microui-wc 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (609) hide show
  1. package/.github/ISSUE_TEMPLATE/bug_report.md +40 -0
  2. package/.github/ISSUE_TEMPLATE/feature_request.md +33 -0
  3. package/.github/PULL_REQUEST_TEMPLATE.md +28 -0
  4. package/.github/workflows/ci.yml +42 -0
  5. package/.github/workflows/deploy-pages.yml +112 -0
  6. package/AGENTS.md +2366 -0
  7. package/CHANGELOG.md +47 -0
  8. package/CODE_OF_CONDUCT.md +59 -0
  9. package/CONTRIBUTING.md +156 -0
  10. package/LICENSE +190 -0
  11. package/README.md +254 -0
  12. package/SECURITY.md +58 -0
  13. package/app/.generated/routes/alerts.js +8 -0
  14. package/app/.generated/routes/avatars.js +8 -0
  15. package/app/.generated/routes/badges.js +8 -0
  16. package/app/.generated/routes/buttons.js +10 -0
  17. package/app/.generated/routes/cards.js +10 -0
  18. package/app/.generated/routes/checkboxes.js +9 -0
  19. package/app/.generated/routes/chips.js +8 -0
  20. package/app/.generated/routes/dropdowns.js +9 -0
  21. package/app/.generated/routes/home.js +7 -0
  22. package/app/.generated/routes/icons.js +9 -0
  23. package/app/.generated/routes/inputs.js +10 -0
  24. package/app/.generated/routes/installation.js +7 -0
  25. package/app/.generated/routes/layout.js +9 -0
  26. package/app/.generated/routes/modals.js +9 -0
  27. package/app/.generated/routes/navbar.js +7 -0
  28. package/app/.generated/routes/progress.js +9 -0
  29. package/app/.generated/routes/radios.js +9 -0
  30. package/app/.generated/routes/switches.js +9 -0
  31. package/app/.generated/routes/tabs.js +8 -0
  32. package/app/.generated/routes/toasts.js +9 -0
  33. package/app/index.html +67 -0
  34. package/app/pages/alerts.html +23 -0
  35. package/app/pages/avatars.html +22 -0
  36. package/app/pages/badges.html +22 -0
  37. package/app/pages/buttons.html +71 -0
  38. package/app/pages/cards.html +54 -0
  39. package/app/pages/checkboxes.html +39 -0
  40. package/app/pages/chips.html +23 -0
  41. package/app/pages/dropdowns.html +41 -0
  42. package/app/pages/home.html +59 -0
  43. package/app/pages/icons.html +29 -0
  44. package/app/pages/inputs.html +66 -0
  45. package/app/pages/installation.html +34 -0
  46. package/app/pages/layout.html +30 -0
  47. package/app/pages/modals.html +21 -0
  48. package/app/pages/navbar.html +22 -0
  49. package/app/pages/progress.html +35 -0
  50. package/app/pages/radios.html +40 -0
  51. package/app/pages/switches.html +39 -0
  52. package/app/pages/tabs.html +30 -0
  53. package/app/pages/toasts.html +22 -0
  54. package/app-dist/index.html +67 -0
  55. package/app-dist/pages/alerts.html +23 -0
  56. package/app-dist/pages/avatars.html +22 -0
  57. package/app-dist/pages/badges.html +22 -0
  58. package/app-dist/pages/buttons.html +71 -0
  59. package/app-dist/pages/cards.html +54 -0
  60. package/app-dist/pages/checkboxes.html +39 -0
  61. package/app-dist/pages/chips.html +23 -0
  62. package/app-dist/pages/dropdowns.html +41 -0
  63. package/app-dist/pages/home.html +59 -0
  64. package/app-dist/pages/icons.html +29 -0
  65. package/app-dist/pages/inputs.html +66 -0
  66. package/app-dist/pages/installation.html +34 -0
  67. package/app-dist/pages/layout.html +30 -0
  68. package/app-dist/pages/modals.html +21 -0
  69. package/app-dist/pages/navbar.html +22 -0
  70. package/app-dist/pages/progress.html +35 -0
  71. package/app-dist/pages/radios.html +40 -0
  72. package/app-dist/pages/switches.html +39 -0
  73. package/app-dist/pages/tabs.html +30 -0
  74. package/app-dist/pages/toasts.html +22 -0
  75. package/app-dist/pages.json +217 -0
  76. package/app-dist/routes/alerts.js +5 -0
  77. package/app-dist/routes/avatars.js +1 -0
  78. package/app-dist/routes/badges.js +1 -0
  79. package/app-dist/routes/buttons.js +1 -0
  80. package/app-dist/routes/cards.js +1 -0
  81. package/app-dist/routes/checkboxes.js +9 -0
  82. package/app-dist/routes/chips.js +4 -0
  83. package/app-dist/routes/chunk-019e5e2f.js +5 -0
  84. package/app-dist/routes/chunk-0m4j19yd.js +2 -0
  85. package/app-dist/routes/chunk-0tmmp5q0.js +1 -0
  86. package/app-dist/routes/chunk-10xn709r.js +1 -0
  87. package/app-dist/routes/chunk-15m2qcda.js +2 -0
  88. package/app-dist/routes/chunk-1bh8g23n.js +1 -0
  89. package/app-dist/routes/chunk-1vg0v937.js +1 -0
  90. package/app-dist/routes/chunk-1zvcgy3j.js +1 -0
  91. package/app-dist/routes/chunk-2afb0861.js +1 -0
  92. package/app-dist/routes/chunk-2c6ttpzt.js +5 -0
  93. package/app-dist/routes/chunk-3dy30fhs.js +1 -0
  94. package/app-dist/routes/chunk-426dnces.js +13 -0
  95. package/app-dist/routes/chunk-44kgxery.js +1 -0
  96. package/app-dist/routes/chunk-47fdnejd.js +33 -0
  97. package/app-dist/routes/chunk-49a6t2vq.js +1 -0
  98. package/app-dist/routes/chunk-4fe1rm5b.js +1 -0
  99. package/app-dist/routes/chunk-4ggmvkta.js +33 -0
  100. package/app-dist/routes/chunk-4vkz81q7.js +33 -0
  101. package/app-dist/routes/chunk-4w4tmj8f.js +31 -0
  102. package/app-dist/routes/chunk-532s62kr.js +31 -0
  103. package/app-dist/routes/chunk-5hm3bssy.js +33 -0
  104. package/app-dist/routes/chunk-5vrh24hc.js +1 -0
  105. package/app-dist/routes/chunk-61pcg25a.js +1 -0
  106. package/app-dist/routes/chunk-6nfhygvf.js +1 -0
  107. package/app-dist/routes/chunk-700e7je6.js +33 -0
  108. package/app-dist/routes/chunk-7fsn17kg.js +1 -0
  109. package/app-dist/routes/chunk-7k789b32.js +1 -0
  110. package/app-dist/routes/chunk-7r46q0ys.js +36 -0
  111. package/app-dist/routes/chunk-86fmc1fr.js +5 -0
  112. package/app-dist/routes/chunk-8qth37vw.js +1 -0
  113. package/app-dist/routes/chunk-924wv8n0.js +1 -0
  114. package/app-dist/routes/chunk-9mbhgxk9.js +1 -0
  115. package/app-dist/routes/chunk-a216hyd9.js +1 -0
  116. package/app-dist/routes/chunk-akzxykh9.js +33 -0
  117. package/app-dist/routes/chunk-b3dcvy8c.js +1 -0
  118. package/app-dist/routes/chunk-b74zahz5.js +31 -0
  119. package/app-dist/routes/chunk-bftj53p2.js +5 -0
  120. package/app-dist/routes/chunk-c01hnz3e.js +1 -0
  121. package/app-dist/routes/chunk-d8pvv5km.js +1 -0
  122. package/app-dist/routes/chunk-dev0aezr.js +2 -0
  123. package/app-dist/routes/chunk-dh6vnv0e.js +1 -0
  124. package/app-dist/routes/chunk-dn2cbpva.js +36 -0
  125. package/app-dist/routes/chunk-dvn0my90.js +1 -0
  126. package/app-dist/routes/chunk-dvq8mnve.js +36 -0
  127. package/app-dist/routes/chunk-e8c2gc4d.js +5 -0
  128. package/app-dist/routes/chunk-ejf9ak2x.js +1 -0
  129. package/app-dist/routes/chunk-f083m55s.js +1 -0
  130. package/app-dist/routes/chunk-fnrj28s1.js +31 -0
  131. package/app-dist/routes/chunk-fvg3yjdp.js +31 -0
  132. package/app-dist/routes/chunk-g7k381n1.js +1 -0
  133. package/app-dist/routes/chunk-h01kq2ae.js +13 -0
  134. package/app-dist/routes/chunk-h4dk761v.js +5 -0
  135. package/app-dist/routes/chunk-hmx91z2x.js +5 -0
  136. package/app-dist/routes/chunk-hxbg4m42.js +36 -0
  137. package/app-dist/routes/chunk-jbjnfp2b.js +2 -0
  138. package/app-dist/routes/chunk-jxtz5vv6.js +36 -0
  139. package/app-dist/routes/chunk-jxzcs0ey.js +36 -0
  140. package/app-dist/routes/chunk-kt7wwhcx.js +1 -0
  141. package/app-dist/routes/chunk-kzptszyc.js +33 -0
  142. package/app-dist/routes/chunk-mhgca4w4.js +2 -0
  143. package/app-dist/routes/chunk-mhswxa20.js +1 -0
  144. package/app-dist/routes/chunk-n8zfeex6.js +1 -0
  145. package/app-dist/routes/chunk-pee47b2r.js +1 -0
  146. package/app-dist/routes/chunk-pesmw829.js +1 -0
  147. package/app-dist/routes/chunk-pgc4c6f3.js +36 -0
  148. package/app-dist/routes/chunk-q8egegm1.js +1 -0
  149. package/app-dist/routes/chunk-q9mn2qyq.js +36 -0
  150. package/app-dist/routes/chunk-qh0rtaf3.js +5 -0
  151. package/app-dist/routes/chunk-qqhmk6ye.js +2 -0
  152. package/app-dist/routes/chunk-qrxygmf7.js +33 -0
  153. package/app-dist/routes/chunk-r46yzksx.js +36 -0
  154. package/app-dist/routes/chunk-rgpbw2w0.js +5 -0
  155. package/app-dist/routes/chunk-rnpzv3d8.js +2 -0
  156. package/app-dist/routes/chunk-s5v8cv05.js +2 -0
  157. package/app-dist/routes/chunk-sbwn5bpc.js +1 -0
  158. package/app-dist/routes/chunk-sqbg8jbt.js +33 -0
  159. package/app-dist/routes/chunk-sv8dqnf7.js +1 -0
  160. package/app-dist/routes/chunk-t67sw3za.js +1 -0
  161. package/app-dist/routes/chunk-tjdpqwdf.js +31 -0
  162. package/app-dist/routes/chunk-tq2mfghg.js +1 -0
  163. package/app-dist/routes/chunk-ttn10vt6.js +1 -0
  164. package/app-dist/routes/chunk-v2hzpjxr.js +1 -0
  165. package/app-dist/routes/chunk-wfjjkw9y.js +1 -0
  166. package/app-dist/routes/chunk-wt8cxzmf.js +31 -0
  167. package/app-dist/routes/chunk-x45d372k.js +5 -0
  168. package/app-dist/routes/chunk-y3wsazkt.js +1 -0
  169. package/app-dist/routes/chunk-y7pmgc7t.js +33 -0
  170. package/app-dist/routes/chunk-zefdt2q3.js +31 -0
  171. package/app-dist/routes/dropdowns.js +6 -0
  172. package/app-dist/routes/home.js +1 -0
  173. package/app-dist/routes/icons.js +1 -0
  174. package/app-dist/routes/inputs.js +12 -0
  175. package/app-dist/routes/installation.js +1 -0
  176. package/app-dist/routes/layout.js +1 -0
  177. package/app-dist/routes/modals.js +7 -0
  178. package/app-dist/routes/navbar.js +1 -0
  179. package/app-dist/routes/progress.js +1 -0
  180. package/app-dist/routes/radios.js +6 -0
  181. package/app-dist/routes/switches.js +6 -0
  182. package/app-dist/routes/tabs.js +1 -0
  183. package/app-dist/routes/toasts.js +16 -0
  184. package/assets/fonts/material-symbols-mini.woff2 +0 -0
  185. package/assets/fonts/material-symbols.woff2 +0 -0
  186. package/assets/fonts/roboto-400.woff2 +0 -0
  187. package/assets/fonts/roboto-500.woff2 +0 -0
  188. package/assets/fonts/roboto-700.woff2 +0 -0
  189. package/assets/logo-banner-400.jpg +0 -0
  190. package/assets/logo-banner-400.webp +0 -0
  191. package/assets/logo-banner-800.webp +0 -0
  192. package/assets/logo-banner.jpg +0 -0
  193. package/assets/logo-icon-64.jpg +0 -0
  194. package/assets/logo-icon-64.webp +0 -0
  195. package/assets/logo-icon.jpg +0 -0
  196. package/assets/logo-square.jpg +0 -0
  197. package/bun.lock +312 -0
  198. package/bunfig.toml +4 -0
  199. package/custom-elements.json +1916 -0
  200. package/demo/api/sample-data.json +38 -0
  201. package/demo/content/alerts.html +115 -0
  202. package/demo/content/avatars.html +70 -0
  203. package/demo/content/badges.html +65 -0
  204. package/demo/content/buttons.html +188 -0
  205. package/demo/content/callouts.html +91 -0
  206. package/demo/content/cards.html +121 -0
  207. package/demo/content/checkboxes.html +178 -0
  208. package/demo/content/chips.html +67 -0
  209. package/demo/content/codeblocks.html +101 -0
  210. package/demo/content/confirms.html +115 -0
  211. package/demo/content/datatables.html +149 -0
  212. package/demo/content/dividers.html +119 -0
  213. package/demo/content/dropdowns.html +89 -0
  214. package/demo/content/enterprise.html +252 -0
  215. package/demo/content/home.html +149 -0
  216. package/demo/content/icons.html +89 -0
  217. package/demo/content/inputs.html +135 -0
  218. package/demo/content/installation.html +16 -0
  219. package/demo/content/layout.html +136 -0
  220. package/demo/content/modals.html +141 -0
  221. package/demo/content/navbar.html +70 -0
  222. package/demo/content/progress.html +119 -0
  223. package/demo/content/radios.html +88 -0
  224. package/demo/content/skeletons.html +109 -0
  225. package/demo/content/spinners.html +96 -0
  226. package/demo/content/switches.html +84 -0
  227. package/demo/content/tables.html +124 -0
  228. package/demo/content/tabs.html +85 -0
  229. package/demo/content/toasts.html +116 -0
  230. package/demo/content/tooltips.html +107 -0
  231. package/demo/content/virtual-lists.html +233 -0
  232. package/demo/favicon.ico +0 -0
  233. package/demo/favicon.png +0 -0
  234. package/demo/full.html +52 -0
  235. package/demo/iife.html +46 -0
  236. package/demo/manifest.json +34 -0
  237. package/demo/pages/datatable-demo.html +237 -0
  238. package/demo/pages/prompt-ui-demo.html +218 -0
  239. package/demo/pages/responsive-demo.html +122 -0
  240. package/demo/pages/schema-form-demo.html +270 -0
  241. package/demo/robots.txt +6 -0
  242. package/demo/shell.html +712 -0
  243. package/demo/sw.js +387 -0
  244. package/dist/AGENTS.md +2366 -0
  245. package/dist/README.md +254 -0
  246. package/dist/chunks/advanced.js +174 -0
  247. package/dist/chunks/chunk-1nhr1wrq.js +14 -0
  248. package/dist/chunks/chunk-hssyjbr0.js +2 -0
  249. package/dist/chunks/chunk-k8etzx0z.js +2 -0
  250. package/dist/chunks/chunk-rr1et8fg.js +2 -0
  251. package/dist/chunks/chunk-sjcx4fd5.js +6 -0
  252. package/dist/chunks/chunk-v1c777xh.js +5 -0
  253. package/dist/chunks/chunk-w5k5vwjd.js +13 -0
  254. package/dist/chunks/core.js +10 -0
  255. package/dist/chunks/display.js +17 -0
  256. package/dist/chunks/feedback.js +15 -0
  257. package/dist/chunks/forms.js +48 -0
  258. package/dist/chunks/layout.js +9 -0
  259. package/dist/components/chunk-4tezav8r.js +2 -0
  260. package/dist/components/chunk-fqyb2pms.js +2 -0
  261. package/dist/components/chunk-h7cdbhxw.js +13 -0
  262. package/dist/components/chunk-mzd8jwrs.js +2 -0
  263. package/dist/components/chunk-qwmxyn8e.js +2 -0
  264. package/dist/components/chunk-redtk47a.js +14 -0
  265. package/dist/components/mu-alert.js +5 -0
  266. package/dist/components/mu-api-table.js +33 -0
  267. package/dist/components/mu-avatar.js +1 -0
  268. package/dist/components/mu-badge.js +1 -0
  269. package/dist/components/mu-bottom-nav.js +1 -0
  270. package/dist/components/mu-button.js +1 -0
  271. package/dist/components/mu-callout.js +1 -0
  272. package/dist/components/mu-card.js +1 -0
  273. package/dist/components/mu-checkbox.js +9 -0
  274. package/dist/components/mu-chip.js +4 -0
  275. package/dist/components/mu-code.js +48 -0
  276. package/dist/components/mu-confirm.js +10 -0
  277. package/dist/components/mu-container.js +1 -0
  278. package/dist/components/mu-datatable.js +96 -0
  279. package/dist/components/mu-divider.js +1 -0
  280. package/dist/components/mu-doc-page.js +26 -0
  281. package/dist/components/mu-drawer-item.js +9 -0
  282. package/dist/components/mu-drawer.js +1 -0
  283. package/dist/components/mu-dropdown.js +6 -0
  284. package/dist/components/mu-error-boundary.js +10 -0
  285. package/dist/components/mu-example.js +38 -0
  286. package/dist/components/mu-fetch.js +1 -0
  287. package/dist/components/mu-form.js +1 -0
  288. package/dist/components/mu-grid.js +1 -0
  289. package/dist/components/mu-icon.js +5 -0
  290. package/dist/components/mu-input.js +12 -0
  291. package/dist/components/mu-layout.js +1 -0
  292. package/dist/components/mu-lazy.js +1 -0
  293. package/dist/components/mu-modal.js +7 -0
  294. package/dist/components/mu-navbar.js +1 -0
  295. package/dist/components/mu-page.js +1 -0
  296. package/dist/components/mu-progress.js +1 -0
  297. package/dist/components/mu-prompt-ui.js +20 -0
  298. package/dist/components/mu-radio.js +6 -0
  299. package/dist/components/mu-repeat.js +1 -0
  300. package/dist/components/mu-router.js +6 -0
  301. package/dist/components/mu-schema-form.js +76 -0
  302. package/dist/components/mu-sidebar.js +1 -0
  303. package/dist/components/mu-skeleton.js +13 -0
  304. package/dist/components/mu-spinner.js +1 -0
  305. package/dist/components/mu-stack.js +1 -0
  306. package/dist/components/mu-switch.js +6 -0
  307. package/dist/components/mu-table.js +1 -0
  308. package/dist/components/mu-tabs.js +1 -0
  309. package/dist/components/mu-textarea.js +11 -0
  310. package/dist/components/mu-theme-toggle.js +5 -0
  311. package/dist/components/mu-toast.js +4 -0
  312. package/dist/components/mu-tooltip.js +10 -0
  313. package/dist/components/mu-virtual-list.js +33 -0
  314. package/dist/components.css +1 -0
  315. package/dist/microui.css +1 -0
  316. package/dist/microui.d.ts +234 -0
  317. package/dist/microui.esm.js +549 -0
  318. package/dist/microui.esm.js.map +79 -0
  319. package/dist/microui.min.js +549 -0
  320. package/dist/microui.min.js.map +79 -0
  321. package/dist/routes/alerts.js +1 -0
  322. package/dist/routes/avatars.js +1 -0
  323. package/dist/routes/badges.js +1 -0
  324. package/dist/routes/buttons.js +1 -0
  325. package/dist/routes/callouts.js +1 -0
  326. package/dist/routes/cards.js +1 -0
  327. package/dist/routes/checkboxes.js +9 -0
  328. package/dist/routes/chips.js +4 -0
  329. package/dist/routes/chunk-19wgcncm.js +2 -0
  330. package/dist/routes/chunk-1khyr3v1.js +33 -0
  331. package/dist/routes/chunk-4rhxe97g.js +1 -0
  332. package/dist/routes/chunk-5qah04bh.js +2 -0
  333. package/dist/routes/chunk-7gfxy70n.js +5 -0
  334. package/dist/routes/chunk-e86zbeta.js +1 -0
  335. package/dist/routes/chunk-fagt36h6.js +2 -0
  336. package/dist/routes/chunk-fed7zr7m.js +1 -0
  337. package/dist/routes/chunk-hwj7pfwp.js +1 -0
  338. package/dist/routes/chunk-mhvcs2f8.js +5 -0
  339. package/dist/routes/chunk-nv3bddmj.js +13 -0
  340. package/dist/routes/chunk-q3f2aeqe.js +7 -0
  341. package/dist/routes/chunk-qxxa8trk.js +1 -0
  342. package/dist/routes/chunk-rw15y9zh.js +1 -0
  343. package/dist/routes/chunk-sfb7x11v.js +5 -0
  344. package/dist/routes/chunk-swyhghrm.js +48 -0
  345. package/dist/routes/chunk-sxddjs2d.js +2 -0
  346. package/dist/routes/chunk-vby0zg5w.js +17 -0
  347. package/dist/routes/chunk-w6zqjqqs.js +9 -0
  348. package/dist/routes/chunk-z960rexd.js +38 -0
  349. package/dist/routes/codeblocks.js +1 -0
  350. package/dist/routes/confirms.js +10 -0
  351. package/dist/routes/datatables.js +96 -0
  352. package/dist/routes/dividers.js +1 -0
  353. package/dist/routes/dropdowns.js +6 -0
  354. package/dist/routes/enterprise.js +15 -0
  355. package/dist/routes/home.js +1 -0
  356. package/dist/routes/icons.js +1 -0
  357. package/dist/routes/inputs.js +22 -0
  358. package/dist/routes/installation.js +1 -0
  359. package/dist/routes/layout.js +1 -0
  360. package/dist/routes/modals.js +1 -0
  361. package/dist/routes/navbar.js +1 -0
  362. package/dist/routes/page-components.json +316 -0
  363. package/dist/routes/progress.js +1 -0
  364. package/dist/routes/radios.js +6 -0
  365. package/dist/routes/route-deps.json +156 -0
  366. package/dist/routes/shell-critical.js +1 -0
  367. package/dist/routes/shell-deferred.js +1 -0
  368. package/dist/routes/shell.js +20 -0
  369. package/dist/routes/skeletons.js +13 -0
  370. package/dist/routes/spinners.js +1 -0
  371. package/dist/routes/src/chunks/core.js +36 -0
  372. package/dist/routes/switches.js +6 -0
  373. package/dist/routes/tables.js +1 -0
  374. package/dist/routes/tabs.js +1 -0
  375. package/dist/routes/toasts.js +1 -0
  376. package/dist/routes/tooltips.js +10 -0
  377. package/dist/routes/virtual-lists.js +33 -0
  378. package/dist/styles/common.css +1 -0
  379. package/dist/styles/components/animations.css +1 -0
  380. package/dist/styles/components/avatar.css +1 -0
  381. package/dist/styles/components/badge.css +1 -0
  382. package/dist/styles/components/bottom-nav.css +1 -0
  383. package/dist/styles/components/button.css +1 -0
  384. package/dist/styles/components/card.css +1 -0
  385. package/dist/styles/components/checkbox.css +1 -0
  386. package/dist/styles/components/chip.css +1 -0
  387. package/dist/styles/components/datatable.css +1 -0
  388. package/dist/styles/components/divider.css +1 -0
  389. package/dist/styles/components/drawer-item.css +1 -0
  390. package/dist/styles/components/drawer.css +1 -0
  391. package/dist/styles/components/grid.css +1 -0
  392. package/dist/styles/components/icon.css +1 -0
  393. package/dist/styles/components/input.css +1 -0
  394. package/dist/styles/components/layout.css +1 -0
  395. package/dist/styles/components/navbar.css +1 -0
  396. package/dist/styles/components/overlays.css +1 -0
  397. package/dist/styles/components/progress.css +1 -0
  398. package/dist/styles/components/prompt-ui.css +1 -0
  399. package/dist/styles/components/radio.css +1 -0
  400. package/dist/styles/components/schema-form.css +1 -0
  401. package/dist/styles/components/switch.css +1 -0
  402. package/dist/styles/components/tabs.css +1 -0
  403. package/dist/styles/components/tooltip.css +1 -0
  404. package/dist/styles/components/virtual-list.css +1 -0
  405. package/dist/tokens.css +1 -0
  406. package/docs/api-reference.md +175 -0
  407. package/docs/component-schema.md +231 -0
  408. package/docs/components.md +269 -0
  409. package/docs/design-system.md +183 -0
  410. package/docs/getting-started.md +198 -0
  411. package/docs/message-protocol.md +262 -0
  412. package/docs/utility-classes.md +205 -0
  413. package/lighthouse-audit.mjs +113 -0
  414. package/package.json +45 -0
  415. package/scripts/analyze-components.js +105 -0
  416. package/scripts/build-app.js +193 -0
  417. package/scripts/build-framework.js +444 -0
  418. package/scripts/build-utils.js +101 -0
  419. package/scripts/test-isolated.js +151 -0
  420. package/server.js +256 -0
  421. package/src/chunks/advanced.js +27 -0
  422. package/src/chunks/core.js +61 -0
  423. package/src/chunks/display.js +25 -0
  424. package/src/chunks/feedback.js +15 -0
  425. package/src/chunks/forms.js +25 -0
  426. package/src/chunks/layout.js +27 -0
  427. package/src/components/mu-alert.js +96 -0
  428. package/src/components/mu-api-table.js +167 -0
  429. package/src/components/mu-avatar.js +94 -0
  430. package/src/components/mu-badge.js +32 -0
  431. package/src/components/mu-bottom-nav.js +115 -0
  432. package/src/components/mu-button.js +61 -0
  433. package/src/components/mu-callout.js +71 -0
  434. package/src/components/mu-card.js +36 -0
  435. package/src/components/mu-checkbox.js +186 -0
  436. package/src/components/mu-chip.js +125 -0
  437. package/src/components/mu-code.js +534 -0
  438. package/src/components/mu-confirm.js +268 -0
  439. package/src/components/mu-container.js +53 -0
  440. package/src/components/mu-datatable.js +517 -0
  441. package/src/components/mu-divider.js +40 -0
  442. package/src/components/mu-doc-page.js +100 -0
  443. package/src/components/mu-drawer-item.js +158 -0
  444. package/src/components/mu-drawer.js +305 -0
  445. package/src/components/mu-dropdown.js +239 -0
  446. package/src/components/mu-error-boundary.js +191 -0
  447. package/src/components/mu-example.js +335 -0
  448. package/src/components/mu-fetch.js +256 -0
  449. package/src/components/mu-form.js +133 -0
  450. package/src/components/mu-grid.js +63 -0
  451. package/src/components/mu-icon.js +211 -0
  452. package/src/components/mu-input.js +142 -0
  453. package/src/components/mu-layout.js +129 -0
  454. package/src/components/mu-lazy.js +94 -0
  455. package/src/components/mu-modal.js +160 -0
  456. package/src/components/mu-navbar.js +71 -0
  457. package/src/components/mu-page.js +77 -0
  458. package/src/components/mu-progress.js +54 -0
  459. package/src/components/mu-prompt-ui.js +382 -0
  460. package/src/components/mu-radio.js +200 -0
  461. package/src/components/mu-repeat.js +135 -0
  462. package/src/components/mu-router.js +169 -0
  463. package/src/components/mu-schema-form.js +441 -0
  464. package/src/components/mu-sidebar.js +81 -0
  465. package/src/components/mu-skeleton.js +69 -0
  466. package/src/components/mu-spinner.js +30 -0
  467. package/src/components/mu-stack.js +59 -0
  468. package/src/components/mu-switch.js +150 -0
  469. package/src/components/mu-table.js +80 -0
  470. package/src/components/mu-tabs.js +112 -0
  471. package/src/components/mu-textarea.js +96 -0
  472. package/src/components/mu-theme-toggle.js +52 -0
  473. package/src/components/mu-toast.js +151 -0
  474. package/src/components/mu-tooltip.js +182 -0
  475. package/src/components/mu-virtual-list.js +184 -0
  476. package/src/core/MuElement.js +562 -0
  477. package/src/core/agent-api.js +771 -0
  478. package/src/core/breakpoints.js +195 -0
  479. package/src/core/bus.js +378 -0
  480. package/src/core/component-schema.js +287 -0
  481. package/src/core/feature-registry.js +241 -0
  482. package/src/core/form-state.js +252 -0
  483. package/src/core/http.js +104 -0
  484. package/src/core/keyboard.js +105 -0
  485. package/src/core/layers.js +71 -0
  486. package/src/core/render.js +201 -0
  487. package/src/core/ripple.js +158 -0
  488. package/src/core/router.js +100 -0
  489. package/src/core/scheduler.js +109 -0
  490. package/src/core/signals.js +164 -0
  491. package/src/core/store.js +268 -0
  492. package/src/core/theme.js +68 -0
  493. package/src/core/transitions.js +72 -0
  494. package/src/core/utils.js +30 -0
  495. package/src/index.d.ts +234 -0
  496. package/src/index.js +308 -0
  497. package/src/styles/animations.css +252 -0
  498. package/src/styles/common.css +82 -0
  499. package/src/styles/components/animations.css +129 -0
  500. package/src/styles/components/avatar.css +83 -0
  501. package/src/styles/components/badge.css +80 -0
  502. package/src/styles/components/bottom-nav.css +37 -0
  503. package/src/styles/components/button.css +348 -0
  504. package/src/styles/components/card.css +138 -0
  505. package/src/styles/components/checkbox.css +201 -0
  506. package/src/styles/components/chip.css +93 -0
  507. package/src/styles/components/datatable.css +180 -0
  508. package/src/styles/components/divider.css +49 -0
  509. package/src/styles/components/drawer-item.css +123 -0
  510. package/src/styles/components/drawer.css +273 -0
  511. package/src/styles/components/grid.css +189 -0
  512. package/src/styles/components/icon.css +40 -0
  513. package/src/styles/components/input.css +203 -0
  514. package/src/styles/components/layout.css +121 -0
  515. package/src/styles/components/navbar.css +91 -0
  516. package/src/styles/components/overlays.css +329 -0
  517. package/src/styles/components/progress.css +79 -0
  518. package/src/styles/components/prompt-ui.css +286 -0
  519. package/src/styles/components/radio.css +17 -0
  520. package/src/styles/components/schema-form.css +85 -0
  521. package/src/styles/components/switch.css +69 -0
  522. package/src/styles/components/tabs.css +145 -0
  523. package/src/styles/components/tooltip.css +93 -0
  524. package/src/styles/components/virtual-list.css +36 -0
  525. package/src/styles/components.css +3677 -0
  526. package/src/styles/routes/home.css +97 -0
  527. package/src/styles/tokens.css +675 -0
  528. package/tests/agents/agent-integration.test.js +76 -0
  529. package/tests/benchmark.html +296 -0
  530. package/tests/build/scan-components.test.js +173 -0
  531. package/tests/components/all-components.test.js +245 -0
  532. package/tests/components/all-missing-components.test.js +574 -0
  533. package/tests/components/mu-alert.test.js +113 -0
  534. package/tests/components/mu-avatar.test.js +148 -0
  535. package/tests/components/mu-badge.test.js +92 -0
  536. package/tests/components/mu-button.test.js +112 -0
  537. package/tests/components/mu-card.test.js +89 -0
  538. package/tests/components/mu-checkbox.test.js +158 -0
  539. package/tests/components/mu-chip.test.js +118 -0
  540. package/tests/components/mu-container.test.js +120 -0
  541. package/tests/components/mu-divider.test.js +98 -0
  542. package/tests/components/mu-drawer-item.test.js +199 -0
  543. package/tests/components/mu-drawer.test.js +96 -0
  544. package/tests/components/mu-dropdown.test.js +125 -0
  545. package/tests/components/mu-form.test.js +138 -0
  546. package/tests/components/mu-grid.test.js +135 -0
  547. package/tests/components/mu-icon.test.js +110 -0
  548. package/tests/components/mu-input.test.js +131 -0
  549. package/tests/components/mu-lazy.test.js +103 -0
  550. package/tests/components/mu-modal.test.js +275 -0
  551. package/tests/components/mu-navbar.test.js +101 -0
  552. package/tests/components/mu-progress.test.js +115 -0
  553. package/tests/components/mu-radio.test.js +114 -0
  554. package/tests/components/mu-repeat.test.js +106 -0
  555. package/tests/components/mu-sidebar.test.js +126 -0
  556. package/tests/components/mu-skeleton.test.js +162 -0
  557. package/tests/components/mu-stack.test.js +143 -0
  558. package/tests/components/mu-switch.test.js +292 -0
  559. package/tests/components/mu-table.test.js +124 -0
  560. package/tests/components/mu-tabs.test.js +104 -0
  561. package/tests/components/mu-textarea.test.js +115 -0
  562. package/tests/components/mu-toast.test.js +321 -0
  563. package/tests/components/mu-tooltip.test.js +133 -0
  564. package/tests/components/mu-virtual-list.test.js +109 -0
  565. package/tests/core/MuElement.test.js +120 -0
  566. package/tests/core/agent-api.test.js +125 -0
  567. package/tests/core/all-core-modules.test.js +442 -0
  568. package/tests/core/bus.test.js +364 -0
  569. package/tests/core/component-schema.test.js +160 -0
  570. package/tests/core/feature-registry.test.js +198 -0
  571. package/tests/core/form-state.test.js +167 -0
  572. package/tests/core/http.test.js +119 -0
  573. package/tests/core/keyboard.test.js +319 -0
  574. package/tests/core/layers.test.js +129 -0
  575. package/tests/core/namespaced-stores.test.js +114 -0
  576. package/tests/core/render.test.js +121 -0
  577. package/tests/core/ripple.test.js +131 -0
  578. package/tests/core/router.test.js +89 -0
  579. package/tests/core/scheduler.test.js +121 -0
  580. package/tests/core/signals.test.js +128 -0
  581. package/tests/core/store.test.js +171 -0
  582. package/tests/core/transitions.test.js +82 -0
  583. package/tests/e2e/accessibility-harness.html +58 -0
  584. package/tests/e2e/accessibility.test.js +401 -0
  585. package/tests/e2e/agent-features.test.js +372 -0
  586. package/tests/e2e/card-spacing.test.js +287 -0
  587. package/tests/e2e/components.test.js +439 -0
  588. package/tests/e2e/demo-routes.test.js +478 -0
  589. package/tests/e2e/layout-css-fallback.test.js +334 -0
  590. package/tests/e2e/mu-alert.e2e.test.js +111 -0
  591. package/tests/e2e/mu-checkbox.test.js +489 -0
  592. package/tests/e2e/mu-chip.test.js +347 -0
  593. package/tests/e2e/mu-form.test.js +499 -0
  594. package/tests/e2e/mu-icon.test.js +114 -0
  595. package/tests/e2e/mu-radio.test.js +113 -0
  596. package/tests/e2e/mu-skeleton.test.js +140 -0
  597. package/tests/e2e/mu-switch.test.js +415 -0
  598. package/tests/e2e/mu-tabs.test.js +494 -0
  599. package/tests/e2e/mu-textarea.test.js +242 -0
  600. package/tests/e2e/mu-virtual-list.test.js +427 -0
  601. package/tests/e2e/perf-memory.test.js +161 -0
  602. package/tests/e2e/puppeteer-helper.js +137 -0
  603. package/tests/e2e/puppeteer.test.js +226 -0
  604. package/tests/e2e/pwa.test.js +261 -0
  605. package/tests/e2e/test-harness.html +319 -0
  606. package/tests/manual/test-components.html +120 -0
  607. package/tests/memory-test.html +309 -0
  608. package/tests/setup-dom.js +93 -0
  609. package/tests/visual-test.html +301 -0
