@tokenoftrust/storefront-runner 2.0.2 → 2.0.4

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 (254) hide show
  1. package/apps/storefront/.astro/content.d.ts +159 -0
  2. package/apps/storefront/.astro/integrations/_astrojs_cloudflare/cloudflare.d.ts +1 -0
  3. package/apps/storefront/.astro/types.d.ts +3 -0
  4. package/apps/storefront/node_modules/.bin/acorn +43 -0
  5. package/apps/storefront/node_modules/.bin/astro +43 -0
  6. package/apps/storefront/node_modules/.bin/astro-check +43 -0
  7. package/apps/storefront/node_modules/.bin/browserslist +43 -0
  8. package/apps/storefront/node_modules/.bin/cf-wrangler +43 -0
  9. package/apps/storefront/node_modules/.bin/depcruise +43 -0
  10. package/apps/storefront/node_modules/.bin/depcruise-baseline +43 -0
  11. package/apps/storefront/node_modules/.bin/depcruise-fmt +43 -0
  12. package/apps/storefront/node_modules/.bin/depcruise-wrap-stream-in-html +43 -0
  13. package/apps/storefront/node_modules/.bin/dependency-cruise +43 -0
  14. package/apps/storefront/node_modules/.bin/dependency-cruiser +43 -0
  15. package/apps/storefront/node_modules/.bin/drizzle-kit +43 -0
  16. package/apps/storefront/node_modules/.bin/esbuild +43 -0
  17. package/apps/storefront/node_modules/.bin/jiti +43 -0
  18. package/apps/storefront/node_modules/.bin/playwright +43 -0
  19. package/apps/storefront/node_modules/.bin/playwright-core +43 -0
  20. package/apps/storefront/node_modules/.bin/prettier +43 -0
  21. package/apps/storefront/node_modules/.bin/rollup +43 -0
  22. package/apps/storefront/node_modules/.bin/tsc +43 -0
  23. package/apps/storefront/node_modules/.bin/tsserver +43 -0
  24. package/apps/storefront/node_modules/.bin/tsx +43 -0
  25. package/apps/storefront/node_modules/.bin/vite +43 -0
  26. package/apps/storefront/node_modules/.bin/vitest +43 -0
  27. package/apps/storefront/node_modules/.bin/workerd +43 -0
  28. package/apps/storefront/node_modules/.bin/wrangler +43 -0
  29. package/apps/storefront/node_modules/.bin/wrangler2 +43 -0
  30. package/apps/storefront/node_modules/.bin/yaml +43 -0
  31. package/apps/storefront/node_modules/.vite/deps/@astrojs_preact_client__js.js +58 -0
  32. package/apps/storefront/node_modules/.vite/deps/@astrojs_preact_client__js.js.map +1 -0
  33. package/apps/storefront/node_modules/.vite/deps/@astrojs_preact_n_@preact_signals.js +741 -0
  34. package/apps/storefront/node_modules/.vite/deps/@astrojs_preact_n_@preact_signals.js.map +1 -0
  35. package/apps/storefront/node_modules/.vite/deps/@astrojs_preact_server__js.js +2549 -0
  36. package/apps/storefront/node_modules/.vite/deps/@astrojs_preact_server__js.js.map +1 -0
  37. package/apps/storefront/node_modules/.vite/deps/_metadata.json +150 -0
  38. package/apps/storefront/node_modules/.vite/deps/astro-BIHuWFxm.js +434 -0
  39. package/apps/storefront/node_modules/.vite/deps/astro-BIHuWFxm.js.map +1 -0
  40. package/apps/storefront/node_modules/.vite/deps/astro_n_aria-query.js +6390 -0
  41. package/apps/storefront/node_modules/.vite/deps/astro_n_aria-query.js.map +1 -0
  42. package/apps/storefront/node_modules/.vite/deps/astro_n_axobject-query.js +2705 -0
  43. package/apps/storefront/node_modules/.vite/deps/astro_n_axobject-query.js.map +1 -0
  44. package/apps/storefront/node_modules/.vite/deps/astro_n_html-escaper.js +65 -0
  45. package/apps/storefront/node_modules/.vite/deps/astro_n_html-escaper.js.map +1 -0
  46. package/apps/storefront/node_modules/.vite/deps/astro_runtime_client_dev-toolbar_entrypoint__js.js +455 -0
  47. package/apps/storefront/node_modules/.vite/deps/astro_runtime_client_dev-toolbar_entrypoint__js.js.map +1 -0
  48. package/apps/storefront/node_modules/.vite/deps/audit-DKDpcdEI.js +1535 -0
  49. package/apps/storefront/node_modules/.vite/deps/audit-DKDpcdEI.js.map +1 -0
  50. package/apps/storefront/node_modules/.vite/deps/highlight-B9UoX1wa.js +48 -0
  51. package/apps/storefront/node_modules/.vite/deps/highlight-B9UoX1wa.js.map +1 -0
  52. package/apps/storefront/node_modules/.vite/deps/icons-BWi2wI9n.js +42 -0
  53. package/apps/storefront/node_modules/.vite/deps/icons-BWi2wI9n.js.map +1 -0
  54. package/apps/storefront/node_modules/.vite/deps/package.json +3 -0
  55. package/apps/storefront/node_modules/.vite/deps/preact.js +310 -0
  56. package/apps/storefront/node_modules/.vite/deps/preact.js.map +1 -0
  57. package/apps/storefront/node_modules/.vite/deps/preact_compat.js +420 -0
  58. package/apps/storefront/node_modules/.vite/deps/preact_compat.js.map +1 -0
  59. package/apps/storefront/node_modules/.vite/deps/preact_compat_jsx-runtime.js +4 -0
  60. package/apps/storefront/node_modules/.vite/deps/preact_debug.js +236 -0
  61. package/apps/storefront/node_modules/.vite/deps/preact_debug.js.map +1 -0
  62. package/apps/storefront/node_modules/.vite/deps/preact_devtools.js +12 -0
  63. package/apps/storefront/node_modules/.vite/deps/preact_devtools.js.map +1 -0
  64. package/apps/storefront/node_modules/.vite/deps/preact_hooks.js +192 -0
  65. package/apps/storefront/node_modules/.vite/deps/preact_hooks.js.map +1 -0
  66. package/apps/storefront/node_modules/.vite/deps/preact_jsx-dev-runtime.js +3 -0
  67. package/apps/storefront/node_modules/.vite/deps/preact_jsx-runtime.js +92 -0
  68. package/apps/storefront/node_modules/.vite/deps/preact_jsx-runtime.js.map +1 -0
  69. package/apps/storefront/node_modules/.vite/deps/preact_test-utils.js +59 -0
  70. package/apps/storefront/node_modules/.vite/deps/preact_test-utils.js.map +1 -0
  71. package/apps/storefront/node_modules/.vite/deps/rolldown-runtime-BPOCksWG.js +24 -0
  72. package/apps/storefront/node_modules/.vite/deps/settings-BVDV0Roj.js +189 -0
  73. package/apps/storefront/node_modules/.vite/deps/settings-BVDV0Roj.js.map +1 -0
  74. package/apps/storefront/node_modules/.vite/deps/static-html-DveYqwMo.js +13 -0
  75. package/apps/storefront/node_modules/.vite/deps/static-html-DveYqwMo.js.map +1 -0
  76. package/apps/storefront/node_modules/.vite/deps/toolbar-B3VIHCXg.js +458 -0
  77. package/apps/storefront/node_modules/.vite/deps/toolbar-B3VIHCXg.js.map +1 -0
  78. package/apps/storefront/node_modules/.vite/deps/ui-library-BK6ricUd.js +1016 -0
  79. package/apps/storefront/node_modules/.vite/deps/ui-library-BK6ricUd.js.map +1 -0
  80. package/apps/storefront/node_modules/.vite/deps/window-BvxDenKN.js +32 -0
  81. package/apps/storefront/node_modules/.vite/deps/window-BvxDenKN.js.map +1 -0
  82. package/apps/storefront/node_modules/.vite/deps/xray-YFiRUU0Z.js +113 -0
  83. package/apps/storefront/node_modules/.vite/deps/xray-YFiRUU0Z.js.map +1 -0
  84. package/apps/storefront/node_modules/.vite/deps_ssr/_metadata.json +8 -0
  85. package/apps/storefront/node_modules/.vite/deps_ssr/package.json +3 -0
  86. package/apps/storefront/src/layouts/Layout.astro +1 -1
  87. package/apps/storefront/src/lib/apps/registryAccess.ts +45 -0
  88. package/apps/storefront/src/lib/auth/adminEntry.ts +4 -4
  89. package/apps/storefront/src/lib/shared/capability.ts +68 -0
  90. package/apps/storefront/src/lib/shared/developerInvites.ts +1250 -0
  91. package/apps/storefront/src/lib/shared/invitePreflight.ts +123 -0
  92. package/apps/storefront/src/lib/webhooks/deliveryEngine.ts +38 -4
  93. package/apps/storefront/src/lib/webhooks/emit.ts +1 -1
  94. package/apps/storefront/src/lib/webhooks/getDispatcher.ts +1 -1
  95. package/apps/storefront/src/pages/api/auth/magic-exchange.ts +1 -1
  96. package/apps/storefront/src/pages/index.astro +1 -1
  97. package/apps/storefront/src/pages/products/[handle].astro +1 -1
  98. package/package.json +1 -1
  99. package/packages/public-runtime/node_modules/.bin/tsc +43 -0
  100. package/packages/public-runtime/node_modules/.bin/tsserver +43 -0
  101. package/packages/public-runtime/node_modules/.bin/vitest +43 -0
  102. package/pnpm-workspace.yaml +3 -0
  103. package/scripts/lib/tenant-dirs.mjs +80 -0
  104. package/scripts/tenant/lint-embeds.mjs +180 -0
  105. package/scripts/tenant/materialize-tenant-content.mjs +533 -0
  106. package/scripts/tenant/validate.mjs +837 -0
  107. package/apps/storefront/scripts/build-v84-clean-clone-standalone.mjs +0 -68
  108. package/apps/storefront/scripts/deny-v84-clean-clone-standalone-capabilities.mjs +0 -111
  109. package/apps/storefront/scripts/deny-v84-dogfood-capabilities.mjs +0 -2
  110. package/apps/storefront/scripts/deny-v84-lifecycle-capabilities.mjs +0 -247
  111. package/apps/storefront/scripts/dogfood-v84-nonportable-routes.ts +0 -73
  112. package/apps/storefront/scripts/fixed-v84-native-install-producer.ts +0 -79
  113. package/apps/storefront/scripts/generated/v84-clean-clone-replay.bundle.mjs +0 -10982
  114. package/apps/storefront/scripts/import-v84-through-ws2.ts +0 -38
  115. package/apps/storefront/scripts/initialize-v84-lifecycle-tooling-dependency.ts +0 -2
  116. package/apps/storefront/scripts/initialize-v84-lifecycle-tooling.ts +0 -4
  117. package/apps/storefront/scripts/install-v84-native-through-ws1.ts +0 -185
  118. package/apps/storefront/scripts/prove-clone-isolation.ts +0 -506
  119. package/apps/storefront/scripts/replay-v84-clean-clone-pass.ts +0 -148
  120. package/apps/storefront/scripts/replay-v84-clean-clone-standalone.ts +0 -35
  121. package/apps/storefront/scripts/replay-v84-clean-clone.ts +0 -214
  122. package/apps/storefront/scripts/run-fixed-v84-native-install-producer.mjs +0 -18
  123. package/apps/storefront/scripts/run-v84-clone-isolation-proof.mjs +0 -18
  124. package/apps/storefront/scripts/run-v84-clone-lifecycle-proof.mjs +0 -18
  125. package/apps/storefront/scripts/run-v84-import-through-ws2-proof.mjs +0 -17
  126. package/apps/storefront/scripts/run-v84-nonportable-route-dogfood.mjs +0 -15
  127. package/apps/storefront/scripts/sanitize-v84-proof-environment.mjs +0 -21
  128. package/apps/storefront/scripts/v84CleanCloneGraphPin.ts +0 -42
  129. package/apps/storefront/scripts/v84CleanCloneSourceGraph.ts +0 -145
  130. package/apps/storefront/scripts/validate-v84-clone-lifecycle.ts +0 -18
  131. package/apps/storefront/src/components/admin/AdminAIWorkflowsTab.astro +0 -531
  132. package/apps/storefront/src/components/admin/AdminBlogDetailRail.astro +0 -878
  133. package/apps/storefront/src/components/admin/AdminBlogTab.astro +0 -1435
  134. package/apps/storefront/src/components/admin/AdminCheckoutSettingsPanel.astro +0 -226
  135. package/apps/storefront/src/components/admin/AdminCustomersTab.astro +0 -593
  136. package/apps/storefront/src/components/admin/AdminFulfillmentTab.astro +0 -465
  137. package/apps/storefront/src/components/admin/AdminIntegrationsTab.astro +0 -105
  138. package/apps/storefront/src/components/admin/AdminProductsTab.astro +0 -901
  139. package/apps/storefront/src/components/admin/AdminPublishTab.astro +0 -2983
  140. package/apps/storefront/src/components/admin/AdminReportingTab.astro +0 -435
  141. package/apps/storefront/src/components/admin/AdminSettingsTab.astro +0 -782
  142. package/apps/storefront/src/components/admin/AdminSubscriptionsTab.astro +0 -611
  143. package/apps/storefront/src/components/admin/orders/OrdersWorkspace.astro +0 -1223
  144. package/apps/storefront/src/lib/apps/adminService.ts +0 -116
  145. package/apps/storefront/src/lib/apps/adminSession.ts +0 -214
  146. package/apps/storefront/src/lib/apps/apiAuth.ts +0 -91
  147. package/apps/storefront/src/lib/apps/apiRoute.ts +0 -35
  148. package/apps/storefront/src/lib/apps/catalogMapper.ts +0 -39
  149. package/apps/storefront/src/lib/apps/consentConfigStore.ts +0 -228
  150. package/apps/storefront/src/lib/apps/gtmMigrationInstall.ts +0 -447
  151. package/apps/storefront/src/lib/apps/gtmMigrationReport.ts +0 -367
  152. package/apps/storefront/src/lib/apps/gtmMigrationTab.ts +0 -315
  153. package/apps/storefront/src/lib/apps/healthAggregate.ts +0 -66
  154. package/apps/storefront/src/lib/apps/integrationLifecycle.ts +0 -614
  155. package/apps/storefront/src/lib/apps/integrationLifecycleController.ts +0 -125
  156. package/apps/storefront/src/lib/apps/integrationReadModel.ts +0 -563
  157. package/apps/storefront/src/lib/apps/integrationsTab.ts +0 -547
  158. package/apps/storefront/src/lib/apps/integrationsView.ts +0 -106
  159. package/apps/storefront/src/lib/apps/managedAnalyticsService.ts +0 -599
  160. package/apps/storefront/src/lib/apps/tenantIntegrationMaterialization.ts +0 -170
  161. package/apps/storefront/src/lib/apps/tokenIssuer.ts +0 -121
  162. package/apps/storefront/src/lib/apps/tokenVerifier.ts +0 -148
  163. package/apps/storefront/src/lib/apps/v84CleanCloneReplayContext.ts +0 -16
  164. package/apps/storefront/src/lib/apps/v84CloneLifecycleCacheEvidence.ts +0 -105
  165. package/apps/storefront/src/lib/apps/v84CloneLifecycleEvidence.ts +0 -177
  166. package/apps/storefront/src/lib/apps/v84CloneLifecycleMaterialization.ts +0 -251
  167. package/apps/storefront/src/lib/apps/v84CloneLifecycleSemantics.ts +0 -241
  168. package/apps/storefront/src/lib/apps/v84CloneMigrationEvidence.ts +0 -211
  169. package/apps/storefront/src/lib/apps/v84CloneNativeInstallEvidence.ts +0 -409
  170. package/apps/storefront/src/lib/apps/v84NonportableCodeCoaching.ts +0 -368
  171. package/apps/storefront/src/lib/apps/v84NonportableRouteContract.ts +0 -188
  172. package/apps/storefront/src/lib/apps/v84NonportableRouteDogfood.ts +0 -291
  173. package/apps/storefront/src/lib/apps/ws1ManagedAnalyticsClient.ts +0 -95
  174. package/apps/storefront/src/lib/content-edit/applyDiff.ts +0 -91
  175. package/apps/storefront/src/lib/content-edit/client.ts +0 -286
  176. package/apps/storefront/src/lib/content-edit/index.ts +0 -14
  177. package/apps/storefront/src/lib/content-edit/route.ts +0 -25
  178. package/apps/storefront/src/lib/content-edit/types.ts +0 -19
  179. package/apps/storefront/src/lib/dev/cockpitStore.ts +0 -57
  180. package/apps/storefront/src/lib/publish/adminPublishTab.ts +0 -4625
  181. package/apps/storefront/src/lib/publish/apex-readiness.ts +0 -360
  182. package/apps/storefront/src/lib/publish/buildStream.ts +0 -269
  183. package/apps/storefront/src/lib/publish/collapsePersistence.ts +0 -72
  184. package/apps/storefront/src/lib/publish/dispatchHealth.ts +0 -267
  185. package/apps/storefront/src/lib/publish/domainState.ts +0 -360
  186. package/apps/storefront/src/lib/publish/lifecycleState.ts +0 -369
  187. package/apps/storefront/src/lib/publish/liveReleaseSummary.ts +0 -29
  188. package/apps/storefront/src/lib/publish/mergeDoctorOnFailure.ts +0 -78
  189. package/apps/storefront/src/lib/publish/mergeHealthBanner.ts +0 -62
  190. package/apps/storefront/src/lib/publish/mergeRowFindings.ts +0 -124
  191. package/apps/storefront/src/lib/publish/mergeSupportEscalation.ts +0 -75
  192. package/apps/storefront/src/lib/publish/panelPolling.ts +0 -78
  193. package/apps/storefront/src/lib/publish/publish-guard.ts +0 -88
  194. package/apps/storefront/src/lib/publish/publishFormat.ts +0 -165
  195. package/apps/storefront/src/lib/publish/publishHero.ts +0 -177
  196. package/apps/storefront/src/lib/publish/reviewRelease/changeState.ts +0 -66
  197. package/apps/storefront/src/lib/publish/reviewRelease/copy.ts +0 -141
  198. package/apps/storefront/src/lib/publish/reviewRelease/index.ts +0 -41
  199. package/apps/storefront/src/lib/publish/reviewRelease/permissions.ts +0 -47
  200. package/apps/storefront/src/lib/publish/reviewRelease/releaseState.ts +0 -42
  201. package/apps/storefront/src/lib/publish/reviewRelease/types.ts +0 -59
  202. package/apps/storefront/src/lib/publish/reviewRelease/viewModel.ts +0 -440
  203. package/apps/storefront/src/lib/publish/reviewReleaseWorkspace/actions.ts +0 -161
  204. package/apps/storefront/src/lib/publish/reviewReleaseWorkspace/controller.ts +0 -325
  205. package/apps/storefront/src/lib/publish/reviewReleaseWorkspace/render.ts +0 -241
  206. package/apps/storefront/src/lib/publish/shipWorkspace.ts +0 -439
  207. package/apps/storefront/src/lib/publish/sseRoute.ts +0 -119
  208. package/apps/storefront/src/lib/publish/stageBundleUpload.ts +0 -215
  209. package/apps/storefront/src/lib/publish/streamLogConsole.ts +0 -142
  210. package/apps/storefront/src/lib/publish/versionNumber.ts +0 -52
  211. package/apps/storefront/src/pages/admin/ops-timeline.astro +0 -420
  212. package/apps/storefront/src/pages/admin/review-release.astro +0 -265
  213. package/apps/storefront/src/pages/admin/select.astro +0 -96
  214. package/apps/storefront/src/pages/admin.astro +0 -570
  215. package/apps/storefront/src/pages/api/apps/admin/credentials/rotate.ts +0 -86
  216. package/apps/storefront/src/pages/api/apps/admin/gtm-migration-install.ts +0 -174
  217. package/apps/storefront/src/pages/api/apps/admin/gtm-migration.ts +0 -96
  218. package/apps/storefront/src/pages/api/apps/admin/health.ts +0 -44
  219. package/apps/storefront/src/pages/api/apps/admin/install.ts +0 -125
  220. package/apps/storefront/src/pages/api/apps/admin/integration-lifecycle.ts +0 -118
  221. package/apps/storefront/src/pages/api/apps/admin/integrations.ts +0 -89
  222. package/apps/storefront/src/pages/api/apps/admin/list.ts +0 -26
  223. package/apps/storefront/src/pages/api/apps/admin/platform-adapters.ts +0 -85
  224. package/apps/storefront/src/pages/api/apps/admin/resume.ts +0 -79
  225. package/apps/storefront/src/pages/api/apps/admin/suspend.ts +0 -80
  226. package/apps/storefront/src/pages/api/apps/admin/uninstall.ts +0 -98
  227. package/apps/storefront/src/pages/api/apps/admin/update.ts +0 -126
  228. package/apps/storefront/src/pages/api/apps/admin/webhooks/deliveries/[deliveryId]/replay.ts +0 -70
  229. package/apps/storefront/src/pages/api/apps/admin/webhooks/deliveries.ts +0 -51
  230. package/apps/storefront/src/pages/api/apps/internal/order-forward.ts +0 -255
  231. package/apps/storefront/src/pages/api/apps/oauth/token.ts +0 -87
  232. package/apps/storefront/src/pages/api/apps/v1/attribution.ts +0 -162
  233. package/apps/storefront/src/pages/api/apps/v1/catalog/products/[handle].ts +0 -39
  234. package/apps/storefront/src/pages/api/apps/v1/catalog/products.ts +0 -49
  235. package/apps/storefront/src/pages/api/apps/v1/health.ts +0 -32
  236. package/apps/storefront/src/pages/api/apps/v1/inventory.ts +0 -59
  237. package/apps/storefront/src/pages/api/apps/v1/orders/[id].ts +0 -48
  238. package/apps/storefront/src/pages/api/apps/v1/orders.ts +0 -73
  239. package/apps/storefront/src/pages/api/apps/v1/reports.ts +0 -21
  240. package/apps/storefront/src/pages/api/apps/v1/webhooks/deliveries/[deliveryId]/replay.ts +0 -74
  241. package/apps/storefront/src/pages/api/apps/v1/webhooks/deliveries.ts +0 -47
  242. package/apps/storefront/src/pages/api/cache-purge.ts +0 -55
  243. package/apps/storefront/src/pages/api/compliance/tamper.ts +0 -88
  244. package/apps/storefront/src/pages/api/content-edit/ai-edit.ts +0 -164
  245. package/apps/storefront/src/pages/api/dashboard/enter-vendor.ts +0 -154
  246. package/apps/storefront/src/pages/api/dashboard/vendor-search.ts +0 -120
  247. package/apps/storefront/src/pages/api/integrations/v1/[operation].ts +0 -108
  248. package/apps/storefront/src/pages/api/publish/stage-bundle.ts +0 -70
  249. package/apps/storefront/src/pages/api/test/dev-session.ts +0 -133
  250. package/apps/storefront/src/pages/cockpit.astro +0 -1548
  251. package/apps/storefront/src/pages/dashboard/[appDomain]/apps/index.astro +0 -119
  252. package/apps/storefront/src/pages/dashboard/[appDomain]/index.astro +0 -105
  253. package/apps/storefront/src/pages/dashboard/[appDomain]/team.astro +0 -177
  254. package/apps/storefront/src/pages/dashboard/index.astro +0 -160
