themelia-react-ui 2.0.4 → 2.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (715) hide show
  1. package/CHANGELOG.md +211 -0
  2. package/MIGRATION.md +119 -0
  3. package/README.md +122 -20
  4. package/dist/{accordion-96o0pN62.js → accordion-0tQUZ20r.js} +13 -13
  5. package/dist/accordion-0tQUZ20r.js.map +1 -0
  6. package/dist/{action-menu-CHgs8vmj.js → action-menu-C0gjzLyE.js} +48 -45
  7. package/dist/action-menu-C0gjzLyE.js.map +1 -0
  8. package/dist/{affordance-geometry.generated-B8yGOr8-.js → affordance-geometry.generated-P-aVJisu.js} +36 -36
  9. package/dist/affordance-geometry.generated-P-aVJisu.js.map +1 -0
  10. package/dist/{ai-artifact-BZUGwBq6.js → ai-artifact-CGGpQryR.js} +281 -230
  11. package/dist/ai-artifact-CGGpQryR.js.map +1 -0
  12. package/dist/app-shell-EHuuRDGy.js +321 -0
  13. package/dist/app-shell-EHuuRDGy.js.map +1 -0
  14. package/dist/{attachment-DkoqHPPl.js → attachment-BCpA4e7i.js} +10 -10
  15. package/dist/{attachment-DkoqHPPl.js.map → attachment-BCpA4e7i.js.map} +1 -1
  16. package/dist/{auth-D2FVZ1MH.js → auth-B0girIk_.js} +49 -52
  17. package/dist/auth-B0girIk_.js.map +1 -0
  18. package/dist/{avatar-DWO_HHhB.js → avatar-B9Jnp-T-.js} +8 -8
  19. package/dist/avatar-B9Jnp-T-.js.map +1 -0
  20. package/dist/{badge-DErMA7ul.js → badge-wWauMgAt.js} +5 -5
  21. package/dist/{badge-DErMA7ul.js.map → badge-wWauMgAt.js.map} +1 -1
  22. package/dist/base/accordion.js +1 -1
  23. package/dist/base/action-menu.js +1 -1
  24. package/dist/base/attachment.js +1 -1
  25. package/dist/base/avatar.js +1 -1
  26. package/dist/base/badge.js +1 -1
  27. package/dist/base/batch-action-bar.js +1 -1
  28. package/dist/base/buttons.js +1 -1
  29. package/dist/base/cards.js +2 -2
  30. package/dist/base/carousel.js +3 -3
  31. package/dist/base/cascader.js +2 -372
  32. package/dist/base/chart.js +1 -1
  33. package/dist/base/choice-inputs.js +2 -2
  34. package/dist/base/code-block.js +1 -1
  35. package/dist/base/combobox.js +2 -2
  36. package/dist/base/command.js +1 -1
  37. package/dist/base/copyable.js +1 -1
  38. package/dist/base/date-pickers.js +2 -2
  39. package/dist/base/display.js +6 -6
  40. package/dist/base/feedback.js +4 -4
  41. package/dist/base/forms-numeric.js +1 -1
  42. package/dist/base/forms.js +2 -2
  43. package/dist/base/inline-edit.js +10 -10
  44. package/dist/base/item.js +1 -1
  45. package/dist/base/media-gallery.js +1 -1
  46. package/dist/base/metadata-list.js +1 -1
  47. package/dist/base/navigation.js +7 -7
  48. package/dist/base/popover-menu.js +1 -1
  49. package/dist/base/popover.js +1 -1
  50. package/dist/base/qr-code.js +1 -1
  51. package/dist/base/repeaters.js +200 -193
  52. package/dist/base/repeaters.js.map +1 -1
  53. package/dist/base/sheet.js +1 -1
  54. package/dist/base/sidebar.js +2 -2
  55. package/dist/base/signature-pad.js +8 -8
  56. package/dist/base/signature-pad.js.map +1 -1
  57. package/dist/base/skeleton.js +1 -1
  58. package/dist/base/spinner.js +6 -6
  59. package/dist/base/spinner.js.map +1 -1
  60. package/dist/base/structure.js +1 -1
  61. package/dist/base/table.js +1 -1
  62. package/dist/base/text-inputs.js +2 -2
  63. package/dist/base/toaster.js +36 -36
  64. package/dist/base/toaster.js.map +1 -1
  65. package/dist/base/tree.js +1 -1
  66. package/dist/base/upload-queue.js +1 -1
  67. package/dist/base/upload.js +3 -3
  68. package/dist/base/value-inputs.js +1 -1
  69. package/dist/{batch-action-bar-CdfIkCsV.js → batch-action-bar-BoqWIIpV.js} +7 -7
  70. package/dist/batch-action-bar-BoqWIIpV.js.map +1 -0
  71. package/dist/blocks/admin.js +21 -21
  72. package/dist/blocks/admin.js.map +1 -1
  73. package/dist/blocks/ai.js +267 -247
  74. package/dist/blocks/ai.js.map +1 -1
  75. package/dist/blocks/analytics/usage-card.js +1 -1
  76. package/dist/blocks/analytics.js +537 -543
  77. package/dist/blocks/analytics.js.map +1 -1
  78. package/dist/blocks/collaboration.js +1 -1
  79. package/dist/blocks/commerce/receipt.js +1 -1
  80. package/dist/blocks/commerce.js +1330 -1250
  81. package/dist/blocks/commerce.js.map +1 -1
  82. package/dist/blocks/data-display.js +2 -2
  83. package/dist/blocks/onboarding.js +6 -6
  84. package/dist/blocks/onboarding.js.map +1 -1
  85. package/dist/blocks/planning.js +11 -11
  86. package/dist/blocks/timelines.js +1 -1
  87. package/dist/{breadcrumbs-B-WFKecD.js → breadcrumbs-Bp9Ke7kd.js} +7 -7
  88. package/dist/breadcrumbs-Bp9Ke7kd.js.map +1 -0
  89. package/dist/{button-DkmK-z8E.js → button-ChBovTx0.js} +3 -3
  90. package/dist/button-ChBovTx0.js.map +1 -0
  91. package/dist/{buttons-BbfzgczK.js → buttons-DeW0bQeK.js} +16 -16
  92. package/dist/buttons-DeW0bQeK.js.map +1 -0
  93. package/dist/cards-CNXnmvV5.js +69 -0
  94. package/dist/cards-CNXnmvV5.js.map +1 -0
  95. package/dist/cascader-CrAl9zD5.js +439 -0
  96. package/dist/cascader-CrAl9zD5.js.map +1 -0
  97. package/dist/chart-I7ROnsl8.js +162 -0
  98. package/dist/chart-I7ROnsl8.js.map +1 -0
  99. package/dist/{checkbox-CzYUTPeJ.js → checkbox-MoyHIAPs.js} +3 -3
  100. package/dist/{checkbox-CzYUTPeJ.js.map → checkbox-MoyHIAPs.js.map} +1 -1
  101. package/dist/choice-inputs-DHGtx0QV.js +789 -0
  102. package/dist/choice-inputs-DHGtx0QV.js.map +1 -0
  103. package/dist/{code-block-CGNaUtAE.js → code-block-BSJyq9e-.js} +9 -9
  104. package/dist/code-block-BSJyq9e-.js.map +1 -0
  105. package/dist/{collapsible-Do4G0zcC.js → collapsible-BzJ91LUG.js} +5 -5
  106. package/dist/{collapsible-Do4G0zcC.js.map → collapsible-BzJ91LUG.js.map} +1 -1
  107. package/dist/{collection-content-C0e8SsTm.js → collection-content-CSnwtOTH.js} +3 -3
  108. package/dist/{collection-content-C0e8SsTm.js.map → collection-content-CSnwtOTH.js.map} +1 -1
  109. package/dist/combobox-Bcvu5J8O.js +363 -0
  110. package/dist/combobox-Bcvu5J8O.js.map +1 -0
  111. package/dist/combobox-C2JiSQPc.js +915 -0
  112. package/dist/combobox-C2JiSQPc.js.map +1 -0
  113. package/dist/{command-D8NrBj-b.js → command-9e52NPgK.js} +11 -11
  114. package/dist/command-9e52NPgK.js.map +1 -0
  115. package/dist/{comments-Di4w0H_S.js → comments-BsgErEqd.js} +44 -39
  116. package/dist/comments-BsgErEqd.js.map +1 -0
  117. package/dist/components/base/action-menu/action-menu.d.ts +7 -1
  118. package/dist/components/base/buttons/button-group.recipes.d.ts +2 -2
  119. package/dist/components/base/cards/card.recipes.d.ts +6 -4
  120. package/dist/components/base/cards/partials/card-primitives.d.ts +9 -2
  121. package/dist/components/base/cards/partials/smart-card-header-row.d.ts +3 -1
  122. package/dist/components/base/cards/smart-card.types.d.ts +3 -4
  123. package/dist/components/base/cascader/cascader-panel.d.ts +76 -0
  124. package/dist/components/base/chart/chart.d.ts +6 -1
  125. package/dist/components/base/choice-inputs/choice-types.d.ts +5 -1
  126. package/dist/components/base/choice-inputs/pill-radio-group.d.ts +7 -6
  127. package/dist/components/base/combobox/combobox-field.d.ts +2 -2
  128. package/dist/components/base/combobox/index.d.ts +4 -2
  129. package/dist/components/base/date-pickers/date-picker-internals.d.ts +3 -1
  130. package/dist/components/base/date-pickers/datepicker.types.d.ts +10 -4
  131. package/dist/components/base/date-pickers/time-picker.d.ts +17 -3
  132. package/dist/components/base/feedback/alert.d.ts +1 -1
  133. package/dist/components/base/feedback/state-display.d.ts +5 -1
  134. package/dist/components/base/feedback/state-display.strings.d.ts +9 -0
  135. package/dist/components/base/forms/form-field.d.ts +7 -2
  136. package/dist/components/base/forms/form-sizing.d.ts +7 -7
  137. package/dist/components/base/forms/workflow.d.ts +7 -1
  138. package/dist/components/base/forms-numeric/coordinates-input.d.ts +8 -1
  139. package/dist/components/base/forms-numeric/decimal-input.d.ts +2 -2
  140. package/dist/components/base/forms-numeric/dimensions-input.d.ts +4 -1
  141. package/dist/components/base/forms-numeric/numeric-composite-field.d.ts +12 -0
  142. package/dist/components/base/forms-numeric/weight-input.d.ts +6 -1
  143. package/dist/components/base/metadata-list/metadata-list.d.ts +1 -1
  144. package/dist/components/base/navigation/dropdown-menu.d.ts +1 -1
  145. package/dist/components/base/navigation/language-switcher.d.ts +12 -4
  146. package/dist/components/base/navigation/page-header/page-header-commands.d.ts +14 -7
  147. package/dist/components/base/navigation/page-header/page-header.d.ts +10 -3
  148. package/dist/components/base/popover/popover.d.ts +3 -3
  149. package/dist/components/base/popover/popover.recipes.d.ts +10 -6
  150. package/dist/components/base/repeaters/key-value-editor.d.ts +2 -1
  151. package/dist/components/base/sheet/sheet.d.ts +2 -0
  152. package/dist/components/base/sidebar/index.d.ts +1 -1
  153. package/dist/components/base/sidebar/sidebar.d.ts +29 -5
  154. package/dist/components/base/toaster/index.d.ts +1 -0
  155. package/dist/components/base/upload/avatar-upload.d.ts +2 -1
  156. package/dist/components/base/upload/image-upload.d.ts +2 -1
  157. package/dist/components/blocks/ai/ai-citation/types.d.ts +2 -0
  158. package/dist/components/blocks/ai/ai-file-tree/types.d.ts +1 -1
  159. package/dist/components/blocks/ai/ai-reasoning/types.d.ts +2 -0
  160. package/dist/components/blocks/ai/ai-sources/types.d.ts +2 -0
  161. package/dist/components/blocks/ai/ai-tool-call/types.d.ts +5 -1
  162. package/dist/components/blocks/ai/ai.strings.d.ts +2 -0
  163. package/dist/components/blocks/analytics/metric/metric.d.ts +4 -0
  164. package/dist/components/blocks/analytics/metric-comparison/metric-comparison.d.ts +4 -0
  165. package/dist/components/blocks/analytics/metric-grid/metric-grid.d.ts +4 -5
  166. package/dist/components/blocks/analytics/types.d.ts +2 -2
  167. package/dist/components/blocks/analytics/usage-card/usage-card.strings.d.ts +2 -0
  168. package/dist/components/blocks/commerce/cart-summary/cart-summary.d.ts +1 -1
  169. package/dist/components/blocks/commerce/cart-summary/types.d.ts +3 -1
  170. package/dist/components/blocks/commerce/discount-stack/discount-stack.d.ts +1 -1
  171. package/dist/components/blocks/commerce/discount-stack/types.d.ts +3 -1
  172. package/dist/components/blocks/commerce/fulfillment-group/fulfillment-group.d.ts +1 -1
  173. package/dist/components/blocks/commerce/fulfillment-group/types.d.ts +11 -2
  174. package/dist/components/blocks/commerce/index.d.ts +7 -6
  175. package/dist/components/blocks/commerce/inventory-section/inventory-section.d.ts +1 -1
  176. package/dist/components/blocks/commerce/inventory-section/types.d.ts +7 -2
  177. package/dist/components/blocks/commerce/invoice-header/index.d.ts +2 -1
  178. package/dist/components/blocks/commerce/invoice-header/invoice-header.d.ts +1 -1
  179. package/dist/components/blocks/commerce/invoice-header/types.d.ts +20 -6
  180. package/dist/components/blocks/commerce/invoice-line-items/invoice-line-items.d.ts +1 -1
  181. package/dist/components/blocks/commerce/invoice-line-items/types.d.ts +24 -7
  182. package/dist/components/blocks/commerce/invoice-mini/index.d.ts +2 -1
  183. package/dist/components/blocks/commerce/invoice-mini/types.d.ts +7 -1
  184. package/dist/components/blocks/commerce/order-customer/order-customer.d.ts +1 -1
  185. package/dist/components/blocks/commerce/order-customer/types.d.ts +9 -1
  186. package/dist/components/blocks/commerce/order-status/types.d.ts +4 -0
  187. package/dist/components/blocks/commerce/refund-status/refund-status.d.ts +1 -1
  188. package/dist/components/blocks/commerce/refund-status/types.d.ts +3 -1
  189. package/dist/components/blocks/commerce/shipment-tracking/shipment-tracking.d.ts +1 -1
  190. package/dist/components/blocks/commerce/shipment-tracking/types.d.ts +3 -1
  191. package/dist/components/blocks/commerce/tax-breakdown/tax-breakdown.d.ts +1 -1
  192. package/dist/components/blocks/commerce/tax-breakdown/types.d.ts +3 -1
  193. package/dist/components/blocks/data-display/empty-state/empty-state.types.d.ts +4 -3
  194. package/dist/components/features/activities/activities.types.d.ts +26 -13
  195. package/dist/components/features/activities/hooks/use-activity-resources.d.ts +2 -1
  196. package/dist/components/features/activities/partials/activity-marker.d.ts +7 -3
  197. package/dist/components/features/activities/partials/activity-row.d.ts +24 -0
  198. package/dist/components/features/ai-chat/hooks/use-ai-chat-scroll.d.ts +1 -1
  199. package/dist/components/features/appointment-calendar/appointment-calendar.d.ts +1 -1
  200. package/dist/components/features/appointment-calendar/appointment-calendar.types.d.ts +4 -2
  201. package/dist/components/features/combobox/async-resource-combobox.d.ts +2 -2
  202. package/dist/components/features/combobox/combobox.d.ts +2 -2
  203. package/dist/components/features/combobox/hooks/use-combobox-core.d.ts +2 -1
  204. package/dist/components/features/combobox/hooks/use-combobox-state.d.ts +1 -0
  205. package/dist/components/features/combobox/hooks/use-load-more.d.ts +1 -0
  206. package/dist/components/features/combobox/types.d.ts +37 -8
  207. package/dist/components/features/email-composer/types.d.ts +3 -1
  208. package/dist/components/features/event-calendar/colors.d.ts +2 -2
  209. package/dist/components/features/event-calendar/event-calendar.types.d.ts +4 -0
  210. package/dist/components/features/filters/facets/date-facet.d.ts +4 -2
  211. package/dist/components/features/filters/facets/range-facet.d.ts +12 -0
  212. package/dist/components/features/filters/facets/select-facet.d.ts +2 -1
  213. package/dist/components/features/filters/filters.strings.d.ts +4 -0
  214. package/dist/components/features/filters/filters.types.d.ts +6 -3
  215. package/dist/components/features/filters/partials/date-filter-content.d.ts +3 -2
  216. package/dist/components/features/filters/partials/filter-editor-header.d.ts +16 -0
  217. package/dist/components/features/filters/partials/filter-popover-content.d.ts +5 -3
  218. package/dist/components/features/filters/partials/nested-filter-options.d.ts +21 -0
  219. package/dist/components/features/filters/partials/range-filter-content.d.ts +12 -0
  220. package/dist/components/features/filters/partials/regular-filter-content.d.ts +2 -1
  221. package/dist/components/features/filters/utils/filter-utils.d.ts +25 -3
  222. package/dist/components/features/global-search/global-search.types.d.ts +2 -0
  223. package/dist/components/features/global-search/partials/global-search-input.d.ts +10 -0
  224. package/dist/components/features/global-search/partials/global-search-result-row.d.ts +7 -1
  225. package/dist/components/features/media-library/hooks/use-media-library.d.ts +1 -1
  226. package/dist/components/features/media-library/media-library.d.ts +1 -1
  227. package/dist/components/features/media-library/media-library.strings.d.ts +8 -0
  228. package/dist/components/features/media-library/media-library.types.d.ts +50 -12
  229. package/dist/components/features/media-library/partials/media-library-partials.d.ts +4 -4
  230. package/dist/components/features/mentions/hooks/use-mentions.d.ts +16 -1
  231. package/dist/components/features/mentions/partials/mention-inline-suggestions.d.ts +5 -1
  232. package/dist/components/features/mentions/utils/split-html-by-mentions.d.ts +1 -7
  233. package/dist/components/features/overlays/hooks/use-overlay-visibility.d.ts +2 -2
  234. package/dist/components/features/products/components/product-options-matrix.d.ts +1 -1
  235. package/dist/components/features/products/components/product-variant-editor.d.ts +1 -1
  236. package/dist/components/features/products/components/product-variants-manager.d.ts +1 -1
  237. package/dist/components/features/products/products.strings.d.ts +9 -1
  238. package/dist/components/features/products/products.types.d.ts +45 -8
  239. package/dist/components/features/questionnaire/questionnaire.types.d.ts +3 -0
  240. package/dist/components/features/resource/resource.d.ts +6 -2
  241. package/dist/components/features/resource/resource.types.d.ts +14 -1
  242. package/dist/components/features/rich-text-editor/form-rich-text-editor.d.ts +1 -1
  243. package/dist/components/features/rich-text-editor/partials/caret-helpers.d.ts +1 -1
  244. package/dist/components/features/rich-text-editor/partials/editor-field-aria.d.ts +14 -0
  245. package/dist/components/features/rich-text-editor/partials/image-uploads.d.ts +1 -1
  246. package/dist/components/features/rich-text-editor/partials/rich-text-editor-toolbar.d.ts +3 -1
  247. package/dist/components/features/rich-text-editor/rich-text-editor.recipes.d.ts +12 -2
  248. package/dist/components/features/rich-text-editor/rich-text-editor.types.d.ts +17 -3
  249. package/dist/components/features/schema-form/hooks/use-schema-form.d.ts +5 -1
  250. package/dist/components/features/schema-form/partials/schema-form-field.d.ts +3 -1
  251. package/dist/components/features/schema-form/schema-form.utils.d.ts +1 -1
  252. package/dist/components/features/suggestions/suggestions.types.d.ts +1 -1
  253. package/dist/components/features/table/data-table.d.ts +1 -1
  254. package/dist/components/features/table/index.d.ts +1 -0
  255. package/dist/components/features/table/partials/resource-cell.d.ts +22 -5
  256. package/dist/components/features/table/table-body.d.ts +1 -1
  257. package/dist/components/features/table/table-helpers.d.ts +6 -3
  258. package/dist/components/features/table/table.strings.d.ts +3 -0
  259. package/dist/components/features/table/table.types.d.ts +18 -2
  260. package/dist/components/layout/app-shell/app-shell.types.d.ts +35 -6
  261. package/dist/components/layout/app-shell/index.d.ts +1 -1
  262. package/dist/components/layout/app-shell/shell-regions.d.ts +27 -0
  263. package/dist/components/layout/app-shell/sidebar-inset-layout.d.ts +1 -1
  264. package/dist/components/layout/app-shell/stacked-layout.d.ts +1 -1
  265. package/dist/components/layout/app-shell/topbar-sidebar-layout.d.ts +1 -1
  266. package/dist/components/layout/containers/two-column-layout.d.ts +2 -0
  267. package/dist/components/layout/header/header.recipes.d.ts +6 -0
  268. package/dist/components/layout/header/header.types.d.ts +9 -8
  269. package/dist/components/layout/layout.types.d.ts +5 -3
  270. package/dist/components/layout/navigation/section-nav/section-nav.d.ts +5 -0
  271. package/dist/components/layout/navigation/side-nav.d.ts +3 -2
  272. package/dist/components/layout/normalize-layout-path.d.ts +1 -0
  273. package/dist/components/layout/page/index.d.ts +2 -1
  274. package/dist/components/layout/page/page.d.ts +1 -0
  275. package/dist/components/layout/page/page.strings.d.ts +11 -0
  276. package/dist/components/layout/page/page.types.d.ts +69 -17
  277. package/dist/components/layout/page/partials/page-header.d.ts +1 -1
  278. package/dist/components/layout/settings/settings.d.ts +10 -3
  279. package/dist/components/layout/sidebar/app-sidebar.d.ts +1 -1
  280. package/dist/components/layout/sidebar/components/sidebar-grouped-navigation.d.ts +1 -1
  281. package/dist/components/layout/sidebar/components/sidebar-navigation.d.ts +1 -1
  282. package/dist/components/layout/sidebar/index.d.ts +2 -1
  283. package/dist/components/layout/sidebar/sidebar-navigation-rail.d.ts +38 -0
  284. package/dist/components/layout/sidebar/sidebar.context.d.ts +6 -7
  285. package/dist/components/layout/sidebar/sidebar.types.d.ts +50 -10
  286. package/dist/components/layout/sidebar/sidebar.utils.d.ts +9 -1
  287. package/dist/components/layout/workspace/workspace.types.d.ts +8 -1
  288. package/dist/components/primitives/link.d.ts +3 -2
  289. package/dist/components/primitives/money.d.ts +1 -1
  290. package/dist/components/primitives/number.d.ts +1 -1
  291. package/dist/components/typography/rich-text/rich-text-tree.d.ts +7 -5
  292. package/dist/components/ui/alert-dialog.d.ts +2 -2
  293. package/dist/components/ui/combobox.d.ts +1 -1
  294. package/dist/components/ui/dialog.d.ts +2 -2
  295. package/dist/components/ui/overlay-layer.d.ts +18 -0
  296. package/dist/components/ui/sheet.d.ts +5 -1
  297. package/dist/components/ui/sidebar-state.d.ts +82 -0
  298. package/dist/components/ui/sidebar.d.ts +5 -17
  299. package/dist/{containers-CRmHf7GP.js → containers-CSdc32h9.js} +26 -18
  300. package/dist/containers-CSdc32h9.js.map +1 -0
  301. package/dist/{control-group-recipes-DBXmfh2E.js → control-group-recipes-fMuFo0H7.js} +6 -6
  302. package/dist/control-group-recipes-fMuFo0H7.js.map +1 -0
  303. package/dist/{copyable-CnGCZdX4.js → copyable-3fdHfMR3.js} +7 -7
  304. package/dist/{copyable-CnGCZdX4.js.map → copyable-3fdHfMR3.js.map} +1 -1
  305. package/dist/{data-display-D4oujtx0.js → data-display-Cmj-xZYl.js} +271 -279
  306. package/dist/data-display-Cmj-xZYl.js.map +1 -0
  307. package/dist/{date-Q7jnXxpk.js → date-Br0FicVv.js} +5 -5
  308. package/dist/{date-Q7jnXxpk.js.map → date-Br0FicVv.js.map} +1 -1
  309. package/dist/date-picker-CyQlFYsP.js +1617 -0
  310. package/dist/date-picker-CyQlFYsP.js.map +1 -0
  311. package/dist/date-pickers-tj2MXmXd.js +185 -0
  312. package/dist/date-pickers-tj2MXmXd.js.map +1 -0
  313. package/dist/{display-BB4BL_-K.js → display-CT_N2a3w.js} +9 -9
  314. package/dist/{display-BB4BL_-K.js.map → display-CT_N2a3w.js.map} +1 -1
  315. package/dist/dropdown-menu-C08iIugv.js +194 -0
  316. package/dist/dropdown-menu-C08iIugv.js.map +1 -0
  317. package/dist/features/activities.js +388 -326
  318. package/dist/features/activities.js.map +1 -1
  319. package/dist/features/ai-chat.js +46 -32
  320. package/dist/features/ai-chat.js.map +1 -1
  321. package/dist/features/appointment-calendar.js +130 -130
  322. package/dist/features/appointment-calendar.js.map +1 -1
  323. package/dist/features/async-preview.js +11 -10
  324. package/dist/features/async-preview.js.map +1 -1
  325. package/dist/features/combobox.js +1 -1
  326. package/dist/features/comments.js +1 -1
  327. package/dist/features/data-view.js +13 -13
  328. package/dist/features/data-view.js.map +1 -1
  329. package/dist/features/email-composer.js +243 -239
  330. package/dist/features/email-composer.js.map +1 -1
  331. package/dist/features/event-calendar.js +197 -199
  332. package/dist/features/event-calendar.js.map +1 -1
  333. package/dist/features/filters.js +2 -2
  334. package/dist/features/global-search.js +168 -143
  335. package/dist/features/global-search.js.map +1 -1
  336. package/dist/features/kanban.js +19 -30
  337. package/dist/features/kanban.js.map +1 -1
  338. package/dist/features/map/style.css +15 -0
  339. package/dist/features/map.js +369 -343
  340. package/dist/features/map.js.map +1 -1
  341. package/dist/features/media-library.js +1202 -975
  342. package/dist/features/media-library.js.map +1 -1
  343. package/dist/features/mentions.js +2 -2
  344. package/dist/features/overlays.js +1 -1
  345. package/dist/features/products.js +1270 -1183
  346. package/dist/features/products.js.map +1 -1
  347. package/dist/features/questionnaire.js +160 -153
  348. package/dist/features/questionnaire.js.map +1 -1
  349. package/dist/features/resource-assignment.js +8 -8
  350. package/dist/features/resource.js +119 -113
  351. package/dist/features/resource.js.map +1 -1
  352. package/dist/features/rich-text-editor.js +28 -19
  353. package/dist/features/rich-text-editor.js.map +1 -1
  354. package/dist/features/schema-form.js +297 -256
  355. package/dist/features/schema-form.js.map +1 -1
  356. package/dist/features/suggestions.js +57 -50
  357. package/dist/features/suggestions.js.map +1 -1
  358. package/dist/features/sync.js +3 -3
  359. package/dist/features/table.js +1 -1
  360. package/dist/features/theme-tweaker.js +470 -470
  361. package/dist/features/theme-tweaker.js.map +1 -1
  362. package/dist/feedback-Dzo1xtAU.js +246 -0
  363. package/dist/feedback-Dzo1xtAU.js.map +1 -0
  364. package/dist/{field-affordance-recipes-DjwGx8eM.js → field-affordance-recipes-D6H7tVJi.js} +5 -5
  365. package/dist/field-affordance-recipes-D6H7tVJi.js.map +1 -0
  366. package/dist/field-control-attributes-B6i335wr.js +18 -0
  367. package/dist/field-control-attributes-B6i335wr.js.map +1 -0
  368. package/dist/{field-state-recipes-BVA2CWHo.js → field-state-recipes-7sza8QbC.js} +4 -2
  369. package/dist/{field-state-recipes-BVA2CWHo.js.map → field-state-recipes-7sza8QbC.js.map} +1 -1
  370. package/dist/filters-Dl80yYtN.js +2415 -0
  371. package/dist/filters-Dl80yYtN.js.map +1 -0
  372. package/dist/form-field-CAPdwdnZ.js +74 -0
  373. package/dist/form-field-CAPdwdnZ.js.map +1 -0
  374. package/dist/{form-sizing-NXgjkmBG.js → form-sizing-CgcrUbLU.js} +5 -5
  375. package/dist/form-sizing-CgcrUbLU.js.map +1 -0
  376. package/dist/{forms-BV5m5aQF.js → forms-B3W8CH7-.js} +17 -13
  377. package/dist/forms-B3W8CH7-.js.map +1 -0
  378. package/dist/forms-numeric-CwjQJe-O.js +991 -0
  379. package/dist/forms-numeric-CwjQJe-O.js.map +1 -0
  380. package/dist/{header-BA697l4a.js → header-ZIIsRKxP.js} +145 -141
  381. package/dist/header-ZIIsRKxP.js.map +1 -0
  382. package/dist/header.recipes-BigdJjw1.js +6 -0
  383. package/dist/header.recipes-BigdJjw1.js.map +1 -0
  384. package/dist/hooks/use-files.d.ts +2 -0
  385. package/dist/{hooks-BQ-L7Uu2.js → hooks-BitHSh-Y.js} +27 -15
  386. package/dist/hooks-BitHSh-Y.js.map +1 -0
  387. package/dist/{icon-badge-COWbCCWu.js → icon-badge-npxF1SLX.js} +4 -4
  388. package/dist/{icon-badge-COWbCCWu.js.map → icon-badge-npxF1SLX.js.map} +1 -1
  389. package/dist/index.js +4 -5
  390. package/dist/{input-Cdw4k0fb.js → input-7KAc7XQL.js} +9 -9
  391. package/dist/{input-Cdw4k0fb.js.map → input-7KAc7XQL.js.map} +1 -1
  392. package/dist/input-DIREVYHs.js +21 -0
  393. package/dist/input-DIREVYHs.js.map +1 -0
  394. package/dist/{interaction-recipes-XR9ZpVYL.js → interaction-recipes-4wZ2tvfb.js} +2 -2
  395. package/dist/{interaction-recipes-XR9ZpVYL.js.map → interaction-recipes-4wZ2tvfb.js.map} +1 -1
  396. package/dist/item-FfWnaYST.js +278 -0
  397. package/dist/item-FfWnaYST.js.map +1 -0
  398. package/dist/layout/app-shell.js +1 -1
  399. package/dist/layout/auth.js +1 -1
  400. package/dist/layout/containers.js +1 -1
  401. package/dist/layout/header.js +1 -1
  402. package/dist/layout/hooks.js +1 -1
  403. package/dist/layout/navigation.js +1 -1
  404. package/dist/layout/page.js +2 -2
  405. package/dist/layout/settings.js +1 -1
  406. package/dist/layout/sidebar.js +3 -3
  407. package/dist/layout/workspace.js +1 -1
  408. package/dist/layout.js +12 -12
  409. package/dist/layout.types-E_GAApzO.js +30 -0
  410. package/dist/layout.types-E_GAApzO.js.map +1 -0
  411. package/dist/lib/affordance-geometry.generated.d.ts +35 -35
  412. package/dist/lib/control-group-recipes.d.ts +5 -5
  413. package/dist/lib/field-affordance-recipes.d.ts +2 -2
  414. package/dist/lib/field-control-attributes.d.ts +11 -0
  415. package/dist/lib/field-state-recipes.d.ts +2 -0
  416. package/dist/lib/format.d.ts +1 -0
  417. package/dist/lib/motion-recipes.d.ts +3 -0
  418. package/dist/lib/navigation-row-recipes.d.ts +7 -7
  419. package/dist/lib/overlay-anatomy-recipes.d.ts +3 -3
  420. package/dist/lib/portal-recipes.d.ts +3 -0
  421. package/dist/lib/surface-recipes.d.ts +1 -1
  422. package/dist/lib/token-merge.generated.d.ts +18 -15
  423. package/dist/lib/utils.js +1 -1
  424. package/dist/map-demo-tile.svg +1 -1
  425. package/dist/{media-gallery-CSl5W1Fy.js → media-gallery-C81DAnKI.js} +6 -6
  426. package/dist/{media-gallery-CSl5W1Fy.js.map → media-gallery-C81DAnKI.js.map} +1 -1
  427. package/dist/{mentions-RKOQaaIB.js → mentions-qOnedSt4.js} +237 -168
  428. package/dist/mentions-qOnedSt4.js.map +1 -0
  429. package/dist/message-BJHnn43M.js +135 -0
  430. package/dist/message-BJHnn43M.js.map +1 -0
  431. package/dist/{metadata-list-qVV7AVxa.js → metadata-list-XkqZ_UXH.js} +64 -64
  432. package/dist/metadata-list-XkqZ_UXH.js.map +1 -0
  433. package/dist/{motion-recipes-ChBg4HBq.js → motion-recipes-DitYv6P2.js} +10 -2
  434. package/dist/motion-recipes-DitYv6P2.js.map +1 -0
  435. package/dist/navigation-BgtPJAhi.js +288 -0
  436. package/dist/navigation-BgtPJAhi.js.map +1 -0
  437. package/dist/navigation-Bt-v7rWP.js +261 -0
  438. package/dist/navigation-Bt-v7rWP.js.map +1 -0
  439. package/dist/{navigation-row-recipes-WZEs-hYo.js → navigation-row-recipes-BGVLvU_O.js} +9 -9
  440. package/dist/navigation-row-recipes-BGVLvU_O.js.map +1 -0
  441. package/dist/normalize-layout-path-BmEgg6fu.js +14 -0
  442. package/dist/normalize-layout-path-BmEgg6fu.js.map +1 -0
  443. package/dist/{number-E_OiIfJz.js → number-CYqBcrSj.js} +79 -87
  444. package/dist/number-CYqBcrSj.js.map +1 -0
  445. package/dist/overflow-tab-bar-BQCA2Zn2.js +172 -0
  446. package/dist/overflow-tab-bar-BQCA2Zn2.js.map +1 -0
  447. package/dist/overlays-CC8zI3Du.js +1017 -0
  448. package/dist/overlays-CC8zI3Du.js.map +1 -0
  449. package/dist/page-BoQ1VaFJ.js +331 -0
  450. package/dist/page-BoQ1VaFJ.js.map +1 -0
  451. package/dist/page-header-commands-DIKspJfx.js +193 -0
  452. package/dist/page-header-commands-DIKspJfx.js.map +1 -0
  453. package/dist/{pagination-Ch8X_47u.js → pagination-Br8TdV9A.js} +7 -7
  454. package/dist/{pagination-Ch8X_47u.js.map → pagination-Br8TdV9A.js.map} +1 -1
  455. package/dist/popover-k8TdUcAt.js +201 -0
  456. package/dist/popover-k8TdUcAt.js.map +1 -0
  457. package/dist/{popover-menu-BYaCdFhf.js → popover-menu-yn-o0kyA.js} +7 -7
  458. package/dist/{popover-menu-BYaCdFhf.js.map → popover-menu-yn-o0kyA.js.map} +1 -1
  459. package/dist/{popover.recipes-D3j8R8Yp.js → popover.recipes-DJ0AkUan.js} +19 -12
  460. package/dist/popover.recipes-DJ0AkUan.js.map +1 -0
  461. package/dist/portal-recipes-DyUXqUtD.js +9 -0
  462. package/dist/portal-recipes-DyUXqUtD.js.map +1 -0
  463. package/dist/{primitives-Du64iDbb.js → primitives-BkkQjYl7.js} +23 -18
  464. package/dist/primitives-BkkQjYl7.js.map +1 -0
  465. package/dist/primitives.js +4 -4
  466. package/dist/{progress-BvF2oCdV.js → progress-DZFXXzPs.js} +9 -9
  467. package/dist/{progress-BvF2oCdV.js.map → progress-DZFXXzPs.js.map} +1 -1
  468. package/dist/{receipt-D789Jwyy.js → receipt-C7LhOg7Q.js} +7 -7
  469. package/dist/receipt-C7LhOg7Q.js.map +1 -0
  470. package/dist/rich-text-BnTzZjIo.js +45 -0
  471. package/dist/rich-text-BnTzZjIo.js.map +1 -0
  472. package/dist/{rich-text-editor-Cm1dpUpQ.js → rich-text-editor-CAurDwT5.js} +501 -424
  473. package/dist/rich-text-editor-CAurDwT5.js.map +1 -0
  474. package/dist/rich-text-editor-toolbar-DbXig7Jk.js +99 -0
  475. package/dist/rich-text-editor-toolbar-DbXig7Jk.js.map +1 -0
  476. package/dist/rich-text-tree-BqyQ_7-R.js +66 -0
  477. package/dist/rich-text-tree-BqyQ_7-R.js.map +1 -0
  478. package/dist/{sanitize-html-DsQmI48u.js → sanitize-html-BWkH4dLM.js} +29 -16
  479. package/dist/sanitize-html-BWkH4dLM.js.map +1 -0
  480. package/dist/{scroll-area-La5RXsEk.js → scroll-area-Bj6CRUif.js} +2 -2
  481. package/dist/{scroll-area-La5RXsEk.js.map → scroll-area-Bj6CRUif.js.map} +1 -1
  482. package/dist/{separator-DAEV0w65.js → separator-B9ewiCGO.js} +2 -2
  483. package/dist/{separator-DAEV0w65.js.map → separator-B9ewiCGO.js.map} +1 -1
  484. package/dist/{separator-GNfPG-90.js → separator-DM6gs2vu.js} +3 -3
  485. package/dist/{separator-GNfPG-90.js.map → separator-DM6gs2vu.js.map} +1 -1
  486. package/dist/services/actions.js +1 -1
  487. package/dist/settings-DZPHgpx4.js +155 -0
  488. package/dist/settings-DZPHgpx4.js.map +1 -0
  489. package/dist/sheet-C4DHsgLk.js +250 -0
  490. package/dist/sheet-C4DHsgLk.js.map +1 -0
  491. package/dist/sidebar-C8BnDwTH.js +709 -0
  492. package/dist/sidebar-C8BnDwTH.js.map +1 -0
  493. package/dist/sidebar-CmD6a-HK.js +1004 -0
  494. package/dist/sidebar-CmD6a-HK.js.map +1 -0
  495. package/dist/skeleton-DDgdhmu9.js +265 -0
  496. package/dist/skeleton-DDgdhmu9.js.map +1 -0
  497. package/dist/smart-card-B6vLxqa_.js +617 -0
  498. package/dist/smart-card-B6vLxqa_.js.map +1 -0
  499. package/dist/{structure-C0V0_Fyf.js → structure-DZJ2wbAU.js} +2 -2
  500. package/dist/{structure-C0V0_Fyf.js.map → structure-DZJ2wbAU.js.map} +1 -1
  501. package/dist/style.css +1 -1
  502. package/dist/{surface-recipes-BKRVW8Os.js → surface-recipes-C8mNycaY.js} +2 -2
  503. package/dist/{surface-recipes-BKRVW8Os.js.map → surface-recipes-C8mNycaY.js.map} +1 -1
  504. package/dist/{table-DH7rozUv.js → table-CBonSdTp.js} +573 -519
  505. package/dist/table-CBonSdTp.js.map +1 -0
  506. package/dist/{table-CpvnzJn9.js → table-CXSPHH25.js} +75 -71
  507. package/dist/table-CXSPHH25.js.map +1 -0
  508. package/dist/tabs-C4Kr_hCr.js +192 -0
  509. package/dist/tabs-C4Kr_hCr.js.map +1 -0
  510. package/dist/{text-inputs-DXItiR0O.js → text-inputs-jdkS3ReG.js} +18 -18
  511. package/dist/text-inputs-jdkS3ReG.js.map +1 -0
  512. package/dist/theme.css +40 -37
  513. package/dist/{timelines-DmtztAY_.js → timelines-CoPwdJP0.js} +13 -12
  514. package/dist/timelines-CoPwdJP0.js.map +1 -0
  515. package/dist/tooltip-31NwIpTo.js +113 -0
  516. package/dist/tooltip-31NwIpTo.js.map +1 -0
  517. package/dist/{tree-CV11PURP.js → tree-CeYVzdFE.js} +9 -9
  518. package/dist/{tree-CV11PURP.js.map → tree-CeYVzdFE.js.map} +1 -1
  519. package/dist/typography/rich-text.js +1 -1
  520. package/dist/{typography-CSyJrh28.js → typography-C7-YMW1S.js} +12 -12
  521. package/dist/{typography-CSyJrh28.js.map → typography-C7-YMW1S.js.map} +1 -1
  522. package/dist/typography.js +1 -1
  523. package/dist/ui-provider-C-74NVLc.js +178 -0
  524. package/dist/ui-provider-C-74NVLc.js.map +1 -0
  525. package/dist/ui-provider.js +2 -3
  526. package/dist/{upload-C9SA0X-8.js → upload-Hdm5gObf.js} +309 -296
  527. package/dist/upload-Hdm5gObf.js.map +1 -0
  528. package/dist/{upload-queue-DhQJiSRc.js → upload-queue-D0sYPuqo.js} +16 -14
  529. package/dist/upload-queue-D0sYPuqo.js.map +1 -0
  530. package/dist/{usage-card-DVTRDmGz.js → usage-card-9s8hLDfn.js} +24 -17
  531. package/dist/usage-card-9s8hLDfn.js.map +1 -0
  532. package/dist/{utils-CF3c95Io.js → utils-DhuoqFy4.js} +255 -165
  533. package/dist/utils-DhuoqFy4.js.map +1 -0
  534. package/dist/value-inputs-D3aPgq9H.js +980 -0
  535. package/dist/value-inputs-D3aPgq9H.js.map +1 -0
  536. package/dist/{value-typography-ClupF0Gz.js → value-typography-uSzzG9Gf.js} +32 -26
  537. package/dist/value-typography-uSzzG9Gf.js.map +1 -0
  538. package/dist/{workspace-9EFVXUyk.js → workspace-CC8Vchiu.js} +51 -50
  539. package/dist/workspace-CC8Vchiu.js.map +1 -0
  540. package/docs/consumer-skill/SKILL.md +4 -3
  541. package/docs/consumer-skill/agents/themelia-ui-designer.md +96 -0
  542. package/docs/consumer-skill/examples/app-layout.tsx +52 -1
  543. package/docs/consumer-skill/examples/commerce-lines.tsx +271 -0
  544. package/docs/consumer-skill/examples/custom-composition.tsx +21 -0
  545. package/docs/consumer-skill/examples/detail.tsx +5 -4
  546. package/docs/consumer-skill/examples/edit.tsx +3 -3
  547. package/docs/consumer-skill/examples/editable-sections.tsx +38 -0
  548. package/docs/consumer-skill/examples/index-table.tsx +4 -4
  549. package/docs/consumer-skill/examples/manifest.json +38 -1
  550. package/docs/consumer-skill/examples/product-media.tsx +41 -0
  551. package/docs/consumer-skill/examples/product-parts.tsx +81 -0
  552. package/docs/consumer-skill/examples/rhf-edit-page.tsx +1 -1
  553. package/docs/consumer-skill/examples/rhf-overlay-form.tsx +24 -11
  554. package/docs/consumer-skill/examples/token-domain-structure.tsx +68 -0
  555. package/docs/consumer-skill/references/agents-md.md +21 -19
  556. package/docs/consumer-skill/references/analytics.md +33 -1
  557. package/docs/consumer-skill/references/commerce-composition.md +97 -0
  558. package/docs/consumer-skill/references/component-contracts.json +21249 -14205
  559. package/docs/consumer-skill/references/composition-mapping.md +17 -3
  560. package/docs/consumer-skill/references/composition.md +177 -32
  561. package/docs/consumer-skill/references/critique-rubric.md +98 -0
  562. package/docs/consumer-skill/references/custom-composition.md +261 -0
  563. package/docs/consumer-skill/references/data-reading.md +79 -0
  564. package/docs/consumer-skill/references/design-contract.md +12 -9
  565. package/docs/consumer-skill/references/discovery.md +27 -3
  566. package/docs/consumer-skill/references/domain-structures.md +124 -0
  567. package/docs/consumer-skill/references/installation.md +62 -8
  568. package/docs/consumer-skill/references/integration.md +59 -1
  569. package/docs/consumer-skill/references/product-composition.md +94 -0
  570. package/docs/consumer-skill/references/public-api.json +3044 -445
  571. package/docs/consumer-skill/references/review.md +87 -10
  572. package/docs/consumer-skill/references/rhf-workflows.md +79 -0
  573. package/docs/consumer-skill/references/screen-archetypes.md +19 -7
  574. package/docs/consumer-skill/references/screen-decisions.md +126 -0
  575. package/docs/consumer-skill/references/theming.md +24 -20
  576. package/docs/consumer-skill/references/tokens.json +9 -9
  577. package/docs/consumer-skill/references/view-craft.md +153 -0
  578. package/docs/consumer-skill/references/view-spec.md +73 -0
  579. package/docs/consumer-skill/references/workflows.md +7 -1
  580. package/docs/consumer-skill/scripts/composition-policy.mjs +176 -26
  581. package/docs/consumer-skill/scripts/composition-schema.mjs +1 -1
  582. package/docs/consumer-skill/scripts/composition.mjs +61 -5
  583. package/docs/consumer-skill/scripts/discovery.mjs +54 -0
  584. package/docs/consumer-skill/scripts/inspect-component.mjs +1 -1
  585. package/docs/consumer-skill/scripts/inspection.mjs +73 -18
  586. package/docs/consumer-skill/scripts/setup-skills.mjs +79 -7
  587. package/docs/consumer-skill/scripts/surface-policy.mjs +5 -5
  588. package/docs/consumer-skills/themelia-components/SKILL.md +14 -13
  589. package/docs/consumer-skills/themelia-composition/SKILL.md +16 -17
  590. package/docs/consumer-skills/themelia-design/SKILL.md +55 -0
  591. package/docs/consumer-skills/themelia-foundation/SKILL.md +2 -1
  592. package/docs/consumer-skills/themelia-tokenization/SKILL.md +24 -17
  593. package/package.json +4 -2
  594. package/templates/admin-shell-template.tsx +1 -2
  595. package/templates/customers-template.tsx +18 -16
  596. package/dist/accordion-96o0pN62.js.map +0 -1
  597. package/dist/action-menu-CHgs8vmj.js.map +0 -1
  598. package/dist/affordance-geometry.generated-B8yGOr8-.js.map +0 -1
  599. package/dist/ai-artifact-BZUGwBq6.js.map +0 -1
  600. package/dist/app-shell-D63ATkIK.js +0 -237
  601. package/dist/app-shell-D63ATkIK.js.map +0 -1
  602. package/dist/auth-D2FVZ1MH.js.map +0 -1
  603. package/dist/avatar-DWO_HHhB.js.map +0 -1
  604. package/dist/base/cascader.js.map +0 -1
  605. package/dist/batch-action-bar-CdfIkCsV.js.map +0 -1
  606. package/dist/breadcrumbs-B-WFKecD.js.map +0 -1
  607. package/dist/button-DkmK-z8E.js.map +0 -1
  608. package/dist/buttons-BbfzgczK.js.map +0 -1
  609. package/dist/cards-4JTWqvVe.js +0 -68
  610. package/dist/cards-4JTWqvVe.js.map +0 -1
  611. package/dist/chart-C19flDQb.js +0 -155
  612. package/dist/chart-C19flDQb.js.map +0 -1
  613. package/dist/choice-inputs-JLtij2y4.js +0 -776
  614. package/dist/choice-inputs-JLtij2y4.js.map +0 -1
  615. package/dist/code-block-CGNaUtAE.js.map +0 -1
  616. package/dist/combobox-CBJDs6w_.js +0 -877
  617. package/dist/combobox-CBJDs6w_.js.map +0 -1
  618. package/dist/combobox-hbhSS18O.js +0 -355
  619. package/dist/combobox-hbhSS18O.js.map +0 -1
  620. package/dist/command-D8NrBj-b.js.map +0 -1
  621. package/dist/comments-Di4w0H_S.js.map +0 -1
  622. package/dist/containers-CRmHf7GP.js.map +0 -1
  623. package/dist/control-group-recipes-DBXmfh2E.js.map +0 -1
  624. package/dist/data-display-D4oujtx0.js.map +0 -1
  625. package/dist/date-picker-zOt1oNss.js +0 -1542
  626. package/dist/date-picker-zOt1oNss.js.map +0 -1
  627. package/dist/date-pickers-cj8IXbDC.js +0 -179
  628. package/dist/date-pickers-cj8IXbDC.js.map +0 -1
  629. package/dist/dropdown-menu-CjY8Vt7W.js +0 -193
  630. package/dist/dropdown-menu-CjY8Vt7W.js.map +0 -1
  631. package/dist/feedback-DZNL5Lg1.js +0 -239
  632. package/dist/feedback-DZNL5Lg1.js.map +0 -1
  633. package/dist/field-affordance-recipes-DjwGx8eM.js.map +0 -1
  634. package/dist/filters-BcT-uoFy.js +0 -2209
  635. package/dist/filters-BcT-uoFy.js.map +0 -1
  636. package/dist/form-field-CsgRmdit.js +0 -63
  637. package/dist/form-field-CsgRmdit.js.map +0 -1
  638. package/dist/form-sizing-NXgjkmBG.js.map +0 -1
  639. package/dist/forms-BV5m5aQF.js.map +0 -1
  640. package/dist/forms-numeric-Cd33AKbD.js +0 -906
  641. package/dist/forms-numeric-Cd33AKbD.js.map +0 -1
  642. package/dist/header-BA697l4a.js.map +0 -1
  643. package/dist/hooks-BQ-L7Uu2.js.map +0 -1
  644. package/dist/input-DOPL5_QE.js +0 -21
  645. package/dist/input-DOPL5_QE.js.map +0 -1
  646. package/dist/item-BvZ2DR_x.js +0 -277
  647. package/dist/item-BvZ2DR_x.js.map +0 -1
  648. package/dist/layout.types-Cn7aUzJp.js +0 -20
  649. package/dist/layout.types-Cn7aUzJp.js.map +0 -1
  650. package/dist/mentions-RKOQaaIB.js.map +0 -1
  651. package/dist/message-INU2xsxu.js +0 -128
  652. package/dist/message-INU2xsxu.js.map +0 -1
  653. package/dist/metadata-list-qVV7AVxa.js.map +0 -1
  654. package/dist/motion-recipes-ChBg4HBq.js.map +0 -1
  655. package/dist/navigation-BQNcg1jT.js +0 -269
  656. package/dist/navigation-BQNcg1jT.js.map +0 -1
  657. package/dist/navigation-DLF3E1IC.js +0 -145
  658. package/dist/navigation-DLF3E1IC.js.map +0 -1
  659. package/dist/navigation-row-recipes-WZEs-hYo.js.map +0 -1
  660. package/dist/number-E_OiIfJz.js.map +0 -1
  661. package/dist/overflow-tab-bar-CrbqMteP.js +0 -284
  662. package/dist/overflow-tab-bar-CrbqMteP.js.map +0 -1
  663. package/dist/overlays-BlKynmde.js +0 -1004
  664. package/dist/overlays-BlKynmde.js.map +0 -1
  665. package/dist/page-CIwNUtGr.js +0 -227
  666. package/dist/page-CIwNUtGr.js.map +0 -1
  667. package/dist/page-header-commands-DFMlNYzN.js +0 -128
  668. package/dist/page-header-commands-DFMlNYzN.js.map +0 -1
  669. package/dist/popover-uwzX2vo7.js +0 -198
  670. package/dist/popover-uwzX2vo7.js.map +0 -1
  671. package/dist/popover.recipes-D3j8R8Yp.js.map +0 -1
  672. package/dist/primitives-Du64iDbb.js.map +0 -1
  673. package/dist/receipt-D789Jwyy.js.map +0 -1
  674. package/dist/rich-text-CLJEf76s.js +0 -78
  675. package/dist/rich-text-CLJEf76s.js.map +0 -1
  676. package/dist/rich-text-editor-Cm1dpUpQ.js.map +0 -1
  677. package/dist/rich-text-editor-toolbar-L__e4x47.js +0 -94
  678. package/dist/rich-text-editor-toolbar-L__e4x47.js.map +0 -1
  679. package/dist/safe-image-src-C6kQSMBZ.js +0 -17
  680. package/dist/safe-image-src-C6kQSMBZ.js.map +0 -1
  681. package/dist/sanitize-html-DsQmI48u.js.map +0 -1
  682. package/dist/settings-BA2iboic.js +0 -174
  683. package/dist/settings-BA2iboic.js.map +0 -1
  684. package/dist/sheet-DoAxTb2J.js +0 -213
  685. package/dist/sheet-DoAxTb2J.js.map +0 -1
  686. package/dist/sidebar-ByqKR_W5.js +0 -512
  687. package/dist/sidebar-ByqKR_W5.js.map +0 -1
  688. package/dist/sidebar-D2iSnGJ7.js +0 -619
  689. package/dist/sidebar-D2iSnGJ7.js.map +0 -1
  690. package/dist/skeleton-CUj8O5Bd.js +0 -264
  691. package/dist/skeleton-CUj8O5Bd.js.map +0 -1
  692. package/dist/smart-card-CqkzQsK-.js +0 -614
  693. package/dist/smart-card-CqkzQsK-.js.map +0 -1
  694. package/dist/table-CpvnzJn9.js.map +0 -1
  695. package/dist/table-DH7rozUv.js.map +0 -1
  696. package/dist/tabs-eqVsJZWO.js +0 -191
  697. package/dist/tabs-eqVsJZWO.js.map +0 -1
  698. package/dist/text-inputs-DXItiR0O.js.map +0 -1
  699. package/dist/theme-scope-BJ6eE2xt.js +0 -50
  700. package/dist/theme-scope-BJ6eE2xt.js.map +0 -1
  701. package/dist/timelines-DmtztAY_.js.map +0 -1
  702. package/dist/tooltip-B4hjKtoV.js +0 -111
  703. package/dist/tooltip-B4hjKtoV.js.map +0 -1
  704. package/dist/ui-provider-CQCuCBcy.js +0 -136
  705. package/dist/ui-provider-CQCuCBcy.js.map +0 -1
  706. package/dist/upload-C9SA0X-8.js.map +0 -1
  707. package/dist/upload-queue-DhQJiSRc.js.map +0 -1
  708. package/dist/usage-card-DVTRDmGz.js.map +0 -1
  709. package/dist/use-mobile-vaLKwgyf.js +0 -15
  710. package/dist/use-mobile-vaLKwgyf.js.map +0 -1
  711. package/dist/utils-CF3c95Io.js.map +0 -1
  712. package/dist/value-inputs-C0o70p-U.js +0 -980
  713. package/dist/value-inputs-C0o70p-U.js.map +0 -1
  714. package/dist/value-typography-ClupF0Gz.js.map +0 -1
  715. package/dist/workspace-9EFVXUyk.js.map +0 -1
