# UltraCache frontend JavaScript helper assets

This directory contains UltraCache-owned frontend JavaScript helpers that are migrated from raw inline output to WordPress-registered scripts.

Migrated helpers are kept as human-readable source files. They are not minified, compiled, or generated by a JavaScript build tool.

## Current migrated helpers

- `mailerlite-lazy-nonce.js` — Lazy MailerLite nonce refresh helper enqueued through `wp_enqueue_scripts` with WordPress-native script APIs.
- `runtime-js-scan-collector.js` — Runtime JavaScript scanner collector enqueued only for verified scan requests through `wp_enqueue_scripts` with configuration passed by `wp_add_inline_script()`.
- `delayed-js-loader.js` — Delayed JavaScript release loader enqueued through `wp_enqueue_scripts` when delayed JS features are active, with runtime configuration passed by `wp_add_inline_script()`.

Additional frontend helpers will be migrated in separate staged versions as they are moved from final HTML rewriting to WordPress-registered helper assets.

- `runtime-font-css-map.js` — Runtime font CSS href rewrite helper enqueued through `wp_enqueue_scripts`, with mapping configuration passed by `wp_add_inline_script()`.
- `font-display-cssom-patch.js` — Runtime CSSOM font-display patch helper enqueued through `wp_enqueue_scripts`.
- `dynamic-icon-font-delay.js` — Intercepts matching same-origin dynamically inserted icon-font stylesheets before activation, adds `font-display: swap` through CSSOM, and exposes aggregate timing in `window.ultracacheIconFontDelayTiming`.
- `woocommerce-cart-fragments-delay.js` — Optional WooCommerce cart-fragments AJAX delay helper enqueued through `wp_enqueue_scripts`, with timing configuration passed by `wp_add_inline_script()`.
- `lcp-observer.js` — Lightweight frontend LCP discovery helper. It sends one page-scoped observation per eligible visit, skips query-string URLs, expired discovery periods, and locked page/viewport mappings, and supports public or administrator-only discovery periods.
