stimeo-ui 0.16.0 → 0.18.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/CHANGELOG.md +136 -0
- package/README.md +27 -11
- package/dist/cable/index.d.ts +88 -31
- package/dist/cable/index.js +384 -449
- package/dist/cable/index.js.map +1 -1
- package/dist/coerce-JtZVNG5h.d.ts +20 -0
- package/dist/controllers/accordion_controller.d.ts +4 -2
- package/dist/controllers/accordion_controller.js +174 -55
- package/dist/controllers/accordion_controller.js.map +1 -1
- package/dist/controllers/alert_dialog_controller.d.ts +12 -2
- package/dist/controllers/alert_dialog_controller.js +903 -235
- package/dist/controllers/alert_dialog_controller.js.map +1 -1
- package/dist/controllers/announcer_controller.d.ts +37 -5
- package/dist/controllers/announcer_controller.js +238 -205
- package/dist/controllers/announcer_controller.js.map +1 -1
- package/dist/controllers/aspect_ratio_controller.js +0 -10
- package/dist/controllers/aspect_ratio_controller.js.map +1 -1
- package/dist/controllers/auto_submit_controller.d.ts +30 -6
- package/dist/controllers/auto_submit_controller.js +414 -145
- package/dist/controllers/auto_submit_controller.js.map +1 -1
- package/dist/controllers/avatar_controller.js +185 -107
- package/dist/controllers/avatar_controller.js.map +1 -1
- package/dist/controllers/breadcrumb_controller.js +0 -130
- package/dist/controllers/breadcrumb_controller.js.map +1 -1
- package/dist/controllers/bulk_select_controller.d.ts +21 -3
- package/dist/controllers/bulk_select_controller.js +282 -58
- package/dist/controllers/bulk_select_controller.js.map +1 -1
- package/dist/controllers/calendar_controller.d.ts +38 -16
- package/dist/controllers/calendar_controller.js +228 -260
- package/dist/controllers/calendar_controller.js.map +1 -1
- package/dist/controllers/carousel_controller.d.ts +43 -12
- package/dist/controllers/carousel_controller.js +536 -436
- package/dist/controllers/carousel_controller.js.map +1 -1
- package/dist/controllers/character_counter_controller.d.ts +44 -7
- package/dist/controllers/character_counter_controller.js +493 -207
- package/dist/controllers/character_counter_controller.js.map +1 -1
- package/dist/controllers/checkbox_controller.d.ts +7 -2
- package/dist/controllers/checkbox_controller.js +38 -74
- package/dist/controllers/checkbox_controller.js.map +1 -1
- package/dist/controllers/clipboard_controller.d.ts +16 -5
- package/dist/controllers/clipboard_controller.js +261 -149
- package/dist/controllers/clipboard_controller.js.map +1 -1
- package/dist/controllers/collapsible_controller.d.ts +17 -5
- package/dist/controllers/collapsible_controller.js +304 -120
- package/dist/controllers/collapsible_controller.js.map +1 -1
- package/dist/controllers/color_picker_controller.d.ts +18 -6
- package/dist/controllers/color_picker_controller.js +178 -146
- package/dist/controllers/color_picker_controller.js.map +1 -1
- package/dist/controllers/combobox_controller.d.ts +24 -6
- package/dist/controllers/combobox_controller.js +522 -156
- package/dist/controllers/combobox_controller.js.map +1 -1
- package/dist/controllers/command_palette_controller.d.ts +51 -20
- package/dist/controllers/command_palette_controller.js +1156 -395
- package/dist/controllers/command_palette_controller.js.map +1 -1
- package/dist/controllers/conditional_fields_controller.d.ts +15 -2
- package/dist/controllers/conditional_fields_controller.js +300 -171
- package/dist/controllers/conditional_fields_controller.js.map +1 -1
- package/dist/controllers/confirm_controller.d.ts +49 -12
- package/dist/controllers/confirm_controller.js +980 -262
- package/dist/controllers/confirm_controller.js.map +1 -1
- package/dist/controllers/context_menu_controller.d.ts +80 -18
- package/dist/controllers/context_menu_controller.js +346 -153
- package/dist/controllers/context_menu_controller.js.map +1 -1
- package/dist/controllers/count_up_controller.d.ts +13 -1
- package/dist/controllers/count_up_controller.js +73 -21
- package/dist/controllers/count_up_controller.js.map +1 -1
- package/dist/controllers/countdown_controller.d.ts +47 -3
- package/dist/controllers/countdown_controller.js +281 -158
- package/dist/controllers/countdown_controller.js.map +1 -1
- package/dist/controllers/currency_input_controller.d.ts +93 -10
- package/dist/controllers/currency_input_controller.js +575 -225
- package/dist/controllers/currency_input_controller.js.map +1 -1
- package/dist/controllers/data_grid_controller.d.ts +25 -12
- package/dist/controllers/data_grid_controller.js +248 -214
- package/dist/controllers/data_grid_controller.js.map +1 -1
- package/dist/controllers/date_range_picker_controller.d.ts +42 -14
- package/dist/controllers/date_range_picker_controller.js +338 -235
- package/dist/controllers/date_range_picker_controller.js.map +1 -1
- package/dist/controllers/dialog_controller.d.ts +17 -6
- package/dist/controllers/dialog_controller.js +899 -237
- package/dist/controllers/dialog_controller.js.map +1 -1
- package/dist/controllers/direct_upload_controller.d.ts +25 -8
- package/dist/controllers/direct_upload_controller.js +97 -167
- package/dist/controllers/direct_upload_controller.js.map +1 -1
- package/dist/controllers/dirty_form_controller.d.ts +6 -1
- package/dist/controllers/dirty_form_controller.js +72 -69
- package/dist/controllers/dirty_form_controller.js.map +1 -1
- package/dist/controllers/dismissible_controller.d.ts +19 -0
- package/dist/controllers/dismissible_controller.js +196 -24
- package/dist/controllers/dismissible_controller.js.map +1 -1
- package/dist/controllers/drawer_controller.d.ts +39 -11
- package/dist/controllers/drawer_controller.js +974 -355
- package/dist/controllers/drawer_controller.js.map +1 -1
- package/dist/controllers/dropdown_controller.d.ts +31 -1
- package/dist/controllers/dropdown_controller.js +339 -96
- package/dist/controllers/dropdown_controller.js.map +1 -1
- package/dist/controllers/editable_controller.d.ts +12 -1
- package/dist/controllers/editable_controller.js +315 -88
- package/dist/controllers/editable_controller.js.map +1 -1
- package/dist/controllers/empty_state_controller.js +79 -58
- package/dist/controllers/empty_state_controller.js.map +1 -1
- package/dist/controllers/file_dropzone_controller.d.ts +63 -18
- package/dist/controllers/file_dropzone_controller.js +322 -211
- package/dist/controllers/file_dropzone_controller.js.map +1 -1
- package/dist/controllers/filter_controller.js +77 -42
- package/dist/controllers/filter_controller.js.map +1 -1
- package/dist/controllers/flash_controller.d.ts +35 -12
- package/dist/controllers/flash_controller.js +238 -347
- package/dist/controllers/flash_controller.js.map +1 -1
- package/dist/controllers/focus_controller.d.ts +15 -6
- package/dist/controllers/focus_controller.js +679 -240
- package/dist/controllers/focus_controller.js.map +1 -1
- package/dist/controllers/form_field_controller.js +156 -132
- package/dist/controllers/form_field_controller.js.map +1 -1
- package/dist/controllers/form_validation_controller.d.ts +3 -3
- package/dist/controllers/form_validation_controller.js +31 -97
- package/dist/controllers/form_validation_controller.js.map +1 -1
- package/dist/controllers/frame_loading_controller.d.ts +47 -14
- package/dist/controllers/frame_loading_controller.js +275 -217
- package/dist/controllers/frame_loading_controller.js.map +1 -1
- package/dist/controllers/highlight_controller.d.ts +27 -6
- package/dist/controllers/highlight_controller.js +107 -75
- package/dist/controllers/highlight_controller.js.map +1 -1
- package/dist/controllers/hover_card_controller.d.ts +60 -4
- package/dist/controllers/hover_card_controller.js +327 -130
- package/dist/controllers/hover_card_controller.js.map +1 -1
- package/dist/controllers/idle_controller.d.ts +48 -6
- package/dist/controllers/idle_controller.js +271 -101
- package/dist/controllers/idle_controller.js.map +1 -1
- package/dist/controllers/input_mask_controller.d.ts +30 -13
- package/dist/controllers/input_mask_controller.js +483 -97
- package/dist/controllers/input_mask_controller.js.map +1 -1
- package/dist/controllers/intersection_controller.d.ts +32 -13
- package/dist/controllers/intersection_controller.js +150 -106
- package/dist/controllers/intersection_controller.js.map +1 -1
- package/dist/controllers/lazy_frame_controller.d.ts +19 -2
- package/dist/controllers/lazy_frame_controller.js +24 -68
- package/dist/controllers/lazy_frame_controller.js.map +1 -1
- package/dist/controllers/listbox_controller.d.ts +44 -9
- package/dist/controllers/listbox_controller.js +523 -240
- package/dist/controllers/listbox_controller.js.map +1 -1
- package/dist/controllers/local_time_controller.d.ts +9 -7
- package/dist/controllers/local_time_controller.js +102 -77
- package/dist/controllers/local_time_controller.js.map +1 -1
- package/dist/controllers/masonry_controller.d.ts +11 -3
- package/dist/controllers/masonry_controller.js +80 -96
- package/dist/controllers/masonry_controller.js.map +1 -1
- package/dist/controllers/menu_controller.d.ts +55 -11
- package/dist/controllers/menu_controller.js +302 -188
- package/dist/controllers/menu_controller.js.map +1 -1
- package/dist/controllers/menubar_controller.d.ts +51 -9
- package/dist/controllers/menubar_controller.js +232 -345
- package/dist/controllers/menubar_controller.js.map +1 -1
- package/dist/controllers/meter_controller.d.ts +33 -20
- package/dist/controllers/meter_controller.js +417 -87
- package/dist/controllers/meter_controller.js.map +1 -1
- package/dist/controllers/multi_select_controller.d.ts +48 -18
- package/dist/controllers/multi_select_controller.js +785 -393
- package/dist/controllers/multi_select_controller.js.map +1 -1
- package/dist/controllers/navigation_menu_controller.d.ts +27 -6
- package/dist/controllers/navigation_menu_controller.js +190 -250
- package/dist/controllers/navigation_menu_controller.js.map +1 -1
- package/dist/controllers/nested_form_controller.d.ts +10 -0
- package/dist/controllers/nested_form_controller.js +396 -192
- package/dist/controllers/nested_form_controller.js.map +1 -1
- package/dist/controllers/network_status_controller.d.ts +23 -0
- package/dist/controllers/network_status_controller.js +268 -62
- package/dist/controllers/network_status_controller.js.map +1 -1
- package/dist/controllers/number_input_controller.d.ts +50 -8
- package/dist/controllers/number_input_controller.js +610 -303
- package/dist/controllers/number_input_controller.js.map +1 -1
- package/dist/controllers/optimistic_controller.d.ts +8 -5
- package/dist/controllers/optimistic_controller.js +45 -87
- package/dist/controllers/optimistic_controller.js.map +1 -1
- package/dist/controllers/otp_controller.d.ts +55 -8
- package/dist/controllers/otp_controller.js +658 -255
- package/dist/controllers/otp_controller.js.map +1 -1
- package/dist/controllers/overflow_indicator_controller.d.ts +5 -0
- package/dist/controllers/overflow_indicator_controller.js +122 -113
- package/dist/controllers/overflow_indicator_controller.js.map +1 -1
- package/dist/controllers/overflow_menu_controller.d.ts +58 -20
- package/dist/controllers/overflow_menu_controller.js +470 -295
- package/dist/controllers/overflow_menu_controller.js.map +1 -1
- package/dist/controllers/pagination_controller.d.ts +37 -7
- package/dist/controllers/pagination_controller.js +332 -123
- package/dist/controllers/pagination_controller.js.map +1 -1
- package/dist/controllers/password_reveal_controller.d.ts +46 -8
- package/dist/controllers/password_reveal_controller.js +392 -121
- package/dist/controllers/password_reveal_controller.js.map +1 -1
- package/dist/controllers/password_strength_controller.d.ts +15 -6
- package/dist/controllers/password_strength_controller.js +111 -158
- package/dist/controllers/password_strength_controller.js.map +1 -1
- package/dist/controllers/persist_controller.d.ts +11 -4
- package/dist/controllers/persist_controller.js +165 -111
- package/dist/controllers/persist_controller.js.map +1 -1
- package/dist/controllers/pointer_drag_controller.d.ts +35 -12
- package/dist/controllers/pointer_drag_controller.js +434 -188
- package/dist/controllers/pointer_drag_controller.js.map +1 -1
- package/dist/controllers/popover_controller.d.ts +41 -5
- package/dist/controllers/popover_controller.js +269 -113
- package/dist/controllers/popover_controller.js.map +1 -1
- package/dist/controllers/portal_controller.d.ts +44 -4
- package/dist/controllers/portal_controller.js +215 -76
- package/dist/controllers/portal_controller.js.map +1 -1
- package/dist/controllers/preview_guard_controller.d.ts +10 -4
- package/dist/controllers/preview_guard_controller.js +243 -116
- package/dist/controllers/preview_guard_controller.js.map +1 -1
- package/dist/controllers/progress_controller.d.ts +20 -19
- package/dist/controllers/progress_controller.js +391 -78
- package/dist/controllers/progress_controller.js.map +1 -1
- package/dist/controllers/radio_group_controller.d.ts +21 -9
- package/dist/controllers/radio_group_controller.js +278 -211
- package/dist/controllers/radio_group_controller.js.map +1 -1
- package/dist/controllers/range_slider_controller.d.ts +47 -6
- package/dist/controllers/range_slider_controller.js +220 -113
- package/dist/controllers/range_slider_controller.js.map +1 -1
- package/dist/controllers/rating_controller.d.ts +20 -4
- package/dist/controllers/rating_controller.js +458 -211
- package/dist/controllers/rating_controller.js.map +1 -1
- package/dist/controllers/read_more_controller.d.ts +2 -0
- package/dist/controllers/read_more_controller.js +138 -63
- package/dist/controllers/read_more_controller.js.map +1 -1
- package/dist/controllers/reading_progress_controller.d.ts +1 -1
- package/dist/controllers/reading_progress_controller.js +166 -137
- package/dist/controllers/reading_progress_controller.js.map +1 -1
- package/dist/controllers/relative_time_controller.d.ts +20 -6
- package/dist/controllers/relative_time_controller.js +211 -112
- package/dist/controllers/relative_time_controller.js.map +1 -1
- package/dist/controllers/reset_on_restore_controller.d.ts +85 -0
- package/dist/controllers/{reset_before_cache_controller.js → reset_on_restore_controller.js} +103 -38
- package/dist/controllers/reset_on_restore_controller.js.map +1 -0
- package/dist/controllers/resizable_controller.d.ts +31 -2
- package/dist/controllers/resizable_controller.js +299 -150
- package/dist/controllers/resizable_controller.js.map +1 -1
- package/dist/controllers/roving_controller.d.ts +3 -3
- package/dist/controllers/roving_controller.js +49 -88
- package/dist/controllers/roving_controller.js.map +1 -1
- package/dist/controllers/scroll_area_controller.d.ts +7 -3
- package/dist/controllers/scroll_area_controller.js +490 -246
- package/dist/controllers/scroll_area_controller.js.map +1 -1
- package/dist/controllers/scroll_restore_controller.d.ts +3 -3
- package/dist/controllers/scroll_restore_controller.js +14 -55
- package/dist/controllers/scroll_restore_controller.js.map +1 -1
- package/dist/controllers/scroll_visibility_controller.d.ts +28 -12
- package/dist/controllers/scroll_visibility_controller.js +432 -149
- package/dist/controllers/scroll_visibility_controller.js.map +1 -1
- package/dist/controllers/scrollspy_controller.d.ts +6 -1
- package/dist/controllers/scrollspy_controller.js +193 -248
- package/dist/controllers/scrollspy_controller.js.map +1 -1
- package/dist/controllers/separator_controller.d.ts +20 -5
- package/dist/controllers/separator_controller.js +285 -142
- package/dist/controllers/separator_controller.js.map +1 -1
- package/dist/controllers/sidebar_controller.d.ts +65 -8
- package/dist/controllers/sidebar_controller.js +1069 -404
- package/dist/controllers/sidebar_controller.js.map +1 -1
- package/dist/controllers/skeleton_controller.d.ts +23 -0
- package/dist/controllers/skeleton_controller.js +259 -101
- package/dist/controllers/skeleton_controller.js.map +1 -1
- package/dist/controllers/slider_controller.d.ts +29 -2
- package/dist/controllers/slider_controller.js +187 -86
- package/dist/controllers/slider_controller.js.map +1 -1
- package/dist/controllers/smart_sticky_header_controller.d.ts +22 -4
- package/dist/controllers/smart_sticky_header_controller.js +173 -66
- package/dist/controllers/smart_sticky_header_controller.js.map +1 -1
- package/dist/controllers/sortable_controller.d.ts +4 -4
- package/dist/controllers/sortable_controller.js +26 -125
- package/dist/controllers/sortable_controller.js.map +1 -1
- package/dist/controllers/spinner_controller.d.ts +39 -4
- package/dist/controllers/spinner_controller.js +288 -173
- package/dist/controllers/spinner_controller.js.map +1 -1
- package/dist/controllers/step_indicator_controller.d.ts +9 -4
- package/dist/controllers/step_indicator_controller.js +105 -46
- package/dist/controllers/step_indicator_controller.js.map +1 -1
- package/dist/controllers/stepper_controller.d.ts +14 -6
- package/dist/controllers/stepper_controller.js +120 -73
- package/dist/controllers/stepper_controller.js.map +1 -1
- package/dist/controllers/stick_to_bottom_controller.d.ts +9 -1
- package/dist/controllers/stick_to_bottom_controller.js +275 -140
- package/dist/controllers/stick_to_bottom_controller.js.map +1 -1
- package/dist/controllers/sticky_observer_controller.d.ts +11 -0
- package/dist/controllers/sticky_observer_controller.js +220 -49
- package/dist/controllers/sticky_observer_controller.js.map +1 -1
- package/dist/controllers/submit_once_controller.d.ts +24 -8
- package/dist/controllers/submit_once_controller.js +376 -227
- package/dist/controllers/submit_once_controller.js.map +1 -1
- package/dist/controllers/switch_controller.d.ts +18 -4
- package/dist/controllers/switch_controller.js +201 -84
- package/dist/controllers/switch_controller.js.map +1 -1
- package/dist/controllers/tabs_controller.d.ts +9 -6
- package/dist/controllers/tabs_controller.js +41 -30
- package/dist/controllers/tabs_controller.js.map +1 -1
- package/dist/controllers/tags_input_controller.d.ts +16 -3
- package/dist/controllers/tags_input_controller.js +293 -173
- package/dist/controllers/tags_input_controller.js.map +1 -1
- package/dist/controllers/textarea_autosize_controller.d.ts +11 -1
- package/dist/controllers/textarea_autosize_controller.js +108 -74
- package/dist/controllers/textarea_autosize_controller.js.map +1 -1
- package/dist/controllers/theme_controller.d.ts +24 -11
- package/dist/controllers/theme_controller.js +140 -116
- package/dist/controllers/theme_controller.js.map +1 -1
- package/dist/controllers/time_picker_controller.d.ts +55 -5
- package/dist/controllers/time_picker_controller.js +331 -127
- package/dist/controllers/time_picker_controller.js.map +1 -1
- package/dist/controllers/toast_controller.d.ts +40 -16
- package/dist/controllers/toast_controller.js +244 -324
- package/dist/controllers/toast_controller.js.map +1 -1
- package/dist/controllers/toggle_group_controller.d.ts +14 -6
- package/dist/controllers/toggle_group_controller.js +252 -191
- package/dist/controllers/toggle_group_controller.js.map +1 -1
- package/dist/controllers/toolbar_controller.d.ts +8 -6
- package/dist/controllers/toolbar_controller.js +219 -120
- package/dist/controllers/toolbar_controller.js.map +1 -1
- package/dist/controllers/tooltip_controller.d.ts +49 -4
- package/dist/controllers/tooltip_controller.js +158 -124
- package/dist/controllers/tooltip_controller.js.map +1 -1
- package/dist/controllers/transition_controller.d.ts +22 -4
- package/dist/controllers/transition_controller.js +123 -119
- package/dist/controllers/transition_controller.js.map +1 -1
- package/dist/controllers/tree_view_controller.d.ts +22 -12
- package/dist/controllers/tree_view_controller.js +283 -369
- package/dist/controllers/tree_view_controller.js.map +1 -1
- package/dist/index.d.ts +10 -5
- package/dist/index.js +8573 -10410
- package/dist/index.js.map +1 -1
- package/dist/inspector/cli.d.ts +38 -14
- package/dist/inspector/cli.js +108 -40
- package/dist/inspector/cli.js.map +1 -1
- package/dist/inspector/cli_bin.js +145 -64
- package/dist/inspector/cli_bin.js.map +1 -1
- package/dist/inspector/examples.json +20 -20
- package/dist/inspector/manifest.json +802 -101
- package/dist/positioning/index.d.ts +15 -7
- package/dist/positioning/index.js +154 -47
- package/dist/positioning/index.js.map +1 -1
- package/package.json +11 -10
- package/dist/controllers/reset_before_cache_controller.d.ts +0 -76
- package/dist/controllers/reset_before_cache_controller.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/attribute_lease.ts","../../src/utils/before_cache_reset.ts","../../src/utils/focus_candidate.ts","../../src/utils/frame_coalescer.ts","../../src/utils/layout_observer.ts","../../src/utils/logical_scroll.ts","../../src/utils/microtask_coalescer.ts","../../src/utils/style_property_lease.ts","../../src/utils/tabindex_loan.ts","../../src/controllers/scroll_area_controller.ts"],"names":[],"mappings":";;;;;AAwBO,IAAM,iBAAN,MAAkD;AAAA,EAC9C,UAAA;AAAA,EACA,QAAA,uBAAe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A,IAAS,IAAA,CAAK,MAAA,KAAW,KAAA,EAAO;AACrC,IAAA,IAAA,CAAK,YAAA,EAAa;AAClB,IAAA,IAAA,CAAK,MAAA,GAAS,KAAA;AACd,IAAA,KAAA,CAAM,gBAAA,CAAiB,aAAA,EAAe,IAAA,CAAK,eAAe,CAAA;AAC1D,IAAA,KAAA,CAAM,gBAAA,CAAiB,cAAA,EAAgB,IAAA,CAAK,eAAe,CAAA;AAAA,EAC7D;AAAA;AAAA,EAGA,YAAA,GAAqB;AACnB,IAAA,IAAA,CAAK,MAAA,EAAQ,mBAAA,CAAoB,aAAA,EAAe,IAAA,CAAK,eAAe,CAAA;AACpE,IAAA,IAAA,CAAK,MAAA,EAAQ,mBAAA,CAAoB,cAAA,EAAgB,IAAA,CAAK,eAAe,CAAA;AACrE,IAAA,IAAA,CAAK,MAAA,GAAS,IAAA;AAAA,EAChB;AAAA;AAAA,EAGA,eAAA,GAAwB;AACtB,IAAA,IAAA,CAAK,QAAQ,MAAA,EAAO;AACpB,IAAA,IAAA,CAAK,QAAQ,MAAA,EAAO;AACpB,IAAA,IAAI,IAAA,CAAK,SAAA,EAAW,IAAA,CAAK,eAAA,CAAgB,KAAK,SAAS,CAAA;AACvD,IAAA,IAAA,CAAK,QAAQ,UAAA,EAAW;AACxB,IAAA,IAAA,CAAK,YAAA,EAAa;AAClB,IAAA,IAAA,CAAK,eAAA,EAAgB;AAAA,EACvB;AACF","file":"scroll_area_controller.js","sourcesContent":["/** One temporarily controlled attribute value and the authored value it displaced. */\ninterface AttributeLeaseRecord {\n readonly original: string | null;\n written: string | null;\n}\n\n/**\n * Temporarily controls one attribute across a changing set of elements.\n *\n * The first write remembers the authored value, including the distinction between\n * an absent attribute and an authored empty string. Returning a lease restores that\n * value only while the attribute still matches the controller's last write. If a\n * consumer changed it in the meantime, the consumer owns the new value and teardown\n * leaves it alone.\n *\n * A `null` write deliberately removes the attribute while retaining the lease. This\n * is useful for derived ARIA whose valid absence is itself controller state, such as\n * an unbounded `aria-valuemin` or a blank spinbutton's `aria-valuenow`.\n *\n * The lease has no lifecycle of its own, so it never subscribes to document events.\n * A consumer that must not let a derived value become the authored baseline of a\n * cached page returns its leases from its own `turbo:before-cache` rewind, where the\n * matching `disconnect()` also releases the subscription.\n */\nexport class AttributeLease<T extends Element = Element> {\n readonly #attribute: string;\n readonly #records = new Map<T, AttributeLeaseRecord>();\n\n /** @param attribute - The attribute whose temporary values this lease owns. */\n constructor(attribute: string) {\n this.#attribute = attribute;\n }\n\n /** Writes or removes the leased attribute while preserving its authored value. */\n write(element: T, value: string | null): void {\n const existing = this.#records.get(element);\n if (existing) {\n existing.written = value;\n } else {\n this.#records.set(element, {\n original: element.getAttribute(this.#attribute),\n written: value,\n });\n }\n\n this.#reflect(element, value);\n }\n\n /** Returns one lease without overwriting a value subsequently authored by a consumer. */\n return(element: T): void {\n const record = this.#records.get(element);\n if (!record) return;\n this.#records.delete(element);\n const stillOwned = element.getAttribute(this.#attribute) === record.written;\n if (stillOwned) this.#reflect(element, record.original);\n }\n\n /** Reflects only a real value transition, avoiding self-triggered mutation work. */\n #reflect(element: T, value: string | null): void {\n if (element.getAttribute(this.#attribute) === value) return;\n if (value === null) element.removeAttribute(this.#attribute);\n else element.setAttribute(this.#attribute, value);\n }\n\n /** Returns every outstanding lease using the same ownership check as {@link return}. */\n returnAll(): void {\n for (const element of Array.from(this.#records.keys())) this.return(element);\n }\n}\n","/**\n * Runs a controller's \"return to the initial state\" pass just before Turbo\n * caches the page.\n *\n * **`disconnect()` cannot do this job, for two independent reasons.** Turbo\n * queues the clone from this event rather than taking it here, and the body swap\n * that runs the controller's `disconnect()` is queued separately — so which of\n * the two lands first is not something a controller can rely on, and a rewind\n * written in `disconnect()` may reach only the DOM being thrown away. In the\n * other direction, `disconnect()` also fires on an in-page move (Stimulus tears\n * down and reconnects the same element), where rewinding would wipe a\n * legitimately in-progress interaction — a spinner mid-load would vanish. One\n * timing is unreliable, the other is too eager; `turbo:before-cache` is the only\n * point that is exactly \"the page is about to be frozen\".\n *\n * Scope is the subscription only: registering on `activate()`, unregistering on\n * `deactivate()`, and one shared document listener no matter how many instances\n * are live. *What* to return to its initial state — which `data-state`, which\n * `hidden`, which `aria-busy` — stays in the controller, because no two\n * consumers answer it the same way.\n *\n * **Rewind state, not appearance.** The pass writes attributes the controller\n * itself owns; the visual result of those attributes is the consumer's CSS, and\n * a library that reached for style or class names would be guessing at markup\n * it does not own.\n *\n * Both entry points are idempotent, so the lifecycle hooks can call them\n * unconditionally: a second `activate()` does not double-subscribe and does not\n * make the callback run twice, and `deactivate()` on an instance that never\n * subscribed is a no-op.\n *\n * This file's own doc block is dropped from `dist`, but every member comment is\n * inlined into each consumer entry (`tsup` builds with `splitting: false`), so\n * rationale belongs here and only the contract belongs on the members.\n *\n * @example\n * ```ts\n * readonly #beforeCache = new BeforeCacheReset(() => this.#rewind());\n *\n * connect() { this.#beforeCache.activate(); }\n * disconnect() { this.#beforeCache.deactivate(); }\n * ```\n */\nexport class BeforeCacheReset {\n /** Every subscribed instance, iterated by the one shared document listener. */\n static readonly #subscribers = new Set<BeforeCacheReset>();\n\n /** The shared listener; installed while at least one instance is subscribed. */\n static readonly #onBeforeCache = (): void => {\n for (const subscriber of BeforeCacheReset.#subscribers) subscriber.#rewind();\n };\n\n readonly #rewind: () => void;\n\n /** @param rewind - the pass that returns this controller's state to its initial form. */\n constructor(rewind: () => void) {\n this.#rewind = rewind;\n }\n\n /** Subscribes to `turbo:before-cache`; call from `connect()`. Idempotent. */\n activate(): void {\n const first = BeforeCacheReset.#subscribers.size === 0;\n BeforeCacheReset.#subscribers.add(this);\n if (first) {\n document.addEventListener(\"turbo:before-cache\", BeforeCacheReset.#onBeforeCache);\n }\n }\n\n /** Unsubscribes; call from `disconnect()`. Safe when never subscribed. */\n deactivate(): void {\n BeforeCacheReset.#subscribers.delete(this);\n if (BeforeCacheReset.#subscribers.size > 0) return;\n document.removeEventListener(\"turbo:before-cache\", BeforeCacheReset.#onBeforeCache);\n }\n}\n","/**\n * Whether a disabled `<fieldset>` ancestor actually reaches `control`.\n *\n * HTML exempts the contents of a fieldset's **first direct-child `<legend>`**, and\n * the exemption is per fieldset — a control legal in one legend can still be\n * disabled by a second, outer fieldset, so the walk continues upward.\n *\n * Exported on its own for callers that need the disabled-inheritance rule without\n * the rest of {@link canTakeFocus} — a control's availability check, or a `hidden`\n * walk bounded at a widget root, which is a different rule to compose with.\n */\nexport function inheritsFieldsetDisabled(control: HTMLElement): boolean {\n let fieldset: Element | null = control.closest(\"fieldset[disabled]\");\n while (fieldset) {\n const legend = Array.from(fieldset.children).find((child) => child.tagName === \"LEGEND\");\n if (!legend?.contains(control)) return true;\n fieldset = fieldset.parentElement?.closest(\"fieldset[disabled]\") ?? null;\n }\n return false;\n}\n\n/**\n * Whether an element can actually take focus, checked **before** `focus()` runs.\n *\n * A controller that must move focus off a control it is about to disable or hide\n * picks a destination and calls `focus()` on it. If that destination cannot take\n * focus, the call **fails silently**: `hidden` and natively `disabled` elements\n * swallow it, so the caret stays in the subtree that is disappearing and lands on\n * `<body>` a frame later — the exact outcome the rescue exists to prevent, minus\n * any signal that it happened.\n *\n * Testing after the fact is the obvious alternative and is deliberately not the\n * rule. Reading `document.activeElement` back only works in a real browser, and\n * looping over candidates that way performs a real focus move per failure —\n * observable to assistive technology. Checking first costs nothing and catches\n * the cases that actually occur.\n *\n * **`aria-disabled` is not disqualifying.** It is the attribute an author uses\n * for a control that must stay *discoverable*, and the roving contract keeps\n * such items reachable. Only the four conditions that make the platform refuse\n * focus are checked: `hidden` / `inert` (an ancestor's counts),\n * `input[type=\"hidden\"]`, the native `disabled` property, and `disabled`\n * inherited from an ancestor `fieldset`. CSS-only invisibility is handled by\n * {@link isRenderedForFocus} when a consumer needs sequential-focus semantics.\n *\n * Reading `:disabled` instead of walking the fieldset chain would be shorter, but\n * that pseudo-class is not evaluated consistently outside real browsers and this\n * has to be right headlessly too. happy-dom in particular focuses a `<button>`\n * inside a disabled fieldset where a real engine refuses, so the inheritance is\n * spelled out rather than delegated.\n *\n * What a consumer does when nothing survives is its own call: some fall back to\n * their landmark, while a widget whose caret already sits somewhere legitimate\n * refuses the move outright rather than relocating it.\n *\n * @example\n * ```ts\n * const target = candidates.find(canTakeFocus);\n * if (target) target.focus();\n * else {\n * this.#tabindex.lend(this.element); // nothing left: fall back to the landmark\n * this.element.focus();\n * }\n * ```\n *\n * @param element - the candidate destination\n */\nexport function canTakeFocus(element: HTMLElement): boolean {\n if (element.closest(\"[hidden], [inert]\")) return false;\n if (element instanceof HTMLInputElement && element.type === \"hidden\") return false;\n if (!(\"disabled\" in element)) return true;\n if ((element as HTMLElement & { disabled: boolean }).disabled) return false;\n return !inheritsFieldsetDisabled(element);\n}\n\n/** Elements whose semantics or authored attributes can place them in sequential focus order. */\nexport const TAB_STOP_CANDIDATE_SELECTOR = [\n \"a[href]\",\n \"area[href]\",\n \"button\",\n \"input\",\n \"select\",\n \"textarea\",\n \"summary\",\n \"iframe\",\n \"audio[controls]\",\n \"video[controls]\",\n \"[tabindex]\",\n \"[contenteditable]\",\n].join(\",\");\n\n/** Optional browser visibility API used to exclude CSS-hidden candidates. */\ninterface VisibilityCheckable {\n checkVisibility?: (options?: { visibilityProperty?: boolean }) => boolean;\n}\n\n/** Whether CSS visibility allows an otherwise eligible element to participate in focus order. */\nexport function isRenderedForFocus(element: HTMLElement): boolean {\n const check = (element as HTMLElement & VisibilityCheckable).checkVisibility;\n return typeof check === \"function\" ? check.call(element, { visibilityProperty: true }) : true;\n}\n\n/** Parses an authored `tabindex`; invalid syntax has no explicit focus-order meaning. */\nfunction authoredTabindex(element: HTMLElement): number | null {\n const value = element.getAttribute(\"tabindex\");\n if (value === null || !/^[+-]?\\d+$/.test(value.trim())) return null;\n return Number(value);\n}\n\n/** Whether the element's native semantics place it in sequential focus order. */\nfunction hasNativeTabStop(element: HTMLElement): boolean {\n if (element instanceof HTMLAnchorElement || element instanceof HTMLAreaElement) {\n return element.hasAttribute(\"href\");\n }\n if (\n element instanceof HTMLButtonElement ||\n element instanceof HTMLSelectElement ||\n element instanceof HTMLTextAreaElement\n ) {\n return true;\n }\n if (element instanceof HTMLInputElement) return element.type !== \"hidden\";\n if (element instanceof HTMLIFrameElement) return true;\n if (element.tagName === \"AUDIO\" || element.tagName === \"VIDEO\") {\n return element.hasAttribute(\"controls\");\n }\n if (element instanceof HTMLElement && element.tagName === \"SUMMARY\") {\n const details = element.parentElement;\n return (\n details instanceof HTMLDetailsElement &&\n Array.from(details.children).find((child) => child.tagName === \"SUMMARY\") === element\n );\n }\n return false;\n}\n\n/** Whether an explicit `contenteditable` value creates an editable tab stop. */\nfunction hasEditableTabStop(element: HTMLElement): boolean {\n const value = element.getAttribute(\"contenteditable\")?.toLowerCase();\n return value === \"\" || value === \"true\" || value === \"plaintext-only\";\n}\n\n/**\n * Whether an element is a usable sequential Tab stop right now.\n *\n * Native semantics, authored `tabindex`, editable hosts, inherited disabled state,\n * HTML `hidden`/`inert`, and CSS visibility are evaluated together. `aria-disabled`\n * remains focusable because it communicates unavailability without removing the\n * control from discovery order.\n */\nexport function isTabStop(element: HTMLElement): boolean {\n if (!canTakeFocus(element) || !isRenderedForFocus(element)) return false;\n\n const tabindex = authoredTabindex(element);\n if (tabindex !== null) return tabindex >= 0;\n return hasNativeTabStop(element) || hasEditableTabStop(element);\n}\n\n/** Returns every usable sequential Tab stop below `root` in document order. */\nexport function tabStopsWithin(root: ParentNode): HTMLElement[] {\n return Array.from(root.querySelectorAll<HTMLElement>(TAB_STOP_CANDIDATE_SELECTOR)).filter(\n isTabStop,\n );\n}\n\n/** Returns the first usable sequential Tab stop below `root`, if one exists. */\nexport function firstTabStop(root: ParentNode): HTMLElement | null {\n for (const candidate of root.querySelectorAll<HTMLElement>(TAB_STOP_CANDIDATE_SELECTOR)) {\n if (isTabStop(candidate)) return candidate;\n }\n return null;\n}\n\n/** Whether `root` contains at least one usable sequential Tab stop. */\nexport function hasTabStop(root: ParentNode): boolean {\n return firstTabStop(root) !== null;\n}\n","/**\n * Runs one piece of scroll-driven work per animation frame.\n *\n * A `scroll` listener fires many times between two paints, and each firing would\n * measure the same layout. Requesting a frame on the first firing and ignoring\n * the rest until it runs keeps the reads to one per frame; running on the frame\n * — rather than on a timer — keeps the measurement in step with what the reader\n * sees.\n *\n * **The first request of a burst wins.** Work handed in while a frame is already\n * pending is dropped, so a caller that queues a special first pass and then\n * receives scrolls gets that first pass, not the last scroll's.\n *\n * Cancelling drops the pending frame outright, and does nothing at all when none\n * is pending. A frame really is cancelled, so nothing needs a generation to tell\n * a stale callback from a fresh one, and nothing has to be refused before the\n * caller starts listening.\n *\n * Scope is the scheduling only. What to measure stays with the caller.\n *\n * @example\n * ```ts\n * readonly #frames = new FrameCoalescer();\n *\n * readonly #onScroll = (): void => this.#frames.schedule(() => this.#measure());\n *\n * disconnect(): void {\n * this.#frames.cancel();\n * }\n * ```\n */\nexport class FrameCoalescer {\n #frame: number | null = null;\n\n /**\n * Runs `run` on the next frame, unless a frame is already pending — the first\n * request of a burst wins and the rest are dropped. The pending frame is\n * released before `run`, so `run` may request the next one.\n */\n schedule(run: () => void): void {\n if (this.#frame !== null) return;\n this.#frame = requestAnimationFrame(() => {\n this.#frame = null;\n run();\n });\n }\n\n /**\n * Drops the pending frame, and reaches the platform only when there is one.\n *\n * There is no handle value that stands for \"nothing pending\":\n * `cancelAnimationFrame` takes an `unsigned long`, so a negative placeholder\n * arrives as a large positive number that the same allocator can hand out, and\n * an idle cancel would then drop a frame belonging to someone else.\n */\n cancel(): void {\n if (this.#frame === null) return;\n cancelAnimationFrame(this.#frame);\n this.#frame = null;\n }\n}\n","/**\n * Unified layout observation for Stimeo controllers.\n *\n * Widgets whose output is measured — an overflow boundary, a masonry column count,\n * an autosized textarea — have three sources that move the layout under them: their\n * *own* box changing — via {@link ResizeObserver} — the *viewport* changing — via the\n * `window` `resize` event — and a descendant *resource settling*, because an image or\n * a frame reports a height of zero until it has loaded. Wiring those three by hand in\n * every controller risks leaked listeners on `disconnect()`. {@link LayoutObserver}\n * owns all three behind one callback and one\n * {@link LayoutObserver.disconnect | disconnect()} that releases everything.\n *\n * Behavior only: the helper reports *that* layout changed; it never reads or\n * writes styles. Consumers decide what to recompute.\n */\n\n/** Invoked whenever an observed element or the viewport changes size. */\nexport type LayoutCallback = () => void;\n\n/** Constructs a {@link ResizeObserver}; injectable so tests stay deterministic. */\nexport type ResizeObserverFactory = (callback: ResizeObserverCallback) => ResizeObserver;\n\n/** Options for {@link LayoutObserver}. */\nexport interface LayoutObserverOptions {\n /**\n * Factory for the {@link ResizeObserver} used by {@link LayoutObserver.observe}.\n * Defaults to the global constructor; override it in tests, or to no-op in\n * environments where `ResizeObserver` is unavailable.\n */\n resizeObserverFactory?: ResizeObserverFactory;\n}\n\n/**\n * Observes element resizes and/or viewport resizes through a single callback,\n * with guaranteed teardown.\n *\n * @example\n * ```ts\n * #layout = new LayoutObserver(() => this.#reposition());\n *\n * connect() {\n * this.#layout.observe(this.panelTarget);\n * this.#layout.observeViewport();\n * this.#layout.observeDescendantLoads(this.panelTarget);\n * }\n *\n * disconnect() {\n * this.#layout.disconnect();\n * }\n * ```\n */\nexport class LayoutObserver {\n readonly #callback: LayoutCallback;\n readonly #resizeObserverFactory: ResizeObserverFactory | null;\n #resizeObserver: ResizeObserver | null = null;\n #observingViewport = false;\n #loadContainer: Element | null = null;\n\n /** Stable bound handler so add/removeEventListener target the same reference. */\n readonly #handleViewportResize = (): void => {\n this.#callback();\n };\n\n /** Stable bound handler for the capture-phase `load`; see {@link observeDescendantLoads}. */\n readonly #handleDescendantLoad = (): void => {\n this.#callback();\n };\n\n constructor(callback: LayoutCallback, options: LayoutObserverOptions = {}) {\n this.#callback = callback;\n this.#resizeObserverFactory =\n options.resizeObserverFactory ??\n (typeof ResizeObserver === \"undefined\" ? null : (cb) => new ResizeObserver(cb));\n }\n\n /**\n * Starts observing an element's size. Repeated calls observe additional\n * elements through the same shared observer. No-ops when no\n * `ResizeObserver` implementation is available.\n */\n observe(element: Element): void {\n if (!this.#resizeObserverFactory) return;\n if (!this.#resizeObserver) {\n this.#resizeObserver = this.#resizeObserverFactory(() => {\n this.#callback();\n });\n }\n this.#resizeObserver.observe(element);\n }\n\n /** Stops observing a single element while leaving any others in place. */\n unobserve(element: Element): void {\n this.#resizeObserver?.unobserve(element);\n }\n\n /** Starts observing viewport resizes. Idempotent: the listener is added once. */\n observeViewport(): void {\n if (this.#observingViewport) return;\n this.#observingViewport = true;\n window.addEventListener(\"resize\", this.#handleViewportResize);\n }\n\n /** Stops observing viewport resizes without affecting element observation. */\n unobserveViewport(): void {\n if (!this.#observingViewport) return;\n this.#observingViewport = false;\n window.removeEventListener(\"resize\", this.#handleViewportResize);\n }\n\n /**\n * Starts reporting a `load` from anywhere inside `container` — an image or a\n * frame settling changes the box it sits in, and it measures as zero high until\n * then. `load` does not bubble, so the subscription is a capture-phase listener\n * on the container itself and nothing the caller spells.\n *\n * **One container at a time.** A further call moves the observation, so a widget\n * whose content element is swapped at runtime releases the element it let go by\n * naming the new one — there is no second place for the release to drift from.\n */\n observeDescendantLoads(container: Element): void {\n this.unobserveDescendantLoads();\n this.#loadContainer = container;\n container.addEventListener(\"load\", this.#handleDescendantLoad, true);\n }\n\n /** Stops reporting descendant loads without affecting element or viewport observation. */\n unobserveDescendantLoads(): void {\n this.#loadContainer?.removeEventListener(\"load\", this.#handleDescendantLoad, true);\n this.#loadContainer = null;\n }\n\n /**\n * Releases every observation: disconnects the {@link ResizeObserver} and removes\n * the viewport and descendant-load listeners. Safe to call multiple times. Call\n * this from a controller's `disconnect()`.\n */\n disconnect(): void {\n this.#resizeObserver?.disconnect();\n this.#resizeObserver = null;\n this.unobserveViewport();\n this.unobserveDescendantLoads();\n }\n}\n","/** Normalized scroll position and maximum distance on one logical axis. */\nexport interface LogicalScrollMetrics {\n position: number;\n max: number;\n}\n\n/**\n * Whether horizontal scrolling on `element` follows right-to-left inline flow.\n *\n * Resolved from the **computed** `direction`, so the authoring contract is the\n * usual `dir=\"rtl\"` (or a stylesheet) on the element or any ancestor.\n *\n * Scope: horizontal writing modes. A vertical writing mode (`writing-mode:\n * vertical-rl`) also inverts the horizontal axis, which this check does not\n * model — vertical writing modes are out of scope for the scroll utilities\n * (their consumers describe axes as horizontal/vertical, not inline/block).\n */\nexport function isRtl(element: Element): boolean {\n return window.getComputedStyle(element).direction === \"rtl\";\n}\n\n/**\n * Returns scroll distance from the logical start edge.\n *\n * CSSOM View exposes standards-mode RTL horizontal offsets as `0` at the inline\n * start (right) and increasingly negative values toward the inline end (left).\n * The normalized position is always clamped to `[0, max]`, which also absorbs\n * Safari's elastic overscroll values.\n */\nexport function logicalScrollMetrics(\n element: HTMLElement,\n horizontal: boolean,\n): LogicalScrollMetrics {\n const max = Math.max(\n 0,\n horizontal\n ? element.scrollWidth - element.clientWidth\n : element.scrollHeight - element.clientHeight,\n );\n const raw = horizontal ? element.scrollLeft : element.scrollTop;\n const position = horizontal && isRtl(element) ? -raw : raw;\n return { position: Math.min(max, Math.max(0, position)), max };\n}\n\n/**\n * Converts a logical start/end delta to the physical value accepted by\n * `Element.scrollBy`.\n */\nexport function physicalScrollDelta(\n element: HTMLElement,\n horizontal: boolean,\n logicalDelta: number,\n): number {\n return horizontal && isRtl(element) ? -logicalDelta : logicalDelta;\n}\n","/**\n * Collapses many Stimulus lifecycle callbacks from one DOM mutation into a\n * single pass.\n *\n * Stimulus fires `<name>TargetConnected` / `Disconnected` once per element and\n * `<name>ValueChanged` once per changed attribute. Replacing a list of N options\n * or morphing several render Values therefore delivers N callbacks — but the\n * useful unit of work is \"reconcile against the resulting declarative input\",\n * once, after the batch has settled. Every controller with reconcilable targets\n * or render Values needs the same shape: a `queued` flag plus `queueMicrotask`.\n *\n * **A microtask is the right horizon, and the reason is specific.** Stimulus\n * drives these callbacks from a `MutationObserver`, whose own callback already\n * runs as a microtask with the whole batch in hand; scheduling one more lands\n * after the last sibling callback of that batch and still before paint or any\n * event handler. A timer would be later than it needs to be, and reconciling\n * synchronously would run once per element against a half-applied DOM.\n *\n * **The two guards are not the same guard.** Scheduling is refused before the\n * controller connects, and running is refused after it disconnects:\n *\n * - **Before `connect()`** — Stimulus delivers initial target and Value callbacks\n * ahead of `connect()`. Reconciling there would compute output against a\n * controller whose own state has not been initialised, and `connect()` is\n * about to do a full pass anyway.\n * - **After `disconnect()`** — Stimulus fires a callback for **every** target\n * during teardown, and a microtask queued just before it would otherwise run\n * against a detached tree. {@link MicrotaskCoalescer.cancel} exists for the\n * teardown path to drop the pending pass outright.\n *\n * Both guards are part of one contract here rather than something each consumer\n * has to remember separately.\n *\n * Scope is the scheduling only. *What* to reconcile — keep the surviving active\n * option, fall back to the next / previous / first visible one, rebuild derived\n * chips or hidden fields — stays in the controller, because no two consumers\n * answer it the same way.\n *\n * This file's own doc block is dropped from `dist`, but every member comment is\n * inlined into each consumer entry (`tsup` builds with `splitting: false`), so\n * rationale belongs here and only the contract belongs on the members.\n *\n * @example\n * ```ts\n * readonly #reconcile = new MicrotaskCoalescer(() => this.#reconcileOptions());\n *\n * connect() { this.#reconcile.activate(); }\n * disconnect() { this.#reconcile.cancel(); }\n *\n * optionTargetConnected() { this.#reconcile.schedule(); }\n * optionTargetDisconnected() { this.#reconcile.schedule(); }\n * ```\n */\nexport class MicrotaskCoalescer {\n readonly #run: () => void;\n #queued = false;\n #active = false;\n #generation = 0;\n\n /** @param run - the single reconciliation pass, invoked at most once per batch. */\n constructor(run: () => void) {\n this.#run = run;\n }\n\n /** Opens the window in which {@link schedule} is honoured; call from `connect()`. */\n activate(): void {\n this.#active = true;\n }\n\n /** Closes the window and drops any pending pass; call from `disconnect()`. */\n cancel(): void {\n this.#active = false;\n this.#queued = false;\n this.#generation += 1;\n }\n\n /** Requests one pass after the batch settles. Idempotent; inert outside the window. */\n schedule(): void {\n if (!this.#active || this.#queued) return;\n this.#queued = true;\n const generation = this.#generation;\n queueMicrotask(() => {\n // A cancelled callback must not consume a pass queued after reconnect.\n if (generation !== this.#generation || !this.#queued || !this.#active) return;\n this.#queued = false;\n this.#run();\n });\n }\n}\n","/** One temporarily controlled style property and the authored declaration it displaced. */\ninterface StylePropertyLeaseRecord {\n readonly originalValue: string;\n readonly originalPriority: string;\n writtenValue: string | null;\n writtenPriority: string;\n}\n\n/**\n * Temporarily controls one inline CSS property across a changing set of elements.\n *\n * Authored value and priority are restored only while the declaration still matches\n * the last leased write. A later consumer write therefore wins.\n *\n * The lease has no lifecycle of its own, so it never subscribes to document events:\n * a consumer returns its leases from its own `turbo:before-cache` rewind.\n */\nexport class StylePropertyLease<T extends HTMLElement = HTMLElement> {\n readonly #property: string;\n readonly #records = new Map<T, StylePropertyLeaseRecord>();\n\n /** @param property - The CSS property whose temporary values this lease owns. */\n constructor(property: string) {\n this.#property = property;\n }\n\n /** Writes or removes the leased declaration while preserving its authored value. */\n write(element: T, value: string | null, priority = \"\"): void {\n const existing = this.#records.get(element);\n if (existing) {\n existing.writtenValue = value;\n existing.writtenPriority = value === null ? \"\" : priority;\n } else {\n this.#records.set(element, {\n originalValue: element.style.getPropertyValue(this.#property),\n originalPriority: element.style.getPropertyPriority(this.#property),\n writtenValue: value,\n writtenPriority: value === null ? \"\" : priority,\n });\n }\n\n this.#reflect(element, value, priority);\n }\n\n /** Returns one lease without overwriting a later consumer declaration. */\n return(element: T): void {\n const record = this.#records.get(element);\n if (!record) return;\n this.#records.delete(element);\n\n const style = element.style;\n const stillOwned =\n style.getPropertyValue(this.#property) === (record.writtenValue ?? \"\") &&\n style.getPropertyPriority(this.#property) === record.writtenPriority;\n if (stillOwned) {\n this.#reflect(element, record.originalValue, record.originalPriority);\n }\n }\n\n /** Returns every outstanding declaration lease. */\n returnAll(): void {\n for (const element of Array.from(this.#records.keys())) this.return(element);\n }\n\n /** Reflects only a real declaration transition. */\n #reflect(element: T, value: string | null, priority: string): void {\n const style = element.style;\n const nextValue = value ?? \"\";\n const nextPriority = value === null ? \"\" : priority;\n if (\n style.getPropertyValue(this.#property) === nextValue &&\n style.getPropertyPriority(this.#property) === nextPriority\n ) {\n return;\n }\n if (value === null) style.removeProperty(this.#property);\n else style.setProperty(this.#property, value, priority);\n }\n}\n","import { BeforeCacheReset } from \"./before_cache_reset\";\n\n/**\n * Shared bookkeeping for a `tabindex` a controller lends an element temporarily.\n *\n * A controller that must move focus somewhere the author never made focusable\n * (a landmark root, a scroll destination) reaches for the same trick: add a\n * `tabindex` just-in-time and hand it back once it is no longer needed. The\n * borrow is the easy half; the return is what the two conditions below are for.\n *\n * **Returning needs two conditions, not one.** Owning the borrow is not enough:\n * the attribute must also still hold the value this instance wrote. A consumer\n * that changed it afterwards — `tabindex=\"0\"` to make the root its own Tab stop\n * — owns it now, and removing it there silently discards authored markup. The\n * bookkeeping is dropped either way, since the loan is over regardless of who\n * ends up owning the value.\n *\n * **Never borrow over an existing value.** An element that already carries a\n * `tabindex` is the author's to control, so there is nothing to lend and nothing\n * to return.\n *\n * Every live loan also owns a shared `turbo:before-cache` subscription. The loan\n * is returned before Turbo can copy it into a snapshot, so consumers get cache\n * safety without duplicating a lifecycle hook; `returnAll()` removes the\n * subscription again as soon as no loan remains.\n *\n * The registry is keyed by element, so a controller borrowing on a single\n * element (`this.element`) and one borrowing across a changing set of targets\n * use the same API — the single-element case is a set of one. It holds no\n * opinion about *when* to borrow or where focus goes next; that stays in the\n * controller.\n *\n * **The API is deliberately two methods.** This file's own doc block is dropped\n * from `dist`, but every member comment is inlined into **each** consumer entry\n * (`tsup` builds with `splitting: false`), so rationale belongs here, only the\n * contract belongs on the members, and every method no consumer calls is still\n * paid for once per consumer entry.\n *\n * @example\n * ```ts\n * readonly #tabindex = new TabindexLoan();\n *\n * #rescueFocus() {\n * this.#tabindex.lend(this.element);\n * this.element.focus();\n * }\n *\n * disconnect() {\n * this.#tabindex.returnAll();\n * }\n * ```\n */\nexport class TabindexLoan<T extends HTMLElement = HTMLElement> {\n readonly #value: string;\n readonly #lent = new Set<T>();\n /** Returns live loans before Turbo can copy them into its page snapshot. */\n readonly #beforeCache = new BeforeCacheReset(() => this.returnAll());\n\n /**\n * @param value - the `tabindex` to lend. `\"-1\"` (the default) is\n * programmatically focusable but not a Tab stop; `\"0\"` is a real Tab stop,\n * which a scroll region with no focusable content of its own needs.\n */\n constructor(value: string = \"-1\") {\n this.#value = value;\n }\n\n /** Lends `element` the value; no-ops when it already carries a `tabindex`. */\n lend(element: T): void {\n if (element.hasAttribute(\"tabindex\")) return;\n element.setAttribute(\"tabindex\", this.#value);\n this.#lent.add(element);\n // Subscribe only while a real loan exists. Keeping this guarantee here means\n // every consumer is Turbo-safe without another lifecycle hook to remember.\n this.#beforeCache.activate();\n }\n\n /** Takes back every loan whose value is still the one that was lent. */\n returnAll(): void {\n for (const element of this.#lent) {\n if (element.getAttribute(\"tabindex\") === this.#value) element.removeAttribute(\"tabindex\");\n }\n this.#lent.clear();\n this.#beforeCache.deactivate();\n }\n}\n","import { Controller } from \"@hotwired/stimulus\";\nimport { AttributeLease } from \"../utils/attribute_lease\";\nimport { BeforeCacheReset } from \"../utils/before_cache_reset\";\nimport { hasTabStop } from \"../utils/focus_candidate\";\nimport { FrameCoalescer } from \"../utils/frame_coalescer\";\nimport { LayoutObserver } from \"../utils/layout_observer\";\nimport { logicalScrollMetrics } from \"../utils/logical_scroll\";\nimport { MicrotaskCoalescer } from \"../utils/microtask_coalescer\";\nimport { StylePropertyLease } from \"../utils/style_property_lease\";\nimport { TabindexLoan } from \"../utils/tabindex_loan\";\n\n/** Distance from an edge (px) treated as fully reached; absorbs sub-pixel scroll. */\nconst EDGE_EPSILON = 1;\n\ntype Edge = \"start\" | \"end\";\n\n/** The event surface used by `document.fonts` without requiring it in older engines. */\ninterface FontEventSource {\n addEventListener(type: string, listener: EventListener): void;\n removeEventListener(type: string, listener: EventListener): void;\n}\n\n/**\n * Headless **Scroll Area** behavior: keyboard reachability and scroll-state hooks\n * for a natively scrolling region. No custom scrollbar is introduced.\n *\n * Markup contract (identifier: `stimeo--scroll-area`):\n * <div data-controller=\"stimeo--scroll-area\"\n * data-stimeo--scroll-area-orientation-value=\"vertical\">\n * <div data-stimeo--scroll-area-target=\"viewport\" aria-label=\"Log output\">\n * <!-- long content -->\n * </div>\n * </div>\n *\n * When content overflows and the viewport has no sequential Tab stop of its own,\n * the viewport receives a borrowed `tabindex=\"0\"`. A named viewport also receives\n * a borrowed `role=\"region\"`. Position is exposed through `data-scroll`, overflow\n * through `data-overflow`, and normalized progress through\n * `--stimeo--scroll-progress` so consumer CSS can render state without prescribing\n * appearance.\n *\n * The `reach` event is emitted once when an overflowing edge state is established,\n * including initial connection and a fit-to-overflow transition. Moving away from\n * that edge rearms the next arrival.\n *\n * `reach` dispatches `{ edge: \"start\" | \"end\" }`.\n *\n * @remarks\n * Behavior only. Scroll work is coalesced to one animation frame and never scans\n * descendants. Resize, content, accessible-name source, descendant-load, and font\n * completion changes run the full measurement pass. Every listener, observer,\n * animation frame, borrowed attribute, and state hook is released on disconnect\n * and before Turbo caches the page. Runtime viewport replacement rebinds the whole\n * resource set as one lifecycle unit.\n */\nexport class ScrollAreaController extends Controller<HTMLElement> {\n static override targets = [\"viewport\"];\n static override values = {\n orientation: { type: String, default: \"vertical\" },\n };\n static events = [\"reach\"] as const;\n\n declare readonly viewportTarget: HTMLElement;\n declare readonly hasViewportTarget: boolean;\n\n declare orientationValue: string;\n\n readonly #layout = new LayoutObserver(() => this.#refresh());\n readonly #rebind = new MicrotaskCoalescer(() => this.#syncViewport());\n readonly #beforeCache = new BeforeCacheReset(() => this.#rewindForCache());\n readonly #tabindex = new TabindexLoan(\"0\");\n readonly #role = new AttributeLease<HTMLElement>(\"role\");\n readonly #overflowState = new AttributeLease<HTMLElement>(\"data-overflow\");\n readonly #scrollState = new AttributeLease<HTMLElement>(\"data-scroll\");\n readonly #progress = new StylePropertyLease<HTMLElement>(\"--stimeo--scroll-progress\");\n\n #viewport: HTMLElement | null = null;\n #content: MutationObserver | null = null;\n #nameSources: MutationObserver | null = null;\n #nameGraph: MutationObserver | null = null;\n #observedNameIds = new Set<string>();\n #observedNameSources: Element[] = [];\n #fonts: FontEventSource | null = null;\n /** Coalesces scroll bursts into one position sync per frame. */\n readonly #frames = new FrameCoalescer();\n #overflowing = false;\n #lastEdge: Edge | null = null;\n readonly #ownedHostMutations = new Map<string, string | null>();\n\n readonly #onScroll = (event: Event): void => {\n // The listener only ever sits on the viewport, and letting that viewport go\n // cancels the pending frame first, so the frame has a target by construction.\n const viewport = event.currentTarget as HTMLElement;\n this.#frames.schedule(() => this.#syncPosition(viewport, this.#overflowing));\n };\n\n readonly #onFontsSettled: EventListener = () => {\n this.#refresh();\n };\n\n override connect(): void {\n this.#beforeCache.activate();\n this.#rebind.activate();\n this.#layout.observeViewport();\n this.#bindFonts();\n this.#syncViewport();\n }\n\n override disconnect(): void {\n this.#beforeCache.deactivate();\n this.#rebind.cancel();\n this.#frames.cancel();\n if (this.#viewport) this.#unbindViewport(this.#viewport);\n this.#layout.disconnect();\n this.#unbindFonts();\n this.#clearHostState();\n }\n\n /** Re-measures when a retained viewport's orientation Value is morphed. */\n orientationValueChanged(): void {\n this.#refresh();\n }\n\n /** Schedules a complete resource rebind for a runtime viewport target. */\n viewportTargetConnected(): void {\n this.#rebind.schedule();\n }\n\n /** Schedules cleanup or replacement binding after a viewport leaves. */\n viewportTargetDisconnected(): void {\n this.#rebind.schedule();\n }\n\n /** Rebinds every viewport-owned resource against the final target in the mutation batch. */\n #syncViewport(): void {\n const next = this.hasViewportTarget ? this.viewportTarget : null;\n if (next === this.#viewport) {\n if (next) this.#refresh();\n else this.#clearHostState();\n return;\n }\n\n if (this.#viewport) this.#unbindViewport(this.#viewport);\n this.#viewport = next;\n if (!next) {\n this.#clearHostState();\n return;\n }\n\n next.addEventListener(\"scroll\", this.#onScroll, { passive: true });\n this.#layout.observeDescendantLoads(next);\n this.#layout.observe(next);\n this.#bindContentObserver(next);\n this.#refresh();\n }\n\n /** Observes structural and attribute changes that can alter overflow or Tab stops. */\n #bindContentObserver(viewport: HTMLElement): void {\n this.#content = new MutationObserver((records) => {\n if (this.#viewport !== viewport || !this.#hasRelevantContentMutation(records)) return;\n this.#refresh();\n });\n this.#content.observe(viewport, {\n subtree: true,\n childList: true,\n attributes: true,\n characterData: true,\n });\n }\n\n /** Ignores only state-hook mutations whose exact value this controller just wrote. */\n #hasRelevantContentMutation(records: MutationRecord[]): boolean {\n let relevant = false;\n const consumed = new Set<string>();\n for (const record of records) {\n const attribute = record.attributeName;\n if (\n record.type === \"attributes\" &&\n record.target === this.element &&\n attribute !== null &&\n this.#ownedHostMutations.has(attribute) &&\n this.element.getAttribute(attribute) === this.#ownedHostMutations.get(attribute)\n ) {\n consumed.add(attribute);\n } else {\n relevant = true;\n }\n }\n for (const attribute of consumed) this.#ownedHostMutations.delete(attribute);\n return relevant;\n }\n\n /** Releases every resource and borrowed attribute owned by one former viewport. */\n #unbindViewport(viewport: HTMLElement): void {\n this.#frames.cancel();\n viewport.removeEventListener(\"scroll\", this.#onScroll);\n this.#layout.unobserveDescendantLoads();\n this.#layout.unobserve(viewport);\n this.#content?.disconnect();\n this.#content = null;\n this.#disconnectNameSources();\n this.#clearViewportAttributes(viewport);\n this.#ownedHostMutations.clear();\n this.#viewport = null;\n this.#overflowing = false;\n this.#lastEdge = null;\n }\n\n /**\n * Runs the full structural and positional measurement pass.\n *\n * @stimeoRenderRoot\n */\n #refresh(): void {\n const viewport = this.#viewport;\n if (!viewport) return;\n this.#frames.cancel();\n this.#syncNameSources(viewport);\n this.#overflowing = this.#syncOverflow(viewport);\n this.#syncKeyboardReach(viewport, this.#overflowing);\n this.#syncPosition(viewport, this.#overflowing);\n }\n\n /** Measures overflow and reflects the state hook without identical DOM writes. */\n #syncOverflow(viewport: HTMLElement): boolean {\n const overflowing = this.#measureOverflow(viewport);\n this.#writeHostAttribute(this.#overflowState, \"data-overflow\", overflowing ? \"true\" : \"false\");\n return overflowing;\n }\n\n /** Measures the primary-axis position and dispatches a newly established edge. */\n #syncPosition(viewport: HTMLElement, overflowing: boolean): void {\n const { position, progress } = this.#measurePosition(viewport);\n this.#writeHostAttribute(this.#scrollState, \"data-scroll\", position);\n this.#writeHostProgress(String(progress));\n\n const edge: Edge | null =\n overflowing && (position === \"start\" || position === \"end\") ? position : null;\n if (edge === this.#lastEdge) return;\n this.#lastEdge = edge;\n if (edge) this.dispatch(\"reach\", { detail: { edge } });\n }\n\n /** Writes one leased host attribute and records self-generated observer input. */\n #writeHostAttribute(lease: AttributeLease<HTMLElement>, attribute: string, value: string): void {\n const before = this.element.getAttribute(attribute);\n lease.write(this.element, value);\n this.#recordOwnedHostMutation(attribute, before);\n }\n\n /** Writes the leased progress property and records its serialized style mutation. */\n #writeHostProgress(value: string): void {\n const before = this.element.getAttribute(\"style\");\n this.#progress.write(this.element, value);\n this.#recordOwnedHostMutation(\"style\", before);\n }\n\n /** Records an exact host mutation only when the host is also the observed viewport. */\n #recordOwnedHostMutation(attribute: string, before: string | null): void {\n if (this.#viewport !== this.element) return;\n const after = this.element.getAttribute(attribute);\n if (after !== before) this.#ownedHostMutations.set(attribute, after);\n }\n\n /** Returns host hooks to authored values and clears edge bookkeeping. */\n #clearHostState(): void {\n this.#overflowState.returnAll();\n this.#scrollState.returnAll();\n this.#progress.returnAll();\n this.#ownedHostMutations.clear();\n this.#overflowing = false;\n this.#lastEdge = null;\n }\n\n /** Whether the configured axis currently has a scroll range. */\n #measureOverflow(viewport: HTMLElement): boolean {\n const orientation = this.orientationValue;\n const vertical =\n orientation !== \"horizontal\" && viewport.scrollHeight > viewport.clientHeight + EDGE_EPSILON;\n const horizontal =\n orientation !== \"vertical\" && viewport.scrollWidth > viewport.clientWidth + EDGE_EPSILON;\n return vertical || horizontal;\n }\n\n /** Reports the primary-axis position bucket and normalized 0–1 progress. */\n #measurePosition(viewport: HTMLElement): {\n position: \"start\" | \"middle\" | \"end\";\n progress: number;\n } {\n const horizontalPrimary =\n this.orientationValue === \"horizontal\" ||\n (this.orientationValue === \"both\" &&\n viewport.scrollHeight <= viewport.clientHeight + EDGE_EPSILON);\n const { position: scrollPosition, max: maxScroll } = logicalScrollMetrics(\n viewport,\n horizontalPrimary,\n );\n\n if (maxScroll <= EDGE_EPSILON) return { position: \"start\", progress: 0 };\n const progress = Math.min(1, Math.max(0, scrollPosition / maxScroll));\n if (scrollPosition <= EDGE_EPSILON) return { position: \"start\", progress };\n if (scrollPosition >= maxScroll - EDGE_EPSILON) return { position: \"end\", progress };\n return { position: \"middle\", progress };\n }\n\n /** Borrows keyboard reach only when no usable descendant already owns a Tab stop. */\n #syncKeyboardReach(viewport: HTMLElement, overflowing: boolean): void {\n const wantsTabindex = overflowing && !hasTabStop(viewport);\n if (!wantsTabindex) {\n this.#clearViewportAttributes(viewport);\n return;\n }\n\n this.#tabindex.lend(viewport);\n if (this.#hasAccessibleName(viewport)) {\n if (!viewport.hasAttribute(\"role\")) this.#role.write(viewport, \"region\");\n } else {\n this.#role.return(viewport);\n }\n }\n\n /** Returns only the viewport attributes borrowed by this controller. */\n #clearViewportAttributes(viewport: HTMLElement): void {\n this.#tabindex.returnAll();\n this.#role.return(viewport);\n }\n\n /** Whether the viewport already has a non-empty accessible name. */\n #hasAccessibleName(viewport: HTMLElement): boolean {\n const sources = this.#resolveNameSources(viewport);\n if (sources.length > 0) {\n return sources.some((source) => {\n const label = source.getAttribute(\"aria-label\")?.trim();\n return Boolean(label || source.textContent?.trim());\n });\n }\n return Boolean(viewport.getAttribute(\"aria-label\")?.trim());\n }\n\n /** Resolves unique, live `aria-labelledby` references in authored order. */\n #resolveNameSources(viewport: HTMLElement): Element[] {\n const ids = this.#nameReferenceIds(viewport);\n const sources: Element[] = [];\n const seen = new Set<Element>();\n for (const id of ids) {\n const source = viewport.ownerDocument.getElementById(id);\n if (source && !seen.has(source)) {\n seen.add(source);\n sources.push(source);\n }\n }\n return sources;\n }\n\n /** Observes external name sources so a retained region never becomes unnamed. */\n #syncNameSources(viewport: HTMLElement): void {\n const ids = this.#nameReferenceIds(viewport);\n const sources = this.#resolveNameSources(viewport).filter(\n (source) => !viewport.contains(source),\n );\n if (\n ids.length === this.#observedNameIds.size &&\n ids.every((id) => this.#observedNameIds.has(id)) &&\n sources.length === this.#observedNameSources.length &&\n sources.every((source, index) => source === this.#observedNameSources[index])\n ) {\n return;\n }\n\n this.#disconnectNameSources();\n this.#observedNameIds = new Set(ids);\n this.#observedNameSources = sources;\n if (ids.length > 0) {\n this.#nameGraph = new MutationObserver((records) => {\n if (this.#viewport === viewport && this.#hasRelevantNameGraphMutation(records)) {\n this.#refresh();\n }\n });\n const documentElement = viewport.ownerDocument.documentElement;\n if (documentElement) {\n this.#nameGraph.observe(documentElement, {\n subtree: true,\n childList: true,\n attributes: true,\n attributeFilter: [\"id\"],\n attributeOldValue: true,\n });\n }\n }\n\n if (sources.length === 0) return;\n this.#nameSources = new MutationObserver(() => {\n this.#refresh();\n });\n for (const source of sources) {\n this.#nameSources.observe(source, {\n subtree: true,\n childList: true,\n characterData: true,\n attributes: true,\n });\n }\n }\n\n /** Returns normalized unique label-reference ids in authored order. */\n #nameReferenceIds(viewport: HTMLElement): string[] {\n const tokens = viewport.getAttribute(\"aria-labelledby\")?.trim().split(/\\s+/).filter(Boolean);\n return Array.from(new Set(tokens));\n }\n\n /** Whether document-graph changes can resolve or invalidate a referenced id. */\n #hasRelevantNameGraphMutation(records: MutationRecord[]): boolean {\n for (const record of records) {\n if (record.type === \"attributes\") {\n const current = (record.target as Element).id;\n if (\n this.#observedNameIds.has(current) ||\n this.#observedNameIds.has(record.oldValue ?? \"\")\n ) {\n return true;\n }\n continue;\n }\n\n for (const node of [...record.addedNodes, ...record.removedNodes]) {\n if (this.#nodeContainsObservedNameId(node)) return true;\n }\n }\n return false;\n }\n\n /** Whether a changed subtree contains one of the current label-reference ids. */\n #nodeContainsObservedNameId(node: Node): boolean {\n if (!(node instanceof Element)) return false;\n if (this.#observedNameIds.has(node.id)) return true;\n return Array.from(node.querySelectorAll<HTMLElement>(\"[id]\")).some((element) =>\n this.#observedNameIds.has(element.id),\n );\n }\n\n /** Stops observing accessible-name sources. */\n #disconnectNameSources(): void {\n this.#nameSources?.disconnect();\n this.#nameSources = null;\n this.#nameGraph?.disconnect();\n this.#nameGraph = null;\n this.#observedNameIds.clear();\n this.#observedNameSources = [];\n }\n\n /** Subscribes to font completion when the current engine exposes `document.fonts`. */\n #bindFonts(): void {\n const fonts = (this.element.ownerDocument as Document & { fonts?: FontEventSource }).fonts;\n if (!fonts || this.#fonts === fonts) return;\n this.#unbindFonts();\n this.#fonts = fonts;\n fonts.addEventListener(\"loadingdone\", this.#onFontsSettled);\n fonts.addEventListener(\"loadingerror\", this.#onFontsSettled);\n }\n\n /** Removes the font completion subscriptions. */\n #unbindFonts(): void {\n this.#fonts?.removeEventListener(\"loadingdone\", this.#onFontsSettled);\n this.#fonts?.removeEventListener(\"loadingerror\", this.#onFontsSettled);\n this.#fonts = null;\n }\n\n /** Suspends live resources and returns all derived state before snapshotting. */\n #rewindForCache(): void {\n this.#rebind.cancel();\n this.#frames.cancel();\n if (this.#viewport) this.#unbindViewport(this.#viewport);\n this.#layout.disconnect();\n this.#unbindFonts();\n this.#clearHostState();\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../../src/utils/attribute_write.ts","../../src/utils/shared_registry.ts","../../src/utils/attribute_lease.ts","../../src/utils/focus_candidate.ts","../../src/utils/listener_set.ts","../../src/utils/font_load_watcher.ts","../../src/utils/frame_coalescer.ts","../../src/utils/layout_observer.ts","../../src/utils/logical_scroll.ts","../../src/utils/microtask_coalescer.ts","../../src/utils/morph_render_watcher.ts","../../src/utils/style_property_lease.ts","../../src/utils/query_open_descendants.ts","../../src/utils/tabindex_loan.ts","../../src/controllers/scroll_area_controller.ts"],"names":["registry","above"],"mappings":";;AAaO,SAAS,qBAAA,CACd,OAAA,EACA,IAAA,EACA,KAAA,EACA,WAAA,EACS;AACT,EAAA,IAAI,OAAA,CAAQ,YAAA,CAAa,IAAI,CAAA,KAAM,OAAO,OAAO,KAAA;AAEjD,EAAA,IAAI,KAAA,KAAU,IAAA,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B,IAAA,IAAA,CAAK,cAAc,UAAA,EAAW;AAC9B,IAAA,IAAA,CAAK,YAAA,GAAe,IAAA;AACpB,IAAA,IAAA,CAAK,YAAY,UAAA,EAAW;AAC5B,IAAA,IAAA,CAAK,UAAA,GAAa,IAAA;AAClB,IAAA,IAAA,CAAK,iBAAiB,KAAA,EAAM;AAC5B,IAAA,IAAA,CAAK,uBAAuB,EAAC;AAAA,EAC/B;AACF","file":"scroll_area_controller.js","sourcesContent":["/**\n * Reflects a serialized attribute value only when the current value differs.\n *\n * A same-value `setAttribute` still queues a mutation record for every observer, so an\n * unchanged value writes nothing.\n *\n * @param element - The element whose attribute is reflected.\n * @param name - The attribute name, using the non-namespaced DOM API.\n * @param value - The serialized value, or null to remove the attribute.\n * @param beforeWrite - Called only for a change, before the DOM mutation, so the\n * caller can record ownership or identify its own observer records.\n * @returns Whether an attribute was written or removed.\n */\nexport function setAttributeIfChanged(\n element: Element,\n name: string,\n value: string | null,\n beforeWrite?: () => void,\n): boolean {\n if (element.getAttribute(name) === value) return false;\n beforeWrite?.();\n if (value === null) element.removeAttribute(name);\n else element.setAttribute(name, value);\n return true;\n}\n","/**\n * One registry per page for every copy of the library.\n *\n * Each `stimeo-ui/controllers/*` file, and each opt-in entry, is built on its own and carries\n * its own copy of every utility it uses, so a page that imports controllers one by one, or one\n * of them next to the barrel, evaluates a utility several times. A registry that coordinates\n * instances of different controllers — the stacks of leased values, the loans of a\n * `tabindex`, the Escape layers, the focus traps — must not be split by that: a dialog inside\n * a drawer, or a character counter and a form field on one input, coordinate whichever files\n * they came from. So such a registry lives once on `globalThis`, under a `Symbol.for` key the\n * copies agree on, and the first copy to ask for it creates it.\n *\n * The key names the registry and the version of its shape\n * (`stimeo-ui.<utility>.registry.v<n>`). Copies whose registries have the same shape share\n * one; a release that changes the shape changes the version, so a copy of another release\n * keeps a registry of its own instead of reading entries it does not understand — the two\n * then coordinate within each release only. An entry another copy put in a registry is read\n * through its fields alone, never through `#private` members, which belong to the class of\n * the copy that created it.\n */\n\n/**\n * The registry stored under `key`, created by `create` on first use.\n *\n * @param key - `stimeo-ui.<utility>.registry.v<n>`: the version is that of the shape `create`\n * returns.\n * @param create - Builds the empty registry.\n */\nexport function sharedRegistry<T extends object>(key: string, create: () => T): T {\n const symbol = Symbol.for(key);\n const scope = globalThis as unknown as Record<symbol, T | undefined>;\n const existing = scope[symbol];\n if (existing !== undefined) return existing;\n const registry = create();\n Object.defineProperty(globalThis, symbol, { value: registry });\n return registry;\n}\n","import { setAttributeIfChanged } from \"./attribute_write\";\nimport { sharedRegistry } from \"./shared_registry\";\n\n/** What a lease's record says: the author's value, its last write, the leases beneath. */\ninterface AttributeLeaseRecord {\n readonly original: string | null;\n readonly written: string | null;\n /** Whether it hands back what the lease right beneath it wrote last. */\n readonly linked: boolean;\n /** The records of the other owners' leases beneath it, nearest first. */\n readonly beneath: readonly string[];\n}\n\n/** One lease's hold on one element's attribute, in the stack every lease of it shares. */\ninterface AttributeHold {\n /** The lease holding it; `null` for a hold read from a copy's record until its lease takes it. */\n lease: object | null;\n readonly record: string;\n written: string | null;\n /** What it hands back with nothing beneath it: the author's value. */\n readonly original: string | null;\n /** Whether it hands back what the hold beneath it wrote last instead. */\n linked: boolean;\n}\n\n/** The holds on each element by attribute, and every lease's record name by attribute. */\ninterface AttributeLeaseRegistry {\n readonly stacks: WeakMap<Element, Map<string, AttributeHold[]>>;\n readonly names: Map<string, Set<string>>;\n}\n\n/** Holds and record names coordinate across separately built package entries. */\nconst registry = sharedRegistry(\n \"stimeo-ui.attribute-lease.registry.v1\",\n (): AttributeLeaseRegistry => ({ stacks: new WeakMap(), names: new Map() }),\n);\n\n/** Whether a parsed record entry is an attribute value: a string, or `null` for absence. */\nfunction isAttributeValue(value: unknown): value is string | null {\n return value === null || typeof value === \"string\";\n}\n\n/**\n * Reads the record a lease left on `element`: the author's value, the value the lease wrote\n * last, whether it hands back the value beneath it (`false` before the names when it does not)\n * and the records beneath it. `undefined` when the record is missing or holds anything else.\n */\nfunction readLeaseRecord(element: Element, record: string): AttributeLeaseRecord | undefined {\n try {\n const parsed: unknown = JSON.parse(element.getAttribute(record) ?? \"null\");\n if (!Array.isArray(parsed)) return undefined;\n const [original, written, ...rest] = parsed as unknown[];\n const linked = rest[0] !== false;\n const beneath = linked ? rest : rest.slice(1);\n if (!beneath.every((under): under is string => typeof under === \"string\")) return undefined;\n return isAttributeValue(original) && isAttributeValue(written)\n ? { original, written, linked, beneath }\n : undefined;\n } catch {\n return undefined;\n }\n}\n\n/** The element's stack, seeded from complete ownership records once. */\nfunction attributeStack(element: Element, attribute: string): AttributeHold[] {\n const byAttribute = registry.stacks.get(element) ?? new Map<string, AttributeHold[]>();\n registry.stacks.set(element, byAttribute);\n const known = byAttribute.get(attribute);\n if (known) return known;\n const found: (AttributeLeaseRecord & { readonly record: string })[] = [];\n for (const record of registry.names.get(attribute) ?? []) {\n const read = readLeaseRecord(element, record);\n if (read) found.push({ ...read, record });\n }\n const depth = ({ beneath }: (typeof found)[number]) =>\n beneath.filter((name) => found.some((other) => other.record === name)).length;\n const stack = found\n .sort((one, other) => depth(one) - depth(other))\n .map(({ record, written, original, linked }, index) => ({\n lease: null,\n record,\n written,\n original,\n linked: linked && index > 0,\n }));\n byAttribute.set(attribute, stack);\n return stack;\n}\n\n/** The lease's live hold or the unclaimed hold described by its owner's record. */\nfunction findHold(\n stack: readonly AttributeHold[],\n lease: object,\n record: string,\n): AttributeHold | undefined {\n return (\n stack.find((held) => held.lease === lease) ??\n stack.find((held) => held.lease === null && held.record === record)\n );\n}\n\n/**\n * Inspects a derived writer's continuation without acquiring or returning a hold.\n * A covered hold may update beneath its cover. Without a hold, the expected authored\n * value is compared with the original beneath any temporary cover. The original\n * distinguishes an absent attribute from an empty one.\n */\nexport function readAttributeLease(\n element: Element,\n attribute: string,\n owner: string,\n lease: object,\n expected: string | null,\n): { readonly allowed: boolean; readonly original: string | null } {\n const stack = attributeStack(element, attribute);\n const hold = findHold(stack, lease, `data-${owner}-${attribute}-lease`);\n const current = element.getAttribute(attribute);\n const covering = [...stack].reverse().find((other) => other.written === current);\n const original = (hold ?? covering)?.original;\n const authored = original === undefined ? current : original;\n return {\n original: authored,\n allowed: hold\n ? current === hold.written ||\n stack.slice(stack.indexOf(hold) + 1).some((above) => above.written === current)\n : authored === expected,\n };\n}\n\n/**\n * The value `element`'s author wrote for `attribute`, as the record a lease of any owner leaves\n * on the element carries it; `undefined` while no lease leaves one, as when nothing has moved\n * the attribute off the author's value. A field a reveal turned from `password` into `text`\n * still reads `\"password\"` here.\n */\nexport function leasedAuthorValue(element: Element, attribute: string): string | null | undefined {\n const suffix = `-${attribute}-lease`;\n for (const name of element.getAttributeNames()) {\n if (!name.startsWith(\"data-\") || !name.endsWith(suffix)) continue;\n const record = readLeaseRecord(element, name);\n if (record) return record.original;\n }\n return undefined;\n}\n\n/**\n * Temporarily controls one attribute across a changing set of elements.\n *\n * The first write remembers the authored value, including the distinction between\n * an absent attribute and an authored empty string. Returning a lease restores that\n * value only while the attribute still matches the controller's last write. If a\n * consumer changed it in the meantime, the consumer owns the new value and teardown\n * leaves it alone.\n *\n * A `null` write deliberately removes the attribute while retaining the lease. This\n * is useful for derived ARIA whose valid absence is itself controller state, such as\n * an unbounded `aria-valuemin` or a blank spinbutton's `aria-valuenow`.\n *\n * **Every lease of an attribute shares one stack of holds per element**, whatever its owner\n * and whichever file of the package constructed it (the stacks are one per page): the holds\n * sit in the order their leases first wrote the element, each with the value it wrote last.\n * The element's value is the highest hold's that carries it, and the page's when none does.\n * A write reaches the element unless a hold above the writer carries the element's value: the\n * top hold always shows its writes, a hold beneath it shows nothing while a hold above keeps\n * its value on the element, and once the page has put a value there that no hold carries, the\n * next write of any hold replaces it. A return gives a value back only from the hold the\n * element's value is: the value the hold beneath it wrote last, or the author's once nothing\n * is beneath it; any other return only leaves the stack, and the page's value stays. Holds\n * that wrote the same value are told apart by the stack, never by the value: the higher one\n * keeps it. A first write over a top hold whose value the page has replaced takes the\n * element's value as the author's. Two instances of one controller on one element — an\n * element outside their scope — stack the same way.\n *\n * A **base lease** (`{ base: true }`) holds the element's own state rather than a value over\n * it — a form field's ARIA on its control is one — so its first write goes to the bottom of\n * the stack, beneath the leases of other owners already there: a temporary value another\n * owner leased stays shown and returns to the base lease's latest value.\n *\n * **The stack travels with the element.** While a hold shows a value other than the author's,\n * lies on another hold or is covered by one, the element carries its owner's record\n * `data-<owner>-<attribute>-lease`: JSON of the author's value and the value the hold wrote\n * last (each a string, or `null` for an absent attribute), `false` where the hold hands back\n * the author's value rather than the latest value of the hold beneath it, and the records of\n * every hold beneath it, nearest first. Returning the last lease of an owner removes its\n * record. A copy of the element — a page Turbo restores from its cache is one — therefore\n * carries the stack, and the first lease to touch the copy reads it back under the record\n * names of the leases constructed so far, which include every lease that wrote a record the\n * cache holds, and orders the holds by the records each one lists beneath it. Each lease takes\n * the hold its owner's record describes over in place. Complete records for distinct owners\n * preserve their order across a copy. The records describe holds by owner, not by instance:\n * one owner holding the element more than once leaves only its topmost hold's record, which\n * the first of its leases to write or return on the copy takes. Lower holds of that owner and\n * their positions are absent; mutually listed owners cannot express their full live order.\n * A hold that showed the author's value alone carries no record and is taken by its first\n * write on the copy. Missing or unreadable records also leave their holds unknown, so copying\n * the DOM does not promise identical decisions for every live stack. Without a record it can\n * read, a new stack takes the current value as the author's. A Turbo morph removes records\n * absent from the server HTML; existing holds remain in memory until their leases return.\n *\n * The lease has no lifecycle of its own, so it never subscribes to document events,\n * and nothing rewinds a live page before Turbo caches it: `turbo:before-cache` also\n * fires on pages that stay.\n */\nexport class AttributeLease<T extends Element = Element> {\n readonly #attribute: string;\n readonly #record: string;\n readonly #base: boolean;\n readonly #preserveAuthor: boolean;\n readonly #held = new Set<T>();\n\n /**\n * @param attribute - The attribute whose temporary values this lease owns.\n * @param owner - Names the record on the element; the controller's identifier.\n * @param options - `base`: written beneath the other owners' leases;\n * `preserveAuthor`: a new base hold keeps a current value that no hold carries as authored.\n */\n constructor(\n attribute: string,\n owner: string,\n options: { readonly base?: boolean; readonly preserveAuthor?: boolean } = {},\n ) {\n this.#attribute = attribute;\n this.#record = `data-${owner}-${attribute}-lease`;\n this.#base = options.base === true;\n this.#preserveAuthor = options.preserveAuthor === true;\n const names = registry.names;\n names.set(attribute, (names.get(attribute) ?? new Set<string>()).add(this.#record));\n }\n\n /** Writes or removes the leased attribute while preserving its authored value. */\n write(element: T, value: string | null): void {\n const stack = attributeStack(element, this.#attribute);\n const hold = this.#take(stack) ?? this.#acquire(element, stack);\n this.#held.add(element);\n const shows = !this.#covered(element, stack, hold);\n hold.written = value;\n this.#mark(element, stack);\n if (shows) this.#reflect(element, value);\n }\n\n /**\n * Returns one lease, also on a restored copy, to the value the hold beneath it wrote last or\n * the author's, without overwriting a value a consumer wrote since. Says whether there was a\n * lease to return: a hold this lease has, or the hold a copy's record describes while no live\n * lease of the owner has taken it — a copy of a page an earlier connection wrote carries one.\n */\n return(element: T): boolean {\n const held = this.#held.delete(element);\n const known = registry.stacks.get(element)?.has(this.#attribute);\n const stack =\n held || known || element.hasAttribute(this.#record)\n ? attributeStack(element, this.#attribute)\n : [];\n const hold = this.#take(stack);\n if (!hold) return false;\n const carries = element.getAttribute(this.#attribute) === hold.written;\n const owns = carries && !this.#covered(element, stack, hold);\n const index = stack.indexOf(hold);\n stack.splice(index, 1);\n const above = stack[index];\n if (above) above.linked &&= hold.linked;\n this.#mark(element, stack);\n if (!owns) return true;\n const below = hold.linked ? stack[index - 1] : undefined;\n this.#reflect(element, below ? below.written : hold.original);\n return true;\n }\n\n /** Returns every lease it holds, with the same ownership check as {@link return}. */\n returnAll(): void {\n for (const element of Array.from(this.#held)) this.return(element);\n }\n\n /** Its hold in `stack`, taking over one read from its record. */\n #take(stack: AttributeHold[]): AttributeHold | undefined {\n const hold = findHold(stack, this, this.#record);\n if (hold) hold.lease = this;\n return hold;\n }\n\n /** A new hold: on top, over the top hold while the element shows it; a base one at the bottom. */\n #acquire(element: T, stack: AttributeHold[]): AttributeHold {\n const current = element.getAttribute(this.#attribute);\n const top = stack.at(-1);\n const bottom = stack[0];\n const over = top?.written === current ? top : undefined;\n const from = this.#base\n ? this.#preserveAuthor && !stack.some((held) => held.written === current)\n ? undefined\n : bottom\n : over;\n const hold: AttributeHold = {\n lease: this,\n record: this.#record,\n written: current,\n original: from ? from.original : current,\n linked: !this.#base && over !== undefined,\n };\n if (this.#base && bottom) {\n bottom.linked = true;\n stack.unshift(hold);\n } else stack.push(hold);\n return hold;\n }\n\n /** Whether a hold above `hold` carries the element's value, which is then that hold's. */\n #covered(element: T, stack: readonly AttributeHold[], hold: AttributeHold): boolean {\n const current = element.getAttribute(this.#attribute);\n return stack.slice(stack.indexOf(hold) + 1).some((above) => above.written === current);\n }\n\n /** Leaves each owner's record of its topmost hold, or none where nothing needs one. */\n #mark(element: T, stack: readonly AttributeHold[]): void {\n const records = new Map<string, string | null>([[this.#record, null]]);\n stack.forEach((hold, index) => {\n const names = stack.slice(0, index).map((under) => under.record);\n const beneath = [...new Set(names.reverse())].filter((name) => name !== hold.record);\n const marker = hold.linked || beneath.length === 0 ? [] : [false];\n records.set(\n hold.record,\n hold.written === hold.original && beneath.length === 0 && index === stack.length - 1\n ? null\n : JSON.stringify([hold.original, hold.written, ...marker, ...beneath]),\n );\n });\n for (const [name, recorded] of records) {\n setAttributeIfChanged(element, name, recorded);\n }\n }\n\n /** Reflects only a real value transition, avoiding self-triggered mutation work. */\n #reflect(element: T, value: string | null): void {\n setAttributeIfChanged(element, this.#attribute, value);\n }\n}\n","/**\n * Whether a disabled `<fieldset>` ancestor actually reaches `control`.\n *\n * HTML exempts the contents of a fieldset's **first direct-child `<legend>`**, and\n * the exemption is per fieldset — a control legal in one legend can still be\n * disabled by a second, outer fieldset, so the walk continues upward.\n *\n * Exported on its own for callers that need the disabled-inheritance rule without\n * the rest of {@link canTakeFocus} — a control's availability check, or a `hidden`\n * walk bounded at a widget root, which is a different rule to compose with.\n */\nexport function inheritsFieldsetDisabled(control: HTMLElement): boolean {\n let fieldset: Element | null = control.closest(\"fieldset[disabled]\");\n while (fieldset) {\n const legend = Array.from(fieldset.children).find((child) => child.tagName === \"LEGEND\");\n if (!legend?.contains(control)) return true;\n fieldset = fieldset.parentElement?.closest(\"fieldset[disabled]\") ?? null;\n }\n return false;\n}\n\n/**\n * Whether the engine reports `element` assigned to no slot of the open shadow root its parent\n * hosts: such an element is not in the flat tree, so it and what it holds are rendered nowhere\n * and cannot take focus.\n */\nfunction unslotted(element: Element): boolean {\n return element.assignedSlot === null && element.parentElement?.shadowRoot != null;\n}\n\n/**\n * The parent of `element` in the flat tree: the slot it is assigned to, its parent element,\n * or the host of the shadow root it is a child of; `null` at the top of the document or of a\n * detached tree, and for an element the engine assigns to no slot of the open shadow root its\n * parent hosts, which is outside the flat tree. A closed shadow root does not report its slots,\n * so an element assigned to one climbs to the host.\n */\nexport function flatTreeParent(element: Element): Element | null {\n if (unslotted(element)) return null;\n const parent = element.assignedSlot ?? element.parentNode;\n if (parent instanceof ShadowRoot) return parent.host;\n return parent instanceof Element ? parent : null;\n}\n\n/** Whether `element` is `ancestor` or one of its descendants in the flat tree. */\nexport function flatTreeContains(ancestor: Element, element: Element | null): boolean {\n for (let node = element; node; node = flatTreeParent(node)) {\n if (node === ancestor) return true;\n }\n return false;\n}\n\n/** The nearest of `element` and its flat-tree ancestors that matches `selector`, or `null`. */\nexport function closestInFlatTree(element: Element, selector: string): Element | null {\n for (let node: Element | null = element; node; node = flatTreeParent(node)) {\n if (node.matches(selector)) return node;\n }\n return null;\n}\n\n/**\n * The children of `element` in the flat tree: its open shadow root's children, a slot's\n * assigned elements (its own children when nothing is assigned to it), or its children.\n */\nexport function flatTreeChildren(element: Element): Element[] {\n return ownedScope(element) ?? Array.from(element.children);\n}\n\n/**\n * Whether an element can actually take focus, checked **before** `focus()` runs.\n *\n * A controller that must move focus off a control it is about to disable or hide\n * picks a destination and calls `focus()` on it. If that destination cannot take\n * focus, the call **fails silently**: `hidden` and natively `disabled` elements\n * swallow it, so the caret stays in the subtree that is disappearing and lands on\n * `<body>` a frame later — the exact outcome the rescue exists to prevent, minus\n * any signal that it happened.\n *\n * Testing after the fact is the obvious alternative and is deliberately not the\n * rule. Reading `document.activeElement` back only works in a real browser, and\n * looping over candidates that way performs a real focus move per failure —\n * observable to assistive technology. Checking first costs nothing and catches\n * the cases that actually occur.\n *\n * **`aria-disabled` is not disqualifying.** It is the attribute an author uses\n * for a control that must stay *discoverable*, and the roving contract keeps\n * such items reachable. Only the conditions that make the platform refuse\n * focus are checked: `hidden` / `inert` on the element or a flat-tree ancestor\n * (the host of an open shadow root it sits in, the slot it is assigned to), the\n * element or an ancestor left out of the flat tree (one the engine assigns to no\n * slot of the open shadow root its parent hosts), `input[type=\"hidden\"]`, the\n * native `disabled` property, and `disabled` inherited from an ancestor\n * `fieldset`. CSS-only invisibility is handled by {@link isRenderedForFocus}\n * when a consumer needs sequential-focus semantics.\n *\n * Reading `:disabled` instead of walking the fieldset chain would be shorter, but\n * that pseudo-class is not evaluated consistently outside real browsers and this\n * has to be right headlessly too. happy-dom in particular focuses a `<button>`\n * inside a disabled fieldset where a real engine refuses, so the inheritance is\n * spelled out rather than delegated.\n *\n * What a consumer does when nothing survives is its own call: some fall back to\n * their landmark, while a widget whose caret already sits somewhere legitimate\n * refuses the move outright rather than relocating it.\n *\n * @example\n * ```ts\n * const target = candidates.find(canTakeFocus);\n * if (target) target.focus();\n * else {\n * this.#tabindex.lend(this.element); // nothing left: fall back to the landmark\n * this.element.focus();\n * }\n * ```\n *\n * @param element - the candidate destination\n */\nexport function canTakeFocus(element: HTMLElement): boolean {\n for (let node: Element | null = element; node; node = flatTreeParent(node)) {\n if (unslotted(node) || node.matches(\"[hidden], [inert]\")) return false;\n }\n if (element instanceof HTMLInputElement && element.type === \"hidden\") return false;\n if (!(\"disabled\" in element)) return true;\n if ((element as HTMLElement & { disabled: boolean }).disabled) return false;\n return !inheritsFieldsetDisabled(element);\n}\n\n/** Elements whose semantics or authored attributes can place them in sequential focus order. */\nexport const TAB_STOP_CANDIDATE_SELECTOR = [\n \"a[href]\",\n \"area[href]\",\n \"button\",\n \"input\",\n \"select\",\n \"textarea\",\n \"summary\",\n \"iframe\",\n \"audio[controls]\",\n \"video[controls]\",\n \"[tabindex]\",\n \"[contenteditable]\",\n].join(\",\");\n\n/** Optional browser visibility API used to exclude CSS-hidden candidates. */\ninterface VisibilityCheckable {\n checkVisibility?: (options?: { visibilityProperty?: boolean }) => boolean;\n}\n\n/** Whether CSS visibility allows an otherwise eligible element to participate in focus order. */\nexport function isRenderedForFocus(element: HTMLElement): boolean {\n const check = (element as HTMLElement & VisibilityCheckable).checkVisibility;\n return typeof check === \"function\" ? check.call(element, { visibilityProperty: true }) : true;\n}\n\n/** Parses an authored `tabindex`; invalid syntax has no explicit focus-order meaning. */\nfunction authoredTabindex(element: Element): number | null {\n const value = element.getAttribute(\"tabindex\");\n if (value === null || !/^[+-]?\\d+$/.test(value.trim())) return null;\n return Number(value);\n}\n\n/** Whether the element's native semantics place it in sequential focus order. */\nfunction hasNativeTabStop(element: HTMLElement): boolean {\n if (element instanceof HTMLAnchorElement || element instanceof HTMLAreaElement) {\n return element.hasAttribute(\"href\");\n }\n if (\n element instanceof HTMLButtonElement ||\n element instanceof HTMLSelectElement ||\n element instanceof HTMLTextAreaElement\n ) {\n return true;\n }\n if (element instanceof HTMLInputElement) return element.type !== \"hidden\";\n if (element instanceof HTMLIFrameElement) return true;\n if (element.tagName === \"AUDIO\" || element.tagName === \"VIDEO\") {\n return element.hasAttribute(\"controls\");\n }\n if (element instanceof HTMLElement && element.tagName === \"SUMMARY\") {\n const details = element.parentElement;\n return (\n details instanceof HTMLDetailsElement &&\n Array.from(details.children).find((child) => child.tagName === \"SUMMARY\") === element\n );\n }\n return false;\n}\n\n/** Whether an explicit `contenteditable` value creates an editable tab stop. */\nfunction hasEditableTabStop(element: HTMLElement): boolean {\n const value = element.getAttribute(\"contenteditable\")?.toLowerCase();\n return value === \"\" || value === \"true\" || value === \"plaintext-only\";\n}\n\n/**\n * Whether an element is a usable sequential Tab stop right now.\n *\n * Native semantics, authored `tabindex`, editable hosts, inherited disabled state,\n * HTML `hidden`/`inert`, and CSS visibility are evaluated together. `aria-disabled`\n * remains focusable because it communicates unavailability without removing the\n * control from discovery order.\n */\nexport function isTabStop(element: HTMLElement): boolean {\n if (!canTakeFocus(element) || !isRenderedForFocus(element)) return false;\n\n const tabindex = authoredTabindex(element);\n if (tabindex !== null) return tabindex >= 0;\n return hasNativeTabStop(element) || hasEditableTabStop(element);\n}\n\n/** Returns every usable sequential Tab stop below `root` in document order. */\nexport function tabStopsWithin(root: ParentNode): HTMLElement[] {\n return Array.from(root.querySelectorAll<HTMLElement>(TAB_STOP_CANDIDATE_SELECTOR)).filter(\n isTabStop,\n );\n}\n\n/** Returns the first usable sequential Tab stop below `root`, if one exists. */\nexport function firstTabStop(root: ParentNode): HTMLElement | null {\n for (const candidate of root.querySelectorAll<HTMLElement>(TAB_STOP_CANDIDATE_SELECTOR)) {\n if (isTabStop(candidate)) return candidate;\n }\n return null;\n}\n\n/** Whether `root` contains at least one usable sequential Tab stop. */\nexport function hasTabStop(root: ParentNode): boolean {\n return firstTabStop(root) !== null;\n}\n\n/** An element sequential focus navigation can stop on. */\nexport type TabStopElement = HTMLElement | SVGElement;\n\n/** Whether the element is a radio button. */\nfunction isRadio(element: Element | null): element is HTMLInputElement {\n return element instanceof HTMLInputElement && element.type === \"radio\";\n}\n\n/**\n * Whether two radios form one group: the same non-empty `name`, the same form owner and\n * the same tree. A radio without a name is a group of its own.\n */\nfunction sameRadioGroup(a: HTMLInputElement, b: HTMLInputElement): boolean {\n return (\n a.name !== \"\" && a.name === b.name && a.form === b.form && a.getRootNode() === b.getRootNode()\n );\n}\n\n/**\n * Whether the element is part of editable content: the nearest ancestor that sets a valid\n * `contenteditable` decides. `false` ends the editable region (a non-editable island\n * inside an editor); an invalid value inherits from further up.\n */\nfunction isInEditableContent(element: Element): boolean {\n for (let node = element.parentElement; node; node = node.parentElement) {\n if (node.getAttribute(\"contenteditable\")?.toLowerCase() === \"false\") return false;\n if (hasEditableTabStop(node)) return true;\n }\n return false;\n}\n\n/** The XLink namespace, where an SVG link may carry its `href`. */\nconst XLINK_NAMESPACE = \"http://www.w3.org/1999/xlink\";\n\n/** Whether the element is an SVG link: an SVG `a` with `href` or `xlink:href`. */\nfunction isSvgLink(element: Element): boolean {\n return (\n element instanceof SVGElement &&\n element.localName === \"a\" &&\n (element.hasAttribute(\"href\") || element.hasAttributeNS(XLINK_NAMESPACE, \"href\"))\n );\n}\n\n/**\n * Whether an image-map area has a rendered image: an `img` in the area's tree whose\n * `usemap` names the area's map (by `name`, or by `id` without one) and that is rendered.\n * The area has no box of its own for {@link isRenderedForFocus} to check.\n */\nfunction hasRenderedImage(area: HTMLAreaElement): boolean {\n const map = area.closest(\"map\");\n const key = map?.name || map?.id;\n if (!map || !key) return false;\n const root = map.getRootNode() as Document | ShadowRoot;\n return Array.from(root.querySelectorAll<HTMLElement>(\"img[usemap]\")).some(\n (image) => image.getAttribute(\"usemap\") === `#${key}` && isRenderedForFocus(image),\n );\n}\n\n/** Whether the element can take focus and has no negative `tabindex`. */\nfunction isFocusableInOrder(element: TabStopElement): boolean {\n const tabindex = authoredTabindex(element);\n return (tabindex === null || tabindex >= 0) && canTakeFocus(element as HTMLElement);\n}\n\n/**\n * The engine's verdict for the stops {@link isTabStop} does not judge the way sequential\n * navigation does, or `null` for every other element: an image-map area with an `href` or\n * its own `tabindex` stops while an image that uses its map is rendered; an object stops\n * while it holds a nested document, as an iframe does; an SVG link stops while it is\n * rendered. Each also needs to take focus and not be taken out of the order with a\n * negative `tabindex`.\n */\nfunction extraStop(element: TabStopElement): boolean | null {\n if (element instanceof HTMLAreaElement) {\n const focusable = element.hasAttribute(\"href\") || authoredTabindex(element) !== null;\n return focusable && isFocusableInOrder(element) && hasRenderedImage(element);\n }\n if (element instanceof HTMLObjectElement) {\n return (\n isFocusableInOrder(element) && isRenderedForFocus(element) && element.contentWindow !== null\n );\n }\n if (isSvgLink(element))\n return isFocusableInOrder(element) && isRenderedForFocus(element as HTMLElement);\n return null;\n}\n\n/**\n * Whether sequential navigation stops on the element: a usable Tab stop\n * ({@link isTabStop}), or one of the stops `extraStop` judges, except a link inside\n * editable content without a `tabindex` of its own, which the engine leaves to editing.\n * Other controls inside an editing host, and the host itself, stay stops.\n */\nfunction isSequentialStop(element: TabStopElement): boolean {\n const stop =\n extraStop(element) ??\n (element.matches(TAB_STOP_CANDIDATE_SELECTOR) && isTabStop(element as HTMLElement));\n if (!stop) return false;\n const link =\n element instanceof HTMLAnchorElement ||\n element instanceof HTMLAreaElement ||\n isSvgLink(element);\n return !(link && authoredTabindex(element) === null && isInEditableContent(element));\n}\n\n/**\n * The elements of the focus navigation scope `element` owns: its open shadow root's\n * children, or a slot's assigned elements (its fallback content when nothing is\n * assigned). `null` when it owns no scope. A closed shadow root cannot be read, so its\n * host owns none.\n */\nfunction ownedScope(element: Element): Element[] | null {\n if (element.shadowRoot) return Array.from(element.shadowRoot.children);\n if (element instanceof HTMLSlotElement) {\n const assigned = element.assignedElements();\n return assigned.length > 0 ? assigned : Array.from(element.children);\n }\n return null;\n}\n\n/** One member of a focus navigation scope: its tabindex and the stops it contributes. */\ninterface ScopeEntry {\n readonly tabindex: number;\n readonly stops: TabStopElement[];\n}\n\n/** What a walk of the order records besides the order itself. */\ninterface OrderWalk {\n /** The element a move starts from. */\n readonly from: Element | null;\n /** Every stop, in flat-tree order. */\n readonly tree: TabStopElement[];\n /**\n * How many entries of {@link OrderWalk.tree} come before `from`; `-1` until the walk\n * meets it.\n */\n fromAt: number;\n}\n\n/**\n * Orders one focus navigation scope the way HTML's sequential navigation does: members\n * with a positive `tabindex` first, ascending, ties in tree order, then the rest in tree\n * order. A member that owns a scope (a shadow host, a slot) is followed by that scope's\n * own order; one taken out of the order with a negative `tabindex` takes its scope with it.\n */\nfunction orderScope(elements: Element[], walk: OrderWalk): TabStopElement[] {\n const entries: ScopeEntry[] = [];\n const visit = (element: Element): void => {\n if (element === walk.from) walk.fromAt = walk.tree.length;\n const tabindex = authoredTabindex(element) ?? 0;\n const stop =\n (element instanceof HTMLElement || element instanceof SVGElement) && isSequentialStop(element)\n ? element\n : null;\n if (stop) walk.tree.push(stop);\n const owned = ownedScope(element);\n if (owned) {\n if (tabindex >= 0) {\n entries.push({ tabindex, stops: [...(stop ? [stop] : []), ...orderScope(owned, walk)] });\n }\n return;\n }\n if (stop) entries.push({ tabindex, stops: [stop] });\n for (const child of Array.from(element.children)) visit(child);\n };\n for (const element of elements) visit(element);\n const positive = entries.filter((entry) => entry.tabindex > 0);\n positive.sort((a, b) => a.tabindex - b.tabindex);\n const rest = entries.filter((entry) => entry.tabindex === 0);\n return [...positive, ...rest].flatMap((entry) => entry.stops);\n}\n\n/**\n * Whether a candidate passes the radio-group rule the engine applies: a checked radio\n * among the stops always does; an unchecked one only as the first radio of a group with\n * no checked stop, and not while focus is on a radio of that group. `tree` is the walk's\n * stops in flat-tree order, so a group is counted within the walked root only.\n */\nfunction passesRadioRule(\n element: TabStopElement,\n tree: TabStopElement[],\n focusedRadio: HTMLInputElement | null,\n): boolean {\n if (!isRadio(element) || element.checked) return true;\n const group = tree.filter(\n (stop): stop is HTMLInputElement =>\n stop === element || (isRadio(stop) && sameRadioGroup(stop, element)),\n );\n if (group.some((radio) => radio.checked)) return false;\n if (group[0] !== element) return false;\n return focusedRadio === null || !sameRadioGroup(focusedRadio, element);\n}\n\n/**\n * The index in `order` a move from the walk's `from` visits first. A start the walk did\n * not meet is outside: the move enters at the first stop, or the last going backward. A\n * start that is a stop moves one place along the order. Any other start (the root, an\n * element with a negative `tabindex`) moves to the nearest stop after it in tree order,\n * or before it going backward, and wraps when there is none.\n */\nfunction startIndex(\n order: TabStopElement[],\n walk: OrderWalk,\n backward: boolean,\n isStop: (element: TabStopElement) => boolean,\n): number {\n if (walk.fromAt < 0) return backward ? order.length - 1 : 0;\n const at = order.indexOf(walk.from as TabStopElement);\n if (at >= 0) return backward ? at - 1 : at + 1;\n const neighbour = backward\n ? walk.tree.slice(0, walk.fromAt).reverse().find(isStop)\n : walk.tree.slice(walk.fromAt).find(isStop);\n if (neighbour) return order.indexOf(neighbour);\n return backward ? order.length - 1 : 0;\n}\n\n/**\n * The stops below `root` in the order a sequential move from `from` visits them: the\n * next stop first (the previous one when `backward`), wrapping at the ends, with `from`\n * itself left out. Without a `from` — or with one outside `root` — the list starts at the\n * first stop, or at the last one when `backward`.\n *\n * The order is HTML's sequential navigation order within `root`: positive `tabindex`\n * first, ascending, then `tabindex=\"0\"` and native stops in tree order. Open shadow roots\n * are walked in flat-tree order, slots expanded, each scope ordered on its own; a closed\n * shadow root is not read. A radio group, counted within `root`, stops once: on its\n * checked radio when that radio can take focus, even with focus elsewhere in the group,\n * and otherwise on its first radio that can, unless focus is already in the group.\n * A link inside editable content without its own `tabindex` is not a stop. Every stop\n * also passes its applicable focusability and rendering checks.\n *\n * @param root - The element whose descendants are ordered; it is not a stop itself.\n * @param from - Where the move starts, usually {@link deepActiveElement}.\n * @param backward - Whether the move goes backward (`Shift+Tab`).\n */\nexport function sequentialTabStops(\n root: Element,\n from: Element | null = null,\n backward = false,\n): TabStopElement[] {\n const walk: OrderWalk = { from, tree: [], fromAt: from === root ? 0 : -1 };\n const order = orderScope(ownedScope(root) ?? Array.from(root.children), walk);\n const focusedRadio = walk.fromAt >= 0 && isRadio(from) ? from : null;\n const isStop = (element: TabStopElement): boolean =>\n passesRadioRule(element, walk.tree, focusedRadio);\n const start = startIndex(order, walk, backward, isStop);\n const visited = backward\n ? [...order.slice(0, start + 1).reverse(), ...order.slice(start + 1).reverse()]\n : [...order.slice(start), ...order.slice(0, start)];\n return visited.filter((element) => element !== from && isStop(element));\n}\n\n/**\n * The element that holds focus in `ownerDocument`, looking through open shadow roots:\n * `document.activeElement` stops at a shadow host. A closed shadow root cannot be read,\n * so focus inside one reads as its host.\n */\nexport function deepActiveElement(ownerDocument: Document): Element | null {\n let active = ownerDocument.activeElement;\n while (active?.shadowRoot?.activeElement) active = active.shadowRoot.activeElement;\n return active;\n}\n","/** What {@link ListenerSet.add} passes on besides the signal it supplies itself. */\nexport type ListenerOptions = Omit<AddEventListenerOptions, \"signal\">;\n\n/**\n * The event map a target's own `addEventListener` types its handlers with: the\n * window's, a document's, an HTML or SVG element's, any other element's, or a\n * media query list's. Other targets name none.\n */\ntype EventMapOf<T extends EventTarget> = T extends Window\n ? WindowEventMap\n : T extends Document\n ? DocumentEventMap\n : T extends HTMLElement\n ? HTMLElementEventMap\n : T extends SVGElement\n ? SVGElementEventMap\n : T extends Element\n ? ElementEventMap\n : T extends MediaQueryList\n ? MediaQueryListEventMap\n : Record<never, never>;\n\n/**\n * Owns every listener a controller attaches for one connected lifetime and\n * releases them together, so an event name is spelled once and the release\n * cannot drift from the registration.\n *\n * Detaching by hand repeats three things at the release site — the type, the\n * handler reference and the capture flag — and any one of them drifting leaves\n * a listener alive on an element the controller no longer drives. Aborting the\n * signal a registration was created with releases it whatever it was made of,\n * so the release site names nothing.\n *\n * One set per lifetime, held as a field and never rebuilt.\n * {@link ListenerSet.dispose} is the only thing that closes a generation, and it opens\n * the next one in the same step, so the lifecycle hooks can call `add` and\n * `dispose` in any order any number of times, and no `add` ever meets an\n * already aborted signal — a DOM that registers a listener on such a signal\n * would keep it forever. Rebuilding the set instead would leak:\n * `addEventListener` matches an existing registration on target, type, callback\n * and capture alone, so re-adding the same handler while the first registration\n * is live is discarded, and that live registration keeps the signal it was\n * attached with — a set built by a second `connect()` can never release what it\n * appears to own.\n *\n * Scope is the registration only. Timers, observers, leases and the order they\n * are unwound in stay with the controller, which places `dispose()` in its\n * cleanup sequence. A receiver that changes at runtime (a\n * swapped target) is rebound by calling `dispose()` and then `add()` again from\n * the rebind, not by a second set.\n *\n * A lifetime shorter than the connection — while a Value holds, until a first\n * load, while a subscription is open — gets a set of its own, which the end of\n * that lifetime disposes. A controller therefore holds one set per lifetime: the\n * connection's, and one for each swapped receiver or shorter span.\n *\n * The set must own every registration of a tuple it holds: a listener the same\n * target already carries for the same type, callback and capture flag keeps the\n * right to remove it, and this set's `add` for that tuple is discarded. A\n * subscription shared between instances behind a participant count, listeners of\n * several elements that come and go one at a time, and those one gesture holds\n * keep their own pair of calls or a signal of their own.\n *\n * @example\n * ```ts\n * readonly #listeners = new ListenerSet();\n *\n * connect(): void {\n * this.#listeners.add(this.element, \"submit\", this.#onNativeSubmit, { capture: true });\n * this.#listeners.add(this.element, \"turbo:submit-start\", this.#onSubmitStart);\n * this.#listeners.add(this.element, \"turbo:submit-end\", this.#onSubmitEnd);\n * }\n *\n * disconnect(): void {\n * this.#listeners.dispose();\n * }\n * ```\n */\nexport class ListenerSet {\n /** The generation every `add` joins until the next `dispose()`. */\n #abort = new AbortController();\n\n /**\n * Attaches `handler` to the open generation, exactly as the caller spelled it.\n *\n * The set supplies the signal, so `options` carries everything else the DOM\n * accepts — `capture` included. A removal by hand would have to repeat that\n * flag; aborting the signal releases the listener without it.\n *\n * A `type` the target's own event map names types `handler` with that event,\n * as the target's `addEventListener` does, so a handler written for a\n * `KeyboardEvent` is passed as it is; any other `type` takes an\n * `EventListener`.\n */\n add<T extends EventTarget, K extends keyof EventMapOf<T> & string>(\n target: T,\n type: K,\n handler: (event: EventMapOf<T>[K]) => void,\n options?: ListenerOptions,\n ): void;\n add(target: EventTarget, type: string, handler: EventListener, options?: ListenerOptions): void;\n add(target: EventTarget, type: string, handler: EventListener, options?: ListenerOptions): void {\n target.addEventListener(type, handler, { ...options, signal: this.#abort.signal });\n }\n\n /**\n * Releases every listener of the open generation, synchronously, and opens the\n * next one. Idempotent, and safe before anything has been added.\n */\n dispose(): void {\n this.#abort.abort();\n this.#abort = new AbortController();\n }\n}\n","import { ListenerSet } from \"./listener_set\";\n\n/**\n * Follows font loading completion in an element's current owner document.\n *\n * Both `loadingdone` and `loadingerror` run the supplied callback synchronously.\n * Measurement and notification policy stay with the caller. Observing the same\n * source preserves its registrations; changing the source releases the former\n * one, including when the next document has no fonts API. Each instance owns its\n * callback identity so independent watchers can safely share a callback.\n */\nexport class FontLoadWatcher {\n readonly #listeners = new ListenerSet();\n readonly #onSettled: EventListener;\n #fonts: EventTarget | null = null;\n\n /** @param run - the consumer's synchronous font-completion measurement. */\n constructor(run: () => void) {\n this.#onSettled = () => run();\n }\n\n /** Follows the element's current font source; a missing API leaves no subscription. */\n observe(element: Element): void {\n const fonts = element.ownerDocument.fonts ?? null;\n if (fonts === this.#fonts) return;\n this.disconnect();\n if (!fonts) return;\n this.#fonts = fonts;\n this.#listeners.add(fonts, \"loadingdone\", this.#onSettled);\n this.#listeners.add(fonts, \"loadingerror\", this.#onSettled);\n }\n\n /** Releases the held source synchronously; repeated calls and later observation are safe. */\n disconnect(): void {\n this.#listeners.dispose();\n this.#fonts = null;\n }\n}\n","/**\n * Runs one piece of scroll-driven work per animation frame.\n *\n * A `scroll` listener fires many times between two paints, and each firing would\n * measure the same layout. Requesting a frame on the first firing and ignoring\n * the rest until it runs keeps the reads to one per frame; running on the frame\n * — rather than on a timer — keeps the measurement in step with what the reader\n * sees.\n *\n * **The first request of a burst wins.** Work handed in while a frame is already\n * pending is dropped, so a caller that queues a special first pass and then\n * receives scrolls gets that first pass, not the last scroll's.\n *\n * Cancelling drops the pending frame outright, and does nothing at all when none\n * is pending. A frame really is cancelled, so nothing needs a generation to tell\n * a stale callback from a fresh one, and nothing has to be refused before the\n * caller starts listening.\n *\n * Scope is the scheduling only. What to measure stays with the caller.\n *\n * @example\n * ```ts\n * readonly #frames = new FrameCoalescer();\n *\n * readonly #onScroll = (): void => this.#frames.schedule(() => this.#measure());\n *\n * disconnect(): void {\n * this.#frames.cancel();\n * }\n * ```\n */\nexport class FrameCoalescer {\n #frame: number | null = null;\n\n /**\n * Runs `run` on the next frame, unless a frame is already pending — the first\n * request of a burst wins and the rest are dropped. The pending frame is\n * released before `run`, so `run` may request the next one.\n */\n schedule(run: () => void): void {\n if (this.#frame !== null) return;\n this.#frame = requestAnimationFrame(() => {\n this.#frame = null;\n run();\n });\n }\n\n /**\n * Drops the pending frame, and reaches the platform only when there is one.\n *\n * There is no handle value that stands for \"nothing pending\":\n * `cancelAnimationFrame` takes an `unsigned long`, so a negative placeholder\n * arrives as a large positive number that the same allocator can hand out, and\n * an idle cancel would then drop a frame belonging to someone else.\n */\n cancel(): void {\n if (this.#frame === null) return;\n cancelAnimationFrame(this.#frame);\n this.#frame = null;\n }\n}\n","/**\n * Unified layout observation for Stimeo controllers.\n *\n * Widgets whose output is measured — an overflow boundary, a masonry column count,\n * an autosized textarea — have three sources that move the layout under them: their\n * *own* box changing — via {@link ResizeObserver} — the *viewport* changing — via the\n * `window` `resize` event — and a descendant *resource settling*, because an image or\n * a frame reports a height of zero until it has loaded. Wiring those three by hand in\n * every controller risks leaked listeners on `disconnect()`. {@link LayoutObserver}\n * owns all three behind one callback and one\n * {@link LayoutObserver.disconnect | disconnect()} that releases everything.\n *\n * Behavior only: the helper reports *that* layout changed; it never reads or\n * writes styles. Consumers decide what to recompute.\n */\n\n/** Invoked whenever an observed element or the viewport changes size. */\nexport type LayoutCallback = () => void;\n\n/** Constructs a {@link ResizeObserver}; injectable so tests stay deterministic. */\nexport type ResizeObserverFactory = (callback: ResizeObserverCallback) => ResizeObserver;\n\n/** Options for {@link LayoutObserver}. */\nexport interface LayoutObserverOptions {\n /**\n * Factory for the {@link ResizeObserver} used by {@link LayoutObserver.observe}.\n * Defaults to the global constructor; override it in tests, or to no-op in\n * environments where `ResizeObserver` is unavailable.\n */\n resizeObserverFactory?: ResizeObserverFactory;\n}\n\n/**\n * Observes element resizes and/or viewport resizes through a single callback,\n * with guaranteed teardown.\n *\n * @example\n * ```ts\n * #layout = new LayoutObserver(() => this.#reposition());\n *\n * connect() {\n * this.#layout.observe(this.panelTarget);\n * this.#layout.observeViewport();\n * this.#layout.observeDescendantLoads(this.panelTarget);\n * }\n *\n * disconnect() {\n * this.#layout.disconnect();\n * }\n * ```\n */\nexport class LayoutObserver {\n readonly #callback: LayoutCallback;\n readonly #resizeObserverFactory: ResizeObserverFactory | null;\n #resizeObserver: ResizeObserver | null = null;\n #observingViewport = false;\n #loadContainer: Element | null = null;\n\n /** Stable bound handler so add/removeEventListener target the same reference. */\n readonly #handleViewportResize = (): void => {\n this.#callback();\n };\n\n /** Stable bound handler for the capture-phase `load`; see {@link observeDescendantLoads}. */\n readonly #handleDescendantLoad = (): void => {\n this.#callback();\n };\n\n constructor(callback: LayoutCallback, options: LayoutObserverOptions = {}) {\n this.#callback = callback;\n this.#resizeObserverFactory =\n options.resizeObserverFactory ??\n (typeof ResizeObserver === \"undefined\" ? null : (cb) => new ResizeObserver(cb));\n }\n\n /**\n * Starts observing an element's size. Repeated calls observe additional\n * elements through the same shared observer. No-ops when no\n * `ResizeObserver` implementation is available.\n */\n observe(element: Element): void {\n if (!this.#resizeObserverFactory) return;\n if (!this.#resizeObserver) {\n this.#resizeObserver = this.#resizeObserverFactory(() => {\n this.#callback();\n });\n }\n this.#resizeObserver.observe(element);\n }\n\n /** Stops observing a single element while leaving any others in place. */\n unobserve(element: Element): void {\n this.#resizeObserver?.unobserve(element);\n }\n\n /** Starts observing viewport resizes. Idempotent: the listener is added once. */\n observeViewport(): void {\n if (this.#observingViewport) return;\n this.#observingViewport = true;\n window.addEventListener(\"resize\", this.#handleViewportResize);\n }\n\n /** Stops observing viewport resizes without affecting element observation. */\n unobserveViewport(): void {\n if (!this.#observingViewport) return;\n this.#observingViewport = false;\n window.removeEventListener(\"resize\", this.#handleViewportResize);\n }\n\n /**\n * Starts reporting a `load` from anywhere inside `container` — an image or a\n * frame settling changes the box it sits in, and it measures as zero high until\n * then. `load` does not bubble, so the subscription is a capture-phase listener\n * on the container itself and nothing the caller spells.\n *\n * **One container at a time.** A further call moves the observation, so a widget\n * whose content element is swapped at runtime releases the element it let go by\n * naming the new one — there is no second place for the release to drift from.\n */\n observeDescendantLoads(container: Element): void {\n this.unobserveDescendantLoads();\n this.#loadContainer = container;\n container.addEventListener(\"load\", this.#handleDescendantLoad, true);\n }\n\n /** Stops reporting descendant loads without affecting element or viewport observation. */\n unobserveDescendantLoads(): void {\n this.#loadContainer?.removeEventListener(\"load\", this.#handleDescendantLoad, true);\n this.#loadContainer = null;\n }\n\n /**\n * Releases every observation: disconnects the {@link ResizeObserver} and removes\n * the viewport and descendant-load listeners. Safe to call multiple times. Call\n * this from a controller's `disconnect()`.\n */\n disconnect(): void {\n this.#resizeObserver?.disconnect();\n this.#resizeObserver = null;\n this.unobserveViewport();\n this.unobserveDescendantLoads();\n }\n}\n","/** Normalized scroll position and maximum distance on one logical axis. */\nexport interface LogicalScrollMetrics {\n position: number;\n max: number;\n}\n\n/**\n * Whether horizontal scrolling on `element` follows right-to-left inline flow.\n *\n * Resolved from the **computed** `direction`, so the authoring contract is the\n * usual `dir=\"rtl\"` (or a stylesheet) on the element or any ancestor.\n *\n * Scope: horizontal writing modes. A vertical writing mode (`writing-mode:\n * vertical-rl`) also inverts the horizontal axis, which this check does not\n * model — vertical writing modes are out of scope for the scroll utilities\n * (their consumers describe axes as horizontal/vertical, not inline/block).\n */\nexport function isRtl(element: Element): boolean {\n return window.getComputedStyle(element).direction === \"rtl\";\n}\n\n/**\n * Returns scroll distance from the logical start edge.\n *\n * CSSOM View exposes standards-mode RTL horizontal offsets as `0` at the inline\n * start (right) and increasingly negative values toward the inline end (left).\n * The normalized position is always clamped to `[0, max]`, which also absorbs\n * Safari's elastic overscroll values.\n */\nexport function logicalScrollMetrics(\n element: HTMLElement,\n horizontal: boolean,\n): LogicalScrollMetrics {\n const max = Math.max(\n 0,\n horizontal\n ? element.scrollWidth - element.clientWidth\n : element.scrollHeight - element.clientHeight,\n );\n const raw = horizontal ? element.scrollLeft : element.scrollTop;\n const position = horizontal && isRtl(element) ? -raw : raw;\n return { position: Math.min(max, Math.max(0, position)), max };\n}\n\n/**\n * Converts a logical start/end delta to the physical value accepted by\n * `Element.scrollBy`.\n */\nexport function physicalScrollDelta(\n element: HTMLElement,\n horizontal: boolean,\n logicalDelta: number,\n): number {\n return horizontal && isRtl(element) ? -logicalDelta : logicalDelta;\n}\n","/**\n * Collapses many Stimulus lifecycle callbacks from one DOM mutation into a\n * single pass.\n *\n * Stimulus fires `<name>TargetConnected` / `Disconnected` once per element and\n * `<name>ValueChanged` once per changed attribute. Replacing a list of N options\n * or morphing several render Values therefore delivers N callbacks — but the\n * useful unit of work is \"reconcile against the resulting declarative input\",\n * once, after the batch has settled. Every controller with reconcilable targets\n * or render Values needs the same shape: a `queued` flag plus `queueMicrotask`.\n *\n * **A microtask is the right horizon, and the reason is specific.** Stimulus\n * drives these callbacks from a `MutationObserver`, whose own callback already\n * runs as a microtask with the whole batch in hand; scheduling one more lands\n * after the last sibling callback of that batch and still before paint or any\n * event handler. A timer would be later than it needs to be, and reconciling\n * synchronously would run once per element against a half-applied DOM.\n *\n * **The two guards are not the same guard.** Scheduling is refused before the\n * controller connects, and running is refused after it disconnects:\n *\n * - **Before `connect()`** — Stimulus delivers initial target and Value callbacks\n * ahead of `connect()`. Reconciling there would compute output against a\n * controller whose own state has not been initialised, and `connect()` is\n * about to do a full pass anyway.\n * - **After `disconnect()`** — Stimulus fires a callback for **every** target\n * during teardown, and a microtask queued just before it would otherwise run\n * against a detached tree. {@link MicrotaskCoalescer.cancel} exists for the\n * teardown path to drop the pending pass outright.\n *\n * Both guards are part of one contract here rather than something each consumer\n * has to remember separately.\n *\n * Scope is the scheduling only. *What* to reconcile — keep the surviving active\n * option, fall back to the next / previous / first visible one, rebuild derived\n * chips or hidden fields — stays in the controller, because no two consumers\n * answer it the same way.\n *\n * @example\n * ```ts\n * readonly #reconcile = new MicrotaskCoalescer(() => this.#reconcileOptions());\n *\n * connect() { this.#reconcile.activate(); }\n * disconnect() { this.#reconcile.cancel(); }\n *\n * optionTargetConnected() { this.#reconcile.schedule(); }\n * optionTargetDisconnected() { this.#reconcile.schedule(); }\n * ```\n */\nexport class MicrotaskCoalescer {\n readonly #run: () => void;\n #queued = false;\n #active = false;\n #generation = 0;\n\n /** @param run - the single reconciliation pass, invoked at most once per batch. */\n constructor(run: () => void) {\n this.#run = run;\n }\n\n /** Opens the window in which {@link schedule} is honoured; call from `connect()`. */\n activate(): void {\n this.#active = true;\n }\n\n /** Closes the window and drops any pending pass; call from `disconnect()`. */\n cancel(): void {\n this.#active = false;\n this.#queued = false;\n this.#generation += 1;\n }\n\n /** Whether a requested pass has yet to run. */\n get pending(): boolean {\n return this.#queued;\n }\n\n /** Requests one pass after the batch settles. Idempotent; inert outside the window. */\n schedule(): void {\n if (!this.#active || this.#queued) return;\n this.#queued = true;\n const generation = this.#generation;\n queueMicrotask(() => {\n // A cancelled callback must not consume a pass queued after reconnect.\n if (generation !== this.#generation || !this.#queued || !this.#active) return;\n this.#queued = false;\n this.#run();\n });\n }\n}\n","import { ListenerSet } from \"./listener_set\";\nimport { MicrotaskCoalescer } from \"./microtask_coalescer\";\n\n/**\n * Coalesces retained-element morphs and explicit lifecycle requests into one pass.\n *\n * Observe the controller's element after its initial state is settled. Morphs on\n * that element and bubbling morphs on its descendants share the same microtask\n * as {@link schedule}. The callback repairs derived output; the controller owns\n * any logical transition reporting. {@link disconnect} releases the listener and\n * cancels pending work, including work from an earlier connected lifetime.\n */\nexport class MorphRenderWatcher {\n readonly #listeners = new ListenerSet();\n readonly #pass: MicrotaskCoalescer;\n #element: Element | null = null;\n readonly #onMorph = (): void => this.#pass.schedule();\n\n /** @param run - the single pass that repairs the settled controller's output. */\n constructor(run: () => void) {\n this.#pass = new MicrotaskCoalescer(run);\n }\n\n /** Opens observation; observing the same element again preserves queued work. */\n observe(element: Element): void {\n if (this.#element === element) return;\n this.disconnect();\n this.#element = element;\n this.#pass.activate();\n this.#listeners.add(element, \"turbo:morph-element\", this.#onMorph);\n }\n\n /** Requests one pass; requests outside an observed lifetime are ignored. */\n schedule(): void {\n this.#pass.schedule();\n }\n\n /** Whether a pass requested by a morph or {@link schedule} has yet to run. */\n get pending(): boolean {\n return this.#pass.pending;\n }\n\n /** Releases observation and pending work synchronously; safe to repeat. */\n disconnect(): void {\n this.#listeners.dispose();\n this.#pass.cancel();\n this.#element = null;\n }\n}\n","import { setAttributeIfChanged } from \"./attribute_write\";\nimport { sharedRegistry } from \"./shared_registry\";\n\n/** What a lease's record says: the authored declaration, the last write and the leases beneath. */\ninterface StylePropertyLeaseRecord {\n readonly originalValue: string;\n readonly originalPriority: string;\n readonly writtenValue: string | null;\n readonly writtenPriority: string;\n /** Whether it hands back what the lease right beneath it wrote last. */\n readonly linked: boolean;\n /** The records of the other owners' leases beneath it, nearest first. */\n readonly beneath: readonly string[];\n}\n\n/** One lease's hold on one element's property, in the stack every lease of it shares. */\ninterface StyleHold {\n /** The lease holding it; `null` for a hold read from a copy's record until its lease takes it. */\n lease: object | null;\n readonly record: string;\n writtenValue: string | null;\n writtenPriority: string;\n /** What it hands back with nothing beneath it: the author's declaration. */\n readonly originalValue: string;\n readonly originalPriority: string;\n /** Whether it hands back what the hold beneath it wrote last instead. */\n linked: boolean;\n}\n\n/** The holds on each element by property, and every lease's record name by property. */\ninterface StylePropertyLeaseRegistry {\n readonly stacks: WeakMap<HTMLElement, Map<string, StyleHold[]>>;\n readonly names: Map<string, Set<string>>;\n}\n\n/**\n * Temporarily controls one inline CSS property across a changing set of elements.\n *\n * Authored value and priority are restored only while the declaration still matches\n * the last leased write. A later consumer write therefore wins.\n *\n * **Every lease of a property shares one stack of holds per element**, whatever its owner\n * and whichever file of the package constructed it (the stacks are one per page): the holds\n * sit in the order their leases first wrote the element, each with the declaration it wrote\n * last. The element's declaration is the highest hold's that carries it, and the page's when\n * none does. A write reaches the element unless a hold above the writer carries the element's\n * declaration, so the top hold always shows its writes and the page's declaration gives way to\n * the next write of any hold. A return gives a declaration back only from the hold the\n * element's declaration is: the one the hold beneath it wrote last, or the author's once\n * nothing is beneath it; any other return only leaves the stack. Holds that wrote the same\n * declaration are told apart by the stack: the higher one keeps it. A first write over a top\n * hold whose declaration the page has replaced takes the element's declaration as the\n * author's. Two instances of one controller that write the same property on\n * `document.documentElement` stack the same way.\n *\n * **The stack travels with the element.** While a hold carries a declaration other than the\n * author's, lies on another hold or is covered by one, the element carries its owner's record\n * `data-<owner>-style-<property>-lease`: JSON of the author's value and priority, the value\n * and priority the hold wrote last (`null` for a removal), `false` where the hold hands back\n * the author's declaration rather than the latest one of the hold beneath it, and the records\n * of every hold beneath it, nearest first. Returning the last lease of an owner removes its\n * record. A copy of the element — a page Turbo restores from its cache — therefore carries the\n * stack, read back under the record names of the leases constructed so far and ordered by the\n * records each hold lists beneath it, and each lease takes the hold its owner's record\n * describes over in place. Complete records for distinct owners preserve their order across\n * a copy. Records describe owners, not instances: one owner holding the element more than\n * once leaves only its topmost hold's record, which the first of its leases to write or return\n * on the copy takes. Its lower holds and positions are absent; mutually listed owners cannot\n * express their full live order. A hold that showed the author's declaration alone carries\n * no record and is taken by its first write on the copy. Missing or unreadable records also\n * leave their holds unknown, so copying the DOM does not promise identical decisions for\n * every live stack. A new stack with no readable record takes the current declaration as the\n * author's; a morph can remove records while existing holds remain in memory until returned.\n *\n * The lease has no lifecycle of its own, so it never subscribes to document events.\n */\nexport class StylePropertyLease<T extends HTMLElement = HTMLElement> {\n /** The holds on each element, bottom first, and the record names; one per page. */\n static readonly #registry = sharedRegistry(\n \"stimeo-ui.style-property-lease.registry.v1\",\n (): StylePropertyLeaseRegistry => ({ stacks: new WeakMap(), names: new Map() }),\n );\n readonly #property: string;\n readonly #record: string;\n readonly #held = new Set<T>();\n\n /**\n * @param property - The CSS property whose temporary values this lease owns.\n * @param owner - Names the record on the element; the controller's identifier.\n */\n constructor(property: string, owner: string) {\n this.#property = property;\n this.#record = `data-${owner}-style-${property}-lease`;\n const names = StylePropertyLease.#registry.names;\n names.set(property, (names.get(property) ?? new Set<string>()).add(this.#record));\n }\n\n /** Writes or removes the leased declaration while preserving its authored value. */\n write(element: T, value: string | null, priority = \"\"): void {\n const stack = this.#stack(element);\n const hold = this.#take(stack) ?? this.#acquire(element, stack);\n this.#held.add(element);\n const shows = !this.#covered(element, stack, hold);\n hold.writtenValue = value;\n hold.writtenPriority = value === null ? \"\" : priority;\n this.#mark(element, stack);\n if (shows) this.#show(element, value, hold.writtenPriority);\n }\n\n /**\n * Returns one lease, also on a restored copy, to the declaration the hold beneath it wrote\n * last or the author's, without overwriting a declaration a consumer wrote since.\n */\n return(element: T): void {\n const held = this.#held.delete(element);\n const known = StylePropertyLease.#registry.stacks.get(element)?.has(this.#property);\n const stack = held || known || element.hasAttribute(this.#record) ? this.#stack(element) : [];\n const hold = this.#take(stack);\n if (!hold) return;\n const owns = this.#carries(element, hold) && !this.#covered(element, stack, hold);\n const index = stack.indexOf(hold);\n stack.splice(index, 1);\n const above = stack[index];\n if (above) above.linked &&= hold.linked;\n this.#mark(element, stack);\n if (!owns) return;\n const below = hold.linked ? stack[index - 1] : undefined;\n if (below) this.#show(element, below.writtenValue, below.writtenPriority);\n else this.#show(element, hold.originalValue, hold.originalPriority);\n }\n\n /** Returns every outstanding declaration lease. */\n returnAll(): void {\n for (const element of Array.from(this.#held)) this.return(element);\n }\n\n /** The record `name` on `element`, or `null` when it is none a lease could write. */\n #recorded(element: T, name: string): StylePropertyLeaseRecord | null {\n try {\n const parsed: unknown = JSON.parse(element.getAttribute(name) ?? \"null\");\n if (!Array.isArray(parsed)) return null;\n const [originalValue, originalPriority, writtenValue, writtenPriority, ...rest] =\n parsed as unknown[];\n if (typeof originalValue !== \"string\" || typeof originalPriority !== \"string\") return null;\n if (typeof writtenValue !== \"string\" && writtenValue !== null) return null;\n if (typeof writtenPriority !== \"string\") return null;\n const linked = rest[0] !== false;\n const beneath = linked ? rest : rest.slice(1);\n if (!beneath.every((under): under is string => typeof under === \"string\")) return null;\n return { originalValue, originalPriority, writtenValue, writtenPriority, linked, beneath };\n } catch {\n return null;\n }\n }\n\n /** The element's stack, read from its records the first time. */\n #stack(element: T): StyleHold[] {\n const stacks = StylePropertyLease.#registry.stacks;\n const byProperty = stacks.get(element) ?? new Map<string, StyleHold[]>();\n stacks.set(element, byProperty);\n const stack = byProperty.get(this.#property) ?? this.#seed(element);\n byProperty.set(this.#property, stack);\n return stack;\n }\n\n /** The holds a copy's records describe, each above every hold its record lists beneath. */\n #seed(element: T): StyleHold[] {\n const found: (StylePropertyLeaseRecord & { readonly record: string })[] = [];\n for (const record of StylePropertyLease.#registry.names.get(this.#property) ?? []) {\n const read = this.#recorded(element, record);\n if (read) found.push({ ...read, record });\n }\n const depth = ({ beneath }: (typeof found)[number]) =>\n beneath.filter((name) => found.some((other) => other.record === name)).length;\n return found\n .sort((one, other) => depth(one) - depth(other))\n .map((entry, index) => ({\n lease: null,\n record: entry.record,\n writtenValue: entry.writtenValue,\n writtenPriority: entry.writtenPriority,\n originalValue: entry.originalValue,\n originalPriority: entry.originalPriority,\n linked: entry.linked && index > 0,\n }));\n }\n\n /** Its hold in `stack`, taking over one read from its record. */\n #take(stack: StyleHold[]): StyleHold | undefined {\n const hold =\n stack.find((held) => held.lease === this) ??\n stack.find((held) => held.lease === null && held.record === this.#record);\n if (hold) hold.lease = this;\n return hold;\n }\n\n /** A new hold on top, over the top hold while the element carries its declaration. */\n #acquire(element: T, stack: StyleHold[]): StyleHold {\n const top = stack.at(-1);\n const over = top && this.#carries(element, top) ? top : undefined;\n const style = element.style;\n const hold: StyleHold = {\n lease: this,\n record: this.#record,\n writtenValue: null,\n writtenPriority: \"\",\n originalValue: over ? over.originalValue : style.getPropertyValue(this.#property),\n originalPriority: over ? over.originalPriority : style.getPropertyPriority(this.#property),\n linked: over !== undefined,\n };\n stack.push(hold);\n return hold;\n }\n\n /** Whether a hold above `hold` carries the element's declaration, then that hold's. */\n #covered(element: T, stack: readonly StyleHold[], hold: StyleHold): boolean {\n return stack.slice(stack.indexOf(hold) + 1).some((above) => this.#carries(element, above));\n }\n\n /** Leaves each owner's record of its topmost hold, or none where nothing needs one. */\n #mark(element: T, stack: readonly StyleHold[]): void {\n const records = new Map<string, string | null>([[this.#record, null]]);\n stack.forEach((hold, index) => {\n const names = stack.slice(0, index).map((under) => under.record);\n const beneath = [...new Set(names.reverse())].filter((name) => name !== hold.record);\n const marker = hold.linked || beneath.length === 0 ? [] : [false];\n const { originalValue, originalPriority, writtenValue, writtenPriority } = hold;\n records.set(\n hold.record,\n (writtenValue ?? \"\") === originalValue &&\n writtenPriority === originalPriority &&\n beneath.length === 0 &&\n index === stack.length - 1\n ? null\n : JSON.stringify([\n originalValue,\n originalPriority,\n writtenValue,\n writtenPriority,\n ...marker,\n ...beneath,\n ]),\n );\n });\n for (const [name, recorded] of records) {\n setAttributeIfChanged(element, name, recorded);\n }\n }\n\n /** Whether the element carries the declaration `hold` wrote last. */\n #carries(element: T, hold: StyleHold): boolean {\n return this.#holds(element, hold.writtenValue ?? \"\", hold.writtenPriority);\n }\n\n /** Whether the inline declaration is `value` with `priority`. */\n #holds(element: T, value: string, priority: string): boolean {\n const style = element.style;\n return (\n style.getPropertyValue(this.#property) === value &&\n style.getPropertyPriority(this.#property) === priority\n );\n }\n\n /** Writes the declaration, or removes it for `null`, unless the element already carries it. */\n #show(element: T, value: string | null, priority: string): void {\n if (this.#holds(element, value ?? \"\", priority)) return;\n if (value === null) element.style.removeProperty(this.#property);\n else element.style.setProperty(this.#property, value, priority);\n }\n}\n","/** Queries physical descendants and nested open shadow trees, including `root`'s own. */\nexport function queryOpenDescendants<T extends Element = Element>(\n root: ParentNode,\n selector: string,\n): T[] {\n const matches: T[] = [];\n const roots: ParentNode[] = [root];\n for (const scope of roots) {\n matches.push(...scope.querySelectorAll<T>(selector));\n if (scope.nodeType === Node.ELEMENT_NODE) {\n const shadow = (scope as Element).shadowRoot;\n if (shadow) roots.push(shadow);\n }\n for (const element of scope.querySelectorAll(\"*\")) {\n if (element.shadowRoot) roots.push(element.shadowRoot);\n }\n }\n return matches;\n}\n","import { setAttributeIfChanged } from \"./attribute_write\";\nimport { deepActiveElement } from \"./focus_candidate\";\nimport { queryOpenDescendants } from \"./query_open_descendants\";\nimport { sharedRegistry } from \"./shared_registry\";\n\n/** One loan's hold on one element's `tabindex`, in the stack every loan of it shares. */\ninterface LoanHold {\n /** The loan holding it; `null` for a loan read from a copy's record until a loan takes it. */\n loan: object | null;\n readonly record: string;\n readonly value: string;\n /** Whether it hands back the value of the hold beneath it; otherwise no `tabindex`. */\n linked: boolean;\n}\n\n/** The loans on each element, bottom first, and every loan's record name. */\ninterface TabindexLoanRegistry {\n readonly stacks: WeakMap<HTMLElement, LoanHold[]>;\n readonly names: Set<string>;\n}\n\n/** Focus can be retargeted to a shadow host rather than exposed on the document. */\nfunction holdsFocus(element: HTMLElement): boolean {\n return element.matches(\":focus\") || deepActiveElement(element.ownerDocument) === element;\n}\n\n/**\n * Shared bookkeeping for a `tabindex` a controller lends an element temporarily.\n *\n * A controller that must move focus somewhere the author never made focusable\n * (a landmark root, a scroll destination) reaches for the same trick: add a\n * `tabindex` just-in-time and hand it back once it is no longer needed. The\n * borrow is the easy half; the return is what the two conditions below are for.\n *\n * **Returning needs two conditions, not one.** Owning the borrow is not enough:\n * the attribute must also still hold the value this instance wrote. A consumer\n * that changed it afterwards — `tabindex=\"0\"` to make the root its own Tab stop\n * — owns it now, and removing it there silently discards authored markup. The\n * bookkeeping is dropped when returned. With `preserveFocus`, a focused element\n * still showing this loan keeps its hold and record until a later return can finish.\n *\n * **Never borrow over a value no loan holds.** An element whose `tabindex` no loan\n * holds — the author's, or one the page wrote over the loans — is the author's to\n * control, so there is nothing to lend and nothing to return.\n *\n * **Every loan of an element shares one stack of loans**, whatever its owner and\n * whichever file of the package constructed it (the stacks are one per page). A loan\n * lends over the loans that hold the element while its `tabindex` is theirs — sharing\n * their value, or covering it with its own — and lends again where the page removed\n * the `tabindex`. The `tabindex` is the highest loan's that lends its value: returning\n * that loan gives the element the value of the loan beneath it, or no `tabindex`, and\n * any other return only leaves the stack. So two loans of one value — every focus trap\n * lends its container under one owner — keep it until the last of them returns, and a\n * loan lent after the page removed an earlier one's `tabindex` keeps it when the\n * earlier one returns.\n *\n * **A loan is recorded on the element.** Lending writes\n * `data-<owner>-tabindex-loan` holding the value the owner's topmost loan lends next\n * to the `tabindex`, and the owner's last loan to end removes it. A copy of the\n * element — a page Turbo restores from its cache is one — so tells its owners' loans\n * from an authored `tabindex`: `lend()` takes over a loan its owner recorded, and\n * `reclaim()` gives back one no loan has taken over; the `tabindex` goes with the last\n * of them. A copy keeps no order of its loans beyond putting those of the value it\n * carries on top. Without a record a `tabindex` is the author's. Nothing returns a\n * live loan before Turbo caches the page: `turbo:before-cache` also fires on pages\n * that stay, and the loan is still in use there.\n *\n * The registry is keyed by element, so a controller borrowing on a single\n * element (`this.element`) and one borrowing across a changing set of targets\n * use the same API — the single-element case is a set of one. It holds no\n * opinion about *when* to borrow or where focus goes next; that stays in the\n * controller.\n *\n * **The API is deliberately small.** Each consumer entry includes its own copy\n * of the class, so unused methods still increase its runtime output.\n *\n * @example\n * ```ts\n * readonly #tabindex = new TabindexLoan(\"-1\", this.identifier);\n *\n * connect() {\n * this.#tabindex.reclaim(this.element);\n * }\n *\n * #rescueFocus() {\n * this.#tabindex.lend(this.element);\n * this.element.focus();\n * }\n *\n * disconnect() {\n * this.#tabindex.returnAll();\n * }\n * ```\n */\nexport class TabindexLoan<T extends HTMLElement = HTMLElement> {\n /** The loans on each element and the record names, one per page. */\n static readonly #registry = sharedRegistry(\n \"stimeo-ui.tabindex-loan.registry.v1\",\n (): TabindexLoanRegistry => ({ stacks: new WeakMap(), names: new Set() }),\n );\n readonly #value: string;\n readonly #record: string;\n readonly #preserveFocus: boolean;\n readonly #lent = new Set<T>();\n\n /**\n * @param value - the `tabindex` to lend. `\"-1\"` is programmatically focusable but\n * not a Tab stop; `\"0\"` is a real Tab stop, which a scroll region with no\n * focusable content of its own needs.\n * @param owner - Names the record on the element; the controller's identifier.\n * @param options - `preserveFocus`: keep a shown loan while its element holds focus.\n */\n constructor(value: string, owner: string, options: { readonly preserveFocus?: boolean } = {}) {\n this.#value = value;\n this.#record = `data-${owner}-tabindex-loan`;\n this.#preserveFocus = options.preserveFocus === true;\n TabindexLoan.#registry.names.add(this.#record);\n }\n\n /**\n * Lends `element` the value over the loans holding its `tabindex`, or where the page removed\n * it; a `tabindex` no loan holds is left alone, and a loan recorded on a copy taken over.\n * `onlyIfUnfocusable` starts no new loan on an element that carries any `tabindex` or is\n * natively focusable (a `tabIndex` of `0` or more).\n */\n lend(element: T, options: { readonly onlyIfUnfocusable?: boolean } = {}): void {\n const stack = this.#stack(element);\n const current = element.getAttribute(\"tabindex\");\n const held =\n stack.find((hold) => hold.loan === this) ??\n stack.find(\n (hold) => hold.loan === null && hold.record === this.#record && hold.value === this.#value,\n );\n const linked = stack.at(-1)?.value === current;\n if (!held && options.onlyIfUnfocusable && (current !== null || element.tabIndex >= 0)) return;\n if (!held && current !== null && !linked) return;\n this.#lent.add(element);\n if (held) held.loan = this;\n else stack.push({ loan: this, record: this.#record, value: this.#value, linked });\n this.#mark(element, stack);\n if (current === null || (!held && current !== this.#value)) {\n element.setAttribute(\"tabindex\", this.#value);\n }\n }\n\n /** Returns one live or restored loan, retaining a focus-protected hold for a later return. */\n return(element: T): boolean {\n const stack = this.#stack(element);\n const hold =\n stack.find((held) => held.loan === this) ??\n stack.find(\n (held) => held.loan === null && held.record === this.#record && held.value === this.#value,\n );\n if (!hold) return false;\n if (!this.#release(element, stack, hold, this.#preserveFocus)) {\n hold.loan = this;\n this.#lent.add(element);\n return false;\n }\n this.#lent.delete(element);\n return true;\n }\n\n /** Returns every loan, retaining focus-protected ones even outside the current target set. */\n returnAll(): void {\n for (const element of Array.from(this.#lent)) this.return(element);\n }\n\n /**\n * Gives back a loan its owner recorded on a restored copy that no loan has taken over, unless\n * the record holds another value or the element holds focus.\n */\n reclaim(element: HTMLElement): void {\n if (element.getAttribute(this.#record) !== this.#value) return;\n const stack = this.#stack(element);\n const hold = stack.find((held) => held.loan === null && held.record === this.#record);\n if (hold && !holdsFocus(element)) this.#release(element, stack, hold);\n }\n\n /** Gives back, as {@link reclaim} does, every loan of its owner recorded inside `root`. */\n reclaimWithin(root: ParentNode): void {\n for (const element of queryOpenDescendants<HTMLElement>(root, `[${this.#record}]`)) {\n this.reclaim(element);\n }\n }\n\n /** The element's loans, read from its records the first time. */\n #stack(element: HTMLElement): LoanHold[] {\n const stacks = TabindexLoan.#registry.stacks;\n const stack = stacks.get(element) ?? this.#seed(element);\n stacks.set(element, stack);\n return stack;\n }\n\n /** The loans a copy's records describe, those of the value it carries on top. */\n #seed(element: HTMLElement): LoanHold[] {\n const current = element.getAttribute(\"tabindex\");\n const holds: LoanHold[] = [];\n for (const record of TabindexLoan.#registry.names) {\n const value = element.getAttribute(record);\n if (value !== null) holds.push({ loan: null, record, value, linked: true });\n }\n holds.sort((one, other) => Number(one.value === current) - Number(other.value === current));\n for (const [index, hold] of holds.entries()) hold.linked = index > 0;\n return holds;\n }\n\n /** Takes `hold` off, handing the value it shows to the loan beneath. */\n #release(\n element: HTMLElement,\n stack: LoanHold[],\n hold: LoanHold,\n preserveFocus = false,\n ): boolean {\n const current = element.getAttribute(\"tabindex\");\n const index = stack.indexOf(hold);\n const owns =\n current === hold.value && !stack.slice(index + 1).some((above) => above.value === current);\n if (owns && preserveFocus && holdsFocus(element)) return false;\n stack.splice(index, 1);\n const above = stack[index];\n if (above) above.linked &&= hold.linked;\n this.#mark(element, stack);\n if (!owns) return true;\n const below = hold.linked ? stack[index - 1] : undefined;\n if (!below) element.removeAttribute(\"tabindex\");\n else if (below.value !== current) element.setAttribute(\"tabindex\", below.value);\n return true;\n }\n\n /** Leaves each owner's record of the value its topmost loan lends. */\n #mark(element: HTMLElement, stack: readonly LoanHold[]): void {\n const records = new Map<string, string | null>([[this.#record, null]]);\n for (const hold of stack) records.set(hold.record, hold.value);\n for (const [name, recorded] of records) {\n setAttributeIfChanged(element, name, recorded);\n }\n }\n}\n","import { Controller } from \"@hotwired/stimulus\";\nimport { AttributeLease } from \"../utils/attribute_lease\";\nimport { hasTabStop } from \"../utils/focus_candidate\";\nimport { FontLoadWatcher } from \"../utils/font_load_watcher\";\nimport { FrameCoalescer } from \"../utils/frame_coalescer\";\nimport { LayoutObserver } from \"../utils/layout_observer\";\nimport { ListenerSet } from \"../utils/listener_set\";\nimport { logicalScrollMetrics } from \"../utils/logical_scroll\";\nimport { MorphRenderWatcher } from \"../utils/morph_render_watcher\";\nimport { StylePropertyLease } from \"../utils/style_property_lease\";\nimport { TabindexLoan } from \"../utils/tabindex_loan\";\n\n/** Distance from an edge (px) treated as fully reached; absorbs sub-pixel scroll. */\nconst EDGE_EPSILON = 1;\n\ntype Edge = \"start\" | \"end\";\n\n/**\n * Headless **Scroll Area** behavior: keyboard reachability and scroll-state hooks\n * for a natively scrolling region. No custom scrollbar is introduced.\n *\n * Markup contract (identifier: `stimeo--scroll-area`):\n * <div data-controller=\"stimeo--scroll-area\"\n * data-stimeo--scroll-area-orientation-value=\"vertical\">\n * <div data-stimeo--scroll-area-target=\"viewport\" aria-label=\"Log output\">\n * <!-- long content -->\n * </div>\n * </div>\n *\n * When content overflows and the viewport has no sequential Tab stop of its own,\n * the viewport receives a borrowed `tabindex=\"0\"`. A named viewport also receives\n * a borrowed `role=\"region\"`. Position is exposed through `data-scroll`, overflow\n * through `data-overflow`, and normalized progress through\n * `--stimeo--scroll-progress` so consumer CSS can render state without prescribing\n * appearance.\n *\n * The `reach` event is emitted once when an overflowing edge state is established,\n * including initial connection and a fit-to-overflow transition. Moving away from\n * that edge rearms the next arrival.\n *\n * `reach` dispatches `{ edge: \"start\" | \"end\" }`.\n *\n * @remarks\n * Behavior only. Scroll work is coalesced to one animation frame and never scans\n * descendants. Resize, content, accessible-name source, descendant-load, and font\n * completion changes run the full measurement pass. Every listener, observer,\n * animation frame, borrowed attribute, and state hook is released on disconnect.\n * Nothing is released on `turbo:before-cache`, which Turbo also dispatches on pages\n * that stay (a promoted frame navigation, a state-less `popstate`, a refresh of a cached\n * URL): the viewport keeps its Tab stop and its state there. A copy of the page Turbo\n * restores from its cache is measured afresh by the connection that adopts it, which\n * gives back what the copy carries from an earlier instance. Runtime viewport\n * replacement rebinds the whole resource set as one lifecycle unit.\n */\nexport class ScrollAreaController extends Controller<HTMLElement> {\n static override targets = [\"viewport\"];\n static override values = {\n orientation: { type: String, default: \"vertical\" },\n };\n static events = [\"reach\"] as const;\n\n declare readonly viewportTarget: HTMLElement;\n declare readonly hasViewportTarget: boolean;\n\n declare orientationValue: string;\n\n readonly #layout = new LayoutObserver(() => this.#refresh());\n readonly #rebind = new MorphRenderWatcher(() => this.#syncViewport());\n readonly #tabindex = new TabindexLoan(\"0\", this.identifier);\n readonly #role = new AttributeLease<HTMLElement>(\"role\", this.identifier);\n readonly #overflowState = new AttributeLease<HTMLElement>(\"data-overflow\", this.identifier);\n readonly #scrollState = new AttributeLease<HTMLElement>(\"data-scroll\", this.identifier);\n readonly #progress = new StylePropertyLease<HTMLElement>(\n \"--stimeo--scroll-progress\",\n this.identifier,\n );\n\n #viewport: HTMLElement | null = null;\n /** The scroll listener on the current viewport; unbinding the viewport releases it. */\n readonly #viewportListeners = new ListenerSet();\n #content: MutationObserver | null = null;\n #nameSources: MutationObserver | null = null;\n #nameGraph: MutationObserver | null = null;\n #observedNameIds = new Set<string>();\n #observedNameSources: Element[] = [];\n /** Coalesces scroll bursts into one position sync per frame. */\n readonly #frames = new FrameCoalescer();\n #overflowing = false;\n #lastEdge: Edge | null = null;\n readonly #ownedHostMutations = new Map<string, string | null>();\n\n readonly #onScroll = (event: Event): void => {\n // The listener only ever sits on the viewport, and letting that viewport go\n // cancels the pending frame first, so the frame has a target by construction.\n const viewport = event.currentTarget as HTMLElement;\n this.#frames.schedule(() => this.#syncPosition(viewport, this.#overflowing));\n };\n\n readonly #onFontsSettled = (): void => {\n this.#refresh();\n };\n readonly #fonts = new FontLoadWatcher(this.#onFontsSettled);\n\n override connect(): void {\n this.#rebind.observe(this.element);\n this.#layout.observeViewport();\n this.#fonts.observe(this.element);\n this.#syncViewport();\n }\n\n override disconnect(): void {\n this.#rebind.disconnect();\n if (this.#viewport) this.#unbindViewport(this.#viewport);\n this.#layout.disconnect();\n this.#fonts.disconnect();\n this.#clearHostState();\n }\n\n /** Re-measures when a retained viewport's orientation Value is morphed. */\n orientationValueChanged(): void {\n this.#refresh();\n }\n\n /** Schedules a complete resource rebind for a runtime viewport target. */\n viewportTargetConnected(): void {\n this.#rebind.schedule();\n }\n\n /** Schedules cleanup or replacement binding after a viewport leaves. */\n viewportTargetDisconnected(): void {\n this.#rebind.schedule();\n }\n\n /** Rebinds every viewport-owned resource against the final target in the mutation batch. */\n #syncViewport(): void {\n const next = this.hasViewportTarget ? this.viewportTarget : null;\n if (next === this.#viewport) {\n if (next) this.#refresh();\n return;\n }\n\n if (this.#viewport) this.#unbindViewport(this.#viewport);\n this.#viewport = next;\n if (!next) {\n this.#clearHostState();\n return;\n }\n\n this.#viewportListeners.add(next, \"scroll\", this.#onScroll, { passive: true });\n this.#layout.observeDescendantLoads(next);\n this.#layout.observe(next);\n this.#bindContentObserver(next);\n this.#refresh();\n }\n\n /** Observes structural and attribute changes that can alter overflow or Tab stops. */\n #bindContentObserver(viewport: HTMLElement): void {\n this.#content = new MutationObserver((records) => {\n if (this.#viewport !== viewport || !this.#hasRelevantContentMutation(records)) return;\n this.#refresh();\n });\n this.#content.observe(viewport, {\n subtree: true,\n childList: true,\n attributes: true,\n characterData: true,\n });\n }\n\n /** Ignores only state-hook mutations whose exact value this controller just wrote. */\n #hasRelevantContentMutation(records: MutationRecord[]): boolean {\n let relevant = false;\n const consumed = new Set<string>();\n for (const record of records) {\n const attribute = record.attributeName;\n if (\n record.type === \"attributes\" &&\n record.target === this.element &&\n attribute !== null &&\n this.#ownedHostMutations.has(attribute) &&\n this.element.getAttribute(attribute) === this.#ownedHostMutations.get(attribute)\n ) {\n consumed.add(attribute);\n } else {\n relevant = true;\n }\n }\n for (const attribute of consumed) this.#ownedHostMutations.delete(attribute);\n return relevant;\n }\n\n /** Releases every resource and borrowed attribute owned by one former viewport. */\n #unbindViewport(viewport: HTMLElement): void {\n this.#frames.cancel();\n this.#viewportListeners.dispose();\n this.#layout.unobserveDescendantLoads();\n this.#layout.unobserve(viewport);\n this.#content?.disconnect();\n this.#content = null;\n this.#disconnectNameSources();\n this.#clearViewportAttributes(viewport);\n this.#ownedHostMutations.clear();\n this.#viewport = null;\n this.#overflowing = false;\n this.#lastEdge = null;\n }\n\n /**\n * Runs the full structural and positional measurement pass.\n *\n * @stimeoRenderRoot\n */\n #refresh(): void {\n const viewport = this.#viewport;\n if (!viewport) return;\n this.#frames.cancel();\n this.#syncNameSources(viewport);\n this.#overflowing = this.#syncOverflow(viewport);\n this.#syncKeyboardReach(viewport, this.#overflowing);\n this.#syncPosition(viewport, this.#overflowing);\n }\n\n /** Measures overflow and reflects the state hook without identical DOM writes. */\n #syncOverflow(viewport: HTMLElement): boolean {\n const overflowing = this.#measureOverflow(viewport);\n this.#writeHostAttribute(this.#overflowState, \"data-overflow\", overflowing ? \"true\" : \"false\");\n return overflowing;\n }\n\n /** Measures the primary-axis position and dispatches a newly established edge. */\n #syncPosition(viewport: HTMLElement, overflowing: boolean): void {\n const { position, progress } = this.#measurePosition(viewport);\n this.#writeHostAttribute(this.#scrollState, \"data-scroll\", position);\n this.#writeHostProgress(String(progress));\n\n const edge: Edge | null =\n overflowing && (position === \"start\" || position === \"end\") ? position : null;\n if (edge === this.#lastEdge) return;\n this.#lastEdge = edge;\n if (edge) this.dispatch(\"reach\", { detail: { edge } });\n }\n\n /** Writes one leased host attribute and records self-generated observer input. */\n #writeHostAttribute(lease: AttributeLease<HTMLElement>, attribute: string, value: string): void {\n const record = `data-${this.identifier}-${attribute}-lease`;\n const before = this.element.getAttribute(attribute);\n const recordBefore = this.element.getAttribute(record);\n lease.write(this.element, value);\n this.#recordOwnedHostMutation(attribute, before);\n this.#recordOwnedHostMutation(record, recordBefore);\n }\n\n /** Writes the leased progress property and records its serialized style mutation. */\n #writeHostProgress(value: string): void {\n const record = `data-${this.identifier}-style---stimeo--scroll-progress-lease`;\n const before = this.element.getAttribute(\"style\");\n const recordBefore = this.element.getAttribute(record);\n this.#progress.write(this.element, value);\n this.#recordOwnedHostMutation(\"style\", before);\n this.#recordOwnedHostMutation(record, recordBefore);\n }\n\n /** Records an exact host mutation only when the host is also the observed viewport. */\n #recordOwnedHostMutation(attribute: string, before: string | null): void {\n if (this.#viewport !== this.element) return;\n const after = this.element.getAttribute(attribute);\n if (after !== before) this.#ownedHostMutations.set(attribute, after);\n }\n\n /** Returns host hooks to authored values and clears edge bookkeeping. */\n #clearHostState(): void {\n this.#overflowState.returnAll();\n this.#scrollState.returnAll();\n this.#progress.returnAll();\n this.#overflowing = false;\n this.#lastEdge = null;\n }\n\n /** Whether the configured axis currently has a scroll range. */\n #measureOverflow(viewport: HTMLElement): boolean {\n const orientation = this.orientationValue;\n const vertical =\n orientation !== \"horizontal\" && viewport.scrollHeight > viewport.clientHeight + EDGE_EPSILON;\n const horizontal =\n orientation !== \"vertical\" && viewport.scrollWidth > viewport.clientWidth + EDGE_EPSILON;\n return vertical || horizontal;\n }\n\n /** Reports the primary-axis position bucket and normalized 0–1 progress. */\n #measurePosition(viewport: HTMLElement): {\n position: \"start\" | \"middle\" | \"end\";\n progress: number;\n } {\n const horizontalPrimary =\n this.orientationValue === \"horizontal\" ||\n (this.orientationValue === \"both\" &&\n viewport.scrollHeight <= viewport.clientHeight + EDGE_EPSILON);\n const { position: scrollPosition, max: maxScroll } = logicalScrollMetrics(\n viewport,\n horizontalPrimary,\n );\n\n if (maxScroll <= EDGE_EPSILON) return { position: \"start\", progress: 0 };\n const progress = Math.min(1, Math.max(0, scrollPosition / maxScroll));\n if (scrollPosition <= EDGE_EPSILON) return { position: \"start\", progress };\n if (scrollPosition >= maxScroll - EDGE_EPSILON) return { position: \"end\", progress };\n return { position: \"middle\", progress };\n }\n\n /** Borrows keyboard reach only when no usable descendant already owns a Tab stop. */\n #syncKeyboardReach(viewport: HTMLElement, overflowing: boolean): void {\n const wantsTabindex = overflowing && !hasTabStop(viewport);\n if (!wantsTabindex) {\n this.#clearViewportAttributes(viewport);\n return;\n }\n\n this.#tabindex.lend(viewport);\n if (this.#hasAccessibleName(viewport)) {\n if (!viewport.hasAttribute(\"role\")) this.#role.write(viewport, \"region\");\n } else {\n this.#returnRole(viewport);\n }\n }\n\n /**\n * Returns only the viewport attributes borrowed by this controller, including the ones\n * an earlier connection recorded on a restored copy of the viewport.\n */\n #clearViewportAttributes(viewport: HTMLElement): void {\n this.#tabindex.returnAll();\n this.#tabindex.reclaim(viewport);\n this.#returnRole(viewport);\n }\n\n /** Gives the viewport its authored `role` back, also from a restored copy's record. */\n #returnRole(viewport: HTMLElement): void {\n this.#role.return(viewport);\n }\n\n /** Whether the viewport already has a non-empty accessible name. */\n #hasAccessibleName(viewport: HTMLElement): boolean {\n const sources = this.#resolveNameSources(viewport);\n if (sources.length > 0) {\n return sources.some((source) => {\n const label = source.getAttribute(\"aria-label\")?.trim();\n return Boolean(label || source.textContent?.trim());\n });\n }\n return Boolean(viewport.getAttribute(\"aria-label\")?.trim());\n }\n\n /** Resolves unique, live `aria-labelledby` references in authored order. */\n #resolveNameSources(viewport: HTMLElement): Element[] {\n const ids = this.#nameReferenceIds(viewport);\n const sources: Element[] = [];\n for (const id of ids) {\n const source = viewport.ownerDocument.getElementById(id);\n if (source) sources.push(source);\n }\n return sources;\n }\n\n /** Observes external name sources so a retained region never becomes unnamed. */\n #syncNameSources(viewport: HTMLElement): void {\n const ids = this.#nameReferenceIds(viewport);\n const sources = this.#resolveNameSources(viewport).filter(\n (source) => !viewport.contains(source),\n );\n if (\n ids.length === this.#observedNameIds.size &&\n ids.every((id) => this.#observedNameIds.has(id)) &&\n sources.length === this.#observedNameSources.length &&\n sources.every((source, index) => source === this.#observedNameSources[index])\n ) {\n return;\n }\n\n this.#disconnectNameSources();\n this.#observedNameIds = new Set(ids);\n this.#observedNameSources = sources;\n if (ids.length > 0) {\n this.#nameGraph = new MutationObserver((records) => {\n if (this.#viewport === viewport && this.#hasRelevantNameGraphMutation(records)) {\n this.#refresh();\n }\n });\n const documentElement = viewport.ownerDocument.documentElement;\n if (documentElement) {\n this.#nameGraph.observe(documentElement, {\n subtree: true,\n childList: true,\n attributes: true,\n attributeFilter: [\"id\"],\n attributeOldValue: true,\n });\n }\n }\n\n if (sources.length === 0) return;\n this.#nameSources = new MutationObserver(() => {\n this.#refresh();\n });\n for (const source of sources) {\n this.#nameSources.observe(source, {\n subtree: true,\n childList: true,\n characterData: true,\n attributes: true,\n });\n }\n }\n\n /** Returns normalized unique label-reference ids in authored order. */\n #nameReferenceIds(viewport: HTMLElement): string[] {\n const tokens = viewport.getAttribute(\"aria-labelledby\")?.trim().split(/\\s+/).filter(Boolean);\n return Array.from(new Set(tokens));\n }\n\n /** Whether document-graph changes can resolve or invalidate a referenced id. */\n #hasRelevantNameGraphMutation(records: MutationRecord[]): boolean {\n for (const record of records) {\n if (record.type === \"attributes\") {\n const current = (record.target as Element).id;\n if (\n this.#observedNameIds.has(current) ||\n this.#observedNameIds.has(record.oldValue ?? \"\")\n ) {\n return true;\n }\n continue;\n }\n\n for (const node of [...record.addedNodes, ...record.removedNodes]) {\n if (this.#nodeContainsObservedNameId(node)) return true;\n }\n }\n return false;\n }\n\n /** Whether a changed subtree contains one of the current label-reference ids. */\n #nodeContainsObservedNameId(node: Node): boolean {\n if (!(node instanceof Element)) return false;\n if (this.#observedNameIds.has(node.id)) return true;\n return Array.from(node.querySelectorAll<HTMLElement>(\"[id]\")).some((element) =>\n this.#observedNameIds.has(element.id),\n );\n }\n\n /** Stops observing accessible-name sources. */\n #disconnectNameSources(): void {\n this.#nameSources?.disconnect();\n this.#nameSources = null;\n this.#nameGraph?.disconnect();\n this.#nameGraph = null;\n this.#observedNameIds.clear();\n this.#observedNameSources = [];\n }\n}\n"]}
|
|
@@ -3,9 +3,9 @@ import { Controller } from '@hotwired/stimulus';
|
|
|
3
3
|
/**
|
|
4
4
|
* Headless **Scroll Restore** behavior: persists and restores the scroll
|
|
5
5
|
* position of an inner scrolling region across Turbo Drive navigations (and full
|
|
6
|
-
* reloads within the same tab session).
|
|
7
|
-
*
|
|
8
|
-
*
|
|
6
|
+
* reloads within the same tab session). Like `stimeo--scroll-visibility` and
|
|
7
|
+
* `stimeo--sticky-observer`, it implements no APG widget; it is a pure
|
|
8
|
+
* state-preservation utility.
|
|
9
9
|
*
|
|
10
10
|
* Markup contract (identifier: `stimeo--scroll-restore`):
|
|
11
11
|
* <div data-controller="stimeo--scroll-restore"
|