@hortonstudio/main 1.9.21 → 1.9.23

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/main.js CHANGED
@@ -1,3 +1,3 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/normalize-DWI4olFS.js","assets/modalManager-LtDi9OJz.js","assets/utils-DA-PANmk.js","assets/structure--7b3v7AH.js","assets/cssVariables-n9wQSSYb.js","assets/default-CZ6vle49.js"])))=>i.map(i=>d[i]);
2
- const e={},a=function(a,t,s){let r=Promise.resolve();if(t&&t.length>0){let a=function(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:"fulfilled",value:e}),e=>({status:"rejected",reason:e}))))};document.getElementsByTagName("link");const s=document.querySelector("meta[property=csp-nonce]"),i=s?.nonce||s?.getAttribute("nonce");r=a(t.map(a=>{if((a=function(e){return"/"+e}(a))in e)return;e[a]=!0;const t=a.endsWith(".css"),s=t?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${a}"]${s}`))return;const r=document.createElement("link");return r.rel=t?"stylesheet":"modulepreload",t||(r.as="script"),r.crossOrigin="",r.href=a,i&&r.setAttribute("nonce",i),document.head.appendChild(r),t?new Promise((e,t)=>{r.addEventListener("load",e),r.addEventListener("error",()=>t(new Error(`Unable to preload CSS for ${a}`)))}):void 0}))}function i(e){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=e,window.dispatchEvent(a),!a.defaultPrevented)throw e}return r.then(e=>{for(const a of e||[])"rejected"===a.status&&i(a.reason);return a().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"}},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:[]}}}},"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:[]}}}},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:{transition:{module:"transition",attributes:{elements:{element:{primary:"data-hs-transition='element'",aliases:[]},exitTrigger:{primary:"data-hs-transition-exit-trigger",aliases:[]},enterTrigger:{primary:"data-hs-transition-enter-trigger",aliases:[]},namespace:{primary:"data-hs-transition-namespace",aliases:[]},exitTime:{primary:"data-hs-exit-time",aliases:[]},enterTime:{primary:"data-hs-enter-time",aliases:[]},exitDelay:{primary:"data-hs-exit-delay",aliases:[]},enterDelay:{primary:"data-hs-enter-delay",aliases:[]}}}},"smooth-scroll":{module:"smooth-scroll",attributes:{elements:{},note:"This module auto-detects anchor links (a[href^='#']) and does not require data attributes"}},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"}}},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"}}},marquee:{module:"marquee",attributes:{elements:{wrapper:{primary:"data-hs-marquee='wrapper'",aliases:[]}},properties:{direction:"data-hs-marquee-direction",duration:"data-hs-marquee-duration",scrollMultiplier:"data-hs-marquee-scroll",type:"data-hs-marquee-type"}},defaults:{duration:"25",scrollMultiplier:"0"}},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:{module:"animations",description:"Conditionally loaded GSAP animations based on DOM presence",counter:{module:"counter",attributes:{elements:{wrapper:{primary:"data-hs-counter='wrapper'",aliases:[]},counter:{primary:"data-hs-anim='counter'",aliases:[]}}}}}},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 e=Array.isArray(window[s])?window[s]:[],r={normalize:()=>a(()=>import("./assets/normalize-DWI4olFS.js"),__vite__mapDeps([0,1,2])),structure:()=>a(()=>import("./assets/structure--7b3v7AH.js"),__vite__mapDeps([3,1,2,4])),default:()=>a(()=>import("./assets/default-CZ6vle49.js"),__vite__mapDeps([5,1,2,4])),animations:()=>a(()=>import("./assets/animations-igIF6V0K.js"),[])};let i=[...document.querySelectorAll(`script[type="module"][src="${import.meta.url}"]`)];0===i.length&&(i=[...document.querySelectorAll('script[type="module"][src*="@hortonstudio/main"]')].filter(e=>{const a=e.src,t=import.meta.url,s=a.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(e=>"true"===e.getAttribute("data-hs-spa"))},n={normalize:{modules:["normalize"],parallel:!1},structure:{modules:["structure"],parallel:!1},default:{modules:["default","animations"],parallel:!0,waitForIx3:!0}},l=async e=>{const a=window[s];if(a.process.has(e))return a.modules[e]?.loading;a.process.add(e);const t=a.modules[e]||{};let i;a.modules[e]=t,t.loading=new Promise((e,a)=>{t.resolve=e,t.reject=a});try{const{init:s}=await r[e](),o=await s()||{};i=o.destroy;const n=o.result;return t.destroy=()=>{i?.(),a.process.delete(e)},t.restart=()=>{t.destroy?.(),a.load(e)},t.resolve?.(n),delete t.resolve,delete t.reject,n}catch(o){throw i?.(),t.reject?.(o),a.process.delete(e),o}},d=async e=>{const a=n[e];if(await Promise.allSettled(a.modules.map(e=>r[e]())),a.parallel){const e=a.modules.map(e=>l(e));await Promise.allSettled(e)}else for(const t of a.modules)await l(t)},m=async()=>new Promise(e=>{const a=()=>{document.documentElement.classList.contains("w-mod-ix3")?e(!0):setTimeout(a,50)};a()}),p=async()=>{await d("normalize"),await d("structure"),n.default.waitForIx3&&await m(),await d("default"),(()=>{const e=new CustomEvent("hsmain:dom-ready");window.dispatchEvent(e)})()},c=[];window[s]={scripts:i,settings:o,modules:{},process:new Set,load:l,loaded:!1,push(...e){for(const[a,t]of e)"function"==typeof t?this.modules[a]?.loading?.then(t):this.load(a)},destroy(){for(const e in this.modules)this.modules[e]?.destroy?.()},async reinitialize(){this.loaded=!1,this.destroy(),this.modules={},this.process=new Set,await this.scanForEmbedModules(),await p(),await m(),this.loaded=!0},async scanForEmbedModules(){document.querySelectorAll(".w-embed").forEach(e=>{e.querySelectorAll("script[data-hs-module]").forEach(e=>{const a=e.getAttribute("data-hs-module-type"),t=e.getAttribute("data-hs-module");if(a&&t){const e=`data-hs-${a}-${t}`;r[e]&&this.load(e)}})})},afterReady(e){"function"==typeof e&&(this.loaded?e():c.push(e))},status(e){return e?{loaded:!!this.modules[e],loading:this.process.has(e)}:{loaded:Object.keys(this.modules),loading:[...this.process],phases:n}}};(async()=>{window[s].push(...e),await p(),await m(),window[s].loaded=!0,c.forEach(e=>{try{e()}catch{}}),c.length=0})().catch(()=>{})})();export{a as _,t as c};
2
+ const e={},a=function(a,t,s){let r=Promise.resolve();if(t&&t.length>0){let a=function(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:"fulfilled",value:e}),e=>({status:"rejected",reason:e}))))};document.getElementsByTagName("link");const s=document.querySelector("meta[property=csp-nonce]"),i=s?.nonce||s?.getAttribute("nonce");r=a(t.map(a=>{if((a=function(e){return"https://cdn.jsdelivr.net/npm/@hortonstudio/main@1.9.22/dist/"+e}(a))in e)return;e[a]=!0;const t=a.endsWith(".css"),s=t?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${a}"]${s}`))return;const r=document.createElement("link");return r.rel=t?"stylesheet":"modulepreload",t||(r.as="script"),r.crossOrigin="",r.href=a,i&&r.setAttribute("nonce",i),document.head.appendChild(r),t?new Promise((e,t)=>{r.addEventListener("load",e),r.addEventListener("error",()=>t(new Error(`Unable to preload CSS for ${a}`)))}):void 0}))}function i(e){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=e,window.dispatchEvent(a),!a.defaultPrevented)throw e}return r.then(e=>{for(const a of e||[])"rejected"===a.status&&i(a.reason);return a().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"}},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:[]}}}},"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:[]}}}},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:{transition:{module:"transition",attributes:{elements:{element:{primary:"data-hs-transition='element'",aliases:[]},exitTrigger:{primary:"data-hs-transition-exit-trigger",aliases:[]},enterTrigger:{primary:"data-hs-transition-enter-trigger",aliases:[]},namespace:{primary:"data-hs-transition-namespace",aliases:[]},exitTime:{primary:"data-hs-exit-time",aliases:[]},enterTime:{primary:"data-hs-enter-time",aliases:[]},exitDelay:{primary:"data-hs-exit-delay",aliases:[]},enterDelay:{primary:"data-hs-enter-delay",aliases:[]}}}},"smooth-scroll":{module:"smooth-scroll",attributes:{elements:{},note:"This module auto-detects anchor links (a[href^='#']) and does not require data attributes"}},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"}}},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"}}},marquee:{module:"marquee",attributes:{elements:{wrapper:{primary:"data-hs-marquee='wrapper'",aliases:[]}},properties:{direction:"data-hs-marquee-direction",duration:"data-hs-marquee-duration",scrollMultiplier:"data-hs-marquee-scroll",type:"data-hs-marquee-type"}},defaults:{duration:"25",scrollMultiplier:"0"}},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:{module:"animations",description:"Conditionally loaded GSAP animations based on DOM presence",counter:{module:"counter",attributes:{elements:{wrapper:{primary:"data-hs-counter='wrapper'",aliases:[]},counter:{primary:"data-hs-anim='counter'",aliases:[]}}}}}},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 e=Array.isArray(window[s])?window[s]:[],r={normalize:()=>a(()=>import("./assets/normalize-DWI4olFS.js"),__vite__mapDeps([0,1,2])),structure:()=>a(()=>import("./assets/structure--7b3v7AH.js"),__vite__mapDeps([3,1,2,4])),default:()=>a(()=>import("./assets/default-CZ6vle49.js"),__vite__mapDeps([5,1,2,4])),animations:()=>a(()=>import("./assets/animations-igIF6V0K.js"),[])};let i=[...document.querySelectorAll(`script[type="module"][src="${import.meta.url}"]`)];0===i.length&&(i=[...document.querySelectorAll('script[type="module"][src*="@hortonstudio/main"]')].filter(e=>{const a=e.src,t=import.meta.url,s=a.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(e=>"true"===e.getAttribute("data-hs-spa"))},n={normalize:{modules:["normalize"],parallel:!1},structure:{modules:["structure"],parallel:!1},default:{modules:["default","animations"],parallel:!0,waitForIx3:!0}},l=async e=>{const a=window[s];if(a.process.has(e))return a.modules[e]?.loading;a.process.add(e);const t=a.modules[e]||{};let i;a.modules[e]=t,t.loading=new Promise((e,a)=>{t.resolve=e,t.reject=a});try{const{init:s}=await r[e](),o=await s()||{};i=o.destroy;const n=o.result;return t.destroy=()=>{i?.(),a.process.delete(e)},t.restart=()=>{t.destroy?.(),a.load(e)},t.resolve?.(n),delete t.resolve,delete t.reject,n}catch(o){throw i?.(),t.reject?.(o),a.process.delete(e),o}},d=async e=>{const a=n[e];if(await Promise.allSettled(a.modules.map(e=>r[e]())),a.parallel){const e=a.modules.map(e=>l(e));await Promise.allSettled(e)}else for(const t of a.modules)await l(t)},m=async()=>new Promise(e=>{const a=()=>{document.documentElement.classList.contains("w-mod-ix3")?e(!0):setTimeout(a,50)};a()}),p=async()=>{await d("normalize"),await d("structure"),n.default.waitForIx3&&await m(),await d("default"),(()=>{const e=new CustomEvent("hsmain:dom-ready");window.dispatchEvent(e)})()},c=[];window[s]={scripts:i,settings:o,modules:{},process:new Set,load:l,loaded:!1,push(...e){for(const[a,t]of e)"function"==typeof t?this.modules[a]?.loading?.then(t):this.load(a)},destroy(){for(const e in this.modules)this.modules[e]?.destroy?.()},async reinitialize(){this.loaded=!1,this.destroy(),this.modules={},this.process=new Set,await this.scanForEmbedModules(),await p(),await m(),this.loaded=!0},async scanForEmbedModules(){document.querySelectorAll(".w-embed").forEach(e=>{e.querySelectorAll("script[data-hs-module]").forEach(e=>{const a=e.getAttribute("data-hs-module-type"),t=e.getAttribute("data-hs-module");if(a&&t){const e=`data-hs-${a}-${t}`;r[e]&&this.load(e)}})})},afterReady(e){"function"==typeof e&&(this.loaded?e():c.push(e))},status(e){return e?{loaded:!!this.modules[e],loading:this.process.has(e)}:{loaded:Object.keys(this.modules),loading:[...this.process],phases:n}}};(async()=>{window[s].push(...e),await p(),await m(),window[s].loaded=!0,c.forEach(e=>{try{e()}catch{}}),c.length=0})().catch(()=>{})})();export{a as _,t as c};
3
3
  //# sourceMappingURL=main.js.map
