@open-mercato/core 0.5.1-develop.2856.35de414092 → 0.5.1-develop.2874.77704bccbd

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 (349) hide show
  1. package/dist/modules/api_docs/frontend/docs/api/Explorer.js +18 -18
  2. package/dist/modules/api_docs/frontend/docs/api/Explorer.js.map +2 -2
  3. package/dist/modules/api_keys/backend/api-keys/create/page.js +1 -1
  4. package/dist/modules/api_keys/backend/api-keys/create/page.js.map +1 -1
  5. package/dist/modules/attachments/components/AttachmentLibrary.js +2 -2
  6. package/dist/modules/attachments/components/AttachmentLibrary.js.map +2 -2
  7. package/dist/modules/attachments/components/AttachmentPartitionSettings.js +1 -1
  8. package/dist/modules/attachments/components/AttachmentPartitionSettings.js.map +1 -1
  9. package/dist/modules/attachments/fields/attachment.js +1 -1
  10. package/dist/modules/attachments/fields/attachment.js.map +1 -1
  11. package/dist/modules/audit_logs/components/ActionLogDetailsDialog.js +1 -1
  12. package/dist/modules/audit_logs/components/ActionLogDetailsDialog.js.map +2 -2
  13. package/dist/modules/audit_logs/lib/display-helpers.js +1 -1
  14. package/dist/modules/audit_logs/lib/display-helpers.js.map +1 -1
  15. package/dist/modules/auth/backend/users/create/page.js +1 -1
  16. package/dist/modules/auth/backend/users/create/page.js.map +1 -1
  17. package/dist/modules/business_rules/backend/rules/page.js +6 -6
  18. package/dist/modules/business_rules/backend/rules/page.js.map +2 -2
  19. package/dist/modules/business_rules/backend/sets/page.js +2 -2
  20. package/dist/modules/business_rules/backend/sets/page.js.map +2 -2
  21. package/dist/modules/business_rules/components/ActionBuilder.js +5 -5
  22. package/dist/modules/business_rules/components/ActionBuilder.js.map +2 -2
  23. package/dist/modules/business_rules/components/ActionRow.js +8 -8
  24. package/dist/modules/business_rules/components/ActionRow.js.map +1 -1
  25. package/dist/modules/business_rules/components/ConditionBuilder.js +5 -5
  26. package/dist/modules/business_rules/components/ConditionBuilder.js.map +2 -2
  27. package/dist/modules/business_rules/components/ConditionGroup.js +2 -2
  28. package/dist/modules/business_rules/components/ConditionGroup.js.map +1 -1
  29. package/dist/modules/business_rules/components/ConditionRow.js +3 -3
  30. package/dist/modules/business_rules/components/ConditionRow.js.map +2 -2
  31. package/dist/modules/business_rules/components/RuleSetMembers.js +8 -8
  32. package/dist/modules/business_rules/components/RuleSetMembers.js.map +2 -2
  33. package/dist/modules/catalog/backend/catalog/products/[id]/page.js +2 -2
  34. package/dist/modules/catalog/backend/catalog/products/[id]/page.js.map +1 -1
  35. package/dist/modules/catalog/backend/catalog/products/create/page.js +5 -5
  36. package/dist/modules/catalog/backend/catalog/products/create/page.js.map +1 -1
  37. package/dist/modules/catalog/components/products/MetadataEditor.js +1 -1
  38. package/dist/modules/catalog/components/products/MetadataEditor.js.map +1 -1
  39. package/dist/modules/catalog/components/products/ProductImageCell.js +1 -1
  40. package/dist/modules/catalog/components/products/ProductImageCell.js.map +1 -1
  41. package/dist/modules/catalog/components/products/VariantBuilder.js +1 -1
  42. package/dist/modules/catalog/components/products/VariantBuilder.js.map +1 -1
  43. package/dist/modules/catalog/widgets/injection/product-seo/widget.client.js +1 -1
  44. package/dist/modules/catalog/widgets/injection/product-seo/widget.client.js.map +2 -2
  45. package/dist/modules/currencies/components/CurrencyFetchingConfig.js +1 -1
  46. package/dist/modules/currencies/components/CurrencyFetchingConfig.js.map +1 -1
  47. package/dist/modules/customer_accounts/backend/customer_accounts/roles/page.js +2 -2
  48. package/dist/modules/customer_accounts/backend/customer_accounts/roles/page.js.map +2 -2
  49. package/dist/modules/customer_accounts/backend/customer_accounts/users/[id]/page.js +9 -9
  50. package/dist/modules/customer_accounts/backend/customer_accounts/users/[id]/page.js.map +2 -2
  51. package/dist/modules/customer_accounts/backend/customer_accounts/users/page.js +7 -7
  52. package/dist/modules/customer_accounts/backend/customer_accounts/users/page.js.map +2 -2
  53. package/dist/modules/customer_accounts/widgets/injection/account-status/widget.client.js +2 -2
  54. package/dist/modules/customer_accounts/widgets/injection/account-status/widget.client.js.map +1 -1
  55. package/dist/modules/customers/backend/config/customers/pipeline-stages/page.js +3 -3
  56. package/dist/modules/customers/backend/config/customers/pipeline-stages/page.js.map +1 -1
  57. package/dist/modules/customers/backend/customers/deals/pipeline/page.js +2 -2
  58. package/dist/modules/customers/backend/customers/deals/pipeline/page.js.map +1 -1
  59. package/dist/modules/customers/components/AddressTiles.js +1 -1
  60. package/dist/modules/customers/components/AddressTiles.js.map +1 -1
  61. package/dist/modules/customers/components/detail/ActivityForm.js +3 -3
  62. package/dist/modules/customers/components/detail/ActivityForm.js.map +1 -1
  63. package/dist/modules/customers/components/detail/AnnualRevenueField.js +2 -2
  64. package/dist/modules/customers/components/detail/AnnualRevenueField.js.map +1 -1
  65. package/dist/modules/customers/components/detail/CustomFieldValuesList.js +1 -1
  66. package/dist/modules/customers/components/detail/CustomFieldValuesList.js.map +1 -1
  67. package/dist/modules/customers/components/detail/DealForm.js +1 -1
  68. package/dist/modules/customers/components/detail/DealForm.js.map +2 -2
  69. package/dist/modules/customers/components/detail/DealsSection.js +1 -1
  70. package/dist/modules/customers/components/detail/DealsSection.js.map +1 -1
  71. package/dist/modules/customers/components/detail/DetailFieldsSection.js +1 -1
  72. package/dist/modules/customers/components/detail/DetailFieldsSection.js.map +1 -1
  73. package/dist/modules/customers/components/detail/InlineEditors.js +5 -5
  74. package/dist/modules/customers/components/detail/InlineEditors.js.map +2 -2
  75. package/dist/modules/customers/components/detail/TasksSection.js +1 -1
  76. package/dist/modules/customers/components/detail/TasksSection.js.map +1 -1
  77. package/dist/modules/customers/components/detail/TimelineItemHeader.js +1 -1
  78. package/dist/modules/customers/components/detail/TimelineItemHeader.js.map +1 -1
  79. package/dist/modules/customers/components/formConfig.js +2 -2
  80. package/dist/modules/customers/components/formConfig.js.map +1 -1
  81. package/dist/modules/customers/widgets/dashboard/customer-todos/widget.client.js +1 -1
  82. package/dist/modules/customers/widgets/dashboard/customer-todos/widget.client.js.map +1 -1
  83. package/dist/modules/customers/widgets/dashboard/new-customers/widget.client.js +2 -2
  84. package/dist/modules/customers/widgets/dashboard/new-customers/widget.client.js.map +1 -1
  85. package/dist/modules/customers/widgets/dashboard/new-deals/widget.client.js +1 -1
  86. package/dist/modules/customers/widgets/dashboard/new-deals/widget.client.js.map +1 -1
  87. package/dist/modules/customers/widgets/dashboard/next-interactions/widget.client.js +1 -1
  88. package/dist/modules/customers/widgets/dashboard/next-interactions/widget.client.js.map +1 -1
  89. package/dist/modules/dashboards/components/WidgetVisibilityEditor.js +1 -1
  90. package/dist/modules/dashboards/components/WidgetVisibilityEditor.js.map +1 -1
  91. package/dist/modules/dashboards/widgets/dashboard/aov-kpi/widget.client.js +1 -1
  92. package/dist/modules/dashboards/widgets/dashboard/aov-kpi/widget.client.js.map +1 -1
  93. package/dist/modules/dashboards/widgets/dashboard/new-customers-kpi/widget.client.js +1 -1
  94. package/dist/modules/dashboards/widgets/dashboard/new-customers-kpi/widget.client.js.map +1 -1
  95. package/dist/modules/dashboards/widgets/dashboard/orders-by-status/widget.client.js +1 -1
  96. package/dist/modules/dashboards/widgets/dashboard/orders-by-status/widget.client.js.map +1 -1
  97. package/dist/modules/dashboards/widgets/dashboard/orders-kpi/widget.client.js +1 -1
  98. package/dist/modules/dashboards/widgets/dashboard/orders-kpi/widget.client.js.map +1 -1
  99. package/dist/modules/dashboards/widgets/dashboard/revenue-kpi/widget.client.js +1 -1
  100. package/dist/modules/dashboards/widgets/dashboard/revenue-kpi/widget.client.js.map +1 -1
  101. package/dist/modules/dashboards/widgets/dashboard/revenue-trend/widget.client.js +2 -2
  102. package/dist/modules/dashboards/widgets/dashboard/revenue-trend/widget.client.js.map +1 -1
  103. package/dist/modules/dashboards/widgets/dashboard/sales-by-region/widget.client.js +1 -1
  104. package/dist/modules/dashboards/widgets/dashboard/sales-by-region/widget.client.js.map +1 -1
  105. package/dist/modules/dashboards/widgets/dashboard/top-customers/widget.client.js +1 -1
  106. package/dist/modules/dashboards/widgets/dashboard/top-customers/widget.client.js.map +1 -1
  107. package/dist/modules/dashboards/widgets/dashboard/top-products/widget.client.js +2 -2
  108. package/dist/modules/dashboards/widgets/dashboard/top-products/widget.client.js.map +1 -1
  109. package/dist/modules/data_sync/backend/data-sync/page.js +4 -4
  110. package/dist/modules/data_sync/backend/data-sync/page.js.map +2 -2
  111. package/dist/modules/data_sync/backend/data-sync/runs/[id]/page.js +2 -2
  112. package/dist/modules/data_sync/backend/data-sync/runs/[id]/page.js.map +1 -1
  113. package/dist/modules/dictionaries/components/AppearanceSelector.js +3 -3
  114. package/dist/modules/dictionaries/components/AppearanceSelector.js.map +2 -2
  115. package/dist/modules/dictionaries/components/DictionariesManager.js +4 -4
  116. package/dist/modules/dictionaries/components/DictionariesManager.js.map +2 -2
  117. package/dist/modules/dictionaries/components/DictionaryEntriesEditor.js +2 -2
  118. package/dist/modules/dictionaries/components/DictionaryEntriesEditor.js.map +2 -2
  119. package/dist/modules/dictionaries/components/DictionaryEntrySelect.js +3 -3
  120. package/dist/modules/dictionaries/components/DictionaryEntrySelect.js.map +1 -1
  121. package/dist/modules/dictionaries/fields/dictionary.js +4 -4
  122. package/dist/modules/dictionaries/fields/dictionary.js.map +1 -1
  123. package/dist/modules/entities/components/EncryptionManager.js +3 -3
  124. package/dist/modules/entities/components/EncryptionManager.js.map +2 -2
  125. package/dist/modules/entities/components/UserEntitiesTable.js +1 -1
  126. package/dist/modules/entities/components/UserEntitiesTable.js.map +2 -2
  127. package/dist/modules/feature_toggles/components/formConfig.js +1 -1
  128. package/dist/modules/feature_toggles/components/formConfig.js.map +1 -1
  129. package/dist/modules/feature_toggles/components/overrideFormConfig.js +2 -2
  130. package/dist/modules/feature_toggles/components/overrideFormConfig.js.map +1 -1
  131. package/dist/modules/inbox_ops/backend/inbox-ops/proposals/[id]/page.js +12 -12
  132. package/dist/modules/inbox_ops/backend/inbox-ops/proposals/[id]/page.js.map +2 -2
  133. package/dist/modules/inbox_ops/components/messages/InboxEmailPreview.js +1 -1
  134. package/dist/modules/inbox_ops/components/messages/InboxEmailPreview.js.map +1 -1
  135. package/dist/modules/inbox_ops/components/proposals/ActionCard.js +12 -12
  136. package/dist/modules/inbox_ops/components/proposals/ActionCard.js.map +2 -2
  137. package/dist/modules/inbox_ops/widgets/notifications/ProposalCreatedRenderer.js +3 -3
  138. package/dist/modules/inbox_ops/widgets/notifications/ProposalCreatedRenderer.js.map +2 -2
  139. package/dist/modules/integrations/backend/integrations/[id]/page.js +6 -6
  140. package/dist/modules/integrations/backend/integrations/[id]/page.js.map +2 -2
  141. package/dist/modules/messages/components/MessagesInboxPageClient.js +1 -1
  142. package/dist/modules/messages/components/MessagesInboxPageClient.js.map +1 -1
  143. package/dist/modules/messages/components/defaults/DefaultMessageListItem.js +1 -1
  144. package/dist/modules/messages/components/defaults/DefaultMessageListItem.js.map +1 -1
  145. package/dist/modules/messages/components/defaults/MessageRecordObjectDetail.js +1 -1
  146. package/dist/modules/messages/components/defaults/MessageRecordObjectDetail.js.map +1 -1
  147. package/dist/modules/messages/components/defaults/MessageRecordObjectPreview.js +1 -1
  148. package/dist/modules/messages/components/defaults/MessageRecordObjectPreview.js.map +1 -1
  149. package/dist/modules/messages/components/message-detail/panels/MessageListComponent.js +1 -1
  150. package/dist/modules/messages/components/message-detail/panels/MessageListComponent.js.map +1 -1
  151. package/dist/modules/messages/components/message-detail/panels/attachments-panel.js +1 -1
  152. package/dist/modules/messages/components/message-detail/panels/attachments-panel.js.map +1 -1
  153. package/dist/modules/payment_gateways/backend/payment-gateways/page.js +11 -11
  154. package/dist/modules/payment_gateways/backend/payment-gateways/page.js.map +2 -2
  155. package/dist/modules/planner/components/AvailabilityRulesEditor.js +2 -2
  156. package/dist/modules/planner/components/AvailabilityRulesEditor.js.map +2 -2
  157. package/dist/modules/portal/frontend/[orgSlug]/portal/dashboard/page.js +2 -2
  158. package/dist/modules/portal/frontend/[orgSlug]/portal/dashboard/page.js.map +2 -2
  159. package/dist/modules/portal/frontend/[orgSlug]/portal/login/page.js +3 -3
  160. package/dist/modules/portal/frontend/[orgSlug]/portal/login/page.js.map +2 -2
  161. package/dist/modules/portal/frontend/[orgSlug]/portal/page.js +3 -3
  162. package/dist/modules/portal/frontend/[orgSlug]/portal/page.js.map +2 -2
  163. package/dist/modules/portal/frontend/[orgSlug]/portal/profile/page.js +4 -4
  164. package/dist/modules/portal/frontend/[orgSlug]/portal/profile/page.js.map +2 -2
  165. package/dist/modules/portal/frontend/[orgSlug]/portal/signup/page.js +4 -4
  166. package/dist/modules/portal/frontend/[orgSlug]/portal/signup/page.js.map +2 -2
  167. package/dist/modules/resources/backend/resources/resources/[id]/page.js +1 -1
  168. package/dist/modules/resources/backend/resources/resources/[id]/page.js.map +1 -1
  169. package/dist/modules/sales/backend/sales/documents/[id]/page.js +4 -4
  170. package/dist/modules/sales/backend/sales/documents/[id]/page.js.map +1 -1
  171. package/dist/modules/sales/components/DocumentNumberSettings.js +1 -1
  172. package/dist/modules/sales/components/DocumentNumberSettings.js.map +1 -1
  173. package/dist/modules/sales/components/channels/ChannelOfferForm.js +1 -1
  174. package/dist/modules/sales/components/channels/ChannelOfferForm.js.map +1 -1
  175. package/dist/modules/sales/components/documents/AdjustmentDialog.js +1 -1
  176. package/dist/modules/sales/components/documents/AdjustmentDialog.js.map +1 -1
  177. package/dist/modules/sales/components/documents/DocumentTotals.js +3 -3
  178. package/dist/modules/sales/components/documents/DocumentTotals.js.map +1 -1
  179. package/dist/modules/sales/components/documents/PaymentDialog.js +1 -1
  180. package/dist/modules/sales/components/documents/PaymentDialog.js.map +1 -1
  181. package/dist/modules/sales/components/documents/SalesDocumentForm.js +2 -2
  182. package/dist/modules/sales/components/documents/SalesDocumentForm.js.map +2 -2
  183. package/dist/modules/sales/widgets/dashboard/new-orders/widget.client.js +4 -4
  184. package/dist/modules/sales/widgets/dashboard/new-orders/widget.client.js.map +1 -1
  185. package/dist/modules/sales/widgets/dashboard/new-quotes/widget.client.js +4 -4
  186. package/dist/modules/sales/widgets/dashboard/new-quotes/widget.client.js.map +1 -1
  187. package/dist/modules/sales/widgets/injection/document-history/widget.client.js +2 -2
  188. package/dist/modules/sales/widgets/injection/document-history/widget.client.js.map +1 -1
  189. package/dist/modules/sales/widgets/messages/SalesDocumentMessageDetail.js +1 -1
  190. package/dist/modules/sales/widgets/messages/SalesDocumentMessageDetail.js.map +1 -1
  191. package/dist/modules/sales/widgets/messages/SalesDocumentMessagePreview.js +1 -1
  192. package/dist/modules/sales/widgets/messages/SalesDocumentMessagePreview.js.map +1 -1
  193. package/dist/modules/shipping_carriers/lib/shipment-wizard/components/PackageEditor.js +1 -1
  194. package/dist/modules/shipping_carriers/lib/shipment-wizard/components/PackageEditor.js.map +1 -1
  195. package/dist/modules/staff/backend/staff/team-members/[id]/page.js +1 -1
  196. package/dist/modules/staff/backend/staff/team-members/[id]/page.js.map +1 -1
  197. package/dist/modules/translations/components/TranslationDrawerAction.js +2 -2
  198. package/dist/modules/translations/components/TranslationDrawerAction.js.map +1 -1
  199. package/dist/modules/translations/components/TranslationManager.js +3 -3
  200. package/dist/modules/translations/components/TranslationManager.js.map +1 -1
  201. package/dist/modules/translations/widgets/injection/translation-manager/widget.client.js +2 -2
  202. package/dist/modules/translations/widgets/injection/translation-manager/widget.client.js.map +1 -1
  203. package/dist/modules/workflows/backend/definitions/[id]/page.js +5 -5
  204. package/dist/modules/workflows/backend/definitions/[id]/page.js.map +2 -2
  205. package/dist/modules/workflows/backend/definitions/visual-editor/page.js +2 -2
  206. package/dist/modules/workflows/backend/definitions/visual-editor/page.js.map +2 -2
  207. package/dist/modules/workflows/backend/events/[id]/page.js +4 -4
  208. package/dist/modules/workflows/backend/events/[id]/page.js.map +1 -1
  209. package/dist/modules/workflows/backend/instances/[id]/page.js +2 -2
  210. package/dist/modules/workflows/backend/instances/[id]/page.js.map +1 -1
  211. package/dist/modules/workflows/backend/tasks/[id]/page.js +20 -20
  212. package/dist/modules/workflows/backend/tasks/[id]/page.js.map +2 -2
  213. package/dist/modules/workflows/components/DefinitionTriggersEditor.js +1 -1
  214. package/dist/modules/workflows/components/DefinitionTriggersEditor.js.map +1 -1
  215. package/dist/modules/workflows/components/EdgeEditDialog.js +12 -12
  216. package/dist/modules/workflows/components/EdgeEditDialog.js.map +1 -1
  217. package/dist/modules/workflows/components/NodeEditDialog.js +26 -26
  218. package/dist/modules/workflows/components/NodeEditDialog.js.map +1 -1
  219. package/dist/modules/workflows/components/fields/FormFieldArrayEditor.js +1 -1
  220. package/dist/modules/workflows/components/fields/FormFieldArrayEditor.js.map +1 -1
  221. package/dist/modules/workflows/components/mobile/MobileDefinitionDetail.js +2 -2
  222. package/dist/modules/workflows/components/mobile/MobileDefinitionDetail.js.map +2 -2
  223. package/dist/modules/workflows/components/mobile/MobileInstanceOverview.js +7 -7
  224. package/dist/modules/workflows/components/mobile/MobileInstanceOverview.js.map +2 -2
  225. package/dist/modules/workflows/components/mobile/MobileTaskForm.js +11 -11
  226. package/dist/modules/workflows/components/mobile/MobileTaskForm.js.map +2 -2
  227. package/dist/modules/workflows/components/mobile/MobileVisualEditor.js +1 -1
  228. package/dist/modules/workflows/components/mobile/MobileVisualEditor.js.map +1 -1
  229. package/dist/modules/workflows/components/mobile/MobileWorkflowTimeline.js +23 -23
  230. package/dist/modules/workflows/components/mobile/MobileWorkflowTimeline.js.map +2 -2
  231. package/dist/modules/workflows/frontend/checkout-demo/page.js +6 -6
  232. package/dist/modules/workflows/frontend/checkout-demo/page.js.map +1 -1
  233. package/package.json +3 -3
  234. package/src/modules/api_docs/frontend/docs/api/Explorer.tsx +18 -18
  235. package/src/modules/api_keys/backend/api-keys/create/page.tsx +1 -1
  236. package/src/modules/attachments/components/AttachmentLibrary.tsx +3 -3
  237. package/src/modules/attachments/components/AttachmentPartitionSettings.tsx +1 -1
  238. package/src/modules/attachments/fields/attachment.tsx +1 -1
  239. package/src/modules/audit_logs/components/ActionLogDetailsDialog.tsx +1 -1
  240. package/src/modules/audit_logs/lib/display-helpers.tsx +1 -1
  241. package/src/modules/auth/backend/users/create/page.tsx +1 -1
  242. package/src/modules/business_rules/backend/rules/page.tsx +7 -7
  243. package/src/modules/business_rules/backend/sets/page.tsx +3 -3
  244. package/src/modules/business_rules/components/ActionBuilder.tsx +6 -6
  245. package/src/modules/business_rules/components/ActionRow.tsx +8 -8
  246. package/src/modules/business_rules/components/ConditionBuilder.tsx +6 -6
  247. package/src/modules/business_rules/components/ConditionGroup.tsx +2 -2
  248. package/src/modules/business_rules/components/ConditionRow.tsx +3 -3
  249. package/src/modules/business_rules/components/RuleSetMembers.tsx +9 -9
  250. package/src/modules/catalog/backend/catalog/products/[id]/page.tsx +2 -2
  251. package/src/modules/catalog/backend/catalog/products/create/page.tsx +5 -5
  252. package/src/modules/catalog/components/products/MetadataEditor.tsx +1 -1
  253. package/src/modules/catalog/components/products/ProductImageCell.tsx +1 -1
  254. package/src/modules/catalog/components/products/VariantBuilder.tsx +1 -1
  255. package/src/modules/catalog/widgets/injection/product-seo/widget.client.tsx +1 -1
  256. package/src/modules/currencies/components/CurrencyFetchingConfig.tsx +1 -1
  257. package/src/modules/customer_accounts/backend/customer_accounts/roles/page.tsx +2 -2
  258. package/src/modules/customer_accounts/backend/customer_accounts/users/[id]/page.tsx +10 -10
  259. package/src/modules/customer_accounts/backend/customer_accounts/users/page.tsx +9 -9
  260. package/src/modules/customer_accounts/widgets/injection/account-status/widget.client.tsx +2 -2
  261. package/src/modules/customers/backend/config/customers/pipeline-stages/page.tsx +3 -3
  262. package/src/modules/customers/backend/customers/deals/pipeline/page.tsx +2 -2
  263. package/src/modules/customers/components/AddressTiles.tsx +1 -1
  264. package/src/modules/customers/components/detail/ActivityForm.tsx +3 -3
  265. package/src/modules/customers/components/detail/AnnualRevenueField.tsx +2 -2
  266. package/src/modules/customers/components/detail/CustomFieldValuesList.tsx +1 -1
  267. package/src/modules/customers/components/detail/DealForm.tsx +1 -1
  268. package/src/modules/customers/components/detail/DealsSection.tsx +1 -1
  269. package/src/modules/customers/components/detail/DetailFieldsSection.tsx +1 -1
  270. package/src/modules/customers/components/detail/InlineEditors.tsx +5 -5
  271. package/src/modules/customers/components/detail/TasksSection.tsx +1 -1
  272. package/src/modules/customers/components/detail/TimelineItemHeader.tsx +1 -1
  273. package/src/modules/customers/components/formConfig.tsx +2 -2
  274. package/src/modules/customers/widgets/dashboard/customer-todos/widget.client.tsx +1 -1
  275. package/src/modules/customers/widgets/dashboard/new-customers/widget.client.tsx +2 -2
  276. package/src/modules/customers/widgets/dashboard/new-deals/widget.client.tsx +1 -1
  277. package/src/modules/customers/widgets/dashboard/next-interactions/widget.client.tsx +1 -1
  278. package/src/modules/dashboards/components/WidgetVisibilityEditor.tsx +1 -1
  279. package/src/modules/dashboards/widgets/dashboard/aov-kpi/widget.client.tsx +1 -1
  280. package/src/modules/dashboards/widgets/dashboard/new-customers-kpi/widget.client.tsx +1 -1
  281. package/src/modules/dashboards/widgets/dashboard/orders-by-status/widget.client.tsx +1 -1
  282. package/src/modules/dashboards/widgets/dashboard/orders-kpi/widget.client.tsx +1 -1
  283. package/src/modules/dashboards/widgets/dashboard/revenue-kpi/widget.client.tsx +1 -1
  284. package/src/modules/dashboards/widgets/dashboard/revenue-trend/widget.client.tsx +2 -2
  285. package/src/modules/dashboards/widgets/dashboard/sales-by-region/widget.client.tsx +1 -1
  286. package/src/modules/dashboards/widgets/dashboard/top-customers/widget.client.tsx +1 -1
  287. package/src/modules/dashboards/widgets/dashboard/top-products/widget.client.tsx +2 -2
  288. package/src/modules/data_sync/backend/data-sync/page.tsx +4 -4
  289. package/src/modules/data_sync/backend/data-sync/runs/[id]/page.tsx +2 -2
  290. package/src/modules/dictionaries/components/AppearanceSelector.tsx +3 -3
  291. package/src/modules/dictionaries/components/DictionariesManager.tsx +4 -4
  292. package/src/modules/dictionaries/components/DictionaryEntriesEditor.tsx +2 -2
  293. package/src/modules/dictionaries/components/DictionaryEntrySelect.tsx +3 -3
  294. package/src/modules/dictionaries/fields/dictionary.tsx +4 -4
  295. package/src/modules/entities/components/EncryptionManager.tsx +3 -3
  296. package/src/modules/entities/components/UserEntitiesTable.tsx +1 -1
  297. package/src/modules/feature_toggles/components/formConfig.tsx +1 -1
  298. package/src/modules/feature_toggles/components/overrideFormConfig.tsx +2 -2
  299. package/src/modules/inbox_ops/backend/inbox-ops/proposals/[id]/page.tsx +12 -12
  300. package/src/modules/inbox_ops/components/messages/InboxEmailPreview.tsx +1 -1
  301. package/src/modules/inbox_ops/components/proposals/ActionCard.tsx +12 -12
  302. package/src/modules/inbox_ops/widgets/notifications/ProposalCreatedRenderer.tsx +4 -4
  303. package/src/modules/integrations/backend/integrations/[id]/page.tsx +6 -6
  304. package/src/modules/messages/components/MessagesInboxPageClient.tsx +1 -1
  305. package/src/modules/messages/components/defaults/DefaultMessageListItem.tsx +1 -1
  306. package/src/modules/messages/components/defaults/MessageRecordObjectDetail.tsx +1 -1
  307. package/src/modules/messages/components/defaults/MessageRecordObjectPreview.tsx +1 -1
  308. package/src/modules/messages/components/message-detail/panels/MessageListComponent.tsx +1 -1
  309. package/src/modules/messages/components/message-detail/panels/attachments-panel.tsx +1 -1
  310. package/src/modules/payment_gateways/backend/payment-gateways/page.tsx +11 -11
  311. package/src/modules/planner/components/AvailabilityRulesEditor.tsx +2 -2
  312. package/src/modules/portal/frontend/[orgSlug]/portal/dashboard/page.tsx +2 -2
  313. package/src/modules/portal/frontend/[orgSlug]/portal/login/page.tsx +3 -3
  314. package/src/modules/portal/frontend/[orgSlug]/portal/page.tsx +3 -3
  315. package/src/modules/portal/frontend/[orgSlug]/portal/profile/page.tsx +4 -4
  316. package/src/modules/portal/frontend/[orgSlug]/portal/signup/page.tsx +4 -4
  317. package/src/modules/resources/backend/resources/resources/[id]/page.tsx +1 -1
  318. package/src/modules/sales/backend/sales/documents/[id]/page.tsx +4 -4
  319. package/src/modules/sales/components/DocumentNumberSettings.tsx +1 -1
  320. package/src/modules/sales/components/channels/ChannelOfferForm.tsx +1 -1
  321. package/src/modules/sales/components/documents/AdjustmentDialog.tsx +1 -1
  322. package/src/modules/sales/components/documents/DocumentTotals.tsx +3 -3
  323. package/src/modules/sales/components/documents/PaymentDialog.tsx +1 -1
  324. package/src/modules/sales/components/documents/SalesDocumentForm.tsx +2 -2
  325. package/src/modules/sales/widgets/dashboard/new-orders/widget.client.tsx +4 -4
  326. package/src/modules/sales/widgets/dashboard/new-quotes/widget.client.tsx +4 -4
  327. package/src/modules/sales/widgets/injection/document-history/widget.client.tsx +2 -2
  328. package/src/modules/sales/widgets/messages/SalesDocumentMessageDetail.tsx +1 -1
  329. package/src/modules/sales/widgets/messages/SalesDocumentMessagePreview.tsx +1 -1
  330. package/src/modules/shipping_carriers/lib/shipment-wizard/components/PackageEditor.tsx +1 -1
  331. package/src/modules/staff/backend/staff/team-members/[id]/page.tsx +1 -1
  332. package/src/modules/translations/components/TranslationDrawerAction.tsx +2 -2
  333. package/src/modules/translations/components/TranslationManager.tsx +3 -3
  334. package/src/modules/translations/widgets/injection/translation-manager/widget.client.tsx +2 -2
  335. package/src/modules/workflows/backend/definitions/[id]/page.tsx +5 -5
  336. package/src/modules/workflows/backend/definitions/visual-editor/page.tsx +2 -2
  337. package/src/modules/workflows/backend/events/[id]/page.tsx +4 -4
  338. package/src/modules/workflows/backend/instances/[id]/page.tsx +2 -2
  339. package/src/modules/workflows/backend/tasks/[id]/page.tsx +23 -23
  340. package/src/modules/workflows/components/DefinitionTriggersEditor.tsx +1 -1
  341. package/src/modules/workflows/components/EdgeEditDialog.tsx +12 -12
  342. package/src/modules/workflows/components/NodeEditDialog.tsx +26 -26
  343. package/src/modules/workflows/components/fields/FormFieldArrayEditor.tsx +1 -1
  344. package/src/modules/workflows/components/mobile/MobileDefinitionDetail.tsx +2 -2
  345. package/src/modules/workflows/components/mobile/MobileInstanceOverview.tsx +7 -7
  346. package/src/modules/workflows/components/mobile/MobileTaskForm.tsx +14 -14
  347. package/src/modules/workflows/components/mobile/MobileVisualEditor.tsx +1 -1
  348. package/src/modules/workflows/components/mobile/MobileWorkflowTimeline.tsx +23 -23
  349. package/src/modules/workflows/frontend/checkout-demo/page.tsx +6 -6
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/modules/api_docs/frontend/docs/api/Explorer.tsx"],
4
- "sourcesContent": ["'use client'\n\nimport { useEffect, useMemo, useState, type ReactNode } from 'react'\nimport Image from 'next/image'\nimport Link from 'next/link'\n\nconst METHOD_STYLES: Record<string, string> = {\n GET: 'bg-emerald-100 text-emerald-800 border border-emerald-200',\n POST: 'bg-blue-100 text-blue-800 border border-blue-200',\n PUT: 'bg-amber-100 text-amber-800 border border-amber-200',\n PATCH: 'bg-purple-100 text-purple-800 border border-purple-200',\n DELETE: 'bg-rose-100 text-rose-800 border border-rose-200',\n}\n\nconst PREFERRED_MEDIA_TYPES = [\n 'application/json',\n 'application/x-www-form-urlencoded',\n 'multipart/form-data',\n 'text/plain',\n]\n\ntype ExplorerOperation = {\n id: string\n path: string\n method: string\n tag: string\n summary?: string\n description?: string\n operation: any\n}\n\ntype ServerOption = { url: string; description?: string }\n\ntype ApiDocsExplorerProps = {\n title: string\n version: string\n description?: string\n operations: ExplorerOperation[]\n tagOrder: string[]\n servers: ServerOption[]\n docsUrl: string\n jsonSpecUrl: string\n markdownSpecUrl: string\n}\n\ntype ContentVariant = {\n mediaType: string\n entry: any\n}\n\ntype TestResponse = {\n status: number\n durationMs: number\n ok: boolean\n body: string\n parsed?: unknown\n}\n\nfunction pickContentVariant(content?: Record<string, any>): ContentVariant | null {\n if (!content) return null\n const entries = Object.entries(content)\n if (!entries.length) return null\n for (const mediaType of PREFERRED_MEDIA_TYPES) {\n const match = entries.find(([candidate]) => candidate === mediaType)\n if (match) {\n return { mediaType: match[0], entry: match[1] }\n }\n }\n const [mediaType, entry] = entries[0]\n return { mediaType, entry }\n}\n\nfunction buildExampleFromSchema(schema: any): unknown {\n if (!schema || typeof schema !== 'object') return undefined\n if (schema.example !== undefined) return schema.example\n if (schema.default !== undefined) return schema.default\n if (Array.isArray(schema.enum) && schema.enum.length) return schema.enum[0]\n\n if (Array.isArray(schema.oneOf) && schema.oneOf.length) return buildExampleFromSchema(schema.oneOf[0])\n if (Array.isArray(schema.anyOf) && schema.anyOf.length) return buildExampleFromSchema(schema.anyOf[0])\n if (Array.isArray(schema.allOf) && schema.allOf.length) {\n return Object.assign({}, ...schema.allOf.map((part: any) => buildExampleFromSchema(part) ?? {}))\n }\n\n const type = Array.isArray(schema.type) ? schema.type[0] : schema.type\n\n if (schema.properties || type === 'object' || (!type && schema.required)) {\n const properties = schema.properties ?? {}\n const result: Record<string, unknown> = {}\n for (const key of Object.keys(properties)) {\n const value = buildExampleFromSchema(properties[key])\n if (value !== undefined) {\n result[key] = value\n }\n }\n if (schema.additionalProperties && typeof schema.additionalProperties === 'object') {\n const value = buildExampleFromSchema(schema.additionalProperties)\n if (value !== undefined) {\n result['additionalProperty'] = value\n }\n }\n return Object.keys(result).length ? result : {}\n }\n\n if (type === 'array') {\n const itemSchema = schema.items ?? (Array.isArray(schema.prefixItems) ? schema.prefixItems[0] : undefined)\n const value = buildExampleFromSchema(itemSchema)\n return value === undefined ? [] : [value]\n }\n\n if (type === 'number' || type === 'integer') return 1\n if (type === 'boolean') return true\n if (schema.format === 'date-time') return new Date('2025-01-01T00:00:00.000Z').toISOString()\n if (schema.format === 'uuid') return '00000000-0000-4000-8000-000000000000'\n if (schema.format === 'email') return 'user@example.com'\n if (schema.format === 'uri' || schema.format === 'url') return 'https://example.com/resource'\n\n return 'string'\n}\n\nfunction stringifyExample(mediaType: string, example: unknown): string {\n if (example === undefined || example === null) return ''\n if (mediaType === 'application/json') {\n try {\n return JSON.stringify(example, null, 2)\n } catch {\n return ''\n }\n }\n if (mediaType === 'application/x-www-form-urlencoded') {\n if (typeof example !== 'object') return ''\n const params = new URLSearchParams()\n for (const [key, value] of Object.entries(example as Record<string, unknown>)) {\n if (value === undefined) continue\n params.append(key, value === null ? '' : String(value))\n }\n return params.toString()\n }\n if (mediaType === 'multipart/form-data') {\n if (typeof example === 'object') {\n return Object.entries(example as Record<string, unknown>)\n .map(([key, value]) => `${key}=${value ?? ''}`)\n .join('\\n')\n }\n return typeof example === 'string' ? example : ''\n }\n if (typeof example === 'string') return example\n try {\n return JSON.stringify(example, null, 2)\n } catch {\n return ''\n }\n}\n\nfunction formatJson(value: unknown): string {\n try {\n return JSON.stringify(value, null, 2)\n } catch {\n return ''\n }\n}\n\nfunction applyPathParams(path: string, params: Record<string, string>): string {\n return path.replace(/\\{([^}]+)\\}/g, (_, key: string) => {\n const value = params[key] ?? ''\n return value ? encodeURIComponent(value) : `{${key}}`\n })\n}\n\ntype Category = {\n tag: string\n operations: ExplorerOperation[]\n}\n\nconst PLACEHOLDER_BASE_URL = 'https://api.your-service.com'\nconst CATEGORY_PAGE_SIZE = 20\n\ntype RequestPreview = {\n method: string\n url: string\n headers: Array<[string, string]>\n body?: string\n jsonBody?: unknown\n mediaType?: string\n usesPlaceholderBase: boolean\n missingPathParam?: string\n bodyParseError?: string\n baseError?: string\n}\n\ntype CodeSnippet = {\n id: string\n label: string\n language: string\n code: string\n}\n\nfunction escapeSingleQuotes(value: string): string {\n return value.replace(/'/g, `'\\\\''`)\n}\n\nfunction escapeSingleQuotesForJs(value: string): string {\n return value.replace(/\\\\/g, '\\\\\\\\').replace(/'/g, \"\\\\'\")\n}\n\nfunction escapeBackticks(value: string): string {\n return value.replace(/\\\\/g, '\\\\\\\\').replace(/`/g, '\\\\`')\n}\n\nfunction toPythonLiteral(value: unknown, indent = 0): string {\n const padding = ' '.repeat(indent)\n if (value === null || value === undefined) return 'None'\n if (typeof value === 'boolean') return value ? 'True' : 'False'\n if (typeof value === 'number' && Number.isFinite(value)) return String(value)\n if (typeof value === 'string') {\n return `'${value.replace(/\\\\/g, '\\\\\\\\').replace(/'/g, \"\\\\'\")}'`\n }\n if (Array.isArray(value)) {\n if (!value.length) return '[]'\n const entries = value\n .map((item) => `${' '.repeat(indent + 1)}${toPythonLiteral(item, indent + 1)}`)\n .join(',\\n')\n return `[\\n${entries},\\n${padding}]`\n }\n if (typeof value === 'object') {\n const entries = Object.entries(value as Record<string, unknown>)\n if (!entries.length) return '{}'\n const lines = entries.map(\n ([key, entry]) =>\n `${' '.repeat(indent + 1)}'${key.replace(/\\\\/g, '\\\\\\\\').replace(/'/g, \"\\\\'\")}': ${toPythonLiteral(entry, indent + 1)}`\n )\n return `{\\n${lines.join(',\\n')},\\n${padding}}`\n }\n return 'None'\n}\n\nexport default function ApiDocsExplorer(props: ApiDocsExplorerProps) {\n const { title, version, description, operations, tagOrder, servers, docsUrl, jsonSpecUrl, markdownSpecUrl } = props\n\n const methodOptions = useMemo(\n () => Array.from(new Set(operations.map((operation) => operation.method))).sort((a, b) => a.localeCompare(b)),\n [operations]\n )\n\n const operationsById = useMemo(() => {\n const map = new Map<string, ExplorerOperation>()\n for (const operation of operations) {\n map.set(operation.id, operation)\n }\n return map\n }, [operations])\n\n const [searchTerm, setSearchTerm] = useState('')\n const [methodFilter, setMethodFilter] = useState<string[]>(methodOptions)\n const [selectedId, setSelectedId] = useState<string>(operations[0]?.id ?? '')\n const [isNavOpen, setIsNavOpen] = useState(false)\n const [isTesterOpen, setIsTesterOpen] = useState(false)\n const [expanded, setExpanded] = useState<Record<string, boolean>>({})\n const [visibleCounts, setVisibleCounts] = useState<Record<string, number>>({})\n const [baseUrl, setBaseUrl] = useState<string>(servers[0]?.url ?? '')\n const [apiKey, setApiKey] = useState<string>('')\n\n useEffect(() => {\n setMethodFilter(methodOptions)\n }, [methodOptions])\n\n useEffect(() => {\n if (servers.length === 0) return\n setBaseUrl((prev) => {\n if (!prev) return servers[0].url\n return prev\n })\n }, [servers])\n\n const filteredOperations = useMemo(() => {\n const lowered = searchTerm.trim().toLowerCase()\n return operations.filter((operation) => {\n if (!methodFilter.includes(operation.method)) return false\n if (!lowered) return true\n return (\n operation.path.toLowerCase().includes(lowered) ||\n (operation.summary && operation.summary.toLowerCase().includes(lowered)) ||\n (operation.description && operation.description.toLowerCase().includes(lowered))\n )\n })\n }, [operations, methodFilter, searchTerm])\n\n const categories = useMemo(() => {\n const grouped = new Map<string, ExplorerOperation[]>()\n for (const operation of filteredOperations) {\n const list = grouped.get(operation.tag) ?? []\n list.push(operation)\n grouped.set(operation.tag, list)\n }\n const ordered: Category[] = []\n for (const tag of tagOrder) {\n const list = grouped.get(tag)\n if (list && list.length) {\n ordered.push({ tag, operations: list })\n grouped.delete(tag)\n }\n }\n const remaining = Array.from(grouped.entries()).sort(([a], [b]) => a.localeCompare(b))\n for (const [tag, ops] of remaining) {\n ordered.push({ tag, operations: ops })\n }\n return ordered\n }, [filteredOperations, tagOrder])\n\n useEffect(() => {\n setExpanded((prev) => {\n const next: Record<string, boolean> = {}\n for (const category of categories) {\n next[category.tag] = prev[category.tag] ?? true\n }\n return next\n })\n setVisibleCounts((prev) => {\n const next: Record<string, number> = {}\n for (const category of categories) {\n const total = category.operations.length\n const previous = prev[category.tag] ?? CATEGORY_PAGE_SIZE\n next[category.tag] = Math.min(total, previous)\n }\n return next\n })\n }, [categories])\n\n useEffect(() => {\n if (!selectedId && filteredOperations.length) {\n setSelectedId(filteredOperations[0].id)\n return\n }\n if (selectedId && filteredOperations.some((operation) => operation.id === selectedId)) return\n if (filteredOperations.length) {\n setSelectedId(filteredOperations[0].id)\n }\n }, [filteredOperations, selectedId])\n\n const selectedOperation =\n (selectedId ? operationsById.get(selectedId) : undefined) ?? filteredOperations[0] ?? operations[0] ?? null\n\n const shouldOpenTesterOverlay = () => {\n if (typeof window === 'undefined') return false\n return window.innerWidth < 1280\n }\n\n const handleSelectOperation = (operationId: string) => {\n setSelectedId(operationId)\n const targetCategory = categories.find((category) =>\n category.operations.some((operation) => operation.id === operationId)\n )\n if (targetCategory) {\n const index = targetCategory.operations.findIndex((operation) => operation.id === operationId)\n if (index >= 0) {\n setVisibleCounts((prev) => {\n const currentVisible = prev[targetCategory.tag] ?? CATEGORY_PAGE_SIZE\n if (index < currentVisible) return prev\n return { ...prev, [targetCategory.tag]: index + 1 }\n })\n }\n }\n requestAnimationFrame(() => {\n const element = document.getElementById(`operation-${operationId}`)\n if (element) element.scrollIntoView({ behavior: 'smooth', block: 'start', inline: 'nearest' })\n })\n if (shouldOpenTesterOverlay()) setIsTesterOpen(true)\n setIsNavOpen(false)\n }\n\n return (\n <div className=\"min-h-screen bg-background text-foreground\">\n <header className=\"border-b bg-card\">\n <div className=\"mx-auto flex w-full max-w-screen-2xl flex-col gap-4 px-6 py-6 lg:flex-row lg:items-center lg:justify-between\">\n <div className=\"flex items-center gap-4\">\n <button\n type=\"button\"\n className=\"inline-flex h-10 w-10 items-center justify-center rounded-md border border-border text-sm font-medium text-muted-foreground hover:border-foreground hover:text-foreground lg:hidden\"\n onClick={() => setIsNavOpen(true)}\n >\n <span className=\"sr-only\">Open navigation</span>\n \u2630\n </button>\n <Link href=\"/\" className=\"flex items-center gap-3\">\n <Image src=\"/open-mercato.svg\" alt=\"Open Mercato\" width={36} height={36} />\n <div>\n <div className=\"text-base font-semibold leading-tight\">{title}</div>\n <div className=\"text-xs text-muted-foreground\">Version {version}</div>\n </div>\n </Link>\n </div>\n <div className=\"flex flex-wrap items-center justify-end gap-2\">\n <nav className=\"hidden items-center gap-2 text-xs text-muted-foreground sm:flex\">\n <Link href=\"/\" className=\"hover:text-foreground hover:underline\">\n Home\n </Link>\n <span>/</span>\n <span>Docs</span>\n <span>/</span>\n <span className=\"font-medium text-foreground\">API Explorer</span>\n </nav>\n <button\n type=\"button\"\n className=\"inline-flex h-10 items-center justify-center rounded-md border border-border px-3 text-sm font-medium text-muted-foreground hover:border-foreground hover:text-foreground xl:hidden\"\n onClick={() => setIsTesterOpen(true)}\n >\n Try Endpoint\n </button>\n <Link\n href={jsonSpecUrl}\n target=\"_blank\"\n rel=\"noreferrer\"\n className=\"inline-flex h-10 items-center justify-center rounded-md border border-border px-3 text-sm font-medium text-muted-foreground hover:border-foreground hover:text-foreground\"\n >\n OpenAPI JSON\n </Link>\n <Link\n href={markdownSpecUrl}\n target=\"_blank\"\n rel=\"noreferrer\"\n className=\"inline-flex h-10 items-center justify-center rounded-md border border-border px-3 text-sm font-medium text-muted-foreground hover:border-foreground hover:text-foreground\"\n >\n Markdown Docs\n </Link>\n <Link\n href={docsUrl}\n target=\"_blank\"\n rel=\"noreferrer\"\n className=\"hidden rounded-md border border-primary/30 px-4 py-2 text-sm font-medium text-primary hover:bg-primary/10 sm:inline-flex\"\n >\n View full docs\n </Link>\n </div>\n </div>\n </header>\n\n <main className=\"mx-auto flex w-full max-w-screen-2xl flex-1 flex-col px-6 py-8 lg:flex-row lg:gap-6\">\n <aside className=\"hidden w-64 shrink-0 lg:block\">\n <div className=\"sticky top-20 max-h-[calc(100vh-6rem)] overflow-y-auto rounded-lg border bg-card p-4\">\n <h2 className=\"text-sm font-semibold uppercase tracking-wide text-muted-foreground\">API Categories</h2>\n <nav className=\"mt-4 space-y-4 text-sm\">\n {categories.map((category) => {\n const isExpanded = expanded[category.tag] ?? true\n return (\n <div key={category.tag} className=\"space-y-2\">\n <button\n type=\"button\"\n className=\"flex w-full items-center justify-between rounded-md bg-muted px-3 py-2 text-left font-medium text-foreground hover:bg-muted/80\"\n onClick={() =>\n setExpanded((prev) => ({\n ...prev,\n [category.tag]: !isExpanded,\n }))\n }\n >\n <span>{category.tag}</span>\n <span className=\"text-xs text-muted-foreground\">{isExpanded ? '\u2212' : '+'}</span>\n </button>\n {isExpanded ? (\n <ul className=\"space-y-1 pl-2\">\n {category.operations.map((operation) => (\n <li key={operation.id}>\n <button\n type=\"button\"\n className={`flex w-full items-center gap-2 rounded-md px-3 py-2 text-left transition ${\n selectedOperation?.id === operation.id\n ? 'bg-primary/10 text-primary'\n : 'text-muted-foreground hover:bg-muted hover:text-foreground'\n }`}\n onClick={() => handleSelectOperation(operation.id)}\n >\n <span\n className={`inline-flex min-w-[3rem] justify-center rounded border px-2 py-0.5 text-[11px] font-semibold uppercase ${\n METHOD_STYLES[operation.method] ?? 'border border-border bg-muted text-foreground'\n }`}\n >\n {operation.method}\n </span>\n <span className=\"truncate text-xs\">{operation.path}</span>\n </button>\n </li>\n ))}\n </ul>\n ) : null}\n </div>\n )\n })}\n </nav>\n </div>\n </aside>\n\n <section className=\"flex-1 space-y-6\">\n <div className=\"rounded-lg border bg-card p-5 shadow-sm\">\n <div className=\"space-y-3\">\n <div className=\"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between\">\n <div>\n <h1 className=\"text-2xl font-semibold\">OpenAPI Explorer</h1>\n {description ? <p className=\"text-sm text-muted-foreground\">{description}</p> : null}\n </div>\n <div className=\"text-xs text-muted-foreground\">\n {servers[0]?.url ? <span>Default server: {servers[0].url}</span> : <span>Server URL not configured.</span>}\n </div>\n </div>\n <div className=\"flex flex-col gap-3 lg:flex-row lg:items-center lg:justify-between\">\n <div className=\"flex flex-1 items-center gap-3\">\n <input\n type=\"search\"\n value={searchTerm}\n onChange={(event) => setSearchTerm(event.target.value)}\n placeholder=\"Search endpoints by path or summary\"\n className=\"flex-1 rounded-md border border-border bg-background px-3 py-2 text-sm focus:border-primary focus:outline-none focus:ring-2 focus:ring-primary/20\"\n />\n </div>\n <div className=\"flex flex-wrap gap-2 text-xs\">\n {methodOptions.map((method) => {\n const isActive = methodFilter.includes(method)\n return (\n <button\n key={method}\n type=\"button\"\n className={`rounded-md border px-3 py-1 font-semibold uppercase transition ${\n isActive\n ? 'border-primary bg-primary/10 text-primary'\n : 'border-border text-muted-foreground hover:border-foreground hover:text-foreground'\n }`}\n onClick={() => {\n setMethodFilter((prev) => {\n if (prev.includes(method)) {\n const next = prev.filter((entry) => entry !== method)\n return next.length ? next : prev\n }\n return [...prev, method]\n })\n }}\n >\n {method}\n </button>\n )\n })}\n </div>\n </div>\n </div>\n </div>\n\n <div className=\"space-y-8\">\n {categories.map((category) => {\n const totalCount = category.operations.length\n const visibleCount = Math.min(\n totalCount,\n visibleCounts[category.tag] ?? CATEGORY_PAGE_SIZE\n )\n const visibleOperations = category.operations.slice(0, visibleCount)\n const hiddenCount = totalCount - visibleCount\n return (\n <div key={category.tag} className=\"space-y-4\">\n <div className=\"flex items-center justify-between\">\n <h2 className=\"text-lg font-semibold\">{category.tag}</h2>\n <div className=\"text-xs text-muted-foreground\">\n Showing {visibleCount} of {totalCount} endpoints\n </div>\n </div>\n <div className=\"space-y-6\">\n {visibleOperations.map((operation) => {\n const methodClass = METHOD_STYLES[operation.method] ?? 'border border-border bg-muted text-foreground'\n const operationId = `operation-${operation.id}`\n const contentVariant = pickContentVariant(operation.operation?.requestBody?.content)\n const contentExample =\n contentVariant?.entry?.example ??\n contentVariant?.entry?.examples?.default?.value ??\n buildExampleFromSchema(contentVariant?.entry?.schema)\n const requestSnippet =\n contentVariant && contentExample\n ? stringifyExample(contentVariant.mediaType, contentExample)\n : undefined\n\n return (\n <article\n key={operation.id}\n id={operationId}\n className={`rounded-lg border bg-card shadow-sm transition ${\n selectedOperation?.id === operation.id ? 'ring-2 ring-primary/40' : ''\n }`}\n >\n <div className=\"flex flex-col gap-4 border-b bg-muted/40 px-5 py-4 md:flex-row md:items-center md:justify-between\">\n <div className=\"flex items-center gap-3\">\n <span className={`rounded px-3 py-1 text-xs font-semibold uppercase ${methodClass}`}>\n {operation.method}\n </span>\n <code className=\"text-sm text-foreground\">{operation.path}</code>\n </div>\n <div className=\"flex items-center gap-2 text-[11px] text-muted-foreground\">\n {operation.operation?.['x-require-auth'] ? (\n <span className=\"rounded bg-amber-100 px-2 py-0.5 text-amber-900\">Auth required</span>\n ) : null}\n {Array.isArray(operation.operation?.['x-require-features'])\n ? operation.operation['x-require-features'].map((feature: string) => (\n <span key={feature} className=\"rounded bg-blue-100 px-2 py-0.5 text-blue-900\">\n {feature}\n </span>\n ))\n : null}\n </div>\n </div>\n <div className=\"space-y-5 p-5\">\n <div className=\"space-y-2\">\n {operation.summary ? <h3 className=\"text-lg font-semibold\">{operation.summary}</h3> : null}\n {operation.description ? (\n <p className=\"text-sm text-muted-foreground whitespace-pre-line\">\n {operation.description}\n </p>\n ) : null}\n </div>\n\n {Array.isArray(operation.operation?.parameters) &&\n operation.operation.parameters.length ? (\n <section className=\"space-y-3\">\n <h4 className=\"text-xs font-semibold uppercase tracking-wide text-muted-foreground\">\n Parameters\n </h4>\n <div className=\"overflow-hidden rounded-lg border\">\n <table className=\"min-w-full divide-y divide-border text-left text-xs\">\n <thead className=\"bg-muted/60 text-[11px] uppercase tracking-wide text-muted-foreground\">\n <tr>\n <th className=\"px-3 py-2 font-medium\">Name</th>\n <th className=\"px-3 py-2 font-medium\">In</th>\n <th className=\"px-3 py-2 font-medium\">Required</th>\n <th className=\"px-3 py-2 font-medium\">Schema</th>\n <th className=\"px-3 py-2 font-medium\">Description</th>\n </tr>\n </thead>\n <tbody className=\"divide-y divide-border text-xs\">\n {operation.operation.parameters.map((parameter: any) => (\n <tr key={`${parameter.in}-${parameter.name}`}>\n <td className=\"px-3 py-2 font-medium text-foreground\">{parameter.name}</td>\n <td className=\"px-3 py-2 text-muted-foreground\">{parameter.in}</td>\n <td className=\"px-3 py-2 text-muted-foreground\">\n {parameter.required ? 'Yes' : 'No'}\n </td>\n <td className=\"px-3 py-2 text-muted-foreground\">\n {parameter.schema?.type ?? 'any'}\n </td>\n <td className=\"px-3 py-2 text-muted-foreground\">\n {parameter.description ?? '\u2014'}\n </td>\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n </section>\n ) : null}\n\n {contentVariant ? (\n <section className=\"space-y-3\">\n <h4 className=\"text-xs font-semibold uppercase tracking-wide text-muted-foreground\">\n Request body ({contentVariant.mediaType})\n </h4>\n {requestSnippet ? (\n <pre className=\"max-h-80 overflow-auto rounded-lg bg-muted px-4 py-3 text-xs leading-relaxed\">\n {requestSnippet}\n </pre>\n ) : (\n <p className=\"text-xs text-muted-foreground\">\n No example available for this content type.\n </p>\n )}\n </section>\n ) : null}\n\n {operation.operation?.responses ? (\n <section className=\"space-y-3\">\n <h4 className=\"text-xs font-semibold uppercase tracking-wide text-muted-foreground\">\n Responses\n </h4>\n <div className=\"space-y-3\">\n {Object.entries(operation.operation.responses).map(([status, response]: [string, any]) => {\n if (response?.['x-autoGenerated']) return null\n const responseVariant = pickContentVariant(response?.content)\n const responseExample =\n responseVariant?.entry?.example ??\n responseVariant?.entry?.examples?.default?.value ??\n buildExampleFromSchema(responseVariant?.entry?.schema)\n const responseSnippet =\n responseVariant && responseExample\n ? stringifyExample(responseVariant.mediaType, responseExample)\n : undefined\n\n return (\n <div key={status} className=\"rounded-lg border\">\n <div className=\"flex items-center justify-between border-b bg-muted/60 px-4 py-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground\">\n <span>{status}</span>\n <span className=\"text-muted-foreground\">\n {response?.description ?? 'Response'}\n </span>\n </div>\n {responseVariant ? (\n <div className=\"border-b bg-muted/40 px-4 py-2 text-[11px] text-muted-foreground\">\n Content-Type: {responseVariant.mediaType}\n </div>\n ) : null}\n {responseSnippet ? (\n <pre className=\"max-h-80 overflow-auto bg-muted px-4 py-3 text-xs leading-relaxed\">\n {responseSnippet}\n </pre>\n ) : (\n <p className=\"px-4 py-3 text-xs text-muted-foreground\">\n {responseVariant ? 'No example available for this content type.' : 'No response body.'}\n </p>\n )}\n </div>\n )\n })}\n </div>\n </section>\n ) : null}\n\n {Array.isArray(operation.operation?.['x-codeSamples']) &&\n operation.operation['x-codeSamples'].length ? (\n <section className=\"space-y-3\">\n <h4 className=\"text-xs font-semibold uppercase tracking-wide text-muted-foreground\">\n Example\n </h4>\n <pre className=\"overflow-auto rounded-lg bg-muted px-4 py-3 text-xs leading-relaxed\">\n {operation.operation['x-codeSamples'][0].source}\n </pre>\n </section>\n ) : null}\n\n <div className=\"flex flex-wrap gap-3\">\n <button\n type=\"button\"\n className=\"inline-flex items-center rounded-md border border-primary px-4 py-2 text-sm font-semibold text-primary hover:bg-primary/10\"\n onClick={() => {\n setSelectedId(operation.id)\n if (shouldOpenTesterOverlay()) setIsTesterOpen(true)\n }}\n >\n Test this endpoint\n </button>\n <button\n type=\"button\"\n className=\"inline-flex items-center rounded-md border border-border px-4 py-2 text-sm text-muted-foreground hover:border-foreground hover:text-foreground\"\n onClick={() => handleSelectOperation(operation.id)}\n >\n Jump to tester\n </button>\n </div>\n </div>\n </article>\n )\n })}\n </div>\n {hiddenCount > 0 ? (\n <div className=\"flex justify-center\">\n <button\n type=\"button\"\n className=\"inline-flex items-center rounded-md border border-border px-4 py-2 text-sm font-medium text-muted-foreground hover:border-foreground hover:text-foreground\"\n onClick={() =>\n setVisibleCounts((prev) => ({\n ...prev,\n [category.tag]: Math.min(\n totalCount,\n (prev[category.tag] ?? CATEGORY_PAGE_SIZE) + CATEGORY_PAGE_SIZE\n ),\n }))\n }\n >\n Show {Math.min(CATEGORY_PAGE_SIZE, hiddenCount)} more endpoints\n </button>\n </div>\n ) : null}\n </div>\n )\n })}\n {!categories.length ? (\n <div className=\"rounded-lg border border-dashed bg-muted/40 p-6 text-center text-sm text-muted-foreground\">\n No endpoints match your filters. Try adjusting the method filters or clearing the search query.\n </div>\n ) : null}\n </div>\n </section>\n\n <aside className=\"hidden w-96 shrink-0 xl:block\">\n <div className=\"sticky top-20 max-h-[calc(100vh-6rem)] overflow-y-auto\">\n <TesterPanel\n key={selectedOperation?.id ?? 'tester'}\n operation={selectedOperation}\n baseUrl={baseUrl}\n setBaseUrl={setBaseUrl}\n baseUrlOptions={servers}\n apiKey={apiKey}\n setApiKey={setApiKey}\n />\n </div>\n </aside>\n </main>\n\n <footer className=\"border-t bg-card\">\n <div className=\"mx-auto flex w-full max-w-screen-2xl flex-col gap-4 px-6 py-6 md:flex-row md:items-center md:justify-between\">\n <div className=\"text-sm text-muted-foreground\">\u00A9 {new Date().getFullYear()} Open Mercato. All rights reserved.</div>\n <div className=\"flex flex-wrap items-center gap-4 text-sm text-muted-foreground\">\n <Link href={docsUrl} target=\"_blank\" rel=\"noreferrer\" className=\"hover:text-foreground hover:underline\">\n Documentation\n </Link>\n <Link\n href=\"https://openmercato.com/privacy\"\n target=\"_blank\"\n rel=\"noreferrer\"\n className=\"hover:text-foreground hover:underline\"\n >\n Privacy\n </Link>\n <Link\n href=\"https://openmercato.com/terms\"\n target=\"_blank\"\n rel=\"noreferrer\"\n className=\"hover:text-foreground hover:underline\"\n >\n Terms\n </Link>\n </div>\n </div>\n </footer>\n\n {isNavOpen ? (\n <MobileOverlay title=\"API categories\" onClose={() => setIsNavOpen(false)}>\n <div className=\"space-y-4\">\n <div className=\"flex items-center justify-between\">\n <h2 className=\"text-sm font-semibold uppercase tracking-wide text-muted-foreground\">API Categories</h2>\n <button\n type=\"button\"\n className=\"text-sm text-muted-foreground hover:text-foreground\"\n onClick={() => setIsNavOpen(false)}\n >\n Close\n </button>\n </div>\n <div className=\"max-h-[70vh] space-y-4 overflow-y-auto\">\n {categories.map((category) => (\n <div key={`mobile-${category.tag}`} className=\"space-y-2\">\n <div className=\"font-semibold text-foreground\">{category.tag}</div>\n <ul className=\"space-y-2\">\n {category.operations.map((operation) => (\n <li key={`mobile-${operation.id}`}>\n <button\n type=\"button\"\n className={`flex w-full items-center gap-2 rounded-md border px-3 py-2 text-left text-sm ${\n selectedOperation?.id === operation.id\n ? 'border-primary text-primary'\n : 'border-border text-muted-foreground'\n }`}\n onClick={() => handleSelectOperation(operation.id)}\n >\n <span\n className={`inline-flex min-w-[3rem] justify-center rounded border px-2 py-0.5 text-[11px] font-semibold uppercase ${\n METHOD_STYLES[operation.method] ?? 'border border-border bg-muted text-foreground'\n }`}\n >\n {operation.method}\n </span>\n <span className=\"truncate\">{operation.path}</span>\n </button>\n </li>\n ))}\n </ul>\n </div>\n ))}\n </div>\n </div>\n </MobileOverlay>\n ) : null}\n\n {isTesterOpen ? (\n <MobileOverlay title=\"API tester\" onClose={() => setIsTesterOpen(false)}>\n <TesterPanel\n key={`mobile-${selectedOperation?.id ?? 'tester'}`}\n operation={selectedOperation}\n baseUrl={baseUrl}\n setBaseUrl={setBaseUrl}\n baseUrlOptions={servers}\n apiKey={apiKey}\n setApiKey={setApiKey}\n />\n </MobileOverlay>\n ) : null}\n </div>\n )\n}\n\nfunction CodeSnippetTabs(props: { snippets: CodeSnippet[] }) {\n const { snippets } = props\n const [activeId, setActiveId] = useState(snippets[0]?.id ?? '')\n const [copied, setCopied] = useState(false)\n\n useEffect(() => {\n const first = snippets[0]?.id ?? ''\n setActiveId((current) => (snippets.some((snippet) => snippet.id === current) ? current : first))\n }, [snippets])\n\n useEffect(() => {\n setCopied(false)\n }, [activeId])\n\n useEffect(() => {\n if (!copied) return\n const timeout = window.setTimeout(() => setCopied(false), 2000)\n return () => window.clearTimeout(timeout)\n }, [copied])\n\n if (!snippets.length) {\n return null\n }\n\n const activeSnippet = snippets.find((snippet) => snippet.id === activeId) ?? snippets[0]\n\n const handleCopy = async () => {\n if (!activeSnippet) return\n if (typeof navigator === 'undefined' || !navigator.clipboard) return\n try {\n await navigator.clipboard.writeText(activeSnippet.code)\n setCopied(true)\n } catch {\n setCopied(false)\n }\n }\n\n return (\n <div className=\"space-y-2\">\n <div className=\"flex items-center justify-between gap-2\">\n <div className=\"flex flex-wrap gap-2\">\n {snippets.map((snippet) => (\n <button\n type=\"button\"\n key={snippet.id}\n className={`rounded-md border px-3 py-1 text-xs font-semibold ${\n snippet.id === activeSnippet.id\n ? 'border-primary bg-primary/10 text-primary'\n : 'border-border text-muted-foreground hover:border-foreground hover:text-foreground'\n }`}\n onClick={() => setActiveId(snippet.id)}\n >\n {snippet.label}\n </button>\n ))}\n </div>\n <button\n type=\"button\"\n className=\"inline-flex items-center rounded-md border border-border px-3 py-1 text-xs font-semibold text-muted-foreground hover:border-foreground hover:text-foreground\"\n onClick={handleCopy}\n >\n {copied ? 'Copied' : 'Copy'}\n </button>\n </div>\n <pre className=\"max-h-80 overflow-auto rounded-md bg-muted px-3 py-2 text-xs leading-relaxed\">\n {activeSnippet.code}\n </pre>\n </div>\n )\n}\n\nfunction MobileOverlay(props: { title: string; children: ReactNode; onClose: () => void }) {\n const { title, children, onClose } = props\n return (\n <div className=\"fixed inset-0 z-50 flex flex-col bg-background/95 backdrop-blur\">\n <div className=\"border-b bg-card px-6 py-4\">\n <div className=\"flex items-center justify-between\">\n <h2 className=\"text-base font-semibold text-foreground\">{title}</h2>\n <button\n type=\"button\"\n className=\"rounded-md border border-border px-3 py-1 text-sm text-muted-foreground hover:border-foreground hover:text-foreground\"\n onClick={onClose}\n >\n Close\n </button>\n </div>\n </div>\n <div className=\"flex-1 overflow-y-auto px-6 py-4\">{children}</div>\n </div>\n )\n}\n\ntype TesterPanelProps = {\n operation: ExplorerOperation | null\n baseUrl: string\n setBaseUrl: (value: string) => void\n baseUrlOptions: ServerOption[]\n apiKey: string\n setApiKey: (value: string) => void\n}\n\nfunction TesterPanel(props: TesterPanelProps) {\n const { operation, baseUrl, setBaseUrl, baseUrlOptions, apiKey, setApiKey } = props\n const [pathValues, setPathValues] = useState<Record<string, string>>({})\n const [queryValues, setQueryValues] = useState<Record<string, string>>({})\n const [bodyContent, setBodyContent] = useState<string>('')\n const [response, setResponse] = useState<TestResponse | null>(null)\n const [error, setError] = useState<string | null>(null)\n const [isLoading, setIsLoading] = useState(false)\n\n const parameters = useMemo(\n () => (operation && Array.isArray(operation.operation?.parameters) ? operation.operation.parameters : []),\n [operation]\n )\n const pathParams = useMemo(\n () => parameters.filter((parameter: any) => parameter.in === 'path'),\n [parameters]\n )\n const queryParams = useMemo(\n () => parameters.filter((parameter: any) => parameter.in === 'query'),\n [parameters]\n )\n const requestVariant = useMemo(\n () => (operation ? pickContentVariant(operation.operation?.requestBody?.content) : null),\n [operation]\n )\n const mergedBaseUrls = useMemo(() => {\n if (!baseUrl) return baseUrlOptions\n if (baseUrlOptions.some((server) => server.url === baseUrl)) return baseUrlOptions\n return [...baseUrlOptions, { url: baseUrl }]\n }, [baseUrlOptions, baseUrl])\n\n const requestPreview = useMemo<RequestPreview | null>(() => {\n if (!operation) return null\n const method = operation.method.toUpperCase()\n const rawBase = baseUrl.trim()\n const normalizedBase = rawBase || PLACEHOLDER_BASE_URL\n const usesPlaceholderBase = !rawBase\n const baseWithSlash = normalizedBase.endsWith('/') ? normalizedBase : `${normalizedBase}/`\n const resolvedPath = applyPathParams(operation.path, pathValues)\n const relativePath = resolvedPath.replace(/^\\//, '')\n\n let url: URL\n try {\n url = new URL(relativePath, baseWithSlash)\n } catch {\n return {\n method,\n url: '',\n headers: [],\n mediaType: requestVariant?.mediaType,\n usesPlaceholderBase,\n baseError: 'Base URL must be absolute (include protocol, e.g. https://api.example.com).',\n }\n }\n\n for (const [key, value] of Object.entries(queryValues)) {\n if (!value) continue\n url.searchParams.append(key, value)\n }\n\n const headers: Array<[string, string]> = [['Accept', 'application/json']]\n const trimmedKey = apiKey.trim()\n if (trimmedKey) {\n headers.push(['Authorization', `ApiKey ${trimmedKey}`])\n headers.push(['X-Api-Key', trimmedKey])\n }\n\n let body: string | undefined\n let jsonBody: unknown\n let bodyParseError: string | undefined\n\n if (requestVariant && method !== 'GET' && method !== 'HEAD') {\n headers.push(['Content-Type', requestVariant.mediaType])\n if (requestVariant.mediaType === 'application/json') {\n if (bodyContent.trim()) {\n try {\n jsonBody = JSON.parse(bodyContent)\n body = JSON.stringify(jsonBody)\n } catch {\n bodyParseError = 'Request body must be valid JSON.'\n }\n }\n } else {\n if (bodyContent) {\n body = bodyContent\n }\n }\n }\n\n const missingPathParam = pathParams.find((parameter: any) => parameter.required && !pathValues[parameter.name])\n\n return {\n method,\n url: url.toString(),\n headers,\n body,\n jsonBody,\n mediaType: requestVariant?.mediaType,\n usesPlaceholderBase,\n missingPathParam: missingPathParam?.name,\n bodyParseError,\n }\n }, [operation, baseUrl, pathValues, queryValues, apiKey, requestVariant, bodyContent, pathParams])\n\n const codeSnippets = useMemo<CodeSnippet[]>(() => {\n if (!requestPreview || requestPreview.baseError) return []\n\n const snippets: CodeSnippet[] = []\n const { method, url, headers, body, jsonBody, mediaType } = requestPreview\n\n if (url) {\n const curlParts = [`curl -X ${method} '${escapeSingleQuotes(url)}'`]\n for (const [key, value] of headers) {\n curlParts.push(` -H '${escapeSingleQuotes(`${key}: ${value}`)}'`)\n }\n if (body) {\n curlParts.push(` --data '${escapeSingleQuotes(body)}'`)\n }\n snippets.push({\n id: 'curl',\n label: 'cURL',\n language: 'bash',\n code: curlParts.join(' \\\\\\n'),\n })\n\n const headerEntries =\n headers.length === 0\n ? ''\n : headers.map(([key, value]) => ` '${key}': '${escapeSingleQuotesForJs(value)}',`).join('\\n')\n const tsLines: string[] = [\n `const url = '${escapeSingleQuotesForJs(url)}';`,\n headerEntries ? `const headers = {\\n${headerEntries}\\n};` : 'const headers = {};',\n ]\n\n if (mediaType === 'application/json' && jsonBody !== undefined) {\n const payloadLiteral = JSON.stringify(jsonBody, null, 2)\n tsLines.push('', `const payload = ${payloadLiteral};`)\n tsLines.push(\n '',\n 'const response = await fetch(url, {',\n ` method: '${method}',`,\n ' headers,',\n ' body: JSON.stringify(payload),',\n '});'\n )\n } else if (body) {\n tsLines.push('', `const body = \\`${escapeBackticks(body)}\\`;`)\n tsLines.push(\n '',\n 'const response = await fetch(url, {',\n ` method: '${method}',`,\n ' headers,',\n ' body,',\n '});'\n )\n } else {\n tsLines.push(\n '',\n 'const response = await fetch(url, {',\n ` method: '${method}',`,\n ' headers,',\n '});'\n )\n }\n tsLines.push('const data = await response.json();', 'console.log(data);')\n\n snippets.push({\n id: 'typescript',\n label: 'TypeScript',\n language: 'ts',\n code: tsLines.join('\\n'),\n })\n\n const pythonLines: string[] = [\"import requests\", \"\", `url = '${escapeSingleQuotesForJs(url)}'`]\n if (headers.length) {\n const pythonHeaders = headers\n .map(([key, value]) => ` '${key}': '${escapeSingleQuotesForJs(value)}',`)\n .join('\\n')\n pythonLines.push('headers = {', pythonHeaders, '}')\n } else {\n pythonLines.push('headers = {}')\n }\n\n if (mediaType === 'application/json' && jsonBody !== undefined) {\n const pythonPayload = toPythonLiteral(jsonBody)\n pythonLines.push('', `payload = ${pythonPayload}`)\n pythonLines.push(\n `response = requests.request('${method}', url, headers=headers, json=payload)`\n )\n } else if (body) {\n pythonLines.push('', `data = ${toPythonLiteral(body)}`)\n pythonLines.push(`response = requests.request('${method}', url, headers=headers, data=data)`)\n } else {\n pythonLines.push('', `response = requests.request('${method}', url, headers=headers)`)\n }\n pythonLines.push('print(response.status_code)', 'print(response.text)')\n\n snippets.push({\n id: 'python',\n label: 'Python',\n language: 'python',\n code: pythonLines.join('\\n'),\n })\n }\n\n return snippets\n }, [requestPreview])\n\n useEffect(() => {\n const nextPath: Record<string, string> = {}\n for (const parameter of pathParams) {\n nextPath[parameter.name] = ''\n }\n const nextQuery: Record<string, string> = {}\n for (const parameter of queryParams) {\n nextQuery[parameter.name] = ''\n }\n setPathValues(nextPath)\n setQueryValues(nextQuery)\n\n if (requestVariant) {\n const example =\n requestVariant.entry?.example ??\n requestVariant.entry?.examples?.default?.value ??\n buildExampleFromSchema(requestVariant.entry?.schema)\n setBodyContent(example ? stringifyExample(requestVariant.mediaType, example) : '')\n } else {\n setBodyContent('')\n }\n setResponse(null)\n setError(null)\n }, [operation?.id, pathParams, queryParams, requestVariant])\n\n if (!operation) {\n return (\n <div className=\"rounded-lg border bg-card p-5 text-sm text-muted-foreground\">\n Select an endpoint to start testing requests.\n </div>\n )\n }\n\n const handleSubmit = async () => {\n if (!operation) return\n if (!baseUrl.trim()) {\n setError('Please provide a base URL for the request.')\n return\n }\n if (requestPreview?.baseError) {\n setError(requestPreview.baseError)\n return\n }\n if (requestPreview?.missingPathParam) {\n setError(`Path parameter \"${requestPreview.missingPathParam}\" is required.`)\n return\n }\n if (requestPreview?.bodyParseError) {\n setError(requestPreview.bodyParseError)\n return\n }\n if (!requestPreview) {\n setError('Unable to prepare the request. Check your input and try again.')\n return\n }\n\n setIsLoading(true)\n setError(null)\n setResponse(null)\n\n try {\n const started = performance.now()\n const res = await fetch(requestPreview.url, {\n method: requestPreview.method,\n headers: Object.fromEntries(requestPreview.headers),\n body: requestPreview.body,\n })\n const duration = performance.now() - started\n const text = await res.text()\n let parsed: unknown | undefined\n try {\n parsed = JSON.parse(text)\n } catch {\n parsed = undefined\n }\n setResponse({\n status: res.status,\n ok: res.ok,\n durationMs: Math.round(duration),\n body: text,\n parsed,\n })\n } catch (cause) {\n setError(cause instanceof Error ? cause.message : 'Request failed. Check your network connection.')\n } finally {\n setIsLoading(false)\n }\n }\n\n return (\n <div className=\"flex flex-col gap-4 rounded-lg border bg-card p-5 shadow-sm\">\n <div className=\"flex items-start justify-between gap-3\">\n <div>\n <h2 className=\"text-lg font-semibold\">Interactive tester</h2>\n <p className=\"text-xs text-muted-foreground\">\n Provide the endpoint parameters and your API key to execute a live request.\n </p>\n </div>\n <span\n className={`inline-flex min-w-[3rem] justify-center rounded border px-2 py-0.5 text-[11px] font-semibold uppercase ${\n METHOD_STYLES[operation.method] ?? 'border border-border bg-muted text-foreground'\n }`}\n >\n {operation.method}\n </span>\n </div>\n\n <div className=\"space-y-2 text-xs\">\n <div className=\"font-semibold text-foreground\">Endpoint</div>\n <code className=\"rounded-md bg-muted px-3 py-2 text-xs text-primary\">{operation.path}</code>\n </div>\n\n <label className=\"space-y-2 text-sm\">\n <span className=\"font-medium text-foreground\">Base URL</span>\n <select\n value={baseUrl}\n onChange={(event) => setBaseUrl(event.target.value)}\n className=\"w-full rounded-md border border-border bg-background px-3 py-2 text-sm focus:border-primary focus:outline-none focus:ring-2 focus:ring-primary/20\"\n >\n {mergedBaseUrls.map((server) => (\n <option key={server.url} value={server.url}>\n {server.url} {server.description ? `\u2014 ${server.description}` : ''}\n </option>\n ))}\n </select>\n {!baseUrl.trim() && requestPreview?.usesPlaceholderBase ? (\n <p className=\"text-xs text-muted-foreground\">\n Examples default to {PLACEHOLDER_BASE_URL}. Update the base URL to match your environment.\n </p>\n ) : null}\n {requestPreview?.baseError ? (\n <p className=\"text-xs text-rose-600\">{requestPreview.baseError}</p>\n ) : null}\n </label>\n\n <label className=\"space-y-2 text-sm\">\n <span className=\"font-medium text-foreground\">API key</span>\n <input\n type=\"text\"\n value={apiKey}\n onChange={(event) => setApiKey(event.target.value)}\n placeholder=\"Paste your API key secret (omk_\u2026)\"\n className=\"w-full rounded-md border border-border bg-background px-3 py-2 text-sm focus:border-primary focus:outline-none focus:ring-2 focus:ring-primary/20\"\n />\n </label>\n\n {pathParams.length ? (\n <section className=\"space-y-2 text-sm\">\n <div className=\"font-medium text-foreground\">Path parameters</div>\n <div className=\"space-y-3\">\n {pathParams.map((parameter: any) => (\n <label key={parameter.name} className=\"space-y-1\">\n <div className=\"flex items-center justify-between text-xs text-muted-foreground\">\n <span>{parameter.name}</span>\n {parameter.required ? <span className=\"text-amber-600\">required</span> : null}\n </div>\n <input\n type=\"text\"\n value={pathValues[parameter.name] ?? ''}\n onChange={(event) =>\n setPathValues((prev) => ({\n ...prev,\n [parameter.name]: event.target.value,\n }))\n }\n placeholder={parameter.description ?? ''}\n className=\"w-full rounded-md border border-border bg-background px-3 py-2 text-sm focus:border-primary focus:outline-none focus:ring-2 focus:ring-primary/20\"\n />\n </label>\n ))}\n </div>\n </section>\n ) : null}\n\n {queryParams.length ? (\n <section className=\"space-y-2 text-sm\">\n <div className=\"font-medium text-foreground\">Query parameters</div>\n <div className=\"space-y-3\">\n {queryParams.map((parameter: any) => (\n <label key={parameter.name} className=\"space-y-1\">\n <div className=\"flex items-center justify-between text-xs text-muted-foreground\">\n <span>{parameter.name}</span>\n {parameter.required ? <span className=\"text-amber-600\">required</span> : null}\n </div>\n <input\n type=\"text\"\n value={queryValues[parameter.name] ?? ''}\n onChange={(event) =>\n setQueryValues((prev) => ({\n ...prev,\n [parameter.name]: event.target.value,\n }))\n }\n placeholder={parameter.description ?? ''}\n className=\"w-full rounded-md border border-border bg-background px-3 py-2 text-sm focus:border-primary focus:outline-none focus:ring-2 focus:ring-primary/20\"\n />\n </label>\n ))}\n </div>\n </section>\n ) : null}\n\n {requestVariant ? (\n <section className=\"space-y-2 text-sm\">\n <div className=\"flex items-center justify-between\">\n <span className=\"font-medium text-foreground\">Request body</span>\n <span className=\"text-xs text-muted-foreground\">{requestVariant.mediaType}</span>\n </div>\n <textarea\n value={bodyContent}\n onChange={(event) => setBodyContent(event.target.value)}\n rows={8}\n className=\"w-full rounded-md border border-border bg-background px-3 py-2 text-xs font-mono leading-relaxed focus:border-primary focus:outline-none focus:ring-2 focus:ring-primary/20\"\n placeholder=\"Provide request payload\"\n />\n </section>\n ) : null}\n\n {requestPreview?.bodyParseError ? (\n <div className=\"rounded border border-amber-300 bg-amber-50 px-3 py-2 text-xs text-amber-700\">\n {requestPreview.bodyParseError}\n </div>\n ) : null}\n\n {codeSnippets.length ? (\n <section className=\"space-y-2 text-sm\">\n <div className=\"font-medium text-foreground\">Request examples</div>\n <CodeSnippetTabs snippets={codeSnippets} />\n </section>\n ) : null}\n\n <button\n type=\"button\"\n onClick={handleSubmit}\n disabled={isLoading}\n className=\"inline-flex items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-semibold text-primary-foreground hover:bg-primary/90 disabled:cursor-not-allowed disabled:bg-primary/60\"\n >\n {isLoading ? 'Sending\u2026' : 'Send request'}\n </button>\n\n {error ? <div className=\"rounded border border-rose-300 bg-rose-50 px-3 py-2 text-xs text-rose-700\">{error}</div> : null}\n\n {response ? (\n <section className=\"space-y-2 text-sm\">\n <div className=\"flex items-center justify-between\">\n <div className=\"font-medium text-foreground\">\n Response \u00B7 <span className={response.ok ? 'text-emerald-600' : 'text-rose-600'}>{response.status}</span>\n </div>\n <div className=\"text-xs text-muted-foreground\">{response.durationMs} ms</div>\n </div>\n <pre className=\"max-h-80 overflow-auto rounded-md bg-muted px-3 py-2 text-xs leading-relaxed\">\n {response.parsed ? formatJson(response.parsed) : response.body || '(empty response)'}\n </pre>\n </section>\n ) : null}\n </div>\n )\n}\n"],
5
- "mappings": ";AAuXY,SAKE,KALF;AArXZ,SAAS,WAAW,SAAS,gBAAgC;AAC7D,OAAO,WAAW;AAClB,OAAO,UAAU;AAEjB,MAAM,gBAAwC;AAAA,EAC5C,KAAK;AAAA,EACL,MAAM;AAAA,EACN,KAAK;AAAA,EAC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AS;AAAA,QACT,UAAU;AAAA,QACV,WAAU;AAAA,QAET,sBAAY,kBAAa;AAAA;AAAA,IAC5B;AAAA,IAEC,QAAQ,oBAAC,SAAI,WAAU,6EAA6E,iBAAM,IAAS;AAAA,IAEnH,WACC,qBAAC,aAAQ,WAAU,qBACjB;AAAA,2BAAC,SAAI,WAAU,qCACb;AAAA,6BAAC,SAAI,WAAU,+BAA8B;AAAA;AAAA,UAChC,oBAAC,UAAK,WAAW,SAAS,KAAK,qBAAqB,iBAAkB,mBAAS,QAAO;AAAA,WACnG;AAAA,QACA,qBAAC,SAAI,WAAU,iCAAiC;AAAA,mBAAS;AAAA,UAAW;AAAA,WAAG;AAAA,SACzE;AAAA,MACA,oBAAC,SAAI,WAAU,gFACZ,mBAAS,SAAS,WAAW,SAAS,MAAM,IAAI,SAAS,QAAQ,oBACpE;AAAA,OACF,IACE;AAAA,KACN;AAEJ;",
4
+ "sourcesContent": ["'use client'\n\nimport { useEffect, useMemo, useState, type ReactNode } from 'react'\nimport Image from 'next/image'\nimport Link from 'next/link'\n\nconst METHOD_STYLES: Record<string, string> = {\n GET: 'bg-emerald-100 text-emerald-800 border border-emerald-200',\n POST: 'bg-blue-100 text-blue-800 border border-blue-200',\n PUT: 'bg-amber-100 text-amber-800 border border-amber-200',\n PATCH: 'bg-purple-100 text-purple-800 border border-purple-200',\n DELETE: 'bg-rose-100 text-rose-800 border border-rose-200',\n}\n\nconst PREFERRED_MEDIA_TYPES = [\n 'application/json',\n 'application/x-www-form-urlencoded',\n 'multipart/form-data',\n 'text/plain',\n]\n\ntype ExplorerOperation = {\n id: string\n path: string\n method: string\n tag: string\n summary?: string\n description?: string\n operation: any\n}\n\ntype ServerOption = { url: string; description?: string }\n\ntype ApiDocsExplorerProps = {\n title: string\n version: string\n description?: string\n operations: ExplorerOperation[]\n tagOrder: string[]\n servers: ServerOption[]\n docsUrl: string\n jsonSpecUrl: string\n markdownSpecUrl: string\n}\n\ntype ContentVariant = {\n mediaType: string\n entry: any\n}\n\ntype TestResponse = {\n status: number\n durationMs: number\n ok: boolean\n body: string\n parsed?: unknown\n}\n\nfunction pickContentVariant(content?: Record<string, any>): ContentVariant | null {\n if (!content) return null\n const entries = Object.entries(content)\n if (!entries.length) return null\n for (const mediaType of PREFERRED_MEDIA_TYPES) {\n const match = entries.find(([candidate]) => candidate === mediaType)\n if (match) {\n return { mediaType: match[0], entry: match[1] }\n }\n }\n const [mediaType, entry] = entries[0]\n return { mediaType, entry }\n}\n\nfunction buildExampleFromSchema(schema: any): unknown {\n if (!schema || typeof schema !== 'object') return undefined\n if (schema.example !== undefined) return schema.example\n if (schema.default !== undefined) return schema.default\n if (Array.isArray(schema.enum) && schema.enum.length) return schema.enum[0]\n\n if (Array.isArray(schema.oneOf) && schema.oneOf.length) return buildExampleFromSchema(schema.oneOf[0])\n if (Array.isArray(schema.anyOf) && schema.anyOf.length) return buildExampleFromSchema(schema.anyOf[0])\n if (Array.isArray(schema.allOf) && schema.allOf.length) {\n return Object.assign({}, ...schema.allOf.map((part: any) => buildExampleFromSchema(part) ?? {}))\n }\n\n const type = Array.isArray(schema.type) ? schema.type[0] : schema.type\n\n if (schema.properties || type === 'object' || (!type && schema.required)) {\n const properties = schema.properties ?? {}\n const result: Record<string, unknown> = {}\n for (const key of Object.keys(properties)) {\n const value = buildExampleFromSchema(properties[key])\n if (value !== undefined) {\n result[key] = value\n }\n }\n if (schema.additionalProperties && typeof schema.additionalProperties === 'object') {\n const value = buildExampleFromSchema(schema.additionalProperties)\n if (value !== undefined) {\n result['additionalProperty'] = value\n }\n }\n return Object.keys(result).length ? result : {}\n }\n\n if (type === 'array') {\n const itemSchema = schema.items ?? (Array.isArray(schema.prefixItems) ? schema.prefixItems[0] : undefined)\n const value = buildExampleFromSchema(itemSchema)\n return value === undefined ? [] : [value]\n }\n\n if (type === 'number' || type === 'integer') return 1\n if (type === 'boolean') return true\n if (schema.format === 'date-time') return new Date('2025-01-01T00:00:00.000Z').toISOString()\n if (schema.format === 'uuid') return '00000000-0000-4000-8000-000000000000'\n if (schema.format === 'email') return 'user@example.com'\n if (schema.format === 'uri' || schema.format === 'url') return 'https://example.com/resource'\n\n return 'string'\n}\n\nfunction stringifyExample(mediaType: string, example: unknown): string {\n if (example === undefined || example === null) return ''\n if (mediaType === 'application/json') {\n try {\n return JSON.stringify(example, null, 2)\n } catch {\n return ''\n }\n }\n if (mediaType === 'application/x-www-form-urlencoded') {\n if (typeof example !== 'object') return ''\n const params = new URLSearchParams()\n for (const [key, value] of Object.entries(example as Record<string, unknown>)) {\n if (value === undefined) continue\n params.append(key, value === null ? '' : String(value))\n }\n return params.toString()\n }\n if (mediaType === 'multipart/form-data') {\n if (typeof example === 'object') {\n return Object.entries(example as Record<string, unknown>)\n .map(([key, value]) => `${key}=${value ?? ''}`)\n .join('\\n')\n }\n return typeof example === 'string' ? example : ''\n }\n if (typeof example === 'string') return example\n try {\n return JSON.stringify(example, null, 2)\n } catch {\n return ''\n }\n}\n\nfunction formatJson(value: unknown): string {\n try {\n return JSON.stringify(value, null, 2)\n } catch {\n return ''\n }\n}\n\nfunction applyPathParams(path: string, params: Record<string, string>): string {\n return path.replace(/\\{([^}]+)\\}/g, (_, key: string) => {\n const value = params[key] ?? ''\n return value ? encodeURIComponent(value) : `{${key}}`\n })\n}\n\ntype Category = {\n tag: string\n operations: ExplorerOperation[]\n}\n\nconst PLACEHOLDER_BASE_URL = 'https://api.your-service.com'\nconst CATEGORY_PAGE_SIZE = 20\n\ntype RequestPreview = {\n method: string\n url: string\n headers: Array<[string, string]>\n body?: string\n jsonBody?: unknown\n mediaType?: string\n usesPlaceholderBase: boolean\n missingPathParam?: string\n bodyParseError?: string\n baseError?: string\n}\n\ntype CodeSnippet = {\n id: string\n label: string\n language: string\n code: string\n}\n\nfunction escapeSingleQuotes(value: string): string {\n return value.replace(/'/g, `'\\\\''`)\n}\n\nfunction escapeSingleQuotesForJs(value: string): string {\n return value.replace(/\\\\/g, '\\\\\\\\').replace(/'/g, \"\\\\'\")\n}\n\nfunction escapeBackticks(value: string): string {\n return value.replace(/\\\\/g, '\\\\\\\\').replace(/`/g, '\\\\`')\n}\n\nfunction toPythonLiteral(value: unknown, indent = 0): string {\n const padding = ' '.repeat(indent)\n if (value === null || value === undefined) return 'None'\n if (typeof value === 'boolean') return value ? 'True' : 'False'\n if (typeof value === 'number' && Number.isFinite(value)) return String(value)\n if (typeof value === 'string') {\n return `'${value.replace(/\\\\/g, '\\\\\\\\').replace(/'/g, \"\\\\'\")}'`\n }\n if (Array.isArray(value)) {\n if (!value.length) return '[]'\n const entries = value\n .map((item) => `${' '.repeat(indent + 1)}${toPythonLiteral(item, indent + 1)}`)\n .join(',\\n')\n return `[\\n${entries},\\n${padding}]`\n }\n if (typeof value === 'object') {\n const entries = Object.entries(value as Record<string, unknown>)\n if (!entries.length) return '{}'\n const lines = entries.map(\n ([key, entry]) =>\n `${' '.repeat(indent + 1)}'${key.replace(/\\\\/g, '\\\\\\\\').replace(/'/g, \"\\\\'\")}': ${toPythonLiteral(entry, indent + 1)}`\n )\n return `{\\n${lines.join(',\\n')},\\n${padding}}`\n }\n return 'None'\n}\n\nexport default function ApiDocsExplorer(props: ApiDocsExplorerProps) {\n const { title, version, description, operations, tagOrder, servers, docsUrl, jsonSpecUrl, markdownSpecUrl } = props\n\n const methodOptions = useMemo(\n () => Array.from(new Set(operations.map((operation) => operation.method))).sort((a, b) => a.localeCompare(b)),\n [operations]\n )\n\n const operationsById = useMemo(() => {\n const map = new Map<string, ExplorerOperation>()\n for (const operation of operations) {\n map.set(operation.id, operation)\n }\n return map\n }, [operations])\n\n const [searchTerm, setSearchTerm] = useState('')\n const [methodFilter, setMethodFilter] = useState<string[]>(methodOptions)\n const [selectedId, setSelectedId] = useState<string>(operations[0]?.id ?? '')\n const [isNavOpen, setIsNavOpen] = useState(false)\n const [isTesterOpen, setIsTesterOpen] = useState(false)\n const [expanded, setExpanded] = useState<Record<string, boolean>>({})\n const [visibleCounts, setVisibleCounts] = useState<Record<string, number>>({})\n const [baseUrl, setBaseUrl] = useState<string>(servers[0]?.url ?? '')\n const [apiKey, setApiKey] = useState<string>('')\n\n useEffect(() => {\n setMethodFilter(methodOptions)\n }, [methodOptions])\n\n useEffect(() => {\n if (servers.length === 0) return\n setBaseUrl((prev) => {\n if (!prev) return servers[0].url\n return prev\n })\n }, [servers])\n\n const filteredOperations = useMemo(() => {\n const lowered = searchTerm.trim().toLowerCase()\n return operations.filter((operation) => {\n if (!methodFilter.includes(operation.method)) return false\n if (!lowered) return true\n return (\n operation.path.toLowerCase().includes(lowered) ||\n (operation.summary && operation.summary.toLowerCase().includes(lowered)) ||\n (operation.description && operation.description.toLowerCase().includes(lowered))\n )\n })\n }, [operations, methodFilter, searchTerm])\n\n const categories = useMemo(() => {\n const grouped = new Map<string, ExplorerOperation[]>()\n for (const operation of filteredOperations) {\n const list = grouped.get(operation.tag) ?? []\n list.push(operation)\n grouped.set(operation.tag, list)\n }\n const ordered: Category[] = []\n for (const tag of tagOrder) {\n const list = grouped.get(tag)\n if (list && list.length) {\n ordered.push({ tag, operations: list })\n grouped.delete(tag)\n }\n }\n const remaining = Array.from(grouped.entries()).sort(([a], [b]) => a.localeCompare(b))\n for (const [tag, ops] of remaining) {\n ordered.push({ tag, operations: ops })\n }\n return ordered\n }, [filteredOperations, tagOrder])\n\n useEffect(() => {\n setExpanded((prev) => {\n const next: Record<string, boolean> = {}\n for (const category of categories) {\n next[category.tag] = prev[category.tag] ?? true\n }\n return next\n })\n setVisibleCounts((prev) => {\n const next: Record<string, number> = {}\n for (const category of categories) {\n const total = category.operations.length\n const previous = prev[category.tag] ?? CATEGORY_PAGE_SIZE\n next[category.tag] = Math.min(total, previous)\n }\n return next\n })\n }, [categories])\n\n useEffect(() => {\n if (!selectedId && filteredOperations.length) {\n setSelectedId(filteredOperations[0].id)\n return\n }\n if (selectedId && filteredOperations.some((operation) => operation.id === selectedId)) return\n if (filteredOperations.length) {\n setSelectedId(filteredOperations[0].id)\n }\n }, [filteredOperations, selectedId])\n\n const selectedOperation =\n (selectedId ? operationsById.get(selectedId) : undefined) ?? filteredOperations[0] ?? operations[0] ?? null\n\n const shouldOpenTesterOverlay = () => {\n if (typeof window === 'undefined') return false\n return window.innerWidth < 1280\n }\n\n const handleSelectOperation = (operationId: string) => {\n setSelectedId(operationId)\n const targetCategory = categories.find((category) =>\n category.operations.some((operation) => operation.id === operationId)\n )\n if (targetCategory) {\n const index = targetCategory.operations.findIndex((operation) => operation.id === operationId)\n if (index >= 0) {\n setVisibleCounts((prev) => {\n const currentVisible = prev[targetCategory.tag] ?? CATEGORY_PAGE_SIZE\n if (index < currentVisible) return prev\n return { ...prev, [targetCategory.tag]: index + 1 }\n })\n }\n }\n requestAnimationFrame(() => {\n const element = document.getElementById(`operation-${operationId}`)\n if (element) element.scrollIntoView({ behavior: 'smooth', block: 'start', inline: 'nearest' })\n })\n if (shouldOpenTesterOverlay()) setIsTesterOpen(true)\n setIsNavOpen(false)\n }\n\n return (\n <div className=\"min-h-screen bg-background text-foreground\">\n <header className=\"border-b bg-card\">\n <div className=\"mx-auto flex w-full max-w-screen-2xl flex-col gap-4 px-6 py-6 lg:flex-row lg:items-center lg:justify-between\">\n <div className=\"flex items-center gap-4\">\n <button\n type=\"button\"\n className=\"inline-flex h-10 w-10 items-center justify-center rounded-md border border-border text-sm font-medium text-muted-foreground hover:border-foreground hover:text-foreground lg:hidden\"\n onClick={() => setIsNavOpen(true)}\n >\n <span className=\"sr-only\">Open navigation</span>\n \u2630\n </button>\n <Link href=\"/\" className=\"flex items-center gap-3\">\n <Image src=\"/open-mercato.svg\" alt=\"Open Mercato\" width={36} height={36} />\n <div>\n <div className=\"text-base font-semibold leading-tight\">{title}</div>\n <div className=\"text-xs text-muted-foreground\">Version {version}</div>\n </div>\n </Link>\n </div>\n <div className=\"flex flex-wrap items-center justify-end gap-2\">\n <nav className=\"hidden items-center gap-2 text-xs text-muted-foreground sm:flex\">\n <Link href=\"/\" className=\"hover:text-foreground hover:underline\">\n Home\n </Link>\n <span>/</span>\n <span>Docs</span>\n <span>/</span>\n <span className=\"font-medium text-foreground\">API Explorer</span>\n </nav>\n <button\n type=\"button\"\n className=\"inline-flex h-10 items-center justify-center rounded-md border border-border px-3 text-sm font-medium text-muted-foreground hover:border-foreground hover:text-foreground xl:hidden\"\n onClick={() => setIsTesterOpen(true)}\n >\n Try Endpoint\n </button>\n <Link\n href={jsonSpecUrl}\n target=\"_blank\"\n rel=\"noreferrer\"\n className=\"inline-flex h-10 items-center justify-center rounded-md border border-border px-3 text-sm font-medium text-muted-foreground hover:border-foreground hover:text-foreground\"\n >\n OpenAPI JSON\n </Link>\n <Link\n href={markdownSpecUrl}\n target=\"_blank\"\n rel=\"noreferrer\"\n className=\"inline-flex h-10 items-center justify-center rounded-md border border-border px-3 text-sm font-medium text-muted-foreground hover:border-foreground hover:text-foreground\"\n >\n Markdown Docs\n </Link>\n <Link\n href={docsUrl}\n target=\"_blank\"\n rel=\"noreferrer\"\n className=\"hidden rounded-md border border-primary/30 px-4 py-2 text-sm font-medium text-primary hover:bg-primary/10 sm:inline-flex\"\n >\n View full docs\n </Link>\n </div>\n </div>\n </header>\n\n <main className=\"mx-auto flex w-full max-w-screen-2xl flex-1 flex-col px-6 py-8 lg:flex-row lg:gap-6\">\n <aside className=\"hidden w-64 shrink-0 lg:block\">\n <div className=\"sticky top-20 max-h-[calc(100vh-6rem)] overflow-y-auto rounded-lg border bg-card p-4\">\n <h2 className=\"text-sm font-semibold uppercase tracking-wide text-muted-foreground\">API Categories</h2>\n <nav className=\"mt-4 space-y-4 text-sm\">\n {categories.map((category) => {\n const isExpanded = expanded[category.tag] ?? true\n return (\n <div key={category.tag} className=\"space-y-2\">\n <button\n type=\"button\"\n className=\"flex w-full items-center justify-between rounded-md bg-muted px-3 py-2 text-left font-medium text-foreground hover:bg-muted/50\"\n onClick={() =>\n setExpanded((prev) => ({\n ...prev,\n [category.tag]: !isExpanded,\n }))\n }\n >\n <span>{category.tag}</span>\n <span className=\"text-xs text-muted-foreground\">{isExpanded ? '\u2212' : '+'}</span>\n </button>\n {isExpanded ? (\n <ul className=\"space-y-1 pl-2\">\n {category.operations.map((operation) => (\n <li key={operation.id}>\n <button\n type=\"button\"\n className={`flex w-full items-center gap-2 rounded-md px-3 py-2 text-left transition ${\n selectedOperation?.id === operation.id\n ? 'bg-primary/10 text-primary'\n : 'text-muted-foreground hover:bg-muted hover:text-foreground'\n }`}\n onClick={() => handleSelectOperation(operation.id)}\n >\n <span\n className={`inline-flex min-w-[3rem] justify-center rounded border px-2 py-0.5 text-overline font-semibold uppercase ${\n METHOD_STYLES[operation.method] ?? 'border border-border bg-muted text-foreground'\n }`}\n >\n {operation.method}\n </span>\n <span className=\"truncate text-xs\">{operation.path}</span>\n </button>\n </li>\n ))}\n </ul>\n ) : null}\n </div>\n )\n })}\n </nav>\n </div>\n </aside>\n\n <section className=\"flex-1 space-y-6\">\n <div className=\"rounded-lg border bg-card p-5 shadow-sm\">\n <div className=\"space-y-3\">\n <div className=\"flex flex-col gap-3 sm:flex-row sm:items-center sm:justify-between\">\n <div>\n <h1 className=\"text-2xl font-semibold\">OpenAPI Explorer</h1>\n {description ? <p className=\"text-sm text-muted-foreground\">{description}</p> : null}\n </div>\n <div className=\"text-xs text-muted-foreground\">\n {servers[0]?.url ? <span>Default server: {servers[0].url}</span> : <span>Server URL not configured.</span>}\n </div>\n </div>\n <div className=\"flex flex-col gap-3 lg:flex-row lg:items-center lg:justify-between\">\n <div className=\"flex flex-1 items-center gap-3\">\n <input\n type=\"search\"\n value={searchTerm}\n onChange={(event) => setSearchTerm(event.target.value)}\n placeholder=\"Search endpoints by path or summary\"\n className=\"flex-1 rounded-md border border-border bg-background px-3 py-2 text-sm focus-visible:border-ring focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/20\"\n />\n </div>\n <div className=\"flex flex-wrap gap-2 text-xs\">\n {methodOptions.map((method) => {\n const isActive = methodFilter.includes(method)\n return (\n <button\n key={method}\n type=\"button\"\n className={`rounded-md border px-3 py-1 font-semibold uppercase transition ${\n isActive\n ? 'border-primary bg-primary/10 text-primary'\n : 'border-border text-muted-foreground hover:border-foreground hover:text-foreground'\n }`}\n onClick={() => {\n setMethodFilter((prev) => {\n if (prev.includes(method)) {\n const next = prev.filter((entry) => entry !== method)\n return next.length ? next : prev\n }\n return [...prev, method]\n })\n }}\n >\n {method}\n </button>\n )\n })}\n </div>\n </div>\n </div>\n </div>\n\n <div className=\"space-y-8\">\n {categories.map((category) => {\n const totalCount = category.operations.length\n const visibleCount = Math.min(\n totalCount,\n visibleCounts[category.tag] ?? CATEGORY_PAGE_SIZE\n )\n const visibleOperations = category.operations.slice(0, visibleCount)\n const hiddenCount = totalCount - visibleCount\n return (\n <div key={category.tag} className=\"space-y-4\">\n <div className=\"flex items-center justify-between\">\n <h2 className=\"text-lg font-semibold\">{category.tag}</h2>\n <div className=\"text-xs text-muted-foreground\">\n Showing {visibleCount} of {totalCount} endpoints\n </div>\n </div>\n <div className=\"space-y-6\">\n {visibleOperations.map((operation) => {\n const methodClass = METHOD_STYLES[operation.method] ?? 'border border-border bg-muted text-foreground'\n const operationId = `operation-${operation.id}`\n const contentVariant = pickContentVariant(operation.operation?.requestBody?.content)\n const contentExample =\n contentVariant?.entry?.example ??\n contentVariant?.entry?.examples?.default?.value ??\n buildExampleFromSchema(contentVariant?.entry?.schema)\n const requestSnippet =\n contentVariant && contentExample\n ? stringifyExample(contentVariant.mediaType, contentExample)\n : undefined\n\n return (\n <article\n key={operation.id}\n id={operationId}\n className={`rounded-lg border bg-card shadow-sm transition ${\n selectedOperation?.id === operation.id ? 'ring-2 ring-primary/40' : ''\n }`}\n >\n <div className=\"flex flex-col gap-4 border-b bg-muted/50 px-5 py-4 md:flex-row md:items-center md:justify-between\">\n <div className=\"flex items-center gap-3\">\n <span className={`rounded px-3 py-1 text-xs font-semibold uppercase ${methodClass}`}>\n {operation.method}\n </span>\n <code className=\"text-sm text-foreground\">{operation.path}</code>\n </div>\n <div className=\"flex items-center gap-2 text-overline text-muted-foreground\">\n {operation.operation?.['x-require-auth'] ? (\n <span className=\"rounded bg-amber-100 px-2 py-0.5 text-amber-900\">Auth required</span>\n ) : null}\n {Array.isArray(operation.operation?.['x-require-features'])\n ? operation.operation['x-require-features'].map((feature: string) => (\n <span key={feature} className=\"rounded bg-blue-100 px-2 py-0.5 text-blue-900\">\n {feature}\n </span>\n ))\n : null}\n </div>\n </div>\n <div className=\"space-y-5 p-5\">\n <div className=\"space-y-2\">\n {operation.summary ? <h3 className=\"text-lg font-semibold\">{operation.summary}</h3> : null}\n {operation.description ? (\n <p className=\"text-sm text-muted-foreground whitespace-pre-line\">\n {operation.description}\n </p>\n ) : null}\n </div>\n\n {Array.isArray(operation.operation?.parameters) &&\n operation.operation.parameters.length ? (\n <section className=\"space-y-3\">\n <h4 className=\"text-xs font-semibold uppercase tracking-wide text-muted-foreground\">\n Parameters\n </h4>\n <div className=\"overflow-hidden rounded-lg border\">\n <table className=\"min-w-full divide-y divide-border text-left text-xs\">\n <thead className=\"bg-muted/50 text-overline uppercase tracking-wide text-muted-foreground\">\n <tr>\n <th className=\"px-3 py-2 font-medium\">Name</th>\n <th className=\"px-3 py-2 font-medium\">In</th>\n <th className=\"px-3 py-2 font-medium\">Required</th>\n <th className=\"px-3 py-2 font-medium\">Schema</th>\n <th className=\"px-3 py-2 font-medium\">Description</th>\n </tr>\n </thead>\n <tbody className=\"divide-y divide-border text-xs\">\n {operation.operation.parameters.map((parameter: any) => (\n <tr key={`${parameter.in}-${parameter.name}`}>\n <td className=\"px-3 py-2 font-medium text-foreground\">{parameter.name}</td>\n <td className=\"px-3 py-2 text-muted-foreground\">{parameter.in}</td>\n <td className=\"px-3 py-2 text-muted-foreground\">\n {parameter.required ? 'Yes' : 'No'}\n </td>\n <td className=\"px-3 py-2 text-muted-foreground\">\n {parameter.schema?.type ?? 'any'}\n </td>\n <td className=\"px-3 py-2 text-muted-foreground\">\n {parameter.description ?? '\u2014'}\n </td>\n </tr>\n ))}\n </tbody>\n </table>\n </div>\n </section>\n ) : null}\n\n {contentVariant ? (\n <section className=\"space-y-3\">\n <h4 className=\"text-xs font-semibold uppercase tracking-wide text-muted-foreground\">\n Request body ({contentVariant.mediaType})\n </h4>\n {requestSnippet ? (\n <pre className=\"max-h-80 overflow-auto rounded-lg bg-muted px-4 py-3 text-xs leading-relaxed\">\n {requestSnippet}\n </pre>\n ) : (\n <p className=\"text-xs text-muted-foreground\">\n No example available for this content type.\n </p>\n )}\n </section>\n ) : null}\n\n {operation.operation?.responses ? (\n <section className=\"space-y-3\">\n <h4 className=\"text-xs font-semibold uppercase tracking-wide text-muted-foreground\">\n Responses\n </h4>\n <div className=\"space-y-3\">\n {Object.entries(operation.operation.responses).map(([status, response]: [string, any]) => {\n if (response?.['x-autoGenerated']) return null\n const responseVariant = pickContentVariant(response?.content)\n const responseExample =\n responseVariant?.entry?.example ??\n responseVariant?.entry?.examples?.default?.value ??\n buildExampleFromSchema(responseVariant?.entry?.schema)\n const responseSnippet =\n responseVariant && responseExample\n ? stringifyExample(responseVariant.mediaType, responseExample)\n : undefined\n\n return (\n <div key={status} className=\"rounded-lg border\">\n <div className=\"flex items-center justify-between border-b bg-muted/50 px-4 py-2 text-xs font-semibold uppercase tracking-wide text-muted-foreground\">\n <span>{status}</span>\n <span className=\"text-muted-foreground\">\n {response?.description ?? 'Response'}\n </span>\n </div>\n {responseVariant ? (\n <div className=\"border-b bg-muted/50 px-4 py-2 text-overline text-muted-foreground\">\n Content-Type: {responseVariant.mediaType}\n </div>\n ) : null}\n {responseSnippet ? (\n <pre className=\"max-h-80 overflow-auto bg-muted px-4 py-3 text-xs leading-relaxed\">\n {responseSnippet}\n </pre>\n ) : (\n <p className=\"px-4 py-3 text-xs text-muted-foreground\">\n {responseVariant ? 'No example available for this content type.' : 'No response body.'}\n </p>\n )}\n </div>\n )\n })}\n </div>\n </section>\n ) : null}\n\n {Array.isArray(operation.operation?.['x-codeSamples']) &&\n operation.operation['x-codeSamples'].length ? (\n <section className=\"space-y-3\">\n <h4 className=\"text-xs font-semibold uppercase tracking-wide text-muted-foreground\">\n Example\n </h4>\n <pre className=\"overflow-auto rounded-lg bg-muted px-4 py-3 text-xs leading-relaxed\">\n {operation.operation['x-codeSamples'][0].source}\n </pre>\n </section>\n ) : null}\n\n <div className=\"flex flex-wrap gap-3\">\n <button\n type=\"button\"\n className=\"inline-flex items-center rounded-md border border-primary px-4 py-2 text-sm font-semibold text-primary hover:bg-primary/10\"\n onClick={() => {\n setSelectedId(operation.id)\n if (shouldOpenTesterOverlay()) setIsTesterOpen(true)\n }}\n >\n Test this endpoint\n </button>\n <button\n type=\"button\"\n className=\"inline-flex items-center rounded-md border border-border px-4 py-2 text-sm text-muted-foreground hover:border-foreground hover:text-foreground\"\n onClick={() => handleSelectOperation(operation.id)}\n >\n Jump to tester\n </button>\n </div>\n </div>\n </article>\n )\n })}\n </div>\n {hiddenCount > 0 ? (\n <div className=\"flex justify-center\">\n <button\n type=\"button\"\n className=\"inline-flex items-center rounded-md border border-border px-4 py-2 text-sm font-medium text-muted-foreground hover:border-foreground hover:text-foreground\"\n onClick={() =>\n setVisibleCounts((prev) => ({\n ...prev,\n [category.tag]: Math.min(\n totalCount,\n (prev[category.tag] ?? CATEGORY_PAGE_SIZE) + CATEGORY_PAGE_SIZE\n ),\n }))\n }\n >\n Show {Math.min(CATEGORY_PAGE_SIZE, hiddenCount)} more endpoints\n </button>\n </div>\n ) : null}\n </div>\n )\n })}\n {!categories.length ? (\n <div className=\"rounded-lg border border-dashed bg-muted/50 p-6 text-center text-sm text-muted-foreground\">\n No endpoints match your filters. Try adjusting the method filters or clearing the search query.\n </div>\n ) : null}\n </div>\n </section>\n\n <aside className=\"hidden w-96 shrink-0 xl:block\">\n <div className=\"sticky top-20 max-h-[calc(100vh-6rem)] overflow-y-auto\">\n <TesterPanel\n key={selectedOperation?.id ?? 'tester'}\n operation={selectedOperation}\n baseUrl={baseUrl}\n setBaseUrl={setBaseUrl}\n baseUrlOptions={servers}\n apiKey={apiKey}\n setApiKey={setApiKey}\n />\n </div>\n </aside>\n </main>\n\n <footer className=\"border-t bg-card\">\n <div className=\"mx-auto flex w-full max-w-screen-2xl flex-col gap-4 px-6 py-6 md:flex-row md:items-center md:justify-between\">\n <div className=\"text-sm text-muted-foreground\">\u00A9 {new Date().getFullYear()} Open Mercato. All rights reserved.</div>\n <div className=\"flex flex-wrap items-center gap-4 text-sm text-muted-foreground\">\n <Link href={docsUrl} target=\"_blank\" rel=\"noreferrer\" className=\"hover:text-foreground hover:underline\">\n Documentation\n </Link>\n <Link\n href=\"https://openmercato.com/privacy\"\n target=\"_blank\"\n rel=\"noreferrer\"\n className=\"hover:text-foreground hover:underline\"\n >\n Privacy\n </Link>\n <Link\n href=\"https://openmercato.com/terms\"\n target=\"_blank\"\n rel=\"noreferrer\"\n className=\"hover:text-foreground hover:underline\"\n >\n Terms\n </Link>\n </div>\n </div>\n </footer>\n\n {isNavOpen ? (\n <MobileOverlay title=\"API categories\" onClose={() => setIsNavOpen(false)}>\n <div className=\"space-y-4\">\n <div className=\"flex items-center justify-between\">\n <h2 className=\"text-sm font-semibold uppercase tracking-wide text-muted-foreground\">API Categories</h2>\n <button\n type=\"button\"\n className=\"text-sm text-muted-foreground hover:text-foreground\"\n onClick={() => setIsNavOpen(false)}\n >\n Close\n </button>\n </div>\n <div className=\"max-h-[70vh] space-y-4 overflow-y-auto\">\n {categories.map((category) => (\n <div key={`mobile-${category.tag}`} className=\"space-y-2\">\n <div className=\"font-semibold text-foreground\">{category.tag}</div>\n <ul className=\"space-y-2\">\n {category.operations.map((operation) => (\n <li key={`mobile-${operation.id}`}>\n <button\n type=\"button\"\n className={`flex w-full items-center gap-2 rounded-md border px-3 py-2 text-left text-sm ${\n selectedOperation?.id === operation.id\n ? 'border-primary text-primary'\n : 'border-border text-muted-foreground'\n }`}\n onClick={() => handleSelectOperation(operation.id)}\n >\n <span\n className={`inline-flex min-w-[3rem] justify-center rounded border px-2 py-0.5 text-overline font-semibold uppercase ${\n METHOD_STYLES[operation.method] ?? 'border border-border bg-muted text-foreground'\n }`}\n >\n {operation.method}\n </span>\n <span className=\"truncate\">{operation.path}</span>\n </button>\n </li>\n ))}\n </ul>\n </div>\n ))}\n </div>\n </div>\n </MobileOverlay>\n ) : null}\n\n {isTesterOpen ? (\n <MobileOverlay title=\"API tester\" onClose={() => setIsTesterOpen(false)}>\n <TesterPanel\n key={`mobile-${selectedOperation?.id ?? 'tester'}`}\n operation={selectedOperation}\n baseUrl={baseUrl}\n setBaseUrl={setBaseUrl}\n baseUrlOptions={servers}\n apiKey={apiKey}\n setApiKey={setApiKey}\n />\n </MobileOverlay>\n ) : null}\n </div>\n )\n}\n\nfunction CodeSnippetTabs(props: { snippets: CodeSnippet[] }) {\n const { snippets } = props\n const [activeId, setActiveId] = useState(snippets[0]?.id ?? '')\n const [copied, setCopied] = useState(false)\n\n useEffect(() => {\n const first = snippets[0]?.id ?? ''\n setActiveId((current) => (snippets.some((snippet) => snippet.id === current) ? current : first))\n }, [snippets])\n\n useEffect(() => {\n setCopied(false)\n }, [activeId])\n\n useEffect(() => {\n if (!copied) return\n const timeout = window.setTimeout(() => setCopied(false), 2000)\n return () => window.clearTimeout(timeout)\n }, [copied])\n\n if (!snippets.length) {\n return null\n }\n\n const activeSnippet = snippets.find((snippet) => snippet.id === activeId) ?? snippets[0]\n\n const handleCopy = async () => {\n if (!activeSnippet) return\n if (typeof navigator === 'undefined' || !navigator.clipboard) return\n try {\n await navigator.clipboard.writeText(activeSnippet.code)\n setCopied(true)\n } catch {\n setCopied(false)\n }\n }\n\n return (\n <div className=\"space-y-2\">\n <div className=\"flex items-center justify-between gap-2\">\n <div className=\"flex flex-wrap gap-2\">\n {snippets.map((snippet) => (\n <button\n type=\"button\"\n key={snippet.id}\n className={`rounded-md border px-3 py-1 text-xs font-semibold ${\n snippet.id === activeSnippet.id\n ? 'border-primary bg-primary/10 text-primary'\n : 'border-border text-muted-foreground hover:border-foreground hover:text-foreground'\n }`}\n onClick={() => setActiveId(snippet.id)}\n >\n {snippet.label}\n </button>\n ))}\n </div>\n <button\n type=\"button\"\n className=\"inline-flex items-center rounded-md border border-border px-3 py-1 text-xs font-semibold text-muted-foreground hover:border-foreground hover:text-foreground\"\n onClick={handleCopy}\n >\n {copied ? 'Copied' : 'Copy'}\n </button>\n </div>\n <pre className=\"max-h-80 overflow-auto rounded-md bg-muted px-3 py-2 text-xs leading-relaxed\">\n {activeSnippet.code}\n </pre>\n </div>\n )\n}\n\nfunction MobileOverlay(props: { title: string; children: ReactNode; onClose: () => void }) {\n const { title, children, onClose } = props\n return (\n <div className=\"fixed inset-0 z-modal flex flex-col bg-background/95 backdrop-blur\">\n <div className=\"border-b bg-card px-6 py-4\">\n <div className=\"flex items-center justify-between\">\n <h2 className=\"text-base font-semibold text-foreground\">{title}</h2>\n <button\n type=\"button\"\n className=\"rounded-md border border-border px-3 py-1 text-sm text-muted-foreground hover:border-foreground hover:text-foreground\"\n onClick={onClose}\n >\n Close\n </button>\n </div>\n </div>\n <div className=\"flex-1 overflow-y-auto px-6 py-4\">{children}</div>\n </div>\n )\n}\n\ntype TesterPanelProps = {\n operation: ExplorerOperation | null\n baseUrl: string\n setBaseUrl: (value: string) => void\n baseUrlOptions: ServerOption[]\n apiKey: string\n setApiKey: (value: string) => void\n}\n\nfunction TesterPanel(props: TesterPanelProps) {\n const { operation, baseUrl, setBaseUrl, baseUrlOptions, apiKey, setApiKey } = props\n const [pathValues, setPathValues] = useState<Record<string, string>>({})\n const [queryValues, setQueryValues] = useState<Record<string, string>>({})\n const [bodyContent, setBodyContent] = useState<string>('')\n const [response, setResponse] = useState<TestResponse | null>(null)\n const [error, setError] = useState<string | null>(null)\n const [isLoading, setIsLoading] = useState(false)\n\n const parameters = useMemo(\n () => (operation && Array.isArray(operation.operation?.parameters) ? operation.operation.parameters : []),\n [operation]\n )\n const pathParams = useMemo(\n () => parameters.filter((parameter: any) => parameter.in === 'path'),\n [parameters]\n )\n const queryParams = useMemo(\n () => parameters.filter((parameter: any) => parameter.in === 'query'),\n [parameters]\n )\n const requestVariant = useMemo(\n () => (operation ? pickContentVariant(operation.operation?.requestBody?.content) : null),\n [operation]\n )\n const mergedBaseUrls = useMemo(() => {\n if (!baseUrl) return baseUrlOptions\n if (baseUrlOptions.some((server) => server.url === baseUrl)) return baseUrlOptions\n return [...baseUrlOptions, { url: baseUrl }]\n }, [baseUrlOptions, baseUrl])\n\n const requestPreview = useMemo<RequestPreview | null>(() => {\n if (!operation) return null\n const method = operation.method.toUpperCase()\n const rawBase = baseUrl.trim()\n const normalizedBase = rawBase || PLACEHOLDER_BASE_URL\n const usesPlaceholderBase = !rawBase\n const baseWithSlash = normalizedBase.endsWith('/') ? normalizedBase : `${normalizedBase}/`\n const resolvedPath = applyPathParams(operation.path, pathValues)\n const relativePath = resolvedPath.replace(/^\\//, '')\n\n let url: URL\n try {\n url = new URL(relativePath, baseWithSlash)\n } catch {\n return {\n method,\n url: '',\n headers: [],\n mediaType: requestVariant?.mediaType,\n usesPlaceholderBase,\n baseError: 'Base URL must be absolute (include protocol, e.g. https://api.example.com).',\n }\n }\n\n for (const [key, value] of Object.entries(queryValues)) {\n if (!value) continue\n url.searchParams.append(key, value)\n }\n\n const headers: Array<[string, string]> = [['Accept', 'application/json']]\n const trimmedKey = apiKey.trim()\n if (trimmedKey) {\n headers.push(['Authorization', `ApiKey ${trimmedKey}`])\n headers.push(['X-Api-Key', trimmedKey])\n }\n\n let body: string | undefined\n let jsonBody: unknown\n let bodyParseError: string | undefined\n\n if (requestVariant && method !== 'GET' && method !== 'HEAD') {\n headers.push(['Content-Type', requestVariant.mediaType])\n if (requestVariant.mediaType === 'application/json') {\n if (bodyContent.trim()) {\n try {\n jsonBody = JSON.parse(bodyContent)\n body = JSON.stringify(jsonBody)\n } catch {\n bodyParseError = 'Request body must be valid JSON.'\n }\n }\n } else {\n if (bodyContent) {\n body = bodyContent\n }\n }\n }\n\n const missingPathParam = pathParams.find((parameter: any) => parameter.required && !pathValues[parameter.name])\n\n return {\n method,\n url: url.toString(),\n headers,\n body,\n jsonBody,\n mediaType: requestVariant?.mediaType,\n usesPlaceholderBase,\n missingPathParam: missingPathParam?.name,\n bodyParseError,\n }\n }, [operation, baseUrl, pathValues, queryValues, apiKey, requestVariant, bodyContent, pathParams])\n\n const codeSnippets = useMemo<CodeSnippet[]>(() => {\n if (!requestPreview || requestPreview.baseError) return []\n\n const snippets: CodeSnippet[] = []\n const { method, url, headers, body, jsonBody, mediaType } = requestPreview\n\n if (url) {\n const curlParts = [`curl -X ${method} '${escapeSingleQuotes(url)}'`]\n for (const [key, value] of headers) {\n curlParts.push(` -H '${escapeSingleQuotes(`${key}: ${value}`)}'`)\n }\n if (body) {\n curlParts.push(` --data '${escapeSingleQuotes(body)}'`)\n }\n snippets.push({\n id: 'curl',\n label: 'cURL',\n language: 'bash',\n code: curlParts.join(' \\\\\\n'),\n })\n\n const headerEntries =\n headers.length === 0\n ? ''\n : headers.map(([key, value]) => ` '${key}': '${escapeSingleQuotesForJs(value)}',`).join('\\n')\n const tsLines: string[] = [\n `const url = '${escapeSingleQuotesForJs(url)}';`,\n headerEntries ? `const headers = {\\n${headerEntries}\\n};` : 'const headers = {};',\n ]\n\n if (mediaType === 'application/json' && jsonBody !== undefined) {\n const payloadLiteral = JSON.stringify(jsonBody, null, 2)\n tsLines.push('', `const payload = ${payloadLiteral};`)\n tsLines.push(\n '',\n 'const response = await fetch(url, {',\n ` method: '${method}',`,\n ' headers,',\n ' body: JSON.stringify(payload),',\n '});'\n )\n } else if (body) {\n tsLines.push('', `const body = \\`${escapeBackticks(body)}\\`;`)\n tsLines.push(\n '',\n 'const response = await fetch(url, {',\n ` method: '${method}',`,\n ' headers,',\n ' body,',\n '});'\n )\n } else {\n tsLines.push(\n '',\n 'const response = await fetch(url, {',\n ` method: '${method}',`,\n ' headers,',\n '});'\n )\n }\n tsLines.push('const data = await response.json();', 'console.log(data);')\n\n snippets.push({\n id: 'typescript',\n label: 'TypeScript',\n language: 'ts',\n code: tsLines.join('\\n'),\n })\n\n const pythonLines: string[] = [\"import requests\", \"\", `url = '${escapeSingleQuotesForJs(url)}'`]\n if (headers.length) {\n const pythonHeaders = headers\n .map(([key, value]) => ` '${key}': '${escapeSingleQuotesForJs(value)}',`)\n .join('\\n')\n pythonLines.push('headers = {', pythonHeaders, '}')\n } else {\n pythonLines.push('headers = {}')\n }\n\n if (mediaType === 'application/json' && jsonBody !== undefined) {\n const pythonPayload = toPythonLiteral(jsonBody)\n pythonLines.push('', `payload = ${pythonPayload}`)\n pythonLines.push(\n `response = requests.request('${method}', url, headers=headers, json=payload)`\n )\n } else if (body) {\n pythonLines.push('', `data = ${toPythonLiteral(body)}`)\n pythonLines.push(`response = requests.request('${method}', url, headers=headers, data=data)`)\n } else {\n pythonLines.push('', `response = requests.request('${method}', url, headers=headers)`)\n }\n pythonLines.push('print(response.status_code)', 'print(response.text)')\n\n snippets.push({\n id: 'python',\n label: 'Python',\n language: 'python',\n code: pythonLines.join('\\n'),\n })\n }\n\n return snippets\n }, [requestPreview])\n\n useEffect(() => {\n const nextPath: Record<string, string> = {}\n for (const parameter of pathParams) {\n nextPath[parameter.name] = ''\n }\n const nextQuery: Record<string, string> = {}\n for (const parameter of queryParams) {\n nextQuery[parameter.name] = ''\n }\n setPathValues(nextPath)\n setQueryValues(nextQuery)\n\n if (requestVariant) {\n const example =\n requestVariant.entry?.example ??\n requestVariant.entry?.examples?.default?.value ??\n buildExampleFromSchema(requestVariant.entry?.schema)\n setBodyContent(example ? stringifyExample(requestVariant.mediaType, example) : '')\n } else {\n setBodyContent('')\n }\n setResponse(null)\n setError(null)\n }, [operation?.id, pathParams, queryParams, requestVariant])\n\n if (!operation) {\n return (\n <div className=\"rounded-lg border bg-card p-5 text-sm text-muted-foreground\">\n Select an endpoint to start testing requests.\n </div>\n )\n }\n\n const handleSubmit = async () => {\n if (!operation) return\n if (!baseUrl.trim()) {\n setError('Please provide a base URL for the request.')\n return\n }\n if (requestPreview?.baseError) {\n setError(requestPreview.baseError)\n return\n }\n if (requestPreview?.missingPathParam) {\n setError(`Path parameter \"${requestPreview.missingPathParam}\" is required.`)\n return\n }\n if (requestPreview?.bodyParseError) {\n setError(requestPreview.bodyParseError)\n return\n }\n if (!requestPreview) {\n setError('Unable to prepare the request. Check your input and try again.')\n return\n }\n\n setIsLoading(true)\n setError(null)\n setResponse(null)\n\n try {\n const started = performance.now()\n const res = await fetch(requestPreview.url, {\n method: requestPreview.method,\n headers: Object.fromEntries(requestPreview.headers),\n body: requestPreview.body,\n })\n const duration = performance.now() - started\n const text = await res.text()\n let parsed: unknown | undefined\n try {\n parsed = JSON.parse(text)\n } catch {\n parsed = undefined\n }\n setResponse({\n status: res.status,\n ok: res.ok,\n durationMs: Math.round(duration),\n body: text,\n parsed,\n })\n } catch (cause) {\n setError(cause instanceof Error ? cause.message : 'Request failed. Check your network connection.')\n } finally {\n setIsLoading(false)\n }\n }\n\n return (\n <div className=\"flex flex-col gap-4 rounded-lg border bg-card p-5 shadow-sm\">\n <div className=\"flex items-start justify-between gap-3\">\n <div>\n <h2 className=\"text-lg font-semibold\">Interactive tester</h2>\n <p className=\"text-xs text-muted-foreground\">\n Provide the endpoint parameters and your API key to execute a live request.\n </p>\n </div>\n <span\n className={`inline-flex min-w-[3rem] justify-center rounded border px-2 py-0.5 text-overline font-semibold uppercase ${\n METHOD_STYLES[operation.method] ?? 'border border-border bg-muted text-foreground'\n }`}\n >\n {operation.method}\n </span>\n </div>\n\n <div className=\"space-y-2 text-xs\">\n <div className=\"font-semibold text-foreground\">Endpoint</div>\n <code className=\"rounded-md bg-muted px-3 py-2 text-xs text-primary\">{operation.path}</code>\n </div>\n\n <label className=\"space-y-2 text-sm\">\n <span className=\"font-medium text-foreground\">Base URL</span>\n <select\n value={baseUrl}\n onChange={(event) => setBaseUrl(event.target.value)}\n className=\"w-full rounded-md border border-border bg-background px-3 py-2 text-sm focus-visible:border-ring focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/20\"\n >\n {mergedBaseUrls.map((server) => (\n <option key={server.url} value={server.url}>\n {server.url} {server.description ? `\u2014 ${server.description}` : ''}\n </option>\n ))}\n </select>\n {!baseUrl.trim() && requestPreview?.usesPlaceholderBase ? (\n <p className=\"text-xs text-muted-foreground\">\n Examples default to {PLACEHOLDER_BASE_URL}. Update the base URL to match your environment.\n </p>\n ) : null}\n {requestPreview?.baseError ? (\n <p className=\"text-xs text-rose-600\">{requestPreview.baseError}</p>\n ) : null}\n </label>\n\n <label className=\"space-y-2 text-sm\">\n <span className=\"font-medium text-foreground\">API key</span>\n <input\n type=\"text\"\n value={apiKey}\n onChange={(event) => setApiKey(event.target.value)}\n placeholder=\"Paste your API key secret (omk_\u2026)\"\n className=\"w-full rounded-md border border-border bg-background px-3 py-2 text-sm focus-visible:border-ring focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/20\"\n />\n </label>\n\n {pathParams.length ? (\n <section className=\"space-y-2 text-sm\">\n <div className=\"font-medium text-foreground\">Path parameters</div>\n <div className=\"space-y-3\">\n {pathParams.map((parameter: any) => (\n <label key={parameter.name} className=\"space-y-1\">\n <div className=\"flex items-center justify-between text-xs text-muted-foreground\">\n <span>{parameter.name}</span>\n {parameter.required ? <span className=\"text-amber-600\">required</span> : null}\n </div>\n <input\n type=\"text\"\n value={pathValues[parameter.name] ?? ''}\n onChange={(event) =>\n setPathValues((prev) => ({\n ...prev,\n [parameter.name]: event.target.value,\n }))\n }\n placeholder={parameter.description ?? ''}\n className=\"w-full rounded-md border border-border bg-background px-3 py-2 text-sm focus-visible:border-ring focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/20\"\n />\n </label>\n ))}\n </div>\n </section>\n ) : null}\n\n {queryParams.length ? (\n <section className=\"space-y-2 text-sm\">\n <div className=\"font-medium text-foreground\">Query parameters</div>\n <div className=\"space-y-3\">\n {queryParams.map((parameter: any) => (\n <label key={parameter.name} className=\"space-y-1\">\n <div className=\"flex items-center justify-between text-xs text-muted-foreground\">\n <span>{parameter.name}</span>\n {parameter.required ? <span className=\"text-amber-600\">required</span> : null}\n </div>\n <input\n type=\"text\"\n value={queryValues[parameter.name] ?? ''}\n onChange={(event) =>\n setQueryValues((prev) => ({\n ...prev,\n [parameter.name]: event.target.value,\n }))\n }\n placeholder={parameter.description ?? ''}\n className=\"w-full rounded-md border border-border bg-background px-3 py-2 text-sm focus-visible:border-ring focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/20\"\n />\n </label>\n ))}\n </div>\n </section>\n ) : null}\n\n {requestVariant ? (\n <section className=\"space-y-2 text-sm\">\n <div className=\"flex items-center justify-between\">\n <span className=\"font-medium text-foreground\">Request body</span>\n <span className=\"text-xs text-muted-foreground\">{requestVariant.mediaType}</span>\n </div>\n <textarea\n value={bodyContent}\n onChange={(event) => setBodyContent(event.target.value)}\n rows={8}\n className=\"w-full rounded-md border border-border bg-background px-3 py-2 text-xs font-mono leading-relaxed focus-visible:border-ring focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/20\"\n placeholder=\"Provide request payload\"\n />\n </section>\n ) : null}\n\n {requestPreview?.bodyParseError ? (\n <div className=\"rounded border border-amber-300 bg-amber-50 px-3 py-2 text-xs text-amber-700\">\n {requestPreview.bodyParseError}\n </div>\n ) : null}\n\n {codeSnippets.length ? (\n <section className=\"space-y-2 text-sm\">\n <div className=\"font-medium text-foreground\">Request examples</div>\n <CodeSnippetTabs snippets={codeSnippets} />\n </section>\n ) : null}\n\n <button\n type=\"button\"\n onClick={handleSubmit}\n disabled={isLoading}\n className=\"inline-flex items-center justify-center rounded-md bg-primary px-4 py-2 text-sm font-semibold text-primary-foreground hover:bg-primary/90 disabled:cursor-not-allowed disabled:bg-primary/10\"\n >\n {isLoading ? 'Sending\u2026' : 'Send request'}\n </button>\n\n {error ? <div className=\"rounded border border-rose-300 bg-rose-50 px-3 py-2 text-xs text-rose-700\">{error}</div> : null}\n\n {response ? (\n <section className=\"space-y-2 text-sm\">\n <div className=\"flex items-center justify-between\">\n <div className=\"font-medium text-foreground\">\n Response \u00B7 <span className={response.ok ? 'text-emerald-600' : 'text-rose-600'}>{response.status}</span>\n </div>\n <div className=\"text-xs text-muted-foreground\">{response.durationMs} ms</div>\n </div>\n <pre className=\"max-h-80 overflow-auto rounded-md bg-muted px-3 py-2 text-xs leading-relaxed\">\n {response.parsed ? formatJson(response.parsed) : response.body || '(empty response)'}\n </pre>\n </section>\n ) : null}\n </div>\n )\n}\n"],
5
+ "mappings": ";AAuXY,SAKE,KALF;AArXZ,SAAS,WAAW,SAAS,gBAAgC;AAC7D,OAAO,WAAW;AAClB,OAAO,UAAU;AAEjB,MAAM,gBAAwC;AAAA,EAC5C,KAAK;AAAA,EACL,MAAM;AAAA,EACN,KAAK;AAAA,EACL,OAAO;AAAA,EACP,QAAQ;AACV;AAEA,MAAM,wBAAwB;AAAA,EAC5B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAuCA,SAAS,mBAAmB,SAAsD;AAChF,MAAI,CAAC,QAAS,QAAO;AACrB,QAAM,UAAU,OAAO,QAAQ,OAAO;AACtC,MAAI,CAAC,QAAQ,OAAQ,QAAO;AAC5B,aAAWA,cAAa,uBAAuB;AAC7C,UAAM,QAAQ,QAAQ,KAAK,CAAC,CAAC,SAAS,MAAM,cAAcA,UAAS;AACnE,QAAI,OAAO;AACT,aAAO,EAAE,WAAW,MAAM,CAAC,GAAG,OAAO,MAAM,CAAC,EAAE;AAAA,IAChD;AAAA,EACF;AACA,QAAM,CAAC,WAAW,KAAK,IAAI,QAAQ,CAAC;AACpC,SAAO,EAAE,WAAW,MAAM;AAC5B;AAEA,SAAS,uBAAuB,QAAsB;AACpD,MAAI,CAAC,UAAU,OAAO,WAAW,SAAU,QAAO;AAClD,MAAI,OAAO,YAAY,OAAW,QAAO,OAAO;AAChD,MAAI,OAAO,YAAY,OAAW,QAAO,OAAO;AAChD,MAAI,MAAM,QAAQ,OAAO,IAAI,KAAK,OAAO,KAAK,OA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AU;AAAA,SAC5E;AAAA,MACA;AAAA,QAAC;AAAA;AAAA,UACC,OAAO;AAAA,UACP,UAAU,CAAC,UAAU,eAAe,MAAM,OAAO,KAAK;AAAA,UACtD,MAAM;AAAA,UACN,WAAU;AAAA,UACV,aAAY;AAAA;AAAA,MACd;AAAA,OACF,IACE;AAAA,IAEH,gBAAgB,iBACf,oBAAC,SAAI,WAAU,gFACZ,yBAAe,gBAClB,IACE;AAAA,IAEH,aAAa,SACZ,qBAAC,aAAQ,WAAU,qBACjB;AAAA,0BAAC,SAAI,WAAU,+BAA8B,8BAAgB;AAAA,MAC7D,oBAAC,mBAAgB,UAAU,cAAc;AAAA,OAC3C,IACE;AAAA,IAEJ;AAAA,MAAC;AAAA;AAAA,QACC,MAAK;AAAA,QACL,SAAS;AAAA,QACT,UAAU;AAAA,QACV,WAAU;AAAA,QAET,sBAAY,kBAAa;AAAA;AAAA,IAC5B;AAAA,IAEC,QAAQ,oBAAC,SAAI,WAAU,6EAA6E,iBAAM,IAAS;AAAA,IAEnH,WACC,qBAAC,aAAQ,WAAU,qBACjB;AAAA,2BAAC,SAAI,WAAU,qCACb;AAAA,6BAAC,SAAI,WAAU,+BAA8B;AAAA;AAAA,UAChC,oBAAC,UAAK,WAAW,SAAS,KAAK,qBAAqB,iBAAkB,mBAAS,QAAO;AAAA,WACnG;AAAA,QACA,qBAAC,SAAI,WAAU,iCAAiC;AAAA,mBAAS;AAAA,UAAW;AAAA,WAAG;AAAA,SACzE;AAAA,MACA,oBAAC,SAAI,WAAU,gFACZ,mBAAS,SAAS,WAAW,SAAS,MAAM,IAAI,SAAS,QAAQ,oBACpE;AAAA,OACF,IACE;AAAA,KACN;AAEJ;",
6
6
  "names": ["mediaType"]
