@fynd-design-engineering/fynd-one-v2 3.3.13 → 3.3.15
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/accordians/dropdown.js.map +2 -2
- package/dist/accordians/index.js.map +2 -2
- package/dist/cms-listing/index.js.map +2 -2
- package/dist/filters/clear-search.js.map +2 -2
- package/dist/filters/show-count.js.map +2 -2
- package/dist/form/cs-gated-redirection.js.map +2 -2
- package/dist/form/download-file.js.map +2 -2
- package/dist/form/handler.js.map +2 -2
- package/dist/form/phone-validator.js.map +2 -2
- package/dist/global/anchor-scroll.js.map +2 -2
- package/dist/global/loader.js.map +2 -2
- package/dist/global/miscellaneous.js.map +2 -2
- package/dist/global/number-count.js.map +2 -2
- package/dist/global/popup-video.js.map +2 -2
- package/dist/home/index.js.map +2 -2
- package/dist/marquee/index.js.map +2 -2
- package/dist/marquee/marquee-swiper.js.map +2 -2
- package/dist/navigation/announcement/index.js.map +2 -2
- package/dist/navigation/context-menu/index.js.map +2 -2
- package/dist/navigation/desktop/index.js.map +2 -2
- package/dist/navigation/initialization.js +1 -1
- package/dist/navigation/initialization.js.map +2 -2
- package/dist/navigation/main.js.map +2 -2
- package/dist/navigation/mobile/index.js.map +2 -2
- package/dist/navigation/scroll/index.js.map +2 -2
- package/dist/navigation/secondary-navigation/index.js.map +2 -2
- package/dist/navigation/style.css +1 -1
- package/dist/navigation/style.css.map +2 -2
- package/dist/navigation/temp.css +0 -1
- package/dist/navigation/temp.css.map +3 -3
- package/dist/others/geolocation.js.map +2 -2
- package/dist/others/hero-aniamtion.js.map +2 -2
- package/dist/others/hero-india-animation-2.js.map +2 -2
- package/dist/others/hero-india-animation.js.map +2 -2
- package/dist/posthog-and-ga/attributes.js.map +2 -2
- package/dist/posthog-and-ga/main.js.map +2 -2
- package/dist/progressive-scroll/index.js.map +2 -2
- package/dist/quick-fix/reload.js.map +2 -2
- package/dist/seo/schema.js.map +2 -2
- package/dist/test/sample.js.map +2 -2
- package/dist/testimonials/index.js.map +2 -2
- package/dist/timeline/index.js.map +2 -2
- package/dist/tracking/fill-form-fields.js.map +2 -2
- package/dist/tracking/form-tracker.js.map +2 -2
- package/dist/tracking/page-categories.js.map +2 -2
- package/dist/tracking/user-journey.js.map +2 -2
- package/dist/tracking/utm-links.js.map +2 -2
- package/dist/utils/sample.js.map +2 -2
- package/dist/validations/localhost.js.map +2 -2
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../bin/live-reload.js", "../../src/accordians/dropdown.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", "// dropdown.ts\n\n// Types for dropdown functionality\ninterface DropdownElements {\n wrapper: HTMLElement;\n toggle: HTMLElement;\n content: HTMLElement;\n name: string;\n }\n \n export interface FyndDropdownAPI {\n close: (dropdownName: string) => void;\n closeAll: () => void;\n init: () => void;\n }\n \n // Helper function to find dropdown elements\n function findDropdownElements(dropdownName: string): DropdownElements | null {\n const wrapper: HTMLElement | null = document.querySelector(`[fynd-dropdown=\"wrapper\"][fynd-dropdown-name=\"${dropdownName}\"]`);\n if (!wrapper) return null;\n \n const toggle: HTMLElement | null = wrapper.querySelector('[fynd-dropdown=\"toggle\"]');\n const content: HTMLElement | null = wrapper.querySelector('[fynd-dropdown=\"content\"]');\n \n if (!toggle || !content) return null;\n \n return {\n wrapper,\n toggle,\n content,\n name: dropdownName\n };\n }\n \n // Function to close all dropdowns (optionally exclude current one)\n function closeAllDropdowns(excludeDropdownName: string | null = null): void {\n const allWrappers: NodeListOf<HTMLElement> = document.querySelectorAll('[fynd-dropdown=\"wrapper\"][fynd-dropdown-name]');\n allWrappers.forEach((wrapper: HTMLElement): void => {\n const dropdownName: string | null = wrapper.getAttribute('fynd-dropdown-name');\n const content: HTMLElement | null = wrapper.querySelector('[fynd-dropdown=\"content\"]');\n \n // Close all dropdowns except the one being toggled\n if (content && dropdownName !== excludeDropdownName) {\n content.style.display = 'none';\n }\n });\n }\n \n // Initialize dropdown functionality with automatic open/close behavior\n function initializeDropdowns(): void {\n // Get all dropdown wrappers\n const dropdownWrappers: NodeListOf<HTMLElement> = document.querySelectorAll('[fynd-dropdown=\"wrapper\"][fynd-dropdown-name]');\n \n dropdownWrappers.forEach((wrapper: HTMLElement): void => {\n const dropdownName: string | null = wrapper.getAttribute('fynd-dropdown-name');\n const toggle: HTMLElement | null = wrapper.querySelector('[fynd-dropdown=\"toggle\"]');\n const content: HTMLElement | null = wrapper.querySelector('[fynd-dropdown=\"content\"]');\n \n if (!toggle || !content || !dropdownName) return;\n \n // Initially hide content\n content.style.display = 'none';\n \n // Remove existing listeners to prevent duplicates\n const newToggle = toggle.cloneNode(true) as HTMLElement;\n const newContent = content.cloneNode(true) as HTMLElement;\n toggle.parentNode?.replaceChild(newToggle, toggle);\n content.parentNode?.replaceChild(newContent, content);\n \n // Auto toggle dropdown on click (default behavior)\n newToggle.addEventListener('click', (e: Event): void => {\n e.stopPropagation();\n \n // Close all other dropdowns first\n closeAllDropdowns(dropdownName);\n \n // Toggle current dropdown automatically\n if (newContent.style.display === 'none') {\n newContent.style.display = 'block';\n } else {\n newContent.style.display = 'none';\n }\n });\n \n // Prevent content clicks from closing dropdown\n newContent.addEventListener('click', (e: Event): void => {\n e.stopPropagation();\n });\n });\n \n // Auto close dropdown when clicking outside (default behavior)\n document.removeEventListener('click', handleOutsideClick);\n document.addEventListener('click', handleOutsideClick);\n \n // Auto close dropdown on Escape key (default behavior)\n document.removeEventListener('keydown', handleEscapeKey);\n document.addEventListener('keydown', handleEscapeKey);\n }\n \n // Event handlers for automatic behavior\n function handleOutsideClick(): void {\n closeAllDropdowns();\n }\n \n function handleEscapeKey(e: KeyboardEvent): void {\n if (e.key === 'Escape') {\n closeAllDropdowns();\n }\n }\n \n // Minimal API - only for manual closing when needed\n export const fyndDropdown: FyndDropdownAPI = {\n close: (dropdownName: string): void => {\n const elements: DropdownElements | null = findDropdownElements(dropdownName);\n if (elements) {\n elements.content.style.display = 'none';\n }\n },\n \n closeAll: (): void => {\n closeAllDropdowns();\n },\n \n init: (): void => {\n initializeDropdowns();\n }\n };\n \n // Auto-initialize when DOM is ready\n if (document.readyState === 'loading') {\n document.addEventListener('DOMContentLoaded', initializeDropdowns);\n } else {\n initializeDropdowns();\n }\n \n // Export as default as well for convenience\n export default fyndDropdown;"],
|
|
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;
|
|
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", "// dropdown.ts\n\n// Types for dropdown functionality\ninterface DropdownElements {\n wrapper: HTMLElement;\n toggle: HTMLElement;\n content: HTMLElement;\n name: string;\n }\n \n export interface FyndDropdownAPI {\n close: (dropdownName: string) => void;\n closeAll: () => void;\n init: () => void;\n }\n \n // Helper function to find dropdown elements\n function findDropdownElements(dropdownName: string): DropdownElements | null {\n const wrapper: HTMLElement | null = document.querySelector(`[fynd-dropdown=\"wrapper\"][fynd-dropdown-name=\"${dropdownName}\"]`);\n if (!wrapper) return null;\n \n const toggle: HTMLElement | null = wrapper.querySelector('[fynd-dropdown=\"toggle\"]');\n const content: HTMLElement | null = wrapper.querySelector('[fynd-dropdown=\"content\"]');\n \n if (!toggle || !content) return null;\n \n return {\n wrapper,\n toggle,\n content,\n name: dropdownName\n };\n }\n \n // Function to close all dropdowns (optionally exclude current one)\n function closeAllDropdowns(excludeDropdownName: string | null = null): void {\n const allWrappers: NodeListOf<HTMLElement> = document.querySelectorAll('[fynd-dropdown=\"wrapper\"][fynd-dropdown-name]');\n allWrappers.forEach((wrapper: HTMLElement): void => {\n const dropdownName: string | null = wrapper.getAttribute('fynd-dropdown-name');\n const content: HTMLElement | null = wrapper.querySelector('[fynd-dropdown=\"content\"]');\n \n // Close all dropdowns except the one being toggled\n if (content && dropdownName !== excludeDropdownName) {\n content.style.display = 'none';\n }\n });\n }\n \n // Initialize dropdown functionality with automatic open/close behavior\n function initializeDropdowns(): void {\n // Get all dropdown wrappers\n const dropdownWrappers: NodeListOf<HTMLElement> = document.querySelectorAll('[fynd-dropdown=\"wrapper\"][fynd-dropdown-name]');\n \n dropdownWrappers.forEach((wrapper: HTMLElement): void => {\n const dropdownName: string | null = wrapper.getAttribute('fynd-dropdown-name');\n const toggle: HTMLElement | null = wrapper.querySelector('[fynd-dropdown=\"toggle\"]');\n const content: HTMLElement | null = wrapper.querySelector('[fynd-dropdown=\"content\"]');\n \n if (!toggle || !content || !dropdownName) return;\n \n // Initially hide content\n content.style.display = 'none';\n \n // Remove existing listeners to prevent duplicates\n const newToggle = toggle.cloneNode(true) as HTMLElement;\n const newContent = content.cloneNode(true) as HTMLElement;\n toggle.parentNode?.replaceChild(newToggle, toggle);\n content.parentNode?.replaceChild(newContent, content);\n \n // Auto toggle dropdown on click (default behavior)\n newToggle.addEventListener('click', (e: Event): void => {\n e.stopPropagation();\n \n // Close all other dropdowns first\n closeAllDropdowns(dropdownName);\n \n // Toggle current dropdown automatically\n if (newContent.style.display === 'none') {\n newContent.style.display = 'block';\n } else {\n newContent.style.display = 'none';\n }\n });\n \n // Prevent content clicks from closing dropdown\n newContent.addEventListener('click', (e: Event): void => {\n e.stopPropagation();\n });\n });\n \n // Auto close dropdown when clicking outside (default behavior)\n document.removeEventListener('click', handleOutsideClick);\n document.addEventListener('click', handleOutsideClick);\n \n // Auto close dropdown on Escape key (default behavior)\n document.removeEventListener('keydown', handleEscapeKey);\n document.addEventListener('keydown', handleEscapeKey);\n }\n \n // Event handlers for automatic behavior\n function handleOutsideClick(): void {\n closeAllDropdowns();\n }\n \n function handleEscapeKey(e: KeyboardEvent): void {\n if (e.key === 'Escape') {\n closeAllDropdowns();\n }\n }\n \n // Minimal API - only for manual closing when needed\n export const fyndDropdown: FyndDropdownAPI = {\n close: (dropdownName: string): void => {\n const elements: DropdownElements | null = findDropdownElements(dropdownName);\n if (elements) {\n elements.content.style.display = 'none';\n }\n },\n \n closeAll: (): void => {\n closeAllDropdowns();\n },\n \n init: (): void => {\n initializeDropdowns();\n }\n };\n \n // Auto-initialize when DOM is ready\n if (document.readyState === 'loading') {\n document.addEventListener('DOMContentLoaded', initializeDropdowns);\n } else {\n initializeDropdowns();\n }\n \n // Export as default as well for convenience\n export default fyndDropdown;"],
|
|
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;;;ACOE,WAAS,qBAAqB,cAA+C;AAC3E,UAAM,UAA8B,SAAS,cAAc,iDAAiD,YAAY,IAAI;AAC5H,QAAI,CAAC,QAAS,QAAO;AAErB,UAAM,SAA6B,QAAQ,cAAc,0BAA0B;AACnF,UAAM,UAA8B,QAAQ,cAAc,2BAA2B;AAErF,QAAI,CAAC,UAAU,CAAC,QAAS,QAAO;AAEhC,WAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA,MAAM;AAAA,IACR;AAAA,EACF;AAGA,WAAS,kBAAkB,sBAAqC,MAAY;AAC1E,UAAM,cA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wB;AAC/C,QAAI,EAAE,QAAQ,UAAU;AACtB,wBAAkB;AAAA,IACpB;AAAA,EACF;AAGO,MAAM,eAAgC;AAAA,IAC3C,OAAO,CAAC,iBAA+B;AACrC,YAAM,WAAoC,qBAAqB,YAAY;AAC3E,UAAI,UAAU;AACZ,iBAAS,QAAQ,MAAM,UAAU;AAAA,MACnC;AAAA,IACF;AAAA,IAEA,UAAU,MAAY;AACpB,wBAAkB;AAAA,IACpB;AAAA,IAEA,MAAM,MAAY;AAChB,0BAAoB;AAAA,IACtB;AAAA,EACF;AAGA,MAAI,SAAS,eAAe,WAAW;AACrC,aAAS,iBAAiB,oBAAoB,mBAAmB;AAAA,EACnE,OAAO;AACL,wBAAoB;AAAA,EACtB;AAGA,MAAO,mBAAQ;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../bin/live-reload.js", "../../src/accordians/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", "// Type definitions\ninterface GSAPElement extends HTMLElement {\n gsapAnimation?: { kill(): void };\n }\n \n\n \n document.addEventListener(\"DOMContentLoaded\", (): void => {\n const faqWrappers: NodeListOf<HTMLElement> = document.querySelectorAll('[fynd-faq-element=\"wrapper\"]');\n \n faqWrappers.forEach((wrapper: HTMLElement): void => {\n const toggle: HTMLElement | null = wrapper.querySelector('[fynd-faq-element=\"toggle\"]');\n const content: GSAPElement | null = wrapper.querySelector('[fynd-faq-element=\"content\"]');\n const contentInner: HTMLElement | null = wrapper.querySelector('[fynd-faq-element=\"content-inner\"]');\n const xLine: HTMLElement | null = toggle?.querySelector('[fynd-faq-element=\"x-line\"]') || null;\n const yLine: HTMLElement | null = toggle?.querySelector('[fynd-faq-element=\"y-line\"]') || null;\n \n if (!toggle || !content || !contentInner || !xLine || !yLine) {\n console.warn('Required FAQ elements not found in wrapper');\n return;\n }\n \n const groupContainer: HTMLElement | null = wrapper.closest(\"[fynd-faq-group]\");\n const groupName: string | null = groupContainer?.getAttribute(\"fynd-faq-group\") || null;\n \n // Get the FAQ type - either \"one-at-a-time\" or \"multiple-at-a-time\"\n const faqType: string = groupContainer?.getAttribute(\"fynd-faq-type\") || \"one-at-a-time\";\n \n if (wrapper.getAttribute(\"fynd-faq-initialopen\") === \"true\") {\n gsap.set(content, { height: \"auto\", overflow: \"hidden\" });\n gsap.set(contentInner, { opacity: 1 });\n gsap.set(xLine, { rotation: 180 });\n gsap.set(yLine, { rotation: 270 });\n toggle.setAttribute(\"data-state\", \"open\");\n \n updateFaqGroupImage(wrapper, groupName); // Update image on load for initial open FAQ\n updateFaqGroupText(wrapper, groupName); // Update text on load for initial open FAQ\n updateFaqGroupButton(wrapper, groupName); // Update button on load for initial open FAQ\n } else {\n gsap.set(content, { height: 0 });\n gsap.set(contentInner, { opacity: 0 });\n gsap.set(xLine, { rotation: 0 });\n gsap.set(yLine, { rotation: 0 });\n toggle.setAttribute(\"data-state\", \"closed\");\n }\n \n let isAnimating: boolean = false;\n toggle.addEventListener(\"click\", (): void => {\n if (isAnimating) return;\n isAnimating = true;\n const isOpen: boolean = toggle.getAttribute(\"data-state\") === \"open\";\n \n // For \"one-at-a-time\" type, check if this is the last open FAQ\n if (faqType === \"one-at-a-time\" && groupContainer) {\n const openFAQs: NodeListOf<HTMLElement> = groupContainer.querySelectorAll(\n '[fynd-faq-element=\"wrapper\"] [data-state=\"open\"]'\n );\n \n if (isOpen && openFAQs.length === 1) {\n // Don't allow closing the last open FAQ in \"one-at-a-time\" mode\n isAnimating = false;\n return;\n }\n }\n \n // For \"multiple-at-a-time\" type, we can always toggle the current FAQ\n // For \"one-at-a-time\" type, we close all others when opening a new one\n \n if (isOpen) {\n // Always allow closing if it's open, regardless of mode\n closeAccordion(wrapper, (): void => {\n isAnimating = false;\n });\n } else {\n // If \"one-at-a-time\", close others before opening this one\n if (faqType === \"one-at-a-time\" && groupContainer) {\n closeOtherAccordions(groupContainer);\n }\n \n openAccordion(wrapper, groupName, (): void => {\n isAnimating = false;\n });\n }\n });\n });\n\n // Initialize ratio heights on page load\n handleRatioHeights();\n });\n\n // Handle window resize\n window.addEventListener(\"resize\", (): void => {\n handleRatioHeights();\n });\n\n // Function to handle ratio heights for FAQ image targets and tabgroups\n function handleRatioHeights(): void {\n // Find all FAQ image targets\n const imageTargets: NodeListOf<HTMLElement> = document.querySelectorAll('[fynd-faq-image-target]');\n \n imageTargets.forEach((imageTarget: HTMLElement): void => {\n // Find the wrapper div for this image target\n const wrapper: HTMLElement | null = imageTarget.parentElement;\n if (!wrapper) return;\n \n // Check if wrapper has ratio-height attribute set to \"true\"\n const ratioHeight: string | null = wrapper.getAttribute(\"ratio-height\");\n if (ratioHeight !== \"true\") return;\n \n // Reset height to auto first to get natural dimensions\n wrapper.style.height = \"auto\";\n \n // Wait for next frame to ensure the auto height is applied\n requestAnimationFrame((): void => {\n // Get the current rendered height\n const renderedHeight: number = wrapper.offsetHeight;\n \n // Set the rendered height as inline style for wrapper\n wrapper.style.height = `${renderedHeight}px`;\n });\n });\n\n // Handle all tabgroups with ratio-height=\"true\" separately\n const tabGroups: NodeListOf<HTMLElement> = document.querySelectorAll('[fynd-faq-tabgroup][ratio-height=\"true\"]');\n \n tabGroups.forEach((tabGroup: HTMLElement): void => {\n // Reset height to auto first to get natural dimensions\n tabGroup.style.height = \"auto\";\n \n // Wait for next frame to ensure the auto height is applied\n requestAnimationFrame((): void => {\n // Get the current rendered height\n const renderedHeight: number = tabGroup.offsetHeight;\n \n // Set the rendered height as inline style for tabgroup\n tabGroup.style.height = `${renderedHeight}px`;\n });\n });\n }\n \n function openAccordion(wrapper: HTMLElement, groupName: string | null, callback?: () => void): void {\n const toggle: HTMLElement | null = wrapper.querySelector('[fynd-faq-element=\"toggle\"]');\n const content: GSAPElement | null = wrapper.querySelector('[fynd-faq-element=\"content\"]');\n const contentInner: HTMLElement | null = wrapper.querySelector('[fynd-faq-element=\"content-inner\"]');\n const xLine: HTMLElement | null = toggle?.querySelector('[fynd-faq-element=\"x-line\"]') || null;\n const yLine: HTMLElement | null = toggle?.querySelector('[fynd-faq-element=\"y-line\"]') || null;\n \n if (!toggle || !content || !contentInner || !xLine || !yLine) {\n console.warn('Required elements not found for opening accordion');\n return;\n }\n \n if (content.gsapAnimation) {\n content.gsapAnimation.kill();\n }\n \n const timeline = gsap.timeline({\n onComplete: (): void => callback && callback(),\n });\n \n gsap.set(content, { height: \"auto\", visibility: \"hidden\", opacity: 0 });\n const height: number = content.offsetHeight;\n gsap.set(content, { height: 0, visibility: \"visible\", opacity: 1 });\n \n timeline.to(xLine, { rotation: 180, duration: 0.4, ease: \"power2.inOut\" }, 0);\n timeline.to(yLine, { rotation: 270, duration: 0.4, ease: \"power2.inOut\" }, 0);\n timeline.to(\n content,\n {\n height: height,\n duration: 0.5,\n ease: \"power3.inOut\",\n clearProps: \"height\",\n onComplete: (): void => {\n (content as HTMLElement).style.height = \"auto\";\n },\n },\n 0\n );\n timeline.to(\n contentInner,\n { opacity: 1, duration: 0.4, ease: \"power2.out\" },\n \"-=0.35\"\n );\n \n content.gsapAnimation = timeline;\n toggle.setAttribute(\"data-state\", \"open\");\n \n const icon: HTMLElement | null = toggle.querySelector('[fynd-faq-element=\"chevron\"]');\n if (icon) {\n gsap.to(icon, { rotation: 180, duration: 0.4, ease: \"back.out(1.7)\" });\n }\n \n // Update image for the group\n updateFaqGroupImage(wrapper, groupName);\n // Update text for the group\n updateFaqGroupText(wrapper, groupName);\n // Update button for the group\n updateFaqGroupButton(wrapper, groupName);\n }\n \n function closeAccordion(wrapper: HTMLElement, callback?: () => void): void {\n const toggle: HTMLElement | null = wrapper.querySelector('[fynd-faq-element=\"toggle\"]');\n const content: GSAPElement | null = wrapper.querySelector('[fynd-faq-element=\"content\"]');\n const contentInner: HTMLElement | null = wrapper.querySelector('[fynd-faq-element=\"content-inner\"]');\n const xLine: HTMLElement | null = toggle?.querySelector('[fynd-faq-element=\"x-line\"]') || null;\n const yLine: HTMLElement | null = toggle?.querySelector('[fynd-faq-element=\"y-line\"]') || null;\n \n if (!toggle || !content || !contentInner || !xLine || !yLine) {\n console.warn('Required elements not found for closing accordion');\n return;\n }\n \n if (content.gsapAnimation) {\n content.gsapAnimation.kill();\n }\n \n const height: number = content.offsetHeight;\n (content as HTMLElement).style.height = `${height}px`;\n \n const timeline = gsap.timeline({\n onComplete: (): void => callback && callback(),\n });\n \n timeline.to(xLine, { rotation: 0, duration: 0.4, ease: \"power2.inOut\" }, 0);\n timeline.to(yLine, { rotation: 0, duration: 0.4, ease: \"power2.inOut\" }, 0);\n timeline.to(\n contentInner,\n { opacity: 0, duration: 0.3, ease: \"power2.in\" },\n 0\n );\n timeline.to(\n content,\n { height: 0, duration: 0.4, ease: \"power3.inOut\" },\n \"-=0.25\"\n );\n \n content.gsapAnimation = timeline;\n toggle.setAttribute(\"data-state\", \"closed\");\n \n const icon: HTMLElement | null = toggle.querySelector('[fynd-faq-element=\"chevron\"]');\n if (icon) {\n gsap.to(icon, { rotation: 0, duration: 0.4, ease: \"back.out(1.7)\" });\n }\n }\n \n // Function to close all other accordions in the same group\n function closeOtherAccordions(groupContainer: HTMLElement): void {\n const openFAQs: NodeListOf<HTMLElement> = groupContainer.querySelectorAll(\n '[fynd-faq-element=\"wrapper\"] [data-state=\"open\"]'\n );\n openFAQs.forEach((openToggle: HTMLElement): void => {\n const wrapper: HTMLElement | null = openToggle.closest('[fynd-faq-element=\"wrapper\"]');\n if (wrapper) {\n closeAccordion(wrapper);\n }\n });\n }\n \n // Function to update the group image\n function updateFaqGroupImage(wrapper: HTMLElement, groupName: string | null): void {\n if (!groupName) return;\n\n // Find the group-level image element\n const groupImage: HTMLImageElement | null = document.querySelector(\n `[fynd-faq-image-target=\"${groupName}\"]`\n );\n if (!groupImage) return;\n\n // Find the image source inside the opened accordion\n const imageSource: HTMLImageElement | null = wrapper.querySelector(\"[fynd-faq-image-source]\");\n if (!imageSource) return;\n\n // Update the group image with the new source\n const newSrc: string | null = imageSource.getAttribute(\"src\");\n const newSrcset: string | null = imageSource.getAttribute(\"srcset\");\n\n if (newSrc) groupImage.setAttribute(\"src\", newSrc);\n if (newSrcset) groupImage.setAttribute(\"srcset\", \"\");\n //removing srcset for now\n }\n\n // Function to update the group text\n function updateFaqGroupText(wrapper: HTMLElement, groupName: string | null): void {\n if (!groupName) return;\n\n // Find the group-level text element\n const groupText: HTMLElement | null = document.querySelector(\n `[fynd-faq-text-target=\"${groupName}\"]`\n );\n if (!groupText) return;\n\n // Find the text source inside the opened accordion\n const textSource: HTMLElement | null = wrapper.querySelector(\"[fynd-faq-text-source]\");\n if (!textSource) return;\n\n // Update the group text with the new content\n groupText.textContent = textSource.textContent;\n }\n\n // Function to update the group button\n function updateFaqGroupButton(wrapper: HTMLElement, groupName: string | null): void {\n if (!groupName) return;\n\n // Find the group-level button elements\n const buttonTextTarget: HTMLElement | null = document.querySelector(\n `[fynd-faq-button-text-target=\"${groupName}\"]`\n );\n const buttonLinkTarget: HTMLElement | null = document.querySelector(\n `[fynd-faq-button-link-target=\"${groupName}\"]`\n );\n\n // Find the link source inside the opened accordion\n const linkSource: HTMLAnchorElement | null = wrapper.querySelector(\"[fynd-faq-link-source]\");\n if (!linkSource) return;\n\n // Update the button text if target exists\n if (buttonTextTarget) {\n buttonTextTarget.textContent = linkSource.textContent;\n }\n\n // Update the button link if target exists\n if (buttonLinkTarget) {\n // Copy all attributes from linkSource to buttonLinkTarget\n for (let i = 0; i < linkSource.attributes.length; i++) {\n const attr = linkSource.attributes[i];\n buttonLinkTarget.setAttribute(attr.name, attr.value);\n }\n }\n }\n \n // Function to ensure at least one FAQ is open in \"one-at-a-time\" mode\n function ensureOneFaqOpen(groupContainer: HTMLElement | null): void {\n if (!groupContainer) return;\n \n const faqType: string = groupContainer.getAttribute(\"fynd-faq-type\") || \"one-at-a-time\";\n \n // Only apply this to \"one-at-a-time\" type\n if (faqType !== \"one-at-a-time\") return;\n \n const openFAQs: NodeListOf<HTMLElement> = groupContainer.querySelectorAll(\n '[fynd-faq-element=\"wrapper\"] [data-state=\"open\"]'\n );\n \n // If no FAQs are open, open the first one\n if (openFAQs.length === 0) {\n const firstFaq: HTMLElement | null = groupContainer.querySelector(\n '[fynd-faq-element=\"wrapper\"]'\n );\n if (firstFaq) {\n const firstToggle: HTMLElement | null = firstFaq.querySelector('[fynd-faq-element=\"toggle\"]');\n if (firstToggle) {\n const groupName: string | null = groupContainer.getAttribute(\"fynd-faq-group\");\n openAccordion(firstFaq, groupName);\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;
|
|
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", "// Type definitions\ninterface GSAPElement extends HTMLElement {\n gsapAnimation?: { kill(): void };\n }\n \n\n \n document.addEventListener(\"DOMContentLoaded\", (): void => {\n const faqWrappers: NodeListOf<HTMLElement> = document.querySelectorAll('[fynd-faq-element=\"wrapper\"]');\n \n faqWrappers.forEach((wrapper: HTMLElement): void => {\n const toggle: HTMLElement | null = wrapper.querySelector('[fynd-faq-element=\"toggle\"]');\n const content: GSAPElement | null = wrapper.querySelector('[fynd-faq-element=\"content\"]');\n const contentInner: HTMLElement | null = wrapper.querySelector('[fynd-faq-element=\"content-inner\"]');\n const xLine: HTMLElement | null = toggle?.querySelector('[fynd-faq-element=\"x-line\"]') || null;\n const yLine: HTMLElement | null = toggle?.querySelector('[fynd-faq-element=\"y-line\"]') || null;\n \n if (!toggle || !content || !contentInner || !xLine || !yLine) {\n console.warn('Required FAQ elements not found in wrapper');\n return;\n }\n \n const groupContainer: HTMLElement | null = wrapper.closest(\"[fynd-faq-group]\");\n const groupName: string | null = groupContainer?.getAttribute(\"fynd-faq-group\") || null;\n \n // Get the FAQ type - either \"one-at-a-time\" or \"multiple-at-a-time\"\n const faqType: string = groupContainer?.getAttribute(\"fynd-faq-type\") || \"one-at-a-time\";\n \n if (wrapper.getAttribute(\"fynd-faq-initialopen\") === \"true\") {\n gsap.set(content, { height: \"auto\", overflow: \"hidden\" });\n gsap.set(contentInner, { opacity: 1 });\n gsap.set(xLine, { rotation: 180 });\n gsap.set(yLine, { rotation: 270 });\n toggle.setAttribute(\"data-state\", \"open\");\n \n updateFaqGroupImage(wrapper, groupName); // Update image on load for initial open FAQ\n updateFaqGroupText(wrapper, groupName); // Update text on load for initial open FAQ\n updateFaqGroupButton(wrapper, groupName); // Update button on load for initial open FAQ\n } else {\n gsap.set(content, { height: 0 });\n gsap.set(contentInner, { opacity: 0 });\n gsap.set(xLine, { rotation: 0 });\n gsap.set(yLine, { rotation: 0 });\n toggle.setAttribute(\"data-state\", \"closed\");\n }\n \n let isAnimating: boolean = false;\n toggle.addEventListener(\"click\", (): void => {\n if (isAnimating) return;\n isAnimating = true;\n const isOpen: boolean = toggle.getAttribute(\"data-state\") === \"open\";\n \n // For \"one-at-a-time\" type, check if this is the last open FAQ\n if (faqType === \"one-at-a-time\" && groupContainer) {\n const openFAQs: NodeListOf<HTMLElement> = groupContainer.querySelectorAll(\n '[fynd-faq-element=\"wrapper\"] [data-state=\"open\"]'\n );\n \n if (isOpen && openFAQs.length === 1) {\n // Don't allow closing the last open FAQ in \"one-at-a-time\" mode\n isAnimating = false;\n return;\n }\n }\n \n // For \"multiple-at-a-time\" type, we can always toggle the current FAQ\n // For \"one-at-a-time\" type, we close all others when opening a new one\n \n if (isOpen) {\n // Always allow closing if it's open, regardless of mode\n closeAccordion(wrapper, (): void => {\n isAnimating = false;\n });\n } else {\n // If \"one-at-a-time\", close others before opening this one\n if (faqType === \"one-at-a-time\" && groupContainer) {\n closeOtherAccordions(groupContainer);\n }\n \n openAccordion(wrapper, groupName, (): void => {\n isAnimating = false;\n });\n }\n });\n });\n\n // Initialize ratio heights on page load\n handleRatioHeights();\n });\n\n // Handle window resize\n window.addEventListener(\"resize\", (): void => {\n handleRatioHeights();\n });\n\n // Function to handle ratio heights for FAQ image targets and tabgroups\n function handleRatioHeights(): void {\n // Find all FAQ image targets\n const imageTargets: NodeListOf<HTMLElement> = document.querySelectorAll('[fynd-faq-image-target]');\n \n imageTargets.forEach((imageTarget: HTMLElement): void => {\n // Find the wrapper div for this image target\n const wrapper: HTMLElement | null = imageTarget.parentElement;\n if (!wrapper) return;\n \n // Check if wrapper has ratio-height attribute set to \"true\"\n const ratioHeight: string | null = wrapper.getAttribute(\"ratio-height\");\n if (ratioHeight !== \"true\") return;\n \n // Reset height to auto first to get natural dimensions\n wrapper.style.height = \"auto\";\n \n // Wait for next frame to ensure the auto height is applied\n requestAnimationFrame((): void => {\n // Get the current rendered height\n const renderedHeight: number = wrapper.offsetHeight;\n \n // Set the rendered height as inline style for wrapper\n wrapper.style.height = `${renderedHeight}px`;\n });\n });\n\n // Handle all tabgroups with ratio-height=\"true\" separately\n const tabGroups: NodeListOf<HTMLElement> = document.querySelectorAll('[fynd-faq-tabgroup][ratio-height=\"true\"]');\n \n tabGroups.forEach((tabGroup: HTMLElement): void => {\n // Reset height to auto first to get natural dimensions\n tabGroup.style.height = \"auto\";\n \n // Wait for next frame to ensure the auto height is applied\n requestAnimationFrame((): void => {\n // Get the current rendered height\n const renderedHeight: number = tabGroup.offsetHeight;\n \n // Set the rendered height as inline style for tabgroup\n tabGroup.style.height = `${renderedHeight}px`;\n });\n });\n }\n \n function openAccordion(wrapper: HTMLElement, groupName: string | null, callback?: () => void): void {\n const toggle: HTMLElement | null = wrapper.querySelector('[fynd-faq-element=\"toggle\"]');\n const content: GSAPElement | null = wrapper.querySelector('[fynd-faq-element=\"content\"]');\n const contentInner: HTMLElement | null = wrapper.querySelector('[fynd-faq-element=\"content-inner\"]');\n const xLine: HTMLElement | null = toggle?.querySelector('[fynd-faq-element=\"x-line\"]') || null;\n const yLine: HTMLElement | null = toggle?.querySelector('[fynd-faq-element=\"y-line\"]') || null;\n \n if (!toggle || !content || !contentInner || !xLine || !yLine) {\n console.warn('Required elements not found for opening accordion');\n return;\n }\n \n if (content.gsapAnimation) {\n content.gsapAnimation.kill();\n }\n \n const timeline = gsap.timeline({\n onComplete: (): void => callback && callback(),\n });\n \n gsap.set(content, { height: \"auto\", visibility: \"hidden\", opacity: 0 });\n const height: number = content.offsetHeight;\n gsap.set(content, { height: 0, visibility: \"visible\", opacity: 1 });\n \n timeline.to(xLine, { rotation: 180, duration: 0.4, ease: \"power2.inOut\" }, 0);\n timeline.to(yLine, { rotation: 270, duration: 0.4, ease: \"power2.inOut\" }, 0);\n timeline.to(\n content,\n {\n height: height,\n duration: 0.5,\n ease: \"power3.inOut\",\n clearProps: \"height\",\n onComplete: (): void => {\n (content as HTMLElement).style.height = \"auto\";\n },\n },\n 0\n );\n timeline.to(\n contentInner,\n { opacity: 1, duration: 0.4, ease: \"power2.out\" },\n \"-=0.35\"\n );\n \n content.gsapAnimation = timeline;\n toggle.setAttribute(\"data-state\", \"open\");\n \n const icon: HTMLElement | null = toggle.querySelector('[fynd-faq-element=\"chevron\"]');\n if (icon) {\n gsap.to(icon, { rotation: 180, duration: 0.4, ease: \"back.out(1.7)\" });\n }\n \n // Update image for the group\n updateFaqGroupImage(wrapper, groupName);\n // Update text for the group\n updateFaqGroupText(wrapper, groupName);\n // Update button for the group\n updateFaqGroupButton(wrapper, groupName);\n }\n \n function closeAccordion(wrapper: HTMLElement, callback?: () => void): void {\n const toggle: HTMLElement | null = wrapper.querySelector('[fynd-faq-element=\"toggle\"]');\n const content: GSAPElement | null = wrapper.querySelector('[fynd-faq-element=\"content\"]');\n const contentInner: HTMLElement | null = wrapper.querySelector('[fynd-faq-element=\"content-inner\"]');\n const xLine: HTMLElement | null = toggle?.querySelector('[fynd-faq-element=\"x-line\"]') || null;\n const yLine: HTMLElement | null = toggle?.querySelector('[fynd-faq-element=\"y-line\"]') || null;\n \n if (!toggle || !content || !contentInner || !xLine || !yLine) {\n console.warn('Required elements not found for closing accordion');\n return;\n }\n \n if (content.gsapAnimation) {\n content.gsapAnimation.kill();\n }\n \n const height: number = content.offsetHeight;\n (content as HTMLElement).style.height = `${height}px`;\n \n const timeline = gsap.timeline({\n onComplete: (): void => callback && callback(),\n });\n \n timeline.to(xLine, { rotation: 0, duration: 0.4, ease: \"power2.inOut\" }, 0);\n timeline.to(yLine, { rotation: 0, duration: 0.4, ease: \"power2.inOut\" }, 0);\n timeline.to(\n contentInner,\n { opacity: 0, duration: 0.3, ease: \"power2.in\" },\n 0\n );\n timeline.to(\n content,\n { height: 0, duration: 0.4, ease: \"power3.inOut\" },\n \"-=0.25\"\n );\n \n content.gsapAnimation = timeline;\n toggle.setAttribute(\"data-state\", \"closed\");\n \n const icon: HTMLElement | null = toggle.querySelector('[fynd-faq-element=\"chevron\"]');\n if (icon) {\n gsap.to(icon, { rotation: 0, duration: 0.4, ease: \"back.out(1.7)\" });\n }\n }\n \n // Function to close all other accordions in the same group\n function closeOtherAccordions(groupContainer: HTMLElement): void {\n const openFAQs: NodeListOf<HTMLElement> = groupContainer.querySelectorAll(\n '[fynd-faq-element=\"wrapper\"] [data-state=\"open\"]'\n );\n openFAQs.forEach((openToggle: HTMLElement): void => {\n const wrapper: HTMLElement | null = openToggle.closest('[fynd-faq-element=\"wrapper\"]');\n if (wrapper) {\n closeAccordion(wrapper);\n }\n });\n }\n \n // Function to update the group image\n function updateFaqGroupImage(wrapper: HTMLElement, groupName: string | null): void {\n if (!groupName) return;\n\n // Find the group-level image element\n const groupImage: HTMLImageElement | null = document.querySelector(\n `[fynd-faq-image-target=\"${groupName}\"]`\n );\n if (!groupImage) return;\n\n // Find the image source inside the opened accordion\n const imageSource: HTMLImageElement | null = wrapper.querySelector(\"[fynd-faq-image-source]\");\n if (!imageSource) return;\n\n // Update the group image with the new source\n const newSrc: string | null = imageSource.getAttribute(\"src\");\n const newSrcset: string | null = imageSource.getAttribute(\"srcset\");\n\n if (newSrc) groupImage.setAttribute(\"src\", newSrc);\n if (newSrcset) groupImage.setAttribute(\"srcset\", \"\");\n //removing srcset for now\n }\n\n // Function to update the group text\n function updateFaqGroupText(wrapper: HTMLElement, groupName: string | null): void {\n if (!groupName) return;\n\n // Find the group-level text element\n const groupText: HTMLElement | null = document.querySelector(\n `[fynd-faq-text-target=\"${groupName}\"]`\n );\n if (!groupText) return;\n\n // Find the text source inside the opened accordion\n const textSource: HTMLElement | null = wrapper.querySelector(\"[fynd-faq-text-source]\");\n if (!textSource) return;\n\n // Update the group text with the new content\n groupText.textContent = textSource.textContent;\n }\n\n // Function to update the group button\n function updateFaqGroupButton(wrapper: HTMLElement, groupName: string | null): void {\n if (!groupName) return;\n\n // Find the group-level button elements\n const buttonTextTarget: HTMLElement | null = document.querySelector(\n `[fynd-faq-button-text-target=\"${groupName}\"]`\n );\n const buttonLinkTarget: HTMLElement | null = document.querySelector(\n `[fynd-faq-button-link-target=\"${groupName}\"]`\n );\n\n // Find the link source inside the opened accordion\n const linkSource: HTMLAnchorElement | null = wrapper.querySelector(\"[fynd-faq-link-source]\");\n if (!linkSource) return;\n\n // Update the button text if target exists\n if (buttonTextTarget) {\n buttonTextTarget.textContent = linkSource.textContent;\n }\n\n // Update the button link if target exists\n if (buttonLinkTarget) {\n // Copy all attributes from linkSource to buttonLinkTarget\n for (let i = 0; i < linkSource.attributes.length; i++) {\n const attr = linkSource.attributes[i];\n buttonLinkTarget.setAttribute(attr.name, attr.value);\n }\n }\n }\n \n // Function to ensure at least one FAQ is open in \"one-at-a-time\" mode\n function ensureOneFaqOpen(groupContainer: HTMLElement | null): void {\n if (!groupContainer) return;\n \n const faqType: string = groupContainer.getAttribute(\"fynd-faq-type\") || \"one-at-a-time\";\n \n // Only apply this to \"one-at-a-time\" type\n if (faqType !== \"one-at-a-time\") return;\n \n const openFAQs: NodeListOf<HTMLElement> = groupContainer.querySelectorAll(\n '[fynd-faq-element=\"wrapper\"] [data-state=\"open\"]'\n );\n \n // If no FAQs are open, open the first one\n if (openFAQs.length === 0) {\n const firstFaq: HTMLElement | null = groupContainer.querySelector(\n '[fynd-faq-element=\"wrapper\"]'\n );\n if (firstFaq) {\n const firstToggle: HTMLElement | null = firstFaq.querySelector('[fynd-faq-element=\"toggle\"]');\n if (firstToggle) {\n const groupName: string | null = groupContainer.getAttribute(\"fynd-faq-group\");\n openAccordion(firstFaq, groupName);\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;;;ACHE,WAAS,iBAAiB,oBAAoB,MAAY;AACxD,UAAM,cAAuC,SAAS,iBAAiB,8BAA8B;AAErG,gBAAY,QAAQ,CAAC,YAA+B;AAClD,YAAM,SAA6B,QAAQ,cAAc,6BAA6B;AACtF,YAAM,UAA8B,QAAQ,cAAc,8BAA8B;AACxF,YAAM,eAAmC,QAAQ,cAAc,oCAAoC;AACnG,YAAM,QAA4B,QAAQ,cAAc,6BAA6B,KAAK;AAC1F,YAAM,QAA4B,QAAQ,cAAc,6BAA6B,KAAK;AAE1F,UAAI,CAAC,UAAU,CAAC,WAAW,CAAC,gBAAgB,CAAC,SAAS,CAAC,OAAO;AAC5D,gBAAQ,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reload.js", "../../src/cms-listing/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", "function isHTMLElement(element: Element | null): element is HTMLElement {\n return element instanceof HTMLElement;\n}\n\nconst clearButton = document.getElementById('clear-button');\nconst fsClearButton = document.getElementById('fs-clear');\n\nif (isHTMLElement(clearButton) && isHTMLElement(fsClearButton)) {\n clearButton.addEventListener('click', (event: MouseEvent): void => {\n fsClearButton.click();\n });\n}\n\nexport {};"],
|
|
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;
|
|
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", "function isHTMLElement(element: Element | null): element is HTMLElement {\n return element instanceof HTMLElement;\n}\n\nconst clearButton = document.getElementById('clear-button');\nconst fsClearButton = document.getElementById('fs-clear');\n\nif (isHTMLElement(clearButton) && isHTMLElement(fsClearButton)) {\n clearButton.addEventListener('click', (event: MouseEvent): void => {\n fsClearButton.click();\n });\n}\n\nexport {};"],
|
|
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;;;ACVA,WAAS,cAAc,SAAiD;AACpE,WAAO,mBAAmB;AAAA,EAC9B;AAEA,MAAM,cAAc,SAAS,eAAe,cAAc;AAC1D,MAAM,gBAAgB,SAAS,eAAe,UAAU;AAExD,MAAI,cAAc,WAAW,KAAK,cAAc,aAAa,GAAG;AAC5D,gBAAY,iBAAiB,SAAS,CAAC,UAA4B;AAC/D,oBAAc,MAAM;AAAA,IACxB,CAAC;AAAA,EACL;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../bin/live-reload.js", "../../src/filters/clear-search.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", "const input = document.querySelector('[fynd-show-clear]') as HTMLInputElement;\nconst clearButton = document.querySelector('[fynd-input-clear]') as HTMLElement;\n\n// Handle input change\nif (input) {\n input.addEventListener('input', (): void => {\n if (input.value.trim() !== '') {\n input.setAttribute('fynd-show-clear', 'true');\n } else {\n input.setAttribute('fynd-show-clear', 'false');\n }\n });\n}\n\n// Handle clear button click\nif (clearButton && input) {\n clearButton.addEventListener('click', (): void => {\n input.value = '';\n input.setAttribute('fynd-show-clear', 'false');\n input.dispatchEvent(new Event('input')); // Optional: Trigger change manually if others listen for it\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;
|
|
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", "const input = document.querySelector('[fynd-show-clear]') as HTMLInputElement;\nconst clearButton = document.querySelector('[fynd-input-clear]') as HTMLElement;\n\n// Handle input change\nif (input) {\n input.addEventListener('input', (): void => {\n if (input.value.trim() !== '') {\n input.setAttribute('fynd-show-clear', 'true');\n } else {\n input.setAttribute('fynd-show-clear', 'false');\n }\n });\n}\n\n// Handle clear button click\nif (clearButton && input) {\n clearButton.addEventListener('click', (): void => {\n input.value = '';\n input.setAttribute('fynd-show-clear', 'false');\n input.dispatchEvent(new Event('input')); // Optional: Trigger change manually if others listen for it\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;;;ACVA,MAAM,QAAQ,SAAS,cAAc,mBAAmB;AACxD,MAAM,cAAc,SAAS,cAAc,oBAAoB;AAG/D,MAAI,OAAO;AACT,UAAM,iBAAiB,SAAS,MAAY;AAC1C,UAAI,MAAM,MAAM,KAAK,MAAM,IAAI;AAC7B,cAAM,aAAa,mBAAmB,MAAM;AAAA,MAC9C,OAAO;AACL,cAAM,aAAa,mBAAmB,OAAO;AAAA,MAC/C;AAAA,IACF,CAAC;AAAA,EACH;AAGA,MAAI,eAAe,OAAO;AACxB,gBAAY,iBAAiB,SAAS,MAAY;AAChD,YAAM,QAAQ;AACd,YAAM,aAAa,mBAAmB,OAAO;AAC7C,YAAM,cAAc,IAAI,MAAM,OAAO,CAAC;AAAA,IACxC,CAAC;AAAA,EACH;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../bin/live-reload.js", "../../src/filters/show-count.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", "function logUrlParams(): number {\n const urlParams = new URLSearchParams(window.location.search);\n \n // Extract geography as an array\n const geography =\n urlParams.get(\"geography\")?.split(\",\").filter(Boolean) || [];\n \n // Extract tags as an array\n const tags = urlParams.get(\"tag\")?.split(\",\").filter(Boolean) || [];\n \n // Extract tags as an array\n const products = urlParams.get(\"product\")?.split(\",\").filter(Boolean) || [];\n \n // Extract tags as an array\n const solutions = urlParams.get(\"solution\")?.split(\",\").filter(Boolean) || [];\n \n // Extract tags as an array\n const category = urlParams.get(\"category\")?.split(\",\").filter(Boolean) || [];\n \n // Check for verified toggle (should be \"true\" in URL)\n const verified = urlParams.get(\"verified\") === \"true\";\n \n // Calculate total count\n let totalCount =\n geography.length +\n tags.length +\n products.length +\n solutions.length +\n category.length +\n (verified ? 1 : 0);\n \n // Create JSON object\n const filters = {\n geography,\n tags,\n products,\n solutions,\n verified,\n category,\n };\n \n // Log JSON object to console\n console.log(JSON.stringify(filters, null, 2));\n \n // Log counts separately\n // console.log(`Geography Count: ${geography.length}`);\n // console.log(`Tags Count: ${tags.length}`);\n // console.log(`Verified: ${verified}`);\n // console.log(`Total Count: ${totalCount}`);\n \n return totalCount;\n }\n \n function updateCountText(totalCount: number): void {\n const totalCountText = document.querySelector(\"[fynd-filters-count]\") as HTMLElement;\n const clearAllButton = document.querySelector(\"[fynd-clear-all]\") as HTMLElement;\n if (!totalCountText) return;\n \n if (totalCount > 0) {\n totalCountText.innerHTML = totalCount.toString();\n totalCountText.style.display = \"flex\";\n if (clearAllButton) {\n clearAllButton.style.display = \"block\";\n }\n } else {\n totalCountText.innerHTML = \"0\";\n totalCountText.style.display = \"none\";\n if (clearAllButton) {\n clearAllButton.style.display = \"none\";\n }\n }\n }\n \n document.addEventListener(\"DOMContentLoaded\", (): void => {\n setTimeout((): void => {\n let totalCount = logUrlParams();\n updateCountText(totalCount);\n }, 200);\n \n document.querySelectorAll(\"[fynd-filter-box]\").forEach((div): void => {\n div.addEventListener(\"click\", (): void => {\n setTimeout((): void => {\n let totalCount = logUrlParams();\n updateCountText(totalCount);\n }, 200);\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;
|
|
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", "function logUrlParams(): number {\n const urlParams = new URLSearchParams(window.location.search);\n \n // Extract geography as an array\n const geography =\n urlParams.get(\"geography\")?.split(\",\").filter(Boolean) || [];\n \n // Extract tags as an array\n const tags = urlParams.get(\"tag\")?.split(\",\").filter(Boolean) || [];\n \n // Extract tags as an array\n const products = urlParams.get(\"product\")?.split(\",\").filter(Boolean) || [];\n \n // Extract tags as an array\n const solutions = urlParams.get(\"solution\")?.split(\",\").filter(Boolean) || [];\n \n // Extract tags as an array\n const category = urlParams.get(\"category\")?.split(\",\").filter(Boolean) || [];\n \n // Check for verified toggle (should be \"true\" in URL)\n const verified = urlParams.get(\"verified\") === \"true\";\n \n // Calculate total count\n let totalCount =\n geography.length +\n tags.length +\n products.length +\n solutions.length +\n category.length +\n (verified ? 1 : 0);\n \n // Create JSON object\n const filters = {\n geography,\n tags,\n products,\n solutions,\n verified,\n category,\n };\n \n // Log JSON object to console\n console.log(JSON.stringify(filters, null, 2));\n \n // Log counts separately\n // console.log(`Geography Count: ${geography.length}`);\n // console.log(`Tags Count: ${tags.length}`);\n // console.log(`Verified: ${verified}`);\n // console.log(`Total Count: ${totalCount}`);\n \n return totalCount;\n }\n \n function updateCountText(totalCount: number): void {\n const totalCountText = document.querySelector(\"[fynd-filters-count]\") as HTMLElement;\n const clearAllButton = document.querySelector(\"[fynd-clear-all]\") as HTMLElement;\n if (!totalCountText) return;\n \n if (totalCount > 0) {\n totalCountText.innerHTML = totalCount.toString();\n totalCountText.style.display = \"flex\";\n if (clearAllButton) {\n clearAllButton.style.display = \"block\";\n }\n } else {\n totalCountText.innerHTML = \"0\";\n totalCountText.style.display = \"none\";\n if (clearAllButton) {\n clearAllButton.style.display = \"none\";\n }\n }\n }\n \n document.addEventListener(\"DOMContentLoaded\", (): void => {\n setTimeout((): void => {\n let totalCount = logUrlParams();\n updateCountText(totalCount);\n }, 200);\n \n document.querySelectorAll(\"[fynd-filter-box]\").forEach((div): void => {\n div.addEventListener(\"click\", (): void => {\n setTimeout((): void => {\n let totalCount = logUrlParams();\n updateCountText(totalCount);\n }, 200);\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;;;ACVA,WAAS,eAAuB;AAC5B,UAAM,YAAY,IAAI,gBAAgB,OAAO,SAAS,MAAM;AAG5D,UAAM,YACJ,UAAU,IAAI,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G,GAAG;AAEN,aAAS,iBAAiB,mBAAmB,EAAE,QAAQ,CAAC,QAAc;AACpE,UAAI,iBAAiB,SAAS,MAAY;AACxC,mBAAW,MAAY;AACrB,cAAI,aAAa,aAAa;AAC9B,0BAAgB,UAAU;AAAA,QAC5B,GAAG,GAAG;AAAA,MACR,CAAC;AAAA,IACH,CAAC;AAAA,EACH,CAAC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../bin/live-reload.js", "../../src/form/cs-gated-redirection.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", "document.addEventListener('DOMContentLoaded', function(): void {\n const currentSlug = window.location.pathname;\n const form: HTMLFormElement | null = document.querySelector('[fynd-webflow-form=\"cs-gated-redirection\"]');\n\n const redirectionCheckboxes = form?.querySelectorAll('input[type=radio]');\n\n redirectionCheckboxes?.forEach((checkbox) => {\n const redirectionSlug = '/' + checkbox.getAttribute('data-redirection-slug');\n if (redirectionSlug === currentSlug) {\n (checkbox as HTMLInputElement).checked = true;\n }\n });\n if (form) {\n form.addEventListener('submit', function(e: Event): void {\n setTimeout(function(): void {\n const selectedRadio: HTMLInputElement | null = form.querySelector(\"input[type=radio]:checked\");\n const selectedRedirectionSlug = '/' + selectedRadio?.getAttribute('data-redirection-slug');\n const fallbackButtonLink = document.querySelector('[data-redirection-fallback-link]');\n\n if (fallbackButtonLink) {\n fallbackButtonLink.setAttribute('href', selectedRedirectionSlug);\n }\n \n if (selectedRedirectionSlug) {\n window.location.href = selectedRedirectionSlug;\n }\n }, 500); \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;
|
|
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", "document.addEventListener('DOMContentLoaded', function(): void {\n const currentSlug = window.location.pathname;\n const form: HTMLFormElement | null = document.querySelector('[fynd-webflow-form=\"cs-gated-redirection\"]');\n\n const redirectionCheckboxes = form?.querySelectorAll('input[type=radio]');\n\n redirectionCheckboxes?.forEach((checkbox) => {\n const redirectionSlug = '/' + checkbox.getAttribute('data-redirection-slug');\n if (redirectionSlug === currentSlug) {\n (checkbox as HTMLInputElement).checked = true;\n }\n });\n if (form) {\n form.addEventListener('submit', function(e: Event): void {\n setTimeout(function(): void {\n const selectedRadio: HTMLInputElement | null = form.querySelector(\"input[type=radio]:checked\");\n const selectedRedirectionSlug = '/' + selectedRadio?.getAttribute('data-redirection-slug');\n const fallbackButtonLink = document.querySelector('[data-redirection-fallback-link]');\n\n if (fallbackButtonLink) {\n fallbackButtonLink.setAttribute('href', selectedRedirectionSlug);\n }\n \n if (selectedRedirectionSlug) {\n window.location.href = selectedRedirectionSlug;\n }\n }, 500); \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;;;ACVA,WAAS,iBAAiB,oBAAoB,WAAiB;AAC3D,UAAM,cAAc,OAAO,SAAS;AACpC,UAAM,OAA+B,SAAS,cAAc,4CAA4C;AAExG,UAAM,wBAAwB,MAAM,iBAAiB,mBAAmB;AAExE,2BAAuB,QAAQ,CAAC,aAAa;AACzC,YAAM,kBAAkB,MAAM,SAAS,aAAa,uBAAuB;AAC3E,UAAI,oBAAoB,aAAa;AACjC,QAAC,SAA8B,UAAU;AAAA,MAC7C;AAAA,IACJ,CAAC;AACD,QAAI,MAAM;AACR,WAAK,iBAAiB,UAAU,SAAS,GAAgB;AACvD,mBAAW,WAAiB;AAC1B,gBAAM,gBAAyC,KAAK,cAAc,2BAA2B;AAC7F,gBAAM,0BAA0B,MAAM,eAAe,aAAa,uBAAuB;AACzF,gBAAM,qBAAsB,SAAS,cAAc,kCAAkC;AAErF,cAAI,oBAAoB;AACtB,+BAAmB,aAAa,QAAQ,uBAAuB;AAAA,UACjE;AAEA,cAAI,yBAAyB;AAC3B,mBAAO,SAAS,OAAO;AAAA,UACzB;AAAA,QACF,GAAG,GAAG;AAAA,MACR,CAAC;AAAA,IACH;AAAA,EACF,CAAC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../bin/live-reload.js", "../../src/form/download-file.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", "function checkDownloadURL(url: string): string {\n const driveFileRegex = /https:\\/\\/drive\\.google\\.com\\/file\\/d\\/([a-zA-Z0-9_-]+)\\//;\n const directDownloadRegex = /https:\\/\\/drive\\.google\\.com\\/uc\\?export=download&id=([a-zA-Z0-9_-]+)/;\n\n // If it's already a direct download link, return as is\n if (directDownloadRegex.test(url)) {\n return url;\n }\n // If it's a normal Google Drive file link, convert it\n const match = url.match(driveFileRegex);\n if (match && match[1]) {\n const fileId = match[1];\n return `https://drive.google.com/uc?export=download&id=${fileId}`;\n }\n return url;\n}\n\nfunction updateDownloadLinks(url: string) {\n const container = document.getElementById(\"asset-success-richtext\");\n if (!container) return;\n\n // Find all <a> tags inside container\n const links = container.getElementsByTagName(\"a\");\n\n for (const link of links) {\n if (link.textContent && link.textContent.toLowerCase().includes(\"download\")) {\n link.href = url;\n }\n }\n}\n\n\ndocument.addEventListener(\"DOMContentLoaded\", function (): void {\n const submitButton = document.getElementById(\"asset-form-submit\") as HTMLInputElement;\n\n if (!submitButton) {\n console.error(\"Submit button not found\");\n return;\n }\n\n submitButton.addEventListener(\"click\", function (): void {\n // Wait 1000ms then check for success div\n setTimeout((): void => {\n const successEl = document.getElementById(\"asset-form-success\") as HTMLElement | null;\n if (successEl && successEl.style.display !== \"none\") {\n const downloadLink = document.getElementById(\"asset-download\") as HTMLAnchorElement | null;\n const checkedDownloadURL = checkDownloadURL(downloadLink?.href || \"\");\n downloadLink?.setAttribute(\"href\", checkedDownloadURL);\n updateDownloadLinks(checkedDownloadURL);\n if (downloadLink) {\n downloadLink.click();\n }\n }\n }, 2500);\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;
|
|
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", "function checkDownloadURL(url: string): string {\n const driveFileRegex = /https:\\/\\/drive\\.google\\.com\\/file\\/d\\/([a-zA-Z0-9_-]+)\\//;\n const directDownloadRegex = /https:\\/\\/drive\\.google\\.com\\/uc\\?export=download&id=([a-zA-Z0-9_-]+)/;\n\n // If it's already a direct download link, return as is\n if (directDownloadRegex.test(url)) {\n return url;\n }\n // If it's a normal Google Drive file link, convert it\n const match = url.match(driveFileRegex);\n if (match && match[1]) {\n const fileId = match[1];\n return `https://drive.google.com/uc?export=download&id=${fileId}`;\n }\n return url;\n}\n\nfunction updateDownloadLinks(url: string) {\n const container = document.getElementById(\"asset-success-richtext\");\n if (!container) return;\n\n // Find all <a> tags inside container\n const links = container.getElementsByTagName(\"a\");\n\n for (const link of links) {\n if (link.textContent && link.textContent.toLowerCase().includes(\"download\")) {\n link.href = url;\n }\n }\n}\n\n\ndocument.addEventListener(\"DOMContentLoaded\", function (): void {\n const submitButton = document.getElementById(\"asset-form-submit\") as HTMLInputElement;\n\n if (!submitButton) {\n console.error(\"Submit button not found\");\n return;\n }\n\n submitButton.addEventListener(\"click\", function (): void {\n // Wait 1000ms then check for success div\n setTimeout((): void => {\n const successEl = document.getElementById(\"asset-form-success\") as HTMLElement | null;\n if (successEl && successEl.style.display !== \"none\") {\n const downloadLink = document.getElementById(\"asset-download\") as HTMLAnchorElement | null;\n const checkedDownloadURL = checkDownloadURL(downloadLink?.href || \"\");\n downloadLink?.setAttribute(\"href\", checkedDownloadURL);\n updateDownloadLinks(checkedDownloadURL);\n if (downloadLink) {\n downloadLink.click();\n }\n }\n }, 2500);\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;;;ACVA,WAAS,iBAAiB,KAAqB;AAC7C,UAAM,iBAAiB;AAC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.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", "/**\n * Form Validation and Submission Script for Webflow\n * Handles phone validation, form submission prevention, and redirection logic\n * conververted version of https://cdn.jsdelivr.net/gh/Fynd-Design-Engineering/fynd-one@4.0.1/form/handler.min.js\n */\n\n// Type definitions\ninterface CountryData {\n dialCode: string;\n iso2: string;\n name: string;\n }\n \n interface IntlTelInputInstance {\n getSelectedCountryData(): CountryData;\n }\n \n interface PhoneInputElement extends HTMLInputElement {\n iti?: IntlTelInputInstance;\n }\n \n interface ValidationResult {\n isValid: boolean;\n message?: string;\n }\n \n interface RedirectionOptions {\n type: 'calendly' | 'hubspot' | 'webflow';\n newTab?: string;\n currentTab?: string;\n }\n \n // Extending Window interface for global variables\n declare global {\n interface Window {\n validationPassed?: boolean;\n _formSubmissionTime?: number;\n redirectionOptions?: RedirectionOptions;\n intlTelInputGlobals?: {\n getInstance(element: HTMLElement): IntlTelInputInstance | null;\n };\n validatePhone?: (selector: string, value: string) => ValidationResult;\n validatePhoneCustom?: (selector: string, value: string) => ValidationResult;\n jQuery?: any;\n $?: any;\n }\n }\n \n window.validationPassed = false; // Global flag to track validation status\n \n /**\n * Updates a hidden input with the country code from an initialized intl-tel-input element\n *\n * @param phoneInputSelector - Phone input element or its selector\n * @param countryCodeInputId - ID of the hidden input to update with country code\n */\n function updateCountryCode(\n phoneInputSelector: string | HTMLElement = \"#phone-number\",\n countryCodeInputId: string = \"#country-code\"\n ): string {\n const phoneInput: PhoneInputElement | null = \n typeof phoneInputSelector === \"string\"\n ? document.querySelector<PhoneInputElement>(phoneInputSelector)\n : phoneInputSelector as PhoneInputElement;\n \n const countryCodeInput = document.querySelector<HTMLInputElement>(countryCodeInputId);\n \n if (!phoneInput) {\n // console.error(\"Phone input not found\");\n return \"91\";\n }\n \n if (!countryCodeInput) {\n // console.error(\"Country code input not found\");\n return \"91\";\n }\n \n try {\n // Try to get country data directly - this will fail gracefully if not possible\n if (\n phoneInput.iti &&\n typeof phoneInput.iti.getSelectedCountryData === \"function\"\n ) {\n const countryData = phoneInput.iti.getSelectedCountryData();\n countryCodeInput.value = \"+\" + countryData.dialCode;\n return countryData.dialCode;\n } else if (\n window.intlTelInputGlobals &&\n typeof window.intlTelInputGlobals.getInstance === \"function\"\n ) {\n // Try using the global instance\n const iti = window.intlTelInputGlobals.getInstance(phoneInput);\n if (iti) {\n const countryData = iti.getSelectedCountryData();\n countryCodeInput.value = \"+\" + countryData.dialCode;\n return countryData.dialCode;\n }\n }\n \n // Default to India's country code (+91)\n countryCodeInput.value = \"+91\";\n return \"91\";\n } catch (error) {\n console.error(\"Error retrieving country code:\", error);\n // Default to India in case of error\n countryCodeInput.value = \"+91\";\n return \"91\";\n }\n }\n \n /**\n * Updates hidden inputs with page data like URL and page title\n */\n function updatePageData(): void {\n const productInput = document.getElementById(\"product\") as HTMLInputElement | null;\n const pageUrlInput = document.getElementById(\"page-url\") as HTMLInputElement | null;\n \n if (pageUrlInput) {\n pageUrlInput.value = window.location.href;\n }\n \n if (productInput) {\n productInput.value = document.title;\n }\n }\n \n /**\n * Generates a Calendly URL with user's information\n * @returns The Calendly URL or null if required fields are missing\n */\n function generateCalendlyURL(): string | null {\n if (!window.redirectionOptions || !window.redirectionOptions.newTab) {\n console.error(\n \"window.redirectionOptions not found or missing newTab property\"\n );\n return null;\n }\n \n const baseURL = window.redirectionOptions.newTab;\n const nameField = document.getElementById(\"first-name\") as HTMLInputElement | null;\n const lastNameField = document.getElementById(\"last-name\") as HTMLInputElement | null;\n const emailField = document.getElementById(\"work-email\") as HTMLInputElement | null;\n \n if (\n !nameField ||\n !nameField.value.trim() ||\n !lastNameField ||\n !lastNameField.value.trim() ||\n !emailField ||\n !emailField.value.trim()\n ) {\n console.error(\"Required fields missing or empty\");\n return null;\n }\n \n const fullName = `${nameField.value} ${lastNameField.value}`.trim();\n const email = emailField.value;\n const updatedURL = `${baseURL}?email=${encodeURIComponent(\n email\n )}&name=${encodeURIComponent(fullName)}`;\n return updatedURL;\n }\n \n /**\n * Generates a Hubspot URL with user's information\n * @returns The Hubspot URL or null if required fields are missing\n */\n function generateHubspotURL(): string | null {\n if (!window.redirectionOptions || !window.redirectionOptions.newTab) {\n console.error(\n \"window.redirectionOptions not found or missing newTab property\"\n );\n return null;\n }\n \n const baseURL = window.redirectionOptions.newTab;\n const nameField = document.getElementById(\"first-name\") as HTMLInputElement | null;\n const lastNameField = document.getElementById(\"last-name\") as HTMLInputElement | null;\n const emailField = document.getElementById(\"work-email\") as HTMLInputElement | null;\n const messageField = document.getElementById(\"message\") as HTMLTextAreaElement | null; // Optional field\n \n // Check only REQUIRED fields\n if (\n !nameField ||\n !nameField.value.trim() ||\n !lastNameField ||\n !lastNameField.value.trim() ||\n !emailField ||\n !emailField.value.trim()\n ) {\n console.error(\"Required fields missing or empty\");\n return null;\n }\n \n try {\n const url = new URL(baseURL);\n \n // Remove any existing params to avoid conflicts\n const paramsToRemove = [\n 'email', 'firstname', 'lastname', 'message',\n 'Email', 'FirstName', 'LastName', 'Message'\n ];\n \n paramsToRemove.forEach(param => url.searchParams.delete(param));\n \n // Add required parameters\n url.searchParams.set(\"email\", emailField.value.trim());\n url.searchParams.set(\"firstname\", nameField.value.trim());\n url.searchParams.set(\"lastname\", lastNameField.value.trim());\n \n // Add company parameter ONLY if field exists and has value\n if (messageField && messageField.value.trim()) {\n url.searchParams.set(\"message\", messageField.value.trim());\n }\n \n return url.toString();\n } catch (error) {\n console.error(\"Invalid URL:\", error);\n return null;\n }\n }\n \n\n \n /**\n * Handles the form submission process and redirection\n */\n function handleFormSubmission(): void {\n try {\n if (typeof handleRedirection === \"function\") {\n handleRedirection();\n } else {\n window.location.href = \"/thank-you\";\n }\n } catch (error) {\n console.error(\"Error during form submission:\", error);\n }\n }\n \n /**\n * Determines which type of redirection to perform\n */\n function handleRedirection(): void {\n if (!window.redirectionOptions || !window.redirectionOptions.type) {\n console.error(\n \"window.redirectionOptions not found or missing type property\"\n );\n return;\n }\n \n switch (window.redirectionOptions.type) {\n case \"calendly\":\n handleCalendlyRedirection();\n break;\n case \"hubspot\":\n handleHubspotRedirection();\n break;\n case \"webflow\":\n handleWebflowRedirection();\n break;\n default:\n console.error(\n \"Invalid redirection type:\",\n window.redirectionOptions.type\n );\n return;\n }\n }\n \n /**\n * Handles Calendly-specific redirection\n */\n function handleCalendlyRedirection(): void {\n const newTabUrl = generateCalendlyURL();\n const currentTabUrl = window.redirectionOptions?.currentTab;\n \n if (newTabUrl) {\n window.open(newTabUrl, \"_blank\");\n }\n \n if (currentTabUrl) {\n window.location.href = currentTabUrl;\n }\n }\n \n /**\n * Handles HubSpot-specific redirection\n */\n function handleHubspotRedirection(): void {\n const newTabUrl = generateHubspotURL();\n const currentTabUrl = window.redirectionOptions?.currentTab;\n \n if (newTabUrl) {\n window.open(newTabUrl, \"_blank\");\n }\n \n if (currentTabUrl) {\n window.location.href = currentTabUrl;\n }\n }\n \n /**\n * Handles Webflow-specific redirection\n */\n function handleWebflowRedirection(): void {\n const newTabUrl = window.redirectionOptions?.newTab;\n const currentTabUrl = window.redirectionOptions?.currentTab;\n \n if (newTabUrl) {\n window.open(newTabUrl, \"_blank\");\n }\n \n if (currentTabUrl) {\n window.location.href = currentTabUrl;\n }\n }\n \n /**\n * Converts the first option in select fields to actual placeholders with styling\n */\n function setupSelectPlaceholders(): void {\n // Find all select elements\n const selectFields = document.querySelectorAll<HTMLSelectElement>(\"select\");\n \n selectFields.forEach((select: HTMLSelectElement) => {\n // Get the first option\n const firstOption = select.querySelector<HTMLOptionElement>(\"option:first-child\");\n \n if (firstOption) {\n // Make it a true placeholder by adding these attributes\n firstOption.setAttribute(\"value\", \"\");\n firstOption.setAttribute(\"disabled\", \"disabled\");\n firstOption.setAttribute(\"selected\", \"selected\");\n \n // Set the select's initial selectedIndex to 0 (the placeholder)\n select.selectedIndex = 0;\n \n // Add a class to the select element to style it when showing placeholder\n select.classList.add(\"placeholder-active\");\n \n // Style the select element when showing the placeholder\n if (select.value === \"\") {\n select.style.color = \"#999999\"; // Placeholder color (gray)\n }\n \n // Change color when user selects a real option\n select.addEventListener(\"change\", () => {\n if (select.value) {\n select.style.color = \"\"; // Reset to default text color\n select.classList.remove(\"placeholder-active\");\n } else {\n select.style.color = \"#999999\"; // Back to placeholder color\n select.classList.add(\"placeholder-active\");\n }\n });\n }\n });\n \n // console.log(\"Select placeholders initialized\");\n }\n \n /**\n * Override Webflow's form submission functionality\n */\n function overrideWebflowFormSubmission(): void {\n const form = document.querySelector<HTMLFormElement>(\"[data-form-handler]\");\n const phoneField = document.querySelector<HTMLInputElement>(\"#phone-number\");\n \n if (!form || !phoneField) {\n console.error(\"Form or phone field not found\");\n return;\n }\n \n // Add validation using setCustomValidity\n phoneField.addEventListener(\"invalid\", (event: Event) => {\n if (window.validatePhone) {\n const validation = window.validatePhone(\"phone-number\", phoneField.value);\n if (!validation.isValid) {\n phoneField.setCustomValidity(\n validation.message || \"Please enter a valid phone number\"\n );\n }\n }\n });\n \n phoneField.addEventListener(\"input\", () => {\n phoneField.setCustomValidity(\"\");\n });\n \n phoneField.addEventListener(\"blur\", () => {\n if (window.validatePhone) {\n const validation = window.validatePhone(\"phone-number\", phoneField.value);\n if (!validation.isValid && phoneField.value.trim() !== \"\") {\n phoneField.setCustomValidity(\n validation.message || \"Please enter a valid phone number\"\n );\n } else {\n phoneField.setCustomValidity(\"\");\n }\n }\n });\n \n // Handle form submission with redirection\n form.addEventListener(\n \"submit\",\n (event: Event) => {\n // Use validatePhoneCustom as primary method (more reliable)\n let validation: ValidationResult;\n if (typeof window.validatePhoneCustom === \"function\") {\n validation = window.validatePhoneCustom(\n \"phone-number\",\n phoneField.value\n );\n } else if (typeof window.validatePhone === \"function\") {\n validation = window.validatePhone(\"phone-number\", phoneField.value);\n } else {\n console.error(\"No phone validation function available\");\n event.preventDefault();\n return false;\n }\n \n if (!validation.isValid) {\n phoneField.setCustomValidity(\n validation.message || \"Please enter a valid phone number\"\n );\n event.preventDefault();\n phoneField.focus();\n return false;\n } else {\n phoneField.setCustomValidity(\"\");\n \n // console.log(\"Validation passed, allowing form submission\");\n window.validationPassed = true;\n window._formSubmissionTime = Date.now();\n \n // Set up a delayed redirection that gives Webflow time to process\n setTimeout(() => {\n console.log(\"Redirecting....\");\n handleFormSubmission();\n }, 3000);\n \n // Let the form submit normally\n return true;\n }\n },\n true\n );\n \n // Additional Webflow success detection\n if (window.jQuery || window.$) {\n const $ = window.jQuery || window.$;\n \n // Listen for Webflow's success event\n $(document).on(\"webflow-form-success\", (e: any) => {\n if (e.target === form) {\n // console.log(\"Webflow success event detected\");\n if (window.posthog && window.getTrackingPropertiesWithForm) {\n window.posthog.capture(\n \"form_success\",\n window.getTrackingPropertiesWithForm(\n window.interactedForm || \"unknown_form\"\n )\n );\n }\n \n handleFormSubmission();\n } else {\n // event for error in future\n }\n });\n }\n \n // console.log(\"Form validation and redirection setup complete\");\n }\n \n /**\n * Initialize everything when the DOM is ready\n */\n document.addEventListener(\"DOMContentLoaded\", () => {\n // Detect phone input\n const phoneField = document.querySelector<HTMLInputElement>(\"#phone-number\");\n if (phoneField) {\n // Add validation on blur - using only browser validation\n phoneField.addEventListener(\"blur\", () => {\n if (typeof window.validatePhone === \"function\") {\n const validation = window.validatePhone(\n \"phone-number\",\n phoneField.value\n );\n if (!validation.isValid && phoneField.value.trim() !== \"\") {\n phoneField.setCustomValidity(\n validation.message || \"Please enter a valid phone number\"\n );\n } else {\n phoneField.setCustomValidity(\"\");\n }\n }\n });\n }\n \n // Select placeholders\n setupSelectPlaceholders();\n \n // Initialize country code and page data\n updateCountryCode();\n updatePageData();\n \n // Override Webflow form submission\n overrideWebflowFormSubmission();\n });\n\n// Export to make this file a module (fixes TypeScript global augmentation error)\nexport {};"],
|
|
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;
|
|
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", "/**\n * Form Validation and Submission Script for Webflow\n * Handles phone validation, form submission prevention, and redirection logic\n * conververted version of https://cdn.jsdelivr.net/gh/Fynd-Design-Engineering/fynd-one@4.0.1/form/handler.min.js\n */\n\n// Type definitions\ninterface CountryData {\n dialCode: string;\n iso2: string;\n name: string;\n }\n \n interface IntlTelInputInstance {\n getSelectedCountryData(): CountryData;\n }\n \n interface PhoneInputElement extends HTMLInputElement {\n iti?: IntlTelInputInstance;\n }\n \n interface ValidationResult {\n isValid: boolean;\n message?: string;\n }\n \n interface RedirectionOptions {\n type: 'calendly' | 'hubspot' | 'webflow';\n newTab?: string;\n currentTab?: string;\n }\n \n // Extending Window interface for global variables\n declare global {\n interface Window {\n validationPassed?: boolean;\n _formSubmissionTime?: number;\n redirectionOptions?: RedirectionOptions;\n intlTelInputGlobals?: {\n getInstance(element: HTMLElement): IntlTelInputInstance | null;\n };\n validatePhone?: (selector: string, value: string) => ValidationResult;\n validatePhoneCustom?: (selector: string, value: string) => ValidationResult;\n jQuery?: any;\n $?: any;\n }\n }\n \n window.validationPassed = false; // Global flag to track validation status\n \n /**\n * Updates a hidden input with the country code from an initialized intl-tel-input element\n *\n * @param phoneInputSelector - Phone input element or its selector\n * @param countryCodeInputId - ID of the hidden input to update with country code\n */\n function updateCountryCode(\n phoneInputSelector: string | HTMLElement = \"#phone-number\",\n countryCodeInputId: string = \"#country-code\"\n ): string {\n const phoneInput: PhoneInputElement | null = \n typeof phoneInputSelector === \"string\"\n ? document.querySelector<PhoneInputElement>(phoneInputSelector)\n : phoneInputSelector as PhoneInputElement;\n \n const countryCodeInput = document.querySelector<HTMLInputElement>(countryCodeInputId);\n \n if (!phoneInput) {\n // console.error(\"Phone input not found\");\n return \"91\";\n }\n \n if (!countryCodeInput) {\n // console.error(\"Country code input not found\");\n return \"91\";\n }\n \n try {\n // Try to get country data directly - this will fail gracefully if not possible\n if (\n phoneInput.iti &&\n typeof phoneInput.iti.getSelectedCountryData === \"function\"\n ) {\n const countryData = phoneInput.iti.getSelectedCountryData();\n countryCodeInput.value = \"+\" + countryData.dialCode;\n return countryData.dialCode;\n } else if (\n window.intlTelInputGlobals &&\n typeof window.intlTelInputGlobals.getInstance === \"function\"\n ) {\n // Try using the global instance\n const iti = window.intlTelInputGlobals.getInstance(phoneInput);\n if (iti) {\n const countryData = iti.getSelectedCountryData();\n countryCodeInput.value = \"+\" + countryData.dialCode;\n return countryData.dialCode;\n }\n }\n \n // Default to India's country code (+91)\n countryCodeInput.value = \"+91\";\n return \"91\";\n } catch (error) {\n console.error(\"Error retrieving country code:\", error);\n // Default to India in case of error\n countryCodeInput.value = \"+91\";\n return \"91\";\n }\n }\n \n /**\n * Updates hidden inputs with page data like URL and page title\n */\n function updatePageData(): void {\n const productInput = document.getElementById(\"product\") as HTMLInputElement | null;\n const pageUrlInput = document.getElementById(\"page-url\") as HTMLInputElement | null;\n \n if (pageUrlInput) {\n pageUrlInput.value = window.location.href;\n }\n \n if (productInput) {\n productInput.value = document.title;\n }\n }\n \n /**\n * Generates a Calendly URL with user's information\n * @returns The Calendly URL or null if required fields are missing\n */\n function generateCalendlyURL(): string | null {\n if (!window.redirectionOptions || !window.redirectionOptions.newTab) {\n console.error(\n \"window.redirectionOptions not found or missing newTab property\"\n );\n return null;\n }\n \n const baseURL = window.redirectionOptions.newTab;\n const nameField = document.getElementById(\"first-name\") as HTMLInputElement | null;\n const lastNameField = document.getElementById(\"last-name\") as HTMLInputElement | null;\n const emailField = document.getElementById(\"work-email\") as HTMLInputElement | null;\n \n if (\n !nameField ||\n !nameField.value.trim() ||\n !lastNameField ||\n !lastNameField.value.trim() ||\n !emailField ||\n !emailField.value.trim()\n ) {\n console.error(\"Required fields missing or empty\");\n return null;\n }\n \n const fullName = `${nameField.value} ${lastNameField.value}`.trim();\n const email = emailField.value;\n const updatedURL = `${baseURL}?email=${encodeURIComponent(\n email\n )}&name=${encodeURIComponent(fullName)}`;\n return updatedURL;\n }\n \n /**\n * Generates a Hubspot URL with user's information\n * @returns The Hubspot URL or null if required fields are missing\n */\n function generateHubspotURL(): string | null {\n if (!window.redirectionOptions || !window.redirectionOptions.newTab) {\n console.error(\n \"window.redirectionOptions not found or missing newTab property\"\n );\n return null;\n }\n \n const baseURL = window.redirectionOptions.newTab;\n const nameField = document.getElementById(\"first-name\") as HTMLInputElement | null;\n const lastNameField = document.getElementById(\"last-name\") as HTMLInputElement | null;\n const emailField = document.getElementById(\"work-email\") as HTMLInputElement | null;\n const messageField = document.getElementById(\"message\") as HTMLTextAreaElement | null; // Optional field\n \n // Check only REQUIRED fields\n if (\n !nameField ||\n !nameField.value.trim() ||\n !lastNameField ||\n !lastNameField.value.trim() ||\n !emailField ||\n !emailField.value.trim()\n ) {\n console.error(\"Required fields missing or empty\");\n return null;\n }\n \n try {\n const url = new URL(baseURL);\n \n // Remove any existing params to avoid conflicts\n const paramsToRemove = [\n 'email', 'firstname', 'lastname', 'message',\n 'Email', 'FirstName', 'LastName', 'Message'\n ];\n \n paramsToRemove.forEach(param => url.searchParams.delete(param));\n \n // Add required parameters\n url.searchParams.set(\"email\", emailField.value.trim());\n url.searchParams.set(\"firstname\", nameField.value.trim());\n url.searchParams.set(\"lastname\", lastNameField.value.trim());\n \n // Add company parameter ONLY if field exists and has value\n if (messageField && messageField.value.trim()) {\n url.searchParams.set(\"message\", messageField.value.trim());\n }\n \n return url.toString();\n } catch (error) {\n console.error(\"Invalid URL:\", error);\n return null;\n }\n }\n \n\n \n /**\n * Handles the form submission process and redirection\n */\n function handleFormSubmission(): void {\n try {\n if (typeof handleRedirection === \"function\") {\n handleRedirection();\n } else {\n window.location.href = \"/thank-you\";\n }\n } catch (error) {\n console.error(\"Error during form submission:\", error);\n }\n }\n \n /**\n * Determines which type of redirection to perform\n */\n function handleRedirection(): void {\n if (!window.redirectionOptions || !window.redirectionOptions.type) {\n console.error(\n \"window.redirectionOptions not found or missing type property\"\n );\n return;\n }\n \n switch (window.redirectionOptions.type) {\n case \"calendly\":\n handleCalendlyRedirection();\n break;\n case \"hubspot\":\n handleHubspotRedirection();\n break;\n case \"webflow\":\n handleWebflowRedirection();\n break;\n default:\n console.error(\n \"Invalid redirection type:\",\n window.redirectionOptions.type\n );\n return;\n }\n }\n \n /**\n * Handles Calendly-specific redirection\n */\n function handleCalendlyRedirection(): void {\n const newTabUrl = generateCalendlyURL();\n const currentTabUrl = window.redirectionOptions?.currentTab;\n \n if (newTabUrl) {\n window.open(newTabUrl, \"_blank\");\n }\n \n if (currentTabUrl) {\n window.location.href = currentTabUrl;\n }\n }\n \n /**\n * Handles HubSpot-specific redirection\n */\n function handleHubspotRedirection(): void {\n const newTabUrl = generateHubspotURL();\n const currentTabUrl = window.redirectionOptions?.currentTab;\n \n if (newTabUrl) {\n window.open(newTabUrl, \"_blank\");\n }\n \n if (currentTabUrl) {\n window.location.href = currentTabUrl;\n }\n }\n \n /**\n * Handles Webflow-specific redirection\n */\n function handleWebflowRedirection(): void {\n const newTabUrl = window.redirectionOptions?.newTab;\n const currentTabUrl = window.redirectionOptions?.currentTab;\n \n if (newTabUrl) {\n window.open(newTabUrl, \"_blank\");\n }\n \n if (currentTabUrl) {\n window.location.href = currentTabUrl;\n }\n }\n \n /**\n * Converts the first option in select fields to actual placeholders with styling\n */\n function setupSelectPlaceholders(): void {\n // Find all select elements\n const selectFields = document.querySelectorAll<HTMLSelectElement>(\"select\");\n \n selectFields.forEach((select: HTMLSelectElement) => {\n // Get the first option\n const firstOption = select.querySelector<HTMLOptionElement>(\"option:first-child\");\n \n if (firstOption) {\n // Make it a true placeholder by adding these attributes\n firstOption.setAttribute(\"value\", \"\");\n firstOption.setAttribute(\"disabled\", \"disabled\");\n firstOption.setAttribute(\"selected\", \"selected\");\n \n // Set the select's initial selectedIndex to 0 (the placeholder)\n select.selectedIndex = 0;\n \n // Add a class to the select element to style it when showing placeholder\n select.classList.add(\"placeholder-active\");\n \n // Style the select element when showing the placeholder\n if (select.value === \"\") {\n select.style.color = \"#999999\"; // Placeholder color (gray)\n }\n \n // Change color when user selects a real option\n select.addEventListener(\"change\", () => {\n if (select.value) {\n select.style.color = \"\"; // Reset to default text color\n select.classList.remove(\"placeholder-active\");\n } else {\n select.style.color = \"#999999\"; // Back to placeholder color\n select.classList.add(\"placeholder-active\");\n }\n });\n }\n });\n \n // console.log(\"Select placeholders initialized\");\n }\n \n /**\n * Override Webflow's form submission functionality\n */\n function overrideWebflowFormSubmission(): void {\n const form = document.querySelector<HTMLFormElement>(\"[data-form-handler]\");\n const phoneField = document.querySelector<HTMLInputElement>(\"#phone-number\");\n \n if (!form || !phoneField) {\n console.error(\"Form or phone field not found\");\n return;\n }\n \n // Add validation using setCustomValidity\n phoneField.addEventListener(\"invalid\", (event: Event) => {\n if (window.validatePhone) {\n const validation = window.validatePhone(\"phone-number\", phoneField.value);\n if (!validation.isValid) {\n phoneField.setCustomValidity(\n validation.message || \"Please enter a valid phone number\"\n );\n }\n }\n });\n \n phoneField.addEventListener(\"input\", () => {\n phoneField.setCustomValidity(\"\");\n });\n \n phoneField.addEventListener(\"blur\", () => {\n if (window.validatePhone) {\n const validation = window.validatePhone(\"phone-number\", phoneField.value);\n if (!validation.isValid && phoneField.value.trim() !== \"\") {\n phoneField.setCustomValidity(\n validation.message || \"Please enter a valid phone number\"\n );\n } else {\n phoneField.setCustomValidity(\"\");\n }\n }\n });\n \n // Handle form submission with redirection\n form.addEventListener(\n \"submit\",\n (event: Event) => {\n // Use validatePhoneCustom as primary method (more reliable)\n let validation: ValidationResult;\n if (typeof window.validatePhoneCustom === \"function\") {\n validation = window.validatePhoneCustom(\n \"phone-number\",\n phoneField.value\n );\n } else if (typeof window.validatePhone === \"function\") {\n validation = window.validatePhone(\"phone-number\", phoneField.value);\n } else {\n console.error(\"No phone validation function available\");\n event.preventDefault();\n return false;\n }\n \n if (!validation.isValid) {\n phoneField.setCustomValidity(\n validation.message || \"Please enter a valid phone number\"\n );\n event.preventDefault();\n phoneField.focus();\n return false;\n } else {\n phoneField.setCustomValidity(\"\");\n \n // console.log(\"Validation passed, allowing form submission\");\n window.validationPassed = true;\n window._formSubmissionTime = Date.now();\n \n // Set up a delayed redirection that gives Webflow time to process\n setTimeout(() => {\n console.log(\"Redirecting....\");\n handleFormSubmission();\n }, 3000);\n \n // Let the form submit normally\n return true;\n }\n },\n true\n );\n \n // Additional Webflow success detection\n if (window.jQuery || window.$) {\n const $ = window.jQuery || window.$;\n \n // Listen for Webflow's success event\n $(document).on(\"webflow-form-success\", (e: any) => {\n if (e.target === form) {\n // console.log(\"Webflow success event detected\");\n if (window.posthog && window.getTrackingPropertiesWithForm) {\n window.posthog.capture(\n \"form_success\",\n window.getTrackingPropertiesWithForm(\n window.interactedForm || \"unknown_form\"\n )\n );\n }\n \n handleFormSubmission();\n } else {\n // event for error in future\n }\n });\n }\n \n // console.log(\"Form validation and redirection setup complete\");\n }\n \n /**\n * Initialize everything when the DOM is ready\n */\n document.addEventListener(\"DOMContentLoaded\", () => {\n // Detect phone input\n const phoneField = document.querySelector<HTMLInputElement>(\"#phone-number\");\n if (phoneField) {\n // Add validation on blur - using only browser validation\n phoneField.addEventListener(\"blur\", () => {\n if (typeof window.validatePhone === \"function\") {\n const validation = window.validatePhone(\n \"phone-number\",\n phoneField.value\n );\n if (!validation.isValid && phoneField.value.trim() !== \"\") {\n phoneField.setCustomValidity(\n validation.message || \"Please enter a valid phone number\"\n );\n } else {\n phoneField.setCustomValidity(\"\");\n }\n }\n });\n }\n \n // Select placeholders\n setupSelectPlaceholders();\n \n // Initialize country code and page data\n updateCountryCode();\n updatePageData();\n \n // Override Webflow form submission\n overrideWebflowFormSubmission();\n });\n\n// Export to make this file a module (fixes TypeScript global augmentation error)\nexport {};"],
|
|
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;;;ACsCE,SAAO,mBAAmB;AAQ1B,WAAS,kBACP,qBAA2C,iBAC3C,qBAA6B,iBACrB;AACR,UAAM,aACJ,OAAO,uBAAuB,WAC1B,SAAS,cAAiC,kBAAkB,IAC5D;AAEN,UAAM,mBAAmB,SAAS,cAAgC,kBAAkB;AAEpF,QAAI,CAAC,YAAY;AAEf,aAAO;AAAA,IACT;AAEA,QAAI,CAAC,kBAAkB;AAErB,aAAO;AAAA,IACT;AAEA,QAAI;AAEF,UACE,WAAW,OACX,OAAO,WAAW,IAAI,2BAA2B,YACjD;AACA,cAAM,cAAc,WAAW,IAAI,uBAAuB;AAC1D,yBAAiB,QAAQ,MAAM,YAAY;AAC3C,eAAO,YAAY;AAAA,MACrB,WACE,OAAO,uBACP,OAAO,OAAO,oBAAoB,gBAAgB,YAClD;AAEA,cAAM,MAAM,OAAO,oBAAoB,YAAY,UAAU;AAC7D,YAAI,KAAK;AACP,gBAAM,cAAc,IAAI,uBAAuB;AAC/C,2BAAiB,QAAQ,MAAM,YAAY;AAC3C,iBAAO,YAAY;AAAA,QACrB;AAAA,MACF;AAGA,uBAAiB,QAAQ;AACzB,aAAO;AAAA,IACT,SAAS,OAAO;AACd,cAAQ,MAAM,kCAAkC,KAAK;AAErD,uBAAiB,QAAQ;AACzB,aAAO;AAAA,IACT;AAAA,EACF;A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AAAA,UACjC;AAAA,QACF;AAAA,MACF,CAAC;AAAA,IACH;AAGA,4BAAwB;AAGxB,sBAAkB;AAClB,mBAAe;AAGf,kCAA8B;AAAA,EAChC,CAAC;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../bin/live-reload.js", "../../src/form/phone-validator.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", "\n//migrated from https://cdn.jsdelivr.net/gh/Fynd-Design-Engineering/fynd-one@4.0.2/form/phone-validator-2.0.js\n\n/**\n * Reliable Phone Validator Library - TypeScript Version\n * Uses custom validation rules as primary method with utils as fallback\n */\n\n// Make this file a module to allow global declarations\nexport {};\n\n// Type definitions\ninterface CountryData {\n iso2: string;\n dialCode: string;\n name: string;\n }\n \n interface ValidationResult {\n isValid: boolean;\n message?: string;\n fullNumber?: string;\n countryCode?: string;\n phoneNumber?: string;\n countryIso?: string;\n countryName?: string;\n formatInternational?: string;\n formatNational?: string;\n validationMethod?: 'custom' | 'standard';\n }\n \n interface IntlTelInputInstance {\n getSelectedCountryData(): CountryData;\n setNumber(number: string): void;\n getNumber(): string;\n isValidNumber?(): boolean;\n }\n \n interface PhoneInputElement extends HTMLInputElement {\n iti?: IntlTelInputInstance;\n }\n \n interface IntlTelInputOptions {\n utilsScript: string;\n separateDialCode: boolean;\n initialCountry: string;\n geoIpLookup: (callback: (countryCode: string) => void) => void;\n nationalMode: boolean;\n allowDropdown: boolean;\n autoPlaceholder: string;\n formatOnDisplay: boolean;\n }\n \n interface GeoIPResponse {\n country_code: string;\n }\n \n // Extend window interface for missing properties\n declare global {\n interface Window {\n phoneValidator: Record<string, unknown>;\n intlTelInput: (element: HTMLInputElement, options: IntlTelInputOptions) => IntlTelInputInstance;\n intlTelInputUtils?: unknown;\n validatePhoneAsync?: (phoneInput?: string | HTMLElement, phoneNumber?: string) => Promise<ValidationResult>;\n updateCountryCode?: () => string;\n validatePhoneNumber?: (selector: string, value: string) => ValidationResult;\n testPhoneNumber?: (selector: string, value: string) => ValidationResult;\n }\n }\n \n (function (): void {\n window.phoneValidator = {};\n \n document.addEventListener(\"DOMContentLoaded\", function (): void {\n setTimeout(function (): void {\n initializePhoneInputs();\n }, 100);\n });\n \n function initializePhoneInputs(): void {\n const phoneInputs = document.querySelectorAll<HTMLInputElement>(\n \"input[type='tel'], .phone-input\"\n );\n \n phoneInputs.forEach(function (input: HTMLInputElement): void {\n if (!input.id) {\n input.id = \"phone-input-\" + Math.floor(Math.random() * 10000);\n }\n \n try {\n const iti: IntlTelInputInstance = window.intlTelInput(input, {\n utilsScript:\n \"https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/17.0.8/js/utils.js\",\n separateDialCode: true,\n initialCountry: \"auto\",\n geoIpLookup: function (callback: (countryCode: string) => void): void {\n fetch(\"https://ipapi.co/json\")\n .then((res: Response) => res.json())\n .then((data: GeoIPResponse) => callback(data.country_code))\n .catch(() => callback(\"in\"));\n },\n nationalMode: false,\n allowDropdown: true,\n autoPlaceholder: \"polite\",\n formatOnDisplay: true,\n });\n \n (input as PhoneInputElement).iti = iti;\n \n input.addEventListener(\"countrychange\", function (): void {\n // console.log(\"Country changed to:\", iti.getSelectedCountryData());\n });\n \n // console.log(\"Phone input initialized:\", input.id);\n } catch (error) {\n // console.error(\"Failed to initialize phone input:\", error);\n }\n });\n \n // Primary validation function - uses custom rules first, then falls back to utils\n window.validatePhone = (phoneInput?: string | HTMLElement, phoneNumber?: string): ValidationResult => {\n const input: PhoneInputElement | null = getPhoneInput(phoneInput);\n if (!input) {\n return { isValid: false, message: \"No phone input found\" };\n }\n \n const iti: IntlTelInputInstance | undefined = input.iti;\n if (!iti) {\n return { isValid: false, message: \"Phone validator not initialized\" };\n }\n \n // Set the number if provided\n if (phoneNumber !== undefined) {\n input.value = phoneNumber;\n iti.setNumber(phoneNumber);\n }\n \n const number: string = input.value.trim();\n if (!number) {\n return { isValid: false, message: \"No phone number provided\" };\n }\n \n // Try custom validation first (most reliable)\n const customResult: ValidationResult = validateWithCustomRules(input, number, iti);\n if (customResult.isValid) {\n return customResult;\n }\n \n // Fallback to standard validation if custom rules don't match\n try {\n if (iti.isValidNumber && iti.isValidNumber()) {\n const fullNumber: string = iti.getNumber();\n const countryData: CountryData = iti.getSelectedCountryData();\n const countryCode: string = countryData.dialCode;\n \n return {\n isValid: true,\n message: \"Valid number (standard validation)\",\n fullNumber: fullNumber,\n countryCode: countryCode,\n phoneNumber: fullNumber.substring(1 + countryCode.length),\n countryIso: countryData.iso2,\n countryName: countryData.name,\n validationMethod: \"standard\",\n };\n }\n } catch (error) {\n console.warn(\"Standard validation failed:\", error);\n }\n \n // If both methods fail, return the custom validation result (which explains why it failed)\n return customResult;\n };\n \n // Custom validation rules for different countries\n function validateWithCustomRules(input: PhoneInputElement, number: string, iti: IntlTelInputInstance): ValidationResult {\n const countryData: CountryData = iti.getSelectedCountryData();\n const countryCode: string | undefined = countryData.iso2?.toUpperCase();\n const digitsOnly: string = number.replace(/\\D/g, \"\");\n \n // United States validation\n if (countryCode === \"US\") {\n if (digitsOnly.length === 10 && /^[2-9]/.test(digitsOnly)) {\n return {\n isValid: true,\n message: \"Valid US number\",\n fullNumber: `+1${digitsOnly}`,\n countryCode: \"1\",\n phoneNumber: digitsOnly,\n countryIso: \"us\",\n countryName: \"United States\",\n formatInternational: `+1 ${digitsOnly.slice(\n 0,\n 3\n )} ${digitsOnly.slice(3, 6)} ${digitsOnly.slice(6)}`,\n formatNational: `(${digitsOnly.slice(0, 3)}) ${digitsOnly.slice(\n 3,\n 6\n )}-${digitsOnly.slice(6)}`,\n validationMethod: \"custom\",\n };\n } else {\n return {\n isValid: false,\n message:\n digitsOnly.length !== 10\n ? `US numbers must be 10 digits (got ${digitsOnly.length})`\n : \"US numbers cannot start with 0 or 1\",\n };\n }\n }\n \n // India validation\n if (countryCode === \"IN\") {\n if (digitsOnly.length === 10 && /^[6-9]/.test(digitsOnly)) {\n return {\n isValid: true,\n message: \"Valid Indian mobile number\",\n fullNumber: `+91${digitsOnly}`,\n countryCode: \"91\",\n phoneNumber: digitsOnly,\n countryIso: \"in\",\n countryName: \"India\",\n formatInternational: `+91 ${digitsOnly.slice(\n 0,\n 5\n )} ${digitsOnly.slice(5)}`,\n formatNational: `${digitsOnly.slice(0, 5)} ${digitsOnly.slice(5)}`,\n validationMethod: \"custom\",\n };\n } else {\n return {\n isValid: false,\n message:\n digitsOnly.length !== 10\n ? `Indian mobile numbers must be 10 digits (got ${digitsOnly.length})`\n : \"Indian mobile numbers must start with 6, 7, 8, or 9\",\n };\n }\n }\n \n // United Kingdom validation\n if (countryCode === \"GB\") {\n // UK mobile numbers (07xxx xxxxxx)\n if (digitsOnly.length === 11 && digitsOnly.startsWith(\"07\")) {\n return {\n isValid: true,\n message: \"Valid UK mobile number\",\n fullNumber: `+44${digitsOnly.slice(1)}`,\n countryCode: \"44\",\n phoneNumber: digitsOnly.slice(1),\n countryIso: \"gb\",\n countryName: \"United Kingdom\",\n validationMethod: \"custom\",\n };\n }\n // UK landline numbers (01xxx or 02xxx)\n if (\n digitsOnly.length >= 10 &&\n digitsOnly.length <= 11 &&\n /^0[12]/.test(digitsOnly)\n ) {\n return {\n isValid: true,\n message: \"Valid UK landline number\",\n fullNumber: `+44${digitsOnly.slice(1)}`,\n countryCode: \"44\",\n phoneNumber: digitsOnly.slice(1),\n countryIso: \"gb\",\n countryName: \"United Kingdom\",\n validationMethod: \"custom\",\n };\n }\n }\n \n // Australia validation\n if (countryCode === \"AU\") {\n // Australian mobile numbers (04xx xxx xxx)\n if (digitsOnly.length === 10 && digitsOnly.startsWith(\"04\")) {\n return {\n isValid: true,\n message: \"Valid Australian mobile number\",\n fullNumber: `+61${digitsOnly.slice(1)}`,\n countryCode: \"61\",\n phoneNumber: digitsOnly.slice(1),\n countryIso: \"au\",\n countryName: \"Australia\",\n validationMethod: \"custom\",\n };\n }\n }\n \n // Canada validation (same as US)\n if (countryCode === \"CA\") {\n if (digitsOnly.length === 10 && /^[2-9]/.test(digitsOnly)) {\n return {\n isValid: true,\n message: \"Valid Canadian number\",\n fullNumber: `+1${digitsOnly}`,\n countryCode: \"1\",\n phoneNumber: digitsOnly,\n countryIso: \"ca\",\n countryName: \"Canada\",\n validationMethod: \"custom\",\n };\n }\n }\n \n // If no custom rules match, return invalid\n return {\n isValid: false,\n message: `No validation rules for ${\n countryData.name || \"this country\"\n }`,\n };\n }\n \n // Helper function to get phone input\n function getPhoneInput(phoneInput?: string | HTMLElement): PhoneInputElement | null {\n if (typeof phoneInput === \"string\") {\n return (\n document.getElementById(phoneInput) as PhoneInputElement ||\n document.querySelector(phoneInput) as PhoneInputElement\n );\n } else if (phoneInput instanceof HTMLElement) {\n return phoneInput as PhoneInputElement;\n } else {\n return (\n document.querySelector(\"#phone-number\") as PhoneInputElement ||\n document.querySelector(\"input[type='tel']\") as PhoneInputElement\n );\n }\n }\n \n // Async version that waits for utils (but still uses custom rules first)\n window.validatePhoneAsync = async (phoneInput?: string | HTMLElement, phoneNumber?: string): Promise<ValidationResult> => {\n // Wait a bit for utils to load\n let attempts: number = 0;\n while (!window.intlTelInputUtils && attempts < 20) {\n await new Promise<void>((resolve) => setTimeout(resolve, 100));\n attempts++;\n }\n \n return window.validatePhone ? window.validatePhone(phoneInput as string, phoneNumber || '') : { isValid: false, message: 'Validation not available' };\n };\n \n // Keep the old custom validation function for backward compatibility\n window.validatePhoneCustom = window.validatePhone;\n \n // Country code update function\n window.updateCountryCode = (): string => {\n const phoneInput: PhoneInputElement | null = document.querySelector(\"#phone-number\");\n const countryCodeInput: HTMLInputElement | null = document.querySelector(\"#country-code\");\n \n if (!phoneInput || !countryCodeInput) return \"91\";\n \n try {\n if (phoneInput.iti) {\n const countryData: CountryData = phoneInput.iti.getSelectedCountryData();\n countryCodeInput.value = \"+\" + countryData.dialCode;\n return countryData.dialCode;\n }\n } catch (error) {\n console.error(\"Error updating country code:\", error);\n }\n \n countryCodeInput.value = \"+91\";\n return \"91\";\n };\n \n // For backward compatibility\n window.validatePhoneNumber = window.validatePhone;\n window.testPhoneNumber = window.validatePhone;\n \n // console.log(\n // \"%c Reliable Phone Validator Ready! \uD83D\uDE80\",\n // \"color: green; font-weight: bold;\"\n // );\n // console.log(\"\u2705 Uses custom validation rules as primary method\");\n // console.log(\"\u2705 Falls back to standard validation when available\");\n // console.log(\"\u2705 Supports: US, India, UK, Australia, Canada\");\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;
|
|
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", "\n//migrated from https://cdn.jsdelivr.net/gh/Fynd-Design-Engineering/fynd-one@4.0.2/form/phone-validator-2.0.js\n\n/**\n * Reliable Phone Validator Library - TypeScript Version\n * Uses custom validation rules as primary method with utils as fallback\n */\n\n// Make this file a module to allow global declarations\nexport {};\n\n// Type definitions\ninterface CountryData {\n iso2: string;\n dialCode: string;\n name: string;\n }\n \n interface ValidationResult {\n isValid: boolean;\n message?: string;\n fullNumber?: string;\n countryCode?: string;\n phoneNumber?: string;\n countryIso?: string;\n countryName?: string;\n formatInternational?: string;\n formatNational?: string;\n validationMethod?: 'custom' | 'standard';\n }\n \n interface IntlTelInputInstance {\n getSelectedCountryData(): CountryData;\n setNumber(number: string): void;\n getNumber(): string;\n isValidNumber?(): boolean;\n }\n \n interface PhoneInputElement extends HTMLInputElement {\n iti?: IntlTelInputInstance;\n }\n \n interface IntlTelInputOptions {\n utilsScript: string;\n separateDialCode: boolean;\n initialCountry: string;\n geoIpLookup: (callback: (countryCode: string) => void) => void;\n nationalMode: boolean;\n allowDropdown: boolean;\n autoPlaceholder: string;\n formatOnDisplay: boolean;\n }\n \n interface GeoIPResponse {\n country_code: string;\n }\n \n // Extend window interface for missing properties\n declare global {\n interface Window {\n phoneValidator: Record<string, unknown>;\n intlTelInput: (element: HTMLInputElement, options: IntlTelInputOptions) => IntlTelInputInstance;\n intlTelInputUtils?: unknown;\n validatePhoneAsync?: (phoneInput?: string | HTMLElement, phoneNumber?: string) => Promise<ValidationResult>;\n updateCountryCode?: () => string;\n validatePhoneNumber?: (selector: string, value: string) => ValidationResult;\n testPhoneNumber?: (selector: string, value: string) => ValidationResult;\n }\n }\n \n (function (): void {\n window.phoneValidator = {};\n \n document.addEventListener(\"DOMContentLoaded\", function (): void {\n setTimeout(function (): void {\n initializePhoneInputs();\n }, 100);\n });\n \n function initializePhoneInputs(): void {\n const phoneInputs = document.querySelectorAll<HTMLInputElement>(\n \"input[type='tel'], .phone-input\"\n );\n \n phoneInputs.forEach(function (input: HTMLInputElement): void {\n if (!input.id) {\n input.id = \"phone-input-\" + Math.floor(Math.random() * 10000);\n }\n \n try {\n const iti: IntlTelInputInstance = window.intlTelInput(input, {\n utilsScript:\n \"https://cdnjs.cloudflare.com/ajax/libs/intl-tel-input/17.0.8/js/utils.js\",\n separateDialCode: true,\n initialCountry: \"auto\",\n geoIpLookup: function (callback: (countryCode: string) => void): void {\n fetch(\"https://ipapi.co/json\")\n .then((res: Response) => res.json())\n .then((data: GeoIPResponse) => callback(data.country_code))\n .catch(() => callback(\"in\"));\n },\n nationalMode: false,\n allowDropdown: true,\n autoPlaceholder: \"polite\",\n formatOnDisplay: true,\n });\n \n (input as PhoneInputElement).iti = iti;\n \n input.addEventListener(\"countrychange\", function (): void {\n // console.log(\"Country changed to:\", iti.getSelectedCountryData());\n });\n \n // console.log(\"Phone input initialized:\", input.id);\n } catch (error) {\n // console.error(\"Failed to initialize phone input:\", error);\n }\n });\n \n // Primary validation function - uses custom rules first, then falls back to utils\n window.validatePhone = (phoneInput?: string | HTMLElement, phoneNumber?: string): ValidationResult => {\n const input: PhoneInputElement | null = getPhoneInput(phoneInput);\n if (!input) {\n return { isValid: false, message: \"No phone input found\" };\n }\n \n const iti: IntlTelInputInstance | undefined = input.iti;\n if (!iti) {\n return { isValid: false, message: \"Phone validator not initialized\" };\n }\n \n // Set the number if provided\n if (phoneNumber !== undefined) {\n input.value = phoneNumber;\n iti.setNumber(phoneNumber);\n }\n \n const number: string = input.value.trim();\n if (!number) {\n return { isValid: false, message: \"No phone number provided\" };\n }\n \n // Try custom validation first (most reliable)\n const customResult: ValidationResult = validateWithCustomRules(input, number, iti);\n if (customResult.isValid) {\n return customResult;\n }\n \n // Fallback to standard validation if custom rules don't match\n try {\n if (iti.isValidNumber && iti.isValidNumber()) {\n const fullNumber: string = iti.getNumber();\n const countryData: CountryData = iti.getSelectedCountryData();\n const countryCode: string = countryData.dialCode;\n \n return {\n isValid: true,\n message: \"Valid number (standard validation)\",\n fullNumber: fullNumber,\n countryCode: countryCode,\n phoneNumber: fullNumber.substring(1 + countryCode.length),\n countryIso: countryData.iso2,\n countryName: countryData.name,\n validationMethod: \"standard\",\n };\n }\n } catch (error) {\n console.warn(\"Standard validation failed:\", error);\n }\n \n // If both methods fail, return the custom validation result (which explains why it failed)\n return customResult;\n };\n \n // Custom validation rules for different countries\n function validateWithCustomRules(input: PhoneInputElement, number: string, iti: IntlTelInputInstance): ValidationResult {\n const countryData: CountryData = iti.getSelectedCountryData();\n const countryCode: string | undefined = countryData.iso2?.toUpperCase();\n const digitsOnly: string = number.replace(/\\D/g, \"\");\n \n // United States validation\n if (countryCode === \"US\") {\n if (digitsOnly.length === 10 && /^[2-9]/.test(digitsOnly)) {\n return {\n isValid: true,\n message: \"Valid US number\",\n fullNumber: `+1${digitsOnly}`,\n countryCode: \"1\",\n phoneNumber: digitsOnly,\n countryIso: \"us\",\n countryName: \"United States\",\n formatInternational: `+1 ${digitsOnly.slice(\n 0,\n 3\n )} ${digitsOnly.slice(3, 6)} ${digitsOnly.slice(6)}`,\n formatNational: `(${digitsOnly.slice(0, 3)}) ${digitsOnly.slice(\n 3,\n 6\n )}-${digitsOnly.slice(6)}`,\n validationMethod: \"custom\",\n };\n } else {\n return {\n isValid: false,\n message:\n digitsOnly.length !== 10\n ? `US numbers must be 10 digits (got ${digitsOnly.length})`\n : \"US numbers cannot start with 0 or 1\",\n };\n }\n }\n \n // India validation\n if (countryCode === \"IN\") {\n if (digitsOnly.length === 10 && /^[6-9]/.test(digitsOnly)) {\n return {\n isValid: true,\n message: \"Valid Indian mobile number\",\n fullNumber: `+91${digitsOnly}`,\n countryCode: \"91\",\n phoneNumber: digitsOnly,\n countryIso: \"in\",\n countryName: \"India\",\n formatInternational: `+91 ${digitsOnly.slice(\n 0,\n 5\n )} ${digitsOnly.slice(5)}`,\n formatNational: `${digitsOnly.slice(0, 5)} ${digitsOnly.slice(5)}`,\n validationMethod: \"custom\",\n };\n } else {\n return {\n isValid: false,\n message:\n digitsOnly.length !== 10\n ? `Indian mobile numbers must be 10 digits (got ${digitsOnly.length})`\n : \"Indian mobile numbers must start with 6, 7, 8, or 9\",\n };\n }\n }\n \n // United Kingdom validation\n if (countryCode === \"GB\") {\n // UK mobile numbers (07xxx xxxxxx)\n if (digitsOnly.length === 11 && digitsOnly.startsWith(\"07\")) {\n return {\n isValid: true,\n message: \"Valid UK mobile number\",\n fullNumber: `+44${digitsOnly.slice(1)}`,\n countryCode: \"44\",\n phoneNumber: digitsOnly.slice(1),\n countryIso: \"gb\",\n countryName: \"United Kingdom\",\n validationMethod: \"custom\",\n };\n }\n // UK landline numbers (01xxx or 02xxx)\n if (\n digitsOnly.length >= 10 &&\n digitsOnly.length <= 11 &&\n /^0[12]/.test(digitsOnly)\n ) {\n return {\n isValid: true,\n message: \"Valid UK landline number\",\n fullNumber: `+44${digitsOnly.slice(1)}`,\n countryCode: \"44\",\n phoneNumber: digitsOnly.slice(1),\n countryIso: \"gb\",\n countryName: \"United Kingdom\",\n validationMethod: \"custom\",\n };\n }\n }\n \n // Australia validation\n if (countryCode === \"AU\") {\n // Australian mobile numbers (04xx xxx xxx)\n if (digitsOnly.length === 10 && digitsOnly.startsWith(\"04\")) {\n return {\n isValid: true,\n message: \"Valid Australian mobile number\",\n fullNumber: `+61${digitsOnly.slice(1)}`,\n countryCode: \"61\",\n phoneNumber: digitsOnly.slice(1),\n countryIso: \"au\",\n countryName: \"Australia\",\n validationMethod: \"custom\",\n };\n }\n }\n \n // Canada validation (same as US)\n if (countryCode === \"CA\") {\n if (digitsOnly.length === 10 && /^[2-9]/.test(digitsOnly)) {\n return {\n isValid: true,\n message: \"Valid Canadian number\",\n fullNumber: `+1${digitsOnly}`,\n countryCode: \"1\",\n phoneNumber: digitsOnly,\n countryIso: \"ca\",\n countryName: \"Canada\",\n validationMethod: \"custom\",\n };\n }\n }\n \n // If no custom rules match, return invalid\n return {\n isValid: false,\n message: `No validation rules for ${\n countryData.name || \"this country\"\n }`,\n };\n }\n \n // Helper function to get phone input\n function getPhoneInput(phoneInput?: string | HTMLElement): PhoneInputElement | null {\n if (typeof phoneInput === \"string\") {\n return (\n document.getElementById(phoneInput) as PhoneInputElement ||\n document.querySelector(phoneInput) as PhoneInputElement\n );\n } else if (phoneInput instanceof HTMLElement) {\n return phoneInput as PhoneInputElement;\n } else {\n return (\n document.querySelector(\"#phone-number\") as PhoneInputElement ||\n document.querySelector(\"input[type='tel']\") as PhoneInputElement\n );\n }\n }\n \n // Async version that waits for utils (but still uses custom rules first)\n window.validatePhoneAsync = async (phoneInput?: string | HTMLElement, phoneNumber?: string): Promise<ValidationResult> => {\n // Wait a bit for utils to load\n let attempts: number = 0;\n while (!window.intlTelInputUtils && attempts < 20) {\n await new Promise<void>((resolve) => setTimeout(resolve, 100));\n attempts++;\n }\n \n return window.validatePhone ? window.validatePhone(phoneInput as string, phoneNumber || '') : { isValid: false, message: 'Validation not available' };\n };\n \n // Keep the old custom validation function for backward compatibility\n window.validatePhoneCustom = window.validatePhone;\n \n // Country code update function\n window.updateCountryCode = (): string => {\n const phoneInput: PhoneInputElement | null = document.querySelector(\"#phone-number\");\n const countryCodeInput: HTMLInputElement | null = document.querySelector(\"#country-code\");\n \n if (!phoneInput || !countryCodeInput) return \"91\";\n \n try {\n if (phoneInput.iti) {\n const countryData: CountryData = phoneInput.iti.getSelectedCountryData();\n countryCodeInput.value = \"+\" + countryData.dialCode;\n return countryData.dialCode;\n }\n } catch (error) {\n console.error(\"Error updating country code:\", error);\n }\n \n countryCodeInput.value = \"+91\";\n return \"91\";\n };\n \n // For backward compatibility\n window.validatePhoneNumber = window.validatePhone;\n window.testPhoneNumber = window.validatePhone;\n \n // console.log(\n // \"%c Reliable Phone Validator Ready! \uD83D\uDE80\",\n // \"color: green; font-weight: bold;\"\n // );\n // console.log(\"\u2705 Uses custom validation rules as primary method\");\n // console.log(\"\u2705 Falls back to standard validation when available\");\n // console.log(\"\u2705 Supports: US, India, UK, Australia, Canada\");\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;;;AC4DE,GAAC,WAAkB;AACjB,WAAO,iBAAiB,CAAC;AAEzB,aAAS,iBAAiB,oBAAoB,WAAkB;AAC9D,iBAAW,WAAkB;AAC3B,8BAAsB;AAAA,MACxB,GAAG,GAAG;AAAA,IACR,CAAC;AA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O,OAAO,gBAAgB,OAAO,cAAc,YAAsB,eAAe,EAAE,IAAI,EAAE,SAAS,OAAO,SAAS,2BAA2B;AAAA,MACtJ;AAGA,aAAO,sBAAsB,OAAO;AAGpC,aAAO,oBAAoB,MAAc;AACvC,cAAM,aAAuC,SAAS,cAAc,eAAe;AACnF,cAAM,mBAA4C,SAAS,cAAc,eAAe;AAExF,YAAI,CAAC,cAAc,CAAC,iBAAkB,QAAO;AAE7C,YAAI;AACF,cAAI,WAAW,KAAK;AAClB,kBAAM,cAA2B,WAAW,IAAI,uBAAuB;AACvE,6BAAiB,QAAQ,MAAM,YAAY;AAC3C,mBAAO,YAAY;AAAA,UACrB;AAAA,QACF,SAAS,OAAO;AACd,kBAAQ,MAAM,gCAAgC,KAAK;AAAA,QACrD;AAEA,yBAAiB,QAAQ;AACzB,eAAO;AAAA,MACT;AAGA,aAAO,sBAAsB,OAAO;AACpC,aAAO,kBAAkB,OAAO;AAAA,IASlC;AAAA,EACF,GAAG;",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../bin/live-reload.js", "../../src/global/anchor-scroll.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", "// TypeScript Scroll Navigation\ninterface ScrollNavigationOptions {\n triggerAttribute?: string;\n targetAttribute?: string;\n scrollDelay?: number;\n }\n \n class ScrollNavigation {\n private readonly triggerAttribute: string;\n private readonly targetAttribute: string;\n private readonly scrollDelay: number;\n \n constructor(options: ScrollNavigationOptions = {}) {\n this.triggerAttribute = options.triggerAttribute || 'fynd-scroll-trigger';\n this.targetAttribute = options.targetAttribute || 'fynd-scroll-target';\n this.scrollDelay = options.scrollDelay || 500;\n \n this.init();\n }\n \n private init(): void {\n if (document.readyState === 'loading') {\n document.addEventListener('DOMContentLoaded', () => {\n this.setupTriggers();\n this.handlePageLoad();\n this.handleBrowserNavigation();\n });\n } else {\n this.setupTriggers();\n this.handlePageLoad();\n this.handleBrowserNavigation();\n }\n }\n \n private scrollToSection(sectionValue: string): void {\n const target = document.querySelector(`[${this.targetAttribute}=\"${sectionValue}\"]`) as HTMLElement;\n \n if (target) {\n this.updateURL(sectionValue);\n \n // Update active states for all triggers pointing to this section\n this.updateActiveStatesBySection(sectionValue);\n \n target.scrollIntoView({\n behavior: 'auto',\n block: 'start'\n });\n } else {\n console.warn(`ScrollNavigation: Target element with ${this.targetAttribute}=\"${sectionValue}\" not found`);\n }\n }\n \n private updateURL(sectionValue: string): void {\n try {\n const url = new URL(window.location.href);\n url.searchParams.set('section', sectionValue);\n window.history.pushState({ section: sectionValue }, '', url.toString());\n } catch (error) {\n console.error('ScrollNavigation: Failed to update URL', error);\n }\n }\n \n private handlePageLoad(): void {\n const urlParams = new URLSearchParams(window.location.search);\n const sectionParam = urlParams.get('section');\n \n if (sectionParam) {\n setTimeout(() => {\n this.scrollToSection(sectionParam);\n }, this.scrollDelay);\n }\n }\n \n private setupTriggers(): void {\n // Remove existing event listeners first\n document.removeEventListener('click', this.handleTriggerClick);\n \n // Initialize all triggers with inactive state\n this.initializeActiveStates();\n \n // Add single delegated event listener\n document.addEventListener('click', this.handleTriggerClick);\n }\n\n private initializeActiveStates(): void {\n const triggers = document.querySelectorAll(`[${this.triggerAttribute}]`) as NodeListOf<HTMLElement>;\n triggers.forEach((trigger: HTMLElement) => {\n trigger.setAttribute('fynd-anchor-active', 'false');\n });\n }\n\n private updateActiveStatesBySection(sectionValue: string): void {\n // Get all triggers\n const allTriggers = document.querySelectorAll(`[${this.triggerAttribute}]`) as NodeListOf<HTMLElement>;\n \n allTriggers.forEach((trigger: HTMLElement) => {\n const triggerSectionValue = trigger.getAttribute(this.triggerAttribute);\n \n // Set active state based on whether this trigger points to the target section\n if (triggerSectionValue === sectionValue) {\n trigger.setAttribute('fynd-anchor-active', 'true');\n } else {\n trigger.setAttribute('fynd-anchor-active', 'false');\n }\n });\n }\n\n private updateActiveStates(activeTrigger: HTMLElement): void {\n const activeSectionValue = activeTrigger.getAttribute(this.triggerAttribute);\n \n if (!activeSectionValue) return;\n \n this.updateActiveStatesBySection(activeSectionValue);\n }\n\n private handleTriggerClick = (event: Event): void => {\n const target = event.target as HTMLElement;\n const trigger = target.closest(`[${this.triggerAttribute}]`) as HTMLElement;\n \n if (trigger) {\n event.preventDefault();\n \n // Update active states\n this.updateActiveStates(trigger);\n \n const sectionValue = trigger.getAttribute(this.triggerAttribute);\n \n if (sectionValue) {\n this.scrollToSection(sectionValue);\n }\n }\n }\n \n private handleBrowserNavigation(): void {\n window.addEventListener('popstate', (event: PopStateEvent) => {\n const urlParams = new URLSearchParams(window.location.search);\n const sectionParam = urlParams.get('section');\n \n if (sectionParam) {\n const target = document.querySelector(`[${this.targetAttribute}=\"${sectionParam}\"]`) as HTMLElement;\n if (target) {\n // Update active states when navigating via browser back/forward\n this.updateActiveStatesBySection(sectionParam);\n \n target.scrollIntoView({\n behavior: 'auto',\n block: 'start'\n });\n }\n }\n });\n }\n \n // Public method to programmatically scroll to section\n public goToSection(sectionValue: string): void {\n this.scrollToSection(sectionValue);\n }\n \n // Public method to get current section from URL\n public getCurrentSection(): string | null {\n const urlParams = new URLSearchParams(window.location.search);\n return urlParams.get('section');\n }\n \n // Public method to get all available sections\n public getAvailableSections(): string[] {\n const targets = document.querySelectorAll(`[${this.targetAttribute}]`) as NodeListOf<HTMLElement>;\n const sections: string[] = [];\n \n targets.forEach((target: HTMLElement) => {\n const sectionValue = target.getAttribute(this.targetAttribute);\n if (sectionValue) {\n sections.push(sectionValue);\n }\n });\n \n return sections;\n }\n\n // Public method to reinitialize triggers (useful when DOM changes)\n public reinitializeTriggers(): void {\n this.setupTriggers();\n }\n\n // Public method for comprehensive reinitialization with options\n public reinitialize(options?: {\n triggers?: boolean;\n handlePageLoad?: boolean;\n browserNavigation?: boolean;\n }): void {\n const config = {\n triggers: true,\n handlePageLoad: false,\n browserNavigation: false,\n ...options\n };\n\n if (config.triggers) {\n this.setupTriggers();\n }\n\n if (config.handlePageLoad) {\n this.handlePageLoad();\n }\n\n if (config.browserNavigation) {\n this.handleBrowserNavigation();\n }\n }\n\n // Public method for complete reinitialization (equivalent to creating new instance)\n public fullReinitialize(): void {\n this.setupTriggers();\n this.handlePageLoad();\n this.handleBrowserNavigation();\n }\n }\n \n // Initialize with default options\n const scrollNavigation = new ScrollNavigation();\n \n // Alternative initialization with custom options\n // const scrollNavigation = new ScrollNavigation({\n // triggerAttribute: 'my-scroll-trigger',\n // targetAttribute: 'my-scroll-target',\n // scrollDelay: 200\n // });\n \n // Export for module usage\n export { ScrollNavigation };\n \n // Also make it available globally for non-module usage\n declare global {\n interface Window {\n ScrollNavigation: typeof ScrollNavigation;\n }\n }\n \n if (typeof window !== 'undefined') {\n window.ScrollNavigation = ScrollNavigation;\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;
|
|
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", "// TypeScript Scroll Navigation\ninterface ScrollNavigationOptions {\n triggerAttribute?: string;\n targetAttribute?: string;\n scrollDelay?: number;\n }\n \n class ScrollNavigation {\n private readonly triggerAttribute: string;\n private readonly targetAttribute: string;\n private readonly scrollDelay: number;\n \n constructor(options: ScrollNavigationOptions = {}) {\n this.triggerAttribute = options.triggerAttribute || 'fynd-scroll-trigger';\n this.targetAttribute = options.targetAttribute || 'fynd-scroll-target';\n this.scrollDelay = options.scrollDelay || 500;\n \n this.init();\n }\n \n private init(): void {\n if (document.readyState === 'loading') {\n document.addEventListener('DOMContentLoaded', () => {\n this.setupTriggers();\n this.handlePageLoad();\n this.handleBrowserNavigation();\n });\n } else {\n this.setupTriggers();\n this.handlePageLoad();\n this.handleBrowserNavigation();\n }\n }\n \n private scrollToSection(sectionValue: string): void {\n const target = document.querySelector(`[${this.targetAttribute}=\"${sectionValue}\"]`) as HTMLElement;\n \n if (target) {\n this.updateURL(sectionValue);\n \n // Update active states for all triggers pointing to this section\n this.updateActiveStatesBySection(sectionValue);\n \n target.scrollIntoView({\n behavior: 'auto',\n block: 'start'\n });\n } else {\n console.warn(`ScrollNavigation: Target element with ${this.targetAttribute}=\"${sectionValue}\" not found`);\n }\n }\n \n private updateURL(sectionValue: string): void {\n try {\n const url = new URL(window.location.href);\n url.searchParams.set('section', sectionValue);\n window.history.pushState({ section: sectionValue }, '', url.toString());\n } catch (error) {\n console.error('ScrollNavigation: Failed to update URL', error);\n }\n }\n \n private handlePageLoad(): void {\n const urlParams = new URLSearchParams(window.location.search);\n const sectionParam = urlParams.get('section');\n \n if (sectionParam) {\n setTimeout(() => {\n this.scrollToSection(sectionParam);\n }, this.scrollDelay);\n }\n }\n \n private setupTriggers(): void {\n // Remove existing event listeners first\n document.removeEventListener('click', this.handleTriggerClick);\n \n // Initialize all triggers with inactive state\n this.initializeActiveStates();\n \n // Add single delegated event listener\n document.addEventListener('click', this.handleTriggerClick);\n }\n\n private initializeActiveStates(): void {\n const triggers = document.querySelectorAll(`[${this.triggerAttribute}]`) as NodeListOf<HTMLElement>;\n triggers.forEach((trigger: HTMLElement) => {\n trigger.setAttribute('fynd-anchor-active', 'false');\n });\n }\n\n private updateActiveStatesBySection(sectionValue: string): void {\n // Get all triggers\n const allTriggers = document.querySelectorAll(`[${this.triggerAttribute}]`) as NodeListOf<HTMLElement>;\n \n allTriggers.forEach((trigger: HTMLElement) => {\n const triggerSectionValue = trigger.getAttribute(this.triggerAttribute);\n \n // Set active state based on whether this trigger points to the target section\n if (triggerSectionValue === sectionValue) {\n trigger.setAttribute('fynd-anchor-active', 'true');\n } else {\n trigger.setAttribute('fynd-anchor-active', 'false');\n }\n });\n }\n\n private updateActiveStates(activeTrigger: HTMLElement): void {\n const activeSectionValue = activeTrigger.getAttribute(this.triggerAttribute);\n \n if (!activeSectionValue) return;\n \n this.updateActiveStatesBySection(activeSectionValue);\n }\n\n private handleTriggerClick = (event: Event): void => {\n const target = event.target as HTMLElement;\n const trigger = target.closest(`[${this.triggerAttribute}]`) as HTMLElement;\n \n if (trigger) {\n event.preventDefault();\n \n // Update active states\n this.updateActiveStates(trigger);\n \n const sectionValue = trigger.getAttribute(this.triggerAttribute);\n \n if (sectionValue) {\n this.scrollToSection(sectionValue);\n }\n }\n }\n \n private handleBrowserNavigation(): void {\n window.addEventListener('popstate', (event: PopStateEvent) => {\n const urlParams = new URLSearchParams(window.location.search);\n const sectionParam = urlParams.get('section');\n \n if (sectionParam) {\n const target = document.querySelector(`[${this.targetAttribute}=\"${sectionParam}\"]`) as HTMLElement;\n if (target) {\n // Update active states when navigating via browser back/forward\n this.updateActiveStatesBySection(sectionParam);\n \n target.scrollIntoView({\n behavior: 'auto',\n block: 'start'\n });\n }\n }\n });\n }\n \n // Public method to programmatically scroll to section\n public goToSection(sectionValue: string): void {\n this.scrollToSection(sectionValue);\n }\n \n // Public method to get current section from URL\n public getCurrentSection(): string | null {\n const urlParams = new URLSearchParams(window.location.search);\n return urlParams.get('section');\n }\n \n // Public method to get all available sections\n public getAvailableSections(): string[] {\n const targets = document.querySelectorAll(`[${this.targetAttribute}]`) as NodeListOf<HTMLElement>;\n const sections: string[] = [];\n \n targets.forEach((target: HTMLElement) => {\n const sectionValue = target.getAttribute(this.targetAttribute);\n if (sectionValue) {\n sections.push(sectionValue);\n }\n });\n \n return sections;\n }\n\n // Public method to reinitialize triggers (useful when DOM changes)\n public reinitializeTriggers(): void {\n this.setupTriggers();\n }\n\n // Public method for comprehensive reinitialization with options\n public reinitialize(options?: {\n triggers?: boolean;\n handlePageLoad?: boolean;\n browserNavigation?: boolean;\n }): void {\n const config = {\n triggers: true,\n handlePageLoad: false,\n browserNavigation: false,\n ...options\n };\n\n if (config.triggers) {\n this.setupTriggers();\n }\n\n if (config.handlePageLoad) {\n this.handlePageLoad();\n }\n\n if (config.browserNavigation) {\n this.handleBrowserNavigation();\n }\n }\n\n // Public method for complete reinitialization (equivalent to creating new instance)\n public fullReinitialize(): void {\n this.setupTriggers();\n this.handlePageLoad();\n this.handleBrowserNavigation();\n }\n }\n \n // Initialize with default options\n const scrollNavigation = new ScrollNavigation();\n \n // Alternative initialization with custom options\n // const scrollNavigation = new ScrollNavigation({\n // triggerAttribute: 'my-scroll-trigger',\n // targetAttribute: 'my-scroll-target',\n // scrollDelay: 200\n // });\n \n // Export for module usage\n export { ScrollNavigation };\n \n // Also make it available globally for non-module usage\n declare global {\n interface Window {\n ScrollNavigation: typeof ScrollNavigation;\n }\n }\n \n if (typeof window !== 'undefined') {\n window.ScrollNavigation = ScrollNavigation;\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;;;ACHE,MAAM,mBAAN,MAAuB;AAAA,IAKrB,YAAY,UAAmC,CAAC,GAAG;AAuGnD,WAAQ,qBAAqB,CAAC,UAAuB;AACnD,cAAM,SAAS,MAAM;AACrB,cAAM,UAAU,OAAO,QAAQ,IAAI,KAAK,gBAAgB,GAAG;AAE3D,YAAI,SAAS;AAC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