package/dist/main.js. CHANGED
@@ -1,3 +1,3 @@
1
1
  const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/normalize-DWI4olFS.js","assets/modalManager-LtDi9OJz.js","assets/utils-DA-PANmk.js","assets/structure--7b3v7AH.js","assets/cssVariables-n9wQSSYb.js","assets/default-CZ6vle49.js"])))=>i.map(i=>d[i]);
2
- const e={},a=function(a,t,s){let r=Promise.resolve();if(t&&t.length>0){let a=function(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:"fulfilled",value:e}),e=>({status:"rejected",reason:e}))))};document.getElementsByTagName("link");const s=document.querySelector("meta[property=csp-nonce]"),i=s?.nonce||s?.getAttribute("nonce");r=a(t.map(a=>{if((a=function(e){return"/"+e}(a))in e)return;e[a]=!0;const t=a.endsWith(".css"),s=t?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${a}"]${s}`))return;const r=document.createElement("link");return r.rel=t?"stylesheet":"modulepreload",t||(r.as="script"),r.crossOrigin="",r.href=a,i&&r.setAttribute("nonce",i),document.head.appendChild(r),t?new Promise((e,t)=>{r.addEventListener("load",e),r.addEventListener("error",()=>t(new Error(`Unable to preload CSS for ${a}`)))}):void 0}))}function i(e){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=e,window.dispatchEvent(a),!a.defaultPrevented)throw e}return r.then(e=>{for(const a of e||[])"rejected"===a.status&&i(a.reason);return a().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"}},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:[]}}}},"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:[]}}}},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:{transition:{module:"transition",attributes:{elements:{element:{primary:"data-hs-transition='element'",aliases:[]},exitTrigger:{primary:"data-hs-transition-exit-trigger",aliases:[]},enterTrigger:{primary:"data-hs-transition-enter-trigger",aliases:[]},namespace:{primary:"data-hs-transition-namespace",aliases:[]},exitTime:{primary:"data-hs-exit-time",aliases:[]},enterTime:{primary:"data-hs-enter-time",aliases:[]},exitDelay:{primary:"data-hs-exit-delay",aliases:[]},enterDelay:{primary:"data-hs-enter-delay",aliases:[]}}}},"smooth-scroll":{module:"smooth-scroll",attributes:{elements:{},note:"This module auto-detects anchor links (a[href^='#']) and does not require data attributes"}},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"}}},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"}}},marquee:{module:"marquee",attributes:{elements:{wrapper:{primary:"data-hs-marquee='wrapper'",aliases:[]}},properties:{direction:"data-hs-marquee-direction",duration:"data-hs-marquee-duration",scrollMultiplier:"data-hs-marquee-scroll",type:"data-hs-marquee-type"}},defaults:{duration:"25",scrollMultiplier:"0"}},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:{module:"animations",description:"Conditionally loaded GSAP animations based on DOM presence",counter:{module:"counter",attributes:{elements:{wrapper:{primary:"data-hs-counter='wrapper'",aliases:[]},counter:{primary:"data-hs-anim='counter'",aliases:[]}}}}}},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 e=Array.isArray(window[s])?window[s]:[],r={normalize:()=>a(()=>import("./assets/normalize-DWI4olFS.js"),__vite__mapDeps([0,1,2])),structure:()=>a(()=>import("./assets/structure--7b3v7AH.js"),__vite__mapDeps([3,1,2,4])),default:()=>a(()=>import("./assets/default-CZ6vle49.js"),__vite__mapDeps([5,1,2,4])),animations:()=>a(()=>import("./assets/animations-igIF6V0K.js"),[])};let i=[...document.querySelectorAll(`script[type="module"][src="${import.meta.url}"]`)];0===i.length&&(i=[...document.querySelectorAll('script[type="module"][src*="@hortonstudio/main"]')].filter(e=>{const a=e.src,t=import.meta.url,s=a.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(e=>"true"===e.getAttribute("data-hs-spa"))},n={normalize:{modules:["normalize"],parallel:!1},structure:{modules:["structure"],parallel:!1},default:{modules:["default","animations"],parallel:!0,waitForIx3:!0}},l=async e=>{const a=window[s];if(a.process.has(e))return a.modules[e]?.loading;a.process.add(e);const t=a.modules[e]||{};let i;a.modules[e]=t,t.loading=new Promise((e,a)=>{t.resolve=e,t.reject=a});try{const{init:s}=await r[e](),o=await s()||{};i=o.destroy;const n=o.result;return t.destroy=()=>{i?.(),a.process.delete(e)},t.restart=()=>{t.destroy?.(),a.load(e)},t.resolve?.(n),delete t.resolve,delete t.reject,n}catch(o){throw i?.(),t.reject?.(o),a.process.delete(e),o}},d=async e=>{const a=n[e];if(await Promise.allSettled(a.modules.map(e=>r[e]())),a.parallel){const e=a.modules.map(e=>l(e));await Promise.allSettled(e)}else for(const t of a.modules)await l(t)},m=async()=>new Promise(e=>{const a=()=>{document.documentElement.classList.contains("w-mod-ix3")?e(!0):setTimeout(a,50)};a()}),p=async()=>{await d("normalize"),await d("structure"),n.default.waitForIx3&&await m(),await d("default"),(()=>{const e=new CustomEvent("hsmain:dom-ready");window.dispatchEvent(e)})()},c=[];window[s]={scripts:i,settings:o,modules:{},process:new Set,load:l,loaded:!1,push(...e){for(const[a,t]of e)"function"==typeof t?this.modules[a]?.loading?.then(t):this.load(a)},destroy(){for(const e in this.modules)this.modules[e]?.destroy?.()},async reinitialize(){this.loaded=!1,this.destroy(),this.modules={},this.process=new Set,await this.scanForEmbedModules(),await p(),await m(),this.loaded=!0},async scanForEmbedModules(){document.querySelectorAll(".w-embed").forEach(e=>{e.querySelectorAll("script[data-hs-module]").forEach(e=>{const a=e.getAttribute("data-hs-module-type"),t=e.getAttribute("data-hs-module");if(a&&t){const e=`data-hs-${a}-${t}`;r[e]&&this.load(e)}})})},afterReady(e){"function"==typeof e&&(this.loaded?e():c.push(e))},status(e){return e?{loaded:!!this.modules[e],loading:this.process.has(e)}:{loaded:Object.keys(this.modules),loading:[...this.process],phases:n}}};(async()=>{window[s].push(...e),await p(),await m(),window[s].loaded=!0,c.forEach(e=>{try{e()}catch{}}),c.length=0})().catch(()=>{})})();export{a as _,t as c};
2
+ const e={},a=function(a,t,s){let r=Promise.resolve();if(t&&t.length>0){let a=function(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:"fulfilled",value:e}),e=>({status:"rejected",reason:e}))))};document.getElementsByTagName("link");const s=document.querySelector("meta[property=csp-nonce]"),i=s?.nonce||s?.getAttribute("nonce");r=a(t.map(a=>{if((a=function(e){return"https://cdn.jsdelivr.net/npm/@hortonstudio/main@1.9.22/dist/"+e}(a))in e)return;e[a]=!0;const t=a.endsWith(".css"),s=t?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${a}"]${s}`))return;const r=document.createElement("link");return r.rel=t?"stylesheet":"modulepreload",t||(r.as="script"),r.crossOrigin="",r.href=a,i&&r.setAttribute("nonce",i),document.head.appendChild(r),t?new Promise((e,t)=>{r.addEventListener("load",e),r.addEventListener("error",()=>t(new Error(`Unable to preload CSS for ${a}`)))}):void 0}))}function i(e){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=e,window.dispatchEvent(a),!a.defaultPrevented)throw e}return r.then(e=>{for(const a of e||[])"rejected"===a.status&&i(a.reason);return a().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"}},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:[]}}}},"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:[]}}}},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:{transition:{module:"transition",attributes:{elements:{element:{primary:"data-hs-transition='element'",aliases:[]},exitTrigger:{primary:"data-hs-transition-exit-trigger",aliases:[]},enterTrigger:{primary:"data-hs-transition-enter-trigger",aliases:[]},namespace:{primary:"data-hs-transition-namespace",aliases:[]},exitTime:{primary:"data-hs-exit-time",aliases:[]},enterTime:{primary:"data-hs-enter-time",aliases:[]},exitDelay:{primary:"data-hs-exit-delay",aliases:[]},enterDelay:{primary:"data-hs-enter-delay",aliases:[]}}}},"smooth-scroll":{module:"smooth-scroll",attributes:{elements:{},note:"This module auto-detects anchor links (a[href^='#']) and does not require data attributes"}},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"}}},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"}}},marquee:{module:"marquee",attributes:{elements:{wrapper:{primary:"data-hs-marquee='wrapper'",aliases:[]}},properties:{direction:"data-hs-marquee-direction",duration:"data-hs-marquee-duration",scrollMultiplier:"data-hs-marquee-scroll",type:"data-hs-marquee-type"}},defaults:{duration:"25",scrollMultiplier:"0"}},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:{module:"animations",description:"Conditionally loaded GSAP animations based on DOM presence",counter:{module:"counter",attributes:{elements:{wrapper:{primary:"data-hs-counter='wrapper'",aliases:[]},counter:{primary:"data-hs-anim='counter'",aliases:[]}}}}}},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 e=Array.isArray(window[s])?window[s]:[],r={normalize:()=>a(()=>import("./assets/normalize-DWI4olFS.js"),__vite__mapDeps([0,1,2])),structure:()=>a(()=>import("./assets/structure--7b3v7AH.js"),__vite__mapDeps([3,1,2,4])),default:()=>a(()=>import("./assets/default-CZ6vle49.js"),__vite__mapDeps([5,1,2,4])),animations:()=>a(()=>import("./assets/animations-igIF6V0K.js"),[])};let i=[...document.querySelectorAll(`script[type="module"][src="${import.meta.url}"]`)];0===i.length&&(i=[...document.querySelectorAll('script[type="module"][src*="@hortonstudio/main"]')].filter(e=>{const a=e.src,t=import.meta.url,s=a.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(e=>"true"===e.getAttribute("data-hs-spa"))},n={normalize:{modules:["normalize"],parallel:!1},structure:{modules:["structure"],parallel:!1},default:{modules:["default","animations"],parallel:!0,waitForIx3:!0}},l=async e=>{const a=window[s];if(a.process.has(e))return a.modules[e]?.loading;a.process.add(e);const t=a.modules[e]||{};let i;a.modules[e]=t,t.loading=new Promise((e,a)=>{t.resolve=e,t.reject=a});try{const{init:s}=await r[e](),o=await s()||{};i=o.destroy;const n=o.result;return t.destroy=()=>{i?.(),a.process.delete(e)},t.restart=()=>{t.destroy?.(),a.load(e)},t.resolve?.(n),delete t.resolve,delete t.reject,n}catch(o){throw i?.(),t.reject?.(o),a.process.delete(e),o}},d=async e=>{const a=n[e];if(await Promise.allSettled(a.modules.map(e=>r[e]())),a.parallel){const e=a.modules.map(e=>l(e));await Promise.allSettled(e)}else for(const t of a.modules)await l(t)},m=async()=>new Promise(e=>{const a=()=>{document.documentElement.classList.contains("w-mod-ix3")?e(!0):setTimeout(a,50)};a()}),p=async()=>{await d("normalize"),await d("structure"),n.default.waitForIx3&&await m(),await d("default"),(()=>{const e=new CustomEvent("hsmain:dom-ready");window.dispatchEvent(e)})()},c=[];window[s]={scripts:i,settings:o,modules:{},process:new Set,load:l,loaded:!1,push(...e){for(const[a,t]of e)"function"==typeof t?this.modules[a]?.loading?.then(t):this.load(a)},destroy(){for(const e in this.modules)this.modules[e]?.destroy?.()},async reinitialize(){this.loaded=!1,this.destroy(),this.modules={},this.process=new Set,await this.scanForEmbedModules(),await p(),await m(),this.loaded=!0},async scanForEmbedModules(){document.querySelectorAll(".w-embed").forEach(e=>{e.querySelectorAll("script[data-hs-module]").forEach(e=>{const a=e.getAttribute("data-hs-module-type"),t=e.getAttribute("data-hs-module");if(a&&t){const e=`data-hs-${a}-${t}`;r[e]&&this.load(e)}})})},afterReady(e){"function"==typeof e&&(this.loaded?e():c.push(e))},status(e){return e?{loaded:!!this.modules[e],loading:this.process.has(e)}:{loaded:Object.keys(this.modules),loading:[...this.process],phases:n}}};(async()=>{window[s].push(...e),await p(),await m(),window[s].loaded=!0,c.forEach(e=>{try{e()}catch{}}),c.length=0})().catch(()=>{})})();export{a as _,t as c};
3
3
  //# sourceMappingURL=main.js.map
