# Spin the Wheel 1.2.0

## 🚀 Key Features & Updates

- Replace prefix-based exclusions with fixed path inclusion: show the launcher and popup only when the pathname contains `/s/`, `/c/`, or `/p/` at any position, or is exactly `/` or `/{locale}`.
- Read the full live `NEXT_LOCALE` cookie for locale-home matching on each route check, including in debug mode. Spin and coupon cookies remain bypassed in debug mode.
- Keep the local JSON preview on an included `/s/gtm-wheel-preview` route.
- Add a keyboard-accessible launcher close control with a 20px visible circle, 10px cross, and 24px clickable area. The cross and border stay grey (`#666666`), including on hover. It sits above the wheel at `top: -28px; right: 0`, with a 4px gap between the clickable area and wheel. Closing hides the launcher by default; optional collapsed controls reopen the popup and emit `bubble_open_popup`. State survives SPA navigation and resets on reload. All states follow the same route inclusion rules.
- Show the close control on launcher hover or keyboard focus for fine-pointer, hover-capable devices; keep it visible on touch devices.
- Campaign `config.launcher.closeBehavior` selects `hide` (default: hide until page reload), `half-wheel` (half the launcher image on the left edge), or `half-circle` (fixed 32px-wide, 64px-high left-edge half-circle with a white reopen arrow). The half-circle uses `config.theme.primary`, defaulting to `#3643BA`. Both collapsed modes preserve the configured vertical edge and offset; activating either restores the bubble and opens the popup. Unknown values fail validation. Configure the existing Contentful `config` JSON field; no migration is required.

## ⚠️ Important Behavioral Changes | Breaking Changes

- `config.excludedPaths` is ignored; the fixed inclusion rules apply instead. It can remain in campaigns shared with older tags. Extra keys in campaign and promo configuration, including nested theme, launcher, and text-style objects, do not prevent initialization. Invalid values for supported settings still fail validation.
- Pages outside the inclusion rules no longer show the wheel, even when `templateUrl` matches. This includes both `/cart` and `/en-TH/cart`.
- Matching is case-sensitive and exact for home paths: `NEXT_LOCALE=en-TH` includes `/en-TH`, not `/en-TH/` or another locale home. Segment matching requires both slashes, so `/s` alone is not included.
- If `NEXT_LOCALE` is missing or empty, no locale home is inferred. `/` and paths containing `/s/`, `/c/`, or `/p/` remain included. The separate Contentful language selection still defaults to `en`.

## ℹ️ Other Notes | Information

- No replacement path configuration is required or supported; the inclusion rules above are fixed.
- Update the installed GTM script URL to `/modules/spin-the-wheel/1.2.0.js` after preparing campaign configuration. Older versioned artifacts remain unchanged.
