@aglyn/plugins-commerce 1.0.0-beta.250 → 1.0.0-beta.253

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 (52) hide show
  1. package/package.json +13 -13
  2. package/src/lib/components/commerce-console-page.d.ts +1 -1
  3. package/src/lib/components/commerce-console-page.js +139 -175
  4. package/src/lib/components/commerce-console-page.js.map +1 -1
  5. package/src/lib/components/commerce-console-sections.d.ts +30 -2
  6. package/src/lib/components/commerce-console-sections.js +82 -7
  7. package/src/lib/components/commerce-console-sections.js.map +1 -1
  8. package/src/lib/components/console/discounts-card.component.js +36 -3
  9. package/src/lib/components/console/discounts-card.component.js.map +1 -1
  10. package/src/lib/components/console/host-coupons-card.component.js +1 -1
  11. package/src/lib/components/console/host-coupons-card.component.js.map +1 -1
  12. package/src/lib/components/console/pos/pos-pairing.component.d.ts +59 -0
  13. package/src/lib/components/console/pos/pos-pairing.component.js +174 -0
  14. package/src/lib/components/console/pos/pos-pairing.component.js.map +1 -0
  15. package/src/lib/components/console/pos/use-pos-display.d.ts +0 -8
  16. package/src/lib/components/console/pos/use-pos-display.js +2 -16
  17. package/src/lib/components/console/pos/use-pos-display.js.map +1 -1
  18. package/src/lib/components/console/pos-devices-card.component.d.ts +12 -1
  19. package/src/lib/components/console/pos-devices-card.component.js +132 -59
  20. package/src/lib/components/console/pos-devices-card.component.js.map +1 -1
  21. package/src/lib/components/console/pos-page.component.d.ts +1 -1
  22. package/src/lib/components/console/pos-page.component.js +37 -86
  23. package/src/lib/components/console/pos-page.component.js.map +1 -1
  24. package/src/lib/components/console/registers-card.component.js +13 -0
  25. package/src/lib/components/console/registers-card.component.js.map +1 -1
  26. package/src/lib/components/console/shipping-settings-card.component.js +6 -11
  27. package/src/lib/components/console/shipping-settings-card.component.js.map +1 -1
  28. package/src/lib/components/console/store-zones.d.ts +15 -0
  29. package/src/lib/components/console/store-zones.js +36 -4
  30. package/src/lib/components/console/store-zones.js.map +1 -1
  31. package/src/lib/components/console/suppliers-card.component.js +2 -2
  32. package/src/lib/components/console/suppliers-card.component.js.map +1 -1
  33. package/src/lib/model/commerce-record-routes.js +10 -3
  34. package/src/lib/model/commerce-record-routes.js.map +1 -1
  35. package/src/lib/model/commerce-shipping.d.ts +16 -0
  36. package/src/lib/model/commerce-shipping.js +21 -0
  37. package/src/lib/model/commerce-shipping.js.map +1 -1
  38. package/src/lib/model/commerce-tax-decision.js +2 -2
  39. package/src/lib/model/commerce-tax-decision.js.map +1 -1
  40. package/src/lib/plugin.js +4 -1
  41. package/src/lib/plugin.js.map +1 -1
  42. package/src/lib/server/billing-webhook.js +13 -0
  43. package/src/lib/server/billing-webhook.js.map +1 -1
  44. package/src/lib/server/order-webhooks.js +1 -1
  45. package/src/lib/server/order-webhooks.js.map +1 -1
  46. package/src/lib/server/shippingeasy.js +1 -1
  47. package/src/lib/server/shippingeasy.js.map +1 -1
  48. package/src/lib/server/store-setup-ai-capability.js +10 -2
  49. package/src/lib/server/store-setup-ai-capability.js.map +1 -1
  50. package/src/lib/server/supplier-routing.d.ts +86 -0
  51. package/src/lib/server/supplier-routing.js +175 -0
  52. package/src/lib/server/supplier-routing.js.map +1 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aglyn/plugins-commerce",
3
- "version": "1.0.0-beta.250",
3
+ "version": "1.0.0-beta.253",
4
4
  "license": "Apache-2.0",
5
5
  "homepage": "https://aglyn.com",
6
6
  "repository": {
@@ -25,18 +25,18 @@
25
25
  "./package.json": "./package.json"
26
26
  },
