themelia-react-ui 2.0.6 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (912) hide show
  1. package/CHANGELOG.md +250 -0
  2. package/MIGRATION.md +746 -7
  3. package/README.md +27 -23
  4. package/dist/{accordion-0tQUZ20r.js → accordion-DNVqwEIC.js} +36 -36
  5. package/dist/accordion-DNVqwEIC.js.map +1 -0
  6. package/dist/action-menu-D5343RwT.js +286 -0
  7. package/dist/action-menu-D5343RwT.js.map +1 -0
  8. package/dist/ai-artifact-otrz9ZwS.js +1214 -0
  9. package/dist/ai-artifact-otrz9ZwS.js.map +1 -0
  10. package/dist/anchored-positioning-1U_eBFNx.js +9 -0
  11. package/dist/anchored-positioning-1U_eBFNx.js.map +1 -0
  12. package/dist/app-shell-CPN30Nb1.js +372 -0
  13. package/dist/app-shell-CPN30Nb1.js.map +1 -0
  14. package/dist/{attachment-BCpA4e7i.js → attachment-D2-fpfmv.js} +15 -15
  15. package/dist/{attachment-BCpA4e7i.js.map → attachment-D2-fpfmv.js.map} +1 -1
  16. package/dist/{auth-B0girIk_.js → auth-g_oUTDDC.js} +234 -241
  17. package/dist/auth-g_oUTDDC.js.map +1 -0
  18. package/dist/{avatar-B9Jnp-T-.js → avatar-Ca3Ihrq4.js} +4 -4
  19. package/dist/{avatar-B9Jnp-T-.js.map → avatar-Ca3Ihrq4.js.map} +1 -1
  20. package/dist/{badge-wWauMgAt.js → badge-oGiXblW7.js} +8 -9
  21. package/dist/badge-oGiXblW7.js.map +1 -0
  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 +2 -2
  29. package/dist/base/cards.js +3 -3
  30. package/dist/base/carousel.js +11 -11
  31. package/dist/base/carousel.js.map +1 -1
  32. package/dist/base/cascader.js +1 -1
  33. package/dist/base/chart.js +1 -1
  34. package/dist/base/choice-inputs.js +2 -2
  35. package/dist/base/code-block.js +1 -1
  36. package/dist/base/combobox.js +1 -1
  37. package/dist/base/command.js +1 -1
  38. package/dist/base/copyable.js +1 -1
  39. package/dist/base/date-pickers.js +2 -2
  40. package/dist/base/display.js +7 -7
  41. package/dist/base/feedback.js +4 -4
  42. package/dist/base/forms-numeric.js +2 -2
  43. package/dist/base/forms.js +2 -2
  44. package/dist/base/inline-edit.js +13 -13
  45. package/dist/base/inline-edit.js.map +1 -1
  46. package/dist/base/item.js +1 -1
  47. package/dist/base/media-gallery.js +203 -2
  48. package/dist/base/media-gallery.js.map +1 -0
  49. package/dist/base/metadata-list.js +1 -1
  50. package/dist/base/navigation.js +7 -7
  51. package/dist/base/popover-menu.js +1 -1
  52. package/dist/base/popover.js +1 -1
  53. package/dist/base/qr-code.js +32 -22
  54. package/dist/base/qr-code.js.map +1 -1
  55. package/dist/base/repeaters.js +91 -88
  56. package/dist/base/repeaters.js.map +1 -1
  57. package/dist/base/sidebar.js +2 -2
  58. package/dist/base/signature-pad.js +14 -14
  59. package/dist/base/signature-pad.js.map +1 -1
  60. package/dist/base/skeleton.js +1 -1
  61. package/dist/base/spinner.js +6 -12
  62. package/dist/base/spinner.js.map +1 -1
  63. package/dist/base/structure.js +1 -1
  64. package/dist/base/table.js +1 -1
  65. package/dist/base/text-inputs.js +3 -3
  66. package/dist/base/toaster.js +2 -2
  67. package/dist/base/tree.js +2 -2
  68. package/dist/base/upload-queue.js +303 -2
  69. package/dist/base/upload-queue.js.map +1 -0
  70. package/dist/base/upload.js +3 -4
  71. package/dist/base/value-inputs.js +1 -1
  72. package/dist/{batch-action-bar-BoqWIIpV.js → batch-action-bar-D6MZQNnC.js} +10 -10
  73. package/dist/{batch-action-bar-BoqWIIpV.js.map → batch-action-bar-D6MZQNnC.js.map} +1 -1
  74. package/dist/blocks/admin.js +242 -228
  75. package/dist/blocks/admin.js.map +1 -1
  76. package/dist/blocks/ai.js +395 -357
  77. package/dist/blocks/ai.js.map +1 -1
  78. package/dist/blocks/analytics/charts.js +1022 -0
  79. package/dist/blocks/analytics/charts.js.map +1 -0
  80. package/dist/blocks/analytics/usage-card.js +1 -1
  81. package/dist/blocks/analytics.js +171 -1365
  82. package/dist/blocks/analytics.js.map +1 -1
  83. package/dist/blocks/collaboration.js +1 -1
  84. package/dist/blocks/commerce/receipt.js +1 -1
  85. package/dist/blocks/commerce.js +1487 -1358
  86. package/dist/blocks/commerce.js.map +1 -1
  87. package/dist/blocks/data-display.js +2 -3
  88. package/dist/blocks/onboarding.js +91 -82
  89. package/dist/blocks/onboarding.js.map +1 -1
  90. package/dist/blocks/planning.js +25 -25
  91. package/dist/blocks/planning.js.map +1 -1
  92. package/dist/blocks/timelines.js +2 -2
  93. package/dist/{breadcrumbs-Bp9Ke7kd.js → breadcrumbs-CQ9JSlez.js} +52 -45
  94. package/dist/breadcrumbs-CQ9JSlez.js.map +1 -0
  95. package/dist/{button-ChBovTx0.js → button-rd6FiHfQ.js} +12 -8
  96. package/dist/button-rd6FiHfQ.js.map +1 -0
  97. package/dist/{buttons-DeW0bQeK.js → buttons-pZVgPTZn.js} +230 -246
  98. package/dist/buttons-pZVgPTZn.js.map +1 -0
  99. package/dist/{cards-CNXnmvV5.js → cards-CgWyqvgZ.js} +25 -22
  100. package/dist/{cards-CNXnmvV5.js.map → cards-CgWyqvgZ.js.map} +1 -1
  101. package/dist/cascader-Cf05pwaq.js +444 -0
  102. package/dist/cascader-Cf05pwaq.js.map +1 -0
  103. package/dist/{chart-I7ROnsl8.js → chart-CygRCyIZ.js} +5 -5
  104. package/dist/{chart-I7ROnsl8.js.map → chart-CygRCyIZ.js.map} +1 -1
  105. package/dist/{checkbox-MoyHIAPs.js → checkbox-Dy5_XBMZ.js} +4 -4
  106. package/dist/{checkbox-MoyHIAPs.js.map → checkbox-Dy5_XBMZ.js.map} +1 -1
  107. package/dist/{choice-inputs-DHGtx0QV.js → choice-inputs-oJEsrb5Y.js} +113 -114
  108. package/dist/choice-inputs-oJEsrb5Y.js.map +1 -0
  109. package/dist/{code-block-BSJyq9e-.js → code-block-BrLD7mCi.js} +44 -60
  110. package/dist/code-block-BrLD7mCi.js.map +1 -0
  111. package/dist/collapsible-CRCCg_bO.js +80 -0
  112. package/dist/collapsible-CRCCg_bO.js.map +1 -0
  113. package/dist/{collection-content-CSnwtOTH.js → collection-content-D7SoDlYd.js} +3 -3
  114. package/dist/{collection-content-CSnwtOTH.js.map → collection-content-D7SoDlYd.js.map} +1 -1
  115. package/dist/combobox-Dl6f6kHz.js +362 -0
  116. package/dist/combobox-Dl6f6kHz.js.map +1 -0
  117. package/dist/combobox-DrDXtSSt.js +929 -0
  118. package/dist/combobox-DrDXtSSt.js.map +1 -0
  119. package/dist/command-CjZ2VzKC.js +432 -0
  120. package/dist/command-CjZ2VzKC.js.map +1 -0
  121. package/dist/comments-C2MZyRmh.js +1214 -0
  122. package/dist/comments-C2MZyRmh.js.map +1 -0
  123. package/dist/components/base/accordion/accordion.d.ts +11 -3
  124. package/dist/components/base/action-menu/action-menu.d.ts +11 -3
  125. package/dist/components/base/buttons/button.d.ts +2 -2
  126. package/dist/components/base/buttons/index.d.ts +1 -1
  127. package/dist/components/base/buttons/loader-button.d.ts +6 -15
  128. package/dist/components/base/cards/index.d.ts +1 -1
  129. package/dist/components/base/cards/partials/card-body-context.d.ts +6 -0
  130. package/dist/components/base/cards/smart-card.d.ts +0 -2
  131. package/dist/components/base/cards/smart-card.types.d.ts +12 -10
  132. package/dist/components/base/cascader/cascader.d.ts +8 -2
  133. package/dist/components/base/cascader/cascader.types.d.ts +24 -2
  134. package/dist/components/base/cascader/index.d.ts +1 -1
  135. package/dist/components/base/choice-inputs/switch.d.ts +1 -1
  136. package/dist/components/base/code-block/use-code-copy.d.ts +2 -6
  137. package/dist/components/base/command/command.d.ts +1 -1
  138. package/dist/components/base/date-pickers/datepicker.types.d.ts +1 -3
  139. package/dist/components/base/display/dialog.d.ts +3 -9
  140. package/dist/components/base/display/index.d.ts +2 -3
  141. package/dist/components/base/display/separator.d.ts +1 -1
  142. package/dist/components/base/feedback/alert.d.ts +2 -1
  143. package/dist/components/base/feedback/empty.d.ts +10 -2
  144. package/dist/components/base/forms/workflow.d.ts +2 -2
  145. package/dist/components/base/forms-numeric/dimensions-input.d.ts +9 -17
  146. package/dist/components/base/forms-numeric/index.d.ts +3 -3
  147. package/dist/components/base/item/item.types.d.ts +6 -2
  148. package/dist/components/base/metadata-list/index.d.ts +1 -3
  149. package/dist/components/base/metadata-list/metadata-list.d.ts +4 -1
  150. package/dist/components/base/navigation/index.d.ts +2 -2
  151. package/dist/components/base/navigation/language-switcher.d.ts +7 -6
  152. package/dist/components/base/navigation/navigation-tabs.d.ts +8 -1
  153. package/dist/components/base/navigation/page-header/index.d.ts +1 -1
  154. package/dist/components/base/navigation/page-header/page-header.d.ts +13 -17
  155. package/dist/components/base/navigation/pagination.d.ts +5 -5
  156. package/dist/components/base/popover/popover.recipes.d.ts +0 -1
  157. package/dist/components/base/qr-code/qr-code.d.ts +4 -0
  158. package/dist/components/base/repeaters/index.d.ts +1 -1
  159. package/dist/components/base/repeaters/key-value-editor.d.ts +4 -0
  160. package/dist/components/base/sheet/sheet.d.ts +6 -15
  161. package/dist/components/base/sidebar/index.d.ts +1 -6
  162. package/dist/components/base/sidebar/sidebar.d.ts +38 -10
  163. package/dist/components/base/skeleton/skeleton.d.ts +1 -1
  164. package/dist/components/base/structure/structure.types.d.ts +11 -2
  165. package/dist/components/base/text-inputs/index.d.ts +1 -1
  166. package/dist/components/base/tree/index.d.ts +1 -0
  167. package/dist/components/base/tree/tree.d.ts +2 -2
  168. package/dist/components/base/tree/tree.types.d.ts +7 -1
  169. package/dist/components/base/upload/file-upload.validation.d.ts +37 -1
  170. package/dist/components/base/upload/image-upload.d.ts +2 -0
  171. package/dist/components/base/upload/index.d.ts +3 -9
  172. package/dist/components/base/value-inputs/date-time-input.d.ts +4 -0
  173. package/dist/components/base/value-inputs/slider.d.ts +5 -2
  174. package/dist/components/blocks/admin/action-surfaces/index.d.ts +17 -4
  175. package/dist/components/blocks/admin/api-key-list/api-key-list.types.d.ts +9 -3
  176. package/dist/components/blocks/admin/index.d.ts +1 -1
  177. package/dist/components/blocks/ai/ai-artifact/ai-artifact.d.ts +1 -1
  178. package/dist/components/blocks/ai/ai-artifact/types.d.ts +9 -4
  179. package/dist/components/blocks/ai/ai-chain-of-thought/ai-chain-of-thought.d.ts +1 -1
  180. package/dist/components/blocks/ai/ai-chain-of-thought/types.d.ts +11 -1
  181. package/dist/components/blocks/ai/ai-citation/ai-citation.d.ts +1 -1
  182. package/dist/components/blocks/ai/ai-citation/types.d.ts +6 -0
  183. package/dist/components/blocks/ai/ai-confirmation/ai-confirmation.d.ts +1 -1
  184. package/dist/components/blocks/ai/ai-confirmation/types.d.ts +21 -5
  185. package/dist/components/blocks/ai/ai-feedback/types.d.ts +7 -2
  186. package/dist/components/blocks/ai/ai-inline-citation/types.d.ts +9 -3
  187. package/dist/components/blocks/ai/ai-package-info/ai-package-info.d.ts +1 -1
  188. package/dist/components/blocks/ai/ai-package-info/types.d.ts +6 -0
  189. package/dist/components/blocks/ai/ai-sources/ai-sources.d.ts +1 -1
  190. package/dist/components/blocks/ai/ai-sources/types.d.ts +8 -2
  191. package/dist/components/blocks/ai/ai-task/ai-task.d.ts +1 -1
  192. package/dist/components/blocks/ai/ai-task/types.d.ts +10 -1
  193. package/dist/components/blocks/ai/ai-tool-call/ai-tool-call.d.ts +1 -1
  194. package/dist/components/blocks/ai/ai-tool-call/types.d.ts +6 -0
  195. package/dist/components/blocks/ai/ai.strings.d.ts +2 -0
  196. package/dist/components/blocks/analytics/activity-heatmap/types.d.ts +1 -1
  197. package/dist/components/blocks/analytics/analytics.strings.d.ts +2 -0
  198. package/dist/components/blocks/analytics/atoms/metric-trend-chip.d.ts +11 -1
  199. package/dist/components/blocks/analytics/chart-card/chart-card.d.ts +7 -5
  200. package/dist/components/blocks/analytics/charts/index.d.ts +27 -0
  201. package/dist/components/blocks/analytics/index.d.ts +17 -24
  202. package/dist/components/blocks/analytics/metric/metric.d.ts +5 -5
  203. package/dist/components/blocks/analytics/metric-grid/metric-grid.d.ts +2 -2
  204. package/dist/components/blocks/analytics/types.d.ts +12 -3
  205. package/dist/components/blocks/analytics/usage-card/usage-card.strings.d.ts +2 -0
  206. package/dist/components/blocks/commerce/address-card/address-card.d.ts +1 -1
  207. package/dist/components/blocks/commerce/address-card/types.d.ts +5 -16
  208. package/dist/components/blocks/commerce/booking-calendar-event-card/booking-calendar-event-card.d.ts +2 -2
  209. package/dist/components/blocks/commerce/booking-calendar-event-card/booking-calendar-event-card.types.d.ts +6 -4
  210. package/dist/components/blocks/commerce/cart-summary/cart-summary.d.ts +0 -2
  211. package/dist/components/blocks/commerce/cart-summary/index.d.ts +2 -2
  212. package/dist/components/blocks/commerce/cart-summary/types.d.ts +9 -11
  213. package/dist/components/blocks/commerce/coupon-input/coupon-input.d.ts +1 -1
  214. package/dist/components/blocks/commerce/coupon-input/types.d.ts +7 -3
  215. package/dist/components/blocks/commerce/discount-stack/discount-stack.d.ts +0 -2
  216. package/dist/components/blocks/commerce/discount-stack/index.d.ts +2 -2
  217. package/dist/components/blocks/commerce/discount-stack/types.d.ts +4 -6
  218. package/dist/components/blocks/commerce/fulfillment-group/fulfillment-group.d.ts +1 -1
  219. package/dist/components/blocks/commerce/fulfillment-group/types.d.ts +2 -0
  220. package/dist/components/blocks/commerce/giftcard-card/partials/giftcard-balance.d.ts +18 -0
  221. package/dist/components/blocks/commerce/giftcard-card/partials/giftcard-compact.d.ts +1 -1
  222. package/dist/components/blocks/commerce/giftcard-card/partials/giftcard-copy-button.d.ts +0 -1
  223. package/dist/components/blocks/commerce/giftcard-card/partials/giftcard-dark.d.ts +1 -1
  224. package/dist/components/blocks/commerce/giftcard-card/partials/giftcard-full.d.ts +1 -1
  225. package/dist/components/blocks/commerce/giftcard-card/partials/giftcard-illustrated.d.ts +1 -1
  226. package/dist/components/blocks/commerce/giftcard-card/partials/giftcard-minimal.d.ts +1 -1
  227. package/dist/components/blocks/commerce/giftcard-card/types.d.ts +16 -5
  228. package/dist/components/blocks/commerce/index.d.ts +8 -8
  229. package/dist/components/blocks/commerce/inventory-level/inventory-level.strings.d.ts +2 -0
  230. package/dist/components/blocks/commerce/inventory-level/types.d.ts +1 -1
  231. package/dist/components/blocks/commerce/inventory-section/types.d.ts +0 -5
  232. package/dist/components/blocks/commerce/invoice-line-items/types.d.ts +6 -3
  233. package/dist/components/blocks/commerce/loyalty-points/loyalty-points.d.ts +1 -1
  234. package/dist/components/blocks/commerce/loyalty-points/types.d.ts +11 -5
  235. package/dist/components/blocks/commerce/order-status/order-status.d.ts +1 -1
  236. package/dist/components/blocks/commerce/order-status/types.d.ts +8 -8
  237. package/dist/components/blocks/commerce/order-timeline/order-timeline.d.ts +1 -1
  238. package/dist/components/blocks/commerce/order-timeline/types.d.ts +3 -1
  239. package/dist/components/blocks/commerce/payment-method/index.d.ts +2 -2
  240. package/dist/components/blocks/commerce/payment-method/payment-method.d.ts +0 -8
  241. package/dist/components/blocks/commerce/payment-method/types.d.ts +0 -2
  242. package/dist/components/blocks/commerce/receipt/index.d.ts +1 -1
  243. package/dist/components/blocks/commerce/receipt/receipt-items.d.ts +1 -1
  244. package/dist/components/blocks/commerce/receipt/types.d.ts +10 -0
  245. package/dist/components/blocks/commerce/refund-status/index.d.ts +2 -2
  246. package/dist/components/blocks/commerce/refund-status/refund-status.d.ts +0 -2
  247. package/dist/components/blocks/commerce/refund-status/types.d.ts +0 -2
  248. package/dist/components/blocks/commerce/seo-listing/types.d.ts +7 -0
  249. package/dist/components/blocks/commerce/shared/code-entry.d.ts +39 -0
  250. package/dist/components/blocks/commerce/shared/order-status.d.ts +1 -1
  251. package/dist/components/blocks/commerce/subscription-summary/subscription-summary.d.ts +1 -1
  252. package/dist/components/blocks/commerce/subscription-summary/types.d.ts +10 -1
  253. package/dist/components/blocks/commerce/upcoming-booking/index.d.ts +2 -1
  254. package/dist/components/blocks/commerce/upcoming-booking/types.d.ts +8 -0
  255. package/dist/components/blocks/commerce/upcoming-booking/upcoming-booking.d.ts +2 -2
  256. package/dist/components/blocks/commerce/vendor-profile/types.d.ts +4 -5
  257. package/dist/components/blocks/commerce/voucher-entry/types.d.ts +6 -3
  258. package/dist/components/blocks/commerce/voucher-entry/voucher-entry.d.ts +1 -1
  259. package/dist/components/blocks/content-block-hooks.d.ts +22 -0
  260. package/dist/components/blocks/data-display/dense-info-card/dense-info.strings.d.ts +5 -1
  261. package/dist/components/blocks/data-display/dense-info-card/helpers.d.ts +3 -1
  262. package/dist/components/blocks/data-display/dense-info-card/index.d.ts +1 -1
  263. package/dist/components/blocks/data-display/dense-info-card/partials/dense-info-classification.d.ts +1 -1
  264. package/dist/components/blocks/data-display/dense-info-card/partials/dense-info-dashboard.d.ts +1 -1
  265. package/dist/components/blocks/data-display/dense-info-card/partials/dense-info-financial.d.ts +1 -1
  266. package/dist/components/blocks/data-display/dense-info-card/partials/dense-info-project.d.ts +1 -1
  267. package/dist/components/blocks/data-display/dense-info-card/partials/dense-info-score.d.ts +1 -1
  268. package/dist/components/blocks/data-display/dense-info-card/types.d.ts +12 -5
  269. package/dist/components/blocks/data-display/empty-state/empty-state.types.d.ts +6 -0
  270. package/dist/components/blocks/data-display/index.d.ts +0 -1
  271. package/dist/components/blocks/data-display/relationship-card-frame.d.ts +1 -1
  272. package/dist/components/blocks/onboarding/checklist/checklist.types.d.ts +5 -3
  273. package/dist/components/blocks/planning/task-card.types.d.ts +7 -3
  274. package/dist/components/blocks/timelines/changelog/types.d.ts +2 -2
  275. package/dist/components/blocks/timelines/index.d.ts +2 -2
  276. package/dist/components/blocks/timelines/milestones/types.d.ts +2 -2
  277. package/dist/components/blocks/timelines/shared/timeline.d.ts +6 -0
  278. package/dist/components/blocks/timelines/steps-card/index.d.ts +2 -1
  279. package/dist/components/blocks/timelines/steps-card/steps-card.d.ts +2 -2
  280. package/dist/components/blocks/timelines/steps-card/types.d.ts +13 -1
  281. package/dist/components/features/activities/activities.strings.d.ts +5 -3
  282. package/dist/components/features/activities/activities.types.d.ts +28 -11
  283. package/dist/components/features/activities/hooks/use-activity-feed.d.ts +6 -0
  284. package/dist/components/features/activities/index.d.ts +1 -1
  285. package/dist/components/features/activities/partials/activity-headline.d.ts +5 -0
  286. package/dist/components/features/activities/partials/activity-row.d.ts +12 -13
  287. package/dist/components/features/activities/partials/row-layers.d.ts +7 -0
  288. package/dist/components/features/activities/relative-time.d.ts +18 -0
  289. package/dist/components/features/ai-chat/ai-chat.d.ts +6 -2
  290. package/dist/components/features/ai-chat/ai-chat.strings.d.ts +41 -2
  291. package/dist/components/features/ai-chat/ai-chat.types.d.ts +6 -0
  292. package/dist/components/features/ai-chat/partials/ai-chat-attachments-strip.d.ts +5 -1
  293. package/dist/components/features/ai-chat/partials/ai-chat-prompt-input.d.ts +2 -2
  294. package/dist/components/features/ai-chat/partials/ai-chat-queue.d.ts +3 -1
  295. package/dist/components/features/ai-chat/partials/ai-chat-suggestions-row.d.ts +6 -1
  296. package/dist/components/features/appointment-calendar/appointment-calendar.d.ts +1 -1
  297. package/dist/components/features/appointment-calendar/appointment-calendar.types.d.ts +19 -5
  298. package/dist/components/features/appointment-calendar/index.d.ts +1 -1
  299. package/dist/components/features/appointment-calendar/partials/appointment-agenda.d.ts +18 -10
  300. package/dist/components/features/async-preview/async-preview.d.ts +2 -2
  301. package/dist/components/features/async-preview/async-preview.types.d.ts +30 -1
  302. package/dist/components/features/async-preview/preview-trigger-cell.d.ts +7 -2
  303. package/dist/components/features/combobox/async-resource-combobox.d.ts +2 -2
  304. package/dist/components/features/combobox/combobox.d.ts +12 -3
  305. package/dist/components/features/combobox/components/error-message.d.ts +3 -1
  306. package/dist/components/features/combobox/hooks/use-combobox-core.d.ts +2 -2
  307. package/dist/components/features/combobox/index.d.ts +1 -1
  308. package/dist/components/features/combobox/types.d.ts +47 -45
  309. package/dist/components/features/comments/comments.strings.d.ts +6 -5
  310. package/dist/components/features/comments/comments.types.d.ts +40 -26
  311. package/dist/components/features/comments/hooks/use-attachment-upload.d.ts +5 -1
  312. package/dist/components/features/comments/hooks/use-comments.d.ts +8 -1
  313. package/dist/components/features/data-view/data-view.strings.d.ts +9 -2
  314. package/dist/components/features/data-view/data-view.types.d.ts +15 -2
  315. package/dist/components/features/email-composer/email-html.d.ts +5 -0
  316. package/dist/components/features/email-composer/http.d.ts +2 -0
  317. package/dist/components/features/email-composer/strings.d.ts +17 -2
  318. package/dist/components/features/email-composer/types.d.ts +17 -2
  319. package/dist/components/features/email-composer/use-composer.d.ts +2 -78
  320. package/dist/components/features/event-calendar/event-calendar-day-cell.d.ts +1 -1
  321. package/dist/components/features/event-calendar/event-calendar-event-badge.d.ts +1 -1
  322. package/dist/components/features/event-calendar/event-calendar-header.d.ts +1 -1
  323. package/dist/components/features/event-calendar/event-calendar-legend.d.ts +2 -2
  324. package/dist/components/features/event-calendar/event-calendar.d.ts +1 -1
  325. package/dist/components/features/event-calendar/event-calendar.types.d.ts +126 -21
  326. package/dist/components/features/filters/facets/range-facet.d.ts +13 -8
  327. package/dist/components/features/filters/filter-context.d.ts +9 -0
  328. package/dist/components/features/filters/filters.strings.d.ts +36 -3
  329. package/dist/components/features/filters/filters.types.d.ts +72 -5
  330. package/dist/components/features/filters/hooks/use-filter-draft.d.ts +1 -0
  331. package/dist/components/features/filters/index.d.ts +2 -2
  332. package/dist/components/features/filters/operator-options.d.ts +25 -2
  333. package/dist/components/features/filters/partials/active-filter-item.d.ts +0 -13
  334. package/dist/components/features/filters/partials/async-options-status.d.ts +32 -0
  335. package/dist/components/features/filters/partials/filter-draft-footer.d.ts +11 -0
  336. package/dist/components/features/filters/partials/filter-operator-select.d.ts +4 -2
  337. package/dist/components/features/filters/partials/filter-pill.d.ts +5 -1
  338. package/dist/components/features/filters/partials/filter-tabs.d.ts +2 -1
  339. package/dist/components/features/filters/partials/regular-filter-content.d.ts +1 -1
  340. package/dist/components/features/filters/utils/filter-utils.d.ts +29 -4
  341. package/dist/components/features/global-search/global-search-dialog.d.ts +7 -1
  342. package/dist/components/features/global-search/global-search.d.ts +7 -1
  343. package/dist/components/features/global-search/global-search.strings.d.ts +19 -3
  344. package/dist/components/features/global-search/global-search.types.d.ts +30 -6
  345. package/dist/components/features/global-search/index.d.ts +1 -1
  346. package/dist/components/features/global-search/partials/global-search-idle-state.d.ts +6 -1
  347. package/dist/components/features/global-search/partials/global-search-input.d.ts +2 -0
  348. package/dist/components/features/kanban/index.d.ts +2 -2
  349. package/dist/components/features/kanban/kanban-context.d.ts +4 -0
  350. package/dist/components/features/kanban/kanban-keyboard.d.ts +7 -2
  351. package/dist/components/features/kanban/kanban.d.ts +10 -1
  352. package/dist/components/features/kanban/kanban.strings.d.ts +11 -2
  353. package/dist/components/features/kanban/kanban.types.d.ts +26 -0
  354. package/dist/components/features/map/map.d.ts +4 -0
  355. package/dist/components/features/map/place-autocomplete.d.ts +10 -1
  356. package/dist/components/features/media-library/hooks/use-media-library.d.ts +3 -1
  357. package/dist/components/features/media-library/media-library.d.ts +1 -1
  358. package/dist/components/features/media-library/media-library.strings.d.ts +33 -3
  359. package/dist/components/features/media-library/media-library.types.d.ts +47 -2
  360. package/dist/components/features/media-library/partials/media-library-partials.d.ts +1 -1
  361. package/dist/components/features/mentions/hooks/use-mentions-search.d.ts +7 -0
  362. package/dist/components/features/mentions/index.d.ts +1 -1
  363. package/dist/components/features/mentions/mentions.strings.d.ts +10 -2
  364. package/dist/components/features/mentions/partials/mention-chip.d.ts +1 -0
  365. package/dist/components/features/mentions/partials/mention-inline-suggestions.d.ts +8 -1
  366. package/dist/components/features/mentions/partials/mention-picker.d.ts +8 -1
  367. package/dist/components/features/mentions/partials/mention-search-error.d.ts +6 -0
  368. package/dist/components/features/mentions/utils/index.d.ts +0 -1
  369. package/dist/components/features/overlays/alert-dialog.d.ts +1 -1
  370. package/dist/components/features/overlays/dialog.d.ts +1 -1
  371. package/dist/components/features/overlays/drawer.d.ts +1 -1
  372. package/dist/components/features/overlays/index.d.ts +2 -2
  373. package/dist/components/features/overlays/overlays.strings.d.ts +2 -1
  374. package/dist/components/features/overlays/overlays.types.d.ts +27 -10
  375. package/dist/components/features/products/components/index.d.ts +0 -10
  376. package/dist/components/features/products/components/product-contract-overview.d.ts +1 -1
  377. package/dist/components/features/products/components/product-details-card.d.ts +1 -1
  378. package/dist/components/features/products/components/product-operations-card.d.ts +1 -1
  379. package/dist/components/features/products/components/product-option-action-menu.d.ts +1 -1
  380. package/dist/components/features/products/components/product-options-summary.d.ts +1 -1
  381. package/dist/components/features/products/components/product-policies-card.d.ts +1 -1
  382. package/dist/components/features/products/components/product-quote-preview-card.d.ts +1 -1
  383. package/dist/components/features/products/components/product-readiness-card.d.ts +1 -1
  384. package/dist/components/features/products/components/product-structure-card.d.ts +1 -1
  385. package/dist/components/features/products/components/product-variant-action-menu.d.ts +1 -1
  386. package/dist/components/features/products/components/product-variants-manager.d.ts +1 -1
  387. package/dist/components/features/products/components/product-variants-table.d.ts +1 -1
  388. package/dist/components/features/products/partials/product-surface.d.ts +15 -0
  389. package/dist/components/features/products/products.strings.d.ts +8 -0
  390. package/dist/components/features/products/products.types.d.ts +25 -7
  391. package/dist/components/features/questionnaire/questionnaire.types.d.ts +6 -4
  392. package/dist/components/features/resource/index.d.ts +2 -3
  393. package/dist/components/features/resource/resource.d.ts +2 -10
  394. package/dist/components/features/resource/resource.types.d.ts +7 -149
  395. package/dist/components/features/resource-assignment/partials/assignment-surface.d.ts +15 -0
  396. package/dist/components/features/resource-assignment/resource-assignment.strings.d.ts +6 -1
  397. package/dist/components/features/resource-assignment/resource-assignment.types.d.ts +6 -0
  398. package/dist/components/features/rich-text-editor/partials/caret-helpers.d.ts +5 -7
  399. package/dist/components/features/rich-text-editor/partials/html-helpers.d.ts +2 -3
  400. package/dist/components/features/rich-text-editor/partials/image-uploads.d.ts +6 -2
  401. package/dist/components/features/rich-text-editor/partials/index.d.ts +2 -3
  402. package/dist/components/features/rich-text-editor/partials/rich-text-editor-tiptap.d.ts +0 -1
  403. package/dist/components/features/rich-text-editor/partials/rich-text-editor-toolbar.d.ts +2 -3
  404. package/dist/components/features/rich-text-editor/rich-text-editor.types.d.ts +13 -1
  405. package/dist/components/features/schema-form/hooks/use-schema-form.d.ts +5 -0
  406. package/dist/components/features/schema-form/schema-form.d.ts +1 -1
  407. package/dist/components/features/schema-form/schema-form.types.d.ts +13 -5
  408. package/dist/components/features/suggestions/suggestions.strings.d.ts +14 -0
  409. package/dist/components/features/suggestions/suggestions.types.d.ts +12 -4
  410. package/dist/components/features/table/data-table.d.ts +1 -1
  411. package/dist/components/features/table/filter-bar.d.ts +1 -1
  412. package/dist/components/features/table/pagination.d.ts +1 -1
  413. package/dist/components/features/table/partials/cell-value.d.ts +1 -1
  414. package/dist/components/features/table/table-body.d.ts +1 -1
  415. package/dist/components/features/table/table-header.d.ts +1 -1
  416. package/dist/components/features/table/table-helpers.d.ts +31 -9
  417. package/dist/components/features/table/table-region.recipes.d.ts +11 -0
  418. package/dist/components/features/table/table-toolbar.d.ts +1 -1
  419. package/dist/components/features/table/table.strings.d.ts +1 -0
  420. package/dist/components/features/table/table.types.d.ts +74 -48
  421. package/dist/components/features/theme-tweaker/theme-provider-settings.d.ts +4 -0
  422. package/dist/components/features/theme-tweaker/theme-tweaker.strings.d.ts +10 -7
  423. package/dist/components/features/theme-tweaker/theme-tweaker.utils.d.ts +17 -0
  424. package/dist/components/layout/app-shell/app-shell.types.d.ts +46 -49
  425. package/dist/components/layout/app-shell/index.d.ts +2 -2
  426. package/dist/components/layout/app-shell/shell-regions.d.ts +9 -0
  427. package/dist/components/layout/app-shell/shell-skip-link.d.ts +9 -0
  428. package/dist/components/layout/app-shell/sidebar-inset-layout.d.ts +1 -1
  429. package/dist/components/layout/app-shell/stacked-layout.d.ts +1 -1
  430. package/dist/components/layout/app-shell/topbar-sidebar-layout.d.ts +1 -1
  431. package/dist/components/layout/auth/auth-shell.d.ts +1 -1
  432. package/dist/components/layout/auth/auth.types.d.ts +0 -5
  433. package/dist/components/layout/containers/inline-gutter-context.d.ts +7 -0
  434. package/dist/components/layout/containers/main-landmark-context.d.ts +6 -0
  435. package/dist/components/layout/header/header.types.d.ts +16 -6
  436. package/dist/components/layout/header/partials/header-global-search-trigger.d.ts +1 -1
  437. package/dist/components/layout/header/partials/header-notifications.d.ts +1 -1
  438. package/dist/components/layout/header/partials/header-search.d.ts +1 -1
  439. package/dist/components/layout/hooks/use-command-shortcut.d.ts +10 -1
  440. package/dist/components/layout/layout.types.d.ts +2 -2
  441. package/dist/components/layout/navigation/breadcrumb-progress/breadcrumb-progress.d.ts +1 -1
  442. package/dist/components/layout/navigation/breadcrumb-progress/types.d.ts +9 -0
  443. package/dist/components/layout/navigation/section-nav/section-nav.d.ts +8 -1
  444. package/dist/components/layout/page/index.d.ts +2 -3
  445. package/dist/components/layout/page/page.strings.d.ts +12 -0
  446. package/dist/components/layout/page/page.types.d.ts +7 -110
  447. package/dist/components/layout/page/partials/page-header.d.ts +1 -1
  448. package/dist/components/layout/settings/index.d.ts +1 -1
  449. package/dist/components/layout/settings/settings.d.ts +3 -5
  450. package/dist/components/layout/sidebar/app-sidebar.d.ts +1 -1
  451. package/dist/components/layout/sidebar/components/sidebar-grouped-navigation.d.ts +1 -1
  452. package/dist/components/layout/sidebar/components/sidebar-navigation-footer.d.ts +1 -1
  453. package/dist/components/layout/sidebar/components/sidebar-navigation.d.ts +1 -1
  454. package/dist/components/layout/sidebar/index.d.ts +1 -1
  455. package/dist/components/layout/sidebar/sidebar-navigation-rail.d.ts +15 -7
  456. package/dist/components/layout/sidebar/sidebar.types.d.ts +10 -12
  457. package/dist/components/layout/sidebar/sidebar.utils.d.ts +4 -0
  458. package/dist/components/layout/workspace/workspace.strings.d.ts +2 -2
  459. package/dist/components/layout/workspace/workspace.types.d.ts +13 -7
  460. package/dist/components/primitives/date.d.ts +22 -3
  461. package/dist/components/primitives/file-size.d.ts +8 -2
  462. package/dist/components/primitives/index.d.ts +1 -1
  463. package/dist/components/primitives/initials.d.ts +3 -1
  464. package/dist/components/primitives/link.d.ts +8 -1
  465. package/dist/components/primitives/money.d.ts +1 -1
  466. package/dist/components/primitives/number.d.ts +2 -1
  467. package/dist/components/typography/heading.d.ts +9 -3
  468. package/dist/components/typography/index.d.ts +1 -1
  469. package/dist/components/typography/text-link.d.ts +10 -3
  470. package/dist/components/ui/badge.d.ts +2 -4
  471. package/dist/components/ui/breadcrumb.d.ts +2 -3
  472. package/dist/components/ui/button.d.ts +8 -2
  473. package/dist/components/ui/collapsible.d.ts +1 -4
  474. package/dist/components/ui/command.d.ts +20 -18
  475. package/dist/components/ui/dialog.d.ts +3 -9
  476. package/dist/components/ui/empty.d.ts +2 -2
  477. package/dist/components/ui/input-group.d.ts +3 -3
  478. package/dist/components/ui/item.d.ts +3 -3
  479. package/dist/components/ui/popover.d.ts +3 -7
  480. package/dist/components/ui/sheet.d.ts +4 -12
  481. package/dist/components/ui/sidebar-state.d.ts +6 -1
  482. package/dist/components/ui/sidebar.d.ts +7 -4
  483. package/dist/components/ui/tabs.d.ts +2 -2
  484. package/dist/components/ui/toggle-group.d.ts +3 -3
  485. package/dist/components/ui/toggle.d.ts +2 -2
  486. package/dist/components/ui/tooltip.d.ts +1 -3
  487. package/dist/{containers-CSdc32h9.js → containers-BdfLTP4w.js} +37 -32
  488. package/dist/containers-BdfLTP4w.js.map +1 -0
  489. package/dist/content-block-hooks-Z3iKjqd1.js +17 -0
  490. package/dist/content-block-hooks-Z3iKjqd1.js.map +1 -0
  491. package/dist/{copyable-3fdHfMR3.js → copyable-Bmr14W0d.js} +6 -6
  492. package/dist/{copyable-3fdHfMR3.js.map → copyable-Bmr14W0d.js.map} +1 -1
  493. package/dist/{data-display-Cmj-xZYl.js → data-display-CWe9SOYh.js} +264 -251
  494. package/dist/data-display-CWe9SOYh.js.map +1 -0
  495. package/dist/date-3qsCE1ID.js +209 -0
  496. package/dist/date-3qsCE1ID.js.map +1 -0
  497. package/dist/{date-picker-CyQlFYsP.js → date-picker-D1keJQIG.js} +129 -129
  498. package/dist/date-picker-D1keJQIG.js.map +1 -0
  499. package/dist/date-pickers-D8aJoeHc.js +185 -0
  500. package/dist/date-pickers-D8aJoeHc.js.map +1 -0
  501. package/dist/disclosure-panel-B0HFNZ9x.js.map +1 -1
  502. package/dist/{display-CT_N2a3w.js → display-VlmP1I0i.js} +23 -46
  503. package/dist/display-VlmP1I0i.js.map +1 -0
  504. package/dist/{dropdown-menu-C08iIugv.js → dropdown-menu-B8hjvbkS.js} +9 -9
  505. package/dist/{dropdown-menu-C08iIugv.js.map → dropdown-menu-B8hjvbkS.js.map} +1 -1
  506. package/dist/dropzone-CHBNK3de.js +116 -0
  507. package/dist/dropzone-CHBNK3de.js.map +1 -0
  508. package/dist/features/activities.js +682 -628
  509. package/dist/features/activities.js.map +1 -1
  510. package/dist/features/ai-chat.js +258 -226
  511. package/dist/features/ai-chat.js.map +1 -1
  512. package/dist/features/appointment-calendar.js +436 -340
  513. package/dist/features/appointment-calendar.js.map +1 -1
  514. package/dist/features/async-preview.js +351 -265
  515. package/dist/features/async-preview.js.map +1 -1
  516. package/dist/features/combobox.js +2 -2
  517. package/dist/features/comments.js +1 -1
  518. package/dist/features/data-view.js +212 -151
  519. package/dist/features/data-view.js.map +1 -1
  520. package/dist/features/email-composer/engine.js +1 -1
  521. package/dist/features/email-composer.js +344 -315
  522. package/dist/features/email-composer.js.map +1 -1
  523. package/dist/features/event-calendar.js +504 -355
  524. package/dist/features/event-calendar.js.map +1 -1
  525. package/dist/features/filters.js +2 -2
  526. package/dist/features/global-search.js +250 -206
  527. package/dist/features/global-search.js.map +1 -1
  528. package/dist/features/kanban.js +269 -189
  529. package/dist/features/kanban.js.map +1 -1
  530. package/dist/features/map.js +385 -371
  531. package/dist/features/map.js.map +1 -1
  532. package/dist/features/media-library.js +1571 -1199
  533. package/dist/features/media-library.js.map +1 -1
  534. package/dist/features/mentions.js +2 -2
  535. package/dist/features/overlays.js +2 -2
  536. package/dist/features/products.js +1780 -1691
  537. package/dist/features/products.js.map +1 -1
  538. package/dist/features/questionnaire.js +165 -152
  539. package/dist/features/questionnaire.js.map +1 -1
  540. package/dist/features/resource-assignment.js +223 -191
  541. package/dist/features/resource-assignment.js.map +1 -1
  542. package/dist/features/resource.js +55 -220
  543. package/dist/features/resource.js.map +1 -1
  544. package/dist/features/rich-text-editor.js +3 -3
  545. package/dist/features/schema-form.js +280 -228
  546. package/dist/features/schema-form.js.map +1 -1
  547. package/dist/features/suggestions.js +48 -39
  548. package/dist/features/suggestions.js.map +1 -1
  549. package/dist/features/table.js +2 -2
  550. package/dist/features/theme-tweaker.js +723 -633
  551. package/dist/features/theme-tweaker.js.map +1 -1
  552. package/dist/feedback-DmqmXKLn.js +254 -0
  553. package/dist/feedback-DmqmXKLn.js.map +1 -0
  554. package/dist/{field-affordance-recipes-D6H7tVJi.js → field-affordance-recipes-DfbMadot.js} +13 -9
  555. package/dist/field-affordance-recipes-DfbMadot.js.map +1 -0
  556. package/dist/{field-state-recipes-7sza8QbC.js → field-state-recipes-EtCxpEy3.js} +6 -2
  557. package/dist/field-state-recipes-EtCxpEy3.js.map +1 -0
  558. package/dist/filters-BviMRMLS.js +2692 -0
  559. package/dist/filters-BviMRMLS.js.map +1 -0
  560. package/dist/{focus-recipes-B653VaLq.js → focus-recipes-DSkiUvUp.js} +3 -3
  561. package/dist/focus-recipes-DSkiUvUp.js.map +1 -0
  562. package/dist/{form-field-CAPdwdnZ.js → form-field-BdfCwSoQ.js} +5 -5
  563. package/dist/{form-field-CAPdwdnZ.js.map → form-field-BdfCwSoQ.js.map} +1 -1
  564. package/dist/{form-sizing-CgcrUbLU.js → form-sizing-DE_dZw32.js} +3 -3
  565. package/dist/{form-sizing-CgcrUbLU.js.map → form-sizing-DE_dZw32.js.map} +1 -1
  566. package/dist/{forms-B3W8CH7-.js → forms-B8DzJnBN.js} +35 -35
  567. package/dist/forms-B8DzJnBN.js.map +1 -0
  568. package/dist/forms-numeric-DOBswjKj.js +992 -0
  569. package/dist/forms-numeric-DOBswjKj.js.map +1 -0
  570. package/dist/{header-ZIIsRKxP.js → header-Cq3G0ZRP.js} +100 -95
  571. package/dist/header-Cq3G0ZRP.js.map +1 -0
  572. package/dist/{hooks-BitHSh-Y.js → hooks-DHfeSMAO.js} +34 -14
  573. package/dist/hooks-DHfeSMAO.js.map +1 -0
  574. package/dist/{http-D_6rOnzU.js → http-Cu-GPpss.js} +61 -35
  575. package/dist/http-Cu-GPpss.js.map +1 -0
  576. package/dist/{icon-badge-npxF1SLX.js → icon-badge-B0Kq7wom.js} +3 -3
  577. package/dist/{icon-badge-npxF1SLX.js.map → icon-badge-B0Kq7wom.js.map} +1 -1
  578. package/dist/index.js +6 -6
  579. package/dist/inline-gutter-context-CSqmrMFZ.js +11 -0
  580. package/dist/inline-gutter-context-CSqmrMFZ.js.map +1 -0
  581. package/dist/{input-DIREVYHs.js → input-2YrgTUrz.js} +3 -3
  582. package/dist/{input-DIREVYHs.js.map → input-2YrgTUrz.js.map} +1 -1
  583. package/dist/{input-7KAc7XQL.js → input-DfJyrjoR.js} +6 -6
  584. package/dist/{input-7KAc7XQL.js.map → input-DfJyrjoR.js.map} +1 -1
  585. package/dist/{interaction-recipes-4wZ2tvfb.js → interaction-recipes-DmuS1ase.js} +2 -2
  586. package/dist/{interaction-recipes-4wZ2tvfb.js.map → interaction-recipes-DmuS1ase.js.map} +1 -1
  587. package/dist/item-GJ9mvCcg.js +279 -0
  588. package/dist/item-GJ9mvCcg.js.map +1 -0
  589. package/dist/layout/app-shell.js +1 -1
  590. package/dist/layout/auth.js +1 -1
  591. package/dist/layout/containers.js +1 -1
  592. package/dist/layout/header.js +1 -1
  593. package/dist/layout/hooks.js +1 -1
  594. package/dist/layout/navigation.js +1 -1
  595. package/dist/layout/page.js +2 -2
  596. package/dist/layout/settings.js +2 -2
  597. package/dist/layout/sidebar.js +3 -3
  598. package/dist/layout/workspace.js +1 -1
  599. package/dist/layout.js +12 -12
  600. package/dist/{layout.types-E_GAApzO.js → layout.types-DbtnyAtd.js} +11 -8
  601. package/dist/layout.types-DbtnyAtd.js.map +1 -0
  602. package/dist/lib/anchored-positioning.d.ts +11 -0
  603. package/dist/lib/field-affordance-recipes.d.ts +10 -0
  604. package/dist/lib/field-state-recipes.d.ts +6 -0
  605. package/dist/lib/focus-recipes.d.ts +7 -0
  606. package/dist/lib/format.d.ts +25 -0
  607. package/dist/lib/money-format.d.ts +6 -0
  608. package/dist/lib/motion-recipes.d.ts +6 -0
  609. package/dist/lib/surface-recipes.d.ts +32 -2
  610. package/dist/lib/theme-scope.d.ts +17 -1
  611. package/dist/lib/token-merge.generated.d.ts +13 -19
  612. package/dist/lib/ui-provider/index.d.ts +1 -1
  613. package/dist/lib/ui-provider/types.d.ts +5 -0
  614. package/dist/lib/use-controllable-state.d.ts +16 -0
  615. package/dist/lib/use-copy-feedback.d.ts +15 -0
  616. package/dist/lib/utils.js +1 -1
  617. package/dist/lib/variant-props.d.ts +9 -0
  618. package/dist/main-landmark-context-BAsyqp2I.js +11 -0
  619. package/dist/main-landmark-context-BAsyqp2I.js.map +1 -0
  620. package/dist/mentions-zz0ewNIq.js +670 -0
  621. package/dist/mentions-zz0ewNIq.js.map +1 -0
  622. package/dist/{message-BJHnn43M.js → message-BiiVrRrm.js} +10 -7
  623. package/dist/{message-BJHnn43M.js.map → message-BiiVrRrm.js.map} +1 -1
  624. package/dist/{metadata-list-XkqZ_UXH.js → metadata-list-G85roWjS.js} +13 -12
  625. package/dist/metadata-list-G85roWjS.js.map +1 -0
  626. package/dist/{motion-recipes-DitYv6P2.js → motion-recipes-CUc_aHuG.js} +7 -4
  627. package/dist/motion-recipes-CUc_aHuG.js.map +1 -0
  628. package/dist/navigation-C0Be5C3i.js +304 -0
  629. package/dist/navigation-C0Be5C3i.js.map +1 -0
  630. package/dist/{navigation-Bt-v7rWP.js → navigation-CmqaQR_G.js} +99 -103
  631. package/dist/navigation-CmqaQR_G.js.map +1 -0
  632. package/dist/number-NFWKIoiK.js +340 -0
  633. package/dist/number-NFWKIoiK.js.map +1 -0
  634. package/dist/{overflow-tab-bar-BQCA2Zn2.js → overflow-tab-bar-DV7HE_3t.js} +8 -8
  635. package/dist/{overflow-tab-bar-BQCA2Zn2.js.map → overflow-tab-bar-DV7HE_3t.js.map} +1 -1
  636. package/dist/overlays-D-gAIfPF.js +1018 -0
  637. package/dist/overlays-D-gAIfPF.js.map +1 -0
  638. package/dist/page-D4pQhgSq.js +216 -0
  639. package/dist/page-D4pQhgSq.js.map +1 -0
  640. package/dist/{page-header-commands-DIKspJfx.js → page-header-commands-elelNOfd.js} +29 -29
  641. package/dist/{page-header-commands-DIKspJfx.js.map → page-header-commands-elelNOfd.js.map} +1 -1
  642. package/dist/{pagination-Br8TdV9A.js → pagination-BuSWw1US.js} +22 -23
  643. package/dist/pagination-BuSWw1US.js.map +1 -0
  644. package/dist/{popover-k8TdUcAt.js → popover-BpMxbqEK.js} +73 -69
  645. package/dist/popover-BpMxbqEK.js.map +1 -0
  646. package/dist/{popover-menu-yn-o0kyA.js → popover-menu-CO-_iiuz.js} +7 -7
  647. package/dist/{popover-menu-yn-o0kyA.js.map → popover-menu-CO-_iiuz.js.map} +1 -1
  648. package/dist/{popover.recipes-DJ0AkUan.js → popover.recipes-BqkdvlZn.js} +3 -4
  649. package/dist/{popover.recipes-DJ0AkUan.js.map → popover.recipes-BqkdvlZn.js.map} +1 -1
  650. package/dist/{portal-recipes-DyUXqUtD.js → portal-recipes-BPeS4rGB.js} +2 -2
  651. package/dist/{portal-recipes-DyUXqUtD.js.map → portal-recipes-BPeS4rGB.js.map} +1 -1
  652. package/dist/primitives-BlC1lXBr.js +447 -0
  653. package/dist/primitives-BlC1lXBr.js.map +1 -0
  654. package/dist/primitives.js +4 -4
  655. package/dist/{progress-DZFXXzPs.js → progress-RARK8AjB.js} +5 -5
  656. package/dist/{progress-DZFXXzPs.js.map → progress-RARK8AjB.js.map} +1 -1
  657. package/dist/receipt-CUf2Vegp.js +114 -0
  658. package/dist/receipt-CUf2Vegp.js.map +1 -0
  659. package/dist/{rich-text-BnTzZjIo.js → rich-text-Cypm9__d.js} +7 -8
  660. package/dist/{rich-text-BnTzZjIo.js.map → rich-text-Cypm9__d.js.map} +1 -1
  661. package/dist/rich-text-editor-Z6cQepsA.js +919 -0
  662. package/dist/rich-text-editor-Z6cQepsA.js.map +1 -0
  663. package/dist/rich-text-editor-toolbar-DYbRJARB.js +100 -0
  664. package/dist/rich-text-editor-toolbar-DYbRJARB.js.map +1 -0
  665. package/dist/rich-text-tree-DdKHIJx4.js +154 -0
  666. package/dist/rich-text-tree-DdKHIJx4.js.map +1 -0
  667. package/dist/safe-image-src-C6kQSMBZ.js +17 -0
  668. package/dist/safe-image-src-C6kQSMBZ.js.map +1 -0
  669. package/dist/{scroll-area-Bj6CRUif.js → scroll-area-B9HKbji0.js} +3 -3
  670. package/dist/{scroll-area-Bj6CRUif.js.map → scroll-area-B9HKbji0.js.map} +1 -1
  671. package/dist/{separator-DM6gs2vu.js → separator-DaDe26sf.js} +3 -3
  672. package/dist/separator-DaDe26sf.js.map +1 -0
  673. package/dist/{separator-B9ewiCGO.js → separator-KGsNXt2J.js} +2 -2
  674. package/dist/{separator-B9ewiCGO.js.map → separator-KGsNXt2J.js.map} +1 -1
  675. package/dist/services/actions/action-adapters.d.ts +5 -2
  676. package/dist/services/actions/index.d.ts +1 -1
  677. package/dist/services/actions.js +2 -2
  678. package/dist/services/actions.js.map +1 -1
  679. package/dist/settings-D5j_RJvT.js +160 -0
  680. package/dist/settings-D5j_RJvT.js.map +1 -0
  681. package/dist/sheet-B6j_BE9O.js +241 -0
  682. package/dist/sheet-B6j_BE9O.js.map +1 -0
  683. package/dist/{sidebar-CmD6a-HK.js → sidebar-C-iQ_TJP.js} +377 -351
  684. package/dist/sidebar-C-iQ_TJP.js.map +1 -0
  685. package/dist/sidebar-D5VO2W8S.js +715 -0
  686. package/dist/sidebar-D5VO2W8S.js.map +1 -0
  687. package/dist/{skeleton-DDgdhmu9.js → skeleton-Cab_KgVo.js} +12 -12
  688. package/dist/skeleton-Cab_KgVo.js.map +1 -0
  689. package/dist/{smart-card-B6vLxqa_.js → smart-card-C59z6KFO.js} +217 -210
  690. package/dist/smart-card-C59z6KFO.js.map +1 -0
  691. package/dist/{structure-DZJ2wbAU.js → structure-DElaQwwN.js} +2 -2
  692. package/dist/{structure-DZJ2wbAU.js.map → structure-DElaQwwN.js.map} +1 -1
  693. package/dist/style.css +1 -1
  694. package/dist/{surface-recipes-C8mNycaY.js → surface-recipes-DV6rrOFq.js} +10 -2
  695. package/dist/surface-recipes-DV6rrOFq.js.map +1 -0
  696. package/dist/{table-CXSPHH25.js → table-CSRUgpdK.js} +62 -61
  697. package/dist/table-CSRUgpdK.js.map +1 -0
  698. package/dist/table-DdXDBsR_.js +1657 -0
  699. package/dist/table-DdXDBsR_.js.map +1 -0
  700. package/dist/{tabs-C4Kr_hCr.js → tabs-WnHfV2pM.js} +27 -27
  701. package/dist/tabs-WnHfV2pM.js.map +1 -0
  702. package/dist/{text-inputs-jdkS3ReG.js → text-inputs-ljyBYaCd.js} +112 -112
  703. package/dist/text-inputs-ljyBYaCd.js.map +1 -0
  704. package/dist/theme.css +21 -5
  705. package/dist/timelines-mOmS9Eh3.js +479 -0
  706. package/dist/timelines-mOmS9Eh3.js.map +1 -0
  707. package/dist/tooltip-yjX-Uv-p.js +112 -0
  708. package/dist/tooltip-yjX-Uv-p.js.map +1 -0
  709. package/dist/{tree-CeYVzdFE.js → tree-YpkxUG2Z.js} +80 -72
  710. package/dist/tree-YpkxUG2Z.js.map +1 -0
  711. package/dist/typography/rich-text.js +1 -1
  712. package/dist/{typography-C7-YMW1S.js → typography-C0dELqYV.js} +46 -40
  713. package/dist/typography-C0dELqYV.js.map +1 -0
  714. package/dist/typography.js +1 -1
  715. package/dist/{ui-provider-C-74NVLc.js → ui-provider-Bu1S-o96.js} +4 -3
  716. package/dist/ui-provider-Bu1S-o96.js.map +1 -0
  717. package/dist/ui-provider.js +2 -2
  718. package/dist/{upload-Hdm5gObf.js → upload-DMuMYJFT.js} +276 -268
  719. package/dist/upload-DMuMYJFT.js.map +1 -0
  720. package/dist/{usage-card-9s8hLDfn.js → usage-card-DDPki5P1.js} +57 -54
  721. package/dist/usage-card-DDPki5P1.js.map +1 -0
  722. package/dist/use-controllable-state-BlP8SyBI.js +13 -0
  723. package/dist/use-controllable-state-BlP8SyBI.js.map +1 -0
  724. package/dist/use-copy-feedback-CzcaqlLf.js +28 -0
  725. package/dist/use-copy-feedback-CzcaqlLf.js.map +1 -0
  726. package/dist/use-metric-format-options-Dk4rC1NO.js +251 -0
  727. package/dist/use-metric-format-options-Dk4rC1NO.js.map +1 -0
  728. package/dist/{utils-DhuoqFy4.js → utils-BVbAG2J6.js} +98 -76
  729. package/dist/utils-BVbAG2J6.js.map +1 -0
  730. package/dist/value-inputs-h5MwjGCo.js +982 -0
  731. package/dist/value-inputs-h5MwjGCo.js.map +1 -0
  732. package/dist/value-typography-D15uwfj-.js +154 -0
  733. package/dist/value-typography-D15uwfj-.js.map +1 -0
  734. package/dist/workspace-DIryPqBt.js +400 -0
  735. package/dist/workspace-DIryPqBt.js.map +1 -0
  736. package/docs/consumer-skill/SKILL.md +7 -0
  737. package/docs/consumer-skill/agents/themelia-ui-designer.md +11 -2
  738. package/docs/consumer-skill/examples/analytics.tsx +1 -1
  739. package/docs/consumer-skill/examples/app-layout.tsx +3 -3
  740. package/docs/consumer-skill/examples/commerce-lines.tsx +7 -5
  741. package/docs/consumer-skill/examples/detail.tsx +3 -2
  742. package/docs/consumer-skill/examples/email-composer.tsx +1 -1
  743. package/docs/consumer-skill/examples/index-table.tsx +2 -2
  744. package/docs/consumer-skill/examples/scoped-directory.tsx +7 -6
  745. package/docs/consumer-skill/references/agents-md.md +20 -16
  746. package/docs/consumer-skill/references/analytics.md +20 -6
  747. package/docs/consumer-skill/references/building-views.md +213 -0
  748. package/docs/consumer-skill/references/catalogue.md +617 -0
  749. package/docs/consumer-skill/references/component-contracts.json +10202 -18084
  750. package/docs/consumer-skill/references/composition.md +21 -17
  751. package/docs/consumer-skill/references/discovery.md +8 -5
  752. package/docs/consumer-skill/references/installation.md +10 -4
  753. package/docs/consumer-skill/references/integration.md +5 -5
  754. package/docs/consumer-skill/references/product-composition.md +2 -2
  755. package/docs/consumer-skill/references/public-api.json +580 -633
  756. package/docs/consumer-skill/references/review.md +6 -4
  757. package/docs/consumer-skill/references/screen-archetypes.md +2 -2
  758. package/docs/consumer-skill/references/theming.md +1 -1
  759. package/docs/consumer-skill/references/tokens.json +4 -4
  760. package/docs/consumer-skill/references/workflows.md +7 -7
  761. package/docs/consumer-skill/scripts/composition-policy.mjs +40 -20
  762. package/docs/consumer-skill/scripts/composition.mjs +4 -1
  763. package/docs/consumer-skill/scripts/discovery.mjs +3 -1
  764. package/docs/consumer-skill/scripts/setup-skills.mjs +31 -4
  765. package/docs/consumer-skills/themelia-components/SKILL.md +8 -4
  766. package/docs/consumer-skills/themelia-composition/SKILL.md +7 -3
  767. package/docs/consumer-skills/themelia-design/SKILL.md +7 -1
  768. package/docs/consumer-skills/themelia-tokenization/SKILL.md +1 -1
  769. package/package.json +9 -12
  770. package/templates/README.md +3 -2
  771. package/templates/admin-shell-template.tsx +49 -9
  772. package/templates/analytics-operations-template.tsx +20 -24
  773. package/templates/customers-template.tsx +12 -9
  774. package/templates/index.ts +2 -8
  775. package/templates/orders-template.tsx +28 -24
  776. package/templates/products-template.tsx +14 -4
  777. package/templates/user-permissions-template.tsx +11 -14
  778. package/dist/accordion-0tQUZ20r.js.map +0 -1
  779. package/dist/action-menu-C0gjzLyE.js +0 -284
  780. package/dist/action-menu-C0gjzLyE.js.map +0 -1
  781. package/dist/ai-artifact-CGGpQryR.js +0 -1200
  782. package/dist/ai-artifact-CGGpQryR.js.map +0 -1
  783. package/dist/anchored-positioning-DPnKTvNs.js +0 -6
  784. package/dist/anchored-positioning-DPnKTvNs.js.map +0 -1
  785. package/dist/app-shell-EHuuRDGy.js +0 -321
  786. package/dist/app-shell-EHuuRDGy.js.map +0 -1
  787. package/dist/auth-B0girIk_.js.map +0 -1
  788. package/dist/badge-wWauMgAt.js.map +0 -1
  789. package/dist/base/sheet.js +0 -3
  790. package/dist/breadcrumbs-Bp9Ke7kd.js.map +0 -1
  791. package/dist/button-ChBovTx0.js.map +0 -1
  792. package/dist/buttons-DeW0bQeK.js.map +0 -1
  793. package/dist/cascader-CrAl9zD5.js +0 -439
  794. package/dist/cascader-CrAl9zD5.js.map +0 -1
  795. package/dist/choice-inputs-DHGtx0QV.js.map +0 -1
  796. package/dist/code-block-BSJyq9e-.js.map +0 -1
  797. package/dist/collapsible-BzJ91LUG.js +0 -81
  798. package/dist/collapsible-BzJ91LUG.js.map +0 -1
  799. package/dist/combobox-Bcvu5J8O.js +0 -363
  800. package/dist/combobox-Bcvu5J8O.js.map +0 -1
  801. package/dist/combobox-C2JiSQPc.js +0 -915
  802. package/dist/combobox-C2JiSQPc.js.map +0 -1
  803. package/dist/command-9e52NPgK.js +0 -425
  804. package/dist/command-9e52NPgK.js.map +0 -1
  805. package/dist/comments-BsgErEqd.js +0 -1174
  806. package/dist/comments-BsgErEqd.js.map +0 -1
  807. package/dist/components/base/buttons/tooltip-button.d.ts +0 -7
  808. package/dist/components/base/display/content-block.d.ts +0 -75
  809. package/dist/components/base/display/content-block.strings.d.ts +0 -5
  810. package/dist/components/base/sheet/index.d.ts +0 -29
  811. package/dist/components/blocks/ai/use-copy-feedback.d.ts +0 -6
  812. package/dist/components/blocks/data-display/metadata/index.d.ts +0 -30
  813. package/dist/components/features/mentions/utils/split-html-by-mentions.d.ts +0 -10
  814. package/dist/components/features/resource/resource.strings.d.ts +0 -12
  815. package/dist/components/features/rich-text-editor/partials/rich-text-editor-fallback.d.ts +0 -8
  816. package/dist/components/features/sync/index.d.ts +0 -26
  817. package/dist/components/features/sync/sync-range-dialog-form.d.ts +0 -5
  818. package/dist/components/features/sync/sync.strings.d.ts +0 -18
  819. package/dist/components/features/sync/sync.types.d.ts +0 -44
  820. package/dist/components/layout/page/partials/page-actions.d.ts +0 -3
  821. package/dist/components/ui/slot.d.ts +0 -6
  822. package/dist/containers-CSdc32h9.js.map +0 -1
  823. package/dist/data-display-Cmj-xZYl.js.map +0 -1
  824. package/dist/date-Br0FicVv.js +0 -144
  825. package/dist/date-Br0FicVv.js.map +0 -1
  826. package/dist/date-picker-CyQlFYsP.js.map +0 -1
  827. package/dist/date-pickers-tj2MXmXd.js +0 -185
  828. package/dist/date-pickers-tj2MXmXd.js.map +0 -1
  829. package/dist/display-CT_N2a3w.js.map +0 -1
  830. package/dist/features/sync.js +0 -142
  831. package/dist/features/sync.js.map +0 -1
  832. package/dist/feedback-Dzo1xtAU.js +0 -246
  833. package/dist/feedback-Dzo1xtAU.js.map +0 -1
  834. package/dist/field-affordance-recipes-D6H7tVJi.js.map +0 -1
  835. package/dist/field-state-recipes-7sza8QbC.js.map +0 -1
  836. package/dist/filters-Dl80yYtN.js +0 -2415
  837. package/dist/filters-Dl80yYtN.js.map +0 -1
  838. package/dist/focus-recipes-B653VaLq.js.map +0 -1
  839. package/dist/forms-B3W8CH7-.js.map +0 -1
  840. package/dist/forms-numeric-CwjQJe-O.js +0 -991
  841. package/dist/forms-numeric-CwjQJe-O.js.map +0 -1
  842. package/dist/header-ZIIsRKxP.js.map +0 -1
  843. package/dist/hooks-BitHSh-Y.js.map +0 -1
  844. package/dist/http-D_6rOnzU.js.map +0 -1
  845. package/dist/item-FfWnaYST.js +0 -278
  846. package/dist/item-FfWnaYST.js.map +0 -1
  847. package/dist/layout.types-E_GAApzO.js.map +0 -1
  848. package/dist/media-gallery-C81DAnKI.js +0 -203
  849. package/dist/media-gallery-C81DAnKI.js.map +0 -1
  850. package/dist/mentions-qOnedSt4.js +0 -639
  851. package/dist/mentions-qOnedSt4.js.map +0 -1
  852. package/dist/metadata-list-XkqZ_UXH.js.map +0 -1
  853. package/dist/motion-recipes-DitYv6P2.js.map +0 -1
  854. package/dist/navigation-BgtPJAhi.js +0 -288
  855. package/dist/navigation-BgtPJAhi.js.map +0 -1
  856. package/dist/navigation-Bt-v7rWP.js.map +0 -1
  857. package/dist/number-CYqBcrSj.js +0 -346
  858. package/dist/number-CYqBcrSj.js.map +0 -1
  859. package/dist/overlays-CC8zI3Du.js +0 -1017
  860. package/dist/overlays-CC8zI3Du.js.map +0 -1
  861. package/dist/page-BoQ1VaFJ.js +0 -331
  862. package/dist/page-BoQ1VaFJ.js.map +0 -1
  863. package/dist/pagination-Br8TdV9A.js.map +0 -1
  864. package/dist/popover-k8TdUcAt.js.map +0 -1
  865. package/dist/primitives-BkkQjYl7.js +0 -385
  866. package/dist/primitives-BkkQjYl7.js.map +0 -1
  867. package/dist/receipt-C7LhOg7Q.js +0 -116
  868. package/dist/receipt-C7LhOg7Q.js.map +0 -1
  869. package/dist/rich-text-editor-CAurDwT5.js +0 -1273
  870. package/dist/rich-text-editor-CAurDwT5.js.map +0 -1
  871. package/dist/rich-text-editor-toolbar-DbXig7Jk.js +0 -99
  872. package/dist/rich-text-editor-toolbar-DbXig7Jk.js.map +0 -1
  873. package/dist/rich-text-tree-BqyQ_7-R.js +0 -66
  874. package/dist/rich-text-tree-BqyQ_7-R.js.map +0 -1
  875. package/dist/sanitize-html-BWkH4dLM.js +0 -105
  876. package/dist/sanitize-html-BWkH4dLM.js.map +0 -1
  877. package/dist/separator-DM6gs2vu.js.map +0 -1
  878. package/dist/settings-DZPHgpx4.js +0 -155
  879. package/dist/settings-DZPHgpx4.js.map +0 -1
  880. package/dist/sheet-C4DHsgLk.js +0 -250
  881. package/dist/sheet-C4DHsgLk.js.map +0 -1
  882. package/dist/sidebar-C8BnDwTH.js +0 -709
  883. package/dist/sidebar-C8BnDwTH.js.map +0 -1
  884. package/dist/sidebar-CmD6a-HK.js.map +0 -1
  885. package/dist/skeleton-DDgdhmu9.js.map +0 -1
  886. package/dist/slot-CLF9kLrS.js +0 -16
  887. package/dist/slot-CLF9kLrS.js.map +0 -1
  888. package/dist/smart-card-B6vLxqa_.js.map +0 -1
  889. package/dist/surface-recipes-C8mNycaY.js.map +0 -1
  890. package/dist/table-CBonSdTp.js +0 -1584
  891. package/dist/table-CBonSdTp.js.map +0 -1
  892. package/dist/table-CXSPHH25.js.map +0 -1
  893. package/dist/tabs-C4Kr_hCr.js.map +0 -1
  894. package/dist/text-inputs-jdkS3ReG.js.map +0 -1
  895. package/dist/timelines-CoPwdJP0.js +0 -458
  896. package/dist/timelines-CoPwdJP0.js.map +0 -1
  897. package/dist/tooltip-31NwIpTo.js +0 -113
  898. package/dist/tooltip-31NwIpTo.js.map +0 -1
  899. package/dist/tree-CeYVzdFE.js.map +0 -1
  900. package/dist/typography-C7-YMW1S.js.map +0 -1
  901. package/dist/ui-provider-C-74NVLc.js.map +0 -1
  902. package/dist/upload-Hdm5gObf.js.map +0 -1
  903. package/dist/upload-queue-D0sYPuqo.js +0 -409
  904. package/dist/upload-queue-D0sYPuqo.js.map +0 -1
  905. package/dist/usage-card-9s8hLDfn.js.map +0 -1
  906. package/dist/utils-DhuoqFy4.js.map +0 -1
  907. package/dist/value-inputs-D3aPgq9H.js +0 -980
  908. package/dist/value-inputs-D3aPgq9H.js.map +0 -1
  909. package/dist/value-typography-uSzzG9Gf.js +0 -122
  910. package/dist/value-typography-uSzzG9Gf.js.map +0 -1
  911. package/dist/workspace-CC8Vchiu.js +0 -411
  912. package/dist/workspace-CC8Vchiu.js.map +0 -1
