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v5.48.0.\n * Original file: /npm/bleedblend@2.1.0/src/auto.mjs\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","/**\n * bleedblend v2 — utils (ESM)\n *\n * Smart iOS Safari chrome tinting helpers. The exported `createBleedblendAuto()`\n * controller and the `bleedblend/auto` entry give you a zero-config setup that\n * paints status bar + URL bar to match the page content at each viewport\n * edge — gradient interp, opaque sections, page-end overscroll all handled.\n *\n * See HANDOFF.md (in repo root during dev) for the mental model and the\n * iOS 26 quirks this library navigates around.\n */\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Color utilities\n// ─────────────────────────────────────────────────────────────────────────────\n\n// Last-resort normalizer for color values regex can't read — oklch(), lab(),\n// lch(), hwb(), color(display-p3 …), named keywords, etc. getComputedStyle\n// serializes these verbatim (not down-converted to rgb), so we paint 1px and\n// read it back as sRGB. Works for ANY CSS color the browser can render.\n// DOM-only: returns null off-DOM (e.g. Node), keeping the pure path pure.\nlet _normCtx;\nfunction normalizeViaCanvas(str) {\n  if (typeof document === 'undefined') return null;\n  try {\n    if (!_normCtx) {\n      const cv = document.createElement('canvas');\n      cv.width = cv.height = 1;\n      _normCtx = cv.getContext('2d', { willReadFrequently: true });\n    }\n    _normCtx.clearRect(0, 0, 1, 1);\n    _normCtx.fillStyle = 'rgba(0,0,0,0)'; // invalid input leaves this → alpha 0\n    _normCtx.fillStyle = str;\n    _normCtx.fillRect(0, 0, 1, 1);\n    const d = _normCtx.getImageData(0, 0, 1, 1).data;\n    if (d[3] === 0) return null; // unparseable or fully transparent\n    return { r: d[0], g: d[1], b: d[2], a: d[3] / 255 };\n  } catch (e) {\n    return null;\n  }\n}\n\nexport function parseColor(str) {\n  if (!str) return null;\n  const s = str.trim();\n  if (s.startsWith('#')) {\n    const hex = s.slice(1);\n    if (hex.length === 3) {\n      return { r: parseInt(hex[0] + hex[0], 16), g: parseInt(hex[1] + hex[1], 16), b: parseInt(hex[2] + hex[2], 16), a: 1 };\n    }\n    if (hex.length === 6) {\n      return { r: parseInt(hex.slice(0, 2), 16), g: parseInt(hex.slice(2, 4), 16), b: parseInt(hex.slice(4, 6), 16), a: 1 };\n    }\n    if (hex.length === 8) {\n      return { r: parseInt(hex.slice(0, 2), 16), g: parseInt(hex.slice(2, 4), 16), b: parseInt(hex.slice(4, 6), 16), a: parseInt(hex.slice(6, 8), 16) / 255 };\n    }\n  }\n  const m = s.match(/rgba?\\(([^)]+)\\)/);\n  if (m) {\n    const parts = m[1].split(',').map((p) => p.trim());\n    return {\n      r: parseFloat(parts[0]),\n      g: parseFloat(parts[1]),\n      b: parseFloat(parts[2]),\n      a: parts[3] != null ? parseFloat(parts[3]) : 1,\n    };\n  }\n  return normalizeViaCanvas(s);\n}\n\nexport function parseColorWithAlpha(str) {\n  if (!str) return null;\n  const c = parseColor(str);\n  if (!c) return null;\n  if (str.trim().startsWith('rgba')) {\n    const m = str.match(/[\\d.]+/g);\n    if (m && m.length >= 4) c.a = parseFloat(m[3]);\n  }\n  return c;\n}\n\nexport function colorToRgb(c) {\n  return c ? 'rgb(' + Math.round(c.r) + ', ' + Math.round(c.g) + ', ' + Math.round(c.b) + ')' : null;\n}\n\nexport function colorToHex(c) {\n  if (!c) return null;\n  const h = (n) => Math.round(n).toString(16).padStart(2, '0');\n  return '#' + h(c.r) + h(c.g) + h(c.b);\n}\n\nexport function isOpaque(colorStr) {\n  const c = parseColor(colorStr);\n  return !!c && c.a >= 0.9;\n}\n\nexport function colorsClose(a, b, threshold = 8) {\n  if (!a || !b) return false;\n  return Math.abs(a.r - b.r) < threshold && Math.abs(a.g - b.g) < threshold && Math.abs(a.b - b.b) < threshold;\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Gradient parsing\n// ─────────────────────────────────────────────────────────────────────────────\n\n// Extract a leading CSS color token from a gradient stop: #hex, a function\n// color with balanced parens (rgb()/hsl()/oklch()/lab()/color() …), or a bare\n// named keyword. Lets parseGradient survive modern-syntax stops that\n// getComputedStyle leaves un-normalized (e.g. oklch / color(display-p3 …)).\nfunction leadingColorToken(p) {\n  if (p[0] === '#') {\n    const m = p.match(/^#[0-9a-fA-F]{3,8}/);\n    return m ? m[0] : null;\n  }\n  if (/^[a-zA-Z][\\w-]*\\(/.test(p)) {\n    let depth = 0;\n    for (let i = 0; i < p.length; i++) {\n      if (p[i] === '(') depth++;\n      else if (p[i] === ')') { depth--; if (depth === 0) return p.slice(0, i + 1); }\n    }\n    return null; // unbalanced parens\n  }\n  const id = p.match(/^[a-zA-Z]{2,}/);\n  return id ? id[0] : null;\n}\n\n// Parse a linear-gradient string into ordered stops { color, pos } where\n// pos is 0..1. Tolerates the form getComputedStyle returns (direction may be\n// dropped when it's the 180deg default).\nexport function parseGradient(bgImage) {\n  if (!bgImage || bgImage === 'none') return null;\n  const lg = bgImage.match(/linear-gradient\\(([\\s\\S]+)\\)/);\n  if (!lg) return null;\n  const inner = lg[1];\n  const parts = [];\n  let depth = 0;\n  let buf = '';\n  for (let i = 0; i < inner.length; i++) {\n    const ch = inner[i];\n    if (ch === '(') depth++;\n    else if (ch === ')') depth--;\n    if (ch === ',' && depth === 0) {\n      parts.push(buf);\n      buf = '';\n    } else buf += ch;\n  }\n  if (buf) parts.push(buf);\n  const stops = [];\n  for (const raw of parts) {\n    const p = raw.trim();\n    if (/^(\\d+(\\.\\d+)?(deg|turn|rad|grad)|to\\s+\\w+(\\s+\\w+)?)$/i.test(p)) continue;\n    const colorTok = leadingColorToken(p);\n    if (!colorTok) continue;\n    const color = parseColor(colorTok);\n    if (!color) continue;\n    const posMatch = p.slice(colorTok.length).match(/(-?\\d+(?:\\.\\d+)?)\\s*%/);\n    stops.push({ color, posPct: posMatch ? parseFloat(posMatch[1]) : null });\n  }\n  if (stops.length === 0) return null;\n  if (stops[0].posPct == null) stops[0].posPct = 0;\n  if (stops[stops.length - 1].posPct == null) stops[stops.length - 1].posPct = 100;\n  for (let i = 1; i < stops.length - 1; i++) {\n    if (stops[i].posPct != null) continue;\n    let next = i + 1;\n    while (next < stops.length && stops[next].posPct == null) next++;\n    const span = stops[next].posPct - stops[i - 1].posPct;\n    const step = span / (next - (i - 1));\n    for (let j = i; j < next; j++) stops[j].posPct = stops[i - 1].posPct + step * (j - (i - 1));\n  }\n  return stops.map((s) => ({ color: s.color, pos: s.posPct / 100 }));\n}\n\nexport function gradientColorAt(stops, progress) {\n  if (!stops || stops.length === 0) return null;\n  if (progress <= stops[0].pos) return stops[0].color;\n  if (progress >= stops[stops.length - 1].pos) return stops[stops.length - 1].color;\n  for (let i = 0; i < stops.length - 1; i++) {\n    const a = stops[i];\n    const b = stops[i + 1];\n    if (progress >= a.pos && progress <= b.pos) {\n      const span = b.pos - a.pos;\n      const t = span > 0 ? (progress - a.pos) / span : 0;\n      return {\n        r: a.color.r + t * (b.color.r - a.color.r),\n        g: a.color.g + t * (b.color.g - a.color.g),\n        b: a.color.b + t * (b.color.b - a.color.b),\n        a: 1,\n      };\n    }\n  }\n  return stops[stops.length - 1].color;\n}\n\nexport function gradientColorAtY(stops, y, viewportHeight) {\n  const vh = viewportHeight || window.innerHeight || 1;\n  const progress = Math.max(0, Math.min(1, y / vh));\n  return gradientColorAt(stops, progress);\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Safe area + viewport probes\n// ─────────────────────────────────────────────────────────────────────────────\n\n// Measure actual safe-area-inset in px. env() only falls back when undefined,\n// not when 0 — so we need an active probe (iPhone Mirroring reports 0).\nexport function measureInset(side) {\n  const probe = document.createElement('div');\n  probe.style.cssText =\n    'position:fixed;visibility:hidden;pointer-events:none;' +\n    side +\n    ':env(safe-area-inset-' +\n    side +\n    ',0px);';\n  document.body.appendChild(probe);\n  const v = parseFloat(getComputedStyle(probe)[side]) || 0;\n  probe.remove();\n  return v;\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Background fill detection\n// ─────────────────────────────────────────────────────────────────────────────\n\n// Detect the \"fill\" sitting behind page content — used as fallback when a\n// boundary probe lands in a transparent area. Priority: body::before fixed\n// gradient/solid > body > html.\n//   { kind: 'gradient', stops, isFixed }\n//   { kind: 'solid',    color }\n//   null\nexport function detectBackgroundFill() {\n  const before = getComputedStyle(document.body, '::before');\n  if (before.position === 'fixed' || before.position === 'absolute') {\n    const stops = parseGradient(before.backgroundImage);\n    if (stops) return { kind: 'gradient', stops, isFixed: true };\n    if (isOpaque(before.backgroundColor)) return { kind: 'solid', color: parseColor(before.backgroundColor) };\n  }\n  const bodyS = getComputedStyle(document.body);\n  const bodyG = parseGradient(bodyS.backgroundImage);\n  if (bodyG) return { kind: 'gradient', stops: bodyG, isFixed: bodyS.backgroundAttachment === 'fixed' };\n  if (isOpaque(bodyS.backgroundColor)) return { kind: 'solid', color: parseColor(bodyS.backgroundColor) };\n  const htmlS = getComputedStyle(document.documentElement);\n  const htmlG = parseGradient(htmlS.backgroundImage);\n  if (htmlG) return { kind: 'gradient', stops: htmlG, isFixed: htmlS.backgroundAttachment === 'fixed' };\n  if (isOpaque(htmlS.backgroundColor)) return { kind: 'solid', color: parseColor(htmlS.backgroundColor) };\n  return null;\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Composite color sampling at a viewport point\n// ─────────────────────────────────────────────────────────────────────────────\n\n// Sample the visually composited color at viewport (x, y). Walks up the DOM\n// from elementFromPoint, collects every translucent/opaque bg-color, then\n// alpha-composites them in stacking order. Returns parsed color or null if\n// no opaque base is found before reaching <html>. Hides ignoreIds while\n// sampling so we don't pick up our own tint.\nexport function sampleColorAt(x, y, ignoreIds = []) {\n  const saved = ignoreIds.map((id) => {\n    const el = document.getElementById(id);\n    if (!el) return null;\n    const d = el.style.display;\n    el.style.display = 'none';\n    return { el, d };\n  });\n  let element = document.elementFromPoint(x, y);\n  saved.forEach((s) => {\n    if (s) s.el.style.display = s.d;\n  });\n  if (!element) return null;\n\n  const stack = [];\n  while (element && element !== document.documentElement) {\n    const c = parseColorWithAlpha(window.getComputedStyle(element).backgroundColor);\n    if (c && c.a > 0.001) {\n      stack.push(c);\n      if (c.a >= 0.999) break;\n    }\n    element = element.parentElement;\n  }\n  if (stack.length === 0) return null;\n  if (stack[stack.length - 1].a < 0.999) return null;\n\n  let r = stack[stack.length - 1];\n  for (let i = stack.length - 2; i >= 0; i--) {\n    const fg = stack[i];\n    const a = fg.a;\n    r = {\n      r: fg.r * a + r.r * (1 - a),\n      g: fg.g * a + r.g * (1 - a),\n      b: fg.b * a + r.b * (1 - a),\n      a: 1,\n    };\n  }\n  return r;\n}\n\n// Color Safari tints chrome with NATURALLY (no tint override): body bg if\n// opaque, else html bg.\nexport function naturalSafariColor() {\n  const bodyBg = parseColorWithAlpha(getComputedStyle(document.body).backgroundColor);\n  if (bodyBg && bodyBg.a > 0.999) return bodyBg;\n  return parseColor(getComputedStyle(document.documentElement).backgroundColor);\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Last-opaque-section detection\n// ─────────────────────────────────────────────────────────────────────────────\n\nconst DEFAULT_SECTION_SELECTOR = 'main section, main > *, footer';\n\nexport function findLastOpaqueSection(selector = DEFAULT_SECTION_SELECTOR) {\n  const candidates = document.querySelectorAll(selector);\n  for (let i = candidates.length - 1; i >= 0; i--) {\n    const c = parseColorWithAlpha(getComputedStyle(candidates[i]).backgroundColor);\n    if (c && c.a > 0.999) return candidates[i];\n  }\n  return null;\n}\n\n// Is the element at viewport (xMid, y) inside `lastSection`?\nexport function isInsideSection(y, lastSection, ignoreIds = []) {\n  if (!lastSection) return false;\n  const saved = ignoreIds.map((id) => {\n    const el = document.getElementById(id);\n    if (!el) return null;\n    const d = el.style.display;\n    el.style.display = 'none';\n    return { el, d };\n  });\n  let el = document.elementFromPoint(window.innerWidth / 2, y);\n  saved.forEach((s) => {\n    if (s) s.el.style.display = s.d;\n  });\n  while (el && el !== document.documentElement) {\n    if (el === lastSection) return true;\n    el = el.parentElement;\n  }\n  return false;\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// theme-color <meta>\n// ─────────────────────────────────────────────────────────────────────────────\n\nexport function setMetaThemeColor(hex) {\n  if (!hex) return;\n  const metas = document.querySelectorAll('meta[name=\"theme-color\"]');\n  if (metas.length === 0) {\n    const m = document.createElement('meta');\n    m.name = 'theme-color';\n    m.content = hex;\n    document.head.appendChild(m);\n  } else {\n    metas.forEach((m) => m.setAttribute('content', hex));\n  }\n}\n\n// ─────────────────────────────────────────────────────────────────────────────\n// Main controller — creates tints, runs the smart tinting state machine\n// ─────────────────────────────────────────────────────────────────────────────\n\nconst TINT_ACTIVE_PX = 12; // just above iOS Safari's 3px sampling threshold\n\nconst isIOS =\n  typeof navigator !== 'undefined' &&\n  (/iPad|iPhone|iPod/.test(navigator.userAgent) ||\n    (navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1));\n\nconst TINT_TOP_ID = 'bleedblend-tint-top';\nconst TINT_BOT_ID = 'bleedblend-tint-bottom';\nconst IGNORE_IDS = [TINT_TOP_ID, TINT_BOT_ID];\n\nfunction ensureTint(id, isTop) {\n  let el = document.getElementById(id);\n  if (el) return el;\n  el = document.createElement('div');\n  el.id = id;\n  el.style.cssText =\n    'position:fixed;left:0;width:100%;height:0;z-index:99999;' +\n    'pointer-events:none;-webkit-backdrop-filter:none;backdrop-filter:none;' +\n    'box-sizing:content-box;' +\n    (isTop ? 'top:0;' : 'bottom:0;');\n  document.body.appendChild(el);\n  return el;\n}\n\nfunction ensureBeforeOverride() {\n  let el = document.getElementById('bleedblend-before-override');\n  if (el) return el;\n  el = document.createElement('style');\n  el.id = 'bleedblend-before-override';\n  document.head.appendChild(el);\n  return el;\n}\n\n// One-time injection of CSS transitions on html / body / body::before\n// background so the page-end色 overwrite fades smoothly instead of snapping.\nfunction ensureTransitionStyle() {\n  let el = document.getElementById('bleedblend-transition-style');\n  if (el) return el;\n  el = document.createElement('style');\n  el.id = 'bleedblend-transition-style';\n  el.textContent =\n    'html, body { transition: background-color 400ms ease; } ' +\n    'body::before { transition: background 400ms ease; }';\n  document.head.appendChild(el);\n  return el;\n}\n\n/**\n * createBleedblendAuto — zero-config controller.\n *\n * Returns `{ update, destroy }`. Call once on page ready (or use\n * `bleedblend/auto` which calls this for you).\n *\n * Options:\n *   sectionSelector  CSS selector for opaque \"section\"-like elements used\n *                    to find the page-end section. Default:\n *                    'main section, main > *, footer'.\n *   onPageLoad       function(update). Called once at init; pass the\n *                    update function so frameworks (Astro, SvelteKit…)\n *                    can rerun bleedblend after their own page-transition\n *                    events. Example:\n *                      onPageLoad: (update) =>\n *                        document.addEventListener('astro:page-load', update)\n */\nexport function createBleedblendAuto(options = {}) {\n  if (typeof document === 'undefined') return { update() {}, destroy() {} };\n\n  const sectionSelector = options.sectionSelector || DEFAULT_SECTION_SELECTOR;\n  const cleanups = [];\n\n  function pickVisible(sel) {\n    const list = document.querySelectorAll(sel);\n    for (const el of list) {\n      if (el.hidden) continue;\n      const s = window.getComputedStyle(el);\n      if (s.display === 'none' || s.visibility === 'hidden') continue;\n      return el;\n    }\n    return null;\n  }\n\n  function colorAtY(y, fill, xMid) {\n    const probed = sampleColorAt(xMid, y, IGNORE_IDS);\n    if (probed) return { color: probed, source: 'section' };\n    if (fill && fill.kind === 'gradient') return { color: gradientColorAtY(fill.stops, y), source: 'gradient' };\n    if (fill && fill.kind === 'solid') return { color: fill.color, source: 'gradient' };\n    return null;\n  }\n\n  // Per-edge state resolution.\n  function resolveEdge(edge, userOwned, boundary, lastSection, probeY) {\n    if (userOwned) return { state: 'STICKY_OWNED', color: null };\n    if (edge === 'top') {\n      // Top永遠 SAFE_NATURAL: chrome top stays light/unobtrusive. Safari\n      // naturally samples top edge content — that's correct tinting without\n      // bleed intervention. Sticky-navs take STICKY_OWNED above.\n      return { state: 'SAFE_NATURAL', color: null };\n    }\n    if (!boundary) return { state: 'SAFE_NATURAL', color: null };\n    if (boundary.source === 'section') {\n      // Section reaches bottom edge. OVERRIDE tinting only if it's the LAST\n      // opaque section in DOM (page-end); mid-page sections shouldstep back\n      // so chrome tinting stays light via Safari's edge sampling.\n      if (isInsideSection(probeY, lastSection, IGNORE_IDS)) {\n        return { state: 'BLEED_OVERRIDE', color: boundary.color };\n      }\n      return { state: 'SAFE_NATURAL', color: boundary.color };\n    }\n    // boundary.source === 'gradient' → OVERRIDE tinting only if it would visually\n    // differ from Safari's natural tinting (html/body bg).\n    const natural = naturalSafariColor();\n    if (colorsClose(natural, boundary.color)) {\n      return { state: 'SAFE_NATURAL', color: boundary.color };\n    }\n    return { state: 'BLEED_OVERRIDE', color: boundary.color };\n  }\n\n  function applyTint(el, resolved, isTop) {\n    const padProp = isTop ? 'paddingTop' : 'paddingBottom';\n    if (resolved.state === 'BLEED_OVERRIDE') {\n      if (resolved.color) el.style.backgroundColor = colorToRgb(resolved.color);\n      el.style[padProp] = TINT_ACTIVE_PX + 'px';\n      el.style.display = 'block';\n    } else {\n      // SAFE / STICKY: display:none so Safari truly stops sampling our tint.\n      // (opacity:0 is still sampled per iOS 26 — must be display:none.)\n      el.style.display = 'none';\n      el.style[padProp] = '0px';\n    }\n  }\n\n  let rafScheduled = false;\n  function update() {\n    if (rafScheduled) return;\n    rafScheduled = true;\n    requestAnimationFrame(() => {\n      rafScheduled = false;\n      runUpdate();\n    });\n  }\n\n  function runUpdate() {\n    const topEl = ensureTint(TINT_TOP_ID, true);\n    const botEl = ensureTint(TINT_BOT_ID, false);\n    const beforeOverrideEl = ensureBeforeOverride();\n    ensureTransitionStyle();\n    const htmlEl = document.documentElement;\n\n    const userTop = pickVisible('.bleedblend-top:not(#' + TINT_TOP_ID + ')');\n    const userBottom = pickVisible('.bleedblend-bottom:not(#' + TINT_BOT_ID + ')');\n\n    const fill = detectBackgroundFill();\n\n    const safeTop = measureInset('top');\n    const safeTopPx = safeTop > 0 ? safeTop : 20;\n    const probeYTop = safeTopPx + 1;\n    const probeYBot = window.innerHeight - (TINT_ACTIVE_PX + 1);\n    const xMid = window.innerWidth / 2;\n\n    const topC = colorAtY(probeYTop, fill, xMid);\n    const botC = colorAtY(probeYBot, fill, xMid);\n\n    const lastSection = findLastOpaqueSection(sectionSelector);\n\n    const topResolved = resolveEdge('top', !!userTop, topC, lastSection, probeYTop);\n    const botResolved = resolveEdge('bottom', !!userBottom, botC, lastSection, probeYBot);\n\n    window.__bleedblend_top_state = topResolved.state;\n    window.__bleedblend_bot_state = botResolved.state;\n    window.__bleedblend_has_fixed = !!userTop;\n\n    if (!isIOS) {\n      topEl.style.display = 'none';\n      botEl.style.display = 'none';\n      htmlEl.style.backgroundColor = '';\n      document.body.style.backgroundColor = '';\n      beforeOverrideEl.textContent = '';\n      return;\n    }\n\n    applyTint(topEl, topResolved, true);\n    applyTint(botEl, botResolved, false);\n\n    // theme-color follows top probe (iOS 15-18 compat; iOS 26 ignores it).\n    const topHex = colorToHex(topC && topC.color);\n    if (topHex) setMetaThemeColor(topHex);\n\n    // Page-end overscroll tinting — body::before stretches into iOS rubber-band\n    // exposed area, so html bg alone isn't enough. Overwrite html, body,\n    // AND body::before together. Only when LAST opaque section is in view.\n    let lastSectionColor = null;\n    if (lastSection) {\n      const r = lastSection.getBoundingClientRect();\n      if (r.top < window.innerHeight && r.bottom > 0) {\n        lastSectionColor = parseColor(getComputedStyle(lastSection).backgroundColor);\n      }\n    }\n    if (lastSectionColor) {\n      const colorRgb = colorToRgb(lastSectionColor);\n      htmlEl.style.backgroundColor = colorRgb;\n      document.body.style.backgroundColor = colorRgb;\n      beforeOverrideEl.textContent = 'body::before { background: ' + colorRgb + ' !important; }';\n      const hex = colorToHex(lastSectionColor);\n      if (hex) setMetaThemeColor(hex);\n    } else {\n      htmlEl.style.backgroundColor = '';\n      document.body.style.backgroundColor = '';\n      beforeOverrideEl.textContent = '';\n    }\n  }\n\n  const passive = { passive: true };\n  window.addEventListener('scroll', update, passive);\n  window.addEventListener('resize', update, passive);\n  cleanups.push(() => window.removeEventListener('scroll', update));\n  cleanups.push(() => window.removeEventListener('resize', update));\n\n  if (window.visualViewport) {\n    window.visualViewport.addEventListener('resize', update, passive);\n    window.visualViewport.addEventListener('scroll', update, passive);\n    cleanups.push(() => window.visualViewport.removeEventListener('resize', update));\n    cleanups.push(() => window.visualViewport.removeEventListener('scroll', update));\n  }\n\n  const mq = window.matchMedia('(prefers-color-scheme: dark)');\n  const mqHandler = () => update();\n  if (mq.addEventListener) mq.addEventListener('change', mqHandler);\n  else if (mq.addListener) mq.addListener(mqHandler);\n  cleanups.push(() => {\n    if (mq.removeEventListener) mq.removeEventListener('change', mqHandler);\n    else if (mq.removeListener) mq.removeListener(mqHandler);\n  });\n\n  if (typeof options.onPageLoad === 'function') {\n    try {\n      options.onPageLoad(update);\n    } catch (e) {\n      // user-supplied hook errored — ignore\n    }\n  }\n\n  if (document.readyState === 'loading') {\n    document.addEventListener('DOMContentLoaded', update, { once: true });\n  } else {\n    update();\n  }\n\n  return {\n    update,\n    destroy() {\n      cleanups.forEach((fn) => {\n        try {\n          fn();\n        } catch (e) {}\n      });\n      cleanups.length = 0;\n      [TINT_TOP_ID, TINT_BOT_ID].forEach((id) => {\n        const el = document.getElementById(id);\n        if (el) el.remove();\n      });\n      const before = document.getElementById('bleedblend-before-override');\n      if (before) before.remove();\n      const transition = document.getElementById('bleedblend-transition-style');\n      if (transition) transition.remove();\n      document.documentElement.style.backgroundColor = '';\n      document.body.style.backgroundColor = '';\n    },\n  };\n}\n\nexport default createBleedblendAuto;\n","/**\n * bleedblend/auto — zero-config entry.\n *\n *   import 'bleedblend/auto';\n *\n * That's it. As soon as this module loads it spins up a bleedblend controller\n * that watches scroll / resize / visualViewport and paints iOS Safari's\n * status bar + URL bar to match the page content at each viewport edge.\n *\n * If you need to pass options or grab the controller handle, use\n * `createBleedblendAuto()` from `bleedblend/utils` instead:\n *\n *   import { createBleedblendAuto } from 'bleedblend/utils';\n *   const bleed = createBleedblendAuto({\n *     onPageLoad: (update) =>\n *       document.addEventListener('astro:page-load', update),\n *   });\n *   // later: bleed.destroy();\n */\n\nimport { createBleedblendAuto } from './utils.mjs';\n\nif (typeof window !== 'undefined') {\n  window.__bleedblend_auto = createBleedblendAuto();\n}\n"]}