27
27
  "dependencies": {
28
- "@aglyn/aglyn": "1.0.0-beta.250",
29
- "@aglyn/shared-data-mdi": "1.0.0-beta.250",
30
- "@aglyn/shared-ui-jsx": "1.0.0-beta.250",
31
- "@aglyn/shared-ui-next": "1.0.0-beta.250",
32
- "@aglyn/shared-ui-snackstack": "1.0.0-beta.250",
33
- "@aglyn/shared-util-email": "1.0.0-beta.250",
34
- "@aglyn/shared-util-http": "1.0.0-beta.250",
35
- "@aglyn/shared-util-timestamp": "1.0.0-beta.250",
36
- "@aglyn/shared-util-tools": "1.0.0-beta.250",
37
- "@aglyn/tenant-data-admin": "1.0.0-beta.250",
38
- "@aglyn/tenant-feature-instance": "1.0.0-beta.250",
39
- "@aglyn/tenant-runtime": "1.0.0-beta.250",
28
+ "@aglyn/aglyn": "1.0.0-beta.253",
29
+ "@aglyn/shared-data-mdi": "1.0.0-beta.253",
30
+ "@aglyn/shared-ui-jsx": "1.0.0-beta.253",
31
+ "@aglyn/shared-ui-next": "1.0.0-beta.253",
32
+ "@aglyn/shared-ui-snackstack": "1.0.0-beta.253",
33
+ "@aglyn/shared-util-email": "1.0.0-beta.253",
34
+ "@aglyn/shared-util-http": "1.0.0-beta.253",
35
+ "@aglyn/shared-util-timestamp": "1.0.0-beta.253",
36
+ "@aglyn/shared-util-tools": "1.0.0-beta.253",
37
+ "@aglyn/tenant-data-admin": "1.0.0-beta.253",
38
+ "@aglyn/tenant-feature-instance": "1.0.0-beta.253",
39
+ "@aglyn/tenant-runtime": "1.0.0-beta.253",
40
40
  "@stripe/react-stripe-js": "^6.12.0",
41
41
  "@stripe/stripe-js": "^9.17.0",
42
42
  "@swc/helpers": "0.5.23",
@@ -8,7 +8,7 @@ import type { ConsolePluginPageProps } from '@aglyn/aglyn';
8
8
  *
9
9
  * ## Sections are ROUTES (AGL-2501)
10
10
  *
11
- * The six sections hold thirty-two Firestore listens between them, and a tab
11
+ * The sections hold thirty-two Firestore listens between them, and a tab
12
12
  * strip mounts every panel: opening Catalog also subscribed the orders,
13
13
  * promotions, reservations, settings and analytics cards. The `limit()` on
14
14
  * those queries is the bill — several ask for 500, and one load reached a
@@ -17,6 +17,7 @@
17
17
  import { jsx as _jsx } from "react/jsx-runtime";
18
18
  import { GridItems } from "@aglyn/shared-ui-jsx";
19
19
  import { HubSections } from "@aglyn/shared-ui-next";
20
+ import { COMMERCE_SETTINGS_PAGE_ZONES } from "./commerce-console-sections.js";
20
21
  import CatalogOrganizationCard from "./console/catalog-organization-card.component.js";
21
22
  import CommerceAnalyticsCard from "./console/commerce-analytics-card.component.js";
22
23
  import CustomerNotificationsCard from "./console/customer-notifications-card.component.js";
@@ -51,19 +52,43 @@ import StoreSettingsCard from "./console/store-settings-card.component.js";
51
52
  import StorefrontTaxSummaryCard from "./console/storefront-tax-summary-card.component.js";
52
53
  import SuppliersCard from "./console/suppliers-card.component.js";
53
54
  import TaxSettingsCard from "./console/tax-settings-card.component.js";
54
- import { COMMERCE_PROMOTIONS_ZONE, COMMERCE_SETTINGS_ZONE } from "./console/store-zones.js";
55
+ import { COMMERCE_PROMOTIONS_ZONE } from "./console/store-zones.js";
55
56
  import { useConsoleWidgetSlot } from "@aglyn/aglyn/app-utils/console-widget-slot-context";
56
57
  /**
57
- * The `commerceSettings` zone (AGL-3612): other plugins' settings for the
58
- * store — label settings and carrier accounts — under the store's own.
58
+ * A settings page's zone (AGL-3612, AGL-3713): other plugins' settings for
59
+ * the store — label settings, carrier accounts, a tax service — under the
60
+ * page's own cards. One zone per page, from `COMMERCE_SETTINGS_PAGE_ZONES`;
61
+ * Integrations draws `commerceSettings`, where a widget naming no page lands.
59
62
  */ function CommerceSettingsZone(props) {
60
63
  const WidgetSlot = useConsoleWidgetSlot();
61
64
  return WidgetSlot ? /*#__PURE__*/ _jsx(WidgetSlot, {
62
- slot: COMMERCE_SETTINGS_ZONE.id,
65
+ slot: COMMERCE_SETTINGS_PAGE_ZONES[props.page],
63
66
  hostId: props.hostId,
64
67
  orgId: undefined
65
68
  }) : null;
66
69
  }
70
+ /** One settings page: its cards in order, then its zone (AGL-3713). */ function settingsPage(page, hostId, cards) {
71
+ return /*#__PURE__*/ _jsx(GridItems, {
72
+ spacing: 3,
73
+ items: [
74
+ ...cards.map((children)=>({
75
+ size: {
76
+ xs: 12
77
+ },
78
+ children
79
+ })),
80
+ {
81
+ size: {
82
+ xs: 12
83
+ },
84
+ children: /*#__PURE__*/ _jsx(CommerceSettingsZone, {
85
+ hostId: hostId,
86
+ page: page
87
+ })
88
+ }
89
+ ]
90
+ });
91
+ }
67
92
  /**
68
93
  * The `commercePromotions` zone (AGL-3640): other plugins' programs beside
69
94
  * the store's own money-off surfaces — a rewards program first.
@@ -80,10 +105,10 @@ import { useConsoleWidgetSlot } from "@aglyn/aglyn/app-utils/console-widget-slot
80
105
  * being read (AGL-2501).
81
106
  *
82
107
  * A function rather than a map of nodes on purpose: a `Record<id, ReactNode>`
83
- * would CONSTRUCT all six every render, and each card opens its Firestore
108
+ * would CONSTRUCT every section every render, and each card opens its Firestore
84
109
  * listens on mount — which is the entire cost this page exists to stop paying.
85
110
  * Only the returned branch is ever built.
86
- */ function sectionBody(section, hostId) {
111
+ */ function sectionBody(section, hostId, canManagePos) {
87
112
  switch(section){
88
113
  case 'catalog':
89
114
  return /*#__PURE__*/ _jsx(GridItems, {
@@ -213,67 +238,8 @@ import { useConsoleWidgetSlot } from "@aglyn/aglyn/app-utils/console-widget-slot
213
238
  hostId: hostId
214
239
  })
215
240
  },
216
- {
217
- size: {
218
- xs: 12
219
- },
220
- children: /*#__PURE__*/ _jsx(CommercePromotionsZone, {
221
- hostId: hostId
222
- })
223
- }
224
- ]
225
- });
226
- case 'reservations':
227
- return /*#__PURE__*/ _jsx(ReservationsCard, {
228
- hostId: hostId
229
- });
230
- case 'settings':
231
- return /*#__PURE__*/ _jsx(GridItems, {
232
- spacing: 3,
233
- items: [
234
- {
235
- size: {
236
- xs: 12
237
- },
238
- children: /*#__PURE__*/ _jsx(PaymentsSettingsCard, {
239
- hostId: hostId
240
- })
241
- },
242
- // What shoppers may pay with (AGL-3629), beside the account the
243
- // money lands in.
244
- {
245
- size: {
246
- xs: 12
247
- },
248
- children: /*#__PURE__*/ _jsx(PaymentMethodsCard, {
249
- hostId: hostId
250
- })
251
- },
252
- {
253
- size: {
254
- xs: 12
255
- },
256
- children: /*#__PURE__*/ _jsx(StoreSettingsCard, {
257
- hostId: hostId
258
- })
259
- },
260
- {
261
- size: {
262
- xs: 12
263
- },
264
- children: /*#__PURE__*/ _jsx(ReturnSettingsCard, {
265
- hostId: hostId
266
- })
267
- },
268
- {
269
- size: {
270
- xs: 12
271
- },
272
- children: /*#__PURE__*/ _jsx(CustomerNotificationsCard, {
273
- hostId: hostId
274
- })
275
- },
276
- // Who may review, and the review-request email (AGL-3736).
241
+ // Who may review, and the review-request email (AGL-3736),
242
+ // beside the queue those reviews land in.
277
243
  {
278
244
  size: {
279
245
  xs: 12
@@ -286,118 +252,111 @@ import { useConsoleWidgetSlot } from "@aglyn/aglyn/app-utils/console-widget-slot
286
252
  size: {
287
253
  xs: 12
288
254
  },
289
- children: /*#__PURE__*/ _jsx(TaxSettingsCard, {
290
- hostId: hostId
291
- })
292
- },
293
- {
294
- size: {
295
- xs: 12
296
- },
297
- children: /*#__PURE__*/ _jsx(LocationsCard, {
298
- hostId: hostId
299
- })
300
- },
301
- {
302
- size: {
303
- xs: 12
304
- },
305
- children: /*#__PURE__*/ _jsx(RegistersCard, {
306
- hostId: hostId
307
- })
308
- },
309
- {
310
- size: {
311
- xs: 12
312
- },
313
- children: /*#__PURE__*/ _jsx(PosStaffPinsCard, {
314
- hostId: hostId
315
- })
316
- },
317
- // A register's printers, cash drawer and status (AGL-3619), one
318
- // card per register, after the list that names them.
319
- {
320
- size: {
321
- xs: 12
322
- },
323
- children: /*#__PURE__*/ _jsx(RegisterHardwareCards, {
324
- hostId: hostId
325
- })
326
- },
327
- {
328
- size: {
329
- xs: 12
330
- },
331
- children: /*#__PURE__*/ _jsx(PosDevicesCard, {
332
- hostId: hostId
333
- })
334
- },
335
- {
336
- size: {
337
- xs: 12
338
- },
339
- children: /*#__PURE__*/ _jsx(ShippingSettingsCard, {
340
- hostId: hostId
341
- })
342
- },
343
- // The store's own delivery (AGL-3624); pickup is per location,
344
- // on the Inventory locations card above.
345
- {
346
- size: {
347
- xs: 12
348
- },
349
- children: /*#__PURE__*/ _jsx(LocalDeliverySettingsCard, {
350
- hostId: hostId
351
- })
352
- },
353
- {
354
- size: {
355
- xs: 12
356
- },
357
- children: /*#__PURE__*/ _jsx(SuppliersCard, {
358
- hostId: hostId
359
- })
360
- },
361
- {
362
- size: {
363
- xs: 12
364
- },
365
- children: /*#__PURE__*/ _jsx(ShipStationCard, {
366
- hostId: hostId
367
- })
368
- },
369
- // ShippingEasy, with the merchant's own keys (AGL-3633).
370
- {
371
- size: {
372
- xs: 12
373
- },
374
- children: /*#__PURE__*/ _jsx(ShippingEasyCard, {
375
- hostId: hostId
376
- })
377
- },
378
- // The store's own endpoints for order events (AGL-3611). Renders
379
- // nothing for a person who may not manage them.
380
- {
381
- size: {
382
- xs: 12
383
- },
384
- children: /*#__PURE__*/ _jsx(OrderWebhooksCard, {
385
- hostId: hostId
386
- })
387
- },
388
- {
389
- size: {
390
- xs: 12
391
- },
392
- children: /*#__PURE__*/ _jsx(CommerceSettingsZone, {
255
+ children: /*#__PURE__*/ _jsx(CommercePromotionsZone, {
393
256
  hostId: hostId
394
257
  })
395
258
  }
396
259
  ]
397
260
  });
261
+ case 'reservations':
262
+ return /*#__PURE__*/ _jsx(ReservationsCard, {
263
+ hostId: hostId
264
+ });
265
+ /*
266
+ * The store's settings, a page each (AGL-3713). They were one `settings`
267
+ * section — every card below in one column — and its old address opens
268
+ * Payments (`COMMERCE_RETIRED_SECTIONS`). Each page is its cards, then
269
+ * the zone where other plugins' cards for that page land.
270
+ */ case 'payments':
271
+ return settingsPage(section, hostId, [
272
+ /*#__PURE__*/ _jsx(PaymentsSettingsCard, {
273
+ hostId: hostId
274
+ }, "payments"),
275
+ // What shoppers may pay with (AGL-3629), beside the account the
276
+ // money lands in.
277
+ /*#__PURE__*/ _jsx(PaymentMethodsCard, {
278
+ hostId: hostId
279
+ }, "methods")
280
+ ]);
281
+ case 'checkout':
282
+ return settingsPage(section, hostId, [
283
+ /*#__PURE__*/ _jsx(StoreSettingsCard, {
284
+ hostId: hostId
285
+ }, "store"),
286
+ // Whether buyers may ask for a return online (AGL-3611): the store's
287
+ // policy, beside the terms and guest-checkout rules above it.
288
+ /*#__PURE__*/ _jsx(ReturnSettingsCard, {
289
+ hostId: hostId
290
+ }, "returns")
291
+ ]);
292
+ case 'taxes':
293
+ return settingsPage(section, hostId, [
294
+ /*#__PURE__*/ _jsx(TaxSettingsCard, {
295
+ hostId: hostId
296
+ }, "tax")
297
+ ]);
298
+ case 'shipping':
299
+ return settingsPage(section, hostId, [
300
+ /*#__PURE__*/ _jsx(ShippingSettingsCard, {
301
+ hostId: hostId
302
+ }, "shipping"),
303
+ // Where parcels ship from, and pickup, per location.
304
+ /*#__PURE__*/ _jsx(LocationsCard, {
305
+ hostId: hostId
306
+ }, "locations"),
307
+ // The store's own delivery (AGL-3624); pickup is per location, on
308
+ // the Inventory locations card above.
309
+ /*#__PURE__*/ _jsx(LocalDeliverySettingsCard, {
310
+ hostId: hostId
311
+ }, "local"),
312
+ /*#__PURE__*/ _jsx(SuppliersCard, {
313
+ hostId: hostId
314
+ }, "suppliers"),
315
+ /*#__PURE__*/ _jsx(ShipStationCard, {
316
+ hostId: hostId
317
+ }, "shipstation"),
318
+ // ShippingEasy, with the merchant's own keys (AGL-3633).
319
+ /*#__PURE__*/ _jsx(ShippingEasyCard, {
320
+ hostId: hostId
321
+ }, "shippingeasy")
322
+ ]);
323
+ case 'notifications':
324
+ return settingsPage(section, hostId, [
325
+ /*#__PURE__*/ _jsx(CustomerNotificationsCard, {
326
+ hostId: hostId
327
+ }, "customers"),
328
+ // The store's own endpoints for order events (AGL-3611). Renders
329
+ // nothing for a person who may not manage them.
330
+ /*#__PURE__*/ _jsx(OrderWebhooksCard, {
331
+ hostId: hostId
332
+ }, "webhooks")
333
+ ]);
334
+ case 'pos':
335
+ return settingsPage(section, hostId, [
336
+ /*#__PURE__*/ _jsx(RegistersCard, {
337
+ hostId: hostId
338
+ }, "registers"),
339
+ /*#__PURE__*/ _jsx(PosStaffPinsCard, {
340
+ hostId: hostId
341
+ }, "pins"),
342
+ // A register's printers, cash drawer and status (AGL-3619), one card
343
+ // per register, after the list that names them.
344
+ /*#__PURE__*/ _jsx(RegisterHardwareCards, {
345
+ hostId: hostId
346
+ }, "hardware"),
347
+ /*#__PURE__*/ _jsx(PosDevicesCard, {
348
+ hostId: hostId,
349
+ canManagePos: canManagePos
350
+ }, "devices")
351
+ ]);
352
+ case 'channels':
353
+ case 'integrations':
354
+ // Other plugins' cards only; the rail leaves either page out while
355
+ // its zone has nothing to draw (`onlyWithZones`).
356
+ return settingsPage(section, hostId, []);
398
357
  case 'analytics':
399
358
  return(// Two cards since AGL-2440. The tax summary lives here rather
400
- // than under Settings → Tax because that tab CONFIGURES tax and
359
+ // than on the Taxes settings page because that page CONFIGURES tax and
401
360
  // this REPORTS what was collected — a merchant reading a figure
402
361
  // they may file from should not be one field away from changing
403
362
  // the rate that produced it.
@@ -435,7 +394,7 @@ import { useConsoleWidgetSlot } from "@aglyn/aglyn/app-utils/console-widget-slot
435
394
  *
436
395
  * ## Sections are ROUTES (AGL-2501)
437
396
  *
438
- * The six sections hold thirty-two Firestore listens between them, and a tab
397
+ * The sections hold thirty-two Firestore listens between them, and a tab
439
398
  * strip mounts every panel: opening Catalog also subscribed the orders,
440
399
  * promotions, reservations, settings and analytics cards. The `limit()` on
441
400
  * those queries is the bill — several ask for 500, and one load reached a
@@ -452,7 +411,12 @@ import { useConsoleWidgetSlot } from "@aglyn/aglyn/app-utils/console-widget-slot
452
411
  * The shell resolves the section, gates it and hands back the rail's hrefs;
453
412
  * this page only has to say what each section contains.
454
413
  */ export function CommerceConsolePage(props) {
455
- const { hostId, section, sections, basePath } = props;
414
+ const { hostId, section, sections, basePath, permissions, hostRole } = props;
415
+ /*
416
+ * The register's own gate, for the devices card's Pair display (AGL-3712):
417
+ * `managePos` on a site role that may run it — what the server's
418
+ * `mayWorkRegister` asks. The server stays the enforcement point.
419
+ */ const canManagePos = (permissions == null ? void 0 : permissions.managePos) === true && (hostRole == null ? void 0 : hostRole.canPublish) === true;
456
420
  /*
457
421
  * Nothing, deliberately, while the redirect is in flight.
458
422
  *
@@ -462,7 +426,7 @@ import { useConsoleWidgetSlot } from "@aglyn/aglyn/app-utils/console-widget-slot
462
426
  */ if (!section || !(sections == null ? void 0 : sections.length) || !basePath) return null;
463
427
  return /*#__PURE__*/ _jsx(HubSections, {
464
428
  sections: sections,
465
- children: sectionBody(section, hostId)
429
+ children: sectionBody(section, hostId, canManagePos)
466
430
  });
467
431
  }
468
432
  CommerceConsolePage.displayName = 'CommerceConsolePage';
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../../libs/plugins/commerce/src/lib/components/commerce-console-page.tsx"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n'use client'\n\nimport type { ConsolePluginPageProps } from '@aglyn/aglyn'\nimport { GridItems } from '@aglyn/shared-ui-jsx'\nimport { HubSections } from '@aglyn/shared-ui-next'\nimport type { ReactNode } from 'react'\nimport type { CommerceConsoleSectionId } from './commerce-console-sections'\nimport CatalogOrganizationCard from './console/catalog-organization-card.component'\nimport CommerceAnalyticsCard from './console/commerce-analytics-card.component'\nimport CustomerNotificationsCard from './console/customer-notifications-card.component'\nimport DiscountsCard from './console/discounts-card.component'\nimport GiftCardsCard from './console/gift-cards-card.component'\nimport HostCouponsCard from './console/host-coupons-card.component'\nimport HostOrdersCard from './console/host-orders-card.component'\nimport LocationsCard from './console/locations-card.component'\nimport LocalDeliverySettingsCard from './console/local-delivery-settings-card.component'\nimport PickupDeliveryQueueCard from './console/pickup-delivery-queue-card.component'\nimport MemberPostsCard from './console/member-posts-card.component'\nimport OrderWebhooksCard from './console/order-webhooks-card.component'\nimport PaymentsSettingsCard from './console/payments-settings-card.component'\nimport PosShiftHistoryCard from './console/pos-ops/pos-shift-history-card.component'\nimport PosStaffPinsCard from './console/pos-ops/pos-staff-pins-card.component'\nimport PaymentMethodsCard from './console/payment-methods-card.component'\nimport ProductsHubCard from './console/products-hub-card.component'\nimport RecoveryQueueCard from './console/recovery-queue-card.component'\nimport RegistersCard from './console/registers-card.component'\nimport RegisterHardwareCards from './console/register-hardware-card.component'\nimport PosDevicesCard from './console/pos-devices-card.component'\nimport ReservationsCard from './console/reservations-card.component'\nimport ReturnSettingsCard from './console/return-settings-card.component'\nimport ReturnsCard from './console/returns-card.component'\nimport ReviewsModerationCard from './console/reviews-moderation-card.component'\nimport ReviewSettingsCard from './console/review-settings-card.component'\nimport ShippingSettingsCard from './console/shipping-settings-card.component'\nimport ShipStationCard from './console/shipstation-card.component'\nimport ShippingEasyCard from './console/shippingeasy-card.component'\nimport StockMovementsCard from './console/stock-movements-card.component'\nimport StoreSettingsCard from './console/store-settings-card.component'\nimport StorefrontTaxSummaryCard from './console/storefront-tax-summary-card.component'\nimport SuppliersCard from './console/suppliers-card.component'\nimport TaxSettingsCard from './console/tax-settings-card.component'\nimport { COMMERCE_PROMOTIONS_ZONE, COMMERCE_SETTINGS_ZONE } from './console/store-zones'\nimport { useConsoleWidgetSlot } from '@aglyn/aglyn/app-utils/console-widget-slot-context'\n\n/**\n * The `commerceSettings` zone (AGL-3612): other plugins' settings for the\n * store — label settings and carrier accounts — under the store's own.\n */\nfunction CommerceSettingsZone(props: { hostId: string }) {\n const WidgetSlot = useConsoleWidgetSlot()\n return WidgetSlot ? (\n <WidgetSlot slot={COMMERCE_SETTINGS_ZONE.id} hostId={props.hostId} orgId={undefined} />\n ) : null\n}\n\n/**\n * The `commercePromotions` zone (AGL-3640): other plugins' programs beside\n * the store's own money-off surfaces — a rewards program first.\n */\nfunction CommercePromotionsZone(props: { hostId: string }) {\n const WidgetSlot = useConsoleWidgetSlot()\n return WidgetSlot ? (\n <WidgetSlot slot={COMMERCE_PROMOTIONS_ZONE.id} hostId={props.hostId} orgId={undefined} />\n ) : null\n}\n\n/**\n * The body of one commerce section, built only when that section is the one\n * being read (AGL-2501).\n *\n * A function rather than a map of nodes on purpose: a `Record<id, ReactNode>`\n * would CONSTRUCT all six every render, and each card opens its Firestore\n * listens on mount — which is the entire cost this page exists to stop paying.\n * Only the returned branch is ever built.\n */\nfunction sectionBody(\n section: CommerceConsoleSectionId,\n hostId: string,\n): ReactNode {\n switch (section) {\n case 'catalog':\n return (\n <GridItems\n spacing={3}\n items={[\n { size: { xs: 12 }, children: <ProductsHubCard hostId={hostId} /> },\n {\n size: { xs: 12 },\n children: <CatalogOrganizationCard hostId={hostId} />,\n },\n // The ledger every stock writer fills and nothing displayed\n // (AGL-2341). Directly under the catalog, because the question\n // it answers — \"why does this count disagree with the shelf\" —\n // is asked while looking at the count.\n {\n size: { xs: 12 },\n children: <StockMovementsCard hostId={hostId} />,\n },\n { size: { xs: 12 }, children: <MemberPostsCard hostId={hostId} /> },\n ]}\n />\n )\n case 'orders':\n return (\n <GridItems\n spacing={3}\n items={[\n { size: { xs: 12 }, children: <HostOrdersCard hostId={hostId} /> },\n // What to prepare, hand over and drive out (AGL-3624). Renders\n // nothing for a store with no pickup and no local delivery.\n {\n size: { xs: 12 },\n children: <PickupDeliveryQueueCard hostId={hostId} />,\n },\n // The two queues that feed orders rather than record them\n // (AGL-2227): checkouts that stalled and shoppers waiting on\n // stock. Beneath the orders list because both are pre-order.\n {\n size: { xs: 12 },\n children: <RecoveryQueueCard hostId={hostId} />,\n },\n {\n size: { xs: 12 },\n children: <PosShiftHistoryCard hostId={hostId} />,\n },\n ]}\n />\n )\n case 'returns':\n // Returns (AGL-3611); `?return={id}` opens one on arrival.\n return <ReturnsCard hostId={hostId} />\n case 'promotions':\n return (\n <GridItems\n spacing={3}\n items={[\n { size: { xs: 12 }, children: <DiscountsCard hostId={hostId} /> },\n { size: { xs: 12 }, children: <HostCouponsCard hostId={hostId} /> },\n // Store credit lives with the other money-off surfaces\n // (AGL-2226) — it had no console anywhere before this.\n { size: { xs: 12 }, children: <GiftCardsCard hostId={hostId} /> },\n {\n size: { xs: 12 },\n children: <ReviewsModerationCard hostId={hostId} />,\n },\n {\n size: { xs: 12 },\n children: <CommercePromotionsZone hostId={hostId} />,\n },\n ]}\n />\n )\n case 'reservations':\n return <ReservationsCard hostId={hostId} />\n case 'settings':\n return (\n <GridItems\n spacing={3}\n items={[\n {\n size: { xs: 12 },\n children: <PaymentsSettingsCard hostId={hostId} />,\n },\n // What shoppers may pay with (AGL-3629), beside the account the\n // money lands in.\n {\n size: { xs: 12 },\n children: <PaymentMethodsCard hostId={hostId} />,\n },\n {\n size: { xs: 12 },\n children: <StoreSettingsCard hostId={hostId} />,\n },\n {\n size: { xs: 12 },\n children: <ReturnSettingsCard hostId={hostId} />,\n },\n {\n size: { xs: 12 },\n children: <CustomerNotificationsCard hostId={hostId} />,\n },\n // Who may review, and the review-request email (AGL-3736).\n {\n size: { xs: 12 },\n children: <ReviewSettingsCard hostId={hostId} />,\n },\n { size: { xs: 12 }, children: <TaxSettingsCard hostId={hostId} /> },\n { size: { xs: 12 }, children: <LocationsCard hostId={hostId} /> },\n { size: { xs: 12 }, children: <RegistersCard hostId={hostId} /> },\n { size: { xs: 12 }, children: <PosStaffPinsCard hostId={hostId} /> },\n // A register's printers, cash drawer and status (AGL-3619), one\n // card per register, after the list that names them.\n {\n size: { xs: 12 },\n children: <RegisterHardwareCards hostId={hostId} />,\n },\n { size: { xs: 12 }, children: <PosDevicesCard hostId={hostId} /> },\n {\n size: { xs: 12 },\n children: <ShippingSettingsCard hostId={hostId} />,\n },\n // The store's own delivery (AGL-3624); pickup is per location,\n // on the Inventory locations card above.\n {\n size: { xs: 12 },\n children: <LocalDeliverySettingsCard hostId={hostId} />,\n },\n { size: { xs: 12 }, children: <SuppliersCard hostId={hostId} /> },\n { size: { xs: 12 }, children: <ShipStationCard hostId={hostId} /> },\n // ShippingEasy, with the merchant's own keys (AGL-3633).\n { size: { xs: 12 }, children: <ShippingEasyCard hostId={hostId} /> },\n // The store's own endpoints for order events (AGL-3611). Renders\n // nothing for a person who may not manage them.\n {\n size: { xs: 12 },\n children: <OrderWebhooksCard hostId={hostId} />,\n },\n {\n size: { xs: 12 },\n children: <CommerceSettingsZone hostId={hostId} />,\n },\n ]}\n />\n )\n case 'analytics':\n return (\n // Two cards since AGL-2440. The tax summary lives here rather\n // than under Settings → Tax because that tab CONFIGURES tax and\n // this REPORTS what was collected — a merchant reading a figure\n // they may file from should not be one field away from changing\n // the rate that produced it.\n <GridItems\n spacing={3}\n items={[\n {\n size: { xs: 12 },\n children: <CommerceAnalyticsCard hostId={hostId} />,\n },\n {\n size: { xs: 12 },\n children: <StorefrontTaxSummaryCard hostId={hostId} />,\n },\n ]}\n />\n )\n default:\n return null\n }\n}\n\n/**\n * Commerce console page (AGL-395): the Products management surface, owned by\n * the commerce plugin and rendered by the shell's generic plugin route. The\n * product editor's media browser is supplied by the shell's\n * ConsoleMediaPickerProvider (the media library is org/session coupled and\n * stays in the app).\n *\n * ## Sections are ROUTES (AGL-2501)\n *\n * The six sections hold thirty-two Firestore listens between them, and a tab\n * strip mounts every panel: opening Catalog also subscribed the orders,\n * promotions, reservations, settings and analytics cards. The `limit()` on\n * those queries is the bill — several ask for 500, and one load reached a\n * ceiling of ~4,460 documents to render one tab.\n *\n * `HubTabs lazy` bought that back as a flag somebody has to remember. A URL\n * per section makes it structural instead: the page builds one section's body\n * and the others do not exist to subscribe. Three things come with it that the\n * tab version faked — a section is linkable, the back button walks sections,\n * and which one is open is a fact about the URL rather than state kept in sync\n * with it. `commerce-console-read-cost.spec.tsx` meters it at the Firestore\n * boundary and refuses a section that listens before it is opened.\n *\n * The shell resolves the section, gates it and hands back the rail's hrefs;\n * this page only has to say what each section contains.\n */\nexport function CommerceConsolePage(props: ConsolePluginPageProps) {\n const { hostId, section, sections, basePath } = props\n\n /*\n * Nothing, deliberately, while the redirect is in flight.\n *\n * Rendering the default section here instead would issue that section's\n * listens on a URL that is about to be replaced — paying for Catalog on\n * every arrival at `/products`, which is every click of the nav tab.\n */\n if (!section || !sections?.length || !basePath) return null\n\n return (\n <HubSections sections={sections}>\n {sectionBody(section as CommerceConsoleSectionId, hostId)}\n </HubSections>\n )\n}\nCommerceConsolePage.displayName = 'CommerceConsolePage'\n\nexport default CommerceConsolePage\n"],"names":["GridItems","HubSections","CatalogOrganizationCard","CommerceAnalyticsCard","CustomerNotificationsCard","DiscountsCard","GiftCardsCard","HostCouponsCard","HostOrdersCard","LocationsCard","LocalDeliverySettingsCard","PickupDeliveryQueueCard","MemberPostsCard","OrderWebhooksCard","PaymentsSettingsCard","PosShiftHistoryCard","PosStaffPinsCard","PaymentMethodsCard","ProductsHubCard","RecoveryQueueCard","RegistersCard","RegisterHardwareCards","PosDevicesCard","ReservationsCard","ReturnSettingsCard","ReturnsCard","ReviewsModerationCard","ReviewSettingsCard","ShippingSettingsCard","ShipStationCard","ShippingEasyCard","StockMovementsCard","StoreSettingsCard","StorefrontTaxSummaryCard","SuppliersCard","TaxSettingsCard","COMMERCE_PROMOTIONS_ZONE","COMMERCE_SETTINGS_ZONE","useConsoleWidgetSlot","CommerceSettingsZone","props","WidgetSlot","slot","id","hostId","orgId","undefined","CommercePromotionsZone","sectionBody","section","spacing","items","size","xs","children","CommerceConsolePage","sections","basePath","length","displayName"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GACD;;AAGA,SAASA,SAAS,QAAQ,uBAAsB;AAChD,SAASC,WAAW,QAAQ,wBAAuB;AAGnD,OAAOC,6BAA6B,mDAA+C;AACnF,OAAOC,2BAA2B,iDAA6C;AAC/E,OAAOC,+BAA+B,qDAAiD;AACvF,OAAOC,mBAAmB,wCAAoC;AAC9D,OAAOC,mBAAmB,yCAAqC;AAC/D,OAAOC,qBAAqB,2CAAuC;AACnE,OAAOC,oBAAoB,0CAAsC;A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ACfC,wBAAU,KAACf;4BAAqBK,QAAQA;;oBAC1C;iBACD;;QAGP,KAAK;YACH,OACE,8DAA8D;YAC9D,gEAAgE;YAChE,gEAAgE;YAChE,gEAAgE;YAChE,6BAA6B;0BAC7B,KAAC5C;gBACCkD,SAAS;gBACTC,OAAO;oBACL;wBACEC,MAAM;4BAAEC,IAAI;wBAAG;wBACfC,wBAAU,KAACnD;4BAAsByC,QAAQA;;oBAC3C;oBACA;wBACEQ,MAAM;4BAAEC,IAAI;wBAAG;wBACfC,wBAAU,KAACrB;4BAAyBW,QAAQA;;oBAC9C;iBACD;;QAGP;YACE,OAAO;IACX;AACF;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;CAyBC,GACD,OAAO,SAASW,oBAAoBf,KAA6B;IAC/D,MAAM,EAAEI,MAAM,EAAEK,OAAO,EAAEO,QAAQ,EAAEC,QAAQ,EAAE,GAAGjB;IAEhD;;;;;;GAMC,GACD,IAAI,CAACS,WAAW,EAACO,4BAAAA,SAAUE,MAAM,KAAI,CAACD,UAAU,OAAO;IAEvD,qBACE,KAACxD;QAAYuD,UAAUA;kBACpBR,YAAYC,SAAqCL;;AAGxD;AACAW,oBAAoBI,WAAW,GAAG;AAElC,eAAeJ,oBAAmB"}
1
+ {"version":3,"sources":["../../../../../../../libs/plugins/commerce/src/lib/components/commerce-console-page.tsx"],"sourcesContent":["/**\n * @license\n * Copyright 2026 Aglyn LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n'use client'\n\nimport type { ConsolePluginPageProps } from '@aglyn/aglyn'\nimport { GridItems } from '@aglyn/shared-ui-jsx'\nimport { HubSections } from '@aglyn/shared-ui-next'\nimport type { ReactNode } from 'react'\nimport {\n COMMERCE_SETTINGS_PAGE_ZONES,\n type CommerceConsoleSectionId,\n type CommerceSettingsSectionId,\n} from './commerce-console-sections'\nimport CatalogOrganizationCard from './console/catalog-organization-card.component'\nimport CommerceAnalyticsCard from './console/commerce-analytics-card.component'\nimport CustomerNotificationsCard from './console/customer-notifications-card.component'\nimport DiscountsCard from './console/discounts-card.component'\nimport GiftCardsCard from './console/gift-cards-card.component'\nimport HostCouponsCard from './console/host-coupons-card.component'\nimport HostOrdersCard from './console/host-orders-card.component'\nimport LocationsCard from './console/locations-card.component'\nimport LocalDeliverySettingsCard from './console/local-delivery-settings-card.component'\nimport PickupDeliveryQueueCard from './console/pickup-delivery-queue-card.component'\nimport MemberPostsCard from './console/member-posts-card.component'\nimport OrderWebhooksCard from './console/order-webhooks-card.component'\nimport PaymentsSettingsCard from './console/payments-settings-card.component'\nimport PosShiftHistoryCard from './console/pos-ops/pos-shift-history-card.component'\nimport PosStaffPinsCard from './console/pos-ops/pos-staff-pins-card.component'\nimport PaymentMethodsCard from './console/payment-methods-card.component'\nimport ProductsHubCard from './console/products-hub-card.component'\nimport RecoveryQueueCard from './console/recovery-queue-card.component'\nimport RegistersCard from './console/registers-card.component'\nimport RegisterHardwareCards from './console/register-hardware-card.component'\nimport PosDevicesCard from './console/pos-devices-card.component'\nimport ReservationsCard from './console/reservations-card.component'\nimport ReturnSettingsCard from './console/return-settings-card.component'\nimport ReturnsCard from './console/returns-card.component'\nimport ReviewsModerationCard from './console/reviews-moderation-card.component'\nimport ReviewSettingsCard from './console/review-settings-card.component'\nimport ShippingSettingsCard from './console/shipping-settings-card.component'\nimport ShipStationCard from './console/shipstation-card.component'\nimport ShippingEasyCard from './console/shippingeasy-card.component'\nimport StockMovementsCard from './console/stock-movements-card.component'\nimport StoreSettingsCard from './console/store-settings-card.component'\nimport StorefrontTaxSummaryCard from './console/storefront-tax-summary-card.component'\nimport SuppliersCard from './console/suppliers-card.component'\nimport TaxSettingsCard from './console/tax-settings-card.component'\nimport { COMMERCE_PROMOTIONS_ZONE } from './console/store-zones'\nimport { useConsoleWidgetSlot } from '@aglyn/aglyn/app-utils/console-widget-slot-context'\n\n/**\n * A settings page's zone (AGL-3612, AGL-3713): other plugins' settings for\n * the store — label settings, carrier accounts, a tax service — under the\n * page's own cards. One zone per page, from `COMMERCE_SETTINGS_PAGE_ZONES`;\n * Integrations draws `commerceSettings`, where a widget naming no page lands.\n */\nfunction CommerceSettingsZone(props: {\n hostId: string\n page: CommerceSettingsSectionId\n}) {\n const WidgetSlot = useConsoleWidgetSlot()\n return WidgetSlot ? (\n <WidgetSlot\n slot={COMMERCE_SETTINGS_PAGE_ZONES[props.page]}\n hostId={props.hostId}\n orgId={undefined}\n />\n ) : null\n}\n\n/** One settings page: its cards in order, then its zone (AGL-3713). */\nfunction settingsPage(\n page: CommerceSettingsSectionId,\n hostId: string,\n cards: readonly ReactNode[],\n): ReactNode {\n return (\n <GridItems\n spacing={3}\n items={[\n ...cards.map((children) => ({ size: { xs: 12 }, children })),\n {\n size: { xs: 12 },\n children: <CommerceSettingsZone hostId={hostId} page={page} />,\n },\n ]}\n />\n )\n}\n\n/**\n * The `commercePromotions` zone (AGL-3640): other plugins' programs beside\n * the store's own money-off surfaces — a rewards program first.\n */\nfunction CommercePromotionsZone(props: { hostId: string }) {\n const WidgetSlot = useConsoleWidgetSlot()\n return WidgetSlot ? (\n <WidgetSlot slot={COMMERCE_PROMOTIONS_ZONE.id} hostId={props.hostId} orgId={undefined} />\n ) : null\n}\n\n/**\n * The body of one commerce section, built only when that section is the one\n * being read (AGL-2501).\n *\n * A function rather than a map of nodes on purpose: a `Record<id, ReactNode>`\n * would CONSTRUCT every section every render, and each card opens its Firestore\n * listens on mount — which is the entire cost this page exists to stop paying.\n * Only the returned branch is ever built.\n */\nfunction sectionBody(\n section: CommerceConsoleSectionId,\n hostId: string,\n canManagePos: boolean,\n): ReactNode {\n switch (section) {\n case 'catalog':\n return (\n <GridItems\n spacing={3}\n items={[\n { size: { xs: 12 }, children: <ProductsHubCard hostId={hostId} /> },\n {\n size: { xs: 12 },\n children: <CatalogOrganizationCard hostId={hostId} />,\n },\n // The ledger every stock writer fills and nothing displayed\n // (AGL-2341). Directly under the catalog, because the question\n // it answers — \"why does this count disagree with the shelf\" —\n // is asked while looking at the count.\n {\n size: { xs: 12 },\n children: <StockMovementsCard hostId={hostId} />,\n },\n { size: { xs: 12 }, children: <MemberPostsCard hostId={hostId} /> },\n ]}\n />\n )\n case 'orders':\n return (\n <GridItems\n spacing={3}\n items={[\n { size: { xs: 12 }, children: <HostOrdersCard hostId={hostId} /> },\n // What to prepare, hand over and drive out (AGL-3624). Renders\n // nothing for a store with no pickup and no local delivery.\n {\n size: { xs: 12 },\n children: <PickupDeliveryQueueCard hostId={hostId} />,\n },\n // The two queues that feed orders rather than record them\n // (AGL-2227): checkouts that stalled and shoppers waiting on\n // stock. Beneath the orders list because both are pre-order.\n {\n size: { xs: 12 },\n children: <RecoveryQueueCard hostId={hostId} />,\n },\n {\n size: { xs: 12 },\n children: <PosShiftHistoryCard hostId={hostId} />,\n },\n ]}\n />\n )\n case 'returns':\n // Returns (AGL-3611); `?return={id}` opens one on arrival.\n return <ReturnsCard hostId={hostId} />\n case 'promotions':\n return (\n <GridItems\n spacing={3}\n items={[\n { size: { xs: 12 }, children: <DiscountsCard hostId={hostId} /> },\n { size: { xs: 12 }, children: <HostCouponsCard hostId={hostId} /> },\n // Store credit lives with the other money-off surfaces\n // (AGL-2226) — it had no console anywhere before this.\n { size: { xs: 12 }, children: <GiftCardsCard hostId={hostId} /> },\n {\n size: { xs: 12 },\n children: <ReviewsModerationCard hostId={hostId} />,\n },\n // Who may review, and the review-request email (AGL-3736),\n // beside the queue those reviews land in.\n {\n size: { xs: 12 },\n children: <ReviewSettingsCard hostId={hostId} />,\n },\n {\n size: { xs: 12 },\n children: <CommercePromotionsZone hostId={hostId} />,\n },\n ]}\n />\n )\n case 'reservations':\n return <ReservationsCard hostId={hostId} />\n /*\n * The store's settings, a page each (AGL-3713). They were one `settings`\n * section — every card below in one column — and its old address opens\n * Payments (`COMMERCE_RETIRED_SECTIONS`). Each page is its cards, then\n * the zone where other plugins' cards for that page land.\n */\n case 'payments':\n return settingsPage(section, hostId, [\n <PaymentsSettingsCard key=\"payments\" hostId={hostId} />,\n // What shoppers may pay with (AGL-3629), beside the account the\n // money lands in.\n <PaymentMethodsCard key=\"methods\" hostId={hostId} />,\n ])\n case 'checkout':\n return settingsPage(section, hostId, [\n <StoreSettingsCard key=\"store\" hostId={hostId} />,\n // Whether buyers may ask for a return online (AGL-3611): the store's\n // policy, beside the terms and guest-checkout rules above it.\n <ReturnSettingsCard key=\"returns\" hostId={hostId} />,\n ])\n case 'taxes':\n return settingsPage(section, hostId, [\n <TaxSettingsCard key=\"tax\" hostId={hostId} />,\n ])\n case 'shipping':\n return settingsPage(section, hostId, [\n <ShippingSettingsCard key=\"shipping\" hostId={hostId} />,\n // Where parcels ship from, and pickup, per location.\n <LocationsCard key=\"locations\" hostId={hostId} />,\n // The store's own delivery (AGL-3624); pickup is per location, on\n // the Inventory locations card above.\n <LocalDeliverySettingsCard key=\"local\" hostId={hostId} />,\n <SuppliersCard key=\"suppliers\" hostId={hostId} />,\n <ShipStationCard key=\"shipstation\" hostId={hostId} />,\n // ShippingEasy, with the merchant's own keys (AGL-3633).\n <ShippingEasyCard key=\"shippingeasy\" hostId={hostId} />,\n ])\n case 'notifications':\n return settingsPage(section, hostId, [\n <CustomerNotificationsCard key=\"customers\" hostId={hostId} />,\n // The store's own endpoints for order events (AGL-3611). Renders\n // nothing for a person who may not manage them.\n <OrderWebhooksCard key=\"webhooks\" hostId={hostId} />,\n ])\n case 'pos':\n return settingsPage(section, hostId, [\n <RegistersCard key=\"registers\" hostId={hostId} />,\n <PosStaffPinsCard key=\"pins\" hostId={hostId} />,\n // A register's printers, cash drawer and status (AGL-3619), one card\n // per register, after the list that names them.\n <RegisterHardwareCards key=\"hardware\" hostId={hostId} />,\n <PosDevicesCard\n key=\"devices\"\n hostId={hostId}\n canManagePos={canManagePos}\n />,\n ])\n case 'channels':\n case 'integrations':\n // Other plugins' cards only; the rail leaves either page out while\n // its zone has nothing to draw (`onlyWithZones`).\n return settingsPage(section, hostId, [])\n case 'analytics':\n return (\n // Two cards since AGL-2440. The tax summary lives here rather\n // than on the Taxes settings page because that page CONFIGURES tax and\n // this REPORTS what was collected — a merchant reading a figure\n // they may file from should not be one field away from changing\n // the rate that produced it.\n <GridItems\n spacing={3}\n items={[\n {\n size: { xs: 12 },\n children: <CommerceAnalyticsCard hostId={hostId} />,\n },\n {\n size: { xs: 12 },\n children: <StorefrontTaxSummaryCard hostId={hostId} />,\n },\n ]}\n />\n )\n default:\n return null\n }\n}\n\n/**\n * Commerce console page (AGL-395): the Products management surface, owned by\n * the commerce plugin and rendered by the shell's generic plugin route. The\n * product editor's media browser is supplied by the shell's\n * ConsoleMediaPickerProvider (the media library is org/session coupled and\n * stays in the app).\n *\n * ## Sections are ROUTES (AGL-2501)\n *\n * The sections hold thirty-two Firestore listens between them, and a tab\n * strip mounts every panel: opening Catalog also subscribed the orders,\n * promotions, reservations, settings and analytics cards. The `limit()` on\n * those queries is the bill — several ask for 500, and one load reached a\n * ceiling of ~4,460 documents to render one tab.\n *\n * `HubTabs lazy` bought that back as a flag somebody has to remember. A URL\n * per section makes it structural instead: the page builds one section's body\n * and the others do not exist to subscribe. Three things come with it that the\n * tab version faked — a section is linkable, the back button walks sections,\n * and which one is open is a fact about the URL rather than state kept in sync\n * with it. `commerce-console-read-cost.spec.tsx` meters it at the Firestore\n * boundary and refuses a section that listens before it is opened.\n *\n * The shell resolves the section, gates it and hands back the rail's hrefs;\n * this page only has to say what each section contains.\n */\nexport function CommerceConsolePage(props: ConsolePluginPageProps) {\n const { hostId, section, sections, basePath, permissions, hostRole } = props\n /*\n * The register's own gate, for the devices card's Pair display (AGL-3712):\n * `managePos` on a site role that may run it — what the server's\n * `mayWorkRegister` asks. The server stays the enforcement point.\n */\n const canManagePos = permissions?.managePos === true && hostRole?.canPublish === true\n\n /*\n * Nothing, deliberately, while the redirect is in flight.\n *\n * Rendering the default section here instead would issue that section's\n * listens on a URL that is about to be replaced — paying for Catalog on\n * every arrival at `/products`, which is every click of the nav tab.\n */\n if (!section || !sections?.length || !basePath) return null\n\n return (\n <HubSections sections={sections}>\n {sectionBody(section as CommerceConsoleSectionId, hostId, canManagePos)}\n </HubSections>\n )\n}\nCommerceConsolePage.displayName = 'CommerceConsolePage'\n\nexport default CommerceConsolePage\n"],"names":["GridItems","HubSections","COMMERCE_SETTINGS_PAGE_ZONES","CatalogOrganizationCard","CommerceAnalyticsCard","CustomerNotificationsCard","DiscountsCard","GiftCardsCard","HostCouponsCard","HostOrdersCard","LocationsCard","LocalDeliverySettingsCard","PickupDeliveryQueueCard","MemberPostsCard","OrderWebhooksCard","PaymentsSettingsCard","PosShiftHistoryCard","PosStaffPinsCard","PaymentMethodsCard","ProductsHubCard","RecoveryQueueCard","RegistersCard","RegisterHardwareCards","PosDevicesCard","ReservationsCard","ReturnSettingsCard","ReturnsCard","ReviewsModerationCard","ReviewSettingsCard","ShippingSettingsCard","ShipStationCard","ShippingEasyCard","StockMovementsCard","StoreSettingsCard","StorefrontTaxSummaryCard","SuppliersCard","TaxSettingsCard","COMMERCE_PROMOTIONS_ZONE","useConsoleWidgetSlot","CommerceSettingsZone","props","WidgetSlot","slot","page","hostId","orgId","undefined","settingsPage","cards","spacing","items","map","children","size","xs","CommercePromotionsZone","id","sectionBody","section","canManagePos","CommerceConsolePage","sections","basePath","permissions","hostRole","managePos","canPublish","length","displayName"],"mappings":"AAAA;;;;;;;;;;;;;;;CAeC,GACD;;AAGA,SAASA,SAAS,QAAQ,uBAAsB;AAChD,SAASC,WAAW,QAAQ,wBAAuB;AAEnD,SACEC,4BAA4B,QAGvB,iCAA6B;AACpC,OAAOC,6BAA6B,mDAA+C;AACnF,OAAOC,2BAA2B,iDAA6C;AA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;YAC9D,uEAAuE;YACvE,gEAAgE;YAChE,gEAAgE;YAChE,6BAA6B;0BAC7B,KAAC5C;gBACCiD,SAAS;gBACTC,OAAO;oBACL;wBACEG,MAAM;4BAAEC,IAAI;wBAAG;wBACfF,wBAAU,KAAChD;4BAAsBwC,QAAQA;;oBAC3C;oBACA;wBACES,MAAM;4BAAEC,IAAI;wBAAG;wBACfF,wBAAU,KAAClB;4BAAyBU,QAAQA;;oBAC9C;iBACD;;QAGP;YACE,OAAO;IACX;AACF;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;CAyBC,GACD,OAAO,SAASgB,oBAAoBpB,KAA6B;IAC/D,MAAM,EAAEI,MAAM,EAAEc,OAAO,EAAEG,QAAQ,EAAEC,QAAQ,EAAEC,WAAW,EAAEC,QAAQ,EAAE,GAAGxB;IACvE;;;;GAIC,GACD,MAAMmB,eAAeI,CAAAA,+BAAAA,YAAaE,SAAS,MAAK,QAAQD,CAAAA,4BAAAA,SAAUE,UAAU,MAAK;IAEjF;;;;;;GAMC,GACD,IAAI,CAACR,WAAW,EAACG,4BAAAA,SAAUM,MAAM,KAAI,CAACL,UAAU,OAAO;IAEvD,qBACE,KAAC7D;QAAY4D,UAAUA;kBACpBJ,YAAYC,SAAqCd,QAAQe;;AAGhE;AACAC,oBAAoBQ,WAAW,GAAG;AAElC,eAAeR,oBAAmB"}
@@ -15,7 +15,25 @@
15
15
  * limitations under the License.
16
16
  */
17
17
  import type { ConsoleNavSection } from '@aglyn/aglyn';
18
- export type CommerceConsoleSectionId = 'catalog' | 'orders' | 'returns' | 'promotions' | 'reservations' | 'settings' | 'analytics';
18
+ export type CommerceConsoleSectionId = 'catalog' | 'orders' | 'returns' | 'promotions' | 'reservations' | 'analytics' | CommerceSettingsSectionId;
19
+ /**
20
+ * The store's settings, one page each (AGL-3713). They were one section,
21
+ * `settings`, and one long column: payments, taxes, shipping, the register
22
+ * and every other plugin's cards, one after another.
23
+ */
24
+ export type CommerceSettingsSectionId = 'payments' | 'checkout' | 'taxes' | 'shipping' | 'notifications' | 'pos' | 'channels' | 'integrations';
25
+ /** The words above the settings pages in the rail (AGL-3713). */
26
+ export declare const COMMERCE_SETTINGS_GROUP = "Settings";
27
+ /**
28
+ * The zone each settings page draws at its foot, keyed by page (AGL-3713).
29
+ *
30
+ * One zone per page, so a plugin chooses its page by the zone it names and
31
+ * nothing else: a contributor restates the id, never imports this package.
32
+ * `commerceSettings` — the zone every store-settings widget named before the
33
+ * split — is the Integrations page's, so a widget that names no page lands
34
+ * there rather than nowhere.
35
+ */
36
+ export declare const COMMERCE_SETTINGS_PAGE_ZONES: Readonly<Record<CommerceSettingsSectionId, string>>;
19
37
  /**
20
38
  * The commerce console's sections, in rail order (AGL-2501).
21
39
  *
@@ -25,10 +43,20 @@ export type CommerceConsoleSectionId = 'catalog' | 'orders' | 'returns' | 'promo
25
43
  * to be routable under one id and drawn under another.
26
44
  *
27
45
  * Ids appear in links people keep — treat them as persisted, and rename a
28
- * LABEL rather than an id.
46
+ * LABEL rather than an id. An id that has to go is mapped in
47
+ * {@link COMMERCE_RETIRED_SECTIONS} to the section that replaced it.
29
48
  *
30
49
  * No `navTabId` on any of them: every section here ships with the surface, so
31
50
  * they inherit the Products nav item's gate. A section that ships later
32
51
  * declares its own, which ANDs with the parent's rather than replacing it.
52
+ *
53
+ * The store's own work first, then its settings under a divider and a
54
+ * "Settings" subheader (AGL-3713).
33
55
  */
34
56
  export declare const COMMERCE_CONSOLE_SECTIONS: readonly ConsoleNavSection[];
57
+ /**
58
+ * Section ids the console no longer has, and where each one's links go
59
+ * (AGL-3713). `/products/settings` was every setting on one page; it opens
60
+ * Payments, the first of the pages it was split into.
61
+ */
62
+ export declare const COMMERCE_RETIRED_SECTIONS: Readonly<Record<string, string>>;