@hortonstudio/main 1.9.24 → 1.9.25

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.
Files changed (89) hide show
  1. package/dist/assets/hs-animations-tvD4W7u0.js +3 -0
  2. package/dist/assets/hs-animations-tvD4W7u0.js.br +0 -0
  3. package/dist/assets/hs-animations-tvD4W7u0.js.gz +0 -0
  4. package/dist/assets/hs-animations-tvD4W7u0.js.map +1 -0
  5. package/dist/assets/hs-counter-DmspKHOV.js +2 -0
  6. package/dist/assets/hs-counter-DmspKHOV.js.br +0 -0
  7. package/dist/assets/hs-counter-DmspKHOV.js.gz +0 -0
  8. package/dist/assets/{hs-counter-Bfh7_P60.js.map → hs-counter-DmspKHOV.js.map} +1 -1
  9. package/dist/assets/hs-default-Dxg7WNGx.js +2 -0
  10. package/dist/assets/hs-default-Dxg7WNGx.js.br +0 -0
  11. package/dist/assets/hs-default-Dxg7WNGx.js.gz +0 -0
  12. package/dist/assets/hs-default-Dxg7WNGx.js.map +1 -0
  13. package/dist/assets/hs-marquee-Dwenaw7L.js +2 -0
  14. package/dist/assets/hs-marquee-Dwenaw7L.js.br +0 -0
  15. package/dist/assets/hs-marquee-Dwenaw7L.js.gz +0 -0
  16. package/dist/assets/{hs-marquee-CZ9pmCbT.js.map → hs-marquee-Dwenaw7L.js.map} +1 -1
  17. package/dist/assets/hs-normalize-iTnWVIjq.js +2 -0
  18. package/dist/assets/hs-normalize-iTnWVIjq.js.br +0 -0
  19. package/dist/assets/hs-normalize-iTnWVIjq.js.gz +0 -0
  20. package/dist/assets/{hs-normalize-CTwtG5-a.js.map → hs-normalize-iTnWVIjq.js.map} +1 -1
  21. package/dist/assets/hs-utils-CNwAFmmK.js +2 -0
  22. package/dist/assets/hs-utils-CNwAFmmK.js.br +0 -0
  23. package/dist/assets/hs-utils-CNwAFmmK.js.gz +0 -0
  24. package/dist/assets/hs-utils-CNwAFmmK.js.map +1 -0
  25. package/dist/main.js +2 -2
  26. package/dist/main.js.br +0 -0
  27. package/dist/main.js.gz +0 -0
  28. package/dist/main.js.map +1 -1
  29. package/package.json +2 -2
  30. package/dist/assets/hs-animations-BDMqlbof.js +0 -3
  31. package/dist/assets/hs-animations-BDMqlbof.js. +0 -3
  32. package/dist/assets/hs-animations-BDMqlbof.js.gz +0 -0
  33. package/dist/assets/hs-animations-BDMqlbof.js.map +0 -1
  34. package/dist/assets/hs-attributeSelector-6pGcDBo-.js +0 -2
  35. package/dist/assets/hs-attributeSelector-6pGcDBo-.js.map +0 -1
  36. package/dist/assets/hs-comparison-Ja8EiSGD.js +0 -2
  37. package/dist/assets/hs-comparison-Ja8EiSGD.js. +0 -2
  38. package/dist/assets/hs-comparison-Ja8EiSGD.js.gz +0 -0
  39. package/dist/assets/hs-comparison-Ja8EiSGD.js.map +0 -1
  40. package/dist/assets/hs-counter-Bfh7_P60.js +0 -2
  41. package/dist/assets/hs-counter-Bfh7_P60.js. +0 -2
  42. package/dist/assets/hs-counter-Bfh7_P60.js.gz +0 -0
  43. package/dist/assets/hs-cssVariables-BjuwJfDJ.js +0 -2
  44. package/dist/assets/hs-cssVariables-BjuwJfDJ.js.map +0 -1
  45. package/dist/assets/hs-default-CLmDRb9d.js +0 -2
  46. package/dist/assets/hs-default-CLmDRb9d.js. +0 -2
  47. package/dist/assets/hs-default-CLmDRb9d.js.gz +0 -0
  48. package/dist/assets/hs-default-CLmDRb9d.js.map +0 -1
  49. package/dist/assets/hs-form-COFGgawz.js +0 -2
  50. package/dist/assets/hs-form-COFGgawz.js. +0 -2
  51. package/dist/assets/hs-form-COFGgawz.js.gz +0 -0
  52. package/dist/assets/hs-form-COFGgawz.js.map +0 -1
  53. package/dist/assets/hs-marquee-CZ9pmCbT.js +0 -2
  54. package/dist/assets/hs-marquee-CZ9pmCbT.js. +0 -2
  55. package/dist/assets/hs-marquee-CZ9pmCbT.js.gz +0 -0
  56. package/dist/assets/hs-modalManager-H_YegPAO.js +0 -2
  57. package/dist/assets/hs-modalManager-H_YegPAO.js. +0 -2
  58. package/dist/assets/hs-modalManager-H_YegPAO.js.gz +0 -0
  59. package/dist/assets/hs-modalManager-H_YegPAO.js.map +0 -1
  60. package/dist/assets/hs-normalize-CTwtG5-a.js +0 -2
  61. package/dist/assets/hs-normalize-CTwtG5-a.js. +0 -2
  62. package/dist/assets/hs-normalize-CTwtG5-a.js.gz +0 -0
  63. package/dist/assets/hs-orchestrator-J8b7XRk1.js +0 -2
  64. package/dist/assets/hs-orchestrator-J8b7XRk1.js. +0 -2
  65. package/dist/assets/hs-orchestrator-J8b7XRk1.js.gz +0 -0
  66. package/dist/assets/hs-orchestrator-J8b7XRk1.js.map +0 -1
  67. package/dist/assets/hs-pagination-DcOxmDPJ.js +0 -2
  68. package/dist/assets/hs-pagination-DcOxmDPJ.js. +0 -2
  69. package/dist/assets/hs-pagination-DcOxmDPJ.js.gz +0 -0
  70. package/dist/assets/hs-pagination-DcOxmDPJ.js.map +0 -1
  71. package/dist/assets/hs-structure-DhNix64P.js +0 -3
  72. package/dist/assets/hs-structure-DhNix64P.js. +0 -3
  73. package/dist/assets/hs-structure-DhNix64P.js.gz +0 -0
  74. package/dist/assets/hs-structure-DhNix64P.js.map +0 -1
  75. package/dist/assets/hs-tabs-CaxqHoGW.js +0 -2
  76. package/dist/assets/hs-tabs-CaxqHoGW.js. +0 -2
  77. package/dist/assets/hs-tabs-CaxqHoGW.js.gz +0 -0
  78. package/dist/assets/hs-tabs-CaxqHoGW.js.map +0 -1
  79. package/dist/assets/hs-toc-fxIQS7tz.js +0 -2
  80. package/dist/assets/hs-toc-fxIQS7tz.js. +0 -2
  81. package/dist/assets/hs-toc-fxIQS7tz.js.gz +0 -0
  82. package/dist/assets/hs-toc-fxIQS7tz.js.map +0 -1
  83. package/dist/assets/hs-transition-CDNuGJNq.js +0 -2
  84. package/dist/assets/hs-transition-CDNuGJNq.js. +0 -2
  85. package/dist/assets/hs-transition-CDNuGJNq.js.gz +0 -0
  86. package/dist/assets/hs-transition-CDNuGJNq.js.map +0 -1
  87. package/dist/assets/hs-utils-CKm6QhLw.js +0 -2
  88. package/dist/assets/hs-utils-CKm6QhLw.js.map +0 -1
  89. package/dist/main.js. +0 -3