@@ -1,35 +1,35 @@
1
1
  "use client";
2
- import { s as e, v as t } from "../ui-provider-CQCuCBcy.js";
2
+ import { S as e, d as t } from "../ui-provider-C-74NVLc.js";
3
3
  import { useStrings as n } from "../lib/strings.js";
4
- import { t as r } from "../utils-CF3c95Io.js";
5
- import { n as i } from "../buttons-BbfzgczK.js";
6
- import { c as a, o } from "../typography-CSyJrh28.js";
4
+ import { t as r } from "../utils-DhuoqFy4.js";
5
+ import { n as i } from "../buttons-DeW0bQeK.js";
6
+ import { c as a, o } from "../typography-C7-YMW1S.js";
7
7
  import { t as s } from "../focus-recipes-B653VaLq.js";
8
- import { r as c, t as l } from "../structure-C0V0_Fyf.js";
9
- import { i as u } from "../smart-card-CqkzQsK-.js";
10
- import { n as d, t as f } from "../feedback-DZNL5Lg1.js";
11
- import { t as p } from "../progress-BvF2oCdV.js";
12
- import { n as m, t as h } from "../composition.recipes-COdiFhxB.js";
13
- import { r as g } from "../overlays-BlKynmde.js";
14
- import { t as _ } from "../interaction-recipes-XR9ZpVYL.js";
15
- import { a as v, i as y, t as b } from "../primitives-Du64iDbb.js";
16
- import { n as x, t as S } from "../number-E_OiIfJz.js";
17
- import { t as C } from "../badge-DErMA7ul.js";
18
- import { t as ee } from "../batch-action-bar-CdfIkCsV.js";
19
- import { t as w } from "../input-Cdw4k0fb.js";
20
- import { t as T } from "../form-field-CsgRmdit.js";
21
- import { c as E, l as D } from "../choice-inputs-JLtij2y4.js";
22
- import { r as O, t as k } from "../control-group-recipes-DBXmfh2E.js";
23
- import { t as te } from "../upload.recipes-BbxTqrCT.js";
24
- import { t as ne } from "../metadata-list-qVV7AVxa.js";
25
- import { a as A } from "../upload-queue-DhQJiSRc.js";
26
- import { s as re } from "../data-display-D4oujtx0.js";
27
- import { createContext as j, useCallback as M, useContext as ie, useEffect as ae, useMemo as N, useRef as oe, useState as P } from "react";
28
- import { Fragment as se, jsx as F, jsxs as I } from "react/jsx-runtime";
29
- import { ArrowLeft as L, ArrowRight as ce, Check as R, File as z, Grid2X2 as B, ImageIcon as le, ImagePlus as ue, Info as de, Layers3 as fe, LayoutList as pe, Lock as me, Play as he, Plus as ge, Search as _e, Star as ve, Trash2 as ye, UploadCloud as be, Video as xe, X as Se } from "lucide-react";
30
- import { createPortal as V } from "react-dom";
8
+ import { r as c, t as l } from "../structure-DZJ2wbAU.js";
9
+ import { h as u, i as d, p as f } from "../smart-card-B6vLxqa_.js";
10
+ import { n as p, t as m } from "../feedback-Dzo1xtAU.js";
11
+ import { t as h } from "../progress-DZFXXzPs.js";
12
+ import { n as g, t as _ } from "../composition.recipes-COdiFhxB.js";
13
+ import { r as v, t as y } from "../overlays-CC8zI3Du.js";
14
+ import { t as b } from "../interaction-recipes-4wZ2tvfb.js";
15
+ import { a as x, i as S, t as C } from "../primitives-BkkQjYl7.js";
16
+ import { n as ee, t as w } from "../number-CYqBcrSj.js";
17
+ import { t as T } from "../badge-wWauMgAt.js";
18
+ import { t as te } from "../batch-action-bar-BoqWIIpV.js";
19
+ import { t as E } from "../input-7KAc7XQL.js";
20
+ import { t as D } from "../form-field-CAPdwdnZ.js";
21
+ import { c as O, l as ne } from "../choice-inputs-DHGtx0QV.js";
22
+ import { r as k, t as re } from "../control-group-recipes-fMuFo0H7.js";
23
+ import { t as A } from "../upload.recipes-BbxTqrCT.js";
24
+ import { t as ie } from "../metadata-list-XkqZ_UXH.js";
25
+ import { a as j } from "../upload-queue-D0sYPuqo.js";
26
+ import { s as M } from "../data-display-Cmj-xZYl.js";
27
+ import { createContext as ae, useCallback as N, useContext as oe, useEffect as se, useMemo as P, useRef as F, useState as I } from "react";
28
+ import { Fragment as ce, jsx as L, jsxs as R } from "react/jsx-runtime";
29
+ import { ArrowLeft as le, ArrowRight as z, Check as ue, File as B, Grid2X2 as de, ImageIcon as fe, ImagePlus as pe, Info as me, Layers3 as he, LayoutList as ge, Lock as _e, Play as V, Plus as ve, Search as ye, Star as be, Trash2 as xe, UploadCloud as Se, Video as Ce, X as we } from "lucide-react";
30
+ import { createPortal as Te } from "react-dom";
31
31
  //#region src/components/features/media-library/media-library.strings.ts