@@ -0,0 +1 @@
1
+ import"./chunk-mhvcs2f8.js";import"./chunk-sfb7x11v.js";import"./chunk-qxxa8trk.js";import"./chunk-z960rexd.js";import"./chunk-sxddjs2d.js";import"./chunk-swyhghrm.js";import"./chunk-e86zbeta.js";import"./chunk-5qah04bh.js";
@@ -0,0 +1 @@
1
+ import"./chunk-fed7zr7m.js";import"./chunk-z960rexd.js";import"./chunk-sxddjs2d.js";import"./chunk-swyhghrm.js";import"./chunk-e86zbeta.js";import"./chunk-5qah04bh.js";
@@ -0,0 +1 @@
1
+ import"./chunk-z960rexd.js";import"./chunk-sxddjs2d.js";import"./chunk-swyhghrm.js";import"./chunk-e86zbeta.js";import{j as e,k as s}from"./chunk-5qah04bh.js";class i extends e{static baseClass="mu-badge";static cssFile="badge";static observedAttributes=["variant","size"];connectedCallback(){super.connectedCallback(),this.#t()}render(){this.#t()}update(t,a,r){this.#t()}#t(){let t=this.attr("variant","primary"),a=this.attr("size","md");this.className=`mu-badge mu-badge--${t} mu-badge--${a}`}}s("mu-badge",i);
@@ -0,0 +1 @@
1
+ import"./chunk-rw15y9zh.js";import"./chunk-1khyr3v1.js";import"./chunk-nv3bddmj.js";import"./chunk-z960rexd.js";import"./chunk-sxddjs2d.js";import"./chunk-swyhghrm.js";import"./chunk-e86zbeta.js";import"./chunk-5qah04bh.js";
@@ -0,0 +1 @@
1
+ import"./chunk-1khyr3v1.js";import"./chunk-z960rexd.js";import"./chunk-sxddjs2d.js";import"./chunk-swyhghrm.js";import"./chunk-e86zbeta.js";import{j as s,k as e}from"./chunk-5qah04bh.js";class a extends s{static baseClass="mu-callout";static observedAttributes=["variant","title"];render(){this.#r()}update(o,t,r){this.#r()}#r(){let o=this.attr("variant","info"),t={info:{bg:"var(--md-sys-color-primary-container)",border:"var(--md-sys-color-primary)",text:"var(--md-sys-color-on-primary-container)"},warning:{bg:"var(--md-sys-color-error-container)",border:"var(--md-sys-color-error)",text:"var(--md-sys-color-on-error-container)"},success:{bg:"var(--md-sys-color-tertiary-container)",border:"var(--md-sys-color-tertiary)",text:"var(--md-sys-color-on-tertiary-container)"},tip:{bg:"var(--md-sys-color-secondary-container)",border:"var(--md-sys-color-secondary)",text:"var(--md-sys-color-on-secondary-container)"}},r=t[o]||t.info;this.style.display="block",this.style.boxSizing="border-box",this.style.maxWidth="100%",this.style.wordWrap="break-word",this.style.overflowWrap="break-word",this.style.padding="20px",this.style.marginTop="24px",this.style.marginBottom="24px",this.style.background=r.bg,this.style.borderLeft=`4px solid ${r.border}`,this.style.borderRadius="var(--md-sys-shape-corner-medium)",this.style.color=r.text,this.style.lineHeight="1.6"}}e("mu-callout",a);
@@ -0,0 +1 @@
1
+ import"./chunk-qxxa8trk.js";import"./chunk-1khyr3v1.js";import"./chunk-z960rexd.js";import"./chunk-sxddjs2d.js";import"./chunk-swyhghrm.js";import"./chunk-e86zbeta.js";import"./chunk-5qah04bh.js";
@@ -0,0 +1,9 @@
1
+ import{h as m}from"./chunk-nv3bddmj.js";import"./chunk-z960rexd.js";import{i as d}from"./chunk-sxddjs2d.js";import"./chunk-swyhghrm.js";import"./chunk-e86zbeta.js";import{j as l,k as h}from"./chunk-5qah04bh.js";class u extends l{static baseClass="mu-checkbox";static cssFile="checkbox";static observedAttributes=["checked","disabled","name","label","indeterminate"];#t=null;connectedCallback(){super.connectedCallback(),this.setAttribute("role","checkbox"),this.setupActivation(()=>this.toggle()),this.listen(this,"pointerdown",(e)=>{if(!this.isDisabled)m(this,e)}),this.listen(this,"click",()=>{if(!this.isDisabled)this.toggle()})}render(){if(this.querySelector(".mu-checkbox__box")){this.#e();return}let e=d(this.attr("label","")||this.textContent);this.innerHTML=`
2
+ <span class="mu-checkbox__box">
3
+ <svg class="mu-checkbox__icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round">
4
+ <path class="mu-checkbox__check" d="M4 12l6 6L20 6"/>
5
+ <line class="mu-checkbox__indeterminate" x1="5" y1="12" x2="19" y2="12"/>
6
+ </svg>
7
+ </span>
8
+ <span class="mu-checkbox__label">${e}</span>
9
+ `,this.style.display="inline-flex",this.style.alignItems="center",this.style.gap="12px",this.style.cursor=this.has("disabled")?"not-allowed":"pointer",this.style.userSelect="none",this.style.minHeight="48px",this.style.padding="0 4px",this.#e()}update(e,s,i){this.#e()}#e(){let e=this.querySelector(".mu-checkbox__box"),s=this.querySelector(".mu-checkbox__icon"),i=this.querySelector(".mu-checkbox__check"),r=this.querySelector(".mu-checkbox__indeterminate"),c=this.querySelector(".mu-checkbox__label"),t=this.has("disabled"),a=this.has("checked"),o=this.has("indeterminate"),n=a||o;if(this.style.cursor=t?"not-allowed":"pointer",e)if(e.style.width="18px",e.style.height="18px",e.style.borderRadius="2px",e.style.display="flex",e.style.alignItems="center",e.style.justifyContent="center",e.style.transition="all var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard)",e.style.flexShrink="0",t)e.style.border="2px solid color-mix(in srgb, var(--md-sys-color-on-surface) 38%, transparent)",e.style.background=n?"color-mix(in srgb, var(--md-sys-color-on-surface) 38%, transparent)":"transparent";else e.style.border=`2px solid ${n?"var(--md-sys-color-primary)":"var(--md-sys-color-outline)"}`,e.style.background=n?"var(--md-sys-color-primary)":"transparent";if(s)s.style.width="14px",s.style.height="14px",s.style.color=t?"var(--md-sys-color-surface)":"var(--md-sys-color-on-primary)";if(i)i.style.strokeDasharray=24,i.style.strokeDashoffset=a&&!o?"0":24,i.style.transition="stroke-dashoffset 200ms var(--md-sys-motion-easing-standard, ease-out)";if(r)r.style.strokeDasharray=14,r.style.strokeDashoffset=o?"0":14,r.style.transition="stroke-dashoffset 200ms var(--md-sys-motion-easing-standard, ease-out)";if(c)c.style.color=t?"color-mix(in srgb, var(--md-sys-color-on-surface) 38%, transparent)":"var(--md-sys-color-on-surface)";this.setAttribute("aria-checked",o?"mixed":String(a)),this.setAttribute("aria-disabled",String(t)),this.setAttribute("tabindex",t?"-1":"0")}toggle(){if(this.has("indeterminate"))this.removeAttribute("indeterminate");if(this.has("checked"))this.removeAttribute("checked");else this.setAttribute("checked","");this.emit("mu-change",{checked:this.has("checked"),indeterminate:!1})}get checked(){return this.has("checked")}set checked(e){if(e)this.setAttribute("checked","");else this.removeAttribute("checked")}get indeterminate(){return this.has("indeterminate")}set indeterminate(e){if(e)this.setAttribute("indeterminate","");else this.removeAttribute("indeterminate")}}h("mu-checkbox",u);
@@ -0,0 +1,4 @@
1
+ import{h as l}from"./chunk-nv3bddmj.js";import"./chunk-z960rexd.js";import"./chunk-sxddjs2d.js";import"./chunk-swyhghrm.js";import"./chunk-e86zbeta.js";import{j as i,k as r}from"./chunk-5qah04bh.js";class o extends i{static baseClass="mu-chip";static cssFile="chip";static observedAttributes=["selected","removable","variant"];#t=null;connectedCallback(){if(super.connectedCallback(),!this.#t&&!this.querySelector(".mu-chip__label"))this.#t=this.textContent.trim();this.setAttribute("tabindex","0"),this.setAttribute("role","button"),this.setupActivation(()=>{if(!this.has("removable"))this.toggle()}),this.listen(this,"pointerdown",(t)=>{if(!t.target.closest(".mu-chip__remove"))l(this,t)}),this.listen(this,"click",(t)=>{if(t.target.closest(".mu-chip__remove"))this.emit("mu-remove"),this.remove();else if(!this.has("removable"))this.toggle()})}render(){if(this.querySelector(".mu-chip__label")){this.#e();return}let t=this.#t||this.textContent.trim(),s=this.has("removable");this.innerHTML=`
2
+ <span class="mu-chip__label">${t}</span>
3
+ ${s?'<button class="mu-chip__remove" aria-label="Remove">✕</button>':""}
4
+ `,this.#e()}update(t,s,e){this.#e()}#e(){let t=this.has("selected"),s=this.attr("variant","outlined");if(this.style.display="inline-flex",this.style.alignItems="center",this.style.gap="4px",this.style.padding="8px 16px",this.style.borderRadius="8px",this.style.fontSize="var(--md-sys-typescale-label-large-size, 14px)",this.style.cursor="pointer",this.style.userSelect="none",this.style.transition="all var(--md-sys-motion-duration-short4) var(--md-sys-motion-easing-standard)",s==="filled"||t)this.style.background=t?"var(--md-sys-color-secondary-container)":"var(--md-sys-color-surface-container-high)",this.style.color=t?"var(--md-sys-color-on-secondary-container)":"var(--md-sys-color-on-surface)",this.style.border="1px solid transparent";else this.style.background="transparent",this.style.color="var(--md-sys-color-on-surface)",this.style.border="1px solid var(--md-sys-color-outline)";let e=this.querySelector(".mu-chip__remove");if(e)e.style.background="none",e.style.border="none",e.style.padding="0",e.style.marginLeft="4px",e.style.cursor="pointer",e.style.color="inherit",e.style.opacity="0.7"}toggle(){if(this.has("selected"))this.removeAttribute("selected");else this.setAttribute("selected","");this.emit("mu-change",{selected:this.has("selected")})}}r("mu-chip",o);
@@ -0,0 +1,2 @@
1
+ class h{#t=[];#e=!1;schedule(t){if(this.#t.push(t),!this.#e)this.#e=!0,requestAnimationFrame(()=>this.#s())}#s(){let t=this.#t.slice();this.#t=[],this.#e=!1;for(let e of t)try{e()}catch(s){console.error("[RenderScheduler] Error:",s)}}}var l=new h;function o(t,e=100){let s=null;return(...i)=>{if(s)clearTimeout(s);s=setTimeout(()=>t(...i),e)}}function n(t,e=100){let s=!1;return(...i)=>{if(!s)t(...i),s=!0,setTimeout(()=>s=!1,e)}}class r{#t=[];#e=[];#s=!1;read(t){this.#t.push(t),this.#i()}write(t){this.#e.push(t),this.#i()}#i(){if(!this.#s)this.#s=!0,requestAnimationFrame(()=>this.#h())}#h(){let t;while(t=this.#t.shift())try{t()}catch(e){console.error(e)}while(t=this.#e.shift())try{t()}catch(e){console.error(e)}if(this.#s=!1,this.#t.length||this.#e.length)this.#i()}}var c=new r;
2
+ export{o as a,n as b};
@@ -0,0 +1,33 @@
1
+ import{i as a}from"./chunk-sxddjs2d.js";import{j as d,k as o}from"./chunk-5qah04bh.js";class i extends d{static baseClass="mu-api-table";static observedAttributes=["type"];render(){let r=this.attr("type","attributes"),t=Array.from(this.querySelectorAll("mu-api-row")),e={attributes:["Name","Type","Default","Description"],properties:["Name","Type","Description"],methods:["Name","Signature","Description"],events:["Name","Detail","Description"],tokens:["Token","Default","Description"]},c=e[r]||e.attributes,n=t.map((s)=>({name:s.getAttribute("name")||"",type:s.getAttribute("type")||"",default:s.getAttribute("default")||"-",signature:s.getAttribute("signature")||"",detail:s.getAttribute("detail")||"",description:s.textContent.trim()}));this.innerHTML=`
2
+ <table class="mu-api-table__table">
3
+ <thead>
4
+ <tr>
5
+ ${c.map((s)=>`<th>${s}</th>`).join("")}
6
+ </tr>
7
+ </thead>
8
+ <tbody>
9
+ ${n.map((s)=>this.#t(r,s)).join("")}
10
+ </tbody>
11
+ </table>
12
+ `,this.#e()}#t(r,t){let e={name:a(t.name),type:a(t.type),default:a(t.default),signature:a(t.signature),detail:a(t.detail),description:a(t.description)};switch(r){case"attributes":return`<tr>
13
+ <td><code>${e.name}</code></td>
14
+ <td><code class="type">${e.type}</code></td>
15
+ <td><code class="default">${e.default}</code></td>
16
+ <td>${e.description}</td>
17
+ </tr>`;case"properties":return`<tr>
18
+ <td><code>${e.name}</code></td>
19
+ <td><code class="type">${e.type}</code></td>
20
+ <td>${e.description}</td>
21
+ </tr>`;case"methods":return`<tr>
22
+ <td><code>${e.name}</code></td>
23
+ <td><code class="signature">${e.signature}</code></td>
24
+ <td>${e.description}</td>
25
+ </tr>`;case"events":return`<tr>
26
+ <td><code>${e.name}</code></td>
27
+ <td><code class="detail">${e.detail}</code></td>
28
+ <td>${e.description}</td>
29
+ </tr>`;case"tokens":return`<tr>
30
+ <td><code>${e.name}</code></td>
31
+ <td><code class="default">${e.default}</code></td>
32
+ <td>${e.description}</td>
33
+ </tr>`;default:return""}}#e(){this.style.display="block",this.style.overflowX="auto",this.style.marginBottom="24px";let r=this.querySelector(".mu-api-table__table");if(r)r.style.width="100%",r.style.borderCollapse="collapse",r.style.fontSize="var(--md-sys-typescale-body-medium-size)";this.querySelectorAll("th").forEach((t)=>{t.style.textAlign="left",t.style.padding="16px",t.style.height="56px",t.style.background="var(--md-sys-color-surface-container)",t.style.fontWeight="500",t.style.color="var(--md-sys-color-on-surface)",t.style.borderBottom="1px solid var(--md-sys-color-outline-variant)"}),this.querySelectorAll("td").forEach((t)=>{t.style.padding="16px",t.style.minHeight="52px",t.style.borderBottom="1px solid var(--md-sys-color-outline-variant)",t.style.verticalAlign="middle",t.style.lineHeight="1.5"}),this.querySelectorAll("code").forEach((t)=>{t.style.fontFamily="'Fira Code', monospace",t.style.fontSize="13px",t.style.padding="2px 6px",t.style.borderRadius="4px",t.style.background="var(--md-sys-color-surface-container-highest)"}),this.querySelectorAll("code.type, code.detail").forEach((t)=>{t.style.color="var(--md-sys-color-primary)"}),this.querySelectorAll("code.default").forEach((t)=>{t.style.color="var(--md-sys-color-secondary)"})}}class l extends d{static baseClass="mu-api-row";static observedAttributes=["name","type","default","signature","detail"];render(){}}o("mu-api-table",i);o("mu-api-row",l);
@@ -0,0 +1 @@
1
+ import{j as e,k as r}from"./chunk-5qah04bh.js";class a extends e{static baseClass="mu-grid";static cssFile="grid";static observedAttributes=["cols","rows","gap","align"];render(){this.#s()}update(t,s,i){this.#s()}#s(){let t=this.attr("cols","1"),s=this.attr("rows",""),i=this.attr("gap","md"),l=this.attr("align","stretch"),d={none:"0",xs:"4px",sm:"8px",md:"16px",lg:"24px",xl:"32px"};if(this.style.display="grid",this.style.gridTemplateColumns=t.includes("fr")||t.includes("px")?t:`repeat(${t}, 1fr)`,s)this.style.gridTemplateRows=s.includes("fr")||s.includes("px")?s:`repeat(${s}, 1fr)`;this.style.gap=d[i]||i,this.style.alignItems=l}}r("mu-grid",a);
@@ -0,0 +1,2 @@
1
+ class a extends HTMLElement{static observedAttributes=[];static baseClass="";static cssFile=null;static _loadedCSS=new Set;static useContainment=!0;_rendered=!1;_abortController=null;_timers=new Set;_intervals=new Set;constructor(){super();this._initAgentLogger()}_initAgentLogger(){if(!window.__MICROUI_ERRORS__)window.__MICROUI_ERRORS__=[];if(!window.microUIAgent)window.microUIAgent={reset:()=>{window.__MICROUI_ERRORS__=[],console.log("[microUIAgent] Errors cleared")},getErrors:()=>window.__MICROUI_ERRORS__,hasError:(t,e)=>{return window.__MICROUI_ERRORS__.some((s)=>s.component===t.toLowerCase()&&s.code===e)}}}logError(t,e){let s={component:this.tagName.toLowerCase(),code:t,message:e,element:this,timestamp:Date.now()};window.__MICROUI_ERRORS__.push(s),console.warn(`[microUI] ${t}: ${e}`,this)}connectedCallback(){if(!this._abortController)this._abortController=new AbortController;if(this.constructor.baseClass)this.classList.add(this.constructor.baseClass);if(this.constructor.useContainment&&!this.style.contain)this.style.contain="layout style";if(this.#t(),!this._rendered)this.render(),this._rendered=!0;this._loadComponentCSS(),this._inferSemanticAttributes()}#t(){this.listen(this,"click",(t)=>{let e=t.target.closest("[data-action]");if(!e||!this.contains(e))return;let s=e.dataset.action;if(this.handleAction)this.handleAction(s,e,t)})}_loadComponentCSS(){let t=this.constructor.cssFile;if(!t)return;if(a._loadedCSS.has(t))return;a._loadedCSS.add(t);let e=document.createElement("link");e.id=`mu-css-${t}`,e.rel="stylesheet";let s="/styles/",r=document.querySelector('link[href*="/styles/"]');if(r){let i=r.href.match(/(.*\/(?:src\/|dist\/)?styles\/)/);if(i)s=i[1]}else{let i=document.querySelector('link[href*="/dist/"]');if(i){let n=i.href.match(/(.*\/dist\/)/);if(n)s=n[1]+"styles/"}else{let n=document.querySelector('script[src*="/src/"]');if(n){let o=n.src.match(/(.*\/src\/)/);if(o)s=o[1]+"styles/"}}}e.href=`${s}components/${t}.css`,document.head.appendChild(e)}_inferSemanticAttributes(){let t=this.tagName.toLowerCase();if(this.hasAttribute("data-mu-action"))return;let e="",s="";switch(t){case"mu-button":e=this._inferButtonAction(),s=this._inferButtonRole();break;case"mu-input":case"mu-textarea":e="input",s="text-field";break;case"mu-checkbox":case"mu-switch":e="toggle",s="control";break;case"mu-dropdown":e="select",s="selector";break;case"mu-modal":e="dialog",s="overlay";break;case"mu-tabs":e="navigate",s="navigation";break;case"mu-card":s="container";break}if(e)this.setAttribute("data-mu-action",e);if(s)this.setAttribute("data-mu-role",s)}_inferButtonAction(){let t=this.textContent?.toLowerCase().trim()||"";if(/^(save|submit|confirm|send|create|add|apply|ok|yes)$/.test(t))return"submit";if(/^(cancel|close|dismiss|no|nevermind)$/.test(t))return"cancel";if(/^(delete|remove|clear|trash)$/.test(t))return"delete";if(/^(back|next|previous|forward|continue)$/.test(t))return"navigate";return"click"}_inferButtonRole(){let t=this.getAttribute("variant");if(t==="filled"||t==="elevated")return"primary-action";if(t==="tonal"||t==="outlined")return"secondary-action";if(t==="text")return"tertiary-action";if(t==="danger")return"destructive-action";return"action"}disconnectedCallback(){if(this._abortController)this._abortController.abort(),this._abortController=null;for(let t of this._timers)clearTimeout(t);this._timers.clear();for(let t of this._intervals)clearInterval(t);this._intervals.clear(),this.cleanup()}cleanup(){}attributeChangedCallback(t,e,s){if(e!==s&&this._rendered)this.update(t,s,e)}render(){}update(t,e,s){}setupEvents(){}attr(t,e=""){return this.getAttribute(t)??e}has(t){return this.hasAttribute(t)}emit(t,e={}){this.dispatchEvent(new CustomEvent(t,{bubbles:!0,composed:!0,detail:e}))}listen(t,e,s,r={}){if(!this._abortController)this._abortController=new AbortController;let i={...r,signal:this._abortController.signal};t.addEventListener(e,s,i)}setTimeout(t,e){let s;return s=setTimeout(()=>{this._timers.delete(s),t()},e),this._timers.add(s),s}setInterval(t,e){let s=setInterval(t,e);return this._intervals.add(s),s}setupActivation(t){this.updateTabindex(),this.addEventListener("keydown",(e)=>{if((e.key==="Enter"||e.key===" ")&&!this.has("disabled"))e.preventDefault(),t()})}updateTabindex(){this.setAttribute("tabindex",this.has("disabled")?"-1":"0")}setDisplay(t){this.style.display=t}get isDisabled(){return this.has("disabled")}}function l(t,e,s={}){if(customElements.get(t))return;let r=s.priority||"user-blocking";if(typeof scheduler<"u"&&scheduler.postTask)scheduler.postTask(()=>{if(!customElements.get(t))customElements.define(t,e)},{priority:r});else customElements.define(t,e)}
2
+ export{a as j,l as k};
@@ -0,0 +1,5 @@
1
+ import{d as n,e as s,f as r}from"./chunk-vby0zg5w.js";import{g as o}from"./chunk-fagt36h6.js";import{j as i,k as l}from"./chunk-5qah04bh.js";var a={set(t){if(t==="auto"){let e=window.matchMedia("(prefers-color-scheme: dark)").matches;document.documentElement.setAttribute("data-theme",e?"dark":"light")}else document.documentElement.setAttribute("data-theme",t);localStorage.setItem("mu-theme",t),n.emit(s.THEME_CHANGE,{theme:t})},get(){return document.documentElement.getAttribute("data-theme")||"light"},toggle(){let t=this.get();this.set(t==="dark"?"light":"dark")},init(){let t=localStorage.getItem("mu-theme");if(t)this.set(t);else this.set("auto");window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",(e)=>{if(localStorage.getItem("mu-theme")==="auto")document.documentElement.setAttribute("data-theme",e.matches?"dark":"light")})}};if(typeof window<"u")a.init();class u extends i{static baseClass="mu-theme-toggle";connectedCallback(){super.connectedCallback(),this.listen(this,"click",()=>a.toggle()),n.on(s.THEME_CHANGE,()=>this.#t())}render(){this.innerHTML=`
2
+ <button class="mu-theme-toggle__button" aria-label="Toggle theme">
3
+ <span class="mu-theme-toggle__icon"></span>
4
+ </button>
5
+ `,this.#t()}#t(){let t=a.get()==="dark",e=this.querySelector(".mu-theme-toggle__icon");if(e)e.textContent=t?"☀️":"\uD83C\uDF19"}}l("mu-theme-toggle",u);r("mu-theme-toggle",{signals:[s.THEME_CHANGE],options:{themes:["light","dark"],emits:["click"]},description:"Theme toggle button that switches between light/dark modes"});class h extends i{static get observedAttributes(){return["hide-on-desktop","value"]}static baseClass="mu-bottom-nav";static cssFile="bottom-nav";constructor(){super();this._unsubscribe=null}get hideOnDesktop(){return this.hasAttribute("hide-on-desktop")}set hideOnDesktop(t){this.toggleAttribute("hide-on-desktop",Boolean(t))}get value(){return this.getAttribute("value")||""}set value(t){this.setAttribute("value",t)}connectedCallback(){if(!this._childrenCaptured)this._userChildren=Array.from(this.children),this._childrenCaptured=!0;super.connectedCallback(),this._setupBreakpointListener(),this._setupListeners(),this._updateVisibility()}disconnectedCallback(){if(super.disconnectedCallback(),this._unsubscribe)this._unsubscribe(),this._unsubscribe=null}attributeChangedCallback(t,e,m){if(!this.isConnected)return;if(t==="hide-on-desktop")this._updateVisibility()}_setupBreakpointListener(){if(this.hideOnDesktop)this._unsubscribe=o.subscribe(()=>{this._updateVisibility()})}_updateVisibility(){if(this.hideOnDesktop&&o.isNotCompact)this.style.display="none";else this.style.display=""}_setupListeners(){this.listen(this,"mu-nav-select",(t)=>{this._updateActiveItem(t.detail.item),this.value=t.detail.href||"",this.emit("change",{value:this.value,item:t.detail.item},{bubbles:!0})})}_updateActiveItem(t){this.querySelectorAll("mu-nav-item, mu-drawer-item").forEach((e)=>{e.active=e===t})}render(){let t=document.createElement("nav");if(t.className="mu-bottom-nav-nav",t.setAttribute("role","menu"),t.setAttribute("aria-label","Bottom navigation"),this.innerHTML="",this.appendChild(t),this._userChildren)this._userChildren.forEach((e)=>t.appendChild(e))}}if(!customElements.get("mu-bottom-nav"))customElements.define("mu-bottom-nav",h);
@@ -0,0 +1 @@
1
+ import{j as a,k as e}from"./chunk-5qah04bh.js";class r extends a{static baseClass="mu-stack";static observedAttributes=["direction","gap","align","justify","wrap","nowrap"];render(){this.#s()}update(s,t,i){this.#s()}#s(){let s=this.attr("direction","column"),t=this.attr("gap","md"),i=this.attr("align","stretch"),l=this.attr("justify","flex-start"),h=this.has("wrap"),n=this.has("nowrap"),p=s==="row"||s==="row-reverse"?!n:h,x={none:"0",xs:"var(--md-sys-spacing-xs, 4px)",sm:"var(--md-sys-spacing-sm, 8px)",md:"var(--md-sys-spacing-md, 16px)",lg:"var(--md-sys-spacing-lg, 24px)",xl:"var(--md-sys-spacing-xl, 32px)"};this.style.display="flex",this.style.flexDirection=s,this.style.gap=x[t]||t,this.style.alignItems=i,this.style.justifyContent=l,this.style.flexWrap=p?"wrap":"nowrap",this.style.boxSizing="border-box",this.style.maxWidth="100%",this.style.minWidth="0",this.style.flexShrink="1"}}e("mu-stack",r);
@@ -0,0 +1,2 @@
1
+ var e={compact:600,medium:840,expanded:840};class i{#s=new Set;#t="expanded";#e=null;#i=null;constructor(){if(typeof window<"u")this.#n()}#n(){this.#e=window.matchMedia(`(max-width: ${e.compact-1}px)`),this.#e.addEventListener("change",this.#h),this.#i=window.matchMedia(`(min-width: ${e.compact}px) and (max-width: ${e.medium-1}px)`),this.#i.addEventListener("change",this.#h),this.#a()}#h=()=>{let t=this.#t;if(this.#a(),t!==this.#t)this.#r()};#a(){if(this.#e?.matches)this.#t="compact";else if(this.#i?.matches)this.#t="medium";else this.#t="expanded"}#r(){this.#s.forEach((t)=>{try{t(this.#t)}catch(s){console.error("[Breakpoints] Listener error:",s)}})}get current(){if(this.#e?.matches)return"compact";else if(this.#i?.matches)return"medium";return"expanded"}get isCompact(){return this.#e?.matches??!1}get isMedium(){return this.#i?.matches??!1}get isExpanded(){return!this.isCompact&&!this.isMedium}get isNotCompact(){return this.#t!=="compact"}subscribe(t){return this.#s.add(t),t(this.#t),()=>{this.#s.delete(t)}}get windowWidth(){return typeof window<"u"?window.innerWidth:1200}}var h=new i;
2
+ export{h as g};
@@ -0,0 +1 @@
1
+ import{j as n,k as h}from"./chunk-5qah04bh.js";class o extends n{static baseClass="mu-avatar";static cssFile="avatar";static observedAttributes=["src","alt","initials","size"];render(){let r=this.attr("src",""),s=this.attr("alt",""),t=this.attr("initials",""),e=this.attr("size","md"),l={sm:"32px",md:"40px",lg:"56px",xl:"80px"},p={sm:"12px",md:"14px",lg:"20px",xl:"28px"};this.style.width=l[e]||e,this.style.height=l[e]||e,this.style.borderRadius="50%",this.style.display="inline-flex",this.style.alignItems="center",this.style.justifyContent="center",this.style.overflow="hidden",this.style.background="var(--md-sys-color-primary-container)",this.style.color="var(--md-sys-color-on-primary-container)",this.style.fontSize=p[e]||"14px",this.style.fontWeight="600",this.innerHTML="";let a="";if(s)a=s.split(" ").map((i)=>i[0]).join("").toUpperCase().slice(0,2);if(r){let i=document.createElement("img");i.src=r,i.alt=s,i.style.cssText="width:100%;height:100%;object-fit:cover;",i.onerror=()=>{this.innerHTML="",this.#t(t,a)},this.appendChild(i)}else this.#t(t,a)}#t(r,s){if(r){let t=document.createElement("span");t.textContent=r.toUpperCase().slice(0,2),this.appendChild(t)}else if(s){let t=document.createElement("span");t.textContent=s,this.appendChild(t)}else{let t=document.createElementNS("http://www.w3.org/2000/svg","svg");t.setAttribute("width","60%"),t.setAttribute("height","60%"),t.setAttribute("viewBox","0 0 16 16"),t.setAttribute("fill","currentColor");let e=document.createElementNS("http://www.w3.org/2000/svg","path");e.setAttribute("d","M10.561 8.073a6.005 6.005 0 0 1 3.432 5.142.75.75 0 0 1-1.498.07 4.5 4.5 0 0 0-8.99 0 .75.75 0 0 1-1.498-.07 6.004 6.004 0 0 1 3.431-5.142 3.999 3.999 0 1 1 5.123 0ZM10.5 5a2.5 2.5 0 1 0-5 0 2.5 2.5 0 0 0 5 0Z"),t.appendChild(e),this.appendChild(t)}}update(r,s,t){this.render()}}h("mu-avatar",o);
@@ -0,0 +1 @@
1
+ import{j as s,k as t}from"./chunk-5qah04bh.js";class a extends s{static baseClass="mu-navbar";static cssFile="navbar";static observedAttributes=["sticky","variant"];render(){if(this.style.display="flex",this.style.alignItems="center",this.style.justifyContent="space-between",this.style.padding="0 var(--md-sys-spacing-md, 16px)",this.style.height="64px",this.style.background="var(--md-sys-color-surface-container)",this.style.borderBottom="1px solid var(--md-sys-color-outline-variant)",this.has("sticky"))this.style.position="sticky",this.style.top="0",this.style.zIndex="100"}}class e extends s{static baseClass="mu-navbar__brand";render(){this.style.fontWeight="600",this.style.fontSize="1.25rem"}}class i extends s{static baseClass="mu-navbar__links";render(){}}class n extends s{static baseClass="mu-navbar__actions";render(){this.style.display="flex",this.style.gap="var(--md-sys-spacing-sm, 8px)",this.style.alignItems="center"}}t("mu-navbar",a);t("mu-navbar-brand",e);t("mu-navbar-links",i);t("mu-navbar-actions",n);
@@ -0,0 +1,5 @@
1
+ import{j as i,k as r}from"./chunk-5qah04bh.js";class n extends i{static baseClass="mu-alert";static observedAttributes=["severity","dismissible"];#i=null;#t=null;connectedCallback(){if(this.setAttribute("role","alert"),this.setAttribute("aria-live","polite"),!this.#t&&!this.querySelector(".mu-alert__content")&&!this.innerHTML.trim())setTimeout(()=>{this.#t=this.innerHTML,this.#e()},0);else{if(!this.#t&&!this.querySelector(".mu-alert__content"))this.#t=this.innerHTML;this.#e()}}#e(){super.connectedCallback(),this.listen(this,"click",(t)=>{if(t.target.classList.contains("mu-alert__close"))this.dismiss()})}dismiss(){this.emit("mu-dismiss"),this.remove()}render(){if(this.querySelector(".mu-alert__content")){this.#s();return}let t=this.attr("severity","info"),e=this.has("dismissible"),s={success:"success",error:"error",warning:"warning",info:"info"},a=this.#t||"",l=s[t]||s.info;this.innerHTML=`
2
+ <mu-icon name="${l}" size="24" class="mu-alert__icon"></mu-icon>
3
+ <span class="mu-alert__content">${a}</span>
4
+ ${e?'<button class="mu-alert__close" aria-label="Dismiss"><mu-icon name="close" size="18"></mu-icon></button>':""}
5
+ `,this.#s()}update(t,e,s){this.#s()}#s(){let t=this.attr("severity","info");this.className=`mu-alert mu-alert--${t}`}}r("mu-alert",n);
@@ -0,0 +1,13 @@
1
+ function v(e,n,c={}){let{color:p="currentColor",centered:h=!1}=c,t=e.getBoundingClientRect(),i,o;if(h||!n)i=t.width/2,o=t.height/2;else{let d=n.touches?n.touches[0].clientX:n.clientX,u=n.touches?n.touches[0].clientY:n.clientY;i=d-t.left,o=u-t.top}let s=Math.max(Math.hypot(i,o),Math.hypot(t.width-i,o),Math.hypot(i,t.height-o),Math.hypot(t.width-i,t.height-o))*2,r=document.createElement("span");r.className="mu-ripple-wave",r.style.cssText=`
2
+ position: absolute;
3
+ width: ${s}px;
4
+ height: ${s}px;
5
+ left: ${i-s/2}px;
6
+ top: ${o-s/2}px;
7
+ background: ${p};
8
+ border-radius: 50%;
9
+ transform: scale(0);
10
+ opacity: 0.10;
11
+ pointer-events: none;
12
+ `;let l=getComputedStyle(e);if(l.position==="static")e.style.position="relative";if(l.overflow!=="hidden")e.style.overflow="hidden";e.appendChild(r),r.animate([{transform:"scale(0)"},{transform:"scale(1)"}],{duration:300,easing:"cubic-bezier(0.4, 0, 0.2, 1)",fill:"forwards"});let a=()=>{r.animate([{opacity:"0.10"},{opacity:"0"}],{duration:150,easing:"ease-out",fill:"forwards"}).onfinish=()=>r.remove(),e.removeEventListener("pointerup",a),e.removeEventListener("pointerleave",a),e.removeEventListener("pointercancel",a)};return e.addEventListener("pointerup",a,{once:!0}),e.addEventListener("pointerleave",a,{once:!0}),e.addEventListener("pointercancel",a,{once:!0}),r}
13
+ export{v as h};
@@ -0,0 +1,7 @@
1
+ import{j as o,k as l}from"./chunk-5qah04bh.js";var d="scheduler"in globalThis;function a(){return new Promise((t)=>{requestAnimationFrame(()=>requestAnimationFrame(t))})}class n extends o{static baseClass="mu-modal";static cssFile="dialog";static observedAttributes=["open","size"];#t=null;connectedCallback(){if(!this.hasAttribute("data-rendered"))this._userContent=this.innerHTML,this.setAttribute("data-rendered","true");super.connectedCallback(),this.#e()}render(){if(this.querySelector("dialog"))return;let t=this.attr("size","md"),e=this._userContent||"";this.innerHTML=`
2
+ <dialog class="mu-modal__dialog mu-modal--${t}">
3
+ <button class="mu-modal__close" aria-label="Close">✕</button>
4
+ <div class="mu-modal__body">${e}</div>
5
+ </dialog>
6
+ `,this.#t=this.querySelector("dialog")}#e(){if(this.#t=this.querySelector("dialog"),!this.#t)return;this.listen(this.#t,"close",()=>{this.removeAttribute("open"),this.classList.remove("is-open","is-visible"),document.body.style.overflow="",this.emit("mu-close")}),this.listen(this.#t,"cancel",(e)=>{e.preventDefault(),this.close()}),this.listen(this.#t,"click",(e)=>{if(e.target===this.#t)this.close()});let t=this.querySelector(".mu-modal__close");if(t)this.listen(t,"click",()=>{this.close()})}update(t,e,s){if(t==="open"){if(e!==null)this.#s()}}#s(){if(!this.#t||this.#t.open)return;this.classList.add("is-open"),this.#t.showModal(),document.body.style.overflow="hidden",a().then(()=>this.classList.add("is-visible"))}open(){this.setAttribute("open","")}close(){if(!this.#t)return;this.classList.remove("is-visible");let t=!1,e=()=>{if(t)return;if(t=!0,this.#t&&this.#t.open)this.#t.close();this.removeAttribute("open"),this.classList.remove("is-open"),document.body.style.overflow="",this.emit("mu-close")},s=this.#t,i=(r)=>{if(r.target===s)s.removeEventListener("transitionend",i),e()};s.addEventListener("transitionend",i),this.setTimeout(()=>{s.removeEventListener("transitionend",i),e()},200)}}l("mu-modal",n);
7
+ export{n as c};
@@ -0,0 +1 @@
1
+ import{j as s,k as d}from"./chunk-5qah04bh.js";class r extends s{static baseClass="mu-card";static cssFile="card";static observedAttributes=["variant","padding"];connectedCallback(){super.connectedCallback(),this.#a()}render(){this.#a()}update(a,t,c){this.#a()}#a(){let a=this.attr("variant","flat"),t=this.attr("padding","md");this.className=`mu-card mu-card--${a} mu-card--padding-${t}`}}d("mu-card",r);
@@ -0,0 +1 @@
1
+ import{h as n}from"./chunk-nv3bddmj.js";import{j as a,k as e}from"./chunk-5qah04bh.js";class l extends a{static baseClass="mu-button";static cssFile="button";static observedAttributes=["variant","size","disabled"];connectedCallback(){super.connectedCallback(),this.setAttribute("role","button"),this.setupActivation(()=>this.click()),this.listen(this,"pointerdown",(t)=>{if(!this.isDisabled)n(this,t)})}render(){let t=this.textContent.trim();this.innerHTML=`<span class="mu-button__label">${t}</span>`,this.#t()}update(t,i,s){if(t==="disabled")this.updateTabindex();this.#t()}#t(){let t=this.attr("variant","primary"),i=this.attr("size","md"),s=["filled","elevated","tonal","outlined","text","danger","primary","secondary","ghost"];if(!s.includes(t))this.logError("INVALID_VARIANT",`Invalid button variant '${t}'. Valid: ${s.join(", ")}`);if(this.className=`mu-button mu-button--${t} mu-button--${i}`,this.has("disabled"))this.classList.add("is-disabled")}}e("mu-button",l);
@@ -0,0 +1,5 @@
1
+ import{j as o,k as t}from"./chunk-5qah04bh.js";var s={check:"M9 16.17 4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z",close:"M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z",add:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z",remove:"M19 13H5v-2h14z",edit:"M3 17.25V21h3.75L17.81 9.94l-3.75-3.75zM20.71 7.04c.39-.39.39-1.02 0-1.41l-2.34-2.34c-.39-.39-1.02-.39-1.41 0l-1.83 1.83 3.75 3.75z",delete:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM19 4h-3.5l-1-1h-5l-1 1H5v2h14z",search:"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z",menu:"M3 18h18v-2H3zm0-5h18v-2H3zm0-7v2h18V6z",chevron_right:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z",chevron_left:"M15.41 7.41 14 6l-6 6 6 6 1.41-1.41L10.83 12z",expand_more:"M16.59 8.59 12 13.17 7.41 8.59 6 10l6 6 6-6z",expand_less:"M12 8l-6 6 1.41 1.41L12 10.83l4.59 4.58L18 14z",home:"M10 20v-6h4v6h5v-8h3L12 3 2 12h3v8z",arrow_back:"M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20z",arrow_forward:"M12 4l-1.41 1.41L16.17 11H4v2h12.17l-5.58 5.59L12 20l8-8z",info:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-6h2zm0-8h-2V7h2z",warning:"M1 21h22L12 2zm12-3h-2v-2h2zm0-4h-2v-4h2z",error:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm1 15h-2v-2h2zm0-4h-2V7h2z",check_circle:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8z",cancel:"M12 2C6.47 2 2 6.47 2 12s4.47 10 10 10 10-4.47 10-10S17.53 2 12 2zm5 13.59L15.59 17 12 13.41 8.41 17 7 15.59 10.59 12 7 8.41 8.41 7 12 10.59 15.59 7 17 8.41 13.41 12z",success:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 15-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8z",settings:"M19.14 12.94c.04-.31.06-.63.06-.94 0-.31-.02-.63-.06-.94l2.03-1.58c.18-.14.23-.41.12-.61l-1.92-3.32c-.12-.22-.37-.29-.59-.22l-2.39.96c-.5-.38-1.03-.7-1.62-.94l-.36-2.54c-.04-.24-.24-.41-.48-.41h-3.84c-.24 0-.43.17-.47.41l-.36 2.54c-.59.24-1.13.57-1.62.94l-2.39-.96c-.22-.08-.47 0-.59.22L2.74 8.87c-.12.21-.08.47.12.61l2.03 1.58c-.04.31-.06.63-.06.94s.02.63.06.94l-2.03 1.58c-.18.14-.23.41-.12.61l1.92 3.32c.12.22.37.29.59.22l2.39-.96c.5.38 1.03.7 1.62.94l.36 2.54c.05.24.24.41.48.41h3.84c.24 0 .44-.17.47-.41l.36-2.54c.59-.24 1.13-.56 1.62-.94l2.39.96c.22.08.47 0 .59-.22l1.92-3.32c.12-.22.07-.47-.12-.61zM12 15.6c-1.98 0-3.6-1.62-3.6-3.6s1.62-3.6 3.6-3.6 3.6 1.62 3.6 3.6-1.62 3.6-3.6 3.6z",person:"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z",light_mode:"M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5M2 13h2c.55 0 1-.45 1-1s-.45-1-1-1H2c-.55 0-1 .45-1 1s.45 1 1 1m18 0h2c.55 0 1-.45 1-1s-.45-1-1-1h-2c-.55 0-1 .45-1 1s.45 1 1 1M11 2v2c0 .55.45 1 1 1s1-.45 1-1V2c0-.55-.45-1-1-1s-1 .45-1 1m0 18v2c0 .55.45 1 1 1s1-.45 1-1v-2c0-.55-.45-1-1-1s-1 .45-1 1M5.99 4.58c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0s.39-1.03 0-1.41zm12.37 12.37c-.39-.39-1.03-.39-1.41 0-.39.39-.39 1.03 0 1.41l1.06 1.06c.39.39 1.03.39 1.41 0 .39-.39.39-1.03 0-1.41zm1.06-10.96c.39-.39.39-1.03 0-1.41-.39-.39-1.03-.39-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0zM7.05 18.36c.39-.39.39-1.03 0-1.41-.39-.39-1.03-.39-1.41 0l-1.06 1.06c-.39.39-.39 1.03 0 1.41s1.03.39 1.41 0z",dark_mode:"M12 3c-4.97 0-9 4.03-9 9s4.03 9 9 9 9-4.03 9-9c0-.46-.04-.92-.1-1.36-.98 1.37-2.58 2.26-4.4 2.26-2.98 0-5.4-2.42-5.4-5.4 0-1.81.89-3.42 2.26-4.4-.44-.06-.9-.1-1.36-.1z",visibility:"M12 4.5C7 4.5 2.73 7.61 1 12c1.73 4.39 6 7.5 11 7.5s9.27-3.11 11-7.5c-1.73-4.39-6-7.5-11-7.5M12 17c-2.76 0-5-2.24-5-5s2.24-5 5-5 5 2.24 5 5-2.24 5-5 5m0-8c-1.66 0-3 1.34-3 3s1.34 3 3 3 3-1.34 3-3-1.34-3-3-3",visibility_off:"M12 7c2.76 0 5 2.24 5 5 0 .65-.13 1.26-.36 1.83l2.92 2.92c1.51-1.26 2.7-2.89 3.43-4.75-1.73-4.39-6-7.5-11-7.5-1.4 0-2.74.25-3.98.7l2.16 2.16C10.74 7.13 11.35 7 12 7M2 4.27l2.28 2.28.46.46C3.08 8.3 1.78 10.02 1 12c1.73 4.39 6 7.5 11 7.5 1.55 0 3.03-.3 4.38-.84l.42.42L19.73 22 21 20.73 3.27 3zM7.53 9.8l1.55 1.55c-.05.21-.08.43-.08.65 0 1.66 1.34 3 3 3 .22 0 .44-.03.65-.08l1.55 1.55c-.67.33-1.41.53-2.2.53-2.76 0-5-2.24-5-5 0-.79.2-1.53.53-2.2m4.31-.78 3.15 3.15.02-.16c0-1.66-1.34-3-3-3z",download:"M5 20h14v-2H5v2zM19 9h-4V3H9v6H5l7 7 7-7z",smart_button:"M22 9v6c0 1.1-.9 2-2 2h-1v-2h1V9H4v6h6v2H4c-1.1 0-2-.9-2-2V9c0-1.1.9-2 2-2h16c1.1 0 2 .9 2 2zm-7.5 11 1.09-2.41L18 16.5l-2.41-1.09L14.5 13l-1.09 2.41L11 16.5l2.41 1.09L14.5 20zm2.5-5 .62-1.38L19 14l-1.38-.62L17 12l-.62 1.38L15 14l1.38.62L17 16zm-2.5 5 1.09-2.41L18 16.5l-2.41-1.09L14.5 13l-1.09 2.41L11 16.5l2.41 1.09L14.5 20z",text_fields:"M2.5 4v3h5v12h3V7h5V4h-13zm19 5h-9v3h3v7h3v-7h3V9z",check_box:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z",toggle_on:"M17 7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h10c2.76 0 5-2.24 5-5s-2.24-5-5-5zm0 8c-1.66 0-3-1.34-3-3s1.34-3 3-3 3 1.34 3 3-1.34 3-3 3z",radio_button_checked:"M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5zm0-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z",arrow_drop_down_circle:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 12-4-4h8l-4 4z",view_carousel:"M7 19h10V4H7v15zm-5-2h4V6H2v11zM18 6v11h4V6h-4z",grid_view:"M3 3v8h8V3H3zm6 6H5V5h4v4zm-6 4v8h8v-8H3zm6 6H5v-4h4v4zm4-16v8h8V3h-8zm6 6h-4V5h4v4zm-6 4v8h8v-8h-8zm6 6h-4v-4h4v4z",tab:"M21 3H3c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h18c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H3V5h10v4h8v10z",notifications:"M12 22c1.1 0 2-.9 2-2h-4c0 1.1.89 2 2 2zm6-6v-5c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.63 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2z",open_in_new:"M19 19H5V5h7V3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.1 0 2-.9 2-2v-7h-2v7zM14 3v2h3.59l-9.83 9.83 1.41 1.41L19 6.41V10h2V3h-7z",hourglass_empty:"M6 2v6h.01L6 8.01 10 12l-4 4 .01.01H6V22h12v-5.99h-.01L18 16l-4-4 4-3.99-.01-.01H18V2H6zm10 14.5V20H8v-3.5l4-4 4 4zm-4-5-4-4V4h8v3.5l-4 4z",account_circle:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 4c1.93 0 3.5 1.57 3.5 3.5S13.93 13 12 13s-3.5-1.57-3.5-3.5S10.07 6 12 6zm0 14c-2.03 0-4.43-.82-6.14-2.88C7.55 15.8 9.68 15 12 15s4.45.8 6.14 2.12C16.43 19.18 14.03 20 12 20z",fiber_manual_record:"M12 12m-8 0a8 8 0 1 0 16 0 8 8 0 1 0-16 0",label:"M17.63 5.84C17.27 5.33 16.67 5 16 5L5 5.01C3.9 5.01 3 5.9 3 7v10c0 1.1.9 1.99 2 1.99L16 19c.67 0 1.27-.33 1.63-.84L22 12l-4.37-6.16z",emoji_emotions:"M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8zm3.5-9c.83 0 1.5-.67 1.5-1.5S16.33 8 15.5 8 14 8.67 14 9.5s.67 1.5 1.5 1.5zm-7 0c.83 0 1.5-.67 1.5-1.5S9.33 8 8.5 8 7 8.67 7 9.5 7.67 11 8.5 11zm3.5 6.5c2.33 0 4.31-1.46 5.11-3.5H6.89c.8 2.04 2.78 3.5 5.11 3.5z",business:"M12 7V3H2v18h20V7H12zM6 19H4v-2h2v2zm0-4H4v-2h2v2zm0-4H4V9h2v2zm0-4H4V5h2v2zm4 12H8v-2h2v2zm0-4H8v-2h2v2zm0-4H8V9h2v2zm0-4H8V5h2v2zm10 12h-8v-2h2v-2h-2v-2h2v-2h-2V9h8v10zm-2-8h-2v2h2v-2zm0 4h-2v2h2v-2z",input:"M21 3.01H3c-1.1 0-2 .9-2 2V9h2V4.99h18v14.03H3V15H1v4.01c0 1.1.9 1.98 2 1.98h18c1.1 0 2-.88 2-1.98v-14c0-1.11-.9-2-2-2zM11 16l4-4-4-4v3H1v2h10v3z",category:"M12 2l-5.5 9h11L12 2zm0 3.84L13.93 9h-3.87L12 5.84zM17.5 13c-2.49 0-4.5 2.01-4.5 4.5s2.01 4.5 4.5 4.5 4.5-2.01 4.5-4.5-2.01-4.5-4.5-4.5zm0 7c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5zM3 21.5h8v-8H3v8zm2-6h4v4H5v-4z",widgets:"M13 13v8h8v-8h-8zM3 21h8v-8H3v8zM3 3v8h8V3H3zm13.66-1.31L11 7.34 16.66 13l5.66-5.66-5.66-5.65z",smart_toy:"M20 9V7c0-1.1-.9-2-2-2h-3c0-1.66-1.34-3-3-3S9 3.34 9 5H6c-1.1 0-2 .9-2 2v2c-1.66 0-3 1.34-3 3s1.34 3 3 3v4c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2v-4c1.66 0 3-1.34 3-3s-1.34-3-3-3zM7.5 11.5c0-.83.67-1.5 1.5-1.5s1.5.67 1.5 1.5S9.83 13 9 13s-1.5-.67-1.5-1.5zM16 17H8v-2h8v2zm-1-4c-.83 0-1.5-.67-1.5-1.5S14.17 10 15 10s1.5.67 1.5 1.5S15.83 13 15 13z",notification_important:"M18 16v-5c0-3.07-1.64-5.64-4.5-6.32V4c0-.83-.67-1.5-1.5-1.5s-1.5.67-1.5 1.5v.68C7.63 5.36 6 7.92 6 11v5l-2 2v1h16v-1l-2-2zm-6 6c1.1 0 2-.9 2-2h-4c0 1.1.89 2 2 2zm1-15.06c1.77.52 3 2.14 3 4.06v5.5l1 1v.5H7v-.5l1-1V11c0-1.92 1.23-3.54 3-4.06V5.5c0-.83.67-1.5 1.5-1.5s1.5.67 1.5 1.5v.94zM13 11h-2v6h2v-6zm0-4h-2v2h2V7z",folder_managed:"M20 6h-8l-2-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm-2.06 11L15 15.28 12.06 17l.78-3.33-2.59-2.24 3.41-.29L15 8l1.34 3.14 3.41.29-2.59 2.24.78 3.33z",shield:"M12 1L3 5v6c0 5.55 3.84 10.74 9 12 5.16-1.26 9-6.45 9-12V5l-9-4zm0 10.99h7c-.53 4.12-3.28 7.79-7 8.94V12H5V6.3l7-3.11v8.8z",apps:"M4 8h4V4H4v4zm6 12h4v-4h-4v4zm-6 0h4v-4H4v4zm0-6h4v-4H4v4zm6 0h4v-4h-4v4zm6-10v4h4V4h-4zm-6 4h4V4h-4v4zm6 6h4v-4h-4v4zm0 6h4v-4h-4v4z",monitoring:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 16H5V5h14v14zM7 12h2v5H7v-5zm4-3h2v8h-2V9zm4-3h2v11h-2V6z"},e={check:"check",close:"close",add:"add",remove:"remove",edit:"edit",delete:"delete",search:"search",menu:"menu",chevron_right:"chevron_right",chevron_left:"chevron_left",expand_more:"expand_more",expand_less:"expand_less",home:"home",arrow_back:"arrow_back",arrow_forward:"arrow_forward",info:"info",warning:"warning",error:"error",success:"check_circle",check_circle:"check_circle",cancel:"cancel",settings:"settings",person:"person",light_mode:"light_mode",dark_mode:"dark_mode",sun:"light_mode",moon:"dark_mode",user:"person",visibility:"visibility",visibility_off:"visibility_off",download:"download",smart_button:"smart_button",text_fields:"text_fields",check_box:"check_box",toggle_on:"toggle_on",radio_button_checked:"radio_button_checked",arrow_drop_down_circle:"arrow_drop_down_circle",view_carousel:"view_carousel",grid_view:"grid_view",tab:"tab",notifications:"notifications",open_in_new:"open_in_new",hourglass_empty:"hourglass_empty",account_circle:"account_circle",fiber_manual_record:"fiber_manual_record",label:"label",emoji_emotions:"emoji_emotions",business:"business",input:"input",category:"category",widgets:"widgets",smart_toy:"smart_toy",notification_important:"notification_important",folder_managed:"folder_managed",shield:"shield",apps:"apps",monitoring:"monitoring",plus:"add",minus:"remove"};class r extends o{static baseClass="mu-icon";static cssFile="icon";static observedAttributes=["name","size","svg","filled","font"];render(){let c=this.attr("name","info"),h=this.attr("size","24"),i=this.has("font"),z=this.has("filled");this.setAttribute("role","img"),this.setAttribute("aria-hidden","true");let m=e[c]?c:c,l=s[c]||s[e[c]];if(!i&&l){this.innerHTML=`
2
+ <svg width="${h}" height="${h}" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true">
3
+ <path d="${l}"></path>
4
+ </svg>
5
+ `;return}let n=e[c]||c;if(!e[c]&&!s[c])this.logError("UNKNOWN_ICON",`Icon name "${c}" not found in predefined icons. Using font fallback.`);this.innerHTML=`<span class="material-symbols-outlined" aria-hidden="true">${n}</span>`;let v=this.querySelector("span");if(v){if(v.style.fontSize=`${h}px`,z)v.style.fontVariationSettings="'FILL' 1"}}update(c,h,i){this.render()}}var _=Object.keys(e),d=Object.keys(s);t("mu-icon",r);
@@ -0,0 +1,48 @@
1
+ import{j as p,k as h}from"./chunk-5qah04bh.js";class _ extends p{static baseClass="mu-code";static observedAttributes=["language"];#e=null;connectedCallback(){if(super.connectedCallback(),!this.#e&&!this.querySelector(".mu-code__content"))this.#e=this.textContent}render(){if(this.querySelector(".mu-code__content"))return;let a=this.attr("language","html"),o=this.#e||this.innerHTML,s=document.createElement("div");s.innerHTML=o;let r=s.textContent,c=this.#r(r),e=this.#o(c,a),t=e,l=e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),i=this.#t(l,a);this.innerHTML=`
2
+ <div class="mu-code__header">
3
+ <span class="mu-code__language">${a.toUpperCase()}</span>
4
+ <button class="mu-code__copy" title="Copy code">
5
+ <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
6
+ <rect x="9" y="9" width="13" height="13" rx="2" ry="2"/>
7
+ <path d="M5 15H4a2 2 0 01-2-2V4a2 2 0 012-2h9a2 2 0 012 2v1"/>
8
+ </svg>
9
+ </button>
10
+ </div>
11
+ <pre class="mu-code__pre"><code class="mu-code__content">${i}</code></pre>
12
+ `,this.#s(),this.#l(t)}#t(a,o){let s=()=>{let r=[],c=0;return{addMarker:(e,t)=>{let l=c++,i=String.fromCharCode(57600+l),d=String.fromCharCode(57344),u=String.fromCharCode(57345),m=d+i+u;return r.push({marker:m,content:e,className:t}),m},resolveMarkers:(e)=>{for(let{marker:t,content:l,className:i}of r)e=e.replace(t,`<span class="${i}">${l}</span>`);return e}}};if(o==="html"||o==="xml"){let{addMarker:r,resolveMarkers:c}=s(),e=a;return e=e.replace(/(&lt;!--[\s\S]*?--&gt;)/g,(t)=>r(t,"mu-code__comment")),e=e.replace(/(&lt;!DOCTYPE[^&]*&gt;)/gi,(t)=>r(t,"mu-code__keyword")),e=e.replace(/("[^"]*")/g,(t)=>r(t,"mu-code__string")),e=e.replace(/(\s)([\w-]+)(=)/g,(t,l,i,d)=>`${l}${r(i,"mu-code__attr")}${d}`),e=e.replace(/(&lt;\/?)([\w-]+)/g,(t,l,i)=>`${l}${r(i,"mu-code__tag")}`),c(e)}if(o==="javascript"||o==="js"||o==="typescript"||o==="ts"){let{addMarker:r,resolveMarkers:c}=s(),e=a;return e=e.replace(/(\/\*[\s\S]*?\*\/)/g,(t)=>r(t,"mu-code__comment")),e=e.replace(/(\/\/.*)/g,(t)=>r(t,"mu-code__comment")),e=e.replace(/(`[^`]*`)/g,(t)=>r(t,"mu-code__string")),e=e.replace(/('[^']*'|"[^"]*")/g,(t)=>r(t,"mu-code__string")),e=e.replace(/\b(\d+\.?\d*(?:e[+-]?\d+)?)\b/gi,(t)=>r(t,"mu-code__number")),e=e.replace(/\b(const|let|var|function|return|if|else|for|while|do|switch|case|break|continue|class|extends|import|export|from|default|async|await|new|this|super|typeof|instanceof|in|of|try|catch|finally|throw|yield|static|get|set)\b/g,(t)=>r(t,"mu-code__keyword")),e=e.replace(/\b(true|false|null|undefined|NaN|Infinity)\b/g,(t)=>r(t,"mu-code__builtin")),e=e.replace(/\b([a-zA-Z_]\w*)\s*(?=\()/g,(t,l)=>r(l,"mu-code__function")),c(e)}if(o==="css"||o==="scss"||o==="sass"){let{addMarker:r,resolveMarkers:c}=s(),e=a;return e=e.replace(/(\/\*[\s\S]*?\*\/)/g,(t)=>r(t,"mu-code__comment")),e=e.replace(/('[^']*'|"[^"]*")/g,(t)=>r(t,"mu-code__string")),e=e.replace(/(@[\w-]+)/g,(t)=>r(t,"mu-code__keyword")),e=e.replace(/\b(\d+\.?\d*)(px|em|rem|%|vh|vw|s|ms|deg|fr)\b/g,(t,l,i)=>`${r(l,"mu-code__number")}${r(i,"mu-code__builtin")}`),e=e.replace(/\b(\d+\.?\d*)\b/g,(t)=>r(t,"mu-code__number")),e=e.replace(/(#[0-9a-fA-F]{3,8})\b/g,(t)=>r(t,"mu-code__string")),e=e.replace(/\b([\w-]+)\s*:/g,(t,l)=>`${r(l,"mu-code__attr")}:`),e=e.replace(/(^|[{,\s])([.#]?[\w-]+)(?=\s*[{,])/gm,(t,l,i)=>`${l}${r(i,"mu-code__tag")}`),c(e)}if(o==="json"){let{addMarker:r,resolveMarkers:c}=s(),e=a;return e=e.replace(/("[^"]*")\s*:/g,(t,l)=>`${r(l,"mu-code__attr")}:`),e=e.replace(/:\s*("[^"]*")/g,(t,l)=>`: ${r(l,"mu-code__string")}`),e=e.replace(/:\s*(-?\d+\.?\d*)/g,(t,l)=>`: ${r(l,"mu-code__number")}`),e=e.replace(/\b(true|false|null)\b/g,(t)=>r(t,"mu-code__builtin")),c(e)}if(o==="bash"||o==="sh"||o==="shell"){let{addMarker:r,resolveMarkers:c}=s(),e=a;return e=e.replace(/(#.*)/g,(t)=>r(t,"mu-code__comment")),e=e.replace(/('[^']*'|"[^"]*")/g,(t)=>r(t,"mu-code__string")),e=e.replace(/(\$\{?\w+\}?)/g,(t)=>r(t,"mu-code__attr")),e=e.replace(/\b(cd|ls|echo|cat|grep|find|sudo|npm|npx|bun|node|git|curl|wget|mkdir|rm|cp|mv|chmod|chown)\b/g,(t)=>r(t,"mu-code__keyword")),e=e.replace(/(\s)(--?[\w-]+)/g,(t,l,i)=>`${l}${r(i,"mu-code__builtin")}`),c(e)}return a}#r(a){let o=a.split(`
13
+ `);while(o.length>0&&o[0].trim()==="")o.shift();while(o.length>0&&o[o.length-1].trim()==="")o.pop();if(o.length===0)return"";let s=1/0;for(let r of o){if(r.trim()==="")continue;let c=r.match(/^(\s*)/),e=c?c[1].length:0;s=Math.min(s,e)}if(s===1/0||s===0)return o.join(`
14
+ `);return o.map((r)=>{if(r.trim()==="")return"";return r.slice(s)}).join(`
15
+ `)}#o(a,o){let s=a.split(`
16
+ `),r=[],c=0;for(let e=0;e<s.length;e++){let t=s[e].trim();if(t===""){r.push("");continue}let l=0,i=0;if(o==="html"){let d=(t.match(/<[a-zA-Z][^>]*(?<!\/)\s*>/g)||[]).length,u=(t.match(/<\/[^>]+>/g)||[]).length,m=(t.match(/<[^>]+\/>/g)||[]).length;l=d-m,i=u}else{let d=!1,u="";for(let m=0;m<t.length;m++){let n=t[m],y=m>0?t[m-1]:"";if((n==='"'||n==="'"||n==="`")&&y!=="\\"){if(!d)d=!0,u=n;else if(n===u)d=!1}if(!d){if(n==="{"||n==="["||n==="(")l++;if(n==="}"||n==="]"||n===")")i++}}}if((o==="html"?t.startsWith("</"):/^[}\]\)]/.test(t))&&i>0)c=Math.max(0,c-1),i--;r.push(" ".repeat(c)+t),c=Math.max(0,c+l-i)}return r.join(`
17
+ `)}#s(){if(this.style.display="block",this.style.background="var(--md-sys-color-surface-container-highest)",this.closest("mu-example"))this.style.borderTopLeftRadius="0",this.style.borderTopRightRadius="0",this.style.borderBottomLeftRadius="var(--md-sys-shape-corner-medium)",this.style.borderBottomRightRadius="var(--md-sys-shape-corner-medium)";else this.style.borderRadius="var(--md-sys-shape-corner-medium)";this.style.overflow="hidden",this.style.fontFamily="'Fira Code', 'Consolas', monospace",this.style.fontSize="13px";let a=this.querySelector(".mu-code__header");if(a)a.style.display="flex",a.style.justifyContent="space-between",a.style.alignItems="center",a.style.padding="8px 16px",a.style.background="var(--md-sys-color-surface-container)",a.style.borderBottom="1px solid var(--md-sys-color-outline-variant)";let o=this.querySelector(".mu-code__language");if(o)o.style.fontSize="11px",o.style.fontWeight="600",o.style.color="var(--md-sys-color-primary)",o.style.letterSpacing="0.5px";let s=this.querySelector(".mu-code__copy");if(s)s.style.background="transparent",s.style.border="none",s.style.cursor="pointer",s.style.color="var(--md-sys-color-on-surface-variant)",s.style.padding="4px",s.style.borderRadius="4px",s.style.display="flex",s.style.transition="all 0.2s ease";let r=this.querySelector(".mu-code__pre");if(r)r.style.margin="0",r.style.padding="16px",r.style.overflow="auto",r.style.maxHeight="400px";let c=this.querySelector(".mu-code__content");if(c)c.style.color="var(--md-sys-color-on-surface)";let e=document.createElement("style");e.textContent=`
18
+ .mu-code__tag { color: var(--md-sys-color-primary); }
19
+ .mu-code__attr { color: var(--md-sys-color-tertiary); }
20
+ .mu-code__string { color: var(--md-sys-color-secondary); }
21
+ .mu-code__keyword { color: var(--md-sys-color-primary); font-weight: 500; }
22
+ .mu-code__comment { color: var(--md-sys-color-outline); font-style: italic; }
23
+ .mu-code__number { color: var(--md-sys-color-error); }
24
+ .mu-code__function { color: var(--md-sys-color-tertiary); }
25
+ .mu-code__builtin { color: var(--md-sys-color-primary); font-weight: 500; }
26
+ .mu-code__copy:hover {
27
+ background: var(--md-sys-color-primary-container) !important;
28
+ color: var(--md-sys-color-on-primary-container) !important;
29
+ }
30
+ .mu-code__copy:active {
31
+ background: var(--md-sys-color-primary) !important;
32
+ color: var(--md-sys-color-on-primary) !important;
33
+ transform: scale(0.95);
34
+ }
35
+ .mu-code__copy.copied {
36
+ background: #c8e6c9 !important;
37
+ color: #1b5e20 !important;
38
+ }
39
+ `;let t=document.getElementById("mu-code-styles");if(t)t.remove();e.id="mu-code-styles",document.head.appendChild(e)}#l(a){let o=this.querySelector(".mu-code__copy");if(o)this.listen(o,"click",async()=>{try{await navigator.clipboard.writeText(a.trim()),o.classList.add("copied"),o.innerHTML=`
40
+ <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
41
+ <polyline points="20 6 9 17 4 12"/>
42
+ </svg>
43
+ `,this.setTimeout(()=>{o.classList.remove("copied"),o.innerHTML=`
44
+ <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
45
+ <rect x="9" y="9" width="13" height="13" rx="2" ry="2"/>
46
+ <path d="M5 15H4a2 2 0 01-2-2V4a2 2 0 012-2h9a2 2 0 012 2v1"/>
47
+ </svg>
48
+ `},2000)}catch(s){console.error("Copy failed:",s)}})}}h("mu-code",_);
@@ -0,0 +1,2 @@
1
+ function r(e){if(e==null)return"";return String(e).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#039;")}
2
+ export{r as i};
@@ -0,0 +1,17 @@
1
+ import{j as X,k as J}from"./chunk-5qah04bh.js";var f=Symbol("listeners"),z=Symbol("subCounter"),N=Symbol("maxListeners"),m=Symbol("fastCache"),k=Object.freeze({peerId:"self",origin:typeof globalThis.location<"u"?globalThis.location.origin:"unknown",type:"local"});class M{constructor(){this[f]=new Map,this[z]=0,this[N]=10,this[m]=Object.create(null)}setMaxListeners(e){return this[N]=e,this}getMaxListeners(){return this[N]}on(e,t,s={}){if(typeof e!=="string")throw TypeError("Signal name must be a string");if(typeof t!=="function")throw TypeError("Handler must be a function");let r=`sub_${++this[z]}`,i={id:r,handler:t,priority:s.priority??0,mode:s.mode??"async",once:s.once??!1,signal:s.signal??null};if(!this[f].has(e))this[f].set(e,[]);let n=this[f].get(e);if(n.length===0||i.priority<=n[n.length-1].priority)n.push(i);else{let u=0,g=n.length;while(u<g){let T=u+g>>>1;if(n[T].priority>=i.priority)u=T+1;else g=T}n.splice(u,0,i)}this[m][e]=n.map((u)=>u.handler);let o=this[N];if(o>0&&n.length>o)console.warn(`[CrossBus] Possible memory leak: ${n.length} listeners for "${e}". Use setMaxListeners(n) to increase limit.`);let h=!0,l={id:r,signalName:e,get active(){return h},unsubscribe:()=>{if(h)this.#t(e,r),h=!1}};if(i.signal)if(i.signal.aborted)this.#t(e,r),h=!1;else i.signal.addEventListener("abort",()=>{l.unsubscribe()},{once:!0});return l}once(e,t,s={}){return this.on(e,t,{...s,once:!0})}onFast(e,t){return(this[m][e]||=[]).push(t),()=>{this[m][e]=this[m][e]?.filter((s)=>s!==t)}}offFast(e,t){let s=this[m][e];if(s){let i=s.indexOf(t);if(i!==-1)s.splice(i,1)}let r=this[f].get(e);if(r){let i=r.findIndex((n)=>n.handler===t);if(i!==-1)r.splice(i,1)}}off(e,t){if(typeof e!=="string")throw TypeError("Signal name must be a string");let s=this[f].get(e);if(!s||s.length===0)return{success:!1,removedCount:0,remainingCount:0};let r=0;if(t===void 0)r=s.length,this[f].delete(e),delete this[m][e];else{let n=s.length,o=s.filter((h)=>h.handler!==t);if(r=n-o.length,o.length===0)this[f].delete(e),delete this[m][e];else this[f].set(e,o),this[m][e]=o.map((h)=>h.handler)}let i=this[f].get(e)?.length??0;return{success:r>0,removedCount:r,remainingCount:i}}emitSync(e,t){let s=this[m][e];if(!s)return 0;let r=s.length;if(r===1)return s[0](t),1;if(r===2)return s[0](t),s[1](t),2;if(r===3)return s[0](t),s[1](t),s[2](t),3;if(r===4)return s[0](t),s[1](t),s[2](t),s[3](t),4;for(let i=0;i<r;i++)s[i](t);return r}async emit(e,t,s){if(typeof e!=="string")throw TypeError("Signal name must be a string");let r=this[f].get(e),i=this[f].has("*");if(r?.length===1&&!i&&!s){let l=r[0],u={name:e,data:t,messageId:crypto.randomUUID(),timestamp:Date.now(),source:k};try{if(l.mode==="sync")await l.handler(u);else Promise.resolve().then(()=>l.handler(u))}catch(g){console.error(`[CrossBus] Handler error for "${e}":`,g)}if(l.once)this.#t(e,l.id);return 1}let n={name:e,data:t,messageId:crypto.randomUUID(),timestamp:Date.now(),source:s?{...k,...s}:k},o=this.#e(e),h=[];for(let{signalName:l,entry:u}of o){try{if(u.mode==="sync")await u.handler(n);else Promise.resolve().then(()=>u.handler(n))}catch(g){console.error(`[CrossBus] Handler error for "${e}":`,g)}if(u.once)h.push({signalName:l,id:u.id})}for(let{signalName:l,id:u}of h)this.#t(l,u);return o.length}hasListeners(e){let t=this[f].get(e);return t!==void 0&&t.length>0}listenerCount(e){return this[f].get(e)?.length??0}getSignalNames(){return Array.from(this[f].keys())}clear(){this[f].clear();for(let e in this[m])delete this[m][e]}#e(e){let t=this[f].get(e),s=this[f].get("*"),r=null,i=e.indexOf(":");if(i>0){let h=e.slice(0,i+1)+"*";r=this[f].get(h)}if(t&&!s&&!r)return t.map((h)=>({signalName:e,entry:h}));let n=[t&&{signalName:e,entries:t},s&&{signalName:"*",entries:s},r&&{signalName:e.slice(0,i+1)+"*",entries:r}].filter(Boolean);if(n.length===0)return[];if(n.length===1)return n[0].entries.map((h)=>({signalName:n[0].signalName,entry:h}));let o=[];for(let{signalName:h,entries:l}of n)for(let u of l)o.push({signalName:h,entry:u});return o.sort((h,l)=>l.entry.priority-h.entry.priority),o}#t(e,t){let s=this[f].get(e);if(!s)return;let r=s.filter((i)=>i.id!==t);if(r.length===0)this[f].delete(e),delete this[m][e];else this[f].set(e,r),this[m][e]=r.map((i)=>i.handler)}}var y="_cb",E=1,d=Object.freeze({SIGNAL:"sig",REQUEST:"req",RESPONSE:"res",ACK:"ack",HANDSHAKE:"hsk",HANDSHAKE_INIT:"hsk_init",HANDSHAKE_ACK:"hsk_ack",HANDSHAKE_COMPLETE:"hsk_done",PING:"png",PONG:"pog",BYE:"bye",BROADCAST:"bc"}),P=Object.freeze({INIT:"init",INIT_SENT:"init_sent",ACK:"ack",ACK_SENT:"ack_sent",DONE:"done"}),U=Object.freeze({CONNECTING:"connecting",CONNECTED:"connected",DISCONNECTED:"disconnected",RECONNECTING:"reconnecting",FAILED:"failed"}),we=Object.freeze({IFRAME:"iframe",WORKER:"worker",SERVICE_WORKER:"sw",WINDOW:"window",PORT:"port"}),be=Object.freeze({LOCAL:"local",SENT:"sent",ACKED:"acked",QUEUED:"queued",TIMEOUT:"timeout",FAILED:"failed"});function S(e){return e!==null&&typeof e==="object"&&e[y]===E&&typeof e.id==="string"&&(typeof e.type==="string"||typeof e.t==="string")}function ne(e){if(e instanceof ArrayBuffer)return!0;if(e instanceof MessagePort)return!0;if(typeof ImageBitmap<"u"&&e instanceof ImageBitmap)return!0;if(typeof OffscreenCanvas<"u"&&e instanceof OffscreenCanvas)return!0;if(typeof ReadableStream<"u"&&e instanceof ReadableStream)return!0;if(typeof WritableStream<"u"&&e instanceof WritableStream)return!0;if(typeof TransformStream<"u"&&e instanceof TransformStream)return!0;return!1}function D(e,t=new Set){if(e===null||e===void 0)return Array.from(t);if(ne(e))return t.add(e),Array.from(t);if(Array.isArray(e))for(let s of e)D(s,t);else if(typeof e==="object")for(let s of Object.keys(e))D(e[s],t);return Array.from(t)}function G(e,t,s={},r=null){return Object.freeze({[y]:E,version:E,id:r||crypto.randomUUID(),type:e,timestamp:Date.now(),payload:Object.freeze({...t}),meta:Object.freeze({...s})})}function ae(e,t,s,r=null){return G(d.SIGNAL,{name:e,data:t,source:s,dest:r})}function oe(e,t,s,r,i=null){return G(d.REQUEST,{name:e,data:t,source:s,dest:r},{},i)}function O(e,t,s,r=!0,i=null){return G(d.RESPONSE,{requestId:e,data:t,source:s,success:r,error:i})}var a=Object.freeze({HANDSHAKE_TIMEOUT:"ERR_HANDSHAKE_TIMEOUT",HANDSHAKE_REJECTED:"ERR_HANDSHAKE_REJECTED",ORIGIN_FORBIDDEN:"ERR_ORIGIN_FORBIDDEN",PEER_EXISTS:"ERR_PEER_EXISTS",PEER_NOT_FOUND:"ERR_PEER_NOT_FOUND",PEER_DISCONNECTED:"ERR_PEER_DISCONNECTED",RECONNECT_FAILED:"ERR_RECONNECT_FAILED",UNSUPPORTED:"ERR_UNSUPPORTED",NOT_CONNECTED:"ERR_NOT_CONNECTED",ACK_TIMEOUT:"ERR_ACK_TIMEOUT",RESPONSE_TIMEOUT:"ERR_RESPONSE_TIMEOUT",QUEUE_FULL:"ERR_QUEUE_FULL",INVALID_MESSAGE:"ERR_INVALID_MESSAGE",VERSION_MISMATCH:"ERR_VERSION_MISMATCH",CLONE_ERROR:"ERR_CLONE_ERROR",TRANSFER_ERROR:"ERR_TRANSFER_ERROR",MESSAGE_TOO_LARGE:"ERR_MESSAGE_TOO_LARGE",UNREACHABLE:"ERR_UNREACHABLE",TTL_EXCEEDED:"ERR_TTL_EXCEEDED",NO_ROUTE:"ERR_NO_ROUTE",NO_HANDLER:"ERR_NO_HANDLER",HANDLER_ERROR:"ERR_HANDLER_ERROR",HANDLER_TIMEOUT:"ERR_HANDLER_TIMEOUT",HANDLER_EXISTS:"ERR_HANDLER_EXISTS",SEND_FAILED:"ERR_SEND_FAILED",CHANNEL_FAILED:"ERR_CHANNEL_FAILED",CHANNEL_CLOSED:"ERR_CHANNEL_CLOSED",MAX_PEERS:"ERR_MAX_PEERS",MAX_PENDING:"ERR_MAX_PENDING",DESTROYED:"ERR_DESTROYED",CIRCUIT_OPEN:"ERR_CIRCUIT_OPEN",PAYLOAD_TOO_LARGE:"ERR_PAYLOAD_TOO_LARGE",RATE_LIMITED:"ERR_RATE_LIMITED",UNAUTHORIZED:"ERR_UNAUTHORIZED",INVALID_PAYLOAD:"ERR_INVALID_PAYLOAD"}),he=Object.freeze({[a.HANDSHAKE_TIMEOUT]:{message:"Handshake timed out",retryable:!0,suggestion:"Increase timeout or check if target is loaded. Use iframe.onload before connecting."},[a.HANDSHAKE_REJECTED]:{message:"Handshake rejected by peer",retryable:!1,suggestion:"Check targetOrigin matches the peer's origin. Verify peer allows your origin."},[a.ORIGIN_FORBIDDEN]:{message:"Origin not in allowed origins list",retryable:!1,suggestion:'Add your origin to allowedOrigins option or use targetOrigin: "*" for development.'},[a.PEER_EXISTS]:{message:"Peer with this ID already exists",retryable:!1,suggestion:"Use unique peerId for each context. Try: peerId: `agent-${Date.now()}`"},[a.PEER_NOT_FOUND]:{message:"Peer not found",retryable:!1,suggestion:"Check if peer is connected using bus.peers. Wait for peer connection before request."},[a.PEER_DISCONNECTED]:{message:"Peer is disconnected",retryable:!0,suggestion:'Wait for peer to reconnect. Listen for "peer:join" event before retry.'},[a.RECONNECT_FAILED]:{message:"Max reconnection attempts reached",retryable:!1,suggestion:"Check network connectivity. Consider increasing maxRetries option."},[a.UNSUPPORTED]:{message:"Operation not supported by this environment",retryable:!1,suggestion:"This feature requires a browser environment. Check for feature availability first."},[a.NOT_CONNECTED]:{message:"Transport is not connected",retryable:!0,suggestion:"Call addTransport() and wait for connection before sending messages."},[a.ACK_TIMEOUT]:{message:"ACK not received within timeout",retryable:!0,suggestion:"Increase ackTimeout option or check peer availability."},[a.RESPONSE_TIMEOUT]:{message:"Response not received within timeout",retryable:!0,suggestion:"Increase timeout in request options: { timeout: 10000 }. Check if handler exists on peer."},[a.QUEUE_FULL]:{message:"Message queue is full",retryable:!1,suggestion:"Increase maxQueueSize or wait for queue to drain. Consider using batching plugin."},[a.INVALID_MESSAGE]:{message:"Invalid message format",retryable:!1,suggestion:"Ensure message data is JSON-serializable. Avoid DOM nodes and functions."},[a.VERSION_MISMATCH]:{message:"Protocol version mismatch",retryable:!1,suggestion:"Update CrossBus to same version on both sides."},[a.CLONE_ERROR]:{message:"Data cannot be cloned (contains functions or DOM nodes)",retryable:!1,suggestion:"Remove functions, DOM nodes, and circular references from message data."},[a.TRANSFER_ERROR]:{message:"Failed to transfer object ownership",retryable:!1,suggestion:"Ensure ArrayBuffers are not detached. Each buffer can only be transferred once."},[a.MESSAGE_TOO_LARGE]:{message:"Message exceeds maximum size",retryable:!1,suggestion:"Use streaming for large payloads or increase maxMessageSize option."},[a.UNREACHABLE]:{message:"Destination peer is unreachable",retryable:!0,suggestion:"Check if peer is still connected. Use bus.peers to list available peers."},[a.TTL_EXCEEDED]:{message:"Message TTL exceeded (possible routing loop)",retryable:!1,suggestion:"Check for circular transport configurations. Increase maxTTL if needed."},[a.NO_ROUTE]:{message:"No route to destination",retryable:!1,suggestion:"Add transport connecting to target peer. Set isHub: true on orchestrator."},[a.NO_HANDLER]:{message:"No handler registered for this request",retryable:!1,suggestion:'Register handler on target: bus.handle("handlerName", fn). Check handler name spelling.'},[a.HANDLER_ERROR]:{message:"Handler threw an exception",retryable:!1,suggestion:"Check target peer logs for error. Wrap handler in try/catch."},[a.HANDLER_TIMEOUT]:{message:"Handler did not respond within timeout",retryable:!0,suggestion:"Handler is slow. Increase timeout or optimize handler performance."},[a.HANDLER_EXISTS]:{message:"Handler already registered with this name",retryable:!1,suggestion:"Use different handler name or call bus.removeHandler() first."},[a.SEND_FAILED]:{message:"Failed to send message to peer",retryable:!0,suggestion:"Check transport status. Target window may be closed or blocked."},[a.CHANNEL_FAILED]:{message:"Failed to create direct channel",retryable:!0,suggestion:"Check browser support for MessageChannel. Retry after short delay."},[a.CHANNEL_CLOSED]:{message:"Channel was closed unexpectedly",retryable:!1,suggestion:"Target context was destroyed. Check if iframe/worker still exists."},[a.MAX_PEERS]:{message:"Maximum number of peers reached",retryable:!1,suggestion:"Increase maxPeers option or disconnect unused peers first."},[a.MAX_PENDING]:{message:"Maximum pending requests reached",retryable:!1,suggestion:"Wait for pending requests to complete. Increase maxPendingRequests option."},[a.DESTROYED]:{message:"CrossBus instance has been destroyed",retryable:!1,suggestion:"Create new CrossBus instance. Do not use bus after calling destroy()."},[a.CIRCUIT_OPEN]:{message:"Circuit breaker is open",retryable:!1,suggestion:"Too many failures. Wait for circuit to reset or call circuit.reset()."},[a.PAYLOAD_TOO_LARGE]:{message:"Payload exceeds maximum allowed size",retryable:!1,suggestion:"Reduce payload size or increase maxPayloadSize option. Consider using streaming for large data."},[a.RATE_LIMITED]:{message:"Request rate limit exceeded",retryable:!0,suggestion:"Wait before retrying. Consider adding delay or using exponential backoff."},[a.UNAUTHORIZED]:{message:"Peer is not authorized to call this handler",retryable:!1,suggestion:"Add peer to handler allowedPeers list or remove peer restrictions."},[a.INVALID_PAYLOAD]:{message:"Payload validation failed",retryable:!1,suggestion:"Check payload structure against handler requirements."}});class c extends Error{code;details;retryable;cause;timestamp;constructor(e,t,s={}){let r=he[e]??{message:"Unknown error",retryable:!1};super(t??r.message);if(this.name="CrossBusError",this.code=e,this.details=s.details??{},this.retryable=s.retryable??r.retryable,this.cause=s.cause,this.timestamp=Date.now(),Error.captureStackTrace)Error.captureStackTrace(this,c)}static from(e,t={}){return new c(e,void 0,{details:t})}static wrap(e,t,s={}){return new c(e,t.message,{cause:t,details:s})}toJSON(){return{name:this.name,code:this.code,message:this.message,details:this.details,retryable:this.retryable,timestamp:this.timestamp}}toString(){return`${this.name} [${this.code}]: ${this.message}`}}function b(){if(typeof crypto<"u"&&crypto.randomUUID)return crypto.randomUUID();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(e)=>{let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}function j(){if(typeof Promise.withResolvers==="function")return Promise.withResolvers();let e,t;return{promise:new Promise((s,r)=>{e=s,t=r}),resolve:e,reject:t}}function q(e,t,s="Operation timed out"){return Promise.race([e,new Promise((r,i)=>{setTimeout(()=>i(Error(s)),t)})])}class K extends M{#e=new Map;#t=0;#s=new Map;#i=Object.create(null);#r=Object.create(null);#n=[];constructor(){super()}addPeer(e,t,s={}){if(this.#e.has(e))throw c.from(a.PEER_EXISTS,{peerId:e});if(typeof t!=="function")throw TypeError("sendFn must be a function");let r={peerId:e,sendFn:t,meta:s.meta??{},origin:s.origin??"unknown",status:U.CONNECTED,connectedAt:Date.now()};this.#e.set(e,r),this.#s.set(e,0),this.#i[e]=r,this.#r[e]=t,this.#n.push(e),this.emit("peer:added",{peerId:e,meta:r.meta})}removePeer(e){let t=this.#i[e];if(!t)return!1;this.#e.delete(e),this.#s.delete(e),delete this.#i[e],delete this.#r[e];let s=this.#n.indexOf(e);if(s!==-1)this.#n.splice(s,1);return this.emit("peer:removed",{peerId:e,meta:t.meta}),!0}getPeer(e){return this.#i[e]}getPeerIds(){return this.#n.slice()}get peerCount(){return this.#e.size}route(e,t={}){let{target:s,payload:r}=e;if(s)return this.#a(s,r);else{let i=t.exclude,n=i?.length?new Set(i):null;return this.#o(r,n)}}broadcast(e,t={}){let s=t.exclude,r=s?.length?new Set(s):null,i=t.include,n=i?.length?new Set(i):null,o=0,h=[];for(let[l,u]of this.#e){if(r?.has(l))continue;if(n&&!n.has(l))continue;if(u.status!==U.CONNECTED)continue;try{let g=this.#h(l,e,d.BROADCAST);u.sendFn(g),o++}catch(g){console.error(`[Router] Failed to send to ${l}:`,g),h.push(l)}}return{success:h.length===0,delivered:o,failed:h}}getSequence(e){return this.#s.get(e)??0}setPeerStatus(e,t){let s=this.#i[e];if(s)s.status=t,this.emit("peer:status",{peerId:e,status:t})}clearPeers(){let e=this.#n.slice();for(let t of e)this.removePeer(t)}#a(e,t){let s=this.#i[e];if(!s)return{success:!1,delivered:0,failed:[e],error:a.PEER_NOT_FOUND};if(s.status!==U.CONNECTED)return{success:!1,delivered:0,failed:[e],error:a.PEER_DISCONNECTED};try{let r=t&&t._cb?t:this.#h(e,t,d.SIGNAL);return s.sendFn(r),{success:!0,delivered:1,failed:[]}}catch(r){return console.error(`[Router] Failed to send to ${e}:`,r),{success:!1,delivered:0,failed:[e]}}}#o(e,t){return this.broadcast(e,t?{exclude:Array.from(t)}:{})}#h(e,t,s){let r=(this.#s.get(e)??0)+1;return this.#s.set(e,r),{id:`msg_${++this.#t}`,t:s,ts:Date.now(),seq:r,p:t}}}class F{#e=new Map;#t=Object.create(null);#s=0;#i;#r;constructor(e={}){this.#i=e.defaultTimeout??30000,this.#r=e.maxPending??1000}create(e,t,s={}){if(this.#r>0&&this.#e.size>=this.#r)throw c.from(a.MAX_PENDING,{current:this.#e.size,max:this.#r,targetPeer:e,handlerName:t});let r=Date.now(),i=`req_${++this.#s}_${r}`,n=s.timeout??this.#i,{promise:o,resolve:h,reject:l}=j(),u={id:i,targetPeer:e,handlerName:t,createdAt:r,timeout:n,resolve:h,reject:l,defaultValue:s.defaultValue};this.#e.set(i,u),this.#t[i]=u;let g=q(o,n).catch((T)=>{if(i in this.#t){if(this.#e.delete(i),delete this.#t[i],"defaultValue"in s)return s.defaultValue;throw c.from(a.RESPONSE_TIMEOUT,{requestId:i,targetPeer:e,handlerName:t,timeout:n})}throw T});return{requestId:i,promise:g}}resolve(e,t){let s=this.#t[e];if(!s)return!1;if(this.#e.delete(e),delete this.#t[e],t.success)s.resolve(t.data);else{let r=c.from(t.error?.code??a.HANDLER_ERROR,{requestId:e,targetPeer:s.targetPeer,handlerName:s.handlerName,originalError:t.error});r.message=t.error?.message??"Handler error",s.reject(r)}return!0}reject(e,t){let s=this.#t[e];if(!s)return!1;this.#e.delete(e),delete this.#t[e];let r=t instanceof Error?t:Error(t);return s.reject(r),!0}cancel(e){let t=this.#t[e];if(!t)return!1;return this.#e.delete(e),delete this.#t[e],t.reject(Error("Request cancelled")),!0}cancelForPeer(e){let t=0;for(let[s,r]of this.#e)if(r.targetPeer===e)this.#e.delete(s),delete this.#t[s],r.reject(c.from(a.PEER_DISCONNECTED,{peerId:e,requestId:s})),t++;return t}cancelAll(){let e=this.#e.size;for(let[t,s]of this.#e)s.reject(Error("All requests cancelled"));this.#e.clear();for(let t in this.#t)delete this.#t[t];return e}has(e){return e in this.#t}get(e){return this.#t[e]}get size(){return this.#e.size}getRequestIds(){return Array.from(this.#e.keys())}getForPeer(e){let t=[];for(let s of this.#e.values())if(s.targetPeer===e)t.push(s);return t}}class Q{#e;#t;#s;#i;#r=new Map;constructor(e={}){this.#e=e.peerId??b(),this.#t=e.meta??{},this.#s=e.capabilities??[],this.#i=e.timeout??1e4}get peerId(){return this.#e}createInitMessage(){return{type:d.HANDSHAKE_INIT,handshakeId:b(),peerId:this.#e,meta:this.#t,capabilities:this.#s,timestamp:Date.now()}}createAckMessage(e,t,s){return{type:d.HANDSHAKE_ACK,handshakeId:e.handshakeId,peerId:this.#e,meta:this.#t,capabilities:this.#s,accept:t,reason:t?void 0:s,timestamp:Date.now()}}createCompleteMessage(e){return{type:d.HANDSHAKE_COMPLETE,handshakeId:e,confirmed:!0,timestamp:Date.now()}}async initiate(e){let t=this.createInitMessage(),{promise:s,resolve:r,reject:i}=j();this.#r.set(t.handshakeId,{phase:P.INIT_SENT,resolve:r,reject:i,initMsg:t,startTime:Date.now()}),e(t);try{return await q(s,this.#i)}catch(n){if(this.#r.delete(t.handshakeId),n.code===a.HANDSHAKE_TIMEOUT)return{success:!1,error:a.HANDSHAKE_TIMEOUT,reason:`Handshake timeout after ${this.#i}ms`};return{success:!1,error:a.HANDSHAKE_REJECTED,reason:n.message}}}handleMessage(e,t,s,r){switch(e.type){case d.HANDSHAKE_INIT:return this.#n(e,t,s,r);case d.HANDSHAKE_ACK:return this.#a(e,t,s);case d.HANDSHAKE_COMPLETE:return this.#o(e,t);default:return null}}hasPending(e){return this.#r.has(e)}cancel(e){let t=this.#r.get(e);if(t)t.reject(Error("Handshake cancelled")),this.#r.delete(e)}cancelAll(){for(let[e,t]of this.#r)t.reject(Error("All handshakes cancelled"));this.#r.clear()}#n(e,t,s,r){if(r&&!r(e,t)){let n=this.createAckMessage(e,!1,"Validation failed");return s(n),null}let i=this.createAckMessage(e,!0);return s(i),this.#r.set(e.handshakeId,{phase:P.ACK_SENT,remotePeer:{peerId:e.peerId,origin:t,meta:e.meta,capabilities:e.capabilities}}),null}#a(e,t,s){let r=this.#r.get(e.handshakeId);if(!r)return null;if(!e.accept)return r.reject(Error(e.reason||"Connection rejected")),this.#r.delete(e.handshakeId),null;let i=this.createCompleteMessage(e.handshakeId);s(i);let n={peerId:e.peerId,origin:t,meta:e.meta,capabilities:e.capabilities,type:"unknown",connectedAt:Date.now()};return r.resolve({success:!0,peer:n}),this.#r.delete(e.handshakeId),n}#o(e,t){let s=this.#r.get(e.handshakeId);if(!s||s.phase!==P.ACK_SENT)return null;if(!e.confirmed)return this.#r.delete(e.handshakeId),null;let r={...s.remotePeer,connectedAt:Date.now()};return this.#r.delete(e.handshakeId),r}}class Y{#e=new Set;#t=[];#s=!1;#i;constructor(e={}){if(this.#s=e.allowAll??!1,this.#i=globalThis.location?.origin,e.allowed)for(let t of e.allowed)this.#r(t)}isAllowed(e){if(this.#s)return!0;if(e==="null"||e===null)return this.#e.has("null");if(this.#e.size===0&&this.#t.length===0)return e===this.#i;if(this.#e.has(e))return!0;for(let t of this.#t)if(t.test(e))return!0;return!1}allow(e){return this.#r(e),this}disallow(e){if(this.#e.has(e))return this.#e.delete(e),!0;return!1}getAllowed(){return Array.from(this.#e)}clear(){this.#e.clear(),this.#t=[]}get selfOrigin(){return this.#i}#r(e){if(typeof e!=="string")throw TypeError("Origin must be a string");if(e==="*"){this.#s=!0;return}if(e.includes("*")){let t=this.#n(e);this.#t.push(t)}else this.#e.add(e)}#n(e){let t=e.replace(/[.+?^${}()|[\]\\]/g,"\\$&").replace(/\*/g,"[a-zA-Z0-9.-]{0,253}");return new RegExp(`^${t}$`)}}class B extends M{#e;#t;#s;#i;#r;#n;#a;#o=new Map;#h=[];#l=[];#d;#f;#c;#g;#u;#m;#y=new Map;#p=new Map;#w=!1;#b="[CrossBus]";#S;#E=!1;constructor(e={}){super();if(this.#e=e.peerId??b(),this.#t=e.isHub??!1,this.#d=e.meta??{},this.#f=e.capabilities??[],this.#c=e.requestTimeout??30000,this.#s=new K,this.#i=new F({defaultTimeout:this.#c}),this.#r=new Q({peerId:this.#e,meta:this.#d,capabilities:this.#f,timeout:e.handshakeTimeout??1e4}),this.#n=new Y({allowed:e.allowedOrigins??[]}),this.#a=e.contentType??"application/json",this.#g=e.maxPayloadSize??1048576,this.#u=e.maxPendingRequests??100,this.#m=e.strictMode??!1,this.#w=e.debug??!1,this.#b=e.debugPrefix??"[CrossBus]",this.#S=Date.now(),this.#D(e),this.#f.push(`serializer:${this.#a}`),this.#s.on("peer:added",(t)=>{this.emit("peer:connected",t.data)}),this.#s.on("peer:removed",(t)=>{this.emit("peer:disconnected",t.data)}),this.#s.on("peer:status",(t)=>{this.emit("peer:status",t.data)}),this.#w)this.#R("info",`Initialized (isHub: ${this.#t})`)}get peerId(){return this.#e}get isHub(){return this.#t}get peerCount(){return this.#s.peerCount}get peers(){return this.#s.getPeerIds()}getPeer(e){return this.#s.getPeer(e)}async signal(e,t,s={}){this.#T();let r=await this.#I(this.#l,t,{type:"signal",direction:"outbound"}),i=ae(e,r,this.#e),n=await this.#s.broadcast(i,s);return this.#R("out",`SIGNAL "${e}" to ${n.delivered} peers`),n}async request(e,t,s,r={}){if(this.#T(),this.#R("out",`REQUEST "${t}" to ${e}`),!this.#s.getPeer(e))throw c.from(a.PEER_NOT_FOUND,{peerId:e});let{requestId:i,promise:n}=this.#i.create(e,t,{timeout:r.timeout??this.#c}),o=await this.#I(this.#l,s,{type:"request",peerId:e,handlerName:t,direction:"outbound"}),h=oe(t,o,this.#e,e,i);if(!this.#s.route({target:e,payload:h}).success)throw this.#i.cancel(i),c.from(a.SEND_FAILED,{peerId:e});return n}async broadcastRequest(e,t,s={}){this.#T();let r=s.timeout??this.#c,i=s.ignoreErrors??!0,n=new Set(s.exclude??[]),o=new Map,h=[];for(let l of this.#s.getPeerIds()){if(n.has(l))continue;let u=this.request(l,e,t,{timeout:r}).then((g)=>{o.set(l,{success:!0,data:g})}).catch((g)=>{if(i)o.set(l,{success:!1,error:g.message});else throw g});h.push(u)}return await Promise.all(h),o}handle(e,t,s={}){if(this.#o.has(e))throw c.from(a.HANDLER_EXISTS,{handlerName:e});if(s.allowedPeers||s.rateLimit||s.validatePayload)this.#p.set(e,s);return this.#o.set(e,t),()=>{this.#o.delete(e),this.#p.delete(e)}}unhandle(e){return this.#o.delete(e)}hasHandler(e){return this.#o.has(e)}addInboundHook(e,t=10){if(typeof e!=="function")throw TypeError("hookFn must be a function");let s={fn:e,priority:t};return this.#h.push(s),this.#h.sort((r,i)=>r.priority-i.priority),()=>this.removeInboundHook(e)}addOutboundHook(e,t=10){if(typeof e!=="function")throw TypeError("hookFn must be a function");let s={fn:e,priority:t};return this.#l.push(s),this.#l.sort((r,i)=>r.priority-i.priority),()=>this.removeOutboundHook(e)}removeInboundHook(e){let t=this.#h.findIndex((s)=>s.fn===e);if(t!==-1)return this.#h.splice(t,1),!0;return!1}removeOutboundHook(e){let t=this.#l.findIndex((s)=>s.fn===e);if(t!==-1)return this.#l.splice(t,1),!0;return!1}addPeer(e,t,s={}){this.#T(),this.#s.addPeer(e,t,s)}removePeer(e){return this.#i.cancelForPeer(e),this.#s.removePeer(e)}addTransport(e,t={}){if(this.#T(),!e||typeof e.send!=="function")throw TypeError("Transport must have a send() method");let s=t.peerId||e.peerId||`transport-${b()}`,r=t.origin||"*";if(typeof e.onMessage==="function")e.onMessage((i)=>{this.handleMessage(i,r,s)});return this.addPeer(s,(i)=>{e.send(i)},t),()=>{if(this.removePeer(s),typeof e.destroy==="function")e.destroy()}}async handleMessage(e,t,s,r){if(this.#E)return;if(!this.#n.isAllowed(t)){console.warn(`[CrossBus] Blocked message from unauthorized origin: ${t}`);return}let i=e.payload??e.data??e.p,n=e.type??e.t,o=e.handler??e.name,h=i;if(e.payload&&typeof e.payload==="object"&&!e.p){if(n===d.SIGNAL||n===d.BROADCAST)o=e.payload.name,h=e.payload.data;else if(n===d.REQUEST)o=e.payload.name,h=e.payload.data;else if(n===d.RESPONSE)h=e.payload.data}else if(e.t&&!e.type&&e.p&&typeof e.p==="object"&&e.p.payload){let l=e.p;o=l.payload.name??l.name,h=l.payload.data??l.data}if(h!==void 0){let l={type:n===d.SIGNAL?"signal":n===d.REQUEST?"request":"response",peerId:s,handlerName:o,direction:"inbound"};h=await this.#I(this.#h,h,l)}switch(n){case d.BROADCAST:case d.SIGNAL:if(typeof o!=="string"){console.warn("[CrossBus] Invalid signal name type");return}await this.#N(o,h,s);break;case d.REQUEST:if(typeof o!=="string"){console.warn("[CrossBus] Invalid handler name type");return}await this.#O(e.id,o,h,s,r);break;case d.RESPONSE:{let{success:l,error:u}=e;if(e.payload&&e.payload.success!==void 0)l=e.payload.success,u=e.payload.error;this.#A(e.payload?.requestId??e.id,l,h,u);break}case d.HANDSHAKE_INIT:case d.HANDSHAKE_ACK:case d.HANDSHAKE_COMPLETE:this.#r.handleMessage(e,t,r);break;default:console.warn(`[CrossBus] Unknown message type: ${n}`)}}destroy(){if(this.#E)return;this.#E=!0,this.#i.cancelAll(),this.#o.clear(),this.#s.clearPeers(),this.clear(),this.emit("destroyed",{})}get isDestroyed(){return this.#E}async#N(e,t,s){await this.emit(e,{payload:t,source:s})}async#O(e,t,s,r,i){let n=this.#o.get(t),o;if(!n)o=O(e,null,this.#e,!1,{code:a.NO_HANDLER,message:"Handler not found"});else{let h=this.#_(t,r,s);if(!h.allowed)o=O(e,null,this.#e,!1,{code:h.error?.code??a.UNAUTHORIZED,message:h.error?.message??"Security check failed"});else try{let l=await n(s,{peerId:r,requestId:e,handlerName:t}),u=await this.#I(this.#l,l,{type:"response",peerId:r,handlerName:t,direction:"outbound"});o=O(e,u,this.#e,!0)}catch(l){o=O(e,null,this.#e,!1,{code:l.code??a.HANDLER_ERROR,message:l.message})}}if(i)i(o);else if(r)this.#s.route({target:r,payload:o})}#A(e,t,s,r){this.#i.resolve(e,{requestId:e,success:t,data:s,error:r})}#T(){if(this.#E)throw c.from(a.DESTROYED,{context:"CrossBus operation"})}async#I(e,t,s){let r=t;for(let{fn:i}of e)try{r=await i(r,s)}catch(n){console.error("[CrossBus] Hook error:",n)}return r}#D(e){if(!(typeof process<"u"?process.env?.NODE_ENV!=="production":typeof window<"u"&&window.location?.hostname==="localhost"))return;if(!e.allowedOrigins||e.allowedOrigins.length===0)console.warn(`[CrossBus Security] ⚠️ No allowedOrigins specified.
2
+ `+`This bus will REJECT all incoming messages from transports.
3
+ To receive messages, specify allowed origins:
4
+ allowedOrigins: ["https://trusted-domain.com"]
5
+ For development only: allowedOrigins: ["*"]`);if(e.allowedOrigins?.includes("*")){if(console.warn(`[CrossBus Security] ⚠️ allowedOrigins: ["*"] accepts messages from ANY origin.
6
+ `+`This is INSECURE in production. Use specific origins instead:
7
+ allowedOrigins: ["https://trusted-domain.com"]
8
+ For production, use:
9
+ CrossBus.createSecure({ allowedOrigins: ["https://..."] })
10
+ Suppress this warning with NODE_ENV=production`),this.#m)throw Error('strictMode: allowedOrigins: ["*"] is not allowed. Use specific origins for security.')}}#_(e,t,s){let r=this.#p.get(e);if(!r)return{allowed:!0};if(r.allowedPeers&&!r.allowedPeers.includes(t))return{allowed:!1,error:c.from(a.UNAUTHORIZED,{handler:e,peer:t,allowedPeers:r.allowedPeers})};if(r.rateLimit){let i=`${e}:${t}`;if(!this.#C(i,r.rateLimit))return{allowed:!1,error:c.from(a.RATE_LIMITED,{handler:e,peer:t,limit:r.rateLimit})}}if(r.validatePayload)try{if(!r.validatePayload(s))return{allowed:!1,error:c.from(a.INVALID_PAYLOAD,{handler:e})}}catch(i){return{allowed:!1,error:c.from(a.INVALID_PAYLOAD,{handler:e,reason:i?.message??"Validation error"})}}return{allowed:!0}}#C(e,t){let s=Date.now(),r=this.#y.get(e);if(!r||s>=r.resetAt)return this.#y.set(e,{count:1,resetAt:s+1000}),!0;if(r.count>=t)return!1;return r.count++,!0}get maxPayloadSize(){return this.#g}get strictMode(){return this.#m}get debug(){return this.#w}get uptime(){return Date.now()-this.#S}#R(e,t){if(!this.#w)return;let s=e==="out"?"→":e==="in"?"←":e==="warn"?"⚠️":e==="error"?"❌":"ℹ️";console.log(`${this.#b} ${s} ${t}`)}healthCheck(){let e=this.#s.getPeerIds(),t=e.length,s="healthy";if(this.#E)s="unhealthy";else if(t===0&&this.#t)s="degraded";let r;if(typeof process<"u"&&process.memoryUsage)try{let i=process.memoryUsage();r={heapUsed:i.heapUsed,heapTotal:i.heapTotal,rss:i.rss}}catch{}return{status:s,peerId:this.#e,isHub:this.#t,uptime:this.uptime,peers:{total:t,ids:e},handlers:Array.from(this.#o.keys()),pendingRequests:this.#i.size??0,destroyed:this.#E,...r&&{memory:r}}}static createSecure(e={}){if(!e.allowedOrigins||e.allowedOrigins.length===0)throw Error('createSecure() requires allowedOrigins to be specified. For development, use: new CrossBus({ allowedOrigins: ["*"] })');if(e.allowedOrigins.includes("*"))throw Error('createSecure() does not allow wildcard origins. Specify exact origins: allowedOrigins: ["https://example.com"]');return new B({strictMode:!0,maxPayloadSize:1048576,maxPendingRequests:100,requestTimeout:30000,...e})}diagnose(){let e=[],t=[],s=[];if(this.#E)return e.push("Instance is destroyed"),t.push("Create a new CrossBus instance"),{status:"error",issues:e,suggestions:t,warnings:s};let r=this.#s.getPeerIds().length;if(r===0)if(this.#t)s.push("Hub has no connected peers"),t.push("Add transports with addTransport() or wait for agents to connect");else e.push("Agent has no connected peers"),t.push('Add a transport to connect to hub: bus.addTransport(transport, {peerId: "hub"})');let i=this.#o.size;if(this.#t&&i===0)s.push("Hub has no registered handlers"),t.push('Register handlers with bus.handle("name", fn)');let n=this.#i.size??0;if(n>this.#u*0.8)s.push(`High pending request count: ${n}/${this.#u}`),t.push("Consider increasing maxPendingRequests or check for slow handlers");if(!this.#m)s.push("strictMode is disabled"),t.push("For production, use CrossBus.createSecure() or set strictMode: true");let o="healthy";if(e.length>0)o="error";else if(s.length>0)o="warning";return{status:o,peerId:this.#e,isHub:this.#t,peerCount:r,handlerCount:i,pendingRequests:n,uptime:this.uptime,issues:e,warnings:s,suggestions:t}}}class ${#e;#t;#s;#i;#r=0;#n=!1;#a=!1;#o;constructor(e,t,s={}){this.#e=b(),this.#t=t,this.#s=e,this.#i=s.chunkSize??64000,this.#o=s.meta??{}}get streamId(){return this.#e}get name(){return this.#t}async open(e){if(this.#a)return;this.#a=!0,await this.#h({st:"open",name:this.#t,meta:{...this.#o,...e}})}async write(e){if(this.#n)throw Error("Stream already ended");if(!this.#a)await this.open();let t,s=!1;if(e instanceof ArrayBuffer)t=this.#d(new Uint8Array(e)),s=!0;else if(e instanceof Uint8Array)t=this.#d(e),s=!0;else if(typeof e==="string"){let r=this.#l(e,this.#i);for(let i of r)await this.#h({st:"data",seq:this.#r++,d:i,b64:!1});return}else t=JSON.stringify(e);if(s){let r=this.#l(t,this.#i);for(let i of r)await this.#h({st:"data",seq:this.#r++,d:i,b64:!0})}else await this.#h({st:"data",seq:this.#r++,d:t,b64:!1})}async end(e){if(this.#n)return;this.#n=!0,await this.#h({st:"end",seq:this.#r,meta:e})}async abort(e){if(this.#n)return;this.#n=!0,await this.#h({st:"error",reason:e??"Stream aborted"})}async#h(e){let t={[y]:E,t:"stream",sid:this.#e,...e};await this.#s(t)}#l(e,t){let s=[];for(let r=0;r<e.length;r+=t)s.push(e.slice(r,r+t));return s}#d(e){let t="";for(let s=0;s<e.length;s++)t+=String.fromCharCode(e[s]);return btoa(t)}}class V{#e;#t;#s;#i=[];#r=null;#n=!1;#a=null;constructor(e,t,s={}){this.#e=e,this.#t=t,this.#s=s}get streamId(){return this.#e}get name(){return this.#t}get meta(){return this.#s}get ended(){return this.#n}push(e){if(this.#n)return;let t=e.d;if(e.b64)t=this.#o(t);if(this.#i.push(t),this.#r){let s=this.#r;this.#r=null,s()}}end(e){if(this.#n=!0,e)this.#s={...this.#s,...e};if(this.#r){let t=this.#r;this.#r=null,t()}}error(e){if(this.#n=!0,this.#a=Error(e),this.#r){let t=this.#r;this.#r=null,t()}}async*[Symbol.asyncIterator](){while(!0){while(this.#i.length>0)yield this.#i.shift();if(this.#n){if(this.#a)throw this.#a;return}await new Promise((e)=>{this.#r=e})}}async collect(){let e=[],t=!1;for await(let s of this)if(e.push(s),s instanceof Uint8Array)t=!0;if(t){let s=e.reduce((n,o)=>n+o.length,0),r=new Uint8Array(s),i=0;for(let n of e)r.set(n,i),i+=n.length;return r}else return e.join("")}#o(e){let t=atob(e),s=new Uint8Array(t.length);for(let r=0;r<t.length;r++)s[r]=t.charCodeAt(r);return s}}class le{#e=new Map;#t=new Map;#s;constructor(e){this.#s=e}createStream(e,t,s={}){return new $(async(r)=>{await this.#s(t,r)},e,s)}onStream(e,t){return this.#t.set(e,t),()=>this.#t.delete(e)}handleMessage(e,t){if(e.t!=="stream")return;let s=e.sid;switch(e.st){case"open":this.#i(s,e,t);break;case"data":this.#r(s,e);break;case"end":this.#n(s,e);break;case"error":this.#a(s,e);break}}#i(e,t,s){let r=this.#t.get(t.name);if(!r){console.warn(`[CrossBus] No handler for stream: ${t.name}`);return}let i=new V(e,t.name,t.meta);this.#e.set(e,i),r(i).catch((n)=>{console.error("[CrossBus] Stream handler error:",n)})}#r(e,t){let s=this.#e.get(e);if(!s)return;s.push(t)}#n(e,t){let s=this.#e.get(e);if(!s)return;s.end(t.meta),this.#e.delete(e)}#a(e,t){let s=this.#e.get(e);if(!s)return;s.error(t.reason),this.#e.delete(e)}get activeStreamCount(){return this.#e.size}}class ue extends M{#e;#t;#s=new Map;#i;#r;#n=null;#a=null;#o=!1;#h="online";#l={};constructor(e,t){super();if(!t.peerId)throw Error("peerId is required");if(this.#e=t.peerId,this.#t=e,this.#i=t.heartbeatInterval??15000,this.#r=t.timeout??45000,t.autoStart!==!1)this.start()}get peerId(){return this.#e}get status(){return this.#h}get onlineCount(){let e=0;for(let t of this.#s.values())if(t.status!=="offline")e++;return e}start(){if(this.#n)return;this.#u("join"),this.#n=setInterval(()=>{this.#u("heartbeat")},this.#i),this.#a=setInterval(()=>{this.#g()},this.#i)}stop(){if(this.#n)clearInterval(this.#n),this.#n=null;if(this.#a)clearInterval(this.#a),this.#a=null;this.#u("leave")}setStatus(e,t){if(this.#h=e,t)this.#l={...this.#l,...t};this.#u("update")}setMeta(e){this.#l={...this.#l,...e},this.#u("update")}getOnlinePeers(){let e=[];for(let[t,s]of this.#s)if(s.status!=="offline")e.push(t);return e}getAllPeers(){return Array.from(this.#s.values())}getPeer(e){return this.#s.get(e)}isOnline(e){let t=this.#s.get(e);return t?t.status!=="offline":!1}handleMessage(e,t){if(e.t!=="presence")return;if(t===this.#e)return;let{pt:s,status:r,meta:i}=e,n=Date.now();switch(s){case"join":this.#d(t,r,i,n),this.#u("heartbeat");break;case"leave":this.#f(t);break;case"heartbeat":case"update":this.#c(t,r,i,n);break}}#d(e,t,s,r){let i=!this.#s.has(e);if(this.#s.set(e,{peerId:e,status:t??"online",lastSeen:r,meta:s??{}}),i)this.emitSync("join",{peerId:e,meta:s})}#f(e){let t=this.#s.get(e);if(!t)return;t.status="offline",this.#s.delete(e),this.emitSync("leave",{peerId:e})}#c(e,t,s,r){let i=this.#s.get(e),n=!i||i.status==="offline";if(!i)i={peerId:e,status:t??"online",lastSeen:r,meta:s??{}},this.#s.set(e,i);else{if(i.lastSeen=r,t)i.status=t;if(s)i.meta={...i.meta,...s}}if(n&&i.status!=="offline")this.emitSync("join",{peerId:e,meta:i.meta});else this.emitSync("update",{peerId:e,peer:i})}#g(){let e=Date.now()-this.#r;for(let[t,s]of this.#s)if(s.lastSeen<e&&s.status!=="offline")s.status="offline",this.#s.delete(t),this.emitSync("leave",{peerId:t})}async#u(e){if(this.#o)return;let t={[y]:E,t:"presence",pt:e,peerId:this.#e,status:this.#h,meta:this.#l,ts:Date.now()};try{await this.#t(t)}catch(s){console.error("[CrossBus] Failed to send presence:",s)}}destroy(){if(this.#o)return;this.#o=!0,this.stop(),this.#s.clear()}get isDestroyed(){return this.#o}}var _={contentType:"application/json",serialize:(e)=>JSON.stringify(e),deserialize:(e)=>JSON.parse(e)},W=new Map;W.set(_.contentType,_);function C(e){return W.get(e)||_}class ce{#e=null;#t;#s;#i;#r;#n;#a=null;#o=null;#h=!1;static isSupported(){return typeof globalThis.postMessage==="function"||typeof Window<"u"}constructor(e,t={}){if(!this.#f(e))throw TypeError("Target must support postMessage");if(this.#e=e,this.#t=t.targetOrigin??"*",this.#s=new Set(t.allowedOrigins??[]),this.#i=t.autoTransfer??!1,this.#n=t.contentType??"application/json",this.#r=C(this.#n),(typeof process<"u"?process.env?.NODE_ENV!=="production":typeof window<"u"&&window.location?.hostname==="localhost")&&this.#t==="*")console.warn(`[CrossBus Security] ⚠️ targetOrigin: "*" broadcasts to ANY window.
11
+ `+`This is INSECURE in production. Use specific origin:
12
+ targetOrigin: "https://iframe-domain.com"
13
+ Suppress this warning with NODE_ENV=production`);this.#o=this.#l.bind(this),this.#u().addEventListener("message",this.#o)}send(e,t){if(this.#h)throw c.from(a.DESTROYED,{context:"PostMessageTransport.send"});if(this.#g())throw c.from(a.PEER_DISCONNECTED,{reason:"Target window is closed"});let s={[y]:E,...e},r=s;if(this.#n!=="application/json")r=this.#r.serialize(s);let i=t;if(this.#i&&!t){if(i=D(e),i.length===0)i=void 0}if(this.#c())this.#e.postMessage(r,i);else this.#e.postMessage(s,this.#t,i)}onMessage(e){if(typeof e!=="function")throw TypeError("Handler must be a function");this.#a=e}offMessage(){this.#a=null}destroy(){if(this.#h)return;if(this.#h=!0,this.#a=null,this.#o)this.#u().removeEventListener("message",this.#o),this.#o=null}get isDestroyed(){return this.#h}get targetOrigin(){return this.#t}#l(e){if(!this.#a)return;let t=e.data;if(!S(t))return;if(e.origin&&!this.#d(e.origin)){console.warn(`[CrossBus] Blocked message from unauthorized origin: ${e.origin}`);return}if(this.#e&&"postMessage"in this.#e&&!this.#c()){if(e.source!==this.#e)return}try{this.#a(t,{origin:e.origin??"worker",source:e.source??e.currentTarget})}catch(s){console.error("[CrossBus] Message handler error:",s)}}#d(e){if(this.#s.size===0)return e===globalThis.location?.origin;if(this.#s.has("*"))return!0;if(this.#s.has(e))return!0;for(let t of this.#s)if(t.includes("*")){if(new RegExp("^"+t.replace(/[.+?^${}()|[\]\\]/g,"\\$&").replace(/\\\*/g,"[a-zA-Z0-9.-]{0,253}")+"$").test(e))return!0}return!1}#f(e){if(!e)return!1;return typeof e.postMessage==="function"}#c(){if(typeof Worker<"u"&&this.#e instanceof Worker)return!0;if(typeof ServiceWorker<"u"&&this.#e instanceof ServiceWorker)return!0;if(typeof MessagePort<"u"&&this.#e instanceof MessagePort)return!0;return!1}#g(){if(this.#c())return!1;return this.#e.closed===!0}#u(){if(typeof DedicatedWorkerGlobalScope<"u"&&globalThis instanceof DedicatedWorkerGlobalScope)return globalThis;if(this.#c())return this.#e;if(typeof window<"u")return window;return globalThis}}class Z{#e;#t;#s;#i;#r=null;#n=!1;static isSupported(){return typeof BroadcastChannel<"u"}constructor(e={}){if(!Z.isSupported())throw c.from(a.UNSUPPORTED,{api:"BroadcastChannel"});this.#t=e.channelName??"crossbus:default",this.#e=new BroadcastChannel(this.#t),this.#i=e.contentType??"application/json",this.#s=C(this.#i),this.#e.onmessage=this.#a.bind(this),this.#e.onmessageerror=this.#o.bind(this)}send(e){if(this.#n)throw c.from(a.DESTROYED,{context:"BroadcastChannelTransport.send"});let t={[y]:E,...e},s=t;if(this.#i!=="application/json")s=this.#s.serialize(t);this.#e.postMessage(s)}onMessage(e){if(typeof e!=="function")throw TypeError("Handler must be a function");this.#r=e}offMessage(){this.#r=null}destroy(){if(this.#n)return;if(this.#n=!0,this.#r=null,this.#e)this.#e.close(),this.#e=null}get channelName(){return this.#t}get isDestroyed(){return this.#n}#a(e){if(!this.#r)return;let t=e.data;if(t instanceof ArrayBuffer||t instanceof Uint8Array)try{let s=new TextDecoder().decode(t instanceof ArrayBuffer?new Uint8Array(t):t);t=_.deserialize(s)}catch(s){console.warn("[CrossBus] Failed to deserialize binary message",s);return}if(!S(t))return;try{this.#r(t,{origin:"broadcast"})}catch(s){console.error("[CrossBus] BroadcastChannel handler error:",s)}}#o(e){console.error("[CrossBus] BroadcastChannel message error:",e)}}class H{#e;#t;#s;#i;#r;#n=null;#a=!1;#o;static isSupported(){return typeof MessageChannel<"u"}static fromPort(e,t={}){if(!(e instanceof MessagePort))throw TypeError("Port must be a MessagePort");let s=Object.create(H.prototype);return s.#e=e,s.#t=null,s.#s=t.autoTransfer??!1,s.#r=t.contentType??"application/json",s.#i=C(s.#r),s.#a=!1,s.#o=!1,s.#n=null,s.#e.onmessage=s.#h.bind(s),s.#e.onmessageerror=s.#l.bind(s),s}constructor(e={}){if(!H.isSupported())throw c.from(a.UNSUPPORTED,{api:"MessageChannel"});let t=new MessageChannel;this.#e=t.port1,this.#t=t.port2,this.#s=e.autoTransfer??!1,this.#r=e.contentType??"application/json",this.#i=C(this.#r),this.#o=!0,this.#e.onmessage=this.#h.bind(this),this.#e.onmessageerror=this.#l.bind(this)}get remotePort(){return this.#t}markRemoteTransferred(){this.#t=null}get isInitiator(){return this.#o}send(e,t){if(this.#a)throw c.from(a.DESTROYED,{context:"MessageChannelTransport.send"});let s={[y]:E,...e},r=s;if(this.#r!=="application/json")r=this.#i.serialize(s);let i=t;if(this.#s&&!t){if(i=D(e),i.length===0)i=void 0}this.#e.postMessage(r,i)}onMessage(e){if(typeof e!=="function")throw TypeError("Handler must be a function");this.#n=e}offMessage(){this.#n=null}destroy(){if(this.#a)return;if(this.#a=!0,this.#n=null,this.#e)this.#e.close(),this.#e=null;if(this.#t)this.#t.close(),this.#t=null}get isDestroyed(){return this.#a}#h(e){if(!this.#n)return;let t=e.data;if(!S(t))return;try{this.#n(t,{origin:"channel"})}catch(s){console.error("[CrossBus] MessageChannel handler error:",s)}}#l(e){console.error("[CrossBus] MessageChannel error:",e)}}class ee{#e=null;#t=null;#s;#i=null;#r=!1;static isSupported(){return typeof SharedWorker<"u"}constructor(e={}){if(!ee.isSupported())throw c.from(a.UNSUPPORTED,{api:"SharedWorker"});this.#s=e.workerUrl??"/crossbus-shared-worker.js",this.#e=new SharedWorker(this.#s,e.name),this.#t=this.#e.port,this.#t.onmessage=this.#n.bind(this),this.#t.onmessageerror=this.#a.bind(this),this.#e.onerror=this.#o.bind(this),this.#t.start()}send(e,t){if(this.#r)throw c.from(a.DESTROYED,{context:"SharedWorkerTransport.send"});let s={[y]:E,...e};if(!this.#t)return;if(t&&t.length>0)this.#t.postMessage(s,t);else this.#t.postMessage(s)}onMessage(e){if(typeof e!=="function")throw TypeError("Handler must be a function");this.#i=e}offMessage(){this.#i=null}destroy(){if(this.#r)return;if(this.#r=!0,this.#i=null,this.#t)this.#t.close(),this.#t=null;this.#e=null}get workerUrl(){return this.#s}get isDestroyed(){return this.#r}#n(e){if(!this.#i)return;if(!S(e.data))return;try{this.#i(e.data,{origin:"sharedworker"})}catch(t){console.error("[CrossBus] SharedWorker handler error:",t)}}#a(e){console.error("[CrossBus] SharedWorker message error:",e)}#o(e){console.error("[CrossBus] SharedWorker error:",e.message)}}class te{#e=null;#t=null;#s=!1;#i;#r=null;static isSupported(){return typeof navigator<"u"&&"serviceWorker"in navigator}constructor(e={}){if(!te.isSupported())throw c.from(a.UNSUPPORTED,{api:"ServiceWorker"});this.#i=this.#n()}get ready(){return this.#i}async#n(){let e=await navigator.serviceWorker.ready;this.#e=e.active||navigator.serviceWorker.controller,this.#r=this.#a.bind(this),navigator.serviceWorker.addEventListener("message",this.#r)}send(e,t){if(this.#s)throw c.from(a.DESTROYED,{context:"ServiceWorkerTransport.send"});if(!this.#e)throw c.from(a.NOT_CONNECTED,{context:"ServiceWorkerTransport.send",reason:"No active ServiceWorker"});let s={[y]:E,...e};if(t&&t.length>0)this.#e.postMessage(s,t);else this.#e.postMessage(s)}onMessage(e){if(typeof e!=="function")throw TypeError("Handler must be a function");this.#t=e}offMessage(){this.#t=null}destroy(){if(this.#s)return;if(this.#s=!0,this.#t=null,this.#r)navigator.serviceWorker.removeEventListener("message",this.#r),this.#r=null;this.#e=null}get isDestroyed(){return this.#s}#a(e){if(!this.#t)return;if(!S(e.data))return;try{this.#t(e.data,{origin:"serviceworker"})}catch(t){console.error("[CrossBus] ServiceWorker handler error:",t)}}}class L{#e="none";#t;#s;#i=null;#r=!1;#n=!1;#a=[];#o;#h=null;#l;#d;#f;static detectBridge(){if(globalThis.CrossBus&&typeof globalThis.CrossBus.postMessage==="function")return"android";if(globalThis.AndroidBridge&&typeof globalThis.AndroidBridge.postMessage==="function")return"android";if(globalThis.webkit?.messageHandlers?.crossbus)return"ios";return"none"}static isSupported(){return L.detectBridge()!=="none"}constructor(e={}){this.#t=e.androidInterface??"CrossBus",this.#s=e.iosHandler??"crossbus",this.#o=e.queueWhileInit??!0,this.#l=e.heartbeatInterval??30000,this.#d=new Promise((t)=>{this.#f=t}),this.#c(e.initTimeout??5000)}async#c(e){let t=Date.now(),s=()=>{if(this.#e=L.detectBridge(),this.#e!=="none"){this.#g();return}if(Date.now()-t<e)setTimeout(s,50);else console.warn("[CrossBus] No native bridge detected after timeout"),this.#n=!0,this.#f?.()};s(),this.#u()}#g(){if(this.#n=!0,this.#f?.(),this.#y(),this.#l>0)this.#p()}#u(){globalThis.__crossbus_receive__=(e)=>{if(this.#r||!this.#i)return;try{let t=typeof e==="string"?JSON.parse(e):e;if(!S(t))return;this.#i(t,{bridgeType:this.#e})}catch(t){console.error("[CrossBus] Failed to parse native message:",t)}}}send(e){if(this.#r)throw c.from(a.DESTROYED,{context:"NativeBridgeTransport.send"});let t={[y]:E,...e};if(!this.#n&&this.#o){this.#a.push(t);return}this.#m(t)}#m(e){let t=JSON.stringify(e);try{if(this.#e==="android"){let s=globalThis[this.#t]||globalThis.AndroidBridge;if(s?.postMessage)s.postMessage(t)}else if(this.#e==="ios"){let s=globalThis.webkit?.messageHandlers?.[this.#s];if(s?.postMessage)s.postMessage(e)}}catch(s){console.error("[CrossBus] Failed to send to native:",s)}}#y(){while(this.#a.length>0){let e=this.#a.shift();this.#m(e)}}#p(){this.#h=setInterval(()=>{if(this.#r)return;this.#m({[y]:E,t:"hb",ts:Date.now()})},this.#l)}onMessage(e){if(typeof e!=="function")throw TypeError("Handler must be a function");this.#i=e}offMessage(){this.#i=null}destroy(){if(this.#r)return;if(this.#r=!0,this.#i=null,this.#a=[],this.#h)clearInterval(this.#h),this.#h=null;delete globalThis.__crossbus_receive__}get isDestroyed(){return this.#r}get bridgeType(){return this.#e}get isReady(){return this.#n}get ready(){return this.#d}}class de{#e;#t;#s=null;#i;#r;#n;#a;#o;#h=null;#l=null;#d=null;#f=null;#c="disconnected";#g=[];#u=!1;constructor(e){this.#e=e.url,this.#t=e.peerId??b(),this.#i=e.autoReconnect??!0,this.#r=e.reconnectDelayMs??1000,this.#n=e.maxReconnectDelayMs??30000,this.#a=this.#r,this.#o=e.heartbeatIntervalMs??30000}get peerId(){return this.#t}get state(){return this.#c}get isConnected(){return this.#c==="connected"&&this.#s?.readyState===WebSocket.OPEN}async connect(){if(this.#s&&this.#s.readyState===WebSocket.OPEN)return;return this.#u=!1,this.#p("connecting"),new Promise((e,t)=>{try{this.#s=new WebSocket(this.#e),this.#s.onopen=()=>{this.#p("connected"),this.#a=this.#r,this.#y(),this.#w(),e()},this.#s.onmessage=(s)=>{this.#m(s)},this.#s.onclose=(s)=>{if(this.#b(),this.#p("disconnected"),!this.#u&&this.#i)this.#S()},this.#s.onerror=(s)=>{if(this.#p("error"),this.#c==="connecting")t(Error("WebSocket connection failed"))}}catch(s){this.#p("error"),t(s)}})}disconnect(){if(this.#u=!0,this.#b(),this.#l)clearTimeout(this.#l),this.#l=null;if(this.#s)this.#s.close(1000,"Client disconnect"),this.#s=null;this.#p("disconnected")}send(e){let t={_cb:E,_m:y,id:b(),from:this.#t,timestamp:Date.now(),...e};if(this.isConnected&&this.#s)return this.#s.send(JSON.stringify(t)),!0;else return this.#g.push(t),!1}onMessage(e){this.#d=e}onStateChange(e){this.#f=e}#m(e){try{let t=JSON.parse(e.data);if(t.type==="pong")return;if(this.#d)this.#d(t)}catch(t){console.error("[WebSocketTransport] Failed to parse message:",t)}}#y(){while(this.#g.length>0&&this.isConnected&&this.#s){let e=this.#g.shift();if(e)this.#s.send(JSON.stringify(e))}}#p(e){if(this.#c!==e){if(this.#c=e,this.#f)this.#f(e)}}#w(){if(this.#o<=0)return;this.#h=setInterval(()=>{if(this.isConnected&&this.#s)this.#s.send(JSON.stringify({type:"ping",from:this.#t}))},this.#o)}#b(){if(this.#h)clearInterval(this.#h),this.#h=null}#S(){if(this.#l)return;this.#l=setTimeout(async()=>{this.#l=null;try{await this.connect()}catch{if(this.#a=Math.min(this.#a*2,this.#n),this.#i&&!this.#u)this.#S()}},this.#a)}destroy(){this.disconnect(),this.#d=null,this.#f=null,this.#g=[]}}class I{#e;#t;constructor(e,t={}){if(this.#e=e,this.#t=new Map(Object.entries(t)),!this.#t.has(e))this.#t.set(e,0)}get ownId(){return this.#e}get(e){return this.#t.get(e)??0}tick(){let e=this.get(this.#e)+1;return this.#t.set(this.#e,e),e}update(e){for(let[t,s]of e.#t){let r=this.get(t);if(s>r)this.#t.set(t,s)}}happenedBefore(e){let t=!1,s=new Set([...this.#t.keys(),...e.#t.keys()]);for(let r of s){let i=this.get(r),n=e.get(r);if(i>n)return!1;if(i<n)t=!0}return t}isConcurrentWith(e){return!this.happenedBefore(e)&&!e.happenedBefore(this)&&!this.equals(e)}equals(e){let t=new Set([...this.#t.keys(),...e.#t.keys()]);for(let s of t)if(this.get(s)!==e.get(s))return!1;return!0}canDeliver(e,t){let s=e.get(t),r=this.get(t);if(s!==r+1)return!1;for(let[i,n]of e.#t){if(i===t)continue;if(n>this.get(i))return!1}return!0}clone(){let e=Object.fromEntries(this.#t);return new I(this.#e,e)}toJSON(){return{ownId:this.#e,counters:Object.fromEntries(this.#t)}}static fromJSON(e){return new I(e.ownId,e.counters)}toString(){let e=[...this.#t.entries()].map(([t,s])=>`${t}:${s}`).join(", ");return`VectorClock(${this.#e}){${e}}`}}class fe{#e;#t;#s;#i;#r;#n;constructor(e,t={}){this.#e=e,this.#t=new I(e),this.#s=[],this.#i=t.onDeliver||(()=>{}),this.#r=t.maxBufferSize??1000,this.#n=t.onBufferOverflow||null}get ownId(){return this.#e}get bufferSize(){return this.#s.length}receive(e,t){let s=I.fromJSON(t.clock);if(this.#t.canDeliver(s,e))this.#a(e,t,s),this.#h();else this.#o(e,t,s)}#a(e,t,s){this.#t.update(s),this.#i(t)}#o(e,t,s){if(this.#s.length>=this.#r){if(this.#n)this.#n({senderId:e,message:t,bufferSize:this.#s.length});return}this.#s.push({senderId:e,message:t,clock:s})}#h(){let e=!0;while(e){e=!1;for(let t=this.#s.length-1;t>=0;t--){let{senderId:s,message:r,clock:i}=this.#s[t];if(this.#t.canDeliver(i,s))this.#s.splice(t,1),this.#a(s,r,i),e=!0}}}tick(){return this.#t.tick(),this.#t.clone()}getVectorClock(){return this.#t.clone()}clear(){this.#s=[]}}var ge="0.1.0",A="__MICROUI_CROSSBUS__",w=typeof window<"u"?window:globalThis,pe=["ui:toast","ui:modal","ui:theme","ui:tabs","ui:dropdown","ui:form","ui:grid","ui:stack","ui:virtual-list"],me={type:"ui-framework",version:ge,description:"AI-Optimized UI Framework - Web Components Edition"};if(!w[A])w[A]=new B({peerId:"microui",isHub:!0,requestTimeout:5000,capabilities:pe,meta:me}),w[A].setMaxListeners(100);var p=w[A],x="__MICROUI_COMPONENT_REGISTRY__";if(!w[x])w[x]=new Map;var Ee=w[x],v={on(e,t){let s=p.on(e,(r)=>{t(r.data??r)});return()=>s.unsubscribe()},once(e,t){let s=this.on(e,(r)=>{s(),t(r)})},off(e,t){p.off(e,t)},emit(e,t){return p.emitSync(e,t)},async emitAsync(e,t){return p.emit(e,t)},signal(e,t){p.signal(e,t)},async request(e,t,s){return p.request(e,t,s)},async broadcastRequest(e,t){return p.broadcastRequest(e,t)},handle(e,t){return p.handle(e,t)},unhandle(e){p.unhandle(e)},destroy(){p.destroy()},setMaxListeners(e){p.setMaxListeners(e)},get peerId(){return p.peerId},get peers(){return p.peers},get peerCount(){return p.peerCount},hasListeners(e){return p.hasListeners(e)},get raw(){return p}},R={TOAST_SHOW:"ui:toast:show",TOAST_DISMISS:"ui:toast:dismiss",MODAL_OPEN:"ui:modal:open",MODAL_CLOSE:"ui:modal:close",THEME_CHANGE:"ui:theme:change",TAB_CHANGE:"ui:tab:change",DROPDOWN_SELECT:"ui:dropdown:select",FORM_SUBMIT:"ui:form:submit",FORM_VALIDATE:"ui:form:validate"},se=(e,t)=>{Ee.set(e,{...t,registeredAt:Date.now()})};class re extends X{static baseClass="mu-toast";static cssFile="snackbar";static observedAttributes=["severity","duration","position"];#e=null;#t=null;connectedCallback(){if(!this.#t&&!this.querySelector(".mu-toast__content"))this.#t=this.innerHTML;super.connectedCallback(),this.listen(this,"click",(t)=>{if(t.target.classList.contains("mu-toast__close"))this.dismiss()});let e=parseInt(this.attr("duration","3000"));if(e>0)this.#e=this.setTimeout(()=>this.dismiss(),e)}disconnectedCallback(){super.disconnectedCallback()}render(){if(this.querySelector(".mu-toast__content")){this.#s();return}let e=this.#t||"";this.innerHTML=`
14
+ <span class="mu-toast__content">${e}</span>
15
+ <button class="mu-toast__close" aria-label="Dismiss">✕</button>
16
+ `,this.#s()}update(e,t,s){this.#s()}#s(){let e=this.attr("severity","info"),t=this.attr("position","bottom-center");this.className=`mu-toast mu-toast--${e} mu-toast--${t}`}dismiss(){this.emit("mu-dismiss"),this.classList.add("is-exiting");let e=!1,t=()=>{if(!e)e=!0,this.remove()};this.addEventListener("animationend",t,{once:!0}),this.setTimeout(t,200)}}J("mu-toast",re);class ie extends X{static baseClass="mu-toast-container";connectedCallback(){super.connectedCallback(),this.setAttribute("role","status"),this.setAttribute("aria-live","polite")}}J("mu-toast-container",ie);var ye={show(e,t={}){let s=t.position||"bottom-center",r=document.querySelector(`mu-toast-container[position="${s}"]`);if(!r)r=document.createElement("mu-toast-container"),r.setAttribute("position",s),document.body.appendChild(r);let i=document.createElement("mu-toast");if(i.textContent=e,t.severity)i.setAttribute("severity",t.severity);if(t.duration)i.setAttribute("duration",t.duration.toString());return r.appendChild(i),i}};if(typeof window<"u"&&v&&!v.hasListeners(R.TOAST_SHOW))v.on(R.TOAST_SHOW,(e)=>{ye.show(e.message,e)});se("mu-toast",{signals:[R.TOAST_SHOW,R.TOAST_DISMISS],options:{severities:["info","success","warning","error"],positions:["top-left","top-center","top-right","bottom-left","bottom-center","bottom-right"],defaultDuration:3000},description:"MD3 Snackbar/Toast Notification component"});
17
+ export{v as d,R as e,se as f};
@@ -0,0 +1,9 @@
1
+ import{g as l}from"./chunk-fagt36h6.js";import{i as n}from"./chunk-sxddjs2d.js";import{j as a}from"./chunk-5qah04bh.js";class c extends a{static get observedAttributes(){return["has-drawer","has-bottom-nav"]}static baseClass="mu-layout";static cssFile="layout";constructor(){super()}connectedCallback(){if(!this._slotsCaptured)this._slots={header:this.querySelector('[slot="header"]'),drawer:this.querySelector('[slot="drawer"]'),footer:this.querySelector('[slot="footer"]'),bottom:this.querySelector('[slot="bottom"]'),default:Array.from(this.children).filter((e)=>!e.hasAttribute("slot"))},this._slotsCaptured=!0;super.connectedCallback(),this._setupScrollReset(),this._updateLayout()}disconnectedCallback(){super.disconnectedCallback()}_setupScrollReset(){this.listen(window,"hashchange",()=>{let e=this.querySelector(".mu-layout-main");if(e)e.scrollTop=0})}_updateLayout(){let e=this._slots.drawer!==null,t=this._slots.bottom!==null;this.toggleAttribute("has-drawer",e),this.toggleAttribute("has-bottom-nav",t)}render(){this.innerHTML="";let e=document.createElement("div");e.className="mu-layout-wrapper";let t=document.createElement("header");if(t.className="mu-layout-header",this._slots.header)t.appendChild(this._slots.header);e.appendChild(t);let i=document.createElement("div");i.className="mu-layout-body";let s=document.createElement("aside");if(s.className="mu-layout-drawer",this._slots.drawer)s.appendChild(this._slots.drawer);i.appendChild(s);let r=document.createElement("div");r.className="mu-layout-main";let o=document.createElement("main");if(o.className="mu-layout-content",this._slots.default)this._slots.default.forEach((b)=>o.appendChild(b));r.appendChild(o),i.appendChild(r),e.appendChild(i);let d=document.createElement("footer");if(d.className="mu-layout-footer",this._slots.footer)d.appendChild(this._slots.footer);e.appendChild(d),this.appendChild(e);let h=document.createElement("div");if(h.className="mu-layout-bottom",this._slots.bottom)h.appendChild(this._slots.bottom);this.appendChild(h)}}if(!customElements.get("mu-layout"))customElements.define("mu-layout",c);class m{#e=[];#t=!1;constructor(){this.#s()}#s(){if(this.#t||typeof window>"u")return;document.addEventListener("keydown",(e)=>{if(e.key==="Escape"&&this.#e.length>0)e.preventDefault(),e.stopPropagation(),this.#e[this.#e.length-1].callback()}),this.#t=!0}pushEscapeHandler(e,t){let i={element:e,callback:t};return this.#e.push(i),()=>{let s=this.#e.indexOf(i);if(s>-1)this.#e.splice(s,1)}}isTopmost(e){if(this.#e.length===0)return!1;return this.#e[this.#e.length-1].element===e}get stackDepth(){return this.#e.length}}var f=new m;class p extends a{static get observedAttributes(){return["mode","open","expand-on-hover","position"]}static baseClass="mu-drawer";static cssFile="drawer";constructor(){super();this._currentMode="expanded",this._isHovering=!1,this._unsubscribe=null}get mode(){return this.getAttribute("mode")||"auto"}set mode(e){this.setAttribute("mode",e)}get open(){return this.hasAttribute("open")}set open(e){this.toggleAttribute("open",Boolean(e))}get expandOnHover(){return this.hasAttribute("expand-on-hover")}set expandOnHover(e){this.toggleAttribute("expand-on-hover",Boolean(e))}get position(){return this.getAttribute("position")||"start"}set position(e){this.setAttribute("position",e)}connectedCallback(){if(!this._slotsCaptured)this._slots={header:this.querySelector('[slot="header"]'),footer:this.querySelector('[slot="footer"]'),default:Array.from(this.children).filter((e)=>!e.hasAttribute("slot"))},this._slotsCaptured=!0;super.connectedCallback(),this._setupBreakpointListener(),this._setupListeners(),this._forceUpdateMode()}_getInitialMode(){let e=this.mode,t=l.isCompact,i=l.isMedium;if(e==="permanent")return"expanded";else if(e==="temporary")return"hidden";else if(e==="rail")return t?"hidden":"rail";else if(t)return"hidden";else if(i)return"rail";else return"expanded"}_forceUpdateMode(){this._currentMode=this._getInitialMode(),this._applyMode()}disconnectedCallback(){if(super.disconnectedCallback(),this._unsubscribe)this._unsubscribe(),this._unsubscribe=null;this._unsubEsc?.(),this._unsubEsc=null}attributeChangedCallback(e,t,i){if(!this.isConnected)return;if(e==="open")this._updateOpenState();else if(e==="mode")this._updateMode()}_setupBreakpointListener(){this._unsubscribe=l.subscribe(()=>{this._updateMode()})}_updateMode(){let e=this.mode,t=l.isCompact,i=l.isMedium,s;if(e==="permanent")s="expanded";else if(e==="temporary")s="hidden";else if(e==="rail")s=t?"hidden":"rail";else if(t)s="hidden";else if(i)s="rail";else s="expanded";if(s!==this._currentMode)this._currentMode=s,this._applyMode()}_applyMode(){let e=this.querySelector(".mu-drawer-nav");if(!e)return;if(e.classList.remove("mu-drawer-mode-expanded","mu-drawer-mode-rail","mu-drawer-mode-hidden"),e.classList.add(`mu-drawer-mode-${this._currentMode}`),this.querySelectorAll("mu-drawer-item").forEach((t)=>{if(this._currentMode==="rail"&&!this._isHovering)t.setAttribute("hide-label","");else t.removeAttribute("hide-label")}),this._currentMode==="hidden"&&!this.open)this._hideScrim()}_setupListeners(){let e=this.querySelector(".mu-drawer-scrim");if(e)this.listen(e,"click",()=>{this.open=!1});let t=this.querySelector(".mu-drawer-nav");if(t&&this.expandOnHover)this.listen(t,"mouseenter",()=>{if(this._currentMode==="rail")this._isHovering=!0,t.classList.add("mu-drawer-expanded-hover"),this._applyMode()}),this.listen(t,"mouseleave",()=>{if(this._currentMode==="rail")this._isHovering=!1,t.classList.remove("mu-drawer-expanded-hover"),this._applyMode()});this.listen(this,"mu-nav-select",(i)=>{if(this._currentMode==="hidden"&&this.open)this.open=!1;this._updateActiveItem(i.detail.item)}),this._unsubEsc=null}_updateActiveItem(e){this.querySelectorAll("mu-drawer-item").forEach((t)=>{t.active=t===e})}_updateOpenState(){let e=this.querySelector(".mu-drawer-nav");if(this.open){if(e?.classList.add("mu-drawer-open"),this._currentMode==="hidden")this._showScrim(),this._unsubEsc=f.pushEscapeHandler(this,()=>{this.open=!1})}else e?.classList.remove("mu-drawer-open"),this._hideScrim(),this._unsubEsc?.(),this._unsubEsc=null}_showScrim(){let e=this.querySelector(".mu-drawer-scrim");if(e)e.classList.add("mu-drawer-scrim-visible")}_hideScrim(){let e=this.querySelector(".mu-drawer-scrim");if(e)e.classList.remove("mu-drawer-scrim-visible")}toggle(){this.open=!this.open}render(){this.innerHTML="";let e=document.createElement("div");e.className="mu-drawer-scrim",this.appendChild(e);let t=document.createElement("nav");t.className=`mu-drawer-nav mu-drawer-mode-${this._getInitialMode()}`,t.setAttribute("role","navigation");let i=document.createElement("div");if(i.className="mu-drawer-header",this._slots.header)i.appendChild(this._slots.header);t.appendChild(i);let s=document.createElement("div");if(s.className="mu-drawer-content",s.setAttribute("role","menu"),this._slots.default)this._slots.default.forEach((r)=>s.appendChild(r));if(t.appendChild(s),this._slots.footer)t.appendChild(this._slots.footer);this.appendChild(t)}}if(!customElements.get("mu-drawer"))customElements.define("mu-drawer",p);class u extends a{static get observedAttributes(){return["icon","href","active","badge","disabled","layout","label"]}static baseClass="mu-drawer-item";static cssFile="drawer-item";constructor(){super();this._capturedLabel="";let e=Array.from(this.childNodes).filter((t)=>t.nodeType===Node.TEXT_NODE).map((t)=>t.textContent.trim()).join("").trim();if(e)this._capturedLabel=e}get icon(){return this.getAttribute("icon")||""}set icon(e){this.setAttribute("icon",e)}get href(){return this.getAttribute("href")||""}set href(e){this.setAttribute("href",e)}get active(){return this.hasAttribute("active")}set active(e){this.toggleAttribute("active",Boolean(e))}get badge(){return this.getAttribute("badge")}set badge(e){e?this.setAttribute("badge",e):this.removeAttribute("badge")}get disabled(){return this.hasAttribute("disabled")}set disabled(e){this.toggleAttribute("disabled",Boolean(e))}get layout(){return this.getAttribute("layout")||"horizontal"}set layout(e){this.setAttribute("layout",e)}get label(){return this.getAttribute("label")||this._capturedLabel||""}set label(e){this.setAttribute("label",e)}connectedCallback(){if(!this._capturedLabel&&this.hasAttribute("label"))this._capturedLabel=this.getAttribute("label");if(!this._capturedLabel&&!this.hasAttribute("label")){if(this._capturedLabel=this.textContent.trim(),this._capturedLabel)this.setAttribute("label",this._capturedLabel)}super.connectedCallback(),this._setupListeners(),this.setAttribute("tabindex","0"),this.setAttribute("role","menuitem"),this.setupActivation(()=>this._handleClick(new MouseEvent("click")))}attributeChangedCallback(e,t,i){if(t!==i&&this.isConnected)this.render()}_setupListeners(){this.listen(this,"click",this._handleClick.bind(this))}_handleClick(e){if(this.disabled){e.preventDefault();return}if(this.href){if(this.href.startsWith("#"))e.preventDefault(),window.location.hash=this.href}this.emit("mu-nav-select",{href:this.href,item:this},{bubbles:!0,composed:!0})}render(){let e=n(this.label),t=e.length>0,i=this.badge?`<span class="mu-drawer-item-badge">${n(this.badge)}</span>`:"",s=this.href?"a":"button",r=this.href?`href="${n(this.href)}"`:"",o=this.disabled?this.href?'aria-disabled="true"':"disabled":"",d=e?`aria-label="${e}"`:"";this.innerHTML=`
2
+ <${s} class="mu-drawer-item-link" ${r} ${o} ${d}>
3
+ <span class="mu-drawer-item-icon">
4
+ <mu-icon name="${n(this.icon)}" size="24"></mu-icon>
5
+ </span>
6
+ ${t?`<span class="mu-drawer-item-label" aria-hidden="true">${e}</span>`:""}
7
+ ${i}
8
+ </${s}>
9
+ `}}if(!customElements.get("mu-drawer-item"))customElements.define("mu-drawer-item",u);if(!customElements.get("mu-nav-item"))customElements.define("mu-nav-item",class extends u{connectedCallback(){if(!this.hasAttribute("layout"))this.setAttribute("layout","vertical");super.connectedCallback()}});
@@ -0,0 +1,38 @@
1
+ import{i as f}from"./chunk-sxddjs2d.js";import{j as m,k as d}from"./chunk-5qah04bh.js";class p extends m{static baseClass="mu-tabs";static cssFile="tabs";static observedAttributes=["active"];#e=[];#t=null;connectedCallback(){super.connectedCallback(),this.listen(this,"click",(s)=>{let e=s.target.closest("mu-tab");if(e){let t=this.querySelector(".mu-tabs__list"),a=(t?Array.from(t.querySelectorAll("mu-tab")):Array.from(this.querySelectorAll("mu-tab"))).indexOf(e);if(a!==-1)this.setAttribute("active",a.toString())}})}render(){if(this.querySelector(".mu-tabs__list")){this.#e=Array.from(this.querySelectorAll("mu-tab")),this.#t=this.querySelector(".mu-tabs__list"),this.#s();return}this.#t=document.createElement("div"),this.#t.className="mu-tabs__list",this.#t.setAttribute("role","tablist"),this.#e=Array.from(this.querySelectorAll("mu-tab")),this.#e.forEach((s)=>{s.setAttribute("role","tab"),this.#t.appendChild(s)}),this.appendChild(this.#t),this.#s()}update(s,e,t){if(s==="active")this.#s(),this.emit("mu-tab-change",{index:parseInt(e)||0})}#s(){let s=parseInt(this.attr("active","0")),e=this.#e.length;if(this.#e.forEach((t,a)=>{t.classList.toggle("is-active",a===s),t.setAttribute("aria-selected",a===s?"true":"false")}),this.#t&&e>0){let t=100/e;this.#t.style.setProperty("--indicator-width",`${t}%`),this.#t.style.setProperty("--indicator-left",`${s*t}%`)}}}class b extends m{static baseClass="mu-tabs__tab";connectedCallback(){super.connectedCallback(),this.setAttribute("tabindex","0")}render(){}}d("mu-tabs",p);d("mu-tab",b);class x extends m{static baseClass="mu-example";static observedAttributes=["title"];#e=!1;render(){let s=this.attr("title","Example"),e=this.querySelector('[slot="demo"]'),t=this.querySelector('[slot="code"]'),a=e?e.innerHTML:"",r=t?t.textContent:e?e.innerHTML:"";if(e)e.remove();if(t)t.remove();let n=this.#t(r),i=f(n);this.innerHTML=`
2
+ <div class="mu-example__card">
3
+ <div class="mu-example__header">
4
+ <span class="mu-example__title">${s}</span>
5
+ <div class="mu-example__actions">
6
+ <button class="mu-example__btn" data-action="link" title="Copy link">
7
+ <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
8
+ <path d="M10 13a5 5 0 007.54.54l3-3a5 5 0 00-7.07-7.07l-1.72 1.71"/>
9
+ <path d="M14 11a5 5 0 00-7.54-.54l-3 3a5 5 0 007.07 7.07l1.71-1.71"/>
10
+ </svg>
11
+ </button>
12
+ <button class="mu-example__btn" data-action="code" title="View source">
13
+ <svg width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">
14
+ <polyline points="16 18 22 12 16 6"/>
15
+ <polyline points="8 6 2 12 8 18"/>
16
+ </svg>
17
+ </button>
18
+ </div>
19
+ </div>
20
+ <div class="mu-example__demo">
21
+ ${a}
22
+ </div>
23
+ <div class="mu-example__code" style="display: none;">
24
+ <mu-code language="html">${i}</mu-code>
25
+ </div>
26
+ </div>
27
+ `,this.#s()}#t(s){let e=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),t=new Set(["a","abbr","b","bdo","br","cite","code","dfn","em","i","kbd","q","s","samp","small","span","strong","sub","sup","u","var"]),a="",r=0,n=" ",i=s.replace(/>\s+</g,"><").replace(/\s+/g," ").trim().split(/(<[^>]+>)/g).filter((o)=>o.trim());for(let o=0;o<i.length;o++){let l=i[o].trim();if(!l)continue;let c=l.startsWith("<"),u=l.startsWith("</"),v=l.endsWith("/>")||c&&e.has(l.match(/<\/?(\w+)/)?.[1]?.toLowerCase());if(u)r=Math.max(0,r-1);let y=c?l.match(/<\/?(\w+)/)?.[1]?.toLowerCase():null,h=y&&t.has(y);if(c)if(!h||u){if(a&&!a.endsWith(`
28
+ `))a+=`
29
+ `;a+=n.repeat(r)+l}else a+=l;else a+=l;if(c&&!u&&!v&&!h)r++}return a.trim()}#s(){this.style.display="block",this.style.marginBottom="24px";let s=this.querySelector(".mu-example__card");if(s)s.style.background="var(--md-sys-color-surface)",s.style.border="1px solid var(--md-sys-color-outline-variant)",s.style.borderRadius="var(--md-sys-shape-corner-large)";let e=this.querySelector(".mu-example__header");if(e)e.style.display="flex",e.style.justifyContent="space-between",e.style.alignItems="center",e.style.padding="12px 16px",e.style.borderBottom="1px solid var(--md-sys-color-outline-variant)",e.style.background="var(--md-sys-color-surface-container-low)",e.style.borderRadius="var(--md-sys-shape-corner-large) var(--md-sys-shape-corner-large) 0 0";let t=this.querySelector(".mu-example__title");if(t)t.style.fontWeight="500",t.style.fontSize="var(--md-sys-typescale-title-small-size)",t.style.color="var(--md-sys-color-on-surface)",t.style.minWidth="0",t.style.overflow="hidden",t.style.textOverflow="ellipsis",t.style.whiteSpace="nowrap";let a=this.querySelector(".mu-example__actions");if(a)a.style.display="flex",a.style.gap="4px";this.querySelectorAll(".mu-example__btn").forEach((l)=>{l.style.background="transparent",l.style.border="none",l.style.cursor="pointer",l.style.padding="8px",l.style.borderRadius="50%",l.style.color="var(--md-sys-color-on-surface-variant)",l.style.display="flex",l.style.alignItems="center",l.style.justifyContent="center",l.style.transition="all 0.2s ease"});let r=this.querySelector(".mu-example__demo");if(r){r.style.boxSizing="border-box",r.style.width="100%",r.style.maxWidth="100%",r.style.padding="24px",r.style.display="flex",r.style.flexWrap="wrap",r.style.gap="16px",r.style.alignItems="center",r.style.justifyContent="flex-start";let l=new Set(["MU-STACK","MU-GRID","MU-LAYOUT"]);Array.from(r.children).forEach((c)=>{if(!l.has(c.tagName))c.style.flexShrink="0"})}let n=this.querySelector(".mu-example__code");if(n)n.style.borderTop="1px solid var(--md-sys-color-outline-variant)";let i=this.querySelector(".mu-example__code mu-code");if(i){i.style.borderTopLeftRadius="0",i.style.borderTopRightRadius="0",i.style.maxHeight="400px",i.style.overflow="auto";let l=i.querySelector(".mu-code__header");if(l)l.style.borderRadius="0"}let o=document.createElement("style");if(o.textContent=`
30
+ .mu-example__btn:hover {
31
+ background: var(--md-sys-color-surface-container-high) !important;
32
+ color: var(--md-sys-color-primary) !important;
33
+ }
34
+ .mu-example__btn.active {
35
+ background: var(--md-sys-color-primary-container) !important;
36
+ color: var(--md-sys-color-on-primary-container) !important;
37
+ }
38
+ `,!document.querySelector("#mu-example-styles"))o.id="mu-example-styles",document.head.appendChild(o)}handleAction(s,e,t){if(s==="code"){let a=this.querySelector(".mu-example__code");if(a){if(this.#e=!this.#e,a.style.display=this.#e?"block":"none",e.classList.toggle("active",this.#e),this.#e)requestAnimationFrame(()=>{requestAnimationFrame(()=>{let r=this.closest(".mu-layout-main")||document.querySelector(".mu-layout-main")||document.documentElement,n=a.getBoundingClientRect(),i=r.getBoundingClientRect?.()||{top:0,bottom:window.innerHeight};if(n.bottom>i.bottom){let o=n.bottom-i.bottom+20;r.scrollBy({top:o,behavior:"smooth"})}})})}}else if(s==="link")this.#l(e)}async#l(s){let e=window.location.href;try{await navigator.clipboard.writeText(e),s.style.color="var(--md-sys-color-primary)",this.setTimeout(()=>{s.style.color=""},2000)}catch(t){console.error("Copy failed:",t)}}}d("mu-example",x);
@@ -0,0 +1 @@
1
+ import"./chunk-1khyr3v1.js";import"./chunk-z960rexd.js";import"./chunk-sxddjs2d.js";import"./chunk-swyhghrm.js";import"./chunk-e86zbeta.js";import"./chunk-5qah04bh.js";