@threadlabs/looma 0.2.4 → 0.2.6

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 (428) hide show
  1. package/dist/chunk-3K45IWIJ.js +4733 -0
  2. package/dist/chunk-MLKGABMK.js +9 -0
  3. package/dist/chunk-UHHA4WT5.js +2916 -0
  4. package/dist/declarative-generated.cjs +135 -0
  5. package/dist/declarative-generated.d.cts +10 -0
  6. package/dist/declarative-generated.d.ts +10 -0
  7. package/dist/declarative-generated.js +111 -0
  8. package/dist/declarative.cjs +2944 -0
  9. package/dist/declarative.d.cts +27 -0
  10. package/dist/declarative.d.ts +27 -0
  11. package/dist/declarative.js +13 -0
  12. package/dist/index.cjs +7480 -6457
  13. package/dist/index.d.cts +4 -58
  14. package/dist/index.d.ts +4 -58
  15. package/dist/index.js +15 -27
  16. package/dist/loader.cjs +7654 -0
  17. package/dist/loader.d.cts +4 -0
  18. package/dist/loader.d.ts +4 -0
  19. package/dist/loader.js +16 -0
  20. package/dist/valibot.cjs +31 -0
  21. package/dist/valibot.d.cts +10 -0
  22. package/dist/valibot.d.ts +1 -43
  23. package/dist/valibot.js +2 -0
  24. package/dist/{types/field/validation.d.ts → validation-bxcou-l-.d.cts} +13 -11
  25. package/dist/validation-bxcou-l-.d.ts +58 -0
  26. package/editor/{chunk-B5WVJOPV.js → chunk-BXICJBWS.js} +118 -8
  27. package/editor/{chunk-ZOUKEZ77.js → chunk-JK53ENSG.js} +8 -21
  28. package/editor/chunk-WI7ZA44X.js +2558 -0
  29. package/editor/extensions/index.d.ts +11 -2
  30. package/editor/extensions/index.js +9 -7
  31. package/editor/index.d.ts +1 -1
  32. package/editor/index.js +10 -8
  33. package/editor/ui.js +2 -2
  34. package/editor.css +32 -0
  35. package/layout/index.cjs +466 -400
  36. package/layout/index.d.cts +1 -2
  37. package/layout/index.d.ts +1 -2
  38. package/layout/index.js +471 -395
  39. package/package.json +14 -5
  40. package/styles.css +8 -8
  41. package/vue/chunk-4DPYH3IT.js +3538 -0
  42. package/vue/editor/index.d.ts +17 -7
  43. package/vue/editor/index.js +53 -35
  44. package/vue/index.d.ts +48 -31
  45. package/vue/index.js +1 -1
  46. package/dist/chunk-24OTMNIU.js +0 -1617
  47. package/dist/chunk-D5WRORG6.js +0 -366
  48. package/dist/chunk-HNFCGIBP.js +0 -8
  49. package/dist/chunk-NB6DBRXQ.js +0 -323
  50. package/dist/chunk-OF57X5AR.js +0 -10
  51. package/dist/chunk-TL4FIE7X.js +0 -93
  52. package/dist/chunk-UL7UIUJZ.js +0 -20
  53. package/dist/cjs/app-globals-V2Kpy_OQ.js +0 -5
  54. package/dist/cjs/controlled-state-BFya8rAX.js +0 -9
  55. package/dist/cjs/events-TcQIzpNv.js +0 -19
  56. package/dist/cjs/icons-BAdjrnhS.js +0 -680
  57. package/dist/cjs/id-CYbKpaYr.js +0 -9
  58. package/dist/cjs/index-BHG9Rpil.js +0 -1602
  59. package/dist/cjs/index.cjs.js +0 -2
  60. package/dist/cjs/loader.cjs.js +0 -13
  61. package/dist/cjs/looma.cjs.js +0 -25
  62. package/dist/cjs/manager-Ce25WRtl.js +0 -95
  63. package/dist/cjs/positioning-CCR6ifPj.js +0 -426
  64. package/dist/cjs/ui-affordance-scope.cjs.entry.js +0 -43
  65. package/dist/cjs/ui-avatar-group.cjs.entry.js +0 -43
  66. package/dist/cjs/ui-avatar.cjs.entry.js +0 -50
  67. package/dist/cjs/ui-badge.cjs.entry.js +0 -19
  68. package/dist/cjs/ui-button.cjs.entry.js +0 -75
  69. package/dist/cjs/ui-callout.cjs.entry.js +0 -27
  70. package/dist/cjs/ui-checkbox.cjs.entry.js +0 -97
  71. package/dist/cjs/ui-chip_2.cjs.entry.js +0 -258
  72. package/dist/cjs/ui-combobox.cjs.entry.js +0 -708
  73. package/dist/cjs/ui-context-menu.cjs.entry.js +0 -239
  74. package/dist/cjs/ui-dialog.cjs.entry.js +0 -131
  75. package/dist/cjs/ui-disclosure.cjs.entry.js +0 -112
  76. package/dist/cjs/ui-editable.cjs.entry.js +0 -100
  77. package/dist/cjs/ui-floating-action-button.cjs.entry.js +0 -20
  78. package/dist/cjs/ui-form-field.cjs.entry.js +0 -114
  79. package/dist/cjs/ui-icon-button.cjs.entry.js +0 -23
  80. package/dist/cjs/ui-input.cjs.entry.js +0 -106
  81. package/dist/cjs/ui-menu-item.cjs.entry.js +0 -19
  82. package/dist/cjs/ui-menu.cjs.entry.js +0 -182
  83. package/dist/cjs/ui-popover.cjs.entry.js +0 -135
  84. package/dist/cjs/ui-radio-group.cjs.entry.js +0 -134
  85. package/dist/cjs/ui-radio.cjs.entry.js +0 -94
  86. package/dist/cjs/ui-search-result-row.cjs.entry.js +0 -47
  87. package/dist/cjs/ui-search-shell.cjs.entry.js +0 -39
  88. package/dist/cjs/ui-select.cjs.entry.js +0 -108
  89. package/dist/cjs/ui-switch.cjs.entry.js +0 -74
  90. package/dist/cjs/ui-tabs.cjs.entry.js +0 -118
  91. package/dist/cjs/ui-textarea.cjs.entry.js +0 -110
  92. package/dist/cjs/ui-toast-region.cjs.entry.js +0 -93
  93. package/dist/cjs/ui-top-bar.cjs.entry.js +0 -43
  94. package/dist/cjs/ui-tree-item.cjs.entry.js +0 -135
  95. package/dist/cjs/ui-tree.cjs.entry.js +0 -500
  96. package/dist/collection/collection-manifest.json +0 -45
  97. package/dist/collection/components/ui-affordance-scope/ui-affordance-scope.css +0 -8
  98. package/dist/collection/components/ui-affordance-scope/ui-affordance-scope.js +0 -70
  99. package/dist/collection/components/ui-avatar/ui-avatar.css +0 -35
  100. package/dist/collection/components/ui-avatar/ui-avatar.js +0 -130
  101. package/dist/collection/components/ui-avatar-group/ui-avatar-group.css +0 -32
  102. package/dist/collection/components/ui-avatar-group/ui-avatar-group.js +0 -95
  103. package/dist/collection/components/ui-badge/ui-badge.css +0 -90
  104. package/dist/collection/components/ui-badge/ui-badge.js +0 -62
  105. package/dist/collection/components/ui-button/ui-button.css +0 -121
  106. package/dist/collection/components/ui-button/ui-button.js +0 -141
  107. package/dist/collection/components/ui-callout/ui-callout.css +0 -74
  108. package/dist/collection/components/ui-callout/ui-callout.js +0 -59
  109. package/dist/collection/components/ui-checkbox/ui-checkbox.css +0 -24
  110. package/dist/collection/components/ui-checkbox/ui-checkbox.js +0 -228
  111. package/dist/collection/components/ui-chip/ui-chip.css +0 -57
  112. package/dist/collection/components/ui-chip/ui-chip.js +0 -67
  113. package/dist/collection/components/ui-combobox/ui-combobox.css +0 -47
  114. package/dist/collection/components/ui-combobox/ui-combobox.js +0 -1295
  115. package/dist/collection/components/ui-context-menu/ui-context-menu.css +0 -34
  116. package/dist/collection/components/ui-context-menu/ui-context-menu.js +0 -311
  117. package/dist/collection/components/ui-dialog/ui-dialog.css +0 -72
  118. package/dist/collection/components/ui-dialog/ui-dialog.js +0 -242
  119. package/dist/collection/components/ui-disclosure/ui-disclosure.css +0 -7
  120. package/dist/collection/components/ui-disclosure/ui-disclosure.js +0 -184
  121. package/dist/collection/components/ui-editable/ui-editable.css +0 -2
  122. package/dist/collection/components/ui-editable/ui-editable.js +0 -196
  123. package/dist/collection/components/ui-floating-action-button/ui-floating-action-button.css +0 -73
  124. package/dist/collection/components/ui-floating-action-button/ui-floating-action-button.js +0 -85
  125. package/dist/collection/components/ui-form-field/ui-form-field.css +0 -25
  126. package/dist/collection/components/ui-form-field/ui-form-field.js +0 -180
  127. package/dist/collection/components/ui-icon-button/ui-icon-button.css +0 -145
  128. package/dist/collection/components/ui-icon-button/ui-icon-button.js +0 -128
  129. package/dist/collection/components/ui-input/ui-input.css +0 -48
  130. package/dist/collection/components/ui-input/ui-input.js +0 -217
  131. package/dist/collection/components/ui-menu/ui-menu.css +0 -73
  132. package/dist/collection/components/ui-menu/ui-menu.js +0 -280
  133. package/dist/collection/components/ui-menu-item/ui-menu-item.css +0 -32
  134. package/dist/collection/components/ui-menu-item/ui-menu-item.js +0 -64
  135. package/dist/collection/components/ui-popover/ui-popover.css +0 -58
  136. package/dist/collection/components/ui-popover/ui-popover.js +0 -232
  137. package/dist/collection/components/ui-radio/ui-radio.css +0 -22
  138. package/dist/collection/components/ui-radio/ui-radio.js +0 -226
  139. package/dist/collection/components/ui-radio-group/ui-radio-group.css +0 -10
  140. package/dist/collection/components/ui-radio-group/ui-radio-group.js +0 -247
  141. package/dist/collection/components/ui-search-result-row/ui-search-result-row.css +0 -80
  142. package/dist/collection/components/ui-search-result-row/ui-search-result-row.js +0 -100
  143. package/dist/collection/components/ui-search-shell/ui-search-shell.css +0 -63
  144. package/dist/collection/components/ui-search-shell/ui-search-shell.js +0 -46
  145. package/dist/collection/components/ui-select/ui-select.css +0 -64
  146. package/dist/collection/components/ui-select/ui-select.js +0 -218
  147. package/dist/collection/components/ui-switch/ui-switch.css +0 -63
  148. package/dist/collection/components/ui-switch/ui-switch.js +0 -185
  149. package/dist/collection/components/ui-tabs/ui-tabs.css +0 -68
  150. package/dist/collection/components/ui-tabs/ui-tabs.js +0 -190
  151. package/dist/collection/components/ui-textarea/ui-textarea.css +0 -49
  152. package/dist/collection/components/ui-textarea/ui-textarea.js +0 -241
  153. package/dist/collection/components/ui-toast-region/ui-toast-region.css +0 -59
  154. package/dist/collection/components/ui-toast-region/ui-toast-region.js +0 -126
  155. package/dist/collection/components/ui-tooltip/ui-tooltip.css +0 -43
  156. package/dist/collection/components/ui-tooltip/ui-tooltip.js +0 -430
  157. package/dist/collection/components/ui-top-bar/ui-top-bar.css +0 -51
  158. package/dist/collection/components/ui-top-bar/ui-top-bar.js +0 -52
  159. package/dist/collection/components/ui-tree/ui-tree.css +0 -12
  160. package/dist/collection/components/ui-tree/ui-tree.js +0 -515
  161. package/dist/collection/components/ui-tree-item/ui-tree-item.css +0 -217
  162. package/dist/collection/components/ui-tree-item/ui-tree-item.js +0 -406
  163. package/dist/collection/field/combobox.js +0 -4
  164. package/dist/collection/field/editable.js +0 -1
  165. package/dist/collection/field/multi-combobox.js +0 -1
  166. package/dist/collection/field/valibot.js +0 -5
  167. package/dist/collection/field/validation.js +0 -62
  168. package/dist/collection/icons.js +0 -71
  169. package/dist/collection/input-modality.js +0 -24
  170. package/dist/collection/overlay/manager.js +0 -92
  171. package/dist/collection/overlay/positioning.js +0 -424
  172. package/dist/collection/utils/controlled-state.js +0 -4
  173. package/dist/collection/utils/drag-drop.js +0 -51
  174. package/dist/collection/utils/events.js +0 -13
  175. package/dist/collection/utils/id.js +0 -5
  176. package/dist/collection/utils/initials.js +0 -11
  177. package/dist/components/index.d.ts +0 -102
  178. package/dist/components/index.js +0 -1
  179. package/dist/components/p-6SWSrfmW.js +0 -1
  180. package/dist/components/p-B_DaIVEY.js +0 -1
  181. package/dist/components/p-Bh_1GxOD.js +0 -1
  182. package/dist/components/p-BnGhGgTH.js +0 -1
  183. package/dist/components/p-BzaB_bXo.js +0 -1
  184. package/dist/components/p-C-0syqXZ.js +0 -1
  185. package/dist/components/p-CoFximGM.js +0 -13
  186. package/dist/components/p-JwSoedEO.js +0 -1
  187. package/dist/components/p-Vc4ExHFc.js +0 -1
  188. package/dist/components/p-hgBUJRDa.js +0 -1
  189. package/dist/components/ui-affordance-scope.d.ts +0 -11
  190. package/dist/components/ui-affordance-scope.js +0 -1
  191. package/dist/components/ui-avatar-group.d.ts +0 -11
  192. package/dist/components/ui-avatar-group.js +0 -1
  193. package/dist/components/ui-avatar.d.ts +0 -11
  194. package/dist/components/ui-avatar.js +0 -1
  195. package/dist/components/ui-badge.d.ts +0 -11
  196. package/dist/components/ui-badge.js +0 -1
  197. package/dist/components/ui-button.d.ts +0 -11
  198. package/dist/components/ui-button.js +0 -1
  199. package/dist/components/ui-callout.d.ts +0 -11
  200. package/dist/components/ui-callout.js +0 -1
  201. package/dist/components/ui-checkbox.d.ts +0 -11
  202. package/dist/components/ui-checkbox.js +0 -1
  203. package/dist/components/ui-chip.d.ts +0 -11
  204. package/dist/components/ui-chip.js +0 -1
  205. package/dist/components/ui-combobox.d.ts +0 -11
  206. package/dist/components/ui-combobox.js +0 -1
  207. package/dist/components/ui-context-menu.d.ts +0 -11
  208. package/dist/components/ui-context-menu.js +0 -1
  209. package/dist/components/ui-dialog.d.ts +0 -11
  210. package/dist/components/ui-dialog.js +0 -1
  211. package/dist/components/ui-disclosure.d.ts +0 -11
  212. package/dist/components/ui-disclosure.js +0 -1
  213. package/dist/components/ui-editable.d.ts +0 -11
  214. package/dist/components/ui-editable.js +0 -1
  215. package/dist/components/ui-floating-action-button.d.ts +0 -11
  216. package/dist/components/ui-floating-action-button.js +0 -1
  217. package/dist/components/ui-form-field.d.ts +0 -11
  218. package/dist/components/ui-form-field.js +0 -1
  219. package/dist/components/ui-icon-button.d.ts +0 -11
  220. package/dist/components/ui-icon-button.js +0 -1
  221. package/dist/components/ui-input.d.ts +0 -11
  222. package/dist/components/ui-input.js +0 -1
  223. package/dist/components/ui-menu-item.d.ts +0 -11
  224. package/dist/components/ui-menu-item.js +0 -1
  225. package/dist/components/ui-menu.d.ts +0 -11
  226. package/dist/components/ui-menu.js +0 -1
  227. package/dist/components/ui-popover.d.ts +0 -11
  228. package/dist/components/ui-popover.js +0 -1
  229. package/dist/components/ui-radio-group.d.ts +0 -11
  230. package/dist/components/ui-radio-group.js +0 -1
  231. package/dist/components/ui-radio.d.ts +0 -11
  232. package/dist/components/ui-radio.js +0 -1
  233. package/dist/components/ui-search-result-row.d.ts +0 -11
  234. package/dist/components/ui-search-result-row.js +0 -1
  235. package/dist/components/ui-search-shell.d.ts +0 -11
  236. package/dist/components/ui-search-shell.js +0 -1
  237. package/dist/components/ui-select.d.ts +0 -11
  238. package/dist/components/ui-select.js +0 -1
  239. package/dist/components/ui-switch.d.ts +0 -11
  240. package/dist/components/ui-switch.js +0 -1
  241. package/dist/components/ui-tabs.d.ts +0 -11
  242. package/dist/components/ui-tabs.js +0 -1
  243. package/dist/components/ui-textarea.d.ts +0 -11
  244. package/dist/components/ui-textarea.js +0 -1
  245. package/dist/components/ui-toast-region.d.ts +0 -11
  246. package/dist/components/ui-toast-region.js +0 -1
  247. package/dist/components/ui-tooltip.d.ts +0 -11
  248. package/dist/components/ui-tooltip.js +0 -1
  249. package/dist/components/ui-top-bar.d.ts +0 -11
  250. package/dist/components/ui-top-bar.js +0 -1
  251. package/dist/components/ui-tree-item.d.ts +0 -11
  252. package/dist/components/ui-tree-item.js +0 -1
  253. package/dist/components/ui-tree.d.ts +0 -11
  254. package/dist/components/ui-tree.js +0 -1
  255. package/dist/esm/app-globals-DQuL1Twl.js +0 -3
  256. package/dist/esm/controlled-state-BnGhGgTH.js +0 -6
  257. package/dist/esm/events-JwSoedEO.js +0 -15
  258. package/dist/esm/icons-CoFximGM.js +0 -678
  259. package/dist/esm/id-hgBUJRDa.js +0 -7
  260. package/dist/esm/index-8BGiMGQ0.js +0 -1593
  261. package/dist/esm/index.js +0 -1
  262. package/dist/esm/loader.js +0 -11
  263. package/dist/esm/looma.js +0 -21
  264. package/dist/esm/manager-C-0syqXZ.js +0 -91
  265. package/dist/esm/positioning-ZOr-2PSe.js +0 -421
  266. package/dist/esm/ui-affordance-scope.entry.js +0 -41
  267. package/dist/esm/ui-avatar-group.entry.js +0 -41
  268. package/dist/esm/ui-avatar.entry.js +0 -48
  269. package/dist/esm/ui-badge.entry.js +0 -17
  270. package/dist/esm/ui-button.entry.js +0 -73
  271. package/dist/esm/ui-callout.entry.js +0 -25
  272. package/dist/esm/ui-checkbox.entry.js +0 -95
  273. package/dist/esm/ui-chip_2.entry.js +0 -255
  274. package/dist/esm/ui-combobox.entry.js +0 -706
  275. package/dist/esm/ui-context-menu.entry.js +0 -237
  276. package/dist/esm/ui-dialog.entry.js +0 -129
  277. package/dist/esm/ui-disclosure.entry.js +0 -110
  278. package/dist/esm/ui-editable.entry.js +0 -98
  279. package/dist/esm/ui-floating-action-button.entry.js +0 -18
  280. package/dist/esm/ui-form-field.entry.js +0 -112
  281. package/dist/esm/ui-icon-button.entry.js +0 -21
  282. package/dist/esm/ui-input.entry.js +0 -104
  283. package/dist/esm/ui-menu-item.entry.js +0 -17
  284. package/dist/esm/ui-menu.entry.js +0 -180
  285. package/dist/esm/ui-popover.entry.js +0 -133
  286. package/dist/esm/ui-radio-group.entry.js +0 -132
  287. package/dist/esm/ui-radio.entry.js +0 -92
  288. package/dist/esm/ui-search-result-row.entry.js +0 -45
  289. package/dist/esm/ui-search-shell.entry.js +0 -37
  290. package/dist/esm/ui-select.entry.js +0 -106
  291. package/dist/esm/ui-switch.entry.js +0 -72
  292. package/dist/esm/ui-tabs.entry.js +0 -116
  293. package/dist/esm/ui-textarea.entry.js +0 -108
  294. package/dist/esm/ui-toast-region.entry.js +0 -91
  295. package/dist/esm/ui-top-bar.entry.js +0 -41
  296. package/dist/esm/ui-tree-item.entry.js +0 -133
  297. package/dist/esm/ui-tree.entry.js +0 -498
  298. package/dist/index.cjs.js +0 -1
  299. package/dist/looma/index.esm.js +0 -0
  300. package/dist/looma/looma.esm.js +0 -1
  301. package/dist/looma/p-08f80207.entry.js +0 -1
  302. package/dist/looma/p-0b5b8d9e.entry.js +0 -1
  303. package/dist/looma/p-1249a806.entry.js +0 -1
  304. package/dist/looma/p-16e0669d.entry.js +0 -1
  305. package/dist/looma/p-1c00670f.entry.js +0 -1
  306. package/dist/looma/p-1c5a7522.entry.js +0 -1
  307. package/dist/looma/p-22842f8c.entry.js +0 -1
  308. package/dist/looma/p-2915d5c0.entry.js +0 -1
  309. package/dist/looma/p-3b2961a6.entry.js +0 -1
  310. package/dist/looma/p-3f60f4c8.entry.js +0 -1
  311. package/dist/looma/p-424d6719.entry.js +0 -1
  312. package/dist/looma/p-4caccfce.entry.js +0 -1
  313. package/dist/looma/p-5fdcee1d.entry.js +0 -1
  314. package/dist/looma/p-6d8b99ee.entry.js +0 -1
  315. package/dist/looma/p-6f20d470.entry.js +0 -1
  316. package/dist/looma/p-7c0b5364.entry.js +0 -1
  317. package/dist/looma/p-8BGiMGQ0.js +0 -2
  318. package/dist/looma/p-8bdd9495.entry.js +0 -1
  319. package/dist/looma/p-99116a72.entry.js +0 -1
  320. package/dist/looma/p-9cfbf722.entry.js +0 -1
  321. package/dist/looma/p-9d2662ca.entry.js +0 -1
  322. package/dist/looma/p-9ff2fa19.entry.js +0 -1
  323. package/dist/looma/p-BnGhGgTH.js +0 -1
  324. package/dist/looma/p-C-0syqXZ.js +0 -1
  325. package/dist/looma/p-CoFximGM.js +0 -13
  326. package/dist/looma/p-DQuL1Twl.js +0 -1
  327. package/dist/looma/p-JwSoedEO.js +0 -1
  328. package/dist/looma/p-ZOr-2PSe.js +0 -1
  329. package/dist/looma/p-a2dd4c6c.entry.js +0 -1
  330. package/dist/looma/p-add67e4c.entry.js +0 -1
  331. package/dist/looma/p-b6ede6bb.entry.js +0 -1
  332. package/dist/looma/p-b76e2111.entry.js +0 -1
  333. package/dist/looma/p-ca2a54fd.entry.js +0 -1
  334. package/dist/looma/p-d372b0db.entry.js +0 -1
  335. package/dist/looma/p-d4825822.entry.js +0 -1
  336. package/dist/looma/p-d56571a2.entry.js +0 -1
  337. package/dist/looma/p-d5c3954f.entry.js +0 -1
  338. package/dist/looma/p-e604e906.entry.js +0 -1
  339. package/dist/looma/p-f1f7c5cb.entry.js +0 -1
  340. package/dist/looma/p-hgBUJRDa.js +0 -1
  341. package/dist/types/components/ui-affordance-scope/ui-affordance-scope.d.ts +0 -11
  342. package/dist/types/components/ui-avatar/ui-avatar.d.ts +0 -11
  343. package/dist/types/components/ui-avatar-group/ui-avatar-group.d.ts +0 -11
  344. package/dist/types/components/ui-badge/ui-badge.d.ts +0 -5
  345. package/dist/types/components/ui-button/ui-button.d.ts +0 -13
  346. package/dist/types/components/ui-callout/ui-callout.d.ts +0 -6
  347. package/dist/types/components/ui-checkbox/ui-checkbox.d.ts +0 -20
  348. package/dist/types/components/ui-chip/ui-chip.d.ts +0 -8
  349. package/dist/types/components/ui-combobox/ui-combobox.d.ts +0 -128
  350. package/dist/types/components/ui-context-menu/ui-context-menu.d.ts +0 -43
  351. package/dist/types/components/ui-dialog/ui-dialog.d.ts +0 -27
  352. package/dist/types/components/ui-disclosure/ui-disclosure.d.ts +0 -21
  353. package/dist/types/components/ui-editable/ui-editable.d.ts +0 -24
  354. package/dist/types/components/ui-floating-action-button/ui-floating-action-button.d.ts +0 -6
  355. package/dist/types/components/ui-form-field/ui-form-field.d.ts +0 -18
  356. package/dist/types/components/ui-icon-button/ui-icon-button.d.ts +0 -9
  357. package/dist/types/components/ui-input/ui-input.d.ts +0 -19
  358. package/dist/types/components/ui-menu/ui-menu.d.ts +0 -28
  359. package/dist/types/components/ui-menu-item/ui-menu-item.d.ts +0 -5
  360. package/dist/types/components/ui-popover/ui-popover.d.ts +0 -26
  361. package/dist/types/components/ui-radio/ui-radio.d.ts +0 -20
  362. package/dist/types/components/ui-radio-group/ui-radio-group.d.ts +0 -21
  363. package/dist/types/components/ui-search-result-row/ui-search-result-row.d.ts +0 -15
  364. package/dist/types/components/ui-search-shell/ui-search-shell.d.ts +0 -9
  365. package/dist/types/components/ui-select/ui-select.d.ts +0 -20
  366. package/dist/types/components/ui-switch/ui-switch.d.ts +0 -16
  367. package/dist/types/components/ui-tabs/ui-tabs.d.ts +0 -18
  368. package/dist/types/components/ui-textarea/ui-textarea.d.ts +0 -20
  369. package/dist/types/components/ui-toast-region/ui-toast-region.d.ts +0 -16
  370. package/dist/types/components/ui-tooltip/ui-tooltip.d.ts +0 -57
  371. package/dist/types/components/ui-top-bar/ui-top-bar.d.ts +0 -12
  372. package/dist/types/components/ui-tree/ui-tree.d.ts +0 -53
  373. package/dist/types/components/ui-tree-item/ui-tree-item.d.ts +0 -44
  374. package/dist/types/components.d.ts +0 -1889
  375. package/dist/types/field/combobox.d.ts +0 -46
  376. package/dist/types/field/editable.d.ts +0 -5
  377. package/dist/types/field/multi-combobox.d.ts +0 -11
  378. package/dist/types/field/valibot.d.ts +0 -7
  379. package/dist/types/icons.d.ts +0 -53
  380. package/dist/types/input-modality.d.ts +0 -6
  381. package/dist/types/overlay/manager.d.ts +0 -17
  382. package/dist/types/overlay/positioning.d.ts +0 -74
  383. package/dist/types/stencil-public-runtime.d.ts +0 -1860
  384. package/dist/types/utils/controlled-state.d.ts +0 -4
  385. package/dist/types/utils/drag-drop.d.ts +0 -15
  386. package/dist/types/utils/events.d.ts +0 -4
  387. package/dist/types/utils/id.d.ts +0 -1
  388. package/dist/types/utils/initials.d.ts +0 -1
  389. package/dist/ui-affordance-scope.entry-L6TIXYOP.js +0 -54
  390. package/dist/ui-avatar-group.entry-TCAA6P72.js +0 -51
  391. package/dist/ui-avatar.entry-52DQ7VXA.js +0 -51
  392. package/dist/ui-badge.entry-2XCAA6LL.js +0 -22
  393. package/dist/ui-button.entry-MNFBMNSX.js +0 -83
  394. package/dist/ui-callout.entry-SSHT5TH2.js +0 -32
  395. package/dist/ui-checkbox.entry-LOWIWIWI.js +0 -111
  396. package/dist/ui-chip_2.entry-BIMTSF6C.js +0 -272
  397. package/dist/ui-combobox.entry-25Z4MN7N.js +0 -717
  398. package/dist/ui-context-menu.entry-YZDL5Y4M.js +0 -248
  399. package/dist/ui-dialog.entry-HIXZX5AB.js +0 -146
  400. package/dist/ui-disclosure.entry-2JZHZNDQ.js +0 -126
  401. package/dist/ui-editable.entry-U3VR3XPT.js +0 -110
  402. package/dist/ui-floating-action-button.entry-6S3QN3KJ.js +0 -23
  403. package/dist/ui-form-field.entry-GQOSMLHT.js +0 -120
  404. package/dist/ui-icon-button.entry-QJXKVDM6.js +0 -26
  405. package/dist/ui-input.entry-UWMQ6JMP.js +0 -114
  406. package/dist/ui-menu-item.entry-NHNZKKJS.js +0 -22
  407. package/dist/ui-menu.entry-D53RUJND.js +0 -192
  408. package/dist/ui-popover.entry-7ZSIWCFQ.js +0 -152
  409. package/dist/ui-radio-group.entry-37MSYIH4.js +0 -142
  410. package/dist/ui-radio.entry-7YGCDHXT.js +0 -108
  411. package/dist/ui-search-result-row.entry-6FCCLGAS.js +0 -50
  412. package/dist/ui-search-shell.entry-HSBEXPER.js +0 -41
  413. package/dist/ui-select.entry-GIDIAYRD.js +0 -117
  414. package/dist/ui-switch.entry-MYAL6XPC.js +0 -87
  415. package/dist/ui-tabs.entry-R4TEXQSD.js +0 -128
  416. package/dist/ui-textarea.entry-FW32JNDV.js +0 -119
  417. package/dist/ui-toast-region.entry-BTMFPKZF.js +0 -104
  418. package/dist/ui-top-bar.entry-5DQGJF3B.js +0 -49
  419. package/dist/ui-tree-item.entry-ADT7DSOS.js +0 -145
  420. package/dist/ui-tree.entry-7PYQ5RIN.js +0 -470
  421. package/editor/chunk-64GLF274.js +0 -1271
  422. package/layout/index.css +0 -387
  423. package/loader/cdn.js +0 -1
  424. package/loader/index.cjs.js +0 -1
  425. package/loader/index.d.ts +0 -24
  426. package/loader/index.es2017.js +0 -1
  427. package/loader/index.js +0 -2
  428. package/vue/chunk-ROMBQS2L.js +0 -352