package/dist/main.js.gz CHANGED
Binary file
package/dist/main.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"mappings":";ikCAuGaA,+hQCrGPC,EAAWD,EAAOE,QAAQC,QAEPC,WACvB,GAAIC,OAAOJ,KAAcK,MAAMC,QAAQF,OAAOJ,KAAcI,OAAOJ,GAAUO,OAC3E,OAIFC,SAASC,gBAAgBC,UAAUC,IAAIZ,EAAOE,QAAQW,QAAQC,aAE9D,MAAMC,EAAgBT,MAAMC,QAAQF,OAAOJ,IAAaI,OAAOJ,GAAY,GAErEe,EAAY,CAChBC,UAAW,IAAAC,EAAA,IAAMC,OAAO,kCAAsCC,0BAC9DC,UAAW,IAAAH,EAAA,IAA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A,yBAAM+E,GACW9E,SAASgB,iBAAiB,YAClC+D,QAASC,IACEA,EAAMhE,iBAAiB,0BAC/B+D,QAAS3D,IAEf,MAAM6D,EAAa7D,EAAOW,aAAa,uBACjCM,EAAajB,EAAOW,aAAa,kBAEvC,GAAIkD,GAAc5C,EAAY,CAC5B,MAAM6C,EAAY,WAAWD,KAAc5C,IACvC9B,EAAU2E,IACZP,KAAKtB,KAAK6B,EAEd,KAGN,EACA,UAAAC,CAAWT,GACe,mBAAbA,IACLC,KAAK5E,OACP2E,IAEAJ,EAAeE,KAAKE,GAG1B,EACA,MAAAU,CAAO/C,GACL,OAAIA,EACK,CACLtC,SAAU4E,KAAK1C,QAAQI,GACvBI,QAASkC,KAAKpC,QAAQC,IAAIH,IAGvB,CACLtC,OAAQsF,OAAOC,KAAKX,KAAK1C,SACzBQ,QAAS,IAAIkC,KAAKpC,SAClBgD,OAAQvD,EAEZ,GAGerC,WACfC,OAAOJ,GAAUgF,QAAQlE,SAGnB2D,UAGA9B,IAENvC,OAAOJ,GAAUO,QAAS,EAC1BuE,EAAeS,QAASL,IACtB,IACEA,GACF,OAEA,IAEFJ,EAAepD,OAAS,GAG1BsE,GAAWC,MAAM,SAGnBC","names":["config","API_NAME","_global","apiName","async","window","Array","isArray","loaded","document","documentElement","classList","add","classes","initialized","queuedModules","moduleMap","normalize","__vitePreload","import","__VITE_PRELOAD__","structure","default","animations","scripts","querySelectorAll","url","length","filter","script","scriptSrc","src","currentSrc","scriptPackage","match","currentPackage","split","settings","isSPA","some","getAttribute","PHASES","modules","parallel","waitForIx3","loadModule","moduleName","instance","process","has","loading","moduleData","destroy","Promise","resolve","reject","init","resultData","initResult","result","delete","restart","load","error","executePhase","phaseName","phase","allSettled","map","name","initPromises","checkIx3","contains","setTimeout","initializeInPhases","event","CustomEvent","dispatchEvent","triggerDomReady","readyCallbacks","Set","push","items","callback","this","then","reinitialize","scanForEmbedModules","forEach","embed","moduleType","moduleKey","afterReady","status","Object","keys","phases","finalize","catch","initializeHsMain"],"ignoreList":[],"sources":["../src/config.ts","../index.ts"],"sourcesContent":["/**\n * Master configuration with TypeScript type safety\n * Single source of truth for all module configs\n *\n * @version 2.0.0\n */\nimport configData from './config.json';\n\n// TypeScript interfaces for autocomplete and type safety\n\nexport interface AttributeConfig {\n primary: string;\n aliases: string[];\n}\n\nexport interface ModuleConfig {\n module: string;\n description?: string;\n attributes?: {\n elements?: Record<string, AttributeConfig>;\n properties?: Record<string, string>;\n placeholders?: Record<string, string>;\n note?: string;\n };\n modes?: Record<string, string>;\n modifiers?: Record<string, string>;\n limits?: Record<string, number>;\n types?: Record<string, string>;\n defaults?: Record<string, string>;\n}\n\nexport interface GlobalConfig {\n version: string;\n apiName: string;\n attributes: {\n height: string;\n heightValue: string;\n heightDuration: string;\n heightEase: string;\n moduleType: string;\n module: string;\n };\n classes: {\n modalOpen: string;\n overflowHidden: string;\n initialized: string;\n displayContents: string;\n active: string;\n gsap: string;\n };\n cssVars: {\n prefix: string;\n state: {\n name: string;\n values: {\n active: string;\n inactive: string;\n };\n };\n };\n clickable: ModuleConfig;\n}\n\nexport interface Config {\n _global: GlobalConfig;\n normalize: {\n sync: ModuleConfig;\n clickable: ModuleConfig & {\n normalize: ModuleConfig;\n };\n dupe: ModuleConfig;\n };\n structure: {\n 'year-replacement': ModuleConfig;\n toc: ModuleConfig;\n pagination: ModuleConfig;\n 'site-settings': ModuleConfig;\n form: {\n honeypot: ModuleConfig;\n range: ModuleConfig;\n test: ModuleConfig;\n select: ModuleConfig & {\n states: ModuleConfig;\n 'custom-select': ModuleConfig;\n };\n };\n };\n transition: ModuleConfig;\n default: {\n 'smooth-scroll': ModuleConfig;\n accordion: ModuleConfig;\n counter: ModuleConfig;\n comparison: ModuleConfig;\n marquee: ModuleConfig;\n navbar: ModuleConfig & {\n dropdown: ModuleConfig;\n menu: ModuleConfig;\n 'arrow-navigation': ModuleConfig;\n };\n };\n}\n\n// Export typed config\nexport const config = configData as Config;\nexport default config;\n","import config from '@config';\n\nconst API_NAME = config._global.apiName;\n\nconst initializeHsMain = async () => {\n if (window[API_NAME] && !Array.isArray(window[API_NAME]) && window[API_NAME].loaded) {\n return;\n }\n\n // Add initialized class to HTML element immediately\n document.documentElement.classList.add(config._global.classes.initialized);\n\n const queuedModules = Array.isArray(window[API_NAME]) ? window[API_NAME] : [];\n\n const moduleMap = {\n normalize: () => import('./src/modules/normalize/normalize.ts'),\n structure: () => import('./src/modules/structure/structure.ts'),\n default: () => import('./src/modules/default/default.ts'),\n animations: () => import('./src/animations/animations.ts'),\n };\n\n let scripts = [...document.querySelectorAll(`script[type=\"module\"][src=\"${import.meta.url}\"]`)];\n\n if (scripts.length === 0) {\n scripts = [\n ...document.querySelectorAll('script[type=\"module\"][src*=\"@hortonstudio/main\"]'),\n ].filter((script) => {\n const scriptSrc = script.src;\n const currentSrc = import.meta.url;\n const scriptPackage = scriptSrc.match(/@hortonstudio\\/main(@[\\d.]+)?/)?.[0];\n const currentPackage = currentSrc.match(/@hortonstudio\\/main(@[\\d.]+)?/)?.[0];\n return (\n scriptPackage &&\n currentPackage &&\n scriptPackage.split('@')[0] === currentPackage.split('@')[0]\n );\n });\n }\n\n // Read settings from script tag attributes\n const settings = {\n isSPA: scripts.some((script) => script.getAttribute('data-hs-spa') === 'true'),\n };\n\n // Define 3-phase initialization system\n const PHASES = {\n normalize: {\n modules: ['normalize'],\n parallel: false, // Sequential execution critical for DOM fixes\n },\n structure: {\n modules: ['structure'],\n parallel: false, // Must complete before default\n },\n default: {\n modules: ['default', 'animations'],\n parallel: true, // Run default and animations synchronously\n waitForIx3: true, // Wait for Webflow IX3 before starting\n },\n };\n\n const loadModule = async (moduleName) => {\n const instance = window[API_NAME];\n if (instance.process.has(moduleName)) {\n return instance.modules[moduleName]?.loading;\n }\n\n instance.process.add(moduleName);\n\n const moduleData = instance.modules[moduleName] || {};\n instance.modules[moduleName] = moduleData;\n\n moduleData.loading = new Promise((resolve, reject) => {\n moduleData.resolve = resolve;\n moduleData.reject = reject;\n });\n\n let destroy;\n try {\n const { init } = await moduleMap[moduleName]();\n const result = await init();\n const resultData = result || {};\n destroy = resultData.destroy;\n const initResult = resultData.result;\n\n moduleData.destroy = () => {\n destroy?.();\n instance.process.delete(moduleName);\n };\n moduleData.restart = () => {\n moduleData.destroy?.();\n instance.load(moduleName);\n };\n\n moduleData.resolve?.(initResult);\n delete moduleData.resolve;\n delete moduleData.reject;\n\n return initResult;\n } catch (error) {\n destroy?.();\n moduleData.reject?.(error);\n instance.process.delete(moduleName);\n throw error;\n }\n };\n\n // Helper to load and execute a phase\n const executePhase = async (phaseName) => {\n const phase = PHASES[phaseName];\n\n // Download all modules in parallel\n await Promise.allSettled(phase.modules.map((name) => moduleMap[name]()));\n\n // Execute based on parallel setting\n if (phase.parallel) {\n const initPromises = phase.modules.map((name) => loadModule(name));\n await Promise.allSettled(initPromises);\n } else {\n // Sequential execution\n for (const name of phase.modules) {\n await loadModule(name);\n }\n }\n };\n\n // Trigger DOM ready event\n const triggerDomReady = () => {\n const event = new CustomEvent('hsmain:dom-ready');\n window.dispatchEvent(event);\n };\n\n // Wait for Webflow IX3 to be ready\n const waitForIx3 = async () => {\n return new Promise((resolve) => {\n const checkIx3 = () => {\n const htmlElement = document.documentElement;\n const hasIx3 = htmlElement.classList.contains('w-mod-ix3');\n\n if (hasIx3) {\n resolve(true);\n } else {\n setTimeout(checkIx3, 50);\n }\n };\n checkIx3();\n });\n };\n\n // Initialize all modules in 3 phases\n const initializeInPhases = async () => {\n // Phase 1: Normalize (critical DOM fixes)\n await executePhase('normalize');\n\n // Phase 2: Structure (DOM modifications)\n await executePhase('structure');\n\n // Wait for IX3 if needed for Phase 3\n if (PHASES.default.waitForIx3) {\n await waitForIx3();\n }\n\n // Phase 3: Default + Transition (parallel with 50ms transition delay)\n await executePhase('default');\n\n // Trigger DOM ready after everything initialized\n triggerDomReady();\n };\n\n const readyCallbacks = [];\n\n window[API_NAME] = {\n scripts,\n settings,\n modules: {},\n process: new Set(),\n load: loadModule,\n loaded: false,\n push(...items) {\n for (const [moduleName, callback] of items) {\n if (typeof callback === 'function') {\n this.modules[moduleName]?.loading?.then(callback);\n } else {\n this.load(moduleName);\n }\n }\n },\n destroy() {\n for (const moduleName in this.modules) {\n this.modules[moduleName]?.destroy?.();\n }\n },\n async reinitialize() {\n // Complete teardown\n this.loaded = false;\n this.destroy();\n this.modules = {};\n this.process = new Set();\n\n // Re-scan for modules including in w-embeds\n await this.scanForEmbedModules();\n\n // Use same phased initialization flow\n await initializeInPhases();\n\n // Wait for IX3 to be ready before marking as loaded\n await waitForIx3();\n this.loaded = true;\n },\n async scanForEmbedModules() {\n const embeds = document.querySelectorAll('.w-embed');\n embeds.forEach((embed) => {\n const scripts = embed.querySelectorAll('script[data-hs-module]');\n scripts.forEach((script) => {\n // Extract module info from data attributes\n const moduleType = script.getAttribute('data-hs-module-type');\n const moduleName = script.getAttribute('data-hs-module');\n\n if (moduleType && moduleName) {\n const moduleKey = `data-hs-${moduleType}-${moduleName}`;\n if (moduleMap[moduleKey]) {\n this.load(moduleKey);\n }\n }\n });\n });\n },\n afterReady(callback) {\n if (typeof callback === 'function') {\n if (this.loaded) {\n callback();\n } else {\n readyCallbacks.push(callback);\n }\n }\n },\n status(moduleName) {\n if (moduleName) {\n return {\n loaded: !!this.modules[moduleName],\n loading: this.process.has(moduleName),\n };\n }\n return {\n loaded: Object.keys(this.modules),\n loading: [...this.process],\n phases: PHASES,\n };\n },\n };\n\n const finalize = async () => {\n window[API_NAME].push(...queuedModules);\n\n // Run phased initialization\n await initializeInPhases();\n\n // Wait for IX3 to be ready before firing callbacks\n await waitForIx3();\n\n window[API_NAME].loaded = true;\n readyCallbacks.forEach((callback) => {\n try {\n callback();\n } catch {\n // Silent error handling\n }\n });\n readyCallbacks.length = 0; // Clear array after execution\n };\n\n finalize().catch(() => {});\n};\n\ninitializeHsMain();\n"],"file":"main.js"}
1
+ {"version":3,"mappings":";4nCAuGaA,+hQCrGPC,EAAWD,EAAOE,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AbC,EACTC,KAAK1C,QAAQI,IAAaI,SAASmC,KAAKF,GAExCC,KAAKtB,KAAKhB,EAGhB,EACA,OAAAM,GACE,UAAWN,KAAcsC,KAAK1C,QAC5B0C,KAAK1C,QAAQI,IAAaM,WAE9B,EACA,kBAAMkC,GAEJF,KAAK5E,QAAS,EACd4E,KAAKhC,UACLgC,KAAK1C,QAAU,GACf0C,KAAKpC,YAAcgC,UAGbI,KAAKG,4BAGLb,UAGA9B,IACNwC,KAAK5E,QAAS,CAChB,EACA,yBAAM+E,GACW9E,SAASgB,iBAAiB,YAClC+D,QAASC,IACEA,EAAMhE,iBAAiB,0BAC/B+D,QAAS3D,IAEf,MAAM6D,EAAa7D,EAAOW,aAAa,uBACjCM,EAAajB,EAAOW,aAAa,kBAEvC,GAAIkD,GAAc5C,EAAY,CAC5B,MAAM6C,EAAY,WAAWD,KAAc5C,IACvC9B,EAAU2E,IACZP,KAAKtB,KAAK6B,EAEd,KAGN,EACA,UAAAC,CAAWT,GACe,mBAAbA,IACLC,KAAK5E,OACP2E,IAEAJ,EAAeE,KAAKE,GAG1B,EACA,MAAAU,CAAO/C,GACL,OAAIA,EACK,CACLtC,SAAU4E,KAAK1C,QAAQI,GACvBI,QAASkC,KAAKpC,QAAQC,IAAIH,IAGvB,CACLtC,OAAQsF,OAAOC,KAAKX,KAAK1C,SACzBQ,QAAS,IAAIkC,KAAKpC,SAClBgD,OAAQvD,EAEZ,GAGerC,WACfC,OAAOJ,GAAUgF,QAAQlE,SAGnB2D,UAGA9B,IAENvC,OAAOJ,GAAUO,QAAS,EAC1BuE,EAAeS,QAASL,IACtB,IACEA,GACF,OAEA,IAEFJ,EAAepD,OAAS,GAG1BsE,GAAWC,MAAM,SAGnBC","names":["config","API_NAME","_global","apiName","async","window","Array","isArray","loaded","document","documentElement","classList","add","classes","initialized","queuedModules","moduleMap","normalize","__vitePreload","import","__VITE_PRELOAD__","structure","default","animations","scripts","querySelectorAll","url","length","filter","script","scriptSrc","src","currentSrc","scriptPackage","match","currentPackage","split","settings","isSPA","some","getAttribute","PHASES","modules","parallel","waitForIx3","loadModule","moduleName","instance","process","has","loading","moduleData","destroy","Promise","resolve","reject","init","resultData","initResult","result","delete","restart","load","error","executePhase","phaseName","phase","allSettled","map","name","initPromises","checkIx3","contains","setTimeout","initializeInPhases","event","CustomEvent","dispatchEvent","triggerDomReady","readyCallbacks","Set","push","items","callback","this","then","reinitialize","scanForEmbedModules","forEach","embed","moduleType","moduleKey","afterReady","status","Object","keys","phases","finalize","catch","initializeHsMain"],"ignoreList":[],"sources":["../src/config.ts","../index.ts"],"sourcesContent":["/**\n * Master configuration with TypeScript type safety\n * Single source of truth for all module configs\n *\n * @version 2.0.0\n */\nimport configData from './config.json';\n\n// TypeScript interfaces for autocomplete and type safety\n\nexport interface AttributeConfig {\n primary: string;\n aliases: string[];\n}\n\nexport interface ModuleConfig {\n module: string;\n description?: string;\n attributes?: {\n elements?: Record<string, AttributeConfig>;\n properties?: Record<string, string>;\n placeholders?: Record<string, string>;\n note?: string;\n };\n modes?: Record<string, string>;\n modifiers?: Record<string, string>;\n limits?: Record<string, number>;\n types?: Record<string, string>;\n defaults?: Record<string, string>;\n}\n\nexport interface GlobalConfig {\n version: string;\n apiName: string;\n attributes: {\n height: string;\n heightValue: string;\n heightDuration: string;\n heightEase: string;\n moduleType: string;\n module: string;\n };\n classes: {\n modalOpen: string;\n overflowHidden: string;\n initialized: string;\n displayContents: string;\n active: string;\n gsap: string;\n };\n cssVars: {\n prefix: string;\n state: {\n name: string;\n values: {\n active: string;\n inactive: string;\n };\n };\n };\n clickable: ModuleConfig;\n}\n\nexport interface Config {\n _global: GlobalConfig;\n normalize: {\n sync: ModuleConfig;\n clickable: ModuleConfig & {\n normalize: ModuleConfig;\n };\n dupe: ModuleConfig;\n };\n structure: {\n 'year-replacement': ModuleConfig;\n toc: ModuleConfig;\n pagination: ModuleConfig;\n 'site-settings': ModuleConfig;\n form: {\n honeypot: ModuleConfig;\n range: ModuleConfig;\n test: ModuleConfig;\n select: ModuleConfig & {\n states: ModuleConfig;\n 'custom-select': ModuleConfig;\n };\n };\n };\n transition: ModuleConfig;\n default: {\n 'smooth-scroll': ModuleConfig;\n accordion: ModuleConfig;\n counter: ModuleConfig;\n comparison: ModuleConfig;\n marquee: ModuleConfig;\n navbar: ModuleConfig & {\n dropdown: ModuleConfig;\n menu: ModuleConfig;\n 'arrow-navigation': ModuleConfig;\n };\n };\n}\n\n// Export typed config\nexport const config = configData as Config;\nexport default config;\n","import config from '@config';\n\nconst API_NAME = config._global.apiName;\n\nconst initializeHsMain = async () => {\n if (window[API_NAME] && !Array.isArray(window[API_NAME]) && window[API_NAME].loaded) {\n return;\n }\n\n // Add initialized class to HTML element immediately\n document.documentElement.classList.add(config._global.classes.initialized);\n\n const queuedModules = Array.isArray(window[API_NAME]) ? window[API_NAME] : [];\n\n const moduleMap = {\n normalize: () => import('./src/modules/normalize/normalize.ts'),\n structure: () => import('./src/modules/structure/structure.ts'),\n default: () => import('./src/modules/default/default.ts'),\n animations: () => import('./src/animations/animations.ts'),\n };\n\n let scripts = [...document.querySelectorAll(`script[type=\"module\"][src=\"${import.meta.url}\"]`)];\n\n if (scripts.length === 0) {\n scripts = [\n ...document.querySelectorAll('script[type=\"module\"][src*=\"@hortonstudio/main\"]'),\n ].filter((script) => {\n const scriptSrc = script.src;\n const currentSrc = import.meta.url;\n const scriptPackage = scriptSrc.match(/@hortonstudio\\/main(@[\\d.]+)?/)?.[0];\n const currentPackage = currentSrc.match(/@hortonstudio\\/main(@[\\d.]+)?/)?.[0];\n return (\n scriptPackage &&\n currentPackage &&\n scriptPackage.split('@')[0] === currentPackage.split('@')[0]\n );\n });\n }\n\n // Read settings from script tag attributes\n const settings = {\n isSPA: scripts.some((script) => script.getAttribute('data-hs-spa') === 'true'),\n };\n\n // Define 3-phase initialization system\n const PHASES = {\n normalize: {\n modules: ['normalize'],\n parallel: false, // Sequential execution critical for DOM fixes\n },\n structure: {\n modules: ['structure'],\n parallel: false, // Must complete before default\n },\n default: {\n modules: ['default', 'animations'],\n parallel: true, // Run default and animations synchronously\n waitForIx3: true, // Wait for Webflow IX3 before starting\n },\n };\n\n const loadModule = async (moduleName) => {\n const instance = window[API_NAME];\n if (instance.process.has(moduleName)) {\n return instance.modules[moduleName]?.loading;\n }\n\n instance.process.add(moduleName);\n\n const moduleData = instance.modules[moduleName] || {};\n instance.modules[moduleName] = moduleData;\n\n moduleData.loading = new Promise((resolve, reject) => {\n moduleData.resolve = resolve;\n moduleData.reject = reject;\n });\n\n let destroy;\n try {\n const { init } = await moduleMap[moduleName]();\n const result = await init();\n const resultData = result || {};\n destroy = resultData.destroy;\n const initResult = resultData.result;\n\n moduleData.destroy = () => {\n destroy?.();\n instance.process.delete(moduleName);\n };\n moduleData.restart = () => {\n moduleData.destroy?.();\n instance.load(moduleName);\n };\n\n moduleData.resolve?.(initResult);\n delete moduleData.resolve;\n delete moduleData.reject;\n\n return initResult;\n } catch (error) {\n destroy?.();\n moduleData.reject?.(error);\n instance.process.delete(moduleName);\n throw error;\n }\n };\n\n // Helper to load and execute a phase\n const executePhase = async (phaseName) => {\n const phase = PHASES[phaseName];\n\n // Download all modules in parallel\n await Promise.allSettled(phase.modules.map((name) => moduleMap[name]()));\n\n // Execute based on parallel setting\n if (phase.parallel) {\n const initPromises = phase.modules.map((name) => loadModule(name));\n await Promise.allSettled(initPromises);\n } else {\n // Sequential execution\n for (const name of phase.modules) {\n await loadModule(name);\n }\n }\n };\n\n // Trigger DOM ready event\n const triggerDomReady = () => {\n const event = new CustomEvent('hsmain:dom-ready');\n window.dispatchEvent(event);\n };\n\n // Wait for Webflow IX3 to be ready\n const waitForIx3 = async () => {\n return new Promise((resolve) => {\n const checkIx3 = () => {\n const htmlElement = document.documentElement;\n const hasIx3 = htmlElement.classList.contains('w-mod-ix3');\n\n if (hasIx3) {\n resolve(true);\n } else {\n setTimeout(checkIx3, 50);\n }\n };\n checkIx3();\n });\n };\n\n // Initialize all modules in 3 phases\n const initializeInPhases = async () => {\n // Phase 1: Normalize (critical DOM fixes)\n await executePhase('normalize');\n\n // Phase 2: Structure (DOM modifications)\n await executePhase('structure');\n\n // Wait for IX3 if needed for Phase 3\n if (PHASES.default.waitForIx3) {\n await waitForIx3();\n }\n\n // Phase 3: Default + Transition (parallel with 50ms transition delay)\n await executePhase('default');\n\n // Trigger DOM ready after everything initialized\n triggerDomReady();\n };\n\n const readyCallbacks = [];\n\n window[API_NAME] = {\n scripts,\n settings,\n modules: {},\n process: new Set(),\n load: loadModule,\n loaded: false,\n push(...items) {\n for (const [moduleName, callback] of items) {\n if (typeof callback === 'function') {\n this.modules[moduleName]?.loading?.then(callback);\n } else {\n this.load(moduleName);\n }\n }\n },\n destroy() {\n for (const moduleName in this.modules) {\n this.modules[moduleName]?.destroy?.();\n }\n },\n async reinitialize() {\n // Complete teardown\n this.loaded = false;\n this.destroy();\n this.modules = {};\n this.process = new Set();\n\n // Re-scan for modules including in w-embeds\n await this.scanForEmbedModules();\n\n // Use same phased initialization flow\n await initializeInPhases();\n\n // Wait for IX3 to be ready before marking as loaded\n await waitForIx3();\n this.loaded = true;\n },\n async scanForEmbedModules() {\n const embeds = document.querySelectorAll('.w-embed');\n embeds.forEach((embed) => {\n const scripts = embed.querySelectorAll('script[data-hs-module]');\n scripts.forEach((script) => {\n // Extract module info from data attributes\n const moduleType = script.getAttribute('data-hs-module-type');\n const moduleName = script.getAttribute('data-hs-module');\n\n if (moduleType && moduleName) {\n const moduleKey = `data-hs-${moduleType}-${moduleName}`;\n if (moduleMap[moduleKey]) {\n this.load(moduleKey);\n }\n }\n });\n });\n },\n afterReady(callback) {\n if (typeof callback === 'function') {\n if (this.loaded) {\n callback();\n } else {\n readyCallbacks.push(callback);\n }\n }\n },\n status(moduleName) {\n if (moduleName) {\n return {\n loaded: !!this.modules[moduleName],\n loading: this.process.has(moduleName),\n };\n }\n return {\n loaded: Object.keys(this.modules),\n loading: [...this.process],\n phases: PHASES,\n };\n },\n };\n\n const finalize = async () => {\n window[API_NAME].push(...queuedModules);\n\n // Run phased initialization\n await initializeInPhases();\n\n // Wait for IX3 to be ready before firing callbacks\n await waitForIx3();\n\n window[API_NAME].loaded = true;\n readyCallbacks.forEach((callback) => {\n try {\n callback();\n } catch {\n // Silent error handling\n }\n });\n readyCallbacks.length = 0; // Clear array after execution\n };\n\n finalize().catch(() => {});\n};\n\ninitializeHsMain();\n"],"file":"main.js"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hortonstudio/main",
3
- "version": "1.9.21",
3
+ "version": "1.9.23",
4
4
  "description": "Animation and utility library for client websites",
5
5
  "main": "dist/main.js",
6
6
  "type": "module",