<
link rel="stylesheet" media="all" onload="this.media='all'" id="ecom-vendors-slider_css" href="https://cdn.ecomposer.app/vendors/css/ecom-swiper@11.css" />
/** @description storefront main bundle asset url */
const ECOMSEND_MAIN_SCRIPT_URL = 'https://cdn.shopify.com/extensions/019e5ed4-05ab-7270-b5f5-a246fd0d5eaa/ecomsend-149/assets/ecomsend.js'
/** @description storefront style asset url */
const ECOMSEND_MAIN_STYLE_URL = 'https://cdn.shopify.com/extensions/019e5ed4-05ab-7270-b5f5-a246fd0d5eaa/ecomsend-149/assets/style.css'
/** @description storefront wasm asset url for runtime signature module */
const ECOMSEND_WASM_ASSET_URL = 'https://cdn.shopify.com/extensions/019e5ed4-05ab-7270-b5f5-a246fd0d5eaa/ecomsend-149/assets/client_safe.wasm'
/** @description fallback delay when requestIdleCallback is unavailable */
const ECOMSEND_IDLE_TIMEOUT_MS = 800
/** @description user interaction events used to trigger lazy init earlier */
const ECOMSEND_INTERACTION_EVENTS = ["pointerdown", "keydown", "touchstart"]
/** @description global flag key for emergency immediate loading */
const ECOMSEND_FORCE_IMMEDIATE_FLAG = window.EcomSendApps?.forceImmediateLoad === true
/** @description create main stylesheet node for storefront runtime */
function createEcomSendMainStyleEle() {
const ecomsendMainStyleEle = document.createElement("link")
ecomsendMainStyleEle.rel = "stylesheet"
ecomsendMainStyleEle.href = ECOMSEND_MAIN_STYLE_URL
ecomsendMainStyleEle.dataset.ecomsendTag = "main-style"
return ecomsendMainStyleEle
}
/** @description append runtime stylesheet exactly once */
function ensureEcomSendMainStyleLoaded() {
if (document.querySelector('link[data-ecomsend-tag="main-style"]')) {
return
}
const ecomsendMainStyleEle = createEcomSendMainStyleEle()
document.head.appendChild(ecomsendMainStyleEle)
}
/** @description remove interaction listeners after first lazy-init trigger */
function clearInteractionListeners() {
ECOMSEND_INTERACTION_EVENTS.forEach((eventName) => {
window.removeEventListener(eventName, scheduleMainBundleLoad)
})
}
/** @description run low-priority task via idle callback with timeout fallback */
function scheduleLowPriorityTask(taskRunner, timeoutMs) {
if (window.requestIdleCallback) {
window.requestIdleCallback(() => {
taskRunner()
}, { timeout: timeoutMs })
return
}
window.setTimeout(() => {
taskRunner()
}, timeoutMs)
}
/** @description load main storefront bundle once and keep rollback override */
function loadEcomsendMainBundle() {
if (window.__ecomsendMainBundleLoaded) {
return
}
window.__ecomsendMainBundleLoaded = true
clearInteractionListeners()
/** @description ensure storefront runtime css is loaded together with main bundle */
ensureEcomSendMainStyleLoaded()
const ecomsendMainScriptEle = document.createElement("script")
ecomsendMainScriptEle.src = ECOMSEND_MAIN_SCRIPT_URL
ecomsendMainScriptEle.async = true
ecomsendMainScriptEle.dataset.ecomsendTag = "main-script"
document.body.appendChild(ecomsendMainScriptEle)
}
/** @description schedule heavy bundle with idle-first strategy to reduce main-thread contention */
function scheduleMainBundleLoad() {
if (window.__ecomsendMainBundleLoadScheduled) {
return
}
/** @description dedupe idle scheduling from DOMContentLoaded and first interactions */
window.__ecomsendMainBundleLoadScheduled = true
if (ECOMSEND_FORCE_IMMEDIATE_FLAG) {
loadEcomsendMainBundle()
return
}
scheduleLowPriorityTask(loadEcomsendMainBundle, ECOMSEND_IDLE_TIMEOUT_MS)
}
/** @description cache marketing params for pixel/report flows before heavy bundle starts */
function cacheMarketingParams() {
const urlParams = new URLSearchParams(window.location.search)
const marketingId = urlParams.get("ec_marketing_id")
const ecEmailId = urlParams.get("ec_email_id")
const ecMarketingSign = urlParams.get("ec_marketing_sign")
if (marketingId && window.localStorage) {
window.localStorage.setItem("ec_marketing_id", marketingId)
}
if (ecEmailId && window.localStorage) {
window.localStorage.setItem("ec_email_id", ecEmailId)
}
if (ecMarketingSign && window.localStorage) {
window.localStorage.setItem("ec_marketing_sign", ecMarketingSign)
}
}
try {
cacheMarketingParams()
} catch (e) {}
/** @description inject wasm asset url into shared namespace before main bundle executes */
window.EcomSendApps = window.EcomSendApps || {}
window.EcomSendApps.wasmURL = ECOMSEND_WASM_ASSET_URL
ECOMSEND_INTERACTION_EVENTS.forEach((eventName) => {
window.addEventListener(eventName, scheduleMainBundleLoad, { once: true, passive: true })
})
if (document.readyState === "loading") {
document.addEventListener("DOMContentLoaded", scheduleMainBundleLoad, { once: true })
} else {
scheduleMainBundleLoad()
}
window.shopLocale = 'en'