@fynd-design-engineering/fynd-one-v2 3.3.69 → 3.4.0
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/flags-DEVAAAR7.webp +0 -0
- package/dist/flags@2x-LAG6ZLTZ.webp +0 -0
- package/dist/form/validation.css +1 -0
- package/dist/form/validation.js +12 -0
- package/dist/global/css/in-page-embed.css +1 -0
- package/dist/global/css/in-project-settings.css +1 -0
- package/dist/globe-TDQQLSUB.webp +0 -0
- package/dist/globe@2x-S5G7N6BJ.webp +0 -0
- package/package.json +2 -1
- package/dist/accordians/dropdown.js.map +0 -7
- package/dist/accordians/index.js.map +0 -7
- package/dist/cms-listing/index.js.map +0 -7
- package/dist/filters/clear-search.js.map +0 -7
- package/dist/filters/konnect.js.map +0 -7
- package/dist/filters/show-count.js.map +0 -7
- package/dist/form/cs-gated-redirection.js.map +0 -7
- package/dist/form/download-file.js.map +0 -7
- package/dist/form/handler.js +0 -1
- package/dist/form/handler.js.map +0 -7
- package/dist/form/phone-validator.js +0 -1
- package/dist/form/phone-validator.js.map +0 -7
- package/dist/global/anchor-scroll.js.map +0 -7
- package/dist/global/console-links.js.map +0 -7
- package/dist/global/contact-popup.js.map +0 -7
- package/dist/global/custom-bg-video.js.map +0 -7
- package/dist/global/loader.js.map +0 -7
- package/dist/global/media-card.js.map +0 -7
- package/dist/global/miscellaneous.js.map +0 -7
- package/dist/global/number-count.js.map +0 -7
- package/dist/global/popup-video.js.map +0 -7
- package/dist/global/style.css.map +0 -7
- package/dist/global/video-card.js.map +0 -7
- package/dist/hacktimus/2025.js.map +0 -7
- package/dist/hacktimus/styles.css.map +0 -7
- package/dist/home/index.js.map +0 -7
- package/dist/marquee/index.js.map +0 -7
- package/dist/marquee/marquee-swiper.js.map +0 -7
- package/dist/navigation/announcement/index.js.map +0 -7
- package/dist/navigation/context-menu/index.js.map +0 -7
- package/dist/navigation/desktop/index.js.map +0 -7
- package/dist/navigation/initialization.js.map +0 -7
- package/dist/navigation/main.js.map +0 -7
- package/dist/navigation/mobile/index.js.map +0 -7
- package/dist/navigation/scroll/index.js.map +0 -7
- package/dist/navigation/secondary-navigation/index.js.map +0 -7
- package/dist/navigation/style.css.map +0 -7
- package/dist/navigation/temp.css.map +0 -7
- package/dist/navigation/theme.css.map +0 -7
- package/dist/others/geolocation.js.map +0 -7
- package/dist/others/hero-aniamtion.js.map +0 -7
- package/dist/others/hero-india-animation-2.js.map +0 -7
- package/dist/others/hero-india-animation.js.map +0 -7
- package/dist/posthog-and-ga/attributes.js.map +0 -7
- package/dist/posthog-and-ga/main.js.map +0 -7
- package/dist/progressive-scroll/index.js.map +0 -7
- package/dist/quick-fix/reload.js.map +0 -7
- package/dist/seo/schema.js.map +0 -7
- package/dist/slider/freescroll.js.map +0 -7
- package/dist/test/sample.js.map +0 -7
- package/dist/testimonials/index.js.map +0 -7
- package/dist/timeline/index.js.map +0 -7
- package/dist/timeline/style.css.map +0 -7
- package/dist/tracking/custom-id.js.map +0 -7
- package/dist/tracking/fill-form-fields.js.map +0 -7
- package/dist/tracking/form-tracker.js.map +0 -7
- package/dist/tracking/page-categories.js.map +0 -7
- package/dist/tracking/user-journey.js.map +0 -7
- package/dist/tracking/utm-links.js.map +0 -7
- package/dist/utils/sample.js.map +0 -7
- package/dist/validations/localhost.js.map +0 -7
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../bin/live-reload.js", "../../src/tracking/user-journey.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", "// userJourney.ts - Enhanced with AI Detection\nimport {\n UTMParameters,\n TouchPoint,\n UserJourney,\n DeviceCategory,\n UTMVisibility,\n JourneyStats,\n FormDetails,\n AIData,\n AIPlatform,\n AIType,\n AIContext,\n AIDetectionMethod\n} from '../utils/types/user-journey';\n\nexport { };\n\n// Strategy 2: Use Latest Platform (Most recent AI influence)\nfunction handleAIDetection_LatestPlatform(existingAIData: AIData, newAIData: AIData): AIData {\n // Always use the most recent AI detection\n if (newAIData.platform !== 'none') {\n return newAIData;\n }\n \n // Keep existing if no new AI detected\n return existingAIData;\n}\n\n// AI Detection Functions\nfunction detectAIPlatform(): AIData {\n const referrerObj = document.referrer;\n const referrer = referrerObj.toLowerCase();\n const currentURL = new URL(window.location.href);\n \n // Extract UTM parameters\n const utmSource = currentURL.searchParams.get('utm_source')?.toLowerCase() || '';\n const utmMedium = currentURL.searchParams.get('utm_medium')?.toLowerCase() || '';\n const utmCampaign = currentURL.searchParams.get('utm_campaign')?.toLowerCase() || '';\n const utmContent = currentURL.searchParams.get('utm_content')?.toLowerCase() || '';\n \n // Combine all sources for detection\n const allSources = `${referrer} ${utmSource} ${utmMedium} ${utmCampaign} ${utmContent}`;\n \n let aiData: AIData = {\n platform: 'none',\n type: 'unknown',\n context: 'unknown',\n confidence: 'low',\n detectionMethod: 'none',\n detectedAt: new Date().toISOString()\n };\n \n // AI Platform Detection with keyword matching\n const aiPlatforms = [\n {\n keywords: ['chatgpt', 'openai', 'chat.openai'],\n platform: 'ChatGPT' as AIPlatform,\n type: 'ai_chat' as AIType,\n context: 'conversational_query' as AIContext,\n confidence: 'high' as const\n },\n {\n keywords: ['perplexity'],\n platform: 'Perplexity' as AIPlatform,\n type: 'ai_search' as AIType,\n context: 'research_query' as AIContext,\n confidence: 'high' as const\n },\n {\n keywords: ['claude', 'anthropic'],\n platform: 'Claude' as AIPlatform,\n type: 'ai_chat' as AIType,\n context: 'conversational_query' as AIContext,\n confidence: 'high' as const\n },\n {\n keywords: ['bing', 'copilot', 'microsoft-copilot'],\n platform: 'Bing_Copilot' as AIPlatform,\n type: 'ai_chat' as AIType,\n context: 'conversational_query' as AIContext,\n confidence: 'medium' as const\n },\n {\n keywords: ['gemini', 'bard', 'google-ai'],\n platform: 'Google_Gemini' as AIPlatform,\n type: 'ai_chat' as AIType,\n context: 'conversational_query' as AIContext,\n confidence: 'high' as const\n },\n {\n keywords: ['you.com', 'you-ai'],\n platform: 'You_AI' as AIPlatform,\n type: 'ai_search' as AIType,\n context: 'search_query' as AIContext,\n confidence: 'medium' as const\n },\n {\n keywords: ['character.ai', 'character'],\n platform: 'Character_AI' as AIPlatform,\n type: 'ai_chat' as AIType,\n context: 'character_interaction' as AIContext,\n confidence: 'high' as const\n },\n {\n keywords: ['poe', 'quora-poe'],\n platform: 'Poe' as AIPlatform,\n type: 'ai_chat' as AIType,\n context: 'conversational_query' as AIContext,\n confidence: 'high' as const\n },\n {\n keywords: ['huggingface', 'hf-chat'],\n platform: 'HuggingFace' as AIPlatform,\n type: 'ai_chat' as AIType,\n context: 'technical_query' as AIContext,\n confidence: 'medium' as const\n },\n {\n keywords: ['replika'],\n platform: 'Replika' as AIPlatform,\n type: 'ai_chat' as AIType,\n context: 'personal_assistant' as AIContext,\n confidence: 'high' as const\n }\n ];\n \n // Check for AI platform matches\n for (const platform of aiPlatforms) {\n const matchedKeyword = platform.keywords.find(keyword => \n allSources.includes(keyword)\n );\n \n if (matchedKeyword) {\n aiData = {\n platform: platform.platform,\n type: platform.type,\n context: platform.context,\n confidence: platform.confidence,\n detectionMethod: getDetectionMethod(matchedKeyword, referrer, utmSource, utmMedium),\n detectedAt: new Date().toISOString()\n };\n break;\n }\n }\n \n // Enhanced detection for specific UTM patterns\n if (aiData.platform === 'none') {\n aiData = detectFromUTMPatterns(utmSource, utmMedium, utmCampaign, utmContent);\n }\n \n return aiData;\n}\n\n// Determine how the AI platform was detected\nfunction getDetectionMethod(matchedKeyword: string, referrer: string, utmSource: string, utmMedium: string): AIDetectionMethod {\n if (referrer.includes(matchedKeyword)) {\n return 'referrer';\n } else if (utmSource.includes(matchedKeyword)) {\n return 'utm_source';\n } else if (utmMedium.includes(matchedKeyword)) {\n return 'utm_medium';\n }\n return 'utm_other';\n}\n\n// Specific UTM pattern detection for AI platforms\nfunction detectFromUTMPatterns(utmSource: string, utmMedium: string, utmCampaign: string, utmContent: string): AIData {\n const aiUTMPatterns = [\n {\n condition: utmMedium.includes('ai') || utmMedium.includes('chat'),\n platform: 'AI_Generic' as AIPlatform,\n type: 'ai_unknown' as AIType,\n context: 'utm_tagged' as AIContext,\n confidence: 'medium' as const\n },\n {\n condition: utmCampaign.includes('ai-assistant') || utmCampaign.includes('chatbot'),\n platform: 'AI_Campaign' as AIPlatform,\n type: 'ai_chat' as AIType,\n context: 'campaign_driven' as AIContext,\n confidence: 'medium' as const\n },\n {\n condition: utmContent.includes('ai-generated') || utmContent.includes('llm'),\n platform: 'AI_Content' as AIPlatform,\n type: 'ai_content' as AIType,\n context: 'content_discovery' as AIContext,\n confidence: 'medium' as const\n }\n ];\n \n for (const pattern of aiUTMPatterns) {\n if (pattern.condition) {\n return {\n platform: pattern.platform,\n type: pattern.type,\n context: pattern.context,\n confidence: pattern.confidence,\n detectionMethod: 'utm_pattern',\n detectedAt: new Date().toISOString()\n };\n }\n }\n \n return {\n platform: 'none',\n type: 'unknown',\n context: 'unknown',\n confidence: 'low',\n detectionMethod: 'none',\n detectedAt: new Date().toISOString()\n };\n}\n\n// AI Journey Analytics Functions\nfunction calculateAIJourneyAnalytics(journey: UserJourney, aiData: AIData): UserJourney['aiJourneyAnalytics'] {\n const isAIUser = aiData.platform !== 'none';\n \n if (!isAIUser) {\n return {\n isAIUser: false,\n aiTouchPoints: 0,\n aiEntryPage: null,\n behaviorPatterns: {\n skipsBranding: false,\n researchIntensive: false,\n quickDecision: false,\n technicalFocus: false\n },\n platformInsights: {\n expectedJourney: 'n/a',\n actualVsPredicted: 'matched',\n platformTypicalBehavior: 'n/a'\n }\n };\n }\n \n const aiEntryPage = journey.userJourney.find(tp => tp.aiContext?.isAIReferral)?.page || journey.userJourney[0]?.page || null;\n const aiTouchPoints = journey.userJourney.filter(tp => tp.aiContext?.aiInfluenced).length;\n \n // Analyze behavior patterns\n const pages = journey.userJourney.map(tp => tp.page.toLowerCase());\n const pageTypes = journey.userJourney.map(tp => tp.type.toLowerCase());\n \n const behaviorPatterns = {\n skipsBranding: !pages.some(p => p.includes('about') || p === '/') && pages.length > 1,\n researchIntensive: journey.userJourney.length > 5 || pageTypes.filter(t => t.includes('solution') || t.includes('blog')).length > 2,\n quickDecision: pages.some(p => p.includes('contact') || p.includes('demo') || p.includes('pricing')) && journey.userJourney.length <= 3,\n technicalFocus: pageTypes.some(t => t.toLowerCase().includes('api') || t.toLowerCase().includes('developer')) || pages.some(p => p.includes('api') || p.includes('developer'))\n };\n \n // Platform-specific insights\n const platformInsights = {\n expectedJourney: predictExpectedJourney(aiData.platform, aiEntryPage),\n actualVsPredicted: evaluateJourneyPerformance(journey, aiData.platform),\n platformTypicalBehavior: getPlatformTypicalBehavior(aiData.platform)\n };\n \n return {\n isAIUser,\n aiTouchPoints,\n aiEntryPage,\n aiConversionPath: pages,\n aiSessionDuration: calculateSessionDuration(journey),\n aiPageDepth: journey.userJourney.length,\n behaviorPatterns,\n platformInsights\n };\n}\n\nfunction predictExpectedJourney(platform: string, entryPage: string | null): string {\n const platformJourneys: Record<string, string> = {\n 'ChatGPT': 'solutions_exploration',\n 'Perplexity': 'research_deep_dive',\n 'Claude': 'technical_evaluation',\n 'Bing_Copilot': 'quick_overview',\n 'Google_Gemini': 'comparative_analysis'\n };\n \n return platformJourneys[platform] || 'general_exploration';\n}\n\nfunction evaluateJourneyPerformance(journey: UserJourney, platform: string): 'matched' | 'exceeded' | 'underperformed' {\n const pageCount = journey.userJourney.length;\n const hasConversion = journey.userJourney.some(tp => \n tp.page.includes('contact') || tp.page.includes('demo') || tp.page.includes('pricing')\n );\n \n // Simple heuristic - can be made more sophisticated\n if (hasConversion && pageCount >= 3) return 'exceeded';\n if (pageCount >= 2) return 'matched';\n return 'underperformed';\n}\n\nfunction getPlatformTypicalBehavior(platform: string): string {\n const behaviors: Record<string, string> = {\n 'ChatGPT': 'Direct to solutions, conversion-focused',\n 'Perplexity': 'Research-heavy, multiple page views',\n 'Claude': 'Technical documentation focus',\n 'Bing_Copilot': 'Quick overview, efficiency-focused',\n 'Google_Gemini': 'Comparative analysis, thorough evaluation'\n };\n \n return behaviors[platform] || 'General exploration pattern';\n}\n\nfunction calculateSessionDuration(journey: UserJourney): number {\n if (journey.userJourney.length < 2) return 0;\n \n const firstVisit = new Date(journey.userJourney[0].time);\n const lastVisit = new Date(journey.userJourney[journey.userJourney.length - 1].time);\n \n return Math.floor((lastVisit.getTime() - firstVisit.getTime()) / 1000);\n}\n\nasync function trackUserJourney(): Promise<UserJourney | null> {\n const STORAGE_KEY: string = 'userJourney';\n const SESSION_TIMEOUT: number = 30 * 60 * 1000; // 30 minutes\n\n // Helper function to get device category\n function getDeviceCategory(): DeviceCategory {\n const userAgent: string = navigator.userAgent;\n if (/tablet|ipad|playbook|silk/i.test(userAgent)) return 'Tablet';\n if (/mobile|iphone|ipod|android|blackberry|opera|mini|windows\\sce|palm|smartphone|iemobile/i.test(userAgent)) return 'Mobile';\n return 'Desktop';\n }\n\n // Helper function to get browser\n function getBrowser(): string {\n const userAgent: string = navigator.userAgent;\n if (userAgent.includes('Chrome') && !userAgent.includes('Edg')) return 'Chrome';\n if (userAgent.includes('Firefox')) return 'Firefox';\n if (userAgent.includes('Safari') && !userAgent.includes('Chrome')) return 'Safari';\n if (userAgent.includes('Edg')) return 'Edge';\n if (userAgent.includes('Opera')) return 'Opera';\n return 'Unknown';\n }\n\n // Helper function to get device name from user agent\n function getDeviceName(): string {\n const userAgent: string = navigator.userAgent;\n \n // Mobile devices\n if (/iPhone/.test(userAgent)) {\n const match = userAgent.match(/iPhone\\s*([^;]*)/);\n return match ? `iPhone ${match[1].trim()}` : 'iPhone';\n }\n \n if (/iPad/.test(userAgent)) {\n const match = userAgent.match(/iPad\\s*([^;]*)/);\n return match ? `iPad ${match[1].trim()}` : 'iPad';\n }\n \n if (/Android/.test(userAgent)) {\n const modelMatch = userAgent.match(/;\\s*([^)]*)\\s*\\)/);\n if (modelMatch) {\n const deviceInfo = modelMatch[1].trim();\n const cleanDevice = deviceInfo\n .replace(/wv/g, '')\n .replace(/Build\\/.*$/g, '')\n .replace(/\\s+/g, ' ')\n .trim();\n return cleanDevice || 'Android Device';\n }\n return 'Android Device';\n }\n \n // Desktop/Laptop detection\n if (/Windows/.test(userAgent)) {\n if (/Windows NT 10/.test(userAgent)) return 'Windows 10/11 PC';\n if (/Windows NT 6\\.3/.test(userAgent)) return 'Windows 8.1 PC';\n if (/Windows NT 6\\.2/.test(userAgent)) return 'Windows 8 PC';\n if (/Windows NT 6\\.1/.test(userAgent)) return 'Windows 7 PC';\n return 'Windows PC';\n }\n \n if (/Macintosh/.test(userAgent)) {\n if (/Intel/.test(userAgent)) return 'Mac (Intel)';\n if (/Apple Silicon|ARM64/.test(userAgent)) return 'Mac (Apple Silicon)';\n return 'Mac';\n }\n \n if (/Linux/.test(userAgent)) {\n return 'Linux PC';\n }\n \n if (/BlackBerry/.test(userAgent)) return 'BlackBerry';\n if (/Windows Phone/.test(userAgent)) return 'Windows Phone';\n \n const deviceCategory = getDeviceCategory();\n return deviceCategory.charAt(0).toUpperCase();\n }\n\n // Helper function to extract domain from referrer\n function extractDomainFromReferrer(referrer: string): string {\n if (!referrer) return 'Unknown';\n\n try {\n const url = new URL(referrer);\n const hostname = url.hostname;\n const domain = hostname.replace(/^www\\./, '');\n const domainParts = domain.split('.');\n if (domainParts.length >= 2) {\n return domainParts[0];\n }\n return domain || 'Unknown';\n } catch (error) {\n return 'Unknown';\n }\n }\n\n // Enhanced UTM parameters with AI detection context\n function getUTMParameters(isFirstVisit: boolean, firstVisitUTM?: UTMParameters): UTMParameters {\n const urlParams: URLSearchParams = new URLSearchParams(window.location.search);\n const hasCurrentUTM: boolean = urlParams.has('utm_source') || urlParams.has('utm_medium') || urlParams.has('utm_campaign');\n\n if (isFirstVisit || hasCurrentUTM) {\n if (hasCurrentUTM) {\n return {\n source: urlParams.get('utm_source') || '',\n medium: urlParams.get('utm_medium') || '',\n campaign: urlParams.get('utm_campaign') || '',\n content: urlParams.get('utm_content') || '',\n term: urlParams.get('utm_term') || ''\n };\n } else {\n const referrerDomain = extractDomainFromReferrer(document.referrer);\n return {\n source: referrerDomain,\n medium: 'organic',\n campaign: 'unknown'\n };\n }\n } else {\n return firstVisitUTM || {\n source: 'Unknown',\n medium: 'organic',\n campaign: 'unknown'\n };\n }\n }\n\n // Helper function to get page categories from global variable\n function getPageCategories(): string[] {\n try {\n if (typeof (window as any).pageCategories !== 'undefined' &&\n Array.isArray((window as any).pageCategories) &&\n (window as any).pageCategories.length > 0) {\n return (window as any).pageCategories;\n }\n return ['Not applicable'];\n } catch (error) {\n console.warn('Error accessing pageCategories:', error);\n return ['Not applicable'];\n }\n }\n\n function hasVisibleUTM(): boolean {\n const urlParams: URLSearchParams = new URLSearchParams(window.location.search);\n return urlParams.has('utm_source') || urlParams.has('utm_medium') || urlParams.has('utm_campaign');\n }\n\n // Helper function to get page type (same as original)\n function getPageType(url: string): string {\n const path: string = url.split('?')[0].toLowerCase();\n\n const typeConfig = {\n exactMatches: {\n '/': 'Home',\n '/home': 'Home',\n '/blog': 'Blog listing',\n '/about-us': 'About us',\n '/contact-us': 'Contact',\n '/privacy-policy': 'Privacy policy',\n '/terms-of-service': 'Terms of service',\n '/careers': 'Careers',\n '/customer-stories': 'Customer stories listing',\n '/events': 'Events listing',\n '/infographics': 'Infographics listing',\n '/newsroom': 'Newsroom',\n '/releases': 'Releases listing',\n } as Record<string, string>,\n\n pathStartsWith: [\n { pattern: '/blog/', type: 'Blog' },\n { pattern: '/customer-stories/', type: 'Customer story' },\n { pattern: '/case-studies/', type: 'Case study' },\n { pattern: '/solutions/', type: 'Solution' },\n { pattern: '/events/', type: 'Event' },\n { pattern: '/news/', type: 'News' },\n { pattern: '/press-releases/', type: 'Press release' },\n { pattern: '/releases/', type: 'Release' },\n ]\n };\n\n if (typeConfig.exactMatches[path]) {\n return typeConfig.exactMatches[path];\n }\n\n for (const item of typeConfig.pathStartsWith) {\n if (path.startsWith(item.pattern)) {\n return item.type;\n }\n }\n\n return 'Other';\n }\n\n // Check if session is still valid\n function isValidSession(journey: UserJourney): boolean {\n if (!journey.userJourney || journey.userJourney.length === 0) return false;\n const lastVisit: Date = new Date(journey.userJourney[journey.userJourney.length - 1].time);\n const now: Date = new Date();\n return (now.getTime() - lastVisit.getTime()) < SESSION_TIMEOUT;\n }\n\n // Add 200ms delay before executing the main logic\n return new Promise((resolve) => {\n setTimeout(() => {\n try {\n // Detect AI platform first\n const aiData = detectAIPlatform();\n \n // Get existing journey from sessionStorage\n let journey: UserJourney | null = null;\n const storedData: string | null = sessionStorage.getItem(STORAGE_KEY);\n\n if (storedData) {\n const parsedData: UserJourney = JSON.parse(storedData);\n if (isValidSession(parsedData)) {\n journey = parsedData;\n }\n }\n\n // Initialize new journey if none exists or session expired\n if (!journey) {\n journey = {\n userJourney: [],\n origin: window.location.hostname,\n deviceCategory: getDeviceCategory(),\n browser: getBrowser(),\n device: getDeviceName(),\n formDetails: {\n formId: '',\n formName: '',\n firstName: '',\n lastName: '',\n email: '',\n phone: ''\n },\n // Initialize AI data\n aiData: aiData,\n aiJourneyAnalytics: {\n isAIUser: false,\n aiTouchPoints: 0,\n aiEntryPage: null,\n behaviorPatterns: {\n skipsBranding: false,\n researchIntensive: false,\n quickDecision: false,\n technicalFocus: false\n },\n platformInsights: {\n expectedJourney: 'n/a',\n actualVsPredicted: 'matched',\n platformTypicalBehavior: 'n/a'\n }\n }\n };\n } else {\n // Update existing journey with AI data using latest platform strategy\n const updatedAIData = handleAIDetection_LatestPlatform(journey.aiData || {\n platform: 'none',\n type: 'unknown',\n context: 'unknown',\n confidence: 'low',\n detectionMethod: 'none',\n detectedAt: new Date().toISOString()\n }, aiData);\n \n journey.aiData = updatedAIData;\n journey.aiJourneyAnalytics = calculateAIJourneyAnalytics(journey, updatedAIData);\n }\n\n // Ensure backward compatibility\n if (!journey.formDetails) {\n journey.formDetails = {\n formId: '',\n formName: '',\n firstName: '',\n lastName: '',\n email: '',\n phone: ''\n };\n }\n\n if (!journey.device) {\n journey.device = getDeviceName();\n }\n\n if (!journey) {\n console.error('Journey initialization failed');\n resolve(null);\n return;\n }\n\n // Get current page info\n const currentUrl: string = window.location.pathname;\n const currentTime: string = new Date().toISOString();\n\n // Check if this is the same page as the last visit\n const lastVisit: TouchPoint | undefined = journey.userJourney[journey.userJourney.length - 1];\n if (lastVisit && lastVisit.page === currentUrl) {\n lastVisit.time = currentTime;\n } else {\n // New page visit\n const isFirstVisit: boolean = journey.userJourney.length === 0;\n const firstVisitUTM: UTMParameters | undefined = isFirstVisit ? undefined : journey.userJourney[0].utm;\n\n // Determine AI context for this touchpoint\n const isAIReferral = isFirstVisit && aiData.platform !== 'none';\n const aiInfluenced = journey.aiData.platform !== 'none';\n\n const touchPoint: TouchPoint = {\n touchPoint: journey.userJourney.length + 1,\n page: currentUrl,\n title: document.title || 'Untitled',\n type: getPageType(currentUrl),\n category: getPageCategories(),\n time: currentTime,\n utmVisibility: hasVisibleUTM() ? 'visible' : 'hidden',\n utm: getUTMParameters(isFirstVisit, firstVisitUTM),\n \n // Add AI context\n aiContext: {\n isAIReferral: isAIReferral,\n aiPlatform: aiInfluenced ? aiData.platform : undefined,\n aiInfluenced: aiInfluenced,\n aiJourneyStage: isAIReferral ? 'entry' : \n (journey.userJourney.length === 0 ? 'exploration' :\n (currentUrl.includes('pricing') || currentUrl.includes('contact') ? 'decision' : 'consideration'))\n }\n };\n\n journey.userJourney.push(touchPoint);\n }\n\n // Recalculate AI journey analytics\n journey.aiJourneyAnalytics = calculateAIJourneyAnalytics(journey, journey.aiData);\n\n // Save updated journey to sessionStorage\n sessionStorage.setItem(STORAGE_KEY, JSON.stringify(journey));\n\n // Initialize form tracking\n initializeFormTracking();\n\n // Send AI tracking events to analytics platforms\n if (journey.aiData.platform !== 'none') {\n sendAITrackingEvents(journey, currentUrl);\n }\n\n resolve(journey);\n\n } catch (error: unknown) {\n console.error('Error tracking user journey:', error);\n resolve(null);\n }\n }, 200);\n });\n}\n\n// Send AI tracking events to analytics platforms\nfunction sendAITrackingEvents(journey: UserJourney, currentPage: string): void {\n const aiData = journey.aiData;\n const currentURL = new URL(window.location.href);\n \n const eventData = {\n ai_platform: aiData.platform,\n ai_type: aiData.type,\n ai_context: aiData.context,\n ai_confidence: aiData.confidence,\n detection_method: aiData.detectionMethod,\n landing_page: currentPage,\n page_category: getPageCategory(currentPage),\n \n // UTM data\n utm_source: currentURL.searchParams.get('utm_source') || '',\n utm_medium: currentURL.searchParams.get('utm_medium') || '',\n utm_campaign: currentURL.searchParams.get('utm_campaign') || '',\n utm_content: currentURL.searchParams.get('utm_content') || '',\n utm_term: currentURL.searchParams.get('utm_term') || '',\n \n // Journey data\n is_ai_user: journey.aiJourneyAnalytics.isAIUser,\n ai_touchpoints: journey.aiJourneyAnalytics.aiTouchPoints,\n session_start: aiData.detectedAt\n };\n \n // Event data is prepared but not sent to any external analytics platforms\n // This can be used for debugging or future analytics integration\n console.debug('AI tracking event data:', eventData);\n}\n\nfunction getPageCategory(pathname: string): string {\n if (pathname === '/') return 'Homepage';\n if (pathname.includes('/platform')) return 'Platform';\n if (pathname.includes('/solutions')) return 'Solutions';\n if (pathname.includes('/blog')) return 'Blog';\n if (pathname.includes('/developers') || pathname.includes('/api')) return 'Developer';\n if (pathname.includes('/contact') || pathname.includes('/demo')) return 'Contact';\n if (pathname.includes('/pricing')) return 'Pricing';\n if (pathname.includes('/about') || pathname.includes('/company')) return 'Company';\n return 'Other';\n}\n\n// Form tracking functionality (keeping original implementation)\nfunction initializeFormTracking(): void {\n const existingInputs = document.querySelectorAll('input[ph-form-field], textarea[ph-form-field], select[ph-form-field]');\n existingInputs.forEach(input => {\n input.removeEventListener('input', handleFormFieldChange);\n input.removeEventListener('change', handleFormFieldChange);\n });\n\n const formFields = document.querySelectorAll('input[ph-form-field], textarea[ph-form-field], select[ph-form-field]');\n formFields.forEach(field => {\n field.addEventListener('input', handleFormFieldChange);\n field.addEventListener('change', handleFormFieldChange);\n });\n\n initializeFormData();\n}\n\nfunction initializeFormData(): void {\n const journey = getUserJourney();\n if (!journey) return;\n\n const formContainer = document.querySelector('[ph-form-name]');\n if (!formContainer) return;\n\n const formName = formContainer.getAttribute('ph-form-name');\n const formId = formContainer.getAttribute('ph-form-id') || 'form-1';\n\n if (!formName) return;\n\n if (!journey.formDetails.formName) {\n journey.formDetails.formId = formId;\n journey.formDetails.formName = formName;\n }\n\n sessionStorage.setItem('userJourney', JSON.stringify(journey));\n}\n\nfunction handleFormFieldChange(event: Event): void {\n const target = event.target as HTMLInputElement | HTMLTextAreaElement | HTMLSelectElement;\n const fieldName = target.getAttribute('ph-form-field');\n\n if (!fieldName) return;\n\n const formContainer = target.closest('[ph-form-name]');\n if (!formContainer) return;\n\n const formName = formContainer.getAttribute('ph-form-name');\n const formId = formContainer.getAttribute('ph-form-id') || 'form-1';\n\n if (!formName) return;\n\n updateFormData(formName, formId, fieldName, target.value);\n}\n\nfunction updateFormData(formName: string, formId: string, fieldName: string, value: string): boolean {\n try {\n const journey = getUserJourney();\n if (!journey) return false;\n\n journey.formDetails.formId = formId;\n journey.formDetails.formName = formName;\n\n switch (fieldName) {\n case 'firstName':\n journey.formDetails.firstName = value;\n break;\n case 'lastName':\n journey.formDetails.lastName = value;\n break;\n case 'email':\n journey.formDetails.email = value;\n break;\n case 'phone':\n journey.formDetails.phone = value;\n break;\n default:\n console.warn(`Unknown field: ${fieldName}`);\n return false;\n }\n\n sessionStorage.setItem('userJourney', JSON.stringify(journey));\n return true;\n } catch (error) {\n console.error('Error updating form data:', error);\n return false;\n }\n}\n\n// Helper function to get current journey data\nfunction getUserJourney(): UserJourney | null {\n try {\n const storedData: string | null = sessionStorage.getItem('userJourney');\n return storedData ? JSON.parse(storedData) as UserJourney : null;\n } catch (error: unknown) {\n console.error('Error getting user journey:', error);\n return null;\n }\n}\n\n// Helper function to clear journey data\nfunction clearUserJourney(): void {\n sessionStorage.removeItem('userJourney');\n}\n\n// Helper function to update page categories manually\nfunction updatePageCategories(categories: string[]): boolean {\n try {\n const journey: UserJourney | null = getUserJourney();\n if (!journey || journey.userJourney.length === 0) return false;\n\n const lastVisit: TouchPoint = journey.userJourney[journey.userJourney.length - 1];\n lastVisit.category = categories.length > 0 ? categories : ['Not applicable'];\n\n sessionStorage.setItem('userJourney', JSON.stringify(journey));\n return true;\n } catch (error: unknown) {\n console.error('Error updating page categories:', error);\n return false;\n }\n}\n\nfunction updatePageType(type: string): boolean {\n try {\n const journey: UserJourney | null = getUserJourney();\n if (!journey || journey.userJourney.length === 0) return false;\n\n const lastVisit: TouchPoint = journey.userJourney[journey.userJourney.length - 1];\n lastVisit.type = type;\n\n sessionStorage.setItem('userJourney', JSON.stringify(journey));\n return true;\n } catch (error: unknown) {\n console.error('Error updating page type:', error);\n return false;\n }\n}\n\n// Enhanced journey statistics with AI metrics\nfunction getJourneyStats(): JourneyStats | null {\n const journey: UserJourney | null = getUserJourney();\n if (!journey || journey.userJourney.length === 0) return null;\n\n const firstVisit: TouchPoint = journey.userJourney[0];\n const lastVisit: TouchPoint = journey.userJourney[journey.userJourney.length - 1];\n\n const sessionDuration: number = new Date(lastVisit.time).getTime() - new Date(firstVisit.time).getTime();\n\n // Calculate AI-specific stats if this is an AI user\n let aiStats: JourneyStats['aiStats'];\n if (journey.aiJourneyAnalytics.isAIUser) {\n const aiEntryPoint = journey.userJourney.find(tp => tp.aiContext?.isAIReferral);\n const aiStartTime = aiEntryPoint ? new Date(aiEntryPoint.time) : new Date(firstVisit.time);\n const aiSessionDuration = new Date(lastVisit.time).getTime() - aiStartTime.getTime();\n \n const hasConversion = journey.userJourney.some(tp => \n tp.page.includes('contact') || tp.page.includes('demo') || tp.page.includes('pricing')\n );\n \n aiStats = {\n aiSessionDuration: Math.floor(aiSessionDuration / 1000),\n aiPages: journey.aiJourneyAnalytics.aiTouchPoints,\n aiConversionTime: hasConversion ? Math.floor(aiSessionDuration / 1000) : undefined,\n aiEngagementScore: calculateAIEngagementScore(journey),\n aiValueScore: calculateAIValueScore(journey)\n };\n }\n\n return {\n totalPages: journey.userJourney.length,\n sessionDuration: Math.floor(sessionDuration / 1000),\n firstPage: firstVisit.page,\n lastPage: lastVisit.page,\n aiStats: aiStats\n };\n}\n\n// Calculate AI engagement score based on behavior\nfunction calculateAIEngagementScore(journey: UserJourney): number {\n let score = 0;\n \n // Base score for being an AI user\n if (journey.aiJourneyAnalytics.isAIUser) score += 20;\n \n // Page depth scoring\n const pageCount = journey.userJourney.length;\n if (pageCount >= 5) score += 30;\n else if (pageCount >= 3) score += 20;\n else if (pageCount >= 2) score += 10;\n \n // Behavior pattern scoring\n const patterns = journey.aiJourneyAnalytics.behaviorPatterns;\n if (patterns.researchIntensive) score += 25;\n if (patterns.technicalFocus) score += 20;\n if (patterns.quickDecision) score += 15;\n \n // Page type engagement\n const hasHighValuePages = journey.userJourney.some(tp => \n tp.type.toLowerCase().includes('solution') || \n tp.type.toLowerCase().includes('pricing') ||\n tp.type.toLowerCase().includes('demo')\n );\n if (hasHighValuePages) score += 15;\n \n return Math.min(score, 100); // Cap at 100\n}\n\n// Calculate AI value score based on conversion indicators\nfunction calculateAIValueScore(journey: UserJourney): number {\n let score = 0;\n \n // High-confidence AI detection\n if (journey.aiData.confidence === 'high') score += 20;\n else if (journey.aiData.confidence === 'medium') score += 10;\n \n // Platform-specific scoring\n const highValuePlatforms = ['ChatGPT', 'Claude', 'Google_Gemini'];\n if (highValuePlatforms.includes(journey.aiData.platform)) score += 15;\n \n // Conversion indicators\n const pages = journey.userJourney.map(tp => tp.page.toLowerCase());\n if (pages.some(p => p.includes('pricing'))) score += 25;\n if (pages.some(p => p.includes('contact') || p.includes('demo'))) score += 30;\n if (pages.some(p => p.includes('api') || p.includes('developer'))) score += 20;\n \n // Form interaction\n const hasFormData = journey.formDetails.email || journey.formDetails.firstName;\n if (hasFormData) score += 20;\n \n return Math.min(score, 100); // Cap at 100\n}\n\n// Helper function to get form data\nfunction getFormData(): FormDetails | null {\n const journey = getUserJourney();\n return journey ? journey.formDetails : null;\n}\n\n// Helper function to get specific form field value\nfunction getFormFieldValue(fieldName: keyof FormDetails): string | null {\n const journey = getUserJourney();\n if (!journey) return null;\n return journey.formDetails[fieldName] || null;\n}\n\n// Helper function to manually update form data\nfunction setFormData(fieldName: keyof FormDetails, value: string): boolean {\n try {\n const journey = getUserJourney();\n if (!journey) return false;\n\n journey.formDetails[fieldName] = value;\n sessionStorage.setItem('userJourney', JSON.stringify(journey));\n return true;\n } catch (error) {\n console.error('Error setting form data:', error);\n return false;\n }\n}\n\n// Helper function to set form ID and name\nfunction setFormDetails(formId: string, formName: string): boolean {\n try {\n const journey = getUserJourney();\n if (!journey) return false;\n\n journey.formDetails.formId = formId;\n journey.formDetails.formName = formName;\n sessionStorage.setItem('userJourney', JSON.stringify(journey));\n return true;\n } catch (error) {\n console.error('Error setting form details:', error);\n return false;\n }\n}\n\n// Helper function to reinitialize form tracking\nfunction reinitializeFormTracking(): void {\n initializeFormTracking();\n}\n\n// New AI-specific helper functions\nfunction getAIData(): AIData | null {\n const journey = getUserJourney();\n return journey ? journey.aiData : null;\n}\n\nfunction getAIJourneyAnalytics(): UserJourney['aiJourneyAnalytics'] | null {\n const journey = getUserJourney();\n return journey ? journey.aiJourneyAnalytics : null;\n}\n\nfunction isAIUser(): boolean {\n const journey = getUserJourney();\n return journey ? journey.aiJourneyAnalytics.isAIUser : false;\n}\n\nfunction getAIPlatform(): string | null {\n const journey = getUserJourney();\n return journey && journey.aiData.platform !== 'none' ? journey.aiData.platform : null;\n}\n\nfunction forceAIDetection(): AIData {\n const aiData = detectAIPlatform();\n const journey = getUserJourney();\n \n if (journey) {\n journey.aiData = aiData;\n journey.aiJourneyAnalytics = calculateAIJourneyAnalytics(journey, aiData);\n sessionStorage.setItem('userJourney', JSON.stringify(journey));\n }\n \n return aiData;\n}\n\n// Auto-execute on page load\ndocument.addEventListener('DOMContentLoaded', (): void => {\n trackUserJourney();\n});\n\n// Also execute immediately if DOM is already loaded\nif (document.readyState === 'loading') {\n document.addEventListener('DOMContentLoaded', (): void => {\n trackUserJourney();\n });\n} else {\n trackUserJourney();\n}\n\n// Make functions globally accessible\ndeclare global {\n interface Window {\n trackUserJourney: () => Promise<UserJourney | null>;\n getUserJourney: () => UserJourney | null;\n clearUserJourney: () => void;\n updatePageType: (type: string) => boolean;\n updatePageCategories: (categories: string[]) => boolean;\n getJourneyStats: () => JourneyStats | null;\n getFormData: () => FormDetails | null;\n getFormFieldValue: (fieldName: keyof FormDetails) => string | null;\n setFormData: (fieldName: keyof FormDetails, value: string) => boolean;\n setFormDetails: (formId: string, formName: string) => boolean;\n reinitializeFormTracking: () => void;\n \n // AI-specific functions\n getAIData: () => AIData | null;\n getAIJourneyAnalytics: () => UserJourney['aiJourneyAnalytics'] | null;\n isAIUser: () => boolean;\n getAIPlatform: () => string | null;\n forceAIDetection: () => AIData;\n detectAIPlatform: () => AIData;\n }\n}\n\n// Attach functions to window object for global access\nwindow.trackUserJourney = trackUserJourney;\nwindow.getUserJourney = getUserJourney;\nwindow.clearUserJourney = clearUserJourney;\nwindow.updatePageType = updatePageType;\nwindow.updatePageCategories = updatePageCategories;\nwindow.getJourneyStats = getJourneyStats;\nwindow.getFormData = getFormData;\nwindow.getFormFieldValue = getFormFieldValue;\nwindow.setFormData = setFormData;\nwindow.setFormDetails = setFormDetails;\nwindow.reinitializeFormTracking = reinitializeFormTracking;\n\n// AI-specific window functions\nwindow.getAIData = getAIData;\nwindow.getAIJourneyAnalytics = getAIJourneyAnalytics;\nwindow.isAIUser = isAIUser;\nwindow.getAIPlatform = getAIPlatform;\nwindow.forceAIDetection = forceAIDetection;\nwindow.detectAIPlatform = detectAIPlatform;\n\n// Export functions for module usage\nexport {\n trackUserJourney,\n getUserJourney,\n clearUserJourney,\n updatePageType,\n updatePageCategories,\n getJourneyStats,\n getFormData,\n getFormFieldValue,\n setFormData,\n setFormDetails,\n reinitializeFormTracking,\n \n // AI-specific exports\n getAIData,\n getAIJourneyAnalytics,\n isAIUser,\n getAIPlatform,\n forceAIDetection,\n detectAIPlatform\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;;;ACSA,WAAS,iCAAiC,gBAAwB,WAA2B;AAEzF,QAAI,UAAU,aAAa,QAAQ;AAC/B,aAAO;AAAA,IACX;AAGA,WAAO;AAAA,EACX;AAGA,WAAS,mBAA2B;AAChC,UAAM,cAAc,SAAS;AAC7B,UAAM,WAAW,YAAY,YAAY;AACzC,UAAM,aAAa,IAAI,IAAI,OAAO,SAAS,IAAI;AAG/C,UAAM,YAAY,WAAW,aAAa,IAAI,YAAY,GAAG,YAAY,KAAK;AAC9E,UAAM,YAAY,WAAW,aAAa,IAAI,YAAY,GAAG,YAAY,KAAK;AAC9E,UAAM,cAAc,WAAW,aAAa,IAAI,cAAc,GAAG,YAAY,KAAK;AAClF,UAAM,aAAa,WAAW,aAAa,IAAI,aAAa,GAAG,YAAY,KAAK;AAGhF,UAAM,aAAa,GAAG,QAAQ,IAAI,SAAS,IAAI,SAAS,IAAI,WAAW,IAAI,UAAU;AAErF,QAAI,SAAiB;AAAA,MACjB,UAAU;AAAA,MACV,MAAM;AAAA,MACN,SAAS;AAAA,MACT,YAAY;AAAA,MACZ,iBAAiB;AAAA,MACjB,aAAY,oBAAI,KAAK,GAAE,YAAY;AAAA,IACvC;AAGA,UAAM,cAAc;AAAA,MAChB;AAAA,QACI,UAAU,CAAC,WAAW,UAAU,aAAa;AAAA,QAC7C,UAAU;AAAA,QACV,MAAM;AAAA,QACN,SAAS;AA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AAiB,oBAAoB,MAAY;AACtD,uBAAiB;AAAA,IACrB,CAAC;AAAA,EACL,OAAO;AACH,qBAAiB;AAAA,EACrB;AA4BA,SAAO,mBAAmB;AAC1B,SAAO,iBAAiB;AACxB,SAAO,mBAAmB;AAC1B,SAAO,iBAAiB;AACxB,SAAO,uBAAuB;AAC9B,SAAO,kBAAkB;AACzB,SAAO,cAAc;AACrB,SAAO,oBAAoB;AAC3B,SAAO,cAAc;AACrB,SAAO,iBAAiB;AACxB,SAAO,2BAA2B;AAGlC,SAAO,YAAY;AACnB,SAAO,wBAAwB;AAC/B,SAAO,WAAW;AAClB,SAAO,gBAAgB;AACvB,SAAO,mBAAmB;AAC1B,SAAO,mBAAmB;",
|
|
6
|
-
"names": ["isAIUser"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../bin/live-reload.js", "../../src/tracking/utm-links.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", "// UTM Parameter Propagation Script (TypeScript)\n// Automatically adds UTM parameters from current page to all internal links\n\ninterface UTMParams {\n [key: string]: string;\n}\n\ninterface UTMConfig {\n utmKeys: string[];\n selectors: 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 selectors: [\n 'a[href]',\n 'button[onclick*=\"location\"]',\n 'button[onclick*=\"window.open\"]',\n 'button[onclick*=\"href\"]',\n '[data-href]'\n ]\n };\n\n // Get current URL parameters\n function getCurrentUTMParams(): UTMParams {\n const urlParams: URLSearchParams = new URLSearchParams(window.location.search);\n const utmParams: UTMParams = {};\n\n config.utmKeys.forEach((key: string) => {\n if (urlParams.has(key)) {\n const value: string | null = urlParams.get(key);\n if (value) {\n utmParams[key] = value;\n }\n }\n });\n\n return utmParams;\n }\n\n // Check if URL is internal (same domain)\n function isInternalLink(url: string, currentHost: string): boolean {\n try {\n // Handle relative URLs\n if (url.startsWith('/') || url.startsWith('./') || url.startsWith('../')) {\n return true;\n }\n\n // Handle absolute URLs\n if (url.startsWith('http')) {\n const linkHost: string = new URL(url).hostname;\n return linkHost === currentHost;\n }\n\n // Handle protocol-relative URLs\n if (url.startsWith('//')) {\n const linkHost: string = new URL('http:' + url).hostname;\n return linkHost === currentHost;\n }\n\n // Handle anchor links and other relative paths\n if (!url.includes('://')) {\n return true;\n }\n\n return false;\n } catch (e: unknown) {\n // If URL parsing fails, assume it's internal to be safe\n console.warn('Error parsing URL:', url, e);\n return true;\n }\n }\n\n // Add UTM parameters to a URL\n function addUTMToURL(url: string, utmParams: UTMParams): string {\n try {\n const urlObj: URL = new URL(url, window.location.origin);\n\n // Add UTM parameters\n Object.keys(utmParams).forEach((key: string) => {\n // Only add if parameter doesn't already exist\n if (!urlObj.searchParams.has(key)) {\n urlObj.searchParams.set(key, utmParams[key]);\n }\n });\n\n return urlObj.toString();\n } catch (e: unknown) {\n console.warn('Error processing URL:', url, e);\n return url;\n }\n }\n\n // Check if element has UTM exception attribute\n function hasUTMException(element: Element): boolean {\n return element.hasAttribute('data-utm-exception') &&\n element.getAttribute('data-utm-exception') === 'true';\n }\n\n // Extract URL from onclick attribute\n function extractURLFromOnclick(onclickStr: string): string | null {\n const urlMatch: RegExpMatchArray | null = onclickStr.match(\n /[\"'](https?:\\/\\/[^\"']+|\\/[^\"']*|[^\"']*\\.html?[^\"']*)[\"']/\n );\n return urlMatch ? urlMatch[1] : null;\n }\n\n // Update element onclick attribute\n function updateOnclickAttribute(element: Element, oldUrl: string, newUrl: string): void {\n if (!(element instanceof HTMLElement) || !element.onclick) return;\n\n const onclickStr: string = element.onclick.toString();\n const newOnclick: string = onclickStr.replace(oldUrl, newUrl);\n const funcBody: string = newOnclick.slice(\n newOnclick.indexOf('{') + 1,\n newOnclick.lastIndexOf('}')\n );\n element.setAttribute('onclick', funcBody);\n }\n\n // Process all links and buttons\n function propagateUTMParameters(): void {\n const utmParams: UTMParams = getCurrentUTMParams();\n\n // Exit if no UTM parameters found\n if (Object.keys(utmParams).length === 0) {\n return;\n }\n\n const currentHost: string = window.location.hostname;\n const elements: NodeListOf<Element> = document.querySelectorAll(config.selectors.join(', '));\n\n elements.forEach((element: Element) => {\n // Skip elements with utm exception attribute\n if (hasUTMException(element)) {\n return;\n }\n\n let url: string | null = null;\n\n // Get URL from different sources\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 } else if (element instanceof HTMLElement && element.onclick) {\n // Try to extract URL from onclick\n const onclickStr: string = element.onclick.toString();\n url = extractURLFromOnclick(onclickStr);\n }\n\n // Process if URL found and is internal\n if (url && isInternalLink(url, currentHost)) {\n const updatedURL: string = addUTMToURL(url, utmParams);\n\n // Update the element\n if (element instanceof HTMLAnchorElement && element.href) {\n element.href = updatedURL;\n } else if (element instanceof HTMLElement && element.dataset.href) {\n element.dataset.href = updatedURL;\n }\n\n // Handle onclick updates (basic cases)\n if (element instanceof HTMLElement && element.onclick && url !== updatedURL) {\n updateOnclickAttribute(element, url, updatedURL);\n }\n }\n });\n\n console.log(`UTM parameters propagated to internal links:`, utmParams);\n }\n\n // Handle dynamically added content\n function observeNewContent(): void {\n const utmParams: UTMParams = getCurrentUTMParams();\n\n if (Object.keys(utmParams).length === 0) {\n return;\n }\n\n const observer: MutationObserver = new MutationObserver(function (mutations: MutationRecord[]): void {\n mutations.forEach(function (mutation: MutationRecord): void {\n mutation.addedNodes.forEach(function (node: Node): void {\n if (node.nodeType === Node.ELEMENT_NODE) {\n const element = node as Element;\n\n // Check if the added node itself is a link\n if (element.matches && element.matches(config.selectors.join(', '))) {\n processElement(element, utmParams);\n }\n\n // Check for links within the added node\n if ('querySelectorAll' in element) {\n const links: NodeListOf<Element> = element.querySelectorAll(config.selectors.join(', '));\n links.forEach((link: Element) => processElement(link, utmParams));\n }\n }\n });\n });\n });\n\n observer.observe(document.body, {\n childList: true,\n subtree: true\n });\n }\n\n // Process individual element\n function processElement(element: Element, utmParams: UTMParams): void {\n // Skip elements with utm exception attribute\n if (hasUTMException(element)) {\n return;\n }\n\n const currentHost: string = 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: string = addUTMToURL(url, utmParams);\n\n if (element instanceof HTMLAnchorElement && element.href) {\n element.href = updatedURL;\n } else if (element instanceof HTMLElement && element.dataset.href) {\n element.dataset.href = updatedURL;\n }\n }\n }\n\n // Initialize when DOM is ready\n function init(): void {\n if (document.readyState === 'loading') {\n document.addEventListener('DOMContentLoaded', function (): void {\n propagateUTMParameters();\n observeNewContent();\n });\n } else {\n propagateUTMParameters();\n observeNewContent();\n }\n }\n\n // Start the process\n init();\n\n})();\n\n// Alternative: If you prefer a more targeted approach for specific elements\n// You can also use this function to manually add UTM params to specific links:\nfunction addUTMToElement(element: HTMLElement | HTMLAnchorElement): void {\n // Skip elements with utm exception attribute\n if (element.hasAttribute('data-utm-exception') &&\n element.getAttribute('data-utm-exception') === 'true') {\n return;\n }\n\n const getCurrentUTMParams = (): UTMParams => {\n const urlParams: URLSearchParams = new URLSearchParams(window.location.search);\n const utmParams: UTMParams = {};\n const utmKeys: string[] = [\n 'utm_source', 'utm_medium', 'utm_campaign',\n 'utm_term', 'utm_content', 'utm_id'\n ];\n\n utmKeys.forEach((key: string) => {\n const value: string | null = urlParams.get(key);\n if (value) {\n utmParams[key] = value;\n }\n });\n\n return utmParams;\n };\n\n const isInternalLink = (url: string, currentHost: string): boolean => {\n try {\n if (url.startsWith('/') || url.startsWith('./') || url.startsWith('../')) {\n return true;\n }\n if (url.startsWith('http')) {\n return new URL(url).hostname === currentHost;\n }\n return !url.includes('://');\n } catch {\n return true;\n }\n };\n\n const addUTMToURL = (url: string, utmParams: UTMParams): string => {\n try {\n const urlObj: URL = new URL(url, window.location.origin);\n Object.keys(utmParams).forEach((key: string) => {\n if (!urlObj.searchParams.has(key)) {\n urlObj.searchParams.set(key, utmParams[key]);\n }\n });\n return urlObj.toString();\n } catch {\n return url;\n }\n };\n\n const utmParams: UTMParams = getCurrentUTMParams();\n if (Object.keys(utmParams).length > 0) {\n const currentHost: string = window.location.hostname;\n\n if (element instanceof HTMLAnchorElement && element.href &&\n isInternalLink(element.href, currentHost)) {\n element.href = addUTMToURL(element.href, utmParams);\n }\n }\n}\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;;;ACEA,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,WAAW;AAAA,QACP;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACJ;AAAA,IACJ;AAGA,aAAS,sBAAiC;AACtC,YAAM,YAA6B,IAAI,gBAAgB,OAAO,SAAS,MAAM;AAC7E,YAAM,YAAuB,CAAC;AAE9B,aAAO,QAAQ,QAAQ,CAAC,QAAgB;AACpC,YAAI,UAAU,IAAI,GAAG,GAAG;AACpB,gBAAM,QAAuB,UAAU,IAAI,GAAG;AAC9C,cAAI,OAAO;AACP,sBAAU,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AqB,YAAY,KAAK,SAAS;AAErD,YAAI,mBAAmB,qBAAqB,QAAQ,MAAM;AACtD,kBAAQ,OAAO;AAAA,QACnB,WAAW,mBAAmB,eAAe,QAAQ,QAAQ,MAAM;AAC/D,kBAAQ,QAAQ,OAAO;AAAA,QAC3B;AAAA,MACJ;AAAA,IACJ;AAGA,aAAS,OAAa;AAClB,UAAI,SAAS,eAAe,WAAW;AACnC,iBAAS,iBAAiB,oBAAoB,WAAkB;AAC5D,iCAAuB;AACvB,4BAAkB;AAAA,QACtB,CAAC;AAAA,MACL,OAAO;AACH,+BAAuB;AACvB,0BAAkB;AAAA,MACtB;AAAA,IACJ;AAGA,SAAK;AAAA,EAET,GAAG;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
package/dist/utils/sample.js.map
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../bin/live-reload.js", "../../src/utils/sample.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", "export function logMessage(message: string): void {\n console.log(\"Logged message:\", message);\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;;;ACVO,WAAS,WAAW,SAAuB;AAChD,YAAQ,IAAI,mBAAmB,OAAO;AAAA,EACxC;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../bin/live-reload.js", "../../node_modules/.pnpm/@fynd-design-engineering+web-utils@1.0.1/node_modules/@fynd-design-engineering/web-utils/src/window/get-path-segments.ts", "../../node_modules/.pnpm/@fynd-design-engineering+web-utils@1.0.1/node_modules/@fynd-design-engineering/web-utils/src/validations/localhost.ts", "../../node_modules/.pnpm/@fynd-design-engineering+web-utils@1.0.1/node_modules/@fynd-design-engineering/web-utils/src/index.ts", "../../src/validations/localhost.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", null, null, null, "import { checkForLocalhostUrls } from \"@fynd-design-engineering/web-utils\";\n\ncheckForLocalhostUrls();"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AACA,UACE,OAAO,SAAS,aAAa,eAC7B,OAAO,SAAS,aAAa,aAC7B;AACA,YAAI,YAAY,GAAG,uBAAY,UAAU,EAAE;AAAA,UAAiB;AAAA,UAAU,MACpE,SAAS,OAAO;AAAA,QAClB;AAAA,MACF,OAAO;AAAA,MAEP;AAAA;AAAA;;;;;;;;ACDA,cAAA,kBAAA;AAAA,eAAgB,kBAAe;AAC3B,cAAM,eAAe,OAAO,SAAS,SAAS,QAAQ,OAAO,EAAE,EAAE,MAAM,GAAG;AAC1E,eAAO,aAAa,OAAO,aAAW,YAAY,EAAE;MACxD;;;;;;;;;;ACHA,cAAA,wBAAAA;AAkHA,cAAA,gCAAA;AAlHA,eAAgBA,uBAAsB,UAKlC,CAAA,GAAE;AACF,cAAM,EACF,aAAa,MACb,cAAc,MACd,eAAe,MACf,mBAAmB,KAAI,IACvB;AAEJ,cAAM,oBAAoB;UACtB;UACA;UAC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