@artisanpack-ui/ecommerce-storefront-react 0.0.0-stage → 1.0.0
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 +21 -0
- package/README.md +67 -2
- package/dist/Addresses-D3ESHG3L.mjs +27 -0
- package/dist/Addresses-D3ESHG3L.mjs.map +1 -0
- package/dist/CategoryShow-OAGROEMA.mjs +12 -0
- package/dist/CategoryShow-OAGROEMA.mjs.map +1 -0
- package/dist/Claim-CJ4UOAUD.mjs +22 -0
- package/dist/Claim-CJ4UOAUD.mjs.map +1 -0
- package/dist/Confirmation-TLMMBPWS.mjs +20 -0
- package/dist/Confirmation-TLMMBPWS.mjs.map +1 -0
- package/dist/Dashboard-ARXORMTL.mjs +24 -0
- package/dist/Dashboard-ARXORMTL.mjs.map +1 -0
- package/dist/Downloads-CEQBY7JO.mjs +25 -0
- package/dist/Downloads-CEQBY7JO.mjs.map +1 -0
- package/dist/Index-KRR3Q7EJ.mjs +12 -0
- package/dist/Index-KRR3Q7EJ.mjs.map +1 -0
- package/dist/Index-RLQFEBTX.mjs +22 -0
- package/dist/Index-RLQFEBTX.mjs.map +1 -0
- package/dist/Index-WDJYGR5Q.mjs +12 -0
- package/dist/Index-WDJYGR5Q.mjs.map +1 -0
- package/dist/Index-XYU5QLUT.mjs +23 -0
- package/dist/Index-XYU5QLUT.mjs.map +1 -0
- package/dist/Lookup-QNUQKUID.mjs +19 -0
- package/dist/Lookup-QNUQKUID.mjs.map +1 -0
- package/dist/OrderShow-RYTP62YA.mjs +27 -0
- package/dist/OrderShow-RYTP62YA.mjs.map +1 -0
- package/dist/Orders-LZW57GE6.mjs +25 -0
- package/dist/Orders-LZW57GE6.mjs.map +1 -0
- package/dist/Profile-ZAAWFCAL.mjs +25 -0
- package/dist/Profile-ZAAWFCAL.mjs.map +1 -0
- package/dist/Show-LFWUO3KR.mjs +14 -0
- package/dist/Show-LFWUO3KR.mjs.map +1 -0
- package/dist/TagShow-FXKXRGY2.mjs +12 -0
- package/dist/TagShow-FXKXRGY2.mjs.map +1 -0
- package/dist/chunk-5UUNH3EH.mjs +1888 -0
- package/dist/chunk-5UUNH3EH.mjs.map +1 -0
- package/dist/chunk-A3MMQ2RY.mjs +183 -0
- package/dist/chunk-A3MMQ2RY.mjs.map +1 -0
- package/dist/chunk-ABGPTZ3Q.mjs +198 -0
- package/dist/chunk-ABGPTZ3Q.mjs.map +1 -0
- package/dist/chunk-BJ3FJFZQ.mjs +32 -0
- package/dist/chunk-BJ3FJFZQ.mjs.map +1 -0
- package/dist/chunk-BSASRFQ7.mjs +89 -0
- package/dist/chunk-BSASRFQ7.mjs.map +1 -0
- package/dist/chunk-CGCW3555.mjs +148 -0
- package/dist/chunk-CGCW3555.mjs.map +1 -0
- package/dist/chunk-DWR23FJD.mjs +643 -0
- package/dist/chunk-DWR23FJD.mjs.map +1 -0
- package/dist/chunk-ENY3MH2W.mjs +148 -0
- package/dist/chunk-ENY3MH2W.mjs.map +1 -0
- package/dist/chunk-EWJLRWPO.mjs +280 -0
- package/dist/chunk-EWJLRWPO.mjs.map +1 -0
- package/dist/chunk-FL5XL3ET.mjs +212 -0
- package/dist/chunk-FL5XL3ET.mjs.map +1 -0
- package/dist/chunk-FOOP6UK3.mjs +218 -0
- package/dist/chunk-FOOP6UK3.mjs.map +1 -0
- package/dist/chunk-HCC7GTVO.mjs +115 -0
- package/dist/chunk-HCC7GTVO.mjs.map +1 -0
- package/dist/chunk-HXZMY3GE.mjs +2331 -0
- package/dist/chunk-HXZMY3GE.mjs.map +1 -0
- package/dist/chunk-IOL2YQ62.mjs +109 -0
- package/dist/chunk-IOL2YQ62.mjs.map +1 -0
- package/dist/chunk-JH7SFSZA.mjs +104 -0
- package/dist/chunk-JH7SFSZA.mjs.map +1 -0
- package/dist/chunk-JJOPX4PI.mjs +205 -0
- package/dist/chunk-JJOPX4PI.mjs.map +1 -0
- package/dist/chunk-LT3GG7YQ.mjs +32 -0
- package/dist/chunk-LT3GG7YQ.mjs.map +1 -0
- package/dist/chunk-MZFULGDI.mjs +267 -0
- package/dist/chunk-MZFULGDI.mjs.map +1 -0
- package/dist/chunk-O4WPMMSH.mjs +58 -0
- package/dist/chunk-O4WPMMSH.mjs.map +1 -0
- package/dist/chunk-OU3WYFIH.mjs +397 -0
- package/dist/chunk-OU3WYFIH.mjs.map +1 -0
- package/dist/chunk-P3NIV4YG.mjs +998 -0
- package/dist/chunk-P3NIV4YG.mjs.map +1 -0
- package/dist/chunk-PEBBSZ5R.mjs +201 -0
- package/dist/chunk-PEBBSZ5R.mjs.map +1 -0
- package/dist/chunk-T5OWL6EG.mjs +73 -0
- package/dist/chunk-T5OWL6EG.mjs.map +1 -0
- package/dist/chunk-THPUK35U.mjs +132 -0
- package/dist/chunk-THPUK35U.mjs.map +1 -0
- package/dist/chunk-TPOKMH5E.mjs +142 -0
- package/dist/chunk-TPOKMH5E.mjs.map +1 -0
- package/dist/chunk-VX5TEJNU.mjs +1898 -0
- package/dist/chunk-VX5TEJNU.mjs.map +1 -0
- package/dist/chunk-WUL34MB2.mjs +268 -0
- package/dist/chunk-WUL34MB2.mjs.map +1 -0
- package/dist/chunk-WYGOMIZK.mjs +140 -0
- package/dist/chunk-WYGOMIZK.mjs.map +1 -0
- package/dist/chunk-Y2IOBBN7.mjs +127 -0
- package/dist/chunk-Y2IOBBN7.mjs.map +1 -0
- package/dist/chunk-Y5BRPEHA.mjs +54 -0
- package/dist/chunk-Y5BRPEHA.mjs.map +1 -0
- package/dist/index.d.ts +4607 -0
- package/dist/index.mjs +1515 -0
- package/dist/index.mjs.map +1 -0
- package/package.json +112 -4
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CatalogListing,
|
|
3
|
+
StorefrontBreadcrumbs
|
|
4
|
+
} from "./chunk-P3NIV4YG.mjs";
|
|
5
|
+
import {
|
|
6
|
+
storefrontLayout
|
|
7
|
+
} from "./chunk-VX5TEJNU.mjs";
|
|
8
|
+
|
|
9
|
+
// src/pages/Catalog/CategoryShow.tsx
|
|
10
|
+
import { __ } from "@artisanpack-ui/ecommerce-storefront-core";
|
|
11
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
12
|
+
function CatalogCategoryShow({
|
|
13
|
+
category,
|
|
14
|
+
listing,
|
|
15
|
+
headingLevel = 1
|
|
16
|
+
}) {
|
|
17
|
+
const Heading = 2 === headingLevel ? "h2" : "h1";
|
|
18
|
+
const all = __("All :category", { category: category.name });
|
|
19
|
+
return /* @__PURE__ */ jsxs("div", { className: "ec-page", "data-category-page": category.id, children: [
|
|
20
|
+
category.breadcrumbs.length > 1 ? /* @__PURE__ */ jsx(StorefrontBreadcrumbs, { items: category.breadcrumbs }) : null,
|
|
21
|
+
/* @__PURE__ */ jsxs(
|
|
22
|
+
"div",
|
|
23
|
+
{
|
|
24
|
+
className: "apui-card ec-category-hero",
|
|
25
|
+
"data-surface": "default",
|
|
26
|
+
"data-with-image": null !== category.image ? "" : void 0,
|
|
27
|
+
"data-category-header": "",
|
|
28
|
+
children: [
|
|
29
|
+
/* @__PURE__ */ jsxs("div", { className: "ec-category-hero__body", children: [
|
|
30
|
+
/* @__PURE__ */ jsx("p", { className: "ec-category-hero__eyebrow", children: __("Category") }),
|
|
31
|
+
/* @__PURE__ */ jsx(Heading, { className: "ec-category-hero__title", children: category.name }),
|
|
32
|
+
null !== category.description ? /* @__PURE__ */ jsx(
|
|
33
|
+
"div",
|
|
34
|
+
{
|
|
35
|
+
className: "ec-category-hero__description",
|
|
36
|
+
"data-category-description": "",
|
|
37
|
+
dangerouslySetInnerHTML: { __html: category.description }
|
|
38
|
+
}
|
|
39
|
+
) : null,
|
|
40
|
+
category.subcategories.length > 0 ? /* @__PURE__ */ jsx("nav", { "aria-label": __("Sub-categories"), "data-subcategories": "", children: /* @__PURE__ */ jsxs("ul", { role: "list", className: "ec-category-hero__chips", children: [
|
|
41
|
+
/* @__PURE__ */ jsx("li", { children: null !== category.url ? /* @__PURE__ */ jsx(
|
|
42
|
+
"a",
|
|
43
|
+
{
|
|
44
|
+
href: category.url,
|
|
45
|
+
className: "ec-chip",
|
|
46
|
+
"data-variant": "select",
|
|
47
|
+
"aria-current": "page",
|
|
48
|
+
"data-subcategory-all": "",
|
|
49
|
+
children: all
|
|
50
|
+
}
|
|
51
|
+
) : /* @__PURE__ */ jsx(
|
|
52
|
+
"span",
|
|
53
|
+
{
|
|
54
|
+
className: "ec-chip",
|
|
55
|
+
"data-variant": "select",
|
|
56
|
+
"aria-current": "page",
|
|
57
|
+
"data-subcategory-all": "",
|
|
58
|
+
children: all
|
|
59
|
+
}
|
|
60
|
+
) }),
|
|
61
|
+
category.subcategories.map((subcategory) => /* @__PURE__ */ jsx("li", { children: null !== subcategory.url ? /* @__PURE__ */ jsx(
|
|
62
|
+
"a",
|
|
63
|
+
{
|
|
64
|
+
href: subcategory.url,
|
|
65
|
+
className: "ec-chip",
|
|
66
|
+
"data-variant": "select",
|
|
67
|
+
"data-subcategory": subcategory.id,
|
|
68
|
+
children: subcategory.name
|
|
69
|
+
}
|
|
70
|
+
) : /* @__PURE__ */ jsx(
|
|
71
|
+
"span",
|
|
72
|
+
{
|
|
73
|
+
className: "ec-chip",
|
|
74
|
+
"data-variant": "select",
|
|
75
|
+
"data-subcategory": subcategory.id,
|
|
76
|
+
children: subcategory.name
|
|
77
|
+
}
|
|
78
|
+
) }, subcategory.id))
|
|
79
|
+
] }) }) : null
|
|
80
|
+
] }),
|
|
81
|
+
null !== category.image ? /* @__PURE__ */ jsx("div", { className: "ec-category-hero__media", children: /* @__PURE__ */ jsx(
|
|
82
|
+
"img",
|
|
83
|
+
{
|
|
84
|
+
src: category.image.url,
|
|
85
|
+
srcSet: category.image.srcset ?? void 0,
|
|
86
|
+
sizes: null !== category.image.srcset ? "(min-width: 1280px) 616px, (min-width: 768px) 50vw, 100vw" : void 0,
|
|
87
|
+
width: category.image.width,
|
|
88
|
+
height: category.image.height,
|
|
89
|
+
alt: category.image.alt,
|
|
90
|
+
"data-category-image": ""
|
|
91
|
+
}
|
|
92
|
+
) }) : null
|
|
93
|
+
]
|
|
94
|
+
}
|
|
95
|
+
),
|
|
96
|
+
/* @__PURE__ */ jsx(CatalogListing, { listing }, category.id)
|
|
97
|
+
] });
|
|
98
|
+
}
|
|
99
|
+
CatalogCategoryShow.layout = storefrontLayout;
|
|
100
|
+
|
|
101
|
+
export {
|
|
102
|
+
CatalogCategoryShow
|
|
103
|
+
};
|
|
104
|
+
//# sourceMappingURL=chunk-JH7SFSZA.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/pages/Catalog/CategoryShow.tsx"],"sourcesContent":["/**\n * `EcommerceStorefront/Catalog/CategoryShow`: a category page.\n *\n * Mirrors ecommerce-storefront-livewire's `Catalog/CategoryShow`: the\n * breadcrumbs, then the category's header card (the \"Category\" eyebrow, the\n * name, the description, the sub-category chips and the image on the end\n * half), then the listing for the category. The card is a design-system\n * Card written out as a `<div>`, so the page keeps one banner landmark.\n *\n * @since 1.0.0\n */\n\nimport { __, type CatalogCategoryShowPageProps } from '@artisanpack-ui/ecommerce-storefront-core';\nimport type { ReactElement } from 'react';\n\nimport { CatalogListing } from '../../catalog/CatalogListing';\nimport { StorefrontBreadcrumbs } from '../../catalog/StorefrontBreadcrumbs';\nimport { storefrontLayout } from '../../layout/StorefrontLayout';\n\n/**\n * A category page.\n *\n * @since 1.0.0\n *\n * @param props - The page's props.\n * @returns The page.\n */\nexport default function CatalogCategoryShow({\n category,\n listing,\n headingLevel = 1,\n}: CatalogCategoryShowPageProps & {\n /** 2 under a template's own `<h1>` (the Product Catalog block). */\n headingLevel?: 1 | 2;\n}): ReactElement {\n const Heading = 2 === headingLevel ? 'h2' : 'h1';\n const all = __('All :category', { category: category.name });\n\n return (\n <div className=\"ec-page\" data-category-page={category.id}>\n {category.breadcrumbs.length > 1 ? (\n <StorefrontBreadcrumbs items={category.breadcrumbs} />\n ) : null}\n\n <div\n className=\"apui-card ec-category-hero\"\n data-surface=\"default\"\n data-with-image={null !== category.image ? '' : undefined}\n data-category-header=\"\"\n >\n <div className=\"ec-category-hero__body\">\n <p className=\"ec-category-hero__eyebrow\">{__('Category')}</p>\n <Heading className=\"ec-category-hero__title\">{category.name}</Heading>\n\n {null !== category.description ? (\n <div\n className=\"ec-category-hero__description\"\n data-category-description=\"\"\n // The server cleans the description's HTML (Support\\SafeHtml).\n dangerouslySetInnerHTML={{ __html: category.description }}\n />\n ) : null}\n\n {category.subcategories.length > 0 ? (\n <nav aria-label={__('Sub-categories')} data-subcategories=\"\">\n <ul role=\"list\" className=\"ec-category-hero__chips\">\n <li>\n {null !== category.url ? (\n <a\n href={category.url}\n className=\"ec-chip\"\n data-variant=\"select\"\n aria-current=\"page\"\n data-subcategory-all=\"\"\n >\n {all}\n </a>\n ) : (\n <span\n className=\"ec-chip\"\n data-variant=\"select\"\n aria-current=\"page\"\n data-subcategory-all=\"\"\n >\n {all}\n </span>\n )}\n </li>\n {category.subcategories.map((subcategory) => (\n <li key={subcategory.id}>\n {null !== subcategory.url ? (\n <a\n href={subcategory.url}\n className=\"ec-chip\"\n data-variant=\"select\"\n data-subcategory={subcategory.id}\n >\n {subcategory.name}\n </a>\n ) : (\n <span\n className=\"ec-chip\"\n data-variant=\"select\"\n data-subcategory={subcategory.id}\n >\n {subcategory.name}\n </span>\n )}\n </li>\n ))}\n </ul>\n </nav>\n ) : null}\n </div>\n\n {null !== category.image ? (\n <div className=\"ec-category-hero__media\">\n <img\n src={category.image.url}\n srcSet={category.image.srcset ?? undefined}\n sizes={\n null !== category.image.srcset\n ? '(min-width: 1280px) 616px, (min-width: 768px) 50vw, 100vw'\n : undefined\n }\n width={category.image.width}\n height={category.image.height}\n alt={category.image.alt}\n data-category-image=\"\"\n />\n </div>\n ) : null}\n </div>\n\n <CatalogListing key={category.id} listing={listing} />\n </div>\n );\n}\n\nCatalogCategoryShow.layout = storefrontLayout;\n"],"mappings":";;;;;;;;;AAYA,SAAS,UAA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A,cACC,SAAS,cAAc,IAAI,CAAC,gBAC3B,oBAAC,QACE,mBAAS,YAAY,MACpB;AAAA,gBAAC;AAAA;AAAA,kBACC,MAAM,YAAY;AAAA,kBAClB,WAAU;AAAA,kBACV,gBAAa;AAAA,kBACb,oBAAkB,YAAY;AAAA,kBAE7B,sBAAY;AAAA;AAAA,cACf,IAEA;AAAA,gBAAC;AAAA;AAAA,kBACC,WAAU;AAAA,kBACV,gBAAa;AAAA,kBACb,oBAAkB,YAAY;AAAA,kBAE7B,sBAAY;AAAA;AAAA,cACf,KAjBK,YAAY,EAmBrB,CACD;AAAA,eACH,GACF,IACE;AAAA,aACN;AAAA,UAEC,SAAS,SAAS,QACjB,oBAAC,SAAI,WAAU,2BACb;AAAA,YAAC;AAAA;AAAA,cACC,KAAK,SAAS,MAAM;AAAA,cACpB,QAAQ,SAAS,MAAM,UAAU;AAAA,cACjC,OACE,SAAS,SAAS,MAAM,SACpB,8DACA;AAAA,cAEN,OAAO,SAAS,MAAM;AAAA,cACtB,QAAQ,SAAS,MAAM;AAAA,cACvB,KAAK,SAAS,MAAM;AAAA,cACpB,uBAAoB;AAAA;AAAA,UACtB,GACF,IACE;AAAA;AAAA;AAAA,IACN;AAAA,IAEA,oBAAC,kBAAiC,WAAb,SAAS,EAAsB;AAAA,KACtD;AAEJ;AAEA,oBAAoB,SAAS;","names":[]}
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Address
|
|
3
|
+
} from "./chunk-O4WPMMSH.mjs";
|
|
4
|
+
import {
|
|
5
|
+
EmptyState,
|
|
6
|
+
Money
|
|
7
|
+
} from "./chunk-VX5TEJNU.mjs";
|
|
8
|
+
|
|
9
|
+
// src/account/AccountDashboard.tsx
|
|
10
|
+
import {
|
|
11
|
+
__,
|
|
12
|
+
trans_choice
|
|
13
|
+
} from "@artisanpack-ui/ecommerce-storefront-core";
|
|
14
|
+
import { Alert, Badge, Button, Card, Icon, Link, List, ListItem } from "@artisanpack-ui/react";
|
|
15
|
+
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
16
|
+
function AccountDashboard({
|
|
17
|
+
name,
|
|
18
|
+
greeting = null,
|
|
19
|
+
showTitle = true,
|
|
20
|
+
orders,
|
|
21
|
+
shippingAddress,
|
|
22
|
+
billingAddress,
|
|
23
|
+
billingSame,
|
|
24
|
+
downloads,
|
|
25
|
+
failed,
|
|
26
|
+
claimable,
|
|
27
|
+
claimUrl,
|
|
28
|
+
ordersUrl,
|
|
29
|
+
addressesUrl,
|
|
30
|
+
downloadsUrl,
|
|
31
|
+
catalogUrl,
|
|
32
|
+
profileUrl,
|
|
33
|
+
passwordUrl
|
|
34
|
+
}) {
|
|
35
|
+
const text = greeting ?? (null === name ? __("Welcome back.") : __("Welcome back, :name.", { name }));
|
|
36
|
+
return /* @__PURE__ */ jsxs("div", { className: "ec-dashboard", "data-account-dashboard": "", children: [
|
|
37
|
+
showTitle ? /* @__PURE__ */ jsx("h1", { className: "ec-dashboard__greeting", "data-account-greeting": "", children: text }) : /* @__PURE__ */ jsx("p", { className: "ec-dashboard__lead", "data-account-greeting": "", children: text }),
|
|
38
|
+
failed ? /* @__PURE__ */ jsx(
|
|
39
|
+
Alert,
|
|
40
|
+
{
|
|
41
|
+
color: "warning",
|
|
42
|
+
icon: "triangle-alert",
|
|
43
|
+
title: __("Some of your account details couldn't be loaded"),
|
|
44
|
+
description: __("Try again in a moment."),
|
|
45
|
+
"data-account-dashboard-failed": ""
|
|
46
|
+
}
|
|
47
|
+
) : null,
|
|
48
|
+
/* @__PURE__ */ jsxs(
|
|
49
|
+
Card,
|
|
50
|
+
{
|
|
51
|
+
className: "ec-order-card ec-order-card--flush",
|
|
52
|
+
role: "region",
|
|
53
|
+
"aria-labelledby": "ec-account-recent-orders",
|
|
54
|
+
"data-account-recent-orders": "",
|
|
55
|
+
children: [
|
|
56
|
+
/* @__PURE__ */ jsxs("div", { className: "ec-dashboard__card-head", children: [
|
|
57
|
+
/* @__PURE__ */ jsx("h2", { id: "ec-account-recent-orders", className: "ec-order-card__title", children: __("Recent orders") }),
|
|
58
|
+
null !== ordersUrl && orders.length > 0 ? /* @__PURE__ */ jsx(Link, { href: ordersUrl, standalone: true, "data-account-all-orders": "", children: __("View all orders") }) : null
|
|
59
|
+
] }),
|
|
60
|
+
0 === orders.length ? /* @__PURE__ */ jsx(
|
|
61
|
+
EmptyState,
|
|
62
|
+
{
|
|
63
|
+
icon: "package",
|
|
64
|
+
title: __("No orders yet"),
|
|
65
|
+
description: __("Orders you place will appear here."),
|
|
66
|
+
headingLevel: 3,
|
|
67
|
+
className: "ec-dashboard__empty",
|
|
68
|
+
"data-account-no-orders": "",
|
|
69
|
+
children: null !== catalogUrl ? /* @__PURE__ */ jsx(Button, { href: catalogUrl, color: "primary", size: "sm", children: __("Start shopping") }) : null
|
|
70
|
+
}
|
|
71
|
+
) : /* @__PURE__ */ jsx(List, { variant: "divided", className: "ec-dashboard__orders", children: orders.map((row) => {
|
|
72
|
+
const label = __("Order :number", { number: row.number });
|
|
73
|
+
return /* @__PURE__ */ jsx(
|
|
74
|
+
ListItem,
|
|
75
|
+
{
|
|
76
|
+
className: "ec-dashboard__order",
|
|
77
|
+
"data-account-recent-order": row.id,
|
|
78
|
+
leading: /* @__PURE__ */ jsx(Icon, { name: "package", variant: "tile", color: "neutral" }),
|
|
79
|
+
title: null !== row.url ? /* @__PURE__ */ jsx("a", { href: row.url, className: "ec-dashboard__order-link", children: label }) : label,
|
|
80
|
+
description: /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
81
|
+
row.date,
|
|
82
|
+
/* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: " \xB7 " }),
|
|
83
|
+
/* @__PURE__ */ jsx("span", { className: "apui-sr-only", children: ", " }),
|
|
84
|
+
trans_choice(":count item|:count items", row.items, { count: row.items })
|
|
85
|
+
] }),
|
|
86
|
+
trailing: /* @__PURE__ */ jsxs("span", { className: "ec-dashboard__order-end", children: [
|
|
87
|
+
/* @__PURE__ */ jsx(Badge, { color: row.color, size: "sm", "data-order-status": "", children: row.status }),
|
|
88
|
+
/* @__PURE__ */ jsx(Money, { money: row.total, className: "ec-dashboard__order-total" })
|
|
89
|
+
] })
|
|
90
|
+
},
|
|
91
|
+
row.id
|
|
92
|
+
);
|
|
93
|
+
}) })
|
|
94
|
+
]
|
|
95
|
+
}
|
|
96
|
+
),
|
|
97
|
+
/* @__PURE__ */ jsxs("div", { className: "ec-dashboard__cards", children: [
|
|
98
|
+
/* @__PURE__ */ jsxs(
|
|
99
|
+
Card,
|
|
100
|
+
{
|
|
101
|
+
className: "ec-order-card ec-dashboard__card",
|
|
102
|
+
role: "region",
|
|
103
|
+
"aria-labelledby": "ec-account-default-shipping",
|
|
104
|
+
"data-account-default-shipping": "",
|
|
105
|
+
children: [
|
|
106
|
+
/* @__PURE__ */ jsx("h2", { id: "ec-account-default-shipping", className: "ec-dashboard__card-title", children: __("Default shipping address") }),
|
|
107
|
+
null !== shippingAddress ? /* @__PURE__ */ jsx(Address, { lines: shippingAddress.lines, phone: shippingAddress.phone }) : /* @__PURE__ */ jsx("p", { className: "ec-dashboard__muted", children: __("None saved yet.") }),
|
|
108
|
+
null !== addressesUrl ? /* @__PURE__ */ jsx(
|
|
109
|
+
Link,
|
|
110
|
+
{
|
|
111
|
+
href: addressesUrl,
|
|
112
|
+
standalone: true,
|
|
113
|
+
trailingIcon: "chevron-right",
|
|
114
|
+
"data-account-link": "addresses",
|
|
115
|
+
children: __("Manage addresses")
|
|
116
|
+
}
|
|
117
|
+
) : null
|
|
118
|
+
]
|
|
119
|
+
}
|
|
120
|
+
),
|
|
121
|
+
/* @__PURE__ */ jsxs(
|
|
122
|
+
Card,
|
|
123
|
+
{
|
|
124
|
+
className: "ec-order-card ec-dashboard__card",
|
|
125
|
+
role: "region",
|
|
126
|
+
"aria-labelledby": "ec-account-default-billing",
|
|
127
|
+
"data-account-default-billing": "",
|
|
128
|
+
children: [
|
|
129
|
+
/* @__PURE__ */ jsx("h2", { id: "ec-account-default-billing", className: "ec-dashboard__card-title", children: __("Default billing address") }),
|
|
130
|
+
null !== billingAddress && null !== shippingAddress && billingSame ? /* @__PURE__ */ jsx("p", { "data-account-billing-same": "", children: __("Same as shipping") }) : null !== billingAddress ? /* @__PURE__ */ jsx(Address, { lines: billingAddress.lines, phone: billingAddress.phone }) : /* @__PURE__ */ jsx("p", { className: "ec-dashboard__muted", children: __("None saved yet.") }),
|
|
131
|
+
null !== addressesUrl ? /* @__PURE__ */ jsx(Link, { href: addressesUrl, standalone: true, trailingIcon: "chevron-right", children: __("Manage addresses") }) : null
|
|
132
|
+
]
|
|
133
|
+
}
|
|
134
|
+
),
|
|
135
|
+
/* @__PURE__ */ jsxs(
|
|
136
|
+
Card,
|
|
137
|
+
{
|
|
138
|
+
className: "ec-order-card ec-dashboard__card",
|
|
139
|
+
role: "region",
|
|
140
|
+
"aria-labelledby": "ec-account-downloads",
|
|
141
|
+
"data-account-downloads-count": "",
|
|
142
|
+
children: [
|
|
143
|
+
/* @__PURE__ */ jsx("h2", { id: "ec-account-downloads", className: "ec-dashboard__card-title", children: __("Downloads") }),
|
|
144
|
+
downloads > 0 ? /* @__PURE__ */ jsx("p", { children: trans_choice(":count download available|:count downloads available", downloads, {
|
|
145
|
+
count: downloads
|
|
146
|
+
}) }) : /* @__PURE__ */ jsx("p", { className: "ec-dashboard__muted", children: __("Files from your orders will appear here.") }),
|
|
147
|
+
null !== downloadsUrl ? /* @__PURE__ */ jsx(
|
|
148
|
+
Link,
|
|
149
|
+
{
|
|
150
|
+
href: downloadsUrl,
|
|
151
|
+
standalone: true,
|
|
152
|
+
trailingIcon: "chevron-right",
|
|
153
|
+
"data-account-link": "downloads",
|
|
154
|
+
children: __("Go to your downloads")
|
|
155
|
+
}
|
|
156
|
+
) : null
|
|
157
|
+
]
|
|
158
|
+
}
|
|
159
|
+
)
|
|
160
|
+
] }),
|
|
161
|
+
claimable > 0 && null !== claimUrl ? /* @__PURE__ */ jsx(Card, { className: "ec-dashboard__claim", "data-account-claim-prompt": "", children: /* @__PURE__ */ jsxs("div", { className: "ec-dashboard__claim-body", children: [
|
|
162
|
+
/* @__PURE__ */ jsx(Icon, { name: "package" }),
|
|
163
|
+
/* @__PURE__ */ jsxs("div", { className: "ec-dashboard__claim-text", children: [
|
|
164
|
+
/* @__PURE__ */ jsx("p", { className: "ec-dashboard__claim-title", children: trans_choice(
|
|
165
|
+
"We found :count order placed as a guest with your email|We found :count orders placed as a guest with your email",
|
|
166
|
+
claimable,
|
|
167
|
+
{ count: claimable }
|
|
168
|
+
) }),
|
|
169
|
+
/* @__PURE__ */ jsx("p", { className: "ec-dashboard__claim-description", children: __("Add them to your account to see them in your order history.") })
|
|
170
|
+
] }),
|
|
171
|
+
/* @__PURE__ */ jsx(Button, { variant: "outline", color: "neutral", size: "sm", href: claimUrl, children: __("Claim your orders") })
|
|
172
|
+
] }) }) : null,
|
|
173
|
+
null !== profileUrl || null !== passwordUrl ? /* @__PURE__ */ jsxs("div", { className: "ec-dashboard__links", "data-account-links": "", children: [
|
|
174
|
+
null !== profileUrl ? /* @__PURE__ */ jsx(
|
|
175
|
+
Button,
|
|
176
|
+
{
|
|
177
|
+
variant: "ghost",
|
|
178
|
+
color: "neutral",
|
|
179
|
+
size: "sm",
|
|
180
|
+
href: profileUrl,
|
|
181
|
+
leadingIcon: "pencil",
|
|
182
|
+
"data-account-host-link": "profile",
|
|
183
|
+
children: __("Edit your profile")
|
|
184
|
+
}
|
|
185
|
+
) : null,
|
|
186
|
+
null !== passwordUrl ? /* @__PURE__ */ jsx(
|
|
187
|
+
Button,
|
|
188
|
+
{
|
|
189
|
+
variant: "ghost",
|
|
190
|
+
color: "neutral",
|
|
191
|
+
size: "sm",
|
|
192
|
+
href: passwordUrl,
|
|
193
|
+
leadingIcon: "lock",
|
|
194
|
+
"data-account-host-link": "password",
|
|
195
|
+
children: __("Change your password")
|
|
196
|
+
}
|
|
197
|
+
) : null
|
|
198
|
+
] }) : null
|
|
199
|
+
] });
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
export {
|
|
203
|
+
AccountDashboard
|
|
204
|
+
};
|
|
205
|
+
//# sourceMappingURL=chunk-JJOPX4PI.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/account/AccountDashboard.tsx"],"sourcesContent":["/**\n * The account dashboard.\n *\n * Mirrors ecommerce-storefront-livewire's `account/dashboard`: the greeting\n * (the page's h1, else a lead paragraph), then the Recent orders Card (a\n * divided List, or the EmptyState with \"Start shopping\"), then three Cards\n * that stack below 768px (the default shipping and billing addresses and\n * the downloads), then the claim prompt and ghost links to edit the profile\n * and change the password.\n *\n * @since 1.0.0\n */\n\nimport {\n __,\n trans_choice,\n type AccountDashboardProps,\n} from '@artisanpack-ui/ecommerce-storefront-core';\nimport { Alert, Badge, Button, Card, Icon, Link, List, ListItem } from '@artisanpack-ui/react';\nimport type { ReactElement } from 'react';\n\nimport { Address } from '../components/Address';\nimport { EmptyState } from '../components/EmptyState';\nimport { Money } from '../components/Money';\n\n/**\n * Props for {@link AccountDashboard}.\n *\n * @since 1.0.0\n */\nexport interface AccountDashboardViewProps extends Omit<AccountDashboardProps, 'shell'> {\n /** The greeting; defaults to \"Welcome back, {name}.\" */\n greeting?: string | null;\n /** Draw the greeting as the page's h1; else a lead paragraph. */\n showTitle?: boolean;\n}\n\n/**\n * The dashboard.\n *\n * @since 1.0.0\n *\n * @param props - The dashboard's props.\n * @returns The dashboard.\n */\nexport function AccountDashboard({\n name,\n greeting = null,\n showTitle = true,\n orders,\n shippingAddress,\n billingAddress,\n billingSame,\n downloads,\n failed,\n claimable,\n claimUrl,\n ordersUrl,\n addressesUrl,\n downloadsUrl,\n catalogUrl,\n profileUrl,\n passwordUrl,\n}: AccountDashboardViewProps): ReactElement {\n const text =\n greeting ?? (null === name ? __('Welcome back.') : __('Welcome back, :name.', { name: name }));\n\n return (\n <div className=\"ec-dashboard\" data-account-dashboard=\"\">\n {showTitle ? (\n <h1 className=\"ec-dashboard__greeting\" data-account-greeting=\"\">\n {text}\n </h1>\n ) : (\n <p className=\"ec-dashboard__lead\" data-account-greeting=\"\">\n {text}\n </p>\n )}\n\n {failed ? (\n <Alert\n color=\"warning\"\n icon=\"triangle-alert\"\n title={__(\"Some of your account details couldn't be loaded\")}\n description={__('Try again in a moment.')}\n data-account-dashboard-failed=\"\"\n />\n ) : null}\n\n <Card\n className=\"ec-order-card ec-order-card--flush\"\n role=\"region\"\n aria-labelledby=\"ec-account-recent-orders\"\n data-account-recent-orders=\"\"\n >\n <div className=\"ec-dashboard__card-head\">\n <h2 id=\"ec-account-recent-orders\" className=\"ec-order-card__title\">\n {__('Recent orders')}\n </h2>\n\n {null !== ordersUrl && orders.length > 0 ? (\n <Link href={ordersUrl} standalone data-account-all-orders=\"\">\n {__('View all orders')}\n </Link>\n ) : null}\n </div>\n\n {0 === orders.length ? (\n <EmptyState\n icon=\"package\"\n title={__('No orders yet')}\n description={__('Orders you place will appear here.')}\n headingLevel={3}\n className=\"ec-dashboard__empty\"\n data-account-no-orders=\"\"\n >\n {null !== catalogUrl ? (\n <Button href={catalogUrl} color=\"primary\" size=\"sm\">\n {__('Start shopping')}\n </Button>\n ) : null}\n </EmptyState>\n ) : (\n <List variant=\"divided\" className=\"ec-dashboard__orders\">\n {orders.map((row) => {\n const label = __('Order :number', { number: row.number });\n\n return (\n <ListItem\n key={row.id}\n className=\"ec-dashboard__order\"\n data-account-recent-order={row.id}\n leading={<Icon name=\"package\" variant=\"tile\" color=\"neutral\" />}\n title={\n null !== row.url ? (\n <a href={row.url} className=\"ec-dashboard__order-link\">\n {label}\n </a>\n ) : (\n label\n )\n }\n description={\n <>\n {row.date}\n <span aria-hidden=\"true\"> · </span>\n <span className=\"apui-sr-only\">, </span>\n {trans_choice(':count item|:count items', row.items, { count: row.items })}\n </>\n }\n trailing={\n <span className=\"ec-dashboard__order-end\">\n <Badge color={row.color} size=\"sm\" data-order-status=\"\">\n {row.status}\n </Badge>\n <Money money={row.total} className=\"ec-dashboard__order-total\" />\n </span>\n }\n />\n );\n })}\n </List>\n )}\n </Card>\n\n <div className=\"ec-dashboard__cards\">\n <Card\n className=\"ec-order-card ec-dashboard__card\"\n role=\"region\"\n aria-labelledby=\"ec-account-default-shipping\"\n data-account-default-shipping=\"\"\n >\n <h2 id=\"ec-account-default-shipping\" className=\"ec-dashboard__card-title\">\n {__('Default shipping address')}\n </h2>\n\n {null !== shippingAddress ? (\n <Address lines={shippingAddress.lines} phone={shippingAddress.phone} />\n ) : (\n <p className=\"ec-dashboard__muted\">{__('None saved yet.')}</p>\n )}\n\n {null !== addressesUrl ? (\n <Link\n href={addressesUrl}\n standalone\n trailingIcon=\"chevron-right\"\n data-account-link=\"addresses\"\n >\n {__('Manage addresses')}\n </Link>\n ) : null}\n </Card>\n\n <Card\n className=\"ec-order-card ec-dashboard__card\"\n role=\"region\"\n aria-labelledby=\"ec-account-default-billing\"\n data-account-default-billing=\"\"\n >\n <h2 id=\"ec-account-default-billing\" className=\"ec-dashboard__card-title\">\n {__('Default billing address')}\n </h2>\n\n {null !== billingAddress && null !== shippingAddress && billingSame ? (\n <p data-account-billing-same=\"\">{__('Same as shipping')}</p>\n ) : null !== billingAddress ? (\n <Address lines={billingAddress.lines} phone={billingAddress.phone} />\n ) : (\n <p className=\"ec-dashboard__muted\">{__('None saved yet.')}</p>\n )}\n\n {null !== addressesUrl ? (\n <Link href={addressesUrl} standalone trailingIcon=\"chevron-right\">\n {__('Manage addresses')}\n </Link>\n ) : null}\n </Card>\n\n <Card\n className=\"ec-order-card ec-dashboard__card\"\n role=\"region\"\n aria-labelledby=\"ec-account-downloads\"\n data-account-downloads-count=\"\"\n >\n <h2 id=\"ec-account-downloads\" className=\"ec-dashboard__card-title\">\n {__('Downloads')}\n </h2>\n\n {downloads > 0 ? (\n <p>\n {trans_choice(':count download available|:count downloads available', downloads, {\n count: downloads,\n })}\n </p>\n ) : (\n <p className=\"ec-dashboard__muted\">{__('Files from your orders will appear here.')}</p>\n )}\n\n {null !== downloadsUrl ? (\n <Link\n href={downloadsUrl}\n standalone\n trailingIcon=\"chevron-right\"\n data-account-link=\"downloads\"\n >\n {__('Go to your downloads')}\n </Link>\n ) : null}\n </Card>\n </div>\n\n {claimable > 0 && null !== claimUrl ? (\n <Card className=\"ec-dashboard__claim\" data-account-claim-prompt=\"\">\n <div className=\"ec-dashboard__claim-body\">\n <Icon name=\"package\" />\n\n <div className=\"ec-dashboard__claim-text\">\n <p className=\"ec-dashboard__claim-title\">\n {trans_choice(\n 'We found :count order placed as a guest with your email|We found :count orders placed as a guest with your email',\n claimable,\n { count: claimable },\n )}\n </p>\n <p className=\"ec-dashboard__claim-description\">\n {__('Add them to your account to see them in your order history.')}\n </p>\n </div>\n\n <Button variant=\"outline\" color=\"neutral\" size=\"sm\" href={claimUrl}>\n {__('Claim your orders')}\n </Button>\n </div>\n </Card>\n ) : null}\n\n {null !== profileUrl || null !== passwordUrl ? (\n <div className=\"ec-dashboard__links\" data-account-links=\"\">\n {null !== profileUrl ? (\n <Button\n variant=\"ghost\"\n color=\"neutral\"\n size=\"sm\"\n href={profileUrl}\n leadingIcon=\"pencil\"\n data-account-host-link=\"profile\"\n >\n {__('Edit your profile')}\n </Button>\n ) : null}\n\n {null !== passwordUrl ? (\n <Button\n variant=\"ghost\"\n color=\"neutral\"\n size=\"sm\"\n href={passwordUrl}\n leadingIcon=\"lock\"\n data-account-host-link=\"password\"\n >\n {__('Change your password')}\n </Button>\n ) : null}\n </div>\n ) : null}\n </div>\n );\n}\n"],"mappings":";;;;;;;;;AAaA;AAAA,EACE;AAAA,EACA;AAAA,OAEK;AACP,SAAS,OAAO,OAAO,QAAQ,MAAM,MAAM,MAAM,MAAM,gBAAgB;AAoD/D,SAyEY,UAzEZ,KAyBA,YAzBA;AAzBD,SAAS,iBAAiB;AAAA,EAC/B;AAAA,EACA,WAAW;AAAA,EACX,YAAY;AAAA,EACZ;AAAA,EACA;AAAA,EACA;AAAA,EACA;A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SAAS,WACzB,oBAAC,QAAK,WAAU,uBAAsB,6BAA0B,IAC9D,+BAAC,SAAI,WAAU,4BACb;AAAA,0BAAC,QAAK,MAAK,WAAU;AAAA,MAErB,qBAAC,SAAI,WAAU,4BACb;AAAA,4BAAC,OAAE,WAAU,6BACV;AAAA,UACC;AAAA,UACA;AAAA,UACA,EAAE,OAAO,UAAU;AAAA,QACrB,GACF;AAAA,QACA,oBAAC,OAAE,WAAU,mCACV,aAAG,6DAA6D,GACnE;AAAA,SACF;AAAA,MAEA,oBAAC,UAAO,SAAQ,WAAU,OAAM,WAAU,MAAK,MAAK,MAAM,UACvD,aAAG,mBAAmB,GACzB;AAAA,OACF,GACF,IACE;AAAA,IAEH,SAAS,cAAc,SAAS,cAC/B,qBAAC,SAAI,WAAU,uBAAsB,sBAAmB,IACrD;AAAA,eAAS,aACR;AAAA,QAAC;AAAA;AAAA,UACC,SAAQ;AAAA,UACR,OAAM;AAAA,UACN,MAAK;AAAA,UACL,MAAM;AAAA,UACN,aAAY;AAAA,UACZ,0BAAuB;AAAA,UAEtB,aAAG,mBAAmB;AAAA;AAAA,MACzB,IACE;AAAA,MAEH,SAAS,cACR;AAAA,QAAC;AAAA;AAAA,UACC,SAAQ;AAAA,UACR,OAAM;AAAA,UACN,MAAK;AAAA,UACL,MAAM;AAAA,UACN,aAAY;AAAA,UACZ,0BAAuB;AAAA,UAEtB,aAAG,sBAAsB;AAAA;AAAA,MAC5B,IACE;AAAA,OACN,IACE;AAAA,KACN;AAEJ;","names":[]}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CatalogListing,
|
|
3
|
+
StorefrontBreadcrumbs
|
|
4
|
+
} from "./chunk-P3NIV4YG.mjs";
|
|
5
|
+
import {
|
|
6
|
+
storefrontLayout
|
|
7
|
+
} from "./chunk-VX5TEJNU.mjs";
|
|
8
|
+
|
|
9
|
+
// src/pages/Catalog/TagShow.tsx
|
|
10
|
+
import { __ } from "@artisanpack-ui/ecommerce-storefront-core";
|
|
11
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
12
|
+
function CatalogTagShow({
|
|
13
|
+
tag,
|
|
14
|
+
listing,
|
|
15
|
+
headingLevel = 1
|
|
16
|
+
}) {
|
|
17
|
+
const Heading = 2 === headingLevel ? "h2" : "h1";
|
|
18
|
+
return /* @__PURE__ */ jsxs("div", { className: "ec-page", "data-tag-page": tag.id, children: [
|
|
19
|
+
tag.breadcrumbs.length > 0 ? /* @__PURE__ */ jsx(StorefrontBreadcrumbs, { items: tag.breadcrumbs }) : null,
|
|
20
|
+
/* @__PURE__ */ jsx("div", { className: "apui-card ec-category-hero", "data-surface": "default", "data-tag-header": "", children: /* @__PURE__ */ jsxs("div", { className: "ec-category-hero__body", children: [
|
|
21
|
+
/* @__PURE__ */ jsx("p", { className: "ec-category-hero__eyebrow", children: __("Tag") }),
|
|
22
|
+
/* @__PURE__ */ jsx(Heading, { className: "ec-category-hero__title", children: tag.name })
|
|
23
|
+
] }) }),
|
|
24
|
+
/* @__PURE__ */ jsx(CatalogListing, { listing }, tag.id)
|
|
25
|
+
] });
|
|
26
|
+
}
|
|
27
|
+
CatalogTagShow.layout = storefrontLayout;
|
|
28
|
+
|
|
29
|
+
export {
|
|
30
|
+
CatalogTagShow
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=chunk-LT3GG7YQ.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/pages/Catalog/TagShow.tsx"],"sourcesContent":["/**\n * `EcommerceStorefront/Catalog/TagShow`: a tag page.\n *\n * Mirrors ecommerce-storefront-livewire's `Catalog/TagShow`: the category\n * page's layout without its image half and chips (the breadcrumbs, a card\n * with the \"Tag\" eyebrow and the tag's name), then the listing for the tag.\n *\n * @since 1.0.0\n */\n\nimport { __, type CatalogTagShowPageProps } from '@artisanpack-ui/ecommerce-storefront-core';\nimport type { ReactElement } from 'react';\n\nimport { CatalogListing } from '../../catalog/CatalogListing';\nimport { StorefrontBreadcrumbs } from '../../catalog/StorefrontBreadcrumbs';\nimport { storefrontLayout } from '../../layout/StorefrontLayout';\n\n/**\n * A tag page.\n *\n * @since 1.0.0\n *\n * @param props - The page's props.\n * @returns The page.\n */\nexport default function CatalogTagShow({\n tag,\n listing,\n headingLevel = 1,\n}: CatalogTagShowPageProps & {\n /** 2 under a template's own `<h1>` (the Product Catalog block). */\n headingLevel?: 1 | 2;\n}): ReactElement {\n const Heading = 2 === headingLevel ? 'h2' : 'h1';\n\n return (\n <div className=\"ec-page\" data-tag-page={tag.id}>\n {tag.breadcrumbs.length > 0 ? <StorefrontBreadcrumbs items={tag.breadcrumbs} /> : null}\n\n <div className=\"apui-card ec-category-hero\" data-surface=\"default\" data-tag-header=\"\">\n <div className=\"ec-category-hero__body\">\n <p className=\"ec-category-hero__eyebrow\">{__('Tag')}</p>\n <Heading className=\"ec-category-hero__title\">{tag.name}</Heading>\n </div>\n </div>\n\n <CatalogListing key={tag.id} listing={listing} />\n </div>\n );\n}\n\nCatalogTagShow.layout = storefrontLayout;\n"],"mappings":";;;;;;;;;AAUA,SAAS,UAAwC;AA2Bb,cAG5B,YAH4B;AAZrB,SAAR,eAAgC;AAAA,EACrC;AAAA,EACA;AAAA,EACA,eAAe;AACjB,GAGiB;AACf,QAAM,UAAU,MAAM,eAAe,OAAO;AAE5C,SACE,qBAAC,SAAI,WAAU,WAAU,iBAAe,IAAI,IACzC;AAAA,QAAI,YAAY,SAAS,IAAI,oBAAC,yBAAsB,OAAO,IAAI,aAAa,IAAK;AAAA,IAElF,oBAAC,SAAI,WAAU,8BAA6B,gBAAa,WAAU,mBAAgB,IACjF,+BAAC,SAAI,WAAU,0BACb;AAAA,0BAAC,OAAE,WAAU,6BAA6B,aAAG,KAAK,GAAE;AAAA,MACpD,oBAAC,WAAQ,WAAU,2BAA2B,cAAI,MAAK;AAAA,OACzD,GACF;AAAA,IAEA,oBAAC,kBAA4B,WAAR,IAAI,EAAsB;AAAA,KACjD;AAEJ;AAEA,eAAe,SAAS;","names":[]}
|