@tempots/beatui 0.94.0 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (279) hide show
  1. package/dist/ar-CuI1Jgt6.cjs +1 -0
  2. package/dist/{ar-8Cko5i-Z.js → ar-DaKbK_t8.js} +88 -11
  3. package/dist/auth/index.cjs.js +1 -1
  4. package/dist/auth/index.es.js +1 -1
  5. package/dist/{auth-divider-Rt0WDKAe.js → auth-divider-BQIhr3-R.js} +99 -98
  6. package/dist/auth-divider-DvnUModP.cjs +1 -0
  7. package/dist/beatui.css +1628 -541
  8. package/dist/beatui.tailwind.css +1629 -542
  9. package/dist/better-auth/index.cjs.js +1 -1
  10. package/dist/better-auth/index.es.js +9 -9
  11. package/dist/codehighlight/index.cjs.js +22 -0
  12. package/dist/codehighlight/index.es.js +76 -0
  13. package/dist/colors-B-p6IzX9.cjs +1 -0
  14. package/dist/{colors-BY0Ja_bf.js → colors-DwufPN8S.js} +18 -18
  15. package/dist/{de-Bt-d2iKj.js → de-3MTPDS1i.js} +83 -6
  16. package/dist/de-DthHehbh.cjs +1 -0
  17. package/dist/{deep-merge-CoLO4id0.js → deep-merge-BzIheQtH.js} +511 -517
  18. package/dist/deep-merge-EkjEgK0N.cjs +1 -0
  19. package/dist/{duration-input-47x7nbGh.cjs → duration-input-ClgYjeBa.cjs} +1 -1
  20. package/dist/{duration-input-DrVonjKK.js → duration-input-DGzmIImj.js} +5 -5
  21. package/dist/{editor-toolbar-group-CzdBZ1yr.js → editor-toolbar-group-Crlu1QJw.js} +3 -3
  22. package/dist/{editor-toolbar-group-DhKJdqER.cjs → editor-toolbar-group-mkL4QozO.cjs} +1 -1
  23. package/dist/es-B6GJLk9h.cjs +1 -0
  24. package/dist/{es-2llfNFX2.js → es-DwMUvBeU.js} +95 -18
  25. package/dist/{fa-CQVIBjKP.js → fa-0rvQiKrJ.js} +88 -11
  26. package/dist/fa-BwgP93iV.cjs +1 -0
  27. package/dist/{fr-CC3smTlW.js → fr-B4i6NzLl.js} +87 -10
  28. package/dist/fr-CQzk5zqY.cjs +1 -0
  29. package/dist/{he-CZilsN75.js → he-C71n-hsn.js} +88 -11
  30. package/dist/he-DcxxvRfs.cjs +1 -0
  31. package/dist/hi-D-KHVWg4.cjs +1 -0
  32. package/dist/{hi-CAZjwGv-.js → hi-xmrXpeVU.js} +88 -11
  33. package/dist/index-B5MAsOC-.cjs +1 -0
  34. package/dist/{index-B8cqD9ny.js → index-C3o9GSH6.js} +106 -105
  35. package/dist/index.cjs.js +4 -4
  36. package/dist/index.es.js +8055 -5285
  37. package/dist/input-container-BvEcp7FU.js +275 -0
  38. package/dist/input-container-Di1YvVB_.cjs +1 -0
  39. package/dist/{it-D6RXFIL6.js → it-CDZTtOBC.js} +84 -7
  40. package/dist/it-D344Dutu.cjs +1 -0
  41. package/dist/ja-BNgnDZ27.cjs +1 -0
  42. package/dist/{ja-D7zsz4Ij.js → ja-Zz1LzidW.js} +92 -15
  43. package/dist/json-schema/index.cjs.js +1 -1
  44. package/dist/json-schema/index.es.js +261 -257
  45. package/dist/json-schema-display/index.cjs.js +1 -1
  46. package/dist/json-schema-display/index.es.js +2 -2
  47. package/dist/json-structure/index.cjs.js +1 -1
  48. package/dist/json-structure/index.es.js +132 -133
  49. package/dist/{ko-taN2Npr4.js → ko-9laUsZDL.js} +91 -14
  50. package/dist/ko-D-WJ9NK7.cjs +1 -0
  51. package/dist/lexical/index.cjs.js +2 -39
  52. package/dist/lexical/index.es.js +2102 -20521
  53. package/dist/markdown/index.cjs.js +1 -1
  54. package/dist/markdown/index.es.js +41 -4
  55. package/dist/{menu-CV85y3Xf.js → menu-B8yoDMRS.js} +23 -23
  56. package/dist/menu-B92oSDct.cjs +1 -0
  57. package/dist/modal-BT0jjDqX.cjs +1 -0
  58. package/dist/{modal-ZitwUeXx.js → modal-DBguyX-b.js} +9 -9
  59. package/dist/monaco/index.cjs.js +2 -2
  60. package/dist/monaco/index.es.js +7 -7
  61. package/dist/nl-CrqUlFie.cjs +1 -0
  62. package/dist/{nl-CRC6r4Q4.js → nl-Dcll9fVA.js} +87 -10
  63. package/dist/{notice-E_p2hg1G.js → notice-E19wu9lA.js} +51 -51
  64. package/dist/notice-_9XhdrFw.cjs +1 -0
  65. package/dist/oneof-branch-detection-J_DYEEcD.js +1077 -0
  66. package/dist/oneof-branch-detection-ZUBZ6hqy.cjs +1 -0
  67. package/dist/pl-9UksIrvX.cjs +1 -0
  68. package/dist/{pl-C6qNs0Lq.js → pl-Dm9N9Gbr.js} +84 -7
  69. package/dist/prosemirror/index.cjs.js +3 -1
  70. package/dist/prosemirror/index.es.js +636 -4
  71. package/dist/{pt-CcWPLqBh.js → pt-CFi5cn0k.js} +89 -12
  72. package/dist/pt-_kfdzwqi.cjs +1 -0
  73. package/dist/{ru-Dt9-9m0E.js → ru-CEhZUw8R.js} +92 -15
  74. package/dist/ru-CW1WNNlr.cjs +1 -0
  75. package/dist/stack-BLMteGTn.js +15 -0
  76. package/dist/stack-dwLevGa2.cjs +1 -0
  77. package/dist/tailwind/preset.cjs.js +1 -1
  78. package/dist/tailwind/preset.es.js +2 -2
  79. package/dist/tailwind/vite-plugin.cjs.js +1 -1
  80. package/dist/tailwind/vite-plugin.es.js +1 -1
  81. package/dist/text-input-DfqXolVe.js +55 -0
  82. package/dist/text-input-X_q01NsY.cjs +1 -0
  83. package/dist/toolbar-DY0ax2Qd.js +130 -0
  84. package/dist/toolbar-DoKdYXIL.cjs +1 -0
  85. package/dist/tr-B6GIRegf.cjs +1 -0
  86. package/dist/{tr-CDTWeRY0.js → tr-ZmnVDhLP.js} +83 -6
  87. package/dist/{translations-NBY7SubC.js → translations-A4kR7CW8.js} +1 -1
  88. package/dist/{translations-CiBhB2FV.js → translations-B1_yyDUK.js} +185 -106
  89. package/dist/{translations-BdCtLBZt.cjs → translations-C81buKAw.cjs} +1 -1
  90. package/dist/translations-Dbx7L7Q1.cjs +1 -0
  91. package/dist/types/beatui-i18n/default.d.ts +72 -0
  92. package/dist/types/beatui-i18n/locales/en.d.ts +72 -0
  93. package/dist/types/beatui-i18n/translations.d.ts +72 -0
  94. package/dist/types/codehighlight/code-highlight.d.ts +21 -0
  95. package/dist/types/codehighlight/index.d.ts +14 -0
  96. package/dist/types/components/button/toggle-button.d.ts +4 -4
  97. package/dist/types/components/data/avatar.d.ts +3 -1
  98. package/dist/types/components/data/badge.d.ts +10 -18
  99. package/dist/types/components/data/column-filter-panel.d.ts +31 -0
  100. package/dist/types/components/data/column-filter.d.ts +110 -0
  101. package/dist/types/components/data/column-header-menu.d.ts +42 -0
  102. package/dist/types/components/data/data-source.d.ts +190 -0
  103. package/dist/types/components/data/data-table-body.d.ts +12 -0
  104. package/dist/types/components/data/data-table-column-toggle.d.ts +4 -0
  105. package/dist/types/components/data/data-table-context.d.ts +53 -0
  106. package/dist/types/components/data/data-table-header.d.ts +6 -0
  107. package/dist/types/components/data/data-table-resolve.d.ts +26 -0
  108. package/dist/types/components/data/data-table-types.d.ts +201 -0
  109. package/dist/types/components/data/data-table.d.ts +38 -0
  110. package/dist/types/components/data/data-toolbar.d.ts +44 -0
  111. package/dist/types/components/data/date-picker-shared.d.ts +55 -0
  112. package/dist/types/components/data/date-picker.d.ts +58 -0
  113. package/dist/types/components/data/date-range-picker.d.ts +56 -0
  114. package/dist/types/components/data/filter.d.ts +268 -0
  115. package/dist/types/components/data/index.d.ts +13 -4
  116. package/dist/types/components/data/indicator.d.ts +41 -0
  117. package/dist/types/components/data/progress-bar.d.ts +2 -2
  118. package/dist/types/components/data/selection-checkbox.d.ts +63 -0
  119. package/dist/types/components/data/skeleton.d.ts +1 -1
  120. package/dist/types/components/data/sortable-header.d.ts +55 -0
  121. package/dist/types/components/data/unstyled-drop-zone.d.ts +2 -2
  122. package/dist/types/components/form/control/control.d.ts +9 -9
  123. package/dist/types/components/form/input/advanced-slider.d.ts +6 -6
  124. package/dist/types/components/form/input/appearance-selector.d.ts +9 -2
  125. package/dist/types/components/form/input/checkbox-input.d.ts +6 -7
  126. package/dist/types/components/form/input/color-input.d.ts +1 -1
  127. package/dist/types/components/form/input/color-swatch-input.d.ts +3 -3
  128. package/dist/types/components/form/input/combobox-input.d.ts +5 -5
  129. package/dist/types/components/form/input/combobox-tags-input.d.ts +5 -5
  130. package/dist/types/components/form/input/create-nullable-string-input.d.ts +2 -2
  131. package/dist/types/components/form/input/date-input.d.ts +4 -4
  132. package/dist/types/components/form/input/dropdown-input.d.ts +5 -5
  133. package/dist/types/components/form/input/editable-text.d.ts +2 -2
  134. package/dist/types/components/form/input/email-input.d.ts +4 -4
  135. package/dist/types/components/form/input/index.d.ts +1 -0
  136. package/dist/types/components/form/input/input-container.d.ts +1 -1
  137. package/dist/types/components/form/input/input-options.d.ts +28 -1
  138. package/dist/types/components/form/input/mask-input.d.ts +8 -2
  139. package/dist/types/components/form/input/native-select.d.ts +3 -3
  140. package/dist/types/components/form/input/nullable-date-input.d.ts +2 -2
  141. package/dist/types/components/form/input/nullable-email-input.d.ts +3 -3
  142. package/dist/types/components/form/input/nullable-rating-input.d.ts +8 -8
  143. package/dist/types/components/form/input/nullable-uuid-input.d.ts +4 -4
  144. package/dist/types/components/form/input/number-input.d.ts +3 -3
  145. package/dist/types/components/form/input/otp-input.d.ts +12 -12
  146. package/dist/types/components/form/input/rating-input.d.ts +7 -8
  147. package/dist/types/components/form/input/select-tags-input.d.ts +5 -5
  148. package/dist/types/components/form/input/switch.d.ts +2 -2
  149. package/dist/types/components/form/input/tri-state-checkbox-input.d.ts +82 -0
  150. package/dist/types/components/form/input/uuid-input.d.ts +2 -2
  151. package/dist/types/components/json-structure/controls/uuid-control.d.ts +1 -1
  152. package/dist/types/components/layout/card.d.ts +66 -0
  153. package/dist/types/components/layout/collapse.d.ts +2 -2
  154. package/dist/types/components/layout/flex.d.ts +26 -0
  155. package/dist/types/components/layout/index.d.ts +1 -0
  156. package/dist/types/components/lexical/floating/slash-command-palette.d.ts +2 -2
  157. package/dist/types/components/lexical/toolbar/toolbar-registry.d.ts +2 -1
  158. package/dist/types/components/media/pdf-page-viewer.d.ts +8 -5
  159. package/dist/types/components/misc/index.d.ts +1 -0
  160. package/dist/types/components/misc/loading-overlay.d.ts +29 -0
  161. package/dist/types/components/misc/notice.d.ts +4 -4
  162. package/dist/types/components/misc/notification-provider.d.ts +9 -3
  163. package/dist/types/components/misc/notification.d.ts +9 -9
  164. package/dist/types/components/navigation/breadcrumbs.d.ts +1 -1
  165. package/dist/types/components/navigation/menu.d.ts +6 -6
  166. package/dist/types/components/navigation/pagination.d.ts +17 -4
  167. package/dist/types/components/navigation/sidebar/sidebar-link.d.ts +2 -2
  168. package/dist/types/components/navigation/tabs/tabs.d.ts +17 -8
  169. package/dist/types/components/navigation/toolbar/toolbar.d.ts +12 -6
  170. package/dist/types/components/overlay/announcement-bar.d.ts +12 -4
  171. package/dist/types/components/overlay/dialogs.d.ts +2 -2
  172. package/dist/types/components/overlay/modal.d.ts +9 -2
  173. package/dist/types/components/overlay/tooltip.d.ts +6 -6
  174. package/dist/types/components/theme/types.d.ts +15 -4
  175. package/dist/types/lexical/index.d.ts +2 -2
  176. package/dist/types/lexical/plugins/index.d.ts +1 -1
  177. package/dist/types/lexical/plugins/slash-commands.d.ts +1 -1
  178. package/dist/types/lexical/plugins/text.d.ts +5 -0
  179. package/dist/types/lexical/types.d.ts +126 -5
  180. package/dist/types/lexical-i18n/default.d.ts +1 -0
  181. package/dist/types/lexical-i18n/locales/ar.d.ts +1 -0
  182. package/dist/types/lexical-i18n/locales/de.d.ts +1 -0
  183. package/dist/types/lexical-i18n/locales/en.d.ts +1 -0
  184. package/dist/types/lexical-i18n/locales/es.d.ts +1 -0
  185. package/dist/types/lexical-i18n/locales/fa.d.ts +1 -0
  186. package/dist/types/lexical-i18n/locales/fr.d.ts +1 -0
  187. package/dist/types/lexical-i18n/locales/he.d.ts +1 -0
  188. package/dist/types/lexical-i18n/locales/hi.d.ts +1 -0
  189. package/dist/types/lexical-i18n/locales/it.d.ts +1 -0
  190. package/dist/types/lexical-i18n/locales/ja.d.ts +1 -0
  191. package/dist/types/lexical-i18n/locales/ko.d.ts +1 -0
  192. package/dist/types/lexical-i18n/locales/nl.d.ts +1 -0
  193. package/dist/types/lexical-i18n/locales/pl.d.ts +1 -0
  194. package/dist/types/lexical-i18n/locales/pt.d.ts +1 -0
  195. package/dist/types/lexical-i18n/locales/ru.d.ts +1 -0
  196. package/dist/types/lexical-i18n/locales/tr.d.ts +1 -0
  197. package/dist/types/lexical-i18n/locales/ur.d.ts +1 -0
  198. package/dist/types/lexical-i18n/locales/vi.d.ts +1 -0
  199. package/dist/types/lexical-i18n/locales/zh.d.ts +1 -0
  200. package/dist/types/tokens/z-index.d.ts +18 -18
  201. package/dist/types/utils/use-animated-toggle.d.ts +12 -4
  202. package/dist/ur-CtFl_tz6.cjs +1 -0
  203. package/dist/{ur-CLrK5FPQ.js → ur-yYgj3NmT.js} +88 -11
  204. package/dist/use-animated-toggle-C3asw_Sg.js +207 -0
  205. package/dist/use-animated-toggle-cKcuItmz.cjs +1 -0
  206. package/dist/use-form-CaW192gw.cjs +2 -0
  207. package/dist/{use-form-BQRVnIp9.js → use-form-Dn6v2tEh.js} +153 -152
  208. package/dist/utils-DmEuG3Np.cjs +1 -0
  209. package/dist/utils-vUtP6iPG.js +165 -0
  210. package/dist/{vi-B1_QDUQJ.js → vi-D5u4CLQO.js} +89 -12
  211. package/dist/vi-DyCZSpsk.cjs +1 -0
  212. package/dist/widget-customization-DgW1SXN6.cjs +1 -0
  213. package/dist/{widget-customization-C-fSx3RB.js → widget-customization-Dkx7kNSe.js} +413 -398
  214. package/dist/{zh-rDtQ92Pp.js → zh-B0kwMMer.js} +91 -14
  215. package/dist/zh-C3ZxMQKb.cjs +1 -0
  216. package/package.json +209 -38
  217. package/dist/_commonjsHelpers-DKOUU3wS.cjs +0 -1
  218. package/dist/_commonjsHelpers-DaMA6jEr.js +0 -8
  219. package/dist/ar-D2DjoXta.cjs +0 -1
  220. package/dist/auth-divider-C3E16pml.cjs +0 -1
  221. package/dist/colors-BI0YhONJ.cjs +0 -1
  222. package/dist/de-Cdf3432J.cjs +0 -1
  223. package/dist/deep-merge-Blrucd-E.cjs +0 -1
  224. package/dist/es-6fFPkKHL.cjs +0 -1
  225. package/dist/fa-GXyNzAXz.cjs +0 -1
  226. package/dist/fr-C6EYTwSH.cjs +0 -1
  227. package/dist/he-CJUgxvi8.cjs +0 -1
  228. package/dist/hi-DqIR4VtX.cjs +0 -1
  229. package/dist/hls.light.min-C6xKDzRR.cjs +0 -27
  230. package/dist/hls.light.min-hEMf_E8u.js +0 -8311
  231. package/dist/index-1JaBwDB-.js +0 -921
  232. package/dist/index-B-cwxUsP.cjs +0 -1
  233. package/dist/index-BFzxpY7y.js +0 -68
  234. package/dist/index-BOC0cVoY.cjs +0 -36
  235. package/dist/index-CN10Cyqr.cjs +0 -1
  236. package/dist/index-CTcbhnPw.cjs +0 -4
  237. package/dist/index-DF7RFzD9.cjs +0 -1
  238. package/dist/index-DJ9YIJcG.js +0 -14308
  239. package/dist/index-DfPkCwdC.js +0 -2709
  240. package/dist/input-container-9r1F3KuX.js +0 -263
  241. package/dist/input-container-DiYEl_y8.cjs +0 -1
  242. package/dist/it-BvHsJ7fH.cjs +0 -1
  243. package/dist/ja-B2gP7OHY.cjs +0 -1
  244. package/dist/ko-BddhddIA.cjs +0 -1
  245. package/dist/menu-De_-sGeb.cjs +0 -1
  246. package/dist/modal-DUlqGUW7.cjs +0 -1
  247. package/dist/nl-COrtZUnH.cjs +0 -1
  248. package/dist/notice-DAVOTnfA.cjs +0 -1
  249. package/dist/oneof-branch-detection-D6Xa8qNR.cjs +0 -8
  250. package/dist/oneof-branch-detection-DCPwyutI.js +0 -6290
  251. package/dist/pl-BHI4zBgV.cjs +0 -1
  252. package/dist/pt-BGzC9MhU.cjs +0 -1
  253. package/dist/ru-CXeFbIPb.cjs +0 -1
  254. package/dist/stack-4VUGISn6.cjs +0 -1
  255. package/dist/stack-Bm-UZosx.js +0 -879
  256. package/dist/string-B9vVyfq3.cjs +0 -1
  257. package/dist/string-DYyMxBl-.js +0 -19
  258. package/dist/text-input-BgPx8BbG.js +0 -45
  259. package/dist/text-input-DUnhBUd6.cjs +0 -1
  260. package/dist/timer-BJHOsuS6.cjs +0 -1
  261. package/dist/timer-Rd2sKnvH.js +0 -65
  262. package/dist/toolbar-DKOh_gbA.js +0 -118
  263. package/dist/toolbar-Dkc2y1dI.cjs +0 -1
  264. package/dist/tr-CdOtQAtA.cjs +0 -1
  265. package/dist/translations-Cy9hoMGV.cjs +0 -1
  266. package/dist/types/components/data/calendar-shared.d.ts +0 -59
  267. package/dist/types/components/data/calendar.d.ts +0 -107
  268. package/dist/types/components/data/icon-badge.d.ts +0 -14
  269. package/dist/types/components/data/range-calendar.d.ts +0 -104
  270. package/dist/types/components/data/tag.d.ts +0 -51
  271. package/dist/ur-C7itXvnC.cjs +0 -1
  272. package/dist/use-animated-toggle-C7PTmnZi.js +0 -195
  273. package/dist/use-animated-toggle-DrqK7nUS.cjs +0 -1
  274. package/dist/use-form-DTyNw0kM.cjs +0 -2
  275. package/dist/utils-DEbsp9Q9.js +0 -129
  276. package/dist/utils-DIUEhA-Z.cjs +0 -1
  277. package/dist/vi-CQrUWB3y.cjs +0 -1
  278. package/dist/widget-customization-xEBfEPhQ.cjs +0 -1
  279. package/dist/zh-DWswYYTS.cjs +0 -1
