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0B,YACX1B,SAAS2B,iBAAiB,oBAAoB,WAExC7B,GA/KU,GA+KmBC,IAC/BM,IAEAD,GAEJ,IAIFX,OAAOC,mBAAoB,CAjM3B,CAkMD,CAvMD","sources":["webpack://vp-website/./src/fixurls.js"],"sourcesContent":["// This script runs immediately to fix any localhost URLs\n(function() {\n // Check if URL fixes are already being handled by main.js\n if (window.__urlFixesRunning || window.__urlFixesApplied) {\n console.log('URL fixes already being handled by main.js, skipping redundant fixes');\n return;\n }\n\n console.log('Running URL fix script from fixurls.js...');\n \n // Set global flag to indicate we're handling URL fixes\n window.__urlFixesRunning = true;\n \n // Flag to prevent multiple executions\n let fixesApplied = 0;\n const MAX_FIXES = 1; // Reduce to just one attempt\n\n // Function to detect if there are still localhost references\n const hasLocalhostReferences = () => {\n return document.documentElement.innerHTML.includes('localhost');\n };\n\n // Check and mark completion\n const checkAndMarkComplete = () => {\n if (!hasLocalhostReferences()) {\n window.__urlFixesApplied = true;\n console.log('All URL fixes completed successfully');\n }\n };\n\n // Replace all localhost URLs in the HTML, with safer approach\n function fixHtmlContent() {\n // Check if there are localhost URLs to fix\n if (hasLocalhostReferences()) {\n console.log('Found localhost URLs in HTML, fixing...');\n \n // Fix all image sources with localhost\n document.querySelectorAll('img[src*=\"localhost\"]').forEach(img => {\n try {\n const url = new URL(img.src);\n img.src = url.pathname;\n } catch (e) {\n console.error('Error fixing image src:', e);\n }\n });\n\n // Fix all data-src attributes for lazy loading\n document.querySelectorAll('[data-src*=\"localhost\"]').forEach(el => {\n try {\n const url = new URL(el.dataset.src);\n el.dataset.src = url.pathname;\n } catch (e) {\n console.error('Error fixing data-src:', e);\n }\n });\n\n // Fix all background images with localhost\n document.querySelectorAll('[style*=\"localhost\"]').forEach(el => {\n try {\n let style = el.getAttribute('style');\n if (style) {\n style = style.replace(/url\\(['\"]?http:\\/\\/localhost:[0-9]+([^'\"]+)['\"]?\\)/g, \"url('$1')\");\n el.setAttribute('style', style);\n }\n } catch (e) {\n console.error('Error fixing background image:', e);\n }\n });\n\n // Fix all links with localhost\n document.querySelectorAll('a[href*=\"localhost\"]').forEach(a => {\n try {\n const url = new URL(a.href);\n a.href = url.pathname;\n } catch (e) {\n console.error('Error fixing link:', e);\n }\n });\n \n return true; // Indicate changes were made\n }\n \n return false; // No changes needed\n }\n\n // Fix HTTP to HTTPS for Google Fonts\n const fixGoogleFonts = function() {\n document.querySelectorAll('link[href*=\"fonts.googleapis.com\"]').forEach(function(link) {\n if (link.href.startsWith('http://')) {\n link.href = link.href.replace('http://', 'https://');\n }\n });\n };\n\n // Fix localhost URLs in src attributes\n const fixLocalhost = function() {\n document.querySelectorAll('[src*=\"localhost\"]').forEach(function(el) {\n try {\n const url = new URL(el.src);\n el.src = url.pathname;\n } catch (e) {\n console.error('Error fixing localhost URL:', e);\n }\n });\n };\n\n // Fix background images with localhost\n const fixBackgroundImages = function() {\n document.querySelectorAll('[style*=\"localhost\"]').forEach(function(el) {\n try {\n let style = el.getAttribute('style');\n if (style) {\n style = style.replace(/url\\(['\"]?http:\\/\\/localhost:[0-9]+([^'\"]+)['\"]?\\)/g, \"url('$1')\");\n el.setAttribute('style', style);\n }\n } catch (e) {\n console.error('Error fixing background image:', e);\n }\n });\n };\n\n // Fix data-src attributes for lazy loading\n const fixDataSrc = function() {\n document.querySelectorAll('[data-src*=\"localhost\"]').forEach(function(el) {\n try {\n const url = new URL(el.dataset.src);\n el.dataset.src = url.pathname;\n } catch (e) {\n console.error('Error fixing data-src:', e);\n }\n });\n };\n\n // Fix all link elements with localhost\n const fixLinks = function() {\n document.querySelectorAll('a[href*=\"localhost\"]').forEach(function(el) {\n try {\n const url = new URL(el.href);\n el.href = url.pathname;\n } catch (e) {\n console.error('Error fixing link:', e);\n }\n });\n };\n\n // Fix favicon link\n const fixFavicon = function() {\n document.querySelectorAll('link[rel=\"icon\"]').forEach(function(link) {\n if (link.href && link.href.includes('localhost')) {\n const url = new URL(link.href);\n link.href = url.pathname;\n }\n });\n };\n\n // Run all fixes\n const runFixes = function() {\n // Increment fixes counter and check if we've already done enough fixes\n fixesApplied++;\n if (fixesApplied > MAX_FIXES) {\n console.log(`URL fixes already applied ${fixesApplied} times. Marking as complete.`);\n window.__urlFixesApplied = true;\n return;\n }\n \n console.log(`Running URL fixes from fixurls.js (attempt ${fixesApplied}/${MAX_FIXES})...`);\n fixGoogleFonts();\n fixLocalhost();\n fixBackgroundImages();\n fixDataSrc();\n fixLinks();\n fixFavicon();\n \n // Final check for any remaining localhost issues\n if (hasLocalhostReferences()) {\n console.log('Still found localhost references, trying targeted element fixes...');\n fixHtmlContent();\n }\n \n // Check if all fixes were successful\n checkAndMarkComplete();\n };\n\n // Run immediately on script load\n runFixes();\n\n // Also run when DOM is fully loaded, but only if needed\n if (document.readyState === 'loading') {\n document.addEventListener('DOMContentLoaded', function() {\n // Only run if we haven't applied fixes yet and there are still localhost URLs\n if (fixesApplied <= MAX_FIXES && hasLocalhostReferences()) {\n runFixes();\n } else {\n checkAndMarkComplete();\n }\n });\n }\n\n // Signal completion to main.js\n window.__urlFixesRunning = false;\n})(); "],"names":["window","__urlFixesRunning","__urlFixesApplied","console","log","fixesApplied","hasLocalhostReferences","document","documentElement","innerHTML","includes","checkAndMarkComplete","runFixes","concat","querySelectorAll","forEach","link","href","startsWith","replace","el","url","URL","src","pathname","e","error","style","getAttribute","setAttribute","dataset","img","a","readyState","addEventListener"],"sourceRoot":""}