@tokenoftrust/storefront-runner 1.3.2
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.
- package/LICENSE +58 -0
- package/README.md +42 -0
- package/apps/storefront/astro.config.mjs +66 -0
- package/apps/storefront/dev-plugins/dev-loop-state.mjs +147 -0
- package/apps/storefront/dev-plugins/tenant-hot-reload.mjs +238 -0
- package/apps/storefront/env.d.ts +162 -0
- package/apps/storefront/migrations/0000_baseline.sql +54 -0
- package/apps/storefront/migrations/0001_products_fts.sql +9 -0
- package/apps/storefront/migrations/README.md +54 -0
- package/apps/storefront/migrations/meta/0000_snapshot.json +347 -0
- package/apps/storefront/migrations/meta/0001_snapshot.json +347 -0
- package/apps/storefront/migrations/meta/_journal.json +20 -0
- package/apps/storefront/package.json +42 -0
- package/apps/storefront/public/brand/northwind-logo-dark.svg +4 -0
- package/apps/storefront/public/brand/northwind-logo-light.svg +4 -0
- package/apps/storefront/public/brand/northwind-og.svg +13 -0
- package/apps/storefront/public/favicon.svg +5 -0
- package/apps/storefront/public/js/dashboard-team.js +147 -0
- package/apps/storefront/public/js/dashboard-vendor-search.js +115 -0
- package/apps/storefront/public/shared/commerce-chrome.css +369 -0
- package/apps/storefront/src/components/Badge.astro +34 -0
- package/apps/storefront/src/components/Breadcrumbs.astro +45 -0
- package/apps/storefront/src/components/CollectionCard.astro +56 -0
- package/apps/storefront/src/components/EmptyState.astro +55 -0
- package/apps/storefront/src/components/Img.astro +68 -0
- package/apps/storefront/src/components/ProductCard.astro +228 -0
- package/apps/storefront/src/components/Section.astro +39 -0
- package/apps/storefront/src/components/Seo.astro +70 -0
- package/apps/storefront/src/components/WidgetFrame.astro +34 -0
- package/apps/storefront/src/components/admin/AdminAIWorkflowsTab.astro +531 -0
- package/apps/storefront/src/components/admin/AdminCustomersTab.astro +597 -0
- package/apps/storefront/src/components/admin/AdminFoxyCartSettingsPanel.astro +227 -0
- package/apps/storefront/src/components/admin/AdminFulfillmentTab.astro +465 -0
- package/apps/storefront/src/components/admin/AdminProductsTab.astro +901 -0
- package/apps/storefront/src/components/admin/AdminReportingTab.astro +435 -0
- package/apps/storefront/src/components/admin/AdminSettingsTab.astro +782 -0
- package/apps/storefront/src/components/admin/orders/OrdersWorkspace.astro +1223 -0
- package/apps/storefront/src/components/auth/AuthBadge.astro +44 -0
- package/apps/storefront/src/components/chrome/AnnouncementBar.astro +108 -0
- package/apps/storefront/src/components/chrome/MegaMenu.astro +26 -0
- package/apps/storefront/src/components/chrome/NavDropdown.astro +201 -0
- package/apps/storefront/src/components/chrome/SiteFooter.astro +201 -0
- package/apps/storefront/src/components/chrome/SiteHeader.astro +234 -0
- package/apps/storefront/src/components/chrome/UtilityNav.astro +79 -0
- package/apps/storefront/src/components/commerce/ArticleCard.astro +242 -0
- package/apps/storefront/src/components/commerce/BrandGrid.astro +175 -0
- package/apps/storefront/src/components/commerce/FoxyLoader.astro +23 -0
- package/apps/storefront/src/components/commerce/FoxySidecartStyles.astro +61 -0
- package/apps/storefront/src/components/commerce/PriceDisplay.astro +91 -0
- package/apps/storefront/src/components/commerce/ProductCarousel.astro +197 -0
- package/apps/storefront/src/components/commerce/ProductGrid.astro +75 -0
- package/apps/storefront/src/components/commerce/RatingStars.astro +58 -0
- package/apps/storefront/src/components/commerce/ReviewList.astro +54 -0
- package/apps/storefront/src/components/commerce/ReviewSummary.astro +44 -0
- package/apps/storefront/src/components/commerce/TagFilterCloud.astro +149 -0
- package/apps/storefront/src/components/compliance/AdultSignatureNotice.astro +37 -0
- package/apps/storefront/src/components/compliance/ComplianceNotice.astro +99 -0
- package/apps/storefront/src/components/compliance/ExciseTaxNotice.astro +45 -0
- package/apps/storefront/src/components/compliance/NicotineWarning.astro +33 -0
- package/apps/storefront/src/components/compliance/PactActNotice.astro +35 -0
- package/apps/storefront/src/components/compliance/Prop65Warning.astro +80 -0
- package/apps/storefront/src/components/compliance/PurchaseLimitNotice.astro +38 -0
- package/apps/storefront/src/components/compliance/ShippingRestrictionNotice.astro +35 -0
- package/apps/storefront/src/components/compliance/StateEligibilityNotice.astro +53 -0
- package/apps/storefront/src/components/home/Hero.astro +164 -0
- package/apps/storefront/src/components/islands/AgeGate.tsx +109 -0
- package/apps/storefront/src/components/islands/ImageGallery.tsx +237 -0
- package/apps/storefront/src/components/islands/IsolatedAgeGate.tsx +73 -0
- package/apps/storefront/src/components/islands/MobileNav.tsx +239 -0
- package/apps/storefront/src/components/islands/QuickView.tsx +138 -0
- package/apps/storefront/src/components/islands/RecentlyViewed.tsx +122 -0
- package/apps/storefront/src/components/islands/SavedList.tsx +99 -0
- package/apps/storefront/src/components/islands/SearchTypeahead.tsx +248 -0
- package/apps/storefront/src/components/islands/VariantSelector.tsx +375 -0
- package/apps/storefront/src/components/marketing/CardGrid.astro +72 -0
- package/apps/storefront/src/components/marketing/CodeSample.astro +20 -0
- package/apps/storefront/src/components/marketing/CtaBand.astro +24 -0
- package/apps/storefront/src/components/marketing/Faq.astro +37 -0
- package/apps/storefront/src/components/marketing/Integrations.astro +63 -0
- package/apps/storefront/src/components/marketing/MarketingBlocks.astro +53 -0
- package/apps/storefront/src/components/marketing/MarketingCtas.astro +48 -0
- package/apps/storefront/src/components/marketing/MarketingHero.astro +72 -0
- package/apps/storefront/src/components/marketing/ProofStrip.astro +37 -0
- package/apps/storefront/src/components/marketing/SplitCompare.astro +53 -0
- package/apps/storefront/src/components/marketing/Steps.astro +36 -0
- package/apps/storefront/src/components/marketing/Testimonials.astro +38 -0
- package/apps/storefront/src/components/marketing/TrustBar.astro +22 -0
- package/apps/storefront/src/components/membership/IllustrativeLabel.astro +56 -0
- package/apps/storefront/src/components/membership/TierCards.astro +164 -0
- package/apps/storefront/src/components/membership/TierComparisonTable.astro +148 -0
- package/apps/storefront/src/components/plp/ActiveFilters.astro +79 -0
- package/apps/storefront/src/components/plp/FacetSidebar.astro +199 -0
- package/apps/storefront/src/components/plp/Pagination.astro +99 -0
- package/apps/storefront/src/components/plp/SortSelect.astro +64 -0
- package/apps/storefront/src/components/style-guide/StyleGuideNav.astro +95 -0
- package/apps/storefront/src/components/subscription/HowItWorksSteps.astro +67 -0
- package/apps/storefront/src/components/subscription/ManageSubscriptionEntry.astro +67 -0
- package/apps/storefront/src/components/subscription/SavingsExplainer.astro +101 -0
- package/apps/storefront/src/config/adminTargetTenant.ts +28 -0
- package/apps/storefront/src/config/devTenantSeed.ts +78 -0
- package/apps/storefront/src/config/devTenants.ts +16 -0
- package/apps/storefront/src/config/kvTenantResolver.ts +87 -0
- package/apps/storefront/src/config/resolver.ts +102 -0
- package/apps/storefront/src/config/tenants.ts +87 -0
- package/apps/storefront/src/layouts/Layout.astro +368 -0
- package/apps/storefront/src/lib/admin/README.md +122 -0
- package/apps/storefront/src/lib/admin/ai/approvalMode.ts +21 -0
- package/apps/storefront/src/lib/admin/ai/askEnvelope.ts +48 -0
- package/apps/storefront/src/lib/admin/ai/audit.ts +14 -0
- package/apps/storefront/src/lib/admin/ai/index.ts +6 -0
- package/apps/storefront/src/lib/admin/ai/operationalRuns.ts +155 -0
- package/apps/storefront/src/lib/admin/ai/recommendation.ts +20 -0
- package/apps/storefront/src/lib/admin/checkoutStyleInput.ts +172 -0
- package/apps/storefront/src/lib/admin/checkoutStyleTarget.ts +65 -0
- package/apps/storefront/src/lib/admin/envelope.ts +10 -0
- package/apps/storefront/src/lib/admin/evidence/evidenceReference.ts +32 -0
- package/apps/storefront/src/lib/admin/memoizeByEnvelope.ts +27 -0
- package/apps/storefront/src/lib/admin/orderClient.ts +146 -0
- package/apps/storefront/src/lib/admin/seed.ts +54 -0
- package/apps/storefront/src/lib/admin/services/mock/aiWorkflows.ts +59 -0
- package/apps/storefront/src/lib/admin/services/mock/customers.ts +86 -0
- package/apps/storefront/src/lib/admin/services/mock/evidence.ts +99 -0
- package/apps/storefront/src/lib/admin/services/mock/foxyCartSettings.ts +78 -0
- package/apps/storefront/src/lib/admin/services/mock/fulfillment.ts +62 -0
- package/apps/storefront/src/lib/admin/services/mock/index.ts +12 -0
- package/apps/storefront/src/lib/admin/services/mock/orders.ts +184 -0
- package/apps/storefront/src/lib/admin/services/mock/products.ts +105 -0
- package/apps/storefront/src/lib/admin/services/mock/reporting.ts +51 -0
- package/apps/storefront/src/lib/admin/services/mock/settings.ts +70 -0
- package/apps/storefront/src/lib/admin/services/mock/tenants.ts +29 -0
- package/apps/storefront/src/lib/admin/services/orders.ts +300 -0
- package/apps/storefront/src/lib/admin/viewmodels/aiWorkflows.ts +67 -0
- package/apps/storefront/src/lib/admin/viewmodels/customers.ts +56 -0
- package/apps/storefront/src/lib/admin/viewmodels/fulfillment.ts +49 -0
- package/apps/storefront/src/lib/admin/viewmodels/orders.ts +92 -0
- package/apps/storefront/src/lib/admin/viewmodels/products.ts +74 -0
- package/apps/storefront/src/lib/admin/viewmodels/reporting.ts +34 -0
- package/apps/storefront/src/lib/admin/viewmodels/settings.ts +64 -0
- package/apps/storefront/src/lib/adminTenantEnvelope.ts +90 -0
- package/apps/storefront/src/lib/analytics/index.ts +47 -0
- package/apps/storefront/src/lib/auth/brokerAssertion.ts +136 -0
- package/apps/storefront/src/lib/auth/devAuth.ts +90 -0
- package/apps/storefront/src/lib/auth/gatePage.ts +81 -0
- package/apps/storefront/src/lib/auth/identityToken.ts +341 -0
- package/apps/storefront/src/lib/auth/loginGate.ts +119 -0
- package/apps/storefront/src/lib/auth/route.ts +146 -0
- package/apps/storefront/src/lib/auth/session.ts +203 -0
- package/apps/storefront/src/lib/auth/totAccessClient.ts +503 -0
- package/apps/storefront/src/lib/basePath.ts +41 -0
- package/apps/storefront/src/lib/cfImage.ts +55 -0
- package/apps/storefront/src/lib/chrome/model.ts +244 -0
- package/apps/storefront/src/lib/chrome/parseConfig.ts +34 -0
- package/apps/storefront/src/lib/colors.ts +97 -0
- package/apps/storefront/src/lib/commerce/foxyCartSettings.ts +253 -0
- package/apps/storefront/src/lib/content-edit/applyDiff.ts +91 -0
- package/apps/storefront/src/lib/content-edit/client.ts +230 -0
- package/apps/storefront/src/lib/content-edit/index.ts +14 -0
- package/apps/storefront/src/lib/content-edit/route.ts +25 -0
- package/apps/storefront/src/lib/content-edit/types.ts +19 -0
- package/apps/storefront/src/lib/cspStaticHashes.ts +24 -0
- package/apps/storefront/src/lib/d1/catalog.ts +366 -0
- package/apps/storefront/src/lib/dashboard/staffAdmission.ts +43 -0
- package/apps/storefront/src/lib/dashboard/staffVendorAccess.ts +449 -0
- package/apps/storefront/src/lib/dashboard/tenantSelection.ts +136 -0
- package/apps/storefront/src/lib/dashboard/vendorQuery.ts +61 -0
- package/apps/storefront/src/lib/demoGate.ts +113 -0
- package/apps/storefront/src/lib/dev/activityIngestToken.ts +78 -0
- package/apps/storefront/src/lib/dev/activityStore.ts +72 -0
- package/apps/storefront/src/lib/dev/ai-widget-client.js +308 -0
- package/apps/storefront/src/lib/dev/apiBase.ts +14 -0
- package/apps/storefront/src/lib/dev/cliSignInCode.ts +155 -0
- package/apps/storefront/src/lib/dev/devDraft.ts +133 -0
- package/apps/storefront/src/lib/dev/hostedCockpit.ts +169 -0
- package/apps/storefront/src/lib/dev/livePreview.ts +77 -0
- package/apps/storefront/src/lib/dev/runtimeStore.ts +120 -0
- package/apps/storefront/src/lib/dev/storeStatus.ts +142 -0
- package/apps/storefront/src/lib/diag/redact.ts +20 -0
- package/apps/storefront/src/lib/edgeCache.ts +128 -0
- package/apps/storefront/src/lib/email/magicLinkInviteEmail.ts +62 -0
- package/apps/storefront/src/lib/env.ts +60 -0
- package/apps/storefront/src/lib/fixtures/sampleProducts.ts +130 -0
- package/apps/storefront/src/lib/format.ts +38 -0
- package/apps/storefront/src/lib/foxyCommerce.ts +49 -0
- package/apps/storefront/src/lib/imageAttrs.ts +55 -0
- package/apps/storefront/src/lib/jsonld.ts +166 -0
- package/apps/storefront/src/lib/maintenance.ts +71 -0
- package/apps/storefront/src/lib/membership/model.ts +97 -0
- package/apps/storefront/src/lib/memoryKv.ts +32 -0
- package/apps/storefront/src/lib/messaging/messagesClient.ts +143 -0
- package/apps/storefront/src/lib/placeholder.ts +99 -0
- package/apps/storefront/src/lib/previewReload.ts +125 -0
- package/apps/storefront/src/lib/priceBuckets.ts +33 -0
- package/apps/storefront/src/lib/rawChrome.ts +505 -0
- package/apps/storefront/src/lib/rawMarketingHtml.ts +136 -0
- package/apps/storefront/src/lib/search/index.ts +74 -0
- package/apps/storefront/src/lib/sections.ts +129 -0
- package/apps/storefront/src/lib/securityHeaders.ts +31 -0
- package/apps/storefront/src/lib/storyblok/content-model.ts +289 -0
- package/apps/storefront/src/lib/storyblok/provider.ts +607 -0
- package/apps/storefront/src/lib/subscription/model.ts +68 -0
- package/apps/storefront/src/lib/tenantRouting.ts +91 -0
- package/apps/storefront/src/lib/tot/ToTClient.ts +177 -0
- package/apps/storefront/src/lib/tot/d1Client.ts +62 -0
- package/apps/storefront/src/lib/tot/query.ts +249 -0
- package/apps/storefront/src/lib/tot/totClientInterface.ts +30 -0
- package/apps/storefront/src/lib/url.ts +142 -0
- package/apps/storefront/src/lib/wishlist.ts +63 -0
- package/apps/storefront/src/middleware/index.ts +455 -0
- package/apps/storefront/src/pages/404.astro +61 -0
- package/apps/storefront/src/pages/[...slug].astro +90 -0
- package/apps/storefront/src/pages/admin.astro +1675 -0
- package/apps/storefront/src/pages/api/admin/orders/[id].ts +53 -0
- package/apps/storefront/src/pages/api/admin/orders.ts +71 -0
- package/apps/storefront/src/pages/api/auth/logout.ts +21 -0
- package/apps/storefront/src/pages/api/auth/magic-exchange.ts +107 -0
- package/apps/storefront/src/pages/api/auth/send.ts +85 -0
- package/apps/storefront/src/pages/api/auth/verify.ts +135 -0
- package/apps/storefront/src/pages/api/cache-purge.ts +44 -0
- package/apps/storefront/src/pages/api/checkout-style.css.ts +43 -0
- package/apps/storefront/src/pages/api/cli/policy.ts +70 -0
- package/apps/storefront/src/pages/api/content-edit/ai-edit.ts +164 -0
- package/apps/storefront/src/pages/api/csp-report.ts +25 -0
- package/apps/storefront/src/pages/api/dashboard/enter-vendor.ts +124 -0
- package/apps/storefront/src/pages/api/dashboard/vendor-search.ts +120 -0
- package/apps/storefront/src/pages/api/dev/activity.ts +124 -0
- package/apps/storefront/src/pages/api/dev/cli-signin-code.ts +73 -0
- package/apps/storefront/src/pages/api/dev/diff.ts +68 -0
- package/apps/storefront/src/pages/api/dev/file.ts +57 -0
- package/apps/storefront/src/pages/api/dev/locate.ts +125 -0
- package/apps/storefront/src/pages/api/dev/publish.ts +128 -0
- package/apps/storefront/src/pages/api/dev/tree.ts +70 -0
- package/apps/storefront/src/pages/api/dev/write.ts +116 -0
- package/apps/storefront/src/pages/api/newsletter.ts +104 -0
- package/apps/storefront/src/pages/api/request-access.ts +172 -0
- package/apps/storefront/src/pages/auth/login.astro +149 -0
- package/apps/storefront/src/pages/auth/magic.astro +105 -0
- package/apps/storefront/src/pages/capabilities.astro +292 -0
- package/apps/storefront/src/pages/collections/[handle].astro +177 -0
- package/apps/storefront/src/pages/collections/index.astro +59 -0
- package/apps/storefront/src/pages/dashboard/[appDomain]/index.astro +100 -0
- package/apps/storefront/src/pages/dashboard/[appDomain]/team.astro +154 -0
- package/apps/storefront/src/pages/dashboard/index.astro +160 -0
- package/apps/storefront/src/pages/index.astro +290 -0
- package/apps/storefront/src/pages/llms.txt.ts +92 -0
- package/apps/storefront/src/pages/products/[handle].astro +402 -0
- package/apps/storefront/src/pages/robots.txt.ts +24 -0
- package/apps/storefront/src/pages/saved.astro +35 -0
- package/apps/storefront/src/pages/search.astro +150 -0
- package/apps/storefront/src/pages/sitemap.xml.ts +78 -0
- package/apps/storefront/src/pages/style-guide/[tenant]/[theme].astro +1280 -0
- package/apps/storefront/src/pages/style-guide/[tenant]/chrome/[theme].astro +229 -0
- package/apps/storefront/src/pages/style-guide/[tenant]/guide/[theme].astro +144 -0
- package/apps/storefront/src/pages/style-guide/[tenant]/index.astro +116 -0
- package/apps/storefront/src/pages/style-guide/index.astro +98 -0
- package/apps/storefront/src/pages/tenants/[id]/[...path].ts +57 -0
- package/apps/storefront/src/styles/global.css +292 -0
- package/apps/storefront/src/themes/reference.ts +68 -0
- package/apps/storefront/src/themes/schema.ts +111 -0
- package/apps/storefront/src/themes/tenants/index.ts +51 -0
- package/apps/storefront/tsconfig.json +16 -0
- package/apps/storefront/vitest.config.ts +22 -0
- package/package.json +26 -0
- package/packages/public-runtime/LICENSE +58 -0
- package/packages/public-runtime/package.json +22 -0
- package/packages/public-runtime/src/binary-path.ts +68 -0
- package/packages/public-runtime/src/capabilities.ts +89 -0
- package/packages/public-runtime/src/catalog-api.ts +81 -0
- package/packages/public-runtime/src/catalog-d1.ts +192 -0
- package/packages/public-runtime/src/checkout-style-publish.ts +200 -0
- package/packages/public-runtime/src/checkout-style.ts +375 -0
- package/packages/public-runtime/src/csp.ts +109 -0
- package/packages/public-runtime/src/customization-preview.ts +197 -0
- package/packages/public-runtime/src/customization-reconcile.ts +63 -0
- package/packages/public-runtime/src/customization-runtime.ts +157 -0
- package/packages/public-runtime/src/customization-scripts.ts +64 -0
- package/packages/public-runtime/src/customization-versioning.ts +95 -0
- package/packages/public-runtime/src/foxy-orders.ts +136 -0
- package/packages/public-runtime/src/foxy.ts +196 -0
- package/packages/public-runtime/src/hot-standby-readiness.ts +140 -0
- package/packages/public-runtime/src/index.ts +34 -0
- package/packages/public-runtime/src/product.ts +159 -0
- package/packages/public-runtime/src/search.ts +45 -0
- package/packages/public-runtime/src/tenant-assets.ts +444 -0
- package/packages/public-runtime/src/tenant.ts +384 -0
- package/packages/public-runtime/tsconfig.json +8 -0
- package/packages/public-runtime/vitest.config.ts +8 -0
- package/pnpm-workspace.yaml +7 -0
- package/scripts/build/copy-tenant-assets.mjs +69 -0
- package/scripts/dev/ai-edit.mjs +183 -0
- package/scripts/dev/checkout-watch.mjs +116 -0
- package/scripts/dev/file-browser.mjs +159 -0
- package/scripts/dev/file-writer.mjs +141 -0
- package/scripts/dev/git-status.mjs +171 -0
- package/scripts/dev/locate-handler.mjs +163 -0
- package/scripts/dev/locate.mjs +112 -0
- package/scripts/dev/port-check.mjs +48 -0
- package/scripts/dev/safe-path.mjs +109 -0
- package/scripts/dev/shot.mjs +46 -0
- package/scripts/dev/tenant-source-root.mjs +76 -0
- package/scripts/dev/unified-diff.mjs +81 -0
- package/scripts/tot-dev.mjs +376 -0
- package/tenants/README.md +14 -0
- package/tenants/home/content/chrome.json +7 -0
- package/tenants/home/content/home.html +58 -0
- package/tenants/home/content/home.json +11 -0
- package/tenants/home/public/js/storefront.js +210 -0
- package/tenants/home/public/logo-wordmark.png +0 -0
- package/tenants/home/public/pages/storefront.css +212 -0
- package/tenants/home/theme.json +6 -0
- package/tsconfig.base.json +20 -0
|
@@ -0,0 +1,435 @@
|
|
|
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>
|