{"version":3,"sources":["jsdelivr-header.js","/gh/willmyerscode/accessibility-widget@1.0.2/accessibilityWidget.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,ACGA,MAAM,sBACF,kBAAoB,uBACpB,kBAAoB,6BAEpB,gBAAO,CAAU,EAAM,EAAS,CAAC,EAAG,EAAO,UACzC,EAAK,cACH,IAAI,YAAY,MAAM,sBAAsB,aAAa,IAAQ,CAC/D,SACA,SAAS,IAGf,CAGA,qBAAuB,CAAC,IAAK,IAAK,IAAK,IAAK,KAC5C,uBAAyB,CAAC,KAAM,IAAK,IAAK,IAAK,KAC/C,0BAA4B,CAAC,KAAM,SAAU,QAAS,SAAU,SAChE,uBAAyB,CAAC,KAAM,IAAM,GAAK,IAAM,GAEjD,aAAe,CACb,SACE,4SACF,SACE,uQACF,WACE,2OACF,cACE,4UACF,SACE,yMACF,WACE,2QACF,OACE,yKACF,UACE,2PACF,WACE,0MACF,OACE,iKACF,MACE,iMACF,MACE,6IAGJ,gBAAkB,CAChB,CAAE,IAAK,WAAY,MAAO,YAAa,KAAM,QAAS,MAAO,GAC7D,CAAE,IAAK,aAAc,MAAO,cAAe,KAAM,QAAS,MAAO,GACjE,CAAE,IAAK,gBAAiB,MAAO,iBAAkB,KAAM,QAAS,MAAO,GACvE,CAAE,IAAK,WAAY,MAAO,yBAA0B,KAAM,UAC1D,CAAE,IAAK,aAAc,MAAO,cAAe,KAAM,UACjD,CAAE,IAAK,SAAU,MAAO,gBAAiB,KAAM,UAC/C,CAAE,IAAK,YAAa,MAAO,YAAa,KAAM,UAC9C,CAAE,IAAK,aAAc,MAAO,aAAc,KAAM,QAAS,MAAO,GAChE,CAAE,IAAK,SAAU,MAAO,aAAc,KAAM,WAG9C,oBAAsB,CACpB,SAAU,EACV,WAAY,EACZ,cAAe,EACf,UAAU,EACV,YAAY,EACZ,QAAQ,EACR,WAAW,EACX,WAAY,EACZ,QAAQ,GAGV,WAAA,CAAY,EAAW,CAAC,GACtB,K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UAAU,WAClC,GAMF,WAIE,SAAS,IAEP,GAAI,SAAS,KAAK,UAAU,SAAS,wBAAyB,OAC9D,GAAI,OAAO,wBAAyB,OACpC,MAAM,EAAW,OAAO,+BAAiC,CAAC,EAC1D,OAAO,wBAA0B,IAAI,sBAAsB,EAC7D,CATI,OAAO,8BACX,OAAO,6BAA8B,EAUT,YAAxB,SAAS,WACX,SAAS,iBAAiB,mBAAoB,GAE9C,IAEH,CAjBD","file":"/gh/willmyerscode/accessibility-widget@1.0.2/accessibilityWidget.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.48.0.\n * Original file: /gh/willmyerscode/accessibility-widget@1.0.2/accessibilityWidget.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","/**\n * Accessibility Widget Plugin for Squarespace\n * A floating (or footer) accessibility toolbar that lets visitors adjust\n * font size, line height, letter spacing, dyslexia-friendly font, hidden\n * images, inverted colors, greyscale, saturation and cursor size. Selections persist\n * across pages and return visits via localStorage.\n * Copyright Will-Myers.com\n **/\n\nclass WMAccessibilityWidget {\n    static pluginName = 'accessibility-widget';\n    static storageKey = 'wmAccessibilityWidgetState';\n  \n    static emitEvent(type, detail = {}, elem = document) {\n      elem.dispatchEvent(\n        new CustomEvent(`wm-${WMAccessibilityWidget.pluginName}${type}`, {\n          detail,\n          bubbles: true\n        })\n      );\n    }\n  \n    /* Step tables. Index 0 is always the \"off\" / default state. */\n    static fontSizeSteps = [100, 130, 160, 190, 220]; // % applied to <html>\n    static lineHeightSteps = [null, 1.6, 1.9, 2.3, 2.7];\n    static letterSpacingSteps = [null, '0.05em', '0.1em', '0.15em', '0.2em'];\n    static saturationSteps = [null, 0.75, 0.5, 0.25, 0];\n  \n    static icons = {\n      launcher:\n        '<svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><circle cx=\"12\" cy=\"4\" r=\"1.7\" fill=\"currentColor\" stroke=\"none\"/><path d=\"M4 8.5c2.5.9 5 1.3 8 1.3s5.5-.4 8-1.3\"/><path d=\"M12 9.8V15\"/><path d=\"M8 20.5l4-5.5 4 5.5\"/></svg>',\n      fontSize:\n        '<svg viewBox=\"0 0 24 24\"><text x=\"1.5\" y=\"19\" font-family=\"Arial, sans-serif\" font-weight=\"700\" font-size=\"16\" fill=\"currentColor\">A</text><text x=\"12.5\" y=\"19\" font-family=\"Arial, sans-serif\" font-weight=\"700\" font-size=\"10\" fill=\"currentColor\">A</text></svg>',\n      lineHeight:\n        '<svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M9 6h11M9 12h11M9 18h11\"/><path d=\"M4 4v16\"/><path d=\"M2 6l2-2 2 2\"/><path d=\"M2 18l2 2 2-2\"/></svg>',\n      letterSpacing:\n        '<svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><text x=\"2\" y=\"13\" font-family=\"Arial, sans-serif\" font-weight=\"700\" font-size=\"12\" fill=\"currentColor\" stroke=\"none\">A A</text><path d=\"M3 20h18\"/><path d=\"M5 18l-2 2 2 2\"/><path d=\"M19 18l2 2-2 2\"/></svg>',\n      dyslexia:\n        '<svg viewBox=\"0 0 24 24\"><text x=\"12\" y=\"19\" text-anchor=\"middle\" font-family=\"\\'WM OpenDyslexic\\', \\'Comic Sans MS\\', sans-serif\" font-weight=\"700\" font-size=\"20\" fill=\"currentColor\">f</text></svg>',\n      hideImages:\n        '<svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><rect x=\"3\" y=\"3\" width=\"18\" height=\"18\" rx=\"2.5\"/><circle cx=\"8.5\" cy=\"8.5\" r=\"1.4\"/><path d=\"M21 15l-5-5-6 6\"/><path d=\"M3 3l18 18\"/></svg>',\n      invert:\n        '<svg viewBox=\"0 0 24 24\"><circle cx=\"12\" cy=\"12\" r=\"9\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"/><path d=\"M12 3a9 9 0 0 0 0 18z\" fill=\"currentColor\"/></svg>',\n      greyscale:\n        '<svg viewBox=\"0 0 24 24\"><circle cx=\"12\" cy=\"12\" r=\"9\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\"/><path d=\"M12 3a9 9 0 0 1 0 18z\" fill=\"currentColor\" opacity=\"0.45\"/><path d=\"M12 3a9 9 0 0 0 0 18\" fill=\"currentColor\" opacity=\"0.15\"/></svg>',\n      saturation:\n        '<svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M12 3c3.8 4.8 6 8 6 10.8a6 6 0 0 1-12 0C6 11 8.2 7.8 12 3z\"/></svg>',\n      cursor:\n        '<svg viewBox=\"0 0 24 24\"><path d=\"M5 2.5l6.5 17 2.2-6.3 6.3-2.2z\" fill=\"currentColor\" stroke=\"currentColor\" stroke-width=\"1.2\" stroke-linejoin=\"round\"/></svg>',\n      reset:\n        '<svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><path d=\"M3.5 12a8.5 8.5 0 1 0 2.9-6.4\"/><path d=\"M3 4v4h4\"/></svg>',\n      close:\n        '<svg viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\"><path d=\"M6 6l12 12M18 6L6 18\"/></svg>'\n    };\n  \n    static features = [\n      { key: 'fontSize', label: 'Font Size', type: 'level', steps: 5 },\n      { key: 'lineHeight', label: 'Line Height', type: 'level', steps: 5 },\n      { key: 'letterSpacing', label: 'Letter Spacing', type: 'level', steps: 5 },\n      { key: 'dyslexia', label: 'Dyslexia Friendly Font', type: 'toggle' },\n      { key: 'hideImages', label: 'Hide Images', type: 'toggle' },\n      { key: 'invert', label: 'Invert Colors', type: 'toggle' },\n      { key: 'greyscale', label: 'Greyscale', type: 'toggle' },\n      { key: 'saturation', label: 'Saturation', type: 'level', steps: 5 },\n      { key: 'cursor', label: 'Big Cursor', type: 'toggle' }\n    ];\n  \n    static defaultState = {\n      fontSize: 0,\n      lineHeight: 0,\n      letterSpacing: 0,\n      dyslexia: false,\n      hideImages: false,\n      invert: false,\n      greyscale: false,\n      saturation: 0,\n      cursor: false\n    };\n  \n    constructor(settings = {}) {\n      this.settings = {\n        widgetPosition: 'floating', // 'floating' | 'footer'\n        widgetSide: 'right', // 'right' | 'left'\n        ...settings\n      };\n      this.pluginName = WMAccessibilityWidget.pluginName;\n      this.state = this.loadState();\n      this.contentRoot = this.resolveContentRoot();\n      this.isOpen = false;\n      this.root = null;\n      this.launcher = null;\n      this.panel = null;\n      this.tiles = {};\n      this.boundOnDocumentClick = null;\n      this.boundOnKeydown = null;\n      this.init();\n    }\n  \n    init() {\n      WMAccessibilityWidget.emitEvent(':beforeInit');\n      this.buildWidget();\n      this.bindEvents();\n      this.applyState();\n      this.syncUI();\n      WMAccessibilityWidget.emitEvent(':afterInit', { el: this.root });\n    }\n  \n    /* ================================\n       STATE / PERSISTENCE\n       ================================ */\n  \n    loadState() {\n      const base = { ...WMAccessibilityWidget.defaultState };\n      try {\n        const saved = window.localStorage.getItem(WMAccessibilityWidget.storageKey);\n        if (!saved) return base;\n        const parsed = JSON.parse(saved);\n        return { ...base, ...parsed };\n      } catch (error) {\n        console.warn(`[${WMAccessibilityWidget.pluginName}] Could not read saved settings`, error);\n        return base;\n      }\n    }\n  \n    saveState() {\n      try {\n        window.localStorage.setItem(\n          WMAccessibilityWidget.storageKey,\n          JSON.stringify(this.state)\n        );\n      } catch (error) {\n        console.warn(`[${WMAccessibilityWidget.pluginName}] Could not save settings`, error);\n      }\n    }\n  \n    resolveContentRoot() {\n      // Filters (invert/saturate) and hidden images are scoped to the site\n      // content so the widget UI itself is never affected.\n      const selectors = ['#siteWrapper', '.site-wrapper', '#site', '#page', 'main'];\n      for (const selector of selectors) {\n        const el = document.querySelector(selector);\n        if (el) return el;\n      }\n      return document.body;\n    }\n  \n    /* ================================\n       DOM BUILDING\n       ================================ */\n  \n    createEl(tag, className, attrs = {}) {\n      const el = document.createElement(tag);\n      if (className) el.className = className;\n      Object.entries(attrs).forEach(([key, value]) => el.setAttribute(key, value));\n      return el;\n    }\n  \n    buildWidget() {\n      const position = this.settings.widgetPosition === 'footer' ? 'footer' : 'floating';\n      const side = this.settings.widgetSide === 'left' ? 'left' : 'right';\n  \n      this.root = this.createEl('div', `wm-accessibility-widget wm-accessibility-widget--${position} wm-accessibility-widget--${side}`);\n      this.root.setAttribute('data-wm-plugin', this.pluginName);\n\n      this.panel = this.buildPanel();\n      this.launcher = this.buildLauncher(position);\n  \n      this.root.appendChild(this.panel);\n      this.root.appendChild(this.launcher);\n  \n      // Appended to <body>, kept outside the content root so filters/hidden\n      // images never apply to the widget itself.\n      document.body.appendChild(this.root);\n    }\n  \n    buildLauncher(position) {\n      const launcher = this.createEl('button', 'wm-accessibility-widget-launcher', {\n        type: 'button',\n        'aria-haspopup': 'dialog',\n        'aria-expanded': 'false',\n        'aria-label': 'Open accessibility settings'\n      });\n  \n      const icon = this.createEl('span', 'wm-accessibility-widget-launcher__icon');\n      icon.innerHTML = WMAccessibilityWidget.icons.launcher;\n      launcher.appendChild(icon);\n  \n      if (position === 'footer') {\n        const label = this.createEl('span', 'wm-accessibility-widget-launcher__label');\n        label.textContent = 'Accessibility';\n        launcher.appendChild(label);\n      }\n  \n      return launcher;\n    }\n  \n    buildPanel() {\n      const panel = this.createEl('div', 'wm-accessibility-widget-panel', {\n        role: 'dialog',\n        'aria-label': 'Accessibility settings',\n        'aria-hidden': 'true'\n      });\n  \n      const header = this.createEl('div', 'wm-accessibility-widget-panel__header');\n      const title = this.createEl('h2', 'wm-accessibility-widget-panel__title');\n      title.textContent = 'Accessibility';\n      const close = this.createEl('button', 'wm-accessibility-widget-panel__close', {\n        type: 'button',\n        'aria-label': 'Close accessibility settings'\n      });\n      close.innerHTML = WMAccessibilityWidget.icons.close;\n      close.addEventListener('click', () => this.closePanel());\n      header.appendChild(title);\n      header.appendChild(close);\n  \n      const grid = this.createEl('div', 'wm-accessibility-widget-grid');\n      WMAccessibilityWidget.features.forEach((feature) => {\n        const tile = this.buildTile(feature);\n        grid.appendChild(tile);\n      });\n  \n      const reset = this.createEl('button', 'wm-accessibility-widget-reset', { type: 'button' });\n      const resetIcon = this.createEl('span', 'wm-accessibility-widget-reset__icon');\n      resetIcon.innerHTML = WMAccessibilityWidget.icons.reset;\n      const resetLabel = this.createEl('span', 'wm-accessibility-widget-reset__label');\n      resetLabel.textContent = 'Reset settings';\n      reset.appendChild(resetIcon);\n      reset.appendChild(resetLabel);\n      reset.addEventListener('click', () => this.resetAll());\n  \n      panel.appendChild(header);\n      panel.appendChild(grid);\n      panel.appendChild(reset);\n      return panel;\n    }\n  \n    buildTile(feature) {\n      const tile = this.createEl('button', 'wm-accessibility-widget-tile', {\n        type: 'button',\n        'data-key': feature.key,\n        'aria-pressed': 'false'\n      });\n  \n      const icon = this.createEl('span', 'wm-accessibility-widget-tile__icon');\n      icon.innerHTML = WMAccessibilityWidget.icons[feature.key];\n  \n      const label = this.createEl('span', 'wm-accessibility-widget-tile__label');\n      label.textContent = feature.label;\n  \n      tile.appendChild(icon);\n      tile.appendChild(label);\n  \n      if (feature.type === 'level') {\n        const level = this.createEl('span', 'wm-accessibility-widget-tile__level');\n        // steps includes the \"off\" state, so indicators = steps - 1\n        for (let i = 1; i < feature.steps; i += 1) {\n          const dot = this.createEl('span', 'wm-accessibility-widget-tile__dot');\n          level.appendChild(dot);\n        }\n        tile.appendChild(level);\n      }\n  \n      tile.addEventListener('click', () => this.toggleFeature(feature));\n      this.tiles[feature.key] = tile;\n      return tile;\n    }\n  \n    /* ================================\n       INTERACTION\n       ================================ */\n  \n    toggleFeature(feature) {\n      if (feature.type === 'level') {\n        const next = (this.state[feature.key] + 1) % feature.steps;\n        this.state[feature.key] = next;\n      } else {\n        this.state[feature.key] = !this.state[feature.key];\n      }\n      this.applyState();\n      this.syncUI();\n      this.saveState();\n      WMAccessibilityWidget.emitEvent(':change', { key: feature.key, state: { ...this.state } });\n    }\n  \n    resetAll() {\n      this.state = { ...WMAccessibilityWidget.defaultState };\n      this.applyState();\n      this.syncUI();\n      this.saveState();\n      WMAccessibilityWidget.emitEvent(':reset', { state: { ...this.state } });\n    }\n  \n    openPanel() {\n      this.isOpen = true;\n      this.root.classList.add('wm-accessibility-widget--open');\n      this.panel.setAttribute('aria-hidden', 'false');\n      this.launcher.setAttribute('aria-expanded', 'true');\n    }\n  \n    closePanel() {\n      this.isOpen = false;\n      this.root.classList.remove('wm-accessibility-widget--open');\n      this.panel.setAttribute('aria-hidden', 'true');\n      this.launcher.setAttribute('aria-expanded', 'false');\n    }\n  \n    togglePanel() {\n      if (this.isOpen) {\n        this.closePanel();\n      } else {\n        this.openPanel();\n      }\n    }\n  \n    bindEvents() {\n      this.launcher.addEventListener('click', () => this.togglePanel());\n  \n      this.boundOnDocumentClick = (event) => {\n        if (!this.isOpen) return;\n        if (this.root.contains(event.target)) return;\n        this.closePanel();\n      };\n      document.addEventListener('click', this.boundOnDocumentClick);\n  \n      this.boundOnKeydown = (event) => {\n        if (event.key === 'Escape' && this.isOpen) {\n          this.closePanel();\n          this.launcher.focus();\n        }\n      };\n      document.addEventListener('keydown', this.boundOnKeydown);\n    }\n  \n    /* ================================\n       APPLY SETTINGS TO THE PAGE\n       ================================ */\n  \n    applyState() {\n      this.applyFontSize();\n      this.applyLineHeight();\n      this.applyLetterSpacing();\n      this.applyDyslexia();\n      this.applyHideImages();\n      this.applyCursor();\n      this.applyFilters();\n    }\n  \n    applyFontSize() {\n      const percent = WMAccessibilityWidget.fontSizeSteps[this.state.fontSize] || 100;\n      if (percent === 100) {\n        document.documentElement.style.removeProperty('font-size');\n      } else {\n        document.documentElement.style.setProperty('font-size', `${percent}%`, 'important');\n      }\n    }\n  \n    applyLineHeight() {\n      const value = WMAccessibilityWidget.lineHeightSteps[this.state.lineHeight];\n      if (value) {\n        this.contentRoot.style.setProperty('--wm-accessibility-widget-line-height', value);\n        this.contentRoot.setAttribute('data-wm-accessibility-widget-line-height', '');\n      } else {\n        this.contentRoot.style.removeProperty('--wm-accessibility-widget-line-height');\n        this.contentRoot.removeAttribute('data-wm-accessibility-widget-line-height');\n      }\n    }\n  \n    applyLetterSpacing() {\n      const value = WMAccessibilityWidget.letterSpacingSteps[this.state.letterSpacing];\n      if (value) {\n        this.contentRoot.style.setProperty('--wm-accessibility-widget-letter-spacing', value);\n        this.contentRoot.setAttribute('data-wm-accessibility-widget-letter-spacing', '');\n      } else {\n        this.contentRoot.style.removeProperty('--wm-accessibility-widget-letter-spacing');\n        this.contentRoot.removeAttribute('data-wm-accessibility-widget-letter-spacing');\n      }\n    }\n  \n    applyDyslexia() {\n      if (this.state.dyslexia) {\n        this.contentRoot.setAttribute('data-wm-accessibility-widget-dyslexia', '');\n      } else {\n        this.contentRoot.removeAttribute('data-wm-accessibility-widget-dyslexia');\n      }\n    }\n  \n    applyHideImages() {\n      if (this.state.hideImages) {\n        this.contentRoot.setAttribute('data-wm-accessibility-widget-hide-images', '');\n      } else {\n        this.contentRoot.removeAttribute('data-wm-accessibility-widget-hide-images');\n      }\n    }\n  \n    applyCursor() {\n      if (this.state.cursor) {\n        document.documentElement.setAttribute('data-wm-accessibility-widget-cursor', '');\n      } else {\n        document.documentElement.removeAttribute('data-wm-accessibility-widget-cursor');\n      }\n    }\n  \n    applyFilters() {\n      const filters = [];\n      if (this.state.invert) filters.push('invert(1)');\n      if (this.state.greyscale) filters.push('grayscale(1)');\n      const saturation = WMAccessibilityWidget.saturationSteps[this.state.saturation];\n      if (saturation != null) filters.push(`saturate(${saturation})`);\n  \n      if (filters.length) {\n        this.contentRoot.style.setProperty('filter', filters.join(' '), 'important');\n        this.contentRoot.setAttribute('data-wm-accessibility-widget-filter', '');\n      } else {\n        this.contentRoot.style.removeProperty('filter');\n        this.contentRoot.removeAttribute('data-wm-accessibility-widget-filter');\n      }\n    }\n  \n    /* ================================\n       UI SYNC\n       ================================ */\n  \n    syncUI() {\n      WMAccessibilityWidget.features.forEach((feature) => {\n        const tile = this.tiles[feature.key];\n        if (!tile) return;\n        const value = this.state[feature.key];\n  \n        if (feature.type === 'level') {\n          const isActive = value > 0;\n          tile.classList.toggle('is-active', isActive);\n          tile.setAttribute('aria-pressed', String(isActive));\n          const dots = tile.querySelectorAll('.wm-accessibility-widget-tile__dot');\n          dots.forEach((dot, index) => {\n            dot.classList.toggle('is-filled', index < value);\n          });\n        } else {\n          tile.classList.toggle('is-active', !!value);\n          tile.setAttribute('aria-pressed', String(!!value));\n        }\n      });\n    }\n  \n    destroy() {\n      if (this.boundOnDocumentClick) {\n        document.removeEventListener('click', this.boundOnDocumentClick);\n      }\n      if (this.boundOnKeydown) {\n        document.removeEventListener('keydown', this.boundOnKeydown);\n      }\n      if (this.root) this.root.remove();\n      WMAccessibilityWidget.emitEvent(':destroy');\n    }\n  }\n  \n  /* ================================\n     INITIALIZATION\n     ================================ */\n  (function () {\n    if (window.__wmAccessibilityWidgetInit) return;\n    window.__wmAccessibilityWidgetInit = true;\n  \n    function start() {\n      // Don't inject the toolbar inside the Squarespace editor chrome.\n      if (document.body.classList.contains('sqs-edit-mode-active')) return;\n      if (window.__wmAccessibilityWidget) return;\n      const settings = window.wmAccessibilityWidgetSettings || {};\n      window.__wmAccessibilityWidget = new WMAccessibilityWidget(settings);\n    }\n  \n    if (document.readyState === 'loading') {\n      document.addEventListener('DOMContentLoaded', start);\n    } else {\n      start();\n    }\n  })();\n  \n"]}