themelia-react-ui 2.0.4 → 2.0.5

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 (588) hide show
  1. package/CHANGELOG.md +135 -0
  2. package/README.md +113 -18
  3. package/dist/{accordion-96o0pN62.js → accordion-B9MHG0cT.js} +11 -11
  4. package/dist/accordion-B9MHG0cT.js.map +1 -0
  5. package/dist/{action-menu-CHgs8vmj.js → action-menu-Dr8K-ghE.js} +48 -45
  6. package/dist/action-menu-Dr8K-ghE.js.map +1 -0
  7. package/dist/{affordance-geometry.generated-B8yGOr8-.js → affordance-geometry.generated-P-aVJisu.js} +36 -36
  8. package/dist/affordance-geometry.generated-P-aVJisu.js.map +1 -0
  9. package/dist/{ai-artifact-BZUGwBq6.js → ai-artifact-C58tQcBy.js} +210 -174
  10. package/dist/ai-artifact-C58tQcBy.js.map +1 -0
  11. package/dist/app-shell-B_IuNWOo.js +321 -0
  12. package/dist/app-shell-B_IuNWOo.js.map +1 -0
  13. package/dist/{attachment-DkoqHPPl.js → attachment-Dg_69lPS.js} +9 -9
  14. package/dist/{attachment-DkoqHPPl.js.map → attachment-Dg_69lPS.js.map} +1 -1
  15. package/dist/{auth-D2FVZ1MH.js → auth-DTkkshS8.js} +43 -46
  16. package/dist/auth-DTkkshS8.js.map +1 -0
  17. package/dist/{avatar-DWO_HHhB.js → avatar-CeZaFmNH.js} +8 -8
  18. package/dist/avatar-CeZaFmNH.js.map +1 -0
  19. package/dist/{badge-DErMA7ul.js → badge-xIiV_E7f.js} +5 -5
  20. package/dist/{badge-DErMA7ul.js.map → badge-xIiV_E7f.js.map} +1 -1
  21. package/dist/base/accordion.js +1 -1
  22. package/dist/base/action-menu.js +1 -1
  23. package/dist/base/attachment.js +1 -1
  24. package/dist/base/avatar.js +1 -1
  25. package/dist/base/badge.js +1 -1
  26. package/dist/base/batch-action-bar.js +1 -1
  27. package/dist/base/buttons.js +1 -1
  28. package/dist/base/cards.js +2 -2
  29. package/dist/base/carousel.js +3 -3
  30. package/dist/base/cascader.js +2 -372
  31. package/dist/base/chart.js +1 -1
  32. package/dist/base/choice-inputs.js +2 -2
  33. package/dist/base/code-block.js +1 -1
  34. package/dist/base/combobox.js +2 -2
  35. package/dist/base/command.js +1 -1
  36. package/dist/base/copyable.js +1 -1
  37. package/dist/base/date-pickers.js +2 -2
  38. package/dist/base/display.js +6 -6
  39. package/dist/base/feedback.js +3 -3
  40. package/dist/base/forms-numeric.js +1 -1
  41. package/dist/base/forms.js +2 -2
  42. package/dist/base/inline-edit.js +10 -10
  43. package/dist/base/item.js +1 -1
  44. package/dist/base/media-gallery.js +1 -1
  45. package/dist/base/metadata-list.js +1 -1
  46. package/dist/base/navigation.js +7 -7
  47. package/dist/base/popover-menu.js +1 -1
  48. package/dist/base/popover.js +1 -1
  49. package/dist/base/qr-code.js +1 -1
  50. package/dist/base/repeaters.js +12 -12
  51. package/dist/base/repeaters.js.map +1 -1
  52. package/dist/base/sheet.js +1 -1
  53. package/dist/base/sidebar.js +2 -2
  54. package/dist/base/signature-pad.js +7 -7
  55. package/dist/base/signature-pad.js.map +1 -1
  56. package/dist/base/skeleton.js +1 -1
  57. package/dist/base/spinner.js +4 -4
  58. package/dist/base/structure.js +1 -1
  59. package/dist/base/table.js +1 -1
  60. package/dist/base/text-inputs.js +2 -2
  61. package/dist/base/toaster.js +36 -36
  62. package/dist/base/toaster.js.map +1 -1
  63. package/dist/base/tree.js +1 -1
  64. package/dist/base/upload-queue.js +1 -1
  65. package/dist/base/upload.js +3 -3
  66. package/dist/base/value-inputs.js +1 -1
  67. package/dist/{batch-action-bar-CdfIkCsV.js → batch-action-bar-Cb8cuvyy.js} +6 -6
  68. package/dist/batch-action-bar-Cb8cuvyy.js.map +1 -0
  69. package/dist/blocks/admin.js +21 -21
  70. package/dist/blocks/admin.js.map +1 -1
  71. package/dist/blocks/ai.js +230 -216
  72. package/dist/blocks/ai.js.map +1 -1
  73. package/dist/blocks/analytics/usage-card.js +1 -1
  74. package/dist/blocks/analytics.js +325 -306
  75. package/dist/blocks/analytics.js.map +1 -1
  76. package/dist/blocks/collaboration.js +1 -1
  77. package/dist/blocks/commerce/receipt.js +1 -1
  78. package/dist/blocks/commerce.js +1259 -1184
  79. package/dist/blocks/commerce.js.map +1 -1
  80. package/dist/blocks/data-display.js +2 -2
  81. package/dist/blocks/onboarding.js +6 -6
  82. package/dist/blocks/onboarding.js.map +1 -1
  83. package/dist/blocks/planning.js +11 -11
  84. package/dist/blocks/timelines.js +1 -1
  85. package/dist/{breadcrumbs-B-WFKecD.js → breadcrumbs-J-K2kl4c.js} +6 -6
  86. package/dist/{breadcrumbs-B-WFKecD.js.map → breadcrumbs-J-K2kl4c.js.map} +1 -1
  87. package/dist/{button-DkmK-z8E.js → button-S2Cubiiz.js} +3 -3
  88. package/dist/button-S2Cubiiz.js.map +1 -0
  89. package/dist/{buttons-BbfzgczK.js → buttons-BedGfygC.js} +16 -16
  90. package/dist/buttons-BedGfygC.js.map +1 -0
  91. package/dist/cards-rNX1M4Xn.js +69 -0
  92. package/dist/cards-rNX1M4Xn.js.map +1 -0
  93. package/dist/cascader-B1MiqkBq.js +439 -0
  94. package/dist/cascader-B1MiqkBq.js.map +1 -0
  95. package/dist/chart-Darg_0Kv.js +162 -0
  96. package/dist/chart-Darg_0Kv.js.map +1 -0
  97. package/dist/{checkbox-CzYUTPeJ.js → checkbox-fflqmODR.js} +2 -2
  98. package/dist/{checkbox-CzYUTPeJ.js.map → checkbox-fflqmODR.js.map} +1 -1
  99. package/dist/{choice-inputs-JLtij2y4.js → choice-inputs-zUgBZfE4.js} +258 -257
  100. package/dist/choice-inputs-zUgBZfE4.js.map +1 -0
  101. package/dist/{code-block-CGNaUtAE.js → code-block-BzmM9Eig.js} +8 -8
  102. package/dist/code-block-BzmM9Eig.js.map +1 -0
  103. package/dist/{collapsible-Do4G0zcC.js → collapsible-BkAI_XD4.js} +5 -5
  104. package/dist/{collapsible-Do4G0zcC.js.map → collapsible-BkAI_XD4.js.map} +1 -1
  105. package/dist/{collection-content-C0e8SsTm.js → collection-content-gDh1v6O4.js} +3 -3
  106. package/dist/{collection-content-C0e8SsTm.js.map → collection-content-gDh1v6O4.js.map} +1 -1
  107. package/dist/combobox-BEx0vJgF.js +362 -0
  108. package/dist/combobox-BEx0vJgF.js.map +1 -0
  109. package/dist/{combobox-CBJDs6w_.js → combobox-BwzoXFSG.js} +254 -247
  110. package/dist/combobox-BwzoXFSG.js.map +1 -0
  111. package/dist/{command-D8NrBj-b.js → command-CrlPIL6m.js} +11 -11
  112. package/dist/command-CrlPIL6m.js.map +1 -0
  113. package/dist/{comments-Di4w0H_S.js → comments-Dmpp0YIc.js} +29 -29
  114. package/dist/{comments-Di4w0H_S.js.map → comments-Dmpp0YIc.js.map} +1 -1
  115. package/dist/components/base/action-menu/action-menu.d.ts +7 -1
  116. package/dist/components/base/buttons/button-group.recipes.d.ts +2 -2
  117. package/dist/components/base/cards/card.recipes.d.ts +6 -4
  118. package/dist/components/base/cards/partials/card-primitives.d.ts +9 -2
  119. package/dist/components/base/cards/partials/smart-card-header-row.d.ts +3 -1
  120. package/dist/components/base/cards/smart-card.types.d.ts +3 -4
  121. package/dist/components/base/cascader/cascader-panel.d.ts +76 -0
  122. package/dist/components/base/chart/chart.d.ts +6 -1
  123. package/dist/components/base/choice-inputs/choice-types.d.ts +1 -1
  124. package/dist/components/base/combobox/index.d.ts +4 -2
  125. package/dist/components/base/feedback/alert.d.ts +1 -1
  126. package/dist/components/base/forms/form-sizing.d.ts +7 -7
  127. package/dist/components/base/forms/workflow.d.ts +7 -1
  128. package/dist/components/base/forms-numeric/coordinates-input.d.ts +4 -0
  129. package/dist/components/base/metadata-list/metadata-list.d.ts +1 -1
  130. package/dist/components/base/navigation/dropdown-menu.d.ts +1 -1
  131. package/dist/components/base/navigation/page-header/page-header-commands.d.ts +14 -7
  132. package/dist/components/base/navigation/page-header/page-header.d.ts +10 -3
  133. package/dist/components/base/popover/popover.d.ts +3 -3
  134. package/dist/components/base/popover/popover.recipes.d.ts +10 -6
  135. package/dist/components/base/sheet/sheet.d.ts +2 -0
  136. package/dist/components/base/sidebar/index.d.ts +1 -1
  137. package/dist/components/base/sidebar/sidebar.d.ts +27 -5
  138. package/dist/components/base/toaster/index.d.ts +1 -0
  139. package/dist/components/blocks/ai/ai-file-tree/types.d.ts +1 -1
  140. package/dist/components/blocks/ai/ai-tool-call/types.d.ts +3 -1
  141. package/dist/components/blocks/ai/ai.strings.d.ts +2 -0
  142. package/dist/components/blocks/analytics/metric-comparison/metric-comparison.d.ts +2 -0
  143. package/dist/components/blocks/analytics/usage-card/usage-card.strings.d.ts +2 -0
  144. package/dist/components/blocks/commerce/cart-summary/cart-summary.d.ts +1 -1
  145. package/dist/components/blocks/commerce/cart-summary/types.d.ts +3 -1
  146. package/dist/components/blocks/commerce/discount-stack/discount-stack.d.ts +1 -1
  147. package/dist/components/blocks/commerce/discount-stack/types.d.ts +3 -1
  148. package/dist/components/blocks/commerce/fulfillment-group/fulfillment-group.d.ts +1 -1
  149. package/dist/components/blocks/commerce/fulfillment-group/types.d.ts +11 -2
  150. package/dist/components/blocks/commerce/index.d.ts +7 -6
  151. package/dist/components/blocks/commerce/inventory-section/inventory-section.d.ts +1 -1
  152. package/dist/components/blocks/commerce/inventory-section/types.d.ts +7 -2
  153. package/dist/components/blocks/commerce/invoice-header/index.d.ts +2 -1
  154. package/dist/components/blocks/commerce/invoice-header/invoice-header.d.ts +1 -1
  155. package/dist/components/blocks/commerce/invoice-header/types.d.ts +20 -6
  156. package/dist/components/blocks/commerce/invoice-line-items/invoice-line-items.d.ts +1 -1
  157. package/dist/components/blocks/commerce/invoice-line-items/types.d.ts +24 -7
  158. package/dist/components/blocks/commerce/invoice-mini/index.d.ts +2 -1
  159. package/dist/components/blocks/commerce/invoice-mini/types.d.ts +7 -1
  160. package/dist/components/blocks/commerce/order-customer/order-customer.d.ts +1 -1
  161. package/dist/components/blocks/commerce/order-customer/types.d.ts +9 -1
  162. package/dist/components/blocks/commerce/refund-status/refund-status.d.ts +1 -1
  163. package/dist/components/blocks/commerce/refund-status/types.d.ts +3 -1
  164. package/dist/components/blocks/commerce/shipment-tracking/shipment-tracking.d.ts +1 -1
  165. package/dist/components/blocks/commerce/shipment-tracking/types.d.ts +3 -1
  166. package/dist/components/blocks/commerce/tax-breakdown/tax-breakdown.d.ts +1 -1
  167. package/dist/components/blocks/commerce/tax-breakdown/types.d.ts +3 -1
  168. package/dist/components/features/activities/activities.types.d.ts +8 -2
  169. package/dist/components/features/activities/partials/activity-marker.d.ts +7 -3
  170. package/dist/components/features/activities/partials/activity-row.d.ts +24 -0
  171. package/dist/components/features/event-calendar/colors.d.ts +2 -2
  172. package/dist/components/features/event-calendar/event-calendar.types.d.ts +4 -0
  173. package/dist/components/features/filters/facets/select-facet.d.ts +2 -1
  174. package/dist/components/features/filters/filters.strings.d.ts +4 -0
  175. package/dist/components/features/filters/filters.types.d.ts +3 -0
  176. package/dist/components/features/filters/partials/filter-editor-header.d.ts +16 -0
  177. package/dist/components/features/filters/partials/filter-popover-content.d.ts +1 -1
  178. package/dist/components/features/filters/partials/nested-filter-options.d.ts +21 -0
  179. package/dist/components/features/filters/partials/regular-filter-content.d.ts +2 -1
  180. package/dist/components/features/filters/utils/filter-utils.d.ts +21 -3
  181. package/dist/components/features/global-search/global-search.types.d.ts +2 -0
  182. package/dist/components/features/global-search/partials/global-search-input.d.ts +10 -0
  183. package/dist/components/features/global-search/partials/global-search-result-row.d.ts +7 -1
  184. package/dist/components/features/media-library/media-library.strings.d.ts +2 -0
  185. package/dist/components/features/media-library/media-library.types.d.ts +14 -4
  186. package/dist/components/features/media-library/partials/media-library-partials.d.ts +1 -1
  187. package/dist/components/features/products/components/product-options-matrix.d.ts +1 -1
  188. package/dist/components/features/products/components/product-variant-editor.d.ts +1 -1
  189. package/dist/components/features/products/components/product-variants-manager.d.ts +1 -1
  190. package/dist/components/features/products/products.strings.d.ts +9 -1
  191. package/dist/components/features/products/products.types.d.ts +43 -6
  192. package/dist/components/features/resource/resource.d.ts +5 -1
  193. package/dist/components/features/resource/resource.types.d.ts +12 -1
  194. package/dist/components/features/rich-text-editor/partials/image-uploads.d.ts +1 -1
  195. package/dist/components/features/rich-text-editor/rich-text-editor.recipes.d.ts +12 -2
  196. package/dist/components/features/table/partials/resource-cell.d.ts +22 -5
  197. package/dist/components/features/table/table.types.d.ts +1 -1
  198. package/dist/components/layout/app-shell/app-shell.types.d.ts +35 -6
  199. package/dist/components/layout/app-shell/index.d.ts +1 -1
  200. package/dist/components/layout/app-shell/shell-regions.d.ts +27 -0
  201. package/dist/components/layout/app-shell/sidebar-inset-layout.d.ts +1 -1
  202. package/dist/components/layout/app-shell/stacked-layout.d.ts +1 -1
  203. package/dist/components/layout/app-shell/topbar-sidebar-layout.d.ts +1 -1
  204. package/dist/components/layout/containers/two-column-layout.d.ts +2 -0
  205. package/dist/components/layout/header/header.recipes.d.ts +6 -0
  206. package/dist/components/layout/header/header.types.d.ts +6 -6
  207. package/dist/components/layout/navigation/section-nav/section-nav.d.ts +5 -0
  208. package/dist/components/layout/page/index.d.ts +2 -1
  209. package/dist/components/layout/page/page.d.ts +1 -0
  210. package/dist/components/layout/page/page.strings.d.ts +11 -0
  211. package/dist/components/layout/page/page.types.d.ts +69 -17
  212. package/dist/components/layout/page/partials/page-header.d.ts +1 -1
  213. package/dist/components/layout/settings/settings.d.ts +9 -2
  214. package/dist/components/layout/sidebar/app-sidebar.d.ts +1 -1
  215. package/dist/components/layout/sidebar/components/sidebar-grouped-navigation.d.ts +1 -1
  216. package/dist/components/layout/sidebar/components/sidebar-navigation.d.ts +1 -1
  217. package/dist/components/layout/sidebar/index.d.ts +2 -1
  218. package/dist/components/layout/sidebar/sidebar-navigation-rail.d.ts +36 -0
  219. package/dist/components/layout/sidebar/sidebar.context.d.ts +5 -7
  220. package/dist/components/layout/sidebar/sidebar.types.d.ts +48 -10
  221. package/dist/components/layout/sidebar/sidebar.utils.d.ts +9 -1
  222. package/dist/components/layout/workspace/workspace.types.d.ts +8 -1
  223. package/dist/components/ui/alert-dialog.d.ts +2 -2
  224. package/dist/components/ui/combobox.d.ts +1 -1
  225. package/dist/components/ui/dialog.d.ts +2 -2
  226. package/dist/components/ui/overlay-layer.d.ts +18 -0
  227. package/dist/components/ui/sheet.d.ts +5 -1
  228. package/dist/components/ui/sidebar-state.d.ts +82 -0
  229. package/dist/components/ui/sidebar.d.ts +5 -17
  230. package/dist/{containers-CRmHf7GP.js → containers-CIxwbZt5.js} +26 -18
  231. package/dist/containers-CIxwbZt5.js.map +1 -0
  232. package/dist/{control-group-recipes-DBXmfh2E.js → control-group-recipes-fMuFo0H7.js} +6 -6
  233. package/dist/control-group-recipes-fMuFo0H7.js.map +1 -0
  234. package/dist/{copyable-CnGCZdX4.js → copyable-DIznBqiT.js} +7 -7
  235. package/dist/{copyable-CnGCZdX4.js.map → copyable-DIznBqiT.js.map} +1 -1
  236. package/dist/{data-display-D4oujtx0.js → data-display-BdgCAw8T.js} +268 -277
  237. package/dist/data-display-BdgCAw8T.js.map +1 -0
  238. package/dist/{date-Q7jnXxpk.js → date-Cq8ioE4o.js} +5 -5
  239. package/dist/{date-Q7jnXxpk.js.map → date-Cq8ioE4o.js.map} +1 -1
  240. package/dist/{date-picker-zOt1oNss.js → date-picker-RlIzKom_.js} +446 -437
  241. package/dist/date-picker-RlIzKom_.js.map +1 -0
  242. package/dist/{date-pickers-cj8IXbDC.js → date-pickers-DY-CpXS1.js} +12 -12
  243. package/dist/{date-pickers-cj8IXbDC.js.map → date-pickers-DY-CpXS1.js.map} +1 -1
  244. package/dist/{display-BB4BL_-K.js → display-KsZLw9Ov.js} +9 -9
  245. package/dist/{display-BB4BL_-K.js.map → display-KsZLw9Ov.js.map} +1 -1
  246. package/dist/dropdown-menu-CLs8Lihj.js +194 -0
  247. package/dist/dropdown-menu-CLs8Lihj.js.map +1 -0
  248. package/dist/features/activities.js +302 -253
  249. package/dist/features/activities.js.map +1 -1
  250. package/dist/features/ai-chat.js +15 -14
  251. package/dist/features/ai-chat.js.map +1 -1
  252. package/dist/features/appointment-calendar.js +22 -22
  253. package/dist/features/appointment-calendar.js.map +1 -1
  254. package/dist/features/async-preview.js +11 -10
  255. package/dist/features/async-preview.js.map +1 -1
  256. package/dist/features/combobox.js +1 -1
  257. package/dist/features/comments.js +1 -1
  258. package/dist/features/data-view.js +13 -13
  259. package/dist/features/data-view.js.map +1 -1
  260. package/dist/features/email-composer.js +237 -238
  261. package/dist/features/email-composer.js.map +1 -1
  262. package/dist/features/event-calendar.js +140 -146
  263. package/dist/features/event-calendar.js.map +1 -1
  264. package/dist/features/filters.js +1 -1
  265. package/dist/features/global-search.js +167 -138
  266. package/dist/features/global-search.js.map +1 -1
  267. package/dist/features/kanban.js +6 -7
  268. package/dist/features/kanban.js.map +1 -1
  269. package/dist/features/map.js +269 -260
  270. package/dist/features/map.js.map +1 -1
  271. package/dist/features/media-library.js +375 -326
  272. package/dist/features/media-library.js.map +1 -1
  273. package/dist/features/mentions.js +1 -1
  274. package/dist/features/overlays.js +1 -1
  275. package/dist/features/products.js +1266 -1193
  276. package/dist/features/products.js.map +1 -1
  277. package/dist/features/questionnaire.js +13 -13
  278. package/dist/features/questionnaire.js.map +1 -1
  279. package/dist/features/resource-assignment.js +8 -8
  280. package/dist/features/resource.js +69 -66
  281. package/dist/features/resource.js.map +1 -1
  282. package/dist/features/rich-text-editor.js +2 -2
  283. package/dist/features/schema-form.js +13 -13
  284. package/dist/features/suggestions.js +3 -3
  285. package/dist/features/sync.js +3 -3
  286. package/dist/features/table.js +1 -1
  287. package/dist/features/theme-tweaker.js +94 -95
  288. package/dist/features/theme-tweaker.js.map +1 -1
  289. package/dist/{feedback-DZNL5Lg1.js → feedback-Dm4izqFn.js} +80 -79
  290. package/dist/feedback-Dm4izqFn.js.map +1 -0
  291. package/dist/{field-affordance-recipes-DjwGx8eM.js → field-affordance-recipes-DWcNcOjh.js} +4 -4
  292. package/dist/field-affordance-recipes-DWcNcOjh.js.map +1 -0
  293. package/dist/{filters-BcT-uoFy.js → filters-DzgSJpMK.js} +693 -645
  294. package/dist/filters-DzgSJpMK.js.map +1 -0
  295. package/dist/{form-field-CsgRmdit.js → form-field-BriWAXyg.js} +6 -6
  296. package/dist/{form-field-CsgRmdit.js.map → form-field-BriWAXyg.js.map} +1 -1
  297. package/dist/{form-sizing-NXgjkmBG.js → form-sizing-Bs2qFUeE.js} +4 -4
  298. package/dist/form-sizing-Bs2qFUeE.js.map +1 -0
  299. package/dist/{forms-BV5m5aQF.js → forms-C0RGnJTe.js} +17 -13
  300. package/dist/forms-C0RGnJTe.js.map +1 -0
  301. package/dist/{forms-numeric-Cd33AKbD.js → forms-numeric-DIhghX1Q.js} +86 -82
  302. package/dist/forms-numeric-DIhghX1Q.js.map +1 -0
  303. package/dist/{header-BA697l4a.js → header-DMMxG__r.js} +67 -63
  304. package/dist/header-DMMxG__r.js.map +1 -0
  305. package/dist/header.recipes-BigdJjw1.js +6 -0
  306. package/dist/header.recipes-BigdJjw1.js.map +1 -0
  307. package/dist/{hooks-BQ-L7Uu2.js → hooks-DB6CJ4MR.js} +26 -14
  308. package/dist/hooks-DB6CJ4MR.js.map +1 -0
  309. package/dist/{icon-badge-COWbCCWu.js → icon-badge-DZF-YjQp.js} +4 -4
  310. package/dist/{icon-badge-COWbCCWu.js.map → icon-badge-DZF-YjQp.js.map} +1 -1
  311. package/dist/index.js +4 -5
  312. package/dist/{input-Cdw4k0fb.js → input-CvyDQlY7.js} +8 -8
  313. package/dist/{input-Cdw4k0fb.js.map → input-CvyDQlY7.js.map} +1 -1
  314. package/dist/input-DMBwAZmr.js +21 -0
  315. package/dist/input-DMBwAZmr.js.map +1 -0
  316. package/dist/{item-BvZ2DR_x.js → item-DjCcM18E.js} +16 -16
  317. package/dist/item-DjCcM18E.js.map +1 -0
  318. package/dist/layout/app-shell.js +1 -1
  319. package/dist/layout/auth.js +1 -1
  320. package/dist/layout/containers.js +1 -1
  321. package/dist/layout/header.js +1 -1
  322. package/dist/layout/hooks.js +1 -1
  323. package/dist/layout/navigation.js +1 -1
  324. package/dist/layout/page.js +2 -2
  325. package/dist/layout/settings.js +1 -1
  326. package/dist/layout/sidebar.js +3 -3
  327. package/dist/layout/workspace.js +1 -1
  328. package/dist/layout.js +11 -11
  329. package/dist/lib/affordance-geometry.generated.d.ts +35 -35
  330. package/dist/lib/control-group-recipes.d.ts +5 -5
  331. package/dist/lib/field-affordance-recipes.d.ts +2 -2
  332. package/dist/lib/motion-recipes.d.ts +3 -0
  333. package/dist/lib/navigation-row-recipes.d.ts +7 -7
  334. package/dist/lib/overlay-anatomy-recipes.d.ts +3 -3
  335. package/dist/lib/portal-recipes.d.ts +3 -0
  336. package/dist/lib/token-merge.generated.d.ts +13 -10
  337. package/dist/lib/utils.js +1 -1
  338. package/dist/map-demo-tile.svg +1 -1
  339. package/dist/{media-gallery-CSl5W1Fy.js → media-gallery-C-vChPmE.js} +6 -6
  340. package/dist/{media-gallery-CSl5W1Fy.js.map → media-gallery-C-vChPmE.js.map} +1 -1
  341. package/dist/{mentions-RKOQaaIB.js → mentions-0_4nWuI-.js} +10 -10
  342. package/dist/{mentions-RKOQaaIB.js.map → mentions-0_4nWuI-.js.map} +1 -1
  343. package/dist/{message-INU2xsxu.js → message-g8p7eVtN.js} +7 -7
  344. package/dist/message-g8p7eVtN.js.map +1 -0
  345. package/dist/{metadata-list-qVV7AVxa.js → metadata-list-C3MkU-Om.js} +64 -64
  346. package/dist/metadata-list-C3MkU-Om.js.map +1 -0
  347. package/dist/{motion-recipes-ChBg4HBq.js → motion-recipes-DitYv6P2.js} +10 -2
  348. package/dist/motion-recipes-DitYv6P2.js.map +1 -0
  349. package/dist/navigation-C90-oQFq.js +255 -0
  350. package/dist/navigation-C90-oQFq.js.map +1 -0
  351. package/dist/{navigation-BQNcg1jT.js → navigation-DaRjthVk.js} +101 -82
  352. package/dist/navigation-DaRjthVk.js.map +1 -0
  353. package/dist/{navigation-row-recipes-WZEs-hYo.js → navigation-row-recipes-BGVLvU_O.js} +9 -9
  354. package/dist/navigation-row-recipes-BGVLvU_O.js.map +1 -0
  355. package/dist/{number-E_OiIfJz.js → number-CRU3kGuk.js} +5 -5
  356. package/dist/{number-E_OiIfJz.js.map → number-CRU3kGuk.js.map} +1 -1
  357. package/dist/overflow-tab-bar-IVFVQFV6.js +172 -0
  358. package/dist/overflow-tab-bar-IVFVQFV6.js.map +1 -0
  359. package/dist/overlays-BSgCtM2v.js +1013 -0
  360. package/dist/overlays-BSgCtM2v.js.map +1 -0
  361. package/dist/page-DUUKDAjo.js +331 -0
  362. package/dist/page-DUUKDAjo.js.map +1 -0
  363. package/dist/page-header-commands-7P3sfE9u.js +193 -0
  364. package/dist/page-header-commands-7P3sfE9u.js.map +1 -0
  365. package/dist/{pagination-Ch8X_47u.js → pagination-CgCjElfu.js} +7 -7
  366. package/dist/{pagination-Ch8X_47u.js.map → pagination-CgCjElfu.js.map} +1 -1
  367. package/dist/popover-B85RenIl.js +201 -0
  368. package/dist/popover-B85RenIl.js.map +1 -0
  369. package/dist/{popover-menu-BYaCdFhf.js → popover-menu-DlnQ2zlR.js} +7 -7
  370. package/dist/{popover-menu-BYaCdFhf.js.map → popover-menu-DlnQ2zlR.js.map} +1 -1
  371. package/dist/{popover.recipes-D3j8R8Yp.js → popover.recipes-DdiEp0rd.js} +18 -11
  372. package/dist/popover.recipes-DdiEp0rd.js.map +1 -0
  373. package/dist/portal-recipes-BpsV_iRw.js +9 -0
  374. package/dist/portal-recipes-BpsV_iRw.js.map +1 -0
  375. package/dist/{primitives-Du64iDbb.js → primitives-ByWgGUgt.js} +5 -5
  376. package/dist/{primitives-Du64iDbb.js.map → primitives-ByWgGUgt.js.map} +1 -1
  377. package/dist/primitives.js +4 -4
  378. package/dist/{progress-BvF2oCdV.js → progress-BJhQP9WX.js} +9 -9
  379. package/dist/{progress-BvF2oCdV.js.map → progress-BJhQP9WX.js.map} +1 -1
  380. package/dist/{receipt-D789Jwyy.js → receipt-tOc7B3hw.js} +7 -7
  381. package/dist/receipt-tOc7B3hw.js.map +1 -0
  382. package/dist/{rich-text-CLJEf76s.js → rich-text-Dth5E882.js} +3 -3
  383. package/dist/{rich-text-CLJEf76s.js.map → rich-text-Dth5E882.js.map} +1 -1
  384. package/dist/{rich-text-editor-Cm1dpUpQ.js → rich-text-editor-C1fOjBTd.js} +429 -430
  385. package/dist/rich-text-editor-C1fOjBTd.js.map +1 -0
  386. package/dist/{rich-text-editor-toolbar-L__e4x47.js → rich-text-editor-toolbar-laT3tpBT.js} +32 -28
  387. package/dist/rich-text-editor-toolbar-laT3tpBT.js.map +1 -0
  388. package/dist/{scroll-area-La5RXsEk.js → scroll-area-B0dB2cBi.js} +2 -2
  389. package/dist/{scroll-area-La5RXsEk.js.map → scroll-area-B0dB2cBi.js.map} +1 -1
  390. package/dist/{separator-DAEV0w65.js → separator-Bb17I4pu.js} +2 -2
  391. package/dist/{separator-DAEV0w65.js.map → separator-Bb17I4pu.js.map} +1 -1
  392. package/dist/{separator-GNfPG-90.js → separator-Ct_WSWTJ.js} +3 -3
  393. package/dist/{separator-GNfPG-90.js.map → separator-Ct_WSWTJ.js.map} +1 -1
  394. package/dist/services/actions.js +1 -1
  395. package/dist/{settings-BA2iboic.js → settings-Bar5wiSo.js} +31 -38
  396. package/dist/settings-Bar5wiSo.js.map +1 -0
  397. package/dist/sheet-BGPERY55.js +250 -0
  398. package/dist/sheet-BGPERY55.js.map +1 -0
  399. package/dist/sidebar-D-JYMMbY.js +686 -0
  400. package/dist/sidebar-D-JYMMbY.js.map +1 -0
  401. package/dist/sidebar-f9gRWXIR.js +1001 -0
  402. package/dist/sidebar-f9gRWXIR.js.map +1 -0
  403. package/dist/skeleton-BapcJd9C.js +265 -0
  404. package/dist/skeleton-BapcJd9C.js.map +1 -0
  405. package/dist/smart-card-CW0hjetE.js +617 -0
  406. package/dist/smart-card-CW0hjetE.js.map +1 -0
  407. package/dist/{structure-C0V0_Fyf.js → structure-DuxKl954.js} +2 -2
  408. package/dist/{structure-C0V0_Fyf.js.map → structure-DuxKl954.js.map} +1 -1
  409. package/dist/style.css +1 -1
  410. package/dist/{table-CpvnzJn9.js → table-B4TE7iOV.js} +3 -3
  411. package/dist/{table-CpvnzJn9.js.map → table-B4TE7iOV.js.map} +1 -1
  412. package/dist/{table-DH7rozUv.js → table-CFOWY9pQ.js} +394 -388
  413. package/dist/table-CFOWY9pQ.js.map +1 -0
  414. package/dist/{tabs-eqVsJZWO.js → tabs-e7ko9S2o.js} +11 -11
  415. package/dist/tabs-e7ko9S2o.js.map +1 -0
  416. package/dist/{text-inputs-DXItiR0O.js → text-inputs-B1culiSK.js} +17 -17
  417. package/dist/text-inputs-B1culiSK.js.map +1 -0
  418. package/dist/theme.css +40 -37
  419. package/dist/{timelines-DmtztAY_.js → timelines-D3Sl9ueq.js} +13 -12
  420. package/dist/timelines-D3Sl9ueq.js.map +1 -0
  421. package/dist/tooltip-8wz5S_Zr.js +113 -0
  422. package/dist/tooltip-8wz5S_Zr.js.map +1 -0
  423. package/dist/{tree-CV11PURP.js → tree-CzUJHnFs.js} +8 -8
  424. package/dist/{tree-CV11PURP.js.map → tree-CzUJHnFs.js.map} +1 -1
  425. package/dist/typography/rich-text.js +1 -1
  426. package/dist/{typography-CSyJrh28.js → typography-BQnine1k.js} +12 -12
  427. package/dist/{typography-CSyJrh28.js.map → typography-BQnine1k.js.map} +1 -1
  428. package/dist/typography.js +1 -1
  429. package/dist/ui-provider-C-74NVLc.js +178 -0
  430. package/dist/ui-provider-C-74NVLc.js.map +1 -0
  431. package/dist/ui-provider.js +2 -3
  432. package/dist/{upload-C9SA0X-8.js → upload-BOW6U2tI.js} +25 -24
  433. package/dist/upload-BOW6U2tI.js.map +1 -0
  434. package/dist/{upload-queue-DhQJiSRc.js → upload-queue-qUXn1ykN.js} +16 -14
  435. package/dist/upload-queue-qUXn1ykN.js.map +1 -0
  436. package/dist/{usage-card-DVTRDmGz.js → usage-card-BeSLY0i0.js} +24 -17
  437. package/dist/usage-card-BeSLY0i0.js.map +1 -0
  438. package/dist/{utils-CF3c95Io.js → utils-B6kKb8jB.js} +237 -141
  439. package/dist/utils-B6kKb8jB.js.map +1 -0
  440. package/dist/value-inputs-skdVB2zh.js +980 -0
  441. package/dist/value-inputs-skdVB2zh.js.map +1 -0
  442. package/dist/{value-typography-ClupF0Gz.js → value-typography-uAmWUAL1.js} +2 -2
  443. package/dist/{value-typography-ClupF0Gz.js.map → value-typography-uAmWUAL1.js.map} +1 -1
  444. package/dist/{workspace-9EFVXUyk.js → workspace-DHeHv0qw.js} +50 -49
  445. package/dist/workspace-DHeHv0qw.js.map +1 -0
  446. package/docs/consumer-skill/SKILL.md +4 -3
  447. package/docs/consumer-skill/agents/themelia-ui-designer.md +96 -0
  448. package/docs/consumer-skill/examples/app-layout.tsx +52 -1
  449. package/docs/consumer-skill/examples/commerce-lines.tsx +271 -0
  450. package/docs/consumer-skill/examples/custom-composition.tsx +21 -0
  451. package/docs/consumer-skill/examples/detail.tsx +5 -4
  452. package/docs/consumer-skill/examples/editable-sections.tsx +38 -0
  453. package/docs/consumer-skill/examples/index-table.tsx +4 -4
  454. package/docs/consumer-skill/examples/manifest.json +38 -1
  455. package/docs/consumer-skill/examples/product-media.tsx +41 -0
  456. package/docs/consumer-skill/examples/product-parts.tsx +81 -0
  457. package/docs/consumer-skill/examples/rhf-edit-page.tsx +1 -1
  458. package/docs/consumer-skill/examples/rhf-overlay-form.tsx +24 -11
  459. package/docs/consumer-skill/examples/token-domain-structure.tsx +68 -0
  460. package/docs/consumer-skill/references/agents-md.md +19 -17
  461. package/docs/consumer-skill/references/analytics.md +18 -1
  462. package/docs/consumer-skill/references/commerce-composition.md +97 -0
  463. package/docs/consumer-skill/references/component-contracts.json +7131 -1754
  464. package/docs/consumer-skill/references/composition-mapping.md +17 -3
  465. package/docs/consumer-skill/references/composition.md +159 -31
  466. package/docs/consumer-skill/references/critique-rubric.md +98 -0
  467. package/docs/consumer-skill/references/custom-composition.md +261 -0
  468. package/docs/consumer-skill/references/data-reading.md +79 -0
  469. package/docs/consumer-skill/references/design-contract.md +11 -9
  470. package/docs/consumer-skill/references/discovery.md +27 -3
  471. package/docs/consumer-skill/references/domain-structures.md +124 -0
  472. package/docs/consumer-skill/references/installation.md +15 -4
  473. package/docs/consumer-skill/references/integration.md +35 -0
  474. package/docs/consumer-skill/references/product-composition.md +94 -0
  475. package/docs/consumer-skill/references/public-api.json +2881 -420
  476. package/docs/consumer-skill/references/review.md +39 -2
  477. package/docs/consumer-skill/references/rhf-workflows.md +7 -0
  478. package/docs/consumer-skill/references/screen-archetypes.md +19 -7
  479. package/docs/consumer-skill/references/screen-decisions.md +126 -0
  480. package/docs/consumer-skill/references/theming.md +17 -18
  481. package/docs/consumer-skill/references/tokens.json +9 -9
  482. package/docs/consumer-skill/references/view-craft.md +153 -0
  483. package/docs/consumer-skill/references/view-spec.md +73 -0
  484. package/docs/consumer-skill/references/workflows.md +7 -1
  485. package/docs/consumer-skill/scripts/composition-policy.mjs +39 -3
  486. package/docs/consumer-skill/scripts/composition-schema.mjs +1 -1
  487. package/docs/consumer-skill/scripts/composition.mjs +61 -5
  488. package/docs/consumer-skill/scripts/discovery.mjs +54 -0
  489. package/docs/consumer-skill/scripts/inspect-component.mjs +1 -1
  490. package/docs/consumer-skill/scripts/inspection.mjs +73 -18
  491. package/docs/consumer-skill/scripts/setup-skills.mjs +41 -6
  492. package/docs/consumer-skill/scripts/surface-policy.mjs +5 -5
  493. package/docs/consumer-skills/themelia-components/SKILL.md +14 -13
  494. package/docs/consumer-skills/themelia-composition/SKILL.md +16 -17
  495. package/docs/consumer-skills/themelia-design/SKILL.md +55 -0
  496. package/docs/consumer-skills/themelia-foundation/SKILL.md +2 -1
  497. package/docs/consumer-skills/themelia-tokenization/SKILL.md +24 -17
  498. package/package.json +1 -1
  499. package/dist/accordion-96o0pN62.js.map +0 -1
  500. package/dist/action-menu-CHgs8vmj.js.map +0 -1
  501. package/dist/affordance-geometry.generated-B8yGOr8-.js.map +0 -1
  502. package/dist/ai-artifact-BZUGwBq6.js.map +0 -1
  503. package/dist/app-shell-D63ATkIK.js +0 -237
  504. package/dist/app-shell-D63ATkIK.js.map +0 -1
  505. package/dist/auth-D2FVZ1MH.js.map +0 -1
  506. package/dist/avatar-DWO_HHhB.js.map +0 -1
  507. package/dist/base/cascader.js.map +0 -1
  508. package/dist/batch-action-bar-CdfIkCsV.js.map +0 -1
  509. package/dist/button-DkmK-z8E.js.map +0 -1
  510. package/dist/buttons-BbfzgczK.js.map +0 -1
  511. package/dist/cards-4JTWqvVe.js +0 -68
  512. package/dist/cards-4JTWqvVe.js.map +0 -1
  513. package/dist/chart-C19flDQb.js +0 -155
  514. package/dist/chart-C19flDQb.js.map +0 -1
  515. package/dist/choice-inputs-JLtij2y4.js.map +0 -1
  516. package/dist/code-block-CGNaUtAE.js.map +0 -1
  517. package/dist/combobox-CBJDs6w_.js.map +0 -1
  518. package/dist/combobox-hbhSS18O.js +0 -355
  519. package/dist/combobox-hbhSS18O.js.map +0 -1
  520. package/dist/command-D8NrBj-b.js.map +0 -1
  521. package/dist/containers-CRmHf7GP.js.map +0 -1
  522. package/dist/control-group-recipes-DBXmfh2E.js.map +0 -1
  523. package/dist/data-display-D4oujtx0.js.map +0 -1
  524. package/dist/date-picker-zOt1oNss.js.map +0 -1
  525. package/dist/dropdown-menu-CjY8Vt7W.js +0 -193
  526. package/dist/dropdown-menu-CjY8Vt7W.js.map +0 -1
  527. package/dist/feedback-DZNL5Lg1.js.map +0 -1
  528. package/dist/field-affordance-recipes-DjwGx8eM.js.map +0 -1
  529. package/dist/filters-BcT-uoFy.js.map +0 -1
  530. package/dist/form-sizing-NXgjkmBG.js.map +0 -1
  531. package/dist/forms-BV5m5aQF.js.map +0 -1
  532. package/dist/forms-numeric-Cd33AKbD.js.map +0 -1
  533. package/dist/header-BA697l4a.js.map +0 -1
  534. package/dist/hooks-BQ-L7Uu2.js.map +0 -1
  535. package/dist/input-DOPL5_QE.js +0 -21
  536. package/dist/input-DOPL5_QE.js.map +0 -1
  537. package/dist/item-BvZ2DR_x.js.map +0 -1
  538. package/dist/message-INU2xsxu.js.map +0 -1
  539. package/dist/metadata-list-qVV7AVxa.js.map +0 -1
  540. package/dist/motion-recipes-ChBg4HBq.js.map +0 -1
  541. package/dist/navigation-BQNcg1jT.js.map +0 -1
  542. package/dist/navigation-DLF3E1IC.js +0 -145
  543. package/dist/navigation-DLF3E1IC.js.map +0 -1
  544. package/dist/navigation-row-recipes-WZEs-hYo.js.map +0 -1
  545. package/dist/overflow-tab-bar-CrbqMteP.js +0 -284
  546. package/dist/overflow-tab-bar-CrbqMteP.js.map +0 -1
  547. package/dist/overlays-BlKynmde.js +0 -1004
  548. package/dist/overlays-BlKynmde.js.map +0 -1
  549. package/dist/page-CIwNUtGr.js +0 -227
  550. package/dist/page-CIwNUtGr.js.map +0 -1
  551. package/dist/page-header-commands-DFMlNYzN.js +0 -128
  552. package/dist/page-header-commands-DFMlNYzN.js.map +0 -1
  553. package/dist/popover-uwzX2vo7.js +0 -198
  554. package/dist/popover-uwzX2vo7.js.map +0 -1
  555. package/dist/popover.recipes-D3j8R8Yp.js.map +0 -1
  556. package/dist/receipt-D789Jwyy.js.map +0 -1
  557. package/dist/rich-text-editor-Cm1dpUpQ.js.map +0 -1
  558. package/dist/rich-text-editor-toolbar-L__e4x47.js.map +0 -1
  559. package/dist/settings-BA2iboic.js.map +0 -1
  560. package/dist/sheet-DoAxTb2J.js +0 -213
  561. package/dist/sheet-DoAxTb2J.js.map +0 -1
  562. package/dist/sidebar-ByqKR_W5.js +0 -512
  563. package/dist/sidebar-ByqKR_W5.js.map +0 -1
  564. package/dist/sidebar-D2iSnGJ7.js +0 -619
  565. package/dist/sidebar-D2iSnGJ7.js.map +0 -1
  566. package/dist/skeleton-CUj8O5Bd.js +0 -264
  567. package/dist/skeleton-CUj8O5Bd.js.map +0 -1
  568. package/dist/smart-card-CqkzQsK-.js +0 -614
  569. package/dist/smart-card-CqkzQsK-.js.map +0 -1
  570. package/dist/table-DH7rozUv.js.map +0 -1
  571. package/dist/tabs-eqVsJZWO.js.map +0 -1
  572. package/dist/text-inputs-DXItiR0O.js.map +0 -1
  573. package/dist/theme-scope-BJ6eE2xt.js +0 -50
  574. package/dist/theme-scope-BJ6eE2xt.js.map +0 -1
  575. package/dist/timelines-DmtztAY_.js.map +0 -1
  576. package/dist/tooltip-B4hjKtoV.js +0 -111
  577. package/dist/tooltip-B4hjKtoV.js.map +0 -1
  578. package/dist/ui-provider-CQCuCBcy.js +0 -136
  579. package/dist/ui-provider-CQCuCBcy.js.map +0 -1
  580. package/dist/upload-C9SA0X-8.js.map +0 -1
  581. package/dist/upload-queue-DhQJiSRc.js.map +0 -1
  582. package/dist/usage-card-DVTRDmGz.js.map +0 -1
  583. package/dist/use-mobile-vaLKwgyf.js +0 -15
  584. package/dist/use-mobile-vaLKwgyf.js.map +0 -1
  585. package/dist/utils-CF3c95Io.js.map +0 -1
  586. package/dist/value-inputs-C0o70p-U.js +0 -980
  587. package/dist/value-inputs-C0o70p-U.js.map +0 -1
  588. package/dist/workspace-9EFVXUyk.js.map +0 -1
