@william-xu-web/c-a11y 1.0.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.
@@ -0,0 +1,826 @@
1
+ function ht(){return`
2
+ :host {
3
+ all: initial;
4
+ font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
5
+ font-size: 16px;
6
+ line-height: 1.5;
7
+ color: #1a1a2e;
8
+ }
9
+ *, *::before, *::after {
10
+ box-sizing: border-box;
11
+ margin: 0;
12
+ padding: 0;
13
+ }
14
+
15
+ .anid-trigger {
16
+ position: fixed;
17
+ z-index: 2147483647;
18
+ width: 56px;
19
+ height: 56px;
20
+ border-radius: 50%;
21
+ background: #1565c0;
22
+ border: 3px solid #fff;
23
+ box-shadow: 0 4px 16px rgba(0,0,0,0.3);
24
+ cursor: pointer;
25
+ display: flex;
26
+ align-items: center;
27
+ justify-content: center;
28
+ transition: transform 0.2s, box-shadow 0.2s;
29
+ touch-action: none;
30
+ }
31
+ .anid-trigger:hover, .anid-trigger:focus-visible {
32
+ transform: scale(1.1);
33
+ box-shadow: 0 6px 24px rgba(0,0,0,0.4);
34
+ }
35
+ .anid-trigger:focus-visible {
36
+ outline: 3px solid #ffab00;
37
+ outline-offset: 2px;
38
+ }
39
+ .anid-trigger svg {
40
+ width: 28px;
41
+ height: 28px;
42
+ fill: #fff;
43
+ }
44
+ .anid-trigger[aria-expanded="true"] {
45
+ background: #c62828;
46
+ }
47
+ .anid-trigger[aria-expanded="true"] svg {
48
+ display: none;
49
+ }
50
+ .anid-trigger[aria-expanded="true"]::after {
51
+ content: '\u2715';
52
+ color: #fff;
53
+ font-size: 22px;
54
+ font-weight: bold;
55
+ }
56
+
57
+ .anid-panel {
58
+ position: fixed;
59
+ z-index: 2147483646;
60
+ width: 380px;
61
+ max-width: calc(100vw - 24px);
62
+ max-height: calc(100vh - 100px);
63
+ background: #ffffff;
64
+ border-radius: 16px;
65
+ box-shadow: 0 8px 40px rgba(0,0,0,0.25);
66
+ overflow: hidden;
67
+ display: flex;
68
+ flex-direction: column;
69
+ opacity: 0;
70
+ visibility: hidden;
71
+ transform: translateY(20px) scale(0.95);
72
+ transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
73
+ }
74
+ .anid-panel.anid-open {
75
+ opacity: 1;
76
+ visibility: visible;
77
+ transform: translateY(0) scale(1);
78
+ }
79
+
80
+ .anid-panel-header {
81
+ display: flex;
82
+ align-items: center;
83
+ justify-content: space-between;
84
+ padding: 16px 20px;
85
+ background: #1565c0;
86
+ color: #fff;
87
+ gap: 8px;
88
+ flex-shrink: 0;
89
+ }
90
+ .anid-panel-title {
91
+ font-size: 18px;
92
+ font-weight: 700;
93
+ flex: 1;
94
+ }
95
+ .anid-lang-select {
96
+ background: rgba(255,255,255,0.2);
97
+ border: 1px solid rgba(255,255,255,0.4);
98
+ color: #fff;
99
+ padding: 4px 8px;
100
+ border-radius: 6px;
101
+ font-size: 13px;
102
+ cursor: pointer;
103
+ }
104
+ .anid-lang-select option {
105
+ color: #1a1a2e;
106
+ background: #fff;
107
+ }
108
+ .anid-close-btn {
109
+ background: none;
110
+ border: none;
111
+ color: #fff;
112
+ font-size: 22px;
113
+ cursor: pointer;
114
+ width: 36px;
115
+ height: 36px;
116
+ border-radius: 50%;
117
+ display: flex;
118
+ align-items: center;
119
+ justify-content: center;
120
+ transition: background 0.15s;
121
+ }
122
+ .anid-close-btn:hover, .anid-close-btn:focus-visible {
123
+ background: rgba(255,255,255,0.2);
124
+ }
125
+ .anid-close-btn:focus-visible {
126
+ outline: 2px solid #ffab00;
127
+ }
128
+
129
+ .anid-panel-body {
130
+ overflow-y: auto;
131
+ flex: 1;
132
+ padding: 8px 0;
133
+ scrollbar-width: thin;
134
+ scrollbar-color: #ccc transparent;
135
+ }
136
+ .anid-panel-body::-webkit-scrollbar {
137
+ width: 6px;
138
+ }
139
+ .anid-panel-body::-webkit-scrollbar-track {
140
+ background: transparent;
141
+ }
142
+ .anid-panel-body::-webkit-scrollbar-thumb {
143
+ background: #ccc;
144
+ border-radius: 3px;
145
+ }
146
+
147
+ .anid-category {
148
+ border-bottom: 1px solid #eee;
149
+ }
150
+ .anid-category:last-child {
151
+ border-bottom: none;
152
+ }
153
+ .anid-category-header {
154
+ display: flex;
155
+ align-items: center;
156
+ gap: 10px;
157
+ padding: 12px 20px;
158
+ background: none;
159
+ border: none;
160
+ width: 100%;
161
+ cursor: pointer;
162
+ font-size: 15px;
163
+ font-weight: 600;
164
+ color: #1a1a2e;
165
+ text-align: inherit;
166
+ transition: background 0.15s;
167
+ }
168
+ .anid-category-header:hover {
169
+ background: #f5f5f5;
170
+ }
171
+ .anid-category-header:focus-visible {
172
+ outline: 2px solid #1565c0;
173
+ outline-offset: -2px;
174
+ }
175
+ .anid-category-icon {
176
+ font-size: 20px;
177
+ width: 28px;
178
+ text-align: center;
179
+ flex-shrink: 0;
180
+ }
181
+ .anid-category-chevron {
182
+ margin-inline-start: auto;
183
+ transition: transform 0.2s;
184
+ font-size: 12px;
185
+ }
186
+ .anid-category[data-expanded="true"] .anid-category-chevron {
187
+ transform: rotate(180deg);
188
+ }
189
+ .anid-category-content {
190
+ max-height: 0;
191
+ overflow: hidden;
192
+ transition: max-height 0.3s ease;
193
+ }
194
+ .anid-category[data-expanded="true"] .anid-category-content {
195
+ max-height: 2000px;
196
+ }
197
+
198
+ .anid-feature {
199
+ display: flex;
200
+ align-items: center;
201
+ padding: 10px 20px 10px 48px;
202
+ gap: 12px;
203
+ min-height: 44px;
204
+ }
205
+ [dir="rtl"] .anid-feature {
206
+ padding: 10px 48px 10px 20px;
207
+ }
208
+ .anid-feature-label {
209
+ flex: 1;
210
+ font-size: 14px;
211
+ color: #333;
212
+ }
213
+
214
+ .anid-toggle {
215
+ position: relative;
216
+ width: 44px;
217
+ height: 24px;
218
+ flex-shrink: 0;
219
+ }
220
+ .anid-toggle input {
221
+ opacity: 0;
222
+ width: 0;
223
+ height: 0;
224
+ position: absolute;
225
+ }
226
+ .anid-toggle-slider {
227
+ position: absolute;
228
+ inset: 0;
229
+ background: #ccc;
230
+ border-radius: 12px;
231
+ cursor: pointer;
232
+ transition: background 0.2s;
233
+ }
234
+ .anid-toggle-slider::before {
235
+ content: '';
236
+ position: absolute;
237
+ width: 20px;
238
+ height: 20px;
239
+ border-radius: 50%;
240
+ background: #fff;
241
+ top: 2px;
242
+ left: 2px;
243
+ transition: transform 0.2s;
244
+ }
245
+ [dir="rtl"] .anid-toggle-slider::before {
246
+ left: auto;
247
+ right: 2px;
248
+ }
249
+ .anid-toggle input:checked + .anid-toggle-slider {
250
+ background: #1565c0;
251
+ }
252
+ .anid-toggle input:checked + .anid-toggle-slider::before {
253
+ transform: translateX(20px);
254
+ }
255
+ [dir="rtl"] .anid-toggle input:checked + .anid-toggle-slider::before {
256
+ transform: translateX(-20px);
257
+ }
258
+ .anid-toggle input:focus-visible + .anid-toggle-slider {
259
+ outline: 2px solid #ffab00;
260
+ outline-offset: 2px;
261
+ }
262
+
263
+ .anid-btn-group {
264
+ display: flex;
265
+ flex-wrap: wrap;
266
+ gap: 6px;
267
+ }
268
+ .anid-btn {
269
+ padding: 6px 12px;
270
+ border: 1px solid #ccc;
271
+ border-radius: 6px;
272
+ background: #f5f5f5;
273
+ color: #333;
274
+ cursor: pointer;
275
+ font-size: 13px;
276
+ min-width: 44px;
277
+ min-height: 32px;
278
+ overflow: hidden;
279
+ text-overflow: ellipsis;
280
+ white-space: nowrap;
281
+ transition: background 0.15s, border-color 0.15s;
282
+ }
283
+ .anid-btn:hover {
284
+ background: #e0e0e0;
285
+ }
286
+ .anid-btn:focus-visible {
287
+ outline: 2px solid #1565c0;
288
+ outline-offset: 1px;
289
+ }
290
+ .anid-btn.anid-active {
291
+ background: #1565c0;
292
+ color: #fff;
293
+ border-color: #1565c0;
294
+ }
295
+
296
+ .anid-slider-wrap {
297
+ display: flex;
298
+ align-items: center;
299
+ gap: 8px;
300
+ width: 120px;
301
+ }
302
+ .anid-slider {
303
+ width: 100%;
304
+ height: 4px;
305
+ -webkit-appearance: none;
306
+ appearance: none;
307
+ background: #ddd;
308
+ border-radius: 2px;
309
+ outline: none;
310
+ }
311
+ .anid-slider::-webkit-slider-thumb {
312
+ -webkit-appearance: none;
313
+ width: 18px;
314
+ height: 18px;
315
+ border-radius: 50%;
316
+ background: #1565c0;
317
+ cursor: pointer;
318
+ }
319
+ .anid-slider::-moz-range-thumb {
320
+ width: 18px;
321
+ height: 18px;
322
+ border: none;
323
+ border-radius: 50%;
324
+ background: #1565c0;
325
+ cursor: pointer;
326
+ }
327
+ .anid-slider:focus-visible {
328
+ outline: 2px solid #ffab00;
329
+ outline-offset: 2px;
330
+ }
331
+
332
+ .anid-panel-footer {
333
+ padding: 12px 20px;
334
+ border-top: 1px solid #eee;
335
+ display: flex;
336
+ justify-content: center;
337
+ flex-shrink: 0;
338
+ }
339
+ .anid-reset-btn {
340
+ padding: 8px 24px;
341
+ border: 2px solid #c62828;
342
+ border-radius: 8px;
343
+ background: transparent;
344
+ color: #c62828;
345
+ font-size: 14px;
346
+ font-weight: 600;
347
+ cursor: pointer;
348
+ min-height: 44px;
349
+ transition: background 0.15s, color 0.15s;
350
+ }
351
+ .anid-reset-btn:hover {
352
+ background: #c62828;
353
+ color: #fff;
354
+ }
355
+ .anid-reset-btn:focus-visible {
356
+ outline: 2px solid #ffab00;
357
+ outline-offset: 2px;
358
+ }
359
+
360
+ .anid-sub-options {
361
+ padding: 4px 20px 8px 64px;
362
+ }
363
+ [dir="rtl"] .anid-sub-options {
364
+ padding: 4px 64px 8px 20px;
365
+ }
366
+
367
+ .anid-heading-list, .anid-landmark-list {
368
+ list-style: none;
369
+ padding: 4px 20px 8px 48px;
370
+ max-height: 200px;
371
+ overflow-y: auto;
372
+ }
373
+ [dir="rtl"] .anid-heading-list, [dir="rtl"] .anid-landmark-list {
374
+ padding: 4px 48px 8px 20px;
375
+ }
376
+ .anid-heading-list li, .anid-landmark-list li {
377
+ margin: 2px 0;
378
+ }
379
+ .anid-heading-list button, .anid-landmark-list button {
380
+ background: none;
381
+ border: none;
382
+ color: #1565c0;
383
+ cursor: pointer;
384
+ font-size: 13px;
385
+ padding: 4px 8px;
386
+ border-radius: 4px;
387
+ text-align: inherit;
388
+ width: 100%;
389
+ min-height: 32px;
390
+ transition: background 0.15s;
391
+ }
392
+ .anid-heading-list button:hover, .anid-landmark-list button:hover {
393
+ background: #e3f2fd;
394
+ }
395
+ .anid-heading-list button:focus-visible, .anid-landmark-list button:focus-visible {
396
+ outline: 2px solid #1565c0;
397
+ }
398
+
399
+ .anid-overlay {
400
+ position: fixed;
401
+ z-index: 2147483645;
402
+ top: 0; left: 0; right: 0; bottom: 0;
403
+ background: rgba(0,0,0,0.85);
404
+ color: #eee;
405
+ overflow-y: auto;
406
+ padding: 40px 20px;
407
+ font-family: monospace;
408
+ font-size: 14px;
409
+ line-height: 1.8;
410
+ white-space: pre-wrap;
411
+ }
412
+ .anid-overlay-close {
413
+ position: fixed;
414
+ top: 16px;
415
+ right: 16px;
416
+ z-index: 2147483646;
417
+ background: #c62828;
418
+ color: #fff;
419
+ border: none;
420
+ width: 44px;
421
+ height: 44px;
422
+ border-radius: 50%;
423
+ font-size: 20px;
424
+ cursor: pointer;
425
+ }
426
+
427
+ .anid-statement-modal {
428
+ position: fixed;
429
+ z-index: 2147483645;
430
+ top: 50%; left: 50%;
431
+ transform: translate(-50%, -50%);
432
+ width: 600px;
433
+ max-width: calc(100vw - 40px);
434
+ max-height: calc(100vh - 80px);
435
+ background: #fff;
436
+ border-radius: 12px;
437
+ box-shadow: 0 16px 48px rgba(0,0,0,0.3);
438
+ overflow-y: auto;
439
+ padding: 32px;
440
+ }
441
+ .anid-statement-modal h2 {
442
+ font-size: 22px;
443
+ margin-bottom: 16px;
444
+ color: #1a1a2e;
445
+ }
446
+ .anid-statement-modal p {
447
+ margin-bottom: 12px;
448
+ color: #333;
449
+ line-height: 1.7;
450
+ }
451
+ .anid-statement-backdrop {
452
+ position: fixed;
453
+ z-index: 2147483644;
454
+ inset: 0;
455
+ background: rgba(0,0,0,0.5);
456
+ }
457
+
458
+ .anid-shortcut {
459
+ display: inline-block;
460
+ font-size: 10px;
461
+ font-family: inherit;
462
+ padding: 1px 5px;
463
+ margin-inline-start: 6px;
464
+ background: #eee;
465
+ color: #666;
466
+ border: 1px solid #ddd;
467
+ border-radius: 3px;
468
+ vertical-align: middle;
469
+ line-height: 1.4;
470
+ }
471
+
472
+ .anid-live-region {
473
+ position: absolute;
474
+ width: 1px;
475
+ height: 1px;
476
+ overflow: hidden;
477
+ clip: rect(0,0,0,0);
478
+ white-space: nowrap;
479
+ }
480
+
481
+ @media (max-width: 768px) {
482
+ .anid-panel {
483
+ width: 100vw !important;
484
+ max-width: 100vw !important;
485
+ height: 100vh !important;
486
+ max-height: 100vh !important;
487
+ border-radius: 0 !important;
488
+ top: 0 !important;
489
+ left: 0 !important;
490
+ right: 0 !important;
491
+ bottom: 0 !important;
492
+ }
493
+ }
494
+ `}var v={en:{dir:"ltr",panelTitle:"Accessibility",close:"Close",resetAll:"Reset All",categoryVision:"Vision & Display",categoryNavigation:"Navigation & Reading",categoryMedia:"Media & Content",categoryCompliance:"Compliance & Info",fontSize:"Font Size",fontSizeIncrease:"Increase",fontSizeDecrease:"Decrease",fontSizeReset:"Reset",highContrast:"High Contrast",contrastDark:"Dark",contrastLight:"Light",contrastInvert:"Invert",darkMode:"Dark Mode",monochrome:"Grayscale",saturation:"Color Saturation",textSpacing:"Text Spacing",dyslexiaFont:"Dyslexia Font",hideImages:"Hide Images",colorBlindSim:"Color Blind Simulation",protanopia:"Protanopia (Red)",deuteranopia:"Deuteranopia (Green)",tritanopia:"Tritanopia (Blue)",keyboardNav:"Keyboard Navigation",focusIndicators:"Focus Indicators",headingStructure:"Heading Map",pageStructure:"Page Structure",readingGuide:"Reading Guide",lineMask:"Line Focus",bigCursor:"Big Cursor",screenReaderPreview:"Screen Reader Preview",linkHighlight:"Highlight Links",imageAltText:"Image Alt Text",stopAnimations:"Stop Animations",muteSounds:"Mute Sounds",accessibilityStatement:"Accessibility Statement",complianceBadge:"Compliance Badge",generateStatement:"Generate Statement",generateBadge:"Generate Badge",language:"Language",on:"On",off:"Off",openPanel:"Open accessibility menu",closePanel:"Close accessibility menu",jumpTo:"Jump to",level:"Level",noHeadings:"No headings found",noLandmarks:"No landmarks found",main:"Main",header:"Header",footer:"Footer",nav:"Navigation",aside:"Aside",form:"Form",search:"Search",statementTitle:"Accessibility Statement",statementIntro:"We strive to make this website accessible to all users, including people with disabilities, in accordance with WCAG 2.1 Level AA guidelines.",statementCoordinator:"Accessibility Coordinator",statementPhone:"Phone",statementEmail:"Email",statementLastAudit:"Last accessibility audit date",statementAccommodations:"Accessibility accommodations performed",copied:"Copied to clipboard",embedCode:"Embed code",copyCode:"Copy",badgeCompliant:"Compliant",poweredBy:"Powered by",contrastAndColors:"Contrast and color adjustments",fontSizeAdjustment:"Font size adjustment",keyboardNavigation:"Keyboard navigation",screenReaderCompat:"Screen reader compatibility",linkHighlighting:"Link highlighting",animationControl:"Animation control",noAltText:"(no alt text)",ttsHover:"Read on Hover",ttsSelection:"Read Selection",ttsReadPage:"Read Page Aloud",ttsStop:"Stop Reading",ttsReading:"Reading...",shortcutPanelToggle:"Toggle accessibility menu",keyboardShortcuts:"Keyboard Shortcuts"},zh:{dir:"ltr",panelTitle:"\u65E0\u969C\u788D",close:"\u5173\u95ED",resetAll:"\u91CD\u7F6E\u5168\u90E8",categoryVision:"\u89C6\u89C9\u4E0E\u663E\u793A",categoryNavigation:"\u5BFC\u822A\u4E0E\u9605\u8BFB",categoryMedia:"\u5A92\u4F53\u4E0E\u5185\u5BB9",categoryCompliance:"\u5408\u89C4\u4E0E\u4FE1\u606F",fontSize:"\u5B57\u4F53\u5927\u5C0F",fontSizeIncrease:"\u589E\u5927",fontSizeDecrease:"\u51CF\u5C0F",fontSizeReset:"\u91CD\u7F6E",highContrast:"\u9AD8\u5BF9\u6BD4\u5EA6",contrastDark:"\u6DF1\u8272",contrastLight:"\u6D45\u8272",contrastInvert:"\u53CD\u8F6C",darkMode:"\u6DF1\u8272\u6A21\u5F0F",monochrome:"\u7070\u5EA6",saturation:"\u8272\u5F69\u9971\u548C\u5EA6",textSpacing:"\u6587\u672C\u95F4\u8DDD",dyslexiaFont:"\u9605\u8BFB\u969C\u788D\u5B57\u4F53",hideImages:"\u9690\u85CF\u56FE\u7247",colorBlindSim:"\u8272\u76F2\u6A21\u62DF",protanopia:"\u7EA2\u8272\u76F2",deuteranopia:"\u7EFF\u8272\u76F2",tritanopia:"\u84DD\u8272\u76F2",keyboardNav:"\u952E\u76D8\u5BFC\u822A",focusIndicators:"\u7126\u70B9\u6307\u793A\u5668",headingStructure:"\u6807\u9898\u5730\u56FE",pageStructure:"\u9875\u9762\u7ED3\u6784",readingGuide:"\u9605\u8BFB\u5F15\u5BFC\u7EBF",lineMask:"\u884C\u805A\u7126",bigCursor:"\u5927\u5149\u6807",screenReaderPreview:"\u5C4F\u5E55\u9605\u8BFB\u5668\u9884\u89C8",linkHighlight:"\u9AD8\u4EAE\u94FE\u63A5",imageAltText:"\u56FE\u7247\u66FF\u4EE3\u6587\u672C",stopAnimations:"\u505C\u6B62\u52A8\u753B",muteSounds:"\u9759\u97F3",accessibilityStatement:"\u65E0\u969C\u788D\u58F0\u660E",complianceBadge:"\u5408\u89C4\u5FBD\u7AE0",generateStatement:"\u751F\u6210\u58F0\u660E",generateBadge:"\u751F\u6210\u5FBD\u7AE0",language:"\u8BED\u8A00",on:"\u5F00\u542F",off:"\u5173\u95ED",openPanel:"\u6253\u5F00\u65E0\u969C\u788D\u83DC\u5355",closePanel:"\u5173\u95ED\u65E0\u969C\u788D\u83DC\u5355",jumpTo:"\u8DF3\u8F6C\u5230",level:"\u7EA7\u522B",noHeadings:"\u672A\u627E\u5230\u6807\u9898",noLandmarks:"\u672A\u627E\u5230\u5730\u6807",main:"\u4E3B\u8981\u5185\u5BB9",header:"\u9875\u7709",footer:"\u9875\u811A",nav:"\u5BFC\u822A",aside:"\u4FA7\u8FB9\u680F",form:"\u8868\u5355",search:"\u641C\u7D22",statementTitle:"\u65E0\u969C\u788D\u58F0\u660E",statementIntro:"\u6211\u4EEC\u81F4\u529B\u4E8E\u4F7F\u672C\u7F51\u7AD9\u5BF9\u6240\u6709\u7528\u6237\uFF08\u5305\u62EC\u6B8B\u969C\u4EBA\u58EB\uFF09\u65E0\u969C\u788D\uFF0C\u7B26\u5408WCAG 2.1 AA \u7EA7\u6307\u5357\u3002",statementCoordinator:"\u65E0\u969C\u788D\u534F\u8C03\u5458",statementPhone:"\u7535\u8BDD",statementEmail:"\u7535\u5B50\u90AE\u4EF6",statementLastAudit:"\u4E0A\u6B21\u65E0\u969C\u788D\u5BA1\u6838\u65E5\u671F",statementAccommodations:"\u5DF2\u6267\u884C\u7684\u65E0\u969C\u788D\u8C03\u6574",copied:"\u5DF2\u590D\u5236\u5230\u526A\u8D34\u677F",embedCode:"\u5D4C\u5165\u4EE3\u7801",copyCode:"\u590D\u5236",badgeCompliant:"\u5408\u89C4",poweredBy:"\u6280\u672F\u652F\u6301",contrastAndColors:"\u5BF9\u6BD4\u5EA6\u548C\u989C\u8272\u8C03\u6574",fontSizeAdjustment:"\u5B57\u4F53\u5927\u5C0F\u8C03\u6574",keyboardNavigation:"\u952E\u76D8\u5BFC\u822A",screenReaderCompat:"\u5C4F\u5E55\u9605\u8BFB\u5668\u517C\u5BB9\u6027",linkHighlighting:"\u94FE\u63A5\u9AD8\u4EAE",animationControl:"\u52A8\u753B\u63A7\u5236",noAltText:"(\u65E0\u66FF\u4EE3\u6587\u672C)",ttsHover:"\u60AC\u505C\u6717\u8BFB",ttsSelection:"\u6717\u8BFB\u9009\u4E2D\u5185\u5BB9",ttsReadPage:"\u6717\u8BFB\u9875\u9762",ttsStop:"\u505C\u6B62\u6717\u8BFB",ttsReading:"\u6B63\u5728\u6717\u8BFB...",shortcutPanelToggle:"\u5207\u6362\u65E0\u969C\u788D\u83DC\u5355",keyboardShortcuts:"\u952E\u76D8\u5FEB\u6377\u952E"}},T="zh";function pt(s){var e;if(s&&s!=="auto"&&v[s])return s;let t=(e=document.documentElement.lang)==null?void 0:e.split("-")[0].toLowerCase();return t&&v[t]?t:"zh"}function Z(s){v[s]&&(T=s)}function b(){return T}function n(s){var t;return((t=v[T])==null?void 0:t[s])||v.en[s]||s}function tt(){var s;return((s=v[T])==null?void 0:s.dir)||"ltr"}function ut(){return Object.keys(v)}var et="opennagish_prefs",x=null;function _(){if(x)return x;try{let s=localStorage.getItem(et);x=s?JSON.parse(s):{}}catch(s){x={}}return x}function gt(){try{localStorage.setItem(et,JSON.stringify(x))}catch(s){}}function it(s,t){let e=_();return e[s]!==void 0?e[s]:t}function f(s,t){_(),x[s]=t,gt()}function L(s){_(),delete x[s],gt()}function mt(){x={};try{localStorage.removeItem(et)}catch(s){}}function ft(){return{..._()}}var Rt={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function g(s){return typeof s!="string"?"":s.replace(/[&<>"']/g,t=>Rt[t])}function C(s,t={},e=[]){let i=document.createElement(s);for(let[o,a]of Object.entries(t))o==="className"?i.className=a:o==="textContent"?i.textContent=a:o==="innerHTML"?i.innerHTML=a:o.startsWith("on")&&typeof a=="function"?i.addEventListener(o.slice(2).toLowerCase(),a):i.setAttribute(o,a);for(let o of e)typeof o=="string"?i.appendChild(document.createTextNode(o)):o&&i.appendChild(o);return i}function u(s,t){let e=document.getElementById(s);if(e)return e.textContent=t,e;let i=document.createElement("style");return i.id=s,i.textContent=t,document.head.appendChild(i),i}function c(s){let t=document.getElementById(s);t&&t.remove()}function y(s,t){let e=t.querySelector(".anid-live-region");e&&(e.textContent="",requestAnimationFrame(()=>{e.textContent=s}))}var nt="anid-font-size",It=-3,Bt=5,Dt=2,E=class{constructor(t){this.ctx=t,this.level=0}setLevel(t){this.level=Math.max(It,Math.min(Bt,t)),this.apply(),f("fontSize",this.level)}increase(){this.setLevel(this.level+1)}decrease(){this.setLevel(this.level-1)}reset(){this.setLevel(0)}apply(){if(this.level===0){c(nt);return}let e=`
495
+ html { font-size: calc(1em + ${this.level*Dt}px) !important; }
496
+ body, body *:not(#opennagish-widget) {
497
+ font-size: inherit !important;
498
+ }
499
+ `;u(nt,e)}enable(){this.apply()}disable(){this.level=0,c(nt),L("fontSize")}};var at="anid-contrast",bt={dark:`
500
+ html { filter: invert(1) hue-rotate(180deg) !important; }
501
+ html img, html video, html canvas, html svg image,
502
+ html [style*="background-image"] {
503
+ filter: invert(1) hue-rotate(180deg) !important;
504
+ }
505
+ `,light:`
506
+ html body { background: #fff !important; color: #000 !important; }
507
+ html body *:not(#opennagish-widget) {
508
+ background-color: #fff !important;
509
+ color: #000 !important;
510
+ border-color: #000 !important;
511
+ box-shadow: none !important;
512
+ }
513
+ html body a { color: #0000EE !important; }
514
+ html body img { opacity: 0.9; }
515
+ `,invert:`
516
+ html { filter: invert(1) !important; }
517
+ html img, html video, html canvas, html svg image {
518
+ filter: invert(1) !important;
519
+ }
520
+ `},$=class{constructor(t){this.ctx=t,this.mode="none"}setMode(t){this.mode=t,t==="none"||!bt[t]?c(at):u(at,bt[t])}enable(){}disable(){this.mode="none",c(at)}};var xt="anid-dark-mode",Ot=`
521
+ html body {
522
+ background-color: #1a1a2e !important;
523
+ color: #e0e0e0 !important;
524
+ }
525
+ html body *:not(#opennagish-widget) {
526
+ background-color: transparent !important;
527
+ color: #e0e0e0 !important;
528
+ border-color: #444 !important;
529
+ }
530
+ html body a { color: #90caf9 !important; }
531
+ html body input, html body textarea, html body select {
532
+ background-color: #2d2d44 !important;
533
+ color: #e0e0e0 !important;
534
+ border-color: #555 !important;
535
+ }
536
+ html body button {
537
+ background-color: #2d2d44 !important;
538
+ color: #e0e0e0 !important;
539
+ }
540
+ html body img { opacity: 0.85; }
541
+ `,H=class{constructor(t){this.ctx=t,this.active=!1}enable(){this.active||(this.active=!0,u(xt,Ot))}disable(){this.active=!1,c(xt)}toggle(){this.active?this.disable():this.enable()}};var yt="anid-monochrome",Nt="html { filter: grayscale(100%) !important; }",M=class{constructor(t){this.ctx=t,this.active=!1}enable(){this.active||(this.active=!0,u(yt,Nt))}disable(){this.active=!1,c(yt)}toggle(){this.active?this.disable():this.enable()}};var st="anid-saturation",P=class{constructor(t){this.ctx=t,this.value=100}setValue(t){this.value=t,t===100?c(st):u(st,`html { filter: saturate(${t}%) !important; }`)}enable(){this.apply()}apply(){this.value!==100&&this.setValue(this.value)}disable(){this.value=100,c(st)}};var vt="anid-spacing",jt=`
542
+ html body *:not(#opennagish-widget) {
543
+ line-height: 1.8 !important;
544
+ letter-spacing: 0.12em !important;
545
+ word-spacing: 0.16em !important;
546
+ }
547
+ html body p, html body li, html body dd {
548
+ margin-bottom: 1em !important;
549
+ }
550
+ `,z=class{constructor(t){this.ctx=t,this.active=!1}enable(){this.active||(this.active=!0,u(vt,jt))}disable(){this.active=!1,c(vt)}toggle(){this.active?this.disable():this.enable()}};var wt="anid-dyslexia-font",qt=`
551
+ @font-face {
552
+ font-family: 'OpenDyslexic';
553
+ src: url('https://cdn.jsdelivr.net/npm/open-dyslexic@1.0.3/woff/OpenDyslexic-Regular.woff') format('woff');
554
+ font-weight: normal;
555
+ font-style: normal;
556
+ font-display: swap;
557
+ }
558
+ @font-face {
559
+ font-family: 'OpenDyslexic';
560
+ src: url('https://cdn.jsdelivr.net/npm/open-dyslexic@1.0.3/woff/OpenDyslexic-Bold.woff') format('woff');
561
+ font-weight: bold;
562
+ font-style: normal;
563
+ font-display: swap;
564
+ }
565
+ html body, html body *:not(#opennagish-widget) {
566
+ font-family: 'OpenDyslexic', sans-serif !important;
567
+ }
568
+ `,R=class{constructor(t){this.ctx=t,this.active=!1}enable(){this.active||(this.active=!0,u(wt,qt))}disable(){this.active=!1,c(wt)}toggle(){this.active?this.disable():this.enable()}};var kt="anid-hide-images",Gt=`
569
+ html body img,
570
+ html body svg,
571
+ html body video,
572
+ html body [role="img"],
573
+ html body [style*="background-image"] {
574
+ opacity: 0.05 !important;
575
+ visibility: hidden !important;
576
+ }
577
+ `,I=class{constructor(t){this.ctx=t,this.active=!1}enable(){this.active||(this.active=!0,u(kt,Gt))}disable(){this.active=!1,c(kt)}toggle(){this.active?this.disable():this.enable()}};var St="anid-color-blind",rt="anid-color-blind-svg",Kt={protanopia:"0.567,0.433,0,0,0 0.558,0.442,0,0,0 0,0.242,0.758,0,0 0,0,0,1,0",deuteranopia:"0.625,0.375,0,0,0 0.7,0.3,0,0,0 0,0.3,0.7,0,0 0,0,0,1,0",tritanopia:"0.95,0.05,0,0,0 0,0.433,0.567,0,0 0,0.475,0.525,0,0 0,0,0,1,0"},B=class{constructor(t){this.ctx=t,this.mode=null}setMode(t){this.mode=t;let e=Kt[t];if(!e){this.disable();return}let i=document.getElementById(rt);i||(i=document.createElementNS("http://www.w3.org/2000/svg","svg"),i.id=rt,i.setAttribute("style","position:absolute;width:0;height:0;"),i.innerHTML='<defs><filter id="anid-cb-filter"><feColorMatrix type="matrix" values=""/></filter></defs>',document.body.appendChild(i)),i.querySelector("feColorMatrix").setAttribute("values",e),u(St,"html { filter: url(#anid-cb-filter) !important; }"),f("colorBlindMode",t)}enable(){this.mode&&this.setMode(this.mode)}disable(){this.mode=null,c(St);let t=document.getElementById(rt);t&&t.remove(),L("colorBlindMode")}toggle(){this.mode?this.disable():this.setMode("protanopia")}};var At="anid-keyboard-nav",Yt=`
578
+ html body *:focus {
579
+ outline: 3px solid #1565c0 !important;
580
+ outline-offset: 2px !important;
581
+ box-shadow: 0 0 0 4px rgba(21,101,192,0.3) !important;
582
+ }
583
+ `,D=class{constructor(t){this.ctx=t,this.active=!1,this._onTab=null}enable(){this.active||(this.active=!0,document.body.dataset.anidKeyboardNav="true",u(At,Yt),this._onTab=t=>{t.key==="Tab"&&document.body.classList.add("anid-using-keyboard")},document.addEventListener("keydown",this._onTab))}disable(){this.active=!1,delete document.body.dataset.anidKeyboardNav,document.body.classList.remove("anid-using-keyboard"),c(At),this._onTab&&(document.removeEventListener("keydown",this._onTab),this._onTab=null)}toggle(){this.active?this.disable():this.enable()}};var Tt="anid-focus",Vt=`
584
+ html body a:focus-visible,
585
+ html body button:focus-visible,
586
+ html body input:focus-visible,
587
+ html body select:focus-visible,
588
+ html body textarea:focus-visible,
589
+ html body [tabindex]:focus-visible {
590
+ outline: 4px solid #ff6f00 !important;
591
+ outline-offset: 3px !important;
592
+ box-shadow: 0 0 0 6px rgba(255,111,0,0.3) !important;
593
+ transition: outline 0.1s ease !important;
594
+ }
595
+ `,O=class{constructor(t){this.ctx=t,this.active=!1}enable(){this.active||(this.active=!0,u(Tt,Vt))}disable(){this.active=!1,c(Tt)}toggle(){this.active?this.disable():this.enable()}};var N=class{constructor(t){this.ctx=t}populateList(t){t.innerHTML="";let e=document.querySelectorAll("h1, h2, h3, h4, h5, h6");if(e.length===0){t.innerHTML=`<li style="padding:8px;color:#888;font-size:13px;">${n("noHeadings")}</li>`;return}e.forEach((i,o)=>{let a=i.tagName[1],r=i.textContent.trim().slice(0,60),h=document.createElement("li"),d=(parseInt(a)-1)*12,l=document.createElement("button");l.style.paddingInlineStart=`${d}px`,l.textContent=`H${a}: ${r}`,l.addEventListener("click",()=>{i.scrollIntoView({behavior:"smooth",block:"center"}),i.focus({preventScroll:!0}),i.style.outline="3px solid #1565c0",i.style.outlineOffset="4px",setTimeout(()=>{i.style.outline="",i.style.outlineOffset=""},2e3)}),h.appendChild(l),t.appendChild(h)})}enable(){}disable(){}};var _t={banner:"header",navigation:"nav",main:"main",contentinfo:"footer",complementary:"aside",form:"form",search:"search"},j=class{constructor(t){this.ctx=t}populateList(t){t.innerHTML="";let e=[];if(document.querySelectorAll("[role]").forEach(i=>{let o=i.getAttribute("role");_t[o]&&e.push({el:i,label:i.getAttribute("aria-label")||n(_t[o]),role:o})}),["header","nav","main","footer","aside","form","search"].forEach(i=>{document.querySelectorAll(i).forEach(o=>{o.getAttribute("role")||e.push({el:o,label:o.getAttribute("aria-label")||n(i),role:i})})}),e.length===0){t.innerHTML=`<li style="padding:8px;color:#888;font-size:13px;">${n("noLandmarks")}</li>`;return}e.forEach(({el:i,label:o,role:a})=>{let r=document.createElement("li"),h=document.createElement("button");h.textContent=`${a}: ${o}`,h.addEventListener("click",()=>{i.scrollIntoView({behavior:"smooth",block:"start"}),i.setAttribute("tabindex","-1"),i.focus({preventScroll:!0})}),r.appendChild(h),t.appendChild(r)})}enable(){}disable(){}};var q=class{constructor(t){this.ctx=t,this.active=!1,this.guide=null,this._onMove=null}enable(){this.active||(this.active=!0,this.guide||(this.guide=document.createElement("div"),this.guide.id="anid-reading-guide",this.guide.style.cssText=`
596
+ position: fixed;
597
+ left: 0;
598
+ width: 100%;
599
+ height: 12px;
600
+ background: rgba(21, 101, 192, 0.15);
601
+ border-top: 2px solid rgba(21, 101, 192, 0.5);
602
+ border-bottom: 2px solid rgba(21, 101, 192, 0.5);
603
+ pointer-events: none;
604
+ z-index: 2147483640;
605
+ transition: top 0.05s linear;
606
+ `,document.body.appendChild(this.guide)),this.guide.style.display="",this._onMove=t=>{this.guide.style.top=`${t.clientY-6}px`},document.addEventListener("mousemove",this._onMove))}disable(){this.active=!1,this._onMove&&(document.removeEventListener("mousemove",this._onMove),this._onMove=null),this.guide&&(this.guide.remove(),this.guide=null)}toggle(){this.active?this.disable():this.enable()}};var G=class{constructor(t){this.ctx=t,this.active=!1,this.maskTop=null,this.maskBottom=null,this._onMove=null}enable(){this.active||(this.active=!0,this.maskTop||(this.maskTop=this._createOverlay("top"),this.maskBottom=this._createOverlay("bottom"),document.body.appendChild(this.maskTop),document.body.appendChild(this.maskBottom)),this.maskTop.style.display="",this.maskBottom.style.display="",this._onMove=t=>{let i=t.clientY;this.maskTop.style.height=`${Math.max(0,i-80/2)}px`,this.maskBottom.style.top=`${i+80/2}px`,this.maskBottom.style.height=`${Math.max(0,window.innerHeight-i-80/2)}px`},document.addEventListener("mousemove",this._onMove))}_createOverlay(t){let e=document.createElement("div");return e.className=`anid-line-mask-${t}`,e.style.cssText=`
607
+ position: fixed;
608
+ left: 0;
609
+ width: 100%;
610
+ background: rgba(0, 0, 0, 0.6);
611
+ pointer-events: none;
612
+ z-index: 2147483640;
613
+ transition: height 0.05s linear, top 0.05s linear;
614
+ `,t==="top"?(e.style.top="0",e.style.height="0"):(e.style.bottom="0",e.style.height="0"),e}disable(){this.active=!1,this._onMove&&(document.removeEventListener("mousemove",this._onMove),this._onMove=null),this.maskTop&&(this.maskTop.remove(),this.maskTop=null),this.maskBottom&&(this.maskBottom.remove(),this.maskBottom=null)}toggle(){this.active?this.disable():this.enable()}};var Lt="anid-big-cursor",Ft=`
615
+ html body, html body *:not(#opennagish-widget) {
616
+ cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48'%3E%3Cpath d='M8 4l28 20H20l-1 1 9 17-5 2-9-17-6 6z' fill='%23000' stroke='%23fff' stroke-width='2'/%3E%3C/svg%3E") 4 4, auto !important;
617
+ }
618
+ html body a, html body a *, html body button, html body button *,
619
+ html body [role="button"], html body input[type="submit"],
620
+ html body input[type="button"], html body label, html body select {
621
+ cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='48' viewBox='0 0 48 48'%3E%3Cpath d='M20 4v28h5l-1-1 8-13h8L12 42V4z' fill='%23000' stroke='%23fff' stroke-width='2'/%3E%3C/svg%3E") 14 4, pointer !important;
622
+ }
623
+ `,K=class{constructor(t){this.ctx=t,this.active=!1}enable(){this.active||(this.active=!0,u(Lt,Ft))}disable(){this.active=!1,c(Lt)}toggle(){this.active?this.disable():this.enable()}};var Y=class{constructor(t){this.ctx=t,this.overlay=null,this._escHandler=null}toggle(){this.overlay?this.close():this.show()}show(){let t=this.extractContent();this.overlay=document.createElement("div"),this.overlay.setAttribute("role","dialog"),this.overlay.setAttribute("aria-modal","true"),this.overlay.setAttribute("aria-label",n("screenReaderPreview")),this.overlay.style.cssText=`
624
+ position: fixed;
625
+ z-index: 2147483645;
626
+ top: 0; left: 0; right: 0; bottom: 0;
627
+ background: rgba(0,0,0,0.92);
628
+ color: #e0e0e0;
629
+ overflow-y: auto;
630
+ padding: 60px 40px 40px;
631
+ font-family: 'Courier New', monospace;
632
+ font-size: 15px;
633
+ line-height: 2;
634
+ white-space: pre-wrap;
635
+ `,this.overlay.textContent=t;let e=document.createElement("button");e.textContent=`\u2715 ${n("close")}`,e.setAttribute("aria-label",n("close")),e.style.cssText=`
636
+ position: fixed;
637
+ top: 12px; inset-inline-end: 12px;
638
+ z-index: 2147483646;
639
+ background: #c62828;
640
+ color: #fff;
641
+ border: none;
642
+ padding: 10px 20px;
643
+ border-radius: 8px;
644
+ font-size: 16px;
645
+ cursor: pointer;
646
+ min-width: 44px;
647
+ min-height: 44px;
648
+ `,e.addEventListener("click",()=>this.close()),this.overlay.appendChild(e),document.body.appendChild(this.overlay),e.focus(),this._escHandler=i=>{i.key==="Escape"&&this.close()},document.addEventListener("keydown",this._escHandler)}close(){this.overlay&&(this.overlay.remove(),this.overlay=null),this._escHandler&&(document.removeEventListener("keydown",this._escHandler),this._escHandler=null)}extractContent(){let t=[],e=document.title;e&&t.push(`[Page Title] ${e}
649
+ `);let i=document.documentElement.lang;i&&t.push(`[Language] ${i}
650
+ `);let o=a=>{if(a.nodeType===Node.TEXT_NODE){let d=a.textContent.trim();d&&t.push(d);return}if(a.nodeType!==Node.ELEMENT_NODE)return;let r=a.tagName.toLowerCase(),h=a.getAttribute("role");if(!["script","style","noscript","template"].includes(r)&&!(a.hidden||a.getAttribute("aria-hidden")==="true")&&a.id!=="opennagish-widget"){if(/^h[1-6]$/.test(r)){t.push(`
651
+ [${"#".repeat(parseInt(r[1]))} Heading ${r[1]}] ${a.textContent.trim()}`);return}if(r==="img"){let d=a.alt||n("noAltText");t.push(`[Image: ${d}]`);return}if(r==="a"&&a.href){t.push(`[Link: ${a.textContent.trim()} -> ${a.href}]`);return}if(["nav","header","footer","main","aside"].includes(r)||h){let d=a.getAttribute("aria-label");t.push(`
652
+ --- [${h||r}${d?": "+d:""}] ---`)}r==="li"&&t.push(" \u2022 ");for(let d of a.childNodes)o(d)}};return o(document.body),t.join(`
653
+ `)}enable(){}disable(){this.close()}};var Ct="anid-links",Ut=`
654
+ html body a {
655
+ text-decoration: underline !important;
656
+ text-decoration-thickness: 2px !important;
657
+ text-underline-offset: 3px !important;
658
+ outline: 2px solid transparent !important;
659
+ border-bottom: 2px solid #1565c0 !important;
660
+ background-color: rgba(21, 101, 192, 0.08) !important;
661
+ padding: 1px 3px !important;
662
+ border-radius: 2px !important;
663
+ }
664
+ html body a:hover {
665
+ background-color: rgba(21, 101, 192, 0.18) !important;
666
+ }
667
+ `,V=class{constructor(t){this.ctx=t,this.active=!1}enable(){this.active||(this.active=!0,u(Ct,Ut))}disable(){this.active=!1,c(Ct)}toggle(){this.active?this.disable():this.enable()}};var lt="data-anid-alt-shown",F=class{constructor(t){this.ctx=t,this.active=!1,this.overlays=[]}enable(){this.active||(this.active=!0,document.querySelectorAll("img").forEach(t=>{if(t.getAttribute(lt))return;let e=t.alt||t.getAttribute("aria-label")||"",i=e||`\u26A0 ${n("noAltText")}`,o=document.createElement("span");o.className="anid-alt-overlay",o.style.cssText=`
668
+ position: absolute;
669
+ bottom: 4px;
670
+ left: 4px;
671
+ right: 4px;
672
+ background: ${e?"rgba(21,101,192,0.9)":"rgba(198,40,40,0.9)"};
673
+ color: #fff;
674
+ font-size: 12px;
675
+ padding: 4px 8px;
676
+ border-radius: 4px;
677
+ z-index: 2147483630;
678
+ pointer-events: none;
679
+ word-break: break-word;
680
+ max-height: 60px;
681
+ overflow: hidden;
682
+ font-family: sans-serif;
683
+ line-height: 1.4;
684
+ `,o.textContent=i;let a=t.parentElement;if(a){let r=getComputedStyle(a).position;r==="static"&&(a.style.position="relative"),a.appendChild(o),t.setAttribute(lt,"true"),this.overlays.push({overlay:o,img:t,wrapper:a,hadPosition:r})}}))}disable(){this.active=!1,this.overlays.forEach(({overlay:t,img:e,wrapper:i,hadPosition:o})=>{t.remove(),e.removeAttribute(lt),o==="static"&&(i.style.position="")}),this.overlays=[]}toggle(){this.active?this.disable():this.enable()}};var Et="anid-animations",k="data-anid-orig-src",Wt=`
685
+ html body *:not(#opennagish-widget),
686
+ html body *:not(#opennagish-widget)::before,
687
+ html body *:not(#opennagish-widget)::after {
688
+ animation-duration: 0.001ms !important;
689
+ animation-iteration-count: 1 !important;
690
+ transition-duration: 0.001ms !important;
691
+ scroll-behavior: auto !important;
692
+ }
693
+ `,U=class{constructor(t){this.ctx=t,this.active=!1}enable(){this.active||(this.active=!0,u(Et,Wt),document.querySelectorAll('img[src$=".gif"], img[src*=".gif?"]').forEach(t=>{if(!t.getAttribute(k))try{let e=document.createElement("canvas");e.width=t.naturalWidth||t.width||100,e.height=t.naturalHeight||t.height||100,e.getContext("2d").drawImage(t,0,0,e.width,e.height),t.setAttribute(k,t.src),t.src=e.toDataURL()}catch(e){}}))}disable(){this.active=!1,c(Et),document.querySelectorAll(`[${k}]`).forEach(t=>{t.src=t.getAttribute(k),t.removeAttribute(k)})}toggle(){this.active?this.disable():this.enable()}};var S="data-anid-orig-src",W=class{constructor(t){this.ctx=t,this.active=!1,this.mutedElements=[]}enable(){this.active||(this.active=!0,document.querySelectorAll("audio, video").forEach(t=>{t.muted||(t.muted=!0,t.pause(),this.mutedElements.push(t))}),document.querySelectorAll("iframe").forEach(t=>{try{let e=t.src||"";if(!e||t.getAttribute(S))return;if((e.includes("youtube")||e.includes("vimeo")||e.includes("dailymotion"))&&!e.includes("mute=1")&&!e.includes("muted=1")){t.setAttribute(S,e);let i=e.includes("?")?"&":"?";t.src=e+i+"mute=1"}}catch(e){}}))}disable(){this.active=!1,this.mutedElements.forEach(t=>{t.muted=!1}),this.mutedElements=[],document.querySelectorAll(`iframe[${S}]`).forEach(t=>{t.src=t.getAttribute(S),t.removeAttribute(S)})}toggle(){this.active?this.disable():this.enable()}};var X=class{constructor(t){this.ctx=t,this.modal=null,this.backdrop=null,this._escHandler=null}show(){let t=this.ctx.config;if(t.statementUrl){window.open(t.statementUrl,"_blank","noopener,noreferrer");return}this.close();let e=t.statementData||{};this.backdrop=document.createElement("div"),this.backdrop.style.cssText="position:fixed;z-index:2147483644;inset:0;background:rgba(0,0,0,0.5);",this.backdrop.addEventListener("click",()=>this.close()),this.modal=document.createElement("div");let i=b()==="he"||b()==="ar"?"rtl":"ltr";this.modal.setAttribute("dir",i),this.modal.setAttribute("role","dialog"),this.modal.setAttribute("aria-modal","true"),this.modal.setAttribute("aria-label",n("statementTitle")),this.modal.style.cssText=`
694
+ position: fixed; z-index: 2147483645;
695
+ top: 50%; left: 50%; transform: translate(-50%, -50%);
696
+ width: 600px; max-width: calc(100vw - 40px); max-height: calc(100vh - 80px);
697
+ background: #fff; border-radius: 12px;
698
+ box-shadow: 0 16px 48px rgba(0,0,0,0.3);
699
+ overflow-y: auto; padding: 32px;
700
+ font-family: sans-serif; color: #1a1a2e; line-height: 1.7;
701
+ `;let a=(e.accommodations||[n("contrastAndColors"),n("fontSizeAdjustment"),n("keyboardNavigation"),n("screenReaderCompat"),n("linkHighlighting"),n("animationControl")]).map(p=>`<li>${g(p)}</li>`).join(""),r=e.coordinatorName?`<p><strong>${g(n("statementCoordinator"))}:</strong> ${g(e.coordinatorName)}</p>`:"",h=e.orgPhone?`<p><strong>${g(n("statementPhone"))}:</strong> <a href="tel:${g(e.orgPhone)}">${g(e.orgPhone)}</a></p>`:"",d=e.orgEmail?`<p><strong>${g(n("statementEmail"))}:</strong> <a href="mailto:${g(e.orgEmail)}">${g(e.orgEmail)}</a></p>`:"",l=e.lastAuditDate?`<p><strong>${g(n("statementLastAudit"))}:</strong> ${g(e.lastAuditDate)}</p>`:"";this.modal.innerHTML=`
702
+ <div style="display:flex;justify-content:space-between;align-items:center;margin-bottom:20px;">
703
+ <h2 style="font-size:22px;margin:0;">${g(n("statementTitle"))}</h2>
704
+ <button id="anid-stmt-close" style="background:none;border:none;font-size:24px;cursor:pointer;width:44px;height:44px;border-radius:50%;display:flex;align-items:center;justify-content:center;" aria-label="${g(n("close"))}">&#x2715;</button>
705
+ </div>
706
+ <p>${g(n("statementIntro"))}</p>
707
+ ${r}
708
+ ${h}
709
+ ${d}
710
+ ${l}
711
+ <p><strong>${g(n("statementAccommodations"))}:</strong></p>
712
+ <ul style="padding-inline-start:20px;margin-bottom:16px;">${a}</ul>
713
+ <p style="font-size:12px;color:#888;">${g(n("poweredBy"))} <a href="https://gitee.com/WilliamHao/npm-c-a11y" target="_blank" rel="noopener noreferrer" style="color:#888;text-decoration:underline;">A11y</a> | WCAG 2.1 AA</p>
714
+ `,document.body.appendChild(this.backdrop),document.body.appendChild(this.modal),this.modal.querySelector("#anid-stmt-close").addEventListener("click",()=>this.close()),this.modal.querySelector("#anid-stmt-close").focus(),this._escHandler=p=>{p.key==="Escape"&&this.close()},document.addEventListener("keydown",this._escHandler)}close(){this.modal&&(this.modal.remove(),this.modal=null),this.backdrop&&(this.backdrop.remove(),this.backdrop=null),this._escHandler&&(document.removeEventListener("keydown",this._escHandler),this._escHandler=null)}enable(){}disable(){this.close()}};var J=class{constructor(t){this.ctx=t,this.modal=null,this.backdrop=null,this._escHandler=null}_buildSvg(){let t="WCAG 2.1 AA",e=`A11y ${n("badgeCompliant")}`;return`<svg xmlns="http://www.w3.org/2000/svg" width="240" height="40" viewBox="0 0 240 40">
715
+ <defs>
716
+ <linearGradient id="abg" x1="0" y1="0" x2="0" y2="1">
717
+ <stop offset="0%" stop-color="#1976d2"/>
718
+ <stop offset="100%" stop-color="#0d47a1"/>
719
+ </linearGradient>
720
+ </defs>
721
+ <rect width="240" height="40" rx="8" fill="url(#abg)"/>
722
+ <rect x="1" y="1" width="238" height="38" rx="7" fill="none" stroke="#fff" stroke-opacity="0.25"/>
723
+ <circle cx="20" cy="20" r="12" fill="#fff" fill-opacity="0.2"/>
724
+ <text x="20" y="25" text-anchor="middle" fill="#fff" font-size="16" font-family="sans-serif">&#x267F;</text>
725
+ <text x="40" y="16" fill="#fff" font-size="11" font-family="sans-serif" font-weight="bold">${g(t)}</text>
726
+ <text x="40" y="31" fill="#fff" font-size="10" font-family="sans-serif" opacity="0.85">${g(e)}</text>
727
+ </svg>`}show(){this.close();let t=this._buildSvg(),e=`<a href="#" title="Accessibility"><img src="data:image/svg+xml,${encodeURIComponent(t.trim())}" alt="WCAG 2.1 AA Accessible" width="240" height="40"></a>`,i=b()==="he"||b()==="ar"?"rtl":"ltr";this.backdrop=document.createElement("div"),this.backdrop.style.cssText="position:fixed;z-index:2147483644;inset:0;background:rgba(0,0,0,0.5);",this.backdrop.addEventListener("click",()=>this.close()),this.modal=document.createElement("div"),this.modal.setAttribute("role","dialog"),this.modal.setAttribute("aria-modal","true"),this.modal.setAttribute("dir",i),this.modal.setAttribute("aria-label",n("complianceBadge")),this.modal.style.cssText=`
728
+ position:fixed;z-index:2147483645;
729
+ top:50%;left:50%;transform:translate(-50%,-50%);
730
+ width:520px;max-width:calc(100vw - 40px);
731
+ background:#fff;border-radius:12px;
732
+ box-shadow:0 16px 48px rgba(0,0,0,0.3);
733
+ padding:32px;font-family:sans-serif;color:#1a1a2e;
734
+ `,this.modal.innerHTML=`
735
+ <div style="display:flex;justify-content:space-between;align-items:center;margin-bottom:20px;">
736
+ <h2 style="font-size:20px;margin:0;">${g(n("complianceBadge"))}</h2>
737
+ <button id="anid-badge-close" style="background:none;border:none;font-size:24px;cursor:pointer;width:44px;height:44px;border-radius:50%;display:flex;align-items:center;justify-content:center;" aria-label="${g(n("close"))}">&#x2715;</button>
738
+ </div>
739
+ <div style="text-align:center;padding:24px;background:#f5f5f5;border-radius:8px;margin-bottom:20px;">${t}</div>
740
+ <label style="display:block;font-size:13px;color:#666;margin-bottom:6px;font-weight:600;">${g(n("embedCode"))}</label>
741
+ <textarea readonly style="width:100%;height:80px;padding:10px;border:1px solid #ddd;border-radius:8px;font-size:12px;font-family:monospace;resize:none;background:#fafafa;direction:ltr;text-align:left;">${g(e)}</textarea>
742
+ <button id="anid-badge-copy" style="display:block;margin-top:14px;padding:10px 24px;background:#1565c0;color:#fff;border:none;border-radius:8px;cursor:pointer;font-size:14px;min-height:44px;font-weight:600;margin-inline-start:auto;">${g(n("copyCode"))}</button>
743
+ `,document.body.appendChild(this.backdrop),document.body.appendChild(this.modal);let o=this.modal.querySelector("#anid-badge-copy");this.modal.querySelector("#anid-badge-close").addEventListener("click",()=>this.close()),o.addEventListener("click",()=>{this._copyToClipboard(e).then(()=>{o.textContent=n("copied"),o.style.background="#2e7d32",setTimeout(()=>{o.textContent=n("copyCode"),o.style.background="#1565c0"},2e3),this.ctx.announce(n("copied"))}).catch(()=>{})}),this._escHandler=a=>{a.key==="Escape"&&this.close()},document.addEventListener("keydown",this._escHandler),this.modal.querySelector("#anid-badge-close").focus()}_copyToClipboard(t){var e;return(e=navigator.clipboard)!=null&&e.writeText?navigator.clipboard.writeText(t):new Promise((i,o)=>{try{let a=document.createElement("textarea");a.value=t,a.style.cssText="position:fixed;left:-9999px;top:-9999px;opacity:0;",document.body.appendChild(a),a.select();let r=document.execCommand("copy");a.remove(),r?i():o(new Error("execCommand failed"))}catch(a){o(a)}})}close(){this.modal&&(this.modal.remove(),this.modal=null),this.backdrop&&(this.backdrop.remove(),this.backdrop=null),this._escHandler&&(document.removeEventListener("keydown",this._escHandler),this._escHandler=null)}enable(){}disable(){this.close()}};var Xt={he:"he-IL",en:"en-US",ar:"ar-SA",ru:"ru-RU"},$t="data-anid-tts-hl",Q=class{constructor(t){this.ctx=t,this.hoverActive=!1,this.selectionActive=!1,this.reading=!1,this._onMouseOver=this._onMouseOver.bind(this),this._onMouseUp=this._onMouseUp.bind(this),this._highlighted=null,this._savedStyles=null,this._hoverDebounce=null,this._warmUpVoices()}_warmUpVoices(){this.supported&&(this.synth.getVoices().length||this.synth.addEventListener("voiceschanged",()=>{},{once:!0}))}_unlockAudio(){if(!this._audioUnlocked)try{let t=new(window.AudioContext||window.webkitAudioContext),e=t.createBuffer(1,1,22050),i=t.createBufferSource();i.buffer=e,i.connect(t.destination),i.start(),t.resume().then(()=>t.close()),this._audioUnlocked=!0}catch(t){}}get synth(){return window.speechSynthesis}get supported(){return"speechSynthesis"in window}_getLang(){let e=document.documentElement.lang||b()||"en";return Xt[e]||e}_findVoice(t){let e=this.synth.getVoices();if(!e.length)return null;let i=t.split("-")[0].toLowerCase();return e.find(o=>o.lang.toLowerCase().startsWith(i))||e.find(o=>o.default)||e[0]}_speak(t){if(!this.supported||!t.trim())return;this._unlockAudio(),this._clearResumeTimer();let e=()=>{let i=new SpeechSynthesisUtterance(t),o=this._getLang(),a=this._findVoice(o);a?(i.voice=a,i.lang=a.lang):i.lang=o,i.rate=1,i.pitch=1,i.onend=()=>{this.reading=!1,this._clearResumeTimer()},i.onerror=()=>{this.reading=!1,this._clearResumeTimer()},this.reading=!0,this.synth.speak(i),this._startResumeTimer()};this.synth.speaking||this.synth.pending?(this.synth.cancel(),setTimeout(e,80)):e()}_startResumeTimer(){this._resumeTimer=setInterval(()=>{this.synth.speaking&&!this.synth.paused&&(this.synth.pause(),this.synth.resume())},1e4)}_clearResumeTimer(){this._resumeTimer&&(clearInterval(this._resumeTimer),this._resumeTimer=null)}stop(){this.supported&&(this.synth.cancel(),this.reading=!1,this._clearResumeTimer(),this._clearHighlight())}enableHover(){this.hoverActive||(this.hoverActive=!0,document.addEventListener("mouseover",this._onMouseOver,!0))}disableHover(){this.hoverActive=!1,document.removeEventListener("mouseover",this._onMouseOver,!0),this._clearHighlight(),clearTimeout(this._hoverDebounce),!this.selectionActive&&!this.reading&&this.stop()}_onMouseOver(t){let e=t.target;!e||e.nodeType!==1||e.closest("#opennagish-widget")||(clearTimeout(this._hoverDebounce),this._hoverDebounce=setTimeout(()=>{let i=this._getElementText(e);i&&(this._clearHighlight(),this._savedStyles={outline:e.style.outline,outlineOffset:e.style.outlineOffset,background:e.style.background},e.setAttribute($t,""),e.style.outline="3px solid #1565c0",e.style.outlineOffset="2px",e.style.background="rgba(21,101,192,0.08)",this._highlighted=e,this._speak(i))},300))}_getElementText(t){return t.tagName==="IMG"?t.alt||"":t.tagName==="INPUT"||t.tagName==="TEXTAREA"?t.value||t.placeholder||"":(t.innerText||t.textContent||"").trim().substring(0,500)}_clearHighlight(){this._highlighted&&(this._highlighted.removeAttribute($t),this._savedStyles&&(this._highlighted.style.outline=this._savedStyles.outline,this._highlighted.style.outlineOffset=this._savedStyles.outlineOffset,this._highlighted.style.background=this._savedStyles.background),this._highlighted=null,this._savedStyles=null)}enableSelection(){this.selectionActive||(this.selectionActive=!0,document.addEventListener("mouseup",this._onMouseUp,!0))}disableSelection(){this.selectionActive=!1,document.removeEventListener("mouseup",this._onMouseUp,!0),!this.hoverActive&&!this.reading&&this.stop()}_onMouseUp(){let t=window.getSelection(),e=t?t.toString().trim():"";e.length>0&&this._speak(e)}readPage(){let t=this._extractPageText();t&&(this.ctx.announce(n("ttsReading")),this._speak(t))}_extractPageText(){let t=[],e=i=>{if(i.nodeType===Node.TEXT_NODE){let a=i.textContent.trim();a&&t.push(a);return}if(i.nodeType!==Node.ELEMENT_NODE)return;let o=i.tagName.toLowerCase();if(!["script","style","noscript","template"].includes(o)&&!(i.hidden||i.getAttribute("aria-hidden")==="true")&&i.id!=="opennagish-widget")for(let a of i.childNodes)e(a)};return e(document.body),t.join(" ").substring(0,5e3)}enable(){}disable(){this.disableHover(),this.disableSelection(),this.stop()}};var Jt='<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M12 2a2 2 0 1 1 0 4 2 2 0 0 1 0-4zm9 7h-6l-1.41-1.41A2 2 0 0 0 12.17 7H12a2 2 0 0 0-1.42.59L9 9H3a1 1 0 0 0 0 2h5l1 1v3l-2 5a1 1 0 0 0 1.8.8L11 16h2l2.2 4.8a1 1 0 0 0 1.8-.8l-2-5v-3l1-1h5a1 1 0 0 0 0-2z"/></svg>',Ht={darkMode:"darkMode",monochrome:"monochrome",textSpacing:"spacing",dyslexiaFont:"dyslexiaFont",hideImages:"hideImages",colorBlindSim:"colorBlind",keyboardNav:"keyboardNav",focusIndicators:"focus",readingGuide:"readingGuide",lineMask:"lineMask",bigCursor:"cursor",linkHighlight:"links",imageAltText:"images",stopAnimations:"animations",muteSounds:"muteSounds"},Qt=["bottom-left","bottom-right","top-left","top-right"],A=null,dt=class{constructor(){this.isOpen=!1,this.modules={},this.shadowHost=null,this.shadowRoot=null,this.panel=null,this.trigger=null,this.config=window.OpenA11yConfig||{},this._keydownHandler=null,this._resizeHandler=null,this._destroyed=!1}init(){let t=it("lang")||pt(this.config.lang);Z(t),this.shadowHost=document.createElement("div"),this.shadowHost.id="opennagish-widget",this.shadowHost.style.cssText="all:initial;",document.body.appendChild(this.shadowHost),this.shadowRoot=this.shadowHost.attachShadow({mode:"open"});let e=document.createElement("style");e.textContent=ht(),this.shadowRoot.appendChild(e);let i=C("div",{className:"anid-live-region",role:"status","aria-live":"polite","aria-atomic":"true"});this.shadowRoot.appendChild(i),this.createTrigger(),this.createPanel(),this.initModules(),this.restoreState(),this.bindGlobalKeys(),this.bindViewportListeners()}createTrigger(){let t=this._getPosition();this.trigger=C("button",{className:"anid-trigger","aria-label":n("openPanel"),"aria-expanded":"false","aria-controls":"anid-panel",innerHTML:Jt}),this.positionElement(this.trigger,t),this.makeDraggable(this.trigger),this.shadowRoot.appendChild(this.trigger)}createPanel(){let t=this._getPosition();this.panel=C("div",{className:"anid-panel",id:"anid-panel",role:"dialog","aria-label":n("panelTitle"),"aria-modal":"false"}),this.panel.setAttribute("dir",tt()),this.positionPanel(t),this.panel.innerHTML=this.buildPanelHTML(),this.shadowRoot.appendChild(this.panel),this.bindPanelEvents()}_getPosition(){let t=this.config.position||"bottom-left";return Qt.includes(t)?t:"bottom-left"}buildPanelHTML(){let e=ut().map(i=>{let o={en:"English",zh:"\u4E2D\u6587"};return`<option value="${i}" ${i===b()?"selected":""}>${o[i]||i}</option>`}).join("");return`
744
+ <div class="anid-panel-header">
745
+ <span class="anid-panel-title">${n("panelTitle")}</span>
746
+ <select class="anid-lang-select" aria-label="${n("language")}">${e}</select>
747
+ <button class="anid-close-btn" aria-label="${n("closePanel")}">&#x2715;</button>
748
+ </div>
749
+ <div class="anid-panel-body">
750
+ ${this.buildCategory("vision",n("categoryVision"),"\u{1F441}",[{id:"fontSize",type:"buttons",shortcut:"Alt+F"},{id:"highContrast",type:"contrast",shortcut:"Alt+C"},{id:"darkMode",type:"toggle",shortcut:"Alt+D"},{id:"monochrome",type:"toggle"},{id:"saturation",type:"slider"},{id:"textSpacing",type:"toggle"},{id:"dyslexiaFont",type:"toggle"},{id:"hideImages",type:"toggle"},{id:"colorBlindSim",type:"colorblind"}])}
751
+ ${this.buildCategory("navigation",n("categoryNavigation"),"\u{1F9ED}",[{id:"keyboardNav",type:"toggle",shortcut:"Alt+K"},{id:"focusIndicators",type:"toggle"},{id:"headingStructure",type:"headings"},{id:"pageStructure",type:"landmarks"},{id:"readingGuide",type:"toggle",shortcut:"Alt+G"},{id:"lineMask",type:"toggle"},{id:"bigCursor",type:"toggle"},{id:"screenReaderPreview",type:"action"}])}
752
+ ${this.buildCategory("media",n("categoryMedia"),"\u{1F50A}",[{id:"ttsHover",type:"toggle"},{id:"ttsSelection",type:"toggle"},{id:"ttsReadPage",type:"action",shortcut:"Alt+T"},{id:"linkHighlight",type:"toggle",shortcut:"Alt+L"},{id:"imageAltText",type:"toggle"},{id:"stopAnimations",type:"toggle"},{id:"muteSounds",type:"toggle",shortcut:"Alt+M"}])}
753
+ ${this.buildCategory("compliance",n("categoryCompliance"),"\u2705",[{id:"accessibilityStatement",type:"action"},{id:"complianceBadge",type:"action"}])}
754
+ </div>
755
+ <div class="anid-panel-footer">
756
+ <button class="anid-reset-btn">${n("resetAll")}</button>
757
+ </div>
758
+ `}buildCategory(t,e,i,o){let a=t==="vision"?"true":"false",r="";for(let h of o)r+=this.buildFeature(h);return`
759
+ <div class="anid-category" data-category="${t}" data-expanded="${a}">
760
+ <button class="anid-category-header" aria-expanded="${a}">
761
+ <span class="anid-category-icon">${i}</span>
762
+ <span>${e}</span>
763
+ <span class="anid-category-chevron">&#x25BC;</span>
764
+ </button>
765
+ <div class="anid-category-content" role="region">
766
+ ${r}
767
+ </div>
768
+ </div>
769
+ `}buildFeature(t){let e=n(t.id),i=t.shortcut?` <kbd class="anid-shortcut">${t.shortcut}</kbd>`:"",o=`${e}${i}`;switch(t.type){case"toggle":return`
770
+ <div class="anid-feature" data-feature="${t.id}">
771
+ <span class="anid-feature-label">${o}</span>
772
+ <label class="anid-toggle">
773
+ <input type="checkbox" data-toggle="${t.id}" aria-label="${e}">
774
+ <span class="anid-toggle-slider"></span>
775
+ </label>
776
+ </div>`;case"buttons":return`
777
+ <div class="anid-feature" data-feature="${t.id}">
778
+ <span class="anid-feature-label">${o}</span>
779
+ <div class="anid-btn-group">
780
+ <button class="anid-btn" data-action="fontDecrease" aria-label="${n("fontSizeDecrease")}">A-</button>
781
+ <button class="anid-btn" data-action="fontReset" aria-label="${n("fontSizeReset")}">A</button>
782
+ <button class="anid-btn" data-action="fontIncrease" aria-label="${n("fontSizeIncrease")}">A+</button>
783
+ </div>
784
+ </div>`;case"contrast":return`
785
+ <div class="anid-feature" data-feature="${t.id}">
786
+ <span class="anid-feature-label">${o}</span>
787
+ <div class="anid-btn-group">
788
+ <button class="anid-btn" data-action="contrastDark" aria-label="${n("contrastDark")}">${n("contrastDark")}</button>
789
+ <button class="anid-btn" data-action="contrastLight" aria-label="${n("contrastLight")}">${n("contrastLight")}</button>
790
+ <button class="anid-btn" data-action="contrastInvert" aria-label="${n("contrastInvert")}">${n("contrastInvert")}</button>
791
+ </div>
792
+ </div>`;case"slider":return`
793
+ <div class="anid-feature" data-feature="${t.id}">
794
+ <span class="anid-feature-label">${o}</span>
795
+ <div class="anid-slider-wrap">
796
+ <input type="range" class="anid-slider" data-slider="${t.id}" min="0" max="200" value="100" aria-label="${e}">
797
+ </div>
798
+ </div>`;case"colorblind":return`
799
+ <div class="anid-feature" data-feature="${t.id}">
800
+ <span class="anid-feature-label">${o}</span>
801
+ <label class="anid-toggle">
802
+ <input type="checkbox" data-toggle="${t.id}" aria-label="${e}">
803
+ <span class="anid-toggle-slider"></span>
804
+ </label>
805
+ </div>
806
+ <div class="anid-sub-options" data-sub="${t.id}" style="display:none">
807
+ <div class="anid-btn-group">
808
+ <button class="anid-btn" data-action="cbProtanopia">${n("protanopia")}</button>
809
+ <button class="anid-btn" data-action="cbDeuteranopia">${n("deuteranopia")}</button>
810
+ <button class="anid-btn" data-action="cbTritanopia">${n("tritanopia")}</button>
811
+ </div>
812
+ </div>`;case"headings":return`
813
+ <div class="anid-feature" data-feature="${t.id}">
814
+ <span class="anid-feature-label">${o}</span>
815
+ <button class="anid-btn" data-action="toggleHeadings">${n("jumpTo")}</button>
816
+ </div>
817
+ <ul class="anid-heading-list" data-list="headings" style="display:none"></ul>`;case"landmarks":return`
818
+ <div class="anid-feature" data-feature="${t.id}">
819
+ <span class="anid-feature-label">${o}</span>
820
+ <button class="anid-btn" data-action="toggleLandmarks">${n("jumpTo")}</button>
821
+ </div>
822
+ <ul class="anid-landmark-list" data-list="landmarks" style="display:none"></ul>`;case"action":return`
823
+ <div class="anid-feature" data-feature="${t.id}">
824
+ <span class="anid-feature-label">${o}</span>
825
+ <button class="anid-btn" data-action="${t.id}">${e}</button>
826
+ </div>`;default:return""}}bindPanelEvents(){let t=this.shadowRoot;t.querySelector(".anid-close-btn").addEventListener("click",()=>this.close()),t.querySelector(".anid-lang-select").addEventListener("change",e=>{let i=e.target.value;Z(i),f("lang",i),this.rebuildPanel(),y(n("panelTitle"),t)}),t.querySelector(".anid-reset-btn").addEventListener("click",()=>{this.resetAll(),y(n("resetAll"),t)}),t.querySelectorAll(".anid-category-header").forEach(e=>{e.addEventListener("click",()=>{let i=e.closest(".anid-category"),o=i.dataset.expanded==="true";i.dataset.expanded=o?"false":"true",e.setAttribute("aria-expanded",String(!o))})}),t.querySelectorAll("[data-toggle]").forEach(e=>{e.addEventListener("change",()=>{this.handleToggle(e.dataset.toggle,e.checked)})}),t.querySelectorAll("[data-action]").forEach(e=>{e.addEventListener("click",()=>{this.handleAction(e.dataset.action)})}),t.querySelectorAll("[data-slider]").forEach(e=>{e.addEventListener("input",()=>{this.handleSlider(e.dataset.slider,parseInt(e.value,10))})})}handleToggle(t,e){var a,r,h,d,l;if(t==="ttsHover"){e?(a=this.modules.tts)==null||a.enableHover():(r=this.modules.tts)==null||r.disableHover(),f(t,e),y(`${n(t)} ${e?n("on"):n("off")}`,this.shadowRoot);return}if(t==="ttsSelection"){e?(h=this.modules.tts)==null||h.enableSelection():(d=this.modules.tts)==null||d.disableSelection(),f(t,e),y(`${n(t)} ${e?n("on"):n("off")}`,this.shadowRoot);return}let i=Ht[t],o=i?this.modules[i]:null;if(o&&(e?o.enable():o.disable(),f(t,e)),t==="colorBlindSim"){let p=this.shadowRoot.querySelector('[data-sub="colorBlindSim"]');p&&(p.style.display=e?"":"none"),e||(l=this.modules.colorBlind)==null||l.disable()}y(`${n(t)} ${e?n("on"):n("off")}`,this.shadowRoot)}handleAction(t){var e,i,o,a,r,h,d,l,p,m;switch(t){case"fontIncrease":(e=this.modules.fontSize)==null||e.increase();break;case"fontDecrease":(i=this.modules.fontSize)==null||i.decrease();break;case"fontReset":(o=this.modules.fontSize)==null||o.reset();break;case"contrastDark":this.toggleContrast("dark");break;case"contrastLight":this.toggleContrast("light");break;case"contrastInvert":this.toggleContrast("invert");break;case"cbProtanopia":(a=this.modules.colorBlind)==null||a.setMode("protanopia");break;case"cbDeuteranopia":(r=this.modules.colorBlind)==null||r.setMode("deuteranopia");break;case"cbTritanopia":(h=this.modules.colorBlind)==null||h.setMode("tritanopia");break;case"toggleHeadings":this.toggleList("headings");break;case"toggleLandmarks":this.toggleList("landmarks");break;case"screenReaderPreview":(d=this.modules.screenReader)==null||d.toggle();break;case"ttsReadPage":(l=this.modules.tts)==null||l.readPage();break;case"accessibilityStatement":(p=this.modules.statement)==null||p.show();break;case"complianceBadge":(m=this.modules.badge)==null||m.show();break}}handleSlider(t,e){var i;t==="saturation"&&((i=this.modules.saturation)==null||i.setValue(e),f("saturation",e))}toggleContrast(t){var a;let i=it("contrast","none")===t?"none":t;(a=this.modules.contrast)==null||a.setMode(i),f("contrast",i),this.updateContrastButtons(i);let o=i==="none"?`${n("highContrast")} ${n("off")}`:`${n("highContrast")} ${n(i==="dark"?"contrastDark":i==="light"?"contrastLight":"contrastInvert")}`;y(o,this.shadowRoot)}updateContrastButtons(t){this.shadowRoot.querySelectorAll('[data-action^="contrast"]').forEach(e=>{let i=e.dataset.action.replace("contrast","").toLowerCase();e.classList.toggle("anid-active",i===t)})}toggleList(t){var o,a;let e=this.shadowRoot.querySelector(`[data-list="${t}"]`);if(!e)return;let i=e.style.display!=="none";e.style.display=i?"none":"",i||(t==="headings"?(o=this.modules.headings)==null||o.populateList(e):(a=this.modules.pageStructure)==null||a.populateList(e))}initModules(){let t={shadowRoot:this.shadowRoot,config:this.config,announce:e=>y(e,this.shadowRoot)};this.modules={fontSize:new E(t),contrast:new $(t),darkMode:new H(t),monochrome:new M(t),saturation:new P(t),spacing:new z(t),dyslexiaFont:new R(t),hideImages:new I(t),colorBlind:new B(t),keyboardNav:new D(t),focus:new O(t),headings:new N(t),pageStructure:new j(t),readingGuide:new q(t),lineMask:new G(t),cursor:new K(t),screenReader:new Y(t),links:new V(t),images:new F(t),animations:new U(t),muteSounds:new W(t),tts:new Q(t),statement:new X(t),badge:new J(t)}}restoreState(){var e,i,o,a,r,h,d;let t=ft();for(let[l,p]of Object.entries(Ht))if(l!=="colorBlindSim"&&t[l]){(e=this.modules[p])==null||e.enable();let m=this.shadowRoot.querySelector(`[data-toggle="${l}"]`);m&&(m.checked=!0)}if(t.ttsHover){(i=this.modules.tts)==null||i.enableHover();let l=this.shadowRoot.querySelector('[data-toggle="ttsHover"]');l&&(l.checked=!0)}if(t.ttsSelection){(o=this.modules.tts)==null||o.enableSelection();let l=this.shadowRoot.querySelector('[data-toggle="ttsSelection"]');l&&(l.checked=!0)}if(t.fontSize&&((a=this.modules.fontSize)==null||a.setLevel(t.fontSize)),t.contrast&&t.contrast!=="none"&&((r=this.modules.contrast)==null||r.setMode(t.contrast),this.updateContrastButtons(t.contrast)),t.saturation!==void 0&&t.saturation!==100){(h=this.modules.saturation)==null||h.setValue(t.saturation);let l=this.shadowRoot.querySelector('[data-slider="saturation"]');l&&(l.value=t.saturation)}if(t.colorBlindMode){(d=this.modules.colorBlind)==null||d.setMode(t.colorBlindMode);let l=this.shadowRoot.querySelector('[data-toggle="colorBlindSim"]');l&&(l.checked=!0);let p=this.shadowRoot.querySelector('[data-sub="colorBlindSim"]');p&&(p.style.display="")}}resetAll(){var t;for(let e of Object.values(this.modules))(t=e.disable)==null||t.call(e);mt(),f("lang",b()),this.rebuildPanel()}rebuildPanel(){this.panel.setAttribute("dir",tt()),this.panel.innerHTML=this.buildPanelHTML(),this.bindPanelEvents(),this.restoreState(),this.isOpen&&(this.updatePanelPosition(),this.panel.classList.add("anid-open")),this.trigger.setAttribute("aria-expanded",String(this.isOpen)),this.trigger.setAttribute("aria-label",this.isOpen?n("closePanel"):n("openPanel"))}toggle(){this.isOpen?this.close():this.open()}open(){var t;this.isOpen=!0,this.updatePanelPosition(),this.panel.classList.add("anid-open"),this.trigger.setAttribute("aria-expanded","true"),this.trigger.setAttribute("aria-label",n("closePanel")),(t=this.panel.querySelector(".anid-close-btn"))==null||t.focus()}close(){this.isOpen=!1,this.panel.classList.remove("anid-open"),this.trigger.setAttribute("aria-expanded","false"),this.trigger.setAttribute("aria-label",n("openPanel")),this.trigger.focus()}bindGlobalKeys(){let t={KeyD:()=>this._flipToggle("darkMode"),KeyF:e=>{var i,o;e.shiftKey?(i=this.modules.fontSize)==null||i.decrease():(o=this.modules.fontSize)==null||o.increase()},KeyK:()=>this._flipToggle("keyboardNav"),KeyG:()=>this._flipToggle("readingGuide"),KeyL:()=>this._flipToggle("linkHighlight"),KeyC:()=>this.toggleContrast("dark"),KeyM:()=>this._flipToggle("muteSounds"),KeyT:()=>{var e;return(e=this.modules.tts)==null?void 0:e.readPage()},KeyR:()=>this.resetAll()};this._keydownHandler=e=>{if(e.key==="Escape"&&this.isOpen){this.close();return}if(e.altKey&&e.code==="KeyA"){e.preventDefault(),this.toggle();return}if(e.altKey&&this.isOpen){let i=t[e.code];i&&(e.preventDefault(),i(e))}},document.addEventListener("keydown",this._keydownHandler)}_flipToggle(t){let e=this.shadowRoot.querySelector(`[data-toggle="${t}"]`);e&&(e.checked=!e.checked,this.handleToggle(t,e.checked))}_getBottomOffset(){let e=window.innerWidth<=768?this.config.mobileBottomOffset:this.config.bottomOffset,i=parseInt(e,10);return i>0?i:0}positionElement(t,e){let i=this._getBottomOffset(),o={"bottom-left":{bottom:`${20+i}px`,left:"20px"},"bottom-right":{bottom:`${20+i}px`,right:"20px"},"top-left":{top:"20px",left:"20px"},"top-right":{top:"20px",right:"20px"}};Object.assign(t.style,o[e]||o["bottom-left"])}positionPanel(t){let e=this._getBottomOffset(),i={"bottom-left":{bottom:`${88+e}px`,left:"20px"},"bottom-right":{bottom:`${88+e}px`,right:"20px"},"top-left":{top:"88px",left:"20px"},"top-right":{top:"88px",right:"20px"}};Object.assign(this.panel.style,i[t]||i["bottom-left"])}updatePanelPosition(){if(window.innerWidth<=768)return;let t=this.trigger.getBoundingClientRect(),e=window.innerHeight,i=window.innerWidth,o=12,a=Math.min(380,i-2*o),r=t.top,h=e-t.bottom,d=t.left;if(d+a>i-o&&(d=i-a-o),d<o&&(d=o),this.panel.style.left=`${d}px`,this.panel.style.right="auto",r>h){let l=e-t.top+o;this.panel.style.bottom=`${l}px`,this.panel.style.top="auto",this.panel.style.maxHeight=`${Math.max(200,r-2*o)}px`}else{let l=t.bottom+o;this.panel.style.top=`${l}px`,this.panel.style.bottom="auto",this.panel.style.maxHeight=`${Math.max(200,e-l-o)}px`}}clampTrigger(){let t=this.trigger.getBoundingClientRect(),e=window.innerWidth,i=window.innerHeight,o=this.trigger.offsetWidth,a=this.trigger.offsetHeight,r=this.trigger.style.top!==""&&this.trigger.style.top!=="auto",h=this.trigger.style.left!==""&&this.trigger.style.left!=="auto";if(r&&h){let d=t.left,l=t.top,p=Math.max(0,Math.min(d,e-o)),m=Math.max(0,Math.min(l,i-a));d!==p&&(this.trigger.style.left=`${p}px`),l!==m&&(this.trigger.style.top=`${m}px`)}else(t.right>e||t.left<0||t.bottom>i||t.top<0)&&(this.trigger.style.left=`${Math.max(0,Math.min(t.left,e-o))}px`,this.trigger.style.top=`${Math.max(0,Math.min(t.top,i-a))}px`,this.trigger.style.right="auto",this.trigger.style.bottom="auto")}bindViewportListeners(){let t;this._resizeHandler=()=>{clearTimeout(t),t=setTimeout(()=>{this.clampTrigger(),this.isOpen&&this.updatePanelPosition()},100)},window.addEventListener("resize",this._resizeHandler),window.addEventListener("orientationchange",this._resizeHandler)}makeDraggable(t){let e=!1,i,o,a,r,h=p=>{let m=p.touches?p.touches[0]:p;i=m.clientX,o=m.clientY;let w=t.getBoundingClientRect();a=w.left,r=w.top,e=!1,document.addEventListener("mousemove",d),document.addEventListener("mouseup",l),document.addEventListener("touchmove",d,{passive:!1}),document.addEventListener("touchend",l)},d=p=>{let m=p.touches?p.touches[0]:p,w=m.clientX-i,ct=m.clientY-o;if((Math.abs(w)>5||Math.abs(ct)>5)&&(e=!0),e){p.preventDefault();let Pt=window.innerWidth-t.offsetWidth,zt=window.innerHeight-t.offsetHeight;t.style.left=`${Math.max(0,Math.min(a+w,Pt))}px`,t.style.top=`${Math.max(0,Math.min(r+ct,zt))}px`,t.style.right="auto",t.style.bottom="auto"}},l=()=>{document.removeEventListener("mousemove",d),document.removeEventListener("mouseup",l),document.removeEventListener("touchmove",d),document.removeEventListener("touchend",l),e&&this.updatePanelPosition()};t.addEventListener("mousedown",h),t.addEventListener("touchstart",h,{passive:!0}),t.addEventListener("click",p=>{if(e){e=!1,p.stopPropagation();return}this.toggle()})}destroy(){var t,e;if(!this._destroyed){this._destroyed=!0;for(let i of Object.values(this.modules))(t=i.disable)==null||t.call(i);this._keydownHandler&&document.removeEventListener("keydown",this._keydownHandler),this._resizeHandler&&(window.removeEventListener("resize",this._resizeHandler),window.removeEventListener("orientationchange",this._resizeHandler)),(e=this.shadowHost)!=null&&e.parentNode&&this.shadowHost.parentNode.removeChild(this.shadowHost),this.modules={},this.shadowRoot=null,this.shadowHost=null,this.panel=null,this.trigger=null,A===this&&(A=null)}}};function Mt(s){A&&A.destroy(),s&&(window.OpenA11yConfig={...window.OpenA11yConfig,...s});let t=new dt;return t.init(),A=t,t}typeof document!="undefined"&&(document.readyState==="loading"?document.addEventListener("DOMContentLoaded",()=>Mt()):Mt());export{Mt as init};