@@ -0,0 +1,2944 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
3
+ var __getOwnPropNames = Object.getOwnPropertyNames;
4
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
5
+ var __export = (target, all) => {
6
+ for (var name in all)
7
+ __defProp(target, name, { get: all[name], enumerable: true });
8
+ };
9
+ var __copyProps = (to, from, except, desc) => {
10
+ if (from && typeof from === "object" || typeof from === "function") {
11
+ for (let key of __getOwnPropNames(from))
12
+ if (!__hasOwnProp.call(to, key) && key !== except)
13
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
14
+ }
15
+ return to;
16
+ };
17
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
+
19
+ // src/declarative.ts
20
+ var declarative_exports = {};
21
+ __export(declarative_exports, {
22
+ attachLoomaComponent: () => attachLoomaComponent,
23
+ controllerFor: () => controllerFor,
24
+ manageComponentLifecycle: () => manageComponentLifecycle2,
25
+ registerLoomaPackage: () => registerLoomaPackage
26
+ });
27
+ module.exports = __toCommonJS(declarative_exports);
28
+
29
+ // ../../tools/migrate-html-next/generated/adoption/runtime.js
30
+ var HtmlRuntime = (() => {
31
+ var Ue = Object.defineProperty;
32
+ var jn = Object.getOwnPropertyDescriptor;
33
+ var On = Object.getOwnPropertyNames;
34
+ var In = Object.prototype.hasOwnProperty;
35
+ var zn = (e, t) => {
36
+ for (var n in t) Ue(e, n, { get: t[n], enumerable: true });
37
+ }, Un = (e, t, n, r) => {
38
+ if (t && typeof t == "object" || typeof t == "function") for (let i of On(t)) !In.call(e, i) && i !== n && Ue(e, i, { get: () => t[i], enumerable: !(r = jn(t, i)) || r.enumerable });
39
+ return e;
40
+ };
41
+ var qn = (e) => Un(Ue({}, "__esModule", { value: true }), e);
42
+ var Di = {};
43
+ zn(Di, { attachComponent: () => xt, attachRegisteredComponent: () => Li, getComponentHost: () => Tt, installComponentGraph: () => ri, lowerDocument: () => $i, manageComponentLifecycle: () => Mi, observeDocument: () => Hi, registerComponentDefinitions: () => Vi, setControllerModule: () => Pn });
44
+ var qe = class extends Error {
45
+ diagnostic;
46
+ constructor(t) {
47
+ let n = t.source ? `${t.source}: ` : "";
48
+ super(`${n}${t.code}: ${t.message}`), this.name = "HtmlDiagnosticError", this.diagnostic = Object.freeze({ ...t });
49
+ }
50
+ };
51
+ function y(e, t, n) {
52
+ throw new qe(n === void 0 ? { code: e, message: t } : { code: e, message: t, source: n });
53
+ }
54
+ function oe(e) {
55
+ if (typeof e != "object" || e === null || Object.isFrozen(e)) return e;
56
+ for (let t of Object.values(e)) oe(t);
57
+ return Object.freeze(e);
58
+ }
59
+ function Nt(e) {
60
+ let t = "", n = true;
61
+ for (let r of e) r === "-" ? n = true : (t += n ? r.toUpperCase() : r, n = false);
62
+ return t;
63
+ }
64
+ function Ee(e) {
65
+ return e.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
66
+ }
67
+ var _n = /* @__PURE__ */ new Set(["string", "boolean", "number", "integer", "null", "absent", "email", "url", "date", "time", "datetime-local", "month", "week", "color", "token", "ident", "url-value", "token-list", "trusted-html", "trusted-script", "function", "unknown"]), xe = class extends SyntaxError {
68
+ constructor(n, r) {
69
+ super(`${n} at character ${r + 1}.`);
70
+ this.position = r;
71
+ this.name = "TypeSyntaxError";
72
+ }
73
+ position;
74
+ }, Fe = class {
75
+ constructor(t) {
76
+ this.source = t;
77
+ }
78
+ source;
79
+ #e = 0;
80
+ parse() {
81
+ let t = this.#t();
82
+ return this.#a(), this.#e !== this.source.length && this.#s("Unexpected type syntax"), t;
83
+ }
84
+ #t() {
85
+ let t = [this.#n()];
86
+ for (; this.#o("|"); ) t.push(this.#n());
87
+ return t.length === 1 ? t[0] : We(t);
88
+ }
89
+ #n() {
90
+ let t = this.#i();
91
+ for (; this.#o("?"); ) t = We([t, { kind: "terminal", name: "null" }, { kind: "terminal", name: "absent" }]);
92
+ return t;
93
+ }
94
+ #i() {
95
+ if (this.#o("(")) {
96
+ let r = this.#t();
97
+ return this.#r(")"), r;
98
+ }
99
+ let t = this.#l();
100
+ if (t !== void 0) return { kind: "keyword", value: t };
101
+ let n = this.#d();
102
+ if (n === void 0 && this.#s("Expected a type, keyword, or group"), n === "list" || n === "record") {
103
+ this.#r("(");
104
+ let r = this.#t();
105
+ return this.#r(")"), n === "list" ? { kind: "list", item: r } : { kind: "record", value: r };
106
+ }
107
+ return n === "object" ? this.#u() : _n.has(n) ? { kind: "terminal", name: n } : { kind: "keyword", value: n };
108
+ }
109
+ #u() {
110
+ this.#r("("), this.#r("{");
111
+ let t = [], n = false;
112
+ for (; !this.#o("}"); ) {
113
+ if (this.#a(), this.source.startsWith("...", this.#e)) this.#e += 3, n = true;
114
+ else {
115
+ let r = this.#l() ?? this.#d();
116
+ r === void 0 && this.#s("Expected an object field or `...`");
117
+ let i = this.#o("?");
118
+ this.#r(":");
119
+ let o = this.#t();
120
+ t.some((a) => a.name === r) && this.#s(`Duplicate object field \`${r}\``), t.push({ name: r, type: o, optional: i });
121
+ }
122
+ if (this.#o("}")) break;
123
+ this.#r(","), n && (this.#a(), this.source.startsWith("}", this.#e) || this.#s("The open marker must be last"));
124
+ }
125
+ return this.#r(")"), { kind: "object", fields: t, open: n };
126
+ }
127
+ #d() {
128
+ this.#a();
129
+ let t = /^[A-Za-z_][A-Za-z0-9_-]*/.exec(this.source.slice(this.#e));
130
+ if (t !== null) return this.#e += t[0].length, t[0];
131
+ }
132
+ #l() {
133
+ this.#a();
134
+ let t = this.source[this.#e];
135
+ if (t !== '"' && t !== "'") return;
136
+ this.#e += 1;
137
+ let n = "";
138
+ for (; this.#e < this.source.length; ) {
139
+ let r = this.source[this.#e++];
140
+ if (r === t) return n;
141
+ if (r !== "\\") {
142
+ n += r;
143
+ continue;
144
+ }
145
+ this.#e >= this.source.length && this.#s("Unterminated escape");
146
+ let i = this.source[this.#e++];
147
+ n += { n: `
148
+ `, r: "\r", t: " ", "\\": "\\", '"': '"', "'": "'" }[i] ?? i;
149
+ }
150
+ this.#s("Unterminated quoted keyword");
151
+ }
152
+ #o(t) {
153
+ return this.#a(), this.source.startsWith(t, this.#e) ? (this.#e += t.length, true) : false;
154
+ }
155
+ #r(t) {
156
+ this.#o(t) || this.#s(`Expected \`${t}\``);
157
+ }
158
+ #a() {
159
+ for (; /\s/.test(this.source[this.#e] ?? ""); ) this.#e += 1;
160
+ }
161
+ #s(t) {
162
+ throw new xe(t, this.#e);
163
+ }
164
+ };
165
+ function We(e) {
166
+ let t = e.flatMap((i) => i.kind === "union" ? i.members : [i]), n = new Map(t.map((i) => [K(i), i])), r = Array.from(n.values());
167
+ return r.length === 1 ? r[0] : { kind: "union", members: r };
168
+ }
169
+ function F(e) {
170
+ if (e.trim() === "") throw new xe("A type expression cannot be empty", 0);
171
+ return oe(new Fe(e).parse());
172
+ }
173
+ function Be(e) {
174
+ return typeof e == "object" && e !== null && "kind" in e && ["terminal", "keyword", "union", "list", "record", "object"].includes(String(e.kind));
175
+ }
176
+ function Q(e) {
177
+ return Be(e) ? e : typeof e == "string" ? { kind: "terminal", name: e } : We(e.enum.map((t) => ({ kind: "keyword", value: t })));
178
+ }
179
+ function K(e) {
180
+ let t = Be(e) ? e : Q(e);
181
+ switch (t.kind) {
182
+ case "terminal":
183
+ return t.name;
184
+ case "keyword":
185
+ return /^[A-Za-z_][A-Za-z0-9_-]*$/.test(t.value) ? t.value : JSON.stringify(t.value);
186
+ case "union":
187
+ return t.members.map((n) => K(n)).join(" | ");
188
+ case "list":
189
+ return `list(${K(t.item)})`;
190
+ case "record":
191
+ return `record(${K(t.value)})`;
192
+ case "object":
193
+ return `object({ ${[...t.fields.map((n) => `${n.name}${n.optional ? "?" : ""}: ${K(n.type)}`), ...t.open ? ["..."] : []].join(", ")} })`;
194
+ }
195
+ }
196
+ function T(e, t, n) {
197
+ return { ok: false, issues: [{ reason: e, message: t, path: n }] };
198
+ }
199
+ function O(e, t) {
200
+ return typeof t == "number" ? `${e}[${t}]` : /^[A-Za-z_$][A-Za-z0-9_$]*$/.test(t) ? `${e}.${t}` : `${e}[${JSON.stringify(t)}]`;
201
+ }
202
+ function $t(e) {
203
+ if (typeof e != "object" || e === null || Array.isArray(e)) return false;
204
+ let t = Object.getPrototypeOf(e);
205
+ return t === Object.prototype || t === null;
206
+ }
207
+ function _e(e) {
208
+ if (typeof e != "string") return e;
209
+ try {
210
+ return JSON.parse(e);
211
+ } catch {
212
+ return /* @__PURE__ */ Symbol.for("html-next.bad-json");
213
+ }
214
+ }
215
+ function Fn(e) {
216
+ if (e.length > 254 || /\s/.test(e)) return false;
217
+ let t = /^([A-Za-z0-9.!#$%&'*+/=?^_`{|}~-]+)@([A-Za-z0-9.-]+)$/.exec(e);
218
+ return t === null || t[1].length > 64 ? false : t[2].split(".").every((n) => n !== "" && n.length <= 63 && !n.startsWith("-") && !n.endsWith("-"));
219
+ }
220
+ function At(e) {
221
+ let t = /^(\d{4,})-(\d{2})-(\d{2})$/.exec(e);
222
+ if (t === null || t[1] === "0000") return false;
223
+ let n = Number(t[1]), r = Number(t[2]), i = Number(t[3]), o = new Date(Date.UTC(n, r - 1, i));
224
+ return o.getUTCFullYear() === n && o.getUTCMonth() === r - 1 && o.getUTCDate() === i;
225
+ }
226
+ function Mt(e) {
227
+ let t = /^(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d{1,3}))?)?$/.exec(e);
228
+ return t !== null && Number(t[1]) < 24 && Number(t[2]) < 60 && Number(t[3] ?? 0) < 60;
229
+ }
230
+ function Wn(e) {
231
+ let t = /^(\d{4,})-W(\d{2})$/.exec(e);
232
+ if (t === null || t[1] === "0000") return false;
233
+ let n = Number(t[1]), r = Number(t[2]);
234
+ if (r < 1 || r > 53) return false;
235
+ if (r < 53) return true;
236
+ let i = new Date(Date.UTC(n, 0, 1)).getUTCDay();
237
+ return i === 4 || i === 3 && new Date(Date.UTC(n, 1, 29)).getUTCDate() === 29;
238
+ }
239
+ function Bn(e, t) {
240
+ if (typeof e != "object" || e === null) return false;
241
+ if (e.kind === t && "value" in e) return true;
242
+ let n = t === "trusted-html" ? "TrustedHTML" : "TrustedScript";
243
+ return e.constructor?.name === n || Object.prototype.toString.call(e) === `[object ${n}]`;
244
+ }
245
+ function Zn(e, t, n) {
246
+ switch (t) {
247
+ case "string":
248
+ return typeof e == "string" ? { ok: true, value: e } : T("typeMismatch", "Must be a string.", n);
249
+ case "boolean":
250
+ return typeof e == "boolean" ? { ok: true, value: e } : e === "" || e === "true" ? { ok: true, value: true } : e === "false" ? { ok: true, value: false } : T("typeMismatch", "Must be true or false.", n);
251
+ case "number":
252
+ case "integer": {
253
+ let r = typeof e == "number" ? e : typeof e == "string" && e.trim() !== "" ? Number(e) : Number.NaN;
254
+ return Number.isFinite(r) ? t === "integer" && !Number.isInteger(r) ? T("typeMismatch", "Must be an integer.", n) : { ok: true, value: r } : T("badInput", `Must be ${t === "integer" ? "an integer" : "a finite number"}.`, n);
255
+ }
256
+ case "null":
257
+ return e === null ? { ok: true, value: null } : T("typeMismatch", "Must be null.", n);
258
+ case "absent":
259
+ return e === void 0 ? { ok: true, value: void 0 } : T("typeMismatch", "Must be absent.", n);
260
+ case "email":
261
+ return typeof e == "string" && Fn(e) ? { ok: true, value: e } : T("typeMismatch", "Must be a valid email address.", n);
262
+ case "url": {
263
+ if (typeof e != "string") return T("typeMismatch", "Must be a URL.", n);
264
+ try {
265
+ let r = new URL(e);
266
+ return r.protocol !== "" ? { ok: true, value: r.href } : T("typeMismatch", "Must be an absolute URL.", n);
267
+ } catch {
268
+ return T("typeMismatch", "Must be a valid absolute URL.", n);
269
+ }
270
+ }
271
+ case "date":
272
+ return typeof e == "string" && At(e) ? { ok: true, value: e } : T("typeMismatch", "Must be a valid date (YYYY-MM-DD).", n);
273
+ case "time":
274
+ return typeof e == "string" && Mt(e) ? { ok: true, value: e } : T("typeMismatch", "Must be a valid time.", n);
275
+ case "datetime-local": {
276
+ if (typeof e != "string") return T("typeMismatch", "Must be a local date and time.", n);
277
+ let r = e.split("T");
278
+ return r.length === 2 && At(r[0]) && Mt(r[1]) ? { ok: true, value: e } : T("typeMismatch", "Must be a valid local date and time.", n);
279
+ }
280
+ case "month":
281
+ return typeof e == "string" && /^(?!0000)\d{4,}-(?:0[1-9]|1[0-2])$/.test(e) ? { ok: true, value: e } : T("typeMismatch", "Must be a valid month.", n);
282
+ case "week":
283
+ return typeof e == "string" && Wn(e) ? { ok: true, value: e } : T("typeMismatch", "Must be a valid ISO week.", n);
284
+ case "color":
285
+ return typeof e == "string" && /^#[0-9a-fA-F]{6}$/.test(e) ? { ok: true, value: e.toLowerCase() } : T("typeMismatch", "Must be a six-digit sRGB color.", n);
286
+ case "token":
287
+ return typeof e == "string" && e !== "" && !/[\t\n\f\r ]/.test(e) ? { ok: true, value: e } : T("typeMismatch", "Must be one non-empty HTML token.", n);
288
+ case "ident":
289
+ return typeof e == "string" && /^-?(?:-?[A-Za-z_]|[^\0-\x7f])(?:[A-Za-z0-9_-]|[^\0-\x7f])*$/.test(e) && !/^--$/.test(e) ? { ok: true, value: e } : T("typeMismatch", "Must be an identifier.", n);
290
+ case "url-value":
291
+ return typeof e == "string" && e.trim() !== "" && !/[\u0000-\u001f\u007f]/.test(e) ? { ok: true, value: e } : T("typeMismatch", "Must be a URL value.", n);
292
+ case "token-list": {
293
+ let r = Array.isArray(e) ? e : typeof e == "string" ? e.trim().split(/\s+/).filter(Boolean) : void 0;
294
+ return r !== void 0 && r.every((i) => typeof i == "string" && i !== "" && !/\s/.test(i)) ? { ok: true, value: r } : T("typeMismatch", "Must be a space-separated token list.", n);
295
+ }
296
+ case "trusted-html":
297
+ case "trusted-script":
298
+ return Bn(e, t) ? { ok: true, value: e } : T("untrustedValue", `Must be a ${t === "trusted-html" ? "TrustedHTML" : "TrustedScript"} value.`, n);
299
+ case "function":
300
+ return typeof e == "function" ? { ok: true, value: e } : T("typeMismatch", "Must be a function supplied through a property.", n);
301
+ case "unknown":
302
+ return { ok: true, value: e };
303
+ }
304
+ }
305
+ function se(e, t, n) {
306
+ switch (t.kind) {
307
+ case "terminal":
308
+ return Zn(e, t.name, n);
309
+ case "keyword":
310
+ return e === t.value ? { ok: true, value: e } : T("typeMismatch", `Must be ${JSON.stringify(t.value)}.`, n);
311
+ case "union": {
312
+ for (let r of t.members) {
313
+ let i = se(e, r, n);
314
+ if (i.ok) return i;
315
+ }
316
+ return T("typeMismatch", `Must match ${K(t)}.`, n);
317
+ }
318
+ case "list": {
319
+ let r = _e(e);
320
+ if (!Array.isArray(r)) return T("typeMismatch", "Must be a list.", n);
321
+ let i = [], o = [];
322
+ return r.forEach((a, s) => {
323
+ let d = se(a, t.item, O(n, s));
324
+ d.ok ? i.push(d.value) : o.push(...d.issues);
325
+ }), o.length === 0 ? { ok: true, value: i } : { ok: false, issues: o };
326
+ }
327
+ case "record": {
328
+ let r = _e(e);
329
+ if (!$t(r)) return T("typeMismatch", "Must be a string-keyed record.", n);
330
+ let i = {}, o = [];
331
+ for (let [a, s] of Object.entries(r)) {
332
+ let d = se(s, t.value, O(n, a));
333
+ d.ok ? i[a] = d.value : o.push(...d.issues);
334
+ }
335
+ return o.length === 0 ? { ok: true, value: i } : { ok: false, issues: o };
336
+ }
337
+ case "object": {
338
+ let r = _e(e);
339
+ if (!$t(r)) return T("typeMismatch", "Must be an object.", n);
340
+ let i = {}, o = [], a = new Map(t.fields.map((s) => [s.name, s]));
341
+ for (let s of t.fields) {
342
+ if (!(s.name in r)) {
343
+ s.optional || o.push({ reason: "schemaMismatch", message: "Required field is absent.", path: O(n, s.name) });
344
+ continue;
345
+ }
346
+ let d = se(r[s.name], s.type, O(n, s.name));
347
+ d.ok ? i[s.name] = d.value : o.push(...d.issues);
348
+ }
349
+ for (let [s, d] of Object.entries(r)) a.has(s) || (t.open ? i[s] = d : o.push({ reason: "schemaMismatch", message: "Field is not declared by this closed object type.", path: O(n, s) }));
350
+ return o.length === 0 ? { ok: true, value: i } : { ok: false, issues: o };
351
+ }
352
+ }
353
+ }
354
+ function j(e, t, n = "$") {
355
+ return se(e, Q(t), n);
356
+ }
357
+ function Se(e, t) {
358
+ let n = j(e, t);
359
+ if (!n.ok) throw new TypeError(n.issues.map((i) => `${i.path}: ${i.message}`).join("; "));
360
+ let r = Q(t);
361
+ if (r.kind === "terminal" && (r.name === "function" || r.name === "unknown")) throw new TypeError(`The ${r.name} type is property-only and cannot be serialized.`);
362
+ return r.kind === "list" || r.kind === "record" || r.kind === "object" || r.kind === "union" && typeof n.value == "object" && n.value !== null ? JSON.stringify(n.value) : r.kind === "terminal" && r.name === "token-list" ? n.value.join(" ") : n.value === null ? "null" : n.value === void 0 ? "" : String(n.value);
363
+ }
364
+ function G(e) {
365
+ let t = Q(e);
366
+ return t.kind === "terminal" ? t.name === "function" || t.name === "unknown" || t.name === "trusted-html" || t.name === "trusted-script" : t.kind === "union" ? t.members.some(G) : t.kind === "list" ? G(t.item) : t.kind === "record" ? G(t.value) : t.kind === "object" ? t.fields.some((n) => G(n.type)) : false;
367
+ }
368
+ function Vt(e) {
369
+ let t;
370
+ try {
371
+ t = F(e);
372
+ } catch (n) {
373
+ y("HC013", n instanceof Error ? n.message : "Invalid prop type expression.");
374
+ }
375
+ return t.kind === "terminal" && (t.name === "string" || t.name === "boolean" || t.name === "number") ? t.name : t.kind === "keyword" ? { enum: [t.value] } : t.kind === "union" && t.members.every((n) => n.kind === "keyword") ? { enum: t.members.map((n) => n.value) } : t;
376
+ }
377
+ var x = /* @__PURE__ */ Symbol("absent"), ae = class extends Error {
378
+ constructor(n) {
379
+ super(`\`${n}\` is not declared in scope.`);
380
+ this.identifier = n;
381
+ this.name = "UndeclaredName";
382
+ }
383
+ identifier;
384
+ }, Ze = /\s*(?:(<=|>=|!=|\^=|\$=|\*=)|(\d+(?:\.\d*)?|\.\d+)|("(?:\\[\s\S]|[^"\\])*"|'(?:\\[\s\S]|[^'\\])*')|([A-Za-z_$][A-Za-z0-9_$]*)|([=<>+*/%(),.:{}[\]-])|$)/y, Jn = /\\([\s\S])/g, Kn = /%s/g, Lt = /* @__PURE__ */ new Map();
385
+ function Gn(e) {
386
+ let t = Lt.get(e);
387
+ return t !== void 0 ? t : (Lt.set(e, e), e);
388
+ }
389
+ function Ht(e) {
390
+ switch (e) {
391
+ case "or":
392
+ return 1;
393
+ case "and":
394
+ return 2;
395
+ case "=":
396
+ case "!=":
397
+ case "^=":
398
+ case "$=":
399
+ case "*=":
400
+ return 3;
401
+ case "<":
402
+ case "<=":
403
+ case ">":
404
+ case ">=":
405
+ return 4;
406
+ case "+":
407
+ case "-":
408
+ return 5;
409
+ case "*":
410
+ case "/":
411
+ case "%":
412
+ return 6;
413
+ default:
414
+ return 0;
415
+ }
416
+ }
417
+ function Yn(e) {
418
+ return e === "round" || e === "clamp" || e === "min" || e === "max" || e === "abs" || e === "format";
419
+ }
420
+ function Qn(e) {
421
+ let t = 0, n = 0, r = "";
422
+ function i() {
423
+ Ze.lastIndex = t;
424
+ let l = Ze.exec(e);
425
+ if (l === null) {
426
+ let m = e.slice(t).trimStart()[0];
427
+ throw m === '"' || m === "'" ? new SyntaxError("Unterminated string literal.") : new SyntaxError(`Unexpected character \`${m}\`.`);
428
+ }
429
+ t = Ze.lastIndex, l[1] !== void 0 || l[5] !== void 0 ? (n = 4, r = l[1] ?? l[5]) : l[2] !== void 0 ? (n = 1, r = Number(l[2])) : l[3] !== void 0 ? (n = 2, r = l[3].slice(1, -1).replace(Jn, "$1")) : l[4] !== void 0 ? (n = 3, r = Gn(l[4])) : (n = 0, r = "");
430
+ }
431
+ function o(l) {
432
+ return r !== l ? false : (i(), true);
433
+ }
434
+ function a(l) {
435
+ if (!o(l)) throw new SyntaxError(`Expected \`${l}\`.`);
436
+ }
437
+ function s(l) {
438
+ let m = d(), f = Ht(r);
439
+ for (; f >= l; ) {
440
+ let p = String(r);
441
+ i(), m = { kind: "binary", op: p, left: m, right: s(f + 1) }, f = Ht(r);
442
+ }
443
+ return m;
444
+ }
445
+ function d() {
446
+ if (n === 3 && r === "not") return i(), { kind: "unary", op: "not", operand: d() };
447
+ if (o("-")) return { kind: "unary", op: "-", operand: d() };
448
+ let l = u();
449
+ for (; n === 4; ) if (o(".")) {
450
+ if (n !== 3) throw new SyntaxError("Expected a property name after `.`.");
451
+ let m = String(r);
452
+ i(), l = { kind: "member", object: l, key: m };
453
+ } else if (o("[")) {
454
+ let m = s(1);
455
+ a("]"), l = { kind: "index", object: l, index: m };
456
+ } else break;
457
+ return l;
458
+ }
459
+ function u() {
460
+ let l = n, m = r;
461
+ if (l === 1 || l === 2) return i(), { kind: "literal", value: m };
462
+ if (l === 4 && m === "(") {
463
+ i();
464
+ let f = s(1);
465
+ return a(")"), f;
466
+ }
467
+ if (l === 4 && m === "{") {
468
+ i();
469
+ let f = [];
470
+ if (!o("}")) {
471
+ do {
472
+ if (r === "}") break;
473
+ if (n !== 3 && n !== 2) throw new SyntaxError("Object keys must be identifiers or strings.");
474
+ let p = String(r);
475
+ i(), a(":"), f.push({ key: p, value: s(1) });
476
+ } while (o(","));
477
+ a("}");
478
+ }
479
+ return { kind: "object", pairs: f };
480
+ }
481
+ if (l === 4 && m === "[") {
482
+ i();
483
+ let f = [];
484
+ if (!o("]")) {
485
+ do {
486
+ if (r === "]") break;
487
+ f.push(s(1));
488
+ } while (o(","));
489
+ a("]");
490
+ }
491
+ return { kind: "array", items: f };
492
+ }
493
+ if (l === 3) {
494
+ let f = String(m);
495
+ if (i(), f === "true") return { kind: "literal", value: true };
496
+ if (f === "false") return { kind: "literal", value: false };
497
+ if (f === "null") return { kind: "literal", value: null };
498
+ if (r === "(" && Yn(f)) {
499
+ i();
500
+ let p = [];
501
+ if (!o(")")) {
502
+ do
503
+ p.push(s(1));
504
+ while (o(","));
505
+ a(")");
506
+ }
507
+ return { kind: "call", fn: f, args: p };
508
+ }
509
+ return { kind: "id", name: f };
510
+ }
511
+ throw new SyntaxError("Unexpected end of expression.");
512
+ }
513
+ i();
514
+ let c = s(1);
515
+ if (n !== 0) throw new SyntaxError("Unexpected trailing input in expression.");
516
+ return c;
517
+ }
518
+ function Ge(e) {
519
+ return e === x || e === null;
520
+ }
521
+ function D(e) {
522
+ if (e === x || e === null || e === false) return false;
523
+ if (e === true) return true;
524
+ if (typeof e == "string") return e.length > 0;
525
+ if (typeof e == "number") return e !== 0 && e === e;
526
+ if (Array.isArray(e)) return e.length > 0;
527
+ for (let t in e) if (Object.hasOwn(e, t)) return true;
528
+ return false;
529
+ }
530
+ function Te(e) {
531
+ return typeof e == "number" && e === e ? e : x;
532
+ }
533
+ function M(e, t) {
534
+ switch (e.kind) {
535
+ case "literal":
536
+ return e.value;
537
+ case "id": {
538
+ let n = t.get(e.name);
539
+ if (n === void 0) throw new ae(e.name);
540
+ return n;
541
+ }
542
+ case "member": {
543
+ let n = M(e.object, t);
544
+ if (n === null || n === x || typeof n != "object" || Array.isArray(n)) return x;
545
+ let r = n[e.key];
546
+ return r === void 0 ? x : r;
547
+ }
548
+ case "index": {
549
+ let n = M(e.object, t), r = M(e.index, t);
550
+ if (n === null || n === x || Ge(r)) return x;
551
+ if (Array.isArray(n) && typeof r == "number") {
552
+ let i = n[r];
553
+ return i === void 0 ? x : i;
554
+ }
555
+ if (typeof n == "object" && typeof r == "string") {
556
+ let i = n[r];
557
+ return i === void 0 ? x : i;
558
+ }
559
+ return x;
560
+ }
561
+ case "unary": {
562
+ let n = M(e.operand, t);
563
+ if (e.op === "not") return !D(n);
564
+ let r = Te(n);
565
+ return r === x ? x : -r;
566
+ }
567
+ case "binary":
568
+ return Xn(e, t);
569
+ case "call":
570
+ return er(e, t);
571
+ case "object": {
572
+ let n = {};
573
+ for (let r of e.pairs) n[r.key] = M(r.value, t);
574
+ return n;
575
+ }
576
+ case "array": {
577
+ let n = [];
578
+ for (let r of e.items) n.push(M(r, t));
579
+ return n;
580
+ }
581
+ }
582
+ }
583
+ function Xn(e, t) {
584
+ let { op: n } = e;
585
+ if (n === "and") return D(M(e.left, t)) && D(M(e.right, t));
586
+ if (n === "or") return D(M(e.left, t)) || D(M(e.right, t));
587
+ let r = M(e.left, t), i = M(e.right, t);
588
+ if (n === "=") return r === i;
589
+ if (n === "!=") return r !== i;
590
+ if (n === "^=" || n === "$=" || n === "*=") return typeof r != "string" || typeof i != "string" ? x : n === "^=" ? r.startsWith(i) : n === "$=" ? r.endsWith(i) : r.includes(i);
591
+ let o = Te(r), a = Te(i);
592
+ if (o === x || a === x) return x;
593
+ switch (n) {
594
+ case "<":
595
+ return o < a;
596
+ case "<=":
597
+ return o <= a;
598
+ case ">":
599
+ return o > a;
600
+ case ">=":
601
+ return o >= a;
602
+ case "+":
603
+ return o + a;
604
+ case "-":
605
+ return o - a;
606
+ case "*":
607
+ return o * a;
608
+ case "/":
609
+ return o / a;
610
+ case "%":
611
+ return o % a;
612
+ default:
613
+ return x;
614
+ }
615
+ }
616
+ function er(e, t) {
617
+ let { args: n, fn: r } = e, i = [];
618
+ for (let a of n) i.push(M(a, t));
619
+ if (r === "format") {
620
+ let a = i[0];
621
+ if (typeof a != "string") return x;
622
+ let s = 1;
623
+ return a.replace(Kn, () => s < i.length ? L(i[s++]) : "%s");
624
+ }
625
+ for (let a = 0; a < i.length; a += 1) {
626
+ let s = Te(i[a]);
627
+ if (s === x) return x;
628
+ i[a] = s;
629
+ }
630
+ let o = i;
631
+ switch (r) {
632
+ case "abs":
633
+ return o.length === 1 ? Math.abs(o[0]) : x;
634
+ case "round":
635
+ return o.length === 1 ? Math.round(o[0]) : x;
636
+ case "min":
637
+ return o.length > 0 ? Math.min(...o) : x;
638
+ case "max":
639
+ return o.length > 0 ? Math.max(...o) : x;
640
+ case "clamp":
641
+ return o.length === 3 ? Math.min(Math.max(o[0], o[1]), o[2]) : x;
642
+ default:
643
+ return x;
644
+ }
645
+ }
646
+ var Dt = /* @__PURE__ */ new Map();
647
+ function Je(e) {
648
+ if (e.kind === "id") return e.name;
649
+ if (e.kind === "member") {
650
+ let t = Je(e.object);
651
+ return t === void 0 ? void 0 : `${t}.${e.key}`;
652
+ }
653
+ if (e.kind === "index" && e.index.kind === "literal") {
654
+ let t = e.index.value;
655
+ if (typeof t != "string" && typeof t != "number") return;
656
+ let n = Je(e.object);
657
+ return n === void 0 ? void 0 : `${n}.${t}`;
658
+ }
659
+ }
660
+ function z(e, t) {
661
+ let n = Je(e);
662
+ if (n !== void 0) {
663
+ t.includes(n) || t.push(n);
664
+ return;
665
+ }
666
+ switch (e.kind) {
667
+ case "literal":
668
+ return;
669
+ case "id":
670
+ return;
671
+ case "member":
672
+ z(e.object, t);
673
+ return;
674
+ case "index":
675
+ z(e.object, t), z(e.index, t);
676
+ return;
677
+ case "unary":
678
+ z(e.operand, t);
679
+ return;
680
+ case "binary":
681
+ z(e.left, t), z(e.right, t);
682
+ return;
683
+ case "call":
684
+ for (let r of e.args) z(r, t);
685
+ return;
686
+ case "object":
687
+ for (let r of e.pairs) z(r.value, t);
688
+ return;
689
+ case "array":
690
+ for (let r of e.items) z(r, t);
691
+ }
692
+ }
693
+ function Ke(e, t) {
694
+ if (e.kind === "id") return t.push(e.name), true;
695
+ if (e.kind === "member") return Ke(e.object, t) ? (t.push(e.key), true) : false;
696
+ if (e.kind !== "index" || !Ke(e.object, t)) return false;
697
+ let n = e.index, r = n.kind === "literal" ? n.value : void 0;
698
+ return t.push(typeof r == "string" || typeof r == "number" ? r : { kind: "index", expression: n }), true;
699
+ }
700
+ function Ce(e) {
701
+ let t = Dt.get(e);
702
+ if (t !== void 0) return t;
703
+ let n = Qn(e), r = [];
704
+ return z(n, r), r.sort(), t = { source: e, ast: n, dependencies: r }, Dt.set(e, t), t;
705
+ }
706
+ function Ye(e, t) {
707
+ let n = [];
708
+ if (!(!Ke(Ce(e).ast, n) || !t.has(String(n[0])))) return n;
709
+ }
710
+ function Pt(e, t) {
711
+ return M(Ce(e).ast, t);
712
+ }
713
+ function W(e, t) {
714
+ return M("ast" in e ? e.ast : e, t);
715
+ }
716
+ function L(e) {
717
+ if (Ge(e)) return "";
718
+ if (Array.isArray(e)) {
719
+ let t = "", n = "";
720
+ for (let r of e) t += n + L(r), n = " ";
721
+ return t;
722
+ }
723
+ return typeof e == "object" ? "" : String(e);
724
+ }
725
+ function jt(e) {
726
+ return Ge(e) || e === false ? null : e === true ? "" : typeof e == "number" || typeof e == "string" ? String(e) : Array.isArray(e) ? e.map(L).join(" ") : null;
727
+ }
728
+ var tr = /* @__PURE__ */ new Set(["href", "src", "action", "formaction", "poster", "data", "xlink:href"]), nr = /* @__PURE__ */ new Set(["base", "embed", "iframe", "link", "meta", "object", "script", "style", "template"]), rr = /* @__PURE__ */ new Set(["srcdoc", "style"]);
729
+ function de(e) {
730
+ let t = e.replace(/[\u0000-\u0020\u007f]+/g, "");
731
+ return /^(?:data|javascript|vbscript):/i.test(t);
732
+ }
733
+ function ue(e) {
734
+ return tr.has(e.toLowerCase());
735
+ }
736
+ function Qe(e, t, n) {
737
+ let r = t.createElement("template");
738
+ r.innerHTML = e;
739
+ for (let i of Array.from(r.content.querySelectorAll("*"))) {
740
+ if (n?.(i), nr.has(i.localName)) {
741
+ i.remove();
742
+ continue;
743
+ }
744
+ for (let o of Array.from(i.attributes)) {
745
+ let a = o.name.toLowerCase();
746
+ (a.startsWith("on") || rr.has(a) || ue(a) && de(o.value)) && i.removeAttribute(o.name);
747
+ }
748
+ }
749
+ return r.content;
750
+ }
751
+ var ir = /^(?:if|else-if|else|for|with|value|state|computed|data)$/, or = /^(?:@|v-|#|on:|use:|transition:|animate:)/, sr = /^(?:innerhtml|outerhtml|srcdoc)$/, ar = /^(?:base|embed|link|meta|object|script|style)$/;
752
+ function Ot(e) {
753
+ return ir.test(e);
754
+ }
755
+ function Xe(e, t) {
756
+ return ar.test(e.toLowerCase()) && y("HT009", `<${e}> is not permitted in rendered component markup.`, t), e;
757
+ }
758
+ function et(e, t, n = "") {
759
+ let r = e.toLowerCase();
760
+ return (r.startsWith("on") || or.test(r)) && y("HT010", `Literal attribute \`${e}\` uses target-framework directive syntax that is not supported.`, t), r === "srcdoc" && y("HT007", "Literal `srcdoc` is not permitted in a component definition.", t), ue(r) && de(n) && y("HT007", `Literal \`${e}\` contains an executable URL.`, t), e;
761
+ }
762
+ function It(e, t) {
763
+ let n = e.toLowerCase();
764
+ return (n.startsWith("on") || sr.test(n)) && y("HT007", `Dynamic ${e} requires a future trusted-content type.`, t), e;
765
+ }
766
+ function U(e) {
767
+ return "tagName" in e;
768
+ }
769
+ function le(e) {
770
+ return e.nodeName === "#text";
771
+ }
772
+ function N(e) {
773
+ return "localName" in e ? e.localName : e.tagName;
774
+ }
775
+ function Re(e) {
776
+ return "attrs" in e ? e.attrs : e.attributes;
777
+ }
778
+ function q(e) {
779
+ return (N(e) === "template" ? e.content : void 0)?.childNodes ?? e.childNodes;
780
+ }
781
+ function ce(e) {
782
+ return "value" in e ? e.value : "nodeValue" in e ? e.nodeValue ?? "" : "";
783
+ }
784
+ function qt(e) {
785
+ let t = [];
786
+ for (let n of e) n.nodeName !== "#comment" && (!le(n) || ce(n).trim() !== "") && t.push(n);
787
+ return t;
788
+ }
789
+ function k(e, t) {
790
+ return "attrs" in e ? e.attrs.find((n) => n.name === t)?.value : e.getAttribute(t) ?? void 0;
791
+ }
792
+ function _t(e) {
793
+ let t = "";
794
+ for (let n of q(e)) le(n) && (t += ce(n));
795
+ return t;
796
+ }
797
+ function Ft(e, t) {
798
+ let n = [];
799
+ for (let r of q(e)) U(r) && N(r) === t && n.push(r);
800
+ return n;
801
+ }
802
+ function Wt(e, t) {
803
+ for (let n of q(e)) {
804
+ if (!U(n)) continue;
805
+ let r = N(n);
806
+ r === "link" && y("HL001", "External definition dependencies require the application-owned graph resolver.", t), Xe(r, t);
807
+ for (let i of Re(n)) /^on(?!:)/i.test(i.name) && et(i.name, t, i.value);
808
+ Wt(n, t);
809
+ }
810
+ }
811
+ var dr = /^\$(?:if|each|where|sort|limit|key|with|match|when|else)$/, zt = /^(?:innerhtml|outerhtml|textcontent|innertext|srcdoc)$/, ur = /^\s*([A-Za-z_$][\w$]*)\s*(?:,\s*([A-Za-z_$][\w$]*)\s*)?\bof\b\s*(.+)$/, Ut = /^\s*(.+?)\s+\bas\b\s+([A-Za-z_$][\w$]*)\s*$/, tt = /^[a-z][a-z0-9-]*$/, lr = /^(?:prevent|stop|self|once|passive|capture|left|middle|right|ctrl|shift|alt|meta|exact|enter|escape|space|tab|up|down)$/, it = /^[A-Za-z_$][A-Za-z0-9_$-]*$/;
812
+ function nt(e, ...t) {
813
+ let n = new Set(e.roots);
814
+ for (let r of t) r !== void 0 && n.add(r);
815
+ return { roots: n, writableRoots: e.writableRoots, handlers: e.handlers };
816
+ }
817
+ function R(e, t, n) {
818
+ let r = yr(e, n);
819
+ return cr(r, t, n), r;
820
+ }
821
+ function cr(e, t, n) {
822
+ for (let r of e.dependencies) {
823
+ let i = r.split(".", 1)[0];
824
+ t.roots.has(i) || y("HT003", `Expression root \`${i}\` is not declared in this scope.`, n);
825
+ }
826
+ }
827
+ function fr(e, t, n) {
828
+ let r = /* @__PURE__ */ Object.create(null), i = (a, s) => {
829
+ let d = r[a];
830
+ d !== void 0 && ("attribute" in d ? !("attribute" in s) || d.attribute !== s.attribute : !("property" in s) || d.property !== s.property) && y("HT004", `Prop \`${a}\` is bound to conflicting targets.`, t), r[a] = s;
831
+ }, o = (a) => {
832
+ for (let s of Re(a)) if (s.name.startsWith(":")) /^[A-Za-z][A-Za-z0-9_-]*$/.test(s.value) && i(s.value, { attribute: s.name.slice(1).toLowerCase() });
833
+ else if (s.name.startsWith(".")) {
834
+ let d = s.name.slice(1).toLowerCase();
835
+ if (/^[A-Za-z][A-Za-z0-9_-]*$/.test(s.value)) {
836
+ let u = n.resolveDomProperty(N(a), d) ?? (s.value.toLowerCase() === d ? s.value : d);
837
+ i(s.value, { property: u });
838
+ }
839
+ }
840
+ for (let s of q(a)) U(s) && N(s) !== "slot" && o(s);
841
+ };
842
+ return o(e), r;
843
+ }
844
+ function pr(e, t, n, r = true) {
845
+ let i = /* @__PURE__ */ Object.create(null), o = /* @__PURE__ */ Object.create(null);
846
+ if (e === void 0) return i;
847
+ let a = Ft(e, "prop");
848
+ a.sort((s, d) => {
849
+ let u = k(s, "name") ?? "", c = k(d, "name") ?? "";
850
+ return u < c ? -1 : u > c ? 1 : 0;
851
+ });
852
+ for (let s of a) {
853
+ let d = k(s, "name");
854
+ (d === void 0 || d === "") && y("HC010", "A <prop> requires a `name` attribute.", n), /^[A-Za-z][A-Za-z0-9_-]*$/.test(d) || y("HC010", `Invalid prop name \`${d}\`.`, n);
855
+ let u = k(s, "type");
856
+ (u === void 0 || u === "") && y("HC013", `Prop \`${d}\` requires a \`type\` attribute.`, n);
857
+ let c = d.toLowerCase(), l = o[c];
858
+ l !== void 0 && y("HC011", `Props \`${l}\` and \`${d}\` collide after lowercase normalization.`, n), o[c] = d;
859
+ let m = t[d];
860
+ m === void 0 && r && y("HC018", `Prop \`${d}\` is declared but never bound in the markup.`, n), m ??= { attribute: d.toLowerCase() };
861
+ let f = Vt(u), p = k(s, "required") !== void 0, h = _t(s).trim();
862
+ h === "" && y("HC003", `\`props.${d}.description\` must be a non-empty string.`, n), "attribute" in m && G(f) && y("HC017", `Prop \`${d}\` uses a property-only type and must target a DOM property.`, n);
863
+ let v = k(s, "default");
864
+ p && v !== void 0 && y("HC019", `Required prop \`${d}\` cannot also declare a default.`, n);
865
+ let S = { type: f, required: p, target: m, description: h };
866
+ if (v !== void 0) {
867
+ let w = j(v, f);
868
+ w.ok || y("HC015", `Default for prop \`${d}\` does not satisfy its type.`, n), S.default = w.value;
869
+ }
870
+ i[d] = S;
871
+ }
872
+ return i;
873
+ }
874
+ function mr(e, t, n, r, i, o, a) {
875
+ let s = k(e, "component") ?? "";
876
+ s.trim() === "" && y("HC003", "`component` must be a non-empty string.", o), /^[a-z][a-z0-9]*(?:-[a-z0-9]+)+$/.test(s) || y("HC005", "The `component` tag must be lowercase and contain a hyphen.", o);
877
+ let d = k(e, "status") ?? "";
878
+ /^(?:early|experimental|stable|deprecated)$/.test(d) || y("HC007", "Component `status` is not recognized.", o);
879
+ let u = k(e, "summary") ?? "";
880
+ return u.trim() === "" && y("HC003", "`summary` must be a non-empty string.", o), (!/^[a-z][a-z0-9-]*$/.test(n) || r && !/^[a-z][a-z0-9]*(?:-[a-z0-9]+)+$/.test(n)) && y("HC008", "`nativeElement` must be a lowercase HTML element or component tag.", o), { version: 1, name: Nt(s), tag: s, status: d, summary: u, nativeElement: n, props: pr(t, i, o, a) };
881
+ }
882
+ function yr(e, t) {
883
+ try {
884
+ return Ce(e);
885
+ } catch {
886
+ y("HT013", `Malformed expression \`${e}\`.`, t);
887
+ }
888
+ }
889
+ function hr(e, t, n) {
890
+ let r = [];
891
+ for (let i of qt(q(e))) {
892
+ U(i) || y("HC023", "Handler bodies contain declarative step elements only.", n);
893
+ let o = k(i, "$if"), a = o === void 0 ? void 0 : R(o, t, n);
894
+ if (N(i) === "set") {
895
+ let s = k(i, "name") ?? "", d = k(i, ":value"), u = k(i, "value");
896
+ (s === "" || d === void 0 == (u === void 0)) && y("HC023", "A <set> requires `name` and exactly one of `value` or `:value`.", n), R(s, t, n);
897
+ let c = Ye(s, t.writableRoots);
898
+ c === void 0 && y("HT005", `Handler write \`${s}\` is not rooted in declared state.`, n);
899
+ let l = { kind: "set", path: s, writablePath: c, value: R(d ?? JSON.stringify(u), t, n) };
900
+ a !== void 0 && (l.guard = a), r.push(l);
901
+ continue;
902
+ }
903
+ if (N(i) === "dispatch") {
904
+ let s = k(i, "event") ?? "";
905
+ tt.test(s) || y("HC023", "A <dispatch> requires a valid `event` name.", n);
906
+ let d = k(i, ":value"), u = k(i, "value");
907
+ d !== void 0 && u !== void 0 && y("HC023", "A <dispatch> may declare only one of `value` or `:value`.", n);
908
+ let c = d === void 0 && u === void 0 ? void 0 : R(d ?? JSON.stringify(u), t, n), l = { kind: "dispatch", event: s };
909
+ c !== void 0 && (l.value = c), a !== void 0 && (l.guard = a), r.push(l);
910
+ continue;
911
+ }
912
+ if (N(i) === "validate" || N(i) === "focus") {
913
+ let s = k(i, "target") ?? k(i, "ref") ?? k(i, "name") ?? "";
914
+ it.test(s) || y("HC023", `<${N(i)}> requires a valid target reference.`, n);
915
+ let d = { kind: N(i), target: s };
916
+ a !== void 0 && (d.guard = a), r.push(d);
917
+ continue;
918
+ }
919
+ y("HC023", `<${N(i)}> is not a recognized handler step.`, n);
920
+ }
921
+ return r;
922
+ }
923
+ function gr(e, t, n) {
924
+ let r = [], i = new Set(Object.keys(t.props)), o = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Set();
925
+ if (e === void 0) return { declarations: r, scope: { roots: i, writableRoots: o, handlers: a } };
926
+ let s = [], d = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Set();
927
+ for (let l of q(e)) {
928
+ if (!U(l)) continue;
929
+ let m = l;
930
+ s.push(m);
931
+ let f = N(m);
932
+ /^(?:prop|state|computed|data|handler|event|method)$/.test(f) || y("HC021", `<${f}> is not a recognized definition declaration.`, n);
933
+ let p = k(m, "name") ?? "";
934
+ if (p === "" && y("HC010", `A <${f}> requires a \`name\` attribute.`, n), f === "event") {
935
+ u.has(p) && y("HC020", `Event \`${p}\` is declared more than once.`, n), u.add(p);
936
+ continue;
937
+ }
938
+ d.has(p) && y("HC020", `Declaration \`${p}\` collides in the flat component scope.`, n), d.add(p), i.add(p), f === "state" ? o.add(p) : f === "handler" && a.add(p);
939
+ }
940
+ let c = { roots: i, writableRoots: o, handlers: a };
941
+ for (let l of s) {
942
+ let m = N(l);
943
+ if (m === "prop") continue;
944
+ let f = k(l, "name");
945
+ if (m === "state") {
946
+ let p = k(l, ":value"), h = k(l, "value");
947
+ p !== void 0 && h !== void 0 && y("HC013", `<state name="${f}"> may declare only one of \`value\` or \`:value\`.`, n);
948
+ let v = p === void 0 && h === void 0 ? void 0 : R(p ?? JSON.stringify(h), c, n), S = { kind: m, name: f };
949
+ h !== void 0 && (S.value = h), v !== void 0 && (S.expression = v), r.push(S);
950
+ continue;
951
+ }
952
+ if (m === "computed") {
953
+ let p = k(l, "from");
954
+ (p === void 0 || p === "") && y("HC013", `<computed name="${f}"> requires a \`from\` expression.`, n), r.push({ kind: m, name: f, expression: R(p, c, n) });
955
+ continue;
956
+ }
957
+ if (m === "data") {
958
+ let p = k(l, "src"), h = k(l, "type"), v = k(l, "schema"), S = k(l, "debounce"), w = k(l, "poll"), g = [], b = /* @__PURE__ */ new Set();
959
+ for (let A of Ft(l, "param")) {
960
+ let P = k(A, "name") ?? "", H = k(A, ":value");
961
+ (!it.test(P) || H === void 0) && y("HC024", "A data <param> requires a valid `name` and a `:value` expression.", n), b.has(P) && y("HC024", `Data source \`${f}\` repeats a parameter name.`, n), b.add(P), g.push({ name: P, expression: R(H, c, n) });
962
+ }
963
+ let E = { kind: m, name: f, parameters: g };
964
+ p !== void 0 && (E.source = p), h !== void 0 && (E.type = h), v !== void 0 && (E.schema = v), S !== void 0 && (E.debounce = S), w !== void 0 && (E.poll = w), r.push(E);
965
+ continue;
966
+ }
967
+ if (m === "event") {
968
+ r.push({ kind: m, name: f, type: k(l, "type") ?? "object", bubbles: k(l, "bubbles") !== "false", composed: k(l, "composed") !== "false", cancelable: k(l, "cancelable") === "true" });
969
+ continue;
970
+ }
971
+ if (m === "method") {
972
+ r.push({ kind: m, name: f, exportName: k(l, "export") ?? f, returns: k(l, "returns") ?? "undefined" });
973
+ continue;
974
+ }
975
+ r.push({ kind: "handler", name: f, steps: hr(l, c, n) });
976
+ }
977
+ for (let l of r) if (l.kind === "handler") for (let m of l.steps) m.kind === "dispatch" && !u.has(m.event) && y("HC023", `Handler \`${l.name}\` dispatches undeclared component event \`${m.event}\`.`, n);
978
+ return { declarations: r, scope: c };
979
+ }
980
+ function br(e, t, n, r, i, o) {
981
+ let a = [];
982
+ for (let s of e) {
983
+ if (s.name.startsWith("bind:")) {
984
+ let d = s.name.slice(5).toLowerCase();
985
+ (d === "" || zt.test(d)) && y("HT007", `Two-way binding cannot target \`${d || s.name}\`.`, i);
986
+ let u = R(s.value, r, i), c = Ye(s.value, r.writableRoots);
987
+ c === void 0 && y("HT005", `\`${s.value}\` is not a writable state-rooted path.`, i), a.push({ kind: "attribute", name: d, expression: s.value, expressionPlan: u, twoWay: true, writablePath: c });
988
+ continue;
989
+ }
990
+ if (s.name.startsWith("class:") || s.name.startsWith("style:")) {
991
+ let d = s.name.startsWith("class:") ? "class" : "style", u = s.name.slice(d.length + 1);
992
+ (d === "class" ? u !== "" && !/\s/.test(u) : /^(?:--[a-z0-9_-]+|[a-z][a-z0-9-]*)$/.test(u)) || y("HT020", `\`${s.name}\` does not name a valid ${d} binding target.`, i), a.push({ kind: "attribute", name: u, expression: s.value, expressionPlan: R(s.value, r, i), target: d });
993
+ continue;
994
+ }
995
+ if (s.name.startsWith("$")) {
996
+ let d = s.name.slice(1).toLowerCase();
997
+ d !== "value" && d !== "html" && y("HT012", `\`$${d}\` is not a known content directive.`, i), a.push({ kind: "directive", name: d, expression: s.value, expressionPlan: R(s.value, r, i) });
998
+ continue;
999
+ }
1000
+ if (s.name.startsWith(":")) {
1001
+ let d = s.name.slice(1).toLowerCase();
1002
+ zt.test(d) && y("HT007", `\`:${d}\` cannot bind a raw content sink.`, i);
1003
+ let u = R(s.value, r, i), c = n.props[s.value];
1004
+ c !== void 0 && (!("attribute" in c.target) || c.target.attribute !== d) && y("HT004", `Binding \`:${d}\` does not match prop \`${s.value}\`'s target.`, i), a.push({ kind: "attribute", name: d, expression: s.value, expressionPlan: u });
1005
+ continue;
1006
+ }
1007
+ if (s.name.startsWith(".")) {
1008
+ let d = s.name.slice(1).toLowerCase(), u = R(s.value, r, i), c = n.props[s.value];
1009
+ c !== void 0 && (!("property" in c.target) || c.target.property.toLowerCase() !== d) && y("HT004", `Property binding \`.${d}\` does not match prop \`${s.value}\`'s target.`, i);
1010
+ let l = o.resolveDomProperty(t, d) ?? (c !== void 0 && "property" in c.target ? c.target.property : void 0);
1011
+ l === void 0 && y("HP001", `\`${d}\` is not a known property of <${t}>.`, i), It(l, i), a.push({ kind: "property", key: d, name: l, expression: s.value, expressionPlan: u });
1012
+ continue;
1013
+ }
1014
+ et(s.name, i, s.value), a.push({ kind: "literal", name: s.name, value: s.value });
1015
+ }
1016
+ return a;
1017
+ }
1018
+ function vr(e, t, n) {
1019
+ if (e === void 0) return;
1020
+ let r = [];
1021
+ for (let i of e) {
1022
+ let [o = "", ...a] = i.name.slice(3).split(".");
1023
+ (!tt.test(o) || a.some((s) => !tt.test(s))) && y("HT010", `\`${i.name}\` is not a valid declarative event binding.`, n);
1024
+ for (let s = 0; s < a.length; s += 1) {
1025
+ let d = a[s];
1026
+ a.indexOf(d) !== s && y("HT010", `\`${i.name}\` repeats an event modifier.`, n), lr.test(d) || y("HT010", `\`${i.name}\` contains an unsupported event modifier.`, n);
1027
+ }
1028
+ a.includes("passive") && a.includes("prevent") && y("HT010", `\`${i.name}\` cannot combine passive and prevent.`, n), t.handlers.has(i.value) || y("HT010", `Event binding \`${i.name}\` names undeclared handler \`${i.value}\`.`, n), r.push({ name: o, handler: i.value, modifiers: a });
1029
+ }
1030
+ return r;
1031
+ }
1032
+ function kr(e, t, n) {
1033
+ if (e !== void 0) return it.test(e) || y("HT019", "`$ref` requires a valid non-empty name.", n), t.has(e) && y("HT019", `Reference \`${e}\` is duplicated.`, n), t.add(e), e;
1034
+ }
1035
+ function wr(e, t, n) {
1036
+ if (e === void 0) return;
1037
+ let r = [], i = [];
1038
+ e.$if !== void 0 && r.push("$if"), e.$each !== void 0 && r.push("$each"), e.$with !== void 0 && r.push("$with"), e.$match !== void 0 && r.push("$match"), e.$when !== void 0 && r.push("$when"), e.$else !== void 0 && r.push("$else"), e.$where !== void 0 && i.push("$where"), e.$sort !== void 0 && i.push("$sort"), e.$limit !== void 0 && i.push("$limit"), e.$key !== void 0 && i.push("$key"), r.length > 1 && y("HT014", `An element carries one structural directive; found ${r.join(", ")}.`, n);
1039
+ let o = e.$each;
1040
+ o === void 0 && i.length > 0 && y("HT014", `${i.join(", ")} may only modify \`$each\`.`, n);
1041
+ let a = e.$if;
1042
+ if (a !== void 0) {
1043
+ let c = a;
1044
+ return { kind: "if", test: c, testPlan: R(c, t, n) };
1045
+ }
1046
+ let s = e.$with;
1047
+ if (s !== void 0) {
1048
+ let c = Ut.exec(s);
1049
+ return c === null && y("HT015", "`$with` must be written `expr as name`.", n), { kind: "with", expr: c[1], expressionPlan: R(c[1], t, n), alias: c[2] };
1050
+ }
1051
+ if (o !== void 0) {
1052
+ let c = ur.exec(o);
1053
+ c === null && y("HT016", "`$each` must be written `item of items` (optionally `item, i of items`).", n);
1054
+ let l = c[1], m = c[2];
1055
+ (t.roots.has(l) || m !== void 0 && t.roots.has(m)) && y("HC020", "Loop locals may not collide with an existing scope name.", n);
1056
+ let f = nt(t, l, m, "loop"), p = { kind: "each", item: l, list: c[3], listPlan: R(c[3], t, n) };
1057
+ m !== void 0 && (p.index = m);
1058
+ let h = e.$where;
1059
+ h !== void 0 && (p.where = h, p.wherePlan = R(h, f, n)), e.$sort !== void 0 && (p.sort = e.$sort);
1060
+ let v = e.$limit;
1061
+ v !== void 0 && (p.limit = v, p.limitPlan = R(v, f, n));
1062
+ let S = e.$key;
1063
+ return S !== void 0 && (p.key = S, p.keyPlan = R(S, f, n)), p;
1064
+ }
1065
+ let d = e.$match;
1066
+ if (d !== void 0) {
1067
+ let c = d.trim();
1068
+ if (c === "") return { kind: "match" };
1069
+ let l = Ut.exec(c);
1070
+ return l === null && y("HT017", "`$match` scope must be written `expr as name`.", n), { kind: "match", expr: l[1], expressionPlan: R(l[1], t, n), alias: l[2] };
1071
+ }
1072
+ let u = e.$when;
1073
+ if (u !== void 0) {
1074
+ let c = u;
1075
+ return { kind: "when", test: c, testPlan: R(c, t, n) };
1076
+ }
1077
+ if (e.$else !== void 0) return { kind: "else" };
1078
+ }
1079
+ function rt(e, t, n, r, i, o) {
1080
+ let a = N(e);
1081
+ Ot(a) && y("HT009", `<${a}> is reserved but not supported by this profile.`, r), Xe(a, r);
1082
+ let s, d = [], u, c;
1083
+ for (let g of Re(e)) dr.test(g.name) ? (s ??= {})[g.name] = g.value : g.name === "$ref" ? c = g.value : g.name.startsWith("on:") ? (u ??= []).push(g) : g.name !== "as" && d.push(g);
1084
+ let l = wr(s, n, r), m = l?.kind === "each" ? nt(n, l.item, l.index, "loop") : l?.kind === "with" || l?.kind === "match" && l.alias !== void 0 ? nt(n, l.alias) : n, f = br(d, a, t, m, r, o), p = vr(u, m, r), h = kr(c, i.refs, r), v = [], S = q(e);
1085
+ for (let g of S) if (g.nodeName !== "#comment") {
1086
+ if (le(g)) {
1087
+ let b = ce(g);
1088
+ b.trim() !== "" && v.push({ kind: "text", value: b });
1089
+ continue;
1090
+ }
1091
+ if (U(g)) {
1092
+ if (N(g) === "slot") {
1093
+ let b = k(g, "name"), E = k(g, ":name");
1094
+ b !== void 0 && E !== void 0 && y("HT008", "A slot cannot declare both `name` and `:name`.", r);
1095
+ for (let V of Re(g)) V.name !== "name" && V.name !== ":name" && y("HT008", "A slot has an unsupported attribute.", r);
1096
+ b === void 0 && E === void 0 && (i.defaults += 1, i.defaults > 1 && y("HT008", "A component may declare one default slot.", r)), b !== void 0 && ((b === "" || i.names.has(b)) && y("HT008", `Slot name \`${b}\` is empty or duplicated.`, r), i.names.add(b));
1097
+ let A = [];
1098
+ for (let V of q(g)) if (V.nodeName !== "#comment") if (le(V)) {
1099
+ let we = ce(V);
1100
+ we.trim() !== "" && A.push({ kind: "text", value: we });
1101
+ } else U(V) && A.push(rt(V, t, m, r, i, o));
1102
+ let H = { dynamic: E !== void 0, required: A.length === 0 };
1103
+ if (b !== void 0 && (H.name = b), i.contracts.push(H), b === void 0 && E === void 0 && A.length === 0) v.push({ kind: "slot" });
1104
+ else {
1105
+ let V = { kind: "slot", fallback: A };
1106
+ b !== void 0 && (V.name = b), E !== void 0 && (V.nameExpression = R(E, m, r)), v.push(V);
1107
+ }
1108
+ continue;
1109
+ }
1110
+ v.push(rt(g, t, m, r, i, o));
1111
+ }
1112
+ }
1113
+ if (f.some((g) => g.kind === "directive") && v.length > 0 && y("HT006", "A content directive cannot coexist with children.", r), f.some((g) => g.kind === "property" && g.name === "textContent") && v.length > 0 && y("HT006", "A content-replacing property binding cannot coexist with children.", r), l?.kind === "match") {
1114
+ let g = 0;
1115
+ for (let E of v) E.kind === "element" && (g += 1);
1116
+ let b = false;
1117
+ for (let E of v) E.kind === "element" && (g -= 1, E.flow?.kind === "when" ? b && y("HT018", "A `$when` arm may not follow `$else`.", r) : E.flow?.kind === "else" ? (b && y("HT018", "A `$match` has at most one `$else`.", r), b = true, g !== 0 && y("HT018", "`$else` must be the last arm.", r)) : y("HT018", "Every direct child of a `$match` must be a `$when` or `$else` arm.", r));
1118
+ }
1119
+ let w = { kind: "element", name: a, attributes: f, children: v };
1120
+ return l !== void 0 && (w.flow = l), p !== void 0 && (w.events = p), h !== void 0 && (w.ref = h), w;
1121
+ }
1122
+ function Bt(e, t, n) {
1123
+ let r = qt(e);
1124
+ (r.length !== 1 || !U(r[0]) || N(r[0]) !== "template" || k(r[0], "component") === void 0) && y("HS001", "A source must contain exactly one top-level <template component>.", t);
1125
+ let i = r[0], o, a = false, s, d;
1126
+ for (let b of q(i)) {
1127
+ if (b.nodeName === "#comment" || le(b) && ce(b).trim() === "") continue;
1128
+ U(b) || y("HT001", "A component's markup must be exactly one element root.", t);
1129
+ let E = N(b);
1130
+ E === "props" || E === "defs" ? (o !== void 0 && y("HS002", "A component has one optional declaration group, one markup root, and one optional <style>.", t), o = b, a = E === "props", Wt(b, t)) : E === "style" ? (s !== void 0 && y("HS002", "A component has one optional declaration group, one markup root, and one optional <style>.", t), s = b) : d === void 0 ? d = b : y("HT001", "A component's markup must be exactly one element root.", t);
1131
+ }
1132
+ d === void 0 && y("HT001", "A component's markup must be exactly one element root.", t);
1133
+ let u = N(d), c = (k(d, "as") ?? u).split("|");
1134
+ for (let b = c.length - 1; b >= 0; b -= 1) c[b] = c[b].trim(), c[b] === "" && c.splice(b, 1);
1135
+ let l = !n.isNativeElement(u);
1136
+ l && k(d, "as") !== void 0 && y("HT021", "A delegated component root cannot also declare native `as` choices.", t), !l && (c.length === 0 || !c.includes(u) || c.some((b, E) => c.indexOf(b) !== E) || c.some((b) => !n.isNativeElement(b))) && y("HT021", "A polymorphic root must list unique native choices including its markup root.", t);
1137
+ let m = fr(d, t, n), f = mr(i, o, u, l, m, t, a), { declarations: p, scope: h } = gr(a ? void 0 : o, f, t), v = { defaults: 0, names: /* @__PURE__ */ new Set(), contracts: [], refs: /* @__PURE__ */ new Set() }, S = rt(d, f, h, t, v, n), w = k(i, "controller");
1138
+ w === "" && y("HC022", "A controller specifier cannot be empty.", t);
1139
+ let g = { source: { file: t }, contract: f, template: S, css: s === void 0 ? "" : _t(s).trim(), declarations: p, slots: v.contracts, root: l ? { kind: "component", tag: u } : { kind: "native", element: u, choices: c } };
1140
+ return w !== void 0 && (g.controller = w), oe(g);
1141
+ }
1142
+ var Zt = /* @__PURE__ */ new WeakMap();
1143
+ function Er(e) {
1144
+ let t = {}, n = {}, r = (i) => {
1145
+ if (i.includes("-")) return false;
1146
+ if (Object.hasOwn(t, i)) return t[i];
1147
+ let o = e.createElement(i), a = e.defaultView?.HTMLUnknownElement, s = a === void 0 ? o.constructor.name !== "HTMLUnknownElement" : !(o instanceof a);
1148
+ return t[i] = s, s;
1149
+ };
1150
+ return { isNativeElement: r, resolveDomProperty(i, o) {
1151
+ if (!r(i)) return;
1152
+ let a = `${i}:${o}`;
1153
+ if (a in n) return n[a] || void 0;
1154
+ let s = e.createElement(i), d = o.toLowerCase();
1155
+ for (; s !== null; ) {
1156
+ for (let u of Object.getOwnPropertyNames(s)) if (u.toLowerCase() === d) return n[a] = u, u;
1157
+ s = Object.getPrototypeOf(s);
1158
+ }
1159
+ n[a] = "";
1160
+ } };
1161
+ }
1162
+ function Jt(e, t = e.ownerDocument.URL) {
1163
+ (e.localName !== "template" || !e.hasAttribute("component")) && y("HS001", "A browser component carrier must be a <template component>.", t);
1164
+ let n = e.ownerDocument, r = Zt.get(n);
1165
+ return r === void 0 && (r = Er(n), Zt.set(n, r)), Bt([e], t, r);
1166
+ }
1167
+ function ot(e, t) {
1168
+ if (Object.is(e, t)) return true;
1169
+ try {
1170
+ return JSON.stringify(e) === JSON.stringify(t);
1171
+ } catch {
1172
+ return false;
1173
+ }
1174
+ }
1175
+ function xr(e, t) {
1176
+ return t === "null" ? e === null : t === "array" ? Array.isArray(e) : t === "object" ? e !== null && typeof e == "object" && !Array.isArray(e) : t === "integer" ? typeof e == "number" && Number.isFinite(e) && Number.isInteger(e) : t === "number" ? typeof e == "number" && Number.isFinite(e) : typeof e === t;
1177
+ }
1178
+ function Sr(e, t) {
1179
+ if (t === "#") return e;
1180
+ if (!t.startsWith("#/")) return;
1181
+ let n = e;
1182
+ for (let r of t.slice(2).split("/")) {
1183
+ let i = r.replace(/~1/g, "/").replace(/~0/g, "~");
1184
+ if (n === null || typeof n != "object") return;
1185
+ n = n[i];
1186
+ }
1187
+ return typeof n == "boolean" || n !== null && typeof n == "object" ? n : void 0;
1188
+ }
1189
+ function C(e, t) {
1190
+ return { reason: "schemaMismatch", path: e, message: t };
1191
+ }
1192
+ function _(e, t, n, r, i) {
1193
+ if (t === true) return [];
1194
+ if (t === false) return [C(r, "The schema rejects every value.")];
1195
+ let o = typeof t.$ref == "string" ? t.$ref : void 0;
1196
+ if (o !== void 0) {
1197
+ if (i.has(o)) return [];
1198
+ let l = Sr(n, o);
1199
+ if (l === void 0) return [C(r, `Schema reference \`${o}\` cannot be resolved.`)];
1200
+ let m = new Set(i);
1201
+ return m.add(o), _(e, l, n, r, m);
1202
+ }
1203
+ if (Array.isArray(t.enum) && !t.enum.some((l) => ot(e, l))) return [C(r, "Value is not one of the schema's allowed values.")];
1204
+ if ("const" in t && !ot(e, t.const)) return [C(r, "Value does not equal the schema's required constant.")];
1205
+ let a = typeof t.type == "string" ? [t.type] : Array.isArray(t.type) ? t.type.filter((l) => typeof l == "string") : [];
1206
+ if (a.length > 0 && !a.some((l) => xr(e, l))) return [C(r, `Expected ${a.join(" or ")}.`)];
1207
+ let d = (Array.isArray(t.allOf) ? t.allOf : []).flatMap((l) => _(e, l, n, r, i)), u = Array.isArray(t.anyOf) ? t.anyOf : [];
1208
+ u.length > 0 && !u.some((l) => _(e, l, n, r, i).length === 0) && d.push(C(r, "Value does not satisfy any allowed schema branch."));
1209
+ let c = Array.isArray(t.oneOf) ? t.oneOf : [];
1210
+ if (c.length > 0 && c.filter((l) => _(e, l, n, r, i).length === 0).length !== 1 && d.push(C(r, "Value must satisfy exactly one schema branch.")), (typeof t.not == "boolean" || t.not !== null && typeof t.not == "object") && _(e, t.not, n, r, i).length === 0 && d.push(C(r, "Value satisfies a schema branch that is forbidden.")), typeof e == "string") {
1211
+ let l = Array.from(e).length;
1212
+ if (typeof t.minLength == "number" && l < t.minLength && d.push(C(r, `Use at least ${t.minLength} characters.`)), typeof t.maxLength == "number" && l > t.maxLength && d.push(C(r, `Use no more than ${t.maxLength} characters.`)), typeof t.pattern == "string") try {
1213
+ new RegExp(t.pattern, "u").test(e) || d.push(C(r, "Value does not match the schema pattern."));
1214
+ } catch {
1215
+ d.push(C(r, "The schema pattern is invalid."));
1216
+ }
1217
+ if (t.format === "email" && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/u.test(e) && d.push(C(r, "Value is not an email address.")), t.format === "uri" || t.format === "url") try {
1218
+ new URL(e);
1219
+ } catch {
1220
+ d.push(C(r, "Value is not an absolute URL."));
1221
+ }
1222
+ }
1223
+ if (typeof e == "number" && Number.isFinite(e) && (typeof t.minimum == "number" && e < t.minimum && d.push(C(r, `Value must be at least ${t.minimum}.`)), typeof t.maximum == "number" && e > t.maximum && d.push(C(r, `Value must be at most ${t.maximum}.`)), typeof t.exclusiveMinimum == "number" && e <= t.exclusiveMinimum && d.push(C(r, `Value must be greater than ${t.exclusiveMinimum}.`)), typeof t.exclusiveMaximum == "number" && e >= t.exclusiveMaximum && d.push(C(r, `Value must be less than ${t.exclusiveMaximum}.`)), typeof t.multipleOf == "number" && t.multipleOf > 0)) {
1224
+ let l = e / t.multipleOf;
1225
+ Math.abs(l - Math.round(l)) > 1e-9 && d.push(C(r, `Value must be a multiple of ${t.multipleOf}.`));
1226
+ }
1227
+ if (Array.isArray(e) && (typeof t.minItems == "number" && e.length < t.minItems && d.push(C(r, `Use at least ${t.minItems} items.`)), typeof t.maxItems == "number" && e.length > t.maxItems && d.push(C(r, `Use no more than ${t.maxItems} items.`)), t.uniqueItems === true && e.some((l, m) => e.slice(0, m).some((f) => ot(f, l))) && d.push(C(r, "Array items must be unique.")), (typeof t.items == "boolean" || t.items !== null && typeof t.items == "object") && e.forEach((l, m) => d.push(..._(l, t.items, n, O(r, m), i)))), e !== null && typeof e == "object" && !Array.isArray(e)) {
1228
+ let l = e, m = Array.isArray(t.required) ? t.required.filter((p) => typeof p == "string") : [];
1229
+ for (let p of m) p in l || d.push(C(O(r, p), "Required field is absent."));
1230
+ let f = t.properties !== null && typeof t.properties == "object" ? t.properties : {};
1231
+ for (let [p, h] of Object.entries(f)) p in l && d.push(..._(l[p], h, n, O(r, p), i));
1232
+ for (let [p, h] of Object.entries(l)) p in f || (t.additionalProperties === false ? d.push(C(O(r, p), "Field is not allowed by the schema.")) : t.additionalProperties !== void 0 && t.additionalProperties !== true && d.push(..._(h, t.additionalProperties, n, O(r, p), i)));
1233
+ }
1234
+ return d;
1235
+ }
1236
+ function Kt(e, t, n = "$") {
1237
+ return Object.freeze(_(e, t, t, n, /* @__PURE__ */ new Set()));
1238
+ }
1239
+ var Ne = class extends TypeError {
1240
+ constructor(n) {
1241
+ super(n.map((r) => `${r.path}: ${r.message}`).join("; "));
1242
+ this.issues = n;
1243
+ this.name = "DataValidationError";
1244
+ }
1245
+ issues;
1246
+ };
1247
+ function Tr(e, t, n) {
1248
+ let r = /* @__PURE__ */ new Set(), i = e.replace(/\{([A-Za-z_$][A-Za-z0-9_$-]*)\}/g, (a, s) => {
1249
+ r.add(s);
1250
+ let d = n[s];
1251
+ return d == null ? "" : encodeURIComponent(String(d));
1252
+ }), o = new URL(i, t);
1253
+ for (let [a, s] of Object.entries(n)) if (!(r.has(a) || s == null)) if (Array.isArray(s)) for (let d of s) o.searchParams.append(a, String(d));
1254
+ else o.searchParams.set(a, String(s));
1255
+ return o.href;
1256
+ }
1257
+ var $e = class {
1258
+ constructor(t) {
1259
+ this.options = t;
1260
+ this.#e = t.fetch ?? globalThis.fetch.bind(globalThis), this.#t = t.setTimer ?? ((n, r) => setTimeout(n, r)), this.#n = t.clearTimer ?? ((n) => clearTimeout(n));
1261
+ }
1262
+ options;
1263
+ #e;
1264
+ #t;
1265
+ #n;
1266
+ #i = {};
1267
+ #u;
1268
+ #d;
1269
+ #l;
1270
+ #o = 0;
1271
+ #r = false;
1272
+ update(t) {
1273
+ this.#i = { ...t }, this.#r = true, this.#a();
1274
+ let n = ++this.#o, r = () => {
1275
+ this.#s(n);
1276
+ };
1277
+ (this.options.debounce ?? 0) > 0 ? this.#d = this.#t(r, this.options.debounce) : r();
1278
+ }
1279
+ disconnect() {
1280
+ this.#r && (this.#r = false, this.#o += 1, this.#a());
1281
+ }
1282
+ #a() {
1283
+ this.#u?.abort(), this.#u = void 0, this.#d !== void 0 && this.#n(this.#d), this.#d = void 0;
1284
+ }
1285
+ async #s(t) {
1286
+ if (!this.#r || t !== this.#o) return;
1287
+ let n = new AbortController();
1288
+ this.#u = n;
1289
+ let r = this.options;
1290
+ r.onState({ pending: true, value: null, error: null, ok: false });
1291
+ try {
1292
+ let i = await this.#e(Tr(r.source, r.baseURL, this.#i), { signal: n.signal });
1293
+ if (!i.ok) throw new TypeError(`Request failed with ${i.status}.`);
1294
+ let o = r.schemaURL === void 0 ? void 0 : this.#l ?? await this.#c(r.schemaURL, n.signal), a = r.type === "text" ? await i.text() : await i.json(), s;
1295
+ if (r.validate !== void 0) s = r.validate(a);
1296
+ else if (r.schema !== void 0) {
1297
+ let d = typeof r.schema == "string" ? F(r.schema) : r.schema, u = j(a, d);
1298
+ if (!u.ok) throw new Ne(u.issues);
1299
+ s = u.value;
1300
+ } else if (o !== void 0) {
1301
+ let d = Kt(a, o);
1302
+ if (d.length > 0) throw new Ne(d);
1303
+ s = a;
1304
+ } else s = a;
1305
+ if (!this.#r || t !== this.#o) return;
1306
+ r.onState({ pending: false, value: s, error: null, ok: true });
1307
+ } catch (i) {
1308
+ if (n.signal.aborted || !this.#r || t !== this.#o) return;
1309
+ r.onState({ pending: false, value: null, error: i, ok: false });
1310
+ } finally {
1311
+ this.#u === n && (this.#u = void 0), this.#r && t === this.#o && (r.poll ?? 0) > 0 && (this.#d = this.#t(() => {
1312
+ this.#s(t);
1313
+ }, r.poll));
1314
+ }
1315
+ }
1316
+ async #c(t, n) {
1317
+ let r = await this.#e(new URL(t, this.options.baseURL), { signal: n });
1318
+ if (!r.ok) throw new TypeError(`Schema request failed with ${r.status}.`);
1319
+ let i = await r.json();
1320
+ if (typeof i != "boolean" && (i === null || typeof i != "object" || Array.isArray(i))) throw new TypeError("A JSON Schema resource must contain a boolean or object schema.");
1321
+ return this.#l = i, this.#l;
1322
+ }
1323
+ };
1324
+ var B, Cr = 0, Rr = 100, st = /* @__PURE__ */ new WeakMap(), Ae = /* @__PURE__ */ new WeakMap();
1325
+ function Gt(e) {
1326
+ let { dependency: t, previousSubscriber: n, nextSubscriber: r } = e;
1327
+ n === void 0 ? t.first = r : n.nextSubscriber = r, r === void 0 ? t.last = n : r.previousSubscriber = n;
1328
+ }
1329
+ var dt = class {
1330
+ #e = [];
1331
+ #t = 0;
1332
+ #n = false;
1333
+ #i = false;
1334
+ enqueue(t) {
1335
+ t.stopped || this.#e.includes(t) || (this.#e.push(t), !this.#n && !this.#i && (this.#n = true, queueMicrotask(() => {
1336
+ this.#n = false, this.flush();
1337
+ })));
1338
+ }
1339
+ flush() {
1340
+ if (this.#i) return;
1341
+ this.#i = true;
1342
+ let t = ++this.#t;
1343
+ try {
1344
+ for (; this.#e.length > 0; ) {
1345
+ let n = this.#e.sort((r, i) => r.priority - i.priority || r.id - i.id);
1346
+ this.#e = [];
1347
+ for (let r of n) r.flushId === t ? r.flushCount += 1 : (r.flushId = t, r.flushCount = 1), r.flushCount > Rr && (this.#e = [], y("HR006", "A reactive effect exceeded the per-flush execution limit.")), r.execute();
1348
+ }
1349
+ } finally {
1350
+ this.#i = false;
1351
+ }
1352
+ }
1353
+ }, ut = class {
1354
+ constructor(t, n, r) {
1355
+ this.scheduler = t;
1356
+ this.run = n;
1357
+ this.priority = r;
1358
+ }
1359
+ scheduler;
1360
+ run;
1361
+ priority;
1362
+ id = Cr++;
1363
+ dependencies = void 0;
1364
+ flushCount = 0;
1365
+ flushId = 0;
1366
+ stopped = false;
1367
+ paused = false;
1368
+ #e = void 0;
1369
+ #t = void 0;
1370
+ execute() {
1371
+ if (this.stopped || this.paused) return;
1372
+ this.#t = void 0, this.#e?.(), this.#e = void 0;
1373
+ let t = B;
1374
+ B = this;
1375
+ try {
1376
+ this.#e = this.run();
1377
+ } finally {
1378
+ B = t;
1379
+ let n = this.#t, r = n === void 0 ? this.dependencies : n.nextDependency;
1380
+ for (n === void 0 ? this.dependencies = void 0 : n.nextDependency = void 0; r !== void 0; ) {
1381
+ let i = r.nextDependency;
1382
+ Gt(r), r = i;
1383
+ }
1384
+ }
1385
+ }
1386
+ track(t) {
1387
+ let n = this.#t === void 0 ? this.dependencies : this.#t.nextDependency;
1388
+ if (n?.dependency === t) {
1389
+ this.#t = n;
1390
+ return;
1391
+ }
1392
+ for (let o = this.dependencies; o !== n; o = o?.nextDependency) if (o?.dependency === t) return;
1393
+ let r = { dependency: t, effect: this, nextDependency: n, previousSubscriber: void 0, nextSubscriber: void 0 };
1394
+ this.#t === void 0 ? this.dependencies = r : this.#t.nextDependency = r, this.#t = r;
1395
+ let i = t.last;
1396
+ r.previousSubscriber = i, i === void 0 ? t.first = r : i.nextSubscriber = r, t.last = r;
1397
+ }
1398
+ schedule() {
1399
+ this.paused || this.scheduler.enqueue(this);
1400
+ }
1401
+ pause() {
1402
+ this.stopped || this.paused || (this.paused = true, this.#n(), this.#e?.(), this.#e = void 0);
1403
+ }
1404
+ resume() {
1405
+ this.stopped || !this.paused || (this.paused = false, this.execute());
1406
+ }
1407
+ stop() {
1408
+ this.stopped || (this.stopped = true, this.#n(), this.#e?.(), this.#e = void 0);
1409
+ }
1410
+ #n() {
1411
+ let t = this.dependencies;
1412
+ for (; t !== void 0; ) {
1413
+ let n = t.nextDependency;
1414
+ Gt(t), t = n;
1415
+ }
1416
+ this.dependencies = void 0, this.#t = void 0;
1417
+ }
1418
+ };
1419
+ function Yt(e) {
1420
+ B === void 0 || B.stopped || B.track(e);
1421
+ }
1422
+ function at(e) {
1423
+ for (let t = e?.first; t !== void 0; ) {
1424
+ let n = t.nextSubscriber;
1425
+ t.effect.schedule(), t = n;
1426
+ }
1427
+ }
1428
+ function X(e, t, n = 1) {
1429
+ let r = new ut(e, t, n);
1430
+ return r.execute(), r;
1431
+ }
1432
+ var fe = class e {
1433
+ constructor(t = [], n = new dt(), r) {
1434
+ this.scheduler = n;
1435
+ this.parent = r;
1436
+ for (let [i, o] of t) this.#e.set(i, this.#i(o));
1437
+ }
1438
+ scheduler;
1439
+ parent;
1440
+ #e = /* @__PURE__ */ new Map();
1441
+ #t = /* @__PURE__ */ new Map();
1442
+ get size() {
1443
+ return new Set(this.keys()).size;
1444
+ }
1445
+ has(t) {
1446
+ return this.#e.has(t) || this.parent?.has(t) === true;
1447
+ }
1448
+ get(t) {
1449
+ if (!this.#e.has(t)) return this.parent?.get(t);
1450
+ if (B !== void 0) {
1451
+ let n = this.#t.get(t);
1452
+ n === void 0 && (n = { first: void 0, last: void 0 }, this.#t.set(t, n)), Yt(n);
1453
+ }
1454
+ return this.#e.get(t);
1455
+ }
1456
+ set(t, n) {
1457
+ let r = this.#i(n);
1458
+ Object.is(this.#e.get(t), r) && this.#e.has(t) || (this.#e.set(t, r), at(this.#t.get(t)));
1459
+ }
1460
+ fork(t = []) {
1461
+ return new e(t, this.scheduler, this);
1462
+ }
1463
+ entries() {
1464
+ return this.#n().entries();
1465
+ }
1466
+ keys() {
1467
+ return this.#n().keys();
1468
+ }
1469
+ values() {
1470
+ return this.#n().values();
1471
+ }
1472
+ [Symbol.iterator]() {
1473
+ return this.entries();
1474
+ }
1475
+ forEach(t, n) {
1476
+ for (let [r, i] of this.entries()) t.call(n, i, r, this);
1477
+ }
1478
+ #n() {
1479
+ return new Map([...Array.from(this.parent?.entries() ?? []), ...Array.from(this.#e)]);
1480
+ }
1481
+ #i(t) {
1482
+ if (t === null || typeof t != "object") return t;
1483
+ let n = st.get(t);
1484
+ if (n !== void 0) return n;
1485
+ let r = new Proxy(t, { get: (i, o, a) => {
1486
+ if (B !== void 0) {
1487
+ let s = Ae.get(i);
1488
+ s === void 0 && (s = /* @__PURE__ */ new Map(), Ae.set(i, s));
1489
+ let d = s.get(o);
1490
+ d === void 0 && (d = { first: void 0, last: void 0 }, s.set(o, d)), Yt(d);
1491
+ }
1492
+ return this.#i(Reflect.get(i, o, a));
1493
+ }, set: (i, o, a, s) => {
1494
+ let d = Reflect.get(i, o, s), u = this.#i(a), c = Reflect.set(i, o, u, s);
1495
+ return Object.is(d, u) || at(Ae.get(i)?.get(o)), c;
1496
+ }, deleteProperty: (i, o) => {
1497
+ let a = Reflect.has(i, o), s = Reflect.deleteProperty(i, o);
1498
+ return a && at(Ae.get(i)?.get(o)), s;
1499
+ } });
1500
+ return st.set(t, r), st.set(r, r), r;
1501
+ }
1502
+ };
1503
+ var Qt = "data-component", te = "data-component-root", ee = "data-slotted", Nr = [[":user-invalid", ":is(:user-invalid, [data-user-invalid])"], [":invalid", ":is(:invalid, [data-invalid])"], [":valid", ":is(:valid, [data-valid])"]], $r = /* @__PURE__ */ new Set(["container", "document", "layer", "media", "scope", "starting-style", "supports"]), Ar = /* @__PURE__ */ new Set(["has", "is", "not", "where"]);
1504
+ function lt(e) {
1505
+ return e !== void 0 && /[A-Za-z0-9_-]/.test(e);
1506
+ }
1507
+ function Xt(e, t) {
1508
+ let n = 1, r, i = 0;
1509
+ for (let o = t + 1; o < e.length; o += 1) {
1510
+ let a = e[o];
1511
+ if (r !== void 0) {
1512
+ a === "\\" ? o += 1 : a === r && (r = void 0);
1513
+ continue;
1514
+ }
1515
+ if (a === '"' || a === "'") {
1516
+ r = a;
1517
+ continue;
1518
+ }
1519
+ if (a === "/" && e[o + 1] === "*") {
1520
+ let s = e.indexOf("*/", o + 2);
1521
+ if (s === -1) return e.length - 1;
1522
+ o = s + 1;
1523
+ continue;
1524
+ }
1525
+ if (a === "[") i += 1;
1526
+ else if (a === "]") i = Math.max(0, i - 1);
1527
+ else if (i === 0 && a === "(") n += 1;
1528
+ else if (i === 0 && a === ")" && --n === 0) return o;
1529
+ }
1530
+ return e.length - 1;
1531
+ }
1532
+ function en(e) {
1533
+ let t = [], n = 0, r = 0, i = 0, o;
1534
+ for (let a = 0; a < e.length; a += 1) {
1535
+ let s = e[a];
1536
+ if (o !== void 0) {
1537
+ s === "\\" ? a += 1 : s === o && (o = void 0);
1538
+ continue;
1539
+ }
1540
+ if (s === '"' || s === "'") o = s;
1541
+ else if (s === "/" && e[a + 1] === "*") {
1542
+ let d = e.indexOf("*/", a + 2);
1543
+ if (d === -1) break;
1544
+ a = d + 1;
1545
+ } else s === "[" ? i += 1 : s === "]" ? i = Math.max(0, i - 1) : i === 0 && s === "(" ? r += 1 : i === 0 && s === ")" ? r = Math.max(0, r - 1) : i === 0 && r === 0 && s === "," && (t.push(e.slice(n, a)), n = a + 1);
1546
+ }
1547
+ return t.push(e.slice(n)), t;
1548
+ }
1549
+ function Mr(e) {
1550
+ let t = 0, n = 0, r = 0, i;
1551
+ for (let o = 0; o < e.length; o += 1) {
1552
+ let a = e[o];
1553
+ if (i !== void 0) {
1554
+ a === "\\" ? o += 1 : a === i && (i = void 0);
1555
+ continue;
1556
+ }
1557
+ if (a === '"' || a === "'") i = a;
1558
+ else if (a === "/" && e[o + 1] === "*") {
1559
+ let s = e.indexOf("*/", o + 2);
1560
+ if (s === -1) return t;
1561
+ o = s + 1;
1562
+ } else if (a === "[") r += 1;
1563
+ else if (a === "]") r = Math.max(0, r - 1);
1564
+ else if (r === 0 && a === "(") n += 1;
1565
+ else if (r === 0 && a === ")") n = Math.max(0, n - 1);
1566
+ else if (r === 0 && n === 0) {
1567
+ if (a === ">" || a === "+" || a === "~") t = o + 1;
1568
+ else if (/\s/.test(a)) {
1569
+ let s = o;
1570
+ for (; s + 1 < e.length && /\s/.test(e[s + 1]); ) s += 1;
1571
+ e[s + 1] !== void 0 && !/[>+~]/.test(e[s + 1]) && (t = s + 1), o = s;
1572
+ }
1573
+ }
1574
+ }
1575
+ for (; t < e.length && /\s/.test(e[t]); ) t += 1;
1576
+ return t;
1577
+ }
1578
+ function Vr(e) {
1579
+ let t = 0, n = 0, r;
1580
+ for (let i = 0; i < e.length - 1; i += 1) {
1581
+ let o = e[i];
1582
+ if (r !== void 0) {
1583
+ o === "\\" ? i += 1 : o === r && (r = void 0);
1584
+ continue;
1585
+ }
1586
+ if (o === '"' || o === "'") r = o;
1587
+ else if (o === "[") n += 1;
1588
+ else if (o === "]") n = Math.max(0, n - 1);
1589
+ else if (n === 0 && o === "(") t += 1;
1590
+ else if (n === 0 && o === ")") t = Math.max(0, t - 1);
1591
+ else if (n === 0 && t === 0 && o === ":" && e[i + 1] === ":") return i;
1592
+ }
1593
+ return e.length;
1594
+ }
1595
+ function Lr(e, t) {
1596
+ let n = `:where([${Qt}~="${t}"])`, r = e.search(/\s*$/), i = e.slice(0, r), o = e.slice(r), a = Mr(i), s = i.slice(a);
1597
+ if (s.includes(n)) return e;
1598
+ let d = Vr(s);
1599
+ return `${i.slice(0, a)}${s.slice(0, d)}${n}${s.slice(d)}${o}`;
1600
+ }
1601
+ function Hr(e, t, n, r) {
1602
+ let i = "", o = true;
1603
+ for (let a = 0; a < e.length; ) {
1604
+ let s = e[a];
1605
+ if (s === '"' || s === "'") {
1606
+ let d = s, u = a + 1;
1607
+ for (; u < e.length; ) if (e[u] === "\\") u += 2;
1608
+ else if (e[u++] === d) break;
1609
+ i += e.slice(a, u), a = u;
1610
+ continue;
1611
+ }
1612
+ if (s === "/" && e[a + 1] === "*") {
1613
+ let d = e.indexOf("*/", a + 2), u = d === -1 ? e.length : d + 2;
1614
+ i += e.slice(a, u), a = u;
1615
+ continue;
1616
+ }
1617
+ if (s === "[") {
1618
+ let d = a + 1, u;
1619
+ for (; d < e.length; ) {
1620
+ let c = e[d];
1621
+ if (u !== void 0) c === "\\" ? d += 2 : (c === u && (u = void 0), d += 1);
1622
+ else if (c === '"' || c === "'") u = c, d += 1;
1623
+ else if (c === "]") {
1624
+ d += 1;
1625
+ break;
1626
+ } else d += 1;
1627
+ }
1628
+ i += e.slice(a, d), a = d, o = false;
1629
+ continue;
1630
+ }
1631
+ if (s === ":") {
1632
+ let d = a + 1;
1633
+ for (; lt(e[d]); ) d += 1;
1634
+ let u = e.slice(a + 1, d).toLowerCase(), c = false;
1635
+ for (let [l, m] of Nr) {
1636
+ if (e.startsWith(m, a)) {
1637
+ i += m, a += m.length, o = false, c = true;
1638
+ break;
1639
+ }
1640
+ if (e.startsWith(l, a) && !lt(e[a + l.length])) {
1641
+ i += m, a += l.length, o = false, c = true;
1642
+ break;
1643
+ }
1644
+ }
1645
+ if (c) continue;
1646
+ if (u === "scope" && t !== void 0 && n === "attribute") {
1647
+ i += `:is(:where([${te}~="${t}"]), ${t})`, a = d, o = false;
1648
+ continue;
1649
+ }
1650
+ if (e[d] === "(") {
1651
+ let l = Xt(e, d), m = e.slice(d + 1, l), f = Ar.has(u) ? tn(m, t, n, r, u === "has" && t !== void 0) : m;
1652
+ i += `${e.slice(a, d + 1)}${f})`, a = l + 1;
1653
+ } else i += e.slice(a, d), a = d;
1654
+ o = false;
1655
+ continue;
1656
+ }
1657
+ if (o && /[A-Za-z]/.test(s)) {
1658
+ let d = a + 1;
1659
+ for (; lt(e[d]); ) d += 1;
1660
+ let u = e.slice(a, d), c = u.includes("-") ? `:is(:where([${te}~="${u.toLowerCase()}"]), ${u})` : u;
1661
+ i += n === "scope" && u.toLowerCase() === r?.toLowerCase() ? `:is(${c}, :where(:scope))` : c, a = d, o = false;
1662
+ continue;
1663
+ }
1664
+ i += s, a += 1, s === "," || s === ">" || s === "+" || s === "~" || /\s/.test(s) ? o = true : s !== "|" && (o = false);
1665
+ }
1666
+ return i;
1667
+ }
1668
+ function tn(e, t, n, r, i) {
1669
+ return en(e).map((o) => {
1670
+ let a = /^\s*/.exec(o)[0], s = /\s*$/.exec(o)[0], d = o.slice(a.length, o.length - s.length);
1671
+ if (d === "") return o;
1672
+ let u = Hr(d, t, n, r);
1673
+ return `${a}${i && t !== void 0 ? Lr(u, t) : u}${s}`;
1674
+ }).join(",");
1675
+ }
1676
+ function ct(e, t) {
1677
+ let n = 1, r;
1678
+ for (let i = t + 1; i < e.length; i += 1) {
1679
+ let o = e[i];
1680
+ if (r !== void 0) {
1681
+ o === "\\" ? i += 1 : o === r && (r = void 0);
1682
+ continue;
1683
+ }
1684
+ if (o === '"' || o === "'") r = o;
1685
+ else if (o === "/" && e[i + 1] === "*") {
1686
+ let a = e.indexOf("*/", i + 2);
1687
+ if (a === -1) return e.length - 1;
1688
+ i = a + 1;
1689
+ } else if (o === "{") n += 1;
1690
+ else if (o === "}" && --n === 0) return i;
1691
+ }
1692
+ return e.length - 1;
1693
+ }
1694
+ function ft(e, t, n, r) {
1695
+ let i = "", o = 0, a, s = 0, d = 0;
1696
+ for (let u = 0; u < e.length; u += 1) {
1697
+ let c = e[u];
1698
+ if (a !== void 0) {
1699
+ c === "\\" ? u += 1 : c === a && (a = void 0);
1700
+ continue;
1701
+ }
1702
+ if (c === '"' || c === "'") a = c;
1703
+ else if (c === "/" && e[u + 1] === "*") {
1704
+ let l = e.indexOf("*/", u + 2);
1705
+ if (l === -1) break;
1706
+ u = l + 1;
1707
+ } else if (c === "(") s += 1;
1708
+ else if (c === ")") s = Math.max(0, s - 1);
1709
+ else if (c === "[") d += 1;
1710
+ else if (c === "]") d = Math.max(0, d - 1);
1711
+ else if (s === 0 && d === 0 && c === ";") i += e.slice(o, u + 1), o = u + 1;
1712
+ else if (s === 0 && d === 0 && c === "{") {
1713
+ let l = ct(e, u), m = e.slice(o, u), f = e.slice(u + 1, l), p = /^\s*@([\w-]+)/.exec(m)?.[1]?.toLowerCase(), h = p === void 0 ? tn(m, t, n, r, t !== void 0 && n === "attribute") : m, v = p === void 0 || $r.has(p) ? ft(f, t, n, r) : f;
1714
+ i += `${h}{${v}}`, u = l, o = l + 1;
1715
+ }
1716
+ }
1717
+ return i + e.slice(o);
1718
+ }
1719
+ function nn(e) {
1720
+ return ft(e, void 0, void 0, void 0);
1721
+ }
1722
+ function Dr(e) {
1723
+ let t = "", n = "", r = 0, i, o = 0, a = 0;
1724
+ for (let s = 0; s < e.length; s += 1) {
1725
+ let d = e[s];
1726
+ if (i !== void 0) {
1727
+ d === "\\" ? s += 1 : d === i && (i = void 0);
1728
+ continue;
1729
+ }
1730
+ if (d === '"' || d === "'") i = d;
1731
+ else if (d === "/" && e[s + 1] === "*") {
1732
+ let u = e.indexOf("*/", s + 2);
1733
+ if (u === -1) break;
1734
+ s = u + 1;
1735
+ } else if (d === "(") o += 1;
1736
+ else if (d === ")") o = Math.max(0, o - 1);
1737
+ else if (d === "[") a += 1;
1738
+ else if (d === "]") a = Math.max(0, a - 1);
1739
+ else if (o === 0 && a === 0 && d === ";") t += e.slice(r, s + 1), r = s + 1;
1740
+ else if (o === 0 && a === 0 && d === "{") {
1741
+ let u = ct(e, s), c = e.slice(r, s), l = e.slice(r, u + 1);
1742
+ !/^\s*@/.test(c) && c.includes(":slotted(") ? n += l : t += l, s = u, r = u + 1;
1743
+ }
1744
+ }
1745
+ return { normal: t + e.slice(r), slotted: n };
1746
+ }
1747
+ function Pr(e, t) {
1748
+ let n = e.trim();
1749
+ if (n.startsWith(">")) {
1750
+ let i = n.slice(1).trim();
1751
+ return i === "" || i === "*" ? `${t} [${ee}]` : `${t} [${ee}]:is(${i})`;
1752
+ }
1753
+ let r = `:where([${ee}], [${ee}] *)`;
1754
+ return n === "" || n === "*" ? `${t} ${r}` : `${t} ${r}:is(${n})`;
1755
+ }
1756
+ function jr(e, t) {
1757
+ let n = `[${te}~="${t}"]`, r = /^\s*:scope((?:\[[^\]]*\]|:{1,2}[\w-]+(?:\([^)]*\))?|[.#][\w-]+)*)\s+(?=:slotted\()/.exec(e), i = r ? `${n}${r[1]}` : n, o = r ? e.slice(r[0].length) : e, a = "", s = 0;
1758
+ for (; ; ) {
1759
+ let d = o.indexOf(":slotted(", s);
1760
+ if (d === -1) return a += o.slice(s), a;
1761
+ a += o.slice(s, d);
1762
+ let u = d + 8, c = Xt(o, u);
1763
+ a += Pr(o.slice(u + 1, c), i), s = c + 1;
1764
+ }
1765
+ }
1766
+ function Or(e, t) {
1767
+ let n = "", r = 0;
1768
+ for (let i = 0; i < e.length; i += 1) if (e[i] === "{") {
1769
+ let o = ct(e, i), a = e.slice(r, i), s = e.slice(i + 1, o), d = en(a).map((u) => jr(u, t)).join(",");
1770
+ n += `${d}{${s}}`, i = o, r = o + 1;
1771
+ }
1772
+ return n + e.slice(r);
1773
+ }
1774
+ function Me(e, t, n) {
1775
+ if (e === "") return "";
1776
+ let { normal: r, slotted: i } = Dr(e), o = ft(r, t, "scope", n), a = o.trim() === "" ? "" : `@scope ([${te}~="${t}"]) to (:scope [${te}] > *, [${ee}]) {
1777
+ ${o}
1778
+ }`, s = i.trim() === "" ? "" : Or(i, t);
1779
+ return [a, s].filter((d) => d !== "").join(`
1780
+ `);
1781
+ }
1782
+ function rn(e, t, n) {
1783
+ let r = new Set((e.getAttribute(t) ?? "").split(/\s+/).filter(Boolean));
1784
+ r.add(n), e.setAttribute(t, Array.from(r).join(" "));
1785
+ }
1786
+ function pe(e, t) {
1787
+ rn(e, Qt, t);
1788
+ }
1789
+ function pt(e, t) {
1790
+ pe(e, t), rn(e, te, t);
1791
+ }
1792
+ function Ve(e) {
1793
+ e.nodeType === 1 && e.setAttribute(ee, "");
1794
+ }
1795
+ var mt = { valid: true, errors: [] }, on = 1e-9;
1796
+ function Ir(e, t = false) {
1797
+ return e == null || e === "" || t && Array.isArray(e) && e.length === 0;
1798
+ }
1799
+ function zr(e) {
1800
+ if (e !== void 0) return typeof e != "string" || ["string", "boolean", "number"].includes(e) ? e : F(e);
1801
+ }
1802
+ function Ur(e) {
1803
+ if (e === void 0) return;
1804
+ let t = Q(e);
1805
+ return t.kind === "terminal" ? t.name : void 0;
1806
+ }
1807
+ function sn(e, t) {
1808
+ return e.map((n) => ({ reason: n.reason === "schemaMismatch" || n.reason === "untrustedValue" ? n.reason : n.reason === "badInput" && !["email", "url"].includes(t ?? "") ? "badInput" : "typeMismatch", message: n.message, path: n.path }));
1809
+ }
1810
+ function dn(e, t) {
1811
+ if (typeof e == "number" && Number.isFinite(e)) return e;
1812
+ if (typeof e == "string") switch (t) {
1813
+ case "number":
1814
+ case "integer": {
1815
+ let n = Number(e);
1816
+ return Number.isFinite(n) ? n : void 0;
1817
+ }
1818
+ case "date": {
1819
+ let n = Date.parse(`${e}T00:00:00Z`);
1820
+ return Number.isFinite(n) ? n / 864e5 : void 0;
1821
+ }
1822
+ case "datetime-local": {
1823
+ let n = Date.parse(`${e}Z`);
1824
+ return Number.isFinite(n) ? n / 1e3 : void 0;
1825
+ }
1826
+ case "time": {
1827
+ let n = /^(\d{2}):(\d{2})(?::(\d{2})(?:\.(\d+))?)?$/.exec(e);
1828
+ return n === null ? void 0 : Number(n[1]) * 3600 + Number(n[2]) * 60 + Number(n[3] ?? 0) + +`0.${n[4] ?? 0}`;
1829
+ }
1830
+ case "month": {
1831
+ let n = /^(\d+)-(\d{2})$/.exec(e);
1832
+ return n === null ? void 0 : Number(n[1]) * 12 + Number(n[2]) - 1;
1833
+ }
1834
+ case "week": {
1835
+ let n = /^(\d+)-W(\d{2})$/.exec(e);
1836
+ return n === null ? void 0 : Number(n[1]) * 53 + Number(n[2]) - 1;
1837
+ }
1838
+ default:
1839
+ return;
1840
+ }
1841
+ }
1842
+ function an(e, t) {
1843
+ return e === void 0 ? void 0 : dn(e, t);
1844
+ }
1845
+ function un(e, t = {}) {
1846
+ if (Ir(e, t.multiple)) return t.required ? { valid: false, errors: [{ reason: "valueMissing", message: "This field is required." }] } : mt;
1847
+ let n = [], r = zr(t.type), i = Ur(r), o = e;
1848
+ if (i === "email" && t.multiple && typeof e == "string") {
1849
+ let u = e.split(",").map((l) => l.trim()), c = u.flatMap((l, m) => {
1850
+ let f = j(l, r, `$[${m}]`);
1851
+ return f.ok ? [] : sn(f.issues, i);
1852
+ });
1853
+ n.push(...c), c.length === 0 && (o = u);
1854
+ } else if (r !== void 0) {
1855
+ let u = j(e, r);
1856
+ u.ok ? o = u.value : n.push(...sn(u.issues, i));
1857
+ }
1858
+ let a = dn(o, i), s = an(t.min, i), d = an(t.max, i);
1859
+ if (a !== void 0 && (s !== void 0 && a < s && n.push({ reason: "rangeUnderflow", message: `Value must be at least ${t.min}.` }), d !== void 0 && a > d && n.push({ reason: "rangeOverflow", message: `Value must be at most ${t.max}.` }), t.step !== void 0 && t.step !== "any" && t.step > 0)) {
1860
+ let c = Math.abs(a - (s ?? 0)) % t.step;
1861
+ c > on && Math.abs(c - t.step) > on && n.push({ reason: "stepMismatch", message: `Value must align to a step of ${t.step}.` });
1862
+ }
1863
+ if (typeof e == "string" && (t.minLength !== void 0 && e.length < t.minLength && n.push({ reason: "tooShort", message: `Use at least ${t.minLength} characters.` }), t.maxLength !== void 0 && e.length > t.maxLength && n.push({ reason: "tooLong", message: `Use no more than ${t.maxLength} characters.` }), t.pattern !== void 0)) {
1864
+ let u;
1865
+ try {
1866
+ u = new RegExp(`^(?:${t.pattern})$`, "v");
1867
+ } catch {
1868
+ try {
1869
+ u = new RegExp(`^(?:${t.pattern})$`, "u");
1870
+ } catch {
1871
+ u = void 0;
1872
+ }
1873
+ }
1874
+ u !== void 0 && !u.test(e) && n.push({ reason: "patternMismatch", message: "Value does not match the required format." });
1875
+ }
1876
+ return n.length === 0 ? mt : { valid: false, errors: n };
1877
+ }
1878
+ var qr = ["valueMissing", "typeMismatch", "patternMismatch", "tooLong", "tooShort", "rangeUnderflow", "rangeOverflow", "stepMismatch", "badInput", "customError"];
1879
+ function yt(e, t) {
1880
+ if (e.valid) return mt;
1881
+ let n = qr.filter((r) => e[r]).map((r) => ({ reason: r, message: t || _r(r) }));
1882
+ return n.length === 0 ? { valid: false, errors: [{ reason: "badInput", message: t || "The value is invalid." }] } : { valid: false, errors: n };
1883
+ }
1884
+ function _r(e) {
1885
+ return { valueMissing: "This field is required.", typeMismatch: "Enter a value in the required format.", patternMismatch: "Value does not match the required format.", tooLong: "The value is too long.", tooShort: "The value is too short.", rangeUnderflow: "The value is below the allowed range.", rangeOverflow: "The value is above the allowed range.", stepMismatch: "The value does not align to the required step.", badInput: "The browser could not parse this value.", customError: "The application marked this value invalid.", schemaMismatch: "The value does not match its schema.", untrustedValue: "The value did not cross an approved trust boundary." }[e];
1886
+ }
1887
+ function ln(e) {
1888
+ return nn(e);
1889
+ }
1890
+ var He = { valid: true, errors: [] }, I = /* @__PURE__ */ new WeakMap(), me = /* @__PURE__ */ new WeakMap(), vt = /* @__PURE__ */ new WeakMap(), re = /* @__PURE__ */ new WeakMap(), gt = /* @__PURE__ */ new WeakMap(), Le = /* @__PURE__ */ new WeakSet(), ne = /* @__PURE__ */ new WeakMap(), ht = /* @__PURE__ */ new WeakMap();
1891
+ function cn(e, t) {
1892
+ let n = [...e.errors, ...t];
1893
+ return n.length === 0 ? He : { valid: false, errors: n };
1894
+ }
1895
+ function he(e) {
1896
+ return ["button", "fieldset", "input", "object", "output", "select", "textarea"].includes(e.localName) && "validity" in e && "validationMessage" in e && typeof e.checkValidity == "function" && typeof e.setCustomValidity == "function";
1897
+ }
1898
+ function ie(e) {
1899
+ let t = I.get(e);
1900
+ if (t !== void 0) return cn(t.derived, t.external);
1901
+ let n = me.get(e), r = vt.get(e) ?? [];
1902
+ return n !== void 0 || r.length > 0 ? cn(n ?? He, r) : he(e) ? yt(e.validity, e.validationMessage) : He;
1903
+ }
1904
+ function hn(e) {
1905
+ let t = new Set(e.errors.map((n) => n.reason));
1906
+ return Object.freeze({ valid: e.valid, valueMissing: t.has("valueMissing"), typeMismatch: t.has("typeMismatch"), patternMismatch: t.has("patternMismatch"), tooLong: t.has("tooLong"), tooShort: t.has("tooShort"), rangeUnderflow: t.has("rangeUnderflow"), rangeOverflow: t.has("rangeOverflow"), stepMismatch: t.has("stepMismatch"), badInput: t.has("badInput"), customError: t.has("customError"), schemaMismatch: t.has("schemaMismatch"), untrustedValue: t.has("untrustedValue"), errors: e.errors });
1907
+ }
1908
+ function gn(e) {
1909
+ return e.valid ? "" : e.errors[0].message;
1910
+ }
1911
+ function Fr(e) {
1912
+ let t = hn(e);
1913
+ return { valueMissing: t.valueMissing, typeMismatch: t.typeMismatch || t.schemaMismatch || t.untrustedValue, patternMismatch: t.patternMismatch, tooLong: t.tooLong, tooShort: t.tooShort, rangeUnderflow: t.rangeUnderflow, rangeOverflow: t.rangeOverflow, stepMismatch: t.stepMismatch, badInput: t.badInput, customError: t.customError };
1914
+ }
1915
+ function ye(e, t) {
1916
+ let n = ie(e), r = gn(n);
1917
+ if (he(e)) {
1918
+ if (t === void 0 || t.external.length > 0 || Object.keys(t.constraint).length > 0) e.setCustomValidity(r), r === "" ? re.delete(e) : re.set(e, r);
1919
+ else {
1920
+ let o = re.get(e);
1921
+ o !== void 0 && e.validationMessage === o && e.setCustomValidity(""), re.delete(e);
1922
+ }
1923
+ e.removeAttribute("data-valid"), e.removeAttribute("data-invalid"), e.removeAttribute("data-user-invalid");
1924
+ return;
1925
+ } else t?.internals !== void 0 && t.internals.setValidity(n.valid ? {} : Fr(n), r);
1926
+ n.valid ? (e.removeAttribute("data-invalid"), e.setAttribute("data-valid", ""), Le.has(e) && (e.removeAttribute("aria-invalid"), Le.delete(e))) : (e.removeAttribute("data-valid"), e.setAttribute("data-invalid", ""), (!e.hasAttribute("aria-invalid") || Le.has(e)) && (e.setAttribute("aria-invalid", "true"), Le.add(e))), t?.interacted === true && !n.valid ? e.setAttribute("data-user-invalid", "") : e.removeAttribute("data-user-invalid");
1927
+ }
1928
+ function Wr(e, t, n) {
1929
+ let r = [], i = /* @__PURE__ */ new Set([...Array.from(e.styleSheets), ...Array.from(e.adoptedStyleSheets ?? [])]);
1930
+ for (let o of i) if (o.ownerNode !== t) try {
1931
+ let a = Array.from(o.cssRules, (d) => d.cssText).join(`
1932
+ `), s = ln(a);
1933
+ s !== a && r.push(s);
1934
+ } catch {
1935
+ n.has(o) || (n.add(o), e.dispatchEvent(new CustomEvent("htmlnextdiagnostic", { detail: { code: "HV001", message: "A stylesheet containing validity selectors could not be read. Transform cross-origin CSS with rewriteValiditySelectors() during the package build." } })));
1936
+ }
1937
+ return r.join(`
1938
+ `);
1939
+ }
1940
+ function bn(e, t) {
1941
+ t.queued = false;
1942
+ let n = Wr(e, t.companion, t.inaccessible);
1943
+ t.companion.textContent !== n && (t.companion.textContent = n);
1944
+ }
1945
+ function bt(e) {
1946
+ let t = gt.get(e);
1947
+ t === void 0 || t.queued || (t.queued = true, queueMicrotask(() => bn(e, t)));
1948
+ }
1949
+ var fn = /* @__PURE__ */ new WeakSet();
1950
+ function Br(e) {
1951
+ let t = e.defaultView?.CSSStyleSheet?.prototype;
1952
+ if (!(t === void 0 || fn.has(t))) {
1953
+ fn.add(t);
1954
+ for (let n of ["insertRule", "deleteRule", "replace", "replaceSync"]) {
1955
+ let r = t[n];
1956
+ typeof r == "function" && Object.defineProperty(t, n, { configurable: true, writable: true, value: function(...i) {
1957
+ let o = r.apply(this, i), a = () => {
1958
+ (Array.from(e.styleSheets).includes(this) || Array.from(e.adoptedStyleSheets ?? []).includes(this)) && bt(e);
1959
+ };
1960
+ return o instanceof Promise ? o.finally(a) : a(), o;
1961
+ } });
1962
+ }
1963
+ }
1964
+ }
1965
+ function Zr(e) {
1966
+ if (gt.has(e)) return;
1967
+ let t = e.createElement("style");
1968
+ t.setAttribute("data-html-next-validity-styles", ""), e.head.append(t);
1969
+ let n, r = new MutationObserver((i) => {
1970
+ if (!i.every((o) => o.target === t || t.contains(o.target))) {
1971
+ for (let o of Array.from(e.querySelectorAll("link[rel=stylesheet]"))) o.addEventListener("load", () => bt(e), { once: true });
1972
+ bt(e);
1973
+ }
1974
+ });
1975
+ n = { companion: t, observer: r, queued: false, inaccessible: /* @__PURE__ */ new WeakSet() }, r.observe(e.head, { childList: true, subtree: true, characterData: true, attributes: true }), gt.set(e, n), Br(e), bn(e, n);
1976
+ }
1977
+ function Jr(e) {
1978
+ return e instanceof HTMLInputElement ? e.type === "checkbox" || e.type === "radio" ? e.checked : e.value : e instanceof HTMLSelectElement ? e.multiple ? Array.from(e.selectedOptions, (t) => t.value) : e.value : e instanceof HTMLTextAreaElement ? e.value : e.value ?? e.getAttribute("data-value") ?? e.getAttribute("value");
1979
+ }
1980
+ function Kr(e) {
1981
+ return hn(ie(e));
1982
+ }
1983
+ function Gr(e) {
1984
+ return gn(ie(e));
1985
+ }
1986
+ function pn(e, t) {
1987
+ let n = typeof t == "string" ? t === "" ? [] : [{ reason: "customError", message: t }] : t;
1988
+ vt.set(e, n);
1989
+ let r = I.get(e);
1990
+ r !== void 0 && (r.external = n), ye(e, r);
1991
+ }
1992
+ function Yr(e, t) {
1993
+ t.valid || e.dispatchEvent(new Event("invalid", { cancelable: true }));
1994
+ }
1995
+ function De(e, t) {
1996
+ if (he(e) && Object.keys(t.constraint).length === 0) {
1997
+ let n = re.get(e);
1998
+ return n !== void 0 && e.validationMessage === n && e.setCustomValidity(""), re.delete(e), yt(e.validity, e.validationMessage);
1999
+ }
2000
+ return un(t.value(), t.constraint);
2001
+ }
2002
+ function Pe(e, t, n) {
2003
+ let r = I.get(e);
2004
+ r !== void 0 && (t && (r.interacted = true), r.derived = De(e, r), me.set(e, r.derived)), ye(e, r);
2005
+ let i = ie(e);
2006
+ return n && Yr(e, i), i.valid;
2007
+ }
2008
+ function Qr(e, t) {
2009
+ let n = e.closest("form");
2010
+ if (!(n instanceof HTMLFormElement)) return;
2011
+ let r = ne.get(n);
2012
+ if (r === void 0) {
2013
+ r = /* @__PURE__ */ new Set(), ne.set(n, r);
2014
+ let i = (a) => {
2015
+ let s;
2016
+ for (let d of ne.get(n) ?? []) d.isConnected && (Pe(d, true, true) || (s ??= d));
2017
+ s !== void 0 && (a.preventDefault(), s.focus?.());
2018
+ }, o = () => {
2019
+ queueMicrotask(() => {
2020
+ for (let a of ne.get(n) ?? []) {
2021
+ let s = I.get(a);
2022
+ s !== void 0 && (s.interacted = false, s.derived = De(a, s), me.set(a, s.derived), ye(a, s));
2023
+ }
2024
+ });
2025
+ };
2026
+ n.addEventListener("submit", i, true), n.addEventListener("reset", o), ht.set(n, () => {
2027
+ n.removeEventListener("submit", i, true), n.removeEventListener("reset", o);
2028
+ });
2029
+ }
2030
+ r.add(e), t.cleanup.push(() => {
2031
+ let i = ne.get(n);
2032
+ i?.delete(e), i?.size === 0 && (ht.get(n)?.(), ht.delete(n), ne.delete(n));
2033
+ });
2034
+ }
2035
+ function mn(e) {
2036
+ let t = e, n = {};
2037
+ "validity" in t || (n.validity = { configurable: true, get: () => Kr(e) }), "validationMessage" in t || (n.validationMessage = { configurable: true, get: () => Gr(e) }), "willValidate" in t || (n.willValidate = { configurable: true, get: () => true }), "checkValidity" in t || (n.checkValidity = { configurable: true, value: () => Pe(e, false, true) }), "reportValidity" in t || (n.reportValidity = { configurable: true, value: () => Pe(e, true, true) }), "setCustomValidity" in t || (n.setCustomValidity = { configurable: true, value: (r) => pn(e, r) }), "setValidity" in t || (n.setValidity = { configurable: true, value: (r = []) => pn(e, r) }), "validate" in t || (n.validate = { configurable: true, value: () => he(e) && I.get(e) === void 0 ? (e.checkValidity(), ie(e)) : Xr(e, I.get(e)?.constraint ?? {}) }), Object.defineProperties(t, n);
2038
+ }
2039
+ function kt(e, t = {}, n = {}) {
2040
+ if (yn(e), he(e) && Object.keys(t).length === 0 && n.value === void 0 && n.internals === void 0) return mn(e), () => {
2041
+ };
2042
+ let r = { constraint: t, derived: He, external: vt.get(e) ?? [], interacted: false, value: n.value ?? (() => Jr(e)), ...n.internals === void 0 ? {} : { internals: n.internals }, cleanup: [] };
2043
+ I.set(e, r), Zr(e.ownerDocument), mn(e);
2044
+ let i = () => {
2045
+ r.interacted = true, r.derived = De(e, r), me.set(e, r.derived), ye(e, r);
2046
+ };
2047
+ return e.addEventListener("input", i), e.addEventListener("change", i), e.addEventListener("blur", i, true), r.cleanup.push(() => e.removeEventListener("input", i), () => e.removeEventListener("change", i), () => e.removeEventListener("blur", i, true)), Qr(e, r), r.derived = De(e, r), me.set(e, r.derived), ye(e, r), () => yn(e);
2048
+ }
2049
+ function yn(e) {
2050
+ let t = I.get(e);
2051
+ if (t !== void 0) {
2052
+ for (let n of t.cleanup) n();
2053
+ I.delete(e);
2054
+ }
2055
+ }
2056
+ function Xr(e, t) {
2057
+ let n = I.get(e);
2058
+ return n === void 0 ? (kt(e, t ?? {}), n = I.get(e)) : t !== void 0 && (n.constraint = t), Pe(e, true, true), ie(e);
2059
+ }
2060
+ var je = /* @__PURE__ */ new WeakSet(), xn = /* @__PURE__ */ new WeakMap(), vn = /* @__PURE__ */ new WeakMap(), ei = /* @__PURE__ */ Symbol.for("@nextwebwg/declarative-components.runtime.v1"), Y = /* @__PURE__ */ Symbol.for("@nextwebwg/declarative-components.lifecycle.v1");
2061
+ function Ie(e) {
2062
+ return e[ei] ??= {};
2063
+ }
2064
+ function J(e) {
2065
+ return xn.get(e);
2066
+ }
2067
+ function ke(e) {
2068
+ let t = Ie(e), n = t.registry;
2069
+ return (n === void 0 || n.root !== e.documentElement) && (n = { root: e.documentElement, definitions: /* @__PURE__ */ new Map(), discoverySelector: void 0 }, t.registry = n), n;
2070
+ }
2071
+ function ze(e, t, n) {
2072
+ e.definitions.set(t, n), e.discoverySelector !== void 0 && (e.discoverySelector += `,${t}`);
2073
+ }
2074
+ function ti(e) {
2075
+ return e.discoverySelector ??= ["template[component]", "[data-component-root]", ...Array.from(e.definitions.keys())].join(",");
2076
+ }
2077
+ function ni(e, t) {
2078
+ let n = e.getAttribute("component") ?? "", r = `${e.ownerDocument.URL}#template[component="${n}"][${t + 1}]`;
2079
+ e.hasAttribute("src") && y("HL001", "External definitions require the application-owned graph resolver.", r);
2080
+ let i = Jt(e, r), o = Array.from(e.content.children).find((a) => a.localName === "style");
2081
+ return { wrapper: e, style: o, definition: i };
2082
+ }
2083
+ function ri(e, t = document) {
2084
+ let n = ke(t), r = 0;
2085
+ for (let i of e.nodes.values()) {
2086
+ if (i.shadowedByCustomElement) continue;
2087
+ let o = i.definition.contract.tag;
2088
+ n.definitions.has(o) && y("HR001", `More than one definition declares <${o}>.`);
2089
+ let a = i.definition.css === "" ? void 0 : t.createElement("style");
2090
+ a !== void 0 && (a.textContent = Me(i.definition.css, o, i.definition.template.name), a.dataset.htmlNextComponent = o, t.head.append(a)), ze(n, o, { definition: i.definition, style: a }), r += 1;
2091
+ }
2092
+ return r;
2093
+ }
2094
+ function Oe(e, t, n = false) {
2095
+ let r = e.type === "boolean" && n ? true : t, i = j(r, e.type);
2096
+ if (!i.ok) {
2097
+ let o = i.issues.map((a) => `${a.path}: ${a.message}`).join("; ");
2098
+ y("HR002", `A prop invocation value does not satisfy its declared type. ${o}`);
2099
+ }
2100
+ return i.value;
2101
+ }
2102
+ function kn(e, t, n) {
2103
+ return n !== void 0 ? Oe(t, n) : (t.required && y("HC020", `Required prop \`${e}\` was not provided.`), t.default === void 0 ? x : t.default);
2104
+ }
2105
+ function ii(e, t) {
2106
+ let n = vn.get(e);
2107
+ if (n === void 0) {
2108
+ let r = /* @__PURE__ */ Object.create(null), i = /* @__PURE__ */ Object.create(null);
2109
+ for (let o of Object.keys(e.contract.props)) {
2110
+ let a = Ee(o);
2111
+ r[a] = o, i[`data-${a}`] = o, a !== o.toLowerCase() && (i[`data-${o.toLowerCase()}`] = o);
2112
+ }
2113
+ n = [r, i], vn.set(e, n);
2114
+ }
2115
+ return n[t ? 1 : 0];
2116
+ }
2117
+ function oi(e, t, n = false) {
2118
+ let r = t.contract, i = ii(t, n), o = /* @__PURE__ */ Object.create(null), a = [], s;
2119
+ for (let f of Array.from(e.attributes)) {
2120
+ if (f.name.toLowerCase() === "as" && t.root?.kind === "native") {
2121
+ s = f.value.toLowerCase();
2122
+ continue;
2123
+ }
2124
+ let p = i[f.name.toLowerCase()];
2125
+ if (p === void 0) {
2126
+ n || a.push(f);
2127
+ continue;
2128
+ }
2129
+ o[p] = Oe(r.props[p], f.value, !n);
2130
+ }
2131
+ let d = t.root?.kind === "native" ? n ? e.localName : s ?? t.root.element : t.template.name;
2132
+ t.root?.kind === "native" && !t.root.choices.includes(d) && y(n ? "HR005" : "HR002", `<${r.tag}> cannot use root <${d}>; expected one of ${t.root.choices.join(", ")}.`);
2133
+ for (let [f, p] of Object.entries(r.props)) {
2134
+ if (o[f] !== void 0 || n && !Object.hasOwn(e, f)) continue;
2135
+ let h = e[f];
2136
+ h !== void 0 && (o[f] = Oe(p, h));
2137
+ }
2138
+ let u = new fe();
2139
+ for (let [f, p] of Object.entries(r.props)) p.required && o[f] === void 0 && y("HC020", `Required prop \`${f}\` was not provided.`), u.set(f, o[f] !== void 0 ? o[f] : p.default === void 0 ? x : p.default);
2140
+ let c = t.declarations ?? [];
2141
+ for (let f of c) (f.kind === "state" || f.kind === "computed" || f.kind === "data") && u.set(f.name, null);
2142
+ for (let f of c) f.kind === "data" ? u.set(f.name, { pending: true, value: null, error: null, ok: false }) : f.kind === "state" && u.set(f.name, f.expression === void 0 ? null : $(f.expression.source, u));
2143
+ let l = [];
2144
+ for (let f of c) f.kind !== "computed" || f.expression === void 0 || l.push(X(u.scheduler, () => {
2145
+ u.set(f.name, $(f.expression.source, u));
2146
+ }, 0));
2147
+ let m = (() => {
2148
+ try {
2149
+ return new URL(t.source.file, e.ownerDocument.baseURI).href;
2150
+ } catch {
2151
+ return e.ownerDocument.baseURI;
2152
+ }
2153
+ })();
2154
+ for (let f of c) {
2155
+ if (f.kind !== "data" || f.source === void 0) continue;
2156
+ let p = f, h = f.source, v = new $e({ source: h, baseURL: m, ...p.type === void 0 ? {} : { type: p.type }, ...p.schema === void 0 || /^(?:\.?\.?\/|\/|[A-Za-z][A-Za-z+.-]*:)/.test(p.schema) ? {} : { schema: p.schema }, ...p.schema !== void 0 && /^(?:\.?\.?\/|\/|[A-Za-z][A-Za-z+.-]*:)/.test(p.schema) ? { schemaURL: new URL(p.schema, m).href } : {}, ...p.debounce === void 0 ? {} : { debounce: Number(p.debounce) }, ...p.poll === void 0 ? {} : { poll: Number(p.poll) }, onState: (S) => u.set(p.name, S) });
2157
+ l.push(X(u.scheduler, () => {
2158
+ let S = Object.fromEntries(p.parameters.map((w) => [w.name, W(w.expression, u)]));
2159
+ return v.update(S), () => v.disconnect();
2160
+ }, 0));
2161
+ }
2162
+ return { scope: u, passThrough: a, effects: l, rootName: d };
2163
+ }
2164
+ function be(e, t) {
2165
+ return e instanceof fe ? e.fork(Object.entries(t)) : new Map([...Array.from(e), ...Object.entries(t)]);
2166
+ }
2167
+ function $(e, t) {
2168
+ try {
2169
+ return Pt(e, t);
2170
+ } catch (n) {
2171
+ throw n instanceof ae && y("HB001", n.message), n;
2172
+ }
2173
+ }
2174
+ function Z(e, t, n, r = 1) {
2175
+ e.effects.push(X(t.scheduler, n, r));
2176
+ }
2177
+ function Sn(e, t, n) {
2178
+ let [r, ...i] = t;
2179
+ if (typeof r != "string") return;
2180
+ if (i.length === 0) {
2181
+ e.set(r, n);
2182
+ return;
2183
+ }
2184
+ let o = e.get(r);
2185
+ for (let d = 0; d < i.length - 1; d += 1) {
2186
+ let u = i[d], c = typeof u == "object" ? W(u.expression, e) : u;
2187
+ if (typeof c != "string" && typeof c != "number" || o == null) return;
2188
+ o = o[c];
2189
+ }
2190
+ let a = i.at(-1), s = typeof a == "object" ? W(a.expression, e) : a;
2191
+ (typeof s == "string" || typeof s == "number") && o != null && (o[s] = n);
2192
+ }
2193
+ function si(e) {
2194
+ return e instanceof HTMLInputElement ? e.type === "checkbox" || e.type === "radio" ? e.checked : e.type === "number" || e.type === "range" ? Number.isNaN(e.valueAsNumber) ? null : e.valueAsNumber : e.value : e instanceof HTMLSelectElement ? e.multiple ? Array.from(e.selectedOptions, (t) => t.value) : e.value : e instanceof HTMLTextAreaElement ? e.value : e.value ?? e.getAttribute("value");
2195
+ }
2196
+ function ai(e, t, n) {
2197
+ let r = t.toLowerCase();
2198
+ if (r === "checked" && e instanceof HTMLInputElement) return e.checked = D(n), true;
2199
+ if (r === "value" && e instanceof HTMLSelectElement && e.multiple) {
2200
+ let i = new Set(Array.isArray(n) ? n.map(String) : []);
2201
+ for (let o of Array.from(e.options)) o.selected = i.has(o.value);
2202
+ return true;
2203
+ }
2204
+ return r === "value" && (e instanceof HTMLInputElement || e instanceof HTMLTextAreaElement || e instanceof HTMLSelectElement) ? (e.value = n == null ? "" : String(n), true) : false;
2205
+ }
2206
+ function di(e, t, n, r) {
2207
+ for (let i of e.steps) if (!(i.guard !== void 0 && !D(W(i.guard, n)))) if (i.kind === "set") Sn(n, i.writablePath, W(i.value, n));
2208
+ else if (i.kind === "dispatch") {
2209
+ let o = (r.definition.declarations ?? []).find((s) => s.kind === "event" && s.name === i.event), a = i.value === void 0 ? void 0 : W(i.value, n);
2210
+ o?.kind === "event" && a !== void 0 && (j(a, F(o.type)).ok || y("HR002", `Event \`${i.event}\` detail does not satisfy its declared type.`)), (r.root ?? t).dispatchEvent(new CustomEvent(i.event, { detail: a, bubbles: o?.kind === "event" ? o.bubbles : true, composed: o?.kind === "event" ? o.composed : true, cancelable: o?.kind === "event" ? o.cancelable : false }));
2211
+ } else {
2212
+ let o = r.refs[i.target];
2213
+ i.kind === "focus" ? o?.focus() : o?.reportValidity?.();
2214
+ }
2215
+ }
2216
+ function ui(e, t, n) {
2217
+ if (n.includes("self") && e.target !== t) return false;
2218
+ if (e instanceof MouseEvent) {
2219
+ let i = n.filter((a) => ["left", "middle", "right"].includes(a)), o = { left: 0, middle: 1, right: 2 };
2220
+ if (i.length > 0 && !i.some((a) => e.button === o[a])) return false;
2221
+ }
2222
+ let r = ["ctrl", "shift", "alt", "meta"];
2223
+ for (let i of r) if (n.includes(i) && !e[`${i}Key`]) return false;
2224
+ if (n.includes("exact") && r.some((i) => !n.includes(i) && e[`${i}Key`])) return false;
2225
+ if (e instanceof KeyboardEvent) {
2226
+ let i = n.filter((a) => ["enter", "escape", "space", "tab", "up", "down", "left", "right"].includes(a)), o = { enter: "Enter", escape: "Escape", space: " ", tab: "Tab", up: "ArrowUp", down: "ArrowDown", left: "ArrowLeft", right: "ArrowRight" };
2227
+ if (i.length > 0 && !i.some((a) => e.key === o[a])) return false;
2228
+ }
2229
+ return true;
2230
+ }
2231
+ function wn(e, t, n, r) {
2232
+ for (let i of t.events ?? []) {
2233
+ let o = (r.definition.declarations ?? []).find((s) => s.kind === "handler" && s.name === i.handler), a = (s) => {
2234
+ ui(s, e, i.modifiers) && (i.modifiers.includes("prevent") && s.preventDefault(), i.modifiers.includes("stop") && s.stopPropagation(), di(o, e, n, r));
2235
+ };
2236
+ if (i.name === "connect" || i.name === "disconnect") {
2237
+ (i.name === "connect" ? r.connectCallbacks : r.disconnectCallbacks).add(() => a(new Event(i.name)));
2238
+ continue;
2239
+ }
2240
+ Z(r, n, () => (e.addEventListener(i.name, a, { capture: i.modifiers.includes("capture"), passive: i.modifiers.includes("passive"), once: i.modifiers.includes("once") }), () => e.removeEventListener(i.name, a, { capture: i.modifiers.includes("capture") })), 2);
2241
+ }
2242
+ }
2243
+ function li(e, t, n) {
2244
+ n === null || ue(t) && de(n) ? e.removeAttribute(t) : e.setAttribute(t, n);
2245
+ }
2246
+ function ci(e, t, n, r) {
2247
+ let i = $(t.expression, n);
2248
+ t.name === "value" ? e.textContent = L(i) : e.replaceChildren(Qe(L(i), r, (o) => je.add(o)));
2249
+ }
2250
+ function fi(e, t, n) {
2251
+ let r = $(e.expression, t);
2252
+ return e.name === "value" ? n.createTextNode(L(r)) : Qe(L(r), n, (i) => je.add(i));
2253
+ }
2254
+ function pi(e, t) {
2255
+ return typeof e == "number" && typeof t == "number" ? e - t : L(e).localeCompare(L(t));
2256
+ }
2257
+ function Tn(e, t, n) {
2258
+ let r = e.slice();
2259
+ if (t.where !== void 0) {
2260
+ let i = t.where;
2261
+ r = r.filter((o) => D($(i, be(n, { [t.item]: o }))));
2262
+ }
2263
+ if (t.sort !== void 0) {
2264
+ let i = t.sort.split(",").map((a) => a.trim()).filter((a) => a !== ""), o = (a, s) => a !== null && typeof a == "object" && !Array.isArray(a) ? $(`${t.item}.${s}`, be(n, { [t.item]: a })) : a;
2265
+ r.sort((a, s) => {
2266
+ for (let d of i) {
2267
+ let u = d.startsWith("-"), c = u ? d.slice(1).trim() : d, l = pi(o(a, c), o(s, c));
2268
+ if (l !== 0) return u ? -l : l;
2269
+ }
2270
+ return 0;
2271
+ });
2272
+ }
2273
+ if (t.limit !== void 0) {
2274
+ let i = $(t.limit, n);
2275
+ typeof i == "number" && (r = r.slice(0, Math.max(0, Math.trunc(i))));
2276
+ }
2277
+ return r;
2278
+ }
2279
+ function mi(e, t) {
2280
+ if (e === void 0) return [t];
2281
+ switch (e.kind) {
2282
+ case "if":
2283
+ return D($(e.test, t)) ? [t] : [];
2284
+ case "with":
2285
+ return [be(t, { [e.alias]: $(e.expr, t) })];
2286
+ case "each": {
2287
+ let n = $(e.list, t);
2288
+ if (!Array.isArray(n)) return [];
2289
+ let r = Tn(n, e, t);
2290
+ return r.map((i, o) => {
2291
+ let a = { [e.item]: i, loop: { index: o, first: o === 0, last: o === r.length - 1, count: r.length } };
2292
+ return e.index !== void 0 && (a[e.index] = o), be(t, a);
2293
+ });
2294
+ }
2295
+ default:
2296
+ return [t];
2297
+ }
2298
+ }
2299
+ function Cn(e, t) {
2300
+ let n = t.createDocumentFragment();
2301
+ return n.append(...e), Array.from(n.childNodes);
2302
+ }
2303
+ function yi(e, t) {
2304
+ let n = e.nextSibling;
2305
+ for (; n !== null && n !== t; ) {
2306
+ let r = n.nextSibling;
2307
+ n.remove(), n = r;
2308
+ }
2309
+ }
2310
+ function hi(e, t, n, r, i) {
2311
+ if (e.flow?.kind === "each") return ki(e, t, n, r, i);
2312
+ let o = n.createComment("html-next:start"), a = n.createComment("html-next:end"), s = n.createDocumentFragment();
2313
+ s.append(o, a);
2314
+ let d = [];
2315
+ return Z(i, t, () => {
2316
+ for (let l of d) l.stop();
2317
+ d = [], yi(o, a);
2318
+ let u = i.effects.length, c = [];
2319
+ if (e.flow?.kind === "if") {
2320
+ if (D($(e.flow.test, t))) {
2321
+ let { flow: l, ...m } = e;
2322
+ c = ve(m, t, n, r, i);
2323
+ }
2324
+ } else if (e.flow?.kind === "with") {
2325
+ let l = t.fork([[e.flow.alias, $(e.flow.expr, t)]]), { flow: m, ...f } = e;
2326
+ c = ve(f, l, n, r, i);
2327
+ } else e.flow?.kind === "match" && (c = wi(e, t, n, i));
2328
+ d = i.effects.slice(u), a.before(...Cn(c, n));
2329
+ }), [s];
2330
+ }
2331
+ function gi(e, t) {
2332
+ if (e.end.nextSibling === t) return;
2333
+ let n = [], r = e.start;
2334
+ for (; r !== null && (n.push(r), r !== e.end); ) r = r.nextSibling;
2335
+ let i = t.parentNode;
2336
+ if (i === null) return;
2337
+ let o = i.moveBefore;
2338
+ for (let a of n) o === void 0 ? i.insertBefore(a, t) : o.call(i, a, t);
2339
+ }
2340
+ function bi(e) {
2341
+ for (let n of e.effects) n.stop();
2342
+ let t = e.start;
2343
+ for (; t !== null; ) {
2344
+ let n = t.nextSibling;
2345
+ if (t.parentNode?.removeChild(t), t === e.end) break;
2346
+ t = n;
2347
+ }
2348
+ }
2349
+ function vi(e) {
2350
+ let t = -1, n = true;
2351
+ for (let s of e) s < 0 || (s < t && (n = false), t = s);
2352
+ if (n) return;
2353
+ let r = [], i = new Int32Array(e.length).fill(-1);
2354
+ for (let s = 0; s < e.length; s += 1) {
2355
+ let d = e[s];
2356
+ if (d < 0) continue;
2357
+ let u = 0, c = r.length;
2358
+ for (; u < c; ) {
2359
+ let l = u + c >>> 1;
2360
+ e[r[l]] < d ? u = l + 1 : c = l;
2361
+ }
2362
+ u > 0 && (i[s] = r[u - 1]), r[u] = s;
2363
+ }
2364
+ let o = new Uint8Array(e.length), a = r.at(-1) ?? -1;
2365
+ for (; a >= 0; ) o[a] = 1, a = i[a];
2366
+ return o;
2367
+ }
2368
+ function ki(e, t, n, r, i) {
2369
+ let o = e.flow, a = n.createComment("html-next:each-start"), s = n.createComment("html-next:each-end"), d = n.createDocumentFragment();
2370
+ d.append(a, s);
2371
+ let u = /* @__PURE__ */ new Map();
2372
+ return Z(i, t, () => {
2373
+ let c = $(o.list, t), l = Array.isArray(c) ? Tn(c, o, t) : [], m = /* @__PURE__ */ new Map(), f = o.key !== void 0, p = f ? [] : void 0, h;
2374
+ if (f) {
2375
+ h = /* @__PURE__ */ new Map();
2376
+ let g = 0;
2377
+ for (let b of u.keys()) h.set(b, g++);
2378
+ }
2379
+ let v = f ? [] : void 0, { flow: S, ...w } = e;
2380
+ for (let g = 0; g < l.length; g += 1) {
2381
+ let b = l[g], E = { [o.item]: b, loop: { index: g, first: g === 0, last: g === l.length - 1, count: l.length } };
2382
+ o.index !== void 0 && (E[o.index] = g);
2383
+ let A, P = g;
2384
+ o.key !== void 0 && (A = t.fork(Object.entries(E)), P = $(o.key, A)), m.has(P) && y("HR004", `A keyed list produced duplicate key \`${L(P)}\`.`);
2385
+ let H = u.get(P);
2386
+ if (H === void 0) {
2387
+ A ??= t.fork(Object.entries(E));
2388
+ let V = i.effects.length, we = Cn(ve(w, A, n, r, i), n), Ct = n.createComment("html-next:item-start"), Rt = n.createComment("html-next:item-end");
2389
+ s.before(Ct, ...we, Rt), H = { start: Ct, end: Rt, scope: A, effects: i.effects.slice(V) };
2390
+ } else H.scope.set(o.item, b), o.index !== void 0 && H.scope.set(o.index, g), H.scope.set("loop", E.loop);
2391
+ m.set(P, H), p?.push(H), v?.push(h?.get(P) ?? -1);
2392
+ }
2393
+ for (let [g, b] of u) m.has(g) || bi(b);
2394
+ if (p !== void 0 && v !== void 0) {
2395
+ let g = vi(v), b = s;
2396
+ for (let E = p.length - 1; E >= 0; E -= 1) {
2397
+ let A = p[E];
2398
+ (v[E] < 0 || g !== void 0 && g[E] !== 1) && gi(A, b), b = A.start;
2399
+ }
2400
+ }
2401
+ u = m;
2402
+ }), [d];
2403
+ }
2404
+ function Rn(e, t, n, r, i, o) {
2405
+ if (e.flow?.kind === "if" || e.flow?.kind === "each" || e.flow?.kind === "with" || e.flow?.kind === "match") return hi(e, t, n, r, i);
2406
+ let a = [];
2407
+ for (let s of mi(e.flow, t)) a.push(...ve(e, s, n, r, i, o));
2408
+ return a;
2409
+ }
2410
+ function wi(e, t, n, r) {
2411
+ let i = e.flow, o = i.expr !== void 0 ? be(t, { [i.alias]: $(i.expr, t) }) : t, a;
2412
+ for (let l of e.children) if (l.kind === "element") {
2413
+ if (l.flow?.kind === "when" && D($(l.flow.test, o))) {
2414
+ a = l;
2415
+ break;
2416
+ }
2417
+ if (l.flow?.kind === "else") {
2418
+ a = l;
2419
+ break;
2420
+ }
2421
+ }
2422
+ if (a === void 0) return [];
2423
+ let { flow: s, ...d } = a, u = ve(d, o, n, [], r);
2424
+ if (e.name === "template") return u;
2425
+ let c = n.createElement(e.name);
2426
+ for (let l of e.attributes) l.kind === "literal" && c.setAttribute(l.name, l.value);
2427
+ return c.append(...u), pe(c, r.definition.contract.tag), [c];
2428
+ }
2429
+ function ve(e, t, n, r, i, o) {
2430
+ let a = e.attributes.find((p) => p.kind === "directive");
2431
+ if (e.name === "template") {
2432
+ if (a !== void 0) {
2433
+ let p = n.createTextNode("");
2434
+ return Z(i, t, () => {
2435
+ let h = $(a.expression, t);
2436
+ a.name === "value" && (p.data = L(h));
2437
+ }), a.name === "value" ? [p] : [fi(a, t, n)];
2438
+ }
2439
+ return Nn(e.children, t, n, i);
2440
+ }
2441
+ let s = e === i.definition.template ? i.rootName : e.name, d = o instanceof Element && o.localName === s, u = d ? o : n.createElement(s);
2442
+ e === i.definition.template && (i.root = u);
2443
+ let c = d ? Array.from(u.childNodes) : [], l = d && (u instanceof HTMLInputElement || u instanceof HTMLTextAreaElement || u instanceof HTMLSelectElement) ? { value: u.value, focused: u.ownerDocument.activeElement === u, ...u instanceof HTMLInputElement ? { checked: u.checked } : {}, ...u instanceof HTMLInputElement || u instanceof HTMLTextAreaElement ? { selectionStart: u.selectionStart, selectionEnd: u.selectionEnd } : {} } : void 0;
2444
+ e.ref !== void 0 && (i.refs[e.ref] = u);
2445
+ for (let p of r) u.setAttribute(p.name, p.value);
2446
+ for (let p of e.attributes) if (p.kind === "literal") u.setAttribute(p.name, p.value);
2447
+ else if (p.kind === "attribute") {
2448
+ if (Z(i, t, () => {
2449
+ let h = $(p.expression, t);
2450
+ p.target === "class" ? u.classList.toggle(p.name, D(h)) : p.target === "style" ? u.style.setProperty(p.name, L(h)) : p.twoWay === true && ai(u, p.name, h) || li(u, p.name, jt(h));
2451
+ }), p.twoWay === true && p.writablePath !== void 0) {
2452
+ let h = u instanceof HTMLSelectElement || u instanceof HTMLInputElement && ["checkbox", "radio", "file"].includes(u.type) ? "change" : "input", v = () => {
2453
+ u instanceof HTMLInputElement && u.type === "radio" && !u.checked || Sn(t, p.writablePath, si(u));
2454
+ };
2455
+ Z(i, t, () => (u.addEventListener(h, v), () => u.removeEventListener(h, v)), 2);
2456
+ }
2457
+ } else p.kind === "property" && Z(i, t, () => {
2458
+ u[p.name] = $(p.expression, t);
2459
+ });
2460
+ if (pe(u, i.definition.contract.tag), a !== void 0) return Z(i, t, () => ci(u, a, t, n)), wn(u, e, t, i), [u];
2461
+ let m = [], f = 0;
2462
+ for (let p of e.children) {
2463
+ let h = $n(p, t, n, i, c[f]);
2464
+ m.push(...h), f += h.length;
2465
+ }
2466
+ if (d) {
2467
+ for (let p = 0; p < m.length; p += 1) {
2468
+ let h = m[p];
2469
+ u.childNodes[p] !== h && u.insertBefore(h, u.childNodes[p] ?? null);
2470
+ }
2471
+ for (; u.childNodes.length > m.length; ) u.lastChild.remove();
2472
+ } else u.append(...m);
2473
+ return l !== void 0 && (u.value = l.value, u instanceof HTMLInputElement && "checked" in l && (u.checked = l.checked), (u instanceof HTMLInputElement || u instanceof HTMLTextAreaElement) && "selectionStart" in l && typeof l.selectionStart == "number" && typeof l.selectionEnd == "number" && (l.focused && u.focus({ preventScroll: true }), u.setSelectionRange(l.selectionStart, l.selectionEnd))), wn(u, e, t, i), [u];
2474
+ }
2475
+ function Nn(e, t, n, r) {
2476
+ let i = [];
2477
+ for (let o of e) i.push(...$n(o, t, n, r));
2478
+ return i;
2479
+ }
2480
+ function Ei(e) {
2481
+ return e instanceof Element ? e.getAttribute("slot") ?? "" : "";
2482
+ }
2483
+ function xi(e, t, n, r) {
2484
+ let i = e.nameExpression === void 0 ? e.name ?? "" : L(W(e.nameExpression, t)), o = r.projectedNodes.filter((s) => Ei(s) === i);
2485
+ if (o.length === 0) return Nn(e.fallback ?? [], t, n, r);
2486
+ if (r.committed) {
2487
+ for (let s of o) Ve(s);
2488
+ return [...o];
2489
+ }
2490
+ let a = n.createComment(`html-next:slot:${i}`);
2491
+ return r.slotInsertions.push({ anchor: a, nodes: o }), [a];
2492
+ }
2493
+ function $n(e, t, n, r, i) {
2494
+ if (e.kind === "text") {
2495
+ let o = i instanceof Text ? i : n.createTextNode("");
2496
+ return o.data = e.value, [o];
2497
+ }
2498
+ return e.kind === "slot" ? xi(e, t, n, r) : Rn(e, t, n, [], r, i);
2499
+ }
2500
+ var An = /* @__PURE__ */ new Set(["type", "required", "multiple", "min", "max", "minlength", "maxlength", "pattern", "step"]), wt = ["button", "fieldset", "input", "object", "output", "select", "textarea", ...Array.from(An, (e) => `[${e}]`)].join(",");
2501
+ function Si(e) {
2502
+ return "validity" in e && typeof e.checkValidity == "function";
2503
+ }
2504
+ function ge(e, t) {
2505
+ let n = e.getAttribute(t);
2506
+ if (n === null || n.trim() === "") return;
2507
+ let r = Number(n);
2508
+ return Number.isFinite(r) ? r : void 0;
2509
+ }
2510
+ function Ti(e) {
2511
+ let t = e.getAttribute("type") ?? void 0, n = e.getAttribute("min") ?? void 0, r = e.getAttribute("max") ?? void 0, o = e.getAttribute("step") === "any" ? "any" : ge(e, "step");
2512
+ return { ...t === void 0 ? {} : { type: t }, ...e.hasAttribute("required") ? { required: true } : {}, ...e.hasAttribute("multiple") ? { multiple: true } : {}, ...n === void 0 ? {} : { min: n }, ...r === void 0 ? {} : { max: r }, ...ge(e, "minlength") === void 0 ? {} : { minLength: ge(e, "minlength") }, ...ge(e, "maxlength") === void 0 ? {} : { maxLength: ge(e, "maxlength") }, ...e.getAttribute("pattern") === null ? {} : { pattern: e.getAttribute("pattern") }, ...o === void 0 ? {} : { step: o } };
2513
+ }
2514
+ function Ci(e, t) {
2515
+ let n = [], r = () => {
2516
+ if (n.length > 0) return;
2517
+ let o = e.matches(wt) ? [e, ...Array.from(e.querySelectorAll(wt))] : Array.from(e.querySelectorAll(wt));
2518
+ for (let a of o) {
2519
+ let s = Si(a), d = Array.from(a.attributes).some((u) => An.has(u.name.toLowerCase()));
2520
+ !s && !d || n.push(kt(a, s ? {} : Ti(a)));
2521
+ }
2522
+ }, i = () => {
2523
+ for (let o of n) o();
2524
+ n = [];
2525
+ };
2526
+ t.connectCallbacks.add(r), t.disconnectCallbacks.add(i);
2527
+ }
2528
+ function Ri(e, t) {
2529
+ let n = t.definition.contract.props, r = {}, i = {};
2530
+ for (let [c, l] of Object.entries(n)) {
2531
+ if (Object.defineProperty(e, c, { configurable: true, enumerable: true, get: () => {
2532
+ let f = t.scope.get(c);
2533
+ return f === x ? void 0 : f;
2534
+ }, set: (f) => {
2535
+ let p = t.scope.get(c);
2536
+ Object.is(p === x ? void 0 : p, f) || t.scope.set(c, kn(c, l, f));
2537
+ } }), "property" in l.target) continue;
2538
+ let m = `data-${Ee(c)}`;
2539
+ r[m] = c, t.effects.push(X(t.scope.scheduler, () => {
2540
+ let f = t.scope.get(c), p = f === void 0 || f === x ? null : Se(f, l.type);
2541
+ i[m] = p, p === null ? e.removeAttribute(m) : e.setAttribute(m, p);
2542
+ }, 2));
2543
+ }
2544
+ let o = e.ownerDocument.defaultView?.MutationObserver, a = Object.keys(r);
2545
+ if (o === void 0 || a.length === 0) return;
2546
+ let s = new o((c) => {
2547
+ for (let l of c) {
2548
+ let m = l.attributeName;
2549
+ if (m === null) continue;
2550
+ let f = r[m];
2551
+ if (f === void 0) continue;
2552
+ let p = e.getAttribute(m);
2553
+ if (m in i && i[m] === p) {
2554
+ delete i[m];
2555
+ continue;
2556
+ }
2557
+ delete i[m];
2558
+ let h = n[f];
2559
+ t.scope.set(f, p === null ? kn(f, h, void 0) : Oe(h, p, true));
2560
+ }
2561
+ }), d = () => s.observe(e, { attributes: true, attributeFilter: a }), u = () => s.disconnect();
2562
+ t.connectCallbacks.add(d), t.disconnectCallbacks.add(u);
2563
+ }
2564
+ function Ni(e, t) {
2565
+ for (let n of t.definition.declarations ?? []) n.kind === "method" && Object.defineProperty(e, n.name, { configurable: true, enumerable: false, value: (...r) => t.controllerModule === void 0 ? Promise.reject(new TypeError(`Controller method \`${n.name}\` is not ready for <${t.definition.contract.tag}>.`)) : t.controllerModule.then((i) => {
2566
+ let o = i[n.exportName];
2567
+ return typeof o != "function" && y("HJ003", `Controller does not export method \`${n.exportName}\`.`), Reflect.apply(o, void 0, [Tt(e), ...r]);
2568
+ }) });
2569
+ }
2570
+ function Mn(e, t, n, r) {
2571
+ let i = n && e.contains(e.ownerDocument.activeElement) ? e.ownerDocument.activeElement : null, o = i instanceof HTMLInputElement || i instanceof HTMLTextAreaElement ? [i.selectionStart, i.selectionEnd] : void 0, { scope: a, passThrough: s, effects: d, rootName: u } = oi(e, t, n), c = n ? r ?? Array.from(e.querySelectorAll("[data-slotted]")) : Array.from(e.childNodes), l = { definition: t, scope: a, refs: {}, effects: d, connectCallbacks: /* @__PURE__ */ new Set(), disconnectCallbacks: /* @__PURE__ */ new Set(), connected: false }, m = { definition: t, effects: d, refs: l.refs, connectCallbacks: l.connectCallbacks, disconnectCallbacks: l.disconnectCallbacks, projectedNodes: c, slotInsertions: [], rootName: u, committed: n }, p = Rn(t.template, a, e.ownerDocument, s, m, n ? e : void 0)[0];
2572
+ return n && p !== e && y("HR005", `Server markup for <${t.contract.tag}> has an incompatible root.`), i instanceof HTMLElement && (i.focus({ preventScroll: true }), o !== void 0 && (i instanceof HTMLInputElement || i instanceof HTMLTextAreaElement) && typeof o[0] == "number" && typeof o[1] == "number" && i.setSelectionRange(o[0], o[1])), pt(p, t.contract.tag), l.element = p, { invocation: e, nativeRoot: p, context: m, definition: t, instance: l, replace: !n };
2573
+ }
2574
+ function Vn(e, t) {
2575
+ t.sort((n, r) => n.invocation.contains(r.invocation) ? -1 : r.invocation.contains(n.invocation) ? 1 : 0);
2576
+ for (let n of t) {
2577
+ for (let r of n.context.slotInsertions) {
2578
+ for (let i of r.nodes) Ve(i);
2579
+ r.anchor.replaceWith(...r.nodes);
2580
+ }
2581
+ n.replace && n.invocation.replaceWith(n.nativeRoot), n.context.committed = true, xn.set(n.nativeRoot, n.instance), Ri(n.nativeRoot, n.instance), Ni(n.nativeRoot, n.instance), Ci(n.nativeRoot, n.instance), St(n.instance);
2582
+ }
2583
+ }
2584
+ function En(e, t, n) {
2585
+ e.nodeType === 1 && e.matches(t) && n.add(e);
2586
+ for (let r of e.querySelectorAll(t)) n.add(r);
2587
+ }
2588
+ function Ln(e, t) {
2589
+ let n = e.nodeType === 1 ? e : void 0;
2590
+ if (n?.matches("[data-component-root]") === true && t(n), n?.childElementCount !== 0) for (let r of e.querySelectorAll("[data-component-root]")) t(r);
2591
+ }
2592
+ function Hn(e, t, n) {
2593
+ let r = ke(e), i = /* @__PURE__ */ new Set(), o = ti(r);
2594
+ for (let f of t) En(f, o, i);
2595
+ let a = [];
2596
+ for (let f of i) f.localName === "template" && f.hasAttribute("component") && !je.has(f) && a.push(ni(f, a.length));
2597
+ let s = /* @__PURE__ */ new Map();
2598
+ for (let f of a) {
2599
+ let p = f.definition.contract.tag;
2600
+ (r.definitions.has(p) || s.has(p)) && y("HR001", `More than one definition declares <${p}>.`), s.set(p, f);
2601
+ }
2602
+ let d = [], u = /* @__PURE__ */ new Set(), c = (f, p, h) => {
2603
+ let { definition: v } = f;
2604
+ return je.has(p) || e.defaultView?.customElements.get(v.contract.tag) !== void 0 || n?.(p, v, h) === false ? false : (d.push(Mn(p, v, h)), true);
2605
+ }, l = (f, p) => {
2606
+ for (let h of p) {
2607
+ let v = f.get(h.localName);
2608
+ if (v !== void 0 && c(v, h, false), !h.hasAttribute("data-component-root")) continue;
2609
+ if (J(h) !== void 0) {
2610
+ u.add(h);
2611
+ continue;
2612
+ }
2613
+ let S = false;
2614
+ for (let w of new Set((h.getAttribute("data-component-root") ?? "").split(/\s+/))) {
2615
+ let g = f.get(w);
2616
+ g !== void 0 && c(g, h, true) && (S = true);
2617
+ }
2618
+ S && u.add(h);
2619
+ }
2620
+ };
2621
+ if (l(r.definitions, i), s.size > 0) {
2622
+ let f = ["[data-component-root]", ...Array.from(s.keys())].join(","), p = /* @__PURE__ */ new Set();
2623
+ En(e, f, p), l(s, p);
2624
+ }
2625
+ for (let f of a) ze(r, f.definition.contract.tag, f), f.style !== void 0 && (f.style.textContent = Me(f.style.textContent ?? "", f.definition.contract.tag, f.definition.template.name), f.wrapper.ownerDocument.head.append(f.style)), f.wrapper.remove();
2626
+ Vn(r, d);
2627
+ let m = d.map((f) => f.nativeRoot);
2628
+ for (let f of m) u.add(f);
2629
+ return { lowered: m, roots: Array.from(u) };
2630
+ }
2631
+ function $i(e = document) {
2632
+ return Hn(e, [e]).lowered.length;
2633
+ }
2634
+ function Dn(e, t) {
2635
+ let n = Ie(e), r = n.mutationHub;
2636
+ if (r === void 0) {
2637
+ let o = e.defaultView?.MutationObserver;
2638
+ o === void 0 && y("HR003", "Automatic component management requires a browser MutationObserver.");
2639
+ let a = /* @__PURE__ */ new Set(), s = new o((d) => {
2640
+ for (let u of Array.from(a)) u(d);
2641
+ });
2642
+ r = { observer: s, subscribers: a }, n.mutationHub = r, s.observe(e, { childList: true, subtree: true });
2643
+ }
2644
+ r.subscribers.add(t);
2645
+ let i = true;
2646
+ return () => {
2647
+ i && (i = false, r.subscribers.delete(t), r.subscribers.size === 0 && (r.observer.disconnect(), delete n.mutationHub));
2648
+ };
2649
+ }
2650
+ function Ai(e) {
2651
+ let t = Ie(e), n = t.lifecycle;
2652
+ if (n !== void 0) return n;
2653
+ let r = 0, i = (s) => {
2654
+ let d = s[Y];
2655
+ d !== void 0 && (s.isConnected && d.disconnect === void 0 ? d.disconnect = d.connect(s) : !s.isConnected && d.disconnect !== void 0 && (d.disconnect(), d.disconnect = void 0));
2656
+ }, o = Dn(e, (s) => {
2657
+ let d = [], u = (c) => {
2658
+ if (c.nodeType !== 1) return;
2659
+ let l = c;
2660
+ l[Y] !== void 0 && d.push(l), Ln(l, (m) => {
2661
+ m[Y] !== void 0 && d.push(m);
2662
+ });
2663
+ };
2664
+ for (let c of s) {
2665
+ for (let l of c.addedNodes) u(l);
2666
+ for (let l of c.removedNodes) u(l);
2667
+ }
2668
+ for (let c of d) i(c);
2669
+ }), a = { add(s, d) {
2670
+ let u = s, c = u[Y];
2671
+ c !== d && (c?.disconnect?.(), c === void 0 && (r += 1), u[Y] = d, i(s));
2672
+ }, remove(s, d) {
2673
+ let u = s;
2674
+ u[Y] === d && (d.disconnect?.(), delete u[Y], r -= 1, r === 0 && (o(), delete t.lifecycle));
2675
+ } };
2676
+ return t.lifecycle = a, a;
2677
+ }
2678
+ function Mi(e, t, n = {}) {
2679
+ let r = Ai(e.ownerDocument), i = { connect: (a) => xt(a, t, n), disconnect: void 0 };
2680
+ r.add(e, i);
2681
+ let o = false;
2682
+ return () => {
2683
+ o || (o = true, r.remove(e, i));
2684
+ };
2685
+ }
2686
+ function Vi(e, t = document) {
2687
+ let n = ke(t);
2688
+ for (let r of e) {
2689
+ let i = n.definitions.get(r.contract.tag);
2690
+ if (i !== void 0) {
2691
+ JSON.stringify(i.definition) !== JSON.stringify(r) && y("HR001", `More than one definition declares <${r.contract.tag}>.`);
2692
+ continue;
2693
+ }
2694
+ if (ze(n, r.contract.tag, { definition: r, style: void 0 }), r.css !== "") {
2695
+ let o = t.createElement("style");
2696
+ o.dataset.htmlNextPackage = r.contract.tag, o.textContent = Me(r.css, r.contract.tag, r.template.name), t.head.append(o);
2697
+ }
2698
+ }
2699
+ }
2700
+ function xt(e, t, n = {}) {
2701
+ let r = e.ownerDocument, i = ke(r), o = i.definitions.get(t.contract.tag);
2702
+ if (o === void 0 ? ze(i, t.contract.tag, { definition: t, style: void 0 }) : JSON.stringify(o.definition) !== JSON.stringify(t) && y("HR001", `More than one definition declares <${t.contract.tag}>.`), J(e) === void 0) {
2703
+ let c = [], l = (m, f) => {
2704
+ let p = f.children.filter((w) => w.kind === "text").map((w) => w.value), h = 0, v = f.children.filter((w) => w.kind === "element"), S = 0;
2705
+ for (let w of Array.from(m.childNodes)) {
2706
+ if (w instanceof Element) {
2707
+ if (!(w.getAttribute("data-component")?.split(/\s+/) ?? []).includes(t.contract.tag)) Ve(w), c.push(w);
2708
+ else {
2709
+ for (; S < v.length && v[S].name !== w.localName; ) S += 1;
2710
+ let b = v[S++];
2711
+ b !== void 0 && l(w, b);
2712
+ }
2713
+ continue;
2714
+ }
2715
+ if (w instanceof Text && w.data.trim() !== "") {
2716
+ for (; h < p.length && p[h] !== w.data; ) h += 1;
2717
+ h < p.length ? h += 1 : c.push(w);
2718
+ }
2719
+ }
2720
+ };
2721
+ l(e, t.template), pe(e, t.contract.tag), pt(e, t.contract.tag);
2722
+ for (let [m, f] of Object.entries(t.contract.props)) {
2723
+ let p = Object.hasOwn(n.props ?? {}, m) ? n.props?.[m] : f.default;
2724
+ p !== void 0 && (e[m] = p, "attribute" in f.target && e.setAttribute(`data-${Ee(m)}`, Se(p, f.type)));
2725
+ }
2726
+ Vn(i, [Mn(e, t, true, c)]);
2727
+ }
2728
+ let s = J(e);
2729
+ s === void 0 && y("HR005", `Could not attach <${t.contract.tag}> to its native root.`);
2730
+ for (let [c, l] of Object.entries(n.props ?? {})) c in t.contract.props && (e[c] = l);
2731
+ St(s);
2732
+ let d, u = false;
2733
+ if (n.controller !== void 0) {
2734
+ let c = Promise.resolve(n.controller);
2735
+ Pn(e, c), Promise.resolve(n.controller.default(Tt(e))).then((l) => {
2736
+ typeof l == "function" && (u ? l() : d = l);
2737
+ });
2738
+ }
2739
+ return () => {
2740
+ u || (u = true, d?.(), Et(s));
2741
+ };
2742
+ }
2743
+ function Li(e, t, n = {}) {
2744
+ let r = ke(e.ownerDocument).definitions.get(t);
2745
+ return r === void 0 && y("HR005", `No registered definition declares <${t}>.`), xt(e, r.definition, n);
2746
+ }
2747
+ function St(e) {
2748
+ if (!e.connected) {
2749
+ e.connected = true;
2750
+ for (let t of e.effects) t.resume();
2751
+ for (let t of e.connectCallbacks) t();
2752
+ e.element?.dispatchEvent(new Event("connect"));
2753
+ }
2754
+ }
2755
+ function Et(e) {
2756
+ if (e.connected) {
2757
+ e.element?.dispatchEvent(new Event("disconnect"));
2758
+ for (let t of e.disconnectCallbacks) t();
2759
+ e.connected = false;
2760
+ for (let t of e.effects) t.pause();
2761
+ }
2762
+ }
2763
+ function Tt(e) {
2764
+ let t = J(e);
2765
+ if (t === void 0) return;
2766
+ if (t.host !== void 0) return t.host;
2767
+ let n = new Set((t.definition.declarations ?? []).filter((a) => a.kind === "state").map((a) => a.name)), r = new Proxy({}, { get: (a, s) => {
2768
+ if (typeof s != "string") return;
2769
+ let d = t.scope.get(s);
2770
+ return d === x ? void 0 : d;
2771
+ }, set: (a, s, d) => {
2772
+ if (typeof s != "string" || !n.has(s)) throw new TypeError(`Only declared state roots are writable; \`${String(s)}\` is read-only.`);
2773
+ return t.scope.set(s, d), true;
2774
+ }, has: (a, s) => typeof s == "string" && t.scope.has(s) }), i = new Proxy({}, { get: (a, s) => typeof s != "string" ? void 0 : (e instanceof HTMLFormElement ? e : e.querySelector("form"))?.elements.namedItem(s) ?? e.querySelector(`[name="${CSS.escape(s)}"]`) ?? void 0 }), o = { element: e, state: r, refs: t.refs, elements: i, effect(a) {
2775
+ let s = X(t.scope.scheduler, a, 2);
2776
+ return t.effects.push(s), () => s.stop();
2777
+ }, on(a, s) {
2778
+ if (a === "connect") {
2779
+ let d = s;
2780
+ return t.connectCallbacks.add(d), t.connected && s(), () => t.connectCallbacks.delete(d);
2781
+ }
2782
+ if (a === "disconnect") {
2783
+ let d = s;
2784
+ return t.disconnectCallbacks.add(d), () => t.disconnectCallbacks.delete(d);
2785
+ }
2786
+ return e.addEventListener(a, s), () => e.removeEventListener(a, s);
2787
+ }, dispatch(a, s) {
2788
+ return e.dispatchEvent(new CustomEvent(a, { detail: s, bubbles: true, composed: true }));
2789
+ } };
2790
+ return t.host = Object.freeze(o), t.host;
2791
+ }
2792
+ function Pn(e, t) {
2793
+ let n = J(e);
2794
+ n === void 0 && y("HJ003", "A controller can attach only to a lowered component root."), n.controllerModule = t;
2795
+ }
2796
+ function Hi(e = document, t = {}) {
2797
+ let n = Ie(e);
2798
+ n.observer !== void 0 && y("HR003", "This document is already being observed.");
2799
+ let r = /* @__PURE__ */ new Map(), i = t.onError ?? ((l) => console.error(l)), o = false, a = (l) => {
2800
+ let m = r.get(l);
2801
+ r.delete(l);
2802
+ let f = J(l);
2803
+ f !== void 0 && Et(f);
2804
+ try {
2805
+ m?.();
2806
+ } catch (p) {
2807
+ i(p);
2808
+ }
2809
+ }, s = (l) => {
2810
+ let m = J(l);
2811
+ if (!(m === void 0 || r.has(l) || !e.contains(l))) {
2812
+ r.set(l, void 0);
2813
+ try {
2814
+ St(m);
2815
+ let f = t.onConnect?.(l, m.definition);
2816
+ o ? f?.() : r.set(l, f);
2817
+ } catch (f) {
2818
+ i(f);
2819
+ }
2820
+ }
2821
+ }, d = (l) => {
2822
+ if (o) return;
2823
+ let m = [];
2824
+ if (l === void 0) m.push(e);
2825
+ else {
2826
+ let f = [];
2827
+ for (let p of l) {
2828
+ for (let h of p.removedNodes) h.nodeType === 1 && Ln(h, (v) => {
2829
+ r.has(v) && f.push(v);
2830
+ });
2831
+ for (let h of p.addedNodes) h.nodeType === 1 && m.push(h);
2832
+ }
2833
+ for (let p of f) e.contains(p) || a(p);
2834
+ }
2835
+ if (m.length > 0) try {
2836
+ for (let f of Hn(e, m, t.shouldLower).roots) {
2837
+ if (o) break;
2838
+ s(f);
2839
+ }
2840
+ } catch (f) {
2841
+ i(f);
2842
+ }
2843
+ }, u = Dn(e, d), c = () => {
2844
+ if (!o) {
2845
+ o = true, u(), delete n.observer;
2846
+ for (let l of r.values()) try {
2847
+ l?.();
2848
+ } catch (m) {
2849
+ i(m);
2850
+ }
2851
+ for (let l of r.keys()) {
2852
+ let m = J(l);
2853
+ m !== void 0 && Et(m);
2854
+ }
2855
+ r.clear();
2856
+ }
2857
+ };
2858
+ return n.observer = c, d(), c;
2859
+ }
2860
+ return qn(Di);
2861
+ })();
2862
+ var { attachComponent, attachRegisteredComponent, getComponentHost, installComponentGraph, lowerDocument, manageComponentLifecycle, observeDocument, registerComponentDefinitions, setControllerModule } = HtmlRuntime;
2863
+
2864
+ // src/declarative.ts
2865
+ var stateKey = /* @__PURE__ */ Symbol.for("@threadlabs/looma.declarative.v1");
2866
+ var stateTarget = globalThis;
2867
+ var state = stateTarget[stateKey] ??= {
2868
+ runtime: {
2869
+ attachRegisteredComponent,
2870
+ getComponentHost,
2871
+ lowerDocument,
2872
+ manageComponentLifecycle,
2873
+ observeDocument,
2874
+ setControllerModule
2875
+ },
2876
+ records: /* @__PURE__ */ new Map(),
2877
+ installedPackages: /* @__PURE__ */ new Set(),
2878
+ stopObservation: void 0,
2879
+ observationScheduled: false
2880
+ };
2881
+ function connectController(element, tag) {
2882
+ if (element.getAttribute("data-looma-managed") === "framework") return;
2883
+ const controller = state.records.get(tag)?.controller;
2884
+ if (!controller?.default) return;
2885
+ state.runtime.setControllerModule(element, Promise.resolve(controller));
2886
+ return controller.default(state.runtime.getComponentHost(element));
2887
+ }
2888
+ function scheduleObservation() {
2889
+ if (state.observationScheduled || typeof document === "undefined") return;
2890
+ state.observationScheduled = true;
2891
+ queueMicrotask(() => {
2892
+ state.observationScheduled = false;
2893
+ state.stopObservation?.();
2894
+ state.stopObservation = state.runtime.observeDocument(document, {
2895
+ shouldLower(element) {
2896
+ return element.getAttribute("data-looma-managed") !== "framework";
2897
+ },
2898
+ onConnect(element, definition) {
2899
+ return connectController(element, definition.contract.tag);
2900
+ }
2901
+ });
2902
+ });
2903
+ }
2904
+ function registerLoomaPackage(name, packageRecords, styles) {
2905
+ if (typeof document === "undefined" || state.installedPackages.has(name)) return;
2906
+ state.stopObservation?.();
2907
+ state.stopObservation = void 0;
2908
+ state.installedPackages.add(name);
2909
+ const definitions = document.createElement("div");
2910
+ definitions.hidden = true;
2911
+ definitions.dataset.loomaDefinitions = name;
2912
+ definitions.innerHTML = packageRecords.map(({ source }) => source).join("\n");
2913
+ document.head.append(...Array.from(definitions.children));
2914
+ for (const record of packageRecords) state.records.set(record.tag, record);
2915
+ if (styles !== "") {
2916
+ const style = document.createElement("style");
2917
+ style.dataset.loomaStyles = name;
2918
+ style.textContent = styles;
2919
+ document.head.append(style);
2920
+ }
2921
+ state.runtime.lowerDocument(document);
2922
+ scheduleObservation();
2923
+ }
2924
+ function attachLoomaComponent(element, definition, tag, props) {
2925
+ if (definition.contract.tag !== tag) {
2926
+ throw new TypeError(`Looma definition ${definition.contract.tag} cannot attach as ${tag}.`);
2927
+ }
2928
+ const controller = state.records.get(tag)?.controller;
2929
+ element.setAttribute("data-looma-managed", "framework");
2930
+ return state.runtime.attachRegisteredComponent(element, tag, { props, controller });
2931
+ }
2932
+ function controllerFor(tag) {
2933
+ return state.records.get(tag)?.controller;
2934
+ }
2935
+ function manageComponentLifecycle2(...args) {
2936
+ return state.runtime.manageComponentLifecycle(...args);
2937
+ }
2938
+ // Annotate the CommonJS export names for ESM import in node:
2939
+ 0 && (module.exports = {
2940
+ attachLoomaComponent,
2941
+ controllerFor,
2942
+ manageComponentLifecycle,
2943
+ registerLoomaPackage
2944
+ });