@@ -1,40 +1,40 @@
1
1
  "use client";
2
- import { s as e, v as t } from "../ui-provider-CQCuCBcy.js";
2
+ import { S as e, d as t } from "../ui-provider-C-74NVLc.js";
3
3
  import { interpolateString as n, useStrings as r } from "../lib/strings.js";
4
- import { t as i } from "../utils-CF3c95Io.js";
5
- import { n as a } from "../buttons-BbfzgczK.js";
6
- import { c as o, o as s } from "../typography-CSyJrh28.js";
4
+ import { t as i } from "../utils-B6kKb8jB.js";
5
+ import { n as a } from "../buttons-BedGfygC.js";
6
+ import { c as o, o as s } from "../typography-BQnine1k.js";
7
7
  import { t as c } from "../focus-recipes-B653VaLq.js";
8
- import { r as l, t as u } from "../structure-C0V0_Fyf.js";
8
+ import { r as l, t as u } from "../structure-DuxKl954.js";
9
9
  import { t as d } from "../tone-recipes-BPsRAvhu.js";
10
- import { t as f } from "../smart-card-CqkzQsK-.js";
11
- import { t as p } from "../progress-BvF2oCdV.js";
12
- import { n as m, t as h } from "../composition.recipes-COdiFhxB.js";
13
- import { i as g, t as _ } from "../overlays-BlKynmde.js";
14
- import { t as v } from "../interaction-recipes-XR9ZpVYL.js";
15
- import { _ as y, g as b } from "../primitives-Du64iDbb.js";
16
- import { n as x } from "../number-E_OiIfJz.js";
17
- import { t as S } from "../badge-DErMA7ul.js";
18
- import { t as C } from "../batch-action-bar-CdfIkCsV.js";
19
- import { t as w } from "../separator-GNfPG-90.js";
20
- import { n as T } from "../field-affordance-recipes-DjwGx8eM.js";
21
- import { t as E } from "../input-Cdw4k0fb.js";
22
- import { t as D } from "../form-field-CsgRmdit.js";
23
- import { d as O } from "../text-inputs-DXItiR0O.js";
24
- import { c as ee, l as k } from "../choice-inputs-JLtij2y4.js";
25
- import { t as A } from "../checkbox-CzYUTPeJ.js";
26
- import { n as j } from "../display-BB4BL_-K.js";
27
- import { r as M, t as te } from "../control-group-recipes-DBXmfh2E.js";
28
- import { c as N, i as P, n as F, o as I, r as ne, t as re, u as ie } from "../item-BvZ2DR_x.js";
29
- import { t as ae } from "../metadata-list-qVV7AVxa.js";
30
- import { c as oe, i as L, n as se, o as ce, s as le, t as ue } from "../table-CpvnzJn9.js";
31
- import { m as R, s as de } from "../data-display-D4oujtx0.js";
32
- import { O as fe, f as pe } from "../table-DH7rozUv.js";
33
- import { Fragment as me, useCallback as z, useId as he, useMemo as B, useRef as ge, useState as _e } from "react";
34
- import { Fragment as ve, jsx as V, jsxs as H } from "react/jsx-runtime";
35
- import { ArrowLeft as U, ChevronDown as ye, Copy as be, Eye as xe, GripVertical as Se, ListFilter as Ce, Pencil as W, Plus as G, PlusCircle as we, Search as K, SlidersHorizontal as q, Trash2 as J, X as Te } from "lucide-react";
10
+ import { h as f, p, t as m, v as h } from "../smart-card-CW0hjetE.js";
11
+ import { t as g } from "../progress-BJhQP9WX.js";
12
+ import { n as _, t as v } from "../composition.recipes-COdiFhxB.js";
13
+ import { i as y, t as b } from "../overlays-BSgCtM2v.js";
14
+ import { t as x } from "../interaction-recipes-XR9ZpVYL.js";
15
+ import { _ as S, g as C } from "../primitives-ByWgGUgt.js";
16
+ import { n as w } from "../number-CRU3kGuk.js";
17
+ import { t as ee } from "../badge-xIiV_E7f.js";
18
+ import { t as T } from "../batch-action-bar-Cb8cuvyy.js";
19
+ import { t as E } from "../separator-Ct_WSWTJ.js";
20
+ import { n as D } from "../field-affordance-recipes-DWcNcOjh.js";
21
+ import { t as O } from "../input-CvyDQlY7.js";
22
+ import { t as k } from "../form-field-BriWAXyg.js";
23
+ import { d as A } from "../text-inputs-B1culiSK.js";
24
+ import { c as te, l as j } from "../choice-inputs-zUgBZfE4.js";
25
+ import { t as ne } from "../checkbox-fflqmODR.js";
26
+ import { n as M } from "../display-KsZLw9Ov.js";
27
+ import { r as re, t as ie } from "../control-group-recipes-fMuFo0H7.js";
28
+ import { c as ae, i as N, n as P, o as F, r as I, t as L, u as R } from "../item-DjCcM18E.js";
29
+ import { t as z } from "../metadata-list-C3MkU-Om.js";
30
+ import { c as B, i as oe, n as se, o as ce, s as le, t as ue } from "../table-B4TE7iOV.js";
31
+ import { m as de, s as V } from "../data-display-BdgCAw8T.js";
32
+ import { O as H, f as fe } from "../table-CFOWY9pQ.js";
33
+ import { Fragment as pe, useCallback as U, useEffect as me, useId as he, useMemo as W, useRef as ge, useState as _e } from "react";
34
+ import { Fragment as ve, jsx as G, jsxs as K } from "react/jsx-runtime";
35
+ import { ArrowLeft as ye, ChevronDown as q, Copy as be, Eye as xe, ListFilter as J, Pencil as Se, Plus as Y, PlusCircle as Ce, Search as we, SlidersHorizontal as Te, Trash2 as X, X as Ee } from "lucide-react";
36
36
  //#region src/components/features/products/products.strings.ts