@@ -1,435 +0,0 @@
1
- ---
2
- import { getReportingViewModel } from "@/lib/admin/services/mock";
3
-
4
- const { envelope } = Astro.props;
5
- const reporting = getReportingViewModel(envelope);
6
-
7
- const { tenant, capabilities } = Astro.locals;
8
-
9
- const compliance = tenant.compliance;
10
- const regulatedEnabled = Boolean(compliance);
11
- const ageVerificationEnabled = Boolean(capabilities.ageVerification.enabled && compliance?.minAge);
12
- const exciseTaxEnabled = Boolean(capabilities.exciseTax.enabled);
13
- const pactReportingEnabled = Boolean(compliance?.shippingRestriction?.match(/\bPACT\b/i));
14
- const regulatedReportCount =
15
- Number(ageVerificationEnabled) + Number(exciseTaxEnabled) + Number(pactReportingEnabled);
16
-
17
- const CATEGORY_TONE: Record<string, string> = {
18
- sales: "green",
19
- products: "blue",
20
- customers: "violet",
21
- fulfillment: "amber",
22
- compliance: "teal",
23
- tax: "blue",
24
- risk: "amber",
25
- };
26
-
27
- const TREND_LABEL: Record<string, string> = { up: "▲", down: "▼", flat: "—" };
28
- const TREND_TONE: Record<string, string> = { up: "green", down: "red", flat: "" };
29
-
30
- const monthlyRows = [
31
- {
32
- enabled: exciseTaxEnabled,
33
- report: "Excise tax close",
34
- period: "June 2026",
35
- cadence: "Monthly visibility",
36
- owner: "Finance",
37
- readiness: "$3,214.90 collected",
38
- status: "Ready",
39
- tone: "green",
40
- action: "Export",
41
- },
42
- {
43
- enabled: pactReportingEnabled,
44
- report: "PACT shipment packets",
45
- period: "June 2026",
46
- cadence: "Due by state schedule",
47
- owner: "Compliance",
48
- readiness: "14 states, 2 local copies",
49
- status: "Review",
50
- tone: "amber",
51
- action: "Prepare",
52
- },
53
- {
54
- enabled: pactReportingEnabled || exciseTaxEnabled,
55
- report: "Reorder and supplemental forms",
56
- period: "July 2026",
57
- cadence: "Monthly checklist",
58
- owner: "Operations",
59
- readiness: "Registrations, amendments, and no-ship attestations",
60
- status: "Draft",
61
- tone: "teal",
62
- action: "Open",
63
- },
64
- {
65
- enabled: exciseTaxEnabled,
66
- report: "Federal excise support",
67
- period: "Q2 2026",
68
- cadence: "Quarterly filing support",
69
- owner: "Finance",
70
- readiness: "Liability, deposits, EIN, and records packet",
71
- status: "Ready",
72
- tone: "blue",
73
- action: "Open",
74
- },
75
- ].filter((row) => row.enabled);
76
-
77
- const requiredFieldGroups = [
78
- {
79
- enabled: exciseTaxEnabled,
80
- title: "Excise Tax",
81
- source: "Products, orders, tax engine",
82
- fields:
83
- "jurisdiction, filing period, tax class, SKU, brand, product type, nicotine flag, pack quantity, volume or weight, wholesale cost, retail price, taxable basis, tax collected, exemption status",
84
- status: "Excise on",
85
- tone: "blue",
86
- },
87
- {
88
- enabled: pactReportingEnabled,
89
- title: "PACT Act Shipment Reports",
90
- source: "Orders, shipments, customer address, carrier record",
91
- fields:
92
- "seller registration, customer name and address, destination state, city, ZIP, invoice or memo ID, brand, quantity, delivery-party name, delivery-party address, delivery-party phone, local or tribal copies",
93
- status: "PACT active",
94
- tone: "amber",
95
- },
96
- {
97
- enabled: ageVerificationEnabled,
98
- title: "Tobacco 21 Verification",
99
- source: "Customer verification evidence",
100
- fields:
101
- "minimum age, date of birth result, photo ID check, verification status, method, evidence ID, freshness, timestamp, review owner, pass or fail reason",
102
- status: "Age checks on",
103
- tone: "teal",
104
- },
105
- {
106
- enabled: regulatedEnabled,
107
- title: "Restricted Product Sales",
108
- source: "Catalog attributes, jurisdiction rules, orders",
109
- fields:
110
- "category, restricted states, allowed destinations, adult signature requirement, product claims evidence, refund and void adjustments, shipment hold reason",
111
- status: "Regulated",
112
- tone: "violet",
113
- },
114
- ].filter((group) => group.enabled);
115
- ---
116
-
117
- <!-- agent-hook:reporting-tab -->
118
- <section id="reporting" class="band reporting-tab" aria-labelledby="admin-tab-reporting reporting-title" data-admin-panel data-agent-scope="reporting" role="tabpanel">
119
- <div class="section-title">
120
- <div>
121
- <h2 id="reporting-title">Reporting</h2>
122
- <p>Sales, product, customer, fulfillment, refund, and exception reporting with regulated reports added when the tenant needs them.</p>
123
- </div>
124
- <div class="actions">
125
- <button class="btn" type="button"><svg><use href="#i-refresh"></use></svg>Refresh</button>
126
- <button class="btn" type="button"><svg><use href="#i-export"></use></svg>Export</button>
127
- </div>
128
- </div>
129
-
130
- <div class="report-card-grid">
131
- {reporting.summaries.map((summary) => (
132
- <a class="report-card" href={summary.drilldownHref}>
133
- <div class="report-card-head">
134
- <span class:list={["chip", CATEGORY_TONE[summary.category] ?? ""]}>{summary.label}</span>
135
- <span class:list={["trend", TREND_TONE[summary.trend]]}>{TREND_LABEL[summary.trend]}</span>
136
- </div>
137
- <strong>{summary.value}</strong>
138
- <p>{summary.headline}</p>
139
- </a>
140
- ))}
141
- </div>
142
-
143
- <div class="panel analysis-panel">
144
- <div class="panel-head">
145
- <h3><svg><use href="#i-ask"></use></svg>Analysis Brief</h3>
146
- <span class="chip blue">Evidence-linked</span>
147
- </div>
148
- <div class="panel-body grid">
149
- <div class="analysis-group">
150
- <h4>Drivers</h4>
151
- {reporting.analysisBrief.drivers.length === 0 ? (
152
- <p class="note">No notable drivers this period.</p>
153
- ) : (
154
- reporting.analysisBrief.drivers.map((item) => (
155
- <a class="analysis-item" href={item.drilldownHref}>
156
- <div>
157
- <b>{item.title}</b>
158
- <p>{item.detail}</p>
159
- </div>
160
- <span class="chip teal">{item.evidenceRef}</span>
161
- </a>
162
- ))
163
- )}
164
- </div>
165
- <div class="analysis-group">
166
- <h4>Watch items</h4>
167
- {reporting.analysisBrief.watchItems.length === 0 ? (
168
- <p class="note">Nothing flagged for follow-up.</p>
169
- ) : (
170
- reporting.analysisBrief.watchItems.map((item) => (
171
- <a class="analysis-item" href={item.drilldownHref}>
172
- <div>
173
- <b>{item.title}</b>
174
- <p>{item.detail}</p>
175
- </div>
176
- <span class="chip amber">{item.evidenceRef}</span>
177
- </a>
178
- ))
179
- )}
180
- </div>
181
- </div>
182
- </div>
183
-
184
- <div class:list={["ship-gate", regulatedReportCount ? "" : "amber"]}>
185
- <div class="ship-gate-main">
186
- <span class="seal"><svg><use href={regulatedReportCount ? "#i-check" : "#i-alert"}></use></svg></span>
187
- <div>
188
- <b>{regulatedReportCount ? "Regulated Reports Available" : "No Regulated Reports Enabled"}</b>
189
- <span>
190
- {regulatedReportCount
191
- ? `${regulatedReportCount} regulated report set${regulatedReportCount === 1 ? "" : "s"} will pull the required attributes into exports for ${tenant.displayName ?? tenant.appDomain}.`
192
- : "This tenant still sees commerce reporting, while compliance, tax, and PACT packets stay quiet until enabled."}
193
- </span>
194
- </div>
195
- </div>
196
- </div>
197
-
198
- <div class="grid reporting-workspace">
199
- <div class="panel">
200
- <div class="panel-head">
201
- <h3><svg><use href="#i-file"></use></svg>Monthly Visibility</h3>
202
- <span class:list={["chip", monthlyRows.length ? "teal" : ""]}>{monthlyRows.length ? "Regulated calendar" : "Commerce only"}</span>
203
- </div>
204
- <div class="panel-body grid">
205
- {monthlyRows.length ? (
206
- <div class="table-wrap monthly-table-wrap">
207
- <table class="monthly-table">
208
- <thead>
209
- <tr>
210
- <th>Report</th>
211
- <th>Period</th>
212
- <th>Cadence</th>
213
- <th>Owner</th>
214
- <th>Readiness</th>
215
- <th>Status</th>
216
- <th class="action">Action</th>
217
- </tr>
218
- </thead>
219
- <tbody>
220
- {monthlyRows.map((row) => (
221
- <tr>
222
- <td><strong>{row.report}</strong><span class="subtle">Monthly report package</span></td>
223
- <td><strong>{row.period}</strong></td>
224
- <td><span class="subtle">{row.cadence}</span></td>
225
- <td><strong>{row.owner}</strong></td>
226
- <td><span class="subtle">{row.readiness}</span></td>
227
- <td><span class:list={["chip", row.tone]}>{row.status}</span></td>
228
- <td class="action"><button class="btn" type="button">{row.action}</button></td>
229
- </tr>
230
- ))}
231
- </tbody>
232
- </table>
233
- </div>
234
- ) : (
235
- <div class="field">
236
- <label>Monthly regulated reports</label>
237
- <strong>Not enabled for this tenant</strong>
238
- <p>Excise tax, PACT packets, and regulated reorder forms appear here when those capabilities or tenant policies are active.</p>
239
- </div>
240
- )}
241
- </div>
242
- </div>
243
-
244
- <aside class="panel report-detail-panel" aria-labelledby="report-detail-title">
245
- <div class="panel-head">
246
- <h3 id="report-detail-title"><svg><use href="#i-shield"></use></svg>Required Fields</h3>
247
- <span class:list={["chip", requiredFieldGroups.length ? "green" : ""]}>{requiredFieldGroups.length ? "Auto-pulled" : "No regulated fields"}</span>
248
- </div>
249
- <div class="panel-body grid">
250
- {requiredFieldGroups.length ? (
251
- requiredFieldGroups.map((group) => (
252
- <div class="required-field-set">
253
- <div class="required-field-head">
254
- <div>
255
- <strong>{group.title}</strong>
256
- <span>{group.source}</span>
257
- </div>
258
- <span class:list={["chip", group.tone]}>{group.status}</span>
259
- </div>
260
- <p>{group.fields}</p>
261
- </div>
262
- ))
263
- ) : (
264
- <div class="field">
265
- <label>Regulated field groups</label>
266
- <strong>Hidden until enabled</strong>
267
- <p>The report builder only asks for regulated fields when the tenant policy or capability requires them.</p>
268
- </div>
269
- )}
270
- </div>
271
- </aside>
272
- </div>
273
- </section>
274
-
275
- <style>
276
- .report-card-grid {
277
- display: grid;
278
- grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
279
- gap: 12px;
280
- }
281
-
282
- .report-card {
283
- display: grid;
284
- gap: 8px;
285
- min-width: 0;
286
- padding: 12px;
287
- border: 1px solid var(--admin-line);
288
- border-radius: var(--admin-radius);
289
- background: var(--admin-surface);
290
- color: var(--admin-ink);
291
- text-decoration: none;
292
- }
293
-
294
- .report-card:hover {
295
- border-color: var(--admin-teal);
296
- }
297
-
298
- .report-card-head {
299
- display: flex;
300
- align-items: center;
301
- justify-content: space-between;
302
- gap: 10px;
303
- }
304
-
305
- .trend {
306
- font-size: 13px;
307
- font-weight: 760;
308
- }
309
-
310
- .trend.green {
311
- color: var(--admin-green);
312
- }
313
-
314
- .trend.red {
315
- color: var(--admin-red);
316
- }
317
-
318
- .report-card > strong {
319
- font-size: 20px;
320
- }
321
-
322
- .report-card p {
323
- margin: 0;
324
- color: var(--admin-muted);
325
- font-size: 12px;
326
- }
327
-
328
- .analysis-panel {
329
- border-color: #b9c9ec;
330
- background: #fbfcff;
331
- }
332
-
333
- .analysis-group {
334
- display: grid;
335
- gap: 8px;
336
- }
337
-
338
- .analysis-group h4 {
339
- margin: 0;
340
- font-size: 13px;
341
- }
342
-
343
- .analysis-item {
344
- display: flex;
345
- align-items: center;
346
- justify-content: space-between;
347
- gap: 12px;
348
- padding: 10px;
349
- border: 1px solid var(--admin-line);
350
- border-radius: var(--admin-radius-sm);
351
- background: var(--admin-surface);
352
- color: var(--admin-ink);
353
- text-decoration: none;
354
- }
355
-
356
- .analysis-item:hover {
357
- border-color: var(--admin-teal);
358
- }
359
-
360
- .analysis-item b {
361
- display: block;
362
- font-size: 13px;
363
- }
364
-
365
- .analysis-item p {
366
- margin: 2px 0 0;
367
- color: var(--admin-muted);
368
- font-size: 12px;
369
- }
370
-
371
- .reporting-workspace {
372
- grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
373
- }
374
-
375
- .monthly-table {
376
- min-width: 940px;
377
- }
378
-
379
- .required-field-set {
380
- display: grid;
381
- gap: 8px;
382
- padding: 11px;
383
- border: 1px solid var(--admin-line);
384
- border-radius: var(--admin-radius-sm);
385
- background: #fcfdfc;
386
- }
387
-
388
- .required-field-head {
389
- display: flex;
390
- align-items: center;
391
- justify-content: space-between;
392
- gap: 10px;
393
- min-width: 0;
394
- }
395
-
396
- .required-field-head > div {
397
- flex: 1 1 150px;
398
- min-width: 0;
399
- }
400
-
401
- .required-field-head strong {
402
- display: block;
403
- }
404
-
405
- .required-field-head span:not(.chip) {
406
- display: block;
407
- margin-top: 2px;
408
- color: var(--admin-muted);
409
- font-size: 12px;
410
- }
411
-
412
- .required-field-set p {
413
- margin: 0;
414
- color: var(--admin-muted);
415
- font-size: 12px;
416
- }
417
-
418
- @media (max-width: 1120px) {
419
- .reporting-workspace {
420
- grid-template-columns: repeat(2, minmax(0, 1fr));
421
- }
422
- }
423
-
424
- @media (max-width: 760px) {
425
- .reporting-workspace {
426
- grid-template-columns: 1fr;
427
- }
428
-
429
- .analysis-item,
430
- .required-field-head {
431
- align-items: flex-start;
432
- flex-direction: column;
433
- }
434
- }
435
- </style>