7
7
  }
@@ -105,7 +105,7 @@ function CreateApiKeyPage() {
105
105
  /* @__PURE__ */ jsx("p", { className: "mt-2 text-sm text-muted-foreground", children: t("api_keys.copy.subtitle") })
106
106
  ] }),
107
107
  /* @__PURE__ */ jsxs("div", { className: "space-y-4 p-6", children: [
108
- /* @__PURE__ */ jsx("div", { className: "rounded-md border bg-muted/40 p-4 font-mono text-sm break-all", children: createdSecret.secret }),
108
+ /* @__PURE__ */ jsx("div", { className: "rounded-md border bg-muted/50 p-4 font-mono text-sm break-all", children: createdSecret.secret }),
109
109
  /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between text-xs text-muted-foreground", children: [
110
110
  /* @__PURE__ */ jsx("span", { className: "inline-flex items-center rounded-full border px-2 py-1 font-medium", children: t("api_keys.copy.prefix", { prefix: createdSecret.keyPrefix }) }),
111
111
  /* @__PURE__ */ jsx("span", { children: t("api_keys.copy.warning") })
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../../src/modules/api_keys/backend/api-keys/create/page.tsx"],
4
- "sourcesContent": ["\"use client\"\nimport * as React from 'react'\nimport { Page, PageBody } from '@open-mercato/ui/backend/Page'\nimport { CrudForm, type CrudField, type CrudFormGroup } from '@open-mercato/ui/backend/CrudForm'\nimport { apiCall } from '@open-mercato/ui/backend/utils/apiCall'\nimport { createCrud } from '@open-mercato/ui/backend/utils/crud'\nimport { createCrudFormError } from '@open-mercato/ui/backend/utils/serverErrors'\nimport { OrganizationSelect } from '@open-mercato/core/modules/directory/components/OrganizationSelect'\nimport { fetchRoleOptions } from '@open-mercato/core/modules/auth/backend/users/roleOptions'\nimport { flash } from '@open-mercato/ui/backend/FlashMessages'\nimport { Button } from '@open-mercato/ui/primitives/button'\nimport { useRouter } from 'next/navigation'\nimport { useOrganizationScopeDetail, useOrganizationScopeVersion } from '@open-mercato/shared/lib/frontend/useOrganizationScope'\nimport { useT } from '@open-mercato/shared/lib/i18n/context'\n\ntype FormValues = {\n name: string\n description: string | null\n organizationId: string | null\n expiresAt: string | null\n roles: string[]\n}\n\nexport default function CreateApiKeyPage() {\n const [createdSecret, setCreatedSecret] = React.useState<{ secret: string; keyPrefix: string } | null>(null)\n const [actorIsSuperAdmin, setActorIsSuperAdmin] = React.useState(false)\n const [actorResolved, setActorResolved] = React.useState(false)\n const [selectedTenantId, setSelectedTenantId] = React.useState<string | null>(null)\n const router = useRouter()\n const scopeDetail = useOrganizationScopeDetail()\n const scopeVersion = useOrganizationScopeVersion()\n const t = useT()\n\n React.useEffect(() => {\n let cancelled = false\n async function loadInitialScope() {\n try {\n const { ok, result } = await apiCall<{ tenantId?: string; isSuperAdmin?: boolean }>(\n '/api/directory/organization-switcher',\n )\n if (!ok || cancelled) {\n if (!ok && !cancelled) setActorIsSuperAdmin(false)\n return\n }\n const rawTenant = typeof result?.tenantId === 'string' ? result.tenantId : null\n const normalizedTenant = rawTenant && rawTenant.trim().length > 0 ? rawTenant.trim() : null\n setSelectedTenantId(normalizedTenant)\n setActorIsSuperAdmin(Boolean(result?.isSuperAdmin))\n } catch {\n if (!cancelled) setActorIsSuperAdmin(false)\n } finally {\n if (!cancelled) setActorResolved(true)\n }\n }\n loadInitialScope()\n return () => { cancelled = true }\n }, [])\n\n React.useEffect(() => {\n if (scopeVersion === 0) return\n const rawTenant = scopeDetail.tenantId\n const normalizedTenant = typeof rawTenant === 'string' && rawTenant.trim().length > 0 ? rawTenant.trim() : null\n setSelectedTenantId((prev) => {\n if ((prev ?? null) === (normalizedTenant ?? null)) return prev\n return normalizedTenant\n })\n }, [scopeDetail.tenantId, scopeVersion])\n\n // Block role loading until we know whether the actor is a super admin. Without this guard the\n // initial (non-super-admin) branch fires before the flag resolves and the server returns roles\n // from other tenants because the real caller is a super admin without tenantId scoping.\n const loadRoleOptions = React.useCallback(async (query?: string) => {\n if (!actorResolved) return []\n if (actorIsSuperAdmin) {\n const tenant = typeof selectedTenantId === 'string' && selectedTenantId.trim().length > 0 ? selectedTenantId.trim() : null\n if (!tenant) return []\n return fetchRoleOptions(query, { tenantId: tenant })\n }\n return fetchRoleOptions(query)\n }, [actorIsSuperAdmin, actorResolved, selectedTenantId])\n\n const fields = React.useMemo<CrudField[]>(() => [\n { id: 'name', label: t('api_keys.form.name'), type: 'text', required: true },\n { id: 'description', label: t('api_keys.form.description'), type: 'textarea', description: t('api_keys.form.descriptionHint') },\n {\n id: 'organizationId',\n label: t('api_keys.form.organization'),\n required: false,\n type: 'custom',\n component: ({ id, value, setValue }) => (\n <OrganizationSelect\n id={id}\n value={typeof value === 'string' ? value : null}\n onChange={(next) => setValue(next ?? null)}\n includeEmptyOption\n emptyOptionLabel={t('api_keys.form.organizationPlaceholder')}\n className=\"w-full h-9 rounded border px-2 text-sm\"\n />\n ),\n },\n {\n id: 'roles',\n label: t('api_keys.form.roles'),\n type: 'tags',\n loadOptions: loadRoleOptions,\n description: t('api_keys.form.rolesHint'),\n },\n { id: 'expiresAt', label: t('api_keys.form.expiresAt'), type: 'date', description: t('api_keys.form.expiresHint') },\n ], [loadRoleOptions, t])\n\n const groups = React.useMemo<CrudFormGroup[]>(() => ([\n { id: 'details', title: t('api_keys.form.details'), column: 1, fields: ['name', 'description', 'organizationId', 'roles', 'expiresAt'] },\n ]), [t])\n\n if (createdSecret) {\n return (\n <Page>\n <PageBody>\n <div className=\"flex items-center justify-center\">\n <div className=\"w-full max-w-2xl rounded-xl border bg-card shadow-sm\">\n <div className=\"border-b p-6\">\n <h1 className=\"text-lg font-semibold leading-7\">{t('api_keys.copy.title')}</h1>\n <p className=\"mt-2 text-sm text-muted-foreground\">\n {t('api_keys.copy.subtitle')}\n </p>\n </div>\n <div className=\"space-y-4 p-6\">\n <div className=\"rounded-md border bg-muted/40 p-4 font-mono text-sm break-all\">\n {createdSecret.secret}\n </div>\n <div className=\"flex items-center justify-between text-xs text-muted-foreground\">\n <span className=\"inline-flex items-center rounded-full border px-2 py-1 font-medium\">\n {t('api_keys.copy.prefix', { prefix: createdSecret.keyPrefix })}\n </span>\n <span>{t('api_keys.copy.warning')}</span>\n </div>\n <div className=\"flex justify-end\">\n <Button onClick={() => router.push('/backend/api-keys')}>\n {t('common.close')}\n </Button>\n </div>\n </div>\n </div>\n </div>\n </PageBody>\n </Page>\n )\n }\n\n return (\n <Page>\n <PageBody>\n <div className=\"space-y-6\">\n <CrudForm<FormValues>\n title={t('api_keys.form.title')}\n backHref=\"/backend/api-keys\"\n fields={fields}\n groups={groups}\n initialValues={{ name: '', description: null, organizationId: null, roles: [], expiresAt: null }}\n submitLabel={t('common.create')}\n cancelHref=\"/backend/api-keys\"\n onSubmit={async (values) => {\n const payload: {\n name: string\n description: string | null\n organizationId: string | null\n roles: string[]\n expiresAt: string | null\n tenantId?: string | null\n } = {\n name: values.name,\n description: values.description || null,\n organizationId: values.organizationId || null,\n roles: Array.isArray(values.roles) ? values.roles : [],\n expiresAt: values.expiresAt || null,\n }\n if (actorIsSuperAdmin) {\n const tenant = typeof selectedTenantId === 'string' && selectedTenantId.trim().length > 0 ? selectedTenantId.trim() : null\n if (!tenant) {\n const message = t('api_keys.errors.tenantRequired')\n throw createCrudFormError(message, { tenantId: message })\n }\n payload.tenantId = tenant\n }\n const { result } = await createCrud<{ secret?: string; keyPrefix?: string | null }>(\n 'api_keys/keys',\n payload,\n )\n const created = result\n if (!created || typeof created.secret !== 'string') {\n throw createCrudFormError(t('api_keys.form.error.secretMissing'))\n }\n const keyPrefix = typeof created.keyPrefix === 'string' ? created.keyPrefix : ''\n setCreatedSecret({ secret: created.secret, keyPrefix })\n flash(t('api_keys.form.success'), 'success')\n }}\n />\n </div>\n </PageBody>\n </Page>\n )\n}\n"],
4
+ "sourcesContent": ["\"use client\"\nimport * as React from 'react'\nimport { Page, PageBody } from '@open-mercato/ui/backend/Page'\nimport { CrudForm, type CrudField, type CrudFormGroup } from '@open-mercato/ui/backend/CrudForm'\nimport { apiCall } from '@open-mercato/ui/backend/utils/apiCall'\nimport { createCrud } from '@open-mercato/ui/backend/utils/crud'\nimport { createCrudFormError } from '@open-mercato/ui/backend/utils/serverErrors'\nimport { OrganizationSelect } from '@open-mercato/core/modules/directory/components/OrganizationSelect'\nimport { fetchRoleOptions } from '@open-mercato/core/modules/auth/backend/users/roleOptions'\nimport { flash } from '@open-mercato/ui/backend/FlashMessages'\nimport { Button } from '@open-mercato/ui/primitives/button'\nimport { useRouter } from 'next/navigation'\nimport { useOrganizationScopeDetail, useOrganizationScopeVersion } from '@open-mercato/shared/lib/frontend/useOrganizationScope'\nimport { useT } from '@open-mercato/shared/lib/i18n/context'\n\ntype FormValues = {\n name: string\n description: string | null\n organizationId: string | null\n expiresAt: string | null\n roles: string[]\n}\n\nexport default function CreateApiKeyPage() {\n const [createdSecret, setCreatedSecret] = React.useState<{ secret: string; keyPrefix: string } | null>(null)\n const [actorIsSuperAdmin, setActorIsSuperAdmin] = React.useState(false)\n const [actorResolved, setActorResolved] = React.useState(false)\n const [selectedTenantId, setSelectedTenantId] = React.useState<string | null>(null)\n const router = useRouter()\n const scopeDetail = useOrganizationScopeDetail()\n const scopeVersion = useOrganizationScopeVersion()\n const t = useT()\n\n React.useEffect(() => {\n let cancelled = false\n async function loadInitialScope() {\n try {\n const { ok, result } = await apiCall<{ tenantId?: string; isSuperAdmin?: boolean }>(\n '/api/directory/organization-switcher',\n )\n if (!ok || cancelled) {\n if (!ok && !cancelled) setActorIsSuperAdmin(false)\n return\n }\n const rawTenant = typeof result?.tenantId === 'string' ? result.tenantId : null\n const normalizedTenant = rawTenant && rawTenant.trim().length > 0 ? rawTenant.trim() : null\n setSelectedTenantId(normalizedTenant)\n setActorIsSuperAdmin(Boolean(result?.isSuperAdmin))\n } catch {\n if (!cancelled) setActorIsSuperAdmin(false)\n } finally {\n if (!cancelled) setActorResolved(true)\n }\n }\n loadInitialScope()\n return () => { cancelled = true }\n }, [])\n\n React.useEffect(() => {\n if (scopeVersion === 0) return\n const rawTenant = scopeDetail.tenantId\n const normalizedTenant = typeof rawTenant === 'string' && rawTenant.trim().length > 0 ? rawTenant.trim() : null\n setSelectedTenantId((prev) => {\n if ((prev ?? null) === (normalizedTenant ?? null)) return prev\n return normalizedTenant\n })\n }, [scopeDetail.tenantId, scopeVersion])\n\n // Block role loading until we know whether the actor is a super admin. Without this guard the\n // initial (non-super-admin) branch fires before the flag resolves and the server returns roles\n // from other tenants because the real caller is a super admin without tenantId scoping.\n const loadRoleOptions = React.useCallback(async (query?: string) => {\n if (!actorResolved) return []\n if (actorIsSuperAdmin) {\n const tenant = typeof selectedTenantId === 'string' && selectedTenantId.trim().length > 0 ? selectedTenantId.trim() : null\n if (!tenant) return []\n return fetchRoleOptions(query, { tenantId: tenant })\n }\n return fetchRoleOptions(query)\n }, [actorIsSuperAdmin, actorResolved, selectedTenantId])\n\n const fields = React.useMemo<CrudField[]>(() => [\n { id: 'name', label: t('api_keys.form.name'), type: 'text', required: true },\n { id: 'description', label: t('api_keys.form.description'), type: 'textarea', description: t('api_keys.form.descriptionHint') },\n {\n id: 'organizationId',\n label: t('api_keys.form.organization'),\n required: false,\n type: 'custom',\n component: ({ id, value, setValue }) => (\n <OrganizationSelect\n id={id}\n value={typeof value === 'string' ? value : null}\n onChange={(next) => setValue(next ?? null)}\n includeEmptyOption\n emptyOptionLabel={t('api_keys.form.organizationPlaceholder')}\n className=\"w-full h-9 rounded border px-2 text-sm\"\n />\n ),\n },\n {\n id: 'roles',\n label: t('api_keys.form.roles'),\n type: 'tags',\n loadOptions: loadRoleOptions,\n description: t('api_keys.form.rolesHint'),\n },\n { id: 'expiresAt', label: t('api_keys.form.expiresAt'), type: 'date', description: t('api_keys.form.expiresHint') },\n ], [loadRoleOptions, t])\n\n const groups = React.useMemo<CrudFormGroup[]>(() => ([\n { id: 'details', title: t('api_keys.form.details'), column: 1, fields: ['name', 'description', 'organizationId', 'roles', 'expiresAt'] },\n ]), [t])\n\n if (createdSecret) {\n return (\n <Page>\n <PageBody>\n <div className=\"flex items-center justify-center\">\n <div className=\"w-full max-w-2xl rounded-xl border bg-card shadow-sm\">\n <div className=\"border-b p-6\">\n <h1 className=\"text-lg font-semibold leading-7\">{t('api_keys.copy.title')}</h1>\n <p className=\"mt-2 text-sm text-muted-foreground\">\n {t('api_keys.copy.subtitle')}\n </p>\n </div>\n <div className=\"space-y-4 p-6\">\n <div className=\"rounded-md border bg-muted/50 p-4 font-mono text-sm break-all\">\n {createdSecret.secret}\n </div>\n <div className=\"flex items-center justify-between text-xs text-muted-foreground\">\n <span className=\"inline-flex items-center rounded-full border px-2 py-1 font-medium\">\n {t('api_keys.copy.prefix', { prefix: createdSecret.keyPrefix })}\n </span>\n <span>{t('api_keys.copy.warning')}</span>\n </div>\n <div className=\"flex justify-end\">\n <Button onClick={() => router.push('/backend/api-keys')}>\n {t('common.close')}\n </Button>\n </div>\n </div>\n </div>\n </div>\n </PageBody>\n </Page>\n )\n }\n\n return (\n <Page>\n <PageBody>\n <div className=\"space-y-6\">\n <CrudForm<FormValues>\n title={t('api_keys.form.title')}\n backHref=\"/backend/api-keys\"\n fields={fields}\n groups={groups}\n initialValues={{ name: '', description: null, organizationId: null, roles: [], expiresAt: null }}\n submitLabel={t('common.create')}\n cancelHref=\"/backend/api-keys\"\n onSubmit={async (values) => {\n const payload: {\n name: string\n description: string | null\n organizationId: string | null\n roles: string[]\n expiresAt: string | null\n tenantId?: string | null\n } = {\n name: values.name,\n description: values.description || null,\n organizationId: values.organizationId || null,\n roles: Array.isArray(values.roles) ? values.roles : [],\n expiresAt: values.expiresAt || null,\n }\n if (actorIsSuperAdmin) {\n const tenant = typeof selectedTenantId === 'string' && selectedTenantId.trim().length > 0 ? selectedTenantId.trim() : null\n if (!tenant) {\n const message = t('api_keys.errors.tenantRequired')\n throw createCrudFormError(message, { tenantId: message })\n }\n payload.tenantId = tenant\n }\n const { result } = await createCrud<{ secret?: string; keyPrefix?: string | null }>(\n 'api_keys/keys',\n payload,\n )\n const created = result\n if (!created || typeof created.secret !== 'string') {\n throw createCrudFormError(t('api_keys.form.error.secretMissing'))\n }\n const keyPrefix = typeof created.keyPrefix === 'string' ? created.keyPrefix : ''\n setCreatedSecret({ secret: created.secret, keyPrefix })\n flash(t('api_keys.form.success'), 'success')\n }}\n />\n </div>\n </PageBody>\n </Page>\n )\n}\n"],
5
5
  "mappings": ";AA0FQ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;AAEJ;",
6
6
  "names": []
7
7
  }
@@ -541,7 +541,7 @@ function AttachmentUploadForm({ partitions, availableTags, onUploaded, onCancel
541
541
  onSubmit: handleSubmit
542
542
  }
543
543
  ),
544
- isUploading ? /* @__PURE__ */ jsx("div", { className: "pointer-events-none absolute inset-0 z-20 flex items-center justify-center bg-background/90 px-6 text-center backdrop-blur", children: /* @__PURE__ */ jsxs("div", { className: "flex w-full max-w-sm flex-col items-center gap-4 rounded-xl border border-border/50 bg-card/95 px-6 py-8 shadow-2xl", children: [
544
+ isUploading ? /* @__PURE__ */ jsx("div", { className: "pointer-events-none absolute inset-0 z-20 flex items-center justify-center bg-background/80 px-6 text-center backdrop-blur", children: /* @__PURE__ */ jsxs("div", { className: "flex w-full max-w-sm flex-col items-center gap-4 rounded-xl border border-border/70 bg-card/95 px-6 py-8 shadow-2xl", children: [
545
545
  /* @__PURE__ */ jsx(Spinner, { size: "lg", className: "border-primary/50 border-t-primary" }),
546
546
  /* @__PURE__ */ jsxs("div", { className: "w-full space-y-3", children: [
547
547
  /* @__PURE__ */ jsx("p", { className: "text-base font-semibold", children: t("attachments.library.upload.progressLabel", "Uploading files") }),
@@ -695,7 +695,7 @@ function AttachmentLibrary() {
695
695
  }
696
696
  const placeholder = resolveAttachmentPlaceholder(value.mimeType, value.fileName);
697
697
  const PlaceholderIcon = placeholder.icon;
698
- return /* @__PURE__ */ jsxs("div", { className: "flex h-16 w-16 flex-col items-center justify-center rounded border bg-muted text-[10px] font-semibold uppercase text-muted-foreground", children: [
698
+ return /* @__PURE__ */ jsxs("div", { className: "flex h-16 w-16 flex-col items-center justify-center rounded border bg-muted text-overline font-semibold uppercase text-muted-foreground", children: [
699
699
  /* @__PURE__ */ jsx(PlaceholderIcon, { className: "mb-1 h-5 w-5 text-muted-foreground", "aria-hidden": true }),
700
700
  placeholder.label
701
701
  ] });