@fynd-design-engineering/fynd-one-v2 3.4.49 → 3.4.50
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";(()=>{})();
|
|
1
|
+
"use strict";(()=>{document.addEventListener("DOMContentLoaded",()=>{let a=window.gsap,p=window.ScrollTrigger;p&&a.registerPlugin(p);let S=document.querySelectorAll("[entity-error-connector]"),h=document.querySelectorAll("[entity-success-connector]"),g=document.querySelectorAll("[entity-name]"),E=document.querySelector("[playbook='store']"),M=document.querySelector("[playbook='store-foundation']"),b=document.querySelector("[playbook='foundation-base']"),T=document.querySelector("[playbook='spacer']"),y=document.querySelector("[playbook='title-1']"),l=document.querySelector("[playbook='title-2']"),u=document.querySelector("[playbook='title-3']"),w=[];g.forEach(t=>{let r=t.getAttribute("entity-name");if(!r)return;let o=Array.from(h).find(n=>n.getAttribute("entity-success-connector")===r),e=Array.from(S).find(n=>n.getAttribute("entity-error-connector")===r);if(o){let n=o.querySelector("path"),c=e?.querySelector("path")||null,s=Array.from(t.querySelectorAll('[entity-state="success"]')),A=Array.from(t.querySelectorAll('[entity-state="error"]'));n&&w.push({name:t,connector:o,path:n,errorConnector:e||null,errorPath:c,successState:s[0]||null,successStates:s,errorStates:A,id:r})}});let f=w.sort(()=>Math.random()-.5);a.set([...S,...h],{opacity:0}),a.set(E,{scale:1.5}),a.set(M,{scale:1.5}),a.set(b,{opacity:0}),a.set(g,{opacity:0,scale:.5}),a.set(T,{height:"100px"}),y&&l&&a.set(l,{opacity:0,filter:"blur(10px)"}),u&&a.set(u,{opacity:0,filter:"blur(10px)"}),f.forEach(({path:t,errorPath:r,successStates:o,errorStates:e})=>{let n=t.getTotalLength();a.set(t,{strokeDasharray:n,strokeDashoffset:n}),r&&a.set(r,{opacity:0}),o.forEach(c=>a.set(c,{opacity:0})),e.forEach(c=>a.set(c,{opacity:0}))});let i=a.timeline({scrollTrigger:{trigger:"#scroll",start:"top top",end:"+=3000vh",scrub:1.5,pin:!0}});i.to([E,M],{scale:1,duration:.8,ease:"power2.out"}).to(T,{height:"0px",duration:.8,ease:"power2.out"},"<").to(b,{opacity:1,duration:.2,ease:"power2.out"},"-=0.1").set(h,{opacity:1}),f.forEach((t,r)=>{let o=r===0?"-=0.1":"-=0.08";i.to(t.path,{strokeDashoffset:0,duration:.3,ease:"power2.out"},o).to(t.name,{opacity:1,scale:1,duration:.1,ease:"power2.out"},"-=0.05"),t.successStates.length>0&&i.to(t.successStates,{opacity:1,duration:.1,ease:"power2.out"},"-=0.05")}),y&&l&&i.to(y,{opacity:0,filter:"blur(10px)",duration:.3,ease:"power2.inOut"}).to(l,{opacity:1,filter:"blur(0px)",duration:.3,ease:"power2.inOut"},"-=0.15");let L=f.filter(t=>t.errorConnector&&t.errorPath),H=L.map((t,r)=>({pair:t,index:r})),P=H.length,d=new Set,m=[];for(;d.size<P;){let t=H.filter(({index:s})=>!d.has(s));if(t.length===0)break;let r=Math.min(Math.floor(Math.random()*2)+2,t.length),o=[],e=[...t].sort(()=>Math.random()-.5);for(let s of e){if(o.length>=r)break;o.some(k=>Math.abs(k.index-s.index)===1)||(o.push(s),d.add(s.index))}if(o.length<r)for(let s of e){if(o.length>=r)break;o.includes(s)||(o.push(s),d.add(s.index))}let n=o.map(({pair:s})=>s),c=L.filter(s=>!n.includes(s));m.push({toFail:n,toSucceed:c})}m.forEach((t,r)=>{let o=r===0?"+=0.2":"-=0.1";t.toFail.forEach((e,n)=>{let c=n===0?o:"<";i.to(e.path,{strokeDashoffset:e.path.getTotalLength(),duration:.2,ease:"power2.in"},c).to(e.errorPath,{opacity:1,duration:.2,ease:"power2.out"},"<0.1").set(e.errorConnector,{opacity:1},"<").to(e.successStates,{opacity:0,duration:.15,ease:"power2.in"},"<").to(e.errorStates,{opacity:1,duration:.15,ease:"power2.out"},"<0.1")}),t.toSucceed.forEach((e,n)=>{let c=n===0&&t.toFail.length===0?o:"<";i.to(e.errorPath,{opacity:0,duration:.2,ease:"power2.in"},c).set(e.errorConnector,{opacity:0},"<").to(e.path,{strokeDashoffset:0,duration:.2,ease:"power2.out"},"<0.1").to(e.errorStates,{opacity:0,duration:.15,ease:"power2.in"},"<").to(e.successStates,{opacity:1,duration:.15,ease:"power2.out"},"<0.1")}),r===Math.floor(m.length/2)&&l&&u&&i.to(l,{opacity:0,filter:"blur(10px)",duration:.3,ease:"power2.inOut"},"-=0.1").to(u,{opacity:1,filter:"blur(0px)",duration:.3,ease:"power2.inOut"},"-=0.15")}),p.refresh()});})();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": ["../../bin/live-reload.js"],
|
|
4
|
-
"sourcesContent": ["// Only enable live reload when running on localhost\nif (\n window.location.hostname === \"localhost\" ||\n window.location.hostname === \"127.0.0.1\"\n) {\n new EventSource(`${SERVE_ORIGIN}/esbuild`).addEventListener(\"change\", () =>\n location.reload()\n );\n} else {\n // console.log(\"Live reload disabled: not running on localhost\");\n}\n"],
|
|
5
|
-
"mappings": ";;;AACA,MACE,OAAO,SAAS,aAAa,eAC7B,OAAO,SAAS,aAAa,aAC7B;AACA,QAAI,YAAY,GAAG,uBAAY,UAAU,EAAE;AAAA,MAAiB;AAAA,MAAU,MACpE,SAAS,OAAO;AAAA,IAClB;AAAA,EACF,OAAO;AAAA,EAEP;",
|
|
3
|
+
"sources": ["../../bin/live-reload.js", "../../src/playbook-2026/index.ts"],
|
|
4
|
+
"sourcesContent": ["// Only enable live reload when running on localhost\nif (\n window.location.hostname === \"localhost\" ||\n window.location.hostname === \"127.0.0.1\"\n) {\n new EventSource(`${SERVE_ORIGIN}/esbuild`).addEventListener(\"change\", () =>\n location.reload()\n );\n} else {\n // console.log(\"Live reload disabled: not running on localhost\");\n}\n", "// Initialize on DOM loaded\ndocument.addEventListener('DOMContentLoaded', (): void => {\n\n const gsap: any = (window as any).gsap\n\n const ScrollTrigger = (window as any).ScrollTrigger\n if (ScrollTrigger) {\n gsap.registerPlugin(ScrollTrigger)\n }\n\n // ! Scroll animation starts\n\n const errorConnectors = document.querySelectorAll<HTMLElement>(\"[entity-error-connector]\")\n const successConnectors = document.querySelectorAll<HTMLElement>(\"[entity-success-connector]\")\n const entityNames = document.querySelectorAll<HTMLElement>(\"[entity-name]\")\n const store = document.querySelector<HTMLElement>(\"[playbook='store']\")\n const storeFoundation = document.querySelector<HTMLElement>(\"[playbook='store-foundation']\")\n const foundationBase = document.querySelector<HTMLElement>(\"[playbook='foundation-base']\")\n const spacer = document.querySelector<HTMLElement>(\"[playbook='spacer']\")\n const title1 = document.querySelector<HTMLElement>(\"[playbook='title-1']\")\n const title2 = document.querySelector<HTMLElement>(\"[playbook='title-2']\")\n const title3 = document.querySelector<HTMLElement>(\"[playbook='title-3']\")\n\n // Create pairs based on matching attribute values\n const pairs: Array<{\n name: HTMLElement\n connector: HTMLElement\n path: SVGPathElement\n successState: HTMLElement | null\n errorConnector: HTMLElement | null\n errorPath: SVGPathElement | null\n successStates: HTMLElement[]\n errorStates: HTMLElement[]\n id: string\n }> = []\n\n entityNames.forEach(nameEl => {\n const id = nameEl.getAttribute('entity-name')\n if (!id) return\n\n const matchingSuccessConnector = Array.from(successConnectors).find(\n connector => connector.getAttribute('entity-success-connector') === id\n )\n\n const matchingErrorConnector = Array.from(errorConnectors).find(\n connector => connector.getAttribute('entity-error-connector') === id\n )\n\n if (matchingSuccessConnector) {\n const successPath = matchingSuccessConnector.querySelector<SVGPathElement>('path')\n const errorPath = matchingErrorConnector?.querySelector<SVGPathElement>('path') || null\n\n // Get all success and error state elements within this entity\n const successStates = Array.from(nameEl.querySelectorAll<HTMLElement>('[entity-state=\"success\"]'))\n const errorStates = Array.from(nameEl.querySelectorAll<HTMLElement>('[entity-state=\"error\"]'))\n\n if (successPath) {\n pairs.push({\n name: nameEl,\n connector: matchingSuccessConnector,\n path: successPath,\n errorConnector: matchingErrorConnector || null,\n errorPath,\n successState: successStates[0] || null,\n successStates,\n errorStates,\n id\n })\n }\n }\n })\n\n // Shuffle pairs for random order\n const shuffledPairs = pairs.sort(() => Math.random() - 0.5)\n\n gsap.set([...errorConnectors, ...successConnectors], { opacity: 0 })\n gsap.set(store, { scale: 1.5 })\n gsap.set(storeFoundation, { scale: 1.5 })\n gsap.set(foundationBase, { opacity: 0 })\n gsap.set(entityNames, { opacity: 0, scale: 0.5 })\n gsap.set(spacer, { height: \"100px\" })\n\n // Setup title elements\n if (title1 && title2) {\n gsap.set(title2, { opacity: 0, filter: \"blur(10px)\" })\n }\n if (title3) {\n gsap.set(title3, { opacity: 0, filter: \"blur(10px)\" })\n }\n\n // Setup SVG path drawing animation and state opacity\n shuffledPairs.forEach(({ path, errorPath, successStates, errorStates }) => {\n const length = path.getTotalLength()\n gsap.set(path, {\n strokeDasharray: length,\n strokeDashoffset: length,\n })\n\n // DON'T set strokeDasharray for error paths - preserve the dotted pattern\n // Just set opacity to 0\n if (errorPath) {\n gsap.set(errorPath, { opacity: 0 })\n }\n\n // Set initial states\n successStates.forEach(state => gsap.set(state, { opacity: 0 }))\n errorStates.forEach(state => gsap.set(state, { opacity: 0 }))\n })\n\n const tl = gsap.timeline({\n scrollTrigger: {\n trigger: \"#scroll\",\n start: \"top top\",\n end: \"+=3000vh\",\n scrub: 1.5,\n pin: true,\n // markers: true,\n },\n });\n\n // 1. scale down store + foundation AND animate spacer height\n tl.to([store, storeFoundation], {\n scale: 1,\n duration: 0.8,\n ease: \"power2.out\",\n })\n .to(spacer, {\n height: \"0px\",\n duration: 0.8,\n ease: \"power2.out\",\n }, \"<\")\n\n // 2. foundation base fades slightly overlapping\n .to(\n foundationBase,\n {\n opacity: 1,\n duration: 0.2,\n ease: \"power2.out\",\n },\n \"-=0.1\"\n )\n\n // 3. Make all connectors visible first\n .set(successConnectors, { opacity: 1 })\n\n // 4. Animate each pair in random order: path first, then entity name, then success state\n shuffledPairs.forEach((pair, i) => {\n const startPosition = i === 0 ? \"-=0.1\" : \"-=0.08\"\n\n tl.to(pair.path, {\n strokeDashoffset: 0,\n duration: 0.3,\n ease: \"power2.out\",\n }, startPosition)\n\n .to(pair.name, {\n opacity: 1,\n scale: 1,\n duration: 0.1,\n ease: \"power2.out\",\n }, \"-=0.05\")\n\n if (pair.successStates.length > 0) {\n tl.to(pair.successStates, {\n opacity: 1,\n duration: 0.1,\n ease: \"power2.out\",\n }, \"-=0.05\")\n }\n })\n\n // 5. Simple blur + opacity transition from title-1 to title-2\n if (title1 && title2) {\n tl.to(title1, {\n opacity: 0,\n filter: \"blur(10px)\",\n duration: 0.3,\n ease: \"power2.inOut\",\n })\n .to(title2, {\n opacity: 1,\n filter: \"blur(0px)\",\n duration: 0.3,\n ease: \"power2.inOut\",\n }, \"-=0.15\")\n }\n\n // 6. Create cycling failure/success waves\n // NEW LOGIC: Each entity fails exactly once, nearby ones don't fail together\n const pairsWithErrors = shuffledPairs.filter(p => p.errorConnector && p.errorPath)\n\n // Create indexed pairs to track positions\n const indexedPairs = pairsWithErrors.map((pair, index) => ({ pair, index }))\n const totalPairs = indexedPairs.length\n\n const failedIndices = new Set<number>()\n const waves: Array<{ toFail: typeof pairsWithErrors, toSucceed: typeof pairsWithErrors }> = []\n\n while (failedIndices.size < totalPairs) {\n const available = indexedPairs.filter(({ index }) => !failedIndices.has(index))\n\n if (available.length === 0) break\n\n const toFailCount = Math.min(Math.floor(Math.random() * 2) + 2, available.length) // 2 or 3\n const toFailIndexed: typeof indexedPairs = []\n\n // Shuffle available pairs\n const shuffledAvailable = [...available].sort(() => Math.random() - 0.5)\n\n for (const candidate of shuffledAvailable) {\n if (toFailIndexed.length >= toFailCount) break\n\n // Check if this candidate is not adjacent to already selected ones\n const isAdjacent = toFailIndexed.some(selected =>\n Math.abs(selected.index - candidate.index) === 1\n )\n\n if (!isAdjacent) {\n toFailIndexed.push(candidate)\n failedIndices.add(candidate.index)\n }\n }\n\n // If we couldn't find enough non-adjacent, just add remaining until we hit the count\n if (toFailIndexed.length < toFailCount) {\n for (const candidate of shuffledAvailable) {\n if (toFailIndexed.length >= toFailCount) break\n if (!toFailIndexed.includes(candidate)) {\n toFailIndexed.push(candidate)\n failedIndices.add(candidate.index)\n }\n }\n }\n\n const toFail = toFailIndexed.map(({ pair }) => pair)\n const toSucceed = pairsWithErrors.filter(p => !toFail.includes(p))\n\n waves.push({ toFail, toSucceed })\n }\n\n // Animate each wave\n waves.forEach((wave, waveIndex) => {\n const startPosition = waveIndex === 0 ? \"+=0.2\" : \"-=0.1\"\n\n // Animate failures\n wave.toFail.forEach((pair, pairIndex) => {\n const pairStart = pairIndex === 0 ? startPosition : \"<\"\n\n // Animate success connector path out\n tl.to(pair.path, {\n strokeDashoffset: pair.path.getTotalLength(),\n duration: 0.2,\n ease: \"power2.in\",\n }, pairStart)\n\n // Fade in error connector (with dotted pattern preserved)\n .to(pair.errorPath, {\n opacity: 1,\n duration: 0.2,\n ease: \"power2.out\",\n }, \"<0.1\")\n\n // Make error connector container visible\n .set(pair.errorConnector, { opacity: 1 }, \"<\")\n\n // Fade out success states\n .to(pair.successStates, {\n opacity: 0,\n duration: 0.15,\n ease: \"power2.in\",\n }, \"<\")\n\n // Fade in error states\n .to(pair.errorStates, {\n opacity: 1,\n duration: 0.15,\n ease: \"power2.out\",\n }, \"<0.1\")\n })\n\n // Animate successes (entities going back to success or staying successful)\n wave.toSucceed.forEach((pair, pairIndex) => {\n const pairStart = pairIndex === 0 && wave.toFail.length === 0 ? startPosition : \"<\"\n\n // Fade out error connector\n tl.to(pair.errorPath, {\n opacity: 0,\n duration: 0.2,\n ease: \"power2.in\",\n }, pairStart)\n\n // Hide error connector container\n .set(pair.errorConnector, { opacity: 0 }, \"<\")\n\n // Animate success connector path in\n .to(pair.path, {\n strokeDashoffset: 0,\n duration: 0.2,\n ease: \"power2.out\",\n }, \"<0.1\")\n\n // Fade out error states\n .to(pair.errorStates, {\n opacity: 0,\n duration: 0.15,\n ease: \"power2.in\",\n }, \"<\")\n\n // Fade in success states\n .to(pair.successStates, {\n opacity: 1,\n duration: 0.15,\n ease: \"power2.out\",\n }, \"<0.1\")\n })\n\n // Add simple blur + opacity transition from title-2 to title-3 in the middle of the waves\n if (waveIndex === Math.floor(waves.length / 2) && title2 && title3) {\n tl.to(title2, {\n opacity: 0,\n filter: \"blur(10px)\",\n duration: 0.3,\n ease: \"power2.inOut\",\n }, \"-=0.1\")\n .to(title3, {\n opacity: 1,\n filter: \"blur(0px)\",\n duration: 0.3,\n ease: \"power2.inOut\",\n }, \"-=0.15\")\n }\n })\n\n ScrollTrigger.refresh()\n // ! Scroll animation ends\n\n});"],
|
|
5
|
+
"mappings": ";;;AACA,MACE,OAAO,SAAS,aAAa,eAC7B,OAAO,SAAS,aAAa,aAC7B;AACA,QAAI,YAAY,GAAG,uBAAY,UAAU,EAAE;AAAA,MAAiB;AAAA,MAAU,MACpE,SAAS,OAAO;AAAA,IAClB;AAAA,EACF,OAAO;AAAA,EAEP;;;ACTA,WAAS,iBAAiB,oBAAoB,MAAY;AAEtD,UAAM,OAAa,OAAe;AAElC,UAAM,gBAAiB,OAAe;AACtC,QAAI,eAAe;AACf,WAAK,eAAe,aAAa;AAAA,IACrC;AAIA,UAAM,kBAAkB,SAAS,iBAA8B,0BAA0B;AACzF,UAAM,oBAAoB,SAAS,iBAA8B,4BAA4B;AAC7F,UAAM,cAAc,SAAS,iBAA8B,eAAe;AAC1E,UAAM,QAAQ,SAAS,cAA2B,oBAAoB;AACtE,UAAM,kBAAkB,SAAS,cAA2B,+BAA+B;AAC3F,UAAM,iBAAiB,SAAS,cAA2B,8BAA8B;AACzF,UAAM,SAAS,SAAS,cAA2B,qBAAqB;AACxE,UAAM,SAAS,SAAS,cAA2B,sBAAsB;AACzE,UAAM,SAAS,SAAS,cAA2B,sBAAsB;AACzE,UAAM,SAAS,SAAS,cAA2B,sBAAsB;AAGzE,UAAM,QAUD,CAAC;AAEN,gBAAY,QAAQ,YAAU;AAC1B,YAAM,KAAK,OAAO,aAAa,aAAa;AAC5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AM,cAAc;AACxC,cAAM,YAAY,cAAc,KAAK,KAAK,OAAO,WAAW,IAAI,gBAAgB;AAGhF,WAAG,GAAG,KAAK,WAAW;AAAA,UAClB,SAAS;AAAA,UACT,UAAU;AAAA,UACV,MAAM;AAAA,QACV,GAAG,SAAS,EAGP,IAAI,KAAK,gBAAgB,EAAE,SAAS,EAAE,GAAG,GAAG,EAG5C,GAAG,KAAK,MAAM;AAAA,UACX,kBAAkB;AAAA,UAClB,UAAU;AAAA,UACV,MAAM;AAAA,QACV,GAAG,MAAM,EAGR,GAAG,KAAK,aAAa;AAAA,UAClB,SAAS;AAAA,UACT,UAAU;AAAA,UACV,MAAM;AAAA,QACV,GAAG,GAAG,EAGL,GAAG,KAAK,eAAe;AAAA,UACpB,SAAS;AAAA,UACT,UAAU;AAAA,UACV,MAAM;AAAA,QACV,GAAG,MAAM;AAAA,MACjB,CAAC;AAGD,UAAI,cAAc,KAAK,MAAM,MAAM,SAAS,CAAC,KAAK,UAAU,QAAQ;AAChE,WAAG,GAAG,QAAQ;AAAA,UACV,SAAS;AAAA,UACT,QAAQ;AAAA,UACR,UAAU;AAAA,UACV,MAAM;AAAA,QACV,GAAG,OAAO,EACL,GAAG,QAAQ;AAAA,UACR,SAAS;AAAA,UACT,QAAQ;AAAA,UACR,UAAU;AAAA,UACV,MAAM;AAAA,QACV,GAAG,QAAQ;AAAA,MACnB;AAAA,IACJ,CAAC;AAED,kBAAc,QAAQ;AAAA,EAG1B,CAAC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
[entity-state=error],[entity-state=success],[entity-error-connector]{opacity:0}[entity-success-connector]{opacity:1}[connector-wrapper]{opacity:0}#scroll{height:100vh}[entity-error-connector],[entity-success-connector],[entity-name],[playbook=foundation-base]{opacity:0}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": [],
|
|
4
|
-
"sourcesContent": [],
|
|
5
|
-
"mappings": "",
|
|
3
|
+
"sources": ["../../src/playbook-2026/styles.css"],
|
|
4
|
+
"sourcesContent": ["[entity-state=\"error\"] {\n opacity: 0;\n}\n\n[entity-state=\"success\"] {\n opacity: 0;\n}\n\n[entity-error-connector] {\n opacity: 0;\n}\n\n[entity-success-connector] {\n opacity: 1;\n}\n\n[connector-wrapper] {\n opacity: 0;\n}\n\n#scroll {\n height: 100vh;\n}\n\n/* #scroll {\n position: relative;\n}\n\n.playbook_sticky-block {\n position: sticky;\n top: 0;\n} */\n\n[entity-error-connector] {\n opacity: 0;\n}\n\n[entity-success-connector] {\n opacity: 0;\n}\n\n[entity-name] {\n opacity: 0;\n}\n\n[playbook='foundation-base'] {\n opacity: 0;\n}"],
|
|
5
|
+
"mappings": ";AAAA,CAAC;AACG,WAAS;AACb;AAEA,CAAC;AACG,WAAS;AACb;AAEA,CAAC;AACG,WAAS;AACb;AAEA,CAAC;AACG,WAAS;AACb;AAEA,CAAC;AACG,WAAS;AACb;AAEA,CAAC;AACG,UAAQ;AACZ;AAWA,CAAC;AACG,WAAS;AACb;AAEA,CAAC;AACG,WAAS;AACb;AAEA,CAAC;AACG,WAAS;AACb;AAEA,CAAC;AACG,WAAS;AACb;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../bin/live-reload.js", "../../src/posthog-and-ga/adtracking-general.ts", "../../src/posthog-and-ga/meta-tracking.ts", "../../src/posthog-and-ga/main.ts"],
|
|
4
|
-
"sourcesContent": ["// Only enable live reload when running on localhost\nif (\n window.location.hostname === \"localhost\" ||\n window.location.hostname === \"127.0.0.1\"\n) {\n new EventSource(`${SERVE_ORIGIN}/esbuild`).addEventListener(\"change\", () =>\n location.reload()\n );\n} else {\n // console.log(\"Live reload disabled: not running on localhost\");\n}\n", "// adTracking.general.ts \u2014 General ad events for paid traffic (utm_medium=cpc|ads)\n\ndeclare global {\n interface Window {\n trackEvent: (eventName: string, properties?: any) => void;\n validationPassed?: boolean;\n __adsTrackingInitializedGeneral?: boolean;\n }\n }\n \n const getSearchParam = (name: string): string | null => {\n const v = new URLSearchParams(window.location.search).get(name);\n return v ? v.trim() : null;\n };\n \n const isAdTraffic = (): boolean => {\n const medium = getSearchParam(\"utm_medium\")?.toLowerCase();\n return medium === \"cpc\" || medium === \"ads\";\n };\n \n const AD_EVENT_PREFIX = \"fynd_website_ad.\";\n const makeEvent = (suffix: string) => `${AD_EVENT_PREFIX}${suffix}`;\n \n // helper: find nearest form and get a friendly name\n const getParentFormName = (element: HTMLElement): string | null => {\n const parentForm = element.closest(\"form\") as HTMLFormElement | null;\n if (!parentForm) return null;\n return (\n parentForm.getAttribute(\"data-name\") ||\n parentForm.getAttribute(\"name\") ||\n parentForm.id ||\n null\n );\n };\n \n /**\n * Initialize general ads tracking.\n * Fires only when utm_medium is \"cpc\" or \"ads\".\n * Adds `fynd_website.current_page` = current page path.\n */\n export const initGeneralAdsTracking = () => {\n if (window.__adsTrackingInitializedGeneral) return;\n if (!isAdTraffic()) return;\n \n window.__adsTrackingInitializedGeneral = true;\n \n const baseProps: Record<string, any> = {\n \"fynd_website.current_page\": window.location.pathname,\n };\n \n const emit = (suffix: string, props?: Record<string, any>) => {\n const name = makeEvent(suffix);\n window.trackEvent?.(name, { ...baseProps, ...(props || {}) });\n };\n \n document.addEventListener(\"DOMContentLoaded\", () => {\n // Buttons\n document.querySelectorAll('[data-ph=\"sign-up\"]').forEach((btn) =>\n btn.addEventListener(\"click\", () => emit(\"sign_up.clicked\"))\n );\n document.querySelectorAll('[data-ph=\"sign-in\"]').forEach((btn) =>\n btn.addEventListener(\"click\", () => emit(\"sign_in.clicked\"))\n );\n document.querySelectorAll('[data-ph=\"book-a-demo\"]').forEach((btn) =>\n btn.addEventListener(\"click\", () => emit(\"book_a_demo.clicked\"))\n );\n \n // Form started\n const formFields = document.querySelectorAll<HTMLElement>(\"[ph-form-field]\");\n const triggeredForms = new Set<string>();\n \n const handleFormStarted = function (this: HTMLElement) {\n const formName = getParentFormName(this) || \"unknown-form\";\n if (!triggeredForms.has(formName)) {\n triggeredForms.add(formName);\n emit(\"form.started\", { started_form: formName });\n }\n };\n \n formFields.forEach((field) => {\n const tag = field.tagName.toLowerCase();\n const type = (field as HTMLInputElement).type?.toLowerCase();\n \n if (!(tag === \"button\" || (tag === \"input\" && type === \"submit\"))) {\n field.addEventListener(\"focus\", handleFormStarted);\n }\n if (tag === \"button\" || (tag === \"input\" && type === \"submit\")) {\n field.addEventListener(\"click\", handleFormStarted);\n } else if (tag === \"select\") {\n field.addEventListener(\"change\", handleFormStarted);\n } else {\n field.addEventListener(\"input\", handleFormStarted);\n }\n });\n \n // Form submitted\n document.querySelectorAll('[type=\"submit\"]').forEach((button) => {\n button.addEventListener(\"click\", function (this: HTMLElement) {\n const formName = getParentFormName(this);\n setTimeout(() => {\n if (window.validationPassed === true) {\n const props = formName ? { submitted_form: formName } : {};\n emit(\"form.submitted\", props);\n }\n }, 10);\n });\n });\n });\n };", "// meta-tracking.ts \u2014 Meta Pixel integration (standards-compliant) for Fynd website\n// - Initializes Meta Pixel (fbq) with Advanced Matching (when available)\n// - Mirrors your existing window.trackEvent() calls to Meta events\n// - Maps Fynd events -> Meta standard/custom events for better optimization\n// - Adds SPA PageView handling + eventID generation for future CAPI dedup\n// - Safe to import once anywhere in your app bootstrap\n\nimport { UserJourney } from \"../utils/types/user-journey\";\n\n// ---------- Config ----------\nconst META_PIXEL_ID = \"2741377816069290\";\n\ntype AdvancedUser = {\n email?: string;\n phone?: string;\n first_name?: string;\n last_name?: string;\n city?: string;\n state?: string;\n zip?: string;\n country?: string;\n external_id?: string;\n};\n\ntype InitOptions = {\n /**\n * If true, attempts to pull user info from window.getUserJourney/sessionStorage\n * and pass as Advanced Matching data (improves match rate for retargeting).\n */\n enableAdvancedMatching?: boolean;\n\n /**\n * If true, listens for SPA route changes and fires PageView on history changes.\n * Set true if you use a client-side router.\n */\n enableSpaPageViews?: boolean;\n\n /**\n * Optional predicate: return false to block Meta calls until consent is granted.\n * Example: () => window.__ad_consent === 'granted'\n */\n hasConsent?: () => boolean;\n};\n\n// ---------- fbq bootstrap ----------\ndeclare global {\n interface Window {\n fbq?: (...args: any[]) => void;\n _fbq?: any;\n trackEvent: (eventName: string, properties?: any) => void;\n getUserJourney: () => UserJourney | null;\n }\n}\n\nfunction loadMetaPixel(): void {\n if (typeof window === \"undefined\") return;\n if (window.fbq) return;\n\n (function (f: any, b: any, e: any, v: any, n?: any, t?: any, s?: any) {\n if (f.fbq) return;\n n = f.fbq = function () {\n (n as any).callMethod ? (n as any).callMethod.apply(n, arguments) : (n as any).queue.push(arguments);\n };\n if (!f._fbq) f._fbq = n;\n (n as any).push = (n as any);\n (n as any).loaded = true;\n (n as any).version = \"2.0\";\n (n as any).queue = [];\n t = b.createElement(e);\n t.async = true;\n t.src = \"https://connect.facebook.net/en_US/fbevents.js\";\n s = b.getElementsByTagName(e)[0];\n s.parentNode!.insertBefore(t, s);\n })(window, document, \"script\", undefined);\n}\n\n// ---------- Advanced Matching helpers ----------\nfunction getAdvancedUserFromJourney(): AdvancedUser | null {\n try {\n let journey: any = null;\n if (typeof window.getUserJourney === \"function\") {\n journey = window.getUserJourney();\n }\n if (!journey) {\n const stored = sessionStorage.getItem(\"userJourney\");\n if (stored) journey = JSON.parse(stored);\n }\n\n const u: AdvancedUser = {};\n const fd = journey?.formDetails;\n if (fd?.email) u.email = fd.email;\n if (fd?.phone) u.phone = fd.phone;\n if (fd?.firstName) u.first_name = fd.firstName;\n if (fd?.lastName) u.last_name = fd.lastName;\n if (fd?.city) u.city = fd.city;\n if (fd?.state) u.state = fd.state;\n if (fd?.zip) u.zip = fd.zip;\n if (journey?.country) u.country = journey.country;\n if (journey?.userId) u.external_id = String(journey.userId);\n\n // Remove empties\n Object.keys(u).forEach((k) => {\n const key = k as keyof AdvancedUser;\n if (!u[key]) delete u[key];\n });\n\n return Object.keys(u).length ? u : null;\n } catch {\n return null;\n }\n}\n\nfunction getAdvancedUserFromProps(props?: any): AdvancedUser | null {\n if (!props) return null;\n const u: AdvancedUser = {};\n if (props[\"fynd_website.form_email\"]) u.email = props[\"fynd_website.form_email\"];\n if (props[\"fynd_website.form_phone\"]) u.phone = props[\"fynd_website.form_phone\"];\n if (props[\"fynd_website.form_first_name\"]) u.first_name = props[\"fynd_website.form_first_name\"];\n if (props[\"fynd_website.form_last_name\"]) u.last_name = props[\"fynd_website.form_last_name\"];\n if (props.city) u.city = props.city;\n if (props.state) u.state = props.state;\n if (props.zip) u.zip = props.zip;\n if (props.country) u.country = props.country;\n if (props.external_id) u.external_id = props.external_id;\n\n Object.keys(u).forEach((k) => {\n const key = k as keyof AdvancedUser;\n if (!u[key]) delete u[key];\n });\n\n return Object.keys(u).length ? u : null;\n}\n\n// ---------- Utility ----------\nfunction genEventId(prefix: string = \"evt\"): string {\n return `${prefix}_${Date.now()}_${Math.random().toString(36).slice(2)}`;\n}\n\nfunction safeFbq(...args: any[]): void {\n if (!window.fbq) return;\n window.fbq(...args);\n}\n\n// ---------- Core mapping (Fynd -> Meta) ----------\n/**\n * Maps your event names to Meta\u2019s recommended events.\n * Returns {name, params, options} ready for fbq('track'|'trackCustom', ...)\n */\nfunction mapFyndToMeta(eventName: string, properties?: any): {\n type: \"track\" | \"trackCustom\";\n name: string;\n params?: Record<string, any>;\n options?: { eventID?: string };\n userData?: AdvancedUser | null;\n} | null {\n const props = properties || {};\n // Try to extract user for Advanced Matching\n const userData = getAdvancedUserFromProps(props) || getAdvancedUserFromJourney();\n\n switch (eventName) {\n case \"fynd_website.form.submitted\": {\n // Choose 'Lead' as default (use CompleteRegistration for account creation flows)\n const eventID = props.event_id || genEventId(\"lead\");\n const formName = props.submitted_form || props[\"fynd_website.form_name\"] || \"unknown_form\";\n return {\n type: \"track\",\n name: \"Lead\",\n params: {\n form_id: props[\"fynd_website.form_id\"] || undefined,\n form_name: formName,\n value: 0,\n currency: \"INR\",\n },\n options: { eventID },\n userData,\n };\n }\n\n case \"fynd_website.sign_up.clicked\":\n return { type: \"trackCustom\", name: \"SignUpClick\", params: {}, userData };\n\n case \"fynd_website.sign_in.clicked\":\n return { type: \"trackCustom\", name: \"SignInClick\", params: {}, userData };\n\n case \"fynd_website.book_a_demo.clicked\":\n return {\n type: \"trackCustom\",\n name: \"BookDemoClick\",\n params: {\n source_page: props?.[\"fynd_website.source_page\"],\n },\n userData,\n };\n\n case \"fynd_website.form.started\":\n return {\n type: \"trackCustom\",\n name: \"FormStarted\",\n params: {\n form_id: props?.[\"fynd_website.form_id\"] || undefined,\n form_name: props?.[\"fynd_website.form_name\"] || undefined,\n },\n userData,\n };\n\n // Page lifecycle\n case \"fynd_website.page.loaded\":\n return { type: \"track\", name: \"PageView\", params: {}, userData };\n\n default:\n // Ignore other events by default; you can add more mappings here\n return null;\n }\n}\n\n// ---------- Public API ----------\n/**\n * Initialize Meta tracking and tee into window.trackEvent so existing code just works.\n */\nexport function initMetaTracking(options: InitOptions = {}): void {\n const { enableAdvancedMatching = true, enableSpaPageViews = true, hasConsent } = options;\n\n // 1) Load fbq\n loadMetaPixel();\n\n // 2) Init with/without Advanced Matching\n const initialUser = enableAdvancedMatching ? getAdvancedUserFromJourney() : null;\n if (hasConsent && !hasConsent()) {\n // Defer init until consent flips to true (lightweight poller)\n const iv = window.setInterval(() => {\n if (hasConsent()) {\n window.clearInterval(iv);\n safeFbq(\"init\", META_PIXEL_ID, initialUser || {});\n postInit(enableSpaPageViews);\n }\n }, 250);\n } else {\n safeFbq(\"init\", META_PIXEL_ID, initialUser || {});\n postInit(enableSpaPageViews);\n }\n\n // 3) Tee into window.trackEvent to mirror to Meta\n const originalTrackEvent = window.trackEvent;\n window.trackEvent = function (eventName: string, properties?: any): void {\n try {\n // First, call original (so PostHog/GA remain unchanged)\n if (typeof originalTrackEvent === \"function\") {\n originalTrackEvent.call(window, eventName, properties);\n }\n // Then forward to Meta (respect consent if provided)\n if (hasConsent && !hasConsent()) return;\n\n const mapped = mapFyndToMeta(eventName, properties);\n if (!mapped) return;\n\n // Pass Advanced Matching userData by re-calling init? No\u2014Meta supports user data on event via fbq 2nd arg in init or as 'init' options.\n // For events, best practice is to include user data via \"Advanced Matching\" settings or CAPI.\n // Here we rely on init advanced matching; optionally, you can include userData with custom calls via setUserProperties (not available on Pixel).\n if (mapped.type === \"track\") {\n if (mapped.options?.eventID) {\n safeFbq(\"track\", mapped.name, mapped.params || {}, { eventID: mapped.options.eventID });\n } else {\n safeFbq(\"track\", mapped.name, mapped.params || {});\n }\n } else {\n // trackCustom\n // We cannot pass user data as a separate arg here; advanced matching should be handled at init or via CAPI.\n safeFbq(\"trackCustom\", mapped.name, mapped.params || {});\n }\n } catch (e) {\n // swallow to avoid interrupting primary trackers\n // eslint-disable-next-line no-console\n console.warn(\"Meta tracking error:\", e);\n }\n };\n}\n\n/**\n * Manually send a CompleteRegistration when your \u201Cform submitted\u201D is actually an account creation.\n * Reuse the same eventID for later CAPI dedup if you mirror server-side.\n */\nexport function trackCompleteRegistration(registrationMethod: string = \"email\", eventID?: string, props?: any) {\n const options = eventID ? { eventID } : undefined;\n // Respect optional consent gate if your app uses one:\n // if (window.__ad_consent !== 'granted') return;\n safeFbq(\"track\", \"CompleteRegistration\", { registration_method: registrationMethod }, options);\n}\n\n/**\n * Optional helper if you want to send a Lead directly (outside of window.trackEvent).\n */\nexport function trackLead(formId?: string, formName?: string, valueINR: number = 0, eventID?: string) {\n const params: Record<string, any> = { value: valueINR, currency: \"INR\" };\n if (formId) params.form_id = formId;\n if (formName) params.form_name = formName;\n const options = { eventID: eventID || genEventId(\"lead\") };\n safeFbq(\"track\", \"Lead\", params, options);\n}\n\n// ---------- Internal: post init tasks ----------\nfunction postInit(enableSpaPageViews: boolean) {\n // Fire initial PageView (Meta does this automatically when you call fbq('track','PageView')\u2014we mimic GA's $pageview behavior)\n safeFbq(\"track\", \"PageView\");\n\n if (enableSpaPageViews) {\n // Hook into history API to catch virtual route changes\n const origPushState = history.pushState;\n const origReplaceState = history.replaceState;\n\n function onLocationChange() {\n // Delay slightly to allow DOM/router to settle\n setTimeout(() => safeFbq(\"track\", \"PageView\"), 0);\n }\n\n history.pushState = function (...args: any[]) {\n const ret = origPushState.apply(this, args as any);\n onLocationChange();\n return ret;\n };\n\n history.replaceState = function (...args: any[]) {\n const ret = origReplaceState.apply(this, args as any);\n onLocationChange();\n return ret;\n };\n\n window.addEventListener(\"popstate\", onLocationChange);\n }\n}\n\n// ---------- (Optional) noscript pixel for non-JS fallbacks ----------\n// In your HTML <noscript>, add:\n// <img height=\"1\" width=\"1\" style=\"display:none\"\n// src=\"https://www.facebook.com/tr?id=2741377816069290&ev=PageView&noscript=1\"/>", "// main.ts \u2014 Core tracking: PostHog + GA (GTM dataLayer) + optional ad tracking bootstrap\nimport { FormDetails, UserJourney } from \"../utils/types/user-journey\";\nimport { AdConfig, initAdsTracking } from \"./adTracking\";\nimport { initGeneralAdsTracking } from \"./adtracking-general\";\nimport { initMetaTracking } from \"./meta-tracking\";\n\n// ---------- Types ----------\ninterface GTMEvent {\n event: string;\n event_category: string;\n event_label: string;\n form_id?: string;\n form_name?: string;\n form_first_name?: string;\n form_last_name?: string;\n form_email?: string;\n form_phone?: string;\n submitted_form?: string;\n [key: string]: any;\n}\n\ninterface GATrackingProperties {\n form_id?: string;\n form_name?: string;\n form_first_name?: string;\n form_last_name?: string;\n form_email?: string;\n form_phone?: string;\n submitted_form?: string;\n aidata_context?: string;\n aidata_platform?: string;\n aidata_type?: string;\n aidata_detection?: string;\n}\n\ninterface TrackingProperties {\n \"fynd_website.source_page\": string;\n \"fynd_website.product\": string;\n \"fynd_website.device_type\": string;\n \"fynd_website.utm_source\": string;\n \"fynd_website.utm_medium\": string;\n \"fynd_website.utm_campaign\": string;\n \"fynd_website.referrer\": string;\n \"fynd_website.form_id\"?: string;\n \"fynd_website.form_name\"?: string;\n \"fynd_website.form_first_name\"?: string;\n \"fynd_website.form_last_name\"?: string;\n \"fynd_website.form_email\"?: string;\n \"fynd_website.form_phone\"?: string;\n \"fynd_website.journey_total_pages\"?: number;\n \"fynd_website.journey_session_duration\"?: number;\n \"fynd_website.journey_first_page\"?: string;\n \"fynd_website.journey_current_page\"?: string;\n \"fynd_website.journey_device\"?: string;\n \"fynd_website.journey_browser\"?: string;\n \"fynd_website.journey_device_name\"?: string;\n \"fynd_website.journey_origin\"?: string;\n \"fynd_website.journey_touchpoints\"?: any;\n \"fynd_website.journey_touchpoints_count\"?: number;\n \"fynd_website.journey_utm_path\"?: string;\n \"fynd_website.journey_entry_time\"?: string;\n \"fynd_website.journey_exit_time\"?: string;\n \"fynd_website.journey_scroll_depth\"?: number;\n \"fynd_website.aidata_context\"?: string;\n \"fynd_website.aidata_platform\"?: string;\n \"fynd_website.aidata_type\"?: string;\n \"fynd_website.aidata_detection\"?: string;\n submitted_form?: string;\n field_type?: string;\n field_name?: string;\n [key: string]: any;\n}\n\ndeclare global {\n interface Window {\n trackEvent: (eventName: string, properties?: any) => void;\n getPosthogTrackingProperties: () => TrackingProperties;\n getGaTrackingProperties: () => GATrackingProperties;\n validationPassed?: boolean;\n getUserJourney: () => UserJourney | null;\n dataLayer?: GTMEvent[];\n }\n}\n\n// ---------- GA helpers ----------\nconst getGaTrackingProperties = (): GATrackingProperties => {\n const gaProperties: GATrackingProperties = {};\n try {\n let journey: any = null;\n if (typeof (window as any).getUserJourney === \"function\") {\n journey = (window as any).getUserJourney();\n }\n if (!journey) {\n const storedData = localStorage.getItem(\"userJourney\");\n if (storedData) journey = JSON.parse(storedData);\n }\n\n if (journey?.formDetails) {\n const formDetails: FormDetails = journey.formDetails;\n if (formDetails.formId) gaProperties.form_id = formDetails.formId;\n if (formDetails.formName) gaProperties.form_name = formDetails.formName;\n if (formDetails.firstName) gaProperties.form_first_name = formDetails.firstName;\n if (formDetails.lastName) gaProperties.form_last_name = formDetails.lastName;\n if (formDetails.email) gaProperties.form_email = formDetails.email;\n if (formDetails.phone) gaProperties.form_phone = formDetails.phone;\n }\n\n if (journey?.aiData) {\n const aiData = journey.aiData;\n if (aiData.context) gaProperties.aidata_context = aiData.context;\n if (aiData.platform) gaProperties.aidata_platform = aiData.platform;\n if (aiData.type) gaProperties.aidata_type = aiData.type;\n if (aiData.detectionMethod) gaProperties.aidata_detection = aiData.detectionMethod;\n }\n } catch (err) {\n console.warn(\"Error getting user journey data for GA tracking:\", err);\n }\n return gaProperties;\n};\n\n// ---------- PostHog properties ----------\nconst getPosthogTrackingProperties = (): TrackingProperties => {\n const pathname: string = window.location.pathname;\n\n const base: TrackingProperties = {\n \"fynd_website.source_page\": pathname,\n \"fynd_website.product\": \"fynd.com website\",\n \"fynd_website.device_type\": \"Unknown\",\n \"fynd_website.utm_source\": new URLSearchParams(window.location.search).get(\"utm_source\") || \"\",\n \"fynd_website.utm_medium\": new URLSearchParams(window.location.search).get(\"utm_medium\") || \"\",\n \"fynd_website.utm_campaign\": new URLSearchParams(window.location.search).get(\"utm_campaign\") || \"\",\n \"fynd_website.referrer\": document.referrer,\n };\n\n try {\n let journey: any = null;\n if (typeof (window as any).getUserJourney === \"function\") {\n journey = (window as any).getUserJourney();\n }\n if (!journey) {\n const storedData = localStorage.getItem(\"userJourney\");\n if (storedData) journey = JSON.parse(storedData);\n }\n\n if (journey) {\n base[\"fynd_website.journey_touchpoints\"] = journey.userJourney || journey;\n\n if (journey.formDetails) {\n const f: FormDetails = journey.formDetails;\n if (f.formId) base[\"fynd_website.form_id\"] = f.formId;\n if (f.formName) base[\"fynd_website.form_name\"] = f.formName;\n if (f.firstName) base[\"fynd_website.form_first_name\"] = f.firstName;\n if (f.lastName) base[\"fynd_website.form_last_name\"] = f.lastName;\n if (f.email) base[\"fynd_website.form_email\"] = f.email;\n if (f.phone) base[\"fynd_website.form_phone\"] = f.phone;\n }\n\n if (journey.userJourney?.length > 0) {\n base[\"fynd_website.journey_total_pages\"] = journey.userJourney.length;\n base[\"fynd_website.journey_touchpoints_count\"] = journey.userJourney.length;\n base[\"fynd_website.journey_first_page\"] = journey.userJourney[0].page;\n base[\"fynd_website.journey_current_page\"] =\n journey.userJourney[journey.userJourney.length - 1].page;\n\n const firstVisit = new Date(journey.userJourney[0].time);\n const lastVisit = new Date(journey.userJourney[journey.userJourney.length - 1].time);\n base[\"fynd_website.journey_session_duration\"] = Math.floor(\n (lastVisit.getTime() - firstVisit.getTime()) / 1000\n );\n base[\"fynd_website.journey_entry_time\"] = journey.userJourney[0].time;\n base[\"fynd_website.journey_exit_time\"] =\n journey.userJourney[journey.userJourney.length - 1].time;\n }\n\n if (journey.deviceCategory) base[\"fynd_website.device_type\"] = journey.deviceCategory;\n if (journey.browser) base[\"fynd_website.journey_browser\"] = journey.browser;\n if (journey.device) base[\"fynd_website.journey_device\"] = journey.device;\n if (journey.origin) base[\"fynd_website.journey_origin\"] = journey.origin;\n if (journey.utmPath) base[\"fynd_website.journey_utm_path\"] = journey.utmPath;\n if (journey.scrollDepth) base[\"fynd_website.journey_scroll_depth\"] = journey.scrollDepth;\n\n if (journey.aiData) {\n const aiData = journey.aiData;\n if (aiData.context) base[\"fynd_website.aidata_context\"] = aiData.context;\n if (aiData.platform) base[\"fynd_website.aidata_platform\"] = aiData.platform;\n if (aiData.type) base[\"fynd_website.aidata_type\"] = aiData.type;\n if (aiData.detectionMethod) base[\"fynd_website.aidata_detection\"] = aiData.detectionMethod;\n }\n }\n } catch (err) {\n console.warn(\"Error getting user journey data for tracking:\", err);\n }\n\n // Fallback device type\n if (base[\"fynd_website.device_type\"] === \"Unknown\") {\n const ua = navigator.userAgent;\n if (/iPad/.test(ua) || (/Android/.test(ua) && !/Mobile/.test(ua)) || /Tablet/.test(ua)) {\n base[\"fynd_website.device_type\"] = \"Tablet\";\n } else if (/Mobile|iPhone|Android|BlackBerry|Opera Mini|IEMobile|WPDesktop/.test(ua)) {\n base[\"fynd_website.device_type\"] = \"Mobile\";\n } else {\n base[\"fynd_website.device_type\"] = \"Desktop\";\n }\n }\n\n // ---------- UUID from cookie ----------\n try {\n const cookieMatch = document.cookie.match(/(?:^|;\\s*)user-id=([^;]*)/);\n base[\"fynd_website.uuid\"] = cookieMatch ? decodeURIComponent(cookieMatch[1]) : null;\n } catch (err) {\n console.warn(\"Error reading user-id cookie:\", err);\n base[\"fynd_website.uuid\"] = null;\n }\n\n return base;\n};\n\n// ---------- GA send ----------\nconst sendToGA = (eventName: string, gaProps: GATrackingProperties, additionalProps?: any): void => {\n if ((window as any).dataLayer) {\n const eventData: GTMEvent = {\n event: eventName,\n event_category: \"form_interaction\",\n event_label: eventName,\n ...gaProps,\n };\n if (additionalProps?.submitted_form) {\n eventData.submitted_form = additionalProps.submitted_form;\n }\n (window as any).dataLayer.push(eventData);\n } else {\n console.warn(\"dataLayer not available for GA tracking\");\n }\n};\n\n// ---------- Public trackEvent ----------\nconst trackEvent = (eventName: string, properties?: Partial<TrackingProperties>): void => {\n try {\n console.log(\"Event fired:\", eventName, properties);\n const baseProps = getPosthogTrackingProperties();\n const finalProps = properties ? { ...baseProps, ...properties } : baseProps;\n\n if ((window as any).posthog) {\n // Capture the event\n (window as any).posthog.capture(eventName, finalProps);\n\n // If this is a form submission event, set person properties\n if (eventName === \"fynd_website.form.submitted\") {\n try {\n const journey = (window as any).getUserJourney?.() ||\n JSON.parse(localStorage.getItem(\"userJourney\") || \"{}\");\n\n const personProps: { [key: string]: any } = {};\n\n if (journey?.formDetails?.firstName) {\n personProps[\"name\"] = journey.formDetails.firstName;\n }\n if (journey?.formDetails?.email) {\n personProps[\"email\"] = journey.formDetails.email;\n }\n if (journey?.formDetails?.phone) {\n personProps[\"mobile\"] = journey.formDetails.phone;\n }\n\n if (Object.keys(personProps).length > 0) {\n console.log(\"\uD83D\uDCCA PostHog Person Properties - Form Submission:\", personProps);\n (window as any).posthog.setPersonProperties(personProps);\n }\n } catch (err) {\n console.warn(\"Error setting person properties:\", err);\n }\n }\n }\n\n const gaProps = getGaTrackingProperties();\n const hasAIData =\n gaProps.aidata_context || gaProps.aidata_platform || gaProps.aidata_type || gaProps.aidata_detection;\n\n const isFormRelatedEvent =\n eventName.includes(\"form\") ||\n Object.keys(gaProps).length > 0 ||\n properties?.submitted_form ||\n !!hasAIData;\n\n if (isFormRelatedEvent) {\n sendToGA(eventName, gaProps, properties);\n }\n } catch (error) {\n console.error(\"Error tracking event:\", error);\n }\n};\n\n// ---------- Shared helpers ----------\nconst getParentFormName = (element: HTMLElement): string | null => {\n const parentForm = element.closest(\"form\") as HTMLFormElement | null;\n if (!parentForm) return null;\n return (\n parentForm.getAttribute(\"data-name\") ||\n parentForm.getAttribute(\"name\") ||\n parentForm.id ||\n null\n );\n};\n\n// ---------- Page lifecycle ----------\ndocument.addEventListener(\"DOMContentLoaded\", () => {\n const props = getPosthogTrackingProperties();\n if ((window as any).posthog) {\n (window as any).posthog.capture(\"$pageview\", props);\n }\n});\n\nwindow.addEventListener(\"load\", () => {\n trackEvent(\"fynd_website.page.loaded\");\n});\n\n// ---------- Base site interactions ----------\ndocument.addEventListener(\"DOMContentLoaded\", () => {\n const signUpButtons = document.querySelectorAll('[data-ph=\"sign-up\"]');\n const signInButtons = document.querySelectorAll('[data-ph=\"sign-in\"]');\n const scrollToFormButtons = document.querySelectorAll('[href=\"#footer-form\"]');\n const bookADemoButtons = document.querySelectorAll('[data-ph=\"book-a-demo\"]');\n const callButtons = document.querySelectorAll('[data-ph=\"call\"]');\n const submitButtons = document.querySelectorAll('[type=\"submit\"]');\n\n submitButtons.forEach((button: Element) => {\n button.addEventListener(\"click\", function (this: HTMLElement): void {\n const formName = getParentFormName(this);\n setTimeout(() => {\n if (window.validationPassed === true) {\n const additionalProps = formName ? { submitted_form: formName } : {};\n trackEvent(\"fynd_website.form.submitted\", additionalProps);\n }\n }, 10);\n });\n });\n\n signUpButtons.forEach((button: Element) => {\n button.addEventListener(\"click\", () => trackEvent(\"fynd_website.sign_up.clicked\"));\n });\n\n signInButtons.forEach((button: Element) => {\n button.addEventListener(\"click\", () => trackEvent(\"fynd_website.sign_in.clicked\"));\n });\n\n scrollToFormButtons.forEach((button: Element) => {\n button.addEventListener(\"click\", () => trackEvent(\"fynd_website.scroll_to_form.clicked\"));\n });\n\n bookADemoButtons.forEach((button: Element) => {\n button.addEventListener(\"click\", () => trackEvent(\"fynd_website.book_a_demo.clicked\"));\n });\n\n callButtons.forEach((button: Element) => {\n button.addEventListener(\"click\", () => trackEvent(\"fynd_website.call.clicked\"));\n });\n\n // Form started\n const formFields = document.querySelectorAll<HTMLElement>(\"[ph-form-field]\");\n const triggeredForms = new Set<string>();\n\n const handleFormStarted = function (this: HTMLElement): void {\n const formName = getParentFormName(this);\n const formIdentifier = formName || \"unknown-form\";\n if (!triggeredForms.has(formIdentifier)) {\n triggeredForms.add(formIdentifier);\n trackEvent(\"fynd_website.form.started\");\n }\n };\n\n formFields.forEach((field) => {\n const tagName = field.tagName.toLowerCase();\n const inputType = (field as HTMLInputElement).type?.toLowerCase();\n\n if (!(tagName === \"button\" || (tagName === \"input\" && inputType === \"submit\"))) {\n field.addEventListener(\"focus\", handleFormStarted);\n }\n if (tagName === \"button\" || (tagName === \"input\" && inputType === \"submit\")) {\n field.addEventListener(\"click\", handleFormStarted);\n } else if (tagName === \"select\") {\n field.addEventListener(\"change\", handleFormStarted);\n } else {\n field.addEventListener(\"input\", handleFormStarted);\n }\n });\n});\n\n// ---------- Expose globals ----------\nwindow.getPosthogTrackingProperties = getPosthogTrackingProperties;\nwindow.trackEvent = trackEvent;\nwindow.getGaTrackingProperties = getGaTrackingProperties;\n\n// ---------- Optional: bootstrap ad tracking here ----------\n// const AD_CONFIGS: AdConfig[] = [\n// { adPageSlug: \"/solutions/transport-management-system\", adEventExtension: \"tms\", adUTMCampaign: \"tms\", },\n// ];\n// initAdsTracking(AD_CONFIGS);\ninitGeneralAdsTracking();\n\ninitMetaTracking({\n enableAdvancedMatching: true, // pulls user data from your journey store when available\n enableSpaPageViews: true, // fires PageView on virtual navigations\n hasConsent: () => (window as any).__ad_consent === \"granted\" || true, // replace with your consent logic\n});\n\n// ---------- Exports ----------\nexport {\n getPosthogTrackingProperties,\n getGaTrackingProperties,\n trackEvent,\n getParentFormName,\n type TrackingProperties,\n type GATrackingProperties,\n type GTMEvent,\n};"],
|
|
5
|
-
"mappings": ";;;AACA,MACE,OAAO,SAAS,aAAa,eAC7B,OAAO,SAAS,aAAa,aAC7B;AACA,QAAI,YAAY,GAAG,uBAAY,UAAU,EAAE;AAAA,MAAiB;AAAA,MAAU,MACpE,SAAS,OAAO;AAAA,IAClB;AAAA,EACF,OAAO;AAAA,EAEP;;;ACAE,MAAM,iBAAiB,CAAC,SAAgC;AACtD,UAAM,IAAI,IAAI,gBAAgB,OAAO,SAAS,MAAM,EAAE,IAAI,IAAI;AAC9D,WAAO,IAAI,EAAE,KAAK,IAAI;AAAA,EACxB;AAEA,MAAM,cAAc,MAAe;AACjC,UAAM,SAAS,eAAe,YAAY,GAAG,YAAY;AACzD,WAAO,WAAW,SAAS,WAAW;AAAA,EACxC;AAEA,MAAM,kBAAkB;AACxB,MAAM,YAAY,CAAC,WAAmB,GAAG,eAAe,GAAG,MAAM;AAGjE,MAAM,oBAAoB,CAAC,YAAwC;AACjE,UAAM,aAAa,QAAQ,QAAQ,MAAM;AACzC,QAAI,CAAC,WAAY,QAAO;AACxB,WACE,WAAW,aAAa,WAAW,KACnC,WAAW,aAAa,MAAM,KAC9B,WAAW,MACX;AAAA,EAEJ;AAOO,MAAM,yBAAyB,MAAM;AAC1C,QAAI,OAAO,gCAAiC;AAC5C,QAAI,CAAC,YAAY,EAAG;AAEpB,WAAO,kCAAkC;AAEzC,UAAM,YAAiC;AAAA,MACrC,6BAA6B,OAAO,SAAS;AAAA,IAC/C;AAEA,UAAM,OAAO,CAAC,QAAgB,UAAgC;AAC5D,YAAM,OAAO,UAAU,MAAM;AAC7B,aAAO,aAAa,MAAM,EAAE,GAAG,WAAW,GAAI,SAAS,CAAC,EAAG,CAAC;AAAA,IAC9D;AAEA,aAAS,iBAAiB,oBAAoB,M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AAe,iBAAiB,aAAa;AAAA;AAAA,EAClE,CAAC;",
|
|
4
|
+
"sourcesContent": ["// Only enable live reload when running on localhost\nif (\n window.location.hostname === \"localhost\" ||\n window.location.hostname === \"127.0.0.1\"\n) {\n new EventSource(`${SERVE_ORIGIN}/esbuild`).addEventListener(\"change\", () =>\n location.reload()\n );\n} else {\n // console.log(\"Live reload disabled: not running on localhost\");\n}\n", "// adTracking.general.ts \u2014 General ad events for paid traffic (utm_medium=cpc|ads)\n\ndeclare global {\n interface Window {\n trackEvent: (eventName: string, properties?: any) => void;\n validationPassed?: boolean;\n __adsTrackingInitializedGeneral?: boolean;\n }\n }\n \n const getSearchParam = (name: string): string | null => {\n const v = new URLSearchParams(window.location.search).get(name);\n return v ? v.trim() : null;\n };\n \n const isAdTraffic = (): boolean => {\n const medium = getSearchParam(\"utm_medium\")?.toLowerCase();\n return medium === \"cpc\" || medium === \"ads\";\n };\n \n const AD_EVENT_PREFIX = \"fynd_website_ad.\";\n const makeEvent = (suffix: string) => `${AD_EVENT_PREFIX}${suffix}`;\n \n // helper: find nearest form and get a friendly name\n const getParentFormName = (element: HTMLElement): string | null => {\n const parentForm = element.closest(\"form\") as HTMLFormElement | null;\n if (!parentForm) return null;\n return (\n parentForm.getAttribute(\"data-name\") ||\n parentForm.getAttribute(\"name\") ||\n parentForm.id ||\n null\n );\n };\n \n /**\n * Initialize general ads tracking.\n * Fires only when utm_medium is \"cpc\" or \"ads\".\n * Adds `fynd_website.current_page` = current page path.\n */\n export const initGeneralAdsTracking = () => {\n if (window.__adsTrackingInitializedGeneral) return;\n if (!isAdTraffic()) return;\n \n window.__adsTrackingInitializedGeneral = true;\n \n const baseProps: Record<string, any> = {\n \"fynd_website.current_page\": window.location.pathname,\n };\n \n const emit = (suffix: string, props?: Record<string, any>) => {\n const name = makeEvent(suffix);\n window.trackEvent?.(name, { ...baseProps, ...(props || {}) });\n };\n \n document.addEventListener(\"DOMContentLoaded\", () => {\n // Buttons\n document.querySelectorAll('[data-ph=\"sign-up\"]').forEach((btn) =>\n btn.addEventListener(\"click\", () => emit(\"sign_up.clicked\"))\n );\n document.querySelectorAll('[data-ph=\"sign-in\"]').forEach((btn) =>\n btn.addEventListener(\"click\", () => emit(\"sign_in.clicked\"))\n );\n document.querySelectorAll('[data-ph=\"book-a-demo\"]').forEach((btn) =>\n btn.addEventListener(\"click\", () => emit(\"book_a_demo.clicked\"))\n );\n \n // Form started\n const formFields = document.querySelectorAll<HTMLElement>(\"[ph-form-field]\");\n const triggeredForms = new Set<string>();\n \n const handleFormStarted = function (this: HTMLElement) {\n const formName = getParentFormName(this) || \"unknown-form\";\n if (!triggeredForms.has(formName)) {\n triggeredForms.add(formName);\n emit(\"form.started\", { started_form: formName });\n }\n };\n \n formFields.forEach((field) => {\n const tag = field.tagName.toLowerCase();\n const type = (field as HTMLInputElement).type?.toLowerCase();\n \n if (!(tag === \"button\" || (tag === \"input\" && type === \"submit\"))) {\n field.addEventListener(\"focus\", handleFormStarted);\n }\n if (tag === \"button\" || (tag === \"input\" && type === \"submit\")) {\n field.addEventListener(\"click\", handleFormStarted);\n } else if (tag === \"select\") {\n field.addEventListener(\"change\", handleFormStarted);\n } else {\n field.addEventListener(\"input\", handleFormStarted);\n }\n });\n \n // Form submitted\n document.querySelectorAll('[type=\"submit\"]').forEach((button) => {\n button.addEventListener(\"click\", function (this: HTMLElement) {\n const formName = getParentFormName(this);\n setTimeout(() => {\n if (window.validationPassed === true) {\n const props = formName ? { submitted_form: formName } : {};\n emit(\"form.submitted\", props);\n }\n }, 10);\n });\n });\n });\n };", "// meta-tracking.ts \u2014 Meta Pixel integration (standards-compliant) for Fynd website\n// - Initializes Meta Pixel (fbq) with Advanced Matching (when available)\n// - Mirrors your existing window.trackEvent() calls to Meta events\n// - Maps Fynd events -> Meta standard/custom events for better optimization\n// - Adds SPA PageView handling + eventID generation for future CAPI dedup\n// - Safe to import once anywhere in your app bootstrap\n\nimport { UserJourney } from \"../utils/types/user-journey\";\n\n// ---------- Config ----------\nconst META_PIXEL_ID = \"2741377816069290\";\n\ntype AdvancedUser = {\n email?: string;\n phone?: string;\n first_name?: string;\n last_name?: string;\n city?: string;\n state?: string;\n zip?: string;\n country?: string;\n external_id?: string;\n};\n\ntype InitOptions = {\n /**\n * If true, attempts to pull user info from window.getUserJourney/sessionStorage\n * and pass as Advanced Matching data (improves match rate for retargeting).\n */\n enableAdvancedMatching?: boolean;\n\n /**\n * If true, listens for SPA route changes and fires PageView on history changes.\n * Set true if you use a client-side router.\n */\n enableSpaPageViews?: boolean;\n\n /**\n * Optional predicate: return false to block Meta calls until consent is granted.\n * Example: () => window.__ad_consent === 'granted'\n */\n hasConsent?: () => boolean;\n};\n\n// ---------- fbq bootstrap ----------\ndeclare global {\n interface Window {\n fbq?: (...args: any[]) => void;\n _fbq?: any;\n trackEvent: (eventName: string, properties?: any) => void;\n getUserJourney: () => UserJourney | null;\n }\n}\n\nfunction loadMetaPixel(): void {\n if (typeof window === \"undefined\") return;\n if (window.fbq) return;\n\n (function (f: any, b: any, e: any, v: any, n?: any, t?: any, s?: any) {\n if (f.fbq) return;\n n = f.fbq = function () {\n (n as any).callMethod ? (n as any).callMethod.apply(n, arguments) : (n as any).queue.push(arguments);\n };\n if (!f._fbq) f._fbq = n;\n (n as any).push = (n as any);\n (n as any).loaded = true;\n (n as any).version = \"2.0\";\n (n as any).queue = [];\n t = b.createElement(e);\n t.async = true;\n t.src = \"https://connect.facebook.net/en_US/fbevents.js\";\n s = b.getElementsByTagName(e)[0];\n s.parentNode!.insertBefore(t, s);\n })(window, document, \"script\", undefined);\n}\n\n// ---------- Advanced Matching helpers ----------\nfunction getAdvancedUserFromJourney(): AdvancedUser | null {\n try {\n let journey: any = null;\n if (typeof window.getUserJourney === \"function\") {\n journey = window.getUserJourney();\n }\n if (!journey) {\n const stored = sessionStorage.getItem(\"userJourney\");\n if (stored) journey = JSON.parse(stored);\n }\n\n const u: AdvancedUser = {};\n const fd = journey?.formDetails;\n if (fd?.email) u.email = fd.email;\n if (fd?.phone) u.phone = fd.phone;\n if (fd?.firstName) u.first_name = fd.firstName;\n if (fd?.lastName) u.last_name = fd.lastName;\n if (fd?.city) u.city = fd.city;\n if (fd?.state) u.state = fd.state;\n if (fd?.zip) u.zip = fd.zip;\n if (journey?.country) u.country = journey.country;\n if (journey?.userId) u.external_id = String(journey.userId);\n\n // Remove empties\n Object.keys(u).forEach((k) => {\n const key = k as keyof AdvancedUser;\n if (!u[key]) delete u[key];\n });\n\n return Object.keys(u).length ? u : null;\n } catch {\n return null;\n }\n}\n\nfunction getAdvancedUserFromProps(props?: any): AdvancedUser | null {\n if (!props) return null;\n const u: AdvancedUser = {};\n if (props[\"fynd_website.form_email\"]) u.email = props[\"fynd_website.form_email\"];\n if (props[\"fynd_website.form_phone\"]) u.phone = props[\"fynd_website.form_phone\"];\n if (props[\"fynd_website.form_first_name\"]) u.first_name = props[\"fynd_website.form_first_name\"];\n if (props[\"fynd_website.form_last_name\"]) u.last_name = props[\"fynd_website.form_last_name\"];\n if (props.city) u.city = props.city;\n if (props.state) u.state = props.state;\n if (props.zip) u.zip = props.zip;\n if (props.country) u.country = props.country;\n if (props.external_id) u.external_id = props.external_id;\n\n Object.keys(u).forEach((k) => {\n const key = k as keyof AdvancedUser;\n if (!u[key]) delete u[key];\n });\n\n return Object.keys(u).length ? u : null;\n}\n\n// ---------- Utility ----------\nfunction genEventId(prefix: string = \"evt\"): string {\n return `${prefix}_${Date.now()}_${Math.random().toString(36).slice(2)}`;\n}\n\nfunction safeFbq(...args: any[]): void {\n if (!window.fbq) return;\n window.fbq(...args);\n}\n\n// ---------- Core mapping (Fynd -> Meta) ----------\n/**\n * Maps your event names to Meta\u2019s recommended events.\n * Returns {name, params, options} ready for fbq('track'|'trackCustom', ...)\n */\nfunction mapFyndToMeta(eventName: string, properties?: any): {\n type: \"track\" | \"trackCustom\";\n name: string;\n params?: Record<string, any>;\n options?: { eventID?: string };\n userData?: AdvancedUser | null;\n} | null {\n const props = properties || {};\n // Try to extract user for Advanced Matching\n const userData = getAdvancedUserFromProps(props) || getAdvancedUserFromJourney();\n\n switch (eventName) {\n case \"fynd_website.form.submitted\": {\n // Choose 'Lead' as default (use CompleteRegistration for account creation flows)\n const eventID = props.event_id || genEventId(\"lead\");\n const formName = props.submitted_form || props[\"fynd_website.form_name\"] || \"unknown_form\";\n return {\n type: \"track\",\n name: \"Lead\",\n params: {\n form_id: props[\"fynd_website.form_id\"] || undefined,\n form_name: formName,\n value: 0,\n currency: \"INR\",\n },\n options: { eventID },\n userData,\n };\n }\n\n case \"fynd_website.sign_up.clicked\":\n return { type: \"trackCustom\", name: \"SignUpClick\", params: {}, userData };\n\n case \"fynd_website.sign_in.clicked\":\n return { type: \"trackCustom\", name: \"SignInClick\", params: {}, userData };\n\n case \"fynd_website.book_a_demo.clicked\":\n return {\n type: \"trackCustom\",\n name: \"BookDemoClick\",\n params: {\n source_page: props?.[\"fynd_website.source_page\"],\n },\n userData,\n };\n\n case \"fynd_website.form.started\":\n return {\n type: \"trackCustom\",\n name: \"FormStarted\",\n params: {\n form_id: props?.[\"fynd_website.form_id\"] || undefined,\n form_name: props?.[\"fynd_website.form_name\"] || undefined,\n },\n userData,\n };\n\n // Page lifecycle\n case \"fynd_website.page.loaded\":\n return { type: \"track\", name: \"PageView\", params: {}, userData };\n\n default:\n // Ignore other events by default; you can add more mappings here\n return null;\n }\n}\n\n// ---------- Public API ----------\n/**\n * Initialize Meta tracking and tee into window.trackEvent so existing code just works.\n */\nexport function initMetaTracking(options: InitOptions = {}): void {\n const { enableAdvancedMatching = true, enableSpaPageViews = true, hasConsent } = options;\n\n // 1) Load fbq\n loadMetaPixel();\n\n // 2) Init with/without Advanced Matching\n const initialUser = enableAdvancedMatching ? getAdvancedUserFromJourney() : null;\n if (hasConsent && !hasConsent()) {\n // Defer init until consent flips to true (lightweight poller)\n const iv = window.setInterval(() => {\n if (hasConsent()) {\n window.clearInterval(iv);\n safeFbq(\"init\", META_PIXEL_ID, initialUser || {});\n postInit(enableSpaPageViews);\n }\n }, 250);\n } else {\n safeFbq(\"init\", META_PIXEL_ID, initialUser || {});\n postInit(enableSpaPageViews);\n }\n\n // 3) Tee into window.trackEvent to mirror to Meta\n const originalTrackEvent = window.trackEvent;\n window.trackEvent = function (eventName: string, properties?: any): void {\n try {\n // First, call original (so PostHog/GA remain unchanged)\n if (typeof originalTrackEvent === \"function\") {\n originalTrackEvent.call(window, eventName, properties);\n }\n // Then forward to Meta (respect consent if provided)\n if (hasConsent && !hasConsent()) return;\n\n const mapped = mapFyndToMeta(eventName, properties);\n if (!mapped) return;\n\n // Pass Advanced Matching userData by re-calling init? No\u2014Meta supports user data on event via fbq 2nd arg in init or as 'init' options.\n // For events, best practice is to include user data via \"Advanced Matching\" settings or CAPI.\n // Here we rely on init advanced matching; optionally, you can include userData with custom calls via setUserProperties (not available on Pixel).\n if (mapped.type === \"track\") {\n if (mapped.options?.eventID) {\n safeFbq(\"track\", mapped.name, mapped.params || {}, { eventID: mapped.options.eventID });\n } else {\n safeFbq(\"track\", mapped.name, mapped.params || {});\n }\n } else {\n // trackCustom\n // We cannot pass user data as a separate arg here; advanced matching should be handled at init or via CAPI.\n safeFbq(\"trackCustom\", mapped.name, mapped.params || {});\n }\n } catch (e) {\n // swallow to avoid interrupting primary trackers\n // eslint-disable-next-line no-console\n console.warn(\"Meta tracking error:\", e);\n }\n };\n}\n\n/**\n * Manually send a CompleteRegistration when your \u201Cform submitted\u201D is actually an account creation.\n * Reuse the same eventID for later CAPI dedup if you mirror server-side.\n */\nexport function trackCompleteRegistration(registrationMethod: string = \"email\", eventID?: string, props?: any) {\n const options = eventID ? { eventID } : undefined;\n // Respect optional consent gate if your app uses one:\n // if (window.__ad_consent !== 'granted') return;\n safeFbq(\"track\", \"CompleteRegistration\", { registration_method: registrationMethod }, options);\n}\n\n/**\n * Optional helper if you want to send a Lead directly (outside of window.trackEvent).\n */\nexport function trackLead(formId?: string, formName?: string, valueINR: number = 0, eventID?: string) {\n const params: Record<string, any> = { value: valueINR, currency: \"INR\" };\n if (formId) params.form_id = formId;\n if (formName) params.form_name = formName;\n const options = { eventID: eventID || genEventId(\"lead\") };\n safeFbq(\"track\", \"Lead\", params, options);\n}\n\n// ---------- Internal: post init tasks ----------\nfunction postInit(enableSpaPageViews: boolean) {\n // Fire initial PageView (Meta does this automatically when you call fbq('track','PageView')\u2014we mimic GA's $pageview behavior)\n safeFbq(\"track\", \"PageView\");\n\n if (enableSpaPageViews) {\n // Hook into history API to catch virtual route changes\n const origPushState = history.pushState;\n const origReplaceState = history.replaceState;\n\n function onLocationChange() {\n // Delay slightly to allow DOM/router to settle\n setTimeout(() => safeFbq(\"track\", \"PageView\"), 0);\n }\n\n history.pushState = function (...args: any[]) {\n const ret = origPushState.apply(this, args as any);\n onLocationChange();\n return ret;\n };\n\n history.replaceState = function (...args: any[]) {\n const ret = origReplaceState.apply(this, args as any);\n onLocationChange();\n return ret;\n };\n\n window.addEventListener(\"popstate\", onLocationChange);\n }\n}\n\n// ---------- (Optional) noscript pixel for non-JS fallbacks ----------\n// In your HTML <noscript>, add:\n// <img height=\"1\" width=\"1\" style=\"display:none\"\n// src=\"https://www.facebook.com/tr?id=2741377816069290&ev=PageView&noscript=1\"/>", "// main.ts \u2014 Core tracking: PostHog + GA (GTM dataLayer) + optional ad tracking bootstrap\nimport { FormDetails, UserJourney } from \"../utils/types/user-journey\";\nimport { AdConfig, initAdsTracking } from \"./adTracking\";\nimport { initGeneralAdsTracking } from \"./adtracking-general\";\nimport { initMetaTracking } from \"./meta-tracking\";\n\n// ---------- Types ----------\n// hey io hagesd\\\\\\\\wedfifehjr\ninterface GTMEvent {\n event: string;\n event_category: string;\n event_label: string;\n form_id?: string;\n form_name?: string;\n form_first_name?: string;\n form_last_name?: string;\n form_email?: string;\n form_phone?: string;\n submitted_form?: string;\n [key: string]: any;\n}\n\ninterface GATrackingProperties {\n form_id?: string;\n form_name?: string;\n form_first_name?: string;\n form_last_name?: string;\n form_email?: string;\n form_phone?: string;\n submitted_form?: string;\n aidata_context?: string;\n aidata_platform?: string;\n aidata_type?: string;\n aidata_detection?: string;\n}\n\ninterface TrackingProperties {\n \"fynd_website.source_page\": string;\n \"fynd_website.product\": string;\n \"fynd_website.device_type\": string;\n \"fynd_website.utm_source\": string;\n \"fynd_website.utm_medium\": string;\n \"fynd_website.utm_campaign\": string;\n \"fynd_website.referrer\": string;\n \"fynd_website.form_id\"?: string;\n \"fynd_website.form_name\"?: string;\n \"fynd_website.form_first_name\"?: string;\n \"fynd_website.form_last_name\"?: string;\n \"fynd_website.form_email\"?: string;\n \"fynd_website.form_phone\"?: string;\n \"fynd_website.journey_total_pages\"?: number;\n \"fynd_website.journey_session_duration\"?: number;\n \"fynd_website.journey_first_page\"?: string;\n \"fynd_website.journey_current_page\"?: string;\n \"fynd_website.journey_device\"?: string;\n \"fynd_website.journey_browser\"?: string;\n \"fynd_website.journey_device_name\"?: string;\n \"fynd_website.journey_origin\"?: string;\n \"fynd_website.journey_touchpoints\"?: any;\n \"fynd_website.journey_touchpoints_count\"?: number;\n \"fynd_website.journey_utm_path\"?: string;\n \"fynd_website.journey_entry_time\"?: string;\n \"fynd_website.journey_exit_time\"?: string;\n \"fynd_website.journey_scroll_depth\"?: number;\n \"fynd_website.aidata_context\"?: string;\n \"fynd_website.aidata_platform\"?: string;\n \"fynd_website.aidata_type\"?: string;\n \"fynd_website.aidata_detection\"?: string;\n submitted_form?: string;\n field_type?: string;\n field_name?: string;\n [key: string]: any;\n}\n\ndeclare global {\n interface Window {\n trackEvent: (eventName: string, properties?: any) => void;\n getPosthogTrackingProperties: () => TrackingProperties;\n getGaTrackingProperties: () => GATrackingProperties;\n validationPassed?: boolean;\n getUserJourney: () => UserJourney | null;\n dataLayer?: GTMEvent[];\n }\n}\n\n// ---------- GA helpers ----------\nconst getGaTrackingProperties = (): GATrackingProperties => {\n const gaProperties: GATrackingProperties = {};\n try {\n let journey: any = null;\n if (typeof (window as any).getUserJourney === \"function\") {\n journey = (window as any).getUserJourney();\n }\n if (!journey) {\n const storedData = localStorage.getItem(\"userJourney\");\n if (storedData) journey = JSON.parse(storedData);\n }\n\n if (journey?.formDetails) {\n const formDetails: FormDetails = journey.formDetails;\n if (formDetails.formId) gaProperties.form_id = formDetails.formId;\n if (formDetails.formName) gaProperties.form_name = formDetails.formName;\n if (formDetails.firstName) gaProperties.form_first_name = formDetails.firstName;\n if (formDetails.lastName) gaProperties.form_last_name = formDetails.lastName;\n if (formDetails.email) gaProperties.form_email = formDetails.email;\n if (formDetails.phone) gaProperties.form_phone = formDetails.phone;\n }\n\n if (journey?.aiData) {\n const aiData = journey.aiData;\n if (aiData.context) gaProperties.aidata_context = aiData.context;\n if (aiData.platform) gaProperties.aidata_platform = aiData.platform;\n if (aiData.type) gaProperties.aidata_type = aiData.type;\n if (aiData.detectionMethod) gaProperties.aidata_detection = aiData.detectionMethod;\n }\n } catch (err) {\n console.warn(\"Error getting user journey data for GA tracking:\", err);\n }\n return gaProperties;\n};\n\n// ---------- PostHog properties ----------\nconst getPosthogTrackingProperties = (): TrackingProperties => {\n const pathname: string = window.location.pathname;\n\n const base: TrackingProperties = {\n \"fynd_website.source_page\": pathname,\n \"fynd_website.product\": \"fynd.com website\",\n \"fynd_website.device_type\": \"Unknown\",\n \"fynd_website.utm_source\": new URLSearchParams(window.location.search).get(\"utm_source\") || \"\",\n \"fynd_website.utm_medium\": new URLSearchParams(window.location.search).get(\"utm_medium\") || \"\",\n \"fynd_website.utm_campaign\": new URLSearchParams(window.location.search).get(\"utm_campaign\") || \"\",\n \"fynd_website.referrer\": document.referrer,\n };\n\n try {\n let journey: any = null;\n if (typeof (window as any).getUserJourney === \"function\") {\n journey = (window as any).getUserJourney();\n }\n if (!journey) {\n const storedData = localStorage.getItem(\"userJourney\");\n if (storedData) journey = JSON.parse(storedData);\n }\n\n if (journey) {\n base[\"fynd_website.journey_touchpoints\"] = journey.userJourney || journey;\n\n if (journey.formDetails) {\n const f: FormDetails = journey.formDetails;\n if (f.formId) base[\"fynd_website.form_id\"] = f.formId;\n if (f.formName) base[\"fynd_website.form_name\"] = f.formName;\n if (f.firstName) base[\"fynd_website.form_first_name\"] = f.firstName;\n if (f.lastName) base[\"fynd_website.form_last_name\"] = f.lastName;\n if (f.email) base[\"fynd_website.form_email\"] = f.email;\n if (f.phone) base[\"fynd_website.form_phone\"] = f.phone;\n }\n\n if (journey.userJourney?.length > 0) {\n base[\"fynd_website.journey_total_pages\"] = journey.userJourney.length;\n base[\"fynd_website.journey_touchpoints_count\"] = journey.userJourney.length;\n base[\"fynd_website.journey_first_page\"] = journey.userJourney[0].page;\n base[\"fynd_website.journey_current_page\"] =\n journey.userJourney[journey.userJourney.length - 1].page;\n\n const firstVisit = new Date(journey.userJourney[0].time);\n const lastVisit = new Date(journey.userJourney[journey.userJourney.length - 1].time);\n base[\"fynd_website.journey_session_duration\"] = Math.floor(\n (lastVisit.getTime() - firstVisit.getTime()) / 1000\n );\n base[\"fynd_website.journey_entry_time\"] = journey.userJourney[0].time;\n base[\"fynd_website.journey_exit_time\"] =\n journey.userJourney[journey.userJourney.length - 1].time;\n }\n\n if (journey.deviceCategory) base[\"fynd_website.device_type\"] = journey.deviceCategory;\n if (journey.browser) base[\"fynd_website.journey_browser\"] = journey.browser;\n if (journey.device) base[\"fynd_website.journey_device\"] = journey.device;\n if (journey.origin) base[\"fynd_website.journey_origin\"] = journey.origin;\n if (journey.utmPath) base[\"fynd_website.journey_utm_path\"] = journey.utmPath;\n if (journey.scrollDepth) base[\"fynd_website.journey_scroll_depth\"] = journey.scrollDepth;\n\n if (journey.aiData) {\n const aiData = journey.aiData;\n if (aiData.context) base[\"fynd_website.aidata_context\"] = aiData.context;\n if (aiData.platform) base[\"fynd_website.aidata_platform\"] = aiData.platform;\n if (aiData.type) base[\"fynd_website.aidata_type\"] = aiData.type;\n if (aiData.detectionMethod) base[\"fynd_website.aidata_detection\"] = aiData.detectionMethod;\n }\n }\n } catch (err) {\n console.warn(\"Error getting user journey data for tracking:\", err);\n }\n\n // Fallback device type\n if (base[\"fynd_website.device_type\"] === \"Unknown\") {\n const ua = navigator.userAgent;\n if (/iPad/.test(ua) || (/Android/.test(ua) && !/Mobile/.test(ua)) || /Tablet/.test(ua)) {\n base[\"fynd_website.device_type\"] = \"Tablet\";\n } else if (/Mobile|iPhone|Android|BlackBerry|Opera Mini|IEMobile|WPDesktop/.test(ua)) {\n base[\"fynd_website.device_type\"] = \"Mobile\";\n } else {\n base[\"fynd_website.device_type\"] = \"Desktop\";\n }\n }\n\n // ---------- UUID from cookie ----------\n try {\n const cookieMatch = document.cookie.match(/(?:^|;\\s*)user-id=([^;]*)/);\n base[\"fynd_website.uuid\"] = cookieMatch ? decodeURIComponent(cookieMatch[1]) : null;\n } catch (err) {\n console.warn(\"Error reading user-id cookie:\", err);\n base[\"fynd_website.uuid\"] = null;\n }\n\n return base;\n};\n\n// ---------- GA send ----------\nconst sendToGA = (eventName: string, gaProps: GATrackingProperties, additionalProps?: any): void => {\n if ((window as any).dataLayer) {\n const eventData: GTMEvent = {\n event: eventName,\n event_category: \"form_interaction\",\n event_label: eventName,\n ...gaProps,\n };\n if (additionalProps?.submitted_form) {\n eventData.submitted_form = additionalProps.submitted_form;\n }\n (window as any).dataLayer.push(eventData);\n } else {\n console.warn(\"dataLayer not available for GA tracking\");\n }\n};\n\n// ---------- Public trackEvent ----------\nconst trackEvent = (eventName: string, properties?: Partial<TrackingProperties>): void => {\n try {\n console.log(\"Event fired:\", eventName, properties);\n const baseProps = getPosthogTrackingProperties();\n const finalProps = properties ? { ...baseProps, ...properties } : baseProps;\n\n if ((window as any).posthog) {\n // Capture the event\n (window as any).posthog.capture(eventName, finalProps);\n\n // If this is a form submission event, set person properties\n if (eventName === \"fynd_website.form.submitted\") {\n try {\n const journey = (window as any).getUserJourney?.() ||\n JSON.parse(localStorage.getItem(\"userJourney\") || \"{}\");\n\n const personProps: { [key: string]: any } = {};\n\n if (journey?.formDetails?.firstName) {\n personProps[\"name\"] = journey.formDetails.firstName;\n }\n if (journey?.formDetails?.email) {\n personProps[\"email\"] = journey.formDetails.email;\n }\n if (journey?.formDetails?.phone) {\n personProps[\"mobile\"] = journey.formDetails.phone;\n }\n\n if (Object.keys(personProps).length > 0) {\n console.log(\"\uD83D\uDCCA PostHog Person Properties - Form Submission:\", personProps);\n (window as any).posthog.setPersonProperties(personProps);\n }\n } catch (err) {\n console.warn(\"Error setting person properties:\", err);\n }\n }\n }\n\n const gaProps = getGaTrackingProperties();\n const hasAIData =\n gaProps.aidata_context || gaProps.aidata_platform || gaProps.aidata_type || gaProps.aidata_detection;\n\n const isFormRelatedEvent =\n eventName.includes(\"form\") ||\n Object.keys(gaProps).length > 0 ||\n properties?.submitted_form ||\n !!hasAIData;\n\n if (isFormRelatedEvent) {\n sendToGA(eventName, gaProps, properties);\n }\n } catch (error) {\n console.error(\"Error tracking event:\", error);\n }\n};\n\n// ---------- Shared helpers ----------\nconst getParentFormName = (element: HTMLElement): string | null => {\n const parentForm = element.closest(\"form\") as HTMLFormElement | null;\n if (!parentForm) return null;\n return (\n parentForm.getAttribute(\"data-name\") ||\n parentForm.getAttribute(\"name\") ||\n parentForm.id ||\n null\n );\n};\n\n// ---------- Page lifecycle ----------\ndocument.addEventListener(\"DOMContentLoaded\", () => {\n const props = getPosthogTrackingProperties();\n if ((window as any).posthog) {\n (window as any).posthog.capture(\"$pageview\", props);\n }\n});\n\nwindow.addEventListener(\"load\", () => {\n trackEvent(\"fynd_website.page.loaded\");\n});\n\n// ---------- Base site interactions ----------\ndocument.addEventListener(\"DOMContentLoaded\", () => {\n const signUpButtons = document.querySelectorAll('[data-ph=\"sign-up\"]');\n const signInButtons = document.querySelectorAll('[data-ph=\"sign-in\"]');\n const scrollToFormButtons = document.querySelectorAll('[href=\"#footer-form\"]');\n const bookADemoButtons = document.querySelectorAll('[data-ph=\"book-a-demo\"]');\n const callButtons = document.querySelectorAll('[data-ph=\"call\"]');\n const submitButtons = document.querySelectorAll('[type=\"submit\"]');\n\n submitButtons.forEach((button: Element) => {\n button.addEventListener(\"click\", function (this: HTMLElement): void {\n const formName = getParentFormName(this);\n setTimeout(() => {\n if (window.validationPassed === true) {\n const additionalProps = formName ? { submitted_form: formName } : {};\n trackEvent(\"fynd_website.form.submitted\", additionalProps);\n }\n }, 10);\n });\n });\n\n signUpButtons.forEach((button: Element) => {\n button.addEventListener(\"click\", () => trackEvent(\"fynd_website.sign_up.clicked\"));\n });\n\n signInButtons.forEach((button: Element) => {\n button.addEventListener(\"click\", () => trackEvent(\"fynd_website.sign_in.clicked\"));\n });\n\n scrollToFormButtons.forEach((button: Element) => {\n button.addEventListener(\"click\", () => trackEvent(\"fynd_website.scroll_to_form.clicked\"));\n });\n\n bookADemoButtons.forEach((button: Element) => {\n button.addEventListener(\"click\", () => trackEvent(\"fynd_website.book_a_demo.clicked\"));\n });\n\n callButtons.forEach((button: Element) => {\n button.addEventListener(\"click\", () => trackEvent(\"fynd_website.call.clicked\"));\n });\n\n // Form started\n const formFields = document.querySelectorAll<HTMLElement>(\"[ph-form-field]\");\n const triggeredForms = new Set<string>();\n\n const handleFormStarted = function (this: HTMLElement): void {\n const formName = getParentFormName(this);\n const formIdentifier = formName || \"unknown-form\";\n if (!triggeredForms.has(formIdentifier)) {\n triggeredForms.add(formIdentifier);\n trackEvent(\"fynd_website.form.started\");\n }\n };\n\n formFields.forEach((field) => {\n const tagName = field.tagName.toLowerCase();\n const inputType = (field as HTMLInputElement).type?.toLowerCase();\n\n if (!(tagName === \"button\" || (tagName === \"input\" && inputType === \"submit\"))) {\n field.addEventListener(\"focus\", handleFormStarted);\n }\n if (tagName === \"button\" || (tagName === \"input\" && inputType === \"submit\")) {\n field.addEventListener(\"click\", handleFormStarted);\n } else if (tagName === \"select\") {\n field.addEventListener(\"change\", handleFormStarted);\n } else {\n field.addEventListener(\"input\", handleFormStarted);\n }\n });\n});\n\n// ---------- Expose globals ----------\nwindow.getPosthogTrackingProperties = getPosthogTrackingProperties;\nwindow.trackEvent = trackEvent;\nwindow.getGaTrackingProperties = getGaTrackingProperties;\n\n// ---------- Optional: bootstrap ad tracking here ----------\n// const AD_CONFIGS: AdConfig[] = [\n// { adPageSlug: \"/solutions/transport-management-system\", adEventExtension: \"tms\", adUTMCampaign: \"tms\", },\n// ];\n// initAdsTracking(AD_CONFIGS);\ninitGeneralAdsTracking();\n\ninitMetaTracking({\n enableAdvancedMatching: true, // pulls user data from your journey store when available\n enableSpaPageViews: true, // fires PageView on virtual navigations\n hasConsent: () => (window as any).__ad_consent === \"granted\" || true, // replace with your consent logic\n});\n\n// ---------- Exports ----------\nexport {\n getPosthogTrackingProperties,\n getGaTrackingProperties,\n trackEvent,\n getParentFormName,\n type TrackingProperties,\n type GATrackingProperties,\n type GTMEvent,\n};"],
|
|
5
|
+
"mappings": ";;;AACA,MACE,OAAO,SAAS,aAAa,eAC7B,OAAO,SAAS,aAAa,aAC7B;AACA,QAAI,YAAY,GAAG,uBAAY,UAAU,EAAE;AAAA,MAAiB;AAAA,MAAU,MACpE,SAAS,OAAO;AAAA,IAClB;AAAA,EACF,OAAO;AAAA,EAEP;;;ACAE,MAAM,iBAAiB,CAAC,SAAgC;AACtD,UAAM,IAAI,IAAI,gBAAgB,OAAO,SAAS,MAAM,EAAE,IAAI,IAAI;AAC9D,WAAO,IAAI,EAAE,KAAK,IAAI;AAAA,EACxB;AAEA,MAAM,cAAc,MAAe;AACjC,UAAM,SAAS,eAAe,YAAY,GAAG,YAAY;AACzD,WAAO,WAAW,SAAS,WAAW;AAAA,EACxC;AAEA,MAAM,kBAAkB;AACxB,MAAM,YAAY,CAAC,WAAmB,GAAG,eAAe,GAAG,MAAM;AAGjE,MAAM,oBAAoB,CAAC,YAAwC;AACjE,UAAM,aAAa,QAAQ,QAAQ,MAAM;AACzC,QAAI,CAAC,WAAY,QAAO;AACxB,WACE,WAAW,aAAa,WAAW,KACnC,WAAW,aAAa,MAAM,KAC9B,WAAW,MACX;AAAA,EAEJ;AAOO,MAAM,yBAAyB,MAAM;AAC1C,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