accessibility-plugin-react 2.12.0 → 2.16.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -24,7 +24,7 @@ function styleInject(css, { insertAt } = {}) {
24
24
  }
25
25
 
26
26
  // src/styles/tailwind.css
27
- styleInject('.arap-root {\n --arap-surface: #fff;\n --arap-text: #111827;\n --arap-muted: #475569;\n --arap-border: #cbd5e1;\n --arap-divider: #e2e8f0;\n --arap-accent: #1d4ed8;\n --arap-accent-hover: #1e40af;\n --arap-selected: #eff6ff;\n --arap-control: #f8fafc;\n color-scheme: light;\n font: 15px/1.5 system-ui, sans-serif;\n color: var(--arap-text);\n text-align: left;\n letter-spacing: normal;\n}\n.arap-root *,\n.arap-root *::before,\n.arap-root *::after {\n box-sizing: border-box;\n}\n.arap-root button {\n font: inherit;\n cursor: pointer;\n color: inherit;\n text-transform: none;\n letter-spacing: normal;\n transition: background-color 0.15s, border-color 0.15s;\n}\n.arap-root button:disabled {\n opacity: 0.45;\n cursor: not-allowed;\n}\n.arap-root button:focus-visible,\n.arap-panel:focus-visible {\n outline: 3px solid var(--arap-accent);\n outline-offset: 3px;\n}\n.arap-root .arap-btn {\n position: fixed;\n z-index: 2147483001;\n bottom: max(16px, env(safe-area-inset-bottom));\n right: max(16px, env(safe-area-inset-right));\n width: 56px;\n height: 56px;\n padding: 12px;\n display: flex;\n align-items: center;\n justify-content: center;\n border: 2px solid var(--arap-surface);\n border-radius: 50%;\n background: var(--arap-accent);\n color: #fff;\n box-shadow: 0 4px 12px #0f172a26, 0 10px 24px #0f172a14;\n}\n.arap-root .arap-btn:hover {\n background: var(--arap-accent-hover);\n}\n.arap-root .arap-btn[data-position=left] {\n right: auto;\n left: max(16px, env(safe-area-inset-left));\n}\n.arap-root .arap-btn[data-position=top] {\n bottom: auto;\n top: max(16px, env(safe-area-inset-top));\n}\n.arap-root .arap-panel {\n position: fixed;\n z-index: 2147483000;\n bottom: max(88px, calc(env(safe-area-inset-bottom) + 72px));\n right: max(16px, env(safe-area-inset-right));\n width: min(400px, calc(100vw - 32px));\n max-height: calc(100vh - 120px);\n max-height: calc(100dvh - 120px - env(safe-area-inset-bottom));\n overflow: auto;\n overscroll-behavior: contain;\n scrollbar-width: thin;\n scrollbar-color: var(--arap-border) transparent;\n padding: 20px;\n border: 1px solid var(--arap-divider);\n border-radius: 16px;\n background: var(--arap-surface);\n box-shadow: 0 8px 16px #0f172a0d, 0 20px 48px #0f172a1a;\n}\n.arap-root .arap-panel[hidden] {\n display: none !important;\n}\n.arap-root .arap-panel[data-position=left] {\n right: auto;\n left: max(16px, env(safe-area-inset-left));\n}\n.arap-root .arap-panel[data-position=top] {\n bottom: auto;\n top: max(88px, calc(env(safe-area-inset-top) + 72px));\n}\n.arap-heading {\n display: flex;\n justify-content: space-between;\n align-items: flex-start;\n gap: 8px;\n padding-bottom: 18px;\n border-bottom: 1px solid var(--arap-divider);\n}\n.arap-heading-copy {\n min-width: 0;\n}\n.arap-heading h2 {\n margin: 0;\n font: 700 22px/1.3 system-ui, sans-serif;\n letter-spacing: -0.025em;\n color: var(--arap-text);\n overflow-wrap: anywhere;\n}\n.arap-description {\n margin: 6px 0 0;\n color: var(--arap-muted);\n font: 14px/1.5 system-ui, sans-serif;\n overflow-wrap: anywhere;\n}\n.arap-heading button {\n flex: none;\n width: 44px;\n height: 44px;\n margin-top: -6px;\n border: 1px solid transparent;\n border-radius: 8px;\n background: transparent;\n color: var(--arap-muted);\n font-size: 28px;\n line-height: 1;\n}\n.arap-heading button:hover {\n background: var(--arap-control);\n border-color: var(--arap-border);\n}\n.arap-feature {\n display: grid;\n grid-template-columns: minmax(0, 1fr) auto;\n align-items: center;\n gap: 10px 12px;\n padding: 18px 0;\n border-bottom: 1px solid var(--arap-divider);\n}\n.arap-feature:last-child {\n border: 0;\n padding-bottom: 0;\n}\n.arap-label {\n display: flex;\n align-items: center;\n gap: 10px;\n font-weight: 500;\n min-width: 0;\n overflow-wrap: anywhere;\n}\n.arap-icon {\n flex: none;\n width: 22px;\n height: 22px;\n display: inline-block;\n vertical-align: middle;\n}\n.arap-controls {\n display: flex;\n align-items: stretch;\n border: 1px solid var(--arap-border);\n border-radius: 9px;\n overflow: hidden;\n background: var(--arap-control);\n}\n.arap-root .arap-btn-sm {\n flex: none;\n width: 44px;\n height: 44px;\n border: 0;\n border-radius: 0;\n background: transparent;\n font-size: 22px;\n}\n.arap-root .arap-btn-sm:hover:not(:disabled) {\n background: var(--arap-selected);\n color: var(--arap-accent);\n}\n.arap-root .arap-controls button:focus-visible {\n outline-offset: -4px;\n}\n.arap-value {\n display: flex;\n align-items: center;\n justify-content: center;\n min-width: 56px;\n padding: 0 6px;\n text-align: center;\n font-weight: 600;\n border-inline: 1px solid var(--arap-divider);\n background: var(--arap-surface);\n}\n.arap-segmented {\n grid-column: 1 / -1;\n display: flex;\n flex-wrap: wrap;\n gap: 6px;\n min-width: 0;\n}\n.arap-root .arap-segment {\n flex: 1 1 auto;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 5px;\n min-width: 44px;\n min-height: 44px;\n padding: 8px 10px;\n border: 1px solid var(--arap-border);\n border-radius: 8px;\n background: var(--arap-control);\n color: var(--arap-muted);\n overflow-wrap: anywhere;\n}\n.arap-root .arap-segment:hover {\n background: var(--arap-selected);\n border-color: var(--arap-accent);\n}\n.arap-root .arap-segment-active {\n background: var(--arap-accent);\n color: #fff;\n border-color: var(--arap-accent);\n font-weight: 600;\n}\n.arap-root .arap-segment-active:hover {\n background: var(--arap-accent-hover);\n color: #fff;\n}\n.arap-check {\n flex: none;\n font-size: 15px;\n line-height: 1;\n}\n.arap-root .arap-toggle {\n position: relative;\n width: 56px;\n height: 44px;\n padding: 0;\n border: 0;\n border-radius: 10px;\n background: transparent;\n}\n.arap-toggle::before {\n content: "";\n position: absolute;\n inset: 6px 0;\n border: 2px solid #64748b;\n border-radius: 20px;\n background: #e2e8f0;\n}\n.arap-toggle-knob {\n position: absolute;\n top: 10px;\n left: 4px;\n width: 24px;\n height: 24px;\n border-radius: 50%;\n background: #475569;\n pointer-events: none;\n transition: transform 0.15s;\n}\n.arap-toggle-active::before {\n background: var(--arap-accent);\n border-color: var(--arap-accent);\n}\n.arap-toggle-active .arap-toggle-knob {\n transform: translateX(24px);\n background: #fff;\n}\n.arap-toggle-active .arap-toggle-knob::after {\n content: "\\2713";\n display: block;\n color: var(--arap-accent);\n font-size: 16px;\n font-weight: 700;\n line-height: 24px;\n text-align: center;\n}\n.arap-root .arap-toggle:hover::before {\n border-color: var(--arap-accent);\n}\n.arap-feature-reset {\n display: block;\n}\n.arap-root .arap-reset-btn {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 10px;\n width: 100%;\n min-height: 48px;\n padding: 10px;\n border: 1px solid var(--arap-border);\n border-radius: 10px;\n background: var(--arap-control);\n color: var(--arap-accent);\n font-weight: 600;\n}\n.arap-root .arap-reset-btn:hover {\n background: var(--arap-selected);\n border-color: var(--arap-accent);\n}\n@media (max-width: 380px) {\n .arap-root .arap-panel {\n padding: 16px;\n }\n .arap-heading h2 {\n font-size: 20px;\n }\n .arap-feature-stepper {\n grid-template-columns: minmax(0, 1fr);\n }\n .arap-controls {\n width: 100%;\n }\n .arap-value {\n flex: 1;\n }\n}\n@media (prefers-reduced-motion: reduce) {\n .arap-root *,\n .arap-root *::before,\n .arap-root *::after {\n transition: none !important;\n animation: none !important;\n }\n}\n@media (forced-colors: active) {\n .arap-root {\n --arap-surface: Canvas;\n --arap-text: CanvasText;\n --arap-muted: CanvasText;\n --arap-border: ButtonText;\n --arap-divider: ButtonText;\n --arap-accent: Highlight;\n --arap-control: Canvas;\n --arap-selected: Canvas;\n }\n .arap-root button[aria-pressed=true] {\n outline: 2px solid Highlight;\n outline-offset: -4px;\n }\n .arap-root .arap-segment-active {\n color: HighlightText;\n background: Highlight;\n }\n .arap-toggle::before {\n border-color: ButtonText;\n background: Canvas;\n }\n .arap-toggle-knob {\n background: ButtonText;\n }\n .arap-toggle-active .arap-toggle-knob {\n background: Highlight;\n }\n .arap-toggle-active .arap-toggle-knob::after {\n color: HighlightText;\n }\n}\n.arap-root .arap-panel {\n display: flex;\n flex-direction: column;\n overflow: visible;\n}\n.arap-heading {\n flex: none;\n}\n.arap-tools {\n flex: 1 1 auto;\n min-height: 0;\n overflow: auto;\n overscroll-behavior: contain;\n scrollbar-width: thin;\n scrollbar-color: var(--arap-border) transparent;\n padding: 0 3px;\n margin: 0 -3px;\n}\n.arap-tools:focus-visible {\n outline: 3px solid var(--arap-accent);\n outline-offset: -3px;\n}\n.arap-quick-actions {\n position: relative;\n flex: none;\n display: flex;\n align-items: center;\n gap: 8px;\n padding-top: 14px;\n margin-top: 8px;\n border-top: 1px solid var(--arap-divider);\n}\n.arap-actions {\n flex: 1;\n min-width: 0;\n}\n.arap-actions:empty {\n display: none;\n}\n.arap-actions .arap-feature-reset {\n padding: 0;\n margin: 0;\n border: 0;\n}\n.arap-root .arap-position-button,\n.arap-root .arap-position-default,\n.arap-root .arap-position-arrows button {\n min-width: 44px;\n min-height: 44px;\n padding: 8px 10px;\n border: 1px solid var(--arap-border);\n border-radius: 8px;\n background: var(--arap-control);\n color: var(--arap-accent);\n}\n.arap-root .arap-position-button:hover,\n.arap-root .arap-position-default:hover,\n.arap-root .arap-position-arrows button:hover {\n background: var(--arap-selected);\n border-color: var(--arap-accent);\n}\n.arap-position-popover {\n position: absolute;\n z-index: 1;\n bottom: calc(100% + 8px);\n left: 0;\n width: 100%;\n max-height: calc(100dvh - 160px);\n overflow: auto;\n padding: 14px;\n border: 1px solid var(--arap-border);\n border-radius: 12px;\n background: var(--arap-surface);\n box-shadow: 0 8px 24px #0f172a26;\n}\n.arap-position-popover[hidden] {\n display: none !important;\n}\n.arap-position-label {\n display: block;\n margin-bottom: 6px;\n font-weight: 600;\n}\n.arap-position-popover select {\n width: 100%;\n min-height: 44px;\n padding: 8px;\n border: 1px solid var(--arap-border);\n border-radius: 8px;\n font: inherit;\n color: var(--arap-text);\n background: var(--arap-surface);\n}\n.arap-position-popover select:focus-visible {\n outline: 3px solid var(--arap-accent);\n outline-offset: 2px;\n}\n.arap-position-arrows {\n display: flex;\n justify-content: space-between;\n gap: 6px;\n margin-top: 10px;\n}\n.arap-position-default {\n width: 100%;\n margin-top: 8px;\n}\n.arap-root .arap-btn[data-draggable=true] {\n touch-action: none;\n user-select: none;\n cursor: grab;\n}\n.arap-root .arap-btn[data-dragging=true] {\n cursor: grabbing;\n}\n.arap-root .arap-btn[data-corner$=left],\n.arap-root .arap-panel[data-corner$=left] {\n right: auto;\n left: max(16px, env(safe-area-inset-left));\n}\n.arap-root .arap-btn[data-corner$=right],\n.arap-root .arap-panel[data-corner$=right] {\n left: auto;\n right: max(16px, env(safe-area-inset-right));\n}\n.arap-root .arap-btn[data-corner^=top] {\n bottom: auto;\n top: max(16px, env(safe-area-inset-top));\n}\n.arap-root .arap-btn[data-corner^=bottom] {\n top: auto;\n bottom: max(16px, env(safe-area-inset-bottom));\n}\n.arap-root .arap-panel[data-corner^=top] {\n bottom: auto;\n top: max(88px, calc(env(safe-area-inset-top) + 72px));\n}\n.arap-root .arap-panel[data-corner^=bottom] {\n top: auto;\n bottom: max(88px, calc(env(safe-area-inset-bottom) + 72px));\n}\n.arap-sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip-path: inset(50%);\n white-space: nowrap;\n border: 0;\n}\n.arap-root .arap-skip-actions {\n position: absolute;\n top: 12px;\n left: 20px;\n width: 44px;\n height: 44px;\n clip-path: inset(50%);\n overflow: hidden;\n pointer-events: none;\n}\n.arap-root .arap-skip-actions:focus-visible {\n right: 20px;\n width: auto;\n height: auto;\n min-height: 44px;\n clip-path: none;\n pointer-events: auto;\n z-index: 2;\n padding: 8px;\n border: 1px solid var(--arap-accent);\n border-radius: 8px;\n background: var(--arap-surface);\n color: var(--arap-accent);\n}\n.arap-skip-to-main {\n position: fixed;\n top: 12px;\n left: 16px;\n z-index: 2147483647;\n width: 1px;\n height: 1px;\n margin: -1px;\n padding: 0;\n overflow: hidden;\n clip-path: inset(50%);\n white-space: nowrap;\n border: 0;\n pointer-events: none;\n font-family: inherit;\n font-size: 0.9375rem;\n font-weight: 600;\n text-decoration: none;\n color: var(--arap-accent, #008060);\n background: var(--arap-surface, #ffffff);\n border-radius: 8px;\n box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);\n}\n.arap-skip-to-main:focus,\n.arap-skip-to-main:focus-visible {\n width: auto;\n height: auto;\n min-height: 44px;\n margin: 0;\n padding: 10px 18px;\n clip-path: none;\n overflow: visible;\n white-space: normal;\n pointer-events: auto;\n border: 2px solid var(--arap-accent, #008060);\n outline: 3px solid var(--arap-accent, #008060);\n outline-offset: 3px;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n}\n@media (forced-colors: active) {\n .arap-skip-to-main {\n background: Canvas;\n color: CanvasText;\n border-color: Highlight;\n }\n .arap-skip-to-main:focus,\n .arap-skip-to-main:focus-visible {\n outline: 3px solid Highlight;\n }\n}\n@media (max-height: 480px) {\n .arap-root .arap-panel {\n top: max(16px, env(safe-area-inset-top)) !important;\n bottom: max(16px, env(safe-area-inset-bottom)) !important;\n max-height: calc(100dvh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom)) !important;\n padding: 8px;\n }\n .arap-heading {\n padding-bottom: 8px;\n }\n .arap-heading h2 {\n font-size: 18px;\n }\n .arap-heading button {\n margin-top: 0;\n }\n .arap-description {\n display: none;\n }\n .arap-quick-actions {\n padding-top: 8px;\n margin-top: 0;\n }\n .arap-root .arap-reset-btn {\n min-height: 44px;\n }\n .arap-root .arap-btn[data-open=true] {\n visibility: hidden;\n }\n .arap-position-popover {\n max-height: calc(100dvh - 96px);\n }\n}\n.arap-statement {\n flex: none;\n padding-top: 10px;\n text-align: center;\n}\n.arap-statement-link {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n min-height: 44px;\n padding: 6px 12px;\n color: var(--arap-accent);\n text-decoration: underline;\n text-underline-offset: 4px;\n font-size: 14px;\n font-weight: 500;\n border-radius: 8px;\n}\n.arap-statement-link:hover {\n color: var(--arap-accent-hover);\n background: var(--arap-selected);\n}\n.arap-statement-link:focus-visible {\n outline: 3px solid var(--arap-accent);\n outline-offset: 2px;\n}\n.arap-credits {\n display: flex;\n flex: none;\n flex-direction: column;\n gap: 2px;\n padding-top: 8px;\n color: var(--arap-muted);\n text-align: center;\n font-size: 11px;\n line-height: 1.4;\n}\n.arap-credits a {\n color: var(--arap-accent);\n text-decoration: underline;\n text-underline-offset: 2px;\n}\n.arap-credits a:hover {\n color: var(--arap-accent-hover);\n}\n.arap-credits a:focus-visible {\n outline: 2px solid var(--arap-accent);\n outline-offset: 2px;\n}\n.arap-root .arap-btn[data-large-controls=true] {\n width: 64px;\n height: 64px;\n min-width: 48px;\n min-height: 48px;\n}\n.arap-root .arap-panel[data-large-controls=true] {\n width: min(440px, calc(100vw - 32px));\n}\n.arap-root .arap-panel[data-large-controls=true] .arap-heading button {\n width: 48px;\n height: 48px;\n min-width: 48px;\n min-height: 48px;\n font-size: 32px;\n}\n.arap-root .arap-panel[data-large-controls=true] .arap-btn-sm {\n width: 48px;\n height: 48px;\n min-width: 48px;\n min-height: 48px;\n font-size: 24px;\n}\n.arap-root .arap-panel[data-large-controls=true] .arap-value {\n min-width: 64px;\n font-size: 16px;\n}\n.arap-root .arap-panel[data-large-controls=true] .arap-segment {\n min-width: 48px;\n min-height: 48px;\n padding: 10px 14px;\n font-size: 15px;\n}\n.arap-root .arap-panel[data-large-controls=true] .arap-toggle {\n width: 64px;\n height: 48px;\n}\n.arap-root .arap-panel[data-large-controls=true] .arap-toggle::before {\n inset: 8px 0;\n}\n.arap-root .arap-panel[data-large-controls=true] .arap-toggle-knob {\n top: 12px;\n}\n.arap-root .arap-panel[data-large-controls=true] .arap-toggle-active .arap-toggle-knob {\n transform: translateX(28px);\n}\n.arap-root .arap-panel[data-large-controls=true] .arap-reset-btn {\n min-height: 52px;\n font-size: 16px;\n padding: 12px;\n}\n.arap-root .arap-panel[data-large-controls=true] .arap-position-button,\n.arap-root .arap-panel[data-large-controls=true] .arap-position-default,\n.arap-root .arap-panel[data-large-controls=true] .arap-position-arrows button {\n min-width: 48px;\n min-height: 48px;\n font-size: 15px;\n}\n.arap-root .arap-panel[data-large-controls=true] .arap-position-popover select {\n min-height: 48px;\n font-size: 15px;\n}\n.arap-root .arap-panel[data-large-controls=true] .arap-statement-link {\n min-height: 48px;\n font-size: 15px;\n padding: 10px 16px;\n}\n.arap-root .arap-panel[data-large-controls=true] .arap-skip-actions {\n min-width: 48px;\n min-height: 48px;\n}\n.arap-feature-card {\n display: flex;\n flex-direction: column;\n align-items: stretch;\n gap: 12px;\n}\n.arap-card-header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 8px;\n}\n.arap-card-title {\n font-weight: 600;\n font-size: 15px;\n color: var(--arap-text);\n}\n.arap-card-desc {\n margin: 0;\n font-size: 13px;\n color: var(--arap-muted);\n line-height: 1.4;\n}\n.arap-status-badge {\n display: inline-flex;\n align-items: center;\n padding: 2px 8px;\n border-radius: 9999px;\n font-size: 11px;\n font-weight: 600;\n background: var(--arap-control);\n border: 1px solid var(--arap-border);\n color: var(--arap-muted);\n text-transform: uppercase;\n letter-spacing: 0.05em;\n}\n.arap-card-alert {\n display: flex;\n align-items: flex-start;\n gap: 8px;\n padding: 10px 12px;\n border-radius: 8px;\n font-size: 13px;\n line-height: 1.4;\n}\n.arap-alert-icon {\n flex: none;\n font-size: 16px;\n line-height: 1;\n}\n.arap-card-error {\n background: #fef2f2;\n border: 1px solid #fecaca;\n color: #991b1b;\n}\n.arap-card-unavailable {\n background: #f8fafc;\n border: 1px solid var(--arap-border);\n color: var(--arap-muted);\n}\n.arap-card-permission {\n background: #fffbeb;\n border: 1px solid #fde68a;\n color: #92400e;\n}\n.arap-permission-content {\n display: flex;\n flex-direction: column;\n gap: 6px;\n}\n.arap-permission-btn {\n align-self: flex-start;\n padding: 4px 10px;\n border: 1px solid #d97706;\n border-radius: 6px;\n background: #f59e0b;\n color: #fff;\n font-size: 12px;\n font-weight: 600;\n cursor: pointer;\n}\n.arap-permission-btn:hover {\n background: #d97706;\n}\n.arap-card-content {\n display: flex;\n flex-direction: column;\n gap: 8px;\n}\n.arap-choice-group {\n display: flex;\n flex-direction: column;\n gap: 6px;\n width: 100%;\n}\n.arap-choice-group-title {\n font-size: 12px;\n font-weight: 600;\n color: var(--arap-muted);\n text-transform: uppercase;\n letter-spacing: 0.05em;\n}\n.arap-choice-badge {\n font-size: 11px;\n padding: 1px 5px;\n border-radius: 4px;\n background: var(--arap-divider);\n color: var(--arap-muted);\n}\n.arap-segment-active .arap-choice-badge {\n background: rgba(255, 255, 255, 0.25);\n color: #fff;\n}\n.arap-stepper-control-wrapper {\n display: flex;\n flex-direction: column;\n gap: 8px;\n width: 100%;\n}\n.arap-slider-container {\n display: flex;\n align-items: center;\n padding: 4px 0;\n}\n.arap-slider {\n width: 100%;\n accent-color: var(--arap-accent);\n cursor: pointer;\n}\n.arap-search-count {\n padding: 6px 0;\n font-size: 12px;\n font-weight: 500;\n color: var(--arap-muted);\n}\n.arap-empty-state {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n text-align: center;\n padding: 24px 16px;\n gap: 8px;\n}\n.arap-empty-icon {\n font-size: 32px;\n}\n.arap-empty-title {\n margin: 0;\n font-size: 16px;\n font-weight: 600;\n color: var(--arap-text);\n}\n.arap-empty-desc {\n margin: 0;\n font-size: 13px;\n color: var(--arap-muted);\n}\n.arap-empty-btn,\n.arap-retry-btn {\n margin-top: 6px;\n padding: 8px 16px;\n border: 1px solid var(--arap-border);\n border-radius: 8px;\n background: var(--arap-control);\n font-weight: 500;\n font-size: 13px;\n color: var(--arap-text);\n cursor: pointer;\n}\n.arap-empty-btn:hover,\n.arap-retry-btn:hover {\n background: var(--arap-selected);\n border-color: var(--arap-accent);\n color: var(--arap-accent);\n}\n.arap-profile-card {\n display: flex;\n flex-direction: column;\n gap: 12px;\n padding: 16px;\n border: 1px solid var(--arap-border);\n border-radius: 12px;\n background: var(--arap-surface);\n transition: border-color 0.15s, box-shadow 0.15s;\n}\n.arap-profile-card-active {\n border-color: var(--arap-accent);\n background: var(--arap-selected);\n box-shadow: 0 0 0 1px var(--arap-accent);\n}\n.arap-profile-header {\n display: flex;\n flex-direction: column;\n gap: 4px;\n}\n.arap-profile-title-row {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 8px;\n}\n.arap-profile-title {\n margin: 0;\n font-size: 15px;\n font-weight: 600;\n color: var(--arap-text);\n}\n.arap-profile-active-badge {\n font-size: 11px;\n font-weight: 600;\n color: var(--arap-accent);\n background: #dbeafe;\n padding: 2px 8px;\n border-radius: 9999px;\n}\n.arap-profile-desc {\n margin: 0;\n font-size: 13px;\n color: var(--arap-muted);\n line-height: 1.4;\n}\n.arap-profile-affected {\n display: flex;\n flex-direction: column;\n gap: 6px;\n}\n.arap-profile-affected-label {\n font-size: 11px;\n font-weight: 600;\n color: var(--arap-muted);\n text-transform: uppercase;\n letter-spacing: 0.05em;\n}\n.arap-profile-chips {\n display: flex;\n flex-wrap: wrap;\n gap: 6px;\n}\n.arap-profile-chip {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n padding: 3px 8px;\n border-radius: 6px;\n background: var(--arap-control);\n border: 1px solid var(--arap-divider);\n font-size: 12px;\n color: var(--arap-text);\n}\n.arap-profile-actions {\n display: flex;\n gap: 8px;\n margin-top: 4px;\n}\n.arap-profile-apply-btn {\n flex: 1;\n padding: 8px 14px;\n border: 1px solid var(--arap-accent);\n border-radius: 8px;\n background: var(--arap-accent);\n color: #fff;\n font-size: 13px;\n font-weight: 600;\n cursor: pointer;\n text-align: center;\n}\n.arap-profile-apply-btn:hover {\n background: var(--arap-accent-hover);\n}\n.arap-profile-revert-btn {\n flex: 1;\n padding: 8px 14px;\n border: 1px solid var(--arap-border);\n border-radius: 8px;\n background: var(--arap-surface);\n color: var(--arap-muted);\n font-size: 13px;\n font-weight: 600;\n cursor: pointer;\n text-align: center;\n}\n.arap-profile-revert-btn:hover {\n background: var(--arap-control);\n color: var(--arap-text);\n border-color: var(--arap-text);\n}\n.arap-notice {\n grid-column: 1 / -1;\n margin-top: 6px;\n padding: 8px 12px;\n border-radius: 8px;\n font-size: 12px;\n line-height: 1.45;\n background: #fefce8;\n border: 1px solid #fef08a;\n color: #854d0e;\n}\n.arap-notice-warning {\n background: #fffbeb;\n border-color: #fde68a;\n color: #92400e;\n}\n.arap-reading-mask {\n position: fixed !important;\n left: 0 !important;\n right: 0 !important;\n pointer-events: none !important;\n user-select: none !important;\n -webkit-user-select: none !important;\n touch-action: none !important;\n z-index: 2147482999 !important;\n}\n.arap-reading-guide {\n position: fixed !important;\n left: 0 !important;\n right: 0 !important;\n pointer-events: none !important;\n user-select: none !important;\n -webkit-user-select: none !important;\n touch-action: none !important;\n z-index: 2147482999 !important;\n}\n.arap-feature-expandable {\n flex-direction: column !important;\n align-items: stretch !important;\n}\n');
27
+ styleInject('.arap-root {\n --arap-surface: #fff;\n --arap-text: #111827;\n --arap-muted: #475569;\n --arap-border: #cbd5e1;\n --arap-divider: #e2e8f0;\n --arap-accent: #1d4ed8;\n --arap-accent-hover: #1e40af;\n --arap-selected: #eff6ff;\n --arap-control: #f8fafc;\n color-scheme: light;\n font: 15px/1.5 system-ui, sans-serif;\n color: var(--arap-text);\n text-align: left;\n letter-spacing: normal;\n}\n.arap-root *,\n.arap-root *::before,\n.arap-root *::after {\n box-sizing: border-box;\n}\n.arap-root button {\n font: inherit;\n cursor: pointer;\n color: inherit;\n text-transform: none;\n letter-spacing: normal;\n transition: background-color 0.15s, border-color 0.15s;\n}\n.arap-root button:disabled {\n opacity: 0.45;\n cursor: not-allowed;\n}\n.arap-root button:focus-visible,\n.arap-panel:focus-visible {\n outline: 3px solid var(--arap-accent);\n outline-offset: 3px;\n}\n.arap-root .arap-btn {\n position: fixed;\n z-index: 2147483001;\n bottom: max(16px, env(safe-area-inset-bottom));\n right: max(16px, env(safe-area-inset-right));\n width: 56px;\n height: 56px;\n padding: 12px;\n display: flex;\n align-items: center;\n justify-content: center;\n border: 2px solid var(--arap-surface);\n border-radius: 50%;\n background: var(--arap-accent);\n color: #fff;\n box-shadow: 0 4px 12px #0f172a26, 0 10px 24px #0f172a14;\n}\n.arap-root .arap-btn:hover {\n background: var(--arap-accent-hover);\n}\n.arap-root .arap-btn[data-position=left] {\n right: auto;\n left: max(16px, env(safe-area-inset-left));\n}\n.arap-root .arap-btn[data-position=top] {\n bottom: auto;\n top: max(16px, env(safe-area-inset-top));\n}\n.arap-root .arap-panel {\n position: fixed;\n z-index: 2147483000;\n bottom: max(88px, calc(env(safe-area-inset-bottom) + 72px));\n right: max(16px, env(safe-area-inset-right));\n width: min(400px, calc(100vw - 32px));\n max-height: calc(100vh - 120px);\n max-height: calc(100dvh - 120px - env(safe-area-inset-bottom));\n overflow: auto;\n overscroll-behavior: contain;\n scrollbar-width: thin;\n scrollbar-color: var(--arap-border) transparent;\n padding: 20px;\n border: 1px solid var(--arap-divider);\n border-radius: 16px;\n background: var(--arap-surface);\n box-shadow: 0 8px 16px #0f172a0d, 0 20px 48px #0f172a1a;\n}\n.arap-root .arap-panel[hidden] {\n display: none !important;\n}\n.arap-root .arap-panel[data-position=left] {\n right: auto;\n left: max(16px, env(safe-area-inset-left));\n}\n.arap-root .arap-panel[data-position=top] {\n bottom: auto;\n top: max(88px, calc(env(safe-area-inset-top) + 72px));\n}\n.arap-heading {\n display: flex;\n justify-content: space-between;\n align-items: flex-start;\n gap: 8px;\n padding-bottom: 18px;\n border-bottom: 1px solid var(--arap-divider);\n}\n.arap-heading-copy {\n min-width: 0;\n}\n.arap-heading h2 {\n margin: 0;\n font: 700 22px/1.3 system-ui, sans-serif;\n letter-spacing: -0.025em;\n color: var(--arap-text);\n overflow-wrap: anywhere;\n}\n.arap-description {\n margin: 6px 0 0;\n color: var(--arap-muted);\n font: 14px/1.5 system-ui, sans-serif;\n overflow-wrap: anywhere;\n}\n.arap-heading button {\n flex: none;\n width: 44px;\n height: 44px;\n margin-top: -6px;\n border: 1px solid transparent;\n border-radius: 8px;\n background: transparent;\n color: var(--arap-muted);\n font-size: 28px;\n line-height: 1;\n}\n.arap-heading button:hover {\n background: var(--arap-control);\n border-color: var(--arap-border);\n}\n.arap-feature {\n display: grid;\n grid-template-columns: minmax(0, 1fr) auto;\n align-items: center;\n gap: 10px 12px;\n padding: 18px 0;\n border-bottom: 1px solid var(--arap-divider);\n}\n.arap-feature:last-child {\n border: 0;\n padding-bottom: 0;\n}\n.arap-label {\n display: flex;\n align-items: center;\n gap: 10px;\n font-weight: 500;\n min-width: 0;\n overflow-wrap: anywhere;\n}\n.arap-icon {\n flex: none;\n width: 22px;\n height: 22px;\n display: inline-block;\n vertical-align: middle;\n}\n.arap-controls {\n display: flex;\n align-items: stretch;\n border: 1px solid var(--arap-border);\n border-radius: 9px;\n overflow: hidden;\n background: var(--arap-control);\n}\n.arap-root .arap-btn-sm {\n flex: none;\n width: 44px;\n height: 44px;\n border: 0;\n border-radius: 0;\n background: transparent;\n font-size: 22px;\n}\n.arap-root .arap-btn-sm:hover:not(:disabled) {\n background: var(--arap-selected);\n color: var(--arap-accent);\n}\n.arap-root .arap-controls button:focus-visible {\n outline-offset: -4px;\n}\n.arap-value {\n display: flex;\n align-items: center;\n justify-content: center;\n min-width: 56px;\n padding: 0 6px;\n text-align: center;\n font-weight: 600;\n border-inline: 1px solid var(--arap-divider);\n background: var(--arap-surface);\n}\n.arap-segmented {\n grid-column: 1 / -1;\n display: flex;\n flex-wrap: wrap;\n gap: 6px;\n min-width: 0;\n}\n.arap-root .arap-segment {\n flex: 1 1 auto;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 5px;\n min-width: 44px;\n min-height: 44px;\n padding: 8px 10px;\n border: 1px solid var(--arap-border);\n border-radius: 8px;\n background: var(--arap-control);\n color: var(--arap-muted);\n overflow-wrap: anywhere;\n}\n.arap-root .arap-segment:hover {\n background: var(--arap-selected);\n border-color: var(--arap-accent);\n}\n.arap-root .arap-segment-active {\n background: var(--arap-accent);\n color: #fff;\n border-color: var(--arap-accent);\n font-weight: 600;\n}\n.arap-root .arap-segment-active:hover {\n background: var(--arap-accent-hover);\n color: #fff;\n}\n.arap-check {\n flex: none;\n font-size: 15px;\n line-height: 1;\n}\n.arap-root .arap-toggle {\n position: relative;\n width: 56px;\n height: 44px;\n padding: 0;\n border: 0;\n border-radius: 10px;\n background: transparent;\n}\n.arap-toggle::before {\n content: "";\n position: absolute;\n inset: 6px 0;\n border: 2px solid #64748b;\n border-radius: 20px;\n background: #e2e8f0;\n}\n.arap-toggle-knob {\n position: absolute;\n top: 10px;\n left: 4px;\n width: 24px;\n height: 24px;\n border-radius: 50%;\n background: #475569;\n pointer-events: none;\n transition: transform 0.15s;\n}\n.arap-toggle-active::before {\n background: var(--arap-accent);\n border-color: var(--arap-accent);\n}\n.arap-toggle-active .arap-toggle-knob {\n transform: translateX(24px);\n background: #fff;\n}\n.arap-toggle-active .arap-toggle-knob::after {\n content: "\\2713";\n display: block;\n color: var(--arap-accent);\n font-size: 16px;\n font-weight: 700;\n line-height: 24px;\n text-align: center;\n}\n.arap-root .arap-toggle:hover::before {\n border-color: var(--arap-accent);\n}\n.arap-feature-reset {\n display: block;\n}\n.arap-root .arap-reset-btn {\n display: flex;\n align-items: center;\n justify-content: center;\n gap: 10px;\n width: 100%;\n min-height: 48px;\n padding: 10px;\n border: 1px solid var(--arap-border);\n border-radius: 10px;\n background: var(--arap-control);\n color: var(--arap-accent);\n font-weight: 600;\n}\n.arap-root .arap-reset-btn:hover {\n background: var(--arap-selected);\n border-color: var(--arap-accent);\n}\n@media (max-width: 380px) {\n .arap-root .arap-panel {\n padding: 16px;\n }\n .arap-heading h2 {\n font-size: 20px;\n }\n .arap-feature-stepper {\n grid-template-columns: minmax(0, 1fr);\n }\n .arap-controls {\n width: 100%;\n }\n .arap-value {\n flex: 1;\n }\n}\n@media (prefers-reduced-motion: reduce) {\n .arap-root *,\n .arap-root *::before,\n .arap-root *::after {\n transition: none !important;\n animation: none !important;\n }\n}\n@media (forced-colors: active) {\n .arap-root {\n --arap-surface: Canvas;\n --arap-text: CanvasText;\n --arap-muted: CanvasText;\n --arap-border: ButtonText;\n --arap-divider: ButtonText;\n --arap-accent: Highlight;\n --arap-control: Canvas;\n --arap-selected: Canvas;\n }\n .arap-root button[aria-pressed=true] {\n outline: 2px solid Highlight;\n outline-offset: -4px;\n }\n .arap-root .arap-segment-active {\n color: HighlightText;\n background: Highlight;\n }\n .arap-toggle::before {\n border-color: ButtonText;\n background: Canvas;\n }\n .arap-toggle-knob {\n background: ButtonText;\n }\n .arap-toggle-active .arap-toggle-knob {\n background: Highlight;\n }\n .arap-toggle-active .arap-toggle-knob::after {\n color: HighlightText;\n }\n}\n.arap-root .arap-panel {\n display: flex;\n flex-direction: column;\n overflow: visible;\n}\n.arap-heading {\n flex: none;\n}\n.arap-tools {\n flex: 1 1 auto;\n min-height: 0;\n overflow: auto;\n overscroll-behavior: contain;\n scrollbar-width: thin;\n scrollbar-color: var(--arap-border) transparent;\n padding: 0 3px;\n margin: 0 -3px;\n}\n.arap-tools:focus-visible {\n outline: 3px solid var(--arap-accent);\n outline-offset: -3px;\n}\n.arap-quick-actions {\n position: relative;\n flex: none;\n display: flex;\n align-items: center;\n gap: 8px;\n padding-top: 14px;\n margin-top: 8px;\n border-top: 1px solid var(--arap-divider);\n}\n.arap-actions {\n flex: 1;\n min-width: 0;\n}\n.arap-actions:empty {\n display: none;\n}\n.arap-actions .arap-feature-reset {\n padding: 0;\n margin: 0;\n border: 0;\n}\n.arap-root .arap-position-button,\n.arap-root .arap-position-default,\n.arap-root .arap-position-arrows button {\n min-width: 44px;\n min-height: 44px;\n padding: 8px 10px;\n border: 1px solid var(--arap-border);\n border-radius: 8px;\n background: var(--arap-control);\n color: var(--arap-accent);\n}\n.arap-root .arap-position-button:hover,\n.arap-root .arap-position-default:hover,\n.arap-root .arap-position-arrows button:hover {\n background: var(--arap-selected);\n border-color: var(--arap-accent);\n}\n.arap-position-popover {\n position: absolute;\n z-index: 1;\n bottom: calc(100% + 8px);\n left: 0;\n width: 100%;\n max-height: calc(100dvh - 160px);\n overflow: auto;\n padding: 14px;\n border: 1px solid var(--arap-border);\n border-radius: 12px;\n background: var(--arap-surface);\n box-shadow: 0 8px 24px #0f172a26;\n}\n.arap-position-popover[hidden] {\n display: none !important;\n}\n.arap-position-label {\n display: block;\n margin-bottom: 6px;\n font-weight: 600;\n}\n.arap-position-popover select {\n width: 100%;\n min-height: 44px;\n padding: 8px;\n border: 1px solid var(--arap-border);\n border-radius: 8px;\n font: inherit;\n color: var(--arap-text);\n background: var(--arap-surface);\n}\n.arap-position-popover select:focus-visible {\n outline: 3px solid var(--arap-accent);\n outline-offset: 2px;\n}\n.arap-position-arrows {\n display: flex;\n justify-content: space-between;\n gap: 6px;\n margin-top: 10px;\n}\n.arap-position-default {\n width: 100%;\n margin-top: 8px;\n}\n.arap-root .arap-btn[data-draggable=true] {\n touch-action: none;\n user-select: none;\n cursor: grab;\n}\n.arap-root .arap-btn[data-dragging=true] {\n cursor: grabbing;\n}\n.arap-root .arap-btn[data-corner$=left],\n.arap-root .arap-panel[data-corner$=left] {\n right: auto;\n left: max(16px, env(safe-area-inset-left));\n}\n.arap-root .arap-btn[data-corner$=right],\n.arap-root .arap-panel[data-corner$=right] {\n left: auto;\n right: max(16px, env(safe-area-inset-right));\n}\n.arap-root .arap-btn[data-corner^=top] {\n bottom: auto;\n top: max(16px, env(safe-area-inset-top));\n}\n.arap-root .arap-btn[data-corner^=bottom] {\n top: auto;\n bottom: max(16px, env(safe-area-inset-bottom));\n}\n.arap-root .arap-panel[data-corner^=top] {\n bottom: auto;\n top: max(88px, calc(env(safe-area-inset-top) + 72px));\n}\n.arap-root .arap-panel[data-corner^=bottom] {\n top: auto;\n bottom: max(88px, calc(env(safe-area-inset-bottom) + 72px));\n}\n.arap-sr-only {\n position: absolute;\n width: 1px;\n height: 1px;\n padding: 0;\n margin: -1px;\n overflow: hidden;\n clip-path: inset(50%);\n white-space: nowrap;\n border: 0;\n}\n.arap-root .arap-skip-actions {\n position: absolute;\n top: 12px;\n left: 20px;\n width: 44px;\n height: 44px;\n clip-path: inset(50%);\n overflow: hidden;\n pointer-events: none;\n}\n.arap-root .arap-skip-actions:focus-visible {\n right: 20px;\n width: auto;\n height: auto;\n min-height: 44px;\n clip-path: none;\n pointer-events: auto;\n z-index: 2;\n padding: 8px;\n border: 1px solid var(--arap-accent);\n border-radius: 8px;\n background: var(--arap-surface);\n color: var(--arap-accent);\n}\n.arap-skip-to-main {\n position: fixed;\n top: 12px;\n left: 16px;\n z-index: 2147483647;\n width: 1px;\n height: 1px;\n margin: -1px;\n padding: 0;\n overflow: hidden;\n clip-path: inset(50%);\n white-space: nowrap;\n border: 0;\n pointer-events: none;\n font-family: inherit;\n font-size: 0.9375rem;\n font-weight: 600;\n text-decoration: none;\n color: var(--arap-accent, #008060);\n background: var(--arap-surface, #ffffff);\n border-radius: 8px;\n box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);\n}\n.arap-skip-to-main:focus,\n.arap-skip-to-main:focus-visible {\n width: auto;\n height: auto;\n min-height: 44px;\n margin: 0;\n padding: 10px 18px;\n clip-path: none;\n overflow: visible;\n white-space: normal;\n pointer-events: auto;\n border: 2px solid var(--arap-accent, #008060);\n outline: 3px solid var(--arap-accent, #008060);\n outline-offset: 3px;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n}\n@media (forced-colors: active) {\n .arap-skip-to-main {\n background: Canvas;\n color: CanvasText;\n border-color: Highlight;\n }\n .arap-skip-to-main:focus,\n .arap-skip-to-main:focus-visible {\n outline: 3px solid Highlight;\n }\n}\n@media (max-height: 480px) {\n .arap-root .arap-panel {\n top: max(16px, env(safe-area-inset-top)) !important;\n bottom: max(16px, env(safe-area-inset-bottom)) !important;\n max-height: calc(100dvh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom)) !important;\n padding: 8px;\n }\n .arap-heading {\n padding-bottom: 8px;\n }\n .arap-heading h2 {\n font-size: 18px;\n }\n .arap-heading button {\n margin-top: 0;\n }\n .arap-description {\n display: none;\n }\n .arap-quick-actions {\n padding-top: 8px;\n margin-top: 0;\n }\n .arap-root .arap-reset-btn {\n min-height: 44px;\n }\n .arap-root .arap-btn[data-open=true] {\n visibility: hidden;\n }\n .arap-position-popover {\n max-height: calc(100dvh - 96px);\n }\n}\n.arap-statement {\n flex: none;\n padding-top: 10px;\n text-align: center;\n}\n.arap-statement-link {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n min-height: 44px;\n padding: 6px 12px;\n color: var(--arap-accent);\n text-decoration: underline;\n text-underline-offset: 4px;\n font-size: 14px;\n font-weight: 500;\n border-radius: 8px;\n}\n.arap-statement-link:hover {\n color: var(--arap-accent-hover);\n background: var(--arap-selected);\n}\n.arap-statement-link:focus-visible {\n outline: 3px solid var(--arap-accent);\n outline-offset: 2px;\n}\n.arap-credits {\n display: flex;\n flex: none;\n flex-direction: column;\n gap: 2px;\n padding-top: 8px;\n color: var(--arap-muted);\n text-align: center;\n font-size: 11px;\n line-height: 1.4;\n}\n.arap-credits a {\n color: var(--arap-accent);\n text-decoration: underline;\n text-underline-offset: 2px;\n}\n.arap-credits a:hover {\n color: var(--arap-accent-hover);\n}\n.arap-credits a:focus-visible {\n outline: 2px solid var(--arap-accent);\n outline-offset: 2px;\n}\n.arap-root .arap-btn[data-large-controls=true] {\n width: 64px;\n height: 64px;\n min-width: 48px;\n min-height: 48px;\n}\n.arap-root .arap-panel[data-large-controls=true] {\n width: min(440px, calc(100vw - 32px));\n}\n.arap-root .arap-panel[data-large-controls=true] .arap-heading button {\n width: 48px;\n height: 48px;\n min-width: 48px;\n min-height: 48px;\n font-size: 32px;\n}\n.arap-root .arap-panel[data-large-controls=true] .arap-btn-sm {\n width: 48px;\n height: 48px;\n min-width: 48px;\n min-height: 48px;\n font-size: 24px;\n}\n.arap-root .arap-panel[data-large-controls=true] .arap-value {\n min-width: 64px;\n font-size: 16px;\n}\n.arap-root .arap-panel[data-large-controls=true] .arap-segment {\n min-width: 48px;\n min-height: 48px;\n padding: 10px 14px;\n font-size: 15px;\n}\n.arap-root .arap-panel[data-large-controls=true] .arap-toggle {\n width: 64px;\n height: 48px;\n}\n.arap-root .arap-panel[data-large-controls=true] .arap-toggle::before {\n inset: 8px 0;\n}\n.arap-root .arap-panel[data-large-controls=true] .arap-toggle-knob {\n top: 12px;\n}\n.arap-root .arap-panel[data-large-controls=true] .arap-toggle-active .arap-toggle-knob {\n transform: translateX(28px);\n}\n.arap-root .arap-panel[data-large-controls=true] .arap-reset-btn {\n min-height: 52px;\n font-size: 16px;\n padding: 12px;\n}\n.arap-root .arap-panel[data-large-controls=true] .arap-position-button,\n.arap-root .arap-panel[data-large-controls=true] .arap-position-default,\n.arap-root .arap-panel[data-large-controls=true] .arap-position-arrows button {\n min-width: 48px;\n min-height: 48px;\n font-size: 15px;\n}\n.arap-root .arap-panel[data-large-controls=true] .arap-position-popover select {\n min-height: 48px;\n font-size: 15px;\n}\n.arap-root .arap-panel[data-large-controls=true] .arap-statement-link {\n min-height: 48px;\n font-size: 15px;\n padding: 10px 16px;\n}\n.arap-root .arap-panel[data-large-controls=true] .arap-skip-actions {\n min-width: 48px;\n min-height: 48px;\n}\n.arap-feature-card {\n display: flex;\n flex-direction: column;\n align-items: stretch;\n gap: 12px;\n}\n.arap-card-header {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 8px;\n}\n.arap-card-title {\n font-weight: 600;\n font-size: 15px;\n color: var(--arap-text);\n}\n.arap-card-desc {\n margin: 0;\n font-size: 13px;\n color: var(--arap-muted);\n line-height: 1.4;\n}\n.arap-status-badge {\n display: inline-flex;\n align-items: center;\n padding: 2px 8px;\n border-radius: 9999px;\n font-size: 11px;\n font-weight: 600;\n background: var(--arap-control);\n border: 1px solid var(--arap-border);\n color: var(--arap-muted);\n text-transform: uppercase;\n letter-spacing: 0.05em;\n}\n.arap-card-alert {\n display: flex;\n align-items: flex-start;\n gap: 8px;\n padding: 10px 12px;\n border-radius: 8px;\n font-size: 13px;\n line-height: 1.4;\n}\n.arap-alert-icon {\n flex: none;\n font-size: 16px;\n line-height: 1;\n}\n.arap-card-error {\n background: #fef2f2;\n border: 1px solid #fecaca;\n color: #991b1b;\n}\n.arap-card-unavailable {\n background: #f8fafc;\n border: 1px solid var(--arap-border);\n color: var(--arap-muted);\n}\n.arap-card-permission {\n background: #fffbeb;\n border: 1px solid #fde68a;\n color: #92400e;\n}\n.arap-permission-content {\n display: flex;\n flex-direction: column;\n gap: 6px;\n}\n.arap-permission-btn {\n align-self: flex-start;\n padding: 4px 10px;\n border: 1px solid #d97706;\n border-radius: 6px;\n background: #f59e0b;\n color: #fff;\n font-size: 12px;\n font-weight: 600;\n cursor: pointer;\n}\n.arap-permission-btn:hover {\n background: #d97706;\n}\n.arap-card-content {\n display: flex;\n flex-direction: column;\n gap: 8px;\n}\n.arap-choice-group {\n display: flex;\n flex-direction: column;\n gap: 6px;\n width: 100%;\n}\n.arap-choice-group-title {\n font-size: 12px;\n font-weight: 600;\n color: var(--arap-muted);\n text-transform: uppercase;\n letter-spacing: 0.05em;\n}\n.arap-choice-badge {\n font-size: 11px;\n padding: 1px 5px;\n border-radius: 4px;\n background: var(--arap-divider);\n color: var(--arap-muted);\n}\n.arap-segment-active .arap-choice-badge {\n background: rgba(255, 255, 255, 0.25);\n color: #fff;\n}\n.arap-stepper-control-wrapper {\n display: flex;\n flex-direction: column;\n gap: 8px;\n width: 100%;\n}\n.arap-slider-container {\n display: flex;\n align-items: center;\n padding: 4px 0;\n}\n.arap-slider {\n width: 100%;\n accent-color: var(--arap-accent);\n cursor: pointer;\n}\n.arap-search-count {\n padding: 6px 0;\n font-size: 12px;\n font-weight: 500;\n color: var(--arap-muted);\n}\n.arap-empty-state {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n text-align: center;\n padding: 24px 16px;\n gap: 8px;\n}\n.arap-empty-icon {\n font-size: 32px;\n}\n.arap-empty-title {\n margin: 0;\n font-size: 16px;\n font-weight: 600;\n color: var(--arap-text);\n}\n.arap-empty-desc {\n margin: 0;\n font-size: 13px;\n color: var(--arap-muted);\n}\n.arap-empty-btn,\n.arap-retry-btn {\n margin-top: 6px;\n padding: 8px 16px;\n border: 1px solid var(--arap-border);\n border-radius: 8px;\n background: var(--arap-control);\n font-weight: 500;\n font-size: 13px;\n color: var(--arap-text);\n cursor: pointer;\n}\n.arap-empty-btn:hover,\n.arap-retry-btn:hover {\n background: var(--arap-selected);\n border-color: var(--arap-accent);\n color: var(--arap-accent);\n}\n.arap-profile-card {\n display: flex;\n flex-direction: column;\n gap: 12px;\n padding: 16px;\n border: 1px solid var(--arap-border);\n border-radius: 12px;\n background: var(--arap-surface);\n transition: border-color 0.15s, box-shadow 0.15s;\n}\n.arap-profile-card-active {\n border-color: var(--arap-accent);\n background: var(--arap-selected);\n box-shadow: 0 0 0 1px var(--arap-accent);\n}\n.arap-profile-header {\n display: flex;\n flex-direction: column;\n gap: 4px;\n}\n.arap-profile-title-row {\n display: flex;\n align-items: center;\n justify-content: space-between;\n gap: 8px;\n}\n.arap-profile-title {\n margin: 0;\n font-size: 15px;\n font-weight: 600;\n color: var(--arap-text);\n}\n.arap-profile-active-badge {\n font-size: 11px;\n font-weight: 600;\n color: var(--arap-accent);\n background: #dbeafe;\n padding: 2px 8px;\n border-radius: 9999px;\n}\n.arap-profile-desc {\n margin: 0;\n font-size: 13px;\n color: var(--arap-muted);\n line-height: 1.4;\n}\n.arap-profile-affected {\n display: flex;\n flex-direction: column;\n gap: 6px;\n}\n.arap-profile-affected-label {\n font-size: 11px;\n font-weight: 600;\n color: var(--arap-muted);\n text-transform: uppercase;\n letter-spacing: 0.05em;\n}\n.arap-profile-chips {\n display: flex;\n flex-wrap: wrap;\n gap: 6px;\n}\n.arap-profile-chip {\n display: inline-flex;\n align-items: center;\n gap: 4px;\n padding: 3px 8px;\n border-radius: 6px;\n background: var(--arap-control);\n border: 1px solid var(--arap-divider);\n font-size: 12px;\n color: var(--arap-text);\n}\n.arap-profile-actions {\n display: flex;\n gap: 8px;\n margin-top: 4px;\n}\n.arap-profile-apply-btn {\n flex: 1;\n padding: 8px 14px;\n border: 1px solid var(--arap-accent);\n border-radius: 8px;\n background: var(--arap-accent);\n color: #fff;\n font-size: 13px;\n font-weight: 600;\n cursor: pointer;\n text-align: center;\n}\n.arap-profile-apply-btn:hover {\n background: var(--arap-accent-hover);\n}\n.arap-profile-revert-btn {\n flex: 1;\n padding: 8px 14px;\n border: 1px solid var(--arap-border);\n border-radius: 8px;\n background: var(--arap-surface);\n color: var(--arap-muted);\n font-size: 13px;\n font-weight: 600;\n cursor: pointer;\n text-align: center;\n}\n.arap-profile-revert-btn:hover {\n background: var(--arap-control);\n color: var(--arap-text);\n border-color: var(--arap-text);\n}\n.arap-notice {\n grid-column: 1 / -1;\n margin-top: 6px;\n padding: 8px 12px;\n border-radius: 8px;\n font-size: 12px;\n line-height: 1.45;\n background: #fefce8;\n border: 1px solid #fef08a;\n color: #854d0e;\n}\n.arap-notice-warning {\n background: #fffbeb;\n border-color: #fde68a;\n color: #92400e;\n}\n.arap-reading-mask {\n position: fixed !important;\n left: 0 !important;\n right: 0 !important;\n pointer-events: none !important;\n user-select: none !important;\n -webkit-user-select: none !important;\n touch-action: none !important;\n z-index: 2147482999 !important;\n}\n.arap-reading-guide {\n position: fixed !important;\n left: 0 !important;\n right: 0 !important;\n pointer-events: none !important;\n user-select: none !important;\n -webkit-user-select: none !important;\n touch-action: none !important;\n z-index: 2147482999 !important;\n}\n.arap-feature-expandable {\n flex-direction: column !important;\n align-items: stretch !important;\n}\n.arap-accessible-tooltip {\n position: fixed !important;\n z-index: 2147483646 !important;\n max-width: 320px !important;\n min-width: 48px !important;\n box-sizing: border-box !important;\n padding: 6px 12px !important;\n background: #0f172a !important;\n color: #ffffff !important;\n font-family:\n -apple-system,\n BlinkMacSystemFont,\n "Segoe UI",\n Roboto,\n "Helvetica Neue",\n Arial,\n sans-serif !important;\n font-size: 13px !important;\n line-height: 1.4 !important;\n font-weight: 500 !important;\n border-radius: 6px !important;\n box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.15) !important;\n pointer-events: auto !important;\n word-break: break-word !important;\n white-space: normal !important;\n opacity: 0 !important;\n visibility: hidden !important;\n transition: opacity 120ms ease, transform 120ms ease !important;\n transform: translateY(2px) !important;\n}\n.arap-accessible-tooltip[data-visible=true] {\n opacity: 1 !important;\n visibility: visible !important;\n transform: translateY(0) !important;\n}\n.arap-accessible-tooltip[data-placement=top] {\n transform: translateY(-2px) !important;\n}\n.arap-accessible-tooltip[data-placement=top][data-visible=true] {\n transform: translateY(0) !important;\n}\n@media (forced-colors: active) {\n .arap-accessible-tooltip {\n background: Canvas !important;\n color: CanvasText !important;\n border: 2px solid Highlight !important;\n box-shadow: none !important;\n }\n}\n.arap-navigator-dialog {\n display: flex;\n flex-direction: column;\n gap: 8px;\n width: 100%;\n margin-top: 10px;\n padding: 10px;\n background: var(--arap-control, #f1f5f9);\n border: 1px solid var(--arap-border, #e2e8f0);\n border-radius: 8px;\n box-sizing: border-box;\n}\n.arap-navigator-tabs {\n display: flex;\n gap: 4px;\n border-bottom: 1px solid var(--arap-border, #cbd5e1);\n padding-bottom: 6px;\n}\n.arap-navigator-tab {\n flex: 1;\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: 6px;\n padding: 6px 10px;\n font-size: 12px;\n font-weight: 600;\n color: var(--arap-muted, #64748b);\n background: transparent;\n border: none;\n border-radius: 6px;\n cursor: pointer;\n transition: all 120ms ease;\n}\n.arap-navigator-tab:hover {\n color: var(--arap-text, #0f172a);\n background: rgba(0, 0, 0, 0.04);\n}\n.arap-navigator-tab-active {\n color: var(--arap-accent, #008060) !important;\n background: var(--arap-selected, #f0fdf4) !important;\n}\n.arap-navigator-search-box {\n width: 100%;\n}\n.arap-navigator-search {\n width: 100%;\n box-sizing: border-box;\n padding: 6px 10px;\n font-size: 12px;\n border: 1px solid var(--arap-border, #cbd5e1);\n border-radius: 6px;\n background: var(--arap-surface, #ffffff);\n color: var(--arap-text, #0f172a);\n}\n.arap-navigator-search:focus {\n outline: 2px solid var(--arap-accent, #008060);\n outline-offset: 1px;\n}\n.arap-navigator-content {\n max-height: 240px;\n overflow-y: auto;\n overflow-x: hidden;\n}\n.arap-navigator-list {\n list-style: none;\n margin: 0;\n padding: 0;\n display: flex;\n flex-direction: column;\n gap: 4px;\n}\n.arap-navigator-item {\n margin: 0;\n padding: 0;\n}\n.arap-navigator-jump-btn {\n width: 100%;\n box-sizing: border-box;\n display: flex;\n align-items: center;\n gap: 8px;\n padding: 6px 8px;\n font-size: 12px;\n font-weight: 500;\n text-align: left;\n background: var(--arap-surface, #ffffff);\n border: 1px solid var(--arap-border, #e2e8f0);\n border-radius: 6px;\n color: var(--arap-text, #0f172a);\n cursor: pointer;\n transition: background 100ms ease, border-color 100ms ease;\n}\n.arap-navigator-jump-btn:hover,\n.arap-navigator-jump-btn:focus-visible {\n background: var(--arap-selected, #f0fdf4);\n border-color: var(--arap-accent, #008060);\n outline: 2px solid var(--arap-accent, #008060);\n outline-offset: -1px;\n}\n.arap-navigator-badge {\n display: inline-block;\n padding: 2px 6px;\n font-size: 10px;\n font-weight: 700;\n border-radius: 4px;\n flex-shrink: 0;\n}\n.arap-navigator-badge-h {\n background: #e0f2fe;\n color: #0369a1;\n}\n.arap-navigator-badge-l {\n background: #fef3c7;\n color: #b45309;\n}\n.arap-navigator-item-text {\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n.arap-navigator-empty {\n padding: 16px;\n font-size: 12px;\n text-align: center;\n color: var(--arap-muted, #64748b);\n font-style: italic;\n}\n.arap-profile-card {\n padding: 12px;\n border: 1px solid var(--arap-border, #e2e8f0);\n border-radius: 8px;\n background: var(--arap-card-bg, #ffffff);\n transition: border-color 0.15s ease, box-shadow 0.15s ease;\n}\n.arap-profile-card:hover {\n border-color: var(--arap-primary, #2563eb);\n}\n.arap-profile-card-active {\n border-color: var(--arap-primary, #2563eb);\n background: rgba(37, 99, 235, 0.03);\n box-shadow: 0 0 0 1px var(--arap-primary, #2563eb);\n}\n.arap-profile-header {\n margin-bottom: 8px;\n}\n.arap-profile-title-row {\n display: flex;\n align-items: center;\n justify-content: space-between;\n margin-bottom: 4px;\n}\n.arap-profile-title {\n margin: 0;\n font-size: 13px;\n font-weight: 600;\n color: var(--arap-text, #1e293b);\n}\n.arap-profile-active-badge {\n display: inline-block;\n padding: 2px 8px;\n font-size: 11px;\n font-weight: 600;\n border-radius: 9999px;\n background: #dbeafe;\n color: #1d4ed8;\n}\n.arap-profile-desc {\n margin: 0;\n font-size: 11px;\n color: var(--arap-muted, #64748b);\n line-height: 1.4;\n}\n.arap-profile-affected {\n margin-top: 8px;\n margin-bottom: 10px;\n}\n.arap-profile-affected-label {\n display: block;\n font-size: 10px;\n font-weight: 600;\n text-transform: uppercase;\n letter-spacing: 0.05em;\n color: var(--arap-muted, #94a3b8);\n margin-bottom: 4px;\n}\n.arap-profile-chips {\n display: flex;\n flex-wrap: wrap;\n gap: 4px;\n}\n.arap-profile-chip {\n display: inline-block;\n padding: 2px 6px;\n font-size: 10px;\n background: var(--arap-chip-bg, #f1f5f9);\n color: var(--arap-text, #334155);\n border-radius: 4px;\n border: 1px solid var(--arap-chip-border, #e2e8f0);\n}\n.arap-profile-actions {\n display: flex;\n justify-content: flex-end;\n margin-top: 8px;\n}\n.arap-profile-apply-btn,\n.arap-profile-revert-btn {\n display: inline-flex;\n align-items: center;\n justify-content: center;\n min-height: 36px;\n padding: 6px 14px;\n font-size: 12px;\n font-weight: 600;\n border-radius: 6px;\n cursor: pointer;\n transition: background 0.15s ease, border-color 0.15s ease;\n}\n.arap-profile-apply-btn {\n background: var(--arap-primary, #2563eb);\n color: #ffffff;\n border: 1px solid var(--arap-primary, #2563eb);\n}\n.arap-profile-apply-btn:hover {\n background: #1d4ed8;\n}\n.arap-profile-revert-btn {\n background: #ffffff;\n color: #dc2626;\n border: 1px solid #fca5a5;\n}\n.arap-profile-revert-btn:hover {\n background: #fef2f2;\n border-color: #f87171;\n}\n.arap-large-controls .arap-profile-apply-btn,\n.arap-large-controls .arap-profile-revert-btn {\n min-height: 48px;\n padding: 10px 18px;\n font-size: 14px;\n}\n@media (prefers-reduced-motion: reduce) {\n .arap-profile-card,\n .arap-profile-apply-btn,\n .arap-profile-revert-btn,\n .arap-preset-card {\n transition: none !important;\n }\n}\n.arap-preset-card {\n transition: border-color 0.15s ease, box-shadow 0.15s ease;\n}\n.arap-preset-card:hover {\n border-color: var(--arap-border-hover, #cbd5e1);\n}\n.arap-large-controls .arap-preset-card button {\n min-height: 48px;\n padding: 10px 16px;\n font-size: 14px;\n}\n');
28
28
 