@@ -1,35 +1,40 @@
1
1
  "use client";
2
- import { S as e, d as t } from "../ui-provider-C-74NVLc.js";
2
+ import { C as e, f as t } from "../ui-provider-Bu1S-o96.js";
3
3
  import { useStrings as n } from "../lib/strings.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
- import { t as s } from "../focus-recipes-B653VaLq.js";
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";
4
+ import { t as r } from "../utils-BVbAG2J6.js";
5
+ import { c as i, o as a } from "../typography-C0dELqYV.js";
6
+ import { t as o } from "../focus-recipes-DSkiUvUp.js";
7
+ import { n as s } from "../buttons-pZVgPTZn.js";
8
+ import { r as c, t as l } from "../structure-DElaQwwN.js";
9
+ import { c as u, o as d } from "../surface-recipes-DV6rrOFq.js";
10
+ import { f, m as p, r as m } from "../smart-card-C59z6KFO.js";
11
+ import { n as h, t as g } from "../feedback-DmqmXKLn.js";
12
+ import { t as _ } from "../progress-RARK8AjB.js";
13
+ import { n as v, t as y } from "../composition.recipes-COdiFhxB.js";
14
+ import { n as b } from "../action-menu-D5343RwT.js";
15
+ import { r as x, t as S } from "../overlays-D-gAIfPF.js";
16
+ import { t as C } from "../interaction-recipes-DmuS1ase.js";
17
+ import { a as ee, i as w, t as te } from "../primitives-BlC1lXBr.js";
18
+ import { n as T, t as ne } from "../number-NFWKIoiK.js";
19
+ import { r as E, s as D, t as O } from "../date-3qsCE1ID.js";
20
+ import { t as k } from "../badge-oGiXblW7.js";
21
+ import { t as re } from "../batch-action-bar-D6MZQNnC.js";
22
+ import { t as ie } from "../input-DfJyrjoR.js";
23
+ import { t as A } from "../form-field-BdfCwSoQ.js";
24
+ import { c as j, l as M } from "../choice-inputs-oJEsrb5Y.js";
25
+ import { r as ae, t as oe } from "../control-group-recipes-fMuFo0H7.js";
26
+ import { t as se } from "../upload.recipes-BbxTqrCT.js";
27
+ import { t as N } from "../metadata-list-G85roWjS.js";
28
+ import { i as P, n as ce, r as le, t as ue } from "../tabs-WnHfV2pM.js";
29
+ import { t as de } from "../dropzone-CHBNK3de.js";
30
+ import { s as fe } from "../upload-DMuMYJFT.js";
31
+ import { s as F } from "../data-display-CWe9SOYh.js";
32
+ import { createContext as pe, useCallback as I, useContext as me, useEffect as L, useMemo as R, useRef as z, useState as B } from "react";
33
+ import { Fragment as he, jsx as V, jsxs as H } from "react/jsx-runtime";
34
+ import { ArrowLeft as ge, ArrowRight as _e, Check as ve, File as ye, Grid2X2 as be, ImageIcon as xe, ImagePlus as Se, Info as Ce, Layers3 as we, LayoutList as Te, Lock as Ee, Play as De, Plus as Oe, Search as ke, Star as Ae, Trash2 as je, UploadCloud as Me, Video as Ne, X as Pe } from "lucide-react";
35
+ import { createPortal as Fe } from "react-dom";
31
36
  //#region src/components/features/media-library/media-library.strings.ts