@@ -1 +0,0 @@
1
- {"version":3,"file":"hs-pagination-DcOxmDPJ.js","sources":["../../src/modules/structure/functions/pagination.ts"],"sourcesContent":["/**\n * Pagination\n *\n * Paginated lists with controls, counters, and dot navigation.\n * Supports infinite looping, mobile/desktop layouts, and full accessibility.\n *\n * Features:\n * - Infinite loop navigation with cloned pages\n * - Responsive items-per-page (desktop/mobile breakpoints)\n * - Dot navigation with keyboard support\n * - Live region announcements for screen readers\n * - Auto-hide controls for single page\n * - Dynamic height adjustment\n * - Focus management with inert attribute\n *\n * HTML Structure:\n * <div data-hs-pagination=\"wrapper\">\n * <div data-hs-pagination=\"list\">\n * <!-- Items here -->\n * </div>\n * <div data-hs-pagination=\"controls\" data-hs-pagination-show=\"6\" data-hs-pagination-show-mobile=\"3\">\n * <div data-hs-pagination=\"previous\"><button>Prev</button></div>\n * <div data-hs-pagination=\"counter\"></div>\n * <div data-hs-pagination=\"next\"><button>Next</button></div>\n * </div>\n * <div data-hs-pagination=\"dots\">\n * <div class=\"is-active\">•</div>\n * <div>•</div>\n * </div>\n * </div>\n */\n\nimport { querySelectorAll, querySelector, getSelector, globalConfig, cssVariables } from '@utils';\n\nexport function init(config) {\n const cleanup = {\n observers: [] as ResizeObserver[],\n handlers: [] as Array<{ element: Element; event: string; handler: EventListener }>,\n liveRegions: [] as HTMLElement[],\n };\n\n // Initialize all pagination containers\n try {\n querySelectorAll(config, 'wrapper').forEach((container) => {\n try {\n const instance = initPaginationInstance(container, cleanup, config);\n if (!instance) {\n console.warn('[pagination] Failed to initialize container', container);\n }\n } catch (error) {\n console.error('[pagination] Error initializing container:', error, container);\n }\n });\n } catch (error) {\n console.error('[pagination] Critical error during initialization:', error);\n }\n\n return {\n result: 'pagination initialized',\n destroy: () => {\n try {\n // Remove all live regions\n cleanup.liveRegions.forEach((liveRegion) => {\n try {\n if (liveRegion.parentNode) {\n liveRegion.parentNode.removeChild(liveRegion);\n }\n } catch (error) {\n console.error('[pagination] Error removing live region:', error);\n }\n });\n cleanup.liveRegions.length = 0;\n\n // Disconnect all observers\n cleanup.observers.forEach((obs) => {\n try {\n obs.disconnect();\n } catch (error) {\n console.error('[pagination] Error disconnecting observer:', error);\n }\n });\n cleanup.observers.length = 0;\n\n // Remove all event listeners\n cleanup.handlers.forEach(({ element, event, handler }) => {\n try {\n element.removeEventListener(event, handler);\n } catch (error) {\n console.error('[pagination] Error removing event listener:', error);\n }\n });\n cleanup.handlers.length = 0;\n } catch (error) {\n console.error('[pagination] Critical error during cleanup:', error);\n }\n },\n };\n}\n\nfunction initPaginationInstance(\n container: Element,\n cleanup: {\n observers: ResizeObserver[];\n handlers: Array<{ element: Element; event: string; handler: EventListener }>;\n liveRegions: HTMLElement[];\n },\n config: any\n) {\n const list = querySelector(config, 'list', container) as HTMLElement;\n if (!list) {\n console.warn('[pagination] Missing required element: list');\n return null;\n }\n\n const wrapper = list.parentElement as HTMLElement;\n if (!wrapper) return null;\n\n const elements = {\n controls: querySelector(config, 'controls', container) as HTMLElement | null,\n counter: querySelector(config, 'counter', container) as HTMLElement | null,\n dotsWrap: querySelector(config, 'dots', container) as HTMLElement | null,\n nextButton: null as HTMLElement | null,\n prevButton: null as HTMLElement | null,\n };\n\n // Early exit for infinite mode - no controls means no pagination\n if (!elements.controls) {\n return { initialized: false };\n }\n\n // Find next/previous buttons using clickable pattern\n const nextClickable = querySelector(config, 'next', container);\n const prevClickable = querySelector(config, 'previous', container);\n\n const clickableSelector = getSelector(\n globalConfig.clickable as {\n attributes: { elements: { [key: string]: { primary: string; aliases?: string[] } } };\n },\n 'button'\n );\n const nextButton = (nextClickable?.querySelector(clickableSelector) ||\n nextClickable) as HTMLElement | null;\n const prevButton = (prevClickable?.querySelector(clickableSelector) ||\n prevClickable) as HTMLElement | null;\n\n if (!nextButton || !prevButton) {\n console.warn('[pagination] Missing required navigation buttons');\n return null;\n }\n\n elements.nextButton = nextButton;\n elements.prevButton = prevButton;\n\n // Add ARIA attributes to buttons\n elements.nextButton.setAttribute('aria-label', 'Go to next page');\n elements.prevButton.setAttribute('aria-label', 'Go to previous page');\n if (elements.counter) {\n elements.counter.setAttribute('aria-live', 'polite');\n elements.counter.setAttribute('aria-label', 'Current page');\n }\n\n // Parse configuration from attributes\n const desktopItems =\n parseInt(elements.controls?.getAttribute(config.attributes.properties.show) || '6') || 6;\n const mobileItems =\n parseInt(\n elements.controls?.getAttribute(config.attributes.properties.showMobile) ||\n String(desktopItems)\n ) || desktopItems;\n\n const isMobileLayout = () => {\n const stateValue = getComputedStyle(list).getPropertyValue(cssVariables.state).trim();\n return stateValue === globalConfig.cssVars.state.values.active;\n };\n\n const allItems = Array.from(list.children) as HTMLElement[];\n const totalItems = allItems.length;\n if (!totalItems) return null;\n\n const state = {\n totalPages: 1,\n currentIndex: 1,\n currentPage: 1,\n isAnimating: false,\n itemsPerPage: desktopItems,\n dotTemplates: { active: null as Element | null, inactive: null as Element | null },\n };\n let wrapperChildren: Element[] = [];\n\n // Create live region for announcements\n const liveRegion = document.createElement('div');\n liveRegion.className = 'sr-only';\n liveRegion.setAttribute('aria-live', 'assertive');\n liveRegion.setAttribute('aria-atomic', 'true');\n liveRegion.style.cssText =\n 'position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden;';\n container.appendChild(liveRegion);\n cleanup.liveRegions.push(liveRegion);\n\n const updateCounter = () => {\n if (elements.counter) {\n elements.counter.textContent = `${state.currentPage} / ${state.totalPages}`;\n }\n };\n\n const announcePageChange = () => {\n liveRegion.textContent = `Page ${state.currentPage} of ${state.totalPages}`;\n setTimeout(() => (liveRegion.textContent = ''), 1000);\n };\n\n const manageFocus = () => {\n wrapperChildren.forEach((page, index) => {\n const htmlPage = page as HTMLElement;\n if (index === state.currentIndex) {\n htmlPage.removeAttribute('inert');\n } else {\n htmlPage.setAttribute('inert', '');\n }\n });\n };\n\n const updateHeight = () => {\n const targetPage = wrapperChildren[state.currentIndex] as HTMLElement;\n if (targetPage && targetPage.offsetHeight !== undefined) {\n wrapper.style.height = targetPage.offsetHeight + 'px';\n }\n };\n\n const initializeDots = () => {\n if (!elements.dotsWrap) return;\n\n // Find existing dots as templates\n const existingDots = Array.from(elements.dotsWrap.children);\n if (!existingDots.length) return;\n\n // Identify active and inactive templates\n const activeDot = existingDots.find((dot) => dot.classList.contains('is-active'));\n const inactiveDot = existingDots.find((dot) => !dot.classList.contains('is-active'));\n\n // Store templates (use same template for both if only one exists)\n state.dotTemplates.active = activeDot\n ? (activeDot.cloneNode(true) as Element)\n : (existingDots[0].cloneNode(true) as Element);\n state.dotTemplates.inactive = inactiveDot\n ? (inactiveDot.cloneNode(true) as Element)\n : (existingDots[0].cloneNode(true) as Element);\n\n // Clear existing dots\n elements.dotsWrap.innerHTML = '';\n\n // Add pagination accessibility attributes\n elements.dotsWrap.setAttribute('role', 'group');\n elements.dotsWrap.setAttribute('aria-label', 'Page navigation');\n\n // Create dots for each page\n for (let i = 1; i <= state.totalPages; i++) {\n const dot = (i === 1 ? state.dotTemplates.active : state.dotTemplates.inactive)!.cloneNode(\n true\n ) as HTMLElement;\n\n // Add accessibility attributes\n dot.setAttribute('role', 'button');\n dot.setAttribute('tabindex', '0');\n dot.setAttribute('aria-label', `Go to page ${i}`);\n dot.setAttribute('aria-current', i === 1 ? 'page' : 'false');\n dot.setAttribute('data-page', String(i));\n\n // Set initial active state\n if (i === 1) {\n dot.classList.add('is-active');\n } else {\n dot.classList.remove('is-active');\n }\n\n // Click handler\n const clickHandler = () => navigateToPage(i);\n dot.addEventListener('click', clickHandler);\n cleanup.handlers.push({ element: dot, event: 'click', handler: clickHandler });\n\n // Keyboard handler\n const keyHandler = (e: KeyboardEvent) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault();\n navigateToPage(i);\n }\n };\n dot.addEventListener('keydown', keyHandler as EventListener);\n cleanup.handlers.push({\n element: dot,\n event: 'keydown',\n handler: keyHandler as EventListener,\n });\n\n elements.dotsWrap.appendChild(dot);\n }\n };\n\n const updateActiveDot = () => {\n if (!elements.dotsWrap) return;\n\n const dots = Array.from(elements.dotsWrap.children);\n dots.forEach((dot, index) => {\n const dotPage = index + 1;\n if (dotPage === state.currentPage) {\n dot.classList.add('is-active');\n dot.setAttribute('aria-current', 'page');\n } else {\n dot.classList.remove('is-active');\n dot.setAttribute('aria-current', 'false');\n }\n });\n };\n\n const initializePagination = (forceItemsPerPage: number | null = null) => {\n const currentIsMobile = isMobileLayout();\n state.itemsPerPage = forceItemsPerPage || (currentIsMobile ? mobileItems : desktopItems);\n state.totalPages = Math.ceil(totalItems / state.itemsPerPage);\n\n // Remove old dot event handlers to prevent memory leaks\n if (elements.dotsWrap) {\n cleanup.handlers = cleanup.handlers.filter(({ element }) => {\n return !elements.dotsWrap!.contains(element);\n });\n }\n\n // Clean up previous page lists\n Array.from(wrapper.children).forEach((child) => {\n if (child !== list) wrapper.removeChild(child);\n });\n list.innerHTML = '';\n allItems.forEach((item) => list.appendChild(item));\n\n // Single page case\n if (state.totalPages <= 1) {\n if (elements.controls) {\n if (elements.controls.contains(document.activeElement) && document.activeElement) {\n (document.activeElement as HTMLElement).blur();\n }\n elements.controls.style.display = 'none';\n elements.controls.setAttribute('aria-hidden', 'true');\n }\n if (elements.dotsWrap) {\n elements.dotsWrap.style.display = 'none';\n elements.dotsWrap.setAttribute('aria-hidden', 'true');\n }\n Object.assign(state, { totalPages: 1, currentIndex: 1, currentPage: 1, isAnimating: false });\n wrapper.style.cssText = `transform: translateX(0%); height: ${list.offsetHeight}px;`;\n wrapperChildren = [list];\n return 1;\n }\n\n // Show controls and dots\n if (elements.controls) {\n elements.controls.style.display = '';\n elements.controls.removeAttribute('aria-hidden');\n }\n if (elements.dotsWrap) {\n elements.dotsWrap.style.display = '';\n elements.dotsWrap.removeAttribute('aria-hidden');\n }\n\n // Create page lists\n const pageLists = Array.from({ length: state.totalPages }, (_, page) => {\n const pageList = list.cloneNode(false) as HTMLElement;\n const startIndex = page * state.itemsPerPage;\n const endIndex = Math.min(startIndex + state.itemsPerPage, totalItems);\n allItems\n .slice(startIndex, endIndex)\n .forEach((item) => pageList.appendChild(item.cloneNode(true)));\n return pageList;\n });\n\n // Insert cloned pages for infinite loop\n wrapper.insertBefore(pageLists[pageLists.length - 1].cloneNode(true), list);\n pageLists.slice(1).forEach((page) => wrapper.appendChild(page));\n wrapper.appendChild(pageLists[0].cloneNode(true));\n\n // Populate original list with first page\n list.innerHTML = '';\n Array.from(pageLists[0].children).forEach((item) => list.appendChild(item as Node));\n\n Object.assign(state, { currentIndex: 1, currentPage: 1, isAnimating: false });\n wrapperChildren = Array.from(wrapper.children);\n wrapper.style.transform = 'translateX(-100%)';\n\n updateCounter();\n updateHeight();\n manageFocus();\n initializeDots();\n return state.totalPages;\n };\n\n let currentLayoutIsMobile = isMobileLayout();\n\n const checkLayoutChange = () => {\n // Prevent resize during animation\n if (state.isAnimating) return;\n\n const newIsMobile = isMobileLayout();\n if (newIsMobile !== currentLayoutIsMobile) {\n currentLayoutIsMobile = newIsMobile;\n initializePagination();\n } else {\n updateHeight();\n }\n };\n\n const resizeObserver = new ResizeObserver(checkLayoutChange);\n resizeObserver.observe(wrapper);\n cleanup.observers.push(resizeObserver);\n\n initializePagination();\n\n const navigateToPage = (targetPage: number) => {\n if (state.isAnimating || state.totalPages <= 1 || targetPage === state.currentPage) return;\n state.isAnimating = true;\n\n state.currentIndex = targetPage;\n state.currentPage = targetPage;\n\n updateCounter();\n announcePageChange();\n updateHeight();\n updateActiveDot();\n\n if (isMobileLayout() && elements.controls) {\n setTimeout(() => {\n const controlsBottom =\n elements.controls.getBoundingClientRect().bottom + window.pageYOffset;\n const clearance = 5 * 16; // 5rem in pixels\n const targetScrollPosition = controlsBottom - window.innerHeight + clearance;\n window.scrollTo({ top: targetScrollPosition, behavior: 'smooth' });\n }, 50);\n }\n\n wrapper.style.transform = `translateX(${-state.currentIndex * 100}%)`;\n\n let transitionTimeout = null;\n\n const handleTransitionEnd = () => {\n clearTimeout(transitionTimeout);\n wrapper.removeEventListener('transitionend', handleTransitionEnd);\n\n updateCounter();\n announcePageChange();\n updateHeight();\n manageFocus();\n updateActiveDot();\n state.isAnimating = false;\n };\n\n // Safety timeout in case transitionend never fires\n transitionTimeout = setTimeout(handleTransitionEnd, 1000);\n\n wrapper.addEventListener('transitionend', handleTransitionEnd);\n };\n\n const navigate = (direction: number) => {\n if (state.isAnimating || state.totalPages <= 1) return;\n state.isAnimating = true;\n state.currentIndex += direction;\n\n state.currentPage =\n state.currentIndex > state.totalPages\n ? 1\n : state.currentIndex < 1\n ? state.totalPages\n : state.currentIndex;\n\n updateCounter();\n announcePageChange();\n updateHeight();\n updateActiveDot();\n\n if (isMobileLayout() && elements.controls) {\n setTimeout(() => {\n const controlsBottom =\n elements.controls.getBoundingClientRect().bottom + window.pageYOffset;\n const clearance = 5 * 16; // 5rem in pixels\n const targetScrollPosition = controlsBottom - window.innerHeight + clearance;\n window.scrollTo({ top: targetScrollPosition, behavior: 'smooth' });\n }, 50);\n }\n\n wrapper.style.transform = `translateX(${-state.currentIndex * 100}%)`;\n\n let transitionTimeout = null;\n\n const handleTransitionEnd = () => {\n clearTimeout(transitionTimeout);\n wrapper.removeEventListener('transitionend', handleTransitionEnd);\n\n if (state.currentIndex > state.totalPages) {\n state.currentIndex = 1;\n state.currentPage = 1;\n // Disable transition for instant jump\n wrapper.style.transition = 'none';\n wrapper.style.transform = 'translateX(-100%)';\n // Force reflow to apply the instant jump\n wrapper.offsetHeight;\n // Re-enable CSS transition\n wrapper.style.transition = '';\n } else if (state.currentIndex < 1) {\n state.currentIndex = state.totalPages;\n state.currentPage = state.totalPages;\n // Disable transition for instant jump\n wrapper.style.transition = 'none';\n wrapper.style.transform = `translateX(${-state.totalPages * 100}%)`;\n // Force reflow to apply the instant jump\n wrapper.offsetHeight;\n // Re-enable CSS transition\n wrapper.style.transition = '';\n }\n\n updateCounter();\n announcePageChange();\n updateHeight();\n manageFocus();\n updateActiveDot();\n state.isAnimating = false;\n };\n\n // Safety timeout in case transitionend never fires\n transitionTimeout = setTimeout(handleTransitionEnd, 1000);\n\n wrapper.addEventListener('transitionend', handleTransitionEnd);\n };\n\n const nextHandler = () => navigate(1);\n const prevHandler = () => navigate(-1);\n\n elements.nextButton.addEventListener('click', nextHandler);\n elements.prevButton.addEventListener('click', prevHandler);\n\n cleanup.handlers.push(\n { element: elements.nextButton, event: 'click', handler: nextHandler },\n { element: elements.prevButton, event: 'click', handler: prevHandler }\n );\n\n return { initialized: true };\n}\n"],"names":["init","config","cleanup","observers","handlers","liveRegions","querySelectorAll","forEach","container","instance","list","querySelector","console","warn","wrapper","parentElement","elements","controls","counter","dotsWrap","nextButton","prevButton","initialized","nextClickable","prevClickable","clickableSelector","getSelector","globalConfig","clickable","setAttribute","desktopItems","parseInt","getAttribute","attributes","properties","show","mobileItems","showMobile","String","isMobileLayout","getComputedStyle","getPropertyValue","cssVariables","state","trim","cssVars","values","active","allItems","Array","from","children","totalItems","length","totalPages","currentIndex","currentPage","isAnimating","itemsPerPage","dotTemplates","inactive","wrapperChildren","liveRegion","document","createElement","className","style","cssText","appendChild","push","updateCounter","textContent","announcePageChange","setTimeout","manageFocus","page","index","htmlPage","removeAttribute","updateHeight","targetPage","offsetHeight","height","initializeDots","existingDots","activeDot","find","dot","classList","contains","inactiveDot","cloneNode","innerHTML","i","add","remove","clickHandler","navigateToPage","addEventListener","element","event","handler","keyHandler","e","key","preventDefault","updateActiveDot","initializePagination","forceItemsPerPage","currentIsMobile","Math","ceil","filter","child","removeChild","item","activeElement","blur","display","Object","assign","pageLists","_","pageList","startIndex","endIndex","min","slice","insertBefore","transform","currentLayoutIsMobile","resizeObserver","ResizeObserver","newIsMobile","observe","clearance","targetScrollPosition","getBoundingClientRect","bottom","window","pageYOffset","innerHeight","scrollTo","top","behavior","transitionTimeout","handleTransitionEnd","clearTimeout","removeEventListener","navigate","direction","transition","nextHandler","prevHandler","initPaginationInstance","error","result","destroy","parentNode","obs","disconnect"],"mappings":"2NAkCO,SAASA,EAAKC,GACnB,MAAMC,EAAU,CACdC,UAAW,GACXC,SAAU,GACVC,YAAa,IAIf,IACEC,EAAiBL,EAAQ,WAAWM,QAASC,IAC3C,IACE,MAAMC,EAsDd,SACED,EACAN,EAKAD,GAEA,MAAMS,EAAOC,EAAcV,EAAQ,OAAQO,GAC3C,IAAKE,EAEH,OADAE,QAAQC,KAAK,+CACN,KAGT,MAAMC,EAAUJ,EAAKK,cACrB,IAAKD,EAAS,OAAO,KAErB,MAAME,EAAW,CACfC,SAAUN,EAAcV,EAAQ,WAAYO,GAC5CU,QAASP,EAAcV,EAAQ,UAAWO,GAC1CW,SAAUR,EAAcV,EAAQ,OAAQO,GACxCY,WAAY,KACZC,WAAY,MAId,IAAKL,EAASC,SACZ,MAAO,CAAEK,aAAa,GAIxB,MAAMC,EAAgBZ,EAAcV,EAAQ,OAAQO,GAC9CgB,EAAgBb,EAAcV,EAAQ,WAAYO,GAElDiB,EAAoBC,EACxBC,EAAaC,UAGb,UAEIR,EAAcG,GAAeZ,cAAcc,IAC/CF,EACIF,EAAcG,GAAeb,cAAcc,IAC/CD,EAEF,IAAKJ,IAAeC,EAElB,OADAT,QAAQC,KAAK,oDACN,KAGTG,EAASI,WAAaA,EACtBJ,EAASK,WAAaA,EAGtBL,EAASI,WAAWS,aAAa,aAAc,mBAC/Cb,EAASK,WAAWQ,aAAa,aAAc,uBAC3Cb,EAASE,UACXF,EAASE,QAAQW,aAAa,YAAa,UAC3Cb,EAASE,QAAQW,aAAa,aAAc,iBAI9C,MAAMC,EACJC,SAASf,EAASC,UAAUe,aAAa/B,EAAOgC,WAAWC,WAAWC,OAAS,MAAQ,EACnFC,EACJL,SACEf,EAASC,UAAUe,aAAa/B,EAAOgC,WAAWC,WAAWG,aAC3DC,OAAOR,KACNA,EAEDS,EAAiB,IACFC,iBAAiB9B,GAAM+B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ps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/hs-toc-fxIQS7tz.js","main.js","assets/hs-attributeSelector-6pGcDBo-.js","assets/hs-modalManager-H_YegPAO.js","assets/hs-pagination-DcOxmDPJ.js","assets/hs-utils-CKm6QhLw.js","assets/hs-cssVariables-BjuwJfDJ.js","assets/hs-comparison-Ja8EiSGD.js","assets/hs-tabs-CaxqHoGW.js","assets/hs-form-COFGgawz.js"])))=>i.map(i=>d[i]);
2
- import{_ as t,c as r}from"../main.js";import{g as o}from"./hs-attributeSelector-6pGcDBo-.js";import"./hs-modalManager-H_YegPAO.js";import{c as a}from"./hs-orchestrator-J8b7XRk1.js";const e=r.structure,s=[{name:"toc",selector:o(e.toc,"list"),import:()=>t(()=>import("./hs-toc-fxIQS7tz.js"),__vite__mapDeps([0,1,2,3]))},{name:"pagination",selector:o(e.pagination,"wrapper"),import:()=>t(()=>import("./hs-pagination-DcOxmDPJ.js"),__vite__mapDeps([4,5,3,1,2,6])),config:e.pagination},{name:"comparison",selector:o(e.comparison,"wrapper"),import:()=>t(()=>import("./hs-comparison-Ja8EiSGD.js"),__vite__mapDeps([7,5,3,1,2,6])),config:e.comparison},{name:"tabs",selector:o(e.tabs,"wrapper"),import:()=>t(()=>import("./hs-tabs-CaxqHoGW.js"),__vite__mapDeps([8,1,5,3,2]))},{name:"form",selector:"[data-hs-form]",import:()=>t(()=>import("./hs-form-COFGgawz.js"),__vite__mapDeps([9,1,2,3]))}],i=(()=>{const t=s.filter(t=>document.querySelector(t.selector)).map(t=>t.import().catch(r=>(console.error(`[structure] Failed to preload ${t.name}:`,r),null)));return Promise.allSettled(t)})();async function n(){await i;const t=a(s),{loaded:r}=await t.scan();return{result:`structure initialized (${r.length} active)`,rescan:t.scan,destroy:t.destroy}}export{n as init};
3
- //# sourceMappingURL=hs-structure-DhNix64P.js.map
@@ -1,3 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/hs-toc-fxIQS7tz.js","main.js","assets/hs-attributeSelector-6pGcDBo-.js","assets/hs-modalManager-H_YegPAO.js","assets/hs-pagination-DcOxmDPJ.js","assets/hs-utils-CKm6QhLw.js","assets/hs-cssVariables-BjuwJfDJ.js","assets/hs-comparison-Ja8EiSGD.js","assets/hs-tabs-CaxqHoGW.js","assets/hs-form-COFGgawz.js"])))=>i.map(i=>d[i]);
2
- import{_ as t,c as r}from"../main.js";import{g as o}from"./hs-attributeSelector-6pGcDBo-.js";import"./hs-modalManager-H_YegPAO.js";import{c as a}from"./hs-orchestrator-J8b7XRk1.js";const e=r.structure,s=[{name:"toc",selector:o(e.toc,"list"),import:()=>t(()=>import("./hs-toc-fxIQS7tz.js"),__vite__mapDeps([0,1,2,3]))},{name:"pagination",selector:o(e.pagination,"wrapper"),import:()=>t(()=>import("./hs-pagination-DcOxmDPJ.js"),__vite__mapDeps([4,5,3,1,2,6])),config:e.pagination},{name:"comparison",selector:o(e.comparison,"wrapper"),import:()=>t(()=>import("./hs-comparison-Ja8EiSGD.js"),__vite__mapDeps([7,5,3,1,2,6])),config:e.comparison},{name:"tabs",selector:o(e.tabs,"wrapper"),import:()=>t(()=>import("./hs-tabs-CaxqHoGW.js"),__vite__mapDeps([8,1,5,3,2]))},{name:"form",selector:"[data-hs-form]",import:()=>t(()=>import("./hs-form-COFGgawz.js"),__vite__mapDeps([9,1,2,3]))}],i=(()=>{const t=s.filter(t=>document.querySelector(t.selector)).map(t=>t.import().catch(r=>(console.error(`[structure] Failed to preload ${t.name}:`,r),null)));return Promise.allSettled(t)})();async function n(){await i;const t=a(s),{loaded:r}=await t.scan();return{result:`structure initialized (${r.length} active)`,rescan:t.scan,destroy:t.destroy}}export{n as init};
3
- //# sourceMappingURL=hs-structure-DhNix64P.js.map
@@ -1 +0,0 @@
1
- {"version":3,"mappings":";qLA+BA,MAAMA,EAAeC,EAAOC,UAOtBC,EAA4C,CAChD,CACEC,KAAM,MACNC,SAAUC,EAAYN,EAAaO,IAAqB,QACxDC,OAAQ,IAAAC,EAAA,IAAMD,OAAO,wBAAwBE,6BAE/C,CACEN,KAAM,aACNC,SAAUC,EAAYN,EAAaW,WAA4B,WAC/DH,OAAQ,UAAMA,OAAO,+BAA2BE,gCAChDT,OAAQD,EAAaW,YAEvB,CACEP,KAAM,aACNC,SAAUC,EAAYN,EAAaY,WAA4B,WAC/DJ,OAAQ,UAAMA,OAAO,+BAA2BE,gCAChDT,OAAQD,EAAaY,YAEvB,CACER,KAAM,OACNC,SAAUC,EAAYN,EAAaa,KAAsB,WACzDL,OAAQ,UAAMA,OAAO,yBAAqBE,+BAE5C,CACEN,KAAM,OACNC,SAAU,iBACVG,OAAQ,IAAAC,EAAA,IAAMD,OAAO,yBAA0BE,8BAM7CI,QACJ,MAKMC,EALmBZ,EAAmBa,OAAQC,GAClDC,SAASC,cAAcF,EAAOZ,WAISe,IAAKH,GAC5CA,EAAOT,SAASa,MAAOC,IACrBC,QAAQD,MAAM,iCAAiCL,EAAOb,QAASkB,GACxD,QAIX,OAAOE,QAAQC,WAAWV,EAC5B,KAEAW,eAAsBC,UAEdb,EAEN,MAAMc,EAAeC,EAAmB1B,IAClC2B,OAAEA,SAAiBF,EAAaG,OAEtC,MAAO,CACLC,OAAQ,0BAA0BF,EAAOG,iBACzCC,OAAQN,EAAaG,KACrBI,QAASP,EAAaO,QAE1B","names":["moduleConfig","config","structure","STRUCTURE_REGISTRY","name","selector","getSelector","toc","import","__vitePreload","__VITE_PRELOAD__","pagination","comparison","tabs","preloadStructure","preloadPromises","filter","module","document","querySelector","map","catch","error","console","Promise","allSettled","async","init","orchestrator","createOrchestrator","loaded","scan","result","length","rescan","destroy"],"ignoreList":[],"sources":["../../src/modules/structure/structure.ts"],"sourcesContent":["/**\n * Structure Orchestrator\n *\n * Conditionally loads structural DOM modification modules based on element presence.\n * Uses registry pattern for scalable module management.\n *\n * Features:\n * - Registry-based conditional loading\n * - Dynamic imports for code-splitting\n * - Prevents duplicate initialization\n * - SPA-friendly rescan() method\n * - Only loads modules when needed on page\n *\n * Architecture:\n * - Runs after normalize, before default\n * - Modifies DOM structure (IDs, pagination, comparisons)\n * - Other modules may depend on these structural changes\n *\n * Adding new modules:\n * 1. Add entry to STRUCTURE_REGISTRY below\n * 2. That's it - orchestrator handles the rest\n */\n\nimport config from '@config';\nimport {\n createOrchestrator,\n type ModuleRegistryEntry,\n getSelector,\n type ModuleConfig,\n} from '@utils';\n\nconst moduleConfig = config.structure;\n\n/**\n * Structure Registry\n * Add new structural modules here - one line per module\n * Selectors pulled directly from config for consistency\n */\nconst STRUCTURE_REGISTRY: ModuleRegistryEntry[] = [\n {\n name: 'toc',\n selector: getSelector(moduleConfig.toc as ModuleConfig, 'list'),\n import: () => import('./functions/toc/toc.ts'),\n },\n {\n name: 'pagination',\n selector: getSelector(moduleConfig.pagination as ModuleConfig, 'wrapper'),\n import: () => import('./functions/pagination.ts'),\n config: moduleConfig.pagination,\n },\n {\n name: 'comparison',\n selector: getSelector(moduleConfig.comparison as ModuleConfig, 'wrapper'),\n import: () => import('./functions/comparison.ts'),\n config: moduleConfig.comparison,\n },\n {\n name: 'tabs',\n selector: getSelector(moduleConfig.tabs as ModuleConfig, 'wrapper'),\n import: () => import('./functions/tabs.ts'),\n },\n {\n name: 'form',\n selector: '[data-hs-form]',\n import: () => import('./functions/form/form.ts'),\n },\n];\n\n// Pre-download structure modules as soon as this file loads (before init is called)\n// This allows parallel downloads during the normalize phase\nconst preloadStructure = (() => {\n const modulesToPreload = STRUCTURE_REGISTRY.filter((module) =>\n document.querySelector(module.selector)\n );\n\n // Download all found modules in parallel\n const preloadPromises = modulesToPreload.map((module) =>\n module.import().catch((error) => {\n console.error(`[structure] Failed to preload ${module.name}:`, error);\n return null;\n })\n );\n\n return Promise.allSettled(preloadPromises);\n})();\n\nexport async function init() {\n // Wait for preloading to complete (modules are already downloaded)\n await preloadStructure;\n\n const orchestrator = createOrchestrator(STRUCTURE_REGISTRY);\n const { loaded } = await orchestrator.scan();\n\n return {\n result: `structure initialized (${loaded.length} active)`,\n rescan: orchestrator.scan,\n destroy: orchestrator.destroy,\n };\n}\n"],"file":"hs-structure-DhNix64P.js"}
@@ -1,2 +0,0 @@
1
- import{c as t}from"../main.js";import{g as e}from"./hs-utils-CKm6QhLw.js";import{q as s,a as n,g as a}from"./hs-attributeSelector-6pGcDBo-.js";import{p as i,g as r}from"./hs-modalManager-H_YegPAO.js";const o=t.structure.tabs;function l(){const l={handlers:[],timers:[],animationFrames:[],observers:[]},c=(t,e,s,n)=>{t.addEventListener(e,s,n),l.handlers.push({element:t,event:e,handler:s,options:n})},p=t=>l.animationFrames.push(t),u=()=>`${t._global.cssVars.prefix}${o.cssVars?.progress||"progress"}`,y=(t,e)=>t.style.setProperty(u(),String(e));function f(t){const s=n(o,"links",t),f=n(o,"list",t);if(!s||!f)return;const h=Array.from(s.children),d=Array.from(f.children),m=a(e.clickable,"button"),b=h.map(t=>t.querySelector(m)).filter(t=>null!==t);if(0===b.length)return;const g=t.getAttribute(o.attributes.properties?.autoplay||"data-hs-tab-autoplay"),v=t.getAttribute(o.attributes.properties?.duration||"data-hs-tab-duration"),E=t.getAttribute(o.attributes.properties?.hover||"data-hs-tab-hover"),A=t.getAttribute(o.attributes.properties?.animation||"data-hs-tab-animation"),w=t.getAttribute(o.attributes.properties?.animationDuration||"data-hs-tab-animation-duration"),P="true"===g,k=v?parseFloat(v):6,F="pause"===E,D=A,$=w?parseFloat(w):.3,L=`${"hs-tab"}-${Math.random().toString(36).substring(2,9)}`;d.forEach((t,e)=>{const s=t.id||`${L}-panel-${e}`,n=`${L}-tab-${e}`;t.id=s,b[e]&&(b[e].id=n,b[e].setAttribute("aria-controls",s))});let S=0,q=null,x=null,M=null,j=!1,C=!1,V=!1;async function I(t,s=!1){if(C)return;if(t<0||t>=d.length)return;if(t===S&&!s)return;C=!0;const n=S;if(S=t,b.forEach((e,s)=>{e.setAttribute("aria-selected",s===t?"true":"false"),e.setAttribute("tabindex",s===t?"0":"-1")}),h.forEach((s,n)=>{s.classList.toggle(e.classes.active,n===t)}),P)if(j){const e=h[n]?parseFloat(getComputedStyle(h[n]).getPropertyValue(u())||"0"):0;h.forEach((s,n)=>y(s,n===t?e:0))}else T();const a=d[n],o=d[t];"fade"!==D||s?"clip"!==D||s?d.forEach((s,n)=>{n===t?("fade"===D||"clip"===D?(s.style.position="",s.style.display="block","fade"===D?s.style.opacity="1":s.style.clipPath=""):s.style.display="block",s.inert=!1,s.style.pointerEvents="",s.classList.add(e.classes.active)):("fade"===D||"clip"===D?(s.style.display="none","fade"===D?s.style.opacity="0":s.style.clipPath=""):s.style.display="none",s.inert=!0,s.style.pointerEvents="none",s.classList.remove(e.classes.active))}):await async function(t,e,s){i()&&(s=0);const n=r("tabs",!1);if(!n)return t.style.display="none",t.style.position="",t.style.clipPath="",t.inert=!0,t.style.pointerEvents="none",e.style.display="block",e.style.position="",e.style.clipPath="",e.inert=!1,void(e.style.pointerEvents="");const{gsap:a}=n;return new Promise(n=>{const i=a.timeline({onComplete:()=>{t.style.display="none",t.style.position="",t.style.clipPath="",t.inert=!0,t.style.pointerEvents="none",e.style.position="",e.style.clipPath="",e.inert=!1,e.style.pointerEvents="",n()},defaults:{duration:s,ease:"power1.inOut"}});i.set(t,{position:"absolute",top:0,left:0,width:"100%",clipPath:"inset(0% 0% 0% 0%)"}),i.set(e,{display:"block",position:"relative",clipPath:"inset(0% 0% 100% 0%)"}),i.to(t,{clipPath:"inset(100% 0% 0% 0%)"}),i.to(e,{clipPath:"inset(0% 0% 0% 0%)"},"<40%")})}(a,o,$):await async function(t,e,s){i()&&(s=0);const n=r("tabs",!1);if(!n)return t.style.display="none",t.style.position="",t.inert=!0,t.style.pointerEvents="none",e.style.display="block",e.style.position="",e.inert=!1,void(e.style.pointerEvents="");const{gsap:a}=n;return new Promise(n=>{const i=a.timeline({onComplete:()=>{t.style.display="none",t.style.position="",t.style.opacity="",t.inert=!0,t.style.pointerEvents="none",e.style.position="",e.style.opacity="",e.inert=!1,e.style.pointerEvents="",n()},defaults:{duration:s,ease:"power1.out"}});i.set(t,{position:"absolute",top:0,left:0,width:"100%"}),i.set(e,{display:"block",position:"relative",opacity:0}),i.to(t,{opacity:0}),i.to(e,{opacity:1},"<50%")})}(a,o,$),C=!1}function O(t){if(P){M||(M=t);const e=Math.min((t-M)/(1e3*k),1);h.forEach((t,s)=>y(t,s===S?e:0)),e<1&&!j&&(x=requestAnimationFrame(O),x&&p(x))}else h.forEach((t,e)=>y(t,e===S?1:0))}function T(){if(z(),!P)return O(0);if(j||!V)return;const t=h[S]?parseFloat(getComputedStyle(h[S]).getPropertyValue(u())||"0"):0,e=t*k*1e3,s=Math.max(0,1e3*k-e);M=null;const n=t,a=performance.now(),i=t=>{const e=Math.min(n+(t-a)/(1e3*k),1);h.forEach((t,s)=>y(t,s===S?e:0)),e<1&&!j&&(x=requestAnimationFrame(i),x&&p(x))};var r;x=requestAnimationFrame(i),x&&p(x),q=window.setTimeout(()=>I((S+1)%d.length),s),r=q,l.timers.push(r)}function z(){null!==q&&(clearTimeout(q),q=null),null!==x&&(cancelAnimationFrame(x),x=null),M=null}const H=()=>{j=!0,z()},N=()=>{j=!1,T()};b.forEach((t,e)=>{c(t,"click",t=>{t.preventDefault(),I(e)})});const R=t=>{const e=b.indexOf(t.target);if(-1===e)return;let s=e;switch(t.key){case"ArrowLeft":case"ArrowUp":t.preventDefault(),s=0===e?b.length-1:e-1;break;case"ArrowRight":case"ArrowDown":t.preventDefault(),s=e===b.length-1?0:e+1;break;case"Home":t.preventDefault(),s=0;break;case"End":t.preventDefault(),s=b.length-1;break;default:return}C||(I(s),b[s].focus())};b.forEach(t=>c(t,"keydown",R)),F&&P&&(c(t,"mouseenter",H),c(t,"mouseleave",N));let U=!1;c(document,"keydown",()=>U=!0),c(document,"mousedown",()=>U=!1),P&&(c(t,"focusin",()=>{U&&(H(),K())}),c(t,"focusout",()=>{U&&j&&(N(),K())}));const _=`[${o.attributes.properties?.controls||"data-hs-tab-controls"}]`,B=t.querySelectorAll(_);let G=null,J=null;B.forEach(t=>{const s=t.getAttribute(o.attributes.properties?.controls||"data-hs-tab-controls"),n=t.querySelector(m);if(n)if("previous"===s)n.setAttribute("aria-label","Previous tab"),c(n,"click",t=>{t.preventDefault(),I(0===S?d.length-1:S-1)});else if("next"===s)n.setAttribute("aria-label","Next tab"),c(n,"click",t=>{t.preventDefault(),I((S+1)%d.length)});else if("toggle"===s){if(!P)return void(t.style.display="none");G=t,J=n,J.setAttribute("aria-label",j?"Play":"Pause"),G.classList.toggle(e.classes.active,!j),c(n,"click",t=>{t.preventDefault(),j?N():H(),K()})}});const K=()=>{G&&J&&(G.classList.toggle(e.classes.active,!j),J.setAttribute("aria-label",j?"Play":"Pause"))};if(I(0,!0),P){const e=new IntersectionObserver(t=>{t.forEach(t=>{V=t.isIntersecting,t.isIntersecting&&!j?T():z()})},{threshold:.1});e.observe(t),Q=e,l.observers.push(Q)}var Q}const h=s(o,"wrapper");return h.forEach(t=>{f(t)}),{result:`tabs initialized (${h.length} systems)`,destroy:()=>{l.timers.forEach(t=>clearTimeout(t)),l.timers.length=0,l.animationFrames.forEach(t=>cancelAnimationFrame(t)),l.animationFrames.length=0,l.observers.forEach(t=>t.disconnect()),l.observers.length=0,l.handlers.forEach(({element:t,event:e,handler:s,options:n})=>{t.removeEventListener(e,s,n)}),l.handlers.length=0}}}export{l as init};
2
- //# sourceMappingURL=hs-tabs-CaxqHoGW.js.map
@@ -1,2 +0,0 @@
1
- import{c as t}from"../main.js";import{g as e}from"./hs-utils-CKm6QhLw.js";import{q as s,a as n,g as a}from"./hs-attributeSelector-6pGcDBo-.js";import{p as i,g as r}from"./hs-modalManager-H_YegPAO.js";const o=t.structure.tabs;function l(){const l={handlers:[],timers:[],animationFrames:[],observers:[]},c=(t,e,s,n)=>{t.addEventListener(e,s,n),l.handlers.push({element:t,event:e,handler:s,options:n})},p=t=>l.animationFrames.push(t),u=()=>`${t._global.cssVars.prefix}${o.cssVars?.progress||"progress"}`,y=(t,e)=>t.style.setProperty(u(),String(e));function f(t){const s=n(o,"links",t),f=n(o,"list",t);if(!s||!f)return;const h=Array.from(s.children),d=Array.from(f.children),m=a(e.clickable,"button"),b=h.map(t=>t.querySelector(m)).filter(t=>null!==t);if(0===b.length)return;const g=t.getAttribute(o.attributes.properties?.autoplay||"data-hs-tab-autoplay"),v=t.getAttribute(o.attributes.properties?.duration||"data-hs-tab-duration"),E=t.getAttribute(o.attributes.properties?.hover||"data-hs-tab-hover"),A=t.getAttribute(o.attributes.properties?.animation||"data-hs-tab-animation"),w=t.getAttribute(o.attributes.properties?.animationDuration||"data-hs-tab-animation-duration"),P="true"===g,k=v?parseFloat(v):6,F="pause"===E,D=A,$=w?parseFloat(w):.3,L=`${"hs-tab"}-${Math.random().toString(36).substring(2,9)}`;d.forEach((t,e)=>{const s=t.id||`${L}-panel-${e}`,n=`${L}-tab-${e}`;t.id=s,b[e]&&(b[e].id=n,b[e].setAttribute("aria-controls",s))});let S=0,q=null,x=null,M=null,j=!1,C=!1,V=!1;async function I(t,s=!1){if(C)return;if(t<0||t>=d.length)return;if(t===S&&!s)return;C=!0;const n=S;if(S=t,b.forEach((e,s)=>{e.setAttribute("aria-selected",s===t?"true":"false"),e.setAttribute("tabindex",s===t?"0":"-1")}),h.forEach((s,n)=>{s.classList.toggle(e.classes.active,n===t)}),P)if(j){const e=h[n]?parseFloat(getComputedStyle(h[n]).getPropertyValue(u())||"0"):0;h.forEach((s,n)=>y(s,n===t?e:0))}else T();const a=d[n],o=d[t];"fade"!==D||s?"clip"!==D||s?d.forEach((s,n)=>{n===t?("fade"===D||"clip"===D?(s.style.position="",s.style.display="block","fade"===D?s.style.opacity="1":s.style.clipPath=""):s.style.display="block",s.inert=!1,s.style.pointerEvents="",s.classList.add(e.classes.active)):("fade"===D||"clip"===D?(s.style.display="none","fade"===D?s.style.opacity="0":s.style.clipPath=""):s.style.display="none",s.inert=!0,s.style.pointerEvents="none",s.classList.remove(e.classes.active))}):await async function(t,e,s){i()&&(s=0);const n=r("tabs",!1);if(!n)return t.style.display="none",t.style.position="",t.style.clipPath="",t.inert=!0,t.style.pointerEvents="none",e.style.display="block",e.style.position="",e.style.clipPath="",e.inert=!1,void(e.style.pointerEvents="");const{gsap:a}=n;return new Promise(n=>{const i=a.timeline({onComplete:()=>{t.style.display="none",t.style.position="",t.style.clipPath="",t.inert=!0,t.style.pointerEvents="none",e.style.position="",e.style.clipPath="",e.inert=!1,e.style.pointerEvents="",n()},defaults:{duration:s,ease:"power1.inOut"}});i.set(t,{position:"absolute",top:0,left:0,width:"100%",clipPath:"inset(0% 0% 0% 0%)"}),i.set(e,{display:"block",position:"relative",clipPath:"inset(0% 0% 100% 0%)"}),i.to(t,{clipPath:"inset(100% 0% 0% 0%)"}),i.to(e,{clipPath:"inset(0% 0% 0% 0%)"},"<40%")})}(a,o,$):await async function(t,e,s){i()&&(s=0);const n=r("tabs",!1);if(!n)return t.style.display="none",t.style.position="",t.inert=!0,t.style.pointerEvents="none",e.style.display="block",e.style.position="",e.inert=!1,void(e.style.pointerEvents="");const{gsap:a}=n;return new Promise(n=>{const i=a.timeline({onComplete:()=>{t.style.display="none",t.style.position="",t.style.opacity="",t.inert=!0,t.style.pointerEvents="none",e.style.position="",e.style.opacity="",e.inert=!1,e.style.pointerEvents="",n()},defaults:{duration:s,ease:"power1.out"}});i.set(t,{position:"absolute",top:0,left:0,width:"100%"}),i.set(e,{display:"block",position:"relative",opacity:0}),i.to(t,{opacity:0}),i.to(e,{opacity:1},"<50%")})}(a,o,$),C=!1}function O(t){if(P){M||(M=t);const e=Math.min((t-M)/(1e3*k),1);h.forEach((t,s)=>y(t,s===S?e:0)),e<1&&!j&&(x=requestAnimationFrame(O),x&&p(x))}else h.forEach((t,e)=>y(t,e===S?1:0))}function T(){if(z(),!P)return O(0);if(j||!V)return;const t=h[S]?parseFloat(getComputedStyle(h[S]).getPropertyValue(u())||"0"):0,e=t*k*1e3,s=Math.max(0,1e3*k-e);M=null;const n=t,a=performance.now(),i=t=>{const e=Math.min(n+(t-a)/(1e3*k),1);h.forEach((t,s)=>y(t,s===S?e:0)),e<1&&!j&&(x=requestAnimationFrame(i),x&&p(x))};var r;x=requestAnimationFrame(i),x&&p(x),q=window.setTimeout(()=>I((S+1)%d.length),s),r=q,l.timers.push(r)}function z(){null!==q&&(clearTimeout(q),q=null),null!==x&&(cancelAnimationFrame(x),x=null),M=null}const H=()=>{j=!0,z()},N=()=>{j=!1,T()};b.forEach((t,e)=>{c(t,"click",t=>{t.preventDefault(),I(e)})});const R=t=>{const e=b.indexOf(t.target);if(-1===e)return;let s=e;switch(t.key){case"ArrowLeft":case"ArrowUp":t.preventDefault(),s=0===e?b.length-1:e-1;break;case"ArrowRight":case"ArrowDown":t.preventDefault(),s=e===b.length-1?0:e+1;break;case"Home":t.preventDefault(),s=0;break;case"End":t.preventDefault(),s=b.length-1;break;default:return}C||(I(s),b[s].focus())};b.forEach(t=>c(t,"keydown",R)),F&&P&&(c(t,"mouseenter",H),c(t,"mouseleave",N));let U=!1;c(document,"keydown",()=>U=!0),c(document,"mousedown",()=>U=!1),P&&(c(t,"focusin",()=>{U&&(H(),K())}),c(t,"focusout",()=>{U&&j&&(N(),K())}));const _=`[${o.attributes.properties?.controls||"data-hs-tab-controls"}]`,B=t.querySelectorAll(_);let G=null,J=null;B.forEach(t=>{const s=t.getAttribute(o.attributes.properties?.controls||"data-hs-tab-controls"),n=t.querySelector(m);if(n)if("previous"===s)n.setAttribute("aria-label","Previous tab"),c(n,"click",t=>{t.preventDefault(),I(0===S?d.length-1:S-1)});else if("next"===s)n.setAttribute("aria-label","Next tab"),c(n,"click",t=>{t.preventDefault(),I((S+1)%d.length)});else if("toggle"===s){if(!P)return void(t.style.display="none");G=t,J=n,J.setAttribute("aria-label",j?"Play":"Pause"),G.classList.toggle(e.classes.active,!j),c(n,"click",t=>{t.preventDefault(),j?N():H(),K()})}});const K=()=>{G&&J&&(G.classList.toggle(e.classes.active,!j),J.setAttribute("aria-label",j?"Play":"Pause"))};if(I(0,!0),P){const e=new IntersectionObserver(t=>{t.forEach(t=>{V=t.isIntersecting,t.isIntersecting&&!j?T():z()})},{threshold:.1});e.observe(t),Q=e,l.observers.push(Q)}var Q}const h=s(o,"wrapper");return h.forEach(t=>{f(t)}),{result:`tabs initialized (${h.length} systems)`,destroy:()=>{l.timers.forEach(t=>clearTimeout(t)),l.timers.length=0,l.animationFrames.forEach(t=>cancelAnimationFrame(t)),l.animationFrames.length=0,l.observers.forEach(t=>t.disconnect()),l.observers.length=0,l.handlers.forEach(({element:t,event:e,handler:s,options:n})=>{t.removeEventListener(e,s,n)}),l.handlers.length=0}}}export{l as init};
2
- //# sourceMappingURL=hs-tabs-CaxqHoGW.js.map
Binary file
@@ -1 +0,0 @@
1
- {"version":3,"file":"hs-tabs-CaxqHoGW.js","sources":["../../src/modules/structure/functions/tabs.ts"],"sourcesContent":["/**\n * Tabs\n *\n * Accessible tab system with autoplay, keyboard navigation, and optional animations.\n * Index-based matching: first button controls first panel, second controls second, etc.\n *\n * Features:\n * - Index-based tab/panel matching (no manual ID configuration needed)\n * - Optional autoplay with configurable duration\n * - CSS progress variable for visual countdown (--_hs---progress)\n * - Pause on hover and focus (accessibility)\n * - Previous/next/toggle controls\n * - Keyboard navigation (Arrow keys, Home, End)\n * - Optional fade or height animations\n * - Respects prefers-reduced-motion\n * - Full ARIA support (auto-generated IDs, aria-controls, aria-selected)\n *\n * Structure:\n * <div data-hs-tab=\"wrapper\" data-hs-tab-autoplay=\"true\" data-hs-tab-duration=\"6\">\n * <div data-hs-tab=\"links\" role=\"tablist\">\n * <div class=\"tab-link\">\n * <button role=\"tab\" data-hs-clickable=\"button\">Tab 1</button>\n * </div>\n * </div>\n * <div data-hs-tab=\"list\">\n * <div role=\"tabpanel\">Panel 1 content</div>\n * <div role=\"tabpanel\">Panel 2 content</div>\n * </div>\n * </div>\n */\n\nimport config from '@config';\nimport {\n querySelectorAll,\n querySelector,\n getSelector,\n globalConfig,\n prefersReducedMotion,\n getGsap,\n hasGsap,\n} from '@utils';\n\ninterface EventHandler {\n element: Element | Document;\n event: string;\n handler: EventListener;\n options?: AddEventListenerOptions;\n}\n\ninterface ModuleConfig {\n attributes: {\n elements: Record<string, { primary: string; aliases?: string[] }>;\n properties?: Record<string, string>;\n };\n cssVars?: {\n progress?: string;\n };\n}\n\nconst moduleConfig = config.structure.tabs as ModuleConfig;\n\nexport function init() {\n const cleanup = {\n handlers: [] as EventHandler[],\n timers: [] as number[],\n animationFrames: [] as number[],\n observers: [] as IntersectionObserver[],\n };\n\n const addHandler = (\n element: Element | Document,\n event: string,\n handler: EventListener,\n options?: AddEventListenerOptions\n ): void => {\n element.addEventListener(event, handler, options);\n cleanup.handlers.push({ element, event, handler, options });\n };\n\n const addTimer = (id: number) => cleanup.timers.push(id);\n const addAnimationFrame = (id: number) => cleanup.animationFrames.push(id);\n const addObserver = (obs: IntersectionObserver) => cleanup.observers.push(obs);\n\n // Helper: Generate unique IDs for ARIA\n const generateId = (prefix: string) => `${prefix}-${Math.random().toString(36).substring(2, 9)}`;\n\n // Helper: Get CSS var name with prefix\n const getProgressVarName = () =>\n `${config._global.cssVars.prefix}${moduleConfig.cssVars?.progress || 'progress'}`;\n\n // Helper: Set progress CSS variable on element\n const setProgress = (element: HTMLElement, progress: number) =>\n element.style.setProperty(getProgressVarName(), String(progress));\n\n // Helper: Fade animation using GSAP\n async function animateFade(\n outPanel: HTMLElement,\n inPanel: HTMLElement,\n duration: number\n ): Promise<void> {\n // Handle reduced motion by setting duration to 0\n if (prefersReducedMotion()) duration = 0;\n\n const gsapInstance = getGsap('tabs', false);\n\n // Fallback to instant switch if GSAP not available\n if (!gsapInstance) {\n outPanel.style.display = 'none';\n outPanel.style.position = '';\n (outPanel as HTMLElement).inert = true;\n outPanel.style.pointerEvents = 'none';\n\n inPanel.style.display = 'block';\n inPanel.style.position = '';\n (inPanel as HTMLElement).inert = false;\n inPanel.style.pointerEvents = '';\n return;\n }\n\n const { gsap } = gsapInstance;\n\n return new Promise<void>((resolve) => {\n const tl = gsap.timeline({\n onComplete: () => {\n // Final cleanup after animation\n outPanel.style.display = 'none';\n outPanel.style.position = '';\n outPanel.style.opacity = '';\n (outPanel as HTMLElement).inert = true;\n outPanel.style.pointerEvents = 'none';\n\n inPanel.style.position = '';\n inPanel.style.opacity = '';\n (inPanel as HTMLElement).inert = false;\n inPanel.style.pointerEvents = '';\n\n resolve();\n },\n defaults: { duration: duration, ease: 'power1.out' },\n });\n\n // Set old panel to absolute position\n tl.set(outPanel, { position: 'absolute', top: 0, left: 0, width: '100%' });\n\n // Set new panel to visible and relative\n tl.set(inPanel, { display: 'block', position: 'relative', opacity: 0 });\n\n // Fade out old panel\n tl.to(outPanel, { opacity: 0 });\n\n // Fade in new panel (starts at 50% of fade out)\n tl.to(inPanel, { opacity: 1 }, '<50%');\n });\n }\n\n // Helper: Clip-path animation using GSAP\n async function animateClip(\n outPanel: HTMLElement,\n inPanel: HTMLElement,\n duration: number\n ): Promise<void> {\n // Handle reduced motion by setting duration to 0\n if (prefersReducedMotion()) duration = 0;\n\n const gsapInstance = getGsap('tabs', false);\n\n // Fallback to instant switch if GSAP not available\n if (!gsapInstance) {\n outPanel.style.display = 'none';\n outPanel.style.position = '';\n outPanel.style.clipPath = '';\n (outPanel as HTMLElement).inert = true;\n outPanel.style.pointerEvents = 'none';\n\n inPanel.style.display = 'block';\n inPanel.style.position = '';\n inPanel.style.clipPath = '';\n (inPanel as HTMLElement).inert = false;\n inPanel.style.pointerEvents = '';\n return;\n }\n\n const { gsap } = gsapInstance;\n\n return new Promise<void>((resolve) => {\n const tl = gsap.timeline({\n onComplete: () => {\n // Final cleanup after animation\n outPanel.style.display = 'none';\n outPanel.style.position = '';\n outPanel.style.clipPath = '';\n (outPanel as HTMLElement).inert = true;\n outPanel.style.pointerEvents = 'none';\n\n inPanel.style.position = '';\n inPanel.style.clipPath = '';\n (inPanel as HTMLElement).inert = false;\n inPanel.style.pointerEvents = '';\n\n resolve();\n },\n defaults: { duration: duration, ease: 'power1.inOut' },\n });\n\n // Set old panel to absolute position with full clip\n tl.set(outPanel, {\n position: 'absolute',\n top: 0,\n left: 0,\n width: '100%',\n clipPath: 'inset(0% 0% 0% 0%)',\n });\n\n // Set new panel to visible with bottom clipped\n tl.set(inPanel, { display: 'block', position: 'relative', clipPath: 'inset(0% 0% 100% 0%)' });\n\n // Clip out old panel (top to bottom)\n tl.to(outPanel, { clipPath: 'inset(100% 0% 0% 0%)' });\n\n // Clip in new panel (bottom to top, starts at 40% through clip out)\n tl.to(inPanel, { clipPath: 'inset(0% 0% 0% 0%)' }, '<40%');\n });\n }\n\n // Setup individual tab system\n function setupTabSystem(wrapper: Element): void {\n const linksWrapper = querySelector(moduleConfig as any, 'links', wrapper);\n const listWrapper = querySelector(moduleConfig as any, 'list', wrapper);\n\n if (!linksWrapper || !listWrapper) {\n return;\n }\n\n // Get tab links (direct children of links wrapper)\n const tabLinkElements = Array.from(linksWrapper.children);\n\n // Get tab panels (direct children of list wrapper)\n const tabPanels = Array.from(listWrapper.children) as HTMLElement[];\n\n // Find clickable buttons within each tab link element\n const clickableSelector = getSelector(globalConfig.clickable as any, 'button');\n const tabButtons = tabLinkElements\n .map((linkEl) => linkEl.querySelector(clickableSelector))\n .filter((btn) => btn !== null) as HTMLElement[];\n\n if (tabButtons.length === 0) {\n return;\n }\n\n // Get options from attributes\n const autoplayAttr = (wrapper as HTMLElement).getAttribute(\n moduleConfig.attributes.properties?.autoplay || 'data-hs-tab-autoplay'\n );\n const durationAttr = (wrapper as HTMLElement).getAttribute(\n moduleConfig.attributes.properties?.duration || 'data-hs-tab-duration'\n );\n const hoverAttr = (wrapper as HTMLElement).getAttribute(\n moduleConfig.attributes.properties?.hover || 'data-hs-tab-hover'\n );\n const animationAttr = (wrapper as HTMLElement).getAttribute(\n moduleConfig.attributes.properties?.animation || 'data-hs-tab-animation'\n );\n const animDurationAttr = (wrapper as HTMLElement).getAttribute(\n moduleConfig.attributes.properties?.animationDuration || 'data-hs-tab-animation-duration'\n );\n\n const autoplayEnabled = autoplayAttr === 'true';\n const duration = durationAttr ? parseFloat(durationAttr) : 6;\n const pauseOnHover = hoverAttr === 'pause';\n const animationType = animationAttr as 'fade' | 'clip' | null;\n const animationDuration = animDurationAttr ? parseFloat(animDurationAttr) : 0.3;\n\n // Generate unique ID for this tab system\n const tabSystemId = generateId('hs-tab');\n\n // Setup ARIA and IDs\n tabPanels.forEach((panel, index) => {\n const panelId = panel.id || `${tabSystemId}-panel-${index}`;\n const tabId = `${tabSystemId}-tab-${index}`;\n\n panel.id = panelId;\n if (tabButtons[index]) {\n tabButtons[index].id = tabId;\n tabButtons[index].setAttribute('aria-controls', panelId);\n }\n });\n\n // State\n let currentIndex = 0;\n let autoplayTimer: number | null = null;\n let progressAnimationFrame: number | null = null;\n let progressStartTime: number | null = null;\n let isPaused = false;\n let isTransitioning = false;\n let isInView = false;\n\n // Activate tab\n async function activateTab(index: number, skipAnimation = false): Promise<void> {\n // Block if transition in progress\n if (isTransitioning) return;\n\n // Validate index\n if (index < 0 || index >= tabPanels.length) return;\n if (index === currentIndex && !skipAnimation) return;\n\n // Lock IMMEDIATELY to block any further calls\n isTransitioning = true;\n\n const previousIndex = currentIndex;\n currentIndex = index;\n\n // Update button ARIA and active classes\n tabButtons.forEach((btn, i) => {\n btn.setAttribute('aria-selected', i === index ? 'true' : 'false');\n btn.setAttribute('tabindex', i === index ? '0' : '-1');\n });\n\n tabLinkElements.forEach((linkEl, i) => {\n linkEl.classList.toggle(globalConfig.classes.active, i === index);\n });\n\n // Handle progress transfer\n if (autoplayEnabled) {\n if (!isPaused) {\n startAutoplay();\n } else {\n const currentProgress = tabLinkElements[previousIndex]\n ? parseFloat(\n getComputedStyle(tabLinkElements[previousIndex] as HTMLElement).getPropertyValue(\n getProgressVarName()\n ) || '0'\n )\n : 0;\n\n tabLinkElements.forEach((linkEl, i) =>\n setProgress(linkEl as HTMLElement, i === index ? currentProgress : 0)\n );\n }\n }\n\n // Update panel visibility with animation\n const previousPanel = tabPanels[previousIndex];\n const currentPanel = tabPanels[index];\n\n if (animationType === 'fade' && !skipAnimation) {\n await animateFade(previousPanel, currentPanel, animationDuration);\n } else if (animationType === 'clip' && !skipAnimation) {\n await animateClip(previousPanel, currentPanel, animationDuration);\n } else {\n // Instant switch (no animation or skip)\n tabPanels.forEach((panel, i) => {\n if (i === index) {\n if (animationType === 'fade' || animationType === 'clip') {\n (panel as HTMLElement).style.position = '';\n (panel as HTMLElement).style.display = 'block';\n if (animationType === 'fade') {\n (panel as HTMLElement).style.opacity = '1';\n } else {\n (panel as HTMLElement).style.clipPath = '';\n }\n } else {\n (panel as HTMLElement).style.display = 'block';\n }\n (panel as HTMLElement).inert = false;\n (panel as HTMLElement).style.pointerEvents = '';\n panel.classList.add(globalConfig.classes.active);\n } else {\n if (animationType === 'fade' || animationType === 'clip') {\n (panel as HTMLElement).style.display = 'none';\n if (animationType === 'fade') {\n (panel as HTMLElement).style.opacity = '0';\n } else {\n (panel as HTMLElement).style.clipPath = '';\n }\n } else {\n (panel as HTMLElement).style.display = 'none';\n }\n (panel as HTMLElement).inert = true;\n (panel as HTMLElement).style.pointerEvents = 'none';\n panel.classList.remove(globalConfig.classes.active);\n }\n });\n }\n\n // Release lock\n isTransitioning = false;\n }\n\n // Progress animation\n function updateProgress(timestamp: number): void {\n if (autoplayEnabled) {\n if (!progressStartTime) progressStartTime = timestamp;\n const progress = Math.min((timestamp - progressStartTime) / (duration * 1000), 1);\n\n tabLinkElements.forEach((linkEl, i) =>\n setProgress(linkEl as HTMLElement, i === currentIndex ? progress : 0)\n );\n\n if (progress < 1 && !isPaused) {\n progressAnimationFrame = requestAnimationFrame(updateProgress);\n if (progressAnimationFrame) addAnimationFrame(progressAnimationFrame);\n }\n } else {\n tabLinkElements.forEach((linkEl, i) =>\n setProgress(linkEl as HTMLElement, i === currentIndex ? 1 : 0)\n );\n }\n }\n\n // Start autoplay\n function startAutoplay(): void {\n stopAutoplay();\n if (!autoplayEnabled) return updateProgress(0);\n if (isPaused || !isInView) return;\n\n // Get current progress to resume from (if any)\n const currentProgress = tabLinkElements[currentIndex]\n ? parseFloat(\n getComputedStyle(tabLinkElements[currentIndex] as HTMLElement).getPropertyValue(\n getProgressVarName()\n ) || '0'\n )\n : 0;\n\n // Calculate remaining time based on current progress\n const elapsedTime = currentProgress * duration * 1000; // Convert progress to milliseconds\n const remainingTime = Math.max(0, duration * 1000 - elapsedTime);\n\n // Start progress animation from current progress\n progressStartTime = null;\n const startProgress = currentProgress;\n const resumeStartTime = performance.now();\n\n const resumeUpdate = (timestamp: number): void => {\n const totalProgress = Math.min(\n startProgress + (timestamp - resumeStartTime) / (duration * 1000),\n 1\n );\n\n tabLinkElements.forEach((linkEl, i) =>\n setProgress(linkEl as HTMLElement, i === currentIndex ? totalProgress : 0)\n );\n\n if (totalProgress < 1 && !isPaused) {\n progressAnimationFrame = requestAnimationFrame(resumeUpdate);\n if (progressAnimationFrame) addAnimationFrame(progressAnimationFrame);\n }\n };\n\n progressAnimationFrame = requestAnimationFrame(resumeUpdate);\n if (progressAnimationFrame) addAnimationFrame(progressAnimationFrame);\n\n autoplayTimer = window.setTimeout(\n () => activateTab((currentIndex + 1) % tabPanels.length),\n remainingTime\n );\n addTimer(autoplayTimer);\n }\n\n // Stop autoplay\n function stopAutoplay(): void {\n if (autoplayTimer !== null) {\n clearTimeout(autoplayTimer);\n autoplayTimer = null;\n }\n if (progressAnimationFrame !== null) {\n cancelAnimationFrame(progressAnimationFrame);\n progressAnimationFrame = null;\n }\n progressStartTime = null;\n }\n\n // Pause/Resume autoplay\n const pauseAutoplay = () => {\n isPaused = true;\n stopAutoplay();\n };\n const resumeAutoplay = () => {\n isPaused = false;\n startAutoplay();\n };\n\n // Tab click handler\n tabButtons.forEach((button, index) => {\n addHandler(button, 'click', (e: Event) => {\n e.preventDefault();\n activateTab(index);\n });\n });\n\n // Keyboard navigation\n const keydownHandler = (e: KeyboardEvent): void => {\n const index = tabButtons.indexOf(e.target as HTMLElement);\n if (index === -1) return;\n\n let newIndex = index;\n switch (e.key) {\n case 'ArrowLeft':\n case 'ArrowUp':\n e.preventDefault();\n newIndex = index === 0 ? tabButtons.length - 1 : index - 1;\n break;\n case 'ArrowRight':\n case 'ArrowDown':\n e.preventDefault();\n newIndex = index === tabButtons.length - 1 ? 0 : index + 1;\n break;\n case 'Home':\n e.preventDefault();\n newIndex = 0;\n break;\n case 'End':\n e.preventDefault();\n newIndex = tabButtons.length - 1;\n break;\n default:\n return;\n }\n\n if (isTransitioning) return;\n activateTab(newIndex);\n tabButtons[newIndex].focus();\n };\n\n tabButtons.forEach((button) => addHandler(button, 'keydown', keydownHandler));\n\n // Pause on hover\n if (pauseOnHover && autoplayEnabled) {\n addHandler(wrapper, 'mouseenter', pauseAutoplay);\n addHandler(wrapper, 'mouseleave', resumeAutoplay);\n }\n\n // Pause on focus (keyboard only)\n let isUsingKeyboard = false;\n addHandler(document, 'keydown', () => (isUsingKeyboard = true));\n addHandler(document, 'mousedown', () => (isUsingKeyboard = false));\n\n if (autoplayEnabled) {\n addHandler(wrapper, 'focusin', () => {\n if (isUsingKeyboard) {\n pauseAutoplay();\n updateToggleState();\n }\n });\n addHandler(wrapper, 'focusout', () => {\n if (isUsingKeyboard && isPaused) {\n resumeAutoplay();\n updateToggleState();\n }\n });\n }\n\n // Previous/Next/Toggle controls\n const controlsSelector = `[${\n moduleConfig.attributes.properties?.controls || 'data-hs-tab-controls'\n }]`;\n const controls = wrapper.querySelectorAll(controlsSelector);\n\n // Find toggle button for state updates (may be null if no toggle or autoplay disabled)\n let toggleControl: Element | null = null;\n let toggleButton: HTMLElement | null = null;\n\n controls.forEach((control) => {\n const controlType = control.getAttribute(\n moduleConfig.attributes.properties?.controls || 'data-hs-tab-controls'\n );\n const controlButton = control.querySelector(clickableSelector);\n\n if (!controlButton) return;\n\n if (controlType === 'previous') {\n (controlButton as HTMLElement).setAttribute('aria-label', 'Previous tab');\n addHandler(controlButton, 'click', (e: Event) => {\n e.preventDefault();\n activateTab(currentIndex === 0 ? tabPanels.length - 1 : currentIndex - 1);\n });\n } else if (controlType === 'next') {\n (controlButton as HTMLElement).setAttribute('aria-label', 'Next tab');\n addHandler(controlButton, 'click', (e: Event) => {\n e.preventDefault();\n activateTab((currentIndex + 1) % tabPanels.length);\n });\n } else if (controlType === 'toggle') {\n // Hide toggle button if autoplay is disabled\n if (!autoplayEnabled) {\n (control as HTMLElement).style.display = 'none';\n return;\n }\n\n // Store references for updateToggleState function\n toggleControl = control;\n toggleButton = controlButton as HTMLElement;\n\n toggleButton.setAttribute('aria-label', isPaused ? 'Play' : 'Pause');\n toggleControl.classList.toggle(globalConfig.classes.active, !isPaused);\n\n addHandler(controlButton, 'click', (e: Event) => {\n e.preventDefault();\n isPaused ? resumeAutoplay() : pauseAutoplay();\n updateToggleState();\n });\n }\n });\n\n // Helper: Update toggle button state\n const updateToggleState = () => {\n if (!toggleControl || !toggleButton) return;\n toggleControl.classList.toggle(globalConfig.classes.active, !isPaused);\n toggleButton.setAttribute('aria-label', isPaused ? 'Play' : 'Pause');\n };\n\n // Initialize first tab as active\n activateTab(0, true);\n\n // IntersectionObserver for autoplay visibility control\n if (autoplayEnabled) {\n const observer = new IntersectionObserver(\n (entries) => {\n entries.forEach((entry) => {\n isInView = entry.isIntersecting;\n entry.isIntersecting && !isPaused ? startAutoplay() : stopAutoplay();\n });\n },\n { threshold: 0.1 }\n );\n observer.observe(wrapper);\n addObserver(observer);\n }\n }\n\n // Find all tab wrappers and initialize\n const tabWrappers = querySelectorAll(moduleConfig as any, 'wrapper');\n\n tabWrappers.forEach((wrapper) => {\n setupTabSystem(wrapper);\n });\n\n return {\n result: `tabs initialized (${tabWrappers.length} systems)`,\n destroy: () => {\n // Clear all timers\n cleanup.timers.forEach((timerId) => clearTimeout(timerId));\n cleanup.timers.length = 0;\n\n // Clear all animation frames\n cleanup.animationFrames.forEach((frameId) => cancelAnimationFrame(frameId));\n cleanup.animationFrames.length = 0;\n\n // Disconnect all observers\n cleanup.observers.forEach((observer) => observer.disconnect());\n cleanup.observers.length = 0;\n\n // Remove all event listeners\n cleanup.handlers.forEach(({ element, event, handler, options }) => {\n element.removeEventListener(event, handler, options);\n });\n cleanup.handlers.length = 0;\n },\n };\n}\n"],"names":["moduleConfig","config","structure","tabs","init","cleanup","handlers","timers","animationFrames","observers","addHandler","element","event","handler","options","addEventListener","push","addAnimationFrame","id","getProgressVarName","_global","cssVars","prefix","progress","setProgress","style","setProperty","String","setupTabSystem","wrapper","linksWrapper","querySelector","listWrapper","tabLinkElements","Array","from","children","tabPanels","clickableSelector","getSelector","globalConfig","clickable","tabButtons","map","linkEl","filter","btn","length","autoplayAttr","getAttribute","attributes","properties","autoplay","durationAttr","duration","hoverAttr","hover","animationAttr","animation","animDurationAttr","animationDuration","autoplayEnabled","parseFloat","pauseOnHover","animationType","tabSystemId","Math","random","toString","substring","forEach","panel","index","panelId","tabId","setAttribute","currentIndex","autoplayTimer","progressAnimationFrame","progressStartTime","isPaused","isTransitioning","isInView","async","activateTab","skipAnimation","previousIndex","i","classList","toggle","classes","active","currentProgress","getComputedStyle","getPropertyValue","startAutoplay","previousPanel","currentPanel","position","display","opacity","clipPath","inert","pointerEvents","add","remove","outPanel","inPanel","prefersReducedMotion","gsapInstance","getGsap","gsap","Promise","resolve","tl","timeline","onComplete","defaults","ease","set","top","left","width","to","animateClip","animateFade","updateProgress","timestamp","min","requestAnimationFrame","stopAutoplay","elapsedTime","remainingTime","max","startProgress","resumeStartTime","performance","now","resumeUpdate","totalProgress","window","setTimeout","clearTimeout","cancelAnimationFrame","pauseAutoplay","resumeAutoplay","button","e","preventDefault","keydownHandler","indexOf","target","newIndex","key","focus","isUsingKeyboard","document","updateToggleState","controlsSelector","controls","querySelectorAll","toggleControl","toggleButton","control","controlType","controlButton","observer","IntersectionObserver","entries","entry","isIntersecting","threshold","observe","obs","tabWrappers","result","destroy","timerId","frameId","disconnect","removeEventListener"],"mappings":"wMA2DA,MAAMA,EAAeC,EAAOC,U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QC,QAASX,GAC7DkF,EAAavF,aAAa,aAAcK,EAAW,OAAS,WAO9D,GAHAI,EAAY,GAAG,GAGXvB,EAAiB,CACnB,MAAMyG,EAAW,IAAIC,qBAClBC,IACCA,EAAQlG,QAASmG,IACfvF,EAAWuF,EAAMC,eACjBD,EAAMC,iBAAmB1F,EAAWe,IAAkBmC,OAG1D,CAAEyC,UAAW,KAEfL,EAASM,QAAQ/I,GAhiBAgJ,EAiiBLP,EAjiBmCjK,EAAQI,UAAUO,KAAK6J,EAkiBxE,CAliBkB,IAACA,CAmiBrB,CAGA,MAAMC,EAAcd,EAAiBhK,EAAqB,WAM1D,OAJA8K,EAAYxG,QAASzC,IACnBD,EAAeC,KAGV,CACLkJ,OAAQ,qBAAqBD,EAAY/H,kBACzCiI,QAAS,KAEP3K,EAAQE,OAAO+D,QAAS2G,GAAYnC,aAAamC,IACjD5K,EAAQE,OAAOwC,OAAS,EAGxB1C,EAAQG,gBAAgB8D,QAAS4G,GAAYnC,qBAAqBmC,IAClE7K,EAAQG,gBAAgBuC,OAAS,EAGjC1C,EAAQI,UAAU6D,QAASgG,GAAaA,EAASa,cACjD9K,EAAQI,UAAUsC,OAAS,EAG3B1C,EAAQC,SAASgE,QAAQ,EAAG3D,UAASC,QAAOC,UAASC,cACnDH,EAAQyK,oBAAoBxK,EAAOC,EAASC,KAE9CT,EAAQC,SAASyC,OAAS,GAGhC"}
@@ -1,2 +0,0 @@
1
- import{c as e}from"../main.js";import{q as r,a as t,g as o}from"./hs-attributeSelector-6pGcDBo-.js";import{p as s,g as n}from"./hs-modalManager-H_YegPAO.js";function l(t){const o=e._global.classes.active,s={observers:[],handlers:[],scrollTimeout:null,headings:[]},n=r(t,"content"),l=r(t,"list");return n.forEach(e=>{const r=l[0];if(!r||0===r.children.length)return;const t=r.children[0].cloneNode(!0),n=t.querySelector("a");n&&n.classList.remove(o),r.innerHTML="";const i=e.querySelectorAll("h2");i.forEach(e=>{const r=e.textContent.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)/g,"");e.id=r,s.headings.push(e)}),i.forEach((e,o)=>{const s=t.cloneNode(!0),n=s.querySelector("a"),l=e.id;n.href=`#${l}`;const i=document.createElement("strong");i.textContent=`${o+1}. `,n.innerHTML="",n.appendChild(i),n.appendChild(document.createTextNode(e.textContent)),r.appendChild(s)});const c=r.querySelectorAll("a");let a=null;const d=()=>{const e=.25*window.innerHeight;let r=null;for(let t=i.length-1;t>=0;t--){if(i[t].getBoundingClientRect().top<=e){r=i[t].id;break}}if(r!==a&&(a=r,c.forEach(e=>e.classList.remove(o)),a)){const e=Array.from(c).find(e=>e.getAttribute("href")===`#${a}`);e&&e.classList.add(o)}},u=new IntersectionObserver(()=>{d()},{rootMargin:"-25% 0px -75% 0px",threshold:0});i.forEach(e=>u.observe(e)),(e=>{s.observers.push(e)})(u);var g,p,h;g=window,p="scroll",h=()=>{s.scrollTimeout&&clearTimeout(s.scrollTimeout),s.scrollTimeout=setTimeout(d,50)},g.addEventListener(p,h),s.handlers.push({element:g,event:p,handler:h})}),{result:"toc initialized",destroy:()=>{s.headings.forEach(e=>{e.removeAttribute("id")}),s.headings.length=0,s.observers.forEach(e=>e.disconnect()),s.observers.length=0,s.handlers.forEach(({element:e,event:r,handler:t})=>{e.removeEventListener(r,t)}),s.handlers.length=0,s.scrollTimeout&&(clearTimeout(s.scrollTimeout),s.scrollTimeout=null)}}}async function i(){const i=e.structure.toc,c={destroyFunctions:[]},a=o(i,"list");if(document.querySelector(a))try{const e=await l(i);e?.destroy&&c.destroyFunctions.push(e.destroy)}catch(u){console.error("[toc] Error initializing heading-links:",u)}const d=o(i["progress-bar"],"wrapper");if(document.querySelector(d))try{const e=await async function(e){const{progressConfig:o,tocConfig:l}=e;if(s())return{result:"progress-bar skipped - prefers-reduced-motion enabled"};const i=n("progress-bar");if(!i)return{result:"progress-bar skipped - GSAP not loaded"};const{gsap:c,ScrollTrigger:a}=i;if(!a)return console.warn("[progress-bar] GSAP ScrollTrigger plugin not loaded"),{result:"progress-bar skipped - ScrollTrigger not loaded"};c.registerPlugin(a);const d={scrollTriggers:[]},u=t(l,"content");if(!u)return{result:"progress-bar skipped - no content element found"};const g=r(o,"wrapper");return 0===g.length?{result:"progress-bar skipped - no wrapper elements found"}:(g.forEach(e=>{c.set(e,{display:"block"}),Array.from(e.querySelectorAll("*")).filter(e=>{const r=o.attributes.elements.element.primary,[t,s]=r.split("="),n=s?.replace(/['"]/g,"");return e.getAttribute(t)===n}).forEach(e=>{c.set(e,{width:"0%"}),c.to(e,{width:"100%",ease:"none",scrollTrigger:{trigger:u,start:"top bottom",end:"bottom 75%",scrub:!0,invalidateOnRefresh:!0,onUpdate:e=>{d.scrollTriggers.includes(e)||d.scrollTriggers.push(e)}}})})}),{result:`progress-bar initialized (${g.length} instances)`,destroy:()=>{d.scrollTriggers.forEach(e=>{e&&"object"==typeof e&&"kill"in e&&"function"==typeof e.kill&&e.kill()}),d.scrollTriggers.length=0}})}({progressConfig:i["progress-bar"],tocConfig:i});e?.destroy&&c.destroyFunctions.push(e.destroy)}catch(u){console.error("[toc] Error initializing progress-bar:",u)}return{result:`toc initialized (${c.destroyFunctions.length} modules active)`,destroy:()=>{c.destroyFunctions.forEach(e=>{try{e()}catch(u){console.error("[toc] Error during cleanup:",u)}}),c.destroyFunctions.length=0}}}export{i as init};
2
- //# sourceMappingURL=hs-toc-fxIQS7tz.js.map
@@ -1,2 +0,0 @@
1
- import{c as e}from"../main.js";import{q as r,a as t,g as o}from"./hs-attributeSelector-6pGcDBo-.js";import{p as s,g as n}from"./hs-modalManager-H_YegPAO.js";function l(t){const o=e._global.classes.active,s={observers:[],handlers:[],scrollTimeout:null,headings:[]},n=r(t,"content"),l=r(t,"list");return n.forEach(e=>{const r=l[0];if(!r||0===r.children.length)return;const t=r.children[0].cloneNode(!0),n=t.querySelector("a");n&&n.classList.remove(o),r.innerHTML="";const i=e.querySelectorAll("h2");i.forEach(e=>{const r=e.textContent.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/(^-|-$)/g,"");e.id=r,s.headings.push(e)}),i.forEach((e,o)=>{const s=t.cloneNode(!0),n=s.querySelector("a"),l=e.id;n.href=`#${l}`;const i=document.createElement("strong");i.textContent=`${o+1}. `,n.innerHTML="",n.appendChild(i),n.appendChild(document.createTextNode(e.textContent)),r.appendChild(s)});const c=r.querySelectorAll("a");let a=null;const d=()=>{const e=.25*window.innerHeight;let r=null;for(let t=i.length-1;t>=0;t--){if(i[t].getBoundingClientRect().top<=e){r=i[t].id;break}}if(r!==a&&(a=r,c.forEach(e=>e.classList.remove(o)),a)){const e=Array.from(c).find(e=>e.getAttribute("href")===`#${a}`);e&&e.classList.add(o)}},u=new IntersectionObserver(()=>{d()},{rootMargin:"-25% 0px -75% 0px",threshold:0});i.forEach(e=>u.observe(e)),(e=>{s.observers.push(e)})(u);var g,p,h;g=window,p="scroll",h=()=>{s.scrollTimeout&&clearTimeout(s.scrollTimeout),s.scrollTimeout=setTimeout(d,50)},g.addEventListener(p,h),s.handlers.push({element:g,event:p,handler:h})}),{result:"toc initialized",destroy:()=>{s.headings.forEach(e=>{e.removeAttribute("id")}),s.headings.length=0,s.observers.forEach(e=>e.disconnect()),s.observers.length=0,s.handlers.forEach(({element:e,event:r,handler:t})=>{e.removeEventListener(r,t)}),s.handlers.length=0,s.scrollTimeout&&(clearTimeout(s.scrollTimeout),s.scrollTimeout=null)}}}async function i(){const i=e.structure.toc,c={destroyFunctions:[]},a=o(i,"list");if(document.querySelector(a))try{const e=await l(i);e?.destroy&&c.destroyFunctions.push(e.destroy)}catch(u){console.error("[toc] Error initializing heading-links:",u)}const d=o(i["progress-bar"],"wrapper");if(document.querySelector(d))try{const e=await async function(e){const{progressConfig:o,tocConfig:l}=e;if(s())return{result:"progress-bar skipped - prefers-reduced-motion enabled"};const i=n("progress-bar");if(!i)return{result:"progress-bar skipped - GSAP not loaded"};const{gsap:c,ScrollTrigger:a}=i;if(!a)return console.warn("[progress-bar] GSAP ScrollTrigger plugin not loaded"),{result:"progress-bar skipped - ScrollTrigger not loaded"};c.registerPlugin(a);const d={scrollTriggers:[]},u=t(l,"content");if(!u)return{result:"progress-bar skipped - no content element found"};const g=r(o,"wrapper");return 0===g.length?{result:"progress-bar skipped - no wrapper elements found"}:(g.forEach(e=>{c.set(e,{display:"block"}),Array.from(e.querySelectorAll("*")).filter(e=>{const r=o.attributes.elements.element.primary,[t,s]=r.split("="),n=s?.replace(/['"]/g,"");return e.getAttribute(t)===n}).forEach(e=>{c.set(e,{width:"0%"}),c.to(e,{width:"100%",ease:"none",scrollTrigger:{trigger:u,start:"top bottom",end:"bottom 75%",scrub:!0,invalidateOnRefresh:!0,onUpdate:e=>{d.scrollTriggers.includes(e)||d.scrollTriggers.push(e)}}})})}),{result:`progress-bar initialized (${g.length} instances)`,destroy:()=>{d.scrollTriggers.forEach(e=>{e&&"object"==typeof e&&"kill"in e&&"function"==typeof e.kill&&e.kill()}),d.scrollTriggers.length=0}})}({progressConfig:i["progress-bar"],tocConfig:i});e?.destroy&&c.destroyFunctions.push(e.destroy)}catch(u){console.error("[toc] Error initializing progress-bar:",u)}return{result:`toc initialized (${c.destroyFunctions.length} modules active)`,destroy:()=>{c.destroyFunctions.forEach(e=>{try{e()}catch(u){console.error("[toc] Error during cleanup:",u)}}),c.destroyFunctions.length=0}}}export{i as init};
2
- //# sourceMappingURL=hs-toc-fxIQS7tz.js.map
Binary file
@@ -1 +0,0 @@
1
- {"version":3,"file":"hs-toc-fxIQS7tz.js","sources":["../../src/modules/structure/functions/toc/functions/heading-links.ts","../../src/modules/structure/functions/toc/toc.ts","../../src/modules/structure/functions/toc/functions/progress-bar.ts"],"sourcesContent":["/**\n * TOC Heading Links\n *\n * Automatically generates table of contents from H2 headings in rich text.\n * Creates links with smooth scrolling and active state tracking.\n *\n * Features:\n * - Automatically adds IDs to H2 headings based on text content\n * - Generates numbered TOC entries from template item\n * - Active state tracking with IntersectionObserver (25% from top trigger)\n * - Smooth scroll handled by smooth-scroll module\n * - Full cleanup on destroy (removes IDs, observers, handlers)\n */\n\nimport globalConfig from '@config';\nimport { querySelectorAll } from '@utils';\n\nexport function init(config) {\n const activeClass = globalConfig._global.classes.active;\n const cleanup = {\n observers: [],\n handlers: [],\n scrollTimeout: null,\n headings: [],\n };\n\n const addObserver = (observer: IntersectionObserver) => cleanup.observers.push(observer);\n const addHandler = (element: Element | Window, event: string, handler: EventListener) => {\n element.addEventListener(event, handler);\n cleanup.handlers.push({ element, event, handler });\n };\n\n const contentAreas = querySelectorAll(config, 'content');\n const tocLists = querySelectorAll(config, 'list');\n\n contentAreas.forEach((contentArea) => {\n // Since there's only 1 content area and 1 TOC list per page, use the first TOC list\n const tocList = tocLists[0];\n\n if (!tocList || tocList.children.length === 0) {\n return;\n }\n\n const template = tocList.children[0].cloneNode(true) as HTMLElement;\n const templateLink = template.querySelector('a');\n if (templateLink) {\n templateLink.classList.remove(activeClass);\n }\n\n // Clear all original TOC items\n tocList.innerHTML = '';\n\n const h2Headings = contentArea.querySelectorAll('h2');\n\n // Add IDs directly to H2 headings\n h2Headings.forEach((heading) => {\n const sectionId = heading.textContent\n .toLowerCase()\n .replace(/[^a-z0-9]+/g, '-')\n .replace(/(^-|-$)/g, '');\n\n heading.id = sectionId;\n cleanup.headings.push(heading);\n });\n\n // Create TOC entries\n h2Headings.forEach((heading, index) => {\n const tocItem = template.cloneNode(true) as HTMLElement;\n const link = tocItem.querySelector('a');\n const sectionId = heading.id;\n link.href = `#${sectionId}`;\n\n // Bold numbered text\n const number = document.createElement('strong');\n number.textContent = `${index + 1}. `;\n\n // Clear the link and add the number + text\n link.innerHTML = '';\n link.appendChild(number);\n link.appendChild(document.createTextNode(heading.textContent));\n\n tocList.appendChild(tocItem);\n });\n\n // Set up IntersectionObserver for active state\n const tocLinks = tocList.querySelectorAll('a');\n let currentActive = null;\n\n const updateActiveLink = () => {\n const windowHeight = window.innerHeight;\n const trigger = windowHeight * 0.25; // 25% from top (natural reading position)\n\n let newActive = null;\n\n // Find the last heading whose top is above the trigger point\n for (let i = h2Headings.length - 1; i >= 0; i--) {\n const rect = h2Headings[i].getBoundingClientRect();\n if (rect.top <= trigger) {\n newActive = h2Headings[i].id;\n break;\n }\n }\n\n // Only update if active section changed\n if (newActive !== currentActive) {\n currentActive = newActive;\n\n // Remove all active classes\n tocLinks.forEach((link) => link.classList.remove(activeClass));\n\n // Add to current\n if (currentActive) {\n const activeLink = Array.from(tocLinks).find(\n (link) => link.getAttribute('href') === `#${currentActive}`\n );\n if (activeLink) {\n activeLink.classList.add(activeClass);\n }\n }\n }\n };\n\n const observerOptions = {\n rootMargin: '-25% 0px -75% 0px',\n threshold: 0,\n };\n\n const observer = new IntersectionObserver(() => {\n updateActiveLink();\n }, observerOptions);\n\n // Observe all headings\n h2Headings.forEach((heading) => observer.observe(heading));\n addObserver(observer);\n\n // Also update on scroll for smoother tracking\n const scrollHandler = () => {\n if (cleanup.scrollTimeout) clearTimeout(cleanup.scrollTimeout);\n cleanup.scrollTimeout = setTimeout(updateActiveLink, 50);\n };\n addHandler(window, 'scroll', scrollHandler);\n });\n\n return {\n result: 'toc initialized',\n destroy: () => {\n // Remove IDs from headings\n cleanup.headings.forEach((heading) => {\n heading.removeAttribute('id');\n });\n cleanup.headings.length = 0;\n\n // Disconnect all observers\n cleanup.observers.forEach((obs) => obs.disconnect());\n cleanup.observers.length = 0;\n\n // Remove all event listeners\n cleanup.handlers.forEach(({ element, event, handler }) => {\n element.removeEventListener(event, handler);\n });\n cleanup.handlers.length = 0;\n\n // Clear scroll timeout\n if (cleanup.scrollTimeout) {\n clearTimeout(cleanup.scrollTimeout);\n cleanup.scrollTimeout = null;\n }\n },\n };\n}\n","/**\n * Table of Contents Orchestrator\n *\n * Loads TOC sub-modules based on element presence.\n * Static imports ensure all modules bundle into single file.\n *\n * Features:\n * - Conditional initialization based on element presence\n * - Centralized cleanup management\n * - Single bundled output file\n *\n * Modules:\n * - heading-links: Main TOC functionality (adds IDs, generates links)\n * - progress-bar: Optional reading progress indicator\n */\n\nimport config from '@config';\nimport { getSelector, type ModuleConfig } from '@utils';\nimport { init as headingLinksInit } from './functions/heading-links.ts';\nimport { init as progressBarInit } from './functions/progress-bar.ts';\n\nexport async function init() {\n const moduleConfig = config.structure.toc;\n const cleanup = {\n destroyFunctions: [] as Array<() => void>,\n };\n\n // Initialize heading-links if TOC list exists\n const headingLinksSelector = getSelector(moduleConfig as ModuleConfig, 'list');\n if (document.querySelector(headingLinksSelector)) {\n try {\n const result = await headingLinksInit(moduleConfig);\n if (result?.destroy) {\n cleanup.destroyFunctions.push(result.destroy);\n }\n } catch (error) {\n console.error('[toc] Error initializing heading-links:', error);\n }\n }\n\n // Initialize progress-bar if wrapper exists\n const progressBarSelector = getSelector(moduleConfig['progress-bar'] as ModuleConfig, 'wrapper');\n if (document.querySelector(progressBarSelector)) {\n try {\n const result = await progressBarInit({\n progressConfig: moduleConfig['progress-bar'],\n tocConfig: moduleConfig,\n } as any);\n if (result?.destroy) {\n cleanup.destroyFunctions.push(result.destroy);\n }\n } catch (error) {\n console.error('[toc] Error initializing progress-bar:', error);\n }\n }\n\n return {\n result: `toc initialized (${cleanup.destroyFunctions.length} modules active)`,\n destroy: () => {\n cleanup.destroyFunctions.forEach((destroyFn) => {\n try {\n destroyFn();\n } catch (error) {\n console.error('[toc] Error during cleanup:', error);\n }\n });\n cleanup.destroyFunctions.length = 0;\n },\n };\n}\n","/**\n * Progress Bar\n *\n * Scroll-based progress bar tracking reading progress through content.\n * Uses GSAP ScrollTrigger to animate bar width from 0% to 100%.\n *\n * Structure:\n * <div data-hs-toc=\"content\">\n * <!-- Content to track -->\n * </div>\n * <div data-hs-toc-progress=\"wrapper\">\n * <div data-hs-toc-progress=\"element\"></div>\n * </div>\n */\n\nimport { querySelector, querySelectorAll, getGsap, prefersReducedMotion } from '@utils';\n\ninterface ProgressBarConfig {\n progressConfig: {\n attributes: {\n elements: {\n wrapper: { primary: string; aliases?: string[] };\n element: { primary: string; aliases?: string[] };\n };\n };\n };\n tocConfig: {\n attributes: {\n elements: {\n content: { primary: string; aliases?: string[] };\n };\n };\n };\n}\n\nexport async function init(configObj: ProgressBarConfig) {\n const { progressConfig: config, tocConfig } = configObj;\n\n // Skip if user prefers reduced motion\n if (prefersReducedMotion()) {\n return { result: 'progress-bar skipped - prefers-reduced-motion enabled' };\n }\n\n const gsapLib = getGsap('progress-bar');\n if (!gsapLib) {\n return { result: 'progress-bar skipped - GSAP not loaded' };\n }\n\n const { gsap, ScrollTrigger } = gsapLib;\n\n if (!ScrollTrigger) {\n console.warn('[progress-bar] GSAP ScrollTrigger plugin not loaded');\n return { result: 'progress-bar skipped - ScrollTrigger not loaded' };\n }\n\n gsap.registerPlugin(ScrollTrigger);\n\n const cleanup = {\n scrollTriggers: [] as unknown[],\n };\n\n // Find content area (using toc config since they share the same content)\n const content = querySelector(tocConfig, 'content');\n if (!content) {\n return { result: 'progress-bar skipped - no content element found' };\n }\n\n // Find all progress bar wrappers\n const wrappers = querySelectorAll(config, 'wrapper');\n if (wrappers.length === 0) {\n return { result: 'progress-bar skipped - no wrapper elements found' };\n }\n\n wrappers.forEach((wrapper) => {\n // Show wrapper\n gsap.set(wrapper, { display: 'block' });\n\n // Find progress bar elements inside this wrapper using config\n const progressBars = Array.from(wrapper.querySelectorAll('*')).filter((el) => {\n // Check primary selector\n const primaryAttr = config.attributes.elements.element.primary;\n const [attr, value] = primaryAttr.split('=');\n const cleanValue = value?.replace(/['\"]/g, '');\n return el.getAttribute(attr) === cleanValue;\n });\n\n progressBars.forEach((bar) => {\n // Set initial width to 0%\n gsap.set(bar, { width: '0%' });\n\n // Animate from 0% to 100% based on scroll\n gsap.to(bar, {\n width: '100%',\n ease: 'none',\n scrollTrigger: {\n trigger: content,\n start: 'top bottom', // Start when top of content touches bottom of viewport\n end: 'bottom 75%', // End when bottom of content reaches 75% down the viewport\n scrub: true,\n invalidateOnRefresh: true,\n onUpdate: (self) => {\n // Store the scrollTrigger instance for cleanup\n if (!cleanup.scrollTriggers.includes(self)) {\n cleanup.scrollTriggers.push(self);\n }\n },\n },\n });\n });\n });\n\n return {\n result: `progress-bar initialized (${wrappers.length} instances)`,\n destroy: () => {\n // Kill all scroll triggers\n cleanup.scrollTriggers.forEach((st) => {\n if (st && typeof st === 'object' && 'kill' in st && typeof st.kill === 'function') {\n st.kill();\n }\n });\n cleanup.scrollTriggers.length = 0;\n },\n };\n}\n"],"names":["init","config","activeClass","globalConfig","_global","classes","active","cleanup","observers","handlers","scrollTimeout","headings","contentAreas","querySelectorAll","tocLists","forEach","contentArea","tocList","children","length","template","cloneNode","templateLink","querySelector","classList","remove","innerHTML","h2Headings","heading","sectionId","textContent","toLowerCase","replace","id","push","index","tocItem","link","href","number","document","createElement","appendChild","createTextNode","tocLinks","currentActive","updateActiveLink","trigger","window","innerHeight","newActive","i","getBoundingClientRect","top","activeLink","Array","from","find","getAttribute","add","observer","IntersectionObserver","rootMargin","threshold","observe","addObserver","element","event","handler","clearTimeout","setTimeout","addEventListener","result","destroy","removeAttribute","obs","disconnect","removeEventListener","async","moduleConfig","structure","toc","destroyFunctions","headingLinksSelector","getSelector","headingLinksInit","error","console","progressBarSelector","configObj","progressConfig","tocConfig","prefersReducedMotion","gsapLib","getGsap","gsap","ScrollTrigger","warn","registerPlugin","scrollTriggers","content","wrappers","wrapper","set","display","filter","el","primaryAttr","attributes","elements","primary","attr","value","split","cleanValue","bar","width","to","ease","scrollTrigger","start","end","scrub","invalidateOnRefresh","onUpdate","self","includes","st","kill","progressBarInit","destroyFn"],"mappings":"6JAiBO,SAASA,EAAKC,GACnB,MAAMC,EAAcC,EAAaC,QAAQC,QAAQC,OAC3CC,EAAU,CACdC,UAAW,GACXC,SAAU,GACVC,cAAe,KACfC,SAAU,IASNC,EAAeC,EAAiBZ,EAAQ,WACxCa,EAAWD,EAAiBZ,EAAQ,QA8G1C,OA5GAW,EAAaG,QAASC,IAEpB,MAAMC,EAAUH,EAAS,GAEzB,IAAKG,GAAuC,IAA5BA,EAAQC,SA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X,EAAa,gBAC7BY,UAAWZ,IAETP,GAAQC,SACVlE,EAAQ2E,iBAAiBhD,KAAKsC,EAAOC,QAEzC,OAASa,GACPC,QAAQD,MAAM,yCAA0CA,EAC1D,CAGF,MAAO,CACLd,OAAQ,oBAAoBjE,EAAQ2E,iBAAiB/D,yBACrDsD,QAAS,KACPlE,EAAQ2E,iBAAiBnE,QAASmH,IAChC,IACEA,GACF,OAAS5C,GACPC,QAAQD,MAAM,8BAA+BA,EAC/C,IAEF/E,EAAQ2E,iBAAiB/D,OAAS,GAGxC"}
@@ -1,2 +0,0 @@
1
- import{g as t}from"./hs-utils-CKm6QhLw.js";import"./hs-modalManager-H_YegPAO.js";import"../main.js";const e=t.apiName,n='[data-hs-transition="wrapper"]',r="data-hs-transition-exit-trigger",i="data-hs-transition-enter-trigger",s="data-hs-transition-trigger",o="data-hs-transition-namespace",a="data-hs-transition-exit-time",l="data-hs-transition-first-delay",d="data-hs-transition-initialized",c="data-hs-exit-time",u="data-hs-delay";async function f(){const t=document.querySelector(n);if(!t)return{result:"transition skipped - no wrapper found",destroy:()=>{}};if(t.hasAttribute(d))return{result:"transition already initialized",destroy:()=>{}};t.setAttribute(d,"true");const f=window[e]?.settings?.isSPA||!1,m=new Map;let h=null;const w=(e,n=null,a=t)=>{const l=a.querySelectorAll(`[${s}="${e}"]`);if(l.length>0){if(n){const t=a.querySelector(`[${o}="${n}"]`);if(t){const n=t.querySelector(`[${s}="${e}"]`);if(n)return n}}const t=Array.from(l).find(t=>{let e=t.parentElement;for(;e&&e!==a;){if(e.hasAttribute(o))return!1;e=e.parentElement}return!0});if(t)return t}const d="exit"===e?r:i,c=a.querySelectorAll(`[${d}]`);if(c.length>0){if(n){const t=a.querySelector(`[${o}="${n}"]`);if(t){const e=t.querySelector(`[${d}]`);if(e)return e}}const t=Array.from(c).find(t=>{let e=t.parentElement;for(;e&&e!==a;){if(e.hasAttribute(o))return!1;e=e.parentElement}return!0});if(t)return t}return null},p=(e=null)=>new Promise(n=>{const r=w("exit",e);if(!r)return void n();const i=(()=>{const e=t.getAttribute(a);if(e)return 1e3*parseFloat(e);const n=t.getAttribute(c);return n?1e3*parseFloat(n):0})();r.click(),setTimeout(()=>n(),i)}),g=(e=null)=>new Promise(n=>{const r=w("enter",e);if(!r)return void n();const i=!sessionStorage.getItem("transition-loaded"),s=(()=>{const e=t.getAttribute(l);if(e)return 1e3*parseFloat(e);const n=t.getAttribute(u);return n?1e3*parseFloat(n):0})(),o=()=>{r.click(),i&&sessionStorage.setItem("transition-loaded","true"),n()};i&&s>0?h=setTimeout(o,s):o()}),y=t=>{p(t?.detail?.namespace||null)},A=t=>{g(t?.detail?.namespace||null)};if(m.set("hsmain:transition-exit",y),m.set("hsmain:transition-enter",A),window.addEventListener("hsmain:transition-exit",y),window.addEventListener("hsmain:transition-enter",A),!f){const t=t=>{const e=t.target.closest("a[href]");if(e&&e.hostname===window.location.hostname&&e.getAttribute("href")&&-1===e.getAttribute("href").indexOf("#")&&"_blank"!==e.getAttribute("target")){t.preventDefault();const n=e.href;p().then(()=>{window.location.href=n})}};m.set("click",t),document.addEventListener("click",t);const e=t=>{t.persisted&&window.location.reload()};m.set("pageshow",e),window.addEventListener("pageshow",e)}const v=()=>{t&&(t.style.display="none")};if(m.set("resize",v),window.addEventListener("resize",v),!f){const t=()=>{g()};m.set(`${e}:dom-ready`,t),window.addEventListener(`${e}:dom-ready`,t,{once:!0})}return{result:"transition initialized",destroy:()=>{h&&clearTimeout(h),m.forEach((t,e)=>{if("click"===e||"pageshow"===e||"resize"===e){("click"===e?document:window).removeEventListener(e,t)}else window.removeEventListener(e,t)}),m.clear(),t.removeAttribute(d)}}}export{f as init};
2
- //# sourceMappingURL=hs-transition-CDNuGJNq.js.map
@@ -1,2 +0,0 @@
1
- import{g as t}from"./hs-utils-CKm6QhLw.js";import"./hs-modalManager-H_YegPAO.js";import"../main.js";const e=t.apiName,n='[data-hs-transition="wrapper"]',r="data-hs-transition-exit-trigger",i="data-hs-transition-enter-trigger",s="data-hs-transition-trigger",o="data-hs-transition-namespace",a="data-hs-transition-exit-time",l="data-hs-transition-first-delay",d="data-hs-transition-initialized",c="data-hs-exit-time",u="data-hs-delay";async function f(){const t=document.querySelector(n);if(!t)return{result:"transition skipped - no wrapper found",destroy:()=>{}};if(t.hasAttribute(d))return{result:"transition already initialized",destroy:()=>{}};t.setAttribute(d,"true");const f=window[e]?.settings?.isSPA||!1,m=new Map;let h=null;const w=(e,n=null,a=t)=>{const l=a.querySelectorAll(`[${s}="${e}"]`);if(l.length>0){if(n){const t=a.querySelector(`[${o}="${n}"]`);if(t){const n=t.querySelector(`[${s}="${e}"]`);if(n)return n}}const t=Array.from(l).find(t=>{let e=t.parentElement;for(;e&&e!==a;){if(e.hasAttribute(o))return!1;e=e.parentElement}return!0});if(t)return t}const d="exit"===e?r:i,c=a.querySelectorAll(`[${d}]`);if(c.length>0){if(n){const t=a.querySelector(`[${o}="${n}"]`);if(t){const e=t.querySelector(`[${d}]`);if(e)return e}}const t=Array.from(c).find(t=>{let e=t.parentElement;for(;e&&e!==a;){if(e.hasAttribute(o))return!1;e=e.parentElement}return!0});if(t)return t}return null},p=(e=null)=>new Promise(n=>{const r=w("exit",e);if(!r)return void n();const i=(()=>{const e=t.getAttribute(a);if(e)return 1e3*parseFloat(e);const n=t.getAttribute(c);return n?1e3*parseFloat(n):0})();r.click(),setTimeout(()=>n(),i)}),g=(e=null)=>new Promise(n=>{const r=w("enter",e);if(!r)return void n();const i=!sessionStorage.getItem("transition-loaded"),s=(()=>{const e=t.getAttribute(l);if(e)return 1e3*parseFloat(e);const n=t.getAttribute(u);return n?1e3*parseFloat(n):0})(),o=()=>{r.click(),i&&sessionStorage.setItem("transition-loaded","true"),n()};i&&s>0?h=setTimeout(o,s):o()}),y=t=>{p(t?.detail?.namespace||null)},A=t=>{g(t?.detail?.namespace||null)};if(m.set("hsmain:transition-exit",y),m.set("hsmain:transition-enter",A),window.addEventListener("hsmain:transition-exit",y),window.addEventListener("hsmain:transition-enter",A),!f){const t=t=>{const e=t.target.closest("a[href]");if(e&&e.hostname===window.location.hostname&&e.getAttribute("href")&&-1===e.getAttribute("href").indexOf("#")&&"_blank"!==e.getAttribute("target")){t.preventDefault();const n=e.href;p().then(()=>{window.location.href=n})}};m.set("click",t),document.addEventListener("click",t);const e=t=>{t.persisted&&window.location.reload()};m.set("pageshow",e),window.addEventListener("pageshow",e)}const v=()=>{t&&(t.style.display="none")};if(m.set("resize",v),window.addEventListener("resize",v),!f){const t=()=>{g()};m.set(`${e}:dom-ready`,t),window.addEventListener(`${e}:dom-ready`,t,{once:!0})}return{result:"transition initialized",destroy:()=>{h&&clearTimeout(h),m.forEach((t,e)=>{if("click"===e||"pageshow"===e||"resize"===e){("click"===e?document:window).removeEventListener(e,t)}else window.removeEventListener(e,t)}),m.clear(),t.removeAttribute(d)}}}export{f as init};
2
- //# sourceMappingURL=hs-transition-CDNuGJNq.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"hs-transition-CDNuGJNq.js","sources":["../../src/animations/functions/transition.ts"],"sourcesContent":["/**\n * Page Transition\n *\n * Provides animated page transitions by intercepting link clicks and triggering\n * Webflow IX animations. Supports namespace-based transitions for different page\n * types (home, contact, etc.) and both MPA and SPA architectures.\n *\n * Features:\n * - Auto link interception for seamless page transitions (MPA mode)\n * - Namespace system for page-specific transitions (Barba.js compatible)\n * - Separate exit/enter triggers for precise animation control\n * - Configurable timing with exit-time and first-delay\n * - Session-aware first load handling\n * - SPA event-based integration support\n *\n * Usage:\n * <div data-hs-transition=\"wrapper\" data-hs-transition-exit-time=\"0.5\" data-hs-transition-first-delay=\"0.3\">\n * <!-- Default triggers (fallback) -->\n * <div data-hs-transition-exit-trigger>Exit animation</div>\n * <div data-hs-transition-enter-trigger>Enter animation</div>\n * <!-- OR -->\n * <div data-hs-transition-trigger=\"exit\">Exit animation</div>\n * <div data-hs-transition-trigger=\"enter\">Enter animation</div>\n *\n * <!-- Namespace-specific (for Barba.js) -->\n * <div data-hs-transition-namespace=\"home\">\n * <div data-hs-transition-trigger=\"exit\">Home exit</div>\n * <div data-hs-transition-trigger=\"enter\">Home enter</div>\n * </div>\n * </div>\n */\n\nimport { globalConfig } from '@utils';\n\nconst API_NAME = globalConfig.apiName;\n\n// Selectors and Attributes\nconst SELECTORS = {\n wrapper: '[data-hs-transition=\"wrapper\"]',\n};\n\nconst ATTRIBUTES = {\n exitTrigger: 'data-hs-transition-exit-trigger',\n enterTrigger: 'data-hs-transition-enter-trigger',\n trigger: 'data-hs-transition-trigger',\n namespace: 'data-hs-transition-namespace',\n exitTime: 'data-hs-transition-exit-time',\n firstDelay: 'data-hs-transition-first-delay',\n initialized: 'data-hs-transition-initialized',\n // Legacy fallbacks\n legacyExitTime: 'data-hs-exit-time',\n legacyFirstDelay: 'data-hs-delay',\n};\n\nexport async function init() {\n // Check if transition wrapper exists - skip if not found\n const transitionWrapper = document.querySelector(SELECTORS.wrapper);\n if (!transitionWrapper) {\n return {\n result: 'transition skipped - no wrapper found',\n destroy: () => {},\n };\n }\n\n // Prevent double initialization (important for SPA when wrapper is outside Barba container)\n if (transitionWrapper.hasAttribute(ATTRIBUTES.initialized)) {\n return {\n result: 'transition already initialized',\n destroy: () => {},\n };\n }\n\n // Mark as initialized\n transitionWrapper.setAttribute(ATTRIBUTES.initialized, 'true');\n\n // Check if running in SPA mode\n const isSPA = window[API_NAME]?.settings?.isSPA || false;\n\n // Store event handlers and timeouts for cleanup\n const eventHandlers = new Map();\n let delayTimeout: number | null = null;\n let navTimeout: number | null = null;\n\n const cleanup = () => {\n // Clear any pending timeouts\n if (delayTimeout) clearTimeout(delayTimeout);\n if (navTimeout) clearTimeout(navTimeout);\n\n // Remove all event listeners\n eventHandlers.forEach((handler, event) => {\n if (event === 'click' || event === 'pageshow' || event === 'resize') {\n const target = event === 'click' ? document : window;\n target.removeEventListener(event, handler);\n } else {\n window.removeEventListener(event, handler);\n }\n });\n eventHandlers.clear();\n\n // Remove initialization flag to allow re-initialization\n transitionWrapper.removeAttribute(ATTRIBUTES.initialized);\n };\n\n /**\n * Find trigger element for specific type (exit or enter) and optional namespace\n * Supports trigger patterns with priority:\n * 1. Namespace-specific triggers (if namespace provided)\n * 2. Default triggers (no namespace)\n */\n const findTrigger = (\n type: 'exit' | 'enter',\n namespace: string | null = null,\n root: Element = transitionWrapper\n ): Element | null => {\n // Try new syntax: data-hs-transition-trigger=\"exit\" or \"enter\"\n const newSyntaxTriggers = root.querySelectorAll(`[${ATTRIBUTES.trigger}=\"${type}\"]`);\n\n if (newSyntaxTriggers.length > 0) {\n // If namespace specified, look inside namespace wrapper\n if (namespace) {\n const namespaceWrapper = root.querySelector(`[${ATTRIBUTES.namespace}=\"${namespace}\"]`);\n if (namespaceWrapper) {\n const namespaceTrigger = namespaceWrapper.querySelector(\n `[${ATTRIBUTES.trigger}=\"${type}\"]`\n );\n if (namespaceTrigger) return namespaceTrigger;\n }\n }\n\n // Fallback to default (not inside ANY namespace wrapper)\n const defaultTrigger = Array.from(newSyntaxTriggers).find((trigger) => {\n // Check if trigger is inside any namespace wrapper\n let parent = trigger.parentElement;\n while (parent && parent !== root) {\n if (parent.hasAttribute(ATTRIBUTES.namespace)) {\n return false; // Inside a namespace, skip it\n }\n parent = parent.parentElement;\n }\n return true; // Not inside any namespace\n });\n\n if (defaultTrigger) return defaultTrigger;\n }\n\n // Try separate exit/enter trigger syntax\n const triggerAttr = type === 'exit' ? ATTRIBUTES.exitTrigger : ATTRIBUTES.enterTrigger;\n const separateTriggers = root.querySelectorAll(`[${triggerAttr}]`);\n\n if (separateTriggers.length > 0) {\n // If namespace specified, look inside namespace wrapper\n if (namespace) {\n const namespaceWrapper = root.querySelector(`[${ATTRIBUTES.namespace}=\"${namespace}\"]`);\n if (namespaceWrapper) {\n const namespaceTrigger = namespaceWrapper.querySelector(`[${triggerAttr}]`);\n if (namespaceTrigger) return namespaceTrigger;\n }\n }\n\n // Fallback to default (not inside ANY namespace wrapper)\n const defaultTrigger = Array.from(separateTriggers).find((trigger) => {\n // Check if trigger is inside any namespace wrapper\n let parent = trigger.parentElement;\n while (parent && parent !== root) {\n if (parent.hasAttribute(ATTRIBUTES.namespace)) {\n return false; // Inside a namespace, skip it\n }\n parent = parent.parentElement;\n }\n return true; // Not inside any namespace\n });\n\n if (defaultTrigger) return defaultTrigger;\n }\n\n return null;\n };\n\n /**\n * Get exit time from wrapper element\n */\n const getExitTime = (): number => {\n const value = transitionWrapper.getAttribute(ATTRIBUTES.exitTime);\n if (value) return parseFloat(value) * 1000;\n\n // Legacy fallback\n const legacyValue = transitionWrapper.getAttribute(ATTRIBUTES.legacyExitTime);\n if (legacyValue) return parseFloat(legacyValue) * 1000;\n\n return 0;\n };\n\n /**\n * Get first delay from wrapper element (only applies on first load)\n */\n const getFirstDelay = (): number => {\n const value = transitionWrapper.getAttribute(ATTRIBUTES.firstDelay);\n if (value) return parseFloat(value) * 1000;\n\n // Legacy fallback\n const legacyValue = transitionWrapper.getAttribute(ATTRIBUTES.legacyFirstDelay);\n if (legacyValue) return parseFloat(legacyValue) * 1000;\n\n return 0;\n };\n\n /**\n * Play exit animation (when leaving page)\n */\n const playExitAnimation = (namespace: string | null = null): Promise<void> => {\n return new Promise((resolve) => {\n const exitTrigger = findTrigger('exit', namespace);\n if (!exitTrigger) {\n resolve();\n return;\n }\n\n const exitTime = getExitTime();\n\n // Trigger the animation\n (exitTrigger as HTMLElement).click();\n\n // Resolve after animation completes\n setTimeout(() => resolve(), exitTime);\n });\n };\n\n /**\n * Play enter animation (when arriving on page)\n */\n const playEnterAnimation = (namespace: string | null = null): Promise<void> => {\n return new Promise((resolve) => {\n const enterTrigger = findTrigger('enter', namespace);\n if (!enterTrigger) {\n resolve();\n return;\n }\n\n // Check if first load\n const isFirstLoad = !sessionStorage.getItem('transition-loaded');\n const firstDelay = getFirstDelay();\n\n const triggerAnimation = () => {\n (enterTrigger as HTMLElement).click();\n\n // Mark as loaded for session\n if (isFirstLoad) {\n sessionStorage.setItem('transition-loaded', 'true');\n }\n\n resolve();\n };\n\n // Only apply delay on first load\n if (isFirstLoad && firstDelay > 0) {\n delayTimeout = setTimeout(triggerAnimation, firstDelay) as unknown as number;\n } else {\n triggerAnimation();\n }\n });\n };\n\n // Always listen for custom events (works for both MPA and SPA)\n // SPA frameworks (like Barba) can dispatch these with namespace data\n const handleExitEvent = (event?: CustomEvent) => {\n const namespace = (event as any)?.detail?.namespace || null;\n playExitAnimation(namespace);\n };\n\n const handleEnterEvent = (event?: CustomEvent) => {\n const namespace = (event as any)?.detail?.namespace || null;\n playEnterAnimation(namespace);\n };\n\n eventHandlers.set('hsmain:transition-exit', handleExitEvent);\n eventHandlers.set('hsmain:transition-enter', handleEnterEvent);\n window.addEventListener('hsmain:transition-exit', handleExitEvent as EventListener);\n window.addEventListener('hsmain:transition-enter', handleEnterEvent as EventListener);\n\n // MPA Mode: Intercept link clicks\n if (!isSPA) {\n const linkClickHandler = (e: MouseEvent) => {\n const link = (e.target as Element).closest('a[href]') as HTMLAnchorElement;\n\n if (\n link &&\n link.hostname === window.location.hostname &&\n link.getAttribute('href') &&\n link.getAttribute('href')!.indexOf('#') === -1 &&\n link.getAttribute('target') !== '_blank'\n ) {\n e.preventDefault();\n const href = link.href;\n\n // Play exit animation, then navigate\n playExitAnimation().then(() => {\n window.location.href = href;\n });\n }\n };\n\n eventHandlers.set('click', linkClickHandler);\n document.addEventListener('click', linkClickHandler);\n\n // Handle back button navigation\n const pageShowHandler = (event: PageTransitionEvent) => {\n if (event.persisted) {\n window.location.reload();\n }\n };\n\n eventHandlers.set('pageshow', pageShowHandler);\n window.addEventListener('pageshow', pageShowHandler);\n }\n\n // Hide transition on window resize (prevents visual glitches)\n const resizeHandler = () => {\n if (transitionWrapper) {\n (transitionWrapper as HTMLElement).style.display = 'none';\n }\n };\n\n eventHandlers.set('resize', resizeHandler);\n window.addEventListener('resize', resizeHandler);\n\n // On DOM ready, play enter animation (only in MPA mode)\n // In SPA mode, Barba handles all transitions via events\n if (!isSPA) {\n const domReadyHandler = () => {\n playEnterAnimation();\n };\n\n eventHandlers.set(`${API_NAME}:dom-ready`, domReadyHandler);\n window.addEventListener(`${API_NAME}:dom-ready`, domReadyHandler, { once: true });\n }\n\n return {\n result: 'transition initialized',\n destroy: cleanup,\n };\n}\n"],"names":["API_NAME","globalConfig","apiName","SELECTORS","ATTRIBUTES","async","init","transitionWrapper","document","querySelector","result","destroy","hasAttribute","setAttribute","isSPA","window","settings","eventHandlers","Map","delayTimeout","findTrigger","type","namespace","root","newSyntaxTriggers","querySelectorAll","length","namespaceWrapper","namespaceTrigger","defaultTrigger","Array","from","find","trigger","parent","parentElement","triggerAttr","separateTriggers","playExitAnimation","Promise","resolve","exitTrigger","exitTime","value","getAttribute","parseFloat","legacyValue","getExitTime","click","setTimeout","playEnterAnimation","enterTrigger","isFirstLoad","sessionStorage","getItem","firstDelay","getFirstDelay","triggerAnimation","setItem","handleExitEvent","event","detail","handleEnterEvent","set","addEventListener","linkClickHandler","e","link","target","closest","hostname","location","indexOf","preventDefault","href","then","pageShowHandler","persisted","reload","resizeHandler","style","display","domReadyHandler","once","forEach","handler","removeEventListener","clear","removeAttribute"],"mappings":"oGAkCA,MAAMA,EAAWC,EAAaC,QAGxBC,EACK,iCAGLC,EACS,kCADTA,EAEU,mCAFVA,EAGK,6BAHLA,EAIO,+BAJPA,EAKM,+BALNA,EAMQ,iCANRA,EAOS,iCAPTA,EASY,oBATZA,EAUc,gBAGpBC,eAAsBC,IAEpB,MAAMC,EAAoBC,SAASC,cAAcN,GACjD,IAAKI,EACH,MAAO,CACLG,OAAQ,wCACRC,QAAS,QAKb,GAAIJ,EAAkBK,aAAaR,GACjC,MAAO,CACLM,OAAQ,iCACRC,QAAS,QAKbJ,EAAkBM,aAAaT,EAAwB,QAGvD,MAAMU,EAAQC,OAAOf,IAAWgB,UAAUF,QAAS,EAG7CG,MAAoBC,IAC1B,IAAIC,EAA8B,KAGlC,MA0BMC,EAAc,CAClBC,EACAC,EAA2B,KAC3BC,EAAgB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B,GAGFzD,EAAc8C,IAAI,QAASE,GAC3BzD,SAASwD,iBAAiB,QAASC,GAGnC,MAAMW,EAAmBhB,IACnBA,EAAMiB,WACR9D,OAAOwD,SAASO,UAIpB7D,EAAc8C,IAAI,WAAYa,GAC9B7D,OAAOiD,iBAAiB,WAAYY,EACtC,CAGA,MAAMG,EAAgB,KAChBxE,IACDA,EAAkCyE,MAAMC,QAAU,SASvD,GALAhE,EAAc8C,IAAI,SAAUgB,GAC5BhE,OAAOiD,iBAAiB,SAAUe,IAI7BjE,EAAO,CACV,MAAMoE,EAAkB,KACtBhC,KAGFjC,EAAc8C,IAAI,GAAG/D,cAAsBkF,GAC3CnE,OAAOiD,iBAAiB,GAAGhE,cAAsBkF,EAAiB,CAAEC,MAAM,GAC5E,CAEA,MAAO,CACLzE,OAAQ,yBACRC,QA/Pc,KAEVQ,gBAA2BA,GAI/BF,EAAcmE,QAAQ,CAACC,EAASzB,KAC9B,GAAc,UAAVA,GAA+B,aAAVA,GAAkC,WAAVA,EAAoB,EAC1C,UAAVA,EAAoBpD,SAAWO,QACvCuE,oBAAoB1B,EAAOyB,EACpC,MACEtE,OAAOuE,oBAAoB1B,EAAOyB,KAGtCpE,EAAcsE,QAGdhF,EAAkBiF,gBAAgBpF,IAgPtC"}
@@ -1,2 +0,0 @@
1
- import"./hs-modalManager-H_YegPAO.js";import{c as a}from"../main.js";const o=a._global;export{o as g};
2
- //# sourceMappingURL=hs-utils-CKm6QhLw.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"hs-utils-CKm6QhLw.js","sources":["../../src/utils.ts"],"sourcesContent":["/**\n * Utils Barrel Export\n *\n * Centralized export for all utility functions.\n * Enables cleaner imports across modules.\n */\n\n// Attribute selector utilities\nexport {\n getSelector,\n querySelectorAll,\n querySelector,\n checkDeprecated,\n} from './utils/attributeSelector.ts';\n\n// Height animation utilities\nexport { animateHeight, setHeight } from './utils/heightAnimator.ts';\n\n// Modal manager utilities\nexport {\n openModal,\n closeModal,\n onModalOpen,\n onModalClose,\n getActiveModalCount,\n isModalOpen,\n} from './utils/modalManager.ts';\n\n// Import config to extract globalConfig\nimport config from '@config';\n\n// Export globalConfig from master config\nexport const globalConfig = config._global;\n\n// CSS variables utility (default export becomes named export)\nexport { default as cssVariables } from './utils/cssVariables.ts';\n\n// GSAP utilities\nexport {\n getGsap,\n hasGsap,\n hasScrollTrigger,\n hasDraggable,\n resetGsapWarning,\n prefersReducedMotion,\n initScrollVelocityTracking,\n initScrollTriggerRefresh,\n getScrollVelocity,\n getScrollDirection,\n warnMissingDependencies,\n type GsapTimeline,\n type GsapTween,\n} from './utils/gsap.ts';\n\n// Orchestrator utility\nexport {\n createOrchestrator,\n type ModuleRegistryEntry,\n type ModuleInstance,\n type ScanResult,\n type OrchestratorReturn,\n} from './utils/orchestrator.ts';\n\n// Webflow platform utilities\nexport { isWebflow, waitForIx3, shouldSkipWebflow } from './utils/webflow.ts';\n\n// Config types\nexport { type ModuleConfig } from './config.ts';\n"],"names":["globalConfig","config","_global"],"mappings":"qEAgCO,MAAMA,EAAeC,EAAOC"}
package/dist/main.js. DELETED
@@ -1,3 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/hs-normalize-CTwtG5-a.js","assets/hs-attributeSelector-6pGcDBo-.js","assets/hs-modalManager-H_YegPAO.js","assets/hs-utils-CKm6QhLw.js","assets/hs-structure-DhNix64P.js","assets/hs-orchestrator-J8b7XRk1.js","assets/hs-default-CLmDRb9d.js","assets/hs-cssVariables-BjuwJfDJ.js","assets/hs-animations-BDMqlbof.js"])))=>i.map(i=>d[i]);
2
- const a={},e=function(e,t,s){let r=Promise.resolve();if(t&&t.length>0){let e=function(a){return Promise.all(a.map(a=>Promise.resolve(a).then(a=>({status:"fulfilled",value:a}),a=>({status:"rejected",reason:a}))))};document.getElementsByTagName("link");const s=document.querySelector("meta[property=csp-nonce]"),i=s?.nonce||s?.getAttribute("nonce");r=e(t.map(e=>{if((e=function(a){return"https://cdn.jsdelivr.net/npm/@hortonstudio/main@1.9.24/dist/"+a}(e))in a)return;a[e]=!0;const t=e.endsWith(".css"),s=t?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${e}"]${s}`))return;const r=document.createElement("link");return r.rel=t?"stylesheet":"modulepreload",t||(r.as="script"),r.crossOrigin="",r.href=e,i&&r.setAttribute("nonce",i),document.head.appendChild(r),t?new Promise((a,t)=>{r.addEventListener("load",a),r.addEventListener("error",()=>t(new Error(`Unable to preload CSS for ${e}`)))}):void 0}))}function i(a){const e=new Event("vite:preloadError",{cancelable:!0});if(e.payload=a,window.dispatchEvent(e),!e.defaultPrevented)throw a}return r.then(a=>{for(const e of a||[])"rejected"===e.status&&i(e.reason);return e().catch(i)})},t={_global:{version:"2.0.0",apiName:"hsmain",attributes:{height:"data-hs-height",heightValue:"element",heightDuration:"data-hs-height-duration",heightEase:"data-hs-height-ease",moduleType:"data-hs-module-type",module:"data-hs-module"},classes:{modalOpen:"hs-modal-open",overflowHidden:"u-overflow-hidden",initialized:"hs-main",displayContents:"u-display-contents",active:"is-active",gsap:"hs-gsap"},cssVars:{prefix:"--_hs---",state:{name:"state",values:{active:"1",inactive:"0"}},clip:{name:"clip"},scrollOffset:{name:"scroll-offset"}},clickable:{module:"global-clickable",attributes:{elements:{wrapper:{primary:"data-hs-clickable='wrapper'",aliases:[]},button:{primary:"data-hs-clickable='button'",aliases:[]}}}}},normalize:{sync:{module:"sync",description:"Syncs collection list data to static lists with matching structure",attributes:{elements:{source:{primary:"data-hs-sync='source'",aliases:[]},target:{primary:"data-hs-sync='target'",aliases:[]},item:{primary:"data-hs-sync='item'",aliases:[]},ignore:{primary:"data-hs-sync='ignore'",aliases:[]}},properties:{syncId:"data-hs-sync-id",syncField:"data-hs-sync-field",syncMode:"data-hs-sync-mode"}}},clickable:{module:"clickable",attributes:{elements:{wrapper:{primary:"data-hs-clickable='wrapper'",aliases:[]}}},normalize:{module:"normalize",description:"Normalizes clickable wrappers by keeping either button or link based on href validity",attributes:{elements:{wrapper:{primary:"data-hs-clickable='wrapper'",aliases:[]},button:{primary:"data-hs-clickable='button'",aliases:[]}}}}},dupe:{module:"dupe",description:"Duplicates elements or their children based on specified modes",attributes:{elements:{wrapper:{primary:"data-hs-dupe",aliases:[]}},properties:{count:"data-hs-dupe-count",hidden:"data-hs-dupe-hidden",noSelect:"data-hs-dupe-no-select"}},modes:{child:"Duplicates the first direct child element",self:"Duplicates the element itself as a sibling"},modifiers:{hidden:"Adds aria-hidden='true' to clones for accessibility",noSelect:"Adds user-select: none to clones to prevent text selection"},limits:{maxCount:20}}},structure:{"year-replacement":{module:"year-replacement",attributes:{placeholders:{year:"{{year}}",month:"{{month}}"}}},toc:{module:"toc",description:"Table of contents with heading links and optional progress bar",attributes:{elements:{content:{primary:"data-hs-toc='content'",aliases:[]},list:{primary:"data-hs-toc='list'",aliases:[]}}},"progress-bar":{module:"progress-bar",attributes:{elements:{wrapper:{primary:"data-hs-toc-progress='wrapper'",aliases:[]},element:{primary:"data-hs-toc-progress='element'",aliases:[]}}}}},pagination:{module:"pagination",attributes:{elements:{wrapper:{primary:"data-hs-pagination='wrapper'",aliases:[]},list:{primary:"data-hs-pagination='list'",aliases:[]},controls:{primary:"data-hs-pagination='controls'",aliases:[]},previous:{primary:"data-hs-pagination='previous'",aliases:[]},next:{primary:"data-hs-pagination='next'",aliases:[]},counter:{primary:"data-hs-pagination='counter'",aliases:[]},dots:{primary:"data-hs-pagination='dots'",aliases:[]}},properties:{show:"data-hs-pagination-show",showMobile:"data-hs-pagination-show-mobile"}}},comparison:{module:"comparison",attributes:{elements:{wrapper:{primary:"data-hs-comparison='wrapper'",aliases:[]},"template-list":{primary:"data-hs-comparison-template='list'",aliases:[]},"template-item":{primary:"data-hs-comparison-template='item'",aliases:[]},"template-name":{primary:"data-hs-comparison-template='name'",aliases:[]},"template-description":{primary:"data-hs-comparison-template='description'",aliases:[]},"template-before-image":{primary:"data-hs-comparison-template='before-image'",aliases:[]},"template-after-image":{primary:"data-hs-comparison-template='after-image'",aliases:[]},name:{primary:"data-hs-comparison='name'",aliases:[]},description:{primary:"data-hs-comparison='description'",aliases:[]},"image-wrapper":{primary:"data-hs-comparison='image-wrapper'",aliases:[]},"before-image":{primary:"data-hs-comparison-image='before'",aliases:[]},"after-image":{primary:"data-hs-comparison-image='after'",aliases:[]},slider:{primary:"data-hs-comparison='slider'",aliases:[]},pagination:{primary:"data-hs-comparison='pagination'",aliases:[]}},properties:{modeType:"data-hs-comparison-mode",navType:"data-hs-comparison-nav"}}},tabs:{module:"tabs",description:"Accessible tab system with autoplay, animations, and keyboard navigation",attributes:{elements:{wrapper:{primary:"data-hs-tab='wrapper'",aliases:[]},links:{primary:"data-hs-tab='links'",aliases:[]},list:{primary:"data-hs-tab='list'",aliases:[]}},properties:{autoplay:"data-hs-tab-autoplay",duration:"data-hs-tab-duration",hover:"data-hs-tab-hover",animation:"data-hs-tab-animation",animationDuration:"data-hs-tab-animation-duration",controls:"data-hs-tab-controls"}},cssVars:{progress:"progress"}},"site-settings":{module:"site-settings",attributes:{elements:{wrapper:{primary:"data-site-settings-element='wrapper'",aliases:[]},list:{primary:"data-site-settings-element='list'",aliases:[]},setting:{primary:"data-site-settings",aliases:[]},hide:{primary:"data-site-settings-hide",aliases:[]}}}},form:{honeypot:{module:"honeypot",attributes:{elements:{"form-handler":{primary:"data-hs-form='form-handler'",aliases:[]}}}},range:{module:"range",attributes:{elements:{wrapper:{primary:"data-hs-form-range='wrapper'",aliases:[]},output:{primary:"data-hs-form-range='output'",aliases:[]}}},cssVars:{progress:"progress"}},test:{module:"form-test",attributes:{elements:{wrapper:{primary:"data-hs-form-test='wrapper'",aliases:[]},info:{primary:"data-hs-form-test='info'",aliases:[]}}}},select:{module:"select",attributes:{elements:{wrapper:{primary:"data-hs-form-select='wrapper'",aliases:[]},list:{primary:"data-hs-form-select='list'",aliases:[]},button:{primary:"data-hs-form-select='button'",aliases:[]}}},states:{module:"select-states",attributes:{elements:{states:{primary:"data-hs-form-select='states'",aliases:[]}}}},"custom-select":{module:"select-custom",attributes:{elements:{wrapper:{primary:"data-hs-form-select='wrapper'",aliases:[]},list:{primary:"data-hs-form-select='list'",aliases:[]},button:{primary:"data-hs-form-select='button'",aliases:[]}}}}}}},default:{"smooth-scroll":{module:"smooth-scroll",attributes:{elements:{"offset-proxy":{primary:"data-hs-scroll-offset='proxy'",aliases:[]}},note:"Auto-detects anchor links (a[href^='#']). Optional: Use data-hs-scroll-offset='proxy' on an element to set scroll offset based on its offsetTop"}},accordion:{module:"accordion",attributes:{elements:{wrapper:{primary:"data-hs-accordion='wrapper'",aliases:[]},toggle:{primary:"data-hs-accordion='toggle'",aliases:[]},content:{primary:"data-hs-accordion='content'",aliases:[]},state:{primary:"data-hs-accordion-text='state'",aliases:[]}},properties:{default:"data-hs-accordion-default",open:"data-hs-accordion-open",closed:"data-hs-accordion-closed"}}},navbar:{module:"navbar",description:"Main navigation orchestrator with modular functions",attributes:{elements:{wrapper:{primary:"data-hs-nav='wrapper'",aliases:[]},"skip-link":{primary:"data-hs-nav='skip-link'",aliases:[]}}},dropdown:{module:"dropdown",description:"Navigation dropdown with hover or click behavior",attributes:{elements:{wrapper:{primary:"data-hs-nav-dropdown='wrapper'",aliases:[]},list:{primary:"data-hs-nav-dropdown='list'",aliases:[]}},properties:{type:"data-hs-nav-dropdown-type"}},types:{hover:"Desktop behavior: hover + full keyboard navigation (ArrowDown/Up, Space, Enter, Escape)",click:"Mobile/accordion behavior: click only + simple keyboard (Space, Enter, Escape)"}},menu:{module:"menu",description:"Mobile menu button and modal behavior",attributes:{elements:{wrapper:{primary:"data-hs-nav-menu='wrapper'",aliases:[]},button:{primary:"data-hs-nav-menu='button'",aliases:[]}}}},"arrow-navigation":{module:"arrow-navigation",description:"Keyboard arrow navigation for desktop navbar and mobile menu"}}},animations:{transition:{module:"transition",attributes:{elements:{wrapper:{primary:"data-hs-transition='wrapper'",aliases:["data-hs-transition='element'"]},exitTrigger:{primary:"data-hs-transition-exit-trigger",aliases:[]},enterTrigger:{primary:"data-hs-transition-enter-trigger",aliases:[]},trigger:{primary:"data-hs-transition-trigger",aliases:[]},namespace:{primary:"data-hs-transition-namespace",aliases:[]},exitTime:{primary:"data-hs-transition-exit-time",aliases:["data-hs-exit-time"]},firstDelay:{primary:"data-hs-transition-first-delay",aliases:["data-hs-delay"]}}}}}},s=t._global.apiName;(async()=>{if(window[s]&&!Array.isArray(window[s])&&window[s].loaded)return;document.documentElement.classList.add(t._global.classes.initialized);const a=Array.isArray(window[s])?window[s]:[],r={normalize:()=>e(()=>import("./assets/hs-normalize-CTwtG5-a.js"),__vite__mapDeps([0,1,2,3])),structure:()=>e(()=>import("./assets/hs-structure-DhNix64P.js"),__vite__mapDeps([4,1,2,5])),default:()=>e(()=>import("./assets/hs-default-CLmDRb9d.js"),__vite__mapDeps([6,1,2,3,7])),animations:()=>e(()=>import("./assets/hs-animations-BDMqlbof.js"),__vite__mapDeps([8,2,5]))};let i=[...document.querySelectorAll(`script[type="module"][src="${import.meta.url}"]`)];0===i.length&&(i=[...document.querySelectorAll('script[type="module"][src*="@hortonstudio/main"]')].filter(a=>{const e=a.src,t=import.meta.url,s=e.match(/@hortonstudio\/main(@[\d.]+)?/)?.[0],r=t.match(/@hortonstudio\/main(@[\d.]+)?/)?.[0];return s&&r&&s.split("@")[0]===r.split("@")[0]}));const o={isSPA:i.some(a=>"true"===a.getAttribute("data-hs-spa"))},n={normalize:{modules:["normalize"],parallel:!1},structure:{modules:["structure"],parallel:!1},default:{modules:["default","animations"],parallel:!0}},l=async a=>{const e=window[s];if(e.process.has(a))return e.modules[a]?.loading;e.process.add(a);const t=e.modules[a]||{};let i;e.modules[a]=t,t.loading=new Promise((a,e)=>{t.resolve=a,t.reject=e});try{const{init:s}=await r[a](),o=await s()||{};i=o.destroy;const n=o.result;return t.destroy=()=>{i?.(),e.process.delete(a)},t.restart=()=>{t.destroy?.(),e.load(a)},t.resolve?.(n),delete t.resolve,delete t.reject,n}catch(o){throw i?.(),t.reject?.(o),e.process.delete(a),o}},d=async a=>{const e=n[a];if(e.parallel){const a=e.modules.map(a=>l(a));await Promise.allSettled(a)}else for(const t of e.modules)await l(t)},p=async()=>{await Promise.allSettled([r.normalize(),r.structure(),r.default(),r.animations()]),await d("normalize"),await d("structure"),await d("default"),(()=>{const a=new CustomEvent("hsmain:dom-ready");window.dispatchEvent(a)})()},m=[];window[s]={scripts:i,settings:o,modules:{},process:new Set,load:l,loaded:!1,push(...a){for(const[e,t]of a)"function"==typeof t?this.modules[e]?.loading?.then(t):this.load(e)},destroy(){for(const a in this.modules)this.modules[a]?.destroy?.()},async reinitialize(){this.loaded=!1,this.destroy(),this.modules={},this.process=new Set,await this.scanForEmbedModules(),await p(),this.loaded=!0},async scanForEmbedModules(){document.querySelectorAll(".w-embed").forEach(a=>{a.querySelectorAll("script[data-hs-module]").forEach(a=>{const e=a.getAttribute("data-hs-module-type"),t=a.getAttribute("data-hs-module");if(e&&t){const a=`data-hs-${e}-${t}`;r[a]&&this.load(a)}})})},afterReady(a){"function"==typeof a&&(this.loaded?a():m.push(a))},status(a){return a?{loaded:!!this.modules[a],loading:this.process.has(a)}:{loaded:Object.keys(this.modules),loading:[...this.process],phases:n}}};(async()=>{window[s].push(...a),await p(),window[s].loaded=!0,m.forEach(a=>{try{a()}catch{}}),m.length=0})().catch(()=>{})})();export{e as _,t as c};
3
- //# sourceMappingURL=main.js.map