29
29
  // src/core/AccessibilityPlugin.tsx
30
30
  import {
@@ -340,7 +340,9 @@ for (const key of [
340
340
  "readingGuide",
341
341
  "highlightFocus",
342
342
  "focusHighlight",
343
- "reduceMotion"
343
+ "reduceMotion",
344
+ "tooltips",
345
+ "accessibleTooltips"
344
346
  ]) {
345
347
  builtins[key] = {
346
348
  defaultValue: false,
@@ -359,6 +361,16 @@ builtins.readingMaskHeight = {
359
361
  defaultValue: DEFAULT_READING_MASK_HEIGHT,
360
362
  validate: (v) => typeof v === "number" && v >= MIN_READING_MASK_HEIGHT && v <= MAX_READING_MASK_HEIGHT
361
363
  };
364
+ builtins.activeProfile = {
365
+ defaultValue: null,
366
+ validate: (v) => v === null || typeof v === "object" && v !== null && "profileId" in v && typeof v.profileId === "string"
367
+ };
368
+ builtins.customPresets = {
369
+ defaultValue: [],
370
+ validate: (v) => Array.isArray(v) && v.every(
371
+ (item) => typeof item === "object" && item !== null && typeof item.id === "string" && typeof item.name === "string" && typeof item.createdAt === "string" && typeof item.settings === "object" && item.settings !== null
372
+ )
373
+ };
362
374
  function validValue(key, value, fallback, validate) {
363
375
  if (builtins[key]) return builtins[key].validate(value);
364
376
  if (validate) {
@@ -1495,6 +1507,274 @@ function useBuiltinEffects(values, onDisable) {
1495
1507
  if (!values.readingGuide) return;
1496
1508
  return readingAid(false, 4, onDisable);
1497
1509
  }, [values.readingGuide, onDisable]);
1510
+ useEffect(() => {
1511
+ if (!values.tooltips && !values.accessibleTooltips) return;
1512
+ return enableAccessibleTooltips();
1513
+ }, [values.tooltips, values.accessibleTooltips]);
1514
+ }
1515
+ var SENSITIVE_AUTOCOMPLETE_PATTERN = /password|credit-card|cc-|card-|security-code|cvc|cvv|one-time-code/i;
1516
+ function getAuthoredDescription(element) {
1517
+ if (!(element instanceof HTMLElement || element instanceof SVGElement)) {
1518
+ return null;
1519
+ }
1520
+ if (element.closest("[data-arap-ui]")) {
1521
+ return null;
1522
+ }
1523
+ if (element.matches("script, style, link, meta, noscript, template")) {
1524
+ return null;
1525
+ }
1526
+ if (element instanceof HTMLInputElement || element instanceof HTMLTextAreaElement || element instanceof HTMLSelectElement) {
1527
+ if (element instanceof HTMLInputElement && element.type === "password") {
1528
+ return null;
1529
+ }
1530
+ const ac = element.getAttribute("autocomplete");
1531
+ if (ac && SENSITIVE_AUTOCOMPLETE_PATTERN.test(ac)) {
1532
+ return null;
1533
+ }
1534
+ }
1535
+ if (element.getAttribute("data-sensitive") === "true") {
1536
+ return null;
1537
+ }
1538
+ if (element.getAttribute("aria-hidden") === "true" || element.getAttribute("role") === "presentation" || element.getAttribute("role") === "none") {
1539
+ return null;
1540
+ }
1541
+ const ariaDesc = element.getAttribute("aria-description")?.trim();
1542
+ let describedByText = "";
1543
+ const describedBy = element.getAttribute("aria-describedby");
1544
+ if (describedBy) {
1545
+ const ids = describedBy.trim().split(/\s+/);
1546
+ const parts = [];
1547
+ for (const id of ids) {
1548
+ const target = document.getElementById(id);
1549
+ if (target) {
1550
+ const text = target.textContent?.trim();
1551
+ if (text) parts.push(text);
1552
+ }
1553
+ }
1554
+ if (parts.length > 0) {
1555
+ describedByText = parts.join(" ");
1556
+ }
1557
+ }
1558
+ const explicitDesc = ariaDesc || describedByText || null;
1559
+ const ariaLabel = element.getAttribute("aria-label")?.trim() || null;
1560
+ const visibleText = (element.textContent || "").trim();
1561
+ const alt = element instanceof HTMLImageElement || element instanceof HTMLAreaElement || element instanceof HTMLInputElement && element.type === "image" ? element.getAttribute("alt")?.trim() || null : null;
1562
+ const title = element.getAttribute("title")?.trim() || null;
1563
+ if (explicitDesc) {
1564
+ if (ariaLabel && ariaLabel.toLowerCase() !== visibleText.toLowerCase() && ariaLabel.toLowerCase() !== explicitDesc.toLowerCase()) {
1565
+ return `${ariaLabel} \u2014 ${explicitDesc}`;
1566
+ }
1567
+ if (explicitDesc.toLowerCase() !== visibleText.toLowerCase()) {
1568
+ return explicitDesc;
1569
+ }
1570
+ }
1571
+ if (ariaLabel && ariaLabel.toLowerCase() !== visibleText.toLowerCase()) {
1572
+ return ariaLabel;
1573
+ }
1574
+ if (alt && alt !== "") {
1575
+ return alt;
1576
+ }
1577
+ if (title && title.toLowerCase() !== visibleText.toLowerCase()) {
1578
+ return title;
1579
+ }
1580
+ return null;
1581
+ }
1582
+ function positionTooltip(tooltip, target) {
1583
+ const rect = target.getBoundingClientRect();
1584
+ const tooltipRect = tooltip.getBoundingClientRect();
1585
+ const tooltipWidth = tooltipRect.width || tooltip.offsetWidth || 180;
1586
+ const tooltipHeight = tooltipRect.height || tooltip.offsetHeight || 32;
1587
+ const gap = 8;
1588
+ const vw = typeof window !== "undefined" && window.innerWidth || document.documentElement.clientWidth || 800;
1589
+ const vh = typeof window !== "undefined" && window.innerHeight || document.documentElement.clientHeight || 600;
1590
+ let placement = "top";
1591
+ let top = rect.top - tooltipHeight - gap;
1592
+ if (top < gap) {
1593
+ top = rect.bottom + gap;
1594
+ placement = "bottom";
1595
+ }
1596
+ if (top + tooltipHeight > vh - gap) {
1597
+ top = Math.max(gap, vh - tooltipHeight - gap);
1598
+ }
1599
+ let left = rect.left + (rect.width - tooltipWidth) / 2;
1600
+ left = Math.max(gap, Math.min(vw - tooltipWidth - gap, left));
1601
+ tooltip.style.top = `${Math.round(top)}px`;
1602
+ tooltip.style.left = `${Math.round(left)}px`;
1603
+ tooltip.setAttribute("data-placement", placement);
1604
+ }
1605
+ function enableAccessibleTooltips() {
1606
+ if (typeof document === "undefined") return () => {
1607
+ };
1608
+ let tooltipEl = document.createElement("div");
1609
+ tooltipEl.className = "arap-accessible-tooltip";
1610
+ tooltipEl.setAttribute("role", "presentation");
1611
+ tooltipEl.setAttribute("aria-hidden", "true");
1612
+ tooltipEl.setAttribute("data-arap-ui", "true");
1613
+ document.body.appendChild(tooltipEl);
1614
+ let activeTarget = null;
1615
+ let dismissedTarget = null;
1616
+ let hideTimeout = null;
1617
+ let isPointerOverTooltip = false;
1618
+ function show(target, text) {
1619
+ if (hideTimeout) {
1620
+ clearTimeout(hideTimeout);
1621
+ hideTimeout = null;
1622
+ }
1623
+ activeTarget = target;
1624
+ if (!tooltipEl || !document.body.contains(tooltipEl)) {
1625
+ tooltipEl = document.createElement("div");
1626
+ tooltipEl.className = "arap-accessible-tooltip";
1627
+ tooltipEl.setAttribute("role", "presentation");
1628
+ tooltipEl.setAttribute("aria-hidden", "true");
1629
+ tooltipEl.setAttribute("data-arap-ui", "true");
1630
+ document.body.appendChild(tooltipEl);
1631
+ }
1632
+ tooltipEl.textContent = text;
1633
+ tooltipEl.setAttribute("data-visible", "true");
1634
+ positionTooltip(tooltipEl, target);
1635
+ }
1636
+ function hide(immediate = false) {
1637
+ if (hideTimeout) {
1638
+ clearTimeout(hideTimeout);
1639
+ hideTimeout = null;
1640
+ }
1641
+ const doHide = () => {
1642
+ if (isPointerOverTooltip) return;
1643
+ if (tooltipEl) {
1644
+ tooltipEl.removeAttribute("data-visible");
1645
+ tooltipEl.style.top = "-9999px";
1646
+ tooltipEl.style.left = "-9999px";
1647
+ }
1648
+ activeTarget = null;
1649
+ };
1650
+ if (immediate) {
1651
+ doHide();
1652
+ } else {
1653
+ hideTimeout = setTimeout(doHide, 100);
1654
+ }
1655
+ }
1656
+ function findTargetWithDescription(node) {
1657
+ if (!(node instanceof Element)) return null;
1658
+ if (node.closest("[data-arap-ui]")) return null;
1659
+ let curr = node;
1660
+ while (curr && curr !== document.body && curr !== document.documentElement) {
1661
+ const desc = getAuthoredDescription(curr);
1662
+ if (desc) return { element: curr, text: desc };
1663
+ curr = curr.parentElement;
1664
+ }
1665
+ return null;
1666
+ }
1667
+ const handlePointerOver = (event) => {
1668
+ if (tooltipEl && (event.target === tooltipEl || tooltipEl.contains(event.target))) {
1669
+ isPointerOverTooltip = true;
1670
+ if (hideTimeout) {
1671
+ clearTimeout(hideTimeout);
1672
+ hideTimeout = null;
1673
+ }
1674
+ return;
1675
+ }
1676
+ const match = findTargetWithDescription(event.target);
1677
+ if (!match) {
1678
+ if (activeTarget && !isPointerOverTooltip) {
1679
+ hide();
1680
+ }
1681
+ return;
1682
+ }
1683
+ if (match.element === dismissedTarget) {
1684
+ return;
1685
+ }
1686
+ if (match.element === activeTarget) {
1687
+ if (hideTimeout) {
1688
+ clearTimeout(hideTimeout);
1689
+ hideTimeout = null;
1690
+ }
1691
+ return;
1692
+ }
1693
+ show(match.element, match.text);
1694
+ };
1695
+ const handlePointerOut = (event) => {
1696
+ if (dismissedTarget === event.target) {
1697
+ dismissedTarget = null;
1698
+ }
1699
+ if (tooltipEl && (event.target === tooltipEl || tooltipEl.contains(event.target))) {
1700
+ isPointerOverTooltip = false;
1701
+ const related = event.relatedTarget;
1702
+ if (activeTarget && (activeTarget === related || activeTarget.contains(related))) {
1703
+ return;
1704
+ }
1705
+ hide();
1706
+ return;
1707
+ }
1708
+ const match = findTargetWithDescription(event.target);
1709
+ if (match && match.element === activeTarget) {
1710
+ const related = event.relatedTarget;
1711
+ if (tooltipEl && (related === tooltipEl || tooltipEl.contains(related))) {
1712
+ return;
1713
+ }
1714
+ hide();
1715
+ }
1716
+ };
1717
+ const handleFocusIn = (event) => {
1718
+ const match = findTargetWithDescription(event.target);
1719
+ if (!match) {
1720
+ hide(true);
1721
+ return;
1722
+ }
1723
+ if (match.element === dismissedTarget) {
1724
+ return;
1725
+ }
1726
+ show(match.element, match.text);
1727
+ };
1728
+ const handleFocusOut = (event) => {
1729
+ if (dismissedTarget === event.target) {
1730
+ dismissedTarget = null;
1731
+ }
1732
+ if (activeTarget && activeTarget === event.target) {
1733
+ hide(true);
1734
+ }
1735
+ };
1736
+ const handleKeyDown = (event) => {
1737
+ if (event.key === "Escape" && activeTarget) {
1738
+ dismissedTarget = activeTarget;
1739
+ hide(true);
1740
+ }
1741
+ };
1742
+ const handleReposition = () => {
1743
+ if (activeTarget && tooltipEl && tooltipEl.getAttribute("data-visible") === "true") {
1744
+ if (!document.contains(activeTarget)) {
1745
+ hide(true);
1746
+ return;
1747
+ }
1748
+ positionTooltip(tooltipEl, activeTarget);
1749
+ }
1750
+ };
1751
+ document.addEventListener("pointerover", handlePointerOver, {
1752
+ passive: true
1753
+ });
1754
+ document.addEventListener("mouseover", handlePointerOver, { passive: true });
1755
+ document.addEventListener("pointerout", handlePointerOut, { passive: true });
1756
+ document.addEventListener("mouseout", handlePointerOut, { passive: true });
1757
+ document.addEventListener("focusin", handleFocusIn);
1758
+ document.addEventListener("focusout", handleFocusOut);
1759
+ document.addEventListener("keydown", handleKeyDown);
1760
+ window.addEventListener("scroll", handleReposition, { passive: true });
1761
+ window.addEventListener("resize", handleReposition, { passive: true });
1762
+ return () => {
1763
+ if (hideTimeout) clearTimeout(hideTimeout);
1764
+ document.removeEventListener("pointerover", handlePointerOver);
1765
+ document.removeEventListener("mouseover", handlePointerOver);
1766
+ document.removeEventListener("pointerout", handlePointerOut);
1767
+ document.removeEventListener("mouseout", handlePointerOut);
1768
+ document.removeEventListener("focusin", handleFocusIn);
1769
+ document.removeEventListener("focusout", handleFocusOut);
1770
+ document.removeEventListener("keydown", handleKeyDown);
1771
+ window.removeEventListener("scroll", handleReposition);
1772
+ window.removeEventListener("resize", handleReposition);
1773
+ if (tooltipEl) {
1774
+ tooltipEl.remove();
1775
+ tooltipEl = null;
1776
+ }
1777
+ };
1498
1778
  }
1499
1779
  function CustomEffect({
1500
1780
  definition,
@@ -1593,15 +1873,39 @@ function AccessibilityPlugin({
1593
1873
  const definition = registrations.current.get(key);
1594
1874
  if (!validKey(key) || !definition || !validValue(key, value2, definition.defaultValue, definition.validate))
1595
1875
  throw new Error(`Invalid value or unregistered feature: ${key}`);
1596
- setFeatures((previous) => ({ ...previous, [key]: value2 }));
1876
+ setFeatures((previous) => {
1877
+ const copy = { ...previous, [key]: value2 };
1878
+ if (key !== "activeProfile" && key !== PLACEMENT_KEY && previous.activeProfile && typeof previous.activeProfile === "object") {
1879
+ const profileState = previous.activeProfile;
1880
+ const targetKey = key === "fontSize" || key === "textScale" ? "fontScale" : key === "focusHighlight" ? "highlightFocus" : key === "linkHighlight" ? "highlightLinks" : key === "bigCursor" ? "cursorSize" : key === "readingGuide" || key === "readingMask" ? "readerMode" : key;
1881
+ if (profileState.baseSnapshot && (targetKey in profileState.baseSnapshot || key in profileState.baseSnapshot)) {
1882
+ copy.activeProfile = {
1883
+ ...profileState,
1884
+ overrides: {
1885
+ ...profileState.overrides,
1886
+ [targetKey]: value2,
1887
+ [key]: value2
1888
+ }
1889
+ };
1890
+ }
1891
+ }
1892
+ return copy;
1893
+ });
1597
1894
  },
1598
1895
  [setFeatures]
1599
1896
  );
1600
1897
  const resetAll = useCallback2(() => {
1601
1898
  resetFns.current.forEach((fn) => fn());
1602
- setFeatures(
1603
- (previous) => validPlacement(previous[PLACEMENT_KEY]) ? { [PLACEMENT_KEY]: previous[PLACEMENT_KEY] } : {}
1604
- );
1899
+ setFeatures((previous) => {
1900
+ const preserved = {};
1901
+ if (validPlacement(previous[PLACEMENT_KEY])) {
1902
+ preserved[PLACEMENT_KEY] = previous[PLACEMENT_KEY];
1903
+ }
1904
+ if (Array.isArray(previous.customPresets)) {
1905
+ preserved.customPresets = previous.customPresets;
1906
+ }
1907
+ return preserved;
1908
+ });
1605
1909
  }, [setFeatures]);
1606
1910
  const registerReset = useCallback2((key, fn) => {
1607
1911
  resetFns.current.set(key, fn);
@@ -2376,6 +2680,16 @@ var DEFAULT_PREFERENCES = Object.freeze({
2376
2680
  saturation: "original",
2377
2681
  tooltips: false
2378
2682
  });
2683
+ var ALL_PROFILE_IDS = [
2684
+ "motor",
2685
+ "blind",
2686
+ "color-blind",
2687
+ "dyslexia",
2688
+ "low-vision",
2689
+ "cognitive",
2690
+ "seizure",
2691
+ "adhd"
2692
+ ];
2379
2693
  var PROFILE_DEFINITIONS = {
2380
2694
  motor: {
2381
2695
  id: "motor",
@@ -2655,6 +2969,249 @@ function preferencesReducer(state, action) {
2655
2969
  }
2656
2970
  }
2657
2971
 
2972
+ // src/core/profiles.ts
2973
+ function getProfileDefinition(id) {
2974
+ return PROFILE_DEFINITIONS[id];
2975
+ }
2976
+ function mapProfileSettingsToFeatures(settings) {
2977
+ const features = {};
2978
+ if (settings.fontScale !== void 0) {
2979
+ features.fontScale = settings.fontScale;
2980
+ features.textScale = settings.fontScale;
2981
+ features.fontSize = Math.round(settings.fontScale * 100);
2982
+ }
2983
+ if (settings.lineHeight !== void 0) {
2984
+ features.lineHeight = settings.lineHeight !== null ? Math.round(settings.lineHeight * 100) : 100;
2985
+ }
2986
+ if (settings.letterSpacingEm !== void 0) {
2987
+ features.letterSpacingEm = settings.letterSpacingEm;
2988
+ }
2989
+ if (settings.wordSpacingEm !== void 0) {
2990
+ features.wordSpacingEm = settings.wordSpacingEm;
2991
+ }
2992
+ if (settings.paragraphSpacingEm !== void 0) {
2993
+ features.paragraphSpacingEm = settings.paragraphSpacingEm;
2994
+ }
2995
+ if (settings.textAlign !== void 0) {
2996
+ features.textAlign = settings.textAlign === "original" ? "default" : settings.textAlign;
2997
+ }
2998
+ if (settings.contrastMode !== void 0) {
2999
+ features.contrastMode = settings.contrastMode;
3000
+ features.contrast = settings.contrastMode;
3001
+ }
3002
+ if (settings.highlightLinks !== void 0) {
3003
+ features.linkHighlight = settings.highlightLinks;
3004
+ }
3005
+ if (settings.highlightFocus !== void 0) {
3006
+ features.highlightFocus = settings.highlightFocus;
3007
+ features.focusHighlight = settings.highlightFocus;
3008
+ }
3009
+ if (settings.reduceMotion !== void 0) {
3010
+ features.reduceMotion = settings.reduceMotion;
3011
+ }
3012
+ if (settings.hideDecorativeImages !== void 0) {
3013
+ features.hideImages = settings.hideDecorativeImages;
3014
+ }
3015
+ if (settings.fontFamily !== void 0) {
3016
+ features.fontFamily = settings.fontFamily === "original" ? "default" : settings.fontFamily;
3017
+ }
3018
+ if (settings.cursorSize !== void 0) {
3019
+ features.bigCursor = settings.cursorSize === "large";
3020
+ }
3021
+ if (settings.readerMode !== void 0) {
3022
+ if (settings.readerMode === "guide") {
3023
+ features.readingGuide = true;
3024
+ features.readingMask = false;
3025
+ } else if (settings.readerMode === "mask") {
3026
+ features.readingMask = true;
3027
+ features.readingGuide = false;
3028
+ } else {
3029
+ features.readingGuide = false;
3030
+ features.readingMask = false;
3031
+ }
3032
+ }
3033
+ if (settings.saturation !== void 0) {
3034
+ features.saturation = settings.saturation === "low" ? 1 : settings.saturation === "high" ? 2 : 0;
3035
+ }
3036
+ if (settings.tooltips !== void 0) {
3037
+ features.tooltips = settings.tooltips;
3038
+ features.accessibleTooltips = settings.tooltips;
3039
+ }
3040
+ return features;
3041
+ }
3042
+ function mapFeaturesToProfileSettings(features) {
3043
+ const result = {
3044
+ ...DEFAULT_PREFERENCES
3045
+ };
3046
+ if (typeof features.fontScale === "number") {
3047
+ result.fontScale = features.fontScale;
3048
+ } else if (typeof features.textScale === "number") {
3049
+ result.fontScale = features.textScale;
3050
+ } else if (typeof features.fontSize === "number") {
3051
+ result.fontScale = features.fontSize / 100;
3052
+ }
3053
+ if (features.lineHeight !== void 0) {
3054
+ result.lineHeight = typeof features.lineHeight === "number" ? features.lineHeight / 100 : null;
3055
+ }
3056
+ if (typeof features.contrastMode === "string") {
3057
+ result.contrastMode = features.contrastMode === "original" ? "off" : features.contrastMode;
3058
+ }
3059
+ if (features.linkHighlight !== void 0) {
3060
+ result.highlightLinks = Boolean(features.linkHighlight);
3061
+ }
3062
+ if (features.highlightFocus !== void 0 || features.focusHighlight !== void 0) {
3063
+ result.highlightFocus = Boolean(
3064
+ features.highlightFocus ?? features.focusHighlight
3065
+ );
3066
+ }
3067
+ if (features.reduceMotion !== void 0) {
3068
+ result.reduceMotion = Boolean(features.reduceMotion);
3069
+ }
3070
+ if (features.hideImages !== void 0) {
3071
+ result.hideDecorativeImages = Boolean(features.hideImages);
3072
+ }
3073
+ if (typeof features.fontFamily === "string") {
3074
+ result.fontFamily = features.fontFamily === "default" ? "original" : features.fontFamily;
3075
+ }
3076
+ if (features.bigCursor !== void 0) {
3077
+ result.cursorSize = features.bigCursor ? "large" : "original";
3078
+ }
3079
+ if (features.readingMask) {
3080
+ result.readerMode = "mask";
3081
+ } else if (features.readingGuide) {
3082
+ result.readerMode = "guide";
3083
+ } else if (features.readingMask === false || features.readingGuide === false) {
3084
+ result.readerMode = "off";
3085
+ }
3086
+ if (features.tooltips !== void 0 || features.accessibleTooltips !== void 0) {
3087
+ result.tooltips = Boolean(features.tooltips ?? features.accessibleTooltips);
3088
+ }
3089
+ return result;
3090
+ }
3091
+ function applyProfileToStore(profileId, currentFeatures, setFeatureState, existingActiveState) {
3092
+ const profile = PROFILE_DEFINITIONS[profileId];
3093
+ if (!profile) {
3094
+ throw new Error(`Unknown profile identifier: ${profileId}`);
3095
+ }
3096
+ const currentSettings = mapFeaturesToProfileSettings(currentFeatures);
3097
+ const targetSettings = profile.settings;
3098
+ const baseSnapshot = {
3099
+ ...existingActiveState?.baseSnapshot ?? {}
3100
+ };
3101
+ for (const k of Object.keys(targetSettings)) {
3102
+ if (!(k in baseSnapshot)) {
3103
+ baseSnapshot[k] = currentSettings[k];
3104
+ }
3105
+ }
3106
+ const activeProfileState = {
3107
+ profileId,
3108
+ baseSnapshot,
3109
+ overrides: {}
3110
+ };
3111
+ const targetFeatures = mapProfileSettingsToFeatures(targetSettings);
3112
+ for (const [key, val] of Object.entries(targetFeatures)) {
3113
+ try {
3114
+ setFeatureState(key, val);
3115
+ } catch {
3116
+ }
3117
+ }
3118
+ try {
3119
+ setFeatureState("activeProfile", activeProfileState);
3120
+ } catch {
3121
+ }
3122
+ return activeProfileState;
3123
+ }
3124
+ function revertProfileFromStore(activeProfileState, setFeatureState) {
3125
+ const { baseSnapshot, overrides } = activeProfileState;
3126
+ const restoredSettings = {};
3127
+ for (const [k, baseVal] of Object.entries(baseSnapshot)) {
3128
+ const key = k;
3129
+ if (key in overrides) {
3130
+ restoredSettings[key] = overrides[key];
3131
+ } else {
3132
+ restoredSettings[key] = baseVal;
3133
+ }
3134
+ }
3135
+ const restoredFeatures = mapProfileSettingsToFeatures(restoredSettings);
3136
+ for (const [key, val] of Object.entries(restoredFeatures)) {
3137
+ try {
3138
+ setFeatureState(key, val);
3139
+ } catch {
3140
+ }
3141
+ }
3142
+ try {
3143
+ setFeatureState("activeProfile", null);
3144
+ } catch {
3145
+ }
3146
+ }
3147
+ function recordProfileOverride(key, value, activeProfileState, setFeatureState) {
3148
+ if (!activeProfileState) return null;
3149
+ const nextOverrides = {
3150
+ ...activeProfileState.overrides,
3151
+ [key]: value
3152
+ };
3153
+ const nextState = {
3154
+ ...activeProfileState,
3155
+ overrides: nextOverrides
3156
+ };
3157
+ try {
3158
+ setFeatureState("activeProfile", nextState);
3159
+ } catch {
3160
+ }
3161
+ return nextState;
3162
+ }
3163
+
3164
+ // src/core/useProfiles.ts
3165
+ import { useCallback as useCallback4, useContext as useContext6 } from "react";
3166
+ function useProfiles() {
3167
+ const ctx = useContext6(AccessibilityContext);
3168
+ if (!ctx) {
3169
+ throw new Error(
3170
+ "useProfiles must be used within an <AccessibilityPlugin> provider."
3171
+ );
3172
+ }
3173
+ const { value: activeProfileState, setValue: setActiveProfileState } = useAccessibility("activeProfile", null);
3174
+ const applyProfile = useCallback4(
3175
+ (profileId) => {
3176
+ const nextState = applyProfileToStore(
3177
+ profileId,
3178
+ ctx.state.features,
3179
+ ctx.setFeatureState,
3180
+ activeProfileState
3181
+ );
3182
+ setActiveProfileState(nextState);
3183
+ },
3184
+ [
3185
+ ctx.state.features,
3186
+ ctx.setFeatureState,
3187
+ activeProfileState,
3188
+ setActiveProfileState
3189
+ ]
3190
+ );
3191
+ const revertProfile = useCallback4(() => {
3192
+ if (activeProfileState) {
3193
+ revertProfileFromStore(activeProfileState, ctx.setFeatureState);
3194
+ setActiveProfileState(null);
3195
+ }
3196
+ }, [activeProfileState, ctx.setFeatureState, setActiveProfileState]);
3197
+ const activeProfileId = activeProfileState?.profileId ?? null;
3198
+ const activeProfile = activeProfileId ? getProfileDefinition(activeProfileId) ?? null : null;
3199
+ const isProfileActive = useCallback4(
3200
+ (id) => activeProfileId === id,
3201
+ [activeProfileId]
3202
+ );
3203
+ const allProfiles = ALL_PROFILE_IDS.map((id) => PROFILE_DEFINITIONS[id]);
3204
+ return {
3205
+ profiles: allProfiles,
3206
+ activeProfileId,
3207
+ activeProfile,
3208
+ activeProfileState,
3209
+ applyProfile,
3210
+ revertProfile,
3211
+ isProfileActive
3212
+ };
3213
+ }
3214
+
2658
3215
  // src/core/FeatureIcon.tsx
2659
3216
  import { Fragment, jsx as jsx7, jsxs as jsxs5 } from "react/jsx-runtime";
2660
3217
  var drawings = {
@@ -2719,6 +3276,27 @@ var drawings = {
2719
3276
  /* @__PURE__ */ jsx7("path", { d: "M3 5h18M3 10h12M3 19h18" }),
2720
3277
  /* @__PURE__ */ jsx7("path", { d: "M2 15h20", strokeWidth: "3" })
2721
3278
  ] }),
3279
+ tooltips: /* @__PURE__ */ jsxs5(Fragment, { children: [
3280
+ /* @__PURE__ */ jsx7("path", { d: "M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" }),
3281
+ /* @__PURE__ */ jsx7("path", { d: "M8 9h8M8 13h5" })
3282
+ ] }),
3283
+ accessibleTooltips: /* @__PURE__ */ jsxs5(Fragment, { children: [
3284
+ /* @__PURE__ */ jsx7("path", { d: "M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" }),
3285
+ /* @__PURE__ */ jsx7("path", { d: "M8 9h8M8 13h5" })
3286
+ ] }),
3287
+ pageNavigator: /* @__PURE__ */ jsxs5(Fragment, { children: [
3288
+ /* @__PURE__ */ jsx7("circle", { cx: "12", cy: "12", r: "9" }),
3289
+ /* @__PURE__ */ jsx7("polygon", { points: "12 3 15.5 10.5 12 9 8.5 10.5 12 3", fill: "currentColor" }),
3290
+ /* @__PURE__ */ jsx7("polygon", { points: "12 21 8.5 13.5 12 15 15.5 13.5 12 21" })
3291
+ ] }),
3292
+ headings: /* @__PURE__ */ jsx7(Fragment, { children: /* @__PURE__ */ jsx7("path", { d: "M4 6v12M14 6v12M4 12h10M18 10h3M18 14h3M18 18h3" }) }),
3293
+ landmarks: /* @__PURE__ */ jsx7(Fragment, { children: /* @__PURE__ */ jsx7("path", { d: "M4 15s1-1 4-1 5 2 8 2 4-1 4-1V3s-1 1-4 1-5-2-8-2-4 1-4 1zM4 22v-7" }) }),
3294
+ profiles: /* @__PURE__ */ jsxs5(Fragment, { children: [
3295
+ /* @__PURE__ */ jsx7("path", { d: "M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2" }),
3296
+ /* @__PURE__ */ jsx7("circle", { cx: "9", cy: "7", r: "4" }),
3297
+ /* @__PURE__ */ jsx7("path", { d: "M22 21v-2a4 4 0 0 0-3-3.87M16 3.13a4 4 0 0 1 0 7.75" })
3298
+ ] }),
3299
+ presets: /* @__PURE__ */ jsx7(Fragment, { children: /* @__PURE__ */ jsx7("path", { d: "M19 21l-7-5-7 5V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z" }) }),
2722
3300
  reset: /* @__PURE__ */ jsx7(Fragment, { children: /* @__PURE__ */ jsx7("path", { d: "M3 10a9 9 0 1 1 1 7M3 4v6h6" }) })
2723
3301
  };
2724
3302
  function FeatureIcon({ name }) {
@@ -4049,90 +4627,1903 @@ function ReduceMotionController() {
4049
4627
  ] });
4050
4628
  }
4051
4629
 
4052
- // src/features/ResetController.tsx
4053
- import { createPortal as createPortal2 } from "react-dom";
4054
- import { useContext as useContext6 } from "react";
4630
+ // src/features/TooltipsController.tsx
4055
4631
  import { jsx as jsx29, jsxs as jsxs27 } from "react/jsx-runtime";
4056
- function ResetController() {
4057
- const ctx = useContext6(AccessibilityContext);
4058
- if (!ctx) {
4059
- throw new Error(
4060
- "ResetController must be used within an <AccessibilityPlugin> provider."
4061
- );
4062
- }
4063
- const actionHost = useContext6(PanelActionsContext);
4064
- const { resetAll } = ctx;
4065
- const strings = resolveLocaleStrings(ctx.locale);
4066
- const button = /* @__PURE__ */ jsx29("div", { className: "arap-feature arap-feature-reset", children: /* @__PURE__ */ jsxs27("button", { className: "arap-reset-btn", onClick: resetAll, type: "button", children: [
4067
- /* @__PURE__ */ jsx29(FeatureIcon, { name: "reset" }),
4068
- strings.resetAll
4069
- ] }) });
4070
- return actionHost ? createPortal2(button, actionHost) : button;
4071
- }
4072
-
4073
- // src/core/controls/ToggleControl.tsx
4074
- import { jsx as jsx30 } from "react/jsx-runtime";
4075
- function ToggleControl({
4076
- id,
4077
- label,
4078
- checked,
4079
- onChange,
4080
- disabled = false,
4081
- unavailable = false,
4082
- unavailableReason,
4083
- name,
4084
- description,
4085
- largeControls = false,
4632
+ var FEATURE_KEY22 = "tooltips";
4633
+ var DEFAULT_VALUE22 = false;
4634
+ function TooltipsController({
4086
4635
  className = "",
4087
- style
4636
+ label = "Accessible Tooltips",
4637
+ description = "Show authored alt text and descriptions on hover or focus"
4088
4638
  }) {
4089
- const isInteractive = !disabled && !unavailable;
4090
- const toggleLabel = typeof label === "string" ? label : void 0;
4091
- const handleClick = () => {
4092
- if (isInteractive) {
4093
- onChange(!checked);
4094
- }
4095
- };
4096
- return /* @__PURE__ */ jsx30(
4639
+ const { value, setValue } = useAccessibility(
4640
+ FEATURE_KEY22,
4641
+ DEFAULT_VALUE22
4642
+ );
4643
+ return /* @__PURE__ */ jsxs27(
4097
4644
  "div",
4098
4645
  {
4099
- className: `arap-toggle-wrapper ${largeControls ? "arap-large-controls" : ""} ${className}`,
4100
- style,
4101
- children: /* @__PURE__ */ jsx30(
4102
- "button",
4103
- {
4104
- id,
4105
- name,
4106
- type: "button",
4107
- className: `arap-toggle ${checked ? "arap-toggle-active" : ""}`,
4108
- role: "switch",
4109
- "aria-checked": checked,
4110
- "aria-label": toggleLabel,
4111
- "aria-disabled": !isInteractive,
4112
- disabled: !isInteractive,
4113
- onClick: handleClick,
4114
- title: unavailableReason || description || toggleLabel,
4115
- children: /* @__PURE__ */ jsx30(
4116
- "span",
4117
- {
4118
- className: "arap-toggle-knob",
4119
- style: {
4120
- transform: checked ? largeControls ? "translateX(28px)" : "translateX(24px)" : "translateX(0)"
4646
+ className: `arap-feature ${className}`,
4647
+ role: "group",
4648
+ "aria-label": label,
4649
+ children: [
4650
+ /* @__PURE__ */ jsxs27("span", { className: "arap-label", children: [
4651
+ /* @__PURE__ */ jsx29(FeatureIcon, { name: FEATURE_KEY22 }),
4652
+ /* @__PURE__ */ jsxs27("span", { children: [
4653
+ /* @__PURE__ */ jsx29("span", { style: { display: "block" }, children: label }),
4654
+ description && /* @__PURE__ */ jsx29(
4655
+ "span",
4656
+ {
4657
+ style: {
4658
+ display: "block",
4659
+ fontSize: "11px",
4660
+ fontWeight: 400,
4661
+ color: "var(--arap-muted, #64748b)",
4662
+ marginTop: "1px"
4663
+ },
4664
+ children: description
4121
4665
  }
4122
- }
4123
- )
4124
- }
4125
- )
4126
- }
4127
- );
4128
- }
4129
-
4130
- // src/core/controls/ChoiceControl.tsx
4131
- import { useCallback as useCallback4, useMemo as useMemo2, useRef as useRef5 } from "react";
4132
- import { jsx as jsx31, jsxs as jsxs28 } from "react/jsx-runtime";
4133
- function ChoiceControl({
4134
- id,
4135
- label,
4666
+ )
4667
+ ] })
4668
+ ] }),
4669
+ /* @__PURE__ */ jsx29(
4670
+ "button",
4671
+ {
4672
+ className: `arap-toggle ${value ? "arap-toggle-active" : ""}`,
4673
+ onClick: () => setValue(!value),
4674
+ "aria-label": label,
4675
+ "aria-pressed": Boolean(value),
4676
+ type: "button",
4677
+ children: /* @__PURE__ */ jsx29("span", { className: "arap-toggle-knob", "aria-hidden": "true" })
4678
+ }
4679
+ )
4680
+ ]
4681
+ }
4682
+ );
4683
+ }
4684
+ var AccessibleTooltipsController = TooltipsController;
4685
+
4686
+ // src/features/PageNavigatorController.tsx
4687
+ import { useState as useState7, useEffect as useEffect7, useRef as useRef5, useCallback as useCallback5 } from "react";
4688
+
4689
+ // src/core/pageNavigator.ts
4690
+ var EXCLUDED_TAGS = /* @__PURE__ */ new Set([
4691
+ "SCRIPT",
4692
+ "STYLE",
4693
+ "LINK",
4694
+ "META",
4695
+ "NOSCRIPT",
4696
+ "TEMPLATE"
4697
+ ]);
4698
+ function isElementVisible(el) {
4699
+ if (el.getAttribute("aria-hidden") === "true") return false;
4700
+ if (el.getAttribute("hidden") !== null) return false;
4701
+ if (el.closest("[aria-hidden='true']")) return false;
4702
+ if (el.style.display === "none" || el.style.visibility === "hidden") {
4703
+ return false;
4704
+ }
4705
+ return true;
4706
+ }
4707
+ function scanHeadings(root) {
4708
+ const doc = root || (typeof document !== "undefined" ? document : null);
4709
+ if (!doc) return [];
4710
+ const candidates = doc.querySelectorAll(
4711
+ "h1, h2, h3, h4, h5, h6, [role='heading']"
4712
+ );
4713
+ const items = [];
4714
+ let index = 0;
4715
+ candidates.forEach((node) => {
4716
+ if (!(node instanceof HTMLElement)) return;
4717
+ if (EXCLUDED_TAGS.has(node.tagName)) return;
4718
+ if (node.closest("[data-arap-ui]")) return;
4719
+ if (!isElementVisible(node)) return;
4720
+ let level = 2;
4721
+ const match = node.tagName.match(/^H([1-6])$/i);
4722
+ if (match) {
4723
+ level = parseInt(match[1], 10);
4724
+ } else if (node.getAttribute("role") === "heading") {
4725
+ const ariaLevel = parseInt(node.getAttribute("aria-level") || "2", 10);
4726
+ level = Math.max(1, Math.min(6, isNaN(ariaLevel) ? 2 : ariaLevel));
4727
+ }
4728
+ const text = node.getAttribute("aria-label")?.trim() || node.textContent?.trim() || "";
4729
+ if (!text) return;
4730
+ items.push({
4731
+ id: node.id || `arap-heading-${++index}`,
4732
+ level,
4733
+ text,
4734
+ element: node
4735
+ });
4736
+ });
4737
+ return items;
4738
+ }
4739
+ var LANDMARK_TAGS = {
4740
+ HEADER: "banner",
4741
+ NAV: "navigation",
4742
+ MAIN: "main",
4743
+ ASIDE: "complementary",
4744
+ FOOTER: "contentinfo",
4745
+ FORM: "form",
4746
+ SECTION: "region"
4747
+ };
4748
+ var LANDMARK_TITLES = {
4749
+ banner: "Header (Banner)",
4750
+ navigation: "Navigation",
4751
+ main: "Main Content",
4752
+ complementary: "Sidebar (Complementary)",
4753
+ contentinfo: "Footer (Content Info)",
4754
+ search: "Search",
4755
+ region: "Region",
4756
+ form: "Form"
4757
+ };
4758
+ function isScopedHeaderOrFooter(el) {
4759
+ const parentSection = el.parentElement?.closest(
4760
+ "article, aside, main, nav, section"
4761
+ );
4762
+ return Boolean(parentSection && !parentSection.closest("[data-arap-ui]"));
4763
+ }
4764
+ function scanLandmarks(root) {
4765
+ const doc = root || (typeof document !== "undefined" ? document : null);
4766
+ if (!doc) return [];
4767
+ const candidates = doc.querySelectorAll(
4768
+ "header, nav, main, aside, footer, form[role='search'], [role='banner'], [role='navigation'], [role='main'], [role='complementary'], [role='contentinfo'], [role='search'], [role='region'][aria-label], [role='region'][aria-labelledby], section[aria-label], section[aria-labelledby], a[id]:not([href]), a[name]"
4769
+ );
4770
+ const items = [];
4771
+ let index = 0;
4772
+ candidates.forEach((node) => {
4773
+ if (!(node instanceof HTMLElement)) return;
4774
+ if (EXCLUDED_TAGS.has(node.tagName)) return;
4775
+ if (node.closest("[data-arap-ui]")) return;
4776
+ if (!isElementVisible(node)) return;
4777
+ let type = "";
4778
+ const explicitRole = node.getAttribute("role");
4779
+ if (explicitRole && [
4780
+ "banner",
4781
+ "navigation",
4782
+ "main",
4783
+ "complementary",
4784
+ "contentinfo",
4785
+ "search",
4786
+ "region",
4787
+ "form"
4788
+ ].includes(explicitRole)) {
4789
+ type = explicitRole;
4790
+ } else if (node.tagName in LANDMARK_TAGS) {
4791
+ if ((node.tagName === "HEADER" || node.tagName === "FOOTER") && isScopedHeaderOrFooter(node)) {
4792
+ return;
4793
+ }
4794
+ type = LANDMARK_TAGS[node.tagName];
4795
+ } else if (node.tagName === "A" && (node.id || node.getAttribute("name"))) {
4796
+ type = "anchor";
4797
+ }
4798
+ if (!type) return;
4799
+ let label = node.getAttribute("aria-label")?.trim() || "";
4800
+ if (!label && node.getAttribute("aria-labelledby")) {
4801
+ const labelId = node.getAttribute("aria-labelledby").trim();
4802
+ const labelEl = document.getElementById(labelId);
4803
+ if (labelEl) {
4804
+ label = labelEl.textContent?.trim() || "";
4805
+ }
4806
+ }
4807
+ if (!label) {
4808
+ if (type === "anchor") {
4809
+ label = node.textContent?.trim() || node.id || node.getAttribute("name") || "Named Anchor";
4810
+ } else {
4811
+ label = LANDMARK_TITLES[type] || type.charAt(0).toUpperCase() + type.slice(1);
4812
+ }
4813
+ }
4814
+ items.push({
4815
+ id: node.id || `arap-landmark-${++index}`,
4816
+ type,
4817
+ label,
4818
+ element: node
4819
+ });
4820
+ });
4821
+ return items;
4822
+ }
4823
+ function navigateToElement(element, options = {}) {
4824
+ if (!element || !element.isConnected) return;
4825
+ const isNaturallyFocusable = element instanceof HTMLAnchorElement || element instanceof HTMLButtonElement || element instanceof HTMLInputElement || element instanceof HTMLSelectElement || element instanceof HTMLTextAreaElement || element.hasAttribute("tabindex");
4826
+ const hadTabIndex = element.hasAttribute("tabindex");
4827
+ const previousTabIndex = element.getAttribute("tabindex");
4828
+ if (!isNaturallyFocusable) {
4829
+ element.setAttribute("tabindex", "-1");
4830
+ }
4831
+ const isReduced = typeof window !== "undefined" && window.matchMedia && window.matchMedia("(prefers-reduced-motion: reduce)").matches;
4832
+ const behavior = options.behavior ?? (isReduced ? "auto" : "smooth");
4833
+ element.scrollIntoView({ behavior, block: "start" });
4834
+ element.focus();
4835
+ if (!isNaturallyFocusable) {
4836
+ const handleBlur = () => {
4837
+ if (hadTabIndex && previousTabIndex !== null) {
4838
+ element.setAttribute("tabindex", previousTabIndex);
4839
+ } else {
4840
+ element.removeAttribute("tabindex");
4841
+ }
4842
+ element.removeEventListener("blur", handleBlur);
4843
+ };
4844
+ element.addEventListener("blur", handleBlur, { once: true });
4845
+ }
4846
+ options.onComplete?.();
4847
+ }
4848
+ function subscribePageStructure(callback) {
4849
+ if (typeof MutationObserver === "undefined" || typeof document === "undefined" || !document.body) {
4850
+ return () => {
4851
+ };
4852
+ }
4853
+ let timer = null;
4854
+ const observer = new MutationObserver((mutations) => {
4855
+ const isExternal = mutations.some((m) => {
4856
+ const target = m.target;
4857
+ if (target instanceof Element && target.closest("[data-arap-ui]")) {
4858
+ return false;
4859
+ }
4860
+ return [...m.addedNodes, ...m.removedNodes].some((node) => {
4861
+ return !(node instanceof Element && node.closest("[data-arap-ui]"));
4862
+ });
4863
+ });
4864
+ if (!isExternal) return;
4865
+ if (timer) clearTimeout(timer);
4866
+ timer = setTimeout(() => {
4867
+ callback();
4868
+ }, 100);
4869
+ });
4870
+ observer.observe(document.body, { childList: true, subtree: true });
4871
+ return () => {
4872
+ if (timer) clearTimeout(timer);
4873
+ observer.disconnect();
4874
+ };
4875
+ }
4876
+
4877
+ // src/features/PageNavigatorController.tsx
4878
+ import { jsx as jsx30, jsxs as jsxs28 } from "react/jsx-runtime";
4879
+ function PageNavigatorController({
4880
+ className = "",
4881
+ label = "Page Navigator",
4882
+ description = "Explore headings and landmarks",
4883
+ closeOnNavigate = false
4884
+ }) {
4885
+ const [isOpen, setIsOpen] = useState7(false);
4886
+ const [activeTab, setActiveTab] = useState7(
4887
+ "headings"
4888
+ );
4889
+ const [headings, setHeadings] = useState7([]);
4890
+ const [landmarks, setLandmarks] = useState7([]);
4891
+ const [search, setSearch] = useState7("");
4892
+ const triggerRef = useRef5(null);
4893
+ const dialogRef = useRef5(null);
4894
+ const refreshStructure = useCallback5(() => {
4895
+ setHeadings(scanHeadings());
4896
+ setLandmarks(scanLandmarks());
4897
+ }, []);
4898
+ const handleOpen = () => {
4899
+ refreshStructure();
4900
+ setIsOpen(true);
4901
+ };
4902
+ const handleClose = () => {
4903
+ setIsOpen(false);
4904
+ triggerRef.current?.focus();
4905
+ };
4906
+ useEffect7(() => {
4907
+ if (!isOpen) return;
4908
+ return subscribePageStructure(refreshStructure);
4909
+ }, [isOpen, refreshStructure]);
4910
+ useEffect7(() => {
4911
+ if (isOpen) {
4912
+ dialogRef.current?.focus();
4913
+ }
4914
+ }, [isOpen]);
4915
+ const handleNavigate = (element) => {
4916
+ navigateToElement(element, {
4917
+ onComplete: () => {
4918
+ if (closeOnNavigate) {
4919
+ setIsOpen(false);
4920
+ }
4921
+ }
4922
+ });
4923
+ };
4924
+ const filteredHeadings = search.trim() ? headings.filter(
4925
+ (h) => h.text.toLowerCase().includes(search.toLowerCase())
4926
+ ) : headings;
4927
+ const filteredLandmarks = search.trim() ? landmarks.filter(
4928
+ (l) => l.label.toLowerCase().includes(search.toLowerCase())
4929
+ ) : landmarks;
4930
+ return /* @__PURE__ */ jsxs28(
4931
+ "div",
4932
+ {
4933
+ className: `arap-feature arap-feature-expandable ${className}`,
4934
+ role: "group",
4935
+ "aria-label": label,
4936
+ children: [
4937
+ /* @__PURE__ */ jsxs28(
4938
+ "div",
4939
+ {
4940
+ style: {
4941
+ display: "flex",
4942
+ alignItems: "center",
4943
+ justifyContent: "space-between",
4944
+ width: "100%"
4945
+ },
4946
+ children: [
4947
+ /* @__PURE__ */ jsxs28("span", { className: "arap-label", children: [
4948
+ /* @__PURE__ */ jsx30(FeatureIcon, { name: "pageNavigator" }),
4949
+ /* @__PURE__ */ jsxs28("span", { children: [
4950
+ /* @__PURE__ */ jsx30("span", { style: { display: "block" }, children: label }),
4951
+ description && /* @__PURE__ */ jsx30(
4952
+ "span",
4953
+ {
4954
+ style: {
4955
+ display: "block",
4956
+ fontSize: "11px",
4957
+ fontWeight: 400,
4958
+ color: "var(--arap-muted, #64748b)",
4959
+ marginTop: "1px"
4960
+ },
4961
+ children: description
4962
+ }
4963
+ )
4964
+ ] })
4965
+ ] }),
4966
+ /* @__PURE__ */ jsx30(
4967
+ "button",
4968
+ {
4969
+ ref: triggerRef,
4970
+ className: "arap-btn-sm",
4971
+ type: "button",
4972
+ "aria-expanded": isOpen,
4973
+ "aria-controls": "arap-page-navigator-dialog",
4974
+ onClick: () => {
4975
+ if (isOpen) {
4976
+ handleClose();
4977
+ } else {
4978
+ handleOpen();
4979
+ }
4980
+ },
4981
+ children: isOpen ? "Close" : "Explore"
4982
+ }
4983
+ )
4984
+ ]
4985
+ }
4986
+ ),
4987
+ isOpen && /* @__PURE__ */ jsxs28(
4988
+ "div",
4989
+ {
4990
+ ref: dialogRef,
4991
+ id: "arap-page-navigator-dialog",
4992
+ className: "arap-navigator-dialog",
4993
+ role: "region",
4994
+ "aria-label": "Page Structure Explorer",
4995
+ tabIndex: -1,
4996
+ onKeyDown: (event) => {
4997
+ if (event.key === "Escape") {
4998
+ event.stopPropagation();
4999
+ handleClose();
5000
+ }
5001
+ },
5002
+ children: [
5003
+ /* @__PURE__ */ jsxs28(
5004
+ "div",
5005
+ {
5006
+ className: "arap-navigator-tabs",
5007
+ role: "tablist",
5008
+ "aria-label": "Structure views",
5009
+ children: [
5010
+ /* @__PURE__ */ jsxs28(
5011
+ "button",
5012
+ {
5013
+ id: "arap-tab-headings",
5014
+ className: `arap-navigator-tab ${activeTab === "headings" ? "arap-navigator-tab-active" : ""}`,
5015
+ role: "tab",
5016
+ "aria-selected": activeTab === "headings",
5017
+ "aria-controls": "arap-panel-headings",
5018
+ type: "button",
5019
+ onClick: () => setActiveTab("headings"),
5020
+ onKeyDown: (e) => {
5021
+ if (e.key === "ArrowRight") {
5022
+ document.getElementById("arap-tab-landmarks")?.focus();
5023
+ setActiveTab("landmarks");
5024
+ }
5025
+ },
5026
+ children: [
5027
+ /* @__PURE__ */ jsx30(FeatureIcon, { name: "headings" }),
5028
+ /* @__PURE__ */ jsxs28("span", { children: [
5029
+ "Headings (",
5030
+ headings.length,
5031
+ ")"
5032
+ ] })
5033
+ ]
5034
+ }
5035
+ ),
5036
+ /* @__PURE__ */ jsxs28(
5037
+ "button",
5038
+ {
5039
+ id: "arap-tab-landmarks",
5040
+ className: `arap-navigator-tab ${activeTab === "landmarks" ? "arap-navigator-tab-active" : ""}`,
5041
+ role: "tab",
5042
+ "aria-selected": activeTab === "landmarks",
5043
+ "aria-controls": "arap-panel-landmarks",
5044
+ type: "button",
5045
+ onClick: () => setActiveTab("landmarks"),
5046
+ onKeyDown: (e) => {
5047
+ if (e.key === "ArrowLeft") {
5048
+ document.getElementById("arap-tab-headings")?.focus();
5049
+ setActiveTab("headings");
5050
+ }
5051
+ },
5052
+ children: [
5053
+ /* @__PURE__ */ jsx30(FeatureIcon, { name: "landmarks" }),
5054
+ /* @__PURE__ */ jsxs28("span", { children: [
5055
+ "Landmarks (",
5056
+ landmarks.length,
5057
+ ")"
5058
+ ] })
5059
+ ]
5060
+ }
5061
+ )
5062
+ ]
5063
+ }
5064
+ ),
5065
+ /* @__PURE__ */ jsx30("div", { className: "arap-navigator-search-box", children: /* @__PURE__ */ jsx30(
5066
+ "input",
5067
+ {
5068
+ type: "search",
5069
+ className: "arap-navigator-search",
5070
+ placeholder: `Filter ${activeTab}...`,
5071
+ value: search,
5072
+ onChange: (e) => setSearch(e.target.value),
5073
+ "aria-label": `Filter ${activeTab}`
5074
+ }
5075
+ ) }),
5076
+ /* @__PURE__ */ jsxs28("div", { className: "arap-navigator-content", children: [
5077
+ activeTab === "headings" && /* @__PURE__ */ jsx30(
5078
+ "div",
5079
+ {
5080
+ id: "arap-panel-headings",
5081
+ role: "tabpanel",
5082
+ "aria-labelledby": "arap-tab-headings",
5083
+ children: filteredHeadings.length === 0 ? /* @__PURE__ */ jsx30("div", { className: "arap-navigator-empty", role: "status", children: headings.length === 0 ? "No headings found on this page." : "No matching headings." }) : /* @__PURE__ */ jsx30("ul", { className: "arap-navigator-list", role: "list", children: filteredHeadings.map((h, i) => /* @__PURE__ */ jsx30("li", { className: "arap-navigator-item", children: /* @__PURE__ */ jsxs28(
5084
+ "button",
5085
+ {
5086
+ type: "button",
5087
+ className: "arap-navigator-jump-btn",
5088
+ style: {
5089
+ paddingLeft: `${Math.max(8, (h.level - 1) * 12 + 8)}px`
5090
+ },
5091
+ onClick: () => handleNavigate(h.element),
5092
+ children: [
5093
+ /* @__PURE__ */ jsxs28(
5094
+ "span",
5095
+ {
5096
+ className: "arap-navigator-badge arap-navigator-badge-h",
5097
+ "aria-hidden": "true",
5098
+ children: [
5099
+ "H",
5100
+ h.level
5101
+ ]
5102
+ }
5103
+ ),
5104
+ /* @__PURE__ */ jsx30("span", { className: "arap-navigator-item-text", children: h.text })
5105
+ ]
5106
+ }
5107
+ ) }, `${h.id}-${i}`)) })
5108
+ }
5109
+ ),
5110
+ activeTab === "landmarks" && /* @__PURE__ */ jsx30(
5111
+ "div",
5112
+ {
5113
+ id: "arap-panel-landmarks",
5114
+ role: "tabpanel",
5115
+ "aria-labelledby": "arap-tab-landmarks",
5116
+ children: filteredLandmarks.length === 0 ? /* @__PURE__ */ jsx30("div", { className: "arap-navigator-empty", role: "status", children: landmarks.length === 0 ? "No landmarks found on this page." : "No matching landmarks." }) : /* @__PURE__ */ jsx30("ul", { className: "arap-navigator-list", role: "list", children: filteredLandmarks.map((l, i) => /* @__PURE__ */ jsx30("li", { className: "arap-navigator-item", children: /* @__PURE__ */ jsxs28(
5117
+ "button",
5118
+ {
5119
+ type: "button",
5120
+ className: "arap-navigator-jump-btn",
5121
+ onClick: () => handleNavigate(l.element),
5122
+ children: [
5123
+ /* @__PURE__ */ jsx30(
5124
+ "span",
5125
+ {
5126
+ className: "arap-navigator-badge arap-navigator-badge-l",
5127
+ "aria-hidden": "true",
5128
+ children: l.type.toUpperCase()
5129
+ }
5130
+ ),
5131
+ /* @__PURE__ */ jsx30("span", { className: "arap-navigator-item-text", children: l.label })
5132
+ ]
5133
+ }
5134
+ ) }, `${l.id}-${i}`)) })
5135
+ }
5136
+ )
5137
+ ] })
5138
+ ]
5139
+ }
5140
+ )
5141
+ ]
5142
+ }
5143
+ );
5144
+ }
5145
+ var HeadingsNavigatorController = PageNavigatorController;
5146
+ var PageStructureController = PageNavigatorController;
5147
+
5148
+ // src/features/ProfilesController.tsx
5149
+ import { useId as useId2, useMemo as useMemo2, useRef as useRef6, useState as useState8 } from "react";
5150
+
5151
+ // src/core/controls/ProfilePreviewCard.tsx
5152
+ import { jsx as jsx31, jsxs as jsxs29 } from "react/jsx-runtime";
5153
+ function ProfilePreviewCard({
5154
+ profile,
5155
+ isActive,
5156
+ onApply,
5157
+ onRevert,
5158
+ largeControls = false,
5159
+ className = "",
5160
+ style
5161
+ }) {
5162
+ const affectedKeys = Object.keys(
5163
+ profile.settings
5164
+ );
5165
+ const formatKeyName = (key) => {
5166
+ switch (key) {
5167
+ case "fontScale":
5168
+ return "Font Size";
5169
+ case "lineHeight":
5170
+ return "Line Height";
5171
+ case "contrastMode":
5172
+ return "Contrast";
5173
+ case "reduceMotion":
5174
+ return "Reduce Motion";
5175
+ case "textAlign":
5176
+ return "Text Align";
5177
+ case "highlightLinks":
5178
+ return "Highlight Links";
5179
+ case "highlightFocus":
5180
+ return "Highlight Focus";
5181
+ case "cursorSize":
5182
+ return "Cursor Size";
5183
+ case "readerMode":
5184
+ return "Reading Mode";
5185
+ case "saturation":
5186
+ return "Saturation";
5187
+ case "hideDecorativeImages":
5188
+ return "Hide Images";
5189
+ default:
5190
+ return key.replace(/([A-Z])/g, " $1").trim();
5191
+ }
5192
+ };
5193
+ const formatSettingValue = (key, val) => {
5194
+ if (typeof val === "boolean") return val ? "On" : "Off";
5195
+ if (key === "fontScale" && typeof val === "number")
5196
+ return `${Math.round(val * 100)}%`;
5197
+ if (key === "lineHeight" && typeof val === "number")
5198
+ return `${Math.round(val * 100)}%`;
5199
+ if (val === null || val === void 0) return "Original";
5200
+ return String(val);
5201
+ };
5202
+ return /* @__PURE__ */ jsxs29(
5203
+ "div",
5204
+ {
5205
+ role: "group",
5206
+ "aria-label": `${profile.label} profile`,
5207
+ className: `arap-profile-card ${isActive ? "arap-profile-card-active" : ""} ${largeControls ? "arap-large-controls" : ""} ${className}`,
5208
+ style,
5209
+ children: [
5210
+ /* @__PURE__ */ jsxs29("div", { className: "arap-profile-header", children: [
5211
+ /* @__PURE__ */ jsxs29("div", { className: "arap-profile-title-row", children: [
5212
+ /* @__PURE__ */ jsx31("h4", { className: "arap-profile-title", children: profile.label }),
5213
+ isActive && /* @__PURE__ */ jsx31(
5214
+ "span",
5215
+ {
5216
+ className: "arap-profile-active-badge",
5217
+ "aria-label": "Active profile",
5218
+ children: "\u2713 Active"
5219
+ }
5220
+ )
5221
+ ] }),
5222
+ /* @__PURE__ */ jsx31("p", { className: "arap-profile-desc", children: profile.description })
5223
+ ] }),
5224
+ /* @__PURE__ */ jsxs29("div", { className: "arap-profile-affected", children: [
5225
+ /* @__PURE__ */ jsx31("span", { className: "arap-profile-affected-label", children: "Affected settings:" }),
5226
+ /* @__PURE__ */ jsx31("div", { className: "arap-profile-chips", children: affectedKeys.map((key) => {
5227
+ const val = profile.settings[key];
5228
+ return /* @__PURE__ */ jsxs29("span", { className: "arap-profile-chip", children: [
5229
+ /* @__PURE__ */ jsxs29("strong", { children: [
5230
+ formatKeyName(key),
5231
+ ":"
5232
+ ] }),
5233
+ " ",
5234
+ formatSettingValue(key, val)
5235
+ ] }, key);
5236
+ }) })
5237
+ ] }),
5238
+ /* @__PURE__ */ jsx31("div", { className: "arap-profile-actions", children: isActive ? /* @__PURE__ */ jsx31(
5239
+ "button",
5240
+ {
5241
+ type: "button",
5242
+ className: "arap-profile-revert-btn",
5243
+ onClick: onRevert,
5244
+ "aria-label": `Revert ${profile.label} profile`,
5245
+ children: "Revert to custom settings"
5246
+ }
5247
+ ) : /* @__PURE__ */ jsx31(
5248
+ "button",
5249
+ {
5250
+ type: "button",
5251
+ className: "arap-profile-apply-btn",
5252
+ onClick: () => onApply(profile),
5253
+ "aria-label": `Apply ${profile.label} profile`,
5254
+ children: "Apply Profile"
5255
+ }
5256
+ ) })
5257
+ ]
5258
+ }
5259
+ );
5260
+ }
5261
+
5262
+ // src/core/controls/FeatureStatusState.tsx
5263
+ import { jsx as jsx32, jsxs as jsxs30 } from "react/jsx-runtime";
5264
+ function SearchCount({
5265
+ totalCount,
5266
+ matchedCount,
5267
+ query,
5268
+ className = "",
5269
+ style
5270
+ }) {
5271
+ const text = query ? `Showing ${matchedCount} of ${totalCount} tools matching "${query}"` : `Showing all ${totalCount} tools`;
5272
+ return /* @__PURE__ */ jsx32(
5273
+ "div",
5274
+ {
5275
+ role: "status",
5276
+ "aria-live": "polite",
5277
+ className: `arap-search-count ${className}`,
5278
+ style,
5279
+ children: text
5280
+ }
5281
+ );
5282
+ }
5283
+ function EmptyState({
5284
+ title = "No matching tools found",
5285
+ description = "Try adjusting your search query or reset filters.",
5286
+ actionLabel = "Clear search",
5287
+ onAction,
5288
+ icon,
5289
+ className = "",
5290
+ style
5291
+ }) {
5292
+ return /* @__PURE__ */ jsxs30(
5293
+ "div",
5294
+ {
5295
+ role: "status",
5296
+ className: `arap-empty-state ${className}`,
5297
+ style,
5298
+ children: [
5299
+ /* @__PURE__ */ jsx32("div", { className: "arap-empty-icon", "aria-hidden": "true", children: icon ?? "\u{1F50D}" }),
5300
+ /* @__PURE__ */ jsx32("h3", { className: "arap-empty-title", children: title }),
5301
+ /* @__PURE__ */ jsx32("p", { className: "arap-empty-desc", children: description }),
5302
+ onAction && /* @__PURE__ */ jsx32("button", { type: "button", className: "arap-empty-btn", onClick: onAction, children: actionLabel })
5303
+ ]
5304
+ }
5305
+ );
5306
+ }
5307
+ function ErrorState({
5308
+ title = "Something went wrong",
5309
+ message,
5310
+ onRetry,
5311
+ retryLabel = "Try again",
5312
+ className = "",
5313
+ style
5314
+ }) {
5315
+ return /* @__PURE__ */ jsxs30(
5316
+ "div",
5317
+ {
5318
+ role: "alert",
5319
+ className: `arap-error-state arap-card-alert arap-card-error ${className}`,
5320
+ style,
5321
+ children: [
5322
+ /* @__PURE__ */ jsx32("span", { className: "arap-alert-icon", "aria-hidden": "true", children: "\u26A0\uFE0F" }),
5323
+ /* @__PURE__ */ jsxs30("div", { className: "arap-error-content", children: [
5324
+ title && /* @__PURE__ */ jsx32("h4", { className: "arap-error-title", children: title }),
5325
+ /* @__PURE__ */ jsx32("p", { className: "arap-error-message", children: message }),
5326
+ onRetry && /* @__PURE__ */ jsx32("button", { type: "button", className: "arap-retry-btn", onClick: onRetry, children: retryLabel })
5327
+ ] })
5328
+ ]
5329
+ }
5330
+ );
5331
+ }
5332
+
5333
+ // src/features/ProfilesController.tsx
5334
+ import { jsx as jsx33, jsxs as jsxs31 } from "react/jsx-runtime";
5335
+ function ProfilesController({
5336
+ className = "",
5337
+ label = "Accessibility Profiles",
5338
+ description = "Explore suggested preference combinations",
5339
+ largeControls = false,
5340
+ onProfileChange
5341
+ }) {
5342
+ const [isOpen, setIsOpen] = useState8(false);
5343
+ const [search, setSearch] = useState8("");
5344
+ const dialogId = "arap-profiles-dialog";
5345
+ const searchInputId = useId2();
5346
+ const triggerRef = useRef6(null);
5347
+ const {
5348
+ profiles,
5349
+ activeProfile,
5350
+ activeProfileState,
5351
+ applyProfile,
5352
+ revertProfile,
5353
+ isProfileActive
5354
+ } = useProfiles();
5355
+ const handleApply = (profileId) => {
5356
+ applyProfile(profileId);
5357
+ onProfileChange?.(profileId);
5358
+ };
5359
+ const handleRevert = () => {
5360
+ revertProfile();
5361
+ onProfileChange?.(null);
5362
+ };
5363
+ const filteredProfiles = useMemo2(() => {
5364
+ const q = search.trim().toLowerCase();
5365
+ if (!q) return profiles;
5366
+ return profiles.filter((p) => {
5367
+ const nameMatch = p.label.toLowerCase().includes(q);
5368
+ const descMatch = p.description.toLowerCase().includes(q);
5369
+ const settingMatch = Object.keys(p.settings).some(
5370
+ (k) => k.toLowerCase().includes(q)
5371
+ );
5372
+ return nameMatch || descMatch || settingMatch;
5373
+ });
5374
+ }, [profiles, search]);
5375
+ const hasOverrides = Boolean(activeProfileState?.overrides) && Object.keys(activeProfileState?.overrides ?? {}).length > 0;
5376
+ return /* @__PURE__ */ jsxs31(
5377
+ "div",
5378
+ {
5379
+ className: `arap-feature arap-feature-expandable ${largeControls ? "arap-large-controls" : ""} ${className}`,
5380
+ role: "group",
5381
+ "aria-label": label,
5382
+ children: [
5383
+ /* @__PURE__ */ jsxs31(
5384
+ "div",
5385
+ {
5386
+ style: {
5387
+ display: "flex",
5388
+ alignItems: "center",
5389
+ justifyContent: "space-between",
5390
+ width: "100%"
5391
+ },
5392
+ children: [
5393
+ /* @__PURE__ */ jsxs31("span", { className: "arap-label", children: [
5394
+ /* @__PURE__ */ jsx33(FeatureIcon, { name: "profiles" }),
5395
+ /* @__PURE__ */ jsxs31("span", { children: [
5396
+ /* @__PURE__ */ jsx33("span", { style: { display: "block" }, children: label }),
5397
+ description && /* @__PURE__ */ jsx33(
5398
+ "span",
5399
+ {
5400
+ style: {
5401
+ display: "block",
5402
+ fontSize: "11px",
5403
+ fontWeight: 400,
5404
+ color: "var(--arap-muted, #64748b)",
5405
+ marginTop: "1px"
5406
+ },
5407
+ children: activeProfile ? /* @__PURE__ */ jsxs31(
5408
+ "span",
5409
+ {
5410
+ style: {
5411
+ color: "var(--arap-primary, #2563eb)",
5412
+ fontWeight: 500
5413
+ },
5414
+ children: [
5415
+ "Active: ",
5416
+ activeProfile.label,
5417
+ hasOverrides && " (Customized)"
5418
+ ]
5419
+ }
5420
+ ) : description
5421
+ }
5422
+ )
5423
+ ] })
5424
+ ] }),
5425
+ /* @__PURE__ */ jsxs31("div", { style: { display: "flex", gap: "6px", alignItems: "center" }, children: [
5426
+ activeProfile && /* @__PURE__ */ jsx33(
5427
+ "button",
5428
+ {
5429
+ type: "button",
5430
+ className: "arap-btn-sm",
5431
+ onClick: handleRevert,
5432
+ "aria-label": "Revert active profile to custom settings",
5433
+ title: "Revert to custom settings",
5434
+ children: "Revert"
5435
+ }
5436
+ ),
5437
+ /* @__PURE__ */ jsx33(
5438
+ "button",
5439
+ {
5440
+ ref: triggerRef,
5441
+ className: "arap-btn-sm",
5442
+ type: "button",
5443
+ "aria-expanded": isOpen,
5444
+ "aria-controls": dialogId,
5445
+ onClick: () => setIsOpen(!isOpen),
5446
+ children: isOpen ? "Close" : "Browse"
5447
+ }
5448
+ )
5449
+ ] })
5450
+ ]
5451
+ }
5452
+ ),
5453
+ isOpen && /* @__PURE__ */ jsxs31(
5454
+ "div",
5455
+ {
5456
+ id: dialogId,
5457
+ className: "arap-profiles-panel",
5458
+ style: {
5459
+ marginTop: "12px",
5460
+ paddingTop: "12px",
5461
+ borderTop: "1px solid var(--arap-divider, #e2e8f0)"
5462
+ },
5463
+ children: [
5464
+ activeProfile && /* @__PURE__ */ jsxs31(
5465
+ "div",
5466
+ {
5467
+ className: "arap-profile-active-banner",
5468
+ style: {
5469
+ display: "flex",
5470
+ alignItems: "center",
5471
+ justifyContent: "space-between",
5472
+ padding: "8px 12px",
5473
+ marginBottom: "12px",
5474
+ background: "rgba(37, 99, 235, 0.08)",
5475
+ border: "1px solid rgba(37, 99, 235, 0.2)",
5476
+ borderRadius: "6px"
5477
+ },
5478
+ children: [
5479
+ /* @__PURE__ */ jsxs31("div", { children: [
5480
+ /* @__PURE__ */ jsxs31(
5481
+ "span",
5482
+ {
5483
+ style: {
5484
+ display: "block",
5485
+ fontWeight: 600,
5486
+ fontSize: "13px",
5487
+ color: "var(--arap-primary, #2563eb)"
5488
+ },
5489
+ children: [
5490
+ "\u2713 Current Profile: ",
5491
+ activeProfile.label
5492
+ ]
5493
+ }
5494
+ ),
5495
+ /* @__PURE__ */ jsx33(
5496
+ "span",
5497
+ {
5498
+ style: {
5499
+ display: "block",
5500
+ fontSize: "11px",
5501
+ color: "var(--arap-muted, #64748b)"
5502
+ },
5503
+ children: hasOverrides ? "Your custom adjustments survive alongside this profile." : "Neutral suggestion applied. Adjust any setting freely."
5504
+ }
5505
+ )
5506
+ ] }),
5507
+ /* @__PURE__ */ jsx33(
5508
+ "button",
5509
+ {
5510
+ type: "button",
5511
+ className: "arap-btn-sm",
5512
+ onClick: handleRevert,
5513
+ "aria-label": "Revert active profile",
5514
+ children: "Revert to Custom"
5515
+ }
5516
+ )
5517
+ ]
5518
+ }
5519
+ ),
5520
+ /* @__PURE__ */ jsxs31(
5521
+ "div",
5522
+ {
5523
+ className: "arap-navigator-search",
5524
+ style: { marginBottom: "10px" },
5525
+ children: [
5526
+ /* @__PURE__ */ jsx33("label", { htmlFor: searchInputId, className: "arap-sr-only", children: "Filter profiles" }),
5527
+ /* @__PURE__ */ jsx33(
5528
+ "input",
5529
+ {
5530
+ id: searchInputId,
5531
+ type: "search",
5532
+ className: "arap-search-input",
5533
+ value: search,
5534
+ onChange: (e) => setSearch(e.target.value),
5535
+ placeholder: "Search 8 accessibility profiles...",
5536
+ "aria-label": "Filter profiles"
5537
+ }
5538
+ ),
5539
+ search && /* @__PURE__ */ jsx33(
5540
+ "button",
5541
+ {
5542
+ type: "button",
5543
+ className: "arap-search-clear",
5544
+ onClick: () => setSearch(""),
5545
+ "aria-label": "Clear profile filter",
5546
+ children: "\xD7"
5547
+ }
5548
+ )
5549
+ ]
5550
+ }
5551
+ ),
5552
+ /* @__PURE__ */ jsx33(
5553
+ SearchCount,
5554
+ {
5555
+ totalCount: profiles.length,
5556
+ matchedCount: filteredProfiles.length,
5557
+ query: search
5558
+ }
5559
+ ),
5560
+ /* @__PURE__ */ jsx33(
5561
+ "div",
5562
+ {
5563
+ className: "arap-profiles-list",
5564
+ style: {
5565
+ display: "flex",
5566
+ flexDirection: "column",
5567
+ gap: "10px",
5568
+ marginTop: "8px"
5569
+ },
5570
+ children: filteredProfiles.length === 0 ? /* @__PURE__ */ jsx33(
5571
+ EmptyState,
5572
+ {
5573
+ title: "No profiles found",
5574
+ description: `No accessibility profiles match "${search}".`,
5575
+ actionLabel: "Clear filter",
5576
+ onAction: () => setSearch("")
5577
+ }
5578
+ ) : filteredProfiles.map((p) => /* @__PURE__ */ jsx33(
5579
+ ProfilePreviewCard,
5580
+ {
5581
+ profile: p,
5582
+ isActive: isProfileActive(p.id),
5583
+ onApply: () => handleApply(p.id),
5584
+ onRevert: handleRevert,
5585
+ largeControls
5586
+ },
5587
+ p.id
5588
+ ))
5589
+ }
5590
+ )
5591
+ ]
5592
+ }
5593
+ )
5594
+ ]
5595
+ }
5596
+ );
5597
+ }
5598
+ var ProfileController = ProfilesController;
5599
+ var AccessibilityProfilesController = ProfilesController;
5600
+
5601
+ // src/features/ResetController.tsx
5602
+ import { createPortal as createPortal2 } from "react-dom";
5603
+ import { useContext as useContext7 } from "react";
5604
+ import { jsx as jsx34, jsxs as jsxs32 } from "react/jsx-runtime";
5605
+ function ResetController() {
5606
+ const ctx = useContext7(AccessibilityContext);
5607
+ if (!ctx) {
5608
+ throw new Error(
5609
+ "ResetController must be used within an <AccessibilityPlugin> provider."
5610
+ );
5611
+ }
5612
+ const actionHost = useContext7(PanelActionsContext);
5613
+ const { resetAll } = ctx;
5614
+ const strings = resolveLocaleStrings(ctx.locale);
5615
+ const button = /* @__PURE__ */ jsx34("div", { className: "arap-feature arap-feature-reset", children: /* @__PURE__ */ jsxs32("button", { className: "arap-reset-btn", onClick: resetAll, type: "button", children: [
5616
+ /* @__PURE__ */ jsx34(FeatureIcon, { name: "reset" }),
5617
+ strings.resetAll
5618
+ ] }) });
5619
+ return actionHost ? createPortal2(button, actionHost) : button;
5620
+ }
5621
+
5622
+ // src/features/PresetsController.tsx
5623
+ import { useId as useId3, useRef as useRef7, useState as useState9 } from "react";
5624
+
5625
+ // src/core/usePresets.ts
5626
+ import { useCallback as useCallback6, useContext as useContext8, useMemo as useMemo3 } from "react";
5627
+
5628
+ // src/core/presets.ts
5629
+ var ALLOWED_PREFERENCE_KEYS = Object.freeze([
5630
+ "fontScale",
5631
+ "lineHeight",
5632
+ "letterSpacingEm",
5633
+ "wordSpacingEm",
5634
+ "paragraphSpacingEm",
5635
+ "textAlign",
5636
+ "contrastMode",
5637
+ "highlightLinks",
5638
+ "highlightFocus",
5639
+ "reduceMotion",
5640
+ "hideDecorativeImages",
5641
+ "fontFamily",
5642
+ "cursorSize",
5643
+ "readerMode",
5644
+ "saturation",
5645
+ "tooltips"
5646
+ ]);
5647
+ var FORBIDDEN_KEYS = /* @__PURE__ */ new Set([
5648
+ "__proto__",
5649
+ "constructor",
5650
+ "prototype",
5651
+ "token",
5652
+ "auth",
5653
+ "password",
5654
+ "email",
5655
+ "user",
5656
+ "userId",
5657
+ "session",
5658
+ "cookie",
5659
+ "transcript",
5660
+ "recording",
5661
+ "pageContent",
5662
+ "notes",
5663
+ "input"
5664
+ ]);
5665
+ function sanitizePreferences(raw) {
5666
+ if (!raw || typeof raw !== "object" || Array.isArray(raw)) {
5667
+ return {};
5668
+ }
5669
+ const record = raw;
5670
+ const clean = {};
5671
+ for (const key of ALLOWED_PREFERENCE_KEYS) {
5672
+ if (key in record && record[key] !== void 0 && !FORBIDDEN_KEYS.has(key)) {
5673
+ clean[key] = normalizePreferenceValue(
5674
+ key,
5675
+ record[key]
5676
+ );
5677
+ }
5678
+ }
5679
+ return clean;
5680
+ }
5681
+ function generatePresetId() {
5682
+ const timestamp = Date.now();
5683
+ const randomPart = Math.random().toString(36).substring(2, 9);
5684
+ return `preset_${timestamp}_${randomPart}`;
5685
+ }
5686
+ function createCustomPreset(name, settings) {
5687
+ const trimmedName = (name || "").trim() || `Preset ${(/* @__PURE__ */ new Date()).toLocaleDateString()}`;
5688
+ const sanitizedSettings = sanitizePreferences(settings);
5689
+ return {
5690
+ id: generatePresetId(),
5691
+ name: trimmedName.slice(0, 60),
5692
+ // clamp name length
5693
+ createdAt: (/* @__PURE__ */ new Date()).toISOString(),
5694
+ settings: sanitizedSettings
5695
+ };
5696
+ }
5697
+ function isValidCustomPreset(item) {
5698
+ if (!item || typeof item !== "object" || Array.isArray(item)) {
5699
+ return false;
5700
+ }
5701
+ const candidate = item;
5702
+ return typeof candidate.id === "string" && candidate.id.length > 0 && typeof candidate.name === "string" && candidate.name.length > 0 && typeof candidate.createdAt === "string" && typeof candidate.settings === "object" && candidate.settings !== null && !Array.isArray(candidate.settings);
5703
+ }
5704
+ function exportPresetsToJson(options) {
5705
+ const envelope = {
5706
+ $schema: "https://accessibility-plugin.org/schemas/presets-v1.json",
5707
+ version: 1,
5708
+ app: "accessibility-plugin-react",
5709
+ exportedAt: (/* @__PURE__ */ new Date()).toISOString(),
5710
+ presets: options.presets.map((p) => ({
5711
+ id: p.id,
5712
+ name: p.name,
5713
+ createdAt: p.createdAt,
5714
+ updatedAt: p.updatedAt,
5715
+ settings: sanitizePreferences(p.settings)
5716
+ }))
5717
+ };
5718
+ if (options.currentSettings) {
5719
+ envelope.currentSettings = sanitizePreferences(options.currentSettings);
5720
+ }
5721
+ return JSON.stringify(envelope, null, 2);
5722
+ }
5723
+ function downloadJsonFile(filename, jsonContent) {
5724
+ if (typeof window === "undefined" || typeof document === "undefined") return;
5725
+ const blob = new Blob([jsonContent], {
5726
+ type: "application/json;charset=utf-8"
5727
+ });
5728
+ const url = URL.createObjectURL(blob);
5729
+ const anchor = document.createElement("a");
5730
+ anchor.href = url;
5731
+ anchor.download = filename.endsWith(".json") ? filename : `${filename}.json`;
5732
+ anchor.style.display = "none";
5733
+ document.body.appendChild(anchor);
5734
+ anchor.click();
5735
+ document.body.removeChild(anchor);
5736
+ URL.revokeObjectURL(url);
5737
+ }
5738
+ function validateAndParseImport(jsonString) {
5739
+ if (!jsonString || typeof jsonString !== "string" || !jsonString.trim()) {
5740
+ return {
5741
+ success: false,
5742
+ error: "Import file is empty."
5743
+ };
5744
+ }
5745
+ let raw;
5746
+ try {
5747
+ raw = JSON.parse(jsonString);
5748
+ } catch {
5749
+ return {
5750
+ success: false,
5751
+ error: "Invalid JSON format: syntax error in file."
5752
+ };
5753
+ }
5754
+ if (!raw || typeof raw !== "object") {
5755
+ return {
5756
+ success: false,
5757
+ error: "Malformed import: file root must be an object or array."
5758
+ };
5759
+ }
5760
+ if (Array.isArray(raw)) {
5761
+ const validPresets = [];
5762
+ for (const item of raw) {
5763
+ if (typeof item === "object" && item !== null && !Array.isArray(item)) {
5764
+ const p = item;
5765
+ const name = typeof p.name === "string" ? p.name : "Imported Preset";
5766
+ const id = typeof p.id === "string" && p.id ? p.id : generatePresetId();
5767
+ const createdAt = typeof p.createdAt === "string" ? p.createdAt : (/* @__PURE__ */ new Date()).toISOString();
5768
+ const settings = sanitizePreferences(p.settings || p);
5769
+ if (Object.keys(settings).length > 0) {
5770
+ validPresets.push({ id, name, createdAt, settings });
5771
+ }
5772
+ }
5773
+ }
5774
+ if (validPresets.length === 0) {
5775
+ return {
5776
+ success: false,
5777
+ error: "Array did not contain any valid accessibility presets."
5778
+ };
5779
+ }
5780
+ return {
5781
+ success: true,
5782
+ presets: validPresets,
5783
+ message: `Successfully imported ${validPresets.length} preset(s).`
5784
+ };
5785
+ }
5786
+ const obj = raw;
5787
+ if ("version" in obj && typeof obj.version === "number") {
5788
+ if (obj.version > 1) {
5789
+ return {
5790
+ success: false,
5791
+ error: `Unsupported schema version: version ${obj.version} is newer than supported version 1.`
5792
+ };
5793
+ }
5794
+ if (obj.version < 1) {
5795
+ return {
5796
+ success: false,
5797
+ error: `Unsupported schema version: version ${obj.version} is not recognized.`
5798
+ };
5799
+ }
5800
+ }
5801
+ const importedPresets = [];
5802
+ if (Array.isArray(obj.presets)) {
5803
+ for (const item of obj.presets) {
5804
+ if (isValidCustomPreset(item)) {
5805
+ importedPresets.push({
5806
+ id: item.id,
5807
+ name: item.name,
5808
+ createdAt: item.createdAt,
5809
+ updatedAt: item.updatedAt,
5810
+ settings: sanitizePreferences(item.settings)
5811
+ });
5812
+ } else if (typeof item === "object" && item !== null) {
5813
+ const record = item;
5814
+ const name = typeof record.name === "string" ? record.name : "Imported Preset";
5815
+ const id = typeof record.id === "string" && record.id ? record.id : generatePresetId();
5816
+ const createdAt = typeof record.createdAt === "string" ? record.createdAt : (/* @__PURE__ */ new Date()).toISOString();
5817
+ const settings = sanitizePreferences(record.settings || record);
5818
+ if (Object.keys(settings).length > 0) {
5819
+ importedPresets.push({ id, name, createdAt, settings });
5820
+ }
5821
+ }
5822
+ }
5823
+ }
5824
+ let currentSettings;
5825
+ if ("currentSettings" in obj && typeof obj.currentSettings === "object") {
5826
+ currentSettings = sanitizePreferences(obj.currentSettings);
5827
+ } else if (!("presets" in obj) && !("version" in obj)) {
5828
+ const flat = sanitizePreferences(obj);
5829
+ if (Object.keys(flat).length > 0) {
5830
+ currentSettings = flat;
5831
+ }
5832
+ }
5833
+ if (importedPresets.length === 0 && (!currentSettings || Object.keys(currentSettings).length === 0)) {
5834
+ return {
5835
+ success: false,
5836
+ error: "No valid presets or accessibility settings found in the file."
5837
+ };
5838
+ }
5839
+ const parts = [];
5840
+ if (importedPresets.length > 0)
5841
+ parts.push(`${importedPresets.length} preset(s)`);
5842
+ if (currentSettings && Object.keys(currentSettings).length > 0)
5843
+ parts.push("current settings");
5844
+ return {
5845
+ success: true,
5846
+ presets: importedPresets,
5847
+ currentSettings,
5848
+ message: `Successfully imported ${parts.join(" and ")}.`
5849
+ };
5850
+ }
5851
+ function applyCustomPresetToStore(preset, setFeatureState) {
5852
+ const mapped = mapProfileSettingsToFeatures(preset.settings);
5853
+ for (const [key, value] of Object.entries(mapped)) {
5854
+ try {
5855
+ setFeatureState(key, value);
5856
+ } catch {
5857
+ }
5858
+ }
5859
+ }
5860
+
5861
+ // src/core/usePresets.ts
5862
+ function usePresets() {
5863
+ const ctx = useContext8(AccessibilityContext);
5864
+ if (!ctx) {
5865
+ throw new Error(
5866
+ "usePresets must be used within an <AccessibilityPlugin> provider."
5867
+ );
5868
+ }
5869
+ const { value: rawPresets, setValue: setPresets } = useAccessibility("customPresets", []);
5870
+ const presets = useMemo3(
5871
+ () => Array.isArray(rawPresets) ? rawPresets : [],
5872
+ [rawPresets]
5873
+ );
5874
+ const currentSettings = useMemo3(
5875
+ () => mapFeaturesToProfileSettings(ctx.state.features),
5876
+ [ctx.state.features]
5877
+ );
5878
+ const saveCurrentAsPreset = useCallback6(
5879
+ (name) => {
5880
+ const newPreset = createCustomPreset(name, currentSettings);
5881
+ setPresets([...presets, newPreset]);
5882
+ return newPreset;
5883
+ },
5884
+ [currentSettings, presets, setPresets]
5885
+ );
5886
+ const applyPreset = useCallback6(
5887
+ (presetId) => {
5888
+ const found = presets.find((p) => p.id === presetId);
5889
+ if (!found) return false;
5890
+ applyCustomPresetToStore(found, ctx.setFeatureState);
5891
+ return true;
5892
+ },
5893
+ [ctx.setFeatureState, presets]
5894
+ );
5895
+ const deletePreset = useCallback6(
5896
+ (presetId) => {
5897
+ const next = presets.filter((p) => p.id !== presetId);
5898
+ if (next.length === presets.length) return false;
5899
+ setPresets(next);
5900
+ return true;
5901
+ },
5902
+ [presets, setPresets]
5903
+ );
5904
+ const exportPresets = useCallback6(() => {
5905
+ return exportPresetsToJson({ presets, currentSettings });
5906
+ }, [currentSettings, presets]);
5907
+ const downloadExport = useCallback6(
5908
+ (filename) => {
5909
+ const json = exportPresetsToJson({ presets, currentSettings });
5910
+ const dateStr = (/* @__PURE__ */ new Date()).toISOString().split("T")[0];
5911
+ const targetName = filename || `accessibility-preferences-${dateStr}.json`;
5912
+ downloadJsonFile(targetName, json);
5913
+ },
5914
+ [currentSettings, presets]
5915
+ );
5916
+ const importFromJson = useCallback6(
5917
+ (jsonStr) => {
5918
+ const result = validateAndParseImport(jsonStr);
5919
+ if (!result.success) {
5920
+ return result;
5921
+ }
5922
+ if (result.presets.length > 0) {
5923
+ const existingMap = new Map(presets.map((p) => [p.id, p]));
5924
+ for (const p of result.presets) {
5925
+ existingMap.set(p.id, p);
5926
+ }
5927
+ setPresets(Array.from(existingMap.values()));
5928
+ }
5929
+ if (result.currentSettings && Object.keys(result.currentSettings).length > 0) {
5930
+ applyCustomPresetToStore(
5931
+ {
5932
+ id: "temp_import",
5933
+ name: "Imported Settings",
5934
+ createdAt: (/* @__PURE__ */ new Date()).toISOString(),
5935
+ settings: result.currentSettings
5936
+ },
5937
+ ctx.setFeatureState
5938
+ );
5939
+ }
5940
+ return result;
5941
+ },
5942
+ [ctx.setFeatureState, presets, setPresets]
5943
+ );
5944
+ const importFromFile = useCallback6(
5945
+ async (file) => {
5946
+ try {
5947
+ const text = await file.text();
5948
+ return importFromJson(text);
5949
+ } catch (err) {
5950
+ return {
5951
+ success: false,
5952
+ error: `Failed to read file: ${err instanceof Error ? err.message : String(err)}`
5953
+ };
5954
+ }
5955
+ },
5956
+ [importFromJson]
5957
+ );
5958
+ return {
5959
+ presets,
5960
+ currentSettings,
5961
+ saveCurrentAsPreset,
5962
+ applyPreset,
5963
+ deletePreset,
5964
+ exportPresets,
5965
+ downloadExport,
5966
+ importFromJson,
5967
+ importFromFile
5968
+ };
5969
+ }
5970
+
5971
+ // src/features/PresetsController.tsx
5972
+ import { jsx as jsx35, jsxs as jsxs33 } from "react/jsx-runtime";
5973
+ function PresetsController({
5974
+ className = "",
5975
+ label = "Custom Presets",
5976
+ description = "Save, restore, and transfer your settings",
5977
+ largeControls = false
5978
+ }) {
5979
+ const [isOpen, setIsOpen] = useState9(false);
5980
+ const [presetName, setPresetName] = useState9("");
5981
+ const [statusMessage, setStatusMessage] = useState9("");
5982
+ const [errorMessage, setErrorMessage] = useState9("");
5983
+ const dialogId = "arap-presets-dialog";
5984
+ const nameInputId = useId3();
5985
+ const fileInputRef = useRef7(null);
5986
+ const triggerRef = useRef7(null);
5987
+ const {
5988
+ presets,
5989
+ saveCurrentAsPreset,
5990
+ applyPreset,
5991
+ deletePreset,
5992
+ downloadExport,
5993
+ importFromFile
5994
+ } = usePresets();
5995
+ const handleSave = () => {
5996
+ const trimmed = presetName.trim();
5997
+ if (!trimmed) {
5998
+ setErrorMessage("Please enter a name for your preset.");
5999
+ setStatusMessage("");
6000
+ return;
6001
+ }
6002
+ const created = saveCurrentAsPreset(trimmed);
6003
+ setPresetName("");
6004
+ setErrorMessage("");
6005
+ setStatusMessage(`Preset "${created.name}" saved successfully.`);
6006
+ };
6007
+ const handleApply = (preset) => {
6008
+ const success = applyPreset(preset.id);
6009
+ if (success) {
6010
+ setErrorMessage("");
6011
+ setStatusMessage(`Preset "${preset.name}" applied.`);
6012
+ }
6013
+ };
6014
+ const handleDelete = (preset) => {
6015
+ const success = deletePreset(preset.id);
6016
+ if (success) {
6017
+ setErrorMessage("");
6018
+ setStatusMessage(`Preset "${preset.name}" deleted.`);
6019
+ }
6020
+ };
6021
+ const handleExport = () => {
6022
+ downloadExport();
6023
+ setErrorMessage("");
6024
+ setStatusMessage("Settings and presets exported to JSON file.");
6025
+ };
6026
+ const handleFileInputChange = async (e) => {
6027
+ const file = e.target.files?.[0];
6028
+ if (!file) return;
6029
+ const result = await importFromFile(file);
6030
+ if (result.success) {
6031
+ setErrorMessage("");
6032
+ setStatusMessage(result.message);
6033
+ } else {
6034
+ setStatusMessage("");
6035
+ setErrorMessage(result.error);
6036
+ }
6037
+ if (fileInputRef.current) {
6038
+ fileInputRef.current.value = "";
6039
+ }
6040
+ };
6041
+ const formatKeyName = (key) => {
6042
+ switch (key) {
6043
+ case "fontScale":
6044
+ return "Font Size";
6045
+ case "lineHeight":
6046
+ return "Line Height";
6047
+ case "contrastMode":
6048
+ return "Contrast";
6049
+ case "reduceMotion":
6050
+ return "Reduce Motion";
6051
+ case "textAlign":
6052
+ return "Text Align";
6053
+ case "highlightLinks":
6054
+ return "Highlight Links";
6055
+ case "highlightFocus":
6056
+ return "Highlight Focus";
6057
+ case "cursorSize":
6058
+ return "Cursor Size";
6059
+ case "readerMode":
6060
+ return "Reading Mode";
6061
+ case "saturation":
6062
+ return "Saturation";
6063
+ case "hideDecorativeImages":
6064
+ return "Hide Images";
6065
+ default:
6066
+ return key.replace(/([A-Z])/g, " $1").trim();
6067
+ }
6068
+ };
6069
+ const formatSettingValue = (key, val) => {
6070
+ if (typeof val === "boolean") return val ? "On" : "Off";
6071
+ if (key === "fontScale" && typeof val === "number")
6072
+ return `${Math.round(val * 100)}%`;
6073
+ if (key === "lineHeight" && typeof val === "number")
6074
+ return `${Math.round(val * 100)}%`;
6075
+ if (val === null || val === void 0) return "Original";
6076
+ return String(val);
6077
+ };
6078
+ return /* @__PURE__ */ jsxs33(
6079
+ "div",
6080
+ {
6081
+ className: `arap-feature arap-feature-expandable ${largeControls ? "arap-large-controls" : ""} ${className}`,
6082
+ role: "group",
6083
+ "aria-label": label,
6084
+ children: [
6085
+ /* @__PURE__ */ jsxs33(
6086
+ "div",
6087
+ {
6088
+ style: {
6089
+ display: "flex",
6090
+ alignItems: "center",
6091
+ justifyContent: "space-between",
6092
+ width: "100%"
6093
+ },
6094
+ children: [
6095
+ /* @__PURE__ */ jsxs33("span", { className: "arap-label", children: [
6096
+ /* @__PURE__ */ jsx35(FeatureIcon, { name: "presets" }),
6097
+ /* @__PURE__ */ jsxs33("span", { children: [
6098
+ /* @__PURE__ */ jsx35("span", { style: { display: "block" }, children: label }),
6099
+ description && /* @__PURE__ */ jsx35(
6100
+ "span",
6101
+ {
6102
+ style: {
6103
+ display: "block",
6104
+ fontSize: "11px",
6105
+ fontWeight: 400,
6106
+ color: "var(--arap-muted, #64748b)",
6107
+ marginTop: "1px"
6108
+ },
6109
+ children: presets.length > 0 ? `${presets.length} custom preset${presets.length === 1 ? "" : "s"} saved` : description
6110
+ }
6111
+ )
6112
+ ] })
6113
+ ] }),
6114
+ /* @__PURE__ */ jsx35(
6115
+ "button",
6116
+ {
6117
+ ref: triggerRef,
6118
+ className: "arap-btn-sm",
6119
+ type: "button",
6120
+ "aria-expanded": isOpen,
6121
+ "aria-controls": dialogId,
6122
+ onClick: () => setIsOpen(!isOpen),
6123
+ children: isOpen ? "Close" : "Presets"
6124
+ }
6125
+ )
6126
+ ]
6127
+ }
6128
+ ),
6129
+ isOpen && /* @__PURE__ */ jsxs33(
6130
+ "div",
6131
+ {
6132
+ id: dialogId,
6133
+ role: "region",
6134
+ "aria-label": "Custom Presets and Settings",
6135
+ tabIndex: -1,
6136
+ style: {
6137
+ marginTop: "12px",
6138
+ padding: "12px",
6139
+ borderRadius: "6px",
6140
+ backgroundColor: "var(--arap-card-bg, #f8fafc)",
6141
+ border: "1px solid var(--arap-border, #e2e8f0)"
6142
+ },
6143
+ onKeyDown: (e) => {
6144
+ if (e.key === "Escape") {
6145
+ e.stopPropagation();
6146
+ setIsOpen(false);
6147
+ triggerRef.current?.focus();
6148
+ }
6149
+ },
6150
+ children: [
6151
+ /* @__PURE__ */ jsxs33(
6152
+ "div",
6153
+ {
6154
+ role: "status",
6155
+ "aria-live": "polite",
6156
+ className: "arap-presets-status",
6157
+ style: {
6158
+ minHeight: statusMessage || errorMessage ? "24px" : "0",
6159
+ marginBottom: statusMessage || errorMessage ? "8px" : "0"
6160
+ },
6161
+ children: [
6162
+ statusMessage && /* @__PURE__ */ jsxs33(
6163
+ "div",
6164
+ {
6165
+ style: {
6166
+ fontSize: "12px",
6167
+ fontWeight: 500,
6168
+ color: "var(--arap-success, #16a34a)",
6169
+ padding: "4px 8px",
6170
+ backgroundColor: "rgba(22, 163, 74, 0.1)",
6171
+ borderRadius: "4px"
6172
+ },
6173
+ children: [
6174
+ "\u2713 ",
6175
+ statusMessage
6176
+ ]
6177
+ }
6178
+ ),
6179
+ errorMessage && /* @__PURE__ */ jsxs33(
6180
+ "div",
6181
+ {
6182
+ role: "alert",
6183
+ style: {
6184
+ fontSize: "12px",
6185
+ fontWeight: 500,
6186
+ color: "var(--arap-error, #dc2626)",
6187
+ padding: "4px 8px",
6188
+ backgroundColor: "rgba(220, 38, 38, 0.1)",
6189
+ borderRadius: "4px"
6190
+ },
6191
+ children: [
6192
+ "\u26A0 ",
6193
+ errorMessage
6194
+ ]
6195
+ }
6196
+ )
6197
+ ]
6198
+ }
6199
+ ),
6200
+ /* @__PURE__ */ jsxs33(
6201
+ "div",
6202
+ {
6203
+ className: "arap-presets-save-section",
6204
+ style: { marginBottom: "14px" },
6205
+ children: [
6206
+ /* @__PURE__ */ jsx35(
6207
+ "label",
6208
+ {
6209
+ htmlFor: nameInputId,
6210
+ style: {
6211
+ display: "block",
6212
+ fontSize: "12px",
6213
+ fontWeight: 600,
6214
+ marginBottom: "4px",
6215
+ color: "var(--arap-text, #1e293b)"
6216
+ },
6217
+ children: "Save current settings as preset:"
6218
+ }
6219
+ ),
6220
+ /* @__PURE__ */ jsxs33("div", { style: { display: "flex", gap: "6px" }, children: [
6221
+ /* @__PURE__ */ jsx35(
6222
+ "input",
6223
+ {
6224
+ id: nameInputId,
6225
+ type: "text",
6226
+ className: "arap-search-input",
6227
+ style: { flex: 1, padding: "6px 10px", fontSize: "13px" },
6228
+ value: presetName,
6229
+ onChange: (e) => {
6230
+ setPresetName(e.target.value);
6231
+ if (errorMessage) setErrorMessage("");
6232
+ },
6233
+ onKeyDown: (e) => {
6234
+ if (e.key === "Enter") {
6235
+ e.preventDefault();
6236
+ handleSave();
6237
+ }
6238
+ },
6239
+ placeholder: "Preset name (e.g. My Reading Setup)",
6240
+ "aria-label": "Preset name"
6241
+ }
6242
+ ),
6243
+ /* @__PURE__ */ jsx35(
6244
+ "button",
6245
+ {
6246
+ type: "button",
6247
+ className: "arap-btn-sm",
6248
+ onClick: handleSave,
6249
+ "aria-label": "Save current preset",
6250
+ children: "Save"
6251
+ }
6252
+ )
6253
+ ] })
6254
+ ]
6255
+ }
6256
+ ),
6257
+ /* @__PURE__ */ jsxs33(
6258
+ "div",
6259
+ {
6260
+ className: "arap-presets-transfer-section",
6261
+ style: {
6262
+ display: "flex",
6263
+ gap: "8px",
6264
+ marginBottom: "14px",
6265
+ paddingBottom: "12px",
6266
+ borderBottom: "1px solid var(--arap-border, #e2e8f0)"
6267
+ },
6268
+ children: [
6269
+ /* @__PURE__ */ jsx35(
6270
+ "button",
6271
+ {
6272
+ type: "button",
6273
+ className: "arap-btn-sm",
6274
+ style: { flex: 1 },
6275
+ onClick: handleExport,
6276
+ "aria-label": "Export settings and presets to JSON file",
6277
+ children: "Export JSON"
6278
+ }
6279
+ ),
6280
+ /* @__PURE__ */ jsx35(
6281
+ "button",
6282
+ {
6283
+ type: "button",
6284
+ className: "arap-btn-sm",
6285
+ style: { flex: 1 },
6286
+ onClick: () => fileInputRef.current?.click(),
6287
+ "aria-label": "Import settings and presets from JSON file",
6288
+ children: "Import JSON"
6289
+ }
6290
+ ),
6291
+ /* @__PURE__ */ jsx35(
6292
+ "input",
6293
+ {
6294
+ ref: fileInputRef,
6295
+ type: "file",
6296
+ accept: ".json,application/json",
6297
+ style: { display: "none" },
6298
+ "aria-label": "Upload JSON settings file",
6299
+ onChange: handleFileInputChange
6300
+ }
6301
+ )
6302
+ ]
6303
+ }
6304
+ ),
6305
+ /* @__PURE__ */ jsxs33("div", { className: "arap-presets-list-section", children: [
6306
+ /* @__PURE__ */ jsxs33(
6307
+ "h4",
6308
+ {
6309
+ style: {
6310
+ fontSize: "12px",
6311
+ fontWeight: 600,
6312
+ marginBottom: "6px",
6313
+ color: "var(--arap-text, #1e293b)"
6314
+ },
6315
+ children: [
6316
+ "Saved Presets (",
6317
+ presets.length,
6318
+ "):"
6319
+ ]
6320
+ }
6321
+ ),
6322
+ presets.length === 0 ? /* @__PURE__ */ jsx35(
6323
+ EmptyState,
6324
+ {
6325
+ title: "No saved presets yet",
6326
+ description: "Configure your preferences and save them above for quick 1-click access."
6327
+ }
6328
+ ) : /* @__PURE__ */ jsx35(
6329
+ "div",
6330
+ {
6331
+ style: {
6332
+ display: "flex",
6333
+ flexDirection: "column",
6334
+ gap: "8px"
6335
+ },
6336
+ children: presets.map((p) => {
6337
+ const affectedKeys = Object.keys(
6338
+ p.settings
6339
+ );
6340
+ return /* @__PURE__ */ jsxs33(
6341
+ "div",
6342
+ {
6343
+ className: "arap-preset-card",
6344
+ role: "group",
6345
+ "aria-label": `${p.name} preset`,
6346
+ style: {
6347
+ padding: "8px 10px",
6348
+ borderRadius: "6px",
6349
+ backgroundColor: "var(--arap-bg, #ffffff)",
6350
+ border: "1px solid var(--arap-border, #e2e8f0)"
6351
+ },
6352
+ children: [
6353
+ /* @__PURE__ */ jsxs33(
6354
+ "div",
6355
+ {
6356
+ style: {
6357
+ display: "flex",
6358
+ alignItems: "center",
6359
+ justifyContent: "space-between",
6360
+ marginBottom: "4px"
6361
+ },
6362
+ children: [
6363
+ /* @__PURE__ */ jsxs33("div", { children: [
6364
+ /* @__PURE__ */ jsx35(
6365
+ "strong",
6366
+ {
6367
+ style: {
6368
+ fontSize: "13px",
6369
+ color: "var(--arap-text, #1e293b)"
6370
+ },
6371
+ children: p.name
6372
+ }
6373
+ ),
6374
+ /* @__PURE__ */ jsxs33(
6375
+ "span",
6376
+ {
6377
+ style: {
6378
+ display: "block",
6379
+ fontSize: "10px",
6380
+ color: "var(--arap-muted, #64748b)"
6381
+ },
6382
+ children: [
6383
+ "Saved ",
6384
+ new Date(p.createdAt).toLocaleDateString()
6385
+ ]
6386
+ }
6387
+ )
6388
+ ] }),
6389
+ /* @__PURE__ */ jsxs33(
6390
+ "div",
6391
+ {
6392
+ style: {
6393
+ display: "flex",
6394
+ gap: "6px",
6395
+ alignItems: "center"
6396
+ },
6397
+ children: [
6398
+ /* @__PURE__ */ jsx35(
6399
+ "button",
6400
+ {
6401
+ type: "button",
6402
+ className: "arap-btn-sm",
6403
+ onClick: () => handleApply(p),
6404
+ "aria-label": `Apply preset ${p.name}`,
6405
+ children: "Apply"
6406
+ }
6407
+ ),
6408
+ /* @__PURE__ */ jsx35(
6409
+ "button",
6410
+ {
6411
+ type: "button",
6412
+ className: "arap-btn-sm",
6413
+ onClick: () => handleDelete(p),
6414
+ "aria-label": `Delete preset ${p.name}`,
6415
+ style: {
6416
+ color: "var(--arap-error, #dc2626)"
6417
+ },
6418
+ children: "Delete"
6419
+ }
6420
+ )
6421
+ ]
6422
+ }
6423
+ )
6424
+ ]
6425
+ }
6426
+ ),
6427
+ affectedKeys.length > 0 && /* @__PURE__ */ jsx35(
6428
+ "div",
6429
+ {
6430
+ className: "arap-profile-chips",
6431
+ style: { marginTop: "4px" },
6432
+ children: affectedKeys.map((key) => {
6433
+ const val = p.settings[key];
6434
+ return /* @__PURE__ */ jsxs33("span", { className: "arap-profile-chip", children: [
6435
+ /* @__PURE__ */ jsxs33("strong", { children: [
6436
+ formatKeyName(key),
6437
+ ":"
6438
+ ] }),
6439
+ " ",
6440
+ formatSettingValue(key, val)
6441
+ ] }, key);
6442
+ })
6443
+ }
6444
+ )
6445
+ ]
6446
+ },
6447
+ p.id
6448
+ );
6449
+ })
6450
+ }
6451
+ )
6452
+ ] })
6453
+ ]
6454
+ }
6455
+ )
6456
+ ]
6457
+ }
6458
+ );
6459
+ }
6460
+ var CustomPresetsController = PresetsController;
6461
+ var SettingsImportExportController = PresetsController;
6462
+ var PresetsBackupController = PresetsController;
6463
+
6464
+ // src/core/controls/ToggleControl.tsx
6465
+ import { jsx as jsx36 } from "react/jsx-runtime";
6466
+ function ToggleControl({
6467
+ id,
6468
+ label,
6469
+ checked,
6470
+ onChange,
6471
+ disabled = false,
6472
+ unavailable = false,
6473
+ unavailableReason,
6474
+ name,
6475
+ description,
6476
+ largeControls = false,
6477
+ className = "",
6478
+ style
6479
+ }) {
6480
+ const isInteractive = !disabled && !unavailable;
6481
+ const toggleLabel = typeof label === "string" ? label : void 0;
6482
+ const handleClick = () => {
6483
+ if (isInteractive) {
6484
+ onChange(!checked);
6485
+ }
6486
+ };
6487
+ return /* @__PURE__ */ jsx36(
6488
+ "div",
6489
+ {
6490
+ className: `arap-toggle-wrapper ${largeControls ? "arap-large-controls" : ""} ${className}`,
6491
+ style,
6492
+ children: /* @__PURE__ */ jsx36(
6493
+ "button",
6494
+ {
6495
+ id,
6496
+ name,
6497
+ type: "button",
6498
+ className: `arap-toggle ${checked ? "arap-toggle-active" : ""}`,
6499
+ role: "switch",
6500
+ "aria-checked": checked,
6501
+ "aria-label": toggleLabel,
6502
+ "aria-disabled": !isInteractive,
6503
+ disabled: !isInteractive,
6504
+ onClick: handleClick,
6505
+ title: unavailableReason || description || toggleLabel,
6506
+ children: /* @__PURE__ */ jsx36(
6507
+ "span",
6508
+ {
6509
+ className: "arap-toggle-knob",
6510
+ style: {
6511
+ transform: checked ? largeControls ? "translateX(28px)" : "translateX(24px)" : "translateX(0)"
6512
+ }
6513
+ }
6514
+ )
6515
+ }
6516
+ )
6517
+ }
6518
+ );
6519
+ }
6520
+
6521
+ // src/core/controls/ChoiceControl.tsx
6522
+ import { useCallback as useCallback7, useMemo as useMemo4, useRef as useRef8 } from "react";
6523
+ import { jsx as jsx37, jsxs as jsxs34 } from "react/jsx-runtime";
6524
+ function ChoiceControl({
6525
+ id,
6526
+ label,
4136
6527
  value,
4137
6528
  options,
4138
6529
  groups,
@@ -4143,12 +6534,12 @@ function ChoiceControl({
4143
6534
  style,
4144
6535
  orientation = "horizontal"
4145
6536
  }) {
4146
- const containerRef = useRef5(null);
4147
- const allOptions = useMemo2(
6537
+ const containerRef = useRef8(null);
6538
+ const allOptions = useMemo4(
4148
6539
  () => groups ? groups.flatMap((g) => g.options) : options || [],
4149
6540
  [groups, options]
4150
6541
  );
4151
- const handleKeyDown = useCallback4(
6542
+ const handleKeyDown = useCallback7(
4152
6543
  (e) => {
4153
6544
  if (disabled || allOptions.length === 0) return;
4154
6545
  const enabledOptions = allOptions.filter((opt) => !opt.disabled);
@@ -4185,7 +6576,7 @@ function ChoiceControl({
4185
6576
  const renderOptionButton = (opt) => {
4186
6577
  const isSelected = value === opt.value;
4187
6578
  const isOptionDisabled = disabled || Boolean(opt.disabled);
4188
- return /* @__PURE__ */ jsxs28(
6579
+ return /* @__PURE__ */ jsxs34(
4189
6580
  "button",
4190
6581
  {
4191
6582
  type: "button",
@@ -4199,15 +6590,15 @@ function ChoiceControl({
4199
6590
  onClick: () => !isOptionDisabled && onChange(opt.value),
4200
6591
  title: opt.description,
4201
6592
  children: [
4202
- isSelected && /* @__PURE__ */ jsx31("span", { className: "arap-check", "aria-hidden": "true", children: "\u2713" }),
4203
- /* @__PURE__ */ jsx31("span", { children: opt.label }),
4204
- opt.badge && /* @__PURE__ */ jsx31("span", { className: "arap-choice-badge", "aria-hidden": "true", children: opt.badge })
6593
+ isSelected && /* @__PURE__ */ jsx37("span", { className: "arap-check", "aria-hidden": "true", children: "\u2713" }),
6594
+ /* @__PURE__ */ jsx37("span", { children: opt.label }),
6595
+ opt.badge && /* @__PURE__ */ jsx37("span", { className: "arap-choice-badge", "aria-hidden": "true", children: opt.badge })
4205
6596
  ]
4206
6597
  },
4207
6598
  String(opt.value)
4208
6599
  );
4209
6600
  };
4210
- return /* @__PURE__ */ jsx31(
6601
+ return /* @__PURE__ */ jsx37(
4211
6602
  "div",
4212
6603
  {
4213
6604
  ref: containerRef,
@@ -4218,15 +6609,15 @@ function ChoiceControl({
4218
6609
  className: `arap-choice-control arap-segmented ${largeControls ? "arap-large-controls" : ""} ${className}`,
4219
6610
  style,
4220
6611
  onKeyDown: handleKeyDown,
4221
- children: groups ? groups.map((group) => /* @__PURE__ */ jsxs28(
6612
+ children: groups ? groups.map((group) => /* @__PURE__ */ jsxs34(
4222
6613
  "div",
4223
6614
  {
4224
6615
  className: "arap-choice-group",
4225
6616
  role: "group",
4226
6617
  "aria-label": group.label,
4227
6618
  children: [
4228
- /* @__PURE__ */ jsx31("span", { className: "arap-choice-group-title", children: group.label }),
4229
- /* @__PURE__ */ jsx31("div", { className: "arap-segmented", children: group.options.map(renderOptionButton) })
6619
+ /* @__PURE__ */ jsx37("span", { className: "arap-choice-group-title", children: group.label }),
6620
+ /* @__PURE__ */ jsx37("div", { className: "arap-segmented", children: group.options.map(renderOptionButton) })
4230
6621
  ]
4231
6622
  },
4232
6623
  group.label
@@ -4236,7 +6627,7 @@ function ChoiceControl({
4236
6627
  }
4237
6628
 
4238
6629
  // src/core/controls/StepperControl.tsx
4239
- import { jsx as jsx32, jsxs as jsxs29 } from "react/jsx-runtime";
6630
+ import { jsx as jsx38, jsxs as jsxs35 } from "react/jsx-runtime";
4240
6631
  function StepperControl({
4241
6632
  id,
4242
6633
  label,
@@ -4266,15 +6657,15 @@ function StepperControl({
4266
6657
  onChange(Math.min(max, Number((value + step).toFixed(2))));
4267
6658
  }
4268
6659
  };
4269
- return /* @__PURE__ */ jsxs29(
6660
+ return /* @__PURE__ */ jsxs35(
4270
6661
  "div",
4271
6662
  {
4272
6663
  id,
4273
6664
  className: `arap-stepper-control-wrapper ${largeControls ? "arap-large-controls" : ""} ${className}`,
4274
6665
  style,
4275
6666
  children: [
4276
- /* @__PURE__ */ jsxs29("div", { className: "arap-controls", children: [
4277
- /* @__PURE__ */ jsx32(
6667
+ /* @__PURE__ */ jsxs35("div", { className: "arap-controls", children: [
6668
+ /* @__PURE__ */ jsx38(
4278
6669
  "button",
4279
6670
  {
4280
6671
  type: "button",
@@ -4285,8 +6676,8 @@ function StepperControl({
4285
6676
  children: "\u2212"
4286
6677
  }
4287
6678
  ),
4288
- /* @__PURE__ */ jsx32("output", { className: "arap-value", "aria-live": "polite", children: displayValue }),
4289
- /* @__PURE__ */ jsx32(
6679
+ /* @__PURE__ */ jsx38("output", { className: "arap-value", "aria-live": "polite", children: displayValue }),
6680
+ /* @__PURE__ */ jsx38(
4290
6681
  "button",
4291
6682
  {
4292
6683
  type: "button",
@@ -4298,7 +6689,7 @@ function StepperControl({
4298
6689
  }
4299
6690
  )
4300
6691
  ] }),
4301
- showSlider && /* @__PURE__ */ jsx32("div", { className: "arap-slider-container", children: /* @__PURE__ */ jsx32(
6692
+ showSlider && /* @__PURE__ */ jsx38("div", { className: "arap-slider-container", children: /* @__PURE__ */ jsx38(
4302
6693
  "input",
4303
6694
  {
4304
6695
  type: "range",
@@ -4322,7 +6713,7 @@ function StepperControl({
4322
6713
  }
4323
6714
 
4324
6715
  // src/core/controls/FeatureCard.tsx
4325
- import { jsx as jsx33, jsxs as jsxs30 } from "react/jsx-runtime";
6716
+ import { jsx as jsx39, jsxs as jsxs36 } from "react/jsx-runtime";
4326
6717
  function FeatureCard({
4327
6718
  id,
4328
6719
  featureKey,
@@ -4341,7 +6732,7 @@ function FeatureCard({
4341
6732
  largeControls = false
4342
6733
  }) {
4343
6734
  const cardTitle = typeof title === "string" ? title : void 0;
4344
- return /* @__PURE__ */ jsxs30(
6735
+ return /* @__PURE__ */ jsxs36(
4345
6736
  "div",
4346
6737
  {
4347
6738
  id,
@@ -4350,27 +6741,27 @@ function FeatureCard({
4350
6741
  className: `arap-feature arap-feature-card ${status !== "idle" ? `arap-feature-${status}` : ""} ${largeControls ? "arap-large-controls" : ""} ${className}`,
4351
6742
  style,
4352
6743
  children: [
4353
- /* @__PURE__ */ jsxs30("div", { className: "arap-card-header", children: [
4354
- /* @__PURE__ */ jsxs30("span", { className: "arap-label", children: [
4355
- icon ?? (featureKey ? /* @__PURE__ */ jsx33(FeatureIcon, { name: featureKey }) : null),
4356
- /* @__PURE__ */ jsx33("span", { className: "arap-card-title", children: title })
6744
+ /* @__PURE__ */ jsxs36("div", { className: "arap-card-header", children: [
6745
+ /* @__PURE__ */ jsxs36("span", { className: "arap-label", children: [
6746
+ icon ?? (featureKey ? /* @__PURE__ */ jsx39(FeatureIcon, { name: featureKey }) : null),
6747
+ /* @__PURE__ */ jsx39("span", { className: "arap-card-title", children: title })
4357
6748
  ] }),
4358
- statusBadge && /* @__PURE__ */ jsx33("span", { className: "arap-status-badge", "aria-hidden": "true", children: statusBadge })
6749
+ statusBadge && /* @__PURE__ */ jsx39("span", { className: "arap-status-badge", "aria-hidden": "true", children: statusBadge })
4359
6750
  ] }),
4360
- description && /* @__PURE__ */ jsx33("p", { className: "arap-card-desc", children: description }),
4361
- status === "error" && errorMessage && /* @__PURE__ */ jsxs30("div", { className: "arap-card-alert arap-card-error", role: "alert", children: [
4362
- /* @__PURE__ */ jsx33("span", { className: "arap-alert-icon", "aria-hidden": "true", children: "\u26A0\uFE0F" }),
4363
- /* @__PURE__ */ jsx33("span", { children: errorMessage })
6751
+ description && /* @__PURE__ */ jsx39("p", { className: "arap-card-desc", children: description }),
6752
+ status === "error" && errorMessage && /* @__PURE__ */ jsxs36("div", { className: "arap-card-alert arap-card-error", role: "alert", children: [
6753
+ /* @__PURE__ */ jsx39("span", { className: "arap-alert-icon", "aria-hidden": "true", children: "\u26A0\uFE0F" }),
6754
+ /* @__PURE__ */ jsx39("span", { children: errorMessage })
4364
6755
  ] }),
4365
- status === "unavailable" && unavailableMessage && /* @__PURE__ */ jsxs30("div", { className: "arap-card-alert arap-card-unavailable", role: "status", children: [
4366
- /* @__PURE__ */ jsx33("span", { className: "arap-alert-icon", "aria-hidden": "true", children: "\u2139\uFE0F" }),
4367
- /* @__PURE__ */ jsx33("span", { children: unavailableMessage })
6756
+ status === "unavailable" && unavailableMessage && /* @__PURE__ */ jsxs36("div", { className: "arap-card-alert arap-card-unavailable", role: "status", children: [
6757
+ /* @__PURE__ */ jsx39("span", { className: "arap-alert-icon", "aria-hidden": "true", children: "\u2139\uFE0F" }),
6758
+ /* @__PURE__ */ jsx39("span", { children: unavailableMessage })
4368
6759
  ] }),
4369
- status === "permission-required" && permissionMessage && /* @__PURE__ */ jsxs30("div", { className: "arap-card-alert arap-card-permission", role: "status", children: [
4370
- /* @__PURE__ */ jsx33("span", { className: "arap-alert-icon", "aria-hidden": "true", children: "\u{1F512}" }),
4371
- /* @__PURE__ */ jsxs30("div", { className: "arap-permission-content", children: [
4372
- /* @__PURE__ */ jsx33("span", { children: permissionMessage }),
4373
- onRequestPermission && /* @__PURE__ */ jsx33(
6760
+ status === "permission-required" && permissionMessage && /* @__PURE__ */ jsxs36("div", { className: "arap-card-alert arap-card-permission", role: "status", children: [
6761
+ /* @__PURE__ */ jsx39("span", { className: "arap-alert-icon", "aria-hidden": "true", children: "\u{1F512}" }),
6762
+ /* @__PURE__ */ jsxs36("div", { className: "arap-permission-content", children: [
6763
+ /* @__PURE__ */ jsx39("span", { children: permissionMessage }),
6764
+ onRequestPermission && /* @__PURE__ */ jsx39(
4374
6765
  "button",
4375
6766
  {
4376
6767
  type: "button",
@@ -4381,198 +6772,20 @@ function FeatureCard({
4381
6772
  )
4382
6773
  ] })
4383
6774
  ] }),
4384
- /* @__PURE__ */ jsx33("div", { className: "arap-card-content", children })
4385
- ]
4386
- }
4387
- );
4388
- }
4389
-
4390
- // src/core/controls/FeatureStatusState.tsx
4391
- import { jsx as jsx34, jsxs as jsxs31 } from "react/jsx-runtime";
4392
- function SearchCount({
4393
- totalCount,
4394
- matchedCount,
4395
- query,
4396
- className = "",
4397
- style
4398
- }) {
4399
- const text = query ? `Showing ${matchedCount} of ${totalCount} tools matching "${query}"` : `Showing all ${totalCount} tools`;
4400
- return /* @__PURE__ */ jsx34(
4401
- "div",
4402
- {
4403
- role: "status",
4404
- "aria-live": "polite",
4405
- className: `arap-search-count ${className}`,
4406
- style,
4407
- children: text
4408
- }
4409
- );
4410
- }
4411
- function EmptyState({
4412
- title = "No matching tools found",
4413
- description = "Try adjusting your search query or reset filters.",
4414
- actionLabel = "Clear search",
4415
- onAction,
4416
- icon,
4417
- className = "",
4418
- style
4419
- }) {
4420
- return /* @__PURE__ */ jsxs31(
4421
- "div",
4422
- {
4423
- role: "status",
4424
- className: `arap-empty-state ${className}`,
4425
- style,
4426
- children: [
4427
- /* @__PURE__ */ jsx34("div", { className: "arap-empty-icon", "aria-hidden": "true", children: icon ?? "\u{1F50D}" }),
4428
- /* @__PURE__ */ jsx34("h3", { className: "arap-empty-title", children: title }),
4429
- /* @__PURE__ */ jsx34("p", { className: "arap-empty-desc", children: description }),
4430
- onAction && /* @__PURE__ */ jsx34("button", { type: "button", className: "arap-empty-btn", onClick: onAction, children: actionLabel })
4431
- ]
4432
- }
4433
- );
4434
- }
4435
- function ErrorState({
4436
- title = "Something went wrong",
4437
- message,
4438
- onRetry,
4439
- retryLabel = "Try again",
4440
- className = "",
4441
- style
4442
- }) {
4443
- return /* @__PURE__ */ jsxs31(
4444
- "div",
4445
- {
4446
- role: "alert",
4447
- className: `arap-error-state arap-card-alert arap-card-error ${className}`,
4448
- style,
4449
- children: [
4450
- /* @__PURE__ */ jsx34("span", { className: "arap-alert-icon", "aria-hidden": "true", children: "\u26A0\uFE0F" }),
4451
- /* @__PURE__ */ jsxs31("div", { className: "arap-error-content", children: [
4452
- title && /* @__PURE__ */ jsx34("h4", { className: "arap-error-title", children: title }),
4453
- /* @__PURE__ */ jsx34("p", { className: "arap-error-message", children: message }),
4454
- onRetry && /* @__PURE__ */ jsx34("button", { type: "button", className: "arap-retry-btn", onClick: onRetry, children: retryLabel })
4455
- ] })
4456
- ]
4457
- }
4458
- );
4459
- }
4460
-
4461
- // src/core/controls/ProfilePreviewCard.tsx
4462
- import { jsx as jsx35, jsxs as jsxs32 } from "react/jsx-runtime";
4463
- function ProfilePreviewCard({
4464
- profile,
4465
- isActive,
4466
- onApply,
4467
- onRevert,
4468
- largeControls = false,
4469
- className = "",
4470
- style
4471
- }) {
4472
- const affectedKeys = Object.keys(
4473
- profile.settings
4474
- );
4475
- const formatKeyName = (key) => {
4476
- switch (key) {
4477
- case "fontScale":
4478
- return "Font Size";
4479
- case "lineHeight":
4480
- return "Line Height";
4481
- case "contrastMode":
4482
- return "Contrast";
4483
- case "reduceMotion":
4484
- return "Reduce Motion";
4485
- case "textAlign":
4486
- return "Text Align";
4487
- case "highlightLinks":
4488
- return "Highlight Links";
4489
- case "highlightFocus":
4490
- return "Highlight Focus";
4491
- case "cursorSize":
4492
- return "Cursor Size";
4493
- case "readerMode":
4494
- return "Reading Mode";
4495
- case "saturation":
4496
- return "Saturation";
4497
- case "hideDecorativeImages":
4498
- return "Hide Images";
4499
- default:
4500
- return key.replace(/([A-Z])/g, " $1").trim();
4501
- }
4502
- };
4503
- const formatSettingValue = (key, val) => {
4504
- if (typeof val === "boolean") return val ? "On" : "Off";
4505
- if (key === "fontScale" && typeof val === "number")
4506
- return `${Math.round(val * 100)}%`;
4507
- if (key === "lineHeight" && typeof val === "number")
4508
- return `${Math.round(val * 100)}%`;
4509
- if (val === null || val === void 0) return "Original";
4510
- return String(val);
4511
- };
4512
- return /* @__PURE__ */ jsxs32(
4513
- "div",
4514
- {
4515
- role: "group",
4516
- "aria-label": `${profile.label} profile`,
4517
- className: `arap-profile-card ${isActive ? "arap-profile-card-active" : ""} ${largeControls ? "arap-large-controls" : ""} ${className}`,
4518
- style,
4519
- children: [
4520
- /* @__PURE__ */ jsxs32("div", { className: "arap-profile-header", children: [
4521
- /* @__PURE__ */ jsxs32("div", { className: "arap-profile-title-row", children: [
4522
- /* @__PURE__ */ jsx35("h4", { className: "arap-profile-title", children: profile.label }),
4523
- isActive && /* @__PURE__ */ jsx35(
4524
- "span",
4525
- {
4526
- className: "arap-profile-active-badge",
4527
- "aria-label": "Active profile",
4528
- children: "\u2713 Active"
4529
- }
4530
- )
4531
- ] }),
4532
- /* @__PURE__ */ jsx35("p", { className: "arap-profile-desc", children: profile.description })
4533
- ] }),
4534
- /* @__PURE__ */ jsxs32("div", { className: "arap-profile-affected", children: [
4535
- /* @__PURE__ */ jsx35("span", { className: "arap-profile-affected-label", children: "Affected settings:" }),
4536
- /* @__PURE__ */ jsx35("div", { className: "arap-profile-chips", children: affectedKeys.map((key) => {
4537
- const val = profile.settings[key];
4538
- return /* @__PURE__ */ jsxs32("span", { className: "arap-profile-chip", children: [
4539
- /* @__PURE__ */ jsxs32("strong", { children: [
4540
- formatKeyName(key),
4541
- ":"
4542
- ] }),
4543
- " ",
4544
- formatSettingValue(key, val)
4545
- ] }, key);
4546
- }) })
4547
- ] }),
4548
- /* @__PURE__ */ jsx35("div", { className: "arap-profile-actions", children: isActive ? /* @__PURE__ */ jsx35(
4549
- "button",
4550
- {
4551
- type: "button",
4552
- className: "arap-profile-revert-btn",
4553
- onClick: onRevert,
4554
- "aria-label": `Revert ${profile.label} profile`,
4555
- children: "Revert to custom settings"
4556
- }
4557
- ) : /* @__PURE__ */ jsx35(
4558
- "button",
4559
- {
4560
- type: "button",
4561
- className: "arap-profile-apply-btn",
4562
- onClick: () => onApply(profile),
4563
- "aria-label": `Apply ${profile.label} profile`,
4564
- children: "Apply Profile"
4565
- }
4566
- ) })
6775
+ /* @__PURE__ */ jsx39("div", { className: "arap-card-content", children })
4567
6776
  ]
4568
6777
  }
4569
6778
  );
4570
6779
  }
4571
6780
  export {
6781
+ ALLOWED_PREFERENCE_KEYS,
6782
+ ALL_PROFILE_IDS,
4572
6783
  AccessibilityButton,
4573
6784
  AccessibilityContext,
4574
6785
  AccessibilityList,
4575
6786
  AccessibilityPlugin,
6787
+ AccessibilityProfilesController,
6788
+ AccessibleTooltipsController,
4576
6789
  BigCursorController,
4577
6790
  CONTRAST_MODES,
4578
6791
  CONTRAST_PALETTES,
@@ -4580,6 +6793,7 @@ export {
4580
6793
  ChoiceControl,
4581
6794
  ContrastController,
4582
6795
  ContrastModeController,
6796
+ CustomPresetsController,
4583
6797
  DEFAULT_PREFERENCES,
4584
6798
  DEFAULT_READING_MASK_HEIGHT,
4585
6799
  DYSLEXIA_FONT_STACK,
@@ -4592,6 +6806,7 @@ export {
4592
6806
  FontFamilyController,
4593
6807
  FontSizeController,
4594
6808
  GrayscaleController,
6809
+ HeadingsNavigatorController,
4595
6810
  HideDecorativeImagesController,
4596
6811
  HideImagesController,
4597
6812
  HideVideosController,
@@ -4606,8 +6821,14 @@ export {
4606
6821
  MAX_READING_MASK_HEIGHT,
4607
6822
  MIN_READING_MASK_HEIGHT,
4608
6823
  PROFILE_DEFINITIONS,
6824
+ PageNavigatorController,
6825
+ PageStructureController,
4609
6826
  ParagraphSpacingController,
6827
+ PresetsBackupController,
6828
+ PresetsController,
6829
+ ProfileController,
4610
6830
  ProfilePreviewCard,
6831
+ ProfilesController,
4611
6832
  READING_MASK_HEIGHT_PRESETS,
4612
6833
  ReadingGuideController,
4613
6834
  ReadingMaskController,
@@ -4615,6 +6836,7 @@ export {
4615
6836
  ResetController,
4616
6837
  SaturationController,
4617
6838
  SearchCount,
6839
+ SettingsImportExportController,
4618
6840
  SkipToMainLink,
4619
6841
  StepperControl,
4620
6842
  TEXT_ALIGN_BLOCK_SELECTOR,
@@ -4624,10 +6846,19 @@ export {
4624
6846
  TextAlignController,
4625
6847
  TextScaleController,
4626
6848
  ToggleControl,
6849
+ TooltipsController,
4627
6850
  WordSpacingController,
6851
+ applyCustomPresetToStore,
6852
+ applyProfileToStore,
6853
+ createCustomPreset,
4628
6854
  createInitialPreferencesState,
6855
+ downloadJsonFile,
4629
6856
  enLocale,
6857
+ enableAccessibleTooltips,
6858
+ exportPresetsToJson,
4630
6859
  findMainLandmark,
6860
+ getAuthoredDescription,
6861
+ getProfileDefinition,
4631
6862
  getScriptSpacingConstraints,
4632
6863
  hasFinePointer,
4633
6864
  isEligibleDecorativeImage,
@@ -4640,16 +6871,30 @@ export {
4640
6871
  isProtectedFromTextSpacing,
4641
6872
  isReducedMotionActive,
4642
6873
  isRtlLocale,
6874
+ isValidCustomPreset,
6875
+ mapFeaturesToProfileSettings,
6876
+ mapProfileSettingsToFeatures,
6877
+ navigateToElement,
4643
6878
  normalizePreferenceValue,
4644
6879
  normalizePreferences,
4645
6880
  nudgeReadingAid,
6881
+ positionTooltip,
4646
6882
  preferencesReducer,
6883
+ recordProfileOverride,
4647
6884
  registerLocale,
4648
6885
  resolveEffectivePreferences,
4649
6886
  resolveLocaleStrings,
6887
+ revertProfileFromStore,
6888
+ sanitizePreferences,
6889
+ scanHeadings,
6890
+ scanLandmarks,
4650
6891
  subscribeFinePointer,
4651
6892
  subscribeForcedColors,
6893
+ subscribePageStructure,
4652
6894
  subscribeReducedMotion,
4653
- useAccessibility
6895
+ useAccessibility,
6896
+ usePresets,
6897
+ useProfiles,
6898
+ validateAndParseImport
4654
6899
  };
4655
6900
  //# sourceMappingURL=index.mjs.map