37
- var Ee = {
37
+ var De = {
38
38
  title: "Readiness",
39
39
  description: "Publishing checks and operational setup.",
40
40
  scoreLabel: "Overall readiness",
@@ -46,7 +46,7 @@ var Ee = {
46
46
  emptyTitle: "No readiness checks",
47
47
  emptyDescription: "Pass readiness items from your product workflow to show progress.",
48
48
  actionLabel: "Open"
49
- }, De = {
49
+ }, Z = {
50
50
  title: "Structure",
51
51
  description: "Media, taxonomy, options, and content coverage.",
52
52
  createLabel: "Add metric",
@@ -86,7 +86,7 @@ var Ee = {
86
86
  ruleActionsLabel: "Rule actions",
87
87
  emptyTitle: "No contract summary",
88
88
  emptyDescription: "Pass metrics, terms, or rules to summarize the product contract."
89
- }, Y = {
89
+ }, je = {
90
90
  title: "Options",
91
91
  description: "Variant-driving choices and add-ons customers can select.",
92
92
  manageLabel: "Manage options",
@@ -97,12 +97,12 @@ var Ee = {
97
97
  actionsLabel: "Option actions",
98
98
  emptyTitle: "No options",
99
99
  emptyDescription: "Pass option groups to summarize configurable product choices."
100
- }, je = {
100
+ }, Q = {
101
101
  viewLabel: "Open option",
102
102
  editLabel: "Edit option",
103
103
  deleteLabel: "Delete option",
104
104
  actionsLabel: "Option actions"
105
- }, X = {
105
+ }, Me = {
106
106
  title: "Variant options",
107
107
  description: "Define option groups and values before generating sellable variants.",
108
108
  createLabel: "Add attribute",
@@ -114,11 +114,15 @@ var Ee = {
114
114
  deleteValueLabel: "Delete value",
115
115
  confirmDeleteOptionTitle: "Delete this option?",
116
116
  confirmRemoveValuesTitle: "Save and remove these values?",
117
- confirmRemoveValuesDescription: "Saving removes {count} value(s) from this option, and any variant built from them goes with it. This cannot be undone.",
117
+ confirmRemoveValuesDescription: "Saving removes {{count}} value(s) from this option, and any variant built from them goes with it. This cannot be undone.",
118
118
  confirmRemoveValuesLabel: "Save changes",
119
119
  confirmDeleteOptionDescription: "Its values are removed from the product, and any variant built from them goes with it. This cannot be undone.",
120
120
  doneLabel: "Done",
121
121
  saveLabel: "Save",
122
+ savingLabel: "Saving…",
123
+ saveErrorTitle: "Changes were not saved",
124
+ saveErrorMessage: "Your draft has been kept. Try again.",
125
+ retrySaveLabel: "Retry save",
122
126
  cancelLabel: "Cancel",
123
127
  expandOptionLabel: "Expand option",
124
128
  collapseOptionLabel: "Collapse option",
@@ -132,7 +136,7 @@ var Ee = {
132
136
  emptyTitle: "No option groups",
133
137
  emptyDescription: "Add options such as size, color, or packaging to create variant combinations.",
134
138
  noValuesLabel: "No values"
135
- }, Z = {
139
+ }, Ne = {
136
140
  title: "Quote preview",
137
141
  description: "How the product appears in a compact customer quote.",
138
142
  subtotalLabel: "Subtotal",
@@ -147,7 +151,7 @@ var Ee = {
147
151
  lineActionsLabel: "Line actions",
148
152
  emptyTitle: "No quote lines",
149
153
  emptyDescription: "Pass quote lines to preview pricing."
150
- }, Q = {
154
+ }, Pe = {
151
155
  title: "Policies",
152
156
  description: "Cancellation, booking, service, and customer-facing rules.",
153
157
  createLabel: "Add policy",
@@ -157,7 +161,7 @@ var Ee = {
157
161
  actionsLabel: "Policy actions",
158
162
  emptyTitle: "No policies",
159
163
  emptyDescription: "Pass policies to summarize customer-facing rules."
160
- }, Me = {
164
+ }, Fe = {
161
165
  title: "Variants",
162
166
  description: "Sellable combinations with price, availability, and SKU.",
163
167
  createLabel: "Add variant",
@@ -176,7 +180,7 @@ var Ee = {
176
180
  updated: "Updated",
177
181
  actions: "Actions"
178
182
  }
179
- }, Ne = {
183
+ }, $ = {
180
184
  title: "Variants",
181
185
  description: "Review generated combinations, select rows, and apply bulk operations.",
182
186
  createLabel: "Add variant",
@@ -204,7 +208,7 @@ var Ee = {
204
208
  updated: "Updated",
205
209
  actions: "Actions"
206
210
  }
207
- }, Pe = {
211
+ }, Ie = {
208
212
  title: "Variants",
209
213
  description: "Configure option groups first, then manage the generated sellable variants.",
210
214
  optionsTitle: "Variant options",
@@ -215,13 +219,13 @@ var Ee = {
215
219
  generateLabel: "Generate variants",
216
220
  createVariantLabel: "Add variant",
217
221
  actionsLabel: "Variant manager actions"
218
- }, Fe = {
222
+ }, Le = {
219
223
  viewLabel: "Open variant",
220
224
  editLabel: "Edit",
221
225
  duplicateLabel: "Duplicate",
222
226
  deleteLabel: "Delete",
223
227
  actionsLabel: "Variant actions"
224
- }, Ie = {
228
+ }, Re = {
225
229
  title: "Variant",
226
230
  description: "Sellable variant details, options, pricing, and fulfilment data.",
227
231
  backLabel: "Back",
@@ -238,7 +242,7 @@ var Ee = {
238
242
  channels: "Channels",
239
243
  updated: "Updated"
240
244
  }
241
- }, Le = {
245
+ }, ze = {
242
246
  title: "Edit variant",
243
247
  description: "Controlled form for variant identity, pricing, inventory, and option values.",
244
248
  identityTitle: "Identity",
@@ -268,14 +272,14 @@ var Ee = {
268
272
  status: "Active",
269
273
  channels: "Online store, POS"
270
274
  }
271
- }, Re = {
275
+ }, Be = {
272
276
  mainLabel: "Product overview",
273
277
  railLabel: "Product supporting information"
274
278
  };
275
279
  //#endregion
276
280
  //#region src/components/features/products/partials/product-empty-state.tsx
277
- function $({ title: e, description: t, action: n, className: r }) {
278
- return /* @__PURE__ */ V(de, {
281
+ function Ve({ title: e, description: t, action: n, className: r }) {
282
+ return /* @__PURE__ */ G(V, {
279
283
  padding: "md",
280
284
  border: !0,
281
285
  title: e,
@@ -286,34 +290,34 @@ function $({ title: e, description: t, action: n, className: r }) {
286
290
  }
287
291
  //#endregion
288
292
  //#region src/components/features/products/partials/product-tone.tsx
289
- var ze = {
293
+ var He = {
290
294
  neutral: "secondary",
291
295
  primary: "secondary",
292
296
  success: "success",
293
297
  warning: "warning",
294
298
  destructive: "destructive",
295
299
  info: "info"
296
- }, Be = {
300
+ }, Ue = {
297
301
  neutral: void 0,
298
302
  primary: void 0,
299
303
  success: "text-success",
300
304
  warning: "text-warning-accent",
301
305
  destructive: "text-destructive",
302
306
  info: "text-info"
303
- }, Ve = /* @__PURE__ */ new Set([
307
+ }, We = /* @__PURE__ */ new Set([
304
308
  "success",
305
309
  "warning",
306
310
  "destructive",
307
311
  "info"
308
312
  ]);
309
- function He(e) {
310
- return e !== void 0 && Ve.has(e);
313
+ function Ge(e) {
314
+ return e !== void 0 && We.has(e);
311
315
  }
312
- function Ue(e) {
316
+ function Ke(e) {
313
317
  return Number.isFinite(e) ? Math.min(100, Math.max(0, Math.round(e))) : 0;
314
318
  }
315
- function We({ tone: e = "neutral" }) {
316
- return /* @__PURE__ */ V("span", {
319
+ function qe({ tone: e = "neutral" }) {
320
+ return /* @__PURE__ */ G("span", {
317
321
  "aria-hidden": "true",
318
322
  className: i("product-tone-dot--component", d.marker, {
319
323
  "bg-muted-foreground": e === "neutral" || e === "primary",
@@ -326,35 +330,35 @@ function We({ tone: e = "neutral" }) {
326
330
  }
327
331
  //#endregion
328
332
  //#region src/components/features/products/partials/product-metric-tile.tsx
329
- function Ge({ metric: e }) {
333
+ function Je({ metric: e }) {
330
334
  let t = "icon" in e ? e.icon : void 0;
331
- return /* @__PURE__ */ H(u, {
335
+ return /* @__PURE__ */ K(u, {
332
336
  gap: "dense",
333
337
  className: "product-metric-tile--component min-w-0",
334
338
  children: [
335
- /* @__PURE__ */ H(u, {
339
+ /* @__PURE__ */ K(u, {
336
340
  direction: "horizontal",
337
341
  gap: "sm",
338
342
  wrap: !1,
339
343
  children: [
340
- He(e.tone) && /* @__PURE__ */ V(We, { tone: e.tone }),
341
- !!t && /* @__PURE__ */ V("span", {
344
+ Ge(e.tone) && /* @__PURE__ */ G(qe, { tone: e.tone }),
345
+ !!t && /* @__PURE__ */ G("span", {
342
346
  className: "flex shrink-0 text-muted-foreground",
343
347
  children: t
344
348
  }),
345
- /* @__PURE__ */ V(s, {
349
+ /* @__PURE__ */ G(s, {
346
350
  className: "truncate text-inherit",
347
351
  children: e.label
348
352
  })
349
353
  ]
350
354
  }),
351
- /* @__PURE__ */ V(y, {
355
+ /* @__PURE__ */ G(S, {
352
356
  type: "inherit",
353
357
  weight: "semibold",
354
358
  className: "tabular-nums",
355
359
  children: e.value
356
360
  }),
357
- !!e.description && /* @__PURE__ */ V(o, {
361
+ !!e.description && /* @__PURE__ */ G(o, {
358
362
  size: "xs",
359
363
  type: "secondary",
360
364
  lineHeight: "snug",
@@ -365,10 +369,10 @@ function Ge({ metric: e }) {
365
369
  }
366
370
  //#endregion
367
371
  //#region src/components/features/products/partials/product-actions.tsx
368
- function Ke({ item: e, actions: t, menuLabel: n, className: r }) {
369
- return t.length === 0 ? null : /* @__PURE__ */ V("div", {
372
+ function Ye({ item: e, actions: t, menuLabel: n, className: r }) {
373
+ return t.length === 0 ? null : /* @__PURE__ */ G("div", {
370
374
  className: i("product-row-actions--component flex justify-end", r),
371
- children: /* @__PURE__ */ V(fe, {
375
+ children: /* @__PURE__ */ G(H, {
372
376
  row: e,
373
377
  actions: t,
374
378
  menuLabel: n,
@@ -378,22 +382,22 @@ function Ke({ item: e, actions: t, menuLabel: n, className: r }) {
378
382
  }
379
383
  //#endregion
380
384
  //#region src/components/features/products/partials/product-rows.tsx
381
- var qe = "min-w-0 basis-48", Je = "line-clamp-none break-words overflow-visible", Ye = "ml-auto shrink-0 flex-wrap justify-end gap-space-md";
382
- function Xe({ label: e, value: t, tone: n, badge: r }) {
383
- let i = /* @__PURE__ */ V(ie, {
384
- className: Je,
385
+ var Xe = "min-w-0 basis-48", Ze = "line-clamp-none break-words overflow-visible", Qe = "ml-auto shrink-0 flex-wrap justify-end gap-space-md";
386
+ function $e({ label: e, value: t, tone: n, badge: r }) {
387
+ let i = /* @__PURE__ */ G(R, {
388
+ className: Ze,
385
389
  children: e
386
390
  });
387
- return !t && !r ? i : /* @__PURE__ */ H(u, {
391
+ return !t && !r ? i : /* @__PURE__ */ K(u, {
388
392
  direction: "horizontal",
389
393
  gap: "sm",
390
394
  className: "product-row--heading",
391
395
  children: [
392
396
  i,
393
- !!t && (He(n) ? /* @__PURE__ */ V(S, {
394
- tone: ze[n],
397
+ !!t && (Ge(n) ? /* @__PURE__ */ G(ee, {
398
+ tone: He[n],
395
399
  children: t
396
- }) : /* @__PURE__ */ V(o, {
400
+ }) : /* @__PURE__ */ G(o, {
397
401
  tag: "span",
398
402
  type: "secondary",
399
403
  lineHeight: "tight",
@@ -403,8 +407,8 @@ function Xe({ label: e, value: t, tone: n, badge: r }) {
403
407
  ]
404
408
  });
405
409
  }
406
- function Ze({ label: e, onSelect: t }) {
407
- return /* @__PURE__ */ V(a, {
410
+ function et({ label: e, onSelect: t }) {
411
+ return /* @__PURE__ */ G(a, {
408
412
  type: "button",
409
413
  tone: "secondary",
410
414
  buttonStyle: "ghost",
@@ -412,60 +416,60 @@ function Ze({ label: e, onSelect: t }) {
412
416
  children: e
413
417
  });
414
418
  }
415
- function Qe({ metric: e, actions: t }) {
416
- return /* @__PURE__ */ H(re, {
419
+ function tt({ metric: e, actions: t }) {
420
+ return /* @__PURE__ */ K(L, {
417
421
  className: "product-structure-metric-row--component product-structure-card--item",
418
422
  children: [
419
- !!e.icon && /* @__PURE__ */ V(N, {
423
+ !!e.icon && /* @__PURE__ */ G(ae, {
420
424
  variant: "icon",
421
425
  className: "text-muted-foreground",
422
426
  children: e.icon
423
427
  }),
424
- /* @__PURE__ */ H(ne, {
425
- className: qe,
426
- children: [/* @__PURE__ */ V(ie, {
427
- className: Je,
428
+ /* @__PURE__ */ K(I, {
429
+ className: Xe,
430
+ children: [/* @__PURE__ */ G(R, {
431
+ className: Ze,
428
432
  children: e.label
429
- }), !!e.description && /* @__PURE__ */ V(P, {
433
+ }), !!e.description && /* @__PURE__ */ G(N, {
430
434
  clamp: 2,
431
435
  children: e.description
432
436
  })]
433
437
  }),
434
- /* @__PURE__ */ H(F, {
438
+ /* @__PURE__ */ K(P, {
435
439
  className: "ml-auto shrink-0 gap-space-md",
436
- children: [/* @__PURE__ */ V(y, {
440
+ children: [/* @__PURE__ */ G(S, {
437
441
  type: "inherit",
438
442
  weight: "semibold",
439
- className: i("tabular-nums", e.tone && Be[e.tone]),
443
+ className: i("tabular-nums", e.tone && Ue[e.tone]),
440
444
  children: e.value
441
445
  }), t]
442
446
  })
443
447
  ]
444
448
  });
445
449
  }
446
- function $e({ item: e, actionFallback: t, onSelect: n, actions: r }) {
450
+ function nt({ item: e, actionFallback: t, onSelect: n, actions: r }) {
447
451
  let i = e.tone ?? (e.completed ? "success" : "neutral"), a = e.onSelect ?? n;
448
- return /* @__PURE__ */ H(re, {
452
+ return /* @__PURE__ */ K(L, {
449
453
  className: "product-readiness-row--component product-readiness-card--item",
450
454
  children: [
451
- /* @__PURE__ */ V(N, {
455
+ /* @__PURE__ */ G(ae, {
452
456
  className: "product-readiness-row--state h-icon-lg",
453
- children: /* @__PURE__ */ V(We, { tone: i })
457
+ children: /* @__PURE__ */ G(qe, { tone: i })
454
458
  }),
455
- /* @__PURE__ */ H(ne, {
456
- className: qe,
457
- children: [/* @__PURE__ */ V(Xe, {
459
+ /* @__PURE__ */ K(I, {
460
+ className: Xe,
461
+ children: [/* @__PURE__ */ G($e, {
458
462
  label: e.label,
459
463
  value: e.value,
460
464
  tone: e.tone
461
- }), !!e.description && /* @__PURE__ */ V(P, {
465
+ }), !!e.description && /* @__PURE__ */ G(N, {
462
466
  clamp: 2,
463
467
  children: e.description
464
468
  })]
465
469
  }),
466
- !!(a || r) && /* @__PURE__ */ H(F, {
467
- className: Ye,
468
- children: [!!a && /* @__PURE__ */ V(Ze, {
470
+ !!(a || r) && /* @__PURE__ */ K(P, {
471
+ className: Qe,
472
+ children: [!!a && /* @__PURE__ */ G(et, {
469
473
  label: e.actionLabel ?? t,
470
474
  onSelect: a
471
475
  }), r]
@@ -473,57 +477,57 @@ function $e({ item: e, actionFallback: t, onSelect: n, actions: r }) {
473
477
  ]
474
478
  });
475
479
  }
476
- function et({ item: e, actionFallback: t, onSelect: n, actions: r }) {
480
+ function rt({ item: e, actionFallback: t, onSelect: n, actions: r }) {
477
481
  let i = e.onSelect ?? n;
478
- return /* @__PURE__ */ H(re, {
482
+ return /* @__PURE__ */ K(L, {
479
483
  className: "product-operation-row--component product-operations-card--item",
480
- children: [/* @__PURE__ */ H(ne, {
481
- className: qe,
482
- children: [/* @__PURE__ */ V(Xe, {
484
+ children: [/* @__PURE__ */ K(I, {
485
+ className: Xe,
486
+ children: [/* @__PURE__ */ G($e, {
483
487
  label: e.label,
484
488
  value: e.value,
485
489
  tone: e.tone
486
- }), !!e.description && /* @__PURE__ */ V(P, {
490
+ }), !!e.description && /* @__PURE__ */ G(N, {
487
491
  clamp: 2,
488
492
  children: e.description
489
493
  })]
490
- }), !!(i || r) && /* @__PURE__ */ H(F, {
491
- className: Ye,
492
- children: [!!i && /* @__PURE__ */ V(Ze, {
494
+ }), !!(i || r) && /* @__PURE__ */ K(P, {
495
+ className: Qe,
496
+ children: [!!i && /* @__PURE__ */ G(et, {
493
497
  label: e.actionLabel ?? t,
494
498
  onSelect: i
495
499
  }), r]
496
500
  })]
497
501
  });
498
502
  }
499
- function tt({ item: e, actionLabel: t, onSelect: n, actions: r }) {
503
+ function it({ item: e, actionLabel: t, onSelect: n, actions: r }) {
500
504
  let i = "values" in e ? e.values : void 0;
501
- return /* @__PURE__ */ H(re, {
505
+ return /* @__PURE__ */ K(L, {
502
506
  className: "product-summary-row--component",
503
- children: [/* @__PURE__ */ H(ne, {
504
- className: qe,
507
+ children: [/* @__PURE__ */ K(I, {
508
+ className: Xe,
505
509
  children: [
506
- /* @__PURE__ */ V(Xe, {
510
+ /* @__PURE__ */ G($e, {
507
511
  label: e.label,
508
512
  value: e.value,
509
513
  tone: e.tone,
510
514
  badge: e.badge
511
515
  }),
512
- !!e.description && /* @__PURE__ */ V(P, {
516
+ !!e.description && /* @__PURE__ */ G(N, {
513
517
  clamp: 2,
514
518
  children: e.description
515
519
  }),
516
- !!i?.length && /* @__PURE__ */ V("div", {
520
+ !!i?.length && /* @__PURE__ */ G("div", {
517
521
  className: "mt-space-md flex flex-wrap gap-space-xs",
518
- children: i.map((e, t) => /* @__PURE__ */ V(S, {
522
+ children: i.map((e, t) => /* @__PURE__ */ G(ee, {
519
523
  tone: "secondary",
520
524
  children: e
521
525
  }, t))
522
526
  })
523
527
  ]
524
- }), !!(n || r) && /* @__PURE__ */ H(F, {
525
- className: Ye,
526
- children: [!!n && /* @__PURE__ */ V(Ze, {
528
+ }), !!(n || r) && /* @__PURE__ */ K(P, {
529
+ className: Qe,
530
+ children: [!!n && /* @__PURE__ */ G(et, {
527
531
  label: t,
528
532
  onSelect: n
529
533
  }), r]
@@ -532,26 +536,26 @@ function tt({ item: e, actionLabel: t, onSelect: n, actions: r }) {
532
536
  }
533
537
  //#endregion
534
538
  //#region src/components/features/products/components/product-contract-overview.tsx
535
- function nt({ metrics: e = [], terms: t = [], rules: n = [], onOpenContract: s, onEditContract: c, onCreateRule: d, onSelectRule: f, onEditRule: p, onDeleteRule: m, renderRuleActions: h, actions: g, footerSlot: _, empty: v, className: y, strings: b }) {
536
- let x = r(Ae, b), S = e.length > 0 || t.length > 0 || n.length > 0, C = s || c || d ? /* @__PURE__ */ H("div", {
539
+ function at({ metrics: e = [], terms: t = [], rules: n = [], onOpenContract: s, onEditContract: c, onCreateRule: d, onSelectRule: f, onEditRule: p, onDeleteRule: m, renderRuleActions: h, actions: g, footerSlot: _, empty: v, className: y, strings: b }) {
540
+ let x = r(Ae, b), S = e.length > 0 || t.length > 0 || n.length > 0, C = s || c || d ? /* @__PURE__ */ K("div", {
537
541
  className: "flex items-center gap-space-md",
538
542
  children: [
539
- !!d && /* @__PURE__ */ V(a, {
543
+ !!d && /* @__PURE__ */ G(a, {
540
544
  type: "button",
541
545
  tone: "secondary",
542
546
  buttonStyle: "ghost",
543
547
  onClick: d,
544
- icon: G,
548
+ icon: Y,
545
549
  children: x.createRuleLabel
546
550
  }),
547
- !!c && /* @__PURE__ */ V(a, {
551
+ !!c && /* @__PURE__ */ G(a, {
548
552
  type: "button",
549
553
  tone: "secondary",
550
554
  buttonStyle: "ghost",
551
555
  onClick: c,
552
556
  children: x.editLabel
553
557
  }),
554
- !!s && /* @__PURE__ */ V(a, {
558
+ !!s && /* @__PURE__ */ G(a, {
555
559
  type: "button",
556
560
  tone: "secondary",
557
561
  buttonStyle: "ghost",
@@ -560,49 +564,49 @@ function nt({ metrics: e = [], terms: t = [], rules: n = [], onOpenContract: s,
560
564
  })
561
565
  ]
562
566
  }) : void 0;
563
- return /* @__PURE__ */ V(j, {
567
+ return /* @__PURE__ */ G(M, {
564
568
  title: x.title,
565
569
  description: x.description,
566
570
  actions: g,
567
571
  headerAction: C,
568
572
  footerSlot: _,
569
573
  className: i("product-contract-overview--component w-full", y),
570
- children: S ? /* @__PURE__ */ H(u, {
574
+ children: S ? /* @__PURE__ */ K(u, {
571
575
  gap: "2xl",
572
576
  children: [
573
- e.length > 0 && /* @__PURE__ */ V(l, {
577
+ e.length > 0 && /* @__PURE__ */ G(l, {
574
578
  columns: {
575
579
  base: 1,
576
580
  sm: 3
577
581
  },
578
582
  gap: "md",
579
- children: e.map((e) => /* @__PURE__ */ V(Ge, { metric: e }, e.id))
583
+ children: e.map((e) => /* @__PURE__ */ G(Je, { metric: e }, e.id))
580
584
  }),
581
- t.length > 0 && /* @__PURE__ */ H(u, {
585
+ t.length > 0 && /* @__PURE__ */ K(u, {
582
586
  gap: "md",
583
- children: [/* @__PURE__ */ V(o, {
587
+ children: [/* @__PURE__ */ G(o, {
584
588
  type: "inherit",
585
589
  weight: "semibold",
586
590
  children: x.termsTitle
587
- }), /* @__PURE__ */ V(ae, {
591
+ }), /* @__PURE__ */ G(z, {
588
592
  adaptTo: "container",
589
593
  items: t,
590
594
  columns: 2,
591
595
  density: "compact"
592
596
  })]
593
597
  }),
594
- n.length > 0 && /* @__PURE__ */ H(u, {
598
+ n.length > 0 && /* @__PURE__ */ K(u, {
595
599
  gap: "md",
596
- children: [/* @__PURE__ */ V(o, {
600
+ children: [/* @__PURE__ */ G(o, {
597
601
  type: "inherit",
598
602
  weight: "semibold",
599
603
  children: x.rulesTitle
600
- }), /* @__PURE__ */ V(I, { children: n.map((e, t) => {
604
+ }), /* @__PURE__ */ G(F, { children: n.map((e, t) => {
601
605
  let n = f ? () => f(e) : void 0, r = p ? () => p(e) : void 0, i = m ? () => m(e) : void 0, a = [
602
606
  ...n ? [{
603
607
  id: "open",
604
608
  label: x.viewRuleLabel,
605
- icon: /* @__PURE__ */ V(xe, { className: "size-icon-md" }),
609
+ icon: /* @__PURE__ */ G(xe, { className: "size-icon-md" }),
606
610
  onClick: () => n(),
607
611
  tone: "secondary",
608
612
  buttonStyle: "ghost"
@@ -610,7 +614,7 @@ function nt({ metrics: e = [], terms: t = [], rules: n = [], onOpenContract: s,
610
614
  ...r ? [{
611
615
  id: "edit",
612
616
  label: x.editRuleLabel,
613
- icon: /* @__PURE__ */ V(W, { className: "size-icon-md" }),
617
+ icon: /* @__PURE__ */ G(Se, { className: "size-icon-md" }),
614
618
  onClick: () => r(),
615
619
  tone: "secondary",
616
620
  buttonStyle: "ghost"
@@ -618,7 +622,7 @@ function nt({ metrics: e = [], terms: t = [], rules: n = [], onOpenContract: s,
618
622
  ...i ? [{
619
623
  id: "delete",
620
624
  label: x.deleteRuleLabel,
621
- icon: /* @__PURE__ */ V(J, { className: "size-icon-md" }),
625
+ icon: /* @__PURE__ */ G(X, { className: "size-icon-md" }),
622
626
  onClick: () => i(),
623
627
  tone: "destructive"
624
628
  }] : []
@@ -627,43 +631,43 @@ function nt({ metrics: e = [], terms: t = [], rules: n = [], onOpenContract: s,
627
631
  onSelect: n,
628
632
  onEdit: r,
629
633
  onDelete: i
630
- }) : /* @__PURE__ */ V(Ke, {
634
+ }) : /* @__PURE__ */ G(Ye, {
631
635
  item: e,
632
636
  actions: a,
633
637
  menuLabel: x.ruleActionsLabel
634
638
  });
635
- return /* @__PURE__ */ V(tt, {
639
+ return /* @__PURE__ */ G(it, {
636
640
  item: e,
637
641
  actions: o
638
642
  }, e.id);
639
643
  }) })]
640
644
  })
641
645
  ]
642
- }) : v ?? /* @__PURE__ */ V($, {
646
+ }) : v ?? /* @__PURE__ */ G(Ve, {
643
647
  title: x.emptyTitle,
644
648
  description: x.emptyDescription,
645
- action: d ? /* @__PURE__ */ V(a, {
649
+ action: d ? /* @__PURE__ */ G(a, {
646
650
  tone: "primary",
647
651
  type: "button",
648
652
  onClick: d,
649
- icon: G,
653
+ icon: Y,
650
654
  children: x.createRuleLabel
651
655
  }) : void 0
652
656
  })
653
657
  });
654
658
  }
655
- nt.displayName = "ProductContractOverview";
659
+ at.displayName = "ProductContractOverview";
656
660
  //#endregion
657
661
  //#region src/components/features/products/components/product-details-card.tsx
658
- function rt({ title: e, description: t, metadata: n = [], media: o, onEditDetails: s, actions: c, headerEnd: l, footerSlot: u, empty: d, className: f, strings: p }) {
659
- let m = r(ke, p), h = s ? /* @__PURE__ */ V(a, {
662
+ function ot({ title: e, description: t, metadata: n = [], media: o, onEditDetails: s, actions: c, headerEnd: l, footerSlot: u, empty: d, className: f, strings: p }) {
663
+ let m = r(ke, p), h = s ? /* @__PURE__ */ G(a, {
660
664
  type: "button",
661
665
  tone: "secondary",
662
666
  buttonStyle: "ghost",
663
667
  onClick: s,
664
668
  children: m.editLabel
665
669
  }) : void 0;
666
- return /* @__PURE__ */ V(j, {
670
+ return /* @__PURE__ */ G(M, {
667
671
  title: e ?? m.title,
668
672
  description: t === !1 ? void 0 : t ?? m.description,
669
673
  actions: c,
@@ -671,17 +675,17 @@ function rt({ title: e, description: t, metadata: n = [], media: o, onEditDetail
671
675
  headerEnd: l,
672
676
  footerSlot: u,
673
677
  className: i("product-details-card--component w-full", f),
674
- children: n.length === 0 ? d ?? /* @__PURE__ */ V($, {
678
+ children: n.length === 0 && !o ? d ?? /* @__PURE__ */ G(Ve, {
675
679
  title: m.emptyTitle,
676
680
  description: m.emptyDescription
677
- }) : /* @__PURE__ */ V("div", {
681
+ }) : /* @__PURE__ */ G("div", {
678
682
  className: "@container/product-details",
679
- children: /* @__PURE__ */ H("div", {
680
- className: i("grid min-w-0 grid-cols-1 gap-space-xl", o && "@xl/product-details:grid-cols-[12rem_minmax(0,1fr)]"),
681
- children: [!!o && /* @__PURE__ */ V("div", {
682
- className: "product-details-card--media self-start overflow-hidden rounded-inner border border-border bg-muted/30",
683
+ children: /* @__PURE__ */ K("div", {
684
+ className: i("grid min-w-0 grid-cols-1 gap-space-xl", o && n.length > 0 && "@xl/product-details:grid-cols-[12rem_minmax(0,1fr)]"),
685
+ children: [!!o && /* @__PURE__ */ G("div", {
686
+ className: "product-details-card--media self-start overflow-hidden rounded-radius border border-border bg-muted/30",
683
687
  children: o
684
- }), /* @__PURE__ */ V(ae, {
688
+ }), n.length > 0 && /* @__PURE__ */ G(z, {
685
689
  adaptTo: "container",
686
690
  items: n,
687
691
  columns: o ? 1 : 2,
@@ -692,12 +696,12 @@ function rt({ title: e, description: t, metadata: n = [], media: o, onEditDetail
692
696
  })
693
697
  });
694
698
  }
695
- rt.displayName = "ProductDetailsCard";
699
+ ot.displayName = "ProductDetailsCard";
696
700
  //#endregion
697
701
  //#region src/components/features/products/components/product-option-action-menu.tsx
698
- function it({ option: e, index: t = 0, onSelectOption: n, onEditOption: a, onDeleteOption: o, renderOptionActions: s, menuLabel: c, className: l, strings: u }) {
699
- let d = r(je, u), f = n ? () => n(e) : void 0, p = a ? () => a(e) : void 0, m = o ? () => o(e) : void 0;
700
- return f || p || m || s ? s ? /* @__PURE__ */ V("div", {
702
+ function st({ option: e, index: t = 0, onSelectOption: n, onEditOption: a, onDeleteOption: o, renderOptionActions: s, menuLabel: c, className: l, strings: u }) {
703
+ let d = r(Q, u), f = n ? () => n(e) : void 0, p = a ? () => a(e) : void 0, m = o ? () => o(e) : void 0;
704
+ return f || p || m || s ? s ? /* @__PURE__ */ G("div", {
701
705
  className: i("product-option-action-menu--component flex justify-end", l),
702
706
  children: s(e, {
703
707
  index: t,
@@ -705,7 +709,7 @@ function it({ option: e, index: t = 0, onSelectOption: n, onEditOption: a, onDel
705
709
  onEdit: p,
706
710
  onDelete: m
707
711
  })
708
- }) : /* @__PURE__ */ V(Ke, {
712
+ }) : /* @__PURE__ */ G(Ye, {
709
713
  item: e,
710
714
  menuLabel: c ?? d.actionsLabel,
711
715
  className: i("product-option-action-menu--component", l),
@@ -713,7 +717,7 @@ function it({ option: e, index: t = 0, onSelectOption: n, onEditOption: a, onDel
713
717
  ...f ? [{
714
718
  id: "open",
715
719
  label: d.viewLabel,
716
- icon: /* @__PURE__ */ V(xe, { className: "size-icon-md" }),
720
+ icon: /* @__PURE__ */ G(xe, { className: "size-icon-md" }),
717
721
  onClick: () => f(),
718
722
  tone: "secondary",
719
723
  buttonStyle: "ghost"
@@ -721,7 +725,7 @@ function it({ option: e, index: t = 0, onSelectOption: n, onEditOption: a, onDel
721
725
  ...p ? [{
722
726
  id: "edit",
723
727
  label: d.editLabel,
724
- icon: /* @__PURE__ */ V(W, { className: "size-icon-md" }),
728
+ icon: /* @__PURE__ */ G(Se, { className: "size-icon-md" }),
725
729
  onClick: () => p(),
726
730
  tone: "secondary",
727
731
  buttonStyle: "ghost"
@@ -729,54 +733,54 @@ function it({ option: e, index: t = 0, onSelectOption: n, onEditOption: a, onDel
729
733
  ...m ? [{
730
734
  id: "delete",
731
735
  label: d.deleteLabel,
732
- icon: /* @__PURE__ */ V(J, { className: "size-icon-md" }),
736
+ icon: /* @__PURE__ */ G(X, { className: "size-icon-md" }),
733
737
  onClick: () => m(),
734
738
  tone: "destructive"
735
739
  }] : []
736
740
  ]
737
741
  }) : null;
738
742
  }
739
- it.displayName = "ProductOptionActionMenu";
743
+ st.displayName = "ProductOptionActionMenu";
740
744
  //#endregion
741
745
  //#region src/components/features/products/components/product-operations-card.tsx
742
- function at({ items: e = [], onCreateOperation: t, onSelectOperation: n, onEditOperation: o, onDeleteOperation: s, renderOperationActions: c, actions: l, footerSlot: u, renderItem: d, empty: f, className: p, strings: m }) {
743
- let h = r(Oe, m), g = t ? /* @__PURE__ */ V(a, {
746
+ function ct({ items: e = [], onCreateOperation: t, onSelectOperation: n, onEditOperation: o, onDeleteOperation: s, renderOperationActions: c, actions: l, footerSlot: u, renderItem: d, empty: f, className: p, strings: m }) {
747
+ let h = r(Oe, m), g = t ? /* @__PURE__ */ G(a, {
744
748
  type: "button",
745
749
  tone: "secondary",
746
750
  buttonStyle: "ghost",
747
751
  onClick: t,
748
- icon: G,
752
+ icon: Y,
749
753
  children: h.createLabel
750
754
  }) : void 0;
751
- return /* @__PURE__ */ V(j, {
755
+ return /* @__PURE__ */ G(M, {
752
756
  title: h.title,
753
757
  description: h.description,
754
758
  actions: l,
755
759
  headerAction: g,
756
760
  footerSlot: u,
757
761
  className: i("product-operations-card--component w-full", p),
758
- children: e.length === 0 ? f ?? /* @__PURE__ */ V($, {
762
+ children: e.length === 0 ? f ?? /* @__PURE__ */ G(Ve, {
759
763
  title: h.emptyTitle,
760
764
  description: h.emptyDescription,
761
- action: t ? /* @__PURE__ */ V(a, {
765
+ action: t ? /* @__PURE__ */ G(a, {
762
766
  tone: "primary",
763
767
  type: "button",
764
768
  onClick: t,
765
- icon: G,
769
+ icon: Y,
766
770
  children: h.createLabel
767
771
  }) : void 0
768
- }) : /* @__PURE__ */ V(I, { children: e.map((e, t) => {
772
+ }) : /* @__PURE__ */ G(F, { children: e.map((e, t) => {
769
773
  let r = n ? () => n(e) : void 0, i = o ? () => o(e) : void 0, a = s ? () => s(e) : void 0, l = [...i ? [{
770
774
  id: "edit",
771
775
  label: h.editLabel,
772
- icon: /* @__PURE__ */ V(W, { className: "size-icon-md" }),
776
+ icon: /* @__PURE__ */ G(Se, { className: "size-icon-md" }),
773
777
  onClick: () => i(),
774
778
  tone: "secondary",
775
779
  buttonStyle: "ghost"
776
780
  }] : [], ...a ? [{
777
781
  id: "delete",
778
782
  label: h.deleteLabel,
779
- icon: /* @__PURE__ */ V(J, { className: "size-icon-md" }),
783
+ icon: /* @__PURE__ */ G(X, { className: "size-icon-md" }),
780
784
  onClick: () => a(),
781
785
  tone: "destructive"
782
786
  }] : []], u = c ? c(e, {
@@ -784,12 +788,12 @@ function at({ items: e = [], onCreateOperation: t, onSelectOperation: n, onEditO
784
788
  onSelect: r,
785
789
  onEdit: i,
786
790
  onDelete: a
787
- }) : /* @__PURE__ */ V(Ke, {
791
+ }) : /* @__PURE__ */ G(Ye, {
788
792
  item: e,
789
793
  actions: l,
790
794
  menuLabel: h.actionsLabel
791
795
  });
792
- return d ? /* @__PURE__ */ V("div", { children: d(e, t) }, e.id) : /* @__PURE__ */ V(et, {
796
+ return d ? /* @__PURE__ */ G("div", { children: d(e, t) }, e.id) : /* @__PURE__ */ G(rt, {
793
797
  item: e,
794
798
  actionFallback: h.actionLabel,
795
799
  onSelect: r,
@@ -798,350 +802,381 @@ function at({ items: e = [], onCreateOperation: t, onSelectOperation: n, onEditO
798
802
  }) })
799
803
  });
800
804
  }
801
- at.displayName = "ProductOperationsCard";
805
+ ct.displayName = "ProductOperationsCard";
802
806
  //#endregion
803
807
  //#region src/components/features/products/components/product-options-matrix.tsx
804
- function ot(e) {
808
+ function lt(e) {
805
809
  return typeof e == "string" || typeof e == "number" ? String(e) : "";
806
810
  }
807
- function st(e) {
811
+ function ut(e) {
808
812
  return typeof e == "string" || typeof e == "number" || typeof e == "bigint";
809
813
  }
810
- function ct(e, t) {
811
- let n = ot(t.name);
814
+ function dt(e, t) {
815
+ let n = lt(t.name);
812
816
  return n ? `${e}: ${n}` : e;
813
817
  }
814
- function lt(e) {
818
+ function ft(e) {
815
819
  return {
816
- name: ot(e.name),
820
+ name: lt(e.name),
817
821
  values: (e.values ?? []).map((e) => ({
818
822
  ...e,
819
- label: ot(e.label)
823
+ label: lt(e.label)
820
824
  }))
821
825
  };
822
826
  }
823
- function ut({ optionGroups: e = [], surface: t = "card", collapsedOptionIds: s, defaultCollapsedOptionIds: l = [], onCollapsedOptionIdsChange: d, editingOptionId: f, defaultEditingOptionId: p, onEditingOptionIdChange: m, onCreateOption: y, onEditOption: b, onDeleteOption: x, confirmDelete: C, onAddValue: w, onDeleteValue: O, onOptionNameChange: k, onValueLabelChange: A, onDoneEditingOption: M, onSaveEditingOption: te, onCancelEditingOption: N, onToggleUsedForVariants: P, renderOptionActions: F, renderValue: I, showHeader: ne, showCollapseControls: re = !0, showInlineActions: ie = !0, showVariantToggle: ae = !0, actions: oe, headerEnd: L, footerSlot: se, empty: ce, className: le, strings: ue }) {
824
- let R = r(X, ue), de = s !== void 0, [fe, pe] = _e(l), he = de ? s : fe, ge = B(() => new Set(he), [he]), U = f !== void 0 || p !== void 0 || !!m || !!k || !!A || !!M || !!te || !!N, be = f !== void 0, [xe, Ce] = _e(p ?? null), [W, K] = _e({}), q = U ? be ? f : xe : null, Ee = e.length > 0, De = t === "embedded" && ne !== !1, Oe = Ee && !!y, ke = z((t) => {
825
- de || pe(t), d?.(t, e.filter((e) => t.includes(e.id)));
827
+ function pt({ optionGroups: e = [], surface: t = "card", collapsedOptionIds: s, defaultCollapsedOptionIds: l = [], onCollapsedOptionIdsChange: d, editingOptionId: m, defaultEditingOptionId: g, onEditingOptionIdChange: _, onCreateOption: S, onEditOption: C, onDeleteOption: w, confirmDelete: T, onAddValue: E, onDeleteValue: A, onOptionNameChange: j, onValueLabelChange: ne, onDoneEditingOption: re, onSaveEditingOption: ie, onError: ae, onCancelEditingOption: N, onToggleUsedForVariants: P, renderOptionActions: F, renderValue: I, showHeader: L, showCollapseControls: R = !0, showInlineActions: z = !0, showVariantToggle: B = !0, actions: oe, headerEnd: se, footerSlot: ce, empty: le, className: ue, strings: de }) {
828
+ let V = r(Me, de), H = s !== void 0, [fe, he] = _e(l), ye = H ? s : fe, be = W(() => new Set(ye), [ye]), xe = m !== void 0 || g !== void 0 || !!_ || !!j || !!ne || !!re || !!ie || !!N, J = m !== void 0, [Se, we] = _e(g ?? null), [Te, De] = _e({}), Z = ge(!1), Oe = ge(!0), [ke, Ae] = _e(null), [je, Q] = _e(null), Ne = ge(null), Pe = ge(null), Fe = U((e) => {
829
+ e && (e.focus(), Pe.current = null);
830
+ }, []), $ = ke !== null;
831
+ me(() => (Oe.current = !0, () => {
832
+ Oe.current = !1;
833
+ }), []);
834
+ let Ie = xe ? J ? m : Se : null, Le = e.length > 0, Re = t === "embedded" && L !== !1, ze = Le && !!S, Be = U((t) => {
835
+ H || he(t), d?.(t, e.filter((e) => t.includes(e.id)));
826
836
  }, [
827
- de,
837
+ H,
828
838
  d,
829
839
  e
830
- ]), Ae = z((e) => {
831
- let t = ge.has(e.id) ? he.filter((t) => t !== e.id) : [...he, e.id];
832
- ke(t);
833
- }, [
834
- ge,
835
- he,
836
- ke
837
- ]), Y = z((e, t) => {
838
- U && (be || Ce(e), m?.(e, t));
840
+ ]), He = U((e) => {
841
+ if (Z.current) return;
842
+ let t = be.has(e.id) ? ye.filter((t) => t !== e.id) : [...ye, e.id];
843
+ Be(t);
839
844
  }, [
840
845
  be,
841
- m,
842
- U
843
- ]), je = z((e) => {
844
- K((t) => ({
846
+ ye,
847
+ Be
848
+ ]), Ue = U((e, t) => {
849
+ xe && (J || we(e), _?.(e, t));
850
+ }, [
851
+ J,
852
+ _,
853
+ xe
854
+ ]), We = U((e) => {
855
+ Z.current || (Q(null), De((t) => ({
845
856
  ...t,
846
- [e.id]: lt(e)
847
- })), Y(e.id, e), b?.(e);
848
- }, [b, Y]), Z = z((e) => W[e.id] ?? lt(e), [W]), Q = z((e, t) => {
849
- K((n) => ({
857
+ [e.id]: ft(e)
858
+ })), Ue(e.id, e), C?.(e));
859
+ }, [C, Ue]), Ge = U((e) => Te[e.id] ?? ft(e), [Te]), Ke = U((e, t) => {
860
+ Z.current || De((n) => ({
850
861
  ...n,
851
- [e.id]: t(n[e.id] ?? lt(e))
862
+ [e.id]: t(n[e.id] ?? ft(e))
852
863
  }));
853
- }, []), Me = z((e) => {
854
- let t = Z(e);
855
- K((t) => {
864
+ }, []), qe = U((e) => {
865
+ if (Z.current) return;
866
+ let t = Ge(e);
867
+ Q(null), De((t) => {
856
868
  let { [e.id]: n, ...r } = t;
857
869
  return r;
858
- }), Y(null, e), N?.(e, t);
870
+ }), Ue(null, e), N?.(e, t);
859
871
  }, [
860
- Z,
872
+ Ge,
861
873
  N,
862
- Y
863
- ]), Ne = z((e) => {
864
- let t = Z(e), n = e.values ?? [], r = new Set(n.map((e) => e.id)), i = new Set(t.values.map((e) => e.id));
865
- te?.(e, t), k?.(e, t.name), n.forEach((n) => {
866
- let r = t.values.find((e) => e.id === n.id);
867
- r && ot(n.label) !== ot(r.label) && A?.(e, n, ot(r.label));
868
- }), t.values.forEach((t) => {
869
- r.has(t.id) || w?.(e);
870
- }), n.forEach((t) => {
871
- i.has(t.id) || O?.(e, t);
872
- }), K((t) => {
873
- let { [e.id]: n, ...r } = t;
874
- return r;
875
- }), Y(null, e), M?.(e);
874
+ Ue
875
+ ]), Je = U(async (e) => {
876
+ if (Z.current) return !1;
877
+ Z.current = !0, Ae(e.id), Q(null);
878
+ let t = Ge(e), n = e.values ?? [], r = new Set(n.map((e) => e.id)), i = new Set(t.values.map((e) => e.id));
879
+ try {
880
+ let a = ie?.(e, t);
881
+ return a && await a, Oe.current ? (j?.(e, t.name), n.forEach((n) => {
882
+ let r = t.values.find((e) => e.id === n.id);
883
+ r && lt(n.label) !== lt(r.label) && ne?.(e, n, lt(r.label));
884
+ }), t.values.forEach((t) => {
885
+ r.has(t.id) || E?.(e);
886
+ }), n.forEach((t) => {
887
+ i.has(t.id) || A?.(e, t);
888
+ }), De((t) => {
889
+ let { [e.id]: n, ...r } = t;
890
+ return r;
891
+ }), Ue(null, e), re?.(e), !0) : !1;
892
+ } catch (t) {
893
+ return Oe.current && (Q({
894
+ optionId: e.id,
895
+ message: t instanceof Error && t.message ? t.message : V.saveErrorMessage ?? Me.saveErrorMessage
896
+ }), ae?.(t)), !1;
897
+ } finally {
898
+ Z.current = !1, Oe.current && Ae(null);
899
+ }
876
900
  }, [
877
- Z,
878
- w,
879
- O,
880
- M,
881
- k,
882
- te,
901
+ Ge,
902
+ E,
883
903
  A,
884
- Y
885
- ]), Pe = g(), [Fe, Ie] = _e(null), Le = z((e) => {
886
- let t = Z(e), n = new Set(t.values.map((e) => e.id)), r = (e.values ?? []).filter((e) => !n.has(e.id)).length;
887
- if (C === !1 || r === 0) {
888
- Ne(e);
904
+ re,
905
+ j,
906
+ ie,
907
+ ae,
908
+ ne,
909
+ V.saveErrorMessage,
910
+ Ue
911
+ ]), Xe = y(), [Ze, Qe] = _e(null);
912
+ me(() => {
913
+ je && !Xe.isOpen && (Ne.current?.focus(), Ne.current?.scrollIntoView?.({ block: "nearest" }));
914
+ }, [je, Xe.isOpen]);
915
+ let $e = U((e) => {
916
+ if (Z.current) return;
917
+ let t = Ge(e), n = new Set(t.values.map((e) => e.id)), r = (e.values ?? []).filter((e) => !n.has(e.id)).length;
918
+ if (T === !1 || r === 0) {
919
+ Je(e);
889
920
  return;
890
921
  }
891
- Ie({
922
+ Qe({
892
923
  option: e,
893
924
  removed: r
894
- }), Pe.show();
925
+ }), Xe.show();
895
926
  }, [
896
- Ne,
897
- C,
898
- Z,
899
- Pe
900
- ]), Re = z((e) => {
901
- q === e.id && (K((t) => {
927
+ Je,
928
+ T,
929
+ Ge,
930
+ Xe
931
+ ]), et = U((e) => {
932
+ Z.current || (Ie === e.id && (De((t) => {
902
933
  let { [e.id]: n, ...r } = t;
903
934
  return r;
904
- }), Y(null, e)), x?.(e);
935
+ }), Ue(null, e)), w?.(e));
905
936
  }, [
906
- x,
907
- q,
908
- Y
909
- ]), ze = g(), [Be, Ve] = _e(null), He = z((e) => {
910
- if (C === !1) {
911
- Re(e);
912
- return;
937
+ w,
938
+ Ie,
939
+ Ue
940
+ ]), tt = y(), [nt, rt] = _e(null), it = U((e) => {
941
+ if (!Z.current) {
942
+ if (T === !1) {
943
+ et(e);
944
+ return;
945
+ }
946
+ rt(e), tt.show();
913
947
  }
914
- Ve(e), ze.show();
915
948
  }, [
916
- C,
917
- Re,
918
- ze
919
- ]), Ue = y ? /* @__PURE__ */ V(a, {
949
+ T,
950
+ et,
951
+ tt
952
+ ]), at = S ? /* @__PURE__ */ G(a, {
920
953
  type: "button",
921
954
  tone: "neutral",
922
- onClick: y,
923
- icon: G,
924
- children: R.createLabel
925
- }) : void 0, We = De ? /* @__PURE__ */ V("div", {
955
+ onClick: () => {
956
+ Z.current || S();
957
+ },
958
+ disabled: $,
959
+ icon: Y,
960
+ children: V.createLabel
961
+ }) : void 0, ot = Re ? /* @__PURE__ */ G("div", {
926
962
  className: "product-options-matrix--panel-header p-surface",
927
- children: /* @__PURE__ */ H(u, {
963
+ children: /* @__PURE__ */ K(u, {
928
964
  direction: "horizontal",
929
965
  gap: "md",
930
966
  justify: "between",
931
- children: [/* @__PURE__ */ V(o, {
967
+ children: [/* @__PURE__ */ G(o, {
932
968
  type: "inherit",
933
969
  weight: "semibold",
934
- children: R.title
935
- }), Ue]
970
+ children: V.title
971
+ }), at]
936
972
  })
937
- }) : null, Ge = /* @__PURE__ */ H("div", {
973
+ }) : null, st = /* @__PURE__ */ K("div", {
938
974
  className: "product-options-matrix--body min-w-0",
939
975
  children: [
940
- /* @__PURE__ */ H("div", {
941
- className: "product-options-matrix--panel overflow-hidden rounded-radius border border-border bg-background text-foreground",
942
- children: [We, Ee ? /* @__PURE__ */ H("div", {
943
- className: i("product-options-matrix--list", De && "border-t border-border/60"),
976
+ /* @__PURE__ */ K("div", {
977
+ className: "product-options-matrix--panel overflow-hidden rounded-surface border border-border bg-background text-foreground",
978
+ children: [ot, Le ? /* @__PURE__ */ K("div", {
979
+ className: i("product-options-matrix--list", Re && "border-t border-border/60"),
944
980
  children: [e.map((e, t) => {
945
- let n = e.values ?? [], r = ge.has(e.id), s = q === e.id, l = !!b || U, d = !!x, f = !!w, p = Z(e), m = F?.(e, {
981
+ let n = e.values ?? [], r = be.has(e.id), s = Ie === e.id, l = !!C || xe, d = !!w, m = !!E, g = Ge(e), _ = je?.optionId === e.id ? je : null, y = ke === e.id, b = F?.(e, {
946
982
  index: t,
947
- onEdit: l ? () => je(e) : void 0,
948
- onDelete: x ? () => He(e) : void 0,
949
- onAddValue: w ? () => w(e) : void 0,
950
- onToggleCollapsed: () => Ae(e),
983
+ onEdit: l && !$ ? () => We(e) : void 0,
984
+ onDelete: w && !$ ? () => it(e) : void 0,
985
+ onAddValue: E && !$ ? () => {
986
+ Z.current || E(e);
987
+ } : void 0,
988
+ onToggleCollapsed: () => He(e),
951
989
  collapsed: r
952
- }), g = [...f ? [{
990
+ }), S = [...m ? [{
953
991
  id: "add-value",
954
- label: R.addValueLabel,
955
- icon: /* @__PURE__ */ V(G, { className: "size-icon-md" }),
956
- onClick: () => w?.(e),
992
+ label: V.addValueLabel,
993
+ disabled: $,
994
+ icon: /* @__PURE__ */ G(Y, { className: "size-icon-md" }),
995
+ onClick: () => {
996
+ Z.current || E?.(e);
997
+ },
957
998
  tone: "secondary",
958
999
  buttonStyle: "ghost"
959
1000
  }] : [], ...d ? [{
960
1001
  id: "delete",
961
- label: R.deleteLabel,
962
- icon: /* @__PURE__ */ V(J, { className: "size-icon-md" }),
963
- onClick: () => He(e),
1002
+ label: V.deleteLabel,
1003
+ disabled: $,
1004
+ icon: /* @__PURE__ */ G(X, { className: "size-icon-md" }),
1005
+ onClick: () => it(e),
964
1006
  tone: "destructive"
965
- }] : []], _ = ie ? /* @__PURE__ */ H(ve, { children: [!!l && /* @__PURE__ */ V(a, {
1007
+ }] : []], T = z && (l || S.length > 0) ? /* @__PURE__ */ K(ve, { children: [!!l && /* @__PURE__ */ G(a, {
966
1008
  type: "button",
967
1009
  tone: "secondary",
968
1010
  buttonStyle: "ghost",
969
- onClick: () => je(e),
970
- children: R.editLabel
971
- }), /* @__PURE__ */ V(Ke, {
1011
+ onClick: () => We(e),
1012
+ disabled: $,
1013
+ children: V.editLabel
1014
+ }), /* @__PURE__ */ G(Ye, {
972
1015
  item: e,
973
- actions: g,
974
- menuLabel: R.actionsLabel
975
- })] }) : null, y = m === void 0 ? _ : m;
976
- if (s) return /* @__PURE__ */ V("div", {
1016
+ actions: S,
1017
+ menuLabel: V.actionsLabel
1018
+ })] }) : null, j = b === void 0 ? T : b;
1019
+ if (s) return /* @__PURE__ */ G("div", {
977
1020
  className: "product-options-matrix--item product-options-matrix--item-editing border-b border-border/60 p-surface last:border-b-0",
978
- children: /* @__PURE__ */ H("div", {
979
- className: "grid min-w-0 grid-cols-[auto_minmax(0,1fr)] gap-x-space-md gap-y-space-lg",
980
- children: [/* @__PURE__ */ V("span", {
981
- className: "product-options-matrix--drag-handle self-start flex size-icon-lg items-center justify-center text-muted-foreground",
982
- "aria-hidden": "true",
983
- children: /* @__PURE__ */ V(Se, { className: "size-icon-sm" })
984
- }), /* @__PURE__ */ H(u, {
985
- gap: "lg",
986
- className: "product-options-matrix--editor",
987
- children: [
988
- /* @__PURE__ */ V(D, {
989
- label: R.optionNameLabel,
990
- className: "product-options-matrix--editor-field",
991
- children: /* @__PURE__ */ V(E, {
992
- value: p.name,
993
- onChange: (t) => {
994
- let n = t.currentTarget.value;
995
- Q(e, (e) => ({
996
- ...e,
997
- name: n
998
- }));
999
- },
1000
- "aria-label": R.optionNameLabel,
1001
- className: "bg-background"
1002
- })
1003
- }),
1004
- /* @__PURE__ */ H(u, {
1005
- gap: "sm",
1006
- className: "product-options-matrix--editor-field",
1007
- children: [/* @__PURE__ */ V(o, {
1008
- type: "inherit",
1009
- weight: "medium",
1010
- children: R.optionValuesLabel
1011
- }), /* @__PURE__ */ H(u, {
1012
- gap: "xs",
1013
- className: "product-options-matrix--editor-values",
1014
- children: [
1015
- p.values.length === 0 && /* @__PURE__ */ V(o, {
1016
- size: "xs",
1017
- type: "secondary",
1018
- children: R.noValuesLabel
1019
- }),
1020
- p.values.map((t) => /* @__PURE__ */ H("div", {
1021
- className: "product-options-matrix--editor-value grid min-w-0 grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-space-sm",
1022
- children: [
1023
- /* @__PURE__ */ V("span", {
1024
- className: "flex size-icon-lg items-center justify-center text-muted-foreground",
1025
- "aria-hidden": "true",
1026
- children: /* @__PURE__ */ V(Se, { className: "size-icon-sm" })
1027
- }),
1028
- /* @__PURE__ */ V(E, {
1029
- value: ot(t.label),
1030
- onChange: (n) => {
1031
- let r = n.currentTarget.value;
1032
- Q(e, (e) => ({
1033
- ...e,
1034
- values: e.values.map((e) => e.id === t.id ? {
1035
- ...e,
1036
- label: r
1037
- } : e)
1038
- }));
1039
- },
1040
- "aria-label": `${R.optionValuesLabel}: ${ot(t.label)}`,
1041
- className: "bg-background"
1042
- }),
1043
- /* @__PURE__ */ H(a, {
1044
- type: "button",
1045
- size: "sm",
1046
- iconOnly: !0,
1047
- tone: "secondary",
1048
- buttonStyle: "ghost",
1049
- onClick: () => Q(e, (e) => ({
1021
+ children: /* @__PURE__ */ K(u, {
1022
+ gap: "lg",
1023
+ className: "product-options-matrix--editor",
1024
+ "aria-busy": y,
1025
+ children: [
1026
+ _ && /* @__PURE__ */ K(p, {
1027
+ ref: Ne,
1028
+ tabIndex: -1,
1029
+ tone: "destructive",
1030
+ children: [/* @__PURE__ */ G(h, { children: V.saveErrorTitle ?? Me.saveErrorTitle }), /* @__PURE__ */ G(f, { children: _.message })]
1031
+ }),
1032
+ /* @__PURE__ */ G(k, {
1033
+ label: V.optionNameLabel,
1034
+ className: "product-options-matrix--editor-field",
1035
+ children: /* @__PURE__ */ G(O, {
1036
+ value: g.name,
1037
+ disabled: $,
1038
+ onChange: (t) => {
1039
+ let n = t.currentTarget.value;
1040
+ Ke(e, (e) => ({
1041
+ ...e,
1042
+ name: n
1043
+ }));
1044
+ },
1045
+ "aria-label": V.optionNameLabel,
1046
+ className: "bg-background"
1047
+ })
1048
+ }),
1049
+ /* @__PURE__ */ K(u, {
1050
+ gap: "sm",
1051
+ className: "product-options-matrix--editor-field",
1052
+ children: [/* @__PURE__ */ G(o, {
1053
+ type: "inherit",
1054
+ weight: "medium",
1055
+ children: V.optionValuesLabel
1056
+ }), /* @__PURE__ */ K(u, {
1057
+ gap: "xs",
1058
+ className: "product-options-matrix--editor-values",
1059
+ children: [
1060
+ g.values.length === 0 && /* @__PURE__ */ G(o, {
1061
+ size: "xs",
1062
+ type: "secondary",
1063
+ children: V.noValuesLabel
1064
+ }),
1065
+ g.values.map((t) => /* @__PURE__ */ K("div", {
1066
+ className: "product-options-matrix--editor-value grid min-w-0 grid-cols-[minmax(0,1fr)_auto] items-center gap-space-sm",
1067
+ children: [/* @__PURE__ */ G(O, {
1068
+ ref: t.id === Pe.current ? Fe : void 0,
1069
+ value: lt(t.label),
1070
+ disabled: $,
1071
+ onChange: (n) => {
1072
+ let r = n.currentTarget.value;
1073
+ Ke(e, (e) => ({
1074
+ ...e,
1075
+ values: e.values.map((e) => e.id === t.id ? {
1050
1076
  ...e,
1051
- values: e.values.filter((e) => e.id !== t.id)
1052
- })),
1053
- "aria-label": R.deleteValueLabel,
1054
- className: "text-muted-foreground hover:text-destructive",
1055
- children: [/* @__PURE__ */ V(J, {
1056
- className: "size-icon-sm",
1057
- "aria-hidden": "true"
1058
- }), /* @__PURE__ */ V(o, {
1059
- tag: "span",
1060
- size: "pxs",
1061
- className: "sr-only",
1062
- children: R.deleteValueLabel
1063
- })]
1064
- })
1065
- ]
1066
- }, t.id)),
1067
- /* @__PURE__ */ H("div", {
1068
- className: "product-options-matrix--editor-add-value grid min-w-0 grid-cols-[auto_minmax(0,1fr)_auto] items-center gap-space-sm",
1069
- children: [
1070
- /* @__PURE__ */ V("span", {
1071
- className: "size-icon-lg",
1072
- "aria-hidden": "true"
1073
- }),
1074
- /* @__PURE__ */ V(a, {
1075
- type: "button",
1076
- tone: "secondary",
1077
- buttonStyle: "outline",
1078
- onClick: () => Q(e, (t) => {
1079
- let n = t.values.length + 1;
1080
- return {
1081
- ...t,
1082
- values: [...t.values, {
1083
- id: `${e.id}-draft-value-${n}`,
1084
- label: ""
1085
- }]
1086
- };
1087
- }),
1088
- fullWidth: !0,
1089
- className: "justify-start text-muted-foreground",
1090
- children: R.addAnotherValueLabel
1091
- }),
1092
- /* @__PURE__ */ V("span", {
1093
- className: "size-action-sm",
1094
- "aria-hidden": "true"
1095
- })
1096
- ]
1077
+ label: r
1078
+ } : e)
1079
+ }));
1080
+ },
1081
+ "aria-label": `${V.optionValuesLabel}: ${lt(t.label)}`,
1082
+ className: "bg-background"
1083
+ }), /* @__PURE__ */ K(a, {
1084
+ type: "button",
1085
+ size: "sm",
1086
+ iconOnly: !0,
1087
+ tone: "secondary",
1088
+ buttonStyle: "ghost",
1089
+ onClick: () => Ke(e, (e) => ({
1090
+ ...e,
1091
+ values: e.values.filter((e) => e.id !== t.id)
1092
+ })),
1093
+ "aria-label": V.deleteValueLabel,
1094
+ disabled: $,
1095
+ className: "text-muted-foreground hover:text-destructive",
1096
+ children: [/* @__PURE__ */ G(X, {
1097
+ className: "size-icon-sm",
1098
+ "aria-hidden": "true"
1099
+ }), /* @__PURE__ */ G(o, {
1100
+ tag: "span",
1101
+ size: "pxs",
1102
+ className: "sr-only",
1103
+ children: V.deleteValueLabel
1104
+ })]
1105
+ })]
1106
+ }, t.id)),
1107
+ /* @__PURE__ */ G("div", {
1108
+ className: "product-options-matrix--editor-add-value min-w-0",
1109
+ children: /* @__PURE__ */ G(a, {
1110
+ type: "button",
1111
+ tone: "secondary",
1112
+ buttonStyle: "outline",
1113
+ disabled: $,
1114
+ onClick: () => Ke(e, (t) => {
1115
+ let n = t.values.length + 1, r = `${e.id}-draft-value-${n}`;
1116
+ return Pe.current = r, {
1117
+ ...t,
1118
+ values: [...t.values, {
1119
+ id: r,
1120
+ label: ""
1121
+ }]
1122
+ };
1123
+ }),
1124
+ fullWidth: !0,
1125
+ className: "justify-start text-muted-foreground",
1126
+ children: V.addAnotherValueLabel
1097
1127
  })
1098
- ]
1099
- })]
1100
- }),
1101
- /* @__PURE__ */ H(u, {
1128
+ })
1129
+ ]
1130
+ })]
1131
+ }),
1132
+ /* @__PURE__ */ K(u, {
1133
+ direction: "horizontal",
1134
+ gap: "md",
1135
+ justify: "between",
1136
+ wrap: !1,
1137
+ className: "product-options-matrix--editor-actions",
1138
+ children: [/* @__PURE__ */ G("div", { children: !!w && /* @__PURE__ */ G(a, {
1139
+ type: "button",
1140
+ tone: "destructive",
1141
+ buttonStyle: "outline",
1142
+ onClick: () => it(e),
1143
+ disabled: $,
1144
+ children: V.deleteLabel
1145
+ }) }), /* @__PURE__ */ K(u, {
1102
1146
  direction: "horizontal",
1103
- gap: "md",
1104
- justify: "between",
1147
+ gap: "sm",
1148
+ justify: "end",
1105
1149
  wrap: !1,
1106
- className: "product-options-matrix--editor-actions",
1107
- children: [/* @__PURE__ */ V("div", { children: !!x && /* @__PURE__ */ V(a, {
1150
+ children: [/* @__PURE__ */ G(a, {
1108
1151
  type: "button",
1109
- tone: "destructive",
1110
- buttonStyle: "outline",
1111
- onClick: () => He(e),
1112
- children: R.deleteLabel
1113
- }) }), /* @__PURE__ */ H(u, {
1114
- direction: "horizontal",
1115
- gap: "sm",
1116
- justify: "end",
1117
- wrap: !1,
1118
- children: [/* @__PURE__ */ V(a, {
1119
- type: "button",
1120
- tone: "secondary",
1121
- buttonStyle: "ghost",
1122
- onClick: () => Me(e),
1123
- children: R.cancelLabel
1124
- }), /* @__PURE__ */ V(a, {
1125
- type: "button",
1126
- tone: "neutral",
1127
- onClick: () => Le(e),
1128
- children: R.saveLabel ?? R.doneLabel
1129
- })]
1152
+ tone: "secondary",
1153
+ buttonStyle: "ghost",
1154
+ onClick: () => qe(e),
1155
+ disabled: $,
1156
+ children: V.cancelLabel
1157
+ }), /* @__PURE__ */ G(a, {
1158
+ type: "button",
1159
+ tone: "neutral",
1160
+ onClick: () => $e(e),
1161
+ disabled: $,
1162
+ loading: y,
1163
+ strings: { loading: V.savingLabel },
1164
+ children: _ ? V.retrySaveLabel ?? V.saveLabel : V.saveLabel ?? V.doneLabel
1130
1165
  })]
1131
- })
1132
- ]
1133
- })]
1166
+ })]
1167
+ })
1168
+ ]
1134
1169
  })
1135
1170
  }, e.id);
1136
- let C = /* @__PURE__ */ H(u, {
1137
- render: /* @__PURE__ */ V("span", {}),
1171
+ let ne = /* @__PURE__ */ K(u, {
1172
+ render: /* @__PURE__ */ G("span", {}),
1138
1173
  gap: "sm",
1139
1174
  children: [
1140
- /* @__PURE__ */ H(u, {
1141
- render: /* @__PURE__ */ V("span", {}),
1175
+ /* @__PURE__ */ K(u, {
1176
+ render: /* @__PURE__ */ G("span", {}),
1142
1177
  direction: "horizontal",
1143
1178
  gap: "sm",
1144
- children: [/* @__PURE__ */ V(o, {
1179
+ children: [/* @__PURE__ */ G(o, {
1145
1180
  type: "inherit",
1146
1181
  tag: "span",
1147
1182
  weight: "semibold",
@@ -1149,37 +1184,39 @@ function ut({ optionGroups: e = [], surface: t = "card", collapsedOptionIds: s,
1149
1184
  children: e.name
1150
1185
  }), e.badge]
1151
1186
  }),
1152
- !!e.description && /* @__PURE__ */ V(o, {
1187
+ !!e.description && /* @__PURE__ */ G(o, {
1153
1188
  tag: "span",
1154
1189
  size: "xs",
1155
1190
  type: "secondary",
1156
1191
  className: "max-w-prose",
1157
1192
  children: e.description
1158
1193
  }),
1159
- !r && /* @__PURE__ */ V(u, {
1160
- render: /* @__PURE__ */ V("span", {}),
1194
+ !r && /* @__PURE__ */ G(u, {
1195
+ render: /* @__PURE__ */ G("span", {}),
1161
1196
  gap: "sm",
1162
1197
  className: "product-options-matrix--values",
1163
- children: n.length === 0 ? /* @__PURE__ */ V(o, {
1198
+ children: n.length === 0 ? /* @__PURE__ */ G(o, {
1164
1199
  tag: "span",
1165
1200
  size: "xs",
1166
1201
  type: "secondary",
1167
- children: R.noValuesLabel
1168
- }) : /* @__PURE__ */ V("span", {
1202
+ children: V.noValuesLabel
1203
+ }) : /* @__PURE__ */ G("span", {
1169
1204
  className: "flex flex-wrap gap-space-xs",
1170
1205
  children: n.map((n, r) => {
1171
- let a = O ? () => O(e, n) : void 0, s = I?.(n, {
1206
+ let a = A ? () => {
1207
+ Z.current || A(e, n);
1208
+ } : void 0, s = I?.(n, {
1172
1209
  option: e,
1173
1210
  optionIndex: t,
1174
1211
  valueIndex: r,
1175
1212
  onDelete: a
1176
1213
  });
1177
- return s ? /* @__PURE__ */ V(me, { children: s }, n.id) : /* @__PURE__ */ H(S, {
1214
+ return s ? /* @__PURE__ */ G(pe, { children: s }, n.id) : /* @__PURE__ */ K(ee, {
1178
1215
  size: "sm",
1179
1216
  tone: "neutral",
1180
1217
  className: i("product-options-matrix--value", n.disabled && "opacity-50"),
1181
1218
  children: [
1182
- st(n.label) ? /* @__PURE__ */ V(o, {
1219
+ ut(n.label) ? /* @__PURE__ */ G(o, {
1183
1220
  type: "inherit",
1184
1221
  tag: "span",
1185
1222
  size: "inherit",
@@ -1187,19 +1224,20 @@ function ut({ optionGroups: e = [], surface: t = "card", collapsedOptionIds: s,
1187
1224
  children: n.label
1188
1225
  }) : n.label,
1189
1226
  n.badge,
1190
- !!a && ie && /* @__PURE__ */ H("button", {
1227
+ !!a && z && /* @__PURE__ */ K("button", {
1191
1228
  type: "button",
1192
1229
  onClick: a,
1193
- "aria-label": R.deleteValueLabel,
1194
- className: i(T.target, T.focus, c.inset, T.clear, "hover:text-destructive"),
1195
- children: [/* @__PURE__ */ V(Te, {
1196
- className: T.icon,
1230
+ disabled: $,
1231
+ "aria-label": V.deleteValueLabel,
1232
+ className: i(D.target, D.focus, c.inset, D.clear, "hover:text-destructive"),
1233
+ children: [/* @__PURE__ */ G(Ee, {
1234
+ className: D.icon,
1197
1235
  "aria-hidden": "true"
1198
- }), /* @__PURE__ */ V(o, {
1236
+ }), /* @__PURE__ */ G(o, {
1199
1237
  tag: "span",
1200
1238
  size: "pxs",
1201
1239
  className: "sr-only",
1202
- children: R.deleteValueLabel
1240
+ children: V.deleteValueLabel
1203
1241
  })]
1204
1242
  })
1205
1243
  ]
@@ -1209,166 +1247,177 @@ function ut({ optionGroups: e = [], surface: t = "card", collapsedOptionIds: s,
1209
1247
  })
1210
1248
  ]
1211
1249
  });
1212
- return /* @__PURE__ */ V("div", {
1250
+ return /* @__PURE__ */ G("div", {
1213
1251
  className: "product-options-matrix--item border-b border-border/60 last:border-b-0",
1214
- children: /* @__PURE__ */ H("div", {
1215
- className: "grid min-w-0 grid-cols-[auto_minmax(0,1fr)] items-center gap-x-space-md gap-y-space-md p-surface @2xl/product-options-matrix:grid-cols-[auto_minmax(0,1fr)_auto]",
1252
+ children: /* @__PURE__ */ K("div", {
1253
+ className: i("grid min-w-0 items-center gap-x-space-md gap-y-space-md p-surface", R ? "grid-cols-[auto_minmax(0,1fr)] @2xl/product-options-matrix:grid-cols-[auto_minmax(0,1fr)_auto]" : "grid-cols-1 @2xl/product-options-matrix:grid-cols-[minmax(0,1fr)_auto]"),
1216
1254
  children: [
1217
- re ? /* @__PURE__ */ H(a, {
1255
+ R && /* @__PURE__ */ K(a, {
1218
1256
  type: "button",
1219
1257
  size: "sm",
1220
1258
  iconOnly: !0,
1221
1259
  tone: "secondary",
1222
1260
  buttonStyle: "ghost",
1223
- onClick: () => Ae(e),
1261
+ onClick: () => He(e),
1262
+ disabled: $,
1224
1263
  "aria-expanded": !r,
1225
- "aria-label": r ? R.expandOptionLabel : R.collapseOptionLabel,
1264
+ "aria-label": r ? V.expandOptionLabel : V.collapseOptionLabel,
1226
1265
  className: "product-options-matrix--collapse-trigger mt-space-2xs shrink-0 text-muted-foreground",
1227
- children: [/* @__PURE__ */ V(ye, {
1266
+ children: [/* @__PURE__ */ G(q, {
1228
1267
  className: i("size-icon-sm transition-transform", r && "-rotate-90"),
1229
1268
  "aria-hidden": "true"
1230
- }), /* @__PURE__ */ V(o, {
1269
+ }), /* @__PURE__ */ G(o, {
1231
1270
  tag: "span",
1232
1271
  size: "pxs",
1233
1272
  className: "sr-only",
1234
- children: r ? R.expandOptionLabel : R.collapseOptionLabel
1273
+ children: r ? V.expandOptionLabel : V.collapseOptionLabel
1235
1274
  })]
1236
- }) : /* @__PURE__ */ V("span", {
1237
- className: "product-options-matrix--drag-handle flex size-icon-lg items-center justify-center text-muted-foreground",
1238
- "aria-hidden": "true",
1239
- children: /* @__PURE__ */ V(Se, { className: "size-icon-sm" })
1240
1275
  }),
1241
- /* @__PURE__ */ V("div", {
1276
+ /* @__PURE__ */ G("div", {
1242
1277
  className: "product-options-matrix--item-main min-w-0",
1243
- children: l && !ie ? /* @__PURE__ */ V("button", {
1278
+ children: l && !z ? /* @__PURE__ */ G("button", {
1244
1279
  type: "button",
1245
- onClick: () => je(e),
1246
- "aria-label": ct(R.editLabel, e),
1247
- className: `product-options-matrix--edit-summary ${v.nativeButtonReset} block w-full cursor-pointer whitespace-normal rounded-inner text-start text-inherit outline-none ${c.edge}`,
1248
- children: C
1249
- }) : C
1280
+ onClick: () => We(e),
1281
+ disabled: $,
1282
+ "aria-label": dt(V.editLabel, e),
1283
+ className: `product-options-matrix--edit-summary ${x.nativeButtonReset} block w-full cursor-pointer whitespace-normal rounded-radius text-start text-inherit outline-none ${c.edge}`,
1284
+ children: ne
1285
+ }) : ne
1250
1286
  }),
1251
- (ae || !!y) && /* @__PURE__ */ H("div", {
1252
- className: i("product-options-matrix--item-actions col-start-2 flex min-w-fit items-center justify-start @2xl/product-options-matrix:justify-end lg:col-start-auto", h.commands),
1253
- children: [!!P && ae && /* @__PURE__ */ H("div", {
1287
+ (!!P && B || !!j) && /* @__PURE__ */ K("div", {
1288
+ className: i("product-options-matrix--item-actions flex min-w-0 flex-wrap items-center justify-start @2xl/product-options-matrix:col-start-auto @2xl/product-options-matrix:justify-end", R ? "col-start-2" : "col-start-1", v.commands),
1289
+ children: [!!P && B && /* @__PURE__ */ K("div", {
1254
1290
  className: "inline-flex items-center gap-space-sm",
1255
- children: [/* @__PURE__ */ V(o, {
1291
+ children: [/* @__PURE__ */ G(o, {
1256
1292
  tag: "span",
1257
1293
  id: `product-option-${e.id}-variant-toggle-label`,
1258
1294
  size: "pxs",
1259
1295
  type: "secondary",
1260
1296
  weight: "medium",
1261
- children: R.useForVariantsLabel
1262
- }), /* @__PURE__ */ V(ee, {
1297
+ children: V.useForVariantsLabel
1298
+ }), /* @__PURE__ */ G(te, {
1263
1299
  checked: !!e.usedForVariants,
1264
- onValueChange: (t) => P(e, t),
1300
+ disabled: $,
1301
+ onValueChange: (t) => {
1302
+ Z.current || P(e, t);
1303
+ },
1265
1304
  "aria-labelledby": `product-option-${e.id}-variant-toggle-label`
1266
1305
  })]
1267
- }), y]
1306
+ }), j]
1268
1307
  })
1269
1308
  ]
1270
1309
  })
1271
1310
  }, e.id);
1272
- }), !!Oe && /* @__PURE__ */ V("div", {
1311
+ }), !!ze && /* @__PURE__ */ G("div", {
1273
1312
  className: "product-options-matrix--create-row border-t border-border/60 p-surface-xs",
1274
- children: /* @__PURE__ */ V(a, {
1313
+ children: /* @__PURE__ */ G(a, {
1275
1314
  type: "button",
1276
1315
  tone: "secondary",
1277
1316
  buttonStyle: "ghost",
1278
- onClick: y,
1279
- icon: we,
1317
+ onClick: () => {
1318
+ Z.current || S?.();
1319
+ },
1320
+ disabled: $,
1321
+ icon: Ce,
1280
1322
  size: "sm",
1281
1323
  fullWidth: !0,
1282
1324
  className: "justify-start text-foreground",
1283
- children: R.addAnotherOptionLabel
1325
+ children: V.addAnotherOptionLabel
1284
1326
  })
1285
1327
  })]
1286
- }) : /* @__PURE__ */ V("div", {
1287
- className: i(De && "border-t border-border/60"),
1288
- children: ce ?? /* @__PURE__ */ V($, {
1289
- title: R.emptyTitle,
1290
- description: R.emptyDescription,
1291
- action: y && !De ? /* @__PURE__ */ V(a, {
1328
+ }) : /* @__PURE__ */ G("div", {
1329
+ className: i(Re && "border-t border-border/60"),
1330
+ children: le ?? /* @__PURE__ */ G(Ve, {
1331
+ title: V.emptyTitle,
1332
+ description: V.emptyDescription,
1333
+ action: S && !Re ? /* @__PURE__ */ G(a, {
1292
1334
  tone: "primary",
1293
1335
  type: "button",
1294
- onClick: y,
1295
- icon: G,
1296
- children: R.createLabel
1336
+ onClick: S,
1337
+ icon: Y,
1338
+ children: V.createLabel
1297
1339
  }) : void 0
1298
1340
  })
1299
1341
  })]
1300
1342
  }),
1301
- !!(C !== !1 && Fe) && /* @__PURE__ */ V(_, {
1302
- ...Pe.overlayProps,
1343
+ !!(T !== !1 && Ze) && /* @__PURE__ */ G(b, {
1344
+ ...Xe.overlayProps,
1303
1345
  destructive: !0,
1304
- title: R.confirmRemoveValuesTitle,
1305
- description: n(R.confirmRemoveValuesDescription, { count: Fe.removed }),
1306
- strings: { confirm: R.confirmRemoveValuesLabel },
1307
- onConfirm: () => Ne(Fe.option)
1346
+ title: V.confirmRemoveValuesTitle,
1347
+ description: n(V.confirmRemoveValuesDescription, { count: Ze.removed }),
1348
+ strings: {
1349
+ confirm: je?.optionId === Ze.option.id ? V.retrySaveLabel : V.confirmRemoveValuesLabel,
1350
+ loading: V.savingLabel
1351
+ },
1352
+ alertMessage: je?.optionId === Ze.option.id ? je.message : void 0,
1353
+ closeOnAsyncComplete: !1,
1354
+ onAsyncConfirm: async () => {
1355
+ await Je(Ze.option) && Xe.hide();
1356
+ }
1308
1357
  }),
1309
- !!(C !== !1 && x) && /* @__PURE__ */ V(_, {
1310
- ...ze.overlayProps,
1358
+ !!(T !== !1 && w) && /* @__PURE__ */ G(b, {
1359
+ ...tt.overlayProps,
1311
1360
  destructive: !0,
1312
- title: R.confirmDeleteOptionTitle,
1313
- description: R.confirmDeleteOptionDescription,
1314
- strings: { confirm: R.deleteLabel },
1361
+ title: V.confirmDeleteOptionTitle,
1362
+ description: V.confirmDeleteOptionDescription,
1363
+ strings: { confirm: V.deleteLabel },
1315
1364
  onConfirm: () => {
1316
- Be && Re(Be);
1365
+ nt && et(nt);
1317
1366
  }
1318
1367
  })
1319
1368
  ]
1320
1369
  });
1321
- return t === "embedded" ? /* @__PURE__ */ V("section", {
1322
- "aria-label": R.title,
1323
- className: i("product-options-matrix--component @container/product-options-matrix min-w-0", le),
1324
- children: Ge
1325
- }) : /* @__PURE__ */ V(j, {
1326
- title: R.title,
1327
- description: R.description,
1370
+ return t === "embedded" ? /* @__PURE__ */ G("section", {
1371
+ "aria-label": V.title,
1372
+ className: i("product-options-matrix--component @container/product-options-matrix min-w-0", ue),
1373
+ children: st
1374
+ }) : /* @__PURE__ */ G(M, {
1375
+ title: V.title,
1376
+ description: V.description,
1328
1377
  actions: oe,
1329
- headerAction: Ue,
1330
- headerEnd: L,
1331
- footerSlot: se,
1332
- className: i("product-options-matrix--component @container/product-options-matrix w-full", le),
1333
- children: Ge
1378
+ headerAction: at,
1379
+ headerEnd: se,
1380
+ footerSlot: ce,
1381
+ className: i("product-options-matrix--component @container/product-options-matrix w-full", ue),
1382
+ children: st
1334
1383
  });
1335
1384
  }
1336
- ut.displayName = "ProductOptionsMatrix";
1385
+ pt.displayName = "ProductOptionsMatrix";
1337
1386
  //#endregion
1338
1387
  //#region src/components/features/products/components/product-options-summary.tsx
1339
- function dt({ options: e = [], onManageOptions: t, onCreateOption: n, onSelectOption: o, onEditOption: s, onDeleteOption: c, renderOptionActions: l, actions: u, footerSlot: d, renderOption: f, empty: p, className: m, strings: h }) {
1340
- let g = r(Y, h), _ = !!(o || s || c || l), v = [...u ?? [], ...n && t ? [{
1388
+ function mt({ options: e = [], onManageOptions: t, onCreateOption: n, onSelectOption: o, onEditOption: s, onDeleteOption: c, renderOptionActions: l, actions: u, footerSlot: d, renderOption: f, empty: p, className: m, strings: h }) {
1389
+ let g = r(je, h), _ = !!(o || s || c || l), v = [...u ?? [], ...n && t ? [{
1341
1390
  id: "manage-options",
1342
1391
  label: g.manageLabel,
1343
- icon: /* @__PURE__ */ V(q, { className: "size-icon-md" }),
1392
+ icon: /* @__PURE__ */ G(Te, { className: "size-icon-md" }),
1344
1393
  onClick: t
1345
- }] : []], y = n || t ? /* @__PURE__ */ V(a, {
1394
+ }] : []], y = n || t ? /* @__PURE__ */ G(a, {
1346
1395
  type: "button",
1347
1396
  tone: "secondary",
1348
1397
  buttonStyle: "ghost",
1349
1398
  onClick: n ?? t,
1350
- icon: n ? G : void 0,
1399
+ icon: n ? Y : void 0,
1351
1400
  children: n ? g.createLabel : g.manageLabel
1352
1401
  }) : void 0;
1353
- return /* @__PURE__ */ V(j, {
1402
+ return /* @__PURE__ */ G(M, {
1354
1403
  title: g.title,
1355
1404
  description: g.description,
1356
1405
  actions: v.length > 0 ? v : void 0,
1357
1406
  headerAction: y,
1358
1407
  footerSlot: d,
1359
1408
  className: i("product-options-summary--component w-full", m),
1360
- children: e.length === 0 ? p ?? /* @__PURE__ */ V($, {
1409
+ children: e.length === 0 ? p ?? /* @__PURE__ */ G(Ve, {
1361
1410
  title: g.emptyTitle,
1362
1411
  description: g.emptyDescription,
1363
- action: n ? /* @__PURE__ */ V(a, {
1412
+ action: n ? /* @__PURE__ */ G(a, {
1364
1413
  tone: "primary",
1365
1414
  type: "button",
1366
1415
  onClick: n,
1367
- icon: G,
1416
+ icon: Y,
1368
1417
  children: g.createLabel
1369
1418
  }) : void 0
1370
- }) : /* @__PURE__ */ V(I, { children: e.map((e, t) => (() => {
1371
- let n = _ ? /* @__PURE__ */ V(it, {
1419
+ }) : /* @__PURE__ */ G(F, { children: e.map((e, t) => (() => {
1420
+ let n = _ ? /* @__PURE__ */ G(st, {
1372
1421
  option: e,
1373
1422
  index: t,
1374
1423
  onSelectOption: o,
@@ -1383,54 +1432,54 @@ function dt({ options: e = [], onManageOptions: t, onCreateOption: n, onSelectOp
1383
1432
  actionsLabel: g.actionsLabel
1384
1433
  }
1385
1434
  }) : void 0;
1386
- return f ? /* @__PURE__ */ V("div", { children: f(e, t) }, e.id) : /* @__PURE__ */ V(tt, {
1435
+ return f ? /* @__PURE__ */ G("div", { children: f(e, t) }, e.id) : /* @__PURE__ */ G(it, {
1387
1436
  item: e,
1388
1437
  actions: n
1389
1438
  }, e.id);
1390
1439
  })()) })
1391
1440
  });
1392
1441
  }
1393
- dt.displayName = "ProductOptionsSummary";
1442
+ mt.displayName = "ProductOptionsSummary";
1394
1443
  //#endregion
1395
1444
  //#region src/components/features/products/components/product-policies-card.tsx
1396
- function ft({ policies: e = [], onCreatePolicy: t, onSelectPolicy: n, onEditPolicy: o, onDeletePolicy: s, renderPolicyActions: c, actions: l, footerSlot: u, renderPolicy: d, empty: f, className: p, strings: m }) {
1397
- let h = r(Q, m), g = t ? /* @__PURE__ */ V(a, {
1445
+ function ht({ policies: e = [], onCreatePolicy: t, onSelectPolicy: n, onEditPolicy: o, onDeletePolicy: s, renderPolicyActions: c, actions: l, footerSlot: u, renderPolicy: d, empty: f, className: p, strings: m }) {
1446
+ let h = r(Pe, m), g = t ? /* @__PURE__ */ G(a, {
1398
1447
  type: "button",
1399
1448
  tone: "secondary",
1400
1449
  buttonStyle: "ghost",
1401
1450
  onClick: t,
1402
- icon: G,
1451
+ icon: Y,
1403
1452
  children: h.createLabel
1404
1453
  }) : void 0;
1405
- return /* @__PURE__ */ V(j, {
1454
+ return /* @__PURE__ */ G(M, {
1406
1455
  title: h.title,
1407
1456
  description: h.description,
1408
1457
  actions: l,
1409
1458
  headerAction: g,
1410
1459
  footerSlot: u,
1411
1460
  className: i("product-policies-card--component w-full", p),
1412
- children: e.length === 0 ? f ?? /* @__PURE__ */ V($, {
1461
+ children: e.length === 0 ? f ?? /* @__PURE__ */ G(Ve, {
1413
1462
  title: h.emptyTitle,
1414
1463
  description: h.emptyDescription,
1415
- action: t ? /* @__PURE__ */ V(a, {
1464
+ action: t ? /* @__PURE__ */ G(a, {
1416
1465
  tone: "primary",
1417
1466
  type: "button",
1418
1467
  onClick: t,
1419
- icon: G,
1468
+ icon: Y,
1420
1469
  children: h.createLabel
1421
1470
  }) : void 0
1422
- }) : /* @__PURE__ */ V(I, { children: e.map((e, t) => (() => {
1471
+ }) : /* @__PURE__ */ G(F, { children: e.map((e, t) => (() => {
1423
1472
  let r = n ? () => n(e) : void 0, i = o ? () => o(e) : void 0, a = s ? () => s(e) : void 0, l = [...i ? [{
1424
1473
  id: "edit",
1425
1474
  label: h.editLabel,
1426
- icon: /* @__PURE__ */ V(W, { className: "size-icon-md" }),
1475
+ icon: /* @__PURE__ */ G(Se, { className: "size-icon-md" }),
1427
1476
  onClick: () => i(),
1428
1477
  tone: "secondary",
1429
1478
  buttonStyle: "ghost"
1430
1479
  }] : [], ...a ? [{
1431
1480
  id: "delete",
1432
1481
  label: h.deleteLabel,
1433
- icon: /* @__PURE__ */ V(J, { className: "size-icon-md" }),
1482
+ icon: /* @__PURE__ */ G(X, { className: "size-icon-md" }),
1434
1483
  onClick: () => a(),
1435
1484
  tone: "destructive"
1436
1485
  }] : []], u = c ? c(e, {
@@ -1438,12 +1487,12 @@ function ft({ policies: e = [], onCreatePolicy: t, onSelectPolicy: n, onEditPoli
1438
1487
  onSelect: r,
1439
1488
  onEdit: i,
1440
1489
  onDelete: a
1441
- }) : /* @__PURE__ */ V(Ke, {
1490
+ }) : /* @__PURE__ */ G(Ye, {
1442
1491
  item: e,
1443
1492
  actions: l,
1444
1493
  menuLabel: h.actionsLabel
1445
1494
  });
1446
- return d ? /* @__PURE__ */ V("div", { children: d(e, t) }, e.id) : /* @__PURE__ */ V(tt, {
1495
+ return d ? /* @__PURE__ */ G("div", { children: d(e, t) }, e.id) : /* @__PURE__ */ G(it, {
1447
1496
  item: e,
1448
1497
  actionLabel: h.viewLabel,
1449
1498
  onSelect: r,
@@ -1452,69 +1501,69 @@ function ft({ policies: e = [], onCreatePolicy: t, onSelectPolicy: n, onEditPoli
1452
1501
  })()) })
1453
1502
  });
1454
1503
  }
1455
- ft.displayName = "ProductPoliciesCard";
1504
+ ht.displayName = "ProductPoliciesCard";
1456
1505
  //#endregion
1457
1506
  //#region src/components/features/products/components/product-quote-preview-card.tsx
1458
- function pt({ lines: e = [], subtotal: t, tax: n, discount: s, total: c, onOpenQuote: l, onCreateLine: d, onSelectLine: f, onEditLine: p, onDeleteLine: m, renderLineActions: h, actions: g, footerSlot: _, empty: v, className: b, strings: x }) {
1459
- let S = r(Z, x), C = t !== void 0 || n !== void 0 || s !== void 0, T = d || l ? /* @__PURE__ */ H("div", {
1507
+ function gt({ lines: e = [], subtotal: t, tax: n, discount: s, total: c, onOpenQuote: l, onCreateLine: d, onSelectLine: f, onEditLine: p, onDeleteLine: m, renderLineActions: h, actions: g, footerSlot: _, empty: v, className: y, strings: b }) {
1508
+ let x = r(Ne, b), C = t !== void 0 || n !== void 0 || s !== void 0, w = d || l ? /* @__PURE__ */ K("div", {
1460
1509
  className: "flex items-center gap-space-md",
1461
- children: [!!d && /* @__PURE__ */ V(a, {
1510
+ children: [!!d && /* @__PURE__ */ G(a, {
1462
1511
  type: "button",
1463
1512
  tone: "secondary",
1464
1513
  buttonStyle: "ghost",
1465
1514
  onClick: d,
1466
- icon: G,
1467
- children: S.createLineLabel
1468
- }), !!l && /* @__PURE__ */ V(a, {
1515
+ icon: Y,
1516
+ children: x.createLineLabel
1517
+ }), !!l && /* @__PURE__ */ G(a, {
1469
1518
  type: "button",
1470
1519
  tone: "secondary",
1471
1520
  buttonStyle: "ghost",
1472
1521
  onClick: l,
1473
- children: S.actionLabel
1522
+ children: x.actionLabel
1474
1523
  })]
1475
1524
  }) : void 0;
1476
- return /* @__PURE__ */ V(j, {
1477
- title: S.title,
1478
- description: S.description,
1525
+ return /* @__PURE__ */ G(M, {
1526
+ title: x.title,
1527
+ description: x.description,
1479
1528
  actions: g,
1480
- headerAction: T,
1529
+ headerAction: w,
1481
1530
  footerSlot: _,
1482
- className: i("product-quote-preview-card--component w-full", b),
1483
- children: e.length === 0 ? v ?? /* @__PURE__ */ V($, {
1484
- title: S.emptyTitle,
1485
- description: S.emptyDescription,
1486
- action: d ? /* @__PURE__ */ V(a, {
1531
+ className: i("product-quote-preview-card--component w-full", y),
1532
+ children: e.length === 0 ? v ?? /* @__PURE__ */ G(Ve, {
1533
+ title: x.emptyTitle,
1534
+ description: x.emptyDescription,
1535
+ action: d ? /* @__PURE__ */ G(a, {
1487
1536
  tone: "primary",
1488
1537
  type: "button",
1489
1538
  onClick: d,
1490
- icon: G,
1491
- children: S.createLineLabel
1539
+ icon: Y,
1540
+ children: x.createLineLabel
1492
1541
  }) : void 0
1493
- }) : /* @__PURE__ */ H(u, {
1542
+ }) : /* @__PURE__ */ K(u, {
1494
1543
  gap: "2xl",
1495
1544
  className: "product-quote-preview-card--body",
1496
- children: [/* @__PURE__ */ V(I, { children: e.map((e, t) => {
1545
+ children: [/* @__PURE__ */ G(F, { children: e.map((e, t) => {
1497
1546
  let n = f ? () => f(e) : void 0, r = p ? () => p(e) : void 0, i = m ? () => m(e) : void 0, a = [
1498
1547
  ...n ? [{
1499
1548
  id: "open",
1500
- label: S.viewLineLabel,
1501
- icon: /* @__PURE__ */ V(xe, { className: "size-icon-md" }),
1549
+ label: x.viewLineLabel,
1550
+ icon: /* @__PURE__ */ G(xe, { className: "size-icon-md" }),
1502
1551
  onClick: () => n(),
1503
1552
  tone: "secondary",
1504
1553
  buttonStyle: "ghost"
1505
1554
  }] : [],
1506
1555
  ...r ? [{
1507
1556
  id: "edit",
1508
- label: S.editLineLabel,
1509
- icon: /* @__PURE__ */ V(W, { className: "size-icon-md" }),
1557
+ label: x.editLineLabel,
1558
+ icon: /* @__PURE__ */ G(Se, { className: "size-icon-md" }),
1510
1559
  onClick: () => r(),
1511
1560
  tone: "secondary",
1512
1561
  buttonStyle: "ghost"
1513
1562
  }] : [],
1514
1563
  ...i ? [{
1515
1564
  id: "delete",
1516
- label: S.deleteLineLabel,
1517
- icon: /* @__PURE__ */ V(J, { className: "size-icon-md" }),
1565
+ label: x.deleteLineLabel,
1566
+ icon: /* @__PURE__ */ G(X, { className: "size-icon-md" }),
1518
1567
  onClick: () => i(),
1519
1568
  tone: "destructive"
1520
1569
  }] : []
@@ -1523,55 +1572,55 @@ function pt({ lines: e = [], subtotal: t, tax: n, discount: s, total: c, onOpenQ
1523
1572
  onSelect: n,
1524
1573
  onEdit: r,
1525
1574
  onDelete: i
1526
- }) : /* @__PURE__ */ V(Ke, {
1575
+ }) : /* @__PURE__ */ G(Ye, {
1527
1576
  item: e,
1528
1577
  actions: a,
1529
- menuLabel: S.lineActionsLabel
1578
+ menuLabel: x.lineActionsLabel
1530
1579
  });
1531
- return /* @__PURE__ */ H(re, {
1580
+ return /* @__PURE__ */ K(L, {
1532
1581
  className: "product-quote-preview-card--line",
1533
- children: [/* @__PURE__ */ H(ne, { children: [
1534
- /* @__PURE__ */ V(ie, { children: e.label }),
1535
- !!e.description && /* @__PURE__ */ V(P, { children: e.description }),
1536
- !!e.quantity && /* @__PURE__ */ V(P, { children: e.quantity })
1537
- ] }), /* @__PURE__ */ H(F, { children: [/* @__PURE__ */ V(y, {
1582
+ children: [/* @__PURE__ */ K(I, { children: [
1583
+ /* @__PURE__ */ G(R, { children: e.label }),
1584
+ !!e.description && /* @__PURE__ */ G(N, { children: e.description }),
1585
+ !!e.quantity && /* @__PURE__ */ G(N, { children: e.quantity })
1586
+ ] }), /* @__PURE__ */ K(P, { children: [/* @__PURE__ */ G(S, {
1538
1587
  type: "inherit",
1539
1588
  className: "tabular-nums",
1540
1589
  children: e.amount
1541
1590
  }), o] })]
1542
1591
  }, e.id);
1543
- }) }), /* @__PURE__ */ H(u, {
1592
+ }) }), /* @__PURE__ */ K(u, {
1544
1593
  gap: "lg",
1545
1594
  className: "product-quote-preview-card--totals",
1546
1595
  children: [
1547
- !!C && /* @__PURE__ */ H(u, {
1596
+ !!C && /* @__PURE__ */ K(u, {
1548
1597
  gap: "sm",
1549
1598
  children: [
1550
- t !== void 0 && /* @__PURE__ */ V(R, {
1551
- label: S.subtotalLabel,
1599
+ t !== void 0 && /* @__PURE__ */ G(de, {
1600
+ label: x.subtotalLabel,
1552
1601
  value: t,
1553
1602
  valueClassName: "tabular-nums"
1554
1603
  }),
1555
- n !== void 0 && /* @__PURE__ */ V(R, {
1556
- label: S.taxLabel,
1604
+ n !== void 0 && /* @__PURE__ */ G(de, {
1605
+ label: x.taxLabel,
1557
1606
  value: n,
1558
1607
  valueClassName: "tabular-nums"
1559
1608
  }),
1560
- s !== void 0 && /* @__PURE__ */ V(R, {
1561
- label: S.discountLabel,
1609
+ s !== void 0 && /* @__PURE__ */ G(de, {
1610
+ label: x.discountLabel,
1562
1611
  value: s,
1563
1612
  valueClassName: "tabular-nums text-success"
1564
1613
  })
1565
1614
  ]
1566
1615
  }),
1567
- !!C && /* @__PURE__ */ V(w, {}),
1568
- /* @__PURE__ */ V(R, {
1569
- label: /* @__PURE__ */ V(o, {
1616
+ !!C && /* @__PURE__ */ G(E, {}),
1617
+ /* @__PURE__ */ G(de, {
1618
+ label: /* @__PURE__ */ G(o, {
1570
1619
  type: "inherit",
1571
1620
  tag: "span",
1572
1621
  weight: "semibold",
1573
1622
  lineHeight: "tight",
1574
- children: S.totalLabel
1623
+ children: x.totalLabel
1575
1624
  }),
1576
1625
  value: c ?? "-",
1577
1626
  valueClassName: "font-semibold tabular-nums"
@@ -1581,135 +1630,135 @@ function pt({ lines: e = [], subtotal: t, tax: n, discount: s, total: c, onOpenQ
1581
1630
  })
1582
1631
  });
1583
1632
  }
1584
- pt.displayName = "ProductQuotePreviewCard";
1633
+ gt.displayName = "ProductQuotePreviewCard";
1585
1634
  //#endregion
1586
1635
  //#region src/components/features/products/components/product-readiness-card.tsx
1587
- function mt({ items: e = [], score: t, scoreLabel: n, summary: s, onCreateReadinessItem: c, onSelectReadinessItem: l, onEditReadinessItem: d, onDeleteReadinessItem: f, renderReadinessItemActions: m, actions: h, footerSlot: g, renderItem: _, empty: v, className: y, strings: b }) {
1588
- let S = r(Ee, b), C = t === void 0 ? void 0 : Ue(t), w = c ? /* @__PURE__ */ V(a, {
1636
+ function _t({ items: e = [], score: t, scoreLabel: n, summary: s, onCreateReadinessItem: c, onSelectReadinessItem: l, onEditReadinessItem: d, onDeleteReadinessItem: f, renderReadinessItemActions: p, actions: m, footerSlot: h, renderItem: _, empty: v, className: y, strings: b }) {
1637
+ let x = r(De, b), S = t === void 0 ? void 0 : Ke(t), C = c ? /* @__PURE__ */ G(a, {
1589
1638
  type: "button",
1590
1639
  tone: "secondary",
1591
1640
  buttonStyle: "ghost",
1592
1641
  onClick: c,
1593
- icon: G,
1594
- children: S.createLabel
1642
+ icon: Y,
1643
+ children: x.createLabel
1595
1644
  }) : void 0;
1596
- return /* @__PURE__ */ H(j, {
1597
- title: S.title,
1598
- description: S.description,
1599
- actions: h,
1600
- headerAction: w,
1601
- footerSlot: g,
1645
+ return /* @__PURE__ */ K(M, {
1646
+ title: x.title,
1647
+ description: x.description,
1648
+ actions: m,
1649
+ headerAction: C,
1650
+ footerSlot: h,
1602
1651
  contentGap: "2xl",
1603
1652
  className: i("product-readiness-card--component w-full", y),
1604
- children: [(C !== void 0 || !!s) && /* @__PURE__ */ H(u, {
1653
+ children: [(S !== void 0 || !!s) && /* @__PURE__ */ K(u, {
1605
1654
  gap: "lg",
1606
1655
  className: "product-readiness-card--summary",
1607
- children: [C !== void 0 && /* @__PURE__ */ H(u, {
1656
+ children: [S !== void 0 && /* @__PURE__ */ K(u, {
1608
1657
  gap: "sm",
1609
1658
  className: "product-readiness-card--score",
1610
- children: [/* @__PURE__ */ H(u, {
1659
+ children: [/* @__PURE__ */ K(u, {
1611
1660
  direction: "horizontal",
1612
1661
  justify: "between",
1613
1662
  gap: "lg",
1614
- children: [/* @__PURE__ */ V(o, {
1663
+ children: [/* @__PURE__ */ G(o, {
1615
1664
  size: "xs",
1616
1665
  type: "secondary",
1617
- children: n ?? S.scoreLabel
1618
- }), /* @__PURE__ */ V(x, {
1666
+ children: n ?? x.scoreLabel
1667
+ }), /* @__PURE__ */ G(w, {
1619
1668
  type: "inherit",
1620
- value: C,
1669
+ value: S,
1621
1670
  scaled: !0,
1622
1671
  size: "xs",
1623
1672
  weight: "semibold"
1624
1673
  })]
1625
- }), /* @__PURE__ */ V(p, {
1626
- value: C,
1627
- "aria-label": typeof n == "string" ? n : S.progressLabel,
1628
- "aria-valuetext": `${C}%`,
1674
+ }), /* @__PURE__ */ G(g, {
1675
+ value: S,
1676
+ "aria-label": typeof n == "string" ? n : x.progressLabel,
1677
+ "aria-valuetext": `${S}%`,
1629
1678
  size: "sm"
1630
1679
  })]
1631
- }), !!s && /* @__PURE__ */ V(o, {
1680
+ }), !!s && /* @__PURE__ */ G(o, {
1632
1681
  type: "secondary",
1633
1682
  children: s
1634
1683
  })]
1635
- }), e.length === 0 ? v ?? /* @__PURE__ */ V($, {
1636
- title: S.emptyTitle,
1637
- description: S.emptyDescription,
1638
- action: c ? /* @__PURE__ */ V(a, {
1684
+ }), e.length === 0 ? v ?? /* @__PURE__ */ G(Ve, {
1685
+ title: x.emptyTitle,
1686
+ description: x.emptyDescription,
1687
+ action: c ? /* @__PURE__ */ G(a, {
1639
1688
  tone: "primary",
1640
1689
  type: "button",
1641
1690
  onClick: c,
1642
- icon: G,
1643
- children: S.createLabel
1691
+ icon: Y,
1692
+ children: x.createLabel
1644
1693
  }) : void 0
1645
- }) : /* @__PURE__ */ V(I, { children: e.map((e, t) => {
1694
+ }) : /* @__PURE__ */ G(F, { children: e.map((e, t) => {
1646
1695
  let n = l ? () => l(e) : void 0, r = d ? () => d(e) : void 0, i = f ? () => f(e) : void 0, a = [...r ? [{
1647
1696
  id: "edit",
1648
- label: S.editLabel,
1649
- icon: /* @__PURE__ */ V(W, { className: "size-icon-md" }),
1697
+ label: x.editLabel,
1698
+ icon: /* @__PURE__ */ G(Se, { className: "size-icon-md" }),
1650
1699
  onClick: () => r(),
1651
1700
  tone: "secondary",
1652
1701
  buttonStyle: "ghost"
1653
1702
  }] : [], ...i ? [{
1654
1703
  id: "delete",
1655
- label: S.deleteLabel,
1656
- icon: /* @__PURE__ */ V(J, { className: "size-icon-md" }),
1704
+ label: x.deleteLabel,
1705
+ icon: /* @__PURE__ */ G(X, { className: "size-icon-md" }),
1657
1706
  onClick: () => i(),
1658
1707
  tone: "destructive"
1659
- }] : []], o = m ? m(e, {
1708
+ }] : []], o = p ? p(e, {
1660
1709
  index: t,
1661
1710
  onSelect: n,
1662
1711
  onEdit: r,
1663
1712
  onDelete: i
1664
- }) : /* @__PURE__ */ V(Ke, {
1713
+ }) : /* @__PURE__ */ G(Ye, {
1665
1714
  item: e,
1666
1715
  actions: a,
1667
- menuLabel: S.actionsLabel
1716
+ menuLabel: x.actionsLabel
1668
1717
  });
1669
- return _ ? /* @__PURE__ */ V("div", { children: _(e, t) }, e.id) : /* @__PURE__ */ V($e, {
1718
+ return _ ? /* @__PURE__ */ G("div", { children: _(e, t) }, e.id) : /* @__PURE__ */ G(nt, {
1670
1719
  item: e,
1671
- actionFallback: S.actionLabel,
1720
+ actionFallback: x.actionLabel,
1672
1721
  onSelect: n,
1673
1722
  actions: o
1674
1723
  }, e.id);
1675
1724
  }) })]
1676
1725
  });
1677
1726
  }
1678
- mt.displayName = "ProductReadinessCard";
1727
+ _t.displayName = "ProductReadinessCard";
1679
1728
  //#endregion
1680
1729
  //#region src/components/features/products/components/product-structure-card.tsx
1681
- function ht({ metrics: e = [], onCreateMetric: t, onSelectMetric: n, onEditMetric: o, onDeleteMetric: s, renderMetricActions: c, actions: l, footerSlot: u, empty: d, className: f, strings: p }) {
1682
- let m = r(De, p), h = t ? /* @__PURE__ */ V(a, {
1730
+ function vt({ metrics: e = [], onCreateMetric: t, onSelectMetric: n, onEditMetric: o, onDeleteMetric: s, renderMetricActions: c, actions: l, footerSlot: u, empty: d, className: f, strings: p }) {
1731
+ let m = r(Z, p), h = t ? /* @__PURE__ */ G(a, {
1683
1732
  type: "button",
1684
1733
  tone: "secondary",
1685
1734
  buttonStyle: "ghost",
1686
1735
  onClick: t,
1687
- icon: G,
1736
+ icon: Y,
1688
1737
  children: m.createLabel
1689
1738
  }) : void 0;
1690
- return /* @__PURE__ */ V(j, {
1739
+ return /* @__PURE__ */ G(M, {
1691
1740
  title: m.title,
1692
1741
  description: m.description,
1693
1742
  actions: l,
1694
1743
  headerAction: h,
1695
1744
  footerSlot: u,
1696
1745
  className: i("product-structure-card--component w-full", f),
1697
- children: e.length === 0 ? d ?? /* @__PURE__ */ V($, {
1746
+ children: e.length === 0 ? d ?? /* @__PURE__ */ G(Ve, {
1698
1747
  title: m.emptyTitle,
1699
1748
  description: m.emptyDescription,
1700
- action: t ? /* @__PURE__ */ V(a, {
1749
+ action: t ? /* @__PURE__ */ G(a, {
1701
1750
  tone: "primary",
1702
1751
  type: "button",
1703
1752
  onClick: t,
1704
- icon: G,
1753
+ icon: Y,
1705
1754
  children: m.createLabel
1706
1755
  }) : void 0
1707
- }) : /* @__PURE__ */ V(I, { children: e.map((e, t) => {
1756
+ }) : /* @__PURE__ */ G(F, { children: e.map((e, t) => {
1708
1757
  let r = n ? () => n(e) : void 0, i = o ? () => o(e) : void 0, a = s ? () => s(e) : void 0, l = [
1709
1758
  ...r ? [{
1710
1759
  id: "open",
1711
1760
  label: m.viewLabel,
1712
- icon: /* @__PURE__ */ V(xe, { className: "size-icon-md" }),
1761
+ icon: /* @__PURE__ */ G(xe, { className: "size-icon-md" }),
1713
1762
  onClick: () => r(),
1714
1763
  tone: "secondary",
1715
1764
  buttonStyle: "ghost"
@@ -1717,7 +1766,7 @@ function ht({ metrics: e = [], onCreateMetric: t, onSelectMetric: n, onEditMetri
1717
1766
  ...i ? [{
1718
1767
  id: "edit",
1719
1768
  label: m.editLabel,
1720
- icon: /* @__PURE__ */ V(W, { className: "size-icon-md" }),
1769
+ icon: /* @__PURE__ */ G(Se, { className: "size-icon-md" }),
1721
1770
  onClick: () => i(),
1722
1771
  tone: "secondary",
1723
1772
  buttonStyle: "ghost"
@@ -1725,7 +1774,7 @@ function ht({ metrics: e = [], onCreateMetric: t, onSelectMetric: n, onEditMetri
1725
1774
  ...a ? [{
1726
1775
  id: "delete",
1727
1776
  label: m.deleteLabel,
1728
- icon: /* @__PURE__ */ V(J, { className: "size-icon-md" }),
1777
+ icon: /* @__PURE__ */ G(X, { className: "size-icon-md" }),
1729
1778
  onClick: () => a(),
1730
1779
  tone: "destructive"
1731
1780
  }] : []
@@ -1734,51 +1783,51 @@ function ht({ metrics: e = [], onCreateMetric: t, onSelectMetric: n, onEditMetri
1734
1783
  onSelect: r,
1735
1784
  onEdit: i,
1736
1785
  onDelete: a
1737
- }) : /* @__PURE__ */ V(Ke, {
1786
+ }) : /* @__PURE__ */ G(Ye, {
1738
1787
  item: e,
1739
1788
  actions: l,
1740
1789
  menuLabel: m.actionsLabel
1741
1790
  });
1742
- return /* @__PURE__ */ V(Qe, {
1791
+ return /* @__PURE__ */ G(tt, {
1743
1792
  metric: e,
1744
1793
  actions: u
1745
1794
  }, e.id);
1746
1795
  }) })
1747
1796
  });
1748
1797
  }
1749
- ht.displayName = "ProductStructureCard";
1798
+ vt.displayName = "ProductStructureCard";
1750
1799
  //#endregion
1751
1800
  //#region src/components/features/products/components/product-variants-table.tsx
1752
- function gt({ variant: e, channelsLabel: t }) {
1753
- return /* @__PURE__ */ H(u, {
1801
+ function yt({ variant: e, channelsLabel: t }) {
1802
+ return /* @__PURE__ */ K(u, {
1754
1803
  gap: "xs",
1755
1804
  className: "product-variants-table--variant-cell min-w-0",
1756
- children: [/* @__PURE__ */ H(u, {
1805
+ children: [/* @__PURE__ */ K(u, {
1757
1806
  gap: "dense",
1758
- children: [/* @__PURE__ */ H(u, {
1807
+ children: [/* @__PURE__ */ K(u, {
1759
1808
  direction: "horizontal",
1760
1809
  gap: "sm",
1761
- children: [/* @__PURE__ */ V(o, {
1810
+ children: [/* @__PURE__ */ G(o, {
1762
1811
  type: "inherit",
1763
1812
  weight: "semibold",
1764
1813
  className: "truncate",
1765
1814
  children: e.name
1766
- }), !!e.status && /* @__PURE__ */ V(S, {
1815
+ }), !!e.status && /* @__PURE__ */ G(ee, {
1767
1816
  tone: e.statusTone ?? "secondary",
1768
1817
  children: e.status
1769
1818
  })]
1770
- }), !!e.description && /* @__PURE__ */ V(o, {
1819
+ }), !!e.description && /* @__PURE__ */ G(o, {
1771
1820
  size: "xs",
1772
1821
  type: "secondary",
1773
1822
  children: e.description
1774
1823
  })]
1775
- }), !!(e.options?.length || e.channels) && /* @__PURE__ */ H(u, {
1824
+ }), !!(e.options?.length || e.channels) && /* @__PURE__ */ K(u, {
1776
1825
  direction: "horizontal",
1777
1826
  gap: "xs",
1778
- children: [e.options?.map((e, t) => /* @__PURE__ */ V(S, {
1827
+ children: [e.options?.map((e, t) => /* @__PURE__ */ G(ee, {
1779
1828
  tone: "secondary",
1780
1829
  children: e
1781
- }, t)), !!e.channels && /* @__PURE__ */ H(o, {
1830
+ }, t)), !!e.channels && /* @__PURE__ */ K(o, {
1782
1831
  tag: "span",
1783
1832
  size: "xs",
1784
1833
  type: "secondary",
@@ -1791,22 +1840,22 @@ function gt({ variant: e, channelsLabel: t }) {
1791
1840
  })]
1792
1841
  });
1793
1842
  }
1794
- function _t({ value: e, emphasis: t = !1 }) {
1795
- return /* @__PURE__ */ V(e ? y : b, {
1843
+ function bt({ value: e, emphasis: t = !1 }) {
1844
+ return /* @__PURE__ */ G(e ? S : C, {
1796
1845
  type: e ? "inherit" : "secondary",
1797
1846
  weight: t ? "semibold" : void 0,
1798
1847
  className: "min-w-0 tabular-nums",
1799
1848
  children: e ?? "-"
1800
1849
  });
1801
1850
  }
1802
- function vt({ variants: e = [], onCreateVariant: t, onSelectVariant: n, onEditVariant: o, onDuplicateVariant: s, onDeleteVariant: c, renderVariantActions: l, actions: u, footerSlot: d, empty: f, className: p, strings: m }) {
1803
- let h = r(Me, m), g = B(() => {
1851
+ function xt({ variants: e = [], onCreateVariant: t, onSelectVariant: n, onEditVariant: o, onDuplicateVariant: s, onDeleteVariant: c, renderVariantActions: l, actions: u, footerSlot: d, empty: f, className: p, strings: m }) {
1852
+ let h = r(Fe, m), g = W(() => {
1804
1853
  if (l) return;
1805
1854
  let e = [
1806
1855
  ...n ? [{
1807
1856
  id: "open",
1808
1857
  label: h.viewLabel,
1809
- icon: /* @__PURE__ */ V(xe, {
1858
+ icon: /* @__PURE__ */ G(xe, {
1810
1859
  className: "size-icon-sm",
1811
1860
  "aria-hidden": "true"
1812
1861
  }),
@@ -1816,7 +1865,7 @@ function vt({ variants: e = [], onCreateVariant: t, onSelectVariant: n, onEditVa
1816
1865
  ...o ? [{
1817
1866
  id: "edit",
1818
1867
  label: h.editLabel,
1819
- icon: /* @__PURE__ */ V(W, {
1868
+ icon: /* @__PURE__ */ G(Se, {
1820
1869
  className: "size-icon-sm",
1821
1870
  "aria-hidden": "true"
1822
1871
  }),
@@ -1826,7 +1875,7 @@ function vt({ variants: e = [], onCreateVariant: t, onSelectVariant: n, onEditVa
1826
1875
  ...s ? [{
1827
1876
  id: "duplicate",
1828
1877
  label: h.duplicateLabel,
1829
- icon: /* @__PURE__ */ V(be, {
1878
+ icon: /* @__PURE__ */ G(be, {
1830
1879
  className: "size-icon-sm",
1831
1880
  "aria-hidden": "true"
1832
1881
  }),
@@ -1836,7 +1885,7 @@ function vt({ variants: e = [], onCreateVariant: t, onSelectVariant: n, onEditVa
1836
1885
  ...c ? [{
1837
1886
  id: "delete",
1838
1887
  label: h.deleteLabel,
1839
- icon: /* @__PURE__ */ V(J, {
1888
+ icon: /* @__PURE__ */ G(X, {
1840
1889
  className: "size-icon-sm",
1841
1890
  "aria-hidden": "true"
1842
1891
  }),
@@ -1855,12 +1904,12 @@ function vt({ variants: e = [], onCreateVariant: t, onSelectVariant: n, onEditVa
1855
1904
  h.duplicateLabel,
1856
1905
  h.editLabel,
1857
1906
  h.viewLabel
1858
- ]), _ = B(() => {
1907
+ ]), _ = W(() => {
1859
1908
  let e = [
1860
1909
  {
1861
1910
  accessorKey: "name",
1862
1911
  header: h.headers.variant,
1863
- cell: ({ row: e }) => /* @__PURE__ */ V(gt, {
1912
+ cell: ({ row: e }) => /* @__PURE__ */ G(yt, {
1864
1913
  variant: e.original,
1865
1914
  channelsLabel: h.headers.channels
1866
1915
  })
@@ -1868,7 +1917,7 @@ function vt({ variants: e = [], onCreateVariant: t, onSelectVariant: n, onEditVa
1868
1917
  {
1869
1918
  accessorKey: "price",
1870
1919
  header: h.headers.price,
1871
- cell: ({ row: e }) => /* @__PURE__ */ V(_t, {
1920
+ cell: ({ row: e }) => /* @__PURE__ */ G(bt, {
1872
1921
  value: e.original.price,
1873
1922
  emphasis: !0
1874
1923
  }),
@@ -1877,17 +1926,17 @@ function vt({ variants: e = [], onCreateVariant: t, onSelectVariant: n, onEditVa
1877
1926
  {
1878
1927
  accessorKey: "inventory",
1879
1928
  header: h.headers.inventory,
1880
- cell: ({ row: e }) => /* @__PURE__ */ V(_t, { value: e.original.inventory })
1929
+ cell: ({ row: e }) => /* @__PURE__ */ G(bt, { value: e.original.inventory })
1881
1930
  },
1882
1931
  {
1883
1932
  accessorKey: "sku",
1884
1933
  header: h.headers.sku,
1885
- cell: ({ row: e }) => /* @__PURE__ */ V(_t, { value: e.original.sku })
1934
+ cell: ({ row: e }) => /* @__PURE__ */ G(bt, { value: e.original.sku })
1886
1935
  },
1887
1936
  {
1888
1937
  accessorKey: "updatedAt",
1889
1938
  header: h.headers.updated,
1890
- cell: ({ row: e }) => /* @__PURE__ */ V(_t, { value: e.original.updatedAt })
1939
+ cell: ({ row: e }) => /* @__PURE__ */ G(bt, { value: e.original.updatedAt })
1891
1940
  }
1892
1941
  ];
1893
1942
  return l && e.push({
@@ -1915,32 +1964,32 @@ function vt({ variants: e = [], onCreateVariant: t, onSelectVariant: n, onEditVa
1915
1964
  h.headers.sku,
1916
1965
  h.headers.updated,
1917
1966
  h.headers.variant
1918
- ]), v = t ? /* @__PURE__ */ V(a, {
1967
+ ]), v = t ? /* @__PURE__ */ G(a, {
1919
1968
  type: "button",
1920
1969
  tone: "secondary",
1921
1970
  buttonStyle: "ghost",
1922
1971
  onClick: t,
1923
- icon: G,
1972
+ icon: Y,
1924
1973
  children: h.createLabel
1925
1974
  }) : void 0;
1926
- return /* @__PURE__ */ V(j, {
1975
+ return /* @__PURE__ */ G(M, {
1927
1976
  title: h.title,
1928
1977
  description: h.description,
1929
1978
  actions: u,
1930
1979
  headerAction: v,
1931
1980
  footerSlot: d,
1932
1981
  className: i("product-variants-table--component w-full", p),
1933
- children: e.length === 0 ? f ?? /* @__PURE__ */ V($, {
1982
+ children: e.length === 0 ? f ?? /* @__PURE__ */ G(Ve, {
1934
1983
  title: h.emptyTitle,
1935
1984
  description: h.emptyDescription,
1936
- action: t ? /* @__PURE__ */ V(a, {
1985
+ action: t ? /* @__PURE__ */ G(a, {
1937
1986
  tone: "primary",
1938
1987
  type: "button",
1939
1988
  onClick: t,
1940
- icon: G,
1989
+ icon: Y,
1941
1990
  children: h.createLabel
1942
1991
  }) : void 0
1943
- }) : /* @__PURE__ */ V(pe, {
1992
+ }) : /* @__PURE__ */ G(fe, {
1944
1993
  data: e,
1945
1994
  columns: _,
1946
1995
  getRowId: (e) => e.id,
@@ -1957,43 +2006,43 @@ function vt({ variants: e = [], onCreateVariant: t, onSelectVariant: n, onEditVa
1957
2006
  })
1958
2007
  });
1959
2008
  }
1960
- vt.displayName = "ProductVariantsTable";
2009
+ xt.displayName = "ProductVariantsTable";
1961
2010
  //#endregion
1962
2011
  //#region src/components/features/products/components/product-overview.tsx
1963
- function yt({ details: e, contract: t, options: n, variants: a, readiness: o, structure: s, operations: c, quote: l, policies: d, slots: f, className: p, mainClassName: m, railClassName: h, strings: g }) {
1964
- let _ = r(Re, g), v = !!(o || s || c || l || d || f?.railTop || f?.railBottom);
1965
- return /* @__PURE__ */ H(u, {
2012
+ function St({ details: e, contract: t, options: n, variants: a, readiness: o, structure: s, operations: c, quote: l, policies: d, slots: f, className: p, mainClassName: m, railClassName: h, strings: g }) {
2013
+ let _ = r(Be, g), v = !!(o || s || c || l || d || f?.railTop || f?.railBottom);
2014
+ return /* @__PURE__ */ K(u, {
1966
2015
  gap: "3xl",
1967
2016
  className: i("product-overview--component @container/product-overview", p),
1968
2017
  children: [
1969
2018
  f?.before,
1970
- /* @__PURE__ */ H("div", {
2019
+ /* @__PURE__ */ K("div", {
1971
2020
  className: i("grid min-w-0 grid-cols-1 gap-space-3xl", v && "@5xl/product-overview:grid-cols-[minmax(0,1fr)_22rem]"),
1972
- children: [/* @__PURE__ */ H(u, {
1973
- render: /* @__PURE__ */ V("section", {}),
2021
+ children: [/* @__PURE__ */ K(u, {
2022
+ render: /* @__PURE__ */ G("section", {}),
1974
2023
  gap: "3xl",
1975
2024
  "aria-label": _.mainLabel,
1976
2025
  className: i("product-overview--main", m),
1977
2026
  children: [
1978
2027
  f?.mainTop,
1979
- !!e && /* @__PURE__ */ V(rt, { ...e }),
1980
- !!t && /* @__PURE__ */ V(nt, { ...t }),
1981
- !!n && /* @__PURE__ */ V(dt, { ...n }),
1982
- !!a && /* @__PURE__ */ V(vt, { ...a }),
2028
+ !!e && /* @__PURE__ */ G(ot, { ...e }),
2029
+ !!t && /* @__PURE__ */ G(at, { ...t }),
2030
+ !!n && /* @__PURE__ */ G(mt, { ...n }),
2031
+ !!a && /* @__PURE__ */ G(xt, { ...a }),
1983
2032
  f?.mainBottom
1984
2033
  ]
1985
- }), !!v && /* @__PURE__ */ H(u, {
1986
- render: /* @__PURE__ */ V("aside", {}),
2034
+ }), !!v && /* @__PURE__ */ K(u, {
2035
+ render: /* @__PURE__ */ G("aside", {}),
1987
2036
  gap: "3xl",
1988
2037
  "aria-label": _.railLabel,
1989
2038
  className: i("product-overview--rail", h),
1990
2039
  children: [
1991
2040
  f?.railTop,
1992
- !!o && /* @__PURE__ */ V(mt, { ...o }),
1993
- !!s && /* @__PURE__ */ V(ht, { ...s }),
1994
- !!c && /* @__PURE__ */ V(at, { ...c }),
1995
- !!l && /* @__PURE__ */ V(pt, { ...l }),
1996
- !!d && /* @__PURE__ */ V(ft, { ...d }),
2041
+ !!o && /* @__PURE__ */ G(_t, { ...o }),
2042
+ !!s && /* @__PURE__ */ G(vt, { ...s }),
2043
+ !!c && /* @__PURE__ */ G(ct, { ...c }),
2044
+ !!l && /* @__PURE__ */ G(gt, { ...l }),
2045
+ !!d && /* @__PURE__ */ G(ht, { ...d }),
1997
2046
  f?.railBottom
1998
2047
  ]
1999
2048
  })]
@@ -2002,15 +2051,15 @@ function yt({ details: e, contract: t, options: n, variants: a, readiness: o, st
2002
2051
  ]
2003
2052
  });
2004
2053
  }
2005
- yt.displayName = "ProductOverview";
2054
+ St.displayName = "ProductOverview";
2006
2055
  //#endregion
2007
2056
  //#region src/components/features/products/components/product-variant-action-menu.tsx
2008
- function bt(e, { onSelectVariant: t, onEditVariant: n, onDuplicateVariant: r, onDeleteVariant: i }, a) {
2057
+ function Ct(e, { onSelectVariant: t, onEditVariant: n, onDuplicateVariant: r, onDeleteVariant: i }, a) {
2009
2058
  return [
2010
2059
  ...t ? [{
2011
2060
  id: "open",
2012
2061
  label: a.viewLabel,
2013
- icon: /* @__PURE__ */ V(xe, { className: "size-icon-md" }),
2062
+ icon: /* @__PURE__ */ G(xe, { className: "size-icon-md" }),
2014
2063
  onClick: () => t(e),
2015
2064
  tone: "secondary",
2016
2065
  buttonStyle: "ghost"
@@ -2018,7 +2067,7 @@ function bt(e, { onSelectVariant: t, onEditVariant: n, onDuplicateVariant: r, on
2018
2067
  ...n ? [{
2019
2068
  id: "edit",
2020
2069
  label: a.editLabel,
2021
- icon: /* @__PURE__ */ V(W, { className: "size-icon-md" }),
2070
+ icon: /* @__PURE__ */ G(Se, { className: "size-icon-md" }),
2022
2071
  onClick: () => n(e),
2023
2072
  tone: "secondary",
2024
2073
  buttonStyle: "ghost"
@@ -2026,7 +2075,7 @@ function bt(e, { onSelectVariant: t, onEditVariant: n, onDuplicateVariant: r, on
2026
2075
  ...r ? [{
2027
2076
  id: "duplicate",
2028
2077
  label: a.duplicateLabel,
2029
- icon: /* @__PURE__ */ V(be, { className: "size-icon-md" }),
2078
+ icon: /* @__PURE__ */ G(be, { className: "size-icon-md" }),
2030
2079
  onClick: () => r(e),
2031
2080
  tone: "secondary",
2032
2081
  buttonStyle: "ghost"
@@ -2034,15 +2083,15 @@ function bt(e, { onSelectVariant: t, onEditVariant: n, onDuplicateVariant: r, on
2034
2083
  ...i ? [{
2035
2084
  id: "delete",
2036
2085
  label: a.deleteLabel,
2037
- icon: /* @__PURE__ */ V(J, { className: "size-icon-md" }),
2086
+ icon: /* @__PURE__ */ G(X, { className: "size-icon-md" }),
2038
2087
  onClick: () => i(e),
2039
2088
  tone: "destructive"
2040
2089
  }] : []
2041
2090
  ];
2042
2091
  }
2043
- function xt({ variant: e, index: t = 0, onSelectVariant: n, onEditVariant: a, onDuplicateVariant: o, onDeleteVariant: s, renderVariantActions: c, menuLabel: l, className: u, strings: d }) {
2044
- let f = r(Fe, d), p = n ? () => n(e) : void 0, m = a ? () => a(e) : void 0, h = o ? () => o(e) : void 0, g = s ? () => s(e) : void 0;
2045
- return p || m || h || g || c ? c ? /* @__PURE__ */ V("div", {
2092
+ function wt({ variant: e, index: t = 0, onSelectVariant: n, onEditVariant: a, onDuplicateVariant: o, onDeleteVariant: s, renderVariantActions: c, menuLabel: l, className: u, strings: d }) {
2093
+ let f = r(Le, d), p = n ? () => n(e) : void 0, m = a ? () => a(e) : void 0, h = o ? () => o(e) : void 0, g = s ? () => s(e) : void 0;
2094
+ return p || m || h || g || c ? c ? /* @__PURE__ */ G("div", {
2046
2095
  className: i("product-variant-action-menu--component flex justify-end", u),
2047
2096
  children: c(e, {
2048
2097
  index: t,
@@ -2051,11 +2100,11 @@ function xt({ variant: e, index: t = 0, onSelectVariant: n, onEditVariant: a, on
2051
2100
  onDuplicate: h,
2052
2101
  onDelete: g
2053
2102
  })
2054
- }) : /* @__PURE__ */ V(Ke, {
2103
+ }) : /* @__PURE__ */ G(Ye, {
2055
2104
  item: e,
2056
2105
  menuLabel: l ?? f.actionsLabel,
2057
2106
  className: i("product-variant-action-menu--component", u),
2058
- actions: bt(e, {
2107
+ actions: Ct(e, {
2059
2108
  onSelectVariant: n,
2060
2109
  onEditVariant: a,
2061
2110
  onDuplicateVariant: o,
@@ -2066,11 +2115,11 @@ function xt({ variant: e, index: t = 0, onSelectVariant: n, onEditVariant: a, on
2066
2115
  }))
2067
2116
  }) : null;
2068
2117
  }
2069
- xt.displayName = "ProductVariantActionMenu";
2118
+ wt.displayName = "ProductVariantActionMenu";
2070
2119
  //#endregion
2071
2120
  //#region src/components/features/products/components/product-variant-details.tsx
2072
- var St = (e) => e != null && e !== !1 && e !== "";
2073
- function Ct(e, t) {
2121
+ var Tt = (e) => e != null && e !== !1 && e !== "";
2122
+ function Et(e, t) {
2074
2123
  return [
2075
2124
  {
2076
2125
  label: t.price,
@@ -2092,24 +2141,24 @@ function Ct(e, t) {
2092
2141
  label: t.updated,
2093
2142
  value: e.updatedAt
2094
2143
  }
2095
- ].filter((e) => St(e.value));
2144
+ ].filter((e) => Tt(e.value));
2096
2145
  }
2097
- function wt({ variant: e, metadata: t, optionItems: n = [], media: s, onBack: c, onSelectVariant: l, onEditVariant: d, onDuplicateVariant: f, onDeleteVariant: p, onSelectOption: m, actions: g, headerEnd: _, footerSlot: v, empty: y, renderActions: b, renderMetadata: x, renderOption: C, className: w, strings: T }) {
2098
- let E = r(Ie, T), D = e ? t ?? Ct(e, E.metadata) : [], O = [...e && !b ? bt(e, {
2146
+ function Dt({ variant: e, metadata: t, optionItems: n = [], media: s, onBack: c, onSelectVariant: l, onEditVariant: d, onDuplicateVariant: f, onDeleteVariant: p, onSelectOption: m, actions: h, headerEnd: g, footerSlot: _, empty: y, renderActions: b, renderMetadata: x, renderOption: S, className: C, strings: w }) {
2147
+ let T = r(Re, w), E = e ? t ?? Et(e, T.metadata) : [], D = [...e && !b ? Ct(e, {
2099
2148
  onSelectVariant: l,
2100
2149
  onEditVariant: d,
2101
2150
  onDuplicateVariant: f,
2102
2151
  onDeleteVariant: p
2103
- }, Fe) : [], ...g ?? []], ee = !!(e && b), k = /* @__PURE__ */ H("div", {
2104
- className: i("product-variant-details--header-actions flex items-center", h.commands),
2105
- children: [!!c && /* @__PURE__ */ V(a, {
2152
+ }, Le) : [], ...h ?? []], O = !!(e && b), k = /* @__PURE__ */ K("div", {
2153
+ className: i("product-variant-details--header-actions flex items-center", v.commands),
2154
+ children: [!!c && /* @__PURE__ */ G(a, {
2106
2155
  type: "button",
2107
2156
  tone: "secondary",
2108
2157
  buttonStyle: "ghost",
2109
2158
  onClick: c,
2110
- icon: U,
2111
- children: E.backLabel
2112
- }), !!ee && e && /* @__PURE__ */ V(xt, {
2159
+ icon: ye,
2160
+ children: T.backLabel
2161
+ }), !!O && e && /* @__PURE__ */ G(wt, {
2113
2162
  variant: e,
2114
2163
  onSelectVariant: l,
2115
2164
  onEditVariant: d,
@@ -2118,189 +2167,195 @@ function wt({ variant: e, metadata: t, optionItems: n = [], media: s, onBack: c,
2118
2167
  renderVariantActions: b
2119
2168
  })]
2120
2169
  }), A = e?.options ?? [];
2121
- return /* @__PURE__ */ V(j, {
2122
- title: e?.name ?? E.title,
2123
- titleSuffix: e?.status ? /* @__PURE__ */ V(S, {
2170
+ return /* @__PURE__ */ G(M, {
2171
+ title: e?.name ?? T.title,
2172
+ titleSuffix: e?.status ? /* @__PURE__ */ G(ee, {
2124
2173
  tone: e.statusTone ?? "secondary",
2125
2174
  children: e.status
2126
2175
  }) : void 0,
2127
- description: e?.description ?? E.description,
2128
- actions: O.length ? O : void 0,
2129
- headerAction: c || ee ? k : void 0,
2130
- headerEnd: _,
2131
- footerSlot: v,
2132
- className: i("product-variant-details--component w-full", w),
2133
- children: e ? /* @__PURE__ */ H(u, {
2176
+ description: e?.description ?? T.description,
2177
+ actions: D.length ? D : void 0,
2178
+ headerAction: c || O ? k : void 0,
2179
+ headerEnd: g,
2180
+ footerSlot: _,
2181
+ className: i("product-variant-details--component w-full", C),
2182
+ children: e ? /* @__PURE__ */ K(u, {
2134
2183
  gap: "2xl",
2135
2184
  className: "product-variant-details--body",
2136
2185
  children: [
2137
- !!s && /* @__PURE__ */ V("div", {
2138
- className: "product-variant-details--media overflow-hidden rounded-inner border border-border bg-muted/30",
2186
+ !!s && /* @__PURE__ */ G("div", {
2187
+ className: "product-variant-details--media overflow-hidden rounded-radius border border-border bg-muted/30",
2139
2188
  children: s
2140
2189
  }),
2141
- x ? x(e) : D.some(Boolean) && /* @__PURE__ */ H(u, {
2190
+ x ? x(e) : E.some(Boolean) && /* @__PURE__ */ K(u, {
2142
2191
  gap: "md",
2143
2192
  className: "product-variant-details--facts",
2144
- children: [/* @__PURE__ */ V(o, {
2193
+ children: [/* @__PURE__ */ G(o, {
2145
2194
  type: "inherit",
2146
2195
  weight: "semibold",
2147
- children: E.factsTitle
2148
- }), /* @__PURE__ */ V(ae, {
2196
+ children: T.factsTitle
2197
+ }), /* @__PURE__ */ G(z, {
2149
2198
  adaptTo: "container",
2150
- items: D,
2199
+ items: E,
2151
2200
  columns: 3,
2152
2201
  density: "compact",
2153
2202
  className: "product-variant-details--metadata"
2154
2203
  })]
2155
2204
  }),
2156
- !!A.length && /* @__PURE__ */ H(u, {
2205
+ !!A.length && /* @__PURE__ */ K(u, {
2157
2206
  gap: "md",
2158
2207
  className: "product-variant-details--selected-options",
2159
- children: [/* @__PURE__ */ V(o, {
2208
+ children: [/* @__PURE__ */ G(o, {
2160
2209
  type: "inherit",
2161
2210
  weight: "semibold",
2162
- children: E.selectedOptionsTitle
2163
- }), /* @__PURE__ */ V("div", {
2211
+ children: T.selectedOptionsTitle
2212
+ }), /* @__PURE__ */ G("div", {
2164
2213
  className: "flex flex-wrap gap-space-sm",
2165
- children: A.map((e, t) => /* @__PURE__ */ V(S, {
2214
+ children: A.map((e, t) => /* @__PURE__ */ G(ee, {
2166
2215
  tone: "secondary",
2167
2216
  children: e
2168
2217
  }, t))
2169
2218
  })]
2170
2219
  }),
2171
- !!n.length && /* @__PURE__ */ H(u, {
2220
+ !!n.length && /* @__PURE__ */ K(u, {
2172
2221
  gap: "md",
2173
2222
  className: "product-variant-details--related-options",
2174
- children: [/* @__PURE__ */ V(o, {
2223
+ children: [/* @__PURE__ */ G(o, {
2175
2224
  type: "inherit",
2176
2225
  weight: "semibold",
2177
- children: E.relatedOptionsTitle
2178
- }), /* @__PURE__ */ V(I, { children: n.map((e, t) => C ? /* @__PURE__ */ V("div", { children: C(e, t) }, e.id) : /* @__PURE__ */ V(tt, {
2226
+ children: T.relatedOptionsTitle
2227
+ }), /* @__PURE__ */ G(F, { children: n.map((e, t) => S ? /* @__PURE__ */ G("div", { children: S(e, t) }, e.id) : /* @__PURE__ */ G(it, {
2179
2228
  item: e,
2180
- actionLabel: E.viewOptionLabel,
2229
+ actionLabel: T.viewOptionLabel,
2181
2230
  onSelect: m ? () => m(e) : void 0
2182
2231
  }, e.id)) })]
2183
2232
  })
2184
2233
  ]
2185
- }) : y ?? /* @__PURE__ */ V($, {
2186
- title: E.emptyTitle,
2187
- description: E.emptyDescription
2234
+ }) : y ?? /* @__PURE__ */ G(Ve, {
2235
+ title: T.emptyTitle,
2236
+ description: T.emptyDescription
2188
2237
  })
2189
2238
  });
2190
2239
  }
2191
- wt.displayName = "ProductVariantDetails";
2240
+ Dt.displayName = "ProductVariantDetails";
2192
2241
  //#endregion
2193
2242
  //#region src/components/features/products/components/product-variant-editor.tsx
2194
- var Tt = (e) => e.map((e) => ({
2243
+ var Ot = (e) => e.map((e) => ({
2195
2244
  value: e.value,
2196
2245
  label: e.label,
2197
2246
  disabled: e.disabled
2198
2247
  }));
2199
- function Et({ value: e, defaultValue: t, optionFields: n = [], statusOptions: s = [], onValueChange: c, onSubmit: l, onError: d, onCancel: f, onDelete: p, actions: m, headerEnd: h, footerSlot: g, disabled: _ = !1, submitting: v = !1, className: y, strings: b }) {
2200
- let x = r(Le, b), S = he(), C = e !== void 0, [w, T] = _e(t ?? {}), [ee, A] = _e(!1), M = (C ? e : w) ?? {}, te = v || ee, N = _ || te, P = (e) => {
2201
- C || T(e), c?.(e);
2202
- }, F = (e, t) => {
2203
- P({
2204
- ...M,
2248
+ function kt({ value: e, defaultValue: t, optionFields: n = [], statusOptions: s = [], onValueChange: c, onSubmit: l, onError: d, onCancel: f, onDelete: p, actions: m, headerEnd: h, footerSlot: g, visibleFields: _, errors: v, formId: y, showHeader: b = !0, children: x, disabled: S = !1, submitting: C = !1, className: w, strings: ee }) {
2249
+ let T = r(ze, ee), E = he(), D = y ?? E, te = e !== void 0, [ne, re] = _e(t ?? {}), [ie, ae] = _e(!1), N = (te ? e : ne) ?? {}, P = C || ie, F = S || P, I = (e) => _?.[e] !== !1, L = I("name") || I("sku") || I("description"), R = I("price") || I("inventory") || I("status") || I("channels"), z = (e) => {
2250
+ te || re(e), c?.(e);
2251
+ }, B = (e, t) => {
2252
+ z({
2253
+ ...N,
2205
2254
  [e]: t
2206
2255
  });
2207
- }, I = (e, t) => {
2208
- P({
2209
- ...M,
2256
+ }, oe = (e, t) => {
2257
+ z({
2258
+ ...N,
2210
2259
  options: {
2211
- ...M.options,
2260
+ ...N.options,
2212
2261
  [e.id]: t
2213
2262
  }
2214
2263
  });
2215
- }, ne = async (e) => {
2216
- if (e.preventDefault(), l && !te) {
2217
- A(!0);
2264
+ }, se = async (e) => {
2265
+ if (e.preventDefault(), l && !P) {
2266
+ ae(!0);
2218
2267
  try {
2219
- await l(M);
2268
+ await l(N);
2220
2269
  } catch (e) {
2221
2270
  d?.(e);
2222
2271
  } finally {
2223
- A(!1);
2272
+ ae(!1);
2224
2273
  }
2225
2274
  }
2226
- }, re = /* @__PURE__ */ H("div", {
2275
+ }, ce = /* @__PURE__ */ K("div", {
2227
2276
  className: "product-variant-editor--footer flex flex-col-reverse gap-space-md @sm/product-variant-editor:flex-row @sm/product-variant-editor:items-center @sm/product-variant-editor:justify-between",
2228
- children: [/* @__PURE__ */ V("div", { children: !!p && /* @__PURE__ */ V(a, {
2277
+ children: [/* @__PURE__ */ G("div", { children: !!p && /* @__PURE__ */ G(a, {
2229
2278
  type: "button",
2230
2279
  tone: "destructive",
2231
2280
  buttonStyle: "ghost",
2232
- onClick: () => p(M),
2233
- disabled: N,
2234
- children: x.deleteLabel
2235
- }) }), /* @__PURE__ */ H("div", {
2281
+ onClick: () => p(N),
2282
+ disabled: F,
2283
+ children: T.deleteLabel
2284
+ }) }), /* @__PURE__ */ K("div", {
2236
2285
  className: "flex flex-col-reverse gap-space-md @sm/product-variant-editor:flex-row @sm/product-variant-editor:justify-end",
2237
- children: [!!f && /* @__PURE__ */ V(a, {
2286
+ children: [!!f && /* @__PURE__ */ G(a, {
2238
2287
  type: "button",
2239
2288
  tone: "secondary",
2240
2289
  buttonStyle: "ghost",
2241
2290
  onClick: f,
2242
- disabled: N,
2243
- children: x.cancelLabel
2244
- }), !!l && /* @__PURE__ */ V(a, {
2291
+ disabled: F,
2292
+ children: T.cancelLabel
2293
+ }), !!l && /* @__PURE__ */ G(a, {
2245
2294
  tone: "primary",
2246
2295
  type: "submit",
2247
- form: S,
2248
- disabled: N,
2249
- children: te ? x.savingLabel : x.saveLabel
2296
+ form: D,
2297
+ disabled: F,
2298
+ children: P ? T.savingLabel : T.saveLabel
2250
2299
  })]
2251
2300
  })]
2252
- }), ie = !!(p || f || l);
2253
- return /* @__PURE__ */ V(j, {
2254
- title: x.title,
2255
- description: x.description,
2301
+ }), le = !!(p || f || l);
2302
+ return /* @__PURE__ */ G(M, {
2303
+ title: b ? T.title : void 0,
2304
+ description: b ? T.description : void 0,
2256
2305
  actions: m,
2257
2306
  headerEnd: h,
2258
2307
  footerSlot: g,
2259
- className: i("product-variant-editor--component @container/product-variant-editor w-full", y),
2260
- children: /* @__PURE__ */ H(u, {
2261
- render: /* @__PURE__ */ V("form", {
2262
- id: S,
2263
- onSubmit: ne
2308
+ className: i("product-variant-editor--component @container/product-variant-editor w-full", w),
2309
+ children: /* @__PURE__ */ K(u, {
2310
+ render: /* @__PURE__ */ G("form", {
2311
+ id: D,
2312
+ onSubmit: se
2264
2313
  }),
2265
2314
  gap: "2xl",
2266
2315
  className: "product-variant-editor--form",
2267
2316
  children: [
2268
- /* @__PURE__ */ H("section", {
2317
+ L && /* @__PURE__ */ K("section", {
2269
2318
  className: "product-variant-editor--section grid gap-space-lg",
2270
- children: [/* @__PURE__ */ V(o, {
2319
+ children: [/* @__PURE__ */ G(o, {
2271
2320
  type: "inherit",
2272
2321
  weight: "semibold",
2273
- children: x.identityTitle
2274
- }), /* @__PURE__ */ H("div", {
2322
+ children: T.identityTitle
2323
+ }), /* @__PURE__ */ K("div", {
2275
2324
  className: "grid gap-space-lg @sm/product-variant-editor:grid-cols-2",
2276
2325
  children: [
2277
- /* @__PURE__ */ V(D, {
2278
- label: x.fields.name,
2326
+ I("name") && /* @__PURE__ */ G(k, {
2327
+ label: T.fields.name,
2328
+ error: v?.name,
2279
2329
  required: !0,
2280
- children: /* @__PURE__ */ V(E, {
2281
- value: M.name ?? "",
2282
- onChange: (e) => F("name", e.target.value),
2283
- placeholder: x.placeholders.name,
2284
- disabled: N
2330
+ children: /* @__PURE__ */ G(O, {
2331
+ value: N.name ?? "",
2332
+ onChange: (e) => B("name", e.target.value),
2333
+ invalid: !!v?.name,
2334
+ placeholder: T.placeholders.name,
2335
+ disabled: F
2285
2336
  })
2286
2337
  }),
2287
- /* @__PURE__ */ V(D, {
2288
- label: x.fields.sku,
2289
- children: /* @__PURE__ */ V(E, {
2290
- value: M.sku ?? "",
2291
- onChange: (e) => F("sku", e.target.value),
2292
- placeholder: x.placeholders.sku,
2293
- disabled: N
2338
+ I("sku") && /* @__PURE__ */ G(k, {
2339
+ label: T.fields.sku,
2340
+ error: v?.sku,
2341
+ children: /* @__PURE__ */ G(O, {
2342
+ value: N.sku ?? "",
2343
+ onChange: (e) => B("sku", e.target.value),
2344
+ invalid: !!v?.sku,
2345
+ placeholder: T.placeholders.sku,
2346
+ disabled: F
2294
2347
  })
2295
2348
  }),
2296
- /* @__PURE__ */ V(D, {
2297
- label: x.fields.description,
2349
+ I("description") && /* @__PURE__ */ G(k, {
2350
+ label: T.fields.description,
2351
+ error: v?.description,
2298
2352
  className: "@sm/product-variant-editor:col-span-2",
2299
- children: /* @__PURE__ */ V(O, {
2300
- value: M.description ?? "",
2301
- onChange: (e) => F("description", e.target.value),
2302
- placeholder: x.placeholders.description,
2303
- disabled: N,
2353
+ children: /* @__PURE__ */ G(A, {
2354
+ value: N.description ?? "",
2355
+ onChange: (e) => B("description", e.target.value),
2356
+ invalid: !!v?.description,
2357
+ placeholder: T.placeholders.description,
2358
+ disabled: F,
2304
2359
  autoResize: !0,
2305
2360
  minRows: 2
2306
2361
  })
@@ -2308,144 +2363,154 @@ function Et({ value: e, defaultValue: t, optionFields: n = [], statusOptions: s
2308
2363
  ]
2309
2364
  })]
2310
2365
  }),
2311
- /* @__PURE__ */ H("section", {
2366
+ R && /* @__PURE__ */ K("section", {
2312
2367
  className: "product-variant-editor--section grid gap-space-lg",
2313
- children: [/* @__PURE__ */ V(o, {
2368
+ children: [/* @__PURE__ */ G(o, {
2314
2369
  type: "inherit",
2315
2370
  weight: "semibold",
2316
- children: x.commercialTitle
2317
- }), /* @__PURE__ */ H("div", {
2371
+ children: T.commercialTitle
2372
+ }), /* @__PURE__ */ K("div", {
2318
2373
  className: "grid gap-space-lg @sm/product-variant-editor:grid-cols-2",
2319
2374
  children: [
2320
- /* @__PURE__ */ V(D, {
2321
- label: x.fields.price,
2322
- children: /* @__PURE__ */ V(E, {
2323
- value: M.price ?? "",
2324
- onChange: (e) => F("price", e.target.value),
2325
- placeholder: x.placeholders.price,
2326
- disabled: N
2375
+ I("price") && /* @__PURE__ */ G(k, {
2376
+ label: T.fields.price,
2377
+ error: v?.price,
2378
+ children: /* @__PURE__ */ G(O, {
2379
+ value: N.price ?? "",
2380
+ onChange: (e) => B("price", e.target.value),
2381
+ invalid: !!v?.price,
2382
+ placeholder: T.placeholders.price,
2383
+ disabled: F
2327
2384
  })
2328
2385
  }),
2329
- /* @__PURE__ */ V(D, {
2330
- label: x.fields.inventory,
2331
- children: /* @__PURE__ */ V(E, {
2332
- value: M.inventory ?? "",
2333
- onChange: (e) => F("inventory", e.target.value),
2334
- placeholder: x.placeholders.inventory,
2335
- disabled: N,
2386
+ I("inventory") && /* @__PURE__ */ G(k, {
2387
+ label: T.fields.inventory,
2388
+ error: v?.inventory,
2389
+ children: /* @__PURE__ */ G(O, {
2390
+ value: N.inventory ?? "",
2391
+ onChange: (e) => B("inventory", e.target.value),
2392
+ invalid: !!v?.inventory,
2393
+ placeholder: T.placeholders.inventory,
2394
+ disabled: F,
2336
2395
  inputMode: "numeric"
2337
2396
  })
2338
2397
  }),
2339
- /* @__PURE__ */ V(D, {
2340
- label: x.fields.status,
2341
- children: s.length > 0 ? /* @__PURE__ */ V(k, {
2342
- options: Tt(s),
2343
- value: M.status ?? null,
2344
- onValueChange: (e) => F("status", e ?? ""),
2345
- placeholder: x.statusPlaceholder,
2346
- disabled: N,
2347
- "aria-label": x.fields.status
2348
- }) : /* @__PURE__ */ V(E, {
2349
- value: M.status ?? "",
2350
- onChange: (e) => F("status", e.target.value),
2351
- placeholder: x.placeholders.status,
2352
- disabled: N
2398
+ I("status") && /* @__PURE__ */ G(k, {
2399
+ label: T.fields.status,
2400
+ error: v?.status,
2401
+ children: s.length > 0 ? /* @__PURE__ */ G(j, {
2402
+ options: Ot(s),
2403
+ value: N.status ?? null,
2404
+ onValueChange: (e) => B("status", e ?? ""),
2405
+ invalid: !!v?.status,
2406
+ placeholder: T.statusPlaceholder,
2407
+ disabled: F,
2408
+ "aria-label": T.fields.status
2409
+ }) : /* @__PURE__ */ G(O, {
2410
+ value: N.status ?? "",
2411
+ onChange: (e) => B("status", e.target.value),
2412
+ invalid: !!v?.status,
2413
+ placeholder: T.placeholders.status,
2414
+ disabled: F
2353
2415
  })
2354
2416
  }),
2355
- /* @__PURE__ */ V(D, {
2356
- label: x.fields.channels,
2357
- children: /* @__PURE__ */ V(E, {
2358
- value: M.channels ?? "",
2359
- onChange: (e) => F("channels", e.target.value),
2360
- placeholder: x.placeholders.channels,
2361
- disabled: N
2417
+ I("channels") && /* @__PURE__ */ G(k, {
2418
+ label: T.fields.channels,
2419
+ error: v?.channels,
2420
+ children: /* @__PURE__ */ G(O, {
2421
+ value: N.channels ?? "",
2422
+ onChange: (e) => B("channels", e.target.value),
2423
+ invalid: !!v?.channels,
2424
+ placeholder: T.placeholders.channels,
2425
+ disabled: F
2362
2426
  })
2363
2427
  })
2364
2428
  ]
2365
2429
  })]
2366
2430
  }),
2367
- !!n.length && /* @__PURE__ */ H("section", {
2431
+ !!n.length && /* @__PURE__ */ K("section", {
2368
2432
  className: "product-variant-editor--section grid gap-space-lg",
2369
- children: [/* @__PURE__ */ V(o, {
2433
+ children: [/* @__PURE__ */ G(o, {
2370
2434
  type: "inherit",
2371
2435
  weight: "semibold",
2372
- children: x.optionsTitle
2373
- }), /* @__PURE__ */ V("div", {
2436
+ children: T.optionsTitle
2437
+ }), /* @__PURE__ */ G("div", {
2374
2438
  className: "grid gap-space-lg @sm/product-variant-editor:grid-cols-2",
2375
2439
  children: n.map((e) => {
2376
- let t = e.value ?? M.options?.[e.id] ?? "", n = !!e.choices?.length;
2377
- return /* @__PURE__ */ V(D, {
2440
+ let t = e.value ?? N.options?.[e.id] ?? "", n = !!e.choices?.length;
2441
+ return /* @__PURE__ */ G(k, {
2378
2442
  label: e.label,
2379
2443
  helperText: e.helperText,
2380
- children: n ? /* @__PURE__ */ V(k, {
2381
- options: Tt(e.choices ?? []),
2444
+ children: n ? /* @__PURE__ */ G(j, {
2445
+ options: Ot(e.choices ?? []),
2382
2446
  value: t || null,
2383
- onValueChange: (t) => I(e, t),
2384
- placeholder: e.placeholder ?? x.optionPlaceholder,
2385
- disabled: N,
2447
+ onValueChange: (t) => oe(e, t),
2448
+ placeholder: e.placeholder ?? T.optionPlaceholder,
2449
+ disabled: F,
2386
2450
  "aria-label": e.label
2387
- }) : /* @__PURE__ */ V(E, {
2451
+ }) : /* @__PURE__ */ G(O, {
2388
2452
  value: t,
2389
- onChange: (t) => I(e, t.target.value),
2390
- placeholder: e.placeholder ?? x.optionPlaceholder,
2391
- disabled: N
2453
+ onChange: (t) => oe(e, t.target.value),
2454
+ placeholder: e.placeholder ?? T.optionPlaceholder,
2455
+ disabled: F
2392
2456
  })
2393
2457
  }, e.id);
2394
2458
  })
2395
2459
  })]
2396
2460
  }),
2397
- g == null && ie && re
2461
+ x,
2462
+ g == null && le && ce
2398
2463
  ]
2399
2464
  })
2400
2465
  });
2401
2466
  }
2402
- Et.displayName = "ProductVariantEditor";
2467
+ kt.displayName = "ProductVariantEditor";
2403
2468
  //#endregion
2404
2469
  //#region src/components/features/products/components/product-variants-bulk-table.tsx
2405
- var Dt = [
2470
+ var At = [
2406
2471
  "variant",
2407
2472
  "sku",
2408
2473
  "price",
2409
2474
  "inventory",
2410
2475
  "status"
2411
- ], Ot = "text", kt = "text", At = "multiple";
2412
- function jt(e) {
2476
+ ], jt = "text", Mt = "text", Nt = "multiple";
2477
+ function Pt(e) {
2413
2478
  return typeof e == "string" || typeof e == "number" ? String(e) : "";
2414
2479
  }
2415
- function Mt(e, t) {
2480
+ function Ft(e, t) {
2416
2481
  let n = e.optionValues?.[t.id];
2417
2482
  if (n != null && n !== !1 && n !== "") return n;
2418
2483
  let r = e.optionValueIds?.[t.id];
2419
2484
  return t.values?.find((e) => e.id === r)?.label ?? void 0;
2420
2485
  }
2421
- function Nt(e, t) {
2422
- return e.name !== void 0 && e.name !== null && e.name !== "" ? e.name : t.filter((e) => e.usedForVariants !== !1).map((t) => Mt(e, t)).filter((e) => e != null && e !== "").map((e) => jt(e)).filter(Boolean).join(" / ") || "-";
2486
+ function It(e, t) {
2487
+ return e.name !== void 0 && e.name !== null && e.name !== "" ? e.name : t.filter((e) => e.usedForVariants !== !1).map((t) => Ft(e, t)).filter((e) => e != null && e !== "").map((e) => Pt(e)).filter(Boolean).join(" / ") || "-";
2423
2488
  }
2424
- function Pt(e, t) {
2425
- return t.filter((e) => e.usedForVariants !== !1).map((t) => Mt(e, t)).filter((e) => e != null && e !== "");
2489
+ function Lt(e, t) {
2490
+ return t.filter((e) => e.usedForVariants !== !1).map((t) => Ft(e, t)).filter((e) => e != null && e !== "");
2426
2491
  }
2427
- function Ft(e) {
2428
- return e.map(jt).filter(Boolean).join(" / ");
2492
+ function Rt(e) {
2493
+ return e.map(Pt).filter(Boolean).join(" / ");
2429
2494
  }
2430
- function It(e, t) {
2431
- return jt(Mt(e, t)) || "-";
2495
+ function zt(e, t) {
2496
+ return Pt(Ft(e, t)) || "-";
2432
2497
  }
2433
- function Lt(e, t) {
2498
+ function Bt(e, t) {
2434
2499
  return e.map((e) => t.get(e)).filter((e) => !!e);
2435
2500
  }
2436
- function Rt(e) {
2501
+ function Vt(e) {
2437
2502
  return e == null || e === "" ? "-" : e;
2438
2503
  }
2439
- function zt(e) {
2504
+ function Ht(e) {
2440
2505
  return e != null && e !== "";
2441
2506
  }
2442
- function Bt(e) {
2507
+ function Ut(e) {
2443
2508
  return e === "sku" || e === "price" || e === "inventory";
2444
2509
  }
2445
- function Vt(e, t) {
2446
- return e === "text" || e === "field" ? e : e[t] ?? kt;
2510
+ function Wt(e, t) {
2511
+ return e === "text" || e === "field" ? e : e[t] ?? Mt;
2447
2512
  }
2448
- function Ht(e, t, n, r) {
2513
+ function Gt(e, t, n, r) {
2449
2514
  return {
2450
2515
  index: e,
2451
2516
  field: t,
@@ -2453,347 +2518,346 @@ function Ht(e, t, n, r) {
2453
2518
  value: r
2454
2519
  };
2455
2520
  }
2456
- function Ut(e, t, n, r, a) {
2457
- let o = jt(e);
2521
+ function Kt(e, t, n, r, a, o = "whitespace-normal break-words") {
2522
+ let s = Pt(e);
2458
2523
  if (n === "field") {
2459
2524
  let e = !!r;
2460
- return /* @__PURE__ */ V(E, {
2525
+ return /* @__PURE__ */ G(O, {
2461
2526
  readOnly: !e,
2462
- value: o,
2527
+ value: s,
2463
2528
  onChange: e ? (e) => r(e.currentTarget.value) : void 0,
2464
2529
  onBlur: a ? (e) => a(e.currentTarget.value) : void 0,
2465
2530
  "aria-label": t,
2466
- className: i("h-control-lg w-full min-w-24 bg-background px-control shadow-xs", !e && "text-muted-foreground")
2531
+ className: i("h-control-lg w-full min-w-24 field-sizing-content bg-background px-control shadow-xs", !e && "text-muted-foreground")
2467
2532
  });
2468
2533
  }
2469
- let s = zt(e) ? y : b;
2470
- return /* @__PURE__ */ V(s, {
2471
- className: "min-w-0 whitespace-normal break-words tabular-nums",
2472
- children: Rt(e)
2534
+ let c = Ht(e) ? S : C;
2535
+ return /* @__PURE__ */ G(c, {
2536
+ className: i("min-w-0 tabular-nums", o),
2537
+ children: Vt(e)
2473
2538
  });
2474
2539
  }
2475
- function Wt({ variants: e = [], optionGroups: t = [], groupByOptionId: n, visibleColumns: c = Dt, optionCombinationDisplay: l = Ot, cellDisplay: d = kt, selectionMode: f, renderOptionCombination: p, renderCell: h, selectedVariantIds: g, defaultSelectedVariantIds: _ = [], onSelectedVariantIdsChange: v, onVariantFieldChange: y, onVariantFieldBlur: b, onCreateVariant: x, onGenerateVariants: w, onSelectVariant: T, onEditVariant: E, onDuplicateVariant: D, onDeleteVariant: O, onBulkEdit: ee, onBulkApply: k, onBulkDelete: M, renderVariantActions: te, renderBulkActions: N, actions: P, headerEnd: F, footerSlot: I, empty: ne, surface: re = "card", className: ie, strings: ae }) {
2476
- let R = r(Ne, ae), de = g !== void 0, [fe, pe] = _e(_), he = !!(N || ee || k || M), U = (f ?? (he || de || v ? At : "none")) === "multiple", ye = B(() => U ? de ? g : fe : [], [
2477
- fe,
2478
- U,
2479
- de,
2480
- g
2481
- ]), Se = B(() => new Map(e.map((e) => [e.id, e])), [e]), Ce = B(() => Lt(ye, Se), [Se, ye]), we = B(() => new Set(ye), [ye]), K = B(() => new Set(c), [c]), q = B(() => t.find((e) => e.id === n), [t, n]), Te = B(() => new Map(e.map((e, t) => [e.id, t])), [e]), Ee = B(() => {
2482
- if (!q) return e;
2483
- let t = new Map((q.values ?? []).map((e, t) => [e.id, t]));
2540
+ function qt({ variants: e = [], optionGroups: t = [], groupByOptionId: n, visibleColumns: c = At, optionCombinationDisplay: l = jt, cellDisplay: d = Mt, selectionMode: f, renderOptionCombination: p, renderCell: m, selectedVariantIds: h, defaultSelectedVariantIds: g = [], onSelectedVariantIdsChange: v, onVariantFieldChange: y, onVariantFieldBlur: b, onCreateVariant: x, onGenerateVariants: S, onSelectVariant: C, onEditVariant: w, onDuplicateVariant: E, onDeleteVariant: D, onBulkEdit: O, onBulkApply: k, onBulkDelete: A, renderVariantActions: te, renderBulkActions: j, actions: re, headerEnd: ie, footerSlot: ae, empty: N, surface: P = "card", className: F, strings: I }) {
2541
+ let L = r($, I), R = h !== void 0, [z, de] = _e(g), V = !!(j || O || k || A), H = (f ?? (V || R || v ? Nt : "none")) === "multiple", fe = W(() => H ? R ? h : z : [], [
2542
+ z,
2543
+ H,
2544
+ R,
2545
+ h
2546
+ ]), me = W(() => new Map(e.map((e) => [e.id, e])), [e]), he = W(() => Bt(fe, me), [me, fe]), ye = W(() => new Set(fe), [fe]), q = W(() => new Set(c), [c]), J = W(() => t.find((e) => e.id === n), [t, n]), Ce = W(() => new Map(e.map((e, t) => [e.id, t])), [e]), we = W(() => {
2547
+ if (!J) return e;
2548
+ let t = new Map((J.values ?? []).map((e, t) => [e.id, t]));
2484
2549
  return [...e].sort((e, n) => {
2485
- let r = e.optionValueIds?.[q.id], i = n.optionValueIds?.[q.id], a = r === void 0 ? void 0 : t.get(r), o = i === void 0 ? void 0 : t.get(i), s = a ?? 2 ** 53 - 1, c = o ?? 2 ** 53 - 1;
2486
- return s === c ? (Te.get(e.id) ?? 0) - (Te.get(n.id) ?? 0) : s - c;
2550
+ let r = e.optionValueIds?.[J.id], i = n.optionValueIds?.[J.id], a = r === void 0 ? void 0 : t.get(r), o = i === void 0 ? void 0 : t.get(i), s = a ?? 2 ** 53 - 1, c = o ?? 2 ** 53 - 1;
2551
+ return s === c ? (Ce.get(e.id) ?? 0) - (Ce.get(n.id) ?? 0) : s - c;
2487
2552
  });
2488
2553
  }, [
2489
- q,
2490
- Te,
2554
+ J,
2555
+ Ce,
2491
2556
  e
2492
- ]), De = B(() => {
2493
- if (!q) return /* @__PURE__ */ new Map();
2557
+ ]), Te = W(() => {
2558
+ if (!J) return /* @__PURE__ */ new Map();
2494
2559
  let t = /* @__PURE__ */ new Map();
2495
2560
  return e.forEach((e) => {
2496
- let n = It(e, q);
2561
+ let n = zt(e, J);
2497
2562
  t.set(n, (t.get(n) ?? 0) + 1);
2498
2563
  }), t;
2499
- }, [q, e]), Oe = U && he, ke = e.length > 0, Ae = U && ke && e.every((e) => we.has(e.id)), Y = Ce.length > 0 && !Ae, je = ge(null), X = !!(T || E || D || O || te), Z = c.filter((e) => K.has(e)).length + +!!U + +!!X, Q = z((e) => {
2500
- let t = Lt(e, Se);
2501
- de || pe(e), v?.(e, t);
2564
+ }, [J, e]), Ee = H && V, De = e.length > 0, Z = H && De && e.every((e) => ye.has(e.id)), Oe = he.length > 0 && !Z, ke = ge(null), Ae = !!(C || w || E || D || te), je = c.filter((e) => q.has(e)).length + +!!H + +!!Ae, Q = U((e) => {
2565
+ let t = Bt(e, me);
2566
+ R || de(e), v?.(e, t);
2502
2567
  }, [
2503
- de,
2568
+ R,
2504
2569
  v,
2505
- Se
2506
- ]), Me = z(() => Q([]), [Q]), Pe = z((e, t) => {
2507
- if (!U) return;
2508
- let n = t === !0 ? Array.from(/* @__PURE__ */ new Set([...ye, e.id])) : ye.filter((t) => t !== e.id);
2570
+ me
2571
+ ]), Me = U(() => Q([]), [Q]), Ne = U((e, t) => {
2572
+ if (!H) return;
2573
+ let n = t === !0 ? Array.from(/* @__PURE__ */ new Set([...fe, e.id])) : fe.filter((t) => t !== e.id);
2509
2574
  Q(n);
2510
2575
  }, [
2511
- U,
2512
- ye,
2576
+ H,
2577
+ fe,
2513
2578
  Q
2514
- ]), Fe = z((t) => {
2515
- U && Q(t === !0 ? e.map((e) => e.id) : []);
2579
+ ]), Pe = U((t) => {
2580
+ H && Q(t === !0 ? e.map((e) => e.id) : []);
2516
2581
  }, [
2517
- U,
2582
+ H,
2518
2583
  Q,
2519
2584
  e
2520
- ]), Ie = {
2521
- selectedRows: Ce,
2522
- selectedIds: ye,
2585
+ ]), Fe = {
2586
+ selectedRows: he,
2587
+ selectedIds: fe,
2523
2588
  allRows: e,
2524
- selectedCount: Ce.length,
2589
+ selectedCount: he.length,
2525
2590
  totalCount: e.length,
2526
- allRowsSelected: Ae,
2591
+ allRowsSelected: Z,
2527
2592
  clearSelection: Me,
2528
2593
  setSelectedIds: Q
2529
- }, Le = x || w ? /* @__PURE__ */ H(u, {
2594
+ }, Ie = x || S ? /* @__PURE__ */ K(u, {
2530
2595
  direction: "horizontal",
2531
- gap: m.commands,
2596
+ gap: _.commands,
2532
2597
  justify: "end",
2533
2598
  className: "product-variants-bulk-table--header-actions",
2534
- children: [!!w && /* @__PURE__ */ V(a, {
2599
+ children: [!!S && /* @__PURE__ */ G(a, {
2535
2600
  type: "button",
2536
2601
  tone: "secondary",
2537
2602
  buttonStyle: "outline",
2538
- onClick: w,
2539
- children: R.generateLabel
2540
- }), !!x && /* @__PURE__ */ V(a, {
2603
+ onClick: S,
2604
+ children: L.generateLabel
2605
+ }), !!x && /* @__PURE__ */ G(a, {
2541
2606
  type: "button",
2542
2607
  tone: "secondary",
2543
2608
  buttonStyle: "ghost",
2544
2609
  onClick: x,
2545
- icon: G,
2546
- children: R.createLabel
2610
+ icon: Y,
2611
+ children: L.createLabel
2547
2612
  })]
2548
- }) : void 0, Re = Ce.length > 0 ? N?.(Ie) : void 0, ze = Oe ? /* @__PURE__ */ V(C, {
2613
+ }) : void 0, Le = he.length > 0 ? j?.(Fe) : void 0, Re = Ee ? /* @__PURE__ */ G(T, {
2549
2614
  placement: "inline",
2550
2615
  className: "product-variants-bulk-table--bulk-toolbar",
2551
- selectedCount: Ce.length,
2616
+ selectedCount: he.length,
2552
2617
  totalCount: e.length,
2553
2618
  onClear: Me,
2554
- returnFocusRef: je,
2619
+ returnFocusRef: ke,
2555
2620
  strings: {
2556
- summary: (t, n) => R.selectedLabel(t, n ?? e.length),
2557
- clear: R.clearSelectionLabel
2621
+ summary: (t, n) => L.selectedLabel(t, n ?? e.length),
2622
+ clear: L.clearSelectionLabel
2558
2623
  },
2559
- children: Re ?? /* @__PURE__ */ H(ve, { children: [
2560
- !!ee && /* @__PURE__ */ V(a, {
2624
+ children: Le ?? /* @__PURE__ */ K(ve, { children: [
2625
+ !!O && /* @__PURE__ */ G(a, {
2561
2626
  type: "button",
2562
- onClick: () => ee(Ce),
2563
- children: R.bulkEditLabel
2627
+ onClick: () => O(he),
2628
+ children: L.bulkEditLabel
2564
2629
  }),
2565
- !!k && /* @__PURE__ */ V(a, {
2630
+ !!k && /* @__PURE__ */ G(a, {
2566
2631
  type: "button",
2567
2632
  tone: "neutral",
2568
2633
  buttonStyle: "ghost",
2569
- onClick: () => k(Ce),
2570
- children: R.bulkApplyLabel
2634
+ onClick: () => k(he),
2635
+ children: L.bulkApplyLabel
2571
2636
  }),
2572
- !!M && /* @__PURE__ */ V(a, {
2637
+ !!A && /* @__PURE__ */ G(a, {
2573
2638
  type: "button",
2574
2639
  tone: "destructive",
2575
2640
  buttonStyle: "ghost",
2576
- onClick: () => M(Ce),
2577
- children: R.bulkDeleteLabel
2641
+ onClick: () => A(he),
2642
+ children: L.bulkDeleteLabel
2578
2643
  })
2579
2644
  ] })
2580
- }) : null, Be = e.length === 0 ? ne ?? /* @__PURE__ */ V($, {
2581
- title: R.emptyTitle,
2582
- description: R.emptyDescription,
2583
- action: w ? /* @__PURE__ */ V(a, {
2645
+ }) : null, ze = e.length === 0 ? N ?? /* @__PURE__ */ G(Ve, {
2646
+ title: L.emptyTitle,
2647
+ description: L.emptyDescription,
2648
+ action: S ? /* @__PURE__ */ G(a, {
2584
2649
  tone: "primary",
2585
2650
  type: "button",
2586
- onClick: w,
2587
- children: R.generateLabel
2651
+ onClick: S,
2652
+ children: L.generateLabel
2588
2653
  }) : void 0
2589
- }) : /* @__PURE__ */ H(u, {
2654
+ }) : /* @__PURE__ */ K(u, {
2590
2655
  gap: "md",
2591
2656
  className: "product-variants-bulk-table--body",
2592
- children: [ze, /* @__PURE__ */ V("div", {
2593
- className: "product-variants-bulk-table--table overflow-hidden rounded-radius border border-border bg-background text-foreground",
2594
- children: /* @__PURE__ */ H(ue, {
2595
- containerClassName: "[scrollbar-gutter:stable] [scrollbar-width:thin] [&::-webkit-scrollbar]:h-2.5 [&::-webkit-scrollbar-thumb]:rounded-full [&::-webkit-scrollbar-thumb]:bg-border [&::-webkit-scrollbar-track]:bg-muted/30",
2657
+ children: [Re, /* @__PURE__ */ G("div", {
2658
+ className: "product-variants-bulk-table--table overflow-hidden rounded-surface border border-border bg-background text-foreground",
2659
+ children: /* @__PURE__ */ K(ue, {
2596
2660
  className: "w-full border-collapse",
2597
2661
  children: [
2598
- /* @__PURE__ */ H("colgroup", { children: [
2599
- U && /* @__PURE__ */ V("col", { className: "w-14 min-w-14 max-w-14" }),
2600
- K.has("variant") && /* @__PURE__ */ V("col", {}),
2601
- K.has("sku") && /* @__PURE__ */ V("col", {}),
2602
- K.has("price") && /* @__PURE__ */ V("col", {}),
2603
- K.has("inventory") && /* @__PURE__ */ V("col", {}),
2604
- K.has("status") && /* @__PURE__ */ V("col", {}),
2605
- K.has("updated") && /* @__PURE__ */ V("col", {}),
2606
- X && /* @__PURE__ */ V("col", { className: "w-18" })
2662
+ /* @__PURE__ */ K("colgroup", { children: [
2663
+ H && /* @__PURE__ */ G("col", { className: "w-14 min-w-14 max-w-14" }),
2664
+ q.has("variant") && /* @__PURE__ */ G("col", {}),
2665
+ q.has("sku") && /* @__PURE__ */ G("col", {}),
2666
+ q.has("price") && /* @__PURE__ */ G("col", {}),
2667
+ q.has("inventory") && /* @__PURE__ */ G("col", {}),
2668
+ q.has("status") && /* @__PURE__ */ G("col", {}),
2669
+ q.has("updated") && /* @__PURE__ */ G("col", {}),
2670
+ Ae && /* @__PURE__ */ G("col", { className: "w-18" })
2607
2671
  ] }),
2608
- /* @__PURE__ */ V(le, { children: /* @__PURE__ */ H(oe, {
2672
+ /* @__PURE__ */ G(le, { children: /* @__PURE__ */ K(B, {
2609
2673
  className: "h-12 border-b border-border/60 bg-muted/50",
2610
2674
  children: [
2611
- U && /* @__PURE__ */ V(ce, {
2675
+ H && /* @__PURE__ */ G(ce, {
2612
2676
  className: "w-14 min-w-14 max-w-14 px-0 py-space-md text-center align-middle",
2613
- children: /* @__PURE__ */ V(A, {
2614
- ref: je,
2615
- checked: Ae,
2616
- indeterminate: Y,
2617
- onCheckedChange: Fe,
2618
- "aria-label": R.selectAllLabel,
2677
+ children: /* @__PURE__ */ G(ne, {
2678
+ ref: ke,
2679
+ checked: Z,
2680
+ indeterminate: Oe,
2681
+ onCheckedChange: Pe,
2682
+ "aria-label": L.selectAllLabel,
2619
2683
  className: "mx-auto"
2620
2684
  })
2621
2685
  }),
2622
- K.has("variant") && /* @__PURE__ */ V(ce, {
2686
+ q.has("variant") && /* @__PURE__ */ G(ce, {
2623
2687
  className: "px-space-lg py-space-md text-left align-middle",
2624
- children: /* @__PURE__ */ V(s, {
2688
+ children: /* @__PURE__ */ G(s, {
2625
2689
  className: "whitespace-normal",
2626
- children: R.headers.variant
2690
+ children: L.headers.variant
2627
2691
  })
2628
2692
  }),
2629
- K.has("sku") && /* @__PURE__ */ V(ce, {
2693
+ q.has("sku") && /* @__PURE__ */ G(ce, {
2630
2694
  className: "px-space-lg py-space-md text-left align-middle",
2631
- children: /* @__PURE__ */ V(s, {
2695
+ children: /* @__PURE__ */ G(s, {
2632
2696
  className: "whitespace-normal",
2633
- children: R.headers.sku
2697
+ children: L.headers.sku
2634
2698
  })
2635
2699
  }),
2636
- K.has("price") && /* @__PURE__ */ V(ce, {
2700
+ q.has("price") && /* @__PURE__ */ G(ce, {
2637
2701
  className: "px-space-lg py-space-md text-left align-middle",
2638
- children: /* @__PURE__ */ V(s, {
2702
+ children: /* @__PURE__ */ G(s, {
2639
2703
  className: "whitespace-normal",
2640
- children: R.headers.price
2704
+ children: L.headers.price
2641
2705
  })
2642
2706
  }),
2643
- K.has("inventory") && /* @__PURE__ */ V(ce, {
2707
+ q.has("inventory") && /* @__PURE__ */ G(ce, {
2644
2708
  className: "px-space-lg py-space-md text-left align-middle",
2645
- children: /* @__PURE__ */ V(s, {
2709
+ children: /* @__PURE__ */ G(s, {
2646
2710
  className: "whitespace-normal",
2647
- children: R.headers.inventory
2711
+ children: L.headers.inventory
2648
2712
  })
2649
2713
  }),
2650
- K.has("status") && /* @__PURE__ */ V(ce, {
2714
+ q.has("status") && /* @__PURE__ */ G(ce, {
2651
2715
  className: "px-space-lg py-space-md text-left align-middle",
2652
- children: /* @__PURE__ */ V(s, {
2716
+ children: /* @__PURE__ */ G(s, {
2653
2717
  className: "whitespace-normal",
2654
- children: R.headers.status
2718
+ children: L.headers.status
2655
2719
  })
2656
2720
  }),
2657
- K.has("updated") && /* @__PURE__ */ V(ce, {
2721
+ q.has("updated") && /* @__PURE__ */ G(ce, {
2658
2722
  className: "px-space-lg py-space-md text-left align-middle",
2659
- children: /* @__PURE__ */ V(s, {
2723
+ children: /* @__PURE__ */ G(s, {
2660
2724
  className: "whitespace-normal",
2661
- children: R.headers.updated
2725
+ children: L.headers.updated
2662
2726
  })
2663
2727
  }),
2664
- X && /* @__PURE__ */ V(ce, {
2728
+ Ae && /* @__PURE__ */ G(ce, {
2665
2729
  className: "px-space-lg py-space-md text-right align-middle",
2666
- children: /* @__PURE__ */ V(s, {
2730
+ children: /* @__PURE__ */ G(s, {
2667
2731
  className: "whitespace-normal",
2668
- children: R.headers.actions
2732
+ children: L.headers.actions
2669
2733
  })
2670
2734
  })
2671
2735
  ]
2672
2736
  }) }),
2673
- /* @__PURE__ */ V(se, { children: Ee.map((e, n) => {
2674
- let r = Te.get(e.id) ?? n, i = q ? It(e, q) : null, a = n > 0 ? Ee[n - 1] : void 0, s = q && a ? It(a, q) : null, c = !!q && i !== s, f = we.has(e.id), m = {
2737
+ /* @__PURE__ */ G(se, { children: we.map((e, n) => {
2738
+ let r = Ce.get(e.id) ?? n, i = J ? zt(e, J) : null, a = n > 0 ? we[n - 1] : void 0, s = J && a ? zt(a, J) : null, c = !!J && i !== s, f = ye.has(e.id), h = {
2675
2739
  index: r,
2676
- onSelect: T ? () => T(e) : void 0,
2677
- onEdit: E ? () => E(e) : void 0,
2678
- onDuplicate: D ? () => D(e) : void 0,
2679
- onDelete: O ? () => O(e) : void 0,
2740
+ onSelect: C ? () => C(e) : void 0,
2741
+ onEdit: w ? () => w(e) : void 0,
2742
+ onDuplicate: E ? () => E(e) : void 0,
2743
+ onDelete: D ? () => D(e) : void 0,
2680
2744
  isSelected: f,
2681
- onToggleSelected: U ? (t) => Pe(e, t) : void 0
2682
- }, g = q ? t.filter((e) => e.id !== q.id) : t, _ = Pt(e, g), v = q ? Nt({
2745
+ onToggleSelected: H ? (t) => Ne(e, t) : void 0
2746
+ }, g = J ? t.filter((e) => e.id !== J.id) : t, _ = Lt(e, g), v = J ? It({
2683
2747
  ...e,
2684
2748
  name: void 0
2685
- }, g) : Nt(e, t), x = v === "-" && q ? Nt(e, t) : v, C = Ft(_), w = C === jt(x), ee = (t, n, i = kt) => {
2686
- let a = Bt(t) && y ? (i) => y(e, t, i, Ht(r, t, n, i)) : void 0, o = Bt(t) && b ? (i) => b(e, t, i, Ht(r, t, n, i)) : void 0;
2749
+ }, g) : It(e, t), x = v === "-" && J ? It(e, t) : v, S = Rt(_), T = S === Pt(x), O = (t, n, i = Mt) => {
2750
+ let a = Ut(t) && y ? (i) => y(e, t, i, Gt(r, t, n, i)) : void 0, o = Ut(t) && b ? (i) => b(e, t, i, Gt(r, t, n, i)) : void 0;
2687
2751
  return {
2688
2752
  index: r,
2689
2753
  column: t,
2690
2754
  value: n,
2691
2755
  variantName: x,
2692
2756
  optionValues: _,
2693
- optionLabel: C,
2757
+ optionLabel: S,
2694
2758
  cellDisplay: i,
2695
2759
  onValueChange: a,
2696
2760
  onBlur: o
2697
2761
  };
2698
2762
  }, k = (t, n, r, i) => {
2699
- let a = ee(t, n, r), o = h?.(e, a);
2763
+ let a = O(t, n, r), o = m?.(e, a);
2700
2764
  return o === void 0 ? i(a) : o;
2701
- }, j = l !== "none" && _.length > 0 && (q ? !w : l === "tags" || !w), M = l === "none" ? null : p?.(e, {
2765
+ }, A = l !== "none" && _.length > 0 && !T, j = l === "none" ? null : p?.(e, {
2702
2766
  optionGroups: t,
2703
2767
  optionValues: _,
2704
- optionLabel: C,
2768
+ optionLabel: S,
2705
2769
  display: l
2706
- }), N = [
2707
- ...T ? [{
2770
+ }), M = [
2771
+ ...C ? [{
2708
2772
  id: "view",
2709
- label: R.viewLabel,
2710
- icon: /* @__PURE__ */ V(xe, { className: "size-icon-md" }),
2711
- onClick: () => T(e),
2773
+ label: L.viewLabel,
2774
+ icon: /* @__PURE__ */ G(xe, { className: "size-icon-md" }),
2775
+ onClick: () => C(e),
2712
2776
  tone: "secondary",
2713
2777
  buttonStyle: "ghost"
2714
2778
  }] : [],
2715
- ...E ? [{
2779
+ ...w ? [{
2716
2780
  id: "edit",
2717
- label: R.editLabel,
2718
- icon: /* @__PURE__ */ V(W, { className: "size-icon-md" }),
2719
- onClick: () => E(e),
2781
+ label: L.editLabel,
2782
+ icon: /* @__PURE__ */ G(Se, { className: "size-icon-md" }),
2783
+ onClick: () => w(e),
2720
2784
  tone: "secondary",
2721
2785
  buttonStyle: "ghost"
2722
2786
  }] : [],
2723
- ...D ? [{
2787
+ ...E ? [{
2724
2788
  id: "duplicate",
2725
- label: R.duplicateLabel,
2726
- icon: /* @__PURE__ */ V(be, { className: "size-icon-md" }),
2727
- onClick: () => D(e),
2789
+ label: L.duplicateLabel,
2790
+ icon: /* @__PURE__ */ G(be, { className: "size-icon-md" }),
2791
+ onClick: () => E(e),
2728
2792
  tone: "secondary",
2729
2793
  buttonStyle: "ghost"
2730
2794
  }] : [],
2731
- ...O ? [{
2795
+ ...D ? [{
2732
2796
  id: "delete",
2733
- label: R.deleteLabel,
2734
- icon: /* @__PURE__ */ V(J, { className: "size-icon-md" }),
2735
- onClick: () => O(e),
2797
+ label: L.deleteLabel,
2798
+ icon: /* @__PURE__ */ G(X, { className: "size-icon-md" }),
2799
+ onClick: () => D(e),
2736
2800
  tone: "destructive"
2737
2801
  }] : []
2738
2802
  ];
2739
- return /* @__PURE__ */ H(me, { children: [c && /* @__PURE__ */ V(oe, {
2803
+ return /* @__PURE__ */ K(pe, { children: [c && /* @__PURE__ */ G(B, {
2740
2804
  className: "product-variants-bulk-table--group-row border-b border-border/60 bg-muted/30",
2741
- children: /* @__PURE__ */ V(L, {
2742
- colSpan: Z,
2805
+ children: /* @__PURE__ */ G(oe, {
2806
+ colSpan: je,
2743
2807
  className: "px-space-lg py-space-md align-middle",
2744
- children: /* @__PURE__ */ H(u, {
2808
+ children: /* @__PURE__ */ K(u, {
2745
2809
  direction: "horizontal",
2746
2810
  gap: "sm",
2747
2811
  wrap: !1,
2748
- children: [/* @__PURE__ */ V(o, {
2812
+ children: [/* @__PURE__ */ G(o, {
2749
2813
  type: "inherit",
2750
2814
  tag: "span",
2751
2815
  weight: "semibold",
2752
2816
  className: "min-w-0 whitespace-normal break-words",
2753
2817
  children: i
2754
- }), /* @__PURE__ */ V(o, {
2818
+ }), /* @__PURE__ */ G(o, {
2755
2819
  tag: "span",
2756
2820
  size: "xs",
2757
2821
  type: "secondary",
2758
2822
  className: "whitespace-nowrap",
2759
- children: R.groupCountLabel(De.get(i ?? "") ?? 0)
2823
+ children: L.groupCountLabel(Te.get(i ?? "") ?? 0)
2760
2824
  })]
2761
2825
  })
2762
2826
  })
2763
- }), /* @__PURE__ */ H(oe, {
2827
+ }), /* @__PURE__ */ K(B, {
2764
2828
  className: "h-20 border-b border-border/60 last:border-b-0",
2765
2829
  children: [
2766
- U && /* @__PURE__ */ V(L, {
2830
+ H && /* @__PURE__ */ G(oe, {
2767
2831
  className: "w-14 min-w-14 max-w-14 px-0 py-space-lg text-center align-middle",
2768
- children: /* @__PURE__ */ V(A, {
2832
+ children: /* @__PURE__ */ G(ne, {
2769
2833
  checked: f,
2770
- onCheckedChange: (t) => Pe(e, t),
2771
- "aria-label": R.selectRowLabel(r),
2834
+ onCheckedChange: (t) => Ne(e, t),
2835
+ "aria-label": L.selectRowLabel(r),
2772
2836
  className: "mx-auto"
2773
2837
  })
2774
2838
  }),
2775
- K.has("variant") && /* @__PURE__ */ V(L, {
2839
+ q.has("variant") && /* @__PURE__ */ G(oe, {
2776
2840
  className: "px-space-lg py-space-lg align-middle",
2777
- children: k("variant", x, kt, () => /* @__PURE__ */ H(u, {
2841
+ children: k("variant", x, Mt, () => /* @__PURE__ */ K(u, {
2778
2842
  gap: "xs",
2779
2843
  children: [
2780
- /* @__PURE__ */ V(o, {
2844
+ /* @__PURE__ */ G(o, {
2781
2845
  type: "inherit",
2782
2846
  weight: "medium",
2783
2847
  className: "min-w-0 whitespace-normal break-words",
2784
2848
  children: x
2785
2849
  }),
2786
- M,
2787
- !M && j && l === "text" && /* @__PURE__ */ V(o, {
2850
+ j,
2851
+ !j && A && l === "text" && /* @__PURE__ */ G(o, {
2788
2852
  size: "xs",
2789
2853
  type: "secondary",
2790
2854
  className: "min-w-0 whitespace-normal break-words",
2791
- children: _.map((t, n) => /* @__PURE__ */ H("span", { children: [n > 0 ? " / " : null, t] }, `${e.id}-option-text-${n}`))
2855
+ children: _.map((t, n) => /* @__PURE__ */ K("span", { children: [n > 0 ? " / " : null, t] }, `${e.id}-option-text-${n}`))
2792
2856
  }),
2793
- !M && j && l === "tags" && /* @__PURE__ */ V(u, {
2857
+ !j && A && l === "tags" && /* @__PURE__ */ G(u, {
2794
2858
  direction: "horizontal",
2795
2859
  gap: "xs",
2796
- children: _.map((t, n) => /* @__PURE__ */ V(S, {
2860
+ children: _.map((t, n) => /* @__PURE__ */ G(ee, {
2797
2861
  size: "sm",
2798
2862
  tone: "secondary",
2799
2863
  className: "max-w-full",
@@ -2803,38 +2867,38 @@ function Wt({ variants: e = [], optionGroups: t = [], groupByOptionId: n, visibl
2803
2867
  ]
2804
2868
  }))
2805
2869
  }),
2806
- K.has("sku") && /* @__PURE__ */ V(L, {
2870
+ q.has("sku") && /* @__PURE__ */ G(oe, {
2807
2871
  className: "px-space-lg py-space-md align-middle",
2808
- children: k("sku", e.sku, Vt(d, "sku"), (t) => Ut(e.sku, `${R.headers.sku}: ${jt(x)}`, t.cellDisplay, t.onValueChange, t.onBlur))
2872
+ children: k("sku", e.sku, Wt(d, "sku"), (t) => Kt(e.sku, `${L.headers.sku}: ${Pt(x)}`, t.cellDisplay, t.onValueChange, t.onBlur, "whitespace-nowrap"))
2809
2873
  }),
2810
- K.has("price") && /* @__PURE__ */ V(L, {
2874
+ q.has("price") && /* @__PURE__ */ G(oe, {
2811
2875
  className: "px-space-lg py-space-md align-middle",
2812
- children: k("price", e.price, Vt(d, "price"), (t) => Ut(e.price, `${R.headers.price}: ${jt(x)}`, t.cellDisplay, t.onValueChange, t.onBlur))
2876
+ children: k("price", e.price, Wt(d, "price"), (t) => Kt(e.price, `${L.headers.price}: ${Pt(x)}`, t.cellDisplay, t.onValueChange, t.onBlur))
2813
2877
  }),
2814
- K.has("inventory") && /* @__PURE__ */ V(L, {
2878
+ q.has("inventory") && /* @__PURE__ */ G(oe, {
2815
2879
  className: "px-space-lg py-space-md align-middle",
2816
- children: k("inventory", e.inventory, Vt(d, "inventory"), (t) => Ut(e.inventory, `${R.headers.inventory}: ${jt(x)}`, t.cellDisplay, t.onValueChange, t.onBlur))
2880
+ children: k("inventory", e.inventory, Wt(d, "inventory"), (t) => Kt(e.inventory, `${L.headers.inventory}: ${Pt(x)}`, t.cellDisplay, t.onValueChange, t.onBlur))
2817
2881
  }),
2818
- K.has("status") && /* @__PURE__ */ V(L, {
2882
+ q.has("status") && /* @__PURE__ */ G(oe, {
2819
2883
  className: "px-space-lg py-space-lg align-middle",
2820
- children: k("status", e.status, kt, () => e.status ? /* @__PURE__ */ V(S, {
2884
+ children: k("status", e.status, Mt, () => e.status ? /* @__PURE__ */ G(ee, {
2821
2885
  tone: e.statusTone ?? "secondary",
2822
2886
  children: e.status
2823
- }) : /* @__PURE__ */ V(o, {
2887
+ }) : /* @__PURE__ */ G(o, {
2824
2888
  type: "secondary",
2825
2889
  children: "-"
2826
2890
  }))
2827
2891
  }),
2828
- K.has("updated") && /* @__PURE__ */ V(L, {
2892
+ q.has("updated") && /* @__PURE__ */ G(oe, {
2829
2893
  className: "px-space-lg py-space-lg align-middle",
2830
- children: k("updated", e.updatedAt, kt, () => Ut(e.updatedAt, `${R.headers.updated}: ${jt(x)}`, "text"))
2894
+ children: k("updated", e.updatedAt, Mt, () => Kt(e.updatedAt, `${L.headers.updated}: ${Pt(x)}`, "text"))
2831
2895
  }),
2832
- X && /* @__PURE__ */ V(L, {
2896
+ Ae && /* @__PURE__ */ G(oe, {
2833
2897
  className: "px-space-lg py-space-lg text-right align-middle",
2834
- children: te ? te(e, m) : /* @__PURE__ */ V(Ke, {
2898
+ children: te ? te(e, h) : /* @__PURE__ */ G(Ye, {
2835
2899
  item: e,
2836
- actions: N,
2837
- menuLabel: R.headers.actions
2900
+ actions: M,
2901
+ menuLabel: L.headers.actions
2838
2902
  })
2839
2903
  })
2840
2904
  ]
@@ -2844,210 +2908,219 @@ function Wt({ variants: e = [], optionGroups: t = [], groupByOptionId: n, visibl
2844
2908
  })
2845
2909
  })]
2846
2910
  });
2847
- return re === "embedded" ? /* @__PURE__ */ V("section", {
2848
- "aria-label": R.title,
2849
- className: i("product-variants-bulk-table--component min-w-0", ie),
2850
- children: Be
2851
- }) : /* @__PURE__ */ V(j, {
2852
- title: R.title,
2853
- description: R.description,
2854
- actions: P,
2855
- headerAction: Le,
2856
- headerEnd: F,
2857
- footerSlot: I,
2858
- className: i("product-variants-bulk-table--component w-full", ie),
2859
- children: Be
2911
+ return P === "embedded" ? /* @__PURE__ */ G("section", {
2912
+ "aria-label": L.title,
2913
+ className: i("product-variants-bulk-table--component min-w-0", F),
2914
+ children: ze
2915
+ }) : /* @__PURE__ */ G(M, {
2916
+ title: L.title,
2917
+ description: L.description,
2918
+ actions: re,
2919
+ headerAction: Ie,
2920
+ headerEnd: ie,
2921
+ footerSlot: ae,
2922
+ className: i("product-variants-bulk-table--component w-full", F),
2923
+ children: ze
2860
2924
  });
2861
2925
  }
2862
- Wt.displayName = "ProductVariantsBulkTable";
2926
+ qt.displayName = "ProductVariantsBulkTable";
2863
2927
  //#endregion
2864
2928
  //#region src/components/features/products/components/product-variants-manager.tsx
2865
- function Gt({ optionGroups: n = [], variants: s = [], visibleColumns: c, optionCombinationDisplay: l, cellDisplay: d, selectionMode: p, renderOptionCombination: h, renderCell: g, selectedVariantIds: _, defaultSelectedVariantIds: v, onSelectedVariantIdsChange: y, onVariantFieldChange: b, onVariantFieldBlur: x, collapsedOptionIds: S, defaultCollapsedOptionIds: C, onCollapsedOptionIdsChange: w, editingOptionId: T, defaultEditingOptionId: E, onEditingOptionIdChange: D, onCreateOption: O, onEditOption: ee, onDeleteOption: A, onAddValue: j, onDeleteValue: N, onOptionNameChange: P, onValueLabelChange: F, onDoneEditingOption: I, onSaveEditingOption: ne, onCancelEditingOption: re, onToggleUsedForVariants: ie, renderOptionActions: ae, renderValue: oe, onCreateVariant: L, onGenerateVariants: se, onSelectVariant: ce, onEditVariant: le, onDuplicateVariant: ue, onDeleteVariant: R, onBulkEdit: de, onBulkApply: fe, onBulkDelete: pe, renderVariantActions: me, renderBulkActions: he, groupByOptionId: ge, defaultGroupByOptionId: ve, onGroupByOptionIdChange: U, onSearchVariants: ye, onFilterVariants: be, controlsEnd: xe, actions: Se, headerEnd: W, footerSlot: we, surface: q = "flat", padding: J = q === "flat" ? "none" : "md", headerDivider: Te, footerDivider: Ee, className: De, strings: Oe, optionsStrings: ke, variantsStrings: Ae }) {
2866
- let { defaultScale: Y } = e(), je = t(void 0, Y), X = r(Pe, Oe), Z = B(() => n.filter((e) => e.usedForVariants !== !1), [n]), Q = Z[0]?.id ?? null, Me = ge !== void 0, [Ne, Fe] = _e(ve ?? Q), Ie = ge ?? Ne ?? Q, Le = B(() => Z.map((e) => ({
2929
+ function Jt({ optionGroups: n = [], variants: s = [], visibleColumns: c, optionCombinationDisplay: l, cellDisplay: d, selectionMode: f, renderOptionCombination: p, renderCell: h, selectedVariantIds: g, defaultSelectedVariantIds: v, onSelectedVariantIdsChange: y, onVariantFieldChange: b, onVariantFieldBlur: x, collapsedOptionIds: S, defaultCollapsedOptionIds: C, onCollapsedOptionIdsChange: w, editingOptionId: ee, defaultEditingOptionId: T, onEditingOptionIdChange: E, onCreateOption: D, onEditOption: O, onDeleteOption: k, onAddValue: A, onDeleteValue: te, onOptionNameChange: ne, onValueLabelChange: M, onDoneEditingOption: ae, onSaveEditingOption: N, onError: P, onCancelEditingOption: F, onToggleUsedForVariants: I, renderOptionActions: L, renderValue: R, onCreateVariant: z, onGenerateVariants: B, onSelectVariant: oe, onEditVariant: se, onDuplicateVariant: ce, onDeleteVariant: le, onBulkEdit: ue, onBulkApply: de, onBulkDelete: V, renderVariantActions: H, renderBulkActions: fe, groupByOptionId: pe, defaultGroupByOptionId: me, onGroupByOptionIdChange: he, showGroupBy: ge = !0, onSearchVariants: ve, onFilterVariants: ye, controlsEnd: q, actions: be, headerEnd: xe, footerSlot: Se, surface: Ce = "flat", padding: Te = Ce === "flat" ? "none" : "md", headerDivider: X, footerDivider: Ee, className: De, strings: Z, optionsStrings: Oe, variantsStrings: ke }) {
2930
+ let { defaultScale: Ae } = t(), je = e(void 0, Ae), Q = r(Ie, Z), Me = W(() => n.filter((e) => e.usedForVariants !== !1), [n]), Ne = Me[0]?.id ?? null, Pe = pe !== void 0, [Fe, $] = _e(me), Le = Pe ? pe : ge ? Fe === void 0 ? Ne : Fe : me ?? null, Re = !!ve && !!ye, ze = !!ve || !!ye, Be = W(() => ge ? Me.map((e) => ({
2867
2931
  value: e.id,
2868
2932
  label: String(typeof e.name == "string" || typeof e.name == "number" ? e.name : e.id)
2869
- })), [Z]), Re = z((e) => {
2933
+ })) : [], [Me, ge]), Ve = U((e) => {
2870
2934
  let t = n.find((t) => t.id === e);
2871
- Me || Fe(e ?? null), U?.(e, t);
2935
+ Pe || $(e ?? null), he?.(e, t);
2872
2936
  }, [
2873
- Me,
2874
- U,
2937
+ Pe,
2938
+ he,
2875
2939
  n
2876
- ]), $ = se || L ? /* @__PURE__ */ H(u, {
2940
+ ]), He = B || z ? /* @__PURE__ */ K(u, {
2877
2941
  direction: "horizontal",
2878
- gap: m.commands,
2942
+ gap: _.commands,
2879
2943
  justify: "end",
2880
2944
  className: "product-variants-manager--header-actions",
2881
- children: [!!se && /* @__PURE__ */ V(a, {
2945
+ children: [!!B && /* @__PURE__ */ G(a, {
2882
2946
  type: "button",
2883
2947
  tone: "secondary",
2884
2948
  buttonStyle: "outline",
2885
- onClick: se,
2886
- children: X.generateLabel
2887
- }), !!L && /* @__PURE__ */ V(a, {
2949
+ onClick: B,
2950
+ children: Q.generateLabel
2951
+ }), !!z && /* @__PURE__ */ G(a, {
2888
2952
  type: "button",
2889
2953
  tone: "secondary",
2890
2954
  buttonStyle: "outline",
2891
- onClick: L,
2892
- icon: G,
2893
- children: X.createVariantLabel
2955
+ onClick: z,
2956
+ icon: Y,
2957
+ children: Q.createVariantLabel
2894
2958
  })]
2895
2959
  }) : void 0;
2896
- return /* @__PURE__ */ V(f, {
2897
- surface: q,
2898
- padding: J,
2899
- headerDivider: Te,
2960
+ return /* @__PURE__ */ G(m, {
2961
+ surface: Ce,
2962
+ padding: Te,
2963
+ headerDivider: X,
2900
2964
  footerDivider: Ee,
2901
- title: X.title,
2902
- description: X.description,
2903
- actions: Se,
2904
- actionsLabel: X.actionsLabel,
2905
- headerAction: $,
2906
- headerEnd: W,
2907
- footerSlot: we,
2965
+ title: Q.title,
2966
+ description: Q.description,
2967
+ actions: be,
2968
+ actionsLabel: Q.actionsLabel,
2969
+ headerAction: He,
2970
+ headerEnd: xe,
2971
+ footerSlot: Se,
2908
2972
  className: i("product-variants-manager--component w-full", De),
2909
- children: /* @__PURE__ */ H(u, {
2973
+ children: /* @__PURE__ */ K(u, {
2910
2974
  gap: "2xl",
2911
2975
  className: "product-variants-manager--body",
2912
- children: [/* @__PURE__ */ V("section", {
2976
+ children: [/* @__PURE__ */ G("section", {
2913
2977
  className: "product-variants-manager--options min-w-0",
2914
- children: /* @__PURE__ */ V(ut, {
2978
+ children: /* @__PURE__ */ G(pt, {
2915
2979
  optionGroups: n,
2916
2980
  collapsedOptionIds: S,
2917
2981
  defaultCollapsedOptionIds: C,
2918
2982
  onCollapsedOptionIdsChange: w,
2919
- editingOptionId: T,
2920
- defaultEditingOptionId: E,
2921
- onEditingOptionIdChange: D,
2983
+ editingOptionId: ee,
2984
+ defaultEditingOptionId: T,
2985
+ onEditingOptionIdChange: E,
2922
2986
  surface: "embedded",
2923
- onCreateOption: O,
2924
- onEditOption: ee,
2925
- onDeleteOption: A,
2926
- onAddValue: j,
2927
- onDeleteValue: N,
2928
- onOptionNameChange: P,
2929
- onValueLabelChange: F,
2930
- onDoneEditingOption: I,
2931
- onSaveEditingOption: ne,
2932
- onCancelEditingOption: re,
2933
- onToggleUsedForVariants: ie,
2934
- renderOptionActions: ae,
2935
- renderValue: oe,
2987
+ onCreateOption: D,
2988
+ onEditOption: O,
2989
+ onDeleteOption: k,
2990
+ onAddValue: A,
2991
+ onDeleteValue: te,
2992
+ onOptionNameChange: ne,
2993
+ onValueLabelChange: M,
2994
+ onDoneEditingOption: ae,
2995
+ onSaveEditingOption: N,
2996
+ onError: P,
2997
+ onCancelEditingOption: F,
2998
+ onToggleUsedForVariants: I,
2999
+ renderOptionActions: L,
3000
+ renderValue: R,
2936
3001
  showHeader: !1,
2937
3002
  showCollapseControls: !1,
2938
3003
  showInlineActions: !1,
2939
3004
  showVariantToggle: !1,
2940
3005
  strings: {
2941
- title: X.optionsTitle,
2942
- ...ke
3006
+ title: Q.optionsTitle,
3007
+ ...Oe
2943
3008
  }
2944
3009
  })
2945
- }), /* @__PURE__ */ H(u, {
3010
+ }), /* @__PURE__ */ K(u, {
2946
3011
  gap: "md",
2947
3012
  className: "product-variants-manager--variants-region",
2948
- children: [/* @__PURE__ */ V("div", {
3013
+ children: [(Be.length > 0 || ze || q) && /* @__PURE__ */ G("div", {
2949
3014
  className: "product-variants-manager--controls",
2950
- children: /* @__PURE__ */ H(u, {
3015
+ children: /* @__PURE__ */ K(u, {
2951
3016
  direction: "horizontal",
2952
3017
  gap: "md",
2953
3018
  justify: "between",
2954
- children: [/* @__PURE__ */ H(u, {
3019
+ children: [Be.length > 0 && /* @__PURE__ */ K(u, {
2955
3020
  direction: "horizontal",
2956
3021
  gap: "sm",
2957
3022
  wrap: !1,
2958
3023
  className: "product-variants-manager--group-by",
2959
- children: [/* @__PURE__ */ V(o, {
3024
+ children: [/* @__PURE__ */ G(o, {
2960
3025
  type: "secondary",
2961
3026
  className: "whitespace-nowrap",
2962
- children: X.groupByLabel
2963
- }), Le.length > 0 && /* @__PURE__ */ V(k, {
2964
- options: Le,
2965
- value: Ie,
2966
- onValueChange: Re,
2967
- "aria-label": X.groupByLabel,
3027
+ children: Q.groupByLabel
3028
+ }), Be.length > 0 && /* @__PURE__ */ G(j, {
3029
+ options: Be,
3030
+ value: Le ?? void 0,
3031
+ onValueChange: Ve,
3032
+ "aria-label": Q.groupByLabel,
2968
3033
  className: "min-w-32 bg-background"
2969
3034
  })]
2970
- }), /* @__PURE__ */ H(u, {
3035
+ }), (ze || q) && /* @__PURE__ */ K(u, {
2971
3036
  direction: "horizontal",
2972
3037
  gap: "sm",
2973
3038
  justify: "end",
2974
3039
  wrap: !1,
2975
- className: "product-variants-manager--controls-end",
2976
- children: [/* @__PURE__ */ H("div", {
2977
- className: i("product-variants-manager--tool-buttons bg-background shadow-xs", M.joinedFrame, te[je]),
2978
- children: [/* @__PURE__ */ H(a, {
3040
+ className: "product-variants-manager--controls-end ms-auto",
3041
+ children: [ze && /* @__PURE__ */ K("div", {
3042
+ className: i("flex", Re && [
3043
+ "product-variants-manager--tool-buttons bg-background shadow-xs",
3044
+ re.joinedFrame,
3045
+ ie[je]
3046
+ ]),
3047
+ children: [ve && /* @__PURE__ */ K(a, {
2979
3048
  type: "button",
2980
- size: "sm",
3049
+ size: je,
2981
3050
  iconOnly: !0,
2982
3051
  tone: "secondary",
2983
- buttonStyle: "ghost",
2984
- onClick: ye,
2985
- "aria-label": X.searchLabel,
2986
- className: i(M.joinedItem, M.firstItem, "border-r border-border text-muted-foreground hover:text-foreground"),
2987
- children: [/* @__PURE__ */ V(K, {
3052
+ buttonStyle: Re ? "ghost" : "outline",
3053
+ onClick: ve,
3054
+ "aria-label": Q.searchLabel,
3055
+ className: i(Re && [
3056
+ re.joinedItem,
3057
+ re.firstItem,
3058
+ "border-r border-border"
3059
+ ], "text-muted-foreground hover:text-foreground"),
3060
+ children: [/* @__PURE__ */ G(we, {
2988
3061
  className: "size-icon-sm",
2989
3062
  "aria-hidden": "true"
2990
- }), /* @__PURE__ */ V(o, {
3063
+ }), /* @__PURE__ */ G(o, {
2991
3064
  tag: "span",
2992
3065
  size: "pxs",
2993
3066
  className: "sr-only",
2994
- children: X.searchLabel
3067
+ children: Q.searchLabel
2995
3068
  })]
2996
- }), /* @__PURE__ */ H(a, {
3069
+ }), ye && /* @__PURE__ */ K(a, {
2997
3070
  type: "button",
2998
- size: "sm",
3071
+ size: je,
2999
3072
  iconOnly: !0,
3000
3073
  tone: "secondary",
3001
- buttonStyle: "ghost",
3002
- onClick: be,
3003
- "aria-label": X.filterLabel,
3004
- className: i(M.joinedItem, M.lastItem, "text-muted-foreground hover:text-foreground"),
3005
- children: [/* @__PURE__ */ V(Ce, {
3074
+ buttonStyle: Re ? "ghost" : "outline",
3075
+ onClick: ye,
3076
+ "aria-label": Q.filterLabel,
3077
+ className: i(Re && [re.joinedItem, re.lastItem], "text-muted-foreground hover:text-foreground"),
3078
+ children: [/* @__PURE__ */ G(J, {
3006
3079
  className: "size-icon-sm",
3007
3080
  "aria-hidden": "true"
3008
- }), /* @__PURE__ */ V(o, {
3081
+ }), /* @__PURE__ */ G(o, {
3009
3082
  tag: "span",
3010
3083
  size: "pxs",
3011
3084
  className: "sr-only",
3012
- children: X.filterLabel
3085
+ children: Q.filterLabel
3013
3086
  })]
3014
3087
  })]
3015
- }), xe]
3088
+ }), q]
3016
3089
  })]
3017
3090
  })
3018
- }), /* @__PURE__ */ V("section", {
3091
+ }), /* @__PURE__ */ G("section", {
3019
3092
  className: "product-variants-manager--variants min-w-0",
3020
- children: /* @__PURE__ */ V(Wt, {
3093
+ children: /* @__PURE__ */ G(qt, {
3021
3094
  variants: s,
3022
3095
  optionGroups: n,
3023
- groupByOptionId: Ie,
3096
+ groupByOptionId: Le,
3024
3097
  visibleColumns: c,
3025
3098
  optionCombinationDisplay: l,
3026
3099
  cellDisplay: d,
3027
- selectionMode: p,
3028
- renderOptionCombination: h,
3029
- renderCell: g,
3100
+ selectionMode: f,
3101
+ renderOptionCombination: p,
3102
+ renderCell: h,
3030
3103
  surface: "embedded",
3031
- selectedVariantIds: _,
3104
+ selectedVariantIds: g,
3032
3105
  defaultSelectedVariantIds: v,
3033
3106
  onSelectedVariantIdsChange: y,
3034
3107
  onVariantFieldChange: b,
3035
3108
  onVariantFieldBlur: x,
3036
- onCreateVariant: L,
3037
- onGenerateVariants: se,
3038
- onSelectVariant: ce,
3039
- onEditVariant: le,
3040
- onDuplicateVariant: ue,
3041
- onDeleteVariant: R,
3042
- onBulkEdit: de,
3043
- onBulkApply: fe,
3044
- onBulkDelete: pe,
3045
- renderVariantActions: me,
3046
- renderBulkActions: he,
3109
+ onCreateVariant: z,
3110
+ onGenerateVariants: B,
3111
+ onSelectVariant: oe,
3112
+ onEditVariant: se,
3113
+ onDuplicateVariant: ce,
3114
+ onDeleteVariant: le,
3115
+ onBulkEdit: ue,
3116
+ onBulkApply: de,
3117
+ onBulkDelete: V,
3118
+ renderVariantActions: H,
3119
+ renderBulkActions: fe,
3047
3120
  strings: {
3048
- title: X.variantsTitle,
3049
- generateLabel: X.generateLabel,
3050
- ...Ae
3121
+ title: Q.variantsTitle,
3122
+ generateLabel: Q.generateLabel,
3123
+ ...ke
3051
3124
  }
3052
3125
  })
3053
3126
  })]
@@ -3055,8 +3128,8 @@ function Gt({ optionGroups: n = [], variants: s = [], visibleColumns: c, optionC
3055
3128
  })
3056
3129
  });
3057
3130
  }
3058
- Gt.displayName = "ProductVariantsManager";
3131
+ Jt.displayName = "ProductVariantsManager";
3059
3132
  //#endregion
3060
- export { nt as ProductContractOverview, rt as ProductDetailsCard, at as ProductOperationsCard, it as ProductOptionActionMenu, ut as ProductOptionsMatrix, dt as ProductOptionsSummary, yt as ProductOverview, ft as ProductPoliciesCard, pt as ProductQuotePreviewCard, mt as ProductReadinessCard, ht as ProductStructureCard, xt as ProductVariantActionMenu, wt as ProductVariantDetails, Et as ProductVariantEditor, Wt as ProductVariantsBulkTable, Gt as ProductVariantsManager, vt as ProductVariantsTable, Ae as defaultProductContractOverviewStrings, ke as defaultProductDetailsCardStrings, Oe as defaultProductOperationsCardStrings, je as defaultProductOptionActionMenuStrings, X as defaultProductOptionsMatrixStrings, Y as defaultProductOptionsSummaryStrings, Re as defaultProductOverviewStrings, Q as defaultProductPoliciesCardStrings, Z as defaultProductQuotePreviewCardStrings, Ee as defaultProductReadinessCardStrings, De as defaultProductStructureCardStrings, Fe as defaultProductVariantActionMenuStrings, Ie as defaultProductVariantDetailsStrings, Le as defaultProductVariantEditorStrings, Ne as defaultProductVariantsBulkTableStrings, Pe as defaultProductVariantsManagerStrings, Me as defaultProductVariantsTableStrings };
3133
+ export { at as ProductContractOverview, ot as ProductDetailsCard, ct as ProductOperationsCard, st as ProductOptionActionMenu, pt as ProductOptionsMatrix, mt as ProductOptionsSummary, St as ProductOverview, ht as ProductPoliciesCard, gt as ProductQuotePreviewCard, _t as ProductReadinessCard, vt as ProductStructureCard, wt as ProductVariantActionMenu, Dt as ProductVariantDetails, kt as ProductVariantEditor, qt as ProductVariantsBulkTable, Jt as ProductVariantsManager, xt as ProductVariantsTable, Ae as defaultProductContractOverviewStrings, ke as defaultProductDetailsCardStrings, Oe as defaultProductOperationsCardStrings, Q as defaultProductOptionActionMenuStrings, Me as defaultProductOptionsMatrixStrings, je as defaultProductOptionsSummaryStrings, Be as defaultProductOverviewStrings, Pe as defaultProductPoliciesCardStrings, Ne as defaultProductQuotePreviewCardStrings, De as defaultProductReadinessCardStrings, Z as defaultProductStructureCardStrings, Le as defaultProductVariantActionMenuStrings, Re as defaultProductVariantDetailsStrings, ze as defaultProductVariantEditorStrings, $ as defaultProductVariantsBulkTableStrings, Ie as defaultProductVariantsManagerStrings, Fe as defaultProductVariantsTableStrings };
3061
3134
 
3062
3135
  //# sourceMappingURL=products.js.map