32
- var H = {
37
+ var U = {
33
38
  title: "Add media",
34
39
  description: "Pick from the library, or upload new files.",
35
40
  close: "Close media library",
@@ -55,8 +60,8 @@ var H = {
55
60
  gridView: "Grid view",
56
61
  tableView: "Table view",
57
62
  countAll: "{count} {count, plural, one {item} other {items}}",
58
- countFiltered: "{count} of {total} items",
59
- countSearch: "{count} of {total} items for \"{query}\"",
63
+ countFiltered: "{count} of {total} {total, plural, one {item} other {items}}",
64
+ countSearch: "{count} of {total} {total, plural, one {item} other {items}} for \"{query}\"",
60
65
  activeSearchLabel: "Search",
61
66
  resultsLabel: "Media results",
62
67
  emptyLibraryTitle: "Library is empty",
@@ -69,12 +74,13 @@ var H = {
69
74
  errorTitle: "Media could not load",
70
75
  errorDescription: "Check your connection, then try again.",
71
76
  retry: "Try again",
77
+ loadMore: "Load more",
78
+ loadingMore: "Loading more...",
79
+ loadMoreError: "Could not load more media.",
72
80
  cardDetails: "Details for {name}",
73
81
  selectMode: "Select",
74
82
  selectItem: "Select {name}",
75
83
  batchActionsLabel: "Batch actions",
76
- privateLabel: "Private",
77
- publicLabel: "Public",
78
84
  typeImage: "Image",
79
85
  typeVideo: "Video",
80
86
  typeFile: "File",
@@ -110,11 +116,12 @@ var H = {
110
116
  confirmDeleteTitle: "Delete media?",
111
117
  confirmDeleteDescription: "{name} will be removed from this library.",
112
118
  confirmDeleteLabel: "Delete asset",
113
- confirmDeleteError: "Could not delete this asset. Try again."
119
+ confirmDeleteError: "Could not delete this asset. Try again.",
120
+ noCollection: "No collection"
114
121
  },
115
122
  upload: {
116
123
  dropTitle: "Drag files here or click to browse",
117
- dropHint: "JPG, PNG, WebP, SVG and MP4 up to 50 MB per file",
124
+ dropHint: "JPG, PNG, WebP, SVG and MP4",
118
125
  dragOver: "Release to stage files",
119
126
  collection: "Collection",
120
127
  tags: "Tags",
@@ -126,7 +133,13 @@ var H = {
126
133
  removeFile: "Remove {name}",
127
134
  uploading: "Uploading",
128
135
  done: "Done",
129
- error: "Could not upload these files. Try again."
136
+ error: "Could not upload these files. Try again.",
137
+ noCollection: "No collection",
138
+ fileFailed: "Upload failed",
139
+ unsupportedType: "{name} is not an accepted file type.",
140
+ tooLarge: "{name} is larger than {size}.",
141
+ tooMany: "Only {count} {count, plural, one {file} other {files}} can be staged at once.",
142
+ sizeLimitHint: "Up to {size} per file"
130
143
  },
131
144
  footer: {
132
145
  pickOne: "Pick one item",
@@ -134,7 +147,7 @@ var H = {
134
147
  selectedCount: "{count} selected",
135
148
  clear: "Clear",
136
149
  cancel: "Cancel",
137
- confirmEmpty: "Add to product",
150
+ confirmEmpty: "Add items",
138
151
  confirmOne: "Add 1 item",
139
152
  confirmMany: "Add {count} items",
140
153
  noFiles: "No files staged",
@@ -151,27 +164,46 @@ var H = {
151
164
  addTile: "Add another media item",
152
165
  cover: "Cover",
153
166
  primary: "Primary",
154
- setPrimary: "Set primary",
155
- remove: "Remove",
156
- movePrevious: "Move previous",
157
- moveNext: "Move next",
167
+ setPrimary: "Set {name} as primary",
168
+ remove: "Remove {name}",
169
+ movePrevious: "Move {name} earlier",
170
+ moveNext: "Move {name} later",
158
171
  itemPosition: "{index} of {total}",
159
- maxReached: "Maximum reached"
172
+ maxReached: "Maximum reached",
173
+ itemActions: "Actions for {name}",
174
+ setCoverAction: "Set as cover",
175
+ movePreviousAction: "Move earlier",
176
+ moveNextAction: "Move later"
160
177
  }
161
178
  };
162
- function U(e, t) {
179
+ function W(e, t) {
163
180
  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] ?? ""));
164
181
  }
165
182
  //#endregion
166
183
  //#region src/components/features/media-library/hooks/use-media-library.ts
167
- var Ee = {
184
+ var Ie = {
168
185
  collection: void 0,
169
186
  tags: [],
170
187
  public: !0
171
- }, De = [];
172
- function Oe(e, t, n) {
173
- let [r, i] = I(t), a = e ?? r;
174
- return [a, N((t) => {
188
+ }, Le = [], Re = "image/*,video/*", ze = "Upload failed", Be = 48, Ve = {
189
+ page: 1,
190
+ hasMore: !1
191
+ };
192
+ function He(e, t) {
193
+ return {
194
+ page: e,
195
+ cursor: t.nextCursor,
196
+ hasMore: t.hasMore ?? t.nextCursor != null
197
+ };
198
+ }
199
+ var Ue = {
200
+ "invalid-type": "type",
201
+ "too-large": "size",
202
+ "too-many": "count"
203
+ };
204
+ function We(e, t, n) {
205
+ let [r, i] = B(t), a = e ?? r;
206
+ return [a, I((t) => {
175
207
  let r = typeof t == "function" ? t(a) : t;
176
208
  e === void 0 && i(r), n?.(r);
177
209
  }, [
@@ -180,7 +212,7 @@ function Oe(e, t, n) {
180
212
  a
181
213
  ])];
182
214
  }
183
- var ke = {
215
+ var Ge = {
184
216
  getId: (e) => e.id,
185
217
  getName: (e) => e.name,
186
218
  getType: (e) => e.type,
@@ -198,47 +230,91 @@ var ke = {
198
230
  getTint: (e) => e.tint,
199
231
  getMimeType: (e) => e.mimeType
200
232
  };
201
- function Ae(e) {
233
+ function Ke(e) {
202
234
  return {
203
- ...ke,
235
+ ...Ge,
204
236
  ...e
205
237
  };
206
238
  }
207
- function je(e) {
208
- return x(e) ?? "";
239
+ function qe(e) {
240
+ return ee(e) ?? "";
209
241
  }
210
- function Me(e, t) {
242
+ function Je(e, t) {
211
243
  let n = t.getWidth(e), r = t.getHeight(e);
212
244
  return !n || !r ? "" : `${n} x ${r}`;
213
245
  }
214
- function Ne(e, t) {
246
+ function G(e, t) {
215
247
  let n = t.getUploadedAt(e);
216
248
  if (!n) return 0;
217
249
  let r = (n instanceof Date ? n : new Date(n)).getTime();
218
250
  return Number.isFinite(r) ? r : 0;
219
251
  }
220
- function Pe(e) {
252
+ function K(e) {
221
253
  return e.type.startsWith("image/") ? "image" : e.type.startsWith("video/") ? "video" : "file";
222
254
  }
223
- function Fe(e) {
255
+ function Ye(e) {
224
256
  if (e.type.startsWith("image/") && typeof URL < "u" && typeof URL.createObjectURL == "function") return URL.createObjectURL(e);
225
257
  }
226
- function Ie(e) {
258
+ function Xe(e) {
227
259
  e && typeof URL < "u" && typeof URL.revokeObjectURL == "function" && URL.revokeObjectURL(e);
228
260
  }
229
- function Le(e) {
261
+ function q(e) {
230
262
  return Array.isArray(e) ? {
231
263
  items: e,
232
264
  total: e.length
233
265
  } : e;
234
266
  }
235
- function Re(e, t) {
267
+ function Ze(e, t) {
236
268
  return t && typeof e == "object" && e ? {
237
269
  ...e,
238
270
  ...t
239
271
  } : e;
240
272
  }
241
- function ze(e, t, n, r, i) {
273
+ var Qe = [
274
+ "alt",
275
+ "collection",
276
+ "tags",
277
+ "public"
278
+ ];
279
+ function $e(e, t, n) {
280
+ let r = {};
281
+ for (let i of n) i === "alt" ? r.alt = t.getAlt(e) : i === "collection" ? r.collection = t.getCollection(e) : i === "tags" ? r.tags = t.getTags(e) : r.public = t.getPublic(e);
282
+ return r;
283
+ }
284
+ function et(e, t) {
285
+ if (Array.isArray(e) || Array.isArray(t)) {
286
+ let n = Array.isArray(e) ? e : [], r = Array.isArray(t) ? t : [];
287
+ return n.length === r.length && n.every((e, t) => e === r[t]);
288
+ }
289
+ return e === t;
290
+ }
291
+ function tt(e, t) {
292
+ return e === t || e.length === t.length && e.every((e, n) => e === t[n]);
293
+ }
294
+ function nt(e, t) {
295
+ if (Object.keys(t).length === 0) return e;
296
+ let n = (n) => t[e.getId(n)];
297
+ return {
298
+ ...e,
299
+ getAlt: (t) => {
300
+ let r = n(t);
301
+ return r && "alt" in r ? r.alt : e.getAlt(t);
302
+ },
303
+ getCollection: (t) => {
304
+ let r = n(t);
305
+ return r && "collection" in r ? r.collection : e.getCollection(t);
306
+ },
307
+ getTags: (t) => {
308
+ let r = n(t);
309
+ return r && "tags" in r ? r.tags ?? [] : e.getTags(t);
310
+ },
311
+ getPublic: (t) => {
312
+ let r = n(t);
313
+ return r && "public" in r ? r.public : e.getPublic(t);
314
+ }
315
+ };
316
+ }
317
+ function rt(e, t, n, r, i) {
242
318
  let a = n.trim().toLowerCase();
243
319
  return e.filter((e) => r !== "all" && t.getType(e) !== r || i !== "all" && t.getCollection(e) !== i ? !1 : !a || [
244
320
  t.getName(e),
@@ -247,299 +323,410 @@ function ze(e, t, n, r, i) {
247
323
  ...t.getTags(e)
248
324
  ].filter(Boolean).join(" ").toLowerCase().includes(a));
249
325
  }
250
- function Be(e, t, n) {
326
+ function it(e, t, n) {
251
327
  let r = e.slice();
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;
328
+ 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) => G(n, t) - G(e, t)), r;
253
329
  }
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,
261
- ...O,
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({
330
+ function at({ items: e = Le, fetcher: t, refreshKey: n, pageSize: r = Be, accessors: i, selectionMode: a = "multiple", value: o, defaultValue: s = [], onValueChange: c, onItemUpdate: l, onItemDelete: u, onUpload: d, uploadAccept: f = Re, maxFileSize: p, maxFiles: m, uploadFailedMessage: h = ze, onError: g, tab: _, defaultTab: v = "library", onTabChange: y, view: b, defaultView: x = "grid", onViewChange: S, query: C, defaultQuery: ee = "", onQueryChange: w, type: te, defaultType: T = "all", onTypeChange: ne, collection: E, defaultCollection: D = "all", onCollectionChange: O, sort: k, defaultSort: re = "newest", onSortChange: ie, uploadOptions: A, defaultUploadOptions: j, onUploadOptionsChange: M, selecting: ae, defaultSelecting: oe = !1, onSelectingChange: se } = {}) {
331
+ let N = !!t, P = R(() => Ke(i), [i]), [ce, le] = We(_, v, y), [ue, de] = We(b, x, S), [F, pe] = We(C, ee, w), [me, he] = We(te, T, ne), [V, H] = We(E, D, O), [ge, _e] = We(k, re, ie), [ve, ye] = B(null), [be, xe] = B(() => [...s]), [Se, Ce] = B(null), [we, Te] = B(N), [Ee, De] = B(null), [Oe, ke] = B(Ve), [Ae, je] = B(!1), [Me, Ne] = B(null), Pe = z(null), [Fe, U] = B(null), [W, Ge] = B(null), [qe, Je] = B([]), [G, at] = B([]), [ot, st] = B(() => /* @__PURE__ */ new Map()), [J, ct] = B(() => /* @__PURE__ */ new Set()), [Y, lt] = B({}), X = R(() => nt(P, Y), [P, Y]), ut = z(/* @__PURE__ */ new Map()), Z = z(/* @__PURE__ */ new Map()), dt = z(/* @__PURE__ */ new Map()), ft = z(/* @__PURE__ */ new Map()), [pt, mt] = B(0), [ht, gt] = B([]), _t = z(ht), [vt, yt] = B([]), bt = z(0), [xt, St] = B(!1), Ct = R(() => ({
332
+ ...Ie,
333
+ ...j,
334
+ tags: j?.tags ?? Ie.tags
335
+ }), [j]), [wt, Tt] = We(R(() => A ? {
336
+ ...Ie,
337
+ ...A,
338
+ tags: A.tags ?? Ie.tags
339
+ } : void 0, [A]), Ct, M), Et = o !== void 0, Q = R(() => Et ? [...o ?? []] : be, [
340
+ be,
341
+ Et,
342
+ o
343
+ ]), Dt = R(() => new Set(Q), [Q]), Ot = z(/* @__PURE__ */ new Set()), kt = z(null), At = z(/* @__PURE__ */ new Map()), [jt, Mt] = B(0), Nt = I(() => Mt((e) => e + 1), []), Pt = z({
268
344
  fetcher: t,
269
- onError: d
345
+ onError: g
270
346
  });
271
- se(() => {
272
- at.current = {
347
+ L(() => {
348
+ Pt.current = {
273
349
  fetcher: t,
274
- onError: d
350
+ onError: g
275
351
  };
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);
352
+ }, [t, g]), L(() => {
353
+ let e = Pt.current.fetcher;
354
+ if (!N || !e) {
355
+ Te(!1), De(null), Ce(null), ke(Ve), at((e) => e.length ? [] : e);
280
356
  return;
281
357
  }
282
358
  let t = new AbortController();
283
- return be(!0), Se(null), we(null), (async () => {
359
+ return Pe.current?.abort(), Pe.current = null, je(!1), Ne(null), Te(!0), De(null), (async () => {
284
360
  try {
285
361
  let n = await e({
286
- query: R,
287
- type: z,
288
- collection: B === "all" ? void 0 : B,
289
- sort: fe,
362
+ query: F,
363
+ type: me,
364
+ collection: V === "all" ? void 0 : V,
365
+ sort: ge,
366
+ limit: r,
367
+ page: 1,
290
368
  signal: t.signal
291
369
  });
292
- t.signal.aborted || ve(Le(n));
370
+ if (t.signal.aborted) return;
371
+ let i = q(n);
372
+ Ce(i), ke(He(1, i));
293
373
  } catch (e) {
294
374
  if (t.signal.aborted) return;
295
- Se(() => e), we(() => e ?? /* @__PURE__ */ Error("Media load failed")), at.current.onError?.(e);
375
+ De(() => e ?? /* @__PURE__ */ Error("Media load failed")), Pt.current.onError?.(e);
296
376
  } finally {
297
- t.signal.aborted || be(!1);
377
+ t.signal.aborted || Te(!1);
298
378
  }
299
379
  })(), () => t.abort();
300
380
  }, [
301
- B,
302
- rt,
303
- j,
304
- R,
381
+ V,
382
+ jt,
383
+ N,
384
+ r,
385
+ F,
305
386
  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)));
387
+ ge,
388
+ me
389
+ ]);
390
+ let Ft = I(async () => {
391
+ let e = Pt.current.fetcher;
392
+ if (!e || !Oe.hasMore || we || Pe.current) return;
393
+ let t = new AbortController();
394
+ Pe.current = t;
395
+ let n = Oe.page + 1;
396
+ je(!0), Ne(null);
397
+ try {
398
+ let i = await e({
399
+ query: F,
400
+ type: me,
401
+ collection: V === "all" ? void 0 : V,
402
+ sort: ge,
403
+ limit: r,
404
+ page: n,
405
+ cursor: Oe.cursor,
406
+ signal: t.signal
407
+ });
408
+ if (t.signal.aborted) return;
409
+ let a = q(i);
410
+ Ce((e) => {
411
+ let t = e?.items ?? [], n = new Set(t.map((e) => P.getId(e))), r = [...t, ...a.items.filter((e) => !n.has(P.getId(e)))];
412
+ return {
413
+ items: r,
414
+ total: Array.isArray(i) ? r.length : a.total ?? e?.total
415
+ };
416
+ }), ke(He(n, a));
417
+ } catch (e) {
418
+ if (t.signal.aborted) return;
419
+ Ne(() => e ?? /* @__PURE__ */ Error("Media load failed")), Pt.current.onError?.(e);
420
+ } finally {
421
+ Pe.current === t && (Pe.current = null, je(!1));
422
+ }
423
+ }, [
424
+ P,
425
+ V,
426
+ we,
427
+ r,
428
+ Oe,
429
+ F,
430
+ ge,
431
+ me
432
+ ]);
433
+ L(() => {
434
+ if (!N || !Se) return;
435
+ let e = new Set(Se.items.map((e) => X.getId(e)));
436
+ at((t) => {
437
+ let n = t.filter((t) => !e.has(X.getId(t)));
313
438
  return n.length === t.length ? t : n;
314
439
  });
315
440
  }, [
316
- M,
317
- V,
318
- j
319
- ]), se(() => {
320
- let e = et.current;
441
+ X,
442
+ Se,
443
+ N
444
+ ]), L(() => {
445
+ let e = Ot.current;
321
446
  return () => {
322
- tt.current?.abort();
323
- for (let t of e) Ie(t);
447
+ kt.current?.abort(), Pe.current?.abort();
448
+ for (let t of e) Xe(t);
324
449
  e.clear();
325
450
  };
326
451
  }, []);
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);
452
+ let It = Se?.items ?? Le, Lt = R(() => {
453
+ let e = new Set(It.map((e) => X.getId(e)));
454
+ return rt(G.filter((t) => {
455
+ let n = X.getId(t);
456
+ return !e.has(n) && !J.has(n);
457
+ }), X, F, me, V);
333
458
  }, [
334
- M,
335
- B,
336
- R,
337
- W,
338
- Z,
339
- Ne,
340
- z
341
- ]), st = P(() => j ? [...ot, ...Z] : [...je, ...e], [
342
- je,
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,
459
+ X,
460
+ V,
461
+ F,
462
+ J,
463
+ It,
349
464
  G,
350
- W,
351
- st
352
- ]), lt = P(() => j ? ct : Be(ze(ct, M, R, z, B), M, fe), [
353
- M,
354
- B,
355
- j,
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
465
+ me
466
+ ]), Rt = R(() => {
467
+ if (N) return [...Lt, ...It];
468
+ if (qe.length === 0) return [...e];
469
+ let t = new Set(e.map((e) => X.getId(e)));
470
+ return [...qe.filter((e) => !t.has(X.getId(e))), ...e];
471
+ }, [
472
+ X,
473
+ qe,
474
+ N,
475
+ e,
476
+ Lt,
477
+ It
478
+ ]), zt = N ? It : e, Bt = z({
479
+ sourceItems: Rt,
480
+ suppliedItems: zt
481
+ });
482
+ L(() => {
483
+ Bt.current = {
484
+ sourceItems: Rt,
485
+ suppliedItems: zt
486
+ };
487
+ }, [Rt, zt]), L(() => {
488
+ let e = Y;
489
+ for (let [t, n] of Object.entries(Y)) {
490
+ if (Z.current.has(t)) continue;
491
+ let r = Rt.find((e) => P.getId(e) === t);
492
+ if (r === void 0) continue;
493
+ let i = ut.current.get(t) ?? {}, a = $e(r, P, Qe), o = { ...n }, s = { ...i };
494
+ for (let e of Qe) e in n && (e in i && !et(a[e], i[e]) || et(a[e], n[e])) && (delete o[e], delete s[e]);
495
+ Object.keys(o).length !== Object.keys(n).length && (e === Y && (e = { ...Y }), Object.keys(o).length > 0 ? (e[t] = o, ut.current.set(t, s)) : (delete e[t], ut.current.delete(t)));
496
+ }
497
+ e !== Y && lt(e);
498
+ let t = [];
499
+ for (let [e, n] of ft.current) dt.current.has(e) || J.has(e) && tt(n, zt) || (ft.current.delete(e), J.has(e) && t.push(e));
500
+ t.length > 0 && ct((e) => {
501
+ let n = new Set(e);
502
+ for (let e of t) n.delete(e);
503
+ return n;
504
+ });
505
+ }, [
506
+ P,
507
+ Y,
508
+ J,
509
+ pt,
510
+ Rt,
511
+ zt
364
512
  ]);
365
- se(() => {
366
- Ue((e) => {
513
+ let Vt = R(() => Rt.filter((e) => !J.has(X.getId(e))).map((e) => Ze(e, Y[X.getId(e)])), [
514
+ X,
515
+ Y,
516
+ J,
517
+ Rt
518
+ ]), Ht = R(() => N ? Vt : it(rt(Vt, X, F, me, V), X, ge), [
519
+ X,
520
+ V,
521
+ N,
522
+ Vt,
523
+ F,
524
+ ge,
525
+ me
526
+ ]), Ut = N && Se?.total !== void 0 ? Se.total + Lt.length : Vt.length, Wt = Ht.length, Gt = R(() => new Map([...G, ...It].map((e) => [X.getId(e), e])), [
527
+ X,
528
+ It,
529
+ G
530
+ ]);
531
+ L(() => {
532
+ st((e) => {
367
533
  let t = /* @__PURE__ */ new Map();
368
- if (j) for (let n of Y) {
369
- let r = ft.get(n) ?? e.get(n);
534
+ if (N) for (let n of Q) {
535
+ let r = Gt.get(n) ?? e.get(n);
370
536
  r !== void 0 && t.set(n, r);
371
537
  }
372
538
  return t.size === e.size && [...t].every(([t, n]) => e.get(t) === n) ? e : t;
373
539
  });
374
540
  }, [
375
- j,
376
- ft,
377
- Y
541
+ N,
542
+ Gt,
543
+ Q
378
544
  ]);
379
- let pt = N((e, t = []) => {
380
- if (!j) {
545
+ let Kt = I((e, t = []) => {
546
+ if (!N) {
381
547
  let n = new Set(e);
382
- return [...t, ...ct].filter((e) => n.delete(M.getId(e)));
548
+ return [...t, ...Vt].filter((e) => n.delete(X.getId(e)));
383
549
  }
384
- let n = new Map(t.map((e) => [M.getId(e), e]));
550
+ let n = new Map(t.map((e) => [X.getId(e), e]));
385
551
  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])];
552
+ if (J.has(e)) return [];
553
+ let t = n.get(e) ?? Gt.get(e) ?? ot.get(e);
554
+ return t === void 0 ? [] : [Ze(t, Y[e])];
389
555
  });
390
556
  }, [
391
- M,
392
- j,
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));
557
+ X,
558
+ N,
559
+ Y,
560
+ Gt,
561
+ Vt,
562
+ J,
563
+ ot
564
+ ]), qt = R(() => Kt(Q), [Kt, Q]), Jt = !!F.trim() || me !== "all" || V !== "all", Yt = I((e, t) => {
565
+ Et || xe(e), c?.(e, Kt(e, t));
400
566
  }, [
401
- Qe,
402
- s,
403
- pt
404
- ]), gt = F({
405
- applySelection: Q,
406
- selectedIds: Y
567
+ Et,
568
+ c,
569
+ Kt
570
+ ]), Xt = z({
571
+ applySelection: Yt,
572
+ selectedIds: Q
407
573
  });
408
- se(() => {
409
- gt.current = {
410
- applySelection: Q,
411
- selectedIds: Y
574
+ L(() => {
575
+ Xt.current = {
576
+ applySelection: Yt,
577
+ selectedIds: Q
412
578
  };
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));
579
+ }, [Yt, Q]);
580
+ let Zt = I((e) => {
581
+ let t = new Set(a === "single" ? [] : Dt);
582
+ Dt.has(e) && a !== "single" ? t.delete(e) : t.add(e), Yt(Array.from(t));
417
583
  }, [
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([]);
584
+ Yt,
585
+ Dt,
586
+ a
587
+ ]), Qt = I(() => Yt([]), [Yt]), [$t, en] = We(ae, oe, se), tn = $t || Q.length > 0, nn = I((e) => {
588
+ en(e), !e && Q.length > 0 && Yt([]);
423
589
  }, [
424
- Q,
425
- Y.length,
426
- bt
427
- ]), Ct = N(() => {
428
- le(""), ue("all"), de("all");
590
+ Yt,
591
+ Q.length,
592
+ en
593
+ ]), rn = I(() => {
594
+ pe(""), he("all"), H("all");
429
595
  }, [
430
- de,
431
- le,
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) => {
596
+ H,
597
+ pe,
598
+ he
599
+ ]), $ = I((e) => {
600
+ let t = e(_t.current);
601
+ _t.current = t, gt(t);
602
+ }, []), an = I((e) => {
603
+ e && (Xe(e), Ot.current.delete(e));
604
+ }, []), on = I((e) => {
439
605
  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++}`,
606
+ Ge(null);
607
+ let t = fe(e, {
608
+ accept: f.split(",").some((e) => e.trim() === "*/*") ? void 0 : f,
609
+ maxSizeBytes: p,
610
+ maxFiles: m === void 0 ? void 0 : Math.max(0, m - _t.current.length)
611
+ }), n = t.accepted, r = t.rejections.flatMap((e) => {
612
+ let t = Ue[e.code];
613
+ return t ? [{
614
+ name: e.file.name,
615
+ reason: t
616
+ }] : [];
617
+ });
618
+ if (yt(r), n.length === 0) return;
619
+ let i = n.map((e) => {
620
+ let t = Ye(e);
621
+ return t && Ot.current.add(t), {
622
+ id: `staged-${bt.current++}`,
445
623
  file: e,
446
624
  name: e.name,
447
625
  size: e.size,
448
- type: Pe(e),
626
+ type: K(e),
449
627
  src: t,
450
628
  progress: 0,
451
629
  status: "staged"
452
630
  };
453
631
  });
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);
632
+ $((e) => [...e, ...i]);
633
+ }, [
634
+ p,
635
+ m,
636
+ $,
637
+ f
638
+ ]), sn = I((e) => {
639
+ $((t) => (an(t.find((t) => t.id === e)?.src), t.filter((t) => t.id !== e)));
640
+ }, [an, $]), cn = I(() => {
641
+ Ge(null), yt([]), $((e) => {
642
+ for (let t of e) an(t.src);
460
643
  return [];
461
644
  });
462
- }, [wt, $]), Ot = N((e) => {
463
- Ze((t) => ({
645
+ }, [an, $]), ln = I((e) => {
646
+ Tt((t) => ({
464
647
  ...t,
465
648
  ...e
466
649
  }));
467
- }, [Ze]), kt = N((e, t) => {
650
+ }, [Tt]), un = I((e, t) => {
468
651
  $((n) => n.map((n) => n.id === e ? {
469
652
  ...n,
470
653
  ...t
471
654
  } : n));
472
- }, [$]), At = N(async () => {
473
- let e = Ke.current;
474
- if (tt.current || e.length === 0) return;
655
+ }, [$]), dn = I(async () => {
656
+ let e = _t.current;
657
+ if (kt.current || e.length === 0) return;
475
658
  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) ? {
659
+ kt.current = r, Ge(null), St(!0), $((e) => e.map((e) => n.has(e.id) ? {
477
660
  ...e,
478
661
  status: "uploading",
479
662
  progress: 0,
480
663
  error: void 0
481
664
  } : e));
482
- let a = (e) => !r.signal.aborted && tt.current === r && n.has(e), o = {
665
+ let i = (e) => !r.signal.aborted && kt.current === r && n.has(e), o = {
483
666
  signal: r.signal,
484
667
  fileIds: t,
485
668
  setProgress: (e, t) => {
486
- a(e) && kt(e, { progress: Math.max(0, Math.min(100, t)) });
669
+ i(e) && un(e, { progress: Math.max(0, Math.min(100, t)) });
487
670
  },
488
671
  setFileStatus: (e, t, n) => {
489
- a(e) && kt(e, {
672
+ i(e) && un(e, {
490
673
  status: t,
491
674
  error: n
492
675
  });
493
676
  }
494
677
  };
495
678
  try {
496
- let t = e.map((e) => e.file), a = await u?.(t, Xe, o);
679
+ let t = e.map((e) => e.file), i = await d?.(t, wt, o);
497
680
  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) {
681
+ if ($((e) => e.filter((e) => !n.has(e.id) || e.status === "error" || (an(e.src), !1))), i?.length) {
682
+ let e = i.map((e) => X.getId(e));
683
+ if (N) {
501
684
  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);
685
+ at((e) => [...i, ...e.filter((e) => !t.has(X.getId(e)))]);
686
+ } else Je((e) => [...i, ...e]);
687
+ let t = Xt.current;
688
+ t.applySelection(a === "single" ? e.slice(0, 1) : Array.from(/* @__PURE__ */ new Set([...e, ...t.selectedIds])), i);
506
689
  }
507
- j && u && X(), Ke.current.length === 0 && oe("library");
690
+ N && d && Nt(), _t.current.length === 0 && le("library");
508
691
  } catch (e) {
509
692
  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" ? {
693
+ Ge(() => e ?? /* @__PURE__ */ Error("Media upload failed")), $((e) => e.map((e) => n.has(e.id) && e.status === "uploading" ? {
511
694
  ...e,
512
695
  status: "error",
513
- error: "Upload failed"
514
- } : e)), d?.(e);
696
+ error: h
697
+ } : e)), g?.(e);
515
698
  } finally {
516
- tt.current === r && (tt.current = null, Ye(!1));
699
+ kt.current === r && (kt.current = null, St(!1));
517
700
  }
518
701
  }, [
519
- M,
520
- j,
521
- d,
522
- u,
523
- wt,
524
702
  X,
525
- i,
526
- oe,
527
- kt,
703
+ N,
704
+ g,
705
+ d,
706
+ an,
707
+ Nt,
708
+ a,
709
+ le,
710
+ un,
528
711
  $,
529
- Xe
530
- ]), jt = N(() => {
531
- tt.current?.abort(), tt.current = null, Ye(!1), $((e) => e.map((e) => e.status === "uploading" ? {
712
+ h,
713
+ wt
714
+ ]), fn = I(() => {
715
+ kt.current?.abort(), kt.current = null, St(!1), $((e) => e.map((e) => e.status === "uploading" ? {
532
716
  ...e,
533
717
  status: "staged",
534
718
  progress: 0,
535
719
  error: void 0
536
720
  } : 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) => ({
721
+ }, [$]), pn = I(async (e, t) => {
722
+ if (!l) return !1;
723
+ let n = X.getId(e), r = `update:${n}`, i = (At.current.get(r) ?? 0) + 1;
724
+ At.current.set(r, i);
725
+ let a = Y[n], o = ut.current.get(n), s = Bt.current.sourceItems.find((e) => P.getId(e) === n) ?? e, c = Qe.filter((e) => e in t && !(o && e in o));
726
+ ut.current.set(n, {
727
+ ...$e(s, P, c),
728
+ ...o
729
+ }), Z.current.set(n, (Z.current.get(n) ?? 0) + 1), U((e) => e?.itemId === n ? null : e), lt((e) => ({
543
730
  ...e,
544
731
  [n]: {
545
732
  ...e[n],
@@ -547,125 +734,147 @@ function Ve({ items: e = De, fetcher: t, refreshKey: n, accessors: r, selectionM
547
734
  }
548
735
  }));
549
736
  try {
550
- return await c(e, t), !0;
737
+ return await l(e, t), !0;
551
738
  } catch (e) {
552
- return nt.current.get(r) === i && (H({
739
+ return At.current.get(r) === i && (U({
553
740
  itemId: n,
554
741
  operation: "update",
555
742
  cause: e
556
- }), K((e) => {
743
+ }), a && o ? ut.current.set(n, o) : ut.current.delete(n), lt((e) => {
557
744
  let t = { ...e };
558
745
  return a ? t[n] = a : delete t[n], t;
559
- })), Se(() => e), d?.(e), !1;
746
+ })), g?.(e), !1;
747
+ } finally {
748
+ let e = (Z.current.get(n) ?? 1) - 1;
749
+ e > 0 ? Z.current.set(n, e) : Z.current.delete(n), mt((e) => e + 1);
560
750
  }
561
751
  }, [
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));
752
+ X,
753
+ P,
754
+ Y,
755
+ g,
756
+ l
757
+ ]), mn = I(async (e) => {
758
+ if (!u) return !1;
759
+ let t = X.getId(e), n = `delete:${t}`, r = (At.current.get(n) ?? 0) + 1;
760
+ At.current.set(n, r);
761
+ let i = J.has(t);
762
+ dt.current.set(t, (dt.current.get(t) ?? 0) + 1), U((e) => e?.itemId === t ? null : e), ct((e) => new Set(e).add(t));
572
763
  try {
573
- return await l(e), $e.has(t) && Q(Y.filter((e) => e !== t)), !0;
764
+ await u(e), ft.current.set(t, Bt.current.suppliedItems);
765
+ let n = (e) => X.getId(e) !== t;
766
+ return Je((e) => e.every(n) ? e : e.filter(n)), at((e) => e.every(n) ? e : e.filter(n)), Dt.has(t) && Yt(Q.filter((e) => e !== t)), !0;
574
767
  } catch (e) {
575
- return nt.current.get(n) === r && (H({
768
+ return At.current.get(n) === r && (U({
576
769
  itemId: t,
577
770
  operation: "delete",
578
771
  cause: e
579
- }), i || We((e) => {
772
+ }), i || ct((e) => {
580
773
  let n = new Set(e);
581
774
  return n.delete(t), n;
582
- })), Se(() => e), d?.(e), !1;
775
+ })), g?.(e), !1;
776
+ } finally {
777
+ let e = (dt.current.get(t) ?? 1) - 1;
778
+ e > 0 ? dt.current.set(t, e) : dt.current.delete(t), mt((e) => e + 1);
583
779
  }
584
780
  }, [
585
- M,
781
+ X,
782
+ Yt,
783
+ g,
784
+ u,
785
+ J,
586
786
  Q,
587
- d,
588
- l,
589
- W,
590
- Y,
591
- $e
787
+ Dt
592
788
  ]);
593
789
  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
790
+ tab: ce,
791
+ setTab: le,
792
+ view: ue,
793
+ setView: de,
794
+ query: F,
795
+ setQuery: pe,
796
+ type: me,
797
+ setType: he,
798
+ collection: V,
799
+ setCollection: H,
800
+ sort: ge,
801
+ setSort: _e,
802
+ detailId: ve,
803
+ setDetailId: ye,
804
+ items: Vt,
805
+ visibleItems: Ht,
806
+ selectedIds: Q,
807
+ selectedItems: qt,
808
+ selectedSet: Dt,
809
+ toggleSelection: Zt,
810
+ clearSelection: Qt,
811
+ selecting: tn,
812
+ setSelecting: nn,
813
+ clearFilters: rn,
814
+ loading: we,
815
+ hasLoadedResults: N && (Se !== null || Lt.length > 0),
816
+ loadError: Ee,
817
+ mutationError: Fe,
818
+ uploadError: W,
819
+ retry: Nt,
820
+ hasMore: N && Oe.hasMore,
821
+ loadMore: Ft,
822
+ loadingMore: Ae,
823
+ loadMoreError: Me,
824
+ hasFilters: Jt,
825
+ totalCount: Ut,
826
+ filteredCount: Wt,
827
+ stagedFiles: ht,
828
+ uploadRejections: vt,
829
+ addFiles: on,
830
+ removeStagedFile: sn,
831
+ clearStagedFiles: cn,
832
+ updateUploadOptions: ln,
833
+ uploadOptions: wt,
834
+ uploading: xt,
835
+ startUpload: dn,
836
+ cancelUpload: fn,
837
+ updateItem: pn,
838
+ removeItem: mn,
839
+ accessors: X
640
840
  };
641
841
  }
642
842
  //#endregion
643
843
  //#region src/components/features/media-library/partials/media-library-partials.tsx
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" });
844
+ var ot = `${C.nativeButtonReset} absolute inset-0 z-10 block h-full w-full cursor-pointer outline-none ${o.inset}`, st = "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", J = "border-primary bg-primary text-primary-foreground opacity-100";
845
+ function ct(e, t) {
846
+ return V(e === "image" ? xe : e === "video" ? Ne : ye, { className: t ?? "size-icon" });
647
847
  }
648
- function G(e, t) {
848
+ function Y(e, t) {
649
849
  return e === "image" ? t.typeImage : e === "video" ? t.typeVideo : t.typeFile;
650
850
  }
651
- function K(e, t) {
652
- return e ? U(t.usedIn, { count: e }) : t.notUsed;
851
+ function lt(e, t) {
852
+ return e ? W(t.usedIn, { count: e }) : t.notUsed;
653
853
  }
654
- function Ge({ children: e, tint: t, className: n }) {
655
- return /* @__PURE__ */ L("div", {
854
+ var X = /^\d{4}-\d{2}-\d{2}$/;
855
+ function ut({ value: e }) {
856
+ if (typeof e == "string" && e.trim() !== "") {
857
+ if (X.test(e.trim())) return /* @__PURE__ */ V(O, { value: e.trim() });
858
+ if (D(e) === null) return /* @__PURE__ */ V(he, { children: e });
859
+ }
860
+ return /* @__PURE__ */ V(E, { value: e });
861
+ }
862
+ function Z({ children: e, tint: t, className: n, role: i }) {
863
+ return /* @__PURE__ */ V("div", {
864
+ role: i,
656
865
  className: r("media-library-preview relative overflow-hidden bg-muted", n),
657
866
  style: t ? { background: t } : void 0,
658
867
  children: e
659
868
  });
660
869
  }
661
- function q({ src: e, alt: t, type: n, className: r, loading: i = "lazy" }) {
662
- let [a, o] = I(!1);
663
- return se(() => {
870
+ function dt({ src: e, alt: t, type: n, className: r, loading: i = "lazy" }) {
871
+ let [a, o] = B(!1);
872
+ return L(() => {
664
873
  o(!1);
665
- }, [e]), !e || a ? /* @__PURE__ */ L("div", {
874
+ }, [e]), !e || a ? /* @__PURE__ */ V("div", {
666
875
  className: "media-library-preview--fallback flex size-full items-center justify-center text-muted-foreground",
667
- children: We(n, "size-6")
668
- }) : /* @__PURE__ */ L("img", {
876
+ children: ct(n, "size-6")
877
+ }) : /* @__PURE__ */ V("img", {
669
878
  src: e,
670
879
  alt: t,
671
880
  loading: i,
@@ -673,23 +882,23 @@ function q({ src: e, alt: t, type: n, className: r, loading: i = "lazy" }) {
673
882
  onError: () => o(!0)
674
883
  });
675
884
  }
676
- function Ke({ icon: e, title: t, description: n, action: i, className: a }) {
677
- return /* @__PURE__ */ L(M, {
885
+ function ft({ icon: e, title: t, description: n, action: i, className: a }) {
886
+ return /* @__PURE__ */ V(F, {
678
887
  title: t,
679
888
  description: n ?? !1,
680
889
  actions: i,
681
- media: e ?? /* @__PURE__ */ L(fe, {
890
+ media: e ?? /* @__PURE__ */ V(xe, {
682
891
  className: "size-icon",
683
892
  "aria-hidden": "true"
684
893
  }),
685
894
  mediaVariant: "icon-soft",
686
895
  padding: "md",
687
- border: !0,
688
- className: r("media-library-empty-state--component min-h-64 bg-muted/30", a)
896
+ surface: "wash",
897
+ className: r("media-library-empty-state--component min-h-64", a)
689
898
  });
690
899
  }
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 = [
900
+ function pt({ query: n, type: a, typeFilters: o, collection: c, sort: u, view: d, collections: f = [], strings: p, onQueryChange: m, onTypeChange: h, onCollectionChange: g, onSortChange: _, onViewChange: v, onClearFilters: y, toolbarEnd: b, selecting: x = !1, onSelectingChange: S, summary: ee, disabled: w = !1 }) {
901
+ let { defaultScale: te } = t(), T = e(void 0, te), ne = [
693
902
  {
694
903
  value: "all",
695
904
  label: p.allTypes,
@@ -698,29 +907,29 @@ function qe({ query: n, type: o, typeFilters: s, collection: c, sort: u, view: d
698
907
  {
699
908
  value: "image",
700
909
  label: p.images,
701
- icon: fe
910
+ icon: xe
702
911
  },
703
912
  {
704
913
  value: "video",
705
914
  label: p.videos,
706
- icon: Ce
915
+ icon: Ne
707
916
  },
708
917
  {
709
918
  value: "file",
710
919
  label: p.files,
711
- icon: B
920
+ icon: ye
712
921
  }
713
- ].filter((e) => (s ?? [
922
+ ].filter((e) => (o ?? [
714
923
  "all",
715
924
  "image",
716
925
  "video"
717
- ]).includes(e.value)), A = [{
926
+ ]).includes(e.value)), E = [{
718
927
  value: "all",
719
928
  label: p.allCollections
720
929
  }, ...f.map((e) => ({
721
930
  value: e.value,
722
931
  label: String(e.label)
723
- }))], ie = [
932
+ }))], D = [
724
933
  {
725
934
  value: "newest",
726
935
  label: p.sortNewest
@@ -737,73 +946,72 @@ function qe({ query: n, type: o, typeFilters: s, collection: c, sort: u, view: d
737
946
  value: "usage",
738
947
  label: p.sortUsage
739
948
  }
740
- ], j = n.trim(), M = j.length > 0, ae = M || o !== "all" || c !== "all";
741
- return /* @__PURE__ */ R(l, {
949
+ ], O = n.trim(), re = O.length > 0, A = re || a !== "all" || c !== "all";
950
+ return /* @__PURE__ */ H(l, {
742
951
  direction: "horizontal",
743
952
  wrap: !0,
744
953
  align: "start",
745
954
  gap: "md",
746
955
  className: "media-library-toolbar--component",
747
- children: [/* @__PURE__ */ R(l, {
956
+ children: [/* @__PURE__ */ H(l, {
748
957
  direction: "horizontal",
749
958
  wrap: !0,
750
959
  align: "start",
751
960
  gap: "md",
752
961
  className: "media-library-toolbar--filters min-w-0 grow basis-80",
753
962
  children: [
754
- /* @__PURE__ */ R(l, {
963
+ /* @__PURE__ */ H(l, {
755
964
  gap: "xs",
756
965
  className: "media-library-toolbar--search min-w-52 flex-1",
757
- children: [/* @__PURE__ */ L(E, {
966
+ children: [/* @__PURE__ */ V(ie, {
758
967
  value: n,
759
968
  onChange: (e) => m(e.target.value),
760
969
  placeholder: p.searchPlaceholder,
761
- startIcon: ye,
970
+ startIcon: ke,
762
971
  clearable: !0,
763
972
  onClear: () => m(""),
764
973
  strings: { clear: p.clearSearch },
765
974
  disabled: w,
766
975
  className: "bg-background"
767
- }), !!M && /* @__PURE__ */ L(l, {
976
+ }), !!re && /* @__PURE__ */ V(l, {
768
977
  direction: "horizontal",
769
978
  gap: "xs",
770
979
  wrap: !1,
771
980
  className: "media-library-toolbar--search-value px-space-xs",
772
- children: /* @__PURE__ */ R(T, {
981
+ children: /* @__PURE__ */ H(k, {
773
982
  tone: "secondary",
774
983
  className: "max-w-full",
775
- children: [/* @__PURE__ */ L(a, {
984
+ children: [/* @__PURE__ */ V(i, {
776
985
  tag: "span",
777
986
  size: "inherit",
778
987
  className: "text-current",
779
988
  children: p.activeSearchLabel
780
- }), /* @__PURE__ */ L(a, {
989
+ }), /* @__PURE__ */ V(i, {
781
990
  tag: "span",
782
991
  size: "inherit",
783
992
  weight: "normal",
784
993
  className: "min-w-0 truncate text-current",
785
- children: j
994
+ children: O
786
995
  })]
787
996
  })
788
997
  })]
789
998
  }),
790
- /* @__PURE__ */ L("div", {
791
- className: r("media-library-toolbar--type-toggle shrink-0", k.frame, re[D]),
792
- role: "tablist",
999
+ /* @__PURE__ */ V("div", {
1000
+ className: r("media-library-toolbar--type-toggle shrink-0", ae.frame, oe[T]),
1001
+ role: "group",
793
1002
  "aria-label": p.typeFilterLabel,
794
- children: O.map((e) => {
795
- let t = e.icon, n = o === e.value;
796
- return /* @__PURE__ */ R(i, {
1003
+ children: ne.map((e) => {
1004
+ let t = e.icon, n = a === e.value;
1005
+ return /* @__PURE__ */ H(s, {
797
1006
  type: "button",
798
- role: "tab",
799
- "aria-selected": n,
1007
+ "aria-pressed": n,
800
1008
  tone: "secondary",
801
1009
  buttonStyle: "ghost",
802
1010
  size: "sm",
803
1011
  disabled: w,
804
- className: r(k.item, "shadow-none", n ? `${b.segmentActive} hover:bg-card` : "text-muted-foreground hover:bg-transparent hover:text-foreground"),
1012
+ className: r(ae.item, "shadow-none", n ? `${C.segmentActive} hover:bg-card` : "text-muted-foreground hover:bg-transparent hover:text-foreground"),
805
1013
  onClick: () => h(e.value),
806
- children: [t && /* @__PURE__ */ L(t, { className: "size-icon-md" }), /* @__PURE__ */ L(a, {
1014
+ children: [t && /* @__PURE__ */ V(t, { className: "size-icon-md" }), /* @__PURE__ */ V(i, {
807
1015
  tag: "span",
808
1016
  size: "xs",
809
1017
  weight: "medium",
@@ -813,27 +1021,27 @@ function qe({ query: n, type: o, typeFilters: s, collection: c, sort: u, view: d
813
1021
  }, e.value);
814
1022
  })
815
1023
  }),
816
- /* @__PURE__ */ R(l, {
1024
+ /* @__PURE__ */ H(l, {
817
1025
  direction: "horizontal",
818
1026
  gap: "md",
819
1027
  wrap: !0,
820
1028
  className: "media-library-toolbar--selects min-w-0",
821
- children: [/* @__PURE__ */ L("div", {
1029
+ children: [/* @__PURE__ */ V("div", {
822
1030
  className: "min-w-40 grow",
823
- children: /* @__PURE__ */ L(ne, {
1031
+ children: /* @__PURE__ */ V(M, {
824
1032
  value: c,
825
- options: A,
1033
+ options: E,
826
1034
  onValueChange: (e) => g(e ?? "all"),
827
1035
  placeholder: p.collectionFilterLabel,
828
1036
  "aria-label": p.collectionFilterLabel,
829
1037
  disabled: w,
830
1038
  className: "bg-background"
831
1039
  })
832
- }), /* @__PURE__ */ L("div", {
1040
+ }), /* @__PURE__ */ V("div", {
833
1041
  className: "min-w-32 grow",
834
- children: /* @__PURE__ */ L(ne, {
1042
+ children: /* @__PURE__ */ V(M, {
835
1043
  value: u,
836
- options: ie,
1044
+ options: D,
837
1045
  onValueChange: (e) => _(e ?? "newest"),
838
1046
  placeholder: p.sortLabel,
839
1047
  "aria-label": p.sortLabel,
@@ -842,7 +1050,7 @@ function qe({ query: n, type: o, typeFilters: s, collection: c, sort: u, view: d
842
1050
  })
843
1051
  })]
844
1052
  }),
845
- !!ae && /* @__PURE__ */ L(i, {
1053
+ !!A && /* @__PURE__ */ V(s, {
846
1054
  type: "button",
847
1055
  tone: "secondary",
848
1056
  buttonStyle: "ghost",
@@ -851,7 +1059,7 @@ function qe({ query: n, type: o, typeFilters: s, collection: c, sort: u, view: d
851
1059
  children: p.clearFilters
852
1060
  })
853
1061
  ]
854
- }), /* @__PURE__ */ R(l, {
1062
+ }), /* @__PURE__ */ H(l, {
855
1063
  direction: "horizontal",
856
1064
  align: "center",
857
1065
  gap: "md",
@@ -859,142 +1067,146 @@ function qe({ query: n, type: o, typeFilters: s, collection: c, sort: u, view: d
859
1067
  className: "media-library-toolbar--view ms-auto min-w-0 max-w-full",
860
1068
  children: [
861
1069
  ee,
862
- /* @__PURE__ */ R("div", {
863
- className: r("media-library-toolbar--view-toggle shrink-0", k.frame, re[D]),
864
- children: [/* @__PURE__ */ L(i, {
1070
+ /* @__PURE__ */ H("div", {
1071
+ className: r("media-library-toolbar--view-toggle shrink-0", ae.frame, oe[T]),
1072
+ role: "group",
1073
+ "aria-label": p.viewLabel,
1074
+ children: [/* @__PURE__ */ V(s, {
865
1075
  type: "button",
866
1076
  tone: d === "grid" ? "neutral" : "secondary",
867
1077
  buttonStyle: d === "grid" ? "solid" : "ghost",
868
1078
  size: "sm",
869
1079
  iconOnly: !0,
870
1080
  disabled: w,
871
- className: r(k.item, d === "grid" && `${b.segmentActive} hover:bg-card`),
1081
+ className: r(ae.item, d === "grid" && `${C.segmentActive} hover:bg-card`),
872
1082
  "aria-label": p.gridView,
1083
+ "aria-pressed": d === "grid",
873
1084
  onClick: () => v("grid"),
874
- children: /* @__PURE__ */ L(de, { className: "size-icon-md" })
875
- }), /* @__PURE__ */ L(i, {
1085
+ children: /* @__PURE__ */ V(be, { className: "size-icon-md" })
1086
+ }), /* @__PURE__ */ V(s, {
876
1087
  type: "button",
877
1088
  tone: d === "table" ? "neutral" : "secondary",
878
1089
  buttonStyle: d === "table" ? "solid" : "ghost",
879
1090
  size: "sm",
880
1091
  iconOnly: !0,
881
1092
  disabled: w,
882
- className: r(k.item, d === "table" && `${b.segmentActive} hover:bg-card`),
1093
+ className: r(ae.item, d === "table" && `${C.segmentActive} hover:bg-card`),
883
1094
  "aria-label": p.tableView,
1095
+ "aria-pressed": d === "table",
884
1096
  onClick: () => v("table"),
885
- children: /* @__PURE__ */ L(ge, { className: "size-icon-md" })
1097
+ children: /* @__PURE__ */ V(Te, { className: "size-icon-md" })
886
1098
  })]
887
1099
  }),
888
- !!C && /* @__PURE__ */ L(i, {
1100
+ !!S && /* @__PURE__ */ V(s, {
889
1101
  type: "button",
890
- "aria-pressed": S,
1102
+ "aria-pressed": x,
891
1103
  tone: "secondary",
892
1104
  buttonStyle: "outline",
893
1105
  disabled: w,
894
- className: r("media-library-toolbar--select shrink-0", S && b.togglePressed),
895
- onClick: () => C(!S),
1106
+ className: r("media-library-toolbar--select shrink-0", x && C.togglePressed),
1107
+ onClick: () => S(!x),
896
1108
  children: p.selectMode
897
1109
  }),
898
- x
1110
+ b
899
1111
  ]
900
1112
  })]
901
1113
  });
902
1114
  }
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", {
1115
+ function mt({ item: e, selected: t = !1, density: n = "comfortable", showMeta: a = !0, accessors: u, strings: d, onToggle: f, onDetails: p, onOpen: m, selecting: h = !1, className: g }) {
1116
+ let _ = u.getType(e), v = u.getName(e), y = u.getSrc(e), b = u.getAlt(e) || v, x = u.getSize(e), S = u.getUsageCount(e), ee = u.getPublic(e) === !1, te = u.getDuration(e), T = !!m && !h, ne = T ? m : f;
1117
+ return /* @__PURE__ */ H("div", {
906
1118
  "data-selected": t || void 0,
907
1119
  "data-selecting": h || void 0,
908
1120
  "data-gallery-density": n,
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,
1121
+ 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", `${C.tileHover} hover:shadow-sm`, t && "media-library-card--selected border-primary ring-1 ring-primary", g),
1122
+ onClick: ne,
911
1123
  children: [
912
- !!D && /* @__PURE__ */ L("button", {
1124
+ !!ne && /* @__PURE__ */ V("button", {
913
1125
  type: "button",
914
1126
  "aria-label": v,
915
- "aria-pressed": E ? void 0 : t,
916
- className: r("media-library-card--select rounded-radius", He),
1127
+ "aria-pressed": T ? void 0 : t,
1128
+ className: r("media-library-card--select rounded-radius", ot),
917
1129
  onClick: (e) => {
918
- e.stopPropagation(), D();
1130
+ e.stopPropagation(), ne();
919
1131
  }
920
1132
  }),
921
- /* @__PURE__ */ R(Ge, {
1133
+ /* @__PURE__ */ H(Z, {
922
1134
  tint: u.getTint(e),
923
1135
  className: r(n === "compact" ? "aspect-square" : "aspect-[4/3]"),
924
1136
  children: [
925
- /* @__PURE__ */ L(q, {
1137
+ /* @__PURE__ */ V(dt, {
926
1138
  src: y,
927
- alt: x,
1139
+ alt: b,
928
1140
  type: _,
929
1141
  className: "size-full object-cover"
930
1142
  }),
931
- E && f ? /* @__PURE__ */ L("button", {
1143
+ T && f ? /* @__PURE__ */ V("button", {
932
1144
  type: "button",
933
- "aria-label": U(d.selectItem, { name: v }),
1145
+ "aria-label": W(d.selectItem, { name: v }),
934
1146
  "aria-pressed": t,
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),
1147
+ className: r(st, `z-10 cursor-pointer opacity-0 transition-opacity group-hover/card:opacity-100 group-focus-within/card:opacity-100 pointer-coarse:opacity-100 ${o.frame}`, t && J),
936
1148
  onClick: (e) => {
937
1149
  e.stopPropagation(), f();
938
1150
  },
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),
1151
+ children: /* @__PURE__ */ V(ve, { className: "size-icon-sm" })
1152
+ }) : /* @__PURE__ */ V("span", {
1153
+ className: r(st, "transition-opacity", h ? "opacity-100" : "opacity-0 group-hover/card:opacity-100 group-focus-within/card:opacity-100", t && J),
942
1154
  "aria-hidden": "true",
943
- children: /* @__PURE__ */ L(ue, { className: "size-icon-sm" })
1155
+ children: /* @__PURE__ */ V(ve, { className: "size-icon-sm" })
944
1156
  }),
945
- !!p && /* @__PURE__ */ L(i, {
1157
+ !!p && /* @__PURE__ */ V(s, {
946
1158
  type: "button",
947
1159
  tone: "secondary",
948
1160
  buttonStyle: "solid",
949
1161
  size: "sm",
950
1162
  iconOnly: !0,
951
1163
  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",
952
- "aria-label": U(d.cardDetails, { name: v }),
1164
+ "aria-label": W(d.cardDetails, { name: v }),
953
1165
  onClick: (e) => {
954
1166
  e.stopPropagation(), p();
955
1167
  },
956
- children: /* @__PURE__ */ L(me, { className: "size-icon-md" })
1168
+ children: /* @__PURE__ */ V(Ce, { className: "size-icon-md" })
957
1169
  }),
958
- _ === "video" && !!te && /* @__PURE__ */ R(T, {
1170
+ _ === "video" && !!te && /* @__PURE__ */ H(k, {
959
1171
  tone: "secondary",
960
1172
  className: "media-library-card--duration absolute bottom-2 left-2 bg-inverse-background text-inverse-foreground",
961
- children: [/* @__PURE__ */ L(V, { className: "size-icon-sm fill-current" }), te]
1173
+ children: [/* @__PURE__ */ V(De, { className: "size-icon-sm fill-current" }), te]
962
1174
  }),
963
- w && /* @__PURE__ */ L(T, {
1175
+ ee && /* @__PURE__ */ V(k, {
964
1176
  tone: "secondary",
965
1177
  className: "media-library-card--private absolute bottom-2 right-2 bg-card text-card-foreground",
966
- children: /* @__PURE__ */ L(_e, { className: "size-icon-sm" })
1178
+ children: /* @__PURE__ */ V(Ee, { className: "size-icon-sm" })
967
1179
  })
968
1180
  ]
969
1181
  }),
970
- /* @__PURE__ */ L("div", {
1182
+ /* @__PURE__ */ V("div", {
971
1183
  className: r("media-library-card--body", n === "compact" ? "p-surface-xs" : "p-surface"),
972
- children: /* @__PURE__ */ R(c, {
1184
+ children: /* @__PURE__ */ H(c, {
973
1185
  columns: 1,
974
1186
  gap: "xs",
975
- children: [/* @__PURE__ */ L(a, {
1187
+ children: [/* @__PURE__ */ V(i, {
976
1188
  tag: "div",
977
1189
  type: "inherit",
978
1190
  weight: "semibold",
979
1191
  className: "truncate",
980
1192
  children: v
981
- }), o && /* @__PURE__ */ R(l, {
1193
+ }), a && /* @__PURE__ */ H(l, {
982
1194
  direction: "horizontal",
983
1195
  align: "center",
984
1196
  justify: "between",
985
1197
  gap: "md",
986
1198
  className: "min-w-0",
987
- children: [/* @__PURE__ */ L(S, {
988
- value: C,
1199
+ children: [/* @__PURE__ */ V(w, {
1200
+ value: x,
989
1201
  size: "xs",
990
1202
  className: "truncate",
991
1203
  emptyLabel: d.unknownSize
992
- }), !!ee && /* @__PURE__ */ R(a, {
1204
+ }), !!S && /* @__PURE__ */ H(i, {
993
1205
  tag: "span",
994
1206
  size: "xs",
995
1207
  type: "secondary",
996
1208
  className: "inline-flex items-center gap-space-xs",
997
- children: [/* @__PURE__ */ L(he, { className: "size-icon-sm" }), ee]
1209
+ children: [/* @__PURE__ */ V(we, { className: "size-icon-sm" }), S]
998
1210
  })]
999
1211
  })]
1000
1212
  })
@@ -1002,200 +1214,268 @@ function Je({ item: e, selected: t = !1, density: n = "comfortable", showMeta: o
1002
1214
  ]
1003
1215
  });
1004
1216
  }
1005
- function Ye({ items: e, selectedSet: t, accessors: n, strings: c, onToggle: l, onDetails: u, onOpen: d, selecting: f = !1 }) {
1217
+ function ht({ items: e, selectedSet: t, accessors: n, strings: c, onToggle: l, onDetails: u, onOpen: d, selecting: f = !1 }) {
1006
1218
  let p = !!d && !f;
1007
- return /* @__PURE__ */ R("div", {
1008
- className: "media-library-list--component min-w-180",
1009
- children: [/* @__PURE__ */ R("div", {
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",
1011
- children: [
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", {})
1020
- ]
1021
- }), e.map((e) => {
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", {
1024
- "data-selected": f || void 0,
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),
1026
- onClick: () => p && d ? d(o) : l(o),
1219
+ return /* @__PURE__ */ H("div", {
1220
+ role: "table",
1221
+ "aria-label": c.resultsLabel,
1222
+ className: "media-library-list--component -mx-row-x min-w-180",
1223
+ children: [/* @__PURE__ */ V("div", {
1224
+ role: "rowgroup",
1225
+ className: "contents",
1226
+ children: /* @__PURE__ */ H("div", {
1227
+ role: "row",
1228
+ 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",
1027
1229
  children: [
1028
- /* @__PURE__ */ L("button", {
1029
- type: "button",
1030
- "aria-label": h,
1031
- "aria-pressed": p ? void 0 : f,
1032
- className: r("media-library-list--select rounded-radius", He),
1033
- onClick: (e) => {
1034
- e.stopPropagation(), p && d ? d(o) : l(o);
1035
- }
1036
- }),
1037
- p ? /* @__PURE__ */ L("button", {
1038
- type: "button",
1039
- "aria-label": U(c.selectItem, { name: h }),
1040
- "aria-pressed": f,
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"),
1042
- onClick: (e) => {
1043
- e.stopPropagation(), l(o);
1044
- },
1045
- children: /* @__PURE__ */ L(ue, { className: "size-icon-sm" })
1046
- }) : /* @__PURE__ */ L("span", {
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"),
1048
- "aria-hidden": "true",
1049
- children: /* @__PURE__ */ L(ue, { className: "size-icon-sm" })
1050
- }),
1051
- /* @__PURE__ */ L(Ge, {
1052
- tint: n.getTint(e),
1053
- className: "size-9 rounded-radius",
1054
- children: g ? /* @__PURE__ */ L("img", {
1055
- src: g,
1056
- alt: "",
1057
- loading: "lazy",
1058
- className: "size-full object-cover"
1059
- }) : /* @__PURE__ */ L("div", {
1060
- className: "flex size-full items-center justify-center text-muted-foreground",
1061
- children: We(m, "size-icon")
1230
+ /* @__PURE__ */ V("span", {
1231
+ role: "columnheader",
1232
+ children: /* @__PURE__ */ V(i, {
1233
+ tag: "span",
1234
+ size: "inherit",
1235
+ className: "sr-only",
1236
+ children: c.selectMode
1062
1237
  })
1063
1238
  }),
1064
- /* @__PURE__ */ R(a, {
1065
- tag: "div",
1066
- type: "inherit",
1067
- weight: "semibold",
1068
- className: "flex min-w-0 items-center gap-space-xs truncate",
1069
- children: [h, _ && /* @__PURE__ */ L(_e, { className: "size-icon-sm shrink-0 text-muted-foreground" })]
1239
+ /* @__PURE__ */ V("span", { role: "cell" }),
1240
+ /* @__PURE__ */ V(a, {
1241
+ role: "columnheader",
1242
+ children: c.table.name
1070
1243
  }),
1071
- /* @__PURE__ */ L(T, {
1072
- tone: "secondary",
1073
- children: G(m, c)
1244
+ /* @__PURE__ */ V(a, {
1245
+ role: "columnheader",
1246
+ children: c.table.type
1074
1247
  }),
1075
- /* @__PURE__ */ L(S, {
1076
- value: n.getSize(e),
1077
- size: "xs",
1078
- emptyLabel: c.unknownSize
1248
+ /* @__PURE__ */ V(a, {
1249
+ role: "columnheader",
1250
+ children: c.table.size
1079
1251
  }),
1080
- /* @__PURE__ */ L(a, {
1081
- size: "xs",
1082
- type: "secondary",
1083
- className: "truncate",
1084
- children: n.getCollection(e) || "—"
1252
+ /* @__PURE__ */ V(a, {
1253
+ role: "columnheader",
1254
+ children: c.table.collection
1085
1255
  }),
1086
- /* @__PURE__ */ L(a, {
1087
- size: "xs",
1088
- type: "secondary",
1089
- children: n.getUsageCount(e) ? n.getUsageCount(e) : "—"
1256
+ /* @__PURE__ */ V(a, {
1257
+ role: "columnheader",
1258
+ children: c.table.used
1090
1259
  }),
1091
- /* @__PURE__ */ L(i, {
1092
- type: "button",
1093
- tone: "secondary",
1094
- buttonStyle: "ghost",
1095
- size: "sm",
1096
- iconOnly: !0,
1097
- className: "relative z-10",
1098
- "aria-label": U(c.cardDetails, { name: h }),
1099
- onClick: (e) => {
1100
- e.stopPropagation(), u(o);
1101
- },
1102
- children: /* @__PURE__ */ L(me, { className: "size-icon-md" })
1260
+ /* @__PURE__ */ V("span", {
1261
+ role: "columnheader",
1262
+ children: /* @__PURE__ */ V(i, {
1263
+ tag: "span",
1264
+ size: "inherit",
1265
+ className: "sr-only",
1266
+ children: c.detail.title
1267
+ })
1103
1268
  })
1104
1269
  ]
1105
- }, o);
1270
+ })
1271
+ }), /* @__PURE__ */ V("div", {
1272
+ role: "rowgroup",
1273
+ className: "contents",
1274
+ children: e.map((e) => {
1275
+ let a = n.getId(e), f = t.has(a), m = n.getType(e), h = n.getName(e), g = n.getSrc(e), _ = n.getPublic(e) === !1;
1276
+ return /* @__PURE__ */ H("div", {
1277
+ role: "row",
1278
+ "data-selected": f || void 0,
1279
+ 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 ${C.rowHover}`, f && C.rowSelected),
1280
+ onClick: () => p && d ? d(a) : l(a),
1281
+ children: [
1282
+ /* @__PURE__ */ H("div", {
1283
+ role: "cell",
1284
+ className: "contents",
1285
+ children: [/* @__PURE__ */ V("button", {
1286
+ type: "button",
1287
+ "aria-label": h,
1288
+ "aria-pressed": p ? void 0 : f,
1289
+ className: r("media-library-list--select rounded-radius", ot),
1290
+ onClick: (e) => {
1291
+ e.stopPropagation(), p && d ? d(a) : l(a);
1292
+ }
1293
+ }), p ? /* @__PURE__ */ V("button", {
1294
+ type: "button",
1295
+ "aria-label": W(c.selectItem, { name: h }),
1296
+ "aria-pressed": f,
1297
+ 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 ${o.frame}`, f && "border-primary bg-primary text-primary-foreground"),
1298
+ onClick: (e) => {
1299
+ e.stopPropagation(), l(a);
1300
+ },
1301
+ children: /* @__PURE__ */ V(ve, { className: "size-icon-sm" })
1302
+ }) : /* @__PURE__ */ V("span", {
1303
+ 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"),
1304
+ "aria-hidden": "true",
1305
+ children: /* @__PURE__ */ V(ve, { className: "size-icon-sm" })
1306
+ })]
1307
+ }),
1308
+ /* @__PURE__ */ V(Z, {
1309
+ role: "cell",
1310
+ tint: n.getTint(e),
1311
+ className: "size-9 rounded-radius",
1312
+ children: g ? /* @__PURE__ */ V("img", {
1313
+ src: g,
1314
+ alt: "",
1315
+ loading: "lazy",
1316
+ className: "size-full object-cover"
1317
+ }) : /* @__PURE__ */ V("div", {
1318
+ className: "flex size-full items-center justify-center text-muted-foreground",
1319
+ children: ct(m, "size-icon")
1320
+ })
1321
+ }),
1322
+ /* @__PURE__ */ H(i, {
1323
+ tag: "div",
1324
+ role: "rowheader",
1325
+ type: "inherit",
1326
+ weight: "semibold",
1327
+ className: "flex min-w-0 items-center gap-space-xs truncate",
1328
+ children: [h, _ && /* @__PURE__ */ V(Ee, { className: "size-icon-sm shrink-0 text-muted-foreground" })]
1329
+ }),
1330
+ /* @__PURE__ */ V(k, {
1331
+ role: "cell",
1332
+ tone: "secondary",
1333
+ children: Y(m, c)
1334
+ }),
1335
+ /* @__PURE__ */ V(w, {
1336
+ role: "cell",
1337
+ value: n.getSize(e),
1338
+ size: "xs",
1339
+ emptyLabel: c.unknownSize
1340
+ }),
1341
+ /* @__PURE__ */ V(i, {
1342
+ role: "cell",
1343
+ size: "xs",
1344
+ type: "secondary",
1345
+ className: "truncate",
1346
+ children: n.getCollection(e) || "—"
1347
+ }),
1348
+ /* @__PURE__ */ V(i, {
1349
+ role: "cell",
1350
+ size: "xs",
1351
+ type: "secondary",
1352
+ children: n.getUsageCount(e) ? n.getUsageCount(e) : "—"
1353
+ }),
1354
+ /* @__PURE__ */ V("div", {
1355
+ role: "cell",
1356
+ className: "contents",
1357
+ children: /* @__PURE__ */ V(s, {
1358
+ type: "button",
1359
+ tone: "secondary",
1360
+ buttonStyle: "ghost",
1361
+ size: "sm",
1362
+ iconOnly: !0,
1363
+ className: "relative z-10",
1364
+ "aria-label": W(c.cardDetails, { name: h }),
1365
+ onClick: (e) => {
1366
+ e.stopPropagation(), u(a);
1367
+ },
1368
+ children: /* @__PURE__ */ V(Ce, { className: "size-icon-md" })
1369
+ })
1370
+ })
1371
+ ]
1372
+ }, a);
1373
+ })
1106
1374
  })]
1107
1375
  });
1108
1376
  }
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
1377
+ function gt({ label: e, value: t, placeholder: n, readOnly: r = !1, onCommit: i }) {
1378
+ let [a, o] = B({
1379
+ source: t,
1380
+ value: t
1113
1381
  });
1114
- o.source !== a && s({
1115
- source: a,
1116
- value: a
1382
+ a.source !== t && o({
1383
+ source: t,
1384
+ value: t
1117
1385
  });
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, {
1386
+ let s = !r && a.value !== t, c = () => o({
1387
+ source: t,
1388
+ value: t
1389
+ }), l = () => {
1390
+ s && (c(), i(a.value));
1391
+ }, u = z(null);
1392
+ return L(() => {
1393
+ u.current = s ? () => i(a.value) : null;
1394
+ }), L(() => () => u.current?.(), []), /* @__PURE__ */ V(A, {
1127
1395
  label: e,
1128
- children: /* @__PURE__ */ L(E, {
1129
- value: o.value,
1396
+ children: /* @__PURE__ */ V(ie, {
1397
+ value: a.value,
1130
1398
  placeholder: n,
1131
1399
  readOnly: r,
1132
- onChange: (e) => s({
1133
- source: a,
1400
+ onChange: (e) => o({
1401
+ source: t,
1134
1402
  value: e.target.value
1135
1403
  }),
1136
- onBlur: c,
1404
+ onBlur: l,
1137
1405
  onKeyDown: (e) => {
1138
- r || e.key !== "Enter" || e.nativeEvent.isComposing || (e.preventDefault(), c());
1406
+ r || e.nativeEvent.isComposing || (e.key === "Enter" ? (e.preventDefault(), l()) : e.key === "Escape" && s && (e.stopPropagation(), c()));
1139
1407
  }
1140
1408
  })
1141
1409
  });
1142
1410
  }
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 }) {
1411
+ function _t({ label: e, tags: t, placeholder: n, readOnly: r = !1, onValueChange: i }) {
1412
+ return /* @__PURE__ */ V(gt, {
1413
+ label: e,
1414
+ value: t.join(", "),
1415
+ placeholder: n,
1416
+ readOnly: r,
1417
+ onCommit: (e) => {
1418
+ let n = e.split(",").map((e) => e.trim()).filter(Boolean);
1419
+ (n.length !== t.length || n.some((e, n) => e !== t[n])) && i(n);
1420
+ }
1421
+ });
1422
+ }
1423
+ function vt({ item: e, collections: t = [], accessors: n, strings: a, onClose: o, onUpdate: c, readOnly: u = !1, mutationError: m, onRemove: h, allowDelete: g = !0, onReplace: _, renderDetail: v }) {
1144
1424
  if (!e) return null;
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, {
1425
+ let b = n.getName(e), x = n.getType(e), S = n.getSrc(e), C = n.getCollection(e), ee = n.getTags(e), T = n.getPublic(e) ?? !0, ne = u ? () => Promise.resolve(!1) : c, E = v?.(e, {
1146
1426
  accessors: n,
1147
- update: k,
1148
- mutationError: p,
1149
- remove: h ? m : () => Promise.resolve(!1),
1150
- replace: g,
1151
- close: s
1427
+ update: ne,
1428
+ mutationError: m,
1429
+ remove: g ? h : () => Promise.resolve(!1),
1430
+ replace: _,
1431
+ close: o
1152
1432
  });
1153
- return re ? /* @__PURE__ */ L(ce, { children: re }) : /* @__PURE__ */ R("aside", {
1433
+ return E ? /* @__PURE__ */ V(he, { children: E }) : /* @__PURE__ */ H("aside", {
1154
1434
  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",
1155
- children: [/* @__PURE__ */ L("div", {
1156
- className: "media-library-detail-panel--header border-b border-border p-surface",
1157
- children: /* @__PURE__ */ R(l, {
1435
+ children: [/* @__PURE__ */ V("div", {
1436
+ className: r("media-library-detail-panel--header p-surface", d.header),
1437
+ children: /* @__PURE__ */ H(l, {
1158
1438
  direction: "horizontal",
1159
1439
  align: "center",
1160
1440
  gap: "md",
1161
- children: [/* @__PURE__ */ L(i, {
1441
+ children: [/* @__PURE__ */ V(s, {
1162
1442
  type: "button",
1163
1443
  tone: "secondary",
1164
1444
  buttonStyle: "ghost",
1165
1445
  size: "sm",
1166
1446
  iconOnly: !0,
1167
- "aria-label": o.detail.close,
1447
+ "aria-label": a.detail.close,
1168
1448
  "data-media-detail-close": "",
1169
- onClick: s,
1170
- children: /* @__PURE__ */ L(le, { className: "size-icon-md" })
1171
- }), /* @__PURE__ */ L(a, {
1449
+ onClick: o,
1450
+ children: /* @__PURE__ */ V(ge, { className: "size-icon-md" })
1451
+ }), /* @__PURE__ */ V(i, {
1172
1452
  weight: "semibold",
1173
- children: o.detail.title
1453
+ children: a.detail.title
1174
1454
  })]
1175
1455
  })
1176
- }), /* @__PURE__ */ R("div", {
1456
+ }), /* @__PURE__ */ H("div", {
1177
1457
  className: "media-library-detail-panel--body grid min-h-0 auto-rows-max gap-space-xl overflow-y-auto p-surface",
1178
1458
  children: [
1179
- /* @__PURE__ */ R(Ge, {
1459
+ /* @__PURE__ */ H(Z, {
1180
1460
  tint: n.getTint(e),
1181
1461
  className: "aspect-[4/3] rounded-radius border border-border",
1182
- children: [/* @__PURE__ */ L(q, {
1183
- src: x,
1184
- alt: n.getAlt(e) || y,
1185
- type: b,
1462
+ children: [/* @__PURE__ */ V(dt, {
1463
+ src: S,
1464
+ alt: n.getAlt(e) || b,
1465
+ type: x,
1186
1466
  className: "size-full object-cover"
1187
- }), b === "video" && !!n.getDuration(e) && /* @__PURE__ */ R(T, {
1467
+ }), x === "video" && !!n.getDuration(e) && /* @__PURE__ */ H(k, {
1188
1468
  className: "absolute bottom-2 right-2 bg-inverse-background text-inverse-foreground",
1189
- children: [/* @__PURE__ */ L(V, { className: "size-icon-sm fill-current" }), n.getDuration(e)]
1469
+ children: [/* @__PURE__ */ V(De, { className: "size-icon-sm fill-current" }), n.getDuration(e)]
1190
1470
  })]
1191
1471
  }),
1192
- /* @__PURE__ */ L(a, {
1472
+ /* @__PURE__ */ V(i, {
1193
1473
  tag: "div",
1194
1474
  weight: "semibold",
1195
1475
  className: "break-words",
1196
- children: y
1476
+ children: b
1197
1477
  }),
1198
- /* @__PURE__ */ L(ie, {
1478
+ /* @__PURE__ */ V(N, {
1199
1479
  layout: "rows",
1200
1480
  valueAlign: "end",
1201
1481
  density: "compact",
@@ -1203,239 +1483,257 @@ function Xe({ item: e, collections: t = [], accessors: n, strings: o, onClose: s
1203
1483
  items: [
1204
1484
  {
1205
1485
  id: "type",
1206
- label: o.detail.type,
1207
- value: G(b, o)
1486
+ label: a.detail.type,
1487
+ value: Y(x, a)
1208
1488
  },
1209
1489
  {
1210
1490
  id: "size",
1211
- label: o.detail.size,
1212
- value: /* @__PURE__ */ L(S, {
1491
+ label: a.detail.size,
1492
+ value: /* @__PURE__ */ V(w, {
1213
1493
  value: n.getSize(e),
1214
- emptyLabel: o.unknownSize
1494
+ emptyLabel: a.unknownSize
1215
1495
  })
1216
1496
  },
1217
1497
  {
1218
1498
  id: "dimensions",
1219
- label: o.detail.dimensions,
1220
- value: /* @__PURE__ */ L(C, {
1499
+ label: a.detail.dimensions,
1500
+ value: /* @__PURE__ */ V(te, {
1221
1501
  width: n.getWidth(e),
1222
1502
  height: n.getHeight(e),
1223
- emptyLabel: o.unknownSize
1503
+ emptyLabel: a.unknownSize
1224
1504
  })
1225
1505
  },
1226
1506
  {
1227
1507
  id: "uploaded",
1228
- label: o.detail.uploaded,
1229
- value: String(n.getUploadedAt(e) ?? "—")
1508
+ label: a.detail.uploaded,
1509
+ value: /* @__PURE__ */ V(ut, { value: n.getUploadedAt(e) })
1230
1510
  },
1231
1511
  {
1232
1512
  id: "used-in",
1233
- label: o.detail.usedIn,
1234
- value: K(n.getUsageCount(e), o)
1513
+ label: a.detail.usedIn,
1514
+ value: lt(n.getUsageCount(e), a)
1235
1515
  }
1236
1516
  ]
1237
1517
  }),
1238
- p && /* @__PURE__ */ L(f, {
1518
+ m && /* @__PURE__ */ V(f, {
1239
1519
  tone: "destructive",
1240
- children: /* @__PURE__ */ L(u, { children: o.detail.mutationError ?? H.detail.mutationError })
1520
+ children: /* @__PURE__ */ V(p, { children: a.detail.mutationError ?? U.detail.mutationError })
1241
1521
  }),
1242
- /* @__PURE__ */ L(D, {
1243
- label: o.detail.altText,
1244
- children: /* @__PURE__ */ L(E, {
1245
- value: n.getAlt(e) ?? "",
1246
- placeholder: o.detail.altPlaceholder,
1247
- readOnly: d,
1248
- onChange: (e) => k({ alt: e.target.value })
1249
- })
1250
- }),
1251
- /* @__PURE__ */ L(D, {
1252
- label: o.detail.collection,
1253
- children: /* @__PURE__ */ L(ne, {
1254
- value: ee,
1522
+ /* @__PURE__ */ V(gt, {
1523
+ label: a.detail.altText,
1524
+ value: n.getAlt(e) ?? "",
1525
+ placeholder: a.detail.altPlaceholder,
1526
+ readOnly: u,
1527
+ onCommit: (e) => ne({ alt: e })
1528
+ }, `alt:${n.getId(e)}`),
1529
+ /* @__PURE__ */ V(A, {
1530
+ label: a.detail.collection,
1531
+ children: /* @__PURE__ */ V(M, {
1532
+ value: C,
1255
1533
  options: t.map((e) => ({
1256
1534
  value: e.value,
1257
1535
  label: String(e.label)
1258
1536
  })),
1259
- "aria-label": o.detail.collection,
1260
- readOnly: d,
1261
- onValueChange: (e) => k({ collection: e })
1537
+ placeholder: a.detail.noCollection ?? U.detail.noCollection,
1538
+ "aria-label": a.detail.collection,
1539
+ readOnly: u,
1540
+ onValueChange: (e) => ne({ collection: e })
1262
1541
  })
1263
1542
  }),
1264
- /* @__PURE__ */ L(J, {
1265
- label: o.detail.tags,
1266
- tags: w,
1267
- placeholder: o.detail.tagsPlaceholder,
1268
- readOnly: d,
1269
- onValueChange: (e) => k({ tags: e })
1543
+ /* @__PURE__ */ V(_t, {
1544
+ label: a.detail.tags,
1545
+ tags: ee,
1546
+ placeholder: a.detail.tagsPlaceholder,
1547
+ readOnly: u,
1548
+ onValueChange: (e) => ne({ tags: e })
1270
1549
  }, n.getId(e)),
1271
- /* @__PURE__ */ L("div", {
1550
+ /* @__PURE__ */ V("div", {
1272
1551
  className: "media-library-detail-panel--public",
1273
- children: /* @__PURE__ */ R(l, {
1552
+ children: /* @__PURE__ */ H(l, {
1274
1553
  direction: "horizontal",
1275
1554
  align: "center",
1276
1555
  justify: "between",
1277
1556
  gap: "xl",
1278
- children: [/* @__PURE__ */ R("div", { children: [/* @__PURE__ */ L(a, {
1557
+ children: [/* @__PURE__ */ H("div", { children: [/* @__PURE__ */ V(i, {
1279
1558
  weight: "semibold",
1280
- children: o.detail.public
1281
- }), /* @__PURE__ */ L(a, {
1559
+ children: a.detail.public
1560
+ }), /* @__PURE__ */ V(i, {
1282
1561
  size: "xs",
1283
1562
  type: "secondary",
1284
- children: te ? o.detail.publicHint : o.detail.privateHint
1285
- })] }), /* @__PURE__ */ L(O, {
1286
- "aria-label": o.detail.public,
1287
- checked: te,
1288
- readOnly: d,
1289
- onValueChange: (e) => k({ public: e })
1563
+ children: T ? a.detail.publicHint : a.detail.privateHint
1564
+ })] }), /* @__PURE__ */ V(j, {
1565
+ "aria-label": a.detail.public,
1566
+ checked: T,
1567
+ readOnly: u,
1568
+ onValueChange: (e) => ne({ public: e })
1290
1569
  })]
1291
1570
  })
1292
1571
  }),
1293
- (g || h) && /* @__PURE__ */ R("div", {
1294
- className: r("media-library-detail-panel--actions flex flex-wrap", _.commands),
1295
- children: [g && /* @__PURE__ */ L(i, {
1572
+ (_ || g) && /* @__PURE__ */ H("div", {
1573
+ className: r("media-library-detail-panel--actions flex flex-wrap", y.commands),
1574
+ children: [_ && /* @__PURE__ */ V(s, {
1296
1575
  type: "button",
1297
1576
  tone: "secondary",
1298
1577
  buttonStyle: "outline",
1299
- onClick: g,
1300
- children: o.detail.replace
1301
- }), h && /* @__PURE__ */ L(i, {
1578
+ onClick: _,
1579
+ children: a.detail.replace
1580
+ }), g && /* @__PURE__ */ V(s, {
1302
1581
  type: "button",
1303
1582
  tone: "destructive",
1304
1583
  buttonStyle: "ghost",
1305
- onClick: m,
1306
- children: o.detail.delete
1584
+ onClick: h,
1585
+ children: a.detail.delete
1307
1586
  })]
1308
1587
  })
1309
1588
  ]
1310
1589
  })]
1311
1590
  });
1312
1591
  }
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", {
1592
+ function yt({ stagedFiles: e, uploadOptions: t, collections: n = [], uploading: r = !1, hasUploadError: a = !1, accept: o = Re, maxFileSize: c, maxFiles: u, rejections: d = [], strings: m, onFiles: h, onRemoveFile: g, onOptionsChange: v, empty: y }) {
1593
+ let b = c === void 0 ? void 0 : ee(c) ?? void 0, x = (e) => m.upload[e] ?? U.upload[e] ?? "", S = b ? `${m.upload.dropHint} · ${W(x("sizeLimitHint"), { size: b })}` : m.upload.dropHint, C = [...d.filter((e) => e.reason !== "count").map((e) => W(x(e.reason === "type" ? "unsupportedType" : "tooLarge"), {
1594
+ name: e.name,
1595
+ size: b ?? ""
1596
+ })), ...d.some((e) => e.reason === "count") ? [W(x("tooMany"), { count: u ?? 0 })] : []];
1597
+ return /* @__PURE__ */ V("div", {
1315
1598
  className: "media-library-upload-panel--component p-surface",
1316
- children: /* @__PURE__ */ R(l, {
1599
+ children: /* @__PURE__ */ H(l, {
1317
1600
  gap: "xl",
1318
1601
  children: [
1319
- /* @__PURE__ */ L(j, {
1320
- onDrop: c,
1321
- accept: "image/*,video/*",
1602
+ /* @__PURE__ */ V(de, {
1603
+ onDrop: h,
1604
+ accept: o,
1322
1605
  multiple: !0,
1323
1606
  size: "md",
1324
1607
  strings: {
1325
- instruction: s.upload.dropTitle,
1326
- helper: s.upload.dropHint,
1327
- dragOver: s.upload.dragOver
1608
+ instruction: m.upload.dropTitle,
1609
+ helper: S,
1610
+ dragOver: m.upload.dragOver
1328
1611
  }
1329
1612
  }),
1330
- o && /* @__PURE__ */ L(f, {
1613
+ C.length > 0 && /* @__PURE__ */ V(f, {
1614
+ tone: "destructive",
1615
+ className: "media-library-upload-panel--rejections",
1616
+ children: /* @__PURE__ */ V(p, { children: /* @__PURE__ */ V(l, {
1617
+ gap: "xs",
1618
+ children: C.map((e) => /* @__PURE__ */ V(i, {
1619
+ tag: "span",
1620
+ size: "inherit",
1621
+ type: "inherit",
1622
+ children: e
1623
+ }, e))
1624
+ }) })
1625
+ }),
1626
+ a && /* @__PURE__ */ V(f, {
1331
1627
  tone: "destructive",
1332
- children: /* @__PURE__ */ L(u, { children: s.upload.error ?? H.upload.error })
1628
+ children: /* @__PURE__ */ V(p, { children: m.upload.error ?? U.upload.error })
1333
1629
  }),
1334
- e.length > 0 ? /* @__PURE__ */ L(l, {
1630
+ e.length > 0 ? /* @__PURE__ */ V(l, {
1335
1631
  gap: "md",
1336
1632
  className: "media-library-upload-panel--staged",
1337
- children: e.map((e) => /* @__PURE__ */ R("div", {
1633
+ children: e.map((e) => /* @__PURE__ */ H("div", {
1338
1634
  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",
1339
1635
  children: [
1340
- /* @__PURE__ */ L(Ge, {
1636
+ /* @__PURE__ */ V(Z, {
1341
1637
  className: "size-10 rounded-radius",
1342
- children: e.src ? /* @__PURE__ */ L("img", {
1638
+ children: e.src ? /* @__PURE__ */ V("img", {
1343
1639
  src: e.src,
1344
1640
  alt: e.name,
1345
1641
  className: "size-full object-cover"
1346
- }) : /* @__PURE__ */ L("div", {
1642
+ }) : /* @__PURE__ */ V("div", {
1347
1643
  className: "flex size-full items-center justify-center text-muted-foreground",
1348
- children: We(e.type, "size-icon")
1644
+ children: ct(e.type, "size-icon")
1349
1645
  })
1350
1646
  }),
1351
- /* @__PURE__ */ R(l, {
1647
+ /* @__PURE__ */ H(l, {
1352
1648
  gap: "md",
1353
1649
  className: "min-w-0 flex-1",
1354
1650
  children: [
1355
- /* @__PURE__ */ R("div", {
1651
+ /* @__PURE__ */ H("div", {
1356
1652
  className: "flex items-baseline gap-space-lg",
1357
- children: [/* @__PURE__ */ L(a, {
1653
+ children: [/* @__PURE__ */ V(i, {
1358
1654
  type: "inherit",
1359
1655
  weight: "semibold",
1360
1656
  className: "truncate",
1361
1657
  children: e.name
1362
- }), /* @__PURE__ */ L(S, {
1658
+ }), /* @__PURE__ */ V(w, {
1363
1659
  value: e.size,
1364
1660
  size: "xs",
1365
1661
  className: "ml-auto shrink-0"
1366
1662
  })]
1367
1663
  }),
1368
- (e.status === "uploading" || e.status === "done") && /* @__PURE__ */ L(h, {
1664
+ (e.status === "uploading" || e.status === "done") && /* @__PURE__ */ V(_, {
1369
1665
  value: e.progress,
1370
1666
  size: "sm",
1371
1667
  "aria-label": e.name
1372
1668
  }),
1373
- e.status === "error" && /* @__PURE__ */ L(a, {
1669
+ e.status === "error" && /* @__PURE__ */ V(i, {
1374
1670
  type: "error",
1375
1671
  children: e.error
1376
1672
  })
1377
1673
  ]
1378
1674
  }),
1379
- e.status === "done" ? /* @__PURE__ */ L(T, {
1675
+ e.status === "done" ? /* @__PURE__ */ V(k, {
1380
1676
  tone: "success",
1381
- children: s.upload.done
1382
- }) : e.status === "uploading" ? /* @__PURE__ */ L(ee, {
1677
+ children: m.upload.done
1678
+ }) : e.status === "uploading" ? /* @__PURE__ */ V(T, {
1383
1679
  value: Math.round(e.progress),
1384
1680
  scaled: !0,
1385
1681
  size: "xs",
1386
1682
  type: "secondary"
1387
- }) : /* @__PURE__ */ L(i, {
1683
+ }) : /* @__PURE__ */ V(s, {
1388
1684
  type: "button",
1389
1685
  tone: "secondary",
1390
1686
  buttonStyle: "ghost",
1391
1687
  size: "sm",
1392
1688
  iconOnly: !0,
1393
1689
  disabled: r,
1394
- "aria-label": U(s.upload.removeFile, { name: e.name }),
1395
- onClick: () => d(e.id),
1396
- children: /* @__PURE__ */ L(we, { className: "size-icon-md" })
1690
+ "aria-label": W(m.upload.removeFile, { name: e.name }),
1691
+ onClick: () => g(e.id),
1692
+ children: /* @__PURE__ */ V(Pe, { className: "size-icon-md" })
1397
1693
  })
1398
1694
  ]
1399
1695
  }, e.id))
1400
- }) : m,
1401
- /* @__PURE__ */ R("div", {
1696
+ }) : y,
1697
+ /* @__PURE__ */ H("div", {
1402
1698
  className: "media-library-upload-panel--options grid gap-space-lg @2xl/media-library:grid-cols-[minmax(0,1fr)_minmax(0,1fr)_auto]",
1403
1699
  children: [
1404
- /* @__PURE__ */ L(D, {
1405
- label: s.upload.collection,
1406
- children: /* @__PURE__ */ L(ne, {
1407
- value: t.collection ?? n[0]?.value,
1700
+ /* @__PURE__ */ V(A, {
1701
+ label: m.upload.collection,
1702
+ children: /* @__PURE__ */ V(M, {
1703
+ value: t.collection,
1704
+ placeholder: m.upload.noCollection ?? U.upload.noCollection,
1705
+ allowClear: !0,
1408
1706
  options: n.map((e) => ({
1409
1707
  value: e.value,
1410
1708
  label: String(e.label)
1411
1709
  })),
1412
- "aria-label": s.upload.collection,
1413
- onValueChange: (e) => p({ collection: e })
1710
+ "aria-label": m.upload.collection,
1711
+ onValueChange: (e) => v({ collection: e })
1414
1712
  })
1415
1713
  }),
1416
- /* @__PURE__ */ L(J, {
1417
- label: s.upload.tags,
1714
+ /* @__PURE__ */ V(_t, {
1715
+ label: m.upload.tags,
1418
1716
  tags: t.tags,
1419
- placeholder: s.upload.tagsPlaceholder,
1420
- onValueChange: (e) => p({ tags: e })
1717
+ placeholder: m.upload.tagsPlaceholder,
1718
+ onValueChange: (e) => v({ tags: e })
1421
1719
  }),
1422
- /* @__PURE__ */ R(l, {
1720
+ /* @__PURE__ */ H(l, {
1423
1721
  direction: "horizontal",
1424
1722
  align: "center",
1425
1723
  justify: "between",
1426
1724
  gap: "xl",
1427
1725
  className: "@2xl/media-library:self-end",
1428
- children: [/* @__PURE__ */ R("div", { children: [/* @__PURE__ */ L(a, {
1726
+ children: [/* @__PURE__ */ H("div", { children: [/* @__PURE__ */ V(i, {
1429
1727
  weight: "semibold",
1430
- children: s.upload.public
1431
- }), /* @__PURE__ */ L(a, {
1728
+ children: m.upload.public
1729
+ }), /* @__PURE__ */ V(i, {
1432
1730
  size: "xs",
1433
1731
  type: "secondary",
1434
- children: s.upload.publicHint
1435
- })] }), /* @__PURE__ */ L(O, {
1436
- "aria-label": s.upload.public,
1732
+ children: m.upload.publicHint
1733
+ })] }), /* @__PURE__ */ V(j, {
1734
+ "aria-label": m.upload.public,
1437
1735
  checked: t.public,
1438
- onValueChange: (e) => p({ public: e })
1736
+ onValueChange: (e) => v({ public: e })
1439
1737
  })]
1440
1738
  })
1441
1739
  ]
@@ -1444,92 +1742,91 @@ function Ze({ stagedFiles: e, uploadOptions: t, collections: n = [], uploading:
1444
1742
  })
1445
1743
  });
1446
1744
  }
1447
- function Qe({ tab: e, selectedIds: t, selectionMode: n, stagedFiles: o, strings: s, onClearSelection: c, className: l }) {
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);
1449
- return e === "upload" ? /* @__PURE__ */ L("div", {
1745
+ function bt({ tab: e, selectedIds: t, selectionMode: n, stagedFiles: a, strings: o, onClearSelection: c, className: l }) {
1746
+ let u = t.length, d = a.reduce((e, t) => e + t.size, 0), f = a.length, p = r("media-library-footer-summary--component flex min-w-0 items-center gap-space-lg", l);
1747
+ return e === "upload" ? /* @__PURE__ */ V("div", {
1450
1748
  className: p,
1451
1749
  "aria-live": "polite",
1452
- children: /* @__PURE__ */ L(a, {
1750
+ children: /* @__PURE__ */ V(i, {
1453
1751
  size: "xs",
1454
1752
  type: "secondary",
1455
1753
  className: "truncate",
1456
- children: f === 0 ? s.footer.noFiles : U(s.footer.stagedSummary, {
1754
+ children: f === 0 ? o.footer.noFiles : W(o.footer.stagedSummary, {
1457
1755
  count: f,
1458
- size: x(d) ?? s.unknownSize
1756
+ size: ee(d) ?? o.unknownSize
1459
1757
  })
1460
1758
  })
1461
- }) : /* @__PURE__ */ L("div", {
1759
+ }) : /* @__PURE__ */ V("div", {
1462
1760
  className: p,
1463
1761
  "aria-live": "polite",
1464
- children: u > 0 ? /* @__PURE__ */ R(ce, { children: [/* @__PURE__ */ L(a, {
1762
+ children: u > 0 ? /* @__PURE__ */ H(he, { children: [/* @__PURE__ */ V(i, {
1465
1763
  weight: "semibold",
1466
1764
  className: "whitespace-nowrap",
1467
- children: U(s.footer.selectedCount, { count: u })
1468
- }), /* @__PURE__ */ L(i, {
1765
+ children: W(o.footer.selectedCount, { count: u })
1766
+ }), /* @__PURE__ */ V(s, {
1469
1767
  type: "button",
1470
1768
  tone: "secondary",
1471
1769
  buttonStyle: "ghost",
1472
1770
  size: "sm",
1473
1771
  onClick: c,
1474
- children: s.footer.clear
1475
- })] }) : /* @__PURE__ */ L(a, {
1772
+ children: o.footer.clear
1773
+ })] }) : /* @__PURE__ */ V(i, {
1476
1774
  size: "xs",
1477
1775
  type: "secondary",
1478
1776
  className: "truncate",
1479
- children: n === "single" ? s.footer.pickOne : s.footer.pickMany
1777
+ children: n === "single" ? o.footer.pickOne : o.footer.pickMany
1480
1778
  })
1481
1779
  });
1482
1780
  }
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 }) {
1781
+ function xt({ tab: e, selectedIds: t, stagedFiles: n, uploading: i = !1, strings: a, confirmLabel: o, cancelLabel: c, onCancel: l, onConfirm: u, onUpload: d, onCancelUpload: f, className: p }) {
1484
1782
  let m = t.length, h = n.length;
1485
- return e === "upload" ? /* @__PURE__ */ R("div", {
1783
+ return e === "upload" ? /* @__PURE__ */ H("div", {
1486
1784
  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, {
1785
+ children: [/* @__PURE__ */ V(s, {
1488
1786
  type: "button",
1489
1787
  tone: "secondary",
1490
1788
  buttonStyle: "ghost",
1491
- disabled: a,
1492
1789
  onClick: f,
1493
- children: c ?? o.footer.cancel
1494
- }), /* @__PURE__ */ L(i, {
1790
+ children: c ?? a.footer.cancel
1791
+ }), /* @__PURE__ */ V(s, {
1495
1792
  tone: "primary",
1496
1793
  type: "button",
1497
- disabled: h === 0 || a,
1794
+ disabled: h === 0 || i,
1498
1795
  onClick: d,
1499
- loading: a,
1500
- strings: { loading: o.footer.uploading },
1501
- children: h <= 1 ? o.footer.upload : U(o.footer.uploadMany, { count: h })
1502
- })]
1503
- }) : /* @__PURE__ */ R("div", {
1796
+ loading: i,
1797
+ strings: { loading: a.footer.uploading },
1798
+ children: h <= 1 ? a.footer.upload : W(a.footer.uploadMany, { count: h })
1799
+ }, "upload")]
1800
+ }) : /* @__PURE__ */ H("div", {
1504
1801
  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, {
1802
+ children: [/* @__PURE__ */ V(s, {
1506
1803
  type: "button",
1507
1804
  tone: "secondary",
1508
1805
  buttonStyle: "ghost",
1509
1806
  onClick: l,
1510
- children: c ?? o.footer.cancel
1511
- }), /* @__PURE__ */ L(i, {
1807
+ children: c ?? a.footer.cancel
1808
+ }), /* @__PURE__ */ V(s, {
1512
1809
  tone: "primary",
1513
1810
  type: "button",
1514
1811
  disabled: m === 0,
1515
1812
  onClick: u,
1516
- children: s ?? (m === 0 ? o.footer.confirmEmpty : m === 1 ? o.footer.confirmOne : U(o.footer.confirmMany, { count: m }))
1517
- })]
1813
+ children: o ?? (m === 0 ? a.footer.confirmEmpty : m === 1 ? a.footer.confirmOne : W(a.footer.confirmMany, { count: m }))
1814
+ }, "confirm")]
1518
1815
  });
1519
1816
  }
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", {
1522
- className: r("media-library-footer--component", h === "section" && "border-t border-border bg-background text-foreground p-surface", g),
1523
- children: /* @__PURE__ */ R("div", {
1817
+ function St({ tab: e, selectedItems: t, selectedIds: n, selectionMode: i, stagedFiles: a, uploading: o = !1, strings: s, confirmLabel: c, cancelLabel: l, onCancel: u, onConfirm: f, onClearSelection: p, onUpload: m, onCancelUpload: h, chrome: g = "section", className: _ }) {
1818
+ return /* @__PURE__ */ V("footer", {
1819
+ className: r("media-library-footer--component", g === "section" && r("bg-background text-foreground p-surface", d.footer), _),
1820
+ children: /* @__PURE__ */ H("div", {
1524
1821
  className: "flex min-w-0 flex-col gap-space-lg @md/media-library:flex-row @md/media-library:justify-between",
1525
- children: [/* @__PURE__ */ L(Qe, {
1822
+ children: [/* @__PURE__ */ V(bt, {
1526
1823
  tab: e,
1527
1824
  selectedIds: n,
1528
1825
  selectionMode: i,
1529
1826
  stagedFiles: a,
1530
1827
  strings: s,
1531
- onClearSelection: f
1532
- }), /* @__PURE__ */ L(Y, {
1828
+ onClearSelection: p
1829
+ }), /* @__PURE__ */ V(xt, {
1533
1830
  tab: e,
1534
1831
  selectedItems: t,
1535
1832
  selectedIds: n,
@@ -1539,18 +1836,30 @@ function $e({ tab: e, selectedItems: t, selectedIds: n, selectionMode: i, staged
1539
1836
  confirmLabel: c,
1540
1837
  cancelLabel: l,
1541
1838
  onCancel: u,
1542
- onConfirm: d,
1543
- onUpload: p,
1544
- onCancelUpload: m
1839
+ onConfirm: f,
1840
+ onUpload: m,
1841
+ onCancelUpload: h
1545
1842
  })]
1546
1843
  })
1547
1844
  });
1548
1845
  }
1549
1846
  //#endregion
1550
1847
  //#region src/components/features/media-library/media-library.tsx
1551
- var et = ae(null);
1552
- function tt(e, t, n) {
1553
- return P(() => {
1848
+ var Ct = pe(null);
1849
+ function wt({ tab: e, children: t }) {
1850
+ let n = "media-library--body flex min-h-0 flex-1";
1851
+ return e ? /* @__PURE__ */ V(ce, {
1852
+ value: e,
1853
+ tabIndex: -1,
1854
+ className: n,
1855
+ children: t
1856
+ }) : /* @__PURE__ */ V("div", {
1857
+ className: n,
1858
+ children: t
1859
+ });
1860
+ }
1861
+ function Tt(e, t, n) {
1862
+ return R(() => {
1554
1863
  if (e) return e;
1555
1864
  let r = /* @__PURE__ */ new Set();
1556
1865
  for (let e of t) {
@@ -1567,404 +1876,432 @@ function tt(e, t, n) {
1567
1876
  t
1568
1877
  ]);
1569
1878
  }
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({
1572
- items: M,
1573
- fetcher: ae,
1574
- refreshKey: N,
1575
- accessors: P,
1576
- collections: ce,
1577
- selectionMode: g,
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,
1879
+ function Et({ title: e, titleSuffix: t, description: a, confirmLabel: c, cancelLabel: u, selectionMode: _ = "multiple", density: v = "comfortable", showMeta: y = !0, allowUpload: b = !0, typeFilters: x, confirmOnSelect: C = !1, onConfirm: ee, onCancel: w, onClose: te, bulkActions: T, strings: E, slots: D, heightClassName: O, className: ie, items: A, fetcher: j, refreshKey: M, pageSize: ae, accessors: oe, collections: se, value: N, defaultValue: ce, onValueChange: de, onItemUpdate: fe, onItemDelete: F, onItemReplace: pe, onItemOpen: I, onUpload: R, uploadAccept: ge, maxFileSize: _e, maxFiles: ve, uploadFailedMessage: ye, onError: be, selecting: Se, defaultSelecting: Ce, onSelectingChange: we, tab: Te, defaultTab: Ee, onTabChange: De, view: Oe, defaultView: ke, onViewChange: Ae, query: je, defaultQuery: Ne, onQueryChange: Pe, type: Ie, defaultType: Le, onTypeChange: Re, collection: ze, defaultCollection: Be, onCollectionChange: Ve, sort: He, defaultSort: Ue, onSortChange: We, uploadOptions: Ge, defaultUploadOptions: Ke, onUploadOptionsChange: qe, ...Je }) {
1880
+ let G = n(U, E), K = at({
1881
+ items: A,
1882
+ fetcher: j,
1883
+ refreshKey: M,
1884
+ pageSize: ae,
1885
+ accessors: oe,
1886
+ collections: se,
1887
+ selectionMode: _,
1888
+ value: N,
1889
+ defaultValue: ce,
1890
+ onValueChange: de,
1891
+ onItemUpdate: fe,
1892
+ onItemDelete: F,
1893
+ onUpload: R,
1894
+ uploadAccept: ge,
1895
+ maxFileSize: _e,
1896
+ maxFiles: ve,
1897
+ uploadFailedMessage: ye ?? G.upload.fileFailed ?? U.upload.fileFailed,
1898
+ onError: be,
1899
+ tab: Te,
1900
+ defaultTab: Ee,
1901
+ onTabChange: De,
1902
+ view: Oe,
1903
+ defaultView: ke,
1904
+ onViewChange: Ae,
1905
+ query: je,
1906
+ defaultQuery: Ne,
1907
+ onQueryChange: Pe,
1908
+ type: Ie,
1909
+ defaultType: Le,
1910
+ onTypeChange: Re,
1911
+ collection: ze,
1912
+ defaultCollection: Be,
1913
+ onCollectionChange: Ve,
1914
+ sort: He,
1915
+ defaultSort: Ue,
1916
+ onSortChange: We,
1917
+ uploadOptions: Ge,
1918
+ defaultUploadOptions: Ke,
1919
+ onUploadOptionsChange: qe,
1920
+ selecting: Se,
1921
+ defaultSelecting: Ce ?? C,
1922
+ onSelectingChange: we
1923
+ }), Ye = Tt(se, K.items, K.accessors.getCollection), Xe = b ? K.tab : "library", [q, Ze] = B(null), Qe = z(null), $e = q ? K.accessors.getId(q.item) : null, et = K.detailId ? K.items.find((e) => K.accessors.getId(e) === K.detailId) ?? ($e === K.detailId ? q?.item ?? null : null) : null, tt = K.mutationError?.operation === "delete" && K.mutationError.itemId === $e, nt = me(Ct), rt = !D?.footer, it = nt && rt ? /* @__PURE__ */ V(bt, {
1924
+ tab: Xe,
1611
1925
  selectedIds: K.selectedIds,
1612
- selectionMode: g,
1926
+ selectionMode: _,
1613
1927
  stagedFiles: K.stagedFiles,
1614
1928
  strings: G,
1615
1929
  onClearSelection: K.clearSelection,
1616
1930
  className: "media-library-dialog--selection-summary shrink-0 justify-end"
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 = () => {
1620
- E?.(), D?.();
1621
- }, pt = (e) => {
1931
+ }) : null, ot = !!(e || t || a || D?.headerStart), st = !!(b || D?.headerEnd || it), J = ot || st, ct = () => {
1932
+ ee?.(K.selectedItems, K.selectedIds), te?.();
1933
+ }, Y = () => {
1934
+ w?.(), te?.();
1935
+ }, lt = () => {
1936
+ if (K.uploading) {
1937
+ K.cancelUpload();
1938
+ return;
1939
+ }
1940
+ K.clearStagedFiles(), K.setTab("library");
1941
+ }, X = (e) => {
1622
1942
  let t = 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) => {
1943
+ K.toggleSelection(t), C && (ee?.([e], [t]), te?.());
1944
+ }, ut = z(null), Z = z(null), dt = z(null), gt = z(!1), _t = (e) => !F || Qe.current ? Promise.resolve(!1) : new Promise((t) => {
1625
1945
  let n = {
1626
1946
  item: e,
1627
1947
  resolve: t
1628
1948
  };
1629
- rt.current = n, nt(n);
1630
- }), vt = (e) => {
1631
- let t = rt.current;
1632
- rt.current = null, nt(null), t?.resolve(e);
1949
+ Qe.current = n, Ze(n);
1950
+ }), Et = (e) => {
1951
+ let t = Qe.current;
1952
+ Qe.current = null, Ze(null), t?.resolve(e);
1633
1953
  };
1634
- se(() => () => {
1635
- rt.current?.resolve(!1), rt.current = null;
1954
+ L(() => () => {
1955
+ Qe.current?.resolve(!1), Qe.current = null;
1636
1956
  }, []);
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));
1957
+ let Q = (e) => {
1958
+ dt.current = document.activeElement instanceof HTMLElement ? document.activeElement : null, K.setDetailId(e);
1959
+ }, Dt = (e) => {
1960
+ I ? I(e) : Q(K.accessors.getId(e));
1641
1961
  };
1642
- se(() => {
1962
+ L(() => {
1643
1963
  if (K.detailId !== null) {
1644
- Q.current && mt.current?.querySelector("[data-media-detail-close]")?.focus();
1964
+ dt.current && ut.current?.querySelector("[data-media-detail-close]")?.focus();
1645
1965
  return;
1646
1966
  }
1647
- let e = Q.current;
1648
- Q.current = null, gt.current ? (gt.current = !1, ht.current?.focus()) : e?.isConnected && e.focus();
1967
+ let e = dt.current;
1968
+ dt.current = null, gt.current ? (gt.current = !1, Z.current?.focus()) : e?.isConnected && e.focus();
1649
1969
  }, [K.detailId]);
1650
- let xt = !!ae && !K.loading && K.loadError != null, St = K.query.trim(), Ct = St.length > 0 ? U(G.countSearch, {
1970
+ let Ot = !!j && !K.loading && K.loadError != null, kt = z(!1), At = () => {
1971
+ kt.current = !0, K.loadMore();
1972
+ };
1973
+ L(() => {
1974
+ !K.loadingMore && kt.current && (kt.current = !1, !K.hasMore && document.activeElement === document.body && Z.current?.focus());
1975
+ }, [K.hasMore, K.loadingMore]);
1976
+ let jt = !!K.hasMore && !Ot && !(K.loading && !K.hasLoadedResults), Mt = K.query.trim(), Nt = Mt.length > 0 ? W(G.countSearch, {
1651
1977
  count: K.filteredCount,
1652
1978
  total: K.totalCount,
1653
- query: St
1654
- }) : K.filteredCount === K.totalCount ? U(G.countAll, { count: K.totalCount }) : U(G.countFiltered, {
1979
+ query: Mt
1980
+ }) : K.filteredCount === K.totalCount ? W(G.countAll, { count: K.totalCount }) : W(G.countFiltered, {
1655
1981
  count: K.filteredCount,
1656
1982
  total: K.totalCount
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,
1983
+ }), Pt = !!T && !(nt || ee && !C), Ft = Xe === "library" ? K.selectedIds.length : 0, It = D?.footer ?? (Pt && Xe === "library" ? null : nt ? /* @__PURE__ */ V(xt, {
1984
+ tab: Xe,
1659
1985
  selectedItems: K.selectedItems,
1660
1986
  selectedIds: K.selectedIds,
1661
1987
  stagedFiles: K.stagedFiles,
1662
1988
  uploading: K.uploading,
1663
1989
  strings: G,
1664
- confirmLabel: f,
1665
- cancelLabel: h,
1666
- onCancel: ft,
1667
- onConfirm: dt,
1990
+ confirmLabel: c,
1991
+ cancelLabel: u,
1992
+ onCancel: Y,
1993
+ onConfirm: ct,
1668
1994
  onUpload: K.startUpload,
1669
- onCancelUpload: () => {
1670
- K.cancelUpload(), K.clearStagedFiles(), K.setTab("library");
1671
- },
1995
+ onCancelUpload: lt,
1672
1996
  className: "ml-auto"
1673
- }) : /* @__PURE__ */ L($e, {
1674
- tab: q,
1997
+ }) : /* @__PURE__ */ V(St, {
1998
+ tab: Xe,
1675
1999
  selectedItems: K.selectedItems,
1676
2000
  selectedIds: K.selectedIds,
1677
- selectionMode: g,
2001
+ selectionMode: _,
1678
2002
  stagedFiles: K.stagedFiles,
1679
2003
  uploading: K.uploading,
1680
2004
  strings: G,
1681
- confirmLabel: f,
1682
- cancelLabel: h,
1683
- onCancel: ft,
1684
- onConfirm: dt,
2005
+ confirmLabel: c,
2006
+ cancelLabel: u,
2007
+ onCancel: Y,
2008
+ onConfirm: ct,
1685
2009
  onClearSelection: K.clearSelection,
1686
2010
  onUpload: K.startUpload,
1687
- onCancelUpload: () => {
1688
- K.cancelUpload(), K.clearStagedFiles(), K.setTab("library");
1689
- }
1690
- }));
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,
1695
- children: [
1696
- ut && /* @__PURE__ */ R("header", {
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",
1698
- children: [ct && /* @__PURE__ */ R(l, {
2011
+ onCancelUpload: lt
2012
+ })), Lt = 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", O ?? "h-190 max-h-[calc(100vh-7rem)]", ie), Rt = /* @__PURE__ */ H(he, { children: [
2013
+ J && /* @__PURE__ */ H("header", {
2014
+ className: r("media-library--header flex flex-col gap-space-lg p-surface", d.header, "@2xl/media-library:flex-row @2xl/media-library:items-center @2xl/media-library:justify-between"),
2015
+ children: [ot && /* @__PURE__ */ H(l, {
2016
+ direction: "horizontal",
2017
+ align: "start",
2018
+ gap: "lg",
2019
+ className: "min-w-0",
2020
+ children: [D?.headerStart, (e || t || a) && /* @__PURE__ */ H(l, {
2021
+ gap: "normal",
2022
+ className: "min-w-0",
2023
+ children: [!!(e || t) && /* @__PURE__ */ V(m, {
2024
+ title: e,
2025
+ suffix: t,
2026
+ className: "media-library--title"
2027
+ }), !!a && /* @__PURE__ */ V(i, {
2028
+ type: "secondary",
2029
+ children: a
2030
+ })]
2031
+ })]
2032
+ }), st && /* @__PURE__ */ H("div", {
2033
+ className: r("media-library--header-controls flex min-w-0 flex-wrap items-center gap-space-md", it ? "flex-1 justify-between" : "@2xl/media-library:justify-end"),
2034
+ children: [/* @__PURE__ */ H(l, {
1699
2035
  direction: "horizontal",
1700
- align: "start",
1701
- gap: "lg",
2036
+ wrap: !0,
2037
+ align: "center",
2038
+ gap: "md",
1702
2039
  className: "min-w-0",
1703
- children: [A?.headerStart, (o || c || u) && /* @__PURE__ */ R(l, {
1704
- gap: "normal",
1705
- className: "min-w-0",
1706
- children: [!!(o || c) && /* @__PURE__ */ L(d, {
1707
- title: o,
1708
- suffix: c,
1709
- className: "media-library--title"
1710
- }), !!u && /* @__PURE__ */ L(a, {
1711
- type: "secondary",
1712
- children: u
2040
+ children: [b && /* @__PURE__ */ H(le, {
2041
+ className: "media-library--tabs",
2042
+ children: [/* @__PURE__ */ H(P, {
2043
+ value: "library",
2044
+ children: [/* @__PURE__ */ V(xe, { className: "size-icon-md" }), G.tabs.library]
2045
+ }), /* @__PURE__ */ H(P, {
2046
+ value: "upload",
2047
+ children: [
2048
+ /* @__PURE__ */ V(Me, { className: "size-icon-md" }),
2049
+ G.tabs.upload,
2050
+ K.stagedFiles.length > 0 && /* @__PURE__ */ V(k, {
2051
+ size: "sm",
2052
+ tone: "secondary",
2053
+ className: "media-library--staged-count",
2054
+ children: /* @__PURE__ */ V(ne, {
2055
+ value: K.stagedFiles.length,
2056
+ size: "inherit",
2057
+ weight: "inherit",
2058
+ type: "inherit",
2059
+ align: "center"
2060
+ })
2061
+ })
2062
+ ]
1713
2063
  })]
1714
- })]
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, {
1718
- direction: "horizontal",
1719
- wrap: !0,
1720
- align: "center",
1721
- gap: "md",
1722
- className: "min-w-0",
1723
- children: [x && /* @__PURE__ */ R("div", {
1724
- className: r("media-library--tabs", k.frame, re[We]),
1725
- role: "tablist",
1726
- children: [/* @__PURE__ */ R(i, {
2064
+ }), D?.headerEnd]
2065
+ }), it]
2066
+ })]
2067
+ }),
2068
+ /* @__PURE__ */ H(wt, {
2069
+ tab: b ? Xe : null,
2070
+ children: [Xe === "upload" ? /* @__PURE__ */ V("div", {
2071
+ className: "min-w-0 flex-1 overflow-y-auto",
2072
+ children: /* @__PURE__ */ V(yt, {
2073
+ stagedFiles: K.stagedFiles,
2074
+ uploadOptions: K.uploadOptions,
2075
+ collections: Ye,
2076
+ uploading: K.uploading,
2077
+ hasUploadError: K.uploadError != null && K.stagedFiles.length > 0,
2078
+ accept: ge,
2079
+ maxFileSize: _e,
2080
+ maxFiles: ve,
2081
+ rejections: K.uploadRejections,
2082
+ strings: G,
2083
+ onFiles: K.addFiles,
2084
+ onRemoveFile: K.removeStagedFile,
2085
+ onOptionsChange: K.updateUploadOptions,
2086
+ empty: D?.uploadEmpty
2087
+ })
2088
+ }) : /* @__PURE__ */ H("div", {
2089
+ className: r("media-library--library min-w-0 flex-1 flex-col", et ? "hidden @2xl/media-library:flex" : "flex"),
2090
+ children: [/* @__PURE__ */ V(l, {
2091
+ gap: "md",
2092
+ className: r("media-library--toolbar p-surface", d.header),
2093
+ children: /* @__PURE__ */ V(pt, {
2094
+ query: K.query,
2095
+ type: K.type,
2096
+ typeFilters: x,
2097
+ collection: K.collection,
2098
+ sort: K.sort,
2099
+ view: K.view,
2100
+ collections: Ye,
2101
+ strings: G,
2102
+ onQueryChange: K.setQuery,
2103
+ onTypeChange: K.setType,
2104
+ onCollectionChange: K.setCollection,
2105
+ onSortChange: K.setSort,
2106
+ onViewChange: K.setView,
2107
+ onClearFilters: K.clearFilters,
2108
+ toolbarEnd: D?.toolbarEnd,
2109
+ selecting: K.selecting,
2110
+ onSelectingChange: K.setSelecting,
2111
+ disabled: Ot,
2112
+ summary: /* @__PURE__ */ V("span", {
2113
+ "aria-live": "polite",
2114
+ className: "media-library--count min-w-0 truncate",
2115
+ children: Ot || K.loading ? null : /* @__PURE__ */ V(i, {
2116
+ tag: "span",
2117
+ size: "xs",
2118
+ type: "secondary",
2119
+ children: Nt
2120
+ })
2121
+ })
2122
+ })
2123
+ }), /* @__PURE__ */ H("div", {
2124
+ ref: Z,
2125
+ role: "region",
2126
+ "aria-label": G.resultsLabel,
2127
+ "aria-busy": K.loading || void 0,
2128
+ tabIndex: 0,
2129
+ className: `media-library--results flex min-h-0 flex-1 flex-col gap-space-lg overflow-y-auto p-surface focus-visible:outline-none ${o.inset}`,
2130
+ children: [K.loading && !K.hasLoadedResults ? /* @__PURE__ */ V("div", {
2131
+ className: "media-library--state my-auto",
2132
+ children: D?.loading ?? /* @__PURE__ */ V(h, {
2133
+ className: "min-h-64",
2134
+ label: G.loading
2135
+ })
2136
+ }) : Ot ? /* @__PURE__ */ V("div", {
2137
+ className: "media-library--state my-auto",
2138
+ children: D?.error ?? /* @__PURE__ */ V(g, {
2139
+ title: G.errorTitle,
2140
+ description: G.errorDescription,
2141
+ onRetry: j ? K.retry : void 0,
2142
+ retryLabel: G.retry ?? U.retry
2143
+ })
2144
+ }) : K.visibleItems.length === 0 ? /* @__PURE__ */ V("div", {
2145
+ className: "media-library--state my-auto",
2146
+ children: D?.empty ?? /* @__PURE__ */ V(ft, {
2147
+ title: K.hasFilters ? G.emptyFilteredTitle : G.emptyLibraryTitle,
2148
+ description: K.hasFilters ? G.emptyFilteredDescription : G.emptyLibraryDescription,
2149
+ action: K.hasFilters ? /* @__PURE__ */ V(s, {
1727
2150
  type: "button",
1728
- role: "tab",
1729
- "aria-selected": q === "library",
1730
2151
  tone: "secondary",
1731
- buttonStyle: "ghost",
1732
- size: "sm",
1733
- className: r(k.item, "shadow-none", q === "library" ? `${b.segmentActive} hover:bg-card` : "text-muted-foreground hover:bg-transparent hover:text-foreground"),
1734
- onClick: () => K.setTab("library"),
1735
- children: [/* @__PURE__ */ L(fe, { className: "size-icon-md" }), G.tabs.library]
1736
- }), /* @__PURE__ */ R(i, {
2152
+ buttonStyle: "outline",
2153
+ onClick: K.clearFilters,
2154
+ children: G.clearFilters
2155
+ }) : b ? /* @__PURE__ */ V(s, {
2156
+ tone: "primary",
1737
2157
  type: "button",
1738
- role: "tab",
1739
- "aria-selected": q === "upload",
1740
- tone: "secondary",
1741
- buttonStyle: "ghost",
1742
- size: "sm",
1743
- className: r(k.item, "shadow-none", q === "upload" ? `${b.segmentActive} hover:bg-card` : "text-muted-foreground hover:bg-transparent hover:text-foreground"),
1744
2158
  onClick: () => K.setTab("upload"),
1745
- children: [
1746
- /* @__PURE__ */ L(Se, { className: "size-icon-md" }),
1747
- G.tabs.upload,
1748
- K.stagedFiles.length > 0 && /* @__PURE__ */ L(T, {
1749
- size: "sm",
1750
- tone: "secondary",
1751
- className: "media-library--staged-count",
1752
- children: /* @__PURE__ */ L(w, {
1753
- value: K.stagedFiles.length,
1754
- size: "inherit",
1755
- weight: "inherit",
1756
- type: "inherit",
1757
- align: "center"
1758
- })
1759
- })
1760
- ]
1761
- })]
1762
- }), A?.headerEnd]
1763
- }), st]
1764
- })]
1765
- }),
1766
- /* @__PURE__ */ R("div", {
1767
- className: "media-library--body flex min-h-0 flex-1",
1768
- children: [q === "upload" ? /* @__PURE__ */ L("div", {
1769
- className: "min-w-0 flex-1 overflow-y-auto",
1770
- children: /* @__PURE__ */ L(Ze, {
1771
- stagedFiles: K.stagedFiles,
1772
- uploadOptions: K.uploadOptions,
1773
- collections: Ge,
1774
- uploading: K.uploading,
1775
- hasUploadError: K.uploadError != null && K.stagedFiles.length > 0,
1776
- strings: G,
1777
- onFiles: K.addFiles,
1778
- onRemoveFile: K.removeStagedFile,
1779
- onOptionsChange: K.updateUploadOptions,
1780
- empty: A?.uploadEmpty
1781
- })
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, {
1785
- gap: "md",
1786
- className: "media-library--toolbar border-b border-border/60 p-surface",
1787
- children: /* @__PURE__ */ L(qe, {
1788
- query: K.query,
1789
- type: K.type,
1790
- typeFilters: S,
1791
- collection: K.collection,
1792
- sort: K.sort,
1793
- view: K.view,
1794
- collections: Ge,
2159
+ children: G.uploadMedia
2160
+ }) : void 0
2161
+ })
2162
+ }) : K.view === "table" ? /* @__PURE__ */ V("div", {
2163
+ className: "overflow-x-auto",
2164
+ children: /* @__PURE__ */ V(ht, {
2165
+ items: K.visibleItems,
2166
+ selectedSet: K.selectedSet,
2167
+ selectionMode: _,
2168
+ accessors: K.accessors,
1795
2169
  strings: G,
1796
- onQueryChange: K.setQuery,
1797
- onTypeChange: K.setType,
1798
- onCollectionChange: K.setCollection,
1799
- onSortChange: K.setSort,
1800
- onViewChange: K.setView,
1801
- onClearFilters: K.clearFilters,
1802
- toolbarEnd: A?.toolbarEnd,
2170
+ onToggle: (e) => {
2171
+ let t = K.items.find((t) => K.accessors.getId(t) === e);
2172
+ t && X(t);
2173
+ },
2174
+ onDetails: Q,
1803
2175
  selecting: K.selecting,
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
- })
2176
+ onOpen: (e) => {
2177
+ let t = K.items.find((t) => K.accessors.getId(t) === e);
2178
+ t && Dt(t);
2179
+ }
1816
2180
  })
1817
- }), /* @__PURE__ */ L("div", {
1818
- ref: ht,
1819
- role: "region",
1820
- "aria-label": G.resultsLabel,
1821
- "aria-busy": K.loading || void 0,
1822
- tabIndex: 0,
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", {
1857
- className: "overflow-x-auto",
1858
- children: /* @__PURE__ */ L(Ye, {
1859
- items: K.visibleItems,
1860
- selectedSet: K.selectedSet,
1861
- selectionMode: g,
2181
+ }) : /* @__PURE__ */ V("div", {
2182
+ 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))]"),
2183
+ children: K.visibleItems.map((e) => {
2184
+ let t = K.accessors.getId(e), n = {
2185
+ id: t,
2186
+ selected: K.selectedSet.has(t),
2187
+ selectionMode: _,
2188
+ selecting: K.selecting,
2189
+ accessors: K.accessors,
2190
+ toggle: () => X(e),
2191
+ openDetails: () => Q(t),
2192
+ open: () => Dt(e)
2193
+ }, r = D?.renderItem?.(e, n);
2194
+ return r ? /* @__PURE__ */ V("div", { children: r }, t) : /* @__PURE__ */ V(mt, {
2195
+ item: e,
2196
+ selected: n.selected,
2197
+ density: v,
2198
+ showMeta: y,
2199
+ selectionMode: _,
1862
2200
  accessors: K.accessors,
1863
2201
  strings: G,
1864
- onToggle: (e) => {
1865
- let t = K.items.find((t) => K.accessors.getId(t) === e);
1866
- t && pt(t);
1867
- },
1868
- onDetails: yt,
1869
- selecting: K.selecting,
1870
- onOpen: (e) => {
1871
- let t = K.items.find((t) => K.accessors.getId(t) === e);
1872
- t && bt(t);
1873
- }
1874
- })
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))]"),
1877
- children: K.visibleItems.map((e) => {
1878
- let t = K.accessors.getId(e), n = {
1879
- id: t,
1880
- selected: K.selectedSet.has(t),
1881
- selectionMode: g,
1882
- selecting: K.selecting,
1883
- accessors: K.accessors,
1884
- toggle: () => pt(e),
1885
- openDetails: () => yt(t),
1886
- open: () => bt(e)
1887
- }, r = A?.renderItem?.(e, n);
1888
- return r ? /* @__PURE__ */ L("div", { children: r }, t) : /* @__PURE__ */ L(Je, {
1889
- item: e,
1890
- selected: n.selected,
1891
- density: _,
1892
- showMeta: v,
1893
- selectionMode: g,
1894
- accessors: K.accessors,
1895
- strings: G,
1896
- onToggle: n.toggle,
1897
- onDetails: n.openDetails,
1898
- onOpen: n.open,
1899
- selecting: n.selecting
1900
- }, t);
1901
- })
2202
+ onToggle: n.toggle,
2203
+ onDetails: n.openDetails,
2204
+ onOpen: n.open,
2205
+ selecting: n.selecting
2206
+ }, t);
1902
2207
  })
2208
+ }), jt && /* @__PURE__ */ H(l, {
2209
+ align: "center",
2210
+ gap: "md",
2211
+ className: "media-library--load-more",
2212
+ children: [K.loadMoreError != null && /* @__PURE__ */ V(f, {
2213
+ tone: "destructive",
2214
+ children: /* @__PURE__ */ V(p, { children: G.loadMoreError ?? U.loadMoreError })
2215
+ }), /* @__PURE__ */ V(s, {
2216
+ type: "button",
2217
+ tone: "secondary",
2218
+ buttonStyle: "outline",
2219
+ disabled: K.loading,
2220
+ loading: K.loadingMore,
2221
+ strings: { loading: G.loadingMore ?? U.loadingMore },
2222
+ onClick: At,
2223
+ children: K.loadMoreError == null ? G.loadMore ?? U.loadMore : G.retry ?? U.retry
2224
+ })]
1903
2225
  })]
1904
- }), q === "library" && /* @__PURE__ */ L(Xe, {
1905
- item: X,
1906
- collections: Ge,
1907
- accessors: K.accessors,
1908
- strings: G,
1909
- onClose: () => K.setDetailId(null),
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),
1916
- renderDetail: A?.renderDetail
1917
2226
  })]
1918
- }),
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,
2227
+ }), Xe === "library" && /* @__PURE__ */ V(vt, {
2228
+ item: et,
2229
+ collections: Ye,
2230
+ accessors: K.accessors,
2231
+ strings: G,
2232
+ onClose: () => K.setDetailId(null),
2233
+ readOnly: !fe,
2234
+ onUpdate: (e) => et ? K.updateItem(et, e) : Promise.resolve(!1),
2235
+ mutationError: K.mutationError?.itemId === K.detailId ? K.mutationError : null,
2236
+ onReplace: pe && et ? () => pe(et) : void 0,
2237
+ allowDelete: !!F,
2238
+ onRemove: () => et ? _t(et) : Promise.resolve(!1),
2239
+ renderDetail: D?.renderDetail
2240
+ })]
2241
+ }),
2242
+ nt ? nt.element ? Fe(It, nt.element) : null : It,
2243
+ (F || q) && /* @__PURE__ */ V(S, {
2244
+ open: q !== null,
2245
+ onOpenChange: (e) => {
2246
+ e || Et(!1);
2247
+ },
2248
+ destructive: !0,
2249
+ title: G.detail.confirmDeleteTitle ?? U.detail.confirmDeleteTitle,
2250
+ description: q ? W(G.detail.confirmDeleteDescription ?? U.detail.confirmDeleteDescription ?? "", { name: K.accessors.getName(q.item) }) : void 0,
2251
+ strings: { confirm: G.detail.confirmDeleteLabel ?? U.detail.confirmDeleteLabel },
2252
+ alertMessage: tt ? G.detail.confirmDeleteError ?? U.detail.confirmDeleteError : void 0,
2253
+ closeOnAsyncComplete: !1,
2254
+ onAsyncConfirm: async () => {
2255
+ q && await K.removeItem(q.item) && Qe.current === q && (gt.current = !0, K.setDetailId(null), Et(!0));
2256
+ }
2257
+ }),
2258
+ Pt && /* @__PURE__ */ V(re, {
2259
+ selectedCount: Ft,
2260
+ totalCount: K.totalCount,
2261
+ onClear: K.clearSelection,
2262
+ returnFocusRef: Z,
2263
+ className: "media-library--bulk-actions",
2264
+ strings: {
2265
+ label: G.batchActionsLabel,
2266
+ summary: (e) => W(G.footer.selectedCount, { count: e }),
2267
+ clear: G.footer.clear
2268
+ },
2269
+ children: Ft > 0 && T?.({
2270
+ selectedItems: K.items.filter((e) => K.selectedSet.has(K.accessors.getId(e))),
2271
+ selectedIds: K.selectedIds,
2272
+ selectedCount: K.selectedIds.length,
2273
+ visibleCount: K.filteredCount,
1937
2274
  totalCount: K.totalCount,
1938
- onClear: K.clearSelection,
1939
- returnFocusRef: ht,
1940
- className: "media-library--bulk-actions",
1941
- strings: {
1942
- label: G.batchActionsLabel,
1943
- summary: (e) => U(G.footer.selectedCount, { count: e }),
1944
- clear: G.footer.clear
1945
- },
1946
- children: wt > 0 && O?.({
1947
- selectedItems: K.items.filter((e) => K.selectedSet.has(K.accessors.getId(e))),
1948
- selectedIds: K.selectedIds,
1949
- selectedCount: K.selectedIds.length,
1950
- visibleCount: K.filteredCount,
1951
- totalCount: K.totalCount,
1952
- clearSelection: K.clearSelection
1953
- })
2275
+ clearSelection: K.clearSelection
1954
2276
  })
1955
- ]
2277
+ })
2278
+ ] });
2279
+ return b ? /* @__PURE__ */ V(ue, {
2280
+ value: Xe,
2281
+ onValueChange: (e) => K.setTab(e),
2282
+ render: /* @__PURE__ */ V("section", {
2283
+ ref: ut,
2284
+ ...Je
2285
+ }),
2286
+ className: r("gap-0", Lt),
2287
+ children: Rt
2288
+ }) : /* @__PURE__ */ V("section", {
2289
+ ref: ut,
2290
+ className: Lt,
2291
+ ...Je,
2292
+ children: Rt
1956
2293
  });
1957
2294
  }
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);
2295
+ function Q({ 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 }) {
2296
+ let m = n(U, p.strings), [h, g] = B(!1), [_, v] = B(null), y = e !== void 0, b = y ? e : h, S = (e) => {
2297
+ y || g(e), t?.(e);
1961
2298
  }, C = () => {
1962
2299
  S(!1), s?.();
1963
2300
  };
1964
- return /* @__PURE__ */ L(et.Provider, {
2301
+ return /* @__PURE__ */ V(Ct.Provider, {
1965
2302
  value: { element: _ },
1966
- children: /* @__PURE__ */ L(v, {
1967
- open: x,
2303
+ children: /* @__PURE__ */ V(x, {
2304
+ open: b,
1968
2305
  onOpenChange: S,
1969
2306
  onClose: s,
1970
2307
  trigger: i,
@@ -1973,15 +2310,15 @@ function rt({ open: e, onOpenChange: t, trigger: i, dialogTitle: a, dialogDescri
1973
2310
  size: "full",
1974
2311
  showCancel: !1,
1975
2312
  showConfirm: !1,
1976
- footer: /* @__PURE__ */ L("div", {
1977
- ref: y,
2313
+ footer: /* @__PURE__ */ V("div", {
2314
+ ref: v,
1978
2315
  className: "media-library-dialog--footer @container/media-library w-full"
1979
2316
  }),
1980
2317
  className: r("media-library-dialog--component max-h-[calc(100vh-2rem)] max-w-[min(1060px,calc(100vw-2rem))] sm:max-w-[min(1060px,calc(100vw-2rem))]", l),
1981
2318
  contentClassName: r("media-library-dialog--body flex min-h-0 flex-col overflow-hidden p-0", u),
1982
2319
  closeOnBackdropClick: f,
1983
2320
  closeOnEscape: d,
1984
- children: /* @__PURE__ */ L(nt, {
2321
+ children: /* @__PURE__ */ V(Et, {
1985
2322
  ...p,
1986
2323
  defaultSelecting: p.defaultSelecting ?? !0,
1987
2324
  onClose: C,
@@ -1994,45 +2331,45 @@ function rt({ open: e, onOpenChange: t, trigger: i, dialogTitle: a, dialogDescri
1994
2331
  }
1995
2332
  //#endregion
1996
2333
  //#region src/components/features/media-library/media-resource-gallery.tsx
1997
- function it(e, t, n) {
2334
+ function Dt(e, t, n) {
1998
2335
  let r = e.slice(), [i] = r.splice(t, 1);
1999
2336
  return i === void 0 || r.splice(n, 0, i), r;
2000
2337
  }
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, {
2338
+ function Ot({ items: e, accessors: t, title: a, description: o, primaryId: c, onPrimaryChange: d, onRemove: f, onReorder: p, onAdd: m, maxItems: h, layout: g = "field", density: _ = "comfortable", readOnly: y = !1, empty: x, action: S, renderItem: ee, strings: te, className: T, ...ne }) {
2339
+ let E = n(U, te), D = Ke(t), O = e.length, re = c ?? (O > 0 ? D.getId(e[0]) : void 0), ie = !y && !!m && (h === void 0 || O < h), A = !y && !!d, j = !y && !!f, M = !y && !!p, ae = A || j || M, oe = ie && (g === "field" || O > 0) ? /* @__PURE__ */ V(s, {
2003
2340
  type: "button",
2004
2341
  tone: "secondary",
2005
2342
  buttonStyle: "outline",
2006
- icon: ve,
2007
- onClick: p,
2343
+ icon: Oe,
2344
+ onClick: m,
2008
2345
  children: E.gallery.add
2009
- }) : m !== void 0 && O >= m ? /* @__PURE__ */ L(T, {
2346
+ }) : h !== void 0 && O >= h ? /* @__PURE__ */ V(k, {
2010
2347
  tone: "secondary",
2011
2348
  children: E.gallery.maxReached
2012
2349
  }) : 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", {
2350
+ if (!M || n < 0 || n >= O || t === n) return;
2351
+ let r = Dt(e, t, n);
2352
+ p?.(r.map((e) => D.getId(e)), r);
2353
+ }, P = !!(a || o || S || oe), ce = O === 0 && g !== "field", le = () => !ie || g !== "field" ? null : /* @__PURE__ */ H("button", {
2017
2354
  type: "button",
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}`),
2355
+ 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 ${se.hover}`),
2019
2356
  "aria-label": E.gallery.addTile,
2020
- onClick: p,
2021
- children: [/* @__PURE__ */ L(ve, { className: "size-icon" }), /* @__PURE__ */ L(a, {
2357
+ onClick: m,
2358
+ children: [/* @__PURE__ */ V(Oe, { className: "size-icon" }), /* @__PURE__ */ V(i, {
2022
2359
  tag: "span",
2023
2360
  size: "inherit",
2024
2361
  className: "sr-only",
2025
2362
  children: E.gallery.addTile
2026
2363
  })]
2027
2364
  });
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,
2365
+ return /* @__PURE__ */ H("section", {
2366
+ className: r("media-resource-gallery--component @container/media-resource-gallery", u.frame, T),
2367
+ "data-layout": g,
2031
2368
  "data-gallery-density": _,
2032
- ...te,
2033
- children: [oe && /* @__PURE__ */ L("header", {
2369
+ ...ne,
2370
+ children: [P && /* @__PURE__ */ V("header", {
2034
2371
  className: "media-resource-gallery--header p-surface",
2035
- children: /* @__PURE__ */ R(l, {
2372
+ children: /* @__PURE__ */ H(l, {
2036
2373
  direction: {
2037
2374
  base: "vertical",
2038
2375
  md: "horizontal"
@@ -2040,44 +2377,44 @@ function X({ items: e, accessors: t, title: o, description: s, primaryId: c, onP
2040
2377
  gap: "lg",
2041
2378
  align: { md: "start" },
2042
2379
  justify: { md: "between" },
2043
- children: [/* @__PURE__ */ R(l, {
2380
+ children: [/* @__PURE__ */ H(l, {
2044
2381
  gap: "normal",
2045
2382
  className: "min-w-0",
2046
- children: [!!o && /* @__PURE__ */ L(a, {
2383
+ children: [!!a && /* @__PURE__ */ V(i, {
2047
2384
  tag: "div",
2048
2385
  type: "inherit",
2049
2386
  weight: "semibold",
2050
- children: o
2051
- }), !!s && /* @__PURE__ */ L(a, {
2387
+ children: a
2388
+ }), !!o && /* @__PURE__ */ V(i, {
2052
2389
  type: "secondary",
2053
- children: s
2390
+ children: o
2054
2391
  })]
2055
- }), /* @__PURE__ */ L(l, {
2392
+ }), /* @__PURE__ */ V(l, {
2056
2393
  direction: "horizontal",
2057
2394
  wrap: !0,
2058
2395
  align: "center",
2059
- gap: g.commands,
2396
+ gap: v.commands,
2060
2397
  className: "media-resource-gallery--actions",
2061
- children: x ?? ae
2398
+ children: S ?? oe
2062
2399
  })]
2063
2400
  })
2064
- }), se ? /* @__PURE__ */ L("div", {
2401
+ }), ce ? /* @__PURE__ */ V("div", {
2065
2402
  className: "media-resource-gallery--empty px-surface pb-surface",
2066
- children: y ?? /* @__PURE__ */ L(Ke, {
2403
+ children: x ?? /* @__PURE__ */ V(ft, {
2067
2404
  title: E.gallery.emptyTitle,
2068
2405
  description: E.gallery.emptyDescription,
2069
- action: k ? /* @__PURE__ */ L(i, {
2406
+ action: ie ? /* @__PURE__ */ V(s, {
2070
2407
  tone: "primary",
2071
2408
  type: "button",
2072
- icon: pe,
2073
- onClick: p,
2409
+ icon: Se,
2410
+ onClick: m,
2074
2411
  children: E.gallery.add
2075
2412
  }) : void 0
2076
2413
  })
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))]"),
2414
+ }) : /* @__PURE__ */ H("div", {
2415
+ className: r("grid min-w-0 grid-cols-1", g === "list" ? "gap-space-md" : "gap-space-lg", "media-resource-gallery--items p-surface", P && "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))]" : _ === "compact" ? "grid-cols-[repeat(auto-fill,minmax(132px,1fr))]" : "grid-cols-[repeat(auto-fill,minmax(164px,1fr))]"),
2079
2416
  children: [e.map((e, t) => {
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, {
2417
+ let n = D.getId(e), a = D.getName(e), o = D.getType(e), c = D.getSrc(e), u = D.getAlt(e) || a, p = n === re, m = D.getPublic(e) === !1, h = D.getDuration(e), v = M && t > 0, y = M && t < O - 1, x = (e) => W(e, { name: a }), S = {
2081
2418
  id: n,
2082
2419
  index: t,
2083
2420
  total: O,
@@ -2086,54 +2423,89 @@ function X({ items: e, accessors: t, title: o, description: s, primaryId: c, onP
2086
2423
  canMovePrevious: v,
2087
2424
  canMoveNext: y,
2088
2425
  setPrimary: () => {
2089
- re && u?.(n, e);
2426
+ A && d?.(n, e);
2090
2427
  },
2091
2428
  remove: () => {
2092
- ie && d?.(n, e);
2429
+ j && f?.(n, e);
2093
2430
  },
2094
2431
  movePrevious: () => N(t, t - 1),
2095
2432
  moveNext: () => N(t, t + 1)
2096
- });
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"),
2099
- "data-primary": p || void 0,
2100
- children: [
2101
- c ? /* @__PURE__ */ L("img", {
2102
- src: c,
2103
- alt: f,
2104
- loading: "lazy",
2105
- className: "size-full object-cover"
2106
- }) : /* @__PURE__ */ L("div", {
2107
- className: "flex size-full items-center justify-center bg-muted text-muted-foreground",
2108
- children: /* @__PURE__ */ L(B, { className: p ? "size-7" : "size-icon-lg" })
2109
- }),
2110
- p && /* @__PURE__ */ L(T, {
2111
- tone: "secondary",
2112
- className: "absolute left-2 top-2 bg-background shadow-xs",
2113
- children: E.gallery.cover
2114
- }),
2115
- s === "video" && !!g && /* @__PURE__ */ R(T, {
2116
- tone: "secondary",
2117
- className: "absolute bottom-2 left-2 bg-foreground text-background",
2118
- children: [/* @__PURE__ */ L(V, { className: "size-icon-sm fill-current" }), g]
2119
- }),
2120
- m && /* @__PURE__ */ L("span", {
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",
2122
- children: /* @__PURE__ */ L(_e, { className: "size-icon-sm" })
2123
- }),
2124
- ie && /* @__PURE__ */ L(i, {
2125
- type: "button",
2126
- tone: "secondary",
2127
- buttonStyle: "solid",
2128
- size: "sm",
2129
- iconOnly: !0,
2130
- className: "absolute right-2 top-2 opacity-0 shadow-sm transition-opacity group-hover/gallery:opacity-100 group-focus-within/gallery:opacity-100",
2131
- "aria-label": E.gallery.remove,
2132
- onClick: () => d?.(n, e),
2133
- children: /* @__PURE__ */ L(we, { className: "size-icon-md" })
2134
- })
2135
- ]
2136
- }, n) : h === "list" ? /* @__PURE__ */ R(l, {
2433
+ }, te = ee?.(e, S);
2434
+ if (te) return /* @__PURE__ */ V("div", { children: te }, n);
2435
+ if (g === "field") {
2436
+ let t = [
2437
+ {
2438
+ id: "cover",
2439
+ label: E.gallery.setCoverAction ?? U.gallery.setCoverAction,
2440
+ visible: A,
2441
+ disabled: p,
2442
+ onClick: S.setPrimary
2443
+ },
2444
+ {
2445
+ id: "previous",
2446
+ label: E.gallery.movePreviousAction ?? U.gallery.movePreviousAction,
2447
+ visible: M,
2448
+ disabled: !v,
2449
+ onClick: S.movePrevious
2450
+ },
2451
+ {
2452
+ id: "next",
2453
+ label: E.gallery.moveNextAction ?? U.gallery.moveNextAction,
2454
+ visible: M,
2455
+ disabled: !y,
2456
+ onClick: S.moveNext
2457
+ }
2458
+ ];
2459
+ return /* @__PURE__ */ H("div", {
2460
+ 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 ${C.tileHover}`, p && "col-span-2 row-span-2 min-h-52"),
2461
+ "data-primary": p || void 0,
2462
+ children: [
2463
+ c ? /* @__PURE__ */ V("img", {
2464
+ src: c,
2465
+ alt: u,
2466
+ loading: "lazy",
2467
+ className: "size-full object-cover"
2468
+ }) : /* @__PURE__ */ V("div", {
2469
+ className: "flex size-full items-center justify-center bg-muted text-muted-foreground",
2470
+ children: /* @__PURE__ */ V(ye, { className: p ? "size-7" : "size-icon-lg" })
2471
+ }),
2472
+ p && /* @__PURE__ */ V(k, {
2473
+ tone: "secondary",
2474
+ className: "absolute left-2 top-2 bg-background shadow-xs",
2475
+ children: E.gallery.cover
2476
+ }),
2477
+ o === "video" && !!h && /* @__PURE__ */ H(k, {
2478
+ tone: "secondary",
2479
+ className: "absolute bottom-2 left-2 bg-foreground text-background",
2480
+ children: [/* @__PURE__ */ V(De, { className: "size-icon-sm fill-current" }), h]
2481
+ }),
2482
+ m && /* @__PURE__ */ V("span", {
2483
+ 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",
2484
+ children: /* @__PURE__ */ V(Ee, { className: "size-icon-sm" })
2485
+ }),
2486
+ ae && /* @__PURE__ */ H("div", {
2487
+ className: "media-resource-gallery--tile-actions absolute right-2 top-2 flex items-center gap-space-xs opacity-0 transition-opacity group-hover/gallery:opacity-100 group-focus-within/gallery:opacity-100 has-[[aria-expanded=true]]:opacity-100 pointer-coarse:opacity-100",
2488
+ children: [(A || M) && /* @__PURE__ */ V(b, {
2489
+ srText: x(E.gallery.itemActions ?? U.gallery.itemActions ?? ""),
2490
+ actions: t,
2491
+ context: "commands",
2492
+ buttonProps: { size: "sm" }
2493
+ }), j && /* @__PURE__ */ V(s, {
2494
+ type: "button",
2495
+ tone: "secondary",
2496
+ buttonStyle: "solid",
2497
+ size: "sm",
2498
+ iconOnly: !0,
2499
+ className: "shadow-sm",
2500
+ "aria-label": x(E.gallery.remove),
2501
+ onClick: () => f?.(n, e),
2502
+ children: /* @__PURE__ */ V(Pe, { className: "size-icon-md" })
2503
+ })]
2504
+ })
2505
+ ]
2506
+ }, n);
2507
+ }
2508
+ return g === "list" ? /* @__PURE__ */ H(l, {
2137
2509
  direction: "horizontal",
2138
2510
  wrap: !0,
2139
2511
  align: "center",
@@ -2141,42 +2513,42 @@ function X({ items: e, accessors: t, title: o, description: s, primaryId: c, onP
2141
2513
  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"),
2142
2514
  "data-primary": p || void 0,
2143
2515
  children: [
2144
- /* @__PURE__ */ L("div", {
2516
+ /* @__PURE__ */ V("div", {
2145
2517
  className: "relative size-12 shrink-0 overflow-hidden rounded-radius bg-muted",
2146
- children: c ? /* @__PURE__ */ L("img", {
2518
+ children: c ? /* @__PURE__ */ V("img", {
2147
2519
  src: c,
2148
- alt: f,
2520
+ alt: u,
2149
2521
  loading: "lazy",
2150
2522
  className: "size-full object-cover"
2151
- }) : /* @__PURE__ */ L("div", {
2523
+ }) : /* @__PURE__ */ V("div", {
2152
2524
  className: "flex size-full items-center justify-center text-muted-foreground",
2153
- children: /* @__PURE__ */ L(B, { className: "size-icon" })
2525
+ children: /* @__PURE__ */ V(ye, { className: "size-icon" })
2154
2526
  })
2155
2527
  }),
2156
- /* @__PURE__ */ R("div", {
2528
+ /* @__PURE__ */ H("div", {
2157
2529
  className: "min-w-0 flex-1",
2158
- children: [/* @__PURE__ */ R(l, {
2530
+ children: [/* @__PURE__ */ H(l, {
2159
2531
  direction: "horizontal",
2160
2532
  wrap: !0,
2161
2533
  align: "center",
2162
2534
  gap: "md",
2163
2535
  className: "min-w-0",
2164
- children: [/* @__PURE__ */ L(a, {
2536
+ children: [/* @__PURE__ */ V(i, {
2165
2537
  tag: "div",
2166
2538
  weight: "semibold",
2167
2539
  className: "min-w-0 break-all",
2168
- children: o
2169
- }), p && /* @__PURE__ */ L(T, {
2540
+ children: a
2541
+ }), p && /* @__PURE__ */ V(k, {
2170
2542
  tone: "secondary",
2171
2543
  children: E.gallery.primary
2172
2544
  })]
2173
- }), /* @__PURE__ */ R(a, {
2545
+ }), /* @__PURE__ */ H(i, {
2174
2546
  size: "xs",
2175
2547
  type: "secondary",
2176
- children: [U(E.gallery.itemPosition, {
2548
+ children: [W(E.gallery.itemPosition, {
2177
2549
  index: t + 1,
2178
2550
  total: O
2179
- }), D.getSize(e) !== void 0 && /* @__PURE__ */ R(ce, { children: [" · ", /* @__PURE__ */ L(S, {
2551
+ }), D.getSize(e) !== void 0 && /* @__PURE__ */ H(he, { children: [" · ", /* @__PURE__ */ V(w, {
2180
2552
  value: D.getSize(e),
2181
2553
  size: "xs",
2182
2554
  align: "left",
@@ -2184,157 +2556,157 @@ function X({ items: e, accessors: t, title: o, description: s, primaryId: c, onP
2184
2556
  })] })]
2185
2557
  })]
2186
2558
  }),
2187
- M && /* @__PURE__ */ R("div", {
2559
+ ae && /* @__PURE__ */ H("div", {
2188
2560
  className: "media-resource-gallery--item-actions flex basis-full flex-wrap items-center justify-end gap-space-xs @sm/media-resource-gallery:basis-auto",
2189
2561
  children: [
2190
- re && /* @__PURE__ */ L(i, {
2562
+ A && /* @__PURE__ */ V(s, {
2191
2563
  type: "button",
2192
2564
  tone: "secondary",
2193
2565
  buttonStyle: "ghost",
2194
2566
  size: "sm",
2195
2567
  iconOnly: !0,
2196
2568
  disabled: p,
2197
- "aria-label": E.gallery.setPrimary,
2198
- onClick: () => u?.(n, e),
2199
- children: /* @__PURE__ */ L(be, { className: "size-icon-md" })
2569
+ "aria-label": x(E.gallery.setPrimary),
2570
+ onClick: () => d?.(n, e),
2571
+ children: /* @__PURE__ */ V(Ae, { className: "size-icon-md" })
2200
2572
  }),
2201
- j && /* @__PURE__ */ L(i, {
2573
+ M && /* @__PURE__ */ V(s, {
2202
2574
  type: "button",
2203
2575
  tone: "secondary",
2204
2576
  buttonStyle: "ghost",
2205
2577
  size: "sm",
2206
2578
  iconOnly: !0,
2207
2579
  disabled: !v,
2208
- "aria-label": E.gallery.movePrevious,
2580
+ "aria-label": x(E.gallery.movePrevious),
2209
2581
  onClick: () => N(t, t - 1),
2210
- children: /* @__PURE__ */ L(le, { className: "size-icon-md" })
2582
+ children: /* @__PURE__ */ V(ge, { className: "size-icon-md" })
2211
2583
  }),
2212
- j && /* @__PURE__ */ L(i, {
2584
+ M && /* @__PURE__ */ V(s, {
2213
2585
  type: "button",
2214
2586
  tone: "secondary",
2215
2587
  buttonStyle: "ghost",
2216
2588
  size: "sm",
2217
2589
  iconOnly: !0,
2218
2590
  disabled: !y,
2219
- "aria-label": E.gallery.moveNext,
2591
+ "aria-label": x(E.gallery.moveNext),
2220
2592
  onClick: () => N(t, t + 1),
2221
- children: /* @__PURE__ */ L(z, { className: "size-icon-md" })
2593
+ children: /* @__PURE__ */ V(_e, { className: "size-icon-md" })
2222
2594
  }),
2223
- ie && /* @__PURE__ */ L(i, {
2595
+ j && /* @__PURE__ */ V(s, {
2224
2596
  type: "button",
2225
2597
  tone: "destructive",
2226
2598
  buttonStyle: "ghost",
2227
2599
  size: "sm",
2228
2600
  iconOnly: !0,
2229
- "aria-label": E.gallery.remove,
2230
- onClick: () => d?.(n, e),
2231
- children: /* @__PURE__ */ L(xe, { className: "size-icon-md" })
2601
+ "aria-label": x(E.gallery.remove),
2602
+ onClick: () => f?.(n, e),
2603
+ children: /* @__PURE__ */ V(je, { className: "size-icon-md" })
2232
2604
  })
2233
2605
  ]
2234
2606
  })
2235
2607
  ]
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}`,
2608
+ }, n) : /* @__PURE__ */ H("div", {
2609
+ className: `media-resource-gallery--item group/gallery overflow-hidden rounded-radius border border-border bg-background text-foreground shadow-xs transition-colors ${C.tileHover}`,
2238
2610
  "data-primary": p || void 0,
2239
- children: [/* @__PURE__ */ R("div", {
2611
+ children: [/* @__PURE__ */ H("div", {
2240
2612
  className: "relative aspect-[4/3] bg-muted",
2241
- children: [c ? /* @__PURE__ */ L("img", {
2613
+ children: [c ? /* @__PURE__ */ V("img", {
2242
2614
  src: c,
2243
- alt: f,
2615
+ alt: u,
2244
2616
  loading: "lazy",
2245
2617
  className: "size-full object-contain"
2246
- }) : /* @__PURE__ */ L("div", {
2618
+ }) : /* @__PURE__ */ V("div", {
2247
2619
  className: "flex size-full items-center justify-center text-muted-foreground",
2248
- children: /* @__PURE__ */ L(B, { className: "size-6" })
2249
- }), /* @__PURE__ */ R("div", {
2620
+ children: /* @__PURE__ */ V(ye, { className: "size-6" })
2621
+ }), /* @__PURE__ */ H("div", {
2250
2622
  className: "absolute left-2 top-2 flex flex-wrap gap-space-xs",
2251
- children: [p && /* @__PURE__ */ L(T, {
2623
+ children: [p && /* @__PURE__ */ V(k, {
2252
2624
  tone: "secondary",
2253
2625
  className: "bg-card text-card-foreground",
2254
2626
  children: E.gallery.primary
2255
- }), /* @__PURE__ */ L(T, {
2627
+ }), /* @__PURE__ */ V(k, {
2256
2628
  tone: "secondary",
2257
2629
  className: "bg-card text-card-foreground",
2258
- children: U(E.gallery.itemPosition, {
2630
+ children: W(E.gallery.itemPosition, {
2259
2631
  index: t + 1,
2260
2632
  total: O
2261
2633
  })
2262
2634
  })]
2263
2635
  })]
2264
- }), /* @__PURE__ */ L("div", {
2636
+ }), /* @__PURE__ */ V("div", {
2265
2637
  className: r("media-resource-gallery--item-body", _ === "compact" ? "p-surface-xs" : "p-surface"),
2266
- children: /* @__PURE__ */ R(l, {
2638
+ children: /* @__PURE__ */ H(l, {
2267
2639
  gap: "md",
2268
- children: [/* @__PURE__ */ R("div", {
2640
+ children: [/* @__PURE__ */ H("div", {
2269
2641
  className: "min-w-0",
2270
- children: [/* @__PURE__ */ L(a, {
2642
+ children: [/* @__PURE__ */ V(i, {
2271
2643
  tag: "div",
2272
2644
  weight: "semibold",
2273
2645
  className: "truncate",
2274
- children: o
2275
- }), D.getSize(e) !== void 0 && /* @__PURE__ */ L(S, {
2646
+ children: a
2647
+ }), D.getSize(e) !== void 0 && /* @__PURE__ */ V(w, {
2276
2648
  value: D.getSize(e),
2277
2649
  size: "xs",
2278
2650
  align: "left",
2279
2651
  emptyLabel: E.unknownSize
2280
2652
  })]
2281
- }), M && /* @__PURE__ */ R("div", {
2653
+ }), ae && /* @__PURE__ */ H("div", {
2282
2654
  className: "flex items-center gap-space-xs",
2283
2655
  children: [
2284
- re && /* @__PURE__ */ L(i, {
2656
+ A && /* @__PURE__ */ V(s, {
2285
2657
  type: "button",
2286
2658
  tone: "secondary",
2287
2659
  buttonStyle: "ghost",
2288
2660
  size: "sm",
2289
2661
  iconOnly: !0,
2290
2662
  disabled: p,
2291
- "aria-label": E.gallery.setPrimary,
2292
- onClick: () => u?.(n, e),
2293
- children: /* @__PURE__ */ L(be, { className: "size-icon-md" })
2663
+ "aria-label": x(E.gallery.setPrimary),
2664
+ onClick: () => d?.(n, e),
2665
+ children: /* @__PURE__ */ V(Ae, { className: "size-icon-md" })
2294
2666
  }),
2295
- j && /* @__PURE__ */ L(i, {
2667
+ M && /* @__PURE__ */ V(s, {
2296
2668
  type: "button",
2297
2669
  tone: "secondary",
2298
2670
  buttonStyle: "ghost",
2299
2671
  size: "sm",
2300
2672
  iconOnly: !0,
2301
2673
  disabled: !v,
2302
- "aria-label": E.gallery.movePrevious,
2674
+ "aria-label": x(E.gallery.movePrevious),
2303
2675
  onClick: () => N(t, t - 1),
2304
- children: /* @__PURE__ */ L(le, { className: "size-icon-md" })
2676
+ children: /* @__PURE__ */ V(ge, { className: "size-icon-md" })
2305
2677
  }),
2306
- j && /* @__PURE__ */ L(i, {
2678
+ M && /* @__PURE__ */ V(s, {
2307
2679
  type: "button",
2308
2680
  tone: "secondary",
2309
2681
  buttonStyle: "ghost",
2310
2682
  size: "sm",
2311
2683
  iconOnly: !0,
2312
2684
  disabled: !y,
2313
- "aria-label": E.gallery.moveNext,
2685
+ "aria-label": x(E.gallery.moveNext),
2314
2686
  onClick: () => N(t, t + 1),
2315
- children: /* @__PURE__ */ L(z, { className: "size-icon-md" })
2687
+ children: /* @__PURE__ */ V(_e, { className: "size-icon-md" })
2316
2688
  }),
2317
- ie && /* @__PURE__ */ L(i, {
2689
+ j && /* @__PURE__ */ V(s, {
2318
2690
  type: "button",
2319
2691
  tone: "destructive",
2320
2692
  buttonStyle: "ghost",
2321
2693
  size: "sm",
2322
2694
  iconOnly: !0,
2323
2695
  className: "ml-auto",
2324
- "aria-label": E.gallery.remove,
2325
- onClick: () => d?.(n, e),
2326
- children: /* @__PURE__ */ L(xe, { className: "size-icon-md" })
2696
+ "aria-label": x(E.gallery.remove),
2697
+ onClick: () => f?.(n, e),
2698
+ children: /* @__PURE__ */ V(je, { className: "size-icon-md" })
2327
2699
  })
2328
2700
  ]
2329
2701
  })]
2330
2702
  })
2331
2703
  })]
2332
2704
  }, n);
2333
- }), P()]
2705
+ }), le()]
2334
2706
  })]
2335
2707
  });
2336
2708
  }
2337
2709
  //#endregion
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 };
2710
+ export { Et as MediaLibrary, mt as MediaLibraryCard, vt as MediaLibraryDetailPanel, Q as MediaLibraryDialog, ft as MediaLibraryEmptyState, St as MediaLibraryFooter, ht as MediaLibraryList, pt as MediaLibraryToolbar, yt as MediaLibraryUploadPanel, Ot as MediaResourceGallery, U as defaultMediaLibraryStrings, qe as formatMediaLibrarySize, W as formatMediaLibraryString, Je as getMediaLibraryDimensions, Ke as resolveMediaLibraryAccessors, at as useMediaLibrary };
2339
2711
 
2340
2712
  //# sourceMappingURL=media-library.js.map