32
- var Ce = {
32
+ var H = {
33
33
  title: "Add media",
34
34
  description: "Pick from the library, or upload new files.",
35
35
  close: "Close media library",
@@ -54,7 +54,7 @@ var Ce = {
54
54
  sortUsage: "Most used",
55
55
  gridView: "Grid view",
56
56
  tableView: "Table view",
57
- countAll: "{count} items",
57
+ countAll: "{count} {count, plural, one {item} other {items}}",
58
58
  countFiltered: "{count} of {total} items",
59
59
  countSearch: "{count} of {total} items for \"{query}\"",
60
60
  activeSearchLabel: "Search",
@@ -67,7 +67,8 @@ var Ce = {
67
67
  uploadMedia: "Upload media",
68
68
  loading: "Loading media...",
69
69
  errorTitle: "Media could not load",
70
- errorDescription: "Try again or adjust your filters.",
70
+ errorDescription: "Check your connection, then try again.",
71
+ retry: "Try again",
71
72
  cardDetails: "Details for {name}",
72
73
  selectMode: "Select",
73
74
  selectItem: "Select {name}",
@@ -104,7 +105,12 @@ var Ce = {
104
105
  usedIn: "Used in",
105
106
  replace: "Replace file",
106
107
  delete: "Delete",
107
- close: "Close details"
108
+ close: "Close details",
109
+ mutationError: "Could not change this asset. Try again.",
110
+ confirmDeleteTitle: "Delete media?",
111
+ confirmDeleteDescription: "{name} will be removed from this library.",
112
+ confirmDeleteLabel: "Delete asset",
113
+ confirmDeleteError: "Could not delete this asset. Try again."
108
114
  },
109
115
  upload: {
110
116
  dropTitle: "Drag files here or click to browse",
@@ -119,7 +125,8 @@ var Ce = {
119
125
  stagedCount: "{count} {count, plural, one {file} other {files}}",
120
126
  removeFile: "Remove {name}",
121
127
  uploading: "Uploading",
122
- done: "Done"
128
+ done: "Done",
129
+ error: "Could not upload these files. Try again."
123
130
  },
124
131
  footer: {
125
132
  pickOne: "Pick one item",
@@ -152,19 +159,19 @@ var Ce = {
152
159
  maxReached: "Maximum reached"
153
160
  }
154
161
  };
155
- function H(e, t) {
162
+ function U(e, t) {
156
163
  return e.replace(/\{(\w+), plural, one \{([^}]*)\} other \{([^}]*)\}\}/g, (e, n, r, i) => Number(t[n]) === 1 ? r : i).replace(/\{(\w+)\}/g, (e, n) => String(t[n] ?? ""));
157
164
  }
158
165
  //#endregion
159
166
  //#region src/components/features/media-library/hooks/use-media-library.ts
160
- var we = {
167
+ var Ee = {
161
168
  collection: void 0,
162
169
  tags: [],
163
170
  public: !0
164
- }, Te = [];
165
- function U(e, t, n) {
166
- let [r, i] = P(t), a = e ?? r;
167
- return [a, M((t) => {
171
+ }, De = [];
172
+ function Oe(e, t, n) {
173
+ let [r, i] = I(t), a = e ?? r;
174
+ return [a, N((t) => {
168
175
  let r = typeof t == "function" ? t(a) : t;
169
176
  e === void 0 && i(r), n?.(r);
170
177
  }, [
@@ -173,7 +180,7 @@ function U(e, t, n) {
173
180
  a
174
181
  ])];
175
182
  }
176
- var Ee = {
183
+ var ke = {
177
184
  getId: (e) => e.id,
178
185
  getName: (e) => e.name,
179
186
  getType: (e) => e.type,
@@ -191,47 +198,47 @@ var Ee = {
191
198
  getTint: (e) => e.tint,
192
199
  getMimeType: (e) => e.mimeType
193
200
  };
194
- function De(e) {
201
+ function Ae(e) {
195
202
  return {
196
- ...Ee,
203
+ ...ke,
197
204
  ...e
198
205
  };
199
206
  }
200
- function Oe(e) {
201
- return v(e) ?? "";
207
+ function je(e) {
208
+ return x(e) ?? "";
202
209
  }
203
- function ke(e, t) {
210
+ function Me(e, t) {
204
211
  let n = t.getWidth(e), r = t.getHeight(e);
205
212
  return !n || !r ? "" : `${n} x ${r}`;
206
213
  }
207
- function Ae(e, t) {
214
+ function Ne(e, t) {
208
215
  let n = t.getUploadedAt(e);
209
216
  if (!n) return 0;
210
217
  let r = (n instanceof Date ? n : new Date(n)).getTime();
211
218
  return Number.isFinite(r) ? r : 0;
212
219
  }
213
- function je(e) {
220
+ function Pe(e) {
214
221
  return e.type.startsWith("image/") ? "image" : e.type.startsWith("video/") ? "video" : "file";
215
222
  }
216
- function Me(e) {
223
+ function Fe(e) {
217
224
  if (e.type.startsWith("image/") && typeof URL < "u" && typeof URL.createObjectURL == "function") return URL.createObjectURL(e);
218
225
  }
219
- function Ne(e) {
226
+ function Ie(e) {
220
227
  e && typeof URL < "u" && typeof URL.revokeObjectURL == "function" && URL.revokeObjectURL(e);
221
228
  }
222
- function Pe(e) {
229
+ function Le(e) {
223
230
  return Array.isArray(e) ? {
224
231
  items: e,
225
232
  total: e.length
226
233
  } : e;
227
234
  }
228
- function Fe(e, t) {
235
+ function Re(e, t) {
229
236
  return t && typeof e == "object" && e ? {
230
237
  ...e,
231
238
  ...t
232
239
  } : e;
233
240
  }
234
- function Ie(e, t, n, r, i) {
241
+ function ze(e, t, n, r, i) {
235
242
  let a = n.trim().toLowerCase();
236
243
  return e.filter((e) => r !== "all" && t.getType(e) !== r || i !== "all" && t.getCollection(e) !== i ? !1 : !a || [
237
244
  t.getName(e),
@@ -240,324 +247,425 @@ function Ie(e, t, n, r, i) {
240
247
  ...t.getTags(e)
241
248
  ].filter(Boolean).join(" ").toLowerCase().includes(a));
242
249
  }
243
- function Le(e, t, n) {
250
+ function Be(e, t, n) {
244
251
  let r = e.slice();
245
- return n === "name" ? r.sort((e, n) => t.getName(e).localeCompare(t.getName(n))) : n === "size" ? r.sort((e, n) => (t.getSize(n) ?? 0) - (t.getSize(e) ?? 0)) : n === "usage" ? r.sort((e, n) => (t.getUsageCount(n) ?? 0) - (t.getUsageCount(e) ?? 0)) : r.sort((e, n) => Ae(n, t) - Ae(e, t)), r;
252
+ return n === "name" ? r.sort((e, n) => t.getName(e).localeCompare(t.getName(n))) : n === "size" ? r.sort((e, n) => (t.getSize(n) ?? 0) - (t.getSize(e) ?? 0)) : n === "usage" ? r.sort((e, n) => (t.getUsageCount(n) ?? 0) - (t.getUsageCount(e) ?? 0)) : r.sort((e, n) => Ne(n, t) - Ne(e, t)), r;
246
253
  }
247
- function Re({ items: e = Te, fetcher: t, accessors: n, selectionMode: r = "multiple", value: i, defaultValue: a = [], onValueChange: o, onItemUpdate: s, onItemDelete: c, onUpload: l, onError: u, tab: d, defaultTab: f = "library", onTabChange: p, view: m, defaultView: h = "grid", onViewChange: g, query: _, defaultQuery: v = "", onQueryChange: y, type: b, defaultType: x = "all", onTypeChange: S, collection: C, defaultCollection: ee = "all", onCollectionChange: w, sort: T, defaultSort: E = "newest", onSortChange: D, uploadOptions: O, defaultUploadOptions: k, onUploadOptionsChange: te, selecting: ne, defaultSelecting: A = !1, onSelectingChange: re } = {}) {
248
- let j = N(() => De(n), [n]), [ie, se] = U(d, f, p), [F, I] = U(m, h, g), [L, ce] = U(_, v, y), [R, z] = U(b, x, S), [B, le] = U(C, ee, w), [ue, de] = U(T, E, D), [fe, pe] = P(null), [me, he] = P(() => [...a]), [ge, _e] = P([]), [ve, ye] = P(), [be, xe] = P(!1), [Se, V] = P(null), [Ce, H] = P([]), [Ee, Oe] = P(() => /* @__PURE__ */ new Set()), [ke, Ae] = P({}), [Re, W] = P([]), [ze, Be] = P(!1), Ve = N(() => ({
249
- ...we,
250
- ...k,
251
- tags: k?.tags ?? we.tags
252
- }), [k]), [G, K] = U(N(() => O ? {
253
- ...we,
254
+ function Ve({ items: e = De, fetcher: t, refreshKey: n, accessors: r, selectionMode: i = "multiple", value: a, defaultValue: o = [], onValueChange: s, onItemUpdate: c, onItemDelete: l, onUpload: u, onError: d, tab: f, defaultTab: p = "library", onTabChange: m, view: h, defaultView: g = "grid", onViewChange: _, query: v, defaultQuery: y = "", onQueryChange: b, type: x, defaultType: S = "all", onTypeChange: C, collection: ee, defaultCollection: w = "all", onCollectionChange: T, sort: te, defaultSort: E = "newest", onSortChange: D, uploadOptions: O, defaultUploadOptions: ne, onUploadOptionsChange: k, selecting: re, defaultSelecting: A = !1, onSelectingChange: ie } = {}) {
255
+ let j = !!t, M = P(() => Ae(r), [r]), [ae, oe] = Oe(f, p, m), [ce, L] = Oe(h, g, _), [R, le] = Oe(v, y, b), [z, ue] = Oe(x, S, C), [B, de] = Oe(ee, w, T), [fe, pe] = Oe(te, E, D), [me, he] = I(null), [ge, _e] = I(() => [...o]), [V, ve] = I(null), [ye, be] = I(j), [xe, Se] = I(null), [Ce, we] = I(null), [Te, H] = I(null), [U, ke] = I(null), [je, Me] = I([]), [Ne, Ve] = I([]), [He, Ue] = I(() => /* @__PURE__ */ new Map()), [W, We] = I(() => /* @__PURE__ */ new Set()), [G, K] = I({}), [Ge, q] = I([]), Ke = F(Ge), qe = F(0), [Je, Ye] = I(!1), J = P(() => ({
256
+ ...Ee,
257
+ ...ne,
258
+ tags: ne?.tags ?? Ee.tags
259
+ }), [ne]), [Xe, Ze] = Oe(P(() => O ? {
260
+ ...Ee,
254
261
  ...O,
255
- tags: O.tags ?? we.tags
256
- } : void 0, [O]), Ve, te), q = i !== void 0, J = N(() => q ? [...i ?? []] : me, [
257
- me,
258
- q,
259
- i
260
- ]), Y = N(() => new Set(J), [J]), He = oe(/* @__PURE__ */ new Set()), X = oe(null), Z = oe(/* @__PURE__ */ new Map());
261
- ae(() => {
262
- if (!t) return;
263
- let e = new AbortController();
264
- return xe(!0), V(null), t({
265
- query: L,
266
- type: R,
267
- collection: B === "all" ? void 0 : B,
268
- sort: ue,
269
- signal: e.signal
270
- }).then((t) => {
271
- if (e.signal.aborted) return;
272
- let n = Pe(t);
273
- _e(n.items), ye(n.total);
274
- }).catch((t) => {
275
- e.signal.aborted || (V(t), u?.(t));
276
- }).finally(() => {
277
- e.signal.aborted || xe(!1);
278
- }), () => e.abort();
262
+ tags: O.tags ?? Ee.tags
263
+ } : void 0, [O]), J, k), Qe = a !== void 0, Y = P(() => Qe ? [...a ?? []] : ge, [
264
+ ge,
265
+ Qe,
266
+ a
267
+ ]), $e = P(() => new Set(Y), [Y]), et = F(/* @__PURE__ */ new Set()), tt = F(null), nt = F(/* @__PURE__ */ new Map()), [rt, it] = I(0), X = N(() => it((e) => e + 1), []), at = F({
268
+ fetcher: t,
269
+ onError: d
270
+ });
271
+ se(() => {
272
+ at.current = {
273
+ fetcher: t,
274
+ onError: d
275
+ };
276
+ }, [t, d]), se(() => {
277
+ let e = at.current.fetcher;
278
+ if (!j || !e) {
279
+ be(!1), we(null), ve(null), Ve((e) => e.length ? [] : e);
280
+ return;
281
+ }
282
+ let t = new AbortController();
283
+ return be(!0), Se(null), we(null), (async () => {
284
+ try {
285
+ let n = await e({
286
+ query: R,
287
+ type: z,
288
+ collection: B === "all" ? void 0 : B,
289
+ sort: fe,
290
+ signal: t.signal
291
+ });
292
+ t.signal.aborted || ve(Le(n));
293
+ } catch (e) {
294
+ if (t.signal.aborted) return;
295
+ Se(() => e), we(() => e ?? /* @__PURE__ */ Error("Media load failed")), at.current.onError?.(e);
296
+ } finally {
297
+ t.signal.aborted || be(!1);
298
+ }
299
+ })(), () => t.abort();
279
300
  }, [
280
301
  B,
281
- t,
282
- u,
283
- L,
284
- ue,
285
- R
286
- ]), ae(() => {
287
- let e = He.current;
302
+ rt,
303
+ j,
304
+ R,
305
+ n,
306
+ fe,
307
+ z
308
+ ]), se(() => {
309
+ if (!j || !V) return;
310
+ let e = new Set(V.items.map((e) => M.getId(e)));
311
+ Ve((t) => {
312
+ let n = t.filter((t) => !e.has(M.getId(t)));
313
+ return n.length === t.length ? t : n;
314
+ });
315
+ }, [
316
+ M,
317
+ V,
318
+ j
319
+ ]), se(() => {
320
+ let e = et.current;
288
321
  return () => {
289
- X.current?.abort();
290
- for (let t of e) Ne(t);
322
+ tt.current?.abort();
323
+ for (let t of e) Ie(t);
291
324
  e.clear();
292
325
  };
293
326
  }, []);
294
- let Ue = N(() => t ? ge : [...Ce, ...e], [
295
- Ce,
296
- ge,
297
- t,
298
- e
299
- ]), Q = N(() => Ue.filter((e) => !Ee.has(j.getId(e))).map((e) => Fe(e, ke[j.getId(e)])), [
300
- j,
301
- ke,
302
- Ee,
303
- Ue
304
- ]), We = N(() => {
305
- let e = t ? Q : Ie(Q, j, L, R, B);
306
- return t ? e : Le(e, j, ue);
327
+ let Z = V?.items ?? De, ot = P(() => {
328
+ let e = new Set(Z.map((e) => M.getId(e)));
329
+ return ze(Ne.filter((t) => {
330
+ let n = M.getId(t);
331
+ return !e.has(n) && !W.has(n);
332
+ }), M, R, z, B);
307
333
  }, [
334
+ M,
335
+ B,
336
+ R,
337
+ W,
338
+ Z,
339
+ Ne,
340
+ z
341
+ ]), st = P(() => j ? [...ot, ...Z] : [...je, ...e], [
342
+ je,
308
343
  j,
344
+ e,
345
+ ot,
346
+ Z
347
+ ]), ct = P(() => st.filter((e) => !W.has(M.getId(e))).map((e) => Re(e, G[M.getId(e)])), [
348
+ M,
349
+ G,
350
+ W,
351
+ st
352
+ ]), lt = P(() => j ? ct : Be(ze(ct, M, R, z, B), M, fe), [
353
+ M,
309
354
  B,
310
- t,
311
- Q,
312
- L,
313
- ue,
314
- R
315
- ]), Ge = ve ?? Q.length, Ke = We.length, qe = N(() => Q.filter((e) => Y.has(j.getId(e))), [
316
355
  j,
317
- Q,
356
+ ct,
357
+ R,
358
+ fe,
359
+ z
360
+ ]), ut = j && V?.total !== void 0 ? V.total + ot.length : ct.length, dt = lt.length, ft = P(() => new Map([...Ne, ...Z].map((e) => [M.getId(e), e])), [
361
+ M,
362
+ Z,
363
+ Ne
364
+ ]);
365
+ se(() => {
366
+ Ue((e) => {
367
+ let t = /* @__PURE__ */ new Map();
368
+ if (j) for (let n of Y) {
369
+ let r = ft.get(n) ?? e.get(n);
370
+ r !== void 0 && t.set(n, r);
371
+ }
372
+ return t.size === e.size && [...t].every(([t, n]) => e.get(t) === n) ? e : t;
373
+ });
374
+ }, [
375
+ j,
376
+ ft,
318
377
  Y
319
- ]), Je = !!L.trim() || R !== "all" || B !== "all", $ = M((e) => {
320
- q || he(e);
321
- let t = new Set(e), n = Q.filter((e) => t.has(j.getId(e)));
322
- o?.(e, n);
378
+ ]);
379
+ let pt = N((e, t = []) => {
380
+ if (!j) {
381
+ let n = new Set(e);
382
+ return [...t, ...ct].filter((e) => n.delete(M.getId(e)));
383
+ }
384
+ let n = new Map(t.map((e) => [M.getId(e), e]));
385
+ return e.flatMap((e) => {
386
+ if (W.has(e)) return [];
387
+ let t = n.get(e) ?? ft.get(e) ?? He.get(e);
388
+ return t === void 0 ? [] : [Re(t, G[e])];
389
+ });
323
390
  }, [
391
+ M,
324
392
  j,
325
- q,
326
- o,
327
- Q
328
- ]), Ye = M((e) => {
329
- let t = new Set(r === "single" ? [] : Y);
330
- Y.has(e) && r !== "single" ? t.delete(e) : t.add(e), $(Array.from(t));
393
+ G,
394
+ ft,
395
+ ct,
396
+ W,
397
+ He
398
+ ]), mt = P(() => pt(Y), [pt, Y]), ht = !!R.trim() || z !== "all" || B !== "all", Q = N((e, t) => {
399
+ Qe || _e(e), s?.(e, pt(e, t));
331
400
  }, [
332
- $,
333
- Y,
334
- r
335
- ]), Xe = M(() => $([]), [$]), [Ze, Qe] = U(ne, A, re), $e = Ze || J.length > 0, et = M((e) => {
336
- Qe(e), !e && J.length > 0 && $([]);
401
+ Qe,
402
+ s,
403
+ pt
404
+ ]), gt = F({
405
+ applySelection: Q,
406
+ selectedIds: Y
407
+ });
408
+ se(() => {
409
+ gt.current = {
410
+ applySelection: Q,
411
+ selectedIds: Y
412
+ };
413
+ }, [Q, Y]);
414
+ let _t = N((e) => {
415
+ let t = new Set(i === "single" ? [] : $e);
416
+ $e.has(e) && i !== "single" ? t.delete(e) : t.add(e), Q(Array.from(t));
337
417
  }, [
338
- $,
339
- J.length,
340
- Qe
341
- ]), tt = M(() => {
342
- ce(""), z("all"), le("all");
418
+ Q,
419
+ $e,
420
+ i
421
+ ]), vt = N(() => Q([]), [Q]), [yt, bt] = Oe(re, A, ie), xt = yt || Y.length > 0, St = N((e) => {
422
+ bt(e), !e && Y.length > 0 && Q([]);
343
423
  }, [
424
+ Q,
425
+ Y.length,
426
+ bt
427
+ ]), Ct = N(() => {
428
+ le(""), ue("all"), de("all");
429
+ }, [
430
+ de,
344
431
  le,
345
- ce,
346
- z
347
- ]), nt = M((e) => {
348
- W((t) => [...t, ...e.map((e, t) => {
349
- let n = Me(e);
350
- return n && He.current.add(n), {
351
- id: `staged-${Date.now()}-${t}`,
432
+ ue
433
+ ]), $ = N((e) => {
434
+ let t = e(Ke.current);
435
+ Ke.current = t, q(t);
436
+ }, []), wt = N((e) => {
437
+ e && (Ie(e), et.current.delete(e));
438
+ }, []), Tt = N((e) => {
439
+ if (e.length === 0) return;
440
+ ke(null);
441
+ let t = e.map((e) => {
442
+ let t = Fe(e);
443
+ return t && et.current.add(t), {
444
+ id: `staged-${qe.current++}`,
352
445
  file: e,
353
446
  name: e.name,
354
447
  size: e.size,
355
- type: je(e),
356
- src: n,
448
+ type: Pe(e),
449
+ src: t,
357
450
  progress: 0,
358
451
  status: "staged"
359
452
  };
360
- })]);
361
- }, []), rt = M((e) => {
362
- W((t) => {
363
- let n = t.find((t) => t.id === e);
364
- return n?.src && (Ne(n.src), He.current.delete(n.src)), t.filter((t) => t.id !== e);
365
453
  });
366
- }, []), it = M(() => {
367
- W((e) => {
368
- for (let t of e) t.src && (Ne(t.src), He.current.delete(t.src));
454
+ $((e) => [...e, ...t]);
455
+ }, [$]), Et = N((e) => {
456
+ $((t) => (wt(t.find((t) => t.id === e)?.src), t.filter((t) => t.id !== e)));
457
+ }, [wt, $]), Dt = N(() => {
458
+ ke(null), $((e) => {
459
+ for (let t of e) wt(t.src);
369
460
  return [];
370
461
  });
371
- }, []), at = M((e) => {
372
- K((t) => ({
462
+ }, [wt, $]), Ot = N((e) => {
463
+ Ze((t) => ({
373
464
  ...t,
374
465
  ...e
375
466
  }));
376
- }, [K]), ot = M((e, t) => {
377
- W((n) => n.map((n) => n.id === e ? {
467
+ }, [Ze]), kt = N((e, t) => {
468
+ $((n) => n.map((n) => n.id === e ? {
378
469
  ...n,
379
470
  ...t
380
471
  } : n));
381
- }, []);
382
- return {
383
- tab: ie,
384
- setTab: se,
385
- view: F,
386
- setView: I,
387
- query: L,
388
- setQuery: ce,
389
- type: R,
390
- setType: z,
391
- collection: B,
392
- setCollection: le,
393
- sort: ue,
394
- setSort: de,
395
- detailId: fe,
396
- setDetailId: pe,
397
- items: Q,
398
- visibleItems: We,
399
- selectedIds: J,
400
- selectedItems: qe,
401
- selectedSet: Y,
402
- toggleSelection: Ye,
403
- clearSelection: Xe,
404
- selecting: $e,
405
- setSelecting: et,
406
- clearFilters: tt,
407
- loading: be,
408
- error: Se,
409
- hasFilters: Je,
410
- totalCount: Ge,
411
- filteredCount: Ke,
412
- stagedFiles: Re,
413
- addFiles: nt,
414
- removeStagedFile: rt,
415
- clearStagedFiles: it,
416
- updateUploadOptions: at,
417
- uploadOptions: G,
418
- uploading: ze,
419
- startUpload: M(async () => {
420
- if (ze || Re.length === 0) return;
421
- let e = new AbortController();
422
- X.current?.abort(), X.current = e, V(null), Be(!0), W((e) => e.map((e) => ({
423
- ...e,
424
- status: "uploading",
425
- progress: 0
426
- })));
427
- let t = {
428
- signal: e.signal,
429
- setProgress: (t, n) => {
430
- e.signal.aborted || ot(t, { progress: Math.max(0, Math.min(100, n)) });
431
- },
432
- setFileStatus: (t, n, r) => {
433
- e.signal.aborted || ot(t, {
434
- status: n,
435
- error: r
436
- });
437
- }
438
- };
439
- try {
440
- let n = Re.map((e) => e.file), i = await l?.(n, G, t);
441
- if (e.signal.aborted) return;
442
- if (W((e) => e.map((e) => ({
443
- ...e,
444
- status: "done",
445
- progress: 100
446
- }))), i?.length) {
447
- H((e) => [...i, ...e]);
448
- let e = i.map((e) => j.getId(e));
449
- $(r === "single" ? e.slice(0, 1) : Array.from(/* @__PURE__ */ new Set([...e, ...J])));
450
- }
451
- it(), se("library");
452
- } catch (t) {
453
- if (e.signal.aborted) return;
454
- V(t), W((e) => e.map((e) => e.status === "uploading" ? {
455
- ...e,
456
- status: "error",
457
- error: "Upload failed"
458
- } : e)), u?.(t);
459
- } finally {
460
- X.current === e && (X.current = null, Be(!1));
472
+ }, [$]), At = N(async () => {
473
+ let e = Ke.current;
474
+ if (tt.current || e.length === 0) return;
475
+ let t = e.map((e) => e.id), n = new Set(t), r = new AbortController();
476
+ tt.current = r, Se(null), ke(null), Ye(!0), $((e) => e.map((e) => n.has(e.id) ? {
477
+ ...e,
478
+ status: "uploading",
479
+ progress: 0,
480
+ error: void 0
481
+ } : e));
482
+ let a = (e) => !r.signal.aborted && tt.current === r && n.has(e), o = {
483
+ signal: r.signal,
484
+ fileIds: t,
485
+ setProgress: (e, t) => {
486
+ a(e) && kt(e, { progress: Math.max(0, Math.min(100, t)) });
487
+ },
488
+ setFileStatus: (e, t, n) => {
489
+ a(e) && kt(e, {
490
+ status: t,
491
+ error: n
492
+ });
461
493
  }
462
- }, [
463
- j,
464
- $,
465
- it,
466
- u,
467
- l,
468
- J,
469
- r,
470
- se,
471
- ot,
472
- Re,
473
- G,
474
- ze
475
- ]),
476
- cancelUpload: M(() => {
477
- X.current?.abort(), X.current = null, Be(!1), W((e) => e.map((e) => e.status === "uploading" ? {
478
- ...e,
479
- status: "staged",
480
- progress: 0,
481
- error: void 0
482
- } : e));
483
- }, []),
484
- updateItem: M(async (e, t) => {
485
- let n = j.getId(e), r = `update:${n}`, i = (Z.current.get(r) ?? 0) + 1;
486
- Z.current.set(r, i);
487
- let a = ke[n];
488
- V(null), Ae((e) => ({
489
- ...e,
490
- [n]: {
491
- ...e[n],
492
- ...t
493
- }
494
- }));
495
- try {
496
- return await s?.(e, t), !0;
497
- } catch (e) {
498
- return Z.current.get(r) === i && Ae((e) => {
499
- let t = { ...e };
500
- return a ? t[n] = a : delete t[n], t;
501
- }), V(e), u?.(e), !1;
494
+ };
495
+ try {
496
+ let t = e.map((e) => e.file), a = await u?.(t, Xe, o);
497
+ if (r.signal.aborted) return;
498
+ if ($((e) => e.filter((e) => !n.has(e.id) || e.status === "error" || (wt(e.src), !1))), a?.length) {
499
+ let e = a.map((e) => M.getId(e));
500
+ if (j) {
501
+ let t = new Set(e);
502
+ Ve((e) => [...a, ...e.filter((e) => !t.has(M.getId(e)))]);
503
+ } else Me((e) => [...a, ...e]);
504
+ let t = gt.current;
505
+ t.applySelection(i === "single" ? e.slice(0, 1) : Array.from(/* @__PURE__ */ new Set([...e, ...t.selectedIds])), a);
502
506
  }
503
- }, [
504
- j,
505
- ke,
506
- u,
507
- s
508
- ]),
509
- removeItem: M(async (e) => {
510
- let t = j.getId(e), n = `delete:${t}`, r = (Z.current.get(n) ?? 0) + 1;
511
- Z.current.set(n, r);
512
- let i = Ee.has(t);
513
- V(null), Oe((e) => new Set(e).add(t));
514
- try {
515
- return await c?.(e), Y.has(t) && $(J.filter((e) => e !== t)), !0;
516
- } catch (e) {
517
- return !i && Z.current.get(n) === r && Oe((e) => {
518
- let n = new Set(e);
519
- return n.delete(t), n;
520
- }), V(e), u?.(e), !1;
507
+ j && u && X(), Ke.current.length === 0 && oe("library");
508
+ } catch (e) {
509
+ if (r.signal.aborted) return;
510
+ Se(() => e), ke(() => e ?? /* @__PURE__ */ Error("Media upload failed")), $((e) => e.map((e) => n.has(e.id) && e.status === "uploading" ? {
511
+ ...e,
512
+ status: "error",
513
+ error: "Upload failed"
514
+ } : e)), d?.(e);
515
+ } finally {
516
+ tt.current === r && (tt.current = null, Ye(!1));
517
+ }
518
+ }, [
519
+ M,
520
+ j,
521
+ d,
522
+ u,
523
+ wt,
524
+ X,
525
+ i,
526
+ oe,
527
+ kt,
528
+ $,
529
+ Xe
530
+ ]), jt = N(() => {
531
+ tt.current?.abort(), tt.current = null, Ye(!1), $((e) => e.map((e) => e.status === "uploading" ? {
532
+ ...e,
533
+ status: "staged",
534
+ progress: 0,
535
+ error: void 0
536
+ } : e));
537
+ }, [$]), Mt = N(async (e, t) => {
538
+ if (!c) return !1;
539
+ let n = M.getId(e), r = `update:${n}`, i = (nt.current.get(r) ?? 0) + 1;
540
+ nt.current.set(r, i);
541
+ let a = G[n];
542
+ Se(null), H((e) => e?.itemId === n ? null : e), K((e) => ({
543
+ ...e,
544
+ [n]: {
545
+ ...e[n],
546
+ ...t
521
547
  }
522
- }, [
523
- j,
524
- $,
525
- u,
526
- c,
527
- Ee,
528
- J,
529
- Y
530
- ]),
531
- accessors: j
548
+ }));
549
+ try {
550
+ return await c(e, t), !0;
551
+ } catch (e) {
552
+ return nt.current.get(r) === i && (H({
553
+ itemId: n,
554
+ operation: "update",
555
+ cause: e
556
+ }), K((e) => {
557
+ let t = { ...e };
558
+ return a ? t[n] = a : delete t[n], t;
559
+ })), Se(() => e), d?.(e), !1;
560
+ }
561
+ }, [
562
+ M,
563
+ G,
564
+ d,
565
+ c
566
+ ]), Nt = N(async (e) => {
567
+ if (!l) return !1;
568
+ let t = M.getId(e), n = `delete:${t}`, r = (nt.current.get(n) ?? 0) + 1;
569
+ nt.current.set(n, r);
570
+ let i = W.has(t);
571
+ Se(null), H((e) => e?.itemId === t ? null : e), We((e) => new Set(e).add(t));
572
+ try {
573
+ return await l(e), $e.has(t) && Q(Y.filter((e) => e !== t)), !0;
574
+ } catch (e) {
575
+ return nt.current.get(n) === r && (H({
576
+ itemId: t,
577
+ operation: "delete",
578
+ cause: e
579
+ }), i || We((e) => {
580
+ let n = new Set(e);
581
+ return n.delete(t), n;
582
+ })), Se(() => e), d?.(e), !1;
583
+ }
584
+ }, [
585
+ M,
586
+ Q,
587
+ d,
588
+ l,
589
+ W,
590
+ Y,
591
+ $e
592
+ ]);
593
+ return {
594
+ tab: ae,
595
+ setTab: oe,
596
+ view: ce,
597
+ setView: L,
598
+ query: R,
599
+ setQuery: le,
600
+ type: z,
601
+ setType: ue,
602
+ collection: B,
603
+ setCollection: de,
604
+ sort: fe,
605
+ setSort: pe,
606
+ detailId: me,
607
+ setDetailId: he,
608
+ items: ct,
609
+ visibleItems: lt,
610
+ selectedIds: Y,
611
+ selectedItems: mt,
612
+ selectedSet: $e,
613
+ toggleSelection: _t,
614
+ clearSelection: vt,
615
+ selecting: xt,
616
+ setSelecting: St,
617
+ clearFilters: Ct,
618
+ loading: ye,
619
+ hasLoadedResults: j && (V !== null || ot.length > 0),
620
+ error: xe,
621
+ loadError: Ce,
622
+ mutationError: Te,
623
+ uploadError: U,
624
+ retry: X,
625
+ hasFilters: ht,
626
+ totalCount: ut,
627
+ filteredCount: dt,
628
+ stagedFiles: Ge,
629
+ addFiles: Tt,
630
+ removeStagedFile: Et,
631
+ clearStagedFiles: Dt,
632
+ updateUploadOptions: Ot,
633
+ uploadOptions: Xe,
634
+ uploading: Je,
635
+ startUpload: At,
636
+ cancelUpload: jt,
637
+ updateItem: Mt,
638
+ removeItem: Nt,
639
+ accessors: M
532
640
  };
533
641
  }
534
642
  //#endregion
535
643
  //#region src/components/features/media-library/partials/media-library-partials.tsx
536
- var W = `${_.nativeButtonReset} absolute inset-0 z-10 block h-full w-full cursor-pointer outline-none ${s.inset}`, ze = "media-library-card--check absolute left-2 top-2 inline-flex size-icon-lg items-center justify-center rounded-radius border border-border bg-background p-0 text-transparent shadow-xs", Be = "border-primary bg-primary text-primary-foreground opacity-100";
537
- function Ve(e, t) {
538
- return F(e === "image" ? le : e === "video" ? xe : z, { className: t ?? "size-icon" });
644
+ var He = `${b.nativeButtonReset} absolute inset-0 z-10 block h-full w-full cursor-pointer outline-none ${s.inset}`, Ue = "media-library-card--check absolute left-2 top-2 inline-flex size-icon-lg items-center justify-center rounded-radius border border-border bg-background p-0 text-transparent shadow-xs", W = "border-primary bg-primary text-primary-foreground opacity-100";
645
+ function We(e, t) {
646
+ return L(e === "image" ? fe : e === "video" ? Ce : B, { className: t ?? "size-icon" });
539
647
  }
540
648
  function G(e, t) {
541
649
  return e === "image" ? t.typeImage : e === "video" ? t.typeVideo : t.typeFile;
542
650
  }
543
651
  function K(e, t) {
544
- return e ? H(t.usedIn, { count: e }) : t.notUsed;
652
+ return e ? U(t.usedIn, { count: e }) : t.notUsed;
545
653
  }
546
- function q({ children: e, tint: t, className: n }) {
547
- return /* @__PURE__ */ F("div", {
654
+ function Ge({ children: e, tint: t, className: n }) {
655
+ return /* @__PURE__ */ L("div", {
548
656
  className: r("media-library-preview relative overflow-hidden bg-muted", n),
549
657
  style: t ? { background: t } : void 0,
550
658
  children: e
551
659
  });
552
660
  }
553
- function J({ src: e, alt: t, type: n, className: r, loading: i = "lazy" }) {
554
- let [a, o] = P(!1);
555
- return ae(() => {
661
+ function q({ src: e, alt: t, type: n, className: r, loading: i = "lazy" }) {
662
+ let [a, o] = I(!1);
663
+ return se(() => {
556
664
  o(!1);
557
- }, [e]), !e || a ? /* @__PURE__ */ F("div", {
665
+ }, [e]), !e || a ? /* @__PURE__ */ L("div", {
558
666
  className: "media-library-preview--fallback flex size-full items-center justify-center text-muted-foreground",
559
- children: Ve(n, "size-6")
560
- }) : /* @__PURE__ */ F("img", {
667
+ children: We(n, "size-6")
668
+ }) : /* @__PURE__ */ L("img", {
561
669
  src: e,
562
670
  alt: t,
563
671
  loading: i,
@@ -565,12 +673,12 @@ function J({ src: e, alt: t, type: n, className: r, loading: i = "lazy" }) {
565
673
  onError: () => o(!0)
566
674
  });
567
675
  }
568
- function Y({ icon: e, title: t, description: n, action: i, className: a }) {
569
- return /* @__PURE__ */ F(re, {
676
+ function Ke({ icon: e, title: t, description: n, action: i, className: a }) {
677
+ return /* @__PURE__ */ L(M, {
570
678
  title: t,
571
679
  description: n ?? !1,
572
680
  actions: i,
573
- media: e ?? /* @__PURE__ */ F(le, {
681
+ media: e ?? /* @__PURE__ */ L(fe, {
574
682
  className: "size-icon",
575
683
  "aria-hidden": "true"
576
684
  }),
@@ -580,8 +688,8 @@ function Y({ icon: e, title: t, description: n, action: i, className: a }) {
580
688
  className: r("media-library-empty-state--component min-h-64 bg-muted/30", a)
581
689
  });
582
690
  }
583
- function He({ query: n, type: o, typeFilters: s, collection: c, sort: u, view: d, collections: f = [], strings: p, onQueryChange: m, onTypeChange: h, onCollectionChange: g, onSortChange: v, onViewChange: y, onClearFilters: b, toolbarEnd: x, selecting: S = !1, onSelectingChange: ee }) {
584
- let { defaultScale: T } = e(), E = t(void 0, T), te = [
691
+ function qe({ query: n, type: o, typeFilters: s, collection: c, sort: u, view: d, collections: f = [], strings: p, onQueryChange: m, onTypeChange: h, onCollectionChange: g, onSortChange: _, onViewChange: v, onClearFilters: y, toolbarEnd: x, selecting: S = !1, onSelectingChange: C, summary: ee, disabled: w = !1 }) {
692
+ let { defaultScale: te } = t(), D = e(void 0, te), O = [
585
693
  {
586
694
  value: "all",
587
695
  label: p.allTypes,
@@ -590,29 +698,29 @@ function He({ query: n, type: o, typeFilters: s, collection: c, sort: u, view: d
590
698
  {
591
699
  value: "image",
592
700
  label: p.images,
593
- icon: le
701
+ icon: fe
594
702
  },
595
703
  {
596
704
  value: "video",
597
705
  label: p.videos,
598
- icon: xe
706
+ icon: Ce
599
707
  },
600
708
  {
601
709
  value: "file",
602
710
  label: p.files,
603
- icon: z
711
+ icon: B
604
712
  }
605
713
  ].filter((e) => (s ?? [
606
714
  "all",
607
715
  "image",
608
716
  "video"
609
- ]).includes(e.value)), ne = [{
717
+ ]).includes(e.value)), A = [{
610
718
  value: "all",
611
719
  label: p.allCollections
612
720
  }, ...f.map((e) => ({
613
721
  value: e.value,
614
722
  label: String(e.label)
615
- }))], A = [
723
+ }))], ie = [
616
724
  {
617
725
  value: "newest",
618
726
  label: p.sortNewest
@@ -629,235 +737,264 @@ function He({ query: n, type: o, typeFilters: s, collection: c, sort: u, view: d
629
737
  value: "usage",
630
738
  label: p.sortUsage
631
739
  }
632
- ], re = n.trim(), j = re.length > 0, M = j || o !== "all" || c !== "all";
633
- return /* @__PURE__ */ I(l, {
740
+ ], j = n.trim(), M = j.length > 0, ae = M || o !== "all" || c !== "all";
741
+ return /* @__PURE__ */ R(l, {
634
742
  direction: "horizontal",
635
743
  wrap: !0,
636
744
  align: "start",
637
745
  gap: "md",
638
746
  className: "media-library-toolbar--component",
639
- children: [
640
- /* @__PURE__ */ I(l, {
641
- gap: "xs",
642
- className: "media-library-toolbar--search min-w-52 flex-1",
643
- children: [/* @__PURE__ */ F(w, {
644
- value: n,
645
- onChange: (e) => m(e.target.value),
646
- placeholder: p.searchPlaceholder,
647
- startIcon: _e,
648
- clearable: !0,
649
- onClear: () => m(""),
650
- strings: { clear: p.clearSearch },
651
- className: "bg-background"
652
- }), !!j && /* @__PURE__ */ F(l, {
653
- direction: "horizontal",
747
+ children: [/* @__PURE__ */ R(l, {
748
+ direction: "horizontal",
749
+ wrap: !0,
750
+ align: "start",
751
+ gap: "md",
752
+ className: "media-library-toolbar--filters min-w-0 grow basis-80",
753
+ children: [
754
+ /* @__PURE__ */ R(l, {
654
755
  gap: "xs",
655
- wrap: !1,
656
- className: "media-library-toolbar--search-value px-space-xs",
657
- children: /* @__PURE__ */ I(C, {
658
- tone: "secondary",
659
- className: "max-w-full",
660
- children: [/* @__PURE__ */ F(a, {
661
- tag: "span",
662
- size: "inherit",
663
- className: "text-current",
664
- children: p.activeSearchLabel
665
- }), /* @__PURE__ */ F(a, {
666
- tag: "span",
667
- size: "inherit",
668
- weight: "normal",
669
- className: "min-w-0 truncate text-current",
670
- children: re
671
- })]
756
+ className: "media-library-toolbar--search min-w-52 flex-1",
757
+ children: [/* @__PURE__ */ L(E, {
758
+ value: n,
759
+ onChange: (e) => m(e.target.value),
760
+ placeholder: p.searchPlaceholder,
761
+ startIcon: ye,
762
+ clearable: !0,
763
+ onClear: () => m(""),
764
+ strings: { clear: p.clearSearch },
765
+ disabled: w,
766
+ className: "bg-background"
767
+ }), !!M && /* @__PURE__ */ L(l, {
768
+ direction: "horizontal",
769
+ gap: "xs",
770
+ wrap: !1,
771
+ className: "media-library-toolbar--search-value px-space-xs",
772
+ children: /* @__PURE__ */ R(T, {
773
+ tone: "secondary",
774
+ className: "max-w-full",
775
+ children: [/* @__PURE__ */ L(a, {
776
+ tag: "span",
777
+ size: "inherit",
778
+ className: "text-current",
779
+ children: p.activeSearchLabel
780
+ }), /* @__PURE__ */ L(a, {
781
+ tag: "span",
782
+ size: "inherit",
783
+ weight: "normal",
784
+ className: "min-w-0 truncate text-current",
785
+ children: j
786
+ })]
787
+ })
788
+ })]
789
+ }),
790
+ /* @__PURE__ */ L("div", {
791
+ className: r("media-library-toolbar--type-toggle shrink-0", k.frame, re[D]),
792
+ role: "tablist",
793
+ "aria-label": p.typeFilterLabel,
794
+ children: O.map((e) => {
795
+ let t = e.icon, n = o === e.value;
796
+ return /* @__PURE__ */ R(i, {
797
+ type: "button",
798
+ role: "tab",
799
+ "aria-selected": n,
800
+ tone: "secondary",
801
+ buttonStyle: "ghost",
802
+ size: "sm",
803
+ disabled: w,
804
+ className: r(k.item, "shadow-none", n ? `${b.segmentActive} hover:bg-card` : "text-muted-foreground hover:bg-transparent hover:text-foreground"),
805
+ onClick: () => h(e.value),
806
+ children: [t && /* @__PURE__ */ L(t, { className: "size-icon-md" }), /* @__PURE__ */ L(a, {
807
+ tag: "span",
808
+ size: "xs",
809
+ weight: "medium",
810
+ className: "text-inherit",
811
+ children: e.label
812
+ })]
813
+ }, e.value);
672
814
  })
673
- })]
674
- }),
675
- /* @__PURE__ */ F("div", {
676
- className: r("media-library-toolbar--type-toggle", O.frame, k[E]),
677
- role: "tablist",
678
- "aria-label": p.typeFilterLabel,
679
- children: te.map((e) => {
680
- let t = e.icon, n = o === e.value;
681
- return /* @__PURE__ */ I(i, {
815
+ }),
816
+ /* @__PURE__ */ R(l, {
817
+ direction: "horizontal",
818
+ gap: "md",
819
+ wrap: !0,
820
+ className: "media-library-toolbar--selects min-w-0",
821
+ children: [/* @__PURE__ */ L("div", {
822
+ className: "min-w-40 grow",
823
+ children: /* @__PURE__ */ L(ne, {
824
+ value: c,
825
+ options: A,
826
+ onValueChange: (e) => g(e ?? "all"),
827
+ placeholder: p.collectionFilterLabel,
828
+ "aria-label": p.collectionFilterLabel,
829
+ disabled: w,
830
+ className: "bg-background"
831
+ })
832
+ }), /* @__PURE__ */ L("div", {
833
+ className: "min-w-32 grow",
834
+ children: /* @__PURE__ */ L(ne, {
835
+ value: u,
836
+ options: ie,
837
+ onValueChange: (e) => _(e ?? "newest"),
838
+ placeholder: p.sortLabel,
839
+ "aria-label": p.sortLabel,
840
+ disabled: w,
841
+ className: "bg-background"
842
+ })
843
+ })]
844
+ }),
845
+ !!ae && /* @__PURE__ */ L(i, {
846
+ type: "button",
847
+ tone: "secondary",
848
+ buttonStyle: "ghost",
849
+ disabled: w,
850
+ onClick: y,
851
+ children: p.clearFilters
852
+ })
853
+ ]
854
+ }), /* @__PURE__ */ R(l, {
855
+ direction: "horizontal",
856
+ align: "center",
857
+ gap: "md",
858
+ wrap: !1,
859
+ className: "media-library-toolbar--view ms-auto min-w-0 max-w-full",
860
+ children: [
861
+ ee,
862
+ /* @__PURE__ */ R("div", {
863
+ className: r("media-library-toolbar--view-toggle shrink-0", k.frame, re[D]),
864
+ children: [/* @__PURE__ */ L(i, {
682
865
  type: "button",
683
- role: "tab",
684
- "aria-selected": n,
685
- tone: "secondary",
686
- buttonStyle: "ghost",
866
+ tone: d === "grid" ? "neutral" : "secondary",
867
+ buttonStyle: d === "grid" ? "solid" : "ghost",
687
868
  size: "sm",
688
- className: r(O.item, "shadow-none", n ? `${_.segmentActive} hover:bg-card` : "text-muted-foreground hover:bg-transparent hover:text-foreground"),
689
- onClick: () => h(e.value),
690
- children: [t && /* @__PURE__ */ F(t, { className: "size-icon-md" }), /* @__PURE__ */ F(a, {
691
- tag: "span",
692
- size: "xs",
693
- weight: "medium",
694
- className: "text-inherit",
695
- children: e.label
696
- })]
697
- }, e.value);
698
- })
699
- }),
700
- /* @__PURE__ */ F("div", {
701
- className: "min-w-40",
702
- children: /* @__PURE__ */ F(D, {
703
- value: c,
704
- options: ne,
705
- onValueChange: (e) => g(e ?? "all"),
706
- placeholder: p.collectionFilterLabel,
707
- "aria-label": p.collectionFilterLabel,
708
- className: "bg-background"
709
- })
710
- }),
711
- /* @__PURE__ */ F("div", {
712
- className: "min-w-32",
713
- children: /* @__PURE__ */ F(D, {
714
- value: u,
715
- options: A,
716
- onValueChange: (e) => v(e ?? "newest"),
717
- placeholder: p.sortLabel,
718
- "aria-label": p.sortLabel,
719
- className: "bg-background"
720
- })
721
- }),
722
- /* @__PURE__ */ I("div", {
723
- className: r("media-library-toolbar--view-toggle ml-auto", O.frame, k[E]),
724
- children: [/* @__PURE__ */ F(i, {
725
- type: "button",
726
- tone: d === "grid" ? "neutral" : "secondary",
727
- buttonStyle: d === "grid" ? "solid" : "ghost",
728
- size: "sm",
729
- iconOnly: !0,
730
- className: r(O.item, d === "grid" && `${_.segmentActive} hover:bg-card`),
731
- "aria-label": p.gridView,
732
- onClick: () => y("grid"),
733
- children: /* @__PURE__ */ F(B, { className: "size-icon-md" })
734
- }), /* @__PURE__ */ F(i, {
869
+ iconOnly: !0,
870
+ disabled: w,
871
+ className: r(k.item, d === "grid" && `${b.segmentActive} hover:bg-card`),
872
+ "aria-label": p.gridView,
873
+ onClick: () => v("grid"),
874
+ children: /* @__PURE__ */ L(de, { className: "size-icon-md" })
875
+ }), /* @__PURE__ */ L(i, {
876
+ type: "button",
877
+ tone: d === "table" ? "neutral" : "secondary",
878
+ buttonStyle: d === "table" ? "solid" : "ghost",
879
+ size: "sm",
880
+ iconOnly: !0,
881
+ disabled: w,
882
+ className: r(k.item, d === "table" && `${b.segmentActive} hover:bg-card`),
883
+ "aria-label": p.tableView,
884
+ onClick: () => v("table"),
885
+ children: /* @__PURE__ */ L(ge, { className: "size-icon-md" })
886
+ })]
887
+ }),
888
+ !!C && /* @__PURE__ */ L(i, {
735
889
  type: "button",
736
- tone: d === "table" ? "neutral" : "secondary",
737
- buttonStyle: d === "table" ? "solid" : "ghost",
738
- size: "sm",
739
- iconOnly: !0,
740
- className: r(O.item, d === "table" && `${_.segmentActive} hover:bg-card`),
741
- "aria-label": p.tableView,
742
- onClick: () => y("table"),
743
- children: /* @__PURE__ */ F(pe, { className: "size-icon-md" })
744
- })]
745
- }),
746
- !!M && /* @__PURE__ */ F(i, {
747
- type: "button",
748
- tone: "secondary",
749
- buttonStyle: "ghost",
750
- onClick: b,
751
- children: p.clearFilters
752
- }),
753
- !!ee && /* @__PURE__ */ F(i, {
754
- type: "button",
755
- "aria-pressed": S,
756
- tone: "secondary",
757
- buttonStyle: "outline",
758
- className: r("media-library-toolbar--select", S && _.togglePressed),
759
- onClick: () => ee(!S),
760
- children: p.selectMode
761
- }),
762
- x
763
- ]
890
+ "aria-pressed": S,
891
+ tone: "secondary",
892
+ buttonStyle: "outline",
893
+ disabled: w,
894
+ className: r("media-library-toolbar--select shrink-0", S && b.togglePressed),
895
+ onClick: () => C(!S),
896
+ children: p.selectMode
897
+ }),
898
+ x
899
+ ]
900
+ })]
764
901
  });
765
902
  }
766
- function X({ item: e, selected: t = !1, density: n = "comfortable", showMeta: o = !0, accessors: u, strings: d, onToggle: f, onDetails: p, onOpen: m, selecting: h = !1, className: g }) {
767
- let v = u.getType(e), b = u.getName(e), x = u.getSrc(e), S = u.getAlt(e) || b, ee = u.getSize(e), w = u.getUsageCount(e), T = u.getPublic(e) === !1, E = u.getDuration(e), D = !!m && !h, O = D ? m : f;
768
- return /* @__PURE__ */ I("div", {
903
+ function Je({ item: e, selected: t = !1, density: n = "comfortable", showMeta: o = !0, accessors: u, strings: d, onToggle: f, onDetails: p, onOpen: m, selecting: h = !1, className: g }) {
904
+ let _ = u.getType(e), v = u.getName(e), y = u.getSrc(e), x = u.getAlt(e) || v, C = u.getSize(e), ee = u.getUsageCount(e), w = u.getPublic(e) === !1, te = u.getDuration(e), E = !!m && !h, D = E ? m : f;
905
+ return /* @__PURE__ */ R("div", {
769
906
  "data-selected": t || void 0,
770
907
  "data-selecting": h || void 0,
771
908
  "data-gallery-density": n,
772
- className: r("media-library-card--component relative group/card overflow-hidden rounded-radius border border-border bg-card text-card-foreground text-left shadow-xs transition-all", `${_.tileHover} hover:shadow-sm`, t && "media-library-card--selected border-primary ring-1 ring-primary", g),
773
- onClick: O,
909
+ className: r("media-library-card--component relative group/card overflow-hidden rounded-radius border border-border bg-card text-card-foreground text-left shadow-xs transition-all", `${b.tileHover} hover:shadow-sm`, t && "media-library-card--selected border-primary ring-1 ring-primary", g),
910
+ onClick: D,
774
911
  children: [
775
- !!O && /* @__PURE__ */ F("button", {
912
+ !!D && /* @__PURE__ */ L("button", {
776
913
  type: "button",
777
- "aria-label": b,
778
- "aria-pressed": D ? void 0 : t,
779
- className: r("media-library-card--select rounded-radius", W),
914
+ "aria-label": v,
915
+ "aria-pressed": E ? void 0 : t,
916
+ className: r("media-library-card--select rounded-radius", He),
780
917
  onClick: (e) => {
781
- e.stopPropagation(), O();
918
+ e.stopPropagation(), D();
782
919
  }
783
920
  }),
784
- /* @__PURE__ */ I(q, {
921
+ /* @__PURE__ */ R(Ge, {
785
922
  tint: u.getTint(e),
786
923
  className: r(n === "compact" ? "aspect-square" : "aspect-[4/3]"),
787
924
  children: [
788
- /* @__PURE__ */ F(J, {
789
- src: x,
790
- alt: S,
791
- type: v,
925
+ /* @__PURE__ */ L(q, {
926
+ src: y,
927
+ alt: x,
928
+ type: _,
792
929
  className: "size-full object-cover"
793
930
  }),
794
- D && f ? /* @__PURE__ */ F("button", {
931
+ E && f ? /* @__PURE__ */ L("button", {
795
932
  type: "button",
796
- "aria-label": H(d.selectItem, { name: b }),
933
+ "aria-label": U(d.selectItem, { name: v }),
797
934
  "aria-pressed": t,
798
- className: r(ze, `z-10 cursor-pointer opacity-0 transition-opacity group-hover/card:opacity-100 group-focus-within/card:opacity-100 pointer-coarse:opacity-100 ${s.frame}`, t && Be),
935
+ className: r(Ue, `z-10 cursor-pointer opacity-0 transition-opacity group-hover/card:opacity-100 group-focus-within/card:opacity-100 pointer-coarse:opacity-100 ${s.frame}`, t && W),
799
936
  onClick: (e) => {
800
937
  e.stopPropagation(), f();
801
938
  },
802
- children: /* @__PURE__ */ F(R, { className: "size-icon-sm" })
803
- }) : /* @__PURE__ */ F("span", {
804
- className: r(ze, "transition-opacity", h ? "opacity-100" : "opacity-0 group-hover/card:opacity-100 group-focus-within/card:opacity-100", t && Be),
939
+ children: /* @__PURE__ */ L(ue, { className: "size-icon-sm" })
940
+ }) : /* @__PURE__ */ L("span", {
941
+ className: r(Ue, "transition-opacity", h ? "opacity-100" : "opacity-0 group-hover/card:opacity-100 group-focus-within/card:opacity-100", t && W),
805
942
  "aria-hidden": "true",
806
- children: /* @__PURE__ */ F(R, { className: "size-icon-sm" })
943
+ children: /* @__PURE__ */ L(ue, { className: "size-icon-sm" })
807
944
  }),
808
- !!p && /* @__PURE__ */ F(i, {
945
+ !!p && /* @__PURE__ */ L(i, {
809
946
  type: "button",
810
947
  tone: "secondary",
811
948
  buttonStyle: "solid",
812
949
  size: "sm",
813
950
  iconOnly: !0,
814
951
  className: "media-library-card--details absolute z-10 right-2 top-2 opacity-0 shadow-sm transition-opacity group-hover/card:opacity-100 group-focus-within/card:opacity-100 pointer-coarse:opacity-100",
815
- "aria-label": H(d.cardDetails, { name: b }),
952
+ "aria-label": U(d.cardDetails, { name: v }),
816
953
  onClick: (e) => {
817
954
  e.stopPropagation(), p();
818
955
  },
819
- children: /* @__PURE__ */ F(de, { className: "size-icon-md" })
956
+ children: /* @__PURE__ */ L(me, { className: "size-icon-md" })
820
957
  }),
821
- v === "video" && !!E && /* @__PURE__ */ I(C, {
958
+ _ === "video" && !!te && /* @__PURE__ */ R(T, {
822
959
  tone: "secondary",
823
960
  className: "media-library-card--duration absolute bottom-2 left-2 bg-inverse-background text-inverse-foreground",
824
- children: [/* @__PURE__ */ F(he, { className: "size-icon-sm fill-current" }), E]
961
+ children: [/* @__PURE__ */ L(V, { className: "size-icon-sm fill-current" }), te]
825
962
  }),
826
- T && /* @__PURE__ */ F(C, {
963
+ w && /* @__PURE__ */ L(T, {
827
964
  tone: "secondary",
828
965
  className: "media-library-card--private absolute bottom-2 right-2 bg-card text-card-foreground",
829
- children: /* @__PURE__ */ F(me, { className: "size-icon-sm" })
966
+ children: /* @__PURE__ */ L(_e, { className: "size-icon-sm" })
830
967
  })
831
968
  ]
832
969
  }),
833
- /* @__PURE__ */ F("div", {
970
+ /* @__PURE__ */ L("div", {
834
971
  className: r("media-library-card--body", n === "compact" ? "p-surface-xs" : "p-surface"),
835
- children: /* @__PURE__ */ I(c, {
972
+ children: /* @__PURE__ */ R(c, {
836
973
  columns: 1,
837
974
  gap: "xs",
838
- children: [/* @__PURE__ */ F(a, {
975
+ children: [/* @__PURE__ */ L(a, {
839
976
  tag: "div",
840
977
  type: "inherit",
841
978
  weight: "semibold",
842
979
  className: "truncate",
843
- children: b
844
- }), o && /* @__PURE__ */ I(l, {
980
+ children: v
981
+ }), o && /* @__PURE__ */ R(l, {
845
982
  direction: "horizontal",
846
983
  align: "center",
847
984
  justify: "between",
848
985
  gap: "md",
849
986
  className: "min-w-0",
850
- children: [/* @__PURE__ */ F(y, {
851
- value: ee,
987
+ children: [/* @__PURE__ */ L(S, {
988
+ value: C,
852
989
  size: "xs",
853
990
  className: "truncate",
854
991
  emptyLabel: d.unknownSize
855
- }), !!w && /* @__PURE__ */ I(a, {
992
+ }), !!ee && /* @__PURE__ */ R(a, {
856
993
  tag: "span",
857
994
  size: "xs",
858
995
  type: "secondary",
859
996
  className: "inline-flex items-center gap-space-xs",
860
- children: [/* @__PURE__ */ F(fe, { className: "size-icon-sm" }), w]
997
+ children: [/* @__PURE__ */ L(he, { className: "size-icon-sm" }), ee]
861
998
  })]
862
999
  })]
863
1000
  })
@@ -865,128 +1002,163 @@ function X({ item: e, selected: t = !1, density: n = "comfortable", showMeta: o
865
1002
  ]
866
1003
  });
867
1004
  }
868
- function Z({ items: e, selectedSet: t, accessors: n, strings: c, onToggle: l, onDetails: u, onOpen: d, selecting: f = !1 }) {
1005
+ function Ye({ items: e, selectedSet: t, accessors: n, strings: c, onToggle: l, onDetails: u, onOpen: d, selecting: f = !1 }) {
869
1006
  let p = !!d && !f;
870
- return /* @__PURE__ */ I("div", {
1007
+ return /* @__PURE__ */ R("div", {
871
1008
  className: "media-library-list--component min-w-180",
872
- children: [/* @__PURE__ */ I("div", {
1009
+ children: [/* @__PURE__ */ R("div", {
873
1010
  className: "sticky top-0 z-10 grid grid-cols-[32px_42px_minmax(0,1fr)_86px_88px_120px_72px_34px] items-center gap-space-lg border-b border-border bg-background px-row-x py-row-y",
874
1011
  children: [
875
- /* @__PURE__ */ F("span", {}),
876
- /* @__PURE__ */ F("span", {}),
877
- /* @__PURE__ */ F(o, { children: c.table.name }),
878
- /* @__PURE__ */ F(o, { children: c.table.type }),
879
- /* @__PURE__ */ F(o, { children: c.table.size }),
880
- /* @__PURE__ */ F(o, { children: c.table.collection }),
881
- /* @__PURE__ */ F(o, { children: c.table.used }),
882
- /* @__PURE__ */ F("span", {})
1012
+ /* @__PURE__ */ L("span", {}),
1013
+ /* @__PURE__ */ L("span", {}),
1014
+ /* @__PURE__ */ L(o, { children: c.table.name }),
1015
+ /* @__PURE__ */ L(o, { children: c.table.type }),
1016
+ /* @__PURE__ */ L(o, { children: c.table.size }),
1017
+ /* @__PURE__ */ L(o, { children: c.table.collection }),
1018
+ /* @__PURE__ */ L(o, { children: c.table.used }),
1019
+ /* @__PURE__ */ L("span", {})
883
1020
  ]
884
1021
  }), e.map((e) => {
885
- let o = n.getId(e), f = t.has(o), m = n.getType(e), h = n.getName(e), g = n.getSrc(e), v = n.getPublic(e) === !1;
886
- return /* @__PURE__ */ I("div", {
1022
+ let o = n.getId(e), f = t.has(o), m = n.getType(e), h = n.getName(e), g = n.getSrc(e), _ = n.getPublic(e) === !1;
1023
+ return /* @__PURE__ */ R("div", {
887
1024
  "data-selected": f || void 0,
888
- className: r("media-library-list--row relative grid grid-cols-[32px_42px_minmax(0,1fr)_86px_88px_120px_72px_34px] items-center gap-space-lg border-b border-border/60 px-row-x py-row-y last:border-b-0", `cursor-pointer rounded-inner transition-colors ${_.rowHover}`, f && _.rowSelected),
1025
+ className: r("media-library-list--row relative grid grid-cols-[32px_42px_minmax(0,1fr)_86px_88px_120px_72px_34px] items-center gap-space-lg border-b border-border/60 px-row-x py-row-y last:border-b-0", `cursor-pointer rounded-radius transition-colors ${b.rowHover}`, f && b.rowSelected),
889
1026
  onClick: () => p && d ? d(o) : l(o),
890
1027
  children: [
891
- /* @__PURE__ */ F("button", {
1028
+ /* @__PURE__ */ L("button", {
892
1029
  type: "button",
893
1030
  "aria-label": h,
894
1031
  "aria-pressed": p ? void 0 : f,
895
- className: r("media-library-list--select rounded-inner", W),
1032
+ className: r("media-library-list--select rounded-radius", He),
896
1033
  onClick: (e) => {
897
1034
  e.stopPropagation(), p && d ? d(o) : l(o);
898
1035
  }
899
1036
  }),
900
- p ? /* @__PURE__ */ F("button", {
1037
+ p ? /* @__PURE__ */ L("button", {
901
1038
  type: "button",
902
- "aria-label": H(c.selectItem, { name: h }),
1039
+ "aria-label": U(c.selectItem, { name: h }),
903
1040
  "aria-pressed": f,
904
1041
  className: r(`relative z-10 inline-flex size-icon-lg cursor-pointer items-center justify-center rounded-radius border border-input bg-background p-0 text-transparent ${s.frame}`, f && "border-primary bg-primary text-primary-foreground"),
905
1042
  onClick: (e) => {
906
1043
  e.stopPropagation(), l(o);
907
1044
  },
908
- children: /* @__PURE__ */ F(R, { className: "size-icon-sm" })
909
- }) : /* @__PURE__ */ F("span", {
1045
+ children: /* @__PURE__ */ L(ue, { className: "size-icon-sm" })
1046
+ }) : /* @__PURE__ */ L("span", {
910
1047
  className: r("inline-flex size-icon-lg items-center justify-center rounded-radius border border-border text-transparent", f && "border-primary bg-primary text-primary-foreground"),
911
1048
  "aria-hidden": "true",
912
- children: /* @__PURE__ */ F(R, { className: "size-icon-sm" })
1049
+ children: /* @__PURE__ */ L(ue, { className: "size-icon-sm" })
913
1050
  }),
914
- /* @__PURE__ */ F(q, {
1051
+ /* @__PURE__ */ L(Ge, {
915
1052
  tint: n.getTint(e),
916
- className: "size-9 rounded-inner",
917
- children: g ? /* @__PURE__ */ F("img", {
1053
+ className: "size-9 rounded-radius",
1054
+ children: g ? /* @__PURE__ */ L("img", {
918
1055
  src: g,
919
1056
  alt: "",
920
1057
  loading: "lazy",
921
1058
  className: "size-full object-cover"
922
- }) : /* @__PURE__ */ F("div", {
1059
+ }) : /* @__PURE__ */ L("div", {
923
1060
  className: "flex size-full items-center justify-center text-muted-foreground",
924
- children: Ve(m, "size-icon")
1061
+ children: We(m, "size-icon")
925
1062
  })
926
1063
  }),
927
- /* @__PURE__ */ I(a, {
1064
+ /* @__PURE__ */ R(a, {
928
1065
  tag: "div",
929
1066
  type: "inherit",
930
1067
  weight: "semibold",
931
1068
  className: "flex min-w-0 items-center gap-space-xs truncate",
932
- children: [h, v && /* @__PURE__ */ F(me, { className: "size-icon-sm shrink-0 text-muted-foreground" })]
1069
+ children: [h, _ && /* @__PURE__ */ L(_e, { className: "size-icon-sm shrink-0 text-muted-foreground" })]
933
1070
  }),
934
- /* @__PURE__ */ F(C, {
1071
+ /* @__PURE__ */ L(T, {
935
1072
  tone: "secondary",
936
1073
  children: G(m, c)
937
1074
  }),
938
- /* @__PURE__ */ F(y, {
1075
+ /* @__PURE__ */ L(S, {
939
1076
  value: n.getSize(e),
940
1077
  size: "xs",
941
1078
  emptyLabel: c.unknownSize
942
1079
  }),
943
- /* @__PURE__ */ F(a, {
1080
+ /* @__PURE__ */ L(a, {
944
1081
  size: "xs",
945
1082
  type: "secondary",
946
1083
  className: "truncate",
947
1084
  children: n.getCollection(e) || "—"
948
1085
  }),
949
- /* @__PURE__ */ F(a, {
1086
+ /* @__PURE__ */ L(a, {
950
1087
  size: "xs",
951
1088
  type: "secondary",
952
1089
  children: n.getUsageCount(e) ? n.getUsageCount(e) : "—"
953
1090
  }),
954
- /* @__PURE__ */ F(i, {
1091
+ /* @__PURE__ */ L(i, {
955
1092
  type: "button",
956
1093
  tone: "secondary",
957
1094
  buttonStyle: "ghost",
958
1095
  size: "sm",
959
1096
  iconOnly: !0,
960
1097
  className: "relative z-10",
961
- "aria-label": H(c.cardDetails, { name: h }),
1098
+ "aria-label": U(c.cardDetails, { name: h }),
962
1099
  onClick: (e) => {
963
1100
  e.stopPropagation(), u(o);
964
1101
  },
965
- children: /* @__PURE__ */ F(de, { className: "size-icon-md" })
1102
+ children: /* @__PURE__ */ L(me, { className: "size-icon-md" })
966
1103
  })
967
1104
  ]
968
1105
  }, o);
969
1106
  })]
970
1107
  });
971
1108
  }
972
- function Ue({ item: e, collections: t = [], accessors: n, strings: o, onClose: s, onUpdate: c, onRemove: u, onReplace: d, renderDetail: f }) {
1109
+ function J({ label: e, tags: t, placeholder: n, readOnly: r = !1, onValueChange: i }) {
1110
+ let a = t.join(", "), [o, s] = I({
1111
+ source: a,
1112
+ value: a
1113
+ });
1114
+ o.source !== a && s({
1115
+ source: a,
1116
+ value: a
1117
+ });
1118
+ let c = () => {
1119
+ if (r || o.value === a) return;
1120
+ let e = o.value.split(",").map((e) => e.trim()).filter(Boolean);
1121
+ s({
1122
+ source: a,
1123
+ value: a
1124
+ }), (e.length !== t.length || e.some((e, n) => e !== t[n])) && i(e);
1125
+ };
1126
+ return /* @__PURE__ */ L(D, {
1127
+ label: e,
1128
+ children: /* @__PURE__ */ L(E, {
1129
+ value: o.value,
1130
+ placeholder: n,
1131
+ readOnly: r,
1132
+ onChange: (e) => s({
1133
+ source: a,
1134
+ value: e.target.value
1135
+ }),
1136
+ onBlur: c,
1137
+ onKeyDown: (e) => {
1138
+ r || e.key !== "Enter" || e.nativeEvent.isComposing || (e.preventDefault(), c());
1139
+ }
1140
+ })
1141
+ });
1142
+ }
1143
+ function Xe({ item: e, collections: t = [], accessors: n, strings: o, onClose: s, onUpdate: c, readOnly: d = !1, mutationError: p, onRemove: m, allowDelete: h = !0, onReplace: g, renderDetail: v }) {
973
1144
  if (!e) return null;
974
- let p = n.getName(e), m = n.getType(e), g = n.getSrc(e), _ = n.getCollection(e) ?? t[0]?.value ?? "", v = n.getTags(e), x = n.getPublic(e) ?? !0, S = f?.(e, {
1145
+ let y = n.getName(e), b = n.getType(e), x = n.getSrc(e), ee = n.getCollection(e) ?? t[0]?.value ?? "", w = n.getTags(e), te = n.getPublic(e) ?? !0, k = d ? () => Promise.resolve(!1) : c, re = v?.(e, {
975
1146
  accessors: n,
976
- update: c,
977
- remove: u,
978
- replace: d,
1147
+ update: k,
1148
+ mutationError: p,
1149
+ remove: h ? m : () => Promise.resolve(!1),
1150
+ replace: g,
979
1151
  close: s
980
1152
  });
981
- return S ? /* @__PURE__ */ F(se, { children: S }) : /* @__PURE__ */ I("aside", {
1153
+ return re ? /* @__PURE__ */ L(ce, { children: re }) : /* @__PURE__ */ R("aside", {
982
1154
  className: "media-library-detail-panel--component flex min-h-0 w-full flex-col border-l border-border bg-background text-foreground @2xl/media-library:w-72",
983
- children: [/* @__PURE__ */ F("div", {
1155
+ children: [/* @__PURE__ */ L("div", {
984
1156
  className: "media-library-detail-panel--header border-b border-border p-surface",
985
- children: /* @__PURE__ */ I(l, {
1157
+ children: /* @__PURE__ */ R(l, {
986
1158
  direction: "horizontal",
987
1159
  align: "center",
988
1160
  gap: "md",
989
- children: [/* @__PURE__ */ F(i, {
1161
+ children: [/* @__PURE__ */ L(i, {
990
1162
  type: "button",
991
1163
  tone: "secondary",
992
1164
  buttonStyle: "ghost",
@@ -995,35 +1167,35 @@ function Ue({ item: e, collections: t = [], accessors: n, strings: o, onClose: s
995
1167
  "aria-label": o.detail.close,
996
1168
  "data-media-detail-close": "",
997
1169
  onClick: s,
998
- children: /* @__PURE__ */ F(L, { className: "size-icon-md" })
999
- }), /* @__PURE__ */ F(a, {
1170
+ children: /* @__PURE__ */ L(le, { className: "size-icon-md" })
1171
+ }), /* @__PURE__ */ L(a, {
1000
1172
  weight: "semibold",
1001
1173
  children: o.detail.title
1002
1174
  })]
1003
1175
  })
1004
- }), /* @__PURE__ */ I("div", {
1176
+ }), /* @__PURE__ */ R("div", {
1005
1177
  className: "media-library-detail-panel--body grid min-h-0 auto-rows-max gap-space-xl overflow-y-auto p-surface",
1006
1178
  children: [
1007
- /* @__PURE__ */ I(q, {
1179
+ /* @__PURE__ */ R(Ge, {
1008
1180
  tint: n.getTint(e),
1009
1181
  className: "aspect-[4/3] rounded-radius border border-border",
1010
- children: [/* @__PURE__ */ F(J, {
1011
- src: g,
1012
- alt: n.getAlt(e) || p,
1013
- type: m,
1182
+ children: [/* @__PURE__ */ L(q, {
1183
+ src: x,
1184
+ alt: n.getAlt(e) || y,
1185
+ type: b,
1014
1186
  className: "size-full object-cover"
1015
- }), m === "video" && !!n.getDuration(e) && /* @__PURE__ */ I(C, {
1187
+ }), b === "video" && !!n.getDuration(e) && /* @__PURE__ */ R(T, {
1016
1188
  className: "absolute bottom-2 right-2 bg-inverse-background text-inverse-foreground",
1017
- children: [/* @__PURE__ */ F(he, { className: "size-icon-sm fill-current" }), n.getDuration(e)]
1189
+ children: [/* @__PURE__ */ L(V, { className: "size-icon-sm fill-current" }), n.getDuration(e)]
1018
1190
  })]
1019
1191
  }),
1020
- /* @__PURE__ */ F(a, {
1192
+ /* @__PURE__ */ L(a, {
1021
1193
  tag: "div",
1022
1194
  weight: "semibold",
1023
1195
  className: "break-words",
1024
- children: p
1196
+ children: y
1025
1197
  }),
1026
- /* @__PURE__ */ F(ne, {
1198
+ /* @__PURE__ */ L(ie, {
1027
1199
  layout: "rows",
1028
1200
  valueAlign: "end",
1029
1201
  density: "compact",
@@ -1032,12 +1204,12 @@ function Ue({ item: e, collections: t = [], accessors: n, strings: o, onClose: s
1032
1204
  {
1033
1205
  id: "type",
1034
1206
  label: o.detail.type,
1035
- value: G(m, o)
1207
+ value: G(b, o)
1036
1208
  },
1037
1209
  {
1038
1210
  id: "size",
1039
1211
  label: o.detail.size,
1040
- value: /* @__PURE__ */ F(y, {
1212
+ value: /* @__PURE__ */ L(S, {
1041
1213
  value: n.getSize(e),
1042
1214
  emptyLabel: o.unknownSize
1043
1215
  })
@@ -1045,7 +1217,7 @@ function Ue({ item: e, collections: t = [], accessors: n, strings: o, onClose: s
1045
1217
  {
1046
1218
  id: "dimensions",
1047
1219
  label: o.detail.dimensions,
1048
- value: /* @__PURE__ */ F(b, {
1220
+ value: /* @__PURE__ */ L(C, {
1049
1221
  width: n.getWidth(e),
1050
1222
  height: n.getHeight(e),
1051
1223
  emptyLabel: o.unknownSize
@@ -1063,68 +1235,74 @@ function Ue({ item: e, collections: t = [], accessors: n, strings: o, onClose: s
1063
1235
  }
1064
1236
  ]
1065
1237
  }),
1066
- /* @__PURE__ */ F(T, {
1238
+ p && /* @__PURE__ */ L(f, {
1239
+ tone: "destructive",
1240
+ children: /* @__PURE__ */ L(u, { children: o.detail.mutationError ?? H.detail.mutationError })
1241
+ }),
1242
+ /* @__PURE__ */ L(D, {
1067
1243
  label: o.detail.altText,
1068
- children: /* @__PURE__ */ F(w, {
1244
+ children: /* @__PURE__ */ L(E, {
1069
1245
  value: n.getAlt(e) ?? "",
1070
1246
  placeholder: o.detail.altPlaceholder,
1071
- onChange: (e) => c({ alt: e.target.value })
1247
+ readOnly: d,
1248
+ onChange: (e) => k({ alt: e.target.value })
1072
1249
  })
1073
1250
  }),
1074
- /* @__PURE__ */ F(T, {
1251
+ /* @__PURE__ */ L(D, {
1075
1252
  label: o.detail.collection,
1076
- children: /* @__PURE__ */ F(D, {
1077
- value: _,
1253
+ children: /* @__PURE__ */ L(ne, {
1254
+ value: ee,
1078
1255
  options: t.map((e) => ({
1079
1256
  value: e.value,
1080
1257
  label: String(e.label)
1081
1258
  })),
1082
1259
  "aria-label": o.detail.collection,
1083
- onValueChange: (e) => c({ collection: e })
1260
+ readOnly: d,
1261
+ onValueChange: (e) => k({ collection: e })
1084
1262
  })
1085
1263
  }),
1086
- /* @__PURE__ */ F(T, {
1264
+ /* @__PURE__ */ L(J, {
1087
1265
  label: o.detail.tags,
1088
- children: /* @__PURE__ */ F(w, {
1089
- value: v.join(", "),
1090
- placeholder: o.detail.tagsPlaceholder,
1091
- onChange: (e) => c({ tags: e.target.value.split(",").map((e) => e.trim()).filter(Boolean) })
1092
- })
1093
- }),
1094
- /* @__PURE__ */ F("div", {
1266
+ tags: w,
1267
+ placeholder: o.detail.tagsPlaceholder,
1268
+ readOnly: d,
1269
+ onValueChange: (e) => k({ tags: e })
1270
+ }, n.getId(e)),
1271
+ /* @__PURE__ */ L("div", {
1095
1272
  className: "media-library-detail-panel--public",
1096
- children: /* @__PURE__ */ I(l, {
1273
+ children: /* @__PURE__ */ R(l, {
1097
1274
  direction: "horizontal",
1098
1275
  align: "center",
1099
1276
  justify: "between",
1100
1277
  gap: "xl",
1101
- children: [/* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F(a, {
1278
+ children: [/* @__PURE__ */ R("div", { children: [/* @__PURE__ */ L(a, {
1102
1279
  weight: "semibold",
1103
1280
  children: o.detail.public
1104
- }), /* @__PURE__ */ F(a, {
1281
+ }), /* @__PURE__ */ L(a, {
1105
1282
  size: "xs",
1106
1283
  type: "secondary",
1107
- children: x ? o.detail.publicHint : o.detail.privateHint
1108
- })] }), /* @__PURE__ */ F(E, {
1284
+ children: te ? o.detail.publicHint : o.detail.privateHint
1285
+ })] }), /* @__PURE__ */ L(O, {
1109
1286
  "aria-label": o.detail.public,
1110
- checked: x,
1111
- onValueChange: (e) => c({ public: e })
1287
+ checked: te,
1288
+ readOnly: d,
1289
+ onValueChange: (e) => k({ public: e })
1112
1290
  })]
1113
1291
  })
1114
1292
  }),
1115
- /* @__PURE__ */ I("div", {
1116
- className: r("media-library-detail-panel--actions flex flex-wrap", h.commands),
1117
- children: [d && /* @__PURE__ */ F(i, {
1293
+ (g || h) && /* @__PURE__ */ R("div", {
1294
+ className: r("media-library-detail-panel--actions flex flex-wrap", _.commands),
1295
+ children: [g && /* @__PURE__ */ L(i, {
1118
1296
  type: "button",
1119
1297
  tone: "secondary",
1120
1298
  buttonStyle: "outline",
1121
- onClick: d,
1299
+ onClick: g,
1122
1300
  children: o.detail.replace
1123
- }), /* @__PURE__ */ F(i, {
1301
+ }), h && /* @__PURE__ */ L(i, {
1124
1302
  type: "button",
1125
1303
  tone: "destructive",
1126
1304
  buttonStyle: "ghost",
1127
- onClick: u,
1305
+ onClick: m,
1128
1306
  children: o.detail.delete
1129
1307
  })]
1130
1308
  })
@@ -1132,130 +1310,132 @@ function Ue({ item: e, collections: t = [], accessors: n, strings: o, onClose: s
1132
1310
  })]
1133
1311
  });
1134
1312
  }
1135
- function Q({ stagedFiles: e, uploadOptions: t, collections: n = [], uploading: r = !1, strings: o, onFiles: s, onRemoveFile: c, onOptionsChange: u, empty: d }) {
1136
- return /* @__PURE__ */ F("div", {
1313
+ function Ze({ stagedFiles: e, uploadOptions: t, collections: n = [], uploading: r = !1, hasUploadError: o = !1, strings: s, onFiles: c, onRemoveFile: d, onOptionsChange: p, empty: m }) {
1314
+ return /* @__PURE__ */ L("div", {
1137
1315
  className: "media-library-upload-panel--component p-surface",
1138
- children: /* @__PURE__ */ I(l, {
1316
+ children: /* @__PURE__ */ R(l, {
1139
1317
  gap: "xl",
1140
1318
  children: [
1141
- /* @__PURE__ */ F(A, {
1142
- onDrop: s,
1319
+ /* @__PURE__ */ L(j, {
1320
+ onDrop: c,
1143
1321
  accept: "image/*,video/*",
1144
1322
  multiple: !0,
1145
1323
  size: "md",
1146
1324
  strings: {
1147
- instruction: o.upload.dropTitle,
1148
- helper: o.upload.dropHint,
1149
- dragOver: o.upload.dragOver
1325
+ instruction: s.upload.dropTitle,
1326
+ helper: s.upload.dropHint,
1327
+ dragOver: s.upload.dragOver
1150
1328
  }
1151
1329
  }),
1152
- e.length > 0 ? /* @__PURE__ */ F(l, {
1330
+ o && /* @__PURE__ */ L(f, {
1331
+ tone: "destructive",
1332
+ children: /* @__PURE__ */ L(u, { children: s.upload.error ?? H.upload.error })
1333
+ }),
1334
+ e.length > 0 ? /* @__PURE__ */ L(l, {
1153
1335
  gap: "md",
1154
1336
  className: "media-library-upload-panel--staged",
1155
- children: e.map((e) => /* @__PURE__ */ I("div", {
1337
+ children: e.map((e) => /* @__PURE__ */ R("div", {
1156
1338
  className: "media-library-upload-panel--staged-file flex items-center gap-space-lg rounded-radius border border-border bg-card text-card-foreground px-row-x py-row-y",
1157
1339
  children: [
1158
- /* @__PURE__ */ F(q, {
1159
- className: "size-10 rounded-inner",
1160
- children: e.src ? /* @__PURE__ */ F("img", {
1340
+ /* @__PURE__ */ L(Ge, {
1341
+ className: "size-10 rounded-radius",
1342
+ children: e.src ? /* @__PURE__ */ L("img", {
1161
1343
  src: e.src,
1162
1344
  alt: e.name,
1163
1345
  className: "size-full object-cover"
1164
- }) : /* @__PURE__ */ F("div", {
1346
+ }) : /* @__PURE__ */ L("div", {
1165
1347
  className: "flex size-full items-center justify-center text-muted-foreground",
1166
- children: Ve(e.type, "size-icon")
1348
+ children: We(e.type, "size-icon")
1167
1349
  })
1168
1350
  }),
1169
- /* @__PURE__ */ I(l, {
1351
+ /* @__PURE__ */ R(l, {
1170
1352
  gap: "md",
1171
1353
  className: "min-w-0 flex-1",
1172
1354
  children: [
1173
- /* @__PURE__ */ I("div", {
1355
+ /* @__PURE__ */ R("div", {
1174
1356
  className: "flex items-baseline gap-space-lg",
1175
- children: [/* @__PURE__ */ F(a, {
1357
+ children: [/* @__PURE__ */ L(a, {
1176
1358
  type: "inherit",
1177
1359
  weight: "semibold",
1178
1360
  className: "truncate",
1179
1361
  children: e.name
1180
- }), /* @__PURE__ */ F(y, {
1362
+ }), /* @__PURE__ */ L(S, {
1181
1363
  value: e.size,
1182
1364
  size: "xs",
1183
1365
  className: "ml-auto shrink-0"
1184
1366
  })]
1185
1367
  }),
1186
- (e.status === "uploading" || e.status === "done") && /* @__PURE__ */ F(p, {
1368
+ (e.status === "uploading" || e.status === "done") && /* @__PURE__ */ L(h, {
1187
1369
  value: e.progress,
1188
1370
  size: "sm",
1189
1371
  "aria-label": e.name
1190
1372
  }),
1191
- e.status === "error" && /* @__PURE__ */ F(a, {
1373
+ e.status === "error" && /* @__PURE__ */ L(a, {
1192
1374
  type: "error",
1193
1375
  children: e.error
1194
1376
  })
1195
1377
  ]
1196
1378
  }),
1197
- e.status === "done" ? /* @__PURE__ */ F(C, {
1379
+ e.status === "done" ? /* @__PURE__ */ L(T, {
1198
1380
  tone: "success",
1199
- children: o.upload.done
1200
- }) : e.status === "uploading" ? /* @__PURE__ */ F(x, {
1381
+ children: s.upload.done
1382
+ }) : e.status === "uploading" ? /* @__PURE__ */ L(ee, {
1201
1383
  value: Math.round(e.progress),
1202
1384
  scaled: !0,
1203
1385
  size: "xs",
1204
1386
  type: "secondary"
1205
- }) : /* @__PURE__ */ F(i, {
1387
+ }) : /* @__PURE__ */ L(i, {
1206
1388
  type: "button",
1207
1389
  tone: "secondary",
1208
1390
  buttonStyle: "ghost",
1209
1391
  size: "sm",
1210
1392
  iconOnly: !0,
1211
1393
  disabled: r,
1212
- "aria-label": H(o.upload.removeFile, { name: e.name }),
1213
- onClick: () => c(e.id),
1214
- children: /* @__PURE__ */ F(Se, { className: "size-icon-md" })
1394
+ "aria-label": U(s.upload.removeFile, { name: e.name }),
1395
+ onClick: () => d(e.id),
1396
+ children: /* @__PURE__ */ L(we, { className: "size-icon-md" })
1215
1397
  })
1216
1398
  ]
1217
1399
  }, e.id))
1218
- }) : d,
1219
- /* @__PURE__ */ I("div", {
1400
+ }) : m,
1401
+ /* @__PURE__ */ R("div", {
1220
1402
  className: "media-library-upload-panel--options grid gap-space-lg @2xl/media-library:grid-cols-[minmax(0,1fr)_minmax(0,1fr)_auto]",
1221
1403
  children: [
1222
- /* @__PURE__ */ F(T, {
1223
- label: o.upload.collection,
1224
- children: /* @__PURE__ */ F(D, {
1404
+ /* @__PURE__ */ L(D, {
1405
+ label: s.upload.collection,
1406
+ children: /* @__PURE__ */ L(ne, {
1225
1407
  value: t.collection ?? n[0]?.value,
1226
1408
  options: n.map((e) => ({
1227
1409
  value: e.value,
1228
1410
  label: String(e.label)
1229
1411
  })),
1230
- "aria-label": o.upload.collection,
1231
- onValueChange: (e) => u({ collection: e })
1412
+ "aria-label": s.upload.collection,
1413
+ onValueChange: (e) => p({ collection: e })
1232
1414
  })
1233
1415
  }),
1234
- /* @__PURE__ */ F(T, {
1235
- label: o.upload.tags,
1236
- children: /* @__PURE__ */ F(w, {
1237
- value: t.tags.join(", "),
1238
- placeholder: o.upload.tagsPlaceholder,
1239
- onChange: (e) => u({ tags: e.target.value.split(",").map((e) => e.trim()).filter(Boolean) })
1240
- })
1416
+ /* @__PURE__ */ L(J, {
1417
+ label: s.upload.tags,
1418
+ tags: t.tags,
1419
+ placeholder: s.upload.tagsPlaceholder,
1420
+ onValueChange: (e) => p({ tags: e })
1241
1421
  }),
1242
- /* @__PURE__ */ I(l, {
1422
+ /* @__PURE__ */ R(l, {
1243
1423
  direction: "horizontal",
1244
1424
  align: "center",
1245
1425
  justify: "between",
1246
1426
  gap: "xl",
1247
1427
  className: "@2xl/media-library:self-end",
1248
- children: [/* @__PURE__ */ I("div", { children: [/* @__PURE__ */ F(a, {
1428
+ children: [/* @__PURE__ */ R("div", { children: [/* @__PURE__ */ L(a, {
1249
1429
  weight: "semibold",
1250
- children: o.upload.public
1251
- }), /* @__PURE__ */ F(a, {
1430
+ children: s.upload.public
1431
+ }), /* @__PURE__ */ L(a, {
1252
1432
  size: "xs",
1253
1433
  type: "secondary",
1254
- children: o.upload.publicHint
1255
- })] }), /* @__PURE__ */ F(E, {
1256
- "aria-label": o.upload.public,
1434
+ children: s.upload.publicHint
1435
+ })] }), /* @__PURE__ */ L(O, {
1436
+ "aria-label": s.upload.public,
1257
1437
  checked: t.public,
1258
- onValueChange: (e) => u({ public: e })
1438
+ onValueChange: (e) => p({ public: e })
1259
1439
  })]
1260
1440
  })
1261
1441
  ]
@@ -1264,35 +1444,35 @@ function Q({ stagedFiles: e, uploadOptions: t, collections: n = [], uploading: r
1264
1444
  })
1265
1445
  });
1266
1446
  }
1267
- function We({ tab: e, selectedIds: t, selectionMode: n, stagedFiles: o, strings: s, onClearSelection: c, className: l }) {
1447
+ function Qe({ tab: e, selectedIds: t, selectionMode: n, stagedFiles: o, strings: s, onClearSelection: c, className: l }) {
1268
1448
  let u = t.length, d = o.reduce((e, t) => e + t.size, 0), f = o.length, p = r("media-library-footer-summary--component flex min-w-0 items-center gap-space-lg", l);
1269
- return e === "upload" ? /* @__PURE__ */ F("div", {
1449
+ return e === "upload" ? /* @__PURE__ */ L("div", {
1270
1450
  className: p,
1271
1451
  "aria-live": "polite",
1272
- children: /* @__PURE__ */ F(a, {
1452
+ children: /* @__PURE__ */ L(a, {
1273
1453
  size: "xs",
1274
1454
  type: "secondary",
1275
1455
  className: "truncate",
1276
- children: f === 0 ? s.footer.noFiles : H(s.footer.stagedSummary, {
1456
+ children: f === 0 ? s.footer.noFiles : U(s.footer.stagedSummary, {
1277
1457
  count: f,
1278
- size: v(d) ?? s.unknownSize
1458
+ size: x(d) ?? s.unknownSize
1279
1459
  })
1280
1460
  })
1281
- }) : /* @__PURE__ */ F("div", {
1461
+ }) : /* @__PURE__ */ L("div", {
1282
1462
  className: p,
1283
1463
  "aria-live": "polite",
1284
- children: u > 0 ? /* @__PURE__ */ I(se, { children: [/* @__PURE__ */ F(a, {
1464
+ children: u > 0 ? /* @__PURE__ */ R(ce, { children: [/* @__PURE__ */ L(a, {
1285
1465
  weight: "semibold",
1286
1466
  className: "whitespace-nowrap",
1287
- children: H(s.footer.selectedCount, { count: u })
1288
- }), /* @__PURE__ */ F(i, {
1467
+ children: U(s.footer.selectedCount, { count: u })
1468
+ }), /* @__PURE__ */ L(i, {
1289
1469
  type: "button",
1290
1470
  tone: "secondary",
1291
1471
  buttonStyle: "ghost",
1292
1472
  size: "sm",
1293
1473
  onClick: c,
1294
1474
  children: s.footer.clear
1295
- })] }) : /* @__PURE__ */ F(a, {
1475
+ })] }) : /* @__PURE__ */ L(a, {
1296
1476
  size: "xs",
1297
1477
  type: "secondary",
1298
1478
  className: "truncate",
@@ -1300,56 +1480,56 @@ function We({ tab: e, selectedIds: t, selectionMode: n, stagedFiles: o, strings:
1300
1480
  })
1301
1481
  });
1302
1482
  }
1303
- function Ge({ tab: e, selectedItems: t, selectedIds: n, stagedFiles: a, uploading: o = !1, strings: s, confirmLabel: c, cancelLabel: l, onCancel: u, onConfirm: d, onUpload: f, onCancelUpload: p, className: m }) {
1304
- let h = n.length, g = a.length;
1305
- return e === "upload" ? /* @__PURE__ */ I("div", {
1306
- className: r("media-library-footer-actions--component flex min-w-0 flex-col-reverse gap-space-md @md/media-library:flex-row @md/media-library:justify-end", m),
1307
- children: [/* @__PURE__ */ F(i, {
1483
+ function Y({ tab: e, selectedIds: t, stagedFiles: n, uploading: a = !1, strings: o, confirmLabel: s, cancelLabel: c, onCancel: l, onConfirm: u, onUpload: d, onCancelUpload: f, className: p }) {
1484
+ let m = t.length, h = n.length;
1485
+ return e === "upload" ? /* @__PURE__ */ R("div", {
1486
+ className: r("media-library-footer-actions--component flex min-w-0 flex-col-reverse gap-space-md @md/media-library:flex-row @md/media-library:justify-end", p),
1487
+ children: [/* @__PURE__ */ L(i, {
1308
1488
  type: "button",
1309
1489
  tone: "secondary",
1310
1490
  buttonStyle: "ghost",
1311
- disabled: o,
1312
- onClick: p,
1313
- children: l ?? s.footer.cancel
1314
- }), /* @__PURE__ */ F(i, {
1491
+ disabled: a,
1492
+ onClick: f,
1493
+ children: c ?? o.footer.cancel
1494
+ }), /* @__PURE__ */ L(i, {
1315
1495
  tone: "primary",
1316
1496
  type: "button",
1317
- disabled: g === 0 || o,
1318
- onClick: f,
1319
- loading: o,
1320
- strings: { loading: s.footer.uploading },
1321
- children: g <= 1 ? s.footer.upload : H(s.footer.uploadMany, { count: g })
1497
+ disabled: h === 0 || a,
1498
+ onClick: d,
1499
+ loading: a,
1500
+ strings: { loading: o.footer.uploading },
1501
+ children: h <= 1 ? o.footer.upload : U(o.footer.uploadMany, { count: h })
1322
1502
  })]
1323
- }) : /* @__PURE__ */ I("div", {
1324
- className: r("media-library-footer-actions--component flex min-w-0 flex-col-reverse gap-space-md @md/media-library:flex-row @md/media-library:justify-end", m),
1325
- children: [/* @__PURE__ */ F(i, {
1503
+ }) : /* @__PURE__ */ R("div", {
1504
+ className: r("media-library-footer-actions--component flex min-w-0 flex-col-reverse gap-space-md @md/media-library:flex-row @md/media-library:justify-end", p),
1505
+ children: [/* @__PURE__ */ L(i, {
1326
1506
  type: "button",
1327
1507
  tone: "secondary",
1328
1508
  buttonStyle: "ghost",
1329
- onClick: u,
1330
- children: l ?? s.footer.cancel
1331
- }), /* @__PURE__ */ F(i, {
1509
+ onClick: l,
1510
+ children: c ?? o.footer.cancel
1511
+ }), /* @__PURE__ */ L(i, {
1332
1512
  tone: "primary",
1333
1513
  type: "button",
1334
- disabled: h === 0,
1335
- onClick: d,
1336
- children: c ?? (h === 0 ? s.footer.confirmEmpty : t.length === 1 ? s.footer.confirmOne : H(s.footer.confirmMany, { count: h }))
1514
+ disabled: m === 0,
1515
+ onClick: u,
1516
+ children: s ?? (m === 0 ? o.footer.confirmEmpty : m === 1 ? o.footer.confirmOne : U(o.footer.confirmMany, { count: m }))
1337
1517
  })]
1338
1518
  });
1339
1519
  }
1340
- function Ke({ tab: e, selectedItems: t, selectedIds: n, selectionMode: i, stagedFiles: a, uploading: o = !1, strings: s, confirmLabel: c, cancelLabel: l, onCancel: u, onConfirm: d, onClearSelection: f, onUpload: p, onCancelUpload: m, chrome: h = "section", className: g }) {
1341
- return /* @__PURE__ */ F("footer", {
1520
+ function $e({ tab: e, selectedItems: t, selectedIds: n, selectionMode: i, stagedFiles: a, uploading: o = !1, strings: s, confirmLabel: c, cancelLabel: l, onCancel: u, onConfirm: d, onClearSelection: f, onUpload: p, onCancelUpload: m, chrome: h = "section", className: g }) {
1521
+ return /* @__PURE__ */ L("footer", {
1342
1522
  className: r("media-library-footer--component", h === "section" && "border-t border-border bg-background text-foreground p-surface", g),
1343
- children: /* @__PURE__ */ I("div", {
1523
+ children: /* @__PURE__ */ R("div", {
1344
1524
  className: "flex min-w-0 flex-col gap-space-lg @md/media-library:flex-row @md/media-library:justify-between",
1345
- children: [/* @__PURE__ */ F(We, {
1525
+ children: [/* @__PURE__ */ L(Qe, {
1346
1526
  tab: e,
1347
1527
  selectedIds: n,
1348
1528
  selectionMode: i,
1349
1529
  stagedFiles: a,
1350
1530
  strings: s,
1351
1531
  onClearSelection: f
1352
- }), /* @__PURE__ */ F(Ge, {
1532
+ }), /* @__PURE__ */ L(Y, {
1353
1533
  tab: e,
1354
1534
  selectedItems: t,
1355
1535
  selectedIds: n,
@@ -1368,9 +1548,9 @@ function Ke({ tab: e, selectedItems: t, selectedIds: n, selectionMode: i, staged
1368
1548
  }
1369
1549
  //#endregion
1370
1550
  //#region src/components/features/media-library/media-library.tsx
1371
- var qe = j(null);
1372
- function Je(e, t, n) {
1373
- return N(() => {
1551
+ var et = ae(null);
1552
+ function tt(e, t, n) {
1553
+ return P(() => {
1374
1554
  if (e) return e;
1375
1555
  let r = /* @__PURE__ */ new Set();
1376
1556
  for (let e of t) {
@@ -1387,175 +1567,189 @@ function Je(e, t, n) {
1387
1567
  t
1388
1568
  ]);
1389
1569
  }
1390
- function $({ title: o, titleSuffix: c, description: p, confirmLabel: m, cancelLabel: h, selectionMode: g = "multiple", density: v = "comfortable", showMeta: y = !0, allowUpload: b = !0, typeFilters: x, confirmOnSelect: w = !1, onConfirm: T, onCancel: E, onClose: D, bulkActions: te, strings: ne, slots: A, heightClassName: re, className: j, items: M, fetcher: N, accessors: P, collections: se, value: L, defaultValue: ce, onValueChange: R, onItemUpdate: z, onItemDelete: B, onItemReplace: ue, onItemOpen: de, onUpload: fe, onError: pe, selecting: me, defaultSelecting: he, onSelectingChange: ge, tab: _e, defaultTab: ve, onTabChange: ye, view: xe, defaultView: Se, onViewChange: we, query: Te, defaultQuery: U, onQueryChange: Ee, type: De, defaultType: Oe, onTypeChange: ke, collection: Ae, defaultCollection: je, onCollectionChange: Me, sort: Ne, defaultSort: Pe, onSortChange: Fe, uploadOptions: Ie, defaultUploadOptions: Le, onUploadOptionsChange: W, ...ze }) {
1391
- let { defaultScale: Be } = e(), Ve = t(void 0, Be), G = n(Ce, ne), K = Re({
1570
+ function nt({ title: o, titleSuffix: c, description: u, confirmLabel: f, cancelLabel: h, selectionMode: g = "multiple", density: _ = "comfortable", showMeta: v = !0, allowUpload: x = !0, typeFilters: S, confirmOnSelect: C = !1, onConfirm: ee, onCancel: E, onClose: D, bulkActions: O, strings: ne, slots: A, heightClassName: ie, className: j, items: M, fetcher: ae, refreshKey: N, accessors: P, collections: ce, value: le, defaultValue: z, onValueChange: ue, onItemUpdate: B, onItemDelete: de, onItemReplace: pe, onItemOpen: me, onUpload: he, onError: ge, selecting: _e, defaultSelecting: V, onSelectingChange: ve, tab: ye, defaultTab: be, onTabChange: xe, view: Ce, defaultView: we, onViewChange: Ee, query: De, defaultQuery: Oe, onQueryChange: ke, type: Ae, defaultType: je, onTypeChange: Me, collection: Ne, defaultCollection: Pe, onCollectionChange: Fe, sort: Ie, defaultSort: Le, onSortChange: Re, uploadOptions: ze, defaultUploadOptions: Be, onUploadOptionsChange: He, ...Ue }) {
1571
+ let { defaultScale: W } = t(), We = e(void 0, W), G = n(H, ne), K = Ve({
1392
1572
  items: M,
1393
- fetcher: N,
1573
+ fetcher: ae,
1574
+ refreshKey: N,
1394
1575
  accessors: P,
1395
- collections: se,
1576
+ collections: ce,
1396
1577
  selectionMode: g,
1397
- value: L,
1398
- defaultValue: ce,
1399
- onValueChange: R,
1400
- onItemUpdate: z,
1401
- onItemDelete: B,
1402
- onUpload: fe,
1403
- onError: pe,
1404
- tab: _e,
1405
- defaultTab: ve,
1406
- onTabChange: ye,
1407
- view: xe,
1408
- defaultView: Se,
1409
- onViewChange: we,
1410
- query: Te,
1411
- defaultQuery: U,
1412
- onQueryChange: Ee,
1413
- type: De,
1414
- defaultType: Oe,
1415
- onTypeChange: ke,
1416
- collection: Ae,
1417
- defaultCollection: je,
1418
- onCollectionChange: Me,
1419
- sort: Ne,
1420
- defaultSort: Pe,
1421
- onSortChange: Fe,
1422
- uploadOptions: Ie,
1423
- defaultUploadOptions: Le,
1424
- onUploadOptionsChange: W,
1425
- selecting: me,
1426
- defaultSelecting: he ?? w,
1427
- onSelectingChange: ge
1428
- }), q = Je(se, K.items, K.accessors.getCollection), J = b ? K.tab : "library", $ = K.detailId ? K.items.find((e) => K.accessors.getId(e) === K.detailId) ?? null : null, Ye = ie(qe), Xe = !A?.footer, Ze = Ye && Xe ? /* @__PURE__ */ F(We, {
1429
- tab: J,
1578
+ value: le,
1579
+ defaultValue: z,
1580
+ onValueChange: ue,
1581
+ onItemUpdate: B,
1582
+ onItemDelete: de,
1583
+ onUpload: he,
1584
+ onError: ge,
1585
+ tab: ye,
1586
+ defaultTab: be,
1587
+ onTabChange: xe,
1588
+ view: Ce,
1589
+ defaultView: we,
1590
+ onViewChange: Ee,
1591
+ query: De,
1592
+ defaultQuery: Oe,
1593
+ onQueryChange: ke,
1594
+ type: Ae,
1595
+ defaultType: je,
1596
+ onTypeChange: Me,
1597
+ collection: Ne,
1598
+ defaultCollection: Pe,
1599
+ onCollectionChange: Fe,
1600
+ sort: Ie,
1601
+ defaultSort: Le,
1602
+ onSortChange: Re,
1603
+ uploadOptions: ze,
1604
+ defaultUploadOptions: Be,
1605
+ onUploadOptionsChange: He,
1606
+ selecting: _e,
1607
+ defaultSelecting: V ?? C,
1608
+ onSelectingChange: ve
1609
+ }), Ge = tt(ce, K.items, K.accessors.getCollection), q = x ? K.tab : "library", [J, nt] = I(null), rt = F(null), it = J ? K.accessors.getId(J.item) : null, X = K.detailId ? K.items.find((e) => K.accessors.getId(e) === K.detailId) ?? (it === K.detailId ? J?.item ?? null : null) : null, at = K.mutationError?.operation === "delete" && K.mutationError.itemId === it, Z = oe(et), ot = !A?.footer, st = Z && ot ? /* @__PURE__ */ L(Qe, {
1610
+ tab: q,
1430
1611
  selectedIds: K.selectedIds,
1431
1612
  selectionMode: g,
1432
1613
  stagedFiles: K.stagedFiles,
1433
1614
  strings: G,
1434
1615
  onClearSelection: K.clearSelection,
1435
1616
  className: "media-library-dialog--selection-summary shrink-0 justify-end"
1436
- }) : null, Qe = !!(o || c || p || A?.headerStart), $e = !!(b || A?.headerEnd || Ze), et = Qe || $e, tt = () => {
1437
- T?.(K.selectedItems, K.selectedIds), D?.();
1438
- }, nt = () => {
1617
+ }) : null, ct = !!(o || c || u || A?.headerStart), lt = !!(x || A?.headerEnd || st), ut = ct || lt, dt = () => {
1618
+ ee?.(K.selectedItems, K.selectedIds), D?.();
1619
+ }, ft = () => {
1439
1620
  E?.(), D?.();
1440
- }, rt = (e) => {
1621
+ }, pt = (e) => {
1441
1622
  let t = K.accessors.getId(e);
1442
- K.toggleSelection(t), w && (T?.([e], [t]), D?.());
1443
- }, it = oe(null), at = oe(null), ot = (e) => {
1444
- at.current = document.activeElement instanceof HTMLElement ? document.activeElement : null, K.setDetailId(e);
1445
- }, st = (e) => {
1446
- de ? de(e) : ot(K.accessors.getId(e));
1623
+ K.toggleSelection(t), C && (ee?.([e], [t]), D?.());
1624
+ }, mt = F(null), ht = F(null), Q = F(null), gt = F(!1), _t = (e) => !de || rt.current ? Promise.resolve(!1) : new Promise((t) => {
1625
+ let n = {
1626
+ item: e,
1627
+ resolve: t
1628
+ };
1629
+ rt.current = n, nt(n);
1630
+ }), vt = (e) => {
1631
+ let t = rt.current;
1632
+ rt.current = null, nt(null), t?.resolve(e);
1447
1633
  };
1448
- ae(() => {
1634
+ se(() => () => {
1635
+ rt.current?.resolve(!1), rt.current = null;
1636
+ }, []);
1637
+ let yt = (e) => {
1638
+ Q.current = document.activeElement instanceof HTMLElement ? document.activeElement : null, K.setDetailId(e);
1639
+ }, bt = (e) => {
1640
+ me ? me(e) : yt(K.accessors.getId(e));
1641
+ };
1642
+ se(() => {
1449
1643
  if (K.detailId !== null) {
1450
- at.current && it.current?.querySelector("[data-media-detail-close]")?.focus();
1644
+ Q.current && mt.current?.querySelector("[data-media-detail-close]")?.focus();
1451
1645
  return;
1452
1646
  }
1453
- let e = at.current;
1454
- at.current = null, e?.isConnected && e.focus();
1647
+ let e = Q.current;
1648
+ Q.current = null, gt.current ? (gt.current = !1, ht.current?.focus()) : e?.isConnected && e.focus();
1455
1649
  }, [K.detailId]);
1456
- let ct = K.query.trim(), lt = ct.length > 0 ? H(G.countSearch, {
1650
+ let xt = !!ae && !K.loading && K.loadError != null, St = K.query.trim(), Ct = St.length > 0 ? U(G.countSearch, {
1457
1651
  count: K.filteredCount,
1458
1652
  total: K.totalCount,
1459
- query: ct
1460
- }) : K.filteredCount === K.totalCount ? H(G.countAll, { count: K.totalCount }) : H(G.countFiltered, {
1653
+ query: St
1654
+ }) : K.filteredCount === K.totalCount ? U(G.countAll, { count: K.totalCount }) : U(G.countFiltered, {
1461
1655
  count: K.filteredCount,
1462
1656
  total: K.totalCount
1463
- }), ut = !!te && !(Ye || T && !w), dt = oe(null), ft = J === "library" ? K.selectedIds.length : 0, pt = A?.footer ?? (ut && J === "library" ? null : Ye ? /* @__PURE__ */ F(Ge, {
1464
- tab: J,
1657
+ }), $ = !!O && !(Z || ee && !C), wt = q === "library" ? K.selectedIds.length : 0, Tt = A?.footer ?? ($ && q === "library" ? null : Z ? /* @__PURE__ */ L(Y, {
1658
+ tab: q,
1465
1659
  selectedItems: K.selectedItems,
1466
1660
  selectedIds: K.selectedIds,
1467
1661
  stagedFiles: K.stagedFiles,
1468
1662
  uploading: K.uploading,
1469
1663
  strings: G,
1470
- confirmLabel: m,
1664
+ confirmLabel: f,
1471
1665
  cancelLabel: h,
1472
- onCancel: nt,
1473
- onConfirm: tt,
1666
+ onCancel: ft,
1667
+ onConfirm: dt,
1474
1668
  onUpload: K.startUpload,
1475
1669
  onCancelUpload: () => {
1476
1670
  K.cancelUpload(), K.clearStagedFiles(), K.setTab("library");
1477
1671
  },
1478
1672
  className: "ml-auto"
1479
- }) : /* @__PURE__ */ F(Ke, {
1480
- tab: J,
1673
+ }) : /* @__PURE__ */ L($e, {
1674
+ tab: q,
1481
1675
  selectedItems: K.selectedItems,
1482
1676
  selectedIds: K.selectedIds,
1483
1677
  selectionMode: g,
1484
1678
  stagedFiles: K.stagedFiles,
1485
1679
  uploading: K.uploading,
1486
1680
  strings: G,
1487
- confirmLabel: m,
1681
+ confirmLabel: f,
1488
1682
  cancelLabel: h,
1489
- onCancel: nt,
1490
- onConfirm: tt,
1683
+ onCancel: ft,
1684
+ onConfirm: dt,
1491
1685
  onClearSelection: K.clearSelection,
1492
1686
  onUpload: K.startUpload,
1493
1687
  onCancelUpload: () => {
1494
1688
  K.cancelUpload(), K.clearStagedFiles(), K.setTab("library");
1495
1689
  }
1496
1690
  }));
1497
- return /* @__PURE__ */ I("section", {
1498
- ref: it,
1499
- className: r("media-library--component @container/media-library box-border flex min-h-0 flex-col overflow-hidden rounded-radius border border-border bg-background text-foreground", re ?? "h-190 max-h-[calc(100vh-7rem)]", j),
1500
- ...ze,
1691
+ return /* @__PURE__ */ R("section", {
1692
+ ref: mt,
1693
+ className: r("media-library--component @container/media-library box-border flex min-h-0 flex-col overflow-hidden rounded-surface border border-border bg-background text-foreground", ie ?? "h-190 max-h-[calc(100vh-7rem)]", j),
1694
+ ...Ue,
1501
1695
  children: [
1502
- et && /* @__PURE__ */ I("header", {
1696
+ ut && /* @__PURE__ */ R("header", {
1503
1697
  className: "media-library--header flex flex-col gap-space-lg border-b border-border p-surface @2xl/media-library:flex-row @2xl/media-library:items-center @2xl/media-library:justify-between",
1504
- children: [Qe && /* @__PURE__ */ I(l, {
1698
+ children: [ct && /* @__PURE__ */ R(l, {
1505
1699
  direction: "horizontal",
1506
1700
  align: "start",
1507
1701
  gap: "lg",
1508
1702
  className: "min-w-0",
1509
- children: [A?.headerStart, (o || c || p) && /* @__PURE__ */ I(l, {
1703
+ children: [A?.headerStart, (o || c || u) && /* @__PURE__ */ R(l, {
1510
1704
  gap: "normal",
1511
1705
  className: "min-w-0",
1512
- children: [!!(o || c) && /* @__PURE__ */ F(u, {
1706
+ children: [!!(o || c) && /* @__PURE__ */ L(d, {
1513
1707
  title: o,
1514
1708
  suffix: c,
1515
1709
  className: "media-library--title"
1516
- }), !!p && /* @__PURE__ */ F(a, {
1710
+ }), !!u && /* @__PURE__ */ L(a, {
1517
1711
  type: "secondary",
1518
- children: p
1712
+ children: u
1519
1713
  })]
1520
1714
  })]
1521
- }), $e && /* @__PURE__ */ I("div", {
1522
- className: r("media-library--header-controls flex min-w-0 flex-wrap items-center gap-space-md", Ze ? "flex-1 justify-between" : "@2xl/media-library:justify-end"),
1523
- children: [/* @__PURE__ */ I(l, {
1715
+ }), lt && /* @__PURE__ */ R("div", {
1716
+ className: r("media-library--header-controls flex min-w-0 flex-wrap items-center gap-space-md", st ? "flex-1 justify-between" : "@2xl/media-library:justify-end"),
1717
+ children: [/* @__PURE__ */ R(l, {
1524
1718
  direction: "horizontal",
1525
1719
  wrap: !0,
1526
1720
  align: "center",
1527
1721
  gap: "md",
1528
1722
  className: "min-w-0",
1529
- children: [b && /* @__PURE__ */ I("div", {
1530
- className: r("media-library--tabs", O.frame, k[Ve]),
1723
+ children: [x && /* @__PURE__ */ R("div", {
1724
+ className: r("media-library--tabs", k.frame, re[We]),
1531
1725
  role: "tablist",
1532
- children: [/* @__PURE__ */ I(i, {
1726
+ children: [/* @__PURE__ */ R(i, {
1533
1727
  type: "button",
1534
1728
  role: "tab",
1535
- "aria-selected": J === "library",
1729
+ "aria-selected": q === "library",
1536
1730
  tone: "secondary",
1537
1731
  buttonStyle: "ghost",
1538
1732
  size: "sm",
1539
- className: r(O.item, "shadow-none", J === "library" ? `${_.segmentActive} hover:bg-card` : "text-muted-foreground hover:bg-transparent hover:text-foreground"),
1733
+ className: r(k.item, "shadow-none", q === "library" ? `${b.segmentActive} hover:bg-card` : "text-muted-foreground hover:bg-transparent hover:text-foreground"),
1540
1734
  onClick: () => K.setTab("library"),
1541
- children: [/* @__PURE__ */ F(le, { className: "size-icon-md" }), G.tabs.library]
1542
- }), /* @__PURE__ */ I(i, {
1735
+ children: [/* @__PURE__ */ L(fe, { className: "size-icon-md" }), G.tabs.library]
1736
+ }), /* @__PURE__ */ R(i, {
1543
1737
  type: "button",
1544
1738
  role: "tab",
1545
- "aria-selected": J === "upload",
1739
+ "aria-selected": q === "upload",
1546
1740
  tone: "secondary",
1547
1741
  buttonStyle: "ghost",
1548
1742
  size: "sm",
1549
- className: r(O.item, "shadow-none", J === "upload" ? `${_.segmentActive} hover:bg-card` : "text-muted-foreground hover:bg-transparent hover:text-foreground"),
1743
+ className: r(k.item, "shadow-none", q === "upload" ? `${b.segmentActive} hover:bg-card` : "text-muted-foreground hover:bg-transparent hover:text-foreground"),
1550
1744
  onClick: () => K.setTab("upload"),
1551
1745
  children: [
1552
- /* @__PURE__ */ F(be, { className: "size-icon-md" }),
1746
+ /* @__PURE__ */ L(Se, { className: "size-icon-md" }),
1553
1747
  G.tabs.upload,
1554
- K.stagedFiles.length > 0 && /* @__PURE__ */ F(C, {
1748
+ K.stagedFiles.length > 0 && /* @__PURE__ */ L(T, {
1555
1749
  size: "sm",
1556
1750
  tone: "secondary",
1557
1751
  className: "media-library--staged-count",
1558
- children: /* @__PURE__ */ F(S, {
1752
+ children: /* @__PURE__ */ L(w, {
1559
1753
  value: K.stagedFiles.length,
1560
1754
  size: "inherit",
1561
1755
  weight: "inherit",
@@ -1566,37 +1760,38 @@ function $({ title: o, titleSuffix: c, description: p, confirmLabel: m, cancelLa
1566
1760
  ]
1567
1761
  })]
1568
1762
  }), A?.headerEnd]
1569
- }), Ze]
1763
+ }), st]
1570
1764
  })]
1571
1765
  }),
1572
- /* @__PURE__ */ I("div", {
1766
+ /* @__PURE__ */ R("div", {
1573
1767
  className: "media-library--body flex min-h-0 flex-1",
1574
- children: [J === "upload" ? /* @__PURE__ */ F("div", {
1768
+ children: [q === "upload" ? /* @__PURE__ */ L("div", {
1575
1769
  className: "min-w-0 flex-1 overflow-y-auto",
1576
- children: /* @__PURE__ */ F(Q, {
1770
+ children: /* @__PURE__ */ L(Ze, {
1577
1771
  stagedFiles: K.stagedFiles,
1578
1772
  uploadOptions: K.uploadOptions,
1579
- collections: q,
1773
+ collections: Ge,
1580
1774
  uploading: K.uploading,
1775
+ hasUploadError: K.uploadError != null && K.stagedFiles.length > 0,
1581
1776
  strings: G,
1582
1777
  onFiles: K.addFiles,
1583
1778
  onRemoveFile: K.removeStagedFile,
1584
1779
  onOptionsChange: K.updateUploadOptions,
1585
1780
  empty: A?.uploadEmpty
1586
1781
  })
1587
- }) : /* @__PURE__ */ I("div", {
1588
- className: r("media-library--library min-w-0 flex-1 flex-col", $ ? "hidden @2xl/media-library:flex" : "flex"),
1589
- children: [/* @__PURE__ */ I(l, {
1782
+ }) : /* @__PURE__ */ R("div", {
1783
+ className: r("media-library--library min-w-0 flex-1 flex-col", X ? "hidden @2xl/media-library:flex" : "flex"),
1784
+ children: [/* @__PURE__ */ L(l, {
1590
1785
  gap: "md",
1591
1786
  className: "media-library--toolbar border-b border-border/60 p-surface",
1592
- children: [/* @__PURE__ */ F(He, {
1787
+ children: /* @__PURE__ */ L(qe, {
1593
1788
  query: K.query,
1594
1789
  type: K.type,
1595
- typeFilters: x,
1790
+ typeFilters: S,
1596
1791
  collection: K.collection,
1597
1792
  sort: K.sort,
1598
1793
  view: K.view,
1599
- collections: q,
1794
+ collections: Ge,
1600
1795
  strings: G,
1601
1796
  onQueryChange: K.setQuery,
1602
1797
  onTypeChange: K.setType,
@@ -1606,43 +1801,61 @@ function $({ title: o, titleSuffix: c, description: p, confirmLabel: m, cancelLa
1606
1801
  onClearFilters: K.clearFilters,
1607
1802
  toolbarEnd: A?.toolbarEnd,
1608
1803
  selecting: K.selecting,
1609
- onSelectingChange: K.setSelecting
1610
- }), /* @__PURE__ */ F(a, {
1611
- size: "xs",
1612
- type: "secondary",
1613
- "aria-live": "polite",
1614
- children: lt
1615
- })]
1616
- }), /* @__PURE__ */ F("div", {
1617
- ref: dt,
1804
+ onSelectingChange: K.setSelecting,
1805
+ disabled: xt,
1806
+ summary: /* @__PURE__ */ L("span", {
1807
+ "aria-live": "polite",
1808
+ className: "media-library--count min-w-0 truncate",
1809
+ children: xt || K.loading ? null : /* @__PURE__ */ L(a, {
1810
+ tag: "span",
1811
+ size: "xs",
1812
+ type: "secondary",
1813
+ children: Ct
1814
+ })
1815
+ })
1816
+ })
1817
+ }), /* @__PURE__ */ L("div", {
1818
+ ref: ht,
1618
1819
  role: "region",
1619
1820
  "aria-label": G.resultsLabel,
1821
+ "aria-busy": K.loading || void 0,
1620
1822
  tabIndex: 0,
1621
- className: `media-library--results min-h-0 flex-1 overflow-y-auto p-surface focus-visible:outline-none ${s.inset}`,
1622
- children: K.loading ? A?.loading ?? /* @__PURE__ */ F(d, {
1623
- className: "min-h-64",
1624
- label: G.loading
1625
- }) : K.error ? A?.error ?? /* @__PURE__ */ F(f, {
1626
- title: G.errorTitle,
1627
- description: G.errorDescription
1628
- }) : K.visibleItems.length === 0 ? A?.empty ?? /* @__PURE__ */ F(Y, {
1629
- title: K.hasFilters ? G.emptyFilteredTitle : G.emptyLibraryTitle,
1630
- description: K.hasFilters ? G.emptyFilteredDescription : G.emptyLibraryDescription,
1631
- action: K.hasFilters ? /* @__PURE__ */ F(i, {
1632
- type: "button",
1633
- tone: "secondary",
1634
- buttonStyle: "outline",
1635
- onClick: K.clearFilters,
1636
- children: G.clearFilters
1637
- }) : b ? /* @__PURE__ */ F(i, {
1638
- tone: "primary",
1639
- type: "button",
1640
- onClick: () => K.setTab("upload"),
1641
- children: G.uploadMedia
1642
- }) : void 0
1643
- }) : K.view === "table" ? /* @__PURE__ */ F("div", {
1823
+ className: `media-library--results flex min-h-0 flex-1 flex-col overflow-y-auto p-surface focus-visible:outline-none ${s.inset}`,
1824
+ children: K.loading && !K.hasLoadedResults ? /* @__PURE__ */ L("div", {
1825
+ className: "media-library--state my-auto",
1826
+ children: A?.loading ?? /* @__PURE__ */ L(p, {
1827
+ className: "min-h-64",
1828
+ label: G.loading
1829
+ })
1830
+ }) : xt ? /* @__PURE__ */ L("div", {
1831
+ className: "media-library--state my-auto",
1832
+ children: A?.error ?? /* @__PURE__ */ L(m, {
1833
+ title: G.errorTitle,
1834
+ description: G.errorDescription,
1835
+ onRetry: ae ? K.retry : void 0,
1836
+ retryLabel: G.retry ?? H.retry
1837
+ })
1838
+ }) : K.visibleItems.length === 0 ? /* @__PURE__ */ L("div", {
1839
+ className: "media-library--state my-auto",
1840
+ children: A?.empty ?? /* @__PURE__ */ L(Ke, {
1841
+ title: K.hasFilters ? G.emptyFilteredTitle : G.emptyLibraryTitle,
1842
+ description: K.hasFilters ? G.emptyFilteredDescription : G.emptyLibraryDescription,
1843
+ action: K.hasFilters ? /* @__PURE__ */ L(i, {
1844
+ type: "button",
1845
+ tone: "secondary",
1846
+ buttonStyle: "outline",
1847
+ onClick: K.clearFilters,
1848
+ children: G.clearFilters
1849
+ }) : x ? /* @__PURE__ */ L(i, {
1850
+ tone: "primary",
1851
+ type: "button",
1852
+ onClick: () => K.setTab("upload"),
1853
+ children: G.uploadMedia
1854
+ }) : void 0
1855
+ })
1856
+ }) : K.view === "table" ? /* @__PURE__ */ L("div", {
1644
1857
  className: "overflow-x-auto",
1645
- children: /* @__PURE__ */ F(Z, {
1858
+ children: /* @__PURE__ */ L(Ye, {
1646
1859
  items: K.visibleItems,
1647
1860
  selectedSet: K.selectedSet,
1648
1861
  selectionMode: g,
@@ -1650,17 +1863,17 @@ function $({ title: o, titleSuffix: c, description: p, confirmLabel: m, cancelLa
1650
1863
  strings: G,
1651
1864
  onToggle: (e) => {
1652
1865
  let t = K.items.find((t) => K.accessors.getId(t) === e);
1653
- t && rt(t);
1866
+ t && pt(t);
1654
1867
  },
1655
- onDetails: ot,
1868
+ onDetails: yt,
1656
1869
  selecting: K.selecting,
1657
1870
  onOpen: (e) => {
1658
1871
  let t = K.items.find((t) => K.accessors.getId(t) === e);
1659
- t && st(t);
1872
+ t && bt(t);
1660
1873
  }
1661
1874
  })
1662
- }) : /* @__PURE__ */ F("div", {
1663
- className: r("media-library--grid grid min-w-0 gap-space-lg", v === "compact" ? "grid-cols-[repeat(auto-fill,minmax(136px,1fr))]" : "grid-cols-[repeat(auto-fill,minmax(168px,1fr))]"),
1875
+ }) : /* @__PURE__ */ L("div", {
1876
+ className: r("media-library--grid grid min-w-0 gap-space-lg", _ === "compact" ? "grid-cols-[repeat(auto-fill,minmax(136px,1fr))]" : "grid-cols-[repeat(auto-fill,minmax(168px,1fr))]"),
1664
1877
  children: K.visibleItems.map((e) => {
1665
1878
  let t = K.accessors.getId(e), n = {
1666
1879
  id: t,
@@ -1668,15 +1881,15 @@ function $({ title: o, titleSuffix: c, description: p, confirmLabel: m, cancelLa
1668
1881
  selectionMode: g,
1669
1882
  selecting: K.selecting,
1670
1883
  accessors: K.accessors,
1671
- toggle: () => rt(e),
1672
- openDetails: () => ot(t),
1673
- open: () => st(e)
1884
+ toggle: () => pt(e),
1885
+ openDetails: () => yt(t),
1886
+ open: () => bt(e)
1674
1887
  }, r = A?.renderItem?.(e, n);
1675
- return r ? /* @__PURE__ */ F("div", { children: r }, t) : /* @__PURE__ */ F(X, {
1888
+ return r ? /* @__PURE__ */ L("div", { children: r }, t) : /* @__PURE__ */ L(Je, {
1676
1889
  item: e,
1677
1890
  selected: n.selected,
1678
- density: v,
1679
- showMeta: y,
1891
+ density: _,
1892
+ showMeta: v,
1680
1893
  selectionMode: g,
1681
1894
  accessors: K.accessors,
1682
1895
  strings: G,
@@ -1688,36 +1901,50 @@ function $({ title: o, titleSuffix: c, description: p, confirmLabel: m, cancelLa
1688
1901
  })
1689
1902
  })
1690
1903
  })]
1691
- }), J === "library" && /* @__PURE__ */ F(Ue, {
1692
- item: $,
1693
- collections: q,
1904
+ }), q === "library" && /* @__PURE__ */ L(Xe, {
1905
+ item: X,
1906
+ collections: Ge,
1694
1907
  accessors: K.accessors,
1695
1908
  strings: G,
1696
1909
  onClose: () => K.setDetailId(null),
1697
- onUpdate: (e) => $ ? K.updateItem($, e) : Promise.resolve(!1),
1698
- onReplace: ue && $ ? () => ue($) : void 0,
1699
- onRemove: async () => {
1700
- if (!$) return !1;
1701
- let e = await K.removeItem($);
1702
- return e && K.setDetailId(null), e;
1703
- },
1910
+ readOnly: !B,
1911
+ onUpdate: (e) => X ? K.updateItem(X, e) : Promise.resolve(!1),
1912
+ mutationError: K.mutationError?.itemId === K.detailId ? K.mutationError : null,
1913
+ onReplace: pe && X ? () => pe(X) : void 0,
1914
+ allowDelete: !!de,
1915
+ onRemove: () => X ? _t(X) : Promise.resolve(!1),
1704
1916
  renderDetail: A?.renderDetail
1705
1917
  })]
1706
1918
  }),
1707
- Ye ? Ye.element ? V(pt, Ye.element) : null : pt,
1708
- ut && /* @__PURE__ */ F(ee, {
1709
- selectedCount: ft,
1919
+ Z ? Z.element ? Te(Tt, Z.element) : null : Tt,
1920
+ (de || J) && /* @__PURE__ */ L(y, {
1921
+ open: J !== null,
1922
+ onOpenChange: (e) => {
1923
+ e || vt(!1);
1924
+ },
1925
+ destructive: !0,
1926
+ title: G.detail.confirmDeleteTitle ?? H.detail.confirmDeleteTitle,
1927
+ description: J ? U(G.detail.confirmDeleteDescription ?? H.detail.confirmDeleteDescription ?? "", { name: K.accessors.getName(J.item) }) : void 0,
1928
+ strings: { confirm: G.detail.confirmDeleteLabel ?? H.detail.confirmDeleteLabel },
1929
+ alertMessage: at ? G.detail.confirmDeleteError ?? H.detail.confirmDeleteError : void 0,
1930
+ closeOnAsyncComplete: !1,
1931
+ onAsyncConfirm: async () => {
1932
+ J && await K.removeItem(J.item) && rt.current === J && (gt.current = !0, K.setDetailId(null), vt(!0));
1933
+ }
1934
+ }),
1935
+ $ && /* @__PURE__ */ L(te, {
1936
+ selectedCount: wt,
1710
1937
  totalCount: K.totalCount,
1711
1938
  onClear: K.clearSelection,
1712
- returnFocusRef: dt,
1939
+ returnFocusRef: ht,
1713
1940
  className: "media-library--bulk-actions",
1714
1941
  strings: {
1715
1942
  label: G.batchActionsLabel,
1716
- summary: (e) => H(G.footer.selectedCount, { count: e }),
1943
+ summary: (e) => U(G.footer.selectedCount, { count: e }),
1717
1944
  clear: G.footer.clear
1718
1945
  },
1719
- children: ft > 0 && te?.({
1720
- selectedItems: K.selectedItems,
1946
+ children: wt > 0 && O?.({
1947
+ selectedItems: K.items.filter((e) => K.selectedSet.has(K.accessors.getId(e))),
1721
1948
  selectedIds: K.selectedIds,
1722
1949
  selectedCount: K.selectedIds.length,
1723
1950
  visibleCount: K.filteredCount,
@@ -1728,15 +1955,15 @@ function $({ title: o, titleSuffix: c, description: p, confirmLabel: m, cancelLa
1728
1955
  ]
1729
1956
  });
1730
1957
  }
1731
- function Ye({ open: e, onOpenChange: t, trigger: i, dialogTitle: a, dialogDescription: o, onClose: s, className: c, dialogClassName: l, contentClassName: u, closeOnEscape: d = !0, closeOnBackdropClick: f = !0, ...p }) {
1732
- let m = n(Ce, p.strings), [h, _] = P(!1), [v, y] = P(null), b = e !== void 0, x = b ? e : h, S = (e) => {
1733
- b || _(e), t?.(e);
1958
+ function rt({ open: e, onOpenChange: t, trigger: i, dialogTitle: a, dialogDescription: o, onClose: s, className: c, dialogClassName: l, contentClassName: u, closeOnEscape: d = !0, closeOnBackdropClick: f = !0, ...p }) {
1959
+ let m = n(H, p.strings), [h, g] = I(!1), [_, y] = I(null), b = e !== void 0, x = b ? e : h, S = (e) => {
1960
+ b || g(e), t?.(e);
1734
1961
  }, C = () => {
1735
1962
  S(!1), s?.();
1736
1963
  };
1737
- return /* @__PURE__ */ F(qe.Provider, {
1738
- value: { element: v },
1739
- children: /* @__PURE__ */ F(g, {
1964
+ return /* @__PURE__ */ L(et.Provider, {
1965
+ value: { element: _ },
1966
+ children: /* @__PURE__ */ L(v, {
1740
1967
  open: x,
1741
1968
  onOpenChange: S,
1742
1969
  onClose: s,
@@ -1746,7 +1973,7 @@ function Ye({ open: e, onOpenChange: t, trigger: i, dialogTitle: a, dialogDescri
1746
1973
  size: "full",
1747
1974
  showCancel: !1,
1748
1975
  showConfirm: !1,
1749
- footer: /* @__PURE__ */ F("div", {
1976
+ footer: /* @__PURE__ */ L("div", {
1750
1977
  ref: y,
1751
1978
  className: "media-library-dialog--footer @container/media-library w-full"
1752
1979
  }),
@@ -1754,7 +1981,7 @@ function Ye({ open: e, onOpenChange: t, trigger: i, dialogTitle: a, dialogDescri
1754
1981
  contentClassName: r("media-library-dialog--body flex min-h-0 flex-col overflow-hidden p-0", u),
1755
1982
  closeOnBackdropClick: f,
1756
1983
  closeOnEscape: d,
1757
- children: /* @__PURE__ */ F($, {
1984
+ children: /* @__PURE__ */ L(nt, {
1758
1985
  ...p,
1759
1986
  defaultSelecting: p.defaultSelecting ?? !0,
1760
1987
  onClose: C,
@@ -1767,45 +1994,45 @@ function Ye({ open: e, onOpenChange: t, trigger: i, dialogTitle: a, dialogDescri
1767
1994
  }
1768
1995
  //#endregion
1769
1996
  //#region src/components/features/media-library/media-resource-gallery.tsx
1770
- function Xe(e, t, n) {
1997
+ function it(e, t, n) {
1771
1998
  let r = e.slice(), [i] = r.splice(t, 1);
1772
1999
  return i === void 0 || r.splice(n, 0, i), r;
1773
2000
  }
1774
- function Ze({ items: e, accessors: t, title: o, description: s, primaryId: c, onPrimaryChange: u, onRemove: d, onReorder: f, onAdd: p, maxItems: h, layout: g = "field", density: v = "comfortable", readOnly: b = !1, empty: x, action: S, renderItem: ee, strings: w, className: T, ...E }) {
1775
- let D = n(Ce, w), O = De(t), k = e.length, ne = c ?? (k > 0 ? O.getId(e[0]) : void 0), A = !b && !!p && (h === void 0 || k < h), re = A && (g === "field" || k > 0) ? /* @__PURE__ */ F(i, {
2001
+ function X({ items: e, accessors: t, title: o, description: s, primaryId: c, onPrimaryChange: u, onRemove: d, onReorder: f, onAdd: p, maxItems: m, layout: h = "field", density: _ = "comfortable", readOnly: v = !1, empty: y, action: x, renderItem: C, strings: ee, className: w, ...te }) {
2002
+ let E = n(H, ee), D = Ae(t), O = e.length, ne = c ?? (O > 0 ? D.getId(e[0]) : void 0), k = !v && !!p && (m === void 0 || O < m), re = !v && !!u, ie = !v && !!d, j = !v && !!f, M = re || ie || j, ae = k && (h === "field" || O > 0) ? /* @__PURE__ */ L(i, {
1776
2003
  type: "button",
1777
2004
  tone: "secondary",
1778
2005
  buttonStyle: "outline",
1779
- icon: ge,
2006
+ icon: ve,
1780
2007
  onClick: p,
1781
- children: D.gallery.add
1782
- }) : h !== void 0 && k >= h ? /* @__PURE__ */ F(C, {
2008
+ children: E.gallery.add
2009
+ }) : m !== void 0 && O >= m ? /* @__PURE__ */ L(T, {
1783
2010
  tone: "secondary",
1784
- children: D.gallery.maxReached
1785
- }) : null, j = (t, n) => {
1786
- if (n < 0 || n >= k || t === n) return;
1787
- let r = Xe(e, t, n);
1788
- f?.(r.map((e) => O.getId(e)), r);
1789
- }, M = !!(o || s || S || re), ie = k === 0 && g !== "field", ae = () => !A || g !== "field" ? null : /* @__PURE__ */ I("button", {
2011
+ children: E.gallery.maxReached
2012
+ }) : null, N = (t, n) => {
2013
+ if (!j || n < 0 || n >= O || t === n) return;
2014
+ let r = it(e, t, n);
2015
+ f?.(r.map((e) => D.getId(e)), r);
2016
+ }, oe = !!(o || s || x || ae), se = O === 0 && h !== "field", P = () => !k || h !== "field" ? null : /* @__PURE__ */ R("button", {
1790
2017
  type: "button",
1791
- className: r("media-resource-gallery--add-tile box-border m-0 inline-flex w-full cursor-pointer items-center justify-center p-space-md font-sans rounded-radius border border-dashed border-border bg-background text-muted-foreground shadow-none", `aspect-square ${te.hover}`),
1792
- "aria-label": D.gallery.addTile,
2018
+ className: r("media-resource-gallery--add-tile box-border m-0 inline-flex w-full cursor-pointer items-center justify-center p-space-md font-sans rounded-radius border border-dashed border-border bg-background text-muted-foreground shadow-none", `aspect-square ${A.hover}`),
2019
+ "aria-label": E.gallery.addTile,
1793
2020
  onClick: p,
1794
- children: [/* @__PURE__ */ F(ge, { className: "size-icon" }), /* @__PURE__ */ F(a, {
2021
+ children: [/* @__PURE__ */ L(ve, { className: "size-icon" }), /* @__PURE__ */ L(a, {
1795
2022
  tag: "span",
1796
2023
  size: "inherit",
1797
2024
  className: "sr-only",
1798
- children: D.gallery.addTile
2025
+ children: E.gallery.addTile
1799
2026
  })]
1800
2027
  });
1801
- return /* @__PURE__ */ I("section", {
1802
- className: r("media-resource-gallery--component @container/media-resource-gallery rounded-radius border border-border bg-card text-card-foreground shadow-xs", T),
1803
- "data-layout": g,
1804
- "data-gallery-density": v,
1805
- ...E,
1806
- children: [M && /* @__PURE__ */ F("header", {
2028
+ return /* @__PURE__ */ R("section", {
2029
+ className: r("media-resource-gallery--component @container/media-resource-gallery rounded-surface border border-border bg-card text-card-foreground shadow-xs", w),
2030
+ "data-layout": h,
2031
+ "data-gallery-density": _,
2032
+ ...te,
2033
+ children: [oe && /* @__PURE__ */ L("header", {
1807
2034
  className: "media-resource-gallery--header p-surface",
1808
- children: /* @__PURE__ */ I(l, {
2035
+ children: /* @__PURE__ */ R(l, {
1809
2036
  direction: {
1810
2037
  base: "vertical",
1811
2038
  md: "horizontal"
@@ -1813,301 +2040,301 @@ function Ze({ items: e, accessors: t, title: o, description: s, primaryId: c, on
1813
2040
  gap: "lg",
1814
2041
  align: { md: "start" },
1815
2042
  justify: { md: "between" },
1816
- children: [/* @__PURE__ */ I(l, {
2043
+ children: [/* @__PURE__ */ R(l, {
1817
2044
  gap: "normal",
1818
2045
  className: "min-w-0",
1819
- children: [!!o && /* @__PURE__ */ F(a, {
2046
+ children: [!!o && /* @__PURE__ */ L(a, {
1820
2047
  tag: "div",
1821
2048
  type: "inherit",
1822
2049
  weight: "semibold",
1823
2050
  children: o
1824
- }), !!s && /* @__PURE__ */ F(a, {
2051
+ }), !!s && /* @__PURE__ */ L(a, {
1825
2052
  type: "secondary",
1826
2053
  children: s
1827
2054
  })]
1828
- }), /* @__PURE__ */ F(l, {
2055
+ }), /* @__PURE__ */ L(l, {
1829
2056
  direction: "horizontal",
1830
2057
  wrap: !0,
1831
2058
  align: "center",
1832
- gap: m.commands,
2059
+ gap: g.commands,
1833
2060
  className: "media-resource-gallery--actions",
1834
- children: S ?? re
2061
+ children: x ?? ae
1835
2062
  })]
1836
2063
  })
1837
- }), ie ? /* @__PURE__ */ F("div", {
2064
+ }), se ? /* @__PURE__ */ L("div", {
1838
2065
  className: "media-resource-gallery--empty px-surface pb-surface",
1839
- children: x ?? /* @__PURE__ */ F(Y, {
1840
- title: D.gallery.emptyTitle,
1841
- description: D.gallery.emptyDescription,
1842
- action: A ? /* @__PURE__ */ F(i, {
2066
+ children: y ?? /* @__PURE__ */ L(Ke, {
2067
+ title: E.gallery.emptyTitle,
2068
+ description: E.gallery.emptyDescription,
2069
+ action: k ? /* @__PURE__ */ L(i, {
1843
2070
  tone: "primary",
1844
2071
  type: "button",
1845
- icon: ue,
2072
+ icon: pe,
1846
2073
  onClick: p,
1847
- children: D.gallery.add
2074
+ children: E.gallery.add
1848
2075
  }) : void 0
1849
2076
  })
1850
- }) : /* @__PURE__ */ I("div", {
1851
- className: r("grid min-w-0 grid-cols-1", g === "list" ? "gap-space-md" : "gap-space-lg", "media-resource-gallery--items p-surface", M && "pt-0", g === "list" ? void 0 : g === "field" ? "grid-cols-[repeat(auto-fill,minmax(96px,1fr))] @md/media-resource-gallery:grid-cols-[repeat(auto-fill,minmax(108px,1fr))]" : v === "compact" ? "grid-cols-[repeat(auto-fill,minmax(132px,1fr))]" : "grid-cols-[repeat(auto-fill,minmax(164px,1fr))]"),
2077
+ }) : /* @__PURE__ */ R("div", {
2078
+ className: r("grid min-w-0 grid-cols-1", h === "list" ? "gap-space-md" : "gap-space-lg", "media-resource-gallery--items p-surface", oe && "pt-0", h === "list" ? void 0 : h === "field" ? "grid-cols-[repeat(auto-fill,minmax(96px,1fr))] @md/media-resource-gallery:grid-cols-[repeat(auto-fill,minmax(108px,1fr))]" : _ === "compact" ? "grid-cols-[repeat(auto-fill,minmax(132px,1fr))]" : "grid-cols-[repeat(auto-fill,minmax(164px,1fr))]"),
1852
2079
  children: [e.map((e, t) => {
1853
- let n = O.getId(e), o = O.getName(e), s = O.getType(e), c = O.getSrc(e), f = O.getAlt(e) || o, p = n === ne, m = O.getPublic(e) === !1, h = O.getDuration(e), x = t > 0, S = t < k - 1, w = ee?.(e, {
2080
+ let n = D.getId(e), o = D.getName(e), s = D.getType(e), c = D.getSrc(e), f = D.getAlt(e) || o, p = n === ne, m = D.getPublic(e) === !1, g = D.getDuration(e), v = j && t > 0, y = j && t < O - 1, x = C?.(e, {
1854
2081
  id: n,
1855
2082
  index: t,
1856
- total: k,
2083
+ total: O,
1857
2084
  primary: p,
1858
- accessors: O,
1859
- canMovePrevious: x,
1860
- canMoveNext: S,
1861
- setPrimary: () => u?.(n, e),
1862
- remove: () => d?.(n, e),
1863
- movePrevious: () => j(t, t - 1),
1864
- moveNext: () => j(t, t + 1)
2085
+ accessors: D,
2086
+ canMovePrevious: v,
2087
+ canMoveNext: y,
2088
+ setPrimary: () => {
2089
+ re && u?.(n, e);
2090
+ },
2091
+ remove: () => {
2092
+ ie && d?.(n, e);
2093
+ },
2094
+ movePrevious: () => N(t, t - 1),
2095
+ moveNext: () => N(t, t + 1)
1865
2096
  });
1866
- return w ? /* @__PURE__ */ F("div", { children: w }, n) : g === "field" ? /* @__PURE__ */ I("div", {
1867
- className: r("media-resource-gallery--item group/gallery relative aspect-square overflow-hidden rounded-radius border border-border bg-background text-foreground shadow-xs", `transition-colors ${_.tileHover}`, p && "col-span-2 row-span-2 min-h-52"),
2097
+ return x ? /* @__PURE__ */ L("div", { children: x }, n) : h === "field" ? /* @__PURE__ */ R("div", {
2098
+ className: r("media-resource-gallery--item group/gallery relative aspect-square overflow-hidden rounded-radius border border-border bg-background text-foreground shadow-xs", `transition-colors ${b.tileHover}`, p && "col-span-2 row-span-2 min-h-52"),
1868
2099
  "data-primary": p || void 0,
1869
2100
  children: [
1870
- c ? /* @__PURE__ */ F("img", {
2101
+ c ? /* @__PURE__ */ L("img", {
1871
2102
  src: c,
1872
2103
  alt: f,
1873
2104
  loading: "lazy",
1874
2105
  className: "size-full object-cover"
1875
- }) : /* @__PURE__ */ F("div", {
2106
+ }) : /* @__PURE__ */ L("div", {
1876
2107
  className: "flex size-full items-center justify-center bg-muted text-muted-foreground",
1877
- children: /* @__PURE__ */ F(z, { className: p ? "size-7" : "size-icon-lg" })
2108
+ children: /* @__PURE__ */ L(B, { className: p ? "size-7" : "size-icon-lg" })
1878
2109
  }),
1879
- p && /* @__PURE__ */ F(C, {
2110
+ p && /* @__PURE__ */ L(T, {
1880
2111
  tone: "secondary",
1881
2112
  className: "absolute left-2 top-2 bg-background shadow-xs",
1882
- children: D.gallery.cover
2113
+ children: E.gallery.cover
1883
2114
  }),
1884
- s === "video" && !!h && /* @__PURE__ */ I(C, {
2115
+ s === "video" && !!g && /* @__PURE__ */ R(T, {
1885
2116
  tone: "secondary",
1886
2117
  className: "absolute bottom-2 left-2 bg-foreground text-background",
1887
- children: [/* @__PURE__ */ F(he, { className: "size-icon-sm fill-current" }), h]
2118
+ children: [/* @__PURE__ */ L(V, { className: "size-icon-sm fill-current" }), g]
1888
2119
  }),
1889
- m && /* @__PURE__ */ F("span", {
2120
+ m && /* @__PURE__ */ L("span", {
1890
2121
  className: "absolute bottom-2 right-2 inline-flex size-6 items-center justify-center rounded-full border border-border bg-background text-muted-foreground shadow-xs",
1891
- children: /* @__PURE__ */ F(me, { className: "size-icon-sm" })
2122
+ children: /* @__PURE__ */ L(_e, { className: "size-icon-sm" })
1892
2123
  }),
1893
- !b && /* @__PURE__ */ F(i, {
2124
+ ie && /* @__PURE__ */ L(i, {
1894
2125
  type: "button",
1895
2126
  tone: "secondary",
1896
2127
  buttonStyle: "solid",
1897
2128
  size: "sm",
1898
2129
  iconOnly: !0,
1899
2130
  className: "absolute right-2 top-2 opacity-0 shadow-sm transition-opacity group-hover/gallery:opacity-100 group-focus-within/gallery:opacity-100",
1900
- "aria-label": D.gallery.remove,
2131
+ "aria-label": E.gallery.remove,
1901
2132
  onClick: () => d?.(n, e),
1902
- children: /* @__PURE__ */ F(Se, { className: "size-icon-md" })
2133
+ children: /* @__PURE__ */ L(we, { className: "size-icon-md" })
1903
2134
  })
1904
2135
  ]
1905
- }, n) : g === "list" ? /* @__PURE__ */ I(l, {
2136
+ }, n) : h === "list" ? /* @__PURE__ */ R(l, {
1906
2137
  direction: "horizontal",
1907
2138
  wrap: !0,
1908
2139
  align: "center",
1909
2140
  gap: "lg",
1910
- className: r("media-resource-gallery--item min-w-0 rounded-radius border border-border bg-background text-foreground px-row-x", v === "compact" ? "py-row-y-sm" : "py-row-y"),
2141
+ className: r("media-resource-gallery--item min-w-0 rounded-radius border border-border bg-background text-foreground px-row-x", _ === "compact" ? "py-row-y-sm" : "py-row-y"),
1911
2142
  "data-primary": p || void 0,
1912
2143
  children: [
1913
- /* @__PURE__ */ F("div", {
1914
- className: "relative size-12 shrink-0 overflow-hidden rounded-inner bg-muted",
1915
- children: c ? /* @__PURE__ */ F("img", {
2144
+ /* @__PURE__ */ L("div", {
2145
+ className: "relative size-12 shrink-0 overflow-hidden rounded-radius bg-muted",
2146
+ children: c ? /* @__PURE__ */ L("img", {
1916
2147
  src: c,
1917
2148
  alt: f,
1918
2149
  loading: "lazy",
1919
2150
  className: "size-full object-cover"
1920
- }) : /* @__PURE__ */ F("div", {
2151
+ }) : /* @__PURE__ */ L("div", {
1921
2152
  className: "flex size-full items-center justify-center text-muted-foreground",
1922
- children: /* @__PURE__ */ F(z, { className: "size-icon" })
2153
+ children: /* @__PURE__ */ L(B, { className: "size-icon" })
1923
2154
  })
1924
2155
  }),
1925
- /* @__PURE__ */ I("div", {
2156
+ /* @__PURE__ */ R("div", {
1926
2157
  className: "min-w-0 flex-1",
1927
- children: [/* @__PURE__ */ I(l, {
2158
+ children: [/* @__PURE__ */ R(l, {
1928
2159
  direction: "horizontal",
1929
2160
  wrap: !0,
1930
2161
  align: "center",
1931
2162
  gap: "md",
1932
2163
  className: "min-w-0",
1933
- children: [/* @__PURE__ */ F(a, {
2164
+ children: [/* @__PURE__ */ L(a, {
1934
2165
  tag: "div",
1935
2166
  weight: "semibold",
1936
2167
  className: "min-w-0 break-all",
1937
2168
  children: o
1938
- }), p && /* @__PURE__ */ F(C, {
2169
+ }), p && /* @__PURE__ */ L(T, {
1939
2170
  tone: "secondary",
1940
- children: D.gallery.primary
2171
+ children: E.gallery.primary
1941
2172
  })]
1942
- }), /* @__PURE__ */ I(a, {
2173
+ }), /* @__PURE__ */ R(a, {
1943
2174
  size: "xs",
1944
2175
  type: "secondary",
1945
- children: [
1946
- H(D.gallery.itemPosition, {
1947
- index: t + 1,
1948
- total: k
1949
- }),
1950
- " · ",
1951
- /* @__PURE__ */ F(y, {
1952
- value: O.getSize(e),
1953
- size: "xs",
1954
- align: "left",
1955
- emptyLabel: D.unknownSize
1956
- })
1957
- ]
2176
+ children: [U(E.gallery.itemPosition, {
2177
+ index: t + 1,
2178
+ total: O
2179
+ }), D.getSize(e) !== void 0 && /* @__PURE__ */ R(ce, { children: [" · ", /* @__PURE__ */ L(S, {
2180
+ value: D.getSize(e),
2181
+ size: "xs",
2182
+ align: "left",
2183
+ emptyLabel: E.unknownSize
2184
+ })] })]
1958
2185
  })]
1959
2186
  }),
1960
- !b && /* @__PURE__ */ I("div", {
2187
+ M && /* @__PURE__ */ R("div", {
1961
2188
  className: "media-resource-gallery--item-actions flex basis-full flex-wrap items-center justify-end gap-space-xs @sm/media-resource-gallery:basis-auto",
1962
2189
  children: [
1963
- /* @__PURE__ */ F(i, {
2190
+ re && /* @__PURE__ */ L(i, {
1964
2191
  type: "button",
1965
2192
  tone: "secondary",
1966
2193
  buttonStyle: "ghost",
1967
2194
  size: "sm",
1968
2195
  iconOnly: !0,
1969
2196
  disabled: p,
1970
- "aria-label": D.gallery.setPrimary,
2197
+ "aria-label": E.gallery.setPrimary,
1971
2198
  onClick: () => u?.(n, e),
1972
- children: /* @__PURE__ */ F(ve, { className: "size-icon-md" })
2199
+ children: /* @__PURE__ */ L(be, { className: "size-icon-md" })
1973
2200
  }),
1974
- /* @__PURE__ */ F(i, {
2201
+ j && /* @__PURE__ */ L(i, {
1975
2202
  type: "button",
1976
2203
  tone: "secondary",
1977
2204
  buttonStyle: "ghost",
1978
2205
  size: "sm",
1979
2206
  iconOnly: !0,
1980
- disabled: !x,
1981
- "aria-label": D.gallery.movePrevious,
1982
- onClick: () => j(t, t - 1),
1983
- children: /* @__PURE__ */ F(L, { className: "size-icon-md" })
2207
+ disabled: !v,
2208
+ "aria-label": E.gallery.movePrevious,
2209
+ onClick: () => N(t, t - 1),
2210
+ children: /* @__PURE__ */ L(le, { className: "size-icon-md" })
1984
2211
  }),
1985
- /* @__PURE__ */ F(i, {
2212
+ j && /* @__PURE__ */ L(i, {
1986
2213
  type: "button",
1987
2214
  tone: "secondary",
1988
2215
  buttonStyle: "ghost",
1989
2216
  size: "sm",
1990
2217
  iconOnly: !0,
1991
- disabled: !S,
1992
- "aria-label": D.gallery.moveNext,
1993
- onClick: () => j(t, t + 1),
1994
- children: /* @__PURE__ */ F(ce, { className: "size-icon-md" })
2218
+ disabled: !y,
2219
+ "aria-label": E.gallery.moveNext,
2220
+ onClick: () => N(t, t + 1),
2221
+ children: /* @__PURE__ */ L(z, { className: "size-icon-md" })
1995
2222
  }),
1996
- /* @__PURE__ */ F(i, {
2223
+ ie && /* @__PURE__ */ L(i, {
1997
2224
  type: "button",
1998
2225
  tone: "destructive",
1999
2226
  buttonStyle: "ghost",
2000
2227
  size: "sm",
2001
2228
  iconOnly: !0,
2002
- "aria-label": D.gallery.remove,
2229
+ "aria-label": E.gallery.remove,
2003
2230
  onClick: () => d?.(n, e),
2004
- children: /* @__PURE__ */ F(ye, { className: "size-icon-md" })
2231
+ children: /* @__PURE__ */ L(xe, { className: "size-icon-md" })
2005
2232
  })
2006
2233
  ]
2007
2234
  })
2008
2235
  ]
2009
- }, n) : /* @__PURE__ */ I("div", {
2010
- className: `media-resource-gallery--item group/gallery overflow-hidden rounded-radius border border-border bg-background text-foreground shadow-xs transition-colors ${_.tileHover}`,
2236
+ }, n) : /* @__PURE__ */ R("div", {
2237
+ className: `media-resource-gallery--item group/gallery overflow-hidden rounded-radius border border-border bg-background text-foreground shadow-xs transition-colors ${b.tileHover}`,
2011
2238
  "data-primary": p || void 0,
2012
- children: [/* @__PURE__ */ I("div", {
2239
+ children: [/* @__PURE__ */ R("div", {
2013
2240
  className: "relative aspect-[4/3] bg-muted",
2014
- children: [c ? /* @__PURE__ */ F("img", {
2241
+ children: [c ? /* @__PURE__ */ L("img", {
2015
2242
  src: c,
2016
2243
  alt: f,
2017
2244
  loading: "lazy",
2018
- className: "size-full object-cover"
2019
- }) : /* @__PURE__ */ F("div", {
2245
+ className: "size-full object-contain"
2246
+ }) : /* @__PURE__ */ L("div", {
2020
2247
  className: "flex size-full items-center justify-center text-muted-foreground",
2021
- children: /* @__PURE__ */ F(z, { className: "size-6" })
2022
- }), /* @__PURE__ */ I("div", {
2248
+ children: /* @__PURE__ */ L(B, { className: "size-6" })
2249
+ }), /* @__PURE__ */ R("div", {
2023
2250
  className: "absolute left-2 top-2 flex flex-wrap gap-space-xs",
2024
- children: [p && /* @__PURE__ */ F(C, {
2251
+ children: [p && /* @__PURE__ */ L(T, {
2025
2252
  tone: "secondary",
2026
2253
  className: "bg-card text-card-foreground",
2027
- children: D.gallery.primary
2028
- }), /* @__PURE__ */ F(C, {
2254
+ children: E.gallery.primary
2255
+ }), /* @__PURE__ */ L(T, {
2029
2256
  tone: "secondary",
2030
2257
  className: "bg-card text-card-foreground",
2031
- children: H(D.gallery.itemPosition, {
2258
+ children: U(E.gallery.itemPosition, {
2032
2259
  index: t + 1,
2033
- total: k
2260
+ total: O
2034
2261
  })
2035
2262
  })]
2036
2263
  })]
2037
- }), /* @__PURE__ */ F("div", {
2038
- className: r("media-resource-gallery--item-body", v === "compact" ? "p-surface-xs" : "p-surface"),
2039
- children: /* @__PURE__ */ I(l, {
2264
+ }), /* @__PURE__ */ L("div", {
2265
+ className: r("media-resource-gallery--item-body", _ === "compact" ? "p-surface-xs" : "p-surface"),
2266
+ children: /* @__PURE__ */ R(l, {
2040
2267
  gap: "md",
2041
- children: [/* @__PURE__ */ I("div", {
2268
+ children: [/* @__PURE__ */ R("div", {
2042
2269
  className: "min-w-0",
2043
- children: [/* @__PURE__ */ F(a, {
2270
+ children: [/* @__PURE__ */ L(a, {
2044
2271
  tag: "div",
2045
2272
  weight: "semibold",
2046
2273
  className: "truncate",
2047
2274
  children: o
2048
- }), /* @__PURE__ */ F(y, {
2049
- value: O.getSize(e),
2275
+ }), D.getSize(e) !== void 0 && /* @__PURE__ */ L(S, {
2276
+ value: D.getSize(e),
2050
2277
  size: "xs",
2051
2278
  align: "left",
2052
- emptyLabel: D.unknownSize
2279
+ emptyLabel: E.unknownSize
2053
2280
  })]
2054
- }), !b && /* @__PURE__ */ I("div", {
2281
+ }), M && /* @__PURE__ */ R("div", {
2055
2282
  className: "flex items-center gap-space-xs",
2056
2283
  children: [
2057
- /* @__PURE__ */ F(i, {
2284
+ re && /* @__PURE__ */ L(i, {
2058
2285
  type: "button",
2059
2286
  tone: "secondary",
2060
2287
  buttonStyle: "ghost",
2061
2288
  size: "sm",
2062
2289
  iconOnly: !0,
2063
2290
  disabled: p,
2064
- "aria-label": D.gallery.setPrimary,
2291
+ "aria-label": E.gallery.setPrimary,
2065
2292
  onClick: () => u?.(n, e),
2066
- children: /* @__PURE__ */ F(ve, { className: "size-icon-md" })
2293
+ children: /* @__PURE__ */ L(be, { className: "size-icon-md" })
2067
2294
  }),
2068
- /* @__PURE__ */ F(i, {
2295
+ j && /* @__PURE__ */ L(i, {
2069
2296
  type: "button",
2070
2297
  tone: "secondary",
2071
2298
  buttonStyle: "ghost",
2072
2299
  size: "sm",
2073
2300
  iconOnly: !0,
2074
- disabled: !x,
2075
- "aria-label": D.gallery.movePrevious,
2076
- onClick: () => j(t, t - 1),
2077
- children: /* @__PURE__ */ F(L, { className: "size-icon-md" })
2301
+ disabled: !v,
2302
+ "aria-label": E.gallery.movePrevious,
2303
+ onClick: () => N(t, t - 1),
2304
+ children: /* @__PURE__ */ L(le, { className: "size-icon-md" })
2078
2305
  }),
2079
- /* @__PURE__ */ F(i, {
2306
+ j && /* @__PURE__ */ L(i, {
2080
2307
  type: "button",
2081
2308
  tone: "secondary",
2082
2309
  buttonStyle: "ghost",
2083
2310
  size: "sm",
2084
2311
  iconOnly: !0,
2085
- disabled: !S,
2086
- "aria-label": D.gallery.moveNext,
2087
- onClick: () => j(t, t + 1),
2088
- children: /* @__PURE__ */ F(ce, { className: "size-icon-md" })
2312
+ disabled: !y,
2313
+ "aria-label": E.gallery.moveNext,
2314
+ onClick: () => N(t, t + 1),
2315
+ children: /* @__PURE__ */ L(z, { className: "size-icon-md" })
2089
2316
  }),
2090
- /* @__PURE__ */ F(i, {
2317
+ ie && /* @__PURE__ */ L(i, {
2091
2318
  type: "button",
2092
2319
  tone: "destructive",
2093
2320
  buttonStyle: "ghost",
2094
2321
  size: "sm",
2095
2322
  iconOnly: !0,
2096
2323
  className: "ml-auto",
2097
- "aria-label": D.gallery.remove,
2324
+ "aria-label": E.gallery.remove,
2098
2325
  onClick: () => d?.(n, e),
2099
- children: /* @__PURE__ */ F(ye, { className: "size-icon-md" })
2326
+ children: /* @__PURE__ */ L(xe, { className: "size-icon-md" })
2100
2327
  })
2101
2328
  ]
2102
2329
  })]
2103
2330
  })
2104
2331
  })]
2105
2332
  }, n);
2106
- }), ae()]
2333
+ }), P()]
2107
2334
  })]
2108
2335
  });
2109
2336
  }
2110
2337
  //#endregion
2111
- export { $ as MediaLibrary, X as MediaLibraryCard, Ue as MediaLibraryDetailPanel, Ye as MediaLibraryDialog, Y as MediaLibraryEmptyState, Ke as MediaLibraryFooter, Z as MediaLibraryList, He as MediaLibraryToolbar, Q as MediaLibraryUploadPanel, Ze as MediaResourceGallery, Ce as defaultMediaLibraryStrings, Oe as formatMediaLibrarySize, H as formatMediaLibraryString, ke as getMediaLibraryDimensions, De as resolveMediaLibraryAccessors, Re as useMediaLibrary };
2338
+ export { nt as MediaLibrary, Je as MediaLibraryCard, Xe as MediaLibraryDetailPanel, rt as MediaLibraryDialog, Ke as MediaLibraryEmptyState, $e as MediaLibraryFooter, Ye as MediaLibraryList, qe as MediaLibraryToolbar, Ze as MediaLibraryUploadPanel, X as MediaResourceGallery, H as defaultMediaLibraryStrings, je as formatMediaLibrarySize, U as formatMediaLibraryString, Me as getMediaLibraryDimensions, Ae as resolveMediaLibraryAccessors, Ve as useMediaLibrary };
2112
2339
 
2113
2340
  //# sourceMappingURL=media-library.js.map