snice 7.2.0 → 7.3.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.
Files changed (200) hide show
  1. package/.agents/skills/snice/SKILL.md +40 -13
  2. package/README.md +6 -5
  3. package/adapters/react/SniceProvider.js +1 -1
  4. package/adapters/react/SniceRouter.d.ts +2 -0
  5. package/adapters/react/SniceRouter.js +3 -2
  6. package/adapters/react/SniceRouter.js.map +1 -1
  7. package/adapters/react/matchRoute.d.ts +4 -1
  8. package/adapters/react/matchRoute.js +13 -3
  9. package/adapters/react/matchRoute.js.map +1 -1
  10. package/adapters/react/useRequestHandler.js +1 -1
  11. package/bin/analyzer-contracts.js +2 -1
  12. package/bin/project-analyzer.js +302 -14
  13. package/bin/templates/AI_GUIDANCE.md +6 -1
  14. package/bin/templates/default/README.md +1 -1
  15. package/bin/templates/default/src/components/app-header.ts +11 -16
  16. package/bin/templates/default/src/components/notification-badge.ts +5 -14
  17. package/bin/templates/default/src/components/search-bar.ts +21 -65
  18. package/bin/templates/default/src/pages/dashboard.ts +15 -11
  19. package/bin/templates/default/src/pages/data.ts +10 -13
  20. package/bin/templates/default/src/pages/notifications.ts +4 -9
  21. package/bin/templates/default/src/pages/profile.ts +2 -8
  22. package/bin/templates/default/src/pages/settings.ts +16 -16
  23. package/dist/cdn/accordion/snice-accordion.js +1 -1
  24. package/dist/cdn/action-bar/snice-action-bar.js +1 -1
  25. package/dist/cdn/activity-feed/snice-activity-feed.js +1 -1
  26. package/dist/cdn/alert/snice-alert.js +1 -1
  27. package/dist/cdn/app-tiles/snice-app-tiles.js +1 -1
  28. package/dist/cdn/approval-flow/snice-approval-flow.js +1 -1
  29. package/dist/cdn/audio-recorder/snice-audio-recorder.js +1 -1
  30. package/dist/cdn/availability/snice-availability.js +1 -1
  31. package/dist/cdn/avatar/snice-avatar.js +1 -1
  32. package/dist/cdn/avatar-group/snice-avatar-group.js +1 -1
  33. package/dist/cdn/badge/snice-badge.js +1 -1
  34. package/dist/cdn/banner/snice-banner.js +1 -1
  35. package/dist/cdn/binpack/snice-binpack.js +1 -1
  36. package/dist/cdn/book/snice-book.js +1 -1
  37. package/dist/cdn/booking/snice-booking.js +1 -1
  38. package/dist/cdn/breadcrumbs/snice-breadcrumbs.js +1 -1
  39. package/dist/cdn/button/snice-button.js +1 -1
  40. package/dist/cdn/calendar/snice-calendar.js +1 -1
  41. package/dist/cdn/camera/snice-camera.js +1 -1
  42. package/dist/cdn/camera-annotate/snice-camera-annotate.js +1 -1
  43. package/dist/cdn/candlestick/snice-candlestick.js +1 -1
  44. package/dist/cdn/card/snice-card.js +1 -1
  45. package/dist/cdn/carousel/snice-carousel.js +1 -1
  46. package/dist/cdn/cart/snice-cart.js +1 -1
  47. package/dist/cdn/chart/snice-chart.js +1 -1
  48. package/dist/cdn/chat/snice-chat.js +1 -1
  49. package/dist/cdn/checkbox/snice-checkbox.js +1 -1
  50. package/dist/cdn/chip/snice-chip.js +1 -1
  51. package/dist/cdn/code-block/snice-code-block.js +1 -1
  52. package/dist/cdn/color-display/snice-color-display.js +1 -1
  53. package/dist/cdn/color-picker/snice-color-picker.js +1 -1
  54. package/dist/cdn/command-palette/snice-command-palette.js +1 -1
  55. package/dist/cdn/comments/snice-comments.js +1 -1
  56. package/dist/cdn/countdown/snice-countdown.js +1 -1
  57. package/dist/cdn/cropper/snice-cropper.js +1 -1
  58. package/dist/cdn/data-card/snice-data-card.js +1 -1
  59. package/dist/cdn/date-picker/snice-date-picker.js +1 -1
  60. package/dist/cdn/date-range-picker/snice-date-range-picker.js +1 -1
  61. package/dist/cdn/date-time-picker/snice-date-time-picker.js +1 -1
  62. package/dist/cdn/diff/snice-diff.js +1 -1
  63. package/dist/cdn/divider/snice-divider.js +1 -1
  64. package/dist/cdn/doc/snice-doc.js +1 -1
  65. package/dist/cdn/draw/snice-draw.js +1 -1
  66. package/dist/cdn/drawer/snice-drawer.js +1 -1
  67. package/dist/cdn/empty-state/snice-empty-state.js +1 -1
  68. package/dist/cdn/estimate/snice-estimate.js +1 -1
  69. package/dist/cdn/file-gallery/snice-file-gallery.js +1 -1
  70. package/dist/cdn/file-upload/snice-file-upload.js +1 -1
  71. package/dist/cdn/flip-card/snice-flip-card.js +1 -1
  72. package/dist/cdn/flow/snice-flow.js +1 -1
  73. package/dist/cdn/form-layout/snice-form-layout.js +1 -1
  74. package/dist/cdn/funnel/snice-funnel.js +1 -1
  75. package/dist/cdn/gantt/snice-gantt.js +1 -1
  76. package/dist/cdn/gauge/snice-gauge.js +1 -1
  77. package/dist/cdn/grid/snice-grid.js +1 -1
  78. package/dist/cdn/heatmap/snice-heatmap.js +1 -1
  79. package/dist/cdn/image/snice-image.js +1 -1
  80. package/dist/cdn/input/snice-input.js +1 -1
  81. package/dist/cdn/invoice/snice-invoice.js +1 -1
  82. package/dist/cdn/kanban/snice-kanban.js +1 -1
  83. package/dist/cdn/key-value/snice-key-value.js +1 -1
  84. package/dist/cdn/kpi/snice-kpi.js +1 -1
  85. package/dist/cdn/layout/snice-layout.js +1 -1
  86. package/dist/cdn/leaderboard/snice-leaderboard.js +1 -1
  87. package/dist/cdn/link/snice-link.js +1 -1
  88. package/dist/cdn/link-preview/snice-link-preview.js +1 -1
  89. package/dist/cdn/list/snice-list.js +1 -1
  90. package/dist/cdn/location/snice-location.js +1 -1
  91. package/dist/cdn/login/snice-login.js +1 -1
  92. package/dist/cdn/map/snice-map.js +1 -1
  93. package/dist/cdn/markdown/snice-markdown.js +1 -1
  94. package/dist/cdn/masonry/snice-masonry.js +1 -1
  95. package/dist/cdn/menu/snice-menu.js +1 -1
  96. package/dist/cdn/message-strip/snice-message-strip.js +1 -1
  97. package/dist/cdn/modal/snice-modal.js +1 -1
  98. package/dist/cdn/music-player/snice-music-player.js +1 -1
  99. package/dist/cdn/nav/snice-nav.js +1 -1
  100. package/dist/cdn/network-graph/snice-network-graph.js +1 -1
  101. package/dist/cdn/notification-center/snice-notification-center.js +1 -1
  102. package/dist/cdn/order-tracker/snice-order-tracker.js +1 -1
  103. package/dist/cdn/org-chart/snice-org-chart.js +1 -1
  104. package/dist/cdn/pagination/snice-pagination.js +1 -1
  105. package/dist/cdn/paint/snice-paint.js +1 -1
  106. package/dist/cdn/pdf-viewer/snice-pdf-viewer.js +1 -1
  107. package/dist/cdn/permission-matrix/snice-permission-matrix.js +1 -1
  108. package/dist/cdn/podcast-player/snice-podcast-player.js +1 -1
  109. package/dist/cdn/popover/snice-popover.js +1 -1
  110. package/dist/cdn/pricing-table/snice-pricing-table.js +1 -1
  111. package/dist/cdn/product-card/snice-product-card.js +1 -1
  112. package/dist/cdn/progress/snice-progress.js +1 -1
  113. package/dist/cdn/progress-ring/snice-progress-ring.js +1 -1
  114. package/dist/cdn/qr-code/snice-qr-code.js +1 -1
  115. package/dist/cdn/qr-reader/snice-qr-reader.js +1 -1
  116. package/dist/cdn/radio/snice-radio.js +1 -1
  117. package/dist/cdn/range-slider/snice-range-slider.js +1 -1
  118. package/dist/cdn/rating/snice-rating.js +1 -1
  119. package/dist/cdn/receipt/snice-receipt.js +1 -1
  120. package/dist/cdn/recipe/snice-recipe.js +1 -1
  121. package/dist/cdn/runtime/README.md +2 -2
  122. package/dist/cdn/runtime/snice-runtime.esm.js +28 -8
  123. package/dist/cdn/runtime/snice-runtime.esm.js.map +1 -1
  124. package/dist/cdn/runtime/snice-runtime.esm.min.js +1 -1
  125. package/dist/cdn/runtime/snice-runtime.esm.min.js.map +1 -1
  126. package/dist/cdn/runtime/snice-runtime.js +28 -8
  127. package/dist/cdn/runtime/snice-runtime.js.map +1 -1
  128. package/dist/cdn/runtime/snice-runtime.min.js +1 -1
  129. package/dist/cdn/runtime/snice-runtime.min.js.map +1 -1
  130. package/dist/cdn/sankey/snice-sankey.js +1 -1
  131. package/dist/cdn/segmented-control/snice-segmented-control.js +1 -1
  132. package/dist/cdn/select/snice-select.js +1 -1
  133. package/dist/cdn/skeleton/snice-skeleton.js +1 -1
  134. package/dist/cdn/slider/snice-slider.js +1 -1
  135. package/dist/cdn/sortable/snice-sortable.js +1 -1
  136. package/dist/cdn/sparkline/snice-sparkline.js +1 -1
  137. package/dist/cdn/spinner/snice-spinner.js +1 -1
  138. package/dist/cdn/split-button/snice-split-button.js +1 -1
  139. package/dist/cdn/split-pane/snice-split-pane.js +1 -1
  140. package/dist/cdn/spotlight/snice-spotlight.js +1 -1
  141. package/dist/cdn/stat-group/snice-stat-group.js +1 -1
  142. package/dist/cdn/step-input/snice-step-input.js +1 -1
  143. package/dist/cdn/stepper/snice-stepper.js +1 -1
  144. package/dist/cdn/switch/snice-switch.js +1 -1
  145. package/dist/cdn/table/snice-table.esm.js +1 -1
  146. package/dist/cdn/table/snice-table.js +1 -1
  147. package/dist/cdn/tabs/snice-tabs.js +1 -1
  148. package/dist/cdn/tag/snice-tag.js +1 -1
  149. package/dist/cdn/tag-input/snice-tag-input.js +1 -1
  150. package/dist/cdn/terminal/snice-terminal.js +1 -1
  151. package/dist/cdn/testimonial/snice-testimonial.js +1 -1
  152. package/dist/cdn/textarea/snice-textarea.js +1 -1
  153. package/dist/cdn/time-picker/snice-time-picker.js +1 -1
  154. package/dist/cdn/time-range-picker/snice-time-range-picker.js +1 -1
  155. package/dist/cdn/timeline/snice-timeline.js +1 -1
  156. package/dist/cdn/timer/snice-timer.js +1 -1
  157. package/dist/cdn/toast/snice-toast.js +1 -1
  158. package/dist/cdn/tooltip/snice-tooltip.js +1 -1
  159. package/dist/cdn/tree/snice-tree.js +1 -1
  160. package/dist/cdn/treemap/snice-treemap.js +1 -1
  161. package/dist/cdn/user-card/snice-user-card.js +1 -1
  162. package/dist/cdn/video-player/snice-video-player.js +1 -1
  163. package/dist/cdn/virtual-scroller/snice-virtual-scroller.js +1 -1
  164. package/dist/cdn/waterfall/snice-waterfall.js +1 -1
  165. package/dist/cdn/weather/snice-weather.js +1 -1
  166. package/dist/cdn/work-order/snice-work-order.js +1 -1
  167. package/dist/index.cjs +25 -5
  168. package/dist/index.cjs.map +1 -1
  169. package/dist/index.esm.js +25 -5
  170. package/dist/index.esm.js.map +1 -1
  171. package/dist/index.iife.js +25 -5
  172. package/dist/index.iife.js.map +1 -1
  173. package/dist/react/SniceProvider.js +1 -1
  174. package/dist/react/SniceRouter.d.ts +2 -0
  175. package/dist/react/SniceRouter.js +3 -2
  176. package/dist/react/SniceRouter.js.map +1 -1
  177. package/dist/react/index.js +1 -1
  178. package/dist/react/matchRoute.d.ts +4 -1
  179. package/dist/react/matchRoute.js +13 -3
  180. package/dist/react/matchRoute.js.map +1 -1
  181. package/dist/react/useRequestHandler.js +1 -1
  182. package/dist/symbols.cjs +1 -1
  183. package/dist/symbols.esm.js +1 -1
  184. package/dist/transitions.cjs +1 -1
  185. package/dist/transitions.esm.js +1 -1
  186. package/dist/types/page-options.d.ts +15 -1
  187. package/dist/types/router-instance.d.ts +2 -1
  188. package/docs/ai/README.md +6 -4
  189. package/docs/ai/api.md +1 -1
  190. package/docs/ai/architecture.md +21 -8
  191. package/docs/ai/cli.md +4 -1
  192. package/docs/ai/controllers.md +11 -1
  193. package/docs/ai/decorators.md +1 -1
  194. package/docs/ai/react-integration.md +1 -0
  195. package/docs/ai/routing.md +25 -3
  196. package/docs/cli.md +4 -2
  197. package/docs/controllers.md +16 -4
  198. package/docs/react-integration.md +1 -0
  199. package/docs/routing.md +29 -2
  200. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.iife.js","sources":["../src/global.ts","../src/symbols.ts","../src/types/simple-array.ts","../src/types/transition.ts","../src/types/context.ts","../src/utils.ts","../src/observe.ts","../src/context-provider.ts","../src/daemon-target.ts","../src/request-response.ts","../src/keyboard-filter.ts","../src/on.ts","../src/controller.ts","../src/context.ts","../src/template.ts","../src/repeat.ts","../src/render-root.ts","../src/parts.ts","../src/autofocus.ts","../src/render.ts","../src/events.ts","../src/method-decorators.ts","../src/reactive.ts","../src/element.ts","../src/snice-element.ts","../node_modules/pica-route/dist/index.esm.js","../src/route-specificity.ts","../src/transitions.ts","../src/daemon.ts","../src/app-context.ts","../src/router.ts","../src/create-request-handler.ts","../src/template-helpers.ts","../src/element-ready.ts","../src/render-debug.ts","../src/scroll-lock.ts","../src/fetcher.ts","../src/index.ts"],"sourcesContent":["// Global namespace for Snice framework\n// Ensures all registries and symbols are shared across different JS files/modules\n\nimport { SniceGlobal } from './types/snice-global';\n\n\n// Initialize the global Snice namespace on globalThis\n// This ensures all module instances share the same registry\nif (!(globalThis as any).snice) {\n (globalThis as any).snice = {\n controllerRegistry: new Map(),\n pendingControllerAttachments: new Map(),\n controllerIdCounter: 0\n };\n}\n\n// Multiple copies of Snice can share a global created by an older build.\n(globalThis as any).snice.pendingControllerAttachments ??= new Map();\n\n// Export direct reference to globalThis.snice\nexport const snice: SniceGlobal = (globalThis as any).snice;\n\n// Helper function to get or create a global symbol\n// Symbol.for() already guarantees global uniqueness, no need for a Map cache\nexport function getSymbol(name: string): symbol {\n return Symbol.for(`snice:${name}`);\n}\n","// Central file for all symbols used in the framework\n// All symbols are stored globally to ensure consistency across modules\n\nimport { getSymbol } from './global';\n\nexport { getSymbol };\n\nexport const IS_CONTROLLER_CLASS = getSymbol('is-controller-class');\nexport const IS_CONTROLLER_INSTANCE = getSymbol('is-controller-instance');\nexport const IS_DAEMON_CLASS = getSymbol('is-daemon-class');\nexport const IS_DAEMON_INSTANCE = getSymbol('is-daemon-instance');\nexport const IS_ELEMENT_CLASS = getSymbol('is-element-class');\nexport const CHANNEL_HANDLERS = getSymbol('channel-handlers');\n\n// Per-instance daemon communication state. Daemon instances are constructed by\n// application code; Snice only creates and manages their private EventTarget\n// when an app context explicitly provides them.\nexport const DAEMON_STATE = getSymbol('daemon-state');\n\n// Internal element state symbols\nexport const READY_PROMISE = getSymbol('ready-promise');\nexport const READY_RESOLVE = getSymbol('ready-resolve');\nexport const READY_REJECT = getSymbol('ready-reject');\n// True only while an element is executing its own @ready handlers. A\n// controller attached to that same host must not await the promise whose\n// settlement depends on the current handler returning.\nexport const READY_HANDLERS_RUNNING = getSymbol('ready-handlers-running');\nexport const RENDERED_PROMISE = getSymbol('rendered-promise');\nexport const RENDERED_RESOLVE = getSymbol('rendered-resolve');\n// Set when a render is requested but dropped because the element was\n// disconnected; consumed on reconnect to replay exactly the missed render.\nexport const PENDING_RECONNECT_RENDER = getSymbol('pending-reconnect-render');\n// Per-element synchronous render-nesting depth, used to cap runaway re-entry\n// without a shared global counter that one element could exhaust for others.\nexport const RENDER_DEPTH = getSymbol('render-depth');\nexport const RENDER_ROOT = getSymbol('render-root');\nexport const ELEMENT_OPTIONS = getSymbol('element-options');\nexport const CONTROLLER = getSymbol('controller');\nexport const INITIALIZED = getSymbol('initialized');\n\n// Event handler symbols\nexport const ON_HANDLERS = getSymbol('on-handlers');\n\n// Controller symbols\nexport const CONTROLLER_KEY = getSymbol('controller-key');\nexport const CONTROLLER_NAME_KEY = getSymbol('controller-name');\nexport const CONTROLLER_ID = getSymbol('controller-id');\nexport const CONTROLLER_OPERATIONS = getSymbol('controller-operations');\nexport const NATIVE_CONTROLLER = getSymbol('native-controller');\n// Decorator name stored on the class so direct class bindings can expose the\n// same useful DOM label without resolving the controller through the registry.\nexport const CONTROLLER_REGISTRY_NAME = getSymbol('controller-registry-name');\n// Set while a controller CLASS (not a registry name) is attached — the\n// attribute/MutationObserver channel must not attach over or detach it.\nexport const DIRECT_CONTROLLER = getSymbol('direct-controller');\n// Guards framework-authored diagnostic controller attribute writes from the\n// synchronous custom-element attributeChangedCallback path.\nexport const CONTROLLER_ATTRIBUTE_SYNC = getSymbol('controller-attribute-sync');\n// A controller class bound by a template before the custom element was\n// defined/upgraded. Picked up by connectedCallback on first initialization.\nexport const PENDING_CONTROLLER_BINDING = getSymbol('pending-controller-binding');\n\n// Cleanup symbol - holds an object with all cleanup arrays\nexport const CLEANUP = getSymbol('cleanup');\n\n// Property symbols\nexport const PROPERTIES = getSymbol('properties');\nexport const PROPERTY_VALUES = getSymbol('property-values');\nexport const PROPERTY_DEFAULTS = getSymbol('property-defaults');\nexport const PROPERTY_WRAPPERS = getSymbol('property-wrappers');\nexport const PRE_INIT_PROPERTY_VALUES = getSymbol('pre-init-property-values');\nexport const PRE_UPGRADE_PROPERTY_BINDINGS = getSymbol('pre-upgrade-property-bindings');\nexport const PROPERTIES_INITIALIZED = getSymbol('properties-initialized');\nexport const PROPERTY_WATCHERS = getSymbol('property-watchers');\nexport const EXPLICITLY_SET_PROPERTIES = getSymbol('explicitly-set-properties');\n\n// Router context symbol\nexport const ROUTER_CONTEXT = getSymbol('router-context');\nexport const CURRENT_PAGE_MARKER = getSymbol('current-page-marker');\nexport const CONTEXT_REQUEST_HANDLER = getSymbol('context-request-handler');\nexport const PAGE_TRANSITION = getSymbol('page-transition');\nexport const CREATED_AT = getSymbol('created-at');\n\n// Lifecycle symbols\nexport const READY_HANDLERS = getSymbol('ready-handlers');\nexport const DISPOSE_HANDLERS = getSymbol('dispose-handlers');\nexport const RECONNECT_HANDLERS = getSymbol('reconnect-handlers');\nexport const MOVED_HANDLERS = getSymbol('moved-handlers');\nexport const ADOPTED_HANDLERS = getSymbol('adopted-handlers');\n\n// Observer symbols\nexport const OBSERVERS = getSymbol('observers');\n\n// Part symbols\nexport const PARTS = getSymbol('parts');\nexport const PART_TIMERS = getSymbol('part-timers');\n\n// Property setter flag (prevents attributeChangedCallback re-triggering watchers)\nexport const SETTING_FROM_PROPERTY = getSymbol('setting-from-property');\n\n// Lifecycle callback timers\nexport const MOVED_TIMERS = getSymbol('moved-timers');\nexport const ADOPTED_TIMERS = getSymbol('adopted-timers');\n\n// Dispatch timing symbols\nexport const DISPATCH_TIMERS = getSymbol('dispatch-timers');\n\n// Render symbols (v3.0.0)\nexport const RENDER_METHOD = getSymbol('render-method');\nexport const RENDER_OPTIONS = getSymbol('render-options');\nexport const RENDER_INSTANCE = getSymbol('render-instance');\nexport const RENDER_TIMERS = getSymbol('render-timers');\nexport const RENDER_CALLBACKS = getSymbol('render-callbacks');\nexport const STYLES_METHOD = getSymbol('styles-method');\nexport const STYLES_APPLIED = getSymbol('styles-applied');\nexport const PARENT_STYLES_METHODS = getSymbol('parent-styles-methods');\nexport const SNICE_ELEMENT_BASE = getSymbol('snice-element-base');\n\n// Navigation context symbols\nexport const CONTEXT_HANDLER = getSymbol('context-handler');\nexport const CONTEXT_METHOD_NAME = getSymbol('context-method-name');\nexport const NAVIGATION_CONTEXT_INSTANCE = getSymbol('navigation-context-instance');\nexport const REGISTERED_ELEMENTS = getSymbol('registered-elements');\nexport const IS_UPDATING = getSymbol('is-updating');\nexport const CONTEXT_REGISTER = getSymbol('context-register');\nexport const CONTEXT_UNREGISTER = getSymbol('context-unregister');\nexport const CONTEXT_NOTIFY_ELEMENT = getSymbol('context-notify-element');\nexport const CONTEXT_OPTIONS = getSymbol('context-options');\nexport const CONTEXT_TIMER = getSymbol('context-timer');\nexport const CONTEXT_CALLED = getSymbol('context-called');\nexport const CONTEXT_UPDATE = getSymbol('context-update');\n\n// Registration de-dup sets on the constructor — replace previous `__*Methods`\n// expando strings that violated the no-double-underscore rule.\nexport const CONTEXT_METHODS = getSymbol('context-methods');\nexport const WATCH_METHODS = getSymbol('watch-methods');\nexport const OBSERVE_METHODS = getSymbol('observe-methods');\nexport const ON_METHODS = getSymbol('on-methods');\nexport const RESPOND_METHODS = getSymbol('respond-methods');\nexport const READY_METHODS = getSymbol('ready-methods');\nexport const DISPOSE_METHODS = getSymbol('dispose-methods');\nexport const RECONNECT_METHODS = getSymbol('reconnect-methods');\nexport const MOVED_METHODS = getSymbol('moved-methods');\nexport const ADOPTED_METHODS = getSymbol('adopted-methods');\n\n// Controller attach-abort — set to an AbortController while attachController\n// is awaiting element.ready, so detachController can short-circuit the wait.\nexport const CONTROLLER_ABORT = getSymbol('controller-abort');\n// Set on a controller instance once it has gotten past element.ready and is\n// being attached, so detachController knows not to run detach() on a controller\n// whose attach() was aborted before it ever ran.\nexport const CONTROLLER_ATTACHED = getSymbol('controller-attached');\nexport const PROPERTY_DEFINERS = getSymbol('property-definers');\n","/**\n * SimpleArray type for arrays that can be safely reflected to attributes\n * Supports arrays of: string, number, boolean\n * Uses full-width comma (,) as separator to avoid conflicts\n * Strings cannot contain the full-width comma character\n */\nexport class SimpleArray {\n static readonly SEPARATOR = ','; // U+FF0C Full-width comma\n\n /**\n * Serialize array to string for attribute storage\n */\n static serialize(arr: (string | number | boolean)[]): string {\n if (!Array.isArray(arr)) return '';\n\n return arr.map(item => {\n if (typeof item === 'string') {\n // Validate string doesn't contain our separator\n if (item.includes(SimpleArray.SEPARATOR)) {\n throw new Error(`SimpleArray strings cannot contain the character \"${SimpleArray.SEPARATOR}\" (U+FF0C)`);\n }\n return item;\n } else if (typeof item === 'number' || typeof item === 'boolean') {\n return String(item);\n } else {\n throw new Error(`SimpleArray only supports string, number, and boolean types. Got: ${typeof item}`);\n }\n }).join(SimpleArray.SEPARATOR);\n }\n\n /**\n * Parse string from attribute back to array\n */\n static parse(str: string | null): (string | number | boolean)[] {\n if (str === null || str === undefined) return [];\n // Empty string should not be parsed as containing an empty string\n // since empty arrays don't get reflected (handled by the reflection logic)\n if (str === '') return [];\n\n return str.split(SimpleArray.SEPARATOR).map(item => {\n // Try to parse as number\n if (/^-?\\d+\\.?\\d*$/.test(item)) {\n const num = Number(item);\n if (!isNaN(num)) return num;\n }\n\n // Parse as boolean\n if (item === 'true') return true;\n if (item === 'false') return false;\n\n // Default to string\n return item;\n });\n }\n}","/**\n * Generic transition system for animating between elements\n */\n\nexport enum TransitionMode {\n /** out transition completes before in transition starts */\n SEQUENTIAL = 'sequential',\n /** both transitions happen at the same time */\n SIMULTANEOUS = 'simultaneous',\n}\n\nexport interface Transition {\n /**\n * Name of the transition (for identification)\n */\n name?: string;\n\n /**\n * Duration of the out transition in ms\n */\n outDuration?: number;\n\n /**\n * Duration of the in transition in ms\n */\n inDuration?: number;\n\n /**\n * CSS properties for the out transition (as string)\n * Example: 'opacity: 0; transform: scale(0.9)'\n */\n out?: string;\n\n /**\n * CSS properties for the in transition (as string)\n * Example: 'opacity: 1; transform: scale(1)'\n */\n in?: string;\n\n /**\n * Transition mode:\n * - `TransitionMode.SEQUENTIAL` ('sequential'): out transition completes before in transition starts\n * - `TransitionMode.SIMULTANEOUS` ('simultaneous'): both transitions happen at the same time\n */\n mode?: TransitionMode | `${TransitionMode}`;\n}\n","import { AppContext } from './app-context';\nimport { NavContext } from './nav-context';\nimport { Placard } from './placard';\nimport { RouteParams } from './route-params';\nimport { REGISTERED_ELEMENTS, IS_UPDATING, CONTEXT_REGISTER, CONTEXT_UNREGISTER, CONTEXT_NOTIFY_ELEMENT, CONTEXT_UPDATE } from '../symbols';\nimport type { Fetcher } from '../fetcher';\n\n// Symbol for storing the Set of elements\n// Use Symbol.for() to ensure symbols are shared across multiple Snice instances\nconst REGISTERED_ELEMENTS_SET = Symbol.for('snice:registered-elements-set');\n\n// Counter for generating unique context IDs\nlet contextIdCounter = 0;\n\n/**\n * Represents the bundled router state that can notify registered elements of changes\n */\nexport class Context {\n // Stores the SET of wrapped-method names per element so that classes with\n // multiple @context() handlers register every method, not just the last one.\n private [REGISTERED_ELEMENTS] = new WeakMap<HTMLElement, Set<string>>();\n private [REGISTERED_ELEMENTS_SET] = new Set<HTMLElement>();\n private [IS_UPDATING] = false;\n\n /**\n * Unique immutable identifier for this context instance\n */\n readonly id: number;\n\n /**\n * Application context (theme, auth, config, etc.)\n */\n application: AppContext;\n\n /**\n * Navigation state\n */\n navigation: NavContext;\n\n /**\n * Fetch function with optional middleware support\n * Bound to this Context instance, allowing middleware to access application and navigation state\n */\n fetch: typeof globalThis.fetch;\n\n constructor(context: AppContext = {}, placards: Placard[] = [], currentRoute = '', routeParams: RouteParams = {}, fetcher?: Fetcher) {\n this.id = contextIdCounter++;\n this.application = context;\n this.navigation = {\n placards,\n route: currentRoute,\n params: routeParams\n };\n\n // Initialize fetch with middleware support or fallback to native fetch\n if (fetcher && typeof fetcher.create === 'function') {\n this.fetch = fetcher.create(this);\n } else if (typeof fetch === 'function') {\n this.fetch = fetch.bind(this);\n } else {\n throw new Error('No fetch implementation available');\n }\n }\n\n /**\n * Register an element to receive context updates\n * @internal Used by @context decorator\n */\n [CONTEXT_REGISTER](element: HTMLElement, methodName: string): void {\n const map = this[REGISTERED_ELEMENTS] as WeakMap<HTMLElement, Set<string>>;\n let names = map.get(element);\n if (!names) {\n names = new Set<string>();\n map.set(element, names);\n }\n names.add(methodName);\n (this[REGISTERED_ELEMENTS_SET] as Set<HTMLElement>).add(element);\n }\n\n /**\n * Unregister an element from receiving context updates. With a methodName,\n * removes only that one handler (so a `once` handler tearing itself down\n * doesn't kill the element's other @context handlers); without one, removes\n * the element entirely (used on disconnect).\n * @internal Used by @context decorator cleanup\n */\n [CONTEXT_UNREGISTER](element: HTMLElement, methodName?: string): void {\n const map = this[REGISTERED_ELEMENTS] as WeakMap<HTMLElement, Set<string>>;\n\n if (methodName !== undefined) {\n const names = map.get(element);\n if (!names) return;\n names.delete(methodName);\n if (names.size > 0) return; // other handlers remain — keep the element\n }\n\n map.delete(element);\n (this[REGISTERED_ELEMENTS_SET] as Set<HTMLElement>).delete(element);\n }\n\n /**\n * Update the context and notify all registered elements\n * Prevents infinite loops by tracking update state\n * @internal Used by Router during navigation\n */\n [CONTEXT_UPDATE](context: AppContext, placards: Placard[], currentRoute: string, routeParams: RouteParams): void {\n this.application = context;\n this.navigation.placards = placards;\n this.navigation.route = currentRoute;\n this.navigation.params = routeParams;\n this.notify();\n }\n\n /**\n * Signal all @context() subscribers to re-read context\n * Does not modify any state — just notifies listeners with current values\n */\n update(): void {\n this.notify();\n }\n\n private notify(): void {\n // Prevent infinite loops\n if (this[IS_UPDATING]) {\n return;\n }\n\n this[IS_UPDATING] = true;\n\n // Notify all registered elements by calling EVERY registered method\n // name on each. Classes with multiple @context() methods get all fired.\n const elementsSet = this[REGISTERED_ELEMENTS_SET] as Set<HTMLElement>;\n const elementsMap = this[REGISTERED_ELEMENTS] as WeakMap<HTMLElement, Set<string>>;\n\n for (const element of elementsSet) {\n const names = elementsMap.get(element);\n if (!names) continue;\n for (const methodName of names) {\n if (typeof (element as any)[methodName] === 'function') {\n try {\n (element as any)[methodName](this);\n } catch (error) {\n console.error(`Error calling @context method ${methodName}:`, error);\n }\n }\n }\n }\n\n this[IS_UPDATING] = false;\n }\n\n /**\n * Notify a specific element of the current context state\n * @internal Used by @context decorator\n */\n [CONTEXT_NOTIFY_ELEMENT](element: HTMLElement): void {\n const names = (this[REGISTERED_ELEMENTS] as WeakMap<HTMLElement, Set<string>>).get(element);\n if (!names) return;\n for (const methodName of names) {\n if (typeof (element as any)[methodName] === 'function') {\n (element as any)[methodName](this);\n }\n }\n }\n}\n","import { SimpleArray, PropertyOptions } from './types';\nimport { PROPERTY_WATCHERS, PROPERTIES } from './symbols';\n\n/**\n * Detects the type constructor from an initial value\n * @param initialValue - The default value assigned to a property field (e.g., `name = \"default\"` -> \"default\")\n * @returns The constructor function (String, Number, Boolean, etc.) or undefined if type can't be determined\n */\nexport function detectType(initialValue: any): any {\n if (initialValue === null || initialValue === undefined) {\n return undefined;\n }\n\n if (typeof initialValue === 'string') {\n return String;\n }\n\n if (typeof initialValue === 'number') {\n return Number;\n }\n\n if (typeof initialValue === 'boolean') {\n return Boolean;\n }\n\n if (initialValue instanceof Date) {\n return Date;\n }\n\n if (typeof initialValue === 'bigint') {\n return BigInt;\n }\n\n if (Array.isArray(initialValue)) {\n return Array;\n }\n\n return undefined;\n}\n\n/**\n * Parses an attribute value based on the property type\n * @param attributeValue - The raw string value from the HTML attribute (e.g., \"123\", \"true\", \"hello\")\n * @param propertyOptions - The options from @property decorator (contains explicit type, attribute name, etc.)\n * @param currentValue - The current stored value of the property (used for type inference when no explicit type)\n * @param initialValue - The default value assigned to the property field (used for type detection as fallback)\n * @returns The parsed value in the correct JavaScript type\n */\nexport function parseAttributeValue(attributeValue: string | null, propertyOptions: PropertyOptions, currentValue?: any, initialValue?: any): any {\n // Use explicit type or detect from initial value\n const typeToUse = propertyOptions.type || detectType(initialValue);\n\n if (propertyOptions.converter?.fromAttribute) {\n return propertyOptions.converter.fromAttribute(attributeValue, typeToUse);\n }\n\n switch (typeToUse) {\n case Boolean:\n // Boolean semantics per user specification:\n // - No attribute = false\n // - String \"false\" = false\n // - String \"true\" = true\n // - Empty string = true (attribute exists like <element bool-attr>)\n // - Any other value = true\n\n if (attributeValue === null) return false; // No attribute\n if (attributeValue === 'false') return false; // String \"false\"\n\n // All other cases (including empty string) = true (attribute exists)\n return true;\n case Number:\n return attributeValue !== null ? Number(attributeValue) : null;\n case String:\n return attributeValue;\n case Date:\n return attributeValue ? new Date(attributeValue) : null;\n case BigInt:\n if (attributeValue && attributeValue.endsWith('n')) {\n return BigInt(attributeValue.slice(0, -1));\n } else {\n return attributeValue ? BigInt(attributeValue) : null;\n }\n case SimpleArray:\n return SimpleArray.parse(attributeValue);\n case Array:\n try {\n return attributeValue ? JSON.parse(attributeValue) : [];\n } catch {\n return [];\n }\n case Object:\n try {\n return attributeValue ? JSON.parse(attributeValue) : {};\n } catch {\n return {};\n }\n default:\n // If no type specified and can't detect, try to infer from current value type\n if (typeof currentValue === 'number' && attributeValue !== null) {\n return Number(attributeValue);\n } else {\n return attributeValue;\n }\n }\n}\n\n/**\n * Converts a property value to its attribute string representation\n * @param value - The property value to convert\n * @param propertyOptions - The options from @property decorator\n * @param initialValue - The default value assigned to the property field (used for type detection)\n * @returns The string representation for the HTML attribute, or null if value should remove attribute\n */\n/**\n * Default property dirty-check: has the value changed? Like `!==`, but treats\n * NaN → NaN as unchanged (NaN !== NaN would otherwise re-fire forever).\n */\nexport function notEqual(value: unknown, old: unknown): boolean {\n // Changed unless strictly equal, or both are NaN (each self-unequal).\n return value !== old && (value === value || old === old);\n}\n\n/**\n * Extract attribute name from property options\n */\nexport function getAttrName(opts: PropertyOptions, propName: string): string {\n // Lowercase always: the DOM stores attribute names lowercase, so an explicit\n // camelCase `attribute:` would otherwise never match observedAttributes and\n // attributeChangedCallback would never fire. get/setAttribute are already\n // case-insensitive, so this is safe for every caller.\n if (typeof opts.attribute === 'string') return opts.attribute.toLowerCase();\n if (opts.attribute === true || opts.attributeNaming === 'kebab') {\n return propName.replace(/([a-z0-9])([A-Z])/g, '$1-$2').toLowerCase();\n }\n return propName.toLowerCase();\n}\n\n/**\n * Escape HTML text-node content. Use for text that will be interpolated\n * into an HTML string (not an attribute value).\n */\nexport function escapeHtml(value: unknown): string {\n return String(value ?? '')\n .replace(/&/g, '&amp;')\n .replace(/</g, '&lt;')\n .replace(/>/g, '&gt;');\n}\n\n/**\n * Escape HTML attribute value. Use for anything interpolated inside a\n * quoted attribute (e.g. `href=\"${...}\"`). Escapes both quote styles so\n * the value cannot close the attribute or the surrounding tag.\n */\nexport function escapeAttr(value: unknown): string {\n return String(value ?? '')\n .replace(/&/g, '&amp;')\n .replace(/</g, '&lt;')\n .replace(/>/g, '&gt;')\n .replace(/\"/g, '&quot;')\n .replace(/'/g, '&#39;');\n}\n\n/**\n * Validate a URL's scheme against a safe-list. Relative references are\n * accepted after parsing, while absolute and network-path references must\n * resolve to an allowed protocol. Raw ASCII control characters are rejected\n * before parsing so they cannot be stripped out to disguise a scheme.\n *\n * Rejects `javascript:`, `data:`, `vbscript:`, and any scheme not in the\n * allowed set by default. Pass to `window.open`, `iframe.src`, `<a href>`,\n * etc. when the URL originates from user input.\n *\n * @example\n * if (!isSafeUrl(url)) return;\n * window.open(url, '_blank');\n */\nexport function isSafeUrl(\n url: unknown,\n opts: { allowed?: readonly string[] } = {}\n): boolean {\n let raw: string;\n try {\n raw = String(url ?? '');\n } catch {\n return false;\n }\n\n if (!raw || /[\\u0000-\\u001f\\u007f]/.test(raw)) return false;\n const s = raw.trim();\n if (!s) return false;\n const allowed = opts.allowed ?? ['http:', 'https:', 'mailto:', 'tel:'];\n\n try {\n const parsed = new URL(s, 'http://__snice-relative.invalid/');\n const hasExplicitScheme = /^[a-z][a-z\\d+.-]*:/i.test(s);\n const isNetworkPathReference = /^[\\\\/]{2}/.test(s);\n\n // Paths, hashes, and query-only references inherit the embedding page's\n // protocol and are safe independently of the absolute-protocol allowlist.\n if (!hasExplicitScheme && !isNetworkPathReference) return true;\n\n return allowed.some(protocol =>\n typeof protocol === 'string'\n && protocol.toLowerCase() === parsed.protocol\n );\n } catch {\n return false;\n }\n}\n\n/**\n * Duration helper returned by {@link parseDuration}. Exposes the parsed\n * value in multiple units without repeated regex parsing at call sites.\n */\nexport interface Duration {\n milliseconds(): number;\n seconds(): number;\n minutes(): number;\n}\n\n/**\n * Parse a duration string into a unit-aware Duration.\n * Recognized suffixes: `ms` (milliseconds), `s` (seconds), `m` (minutes),\n * `h` (hours). Plain numbers with no suffix are treated as milliseconds.\n * Unparseable input yields a zero-duration.\n *\n * @example\n * parseDuration('200ms').milliseconds() // 200\n * parseDuration('0.4s').milliseconds() // 400\n * parseDuration('0.4s').seconds() // 0.4\n */\nexport function parseDuration(value: string): Duration {\n const v = String(value).trim();\n const num = parseFloat(v);\n let ms: number;\n if (isNaN(num)) {\n ms = 0;\n } else if (/ms$/i.test(v)) {\n ms = num;\n } else if (/s$/i.test(v)) {\n ms = num * 1000;\n } else if (/m$/i.test(v)) {\n ms = num * 60000;\n } else if (/h$/i.test(v)) {\n ms = num * 3600000;\n } else {\n ms = num;\n }\n return {\n milliseconds: () => ms,\n seconds: () => ms / 1000,\n minutes: () => ms / 60000,\n };\n}\n\n/**\n * Lazy-init a Set on a symbol key\n */\nexport function ensureSet<T>(obj: any, sym: symbol): Set<T> {\n if (!obj[sym]) obj[sym] = new Set<T>();\n return obj[sym];\n}\n\n/**\n * Lazy-init an object on a symbol key\n */\nexport function ensureObj(obj: any, sym: symbol): Record<string, any> {\n if (!obj[sym]) obj[sym] = {};\n return obj[sym];\n}\n\n/**\n * Invoke property watchers for a given property change\n */\nexport function invokeWatchers(instance: any, constructor: any, propName: string, oldValue: any, newValue: any): void {\n const watchers = constructor[PROPERTY_WATCHERS];\n if (!watchers) return;\n\n // Look up watchers by the JS property name AND the explicit `attribute:`\n // name (if declared). Lets `@watch('show-dropdown')` match a property\n // declared as `@property({ attribute: 'show-dropdown' }) showDropdown`.\n const keys: string[] = [propName];\n const propOpts = constructor[PROPERTIES]?.get(propName);\n const attrName = propOpts && typeof propOpts.attribute === 'string' ? propOpts.attribute : null;\n if (attrName && attrName !== propName) keys.push(attrName);\n\n for (const key of keys) {\n if (watchers.has(key)) {\n for (const w of watchers.get(key)) {\n try { w.method.call(instance, oldValue, newValue, propName); }\n catch (e) { console.error(`Error in @watch('${key}') method ${w.methodName}:`, e); }\n }\n }\n }\n\n if (watchers.has('*')) {\n for (const w of watchers.get('*')) {\n try { w.method.call(instance, oldValue, newValue, propName); }\n catch (e) { console.error(`Error in @watch('*') method ${w.methodName}:`, e); }\n }\n }\n}\n\n/**\n * Fire the one-time initialization call for `@watch(..., { immediate: true })`\n * handlers. Runs once per declared property after the element is initialized,\n * passing the effective initial value with `oldValue` undefined. Non-immediate\n * watchers are untouched — they only react to later changes.\n */\nexport function invokeImmediateWatchers(instance: any, constructor: any): void {\n const watchers = constructor[PROPERTY_WATCHERS];\n const properties = constructor[PROPERTIES];\n if (!watchers || !properties) return;\n\n for (const [propName, propOptions] of properties) {\n // A watcher may be registered under the JS name, the explicit `attribute:`\n // name, or the `*` wildcard; fire each immediate one exactly once, keyed to\n // this property's current value.\n const keys: string[] = [propName];\n const attrName = propOptions && typeof propOptions.attribute === 'string' ? propOptions.attribute : null;\n if (attrName && attrName !== propName) keys.push(attrName);\n keys.push('*');\n\n for (const key of keys) {\n if (!watchers.has(key)) continue;\n for (const w of watchers.get(key)) {\n if (!w.immediate) continue;\n try { w.method.call(instance, undefined, instance[propName], propName); }\n catch (e) { console.error(`Error in @watch('${key}') method ${w.methodName}:`, e); }\n }\n }\n }\n}\n\n/**\n * Create a debounced version of a function\n */\nexport function createDebounced<T extends (...args: any[]) => any>(fn: T, delay: number): T {\n let timer: ReturnType<typeof setTimeout> | null = null;\n return function(this: any, ...args: any[]) {\n if (timer !== null) clearTimeout(timer);\n timer = setTimeout(() => { fn.apply(this, args); timer = null; }, delay);\n } as T;\n}\n\n/**\n * Create a throttled version of a function (leading + trailing edge)\n */\nexport function createThrottled<T extends (...args: any[]) => any>(fn: T, delay: number): T {\n let lastCall = 0;\n let timer: ReturnType<typeof setTimeout> | null = null;\n return function(this: any, ...args: any[]) {\n const now = Date.now();\n const remaining = delay - (now - lastCall);\n if (remaining <= 0) {\n if (timer) { clearTimeout(timer); timer = null; }\n lastCall = now;\n return fn.apply(this, args);\n }\n if (!timer) {\n timer = setTimeout(() => { lastCall = Date.now(); timer = null; fn.apply(this, args); }, remaining);\n }\n } as T;\n}\n\n/**\n * Resolve a scope option to a concrete EventTarget.\n *\n * - undefined → host element (default behavior)\n * - 'global' → `document`\n * - string → `host.closest(selector)` (nearest matching ancestor)\n * - EventTarget instance → that target directly\n * - resolver function → called with host as `this`, returns target or null\n *\n * Returns null when the scope cannot be resolved (e.g. selector matches no\n * ancestor, resolver returns null). Caller decides how to handle null —\n * typically warn in dev and skip listener attachment.\n */\nexport function resolveScope(host: HTMLElement, scope: unknown): EventTarget | null {\n if (scope === undefined || scope === null) return host;\n if (scope === 'global') return typeof document !== 'undefined' ? document : null;\n if (typeof scope === 'function') {\n try {\n return (scope as (this: HTMLElement) => EventTarget | null).call(host) || null;\n } catch {\n return null;\n }\n }\n if (typeof scope === 'string') {\n return host.closest?.(scope) || null;\n }\n // Direct EventTarget instance.\n if (scope && typeof (scope as EventTarget).addEventListener === 'function') {\n return scope as EventTarget;\n }\n return null;\n}\n\nexport function valueToAttribute(value: any, propertyOptions: PropertyOptions, initialValue?: any): string | null {\n // Handle null/undefined/false values and empty arrays\n if (value === null || value === undefined || value === false ||\n (propertyOptions?.type === SimpleArray && Array.isArray(value) && value.length === 0)) {\n return null;\n }\n\n // Use custom converter if provided\n if (propertyOptions.converter?.toAttribute) {\n return propertyOptions.converter.toAttribute(value, propertyOptions.type);\n }\n\n // Use explicit type or detect from initial value\n const typeToUse = propertyOptions.type || detectType(initialValue);\n\n switch (typeToUse) {\n case Boolean:\n // For boolean attributes, return \"true\" when true\n // (false is already handled above - returns null to remove attribute)\n return 'true';\n case Date:\n return value instanceof Date ? value.toISOString() : String(value);\n case BigInt:\n return typeof value === 'bigint' ? value.toString() + 'n' : String(value);\n case SimpleArray:\n return Array.isArray(value) ? SimpleArray.serialize(value) : String(value);\n case Array:\n return Array.isArray(value) ? JSON.stringify(value) : String(value);\n case Object:\n return typeof value === 'object' && value !== null ? JSON.stringify(value) : String(value);\n default:\n return String(value);\n }\n}\n/**\n * Warn (once per class) about @watch targets that match no @property —\n * such watchers can never fire, and the typo is otherwise silent.\n * Valid targets: property names, their attribute forms, and the '*' wildcard.\n */\nconst validatedWatchClasses = new WeakSet<Function>();\n\nexport function validateWatchedProperties(instance: any, constructor: any): void {\n if (validatedWatchClasses.has(constructor)) return;\n validatedWatchClasses.add(constructor);\n\n const watchers: Map<string, any[]> | undefined = constructor[PROPERTY_WATCHERS];\n if (!watchers || watchers.size === 0) return;\n\n const properties: Map<string, PropertyOptions> | undefined = constructor[PROPERTIES];\n // invokeWatchers matches exactly: the property name, or an EXPLICIT\n // `attribute:` string. A derived/lowercased attribute name is NOT watchable,\n // so it must not be treated as valid here.\n const valid = new Set<string>(['*']);\n if (properties) {\n for (const [name, opts] of properties) {\n valid.add(name);\n if (typeof opts?.attribute === 'string') valid.add(opts.attribute);\n }\n }\n\n for (const key of watchers.keys()) {\n if (valid.has(key)) continue;\n const tag = instance.tagName ? instance.tagName.toLowerCase() : 'element';\n const known = properties ? [...properties.keys()].join(', ') : '(none)';\n console.warn(\n `@watch('${key}') on <${tag}> matches no @property — it will never fire. ` +\n `Known properties: ${known}.`\n );\n }\n}\n","import { OBSERVERS, CLEANUP, IS_CONTROLLER_INSTANCE, OBSERVE_METHODS } from './symbols';\nimport { ObserveOptions } from './types/observe-options';\nimport { createThrottled } from './utils';\n\n\ninterface ObserverMetadata {\n type: string;\n target: string;\n selector?: string;\n methodName: string;\n method: Function;\n options?: ObserveOptions;\n}\n\n// Global cache for MediaQueryList objects\nconst mediaQueryCache = new Map<string, MediaQueryList>();\n\n\n/**\n * Decorator for observing external changes like viewport intersection, resize, media queries, and DOM mutations\n * \n * @param target - The observation target (e.g., 'intersection', 'resize', 'media:(min-width: 768px)', 'mutation:childList') or array of targets\n * @param selectorOrOptions - CSS selector for element to observe OR options object\n * @param options - Options object (when second parameter is a selector)\n */\nexport function observe(observeTarget: string | string[], selectorOrOptions?: string | ObserveOptions, options?: ObserveOptions) {\n // Handle overloaded parameters\n let selector: string | undefined;\n let opts: ObserveOptions | undefined;\n \n if (typeof selectorOrOptions === 'string') {\n selector = selectorOrOptions;\n opts = options;\n } else {\n selector = undefined;\n opts = selectorOrOptions;\n }\n \n return function (target: any, context: ClassMethodDecoratorContext) {\n const propertyKey = context.name as string;\n context.addInitializer(function(this: any) {\n const constructor = this.constructor as any;\n\n // hasOwnProperty guards so subclasses don't mutate parent state via\n // the prototype chain. Without this, instantiating a child pushes into\n // the parent's OBSERVERS array and fires child observers on fresh\n // parent instances.\n if (!Object.prototype.hasOwnProperty.call(constructor, OBSERVE_METHODS)) {\n constructor[OBSERVE_METHODS] = new Set();\n }\n if (constructor[OBSERVE_METHODS].has(target)) return;\n constructor[OBSERVE_METHODS].add(target);\n\n if (!Object.prototype.hasOwnProperty.call(constructor, OBSERVERS)) {\n const inherited = constructor[OBSERVERS];\n constructor[OBSERVERS] = inherited ? [...inherited] : [];\n }\n\n const observeTargets = Array.isArray(observeTarget) ? observeTarget : [observeTarget];\n\n for (const targetString of observeTargets) {\n const [type, ...modifiers] = targetString.split(':');\n const targetStr = modifiers.join(':');\n\n constructor[OBSERVERS].push({\n type,\n target: targetStr,\n selector,\n methodName: propertyKey,\n method: target,\n options: opts\n });\n }\n });\n };\n}\n\n// Helper to setup observers for elements\nexport function setupObservers(instance: any, element: HTMLElement) {\n const observers = instance.constructor[OBSERVERS];\n if (!observers || !Array.isArray(observers) || observers.length === 0) {\n return;\n }\n \n // Initialize cleanup object if needed\n if (!instance[CLEANUP]) {\n instance[CLEANUP] = { events: [], channels: [], observers: [] };\n } else if (!instance[CLEANUP].observers) {\n instance[CLEANUP].observers = [];\n }\n \n for (const observer of observers) {\n const method = observer.method.bind(instance);\n \n // Apply throttling if specified\n const callback = observer.options?.throttle\n ? createThrottled(method, observer.options.throttle)\n : method;\n \n switch (observer.type) {\n case 'intersection':\n setupIntersectionObserver(instance, element, observer, callback);\n break;\n case 'resize':\n setupResizeObserver(instance, element, observer, callback);\n break;\n case 'media':\n setupMediaQueryObserver(instance, element, observer, callback);\n break;\n case 'mutation':\n setupMutationObserver(instance, element, observer, callback);\n break;\n default:\n console.warn(`Unknown observer type: ${observer.type}`);\n }\n }\n}\n\nfunction setupIntersectionObserver(\n instance: any, \n element: HTMLElement, \n observer: ObserverMetadata, \n callback: Function\n) {\n const options: IntersectionObserverInit = {\n threshold: observer.options?.threshold ?? 0,\n rootMargin: observer.options?.rootMargin ?? '0px',\n root: observer.options?.root ?? null\n };\n \n // Wrap callback to handle return value\n const wrappedCallback = (entries: IntersectionObserverEntry[]) => {\n for (const entry of entries) {\n try {\n const result = callback(entry);\n if (result === false && io) {\n io.unobserve(entry.target);\n }\n } catch (error) {\n console.error(`Error in intersection observer ${observer.methodName}:`, error);\n }\n }\n };\n\n if (typeof IntersectionObserver === 'undefined') {\n console.warn('IntersectionObserver is not available in this environment');\n return;\n }\n\n const io = new IntersectionObserver(wrappedCallback, options);\n \n // Find target elements\n const targets = observer.selector \n ? Array.from(element.shadowRoot?.querySelectorAll(observer.selector) || [])\n : [element];\n \n // Start observing\n targets.forEach(target => io!.observe(target));\n \n // Store cleanup\n instance[CLEANUP].observers.push(() => {\n targets.forEach(target => io!.unobserve(target));\n // Only disconnect if no more targets\n if (io!.takeRecords().length === 0) {\n io!.disconnect();\n }\n });\n}\n\nfunction setupResizeObserver(\n instance: any, \n element: HTMLElement, \n observer: ObserverMetadata, \n callback: Function\n) {\n const box = observer.options?.box || 'content-box';\n \n // Wrap callback with error handling\n const wrappedCallback = (entries: ResizeObserverEntry[]) => {\n for (const entry of entries) {\n try {\n callback(entry);\n } catch (error) {\n console.error(`Error in resize observer ${observer.methodName}:`, error);\n }\n }\n };\n \n // Check if ResizeObserver is available\n if (typeof ResizeObserver === 'undefined') {\n console.warn('ResizeObserver is not available in this environment');\n return;\n }\n \n // Create ResizeObserver\n const ro = new ResizeObserver(wrappedCallback);\n \n // Find target elements\n const targets = observer.selector \n ? Array.from(element.shadowRoot?.querySelectorAll(observer.selector) || [])\n : [element];\n \n // Start observing with options\n targets.forEach(target => {\n ro.observe(target, { box });\n });\n \n // Store cleanup\n instance[CLEANUP].observers.push(() => {\n ro.disconnect();\n });\n}\n\nfunction setupMediaQueryObserver(\n instance: any, \n _element: HTMLElement, \n observer: ObserverMetadata, \n callback: Function\n) {\n // Extract media query from target (e.g., \"media:(min-width: 768px)\" -> \"(min-width: 768px)\")\n const mediaQuery = observer.target;\n \n if (!mediaQuery) {\n console.warn('Media query observer requires a query string');\n return;\n }\n \n // Get or create MediaQueryList (cached globally)\n let mql = mediaQueryCache.get(mediaQuery);\n if (!mql) {\n try {\n mql = window.matchMedia(mediaQuery);\n mediaQueryCache.set(mediaQuery, mql);\n } catch (error) {\n console.error(`Invalid media query: ${mediaQuery}`, error);\n return;\n }\n }\n \n // Wrap callback with error handling\n const wrappedCallback = (event: MediaQueryListEvent | MediaQueryList) => {\n try {\n callback('matches' in event ? event.matches : (event as MediaQueryListEvent).matches);\n } catch (error) {\n console.error(`Error in media query observer ${observer.methodName}:`, error);\n }\n };\n \n // Call immediately with current state\n wrappedCallback(mql);\n \n // Listen for changes\n const changeHandler = (e: MediaQueryListEvent) => wrappedCallback(e);\n \n // Modern browsers use addEventListener\n if (mql.addEventListener) {\n mql.addEventListener('change', changeHandler);\n instance[CLEANUP].observers.push(() => {\n mql!.removeEventListener('change', changeHandler);\n });\n } else {\n // Fallback for older browsers\n mql.addListener(changeHandler);\n instance[CLEANUP].observers.push(() => {\n mql!.removeListener(changeHandler);\n });\n }\n}\n\nfunction setupMutationObserver(\n instance: any, \n element: HTMLElement, \n observer: ObserverMetadata, \n callback: Function\n) {\n // Parse mutation type and attribute from target\n // e.g., \"childList\", \"attributes:class\", \"attributes:data-state\"\n const parts = observer.target.split(':');\n const mutationType = parts[0] || 'childList';\n const attributeName = parts[1];\n \n // Build MutationObserver options\n const options: MutationObserverInit = {};\n \n switch (mutationType) {\n case 'childList':\n options.childList = true;\n break;\n case 'attributes':\n options.attributes = true;\n if (attributeName) {\n options.attributeFilter = [attributeName];\n }\n break;\n default: {\n // A leading . # or [ means the author put a CSS selector where the\n // mutation type goes — point at the correct two-argument form.\n if (/^[.#[]/.test(mutationType)) {\n console.warn(\n `@observe: \"mutation:${mutationType}\" — \"${mutationType}\" looks like a selector. ` +\n `Selectors are the second argument — did you mean ` +\n `@observe('mutation:childList', '${mutationType}')?`\n );\n } else {\n console.warn(`Unknown mutation type: ${mutationType} (expected childList or attributes)`);\n }\n return;\n }\n }\n \n // Apply subtree with safety limits\n if (observer.options?.subtree) {\n options.subtree = true;\n // Could implement maxDepth checking in the callback\n if (observer.options.maxDepth) {\n console.warn('maxDepth is set but requires custom implementation');\n }\n }\n \n // Wrap callback with error handling and optional depth filtering\n const needsDepthFilter = !!(observer.options?.maxDepth && observer.options.subtree);\n const wrappedCallback = (mutations: MutationRecord[]) => {\n try {\n if (!needsDepthFilter) {\n callback(mutations);\n return;\n }\n\n const maxDepth = observer.options!.maxDepth!;\n const root = element.shadowRoot || element;\n const filtered = mutations.filter(mutation => {\n let depth = 0;\n let current = mutation.target as Node;\n while (current && current !== root && depth < maxDepth) {\n current = current.parentNode!;\n depth++;\n }\n return depth < maxDepth;\n });\n\n if (filtered.length > 0) callback(filtered);\n } catch (error) {\n console.error(`Error in mutation observer ${observer.methodName}:`, error);\n }\n };\n \n // Create MutationObserver\n const mo = new MutationObserver(wrappedCallback);\n \n // Find target elements\n const isController = instance[IS_CONTROLLER_INSTANCE] === true;\n \n // For mutation observers without selector:\n // - Controllers: observe the shadow DOM of the element they're attached to (if it exists)\n // - Elements: observe the element itself (light DOM) to avoid infinite loops\n const targets = observer.selector \n ? Array.from(element.shadowRoot?.querySelectorAll(observer.selector) || [])\n : isController && element.shadowRoot \n ? [element.shadowRoot]\n : [element];\n \n // Start observing\n targets.forEach(target => {\n mo.observe(target, options);\n });\n \n // Store cleanup\n instance[CLEANUP].observers.push(() => {\n mo.disconnect();\n });\n}\n\n// Helper to cleanup observers\nexport function cleanupObservers(instance: any) {\n if (instance[CLEANUP]?.observers) {\n for (const cleanup of instance[CLEANUP].observers) {\n cleanup();\n }\n instance[CLEANUP].observers = [];\n }\n}","import { IS_CONTROLLER_INSTANCE, ROUTER_CONTEXT } from './symbols';\nimport type { AppContext } from './types/app-context';\n\nconst CONTEXT_REQUEST_EVENT = '@context/request';\n\ninterface ContextRequestDetail {\n context?: AppContext;\n}\n\ninterface ProviderRecord {\n listener: EventListener;\n}\n\nconst providers = new WeakMap<EventTarget, ProviderRecord>();\n\n/** @internal */\nexport function hasContextProvider(root: EventTarget): boolean {\n return providers.has(root);\n}\n\nfunction contextTarget(source: unknown): EventTarget | null {\n if (!source || (typeof source !== 'object' && typeof source !== 'function')) {\n return null;\n }\n\n const value = source as any;\n if (value[IS_CONTROLLER_INSTANCE] === true) {\n return value.element && typeof value.element.dispatchEvent === 'function'\n ? value.element\n : null;\n }\n\n return typeof value.dispatchEvent === 'function' ? value as EventTarget : null;\n}\n\n/**\n * Installs the low-level application-context provider on a concrete event\n * boundary. Public callers use provideContext(), which also activates the\n * daemon instances declared by the context.\n */\nexport function installContextProvider(root: EventTarget, context: AppContext): () => void {\n if (!root || typeof root.addEventListener !== 'function' || typeof root.removeEventListener !== 'function') {\n throw new TypeError('provideContext() requires an EventTarget root.');\n }\n if (!context || typeof context !== 'object') {\n throw new TypeError('provideContext() requires an application context object.');\n }\n if (providers.has(root)) {\n throw new Error('This root already provides an application context. Release it before providing another.');\n }\n\n const listener: EventListener = (event) => {\n const request = event as CustomEvent<ContextRequestDetail>;\n if (!request.detail || request.detail.context !== undefined) return;\n\n request.detail.context = context;\n request.preventDefault();\n request.stopPropagation();\n };\n\n root.addEventListener(CONTEXT_REQUEST_EVENT, listener);\n providers.set(root, { listener });\n\n let released = false;\n return () => {\n if (released) return;\n released = true;\n\n const current = providers.get(root);\n if (current?.listener === listener) {\n root.removeEventListener(CONTEXT_REQUEST_EVENT, listener);\n providers.delete(root);\n }\n };\n}\n\n/**\n * Resolves the raw application context visible to an element or controller.\n * A single composed, bubbling request is answered by the nearest\n * provideContext() root. Router-injected context remains a fallback for a\n * detached page or controller that cannot currently reach its provider.\n */\nexport function getContext<T extends AppContext = AppContext>(source: unknown): T | undefined {\n if (!source || (typeof source !== 'object' && typeof source !== 'function')) {\n return undefined;\n }\n\n const target = contextTarget(source);\n if (target) {\n const detail: ContextRequestDetail = {};\n target.dispatchEvent(new CustomEvent<ContextRequestDetail>(CONTEXT_REQUEST_EVENT, {\n bubbles: true,\n composed: true,\n cancelable: true,\n detail,\n }));\n if (detail.context !== undefined) return detail.context as T;\n }\n\n const value = source as any;\n if (value[ROUTER_CONTEXT] !== undefined) {\n return value[ROUTER_CONTEXT] as T;\n }\n if (value[IS_CONTROLLER_INSTANCE] === true && value.element?.[ROUTER_CONTEXT] !== undefined) {\n return value.element[ROUTER_CONTEXT] as T;\n }\n return undefined;\n}\n","import { DAEMON_STATE, IS_CONTROLLER_INSTANCE, IS_DAEMON_CLASS, IS_DAEMON_INSTANCE } from './symbols';\nimport { getContext } from './context-provider';\nimport type { AppContext } from './types/app-context';\n\nexport interface DaemonCommunicationState {\n target: EventTarget;\n bindings: number;\n active: boolean;\n}\n\nexport function isDaemonInstance(value: unknown): value is object {\n return !!value\n && (typeof value === 'object' || typeof value === 'function')\n && (value as any)[IS_DAEMON_CLASS] === true;\n}\n\nexport function daemonState(instance: object): DaemonCommunicationState {\n if (!isDaemonInstance(instance)) {\n throw new TypeError('Application contexts may provide only instances of @daemon classes.');\n }\n\n let state = (instance as any)[DAEMON_STATE] as DaemonCommunicationState | undefined;\n if (!state) {\n state = {\n target: new EventTarget(),\n bindings: 0,\n active: false,\n };\n try {\n Object.defineProperty(instance, DAEMON_STATE, {\n value: state,\n configurable: true,\n });\n Object.defineProperty(instance, IS_DAEMON_INSTANCE, {\n value: true,\n configurable: true,\n });\n } catch {\n throw new TypeError('@daemon instances must remain extensible until they are provided to an app context.');\n }\n }\n return state;\n}\n\nexport function getDaemonTarget(instance: object): EventTarget {\n return daemonState(instance).target;\n}\n\nfunction sourceLabel(source: unknown): string {\n const value = source as any;\n if (value?.[IS_CONTROLLER_INSTANCE] === true) return 'controller';\n if (isDaemonInstance(value)) return '@daemon instance';\n return 'element';\n}\n\nexport function requireDaemonTarget(source: unknown, name: string): EventTarget {\n if (typeof name !== 'string' || !name.trim()) {\n throw new TypeError('Daemon addresses must be non-empty strings.');\n }\n\n const context = getContext<AppContext>(source);\n if (!context) {\n throw new Error(`[snice] ${sourceLabel(source)} cannot resolve daemon \"${name}\" because no app context is provided.`);\n }\n\n const instance = context.daemons?.[name];\n if (!instance) {\n throw new Error(`[snice] app context does not provide daemon \"${name}\".`);\n }\n if (!isDaemonInstance(instance)) {\n throw new TypeError(`[snice] app context entry \"${name}\" is not an instance of an @daemon class.`);\n }\n\n const state = daemonState(instance);\n if (!state.active) {\n throw new Error(`[snice] daemon \"${name}\" is not active because its app context has not been provided.`);\n }\n return state.target;\n}\n\nexport function defaultCommunicationTarget(instance: any): EventTarget | null {\n if (isDaemonInstance(instance)) {\n return getDaemonTarget(instance);\n }\n if (instance?.[IS_CONTROLLER_INSTANCE] === true) {\n return instance.element && typeof instance.element.dispatchEvent === 'function'\n ? instance.element\n : null;\n }\n if (instance && typeof instance.dispatchEvent === 'function') {\n return instance as EventTarget;\n }\n return null;\n}\n","import { CHANNEL_HANDLERS, CLEANUP, RESPOND_METHODS } from './symbols';\nimport { RequestOptions } from './types/request-options';\nimport { RespondOptions } from './types/respond-options';\nimport { defaultCommunicationTarget, requireDaemonTarget } from './daemon-target';\n\n/**\n * Return type for methods decorated with `@request`.\n *\n * TypeScript cannot express a method decorator changing an async generator\n * into a promise-returning method. This pragmatic helper suppresses that\n * mismatch while documenting the response value for readers and tooling.\n */\nexport type Response<T = any> = T | any;\n\n// @request decorator transforms methods to return Promise<T>\n\n\n/**\n * Decorator for making requests from elements or controllers.\n * Uses async generator pattern for bidirectional communication.\n * \n * @param requestName The name of the request\n * @param options Optional configuration\n */\nexport function request<T = any>(requestName: string, options?: RequestOptions) {\n return function (originalMethod: any, _context: ClassMethodDecoratorContext): (...args: any[]) => Promise<T> {\n // Create timing variables for debounce/throttle\n let debounceTimeout: any;\n let throttleLastCall = 0;\n let throttleTimeout: any;\n const throttleTrailingResolvers: Array<{ resolve: (v: any) => void; reject: (e: any) => void }> = [];\n\n return async function (this: any, ...args: any[]) {\n const actualRequest = async () => {\n // @request always acts as requester (client side)\n const responseTimeout = options?.timeout ?? 120000; // Default 2 minute timeout\n const discoveryTimeout = options?.discoveryTimeout ?? 50; // Default 50ms discovery timeout\n\n // Resolve before creating timeout promises. A missing daemon/context\n // should reject immediately without leaving an orphaned discovery\n // timer behind.\n const dispatcher = options?.daemon !== undefined\n ? requireDaemonTarget(this, options.daemon)\n : defaultCommunicationTarget(this);\n if (!dispatcher) {\n throw new TypeError(\n `@request('${requestName}') requires an element, attached controller, or provided @daemon instance.`\n );\n }\n \n // Create the generator\n const generator = originalMethod.apply(this, args);\n \n // Get the first yield (the request payload)\n const { value: payload, done } = await generator.next();\n \n if (done) {\n // Generator returned without yielding\n return payload;\n }\n \n // Create data promise and expose resolve/reject\n let dataResolve: (value: any) => void;\n let dataReject: (reason?: any) => void;\n const dataPromise = new Promise((resolve, reject) => {\n dataResolve = resolve;\n dataReject = reject;\n });\n \n // Create discovery timeout promise and expose resolve/reject\n let discoveryResolve: () => void;\n let discoveryReject: (reason?: any) => void;\n let discoveryTimeoutId: NodeJS.Timeout;\n let discovered = false;\n const discoveryPromise = new Promise<void>((resolve, reject) => {\n discoveryResolve = resolve;\n discoveryReject = reject;\n discoveryTimeoutId = setTimeout(() => {\n reject(new Error(\n `Request \"${requestName}\" found no @respond('${requestName}') handler within ${discoveryTimeout}ms — ` +\n `attach a responding controller/element, or pass { optional: true } to resolve undefined when unhandled.`\n ));\n }, discoveryTimeout);\n });\n \n // Dispatch event with promises\n const eventName = `@request/${requestName}`;\n const event = new CustomEvent(eventName, {\n bubbles: options?.bubbles !== undefined ? options.bubbles : true,\n cancelable: options?.cancelable || false,\n composed: true, // Allow crossing shadow DOM boundaries\n detail: {\n payload,\n discovery: {\n resolve: () => {\n discovered = true;\n clearTimeout(discoveryTimeoutId);\n discoveryResolve();\n },\n reject: discoveryReject!\n },\n data: {\n resolve: dataResolve!,\n reject: dataReject!\n }\n }\n });\n \n dispatcher.dispatchEvent(event);\n \n try {\n // Wait for discovery timeout to be cleared (handler found) or discovery timeout to reject (no handler)\n await discoveryPromise;\n \n // If we get here, a handler was found and discovery timeout was cleared\n // Now wait for the actual data response with the full response timeout\n const responseTimeoutId = setTimeout(() => {\n dataReject!(new Error(`Request \"${requestName}\" timed out after ${responseTimeout}ms`));\n }, responseTimeout);\n \n const response = await dataPromise;\n clearTimeout(responseTimeoutId);\n \n // Send response back to generator and get final return value\n const { value: finalValue } = await generator.next(response);\n return finalValue;\n } catch (error) {\n // optional: an unhandled request isn't an error — resume the generator\n // with undefined so `const data = await (yield payload)` sees no data.\n // A response TIMEOUT (handler exists but is slow) still throws.\n if (options?.optional && !discovered) {\n const { value: finalValue } = await generator.next(undefined);\n return finalValue;\n }\n\n // Drive the generator's own catch block and return whatever it recovers\n // with (e.g. a cached fallback). If the generator re-throws instead,\n // generator.throw rejects and the error propagates to the caller.\n const { value: recovered } = await generator.throw(error);\n return recovered;\n }\n }; // Close actualRequest function\n \n // Debounce\n if (options?.debounce) {\n return new Promise((resolve, reject) => {\n clearTimeout(debounceTimeout);\n debounceTimeout = setTimeout(async () => {\n try { resolve(await actualRequest()); }\n catch (error) { reject(error); }\n }, options.debounce);\n });\n }\n\n // No throttle — execute immediately\n if (!options?.throttle) return actualRequest();\n\n // Throttle: time elapsed — invoke now\n const now = Date.now();\n const remaining = options.throttle - (now - throttleLastCall);\n\n if (remaining <= 0) {\n // Cancelling the scheduled trailing call must not orphan the promises\n // queued for it — settle them with this fresh result. Also reset\n // throttleTimeout so later within-window calls don't attach to a dead\n // timer and hang.\n clearTimeout(throttleTimeout);\n throttleTimeout = null;\n throttleLastCall = now;\n const orphaned = throttleTrailingResolvers.splice(0);\n const p = actualRequest();\n if (orphaned.length) {\n p.then(\n (r) => { for (const x of orphaned) x.resolve(r); },\n (e) => { for (const x of orphaned) x.reject(e); }\n );\n }\n return p;\n }\n\n // Throttle: already has pending trailing call — attach to it\n if (throttleTimeout) {\n return new Promise((resolve, reject) => {\n throttleTrailingResolvers.push({ resolve, reject });\n });\n }\n\n // Throttle: schedule trailing call\n return new Promise((resolve, reject) => {\n throttleTrailingResolvers.push({ resolve, reject });\n throttleTimeout = setTimeout(async () => {\n throttleLastCall = Date.now();\n throttleTimeout = null;\n const resolvers = throttleTrailingResolvers.splice(0);\n try {\n const result = await actualRequest();\n for (const r of resolvers) r.resolve(result);\n } catch (error) {\n for (const r of resolvers) r.reject(error);\n }\n }, remaining);\n });\n };\n };\n}\n\n\n/**\n * Decorator for responding to requests in elements or controllers.\n * \n * @param requestName The name of the request to respond to\n * @param options Optional configuration\n */\nexport function respond(requestName: string, options?: RespondOptions) {\n return function (target: any, context: ClassMethodDecoratorContext) {\n const propertyKey = context.name as string;\n context.addInitializer(function(this: any) {\n const constructor = this.constructor as any;\n\n // hasOwnProperty guards so subclasses don't mutate parent state via\n // the prototype chain.\n if (!Object.prototype.hasOwnProperty.call(constructor, RESPOND_METHODS)) {\n constructor[RESPOND_METHODS] = new Set();\n }\n if (constructor[RESPOND_METHODS].has(target)) return;\n constructor[RESPOND_METHODS].add(target);\n\n if (!Object.prototype.hasOwnProperty.call(constructor, CHANNEL_HANDLERS)) {\n const inherited = constructor[CHANNEL_HANDLERS];\n constructor[CHANNEL_HANDLERS] = inherited ? [...inherited] : [];\n }\n\n constructor[CHANNEL_HANDLERS].push({\n channelName: requestName,\n methodName: propertyKey,\n method: target,\n options: options\n });\n });\n };\n}\n\n// Helper to setup response handlers for elements and controllers\nexport function setupResponseHandlers(instance: any, element: EventTarget) {\n const handlers = instance.constructor[CHANNEL_HANDLERS];\n if (!handlers) return;\n \n // Store cleanup functions\n // Initialize cleanup object if needed\n if (!instance[CLEANUP]) {\n instance[CLEANUP] = { events: [], channels: [] };\n }\n \n for (const handler of handlers) {\n const boundMethod = handler.method.bind(instance);\n const eventName = `@request/${handler.channelName}`;\n \n // Create timing variables for debounce/throttle per handler\n let debounceTimeout: any;\n let throttleLastCall = 0;\n let throttleTimeout: any;\n const throttleTrailingResolvers: Array<{ resolve: (v: any) => void; reject: (e: any) => void }> = [];\n let throttleLatestArgs: any[] | null = null;\n\n // Create wrapped method with timing if needed\n const createTimedMethod = (originalMethod: Function) => {\n if (handler.options?.debounce) {\n return (...args: any[]) => new Promise((resolve, reject) => {\n clearTimeout(debounceTimeout);\n debounceTimeout = setTimeout(async () => {\n try { resolve(await originalMethod(...args)); }\n catch (error) { reject(error); }\n }, handler.options.debounce);\n });\n }\n\n if (!handler.options?.throttle) return originalMethod;\n\n return (...args: any[]) => {\n const now = Date.now();\n const remaining = handler.options.throttle! - (now - throttleLastCall);\n\n if (remaining <= 0) {\n // Same as the @request side: settle any queued trailing callers with\n // this fresh result rather than orphaning their promises.\n clearTimeout(throttleTimeout);\n throttleTimeout = null;\n throttleLastCall = now;\n const orphaned = throttleTrailingResolvers.splice(0);\n throttleLatestArgs = null;\n const result = originalMethod(...args);\n if (orphaned.length) {\n Promise.resolve(result).then(\n (r) => { for (const x of orphaned) x.resolve(r); },\n (e) => { for (const x of orphaned) x.reject(e); }\n );\n }\n return result;\n }\n\n // Remember the LATEST args so the trailing call uses fresh input,\n // and queue every suppressed caller's resolver so they all receive\n // the trailing result instead of `undefined`.\n throttleLatestArgs = args;\n return new Promise((resolve, reject) => {\n throttleTrailingResolvers.push({ resolve, reject });\n if (throttleTimeout) return; // already scheduled\n throttleTimeout = setTimeout(async () => {\n throttleLastCall = Date.now();\n throttleTimeout = null;\n const resolvers = throttleTrailingResolvers.splice(0);\n const finalArgs = throttleLatestArgs ?? args;\n throttleLatestArgs = null;\n try {\n const result = await originalMethod(...finalArgs);\n for (const r of resolvers) r.resolve(result);\n } catch (error) {\n for (const r of resolvers) r.reject(error);\n }\n }, remaining);\n });\n };\n };\n \n const timedMethod = createTimedMethod(boundMethod);\n \n // Setup response handler\n const responseHandler = (event: CustomEvent) => {\n // Extract promises and payload\n const { data, discovery, payload } = event.detail;\n \n // Prevent other responders from responding\n event.preventDefault();\n event.stopImmediatePropagation();\n event.stopPropagation();\n \n // Clear the discovery timeout immediately - we found a handler\n discovery.resolve();\n \n // Call the timed responder method and handle the result\n Promise.resolve(timedMethod(payload))\n .then(result => {\n data.resolve(result);\n })\n .catch(error => {\n data.reject(error);\n console.error(`Error in response handler ${handler.methodName}:`, error);\n });\n };\n \n let responseTarget = element;\n if (handler.options?.daemon !== undefined) {\n try {\n responseTarget = requireDaemonTarget(instance, handler.options.daemon);\n } catch (error) {\n console.warn(`[snice/@respond] ${(error as Error).message} Responder \"${handler.channelName}\" skipped.`);\n continue;\n }\n }\n\n responseTarget.addEventListener(eventName, responseHandler as EventListener);\n \n instance[CLEANUP].channels.push(() => {\n responseTarget.removeEventListener(eventName, responseHandler as EventListener);\n });\n }\n}\n\n// Helper to cleanup response handlers\nexport function cleanupResponseHandlers(instance: any) {\n if (instance[CLEANUP]?.channels) {\n for (const cleanup of instance[CLEANUP].channels) {\n cleanup();\n }\n instance[CLEANUP].channels = [];\n }\n}\n","/**\n * Keyboard filter for matching specific keys and modifiers\n */\nexport interface KeyboardFilter {\n key: string;\n ctrl?: boolean;\n alt?: boolean;\n shift?: boolean;\n meta?: boolean;\n anyModifiers?: boolean; // true if prefixed with ~\n}\n\n// once/preventDefault/stopPropagation/capture/passive are @on() OPTIONS, not\n// template modifiers. A dotted non-keyboard event whose suffix is one of these\n// is almost certainly a mistake (e.g. `@click.once`) — it binds a listener for\n// an event type the DOM never dispatches. Warn instead of failing silently. A\n// legitimate custom event name like `app.ready` won't match and stays quiet.\nconst MODIFIER_WORDS = new Set([\n 'once', 'prevent', 'preventdefault', 'stop', 'stoppropagation', 'capture', 'passive',\n]);\n\nexport function warnIfModifierMisuse(eventName: string): void {\n const dot = eventName.lastIndexOf('.');\n if (dot < 0) return;\n\n const suffix = eventName.slice(dot + 1).toLowerCase();\n if (!MODIFIER_WORDS.has(suffix)) return;\n\n console.warn(\n `snice: \"@${eventName}\" is not a valid modifier — once/preventDefault/` +\n `stopPropagation/capture are @on() options, not template modifiers. ` +\n `This registers a listener for event \"${eventName}\", which never fires.`\n );\n}\n\n/**\n * Parse keyboard shortcut specification\n * Examples:\n * \"enter\" -> { key: \"Enter\" }\n * \"ctrl+s\" -> { key: \"s\", ctrl: true }\n * \"ctrl+shift+s\" -> { key: \"s\", ctrl: true, shift: true }\n * \"~enter\" -> { key: \"Enter\", anyModifiers: true }\n */\nexport function parseKeyboardFilter(spec: string): KeyboardFilter {\n // Handle ~ prefix for matching regardless of modifiers\n const anyModifiers = spec.startsWith('~');\n if (anyModifiers) {\n spec = spec.substring(1);\n }\n\n const parts = spec.split('+');\n const filter: KeyboardFilter = {\n key: '',\n anyModifiers\n };\n\n for (const part of parts) {\n const lower = part.toLowerCase();\n if (lower === 'ctrl' || lower === 'control') {\n filter.ctrl = true;\n } else if (lower === 'alt') {\n filter.alt = true;\n } else if (lower === 'shift') {\n filter.shift = true;\n } else if (lower === 'meta' || lower === 'cmd' || lower === 'command') {\n filter.meta = true;\n } else {\n // This is the key itself - normalize common keys\n filter.key = normalizeKey(part);\n }\n }\n\n return filter;\n}\n\n/**\n * Normalize key names to match KeyboardEvent.key\n */\nfunction normalizeKey(key: string): string {\n const keyMap: Record<string, string> = {\n 'esc': 'Escape',\n 'escape': 'Escape',\n 'enter': 'Enter',\n 'return': 'Enter',\n 'space': ' ',\n 'spacebar': ' ',\n 'up': 'ArrowUp',\n 'down': 'ArrowDown',\n 'left': 'ArrowLeft',\n 'right': 'ArrowRight',\n 'arrowup': 'ArrowUp',\n 'arrowdown': 'ArrowDown',\n 'arrowleft': 'ArrowLeft',\n 'arrowright': 'ArrowRight',\n 'delete': 'Delete',\n 'del': 'Delete',\n 'backspace': 'Backspace',\n 'tab': 'Tab',\n 'home': 'Home',\n 'end': 'End',\n 'pageup': 'PageUp',\n 'pagedown': 'PageDown'\n };\n\n const lower = key.toLowerCase();\n return keyMap[lower] || key;\n}\n\n/**\n * Check if keyboard event matches the filter\n */\nexport function matchesKeyboardFilter(event: KeyboardEvent, filter: KeyboardFilter): boolean {\n // Check key match\n if (event.key !== filter.key) {\n return false;\n }\n\n // If anyModifiers is true, we don't care about modifiers\n if (filter.anyModifiers) {\n return true;\n }\n\n // Check modifiers - by default, exact match\n // If filter specifies ctrl: true, event must have ctrlKey\n // If filter doesn't specify ctrl, event must NOT have ctrlKey\n const ctrlMatch = filter.ctrl ? event.ctrlKey : !event.ctrlKey;\n const altMatch = filter.alt ? event.altKey : !event.altKey;\n const shiftMatch = filter.shift ? event.shiftKey : !event.shiftKey;\n const metaMatch = filter.meta ? event.metaKey : !event.metaKey;\n\n return ctrlMatch && altMatch && shiftMatch && metaMatch;\n}\n","/**\n * @on decorator for listening to events\n * Use in elements or controllers to listen to DOM events or custom events\n */\n\nimport { CLEANUP, ON_METHODS } from './symbols';\nimport { getSymbol } from './symbols';\nimport type { OnOptions } from './types/on-options';\nimport { parseKeyboardFilter, matchesKeyboardFilter, warnIfModifierMisuse, type KeyboardFilter } from './keyboard-filter';\nimport { createDebounced, resolveScope } from './utils';\nimport { isDaemonInstance, requireDaemonTarget } from './daemon-target';\n\n// Re-export OnOptions for public API\nexport type { OnOptions } from './types/on-options';\n\nconst ON_HANDLERS = getSymbol('on-handlers');\n\n/**\n * @on decorator for listening to events\n *\n * Works in both elements and controllers with full event delegation support.\n *\n * @param eventName - Event name(s) to listen for\n * @param selector - Optional CSS selector for event delegation\n * @param options - Event listener options including debounce/throttle\n *\n * @example\n * ```typescript\n * // In elements\n * @element('my-button')\n * class MyButton extends HTMLElement {\n * @on('click', 'button')\n * handleClick(e: MouseEvent) {\n * console.log('Button clicked!', e);\n * }\n *\n * @on('input', 'input', { debounce: 300 })\n * handleInput(e: Event) {\n * console.log('Input changed:', (e.target as HTMLInputElement).value);\n * }\n * }\n *\n * // In controllers\n * @controller('my-controller')\n * class MyController {\n * element!: HTMLElement;\n *\n * @on('count-changed')\n * handleCountChanged(e: CustomEvent) {\n * console.log('Count changed to:', e.detail.count);\n * }\n *\n * @on('click', '.item', { throttle: 100 })\n * handleItemClick(e: MouseEvent) {\n * console.log('Item clicked');\n * }\n * }\n * ```\n */\nexport function on(\n eventName: string | string[],\n selectorOrOptions?: string | OnOptions | null,\n options?: OnOptions\n) {\n // Parse arguments to support multiple call signatures\n let selector: string | null = null;\n let opts: OnOptions = {};\n\n if (typeof selectorOrOptions === 'string') {\n selector = selectorOrOptions;\n opts = options || {};\n } else if (selectorOrOptions && typeof selectorOrOptions === 'object') {\n opts = selectorOrOptions;\n } else if (selectorOrOptions === null && options) {\n opts = options;\n }\n\n return function (originalMethod: any, context: ClassMethodDecoratorContext) {\n const methodName = context.name as string;\n context.addInitializer(function(this: any) {\n const constructor = this.constructor as any;\n\n // Dedup by registration identity (method + events + selector), NOT by\n // method reference alone — stacked @on decorators share one method and\n // must each register. Use hasOwnProperty so subclasses get their OWN\n // Set instead of inheriting — otherwise parent and child share state\n // and child registrations pollute parent (and vice versa) via the\n // prototype chain.\n const eventNames = Array.isArray(eventName) ? eventName : [eventName];\n const registrationKey = `${methodName}::${eventNames.join(',')}::${selector ?? ''}::daemon:${opts.daemon ?? ''}`;\n\n if (!Object.prototype.hasOwnProperty.call(constructor, ON_METHODS)) {\n constructor[ON_METHODS] = new Set();\n }\n if (constructor[ON_METHODS].has(registrationKey)) return;\n constructor[ON_METHODS].add(registrationKey);\n\n if (!Object.prototype.hasOwnProperty.call(constructor, ON_HANDLERS)) {\n // Seed with parent's handlers (if any) so inherited @on still fires.\n const inherited = constructor[ON_HANDLERS];\n constructor[ON_HANDLERS] = inherited ? [...inherited] : [];\n }\n\n for (const event of eventNames) {\n constructor[ON_HANDLERS].push({\n eventName: event,\n selector,\n methodName,\n method: originalMethod,\n options: opts\n });\n }\n });\n\n return originalMethod;\n };\n}\n\n// Note: on.ts uses leading-edge-only throttle (no trailing call).\n// createThrottled from utils has leading+trailing, so we keep a local leading-only variant.\nfunction throttle<T extends (...args: any[]) => any>(fn: T, delay: number): T {\n let lastCall = 0;\n return function (this: any, ...args: any[]) {\n const now = Date.now();\n if (now - lastCall >= delay) {\n lastCall = now;\n fn.apply(this, args);\n }\n } as T;\n}\n\n/**\n * Events that don't bubble - these require capture phase for delegation\n */\nconst NON_BUBBLING_EVENTS = new Set([\n 'scroll',\n 'focus',\n 'blur',\n 'load',\n 'unload',\n 'error',\n 'resize',\n 'abort',\n 'mouseenter',\n 'mouseleave',\n 'pointerenter',\n 'pointerleave',\n]);\n\n/**\n * Setup event listeners for an element or controller instance\n * Called automatically during element connection or controller attachment\n */\nexport function setupEventHandlers(instance: any, targetElement: EventTarget) {\n const handlers = instance.constructor[ON_HANDLERS];\n if (!handlers || !Array.isArray(handlers) || handlers.length === 0) {\n return;\n }\n\n // Initialize cleanup object if needed\n if (!instance[CLEANUP]) {\n instance[CLEANUP] = { events: [], channels: [], observers: [] };\n } else if (!instance[CLEANUP].events) {\n instance[CLEANUP].events = [];\n } else if (instance[CLEANUP].events.length > 0) {\n // Events already set up - clean them up first to avoid duplicates\n cleanupEventHandlers(instance);\n }\n\n for (const handler of handlers) {\n // Get current method from instance (preserves decorator stacking)\n const currentMethod = (instance as any)[handler.methodName];\n let boundMethod = currentMethod ? currentMethod.bind(instance) : handler.method.bind(instance);\n const handlerOptions = handler.options || {};\n\n // Parse event name for key modifiers\n // Supports both dot notation (@keydown.enter) and colon notation (@keydown:Enter)\n // Only parse colons for keyboard events, not custom events\n const isKeyboardEvent = ['keydown', 'keyup', 'keypress'].includes(handler.eventName.split('.')[0].split(':')[0]);\n // Only keyboard events split on `.`/`:` into a key filter — a custom event\n // name may legitimately contain a dot (e.g. `app.ready`) and must be kept whole.\n const dotIndex = isKeyboardEvent ? handler.eventName.indexOf('.') : -1;\n const colonIndex = isKeyboardEvent ? handler.eventName.indexOf(':') : -1;\n\n const delimiterIndex = dotIndex > 0 && colonIndex > 0\n ? Math.min(dotIndex, colonIndex)\n : Math.max(dotIndex, colonIndex);\n\n const baseEventName = delimiterIndex > 0\n ? handler.eventName.substring(0, delimiterIndex)\n : handler.eventName;\n\n const keyModifier = delimiterIndex > 0\n ? handler.eventName.substring(delimiterIndex + 1)\n : null;\n\n if (delimiterIndex <= 0) warnIfModifierMisuse(handler.eventName);\n\n // Apply debounce (takes precedence over throttle)\n if (handlerOptions.debounce && handlerOptions.debounce > 0) {\n boundMethod = createDebounced(boundMethod, handlerOptions.debounce);\n } else if (handlerOptions.throttle && handlerOptions.throttle > 0) {\n boundMethod = throttle(boundMethod, handlerOptions.throttle);\n }\n\n // Create event handler with key modifier support\n // Uses shared keyboard filter implementation from parts.ts\n let keyFilter: KeyboardFilter | null = null;\n if (keyModifier && ['keydown', 'keyup', 'keypress'].includes(baseEventName)) {\n keyFilter = parseKeyboardFilter(keyModifier);\n }\n\n const createKeyModifierHandler = (method: Function): Function => {\n if (!keyFilter) {\n return method;\n }\n\n return (event: Event) => {\n const keyEvent = event as KeyboardEvent;\n if (matchesKeyboardFilter(keyEvent, keyFilter)) {\n method(event);\n }\n };\n };\n\n // Apply key modifier wrapper\n const keyModifierMethod = createKeyModifierHandler(boundMethod);\n\n // Resolve an explicit DOM scope or an app-context daemon. They are two\n // distinct addressing models and may not be combined.\n const hasExplicitScope = handlerOptions.scope !== undefined;\n const hasDaemon = handlerOptions.daemon !== undefined;\n if (hasExplicitScope && hasDaemon) {\n console.warn(\n `[snice/@on] \"${handler.eventName}\" cannot use both scope and daemon — listener skipped.`\n );\n continue;\n }\n if ((hasDaemon || isDaemonInstance(instance)) && handler.selector) {\n console.warn(\n `[snice/@on] \"${handler.eventName}\" cannot delegate \"${handler.selector}\" on a daemon target — listener skipped.`\n );\n continue;\n }\n\n const hasExplicitTarget = hasExplicitScope || hasDaemon;\n let scopedTarget: EventTarget | null = null;\n if (hasDaemon) {\n try {\n scopedTarget = requireDaemonTarget(instance, handlerOptions.daemon);\n } catch (error) {\n console.warn(`[snice/@on] ${(error as Error).message} Listener \"${handler.eventName}\" skipped.`);\n continue;\n }\n } else if (hasExplicitScope) {\n scopedTarget = resolveScope(targetElement as HTMLElement, handlerOptions.scope);\n if (!scopedTarget) {\n // Dev warning — listener silently dropped when scope cannot resolve.\n // Skip attachment so we don't bind to the wrong target.\n console.warn(\n `[snice/@on] scope did not resolve for \"${handler.eventName}\" on ${handler.methodName} — listener skipped.`\n );\n continue;\n }\n }\n\n // Main event handler with error handling and event delegation\n if (handler.selector) {\n // Delegated event handling.\n // - Default eventRoot: shadow root if present, else host element.\n // - With explicit scope: attach to the scoped target instead.\n const eventRoot: EventTarget = hasExplicitTarget\n ? scopedTarget!\n : ((targetElement as any).shadowRoot || targetElement);\n\n const delegatedHandler = (event: Event) => {\n const target = event.target as HTMLElement;\n const matchingElement =\n (target.matches && target.matches(handler.selector) && target) ||\n (target.closest && target.closest(handler.selector)) ||\n null;\n\n if (!matchingElement) return;\n\n if (handlerOptions.preventDefault) event.preventDefault();\n if (handlerOptions.stopPropagation) {\n event.stopPropagation();\n event.stopImmediatePropagation();\n }\n\n try {\n keyModifierMethod(event);\n } catch (error) {\n console.error(`Error in event handler ${handler.methodName}:`, error);\n }\n };\n\n // Auto-enable capture for non-bubbling events when using delegation\n const needsCapture = NON_BUBBLING_EVENTS.has(baseEventName);\n const useCapture = handlerOptions.capture !== undefined\n ? handlerOptions.capture\n : needsCapture;\n\n const listenerOptions: AddEventListenerOptions = {\n capture: useCapture,\n once: handlerOptions.once || false,\n passive: handlerOptions.passive || false,\n };\n\n eventRoot.addEventListener(baseEventName, delegatedHandler, listenerOptions);\n\n instance[CLEANUP].events.push({\n target: eventRoot,\n eventName: baseEventName,\n handler: delegatedHandler,\n options: listenerOptions,\n });\n } else {\n // Direct event handling.\n // - Default: shadow root + host element (so events inside shadow and on\n // the host itself both fire). A per-handler Symbol dedupes.\n // - With explicit scope: attach to the scoped target ONLY (no duplication).\n const shadowRoot = hasExplicitTarget ? null : (targetElement as any).shadowRoot;\n\n // Per-handler private Symbol so dedup is scoped to THIS handler's two\n // listeners (shadowRoot + host). Using Symbol.for() with the method name\n // would collide across components that share a method name (e.g. a parent\n // and nested child both defining `handleClick`), causing the parent's\n // handler to be silently swallowed when events bubble up through a\n // shadow boundary.\n const handledSymbol = Symbol();\n\n const wrappedMethod = (event: Event) => {\n if ((event as any)[handledSymbol]) return;\n (event as any)[handledSymbol] = true;\n\n if (handlerOptions.preventDefault) event.preventDefault();\n if (handlerOptions.stopPropagation) event.stopPropagation();\n\n try {\n keyModifierMethod(event);\n } catch (error) {\n console.error(`Error in event handler ${handler.methodName}:`, error);\n }\n };\n\n const listenerOptions: AddEventListenerOptions = {\n capture: handlerOptions.capture || false,\n once: handlerOptions.once || false,\n passive: handlerOptions.passive || false,\n };\n\n if (hasExplicitTarget) {\n scopedTarget!.addEventListener(baseEventName, wrappedMethod as EventListener, listenerOptions);\n instance[CLEANUP].events.push({\n target: scopedTarget!,\n eventName: baseEventName,\n handler: wrappedMethod,\n options: listenerOptions,\n });\n continue;\n }\n\n if (shadowRoot) {\n // Listen on shadow root for events inside shadow DOM\n shadowRoot.addEventListener(baseEventName, wrappedMethod as EventListener, listenerOptions);\n instance[CLEANUP].events.push({\n target: shadowRoot,\n eventName: baseEventName,\n handler: wrappedMethod,\n options: listenerOptions,\n });\n }\n\n // Also listen on host element (for clicks on host itself or when no shadow root)\n targetElement.addEventListener(baseEventName, wrappedMethod as EventListener, listenerOptions);\n instance[CLEANUP].events.push({\n target: targetElement,\n eventName: baseEventName,\n handler: wrappedMethod,\n options: listenerOptions,\n });\n }\n }\n}\n\n/**\n * Cleanup event listeners for a controller instance\n * Called automatically by the controller system during detach\n */\nexport function cleanupEventHandlers(instance: any) {\n if (!instance[CLEANUP]?.events) return;\n\n for (const { target, eventName, handler, options } of instance[CLEANUP].events) {\n target.removeEventListener(eventName, handler, options);\n }\n\n instance[CLEANUP].events = [];\n}\n","import { setupObservers, cleanupObservers } from './observe';\nimport { setupResponseHandlers, cleanupResponseHandlers } from './request-response';\nimport { setupEventHandlers, cleanupEventHandlers } from './on';\nimport { IS_CONTROLLER_CLASS, IS_CONTROLLER_INSTANCE, CONTROLLER, CONTROLLER_KEY, CONTROLLER_NAME_KEY, CONTROLLER_ID, CONTROLLER_OPERATIONS, NATIVE_CONTROLLER, CONTROLLER_REGISTRY_NAME, DIRECT_CONTROLLER, CONTROLLER_ATTRIBUTE_SYNC, IS_ELEMENT_CLASS, ROUTER_CONTEXT, CONTROLLER_ABORT, CONTROLLER_ATTACHED, READY_HANDLERS_RUNNING } from './symbols';\nimport { snice } from './global';\nimport { IController, ControllerClass } from './types/i-controller';\n\n\n\n\n// Controller-scoped cleanup registry\nclass ControllerScope {\n private cleanupFns: Map<string, Function> = new Map();\n private pendingOperations: Set<Promise<void>> = new Set();\n \n register(key: string, cleanup: Function): void {\n this.cleanupFns.set(key, cleanup);\n }\n \n unregister(key: string): void {\n this.cleanupFns.delete(key);\n }\n \n async cleanup(): Promise<void> {\n // Wait for all pending operations\n await Promise.all(this.pendingOperations);\n \n // Run all cleanup functions\n for (const cleanup of this.cleanupFns.values()) {\n try {\n await cleanup();\n } catch (error) {\n console.error('Error during cleanup:', error);\n }\n }\n this.cleanupFns.clear();\n }\n \n async runOperation<T>(operation: () => Promise<T>): Promise<T> {\n const promise = operation();\n const voidPromise = promise.then(() => {}, () => {});\n this.pendingOperations.add(voidPromise);\n \n try {\n const result = await promise;\n this.pendingOperations.delete(voidPromise);\n return result;\n } catch (error) {\n this.pendingOperations.delete(voidPromise);\n throw error;\n }\n }\n}\n\n/**\n * Decorator to register a controller class with a name\n * @param name The name to register the controller under\n */\nexport function controller(name: string) {\n return function <T extends ControllerClass>(constructor: T, _context: ClassDecoratorContext) {\n // Access globalThis.snice directly to ensure consistency\n const registry = (globalThis as any).snice?.controllerRegistry;\n if (!registry) {\n throw new Error('Snice global registry not initialized');\n }\n registry.set(name, constructor);\n // Mark as controller class for channel decorator detection\n (constructor.prototype as any)[IS_CONTROLLER_CLASS] = true;\n // Preserve the registry name on the class. Direct class attachments still\n // skip registry lookup; this is only their inspectable DOM label.\n Object.defineProperty(constructor, CONTROLLER_REGISTRY_NAME, {\n value: name,\n configurable: true\n });\n\n const pending = snice.pendingControllerAttachments.get(name);\n if (pending) {\n snice.pendingControllerAttachments.delete(name);\n queueMicrotask(() => {\n for (const element of pending) {\n const nativeName = (element as any)[NATIVE_CONTROLLER];\n const desiredName = nativeName === undefined\n ? (element as any)[CONTROLLER]\n : nativeName;\n if (desiredName !== name) continue;\n\n attachController(element, name).catch(error => {\n if (error?.name !== 'ControllerAttachAborted') {\n console.error(`Failed to attach controller \"${name}\":`, error);\n }\n });\n }\n });\n }\n return constructor;\n };\n}\n\n/** Queue an element until its controller module finishes registering. */\nexport function deferControllerAttachment(element: HTMLElement, controllerName: string): void {\n // Registration can win the microtask race between attachController's\n // rejected promise and this recovery path. Retry immediately in that case.\n if (snice.controllerRegistry.has(controllerName)) {\n queueMicrotask(() => {\n const nativeName = (element as any)[NATIVE_CONTROLLER];\n const desiredName = nativeName === undefined\n ? (element as any)[CONTROLLER]\n : nativeName;\n if (desiredName !== controllerName) return;\n\n attachController(element, controllerName).catch(error => {\n if (error?.name !== 'ControllerAttachAborted') {\n console.error(`Failed to attach controller \"${controllerName}\":`, error);\n }\n });\n });\n return;\n }\n\n let pending = snice.pendingControllerAttachments.get(controllerName);\n if (!pending) {\n pending = new Set();\n snice.pendingControllerAttachments.set(controllerName, pending);\n }\n pending.add(element);\n\n // Give synchronously evaluated and microtask-delayed controller modules a\n // chance to register, while keeping genuinely missing controllers loud.\n queueMicrotask(() => {\n if (snice.pendingControllerAttachments.get(controllerName)?.has(element)) {\n console.error(\n `Failed to attach controller \"${controllerName}\":`,\n new Error(`Controller \"${controllerName}\" not found in registry`)\n );\n }\n });\n}\n\n/**\n * True when the value is a controller class that went through @controller().\n * The decorator is required — it registers the class, marks it, and flushes\n * pending attachments. Direct class binding only changes the attach side.\n */\nexport function isControllerClass(value: unknown): value is ControllerClass {\n return typeof value === 'function'\n && (value as any).prototype?.[IS_CONTROLLER_CLASS] === true;\n}\n\n/** Human-readable label for a controller reference (registry name or class). */\nfunction controllerLabel(controller: string | ControllerClass): string {\n return typeof controller === 'string'\n ? controller\n : (controller?.name || '(anonymous controller class)');\n}\n\n/** Registry/decorator name used for a direct class attachment's DOM marker. */\nfunction directControllerAttributeName(controllerClass: ControllerClass): string {\n const registeredName = Object.prototype.hasOwnProperty.call(controllerClass, CONTROLLER_REGISTRY_NAME)\n ? (controllerClass as any)[CONTROLLER_REGISTRY_NAME]\n : undefined;\n return typeof registeredName === 'string'\n ? registeredName\n : controllerLabel(controllerClass);\n}\n\n/**\n * Write the inspectable controller marker without feeding it back into the\n * custom-element attribute channel. Native MutationObservers are asynchronous\n * and are excluded independently by DIRECT_CONTROLLER.\n */\nfunction writeControllerAttribute(element: HTMLElement, value: string | null): void {\n if (value === null) {\n if (!element.hasAttribute('controller')) return;\n } else if (element.getAttribute('controller') === value) {\n return;\n }\n\n (element as any)[CONTROLLER_ATTRIBUTE_SYNC] = true;\n try {\n if (value === null) element.removeAttribute('controller');\n else element.setAttribute('controller', value);\n } finally {\n delete (element as any)[CONTROLLER_ATTRIBUTE_SYNC];\n }\n}\n\n/**\n * Restore the diagnostic attribute for an attached class controller. Returns\n * true when the direct class channel owns the element.\n */\nexport function restoreDirectControllerAttribute(element: HTMLElement): boolean {\n if (!(element as any)[DIRECT_CONTROLLER]) return false;\n const source = (element as any)[CONTROLLER_NAME_KEY] as string | ControllerClass | undefined;\n if (typeof source !== 'function') return false;\n writeControllerAttribute(element, directControllerAttributeName(source));\n return true;\n}\n\n/**\n * Attaches a controller to an element\n * @param element The element to attach the controller to\n * @param controller The registry name of the controller, or the decorated\n * controller class itself (classes skip the registry)\n */\nexport async function attachController(element: HTMLElement, controller: string | ControllerClass): Promise<void> {\n if (typeof controller !== 'string') {\n if (typeof controller !== 'function') {\n throw new Error(\n 'attachController: expected a controller name or a controller class, ' +\n `got ${typeof controller}. Controller instances are not supported — pass the class itself.`\n );\n }\n if (!isControllerClass(controller)) {\n throw new Error(\n `Controller class \"${controllerLabel(controller)}\" must be decorated with ` +\n `@controller('name') before it can be attached.`\n );\n }\n }\n\n const controllerName = controllerLabel(controller);\n const existingController = (element as any)[CONTROLLER_KEY] as IController | undefined;\n const existingSource = (element as any)[CONTROLLER_NAME_KEY] as string | ControllerClass | undefined;\n\n // For attribute-managed native elements, check if this is actually the\n // desired controller. Class attachments take the element over instead.\n const nativeController = (element as any)[NATIVE_CONTROLLER];\n if (typeof controller === 'string' && nativeController !== undefined && nativeController !== controller) {\n // This attachment is outdated, skip it\n return;\n }\n\n if (existingSource === controller && existingController) {\n // Already attached and controller exists (name or class reference match)\n if (typeof controller !== 'string') {\n restoreDirectControllerAttribute(element);\n }\n return;\n }\n\n // If there's an existing controller, detach it first\n if (existingController) {\n await detachController(element);\n\n // Light-DOM reconciliation can issue commit() and reconnected() requests\n // for the same class while the previous controller is still detaching.\n // If the other request already installed that exact source, this request\n // is redundant. Different sources retain the established rapid-switch\n // behavior and continue through the normal replacement path.\n const replacement = (element as any)[CONTROLLER_KEY] as IController | undefined;\n const replacementSource = (element as any)[CONTROLLER_NAME_KEY] as string | ControllerClass | undefined;\n if (replacement && replacementSource === controller) {\n if (typeof controller !== 'string') restoreDirectControllerAttribute(element);\n return;\n }\n }\n\n let ControllerClass: ControllerClass;\n if (typeof controller === 'string') {\n // Access globalThis.snice directly to ensure consistency\n const registry = (globalThis as any).snice?.controllerRegistry;\n if (!registry) {\n throw new Error('Snice global registry not initialized');\n }\n\n ControllerClass = registry.get(controller);\n if (!ControllerClass) {\n throw new Error(`Controller \"${controller}\" not found in registry`);\n }\n } else {\n ControllerClass = controller;\n }\n\n // Create controller instance with unique ID and scope\n const controllerInstance = new ControllerClass();\n if (typeof controller !== 'string') {\n // Construction succeeded, so the class channel can safely take ownership.\n // Setting this before construction would leave a stale observer guard when\n // a controller constructor throws.\n (element as any)[DIRECT_CONTROLLER] = true;\n delete (element as any)[NATIVE_CONTROLLER];\n }\n snice.controllerIdCounter += 1;\n const controllerId = snice.controllerIdCounter;\n const scope = new ControllerScope();\n \n // Mark this as a controller instance\n (controllerInstance as any)[IS_CONTROLLER_INSTANCE] = true;\n (controllerInstance as any)[CONTROLLER_ID] = controllerId;\n controllerInstance.element = element;\n \n // Pass router context from element to controller if it exists\n const routerContext = (element as any)[ROUTER_CONTEXT];\n if (routerContext !== undefined) {\n (controllerInstance as any)[ROUTER_CONTEXT] = routerContext;\n }\n \n // Store references. CONTROLLER_NAME_KEY holds the attach source — the\n // registry name string, or the class reference itself for class attaches\n // (reference equality is the dedupe key for classes).\n (element as any)[CONTROLLER_KEY] = controllerInstance;\n (element as any)[CONTROLLER_NAME_KEY] = controller;\n (element as any)[CONTROLLER_OPERATIONS] = scope;\n if (typeof controller !== 'string') {\n // The class reference remains the sole attachment authority. This\n // attribute is diagnostic only; custom-element callbacks and native\n // MutationObservers are guarded from treating it as a string attachment.\n restoreDirectControllerAttribute(element);\n }\n\n // Normally a controller waits for its host's full initialization. The sole\n // exception is attachController(host, ...) from that host's own @ready\n // handler: awaiting ready there would wait on the current handler itself.\n if (!(element as any)[READY_HANDLERS_RUNNING]) {\n // Race against abort (detachController) and a 30s deadline so a caller\n // that forgets to append the element gets a clear error.\n const abort = new AbortController();\n (element as any)[CONTROLLER_ABORT] = abort;\n const ATTACH_DEADLINE_MS = 30_000;\n\n try {\n await Promise.race([\n (element as any).ready,\n new Promise<never>((_, reject) => {\n const onAbort = () => {\n // Tagged so fire-and-forget call sites can tell this designed\n // teardown path apart from real attach failures and stay quiet.\n const error = new Error(`attachController(\"${controllerName}\"): aborted before element was ready (likely detached or never connected)`);\n error.name = 'ControllerAttachAborted';\n reject(error);\n };\n if (abort.signal.aborted) return onAbort();\n abort.signal.addEventListener('abort', onAbort, { once: true });\n const timerId = setTimeout(() => reject(\n new Error(`attachController(\"${controllerName}\"): element did not become ready within ${ATTACH_DEADLINE_MS}ms (did you forget to appendChild it?)`)\n ), ATTACH_DEADLINE_MS);\n abort.signal.addEventListener('abort', () => clearTimeout(timerId), { once: true });\n }),\n ]);\n } catch (error) {\n // Attach never got past `ready` (aborted or deadline). Roll back the\n // stored references so a later attach does not short-circuit against an\n // instance whose attach() never ran.\n if ((element as any)[CONTROLLER_KEY] === controllerInstance) {\n if (typeof controller !== 'string') {\n writeControllerAttribute(element, null);\n }\n delete (element as any)[CONTROLLER_KEY];\n delete (element as any)[CONTROLLER_NAME_KEY];\n delete (element as any)[CONTROLLER_OPERATIONS];\n if (typeof controller !== 'string') {\n delete (element as any)[DIRECT_CONTROLLER];\n }\n }\n throw error;\n } finally {\n if ((element as any)[CONTROLLER_ABORT] === abort) {\n delete (element as any)[CONTROLLER_ABORT];\n }\n }\n }\n\n // Past `ready` — mark the controller so detach knows attach was actually run.\n (controllerInstance as any)[CONTROLLER_ATTACHED] = true;\n\n // Run attach in the controller's scope\n await scope.runOperation(async () => {\n await controllerInstance.attach(element);\n });\n\n // Setup @observe observers for controller\n setupObservers(controllerInstance, element);\n\n // Setup @channel handlers for controller\n setupResponseHandlers(controllerInstance, element);\n\n // Setup @on event handlers for controller\n setupEventHandlers(controllerInstance, element);\n\n element.dispatchEvent(new CustomEvent('controller-attached', {\n detail: { name: controllerName, controller: controllerInstance }\n }));\n}\n\n/**\n * Detaches a controller from an element\n * @param element The element to detach the controller from\n */\nexport async function detachController(element: HTMLElement): Promise<void> {\n // If attachController is currently awaiting `.ready`, short-circuit that\n // wait so the pending attach rejects immediately instead of hanging.\n const pendingAbort = (element as any)[CONTROLLER_ABORT] as AbortController | undefined;\n if (pendingAbort) pendingAbort.abort();\n\n const controllerInstance = (element as any)[CONTROLLER_KEY] as IController | undefined;\n const controllerSource = (element as any)[CONTROLLER_NAME_KEY] as string | ControllerClass | undefined;\n const scope = (element as any)[CONTROLLER_OPERATIONS] as ControllerScope | undefined;\n\n if (!controllerInstance) {\n return;\n }\n\n // Claim the controller immediately — before any await — so a second detach\n // that overlaps this one (e.g. disconnect's fire-and-forget detach racing a\n // controller reassignment) finds no instance and returns, instead of running\n // detach() a second time on the same controller. The rest of this function\n // works off the locals captured above.\n if (typeof controllerSource === 'function') {\n // Remove the class channel's diagnostic marker while its guards are still\n // active. A queued native MutationObserver therefore sees no attribute and\n // cannot resurrect a registry attachment after detach.\n writeControllerAttribute(element, null);\n }\n delete (element as any)[CONTROLLER_KEY];\n delete (element as any)[CONTROLLER_NAME_KEY];\n delete (element as any)[CONTROLLER_OPERATIONS];\n if (typeof controllerSource === 'function') {\n // Class attach owned the element — release it back to the attribute channel.\n delete (element as any)[DIRECT_CONTROLLER];\n }\n\n // A controller whose attach() was aborted before it ever ran must not have\n // detach() (or the teardown/event) run on it.\n if (!(controllerInstance as any)[CONTROLLER_ATTACHED]) {\n return;\n }\n\n // Run detach in the controller's scope\n if (scope) {\n await scope.runOperation(async () => {\n await controllerInstance.detach(element);\n });\n } else {\n await controllerInstance.detach(element);\n }\n \n controllerInstance.element = null;\n\n // Cleanup @observe observers for controller\n cleanupObservers(controllerInstance);\n\n // Cleanup @channel handlers for controller\n cleanupResponseHandlers(controllerInstance);\n\n // Cleanup @on event handlers for controller\n cleanupEventHandlers(controllerInstance);\n \n // Cleanup the controller scope\n if (scope) {\n await scope.cleanup();\n }\n \n // Clean up router context reference\n delete (controllerInstance as any)[ROUTER_CONTEXT];\n\n element.dispatchEvent(new CustomEvent('controller-detached', {\n detail: {\n name: controllerSource === undefined ? undefined : controllerLabel(controllerSource),\n controller: controllerInstance\n }\n }));\n}\n\n/**\n * Gets the controller instance attached to an element\n * @param element The element to get the controller from\n * @returns The controller instance or undefined\n */\nexport function getController<T extends IController = IController>(element: HTMLElement): T | undefined {\n return (element as any)[CONTROLLER_KEY] as T | undefined;\n}\n\n/**\n * Gets the controller scope for an element\n * @param element The element to get the scope from\n * @returns The controller scope or undefined\n */\nexport function getControllerScope(element: HTMLElement): ControllerScope | undefined {\n return (element as any)[CONTROLLER_OPERATIONS] as ControllerScope | undefined;\n}\n\n/**\n * Enable controller support for native HTML elements\n * This sets up a MutationObserver to watch for controller attributes\n * on non-custom elements (elements without hyphens in their tag names)\n */\nexport function useNativeElementControllers() {\n // Return if already initialized\n if ((globalThis as any).sniceNativeControllersInitialized) {\n return;\n }\n (globalThis as any).sniceNativeControllersInitialized = true;\n\n // Process elements that already have controller attribute\n function processElement(element: Element) {\n if (!(element instanceof HTMLElement)) return;\n // `tagName` can briefly be null when happy-dom/native mutation observers\n // fire on a node that's been detached mid-callback. Skip cleanly.\n if (!element.tagName || element.tagName.includes('-')) return;\n if ((element as any)[IS_ELEMENT_CLASS]) return;\n\n // A controller CLASS is attached (template binding or direct\n // attachController(el, Class)). The class channel owns the element:\n // attribute writes must not attach over it, and insertion sweeps must\n // not detach it.\n if ((element as any)[DIRECT_CONTROLLER]) {\n // External writes cannot replace a class binding. Keep the DOM marker\n // honest about the class that is actually attached.\n restoreDirectControllerAttribute(element);\n return;\n }\n\n const controllerName = element.getAttribute('controller');\n const currentControllerName = (element as any)[NATIVE_CONTROLLER];\n\n // No change\n if (controllerName === currentControllerName) return;\n\n // No attribute and never attribute-managed — nothing for this channel to\n // do. Without this guard, every added native element (including ones a\n // class controller was imperatively attached to before insertion) would\n // fall into the removal branch and get spuriously detached.\n if (!controllerName && currentControllerName === undefined) return;\n\n // Controller removed\n if (!controllerName) {\n delete (element as any)[NATIVE_CONTROLLER];\n delete (element as any)[CONTROLLER_NAME_KEY];\n detachController(element as HTMLElement).catch(error => {\n console.error(`Failed to detach controller from native element:`, error);\n });\n return;\n }\n\n // Controller added or changed\n (element as any)[NATIVE_CONTROLLER] = controllerName;\n\n if (!(element as any).ready) {\n (element as any).ready = Promise.resolve();\n }\n\n if (currentControllerName) {\n detachController(element as HTMLElement).catch(error => {\n console.error(`Failed to detach old controller from native element:`, error);\n });\n }\n\n attachController(element as HTMLElement, controllerName).catch(error => {\n // Detached before ready — designed teardown, not a failure\n if (error?.name === 'ControllerAttachAborted') {\n console.debug(`Controller \"${controllerName}\" attach aborted (element detached before ready)`);\n return;\n }\n if (error?.message === `Controller \"${controllerName}\" not found in registry`) {\n deferControllerAttachment(element as HTMLElement, controllerName);\n return;\n }\n console.error(`Failed to attach controller \"${controllerName}\" to native element:`, error);\n });\n }\n\n // Set up MutationObserver to watch for controller attributes\n const observer = new MutationObserver((mutations) => {\n for (const mutation of mutations) {\n if (mutation.type === 'attributes' && mutation.attributeName === 'controller') {\n processElement(mutation.target as Element);\n } else if (mutation.type === 'childList') {\n // Process added nodes\n mutation.addedNodes.forEach(node => {\n if (node instanceof HTMLElement) {\n // Process the node itself\n processElement(node);\n // Process all descendants with controller attribute\n node.querySelectorAll('[controller]').forEach(processElement);\n }\n });\n }\n }\n });\n\n function startObserving() {\n document.querySelectorAll('[controller]').forEach(processElement);\n observer.observe(document.body, {\n attributes: true,\n attributeFilter: ['controller'],\n childList: true,\n subtree: true\n });\n }\n\n if (document.readyState === 'loading') {\n document.addEventListener('DOMContentLoaded', startObserving);\n } else {\n startObserving();\n }\n\n // Store observer reference for cleanup if needed\n (globalThis as any).sniceNativeControllerObserver = observer;\n}\n\n/**\n * Stop watching for native element controllers\n */\nexport function cleanupNativeElementControllers() {\n const observer = (globalThis as any).sniceNativeControllerObserver;\n if (observer) {\n observer.disconnect();\n delete (globalThis as any).sniceNativeControllerObserver;\n delete (globalThis as any).sniceNativeControllersInitialized;\n }\n}\n\n/**\n * Registers a cleanup function for the current controller\n * @param controller The controller instance\n * @param key A unique key for this cleanup function\n * @param cleanup The cleanup function to register\n */\nexport function registerControllerCleanup(controller: IController, key: string, cleanup: Function): void {\n if (!controller.element) return;\n \n const scope = getControllerScope(controller.element as HTMLElement);\n if (scope) {\n scope.register(key, cleanup);\n }\n}\n","/**\n * @context decorator for receiving router context updates\n */\n\nimport { CONTEXT_HANDLER, NAVIGATION_CONTEXT_INSTANCE, CONTEXT_REGISTER, CONTEXT_UNREGISTER, CONTEXT_TIMER, CONTEXT_CALLED, CONTEXT_METHODS } from './symbols';\nimport { getSymbol } from './symbols';\nimport type { Context } from './types/context';\n\nconst CONTEXT_HANDLERS = getSymbol('context-handlers');\n\n/**\n * Options for the @context decorator\n */\nexport interface ContextOptions {\n /** Debounce delay in milliseconds - waits for quiet period before calling */\n debounce?: number;\n /** Throttle delay in milliseconds - limits calls to at most once per period */\n throttle?: number;\n /** Only call the method once, then unregister */\n once?: boolean;\n}\n\n/**\n * @context decorator for receiving router context updates\n *\n * @example\n * ```typescript\n * @element('my-layout')\n * class MyLayout extends HTMLElement {\n * @context\n * handleContext(ctx: Context) {\n * this.renderNav(ctx.placards, ctx.currentRoute);\n * }\n *\n * @context({ debounce: 300 })\n * handleContextDebounced(ctx: Context) {\n * // Called after 300ms of no updates\n * }\n * }\n * ```\n */\nexport function context(options: ContextOptions = {}) {\n return function (originalMethod: any, context: ClassMethodDecoratorContext) {\n const methodName = context.name as string;\n context.addInitializer(function (this: any) {\n const constructor = this.constructor as any;\n\n // hasOwnProperty guards so subclasses don't mutate parent state via\n // the prototype chain.\n if (!Object.prototype.hasOwnProperty.call(constructor, CONTEXT_METHODS)) {\n constructor[CONTEXT_METHODS] = new Set();\n }\n if (constructor[CONTEXT_METHODS].has(originalMethod)) return;\n constructor[CONTEXT_METHODS].add(originalMethod);\n\n if (!Object.prototype.hasOwnProperty.call(constructor, CONTEXT_HANDLERS)) {\n const inherited = constructor[CONTEXT_HANDLERS];\n constructor[CONTEXT_HANDLERS] = inherited ? [...inherited] : [];\n }\n\n constructor[CONTEXT_HANDLERS].push({\n methodName,\n method: originalMethod,\n options,\n });\n });\n\n return originalMethod;\n };\n}\n\n/**\n * Setup context handler for an element instance\n * Called automatically during element connection\n */\nexport function setupContextHandler(element: HTMLElement) {\n const handlers = (element.constructor as any)[CONTEXT_HANDLERS];\n if (!handlers || !Array.isArray(handlers) || handlers.length === 0) {\n return;\n }\n\n // Get the Context instance from the router\n const ctx = (element as any)[CONTEXT_HANDLER];\n if (!ctx) {\n return;\n }\n\n // Store the Context instance for cleanup\n (element as any)[NAVIGATION_CONTEXT_INSTANCE] = ctx;\n\n // Register each handler with the Context\n for (const handler of handlers) {\n const { methodName, method, options } = handler;\n const wrappedMethodName = `__wrapped_${methodName}`;\n\n // Create wrapped method with timing controls\n (element as any)[wrappedMethodName] = function (context: Context) {\n // `once` is tracked PER method (not a single element-level flag) so\n // multiple once handlers on the same element each fire.\n const called: Set<string> = (element as any)[CONTEXT_CALLED] ||\n ((element as any)[CONTEXT_CALLED] = new Set<string>());\n\n if (options.once && called.has(methodName)) {\n return;\n }\n\n const callMethod = () => {\n method.call(element, context);\n\n // Handle once option\n if (options.once) {\n called.add(methodName);\n // Unregister ONLY this handler, not the whole element — otherwise the\n // element's other @context handlers would stop receiving updates.\n const ctx = (element as any)[NAVIGATION_CONTEXT_INSTANCE];\n if (ctx && typeof ctx[CONTEXT_UNREGISTER] === 'function') {\n (ctx[CONTEXT_UNREGISTER] as (element: HTMLElement, methodName?: string) => void)(element, wrappedMethodName);\n }\n }\n };\n\n // Per-handler timer slot to avoid debounce/throttle handlers on the same\n // element overwriting each other's state.\n const timerSlot = (element as any)[CONTEXT_TIMER] ||\n ((element as any)[CONTEXT_TIMER] = {} as Record<string, any>);\n const timerKey = methodName;\n\n if (options.debounce) {\n clearTimeout(timerSlot[timerKey]?.timeout);\n timerSlot[timerKey] = {\n timeout: setTimeout(callMethod, options.debounce),\n };\n return;\n }\n\n if (options.throttle) {\n const now = Date.now();\n const lastCall = timerSlot[timerKey]?.lastCall || 0;\n if (now - lastCall >= options.throttle) {\n timerSlot[timerKey] = { lastCall: now };\n callMethod();\n }\n return;\n }\n\n callMethod();\n };\n\n // Register with the Context using the wrapped method name\n if (typeof ctx[CONTEXT_REGISTER] === 'function') {\n (ctx[CONTEXT_REGISTER] as (element: HTMLElement, methodName: string) => void)(element, wrappedMethodName);\n }\n }\n}\n\n/**\n * Cleanup context handler for an element instance\n * Called automatically during element disconnection\n */\nexport function cleanupContextHandler(element: HTMLElement) {\n const handlers = (element.constructor as any)[CONTEXT_HANDLERS];\n if (!handlers || !Array.isArray(handlers) || handlers.length === 0) {\n return;\n }\n\n // Clear any pending debounce timers (per-handler slots)\n const timerSlot = (element as any)[CONTEXT_TIMER];\n if (timerSlot && typeof timerSlot === 'object') {\n for (const key of Object.keys(timerSlot)) {\n if (timerSlot[key]?.timeout) clearTimeout(timerSlot[key].timeout);\n }\n delete (element as any)[CONTEXT_TIMER];\n }\n\n for (const handler of handlers) {\n\n // Clean up wrapped method\n const wrappedMethodName = `__wrapped_${handler.methodName}`;\n delete (element as any)[wrappedMethodName];\n }\n\n // Unregister from Context if available\n const ctx = (element as any)[NAVIGATION_CONTEXT_INSTANCE];\n if (ctx && typeof ctx[CONTEXT_UNREGISTER] === 'function') {\n (ctx[CONTEXT_UNREGISTER] as (element: HTMLElement) => void)(element);\n }\n\n delete (element as any)[NAVIGATION_CONTEXT_INSTANCE];\n delete (element as any)[CONTEXT_CALLED];\n}\n","/**\n * Template system for Snice v3.0.0\n * Provides html`` and css`` tagged template processors with differential rendering\n */\n\n// Unique symbols for type checking\n// Use Symbol.for() to ensure symbols are shared across multiple Snice instances\nexport const HTML_RESULT = Symbol.for('snice:html-result');\nexport const CSS_RESULT = Symbol.for('snice:css-result');\n\n// Static css`` sites are the common stylesheet path and can be reused forever.\n// Interpolated sites are intentionally not retained: caching every distinct\n// primitive interpolation would turn a dynamic css`` call into an unbounded\n// per-callsite value history.\nconst cssResultCache = new WeakMap<TemplateStringsArray, CSSResult>();\n\n/**\n * Result of html`` tagged template\n * Contains static strings and dynamic values for differential rendering\n */\nexport interface TemplateResult {\n readonly _$litType$: typeof HTML_RESULT;\n readonly strings: TemplateStringsArray;\n readonly values: readonly any[];\n /** True when created by svg`` — parses in the SVG namespace */\n readonly svg?: boolean;\n}\n\n/**\n * Result of css`` tagged template\n * Contains CSS text for style injection\n */\nexport interface CSSResult {\n readonly _$litType$: typeof CSS_RESULT;\n readonly cssText: string;\n styleSheet?: CSSStyleSheet;\n}\n\n/**\n * Tagged template function for creating HTML templates\n *\n * @example\n * ```typescript\n * html`<div class=\"card\">\n * <h1>${this.title}</h1>\n * <button @click=${this.handleClick}>Click me</button>\n * </div>`\n * ```\n */\nexport function html(strings: TemplateStringsArray, ...values: any[]): TemplateResult {\n return {\n _$litType$: HTML_RESULT,\n strings,\n values\n };\n}\n\n/**\n * Tagged template function for SVG fragments.\n *\n * Bare SVG elements (<circle>, <path>, ...) parse as unknown elements in an\n * HTML context. Use svg`` for fragments composed into a surrounding <svg>:\n *\n * @example\n * ```typescript\n * html`<svg viewBox=\"0 0 100 100\">${svg`<circle cx=\"50\" cy=\"50\" r=${r}></circle>`}</svg>`\n * ```\n */\nexport function svg(strings: TemplateStringsArray, ...values: any[]): TemplateResult {\n return {\n _$litType$: HTML_RESULT,\n strings,\n values,\n svg: true\n };\n}\n\n/**\n * Tagged template function for creating CSS\n *\n * @example\n * ```typescript\n * css`:host {\n * display: block;\n * padding: 1rem;\n * }`\n * ```\n */\nexport function css(strings: TemplateStringsArray, ...values: any[]): CSSResult {\n const cached = values.length === 0 ? cssResultCache.get(strings) : undefined;\n if (cached) return cached;\n\n // Combine strings and values into final CSS text\n let cssText = strings[0];\n for (let i = 0; i < values.length; i++) {\n // Inline a nested css`` result by its text so style fragments compose;\n // String() on a CSSResult object would yield \"[object Object]\".\n const value = values[i];\n cssText += (isCSSResult(value) ? value.cssText : String(value)) + strings[i + 1];\n }\n\n const result: CSSResult = {\n _$litType$: CSS_RESULT,\n cssText\n };\n\n // Try to create constructable stylesheet for better performance\n // This will be cached and reused across instances. Guard against envs\n // without a Document global (for example, workers).\n if (\n typeof CSSStyleSheet !== 'undefined' &&\n typeof Document !== 'undefined' &&\n 'adoptedStyleSheets' in Document.prototype\n ) {\n try {\n const sheet = new CSSStyleSheet();\n (sheet as any).replaceSync(cssText);\n result.styleSheet = sheet;\n } catch (e) {\n // Fall back to regular <style> tag if constructable stylesheets fail\n }\n }\n\n if (values.length === 0) cssResultCache.set(strings, result);\n\n return result;\n}\n\n/**\n * Check if a value is a TemplateResult\n */\nexport function isTemplateResult(value: any): value is TemplateResult {\n return value && value._$litType$ === HTML_RESULT;\n}\n\n/**\n * Check if a value is a CSSResult\n */\nexport function isCSSResult(value: any): value is CSSResult {\n return value && value._$litType$ === CSS_RESULT;\n}\n\n/**\n * Type guard for primitive values\n */\nexport function isPrimitive(value: any): boolean {\n return (\n value === null ||\n value === undefined ||\n typeof value === 'string' ||\n typeof value === 'number' ||\n typeof value === 'boolean' ||\n typeof value === 'bigint'\n );\n}\n\n/**\n * Sanitize HTML to prevent XSS\n * Only allows safe HTML, escapes dangerous content\n */\nexport function sanitize(value: any): string {\n if (value === null || value === undefined) {\n return '';\n }\n\n // Template results are safe - they've been processed\n if (isTemplateResult(value)) {\n return ''; // Will be handled by template renderer\n }\n\n // Convert to string and escape HTML entities\n const str = String(value);\n return str\n .replace(/&/g, '&amp;')\n .replace(/</g, '&lt;')\n .replace(/>/g, '&gt;')\n .replace(/\"/g, '&quot;')\n .replace(/'/g, '&#39;');\n}\n\n/**\n * Nothing - represents no value (different from null/undefined)\n * Used to remove content from templates\n * Use Symbol.for() to ensure symbols are shared across multiple Snice instances\n */\nexport const nothing = Symbol.for('snice:nothing');\n\n/**\n * Type for template values that represent \"no content\"\n */\nexport type Nothing = typeof nothing;\n\n// Unique symbol for unsafe HTML\n// Use Symbol.for() to ensure symbols are shared across multiple Snice instances\nconst UNSAFE_HTML = Symbol.for('snice:unsafe-html');\n\n/**\n * Wrapper for raw HTML strings that should not be escaped\n * WARNING: Only use with sanitized/trusted content to prevent XSS\n */\nexport interface UnsafeHTML {\n readonly _$litType$: typeof UNSAFE_HTML;\n readonly html: string;\n}\n\n/**\n * Mark a string as raw HTML that should not be escaped\n * WARNING: Only use with sanitized content - using user input can lead to XSS!\n *\n * @example\n * ```typescript\n * const htmlString = '<span class=\"bold\">Hello</span>';\n * html`<div>${unsafeHTML(htmlString)}</div>`\n * ```\n */\nexport function unsafeHTML(html: string): UnsafeHTML {\n return {\n _$litType$: UNSAFE_HTML,\n html\n };\n}\n\n/**\n * Check if a value is an UnsafeHTML wrapper\n */\nexport function isUnsafeHTML(value: any): value is UnsafeHTML {\n return value && value._$litType$ === UNSAFE_HTML;\n}\n","export const REPEAT_RESULT = Symbol.for('snice:repeat-result');\n\nexport interface RepeatOptions<T, K> {\n key: (item: T, index: number) => K;\n render: (item: T, index: number) => unknown;\n empty?: unknown | (() => unknown);\n}\n\nexport interface RepeatResult<T = unknown, K = unknown> {\n readonly _$repeat$: typeof REPEAT_RESULT;\n readonly items: readonly T[];\n readonly keys: readonly K[];\n readonly values: readonly unknown[];\n readonly empty: unknown;\n}\n\n/**\n * Render a keyed collection without adding wrapper elements.\n *\n * Keys are mandatory because repeat() is the explicit identity-preserving list\n * API. Duplicate keys throw before DOM reconciliation rather than silently\n * reusing the wrong row.\n */\nexport function repeat<T, K>(\n items: Iterable<T> | null | undefined,\n options: RepeatOptions<T, K>\n): RepeatResult<T, K> {\n if (!options || typeof options.key !== 'function' || typeof options.render !== 'function') {\n throw new TypeError('snice: repeat() requires { key, render }.');\n }\n\n const array = items == null ? [] : Array.from(items);\n const keys = array.map(options.key);\n const seen = new Set<K>();\n for (const key of keys) {\n if (seen.has(key)) {\n throw new Error(`snice: repeat() received duplicate key ${String(key)}.`);\n }\n seen.add(key);\n }\n\n return {\n _$repeat$: REPEAT_RESULT,\n items: array,\n keys,\n values: array.map(options.render),\n empty: array.length === 0\n ? typeof options.empty === 'function'\n ? (options.empty as () => unknown)()\n : options.empty\n : undefined\n };\n}\n\nexport function isRepeatResult(value: unknown): value is RepeatResult {\n return !!value && (value as RepeatResult)._$repeat$ === REPEAT_RESULT;\n}\n","import { ELEMENT_OPTIONS, RENDER_ROOT } from './symbols';\nimport type { ElementOptions } from './types/element-options';\n\nexport type SniceRenderRoot = HTMLElement | ShadowRoot;\n\nconst renderHosts = new WeakSet<HTMLElement>();\n\nexport function getRenderRoot(element: HTMLElement): SniceRenderRoot | null {\n return (element as any)[RENDER_ROOT] || element.shadowRoot || null;\n}\n\nexport function ensureRenderRoot(element: HTMLElement): SniceRenderRoot {\n const existing = getRenderRoot(element);\n if (existing) return existing;\n\n const options = (element.constructor as any)[ELEMENT_OPTIONS] as ElementOptions | undefined;\n let root: SniceRenderRoot;\n\n if (options?.renderRoot === 'light' || options?.shadow === false) {\n root = element;\n } else if (typeof (element as any).createRenderRoot === 'function') {\n root = (element as any).createRenderRoot();\n } else {\n const mode = typeof options?.shadow === 'string' ? options.shadow : 'open';\n root = element.attachShadow({ mode, delegatesFocus: options?.delegatesFocus });\n }\n\n if (root !== element && !(root instanceof ShadowRoot)) {\n throw new TypeError('snice: createRenderRoot() must return the host element or a ShadowRoot.');\n }\n (element as any)[RENDER_ROOT] = root;\n renderHosts.add(element);\n return root;\n}\n\nexport function findRenderHost(node: Node): HTMLElement | null {\n const root = node.getRootNode();\n if (root instanceof ShadowRoot) return root.host as HTMLElement;\n\n let current: Node | null = node;\n while (current) {\n if (current instanceof HTMLElement && renderHosts.has(current)) return current;\n current = current.parentNode;\n }\n return null;\n}\n","\nimport { TemplateResult, CSSResult, HTML_RESULT, CSS_RESULT, isTemplateResult, isUnsafeHTML, UnsafeHTML, nothing, Nothing } from './template';\nimport { isRepeatResult } from './repeat';\nimport { findRenderHost } from './render-root';\nimport { PRE_UPGRADE_PROPERTY_BINDINGS, IS_ELEMENT_CLASS, PENDING_CONTROLLER_BINDING } from './symbols';\nimport { attachController, detachController } from './controller';\nimport { parseKeyboardFilter, matchesKeyboardFilter, warnIfModifierMisuse, type KeyboardFilter } from './keyboard-filter';\n\n// Unique marker for dynamic parts\n// This parses as a comment node but doesn't get escaped in attributes\nconst marker = `snice$${Math.random().toFixed(9).slice(2)}$`;\nconst markerMatch = '?' + marker;\n// A true comment, not a processing instruction (<?...>): in HTML content both\n// parse to the same comment node, but PIs are dropped inside foreign content\n// (<svg>), which would silently kill any node binding inside an svg block.\nconst nodeMarker = `<!--${markerMatch}-->`;\n// Escape the `$` chars — as a bare RegExp they'd be end anchors and the\n// pattern would never match, so marker-bearing text/comments never split.\nconst markerRegex = new RegExp(marker.replace(/\\$/g, '\\\\$'), 'g');\n\n// Template cache - templates with same string array can be reused\nconst templateCache = new WeakMap<TemplateStringsArray, Template>();\n\n// Sentinel for \"not yet set\" - distinct from undefined/null\nconst NOT_COMMITTED = Symbol('not-committed');\n\nfunction markPreUpgradePropertyBinding(element: Element, propertyName: string): void {\n const tagName = element.localName;\n if (!tagName?.includes('-')) return;\n const registry = element.ownerDocument?.defaultView?.customElements ?? globalThis.customElements;\n if (registry?.get(tagName)) return;\n const target = element as any;\n if (!target[PRE_UPGRADE_PROPERTY_BINDINGS]) target[PRE_UPGRADE_PROPERTY_BINDINGS] = new Set<string>();\n target[PRE_UPGRADE_PROPERTY_BINDINGS].add(propertyName);\n}\n\n// noChange sentinel - preserves the currently committed value\nexport const noChange = Symbol.for('snice:no-change');\nexport type NoChange = typeof noChange;\n\n// live() wrapper - marks a property binding value for comparison against the\n// actual DOM property instead of the last committed value\nconst LIVE_MARKER = Symbol.for('snice:live');\n\ninterface LiveValue {\n readonly _$liveMarker$: typeof LIVE_MARKER;\n readonly value: unknown;\n}\n\n/**\n * Wrap a property binding value so the commit compares against the element's\n * CURRENT DOM property rather than the last committed value. Use for inputs\n * whose DOM state the user can change out from under the binding:\n *\n * ```typescript\n * html`<input .value=${live(this.text)} />`\n * ```\n *\n * Without live(), re-rendering with an unchanged bound value skips the DOM\n * write, leaving user-typed text in place.\n */\nexport function live(value: unknown): LiveValue {\n return { _$liveMarker$: LIVE_MARKER, value };\n}\n\nfunction isLive(value: any): value is LiveValue {\n return value && value._$liveMarker$ === LIVE_MARKER;\n}\n\nfunction contextualizeTemplatePreparationError(error: unknown, strings: TemplateStringsArray): Error {\n if (error instanceof Error && /\\bNear \"[\\s\\S]*\"\\.$/.test(error.message)) return error;\n const message = error instanceof Error ? error.message : String(error);\n const source = Array.from(strings).join('${…}').replace(/\\s+/g, ' ').trim();\n const tag = /<([a-z][a-z0-9-]*)>/i.exec(message)?.[1];\n const binding = /binding \"([^\"]+)\"/i.exec(message)?.[1];\n const clue = tag ? `<${tag}` : binding ?? '';\n const clueIndex = clue ? source.indexOf(clue) : -1;\n const center = clueIndex >= 0 ? clueIndex : 0;\n const start = Math.max(0, center - 40);\n const end = Math.min(source.length, center + 80);\n const prefix = start > 0 ? '…' : '';\n const suffix = end < source.length ? '…' : '';\n return new Error(`${message} Near \"${prefix}${source.slice(start, end)}${suffix}\".`, {\n cause: error\n });\n}\n\n/**\n * Check if value is a primitive (can be compared with ===)\n */\nconst isPrimitive = (value: unknown): boolean =>\n value === null || (typeof value !== 'object' && typeof value !== 'function');\n\n/**\n * Check if value is iterable (array or has Symbol.iterator)\n */\nconst isIterable = (value: unknown): value is Iterable<unknown> =>\n Array.isArray(value) || typeof (value as any)?.[Symbol.iterator] === 'function';\n\nconst isPromiseLike = (value: unknown): value is PromiseLike<unknown> =>\n !!value && typeof (value as PromiseLike<unknown>).then === 'function';\n\nconst isAsyncIterable = (value: unknown): value is AsyncIterable<unknown> =>\n !!value && typeof (value as AsyncIterable<unknown>)[Symbol.asyncIterator] === 'function';\n\n/**\n * A prepared template ready for rendering\n */\nclass Template {\n parts: TemplatePart[] = [];\n element: HTMLTemplateElement;\n /**\n * Value index of a `key=${...}` binding in this template, or -1 if unkeyed.\n * Used by keyed list reconciliation in NodePart._commitIterable.\n */\n keyIndex = -1;\n\n constructor(result: TemplateResult, element: HTMLTemplateElement, attrNamesForParts: string[]) {\n this.element = element;\n const walker = document.createTreeWalker(\n element.content,\n NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT\n );\n\n let partIndex = 0;\n const nodesToRemove: Node[] = [];\n let node: Node | null;\n\n while ((node = walker.nextNode()) !== null) {\n if (node.nodeType === Node.ELEMENT_NODE) {\n const element = node as Element;\n const tagName = element.tagName.toLowerCase();\n const parentTag = element.parentElement?.tagName.toLowerCase();\n\n if ((tagName === 'else' || tagName === 'else-if') && parentTag !== 'if') {\n throw new Error(`snice: <${tagName}> must be a direct child of <if>.`);\n }\n if ((tagName === 'when' || tagName === 'default') && parentTag !== 'case') {\n throw new Error(`snice: <${tagName}> must be a direct child of <case>.`);\n }\n\n // Handle virtual elements: <if>, <else-if>, <case>, <when>\n // Keep them in the DOM with display:contents for now\n // Will optimize later with proper template extraction\n if (tagName === 'if') {\n // <if value=\"${condition}\">children</if>\n const valueAttr = element.getAttribute('value');\n\n if (valueAttr && valueAttr.includes(marker)) {\n // Remove the value attribute\n element.removeAttribute('value');\n\n this.parts.push({\n type: 'conditional-if',\n index: partIndex++,\n element // Keep the <if> element\n });\n\n // Continue processing children normally\n } else {\n throw new Error('snice: <if> requires a condition expression.');\n }\n continue;\n }\n\n // Handle <case> element\n if (tagName === 'case') {\n // <case value=\"${value}\">children</case>\n const valueAttr = element.getAttribute('value');\n\n if (valueAttr && valueAttr.includes(marker)) {\n for (const child of Array.from(element.childNodes)) {\n if (child.nodeType === Node.ELEMENT_NODE) {\n const branchTag = (child as Element).tagName.toLowerCase();\n if (branchTag !== 'when' && branchTag !== 'default') {\n throw new Error('snice: <case> may contain only direct <when> and <default> branches.');\n }\n } else if (\n child.nodeType === Node.TEXT_NODE && child.textContent?.trim() ||\n child.nodeType === Node.COMMENT_NODE && (child as Comment).data.includes(marker)\n ) {\n throw new Error('snice: content inside <case> must be nested in a <when> or <default> branch.');\n }\n }\n // Remove the value attribute\n element.removeAttribute('value');\n\n this.parts.push({\n type: 'conditional-case',\n index: partIndex++,\n element // Keep the <case> element\n });\n\n // Continue processing children normally\n } else {\n throw new Error('snice: <case> requires a value expression.');\n }\n continue;\n }\n\n if (tagName === 'else-if') {\n const valueAttr = element.getAttribute('value');\n if (valueAttr && valueAttr.includes(marker)) {\n element.removeAttribute('value');\n this.parts.push({\n type: 'conditional-else-if',\n index: partIndex++,\n element\n });\n } else {\n throw new Error('snice: <else-if> requires a condition expression.');\n }\n continue;\n }\n\n if (tagName === 'when') {\n const valueAttr = element.getAttribute('value');\n if (valueAttr && valueAttr.includes(marker)) {\n element.removeAttribute('value');\n this.parts.push({\n type: 'conditional-when',\n index: partIndex++,\n element\n });\n }\n continue;\n }\n\n if (element.hasAttributes()) {\n const attributes = element.attributes;\n const attrsToRemove: Attr[] = [];\n\n for (let i = 0; i < attributes.length; i++) {\n const attr = attributes[i];\n const value = attr.value;\n\n // Check for attribute bindings\n if (value.includes(marker)) {\n attrsToRemove.push(attr);\n\n // Get original attribute name with preserved case\n const originalName = attrNamesForParts[partIndex] || attr.name;\n\n // Extract static string segments by splitting on marker\n const attrStrings = value.split(marker);\n\n // Number of expressions = number of markers = attrStrings.length - 1\n const expressionCount = attrStrings.length - 1;\n\n // Property/boolean/event bindings take a SINGLE expression — they\n // can't concatenate static text (a `.prop` is an object, not a\n // string). They consume the first expression; any static text or\n // extra expressions are ignored. But the value index must still\n // advance by the true marker count, or every later binding shifts.\n const isSingleExpressionBinding =\n /^@@?|^[.?]/.test(originalName) ||\n originalName.startsWith('...') ||\n originalName.startsWith('class:') ||\n originalName.startsWith('style:');\n if (isSingleExpressionBinding) {\n const hasStaticText = attrStrings.some((s) => s !== '');\n if (expressionCount > 1 || hasStaticText) {\n console.warn(\n `snice: binding \"${originalName}\" takes a single expression; ` +\n `static text and extra interpolations are ignored. ` +\n `Use a plain attribute for string interpolation.`\n );\n }\n }\n\n if (originalName.startsWith('...')) {\n const spreadName = originalName.slice(3).toLowerCase();\n if (!['props', 'properties', 'attrs', 'attributes', 'events'].includes(spreadName)) {\n throw new Error(\n `snice: unknown spread binding \"${originalName}\". ` +\n 'Use ...props, ...attrs, or ...events.'\n );\n }\n this.parts.push({\n type: 'spread',\n index: partIndex,\n name: spreadName,\n element\n });\n partIndex += expressionCount;\n } else if (originalName.startsWith('class:')) {\n if (!originalName.slice(6)) throw new Error('snice: class: binding requires a class name.');\n this.parts.push({\n type: 'class',\n index: partIndex,\n name: originalName.slice(6),\n element\n });\n partIndex += expressionCount;\n } else if (originalName.startsWith('style:')) {\n if (!originalName.slice(6)) throw new Error('snice: style: binding requires a CSS property name.');\n this.parts.push({\n type: 'style',\n index: partIndex,\n name: originalName.slice(6),\n element\n });\n partIndex += expressionCount;\n } else if (originalName.startsWith('@@')) {\n if (!originalName.slice(2).split('|')[0]) throw new Error('snice: event binding requires an event name.');\n // Escaped event binding for events with @ in the name (e.g., @@snice/event -> @snice/event)\n this.parts.push({\n type: 'event',\n index: partIndex,\n name: originalName.slice(1), // Keep the @ in the event name\n element\n });\n partIndex += expressionCount;\n } else if (originalName.startsWith('@')) {\n if (!originalName.slice(1).split('|')[0]) throw new Error('snice: event binding requires an event name.');\n // Event binding (single value only)\n this.parts.push({\n type: 'event',\n index: partIndex,\n name: originalName.slice(1),\n element\n });\n partIndex += expressionCount;\n } else if (originalName.startsWith('.')) {\n if (!originalName.slice(1)) throw new Error('snice: property binding requires a property name.');\n // Property binding (single value only)\n this.parts.push({\n type: 'property',\n index: partIndex,\n name: originalName.slice(1),\n element\n });\n partIndex += expressionCount;\n } else if (originalName.startsWith('?')) {\n if (!originalName.slice(1)) throw new Error('snice: boolean binding requires an attribute name.');\n // Boolean attribute (single value only)\n this.parts.push({\n type: 'boolean-attribute',\n index: partIndex,\n name: originalName.slice(1),\n element\n });\n partIndex += expressionCount;\n } else if (\n attr.name === 'controller' &&\n attrStrings.length === 2 && attrStrings[0] === '' && attrStrings[1] === ''\n ) {\n // Bare controller=${...} binding: accepts a decorated\n // controller class directly, or a registry name string.\n // Interpolated forms (controller=\"a-${x}\") stay plain\n // string attributes.\n this.parts.push({\n type: 'controller',\n index: partIndex,\n element\n });\n partIndex += expressionCount;\n } else {\n // Regular attribute - supports multiple interpolations\n // Store static string segments for interpolation\n this.parts.push({\n type: 'attribute',\n index: partIndex,\n name: attr.name,\n element,\n attrStrings\n });\n // Increment by number of expressions consumed\n partIndex += expressionCount;\n }\n }\n }\n\n // Remove marker attributes\n for (const attr of attrsToRemove) {\n element.removeAttribute(attr.name);\n }\n }\n } else if (node.nodeType === Node.COMMENT_NODE) {\n const comment = node as Comment;\n // Check for marker match (processing instruction becomes comment)\n if (comment.data === markerMatch) {\n // Node part\n const parent = comment.parentNode!;\n const endNode = document.createComment('');\n parent.insertBefore(endNode, comment.nextSibling);\n\n this.parts.push({\n type: 'node',\n index: partIndex++,\n startNode: comment,\n endNode\n });\n } else if (comment.data.includes(marker)) {\n // Binding(s) inside an authored HTML comment (<!-- ${x} -->).\n // Render values into the comment text; critically, consume the\n // right number of value indices so later parts stay aligned.\n const commentStrings = comment.data.split(markerRegex);\n\n this.parts.push({\n type: 'comment',\n index: partIndex,\n startNode: comment,\n attrStrings: commentStrings\n });\n partIndex += commentStrings.length - 1;\n }\n } else if (node.nodeType === Node.TEXT_NODE) {\n const text = node as Text;\n const data = text.data;\n\n if (data.includes(marker)) {\n // Split text node at markers\n const parent = text.parentNode!;\n const parts = data.split(markerRegex);\n const lastIndex = parts.length - 1;\n\n for (let i = 0; i < lastIndex; i++) {\n parent.insertBefore(document.createTextNode(parts[i]), text);\n const comment = document.createComment('');\n const endNode = document.createComment('');\n parent.insertBefore(comment, text);\n parent.insertBefore(endNode, text);\n\n this.parts.push({\n type: 'node',\n index: partIndex++,\n startNode: comment,\n endNode\n });\n }\n\n // Last part\n if (parts[lastIndex] !== '') {\n text.data = parts[lastIndex];\n } else {\n nodesToRemove.push(text);\n }\n }\n }\n }\n\n // Remove marker nodes\n for (const node of nodesToRemove) {\n node.parentNode?.removeChild(node);\n }\n\n // Record the value index of a `key=${...}` binding (first one wins) so\n // list rendering can associate DOM with keys instead of indices.\n for (const part of this.parts) {\n if (part.type === 'attribute' && part.name === 'key') {\n this.keyIndex = part.index;\n break;\n }\n }\n }\n}\n\ninterface TemplatePart {\n type: 'node' | 'attribute' | 'property' | 'boolean-attribute' | 'event' | 'class' | 'style' | 'spread' | 'controller' | 'conditional-if' | 'conditional-else-if' | 'conditional-case' | 'conditional-when' | 'comment';\n index: number;\n name?: string;\n element?: Element;\n startNode?: Comment;\n endNode?: Comment;\n attrStrings?: string[]; // Static string segments for attribute/comment interpolation\n}\n\n/**\n * Prepare a template for rendering\n *\n * Uses state tracking to correctly handle multi-interpolation in attributes.\n * Tracks whether we're inside a tag and inside a quoted attribute value.\n */\nfunction prepareTemplate(result: TemplateResult): Template {\n // Check cache first\n const { strings } = result;\n const cached = templateCache.get(strings);\n if (cached) {\n return cached;\n }\n\n // Build HTML with markers and extract original attribute names\n const htmlParts: string[] = [];\n const attrNamesForParts: string[] = [];\n\n // State tracking for multi-interpolation support\n let inTag = false; // Inside a tag (between < and >)\n let inAttrValue = false; // Inside a quoted attribute value\n let inComment = false; // Inside an HTML comment (<!-- ... -->)\n let attrQuoteChar = ''; // The quote character (' or \")\n let currentAttrName = ''; // The current attribute name\n\n for (let i = 0; i < strings.length; i++) {\n const str = strings[i];\n htmlParts.push(str);\n\n if (i < strings.length - 1) {\n // Update state by scanning the string\n for (let j = 0; j < str.length; j++) {\n const char = str[j];\n\n if (inComment) {\n // Only the closing --> matters inside a comment\n if (char === '-' && str.startsWith('-->', j)) {\n inComment = false;\n j += 2;\n }\n } else if (!inTag) {\n // Looking for tag start (or comment start)\n if (char === '<') {\n if (str.startsWith('<!--', j)) {\n inComment = true;\n j += 3;\n } else if (/[A-Za-z!/?]/.test(str[j + 1] || '')) {\n inTag = true;\n }\n }\n } else if (!inAttrValue) {\n // Inside tag, but not in attribute value\n if (char === '>') {\n inTag = false;\n } else if (char === '\"' || char === \"'\") {\n inAttrValue = true;\n attrQuoteChar = char;\n } else if (char === '=') {\n // Extract attribute name (look backwards for it).\n // Includes `~` for the \"any-modifier\" keyboard prefix\n // (e.g. `@keydown.~enter`) so it isn't truncated to `.enter`.\n let attrStart = j - 1;\n while (attrStart >= 0 && /[\\w\\-\\.@\\?/:\\+~|]/.test(str[attrStart])) {\n attrStart--;\n }\n currentAttrName = str.substring(attrStart + 1, j).trim();\n }\n } else {\n // Inside quoted attribute value\n if (char === attrQuoteChar) {\n inAttrValue = false;\n attrQuoteChar = '';\n }\n }\n }\n\n // Now determine what kind of marker to insert based on current state\n if (inComment) {\n // Binding inside an HTML comment — insert a plain marker into the\n // comment text. The Template scanner turns it into a CommentPart so\n // the value index stays aligned (a swallowed marker would shift every\n // binding after the comment).\n attrNamesForParts.push('');\n htmlParts.push(marker);\n } else if (inAttrValue) {\n // We're inside a quoted attribute value - this is an attribute binding\n // For subsequent interpolations in same attribute, keep using same attr name\n attrNamesForParts.push(currentAttrName);\n htmlParts.push(marker);\n } else if (inTag) {\n // Inside tag but not in attr value - check for special cases\n // Check if this is start of attribute value (= at end of string)\n const trimmed = str.trimEnd();\n if (trimmed.endsWith('=')) {\n // Extract attribute name (same `~` inclusion as the in-tag branch\n // above — supports `@keydown.~enter` keyboard modifier prefix).\n let attrStart = trimmed.length - 2;\n while (attrStart >= 0 && /[\\w\\-\\.@\\?\\/:\\+~|]/.test(trimmed[attrStart])) {\n attrStart--;\n }\n currentAttrName = trimmed.substring(attrStart + 1, trimmed.length - 1).trim();\n attrNamesForParts.push(currentAttrName);\n htmlParts.push(marker);\n } else {\n // Check if this is a meta element (<if> or <case>)\n const metaElementMatch = str.match(/<(if|else-if|case|when)\\s*$/);\n if (metaElementMatch) {\n currentAttrName = 'value';\n attrNamesForParts.push('value');\n htmlParts.push(`value=\"${marker}\"`);\n } else {\n const nearbyTemplate = (\n str.slice(-40) + '${…}' + (strings[i + 1] ?? '').slice(0, 40)\n ).replace(/\\s+/g, ' ').trim();\n throw new Error(\n 'snice: expressions directly in opening tags are not supported; ' +\n 'use an explicit attribute, property, event, class, style, or named spread binding. ' +\n `Near \"${nearbyTemplate}\".`\n );\n }\n }\n } else {\n // Outside any tag - this is node content\n attrNamesForParts.push('');\n htmlParts.push(nodeMarker);\n }\n }\n }\n\n const html = htmlParts.join('');\n\n const template = document.createElement('template');\n if (result.svg) {\n // Parse in the SVG namespace by wrapping, then unwrap: the parsed nodes\n // keep their namespace when moved out of the temporary <svg> element.\n template.innerHTML = `<svg>${html}</svg>`;\n const wrapper = template.content.firstElementChild!;\n while (wrapper.firstChild) {\n template.content.insertBefore(wrapper.firstChild, wrapper);\n }\n template.content.removeChild(wrapper);\n } else {\n template.innerHTML = html;\n }\n\n let tmpl: Template;\n try {\n tmpl = new Template(result, template, attrNamesForParts);\n } catch (error) {\n throw contextualizeTemplatePreparationError(error, strings);\n }\n // Cache the template for reuse\n templateCache.set(strings, tmpl);\n return tmpl;\n}\n\n/**\n * Extract the key of a list item rendered from a template with a\n * `key=${...}` binding. Returns undefined for unkeyed items.\n */\nfunction getItemKey(item: unknown): unknown {\n if (!isTemplateResult(item)) return undefined;\n const tmpl = prepareTemplate(item as TemplateResult);\n return tmpl.keyIndex === -1 ? undefined : (item as TemplateResult).values[tmpl.keyIndex];\n}\n\n/**\n * Instance of a rendered template\n */\nexport class TemplateInstance {\n template: Template;\n strings: TemplateStringsArray;\n parts: Part[] = [];\n fragment: DocumentFragment | null = null;\n private conditionalParts: Array<{part: Part; index: number}> = []; // if/case parts with their indices\n private regularParts: Array<{part: Part; index: number}> = []; // all other parts with their indices\n\n constructor(result: TemplateResult) {\n this.template = prepareTemplate(result);\n this.strings = result.strings;\n }\n\n /**\n * Check if this instance uses the same template strings\n * (template identity is based on the strings array reference)\n */\n isSameTemplate(strings: TemplateStringsArray): boolean {\n return this.strings === strings;\n }\n\n renderFragment(): DocumentFragment {\n if (!this.fragment) {\n // First render - clone template and create parts\n this.fragment = this.template.element.content.cloneNode(true) as DocumentFragment;\n\n // Build a map of nodes from template to cloned fragment\n const walker = document.createTreeWalker(\n this.template.element.content,\n NodeFilter.SHOW_ALL\n );\n const clonedWalker = document.createTreeWalker(\n this.fragment,\n NodeFilter.SHOW_ALL\n );\n\n const nodeMap = new Map<Node, Node>();\n let templateNode = walker.currentNode;\n let clonedNode = clonedWalker.currentNode;\n\n while (templateNode && clonedNode) {\n nodeMap.set(templateNode, clonedNode);\n templateNode = walker.nextNode()!;\n clonedNode = clonedWalker.nextNode()!;\n }\n\n const dynamicWhenElements = new Set<Element>();\n for (const definition of this.template.parts) {\n if (definition.type === 'conditional-when') {\n dynamicWhenElements.add(nodeMap.get(definition.element!) as Element);\n }\n }\n\n for (let i = 0; i < this.template.parts.length; i++) {\n const partDef = this.template.parts[i];\n let part: Part;\n\n switch (partDef.type) {\n case 'node':\n const startNode = nodeMap.get(partDef.startNode!) as Comment;\n const endNode = nodeMap.get(partDef.endNode!) as Comment;\n part = new NodePart(startNode, endNode);\n break;\n case 'attribute':\n const attrElement = nodeMap.get(partDef.element!) as Element;\n part = new AttributePart(attrElement, partDef.name!, partDef.attrStrings);\n break;\n case 'property':\n const propElement = nodeMap.get(partDef.element!) as Element;\n part = new PropertyPart(propElement, partDef.name!);\n break;\n case 'boolean-attribute':\n const boolElement = nodeMap.get(partDef.element!) as Element;\n part = new BooleanAttributePart(boolElement, partDef.name!);\n break;\n case 'event':\n const eventElement = nodeMap.get(partDef.element!) as Element;\n part = new EventPart(eventElement, partDef.name!);\n break;\n case 'class':\n const classElement = nodeMap.get(partDef.element!) as Element;\n part = new ClassPart(classElement, partDef.name!);\n break;\n case 'style':\n const styleElement = nodeMap.get(partDef.element!) as HTMLElement;\n part = new StylePart(styleElement, partDef.name!);\n break;\n case 'spread':\n const spreadElement = nodeMap.get(partDef.element!) as Element;\n part = new SpreadPart(spreadElement, partDef.name!);\n break;\n case 'controller':\n const controllerElement = nodeMap.get(partDef.element!) as HTMLElement;\n part = new ControllerPart(controllerElement);\n break;\n case 'conditional-if':\n const conditionalIfElement = nodeMap.get(partDef.element!) as Element;\n part = new ConditionalIfPart(conditionalIfElement);\n break;\n case 'conditional-else-if':\n const conditionalElseIfElement = nodeMap.get(partDef.element!) as Element;\n part = new ConditionalElseIfPart(conditionalElseIfElement);\n break;\n case 'conditional-case':\n const conditionalCaseElement = nodeMap.get(partDef.element!) as Element;\n part = new ConditionalCasePart(conditionalCaseElement, dynamicWhenElements);\n break;\n case 'conditional-when':\n const conditionalWhenElement = nodeMap.get(partDef.element!) as Element;\n part = new ConditionalWhenPart(conditionalWhenElement);\n break;\n case 'comment':\n const commentNode = nodeMap.get(partDef.startNode!) as Comment;\n part = new CommentPart(commentNode, partDef.attrStrings!);\n break;\n default:\n throw new Error(`Unknown part type: ${(partDef as any).type}`);\n }\n\n this.parts.push(part);\n\n // Separate conditional parts from regular parts for optimized update\n // Use partDef.index (the VALUE index) not i (the part array index)\n if (\n part instanceof ConditionalIfPart ||\n part instanceof ConditionalElseIfPart ||\n part instanceof ConditionalCasePart ||\n part instanceof ConditionalWhenPart\n ) {\n this.conditionalParts.push({part, index: partDef.index});\n } else {\n this.regularParts.push({part, index: partDef.index});\n }\n }\n\n }\n\n return this.fragment;\n }\n\n render(values: readonly any[]): DocumentFragment {\n const fragment = this.renderFragment();\n // Commit values to parts\n this.update(values);\n return fragment;\n }\n\n update(values: readonly any[]): void {\n // Optimized: Process conditional parts first (if any), then regular parts\n // Using pre-separated arrays with cached indices avoids instanceof and indexOf calls\n\n // Process conditional parts first (they control visibility)\n for (const {part, index} of this.conditionalParts) {\n part.commit(values[index]);\n }\n\n // Conditions are staged above, then flushed once. This avoids transiently\n // mounting an else/default branch while later else-if/when expressions in\n // the same update are still being committed.\n const flushed = new Set<Part>();\n for (const {part} of this.conditionalParts) {\n const coordinator = part instanceof ConditionalElseIfPart\n ? part.coordinator\n : part instanceof ConditionalWhenPart\n ? part.coordinator\n : part;\n if (flushed.has(coordinator)) continue;\n flushed.add(coordinator);\n if (coordinator instanceof ConditionalIfPart || coordinator instanceof ConditionalCasePart) {\n coordinator.flush();\n }\n }\n\n // Then process regular parts\n let i = 0;\n for (const {part, index} of this.regularParts) {\n // AttributeParts with interpolation consume multiple values\n if (part instanceof AttributePart && part.strings !== undefined) {\n // Pass full values array and starting index for interpolation\n part.commit(values, index);\n // The part consumes (strings.length - 1) values\n // But since we're iterating by template part index, this is handled by the Template\n } else if (part instanceof CommentPart) {\n // CommentParts also consume (strings.length - 1) values\n part.commit(values, index);\n } else {\n part.commit(values[index]);\n }\n }\n\n // Branch switches can move event-bearing nodes between the live DOM and\n // parked fragments. Reconcile connection state after every update so\n // listeners detach while parked and reattach when their branch returns.\n let lifecycleError: unknown;\n for (const part of this.parts) {\n try {\n if (part.isConnected) part.reconnected();\n else part.disconnected();\n } catch (error) {\n lifecycleError ??= error;\n }\n }\n if (lifecycleError) throw lifecycleError;\n }\n\n clear(): void {\n let lifecycleError: unknown;\n for (const part of this.parts) {\n try {\n part.destroy();\n } catch (error) {\n lifecycleError ??= error;\n }\n }\n if (lifecycleError) throw lifecycleError;\n }\n\n disconnected(preserveEventListeners = false): void {\n let lifecycleError: unknown;\n for (const part of this.parts) {\n try {\n part.disconnected(preserveEventListeners);\n } catch (error) {\n lifecycleError ??= error;\n }\n }\n if (lifecycleError) throw lifecycleError;\n }\n\n reconnected(): void {\n let lifecycleError: unknown;\n for (const part of this.parts) {\n try {\n part.reconnected();\n } catch (error) {\n lifecycleError ??= error;\n }\n }\n if (lifecycleError) throw lifecycleError;\n }\n\n}\n\n/**\n * Base class for all parts\n */\nexport abstract class Part {\n abstract readonly type: string;\n\n get isConnected(): boolean {\n return (this as any).element?.isConnected ?? false;\n }\n\n disconnected(_preserveEventListeners = false): void {}\n\n reconnected(): void {}\n\n destroy(): void {\n let lifecycleError: unknown;\n try {\n this.clear();\n } catch (error) {\n lifecycleError = error;\n }\n if (lifecycleError) throw lifecycleError;\n }\n\n abstract commit(value: any): void;\n abstract clear(): void;\n}\n\n/**\n * NodePart handles text content and nested templates\n *\n * Lit-HTML style optimizations:\n * - Reuses TemplateInstance when same template strings are rendered\n * - Reuses text nodes when updating primitive → primitive\n * - Reuses child NodeParts when rendering arrays\n */\nexport class NodePart extends Part {\n readonly type = 'node' as const;\n private startNode: Comment;\n private endNode: Comment;\n private _committedValue: any = NOT_COMMITTED;\n private _itemKeys: unknown[] | null = null; // keys of the last committed iterable, when fully keyed\n private _asyncSource: PromiseLike<unknown> | AsyncIterable<unknown> | null = null;\n private _asyncVersion = 0;\n private _asyncIterator: AsyncIterator<unknown> | null = null;\n private _asyncRunning = false;\n private _asyncStarted = false;\n private _asyncCompleted = false;\n private _asyncPaused = false;\n private _committingAsyncValue = false;\n\n constructor(startNode: Comment, endNode: Comment) {\n super();\n this.startNode = startNode;\n this.endNode = endNode;\n }\n\n commit(value: any): void {\n // Handle noChange sentinel\n if (value === noChange) {\n return;\n }\n\n if (isPromiseLike(value) || isAsyncIterable(value)) {\n this._commitAsync(value);\n return;\n }\n if (!this._committingAsyncValue && this._asyncSource) this._cancelAsync(true);\n\n // Handle nothing/null/undefined/empty - clear content\n if (value === nothing || value == null || value === '') {\n if (this._committedValue !== nothing) {\n const cleanupError = this._clear();\n this._committedValue = nothing;\n if (cleanupError) throw cleanupError;\n }\n this._committedValue = nothing;\n return;\n }\n\n // Handle primitives (string, number, boolean, bigint, symbol)\n if (isPrimitive(value)) {\n if (value !== this._committedValue) {\n this._commitText(value);\n }\n return;\n }\n\n // Handle nested templates\n if (isTemplateResult(value)) {\n this._commitTemplateResult(value);\n return;\n }\n\n // Explicit keyed repeat() result. It feeds keys directly into the list\n // reconciler, so rendered roots do not need a synthetic key attribute or\n // wrapper element.\n if (isRepeatResult(value)) {\n if (value.values.length === 0) {\n this.commit(value.empty ?? nothing);\n } else {\n this._commitIterable(value.values, value.keys);\n }\n return;\n }\n\n // Handle unsafe HTML\n if (isUnsafeHTML(value)) {\n this._commitUnsafeHTML(value);\n return;\n }\n\n // Handle DOM nodes\n if ((value as Node).nodeType !== undefined) {\n this._commitNode(value as Node);\n return;\n }\n\n // Handle iterables (arrays, etc.)\n if (isIterable(value)) {\n this._commitIterable(value);\n return;\n }\n\n // Fallback: convert to string\n this._commitText(value);\n }\n\n /**\n * Commit a primitive value as text\n * OPTIMIZATION: Reuses existing text node if previous value was also primitive\n */\n private _commitText(value: any): void {\n // Try to reuse existing text node\n const canReuse =\n this._committedValue !== NOT_COMMITTED &&\n this._committedValue !== nothing &&\n isPrimitive(this._committedValue) &&\n !Array.isArray(this._committedValue);\n\n if (canReuse) {\n const textNode = this.startNode.nextSibling as Text;\n if (textNode && textNode.nodeType === Node.TEXT_NODE) {\n textNode.data = String(value);\n this._committedValue = value;\n return;\n }\n }\n\n const cleanupError = this._clear();\n this._insertBefore(document.createTextNode(String(value)));\n this._committedValue = value;\n if (cleanupError) throw cleanupError;\n }\n\n /**\n * Commit a TemplateResult\n * OPTIMIZATION: Reuses TemplateInstance if same template strings\n */\n private _commitTemplateResult(result: TemplateResult): void {\n // Check if we can reuse the existing TemplateInstance\n const committedInstance = this._committedValue as TemplateInstance;\n\n if (committedInstance instanceof TemplateInstance) {\n // Check if same template by comparing strings reference\n const cachedTemplate = templateCache.get(result.strings);\n if (cachedTemplate && committedInstance.template === cachedTemplate) {\n // SAME TEMPLATE - just update values (efficient path!)\n committedInstance.update(result.values);\n return;\n }\n }\n\n // Different template or first render: prepare and validate the replacement\n // while it is detached. If a binding throws, the currently\n // committed range remains intact and its lifecycle stays connected.\n const instance = new TemplateInstance(result);\n const fragment = instance.renderFragment();\n try {\n instance.update(result.values);\n } catch (error) {\n instance.clear();\n throw error;\n }\n\n const previousValue = this._committedValue;\n const previousKeys = this._itemKeys;\n const previousFragment = this.endNode.ownerDocument.createDocumentFragment();\n let previousNode = this.startNode.nextSibling;\n while (previousNode && previousNode !== this.endNode) {\n const next = previousNode.nextSibling;\n previousFragment.appendChild(previousNode);\n previousNode = next;\n }\n\n this._insertBefore(fragment);\n this._committedValue = instance;\n this._itemKeys = null;\n try {\n if (this.isConnected) instance.reconnected();\n } catch (error) {\n try {\n instance.clear();\n } catch (cleanupError) {\n console.error('snice: failed to clean up a rejected nested template:', cleanupError);\n }\n let node = this.startNode.nextSibling;\n while (node && node !== this.endNode) {\n const next = node.nextSibling;\n node.remove();\n node = next;\n }\n this._insertBefore(previousFragment);\n this._committedValue = previousValue;\n this._itemKeys = previousKeys;\n throw error;\n }\n\n this._disposeCommitted(previousValue);\n }\n\n /**\n * Commit an iterable (array, Set, etc.)\n * OPTIMIZATION: Reuses existing NodeParts for items\n */\n private _commitIterable(value: Iterable<unknown>, explicitKeys?: readonly unknown[]): void {\n const items = Array.isArray(value) ? (value as unknown[]) : Array.from(value);\n const newKeys = explicitKeys ? Array.from(explicitKeys) : items.map(getItemKey);\n if (newKeys.length !== items.length) {\n throw new Error('snice: keyed iterable produced a different number of keys and values.');\n }\n const definedKeys = newKeys.filter(key => key !== undefined);\n if (definedKeys.length > 0 && definedKeys.length !== newKeys.length) {\n console.warn(\n 'snice: a list mixes keyed and unkeyed items. Identity falls back to position; ' +\n 'use repeat(items, { key, render }) for deterministic updates.'\n );\n }\n if (definedKeys.length > 0 && new Set(definedKeys).size !== definedKeys.length) {\n throw new Error('snice: a keyed list contains duplicate keys.');\n }\n\n let cleanupError: unknown;\n // If previous value wasn't an array of parts, start fresh\n if (!Array.isArray(this._committedValue) ||\n !(this._committedValue[0] instanceof NodePart)) {\n cleanupError = this._clear();\n this._committedValue = [];\n this._itemKeys = null;\n }\n const allKeyed = items.length > 0 && newKeys.every(k => k !== undefined);\n const oldKeys = this._itemKeys;\n\n // Keyed reconciliation: when every item carries a key=${...} binding and\n // the key order changed, DOM (and its state) follows the key, not the\n // index. Unchanged key order falls through to the cheap index path.\n if (allKeyed && oldKeys && (this._committedValue as NodePart[]).length > 0) {\n const sameOrder =\n oldKeys.length === newKeys.length &&\n newKeys.every((k, i) => k === oldKeys[i]);\n\n if (!sameOrder) {\n cleanupError ??= this._reconcileKeyed(\n items,\n newKeys,\n this._committedValue as NodePart[],\n oldKeys\n );\n this._itemKeys = newKeys;\n if (cleanupError) throw cleanupError;\n return;\n }\n }\n\n const itemParts = this._committedValue as NodePart[];\n let partIndex = 0;\n\n for (const item of items) {\n let itemPart: NodePart;\n\n if (partIndex >= itemParts.length) {\n // Need new NodePart - create with markers\n const startMarker = document.createComment('');\n const endMarker = document.createComment('');\n this._insertBefore(startMarker);\n this._insertBefore(endMarker);\n itemPart = new NodePart(startMarker, endMarker);\n itemParts.push(itemPart);\n } else {\n // Reuse existing NodePart\n itemPart = itemParts[partIndex];\n }\n\n // Set value on this part (recursively handles templates, text, etc.)\n itemPart.commit(item);\n partIndex++;\n }\n\n // Cleanup excess parts from previous render\n if (partIndex < itemParts.length) {\n // Clear DOM for removed items\n for (let i = partIndex; i < itemParts.length; i++) {\n const part = itemParts[i];\n // Dispose async state as well as removing the content. These item parts\n // are leaving the list permanently, not merely being moved.\n try {\n part.destroy();\n } catch (error) {\n cleanupError ??= error;\n }\n // Remove the markers themselves\n part.startNode.remove();\n part.endNode.remove();\n }\n // Truncate array\n itemParts.length = partIndex;\n }\n\n // Remember keys so the next commit can reconcile by key\n this._itemKeys = allKeyed ? newKeys : null;\n if (cleanupError) throw cleanupError;\n }\n\n /**\n * Reorder/reuse item parts so each key keeps its DOM.\n * Old parts whose keys disappeared are removed; new keys get fresh parts.\n */\n private _reconcileKeyed(\n items: unknown[],\n newKeys: unknown[],\n oldParts: NodePart[],\n oldKeys: unknown[]\n ): unknown {\n const parent = this.endNode.parentNode!;\n let cleanupError: unknown;\n\n // Map old parts by key (first occurrence wins on duplicate keys)\n const oldByKey = new Map<unknown, NodePart>();\n for (let i = 0; i < oldParts.length; i++) {\n if (!oldByKey.has(oldKeys[i])) oldByKey.set(oldKeys[i], oldParts[i]);\n }\n\n // Choose a part for each new item: reuse by key, or create during placement\n const reused = new Set<NodePart>();\n const newParts: (NodePart | null)[] = new Array(items.length).fill(null);\n for (let i = 0; i < items.length; i++) {\n const candidate = oldByKey.get(newKeys[i]);\n if (candidate && !reused.has(candidate)) {\n reused.add(candidate);\n newParts[i] = candidate;\n }\n }\n\n // Remove parts whose keys are gone (before placement, so the DOM walk\n // below only ever sees surviving nodes)\n for (const part of oldParts) {\n if (!reused.has(part)) {\n try {\n part.destroy();\n } catch (error) {\n cleanupError ??= error;\n }\n part.startNode.remove();\n part.endNode.remove();\n }\n }\n\n // Place parts in order. `ref` walks the surviving DOM; a part already\n // sitting at `ref` is skipped, anything else is moved (or created) there.\n let ref: Node = this.startNode.nextSibling!;\n for (let i = 0; i < newParts.length; i++) {\n let part = newParts[i];\n\n if (part) {\n if (part.startNode === ref) {\n // Already in position — advance past its range\n ref = part.endNode.nextSibling!;\n } else {\n // Move the part's whole range [startNode..endNode] before ref.\n // Detach into a fragment first, then insert in one operation —\n // node identity (and any state inside) is preserved either way.\n const range = document.createDocumentFragment();\n let node: Node | null = part.startNode;\n const stop: Node | null = part.endNode.nextSibling;\n while (node && node !== stop) {\n const next: Node | null = node.nextSibling;\n range.appendChild(node);\n node = next;\n }\n parent.insertBefore(range, ref);\n }\n } else {\n // New key — fresh part inserted at the current position\n const startMarker = document.createComment('');\n const endMarker = document.createComment('');\n parent.insertBefore(startMarker, ref);\n parent.insertBefore(endMarker, ref);\n part = new NodePart(startMarker, endMarker);\n newParts[i] = part;\n }\n\n part.commit(items[i]);\n }\n\n this._committedValue = newParts as NodePart[];\n return cleanupError;\n }\n\n /**\n * Commit a DOM node directly\n */\n private _commitNode(node: Node): void {\n if (this._committedValue !== node) {\n const cleanupError = this._clear();\n this._insertBefore(node);\n this._committedValue = node;\n if (cleanupError) throw cleanupError;\n }\n }\n\n /**\n * Commit unsafe HTML string\n */\n private _commitUnsafeHTML(value: UnsafeHTML): void {\n // Can't diff arbitrary HTML, but when the STRING is unchanged the DOM is\n // already correct — skip the clear+reparse so live state (typed input\n // values, focus, scroll) inside the block survives unrelated re-renders.\n const prev = this._committedValue;\n if (isUnsafeHTML(prev) && (prev as UnsafeHTML).html === value.html) {\n return;\n }\n\n const cleanupError = this._clear();\n const temp = document.createElement('template');\n temp.innerHTML = value.html;\n this._insertBefore(temp.content);\n this._committedValue = value;\n if (cleanupError) throw cleanupError;\n }\n\n private _commitAsync(source: PromiseLike<unknown> | AsyncIterable<unknown>): void {\n // A Promise/stream object is the identity of the async operation. Once it\n // settles, unrelated parent renders must keep the committed result rather\n // than clearing it and subscribing to the same source again.\n if (source === this._asyncSource) return;\n this._cancelAsync(false);\n this._asyncSource = source;\n this._asyncStarted = false;\n this._asyncCompleted = false;\n this._asyncPaused = false;\n const cleanupError = this._clear();\n this._committedValue = nothing;\n this._startAsyncSource();\n if (cleanupError) throw cleanupError;\n }\n\n private _startAsyncSource(forceConnected = false): void {\n const source = this._asyncSource;\n if (\n !source || this._asyncRunning || this._asyncCompleted ||\n (!forceConnected && !this.isConnected)\n ) return;\n this._asyncRunning = true;\n this._asyncStarted = true;\n this._asyncPaused = false;\n const version = ++this._asyncVersion;\n\n if (isAsyncIterable(source)) {\n try {\n this._asyncIterator = source[Symbol.asyncIterator]();\n } catch (error) {\n this._asyncRunning = false;\n this._asyncCompleted = true;\n console.error('snice: async iterable template value failed:', error);\n return;\n }\n void (async () => {\n try {\n while (this._asyncIterator) {\n const result = await this._asyncIterator.next();\n if (result.done || version !== this._asyncVersion) break;\n this._commitAsyncValue(result.value);\n }\n } catch (error) {\n if (version === this._asyncVersion) console.error('snice: async iterable template value failed:', error);\n } finally {\n if (version === this._asyncVersion) {\n this._asyncIterator = null;\n this._asyncRunning = false;\n this._asyncCompleted = true;\n }\n }\n })();\n return;\n }\n\n Promise.resolve(source).then(\n value => {\n if (version !== this._asyncVersion) return;\n this._asyncRunning = false;\n this._asyncCompleted = true;\n try {\n this._commitAsyncValue(value);\n } catch (error) {\n console.error('snice: promise template value failed:', error);\n }\n },\n error => {\n if (version !== this._asyncVersion) return;\n this._asyncRunning = false;\n this._asyncCompleted = true;\n console.error('snice: promise template value failed:', error);\n }\n );\n }\n\n private _commitAsyncValue(value: unknown): void {\n this._committingAsyncValue = true;\n try {\n this.commit(value);\n } finally {\n this._committingAsyncValue = false;\n }\n }\n\n private _cancelAsync(clearSource: boolean): void {\n this._asyncVersion++;\n const iterator = this._asyncIterator;\n this._asyncIterator = null;\n this._asyncRunning = false;\n if (clearSource) {\n this._asyncSource = null;\n this._asyncStarted = false;\n this._asyncCompleted = false;\n this._asyncPaused = false;\n }\n if (iterator?.return) {\n try {\n void Promise.resolve(iterator.return()).catch(() => {});\n } catch {\n // Cancellation is best-effort; internal state is already detached.\n }\n }\n }\n\n private _insertBefore(node: Node): void {\n this.endNode.parentNode?.insertBefore(node, this.endNode);\n }\n\n _clear(): unknown {\n const parent = this.startNode.parentNode;\n const committed = this._committedValue;\n let cleanupError: unknown;\n try {\n this._disposeCommitted(committed);\n } catch (error) {\n cleanupError = error;\n }\n if (!parent) {\n this._committedValue = nothing;\n return cleanupError;\n }\n\n let node = this.startNode.nextSibling;\n while (node && node !== this.endNode) {\n const next = node.nextSibling;\n parent.removeChild(node);\n node = next;\n }\n this._committedValue = nothing;\n return cleanupError;\n }\n\n private _disposeCommitted(committed: unknown): void {\n let lifecycleError: unknown;\n if (committed instanceof TemplateInstance) {\n try {\n committed.clear();\n } catch (error) {\n lifecycleError = error;\n }\n } else if (Array.isArray(committed)) {\n for (const item of committed) {\n if (!(item instanceof NodePart)) continue;\n try {\n item.destroy();\n } catch (error) {\n lifecycleError ??= error;\n }\n }\n }\n if (lifecycleError) throw lifecycleError;\n }\n\n clear(): void {\n this._cancelAsync(true);\n const cleanupError = this._clear();\n if (cleanupError) throw cleanupError;\n }\n\n get isConnected(): boolean {\n return this.startNode.isConnected;\n }\n\n disconnected(preserveEventListeners = false): void {\n let lifecycleError: unknown;\n if (this._committedValue instanceof TemplateInstance) {\n try {\n this._committedValue.disconnected(preserveEventListeners);\n } catch (error) {\n lifecycleError ??= error;\n }\n } else if (Array.isArray(this._committedValue)) {\n for (const part of this._committedValue) {\n if (!(part instanceof NodePart)) continue;\n try {\n part.disconnected(preserveEventListeners);\n } catch (error) {\n lifecycleError ??= error;\n }\n }\n }\n if (this._asyncSource && this._asyncRunning) {\n this._cancelAsync(false);\n this._asyncPaused = true;\n }\n if (lifecycleError) throw lifecycleError;\n }\n\n reconnected(): void {\n let lifecycleError: unknown;\n if (this._committedValue instanceof TemplateInstance) {\n try {\n this._committedValue.reconnected();\n } catch (error) {\n lifecycleError ??= error;\n }\n } else if (Array.isArray(this._committedValue)) {\n for (const part of this._committedValue) {\n if (!(part instanceof NodePart)) continue;\n try {\n part.reconnected();\n } catch (error) {\n lifecycleError ??= error;\n }\n }\n }\n if (this._asyncSource && (!this._asyncStarted || this._asyncPaused)) {\n this._startAsyncSource(true);\n }\n if (lifecycleError) throw lifecycleError;\n }\n}\n\n/**\n * AttributePart handles regular attribute updates\n *\n * Supports multiple interpolations: class=\"a ${b} c ${d} e\"\n * Lit-HTML style: tracks each value separately for dirty checking\n */\nexport class AttributePart extends Part {\n readonly type = 'attribute' as const;\n element: Element;\n readonly name: string;\n readonly strings?: readonly string[]; // Static strings for interpolation\n private _committedValue: unknown | unknown[] = NOT_COMMITTED;\n private lastValues: unknown[] | null = null;\n private lastValueIndex = 0;\n\n constructor(element: Element, name: string, strings?: string[]) {\n super();\n this.element = element;\n this.name = name;\n\n // Determine if this is interpolation or single-value binding\n if (strings && (strings.length > 2 || strings[0] !== '' || strings[1] !== '')) {\n // Interpolation case: class=\"foo ${x} bar ${y}\"\n // strings = [\"foo \", \" bar \", \"\"]\n this._committedValue = new Array(strings.length - 1).fill(NOT_COMMITTED);\n this.strings = strings;\n } else {\n // Single-value case: class=\"${x}\"\n this._committedValue = NOT_COMMITTED;\n }\n }\n\n /**\n * Commit value(s) to the attribute\n *\n * For single-value binding: commit(value)\n * For interpolation: commit(values, startIndex) where values is full template values array\n */\n commit(value: unknown, valueIndex: number = 0): void {\n let change = false;\n let finalValue: unknown;\n\n // === SINGLE-VALUE BINDING ===\n if (this.strings === undefined) {\n if (value === noChange) return;\n\n change = !isPrimitive(value) ||\n (value !== this._committedValue && value !== noChange);\n\n if (change) {\n this._committedValue = value;\n finalValue = value;\n } else {\n return; // No change, skip DOM update\n }\n }\n // === INTERPOLATION BINDING ===\n else {\n const values = value as unknown[];\n this.lastValues = [...values];\n this.lastValueIndex = valueIndex;\n const committedValues = this._committedValue as unknown[];\n finalValue = this.strings[0];\n\n for (let i = 0; i < this.strings.length - 1; i++) {\n let v = values[valueIndex + i];\n\n // Handle noChange sentinel\n if (v === noChange) {\n v = committedValues[i];\n // First-ever commit: there is no previous value to keep — resolve\n // to empty. Without this, the NOT_COMMITTED symbol would be\n // string-concatenated below and throw.\n if (v === NOT_COMMITTED) v = '';\n }\n\n // Track if any value changed\n change = change || !isPrimitive(v) || v !== committedValues[i];\n\n // Handle nothing sentinel - removes entire attribute\n if (v === nothing) {\n finalValue = nothing;\n } else if (finalValue !== nothing) {\n finalValue = (finalValue as string) + (v ?? '') + this.strings[i + 1];\n }\n\n // Always record each value for future comparison\n committedValues[i] = v;\n }\n\n if (!change) {\n return; // No change, skip DOM update\n }\n }\n\n // Commit to DOM\n this._commitValue(finalValue);\n }\n\n private _commitValue(value: unknown): void {\n // Only the `nothing` sentinel removes the attribute. null/undefined\n // commit an empty attribute value, consistent with the interpolated\n // path above (which renders them as '').\n if (value === nothing) {\n this.element.removeAttribute(this.name);\n } else {\n this.element.setAttribute(this.name, String(value ?? ''));\n }\n }\n\n clear(): void {\n this.element.removeAttribute(this.name);\n }\n\n}\n\n/**\n * CommentPart renders binding values into an authored HTML comment's text\n * (<!-- debug: ${x} -->). Its real job is index alignment: each binding in a\n * comment consumes one value slot, so bindings after the comment stay bound\n * to their own values.\n */\nexport class CommentPart extends Part {\n readonly type = 'node' as const;\n node: Comment;\n readonly strings: readonly string[];\n private _committedValues: unknown[];\n private lastValues: unknown[] | null = null;\n private lastValueIndex = 0;\n\n constructor(node: Comment, strings: readonly string[]) {\n super();\n this.node = node;\n this.strings = strings;\n this._committedValues = new Array(strings.length - 1).fill(NOT_COMMITTED);\n }\n\n /**\n * Commit values into the comment text.\n * commit(values, startIndex) — like interpolated AttributePart, this part\n * consumes (strings.length - 1) values from the template values array.\n */\n commit(values: unknown, startIndex: number = 0): void {\n const vals = values as unknown[];\n this.lastValues = [...vals];\n this.lastValueIndex = startIndex;\n let change = false;\n let text = this.strings[0];\n\n for (let i = 0; i < this.strings.length - 1; i++) {\n let v = vals[startIndex + i];\n\n if (v === noChange) {\n v = this._committedValues[i];\n if (v === NOT_COMMITTED) v = '';\n }\n\n change = change || !isPrimitive(v) || v !== this._committedValues[i];\n this._committedValues[i] = v;\n\n text += String(v === nothing ? '' : (v ?? '')) + this.strings[i + 1];\n }\n\n if (change) {\n if (text.includes('--') || text.endsWith('-')) {\n throw new Error('snice: comment expressions cannot produce \"--\" or end with \"-\".');\n }\n this.node.data = text;\n }\n }\n\n clear(): void {}\n\n}\n\n/** Toggle one class without rebuilding the element's full class string. */\nexport class ClassPart extends Part {\n readonly type = 'class' as const;\n element: Element;\n readonly name: string;\n private committed: unknown = NOT_COMMITTED;\n\n constructor(element: Element, name: string) {\n super();\n this.element = element;\n this.name = name;\n }\n\n commit(value: unknown): void {\n if (value === noChange) return;\n const enabled = value !== nothing && Boolean(value);\n if (enabled === this.committed) return;\n this.committed = enabled;\n this.element.classList.toggle(this.name, enabled);\n }\n\n clear(): void {\n this.element.classList.remove(this.name);\n this.committed = NOT_COMMITTED;\n }\n\n}\n\n/** Set one CSS property, including custom properties, declaratively. */\nexport class StylePart extends Part {\n readonly type = 'style' as const;\n element: Element;\n readonly name: string;\n private committed: unknown = NOT_COMMITTED;\n\n constructor(element: Element, name: string) {\n super();\n this.element = element;\n this.name = name;\n }\n\n commit(value: unknown): void {\n if (value === noChange || Object.is(value, this.committed)) return;\n this.committed = value;\n const style = (this.element as HTMLElement).style;\n if (value === nothing || value == null || value === false) {\n style.removeProperty(this.name);\n } else {\n style.setProperty(this.name, String(value));\n }\n }\n\n clear(): void {\n (this.element as HTMLElement).style.removeProperty(this.name);\n this.committed = NOT_COMMITTED;\n }\n\n}\n\ntype SpreadListener = {\n value: unknown;\n listener: EventListener;\n options?: AddEventListenerOptions;\n};\n\nfunction validateSpreadEvents(next: Record<string, unknown>, label: string): void {\n const names = new Set<string>();\n for (const [rawName, value] of Object.entries(next)) {\n const name = rawName.startsWith('@') ? rawName.slice(1) : rawName;\n if (!name) throw new TypeError(`snice: ${label} contains an empty event name.`);\n if (names.has(name)) {\n throw new TypeError(`snice: ${label} contains duplicate event name \"${name}\".`);\n }\n names.add(name);\n const listenerObject = !!value && typeof value === 'object' &&\n typeof (value as EventListenerObject).handleEvent === 'function';\n if (\n value !== nothing && value != null && value !== false &&\n typeof value !== 'function' && !listenerObject\n ) {\n throw new TypeError(`snice: ${label} event \"${name}\" expects a function, EventListenerObject, or null.`);\n }\n }\n}\n\n/** Named spreads: ...props, ...attrs, and ...events. */\nexport class SpreadPart extends Part {\n readonly type = 'spread' as const;\n element: Element;\n readonly name: string;\n private committed: Record<string, unknown> = {};\n private listeners = new Map<string, SpreadListener>();\n private consumedOnce = new Map<string, unknown>();\n\n constructor(element: Element, name: string) {\n super();\n this.element = element;\n this.name = name;\n }\n\n commit(value: unknown): void {\n if (value === noChange) return;\n if (value === nothing || value == null) value = {};\n if (typeof value !== 'object' || Array.isArray(value)) {\n throw new TypeError(`snice: ...${this.name} expects an object.`);\n }\n const next = value as Record<string, unknown>;\n if (this.name === 'events') this.commitEvents(next);\n else if (this.name === 'props' || this.name === 'properties') this.commitProperties(next);\n else this.commitAttributes(next);\n this.committed = { ...next };\n }\n\n private commitProperties(next: Record<string, unknown>): void {\n for (const key of Object.keys(this.committed)) {\n if (!Object.prototype.hasOwnProperty.call(next, key)) {\n markPreUpgradePropertyBinding(this.element, key);\n (this.element as any)[key] = undefined;\n }\n }\n for (const [key, value] of Object.entries(next)) {\n if (Object.is(this.committed[key], value)) continue;\n markPreUpgradePropertyBinding(this.element, key);\n (this.element as any)[key] = value === nothing ? undefined : value;\n }\n }\n\n private commitAttributes(next: Record<string, unknown>): void {\n for (const key of Object.keys(this.committed)) {\n if (!Object.prototype.hasOwnProperty.call(next, key)) this.element.removeAttribute(key);\n }\n for (const [key, value] of Object.entries(next)) {\n if (Object.is(this.committed[key], value)) continue;\n if (value === nothing || value == null || value === false) this.element.removeAttribute(key);\n else this.element.setAttribute(key, value === true ? '' : String(value));\n }\n }\n\n private commitEvents(next: Record<string, unknown>): void {\n validateSpreadEvents(next, `...${this.name}`);\n for (const [name, value] of this.consumedOnce) {\n const rawName = Object.keys(next).find(key => this.eventName(key) === name);\n if (!rawName || !Object.is(next[rawName], value)) this.consumedOnce.delete(name);\n }\n for (const [name, entry] of this.listeners) {\n const rawName = Object.keys(next).find(key => this.eventName(key) === name);\n if (rawName && Object.is(next[rawName], entry.value)) continue;\n this.element.removeEventListener(name, entry.listener, entry.options);\n this.listeners.delete(name);\n }\n\n for (const [rawName, value] of Object.entries(next)) {\n const name = this.eventName(rawName);\n if (this.listeners.has(name)) continue;\n const listenerObject = !!value && typeof value === 'object' &&\n typeof (value as EventListenerObject).handleEvent === 'function';\n if (value === nothing || value == null || value === false) continue;\n if (this.consumedOnce.has(name) && Object.is(this.consumedOnce.get(name), value)) continue;\n this.consumedOnce.delete(name);\n const options = listenerObject ? value as AddEventListenerOptions : undefined;\n const listener = ((event: Event) => {\n if (options?.once) this.consumedOnce.set(name, value);\n if (listenerObject) (value as EventListenerObject).handleEvent(event);\n else (value as EventListener).call(this.resolveHost(), event);\n }) as EventListener;\n this.element.addEventListener(name, listener, options);\n this.listeners.set(name, { value, listener, options });\n }\n }\n\n private eventName(name: string): string {\n return name.startsWith('@') ? name.slice(1) : name;\n }\n\n private resolveHost(): Element | null {\n return findRenderHost(this.element) || this.element;\n }\n\n clear(): void {\n if (this.name === 'events') {\n for (const [name, entry] of this.listeners) {\n this.element.removeEventListener(name, entry.listener, entry.options);\n }\n this.listeners.clear();\n this.consumedOnce.clear();\n } else if (this.name !== 'props' && this.name !== 'properties') {\n for (const key of Object.keys(this.committed)) this.element.removeAttribute(key);\n }\n // A property spread is being destroyed with the element that owns it.\n // Resetting native/custom properties here is unnecessary and can throw for\n // setters that reject undefined (textarea.value is a common example).\n // Stale keys are still removed during an ordinary live spread update.\n this.committed = {};\n }\n\n disconnected(preserveEventListeners = false): void {\n if (this.name === 'events' && !preserveEventListeners) this.detachListeners();\n }\n\n reconnected(): void {\n if (this.name === 'events' && this.listeners.size === 0) this.commitEvents(this.committed);\n }\n\n private detachListeners(): void {\n for (const [name, entry] of this.listeners) {\n this.element.removeEventListener(name, entry.listener, entry.options);\n }\n this.listeners.clear();\n }\n\n}\n\n/**\n * PropertyPart handles property bindings (.property=${value})\n */\nexport class PropertyPart extends Part {\n readonly type = 'property' as const;\n element: Element;\n readonly name: string;\n private _committedValue: unknown = NOT_COMMITTED;\n\n constructor(element: Element, name: string) {\n super();\n this.element = element;\n this.name = name;\n }\n\n commit(value: unknown): void {\n if (value === noChange) return;\n\n // live(): compare against the element's actual DOM property, so state\n // the user changed (typed text, toggled checkbox) is reset even when the\n // bound value itself is unchanged.\n if (isLive(value)) {\n value = value.value;\n if (value === noChange) return;\n const domValue = (this.element as any)[this.name];\n if (value === domValue) {\n this._committedValue = value;\n return;\n }\n } else {\n // Dirty check - skip if same value\n if (value === this._committedValue) return;\n }\n\n this._committedValue = value;\n markPreUpgradePropertyBinding(this.element, this.name);\n (this.element as any)[this.name] = value === nothing ? undefined : value;\n }\n\n clear(): void {\n // This part is being destroyed with its owning template. The element is\n // about to leave the tree, so writing `undefined` is both unnecessary and\n // unsafe for native setters such as HTMLTextAreaElement.value.\n this._committedValue = NOT_COMMITTED;\n }\n\n}\n\n/**\n * ControllerPart handles bare controller=${...} bindings.\n *\n * Accepts a controller class decorated with @controller (attached directly,\n * no registry lookup) or a registry name string (delegated to the attribute\n * channel with the exact semantics of a static controller=\"name\"). While a\n * class is bound it owns the element: the decorator name is reflected for\n * inspection, while the attribute/MutationObserver attach channel stays inert.\n *\n * Renders commit while the tree is detached and connect afterwards, so\n * attachment happens on reconnected()/connected commits; every hook is\n * idempotent because the update loop reconciles connection state on each pass.\n */\nexport class ControllerPart extends Part {\n readonly type = 'controller' as const;\n element: Element;\n private _committedValue: unknown = NOT_COMMITTED;\n\n constructor(element: Element) {\n super();\n this.element = element;\n }\n\n commit(value: unknown): void {\n if (value === noChange) return;\n\n // Normalize every \"no controller\" shape to null\n const next = (value == null || value === false || value === '' || value === nothing)\n ? null\n : value;\n const first = this._committedValue === NOT_COMMITTED;\n const previous = first ? null : this._committedValue;\n if (!first && next === previous) return;\n this._committedValue = next;\n\n const el = this.element as any;\n\n // Leaving a class binding: release the element back to the attribute channel.\n if (typeof previous === 'function' && typeof next !== 'function') {\n if (el[PENDING_CONTROLLER_BINDING] !== undefined) {\n delete el[PENDING_CONTROLLER_BINDING];\n } else if (el[IS_ELEMENT_CLASS]) {\n el.controller = null;\n } else {\n this._detach();\n }\n }\n\n if (typeof next === 'function') {\n if (this.isConnected) {\n this._apply(next);\n } else if (this.element.localName.includes('-') && !el[IS_ELEMENT_CLASS]) {\n // Park on not-yet-upgraded custom elements even while detached — the\n // element picks the class up in connectedCallback on upgrade.\n el[PENDING_CONTROLLER_BINDING] = next;\n }\n // Detached native/upgraded elements attach in reconnected().\n } else if (typeof next === 'string') {\n this.element.setAttribute('controller', next);\n } else if (typeof previous === 'string') {\n this.element.removeAttribute('controller');\n }\n }\n\n /** Drive the element toward the committed class. Idempotent. */\n private _apply(controllerClass: any): void {\n const el = this.element as any;\n\n if (el[IS_ELEMENT_CLASS]) {\n if (el.controller !== controllerClass) {\n // Setter handles detach of the old controller and attach of the new.\n el.controller = controllerClass;\n } else {\n // Same value: the setter would no-op, but the element may have\n // self-detached on disconnect. attachController dedupes when the\n // controller is still attached.\n this._attach(controllerClass);\n }\n return;\n }\n\n if (this.element.localName.includes('-')) {\n // Custom element that hasn't upgraded yet (defined later, or cloned\n // into a detached fragment). Park the class — connectedCallback picks\n // it up on upgrade. Assigning the property now would shadow the future\n // prototype accessor with an own expando property.\n el[PENDING_CONTROLLER_BINDING] = controllerClass;\n return;\n }\n\n // Native element — attach directly. Mirror the observer path's ready shim.\n if (!el.ready) el.ready = Promise.resolve();\n this._attach(controllerClass);\n }\n\n private _attach(controllerClass: any): void {\n attachController(this.element as HTMLElement, controllerClass).catch((error: any) => {\n if (error?.name === 'ControllerAttachAborted') return;\n console.error(\n `Failed to attach controller \"${controllerClass?.name || controllerClass}\":`,\n error\n );\n });\n }\n\n private _detach(): void {\n detachController(this.element as HTMLElement).catch((error: any) => {\n console.error('Failed to detach controller:', error);\n });\n }\n\n disconnected(_preserveEventListeners = false): void {\n const committed = this._committedValue;\n if (typeof committed !== 'function') return;\n const el = this.element as any;\n if (el[PENDING_CONTROLLER_BINDING] !== undefined) return; // never attached\n if (el[IS_ELEMENT_CLASS]) return; // snice elements detach themselves on disconnect\n this._detach();\n }\n\n reconnected(): void {\n const committed = this._committedValue;\n if (typeof committed !== 'function') return;\n this._apply(committed);\n }\n\n clear(): void {\n const el = this.element as any;\n if (el[PENDING_CONTROLLER_BINDING] !== undefined) delete el[PENDING_CONTROLLER_BINDING];\n const committed = this._committedValue;\n this._committedValue = NOT_COMMITTED;\n if (typeof committed !== 'function') return;\n if (el[IS_ELEMENT_CLASS]) return; // the element's own teardown detaches\n this._detach();\n }\n\n}\n\n/**\n * BooleanAttributePart handles boolean attributes (?attribute=${value})\n */\nexport class BooleanAttributePart extends Part {\n readonly type = 'boolean-attribute' as const;\n element: Element;\n readonly name: string;\n private _committedValue: unknown = NOT_COMMITTED;\n\n constructor(element: Element, name: string) {\n super();\n this.element = element;\n this.name = name;\n }\n\n commit(value: unknown): void {\n if (value === noChange) return;\n\n // Coerce to boolean\n const boolValue = !!value && value !== nothing;\n\n // Dirty check - skip if same boolean value\n if (boolValue === this._committedValue) return;\n\n this._committedValue = boolValue;\n\n if (boolValue) {\n this.element.setAttribute(this.name, '');\n } else {\n this.element.removeAttribute(this.name);\n }\n }\n\n clear(): void {\n this.element.removeAttribute(this.name);\n this._committedValue = NOT_COMMITTED;\n }\n\n}\n\n/**\n * EventPart handles event listener bindings with keyboard shortcut support\n */\nexport class EventPart extends Part {\n readonly type = 'event' as const;\n element: Element;\n readonly eventName: string;\n private listener: EventListener | null = null;\n private listenerOptions: AddEventListenerOptions | undefined = undefined;\n private value: any = undefined;\n private keyFilter: KeyboardFilter | null = null;\n private host: Element | null = null; // Cache host element\n private modifiers = new Set<string>();\n private once = false;\n private onceConsumed = false;\n\n constructor(element: Element, eventName: string) {\n super();\n this.element = element;\n\n const [eventSpec, ...modifierSpecs] = eventName.split('|');\n const aliases: Record<string, string> = {\n preventdefault: 'prevent',\n stoppropagation: 'stop',\n stopimmediatepropagation: 'immediate'\n };\n const allowed = new Set(['prevent', 'stop', 'immediate', 'once', 'capture', 'passive', 'self']);\n for (const raw of modifierSpecs) {\n const normalized = aliases[raw.toLowerCase()] || raw.toLowerCase();\n if (!allowed.has(normalized)) {\n throw new Error(\n `snice: unknown event modifier \"${raw}\" in @${eventName}. ` +\n 'Supported modifiers: prevent, stop, immediate, once, capture, passive, self.'\n );\n }\n this.modifiers.add(normalized);\n }\n if (this.modifiers.has('passive') && this.modifiers.has('prevent')) {\n throw new Error(`snice: @${eventName} cannot combine passive and prevent.`);\n }\n\n // Parse keyboard shortcuts:\n // Supports both dot notation (@keydown.enter) and colon notation (@keydown:Enter) to match @on decorator\n // Only parse colons for keyboard events, not custom events\n const isKeyboardEvent = ['keydown', 'keyup', 'keypress'].includes(eventSpec.split('.')[0].split(':')[0]);\n // Only keyboard events split on `.`/`:` into a key filter — a custom event\n // name may legitimately contain a dot (e.g. `app.ready`) and must be kept whole.\n const dotIndex = isKeyboardEvent ? eventSpec.indexOf('.') : -1;\n const colonIndex = isKeyboardEvent ? eventSpec.indexOf(':') : -1;\n\n // Use whichever delimiter comes first (dot or colon)\n const delimiterIndex = dotIndex > 0 && colonIndex > 0\n ? Math.min(dotIndex, colonIndex)\n : Math.max(dotIndex, colonIndex);\n\n if (delimiterIndex > 0) {\n const baseEvent = eventSpec.substring(0, delimiterIndex);\n const keySpec = eventSpec.substring(delimiterIndex + 1);\n this.eventName = baseEvent;\n this.keyFilter = parseKeyboardFilter(keySpec);\n } else {\n this.eventName = eventSpec;\n warnIfModifierMisuse(eventSpec);\n }\n }\n\n commit(value: any): void {\n // Handle noChange sentinel\n if (value === noChange) return;\n\n // Handle nothing sentinel - remove listener\n if (value === nothing) {\n value = null;\n }\n\n const isListenerObject = !!value &&\n typeof value === 'object' &&\n typeof (value as EventListenerObject).handleEvent === 'function';\n if (\n value !== null && value !== undefined && value !== false &&\n typeof value !== 'function' && !isListenerObject\n ) {\n throw new TypeError(`snice: @${this.eventName} expects a function, EventListenerObject, or null.`);\n }\n if (isListenerObject && this.modifiers.has('prevent') && !!(value as AddEventListenerOptions).passive) {\n throw new Error(`snice: @${this.eventName} cannot combine a passive listener object with prevent.`);\n }\n\n // Skip if same value (but null/undefined always triggers update for cleanup)\n if (value === this.value && value !== null && value !== undefined) return;\n\n // Remove old listener (with the same capture option it was added with)\n if (this.listener) {\n this.element.removeEventListener(this.eventName, this.listener, this.listenerOptions);\n this.listener = null;\n this.listenerOptions = undefined;\n }\n\n // Add new listener\n if (value === null || value === undefined || value === false) {\n this.value = value;\n this.onceConsumed = false;\n return;\n }\n\n this.onceConsumed = false;\n try {\n this.attachListener(value, isListenerObject);\n this.value = value;\n } catch (error) {\n this.value = undefined;\n throw error;\n }\n }\n\n private attachListener(value: EventListener | (EventListenerObject & AddEventListenerOptions), isListenerObject: boolean): void {\n // Accept plain functions AND EventListenerObject ({ handleEvent }). For\n // listener objects, the object itself doubles as the options bag.\n\n const keyFilter = this.keyFilter;\n const listener = ((event: Event) => {\n if (this.modifiers.has('self') && event.target !== this.element) return;\n if (keyFilter && !matchesKeyboardFilter(event as KeyboardEvent, keyFilter)) return;\n if (this.once) {\n this.onceConsumed = true;\n this.element.removeEventListener(this.eventName, listener, listenerOptions);\n this.listener = null;\n this.listenerOptions = undefined;\n }\n if (this.modifiers.has('prevent')) event.preventDefault();\n if (this.modifiers.has('immediate')) event.stopImmediatePropagation();\n else if (this.modifiers.has('stop')) event.stopPropagation();\n if (isListenerObject) {\n // DOM spec: `this` inside handleEvent is the listener object itself\n (value as EventListenerObject).handleEvent(event);\n return;\n }\n // Resolve the host (the custom element owning the shadow root) at dispatch\n // time, not bind time: a binding inside an initially-hidden <if>/<case>\n // branch commits while off-DOM, where getRootNode() has no host — caching\n // that null permanently would call the handler with `this = null` once the\n // branch is shown. By the time an event fires, the element is in the DOM.\n if (!this.host) {\n this.host = findRenderHost(this.element);\n }\n (value as EventListener).call(this.host || this.element, event);\n }) as EventListener;\n\n const valueOptions = isListenerObject ? value as AddEventListenerOptions : {};\n this.once = this.modifiers.has('once') || !!valueOptions.once;\n const listenerOptions: AddEventListenerOptions = {\n capture: this.modifiers.has('capture') || valueOptions.capture,\n passive: this.modifiers.has('passive') || valueOptions.passive,\n signal: valueOptions.signal\n };\n this.element.addEventListener(this.eventName, listener, listenerOptions);\n this.listener = listener;\n this.listenerOptions = listenerOptions;\n }\n\n clear(): void {\n this.detachListener();\n this.value = undefined;\n this.host = null;\n this.onceConsumed = false;\n }\n\n private detachListener(): void {\n if (this.listener) {\n this.element.removeEventListener(this.eventName, this.listener, this.listenerOptions);\n this.listener = null;\n this.listenerOptions = undefined;\n }\n }\n\n disconnected(preserveEventListeners = false): void {\n if (!preserveEventListeners) this.detachListener();\n this.host = null;\n }\n\n reconnected(): void {\n if (!this.listener && !this.onceConsumed && this.value != null && this.value !== false) {\n const isListenerObject = typeof this.value === 'object';\n this.attachListener(this.value, isListenerObject);\n }\n }\n\n}\n\n/**\n * ConditionalIfPart handles <if> conditional rendering\n * Removes/inserts DOM nodes based on condition\n */\n// Sentinel value to distinguish \"not yet set\" from undefined\nconst NOT_SET = Symbol('not-set');\n\nexport class ConditionalIfPart extends Part {\n readonly type = 'node' as const;\n private startNode: Comment;\n private endNode: Comment;\n private conditions: unknown[] = [NOT_SET];\n private branches: DocumentFragment[] = [];\n private defaultBranch = -1;\n private currentBranch = -1;\n\n constructor(ifElement: Element) {\n super();\n const parent = ifElement.parentNode!;\n\n // Create comment boundary markers\n this.startNode = document.createComment('if');\n this.endNode = document.createComment('/if');\n\n // Insert markers where <if> is\n parent.insertBefore(this.startNode, ifElement);\n parent.insertBefore(this.endNode, ifElement.nextSibling);\n\n const primary = document.createDocumentFragment();\n this.branches.push(primary);\n let sawAlternative = false;\n let lastBranch = primary;\n\n for (const child of Array.from(ifElement.childNodes)) {\n const tag = child.nodeType === Node.ELEMENT_NODE\n ? (child as Element).tagName.toLowerCase()\n : '';\n\n if (tag === 'else-if' || tag === 'else') {\n sawAlternative = true;\n const wrapper = child as Element;\n const fragment = document.createDocumentFragment();\n while (wrapper.firstChild) fragment.appendChild(wrapper.firstChild);\n const index = this.branches.push(fragment) - 1;\n lastBranch = fragment;\n\n if (tag === 'else-if') {\n if (this.defaultBranch !== -1) {\n throw new Error('snice: <else> must be the final branch inside <if>.');\n }\n this.conditions[index] = NOT_SET;\n conditionalElseIfOwners.set(wrapper, { coordinator: this, index });\n } else {\n if (this.defaultBranch !== -1) {\n throw new Error('snice: <if> may contain only one <else> branch.');\n }\n this.defaultBranch = index;\n }\n wrapper.remove();\n continue;\n }\n\n if (!sawAlternative) {\n primary.appendChild(child);\n } else if (child.nodeType === Node.TEXT_NODE && !child.textContent?.trim()) {\n child.remove();\n } else {\n lastBranch.appendChild(child);\n }\n }\n\n parent.removeChild(ifElement);\n }\n\n commit(value: any): void {\n if (value !== noChange) this.conditions[0] = value;\n }\n\n setAlternative(index: number, value: unknown): void {\n if (value !== noChange) this.conditions[index] = value;\n }\n\n flush(): void {\n let next = -1;\n for (let i = 0; i < this.conditions.length; i++) {\n if (\n this.conditions[i] !== NOT_SET &&\n this.conditions[i] !== nothing &&\n Boolean(this.conditions[i])\n ) {\n next = i;\n break;\n }\n }\n if (next === -1) next = this.defaultBranch;\n if (next === this.currentBranch) return;\n\n this.collectCurrent();\n this.currentBranch = next;\n if (next !== -1 && this.branches[next].hasChildNodes()) {\n this.startNode.parentNode?.insertBefore(this.branches[next], this.endNode);\n }\n }\n\n private collectCurrent(): void {\n if (this.currentBranch === -1) return;\n const fragment = this.branches[this.currentBranch];\n let node = this.startNode.nextSibling;\n while (node && node !== this.endNode) {\n const next = node.nextSibling;\n fragment.appendChild(node);\n node = next;\n }\n }\n\n clear(): void {\n this.collectCurrent();\n this.currentBranch = -1;\n }\n\n get isConnected(): boolean {\n return this.startNode.isConnected;\n }\n}\n\nconst conditionalElseIfOwners = new WeakMap<Element, {\n coordinator: ConditionalIfPart;\n index: number;\n}>();\n\nexport class ConditionalElseIfPart extends Part {\n readonly type = 'node' as const;\n readonly coordinator: ConditionalIfPart;\n private readonly index: number;\n\n constructor(element: Element) {\n super();\n const owner = conditionalElseIfOwners.get(element);\n if (!owner) throw new Error('snice: <else-if> must be a direct child of <if>.');\n this.coordinator = owner.coordinator;\n this.index = owner.index;\n }\n\n commit(value: unknown): void {\n this.coordinator.setAlternative(this.index, value);\n }\n\n clear(): void {}\n\n get isConnected(): boolean {\n return this.coordinator.isConnected;\n }\n}\n\n/**\n * ConditionalCasePart handles <case>/<when>/<default> conditional rendering\n * Removes/inserts matching branch based on value\n */\nexport class ConditionalCasePart extends Part {\n readonly type = 'node' as const;\n private startNode: Comment;\n private endNode: Comment;\n private value: any = NOT_SET;\n private branches: Array<{\n fragment: DocumentFragment;\n dynamic: boolean;\n expected: unknown;\n }> = [];\n private defaultBranch = -1;\n private currentBranch = -1;\n\n constructor(caseElement: Element, dynamicWhenElements: ReadonlySet<Element>) {\n super();\n const parent = caseElement.parentNode!;\n\n // Create comment boundary markers\n this.startNode = document.createComment('case');\n this.endNode = document.createComment('/case');\n\n // Insert markers where <case> is\n parent.insertBefore(this.startNode, caseElement);\n parent.insertBefore(this.endNode, caseElement.nextSibling);\n\n // Extract branches from <when> and <default> children\n for (const child of Array.from(caseElement.children)) {\n const childTag = child.tagName.toLowerCase();\n if (childTag === 'when') {\n const fragment = document.createDocumentFragment();\n while (child.firstChild) {\n fragment.appendChild(child.firstChild);\n }\n const dynamic = dynamicWhenElements.has(child);\n const index = this.branches.push({\n fragment,\n dynamic,\n expected: dynamic ? NOT_SET : (child.getAttribute('value') ?? '')\n }) - 1;\n if (dynamic) conditionalWhenOwners.set(child, { coordinator: this, index });\n } else if (childTag === 'default') {\n if (this.defaultBranch !== -1) {\n throw new Error('snice: <case> may contain only one <default> branch.');\n }\n const fragment = document.createDocumentFragment();\n while (child.firstChild) {\n fragment.appendChild(child.firstChild);\n }\n this.defaultBranch = this.branches.push({\n fragment,\n dynamic: false,\n expected: NOT_SET\n }) - 1;\n }\n }\n\n // Remove the <case> element from DOM\n parent.removeChild(caseElement);\n }\n\n commit(value: any): void {\n if (value !== noChange) this.value = value;\n }\n\n setExpected(index: number, value: unknown): void {\n if (value !== noChange) this.branches[index].expected = value;\n }\n\n flush(): void {\n let next = this.branches.findIndex((branch, index) => {\n if (index === this.defaultBranch) return false;\n return branch.dynamic\n ? Object.is(this.value, branch.expected)\n : String(this.value) === branch.expected;\n });\n if (next === -1) next = this.defaultBranch;\n if (next === this.currentBranch) return;\n\n this.collectCurrent();\n this.currentBranch = next;\n if (next !== -1 && this.branches[next].fragment.hasChildNodes()) {\n this.startNode.parentNode?.insertBefore(this.branches[next].fragment, this.endNode);\n }\n }\n\n private collectCurrent(): void {\n if (this.currentBranch === -1) return;\n const fragment = this.branches[this.currentBranch].fragment;\n\n let node = this.startNode.nextSibling;\n while (node && node !== this.endNode) {\n const next = node.nextSibling;\n fragment.appendChild(node);\n node = next;\n }\n }\n\n clear(): void {\n this.collectCurrent();\n this.currentBranch = -1;\n }\n\n get isConnected(): boolean {\n return this.startNode.isConnected;\n }\n}\n\nconst conditionalWhenOwners = new WeakMap<Element, {\n coordinator: ConditionalCasePart;\n index: number;\n}>();\n\nexport class ConditionalWhenPart extends Part {\n readonly type = 'node' as const;\n readonly coordinator: ConditionalCasePart;\n private readonly index: number;\n\n constructor(element: Element) {\n super();\n const owner = conditionalWhenOwners.get(element);\n if (!owner) throw new Error('snice: dynamic <when> must be a direct child of <case>.');\n this.coordinator = owner.coordinator;\n this.index = owner.index;\n }\n\n commit(value: unknown): void {\n this.coordinator.setExpected(this.index, value);\n }\n\n clear(): void {}\n\n get isConnected(): boolean {\n return this.coordinator.isConnected;\n }\n}\n","import { getRenderRoot, type SniceRenderRoot } from './render-root';\n\nconst scheduledHosts = new WeakSet<HTMLElement>();\nconst processedCandidates = new WeakSet<Element>();\n\nconst focusableSelector = [\n 'a[href]',\n 'area[href]',\n 'button:not([disabled])',\n 'input:not([disabled]):not([type=\"hidden\"])',\n 'select:not([disabled])',\n 'textarea:not([disabled])',\n 'iframe',\n 'object',\n 'embed',\n 'summary',\n 'audio[controls]',\n 'video[controls]',\n '[contenteditable]:not([contenteditable=\"false\"])',\n '[tabindex]:not([tabindex=\"-1\"])'\n].join(',');\n\nfunction hasMeaningfulFocus(document: Document): boolean {\n const active = document.activeElement;\n return Boolean(active && active !== document.body && active !== document.documentElement);\n}\n\nfunction isFocused(target: HTMLElement): boolean {\n const root = target.getRootNode() as Document | ShadowRoot;\n const active = root.activeElement;\n return active === target || Boolean(active && target.contains(active));\n}\n\nfunction tryFocus(target: HTMLElement): boolean {\n try {\n target.focus();\n } catch {\n return false;\n }\n return isFocused(target);\n}\n\nfunction explicitCandidates(root: SniceRenderRoot | null): HTMLElement[] {\n if (!root) return [];\n return Array.from(root.querySelectorAll<HTMLElement>('[autofocus]'))\n .filter(candidate => !processedCandidates.has(candidate));\n}\n\nfunction fallbackCandidates(root: SniceRenderRoot | null): HTMLElement[] {\n if (!root) return [];\n return Array.from(root.querySelectorAll<HTMLElement>(focusableSelector));\n}\n\nfunction hasCandidate(host: HTMLElement): boolean {\n if (host.hasAttribute('autofocus') && !processedCandidates.has(host)) return true;\n return explicitCandidates(getRenderRoot(host)).length > 0;\n}\n\n/**\n * Complete native autofocus processing after a Snice element becomes usable.\n * Browsers do not consistently revisit late-upgraded hosts or autofocus\n * controls inserted into Shadow DOM, so Snice supplies that missing pass.\n */\nexport function applyAutofocus(host: HTMLElement): void {\n if (!host.isConnected) return;\n\n const root = getRenderRoot(host);\n const candidates: HTMLElement[] = [];\n if (host.hasAttribute('autofocus') && !processedCandidates.has(host)) candidates.push(host);\n candidates.push(...explicitCandidates(root));\n if (candidates.length === 0) return;\n\n // Match native first-wins behavior and preserve focus deliberately\n // established by application code or an earlier autofocus candidate.\n if (hasMeaningfulFocus(host.ownerDocument)) {\n for (const candidate of candidates) processedCandidates.add(candidate);\n return;\n }\n\n for (const candidate of candidates) {\n processedCandidates.add(candidate);\n if (tryFocus(candidate)) return;\n\n // A decorated custom-element host is not necessarily a focusable area.\n // If its public focus() has no effect, use its first native focus target\n // without adding tabindex or changing the host's accessibility semantics.\n if (candidate === host) {\n for (const fallback of fallbackCandidates(root)) {\n if (tryFocus(fallback)) return;\n }\n }\n }\n}\n\n/** Schedule one post-ready, post-paint autofocus pass for a Snice host. */\nexport function scheduleAutofocus(host: HTMLElement): void {\n if (scheduledHosts.has(host) || !hasCandidate(host)) return;\n scheduledHosts.add(host);\n\n const run = () => {\n const view = host.ownerDocument.defaultView;\n const apply = () => {\n scheduledHosts.delete(host);\n applyAutofocus(host);\n };\n if (view?.requestAnimationFrame) view.requestAnimationFrame(apply);\n else queueMicrotask(apply);\n };\n\n const ready = (host as any).ready as Promise<unknown> | undefined;\n Promise.resolve(ready).then(run, run);\n}\n\n/** Allow an explicitly removed/re-added host autofocus attribute to run again. */\nexport function resetHostAutofocus(host: HTMLElement): void {\n processedCandidates.delete(host);\n}\n","/**\n * @render and @styles decorators for Snice v3.0.0\n * Provides automatic differential rendering on property changes\n */\n\nimport { TemplateResult, CSSResult, isTemplateResult, isCSSResult } from './template';\nimport { TemplateInstance } from './parts';\nimport { RENDER_METHOD, RENDER_OPTIONS, RENDER_INSTANCE, RENDER_TIMERS, RENDER_CALLBACKS, STYLES_METHOD, STYLES_APPLIED, PARENT_STYLES_METHODS, PENDING_RECONNECT_RENDER, RENDER_DEPTH, RENDERED_PROMISE, RENDERED_RESOLVE } from './symbols';\nimport { ensureRenderRoot } from './render-root';\nimport { scheduleAutofocus } from './autofocus';\n\n/**\n * When true, render errors are rethrown instead of logged, so tests and dev\n * environments fail loudly rather than leaving the element silently stale.\n * Production default is false (log and keep the previous DOM).\n */\nlet strictRenderErrors = false;\n\nfunction contextualizeRenderError(element: HTMLElement, error: unknown): unknown {\n const tag = element.tagName?.toLowerCase() || 'element';\n const message = error instanceof Error ? error.message : String(error);\n const contextual = new Error(`snice: render failed for <${tag}>: ${message}`, {\n cause: error\n });\n if (error instanceof Error) contextual.name = error.name;\n return contextual;\n}\n\nexport function setStrictRenderErrors(value: boolean): void {\n strictRenderErrors = value;\n}\n\n/**\n * Ensure the element has a pending `rendered` promise. Called whenever a\n * render is requested; resolved by performRender once the render commits.\n */\nfunction ensureRenderedPromise(element: HTMLElement): void {\n if (!(element as any)[RENDERED_RESOLVE]) {\n (element as any)[RENDERED_PROMISE] = new Promise<void>((resolve) => {\n (element as any)[RENDERED_RESOLVE] = resolve;\n });\n }\n}\n\n/** Resolve the element's pending `rendered` promise, if any. */\nfunction resolveRendered(element: HTMLElement): void {\n const resolve = (element as any)[RENDERED_RESOLVE];\n if (resolve) {\n (element as any)[RENDERED_RESOLVE] = null;\n resolve();\n }\n}\n\n/**\n * Options for @render decorator\n */\nexport interface RenderOptions {\n /**\n * Debounce render calls (ms)\n * Delays rendering until after this many ms of inactivity\n */\n debounce?: number;\n\n /**\n * Throttle render calls (ms)\n * Limits rendering to once per this many ms\n */\n throttle?: number;\n\n /**\n * Render only once, disable auto-rendering\n * Component must call render() method manually to re-render\n */\n once?: boolean;\n\n /**\n * Synchronous rendering (skip microtask batching)\n * Renders immediately instead of batching multiple property changes\n */\n sync?: boolean;\n\n /**\n * Disable differential rendering\n * When false, clears shadow root and re-renders from scratch each time\n * The render method must return a plain HTML string\n */\n differential?: boolean;\n}\n\n/**\n * Global render scheduler for microtask batching\n * Batches multiple property changes into a single render\n */\nclass RenderScheduler {\n private pending = new Set<HTMLElement>();\n private scheduled = false;\n\n /**\n * Schedule an element for rendering\n * Batches renders in a microtask unless sync option is enabled\n */\n schedule(element: HTMLElement, options: RenderOptions): void {\n // Sync rendering - execute immediately\n if (options.sync) {\n performRender(element, options);\n return;\n }\n\n // Async rendering - batch in microtask\n this.pending.add(element);\n\n if (!this.scheduled) {\n this.scheduled = true;\n queueMicrotask(() => this.flush());\n }\n }\n\n /**\n * Flush all pending renders\n */\n private flush(): void {\n const elements = Array.from(this.pending);\n this.pending.clear();\n this.scheduled = false;\n\n for (const element of elements) {\n // Skip elements that were disconnected between scheduling and flush, but\n // remember the dropped render so reconnect can replay it — otherwise the\n // shadow DOM stays stale for a property changed while detached. The flag\n // lives on the element, so it's GC'd with it (no leak if never reattached).\n if (!element.isConnected) {\n (element as any)[PENDING_RECONNECT_RENDER] = true;\n continue;\n }\n const options = (element as any)[RENDER_OPTIONS] || {};\n performRender(element, options);\n }\n }\n\n /** Remove a disconnected element from the queue */\n remove(element: HTMLElement): void {\n this.pending.delete(element);\n }\n}\n\nconst renderScheduler = new RenderScheduler();\n\nfunction hasRendered(element: HTMLElement): boolean {\n return Object.prototype.hasOwnProperty.call(element, RENDER_INSTANCE);\n}\n\nfunction flushRenderCallbacks(element: HTMLElement): void {\n const callbacks = (element as any)[RENDER_CALLBACKS];\n if (!callbacks || callbacks.length === 0) return;\n const cbs = [...callbacks];\n (element as any)[RENDER_CALLBACKS] = [];\n cbs.forEach(cb => cb());\n}\n\n/**\n * Backstop against a render() that mutates an observed property, which makes\n * the property setter request another render from inside the current one. In\n * `sync` mode that re-enters performRender synchronously and, unchecked,\n * recurses to a stack overflow. The counter caps synchronous nesting and turns\n * a silent crash into an actionable error. Normal renders never nest (child\n * renders defer to a microtask), so this stays at depth 1 in the common case.\n *\n * The depth is tracked PER ELEMENT (on RENDER_DEPTH), not globally: a runaway\n * component must not consume a shared budget and reject an unrelated component\n * that happens to render inside its call stack.\n */\nconst MAX_RENDER_DEPTH = 50;\n\n/**\n * Perform the actual render of an element\n */\nfunction performRender(\n element: HTMLElement,\n options: RenderOptions,\n precomputedResult?: any\n): void {\n const hasPrecomputedResult = arguments.length >= 3;\n const renderMethod = (element as any)[RENDER_METHOD];\n if (!renderMethod) {\n resolveRendered(element);\n return;\n }\n\n // If once is true and we've already rendered, skip\n if (options.once && hasRendered(element)) {\n resolveRendered(element);\n return;\n }\n\n const depth = ((element as any)[RENDER_DEPTH] ?? 0) as number;\n if (depth >= MAX_RENDER_DEPTH) {\n const tag = element.tagName ? element.tagName.toLowerCase() : 'element';\n console.error(\n `snice: maximum render depth (${MAX_RENDER_DEPTH}) exceeded for <${tag}>. ` +\n `render() is mutating an observed property, causing an infinite render loop.`\n );\n resolveRendered(element);\n return;\n }\n\n (element as any)[RENDER_DEPTH] = depth + 1;\n try {\n const result = hasPrecomputedResult\n ? precomputedResult\n : renderMethod.call(element);\n\n const renderRoot = ensureRenderRoot(element);\n\n // Non-differential rendering (string)\n if (options.differential === false) {\n if (typeof result !== 'string') {\n console.warn('Render method with differential: false must return a string');\n return;\n }\n const template = document.createElement('template');\n template.innerHTML = result;\n const instance = (element as any)[RENDER_INSTANCE] as TemplateInstance | null | undefined;\n instance?.clear();\n const removable = Array.from(renderRoot.childNodes).filter(node => !(\n node.nodeType === Node.ELEMENT_NODE &&\n (node as Element).tagName === 'STYLE' &&\n (node as Element).hasAttribute('data-snice-style')\n ));\n for (const node of removable) node.remove();\n renderRoot.appendChild(template.content);\n // A present, null render instance records a successful string render so\n // `once` works without pretending the string tree is a TemplateInstance.\n (element as any)[RENDER_INSTANCE] = null;\n flushRenderCallbacks(element);\n scheduleAutofocus(element);\n return;\n }\n\n // Differential rendering (template)\n if (!isTemplateResult(result)) {\n console.warn('Render method must return html`` template result');\n return;\n }\n\n let instance = (element as any)[RENDER_INSTANCE] as TemplateInstance | undefined;\n\n if (instance && instance.isSameTemplate(result.strings)) {\n instance.update(result.values);\n flushRenderCallbacks(element);\n scheduleAutofocus(element);\n return;\n }\n\n const nextInstance = new TemplateInstance(result);\n const nextFragment = nextInstance.renderFragment();\n\n // Commit while detached first. A malformed binding can then fail without\n // exposing a half-updated tree. Connection-aware parts are paired with\n // reconnected() immediately after the successful mount.\n try {\n nextInstance.update(result.values);\n } catch (error) {\n nextInstance.clear();\n throw error;\n }\n\n // Park the previous tree without disposing it, mount the prepared tree,\n // then run connection hooks. If reconnecting a listener or async part\n // fails, restore the still-live previous tree instead of leaving a\n // partially mounted replacement behind.\n const previousFragment = document.createDocumentFragment();\n for (const child of Array.from(renderRoot.childNodes)) {\n if (\n child.nodeType === Node.ELEMENT_NODE &&\n (child as Element).tagName === 'STYLE' &&\n (child as Element).hasAttribute('data-snice-style')\n ) continue;\n previousFragment.appendChild(child);\n }\n renderRoot.appendChild(nextFragment);\n try {\n if (element.isConnected) nextInstance.reconnected();\n } catch (error) {\n try {\n nextInstance.clear();\n } catch (cleanupError) {\n console.error('snice: failed to clean up a rejected render tree:', cleanupError);\n }\n for (const child of Array.from(renderRoot.childNodes)) {\n if (\n child.nodeType === Node.ELEMENT_NODE &&\n (child as Element).tagName === 'STYLE' &&\n (child as Element).hasAttribute('data-snice-style')\n ) continue;\n child.remove();\n }\n renderRoot.appendChild(previousFragment);\n throw error;\n }\n\n (element as any)[RENDER_INSTANCE] = nextInstance;\n let cleanupError: unknown;\n try {\n instance?.clear();\n } catch (error) {\n cleanupError = error;\n }\n flushRenderCallbacks(element);\n scheduleAutofocus(element);\n if (cleanupError) throw cleanupError;\n } catch (error) {\n const contextual = contextualizeRenderError(element, error);\n if (strictRenderErrors) throw contextual;\n console.error('Error rendering element:', contextual);\n } finally {\n (element as any)[RENDER_DEPTH] = depth;\n resolveRendered(element);\n }\n}\n\n/** Commit immediately using the element's configured render options. */\nexport function renderElementNow(element: HTMLElement): void {\n ensureRenderedPromise(element);\n const options = (element as any)[RENDER_OPTIONS] as RenderOptions || {};\n performRender(element, { ...options, once: false });\n}\n\n/**\n * Request a render for an element\n * Respects debounce/throttle/once/sync options\n * @param immediate - Force immediate render (used for initial render)\n */\nexport function requestRender(element: HTMLElement, immediate = false): void {\n const options = (element as any)[RENDER_OPTIONS] as RenderOptions || {};\n\n // Handle once option\n if (options.once && hasRendered(element)) {\n if (element.isConnected) reconnectRenderTree(element);\n return;\n }\n\n // Arm the `rendered` promise: it resolves when this request's render\n // commits (immediately below for sync/immediate, later for batched/\n // debounced/throttled renders).\n ensureRenderedPromise(element);\n\n // Force immediate render (for initial render)\n if (immediate) {\n performRender(element, options);\n return;\n }\n\n // Handle debounce\n if (options.debounce !== undefined && options.debounce > 0) {\n if (!(element as any)[RENDER_TIMERS]) {\n (element as any)[RENDER_TIMERS] = {};\n }\n\n clearTimeout((element as any)[RENDER_TIMERS].debounce);\n (element as any)[RENDER_TIMERS].debounce = setTimeout(() => {\n (element as any)[RENDER_TIMERS].debounce = null;\n renderScheduler.schedule(element, options);\n }, options.debounce);\n return;\n }\n\n // Handle throttle\n if (options.throttle !== undefined && options.throttle > 0) {\n if (!(element as any)[RENDER_TIMERS]) {\n (element as any)[RENDER_TIMERS] = { lastThrottle: 0 };\n }\n\n const timers = (element as any)[RENDER_TIMERS];\n const now = Date.now();\n\n if (timers.lastThrottle === 0 || now - timers.lastThrottle >= options.throttle) {\n timers.lastThrottle = now;\n renderScheduler.schedule(element, options);\n return;\n }\n\n if (!timers.throttleTimer) {\n const remaining = options.throttle - (now - timers.lastThrottle);\n timers.throttleTimer = setTimeout(() => {\n timers.throttleTimer = null;\n timers.lastThrottle = Date.now();\n renderScheduler.schedule(element, options);\n }, remaining);\n }\n return;\n }\n\n // Normal rendering (with microtask batching unless sync)\n renderScheduler.schedule(element, options);\n}\n\n/**\n * Clear any pending debounce/throttle render timers on an element (e.g. on\n * disconnect, so they don't fire on a dead element and retain it until they\n * expire). Returns true if a render was actually pending, so the caller can\n * arrange a replay on reconnect via PENDING_RECONNECT_RENDER.\n */\nexport function clearRenderTimers(element: HTMLElement): boolean {\n const timers = (element as any)[RENDER_TIMERS];\n if (!timers) return false;\n\n let hadPending = false;\n if (timers.debounce) {\n clearTimeout(timers.debounce);\n timers.debounce = null;\n hadPending = true;\n }\n if (timers.throttleTimer) {\n clearTimeout(timers.throttleTimer);\n timers.throttleTimer = null;\n hadPending = true;\n }\n // Deliberately do NOT reset timers.lastThrottle: a plain DOM move is a\n // disconnect+reconnect, and zeroing the cooldown would let the next render\n // fire inside the throttle window. Preserving it keeps throttle honest\n // across moves; on a true disconnect the element is discarded anyway.\n return hadPending;\n}\n\n/** Pause connection-aware render parts while an element is detached. */\nexport function disconnectRenderTree(element: HTMLElement): void {\n const instance = (element as any)[RENDER_INSTANCE] as TemplateInstance | undefined;\n // A host disconnection is not the same thing as parking a conditional\n // branch. The shadow/light render tree still belongs to the host, so native\n // event listeners remain usable on retained node references. Async iteration\n // is paused, and parked branches continue to detach their listeners through\n // the ordinary Part lifecycle.\n instance?.disconnected(true);\n}\n\n/** Resume connection-aware render parts when an existing tree reconnects. */\nexport function reconnectRenderTree(element: HTMLElement): void {\n const instance = (element as any)[RENDER_INSTANCE] as TemplateInstance | undefined;\n instance?.reconnected();\n}\n\n/**\n * @render decorator for component rendering\n *\n * Marks a method as the render method for the component.\n * The method should return html`...` template.\n * Automatically re-renders when properties change (unless once: true).\n *\n * @example\n * ```typescript\n * @render()\n * renderContent() {\n * return html`<div>${this.count}</div>`;\n * }\n * ```\n *\n * @example\n * ```typescript\n * // Debounced rendering\n * @render({ debounce: 100 })\n * renderContent() {\n * return html`<div>${this.searchTerm}</div>`;\n * }\n * ```\n *\n * @example\n * ```typescript\n * // Render only once (manual re-renders only)\n * @render({ once: true })\n * renderContent() {\n * return html`<div>Static content</div>`;\n * }\n * ```\n */\nexport function render(options: RenderOptions = {}) {\n return function (originalMethod: any, context: ClassMethodDecoratorContext) {\n const methodName = context.name as string;\n\n context.addInitializer(function (this: any) {\n // Store the render method and options\n this[RENDER_METHOD] = originalMethod;\n this[RENDER_OPTIONS] = options;\n });\n\n // Return wrapped method that triggers re-render when called manually\n return function (this: HTMLElement, ...args: any[]) {\n // Call original method to get the template\n const result = originalMethod.apply(this, args);\n\n // Always render when method is called manually (even if once: true)\n // Force immediate render to bypass all options, pass precomputed result to avoid calling method twice\n const configured = (this as any)[RENDER_OPTIONS] || options;\n performRender(this, { ...configured, once: false }, result);\n\n return result;\n };\n };\n}\n\n/**\n * @styles decorator for component styles\n *\n * Marks a method as the styles method for the component.\n * The method should return css`...` template.\n * Styles are applied once when the component is connected.\n *\n * @example\n * ```typescript\n * @styles()\n * styles() {\n * return css`:host { display: block; }`;\n * }\n * ```\n */\nexport function styles() {\n return function (originalMethod: any, context: ClassMethodDecoratorContext) {\n context.addInitializer(function (this: any) {\n // Collect parent styles methods before overwriting with child's\n if (this[STYLES_METHOD] && !this[PARENT_STYLES_METHODS]) {\n this[PARENT_STYLES_METHODS] = [this[STYLES_METHOD]];\n } else if (this[STYLES_METHOD] && this[PARENT_STYLES_METHODS]) {\n this[PARENT_STYLES_METHODS].push(this[STYLES_METHOD]);\n }\n this[STYLES_METHOD] = originalMethod;\n });\n\n return originalMethod;\n };\n}\n\n/**\n * Apply styles to an element\n * Called during element initialization\n */\nexport function applyStyles(element: HTMLElement): void {\n const stylesMethod = (element as any)[STYLES_METHOD];\n const staticResults: CSSResult[] = [];\n const constructors: any[] = [];\n let constructor: any = element.constructor;\n while (constructor && constructor !== HTMLElement && constructor !== Function.prototype) {\n constructors.unshift(constructor);\n constructor = Object.getPrototypeOf(constructor);\n }\n for (const current of constructors) {\n if (!Object.prototype.hasOwnProperty.call(current, 'styles')) continue;\n const value = current.styles;\n const values = Array.isArray(value) ? value : [value];\n for (const result of values) {\n if (isCSSResult(result)) staticResults.push(result);\n else console.warn('Static styles must be a css`` result or an array of css`` results');\n }\n }\n if (!stylesMethod && staticResults.length === 0) return;\n\n // Only apply once\n if ((element as any)[STYLES_APPLIED]) return;\n (element as any)[STYLES_APPLIED] = true;\n\n try {\n // Collect all CSS results: parent styles first, then child styles\n const allResults: CSSResult[] = [...staticResults];\n const parentMethods = (element as any)[PARENT_STYLES_METHODS] as Array<(...args: any[]) => any> | undefined;\n if (parentMethods) {\n for (const method of parentMethods) {\n const r = method.call(element);\n if (isCSSResult(r)) allResults.push(r);\n }\n }\n if (stylesMethod) {\n const result = stylesMethod.call(element);\n if (!isCSSResult(result)) {\n console.warn('Styles method must return css`` template result');\n return;\n }\n allResults.push(result);\n }\n\n const renderRoot = ensureRenderRoot(element);\n\n // Retain matching framework-owned style elements instead of adding a\n // duplicate stylesheet during a repeated setup pass.\n const existingStyles = Array.from(renderRoot.childNodes).filter(node =>\n node.nodeType === Node.ELEMENT_NODE &&\n (node as Element).tagName === 'STYLE' &&\n (node as Element).hasAttribute('data-snice-style')\n ) as HTMLStyleElement[];\n if (\n existingStyles.length === allResults.length &&\n existingStyles.every((style, index) => style.textContent === allResults[index].cssText)\n ) {\n return;\n }\n for (const style of existingStyles) style.remove();\n\n // Prefer constructable stylesheets\n if (renderRoot instanceof ShadowRoot && allResults.every(r => !!r.styleSheet) && 'adoptedStyleSheets' in renderRoot) {\n try {\n renderRoot.adoptedStyleSheets = allResults.map(r => r.styleSheet!);\n return;\n } catch {\n // A stylesheet constructed in another Window/Document realm cannot be\n // adopted here. Fall through to equivalent <style> elements.\n }\n }\n\n // Fallback — one <style> tag per stylesheet, preserving cascade order.\n // Marked so the template-switch cleanup keeps these (framework styles) but\n // still removes template-emitted <style> tags (which would otherwise pile up).\n for (const r of allResults) {\n const style = document.createElement('style');\n style.setAttribute('data-snice-style', '');\n style.textContent = r.cssText;\n renderRoot.appendChild(style);\n }\n } catch (error) {\n console.error('Error applying styles:', error);\n }\n}\n","import { DISPATCH_TIMERS } from './symbols';\nimport { DispatchOptions } from './types/dispatch-options';\nimport { resolveScope } from './utils';\nimport { defaultCommunicationTarget, requireDaemonTarget } from './daemon-target';\n\n// @dispatch decorator - auto-dispatches custom events from method return values\n\n\n/**\n * Decorator that automatically dispatches a custom event after a method is called.\n * The return value of the method becomes the event detail.\n *\n * @param eventName The name of the event to dispatch\n * @param options Optional configuration extending EventInit\n */\nexport function dispatch(eventName: string, options?: DispatchOptions) {\n return function (originalMethod: any, _context: ClassMethodDecoratorContext) {\n return function (this: any, ...args: any[]) {\n // Create timing wrappers for dispatch (per-instance)\n if (!this[DISPATCH_TIMERS]) {\n this[DISPATCH_TIMERS] = new Map();\n }\n\n const timerKey = `${eventName}_${_context.name as string}`;\n if (!this[DISPATCH_TIMERS].has(timerKey)) {\n this[DISPATCH_TIMERS].set(timerKey, {\n debounceTimeout: null,\n throttleLastCall: 0,\n throttleTimeout: null\n });\n }\n\n const timers = this[DISPATCH_TIMERS].get(timerKey);\n\n // Call the original method with preserved this context\n const result = originalMethod.apply(this, args);\n \n // Helper to dispatch the event\n const doDispatch = (detail: any) => {\n // Skip dispatch if result is undefined and dispatchOnUndefined is false\n if (detail === undefined && options?.dispatchOnUndefined === false) {\n return;\n }\n\n // Copy only platform EventInit fields; Snice-only decorator options do\n // not belong in the CustomEvent constructor dictionary.\n const event = new CustomEvent(eventName, {\n bubbles: options?.bubbles ?? true,\n cancelable: options?.cancelable ?? false,\n composed: options?.composed ?? true,\n detail\n });\n\n if (options?.scope !== undefined && options?.daemon !== undefined) {\n throw new TypeError(\n `@dispatch('${eventName}') cannot use both scope and daemon.`\n );\n }\n\n if (options?.daemon !== undefined) {\n requireDaemonTarget(this, options.daemon).dispatchEvent(event);\n return;\n }\n\n if (options?.scope !== undefined) {\n const target = resolveScope(this as HTMLElement, options.scope);\n if (!target) {\n console.warn(\n `[snice/@dispatch] scope did not resolve for \"${eventName}\" — event not dispatched.`\n );\n return;\n }\n target.dispatchEvent(event);\n return;\n }\n\n const target = defaultCommunicationTarget(this);\n if (!target) {\n throw new TypeError(\n `@dispatch('${eventName}') requires an element, attached controller, or provided @daemon instance.`\n );\n }\n target.dispatchEvent(event);\n };\n \n // Helper to handle timed dispatch\n const timedDispatch = (detail: any) => {\n if (options?.debounce) {\n clearTimeout(timers.debounceTimeout);\n timers.debounceTimeout = setTimeout(() => doDispatch(detail), options.debounce);\n return;\n }\n\n if (!options?.throttle) {\n doDispatch(detail);\n return;\n }\n\n const now = Date.now();\n const remaining = options.throttle - (now - timers.throttleLastCall);\n\n if (remaining <= 0) {\n clearTimeout(timers.throttleTimeout);\n timers.throttleLastCall = now;\n doDispatch(detail);\n return;\n }\n\n // Record the LATEST detail so the trailing dispatch carries fresh\n // data, not the first-suppressed-call detail captured by closure.\n timers.latestDetail = detail;\n if (!timers.throttleTimeout) {\n timers.throttleTimeout = setTimeout(() => {\n timers.throttleLastCall = Date.now();\n timers.throttleTimeout = null;\n const d = timers.latestDetail;\n timers.latestDetail = undefined;\n doDispatch(d);\n }, remaining);\n }\n };\n \n // Handle async methods\n if (result instanceof Promise) {\n return result.then((resolvedResult: any) => {\n timedDispatch(resolvedResult);\n return resolvedResult;\n });\n }\n \n // Sync method\n timedDispatch(result);\n return result;\n };\n };\n}\n\n/**\n * Clear any pending debounce/throttle dispatch timers on an instance (e.g. on\n * disconnect, so a queued event doesn't fire into a detached node). A dispatch\n * is a one-shot signal, so pending ones are dropped, not replayed.\n */\nexport function clearDispatchTimers(instance: any): void {\n const timers = instance[DISPATCH_TIMERS];\n if (!timers) return;\n\n for (const t of timers.values()) {\n if (t.debounceTimeout) clearTimeout(t.debounceTimeout);\n if (t.throttleTimeout) clearTimeout(t.throttleTimeout);\n t.debounceTimeout = null;\n t.throttleTimeout = null;\n t.throttleLastCall = 0;\n t.latestDetail = undefined;\n }\n}\n","/**\n * Method decorators for common patterns\n * @debounce, @throttle, @once, @memoize\n */\n\nimport { getSymbol } from './symbols';\n\nconst DEBOUNCE_TIMERS = getSymbol('debounce-timers');\nconst THROTTLE_TIMERS = getSymbol('throttle-timers');\nconst ONCE_CALLED = getSymbol('once-called');\nconst MEMOIZE_CACHE = getSymbol('memoize-cache');\n\n/**\n * @debounce decorator - delays function execution until after wait time has elapsed\n * since the last invocation\n *\n * @param wait - Time to wait in milliseconds (default: 300)\n * @param options - Debounce options\n * @param options.leading - Invoke on the leading edge (default: false)\n * @param options.trailing - Invoke on the trailing edge (default: true)\n * @param options.maxWait - Maximum time to wait before invoking (default: undefined)\n *\n * @example\n * ```typescript\n * @element('search-input')\n * class SearchInput extends HTMLElement {\n * @debounce(500)\n * handleSearch(query: string) {\n * // Only called 500ms after last keystroke\n * fetch(`/api/search?q=${query}`);\n * }\n * }\n * ```\n */\nexport function debounce(\n wait = 300,\n options: {\n leading?: boolean;\n trailing?: boolean;\n maxWait?: number;\n } = {}\n) {\n const { leading = false, trailing = true, maxWait } = options;\n\n return function (originalMethod: any, context: ClassMethodDecoratorContext) {\n const methodName = context.name as string;\n\n return function (this: any, ...args: any[]) {\n if (!this[DEBOUNCE_TIMERS]) {\n this[DEBOUNCE_TIMERS] = {};\n }\n\n const timers = this[DEBOUNCE_TIMERS];\n const timerKey = methodName;\n\n // Clear existing timer\n if (timers[timerKey]) {\n clearTimeout(timers[timerKey].timeout);\n }\n\n // Track when debounce started for maxWait\n const now = Date.now();\n const isFirstCall = !timers[timerKey];\n const startTime = isFirstCall ? now : timers[timerKey].startTime;\n\n // Check if maxWait exceeded\n const shouldInvokeFromMaxWait =\n maxWait !== undefined && now - startTime >= maxWait;\n\n // Leading edge invocation\n if (leading && isFirstCall) {\n const result = originalMethod.apply(this, args);\n timers[timerKey] = {\n timeout: null,\n startTime,\n lastArgs: args,\n };\n return result;\n }\n\n // Set new timer for trailing edge\n const timeout = setTimeout(() => {\n if (trailing || shouldInvokeFromMaxWait) {\n originalMethod.apply(this, timers[timerKey].lastArgs);\n }\n delete timers[timerKey];\n }, shouldInvokeFromMaxWait ? 0 : wait);\n\n timers[timerKey] = {\n timeout,\n startTime,\n lastArgs: args,\n };\n };\n };\n}\n\n/**\n * @throttle decorator - ensures function is called at most once per specified time period\n *\n * @param wait - Time to wait in milliseconds (default: 300)\n * @param options - Throttle options\n * @param options.leading - Invoke on the leading edge (default: true)\n * @param options.trailing - Invoke on the trailing edge (default: true)\n *\n * @example\n * ```typescript\n * @element('scroll-tracker')\n * class ScrollTracker extends HTMLElement {\n * @throttle(100)\n * handleScroll(e: Event) {\n * // Called at most once every 100ms\n * this.updateScrollPosition();\n * }\n * }\n * ```\n */\nexport function throttle(\n wait = 300,\n options: {\n leading?: boolean;\n trailing?: boolean;\n } = {}\n) {\n const { leading = true, trailing = true } = options;\n\n return function (originalMethod: any, context: ClassMethodDecoratorContext) {\n const methodName = context.name as string;\n\n return function (this: any, ...args: any[]) {\n if (!this[THROTTLE_TIMERS]) {\n this[THROTTLE_TIMERS] = {};\n }\n\n const timers = this[THROTTLE_TIMERS];\n const timerKey = methodName;\n const now = Date.now();\n\n // First call\n if (!timers[timerKey]) {\n if (leading) originalMethod.apply(this, args);\n\n timers[timerKey] = { lastInvoke: now, timeout: null, lastArgs: args };\n\n if (trailing && !leading) {\n timers[timerKey].timeout = setTimeout(() => {\n originalMethod.apply(this, timers[timerKey].lastArgs);\n delete timers[timerKey];\n }, wait);\n }\n return;\n }\n\n // Subsequent calls\n const timeSinceLastInvoke = now - timers[timerKey].lastInvoke;\n timers[timerKey].lastArgs = args;\n\n if (timers[timerKey].timeout) {\n clearTimeout(timers[timerKey].timeout);\n }\n\n // Enough time passed — invoke immediately\n if (timeSinceLastInvoke >= wait) {\n originalMethod.apply(this, args);\n timers[timerKey].lastInvoke = now;\n return;\n }\n\n // Set up trailing call\n if (trailing) {\n const remaining = wait - timeSinceLastInvoke;\n timers[timerKey].timeout = setTimeout(() => {\n originalMethod.apply(this, timers[timerKey].lastArgs);\n timers[timerKey].lastInvoke = Date.now();\n timers[timerKey].timeout = null;\n }, remaining);\n }\n };\n };\n}\n\n/**\n * @once decorator - ensures function is only called once\n * Subsequent calls return the result of the first call\n *\n * @param perInstance - If true, function can be called once per instance (default: true)\n * If false, function can only be called once globally across all instances\n *\n * @example\n * ```typescript\n * @element('data-loader')\n * class DataLoader extends HTMLElement {\n * @once()\n * async loadData() {\n * // Only loads data once, even if called multiple times\n * const data = await fetch('/api/data');\n * return data.json();\n * }\n * }\n * ```\n */\nexport function once(perInstance = true) {\n let globalCalled = false;\n let globalResult: any;\n\n return function (originalMethod: any, context: ClassMethodDecoratorContext) {\n const methodName = context.name as string;\n\n return function (this: any, ...args: any[]) {\n // Per-instance tracking\n if (perInstance) {\n if (!this[ONCE_CALLED]) this[ONCE_CALLED] = {};\n\n if (!this[ONCE_CALLED][methodName]) {\n this[ONCE_CALLED][methodName] = {\n called: true,\n result: originalMethod.apply(this, args),\n };\n }\n\n return this[ONCE_CALLED][methodName].result;\n }\n\n // Global tracking\n if (!globalCalled) {\n globalCalled = true;\n globalResult = originalMethod.apply(this, args);\n }\n\n return globalResult;\n };\n };\n}\n\n/**\n * @memoize decorator - caches function results based on arguments\n * Uses JSON.stringify for argument comparison by default\n *\n * @param options - Memoization options\n * @param options.keyGenerator - Custom function to generate cache key from arguments\n * @param options.maxSize - Maximum cache size (default: 100)\n * @param options.ttl - Time to live in milliseconds (default: undefined - no expiration)\n *\n * @example\n * ```typescript\n * @element('calculator')\n * class Calculator extends HTMLElement {\n * @memoize({ maxSize: 50 })\n * fibonacci(n: number): number {\n * // Results are cached, subsequent calls with same n are instant\n * if (n <= 1) return n;\n * return this.fibonacci(n - 1) + this.fibonacci(n - 2);\n * }\n * }\n * ```\n */\nexport function memoize(\n options: {\n keyGenerator?: (...args: any[]) => string;\n maxSize?: number;\n ttl?: number;\n } = {}\n) {\n const { keyGenerator = (...args) => JSON.stringify(args), maxSize = 100, ttl } = options;\n\n return function (originalMethod: any, context: ClassMethodDecoratorContext) {\n const methodName = context.name as string;\n\n return function (this: any, ...args: any[]) {\n if (!this[MEMOIZE_CACHE]) {\n this[MEMOIZE_CACHE] = {};\n }\n\n if (!this[MEMOIZE_CACHE][methodName]) {\n this[MEMOIZE_CACHE][methodName] = new Map();\n }\n\n const cache = this[MEMOIZE_CACHE][methodName];\n const key = keyGenerator(...args);\n\n // Check if cached\n if (cache.has(key)) {\n const cached = cache.get(key);\n const expired = ttl !== undefined && (Date.now() - cached.timestamp) > ttl;\n\n if (expired) {\n cache.delete(key);\n } else {\n return cached.value;\n }\n }\n\n // Compute result\n const result = originalMethod.apply(this, args);\n\n // Store in cache\n cache.set(key, {\n value: result,\n timestamp: Date.now(),\n });\n\n // Enforce max size (LRU - delete oldest)\n if (cache.size > maxSize) {\n const firstKey = cache.keys().next().value;\n cache.delete(firstKey);\n }\n\n return result;\n };\n };\n}\n\n/**\n * Clear all debounce timers for an instance\n * Useful in cleanup/disconnectedCallback\n */\nexport function clearDebounceTimers(instance: any): void {\n if (instance[DEBOUNCE_TIMERS]) {\n for (const timerKey in instance[DEBOUNCE_TIMERS]) {\n if (instance[DEBOUNCE_TIMERS][timerKey]?.timeout) {\n clearTimeout(instance[DEBOUNCE_TIMERS][timerKey].timeout);\n }\n }\n instance[DEBOUNCE_TIMERS] = {};\n }\n}\n\n/**\n * Clear all throttle timers for an instance\n * Useful in cleanup/disconnectedCallback\n */\nexport function clearThrottleTimers(instance: any): void {\n if (instance[THROTTLE_TIMERS]) {\n for (const timerKey in instance[THROTTLE_TIMERS]) {\n if (instance[THROTTLE_TIMERS][timerKey]?.timeout) {\n clearTimeout(instance[THROTTLE_TIMERS][timerKey].timeout);\n }\n }\n instance[THROTTLE_TIMERS] = {};\n }\n}\n\n/**\n * Clear memoize cache for an instance\n */\nexport function clearMemoizeCache(instance: any, methodName?: string): void {\n if (instance[MEMOIZE_CACHE]) {\n if (methodName) {\n delete instance[MEMOIZE_CACHE][methodName];\n } else {\n instance[MEMOIZE_CACHE] = {};\n }\n }\n}\n\n/**\n * Reset once-called state for an instance\n */\nexport function resetOnce(instance: any, methodName?: string): void {\n if (instance[ONCE_CALLED]) {\n if (methodName) {\n delete instance[ONCE_CALLED][methodName];\n } else {\n instance[ONCE_CALLED] = {};\n }\n }\n}\n","type MutationCallback = () => void;\n\nfunction isPlainObject(value: object): boolean {\n const prototype = Object.getPrototypeOf(value);\n return prototype === Object.prototype || prototype === null;\n}\n\nfunction descriptorsEqual(first?: PropertyDescriptor, second?: PropertyDescriptor): boolean {\n if (!first || !second) return first === second;\n const firstIsData = 'value' in first || 'writable' in first;\n const secondIsData = 'value' in second || 'writable' in second;\n return firstIsData === secondIsData &&\n first.configurable === second.configurable &&\n first.enumerable === second.enumerable &&\n (!firstIsData || (\n first.writable === second.writable &&\n Object.is(first.value, second.value)\n )) &&\n (firstIsData || (\n first.get === second.get &&\n first.set === second.set\n ));\n}\n\nfunction invariantValue(target: object, property: PropertyKey): { locked: boolean; value: unknown } {\n const descriptor = Reflect.getOwnPropertyDescriptor(target, property);\n if (!descriptor || descriptor.configurable) return { locked: false, value: undefined };\n if ('value' in descriptor && descriptor.writable === false) {\n return { locked: true, value: descriptor.value };\n }\n if (!('value' in descriptor) && descriptor.get === undefined) {\n return { locked: true, value: undefined };\n }\n return { locked: false, value: undefined };\n}\n\n/**\n * Wrap mutable collection/object state so nested writes can invalidate a\n * component without requiring a replacement assignment.\n */\nexport function createDeepReactive<T>(value: T, changed: MutationCallback): T {\n if (!value || typeof value !== 'object') return value;\n\n const cache = new WeakMap<object, any>();\n const rawByProxy = new WeakMap<object, object>();\n const unwrap = (input: any): any => input && typeof input === 'object'\n ? rawByProxy.get(input) || input\n : input;\n\n const wrap = (input: any): any => {\n if (!input || typeof input !== 'object') return input;\n if (cache.has(input)) return cache.get(input);\n\n if (input instanceof Map) {\n let proxy: Map<any, any>;\n const methods = new Map<PropertyKey, unknown>();\n proxy = new Proxy(input, {\n get(target, property) {\n const invariant = invariantValue(target, property);\n if (invariant.locked) return invariant.value;\n if (methods.has(property)) return methods.get(property);\n let method: unknown;\n if (property === 'set') method = (key: unknown, next: unknown) => {\n key = unwrap(key);\n next = unwrap(next);\n const existed = target.has(key);\n const previous = target.get(key);\n target.set(key, next);\n if (!existed || !Object.is(previous, next)) changed();\n return proxy;\n };\n else if (property === 'delete') method = (key: unknown) => {\n key = unwrap(key);\n const deleted = target.delete(key);\n if (deleted) changed();\n return deleted;\n };\n else if (property === 'clear') method = () => {\n if (target.size === 0) return;\n target.clear();\n changed();\n };\n else if (property === 'get') method = (key: unknown) => wrap(target.get(unwrap(key)));\n else if (property === 'has') method = (key: unknown) => target.has(unwrap(key));\n else if (property === 'forEach') method = (callback: Function, thisArg?: unknown) =>\n target.forEach((entryValue, key) => callback.call(thisArg, wrap(entryValue), wrap(key), proxy));\n else if (property === 'values') method = function* () {\n for (const entryValue of target.values()) yield wrap(entryValue);\n };\n else if (property === 'keys') method = function* () {\n for (const key of target.keys()) yield wrap(key);\n };\n else if (property === 'entries' || property === Symbol.iterator) method = function* () {\n for (const [key, entryValue] of target.entries()) yield [wrap(key), wrap(entryValue)];\n };\n else {\n const value = Reflect.get(target, property, target);\n if (typeof value !== 'function') return value;\n if (property === 'constructor') return value;\n method = value.bind(target);\n }\n methods.set(property, method);\n return method;\n }\n });\n cache.set(input, proxy);\n rawByProxy.set(proxy, input);\n return proxy;\n }\n\n if (input instanceof Set) {\n let proxy: Set<any>;\n const methods = new Map<PropertyKey, unknown>();\n proxy = new Proxy(input, {\n get(target, property) {\n const invariant = invariantValue(target, property);\n if (invariant.locked) return invariant.value;\n if (methods.has(property)) return methods.get(property);\n let method: unknown;\n if (property === 'add') method = (entryValue: unknown) => {\n entryValue = unwrap(entryValue);\n const existed = target.has(entryValue);\n target.add(entryValue);\n if (!existed) changed();\n return proxy;\n };\n else if (property === 'delete') method = (entryValue: unknown) => {\n entryValue = unwrap(entryValue);\n const deleted = target.delete(entryValue);\n if (deleted) changed();\n return deleted;\n };\n else if (property === 'clear') method = () => {\n if (target.size === 0) return;\n target.clear();\n changed();\n };\n else if (property === 'has') method = (entryValue: unknown) => target.has(unwrap(entryValue));\n else if (property === 'forEach') method = (callback: Function, thisArg?: unknown) =>\n target.forEach(entryValue => {\n const wrapped = wrap(entryValue);\n callback.call(thisArg, wrapped, wrapped, proxy);\n });\n else if (property === 'values' || property === 'keys' || property === Symbol.iterator) method = function* () {\n for (const entryValue of target.values()) yield wrap(entryValue);\n };\n else if (property === 'entries') method = function* () {\n for (const entryValue of target.values()) {\n const wrapped = wrap(entryValue);\n yield [wrapped, wrapped];\n }\n };\n else {\n const value = Reflect.get(target, property, target);\n if (typeof value !== 'function') return value;\n if (property === 'constructor') return value;\n method = value.bind(target);\n }\n methods.set(property, method);\n return method;\n }\n });\n cache.set(input, proxy);\n rawByProxy.set(proxy, input);\n return proxy;\n }\n\n if (!Array.isArray(input) && !isPlainObject(input)) return input;\n\n const proxy = new Proxy(input, {\n get(target, property, receiver) {\n const invariant = invariantValue(target, property);\n return invariant.locked\n ? invariant.value\n : wrap(Reflect.get(target, property, receiver));\n },\n set(target, property, next, receiver) {\n const previous = Reflect.get(target, property, receiver);\n next = unwrap(next);\n // Write directly to the wrapped target. Passing the proxy as the\n // receiver re-enters defineProperty for an ordinary assignment and\n // would report the same mutation twice.\n const result = Reflect.set(target, property, next);\n if (result && !Object.is(previous, next)) changed();\n return result;\n },\n deleteProperty(target, property) {\n const existed = Object.prototype.hasOwnProperty.call(target, property);\n const result = Reflect.deleteProperty(target, property);\n if (result && existed) changed();\n return result;\n },\n defineProperty(target, property, descriptor) {\n const previous = Reflect.getOwnPropertyDescriptor(target, property);\n const nextDescriptor = 'value' in descriptor\n ? { ...descriptor, value: unwrap(descriptor.value) }\n : descriptor;\n const result = Reflect.defineProperty(target, property, nextDescriptor);\n const current = result ? Reflect.getOwnPropertyDescriptor(target, property) : previous;\n if (result && !descriptorsEqual(previous, current)) changed();\n return result;\n }\n });\n cache.set(input, proxy);\n rawByProxy.set(proxy, input);\n return proxy;\n };\n\n return wrap(value);\n}\n","import { attachController, deferControllerAttachment, detachController, restoreDirectControllerAttribute } from './controller';\nimport { ControllerClass } from './types/i-controller';\nimport { setupObservers, cleanupObservers } from './observe';\nimport { setupResponseHandlers, cleanupResponseHandlers } from './request-response';\nimport { setupEventHandlers, cleanupEventHandlers } from './on';\nimport { setupContextHandler, cleanupContextHandler } from './context';\nimport { parseAttributeValue, detectType, valueToAttribute, getAttrName, ensureSet, ensureObj, invokeWatchers, invokeImmediateWatchers, validateWatchedProperties, notEqual } from './utils';\nimport { requestRender, applyStyles, clearRenderTimers, disconnectRenderTree, reconnectRenderTree } from './render';\nimport { clearDispatchTimers } from './events';\nimport { IS_ELEMENT_CLASS, IS_CONTROLLER_INSTANCE, READY_PROMISE, READY_RESOLVE, READY_REJECT, READY_HANDLERS_RUNNING, RENDERED_PROMISE, RENDERED_RESOLVE, CONTROLLER, DIRECT_CONTROLLER, CONTROLLER_ATTRIBUTE_SYNC, PENDING_CONTROLLER_BINDING, PROPERTIES, PROPERTY_VALUES, PROPERTY_DEFAULTS, PROPERTY_WRAPPERS, PROPERTIES_INITIALIZED, PRE_INIT_PROPERTY_VALUES, PRE_UPGRADE_PROPERTY_BINDINGS, PROPERTY_WATCHERS, PROPERTY_DEFINERS, EXPLICITLY_SET_PROPERTIES, SETTING_FROM_PROPERTY, ROUTER_CONTEXT, READY_HANDLERS, DISPOSE_HANDLERS, RECONNECT_HANDLERS, INITIALIZED, MOVED_HANDLERS, ADOPTED_HANDLERS, MOVED_TIMERS, ADOPTED_TIMERS, RENDER_METHOD, RENDER_OPTIONS, ELEMENT_OPTIONS, WATCH_METHODS, READY_METHODS, DISPOSE_METHODS, RECONNECT_METHODS, MOVED_METHODS, ADOPTED_METHODS, PENDING_RECONNECT_RENDER, SNICE_ELEMENT_BASE } from './symbols';\nimport { QueryOptions } from './types/query-options';\nimport { PropertyOptions, StateOptions } from './types/property-options';\nimport { WatchOptions } from './types/watch-options';\nimport { ElementOptions } from './types/element-options';\nimport { clearDebounceTimers, clearThrottleTimers } from './method-decorators';\nimport { AppContext } from './types/app-context';\nimport { Placard } from './types/placard';\nimport { RouteParams } from './types/route-params';\nimport { createDeepReactive } from './reactive';\nimport { ensureRenderRoot, getRenderRoot } from './render-root';\nimport { getContext as getAppContext } from './context-provider';\nimport { resetHostAutofocus, scheduleAutofocus } from './autofocus';\n\n/**\n * Interface that layout components must implement to receive updates\n * from the router about application state and navigation changes.\n *\n * The framework will call the update method:\n * - When the layout is first created/connected\n * - When route changes occur during navigation\n *\n * Placards are collected at route creation and refreshed before each navigation,\n * ensuring layouts always receive current page metadata.\n *\n * @example\n * ```typescript\n * @layout('app-shell')\n * class AppShell extends HTMLElement implements Layout {\n * update(appContext: AppContext, placards: Placard[], currentRoute: string, routeParams: RouteParams) {\n * // Update navigation, breadcrumbs, user info, etc.\n * this.renderNavigation(placards, currentRoute);\n * this.updateUserInfo(appContext.principal);\n * this.applyTheme(appContext.theme);\n * }\n * }\n * ```\n */\nexport interface Layout {\n /**\n * Called by the framework to update the layout with current application state.\n *\n * @param appContext - Application-wide context (theme, auth, config, etc.)\n * @param placards - All page metadata for navigation and breadcrumbs\n * @param currentRoute - The currently active route path\n * @param routeParams - Parameters extracted from the current route\n *\n * @example\n * ```typescript\n * update(appContext, placards, currentRoute, routeParams) {\n * // Filter placards for main navigation\n * const navItems = placards.filter(p => p.show !== false && !p.parent);\n *\n * // Build breadcrumbs for current page\n * const currentPlacard = placards.find(p => matchesRoute(p, currentRoute));\n * const breadcrumbs = this.buildBreadcrumbs(currentPlacard, placards);\n *\n * // Update UI\n * this.renderNavigation(navItems, currentRoute);\n * this.renderBreadcrumbs(breadcrumbs);\n * this.updateUserDisplay(appContext.principal);\n * }\n * ```\n */\n update(\n appContext: AppContext,\n placards: Placard[],\n currentRoute: string,\n routeParams: RouteParams\n ): void;\n}\n\n/**\n * Applies core element functionality to a constructor\n * This is shared between @element and @page decorators\n */\nexport function applyElementFunctionality(constructor: any) {\n // Mark as element class for channel decorator detection\n (constructor.prototype as any)[IS_ELEMENT_CLASS] = true;\n\n // Add controller property to all elements\n const originalConnectedCallback = constructor.prototype.connectedCallback;\n const originalDisconnectedCallback = constructor.prototype.disconnectedCallback;\n const originalAttributeChangedCallback = constructor.prototype.attributeChangedCallback;\n \n // Add framework-managed native/controller attributes and all reflected properties\n const observedAttributes = constructor.observedAttributes || [];\n if (!observedAttributes.includes('controller')) {\n observedAttributes.push('controller');\n }\n if (!observedAttributes.includes('autofocus')) {\n observedAttributes.push('autofocus');\n }\n \n // Add all properties to observed attributes (skip attribute: false)\n const properties = constructor[PROPERTIES];\n if (properties) {\n for (const [propName, propOptions] of properties) {\n if (propOptions.attribute === false) continue;\n const attributeName = getAttrName(propOptions, propName);\n if (!observedAttributes.includes(attributeName)) {\n observedAttributes.push(attributeName);\n }\n }\n }\n \n Object.defineProperty(constructor, 'observedAttributes', {\n get() { return observedAttributes; },\n configurable: true\n });\n \n // Add ready property - always returns a promise\n Object.defineProperty(constructor.prototype, 'ready', {\n get() {\n if (!this[READY_PROMISE]) {\n // Create a pending promise if not yet initialized\n this[READY_PROMISE] = new Promise<void>((resolve, reject) => {\n this[READY_RESOLVE] = resolve;\n this[READY_REJECT] = reject;\n });\n // Preserve a rejected ready promise for explicit awaiters without\n // producing an unhandled rejection when nobody reads `.ready`.\n this[READY_PROMISE].catch(() => {});\n }\n return this[READY_PROMISE];\n },\n enumerable: true,\n configurable: true\n });\n\n // Add rendered property - resolves when the pending render (batched,\n // debounced, or throttled) has committed to the DOM; resolves\n // immediately when no render is pending.\n Object.defineProperty(constructor.prototype, 'rendered', {\n get() {\n return this[RENDERED_RESOLVE] ? this[RENDERED_PROMISE] : Promise.resolve();\n },\n enumerable: true,\n configurable: true\n });\n\n // Add controller property\n Object.defineProperty(constructor.prototype, 'controller', {\n get() {\n return this[CONTROLLER];\n },\n set(value: string | ControllerClass | null) {\n const oldValue = this[CONTROLLER];\n this[CONTROLLER] = value;\n if (value === oldValue) return;\n\n if (value) {\n const label = typeof value === 'string' ? value : (value.name || '(anonymous controller class)');\n attachController(this, value).catch(error => {\n // Detached before ready — designed teardown, not a failure\n if (error?.name === 'ControllerAttachAborted') {\n console.debug(`Controller \"${label}\" attach aborted (element detached before ready)`);\n return;\n }\n // Registry misses only apply to string names — class references\n // never go through the registry.\n if (typeof value === 'string' && error?.message === `Controller \"${value}\" not found in registry`) {\n deferControllerAttachment(this, value);\n return;\n }\n console.error(`Failed to attach controller \"${label}\":`, error);\n });\n return;\n }\n\n if (oldValue) {\n detachController(this).catch(error => {\n console.error(`Failed to detach controller:`, error);\n });\n }\n },\n enumerable: true,\n configurable: true\n });\n \n \n constructor.prototype.connectedCallback = async function() {\n\n // If ready promise was already created (controller attached before connected), use existing resolve\n // Otherwise create the ready promise now\n if (!this[READY_PROMISE]) {\n this[READY_PROMISE] = new Promise<void>((resolve, reject) => {\n this[READY_RESOLVE] = resolve;\n this[READY_REJECT] = reject;\n });\n this[READY_PROMISE].catch(() => {});\n }\n\n // Only run initialization logic once, but re-establish handlers on reconnection\n if (this[INITIALIZED]) {\n try {\n reconnectRenderTree(this);\n } catch (error) {\n console.error(`Error reconnecting the render tree for ${this.tagName}:`, error);\n }\n // Re-establish handlers that get cleaned up on disconnect\n setupEventHandlers(this, this);\n setupResponseHandlers(this, this);\n setupContextHandler(this);\n\n // Re-establish observers that get cleaned up on disconnect\n try {\n setupObservers(this, this);\n } catch (error) {\n console.error(`Error setting up observers for ${this.tagName} on reconnection:`, error);\n }\n\n // Call user's connectedCallback\n if (originalConnectedCallback) {\n originalConnectedCallback.call(this);\n }\n\n // Fire @reconnect handlers — for components that wire long-lived\n // global listeners or subscriptions in @ready and need to re-establish\n // them on re-connection. @ready does NOT re-fire (deliberately, to\n // preserve once-only initialization semantics).\n const reconnectHandlers = constructor[RECONNECT_HANDLERS];\n if (reconnectHandlers) {\n for (const handler of reconnectHandlers) {\n try {\n const result = handler.method.call(this);\n if (result && typeof (result as any).then === 'function') {\n (result as Promise<any>).catch(error => {\n console.error(`Error in @reconnect handler ${handler.methodName}:`, error);\n });\n }\n } catch (error) {\n console.error(`Error in @reconnect handler ${handler.methodName}:`, error);\n }\n }\n }\n\n // Replay a render that was dropped while disconnected. The scheduler\n // sets this flag when it skips a detached element, so a property changed\n // while detached still reaches the DOM on reattach. A plain move (no\n // pending render) leaves the flag unset, so we don't re-render needlessly.\n if (this[RENDER_METHOD] && this[PENDING_RECONNECT_RENDER]) {\n this[PENDING_RECONNECT_RENDER] = false;\n requestRender(this);\n }\n scheduleAutofocus(this);\n return;\n }\n\n // Mark that properties are being initialized from attributes\n // This allows property setters to work during initialization\n this[PROPERTIES_INITIALIZED] = true;\n\n // Initialize properties from attributes before rendering\n const properties = constructor[PROPERTIES];\n if (properties) {\n for (const [propName, propOptions] of properties) {\n if (propOptions.attribute === false) continue;\n const attributeName = getAttrName(propOptions, propName);\n if (!this.hasAttribute(attributeName)) continue;\n\n const attrValue = this.getAttribute(attributeName);\n ensureSet(this, EXPLICITLY_SET_PROPERTIES).add(propName);\n\n if (propOptions.type === Boolean && attrValue === '') {\n this.setAttribute(attributeName, 'true');\n }\n\n this[propName] = parseAttributeValue(attrValue, propOptions);\n }\n }\n\n // Clear pre-init values for properties that have HTML attributes\n if (this[PRE_INIT_PROPERTY_VALUES]) {\n for (const [propName, propValue] of Array.from((this[PRE_INIT_PROPERTY_VALUES] as Map<string, any>).entries())) {\n const propOptions = properties?.get(propName);\n const attributeName = getAttrName(propOptions || {}, propName);\n this[PRE_INIT_PROPERTY_VALUES].delete(propName);\n\n if (!this.hasAttribute(attributeName)) {\n this[propName] = propValue;\n }\n }\n delete this[PRE_INIT_PROPERTY_VALUES];\n }\n\n // Pick up a controller CLASS a template bound before this element was\n // defined. The binding parks the class instead of assigning the\n // property — a pre-upgrade assignment would have shadowed this accessor\n // with an own expando property. Attach directly rather than through the\n // `controller` accessor: some DOM implementations (happy-dom) invoke\n // connectedCallback on define without swapping the prototype, so the\n // accessor may not exist on this instance yet.\n if (this[PENDING_CONTROLLER_BINDING] !== undefined) {\n const pendingControllerClass = this[PENDING_CONTROLLER_BINDING];\n delete this[PENDING_CONTROLLER_BINDING];\n if (!this[CONTROLLER]) {\n this[CONTROLLER] = pendingControllerClass;\n const pendingLabel = pendingControllerClass?.name || '(anonymous controller class)';\n attachController(this, pendingControllerClass).catch((error: any) => {\n if (error?.name === 'ControllerAttachAborted') {\n console.debug(`Controller \"${pendingLabel}\" attach aborted (element detached before ready)`);\n return;\n }\n console.error(`Failed to attach controller \"${pendingLabel}\":`, error);\n });\n }\n }\n\n // Pick up a `controller` attribute set before connection. Real browsers\n // fire attributeChangedCallback on connect for all observed attrs that\n // already existed; happy-dom doesn't always, so we read it proactively.\n if (this.hasAttribute('controller') && !this[CONTROLLER]) {\n const controllerName = this.getAttribute('controller');\n if (controllerName) (this as any).controller = controllerName;\n }\n\n applyStyles(this);\n\n // Delegated @on handlers must bind inside the render root. Styles used\n // to create that root as a side effect, leaving styleless renderers to\n // bind on the host before their shadow root existed. Create only for\n // declarative renderers here so imperative elements that manage their\n // own shadow root keep their established lifecycle.\n if (this[RENDER_METHOD]) {\n try {\n ensureRenderRoot(this);\n } catch {\n // Defer invalid custom-root diagnostics to the normal render path,\n // where render errors are contextualized and reported consistently.\n // There is no usable root to bind delegated handlers to in this\n // invalid configuration, but the initial render below will surface\n // the author error without escaping connectedCallback.\n }\n }\n\n setupEventHandlers(this, this);\n setupResponseHandlers(this, this);\n setupContextHandler(this);\n\n this[INITIALIZED] = true;\n\n // One-time (per class) sanity check: a @watch name with no matching\n // @property never fires — surface the typo instead of staying silent.\n validateWatchedProperties(this, constructor);\n\n // Now that the initial value is settled, give @watch immediate handlers\n // their one init call (before the first render, so derived state is ready).\n invokeImmediateWatchers(this, constructor);\n\n if (originalConnectedCallback) {\n originalConnectedCallback.call(this);\n }\n // v4.16.1: Render, run @ready handlers, THEN resolve .ready promise\n // This ensures `await el.ready` waits for both initial render AND all async @ready() methods\n //\n // We await a microtask boundary (to defer render for parent property bindings),\n // then run render + @ready handlers sequentially, then resolve .ready.\n const readyHandlers = constructor[READY_HANDLERS];\n\n // Await one microtask to defer initial render (allows parent property bindings)\n await new Promise<void>(r => queueMicrotask(r));\n\n // If the element was removed during the microtask gap, don't render,\n // don't run @ready on an orphan. Resolve ready so any awaiters don't\n // hang — the element exists, it just isn't in the DOM.\n if (!this.isConnected) {\n if (this[READY_RESOLVE]) {\n this[READY_RESOLVE]();\n this[READY_RESOLVE] = null;\n this[READY_REJECT] = null;\n }\n return;\n }\n\n if (this[RENDER_METHOD]) {\n requestRender(this, true);\n }\n\n // Setup observers after render so shadow DOM content exists\n try {\n setupObservers(this, this);\n } catch (error) {\n console.error(`Error setting up observers for ${this.tagName}:`, error);\n }\n\n // Yield a microtask so child elements' microtask-deferred renders\n // complete before @ready handlers run. Children queued their render\n // microtask when they connected (earlier in the queue), so they\n // drain before this one.\n await new Promise<void>(r => queueMicrotask(r));\n\n // Element may have been removed during the second microtask gap.\n if (!this.isConnected) {\n if (this[READY_RESOLVE]) {\n this[READY_RESOLVE]();\n this[READY_RESOLVE] = null;\n this[READY_REJECT] = null;\n }\n return;\n }\n\n // Run @ready handlers serially, awaiting each\n let readyFailed = false;\n let readyFailure: unknown;\n if (readyHandlers) {\n this[READY_HANDLERS_RUNNING] = true;\n try {\n for (const handler of readyHandlers) {\n try {\n await handler.method.call(this);\n } catch (error) {\n console.error(`Error in @ready handler ${handler.methodName}:`, error);\n if (!readyFailed) {\n readyFailed = true;\n readyFailure = error;\n }\n }\n }\n } finally {\n delete this[READY_HANDLERS_RUNNING];\n }\n }\n\n // NOW settle — render done AND every @ready handler completed. A failed\n // handler rejects the public signal instead of leaving a half-initialized\n // element indistinguishable from a successful one.\n if (readyFailed && this[READY_REJECT]) {\n this[READY_REJECT](readyFailure);\n this[READY_RESOLVE] = null;\n this[READY_REJECT] = null;\n } else if (this[READY_RESOLVE]) {\n this[READY_RESOLVE]();\n this[READY_RESOLVE] = null;\n this[READY_REJECT] = null;\n }\n scheduleAutofocus(this);\n };\n \n constructor.prototype.disconnectedCallback = async function() {\n try {\n disconnectRenderTree(this);\n } catch (error) {\n console.error(`Error disconnecting the render tree for ${this.tagName}:`, error);\n }\n // Call @dispose handlers\n const disposeHandlers = constructor[DISPOSE_HANDLERS];\n if (disposeHandlers) {\n for (const handler of disposeHandlers) {\n try {\n await handler.method.call(this);\n } catch (error) {\n console.error(`Error in @dispose handler ${handler.methodName}:`, error);\n }\n }\n }\n \n // Call original user-defined disconnectedCallback\n if (originalDisconnectedCallback) {\n originalDisconnectedCallback.call(this);\n }\n if (this[CONTROLLER]) {\n detachController(this).catch(error => {\n console.error(`Failed to detach controller:`, error);\n });\n }\n // Cleanup @on event handlers (v2.5.4 compatibility restored!)\n cleanupEventHandlers(this);\n // Cleanup @respond handlers\n cleanupResponseHandlers(this);\n // Cleanup @context handler\n cleanupContextHandler(this);\n // Cleanup @observe observers\n cleanupObservers(this);\n // Cleanup pending @debounce / @throttle timers so they don't fire on a dead element\n clearDebounceTimers(this);\n clearThrottleTimers(this);\n // The render/dispatch debounce-throttle timers live in separate stores.\n // A pending render is replayed on reconnect (same flag the scheduler\n // uses); a pending dispatch is a one-shot signal, so it's dropped.\n if (clearRenderTimers(this)) {\n (this as any)[PENDING_RECONNECT_RENDER] = true;\n }\n clearDispatchTimers(this);\n // @moved / @adopted debounce-throttle timers, likewise dropped so they\n // don't fire on a dead element.\n clearLifecycleTimers(this, MOVED_TIMERS);\n clearLifecycleTimers(this, ADOPTED_TIMERS);\n };\n \n constructor.prototype.attributeChangedCallback = function(name: string, oldValue: string | null, newValue: string | null) {\n originalAttributeChangedCallback?.call(this, name, oldValue, newValue);\n\n if (name === 'controller') {\n // A class attachment reflects its decorator name for DOM diagnostics,\n // but the class reference remains the only attachment authority.\n if (this[CONTROLLER_ATTRIBUTE_SYNC]) return;\n if (this[DIRECT_CONTROLLER]) {\n restoreDirectControllerAttribute(this);\n return;\n }\n this.controller = newValue;\n return;\n }\n\n if (name === 'autofocus') {\n if (newValue === null) resetHostAutofocus(this);\n else if (this[INITIALIZED]) scheduleAutofocus(this);\n }\n\n const properties = constructor[PROPERTIES];\n if (!properties) return;\n\n for (const [propName, propOptions] of properties) {\n const attributeName = getAttrName(propOptions, propName);\n if (attributeName.toLowerCase() !== name.toLowerCase()) continue;\n\n // A property-originated reflection already stored the authoritative\n // JS value. Do not parse the serialized attribute back into a clone.\n if (this[SETTING_FROM_PROPERTY]?.has(name.toLowerCase())) break;\n\n const currentValue = this[PROPERTY_VALUES]?.[propName];\n // A removed attribute reverts the property to its field default. Read it\n // back through the getter (attribute is already gone at this point) so the\n // watcher's newValue and PROPERTY_VALUES match what this[propName] now\n // returns — parseAttributeValue(null) would diverge to null for String/Number.\n const defaultValue = this[PROPERTY_DEFAULTS]?.[propName];\n let parsedValue = newValue === null\n ? (propOptions.type === Boolean ? false : defaultValue)\n : parseAttributeValue(newValue, propOptions, currentValue, defaultValue);\n const wrap = this[PROPERTY_WRAPPERS]?.[propName];\n if (wrap) parsedValue = wrap(parsedValue);\n\n const changed = propOptions?.hasChanged\n ? propOptions.hasChanged(parsedValue, currentValue)\n : notEqual(parsedValue, currentValue);\n if (!changed) break;\n\n ensureSet(this, EXPLICITLY_SET_PROPERTIES).add(propName);\n ensureObj(this, PROPERTY_VALUES)[propName] = parsedValue;\n\n // Watchers react to changes only. During upgrade the initial value\n // is not a change, so suppress until INITIALIZED; @watch immediate\n // handlers get their one init call from invokeImmediateWatchers.\n if (this[INITIALIZED]) {\n invokeWatchers(this, constructor, propName, currentValue, parsedValue);\n }\n\n if (this[RENDER_METHOD] && this[INITIALIZED]) {\n requestRender(this);\n }\n break;\n }\n };\n\n // Add connectedMoveCallback for handling DOM moves\n constructor.prototype.connectedMoveCallback = async function() {\n // Call @moved handlers via the prototype method (the debounce/throttle\n // wrapper), not the raw handler — otherwise @moved({debounce}) options\n // are ignored for real moves and only work when called directly.\n const movedHandlers = constructor[MOVED_HANDLERS];\n if (movedHandlers) {\n for (const handler of movedHandlers) {\n try {\n await (this as any)[handler.methodName]();\n } catch (error) {\n console.error(`Error in @moved handler ${handler.methodName}:`, error);\n }\n }\n }\n };\n\n // Add adoptedCallback for handling document adoption\n constructor.prototype.adoptedCallback = async function() {\n // Call @adopted handlers via the prototype method (the debounce/throttle\n // wrapper), not the raw handler — same reason as connectedMoveCallback.\n const adoptedHandlers = constructor[ADOPTED_HANDLERS];\n if (adoptedHandlers) {\n for (const handler of adoptedHandlers) {\n try {\n await (this as any)[handler.methodName]();\n } catch (error) {\n console.error(`Error in @adopted handler ${handler.methodName}:`, error);\n }\n }\n }\n };\n}\n\n/**\n * Walk the prototype chain and merge parent element metadata into the child.\n * Called once at class definition time — zero per-instance cost.\n * Skips plain HTMLElement (no metadata to merge).\n *\n * Only merges PROPERTIES (stored via context.metadata at decoration time)\n * and formAssociated. Other handler registrations (@watch, @on, @ready, etc.)\n * inherit automatically via TC39 addInitializer — parent initializers run\n * during child instance construction.\n */\nfunction mergeParentMetadata(constructor: any) {\n let parent = Object.getPrototypeOf(constructor);\n\n // Collect ancestors bottom-up, then merge top-down so the deepest parent goes first\n const ancestors: any[] = [];\n while (parent && parent !== HTMLElement && parent !== Function.prototype) {\n ancestors.push(parent);\n parent = Object.getPrototypeOf(parent);\n }\n ancestors.reverse();\n\n for (const ancestor of ancestors) {\n // Properties (Map) — parent first, child overrides\n if (ancestor[PROPERTIES]) {\n if (!constructor[PROPERTIES]) constructor[PROPERTIES] = new Map();\n for (const [key, value] of ancestor[PROPERTIES]) {\n if (!constructor[PROPERTIES].has(key)) {\n constructor[PROPERTIES].set(key, value);\n }\n }\n }\n\n // formAssociated — inherit if parent is form-associated\n if (ancestor.formAssociated && !constructor.formAssociated) {\n constructor.formAssociated = true;\n }\n }\n}\n\nfunction defineElement(tagName: string, constructor: any, context: ClassDecoratorContext, options?: ElementOptions) {\n // Merge metadata from parent @element classes (inheritance support)\n mergeParentMetadata(constructor);\n\n if (context.metadata && (context.metadata as any)[PROPERTIES]) {\n if (!constructor[PROPERTIES]) constructor[PROPERTIES] = new Map();\n for (const [key, value] of (context.metadata as any)[PROPERTIES]) {\n constructor[PROPERTIES].set(key, value);\n }\n } else if (_pendingProperties.length > 0) {\n // Symbol.metadata unavailable — drain the pending stack\n if (!constructor[PROPERTIES]) constructor[PROPERTIES] = new Map();\n const pending = _pendingProperties.pop()!;\n for (const [key, value] of pending) {\n constructor[PROPERTIES].set(key, value);\n }\n }\n if (options?.formAssociated) constructor.formAssociated = true;\n const inheritedOptions = {\n ...((Object.getPrototypeOf(constructor) as any)?.[ELEMENT_OPTIONS] || {})\n } as ElementOptions;\n const ownOptions = options || {};\n if (\n ownOptions.renderRoot === 'light' && typeof ownOptions.shadow === 'string' ||\n ownOptions.renderRoot === 'shadow' && ownOptions.shadow === false\n ) {\n throw new TypeError('snice: @element renderRoot and shadow options select conflicting render roots.');\n }\n const mergedOptions: ElementOptions = { ...inheritedOptions, ...ownOptions };\n if (Object.prototype.hasOwnProperty.call(ownOptions, 'shadow')) {\n mergedOptions.renderRoot = ownOptions.shadow === false ? 'light' : 'shadow';\n } else if (Object.prototype.hasOwnProperty.call(ownOptions, 'renderRoot')) {\n if (ownOptions.renderRoot === 'light') mergedOptions.shadow = false;\n else if (mergedOptions.shadow === false) mergedOptions.shadow = 'open';\n }\n constructor[ELEMENT_OPTIONS] = mergedOptions;\n if (\n (constructor.prototype as any)[SNICE_ELEMENT_BASE] === true &&\n Object.prototype.hasOwnProperty.call(constructor.prototype, 'render') &&\n !Object.prototype.hasOwnProperty.call(constructor.prototype, RENDER_METHOD) &&\n typeof constructor.prototype.render === 'function'\n ) {\n (constructor.prototype as any)[RENDER_METHOD] = constructor.prototype.render;\n (constructor.prototype as any)[RENDER_OPTIONS] = constructor.renderOptions || {};\n }\n applyElementFunctionality(constructor);\n if (customElements.get(tagName)) {\n if ((globalThis as any).SNICE_DEBUG) console.warn(`[snice] \"${tagName}\" is already registered. Skipping.`);\n return constructor;\n }\n customElements.define(tagName, constructor);\n return constructor;\n}\n\nexport function element(tagName: string, options?: ElementOptions) {\n if (options?.renderRoot !== undefined && options.renderRoot !== 'shadow' && options.renderRoot !== 'light') {\n throw new TypeError('snice: @element renderRoot must be \"shadow\" or \"light\".');\n }\n if (\n options?.shadow !== undefined && options.shadow !== false &&\n options.shadow !== 'open' && options.shadow !== 'closed'\n ) {\n throw new TypeError('snice: @element shadow must be \"open\", \"closed\", or false.');\n }\n return function (constructor: any, context: ClassDecoratorContext) {\n return defineElement(tagName, constructor, context, options);\n };\n}\n\nexport function layout(tagName: string) {\n return function (constructor: any, context: ClassDecoratorContext) {\n return defineElement(tagName, constructor, context);\n };\n}\n// Fallback stack for environments where Symbol.metadata is unavailable.\n// @property pushes entries; @element pops them. Works because field decorators\n// run synchronously before the class decorator in the same static block.\nconst _pendingProperties: Map<string, PropertyOptions>[] = [];\nconst nativeOwnPropertyDefaults = new WeakMap<Document, Map<PropertyKey, unknown>>();\n\nfunction isNativeOwnPropertyDefault(instance: any, propertyKey: PropertyKey, value: unknown): boolean {\n const ownerDocument = instance?.ownerDocument as Document | undefined;\n if (!ownerDocument?.createElement) return false;\n let defaults = nativeOwnPropertyDefaults.get(ownerDocument);\n if (!defaults) {\n const nativeElement = ownerDocument.createElement('div') as any;\n defaults = new Map<PropertyKey, unknown>();\n for (const key of Reflect.ownKeys(nativeElement)) defaults.set(key, nativeElement[key]);\n nativeOwnPropertyDefaults.set(ownerDocument, defaults);\n }\n return defaults.has(propertyKey) && Object.is(defaults.get(propertyKey), value);\n}\n\nexport function property(options?: PropertyOptions) {\n return function (_value: any, context: ClassFieldDecoratorContext) {\n const propertyKey = context.name as string;\n // Use metadata to store property information at decoration time\n if (context.metadata) {\n if (!(context.metadata as any)[PROPERTIES]) {\n (context.metadata as any)[PROPERTIES] = new Map();\n }\n (context.metadata as any)[PROPERTIES].set(propertyKey, options || {});\n } else {\n // Symbol.metadata unavailable — use the pending stack instead\n if (_pendingProperties.length === 0) _pendingProperties.push(new Map());\n _pendingProperties[_pendingProperties.length - 1].set(propertyKey, options || {});\n }\n\n\n return function(this: any, initialValue: any) {\n // A property binding can run while this is still an unupgraded custom\n // element, creating an own data property. Preserve that value across the\n // upgrade, but remove the expando before the decorated field initializer\n // is assigned so the assignment replays through the reactive accessor.\n const markedBindings = this[PRE_UPGRADE_PROPERTY_BINDINGS] as Set<string> | undefined;\n const wasTemplateBoundBeforeUpgrade = markedBindings?.delete(propertyKey) === true;\n if (markedBindings?.size === 0) delete this[PRE_UPGRADE_PROPERTY_BINDINGS];\n const hasOwnValue = Object.prototype.hasOwnProperty.call(this, propertyKey);\n const hadPreUpgradeValue = hasOwnValue && (\n wasTemplateBoundBeforeUpgrade || !isNativeOwnPropertyDefault(this, propertyKey, this[propertyKey])\n );\n const preUpgradeValue = hadPreUpgradeValue ? this[propertyKey] : initialValue;\n if (hasOwnValue) delete this[propertyKey];\n\n const constructor = this.constructor as any;\n if (!constructor[PROPERTIES]) constructor[PROPERTIES] = new Map();\n\n const finalOptions: PropertyOptions = { ...options };\n if (!finalOptions.type && initialValue !== undefined) finalOptions.type = detectType(initialValue);\n if (!finalOptions.attributeNaming && constructor.propertyAttributeNaming === 'kebab') {\n finalOptions.attributeNaming = 'kebab';\n }\n constructor[PROPERTIES].set(propertyKey, finalOptions);\n ensureObj(this, PROPERTY_DEFAULTS)[propertyKey] = initialValue;\n\n const notifyDeepMutation = () => {\n if (!this[PROPERTIES_INITIALIZED]) return;\n const current = this[PROPERTY_VALUES]?.[propertyKey];\n\n if (finalOptions.attribute !== false && finalOptions.reflect !== false) {\n const attributeName = getAttrName(finalOptions, propertyKey);\n const attributeValue = valueToAttribute(current, finalOptions, initialValue);\n const attrKey = attributeName.toLowerCase();\n ensureSet(this, SETTING_FROM_PROPERTY).add(attrKey);\n try {\n if (attributeValue === null) this.removeAttribute?.(attributeName);\n else this.setAttribute?.(attributeName, attributeValue);\n } finally {\n this[SETTING_FROM_PROPERTY].delete(attrKey);\n }\n }\n\n if (this[INITIALIZED]) {\n invokeWatchers(this, this.constructor, propertyKey, current, current);\n if (this[RENDER_METHOD]) requestRender(this);\n }\n };\n\n const wrap = (value: any) => {\n if (!finalOptions.deep) return value;\n let wrapped: any;\n wrapped = createDeepReactive(value, () => {\n // A caller may retain an old proxied object after replacing the\n // property. Mutating that detached graph must not invalidate the\n // component or notify watchers for the current value.\n if (this[PROPERTY_VALUES]?.[propertyKey] !== wrapped) return;\n notifyDeepMutation();\n });\n return wrapped;\n };\n ensureObj(this, PROPERTY_WRAPPERS)[propertyKey] = wrap;\n\n const proto = this.constructor.prototype;\n let definers: Map<string, any> | undefined = proto[PROPERTY_DEFINERS];\n if (!definers || !Object.prototype.hasOwnProperty.call(proto, PROPERTY_DEFINERS)) {\n definers = new Map(definers);\n proto[PROPERTY_DEFINERS] = definers;\n }\n const existingDefiner = definers.get(propertyKey);\n if (!existingDefiner || existingDefiner !== options) {\n definers.set(propertyKey, options);\n Object.defineProperty(this.constructor.prototype, propertyKey, {\n get(this: any) {\n if (this[PRE_INIT_PROPERTY_VALUES]?.has(propertyKey)) {\n return this[PRE_INIT_PROPERTY_VALUES].get(propertyKey);\n }\n if (this[PROPERTY_VALUES] && propertyKey in this[PROPERTY_VALUES]) {\n return this[PROPERTY_VALUES][propertyKey];\n }\n return initialValue;\n },\n set(this: any, incomingValue: any) {\n const oldValue = this[propertyKey];\n const changed = finalOptions.hasChanged\n ? finalOptions.hasChanged(incomingValue, oldValue)\n : notEqual(incomingValue, oldValue);\n if (!changed) return;\n\n const instanceWrap = this[PROPERTY_WRAPPERS]?.[propertyKey] || ((value: any) => value);\n // Property assignments are already typed JavaScript values and\n // remain the source of truth. `type` and `converter.fromAttribute`\n // apply only at the string attribute boundary; coercing here would\n // destroy object identity and turn valid union values (for example\n // `Date | ''` or `string | string[]`) into the wrong type.\n const newValue = instanceWrap(incomingValue);\n if (!this[PROPERTIES_INITIALIZED]) {\n if (!this[PRE_INIT_PROPERTY_VALUES]) this[PRE_INIT_PROPERTY_VALUES] = new Map();\n this[PRE_INIT_PROPERTY_VALUES].set(propertyKey, newValue);\n return;\n }\n\n ensureObj(this, PROPERTY_VALUES)[propertyKey] = newValue;\n\n if (finalOptions.attribute !== false && finalOptions.reflect !== false) {\n const attributeName = getAttrName(finalOptions, propertyKey);\n const attributeValue = valueToAttribute(\n newValue,\n finalOptions,\n this[PROPERTY_DEFAULTS]?.[propertyKey]\n );\n ensureSet(this, EXPLICITLY_SET_PROPERTIES).add(propertyKey);\n const attrKey = attributeName.toLowerCase();\n ensureSet(this, SETTING_FROM_PROPERTY).add(attrKey);\n try {\n if (attributeValue === null) this.removeAttribute?.(attributeName);\n else this.setAttribute?.(attributeName, attributeValue);\n } finally {\n this[SETTING_FROM_PROPERTY].delete(attrKey);\n }\n }\n\n if (this[INITIALIZED]) {\n invokeWatchers(this, this.constructor, propertyKey, oldValue, newValue);\n if (this[RENDER_METHOD]) requestRender(this);\n }\n },\n configurable: true,\n enumerable: true\n });\n }\n\n const wrappedInitialValue = wrap(initialValue);\n ensureObj(this, PROPERTY_VALUES)[propertyKey] = wrappedInitialValue;\n ensureObj(this, PROPERTY_DEFAULTS)[propertyKey] = wrappedInitialValue;\n return hadPreUpgradeValue ? preUpgradeValue : wrappedInitialValue;\n };\n };\n}\n\n/** Internal reactive state: never reads from or reflects to an attribute. */\nexport function state(options: StateOptions = {}) {\n return property({ ...options, attribute: false, reflect: false });\n}\n\n\nfunction getQueryRoot(instance: any): any {\n const isController = instance[IS_CONTROLLER_INSTANCE] === true;\n return isController && instance.element ? instance.element : instance;\n}\n\nexport function query(selector: string, options: QueryOptions = {}) {\n return function (_value: any, context: ClassFieldDecoratorContext) {\n const { light = false, shadow = true } = options;\n const propertyKey = context.name as string;\n\n return function(this: any, initialValue: any) {\n if (!Object.hasOwn(this.constructor.prototype, propertyKey)) {\n Object.defineProperty(this.constructor.prototype, propertyKey, {\n get() {\n const root = getQueryRoot(this);\n let result = null;\n const managedRoot = root instanceof HTMLElement ? getRenderRoot(root) : null;\n if (shadow && managedRoot) result = managedRoot.querySelector(selector);\n else if (shadow && root.shadowRoot) result = root.shadowRoot.querySelector(selector);\n if (!result && light) result = root.querySelector(selector);\n return result || null;\n },\n set() {},\n configurable: true,\n enumerable: true\n });\n }\n return initialValue;\n };\n };\n}\n\nexport function queryAll(selector: string, options: QueryOptions = {}) {\n return function (_value: any, context: ClassFieldDecoratorContext) {\n const { light = false, shadow = true } = options;\n const propertyKey = context.name as string;\n\n return function(this: any, initialValue: any) {\n if (!Object.hasOwn(this.constructor.prototype, propertyKey)) {\n Object.defineProperty(this.constructor.prototype, propertyKey, {\n get() {\n const root = getQueryRoot(this);\n const results = new Set<Element>();\n const managedRoot = root instanceof HTMLElement ? getRenderRoot(root) : null;\n if (shadow && managedRoot) {\n for (const match of managedRoot.querySelectorAll(selector)) results.add(match);\n } else if (shadow && root.shadowRoot) {\n for (const match of root.shadowRoot.querySelectorAll(selector)) results.add(match);\n }\n if (light) {\n for (const match of root.querySelectorAll(selector)) results.add(match);\n }\n return [...results] as any as NodeListOf<Element>;\n },\n set() {},\n configurable: true,\n enumerable: true\n });\n }\n return initialValue;\n };\n };\n}\n\n\n\n\n\n\nexport function watch(...args: (string | WatchOptions)[]) {\n // A trailing options object is separated from the watched property names.\n const propertyNames = args.filter((a): a is string => typeof a === 'string');\n const options = args.find((a): a is WatchOptions => typeof a === 'object' && a !== null);\n // Fire on init by default; opt out of the init call with { immediate: false }.\n const immediate = options?.immediate !== false;\n\n return function (target: any, context: ClassMethodDecoratorContext) {\n const methodName = context.name as string;\n\n context.addInitializer(function(this: any) {\n const constructor = this.constructor as any;\n\n // Dedup by (method reference, propertyName) so that multiple @watch\n // decorators on the same method register for each key independently,\n // while still preventing duplicate registration when child classes\n // inherit/override a method with the same name. Use hasOwnProperty so\n // subclasses get their OWN Map — otherwise child pushes into the\n // parent's PROPERTY_WATCHERS via the prototype chain.\n if (!Object.prototype.hasOwnProperty.call(constructor, WATCH_METHODS)) {\n constructor[WATCH_METHODS] = new Map();\n }\n let registered: Set<string> = constructor[WATCH_METHODS].get(target);\n if (!registered) {\n registered = new Set<string>();\n constructor[WATCH_METHODS].set(target, registered);\n }\n\n if (!Object.prototype.hasOwnProperty.call(constructor, PROPERTY_WATCHERS)) {\n // Deep-copy the inherited Map so the child starts with the parent's\n // watchers but pushing to a propertyName's array on the child doesn't\n // mutate the parent's array.\n const inherited: Map<string, any[]> | undefined = constructor[PROPERTY_WATCHERS];\n const copy = new Map<string, any[]>();\n if (inherited) {\n for (const [key, arr] of inherited) copy.set(key, [...arr]);\n }\n constructor[PROPERTY_WATCHERS] = copy;\n }\n\n for (const propertyName of propertyNames) {\n if (registered.has(propertyName)) continue;\n registered.add(propertyName);\n\n if (!constructor[PROPERTY_WATCHERS].has(propertyName)) {\n constructor[PROPERTY_WATCHERS].set(propertyName, []);\n }\n\n constructor[PROPERTY_WATCHERS].get(propertyName).push({\n methodName,\n method: target,\n immediate\n });\n }\n });\n };\n}\n\n/**\n * Decorator that injects router context into a property\n * The context is automatically provided to page components by the router\n */\nexport function context() {\n return function(_value: any, context: ClassFieldDecoratorContext) {\n const propertyKey = context.name as string;\n\n // Return a field initializer function for new decorators\n return function(this: any, initialValue: any) {\n // Set up the property descriptor on first access\n if (!Object.hasOwn(this.constructor.prototype, propertyKey)) {\n const descriptor: PropertyDescriptor = {\n get() {\n // Cached context\n if ((this as any)[ROUTER_CONTEXT] !== undefined) {\n return (this as any)[ROUTER_CONTEXT];\n }\n\n const resolved = getAppContext(this);\n if (resolved === undefined) return undefined;\n\n // Explicit providers may be nested or released, so do not cache a\n // dynamically resolved value. Router-owned context is injected on\n // the instance and returned by the fast path above.\n return resolved;\n },\n set() {\n // Context is read-only\n },\n configurable: true,\n enumerable: true\n };\n\n Object.defineProperty(this.constructor.prototype, propertyKey, descriptor);\n }\n\n return initialValue;\n };\n };\n}\n\nfunction registerHandler(handlersSymbol: symbol, methodsSymbol: symbol, target: any, context: ClassMethodDecoratorContext, extra?: any) {\n const methodName = context.name as string;\n context.addInitializer(function(this: any) {\n const constructor = this.constructor as any;\n // hasOwnProperty guards so subclasses get their OWN Set/array instead of\n // mutating the parent's via the prototype chain.\n if (!Object.prototype.hasOwnProperty.call(constructor, methodsSymbol)) {\n constructor[methodsSymbol] = new Set();\n }\n if (constructor[methodsSymbol].has(target)) return;\n constructor[methodsSymbol].add(target);\n if (!Object.prototype.hasOwnProperty.call(constructor, handlersSymbol)) {\n const inherited = constructor[handlersSymbol];\n constructor[handlersSymbol] = inherited ? [...inherited] : [];\n }\n constructor[handlersSymbol].push({ methodName, method: target, ...extra });\n });\n}\n\nexport function ready() {\n return function (target: any, context: ClassMethodDecoratorContext) {\n registerHandler(READY_HANDLERS, READY_METHODS, target, context);\n };\n}\n\nexport function dispose() {\n return function (target: any, context: ClassMethodDecoratorContext) {\n registerHandler(DISPOSE_HANDLERS, DISPOSE_METHODS, target, context);\n };\n}\n\n/**\n * Fires every time the element is connected AFTER the first connect.\n *\n * `@ready` only fires once (after the initial render). `@dispose` fires on\n * every disconnect. The gap between them is \"what should run on a\n * reconnect?\" For most components, framework-managed pieces (`@on`,\n * `@observe`, `@respond`, `@context`) are re-established automatically\n * and nothing else is needed.\n *\n * Use `@reconnect` only when the component wires its OWN long-lived global\n * subscription in `@ready` (e.g. a `document.addEventListener` for\n * outside-click detection) and tears it down in `@dispose`. The framework\n * doesn't track those, so they need a hook to re-attach on reconnect.\n *\n * Counterpart to `@dispose`. Symmetric.\n */\nexport function reconnect() {\n return function (target: any, context: ClassMethodDecoratorContext) {\n registerHandler(RECONNECT_HANDLERS, RECONNECT_METHODS, target, context);\n };\n}\n\n/**\n * Clear any pending @moved / @adopted debounce/throttle timers on an instance\n * (e.g. on disconnect), so they don't fire on a dead element.\n */\nfunction clearLifecycleTimers(instance: any, timersSymbol: symbol): void {\n const map = instance[timersSymbol];\n if (!map) return;\n\n for (const t of map.values()) {\n if (t.debounceTimer) clearTimeout(t.debounceTimer);\n if (t.throttleTimer) clearTimeout(t.throttleTimer);\n t.debounceTimer = null;\n t.throttleTimer = null;\n t.lastThrottleCall = 0;\n }\n}\n\nfunction createLifecycleDecorator(handlersSymbol: symbol, timersSymbol: symbol, methodsSymbol: symbol) {\n return function (options: any = {}) {\n return function (originalMethod: any, context: ClassMethodDecoratorContext) {\n registerHandler(handlersSymbol, methodsSymbol, originalMethod, context, { options });\n\n const methodName = context.name as string;\n\n return function (this: HTMLElement, ...args: any[]) {\n if (!(this as any)[timersSymbol]) (this as any)[timersSymbol] = new Map();\n if (!(this as any)[timersSymbol].has(methodName)) {\n (this as any)[timersSymbol].set(methodName, { throttleTimer: null, debounceTimer: null, lastThrottleCall: 0 });\n }\n\n const timers = (this as any)[timersSymbol].get(methodName);\n const exec = (...a: any[]) => originalMethod.apply(this, a);\n // Deferred (debounce/throttle) calls run inside a setTimeout, outside\n // the caller's try/catch — so catch their sync throws and async\n // rejections here and log, rather than surface an uncaught error.\n const execDeferred = (...a: any[]) => {\n try {\n const result = originalMethod.apply(this, a);\n if (result && typeof result.then === 'function') {\n (result as Promise<any>).catch((error) =>\n console.error(`Error in deferred lifecycle handler ${methodName}:`, error)\n );\n }\n } catch (error) {\n console.error(`Error in deferred lifecycle handler ${methodName}:`, error);\n }\n };\n\n if (options.debounce > 0) {\n clearTimeout(timers.debounceTimer);\n timers.debounceTimer = setTimeout(() => execDeferred(...args), options.debounce);\n return undefined;\n }\n\n if (options.throttle > 0) {\n const now = Date.now();\n if (timers.lastThrottleCall === 0 || now - timers.lastThrottleCall >= options.throttle) {\n timers.lastThrottleCall = now;\n return exec(...args);\n }\n if (!timers.throttleTimer) {\n const remaining = options.throttle - (now - timers.lastThrottleCall);\n timers.throttleTimer = setTimeout(() => {\n timers.throttleTimer = null;\n timers.lastThrottleCall = Date.now();\n execDeferred(...args);\n }, remaining);\n }\n return undefined;\n }\n\n return exec(...args);\n };\n };\n };\n}\n\nexport const moved = createLifecycleDecorator(MOVED_HANDLERS, MOVED_TIMERS, MOVED_METHODS);\nexport const adopted = createLifecycleDecorator(ADOPTED_HANDLERS, ADOPTED_TIMERS, ADOPTED_METHODS);\n","import { requestRender, renderElementNow } from './render';\nimport { ELEMENT_OPTIONS, SNICE_ELEMENT_BASE } from './symbols';\nimport type { ElementOptions } from './types/element-options';\n\n/**\n * Optional authoring base for convention-driven Snice components.\n *\n * Decorators remain fully supported on plain HTMLElement subclasses. Extending\n * this class adds typed lifecycle promises, imperative invalidation, modern\n * kebab-case implicit attributes, and `render()` / static `styles` conventions.\n */\nexport class SniceElement extends HTMLElement {\n static propertyAttributeNaming: 'kebab' = 'kebab';\n\n protected createRenderRoot(): HTMLElement | ShadowRoot {\n const options = (this.constructor as any)[ELEMENT_OPTIONS] as ElementOptions | undefined;\n const mode = typeof options?.shadow === 'string' ? options.shadow : 'open';\n return this.attachShadow({ mode, delegatesFocus: options?.delegatesFocus });\n }\n\n invalidate(): Promise<void> {\n requestRender(this);\n return this.rendered;\n }\n\n renderNow(): Promise<void> {\n renderElementNow(this);\n return this.rendered;\n }\n}\n\n// Declaration merging exposes lifecycle promises without emitting class fields\n// that could shadow the accessors installed by @element at runtime.\nexport interface SniceElement {\n readonly ready: Promise<void>;\n readonly rendered: Promise<void>;\n}\n\n// `@element` uses this inherited marker to enable render() conventions only\n// for the opt-in base class. Plain HTMLElement components may legitimately\n// have imperative helper methods named render().\nObject.defineProperty(SniceElement.prototype, SNICE_ELEMENT_BASE, { value: true });\n","/*!\n * pica-route v1.1.2\n * A pure URL pattern matching library compatible with route-parser API\n * (c) 2024\n * Released under the MIT License.\n */\nclass Route {\n constructor(pattern) {\n this.parsed = this.parsePattern(pattern);\n }\n get spec() {\n return this.parsed.template;\n }\n parsePattern(pattern) {\n // Handle optional query syntax (?query=:param)\n let pathPattern = pattern;\n let queryPattern = '';\n let queryOptional = false;\n const queryIndex = pattern.indexOf('?');\n if (queryIndex !== -1) {\n pathPattern = pattern.slice(0, queryIndex);\n queryPattern = pattern.slice(queryIndex + 1);\n // Check if query is wrapped in optional syntax (?...)\n if (pathPattern.endsWith('(') && queryPattern.endsWith(')')) {\n queryOptional = true;\n pathPattern = pathPattern.slice(0, -1);\n queryPattern = queryPattern.slice(0, -1);\n }\n }\n return {\n pathSegments: this.parseSegments(pathPattern),\n querySegments: queryPattern ? this.parseQuerySegments(queryPattern) : [],\n queryOptional,\n template: pattern\n };\n }\n parseSegments(pattern) {\n const segments = [];\n let i = 0;\n while (i < pattern.length) {\n const char = pattern[i];\n switch (char) {\n case '(':\n // Parse optional group\n const { segments: optionalSegments, endIndex } = this.parseOptionalGroup(pattern, i);\n segments.push({ type: 'optional', segments: optionalSegments });\n i = endIndex + 1;\n break;\n case ':':\n // Parse parameter\n const { name, endIndex: paramEndIndex } = this.parseIdentifier(pattern, i + 1);\n segments.push({ type: 'param', name });\n i = paramEndIndex;\n break;\n case '*':\n // Parse splat\n const { name: splatName, endIndex: splatEndIndex } = this.parseIdentifier(pattern, i + 1);\n segments.push({ type: 'splat', name: splatName });\n i = splatEndIndex;\n break;\n default:\n // Parse literal text\n const { value, endIndex: literalEndIndex } = this.parseLiteral(pattern, i);\n if (value) {\n segments.push({ type: 'literal', value });\n }\n i = literalEndIndex;\n break;\n }\n }\n return segments;\n }\n parseOptionalGroup(pattern, startIndex) {\n let depth = 1;\n let i = startIndex + 1;\n while (i < pattern.length && depth > 0) {\n if (pattern[i] === '(')\n depth++;\n if (pattern[i] === ')')\n depth--;\n i++;\n }\n const content = pattern.slice(startIndex + 1, i - 1);\n return {\n segments: this.parseSegments(content),\n endIndex: i - 1\n };\n }\n parseIdentifier(pattern, startIndex) {\n let i = startIndex;\n while (i < pattern.length && /[\\w-]/.test(pattern[i])) {\n i++;\n }\n return {\n name: pattern.slice(startIndex, i),\n endIndex: i\n };\n }\n parseLiteral(pattern, startIndex) {\n let i = startIndex;\n while (i < pattern.length && !'(:*('.includes(pattern[i])) {\n i++;\n }\n return {\n value: pattern.slice(startIndex, i),\n endIndex: i\n };\n }\n parseQuerySegments(queryPattern) {\n // Remove optional group syntax wrapping the query\n let cleanPattern = queryPattern;\n if (cleanPattern.startsWith('(') && cleanPattern.endsWith(')')) {\n cleanPattern = cleanPattern.slice(1, -1);\n }\n const segments = [];\n let i = 0;\n while (i < cleanPattern.length) {\n switch (cleanPattern[i]) {\n case ':':\n const { name, endIndex } = this.parseIdentifier(cleanPattern, i + 1);\n segments.push({ type: 'param', name });\n i = endIndex;\n break;\n default:\n const { value, endIndex: literalEndIndex } = this.parseQueryLiteral(cleanPattern, i);\n if (value) {\n segments.push({ type: 'literal', value });\n }\n i = literalEndIndex;\n break;\n }\n }\n return segments;\n }\n parseQueryLiteral(pattern, startIndex) {\n let i = startIndex;\n while (i < pattern.length && pattern[i] !== ':') {\n i++;\n }\n return {\n value: pattern.slice(startIndex, i),\n endIndex: i\n };\n }\n getAllParamNames() {\n const paramNames = new Set();\n const collectParams = (segments) => {\n for (const segment of segments) {\n switch (segment.type) {\n case 'param':\n case 'splat':\n paramNames.add(segment.name);\n break;\n case 'optional':\n collectParams(segment.segments);\n break;\n }\n }\n };\n collectParams(this.parsed.pathSegments);\n collectParams(this.parsed.querySegments);\n return Array.from(paramNames);\n }\n canMatchRemainingSegments(path, startIndex, segments) {\n // Quick check: try to match the remaining segments\n // This is a simplified check - we just look for literal segments that must exist\n let pathIndex = startIndex;\n for (const segment of segments) {\n if (segment.type === 'literal') {\n const literalIndex = path.indexOf(segment.value, pathIndex);\n if (literalIndex === -1) {\n return false; // Required literal not found\n }\n pathIndex = literalIndex + segment.value.length;\n }\n // For optional, param, and splat segments, we're more permissive in this quick check\n }\n return true;\n }\n match(url) {\n const [pathPart, queryPart] = url.split('?');\n const pathParams = this.matchPath(pathPart, this.parsed.pathSegments);\n if (pathParams === false) {\n return false;\n }\n const queryParams = this.matchQuery(queryPart || '', this.parsed.querySegments);\n if (queryParams === false) {\n return false;\n }\n // Initialize result with all optional parameters set to undefined\n const allParams = this.getAllParamNames();\n const result = {};\n // Set all parameters to undefined initially\n for (const paramName of allParams) {\n result[paramName] = undefined;\n }\n // Override with actual matched values\n Object.assign(result, pathParams, queryParams);\n return result;\n }\n matchPath(path, segments) {\n const result = {};\n let pathIndex = 0;\n for (let i = 0; i < segments.length; i++) {\n const segment = segments[i];\n const remainingSegments = segments.slice(i + 1);\n const matchResult = this.matchSegment(path, pathIndex, segment, remainingSegments);\n if (matchResult === false) {\n return false;\n }\n Object.assign(result, matchResult.params);\n pathIndex = matchResult.nextIndex;\n }\n // Check if we've consumed the entire path\n if (pathIndex < path.length) {\n return false;\n }\n return result;\n }\n matchSegment(path, startIndex, segment, remainingSegments = []) {\n switch (segment.type) {\n case 'literal':\n if (path.slice(startIndex, startIndex + segment.value.length) === segment.value) {\n return { params: {}, nextIndex: startIndex + segment.value.length };\n }\n return false;\n case 'param': {\n let endIndex = startIndex;\n // Check if the next segment is a literal and find where it starts\n const nextSegment = remainingSegments[0];\n let stopChars = ['/', '?'];\n if (nextSegment && nextSegment.type === 'literal') {\n // For parameters followed by literals, we need to find where the literal starts\n const literalValue = nextSegment.value;\n const literalStart = path.indexOf(literalValue, startIndex);\n if (literalStart !== -1) {\n endIndex = literalStart;\n }\n else {\n // Literal not found, this parameter can't match\n return false;\n }\n }\n else {\n // Default behavior - stop at / or ?\n while (endIndex < path.length && !stopChars.includes(path[endIndex])) {\n endIndex++;\n }\n }\n if (endIndex === startIndex)\n return false;\n let value;\n try {\n value = decodeURIComponent(path.slice(startIndex, endIndex));\n }\n catch (e) {\n // If decoding fails, use the original value\n value = path.slice(startIndex, endIndex);\n }\n // If we hit a query string, we should reject this match for path parameters\n if (endIndex < path.length && path[endIndex] === '?' && remainingSegments.length > 0) {\n return false;\n }\n // Keep values as strings to match route-parser behavior\n return {\n params: { [segment.name]: value },\n nextIndex: endIndex\n };\n }\n case 'splat': {\n // For splats, we need to find the optimal stopping point by looking ahead\n let endIndex = path.length;\n const nextSegment = remainingSegments[0];\n if (nextSegment) {\n switch (nextSegment.type) {\n case 'literal':\n // For literal dots after splats, use first occurrence (for file extensions)\n // For other literals, use last occurrence\n if (nextSegment.value === '.') {\n const firstDotIndex = path.indexOf('.', startIndex);\n if (firstDotIndex !== -1) {\n endIndex = firstDotIndex;\n }\n }\n else {\n // Find the last occurrence of the next literal\n const literalIndex = path.lastIndexOf(nextSegment.value);\n if (literalIndex !== -1 && literalIndex >= startIndex) {\n endIndex = literalIndex;\n }\n }\n break;\n case 'param':\n // For parameter after splat, find the last slash\n let lastSlashIndex = -1;\n for (let i = path.length - 1; i >= startIndex; i--) {\n if (path[i] === '/') {\n lastSlashIndex = i;\n break;\n }\n }\n if (lastSlashIndex !== -1) {\n endIndex = lastSlashIndex;\n }\n break;\n case 'splat':\n // For consecutive splats, give this splat everything up to the last slash\n // The next splat gets the last component\n let lastSlash = -1;\n for (let i = path.length - 1; i > startIndex; i--) {\n if (path[i] === '/') {\n lastSlash = i + 1; // Include the slash\n break;\n }\n }\n if (lastSlash !== -1) {\n endIndex = lastSlash;\n }\n else {\n // No slash found, this splat gets everything except the last component\n const pathSegments = path.slice(startIndex).split('/').filter(s => s);\n if (pathSegments.length > 1) {\n endIndex = startIndex + pathSegments.slice(0, -1).join('/').length + 1;\n }\n else {\n endIndex = startIndex; // Give nothing to this splat\n }\n }\n break;\n case 'optional':\n // Look for literals inside optional groups\n const findFirstLiteral = (segs) => {\n for (const seg of segs) {\n if (seg.type === 'literal')\n return seg.value;\n if (seg.type === 'optional') {\n const nested = findFirstLiteral(seg.segments);\n if (nested)\n return nested;\n }\n }\n return null;\n };\n const firstLiteral = findFirstLiteral(nextSegment.segments);\n if (firstLiteral) {\n const literalIndex = path.lastIndexOf(firstLiteral);\n if (literalIndex !== -1 && literalIndex >= startIndex) {\n endIndex = literalIndex;\n }\n }\n break;\n }\n }\n // Don't go past query parameters\n const queryIndex = path.indexOf('?', startIndex);\n if (queryIndex !== -1 && queryIndex < endIndex) {\n endIndex = queryIndex;\n }\n let value;\n try {\n value = decodeURIComponent(path.slice(startIndex, endIndex));\n }\n catch (e) {\n // If decoding fails, use the original value\n value = path.slice(startIndex, endIndex);\n }\n return {\n params: { [segment.name]: value },\n nextIndex: endIndex\n };\n }\n case 'optional': {\n // Try to match the optional segment first, with backtracking if needed\n let tempIndex = startIndex;\n let params = {};\n let allMatched = true;\n for (let i = 0; i < segment.segments.length; i++) {\n const innerSegment = segment.segments[i];\n const remainingInner = segment.segments.slice(i + 1);\n const innerResult = this.matchSegment(path, tempIndex, innerSegment, remainingInner);\n if (innerResult === false) {\n allMatched = false;\n break;\n }\n Object.assign(params, innerResult.params);\n tempIndex = innerResult.nextIndex;\n }\n if (allMatched) {\n // Check if the rest of the segments can still be matched\n const canMatchRemaining = this.canMatchRemainingSegments(path, tempIndex, remainingSegments);\n if (canMatchRemaining) {\n return {\n params,\n nextIndex: tempIndex\n };\n }\n }\n // Optional segment either didn't match or would prevent remaining segments from matching\n // So skip it and return to original position\n return { params: {}, nextIndex: startIndex };\n }\n default:\n return false;\n }\n }\n findNextLiteral(segments) {\n for (const segment of segments) {\n if (segment.type === 'literal') {\n return segment;\n }\n else if (segment.type === 'optional') {\n const nested = this.findNextLiteral(segment.segments);\n if (nested)\n return nested;\n }\n }\n return null;\n }\n matchQuery(query, segments) {\n if (segments.length === 0) {\n return {};\n }\n const result = {};\n let queryIndex = 0;\n for (const segment of segments) {\n switch (segment.type) {\n case 'literal':\n if (query.slice(queryIndex, queryIndex + segment.value.length) === segment.value) {\n queryIndex += segment.value.length;\n }\n else {\n return false;\n }\n break;\n case 'param': {\n let endIndex = queryIndex;\n while (endIndex < query.length && query[endIndex] !== '&') {\n endIndex++;\n }\n if (endIndex === queryIndex)\n return false;\n let value;\n try {\n value = decodeURIComponent(query.slice(queryIndex, endIndex));\n }\n catch (e) {\n // If decoding fails, use the original value\n value = query.slice(queryIndex, endIndex);\n }\n result[segment.name] = value;\n queryIndex = endIndex;\n break;\n }\n }\n }\n return result;\n }\n reverse(params = {}) {\n const pathResult = this.reverseSegments(this.parsed.pathSegments, params);\n if (pathResult === false) {\n return false;\n }\n let result = pathResult;\n if (this.parsed.querySegments.length > 0) {\n const queryResult = this.reverseSegments(this.parsed.querySegments, params);\n if (!this.parsed.queryOptional) {\n // Query is required - if it fails, the whole reverse fails\n if (queryResult === false) {\n return false;\n }\n }\n // Add query string if we have a result\n if (queryResult && queryResult !== '') {\n result += '?' + queryResult;\n }\n }\n return result;\n }\n reverseSegments(segments, params, inActivatedStructure = false) {\n let result = '';\n for (let i = 0; i < segments.length; i++) {\n const segment = segments[i];\n const remainingSegments = segments.slice(i + 1);\n switch (segment.type) {\n case 'literal':\n result += segment.value;\n break;\n case 'param':\n case 'splat':\n if (segment.name in params) {\n result += String(params[segment.name]);\n }\n else {\n // Missing required parameter - but for query segments, this might be optional\n return false;\n }\n break;\n case 'optional':\n // Check if this optional group should be included\n // considering dependencies from later optional groups\n const shouldInclude = this.hasAllParams(segment.segments, params, inActivatedStructure) ||\n this.hasLaterOptionalGroupNeedingParams(remainingSegments, params, segment.segments);\n if (shouldInclude) {\n const optionalResult = this.reverseSegments(segment.segments, params, true);\n if (optionalResult === false) {\n return false;\n }\n result += optionalResult;\n }\n break;\n }\n }\n return result;\n }\n // Check if any later optional groups need parameters and would require this group to be included\n hasLaterOptionalGroupNeedingParams(laterSegments, params, currentOptionalSegments) {\n // Check if any later optional group has parameters that are provided\n for (const segment of laterSegments) {\n if (segment.type === 'optional') {\n if (this.hasAnyParamInSegments(segment.segments, params)) {\n // Check if the current optional group only has literals/no required params\n // If so, it should be included as a bridge to the later group\n return this.hasOnlyLiteralsAndOptionals(currentOptionalSegments);\n }\n }\n }\n return false;\n }\n hasOnlyLiteralsAndOptionals(segments) {\n for (const segment of segments) {\n if (segment.type === 'param' || segment.type === 'splat') {\n return false;\n }\n }\n return true;\n }\n hasAllParams(segments, params, inActivatedStructure = false) {\n // Check if we can include this optional group\n let hasDirectParams = false;\n let hasNestedParams = false;\n let missingDirectParam = false;\n let hasOnlyLiteralsAndOptionals = true;\n // First pass: check direct params and literals\n for (const segment of segments) {\n switch (segment.type) {\n case 'param':\n case 'splat':\n hasOnlyLiteralsAndOptionals = false;\n if (segment.name in params && params[segment.name] !== undefined) {\n hasDirectParams = true;\n }\n else {\n missingDirectParam = true;\n }\n break;\n }\n }\n // Determine if this level will be activated and propagate to nested\n const willBeActivated = (hasDirectParams && !missingDirectParam);\n const passToNested = inActivatedStructure || willBeActivated;\n // Second pass: check nested optional groups with correct context\n for (const segment of segments) {\n if (segment.type === 'optional') {\n const shouldIncludeNested = this.hasAllParams(segment.segments, params, passToNested);\n if (shouldIncludeNested) {\n hasNestedParams = true;\n }\n }\n }\n // Include this optional group if:\n // 1. We have all direct parameters needed, OR\n // 2. We have nested parameters and no missing direct parameters, OR\n // 3. We have only literals/optionals and parent was activated\n if (hasDirectParams && !missingDirectParam) {\n return true; // We have all required params for this level\n }\n if (hasNestedParams && !missingDirectParam) {\n return true; // We need this group to reach nested parameters\n }\n // Include literal-only groups in nested structures\n if (hasOnlyLiteralsAndOptionals && inActivatedStructure) {\n return true; // Include literal paths in activated structures\n }\n return false;\n }\n hasOnlyOptionalMissingParams(segments, params) {\n // Check if all missing parameters are in nested optional groups\n for (const segment of segments) {\n switch (segment.type) {\n case 'param':\n case 'splat':\n if (!(segment.name in params)) {\n return false; // Has required missing param\n }\n break;\n }\n }\n return true;\n }\n hasAnyParamInSegments(segments, params) {\n for (const segment of segments) {\n switch (segment.type) {\n case 'param':\n case 'splat':\n if (segment.name in params) {\n return true;\n }\n break;\n case 'optional':\n if (this.hasAnyParamInSegments(segment.segments, params)) {\n return true;\n }\n break;\n }\n }\n return false;\n }\n}\n\nexport { Route, Route as default };\n//# sourceMappingURL=index.esm.js.map\n","/**\n * Score a route pattern by specificity so that more specific routes are tried\n * first. Scoring is per-segment by ROLE, not by string length: a static segment\n * outweighs a dynamic (`:param`) segment, which outweighs a wildcard (`*` /\n * `*name`). So `/post/new` beats `/post/:id`, and a splat always ranks last —\n * regardless of how long the pattern string happens to be. This mirrors the\n * segment-scoring model mainstream routers (React Router, Remix) use.\n *\n * Sort callers descending by this score (highest = most specific = first).\n *\n * NOTE: mirrored in `src/react/route-specificity.ts` for the isolated React\n * bundle — keep the two in sync.\n */\nconst STATIC_SEGMENT = 10;\nconst DYNAMIC_SEGMENT = 3;\nconst WILDCARD_SEGMENT = -2;\n\nexport function routeSpecificity(spec: string): number {\n const segments = spec.split('/').filter(Boolean);\n // Base on segment count so a deeper path outranks a shallower one on ties.\n let score = segments.length;\n\n for (const segment of segments) {\n if (segment.startsWith('*')) {\n score += WILDCARD_SEGMENT;\n } else if (segment.startsWith(':')) {\n score += DYNAMIC_SEGMENT;\n } else {\n score += STATIC_SEGMENT;\n }\n }\n\n return score;\n}\n","/**\n * Generic transition system for animating between elements\n */\n\nimport { Transition, TransitionMode } from './types/transition';\n\n// Re-export Transition type + TransitionMode enum for external consumers\nexport type { Transition };\nexport { TransitionMode };\n\n\n/**\n * Parse CSS property string into an object\n */\nexport function parseStyles(styleString: string): Record<string, string> {\n const styles: Record<string, string> = {};\n styleString.split(';').forEach(rule => {\n const idx = rule.indexOf(':');\n if (idx === -1) return;\n const prop = rule.slice(0, idx).trim();\n const value = rule.slice(idx + 1).trim();\n if (prop && value) {\n styles[prop] = value;\n }\n });\n return styles;\n}\n\n/**\n * Perform a transition between two elements\n */\n\nfunction applyBaseTransitionStyles(el: HTMLElement, isSlotted: boolean, duration: number, prop: string) {\n el.style.position = 'absolute';\n el.style.width = '100%';\n\n if (isSlotted) {\n el.style.height = '100%';\n el.style.transition = `opacity ${duration}ms ease-in-out`;\n return;\n }\n\n el.style.top = '0';\n el.style.left = '0';\n el.style.transition = `${prop} ${duration}ms ease-in-out`;\n}\n\nfunction resetTransitionStyles(el: HTMLElement, isSlotted: boolean) {\n el.style.position = '';\n el.style.width = '';\n el.style.transition = '';\n\n if (isSlotted) {\n el.style.height = '';\n return;\n }\n\n el.style.top = '';\n el.style.left = '';\n}\n\nexport async function performTransition(\n container: Element,\n oldElement: HTMLElement,\n newElement: HTMLElement,\n transition: Transition = {},\n /**\n * Called at each async boundary — if it returns true, this transition has\n * been superseded by a newer navigation. We abort cleanup so we don't tear\n * down elements now owned by the newer transition.\n */\n isStale: () => boolean = () => false,\n): Promise<void> {\n const outDuration = transition.outDuration ?? 300;\n const inDuration = transition.inDuration ?? 300;\n const mode = (transition.mode || 'sequential') as TransitionMode;\n\n const outStyles = transition.out ? parseStyles(transition.out) : { opacity: '0' };\n const inStartStyles = { opacity: '0' };\n const inEndStyles = transition.in ? parseStyles(transition.in) : { opacity: '1' };\n\n const containerStyle = (container as HTMLElement).style;\n const isLayoutElement = container.tagName.includes('-') && container.shadowRoot;\n\n // Track the position we were ORIGINALLY given, not what a concurrent\n // transition may have already written. The first transition to touch this\n // container wins; subsequent overlapping transitions reuse the same value\n // and the last one to finish restores it.\n const POS_KEY = Symbol.for('snice:transition-original-position');\n const POS_COUNT = Symbol.for('snice:transition-count');\n const c = container as any;\n if (!isLayoutElement) {\n if (!(POS_KEY in c)) {\n c[POS_KEY] = containerStyle.position;\n c[POS_COUNT] = 0;\n }\n c[POS_COUNT]++;\n containerStyle.position = 'relative';\n }\n\n const restorePosition = () => {\n if (isLayoutElement) return;\n c[POS_COUNT]--;\n if (c[POS_COUNT] <= 0) {\n containerStyle.position = c[POS_KEY];\n delete c[POS_KEY];\n delete c[POS_COUNT];\n }\n };\n\n const isSlotted = oldElement.hasAttribute('slot') || newElement.hasAttribute('slot');\n\n applyBaseTransitionStyles(oldElement, isSlotted, outDuration, 'all');\n applyBaseTransitionStyles(newElement, isSlotted, inDuration, 'all');\n Object.assign(newElement.style, inStartStyles);\n\n container.appendChild(newElement);\n void newElement.offsetHeight;\n\n // Animate\n switch (mode) {\n case TransitionMode.SIMULTANEOUS:\n Object.assign(oldElement.style, outStyles);\n Object.assign(newElement.style, inEndStyles);\n await new Promise(resolve => setTimeout(resolve, Math.max(outDuration, inDuration)));\n break;\n\n case TransitionMode.SEQUENTIAL:\n Object.assign(oldElement.style, outStyles);\n await new Promise(resolve => setTimeout(resolve, outDuration));\n if (isStale()) {\n if (newElement.parentNode === container) newElement.remove();\n restorePosition();\n return;\n }\n Object.assign(newElement.style, inEndStyles);\n await new Promise(resolve => setTimeout(resolve, inDuration));\n break;\n }\n\n if (isStale()) {\n // A newer navigation took over while we were animating. Don't touch\n // oldElement (the newer transition owns it now) and remove OUR newElement\n // since the newer transition appended its own.\n if (newElement.parentNode === container) newElement.remove();\n restorePosition();\n return;\n }\n\n // Cleanup\n oldElement.remove();\n resetTransitionStyles(newElement, isSlotted);\n\n Object.keys({...inStartStyles, ...inEndStyles}).forEach(prop => {\n newElement.style[prop as any] = '';\n });\n\n restorePosition();\n}\n\n/**\n * Predefined transitions\n */\n\n// Fade transition\nexport const fadeTransition: Transition = {\n name: 'fade',\n outDuration: 200,\n inDuration: 200,\n out: 'opacity: 0',\n in: 'opacity: 1',\n mode: 'simultaneous'\n};\n\n// Slide transition (from left)\nexport const slideTransition: Transition = {\n name: 'slide',\n outDuration: 300,\n inDuration: 300,\n out: 'transform: translateX(-100%)',\n in: 'transform: translateX(0)',\n mode: 'sequential'\n};\n\n// Slide from right\nexport const slideRightTransition: Transition = {\n name: 'slide-right',\n outDuration: 300,\n inDuration: 300,\n out: 'transform: translateX(100%)',\n in: 'transform: translateX(0)',\n mode: 'sequential'\n};\n\n// Slide from top\nexport const slideUpTransition: Transition = {\n name: 'slide-up',\n outDuration: 300,\n inDuration: 300,\n out: 'transform: translateY(-100%)',\n in: 'transform: translateY(0)',\n mode: 'sequential'\n};\n\n// Slide from bottom\nexport const slideDownTransition: Transition = {\n name: 'slide-down',\n outDuration: 300,\n inDuration: 300,\n out: 'transform: translateY(100%)',\n in: 'transform: translateY(0)',\n mode: 'sequential'\n};\n\n// Scale transition\nexport const scaleTransition: Transition = {\n name: 'scale',\n outDuration: 250,\n inDuration: 250,\n out: 'transform: scale(0.9); opacity: 0',\n in: 'transform: scale(1); opacity: 1',\n mode: 'simultaneous'\n};\n\n// Rotate transition\nexport const rotateTransition: Transition = {\n name: 'rotate',\n outDuration: 400,\n inDuration: 400,\n out: 'transform: rotate(180deg) scale(0.5); opacity: 0',\n in: 'transform: rotate(0) scale(1); opacity: 1',\n mode: 'simultaneous'\n};\n\n// Flip transition\nexport const flipTransition: Transition = {\n name: 'flip',\n outDuration: 400,\n inDuration: 400,\n out: 'transform: rotateY(180deg); opacity: 0',\n in: 'transform: rotateY(0); opacity: 1',\n mode: 'sequential'\n};\n\n// Zoom transition\nexport const zoomTransition: Transition = {\n name: 'zoom',\n outDuration: 300,\n inDuration: 300,\n out: 'transform: scale(2); opacity: 0',\n in: 'transform: scale(1); opacity: 1',\n mode: 'simultaneous'\n};\n\n// None transition (instant swap)\nexport const noneTransition: Transition = {\n name: 'none',\n outDuration: 0,\n inDuration: 0,\n out: '',\n in: '',\n mode: 'simultaneous'\n};\n","import { clearDispatchTimers } from './events';\nimport { cleanupEventHandlers, setupEventHandlers } from './on';\nimport { cleanupResponseHandlers, setupResponseHandlers } from './request-response';\nimport { IS_DAEMON_CLASS } from './symbols';\nimport { daemonState, isDaemonInstance } from './daemon-target';\n\n/**\n * Marks an ordinary class as a Snice daemon.\n *\n * The decorator never constructs or globally registers the class. Application\n * code owns every instance and exposes selected instances through an explicit\n * app context.\n */\nexport function daemon<T extends abstract new (...args: any[]) => object>(\n constructor: T,\n _context: ClassDecoratorContext<T>,\n): void {\n Object.defineProperty(constructor.prototype, IS_DAEMON_CLASS, {\n value: true,\n configurable: true,\n });\n}\n\n/** @internal Activates framework-managed communication for a provided daemon. */\nexport function bindDaemon(instance: object): () => void {\n if (!isDaemonInstance(instance)) {\n throw new TypeError('Application contexts may provide only instances of @daemon classes.');\n }\n\n const state = daemonState(instance);\n if (state.bindings === 0) {\n state.active = true;\n try {\n setupEventHandlers(instance, state.target);\n setupResponseHandlers(instance, state.target);\n } catch (error) {\n cleanupResponseHandlers(instance);\n cleanupEventHandlers(instance);\n state.active = false;\n throw error;\n }\n }\n state.bindings += 1;\n\n let released = false;\n return () => {\n if (released) return;\n released = true;\n\n state.bindings = Math.max(0, state.bindings - 1);\n if (state.bindings !== 0) return;\n\n cleanupResponseHandlers(instance);\n cleanupEventHandlers(instance);\n clearDispatchTimers(instance);\n state.active = false;\n\n // Consumers may still hold cleanup records for the old target until their\n // elements disconnect. Rotate the target so released contexts are inert\n // immediately and a later provision starts from a clean event surface.\n state.target = new EventTarget();\n };\n}\n","import { bindDaemon } from './daemon';\nimport { installContextProvider, getContext } from './context-provider';\nimport type { AppContext } from './types/app-context';\n\nfunction bindContextDaemons(context: AppContext): () => void {\n const daemonMap = context.daemons;\n if (daemonMap === undefined) return () => {};\n if (!daemonMap || typeof daemonMap !== 'object' || Array.isArray(daemonMap)) {\n throw new TypeError('AppContext.daemons must be a readonly record of named @daemon instances.');\n }\n\n const releases: Array<() => void> = [];\n const bound = new Set<object>();\n try {\n for (const [name, instance] of Object.entries(daemonMap)) {\n if (!name.trim()) {\n throw new TypeError('AppContext.daemons keys must be non-empty strings.');\n }\n if (!instance || typeof instance !== 'object') {\n throw new TypeError(`AppContext.daemons[\"${name}\"] must be an instance of an @daemon class.`);\n }\n if (bound.has(instance)) continue;\n bound.add(instance);\n releases.push(bindDaemon(instance));\n }\n } catch (error) {\n for (const release of releases.reverse()) release();\n throw error;\n }\n\n return () => {\n for (const release of releases.reverse()) release();\n };\n}\n\n/**\n * Makes one explicit application context visible beneath a root.\n *\n * Daemon instances must already exist in context.daemons. The returned cleanup\n * removes the provider and deactivates framework communication for daemons no\n * longer provided by any context.\n */\nexport function provideContext(root: EventTarget, context: AppContext): () => void {\n const releaseProvider = installContextProvider(root, context);\n let releaseDaemons: (() => void) | undefined;\n try {\n releaseDaemons = bindContextDaemons(context);\n } catch (error) {\n releaseProvider();\n throw error;\n }\n\n let released = false;\n return () => {\n if (released) return;\n released = true;\n releaseProvider();\n releaseDaemons?.();\n };\n}\n\nexport { getContext };\n","import { Route } from 'pica-route';\nimport { routeSpecificity } from './route-specificity';\nimport { applyElementFunctionality } from './element';\nimport { ROUTER_CONTEXT, PAGE_TRANSITION, CREATED_AT, PROPERTIES, CONTEXT_HANDLER, CONTEXT_UPDATE } from './symbols';\nimport { performTransition as performTransitionUtil } from './transitions';\nimport { Transition } from './types/transition';\nimport { RouterOptions } from './types/router-options';\nimport { PageOptions } from './types/page-options';\nimport { Guard } from './types/guard';\nimport { RouteParams } from 'pica-route';\nimport { RouterInstance } from './types/router-instance';\nimport { Placard } from './types/placard';\nimport { AppContext } from './types/app-context';\nimport { Context } from './types/context';\nimport { provideContext } from './app-context';\nimport { hasContextProvider } from './context-provider';\n\n// Router historically allows a later Router instance to take over the same\n// target. Track only Router-owned provider releases so that handoff remains\n// explicit without weakening duplicate protection for public provideContext().\nconst routerContextProviders = new WeakMap<EventTarget, () => void>();\n\n\n/**\n * Possible outcomes from route resolution\n */\nenum RouteResult {\n SUCCESS = 'success',\n GUARDS_FAILED = 'guards-failed',\n NOT_FOUND = 'not-found'\n}\n\n\n/**\n * Creates a new router instance.\n * @param {RouterOptions} options - The router configuration options.\n * @returns An object containing the router's API methods.\n */\nexport function Router(options: RouterOptions): RouterInstance {\n const win = options.window ?? window;\n const doc = options.document ?? document;\n const routes: { route: Route, tag: string, transition?: Transition, guards?: Guard<any> | Guard<any>[], layout?: string | false, placard?: Placard | ((context: AppContext) => Placard) }[] = [];\n let is_sorted = false;\n let placards: Placard[] = []; // Store collected placards\n\n let _404: string; // the 404 page\n let _403: string; // the 403 forbidden page\n let home: string; // the home page\n let currentLayoutName: string | null = null; // Track current layout name\n let currentLayoutTimestamp: number | null = null; // Track current layout timestamp\n const context = options.context || {}; // Store context for guards\n let contextProviderRoot: EventTarget | null = null;\n let releaseContextProvider: (() => void) | null = null;\n\n // Create Context instance for managing router state\n const navigationContext = new Context(context, [], '', {}, options.fetcher);\n\n function ensureContextProvider(target: Element): void {\n if (\n contextProviderRoot === target\n && releaseContextProvider\n && routerContextProviders.get(target) === releaseContextProvider\n ) return;\n\n releaseContextProvider?.();\n routerContextProviders.get(target)?.();\n\n const releaseProvidedContext = provideContext(target, context as AppContext);\n let released = false;\n const release = () => {\n if (released) return;\n released = true;\n releaseProvidedContext();\n if (routerContextProviders.get(target) === release) {\n routerContextProviders.delete(target);\n }\n };\n\n releaseContextProvider = release;\n contextProviderRoot = target;\n routerContextProviders.set(target, release);\n }\n\n function getCurrentLayoutElement(target: Element): HTMLElement | null {\n const noCurrentLayout = !currentLayoutName || !currentLayoutTimestamp;\n if (noCurrentLayout) {\n return null;\n }\n \n const layoutElements = target.querySelectorAll(currentLayoutName!) as NodeListOf<HTMLElement>;\n \n for (const element of layoutElements) {\n const hasTimestamp = (element as any)[CREATED_AT] === currentLayoutTimestamp;\n if (hasTimestamp) {\n return element;\n }\n }\n \n return null;\n }\n\n /**\n * Decorator function for defining a page with associated routes.\n * @param {PageOptions} pageOptions - The page configuration options.\n * @returns A decorator function to apply to a custom element class.\n */\n function page(pageOptions: PageOptions) {\n return function <C extends { new(...args: any[]): HTMLElement }>(constructor: C, context: ClassDecoratorContext) {\n // Transfer metadata from context to constructor (for new decorators)\n if (context?.metadata && (context.metadata as any)[PROPERTIES]) {\n if (!(constructor as any)[PROPERTIES]) {\n (constructor as any)[PROPERTIES] = new Map();\n }\n for (const [key, value] of (context.metadata as any)[PROPERTIES]) {\n (constructor as any)[PROPERTIES].set(key, value);\n }\n }\n\n // Apply all element functionality (properties, queries, watchers, controllers, etc.)\n applyElementFunctionality(constructor);\n \n // Store transition config on constructor for later use\n (constructor as any)[PAGE_TRANSITION] = pageOptions.transition;\n \n // Extend the connectedCallback to add router-specific functionality\n const elementConnectedCallback = constructor.prototype.connectedCallback;\n constructor.prototype.connectedCallback = function() {\n // Store the Context instance for @context decorated methods to access\n (this as any)[CONTEXT_HANDLER] = navigationContext;\n\n // Call the element's connectedCallback first\n elementConnectedCallback?.call(this);\n };\n \n // Extend the disconnectedCallback to clean up router-specific stuff\n const elementDisconnectedCallback = constructor.prototype.disconnectedCallback;\n constructor.prototype.disconnectedCallback = function() {\n // Call element's disconnectedCallback first\n elementDisconnectedCallback?.call(this);\n\n // Clean up context references\n delete (this as any)[ROUTER_CONTEXT];\n delete (this as any)[CONTEXT_HANDLER];\n };\n \n // Define the custom element (skip if already registered)\n if (!win.customElements.get(pageOptions.tag)) {\n win.customElements.define(pageOptions.tag, constructor);\n }\n\n // Register the routes with guards, layout, and placard\n pageOptions.routes.forEach(route => register(route, pageOptions.tag, pageOptions.transition, pageOptions.guards, pageOptions.layout, pageOptions.placard));\n\n return constructor;\n }\n }\n\n /**\n * Registers a new route with the router.\n * @param {string} route - The route path.\n * @param {string} tag - The custom element tag associated with the route.\n * @example\n * register('/custom-route', 'custom-element');\n */\n function register(route: string, tag: string, transition?: Transition, guards?: Guard<any> | Guard<any>[], layout?: string | false, placard?: Placard | ((context: AppContext) => Placard)): void {\n routes.push({ route: new Route(route), tag, transition, guards, layout, placard });\n is_sorted = false;\n\n switch (route) {\n case '/404': _404 = tag; break;\n case '/403': _403 = tag; break;\n case '/': home = tag; break;\n }\n }\n\n function setupEventListeners(): void {\n const handler = () => {\n const target = doc.querySelector(options.target);\n if (!target) return;\n\n // A later Router can explicitly take over the same live root. The old\n // history listener remains installed for backward compatibility, but it\n // must no longer navigate or replace the new owner's app context.\n if (\n contextProviderRoot === target\n && releaseContextProvider\n && routerContextProviders.get(target) !== releaseContextProvider\n ) return;\n\n // Router has no public disposal API and historically leaves its history\n // listener installed. Tests and app shells may replace a target with a\n // new element using the same selector, then initialize a new Router. In\n // that case the old listener must yield to the provider already owning\n // the replacement root instead of stealing it on the next hashchange.\n if (contextProviderRoot !== target && hasContextProvider(target)) {\n releaseContextProvider?.();\n releaseContextProvider = null;\n contextProviderRoot = null;\n return;\n }\n renderPath(getPath());\n };\n\n switch (options.type) {\n case 'hash':\n win.addEventListener('hashchange', handler);\n break;\n case 'pushstate':\n win.addEventListener('popstate', handler);\n break;\n }\n }\n\n /**\n * Initializes the router and sets up navigation event listeners.\n * @example\n * initialize();\n */\n function initialize(): void {\n const target = doc.querySelector(options.target);\n if (!target) {\n throw new Error(`Target element not found: ${options.target}`);\n }\n ensureContextProvider(target);\n\n const needsSorting = !is_sorted;\n if (needsSorting) {\n routes.sort((a: any, b: any) => routeSpecificity(b.route.spec) - routeSpecificity(a.route.spec));\n is_sorted = true;\n }\n\n // Collect placards from registered routes\n collectPlacards();\n\n setupEventListeners();\n\n const path = getPath();\n renderPath(path);\n }\n\n function collectPlacards(): void {\n const seen = new Set<string>();\n placards = routes\n .filter(route => route.placard)\n .map(route => {\n const placard = route.placard!;\n return typeof placard === 'function'\n ? placard(context as AppContext)\n : placard;\n })\n .filter(p => {\n if (seen.has(p.name)) return false;\n seen.add(p.name);\n return true;\n });\n }\n\n // Symbol for storing the navigation context on page elements\n const ROUTER_CONTEXT_SYMBOL = Symbol.for('router-context');\n\n function emitContextUpdate(target: Element, currentPath: string, routeParams: RouteParams): void {\n // Update the navigation context and notify all registered elements\n (navigationContext[CONTEXT_UPDATE] as Function)(context, placards, currentPath, routeParams);\n }\n\n function updateLayout(layoutElement: HTMLElement, currentPath: string, routeParams: RouteParams): void {\n // Check if layout implements the update method\n if (typeof (layoutElement as any).update === 'function') {\n (layoutElement as any).update(context, placards, currentPath, routeParams);\n }\n }\n \n function getPath(): string {\n switch (options.type) {\n case 'hash':\n return win.location.hash.slice(1);\n case 'pushstate':\n return `${win.location.pathname}${win.location.search}`;\n }\n }\n\n function normalizePath(path: string): string {\n const withoutHash = path.trim().replace(/^#/, '');\n if (!withoutHash) return '/';\n return withoutHash.startsWith('/') ? withoutHash : `/${withoutHash}`;\n }\n\n function recordNavigation(path: string): void {\n switch (options.type) {\n case 'hash': {\n const hash = `#${path}`;\n if (win.location.hash !== hash) win.history.pushState(null, '', hash);\n break;\n }\n case 'pushstate': {\n const current = `${win.location.pathname}${win.location.search}`;\n if (current !== path) win.history.pushState(null, '', path);\n break;\n }\n }\n }\n \n function renderForbiddenPage(target: Element): void {\n let newPageElement: HTMLElement;\n\n if (_403) {\n newPageElement = doc.createElement(_403);\n (newPageElement as any)[ROUTER_CONTEXT] = context;\n } else {\n const div = doc.createElement('div');\n div.className = 'default-403';\n div.innerHTML = /*html*/`<h1>403</h1><p>Unauthorized</p>`;\n newPageElement = div;\n }\n\n target.innerHTML = '';\n target.appendChild(newPageElement);\n currentLayoutName = null;\n currentLayoutTimestamp = null;\n }\n\n function createLoadingSpinner(): HTMLElement {\n const container = doc.createElement('div');\n container.setAttribute('data-snice-loading', '');\n container.innerHTML = /*html*/`\n <style>@keyframes snice-spin{to{transform:rotate(360deg)}}</style>\n <div style=\"display:flex;align-items:center;justify-content:center;height:100%;min-height:200px\">\n <div style=\"width:32px;height:32px;border:3px solid rgba(128,128,128,0.3);border-top-color:rgba(128,128,128,0.8);border-radius:50%;animation:snice-spin 0.6s linear infinite\"></div>\n </div>`;\n return container;\n }\n\n async function checkGuards(guards: Guard<any> | Guard<any>[] | undefined, params: RouteParams, target: Element, stale?: () => boolean): Promise<boolean> {\n const hasGuards = !!guards;\n if (!hasGuards) {\n return true;\n }\n\n const guardsArray = Array.isArray(guards) ? guards : [guards];\n let spinner: HTMLElement | null = null;\n let spinnerTimer: ReturnType<typeof setTimeout> | null = null;\n\n // Show spinner after a short delay (avoids flash for fast sync guards).\n // Skip if a newer navigation has already superseded this one.\n spinnerTimer = setTimeout(() => {\n if (stale && stale()) return;\n spinner = createLoadingSpinner();\n target.appendChild(spinner);\n }, 50);\n\n try {\n for (const guard of guardsArray) {\n const allowed = await guard(context, params);\n if (!allowed) {\n // Don't stomp the current page with a 403 if a newer navigation\n // already took over while this guard was resolving.\n if (!stale || !stale()) {\n renderForbiddenPage(target);\n }\n return false;\n }\n }\n return true;\n } finally {\n if (spinnerTimer) clearTimeout(spinnerTimer);\n // @ts-ignore — TS narrows spinner to never because it can't track setTimeout mutations\n if (spinner) spinner.remove();\n }\n }\n\n function createHomeElement(): { element: HTMLElement; transition?: Transition; layout?: string | false } {\n const newPageElement = doc.createElement(home);\n (newPageElement as any)[ROUTER_CONTEXT] = context;\n const constructor = win.customElements.get(home);\n const transition = (constructor as any)?.[PAGE_TRANSITION];\n \n const homeRoute = routes.find(r => r.route.match('/'));\n return { element: newPageElement, transition, layout: homeRoute?.layout };\n }\n\n function create404Element(): { element: HTMLElement; transition?: Transition; layout?: string | false } {\n const has404Page = !!_404;\n \n if (has404Page) {\n const newPageElement = doc.createElement(_404);\n (newPageElement as any)[ROUTER_CONTEXT] = context;\n const constructor = win.customElements.get(_404);\n const transition = (constructor as any)?.[PAGE_TRANSITION];\n return { element: newPageElement, transition, layout: undefined };\n }\n \n const div = doc.createElement('div');\n div.className = 'default-404';\n div.innerHTML = /*html*/`<h1>404</h1><p>Page not found</p>`;\n return { element: div, transition: undefined, layout: undefined };\n }\n\n async function resolveRoute(path: string, target: Element, stale?: () => boolean): Promise<{ result: RouteResult; element?: HTMLElement; transition?: Transition; layout?: string | false; routeParams?: RouteParams }> {\n for (const route of routes) {\n const params = route.route.match(path);\n const isMatch = params !== false;\n if (!isMatch) {\n continue;\n }\n\n const guardsAllowed = await checkGuards(route.guards, params as RouteParams, target, stale);\n if (!guardsAllowed) {\n return { result: RouteResult.GUARDS_FAILED };\n }\n\n const newPageElement = doc.createElement(route.tag);\n (newPageElement as any)[ROUTER_CONTEXT] = context;\n (newPageElement as any)[CONTEXT_HANDLER] = navigationContext;\n const routeParams = params as RouteParams;\n Object.keys(routeParams).forEach(key => newPageElement.setAttribute(key, routeParams[key]));\n\n return { result: RouteResult.SUCCESS, element: newPageElement, transition: route.transition, layout: route.layout, routeParams };\n }\n\n return { result: RouteResult.NOT_FOUND };\n }\n\n function determineLayout(pageLayout: string | false | undefined): string | null {\n const isExplicitlyNoLayout = pageLayout === false;\n if (isExplicitlyNoLayout) {\n return null;\n }\n \n const hasPageLayout = !!pageLayout;\n if (hasPageLayout) {\n return pageLayout;\n }\n \n const hasRouterLayout = !!options.layout;\n if (hasRouterLayout) {\n return options.layout!;\n }\n \n return null;\n }\n\n function setupLayout(layoutToUse: string | null): { element: HTMLElement | null; needsNewLayout: boolean } {\n const needsNewLayout = layoutToUse !== currentLayoutName;\n if (!needsNewLayout) {\n return { element: null, needsNewLayout: false };\n }\n \n currentLayoutName = layoutToUse;\n \n const shouldCreateLayout = !!layoutToUse;\n if (shouldCreateLayout) {\n const timestamp = Date.now();\n currentLayoutTimestamp = timestamp;\n \n const layoutElement = doc.createElement(layoutToUse);\n (layoutElement as any)[ROUTER_CONTEXT] = context;\n (layoutElement as any)[CREATED_AT] = timestamp;\n \n return { element: layoutElement, needsNewLayout: true };\n }\n \n currentLayoutTimestamp = null;\n return { element: null, needsNewLayout: true };\n }\n\n async function renderWithLayout(target: Element, pageElement: HTMLElement, transition: Transition | undefined, layoutElement: HTMLElement | null, needsNewLayout: boolean, currentPath: string, routeParams: RouteParams, stale?: () => boolean): Promise<void> {\n const currentLayout = layoutElement || getCurrentLayoutElement(target);\n if (!currentLayout) {\n return;\n }\n\n // Update layout with current context and placards\n updateLayout(currentLayout, currentPath, routeParams);\n\n const oldPageInLayout = currentLayout.querySelector('[slot=\"page\"]') as HTMLElement | null;\n const shouldTransition = !!(transition && oldPageInLayout);\n\n if (shouldTransition) {\n pageElement.setAttribute('slot', 'page');\n await performTransition(currentLayout, oldPageInLayout!, pageElement, transition!);\n if (stale && stale()) return;\n if (needsNewLayout) {\n target.innerHTML = '';\n target.appendChild(currentLayout);\n }\n return;\n }\n\n // Guard before committing DOM changes.\n if (stale && stale()) return;\n\n const existingPages = currentLayout.querySelectorAll('[slot=\"page\"]');\n existingPages.forEach(page => page.remove());\n pageElement.setAttribute('slot', 'page');\n currentLayout.appendChild(pageElement);\n\n if (needsNewLayout) {\n target.innerHTML = '';\n target.appendChild(currentLayout);\n }\n }\n\n async function renderDirect(target: Element, pageElement: HTMLElement, transition: Transition | undefined, stale?: () => boolean): Promise<void> {\n const currentElementInTarget = target.children[0] as HTMLElement | null;\n const shouldTransition = !!(transition && currentElementInTarget);\n\n if (shouldTransition) {\n await performTransition(target, currentElementInTarget!, pageElement, transition!);\n return;\n }\n\n // Guard against superseded navigation before committing DOM.\n if (stale && stale()) return;\n target.innerHTML = '';\n target.appendChild(pageElement);\n }\n\n async function renderPage(target: Element, pageElement: HTMLElement, transition: Transition | undefined, layout: string | false | undefined, path: string, routeParams: RouteParams, stale?: () => boolean): Promise<void> {\n const layoutToUse = determineLayout(layout);\n const { element: layoutElement, needsNewLayout } = setupLayout(layoutToUse);\n const finalTransition = transition || options.transition;\n\n const hasLayout = layoutElement !== null || getCurrentLayoutElement(target) !== null;\n if (hasLayout) {\n await renderWithLayout(target, pageElement, finalTransition, layoutElement, needsNewLayout, path, routeParams, stale);\n if (stale && stale()) return;\n emitContextUpdate(target, path, routeParams);\n return;\n }\n\n await renderDirect(target, pageElement, finalTransition, stale);\n if (stale && stale()) return;\n emitContextUpdate(target, path, routeParams);\n }\n\n /**\n * Navigates to the specified path.\n * @param {string} path - The path to navigate to.\n * @example\n * navigate('/login');\n */\n let navGeneration = 0;\n async function renderPath(path: string): Promise<void> {\n const target = doc.querySelector(options.target);\n if (!target) {\n throw new Error(`Target element not found: ${options.target}`);\n }\n ensureContextProvider(target);\n\n const myGen = ++navGeneration;\n const stale = () => myGen !== navGeneration;\n\n collectPlacards();\n win.scrollTo(0, 0);\n\n // Home path\n const isHomePath = (path?.trim() === '' || path === '/') && !!home;\n if (isHomePath) {\n const homeRoute = routes.find(r => r.route.match('/'));\n if (!(await checkGuards(homeRoute?.guards, {}, target, stale))) return;\n if (stale()) return;\n const { element, transition, layout } = createHomeElement();\n await renderPage(target, element, transition, layout, path, {}, stale);\n return;\n }\n\n // No path\n if (!path) return;\n\n // Resolve route\n const routeResult = await resolveRoute(path, target, stale);\n if (stale()) return;\n\n // Guards failed (403 already rendered by checkGuards)\n if (routeResult.result === RouteResult.GUARDS_FAILED) return;\n\n // Route matched\n if (routeResult.result === RouteResult.SUCCESS) {\n const { element, transition, layout, routeParams = {} } = routeResult;\n await renderPage(target, element!, transition, layout, path, routeParams, stale);\n return;\n }\n\n // 404 fallthrough\n const { element, transition, layout } = create404Element();\n await renderPage(target, element, transition, layout, path, {}, stale);\n }\n\n async function navigate(path: string): Promise<void> {\n const normalizedPath = normalizePath(path);\n recordNavigation(normalizedPath);\n await renderPath(normalizedPath);\n }\n\n async function performTransition(\n container: Element,\n oldElement: HTMLElement,\n newElement: HTMLElement,\n transition: Transition,\n atGen: number = navGeneration\n ): Promise<void> {\n // `isStale` returns true when a newer navigate() has been kicked off.\n // The transition util checks this at each async boundary and bails so\n // we don't remove an element the newer transition now owns.\n const isStale = () => atGen !== navGeneration;\n return performTransitionUtil(container, oldElement, newElement, transition, isStale);\n }\n\n return {\n page,\n initialize,\n navigate,\n register\n };\n}\n","/**\n * createRequestHandler — vanilla JS utility for handling @request channels\n * outside of the Snice element/controller decorator system.\n *\n * Listens for @request CustomEvents on a target element (or document),\n * performs the discovery/data handshake, and dispatches to your route map.\n *\n * @example\n * ```js\n * import { createRequestHandler } from 'snice';\n *\n * const cleanup = createRequestHandler(document, {\n * 'fetch-user': async (payload) => {\n * const res = await fetch(`/api/users/${payload.id}`);\n * return res.json();\n * },\n * 'save-settings': async (payload) => {\n * await fetch('/api/settings', { method: 'POST', body: JSON.stringify(payload) });\n * return { ok: true };\n * }\n * });\n *\n * // Later, to remove all listeners:\n * cleanup();\n * ```\n */\n\nexport type RequestRoute = (payload: any) => any | Promise<any>;\nexport type RequestRouteMap = Record<string, RequestRoute>;\n\nexport interface CreateRequestHandlerOptions {\n /** If true, the handler will NOT stop propagation, allowing other handlers to also respond. Default: false */\n passive?: boolean;\n}\n\n/**\n * Attach request handlers to a DOM target.\n *\n * @param target The element or document to listen on. Events bubble, so an\n * ancestor element catches requests from any descendant.\n * @param routes Map of channel names to handler functions.\n * @param options Optional configuration.\n * @returns A cleanup function that removes all listeners.\n */\nexport function createRequestHandler(\n target: EventTarget,\n routes: RequestRouteMap,\n options?: CreateRequestHandlerOptions,\n): () => void {\n const cleanups: (() => void)[] = [];\n\n for (const [channelName, handler] of Object.entries(routes)) {\n const eventName = `@request/${channelName}`;\n\n const listener = (event: Event) => {\n const ce = event as CustomEvent;\n const { discovery, data, payload } = ce.detail;\n\n if (!options?.passive) {\n ce.preventDefault();\n ce.stopImmediatePropagation();\n ce.stopPropagation();\n }\n\n // Signal that we found the handler — clears discovery timeout\n discovery.resolve();\n\n // Execute the handler and wire up the data promise\n Promise.resolve()\n .then(() => handler(payload))\n .then((result: any) => data.resolve(result))\n .catch((error: any) => {\n data.reject(error);\n console.error(`createRequestHandler: error in \"${channelName}\" handler:`, error);\n });\n };\n\n target.addEventListener(eventName, listener);\n cleanups.push(() => target.removeEventListener(eventName, listener));\n }\n\n return () => {\n for (const fn of cleanups) fn();\n cleanups.length = 0;\n };\n}\n","/**\n * Template binding helpers for class and style attributes.\n *\n * @example\n * ```typescript\n * html`<div class=\"${classMap({ box: true, 'box--active': this.active })}\"></div>`\n * html`<div style=\"${styleMap({ color: this.color, fontWeight: 'bold' })}\"></div>`\n * ```\n */\n\n/**\n * Build a class string from an object: keys with truthy values are included.\n */\nexport function classMap(classes: Record<string, unknown>): string {\n let out = '';\n for (const name of Object.keys(classes)) {\n if (classes[name]) out += (out ? ' ' : '') + name;\n }\n return out;\n}\n\n/**\n * Build a style string from an object. camelCase keys convert to kebab-case;\n * CSS custom properties (`--token`) pass through unchanged. Entries whose\n * value is null/undefined/false are dropped.\n */\nexport function styleMap(styles: Record<string, unknown>): string {\n const decls: string[] = [];\n for (const key of Object.keys(styles)) {\n const value = styles[key];\n if (value === null || value === undefined || value === false) continue;\n const prop = key.startsWith('--')\n ? key\n : key.replace(/[A-Z]/g, (c) => '-' + c.toLowerCase());\n decls.push(`${prop}: ${value}`);\n }\n return decls.join('; ');\n}\n","/**\n * Custom element readiness utilities\n * Handles waiting for custom elements to be defined with timeout warnings\n */\n\n/**\n * Global flag to disable custom element readiness timeout warnings\n * Set this to true in environments where slow element registration is expected\n */\nexport let DISABLE_ELEMENT_READY_WARNINGS = false;\n\n/**\n * Set whether to disable custom element readiness timeout warnings\n */\nexport function setDisableElementReadyWarnings(value: boolean): void {\n DISABLE_ELEMENT_READY_WARNINGS = value;\n}\n\n/**\n * Default timeout for custom element registration warning (500ms)\n */\nconst DEFAULT_WARNING_TIMEOUT = 500;\n\n/**\n * Wait for a custom element to be defined\n * Logs a warning if it takes longer than the warning timeout\n *\n * @param tagName - The custom element tag name\n * @param warningTimeout - Time in ms before warning (default 500ms)\n * @returns Promise that resolves when element is defined\n */\nexport async function waitForElementDefined(\n tagName: string,\n warningTimeout = DEFAULT_WARNING_TIMEOUT\n): Promise<void> {\n // If already defined, return immediately\n if (customElements.get(tagName)) {\n return;\n }\n\n // Set up warning timer if not disabled\n let warningTimer: any = null;\n if (!DISABLE_ELEMENT_READY_WARNINGS) {\n warningTimer = setTimeout(() => {\n console.warn(\n `Custom element <${tagName}> is taking longer than ${warningTimeout}ms to register. ` +\n `This may indicate a missing import or circular dependency. ` +\n `Set DISABLE_ELEMENT_READY_WARNINGS=true to disable this warning.`\n );\n }, warningTimeout);\n }\n\n try {\n // Wait for element to be defined\n await customElements.whenDefined(tagName);\n } finally {\n // Clear warning timer\n if (warningTimer) {\n clearTimeout(warningTimer);\n }\n }\n}\n\n/**\n * Wait for a custom element to be defined and ready\n * First waits for the element to be registered, then waits for its ready promise\n *\n * @param element - The custom element instance\n * @param warningTimeout - Time in ms before warning about registration (default 500ms)\n * @returns Promise that resolves when element is defined and ready\n */\nexport async function waitForElementReady(\n element: HTMLElement,\n warningTimeout = DEFAULT_WARNING_TIMEOUT\n): Promise<void> {\n const tagName = element.tagName.toLowerCase();\n\n // Wait for element to be defined\n await waitForElementDefined(tagName, warningTimeout);\n\n // Wait for element's ready promise if it exists\n if ('ready' in element && typeof (element as any).ready?.then === 'function') {\n await (element as any).ready;\n }\n}\n\n/**\n * Process all custom elements in a node tree and wait for them to be ready\n * This is useful after inserting a template with custom elements\n *\n * @param node - The root node to scan for custom elements\n * @param warningTimeout - Time in ms before warning about registration (default 500ms)\n * @returns Promise that resolves when all custom elements are ready\n */\nexport async function waitForAllCustomElements(\n node: Node,\n warningTimeout = DEFAULT_WARNING_TIMEOUT\n): Promise<void> {\n const customElements: HTMLElement[] = [];\n\n // Find all custom elements (tag names with hyphens)\n if (node instanceof Element) {\n if (node.tagName.includes('-')) {\n customElements.push(node as HTMLElement);\n }\n\n // Also check in shadow DOM\n if (node.shadowRoot) {\n const shadowCustomElements = node.shadowRoot.querySelectorAll('*');\n shadowCustomElements.forEach(el => {\n if (el.tagName.includes('-')) {\n customElements.push(el as HTMLElement);\n }\n });\n }\n }\n\n // If it's a DocumentFragment, check all children\n if (node instanceof DocumentFragment) {\n const elements = node.querySelectorAll('*');\n elements.forEach(el => {\n if (el.tagName.includes('-')) {\n customElements.push(el as HTMLElement);\n }\n });\n }\n\n // Wait for all custom elements to be ready\n await Promise.all(\n customElements.map(el => waitForElementReady(el, warningTimeout))\n );\n}\n","/**\n * Render debugging utilities for Snice v3.0.0\n * For testing and debugging only - not recommended for production use\n */\n\nimport { RENDER_CALLBACKS } from './symbols';\n\n/**\n * Track renders of an element using an async generator\n * Each call to tracker.next() waits for the next render to complete\n *\n * @example\n * ```typescript\n * const tracker = trackRenders(element);\n *\n * element.someProp = 'new value';\n * await tracker.next(); // Waits for render\n * // DOM is now updated\n *\n * element.someProp = 'another value';\n * await tracker.next(); // Waits for next render\n * // DOM is updated again\n * ```\n *\n * WARNING: For testing/debugging only!\n * - Do not use in production code\n * - The generator yields indefinitely - use it only in controlled test environments\n * - Each yield waits for the next render event\n */\nexport async function* trackRenders(element: HTMLElement): AsyncGenerator<void, void, unknown> {\n while (true) {\n await new Promise<void>(resolve => {\n if (!(element as any)[RENDER_CALLBACKS]) {\n (element as any)[RENDER_CALLBACKS] = [];\n }\n (element as any)[RENDER_CALLBACKS].push(resolve);\n });\n yield;\n }\n}\n","/**\n * Shared body scroll-lock with refcounting.\n *\n * Multiple overlay components (drawer, modal, etc.) can each lock body\n * scroll independently. Without coordination, closing one overlay would\n * unlock scroll while another is still open. This utility increments\n * a module-scope counter on lock, decrements on unlock, and only mutates\n * `document.body.style.overflow` on the 0 ↔ 1 transitions. The original\n * overflow value is captured at the first lock and restored at the last\n * unlock — important because some pages set `overflow: scroll` for layout\n * and a naive `= ''` would clobber it.\n */\n\nlet count = 0;\nlet savedOverflow: string | null = null;\n\n// Test hook — `afterEach` in test suites can call `.clear()` to reset the\n// counter when document.body.innerHTML is wiped. The counter is module-scope,\n// so without this it survives across tests and the second test's first lock\n// would only increment instead of flipping `overflow: hidden`.\nconst TEST_HOOK = Symbol.for('snice:body-scroll-lock');\n(globalThis as any)[TEST_HOOK] = {\n clear() {\n count = 0;\n savedOverflow = null;\n },\n};\n\nexport function lockBodyScroll(): void {\n if (count === 0) {\n savedOverflow = document.body.style.overflow;\n document.body.style.overflow = 'hidden';\n }\n count++;\n}\n\nexport function unlockBodyScroll(): void {\n if (count === 0) return;\n count--;\n if (count === 0) {\n document.body.style.overflow = savedOverflow ?? '';\n savedOverflow = null;\n }\n}\n\n/**\n * Test/debug only — peek at the current refcount.\n */\nexport function getBodyScrollLockCount(): number {\n return count;\n}\n","import type { Context } from './types/context';\n\n/**\n * Middleware for modifying requests before they are sent\n * `this` is bound to the Context instance\n */\nexport type RequestMiddleware = (\n this: Context,\n request: Request,\n next: () => Promise<Response>\n) => Promise<Response>;\n\n/**\n * Middleware for handling responses after they are received\n * `this` is bound to the Context instance\n */\nexport type ResponseMiddleware = (\n this: Context,\n response: Response,\n next: () => Promise<Response>\n) => Promise<Response>;\n\n/**\n * Interface for fetch middleware implementations\n */\nexport interface Fetcher {\n use(type: 'request', middleware: RequestMiddleware): void;\n use(type: 'response', middleware: ResponseMiddleware): void;\n create(ctx: Context): typeof globalThis.fetch;\n}\n\n/**\n * Context-aware fetch implementation with middleware support\n *\n * @example\n * ```typescript\n * const fetcher = new ContextAwareFetcher();\n *\n * fetcher.use('request', function(request, next) {\n * const token = this.application.user?.token;\n * if (token) {\n * request.headers.set('Authorization', `Bearer ${token}`);\n * }\n * return next();\n * });\n *\n * fetcher.use('response', async function(response, next) {\n * if (!response.ok) {\n * throw new Error(`HTTP ${response.status}`);\n * }\n * return next();\n * });\n *\n * const router = Router({\n * target: '#app',\n * context: { user: null },\n * fetcher\n * });\n * ```\n */\nexport class ContextAwareFetcher implements Fetcher {\n private requestMiddlewares: RequestMiddleware[] = [];\n private responseMiddlewares: ResponseMiddleware[] = [];\n\n /**\n * Add middleware to the fetch pipeline\n * @param type - 'request' for pre-fetch middleware, 'response' for post-fetch middleware\n * @param middleware - The middleware function\n */\n use(type: 'request', middleware: RequestMiddleware): void;\n use(type: 'response', middleware: ResponseMiddleware): void;\n use(type: 'request' | 'response', middleware: RequestMiddleware | ResponseMiddleware): void {\n if (type === 'request') {\n this.requestMiddlewares.push(middleware as RequestMiddleware);\n return;\n }\n this.responseMiddlewares.push(middleware as ResponseMiddleware);\n }\n\n /**\n * Create a fetch function bound to the given Context instance\n * @param ctx - The Context instance to bind to\n * @returns A fetch function with middleware applied\n */\n create(ctx: Context): typeof globalThis.fetch {\n const requestMiddlewares = this.requestMiddlewares;\n const responseMiddlewares = this.responseMiddlewares;\n\n const fetchFn = async function(\n this: Context,\n input: RequestInfo | URL,\n init?: RequestInit\n ): Promise<Response> {\n const request = new Request(input, init);\n\n // Request middleware chain\n let reqIndex = 0;\n const nextRequest = async (): Promise<Response> => {\n if (reqIndex < requestMiddlewares.length) {\n const middleware = requestMiddlewares[reqIndex++];\n return middleware.call(this, request, nextRequest);\n }\n\n // Execute actual fetch\n const response = await fetch(request);\n\n // Response middleware chain\n let resIndex = 0;\n const nextResponse = async (): Promise<Response> => {\n if (resIndex < responseMiddlewares.length) {\n const middleware = responseMiddlewares[resIndex++];\n return middleware.call(this, response, nextResponse);\n }\n return response;\n };\n\n return nextResponse();\n };\n\n return nextRequest();\n };\n\n return fetchFn.bind(ctx) as typeof globalThis.fetch;\n }\n}\n","// v3.0.0 exports\nexport { element, layout, property, state, query, queryAll, watch, applyElementFunctionality, ready, dispose, reconnect, moved, adopted } from './element';\nexport type { Layout } from './element';\nexport { SniceElement } from './snice-element';\nexport { context as contextProperty } from './element'; // Deprecated: use @context method decorator instead\nexport { Router } from './router';\nexport { controller, useNativeElementControllers, attachController, detachController, getController } from './controller';\nexport { daemon } from './daemon';\nexport { provideContext, getContext } from './app-context';\nimport { useNativeElementControllers } from './controller';\n\n// Auto-enable native element controllers in browser environments\nif (typeof document !== 'undefined') {\n useNativeElementControllers();\n}\nexport { dispatch } from './events';\nexport { observe } from './observe';\nexport { on } from './on';\nexport type { OnOptions } from './on';\nexport { request, respond } from './request-response';\nexport type { Response } from './request-response';\nexport { createRequestHandler } from './create-request-handler';\nexport type { RequestRoute, RequestRouteMap, CreateRequestHandlerOptions } from './create-request-handler';\nexport { IS_CONTROLLER_INSTANCE, getSymbol } from './symbols';\n\n// v3.0.0 new template system\nexport { html, svg, css, nothing, unsafeHTML } from './template';\nexport type { TemplateResult, CSSResult, Nothing, UnsafeHTML } from './template';\nexport { render, styles, setStrictRenderErrors } from './render';\nexport { noChange, live } from './parts';\nexport type { NoChange } from './parts';\nexport { repeat } from './repeat';\nexport type { RepeatOptions, RepeatResult } from './repeat';\nexport type { RenderOptions } from './render';\nexport { classMap, styleMap } from './template-helpers';\n\n// v3.0.0 custom element readiness utilities\nexport { waitForElementDefined, waitForElementReady, waitForAllCustomElements, setDisableElementReadyWarnings } from './element-ready';\n\n// v3.0.0 render debugging utilities (for testing/debugging only)\nexport { trackRenders } from './render-debug';\n\n// Shared utilities\nexport { parseDuration, escapeHtml, escapeAttr, isSafeUrl } from './utils';\nexport type { Duration } from './utils';\nexport { lockBodyScroll, unlockBodyScroll, getBodyScrollLockCount } from './scroll-lock';\n\n// v3.0.0 method decorators\nexport { debounce, throttle, once, memoize, clearDebounceTimers, clearThrottleTimers, clearMemoizeCache, resetOnce } from './method-decorators';\n\n// Router context decorator (method decorator for receiving router updates)\nexport { context } from './context';\nexport type { ContextOptions } from './context';\n\n// Fetch middleware system\nexport { ContextAwareFetcher } from './fetcher';\nexport type { Fetcher, RequestMiddleware, ResponseMiddleware } from './fetcher';\n\n// Export all types from centralized types module\nexport * from './types';\n\n\n// NOTE: @on decorator works in both elements AND controllers.\n// Supports event delegation, keyboard modifiers, debounce/throttle - see docs/events.md\n// Template event syntax (@click=${handler}) is also available as an alternative.\n"],"names":["TransitionMode","throttle","context","getAppContext","performTransition","performTransitionUtil"],"mappings":";;;;;;;;;;;IAAA;IACA;IAKA;IACA;IACA,IAAI,CAAE,UAAkB,CAAC,KAAK,EAAE;QAC7B,UAAkB,CAAC,KAAK,GAAG;YAC1B,kBAAkB,EAAE,IAAI,GAAG,EAAE;YAC7B,4BAA4B,EAAE,IAAI,GAAG,EAAE;IACvC,QAAA,mBAAmB,EAAE;SACtB;IACH;IAEA;IACC,UAAkB,CAAC,KAAK,CAAC,4BAA4B,KAAK,IAAI,GAAG,EAAE;IAEpE;IACO,MAAM,KAAK,GAAiB,UAAkB,CAAC,KAAK;IAE3D;IACA;IACM,SAAU,SAAS,CAAC,IAAY,EAAA;QACpC,OAAO,MAAM,CAAC,GAAG,CAAC,SAAS,IAAI,CAAA,CAAE,CAAC;IACpC;;IC1BA;IACA;IAMO,MAAM,mBAAmB,GAAG,SAAS,CAAC,qBAAqB,CAAC;UACtD,sBAAsB,GAAG,SAAS,CAAC,wBAAwB;IACjE,MAAM,eAAe,GAAG,SAAS,CAAC,iBAAiB,CAAC;IACpD,MAAM,kBAAkB,GAAG,SAAS,CAAC,oBAAoB,CAAC;IAC1D,MAAM,gBAAgB,GAAG,SAAS,CAAC,kBAAkB,CAAC;IACtD,MAAM,gBAAgB,GAAG,SAAS,CAAC,kBAAkB,CAAC;IAE7D;IACA;IACA;IACO,MAAM,YAAY,GAAG,SAAS,CAAC,cAAc,CAAC;IAErD;IACO,MAAM,aAAa,GAAG,SAAS,CAAC,eAAe,CAAC;IAChD,MAAM,aAAa,GAAG,SAAS,CAAC,eAAe,CAAC;IAChD,MAAM,YAAY,GAAG,SAAS,CAAC,cAAc,CAAC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,GAAG,mBAAmB,CAAC,QAAQ,EAAE,CAAC;4BAClD,OAAO,UAAU,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,EAAE,YAAY,CAAC;wBACtD;IACA,oBAAA,OAAO,QAAQ;IACjB,gBAAA,CAAC;oBAED,OAAO,YAAY,EAAE;IACvB,YAAA,CAAC;gBAED,OAAO,WAAW,EAAE;IACtB,QAAA,CAAC;IAED,QAAA,OAAO,OAAO,CAAC,IAAI,CAAC,GAAG,CAA4B;QACrD;IACD;;IC5HD;IAWA;IACA,IAAI,OAAO,QAAQ,KAAK,WAAW,EAAE;IACnC,IAAA,2BAA2B,EAAE;IAC/B;IAgDA;IACA;IACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","x_google_ignoreList":[25]}
1
+ {"version":3,"file":"index.iife.js","sources":["../src/global.ts","../src/symbols.ts","../src/types/simple-array.ts","../src/types/transition.ts","../src/types/context.ts","../src/utils.ts","../src/observe.ts","../src/context-provider.ts","../src/daemon-target.ts","../src/request-response.ts","../src/keyboard-filter.ts","../src/on.ts","../src/controller.ts","../src/context.ts","../src/template.ts","../src/repeat.ts","../src/render-root.ts","../src/parts.ts","../src/autofocus.ts","../src/render.ts","../src/events.ts","../src/method-decorators.ts","../src/reactive.ts","../src/element.ts","../src/snice-element.ts","../node_modules/pica-route/dist/index.esm.js","../src/route-specificity.ts","../src/transitions.ts","../src/daemon.ts","../src/app-context.ts","../src/router.ts","../src/create-request-handler.ts","../src/template-helpers.ts","../src/element-ready.ts","../src/render-debug.ts","../src/scroll-lock.ts","../src/fetcher.ts","../src/index.ts"],"sourcesContent":["// Global namespace for Snice framework\n// Ensures all registries and symbols are shared across different JS files/modules\n\nimport { SniceGlobal } from './types/snice-global';\n\n\n// Initialize the global Snice namespace on globalThis\n// This ensures all module instances share the same registry\nif (!(globalThis as any).snice) {\n (globalThis as any).snice = {\n controllerRegistry: new Map(),\n pendingControllerAttachments: new Map(),\n controllerIdCounter: 0\n };\n}\n\n// Multiple copies of Snice can share a global created by an older build.\n(globalThis as any).snice.pendingControllerAttachments ??= new Map();\n\n// Export direct reference to globalThis.snice\nexport const snice: SniceGlobal = (globalThis as any).snice;\n\n// Helper function to get or create a global symbol\n// Symbol.for() already guarantees global uniqueness, no need for a Map cache\nexport function getSymbol(name: string): symbol {\n return Symbol.for(`snice:${name}`);\n}\n","// Central file for all symbols used in the framework\n// All symbols are stored globally to ensure consistency across modules\n\nimport { getSymbol } from './global';\n\nexport { getSymbol };\n\nexport const IS_CONTROLLER_CLASS = getSymbol('is-controller-class');\nexport const IS_CONTROLLER_INSTANCE = getSymbol('is-controller-instance');\nexport const IS_DAEMON_CLASS = getSymbol('is-daemon-class');\nexport const IS_DAEMON_INSTANCE = getSymbol('is-daemon-instance');\nexport const IS_ELEMENT_CLASS = getSymbol('is-element-class');\nexport const CHANNEL_HANDLERS = getSymbol('channel-handlers');\n\n// Per-instance daemon communication state. Daemon instances are constructed by\n// application code; Snice only creates and manages their private EventTarget\n// when an app context explicitly provides them.\nexport const DAEMON_STATE = getSymbol('daemon-state');\n\n// Internal element state symbols\nexport const READY_PROMISE = getSymbol('ready-promise');\nexport const READY_RESOLVE = getSymbol('ready-resolve');\nexport const READY_REJECT = getSymbol('ready-reject');\n// True only while an element is executing its own @ready handlers. A\n// controller attached to that same host must not await the promise whose\n// settlement depends on the current handler returning.\nexport const READY_HANDLERS_RUNNING = getSymbol('ready-handlers-running');\nexport const RENDERED_PROMISE = getSymbol('rendered-promise');\nexport const RENDERED_RESOLVE = getSymbol('rendered-resolve');\n// Set when a render is requested but dropped because the element was\n// disconnected; consumed on reconnect to replay exactly the missed render.\nexport const PENDING_RECONNECT_RENDER = getSymbol('pending-reconnect-render');\n// Per-element synchronous render-nesting depth, used to cap runaway re-entry\n// without a shared global counter that one element could exhaust for others.\nexport const RENDER_DEPTH = getSymbol('render-depth');\nexport const RENDER_ROOT = getSymbol('render-root');\nexport const ELEMENT_OPTIONS = getSymbol('element-options');\nexport const CONTROLLER = getSymbol('controller');\nexport const INITIALIZED = getSymbol('initialized');\n\n// Event handler symbols\nexport const ON_HANDLERS = getSymbol('on-handlers');\n\n// Controller symbols\nexport const CONTROLLER_KEY = getSymbol('controller-key');\nexport const CONTROLLER_NAME_KEY = getSymbol('controller-name');\nexport const CONTROLLER_ID = getSymbol('controller-id');\nexport const CONTROLLER_OPERATIONS = getSymbol('controller-operations');\nexport const NATIVE_CONTROLLER = getSymbol('native-controller');\n// Decorator name stored on the class so direct class bindings can expose the\n// same useful DOM label without resolving the controller through the registry.\nexport const CONTROLLER_REGISTRY_NAME = getSymbol('controller-registry-name');\n// Set while a controller CLASS (not a registry name) is attached — the\n// attribute/MutationObserver channel must not attach over or detach it.\nexport const DIRECT_CONTROLLER = getSymbol('direct-controller');\n// Guards framework-authored diagnostic controller attribute writes from the\n// synchronous custom-element attributeChangedCallback path.\nexport const CONTROLLER_ATTRIBUTE_SYNC = getSymbol('controller-attribute-sync');\n// A controller class bound by a template before the custom element was\n// defined/upgraded. Picked up by connectedCallback on first initialization.\nexport const PENDING_CONTROLLER_BINDING = getSymbol('pending-controller-binding');\n\n// Cleanup symbol - holds an object with all cleanup arrays\nexport const CLEANUP = getSymbol('cleanup');\n\n// Property symbols\nexport const PROPERTIES = getSymbol('properties');\nexport const PROPERTY_VALUES = getSymbol('property-values');\nexport const PROPERTY_DEFAULTS = getSymbol('property-defaults');\nexport const PROPERTY_WRAPPERS = getSymbol('property-wrappers');\nexport const PRE_INIT_PROPERTY_VALUES = getSymbol('pre-init-property-values');\nexport const PRE_UPGRADE_PROPERTY_BINDINGS = getSymbol('pre-upgrade-property-bindings');\nexport const PROPERTIES_INITIALIZED = getSymbol('properties-initialized');\nexport const PROPERTY_WATCHERS = getSymbol('property-watchers');\nexport const EXPLICITLY_SET_PROPERTIES = getSymbol('explicitly-set-properties');\n\n// Router context symbol\nexport const ROUTER_CONTEXT = getSymbol('router-context');\nexport const CURRENT_PAGE_MARKER = getSymbol('current-page-marker');\nexport const CONTEXT_REQUEST_HANDLER = getSymbol('context-request-handler');\nexport const PAGE_TRANSITION = getSymbol('page-transition');\nexport const CREATED_AT = getSymbol('created-at');\n\n// Lifecycle symbols\nexport const READY_HANDLERS = getSymbol('ready-handlers');\nexport const DISPOSE_HANDLERS = getSymbol('dispose-handlers');\nexport const RECONNECT_HANDLERS = getSymbol('reconnect-handlers');\nexport const MOVED_HANDLERS = getSymbol('moved-handlers');\nexport const ADOPTED_HANDLERS = getSymbol('adopted-handlers');\n\n// Observer symbols\nexport const OBSERVERS = getSymbol('observers');\n\n// Part symbols\nexport const PARTS = getSymbol('parts');\nexport const PART_TIMERS = getSymbol('part-timers');\n\n// Property setter flag (prevents attributeChangedCallback re-triggering watchers)\nexport const SETTING_FROM_PROPERTY = getSymbol('setting-from-property');\n\n// Lifecycle callback timers\nexport const MOVED_TIMERS = getSymbol('moved-timers');\nexport const ADOPTED_TIMERS = getSymbol('adopted-timers');\n\n// Dispatch timing symbols\nexport const DISPATCH_TIMERS = getSymbol('dispatch-timers');\n\n// Render symbols (v3.0.0)\nexport const RENDER_METHOD = getSymbol('render-method');\nexport const RENDER_OPTIONS = getSymbol('render-options');\nexport const RENDER_INSTANCE = getSymbol('render-instance');\nexport const RENDER_TIMERS = getSymbol('render-timers');\nexport const RENDER_CALLBACKS = getSymbol('render-callbacks');\nexport const STYLES_METHOD = getSymbol('styles-method');\nexport const STYLES_APPLIED = getSymbol('styles-applied');\nexport const PARENT_STYLES_METHODS = getSymbol('parent-styles-methods');\nexport const SNICE_ELEMENT_BASE = getSymbol('snice-element-base');\n\n// Navigation context symbols\nexport const CONTEXT_HANDLER = getSymbol('context-handler');\nexport const CONTEXT_METHOD_NAME = getSymbol('context-method-name');\nexport const NAVIGATION_CONTEXT_INSTANCE = getSymbol('navigation-context-instance');\nexport const REGISTERED_ELEMENTS = getSymbol('registered-elements');\nexport const IS_UPDATING = getSymbol('is-updating');\nexport const CONTEXT_REGISTER = getSymbol('context-register');\nexport const CONTEXT_UNREGISTER = getSymbol('context-unregister');\nexport const CONTEXT_NOTIFY_ELEMENT = getSymbol('context-notify-element');\nexport const CONTEXT_OPTIONS = getSymbol('context-options');\nexport const CONTEXT_TIMER = getSymbol('context-timer');\nexport const CONTEXT_CALLED = getSymbol('context-called');\nexport const CONTEXT_UPDATE = getSymbol('context-update');\n\n// Registration de-dup sets on the constructor — replace previous `__*Methods`\n// expando strings that violated the no-double-underscore rule.\nexport const CONTEXT_METHODS = getSymbol('context-methods');\nexport const WATCH_METHODS = getSymbol('watch-methods');\nexport const OBSERVE_METHODS = getSymbol('observe-methods');\nexport const ON_METHODS = getSymbol('on-methods');\nexport const RESPOND_METHODS = getSymbol('respond-methods');\nexport const READY_METHODS = getSymbol('ready-methods');\nexport const DISPOSE_METHODS = getSymbol('dispose-methods');\nexport const RECONNECT_METHODS = getSymbol('reconnect-methods');\nexport const MOVED_METHODS = getSymbol('moved-methods');\nexport const ADOPTED_METHODS = getSymbol('adopted-methods');\n\n// Controller attach-abort — set to an AbortController while attachController\n// is awaiting element.ready, so detachController can short-circuit the wait.\nexport const CONTROLLER_ABORT = getSymbol('controller-abort');\n// Set on a controller instance once it has gotten past element.ready and is\n// being attached, so detachController knows not to run detach() on a controller\n// whose attach() was aborted before it ever ran.\nexport const CONTROLLER_ATTACHED = getSymbol('controller-attached');\nexport const PROPERTY_DEFINERS = getSymbol('property-definers');\n","/**\n * SimpleArray type for arrays that can be safely reflected to attributes\n * Supports arrays of: string, number, boolean\n * Uses full-width comma (,) as separator to avoid conflicts\n * Strings cannot contain the full-width comma character\n */\nexport class SimpleArray {\n static readonly SEPARATOR = ','; // U+FF0C Full-width comma\n\n /**\n * Serialize array to string for attribute storage\n */\n static serialize(arr: (string | number | boolean)[]): string {\n if (!Array.isArray(arr)) return '';\n\n return arr.map(item => {\n if (typeof item === 'string') {\n // Validate string doesn't contain our separator\n if (item.includes(SimpleArray.SEPARATOR)) {\n throw new Error(`SimpleArray strings cannot contain the character \"${SimpleArray.SEPARATOR}\" (U+FF0C)`);\n }\n return item;\n } else if (typeof item === 'number' || typeof item === 'boolean') {\n return String(item);\n } else {\n throw new Error(`SimpleArray only supports string, number, and boolean types. Got: ${typeof item}`);\n }\n }).join(SimpleArray.SEPARATOR);\n }\n\n /**\n * Parse string from attribute back to array\n */\n static parse(str: string | null): (string | number | boolean)[] {\n if (str === null || str === undefined) return [];\n // Empty string should not be parsed as containing an empty string\n // since empty arrays don't get reflected (handled by the reflection logic)\n if (str === '') return [];\n\n return str.split(SimpleArray.SEPARATOR).map(item => {\n // Try to parse as number\n if (/^-?\\d+\\.?\\d*$/.test(item)) {\n const num = Number(item);\n if (!isNaN(num)) return num;\n }\n\n // Parse as boolean\n if (item === 'true') return true;\n if (item === 'false') return false;\n\n // Default to string\n return item;\n });\n }\n}","/**\n * Generic transition system for animating between elements\n */\n\nexport enum TransitionMode {\n /** out transition completes before in transition starts */\n SEQUENTIAL = 'sequential',\n /** both transitions happen at the same time */\n SIMULTANEOUS = 'simultaneous',\n}\n\nexport interface Transition {\n /**\n * Name of the transition (for identification)\n */\n name?: string;\n\n /**\n * Duration of the out transition in ms\n */\n outDuration?: number;\n\n /**\n * Duration of the in transition in ms\n */\n inDuration?: number;\n\n /**\n * CSS properties for the out transition (as string)\n * Example: 'opacity: 0; transform: scale(0.9)'\n */\n out?: string;\n\n /**\n * CSS properties for the in transition (as string)\n * Example: 'opacity: 1; transform: scale(1)'\n */\n in?: string;\n\n /**\n * Transition mode:\n * - `TransitionMode.SEQUENTIAL` ('sequential'): out transition completes before in transition starts\n * - `TransitionMode.SIMULTANEOUS` ('simultaneous'): both transitions happen at the same time\n */\n mode?: TransitionMode | `${TransitionMode}`;\n}\n","import { AppContext } from './app-context';\nimport { NavContext } from './nav-context';\nimport { Placard } from './placard';\nimport { RouteParams } from './route-params';\nimport { REGISTERED_ELEMENTS, IS_UPDATING, CONTEXT_REGISTER, CONTEXT_UNREGISTER, CONTEXT_NOTIFY_ELEMENT, CONTEXT_UPDATE } from '../symbols';\nimport type { Fetcher } from '../fetcher';\n\n// Symbol for storing the Set of elements\n// Use Symbol.for() to ensure symbols are shared across multiple Snice instances\nconst REGISTERED_ELEMENTS_SET = Symbol.for('snice:registered-elements-set');\n\n// Counter for generating unique context IDs\nlet contextIdCounter = 0;\n\n/**\n * Represents the bundled router state that can notify registered elements of changes\n */\nexport class Context {\n // Stores the SET of wrapped-method names per element so that classes with\n // multiple @context() handlers register every method, not just the last one.\n private [REGISTERED_ELEMENTS] = new WeakMap<HTMLElement, Set<string>>();\n private [REGISTERED_ELEMENTS_SET] = new Set<HTMLElement>();\n private [IS_UPDATING] = false;\n\n /**\n * Unique immutable identifier for this context instance\n */\n readonly id: number;\n\n /**\n * Application context (theme, auth, config, etc.)\n */\n application: AppContext;\n\n /**\n * Navigation state\n */\n navigation: NavContext;\n\n /**\n * Fetch function with optional middleware support\n * Bound to this Context instance, allowing middleware to access application and navigation state\n */\n fetch: typeof globalThis.fetch;\n\n constructor(context: AppContext = {}, placards: Placard[] = [], currentRoute = '', routeParams: RouteParams = {}, fetcher?: Fetcher) {\n this.id = contextIdCounter++;\n this.application = context;\n this.navigation = {\n placards,\n route: currentRoute,\n params: routeParams\n };\n\n // Initialize fetch with middleware support or fallback to native fetch\n if (fetcher && typeof fetcher.create === 'function') {\n this.fetch = fetcher.create(this);\n } else if (typeof fetch === 'function') {\n this.fetch = fetch.bind(this);\n } else {\n throw new Error('No fetch implementation available');\n }\n }\n\n /**\n * Register an element to receive context updates\n * @internal Used by @context decorator\n */\n [CONTEXT_REGISTER](element: HTMLElement, methodName: string): void {\n const map = this[REGISTERED_ELEMENTS] as WeakMap<HTMLElement, Set<string>>;\n let names = map.get(element);\n if (!names) {\n names = new Set<string>();\n map.set(element, names);\n }\n names.add(methodName);\n (this[REGISTERED_ELEMENTS_SET] as Set<HTMLElement>).add(element);\n }\n\n /**\n * Unregister an element from receiving context updates. With a methodName,\n * removes only that one handler (so a `once` handler tearing itself down\n * doesn't kill the element's other @context handlers); without one, removes\n * the element entirely (used on disconnect).\n * @internal Used by @context decorator cleanup\n */\n [CONTEXT_UNREGISTER](element: HTMLElement, methodName?: string): void {\n const map = this[REGISTERED_ELEMENTS] as WeakMap<HTMLElement, Set<string>>;\n\n if (methodName !== undefined) {\n const names = map.get(element);\n if (!names) return;\n names.delete(methodName);\n if (names.size > 0) return; // other handlers remain — keep the element\n }\n\n map.delete(element);\n (this[REGISTERED_ELEMENTS_SET] as Set<HTMLElement>).delete(element);\n }\n\n /**\n * Update the context and notify all registered elements\n * Prevents infinite loops by tracking update state\n * @internal Used by Router during navigation\n */\n [CONTEXT_UPDATE](context: AppContext, placards: Placard[], currentRoute: string, routeParams: RouteParams): void {\n this.application = context;\n this.navigation.placards = placards;\n this.navigation.route = currentRoute;\n this.navigation.params = routeParams;\n this.notify();\n }\n\n /**\n * Signal all @context() subscribers to re-read context\n * Does not modify any state — just notifies listeners with current values\n */\n update(): void {\n this.notify();\n }\n\n private notify(): void {\n // Prevent infinite loops\n if (this[IS_UPDATING]) {\n return;\n }\n\n this[IS_UPDATING] = true;\n\n // Notify all registered elements by calling EVERY registered method\n // name on each. Classes with multiple @context() methods get all fired.\n const elementsSet = this[REGISTERED_ELEMENTS_SET] as Set<HTMLElement>;\n const elementsMap = this[REGISTERED_ELEMENTS] as WeakMap<HTMLElement, Set<string>>;\n\n for (const element of elementsSet) {\n const names = elementsMap.get(element);\n if (!names) continue;\n for (const methodName of names) {\n if (typeof (element as any)[methodName] === 'function') {\n try {\n (element as any)[methodName](this);\n } catch (error) {\n console.error(`Error calling @context method ${methodName}:`, error);\n }\n }\n }\n }\n\n this[IS_UPDATING] = false;\n }\n\n /**\n * Notify a specific element of the current context state\n * @internal Used by @context decorator\n */\n [CONTEXT_NOTIFY_ELEMENT](element: HTMLElement): void {\n const names = (this[REGISTERED_ELEMENTS] as WeakMap<HTMLElement, Set<string>>).get(element);\n if (!names) return;\n for (const methodName of names) {\n if (typeof (element as any)[methodName] === 'function') {\n (element as any)[methodName](this);\n }\n }\n }\n}\n","import { SimpleArray, PropertyOptions } from './types';\nimport { PROPERTY_WATCHERS, PROPERTIES } from './symbols';\n\n/**\n * Detects the type constructor from an initial value\n * @param initialValue - The default value assigned to a property field (e.g., `name = \"default\"` -> \"default\")\n * @returns The constructor function (String, Number, Boolean, etc.) or undefined if type can't be determined\n */\nexport function detectType(initialValue: any): any {\n if (initialValue === null || initialValue === undefined) {\n return undefined;\n }\n\n if (typeof initialValue === 'string') {\n return String;\n }\n\n if (typeof initialValue === 'number') {\n return Number;\n }\n\n if (typeof initialValue === 'boolean') {\n return Boolean;\n }\n\n if (initialValue instanceof Date) {\n return Date;\n }\n\n if (typeof initialValue === 'bigint') {\n return BigInt;\n }\n\n if (Array.isArray(initialValue)) {\n return Array;\n }\n\n return undefined;\n}\n\n/**\n * Parses an attribute value based on the property type\n * @param attributeValue - The raw string value from the HTML attribute (e.g., \"123\", \"true\", \"hello\")\n * @param propertyOptions - The options from @property decorator (contains explicit type, attribute name, etc.)\n * @param currentValue - The current stored value of the property (used for type inference when no explicit type)\n * @param initialValue - The default value assigned to the property field (used for type detection as fallback)\n * @returns The parsed value in the correct JavaScript type\n */\nexport function parseAttributeValue(attributeValue: string | null, propertyOptions: PropertyOptions, currentValue?: any, initialValue?: any): any {\n // Use explicit type or detect from initial value\n const typeToUse = propertyOptions.type || detectType(initialValue);\n\n if (propertyOptions.converter?.fromAttribute) {\n return propertyOptions.converter.fromAttribute(attributeValue, typeToUse);\n }\n\n switch (typeToUse) {\n case Boolean:\n // Boolean semantics per user specification:\n // - No attribute = false\n // - String \"false\" = false\n // - String \"true\" = true\n // - Empty string = true (attribute exists like <element bool-attr>)\n // - Any other value = true\n\n if (attributeValue === null) return false; // No attribute\n if (attributeValue === 'false') return false; // String \"false\"\n\n // All other cases (including empty string) = true (attribute exists)\n return true;\n case Number:\n return attributeValue !== null ? Number(attributeValue) : null;\n case String:\n return attributeValue;\n case Date:\n return attributeValue ? new Date(attributeValue) : null;\n case BigInt:\n if (attributeValue && attributeValue.endsWith('n')) {\n return BigInt(attributeValue.slice(0, -1));\n } else {\n return attributeValue ? BigInt(attributeValue) : null;\n }\n case SimpleArray:\n return SimpleArray.parse(attributeValue);\n case Array:\n try {\n return attributeValue ? JSON.parse(attributeValue) : [];\n } catch {\n return [];\n }\n case Object:\n try {\n return attributeValue ? JSON.parse(attributeValue) : {};\n } catch {\n return {};\n }\n default:\n // If no type specified and can't detect, try to infer from current value type\n if (typeof currentValue === 'number' && attributeValue !== null) {\n return Number(attributeValue);\n } else {\n return attributeValue;\n }\n }\n}\n\n/**\n * Converts a property value to its attribute string representation\n * @param value - The property value to convert\n * @param propertyOptions - The options from @property decorator\n * @param initialValue - The default value assigned to the property field (used for type detection)\n * @returns The string representation for the HTML attribute, or null if value should remove attribute\n */\n/**\n * Default property dirty-check: has the value changed? Like `!==`, but treats\n * NaN → NaN as unchanged (NaN !== NaN would otherwise re-fire forever).\n */\nexport function notEqual(value: unknown, old: unknown): boolean {\n // Changed unless strictly equal, or both are NaN (each self-unequal).\n return value !== old && (value === value || old === old);\n}\n\n/**\n * Extract attribute name from property options\n */\nexport function getAttrName(opts: PropertyOptions, propName: string): string {\n // Lowercase always: the DOM stores attribute names lowercase, so an explicit\n // camelCase `attribute:` would otherwise never match observedAttributes and\n // attributeChangedCallback would never fire. get/setAttribute are already\n // case-insensitive, so this is safe for every caller.\n if (typeof opts.attribute === 'string') return opts.attribute.toLowerCase();\n if (opts.attribute === true || opts.attributeNaming === 'kebab') {\n return propName.replace(/([a-z0-9])([A-Z])/g, '$1-$2').toLowerCase();\n }\n return propName.toLowerCase();\n}\n\n/**\n * Escape HTML text-node content. Use for text that will be interpolated\n * into an HTML string (not an attribute value).\n */\nexport function escapeHtml(value: unknown): string {\n return String(value ?? '')\n .replace(/&/g, '&amp;')\n .replace(/</g, '&lt;')\n .replace(/>/g, '&gt;');\n}\n\n/**\n * Escape HTML attribute value. Use for anything interpolated inside a\n * quoted attribute (e.g. `href=\"${...}\"`). Escapes both quote styles so\n * the value cannot close the attribute or the surrounding tag.\n */\nexport function escapeAttr(value: unknown): string {\n return String(value ?? '')\n .replace(/&/g, '&amp;')\n .replace(/</g, '&lt;')\n .replace(/>/g, '&gt;')\n .replace(/\"/g, '&quot;')\n .replace(/'/g, '&#39;');\n}\n\n/**\n * Validate a URL's scheme against a safe-list. Relative references are\n * accepted after parsing, while absolute and network-path references must\n * resolve to an allowed protocol. Raw ASCII control characters are rejected\n * before parsing so they cannot be stripped out to disguise a scheme.\n *\n * Rejects `javascript:`, `data:`, `vbscript:`, and any scheme not in the\n * allowed set by default. Pass to `window.open`, `iframe.src`, `<a href>`,\n * etc. when the URL originates from user input.\n *\n * @example\n * if (!isSafeUrl(url)) return;\n * window.open(url, '_blank');\n */\nexport function isSafeUrl(\n url: unknown,\n opts: { allowed?: readonly string[] } = {}\n): boolean {\n let raw: string;\n try {\n raw = String(url ?? '');\n } catch {\n return false;\n }\n\n if (!raw || /[\\u0000-\\u001f\\u007f]/.test(raw)) return false;\n const s = raw.trim();\n if (!s) return false;\n const allowed = opts.allowed ?? ['http:', 'https:', 'mailto:', 'tel:'];\n\n try {\n const parsed = new URL(s, 'http://__snice-relative.invalid/');\n const hasExplicitScheme = /^[a-z][a-z\\d+.-]*:/i.test(s);\n const isNetworkPathReference = /^[\\\\/]{2}/.test(s);\n\n // Paths, hashes, and query-only references inherit the embedding page's\n // protocol and are safe independently of the absolute-protocol allowlist.\n if (!hasExplicitScheme && !isNetworkPathReference) return true;\n\n return allowed.some(protocol =>\n typeof protocol === 'string'\n && protocol.toLowerCase() === parsed.protocol\n );\n } catch {\n return false;\n }\n}\n\n/**\n * Duration helper returned by {@link parseDuration}. Exposes the parsed\n * value in multiple units without repeated regex parsing at call sites.\n */\nexport interface Duration {\n milliseconds(): number;\n seconds(): number;\n minutes(): number;\n}\n\n/**\n * Parse a duration string into a unit-aware Duration.\n * Recognized suffixes: `ms` (milliseconds), `s` (seconds), `m` (minutes),\n * `h` (hours). Plain numbers with no suffix are treated as milliseconds.\n * Unparseable input yields a zero-duration.\n *\n * @example\n * parseDuration('200ms').milliseconds() // 200\n * parseDuration('0.4s').milliseconds() // 400\n * parseDuration('0.4s').seconds() // 0.4\n */\nexport function parseDuration(value: string): Duration {\n const v = String(value).trim();\n const num = parseFloat(v);\n let ms: number;\n if (isNaN(num)) {\n ms = 0;\n } else if (/ms$/i.test(v)) {\n ms = num;\n } else if (/s$/i.test(v)) {\n ms = num * 1000;\n } else if (/m$/i.test(v)) {\n ms = num * 60000;\n } else if (/h$/i.test(v)) {\n ms = num * 3600000;\n } else {\n ms = num;\n }\n return {\n milliseconds: () => ms,\n seconds: () => ms / 1000,\n minutes: () => ms / 60000,\n };\n}\n\n/**\n * Lazy-init a Set on a symbol key\n */\nexport function ensureSet<T>(obj: any, sym: symbol): Set<T> {\n if (!obj[sym]) obj[sym] = new Set<T>();\n return obj[sym];\n}\n\n/**\n * Lazy-init an object on a symbol key\n */\nexport function ensureObj(obj: any, sym: symbol): Record<string, any> {\n if (!obj[sym]) obj[sym] = {};\n return obj[sym];\n}\n\n/**\n * Invoke property watchers for a given property change\n */\nexport function invokeWatchers(instance: any, constructor: any, propName: string, oldValue: any, newValue: any): void {\n const watchers = constructor[PROPERTY_WATCHERS];\n if (!watchers) return;\n\n // Look up watchers by the JS property name AND the explicit `attribute:`\n // name (if declared). Lets `@watch('show-dropdown')` match a property\n // declared as `@property({ attribute: 'show-dropdown' }) showDropdown`.\n const keys: string[] = [propName];\n const propOpts = constructor[PROPERTIES]?.get(propName);\n const attrName = propOpts && typeof propOpts.attribute === 'string' ? propOpts.attribute : null;\n if (attrName && attrName !== propName) keys.push(attrName);\n\n for (const key of keys) {\n if (watchers.has(key)) {\n for (const w of watchers.get(key)) {\n try { w.method.call(instance, oldValue, newValue, propName); }\n catch (e) { console.error(`Error in @watch('${key}') method ${w.methodName}:`, e); }\n }\n }\n }\n\n if (watchers.has('*')) {\n for (const w of watchers.get('*')) {\n try { w.method.call(instance, oldValue, newValue, propName); }\n catch (e) { console.error(`Error in @watch('*') method ${w.methodName}:`, e); }\n }\n }\n}\n\n/**\n * Fire the one-time initialization call for `@watch(..., { immediate: true })`\n * handlers. Runs once per declared property after the element is initialized,\n * passing the effective initial value with `oldValue` undefined. Non-immediate\n * watchers are untouched — they only react to later changes.\n */\nexport function invokeImmediateWatchers(instance: any, constructor: any): void {\n const watchers = constructor[PROPERTY_WATCHERS];\n const properties = constructor[PROPERTIES];\n if (!watchers || !properties) return;\n\n for (const [propName, propOptions] of properties) {\n // A watcher may be registered under the JS name, the explicit `attribute:`\n // name, or the `*` wildcard; fire each immediate one exactly once, keyed to\n // this property's current value.\n const keys: string[] = [propName];\n const attrName = propOptions && typeof propOptions.attribute === 'string' ? propOptions.attribute : null;\n if (attrName && attrName !== propName) keys.push(attrName);\n keys.push('*');\n\n for (const key of keys) {\n if (!watchers.has(key)) continue;\n for (const w of watchers.get(key)) {\n if (!w.immediate) continue;\n try { w.method.call(instance, undefined, instance[propName], propName); }\n catch (e) { console.error(`Error in @watch('${key}') method ${w.methodName}:`, e); }\n }\n }\n }\n}\n\n/**\n * Create a debounced version of a function\n */\nexport function createDebounced<T extends (...args: any[]) => any>(fn: T, delay: number): T {\n let timer: ReturnType<typeof setTimeout> | null = null;\n return function(this: any, ...args: any[]) {\n if (timer !== null) clearTimeout(timer);\n timer = setTimeout(() => { fn.apply(this, args); timer = null; }, delay);\n } as T;\n}\n\n/**\n * Create a throttled version of a function (leading + trailing edge)\n */\nexport function createThrottled<T extends (...args: any[]) => any>(fn: T, delay: number): T {\n let lastCall = 0;\n let timer: ReturnType<typeof setTimeout> | null = null;\n return function(this: any, ...args: any[]) {\n const now = Date.now();\n const remaining = delay - (now - lastCall);\n if (remaining <= 0) {\n if (timer) { clearTimeout(timer); timer = null; }\n lastCall = now;\n return fn.apply(this, args);\n }\n if (!timer) {\n timer = setTimeout(() => { lastCall = Date.now(); timer = null; fn.apply(this, args); }, remaining);\n }\n } as T;\n}\n\n/**\n * Resolve a scope option to a concrete EventTarget.\n *\n * - undefined → host element (default behavior)\n * - 'global' → `document`\n * - string → `host.closest(selector)` (nearest matching ancestor)\n * - EventTarget instance → that target directly\n * - resolver function → called with host as `this`, returns target or null\n *\n * Returns null when the scope cannot be resolved (e.g. selector matches no\n * ancestor, resolver returns null). Caller decides how to handle null —\n * typically warn in dev and skip listener attachment.\n */\nexport function resolveScope(host: HTMLElement, scope: unknown): EventTarget | null {\n if (scope === undefined || scope === null) return host;\n if (scope === 'global') return typeof document !== 'undefined' ? document : null;\n if (typeof scope === 'function') {\n try {\n return (scope as (this: HTMLElement) => EventTarget | null).call(host) || null;\n } catch {\n return null;\n }\n }\n if (typeof scope === 'string') {\n return host.closest?.(scope) || null;\n }\n // Direct EventTarget instance.\n if (scope && typeof (scope as EventTarget).addEventListener === 'function') {\n return scope as EventTarget;\n }\n return null;\n}\n\nexport function valueToAttribute(value: any, propertyOptions: PropertyOptions, initialValue?: any): string | null {\n // Handle null/undefined/false values and empty arrays\n if (value === null || value === undefined || value === false ||\n (propertyOptions?.type === SimpleArray && Array.isArray(value) && value.length === 0)) {\n return null;\n }\n\n // Use custom converter if provided\n if (propertyOptions.converter?.toAttribute) {\n return propertyOptions.converter.toAttribute(value, propertyOptions.type);\n }\n\n // Use explicit type or detect from initial value\n const typeToUse = propertyOptions.type || detectType(initialValue);\n\n switch (typeToUse) {\n case Boolean:\n // For boolean attributes, return \"true\" when true\n // (false is already handled above - returns null to remove attribute)\n return 'true';\n case Date:\n return value instanceof Date ? value.toISOString() : String(value);\n case BigInt:\n return typeof value === 'bigint' ? value.toString() + 'n' : String(value);\n case SimpleArray:\n return Array.isArray(value) ? SimpleArray.serialize(value) : String(value);\n case Array:\n return Array.isArray(value) ? JSON.stringify(value) : String(value);\n case Object:\n return typeof value === 'object' && value !== null ? JSON.stringify(value) : String(value);\n default:\n return String(value);\n }\n}\n/**\n * Warn (once per class) about @watch targets that match no @property —\n * such watchers can never fire, and the typo is otherwise silent.\n * Valid targets: property names, their attribute forms, and the '*' wildcard.\n */\nconst validatedWatchClasses = new WeakSet<Function>();\n\nexport function validateWatchedProperties(instance: any, constructor: any): void {\n if (validatedWatchClasses.has(constructor)) return;\n validatedWatchClasses.add(constructor);\n\n const watchers: Map<string, any[]> | undefined = constructor[PROPERTY_WATCHERS];\n if (!watchers || watchers.size === 0) return;\n\n const properties: Map<string, PropertyOptions> | undefined = constructor[PROPERTIES];\n // invokeWatchers matches exactly: the property name, or an EXPLICIT\n // `attribute:` string. A derived/lowercased attribute name is NOT watchable,\n // so it must not be treated as valid here.\n const valid = new Set<string>(['*']);\n if (properties) {\n for (const [name, opts] of properties) {\n valid.add(name);\n if (typeof opts?.attribute === 'string') valid.add(opts.attribute);\n }\n }\n\n for (const key of watchers.keys()) {\n if (valid.has(key)) continue;\n const tag = instance.tagName ? instance.tagName.toLowerCase() : 'element';\n const known = properties ? [...properties.keys()].join(', ') : '(none)';\n console.warn(\n `@watch('${key}') on <${tag}> matches no @property — it will never fire. ` +\n `Known properties: ${known}.`\n );\n }\n}\n","import { OBSERVERS, CLEANUP, IS_CONTROLLER_INSTANCE, OBSERVE_METHODS } from './symbols';\nimport { ObserveOptions } from './types/observe-options';\nimport { createThrottled } from './utils';\n\n\ninterface ObserverMetadata {\n type: string;\n target: string;\n selector?: string;\n methodName: string;\n method: Function;\n options?: ObserveOptions;\n}\n\n// Global cache for MediaQueryList objects\nconst mediaQueryCache = new Map<string, MediaQueryList>();\n\n\n/**\n * Decorator for observing external changes like viewport intersection, resize, media queries, and DOM mutations\n * \n * @param target - The observation target (e.g., 'intersection', 'resize', 'media:(min-width: 768px)', 'mutation:childList') or array of targets\n * @param selectorOrOptions - CSS selector for element to observe OR options object\n * @param options - Options object (when second parameter is a selector)\n */\nexport function observe(observeTarget: string | string[], selectorOrOptions?: string | ObserveOptions, options?: ObserveOptions) {\n // Handle overloaded parameters\n let selector: string | undefined;\n let opts: ObserveOptions | undefined;\n \n if (typeof selectorOrOptions === 'string') {\n selector = selectorOrOptions;\n opts = options;\n } else {\n selector = undefined;\n opts = selectorOrOptions;\n }\n \n return function (target: any, context: ClassMethodDecoratorContext) {\n const propertyKey = context.name as string;\n context.addInitializer(function(this: any) {\n const constructor = this.constructor as any;\n\n // hasOwnProperty guards so subclasses don't mutate parent state via\n // the prototype chain. Without this, instantiating a child pushes into\n // the parent's OBSERVERS array and fires child observers on fresh\n // parent instances.\n if (!Object.prototype.hasOwnProperty.call(constructor, OBSERVE_METHODS)) {\n constructor[OBSERVE_METHODS] = new Set();\n }\n if (constructor[OBSERVE_METHODS].has(target)) return;\n constructor[OBSERVE_METHODS].add(target);\n\n if (!Object.prototype.hasOwnProperty.call(constructor, OBSERVERS)) {\n const inherited = constructor[OBSERVERS];\n constructor[OBSERVERS] = inherited ? [...inherited] : [];\n }\n\n const observeTargets = Array.isArray(observeTarget) ? observeTarget : [observeTarget];\n\n for (const targetString of observeTargets) {\n const [type, ...modifiers] = targetString.split(':');\n const targetStr = modifiers.join(':');\n\n constructor[OBSERVERS].push({\n type,\n target: targetStr,\n selector,\n methodName: propertyKey,\n method: target,\n options: opts\n });\n }\n });\n };\n}\n\n// Helper to setup observers for elements\nexport function setupObservers(instance: any, element: HTMLElement) {\n const observers = instance.constructor[OBSERVERS];\n if (!observers || !Array.isArray(observers) || observers.length === 0) {\n return;\n }\n \n // Initialize cleanup object if needed\n if (!instance[CLEANUP]) {\n instance[CLEANUP] = { events: [], channels: [], observers: [] };\n } else if (!instance[CLEANUP].observers) {\n instance[CLEANUP].observers = [];\n }\n \n for (const observer of observers) {\n const method = observer.method.bind(instance);\n \n // Apply throttling if specified\n const callback = observer.options?.throttle\n ? createThrottled(method, observer.options.throttle)\n : method;\n \n switch (observer.type) {\n case 'intersection':\n setupIntersectionObserver(instance, element, observer, callback);\n break;\n case 'resize':\n setupResizeObserver(instance, element, observer, callback);\n break;\n case 'media':\n setupMediaQueryObserver(instance, element, observer, callback);\n break;\n case 'mutation':\n setupMutationObserver(instance, element, observer, callback);\n break;\n default:\n console.warn(`Unknown observer type: ${observer.type}`);\n }\n }\n}\n\nfunction setupIntersectionObserver(\n instance: any, \n element: HTMLElement, \n observer: ObserverMetadata, \n callback: Function\n) {\n const options: IntersectionObserverInit = {\n threshold: observer.options?.threshold ?? 0,\n rootMargin: observer.options?.rootMargin ?? '0px',\n root: observer.options?.root ?? null\n };\n \n // Wrap callback to handle return value\n const wrappedCallback = (entries: IntersectionObserverEntry[]) => {\n for (const entry of entries) {\n try {\n const result = callback(entry);\n if (result === false && io) {\n io.unobserve(entry.target);\n }\n } catch (error) {\n console.error(`Error in intersection observer ${observer.methodName}:`, error);\n }\n }\n };\n\n if (typeof IntersectionObserver === 'undefined') {\n console.warn('IntersectionObserver is not available in this environment');\n return;\n }\n\n const io = new IntersectionObserver(wrappedCallback, options);\n \n // Find target elements\n const targets = observer.selector \n ? Array.from(element.shadowRoot?.querySelectorAll(observer.selector) || [])\n : [element];\n \n // Start observing\n targets.forEach(target => io!.observe(target));\n \n // Store cleanup\n instance[CLEANUP].observers.push(() => {\n targets.forEach(target => io!.unobserve(target));\n // Only disconnect if no more targets\n if (io!.takeRecords().length === 0) {\n io!.disconnect();\n }\n });\n}\n\nfunction setupResizeObserver(\n instance: any, \n element: HTMLElement, \n observer: ObserverMetadata, \n callback: Function\n) {\n const box = observer.options?.box || 'content-box';\n \n // Wrap callback with error handling\n const wrappedCallback = (entries: ResizeObserverEntry[]) => {\n for (const entry of entries) {\n try {\n callback(entry);\n } catch (error) {\n console.error(`Error in resize observer ${observer.methodName}:`, error);\n }\n }\n };\n \n // Check if ResizeObserver is available\n if (typeof ResizeObserver === 'undefined') {\n console.warn('ResizeObserver is not available in this environment');\n return;\n }\n \n // Create ResizeObserver\n const ro = new ResizeObserver(wrappedCallback);\n \n // Find target elements\n const targets = observer.selector \n ? Array.from(element.shadowRoot?.querySelectorAll(observer.selector) || [])\n : [element];\n \n // Start observing with options\n targets.forEach(target => {\n ro.observe(target, { box });\n });\n \n // Store cleanup\n instance[CLEANUP].observers.push(() => {\n ro.disconnect();\n });\n}\n\nfunction setupMediaQueryObserver(\n instance: any, \n _element: HTMLElement, \n observer: ObserverMetadata, \n callback: Function\n) {\n // Extract media query from target (e.g., \"media:(min-width: 768px)\" -> \"(min-width: 768px)\")\n const mediaQuery = observer.target;\n \n if (!mediaQuery) {\n console.warn('Media query observer requires a query string');\n return;\n }\n \n // Get or create MediaQueryList (cached globally)\n let mql = mediaQueryCache.get(mediaQuery);\n if (!mql) {\n try {\n mql = window.matchMedia(mediaQuery);\n mediaQueryCache.set(mediaQuery, mql);\n } catch (error) {\n console.error(`Invalid media query: ${mediaQuery}`, error);\n return;\n }\n }\n \n // Wrap callback with error handling\n const wrappedCallback = (event: MediaQueryListEvent | MediaQueryList) => {\n try {\n callback('matches' in event ? event.matches : (event as MediaQueryListEvent).matches);\n } catch (error) {\n console.error(`Error in media query observer ${observer.methodName}:`, error);\n }\n };\n \n // Call immediately with current state\n wrappedCallback(mql);\n \n // Listen for changes\n const changeHandler = (e: MediaQueryListEvent) => wrappedCallback(e);\n \n // Modern browsers use addEventListener\n if (mql.addEventListener) {\n mql.addEventListener('change', changeHandler);\n instance[CLEANUP].observers.push(() => {\n mql!.removeEventListener('change', changeHandler);\n });\n } else {\n // Fallback for older browsers\n mql.addListener(changeHandler);\n instance[CLEANUP].observers.push(() => {\n mql!.removeListener(changeHandler);\n });\n }\n}\n\nfunction setupMutationObserver(\n instance: any, \n element: HTMLElement, \n observer: ObserverMetadata, \n callback: Function\n) {\n // Parse mutation type and attribute from target\n // e.g., \"childList\", \"attributes:class\", \"attributes:data-state\"\n const parts = observer.target.split(':');\n const mutationType = parts[0] || 'childList';\n const attributeName = parts[1];\n \n // Build MutationObserver options\n const options: MutationObserverInit = {};\n \n switch (mutationType) {\n case 'childList':\n options.childList = true;\n break;\n case 'attributes':\n options.attributes = true;\n if (attributeName) {\n options.attributeFilter = [attributeName];\n }\n break;\n default: {\n // A leading . # or [ means the author put a CSS selector where the\n // mutation type goes — point at the correct two-argument form.\n if (/^[.#[]/.test(mutationType)) {\n console.warn(\n `@observe: \"mutation:${mutationType}\" — \"${mutationType}\" looks like a selector. ` +\n `Selectors are the second argument — did you mean ` +\n `@observe('mutation:childList', '${mutationType}')?`\n );\n } else {\n console.warn(`Unknown mutation type: ${mutationType} (expected childList or attributes)`);\n }\n return;\n }\n }\n \n // Apply subtree with safety limits\n if (observer.options?.subtree) {\n options.subtree = true;\n // Could implement maxDepth checking in the callback\n if (observer.options.maxDepth) {\n console.warn('maxDepth is set but requires custom implementation');\n }\n }\n \n // Wrap callback with error handling and optional depth filtering\n const needsDepthFilter = !!(observer.options?.maxDepth && observer.options.subtree);\n const wrappedCallback = (mutations: MutationRecord[]) => {\n try {\n if (!needsDepthFilter) {\n callback(mutations);\n return;\n }\n\n const maxDepth = observer.options!.maxDepth!;\n const root = element.shadowRoot || element;\n const filtered = mutations.filter(mutation => {\n let depth = 0;\n let current = mutation.target as Node;\n while (current && current !== root && depth < maxDepth) {\n current = current.parentNode!;\n depth++;\n }\n return depth < maxDepth;\n });\n\n if (filtered.length > 0) callback(filtered);\n } catch (error) {\n console.error(`Error in mutation observer ${observer.methodName}:`, error);\n }\n };\n \n // Create MutationObserver\n const mo = new MutationObserver(wrappedCallback);\n \n // Find target elements\n const isController = instance[IS_CONTROLLER_INSTANCE] === true;\n \n // For mutation observers without selector:\n // - Controllers: observe the shadow DOM of the element they're attached to (if it exists)\n // - Elements: observe the element itself (light DOM) to avoid infinite loops\n const targets = observer.selector \n ? Array.from(element.shadowRoot?.querySelectorAll(observer.selector) || [])\n : isController && element.shadowRoot \n ? [element.shadowRoot]\n : [element];\n \n // Start observing\n targets.forEach(target => {\n mo.observe(target, options);\n });\n \n // Store cleanup\n instance[CLEANUP].observers.push(() => {\n mo.disconnect();\n });\n}\n\n// Helper to cleanup observers\nexport function cleanupObservers(instance: any) {\n if (instance[CLEANUP]?.observers) {\n for (const cleanup of instance[CLEANUP].observers) {\n cleanup();\n }\n instance[CLEANUP].observers = [];\n }\n}","import { IS_CONTROLLER_INSTANCE, ROUTER_CONTEXT } from './symbols';\nimport type { AppContext } from './types/app-context';\n\nconst CONTEXT_REQUEST_EVENT = '@context/request';\n\ninterface ContextRequestDetail {\n context?: AppContext;\n}\n\ninterface ProviderRecord {\n listener: EventListener;\n}\n\nconst providers = new WeakMap<EventTarget, ProviderRecord>();\n\n/** @internal */\nexport function hasContextProvider(root: EventTarget): boolean {\n return providers.has(root);\n}\n\nfunction contextTarget(source: unknown): EventTarget | null {\n if (!source || (typeof source !== 'object' && typeof source !== 'function')) {\n return null;\n }\n\n const value = source as any;\n if (value[IS_CONTROLLER_INSTANCE] === true) {\n return value.element && typeof value.element.dispatchEvent === 'function'\n ? value.element\n : null;\n }\n\n return typeof value.dispatchEvent === 'function' ? value as EventTarget : null;\n}\n\n/**\n * Installs the low-level application-context provider on a concrete event\n * boundary. Public callers use provideContext(), which also activates the\n * daemon instances declared by the context.\n */\nexport function installContextProvider(root: EventTarget, context: AppContext): () => void {\n if (!root || typeof root.addEventListener !== 'function' || typeof root.removeEventListener !== 'function') {\n throw new TypeError('provideContext() requires an EventTarget root.');\n }\n if (!context || typeof context !== 'object') {\n throw new TypeError('provideContext() requires an application context object.');\n }\n if (providers.has(root)) {\n throw new Error('This root already provides an application context. Release it before providing another.');\n }\n\n const listener: EventListener = (event) => {\n const request = event as CustomEvent<ContextRequestDetail>;\n if (!request.detail || request.detail.context !== undefined) return;\n\n request.detail.context = context;\n request.preventDefault();\n request.stopPropagation();\n };\n\n root.addEventListener(CONTEXT_REQUEST_EVENT, listener);\n providers.set(root, { listener });\n\n let released = false;\n return () => {\n if (released) return;\n released = true;\n\n const current = providers.get(root);\n if (current?.listener === listener) {\n root.removeEventListener(CONTEXT_REQUEST_EVENT, listener);\n providers.delete(root);\n }\n };\n}\n\n/**\n * Resolves the raw application context visible to an element or controller.\n * A single composed, bubbling request is answered by the nearest\n * provideContext() root. Router-injected context remains a fallback for a\n * detached page or controller that cannot currently reach its provider.\n */\nexport function getContext<T extends AppContext = AppContext>(source: unknown): T | undefined {\n if (!source || (typeof source !== 'object' && typeof source !== 'function')) {\n return undefined;\n }\n\n const target = contextTarget(source);\n if (target) {\n const detail: ContextRequestDetail = {};\n target.dispatchEvent(new CustomEvent<ContextRequestDetail>(CONTEXT_REQUEST_EVENT, {\n bubbles: true,\n composed: true,\n cancelable: true,\n detail,\n }));\n if (detail.context !== undefined) return detail.context as T;\n }\n\n const value = source as any;\n if (value[ROUTER_CONTEXT] !== undefined) {\n return value[ROUTER_CONTEXT] as T;\n }\n if (value[IS_CONTROLLER_INSTANCE] === true && value.element?.[ROUTER_CONTEXT] !== undefined) {\n return value.element[ROUTER_CONTEXT] as T;\n }\n return undefined;\n}\n","import { DAEMON_STATE, IS_CONTROLLER_INSTANCE, IS_DAEMON_CLASS, IS_DAEMON_INSTANCE } from './symbols';\nimport { getContext } from './context-provider';\nimport type { AppContext } from './types/app-context';\n\nexport interface DaemonCommunicationState {\n target: EventTarget;\n bindings: number;\n active: boolean;\n}\n\nexport function isDaemonInstance(value: unknown): value is object {\n return !!value\n && (typeof value === 'object' || typeof value === 'function')\n && (value as any)[IS_DAEMON_CLASS] === true;\n}\n\nexport function daemonState(instance: object): DaemonCommunicationState {\n if (!isDaemonInstance(instance)) {\n throw new TypeError('Application contexts may provide only instances of @daemon classes.');\n }\n\n let state = (instance as any)[DAEMON_STATE] as DaemonCommunicationState | undefined;\n if (!state) {\n state = {\n target: new EventTarget(),\n bindings: 0,\n active: false,\n };\n try {\n Object.defineProperty(instance, DAEMON_STATE, {\n value: state,\n configurable: true,\n });\n Object.defineProperty(instance, IS_DAEMON_INSTANCE, {\n value: true,\n configurable: true,\n });\n } catch {\n throw new TypeError('@daemon instances must remain extensible until they are provided to an app context.');\n }\n }\n return state;\n}\n\nexport function getDaemonTarget(instance: object): EventTarget {\n return daemonState(instance).target;\n}\n\nfunction sourceLabel(source: unknown): string {\n const value = source as any;\n if (value?.[IS_CONTROLLER_INSTANCE] === true) return 'controller';\n if (isDaemonInstance(value)) return '@daemon instance';\n return 'element';\n}\n\nexport function requireDaemonTarget(source: unknown, name: string): EventTarget {\n if (typeof name !== 'string' || !name.trim()) {\n throw new TypeError('Daemon addresses must be non-empty strings.');\n }\n\n const context = getContext<AppContext>(source);\n if (!context) {\n throw new Error(`[snice] ${sourceLabel(source)} cannot resolve daemon \"${name}\" because no app context is provided.`);\n }\n\n const instance = context.daemons?.[name];\n if (!instance) {\n throw new Error(`[snice] app context does not provide daemon \"${name}\".`);\n }\n if (!isDaemonInstance(instance)) {\n throw new TypeError(`[snice] app context entry \"${name}\" is not an instance of an @daemon class.`);\n }\n\n const state = daemonState(instance);\n if (!state.active) {\n throw new Error(`[snice] daemon \"${name}\" is not active because its app context has not been provided.`);\n }\n return state.target;\n}\n\nexport function defaultCommunicationTarget(instance: any): EventTarget | null {\n if (isDaemonInstance(instance)) {\n return getDaemonTarget(instance);\n }\n if (instance?.[IS_CONTROLLER_INSTANCE] === true) {\n return instance.element && typeof instance.element.dispatchEvent === 'function'\n ? instance.element\n : null;\n }\n if (instance && typeof instance.dispatchEvent === 'function') {\n return instance as EventTarget;\n }\n return null;\n}\n","import { CHANNEL_HANDLERS, CLEANUP, RESPOND_METHODS } from './symbols';\nimport { RequestOptions } from './types/request-options';\nimport { RespondOptions } from './types/respond-options';\nimport { defaultCommunicationTarget, requireDaemonTarget } from './daemon-target';\n\n/**\n * Return type for methods decorated with `@request`.\n *\n * TypeScript cannot express a method decorator changing an async generator\n * into a promise-returning method. This pragmatic helper suppresses that\n * mismatch while documenting the response value for readers and tooling.\n */\nexport type Response<T = any> = T | any;\n\n// @request decorator transforms methods to return Promise<T>\n\n\n/**\n * Decorator for making requests from elements or controllers.\n * Uses async generator pattern for bidirectional communication.\n * \n * @param requestName The name of the request\n * @param options Optional configuration\n */\nexport function request<T = any>(requestName: string, options?: RequestOptions) {\n return function (originalMethod: any, _context: ClassMethodDecoratorContext): (...args: any[]) => Promise<T> {\n // Create timing variables for debounce/throttle\n let debounceTimeout: any;\n let throttleLastCall = 0;\n let throttleTimeout: any;\n const throttleTrailingResolvers: Array<{ resolve: (v: any) => void; reject: (e: any) => void }> = [];\n\n return async function (this: any, ...args: any[]) {\n const actualRequest = async () => {\n // @request always acts as requester (client side)\n const responseTimeout = options?.timeout ?? 120000; // Default 2 minute timeout\n const discoveryTimeout = options?.discoveryTimeout ?? 50; // Default 50ms discovery timeout\n\n // Resolve before creating timeout promises. A missing daemon/context\n // should reject immediately without leaving an orphaned discovery\n // timer behind.\n const dispatcher = options?.daemon !== undefined\n ? requireDaemonTarget(this, options.daemon)\n : defaultCommunicationTarget(this);\n if (!dispatcher) {\n throw new TypeError(\n `@request('${requestName}') requires an element, attached controller, or provided @daemon instance.`\n );\n }\n \n // Create the generator\n const generator = originalMethod.apply(this, args);\n \n // Get the first yield (the request payload)\n const { value: payload, done } = await generator.next();\n \n if (done) {\n // Generator returned without yielding\n return payload;\n }\n \n // Create data promise and expose resolve/reject\n let dataResolve: (value: any) => void;\n let dataReject: (reason?: any) => void;\n const dataPromise = new Promise((resolve, reject) => {\n dataResolve = resolve;\n dataReject = reject;\n });\n \n // Create discovery timeout promise and expose resolve/reject\n let discoveryResolve: () => void;\n let discoveryReject: (reason?: any) => void;\n let discoveryTimeoutId: NodeJS.Timeout;\n let discovered = false;\n const discoveryPromise = new Promise<void>((resolve, reject) => {\n discoveryResolve = resolve;\n discoveryReject = reject;\n discoveryTimeoutId = setTimeout(() => {\n reject(new Error(\n `Request \"${requestName}\" found no @respond('${requestName}') handler within ${discoveryTimeout}ms — ` +\n `attach a responding controller/element, or pass { optional: true } to resolve undefined when unhandled.`\n ));\n }, discoveryTimeout);\n });\n \n // Dispatch event with promises\n const eventName = `@request/${requestName}`;\n const event = new CustomEvent(eventName, {\n bubbles: options?.bubbles !== undefined ? options.bubbles : true,\n cancelable: options?.cancelable || false,\n composed: true, // Allow crossing shadow DOM boundaries\n detail: {\n payload,\n discovery: {\n resolve: () => {\n discovered = true;\n clearTimeout(discoveryTimeoutId);\n discoveryResolve();\n },\n reject: discoveryReject!\n },\n data: {\n resolve: dataResolve!,\n reject: dataReject!\n }\n }\n });\n \n dispatcher.dispatchEvent(event);\n \n try {\n // Wait for discovery timeout to be cleared (handler found) or discovery timeout to reject (no handler)\n await discoveryPromise;\n \n // If we get here, a handler was found and discovery timeout was cleared\n // Now wait for the actual data response with the full response timeout\n const responseTimeoutId = setTimeout(() => {\n dataReject!(new Error(`Request \"${requestName}\" timed out after ${responseTimeout}ms`));\n }, responseTimeout);\n \n const response = await dataPromise;\n clearTimeout(responseTimeoutId);\n \n // Send response back to generator and get final return value\n const { value: finalValue } = await generator.next(response);\n return finalValue;\n } catch (error) {\n // optional: an unhandled request isn't an error — resume the generator\n // with undefined so `const data = await (yield payload)` sees no data.\n // A response TIMEOUT (handler exists but is slow) still throws.\n if (options?.optional && !discovered) {\n const { value: finalValue } = await generator.next(undefined);\n return finalValue;\n }\n\n // Drive the generator's own catch block and return whatever it recovers\n // with (e.g. a cached fallback). If the generator re-throws instead,\n // generator.throw rejects and the error propagates to the caller.\n const { value: recovered } = await generator.throw(error);\n return recovered;\n }\n }; // Close actualRequest function\n \n // Debounce\n if (options?.debounce) {\n return new Promise((resolve, reject) => {\n clearTimeout(debounceTimeout);\n debounceTimeout = setTimeout(async () => {\n try { resolve(await actualRequest()); }\n catch (error) { reject(error); }\n }, options.debounce);\n });\n }\n\n // No throttle — execute immediately\n if (!options?.throttle) return actualRequest();\n\n // Throttle: time elapsed — invoke now\n const now = Date.now();\n const remaining = options.throttle - (now - throttleLastCall);\n\n if (remaining <= 0) {\n // Cancelling the scheduled trailing call must not orphan the promises\n // queued for it — settle them with this fresh result. Also reset\n // throttleTimeout so later within-window calls don't attach to a dead\n // timer and hang.\n clearTimeout(throttleTimeout);\n throttleTimeout = null;\n throttleLastCall = now;\n const orphaned = throttleTrailingResolvers.splice(0);\n const p = actualRequest();\n if (orphaned.length) {\n p.then(\n (r) => { for (const x of orphaned) x.resolve(r); },\n (e) => { for (const x of orphaned) x.reject(e); }\n );\n }\n return p;\n }\n\n // Throttle: already has pending trailing call — attach to it\n if (throttleTimeout) {\n return new Promise((resolve, reject) => {\n throttleTrailingResolvers.push({ resolve, reject });\n });\n }\n\n // Throttle: schedule trailing call\n return new Promise((resolve, reject) => {\n throttleTrailingResolvers.push({ resolve, reject });\n throttleTimeout = setTimeout(async () => {\n throttleLastCall = Date.now();\n throttleTimeout = null;\n const resolvers = throttleTrailingResolvers.splice(0);\n try {\n const result = await actualRequest();\n for (const r of resolvers) r.resolve(result);\n } catch (error) {\n for (const r of resolvers) r.reject(error);\n }\n }, remaining);\n });\n };\n };\n}\n\n\n/**\n * Decorator for responding to requests in elements or controllers.\n * \n * @param requestName The name of the request to respond to\n * @param options Optional configuration\n */\nexport function respond(requestName: string, options?: RespondOptions) {\n return function (target: any, context: ClassMethodDecoratorContext) {\n const propertyKey = context.name as string;\n context.addInitializer(function(this: any) {\n const constructor = this.constructor as any;\n\n // hasOwnProperty guards so subclasses don't mutate parent state via\n // the prototype chain.\n if (!Object.prototype.hasOwnProperty.call(constructor, RESPOND_METHODS)) {\n constructor[RESPOND_METHODS] = new Set();\n }\n if (constructor[RESPOND_METHODS].has(target)) return;\n constructor[RESPOND_METHODS].add(target);\n\n if (!Object.prototype.hasOwnProperty.call(constructor, CHANNEL_HANDLERS)) {\n const inherited = constructor[CHANNEL_HANDLERS];\n constructor[CHANNEL_HANDLERS] = inherited ? [...inherited] : [];\n }\n\n constructor[CHANNEL_HANDLERS].push({\n channelName: requestName,\n methodName: propertyKey,\n method: target,\n options: options\n });\n });\n };\n}\n\n// Helper to setup response handlers for elements and controllers\nexport function setupResponseHandlers(instance: any, element: EventTarget) {\n const handlers = instance.constructor[CHANNEL_HANDLERS];\n if (!handlers) return;\n \n // Store cleanup functions\n // Initialize cleanup object if needed\n if (!instance[CLEANUP]) {\n instance[CLEANUP] = { events: [], channels: [] };\n }\n \n for (const handler of handlers) {\n const boundMethod = handler.method.bind(instance);\n const eventName = `@request/${handler.channelName}`;\n \n // Create timing variables for debounce/throttle per handler\n let debounceTimeout: any;\n let throttleLastCall = 0;\n let throttleTimeout: any;\n const throttleTrailingResolvers: Array<{ resolve: (v: any) => void; reject: (e: any) => void }> = [];\n let throttleLatestArgs: any[] | null = null;\n\n // Create wrapped method with timing if needed\n const createTimedMethod = (originalMethod: Function) => {\n if (handler.options?.debounce) {\n return (...args: any[]) => new Promise((resolve, reject) => {\n clearTimeout(debounceTimeout);\n debounceTimeout = setTimeout(async () => {\n try { resolve(await originalMethod(...args)); }\n catch (error) { reject(error); }\n }, handler.options.debounce);\n });\n }\n\n if (!handler.options?.throttle) return originalMethod;\n\n return (...args: any[]) => {\n const now = Date.now();\n const remaining = handler.options.throttle! - (now - throttleLastCall);\n\n if (remaining <= 0) {\n // Same as the @request side: settle any queued trailing callers with\n // this fresh result rather than orphaning their promises.\n clearTimeout(throttleTimeout);\n throttleTimeout = null;\n throttleLastCall = now;\n const orphaned = throttleTrailingResolvers.splice(0);\n throttleLatestArgs = null;\n const result = originalMethod(...args);\n if (orphaned.length) {\n Promise.resolve(result).then(\n (r) => { for (const x of orphaned) x.resolve(r); },\n (e) => { for (const x of orphaned) x.reject(e); }\n );\n }\n return result;\n }\n\n // Remember the LATEST args so the trailing call uses fresh input,\n // and queue every suppressed caller's resolver so they all receive\n // the trailing result instead of `undefined`.\n throttleLatestArgs = args;\n return new Promise((resolve, reject) => {\n throttleTrailingResolvers.push({ resolve, reject });\n if (throttleTimeout) return; // already scheduled\n throttleTimeout = setTimeout(async () => {\n throttleLastCall = Date.now();\n throttleTimeout = null;\n const resolvers = throttleTrailingResolvers.splice(0);\n const finalArgs = throttleLatestArgs ?? args;\n throttleLatestArgs = null;\n try {\n const result = await originalMethod(...finalArgs);\n for (const r of resolvers) r.resolve(result);\n } catch (error) {\n for (const r of resolvers) r.reject(error);\n }\n }, remaining);\n });\n };\n };\n \n const timedMethod = createTimedMethod(boundMethod);\n \n // Setup response handler\n const responseHandler = (event: CustomEvent) => {\n // Extract promises and payload\n const { data, discovery, payload } = event.detail;\n \n // Prevent other responders from responding\n event.preventDefault();\n event.stopImmediatePropagation();\n event.stopPropagation();\n \n // Clear the discovery timeout immediately - we found a handler\n discovery.resolve();\n \n // Call the timed responder method and handle the result\n Promise.resolve(timedMethod(payload))\n .then(result => {\n data.resolve(result);\n })\n .catch(error => {\n data.reject(error);\n console.error(`Error in response handler ${handler.methodName}:`, error);\n });\n };\n \n let responseTarget = element;\n if (handler.options?.daemon !== undefined) {\n try {\n responseTarget = requireDaemonTarget(instance, handler.options.daemon);\n } catch (error) {\n console.warn(`[snice/@respond] ${(error as Error).message} Responder \"${handler.channelName}\" skipped.`);\n continue;\n }\n }\n\n responseTarget.addEventListener(eventName, responseHandler as EventListener);\n \n instance[CLEANUP].channels.push(() => {\n responseTarget.removeEventListener(eventName, responseHandler as EventListener);\n });\n }\n}\n\n// Helper to cleanup response handlers\nexport function cleanupResponseHandlers(instance: any) {\n if (instance[CLEANUP]?.channels) {\n for (const cleanup of instance[CLEANUP].channels) {\n cleanup();\n }\n instance[CLEANUP].channels = [];\n }\n}\n","/**\n * Keyboard filter for matching specific keys and modifiers\n */\nexport interface KeyboardFilter {\n key: string;\n ctrl?: boolean;\n alt?: boolean;\n shift?: boolean;\n meta?: boolean;\n anyModifiers?: boolean; // true if prefixed with ~\n}\n\n// once/preventDefault/stopPropagation/capture/passive are @on() OPTIONS, not\n// template modifiers. A dotted non-keyboard event whose suffix is one of these\n// is almost certainly a mistake (e.g. `@click.once`) — it binds a listener for\n// an event type the DOM never dispatches. Warn instead of failing silently. A\n// legitimate custom event name like `app.ready` won't match and stays quiet.\nconst MODIFIER_WORDS = new Set([\n 'once', 'prevent', 'preventdefault', 'stop', 'stoppropagation', 'capture', 'passive',\n]);\n\nexport function warnIfModifierMisuse(eventName: string): void {\n const dot = eventName.lastIndexOf('.');\n if (dot < 0) return;\n\n const suffix = eventName.slice(dot + 1).toLowerCase();\n if (!MODIFIER_WORDS.has(suffix)) return;\n\n console.warn(\n `snice: \"@${eventName}\" is not a valid modifier — once/preventDefault/` +\n `stopPropagation/capture are @on() options, not template modifiers. ` +\n `This registers a listener for event \"${eventName}\", which never fires.`\n );\n}\n\n/**\n * Parse keyboard shortcut specification\n * Examples:\n * \"enter\" -> { key: \"Enter\" }\n * \"ctrl+s\" -> { key: \"s\", ctrl: true }\n * \"ctrl+shift+s\" -> { key: \"s\", ctrl: true, shift: true }\n * \"~enter\" -> { key: \"Enter\", anyModifiers: true }\n */\nexport function parseKeyboardFilter(spec: string): KeyboardFilter {\n // Handle ~ prefix for matching regardless of modifiers\n const anyModifiers = spec.startsWith('~');\n if (anyModifiers) {\n spec = spec.substring(1);\n }\n\n const parts = spec.split('+');\n const filter: KeyboardFilter = {\n key: '',\n anyModifiers\n };\n\n for (const part of parts) {\n const lower = part.toLowerCase();\n if (lower === 'ctrl' || lower === 'control') {\n filter.ctrl = true;\n } else if (lower === 'alt') {\n filter.alt = true;\n } else if (lower === 'shift') {\n filter.shift = true;\n } else if (lower === 'meta' || lower === 'cmd' || lower === 'command') {\n filter.meta = true;\n } else {\n // This is the key itself - normalize common keys\n filter.key = normalizeKey(part);\n }\n }\n\n return filter;\n}\n\n/**\n * Normalize key names to match KeyboardEvent.key\n */\nfunction normalizeKey(key: string): string {\n const keyMap: Record<string, string> = {\n 'esc': 'Escape',\n 'escape': 'Escape',\n 'enter': 'Enter',\n 'return': 'Enter',\n 'space': ' ',\n 'spacebar': ' ',\n 'up': 'ArrowUp',\n 'down': 'ArrowDown',\n 'left': 'ArrowLeft',\n 'right': 'ArrowRight',\n 'arrowup': 'ArrowUp',\n 'arrowdown': 'ArrowDown',\n 'arrowleft': 'ArrowLeft',\n 'arrowright': 'ArrowRight',\n 'delete': 'Delete',\n 'del': 'Delete',\n 'backspace': 'Backspace',\n 'tab': 'Tab',\n 'home': 'Home',\n 'end': 'End',\n 'pageup': 'PageUp',\n 'pagedown': 'PageDown'\n };\n\n const lower = key.toLowerCase();\n return keyMap[lower] || key;\n}\n\n/**\n * Check if keyboard event matches the filter\n */\nexport function matchesKeyboardFilter(event: KeyboardEvent, filter: KeyboardFilter): boolean {\n // Check key match\n if (event.key !== filter.key) {\n return false;\n }\n\n // If anyModifiers is true, we don't care about modifiers\n if (filter.anyModifiers) {\n return true;\n }\n\n // Check modifiers - by default, exact match\n // If filter specifies ctrl: true, event must have ctrlKey\n // If filter doesn't specify ctrl, event must NOT have ctrlKey\n const ctrlMatch = filter.ctrl ? event.ctrlKey : !event.ctrlKey;\n const altMatch = filter.alt ? event.altKey : !event.altKey;\n const shiftMatch = filter.shift ? event.shiftKey : !event.shiftKey;\n const metaMatch = filter.meta ? event.metaKey : !event.metaKey;\n\n return ctrlMatch && altMatch && shiftMatch && metaMatch;\n}\n","/**\n * @on decorator for listening to events\n * Use in elements or controllers to listen to DOM events or custom events\n */\n\nimport { CLEANUP, ON_METHODS } from './symbols';\nimport { getSymbol } from './symbols';\nimport type { OnOptions } from './types/on-options';\nimport { parseKeyboardFilter, matchesKeyboardFilter, warnIfModifierMisuse, type KeyboardFilter } from './keyboard-filter';\nimport { createDebounced, resolveScope } from './utils';\nimport { isDaemonInstance, requireDaemonTarget } from './daemon-target';\n\n// Re-export OnOptions for public API\nexport type { OnOptions } from './types/on-options';\n\nconst ON_HANDLERS = getSymbol('on-handlers');\n\n/**\n * @on decorator for listening to events\n *\n * Works in both elements and controllers with full event delegation support.\n *\n * @param eventName - Event name(s) to listen for\n * @param selector - Optional CSS selector for event delegation\n * @param options - Event listener options including debounce/throttle\n *\n * @example\n * ```typescript\n * // In elements\n * @element('my-button')\n * class MyButton extends HTMLElement {\n * @on('click', 'button')\n * handleClick(e: MouseEvent) {\n * console.log('Button clicked!', e);\n * }\n *\n * @on('input', 'input', { debounce: 300 })\n * handleInput(e: Event) {\n * console.log('Input changed:', (e.target as HTMLInputElement).value);\n * }\n * }\n *\n * // In controllers\n * @controller('my-controller')\n * class MyController {\n * element!: HTMLElement;\n *\n * @on('count-changed')\n * handleCountChanged(e: CustomEvent) {\n * console.log('Count changed to:', e.detail.count);\n * }\n *\n * @on('click', '.item', { throttle: 100 })\n * handleItemClick(e: MouseEvent) {\n * console.log('Item clicked');\n * }\n * }\n * ```\n */\nexport function on(\n eventName: string | string[],\n selectorOrOptions?: string | OnOptions | null,\n options?: OnOptions\n) {\n // Parse arguments to support multiple call signatures\n let selector: string | null = null;\n let opts: OnOptions = {};\n\n if (typeof selectorOrOptions === 'string') {\n selector = selectorOrOptions;\n opts = options || {};\n } else if (selectorOrOptions && typeof selectorOrOptions === 'object') {\n opts = selectorOrOptions;\n } else if (selectorOrOptions === null && options) {\n opts = options;\n }\n\n return function (originalMethod: any, context: ClassMethodDecoratorContext) {\n const methodName = context.name as string;\n context.addInitializer(function(this: any) {\n const constructor = this.constructor as any;\n\n // Dedup by registration identity (method + events + selector), NOT by\n // method reference alone — stacked @on decorators share one method and\n // must each register. Use hasOwnProperty so subclasses get their OWN\n // Set instead of inheriting — otherwise parent and child share state\n // and child registrations pollute parent (and vice versa) via the\n // prototype chain.\n const eventNames = Array.isArray(eventName) ? eventName : [eventName];\n const registrationKey = `${methodName}::${eventNames.join(',')}::${selector ?? ''}::daemon:${opts.daemon ?? ''}`;\n\n if (!Object.prototype.hasOwnProperty.call(constructor, ON_METHODS)) {\n constructor[ON_METHODS] = new Set();\n }\n if (constructor[ON_METHODS].has(registrationKey)) return;\n constructor[ON_METHODS].add(registrationKey);\n\n if (!Object.prototype.hasOwnProperty.call(constructor, ON_HANDLERS)) {\n // Seed with parent's handlers (if any) so inherited @on still fires.\n const inherited = constructor[ON_HANDLERS];\n constructor[ON_HANDLERS] = inherited ? [...inherited] : [];\n }\n\n for (const event of eventNames) {\n constructor[ON_HANDLERS].push({\n eventName: event,\n selector,\n methodName,\n method: originalMethod,\n options: opts\n });\n }\n });\n\n return originalMethod;\n };\n}\n\n// Note: on.ts uses leading-edge-only throttle (no trailing call).\n// createThrottled from utils has leading+trailing, so we keep a local leading-only variant.\nfunction throttle<T extends (...args: any[]) => any>(fn: T, delay: number): T {\n let lastCall = 0;\n return function (this: any, ...args: any[]) {\n const now = Date.now();\n if (now - lastCall >= delay) {\n lastCall = now;\n fn.apply(this, args);\n }\n } as T;\n}\n\n/**\n * Events that don't bubble - these require capture phase for delegation\n */\nconst NON_BUBBLING_EVENTS = new Set([\n 'scroll',\n 'focus',\n 'blur',\n 'load',\n 'unload',\n 'error',\n 'resize',\n 'abort',\n 'mouseenter',\n 'mouseleave',\n 'pointerenter',\n 'pointerleave',\n]);\n\n/**\n * Setup event listeners for an element or controller instance\n * Called automatically during element connection or controller attachment\n */\nexport function setupEventHandlers(instance: any, targetElement: EventTarget) {\n const handlers = instance.constructor[ON_HANDLERS];\n if (!handlers || !Array.isArray(handlers) || handlers.length === 0) {\n return;\n }\n\n // Initialize cleanup object if needed\n if (!instance[CLEANUP]) {\n instance[CLEANUP] = { events: [], channels: [], observers: [] };\n } else if (!instance[CLEANUP].events) {\n instance[CLEANUP].events = [];\n } else if (instance[CLEANUP].events.length > 0) {\n // Events already set up - clean them up first to avoid duplicates\n cleanupEventHandlers(instance);\n }\n\n for (const handler of handlers) {\n // Get current method from instance (preserves decorator stacking)\n const currentMethod = (instance as any)[handler.methodName];\n let boundMethod = currentMethod ? currentMethod.bind(instance) : handler.method.bind(instance);\n const handlerOptions = handler.options || {};\n\n // Parse event name for key modifiers\n // Supports both dot notation (@keydown.enter) and colon notation (@keydown:Enter)\n // Only parse colons for keyboard events, not custom events\n const isKeyboardEvent = ['keydown', 'keyup', 'keypress'].includes(handler.eventName.split('.')[0].split(':')[0]);\n // Only keyboard events split on `.`/`:` into a key filter — a custom event\n // name may legitimately contain a dot (e.g. `app.ready`) and must be kept whole.\n const dotIndex = isKeyboardEvent ? handler.eventName.indexOf('.') : -1;\n const colonIndex = isKeyboardEvent ? handler.eventName.indexOf(':') : -1;\n\n const delimiterIndex = dotIndex > 0 && colonIndex > 0\n ? Math.min(dotIndex, colonIndex)\n : Math.max(dotIndex, colonIndex);\n\n const baseEventName = delimiterIndex > 0\n ? handler.eventName.substring(0, delimiterIndex)\n : handler.eventName;\n\n const keyModifier = delimiterIndex > 0\n ? handler.eventName.substring(delimiterIndex + 1)\n : null;\n\n if (delimiterIndex <= 0) warnIfModifierMisuse(handler.eventName);\n\n // Apply debounce (takes precedence over throttle)\n if (handlerOptions.debounce && handlerOptions.debounce > 0) {\n boundMethod = createDebounced(boundMethod, handlerOptions.debounce);\n } else if (handlerOptions.throttle && handlerOptions.throttle > 0) {\n boundMethod = throttle(boundMethod, handlerOptions.throttle);\n }\n\n // Create event handler with key modifier support\n // Uses shared keyboard filter implementation from parts.ts\n let keyFilter: KeyboardFilter | null = null;\n if (keyModifier && ['keydown', 'keyup', 'keypress'].includes(baseEventName)) {\n keyFilter = parseKeyboardFilter(keyModifier);\n }\n\n const createKeyModifierHandler = (method: Function): Function => {\n if (!keyFilter) {\n return method;\n }\n\n return (event: Event) => {\n const keyEvent = event as KeyboardEvent;\n if (matchesKeyboardFilter(keyEvent, keyFilter)) {\n method(event);\n }\n };\n };\n\n // Apply key modifier wrapper\n const keyModifierMethod = createKeyModifierHandler(boundMethod);\n\n // Resolve an explicit DOM scope or an app-context daemon. They are two\n // distinct addressing models and may not be combined.\n const hasExplicitScope = handlerOptions.scope !== undefined;\n const hasDaemon = handlerOptions.daemon !== undefined;\n if (hasExplicitScope && hasDaemon) {\n console.warn(\n `[snice/@on] \"${handler.eventName}\" cannot use both scope and daemon — listener skipped.`\n );\n continue;\n }\n if ((hasDaemon || isDaemonInstance(instance)) && handler.selector) {\n console.warn(\n `[snice/@on] \"${handler.eventName}\" cannot delegate \"${handler.selector}\" on a daemon target — listener skipped.`\n );\n continue;\n }\n\n const hasExplicitTarget = hasExplicitScope || hasDaemon;\n let scopedTarget: EventTarget | null = null;\n if (hasDaemon) {\n try {\n scopedTarget = requireDaemonTarget(instance, handlerOptions.daemon);\n } catch (error) {\n console.warn(`[snice/@on] ${(error as Error).message} Listener \"${handler.eventName}\" skipped.`);\n continue;\n }\n } else if (hasExplicitScope) {\n scopedTarget = resolveScope(targetElement as HTMLElement, handlerOptions.scope);\n if (!scopedTarget) {\n // Dev warning — listener silently dropped when scope cannot resolve.\n // Skip attachment so we don't bind to the wrong target.\n console.warn(\n `[snice/@on] scope did not resolve for \"${handler.eventName}\" on ${handler.methodName} — listener skipped.`\n );\n continue;\n }\n }\n\n // Main event handler with error handling and event delegation\n if (handler.selector) {\n // Delegated event handling.\n // - Default eventRoot: shadow root if present, else host element.\n // - With explicit scope: attach to the scoped target instead.\n const eventRoot: EventTarget = hasExplicitTarget\n ? scopedTarget!\n : ((targetElement as any).shadowRoot || targetElement);\n\n const delegatedHandler = (event: Event) => {\n const target = event.target as HTMLElement;\n const matchingElement =\n (target.matches && target.matches(handler.selector) && target) ||\n (target.closest && target.closest(handler.selector)) ||\n null;\n\n if (!matchingElement) return;\n\n if (handlerOptions.preventDefault) event.preventDefault();\n if (handlerOptions.stopPropagation) {\n event.stopPropagation();\n event.stopImmediatePropagation();\n }\n\n try {\n keyModifierMethod(event);\n } catch (error) {\n console.error(`Error in event handler ${handler.methodName}:`, error);\n }\n };\n\n // Auto-enable capture for non-bubbling events when using delegation\n const needsCapture = NON_BUBBLING_EVENTS.has(baseEventName);\n const useCapture = handlerOptions.capture !== undefined\n ? handlerOptions.capture\n : needsCapture;\n\n const listenerOptions: AddEventListenerOptions = {\n capture: useCapture,\n once: handlerOptions.once || false,\n passive: handlerOptions.passive || false,\n };\n\n eventRoot.addEventListener(baseEventName, delegatedHandler, listenerOptions);\n\n instance[CLEANUP].events.push({\n target: eventRoot,\n eventName: baseEventName,\n handler: delegatedHandler,\n options: listenerOptions,\n });\n } else {\n // Direct event handling.\n // - Default: shadow root + host element (so events inside shadow and on\n // the host itself both fire). A per-handler Symbol dedupes.\n // - With explicit scope: attach to the scoped target ONLY (no duplication).\n const shadowRoot = hasExplicitTarget ? null : (targetElement as any).shadowRoot;\n\n // Per-handler private Symbol so dedup is scoped to THIS handler's two\n // listeners (shadowRoot + host). Using Symbol.for() with the method name\n // would collide across components that share a method name (e.g. a parent\n // and nested child both defining `handleClick`), causing the parent's\n // handler to be silently swallowed when events bubble up through a\n // shadow boundary.\n const handledSymbol = Symbol();\n\n const wrappedMethod = (event: Event) => {\n if ((event as any)[handledSymbol]) return;\n (event as any)[handledSymbol] = true;\n\n if (handlerOptions.preventDefault) event.preventDefault();\n if (handlerOptions.stopPropagation) event.stopPropagation();\n\n try {\n keyModifierMethod(event);\n } catch (error) {\n console.error(`Error in event handler ${handler.methodName}:`, error);\n }\n };\n\n const listenerOptions: AddEventListenerOptions = {\n capture: handlerOptions.capture || false,\n once: handlerOptions.once || false,\n passive: handlerOptions.passive || false,\n };\n\n if (hasExplicitTarget) {\n scopedTarget!.addEventListener(baseEventName, wrappedMethod as EventListener, listenerOptions);\n instance[CLEANUP].events.push({\n target: scopedTarget!,\n eventName: baseEventName,\n handler: wrappedMethod,\n options: listenerOptions,\n });\n continue;\n }\n\n if (shadowRoot) {\n // Listen on shadow root for events inside shadow DOM\n shadowRoot.addEventListener(baseEventName, wrappedMethod as EventListener, listenerOptions);\n instance[CLEANUP].events.push({\n target: shadowRoot,\n eventName: baseEventName,\n handler: wrappedMethod,\n options: listenerOptions,\n });\n }\n\n // Also listen on host element (for clicks on host itself or when no shadow root)\n targetElement.addEventListener(baseEventName, wrappedMethod as EventListener, listenerOptions);\n instance[CLEANUP].events.push({\n target: targetElement,\n eventName: baseEventName,\n handler: wrappedMethod,\n options: listenerOptions,\n });\n }\n }\n}\n\n/**\n * Cleanup event listeners for a controller instance\n * Called automatically by the controller system during detach\n */\nexport function cleanupEventHandlers(instance: any) {\n if (!instance[CLEANUP]?.events) return;\n\n for (const { target, eventName, handler, options } of instance[CLEANUP].events) {\n target.removeEventListener(eventName, handler, options);\n }\n\n instance[CLEANUP].events = [];\n}\n","import { setupObservers, cleanupObservers } from './observe';\nimport { setupResponseHandlers, cleanupResponseHandlers } from './request-response';\nimport { setupEventHandlers, cleanupEventHandlers } from './on';\nimport { IS_CONTROLLER_CLASS, IS_CONTROLLER_INSTANCE, CONTROLLER, CONTROLLER_KEY, CONTROLLER_NAME_KEY, CONTROLLER_ID, CONTROLLER_OPERATIONS, NATIVE_CONTROLLER, CONTROLLER_REGISTRY_NAME, DIRECT_CONTROLLER, CONTROLLER_ATTRIBUTE_SYNC, IS_ELEMENT_CLASS, ROUTER_CONTEXT, CONTROLLER_ABORT, CONTROLLER_ATTACHED, READY_HANDLERS_RUNNING } from './symbols';\nimport { snice } from './global';\nimport { IController, ControllerClass } from './types/i-controller';\n\n\n\n\n// Controller-scoped cleanup registry\nclass ControllerScope {\n private cleanupFns: Map<string, Function> = new Map();\n private pendingOperations: Set<Promise<void>> = new Set();\n \n register(key: string, cleanup: Function): void {\n this.cleanupFns.set(key, cleanup);\n }\n \n unregister(key: string): void {\n this.cleanupFns.delete(key);\n }\n \n async cleanup(): Promise<void> {\n // Wait for all pending operations\n await Promise.all(this.pendingOperations);\n \n // Run all cleanup functions\n for (const cleanup of this.cleanupFns.values()) {\n try {\n await cleanup();\n } catch (error) {\n console.error('Error during cleanup:', error);\n }\n }\n this.cleanupFns.clear();\n }\n \n async runOperation<T>(operation: () => Promise<T>): Promise<T> {\n const promise = operation();\n const voidPromise = promise.then(() => {}, () => {});\n this.pendingOperations.add(voidPromise);\n \n try {\n const result = await promise;\n this.pendingOperations.delete(voidPromise);\n return result;\n } catch (error) {\n this.pendingOperations.delete(voidPromise);\n throw error;\n }\n }\n}\n\n/**\n * Decorator to register a controller class with a name\n * @param name The name to register the controller under\n */\nexport function controller(name: string) {\n return function <T extends ControllerClass>(constructor: T, _context: ClassDecoratorContext) {\n // Access globalThis.snice directly to ensure consistency\n const registry = (globalThis as any).snice?.controllerRegistry;\n if (!registry) {\n throw new Error('Snice global registry not initialized');\n }\n registry.set(name, constructor);\n // Mark as controller class for channel decorator detection\n (constructor.prototype as any)[IS_CONTROLLER_CLASS] = true;\n // Preserve the registry name on the class. Direct class attachments still\n // skip registry lookup; this is only their inspectable DOM label.\n Object.defineProperty(constructor, CONTROLLER_REGISTRY_NAME, {\n value: name,\n configurable: true\n });\n\n const pending = snice.pendingControllerAttachments.get(name);\n if (pending) {\n snice.pendingControllerAttachments.delete(name);\n queueMicrotask(() => {\n for (const element of pending) {\n const nativeName = (element as any)[NATIVE_CONTROLLER];\n const desiredName = nativeName === undefined\n ? (element as any)[CONTROLLER]\n : nativeName;\n if (desiredName !== name) continue;\n\n attachController(element, name).catch(error => {\n if (error?.name !== 'ControllerAttachAborted') {\n console.error(`Failed to attach controller \"${name}\":`, error);\n }\n });\n }\n });\n }\n return constructor;\n };\n}\n\n/** Queue an element until its controller module finishes registering. */\nexport function deferControllerAttachment(element: HTMLElement, controllerName: string): void {\n // Registration can win the microtask race between attachController's\n // rejected promise and this recovery path. Retry immediately in that case.\n if (snice.controllerRegistry.has(controllerName)) {\n queueMicrotask(() => {\n const nativeName = (element as any)[NATIVE_CONTROLLER];\n const desiredName = nativeName === undefined\n ? (element as any)[CONTROLLER]\n : nativeName;\n if (desiredName !== controllerName) return;\n\n attachController(element, controllerName).catch(error => {\n if (error?.name !== 'ControllerAttachAborted') {\n console.error(`Failed to attach controller \"${controllerName}\":`, error);\n }\n });\n });\n return;\n }\n\n let pending = snice.pendingControllerAttachments.get(controllerName);\n if (!pending) {\n pending = new Set();\n snice.pendingControllerAttachments.set(controllerName, pending);\n }\n pending.add(element);\n\n // Give synchronously evaluated and microtask-delayed controller modules a\n // chance to register, while keeping genuinely missing controllers loud.\n queueMicrotask(() => {\n if (snice.pendingControllerAttachments.get(controllerName)?.has(element)) {\n console.error(\n `Failed to attach controller \"${controllerName}\":`,\n new Error(`Controller \"${controllerName}\" not found in registry`)\n );\n }\n });\n}\n\n/**\n * True when the value is a controller class that went through @controller().\n * The decorator is required — it registers the class, marks it, and flushes\n * pending attachments. Direct class binding only changes the attach side.\n */\nexport function isControllerClass(value: unknown): value is ControllerClass {\n return typeof value === 'function'\n && (value as any).prototype?.[IS_CONTROLLER_CLASS] === true;\n}\n\n/** Human-readable label for a controller reference (registry name or class). */\nfunction controllerLabel(controller: string | ControllerClass): string {\n return typeof controller === 'string'\n ? controller\n : (controller?.name || '(anonymous controller class)');\n}\n\n/** Registry/decorator name used for a direct class attachment's DOM marker. */\nfunction directControllerAttributeName(controllerClass: ControllerClass): string {\n const registeredName = Object.prototype.hasOwnProperty.call(controllerClass, CONTROLLER_REGISTRY_NAME)\n ? (controllerClass as any)[CONTROLLER_REGISTRY_NAME]\n : undefined;\n return typeof registeredName === 'string'\n ? registeredName\n : controllerLabel(controllerClass);\n}\n\n/**\n * Write the inspectable controller marker without feeding it back into the\n * custom-element attribute channel. Native MutationObservers are asynchronous\n * and are excluded independently by DIRECT_CONTROLLER.\n */\nfunction writeControllerAttribute(element: HTMLElement, value: string | null): void {\n if (value === null) {\n if (!element.hasAttribute('controller')) return;\n } else if (element.getAttribute('controller') === value) {\n return;\n }\n\n (element as any)[CONTROLLER_ATTRIBUTE_SYNC] = true;\n try {\n if (value === null) element.removeAttribute('controller');\n else element.setAttribute('controller', value);\n } finally {\n delete (element as any)[CONTROLLER_ATTRIBUTE_SYNC];\n }\n}\n\n/**\n * Restore the diagnostic attribute for an attached class controller. Returns\n * true when the direct class channel owns the element.\n */\nexport function restoreDirectControllerAttribute(element: HTMLElement): boolean {\n if (!(element as any)[DIRECT_CONTROLLER]) return false;\n const source = (element as any)[CONTROLLER_NAME_KEY] as string | ControllerClass | undefined;\n if (typeof source !== 'function') return false;\n writeControllerAttribute(element, directControllerAttributeName(source));\n return true;\n}\n\n/**\n * Attaches a controller to an element\n * @param element The element to attach the controller to\n * @param controller The registry name of the controller, or the decorated\n * controller class itself (classes skip the registry)\n */\nexport async function attachController(element: HTMLElement, controller: string | ControllerClass): Promise<void> {\n if (typeof controller !== 'string') {\n if (typeof controller !== 'function') {\n throw new Error(\n 'attachController: expected a controller name or a controller class, ' +\n `got ${typeof controller}. Controller instances are not supported — pass the class itself.`\n );\n }\n if (!isControllerClass(controller)) {\n throw new Error(\n `Controller class \"${controllerLabel(controller)}\" must be decorated with ` +\n `@controller('name') before it can be attached.`\n );\n }\n }\n\n const controllerName = controllerLabel(controller);\n const existingController = (element as any)[CONTROLLER_KEY] as IController | undefined;\n const existingSource = (element as any)[CONTROLLER_NAME_KEY] as string | ControllerClass | undefined;\n\n // For attribute-managed native elements, check if this is actually the\n // desired controller. Class attachments take the element over instead.\n const nativeController = (element as any)[NATIVE_CONTROLLER];\n if (typeof controller === 'string' && nativeController !== undefined && nativeController !== controller) {\n // This attachment is outdated, skip it\n return;\n }\n\n if (existingSource === controller && existingController) {\n // Already attached and controller exists (name or class reference match)\n if (typeof controller !== 'string') {\n restoreDirectControllerAttribute(element);\n }\n return;\n }\n\n // If there's an existing controller, detach it first\n if (existingController) {\n await detachController(element);\n\n // Light-DOM reconciliation can issue commit() and reconnected() requests\n // for the same class while the previous controller is still detaching.\n // If the other request already installed that exact source, this request\n // is redundant. Different sources retain the established rapid-switch\n // behavior and continue through the normal replacement path.\n const replacement = (element as any)[CONTROLLER_KEY] as IController | undefined;\n const replacementSource = (element as any)[CONTROLLER_NAME_KEY] as string | ControllerClass | undefined;\n if (replacement && replacementSource === controller) {\n if (typeof controller !== 'string') restoreDirectControllerAttribute(element);\n return;\n }\n }\n\n let ControllerClass: ControllerClass;\n if (typeof controller === 'string') {\n // Access globalThis.snice directly to ensure consistency\n const registry = (globalThis as any).snice?.controllerRegistry;\n if (!registry) {\n throw new Error('Snice global registry not initialized');\n }\n\n ControllerClass = registry.get(controller);\n if (!ControllerClass) {\n throw new Error(`Controller \"${controller}\" not found in registry`);\n }\n } else {\n ControllerClass = controller;\n }\n\n // Create controller instance with unique ID and scope\n const controllerInstance = new ControllerClass();\n if (typeof controller !== 'string') {\n // Construction succeeded, so the class channel can safely take ownership.\n // Setting this before construction would leave a stale observer guard when\n // a controller constructor throws.\n (element as any)[DIRECT_CONTROLLER] = true;\n delete (element as any)[NATIVE_CONTROLLER];\n }\n snice.controllerIdCounter += 1;\n const controllerId = snice.controllerIdCounter;\n const scope = new ControllerScope();\n \n // Mark this as a controller instance\n (controllerInstance as any)[IS_CONTROLLER_INSTANCE] = true;\n (controllerInstance as any)[CONTROLLER_ID] = controllerId;\n controllerInstance.element = element;\n \n // Pass router context from element to controller if it exists\n const routerContext = (element as any)[ROUTER_CONTEXT];\n if (routerContext !== undefined) {\n (controllerInstance as any)[ROUTER_CONTEXT] = routerContext;\n }\n \n // Store references. CONTROLLER_NAME_KEY holds the attach source — the\n // registry name string, or the class reference itself for class attaches\n // (reference equality is the dedupe key for classes).\n (element as any)[CONTROLLER_KEY] = controllerInstance;\n (element as any)[CONTROLLER_NAME_KEY] = controller;\n (element as any)[CONTROLLER_OPERATIONS] = scope;\n if (typeof controller !== 'string') {\n // The class reference remains the sole attachment authority. This\n // attribute is diagnostic only; custom-element callbacks and native\n // MutationObservers are guarded from treating it as a string attachment.\n restoreDirectControllerAttribute(element);\n }\n\n // Normally a controller waits for its host's full initialization. The sole\n // exception is attachController(host, ...) from that host's own @ready\n // handler: awaiting ready there would wait on the current handler itself.\n if (!(element as any)[READY_HANDLERS_RUNNING]) {\n // Race against abort (detachController) and a 30s deadline so a caller\n // that forgets to append the element gets a clear error.\n const abort = new AbortController();\n (element as any)[CONTROLLER_ABORT] = abort;\n const ATTACH_DEADLINE_MS = 30_000;\n\n try {\n await Promise.race([\n (element as any).ready,\n new Promise<never>((_, reject) => {\n const onAbort = () => {\n // Tagged so fire-and-forget call sites can tell this designed\n // teardown path apart from real attach failures and stay quiet.\n const error = new Error(`attachController(\"${controllerName}\"): aborted before element was ready (likely detached or never connected)`);\n error.name = 'ControllerAttachAborted';\n reject(error);\n };\n if (abort.signal.aborted) return onAbort();\n abort.signal.addEventListener('abort', onAbort, { once: true });\n const timerId = setTimeout(() => reject(\n new Error(`attachController(\"${controllerName}\"): element did not become ready within ${ATTACH_DEADLINE_MS}ms (did you forget to appendChild it?)`)\n ), ATTACH_DEADLINE_MS);\n abort.signal.addEventListener('abort', () => clearTimeout(timerId), { once: true });\n }),\n ]);\n } catch (error) {\n // Attach never got past `ready` (aborted or deadline). Roll back the\n // stored references so a later attach does not short-circuit against an\n // instance whose attach() never ran.\n if ((element as any)[CONTROLLER_KEY] === controllerInstance) {\n if (typeof controller !== 'string') {\n writeControllerAttribute(element, null);\n }\n delete (element as any)[CONTROLLER_KEY];\n delete (element as any)[CONTROLLER_NAME_KEY];\n delete (element as any)[CONTROLLER_OPERATIONS];\n if (typeof controller !== 'string') {\n delete (element as any)[DIRECT_CONTROLLER];\n }\n }\n throw error;\n } finally {\n if ((element as any)[CONTROLLER_ABORT] === abort) {\n delete (element as any)[CONTROLLER_ABORT];\n }\n }\n }\n\n // Past `ready` — mark the controller so detach knows attach was actually run.\n (controllerInstance as any)[CONTROLLER_ATTACHED] = true;\n\n // Run attach in the controller's scope\n await scope.runOperation(async () => {\n await controllerInstance.attach(element);\n });\n\n // Setup @observe observers for controller\n setupObservers(controllerInstance, element);\n\n // Setup @channel handlers for controller\n setupResponseHandlers(controllerInstance, element);\n\n // Setup @on event handlers for controller\n setupEventHandlers(controllerInstance, element);\n\n element.dispatchEvent(new CustomEvent('controller-attached', {\n detail: { name: controllerName, controller: controllerInstance }\n }));\n}\n\n/**\n * Detaches a controller from an element\n * @param element The element to detach the controller from\n */\nexport async function detachController(element: HTMLElement): Promise<void> {\n // If attachController is currently awaiting `.ready`, short-circuit that\n // wait so the pending attach rejects immediately instead of hanging.\n const pendingAbort = (element as any)[CONTROLLER_ABORT] as AbortController | undefined;\n if (pendingAbort) pendingAbort.abort();\n\n const controllerInstance = (element as any)[CONTROLLER_KEY] as IController | undefined;\n const controllerSource = (element as any)[CONTROLLER_NAME_KEY] as string | ControllerClass | undefined;\n const scope = (element as any)[CONTROLLER_OPERATIONS] as ControllerScope | undefined;\n\n if (!controllerInstance) {\n return;\n }\n\n // Claim the controller immediately — before any await — so a second detach\n // that overlaps this one (e.g. disconnect's fire-and-forget detach racing a\n // controller reassignment) finds no instance and returns, instead of running\n // detach() a second time on the same controller. The rest of this function\n // works off the locals captured above.\n if (typeof controllerSource === 'function') {\n // Remove the class channel's diagnostic marker while its guards are still\n // active. A queued native MutationObserver therefore sees no attribute and\n // cannot resurrect a registry attachment after detach.\n writeControllerAttribute(element, null);\n }\n delete (element as any)[CONTROLLER_KEY];\n delete (element as any)[CONTROLLER_NAME_KEY];\n delete (element as any)[CONTROLLER_OPERATIONS];\n if (typeof controllerSource === 'function') {\n // Class attach owned the element — release it back to the attribute channel.\n delete (element as any)[DIRECT_CONTROLLER];\n }\n\n // A controller whose attach() was aborted before it ever ran must not have\n // detach() (or the teardown/event) run on it.\n if (!(controllerInstance as any)[CONTROLLER_ATTACHED]) {\n return;\n }\n\n // Run detach in the controller's scope\n if (scope) {\n await scope.runOperation(async () => {\n await controllerInstance.detach(element);\n });\n } else {\n await controllerInstance.detach(element);\n }\n \n controllerInstance.element = null;\n\n // Cleanup @observe observers for controller\n cleanupObservers(controllerInstance);\n\n // Cleanup @channel handlers for controller\n cleanupResponseHandlers(controllerInstance);\n\n // Cleanup @on event handlers for controller\n cleanupEventHandlers(controllerInstance);\n \n // Cleanup the controller scope\n if (scope) {\n await scope.cleanup();\n }\n \n // Clean up router context reference\n delete (controllerInstance as any)[ROUTER_CONTEXT];\n\n element.dispatchEvent(new CustomEvent('controller-detached', {\n detail: {\n name: controllerSource === undefined ? undefined : controllerLabel(controllerSource),\n controller: controllerInstance\n }\n }));\n}\n\n/**\n * Gets the controller instance attached to an element\n * @param element The element to get the controller from\n * @returns The controller instance or undefined\n */\nexport function getController<T extends IController = IController>(element: HTMLElement): T | undefined {\n return (element as any)[CONTROLLER_KEY] as T | undefined;\n}\n\n/**\n * Gets the controller scope for an element\n * @param element The element to get the scope from\n * @returns The controller scope or undefined\n */\nexport function getControllerScope(element: HTMLElement): ControllerScope | undefined {\n return (element as any)[CONTROLLER_OPERATIONS] as ControllerScope | undefined;\n}\n\n/**\n * Enable controller support for native HTML elements\n * This sets up a MutationObserver to watch for controller attributes\n * on non-custom elements (elements without hyphens in their tag names)\n */\nexport function useNativeElementControllers() {\n // Return if already initialized\n if ((globalThis as any).sniceNativeControllersInitialized) {\n return;\n }\n (globalThis as any).sniceNativeControllersInitialized = true;\n\n // Process elements that already have controller attribute\n function processElement(element: Element) {\n if (!(element instanceof HTMLElement)) return;\n // `tagName` can briefly be null when happy-dom/native mutation observers\n // fire on a node that's been detached mid-callback. Skip cleanly.\n if (!element.tagName || element.tagName.includes('-')) return;\n if ((element as any)[IS_ELEMENT_CLASS]) return;\n\n // A controller CLASS is attached (template binding or direct\n // attachController(el, Class)). The class channel owns the element:\n // attribute writes must not attach over it, and insertion sweeps must\n // not detach it.\n if ((element as any)[DIRECT_CONTROLLER]) {\n // External writes cannot replace a class binding. Keep the DOM marker\n // honest about the class that is actually attached.\n restoreDirectControllerAttribute(element);\n return;\n }\n\n const controllerName = element.getAttribute('controller');\n const currentControllerName = (element as any)[NATIVE_CONTROLLER];\n\n // No change\n if (controllerName === currentControllerName) return;\n\n // No attribute and never attribute-managed — nothing for this channel to\n // do. Without this guard, every added native element (including ones a\n // class controller was imperatively attached to before insertion) would\n // fall into the removal branch and get spuriously detached.\n if (!controllerName && currentControllerName === undefined) return;\n\n // Controller removed\n if (!controllerName) {\n delete (element as any)[NATIVE_CONTROLLER];\n delete (element as any)[CONTROLLER_NAME_KEY];\n detachController(element as HTMLElement).catch(error => {\n console.error(`Failed to detach controller from native element:`, error);\n });\n return;\n }\n\n // Controller added or changed\n (element as any)[NATIVE_CONTROLLER] = controllerName;\n\n if (!(element as any).ready) {\n (element as any).ready = Promise.resolve();\n }\n\n if (currentControllerName) {\n detachController(element as HTMLElement).catch(error => {\n console.error(`Failed to detach old controller from native element:`, error);\n });\n }\n\n attachController(element as HTMLElement, controllerName).catch(error => {\n // Detached before ready — designed teardown, not a failure\n if (error?.name === 'ControllerAttachAborted') {\n console.debug(`Controller \"${controllerName}\" attach aborted (element detached before ready)`);\n return;\n }\n if (error?.message === `Controller \"${controllerName}\" not found in registry`) {\n deferControllerAttachment(element as HTMLElement, controllerName);\n return;\n }\n console.error(`Failed to attach controller \"${controllerName}\" to native element:`, error);\n });\n }\n\n // Set up MutationObserver to watch for controller attributes\n const observer = new MutationObserver((mutations) => {\n for (const mutation of mutations) {\n if (mutation.type === 'attributes' && mutation.attributeName === 'controller') {\n processElement(mutation.target as Element);\n } else if (mutation.type === 'childList') {\n // Process added nodes\n mutation.addedNodes.forEach(node => {\n if (node instanceof HTMLElement) {\n // Process the node itself\n processElement(node);\n // Process all descendants with controller attribute\n node.querySelectorAll('[controller]').forEach(processElement);\n }\n });\n }\n }\n });\n\n function startObserving() {\n document.querySelectorAll('[controller]').forEach(processElement);\n observer.observe(document.body, {\n attributes: true,\n attributeFilter: ['controller'],\n childList: true,\n subtree: true\n });\n }\n\n if (document.readyState === 'loading') {\n document.addEventListener('DOMContentLoaded', startObserving);\n } else {\n startObserving();\n }\n\n // Store observer reference for cleanup if needed\n (globalThis as any).sniceNativeControllerObserver = observer;\n}\n\n/**\n * Stop watching for native element controllers\n */\nexport function cleanupNativeElementControllers() {\n const observer = (globalThis as any).sniceNativeControllerObserver;\n if (observer) {\n observer.disconnect();\n delete (globalThis as any).sniceNativeControllerObserver;\n delete (globalThis as any).sniceNativeControllersInitialized;\n }\n}\n\n/**\n * Registers a cleanup function for the current controller\n * @param controller The controller instance\n * @param key A unique key for this cleanup function\n * @param cleanup The cleanup function to register\n */\nexport function registerControllerCleanup(controller: IController, key: string, cleanup: Function): void {\n if (!controller.element) return;\n \n const scope = getControllerScope(controller.element as HTMLElement);\n if (scope) {\n scope.register(key, cleanup);\n }\n}\n","/**\n * @context decorator for receiving router context updates\n */\n\nimport { CONTEXT_HANDLER, NAVIGATION_CONTEXT_INSTANCE, CONTEXT_REGISTER, CONTEXT_UNREGISTER, CONTEXT_TIMER, CONTEXT_CALLED, CONTEXT_METHODS } from './symbols';\nimport { getSymbol } from './symbols';\nimport type { Context } from './types/context';\n\nconst CONTEXT_HANDLERS = getSymbol('context-handlers');\n\n/**\n * Options for the @context decorator\n */\nexport interface ContextOptions {\n /** Debounce delay in milliseconds - waits for quiet period before calling */\n debounce?: number;\n /** Throttle delay in milliseconds - limits calls to at most once per period */\n throttle?: number;\n /** Only call the method once, then unregister */\n once?: boolean;\n}\n\n/**\n * @context decorator for receiving router context updates\n *\n * @example\n * ```typescript\n * @element('my-layout')\n * class MyLayout extends HTMLElement {\n * @context\n * handleContext(ctx: Context) {\n * this.renderNav(ctx.placards, ctx.currentRoute);\n * }\n *\n * @context({ debounce: 300 })\n * handleContextDebounced(ctx: Context) {\n * // Called after 300ms of no updates\n * }\n * }\n * ```\n */\nexport function context(options: ContextOptions = {}) {\n return function (originalMethod: any, context: ClassMethodDecoratorContext) {\n const methodName = context.name as string;\n context.addInitializer(function (this: any) {\n const constructor = this.constructor as any;\n\n // hasOwnProperty guards so subclasses don't mutate parent state via\n // the prototype chain.\n if (!Object.prototype.hasOwnProperty.call(constructor, CONTEXT_METHODS)) {\n constructor[CONTEXT_METHODS] = new Set();\n }\n if (constructor[CONTEXT_METHODS].has(originalMethod)) return;\n constructor[CONTEXT_METHODS].add(originalMethod);\n\n if (!Object.prototype.hasOwnProperty.call(constructor, CONTEXT_HANDLERS)) {\n const inherited = constructor[CONTEXT_HANDLERS];\n constructor[CONTEXT_HANDLERS] = inherited ? [...inherited] : [];\n }\n\n constructor[CONTEXT_HANDLERS].push({\n methodName,\n method: originalMethod,\n options,\n });\n });\n\n return originalMethod;\n };\n}\n\n/**\n * Setup context handler for an element instance\n * Called automatically during element connection\n */\nexport function setupContextHandler(element: HTMLElement) {\n const handlers = (element.constructor as any)[CONTEXT_HANDLERS];\n if (!handlers || !Array.isArray(handlers) || handlers.length === 0) {\n return;\n }\n\n // Get the Context instance from the router\n const ctx = (element as any)[CONTEXT_HANDLER];\n if (!ctx) {\n return;\n }\n\n // Store the Context instance for cleanup\n (element as any)[NAVIGATION_CONTEXT_INSTANCE] = ctx;\n\n // Register each handler with the Context\n for (const handler of handlers) {\n const { methodName, method, options } = handler;\n const wrappedMethodName = `__wrapped_${methodName}`;\n\n // Create wrapped method with timing controls\n (element as any)[wrappedMethodName] = function (context: Context) {\n // `once` is tracked PER method (not a single element-level flag) so\n // multiple once handlers on the same element each fire.\n const called: Set<string> = (element as any)[CONTEXT_CALLED] ||\n ((element as any)[CONTEXT_CALLED] = new Set<string>());\n\n if (options.once && called.has(methodName)) {\n return;\n }\n\n const callMethod = () => {\n method.call(element, context);\n\n // Handle once option\n if (options.once) {\n called.add(methodName);\n // Unregister ONLY this handler, not the whole element — otherwise the\n // element's other @context handlers would stop receiving updates.\n const ctx = (element as any)[NAVIGATION_CONTEXT_INSTANCE];\n if (ctx && typeof ctx[CONTEXT_UNREGISTER] === 'function') {\n (ctx[CONTEXT_UNREGISTER] as (element: HTMLElement, methodName?: string) => void)(element, wrappedMethodName);\n }\n }\n };\n\n // Per-handler timer slot to avoid debounce/throttle handlers on the same\n // element overwriting each other's state.\n const timerSlot = (element as any)[CONTEXT_TIMER] ||\n ((element as any)[CONTEXT_TIMER] = {} as Record<string, any>);\n const timerKey = methodName;\n\n if (options.debounce) {\n clearTimeout(timerSlot[timerKey]?.timeout);\n timerSlot[timerKey] = {\n timeout: setTimeout(callMethod, options.debounce),\n };\n return;\n }\n\n if (options.throttle) {\n const now = Date.now();\n const lastCall = timerSlot[timerKey]?.lastCall || 0;\n if (now - lastCall >= options.throttle) {\n timerSlot[timerKey] = { lastCall: now };\n callMethod();\n }\n return;\n }\n\n callMethod();\n };\n\n // Register with the Context using the wrapped method name\n if (typeof ctx[CONTEXT_REGISTER] === 'function') {\n (ctx[CONTEXT_REGISTER] as (element: HTMLElement, methodName: string) => void)(element, wrappedMethodName);\n }\n }\n}\n\n/**\n * Cleanup context handler for an element instance\n * Called automatically during element disconnection\n */\nexport function cleanupContextHandler(element: HTMLElement) {\n const handlers = (element.constructor as any)[CONTEXT_HANDLERS];\n if (!handlers || !Array.isArray(handlers) || handlers.length === 0) {\n return;\n }\n\n // Clear any pending debounce timers (per-handler slots)\n const timerSlot = (element as any)[CONTEXT_TIMER];\n if (timerSlot && typeof timerSlot === 'object') {\n for (const key of Object.keys(timerSlot)) {\n if (timerSlot[key]?.timeout) clearTimeout(timerSlot[key].timeout);\n }\n delete (element as any)[CONTEXT_TIMER];\n }\n\n for (const handler of handlers) {\n\n // Clean up wrapped method\n const wrappedMethodName = `__wrapped_${handler.methodName}`;\n delete (element as any)[wrappedMethodName];\n }\n\n // Unregister from Context if available\n const ctx = (element as any)[NAVIGATION_CONTEXT_INSTANCE];\n if (ctx && typeof ctx[CONTEXT_UNREGISTER] === 'function') {\n (ctx[CONTEXT_UNREGISTER] as (element: HTMLElement) => void)(element);\n }\n\n delete (element as any)[NAVIGATION_CONTEXT_INSTANCE];\n delete (element as any)[CONTEXT_CALLED];\n}\n","/**\n * Template system for Snice v3.0.0\n * Provides html`` and css`` tagged template processors with differential rendering\n */\n\n// Unique symbols for type checking\n// Use Symbol.for() to ensure symbols are shared across multiple Snice instances\nexport const HTML_RESULT = Symbol.for('snice:html-result');\nexport const CSS_RESULT = Symbol.for('snice:css-result');\n\n// Static css`` sites are the common stylesheet path and can be reused forever.\n// Interpolated sites are intentionally not retained: caching every distinct\n// primitive interpolation would turn a dynamic css`` call into an unbounded\n// per-callsite value history.\nconst cssResultCache = new WeakMap<TemplateStringsArray, CSSResult>();\n\n/**\n * Result of html`` tagged template\n * Contains static strings and dynamic values for differential rendering\n */\nexport interface TemplateResult {\n readonly _$litType$: typeof HTML_RESULT;\n readonly strings: TemplateStringsArray;\n readonly values: readonly any[];\n /** True when created by svg`` — parses in the SVG namespace */\n readonly svg?: boolean;\n}\n\n/**\n * Result of css`` tagged template\n * Contains CSS text for style injection\n */\nexport interface CSSResult {\n readonly _$litType$: typeof CSS_RESULT;\n readonly cssText: string;\n styleSheet?: CSSStyleSheet;\n}\n\n/**\n * Tagged template function for creating HTML templates\n *\n * @example\n * ```typescript\n * html`<div class=\"card\">\n * <h1>${this.title}</h1>\n * <button @click=${this.handleClick}>Click me</button>\n * </div>`\n * ```\n */\nexport function html(strings: TemplateStringsArray, ...values: any[]): TemplateResult {\n return {\n _$litType$: HTML_RESULT,\n strings,\n values\n };\n}\n\n/**\n * Tagged template function for SVG fragments.\n *\n * Bare SVG elements (<circle>, <path>, ...) parse as unknown elements in an\n * HTML context. Use svg`` for fragments composed into a surrounding <svg>:\n *\n * @example\n * ```typescript\n * html`<svg viewBox=\"0 0 100 100\">${svg`<circle cx=\"50\" cy=\"50\" r=${r}></circle>`}</svg>`\n * ```\n */\nexport function svg(strings: TemplateStringsArray, ...values: any[]): TemplateResult {\n return {\n _$litType$: HTML_RESULT,\n strings,\n values,\n svg: true\n };\n}\n\n/**\n * Tagged template function for creating CSS\n *\n * @example\n * ```typescript\n * css`:host {\n * display: block;\n * padding: 1rem;\n * }`\n * ```\n */\nexport function css(strings: TemplateStringsArray, ...values: any[]): CSSResult {\n const cached = values.length === 0 ? cssResultCache.get(strings) : undefined;\n if (cached) return cached;\n\n // Combine strings and values into final CSS text\n let cssText = strings[0];\n for (let i = 0; i < values.length; i++) {\n // Inline a nested css`` result by its text so style fragments compose;\n // String() on a CSSResult object would yield \"[object Object]\".\n const value = values[i];\n cssText += (isCSSResult(value) ? value.cssText : String(value)) + strings[i + 1];\n }\n\n const result: CSSResult = {\n _$litType$: CSS_RESULT,\n cssText\n };\n\n // Try to create constructable stylesheet for better performance\n // This will be cached and reused across instances. Guard against envs\n // without a Document global (for example, workers).\n if (\n typeof CSSStyleSheet !== 'undefined' &&\n typeof Document !== 'undefined' &&\n 'adoptedStyleSheets' in Document.prototype\n ) {\n try {\n const sheet = new CSSStyleSheet();\n (sheet as any).replaceSync(cssText);\n result.styleSheet = sheet;\n } catch (e) {\n // Fall back to regular <style> tag if constructable stylesheets fail\n }\n }\n\n if (values.length === 0) cssResultCache.set(strings, result);\n\n return result;\n}\n\n/**\n * Check if a value is a TemplateResult\n */\nexport function isTemplateResult(value: any): value is TemplateResult {\n return value && value._$litType$ === HTML_RESULT;\n}\n\n/**\n * Check if a value is a CSSResult\n */\nexport function isCSSResult(value: any): value is CSSResult {\n return value && value._$litType$ === CSS_RESULT;\n}\n\n/**\n * Type guard for primitive values\n */\nexport function isPrimitive(value: any): boolean {\n return (\n value === null ||\n value === undefined ||\n typeof value === 'string' ||\n typeof value === 'number' ||\n typeof value === 'boolean' ||\n typeof value === 'bigint'\n );\n}\n\n/**\n * Sanitize HTML to prevent XSS\n * Only allows safe HTML, escapes dangerous content\n */\nexport function sanitize(value: any): string {\n if (value === null || value === undefined) {\n return '';\n }\n\n // Template results are safe - they've been processed\n if (isTemplateResult(value)) {\n return ''; // Will be handled by template renderer\n }\n\n // Convert to string and escape HTML entities\n const str = String(value);\n return str\n .replace(/&/g, '&amp;')\n .replace(/</g, '&lt;')\n .replace(/>/g, '&gt;')\n .replace(/\"/g, '&quot;')\n .replace(/'/g, '&#39;');\n}\n\n/**\n * Nothing - represents no value (different from null/undefined)\n * Used to remove content from templates\n * Use Symbol.for() to ensure symbols are shared across multiple Snice instances\n */\nexport const nothing = Symbol.for('snice:nothing');\n\n/**\n * Type for template values that represent \"no content\"\n */\nexport type Nothing = typeof nothing;\n\n// Unique symbol for unsafe HTML\n// Use Symbol.for() to ensure symbols are shared across multiple Snice instances\nconst UNSAFE_HTML = Symbol.for('snice:unsafe-html');\n\n/**\n * Wrapper for raw HTML strings that should not be escaped\n * WARNING: Only use with sanitized/trusted content to prevent XSS\n */\nexport interface UnsafeHTML {\n readonly _$litType$: typeof UNSAFE_HTML;\n readonly html: string;\n}\n\n/**\n * Mark a string as raw HTML that should not be escaped\n * WARNING: Only use with sanitized content - using user input can lead to XSS!\n *\n * @example\n * ```typescript\n * const htmlString = '<span class=\"bold\">Hello</span>';\n * html`<div>${unsafeHTML(htmlString)}</div>`\n * ```\n */\nexport function unsafeHTML(html: string): UnsafeHTML {\n return {\n _$litType$: UNSAFE_HTML,\n html\n };\n}\n\n/**\n * Check if a value is an UnsafeHTML wrapper\n */\nexport function isUnsafeHTML(value: any): value is UnsafeHTML {\n return value && value._$litType$ === UNSAFE_HTML;\n}\n","export const REPEAT_RESULT = Symbol.for('snice:repeat-result');\n\nexport interface RepeatOptions<T, K> {\n key: (item: T, index: number) => K;\n render: (item: T, index: number) => unknown;\n empty?: unknown | (() => unknown);\n}\n\nexport interface RepeatResult<T = unknown, K = unknown> {\n readonly _$repeat$: typeof REPEAT_RESULT;\n readonly items: readonly T[];\n readonly keys: readonly K[];\n readonly values: readonly unknown[];\n readonly empty: unknown;\n}\n\n/**\n * Render a keyed collection without adding wrapper elements.\n *\n * Keys are mandatory because repeat() is the explicit identity-preserving list\n * API. Duplicate keys throw before DOM reconciliation rather than silently\n * reusing the wrong row.\n */\nexport function repeat<T, K>(\n items: Iterable<T> | null | undefined,\n options: RepeatOptions<T, K>\n): RepeatResult<T, K> {\n if (!options || typeof options.key !== 'function' || typeof options.render !== 'function') {\n throw new TypeError('snice: repeat() requires { key, render }.');\n }\n\n const array = items == null ? [] : Array.from(items);\n const keys = array.map(options.key);\n const seen = new Set<K>();\n for (const key of keys) {\n if (seen.has(key)) {\n throw new Error(`snice: repeat() received duplicate key ${String(key)}.`);\n }\n seen.add(key);\n }\n\n return {\n _$repeat$: REPEAT_RESULT,\n items: array,\n keys,\n values: array.map(options.render),\n empty: array.length === 0\n ? typeof options.empty === 'function'\n ? (options.empty as () => unknown)()\n : options.empty\n : undefined\n };\n}\n\nexport function isRepeatResult(value: unknown): value is RepeatResult {\n return !!value && (value as RepeatResult)._$repeat$ === REPEAT_RESULT;\n}\n","import { ELEMENT_OPTIONS, RENDER_ROOT } from './symbols';\nimport type { ElementOptions } from './types/element-options';\n\nexport type SniceRenderRoot = HTMLElement | ShadowRoot;\n\nconst renderHosts = new WeakSet<HTMLElement>();\n\nexport function getRenderRoot(element: HTMLElement): SniceRenderRoot | null {\n return (element as any)[RENDER_ROOT] || element.shadowRoot || null;\n}\n\nexport function ensureRenderRoot(element: HTMLElement): SniceRenderRoot {\n const existing = getRenderRoot(element);\n if (existing) return existing;\n\n const options = (element.constructor as any)[ELEMENT_OPTIONS] as ElementOptions | undefined;\n let root: SniceRenderRoot;\n\n if (options?.renderRoot === 'light' || options?.shadow === false) {\n root = element;\n } else if (typeof (element as any).createRenderRoot === 'function') {\n root = (element as any).createRenderRoot();\n } else {\n const mode = typeof options?.shadow === 'string' ? options.shadow : 'open';\n root = element.attachShadow({ mode, delegatesFocus: options?.delegatesFocus });\n }\n\n if (root !== element && !(root instanceof ShadowRoot)) {\n throw new TypeError('snice: createRenderRoot() must return the host element or a ShadowRoot.');\n }\n (element as any)[RENDER_ROOT] = root;\n renderHosts.add(element);\n return root;\n}\n\nexport function findRenderHost(node: Node): HTMLElement | null {\n const root = node.getRootNode();\n if (root instanceof ShadowRoot) return root.host as HTMLElement;\n\n let current: Node | null = node;\n while (current) {\n if (current instanceof HTMLElement && renderHosts.has(current)) return current;\n current = current.parentNode;\n }\n return null;\n}\n","\nimport { TemplateResult, CSSResult, HTML_RESULT, CSS_RESULT, isTemplateResult, isUnsafeHTML, UnsafeHTML, nothing, Nothing } from './template';\nimport { isRepeatResult } from './repeat';\nimport { findRenderHost } from './render-root';\nimport { PRE_UPGRADE_PROPERTY_BINDINGS, IS_ELEMENT_CLASS, PENDING_CONTROLLER_BINDING } from './symbols';\nimport { attachController, detachController } from './controller';\nimport { parseKeyboardFilter, matchesKeyboardFilter, warnIfModifierMisuse, type KeyboardFilter } from './keyboard-filter';\n\n// Unique marker for dynamic parts\n// This parses as a comment node but doesn't get escaped in attributes\nconst marker = `snice$${Math.random().toFixed(9).slice(2)}$`;\nconst markerMatch = '?' + marker;\n// A true comment, not a processing instruction (<?...>): in HTML content both\n// parse to the same comment node, but PIs are dropped inside foreign content\n// (<svg>), which would silently kill any node binding inside an svg block.\nconst nodeMarker = `<!--${markerMatch}-->`;\n// Escape the `$` chars — as a bare RegExp they'd be end anchors and the\n// pattern would never match, so marker-bearing text/comments never split.\nconst markerRegex = new RegExp(marker.replace(/\\$/g, '\\\\$'), 'g');\n\n// Template cache - templates with same string array can be reused\nconst templateCache = new WeakMap<TemplateStringsArray, Template>();\n\n// Sentinel for \"not yet set\" - distinct from undefined/null\nconst NOT_COMMITTED = Symbol('not-committed');\n\nfunction markPreUpgradePropertyBinding(element: Element, propertyName: string): void {\n const tagName = element.localName;\n if (!tagName?.includes('-')) return;\n const registry = element.ownerDocument?.defaultView?.customElements ?? globalThis.customElements;\n if (registry?.get(tagName)) return;\n const target = element as any;\n if (!target[PRE_UPGRADE_PROPERTY_BINDINGS]) target[PRE_UPGRADE_PROPERTY_BINDINGS] = new Set<string>();\n target[PRE_UPGRADE_PROPERTY_BINDINGS].add(propertyName);\n}\n\n// noChange sentinel - preserves the currently committed value\nexport const noChange = Symbol.for('snice:no-change');\nexport type NoChange = typeof noChange;\n\n// live() wrapper - marks a property binding value for comparison against the\n// actual DOM property instead of the last committed value\nconst LIVE_MARKER = Symbol.for('snice:live');\n\ninterface LiveValue {\n readonly _$liveMarker$: typeof LIVE_MARKER;\n readonly value: unknown;\n}\n\n/**\n * Wrap a property binding value so the commit compares against the element's\n * CURRENT DOM property rather than the last committed value. Use for inputs\n * whose DOM state the user can change out from under the binding:\n *\n * ```typescript\n * html`<input .value=${live(this.text)} />`\n * ```\n *\n * Without live(), re-rendering with an unchanged bound value skips the DOM\n * write, leaving user-typed text in place.\n */\nexport function live(value: unknown): LiveValue {\n return { _$liveMarker$: LIVE_MARKER, value };\n}\n\nfunction isLive(value: any): value is LiveValue {\n return value && value._$liveMarker$ === LIVE_MARKER;\n}\n\nfunction contextualizeTemplatePreparationError(error: unknown, strings: TemplateStringsArray): Error {\n if (error instanceof Error && /\\bNear \"[\\s\\S]*\"\\.$/.test(error.message)) return error;\n const message = error instanceof Error ? error.message : String(error);\n const source = Array.from(strings).join('${…}').replace(/\\s+/g, ' ').trim();\n const tag = /<([a-z][a-z0-9-]*)>/i.exec(message)?.[1];\n const binding = /binding \"([^\"]+)\"/i.exec(message)?.[1];\n const clue = tag ? `<${tag}` : binding ?? '';\n const clueIndex = clue ? source.indexOf(clue) : -1;\n const center = clueIndex >= 0 ? clueIndex : 0;\n const start = Math.max(0, center - 40);\n const end = Math.min(source.length, center + 80);\n const prefix = start > 0 ? '…' : '';\n const suffix = end < source.length ? '…' : '';\n return new Error(`${message} Near \"${prefix}${source.slice(start, end)}${suffix}\".`, {\n cause: error\n });\n}\n\n/**\n * Check if value is a primitive (can be compared with ===)\n */\nconst isPrimitive = (value: unknown): boolean =>\n value === null || (typeof value !== 'object' && typeof value !== 'function');\n\n/**\n * Check if value is iterable (array or has Symbol.iterator)\n */\nconst isIterable = (value: unknown): value is Iterable<unknown> =>\n Array.isArray(value) || typeof (value as any)?.[Symbol.iterator] === 'function';\n\nconst isPromiseLike = (value: unknown): value is PromiseLike<unknown> =>\n !!value && typeof (value as PromiseLike<unknown>).then === 'function';\n\nconst isAsyncIterable = (value: unknown): value is AsyncIterable<unknown> =>\n !!value && typeof (value as AsyncIterable<unknown>)[Symbol.asyncIterator] === 'function';\n\n/**\n * A prepared template ready for rendering\n */\nclass Template {\n parts: TemplatePart[] = [];\n element: HTMLTemplateElement;\n /**\n * Value index of a `key=${...}` binding in this template, or -1 if unkeyed.\n * Used by keyed list reconciliation in NodePart._commitIterable.\n */\n keyIndex = -1;\n\n constructor(result: TemplateResult, element: HTMLTemplateElement, attrNamesForParts: string[]) {\n this.element = element;\n const walker = document.createTreeWalker(\n element.content,\n NodeFilter.SHOW_ELEMENT | NodeFilter.SHOW_COMMENT | NodeFilter.SHOW_TEXT\n );\n\n let partIndex = 0;\n const nodesToRemove: Node[] = [];\n let node: Node | null;\n\n while ((node = walker.nextNode()) !== null) {\n if (node.nodeType === Node.ELEMENT_NODE) {\n const element = node as Element;\n const tagName = element.tagName.toLowerCase();\n const parentTag = element.parentElement?.tagName.toLowerCase();\n\n if ((tagName === 'else' || tagName === 'else-if') && parentTag !== 'if') {\n throw new Error(`snice: <${tagName}> must be a direct child of <if>.`);\n }\n if ((tagName === 'when' || tagName === 'default') && parentTag !== 'case') {\n throw new Error(`snice: <${tagName}> must be a direct child of <case>.`);\n }\n\n // Handle virtual elements: <if>, <else-if>, <case>, <when>\n // Keep them in the DOM with display:contents for now\n // Will optimize later with proper template extraction\n if (tagName === 'if') {\n // <if value=\"${condition}\">children</if>\n const valueAttr = element.getAttribute('value');\n\n if (valueAttr && valueAttr.includes(marker)) {\n // Remove the value attribute\n element.removeAttribute('value');\n\n this.parts.push({\n type: 'conditional-if',\n index: partIndex++,\n element // Keep the <if> element\n });\n\n // Continue processing children normally\n } else {\n throw new Error('snice: <if> requires a condition expression.');\n }\n continue;\n }\n\n // Handle <case> element\n if (tagName === 'case') {\n // <case value=\"${value}\">children</case>\n const valueAttr = element.getAttribute('value');\n\n if (valueAttr && valueAttr.includes(marker)) {\n for (const child of Array.from(element.childNodes)) {\n if (child.nodeType === Node.ELEMENT_NODE) {\n const branchTag = (child as Element).tagName.toLowerCase();\n if (branchTag !== 'when' && branchTag !== 'default') {\n throw new Error('snice: <case> may contain only direct <when> and <default> branches.');\n }\n } else if (\n child.nodeType === Node.TEXT_NODE && child.textContent?.trim() ||\n child.nodeType === Node.COMMENT_NODE && (child as Comment).data.includes(marker)\n ) {\n throw new Error('snice: content inside <case> must be nested in a <when> or <default> branch.');\n }\n }\n // Remove the value attribute\n element.removeAttribute('value');\n\n this.parts.push({\n type: 'conditional-case',\n index: partIndex++,\n element // Keep the <case> element\n });\n\n // Continue processing children normally\n } else {\n throw new Error('snice: <case> requires a value expression.');\n }\n continue;\n }\n\n if (tagName === 'else-if') {\n const valueAttr = element.getAttribute('value');\n if (valueAttr && valueAttr.includes(marker)) {\n element.removeAttribute('value');\n this.parts.push({\n type: 'conditional-else-if',\n index: partIndex++,\n element\n });\n } else {\n throw new Error('snice: <else-if> requires a condition expression.');\n }\n continue;\n }\n\n if (tagName === 'when') {\n const valueAttr = element.getAttribute('value');\n if (valueAttr && valueAttr.includes(marker)) {\n element.removeAttribute('value');\n this.parts.push({\n type: 'conditional-when',\n index: partIndex++,\n element\n });\n }\n continue;\n }\n\n if (element.hasAttributes()) {\n const attributes = element.attributes;\n const attrsToRemove: Attr[] = [];\n\n for (let i = 0; i < attributes.length; i++) {\n const attr = attributes[i];\n const value = attr.value;\n\n // Check for attribute bindings\n if (value.includes(marker)) {\n attrsToRemove.push(attr);\n\n // Get original attribute name with preserved case\n const originalName = attrNamesForParts[partIndex] || attr.name;\n\n // Extract static string segments by splitting on marker\n const attrStrings = value.split(marker);\n\n // Number of expressions = number of markers = attrStrings.length - 1\n const expressionCount = attrStrings.length - 1;\n\n // Property/boolean/event bindings take a SINGLE expression — they\n // can't concatenate static text (a `.prop` is an object, not a\n // string). They consume the first expression; any static text or\n // extra expressions are ignored. But the value index must still\n // advance by the true marker count, or every later binding shifts.\n const isSingleExpressionBinding =\n /^@@?|^[.?]/.test(originalName) ||\n originalName.startsWith('...') ||\n originalName.startsWith('class:') ||\n originalName.startsWith('style:');\n if (isSingleExpressionBinding) {\n const hasStaticText = attrStrings.some((s) => s !== '');\n if (expressionCount > 1 || hasStaticText) {\n console.warn(\n `snice: binding \"${originalName}\" takes a single expression; ` +\n `static text and extra interpolations are ignored. ` +\n `Use a plain attribute for string interpolation.`\n );\n }\n }\n\n if (originalName.startsWith('...')) {\n const spreadName = originalName.slice(3).toLowerCase();\n if (!['props', 'properties', 'attrs', 'attributes', 'events'].includes(spreadName)) {\n throw new Error(\n `snice: unknown spread binding \"${originalName}\". ` +\n 'Use ...props, ...attrs, or ...events.'\n );\n }\n this.parts.push({\n type: 'spread',\n index: partIndex,\n name: spreadName,\n element\n });\n partIndex += expressionCount;\n } else if (originalName.startsWith('class:')) {\n if (!originalName.slice(6)) throw new Error('snice: class: binding requires a class name.');\n this.parts.push({\n type: 'class',\n index: partIndex,\n name: originalName.slice(6),\n element\n });\n partIndex += expressionCount;\n } else if (originalName.startsWith('style:')) {\n if (!originalName.slice(6)) throw new Error('snice: style: binding requires a CSS property name.');\n this.parts.push({\n type: 'style',\n index: partIndex,\n name: originalName.slice(6),\n element\n });\n partIndex += expressionCount;\n } else if (originalName.startsWith('@@')) {\n if (!originalName.slice(2).split('|')[0]) throw new Error('snice: event binding requires an event name.');\n // Escaped event binding for events with @ in the name (e.g., @@snice/event -> @snice/event)\n this.parts.push({\n type: 'event',\n index: partIndex,\n name: originalName.slice(1), // Keep the @ in the event name\n element\n });\n partIndex += expressionCount;\n } else if (originalName.startsWith('@')) {\n if (!originalName.slice(1).split('|')[0]) throw new Error('snice: event binding requires an event name.');\n // Event binding (single value only)\n this.parts.push({\n type: 'event',\n index: partIndex,\n name: originalName.slice(1),\n element\n });\n partIndex += expressionCount;\n } else if (originalName.startsWith('.')) {\n if (!originalName.slice(1)) throw new Error('snice: property binding requires a property name.');\n // Property binding (single value only)\n this.parts.push({\n type: 'property',\n index: partIndex,\n name: originalName.slice(1),\n element\n });\n partIndex += expressionCount;\n } else if (originalName.startsWith('?')) {\n if (!originalName.slice(1)) throw new Error('snice: boolean binding requires an attribute name.');\n // Boolean attribute (single value only)\n this.parts.push({\n type: 'boolean-attribute',\n index: partIndex,\n name: originalName.slice(1),\n element\n });\n partIndex += expressionCount;\n } else if (\n attr.name === 'controller' &&\n attrStrings.length === 2 && attrStrings[0] === '' && attrStrings[1] === ''\n ) {\n // Bare controller=${...} binding: accepts a decorated\n // controller class directly, or a registry name string.\n // Interpolated forms (controller=\"a-${x}\") stay plain\n // string attributes.\n this.parts.push({\n type: 'controller',\n index: partIndex,\n element\n });\n partIndex += expressionCount;\n } else {\n // Regular attribute - supports multiple interpolations\n // Store static string segments for interpolation\n this.parts.push({\n type: 'attribute',\n index: partIndex,\n name: attr.name,\n element,\n attrStrings\n });\n // Increment by number of expressions consumed\n partIndex += expressionCount;\n }\n }\n }\n\n // Remove marker attributes\n for (const attr of attrsToRemove) {\n element.removeAttribute(attr.name);\n }\n }\n } else if (node.nodeType === Node.COMMENT_NODE) {\n const comment = node as Comment;\n // Check for marker match (processing instruction becomes comment)\n if (comment.data === markerMatch) {\n // Node part\n const parent = comment.parentNode!;\n const endNode = document.createComment('');\n parent.insertBefore(endNode, comment.nextSibling);\n\n this.parts.push({\n type: 'node',\n index: partIndex++,\n startNode: comment,\n endNode\n });\n } else if (comment.data.includes(marker)) {\n // Binding(s) inside an authored HTML comment (<!-- ${x} -->).\n // Render values into the comment text; critically, consume the\n // right number of value indices so later parts stay aligned.\n const commentStrings = comment.data.split(markerRegex);\n\n this.parts.push({\n type: 'comment',\n index: partIndex,\n startNode: comment,\n attrStrings: commentStrings\n });\n partIndex += commentStrings.length - 1;\n }\n } else if (node.nodeType === Node.TEXT_NODE) {\n const text = node as Text;\n const data = text.data;\n\n if (data.includes(marker)) {\n // Split text node at markers\n const parent = text.parentNode!;\n const parts = data.split(markerRegex);\n const lastIndex = parts.length - 1;\n\n for (let i = 0; i < lastIndex; i++) {\n parent.insertBefore(document.createTextNode(parts[i]), text);\n const comment = document.createComment('');\n const endNode = document.createComment('');\n parent.insertBefore(comment, text);\n parent.insertBefore(endNode, text);\n\n this.parts.push({\n type: 'node',\n index: partIndex++,\n startNode: comment,\n endNode\n });\n }\n\n // Last part\n if (parts[lastIndex] !== '') {\n text.data = parts[lastIndex];\n } else {\n nodesToRemove.push(text);\n }\n }\n }\n }\n\n // Remove marker nodes\n for (const node of nodesToRemove) {\n node.parentNode?.removeChild(node);\n }\n\n // Record the value index of a `key=${...}` binding (first one wins) so\n // list rendering can associate DOM with keys instead of indices.\n for (const part of this.parts) {\n if (part.type === 'attribute' && part.name === 'key') {\n this.keyIndex = part.index;\n break;\n }\n }\n }\n}\n\ninterface TemplatePart {\n type: 'node' | 'attribute' | 'property' | 'boolean-attribute' | 'event' | 'class' | 'style' | 'spread' | 'controller' | 'conditional-if' | 'conditional-else-if' | 'conditional-case' | 'conditional-when' | 'comment';\n index: number;\n name?: string;\n element?: Element;\n startNode?: Comment;\n endNode?: Comment;\n attrStrings?: string[]; // Static string segments for attribute/comment interpolation\n}\n\n/**\n * Prepare a template for rendering\n *\n * Uses state tracking to correctly handle multi-interpolation in attributes.\n * Tracks whether we're inside a tag and inside a quoted attribute value.\n */\nfunction prepareTemplate(result: TemplateResult): Template {\n // Check cache first\n const { strings } = result;\n const cached = templateCache.get(strings);\n if (cached) {\n return cached;\n }\n\n // Build HTML with markers and extract original attribute names\n const htmlParts: string[] = [];\n const attrNamesForParts: string[] = [];\n\n // State tracking for multi-interpolation support\n let inTag = false; // Inside a tag (between < and >)\n let inAttrValue = false; // Inside a quoted attribute value\n let inComment = false; // Inside an HTML comment (<!-- ... -->)\n let attrQuoteChar = ''; // The quote character (' or \")\n let currentAttrName = ''; // The current attribute name\n\n for (let i = 0; i < strings.length; i++) {\n const str = strings[i];\n htmlParts.push(str);\n\n if (i < strings.length - 1) {\n // Update state by scanning the string\n for (let j = 0; j < str.length; j++) {\n const char = str[j];\n\n if (inComment) {\n // Only the closing --> matters inside a comment\n if (char === '-' && str.startsWith('-->', j)) {\n inComment = false;\n j += 2;\n }\n } else if (!inTag) {\n // Looking for tag start (or comment start)\n if (char === '<') {\n if (str.startsWith('<!--', j)) {\n inComment = true;\n j += 3;\n } else if (/[A-Za-z!/?]/.test(str[j + 1] || '')) {\n inTag = true;\n }\n }\n } else if (!inAttrValue) {\n // Inside tag, but not in attribute value\n if (char === '>') {\n inTag = false;\n } else if (char === '\"' || char === \"'\") {\n inAttrValue = true;\n attrQuoteChar = char;\n } else if (char === '=') {\n // Extract attribute name (look backwards for it).\n // Includes `~` for the \"any-modifier\" keyboard prefix\n // (e.g. `@keydown.~enter`) so it isn't truncated to `.enter`.\n let attrStart = j - 1;\n while (attrStart >= 0 && /[\\w\\-\\.@\\?/:\\+~|]/.test(str[attrStart])) {\n attrStart--;\n }\n currentAttrName = str.substring(attrStart + 1, j).trim();\n }\n } else {\n // Inside quoted attribute value\n if (char === attrQuoteChar) {\n inAttrValue = false;\n attrQuoteChar = '';\n }\n }\n }\n\n // Now determine what kind of marker to insert based on current state\n if (inComment) {\n // Binding inside an HTML comment — insert a plain marker into the\n // comment text. The Template scanner turns it into a CommentPart so\n // the value index stays aligned (a swallowed marker would shift every\n // binding after the comment).\n attrNamesForParts.push('');\n htmlParts.push(marker);\n } else if (inAttrValue) {\n // We're inside a quoted attribute value - this is an attribute binding\n // For subsequent interpolations in same attribute, keep using same attr name\n attrNamesForParts.push(currentAttrName);\n htmlParts.push(marker);\n } else if (inTag) {\n // Inside tag but not in attr value - check for special cases\n // Check if this is start of attribute value (= at end of string)\n const trimmed = str.trimEnd();\n if (trimmed.endsWith('=')) {\n // Extract attribute name (same `~` inclusion as the in-tag branch\n // above — supports `@keydown.~enter` keyboard modifier prefix).\n let attrStart = trimmed.length - 2;\n while (attrStart >= 0 && /[\\w\\-\\.@\\?\\/:\\+~|]/.test(trimmed[attrStart])) {\n attrStart--;\n }\n currentAttrName = trimmed.substring(attrStart + 1, trimmed.length - 1).trim();\n attrNamesForParts.push(currentAttrName);\n htmlParts.push(marker);\n } else {\n // Check if this is a meta element (<if> or <case>)\n const metaElementMatch = str.match(/<(if|else-if|case|when)\\s*$/);\n if (metaElementMatch) {\n currentAttrName = 'value';\n attrNamesForParts.push('value');\n htmlParts.push(`value=\"${marker}\"`);\n } else {\n const nearbyTemplate = (\n str.slice(-40) + '${…}' + (strings[i + 1] ?? '').slice(0, 40)\n ).replace(/\\s+/g, ' ').trim();\n throw new Error(\n 'snice: expressions directly in opening tags are not supported; ' +\n 'use an explicit attribute, property, event, class, style, or named spread binding. ' +\n `Near \"${nearbyTemplate}\".`\n );\n }\n }\n } else {\n // Outside any tag - this is node content\n attrNamesForParts.push('');\n htmlParts.push(nodeMarker);\n }\n }\n }\n\n const html = htmlParts.join('');\n\n const template = document.createElement('template');\n if (result.svg) {\n // Parse in the SVG namespace by wrapping, then unwrap: the parsed nodes\n // keep their namespace when moved out of the temporary <svg> element.\n template.innerHTML = `<svg>${html}</svg>`;\n const wrapper = template.content.firstElementChild!;\n while (wrapper.firstChild) {\n template.content.insertBefore(wrapper.firstChild, wrapper);\n }\n template.content.removeChild(wrapper);\n } else {\n template.innerHTML = html;\n }\n\n let tmpl: Template;\n try {\n tmpl = new Template(result, template, attrNamesForParts);\n } catch (error) {\n throw contextualizeTemplatePreparationError(error, strings);\n }\n // Cache the template for reuse\n templateCache.set(strings, tmpl);\n return tmpl;\n}\n\n/**\n * Extract the key of a list item rendered from a template with a\n * `key=${...}` binding. Returns undefined for unkeyed items.\n */\nfunction getItemKey(item: unknown): unknown {\n if (!isTemplateResult(item)) return undefined;\n const tmpl = prepareTemplate(item as TemplateResult);\n return tmpl.keyIndex === -1 ? undefined : (item as TemplateResult).values[tmpl.keyIndex];\n}\n\n/**\n * Instance of a rendered template\n */\nexport class TemplateInstance {\n template: Template;\n strings: TemplateStringsArray;\n parts: Part[] = [];\n fragment: DocumentFragment | null = null;\n private conditionalParts: Array<{part: Part; index: number}> = []; // if/case parts with their indices\n private regularParts: Array<{part: Part; index: number}> = []; // all other parts with their indices\n\n constructor(result: TemplateResult) {\n this.template = prepareTemplate(result);\n this.strings = result.strings;\n }\n\n /**\n * Check if this instance uses the same template strings\n * (template identity is based on the strings array reference)\n */\n isSameTemplate(strings: TemplateStringsArray): boolean {\n return this.strings === strings;\n }\n\n renderFragment(): DocumentFragment {\n if (!this.fragment) {\n // First render - clone template and create parts\n this.fragment = this.template.element.content.cloneNode(true) as DocumentFragment;\n\n // Build a map of nodes from template to cloned fragment\n const walker = document.createTreeWalker(\n this.template.element.content,\n NodeFilter.SHOW_ALL\n );\n const clonedWalker = document.createTreeWalker(\n this.fragment,\n NodeFilter.SHOW_ALL\n );\n\n const nodeMap = new Map<Node, Node>();\n let templateNode = walker.currentNode;\n let clonedNode = clonedWalker.currentNode;\n\n while (templateNode && clonedNode) {\n nodeMap.set(templateNode, clonedNode);\n templateNode = walker.nextNode()!;\n clonedNode = clonedWalker.nextNode()!;\n }\n\n const dynamicWhenElements = new Set<Element>();\n for (const definition of this.template.parts) {\n if (definition.type === 'conditional-when') {\n dynamicWhenElements.add(nodeMap.get(definition.element!) as Element);\n }\n }\n\n for (let i = 0; i < this.template.parts.length; i++) {\n const partDef = this.template.parts[i];\n let part: Part;\n\n switch (partDef.type) {\n case 'node':\n const startNode = nodeMap.get(partDef.startNode!) as Comment;\n const endNode = nodeMap.get(partDef.endNode!) as Comment;\n part = new NodePart(startNode, endNode);\n break;\n case 'attribute':\n const attrElement = nodeMap.get(partDef.element!) as Element;\n part = new AttributePart(attrElement, partDef.name!, partDef.attrStrings);\n break;\n case 'property':\n const propElement = nodeMap.get(partDef.element!) as Element;\n part = new PropertyPart(propElement, partDef.name!);\n break;\n case 'boolean-attribute':\n const boolElement = nodeMap.get(partDef.element!) as Element;\n part = new BooleanAttributePart(boolElement, partDef.name!);\n break;\n case 'event':\n const eventElement = nodeMap.get(partDef.element!) as Element;\n part = new EventPart(eventElement, partDef.name!);\n break;\n case 'class':\n const classElement = nodeMap.get(partDef.element!) as Element;\n part = new ClassPart(classElement, partDef.name!);\n break;\n case 'style':\n const styleElement = nodeMap.get(partDef.element!) as HTMLElement;\n part = new StylePart(styleElement, partDef.name!);\n break;\n case 'spread':\n const spreadElement = nodeMap.get(partDef.element!) as Element;\n part = new SpreadPart(spreadElement, partDef.name!);\n break;\n case 'controller':\n const controllerElement = nodeMap.get(partDef.element!) as HTMLElement;\n part = new ControllerPart(controllerElement);\n break;\n case 'conditional-if':\n const conditionalIfElement = nodeMap.get(partDef.element!) as Element;\n part = new ConditionalIfPart(conditionalIfElement);\n break;\n case 'conditional-else-if':\n const conditionalElseIfElement = nodeMap.get(partDef.element!) as Element;\n part = new ConditionalElseIfPart(conditionalElseIfElement);\n break;\n case 'conditional-case':\n const conditionalCaseElement = nodeMap.get(partDef.element!) as Element;\n part = new ConditionalCasePart(conditionalCaseElement, dynamicWhenElements);\n break;\n case 'conditional-when':\n const conditionalWhenElement = nodeMap.get(partDef.element!) as Element;\n part = new ConditionalWhenPart(conditionalWhenElement);\n break;\n case 'comment':\n const commentNode = nodeMap.get(partDef.startNode!) as Comment;\n part = new CommentPart(commentNode, partDef.attrStrings!);\n break;\n default:\n throw new Error(`Unknown part type: ${(partDef as any).type}`);\n }\n\n this.parts.push(part);\n\n // Separate conditional parts from regular parts for optimized update\n // Use partDef.index (the VALUE index) not i (the part array index)\n if (\n part instanceof ConditionalIfPart ||\n part instanceof ConditionalElseIfPart ||\n part instanceof ConditionalCasePart ||\n part instanceof ConditionalWhenPart\n ) {\n this.conditionalParts.push({part, index: partDef.index});\n } else {\n this.regularParts.push({part, index: partDef.index});\n }\n }\n\n }\n\n return this.fragment;\n }\n\n render(values: readonly any[]): DocumentFragment {\n const fragment = this.renderFragment();\n // Commit values to parts\n this.update(values);\n return fragment;\n }\n\n update(values: readonly any[]): void {\n // Optimized: Process conditional parts first (if any), then regular parts\n // Using pre-separated arrays with cached indices avoids instanceof and indexOf calls\n\n // Process conditional parts first (they control visibility)\n for (const {part, index} of this.conditionalParts) {\n part.commit(values[index]);\n }\n\n // Conditions are staged above, then flushed once. This avoids transiently\n // mounting an else/default branch while later else-if/when expressions in\n // the same update are still being committed.\n const flushed = new Set<Part>();\n for (const {part} of this.conditionalParts) {\n const coordinator = part instanceof ConditionalElseIfPart\n ? part.coordinator\n : part instanceof ConditionalWhenPart\n ? part.coordinator\n : part;\n if (flushed.has(coordinator)) continue;\n flushed.add(coordinator);\n if (coordinator instanceof ConditionalIfPart || coordinator instanceof ConditionalCasePart) {\n coordinator.flush();\n }\n }\n\n // Then process regular parts\n let i = 0;\n for (const {part, index} of this.regularParts) {\n // AttributeParts with interpolation consume multiple values\n if (part instanceof AttributePart && part.strings !== undefined) {\n // Pass full values array and starting index for interpolation\n part.commit(values, index);\n // The part consumes (strings.length - 1) values\n // But since we're iterating by template part index, this is handled by the Template\n } else if (part instanceof CommentPart) {\n // CommentParts also consume (strings.length - 1) values\n part.commit(values, index);\n } else {\n part.commit(values[index]);\n }\n }\n\n // Branch switches can move event-bearing nodes between the live DOM and\n // parked fragments. Reconcile connection state after every update so\n // listeners detach while parked and reattach when their branch returns.\n let lifecycleError: unknown;\n for (const part of this.parts) {\n try {\n if (part.isConnected) part.reconnected();\n else part.disconnected();\n } catch (error) {\n lifecycleError ??= error;\n }\n }\n if (lifecycleError) throw lifecycleError;\n }\n\n clear(): void {\n let lifecycleError: unknown;\n for (const part of this.parts) {\n try {\n part.destroy();\n } catch (error) {\n lifecycleError ??= error;\n }\n }\n if (lifecycleError) throw lifecycleError;\n }\n\n disconnected(preserveEventListeners = false): void {\n let lifecycleError: unknown;\n for (const part of this.parts) {\n try {\n part.disconnected(preserveEventListeners);\n } catch (error) {\n lifecycleError ??= error;\n }\n }\n if (lifecycleError) throw lifecycleError;\n }\n\n reconnected(): void {\n let lifecycleError: unknown;\n for (const part of this.parts) {\n try {\n part.reconnected();\n } catch (error) {\n lifecycleError ??= error;\n }\n }\n if (lifecycleError) throw lifecycleError;\n }\n\n}\n\n/**\n * Base class for all parts\n */\nexport abstract class Part {\n abstract readonly type: string;\n\n get isConnected(): boolean {\n return (this as any).element?.isConnected ?? false;\n }\n\n disconnected(_preserveEventListeners = false): void {}\n\n reconnected(): void {}\n\n destroy(): void {\n let lifecycleError: unknown;\n try {\n this.clear();\n } catch (error) {\n lifecycleError = error;\n }\n if (lifecycleError) throw lifecycleError;\n }\n\n abstract commit(value: any): void;\n abstract clear(): void;\n}\n\n/**\n * NodePart handles text content and nested templates\n *\n * Lit-HTML style optimizations:\n * - Reuses TemplateInstance when same template strings are rendered\n * - Reuses text nodes when updating primitive → primitive\n * - Reuses child NodeParts when rendering arrays\n */\nexport class NodePart extends Part {\n readonly type = 'node' as const;\n private startNode: Comment;\n private endNode: Comment;\n private _committedValue: any = NOT_COMMITTED;\n private _itemKeys: unknown[] | null = null; // keys of the last committed iterable, when fully keyed\n private _asyncSource: PromiseLike<unknown> | AsyncIterable<unknown> | null = null;\n private _asyncVersion = 0;\n private _asyncIterator: AsyncIterator<unknown> | null = null;\n private _asyncRunning = false;\n private _asyncStarted = false;\n private _asyncCompleted = false;\n private _asyncPaused = false;\n private _committingAsyncValue = false;\n\n constructor(startNode: Comment, endNode: Comment) {\n super();\n this.startNode = startNode;\n this.endNode = endNode;\n }\n\n commit(value: any): void {\n // Handle noChange sentinel\n if (value === noChange) {\n return;\n }\n\n if (isPromiseLike(value) || isAsyncIterable(value)) {\n this._commitAsync(value);\n return;\n }\n if (!this._committingAsyncValue && this._asyncSource) this._cancelAsync(true);\n\n // Handle nothing/null/undefined/empty - clear content\n if (value === nothing || value == null || value === '') {\n if (this._committedValue !== nothing) {\n const cleanupError = this._clear();\n this._committedValue = nothing;\n if (cleanupError) throw cleanupError;\n }\n this._committedValue = nothing;\n return;\n }\n\n // Handle primitives (string, number, boolean, bigint, symbol)\n if (isPrimitive(value)) {\n if (value !== this._committedValue) {\n this._commitText(value);\n }\n return;\n }\n\n // Handle nested templates\n if (isTemplateResult(value)) {\n this._commitTemplateResult(value);\n return;\n }\n\n // Explicit keyed repeat() result. It feeds keys directly into the list\n // reconciler, so rendered roots do not need a synthetic key attribute or\n // wrapper element.\n if (isRepeatResult(value)) {\n if (value.values.length === 0) {\n this.commit(value.empty ?? nothing);\n } else {\n this._commitIterable(value.values, value.keys);\n }\n return;\n }\n\n // Handle unsafe HTML\n if (isUnsafeHTML(value)) {\n this._commitUnsafeHTML(value);\n return;\n }\n\n // Handle DOM nodes\n if ((value as Node).nodeType !== undefined) {\n this._commitNode(value as Node);\n return;\n }\n\n // Handle iterables (arrays, etc.)\n if (isIterable(value)) {\n this._commitIterable(value);\n return;\n }\n\n // Fallback: convert to string\n this._commitText(value);\n }\n\n /**\n * Commit a primitive value as text\n * OPTIMIZATION: Reuses existing text node if previous value was also primitive\n */\n private _commitText(value: any): void {\n // Try to reuse existing text node\n const canReuse =\n this._committedValue !== NOT_COMMITTED &&\n this._committedValue !== nothing &&\n isPrimitive(this._committedValue) &&\n !Array.isArray(this._committedValue);\n\n if (canReuse) {\n const textNode = this.startNode.nextSibling as Text;\n if (textNode && textNode.nodeType === Node.TEXT_NODE) {\n textNode.data = String(value);\n this._committedValue = value;\n return;\n }\n }\n\n const cleanupError = this._clear();\n this._insertBefore(document.createTextNode(String(value)));\n this._committedValue = value;\n if (cleanupError) throw cleanupError;\n }\n\n /**\n * Commit a TemplateResult\n * OPTIMIZATION: Reuses TemplateInstance if same template strings\n */\n private _commitTemplateResult(result: TemplateResult): void {\n // Check if we can reuse the existing TemplateInstance\n const committedInstance = this._committedValue as TemplateInstance;\n\n if (committedInstance instanceof TemplateInstance) {\n // Check if same template by comparing strings reference\n const cachedTemplate = templateCache.get(result.strings);\n if (cachedTemplate && committedInstance.template === cachedTemplate) {\n // SAME TEMPLATE - just update values (efficient path!)\n committedInstance.update(result.values);\n return;\n }\n }\n\n // Different template or first render: prepare and validate the replacement\n // while it is detached. If a binding throws, the currently\n // committed range remains intact and its lifecycle stays connected.\n const instance = new TemplateInstance(result);\n const fragment = instance.renderFragment();\n try {\n instance.update(result.values);\n } catch (error) {\n instance.clear();\n throw error;\n }\n\n const previousValue = this._committedValue;\n const previousKeys = this._itemKeys;\n const previousFragment = this.endNode.ownerDocument.createDocumentFragment();\n let previousNode = this.startNode.nextSibling;\n while (previousNode && previousNode !== this.endNode) {\n const next = previousNode.nextSibling;\n previousFragment.appendChild(previousNode);\n previousNode = next;\n }\n\n this._insertBefore(fragment);\n this._committedValue = instance;\n this._itemKeys = null;\n try {\n if (this.isConnected) instance.reconnected();\n } catch (error) {\n try {\n instance.clear();\n } catch (cleanupError) {\n console.error('snice: failed to clean up a rejected nested template:', cleanupError);\n }\n let node = this.startNode.nextSibling;\n while (node && node !== this.endNode) {\n const next = node.nextSibling;\n node.remove();\n node = next;\n }\n this._insertBefore(previousFragment);\n this._committedValue = previousValue;\n this._itemKeys = previousKeys;\n throw error;\n }\n\n this._disposeCommitted(previousValue);\n }\n\n /**\n * Commit an iterable (array, Set, etc.)\n * OPTIMIZATION: Reuses existing NodeParts for items\n */\n private _commitIterable(value: Iterable<unknown>, explicitKeys?: readonly unknown[]): void {\n const items = Array.isArray(value) ? (value as unknown[]) : Array.from(value);\n const newKeys = explicitKeys ? Array.from(explicitKeys) : items.map(getItemKey);\n if (newKeys.length !== items.length) {\n throw new Error('snice: keyed iterable produced a different number of keys and values.');\n }\n const definedKeys = newKeys.filter(key => key !== undefined);\n if (definedKeys.length > 0 && definedKeys.length !== newKeys.length) {\n console.warn(\n 'snice: a list mixes keyed and unkeyed items. Identity falls back to position; ' +\n 'use repeat(items, { key, render }) for deterministic updates.'\n );\n }\n if (definedKeys.length > 0 && new Set(definedKeys).size !== definedKeys.length) {\n throw new Error('snice: a keyed list contains duplicate keys.');\n }\n\n let cleanupError: unknown;\n // If previous value wasn't an array of parts, start fresh\n if (!Array.isArray(this._committedValue) ||\n !(this._committedValue[0] instanceof NodePart)) {\n cleanupError = this._clear();\n this._committedValue = [];\n this._itemKeys = null;\n }\n const allKeyed = items.length > 0 && newKeys.every(k => k !== undefined);\n const oldKeys = this._itemKeys;\n\n // Keyed reconciliation: when every item carries a key=${...} binding and\n // the key order changed, DOM (and its state) follows the key, not the\n // index. Unchanged key order falls through to the cheap index path.\n if (allKeyed && oldKeys && (this._committedValue as NodePart[]).length > 0) {\n const sameOrder =\n oldKeys.length === newKeys.length &&\n newKeys.every((k, i) => k === oldKeys[i]);\n\n if (!sameOrder) {\n cleanupError ??= this._reconcileKeyed(\n items,\n newKeys,\n this._committedValue as NodePart[],\n oldKeys\n );\n this._itemKeys = newKeys;\n if (cleanupError) throw cleanupError;\n return;\n }\n }\n\n const itemParts = this._committedValue as NodePart[];\n let partIndex = 0;\n\n for (const item of items) {\n let itemPart: NodePart;\n\n if (partIndex >= itemParts.length) {\n // Need new NodePart - create with markers\n const startMarker = document.createComment('');\n const endMarker = document.createComment('');\n this._insertBefore(startMarker);\n this._insertBefore(endMarker);\n itemPart = new NodePart(startMarker, endMarker);\n itemParts.push(itemPart);\n } else {\n // Reuse existing NodePart\n itemPart = itemParts[partIndex];\n }\n\n // Set value on this part (recursively handles templates, text, etc.)\n itemPart.commit(item);\n partIndex++;\n }\n\n // Cleanup excess parts from previous render\n if (partIndex < itemParts.length) {\n // Clear DOM for removed items\n for (let i = partIndex; i < itemParts.length; i++) {\n const part = itemParts[i];\n // Dispose async state as well as removing the content. These item parts\n // are leaving the list permanently, not merely being moved.\n try {\n part.destroy();\n } catch (error) {\n cleanupError ??= error;\n }\n // Remove the markers themselves\n part.startNode.remove();\n part.endNode.remove();\n }\n // Truncate array\n itemParts.length = partIndex;\n }\n\n // Remember keys so the next commit can reconcile by key\n this._itemKeys = allKeyed ? newKeys : null;\n if (cleanupError) throw cleanupError;\n }\n\n /**\n * Reorder/reuse item parts so each key keeps its DOM.\n * Old parts whose keys disappeared are removed; new keys get fresh parts.\n */\n private _reconcileKeyed(\n items: unknown[],\n newKeys: unknown[],\n oldParts: NodePart[],\n oldKeys: unknown[]\n ): unknown {\n const parent = this.endNode.parentNode!;\n let cleanupError: unknown;\n\n // Map old parts by key (first occurrence wins on duplicate keys)\n const oldByKey = new Map<unknown, NodePart>();\n for (let i = 0; i < oldParts.length; i++) {\n if (!oldByKey.has(oldKeys[i])) oldByKey.set(oldKeys[i], oldParts[i]);\n }\n\n // Choose a part for each new item: reuse by key, or create during placement\n const reused = new Set<NodePart>();\n const newParts: (NodePart | null)[] = new Array(items.length).fill(null);\n for (let i = 0; i < items.length; i++) {\n const candidate = oldByKey.get(newKeys[i]);\n if (candidate && !reused.has(candidate)) {\n reused.add(candidate);\n newParts[i] = candidate;\n }\n }\n\n // Remove parts whose keys are gone (before placement, so the DOM walk\n // below only ever sees surviving nodes)\n for (const part of oldParts) {\n if (!reused.has(part)) {\n try {\n part.destroy();\n } catch (error) {\n cleanupError ??= error;\n }\n part.startNode.remove();\n part.endNode.remove();\n }\n }\n\n // Place parts in order. `ref` walks the surviving DOM; a part already\n // sitting at `ref` is skipped, anything else is moved (or created) there.\n let ref: Node = this.startNode.nextSibling!;\n for (let i = 0; i < newParts.length; i++) {\n let part = newParts[i];\n\n if (part) {\n if (part.startNode === ref) {\n // Already in position — advance past its range\n ref = part.endNode.nextSibling!;\n } else {\n // Move the part's whole range [startNode..endNode] before ref.\n // Detach into a fragment first, then insert in one operation —\n // node identity (and any state inside) is preserved either way.\n const range = document.createDocumentFragment();\n let node: Node | null = part.startNode;\n const stop: Node | null = part.endNode.nextSibling;\n while (node && node !== stop) {\n const next: Node | null = node.nextSibling;\n range.appendChild(node);\n node = next;\n }\n parent.insertBefore(range, ref);\n }\n } else {\n // New key — fresh part inserted at the current position\n const startMarker = document.createComment('');\n const endMarker = document.createComment('');\n parent.insertBefore(startMarker, ref);\n parent.insertBefore(endMarker, ref);\n part = new NodePart(startMarker, endMarker);\n newParts[i] = part;\n }\n\n part.commit(items[i]);\n }\n\n this._committedValue = newParts as NodePart[];\n return cleanupError;\n }\n\n /**\n * Commit a DOM node directly\n */\n private _commitNode(node: Node): void {\n if (this._committedValue !== node) {\n const cleanupError = this._clear();\n this._insertBefore(node);\n this._committedValue = node;\n if (cleanupError) throw cleanupError;\n }\n }\n\n /**\n * Commit unsafe HTML string\n */\n private _commitUnsafeHTML(value: UnsafeHTML): void {\n // Can't diff arbitrary HTML, but when the STRING is unchanged the DOM is\n // already correct — skip the clear+reparse so live state (typed input\n // values, focus, scroll) inside the block survives unrelated re-renders.\n const prev = this._committedValue;\n if (isUnsafeHTML(prev) && (prev as UnsafeHTML).html === value.html) {\n return;\n }\n\n const cleanupError = this._clear();\n const temp = document.createElement('template');\n temp.innerHTML = value.html;\n this._insertBefore(temp.content);\n this._committedValue = value;\n if (cleanupError) throw cleanupError;\n }\n\n private _commitAsync(source: PromiseLike<unknown> | AsyncIterable<unknown>): void {\n // A Promise/stream object is the identity of the async operation. Once it\n // settles, unrelated parent renders must keep the committed result rather\n // than clearing it and subscribing to the same source again.\n if (source === this._asyncSource) return;\n this._cancelAsync(false);\n this._asyncSource = source;\n this._asyncStarted = false;\n this._asyncCompleted = false;\n this._asyncPaused = false;\n const cleanupError = this._clear();\n this._committedValue = nothing;\n this._startAsyncSource();\n if (cleanupError) throw cleanupError;\n }\n\n private _startAsyncSource(forceConnected = false): void {\n const source = this._asyncSource;\n if (\n !source || this._asyncRunning || this._asyncCompleted ||\n (!forceConnected && !this.isConnected)\n ) return;\n this._asyncRunning = true;\n this._asyncStarted = true;\n this._asyncPaused = false;\n const version = ++this._asyncVersion;\n\n if (isAsyncIterable(source)) {\n try {\n this._asyncIterator = source[Symbol.asyncIterator]();\n } catch (error) {\n this._asyncRunning = false;\n this._asyncCompleted = true;\n console.error('snice: async iterable template value failed:', error);\n return;\n }\n void (async () => {\n try {\n while (this._asyncIterator) {\n const result = await this._asyncIterator.next();\n if (result.done || version !== this._asyncVersion) break;\n this._commitAsyncValue(result.value);\n }\n } catch (error) {\n if (version === this._asyncVersion) console.error('snice: async iterable template value failed:', error);\n } finally {\n if (version === this._asyncVersion) {\n this._asyncIterator = null;\n this._asyncRunning = false;\n this._asyncCompleted = true;\n }\n }\n })();\n return;\n }\n\n Promise.resolve(source).then(\n value => {\n if (version !== this._asyncVersion) return;\n this._asyncRunning = false;\n this._asyncCompleted = true;\n try {\n this._commitAsyncValue(value);\n } catch (error) {\n console.error('snice: promise template value failed:', error);\n }\n },\n error => {\n if (version !== this._asyncVersion) return;\n this._asyncRunning = false;\n this._asyncCompleted = true;\n console.error('snice: promise template value failed:', error);\n }\n );\n }\n\n private _commitAsyncValue(value: unknown): void {\n this._committingAsyncValue = true;\n try {\n this.commit(value);\n } finally {\n this._committingAsyncValue = false;\n }\n }\n\n private _cancelAsync(clearSource: boolean): void {\n this._asyncVersion++;\n const iterator = this._asyncIterator;\n this._asyncIterator = null;\n this._asyncRunning = false;\n if (clearSource) {\n this._asyncSource = null;\n this._asyncStarted = false;\n this._asyncCompleted = false;\n this._asyncPaused = false;\n }\n if (iterator?.return) {\n try {\n void Promise.resolve(iterator.return()).catch(() => {});\n } catch {\n // Cancellation is best-effort; internal state is already detached.\n }\n }\n }\n\n private _insertBefore(node: Node): void {\n this.endNode.parentNode?.insertBefore(node, this.endNode);\n }\n\n _clear(): unknown {\n const parent = this.startNode.parentNode;\n const committed = this._committedValue;\n let cleanupError: unknown;\n try {\n this._disposeCommitted(committed);\n } catch (error) {\n cleanupError = error;\n }\n if (!parent) {\n this._committedValue = nothing;\n return cleanupError;\n }\n\n let node = this.startNode.nextSibling;\n while (node && node !== this.endNode) {\n const next = node.nextSibling;\n parent.removeChild(node);\n node = next;\n }\n this._committedValue = nothing;\n return cleanupError;\n }\n\n private _disposeCommitted(committed: unknown): void {\n let lifecycleError: unknown;\n if (committed instanceof TemplateInstance) {\n try {\n committed.clear();\n } catch (error) {\n lifecycleError = error;\n }\n } else if (Array.isArray(committed)) {\n for (const item of committed) {\n if (!(item instanceof NodePart)) continue;\n try {\n item.destroy();\n } catch (error) {\n lifecycleError ??= error;\n }\n }\n }\n if (lifecycleError) throw lifecycleError;\n }\n\n clear(): void {\n this._cancelAsync(true);\n const cleanupError = this._clear();\n if (cleanupError) throw cleanupError;\n }\n\n get isConnected(): boolean {\n return this.startNode.isConnected;\n }\n\n disconnected(preserveEventListeners = false): void {\n let lifecycleError: unknown;\n if (this._committedValue instanceof TemplateInstance) {\n try {\n this._committedValue.disconnected(preserveEventListeners);\n } catch (error) {\n lifecycleError ??= error;\n }\n } else if (Array.isArray(this._committedValue)) {\n for (const part of this._committedValue) {\n if (!(part instanceof NodePart)) continue;\n try {\n part.disconnected(preserveEventListeners);\n } catch (error) {\n lifecycleError ??= error;\n }\n }\n }\n if (this._asyncSource && this._asyncRunning) {\n this._cancelAsync(false);\n this._asyncPaused = true;\n }\n if (lifecycleError) throw lifecycleError;\n }\n\n reconnected(): void {\n let lifecycleError: unknown;\n if (this._committedValue instanceof TemplateInstance) {\n try {\n this._committedValue.reconnected();\n } catch (error) {\n lifecycleError ??= error;\n }\n } else if (Array.isArray(this._committedValue)) {\n for (const part of this._committedValue) {\n if (!(part instanceof NodePart)) continue;\n try {\n part.reconnected();\n } catch (error) {\n lifecycleError ??= error;\n }\n }\n }\n if (this._asyncSource && (!this._asyncStarted || this._asyncPaused)) {\n this._startAsyncSource(true);\n }\n if (lifecycleError) throw lifecycleError;\n }\n}\n\n/**\n * AttributePart handles regular attribute updates\n *\n * Supports multiple interpolations: class=\"a ${b} c ${d} e\"\n * Lit-HTML style: tracks each value separately for dirty checking\n */\nexport class AttributePart extends Part {\n readonly type = 'attribute' as const;\n element: Element;\n readonly name: string;\n readonly strings?: readonly string[]; // Static strings for interpolation\n private _committedValue: unknown | unknown[] = NOT_COMMITTED;\n private lastValues: unknown[] | null = null;\n private lastValueIndex = 0;\n\n constructor(element: Element, name: string, strings?: string[]) {\n super();\n this.element = element;\n this.name = name;\n\n // Determine if this is interpolation or single-value binding\n if (strings && (strings.length > 2 || strings[0] !== '' || strings[1] !== '')) {\n // Interpolation case: class=\"foo ${x} bar ${y}\"\n // strings = [\"foo \", \" bar \", \"\"]\n this._committedValue = new Array(strings.length - 1).fill(NOT_COMMITTED);\n this.strings = strings;\n } else {\n // Single-value case: class=\"${x}\"\n this._committedValue = NOT_COMMITTED;\n }\n }\n\n /**\n * Commit value(s) to the attribute\n *\n * For single-value binding: commit(value)\n * For interpolation: commit(values, startIndex) where values is full template values array\n */\n commit(value: unknown, valueIndex: number = 0): void {\n let change = false;\n let finalValue: unknown;\n\n // === SINGLE-VALUE BINDING ===\n if (this.strings === undefined) {\n if (value === noChange) return;\n\n change = !isPrimitive(value) ||\n (value !== this._committedValue && value !== noChange);\n\n if (change) {\n this._committedValue = value;\n finalValue = value;\n } else {\n return; // No change, skip DOM update\n }\n }\n // === INTERPOLATION BINDING ===\n else {\n const values = value as unknown[];\n this.lastValues = [...values];\n this.lastValueIndex = valueIndex;\n const committedValues = this._committedValue as unknown[];\n finalValue = this.strings[0];\n\n for (let i = 0; i < this.strings.length - 1; i++) {\n let v = values[valueIndex + i];\n\n // Handle noChange sentinel\n if (v === noChange) {\n v = committedValues[i];\n // First-ever commit: there is no previous value to keep — resolve\n // to empty. Without this, the NOT_COMMITTED symbol would be\n // string-concatenated below and throw.\n if (v === NOT_COMMITTED) v = '';\n }\n\n // Track if any value changed\n change = change || !isPrimitive(v) || v !== committedValues[i];\n\n // Handle nothing sentinel - removes entire attribute\n if (v === nothing) {\n finalValue = nothing;\n } else if (finalValue !== nothing) {\n finalValue = (finalValue as string) + (v ?? '') + this.strings[i + 1];\n }\n\n // Always record each value for future comparison\n committedValues[i] = v;\n }\n\n if (!change) {\n return; // No change, skip DOM update\n }\n }\n\n // Commit to DOM\n this._commitValue(finalValue);\n }\n\n private _commitValue(value: unknown): void {\n // Only the `nothing` sentinel removes the attribute. null/undefined\n // commit an empty attribute value, consistent with the interpolated\n // path above (which renders them as '').\n if (value === nothing) {\n this.element.removeAttribute(this.name);\n } else {\n this.element.setAttribute(this.name, String(value ?? ''));\n }\n }\n\n clear(): void {\n this.element.removeAttribute(this.name);\n }\n\n}\n\n/**\n * CommentPart renders binding values into an authored HTML comment's text\n * (<!-- debug: ${x} -->). Its real job is index alignment: each binding in a\n * comment consumes one value slot, so bindings after the comment stay bound\n * to their own values.\n */\nexport class CommentPart extends Part {\n readonly type = 'node' as const;\n node: Comment;\n readonly strings: readonly string[];\n private _committedValues: unknown[];\n private lastValues: unknown[] | null = null;\n private lastValueIndex = 0;\n\n constructor(node: Comment, strings: readonly string[]) {\n super();\n this.node = node;\n this.strings = strings;\n this._committedValues = new Array(strings.length - 1).fill(NOT_COMMITTED);\n }\n\n /**\n * Commit values into the comment text.\n * commit(values, startIndex) — like interpolated AttributePart, this part\n * consumes (strings.length - 1) values from the template values array.\n */\n commit(values: unknown, startIndex: number = 0): void {\n const vals = values as unknown[];\n this.lastValues = [...vals];\n this.lastValueIndex = startIndex;\n let change = false;\n let text = this.strings[0];\n\n for (let i = 0; i < this.strings.length - 1; i++) {\n let v = vals[startIndex + i];\n\n if (v === noChange) {\n v = this._committedValues[i];\n if (v === NOT_COMMITTED) v = '';\n }\n\n change = change || !isPrimitive(v) || v !== this._committedValues[i];\n this._committedValues[i] = v;\n\n text += String(v === nothing ? '' : (v ?? '')) + this.strings[i + 1];\n }\n\n if (change) {\n if (text.includes('--') || text.endsWith('-')) {\n throw new Error('snice: comment expressions cannot produce \"--\" or end with \"-\".');\n }\n this.node.data = text;\n }\n }\n\n clear(): void {}\n\n}\n\n/** Toggle one class without rebuilding the element's full class string. */\nexport class ClassPart extends Part {\n readonly type = 'class' as const;\n element: Element;\n readonly name: string;\n private committed: unknown = NOT_COMMITTED;\n\n constructor(element: Element, name: string) {\n super();\n this.element = element;\n this.name = name;\n }\n\n commit(value: unknown): void {\n if (value === noChange) return;\n const enabled = value !== nothing && Boolean(value);\n if (enabled === this.committed) return;\n this.committed = enabled;\n this.element.classList.toggle(this.name, enabled);\n }\n\n clear(): void {\n this.element.classList.remove(this.name);\n this.committed = NOT_COMMITTED;\n }\n\n}\n\n/** Set one CSS property, including custom properties, declaratively. */\nexport class StylePart extends Part {\n readonly type = 'style' as const;\n element: Element;\n readonly name: string;\n private committed: unknown = NOT_COMMITTED;\n\n constructor(element: Element, name: string) {\n super();\n this.element = element;\n this.name = name;\n }\n\n commit(value: unknown): void {\n if (value === noChange || Object.is(value, this.committed)) return;\n this.committed = value;\n const style = (this.element as HTMLElement).style;\n if (value === nothing || value == null || value === false) {\n style.removeProperty(this.name);\n } else {\n style.setProperty(this.name, String(value));\n }\n }\n\n clear(): void {\n (this.element as HTMLElement).style.removeProperty(this.name);\n this.committed = NOT_COMMITTED;\n }\n\n}\n\ntype SpreadListener = {\n value: unknown;\n listener: EventListener;\n options?: AddEventListenerOptions;\n};\n\nfunction validateSpreadEvents(next: Record<string, unknown>, label: string): void {\n const names = new Set<string>();\n for (const [rawName, value] of Object.entries(next)) {\n const name = rawName.startsWith('@') ? rawName.slice(1) : rawName;\n if (!name) throw new TypeError(`snice: ${label} contains an empty event name.`);\n if (names.has(name)) {\n throw new TypeError(`snice: ${label} contains duplicate event name \"${name}\".`);\n }\n names.add(name);\n const listenerObject = !!value && typeof value === 'object' &&\n typeof (value as EventListenerObject).handleEvent === 'function';\n if (\n value !== nothing && value != null && value !== false &&\n typeof value !== 'function' && !listenerObject\n ) {\n throw new TypeError(`snice: ${label} event \"${name}\" expects a function, EventListenerObject, or null.`);\n }\n }\n}\n\n/** Named spreads: ...props, ...attrs, and ...events. */\nexport class SpreadPart extends Part {\n readonly type = 'spread' as const;\n element: Element;\n readonly name: string;\n private committed: Record<string, unknown> = {};\n private listeners = new Map<string, SpreadListener>();\n private consumedOnce = new Map<string, unknown>();\n\n constructor(element: Element, name: string) {\n super();\n this.element = element;\n this.name = name;\n }\n\n commit(value: unknown): void {\n if (value === noChange) return;\n if (value === nothing || value == null) value = {};\n if (typeof value !== 'object' || Array.isArray(value)) {\n throw new TypeError(`snice: ...${this.name} expects an object.`);\n }\n const next = value as Record<string, unknown>;\n if (this.name === 'events') this.commitEvents(next);\n else if (this.name === 'props' || this.name === 'properties') this.commitProperties(next);\n else this.commitAttributes(next);\n this.committed = { ...next };\n }\n\n private commitProperties(next: Record<string, unknown>): void {\n for (const key of Object.keys(this.committed)) {\n if (!Object.prototype.hasOwnProperty.call(next, key)) {\n markPreUpgradePropertyBinding(this.element, key);\n (this.element as any)[key] = undefined;\n }\n }\n for (const [key, value] of Object.entries(next)) {\n if (Object.is(this.committed[key], value)) continue;\n markPreUpgradePropertyBinding(this.element, key);\n (this.element as any)[key] = value === nothing ? undefined : value;\n }\n }\n\n private commitAttributes(next: Record<string, unknown>): void {\n for (const key of Object.keys(this.committed)) {\n if (!Object.prototype.hasOwnProperty.call(next, key)) this.element.removeAttribute(key);\n }\n for (const [key, value] of Object.entries(next)) {\n if (Object.is(this.committed[key], value)) continue;\n if (value === nothing || value == null || value === false) this.element.removeAttribute(key);\n else this.element.setAttribute(key, value === true ? '' : String(value));\n }\n }\n\n private commitEvents(next: Record<string, unknown>): void {\n validateSpreadEvents(next, `...${this.name}`);\n for (const [name, value] of this.consumedOnce) {\n const rawName = Object.keys(next).find(key => this.eventName(key) === name);\n if (!rawName || !Object.is(next[rawName], value)) this.consumedOnce.delete(name);\n }\n for (const [name, entry] of this.listeners) {\n const rawName = Object.keys(next).find(key => this.eventName(key) === name);\n if (rawName && Object.is(next[rawName], entry.value)) continue;\n this.element.removeEventListener(name, entry.listener, entry.options);\n this.listeners.delete(name);\n }\n\n for (const [rawName, value] of Object.entries(next)) {\n const name = this.eventName(rawName);\n if (this.listeners.has(name)) continue;\n const listenerObject = !!value && typeof value === 'object' &&\n typeof (value as EventListenerObject).handleEvent === 'function';\n if (value === nothing || value == null || value === false) continue;\n if (this.consumedOnce.has(name) && Object.is(this.consumedOnce.get(name), value)) continue;\n this.consumedOnce.delete(name);\n const options = listenerObject ? value as AddEventListenerOptions : undefined;\n const listener = ((event: Event) => {\n if (options?.once) this.consumedOnce.set(name, value);\n if (listenerObject) (value as EventListenerObject).handleEvent(event);\n else (value as EventListener).call(this.resolveHost(), event);\n }) as EventListener;\n this.element.addEventListener(name, listener, options);\n this.listeners.set(name, { value, listener, options });\n }\n }\n\n private eventName(name: string): string {\n return name.startsWith('@') ? name.slice(1) : name;\n }\n\n private resolveHost(): Element | null {\n return findRenderHost(this.element) || this.element;\n }\n\n clear(): void {\n if (this.name === 'events') {\n for (const [name, entry] of this.listeners) {\n this.element.removeEventListener(name, entry.listener, entry.options);\n }\n this.listeners.clear();\n this.consumedOnce.clear();\n } else if (this.name !== 'props' && this.name !== 'properties') {\n for (const key of Object.keys(this.committed)) this.element.removeAttribute(key);\n }\n // A property spread is being destroyed with the element that owns it.\n // Resetting native/custom properties here is unnecessary and can throw for\n // setters that reject undefined (textarea.value is a common example).\n // Stale keys are still removed during an ordinary live spread update.\n this.committed = {};\n }\n\n disconnected(preserveEventListeners = false): void {\n if (this.name === 'events' && !preserveEventListeners) this.detachListeners();\n }\n\n reconnected(): void {\n if (this.name === 'events' && this.listeners.size === 0) this.commitEvents(this.committed);\n }\n\n private detachListeners(): void {\n for (const [name, entry] of this.listeners) {\n this.element.removeEventListener(name, entry.listener, entry.options);\n }\n this.listeners.clear();\n }\n\n}\n\n/**\n * PropertyPart handles property bindings (.property=${value})\n */\nexport class PropertyPart extends Part {\n readonly type = 'property' as const;\n element: Element;\n readonly name: string;\n private _committedValue: unknown = NOT_COMMITTED;\n\n constructor(element: Element, name: string) {\n super();\n this.element = element;\n this.name = name;\n }\n\n commit(value: unknown): void {\n if (value === noChange) return;\n\n // live(): compare against the element's actual DOM property, so state\n // the user changed (typed text, toggled checkbox) is reset even when the\n // bound value itself is unchanged.\n if (isLive(value)) {\n value = value.value;\n if (value === noChange) return;\n const domValue = (this.element as any)[this.name];\n if (value === domValue) {\n this._committedValue = value;\n return;\n }\n } else {\n // Dirty check - skip if same value\n if (value === this._committedValue) return;\n }\n\n this._committedValue = value;\n markPreUpgradePropertyBinding(this.element, this.name);\n (this.element as any)[this.name] = value === nothing ? undefined : value;\n }\n\n clear(): void {\n // This part is being destroyed with its owning template. The element is\n // about to leave the tree, so writing `undefined` is both unnecessary and\n // unsafe for native setters such as HTMLTextAreaElement.value.\n this._committedValue = NOT_COMMITTED;\n }\n\n}\n\n/**\n * ControllerPart handles bare controller=${...} bindings.\n *\n * Accepts a controller class decorated with @controller (attached directly,\n * no registry lookup) or a registry name string (delegated to the attribute\n * channel with the exact semantics of a static controller=\"name\"). While a\n * class is bound it owns the element: the decorator name is reflected for\n * inspection, while the attribute/MutationObserver attach channel stays inert.\n *\n * Renders commit while the tree is detached and connect afterwards, so\n * attachment happens on reconnected()/connected commits; every hook is\n * idempotent because the update loop reconciles connection state on each pass.\n */\nexport class ControllerPart extends Part {\n readonly type = 'controller' as const;\n element: Element;\n private _committedValue: unknown = NOT_COMMITTED;\n\n constructor(element: Element) {\n super();\n this.element = element;\n }\n\n commit(value: unknown): void {\n if (value === noChange) return;\n\n // Normalize every \"no controller\" shape to null\n const next = (value == null || value === false || value === '' || value === nothing)\n ? null\n : value;\n const first = this._committedValue === NOT_COMMITTED;\n const previous = first ? null : this._committedValue;\n if (!first && next === previous) return;\n this._committedValue = next;\n\n const el = this.element as any;\n\n // Leaving a class binding: release the element back to the attribute channel.\n if (typeof previous === 'function' && typeof next !== 'function') {\n if (el[PENDING_CONTROLLER_BINDING] !== undefined) {\n delete el[PENDING_CONTROLLER_BINDING];\n } else if (el[IS_ELEMENT_CLASS]) {\n el.controller = null;\n } else {\n this._detach();\n }\n }\n\n if (typeof next === 'function') {\n if (this.isConnected) {\n this._apply(next);\n } else if (this.element.localName.includes('-') && !el[IS_ELEMENT_CLASS]) {\n // Park on not-yet-upgraded custom elements even while detached — the\n // element picks the class up in connectedCallback on upgrade.\n el[PENDING_CONTROLLER_BINDING] = next;\n }\n // Detached native/upgraded elements attach in reconnected().\n } else if (typeof next === 'string') {\n this.element.setAttribute('controller', next);\n } else if (typeof previous === 'string') {\n this.element.removeAttribute('controller');\n }\n }\n\n /** Drive the element toward the committed class. Idempotent. */\n private _apply(controllerClass: any): void {\n const el = this.element as any;\n\n if (el[IS_ELEMENT_CLASS]) {\n if (el.controller !== controllerClass) {\n // Setter handles detach of the old controller and attach of the new.\n el.controller = controllerClass;\n } else {\n // Same value: the setter would no-op, but the element may have\n // self-detached on disconnect. attachController dedupes when the\n // controller is still attached.\n this._attach(controllerClass);\n }\n return;\n }\n\n if (this.element.localName.includes('-')) {\n // Custom element that hasn't upgraded yet (defined later, or cloned\n // into a detached fragment). Park the class — connectedCallback picks\n // it up on upgrade. Assigning the property now would shadow the future\n // prototype accessor with an own expando property.\n el[PENDING_CONTROLLER_BINDING] = controllerClass;\n return;\n }\n\n // Native element — attach directly. Mirror the observer path's ready shim.\n if (!el.ready) el.ready = Promise.resolve();\n this._attach(controllerClass);\n }\n\n private _attach(controllerClass: any): void {\n attachController(this.element as HTMLElement, controllerClass).catch((error: any) => {\n if (error?.name === 'ControllerAttachAborted') return;\n console.error(\n `Failed to attach controller \"${controllerClass?.name || controllerClass}\":`,\n error\n );\n });\n }\n\n private _detach(): void {\n detachController(this.element as HTMLElement).catch((error: any) => {\n console.error('Failed to detach controller:', error);\n });\n }\n\n disconnected(_preserveEventListeners = false): void {\n const committed = this._committedValue;\n if (typeof committed !== 'function') return;\n const el = this.element as any;\n if (el[PENDING_CONTROLLER_BINDING] !== undefined) return; // never attached\n if (el[IS_ELEMENT_CLASS]) return; // snice elements detach themselves on disconnect\n this._detach();\n }\n\n reconnected(): void {\n const committed = this._committedValue;\n if (typeof committed !== 'function') return;\n this._apply(committed);\n }\n\n clear(): void {\n const el = this.element as any;\n if (el[PENDING_CONTROLLER_BINDING] !== undefined) delete el[PENDING_CONTROLLER_BINDING];\n const committed = this._committedValue;\n this._committedValue = NOT_COMMITTED;\n if (typeof committed !== 'function') return;\n if (el[IS_ELEMENT_CLASS]) return; // the element's own teardown detaches\n this._detach();\n }\n\n}\n\n/**\n * BooleanAttributePart handles boolean attributes (?attribute=${value})\n */\nexport class BooleanAttributePart extends Part {\n readonly type = 'boolean-attribute' as const;\n element: Element;\n readonly name: string;\n private _committedValue: unknown = NOT_COMMITTED;\n\n constructor(element: Element, name: string) {\n super();\n this.element = element;\n this.name = name;\n }\n\n commit(value: unknown): void {\n if (value === noChange) return;\n\n // Coerce to boolean\n const boolValue = !!value && value !== nothing;\n\n // Dirty check - skip if same boolean value\n if (boolValue === this._committedValue) return;\n\n this._committedValue = boolValue;\n\n if (boolValue) {\n this.element.setAttribute(this.name, '');\n } else {\n this.element.removeAttribute(this.name);\n }\n }\n\n clear(): void {\n this.element.removeAttribute(this.name);\n this._committedValue = NOT_COMMITTED;\n }\n\n}\n\n/**\n * EventPart handles event listener bindings with keyboard shortcut support\n */\nexport class EventPart extends Part {\n readonly type = 'event' as const;\n element: Element;\n readonly eventName: string;\n private listener: EventListener | null = null;\n private listenerOptions: AddEventListenerOptions | undefined = undefined;\n private value: any = undefined;\n private keyFilter: KeyboardFilter | null = null;\n private host: Element | null = null; // Cache host element\n private modifiers = new Set<string>();\n private once = false;\n private onceConsumed = false;\n\n constructor(element: Element, eventName: string) {\n super();\n this.element = element;\n\n const [eventSpec, ...modifierSpecs] = eventName.split('|');\n const aliases: Record<string, string> = {\n preventdefault: 'prevent',\n stoppropagation: 'stop',\n stopimmediatepropagation: 'immediate'\n };\n const allowed = new Set(['prevent', 'stop', 'immediate', 'once', 'capture', 'passive', 'self']);\n for (const raw of modifierSpecs) {\n const normalized = aliases[raw.toLowerCase()] || raw.toLowerCase();\n if (!allowed.has(normalized)) {\n throw new Error(\n `snice: unknown event modifier \"${raw}\" in @${eventName}. ` +\n 'Supported modifiers: prevent, stop, immediate, once, capture, passive, self.'\n );\n }\n this.modifiers.add(normalized);\n }\n if (this.modifiers.has('passive') && this.modifiers.has('prevent')) {\n throw new Error(`snice: @${eventName} cannot combine passive and prevent.`);\n }\n\n // Parse keyboard shortcuts:\n // Supports both dot notation (@keydown.enter) and colon notation (@keydown:Enter) to match @on decorator\n // Only parse colons for keyboard events, not custom events\n const isKeyboardEvent = ['keydown', 'keyup', 'keypress'].includes(eventSpec.split('.')[0].split(':')[0]);\n // Only keyboard events split on `.`/`:` into a key filter — a custom event\n // name may legitimately contain a dot (e.g. `app.ready`) and must be kept whole.\n const dotIndex = isKeyboardEvent ? eventSpec.indexOf('.') : -1;\n const colonIndex = isKeyboardEvent ? eventSpec.indexOf(':') : -1;\n\n // Use whichever delimiter comes first (dot or colon)\n const delimiterIndex = dotIndex > 0 && colonIndex > 0\n ? Math.min(dotIndex, colonIndex)\n : Math.max(dotIndex, colonIndex);\n\n if (delimiterIndex > 0) {\n const baseEvent = eventSpec.substring(0, delimiterIndex);\n const keySpec = eventSpec.substring(delimiterIndex + 1);\n this.eventName = baseEvent;\n this.keyFilter = parseKeyboardFilter(keySpec);\n } else {\n this.eventName = eventSpec;\n warnIfModifierMisuse(eventSpec);\n }\n }\n\n commit(value: any): void {\n // Handle noChange sentinel\n if (value === noChange) return;\n\n // Handle nothing sentinel - remove listener\n if (value === nothing) {\n value = null;\n }\n\n const isListenerObject = !!value &&\n typeof value === 'object' &&\n typeof (value as EventListenerObject).handleEvent === 'function';\n if (\n value !== null && value !== undefined && value !== false &&\n typeof value !== 'function' && !isListenerObject\n ) {\n throw new TypeError(`snice: @${this.eventName} expects a function, EventListenerObject, or null.`);\n }\n if (isListenerObject && this.modifiers.has('prevent') && !!(value as AddEventListenerOptions).passive) {\n throw new Error(`snice: @${this.eventName} cannot combine a passive listener object with prevent.`);\n }\n\n // Skip if same value (but null/undefined always triggers update for cleanup)\n if (value === this.value && value !== null && value !== undefined) return;\n\n // Remove old listener (with the same capture option it was added with)\n if (this.listener) {\n this.element.removeEventListener(this.eventName, this.listener, this.listenerOptions);\n this.listener = null;\n this.listenerOptions = undefined;\n }\n\n // Add new listener\n if (value === null || value === undefined || value === false) {\n this.value = value;\n this.onceConsumed = false;\n return;\n }\n\n this.onceConsumed = false;\n try {\n this.attachListener(value, isListenerObject);\n this.value = value;\n } catch (error) {\n this.value = undefined;\n throw error;\n }\n }\n\n private attachListener(value: EventListener | (EventListenerObject & AddEventListenerOptions), isListenerObject: boolean): void {\n // Accept plain functions AND EventListenerObject ({ handleEvent }). For\n // listener objects, the object itself doubles as the options bag.\n\n const keyFilter = this.keyFilter;\n const listener = ((event: Event) => {\n if (this.modifiers.has('self') && event.target !== this.element) return;\n if (keyFilter && !matchesKeyboardFilter(event as KeyboardEvent, keyFilter)) return;\n if (this.once) {\n this.onceConsumed = true;\n this.element.removeEventListener(this.eventName, listener, listenerOptions);\n this.listener = null;\n this.listenerOptions = undefined;\n }\n if (this.modifiers.has('prevent')) event.preventDefault();\n if (this.modifiers.has('immediate')) event.stopImmediatePropagation();\n else if (this.modifiers.has('stop')) event.stopPropagation();\n if (isListenerObject) {\n // DOM spec: `this` inside handleEvent is the listener object itself\n (value as EventListenerObject).handleEvent(event);\n return;\n }\n // Resolve the host (the custom element owning the shadow root) at dispatch\n // time, not bind time: a binding inside an initially-hidden <if>/<case>\n // branch commits while off-DOM, where getRootNode() has no host — caching\n // that null permanently would call the handler with `this = null` once the\n // branch is shown. By the time an event fires, the element is in the DOM.\n if (!this.host) {\n this.host = findRenderHost(this.element);\n }\n (value as EventListener).call(this.host || this.element, event);\n }) as EventListener;\n\n const valueOptions = isListenerObject ? value as AddEventListenerOptions : {};\n this.once = this.modifiers.has('once') || !!valueOptions.once;\n const listenerOptions: AddEventListenerOptions = {\n capture: this.modifiers.has('capture') || valueOptions.capture,\n passive: this.modifiers.has('passive') || valueOptions.passive,\n signal: valueOptions.signal\n };\n this.element.addEventListener(this.eventName, listener, listenerOptions);\n this.listener = listener;\n this.listenerOptions = listenerOptions;\n }\n\n clear(): void {\n this.detachListener();\n this.value = undefined;\n this.host = null;\n this.onceConsumed = false;\n }\n\n private detachListener(): void {\n if (this.listener) {\n this.element.removeEventListener(this.eventName, this.listener, this.listenerOptions);\n this.listener = null;\n this.listenerOptions = undefined;\n }\n }\n\n disconnected(preserveEventListeners = false): void {\n if (!preserveEventListeners) this.detachListener();\n this.host = null;\n }\n\n reconnected(): void {\n if (!this.listener && !this.onceConsumed && this.value != null && this.value !== false) {\n const isListenerObject = typeof this.value === 'object';\n this.attachListener(this.value, isListenerObject);\n }\n }\n\n}\n\n/**\n * ConditionalIfPart handles <if> conditional rendering\n * Removes/inserts DOM nodes based on condition\n */\n// Sentinel value to distinguish \"not yet set\" from undefined\nconst NOT_SET = Symbol('not-set');\n\nexport class ConditionalIfPart extends Part {\n readonly type = 'node' as const;\n private startNode: Comment;\n private endNode: Comment;\n private conditions: unknown[] = [NOT_SET];\n private branches: DocumentFragment[] = [];\n private defaultBranch = -1;\n private currentBranch = -1;\n\n constructor(ifElement: Element) {\n super();\n const parent = ifElement.parentNode!;\n\n // Create comment boundary markers\n this.startNode = document.createComment('if');\n this.endNode = document.createComment('/if');\n\n // Insert markers where <if> is\n parent.insertBefore(this.startNode, ifElement);\n parent.insertBefore(this.endNode, ifElement.nextSibling);\n\n const primary = document.createDocumentFragment();\n this.branches.push(primary);\n let sawAlternative = false;\n let lastBranch = primary;\n\n for (const child of Array.from(ifElement.childNodes)) {\n const tag = child.nodeType === Node.ELEMENT_NODE\n ? (child as Element).tagName.toLowerCase()\n : '';\n\n if (tag === 'else-if' || tag === 'else') {\n sawAlternative = true;\n const wrapper = child as Element;\n const fragment = document.createDocumentFragment();\n while (wrapper.firstChild) fragment.appendChild(wrapper.firstChild);\n const index = this.branches.push(fragment) - 1;\n lastBranch = fragment;\n\n if (tag === 'else-if') {\n if (this.defaultBranch !== -1) {\n throw new Error('snice: <else> must be the final branch inside <if>.');\n }\n this.conditions[index] = NOT_SET;\n conditionalElseIfOwners.set(wrapper, { coordinator: this, index });\n } else {\n if (this.defaultBranch !== -1) {\n throw new Error('snice: <if> may contain only one <else> branch.');\n }\n this.defaultBranch = index;\n }\n wrapper.remove();\n continue;\n }\n\n if (!sawAlternative) {\n primary.appendChild(child);\n } else if (child.nodeType === Node.TEXT_NODE && !child.textContent?.trim()) {\n child.remove();\n } else {\n lastBranch.appendChild(child);\n }\n }\n\n parent.removeChild(ifElement);\n }\n\n commit(value: any): void {\n if (value !== noChange) this.conditions[0] = value;\n }\n\n setAlternative(index: number, value: unknown): void {\n if (value !== noChange) this.conditions[index] = value;\n }\n\n flush(): void {\n let next = -1;\n for (let i = 0; i < this.conditions.length; i++) {\n if (\n this.conditions[i] !== NOT_SET &&\n this.conditions[i] !== nothing &&\n Boolean(this.conditions[i])\n ) {\n next = i;\n break;\n }\n }\n if (next === -1) next = this.defaultBranch;\n if (next === this.currentBranch) return;\n\n this.collectCurrent();\n this.currentBranch = next;\n if (next !== -1 && this.branches[next].hasChildNodes()) {\n this.startNode.parentNode?.insertBefore(this.branches[next], this.endNode);\n }\n }\n\n private collectCurrent(): void {\n if (this.currentBranch === -1) return;\n const fragment = this.branches[this.currentBranch];\n let node = this.startNode.nextSibling;\n while (node && node !== this.endNode) {\n const next = node.nextSibling;\n fragment.appendChild(node);\n node = next;\n }\n }\n\n clear(): void {\n this.collectCurrent();\n this.currentBranch = -1;\n }\n\n get isConnected(): boolean {\n return this.startNode.isConnected;\n }\n}\n\nconst conditionalElseIfOwners = new WeakMap<Element, {\n coordinator: ConditionalIfPart;\n index: number;\n}>();\n\nexport class ConditionalElseIfPart extends Part {\n readonly type = 'node' as const;\n readonly coordinator: ConditionalIfPart;\n private readonly index: number;\n\n constructor(element: Element) {\n super();\n const owner = conditionalElseIfOwners.get(element);\n if (!owner) throw new Error('snice: <else-if> must be a direct child of <if>.');\n this.coordinator = owner.coordinator;\n this.index = owner.index;\n }\n\n commit(value: unknown): void {\n this.coordinator.setAlternative(this.index, value);\n }\n\n clear(): void {}\n\n get isConnected(): boolean {\n return this.coordinator.isConnected;\n }\n}\n\n/**\n * ConditionalCasePart handles <case>/<when>/<default> conditional rendering\n * Removes/inserts matching branch based on value\n */\nexport class ConditionalCasePart extends Part {\n readonly type = 'node' as const;\n private startNode: Comment;\n private endNode: Comment;\n private value: any = NOT_SET;\n private branches: Array<{\n fragment: DocumentFragment;\n dynamic: boolean;\n expected: unknown;\n }> = [];\n private defaultBranch = -1;\n private currentBranch = -1;\n\n constructor(caseElement: Element, dynamicWhenElements: ReadonlySet<Element>) {\n super();\n const parent = caseElement.parentNode!;\n\n // Create comment boundary markers\n this.startNode = document.createComment('case');\n this.endNode = document.createComment('/case');\n\n // Insert markers where <case> is\n parent.insertBefore(this.startNode, caseElement);\n parent.insertBefore(this.endNode, caseElement.nextSibling);\n\n // Extract branches from <when> and <default> children\n for (const child of Array.from(caseElement.children)) {\n const childTag = child.tagName.toLowerCase();\n if (childTag === 'when') {\n const fragment = document.createDocumentFragment();\n while (child.firstChild) {\n fragment.appendChild(child.firstChild);\n }\n const dynamic = dynamicWhenElements.has(child);\n const index = this.branches.push({\n fragment,\n dynamic,\n expected: dynamic ? NOT_SET : (child.getAttribute('value') ?? '')\n }) - 1;\n if (dynamic) conditionalWhenOwners.set(child, { coordinator: this, index });\n } else if (childTag === 'default') {\n if (this.defaultBranch !== -1) {\n throw new Error('snice: <case> may contain only one <default> branch.');\n }\n const fragment = document.createDocumentFragment();\n while (child.firstChild) {\n fragment.appendChild(child.firstChild);\n }\n this.defaultBranch = this.branches.push({\n fragment,\n dynamic: false,\n expected: NOT_SET\n }) - 1;\n }\n }\n\n // Remove the <case> element from DOM\n parent.removeChild(caseElement);\n }\n\n commit(value: any): void {\n if (value !== noChange) this.value = value;\n }\n\n setExpected(index: number, value: unknown): void {\n if (value !== noChange) this.branches[index].expected = value;\n }\n\n flush(): void {\n let next = this.branches.findIndex((branch, index) => {\n if (index === this.defaultBranch) return false;\n return branch.dynamic\n ? Object.is(this.value, branch.expected)\n : String(this.value) === branch.expected;\n });\n if (next === -1) next = this.defaultBranch;\n if (next === this.currentBranch) return;\n\n this.collectCurrent();\n this.currentBranch = next;\n if (next !== -1 && this.branches[next].fragment.hasChildNodes()) {\n this.startNode.parentNode?.insertBefore(this.branches[next].fragment, this.endNode);\n }\n }\n\n private collectCurrent(): void {\n if (this.currentBranch === -1) return;\n const fragment = this.branches[this.currentBranch].fragment;\n\n let node = this.startNode.nextSibling;\n while (node && node !== this.endNode) {\n const next = node.nextSibling;\n fragment.appendChild(node);\n node = next;\n }\n }\n\n clear(): void {\n this.collectCurrent();\n this.currentBranch = -1;\n }\n\n get isConnected(): boolean {\n return this.startNode.isConnected;\n }\n}\n\nconst conditionalWhenOwners = new WeakMap<Element, {\n coordinator: ConditionalCasePart;\n index: number;\n}>();\n\nexport class ConditionalWhenPart extends Part {\n readonly type = 'node' as const;\n readonly coordinator: ConditionalCasePart;\n private readonly index: number;\n\n constructor(element: Element) {\n super();\n const owner = conditionalWhenOwners.get(element);\n if (!owner) throw new Error('snice: dynamic <when> must be a direct child of <case>.');\n this.coordinator = owner.coordinator;\n this.index = owner.index;\n }\n\n commit(value: unknown): void {\n this.coordinator.setExpected(this.index, value);\n }\n\n clear(): void {}\n\n get isConnected(): boolean {\n return this.coordinator.isConnected;\n }\n}\n","import { getRenderRoot, type SniceRenderRoot } from './render-root';\n\nconst scheduledHosts = new WeakSet<HTMLElement>();\nconst processedCandidates = new WeakSet<Element>();\n\nconst focusableSelector = [\n 'a[href]',\n 'area[href]',\n 'button:not([disabled])',\n 'input:not([disabled]):not([type=\"hidden\"])',\n 'select:not([disabled])',\n 'textarea:not([disabled])',\n 'iframe',\n 'object',\n 'embed',\n 'summary',\n 'audio[controls]',\n 'video[controls]',\n '[contenteditable]:not([contenteditable=\"false\"])',\n '[tabindex]:not([tabindex=\"-1\"])'\n].join(',');\n\nfunction hasMeaningfulFocus(document: Document): boolean {\n const active = document.activeElement;\n return Boolean(active && active !== document.body && active !== document.documentElement);\n}\n\nfunction isFocused(target: HTMLElement): boolean {\n const root = target.getRootNode() as Document | ShadowRoot;\n const active = root.activeElement;\n return active === target || Boolean(active && target.contains(active));\n}\n\nfunction tryFocus(target: HTMLElement): boolean {\n try {\n target.focus();\n } catch {\n return false;\n }\n return isFocused(target);\n}\n\nfunction explicitCandidates(root: SniceRenderRoot | null): HTMLElement[] {\n if (!root) return [];\n return Array.from(root.querySelectorAll<HTMLElement>('[autofocus]'))\n .filter(candidate => !processedCandidates.has(candidate));\n}\n\nfunction fallbackCandidates(root: SniceRenderRoot | null): HTMLElement[] {\n if (!root) return [];\n return Array.from(root.querySelectorAll<HTMLElement>(focusableSelector));\n}\n\nfunction hasCandidate(host: HTMLElement): boolean {\n if (host.hasAttribute('autofocus') && !processedCandidates.has(host)) return true;\n return explicitCandidates(getRenderRoot(host)).length > 0;\n}\n\n/**\n * Complete native autofocus processing after a Snice element becomes usable.\n * Browsers do not consistently revisit late-upgraded hosts or autofocus\n * controls inserted into Shadow DOM, so Snice supplies that missing pass.\n */\nexport function applyAutofocus(host: HTMLElement): void {\n if (!host.isConnected) return;\n\n const root = getRenderRoot(host);\n const candidates: HTMLElement[] = [];\n if (host.hasAttribute('autofocus') && !processedCandidates.has(host)) candidates.push(host);\n candidates.push(...explicitCandidates(root));\n if (candidates.length === 0) return;\n\n // Match native first-wins behavior and preserve focus deliberately\n // established by application code or an earlier autofocus candidate.\n if (hasMeaningfulFocus(host.ownerDocument)) {\n for (const candidate of candidates) processedCandidates.add(candidate);\n return;\n }\n\n for (const candidate of candidates) {\n processedCandidates.add(candidate);\n if (tryFocus(candidate)) return;\n\n // A decorated custom-element host is not necessarily a focusable area.\n // If its public focus() has no effect, use its first native focus target\n // without adding tabindex or changing the host's accessibility semantics.\n if (candidate === host) {\n for (const fallback of fallbackCandidates(root)) {\n if (tryFocus(fallback)) return;\n }\n }\n }\n}\n\n/** Schedule one post-ready, post-paint autofocus pass for a Snice host. */\nexport function scheduleAutofocus(host: HTMLElement): void {\n if (scheduledHosts.has(host) || !hasCandidate(host)) return;\n scheduledHosts.add(host);\n\n const run = () => {\n const view = host.ownerDocument.defaultView;\n const apply = () => {\n scheduledHosts.delete(host);\n applyAutofocus(host);\n };\n if (view?.requestAnimationFrame) view.requestAnimationFrame(apply);\n else queueMicrotask(apply);\n };\n\n const ready = (host as any).ready as Promise<unknown> | undefined;\n Promise.resolve(ready).then(run, run);\n}\n\n/** Allow an explicitly removed/re-added host autofocus attribute to run again. */\nexport function resetHostAutofocus(host: HTMLElement): void {\n processedCandidates.delete(host);\n}\n","/**\n * @render and @styles decorators for Snice v3.0.0\n * Provides automatic differential rendering on property changes\n */\n\nimport { TemplateResult, CSSResult, isTemplateResult, isCSSResult } from './template';\nimport { TemplateInstance } from './parts';\nimport { RENDER_METHOD, RENDER_OPTIONS, RENDER_INSTANCE, RENDER_TIMERS, RENDER_CALLBACKS, STYLES_METHOD, STYLES_APPLIED, PARENT_STYLES_METHODS, PENDING_RECONNECT_RENDER, RENDER_DEPTH, RENDERED_PROMISE, RENDERED_RESOLVE } from './symbols';\nimport { ensureRenderRoot } from './render-root';\nimport { scheduleAutofocus } from './autofocus';\n\n/**\n * When true, render errors are rethrown instead of logged, so tests and dev\n * environments fail loudly rather than leaving the element silently stale.\n * Production default is false (log and keep the previous DOM).\n */\nlet strictRenderErrors = false;\n\nfunction contextualizeRenderError(element: HTMLElement, error: unknown): unknown {\n const tag = element.tagName?.toLowerCase() || 'element';\n const message = error instanceof Error ? error.message : String(error);\n const contextual = new Error(`snice: render failed for <${tag}>: ${message}`, {\n cause: error\n });\n if (error instanceof Error) contextual.name = error.name;\n return contextual;\n}\n\nexport function setStrictRenderErrors(value: boolean): void {\n strictRenderErrors = value;\n}\n\n/**\n * Ensure the element has a pending `rendered` promise. Called whenever a\n * render is requested; resolved by performRender once the render commits.\n */\nfunction ensureRenderedPromise(element: HTMLElement): void {\n if (!(element as any)[RENDERED_RESOLVE]) {\n (element as any)[RENDERED_PROMISE] = new Promise<void>((resolve) => {\n (element as any)[RENDERED_RESOLVE] = resolve;\n });\n }\n}\n\n/** Resolve the element's pending `rendered` promise, if any. */\nfunction resolveRendered(element: HTMLElement): void {\n const resolve = (element as any)[RENDERED_RESOLVE];\n if (resolve) {\n (element as any)[RENDERED_RESOLVE] = null;\n resolve();\n }\n}\n\n/**\n * Options for @render decorator\n */\nexport interface RenderOptions {\n /**\n * Debounce render calls (ms)\n * Delays rendering until after this many ms of inactivity\n */\n debounce?: number;\n\n /**\n * Throttle render calls (ms)\n * Limits rendering to once per this many ms\n */\n throttle?: number;\n\n /**\n * Render only once, disable auto-rendering\n * Component must call render() method manually to re-render\n */\n once?: boolean;\n\n /**\n * Synchronous rendering (skip microtask batching)\n * Renders immediately instead of batching multiple property changes\n */\n sync?: boolean;\n\n /**\n * Disable differential rendering\n * When false, clears shadow root and re-renders from scratch each time\n * The render method must return a plain HTML string\n */\n differential?: boolean;\n}\n\n/**\n * Global render scheduler for microtask batching\n * Batches multiple property changes into a single render\n */\nclass RenderScheduler {\n private pending = new Set<HTMLElement>();\n private scheduled = false;\n\n /**\n * Schedule an element for rendering\n * Batches renders in a microtask unless sync option is enabled\n */\n schedule(element: HTMLElement, options: RenderOptions): void {\n // Sync rendering - execute immediately\n if (options.sync) {\n performRender(element, options);\n return;\n }\n\n // Async rendering - batch in microtask\n this.pending.add(element);\n\n if (!this.scheduled) {\n this.scheduled = true;\n queueMicrotask(() => this.flush());\n }\n }\n\n /**\n * Flush all pending renders\n */\n private flush(): void {\n const elements = Array.from(this.pending);\n this.pending.clear();\n this.scheduled = false;\n\n for (const element of elements) {\n // Skip elements that were disconnected between scheduling and flush, but\n // remember the dropped render so reconnect can replay it — otherwise the\n // shadow DOM stays stale for a property changed while detached. The flag\n // lives on the element, so it's GC'd with it (no leak if never reattached).\n if (!element.isConnected) {\n (element as any)[PENDING_RECONNECT_RENDER] = true;\n continue;\n }\n const options = (element as any)[RENDER_OPTIONS] || {};\n performRender(element, options);\n }\n }\n\n /** Remove a disconnected element from the queue */\n remove(element: HTMLElement): void {\n this.pending.delete(element);\n }\n}\n\nconst renderScheduler = new RenderScheduler();\n\nfunction hasRendered(element: HTMLElement): boolean {\n return Object.prototype.hasOwnProperty.call(element, RENDER_INSTANCE);\n}\n\nfunction flushRenderCallbacks(element: HTMLElement): void {\n const callbacks = (element as any)[RENDER_CALLBACKS];\n if (!callbacks || callbacks.length === 0) return;\n const cbs = [...callbacks];\n (element as any)[RENDER_CALLBACKS] = [];\n cbs.forEach(cb => cb());\n}\n\n/**\n * Backstop against a render() that mutates an observed property, which makes\n * the property setter request another render from inside the current one. In\n * `sync` mode that re-enters performRender synchronously and, unchecked,\n * recurses to a stack overflow. The counter caps synchronous nesting and turns\n * a silent crash into an actionable error. Normal renders never nest (child\n * renders defer to a microtask), so this stays at depth 1 in the common case.\n *\n * The depth is tracked PER ELEMENT (on RENDER_DEPTH), not globally: a runaway\n * component must not consume a shared budget and reject an unrelated component\n * that happens to render inside its call stack.\n */\nconst MAX_RENDER_DEPTH = 50;\n\n/**\n * Perform the actual render of an element\n */\nfunction performRender(\n element: HTMLElement,\n options: RenderOptions,\n precomputedResult?: any\n): void {\n const hasPrecomputedResult = arguments.length >= 3;\n const renderMethod = (element as any)[RENDER_METHOD];\n if (!renderMethod) {\n resolveRendered(element);\n return;\n }\n\n // If once is true and we've already rendered, skip\n if (options.once && hasRendered(element)) {\n resolveRendered(element);\n return;\n }\n\n const depth = ((element as any)[RENDER_DEPTH] ?? 0) as number;\n if (depth >= MAX_RENDER_DEPTH) {\n const tag = element.tagName ? element.tagName.toLowerCase() : 'element';\n console.error(\n `snice: maximum render depth (${MAX_RENDER_DEPTH}) exceeded for <${tag}>. ` +\n `render() is mutating an observed property, causing an infinite render loop.`\n );\n resolveRendered(element);\n return;\n }\n\n (element as any)[RENDER_DEPTH] = depth + 1;\n try {\n const result = hasPrecomputedResult\n ? precomputedResult\n : renderMethod.call(element);\n\n const renderRoot = ensureRenderRoot(element);\n\n // Non-differential rendering (string)\n if (options.differential === false) {\n if (typeof result !== 'string') {\n console.warn('Render method with differential: false must return a string');\n return;\n }\n const template = document.createElement('template');\n template.innerHTML = result;\n const instance = (element as any)[RENDER_INSTANCE] as TemplateInstance | null | undefined;\n instance?.clear();\n const removable = Array.from(renderRoot.childNodes).filter(node => !(\n node.nodeType === Node.ELEMENT_NODE &&\n (node as Element).tagName === 'STYLE' &&\n (node as Element).hasAttribute('data-snice-style')\n ));\n for (const node of removable) node.remove();\n renderRoot.appendChild(template.content);\n // A present, null render instance records a successful string render so\n // `once` works without pretending the string tree is a TemplateInstance.\n (element as any)[RENDER_INSTANCE] = null;\n flushRenderCallbacks(element);\n scheduleAutofocus(element);\n return;\n }\n\n // Differential rendering (template)\n if (!isTemplateResult(result)) {\n console.warn('Render method must return html`` template result');\n return;\n }\n\n let instance = (element as any)[RENDER_INSTANCE] as TemplateInstance | undefined;\n\n if (instance && instance.isSameTemplate(result.strings)) {\n instance.update(result.values);\n flushRenderCallbacks(element);\n scheduleAutofocus(element);\n return;\n }\n\n const nextInstance = new TemplateInstance(result);\n const nextFragment = nextInstance.renderFragment();\n\n // Commit while detached first. A malformed binding can then fail without\n // exposing a half-updated tree. Connection-aware parts are paired with\n // reconnected() immediately after the successful mount.\n try {\n nextInstance.update(result.values);\n } catch (error) {\n nextInstance.clear();\n throw error;\n }\n\n // Park the previous tree without disposing it, mount the prepared tree,\n // then run connection hooks. If reconnecting a listener or async part\n // fails, restore the still-live previous tree instead of leaving a\n // partially mounted replacement behind.\n const previousFragment = document.createDocumentFragment();\n for (const child of Array.from(renderRoot.childNodes)) {\n if (\n child.nodeType === Node.ELEMENT_NODE &&\n (child as Element).tagName === 'STYLE' &&\n (child as Element).hasAttribute('data-snice-style')\n ) continue;\n previousFragment.appendChild(child);\n }\n renderRoot.appendChild(nextFragment);\n try {\n if (element.isConnected) nextInstance.reconnected();\n } catch (error) {\n try {\n nextInstance.clear();\n } catch (cleanupError) {\n console.error('snice: failed to clean up a rejected render tree:', cleanupError);\n }\n for (const child of Array.from(renderRoot.childNodes)) {\n if (\n child.nodeType === Node.ELEMENT_NODE &&\n (child as Element).tagName === 'STYLE' &&\n (child as Element).hasAttribute('data-snice-style')\n ) continue;\n child.remove();\n }\n renderRoot.appendChild(previousFragment);\n throw error;\n }\n\n (element as any)[RENDER_INSTANCE] = nextInstance;\n let cleanupError: unknown;\n try {\n instance?.clear();\n } catch (error) {\n cleanupError = error;\n }\n flushRenderCallbacks(element);\n scheduleAutofocus(element);\n if (cleanupError) throw cleanupError;\n } catch (error) {\n const contextual = contextualizeRenderError(element, error);\n if (strictRenderErrors) throw contextual;\n console.error('Error rendering element:', contextual);\n } finally {\n (element as any)[RENDER_DEPTH] = depth;\n resolveRendered(element);\n }\n}\n\n/** Commit immediately using the element's configured render options. */\nexport function renderElementNow(element: HTMLElement): void {\n ensureRenderedPromise(element);\n const options = (element as any)[RENDER_OPTIONS] as RenderOptions || {};\n performRender(element, { ...options, once: false });\n}\n\n/**\n * Request a render for an element\n * Respects debounce/throttle/once/sync options\n * @param immediate - Force immediate render (used for initial render)\n */\nexport function requestRender(element: HTMLElement, immediate = false): void {\n const options = (element as any)[RENDER_OPTIONS] as RenderOptions || {};\n\n // Handle once option\n if (options.once && hasRendered(element)) {\n if (element.isConnected) reconnectRenderTree(element);\n return;\n }\n\n // Arm the `rendered` promise: it resolves when this request's render\n // commits (immediately below for sync/immediate, later for batched/\n // debounced/throttled renders).\n ensureRenderedPromise(element);\n\n // Force immediate render (for initial render)\n if (immediate) {\n performRender(element, options);\n return;\n }\n\n // Handle debounce\n if (options.debounce !== undefined && options.debounce > 0) {\n if (!(element as any)[RENDER_TIMERS]) {\n (element as any)[RENDER_TIMERS] = {};\n }\n\n clearTimeout((element as any)[RENDER_TIMERS].debounce);\n (element as any)[RENDER_TIMERS].debounce = setTimeout(() => {\n (element as any)[RENDER_TIMERS].debounce = null;\n renderScheduler.schedule(element, options);\n }, options.debounce);\n return;\n }\n\n // Handle throttle\n if (options.throttle !== undefined && options.throttle > 0) {\n if (!(element as any)[RENDER_TIMERS]) {\n (element as any)[RENDER_TIMERS] = { lastThrottle: 0 };\n }\n\n const timers = (element as any)[RENDER_TIMERS];\n const now = Date.now();\n\n if (timers.lastThrottle === 0 || now - timers.lastThrottle >= options.throttle) {\n timers.lastThrottle = now;\n renderScheduler.schedule(element, options);\n return;\n }\n\n if (!timers.throttleTimer) {\n const remaining = options.throttle - (now - timers.lastThrottle);\n timers.throttleTimer = setTimeout(() => {\n timers.throttleTimer = null;\n timers.lastThrottle = Date.now();\n renderScheduler.schedule(element, options);\n }, remaining);\n }\n return;\n }\n\n // Normal rendering (with microtask batching unless sync)\n renderScheduler.schedule(element, options);\n}\n\n/**\n * Clear any pending debounce/throttle render timers on an element (e.g. on\n * disconnect, so they don't fire on a dead element and retain it until they\n * expire). Returns true if a render was actually pending, so the caller can\n * arrange a replay on reconnect via PENDING_RECONNECT_RENDER.\n */\nexport function clearRenderTimers(element: HTMLElement): boolean {\n const timers = (element as any)[RENDER_TIMERS];\n if (!timers) return false;\n\n let hadPending = false;\n if (timers.debounce) {\n clearTimeout(timers.debounce);\n timers.debounce = null;\n hadPending = true;\n }\n if (timers.throttleTimer) {\n clearTimeout(timers.throttleTimer);\n timers.throttleTimer = null;\n hadPending = true;\n }\n // Deliberately do NOT reset timers.lastThrottle: a plain DOM move is a\n // disconnect+reconnect, and zeroing the cooldown would let the next render\n // fire inside the throttle window. Preserving it keeps throttle honest\n // across moves; on a true disconnect the element is discarded anyway.\n return hadPending;\n}\n\n/** Pause connection-aware render parts while an element is detached. */\nexport function disconnectRenderTree(element: HTMLElement): void {\n const instance = (element as any)[RENDER_INSTANCE] as TemplateInstance | undefined;\n // A host disconnection is not the same thing as parking a conditional\n // branch. The shadow/light render tree still belongs to the host, so native\n // event listeners remain usable on retained node references. Async iteration\n // is paused, and parked branches continue to detach their listeners through\n // the ordinary Part lifecycle.\n instance?.disconnected(true);\n}\n\n/** Resume connection-aware render parts when an existing tree reconnects. */\nexport function reconnectRenderTree(element: HTMLElement): void {\n const instance = (element as any)[RENDER_INSTANCE] as TemplateInstance | undefined;\n instance?.reconnected();\n}\n\n/**\n * @render decorator for component rendering\n *\n * Marks a method as the render method for the component.\n * The method should return html`...` template.\n * Automatically re-renders when properties change (unless once: true).\n *\n * @example\n * ```typescript\n * @render()\n * renderContent() {\n * return html`<div>${this.count}</div>`;\n * }\n * ```\n *\n * @example\n * ```typescript\n * // Debounced rendering\n * @render({ debounce: 100 })\n * renderContent() {\n * return html`<div>${this.searchTerm}</div>`;\n * }\n * ```\n *\n * @example\n * ```typescript\n * // Render only once (manual re-renders only)\n * @render({ once: true })\n * renderContent() {\n * return html`<div>Static content</div>`;\n * }\n * ```\n */\nexport function render(options: RenderOptions = {}) {\n return function (originalMethod: any, context: ClassMethodDecoratorContext) {\n const methodName = context.name as string;\n\n context.addInitializer(function (this: any) {\n // Store the render method and options\n this[RENDER_METHOD] = originalMethod;\n this[RENDER_OPTIONS] = options;\n });\n\n // Return wrapped method that triggers re-render when called manually\n return function (this: HTMLElement, ...args: any[]) {\n // Call original method to get the template\n const result = originalMethod.apply(this, args);\n\n // Always render when method is called manually (even if once: true)\n // Force immediate render to bypass all options, pass precomputed result to avoid calling method twice\n const configured = (this as any)[RENDER_OPTIONS] || options;\n performRender(this, { ...configured, once: false }, result);\n\n return result;\n };\n };\n}\n\n/**\n * @styles decorator for component styles\n *\n * Marks a method as the styles method for the component.\n * The method should return css`...` template.\n * Styles are applied once when the component is connected.\n *\n * @example\n * ```typescript\n * @styles()\n * styles() {\n * return css`:host { display: block; }`;\n * }\n * ```\n */\nexport function styles() {\n return function (originalMethod: any, context: ClassMethodDecoratorContext) {\n context.addInitializer(function (this: any) {\n // Collect parent styles methods before overwriting with child's\n if (this[STYLES_METHOD] && !this[PARENT_STYLES_METHODS]) {\n this[PARENT_STYLES_METHODS] = [this[STYLES_METHOD]];\n } else if (this[STYLES_METHOD] && this[PARENT_STYLES_METHODS]) {\n this[PARENT_STYLES_METHODS].push(this[STYLES_METHOD]);\n }\n this[STYLES_METHOD] = originalMethod;\n });\n\n return originalMethod;\n };\n}\n\n/**\n * Apply styles to an element\n * Called during element initialization\n */\nexport function applyStyles(element: HTMLElement): void {\n const stylesMethod = (element as any)[STYLES_METHOD];\n const staticResults: CSSResult[] = [];\n const constructors: any[] = [];\n let constructor: any = element.constructor;\n while (constructor && constructor !== HTMLElement && constructor !== Function.prototype) {\n constructors.unshift(constructor);\n constructor = Object.getPrototypeOf(constructor);\n }\n for (const current of constructors) {\n if (!Object.prototype.hasOwnProperty.call(current, 'styles')) continue;\n const value = current.styles;\n const values = Array.isArray(value) ? value : [value];\n for (const result of values) {\n if (isCSSResult(result)) staticResults.push(result);\n else console.warn('Static styles must be a css`` result or an array of css`` results');\n }\n }\n if (!stylesMethod && staticResults.length === 0) return;\n\n // Only apply once\n if ((element as any)[STYLES_APPLIED]) return;\n (element as any)[STYLES_APPLIED] = true;\n\n try {\n // Collect all CSS results: parent styles first, then child styles\n const allResults: CSSResult[] = [...staticResults];\n const parentMethods = (element as any)[PARENT_STYLES_METHODS] as Array<(...args: any[]) => any> | undefined;\n if (parentMethods) {\n for (const method of parentMethods) {\n const r = method.call(element);\n if (isCSSResult(r)) allResults.push(r);\n }\n }\n if (stylesMethod) {\n const result = stylesMethod.call(element);\n if (!isCSSResult(result)) {\n console.warn('Styles method must return css`` template result');\n return;\n }\n allResults.push(result);\n }\n\n const renderRoot = ensureRenderRoot(element);\n\n // Retain matching framework-owned style elements instead of adding a\n // duplicate stylesheet during a repeated setup pass.\n const existingStyles = Array.from(renderRoot.childNodes).filter(node =>\n node.nodeType === Node.ELEMENT_NODE &&\n (node as Element).tagName === 'STYLE' &&\n (node as Element).hasAttribute('data-snice-style')\n ) as HTMLStyleElement[];\n if (\n existingStyles.length === allResults.length &&\n existingStyles.every((style, index) => style.textContent === allResults[index].cssText)\n ) {\n return;\n }\n for (const style of existingStyles) style.remove();\n\n // Prefer constructable stylesheets\n if (renderRoot instanceof ShadowRoot && allResults.every(r => !!r.styleSheet) && 'adoptedStyleSheets' in renderRoot) {\n try {\n renderRoot.adoptedStyleSheets = allResults.map(r => r.styleSheet!);\n return;\n } catch {\n // A stylesheet constructed in another Window/Document realm cannot be\n // adopted here. Fall through to equivalent <style> elements.\n }\n }\n\n // Fallback — one <style> tag per stylesheet, preserving cascade order.\n // Marked so the template-switch cleanup keeps these (framework styles) but\n // still removes template-emitted <style> tags (which would otherwise pile up).\n for (const r of allResults) {\n const style = document.createElement('style');\n style.setAttribute('data-snice-style', '');\n style.textContent = r.cssText;\n renderRoot.appendChild(style);\n }\n } catch (error) {\n console.error('Error applying styles:', error);\n }\n}\n","import { DISPATCH_TIMERS } from './symbols';\nimport { DispatchOptions } from './types/dispatch-options';\nimport { resolveScope } from './utils';\nimport { defaultCommunicationTarget, requireDaemonTarget } from './daemon-target';\n\n// @dispatch decorator - auto-dispatches custom events from method return values\n\n\n/**\n * Decorator that automatically dispatches a custom event after a method is called.\n * The return value of the method becomes the event detail.\n *\n * @param eventName The name of the event to dispatch\n * @param options Optional configuration extending EventInit\n */\nexport function dispatch(eventName: string, options?: DispatchOptions) {\n return function (originalMethod: any, _context: ClassMethodDecoratorContext) {\n return function (this: any, ...args: any[]) {\n // Create timing wrappers for dispatch (per-instance)\n if (!this[DISPATCH_TIMERS]) {\n this[DISPATCH_TIMERS] = new Map();\n }\n\n const timerKey = `${eventName}_${_context.name as string}`;\n if (!this[DISPATCH_TIMERS].has(timerKey)) {\n this[DISPATCH_TIMERS].set(timerKey, {\n debounceTimeout: null,\n throttleLastCall: 0,\n throttleTimeout: null\n });\n }\n\n const timers = this[DISPATCH_TIMERS].get(timerKey);\n\n // Call the original method with preserved this context\n const result = originalMethod.apply(this, args);\n \n // Helper to dispatch the event\n const doDispatch = (detail: any) => {\n // Skip dispatch if result is undefined and dispatchOnUndefined is false\n if (detail === undefined && options?.dispatchOnUndefined === false) {\n return;\n }\n\n // Copy only platform EventInit fields; Snice-only decorator options do\n // not belong in the CustomEvent constructor dictionary.\n const event = new CustomEvent(eventName, {\n bubbles: options?.bubbles ?? true,\n cancelable: options?.cancelable ?? false,\n composed: options?.composed ?? true,\n detail\n });\n\n if (options?.scope !== undefined && options?.daemon !== undefined) {\n throw new TypeError(\n `@dispatch('${eventName}') cannot use both scope and daemon.`\n );\n }\n\n if (options?.daemon !== undefined) {\n requireDaemonTarget(this, options.daemon).dispatchEvent(event);\n return;\n }\n\n if (options?.scope !== undefined) {\n const target = resolveScope(this as HTMLElement, options.scope);\n if (!target) {\n console.warn(\n `[snice/@dispatch] scope did not resolve for \"${eventName}\" — event not dispatched.`\n );\n return;\n }\n target.dispatchEvent(event);\n return;\n }\n\n const target = defaultCommunicationTarget(this);\n if (!target) {\n throw new TypeError(\n `@dispatch('${eventName}') requires an element, attached controller, or provided @daemon instance.`\n );\n }\n target.dispatchEvent(event);\n };\n \n // Helper to handle timed dispatch\n const timedDispatch = (detail: any) => {\n if (options?.debounce) {\n clearTimeout(timers.debounceTimeout);\n timers.debounceTimeout = setTimeout(() => doDispatch(detail), options.debounce);\n return;\n }\n\n if (!options?.throttle) {\n doDispatch(detail);\n return;\n }\n\n const now = Date.now();\n const remaining = options.throttle - (now - timers.throttleLastCall);\n\n if (remaining <= 0) {\n clearTimeout(timers.throttleTimeout);\n timers.throttleLastCall = now;\n doDispatch(detail);\n return;\n }\n\n // Record the LATEST detail so the trailing dispatch carries fresh\n // data, not the first-suppressed-call detail captured by closure.\n timers.latestDetail = detail;\n if (!timers.throttleTimeout) {\n timers.throttleTimeout = setTimeout(() => {\n timers.throttleLastCall = Date.now();\n timers.throttleTimeout = null;\n const d = timers.latestDetail;\n timers.latestDetail = undefined;\n doDispatch(d);\n }, remaining);\n }\n };\n \n // Handle async methods\n if (result instanceof Promise) {\n return result.then((resolvedResult: any) => {\n timedDispatch(resolvedResult);\n return resolvedResult;\n });\n }\n \n // Sync method\n timedDispatch(result);\n return result;\n };\n };\n}\n\n/**\n * Clear any pending debounce/throttle dispatch timers on an instance (e.g. on\n * disconnect, so a queued event doesn't fire into a detached node). A dispatch\n * is a one-shot signal, so pending ones are dropped, not replayed.\n */\nexport function clearDispatchTimers(instance: any): void {\n const timers = instance[DISPATCH_TIMERS];\n if (!timers) return;\n\n for (const t of timers.values()) {\n if (t.debounceTimeout) clearTimeout(t.debounceTimeout);\n if (t.throttleTimeout) clearTimeout(t.throttleTimeout);\n t.debounceTimeout = null;\n t.throttleTimeout = null;\n t.throttleLastCall = 0;\n t.latestDetail = undefined;\n }\n}\n","/**\n * Method decorators for common patterns\n * @debounce, @throttle, @once, @memoize\n */\n\nimport { getSymbol } from './symbols';\n\nconst DEBOUNCE_TIMERS = getSymbol('debounce-timers');\nconst THROTTLE_TIMERS = getSymbol('throttle-timers');\nconst ONCE_CALLED = getSymbol('once-called');\nconst MEMOIZE_CACHE = getSymbol('memoize-cache');\n\n/**\n * @debounce decorator - delays function execution until after wait time has elapsed\n * since the last invocation\n *\n * @param wait - Time to wait in milliseconds (default: 300)\n * @param options - Debounce options\n * @param options.leading - Invoke on the leading edge (default: false)\n * @param options.trailing - Invoke on the trailing edge (default: true)\n * @param options.maxWait - Maximum time to wait before invoking (default: undefined)\n *\n * @example\n * ```typescript\n * @element('search-input')\n * class SearchInput extends HTMLElement {\n * @debounce(500)\n * handleSearch(query: string) {\n * // Only called 500ms after last keystroke\n * fetch(`/api/search?q=${query}`);\n * }\n * }\n * ```\n */\nexport function debounce(\n wait = 300,\n options: {\n leading?: boolean;\n trailing?: boolean;\n maxWait?: number;\n } = {}\n) {\n const { leading = false, trailing = true, maxWait } = options;\n\n return function (originalMethod: any, context: ClassMethodDecoratorContext) {\n const methodName = context.name as string;\n\n return function (this: any, ...args: any[]) {\n if (!this[DEBOUNCE_TIMERS]) {\n this[DEBOUNCE_TIMERS] = {};\n }\n\n const timers = this[DEBOUNCE_TIMERS];\n const timerKey = methodName;\n\n // Clear existing timer\n if (timers[timerKey]) {\n clearTimeout(timers[timerKey].timeout);\n }\n\n // Track when debounce started for maxWait\n const now = Date.now();\n const isFirstCall = !timers[timerKey];\n const startTime = isFirstCall ? now : timers[timerKey].startTime;\n\n // Check if maxWait exceeded\n const shouldInvokeFromMaxWait =\n maxWait !== undefined && now - startTime >= maxWait;\n\n // Leading edge invocation\n if (leading && isFirstCall) {\n const result = originalMethod.apply(this, args);\n timers[timerKey] = {\n timeout: null,\n startTime,\n lastArgs: args,\n };\n return result;\n }\n\n // Set new timer for trailing edge\n const timeout = setTimeout(() => {\n if (trailing || shouldInvokeFromMaxWait) {\n originalMethod.apply(this, timers[timerKey].lastArgs);\n }\n delete timers[timerKey];\n }, shouldInvokeFromMaxWait ? 0 : wait);\n\n timers[timerKey] = {\n timeout,\n startTime,\n lastArgs: args,\n };\n };\n };\n}\n\n/**\n * @throttle decorator - ensures function is called at most once per specified time period\n *\n * @param wait - Time to wait in milliseconds (default: 300)\n * @param options - Throttle options\n * @param options.leading - Invoke on the leading edge (default: true)\n * @param options.trailing - Invoke on the trailing edge (default: true)\n *\n * @example\n * ```typescript\n * @element('scroll-tracker')\n * class ScrollTracker extends HTMLElement {\n * @throttle(100)\n * handleScroll(e: Event) {\n * // Called at most once every 100ms\n * this.updateScrollPosition();\n * }\n * }\n * ```\n */\nexport function throttle(\n wait = 300,\n options: {\n leading?: boolean;\n trailing?: boolean;\n } = {}\n) {\n const { leading = true, trailing = true } = options;\n\n return function (originalMethod: any, context: ClassMethodDecoratorContext) {\n const methodName = context.name as string;\n\n return function (this: any, ...args: any[]) {\n if (!this[THROTTLE_TIMERS]) {\n this[THROTTLE_TIMERS] = {};\n }\n\n const timers = this[THROTTLE_TIMERS];\n const timerKey = methodName;\n const now = Date.now();\n\n // First call\n if (!timers[timerKey]) {\n if (leading) originalMethod.apply(this, args);\n\n timers[timerKey] = { lastInvoke: now, timeout: null, lastArgs: args };\n\n if (trailing && !leading) {\n timers[timerKey].timeout = setTimeout(() => {\n originalMethod.apply(this, timers[timerKey].lastArgs);\n delete timers[timerKey];\n }, wait);\n }\n return;\n }\n\n // Subsequent calls\n const timeSinceLastInvoke = now - timers[timerKey].lastInvoke;\n timers[timerKey].lastArgs = args;\n\n if (timers[timerKey].timeout) {\n clearTimeout(timers[timerKey].timeout);\n }\n\n // Enough time passed — invoke immediately\n if (timeSinceLastInvoke >= wait) {\n originalMethod.apply(this, args);\n timers[timerKey].lastInvoke = now;\n return;\n }\n\n // Set up trailing call\n if (trailing) {\n const remaining = wait - timeSinceLastInvoke;\n timers[timerKey].timeout = setTimeout(() => {\n originalMethod.apply(this, timers[timerKey].lastArgs);\n timers[timerKey].lastInvoke = Date.now();\n timers[timerKey].timeout = null;\n }, remaining);\n }\n };\n };\n}\n\n/**\n * @once decorator - ensures function is only called once\n * Subsequent calls return the result of the first call\n *\n * @param perInstance - If true, function can be called once per instance (default: true)\n * If false, function can only be called once globally across all instances\n *\n * @example\n * ```typescript\n * @element('data-loader')\n * class DataLoader extends HTMLElement {\n * @once()\n * async loadData() {\n * // Only loads data once, even if called multiple times\n * const data = await fetch('/api/data');\n * return data.json();\n * }\n * }\n * ```\n */\nexport function once(perInstance = true) {\n let globalCalled = false;\n let globalResult: any;\n\n return function (originalMethod: any, context: ClassMethodDecoratorContext) {\n const methodName = context.name as string;\n\n return function (this: any, ...args: any[]) {\n // Per-instance tracking\n if (perInstance) {\n if (!this[ONCE_CALLED]) this[ONCE_CALLED] = {};\n\n if (!this[ONCE_CALLED][methodName]) {\n this[ONCE_CALLED][methodName] = {\n called: true,\n result: originalMethod.apply(this, args),\n };\n }\n\n return this[ONCE_CALLED][methodName].result;\n }\n\n // Global tracking\n if (!globalCalled) {\n globalCalled = true;\n globalResult = originalMethod.apply(this, args);\n }\n\n return globalResult;\n };\n };\n}\n\n/**\n * @memoize decorator - caches function results based on arguments\n * Uses JSON.stringify for argument comparison by default\n *\n * @param options - Memoization options\n * @param options.keyGenerator - Custom function to generate cache key from arguments\n * @param options.maxSize - Maximum cache size (default: 100)\n * @param options.ttl - Time to live in milliseconds (default: undefined - no expiration)\n *\n * @example\n * ```typescript\n * @element('calculator')\n * class Calculator extends HTMLElement {\n * @memoize({ maxSize: 50 })\n * fibonacci(n: number): number {\n * // Results are cached, subsequent calls with same n are instant\n * if (n <= 1) return n;\n * return this.fibonacci(n - 1) + this.fibonacci(n - 2);\n * }\n * }\n * ```\n */\nexport function memoize(\n options: {\n keyGenerator?: (...args: any[]) => string;\n maxSize?: number;\n ttl?: number;\n } = {}\n) {\n const { keyGenerator = (...args) => JSON.stringify(args), maxSize = 100, ttl } = options;\n\n return function (originalMethod: any, context: ClassMethodDecoratorContext) {\n const methodName = context.name as string;\n\n return function (this: any, ...args: any[]) {\n if (!this[MEMOIZE_CACHE]) {\n this[MEMOIZE_CACHE] = {};\n }\n\n if (!this[MEMOIZE_CACHE][methodName]) {\n this[MEMOIZE_CACHE][methodName] = new Map();\n }\n\n const cache = this[MEMOIZE_CACHE][methodName];\n const key = keyGenerator(...args);\n\n // Check if cached\n if (cache.has(key)) {\n const cached = cache.get(key);\n const expired = ttl !== undefined && (Date.now() - cached.timestamp) > ttl;\n\n if (expired) {\n cache.delete(key);\n } else {\n return cached.value;\n }\n }\n\n // Compute result\n const result = originalMethod.apply(this, args);\n\n // Store in cache\n cache.set(key, {\n value: result,\n timestamp: Date.now(),\n });\n\n // Enforce max size (LRU - delete oldest)\n if (cache.size > maxSize) {\n const firstKey = cache.keys().next().value;\n cache.delete(firstKey);\n }\n\n return result;\n };\n };\n}\n\n/**\n * Clear all debounce timers for an instance\n * Useful in cleanup/disconnectedCallback\n */\nexport function clearDebounceTimers(instance: any): void {\n if (instance[DEBOUNCE_TIMERS]) {\n for (const timerKey in instance[DEBOUNCE_TIMERS]) {\n if (instance[DEBOUNCE_TIMERS][timerKey]?.timeout) {\n clearTimeout(instance[DEBOUNCE_TIMERS][timerKey].timeout);\n }\n }\n instance[DEBOUNCE_TIMERS] = {};\n }\n}\n\n/**\n * Clear all throttle timers for an instance\n * Useful in cleanup/disconnectedCallback\n */\nexport function clearThrottleTimers(instance: any): void {\n if (instance[THROTTLE_TIMERS]) {\n for (const timerKey in instance[THROTTLE_TIMERS]) {\n if (instance[THROTTLE_TIMERS][timerKey]?.timeout) {\n clearTimeout(instance[THROTTLE_TIMERS][timerKey].timeout);\n }\n }\n instance[THROTTLE_TIMERS] = {};\n }\n}\n\n/**\n * Clear memoize cache for an instance\n */\nexport function clearMemoizeCache(instance: any, methodName?: string): void {\n if (instance[MEMOIZE_CACHE]) {\n if (methodName) {\n delete instance[MEMOIZE_CACHE][methodName];\n } else {\n instance[MEMOIZE_CACHE] = {};\n }\n }\n}\n\n/**\n * Reset once-called state for an instance\n */\nexport function resetOnce(instance: any, methodName?: string): void {\n if (instance[ONCE_CALLED]) {\n if (methodName) {\n delete instance[ONCE_CALLED][methodName];\n } else {\n instance[ONCE_CALLED] = {};\n }\n }\n}\n","type MutationCallback = () => void;\n\nfunction isPlainObject(value: object): boolean {\n const prototype = Object.getPrototypeOf(value);\n return prototype === Object.prototype || prototype === null;\n}\n\nfunction descriptorsEqual(first?: PropertyDescriptor, second?: PropertyDescriptor): boolean {\n if (!first || !second) return first === second;\n const firstIsData = 'value' in first || 'writable' in first;\n const secondIsData = 'value' in second || 'writable' in second;\n return firstIsData === secondIsData &&\n first.configurable === second.configurable &&\n first.enumerable === second.enumerable &&\n (!firstIsData || (\n first.writable === second.writable &&\n Object.is(first.value, second.value)\n )) &&\n (firstIsData || (\n first.get === second.get &&\n first.set === second.set\n ));\n}\n\nfunction invariantValue(target: object, property: PropertyKey): { locked: boolean; value: unknown } {\n const descriptor = Reflect.getOwnPropertyDescriptor(target, property);\n if (!descriptor || descriptor.configurable) return { locked: false, value: undefined };\n if ('value' in descriptor && descriptor.writable === false) {\n return { locked: true, value: descriptor.value };\n }\n if (!('value' in descriptor) && descriptor.get === undefined) {\n return { locked: true, value: undefined };\n }\n return { locked: false, value: undefined };\n}\n\n/**\n * Wrap mutable collection/object state so nested writes can invalidate a\n * component without requiring a replacement assignment.\n */\nexport function createDeepReactive<T>(value: T, changed: MutationCallback): T {\n if (!value || typeof value !== 'object') return value;\n\n const cache = new WeakMap<object, any>();\n const rawByProxy = new WeakMap<object, object>();\n const unwrap = (input: any): any => input && typeof input === 'object'\n ? rawByProxy.get(input) || input\n : input;\n\n const wrap = (input: any): any => {\n if (!input || typeof input !== 'object') return input;\n if (cache.has(input)) return cache.get(input);\n\n if (input instanceof Map) {\n let proxy: Map<any, any>;\n const methods = new Map<PropertyKey, unknown>();\n proxy = new Proxy(input, {\n get(target, property) {\n const invariant = invariantValue(target, property);\n if (invariant.locked) return invariant.value;\n if (methods.has(property)) return methods.get(property);\n let method: unknown;\n if (property === 'set') method = (key: unknown, next: unknown) => {\n key = unwrap(key);\n next = unwrap(next);\n const existed = target.has(key);\n const previous = target.get(key);\n target.set(key, next);\n if (!existed || !Object.is(previous, next)) changed();\n return proxy;\n };\n else if (property === 'delete') method = (key: unknown) => {\n key = unwrap(key);\n const deleted = target.delete(key);\n if (deleted) changed();\n return deleted;\n };\n else if (property === 'clear') method = () => {\n if (target.size === 0) return;\n target.clear();\n changed();\n };\n else if (property === 'get') method = (key: unknown) => wrap(target.get(unwrap(key)));\n else if (property === 'has') method = (key: unknown) => target.has(unwrap(key));\n else if (property === 'forEach') method = (callback: Function, thisArg?: unknown) =>\n target.forEach((entryValue, key) => callback.call(thisArg, wrap(entryValue), wrap(key), proxy));\n else if (property === 'values') method = function* () {\n for (const entryValue of target.values()) yield wrap(entryValue);\n };\n else if (property === 'keys') method = function* () {\n for (const key of target.keys()) yield wrap(key);\n };\n else if (property === 'entries' || property === Symbol.iterator) method = function* () {\n for (const [key, entryValue] of target.entries()) yield [wrap(key), wrap(entryValue)];\n };\n else {\n const value = Reflect.get(target, property, target);\n if (typeof value !== 'function') return value;\n if (property === 'constructor') return value;\n method = value.bind(target);\n }\n methods.set(property, method);\n return method;\n }\n });\n cache.set(input, proxy);\n rawByProxy.set(proxy, input);\n return proxy;\n }\n\n if (input instanceof Set) {\n let proxy: Set<any>;\n const methods = new Map<PropertyKey, unknown>();\n proxy = new Proxy(input, {\n get(target, property) {\n const invariant = invariantValue(target, property);\n if (invariant.locked) return invariant.value;\n if (methods.has(property)) return methods.get(property);\n let method: unknown;\n if (property === 'add') method = (entryValue: unknown) => {\n entryValue = unwrap(entryValue);\n const existed = target.has(entryValue);\n target.add(entryValue);\n if (!existed) changed();\n return proxy;\n };\n else if (property === 'delete') method = (entryValue: unknown) => {\n entryValue = unwrap(entryValue);\n const deleted = target.delete(entryValue);\n if (deleted) changed();\n return deleted;\n };\n else if (property === 'clear') method = () => {\n if (target.size === 0) return;\n target.clear();\n changed();\n };\n else if (property === 'has') method = (entryValue: unknown) => target.has(unwrap(entryValue));\n else if (property === 'forEach') method = (callback: Function, thisArg?: unknown) =>\n target.forEach(entryValue => {\n const wrapped = wrap(entryValue);\n callback.call(thisArg, wrapped, wrapped, proxy);\n });\n else if (property === 'values' || property === 'keys' || property === Symbol.iterator) method = function* () {\n for (const entryValue of target.values()) yield wrap(entryValue);\n };\n else if (property === 'entries') method = function* () {\n for (const entryValue of target.values()) {\n const wrapped = wrap(entryValue);\n yield [wrapped, wrapped];\n }\n };\n else {\n const value = Reflect.get(target, property, target);\n if (typeof value !== 'function') return value;\n if (property === 'constructor') return value;\n method = value.bind(target);\n }\n methods.set(property, method);\n return method;\n }\n });\n cache.set(input, proxy);\n rawByProxy.set(proxy, input);\n return proxy;\n }\n\n if (!Array.isArray(input) && !isPlainObject(input)) return input;\n\n const proxy = new Proxy(input, {\n get(target, property, receiver) {\n const invariant = invariantValue(target, property);\n return invariant.locked\n ? invariant.value\n : wrap(Reflect.get(target, property, receiver));\n },\n set(target, property, next, receiver) {\n const previous = Reflect.get(target, property, receiver);\n next = unwrap(next);\n // Write directly to the wrapped target. Passing the proxy as the\n // receiver re-enters defineProperty for an ordinary assignment and\n // would report the same mutation twice.\n const result = Reflect.set(target, property, next);\n if (result && !Object.is(previous, next)) changed();\n return result;\n },\n deleteProperty(target, property) {\n const existed = Object.prototype.hasOwnProperty.call(target, property);\n const result = Reflect.deleteProperty(target, property);\n if (result && existed) changed();\n return result;\n },\n defineProperty(target, property, descriptor) {\n const previous = Reflect.getOwnPropertyDescriptor(target, property);\n const nextDescriptor = 'value' in descriptor\n ? { ...descriptor, value: unwrap(descriptor.value) }\n : descriptor;\n const result = Reflect.defineProperty(target, property, nextDescriptor);\n const current = result ? Reflect.getOwnPropertyDescriptor(target, property) : previous;\n if (result && !descriptorsEqual(previous, current)) changed();\n return result;\n }\n });\n cache.set(input, proxy);\n rawByProxy.set(proxy, input);\n return proxy;\n };\n\n return wrap(value);\n}\n","import { attachController, deferControllerAttachment, detachController, restoreDirectControllerAttribute } from './controller';\nimport { ControllerClass } from './types/i-controller';\nimport { setupObservers, cleanupObservers } from './observe';\nimport { setupResponseHandlers, cleanupResponseHandlers } from './request-response';\nimport { setupEventHandlers, cleanupEventHandlers } from './on';\nimport { setupContextHandler, cleanupContextHandler } from './context';\nimport { parseAttributeValue, detectType, valueToAttribute, getAttrName, ensureSet, ensureObj, invokeWatchers, invokeImmediateWatchers, validateWatchedProperties, notEqual } from './utils';\nimport { requestRender, applyStyles, clearRenderTimers, disconnectRenderTree, reconnectRenderTree } from './render';\nimport { clearDispatchTimers } from './events';\nimport { IS_ELEMENT_CLASS, IS_CONTROLLER_INSTANCE, READY_PROMISE, READY_RESOLVE, READY_REJECT, READY_HANDLERS_RUNNING, RENDERED_PROMISE, RENDERED_RESOLVE, CONTROLLER, DIRECT_CONTROLLER, CONTROLLER_ATTRIBUTE_SYNC, PENDING_CONTROLLER_BINDING, PROPERTIES, PROPERTY_VALUES, PROPERTY_DEFAULTS, PROPERTY_WRAPPERS, PROPERTIES_INITIALIZED, PRE_INIT_PROPERTY_VALUES, PRE_UPGRADE_PROPERTY_BINDINGS, PROPERTY_WATCHERS, PROPERTY_DEFINERS, EXPLICITLY_SET_PROPERTIES, SETTING_FROM_PROPERTY, ROUTER_CONTEXT, READY_HANDLERS, DISPOSE_HANDLERS, RECONNECT_HANDLERS, INITIALIZED, MOVED_HANDLERS, ADOPTED_HANDLERS, MOVED_TIMERS, ADOPTED_TIMERS, RENDER_METHOD, RENDER_OPTIONS, ELEMENT_OPTIONS, WATCH_METHODS, READY_METHODS, DISPOSE_METHODS, RECONNECT_METHODS, MOVED_METHODS, ADOPTED_METHODS, PENDING_RECONNECT_RENDER, SNICE_ELEMENT_BASE } from './symbols';\nimport { QueryOptions } from './types/query-options';\nimport { PropertyOptions, StateOptions } from './types/property-options';\nimport { WatchOptions } from './types/watch-options';\nimport { ElementOptions } from './types/element-options';\nimport { clearDebounceTimers, clearThrottleTimers } from './method-decorators';\nimport { AppContext } from './types/app-context';\nimport { Placard } from './types/placard';\nimport { RouteParams } from './types/route-params';\nimport { createDeepReactive } from './reactive';\nimport { ensureRenderRoot, getRenderRoot } from './render-root';\nimport { getContext as getAppContext } from './context-provider';\nimport { resetHostAutofocus, scheduleAutofocus } from './autofocus';\n\n/**\n * Interface that layout components must implement to receive updates\n * from the router about application state and navigation changes.\n *\n * The framework will call the update method:\n * - When the layout is first created/connected\n * - When route changes occur during navigation\n *\n * Placards are collected at route creation and refreshed before each navigation,\n * ensuring layouts always receive current page metadata.\n *\n * @example\n * ```typescript\n * @layout('app-shell')\n * class AppShell extends HTMLElement implements Layout {\n * update(appContext: AppContext, placards: Placard[], currentRoute: string, routeParams: RouteParams) {\n * // Update navigation, breadcrumbs, user info, etc.\n * this.renderNavigation(placards, currentRoute);\n * this.updateUserInfo(appContext.principal);\n * this.applyTheme(appContext.theme);\n * }\n * }\n * ```\n */\nexport interface Layout {\n /**\n * Called by the framework to update the layout with current application state.\n *\n * @param appContext - Application-wide context (theme, auth, config, etc.)\n * @param placards - All page metadata for navigation and breadcrumbs\n * @param currentRoute - The currently active route path\n * @param routeParams - Parameters extracted from the current route\n *\n * @example\n * ```typescript\n * update(appContext, placards, currentRoute, routeParams) {\n * // Filter placards for main navigation\n * const navItems = placards.filter(p => p.show !== false && !p.parent);\n *\n * // Build breadcrumbs for current page\n * const currentPlacard = placards.find(p => matchesRoute(p, currentRoute));\n * const breadcrumbs = this.buildBreadcrumbs(currentPlacard, placards);\n *\n * // Update UI\n * this.renderNavigation(navItems, currentRoute);\n * this.renderBreadcrumbs(breadcrumbs);\n * this.updateUserDisplay(appContext.principal);\n * }\n * ```\n */\n update(\n appContext: AppContext,\n placards: Placard[],\n currentRoute: string,\n routeParams: RouteParams\n ): void;\n}\n\n/**\n * Applies core element functionality to a constructor\n * This is shared between @element and @page decorators\n */\nexport function applyElementFunctionality(constructor: any) {\n // Mark as element class for channel decorator detection\n (constructor.prototype as any)[IS_ELEMENT_CLASS] = true;\n\n // Add controller property to all elements\n const originalConnectedCallback = constructor.prototype.connectedCallback;\n const originalDisconnectedCallback = constructor.prototype.disconnectedCallback;\n const originalAttributeChangedCallback = constructor.prototype.attributeChangedCallback;\n \n // Add framework-managed native/controller attributes and all reflected properties\n const observedAttributes = constructor.observedAttributes || [];\n if (!observedAttributes.includes('controller')) {\n observedAttributes.push('controller');\n }\n if (!observedAttributes.includes('autofocus')) {\n observedAttributes.push('autofocus');\n }\n \n // Add all properties to observed attributes (skip attribute: false)\n const properties = constructor[PROPERTIES];\n if (properties) {\n for (const [propName, propOptions] of properties) {\n if (propOptions.attribute === false) continue;\n const attributeName = getAttrName(propOptions, propName);\n if (!observedAttributes.includes(attributeName)) {\n observedAttributes.push(attributeName);\n }\n }\n }\n \n Object.defineProperty(constructor, 'observedAttributes', {\n get() { return observedAttributes; },\n configurable: true\n });\n \n // Add ready property - always returns a promise\n Object.defineProperty(constructor.prototype, 'ready', {\n get() {\n if (!this[READY_PROMISE]) {\n // Create a pending promise if not yet initialized\n this[READY_PROMISE] = new Promise<void>((resolve, reject) => {\n this[READY_RESOLVE] = resolve;\n this[READY_REJECT] = reject;\n });\n // Preserve a rejected ready promise for explicit awaiters without\n // producing an unhandled rejection when nobody reads `.ready`.\n this[READY_PROMISE].catch(() => {});\n }\n return this[READY_PROMISE];\n },\n enumerable: true,\n configurable: true\n });\n\n // Add rendered property - resolves when the pending render (batched,\n // debounced, or throttled) has committed to the DOM; resolves\n // immediately when no render is pending.\n Object.defineProperty(constructor.prototype, 'rendered', {\n get() {\n return this[RENDERED_RESOLVE] ? this[RENDERED_PROMISE] : Promise.resolve();\n },\n enumerable: true,\n configurable: true\n });\n\n // Add controller property\n Object.defineProperty(constructor.prototype, 'controller', {\n get() {\n return this[CONTROLLER];\n },\n set(value: string | ControllerClass | null) {\n const oldValue = this[CONTROLLER];\n this[CONTROLLER] = value;\n if (value === oldValue) return;\n\n if (value) {\n const label = typeof value === 'string' ? value : (value.name || '(anonymous controller class)');\n attachController(this, value).catch(error => {\n // Detached before ready — designed teardown, not a failure\n if (error?.name === 'ControllerAttachAborted') {\n console.debug(`Controller \"${label}\" attach aborted (element detached before ready)`);\n return;\n }\n // Registry misses only apply to string names — class references\n // never go through the registry.\n if (typeof value === 'string' && error?.message === `Controller \"${value}\" not found in registry`) {\n deferControllerAttachment(this, value);\n return;\n }\n console.error(`Failed to attach controller \"${label}\":`, error);\n });\n return;\n }\n\n if (oldValue) {\n detachController(this).catch(error => {\n console.error(`Failed to detach controller:`, error);\n });\n }\n },\n enumerable: true,\n configurable: true\n });\n \n \n constructor.prototype.connectedCallback = async function() {\n\n // If ready promise was already created (controller attached before connected), use existing resolve\n // Otherwise create the ready promise now\n if (!this[READY_PROMISE]) {\n this[READY_PROMISE] = new Promise<void>((resolve, reject) => {\n this[READY_RESOLVE] = resolve;\n this[READY_REJECT] = reject;\n });\n this[READY_PROMISE].catch(() => {});\n }\n\n // Only run initialization logic once, but re-establish handlers on reconnection\n if (this[INITIALIZED]) {\n try {\n reconnectRenderTree(this);\n } catch (error) {\n console.error(`Error reconnecting the render tree for ${this.tagName}:`, error);\n }\n // Re-establish handlers that get cleaned up on disconnect\n setupEventHandlers(this, this);\n setupResponseHandlers(this, this);\n setupContextHandler(this);\n\n // Re-establish observers that get cleaned up on disconnect\n try {\n setupObservers(this, this);\n } catch (error) {\n console.error(`Error setting up observers for ${this.tagName} on reconnection:`, error);\n }\n\n // Call user's connectedCallback\n if (originalConnectedCallback) {\n originalConnectedCallback.call(this);\n }\n\n // Fire @reconnect handlers — for components that wire long-lived\n // global listeners or subscriptions in @ready and need to re-establish\n // them on re-connection. @ready does NOT re-fire (deliberately, to\n // preserve once-only initialization semantics).\n const reconnectHandlers = constructor[RECONNECT_HANDLERS];\n if (reconnectHandlers) {\n for (const handler of reconnectHandlers) {\n try {\n const result = handler.method.call(this);\n if (result && typeof (result as any).then === 'function') {\n (result as Promise<any>).catch(error => {\n console.error(`Error in @reconnect handler ${handler.methodName}:`, error);\n });\n }\n } catch (error) {\n console.error(`Error in @reconnect handler ${handler.methodName}:`, error);\n }\n }\n }\n\n // Replay a render that was dropped while disconnected. The scheduler\n // sets this flag when it skips a detached element, so a property changed\n // while detached still reaches the DOM on reattach. A plain move (no\n // pending render) leaves the flag unset, so we don't re-render needlessly.\n if (this[RENDER_METHOD] && this[PENDING_RECONNECT_RENDER]) {\n this[PENDING_RECONNECT_RENDER] = false;\n requestRender(this);\n }\n scheduleAutofocus(this);\n return;\n }\n\n // Mark that properties are being initialized from attributes\n // This allows property setters to work during initialization\n this[PROPERTIES_INITIALIZED] = true;\n\n // Initialize properties from attributes before rendering\n const properties = constructor[PROPERTIES];\n if (properties) {\n for (const [propName, propOptions] of properties) {\n if (propOptions.attribute === false) continue;\n const attributeName = getAttrName(propOptions, propName);\n if (!this.hasAttribute(attributeName)) continue;\n\n const attrValue = this.getAttribute(attributeName);\n ensureSet(this, EXPLICITLY_SET_PROPERTIES).add(propName);\n\n if (propOptions.type === Boolean && attrValue === '') {\n this.setAttribute(attributeName, 'true');\n }\n\n this[propName] = parseAttributeValue(attrValue, propOptions);\n }\n }\n\n // Clear pre-init values for properties that have HTML attributes\n if (this[PRE_INIT_PROPERTY_VALUES]) {\n for (const [propName, propValue] of Array.from((this[PRE_INIT_PROPERTY_VALUES] as Map<string, any>).entries())) {\n const propOptions = properties?.get(propName);\n const attributeName = getAttrName(propOptions || {}, propName);\n this[PRE_INIT_PROPERTY_VALUES].delete(propName);\n\n if (!this.hasAttribute(attributeName)) {\n this[propName] = propValue;\n }\n }\n delete this[PRE_INIT_PROPERTY_VALUES];\n }\n\n // Pick up a controller CLASS a template bound before this element was\n // defined. The binding parks the class instead of assigning the\n // property — a pre-upgrade assignment would have shadowed this accessor\n // with an own expando property. Attach directly rather than through the\n // `controller` accessor: some DOM implementations (happy-dom) invoke\n // connectedCallback on define without swapping the prototype, so the\n // accessor may not exist on this instance yet.\n if (this[PENDING_CONTROLLER_BINDING] !== undefined) {\n const pendingControllerClass = this[PENDING_CONTROLLER_BINDING];\n delete this[PENDING_CONTROLLER_BINDING];\n if (!this[CONTROLLER]) {\n this[CONTROLLER] = pendingControllerClass;\n const pendingLabel = pendingControllerClass?.name || '(anonymous controller class)';\n attachController(this, pendingControllerClass).catch((error: any) => {\n if (error?.name === 'ControllerAttachAborted') {\n console.debug(`Controller \"${pendingLabel}\" attach aborted (element detached before ready)`);\n return;\n }\n console.error(`Failed to attach controller \"${pendingLabel}\":`, error);\n });\n }\n }\n\n // Pick up a `controller` attribute set before connection. Real browsers\n // fire attributeChangedCallback on connect for all observed attrs that\n // already existed; happy-dom doesn't always, so we read it proactively.\n if (this.hasAttribute('controller') && !this[CONTROLLER]) {\n const controllerName = this.getAttribute('controller');\n if (controllerName) (this as any).controller = controllerName;\n }\n\n applyStyles(this);\n\n // Delegated @on handlers must bind inside the render root. Styles used\n // to create that root as a side effect, leaving styleless renderers to\n // bind on the host before their shadow root existed. Create only for\n // declarative renderers here so imperative elements that manage their\n // own shadow root keep their established lifecycle.\n if (this[RENDER_METHOD]) {\n try {\n ensureRenderRoot(this);\n } catch {\n // Defer invalid custom-root diagnostics to the normal render path,\n // where render errors are contextualized and reported consistently.\n // There is no usable root to bind delegated handlers to in this\n // invalid configuration, but the initial render below will surface\n // the author error without escaping connectedCallback.\n }\n }\n\n setupEventHandlers(this, this);\n setupResponseHandlers(this, this);\n setupContextHandler(this);\n\n this[INITIALIZED] = true;\n\n // One-time (per class) sanity check: a @watch name with no matching\n // @property never fires — surface the typo instead of staying silent.\n validateWatchedProperties(this, constructor);\n\n // Now that the initial value is settled, give @watch immediate handlers\n // their one init call (before the first render, so derived state is ready).\n invokeImmediateWatchers(this, constructor);\n\n if (originalConnectedCallback) {\n originalConnectedCallback.call(this);\n }\n // v4.16.1: Render, run @ready handlers, THEN resolve .ready promise\n // This ensures `await el.ready` waits for both initial render AND all async @ready() methods\n //\n // We await a microtask boundary (to defer render for parent property bindings),\n // then run render + @ready handlers sequentially, then resolve .ready.\n const readyHandlers = constructor[READY_HANDLERS];\n\n // Await one microtask to defer initial render (allows parent property bindings)\n await new Promise<void>(r => queueMicrotask(r));\n\n // If the element was removed during the microtask gap, don't render,\n // don't run @ready on an orphan. Resolve ready so any awaiters don't\n // hang — the element exists, it just isn't in the DOM.\n if (!this.isConnected) {\n if (this[READY_RESOLVE]) {\n this[READY_RESOLVE]();\n this[READY_RESOLVE] = null;\n this[READY_REJECT] = null;\n }\n return;\n }\n\n if (this[RENDER_METHOD]) {\n requestRender(this, true);\n }\n\n // Setup observers after render so shadow DOM content exists\n try {\n setupObservers(this, this);\n } catch (error) {\n console.error(`Error setting up observers for ${this.tagName}:`, error);\n }\n\n // Yield a microtask so child elements' microtask-deferred renders\n // complete before @ready handlers run. Children queued their render\n // microtask when they connected (earlier in the queue), so they\n // drain before this one.\n await new Promise<void>(r => queueMicrotask(r));\n\n // Element may have been removed during the second microtask gap.\n if (!this.isConnected) {\n if (this[READY_RESOLVE]) {\n this[READY_RESOLVE]();\n this[READY_RESOLVE] = null;\n this[READY_REJECT] = null;\n }\n return;\n }\n\n // Run @ready handlers serially, awaiting each\n let readyFailed = false;\n let readyFailure: unknown;\n if (readyHandlers) {\n this[READY_HANDLERS_RUNNING] = true;\n try {\n for (const handler of readyHandlers) {\n try {\n await handler.method.call(this);\n } catch (error) {\n console.error(`Error in @ready handler ${handler.methodName}:`, error);\n if (!readyFailed) {\n readyFailed = true;\n readyFailure = error;\n }\n }\n }\n } finally {\n delete this[READY_HANDLERS_RUNNING];\n }\n }\n\n // NOW settle — render done AND every @ready handler completed. A failed\n // handler rejects the public signal instead of leaving a half-initialized\n // element indistinguishable from a successful one.\n if (readyFailed && this[READY_REJECT]) {\n this[READY_REJECT](readyFailure);\n this[READY_RESOLVE] = null;\n this[READY_REJECT] = null;\n } else if (this[READY_RESOLVE]) {\n this[READY_RESOLVE]();\n this[READY_RESOLVE] = null;\n this[READY_REJECT] = null;\n }\n scheduleAutofocus(this);\n };\n \n constructor.prototype.disconnectedCallback = async function() {\n try {\n disconnectRenderTree(this);\n } catch (error) {\n console.error(`Error disconnecting the render tree for ${this.tagName}:`, error);\n }\n // Call @dispose handlers\n const disposeHandlers = constructor[DISPOSE_HANDLERS];\n if (disposeHandlers) {\n for (const handler of disposeHandlers) {\n try {\n await handler.method.call(this);\n } catch (error) {\n console.error(`Error in @dispose handler ${handler.methodName}:`, error);\n }\n }\n }\n \n // Call original user-defined disconnectedCallback\n if (originalDisconnectedCallback) {\n originalDisconnectedCallback.call(this);\n }\n if (this[CONTROLLER]) {\n detachController(this).catch(error => {\n console.error(`Failed to detach controller:`, error);\n });\n }\n // Cleanup @on event handlers (v2.5.4 compatibility restored!)\n cleanupEventHandlers(this);\n // Cleanup @respond handlers\n cleanupResponseHandlers(this);\n // Cleanup @context handler\n cleanupContextHandler(this);\n // Cleanup @observe observers\n cleanupObservers(this);\n // Cleanup pending @debounce / @throttle timers so they don't fire on a dead element\n clearDebounceTimers(this);\n clearThrottleTimers(this);\n // The render/dispatch debounce-throttle timers live in separate stores.\n // A pending render is replayed on reconnect (same flag the scheduler\n // uses); a pending dispatch is a one-shot signal, so it's dropped.\n if (clearRenderTimers(this)) {\n (this as any)[PENDING_RECONNECT_RENDER] = true;\n }\n clearDispatchTimers(this);\n // @moved / @adopted debounce-throttle timers, likewise dropped so they\n // don't fire on a dead element.\n clearLifecycleTimers(this, MOVED_TIMERS);\n clearLifecycleTimers(this, ADOPTED_TIMERS);\n };\n \n constructor.prototype.attributeChangedCallback = function(name: string, oldValue: string | null, newValue: string | null) {\n originalAttributeChangedCallback?.call(this, name, oldValue, newValue);\n\n if (name === 'controller') {\n // A class attachment reflects its decorator name for DOM diagnostics,\n // but the class reference remains the only attachment authority.\n if (this[CONTROLLER_ATTRIBUTE_SYNC]) return;\n if (this[DIRECT_CONTROLLER]) {\n restoreDirectControllerAttribute(this);\n return;\n }\n this.controller = newValue;\n return;\n }\n\n if (name === 'autofocus') {\n if (newValue === null) resetHostAutofocus(this);\n else if (this[INITIALIZED]) scheduleAutofocus(this);\n }\n\n const properties = constructor[PROPERTIES];\n if (!properties) return;\n\n for (const [propName, propOptions] of properties) {\n const attributeName = getAttrName(propOptions, propName);\n if (attributeName.toLowerCase() !== name.toLowerCase()) continue;\n\n // A property-originated reflection already stored the authoritative\n // JS value. Do not parse the serialized attribute back into a clone.\n if (this[SETTING_FROM_PROPERTY]?.has(name.toLowerCase())) break;\n\n const currentValue = this[PROPERTY_VALUES]?.[propName];\n // A removed attribute reverts the property to its field default. Read it\n // back through the getter (attribute is already gone at this point) so the\n // watcher's newValue and PROPERTY_VALUES match what this[propName] now\n // returns — parseAttributeValue(null) would diverge to null for String/Number.\n const defaultValue = this[PROPERTY_DEFAULTS]?.[propName];\n let parsedValue = newValue === null\n ? (propOptions.type === Boolean ? false : defaultValue)\n : parseAttributeValue(newValue, propOptions, currentValue, defaultValue);\n const wrap = this[PROPERTY_WRAPPERS]?.[propName];\n if (wrap) parsedValue = wrap(parsedValue);\n\n const changed = propOptions?.hasChanged\n ? propOptions.hasChanged(parsedValue, currentValue)\n : notEqual(parsedValue, currentValue);\n if (!changed) break;\n\n ensureSet(this, EXPLICITLY_SET_PROPERTIES).add(propName);\n ensureObj(this, PROPERTY_VALUES)[propName] = parsedValue;\n\n // Watchers react to changes only. During upgrade the initial value\n // is not a change, so suppress until INITIALIZED; @watch immediate\n // handlers get their one init call from invokeImmediateWatchers.\n if (this[INITIALIZED]) {\n invokeWatchers(this, constructor, propName, currentValue, parsedValue);\n }\n\n if (this[RENDER_METHOD] && this[INITIALIZED]) {\n requestRender(this);\n }\n break;\n }\n };\n\n // Add connectedMoveCallback for handling DOM moves\n constructor.prototype.connectedMoveCallback = async function() {\n // Call @moved handlers via the prototype method (the debounce/throttle\n // wrapper), not the raw handler — otherwise @moved({debounce}) options\n // are ignored for real moves and only work when called directly.\n const movedHandlers = constructor[MOVED_HANDLERS];\n if (movedHandlers) {\n for (const handler of movedHandlers) {\n try {\n await (this as any)[handler.methodName]();\n } catch (error) {\n console.error(`Error in @moved handler ${handler.methodName}:`, error);\n }\n }\n }\n };\n\n // Add adoptedCallback for handling document adoption\n constructor.prototype.adoptedCallback = async function() {\n // Call @adopted handlers via the prototype method (the debounce/throttle\n // wrapper), not the raw handler — same reason as connectedMoveCallback.\n const adoptedHandlers = constructor[ADOPTED_HANDLERS];\n if (adoptedHandlers) {\n for (const handler of adoptedHandlers) {\n try {\n await (this as any)[handler.methodName]();\n } catch (error) {\n console.error(`Error in @adopted handler ${handler.methodName}:`, error);\n }\n }\n }\n };\n}\n\n/**\n * Walk the prototype chain and merge parent element metadata into the child.\n * Called once at class definition time — zero per-instance cost.\n * Skips plain HTMLElement (no metadata to merge).\n *\n * Only merges PROPERTIES (stored via context.metadata at decoration time)\n * and formAssociated. Other handler registrations (@watch, @on, @ready, etc.)\n * inherit automatically via TC39 addInitializer — parent initializers run\n * during child instance construction.\n */\nfunction mergeParentMetadata(constructor: any) {\n let parent = Object.getPrototypeOf(constructor);\n\n // Collect ancestors bottom-up, then merge top-down so the deepest parent goes first\n const ancestors: any[] = [];\n while (parent && parent !== HTMLElement && parent !== Function.prototype) {\n ancestors.push(parent);\n parent = Object.getPrototypeOf(parent);\n }\n ancestors.reverse();\n\n for (const ancestor of ancestors) {\n // Properties (Map) — parent first, child overrides\n if (ancestor[PROPERTIES]) {\n if (!constructor[PROPERTIES]) constructor[PROPERTIES] = new Map();\n for (const [key, value] of ancestor[PROPERTIES]) {\n if (!constructor[PROPERTIES].has(key)) {\n constructor[PROPERTIES].set(key, value);\n }\n }\n }\n\n // formAssociated — inherit if parent is form-associated\n if (ancestor.formAssociated && !constructor.formAssociated) {\n constructor.formAssociated = true;\n }\n }\n}\n\nfunction defineElement(tagName: string, constructor: any, context: ClassDecoratorContext, options?: ElementOptions) {\n // Merge metadata from parent @element classes (inheritance support)\n mergeParentMetadata(constructor);\n\n if (context.metadata && (context.metadata as any)[PROPERTIES]) {\n if (!constructor[PROPERTIES]) constructor[PROPERTIES] = new Map();\n for (const [key, value] of (context.metadata as any)[PROPERTIES]) {\n constructor[PROPERTIES].set(key, value);\n }\n } else if (_pendingProperties.length > 0) {\n // Symbol.metadata unavailable — drain the pending stack\n if (!constructor[PROPERTIES]) constructor[PROPERTIES] = new Map();\n const pending = _pendingProperties.pop()!;\n for (const [key, value] of pending) {\n constructor[PROPERTIES].set(key, value);\n }\n }\n if (options?.formAssociated) constructor.formAssociated = true;\n const inheritedOptions = {\n ...((Object.getPrototypeOf(constructor) as any)?.[ELEMENT_OPTIONS] || {})\n } as ElementOptions;\n const ownOptions = options || {};\n if (\n ownOptions.renderRoot === 'light' && typeof ownOptions.shadow === 'string' ||\n ownOptions.renderRoot === 'shadow' && ownOptions.shadow === false\n ) {\n throw new TypeError('snice: @element renderRoot and shadow options select conflicting render roots.');\n }\n const mergedOptions: ElementOptions = { ...inheritedOptions, ...ownOptions };\n if (Object.prototype.hasOwnProperty.call(ownOptions, 'shadow')) {\n mergedOptions.renderRoot = ownOptions.shadow === false ? 'light' : 'shadow';\n } else if (Object.prototype.hasOwnProperty.call(ownOptions, 'renderRoot')) {\n if (ownOptions.renderRoot === 'light') mergedOptions.shadow = false;\n else if (mergedOptions.shadow === false) mergedOptions.shadow = 'open';\n }\n constructor[ELEMENT_OPTIONS] = mergedOptions;\n if (\n (constructor.prototype as any)[SNICE_ELEMENT_BASE] === true &&\n Object.prototype.hasOwnProperty.call(constructor.prototype, 'render') &&\n !Object.prototype.hasOwnProperty.call(constructor.prototype, RENDER_METHOD) &&\n typeof constructor.prototype.render === 'function'\n ) {\n (constructor.prototype as any)[RENDER_METHOD] = constructor.prototype.render;\n (constructor.prototype as any)[RENDER_OPTIONS] = constructor.renderOptions || {};\n }\n applyElementFunctionality(constructor);\n if (customElements.get(tagName)) {\n if ((globalThis as any).SNICE_DEBUG) console.warn(`[snice] \"${tagName}\" is already registered. Skipping.`);\n return constructor;\n }\n customElements.define(tagName, constructor);\n return constructor;\n}\n\nexport function element(tagName: string, options?: ElementOptions) {\n if (options?.renderRoot !== undefined && options.renderRoot !== 'shadow' && options.renderRoot !== 'light') {\n throw new TypeError('snice: @element renderRoot must be \"shadow\" or \"light\".');\n }\n if (\n options?.shadow !== undefined && options.shadow !== false &&\n options.shadow !== 'open' && options.shadow !== 'closed'\n ) {\n throw new TypeError('snice: @element shadow must be \"open\", \"closed\", or false.');\n }\n return function (constructor: any, context: ClassDecoratorContext) {\n return defineElement(tagName, constructor, context, options);\n };\n}\n\nexport function layout(tagName: string) {\n return function (constructor: any, context: ClassDecoratorContext) {\n return defineElement(tagName, constructor, context);\n };\n}\n// Fallback stack for environments where Symbol.metadata is unavailable.\n// @property pushes entries; @element pops them. Works because field decorators\n// run synchronously before the class decorator in the same static block.\nconst _pendingProperties: Map<string, PropertyOptions>[] = [];\nconst nativeOwnPropertyDefaults = new WeakMap<Document, Map<PropertyKey, unknown>>();\n\nfunction isNativeOwnPropertyDefault(instance: any, propertyKey: PropertyKey, value: unknown): boolean {\n const ownerDocument = instance?.ownerDocument as Document | undefined;\n if (!ownerDocument?.createElement) return false;\n let defaults = nativeOwnPropertyDefaults.get(ownerDocument);\n if (!defaults) {\n const nativeElement = ownerDocument.createElement('div') as any;\n defaults = new Map<PropertyKey, unknown>();\n for (const key of Reflect.ownKeys(nativeElement)) defaults.set(key, nativeElement[key]);\n nativeOwnPropertyDefaults.set(ownerDocument, defaults);\n }\n return defaults.has(propertyKey) && Object.is(defaults.get(propertyKey), value);\n}\n\nexport function property(options?: PropertyOptions) {\n return function (_value: any, context: ClassFieldDecoratorContext) {\n const propertyKey = context.name as string;\n // Use metadata to store property information at decoration time\n if (context.metadata) {\n if (!(context.metadata as any)[PROPERTIES]) {\n (context.metadata as any)[PROPERTIES] = new Map();\n }\n (context.metadata as any)[PROPERTIES].set(propertyKey, options || {});\n } else {\n // Symbol.metadata unavailable — use the pending stack instead\n if (_pendingProperties.length === 0) _pendingProperties.push(new Map());\n _pendingProperties[_pendingProperties.length - 1].set(propertyKey, options || {});\n }\n\n\n return function(this: any, initialValue: any) {\n // A property binding can run while this is still an unupgraded custom\n // element, creating an own data property. Preserve that value across the\n // upgrade, but remove the expando before the decorated field initializer\n // is assigned so the assignment replays through the reactive accessor.\n const markedBindings = this[PRE_UPGRADE_PROPERTY_BINDINGS] as Set<string> | undefined;\n const wasTemplateBoundBeforeUpgrade = markedBindings?.delete(propertyKey) === true;\n if (markedBindings?.size === 0) delete this[PRE_UPGRADE_PROPERTY_BINDINGS];\n const hasOwnValue = Object.prototype.hasOwnProperty.call(this, propertyKey);\n const hadPreUpgradeValue = hasOwnValue && (\n wasTemplateBoundBeforeUpgrade || !isNativeOwnPropertyDefault(this, propertyKey, this[propertyKey])\n );\n const preUpgradeValue = hadPreUpgradeValue ? this[propertyKey] : initialValue;\n if (hasOwnValue) delete this[propertyKey];\n\n const constructor = this.constructor as any;\n if (!constructor[PROPERTIES]) constructor[PROPERTIES] = new Map();\n\n const finalOptions: PropertyOptions = { ...options };\n if (!finalOptions.type && initialValue !== undefined) finalOptions.type = detectType(initialValue);\n if (!finalOptions.attributeNaming && constructor.propertyAttributeNaming === 'kebab') {\n finalOptions.attributeNaming = 'kebab';\n }\n constructor[PROPERTIES].set(propertyKey, finalOptions);\n ensureObj(this, PROPERTY_DEFAULTS)[propertyKey] = initialValue;\n\n const notifyDeepMutation = () => {\n if (!this[PROPERTIES_INITIALIZED]) return;\n const current = this[PROPERTY_VALUES]?.[propertyKey];\n\n if (finalOptions.attribute !== false && finalOptions.reflect !== false) {\n const attributeName = getAttrName(finalOptions, propertyKey);\n const attributeValue = valueToAttribute(current, finalOptions, initialValue);\n const attrKey = attributeName.toLowerCase();\n ensureSet(this, SETTING_FROM_PROPERTY).add(attrKey);\n try {\n if (attributeValue === null) this.removeAttribute?.(attributeName);\n else this.setAttribute?.(attributeName, attributeValue);\n } finally {\n this[SETTING_FROM_PROPERTY].delete(attrKey);\n }\n }\n\n if (this[INITIALIZED]) {\n invokeWatchers(this, this.constructor, propertyKey, current, current);\n if (this[RENDER_METHOD]) requestRender(this);\n }\n };\n\n const wrap = (value: any) => {\n if (!finalOptions.deep) return value;\n let wrapped: any;\n wrapped = createDeepReactive(value, () => {\n // A caller may retain an old proxied object after replacing the\n // property. Mutating that detached graph must not invalidate the\n // component or notify watchers for the current value.\n if (this[PROPERTY_VALUES]?.[propertyKey] !== wrapped) return;\n notifyDeepMutation();\n });\n return wrapped;\n };\n ensureObj(this, PROPERTY_WRAPPERS)[propertyKey] = wrap;\n\n const proto = this.constructor.prototype;\n let definers: Map<string, any> | undefined = proto[PROPERTY_DEFINERS];\n if (!definers || !Object.prototype.hasOwnProperty.call(proto, PROPERTY_DEFINERS)) {\n definers = new Map(definers);\n proto[PROPERTY_DEFINERS] = definers;\n }\n const existingDefiner = definers.get(propertyKey);\n if (!existingDefiner || existingDefiner !== options) {\n definers.set(propertyKey, options);\n Object.defineProperty(this.constructor.prototype, propertyKey, {\n get(this: any) {\n if (this[PRE_INIT_PROPERTY_VALUES]?.has(propertyKey)) {\n return this[PRE_INIT_PROPERTY_VALUES].get(propertyKey);\n }\n if (this[PROPERTY_VALUES] && propertyKey in this[PROPERTY_VALUES]) {\n return this[PROPERTY_VALUES][propertyKey];\n }\n return initialValue;\n },\n set(this: any, incomingValue: any) {\n const oldValue = this[propertyKey];\n const changed = finalOptions.hasChanged\n ? finalOptions.hasChanged(incomingValue, oldValue)\n : notEqual(incomingValue, oldValue);\n if (!changed) return;\n\n const instanceWrap = this[PROPERTY_WRAPPERS]?.[propertyKey] || ((value: any) => value);\n // Property assignments are already typed JavaScript values and\n // remain the source of truth. `type` and `converter.fromAttribute`\n // apply only at the string attribute boundary; coercing here would\n // destroy object identity and turn valid union values (for example\n // `Date | ''` or `string | string[]`) into the wrong type.\n const newValue = instanceWrap(incomingValue);\n if (!this[PROPERTIES_INITIALIZED]) {\n if (!this[PRE_INIT_PROPERTY_VALUES]) this[PRE_INIT_PROPERTY_VALUES] = new Map();\n this[PRE_INIT_PROPERTY_VALUES].set(propertyKey, newValue);\n return;\n }\n\n ensureObj(this, PROPERTY_VALUES)[propertyKey] = newValue;\n\n if (finalOptions.attribute !== false && finalOptions.reflect !== false) {\n const attributeName = getAttrName(finalOptions, propertyKey);\n const attributeValue = valueToAttribute(\n newValue,\n finalOptions,\n this[PROPERTY_DEFAULTS]?.[propertyKey]\n );\n ensureSet(this, EXPLICITLY_SET_PROPERTIES).add(propertyKey);\n const attrKey = attributeName.toLowerCase();\n ensureSet(this, SETTING_FROM_PROPERTY).add(attrKey);\n try {\n if (attributeValue === null) this.removeAttribute?.(attributeName);\n else this.setAttribute?.(attributeName, attributeValue);\n } finally {\n this[SETTING_FROM_PROPERTY].delete(attrKey);\n }\n }\n\n if (this[INITIALIZED]) {\n invokeWatchers(this, this.constructor, propertyKey, oldValue, newValue);\n if (this[RENDER_METHOD]) requestRender(this);\n }\n },\n configurable: true,\n enumerable: true\n });\n }\n\n const wrappedInitialValue = wrap(initialValue);\n ensureObj(this, PROPERTY_VALUES)[propertyKey] = wrappedInitialValue;\n ensureObj(this, PROPERTY_DEFAULTS)[propertyKey] = wrappedInitialValue;\n return hadPreUpgradeValue ? preUpgradeValue : wrappedInitialValue;\n };\n };\n}\n\n/** Internal reactive state: never reads from or reflects to an attribute. */\nexport function state(options: StateOptions = {}) {\n return property({ ...options, attribute: false, reflect: false });\n}\n\n\nfunction getQueryRoot(instance: any): any {\n const isController = instance[IS_CONTROLLER_INSTANCE] === true;\n return isController && instance.element ? instance.element : instance;\n}\n\nexport function query(selector: string, options: QueryOptions = {}) {\n return function (_value: any, context: ClassFieldDecoratorContext) {\n const { light = false, shadow = true } = options;\n const propertyKey = context.name as string;\n\n return function(this: any, initialValue: any) {\n if (!Object.hasOwn(this.constructor.prototype, propertyKey)) {\n Object.defineProperty(this.constructor.prototype, propertyKey, {\n get() {\n const root = getQueryRoot(this);\n let result = null;\n const managedRoot = root instanceof HTMLElement ? getRenderRoot(root) : null;\n if (shadow && managedRoot) result = managedRoot.querySelector(selector);\n else if (shadow && root.shadowRoot) result = root.shadowRoot.querySelector(selector);\n if (!result && light) result = root.querySelector(selector);\n return result || null;\n },\n set() {},\n configurable: true,\n enumerable: true\n });\n }\n return initialValue;\n };\n };\n}\n\nexport function queryAll(selector: string, options: QueryOptions = {}) {\n return function (_value: any, context: ClassFieldDecoratorContext) {\n const { light = false, shadow = true } = options;\n const propertyKey = context.name as string;\n\n return function(this: any, initialValue: any) {\n if (!Object.hasOwn(this.constructor.prototype, propertyKey)) {\n Object.defineProperty(this.constructor.prototype, propertyKey, {\n get() {\n const root = getQueryRoot(this);\n const results = new Set<Element>();\n const managedRoot = root instanceof HTMLElement ? getRenderRoot(root) : null;\n if (shadow && managedRoot) {\n for (const match of managedRoot.querySelectorAll(selector)) results.add(match);\n } else if (shadow && root.shadowRoot) {\n for (const match of root.shadowRoot.querySelectorAll(selector)) results.add(match);\n }\n if (light) {\n for (const match of root.querySelectorAll(selector)) results.add(match);\n }\n return [...results] as any as NodeListOf<Element>;\n },\n set() {},\n configurable: true,\n enumerable: true\n });\n }\n return initialValue;\n };\n };\n}\n\n\n\n\n\n\nexport function watch(...args: (string | WatchOptions)[]) {\n // A trailing options object is separated from the watched property names.\n const propertyNames = args.filter((a): a is string => typeof a === 'string');\n const options = args.find((a): a is WatchOptions => typeof a === 'object' && a !== null);\n // Fire on init by default; opt out of the init call with { immediate: false }.\n const immediate = options?.immediate !== false;\n\n return function (target: any, context: ClassMethodDecoratorContext) {\n const methodName = context.name as string;\n\n context.addInitializer(function(this: any) {\n const constructor = this.constructor as any;\n\n // Dedup by (method reference, propertyName) so that multiple @watch\n // decorators on the same method register for each key independently,\n // while still preventing duplicate registration when child classes\n // inherit/override a method with the same name. Use hasOwnProperty so\n // subclasses get their OWN Map — otherwise child pushes into the\n // parent's PROPERTY_WATCHERS via the prototype chain.\n if (!Object.prototype.hasOwnProperty.call(constructor, WATCH_METHODS)) {\n constructor[WATCH_METHODS] = new Map();\n }\n let registered: Set<string> = constructor[WATCH_METHODS].get(target);\n if (!registered) {\n registered = new Set<string>();\n constructor[WATCH_METHODS].set(target, registered);\n }\n\n if (!Object.prototype.hasOwnProperty.call(constructor, PROPERTY_WATCHERS)) {\n // Deep-copy the inherited Map so the child starts with the parent's\n // watchers but pushing to a propertyName's array on the child doesn't\n // mutate the parent's array.\n const inherited: Map<string, any[]> | undefined = constructor[PROPERTY_WATCHERS];\n const copy = new Map<string, any[]>();\n if (inherited) {\n for (const [key, arr] of inherited) copy.set(key, [...arr]);\n }\n constructor[PROPERTY_WATCHERS] = copy;\n }\n\n for (const propertyName of propertyNames) {\n if (registered.has(propertyName)) continue;\n registered.add(propertyName);\n\n if (!constructor[PROPERTY_WATCHERS].has(propertyName)) {\n constructor[PROPERTY_WATCHERS].set(propertyName, []);\n }\n\n constructor[PROPERTY_WATCHERS].get(propertyName).push({\n methodName,\n method: target,\n immediate\n });\n }\n });\n };\n}\n\n/**\n * Decorator that injects router context into a property\n * The context is automatically provided to page components by the router\n */\nexport function context() {\n return function(_value: any, context: ClassFieldDecoratorContext) {\n const propertyKey = context.name as string;\n\n // Return a field initializer function for new decorators\n return function(this: any, initialValue: any) {\n // Set up the property descriptor on first access\n if (!Object.hasOwn(this.constructor.prototype, propertyKey)) {\n const descriptor: PropertyDescriptor = {\n get() {\n // Cached context\n if ((this as any)[ROUTER_CONTEXT] !== undefined) {\n return (this as any)[ROUTER_CONTEXT];\n }\n\n const resolved = getAppContext(this);\n if (resolved === undefined) return undefined;\n\n // Explicit providers may be nested or released, so do not cache a\n // dynamically resolved value. Router-owned context is injected on\n // the instance and returned by the fast path above.\n return resolved;\n },\n set() {\n // Context is read-only\n },\n configurable: true,\n enumerable: true\n };\n\n Object.defineProperty(this.constructor.prototype, propertyKey, descriptor);\n }\n\n return initialValue;\n };\n };\n}\n\nfunction registerHandler(handlersSymbol: symbol, methodsSymbol: symbol, target: any, context: ClassMethodDecoratorContext, extra?: any) {\n const methodName = context.name as string;\n context.addInitializer(function(this: any) {\n const constructor = this.constructor as any;\n // hasOwnProperty guards so subclasses get their OWN Set/array instead of\n // mutating the parent's via the prototype chain.\n if (!Object.prototype.hasOwnProperty.call(constructor, methodsSymbol)) {\n constructor[methodsSymbol] = new Set();\n }\n if (constructor[methodsSymbol].has(target)) return;\n constructor[methodsSymbol].add(target);\n if (!Object.prototype.hasOwnProperty.call(constructor, handlersSymbol)) {\n const inherited = constructor[handlersSymbol];\n constructor[handlersSymbol] = inherited ? [...inherited] : [];\n }\n constructor[handlersSymbol].push({ methodName, method: target, ...extra });\n });\n}\n\nexport function ready() {\n return function (target: any, context: ClassMethodDecoratorContext) {\n registerHandler(READY_HANDLERS, READY_METHODS, target, context);\n };\n}\n\nexport function dispose() {\n return function (target: any, context: ClassMethodDecoratorContext) {\n registerHandler(DISPOSE_HANDLERS, DISPOSE_METHODS, target, context);\n };\n}\n\n/**\n * Fires every time the element is connected AFTER the first connect.\n *\n * `@ready` only fires once (after the initial render). `@dispose` fires on\n * every disconnect. The gap between them is \"what should run on a\n * reconnect?\" For most components, framework-managed pieces (`@on`,\n * `@observe`, `@respond`, `@context`) are re-established automatically\n * and nothing else is needed.\n *\n * Use `@reconnect` only when the component wires its OWN long-lived global\n * subscription in `@ready` (e.g. a `document.addEventListener` for\n * outside-click detection) and tears it down in `@dispose`. The framework\n * doesn't track those, so they need a hook to re-attach on reconnect.\n *\n * Counterpart to `@dispose`. Symmetric.\n */\nexport function reconnect() {\n return function (target: any, context: ClassMethodDecoratorContext) {\n registerHandler(RECONNECT_HANDLERS, RECONNECT_METHODS, target, context);\n };\n}\n\n/**\n * Clear any pending @moved / @adopted debounce/throttle timers on an instance\n * (e.g. on disconnect), so they don't fire on a dead element.\n */\nfunction clearLifecycleTimers(instance: any, timersSymbol: symbol): void {\n const map = instance[timersSymbol];\n if (!map) return;\n\n for (const t of map.values()) {\n if (t.debounceTimer) clearTimeout(t.debounceTimer);\n if (t.throttleTimer) clearTimeout(t.throttleTimer);\n t.debounceTimer = null;\n t.throttleTimer = null;\n t.lastThrottleCall = 0;\n }\n}\n\nfunction createLifecycleDecorator(handlersSymbol: symbol, timersSymbol: symbol, methodsSymbol: symbol) {\n return function (options: any = {}) {\n return function (originalMethod: any, context: ClassMethodDecoratorContext) {\n registerHandler(handlersSymbol, methodsSymbol, originalMethod, context, { options });\n\n const methodName = context.name as string;\n\n return function (this: HTMLElement, ...args: any[]) {\n if (!(this as any)[timersSymbol]) (this as any)[timersSymbol] = new Map();\n if (!(this as any)[timersSymbol].has(methodName)) {\n (this as any)[timersSymbol].set(methodName, { throttleTimer: null, debounceTimer: null, lastThrottleCall: 0 });\n }\n\n const timers = (this as any)[timersSymbol].get(methodName);\n const exec = (...a: any[]) => originalMethod.apply(this, a);\n // Deferred (debounce/throttle) calls run inside a setTimeout, outside\n // the caller's try/catch — so catch their sync throws and async\n // rejections here and log, rather than surface an uncaught error.\n const execDeferred = (...a: any[]) => {\n try {\n const result = originalMethod.apply(this, a);\n if (result && typeof result.then === 'function') {\n (result as Promise<any>).catch((error) =>\n console.error(`Error in deferred lifecycle handler ${methodName}:`, error)\n );\n }\n } catch (error) {\n console.error(`Error in deferred lifecycle handler ${methodName}:`, error);\n }\n };\n\n if (options.debounce > 0) {\n clearTimeout(timers.debounceTimer);\n timers.debounceTimer = setTimeout(() => execDeferred(...args), options.debounce);\n return undefined;\n }\n\n if (options.throttle > 0) {\n const now = Date.now();\n if (timers.lastThrottleCall === 0 || now - timers.lastThrottleCall >= options.throttle) {\n timers.lastThrottleCall = now;\n return exec(...args);\n }\n if (!timers.throttleTimer) {\n const remaining = options.throttle - (now - timers.lastThrottleCall);\n timers.throttleTimer = setTimeout(() => {\n timers.throttleTimer = null;\n timers.lastThrottleCall = Date.now();\n execDeferred(...args);\n }, remaining);\n }\n return undefined;\n }\n\n return exec(...args);\n };\n };\n };\n}\n\nexport const moved = createLifecycleDecorator(MOVED_HANDLERS, MOVED_TIMERS, MOVED_METHODS);\nexport const adopted = createLifecycleDecorator(ADOPTED_HANDLERS, ADOPTED_TIMERS, ADOPTED_METHODS);\n","import { requestRender, renderElementNow } from './render';\nimport { ELEMENT_OPTIONS, SNICE_ELEMENT_BASE } from './symbols';\nimport type { ElementOptions } from './types/element-options';\n\n/**\n * Optional authoring base for convention-driven Snice components.\n *\n * Decorators remain fully supported on plain HTMLElement subclasses. Extending\n * this class adds typed lifecycle promises, imperative invalidation, modern\n * kebab-case implicit attributes, and `render()` / static `styles` conventions.\n */\nexport class SniceElement extends HTMLElement {\n static propertyAttributeNaming: 'kebab' = 'kebab';\n\n protected createRenderRoot(): HTMLElement | ShadowRoot {\n const options = (this.constructor as any)[ELEMENT_OPTIONS] as ElementOptions | undefined;\n const mode = typeof options?.shadow === 'string' ? options.shadow : 'open';\n return this.attachShadow({ mode, delegatesFocus: options?.delegatesFocus });\n }\n\n invalidate(): Promise<void> {\n requestRender(this);\n return this.rendered;\n }\n\n renderNow(): Promise<void> {\n renderElementNow(this);\n return this.rendered;\n }\n}\n\n// Declaration merging exposes lifecycle promises without emitting class fields\n// that could shadow the accessors installed by @element at runtime.\nexport interface SniceElement {\n readonly ready: Promise<void>;\n readonly rendered: Promise<void>;\n}\n\n// `@element` uses this inherited marker to enable render() conventions only\n// for the opt-in base class. Plain HTMLElement components may legitimately\n// have imperative helper methods named render().\nObject.defineProperty(SniceElement.prototype, SNICE_ELEMENT_BASE, { value: true });\n","/*!\n * pica-route v1.1.2\n * A pure URL pattern matching library compatible with route-parser API\n * (c) 2024\n * Released under the MIT License.\n */\nclass Route {\n constructor(pattern) {\n this.parsed = this.parsePattern(pattern);\n }\n get spec() {\n return this.parsed.template;\n }\n parsePattern(pattern) {\n // Handle optional query syntax (?query=:param)\n let pathPattern = pattern;\n let queryPattern = '';\n let queryOptional = false;\n const queryIndex = pattern.indexOf('?');\n if (queryIndex !== -1) {\n pathPattern = pattern.slice(0, queryIndex);\n queryPattern = pattern.slice(queryIndex + 1);\n // Check if query is wrapped in optional syntax (?...)\n if (pathPattern.endsWith('(') && queryPattern.endsWith(')')) {\n queryOptional = true;\n pathPattern = pathPattern.slice(0, -1);\n queryPattern = queryPattern.slice(0, -1);\n }\n }\n return {\n pathSegments: this.parseSegments(pathPattern),\n querySegments: queryPattern ? this.parseQuerySegments(queryPattern) : [],\n queryOptional,\n template: pattern\n };\n }\n parseSegments(pattern) {\n const segments = [];\n let i = 0;\n while (i < pattern.length) {\n const char = pattern[i];\n switch (char) {\n case '(':\n // Parse optional group\n const { segments: optionalSegments, endIndex } = this.parseOptionalGroup(pattern, i);\n segments.push({ type: 'optional', segments: optionalSegments });\n i = endIndex + 1;\n break;\n case ':':\n // Parse parameter\n const { name, endIndex: paramEndIndex } = this.parseIdentifier(pattern, i + 1);\n segments.push({ type: 'param', name });\n i = paramEndIndex;\n break;\n case '*':\n // Parse splat\n const { name: splatName, endIndex: splatEndIndex } = this.parseIdentifier(pattern, i + 1);\n segments.push({ type: 'splat', name: splatName });\n i = splatEndIndex;\n break;\n default:\n // Parse literal text\n const { value, endIndex: literalEndIndex } = this.parseLiteral(pattern, i);\n if (value) {\n segments.push({ type: 'literal', value });\n }\n i = literalEndIndex;\n break;\n }\n }\n return segments;\n }\n parseOptionalGroup(pattern, startIndex) {\n let depth = 1;\n let i = startIndex + 1;\n while (i < pattern.length && depth > 0) {\n if (pattern[i] === '(')\n depth++;\n if (pattern[i] === ')')\n depth--;\n i++;\n }\n const content = pattern.slice(startIndex + 1, i - 1);\n return {\n segments: this.parseSegments(content),\n endIndex: i - 1\n };\n }\n parseIdentifier(pattern, startIndex) {\n let i = startIndex;\n while (i < pattern.length && /[\\w-]/.test(pattern[i])) {\n i++;\n }\n return {\n name: pattern.slice(startIndex, i),\n endIndex: i\n };\n }\n parseLiteral(pattern, startIndex) {\n let i = startIndex;\n while (i < pattern.length && !'(:*('.includes(pattern[i])) {\n i++;\n }\n return {\n value: pattern.slice(startIndex, i),\n endIndex: i\n };\n }\n parseQuerySegments(queryPattern) {\n // Remove optional group syntax wrapping the query\n let cleanPattern = queryPattern;\n if (cleanPattern.startsWith('(') && cleanPattern.endsWith(')')) {\n cleanPattern = cleanPattern.slice(1, -1);\n }\n const segments = [];\n let i = 0;\n while (i < cleanPattern.length) {\n switch (cleanPattern[i]) {\n case ':':\n const { name, endIndex } = this.parseIdentifier(cleanPattern, i + 1);\n segments.push({ type: 'param', name });\n i = endIndex;\n break;\n default:\n const { value, endIndex: literalEndIndex } = this.parseQueryLiteral(cleanPattern, i);\n if (value) {\n segments.push({ type: 'literal', value });\n }\n i = literalEndIndex;\n break;\n }\n }\n return segments;\n }\n parseQueryLiteral(pattern, startIndex) {\n let i = startIndex;\n while (i < pattern.length && pattern[i] !== ':') {\n i++;\n }\n return {\n value: pattern.slice(startIndex, i),\n endIndex: i\n };\n }\n getAllParamNames() {\n const paramNames = new Set();\n const collectParams = (segments) => {\n for (const segment of segments) {\n switch (segment.type) {\n case 'param':\n case 'splat':\n paramNames.add(segment.name);\n break;\n case 'optional':\n collectParams(segment.segments);\n break;\n }\n }\n };\n collectParams(this.parsed.pathSegments);\n collectParams(this.parsed.querySegments);\n return Array.from(paramNames);\n }\n canMatchRemainingSegments(path, startIndex, segments) {\n // Quick check: try to match the remaining segments\n // This is a simplified check - we just look for literal segments that must exist\n let pathIndex = startIndex;\n for (const segment of segments) {\n if (segment.type === 'literal') {\n const literalIndex = path.indexOf(segment.value, pathIndex);\n if (literalIndex === -1) {\n return false; // Required literal not found\n }\n pathIndex = literalIndex + segment.value.length;\n }\n // For optional, param, and splat segments, we're more permissive in this quick check\n }\n return true;\n }\n match(url) {\n const [pathPart, queryPart] = url.split('?');\n const pathParams = this.matchPath(pathPart, this.parsed.pathSegments);\n if (pathParams === false) {\n return false;\n }\n const queryParams = this.matchQuery(queryPart || '', this.parsed.querySegments);\n if (queryParams === false) {\n return false;\n }\n // Initialize result with all optional parameters set to undefined\n const allParams = this.getAllParamNames();\n const result = {};\n // Set all parameters to undefined initially\n for (const paramName of allParams) {\n result[paramName] = undefined;\n }\n // Override with actual matched values\n Object.assign(result, pathParams, queryParams);\n return result;\n }\n matchPath(path, segments) {\n const result = {};\n let pathIndex = 0;\n for (let i = 0; i < segments.length; i++) {\n const segment = segments[i];\n const remainingSegments = segments.slice(i + 1);\n const matchResult = this.matchSegment(path, pathIndex, segment, remainingSegments);\n if (matchResult === false) {\n return false;\n }\n Object.assign(result, matchResult.params);\n pathIndex = matchResult.nextIndex;\n }\n // Check if we've consumed the entire path\n if (pathIndex < path.length) {\n return false;\n }\n return result;\n }\n matchSegment(path, startIndex, segment, remainingSegments = []) {\n switch (segment.type) {\n case 'literal':\n if (path.slice(startIndex, startIndex + segment.value.length) === segment.value) {\n return { params: {}, nextIndex: startIndex + segment.value.length };\n }\n return false;\n case 'param': {\n let endIndex = startIndex;\n // Check if the next segment is a literal and find where it starts\n const nextSegment = remainingSegments[0];\n let stopChars = ['/', '?'];\n if (nextSegment && nextSegment.type === 'literal') {\n // For parameters followed by literals, we need to find where the literal starts\n const literalValue = nextSegment.value;\n const literalStart = path.indexOf(literalValue, startIndex);\n if (literalStart !== -1) {\n endIndex = literalStart;\n }\n else {\n // Literal not found, this parameter can't match\n return false;\n }\n }\n else {\n // Default behavior - stop at / or ?\n while (endIndex < path.length && !stopChars.includes(path[endIndex])) {\n endIndex++;\n }\n }\n if (endIndex === startIndex)\n return false;\n let value;\n try {\n value = decodeURIComponent(path.slice(startIndex, endIndex));\n }\n catch (e) {\n // If decoding fails, use the original value\n value = path.slice(startIndex, endIndex);\n }\n // If we hit a query string, we should reject this match for path parameters\n if (endIndex < path.length && path[endIndex] === '?' && remainingSegments.length > 0) {\n return false;\n }\n // Keep values as strings to match route-parser behavior\n return {\n params: { [segment.name]: value },\n nextIndex: endIndex\n };\n }\n case 'splat': {\n // For splats, we need to find the optimal stopping point by looking ahead\n let endIndex = path.length;\n const nextSegment = remainingSegments[0];\n if (nextSegment) {\n switch (nextSegment.type) {\n case 'literal':\n // For literal dots after splats, use first occurrence (for file extensions)\n // For other literals, use last occurrence\n if (nextSegment.value === '.') {\n const firstDotIndex = path.indexOf('.', startIndex);\n if (firstDotIndex !== -1) {\n endIndex = firstDotIndex;\n }\n }\n else {\n // Find the last occurrence of the next literal\n const literalIndex = path.lastIndexOf(nextSegment.value);\n if (literalIndex !== -1 && literalIndex >= startIndex) {\n endIndex = literalIndex;\n }\n }\n break;\n case 'param':\n // For parameter after splat, find the last slash\n let lastSlashIndex = -1;\n for (let i = path.length - 1; i >= startIndex; i--) {\n if (path[i] === '/') {\n lastSlashIndex = i;\n break;\n }\n }\n if (lastSlashIndex !== -1) {\n endIndex = lastSlashIndex;\n }\n break;\n case 'splat':\n // For consecutive splats, give this splat everything up to the last slash\n // The next splat gets the last component\n let lastSlash = -1;\n for (let i = path.length - 1; i > startIndex; i--) {\n if (path[i] === '/') {\n lastSlash = i + 1; // Include the slash\n break;\n }\n }\n if (lastSlash !== -1) {\n endIndex = lastSlash;\n }\n else {\n // No slash found, this splat gets everything except the last component\n const pathSegments = path.slice(startIndex).split('/').filter(s => s);\n if (pathSegments.length > 1) {\n endIndex = startIndex + pathSegments.slice(0, -1).join('/').length + 1;\n }\n else {\n endIndex = startIndex; // Give nothing to this splat\n }\n }\n break;\n case 'optional':\n // Look for literals inside optional groups\n const findFirstLiteral = (segs) => {\n for (const seg of segs) {\n if (seg.type === 'literal')\n return seg.value;\n if (seg.type === 'optional') {\n const nested = findFirstLiteral(seg.segments);\n if (nested)\n return nested;\n }\n }\n return null;\n };\n const firstLiteral = findFirstLiteral(nextSegment.segments);\n if (firstLiteral) {\n const literalIndex = path.lastIndexOf(firstLiteral);\n if (literalIndex !== -1 && literalIndex >= startIndex) {\n endIndex = literalIndex;\n }\n }\n break;\n }\n }\n // Don't go past query parameters\n const queryIndex = path.indexOf('?', startIndex);\n if (queryIndex !== -1 && queryIndex < endIndex) {\n endIndex = queryIndex;\n }\n let value;\n try {\n value = decodeURIComponent(path.slice(startIndex, endIndex));\n }\n catch (e) {\n // If decoding fails, use the original value\n value = path.slice(startIndex, endIndex);\n }\n return {\n params: { [segment.name]: value },\n nextIndex: endIndex\n };\n }\n case 'optional': {\n // Try to match the optional segment first, with backtracking if needed\n let tempIndex = startIndex;\n let params = {};\n let allMatched = true;\n for (let i = 0; i < segment.segments.length; i++) {\n const innerSegment = segment.segments[i];\n const remainingInner = segment.segments.slice(i + 1);\n const innerResult = this.matchSegment(path, tempIndex, innerSegment, remainingInner);\n if (innerResult === false) {\n allMatched = false;\n break;\n }\n Object.assign(params, innerResult.params);\n tempIndex = innerResult.nextIndex;\n }\n if (allMatched) {\n // Check if the rest of the segments can still be matched\n const canMatchRemaining = this.canMatchRemainingSegments(path, tempIndex, remainingSegments);\n if (canMatchRemaining) {\n return {\n params,\n nextIndex: tempIndex\n };\n }\n }\n // Optional segment either didn't match or would prevent remaining segments from matching\n // So skip it and return to original position\n return { params: {}, nextIndex: startIndex };\n }\n default:\n return false;\n }\n }\n findNextLiteral(segments) {\n for (const segment of segments) {\n if (segment.type === 'literal') {\n return segment;\n }\n else if (segment.type === 'optional') {\n const nested = this.findNextLiteral(segment.segments);\n if (nested)\n return nested;\n }\n }\n return null;\n }\n matchQuery(query, segments) {\n if (segments.length === 0) {\n return {};\n }\n const result = {};\n let queryIndex = 0;\n for (const segment of segments) {\n switch (segment.type) {\n case 'literal':\n if (query.slice(queryIndex, queryIndex + segment.value.length) === segment.value) {\n queryIndex += segment.value.length;\n }\n else {\n return false;\n }\n break;\n case 'param': {\n let endIndex = queryIndex;\n while (endIndex < query.length && query[endIndex] !== '&') {\n endIndex++;\n }\n if (endIndex === queryIndex)\n return false;\n let value;\n try {\n value = decodeURIComponent(query.slice(queryIndex, endIndex));\n }\n catch (e) {\n // If decoding fails, use the original value\n value = query.slice(queryIndex, endIndex);\n }\n result[segment.name] = value;\n queryIndex = endIndex;\n break;\n }\n }\n }\n return result;\n }\n reverse(params = {}) {\n const pathResult = this.reverseSegments(this.parsed.pathSegments, params);\n if (pathResult === false) {\n return false;\n }\n let result = pathResult;\n if (this.parsed.querySegments.length > 0) {\n const queryResult = this.reverseSegments(this.parsed.querySegments, params);\n if (!this.parsed.queryOptional) {\n // Query is required - if it fails, the whole reverse fails\n if (queryResult === false) {\n return false;\n }\n }\n // Add query string if we have a result\n if (queryResult && queryResult !== '') {\n result += '?' + queryResult;\n }\n }\n return result;\n }\n reverseSegments(segments, params, inActivatedStructure = false) {\n let result = '';\n for (let i = 0; i < segments.length; i++) {\n const segment = segments[i];\n const remainingSegments = segments.slice(i + 1);\n switch (segment.type) {\n case 'literal':\n result += segment.value;\n break;\n case 'param':\n case 'splat':\n if (segment.name in params) {\n result += String(params[segment.name]);\n }\n else {\n // Missing required parameter - but for query segments, this might be optional\n return false;\n }\n break;\n case 'optional':\n // Check if this optional group should be included\n // considering dependencies from later optional groups\n const shouldInclude = this.hasAllParams(segment.segments, params, inActivatedStructure) ||\n this.hasLaterOptionalGroupNeedingParams(remainingSegments, params, segment.segments);\n if (shouldInclude) {\n const optionalResult = this.reverseSegments(segment.segments, params, true);\n if (optionalResult === false) {\n return false;\n }\n result += optionalResult;\n }\n break;\n }\n }\n return result;\n }\n // Check if any later optional groups need parameters and would require this group to be included\n hasLaterOptionalGroupNeedingParams(laterSegments, params, currentOptionalSegments) {\n // Check if any later optional group has parameters that are provided\n for (const segment of laterSegments) {\n if (segment.type === 'optional') {\n if (this.hasAnyParamInSegments(segment.segments, params)) {\n // Check if the current optional group only has literals/no required params\n // If so, it should be included as a bridge to the later group\n return this.hasOnlyLiteralsAndOptionals(currentOptionalSegments);\n }\n }\n }\n return false;\n }\n hasOnlyLiteralsAndOptionals(segments) {\n for (const segment of segments) {\n if (segment.type === 'param' || segment.type === 'splat') {\n return false;\n }\n }\n return true;\n }\n hasAllParams(segments, params, inActivatedStructure = false) {\n // Check if we can include this optional group\n let hasDirectParams = false;\n let hasNestedParams = false;\n let missingDirectParam = false;\n let hasOnlyLiteralsAndOptionals = true;\n // First pass: check direct params and literals\n for (const segment of segments) {\n switch (segment.type) {\n case 'param':\n case 'splat':\n hasOnlyLiteralsAndOptionals = false;\n if (segment.name in params && params[segment.name] !== undefined) {\n hasDirectParams = true;\n }\n else {\n missingDirectParam = true;\n }\n break;\n }\n }\n // Determine if this level will be activated and propagate to nested\n const willBeActivated = (hasDirectParams && !missingDirectParam);\n const passToNested = inActivatedStructure || willBeActivated;\n // Second pass: check nested optional groups with correct context\n for (const segment of segments) {\n if (segment.type === 'optional') {\n const shouldIncludeNested = this.hasAllParams(segment.segments, params, passToNested);\n if (shouldIncludeNested) {\n hasNestedParams = true;\n }\n }\n }\n // Include this optional group if:\n // 1. We have all direct parameters needed, OR\n // 2. We have nested parameters and no missing direct parameters, OR\n // 3. We have only literals/optionals and parent was activated\n if (hasDirectParams && !missingDirectParam) {\n return true; // We have all required params for this level\n }\n if (hasNestedParams && !missingDirectParam) {\n return true; // We need this group to reach nested parameters\n }\n // Include literal-only groups in nested structures\n if (hasOnlyLiteralsAndOptionals && inActivatedStructure) {\n return true; // Include literal paths in activated structures\n }\n return false;\n }\n hasOnlyOptionalMissingParams(segments, params) {\n // Check if all missing parameters are in nested optional groups\n for (const segment of segments) {\n switch (segment.type) {\n case 'param':\n case 'splat':\n if (!(segment.name in params)) {\n return false; // Has required missing param\n }\n break;\n }\n }\n return true;\n }\n hasAnyParamInSegments(segments, params) {\n for (const segment of segments) {\n switch (segment.type) {\n case 'param':\n case 'splat':\n if (segment.name in params) {\n return true;\n }\n break;\n case 'optional':\n if (this.hasAnyParamInSegments(segment.segments, params)) {\n return true;\n }\n break;\n }\n }\n return false;\n }\n}\n\nexport { Route, Route as default };\n//# sourceMappingURL=index.esm.js.map\n","/**\n * Score a route pattern by specificity so that more specific routes are tried\n * first. Scoring is per-segment by ROLE, not by string length: a static segment\n * outweighs a dynamic (`:param`) segment, which outweighs a wildcard (`*` /\n * `*name`). So `/post/new` beats `/post/:id`, and a splat always ranks last —\n * regardless of how long the pattern string happens to be. This mirrors the\n * segment-scoring model mainstream routers (React Router, Remix) use.\n *\n * Sort callers descending by this score (highest = most specific = first).\n *\n * NOTE: mirrored in `src/react/route-specificity.ts` for the isolated React\n * bundle — keep the two in sync.\n */\nconst STATIC_SEGMENT = 10;\nconst DYNAMIC_SEGMENT = 3;\nconst WILDCARD_SEGMENT = -2;\n\nexport function routeSpecificity(spec: string): number {\n const segments = spec.split('/').filter(Boolean);\n // Base on segment count so a deeper path outranks a shallower one on ties.\n let score = segments.length;\n\n for (const segment of segments) {\n if (segment.startsWith('*')) {\n score += WILDCARD_SEGMENT;\n } else if (segment.startsWith(':')) {\n score += DYNAMIC_SEGMENT;\n } else {\n score += STATIC_SEGMENT;\n }\n }\n\n return score;\n}\n","/**\n * Generic transition system for animating between elements\n */\n\nimport { Transition, TransitionMode } from './types/transition';\n\n// Re-export Transition type + TransitionMode enum for external consumers\nexport type { Transition };\nexport { TransitionMode };\n\n\n/**\n * Parse CSS property string into an object\n */\nexport function parseStyles(styleString: string): Record<string, string> {\n const styles: Record<string, string> = {};\n styleString.split(';').forEach(rule => {\n const idx = rule.indexOf(':');\n if (idx === -1) return;\n const prop = rule.slice(0, idx).trim();\n const value = rule.slice(idx + 1).trim();\n if (prop && value) {\n styles[prop] = value;\n }\n });\n return styles;\n}\n\n/**\n * Perform a transition between two elements\n */\n\nfunction applyBaseTransitionStyles(el: HTMLElement, isSlotted: boolean, duration: number, prop: string) {\n el.style.position = 'absolute';\n el.style.width = '100%';\n\n if (isSlotted) {\n el.style.height = '100%';\n el.style.transition = `opacity ${duration}ms ease-in-out`;\n return;\n }\n\n el.style.top = '0';\n el.style.left = '0';\n el.style.transition = `${prop} ${duration}ms ease-in-out`;\n}\n\nfunction resetTransitionStyles(el: HTMLElement, isSlotted: boolean) {\n el.style.position = '';\n el.style.width = '';\n el.style.transition = '';\n\n if (isSlotted) {\n el.style.height = '';\n return;\n }\n\n el.style.top = '';\n el.style.left = '';\n}\n\nexport async function performTransition(\n container: Element,\n oldElement: HTMLElement,\n newElement: HTMLElement,\n transition: Transition = {},\n /**\n * Called at each async boundary — if it returns true, this transition has\n * been superseded by a newer navigation. We abort cleanup so we don't tear\n * down elements now owned by the newer transition.\n */\n isStale: () => boolean = () => false,\n): Promise<void> {\n const outDuration = transition.outDuration ?? 300;\n const inDuration = transition.inDuration ?? 300;\n const mode = (transition.mode || 'sequential') as TransitionMode;\n\n const outStyles = transition.out ? parseStyles(transition.out) : { opacity: '0' };\n const inStartStyles = { opacity: '0' };\n const inEndStyles = transition.in ? parseStyles(transition.in) : { opacity: '1' };\n\n const containerStyle = (container as HTMLElement).style;\n const isLayoutElement = container.tagName.includes('-') && container.shadowRoot;\n\n // Track the position we were ORIGINALLY given, not what a concurrent\n // transition may have already written. The first transition to touch this\n // container wins; subsequent overlapping transitions reuse the same value\n // and the last one to finish restores it.\n const POS_KEY = Symbol.for('snice:transition-original-position');\n const POS_COUNT = Symbol.for('snice:transition-count');\n const c = container as any;\n if (!isLayoutElement) {\n if (!(POS_KEY in c)) {\n c[POS_KEY] = containerStyle.position;\n c[POS_COUNT] = 0;\n }\n c[POS_COUNT]++;\n containerStyle.position = 'relative';\n }\n\n const restorePosition = () => {\n if (isLayoutElement) return;\n c[POS_COUNT]--;\n if (c[POS_COUNT] <= 0) {\n containerStyle.position = c[POS_KEY];\n delete c[POS_KEY];\n delete c[POS_COUNT];\n }\n };\n\n const isSlotted = oldElement.hasAttribute('slot') || newElement.hasAttribute('slot');\n\n applyBaseTransitionStyles(oldElement, isSlotted, outDuration, 'all');\n applyBaseTransitionStyles(newElement, isSlotted, inDuration, 'all');\n Object.assign(newElement.style, inStartStyles);\n\n container.appendChild(newElement);\n void newElement.offsetHeight;\n\n // Animate\n switch (mode) {\n case TransitionMode.SIMULTANEOUS:\n Object.assign(oldElement.style, outStyles);\n Object.assign(newElement.style, inEndStyles);\n await new Promise(resolve => setTimeout(resolve, Math.max(outDuration, inDuration)));\n break;\n\n case TransitionMode.SEQUENTIAL:\n Object.assign(oldElement.style, outStyles);\n await new Promise(resolve => setTimeout(resolve, outDuration));\n if (isStale()) {\n if (newElement.parentNode === container) newElement.remove();\n restorePosition();\n return;\n }\n Object.assign(newElement.style, inEndStyles);\n await new Promise(resolve => setTimeout(resolve, inDuration));\n break;\n }\n\n if (isStale()) {\n // A newer navigation took over while we were animating. Don't touch\n // oldElement (the newer transition owns it now) and remove OUR newElement\n // since the newer transition appended its own.\n if (newElement.parentNode === container) newElement.remove();\n restorePosition();\n return;\n }\n\n // Cleanup\n oldElement.remove();\n resetTransitionStyles(newElement, isSlotted);\n\n Object.keys({...inStartStyles, ...inEndStyles}).forEach(prop => {\n newElement.style[prop as any] = '';\n });\n\n restorePosition();\n}\n\n/**\n * Predefined transitions\n */\n\n// Fade transition\nexport const fadeTransition: Transition = {\n name: 'fade',\n outDuration: 200,\n inDuration: 200,\n out: 'opacity: 0',\n in: 'opacity: 1',\n mode: 'simultaneous'\n};\n\n// Slide transition (from left)\nexport const slideTransition: Transition = {\n name: 'slide',\n outDuration: 300,\n inDuration: 300,\n out: 'transform: translateX(-100%)',\n in: 'transform: translateX(0)',\n mode: 'sequential'\n};\n\n// Slide from right\nexport const slideRightTransition: Transition = {\n name: 'slide-right',\n outDuration: 300,\n inDuration: 300,\n out: 'transform: translateX(100%)',\n in: 'transform: translateX(0)',\n mode: 'sequential'\n};\n\n// Slide from top\nexport const slideUpTransition: Transition = {\n name: 'slide-up',\n outDuration: 300,\n inDuration: 300,\n out: 'transform: translateY(-100%)',\n in: 'transform: translateY(0)',\n mode: 'sequential'\n};\n\n// Slide from bottom\nexport const slideDownTransition: Transition = {\n name: 'slide-down',\n outDuration: 300,\n inDuration: 300,\n out: 'transform: translateY(100%)',\n in: 'transform: translateY(0)',\n mode: 'sequential'\n};\n\n// Scale transition\nexport const scaleTransition: Transition = {\n name: 'scale',\n outDuration: 250,\n inDuration: 250,\n out: 'transform: scale(0.9); opacity: 0',\n in: 'transform: scale(1); opacity: 1',\n mode: 'simultaneous'\n};\n\n// Rotate transition\nexport const rotateTransition: Transition = {\n name: 'rotate',\n outDuration: 400,\n inDuration: 400,\n out: 'transform: rotate(180deg) scale(0.5); opacity: 0',\n in: 'transform: rotate(0) scale(1); opacity: 1',\n mode: 'simultaneous'\n};\n\n// Flip transition\nexport const flipTransition: Transition = {\n name: 'flip',\n outDuration: 400,\n inDuration: 400,\n out: 'transform: rotateY(180deg); opacity: 0',\n in: 'transform: rotateY(0); opacity: 1',\n mode: 'sequential'\n};\n\n// Zoom transition\nexport const zoomTransition: Transition = {\n name: 'zoom',\n outDuration: 300,\n inDuration: 300,\n out: 'transform: scale(2); opacity: 0',\n in: 'transform: scale(1); opacity: 1',\n mode: 'simultaneous'\n};\n\n// None transition (instant swap)\nexport const noneTransition: Transition = {\n name: 'none',\n outDuration: 0,\n inDuration: 0,\n out: '',\n in: '',\n mode: 'simultaneous'\n};\n","import { clearDispatchTimers } from './events';\nimport { cleanupEventHandlers, setupEventHandlers } from './on';\nimport { cleanupResponseHandlers, setupResponseHandlers } from './request-response';\nimport { IS_DAEMON_CLASS } from './symbols';\nimport { daemonState, isDaemonInstance } from './daemon-target';\n\n/**\n * Marks an ordinary class as a Snice daemon.\n *\n * The decorator never constructs or globally registers the class. Application\n * code owns every instance and exposes selected instances through an explicit\n * app context.\n */\nexport function daemon<T extends abstract new (...args: any[]) => object>(\n constructor: T,\n _context: ClassDecoratorContext<T>,\n): void {\n Object.defineProperty(constructor.prototype, IS_DAEMON_CLASS, {\n value: true,\n configurable: true,\n });\n}\n\n/** @internal Activates framework-managed communication for a provided daemon. */\nexport function bindDaemon(instance: object): () => void {\n if (!isDaemonInstance(instance)) {\n throw new TypeError('Application contexts may provide only instances of @daemon classes.');\n }\n\n const state = daemonState(instance);\n if (state.bindings === 0) {\n state.active = true;\n try {\n setupEventHandlers(instance, state.target);\n setupResponseHandlers(instance, state.target);\n } catch (error) {\n cleanupResponseHandlers(instance);\n cleanupEventHandlers(instance);\n state.active = false;\n throw error;\n }\n }\n state.bindings += 1;\n\n let released = false;\n return () => {\n if (released) return;\n released = true;\n\n state.bindings = Math.max(0, state.bindings - 1);\n if (state.bindings !== 0) return;\n\n cleanupResponseHandlers(instance);\n cleanupEventHandlers(instance);\n clearDispatchTimers(instance);\n state.active = false;\n\n // Consumers may still hold cleanup records for the old target until their\n // elements disconnect. Rotate the target so released contexts are inert\n // immediately and a later provision starts from a clean event surface.\n state.target = new EventTarget();\n };\n}\n","import { bindDaemon } from './daemon';\nimport { installContextProvider, getContext } from './context-provider';\nimport type { AppContext } from './types/app-context';\n\nfunction bindContextDaemons(context: AppContext): () => void {\n const daemonMap = context.daemons;\n if (daemonMap === undefined) return () => {};\n if (!daemonMap || typeof daemonMap !== 'object' || Array.isArray(daemonMap)) {\n throw new TypeError('AppContext.daemons must be a readonly record of named @daemon instances.');\n }\n\n const releases: Array<() => void> = [];\n const bound = new Set<object>();\n try {\n for (const [name, instance] of Object.entries(daemonMap)) {\n if (!name.trim()) {\n throw new TypeError('AppContext.daemons keys must be non-empty strings.');\n }\n if (!instance || typeof instance !== 'object') {\n throw new TypeError(`AppContext.daemons[\"${name}\"] must be an instance of an @daemon class.`);\n }\n if (bound.has(instance)) continue;\n bound.add(instance);\n releases.push(bindDaemon(instance));\n }\n } catch (error) {\n for (const release of releases.reverse()) release();\n throw error;\n }\n\n return () => {\n for (const release of releases.reverse()) release();\n };\n}\n\n/**\n * Makes one explicit application context visible beneath a root.\n *\n * Daemon instances must already exist in context.daemons. The returned cleanup\n * removes the provider and deactivates framework communication for daemons no\n * longer provided by any context.\n */\nexport function provideContext(root: EventTarget, context: AppContext): () => void {\n const releaseProvider = installContextProvider(root, context);\n let releaseDaemons: (() => void) | undefined;\n try {\n releaseDaemons = bindContextDaemons(context);\n } catch (error) {\n releaseProvider();\n throw error;\n }\n\n let released = false;\n return () => {\n if (released) return;\n released = true;\n releaseProvider();\n releaseDaemons?.();\n };\n}\n\nexport { getContext };\n","import { Route } from 'pica-route';\nimport { routeSpecificity } from './route-specificity';\nimport { applyElementFunctionality } from './element';\nimport { ROUTER_CONTEXT, PAGE_TRANSITION, CREATED_AT, PROPERTIES, CONTEXT_HANDLER, CONTEXT_UPDATE } from './symbols';\nimport { performTransition as performTransitionUtil } from './transitions';\nimport { Transition } from './types/transition';\nimport { RouterOptions } from './types/router-options';\nimport { PageOptions } from './types/page-options';\nimport { Guard } from './types/guard';\nimport { RouteParams } from 'pica-route';\nimport { RouterInstance } from './types/router-instance';\nimport { Placard } from './types/placard';\nimport { AppContext } from './types/app-context';\nimport { Context } from './types/context';\nimport { provideContext } from './app-context';\nimport { hasContextProvider } from './context-provider';\n\n// Router historically allows a later Router instance to take over the same\n// target. Track only Router-owned provider releases so that handoff remains\n// explicit without weakening duplicate protection for public provideContext().\nconst routerContextProviders = new WeakMap<EventTarget, () => void>();\n\n\n/**\n * Possible outcomes from route resolution\n */\nenum RouteResult {\n SUCCESS = 'success',\n GUARDS_FAILED = 'guards-failed',\n NOT_FOUND = 'not-found'\n}\n\n\n/**\n * Creates a new router instance.\n * @param {RouterOptions} options - The router configuration options.\n * @returns An object containing the router's API methods.\n */\nexport function Router(options: RouterOptions): RouterInstance {\n const win = options.window ?? window;\n const doc = options.document ?? document;\n const routes: {\n route: Route;\n tag: string;\n transition?: Transition;\n guards?: Guard<any> | Guard<any>[];\n layout?: string | false;\n placard?: Placard | ((context: AppContext) => Placard);\n order: number;\n registrationOrder: number;\n }[] = [];\n let nextRegistrationOrder = 0;\n let is_sorted = false;\n let placards: Placard[] = []; // Store collected placards\n\n let _404: string; // the 404 page\n let _403: string; // the 403 forbidden page\n let home: string; // the home page\n let currentLayoutName: string | null = null; // Track current layout name\n let currentLayoutTimestamp: number | null = null; // Track current layout timestamp\n const context = options.context || {}; // Store context for guards\n let contextProviderRoot: EventTarget | null = null;\n let releaseContextProvider: (() => void) | null = null;\n\n // Create Context instance for managing router state\n const navigationContext = new Context(context, [], '', {}, options.fetcher);\n\n function ensureContextProvider(target: Element): void {\n if (\n contextProviderRoot === target\n && releaseContextProvider\n && routerContextProviders.get(target) === releaseContextProvider\n ) return;\n\n releaseContextProvider?.();\n routerContextProviders.get(target)?.();\n\n const releaseProvidedContext = provideContext(target, context as AppContext);\n let released = false;\n const release = () => {\n if (released) return;\n released = true;\n releaseProvidedContext();\n if (routerContextProviders.get(target) === release) {\n routerContextProviders.delete(target);\n }\n };\n\n releaseContextProvider = release;\n contextProviderRoot = target;\n routerContextProviders.set(target, release);\n }\n\n function getCurrentLayoutElement(target: Element): HTMLElement | null {\n const noCurrentLayout = !currentLayoutName || !currentLayoutTimestamp;\n if (noCurrentLayout) {\n return null;\n }\n \n const layoutElements = target.querySelectorAll(currentLayoutName!) as NodeListOf<HTMLElement>;\n \n for (const element of layoutElements) {\n const hasTimestamp = (element as any)[CREATED_AT] === currentLayoutTimestamp;\n if (hasTimestamp) {\n return element;\n }\n }\n \n return null;\n }\n\n /**\n * Decorator function for defining a page with associated routes.\n * @param {PageOptions} pageOptions - The page configuration options.\n * @returns A decorator function to apply to a custom element class.\n */\n function page(pageOptions: PageOptions) {\n return function <C extends { new(...args: any[]): HTMLElement }>(constructor: C, context: ClassDecoratorContext) {\n // Transfer metadata from context to constructor (for new decorators)\n if (context?.metadata && (context.metadata as any)[PROPERTIES]) {\n if (!(constructor as any)[PROPERTIES]) {\n (constructor as any)[PROPERTIES] = new Map();\n }\n for (const [key, value] of (context.metadata as any)[PROPERTIES]) {\n (constructor as any)[PROPERTIES].set(key, value);\n }\n }\n\n // Apply all element functionality (properties, queries, watchers, controllers, etc.)\n applyElementFunctionality(constructor);\n \n // Store transition config on constructor for later use\n (constructor as any)[PAGE_TRANSITION] = pageOptions.transition;\n \n // Extend the connectedCallback to add router-specific functionality\n const elementConnectedCallback = constructor.prototype.connectedCallback;\n constructor.prototype.connectedCallback = function() {\n // Store the Context instance for @context decorated methods to access\n (this as any)[CONTEXT_HANDLER] = navigationContext;\n\n // Call the element's connectedCallback first\n elementConnectedCallback?.call(this);\n };\n \n // Extend the disconnectedCallback to clean up router-specific stuff\n const elementDisconnectedCallback = constructor.prototype.disconnectedCallback;\n constructor.prototype.disconnectedCallback = function() {\n // Call element's disconnectedCallback first\n elementDisconnectedCallback?.call(this);\n\n // Clean up context references\n delete (this as any)[ROUTER_CONTEXT];\n delete (this as any)[CONTEXT_HANDLER];\n };\n \n // Define the custom element (skip if already registered)\n if (!win.customElements.get(pageOptions.tag)) {\n win.customElements.define(pageOptions.tag, constructor);\n }\n\n // Register the routes with guards, layout, and placard\n pageOptions.routes.forEach(route => {\n const path = typeof route === 'string' ? route : route.path;\n const order = typeof route === 'string' ? undefined : route.order;\n register(path, pageOptions.tag, pageOptions.transition, pageOptions.guards, pageOptions.layout, pageOptions.placard, order);\n });\n\n return constructor;\n }\n }\n\n /**\n * Registers a new route with the router.\n * @param {string} route - The route path.\n * @param {string} tag - The custom element tag associated with the route.\n * @param {number} order - Optional lower-first tie-break after specificity.\n * @example\n * register('/custom-route', 'custom-element');\n */\n function register(\n route: string,\n tag: string,\n transition?: Transition,\n guards?: Guard<any> | Guard<any>[],\n layout?: string | false,\n placard?: Placard | ((context: AppContext) => Placard),\n order = 0\n ): void {\n if (!Number.isFinite(order)) {\n throw new TypeError(`Route order for \"${route}\" must be a finite number.`);\n }\n routes.push({\n route: new Route(route),\n tag,\n transition,\n guards,\n layout,\n placard,\n order,\n registrationOrder: nextRegistrationOrder++\n });\n is_sorted = false;\n\n switch (route) {\n case '/404': _404 = tag; break;\n case '/403': _403 = tag; break;\n case '/': home = tag; break;\n }\n }\n\n function setupEventListeners(): void {\n const handler = () => {\n const target = doc.querySelector(options.target);\n if (!target) return;\n\n // A later Router can explicitly take over the same live root. The old\n // history listener remains installed for backward compatibility, but it\n // must no longer navigate or replace the new owner's app context.\n if (\n contextProviderRoot === target\n && releaseContextProvider\n && routerContextProviders.get(target) !== releaseContextProvider\n ) return;\n\n // Router has no public disposal API and historically leaves its history\n // listener installed. Tests and app shells may replace a target with a\n // new element using the same selector, then initialize a new Router. In\n // that case the old listener must yield to the provider already owning\n // the replacement root instead of stealing it on the next hashchange.\n if (contextProviderRoot !== target && hasContextProvider(target)) {\n releaseContextProvider?.();\n releaseContextProvider = null;\n contextProviderRoot = null;\n return;\n }\n renderPath(getPath());\n };\n\n switch (options.type) {\n case 'hash':\n win.addEventListener('hashchange', handler);\n break;\n case 'pushstate':\n win.addEventListener('popstate', handler);\n break;\n }\n }\n\n /**\n * Initializes the router and sets up navigation event listeners.\n * @example\n * initialize();\n */\n function initialize(): void {\n const target = doc.querySelector(options.target);\n if (!target) {\n throw new Error(`Target element not found: ${options.target}`);\n }\n ensureContextProvider(target);\n\n const needsSorting = !is_sorted;\n if (needsSorting) {\n routes.sort((a, b) =>\n routeSpecificity(b.route.spec) - routeSpecificity(a.route.spec)\n || a.order - b.order\n || a.registrationOrder - b.registrationOrder\n );\n is_sorted = true;\n }\n\n // Collect placards from registered routes\n collectPlacards();\n\n setupEventListeners();\n\n const path = getPath();\n renderPath(path);\n }\n\n function collectPlacards(): void {\n const seen = new Set<string>();\n placards = routes\n .filter(route => route.placard)\n .map(route => {\n const placard = route.placard!;\n return typeof placard === 'function'\n ? placard(context as AppContext)\n : placard;\n })\n .filter(p => {\n if (seen.has(p.name)) return false;\n seen.add(p.name);\n return true;\n });\n }\n\n // Symbol for storing the navigation context on page elements\n const ROUTER_CONTEXT_SYMBOL = Symbol.for('router-context');\n\n function emitContextUpdate(target: Element, currentPath: string, routeParams: RouteParams): void {\n // Update the navigation context and notify all registered elements\n (navigationContext[CONTEXT_UPDATE] as Function)(context, placards, currentPath, routeParams);\n }\n\n function updateLayout(layoutElement: HTMLElement, currentPath: string, routeParams: RouteParams): void {\n // Check if layout implements the update method\n if (typeof (layoutElement as any).update === 'function') {\n (layoutElement as any).update(context, placards, currentPath, routeParams);\n }\n }\n \n function getPath(): string {\n switch (options.type) {\n case 'hash':\n return win.location.hash.slice(1);\n case 'pushstate':\n return `${win.location.pathname}${win.location.search}`;\n }\n }\n\n function normalizePath(path: string): string {\n const withoutHash = path.trim().replace(/^#/, '');\n if (!withoutHash) return '/';\n return withoutHash.startsWith('/') ? withoutHash : `/${withoutHash}`;\n }\n\n function recordNavigation(path: string): void {\n switch (options.type) {\n case 'hash': {\n const hash = `#${path}`;\n if (win.location.hash !== hash) win.history.pushState(null, '', hash);\n break;\n }\n case 'pushstate': {\n const current = `${win.location.pathname}${win.location.search}`;\n if (current !== path) win.history.pushState(null, '', path);\n break;\n }\n }\n }\n \n function renderForbiddenPage(target: Element): void {\n let newPageElement: HTMLElement;\n\n if (_403) {\n newPageElement = doc.createElement(_403);\n (newPageElement as any)[ROUTER_CONTEXT] = context;\n } else {\n const div = doc.createElement('div');\n div.className = 'default-403';\n div.innerHTML = /*html*/`<h1>403</h1><p>Unauthorized</p>`;\n newPageElement = div;\n }\n\n target.innerHTML = '';\n target.appendChild(newPageElement);\n currentLayoutName = null;\n currentLayoutTimestamp = null;\n }\n\n function createLoadingSpinner(): HTMLElement {\n const container = doc.createElement('div');\n container.setAttribute('data-snice-loading', '');\n container.innerHTML = /*html*/`\n <style>@keyframes snice-spin{to{transform:rotate(360deg)}}</style>\n <div style=\"display:flex;align-items:center;justify-content:center;height:100%;min-height:200px\">\n <div style=\"width:32px;height:32px;border:3px solid rgba(128,128,128,0.3);border-top-color:rgba(128,128,128,0.8);border-radius:50%;animation:snice-spin 0.6s linear infinite\"></div>\n </div>`;\n return container;\n }\n\n async function checkGuards(guards: Guard<any> | Guard<any>[] | undefined, params: RouteParams, target: Element, stale?: () => boolean): Promise<boolean> {\n const hasGuards = !!guards;\n if (!hasGuards) {\n return true;\n }\n\n const guardsArray = Array.isArray(guards) ? guards : [guards];\n let spinner: HTMLElement | null = null;\n let spinnerTimer: ReturnType<typeof setTimeout> | null = null;\n\n // Show spinner after a short delay (avoids flash for fast sync guards).\n // Skip if a newer navigation has already superseded this one.\n spinnerTimer = setTimeout(() => {\n if (stale && stale()) return;\n spinner = createLoadingSpinner();\n target.appendChild(spinner);\n }, 50);\n\n try {\n for (const guard of guardsArray) {\n const allowed = await guard(context, params);\n if (!allowed) {\n // Don't stomp the current page with a 403 if a newer navigation\n // already took over while this guard was resolving.\n if (!stale || !stale()) {\n renderForbiddenPage(target);\n }\n return false;\n }\n }\n return true;\n } finally {\n if (spinnerTimer) clearTimeout(spinnerTimer);\n // @ts-ignore — TS narrows spinner to never because it can't track setTimeout mutations\n if (spinner) spinner.remove();\n }\n }\n\n function createHomeElement(): { element: HTMLElement; transition?: Transition; layout?: string | false } {\n const newPageElement = doc.createElement(home);\n (newPageElement as any)[ROUTER_CONTEXT] = context;\n const constructor = win.customElements.get(home);\n const transition = (constructor as any)?.[PAGE_TRANSITION];\n \n const homeRoute = routes.find(r => r.route.match('/'));\n return { element: newPageElement, transition, layout: homeRoute?.layout };\n }\n\n function create404Element(): { element: HTMLElement; transition?: Transition; layout?: string | false } {\n const has404Page = !!_404;\n \n if (has404Page) {\n const newPageElement = doc.createElement(_404);\n (newPageElement as any)[ROUTER_CONTEXT] = context;\n const constructor = win.customElements.get(_404);\n const transition = (constructor as any)?.[PAGE_TRANSITION];\n return { element: newPageElement, transition, layout: undefined };\n }\n \n const div = doc.createElement('div');\n div.className = 'default-404';\n div.innerHTML = /*html*/`<h1>404</h1><p>Page not found</p>`;\n return { element: div, transition: undefined, layout: undefined };\n }\n\n async function resolveRoute(path: string, target: Element, stale?: () => boolean): Promise<{ result: RouteResult; element?: HTMLElement; transition?: Transition; layout?: string | false; routeParams?: RouteParams }> {\n for (const route of routes) {\n const params = route.route.match(path);\n const isMatch = params !== false;\n if (!isMatch) {\n continue;\n }\n\n const guardsAllowed = await checkGuards(route.guards, params as RouteParams, target, stale);\n if (!guardsAllowed) {\n return { result: RouteResult.GUARDS_FAILED };\n }\n\n const newPageElement = doc.createElement(route.tag);\n (newPageElement as any)[ROUTER_CONTEXT] = context;\n (newPageElement as any)[CONTEXT_HANDLER] = navigationContext;\n const routeParams = params as RouteParams;\n Object.keys(routeParams).forEach(key => newPageElement.setAttribute(key, routeParams[key]));\n\n return { result: RouteResult.SUCCESS, element: newPageElement, transition: route.transition, layout: route.layout, routeParams };\n }\n\n return { result: RouteResult.NOT_FOUND };\n }\n\n function determineLayout(pageLayout: string | false | undefined): string | null {\n const isExplicitlyNoLayout = pageLayout === false;\n if (isExplicitlyNoLayout) {\n return null;\n }\n \n const hasPageLayout = !!pageLayout;\n if (hasPageLayout) {\n return pageLayout;\n }\n \n const hasRouterLayout = !!options.layout;\n if (hasRouterLayout) {\n return options.layout!;\n }\n \n return null;\n }\n\n function setupLayout(layoutToUse: string | null): { element: HTMLElement | null; needsNewLayout: boolean } {\n const needsNewLayout = layoutToUse !== currentLayoutName;\n if (!needsNewLayout) {\n return { element: null, needsNewLayout: false };\n }\n \n currentLayoutName = layoutToUse;\n \n const shouldCreateLayout = !!layoutToUse;\n if (shouldCreateLayout) {\n const timestamp = Date.now();\n currentLayoutTimestamp = timestamp;\n \n const layoutElement = doc.createElement(layoutToUse);\n (layoutElement as any)[ROUTER_CONTEXT] = context;\n (layoutElement as any)[CREATED_AT] = timestamp;\n \n return { element: layoutElement, needsNewLayout: true };\n }\n \n currentLayoutTimestamp = null;\n return { element: null, needsNewLayout: true };\n }\n\n async function renderWithLayout(target: Element, pageElement: HTMLElement, transition: Transition | undefined, layoutElement: HTMLElement | null, needsNewLayout: boolean, currentPath: string, routeParams: RouteParams, stale?: () => boolean): Promise<void> {\n const currentLayout = layoutElement || getCurrentLayoutElement(target);\n if (!currentLayout) {\n return;\n }\n\n // Update layout with current context and placards\n updateLayout(currentLayout, currentPath, routeParams);\n\n const oldPageInLayout = currentLayout.querySelector('[slot=\"page\"]') as HTMLElement | null;\n const shouldTransition = !!(transition && oldPageInLayout);\n\n if (shouldTransition) {\n pageElement.setAttribute('slot', 'page');\n await performTransition(currentLayout, oldPageInLayout!, pageElement, transition!);\n if (stale && stale()) return;\n if (needsNewLayout) {\n target.innerHTML = '';\n target.appendChild(currentLayout);\n }\n return;\n }\n\n // Guard before committing DOM changes.\n if (stale && stale()) return;\n\n const existingPages = currentLayout.querySelectorAll('[slot=\"page\"]');\n existingPages.forEach(page => page.remove());\n pageElement.setAttribute('slot', 'page');\n currentLayout.appendChild(pageElement);\n\n if (needsNewLayout) {\n target.innerHTML = '';\n target.appendChild(currentLayout);\n }\n }\n\n async function renderDirect(target: Element, pageElement: HTMLElement, transition: Transition | undefined, stale?: () => boolean): Promise<void> {\n const currentElementInTarget = target.children[0] as HTMLElement | null;\n const shouldTransition = !!(transition && currentElementInTarget);\n\n if (shouldTransition) {\n await performTransition(target, currentElementInTarget!, pageElement, transition!);\n return;\n }\n\n // Guard against superseded navigation before committing DOM.\n if (stale && stale()) return;\n target.innerHTML = '';\n target.appendChild(pageElement);\n }\n\n async function renderPage(target: Element, pageElement: HTMLElement, transition: Transition | undefined, layout: string | false | undefined, path: string, routeParams: RouteParams, stale?: () => boolean): Promise<void> {\n const layoutToUse = determineLayout(layout);\n const { element: layoutElement, needsNewLayout } = setupLayout(layoutToUse);\n const finalTransition = transition || options.transition;\n\n const hasLayout = layoutElement !== null || getCurrentLayoutElement(target) !== null;\n if (hasLayout) {\n await renderWithLayout(target, pageElement, finalTransition, layoutElement, needsNewLayout, path, routeParams, stale);\n if (stale && stale()) return;\n emitContextUpdate(target, path, routeParams);\n return;\n }\n\n await renderDirect(target, pageElement, finalTransition, stale);\n if (stale && stale()) return;\n emitContextUpdate(target, path, routeParams);\n }\n\n /**\n * Navigates to the specified path.\n * @param {string} path - The path to navigate to.\n * @example\n * navigate('/login');\n */\n let navGeneration = 0;\n async function renderPath(path: string): Promise<void> {\n const target = doc.querySelector(options.target);\n if (!target) {\n throw new Error(`Target element not found: ${options.target}`);\n }\n ensureContextProvider(target);\n\n const myGen = ++navGeneration;\n const stale = () => myGen !== navGeneration;\n\n collectPlacards();\n win.scrollTo(0, 0);\n\n // Home path\n const isHomePath = (path?.trim() === '' || path === '/') && !!home;\n if (isHomePath) {\n const homeRoute = routes.find(r => r.route.match('/'));\n if (!(await checkGuards(homeRoute?.guards, {}, target, stale))) return;\n if (stale()) return;\n const { element, transition, layout } = createHomeElement();\n await renderPage(target, element, transition, layout, path, {}, stale);\n return;\n }\n\n // No path\n if (!path) return;\n\n // Resolve route\n const routeResult = await resolveRoute(path, target, stale);\n if (stale()) return;\n\n // Guards failed (403 already rendered by checkGuards)\n if (routeResult.result === RouteResult.GUARDS_FAILED) return;\n\n // Route matched\n if (routeResult.result === RouteResult.SUCCESS) {\n const { element, transition, layout, routeParams = {} } = routeResult;\n await renderPage(target, element!, transition, layout, path, routeParams, stale);\n return;\n }\n\n // 404 fallthrough\n const { element, transition, layout } = create404Element();\n await renderPage(target, element, transition, layout, path, {}, stale);\n }\n\n async function navigate(path: string): Promise<void> {\n const normalizedPath = normalizePath(path);\n recordNavigation(normalizedPath);\n await renderPath(normalizedPath);\n }\n\n async function performTransition(\n container: Element,\n oldElement: HTMLElement,\n newElement: HTMLElement,\n transition: Transition,\n atGen: number = navGeneration\n ): Promise<void> {\n // `isStale` returns true when a newer navigate() has been kicked off.\n // The transition util checks this at each async boundary and bails so\n // we don't remove an element the newer transition now owns.\n const isStale = () => atGen !== navGeneration;\n return performTransitionUtil(container, oldElement, newElement, transition, isStale);\n }\n\n return {\n page,\n initialize,\n navigate,\n register\n };\n}\n","/**\n * createRequestHandler — vanilla JS utility for handling @request channels\n * outside of the Snice element/controller decorator system.\n *\n * Listens for @request CustomEvents on a target element (or document),\n * performs the discovery/data handshake, and dispatches to your route map.\n *\n * @example\n * ```js\n * import { createRequestHandler } from 'snice';\n *\n * const cleanup = createRequestHandler(document, {\n * 'fetch-user': async (payload) => {\n * const res = await fetch(`/api/users/${payload.id}`);\n * return res.json();\n * },\n * 'save-settings': async (payload) => {\n * await fetch('/api/settings', { method: 'POST', body: JSON.stringify(payload) });\n * return { ok: true };\n * }\n * });\n *\n * // Later, to remove all listeners:\n * cleanup();\n * ```\n */\n\nexport type RequestRoute = (payload: any) => any | Promise<any>;\nexport type RequestRouteMap = Record<string, RequestRoute>;\n\nexport interface CreateRequestHandlerOptions {\n /** If true, the handler will NOT stop propagation, allowing other handlers to also respond. Default: false */\n passive?: boolean;\n}\n\n/**\n * Attach request handlers to a DOM target.\n *\n * @param target The element or document to listen on. Events bubble, so an\n * ancestor element catches requests from any descendant.\n * @param routes Map of channel names to handler functions.\n * @param options Optional configuration.\n * @returns A cleanup function that removes all listeners.\n */\nexport function createRequestHandler(\n target: EventTarget,\n routes: RequestRouteMap,\n options?: CreateRequestHandlerOptions,\n): () => void {\n const cleanups: (() => void)[] = [];\n\n for (const [channelName, handler] of Object.entries(routes)) {\n const eventName = `@request/${channelName}`;\n\n const listener = (event: Event) => {\n const ce = event as CustomEvent;\n const { discovery, data, payload } = ce.detail;\n\n if (!options?.passive) {\n ce.preventDefault();\n ce.stopImmediatePropagation();\n ce.stopPropagation();\n }\n\n // Signal that we found the handler — clears discovery timeout\n discovery.resolve();\n\n // Execute the handler and wire up the data promise\n Promise.resolve()\n .then(() => handler(payload))\n .then((result: any) => data.resolve(result))\n .catch((error: any) => {\n data.reject(error);\n console.error(`createRequestHandler: error in \"${channelName}\" handler:`, error);\n });\n };\n\n target.addEventListener(eventName, listener);\n cleanups.push(() => target.removeEventListener(eventName, listener));\n }\n\n return () => {\n for (const fn of cleanups) fn();\n cleanups.length = 0;\n };\n}\n","/**\n * Template binding helpers for class and style attributes.\n *\n * @example\n * ```typescript\n * html`<div class=\"${classMap({ box: true, 'box--active': this.active })}\"></div>`\n * html`<div style=\"${styleMap({ color: this.color, fontWeight: 'bold' })}\"></div>`\n * ```\n */\n\n/**\n * Build a class string from an object: keys with truthy values are included.\n */\nexport function classMap(classes: Record<string, unknown>): string {\n let out = '';\n for (const name of Object.keys(classes)) {\n if (classes[name]) out += (out ? ' ' : '') + name;\n }\n return out;\n}\n\n/**\n * Build a style string from an object. camelCase keys convert to kebab-case;\n * CSS custom properties (`--token`) pass through unchanged. Entries whose\n * value is null/undefined/false are dropped.\n */\nexport function styleMap(styles: Record<string, unknown>): string {\n const decls: string[] = [];\n for (const key of Object.keys(styles)) {\n const value = styles[key];\n if (value === null || value === undefined || value === false) continue;\n const prop = key.startsWith('--')\n ? key\n : key.replace(/[A-Z]/g, (c) => '-' + c.toLowerCase());\n decls.push(`${prop}: ${value}`);\n }\n return decls.join('; ');\n}\n","/**\n * Custom element readiness utilities\n * Handles waiting for custom elements to be defined with timeout warnings\n */\n\n/**\n * Global flag to disable custom element readiness timeout warnings\n * Set this to true in environments where slow element registration is expected\n */\nexport let DISABLE_ELEMENT_READY_WARNINGS = false;\n\n/**\n * Set whether to disable custom element readiness timeout warnings\n */\nexport function setDisableElementReadyWarnings(value: boolean): void {\n DISABLE_ELEMENT_READY_WARNINGS = value;\n}\n\n/**\n * Default timeout for custom element registration warning (500ms)\n */\nconst DEFAULT_WARNING_TIMEOUT = 500;\n\n/**\n * Wait for a custom element to be defined\n * Logs a warning if it takes longer than the warning timeout\n *\n * @param tagName - The custom element tag name\n * @param warningTimeout - Time in ms before warning (default 500ms)\n * @returns Promise that resolves when element is defined\n */\nexport async function waitForElementDefined(\n tagName: string,\n warningTimeout = DEFAULT_WARNING_TIMEOUT\n): Promise<void> {\n // If already defined, return immediately\n if (customElements.get(tagName)) {\n return;\n }\n\n // Set up warning timer if not disabled\n let warningTimer: any = null;\n if (!DISABLE_ELEMENT_READY_WARNINGS) {\n warningTimer = setTimeout(() => {\n console.warn(\n `Custom element <${tagName}> is taking longer than ${warningTimeout}ms to register. ` +\n `This may indicate a missing import or circular dependency. ` +\n `Set DISABLE_ELEMENT_READY_WARNINGS=true to disable this warning.`\n );\n }, warningTimeout);\n }\n\n try {\n // Wait for element to be defined\n await customElements.whenDefined(tagName);\n } finally {\n // Clear warning timer\n if (warningTimer) {\n clearTimeout(warningTimer);\n }\n }\n}\n\n/**\n * Wait for a custom element to be defined and ready\n * First waits for the element to be registered, then waits for its ready promise\n *\n * @param element - The custom element instance\n * @param warningTimeout - Time in ms before warning about registration (default 500ms)\n * @returns Promise that resolves when element is defined and ready\n */\nexport async function waitForElementReady(\n element: HTMLElement,\n warningTimeout = DEFAULT_WARNING_TIMEOUT\n): Promise<void> {\n const tagName = element.tagName.toLowerCase();\n\n // Wait for element to be defined\n await waitForElementDefined(tagName, warningTimeout);\n\n // Wait for element's ready promise if it exists\n if ('ready' in element && typeof (element as any).ready?.then === 'function') {\n await (element as any).ready;\n }\n}\n\n/**\n * Process all custom elements in a node tree and wait for them to be ready\n * This is useful after inserting a template with custom elements\n *\n * @param node - The root node to scan for custom elements\n * @param warningTimeout - Time in ms before warning about registration (default 500ms)\n * @returns Promise that resolves when all custom elements are ready\n */\nexport async function waitForAllCustomElements(\n node: Node,\n warningTimeout = DEFAULT_WARNING_TIMEOUT\n): Promise<void> {\n const customElements: HTMLElement[] = [];\n\n // Find all custom elements (tag names with hyphens)\n if (node instanceof Element) {\n if (node.tagName.includes('-')) {\n customElements.push(node as HTMLElement);\n }\n\n // Also check in shadow DOM\n if (node.shadowRoot) {\n const shadowCustomElements = node.shadowRoot.querySelectorAll('*');\n shadowCustomElements.forEach(el => {\n if (el.tagName.includes('-')) {\n customElements.push(el as HTMLElement);\n }\n });\n }\n }\n\n // If it's a DocumentFragment, check all children\n if (node instanceof DocumentFragment) {\n const elements = node.querySelectorAll('*');\n elements.forEach(el => {\n if (el.tagName.includes('-')) {\n customElements.push(el as HTMLElement);\n }\n });\n }\n\n // Wait for all custom elements to be ready\n await Promise.all(\n customElements.map(el => waitForElementReady(el, warningTimeout))\n );\n}\n","/**\n * Render debugging utilities for Snice v3.0.0\n * For testing and debugging only - not recommended for production use\n */\n\nimport { RENDER_CALLBACKS } from './symbols';\n\n/**\n * Track renders of an element using an async generator\n * Each call to tracker.next() waits for the next render to complete\n *\n * @example\n * ```typescript\n * const tracker = trackRenders(element);\n *\n * element.someProp = 'new value';\n * await tracker.next(); // Waits for render\n * // DOM is now updated\n *\n * element.someProp = 'another value';\n * await tracker.next(); // Waits for next render\n * // DOM is updated again\n * ```\n *\n * WARNING: For testing/debugging only!\n * - Do not use in production code\n * - The generator yields indefinitely - use it only in controlled test environments\n * - Each yield waits for the next render event\n */\nexport async function* trackRenders(element: HTMLElement): AsyncGenerator<void, void, unknown> {\n while (true) {\n await new Promise<void>(resolve => {\n if (!(element as any)[RENDER_CALLBACKS]) {\n (element as any)[RENDER_CALLBACKS] = [];\n }\n (element as any)[RENDER_CALLBACKS].push(resolve);\n });\n yield;\n }\n}\n","/**\n * Shared body scroll-lock with refcounting.\n *\n * Multiple overlay components (drawer, modal, etc.) can each lock body\n * scroll independently. Without coordination, closing one overlay would\n * unlock scroll while another is still open. This utility increments\n * a module-scope counter on lock, decrements on unlock, and only mutates\n * `document.body.style.overflow` on the 0 ↔ 1 transitions. The original\n * overflow value is captured at the first lock and restored at the last\n * unlock — important because some pages set `overflow: scroll` for layout\n * and a naive `= ''` would clobber it.\n */\n\nlet count = 0;\nlet savedOverflow: string | null = null;\n\n// Test hook — `afterEach` in test suites can call `.clear()` to reset the\n// counter when document.body.innerHTML is wiped. The counter is module-scope,\n// so without this it survives across tests and the second test's first lock\n// would only increment instead of flipping `overflow: hidden`.\nconst TEST_HOOK = Symbol.for('snice:body-scroll-lock');\n(globalThis as any)[TEST_HOOK] = {\n clear() {\n count = 0;\n savedOverflow = null;\n },\n};\n\nexport function lockBodyScroll(): void {\n if (count === 0) {\n savedOverflow = document.body.style.overflow;\n document.body.style.overflow = 'hidden';\n }\n count++;\n}\n\nexport function unlockBodyScroll(): void {\n if (count === 0) return;\n count--;\n if (count === 0) {\n document.body.style.overflow = savedOverflow ?? '';\n savedOverflow = null;\n }\n}\n\n/**\n * Test/debug only — peek at the current refcount.\n */\nexport function getBodyScrollLockCount(): number {\n return count;\n}\n","import type { Context } from './types/context';\n\n/**\n * Middleware for modifying requests before they are sent\n * `this` is bound to the Context instance\n */\nexport type RequestMiddleware = (\n this: Context,\n request: Request,\n next: () => Promise<Response>\n) => Promise<Response>;\n\n/**\n * Middleware for handling responses after they are received\n * `this` is bound to the Context instance\n */\nexport type ResponseMiddleware = (\n this: Context,\n response: Response,\n next: () => Promise<Response>\n) => Promise<Response>;\n\n/**\n * Interface for fetch middleware implementations\n */\nexport interface Fetcher {\n use(type: 'request', middleware: RequestMiddleware): void;\n use(type: 'response', middleware: ResponseMiddleware): void;\n create(ctx: Context): typeof globalThis.fetch;\n}\n\n/**\n * Context-aware fetch implementation with middleware support\n *\n * @example\n * ```typescript\n * const fetcher = new ContextAwareFetcher();\n *\n * fetcher.use('request', function(request, next) {\n * const token = this.application.user?.token;\n * if (token) {\n * request.headers.set('Authorization', `Bearer ${token}`);\n * }\n * return next();\n * });\n *\n * fetcher.use('response', async function(response, next) {\n * if (!response.ok) {\n * throw new Error(`HTTP ${response.status}`);\n * }\n * return next();\n * });\n *\n * const router = Router({\n * target: '#app',\n * context: { user: null },\n * fetcher\n * });\n * ```\n */\nexport class ContextAwareFetcher implements Fetcher {\n private requestMiddlewares: RequestMiddleware[] = [];\n private responseMiddlewares: ResponseMiddleware[] = [];\n\n /**\n * Add middleware to the fetch pipeline\n * @param type - 'request' for pre-fetch middleware, 'response' for post-fetch middleware\n * @param middleware - The middleware function\n */\n use(type: 'request', middleware: RequestMiddleware): void;\n use(type: 'response', middleware: ResponseMiddleware): void;\n use(type: 'request' | 'response', middleware: RequestMiddleware | ResponseMiddleware): void {\n if (type === 'request') {\n this.requestMiddlewares.push(middleware as RequestMiddleware);\n return;\n }\n this.responseMiddlewares.push(middleware as ResponseMiddleware);\n }\n\n /**\n * Create a fetch function bound to the given Context instance\n * @param ctx - The Context instance to bind to\n * @returns A fetch function with middleware applied\n */\n create(ctx: Context): typeof globalThis.fetch {\n const requestMiddlewares = this.requestMiddlewares;\n const responseMiddlewares = this.responseMiddlewares;\n\n const fetchFn = async function(\n this: Context,\n input: RequestInfo | URL,\n init?: RequestInit\n ): Promise<Response> {\n const request = new Request(input, init);\n\n // Request middleware chain\n let reqIndex = 0;\n const nextRequest = async (): Promise<Response> => {\n if (reqIndex < requestMiddlewares.length) {\n const middleware = requestMiddlewares[reqIndex++];\n return middleware.call(this, request, nextRequest);\n }\n\n // Execute actual fetch\n const response = await fetch(request);\n\n // Response middleware chain\n let resIndex = 0;\n const nextResponse = async (): Promise<Response> => {\n if (resIndex < responseMiddlewares.length) {\n const middleware = responseMiddlewares[resIndex++];\n return middleware.call(this, response, nextResponse);\n }\n return response;\n };\n\n return nextResponse();\n };\n\n return nextRequest();\n };\n\n return fetchFn.bind(ctx) as typeof globalThis.fetch;\n }\n}\n","// v3.0.0 exports\nexport { element, layout, property, state, query, queryAll, watch, applyElementFunctionality, ready, dispose, reconnect, moved, adopted } from './element';\nexport type { Layout } from './element';\nexport { SniceElement } from './snice-element';\nexport { context as contextProperty } from './element'; // Deprecated: use @context method decorator instead\nexport { Router } from './router';\nexport { controller, useNativeElementControllers, attachController, detachController, getController } from './controller';\nexport { daemon } from './daemon';\nexport { provideContext, getContext } from './app-context';\nimport { useNativeElementControllers } from './controller';\n\n// Auto-enable native element controllers in browser environments\nif (typeof document !== 'undefined') {\n useNativeElementControllers();\n}\nexport { dispatch } from './events';\nexport { observe } from './observe';\nexport { on } from './on';\nexport type { OnOptions } from './on';\nexport { request, respond } from './request-response';\nexport type { Response } from './request-response';\nexport { createRequestHandler } from './create-request-handler';\nexport type { RequestRoute, RequestRouteMap, CreateRequestHandlerOptions } from './create-request-handler';\nexport { IS_CONTROLLER_INSTANCE, getSymbol } from './symbols';\n\n// v3.0.0 new template system\nexport { html, svg, css, nothing, unsafeHTML } from './template';\nexport type { TemplateResult, CSSResult, Nothing, UnsafeHTML } from './template';\nexport { render, styles, setStrictRenderErrors } from './render';\nexport { noChange, live } from './parts';\nexport type { NoChange } from './parts';\nexport { repeat } from './repeat';\nexport type { RepeatOptions, RepeatResult } from './repeat';\nexport type { RenderOptions } from './render';\nexport { classMap, styleMap } from './template-helpers';\n\n// v3.0.0 custom element readiness utilities\nexport { waitForElementDefined, waitForElementReady, waitForAllCustomElements, setDisableElementReadyWarnings } from './element-ready';\n\n// v3.0.0 render debugging utilities (for testing/debugging only)\nexport { trackRenders } from './render-debug';\n\n// Shared utilities\nexport { parseDuration, escapeHtml, escapeAttr, isSafeUrl } from './utils';\nexport type { Duration } from './utils';\nexport { lockBodyScroll, unlockBodyScroll, getBodyScrollLockCount } from './scroll-lock';\n\n// v3.0.0 method decorators\nexport { debounce, throttle, once, memoize, clearDebounceTimers, clearThrottleTimers, clearMemoizeCache, resetOnce } from './method-decorators';\n\n// Router context decorator (method decorator for receiving router updates)\nexport { context } from './context';\nexport type { ContextOptions } from './context';\n\n// Fetch middleware system\nexport { ContextAwareFetcher } from './fetcher';\nexport type { Fetcher, RequestMiddleware, ResponseMiddleware } from './fetcher';\n\n// Export all types from centralized types module\nexport * from './types';\n\n\n// NOTE: @on decorator works in both elements AND controllers.\n// Supports event delegation, keyboard modifiers, debounce/throttle - see docs/events.md\n// Template event syntax (@click=${handler}) is also available as an alternative.\n"],"names":["TransitionMode","throttle","context","getAppContext","performTransition","performTransitionUtil"],"mappings":";;;;;;;;;;;IAAA;IACA;IAKA;IACA;IACA,IAAI,CAAE,UAAkB,CAAC,KAAK,EAAE;QAC7B,UAAkB,CAAC,KAAK,GAAG;YAC1B,kBAAkB,EAAE,IAAI,GAAG,EAAE;YAC7B,4BAA4B,EAAE,IAAI,GAAG,EAAE;IACvC,QAAA,mBAAmB,EAAE;SACtB;IACH;IAEA;IACC,UAAkB,CAAC,KAAK,CAAC,4BAA4B,KAAK,IAAI,GAAG,EAAE;IAEpE;IACO,MAAM,KAAK,GAAiB,UAAkB,CAAC,KAAK;IAE3D;IACA;IACM,SAAU,SAAS,CAAC,IAAY,EAAA;QACpC,OAAO,MAAM,CAAC,GAAG,CAAC,SAAS,IAAI,CAAA,CAAE,CAAC;IACpC;;IC1BA;IACA;IAMO,MAAM,mBAAmB,GAAG,SAAS,CAAC,qBAAqB,CAAC;UACtD,sBAAsB,GAAG,SAAS,CAAC,wBAAwB;IACjE,MAAM,eAAe,GAAG,SAAS,CAAC,iBAAiB,CAAC;IACpD,MAAM,kBAAkB,GAAG,SAAS,CAAC,oBAAoB,CAAC;IAC1D,MAAM,gBAAgB,GAAG,SAAS,CAAC,kBAAkB,CAAC;IACtD,MAAM,gBAAgB,GAAG,SAAS,CAAC,kBAAkB,CAAC;IAE7D;IACA;IACA;IACO,MAAM,YAAY,GAAG,SAAS,CAAC,cAAc,CAAC;IAErD;IACO,MAAM,aAAa,GAAG,SAAS,CAAC,eAAe,CAAC;IAChD,MAAM,aAAa,GAAG,SAAS,CAAC,eAAe,CAAC;IAChD,MAAM,YAAY,GAAG,SAAS,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