@@ -0,0 +1,1077 @@
1
+ import { Validation as z, upperCaseFirst as B, humanize as W } from "@tempots/std";
2
+ import { attr as c, prop as _, html as h, computedOf as g, aria as F, on as w } from "@tempots/dom";
3
+ import { g as H, C as J } from "./utils-vUtP6iPG.js";
4
+ import { S as y, L as K } from "./stack-BLMteGTn.js";
5
+ import { d as V, I as x } from "./translations-B1_yyDUK.js";
6
+ import U from "ajv";
7
+ import G from "ajv/dist/2019";
8
+ import X from "ajv/dist/2020";
9
+ import Q from "ajv-formats";
10
+ function M(t) {
11
+ return t.split("/").slice(1).map((e) => e.replace(/~1/g, "/").replace(/~0/g, "~"));
12
+ }
13
+ function Y(t) {
14
+ const e = M(t.instancePath || "");
15
+ if (t.keyword === "required") {
16
+ const n = t.params.missingProperty;
17
+ if (n != null) return [...e, n];
18
+ }
19
+ if (t.keyword === "additionalProperties") {
20
+ const n = t.params.additionalProperty;
21
+ if (n != null) return [...e, n];
22
+ }
23
+ if (t.keyword === "unevaluatedProperties") {
24
+ const n = t.params.unevaluatedProperty;
25
+ if (n != null) return [...e, n];
26
+ }
27
+ return e.length > 0 ? e : void 0;
28
+ }
29
+ function Z(t) {
30
+ return t.message ?? `${t.keyword} validation failed`;
31
+ }
32
+ function N(t) {
33
+ return t.reduce((e, n) => {
34
+ const r = Y(n);
35
+ if (r == null) return e;
36
+ let i = e;
37
+ for (const o of r) {
38
+ const s = o;
39
+ i.dependencies == null && (i.dependencies = {}), i.dependencies[s] == null && (i.dependencies[s] = {}), i = i.dependencies[s];
40
+ }
41
+ return i.message = Z(n), e;
42
+ }, {});
43
+ }
44
+ function Ve(t) {
45
+ const e = N(t);
46
+ return z.invalid(e);
47
+ }
48
+ function ee(t) {
49
+ const e = {
50
+ keyword: "x:ui",
51
+ // Accept both string and object shapes for future-proofing
52
+ schemaType: ["string", "object"],
53
+ errors: !1,
54
+ // No-op validation – vendor annotation only
55
+ validate: () => !0
56
+ };
57
+ t.addKeyword(e);
58
+ }
59
+ let A = /* @__PURE__ */ new WeakMap();
60
+ function xe() {
61
+ A = /* @__PURE__ */ new WeakMap();
62
+ }
63
+ function Me(t) {
64
+ A.delete(t);
65
+ }
66
+ function Ee() {
67
+ return {
68
+ ajvInstances: 0
69
+ // WeakMap doesn't expose size for privacy/security
70
+ };
71
+ }
72
+ function te(t, e) {
73
+ let n = A.get(t);
74
+ n == null && (n = /* @__PURE__ */ new WeakMap(), A.set(t, n));
75
+ const r = n.get(e);
76
+ if (r) return r;
77
+ const i = t.compile(e);
78
+ return n.set(e, i), i;
79
+ }
80
+ async function k(t, e, n) {
81
+ const i = {
82
+ "2020-12": X,
83
+ "2019-09": G,
84
+ "draft-07": U
85
+ }[t], o = new i({
86
+ meta: n,
87
+ strictSchema: !1,
88
+ // Allow more flexible schema validation for tuple arrays
89
+ allErrors: !0,
90
+ removeAdditional: e
91
+ });
92
+ switch (t) {
93
+ case "2020-12":
94
+ o.opts.defaultMeta = "https://json-schema.org/draft/2020-12/schema";
95
+ break;
96
+ case "2019-09":
97
+ o.opts.defaultMeta = "https://json-schema.org/draft/2019-09/schema";
98
+ break;
99
+ case "draft-07":
100
+ o.opts.defaultMeta = "http://json-schema.org/draft-07/schema#";
101
+ break;
102
+ }
103
+ return Q(o), ee(o), o;
104
+ }
105
+ function ne(t) {
106
+ return t == null || t.includes("draft/2020-12") ? "2020-12" : t.includes("draft/2019-09") ? "2019-09" : "draft-07";
107
+ }
108
+ function re(t) {
109
+ const e = t.indexOf("#");
110
+ return e >= 0 ? t.slice(0, e) : t;
111
+ }
112
+ function $(t, e = !0) {
113
+ if (Array.isArray(t))
114
+ return t.map((n) => $(n, !1));
115
+ if (t != null && typeof t == "object") {
116
+ const n = t, r = {};
117
+ for (const [i, o] of Object.entries(n))
118
+ !e && (i === "$id" || i === "$schema" || i === "$dynamicAnchor") || (r[i] = $(o, !1));
119
+ return r;
120
+ }
121
+ return t;
122
+ }
123
+ function R(t) {
124
+ const e = /* @__PURE__ */ new Set(), n = (r) => {
125
+ if (r != null) {
126
+ if (Array.isArray(r)) {
127
+ for (const i of r) n(i);
128
+ return;
129
+ }
130
+ if (typeof r == "object") {
131
+ const i = r, o = i.$ref;
132
+ typeof o == "string" && o.length > 0 && o[0] !== "#" && e.add(re(o));
133
+ for (const s of Object.values(i)) n(s);
134
+ }
135
+ }
136
+ };
137
+ return n(t), [...e];
138
+ }
139
+ function E(t, e) {
140
+ for (const n of e) {
141
+ const r = n.$id;
142
+ if (typeof r == "string" && r.length > 0 && !t.getSchema(r))
143
+ try {
144
+ t.addSchema(n);
145
+ } catch {
146
+ }
147
+ }
148
+ }
149
+ async function ie(t, e, n, r) {
150
+ if (n == null) return null;
151
+ const i = /* @__PURE__ */ new Set();
152
+ if (r && r.length > 0)
153
+ for (const a of r) {
154
+ const l = a.$id;
155
+ typeof l == "string" && l.length > 0 && i.add(l);
156
+ }
157
+ const o = [], s = 5;
158
+ for (let a = 0; a < s; a++) {
159
+ const l = R(e), u = o.flatMap(
160
+ (p) => R(p)
161
+ ), f = /* @__PURE__ */ new Set([...l, ...u]), d = [];
162
+ for (const p of f)
163
+ if (!i.has(p)) {
164
+ if (t.getSchema(p)) {
165
+ i.add(p);
166
+ continue;
167
+ }
168
+ d.push(p);
169
+ }
170
+ if (d.length === 0) return null;
171
+ try {
172
+ const p = await n(d);
173
+ if (!Array.isArray(p) || p.length === 0)
174
+ return null;
175
+ E(t, p);
176
+ for (const m of p) {
177
+ const b = m.$id;
178
+ typeof b == "string" && b.length > 0 && (i.add(b), o.push(m));
179
+ }
180
+ } catch (p) {
181
+ return `refResolver failed: ${p instanceof Error ? p.message : String(p)}`;
182
+ }
183
+ }
184
+ return "refResolver reached iteration limit while resolving external $refs";
185
+ }
186
+ async function Te(t, e) {
187
+ try {
188
+ const n = ne(t.$schema), r = e?.sanitizeAdditional === !1 ? !1 : e?.sanitizeAdditional ?? !1, i = (f) => typeof f == "string" && f.endsWith("#") ? f.slice(0, -1) : f ?? "", o = t.$id, s = i(o);
189
+ if (s !== "" && (/* @__PURE__ */ new Set([
190
+ "https://json-schema.org/draft/2020-12/schema",
191
+ "https://json-schema.org/draft/2019-09/schema",
192
+ "http://json-schema.org/draft-07/schema"
193
+ ])).has(s)) {
194
+ const f = await k(n, r, !1), d = $(
195
+ t
196
+ );
197
+ try {
198
+ f.addMetaSchema(d);
199
+ } catch {
200
+ }
201
+ const p = f.getSchema(o ?? s) ?? f.compile(d);
202
+ return { ok: !0, value: { ajv: f, validate: p } };
203
+ }
204
+ const l = await k(n, r, !0);
205
+ if (e?.externalSchemas && e.externalSchemas.length > 0 && E(l, e.externalSchemas), e?.refResolver) {
206
+ const f = await ie(
207
+ l,
208
+ t,
209
+ e.refResolver,
210
+ e.externalSchemas
211
+ );
212
+ if (f != null)
213
+ return { ok: !1, error: f };
214
+ }
215
+ const u = l.compile(t);
216
+ return { ok: !0, value: { ajv: l, validate: u } };
217
+ } catch (n) {
218
+ return { ok: !1, error: n instanceof Error ? n.message : String(n) };
219
+ }
220
+ }
221
+ function se(t, e) {
222
+ if (typeof t == "boolean" || typeof e == "boolean")
223
+ return e;
224
+ const n = { ...t };
225
+ for (const [r, i] of Object.entries(e))
226
+ r === "required" && Array.isArray(t.required) && Array.isArray(i) ? n.required = [.../* @__PURE__ */ new Set([...t.required, ...i])] : r === "properties" && t.properties && typeof i == "object" && i != null ? n.properties = { ...t.properties, ...i } : n[r] = i;
227
+ return n;
228
+ }
229
+ function oe(t, e) {
230
+ if (typeof t == "boolean" || typeof e == "boolean")
231
+ return t === e;
232
+ const n = t.type, r = e.type;
233
+ return !(n != null && r != null && n !== r || n === "string" && r === "string" && (t.minLength != null && e.maxLength != null && t.minLength > e.maxLength || t.maxLength != null && e.minLength != null && t.maxLength < e.minLength) || (n === "number" || n === "integer") && (r === "number" || r === "integer") && (t.minimum != null && e.maximum != null && t.minimum > e.maximum || t.maximum != null && e.minimum != null && t.maximum < e.minimum));
234
+ }
235
+ function ae(t, e, n, r) {
236
+ if (typeof e == "boolean" || typeof n == "boolean")
237
+ return {
238
+ path: r,
239
+ message: `Property "${t}" has conflicting boolean schema definitions in allOf branches`,
240
+ conflictingValues: [e, n]
241
+ };
242
+ const i = e.type, o = n.type;
243
+ if (i != null && o != null && i !== o) {
244
+ const s = Array.isArray(i) ? i : [i], a = Array.isArray(o) ? o : [o];
245
+ return {
246
+ path: r,
247
+ message: `Property "${t}" has conflicting types: ${s.join("|")} vs ${a.join("|")}`,
248
+ conflictingValues: [e, n]
249
+ };
250
+ }
251
+ if (i === o && i === "string") {
252
+ const s = [];
253
+ if (e.minLength != null && n.maxLength != null && e.minLength > n.maxLength && s.push(
254
+ `minLength ${e.minLength} > maxLength ${n.maxLength}`
255
+ ), e.maxLength != null && n.minLength != null && e.maxLength < n.minLength && s.push(
256
+ `maxLength ${e.maxLength} < minLength ${n.minLength}`
257
+ ), s.length > 0)
258
+ return {
259
+ path: r,
260
+ message: `Property "${t}" has conflicting string constraints: ${s.join(", ")}`,
261
+ conflictingValues: [e, n]
262
+ };
263
+ }
264
+ if (i === o && (i === "number" || i === "integer")) {
265
+ const s = [];
266
+ if (e.minimum != null && n.maximum != null && e.minimum > n.maximum && s.push(
267
+ `minimum ${e.minimum} > maximum ${n.maximum}`
268
+ ), e.maximum != null && n.minimum != null && e.maximum < n.minimum && s.push(
269
+ `maximum ${e.maximum} < minimum ${n.minimum}`
270
+ ), s.length > 0)
271
+ return {
272
+ path: r,
273
+ message: `Property "${t}" has conflicting numeric constraints: ${s.join(", ")}`,
274
+ conflictingValues: [e, n]
275
+ };
276
+ }
277
+ return oe(e, n) ? null : {
278
+ path: r,
279
+ message: `Property "${t}" has conflicting definitions in allOf branches`,
280
+ conflictingValues: [e, n]
281
+ };
282
+ }
283
+ function le(t) {
284
+ const e = Array.isArray(t) ? t : [t], n = new Set(
285
+ e.map((r) => r)
286
+ );
287
+ return n.has("number") && n.add("integer"), n;
288
+ }
289
+ function ce(t, e, n, r) {
290
+ for (const [i, o] of Object.entries(e)) {
291
+ if (t[i] != null && t[i] !== o) {
292
+ const s = t[i], a = ae(i, s, o, [
293
+ ...n,
294
+ "properties",
295
+ i
296
+ ]);
297
+ a != null && r.push(a);
298
+ }
299
+ t[i] != null ? t[i] = se(t[i], o) : t[i] = o;
300
+ }
301
+ }
302
+ function fe(t, e, n, r) {
303
+ e != null && t.additionalProperties != null && t.additionalProperties !== e && r.push({
304
+ path: [...n, "additionalProperties"],
305
+ message: `Conflicting additionalProperties values in allOf: ${t.additionalProperties} vs ${e}`,
306
+ conflictingValues: [t.additionalProperties, e]
307
+ });
308
+ }
309
+ function ue(t, e, n, r, i) {
310
+ e != null && t.maxProperties != null && e > t.maxProperties && i.push({
311
+ path: [...r, "minProperties"],
312
+ message: `minProperties ${e} conflicts with existing maxProperties ${t.maxProperties}`,
313
+ conflictingValues: [e, t.maxProperties]
314
+ }), n != null && t.minProperties != null && n < t.minProperties && i.push({
315
+ path: [...r, "maxProperties"],
316
+ message: `maxProperties ${n} conflicts with existing minProperties ${t.minProperties}`,
317
+ conflictingValues: [n, t.minProperties]
318
+ });
319
+ }
320
+ function de(t, e, n) {
321
+ if (t.length === 0)
322
+ return;
323
+ let r = null;
324
+ for (const o of t)
325
+ if (r == null)
326
+ r = new Set(o);
327
+ else {
328
+ const s = /* @__PURE__ */ new Set();
329
+ for (const a of r)
330
+ o.has(a) && s.add(a);
331
+ r = s;
332
+ }
333
+ const i = Array.from(r ?? []);
334
+ if (i.length === 0) {
335
+ const o = t.map((s) => Array.from(s));
336
+ n.push({
337
+ path: [...e, "type"],
338
+ message: "Incompatible types in allOf (no common types)",
339
+ conflictingValues: o
340
+ });
341
+ return;
342
+ } else return i.length === 1 ? i[0] : i;
343
+ }
344
+ function qe(t, e = []) {
345
+ const n = [], r = {}, i = [], o = [], s = {};
346
+ for (const l of t) {
347
+ l.type != null && i.push(le(l.type)), Array.isArray(l.required) && o.push(...l.required), l.properties != null && ce(
348
+ s,
349
+ l.properties,
350
+ e,
351
+ n
352
+ );
353
+ const {
354
+ type: u,
355
+ required: f,
356
+ properties: d,
357
+ allOf: p,
358
+ additionalProperties: m,
359
+ patternProperties: b,
360
+ minProperties: v,
361
+ maxProperties: j,
362
+ ...D
363
+ } = l;
364
+ fe(
365
+ r,
366
+ m,
367
+ e,
368
+ n
369
+ ), ue(
370
+ r,
371
+ v,
372
+ j,
373
+ e,
374
+ n
375
+ ), Object.assign(r, D), m != null && (r.additionalProperties = m), b != null && (r.patternProperties = b), v != null && (r.minProperties = v), j != null && (r.maxProperties = j);
376
+ }
377
+ const a = de(i, e, n);
378
+ return a != null && (r.type = a), o.length > 0 && (r.required = [...new Set(o)]), Object.keys(s).length > 0 && (r.properties = s), {
379
+ mergedSchema: r,
380
+ conflicts: n
381
+ };
382
+ }
383
+ class T {
384
+ schema;
385
+ definition;
386
+ horizontal;
387
+ path;
388
+ ajv;
389
+ isPropertyRequired;
390
+ suppressLabel;
391
+ schemaConflicts;
392
+ notViolations;
393
+ widgetRegistry;
394
+ /**
395
+ * Function to set the form's validation status.
396
+ * Available for custom widgets that need to perform their own validation.
397
+ */
398
+ setStatus;
399
+ /**
400
+ * Signal containing the entire form's current value.
401
+ * Useful for cross-field validation or conditional rendering.
402
+ */
403
+ formValue;
404
+ /**
405
+ * Current validation mode ('eager', 'onTouched', 'onSubmit').
406
+ * Custom widgets may want to behave differently based on this.
407
+ */
408
+ validationMode;
409
+ /**
410
+ * Signal indicating whether the form is currently submitting.
411
+ * Widgets should typically disable during submission.
412
+ */
413
+ submitting;
414
+ constructor(e) {
415
+ const {
416
+ schema: n,
417
+ definition: r,
418
+ horizontal: i,
419
+ path: o,
420
+ ajv: s,
421
+ isPropertyRequired: a,
422
+ suppressLabel: l,
423
+ schemaConflicts: u,
424
+ notViolations: f,
425
+ widgetRegistry: d,
426
+ setStatus: p,
427
+ formValue: m,
428
+ validationMode: b,
429
+ submitting: v
430
+ } = e;
431
+ this.schema = n, this.definition = r, this.horizontal = i, this.path = o, this.ajv = s, this.isPropertyRequired = a ?? !1, this.suppressLabel = l ?? !1, this.schemaConflicts = u ?? [], this.notViolations = f ?? [], this.widgetRegistry = d, this.setStatus = p, this.formValue = m, this.validationMode = b, this.submitting = v;
432
+ }
433
+ with = (e) => new T({
434
+ schema: e.schema ?? this.schema,
435
+ definition: e.definition ?? this.definition,
436
+ horizontal: e.horizontal ?? this.horizontal,
437
+ path: e.path ?? this.path,
438
+ ajv: e.ajv ?? this.ajv,
439
+ isPropertyRequired: e.isPropertyRequired ?? this.isPropertyRequired,
440
+ suppressLabel: e.suppressLabel ?? this.suppressLabel,
441
+ schemaConflicts: e.schemaConflicts ?? this.schemaConflicts,
442
+ notViolations: e.notViolations ?? this.notViolations,
443
+ widgetRegistry: e.widgetRegistry ?? this.widgetRegistry,
444
+ setStatus: e.setStatus ?? this.setStatus,
445
+ formValue: e.formValue ?? this.formValue,
446
+ validationMode: e.validationMode ?? this.validationMode,
447
+ submitting: e.submitting ?? this.submitting
448
+ });
449
+ append = (e) => this.with({ path: [...this.path, e] });
450
+ get isRoot() {
451
+ return this.path.length === 0;
452
+ }
453
+ get name() {
454
+ const e = this.path[this.path.length - 1];
455
+ if (typeof e == "string")
456
+ return e;
457
+ }
458
+ get widgetName() {
459
+ return this.path.map(String).join(".");
460
+ }
461
+ get widgetLabel() {
462
+ const e = this.name;
463
+ return (typeof this.definition == "object" && this.definition !== null ? this.definition.title : void 0) ?? (e != null ? B(W(e)) : void 0);
464
+ }
465
+ hasRequiredProperty = (e) => typeof this.definition == "boolean" ? !1 : this.definition.required != null && this.definition.required.includes(e);
466
+ get nullable() {
467
+ return this.definition.nullable ?? !1;
468
+ }
469
+ get isNullable() {
470
+ return this.nullable || this.hasType("null") || this.hasEnumValue(null) || this.hasConstValue(null) || (this.anyOf?.some((e) => e.isNullable) ?? !1) || (this.oneOf?.some((e) => e.isNullable) ?? !1);
471
+ }
472
+ /**
473
+ * Determines if this property is optional (can be absent from parent object).
474
+ * This is different from nullable - optional means the key can be missing,
475
+ * while nullable means the value can be explicitly null.
476
+ */
477
+ get isOptional() {
478
+ return !this.isPropertyRequired;
479
+ }
480
+ /**
481
+ * Determines if this property should show a presence toggle.
482
+ * Optional properties that are not at the root level should have presence toggles,
483
+ * but primitive values that allow null should use nullable controls instead.
484
+ */
485
+ get shouldShowPresenceToggle() {
486
+ return !(!this.isOptional || this.isRoot || (this.isNullable || this.isOptional) && this.isPrimitive);
487
+ }
488
+ /**
489
+ * Determines if this schema represents a primitive type (string, number, boolean, null).
490
+ */
491
+ get isPrimitive() {
492
+ if (typeof this.definition == "boolean")
493
+ return !1;
494
+ const e = this.definition;
495
+ if (e.const !== void 0 || e.enum !== void 0)
496
+ return !0;
497
+ if (e.type) {
498
+ const n = Array.isArray(e.type) ? e.type : [e.type], r = ["string", "number", "integer", "boolean"];
499
+ return n.every((i) => r.includes(i));
500
+ }
501
+ return !1;
502
+ }
503
+ /**
504
+ * Determines if this property is marked as readOnly.
505
+ */
506
+ get isReadOnly() {
507
+ return typeof this.definition == "boolean" ? !1 : !!this.definition.readOnly;
508
+ }
509
+ /**
510
+ * Determines if this property is marked as writeOnly.
511
+ */
512
+ get isWriteOnly() {
513
+ return typeof this.definition == "boolean" ? !1 : !!this.definition.writeOnly;
514
+ }
515
+ /**
516
+ * Determines if this property is marked as deprecated.
517
+ */
518
+ get isDeprecated() {
519
+ return typeof this.definition == "boolean" ? !1 : !!this.definition.deprecated;
520
+ }
521
+ /**
522
+ * Checks if readOnly should be ignored based on x:ui.ignoreReadOnly.
523
+ */
524
+ get shouldIgnoreReadOnly() {
525
+ if (typeof this.definition == "boolean") return !1;
526
+ const e = this.definition["x:ui"];
527
+ return e && typeof e == "object" ? !!e.ignoreReadOnly : !1;
528
+ }
529
+ /**
530
+ * Checks if writeOnly should be shown based on x:ui.showWriteOnly.
531
+ */
532
+ get shouldShowWriteOnly() {
533
+ if (typeof this.definition == "boolean") return !1;
534
+ const e = this.definition["x:ui"];
535
+ return e && typeof e == "object" ? !!e.showWriteOnly : !1;
536
+ }
537
+ get anyOf() {
538
+ if (typeof this.definition != "boolean")
539
+ return Array.isArray(this.definition.anyOf) ? this.definition.anyOf.map((e) => this.with({ definition: e })) : void 0;
540
+ }
541
+ get oneOf() {
542
+ if (typeof this.definition != "boolean")
543
+ return Array.isArray(this.definition.oneOf) ? this.definition.oneOf.map((e) => this.with({ definition: e })) : void 0;
544
+ }
545
+ get allOf() {
546
+ if (typeof this.definition != "boolean")
547
+ return Array.isArray(this.definition.allOf) ? this.definition.allOf.map((e) => this.with({ definition: e })) : void 0;
548
+ }
549
+ hasType = (e) => this.definition === !0 ? !0 : this.definition === !1 ? !1 : Array.isArray(this.definition.type) ? this.definition.type.includes(e) : this.definition.type === e;
550
+ hasEnumValue = (e) => typeof this.definition == "boolean" ? !1 : Array.isArray(this.definition.enum) ? this.definition.enum.includes(e) : !1;
551
+ hasConstValue = (e) => typeof this.definition == "boolean" ? !1 : this.definition.const === e;
552
+ get description() {
553
+ if (typeof this.definition != "boolean")
554
+ return this.definition.description;
555
+ }
556
+ get examples() {
557
+ if (typeof this.definition != "boolean")
558
+ return this.definition.examples;
559
+ }
560
+ get default() {
561
+ if (typeof this.definition != "boolean")
562
+ return this.definition.default;
563
+ }
564
+ }
565
+ let S = /* @__PURE__ */ new WeakMap(), P = /* @__PURE__ */ new WeakMap();
566
+ function he(t, e) {
567
+ const n = typeof e == "object" && e != null ? e : null;
568
+ if (n != null) {
569
+ const s = S.get(n)?.get(t);
570
+ if (s != null) return s;
571
+ }
572
+ let r = t;
573
+ const i = /* @__PURE__ */ new Set();
574
+ for (; q(r); ) {
575
+ const o = r.$ref;
576
+ if (!o.startsWith("#")) {
577
+ console.warn(`resolveRef: external $ref not supported here: ${o}`);
578
+ break;
579
+ }
580
+ if (i.has(o)) {
581
+ console.warn(
582
+ `resolveRef: cycle detected while resolving in-document $ref chain: ${[...i, o].join(" -> ")}`
583
+ );
584
+ break;
585
+ }
586
+ i.add(o);
587
+ const s = I(e, o);
588
+ if (!O(s)) {
589
+ console.warn(`resolveRef: could not resolve JSON Pointer ${o}`);
590
+ break;
591
+ }
592
+ const { $ref: a, ...l } = r;
593
+ r = { ...s, ...l };
594
+ }
595
+ if (n != null) {
596
+ let o = S.get(n);
597
+ o == null && (o = /* @__PURE__ */ new WeakMap(), S.set(n, o)), o.set(t, r);
598
+ }
599
+ return r;
600
+ }
601
+ function q(t) {
602
+ return O(t) && typeof t.$ref == "string";
603
+ }
604
+ function O(t) {
605
+ return typeof t == "object" && t != null && !Array.isArray(t);
606
+ }
607
+ function I(t, e) {
608
+ if (!e.startsWith("#")) return;
609
+ if (e === "#") return t;
610
+ if (typeof t != "object" || t == null) return;
611
+ const n = t;
612
+ let r = P.get(n);
613
+ r == null && (r = /* @__PURE__ */ new Map(), P.set(n, r));
614
+ const i = r.get(e);
615
+ if (i !== void 0) return i;
616
+ const o = M(e);
617
+ let s = t;
618
+ for (const a of o) {
619
+ if (!O(s) && !Array.isArray(s)) {
620
+ r.set(e, void 0);
621
+ return;
622
+ }
623
+ s = s[a];
624
+ }
625
+ return r.set(e, s), s;
626
+ }
627
+ function Ie(t, e, n) {
628
+ let r = t;
629
+ const i = /* @__PURE__ */ new Set(), o = (s, a) => {
630
+ const { $ref: l, ...u } = a;
631
+ return { ...s, ...u };
632
+ };
633
+ for (; q(r); ) {
634
+ const s = r.$ref;
635
+ if (i.has(s)) {
636
+ console.warn(
637
+ `resolveAnyRef: cycle detected while resolving $ref chain: ${[...i, s].join(" -> ")}`
638
+ );
639
+ break;
640
+ }
641
+ if (i.add(s), s.startsWith("#")) {
642
+ const d = I(e, s);
643
+ if (!O(d)) {
644
+ console.warn(`resolveAnyRef: could not resolve JSON Pointer ${s}`);
645
+ break;
646
+ }
647
+ r = o(d, r);
648
+ continue;
649
+ }
650
+ if (!n) {
651
+ console.warn(
652
+ `resolveAnyRef: external $ref without AJV not resolved: ${s}`
653
+ );
654
+ break;
655
+ }
656
+ const a = s.indexOf("#"), l = a >= 0 ? s.slice(0, a) : s;
657
+ let u = n.getSchema(s) || n.getSchema(l);
658
+ if (!u)
659
+ try {
660
+ u = n.compile({ $ref: s });
661
+ } catch {
662
+ }
663
+ const f = u?.schema;
664
+ if (!f || typeof f != "object") {
665
+ console.warn(`resolveAnyRef: AJV could not provide schema for ${s}`);
666
+ break;
667
+ }
668
+ r = o(f, r);
669
+ }
670
+ return r;
671
+ }
672
+ function De(t) {
673
+ if (typeof t.definition == "boolean") return;
674
+ const e = H(t.definition);
675
+ if (typeof e != "object") return;
676
+ const n = {};
677
+ return typeof e.format == "string" && ["fieldset", "tabs", "accordion", "group", "grid"].includes(e.format) && (n.format = e.format), Array.isArray(e.order) && (n.order = e.order.filter(
678
+ (r) => typeof r == "string"
679
+ )), e.groups && typeof e.groups == "object" && (n.groups = e.groups), (typeof e.cols == "number" || e.cols && typeof e.cols == "object") && (n.cols = e.cols), Object.keys(n).length > 0 ? n : void 0;
680
+ }
681
+ function pe({
682
+ title: t,
683
+ children: e
684
+ }) {
685
+ return h.fieldset(
686
+ c.class("bc-fieldset"),
687
+ t ? h.legend(c.class("bc-fieldset__legend"), t) : null,
688
+ h.div(
689
+ c.class("bc-fieldset__content"),
690
+ y(c.class("bc-stack--gap-1"), ...e)
691
+ )
692
+ );
693
+ }
694
+ function me({
695
+ title: t,
696
+ children: e
697
+ }) {
698
+ return J(
699
+ { variant: "outlined", size: "md" },
700
+ y(
701
+ c.class("bc-stack--gap-1"),
702
+ t ? K(t) : null,
703
+ ...e
704
+ )
705
+ );
706
+ }
707
+ function ye({
708
+ cols: t = 1,
709
+ children: e
710
+ }) {
711
+ const n = typeof t == "number" ? `bc-schema-grid bc-schema-grid--cols-${t}` : g(t)((r) => {
712
+ if (typeof r == "number")
713
+ return `bc-schema-grid bc-schema-grid--cols-${r}`;
714
+ if (r && typeof r == "object") {
715
+ const i = ["bc-schema-grid"];
716
+ return r.sm && i.push(`bc-schema-grid--cols-sm-${r.sm}`), r.md && i.push(`bc-schema-grid--cols-md-${r.md}`), r.lg && i.push(`bc-schema-grid--cols-lg-${r.lg}`), r.xl && i.push(`bc-schema-grid--cols-xl-${r.xl}`), r["2xl"] && i.push(`bc-schema-grid--cols-2xl-${r["2xl"]}`), i.join(" ");
717
+ }
718
+ return "bc-schema-grid bc-schema-grid--cols-1";
719
+ });
720
+ return h.div(
721
+ c.class(n),
722
+ c.class("bc-schema-grid--gap-4"),
723
+ ...e
724
+ );
725
+ }
726
+ function be({
727
+ groups: t,
728
+ children: e
729
+ }) {
730
+ if (!t || Object.keys(t).length === 0)
731
+ return ge({ title: V.properties, children: e });
732
+ const n = _(Object.keys(t)[0]), r = Object.entries(t);
733
+ return h.div(
734
+ c.class("bc-tabs"),
735
+ // Tab headers
736
+ h.div(
737
+ c.class("bc-tabs__header"),
738
+ c.role("tablist"),
739
+ ...r.map(
740
+ ([i], o) => h.button(
741
+ c.type("button"),
742
+ c.class("bc-tabs__tab"),
743
+ c.class(
744
+ g(n)(
745
+ (s) => s === i ? "bc-tabs__tab--active" : ""
746
+ )
747
+ ),
748
+ c.role("tab"),
749
+ c.tabindex(
750
+ n.map((s) => s === i ? 0 : -1)
751
+ ),
752
+ w.click(() => n.set(i)),
753
+ w.keydown((s) => {
754
+ switch (s.key) {
755
+ case "ArrowLeft":
756
+ s.preventDefault();
757
+ const a = o > 0 ? o - 1 : r.length - 1;
758
+ n.set(r[a][0]);
759
+ break;
760
+ case "ArrowRight":
761
+ s.preventDefault();
762
+ const l = o < r.length - 1 ? o + 1 : 0;
763
+ n.set(r[l][0]);
764
+ break;
765
+ case "Home":
766
+ s.preventDefault(), n.set(r[0][0]);
767
+ break;
768
+ case "End":
769
+ s.preventDefault(), n.set(r[r.length - 1][0]);
770
+ break;
771
+ }
772
+ }),
773
+ i
774
+ )
775
+ )
776
+ ),
777
+ // Tab content
778
+ h.div(
779
+ c.class("bc-tabs__content"),
780
+ ...r.map(
781
+ ([i, o]) => h.div(
782
+ c.class("bc-tabs__panel"),
783
+ c.class(
784
+ g(n)(
785
+ (s) => s === i ? "bc-tabs__panel--active" : "bc-tabs__panel--hidden"
786
+ )
787
+ ),
788
+ c.role("tabpanel"),
789
+ y(
790
+ c.class("bc-stack--gap-1"),
791
+ ...e.filter((s, a) => o.length === 0 || a < o.length)
792
+ )
793
+ )
794
+ )
795
+ )
796
+ );
797
+ }
798
+ function ge({
799
+ title: t,
800
+ children: e
801
+ }) {
802
+ return h.div(
803
+ c.class("bc-tabs"),
804
+ h.div(
805
+ c.class("bc-tabs__header"),
806
+ h.div(c.class("bc-tabs__tab bc-tabs__tab--active"), t)
807
+ ),
808
+ h.div(
809
+ c.class("bc-tabs__content"),
810
+ h.div(
811
+ c.class("bc-tabs__panel bc-tabs__panel--active"),
812
+ y(c.class("bc-stack--gap-1"), ...e)
813
+ )
814
+ )
815
+ );
816
+ }
817
+ function ve({
818
+ groups: t,
819
+ children: e
820
+ }) {
821
+ if (!t || Object.keys(t).length === 0)
822
+ return we({
823
+ title: V.properties,
824
+ children: e
825
+ });
826
+ const n = Object.entries(t), r = _(new Set([n[0]?.[0]].filter(Boolean)));
827
+ return h.div(
828
+ c.class("bc-accordion"),
829
+ ...n.map(([i, o]) => {
830
+ const s = g(r)(
831
+ (a) => a.has(i)
832
+ );
833
+ return h.div(
834
+ c.class("bc-accordion__item"),
835
+ h.button(
836
+ c.type("button"),
837
+ c.class("bc-accordion__header"),
838
+ F.expanded(s),
839
+ w.click(() => {
840
+ const a = r.value, l = new Set(a);
841
+ l.has(i) ? l.delete(i) : l.add(i), r.set(l);
842
+ }),
843
+ w.keydown((a) => {
844
+ if (a.key === "Enter" || a.key === " ") {
845
+ a.preventDefault();
846
+ const l = r.value, u = new Set(l);
847
+ u.has(i) ? u.delete(i) : u.add(i), r.set(u);
848
+ }
849
+ }),
850
+ h.span(i),
851
+ x({
852
+ icon: g(s)(
853
+ (a) => a ? "chevron-up" : "chevron-down"
854
+ ),
855
+ size: "sm"
856
+ })
857
+ ),
858
+ h.div(
859
+ c.class("bc-accordion__content"),
860
+ c.class(
861
+ g(s)(
862
+ (a) => a ? "bc-accordion__content--open" : "bc-accordion__content--closed"
863
+ )
864
+ ),
865
+ y(
866
+ c.class("bc-stack--gap-1"),
867
+ ...e.filter((a, l) => o.length === 0 || l < o.length)
868
+ )
869
+ )
870
+ );
871
+ })
872
+ );
873
+ }
874
+ function we({
875
+ title: t,
876
+ children: e
877
+ }) {
878
+ const n = _(!0);
879
+ return h.div(
880
+ c.class("bc-accordion"),
881
+ h.div(
882
+ c.class("bc-accordion__item"),
883
+ h.button(
884
+ c.type("button"),
885
+ c.class("bc-accordion__header"),
886
+ w.click(() => n.set(!n.value)),
887
+ h.span(t),
888
+ x({
889
+ icon: g(n)(
890
+ (r) => r ? "chevron-up" : "chevron-down"
891
+ ),
892
+ size: "sm"
893
+ })
894
+ ),
895
+ h.div(
896
+ c.class("bc-accordion__content"),
897
+ c.class(
898
+ g(n)(
899
+ (r) => r ? "bc-accordion__content--open" : "bc-accordion__content--closed"
900
+ )
901
+ ),
902
+ y(c.class("bc-stack--gap-1"), ...e)
903
+ )
904
+ )
905
+ );
906
+ }
907
+ function C(t, e, n) {
908
+ const r = /* @__PURE__ */ new Map();
909
+ n.forEach((s, a) => {
910
+ t[a] && r.set(s, t[a]);
911
+ });
912
+ let i = t;
913
+ if (e.order && e.order.length > 0) {
914
+ const s = /* @__PURE__ */ new Map(), a = [];
915
+ e.order.forEach((l) => {
916
+ const u = r.get(l);
917
+ u && s.set(l, u);
918
+ }), n.forEach((l, u) => {
919
+ !e.order.includes(l) && t[u] && a.push(t[u]);
920
+ }), i = [...Array.from(s.values()), ...a];
921
+ }
922
+ let o;
923
+ if (e.groups && Object.keys(e.groups).length > 0) {
924
+ o = {};
925
+ const s = /* @__PURE__ */ new Set();
926
+ Object.entries(e.groups).forEach(([l, u]) => {
927
+ o[l] = [], u.forEach((f) => {
928
+ const d = r.get(f);
929
+ d && (o[l].push(d), s.add(d));
930
+ });
931
+ });
932
+ const a = i.filter(
933
+ (l) => !s.has(l)
934
+ );
935
+ a.length > 0 && (o.Other = a);
936
+ }
937
+ return { orderedChildren: i, groupedChildren: o };
938
+ }
939
+ function ze(t, e, n, r = []) {
940
+ if (!t || !t.format) {
941
+ if (t?.order) {
942
+ const { orderedChildren: a } = C(
943
+ n,
944
+ t,
945
+ r
946
+ );
947
+ return y(c.class("bc-stack--gap-1"), ...a);
948
+ }
949
+ return y(c.class("bc-stack--gap-1"), ...n);
950
+ }
951
+ const i = e.widgetLabel || e.name, { orderedChildren: o, groupedChildren: s } = C(
952
+ n,
953
+ t,
954
+ r
955
+ );
956
+ switch (t.format) {
957
+ case "fieldset":
958
+ return pe({ title: i, children: o });
959
+ case "group":
960
+ return me({ title: i, children: o });
961
+ case "grid":
962
+ return ye({ cols: t.cols, children: o });
963
+ case "tabs":
964
+ return be({
965
+ groups: s || t.groups,
966
+ children: s ? Object.values(s).flat() : o
967
+ });
968
+ case "accordion":
969
+ return ve({
970
+ groups: s || t.groups,
971
+ children: s ? Object.values(s).flat() : o
972
+ });
973
+ default:
974
+ return y(c.class("bc-stack--gap-1"), ...o);
975
+ }
976
+ }
977
+ function Ae(t, e, n) {
978
+ const i = t.definition.oneOf;
979
+ if (!Array.isArray(i) || i.length === 0)
980
+ return {
981
+ matchingBranch: -1,
982
+ validBranches: [],
983
+ isAmbiguous: !1,
984
+ hasNoMatch: !0
985
+ };
986
+ const o = i.map((f) => {
987
+ if (typeof f == "object" && f != null && "$ref" in f) {
988
+ const d = f.$ref;
989
+ if (typeof d == "string" && d.startsWith("#"))
990
+ return he(f, t.schema);
991
+ }
992
+ return f;
993
+ }), s = [];
994
+ for (let f = 0; f < o.length; f++) {
995
+ const d = o[f];
996
+ if (typeof d == "boolean") {
997
+ d === !0 && s.push(f);
998
+ continue;
999
+ }
1000
+ if (n)
1001
+ try {
1002
+ te(n, d)(e) && s.push(f);
1003
+ } catch (p) {
1004
+ console.warn(`Failed to compile oneOf branch ${f}:`, p), L(d, e) && s.push(f);
1005
+ }
1006
+ else
1007
+ L(d, e) && s.push(f);
1008
+ }
1009
+ const a = s.length > 1, l = s.length === 0;
1010
+ return {
1011
+ matchingBranch: s.length === 1 ? s[0] : -1,
1012
+ validBranches: s,
1013
+ isAmbiguous: a,
1014
+ hasNoMatch: l
1015
+ };
1016
+ }
1017
+ function L(t, e) {
1018
+ if ("const" in t)
1019
+ return t.const === e;
1020
+ if (Array.isArray(t.enum))
1021
+ return t.enum.includes(e);
1022
+ if (t.type != null) {
1023
+ const n = Array.isArray(t.type) ? t.type : [t.type], r = Oe(e);
1024
+ if (r === "unknown" || !n.includes(r))
1025
+ return !1;
1026
+ }
1027
+ if (t.properties && typeof e == "object" && e != null) {
1028
+ const n = e;
1029
+ for (const [r, i] of Object.entries(t.properties))
1030
+ if (typeof i == "object" && i != null && "const" in i && n[r] !== i.const)
1031
+ return !1;
1032
+ }
1033
+ return !0;
1034
+ }
1035
+ function Oe(t) {
1036
+ return t === null ? "null" : Array.isArray(t) ? "array" : typeof t == "object" ? "object" : typeof t == "string" ? "string" : typeof t == "number" ? Number.isInteger(t) ? "integer" : "number" : typeof t == "boolean" ? "boolean" : "unknown";
1037
+ }
1038
+ function Be(t, e, n = `Option ${e + 1}`) {
1039
+ if (typeof t == "boolean")
1040
+ return t ? "Any Value" : "No Value";
1041
+ if (t.title)
1042
+ return t.title;
1043
+ if (t.properties) {
1044
+ for (const [r, i] of Object.entries(t.properties))
1045
+ if (typeof i == "object" && i != null && "const" in i) {
1046
+ const o = i.const;
1047
+ if (typeof o == "string")
1048
+ return `${r}: ${o}`;
1049
+ }
1050
+ }
1051
+ return "const" in t && typeof t.const == "string" ? t.const : t.type ? (Array.isArray(t.type) ? t.type : [t.type]).join(" | ") : n;
1052
+ }
1053
+ function We(t, e, n) {
1054
+ const r = Ae(t, e, n);
1055
+ return r.matchingBranch !== -1 ? r.matchingBranch : -1;
1056
+ }
1057
+ export {
1058
+ T as S,
1059
+ ze as a,
1060
+ he as b,
1061
+ te as c,
1062
+ Ae as d,
1063
+ Be as e,
1064
+ We as f,
1065
+ De as g,
1066
+ Ve as h,
1067
+ Te as i,
1068
+ N as j,
1069
+ Z as k,
1070
+ Y as l,
1071
+ qe as m,
1072
+ xe as n,
1073
+ Me as o,
1074
+ Ee as p,
1075
+ M as q,
1076
+ Ie as r
1077
+ };