@plasmicpkgs/commerce-local 0.0.209 → 0.0.211
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/dist/commerce-local.cjs.development.js +64 -76
- package/dist/commerce-local.cjs.development.js.map +1 -1
- package/dist/commerce-local.cjs.production.min.js +1 -1
- package/dist/commerce-local.cjs.production.min.js.map +1 -1
- package/dist/commerce-local.esm.js +64 -76
- package/dist/commerce-local.esm.js.map +1 -1
- package/package.json +4 -4
|
@@ -2233,6 +2233,62 @@ var data = {
|
|
|
2233
2233
|
products: products
|
|
2234
2234
|
};
|
|
2235
2235
|
|
|
2236
|
+
function _arrayLikeToArray(r, a) {
|
|
2237
|
+
(null == a || a > r.length) && (a = r.length);
|
|
2238
|
+
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
2239
|
+
return n;
|
|
2240
|
+
}
|
|
2241
|
+
function asyncGeneratorStep(n, t, e, r, o, a, c) {
|
|
2242
|
+
try {
|
|
2243
|
+
var i = n[a](c),
|
|
2244
|
+
u = i.value;
|
|
2245
|
+
} catch (n) {
|
|
2246
|
+
return void e(n);
|
|
2247
|
+
}
|
|
2248
|
+
i.done ? t(u) : Promise.resolve(u).then(r, o);
|
|
2249
|
+
}
|
|
2250
|
+
function _asyncToGenerator(n) {
|
|
2251
|
+
return function () {
|
|
2252
|
+
var t = this,
|
|
2253
|
+
e = arguments;
|
|
2254
|
+
return new Promise(function (r, o) {
|
|
2255
|
+
var a = n.apply(t, e);
|
|
2256
|
+
function _next(n) {
|
|
2257
|
+
asyncGeneratorStep(a, r, o, _next, _throw, "next", n);
|
|
2258
|
+
}
|
|
2259
|
+
function _throw(n) {
|
|
2260
|
+
asyncGeneratorStep(a, r, o, _next, _throw, "throw", n);
|
|
2261
|
+
}
|
|
2262
|
+
_next(void 0);
|
|
2263
|
+
});
|
|
2264
|
+
};
|
|
2265
|
+
}
|
|
2266
|
+
function _createForOfIteratorHelperLoose(r, e) {
|
|
2267
|
+
var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
2268
|
+
if (t) return (t = t.call(r)).next.bind(t);
|
|
2269
|
+
if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) {
|
|
2270
|
+
t && (r = t);
|
|
2271
|
+
var o = 0;
|
|
2272
|
+
return function () {
|
|
2273
|
+
return o >= r.length ? {
|
|
2274
|
+
done: !0
|
|
2275
|
+
} : {
|
|
2276
|
+
done: !1,
|
|
2277
|
+
value: r[o++]
|
|
2278
|
+
};
|
|
2279
|
+
};
|
|
2280
|
+
}
|
|
2281
|
+
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
2282
|
+
}
|
|
2283
|
+
function _extends() {
|
|
2284
|
+
return _extends = Object.assign ? Object.assign.bind() : function (n) {
|
|
2285
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
2286
|
+
var t = arguments[e];
|
|
2287
|
+
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
2288
|
+
}
|
|
2289
|
+
return n;
|
|
2290
|
+
}, _extends.apply(null, arguments);
|
|
2291
|
+
}
|
|
2236
2292
|
function _regeneratorRuntime() {
|
|
2237
2293
|
_regeneratorRuntime = function () {
|
|
2238
2294
|
return e;
|
|
@@ -2341,7 +2397,7 @@ function _regeneratorRuntime() {
|
|
|
2341
2397
|
function makeInvokeMethod(e, r, n) {
|
|
2342
2398
|
var o = h;
|
|
2343
2399
|
return function (i, a) {
|
|
2344
|
-
if (o === f) throw
|
|
2400
|
+
if (o === f) throw Error("Generator is already running");
|
|
2345
2401
|
if (o === s) {
|
|
2346
2402
|
if ("throw" === i) throw a;
|
|
2347
2403
|
return {
|
|
@@ -2483,7 +2539,7 @@ function _regeneratorRuntime() {
|
|
|
2483
2539
|
} else if (c) {
|
|
2484
2540
|
if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
|
|
2485
2541
|
} else {
|
|
2486
|
-
if (!u) throw
|
|
2542
|
+
if (!u) throw Error("try statement without catch or finally");
|
|
2487
2543
|
if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
|
|
2488
2544
|
}
|
|
2489
2545
|
}
|
|
@@ -2523,7 +2579,7 @@ function _regeneratorRuntime() {
|
|
|
2523
2579
|
return o;
|
|
2524
2580
|
}
|
|
2525
2581
|
}
|
|
2526
|
-
throw
|
|
2582
|
+
throw Error("illegal catch attempt");
|
|
2527
2583
|
},
|
|
2528
2584
|
delegateYield: function (e, r, n) {
|
|
2529
2585
|
return this.delegate = {
|
|
@@ -2534,80 +2590,12 @@ function _regeneratorRuntime() {
|
|
|
2534
2590
|
}
|
|
2535
2591
|
}, e;
|
|
2536
2592
|
}
|
|
2537
|
-
function
|
|
2538
|
-
|
|
2539
|
-
|
|
2540
|
-
var
|
|
2541
|
-
|
|
2542
|
-
reject(error);
|
|
2543
|
-
return;
|
|
2544
|
-
}
|
|
2545
|
-
if (info.done) {
|
|
2546
|
-
resolve(value);
|
|
2547
|
-
} else {
|
|
2548
|
-
Promise.resolve(value).then(_next, _throw);
|
|
2549
|
-
}
|
|
2550
|
-
}
|
|
2551
|
-
function _asyncToGenerator(fn) {
|
|
2552
|
-
return function () {
|
|
2553
|
-
var self = this,
|
|
2554
|
-
args = arguments;
|
|
2555
|
-
return new Promise(function (resolve, reject) {
|
|
2556
|
-
var gen = fn.apply(self, args);
|
|
2557
|
-
function _next(value) {
|
|
2558
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
2559
|
-
}
|
|
2560
|
-
function _throw(err) {
|
|
2561
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
2562
|
-
}
|
|
2563
|
-
_next(undefined);
|
|
2564
|
-
});
|
|
2565
|
-
};
|
|
2566
|
-
}
|
|
2567
|
-
function _extends() {
|
|
2568
|
-
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
2569
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
2570
|
-
var source = arguments[i];
|
|
2571
|
-
for (var key in source) {
|
|
2572
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
2573
|
-
target[key] = source[key];
|
|
2574
|
-
}
|
|
2575
|
-
}
|
|
2576
|
-
}
|
|
2577
|
-
return target;
|
|
2578
|
-
};
|
|
2579
|
-
return _extends.apply(this, arguments);
|
|
2580
|
-
}
|
|
2581
|
-
function _unsupportedIterableToArray(o, minLen) {
|
|
2582
|
-
if (!o) return;
|
|
2583
|
-
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
2584
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
2585
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
2586
|
-
if (n === "Map" || n === "Set") return Array.from(o);
|
|
2587
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
2588
|
-
}
|
|
2589
|
-
function _arrayLikeToArray(arr, len) {
|
|
2590
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
2591
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
2592
|
-
return arr2;
|
|
2593
|
-
}
|
|
2594
|
-
function _createForOfIteratorHelperLoose(o, allowArrayLike) {
|
|
2595
|
-
var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
|
|
2596
|
-
if (it) return (it = it.call(o)).next.bind(it);
|
|
2597
|
-
if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
|
|
2598
|
-
if (it) o = it;
|
|
2599
|
-
var i = 0;
|
|
2600
|
-
return function () {
|
|
2601
|
-
if (i >= o.length) return {
|
|
2602
|
-
done: true
|
|
2603
|
-
};
|
|
2604
|
-
return {
|
|
2605
|
-
done: false,
|
|
2606
|
-
value: o[i++]
|
|
2607
|
-
};
|
|
2608
|
-
};
|
|
2593
|
+
function _unsupportedIterableToArray(r, a) {
|
|
2594
|
+
if (r) {
|
|
2595
|
+
if ("string" == typeof r) return _arrayLikeToArray(r, a);
|
|
2596
|
+
var t = {}.toString.call(r).slice(8, -1);
|
|
2597
|
+
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
|
|
2609
2598
|
}
|
|
2610
|
-
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
2611
2599
|
}
|
|
2612
2600
|
|
|
2613
2601
|
var fetcher = /*#__PURE__*/function () {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commerce-local.cjs.development.js","sources":["../src/fetcher.ts","../src/const.ts","../src/utils/cart.ts","../src/cart/use-cart.tsx","../src/cart/use-add-item.tsx","../src/cart/use-update-item.tsx","../src/cart/use-remove-item.tsx","../src/utils/sort-product.ts","../src/product/use-search.tsx","../src/product/use-product.tsx","../src/site/use-categories.ts","../src/site/use-brands.ts","../src/provider.ts","../src/local.ts","../src/registerCommerceProvider.tsx","../src/index.tsx"],"sourcesContent":["import { Fetcher } from '@plasmicpkgs/commerce';\n\nexport const fetcher: Fetcher = async () => {\n console.log('FETCHER')\n const res = await fetch('./data.json')\n if (res.ok) {\n const { data } = await res.json()\n return data\n }\n throw res\n}\n","export const LOCAL_CART_OBJ = \"localCartObj\";\n\nexport const LOCAL_CART_ID = \"localCartId\";\n","import { CartType } from \"@plasmicpkgs/commerce\";\nimport Cookies from \"js-cookie\";\nimport { LOCAL_CART_ID, LOCAL_CART_OBJ } from \"../const\";\n\nconst options: Cookies.CookieAttributes = {\n sameSite: \"none\",\n secure: true,\n};\n\nexport const createCart: () => CartType.Cart = () => {\n const cart = {\n id: \"\",\n createdAt: \"\",\n currency: { code: \"USD\" },\n taxesIncluded: false,\n lineItems: [],\n lineItemsSubtotalPrice: 0,\n subtotalPrice: 0,\n totalPrice: 0,\n };\n\n const cartId = Date.now().toString();\n\n Cookies.set(LOCAL_CART_ID, cartId);\n Cookies.set(\n LOCAL_CART_OBJ,\n JSON.stringify({\n id: cartId,\n cart,\n })\n );\n\n return cart;\n};\n\nexport const getCart: (cartId?: string) => CartType.Cart = (\n cartId?: string\n) => {\n cartId = cartId ?? Cookies.get(LOCAL_CART_ID);\n const cartStr = Cookies.get(LOCAL_CART_OBJ);\n const cart = cartStr ? JSON.parse(cartStr) : undefined;\n\n if (!cart || cart.id !== cartId) {\n return createCart();\n } else {\n return cart.cart;\n }\n};\n\nexport const cartUpdate = (newCart: CartType.Cart) => {\n Cookies.set(\n LOCAL_CART_OBJ,\n JSON.stringify({\n id: Cookies.get(LOCAL_CART_ID),\n cart: newCart,\n })\n );\n\n return newCart;\n};\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes:\n - Before: just returned an empty cart.\n - Now: Read cart from local storage.\n*/\nimport { SWRHook, useCart, UseCart } from \"@plasmicpkgs/commerce\";\nimport React from \"react\";\nimport { getCart } from \"../utils/cart\";\n\nexport default useCart as UseCart<typeof handler>;\n\nexport const handler: SWRHook<any> = {\n fetchOptions: {\n query: \"use-cart\",\n },\n async fetcher({ input, options, fetch }) {\n return getCart(input.cartId);\n },\n useHook: ({ useData }) => (input) => {\n const response = useData({\n swrOptions: { revalidateOnFocus: false, ...input?.swrOptions },\n });\n return React.useMemo(\n () =>\n Object.create(response, {\n isEmpty: {\n get() {\n return (response.data?.lineItems.length ?? 0) <= 0;\n },\n enumerable: true,\n },\n }),\n [response]\n );\n },\n};\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes:\n - Implemented a local cart\n - The items are added to local storage.\n*/\nimport {\n CommerceError,\n MutationHook,\n useAddItem,\n UseAddItem,\n} from \"@plasmicpkgs/commerce\";\nimport { useCallback } from \"react\";\nimport data from \"../data.json\";\nimport { cartUpdate, getCart } from \"../utils/cart\";\nimport useCart from \"./use-cart\";\n\nexport default useAddItem as UseAddItem<typeof handler>;\nexport const handler: MutationHook<any> = {\n fetchOptions: {\n query: \"use-add-item\",\n },\n async fetcher({ input: item, options, fetch }) {\n if (\n item.quantity &&\n (!Number.isInteger(item.quantity) || item.quantity! < 1)\n ) {\n throw new CommerceError({\n message: \"The item quantity has to be a valid integer greater than 0\",\n });\n }\n\n const lineItem = {\n variantId: item.variantId,\n quantity: item.quantity ?? 1,\n };\n\n const cart = getCart();\n for (const product of data.products) {\n const variant = (product.variants as any[]).find(\n (variant) => variant.id === item.variantId\n );\n if (variant) {\n cart.totalPrice += variant.price * (item.quantity ?? 1);\n cart.currency.code = product.price.currencyCode;\n const currentLineItem = cart.lineItems.find(\n (item) => item.variantId === lineItem.variantId\n );\n if (!currentLineItem) {\n cart.lineItems.push(lineItem as any);\n } else {\n currentLineItem.quantity += lineItem.quantity;\n }\n }\n }\n\n return cartUpdate(cart);\n },\n useHook: ({ fetch }) => () => {\n const { mutate } = useCart();\n return useCallback(\n async function addItem(input) {\n const data = await fetch({ input });\n await mutate(data, false);\n return data;\n },\n [fetch, mutate]\n );\n },\n};\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes: None\n*/\nimport { MutationHook } from '@plasmicpkgs/commerce'\nimport { useUpdateItem,\n UseUpdateItem,\n} from '@plasmicpkgs/commerce'\n\nexport default useUpdateItem as UseUpdateItem<any>\n\nexport const handler: MutationHook<any> = {\n fetchOptions: {\n query: '',\n },\n async fetcher({ input, options, fetch }) {},\n useHook:\n ({ fetch }) =>\n () => {\n return async function addItem() {\n return {}\n }\n },\n}\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes: None\n*/\nimport { MutationHook } from '@plasmicpkgs/commerce'\nimport {useRemoveItem,\n UseRemoveItem,\n} from '@plasmicpkgs/commerce'\n\nexport default useRemoveItem as UseRemoveItem<typeof handler>\n\nexport const handler: MutationHook<any> = {\n fetchOptions: {\n query: '',\n },\n async fetcher({ input, options, fetch }) {},\n useHook:\n ({ fetch }) =>\n () => {\n return async function removeItem(input) {\n return {}\n }\n },\n}\n","import data from \"../data.json\";\n\nexport const sortProduct = (\n a: typeof data.products[0],\n b: typeof data.products[0],\n sortKey: string\n) => {\n switch (sortKey) {\n case \"price-asc\":\n return a.price.value < b.price.value ? -1 : 1;\n case \"price-desc\":\n return a.price.value < b.price.value ? 1 : -1;\n case \"trending-desc\":\n return a.id.localeCompare(b.id);\n case \"latest-desc\":\n return a.id.localeCompare(b.id) * -1;\n default:\n return 0;\n }\n};\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes: None\n*/\nimport { SWRHook, useSearch, UseSearch } from \"@plasmicpkgs/commerce\";\nimport data from \"../data.json\";\nimport { sortProduct } from \"../utils/sort-product\";\nconst useSearchTyped: UseSearch<typeof handler> = useSearch;\nexport default useSearchTyped;\n\nexport const handler: SWRHook<any> = {\n fetchOptions: {\n query: \"use-search\",\n },\n async fetcher({ input, options, fetch }) {\n const { search, categoryId, brandId, sort, count } = input;\n\n let products = data.products;\n\n if (categoryId) {\n const category = data.categories.find(\n (category) => category.id === categoryId\n );\n products = data.products.filter((product) =>\n category?.products?.includes(product.id)\n );\n }\n\n if (brandId) {\n products = products.filter(\n (product) =>\n product.vendor.replace(/\\s+/g, \"-\").toLowerCase() ===\n `${brandId}`.toLowerCase()\n );\n }\n\n if (search) {\n products = products.filter(\n (product) =>\n product.name.toLowerCase().includes(`${search}`.toLowerCase()) ||\n product.slug.toLowerCase().includes(`${search}`.toLowerCase())\n );\n }\n\n if (sort) {\n products = products.sort((a, b) => sortProduct(a, b, sort));\n }\n\n return {\n products: products.slice(0, count),\n found: products.length > 0,\n };\n },\n useHook:\n ({ useData }) =>\n (input = {}) => {\n return useData({\n input: [\n [\"search\", input.search],\n [\"prefixSearch\", input.prefixSearch],\n [\"categoryId\", input.categoryId],\n [\"brandId\", input.brandId],\n [\"sort\", input.sort],\n [\"locale\", input.locale],\n [\"count\", input.count],\n ],\n swrOptions: {\n revalidateOnFocus: false,\n ...input.swrOptions,\n },\n });\n },\n};\n","import { SWRHook, useProduct, UseProduct } from \"@plasmicpkgs/commerce\";\nimport data from \"../data.json\";\nexport default useProduct as UseProduct<typeof handler>;\n\nexport const handler: SWRHook<any> = {\n fetchOptions: {\n query: \"use-product\",\n },\n async fetcher({ input, options, fetch }) {\n const { id } = input;\n\n return (\n data.products.find((product) =>\n [product.id, product.slug].includes(id)\n ) ?? null\n );\n },\n useHook: ({ useData }) => (input = {}) => {\n return useData({\n input: [[\"id\", input.id]],\n swrOptions: {\n revalidateOnFocus: false,\n ...input.swrOptions,\n },\n });\n },\n};\n","import { SWRHook, useCategories, UseCategories } from \"@plasmicpkgs/commerce\";\nimport React from \"react\";\nimport data from \"../data.json\";\nexport default useCategories as UseCategories<typeof handler>;\n\nexport const handler: SWRHook<any> = {\n fetchOptions: {\n query: \"use-categories\",\n },\n async fetcher({ input, options, fetch }) {\n const { categoryId } = input;\n if (!categoryId) {\n return data.categories;\n }\n const category = data.categories.find(\n (category) => category.id === categoryId\n );\n return category ? [category] : [];\n },\n useHook: ({ useData }) => (input) => {\n const response = useData({\n input: [[\"categoryId\", input?.categoryId]],\n swrOptions: { revalidateOnFocus: false, ...input?.swrOptions },\n });\n return React.useMemo(\n () =>\n Object.create(response, {\n isEmpty: {\n get() {\n return (response.data?.length ?? 0) <= 0;\n },\n enumerable: true,\n },\n }),\n [response]\n );\n },\n};\n","import { SWRHook, useBrands, UseBrands } from \"@plasmicpkgs/commerce\";\nimport React from \"react\";\nimport data from \"../data.json\";\nexport default useBrands as UseBrands<typeof handler>;\n\nexport const handler: SWRHook<any> = {\n fetchOptions: {\n query: \"use-brands\",\n },\n async fetcher({ input, options, fetch }) {\n const vendorsStrings = data.products.map((product) => product.vendor);\n return Array.from(new Set(vendorsStrings).values()).map((v) => {\n const id = v.replace(/\\s+/g, \"-\").toLowerCase();\n return {\n entityId: id,\n name: v,\n path: `brands/${id}`,\n };\n });\n },\n useHook: ({ useData }) => (input) => {\n const response = useData({\n swrOptions: { revalidateOnFocus: false, ...input?.swrOptions },\n });\n return React.useMemo(\n () =>\n Object.create(response, {\n isEmpty: {\n get() {\n return (response.data?.length ?? 0) <= 0;\n },\n enumerable: true,\n },\n }),\n [response]\n );\n },\n};\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes: Removed authentication, customer and wishlist hooks\n*/\nimport { fetcher } from './fetcher'\nimport { handler as useCart } from './cart/use-cart'\nimport { handler as useAddItem } from './cart/use-add-item'\nimport { handler as useUpdateItem } from './cart/use-update-item'\nimport { handler as useRemoveItem } from './cart/use-remove-item'\nimport { handler as useSearch } from './product/use-search'\nimport { handler as useProduct } from './product/use-product'\nimport { handler as useCategories } from './site/use-categories'\nimport { handler as useBrands } from './site/use-brands'\nimport { LOCAL_CART_ID } from './const'\nexport const localProvider = {\n locale: 'en-us',\n cartCookie: LOCAL_CART_ID,\n fetcher: fetcher,\n cart: { useCart, useAddItem, useUpdateItem, useRemoveItem },\n products: { useSearch, useProduct },\n site: { useCategories, useBrands }\n}\n\nexport type LocalProvider = typeof localProvider\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes: Add export data\n*/\nexport * from \"./registerable\";\nexport { localProvider, data };\nexport type { LocalProvider };\nimport {\n getCommerceProvider,\n useCommerce as useCoreCommerce,\n} from \"@plasmicpkgs/commerce\";\nimport data from \"./data.json\";\nimport { localProvider, LocalProvider } from \"./provider\";\n\nexport const CommerceProvider = getCommerceProvider(localProvider);\n\nexport const useCommerce = () => useCoreCommerce<LocalProvider>();\n","import { GlobalContextMeta } from \"@plasmicapp/host\";\nimport registerGlobalContext from \"@plasmicapp/host/registerGlobalContext\";\nimport React from \"react\";\nimport { CommerceProvider } from \"./local\";\nimport { Registerable } from \"./registerable\";\n\ninterface CommerceProviderProps {\n children?: React.ReactNode;\n}\n\nexport const commerceProviderMeta: GlobalContextMeta<CommerceProviderProps> = {\n name: \"plasmic-commerce-local-provider\",\n displayName: \"Local Provider\",\n props: {},\n importPath: \"@plasmicpkgs/commerce-local\",\n importName: \"CommerceProviderComponent\",\n};\n\nfunction CommerceProviderComponent(props: CommerceProviderProps) {\n return <CommerceProvider>{props.children}</CommerceProvider>;\n}\n\nexport function registerCommerceProvider(\n loader?: Registerable,\n customCommerceProviderMeta?: GlobalContextMeta<CommerceProviderProps>\n) {\n const doRegisterComponent: typeof registerGlobalContext = (...args) =>\n loader\n ? loader.registerGlobalContext(...args)\n : registerGlobalContext(...args);\n doRegisterComponent(\n CommerceProviderComponent,\n customCommerceProviderMeta ?? commerceProviderMeta\n );\n}\n","import { Registerable } from \"./registerable\";\nimport { registerCommerceProvider } from \"./registerCommerceProvider\";\nexport * from \"./registerable\";\n\nexport * from \"./local\";\n\nexport function registerAll(loader?: Registerable) {\n registerCommerceProvider(loader);\n}\n\nexport { registerCommerceProvider };"],"names":["fetcher","_ref","_asyncToGenerator","_regeneratorRuntime","mark","_callee","res","_yield$res$json","data","wrap","_callee$","_context","prev","next","console","log","fetch","sent","ok","json","abrupt","stop","apply","arguments","LOCAL_CART_OBJ","LOCAL_CART_ID","createCart","cart","id","createdAt","currency","code","taxesIncluded","lineItems","lineItemsSubtotalPrice","subtotalPrice","totalPrice","cartId","Date","now","toString","Cookies","set","JSON","stringify","getCart","_cartId","get","cartStr","parse","undefined","cartUpdate","newCart","handler","fetchOptions","query","input","options","useHook","_ref2","useData","response","swrOptions","_extends","revalidateOnFocus","React","useMemo","Object","create","isEmpty","_response$data$lineIt","_response$data","length","enumerable","item","quantity","Number","isInteger","CommerceError","message","lineItem","variantId","_item$quantity","_iterator","_createForOfIteratorHelperLoose","products","_step","done","product","value","variant","variants","find","price","_item$quantity2","currencyCode","currentLineItem","push","_useCart","useCart","mutate","useCallback","_addItem","_callee2","_callee2$","_context2","addItem","_x","_removeItem","removeItem","sortProduct","a","b","sortKey","localeCompare","search","categoryId","brandId","sort","count","category","categories","filter","_category$products","includes","vendor","replace","toLowerCase","name","slug","slice","found","prefixSearch","locale","_data$products$find","_response$data$length","vendorsStrings","map","Array","from","Set","values","v","entityId","path","localProvider","cartCookie","useAddItem","useUpdateItem","useRemoveItem","useSearch","useProduct","site","useCategories","useBrands","CommerceProvider","getCommerceProvider","useCommerce","useCoreCommerce","commerceProviderMeta","displayName","props","importPath","importName","CommerceProviderComponent","children","registerCommerceProvider","loader","customCommerceProviderMeta","doRegisterComponent","registerGlobalContext","registerAll"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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/const.ts","../src/utils/cart.ts","../src/cart/use-cart.tsx","../src/cart/use-add-item.tsx","../src/cart/use-update-item.tsx","../src/cart/use-remove-item.tsx","../src/utils/sort-product.ts","../src/product/use-search.tsx","../src/product/use-product.tsx","../src/site/use-categories.ts","../src/site/use-brands.ts","../src/provider.ts","../src/local.ts","../src/registerCommerceProvider.tsx","../src/index.tsx"],"sourcesContent":["import { Fetcher } from '@plasmicpkgs/commerce';\n\nexport const fetcher: Fetcher = async () => {\n console.log('FETCHER')\n const res = await fetch('./data.json')\n if (res.ok) {\n const { data } = await res.json()\n return data\n }\n throw res\n}\n","export const LOCAL_CART_OBJ = \"localCartObj\";\n\nexport const LOCAL_CART_ID = \"localCartId\";\n","import { CartType } from \"@plasmicpkgs/commerce\";\nimport Cookies from \"js-cookie\";\nimport { LOCAL_CART_ID, LOCAL_CART_OBJ } from \"../const\";\n\nconst options: Cookies.CookieAttributes = {\n sameSite: \"none\",\n secure: true,\n};\n\nexport const createCart: () => CartType.Cart = () => {\n const cart = {\n id: \"\",\n createdAt: \"\",\n currency: { code: \"USD\" },\n taxesIncluded: false,\n lineItems: [],\n lineItemsSubtotalPrice: 0,\n subtotalPrice: 0,\n totalPrice: 0,\n };\n\n const cartId = Date.now().toString();\n\n Cookies.set(LOCAL_CART_ID, cartId);\n Cookies.set(\n LOCAL_CART_OBJ,\n JSON.stringify({\n id: cartId,\n cart,\n })\n );\n\n return cart;\n};\n\nexport const getCart: (cartId?: string) => CartType.Cart = (\n cartId?: string\n) => {\n cartId = cartId ?? Cookies.get(LOCAL_CART_ID);\n const cartStr = Cookies.get(LOCAL_CART_OBJ);\n const cart = cartStr ? JSON.parse(cartStr) : undefined;\n\n if (!cart || cart.id !== cartId) {\n return createCart();\n } else {\n return cart.cart;\n }\n};\n\nexport const cartUpdate = (newCart: CartType.Cart) => {\n Cookies.set(\n LOCAL_CART_OBJ,\n JSON.stringify({\n id: Cookies.get(LOCAL_CART_ID),\n cart: newCart,\n })\n );\n\n return newCart;\n};\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes:\n - Before: just returned an empty cart.\n - Now: Read cart from local storage.\n*/\nimport { SWRHook, useCart, UseCart } from \"@plasmicpkgs/commerce\";\nimport React from \"react\";\nimport { getCart } from \"../utils/cart\";\n\nexport default useCart as UseCart<typeof handler>;\n\nexport const handler: SWRHook<any> = {\n fetchOptions: {\n query: \"use-cart\",\n },\n async fetcher({ input, options, fetch }) {\n return getCart(input.cartId);\n },\n useHook: ({ useData }) => (input) => {\n const response = useData({\n swrOptions: { revalidateOnFocus: false, ...input?.swrOptions },\n });\n return React.useMemo(\n () =>\n Object.create(response, {\n isEmpty: {\n get() {\n return (response.data?.lineItems.length ?? 0) <= 0;\n },\n enumerable: true,\n },\n }),\n [response]\n );\n },\n};\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes:\n - Implemented a local cart\n - The items are added to local storage.\n*/\nimport {\n CommerceError,\n MutationHook,\n useAddItem,\n UseAddItem,\n} from \"@plasmicpkgs/commerce\";\nimport { useCallback } from \"react\";\nimport data from \"../data.json\";\nimport { cartUpdate, getCart } from \"../utils/cart\";\nimport useCart from \"./use-cart\";\n\nexport default useAddItem as UseAddItem<typeof handler>;\nexport const handler: MutationHook<any> = {\n fetchOptions: {\n query: \"use-add-item\",\n },\n async fetcher({ input: item, options, fetch }) {\n if (\n item.quantity &&\n (!Number.isInteger(item.quantity) || item.quantity! < 1)\n ) {\n throw new CommerceError({\n message: \"The item quantity has to be a valid integer greater than 0\",\n });\n }\n\n const lineItem = {\n variantId: item.variantId,\n quantity: item.quantity ?? 1,\n };\n\n const cart = getCart();\n for (const product of data.products) {\n const variant = (product.variants as any[]).find(\n (variant) => variant.id === item.variantId\n );\n if (variant) {\n cart.totalPrice += variant.price * (item.quantity ?? 1);\n cart.currency.code = product.price.currencyCode;\n const currentLineItem = cart.lineItems.find(\n (item) => item.variantId === lineItem.variantId\n );\n if (!currentLineItem) {\n cart.lineItems.push(lineItem as any);\n } else {\n currentLineItem.quantity += lineItem.quantity;\n }\n }\n }\n\n return cartUpdate(cart);\n },\n useHook: ({ fetch }) => () => {\n const { mutate } = useCart();\n return useCallback(\n async function addItem(input) {\n const data = await fetch({ input });\n await mutate(data, false);\n return data;\n },\n [fetch, mutate]\n );\n },\n};\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes: None\n*/\nimport { MutationHook } from '@plasmicpkgs/commerce'\nimport { useUpdateItem,\n UseUpdateItem,\n} from '@plasmicpkgs/commerce'\n\nexport default useUpdateItem as UseUpdateItem<any>\n\nexport const handler: MutationHook<any> = {\n fetchOptions: {\n query: '',\n },\n async fetcher({ input, options, fetch }) {},\n useHook:\n ({ fetch }) =>\n () => {\n return async function addItem() {\n return {}\n }\n },\n}\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes: None\n*/\nimport { MutationHook } from '@plasmicpkgs/commerce'\nimport {useRemoveItem,\n UseRemoveItem,\n} from '@plasmicpkgs/commerce'\n\nexport default useRemoveItem as UseRemoveItem<typeof handler>\n\nexport const handler: MutationHook<any> = {\n fetchOptions: {\n query: '',\n },\n async fetcher({ input, options, fetch }) {},\n useHook:\n ({ fetch }) =>\n () => {\n return async function removeItem(input) {\n return {}\n }\n },\n}\n","import data from \"../data.json\";\n\nexport const sortProduct = (\n a: typeof data.products[0],\n b: typeof data.products[0],\n sortKey: string\n) => {\n switch (sortKey) {\n case \"price-asc\":\n return a.price.value < b.price.value ? -1 : 1;\n case \"price-desc\":\n return a.price.value < b.price.value ? 1 : -1;\n case \"trending-desc\":\n return a.id.localeCompare(b.id);\n case \"latest-desc\":\n return a.id.localeCompare(b.id) * -1;\n default:\n return 0;\n }\n};\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes: None\n*/\nimport { SWRHook, useSearch, UseSearch } from \"@plasmicpkgs/commerce\";\nimport data from \"../data.json\";\nimport { sortProduct } from \"../utils/sort-product\";\nconst useSearchTyped: UseSearch<typeof handler> = useSearch;\nexport default useSearchTyped;\n\nexport const handler: SWRHook<any> = {\n fetchOptions: {\n query: \"use-search\",\n },\n async fetcher({ input, options, fetch }) {\n const { search, categoryId, brandId, sort, count } = input;\n\n let products = data.products;\n\n if (categoryId) {\n const category = data.categories.find(\n (category) => category.id === categoryId\n );\n products = data.products.filter((product) =>\n category?.products?.includes(product.id)\n );\n }\n\n if (brandId) {\n products = products.filter(\n (product) =>\n product.vendor.replace(/\\s+/g, \"-\").toLowerCase() ===\n `${brandId}`.toLowerCase()\n );\n }\n\n if (search) {\n products = products.filter(\n (product) =>\n product.name.toLowerCase().includes(`${search}`.toLowerCase()) ||\n product.slug.toLowerCase().includes(`${search}`.toLowerCase())\n );\n }\n\n if (sort) {\n products = products.sort((a, b) => sortProduct(a, b, sort));\n }\n\n return {\n products: products.slice(0, count),\n found: products.length > 0,\n };\n },\n useHook:\n ({ useData }) =>\n (input = {}) => {\n return useData({\n input: [\n [\"search\", input.search],\n [\"prefixSearch\", input.prefixSearch],\n [\"categoryId\", input.categoryId],\n [\"brandId\", input.brandId],\n [\"sort\", input.sort],\n [\"locale\", input.locale],\n [\"count\", input.count],\n ],\n swrOptions: {\n revalidateOnFocus: false,\n ...input.swrOptions,\n },\n });\n },\n};\n","import { SWRHook, useProduct, UseProduct } from \"@plasmicpkgs/commerce\";\nimport data from \"../data.json\";\nexport default useProduct as UseProduct<typeof handler>;\n\nexport const handler: SWRHook<any> = {\n fetchOptions: {\n query: \"use-product\",\n },\n async fetcher({ input, options, fetch }) {\n const { id } = input;\n\n return (\n data.products.find((product) =>\n [product.id, product.slug].includes(id)\n ) ?? null\n );\n },\n useHook: ({ useData }) => (input = {}) => {\n return useData({\n input: [[\"id\", input.id]],\n swrOptions: {\n revalidateOnFocus: false,\n ...input.swrOptions,\n },\n });\n },\n};\n","import { SWRHook, useCategories, UseCategories } from \"@plasmicpkgs/commerce\";\nimport React from \"react\";\nimport data from \"../data.json\";\nexport default useCategories as UseCategories<typeof handler>;\n\nexport const handler: SWRHook<any> = {\n fetchOptions: {\n query: \"use-categories\",\n },\n async fetcher({ input, options, fetch }) {\n const { categoryId } = input;\n if (!categoryId) {\n return data.categories;\n }\n const category = data.categories.find(\n (category) => category.id === categoryId\n );\n return category ? [category] : [];\n },\n useHook: ({ useData }) => (input) => {\n const response = useData({\n input: [[\"categoryId\", input?.categoryId]],\n swrOptions: { revalidateOnFocus: false, ...input?.swrOptions },\n });\n return React.useMemo(\n () =>\n Object.create(response, {\n isEmpty: {\n get() {\n return (response.data?.length ?? 0) <= 0;\n },\n enumerable: true,\n },\n }),\n [response]\n );\n },\n};\n","import { SWRHook, useBrands, UseBrands } from \"@plasmicpkgs/commerce\";\nimport React from \"react\";\nimport data from \"../data.json\";\nexport default useBrands as UseBrands<typeof handler>;\n\nexport const handler: SWRHook<any> = {\n fetchOptions: {\n query: \"use-brands\",\n },\n async fetcher({ input, options, fetch }) {\n const vendorsStrings = data.products.map((product) => product.vendor);\n return Array.from(new Set(vendorsStrings).values()).map((v) => {\n const id = v.replace(/\\s+/g, \"-\").toLowerCase();\n return {\n entityId: id,\n name: v,\n path: `brands/${id}`,\n };\n });\n },\n useHook: ({ useData }) => (input) => {\n const response = useData({\n swrOptions: { revalidateOnFocus: false, ...input?.swrOptions },\n });\n return React.useMemo(\n () =>\n Object.create(response, {\n isEmpty: {\n get() {\n return (response.data?.length ?? 0) <= 0;\n },\n enumerable: true,\n },\n }),\n [response]\n );\n },\n};\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes: Removed authentication, customer and wishlist hooks\n*/\nimport { fetcher } from './fetcher'\nimport { handler as useCart } from './cart/use-cart'\nimport { handler as useAddItem } from './cart/use-add-item'\nimport { handler as useUpdateItem } from './cart/use-update-item'\nimport { handler as useRemoveItem } from './cart/use-remove-item'\nimport { handler as useSearch } from './product/use-search'\nimport { handler as useProduct } from './product/use-product'\nimport { handler as useCategories } from './site/use-categories'\nimport { handler as useBrands } from './site/use-brands'\nimport { LOCAL_CART_ID } from './const'\nexport const localProvider = {\n locale: 'en-us',\n cartCookie: LOCAL_CART_ID,\n fetcher: fetcher,\n cart: { useCart, useAddItem, useUpdateItem, useRemoveItem },\n products: { useSearch, useProduct },\n site: { useCategories, useBrands }\n}\n\nexport type LocalProvider = typeof localProvider\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes: Add export data\n*/\nexport * from \"./registerable\";\nexport { localProvider, data };\nexport type { LocalProvider };\nimport {\n getCommerceProvider,\n useCommerce as useCoreCommerce,\n} from \"@plasmicpkgs/commerce\";\nimport data from \"./data.json\";\nimport { localProvider, LocalProvider } from \"./provider\";\n\nexport const CommerceProvider = getCommerceProvider(localProvider);\n\nexport const useCommerce = () => useCoreCommerce<LocalProvider>();\n","import { GlobalContextMeta } from \"@plasmicapp/host\";\nimport registerGlobalContext from \"@plasmicapp/host/registerGlobalContext\";\nimport React from \"react\";\nimport { CommerceProvider } from \"./local\";\nimport { Registerable } from \"./registerable\";\n\ninterface CommerceProviderProps {\n children?: React.ReactNode;\n}\n\nexport const commerceProviderMeta: GlobalContextMeta<CommerceProviderProps> = {\n name: \"plasmic-commerce-local-provider\",\n displayName: \"Local Provider\",\n props: {},\n importPath: \"@plasmicpkgs/commerce-local\",\n importName: \"CommerceProviderComponent\",\n};\n\nfunction CommerceProviderComponent(props: CommerceProviderProps) {\n return <CommerceProvider>{props.children}</CommerceProvider>;\n}\n\nexport function registerCommerceProvider(\n loader?: Registerable,\n customCommerceProviderMeta?: GlobalContextMeta<CommerceProviderProps>\n) {\n const doRegisterComponent: typeof registerGlobalContext = (...args) =>\n loader\n ? loader.registerGlobalContext(...args)\n : registerGlobalContext(...args);\n doRegisterComponent(\n CommerceProviderComponent,\n customCommerceProviderMeta ?? commerceProviderMeta\n );\n}\n","import { Registerable } from \"./registerable\";\nimport { registerCommerceProvider } from \"./registerCommerceProvider\";\nexport * from \"./registerable\";\n\nexport * from \"./local\";\n\nexport function registerAll(loader?: Registerable) {\n registerCommerceProvider(loader);\n}\n\nexport { registerCommerceProvider };"],"names":["fetcher","_ref","_asyncToGenerator","_regeneratorRuntime","mark","_callee","res","_yield$res$json","data","wrap","_callee$","_context","prev","next","console","log","fetch","sent","ok","json","abrupt","stop","apply","arguments","LOCAL_CART_OBJ","LOCAL_CART_ID","createCart","cart","id","createdAt","currency","code","taxesIncluded","lineItems","lineItemsSubtotalPrice","subtotalPrice","totalPrice","cartId","Date","now","toString","Cookies","set","JSON","stringify","getCart","_cartId","get","cartStr","parse","undefined","cartUpdate","newCart","handler","fetchOptions","query","input","options","useHook","_ref2","useData","response","swrOptions","_extends","revalidateOnFocus","React","useMemo","Object","create","isEmpty","_response$data$lineIt","_response$data","length","enumerable","item","quantity","Number","isInteger","CommerceError","message","lineItem","variantId","_item$quantity","_iterator","_createForOfIteratorHelperLoose","products","_step","done","product","value","variant","variants","find","price","_item$quantity2","currencyCode","currentLineItem","push","_useCart","useCart","mutate","useCallback","_addItem","_callee2","_callee2$","_context2","addItem","_x","_removeItem","removeItem","sortProduct","a","b","sortKey","localeCompare","search","categoryId","brandId","sort","count","category","categories","filter","_category$products","includes","vendor","replace","toLowerCase","name","slug","slice","found","prefixSearch","locale","_data$products$find","_response$data$length","vendorsStrings","map","Array","from","Set","values","v","entityId","path","localProvider","cartCookie","useAddItem","useUpdateItem","useRemoveItem","useSearch","useProduct","site","useCategories","useBrands","CommerceProvider","getCommerceProvider","useCommerce","useCoreCommerce","commerceProviderMeta","displayName","props","importPath","importName","CommerceProviderComponent","children","registerCommerceProvider","loader","customCommerceProviderMeta","doRegisterComponent","registerGlobalContext","registerAll"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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6BAA6B;EACzCC,UAAU,EAAE;CACb;AAED,SAASC,yBAAyBA,CAACH,KAA4B;EAC7D,OAAOhG,6BAAC0F,gBAAgB,QAAEM,KAAK,CAACI,QAAQ,CAAoB;AAC9D;AAEA,SAAgBC,wBAAwBA,CACtCC,MAAqB,EACrBC,0BAAqE;EAErE,IAAMC,mBAAmB,GAAiC,SAApDA,mBAAmBA;IAAA,OACvBF,MAAM,GACFA,MAAM,CAACG,qBAAqB,CAAApJ,KAAA,CAA5BiJ,MAAM,EAAAhJ,SAA8B,CAAC,GACrCmJ,qBAAqB,CAAApJ,KAAA,SAAAC,SAAQ,CAAC;;EACpCkJ,mBAAmB,CACjBL,yBAAyB,EACzBI,0BAA0B,WAA1BA,0BAA0B,GAAIT,oBAAoB,CACnD;AACH;;SC5BgBY,WAAWA,CAACJ,MAAqB;EAC/CD,wBAAwB,CAACC,MAAM,CAAC;AAClC;;;;;;;;;"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var i=e(require("@plasmicapp/host/registerGlobalContext")),t=require("react"),a=e(t),l=require("@plasmicpkgs/commerce"),r=e(require("js-cookie")),n={categories:[{id:"id::270412710052",name:"New Arrivals",slug:"clothes",path:"/clothes",isEmpty:!1,products:["id::5447323812004","id::5447324270756","id::5447324729508","id::5447325024420","id::6621772644516"]},{id:"id::271211167908",name:"Featured",slug:"featured",path:"/featured",isEmpty:!1,products:["id::5447323156644","id::5447323812004","id::6621772644516"]}],products:[{id:"id::5447322697892",name:"Special Edition T-Shirt",vendor:"ACME",path:"/conf-shirt",slug:"conf-shirt",price:{value:50,currencyCode:"USD"},images:[{url:"https://static1.plasmic.app/commerce/conf-shirt-0.png",altText:null,width:958,height:1e3},{url:"https://static1.plasmic.app/commerce/conf-shirt-1.png",altText:null,width:1e3,height:1e3},{url:"https://static1.plasmic.app/commerce/conf-shirt-2.png",altText:null,width:1e3,height:1e3},{url:"https://static1.plasmic.app/commerce/conf-shirt-3.png",altText:null,width:1e3,height:1e3}],variants:[{id:"id::40047332688036",name:"Black / S",sku:"",price:200,listPrice:null,requiresShipping:!0,availableForSale:!0,options:[{__typename:"MultipleChoiceOption",id:"id::40047332688036",displayName:"color",values:[{label:"Black",hexColors:["#000000"]}]},{__typename:"MultipleChoiceOption",id:"id::40047332688036",displayName:"size",values:[{label:"S"}]}]},{id:"id::40009056387236",name:"Black / M",sku:"",price:200,listPrice:null,requiresShipping:!0,availableForSale:!0,options:[{__typename:"MultipleChoiceOption",id:"id::40009056387236",displayName:"color",values:[{label:"Black",hexColors:["#000000"]}]},{__typename:"MultipleChoiceOption",id:"id::40009056387236",displayName:"size",values:[{label:"M"}]}]},{id:"id::40064229212324",name:"Black / L",sku:"",price:200,listPrice:null,requiresShipping:!0,availableForSale:!0,options:[{__typename:"MultipleChoiceOption",id:"id::40064229212324",displayName:"color",values:[{label:"Black",hexColors:["#000000"]}]},{__typename:"MultipleChoiceOption",id:"id::40064229212324",displayName:"size",values:[{label:"L"}]}]},{id:"id::40073451602084",name:"Black / XL",sku:"",price:50,listPrice:null,requiresShipping:!0,availableForSale:!0,options:[{__typename:"MultipleChoiceOption",id:"id::40073451602084",displayName:"color",values:[{label:"Black",hexColors:["#000000"]}]},{__typename:"MultipleChoiceOption",id:"id::40073451602084",displayName:"size",values:[{label:"XL"}]}]},{id:"id::40073450061988",name:"Black / XXL",sku:"",price:50,listPrice:null,requiresShipping:!0,availableForSale:!0,options:[{__typename:"MultipleChoiceOption",id:"id::40073450061988",displayName:"color",values:[{label:"Black",hexColors:["#000000"]}]},{__typename:"MultipleChoiceOption",id:"id::40073450061988",displayName:"size",values:[{label:"XXL"}]}]}],options:[{__typename:"MultipleChoiceOption",id:"id::6940501311652",displayName:"color",values:[{label:"Black",hexColors:["#000000"]}]},{__typename:"MultipleChoiceOption",id:"id::6940501278884",displayName:"size",values:[{label:"S"},{label:"M"},{label:"L"},{label:"XL"},{label:"XXL"}]}],description:"Show off your love for Next.js and Vercel with this unique, limited edition t-shirt. This design is part of a limited run, numbered drop at the June 2021 Next.js Conf. It features a unique, handcrafted triangle design. Get it while supplies last – only 200 of these shirts will be made! All proceeds will be donated to charity.",descriptionHtml:'<p><meta charset="utf-8"><span>Show off your love for Next.js and Vercel with this unique, </span><strong>limited edition</strong><span> t-shirt. This design is part of a limited run, numbered drop at the June 2021 Next.js Conf. It features a unique, handcrafted triangle design. Get it while supplies last – only 200 of these shirts will be made! </span><strong>All proceeds will be donated to charity.</strong></p>'},{id:"id::5447323156644",name:"Quarter Zip",vendor:"ACME",path:"/quarter-zip",slug:"quarter-zip",price:{value:90,currencyCode:"USD"},images:[{url:"https://static1.plasmic.app/commerce/quarter-zip-0.png",altText:null,width:1e3,height:1e3},{url:"https://static1.plasmic.app/commerce/quarter-zip-1.png",altText:null,width:1e3,height:1e3},{url:"https://static1.plasmic.app/commerce/quarter-zip-2.png",altText:null,width:1e3,height:1e3}],variants:[{id:"id::40065999569060",name:"Black / S",sku:"",price:90,listPrice:20,requiresShipping:!0,availableForSale:!0,options:[{__typename:"MultipleChoiceOption",id:"id::40065999569060",displayName:"color",values:[{label:"Black",hexColors:["#000000"]}]},{__typename:"MultipleChoiceOption",id:"id::40065999569060",displayName:"size",values:[{label:"S"}]}]},{id:"id::40008984756388",name:"Black / M",sku:"",price:90,listPrice:20,requiresShipping:!0,availableForSale:!0,options:[{__typename:"MultipleChoiceOption",id:"id::40008984756388",displayName:"color",values:[{label:"Black",hexColors:["#000000"]}]},{__typename:"MultipleChoiceOption",id:"id::40008984756388",displayName:"size",values:[{label:"M"}]}]},{id:"id::40065122828452",name:"Black / L",sku:"",price:90,listPrice:20,requiresShipping:!0,availableForSale:!0,options:[{__typename:"MultipleChoiceOption",id:"id::40065122828452",displayName:"color",values:[{label:"Black",hexColors:["#000000"]}]},{__typename:"MultipleChoiceOption",id:"id::40065122828452",displayName:"size",values:[{label:"L"}]}]},{id:"id::40065123713188",name:"Black / XL",sku:"",price:90,listPrice:20,requiresShipping:!0,availableForSale:!0,options:[{__typename:"MultipleChoiceOption",id:"id::40065123713188",displayName:"color",values:[{label:"Black",hexColors:["#000000"]}]},{__typename:"MultipleChoiceOption",id:"id::40065123713188",displayName:"size",values:[{label:"XL"}]}]},{id:"id::40065125286052",name:"Black / XXL",sku:"",price:90,listPrice:20,requiresShipping:!0,availableForSale:!0,options:[{__typename:"MultipleChoiceOption",id:"id::40065125286052",displayName:"color",values:[{label:"Black",hexColors:["#000000"]}]},{__typename:"MultipleChoiceOption",id:"id::40065125286052",displayName:"size",values:[{label:"XXL"}]}]}],options:[{__typename:"MultipleChoiceOption",id:"id::6940501835940",displayName:"color",values:[{label:"Black",hexColors:["#000000"]}]},{__typename:"MultipleChoiceOption",id:"id::6940501803172",displayName:"size",values:[{label:"S"},{label:"M"},{label:"L"},{label:"XL"},{label:"XXL"}]}],description:"Show off your love for Next.js and Vercel with this unique, limited edition quarter zip. This design is part of a limited run, numbered drop at the June 2021 Next.js Conf. It features a unique, handcrafted triangle design. Get it while supplies last – only 200 of these shirts will be made! All proceeds will be donated to charity.",descriptionHtml:"<p>Show off your love for Next.js and Vercel with this unique, <strong>limited edition</strong> quarter zip. This design is part of a limited run, numbered drop at the June 2021 Next.js Conf. It features a unique, handcrafted triangle design. Get it while supplies last – only 200 of these shirts will be made! <strong>All proceeds will be donated to charity.</strong></p>"},{id:"id::5447323812004",name:"Sticker",vendor:"ACME",path:"/sticker",slug:"sticker",price:{value:0,currencyCode:"USD"},images:[{url:"https://static1.plasmic.app/commerce/sticker-0.png",altText:null,width:900,height:900}],variants:[{id:"id::40008892580004",name:"Gradient",sku:"",price:0,listPrice:60,requiresShipping:!0,availableForSale:!0,options:[{__typename:"MultipleChoiceOption",id:"id::40008892580004",displayName:"color",values:[{label:"Gradient"}]}]}],options:[{__typename:"MultipleChoiceOption",id:"id::6940502524068",displayName:"color",values:[{label:"Gradient"}]}],description:"Wafer cupcake candy macaroon bonbon candy canes cheesecake candy. Donut chupa chups sesame snaps candy chocolate cake chocolate cake danish. Tart cotton candy gummies cotton candy sweet roll. Wafer pie chocolate cake. Caramels toffee gummies. Liquorice sweet oat cake chocolate candy canes toffee bear claw. Chocolate cupcake wafer. Halvah soufflé halvah. Dessert pastry toffee apple pie chocolate cake lemon drops. Tart carrot cake wafer halvah tiramisu fruitcake.",descriptionHtml:'<p><meta charset="utf-8">Wafer cupcake candy macaroon bonbon candy canes cheesecake candy. Donut chupa chups sesame snaps candy chocolate cake chocolate cake danish. Tart cotton candy gummies cotton candy sweet roll. Wafer pie chocolate cake. Caramels toffee gummies. Liquorice sweet oat cake chocolate candy canes toffee bear claw. Chocolate cupcake wafer. Halvah soufflé halvah. Dessert pastry toffee apple pie chocolate cake lemon drops. Tart carrot cake wafer halvah tiramisu fruitcake.<br></p>'},{id:"id::5447324270756",name:"Bomber Jacket",vendor:"Next.js",path:"/bomber-jacket",slug:"bomber-jacket",price:{value:635.99,currencyCode:"USD"},images:[{url:"https://static1.plasmic.app/commerce/bomber-jacket-0.png",altText:null,width:1e3,height:1e3},{url:"https://static1.plasmic.app/commerce/bomber-jacket-1.png",altText:null,width:1e3,height:1e3}],variants:[{id:"id::40046243905700",name:"L / Black",sku:"",price:635.99,listPrice:5200,requiresShipping:!0,availableForSale:!0,options:[{__typename:"MultipleChoiceOption",id:"id::40046243905700",displayName:"size",values:[{label:"L"}]},{__typename:"MultipleChoiceOption",id:"id::40046243905700",displayName:"color",values:[{label:"Black",hexColors:["#000000"]}]}]},{id:"id::40046243938468",name:"L / DarkOliveGreen",sku:"",price:635.99,listPrice:5200,requiresShipping:!0,availableForSale:!0,options:[{__typename:"MultipleChoiceOption",id:"id::40046243938468",displayName:"size",values:[{label:"L"}]},{__typename:"MultipleChoiceOption",id:"id::40046243938468",displayName:"color",values:[{label:"DarkOliveGreen",hexColors:["#556B2F"]}]}]},{id:"id::40046243971236",name:"XL / Black",sku:"",price:635.99,listPrice:5200,requiresShipping:!0,availableForSale:!0,options:[{__typename:"MultipleChoiceOption",id:"id::40046243971236",displayName:"size",values:[{label:"XL"}]},{__typename:"MultipleChoiceOption",id:"id::40046243971236",displayName:"color",values:[{label:"Black",hexColors:["#000000"]}]}]},{id:"id::40046244004004",name:"XL / DarkOliveGreen",sku:"",price:635.99,listPrice:5200,requiresShipping:!0,availableForSale:!0,options:[{__typename:"MultipleChoiceOption",id:"id::40046244004004",displayName:"size",values:[{label:"XL"}]},{__typename:"MultipleChoiceOption",id:"id::40046244004004",displayName:"color",values:[{label:"DarkOliveGreen",hexColors:["#556B2F"]}]}]},{id:"id::40046244036772",name:"XXL / Black",sku:"",price:635.99,listPrice:5200,requiresShipping:!0,availableForSale:!0,options:[{__typename:"MultipleChoiceOption",id:"id::40046244036772",displayName:"size",values:[{label:"XXL"}]},{__typename:"MultipleChoiceOption",id:"id::40046244036772",displayName:"color",values:[{label:"Black",hexColors:["#000000"]}]}]},{id:"id::40046244069540",name:"XXL / DarkOliveGreen",sku:"",price:635.99,listPrice:5200,requiresShipping:!0,availableForSale:!0,options:[{__typename:"MultipleChoiceOption",id:"id::40046244069540",displayName:"size",values:[{label:"XXL"}]},{__typename:"MultipleChoiceOption",id:"id::40046244069540",displayName:"color",values:[{label:"DarkOliveGreen",hexColors:["#556B2F"]}]}]}],options:[{__typename:"MultipleChoiceOption",id:"id::6940503015588",displayName:"size",values:[{label:"L"},{label:"XL"},{label:"XXL"}]},{__typename:"MultipleChoiceOption",id:"id::8655769764004",displayName:"color",values:[{label:"Black",hexColors:["#000000"]},{label:"DarkOliveGreen",hexColors:["#556B2F"]}]}],description:"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Praesent elementum facilisis leo vel fringilla est ullamcorper eget. At imperdiet dui accumsan sit amet nulla facilisi morbi tempus. Praesent elementum facilisis leo vel fringilla. Congue mauris rhoncus aenean vel. Egestas sed tempus urna et pharetra pharetra massa massa ultricies.",descriptionHtml:"<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Praesent elementum facilisis leo vel fringilla est ullamcorper eget. At imperdiet dui accumsan sit amet nulla facilisi morbi tempus. Praesent elementum facilisis leo vel fringilla. Congue mauris rhoncus aenean vel. Egestas sed tempus urna et pharetra pharetra massa massa ultricies.</p>"},{id:"id::5447324729508",name:"Short Sleeve T-Shirt",vendor:"Next.js",path:"/short-sleeve-t-shirt",slug:"short-sleeve-t-shirt",price:{value:35,currencyCode:"USD"},images:[{url:"https://static1.plasmic.app/commerce/short-sleeve-t-shirt-0.png",altText:null,width:1e3,height:1e3},{url:"https://static1.plasmic.app/commerce/short-sleeve-t-shirt-1.png",altText:null,width:1e3,height:1e3},{url:"https://static1.plasmic.app/commerce/short-sleeve-t-shirt-2.png",altText:null,width:1e3,height:1e3},{url:"https://static1.plasmic.app/commerce/short-sleeve-t-shirt-3.png",altText:null,width:1e3,height:1e3}],variants:[{id:"id::35180690669732",name:"M / gray",sku:"",price:35,listPrice:null,requiresShipping:!0,availableForSale:!0,options:[{__typename:"MultipleChoiceOption",id:"id::35180690669732",displayName:"size",values:[{label:"M"}]},{__typename:"MultipleChoiceOption",id:"id::35180690669732",displayName:"color",values:[{label:"gray",hexColors:["#808080"]}]}]},{id:"id::35180690702500",name:"L / gray",sku:"",price:35,listPrice:null,requiresShipping:!0,availableForSale:!0,options:[{__typename:"MultipleChoiceOption",id:"id::35180690702500",displayName:"size",values:[{label:"L"}]},{__typename:"MultipleChoiceOption",id:"id::35180690702500",displayName:"color",values:[{label:"gray",hexColors:["#808080"]}]}]},{id:"id::35180690735268",name:"XL / gray",sku:"",price:35,listPrice:null,requiresShipping:!0,availableForSale:!0,options:[{__typename:"MultipleChoiceOption",id:"id::35180690735268",displayName:"size",values:[{label:"XL"}]},{__typename:"MultipleChoiceOption",id:"id::35180690735268",displayName:"color",values:[{label:"gray",hexColors:["#808080"]}]}]},{id:"id::40046203437220",name:"M / beige",sku:"",price:35,listPrice:null,requiresShipping:!0,availableForSale:!0,options:[{__typename:"MultipleChoiceOption",id:"id::40046203437220",displayName:"size",values:[{label:"M"}]},{__typename:"MultipleChoiceOption",id:"id::40046203437220",displayName:"color",values:[{label:"beige",hexColors:["#F5F5DC"]}]}]},{id:"id::40046207369380",name:"L / beige",sku:"",price:35,listPrice:null,requiresShipping:!0,availableForSale:!0,options:[{__typename:"MultipleChoiceOption",id:"id::40046207369380",displayName:"size",values:[{label:"L"}]},{__typename:"MultipleChoiceOption",id:"id::40046207369380",displayName:"color",values:[{label:"beige",hexColors:["#F5F5DC"]}]}]},{id:"id::40046207729828",name:"XL / beige",sku:"",price:35,listPrice:null,requiresShipping:!0,availableForSale:!0,options:[{__typename:"MultipleChoiceOption",id:"id::40046207729828",displayName:"size",values:[{label:"XL"}]},{__typename:"MultipleChoiceOption",id:"id::40046207729828",displayName:"color",values:[{label:"beige",hexColors:["#F5F5DC"]}]}]},{id:"id::40046212612260",name:"M / white",sku:"",price:35,listPrice:null,requiresShipping:!0,availableForSale:!0,options:[{__typename:"MultipleChoiceOption",id:"id::40046212612260",displayName:"size",values:[{label:"M"}]},{__typename:"MultipleChoiceOption",id:"id::40046212612260",displayName:"color",values:[{label:"white",hexColors:["#FFFFFF"]}]}]},{id:"id::40046212907172",name:"L / white",sku:"",price:35,listPrice:null,requiresShipping:!0,availableForSale:!0,options:[{__typename:"MultipleChoiceOption",id:"id::40046212907172",displayName:"size",values:[{label:"L"}]},{__typename:"MultipleChoiceOption",id:"id::40046212907172",displayName:"color",values:[{label:"white",hexColors:["#FFFFFF"]}]}]},{id:"id::40046213300388",name:"XL / white",sku:"",price:35,listPrice:null,requiresShipping:!0,availableForSale:!0,options:[{__typename:"MultipleChoiceOption",id:"id::40046213300388",displayName:"size",values:[{label:"XL"}]},{__typename:"MultipleChoiceOption",id:"id::40046213300388",displayName:"color",values:[{label:"white",hexColors:["#FFFFFF"]}]}]},{id:"id::40046214742180",name:"M / DarkTurquoise",sku:"",price:35,listPrice:null,requiresShipping:!0,availableForSale:!0,options:[{__typename:"MultipleChoiceOption",id:"id::40046214742180",displayName:"size",values:[{label:"M"}]},{__typename:"MultipleChoiceOption",id:"id::40046214742180",displayName:"color",values:[{label:"DarkTurquoise",hexColors:["#00CED1"]}]}]},{id:"id::40046218346660",name:"L / DarkTurquoise",sku:"",price:35,listPrice:null,requiresShipping:!0,availableForSale:!0,options:[{__typename:"MultipleChoiceOption",id:"id::40046218346660",displayName:"size",values:[{label:"L"}]},{__typename:"MultipleChoiceOption",id:"id::40046218346660",displayName:"color",values:[{label:"DarkTurquoise",hexColors:["#00CED1"]}]}]},{id:"id::40046220214436",name:"XL / DarkTurquoise",sku:"",price:35,listPrice:null,requiresShipping:!0,availableForSale:!0,options:[{__typename:"MultipleChoiceOption",id:"id::40046220214436",displayName:"size",values:[{label:"XL"}]},{__typename:"MultipleChoiceOption",id:"id::40046220214436",displayName:"color",values:[{label:"DarkTurquoise",hexColors:["#00CED1"]}]}]}],options:[{__typename:"MultipleChoiceOption",id:"id::6940503474340",displayName:"size",values:[{label:"M"},{label:"L"},{label:"XL"}]},{__typename:"MultipleChoiceOption",id:"id::8655761178788",displayName:"color",values:[{label:"gray",hexColors:["#808080"]},{label:"beige",hexColors:["#F5F5DC"]},{label:"white",hexColors:["#FFFFFF"]},{label:"DarkTurquoise",hexColors:["#00CED1"]}]}],description:"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Praesent elementum facilisis leo vel fringilla est ullamcorper eget. At imperdiet dui accumsan sit amet nulla facilisi morbi tempus. Praesent elementum facilisis leo vel fringilla. Congue mauris rhoncus aenean vel. Egestas sed tempus urna et pharetra pharetra massa massa ultricies.",descriptionHtml:"<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Praesent elementum facilisis leo vel fringilla est ullamcorper eget. At imperdiet dui accumsan sit amet nulla facilisi morbi tempus. Praesent elementum facilisis leo vel fringilla. Congue mauris rhoncus aenean vel. Egestas sed tempus urna et pharetra pharetra massa massa ultricies.</p>"},{id:"id::5447325024420",name:"New Short Sleeve T-Shirt",vendor:"Next.js",path:"/new-short-sleeve-t-shirt",slug:"new-short-sleeve-t-shirt",price:{value:25,currencyCode:"USD"},images:[{url:"https://static1.plasmic.app/commerce/new-short-sleeve-t-shirt-0.png",altText:null,width:1e3,height:1e3},{url:"https://static1.plasmic.app/commerce/new-short-sleeve-t-shirt-1.png",altText:null,width:1e3,height:1e3},{url:"https://static1.plasmic.app/commerce/new-short-sleeve-t-shirt-2.png",altText:null,width:1e3,height:1e3},{url:"https://static1.plasmic.app/commerce/new-short-sleeve-t-shirt-3.png",altText:null,width:1e3,height:1e3}],variants:[{id:"id::40046230962340",name:"XS / white",sku:"",price:25,listPrice:null,requiresShipping:!0,availableForSale:!0,options:[{__typename:"MultipleChoiceOption",id:"id::40046230962340",displayName:"size",values:[{label:"XS"}]},{__typename:"MultipleChoiceOption",id:"id::40046230962340",displayName:"color",values:[{label:"white",hexColors:["#FFFFFF"]}]}]},{id:"id::40046230995108",name:"XS / grey",sku:"",price:25,listPrice:null,requiresShipping:!0,availableForSale:!0,options:[{__typename:"MultipleChoiceOption",id:"id::40046230995108",displayName:"size",values:[{label:"XS"}]},{__typename:"MultipleChoiceOption",id:"id::40046230995108",displayName:"color",values:[{label:"grey",hexColors:["#808080"]}]}]},{id:"id::40046231027876",name:"XS / DarkTurquoise",sku:"",price:25,listPrice:null,requiresShipping:!0,availableForSale:!0,options:[{__typename:"MultipleChoiceOption",id:"id::40046231027876",displayName:"size",values:[{label:"XS"}]},{__typename:"MultipleChoiceOption",id:"id::40046231027876",displayName:"color",values:[{label:"DarkTurquoise",hexColors:["#00CED1"]}]}]},{id:"id::40046231060644",name:"XS / LightSalmon",sku:"",price:25,listPrice:null,requiresShipping:!0,availableForSale:!0,options:[{__typename:"MultipleChoiceOption",id:"id::40046231060644",displayName:"size",values:[{label:"XS"}]},{__typename:"MultipleChoiceOption",id:"id::40046231060644",displayName:"color",values:[{label:"LightSalmon",hexColors:["#FFA07A"]}]}]},{id:"id::40046231093412",name:"S / white",sku:"",price:25,listPrice:null,requiresShipping:!0,availableForSale:!0,options:[{__typename:"MultipleChoiceOption",id:"id::40046231093412",displayName:"size",values:[{label:"S"}]},{__typename:"MultipleChoiceOption",id:"id::40046231093412",displayName:"color",values:[{label:"white",hexColors:["#FFFFFF"]}]}]},{id:"id::40046231126180",name:"S / grey",sku:"",price:25,listPrice:null,requiresShipping:!0,availableForSale:!0,options:[{__typename:"MultipleChoiceOption",id:"id::40046231126180",displayName:"size",values:[{label:"S"}]},{__typename:"MultipleChoiceOption",id:"id::40046231126180",displayName:"color",values:[{label:"grey",hexColors:["#808080"]}]}]},{id:"id::40046231158948",name:"S / DarkTurquoise",sku:"",price:25,listPrice:null,requiresShipping:!0,availableForSale:!0,options:[{__typename:"MultipleChoiceOption",id:"id::40046231158948",displayName:"size",values:[{label:"S"}]},{__typename:"MultipleChoiceOption",id:"id::40046231158948",displayName:"color",values:[{label:"DarkTurquoise",hexColors:["#00CED1"]}]}]},{id:"id::40046231191716",name:"S / LightSalmon",sku:"",price:25,listPrice:null,requiresShipping:!0,availableForSale:!0,options:[{__typename:"MultipleChoiceOption",id:"id::40046231191716",displayName:"size",values:[{label:"S"}]},{__typename:"MultipleChoiceOption",id:"id::40046231191716",displayName:"color",values:[{label:"LightSalmon",hexColors:["#FFA07A"]}]}]},{id:"id::40046231224484",name:"M / white",sku:"",price:25,listPrice:null,requiresShipping:!0,availableForSale:!0,options:[{__typename:"MultipleChoiceOption",id:"id::40046231224484",displayName:"size",values:[{label:"M"}]},{__typename:"MultipleChoiceOption",id:"id::40046231224484",displayName:"color",values:[{label:"white",hexColors:["#FFFFFF"]}]}]},{id:"id::40046231257252",name:"M / grey",sku:"",price:25,listPrice:null,requiresShipping:!0,availableForSale:!0,options:[{__typename:"MultipleChoiceOption",id:"id::40046231257252",displayName:"size",values:[{label:"M"}]},{__typename:"MultipleChoiceOption",id:"id::40046231257252",displayName:"color",values:[{label:"grey",hexColors:["#808080"]}]}]},{id:"id::40046231290020",name:"M / DarkTurquoise",sku:"",price:25,listPrice:null,requiresShipping:!0,availableForSale:!0,options:[{__typename:"MultipleChoiceOption",id:"id::40046231290020",displayName:"size",values:[{label:"M"}]},{__typename:"MultipleChoiceOption",id:"id::40046231290020",displayName:"color",values:[{label:"DarkTurquoise",hexColors:["#00CED1"]}]}]},{id:"id::40046231322788",name:"M / LightSalmon",sku:"",price:25,listPrice:null,requiresShipping:!0,availableForSale:!0,options:[{__typename:"MultipleChoiceOption",id:"id::40046231322788",displayName:"size",values:[{label:"M"}]},{__typename:"MultipleChoiceOption",id:"id::40046231322788",displayName:"color",values:[{label:"LightSalmon",hexColors:["#FFA07A"]}]}]},{id:"id::40046231355556",name:"L / white",sku:"",price:25,listPrice:null,requiresShipping:!0,availableForSale:!0,options:[{__typename:"MultipleChoiceOption",id:"id::40046231355556",displayName:"size",values:[{label:"L"}]},{__typename:"MultipleChoiceOption",id:"id::40046231355556",displayName:"color",values:[{label:"white",hexColors:["#FFFFFF"]}]}]},{id:"id::40046231388324",name:"L / grey",sku:"",price:25,listPrice:null,requiresShipping:!0,availableForSale:!0,options:[{__typename:"MultipleChoiceOption",id:"id::40046231388324",displayName:"size",values:[{label:"L"}]},{__typename:"MultipleChoiceOption",id:"id::40046231388324",displayName:"color",values:[{label:"grey",hexColors:["#808080"]}]}]},{id:"id::40046231421092",name:"L / DarkTurquoise",sku:"",price:25,listPrice:null,requiresShipping:!0,availableForSale:!0,options:[{__typename:"MultipleChoiceOption",id:"id::40046231421092",displayName:"size",values:[{label:"L"}]},{__typename:"MultipleChoiceOption",id:"id::40046231421092",displayName:"color",values:[{label:"DarkTurquoise",hexColors:["#00CED1"]}]}]},{id:"id::40046231453860",name:"L / LightSalmon",sku:"",price:25,listPrice:null,requiresShipping:!0,availableForSale:!0,options:[{__typename:"MultipleChoiceOption",id:"id::40046231453860",displayName:"size",values:[{label:"L"}]},{__typename:"MultipleChoiceOption",id:"id::40046231453860",displayName:"color",values:[{label:"LightSalmon",hexColors:["#FFA07A"]}]}]},{id:"id::40046231486628",name:"XL / white",sku:"",price:25,listPrice:null,requiresShipping:!0,availableForSale:!0,options:[{__typename:"MultipleChoiceOption",id:"id::40046231486628",displayName:"size",values:[{label:"XL"}]},{__typename:"MultipleChoiceOption",id:"id::40046231486628",displayName:"color",values:[{label:"white",hexColors:["#FFFFFF"]}]}]},{id:"id::40046231519396",name:"XL / grey",sku:"",price:25,listPrice:null,requiresShipping:!0,availableForSale:!0,options:[{__typename:"MultipleChoiceOption",id:"id::40046231519396",displayName:"size",values:[{label:"XL"}]},{__typename:"MultipleChoiceOption",id:"id::40046231519396",displayName:"color",values:[{label:"grey",hexColors:["#808080"]}]}]},{id:"id::40046231552164",name:"XL / DarkTurquoise",sku:"",price:25,listPrice:null,requiresShipping:!0,availableForSale:!0,options:[{__typename:"MultipleChoiceOption",id:"id::40046231552164",displayName:"size",values:[{label:"XL"}]},{__typename:"MultipleChoiceOption",id:"id::40046231552164",displayName:"color",values:[{label:"DarkTurquoise",hexColors:["#00CED1"]}]}]},{id:"id::40046231584932",name:"XL / LightSalmon",sku:"",price:25,listPrice:null,requiresShipping:!0,availableForSale:!0,options:[{__typename:"MultipleChoiceOption",id:"id::40046231584932",displayName:"size",values:[{label:"XL"}]},{__typename:"MultipleChoiceOption",id:"id::40046231584932",displayName:"color",values:[{label:"LightSalmon",hexColors:["#FFA07A"]}]}]}],options:[{__typename:"MultipleChoiceOption",id:"id::6940503769252",displayName:"size",values:[{label:"XS"},{label:"S"},{label:"M"},{label:"L"},{label:"XL"}]},{__typename:"MultipleChoiceOption",id:"id::8655765471396",displayName:"color",values:[{label:"white",hexColors:["#FFFFFF"]},{label:"grey",hexColors:["#808080"]},{label:"DarkTurquoise",hexColors:["#00CED1"]},{label:"LightSalmon",hexColors:["#FFA07A"]}]}],description:"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Praesent elementum facilisis leo vel fringilla est ullamcorper eget. At imperdiet dui accumsan sit amet nulla facilisi morbi tempus. Praesent elementum facilisis leo vel fringilla. Congue mauris rhoncus aenean vel. Egestas sed tempus urna et pharetra pharetra massa massa ultricies.",descriptionHtml:"<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Praesent elementum facilisis leo vel fringilla est ullamcorper eget. At imperdiet dui accumsan sit amet nulla facilisi morbi tempus. Praesent elementum facilisis leo vel fringilla. Congue mauris rhoncus aenean vel. Egestas sed tempus urna et pharetra pharetra massa massa ultricies.<br></p>"},{id:"id::6621772644516",name:"ACME Cup",vendor:"ACME",path:"/acme-cup",slug:"acme-cup",price:{value:25,currencyCode:"USD"},images:[{url:"https://static1.plasmic.app/commerce/acme-cup-0.png",altText:null,width:2048,height:2048},{url:"https://static1.plasmic.app/commerce/acme-cup-1.png",altText:null,width:2048,height:2048}],variants:[{id:"id::40064679805092",name:"White",sku:"200",price:25,listPrice:null,requiresShipping:!0,availableForSale:!0,options:[{__typename:"MultipleChoiceOption",id:"id::40064679805092",displayName:"color",values:[{label:"White",hexColors:["#FFFFFF"]}]}]},{id:"id::40064679837860",name:"Black",sku:"201",price:25,listPrice:null,requiresShipping:!0,availableForSale:!1,options:[{__typename:"MultipleChoiceOption",id:"id::40064679837860",displayName:"color",values:[{label:"Black",hexColors:["#000000"]}]}]}],options:[{__typename:"MultipleChoiceOption",id:"id::8505918849188",displayName:"color",values:[{label:"White",hexColors:["#FFFFFF"]},{label:"Black",hexColors:["#000000"]}]}],description:"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Praesent elementum facilisis leo vel fringilla est ullamcorper eget. At imperdiet dui accumsan sit amet nulla facilisi morbi tempus. Praesent elementum facilisis leo vel fringilla. Congue mauris rhoncus aenean vel. Egestas sed tempus urna et pharetra pharetra massa massa ultricies.",descriptionHtml:'<meta charset="utf-8"><span>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Praesent elementum facilisis leo vel fringilla est ullamcorper eget. At imperdiet dui accumsan sit amet nulla facilisi morbi tempus. Praesent elementum facilisis leo vel fringilla. Congue mauris rhoncus aenean vel. Egestas sed tempus urna et pharetra pharetra massa massa ultricies.</span>'}]};function o(){o=function(){return i};var e,i={},t=Object.prototype,a=t.hasOwnProperty,l=Object.defineProperty||function(e,i,t){e[i]=t.value},r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",s=r.asyncIterator||"@@asyncIterator",u=r.toStringTag||"@@toStringTag";function p(e,i,t){return Object.defineProperty(e,i,{value:t,enumerable:!0,configurable:!0,writable:!0}),e[i]}try{p({},"")}catch(e){p=function(e,i,t){return e[i]=t}}function c(e,i,t,a){var r=Object.create((i&&i.prototype instanceof f?i:f).prototype),n=new L(a||[]);return l(r,"_invoke",{value:F(e,t,n)}),r}function d(e,i,t){try{return{type:"normal",arg:e.call(i,t)}}catch(e){return{type:"throw",arg:e}}}i.wrap=c;var m="suspendedStart",h="executing",y="completed",v={};function f(){}function g(){}function b(){}var C={};p(C,n,(function(){return this}));var _=Object.getPrototypeOf,S=_&&_(_(q([])));S&&S!==t&&a.call(S,n)&&(C=S);var k=b.prototype=f.prototype=Object.create(C);function w(e){["next","throw","return"].forEach((function(i){p(e,i,(function(e){return this._invoke(i,e)}))}))}function O(e,i){function t(l,r,n,o){var s=d(e[l],e,r);if("throw"!==s.type){var u=s.arg,p=u.value;return p&&"object"==typeof p&&a.call(p,"__await")?i.resolve(p.__await).then((function(e){t("next",e,n,o)}),(function(e){t("throw",e,n,o)})):i.resolve(p).then((function(e){u.value=e,n(u)}),(function(e){return t("throw",e,n,o)}))}o(s.arg)}var r;l(this,"_invoke",{value:function(e,a){function l(){return new i((function(i,l){t(e,a,i,l)}))}return r=r?r.then(l,l):l()}})}function F(i,t,a){var l=m;return function(r,n){if(l===h)throw new Error("Generator is already running");if(l===y){if("throw"===r)throw n;return{value:e,done:!0}}for(a.method=r,a.arg=n;;){var o=a.delegate;if(o){var s=x(o,a);if(s){if(s===v)continue;return s}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if(l===m)throw l=y,a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);l=h;var u=d(i,t,a);if("normal"===u.type){if(l=a.done?y:"suspendedYield",u.arg===v)continue;return{value:u.arg,done:a.done}}"throw"===u.type&&(l=y,a.method="throw",a.arg=u.arg)}}}function x(i,t){var a=t.method,l=i.iterator[a];if(l===e)return t.delegate=null,"throw"===a&&i.iterator.return&&(t.method="return",t.arg=e,x(i,t),"throw"===t.method)||"return"!==a&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+a+"' method")),v;var r=d(l,i.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,v;var n=r.arg;return n?n.done?(t[i.resultName]=n.value,t.next=i.nextLoc,"return"!==t.method&&(t.method="next",t.arg=e),t.delegate=null,v):n:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,v)}function M(e){var i={tryLoc:e[0]};1 in e&&(i.catchLoc=e[1]),2 in e&&(i.finallyLoc=e[2],i.afterLoc=e[3]),this.tryEntries.push(i)}function N(e){var i=e.completion||{};i.type="normal",delete i.arg,e.completion=i}function L(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(M,this),this.reset(!0)}function q(i){if(i||""===i){var t=i[n];if(t)return t.call(i);if("function"==typeof i.next)return i;if(!isNaN(i.length)){var l=-1,r=function t(){for(;++l<i.length;)if(a.call(i,l))return t.value=i[l],t.done=!1,t;return t.value=e,t.done=!0,t};return r.next=r}}throw new TypeError(typeof i+" is not iterable")}return g.prototype=b,l(k,"constructor",{value:b,configurable:!0}),l(b,"constructor",{value:g,configurable:!0}),g.displayName=p(b,u,"GeneratorFunction"),i.isGeneratorFunction=function(e){var i="function"==typeof e&&e.constructor;return!!i&&(i===g||"GeneratorFunction"===(i.displayName||i.name))},i.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,p(e,u,"GeneratorFunction")),e.prototype=Object.create(k),e},i.awrap=function(e){return{__await:e}},w(O.prototype),p(O.prototype,s,(function(){return this})),i.AsyncIterator=O,i.async=function(e,t,a,l,r){void 0===r&&(r=Promise);var n=new O(c(e,t,a,l),r);return i.isGeneratorFunction(t)?n:n.next().then((function(e){return e.done?e.value:n.next()}))},w(k),p(k,u,"Generator"),p(k,n,(function(){return this})),p(k,"toString",(function(){return"[object Generator]"})),i.keys=function(e){var i=Object(e),t=[];for(var a in i)t.push(a);return t.reverse(),function e(){for(;t.length;){var a=t.pop();if(a in i)return e.value=a,e.done=!1,e}return e.done=!0,e}},i.values=q,L.prototype={constructor:L,reset:function(i){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(N),!i)for(var t in this)"t"===t.charAt(0)&&a.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(i){if(this.done)throw i;var t=this;function l(a,l){return o.type="throw",o.arg=i,t.next=a,l&&(t.method="next",t.arg=e),!!l}for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r],o=n.completion;if("root"===n.tryLoc)return l("end");if(n.tryLoc<=this.prev){var s=a.call(n,"catchLoc"),u=a.call(n,"finallyLoc");if(s&&u){if(this.prev<n.catchLoc)return l(n.catchLoc,!0);if(this.prev<n.finallyLoc)return l(n.finallyLoc)}else if(s){if(this.prev<n.catchLoc)return l(n.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<n.finallyLoc)return l(n.finallyLoc)}}}},abrupt:function(e,i){for(var t=this.tryEntries.length-1;t>=0;--t){var l=this.tryEntries[t];if(l.tryLoc<=this.prev&&a.call(l,"finallyLoc")&&this.prev<l.finallyLoc){var r=l;break}}r&&("break"===e||"continue"===e)&&r.tryLoc<=i&&i<=r.finallyLoc&&(r=null);var n=r?r.completion:{};return n.type=e,n.arg=i,r?(this.method="next",this.next=r.finallyLoc,v):this.complete(n)},complete:function(e,i){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&i&&(this.next=i),v},finish:function(e){for(var i=this.tryEntries.length-1;i>=0;--i){var t=this.tryEntries[i];if(t.finallyLoc===e)return this.complete(t.completion,t.afterLoc),N(t),v}},catch:function(e){for(var i=this.tryEntries.length-1;i>=0;--i){var t=this.tryEntries[i];if(t.tryLoc===e){var a=t.completion;if("throw"===a.type){var l=a.arg;N(t)}return l}}throw new Error("illegal catch attempt")},delegateYield:function(i,t,a){return this.delegate={iterator:q(i),resultName:t,nextLoc:a},"next"===this.method&&(this.arg=e),v}},i}function s(e,i,t,a,l,r,n){try{var o=e[r](n),s=o.value}catch(e){return void t(e)}o.done?i(s):Promise.resolve(s).then(a,l)}function u(e){return function(){var i=this,t=arguments;return new Promise((function(a,l){var r=e.apply(i,t);function n(e){s(r,a,l,n,o,"next",e)}function o(e){s(r,a,l,n,o,"throw",e)}n(void 0)}))}}function p(){return(p=Object.assign?Object.assign.bind():function(e){for(var i=1;i<arguments.length;i++){var t=arguments[i];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e}).apply(this,arguments)}function c(e,i){(null==i||i>e.length)&&(i=e.length);for(var t=0,a=new Array(i);t<i;t++)a[t]=e[t];return a}function d(e,i){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(t)return(t=t.call(e)).next.bind(t);if(Array.isArray(e)||(t=function(e,i){if(e){if("string"==typeof e)return c(e,void 0);var t=Object.prototype.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?c(e,void 0):void 0}}(e))||i&&e&&"number"==typeof e.length){t&&(e=t);var a=0;return function(){return a>=e.length?{done:!0}:{done:!1,value:e[a++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var m=function(e){var i;e=null!=(i=e)?i:r.get("localCartId");var t=r.get("localCartObj"),a=t?JSON.parse(t):void 0;return a&&a.id===e?a.cart:function(){var e={id:"",createdAt:"",currency:{code:"USD"},taxesIncluded:!1,lineItems:[],lineItemsSubtotalPrice:0,subtotalPrice:0,totalPrice:0},i=Date.now().toString();return r.set("localCartId",i),r.set("localCartObj",JSON.stringify({id:i,cart:e})),e}()},h=function(e,i,t){switch(t){case"price-asc":return e.price.value<i.price.value?-1:1;case"price-desc":return e.price.value<i.price.value?1:-1;case"trending-desc":return e.id.localeCompare(i.id);case"latest-desc":return-1*e.id.localeCompare(i.id);default:return 0}},y={locale:"en-us",cartCookie:"localCartId",fetcher:function(){var e=u(o().mark((function e(){var i;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return console.log("FETCHER"),e.next=3,fetch("./data.json");case 3:if(!(i=e.sent).ok){e.next=10;break}return e.next=7,i.json();case 7:return e.abrupt("return",e.sent.data);case 10:throw i;case 11:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),cart:{useCart:{fetchOptions:{query:"use-cart"},fetcher:function(e){return u(o().mark((function i(){return o().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.abrupt("return",m(e.input.cartId));case 2:case"end":return i.stop()}}),i)})))()},useHook:function(e){var i=e.useData;return function(e){var t=i({swrOptions:p({revalidateOnFocus:!1},null==e?void 0:e.swrOptions)});return a.useMemo((function(){return Object.create(t,{isEmpty:{get:function(){var e,i;return(null!=(e=null==(i=t.data)?void 0:i.lineItems.length)?e:0)<=0},enumerable:!0}})}),[t])}}},useAddItem:{fetchOptions:{query:"use-add-item"},fetcher:function(e){return u(o().mark((function i(){var t,a,s,u,p,c,h,y,v,f;return o().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if(!(a=e.input).quantity||Number.isInteger(a.quantity)&&!(a.quantity<1)){i.next=3;break}throw new l.CommerceError({message:"The item quantity has to be a valid integer greater than 0"});case 3:for(s={variantId:a.variantId,quantity:null!=(t=a.quantity)?t:1},u=m(),p=d(n.products);!(c=p()).done;)(y=(h=c.value).variants.find((function(e){return e.id===a.variantId})))&&(u.totalPrice+=y.price*(null!=(v=a.quantity)?v:1),u.currency.code=h.price.currencyCode,(f=u.lineItems.find((function(e){return e.variantId===s.variantId})))?f.quantity+=s.quantity:u.lineItems.push(s));return i.abrupt("return",(o=u,r.set("localCartObj",JSON.stringify({id:r.get("localCartId"),cart:o})),o));case 7:case"end":return i.stop()}var o}),i)})))()},useHook:function(e){var i=e.fetch;return function(){var e=l.useCart().mutate;return t.useCallback(function(){var t=u(o().mark((function t(a){var l;return o().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,i({input:a});case 2:return l=t.sent,t.next=5,e(l,!1);case 5:return t.abrupt("return",l);case 6:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),[i,e])}}},useUpdateItem:{fetchOptions:{query:""},fetcher:function(e){return u(o().mark((function e(){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case 1:case"end":return e.stop()}}),e)})))()},useHook:function(e){return function(){return function(){var e=u(o().mark((function e(){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",{});case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()}}},useRemoveItem:{fetchOptions:{query:""},fetcher:function(e){return u(o().mark((function e(){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case 1:case"end":return e.stop()}}),e)})))()},useHook:function(e){return function(){return function(){var e=u(o().mark((function e(i){return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",{});case 1:case"end":return e.stop()}}),e)})));return function(i){return e.apply(this,arguments)}}()}}}},products:{useSearch:{fetchOptions:{query:"use-search"},fetcher:function(e){return u(o().mark((function i(){var t,a,l,r,s,u,p,c;return o().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return a=(t=e.input).search,r=t.brandId,s=t.sort,u=t.count,p=n.products,(l=t.categoryId)&&(c=n.categories.find((function(e){return e.id===l})),p=n.products.filter((function(e){var i;return null==c||null==(i=c.products)?void 0:i.includes(e.id)}))),r&&(p=p.filter((function(e){return e.vendor.replace(/\s+/g,"-").toLowerCase()===(""+r).toLowerCase()}))),a&&(p=p.filter((function(e){return e.name.toLowerCase().includes((""+a).toLowerCase())||e.slug.toLowerCase().includes((""+a).toLowerCase())}))),s&&(p=p.sort((function(e,i){return h(e,i,s)}))),i.abrupt("return",{products:p.slice(0,u),found:p.length>0});case 8:case"end":return i.stop()}}),i)})))()},useHook:function(e){var i=e.useData;return function(e){return void 0===e&&(e={}),i({input:[["search",e.search],["prefixSearch",e.prefixSearch],["categoryId",e.categoryId],["brandId",e.brandId],["sort",e.sort],["locale",e.locale],["count",e.count]],swrOptions:p({revalidateOnFocus:!1},e.swrOptions)})}}},useProduct:{fetchOptions:{query:"use-product"},fetcher:function(e){return u(o().mark((function i(){var t,a;return o().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return a=e.input.id,i.abrupt("return",null!=(t=n.products.find((function(e){return[e.id,e.slug].includes(a)})))?t:null);case 3:case"end":return i.stop()}}),i)})))()},useHook:function(e){var i=e.useData;return function(e){return void 0===e&&(e={}),i({input:[["id",e.id]],swrOptions:p({revalidateOnFocus:!1},e.swrOptions)})}}}},site:{useCategories:{fetchOptions:{query:"use-categories"},fetcher:function(e){return u(o().mark((function i(){var t,a;return o().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if(t=e.input.categoryId){i.next=4;break}return i.abrupt("return",n.categories);case 4:return a=n.categories.find((function(e){return e.id===t})),i.abrupt("return",a?[a]:[]);case 6:case"end":return i.stop()}}),i)})))()},useHook:function(e){var i=e.useData;return function(e){var t=i({input:[["categoryId",null==e?void 0:e.categoryId]],swrOptions:p({revalidateOnFocus:!1},null==e?void 0:e.swrOptions)});return a.useMemo((function(){return Object.create(t,{isEmpty:{get:function(){var e,i;return(null!=(e=null==(i=t.data)?void 0:i.length)?e:0)<=0},enumerable:!0}})}),[t])}}},useBrands:{fetchOptions:{query:"use-brands"},fetcher:function(e){return u(o().mark((function e(){var i;return o().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=n.products.map((function(e){return e.vendor})),e.abrupt("return",Array.from(new Set(i).values()).map((function(e){var i=e.replace(/\s+/g,"-").toLowerCase();return{entityId:i,name:e,path:"brands/"+i}})));case 3:case"end":return e.stop()}}),e)})))()},useHook:function(e){var i=e.useData;return function(e){var t=i({swrOptions:p({revalidateOnFocus:!1},null==e?void 0:e.swrOptions)});return a.useMemo((function(){return Object.create(t,{isEmpty:{get:function(){var e,i;return(null!=(e=null==(i=t.data)?void 0:i.length)?e:0)<=0},enumerable:!0}})}),[t])}}}}},v=l.getCommerceProvider(y),f={name:"plasmic-commerce-local-provider",displayName:"Local Provider",props:{},importPath:"@plasmicpkgs/commerce-local",importName:"CommerceProviderComponent"};function g(e){return a.createElement(v,null,e.children)}function b(e,t){!function(){e?e.registerGlobalContext.apply(e,arguments):i.apply(void 0,arguments)}(g,null!=t?t:f)}exports.CommerceProvider=v,exports.data=n,exports.localProvider=y,exports.registerAll=function(e){b(e)},exports.registerCommerceProvider=b,exports.useCommerce=function(){return l.useCommerce()};
|
|
1
|
+
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var i=e(require("@plasmicapp/host/registerGlobalContext")),t=require("react"),a=e(t),l=require("@plasmicpkgs/commerce"),r=e(require("js-cookie")),n={categories:[{id:"id::270412710052",name:"New Arrivals",slug:"clothes",path:"/clothes",isEmpty:!1,products:["id::5447323812004","id::5447324270756","id::5447324729508","id::5447325024420","id::6621772644516"]},{id:"id::271211167908",name:"Featured",slug:"featured",path:"/featured",isEmpty:!1,products:["id::5447323156644","id::5447323812004","id::6621772644516"]}],products:[{id:"id::5447322697892",name:"Special Edition T-Shirt",vendor:"ACME",path:"/conf-shirt",slug:"conf-shirt",price:{value:50,currencyCode:"USD"},images:[{url:"https://static1.plasmic.app/commerce/conf-shirt-0.png",altText:null,width:958,height:1e3},{url:"https://static1.plasmic.app/commerce/conf-shirt-1.png",altText:null,width:1e3,height:1e3},{url:"https://static1.plasmic.app/commerce/conf-shirt-2.png",altText:null,width:1e3,height:1e3},{url:"https://static1.plasmic.app/commerce/conf-shirt-3.png",altText:null,width:1e3,height:1e3}],variants:[{id:"id::40047332688036",name:"Black / S",sku:"",price:200,listPrice:null,requiresShipping:!0,availableForSale:!0,options:[{__typename:"MultipleChoiceOption",id:"id::40047332688036",displayName:"color",values:[{label:"Black",hexColors:["#000000"]}]},{__typename:"MultipleChoiceOption",id:"id::40047332688036",displayName:"size",values:[{label:"S"}]}]},{id:"id::40009056387236",name:"Black / M",sku:"",price:200,listPrice:null,requiresShipping:!0,availableForSale:!0,options:[{__typename:"MultipleChoiceOption",id:"id::40009056387236",displayName:"color",values:[{label:"Black",hexColors:["#000000"]}]},{__typename:"MultipleChoiceOption",id:"id::40009056387236",displayName:"size",values:[{label:"M"}]}]},{id:"id::40064229212324",name:"Black / L",sku:"",price:200,listPrice:null,requiresShipping:!0,availableForSale:!0,options:[{__typename:"MultipleChoiceOption",id:"id::40064229212324",displayName:"color",values:[{label:"Black",hexColors:["#000000"]}]},{__typename:"MultipleChoiceOption",id:"id::40064229212324",displayName:"size",values:[{label:"L"}]}]},{id:"id::40073451602084",name:"Black / XL",sku:"",price:50,listPrice:null,requiresShipping:!0,availableForSale:!0,options:[{__typename:"MultipleChoiceOption",id:"id::40073451602084",displayName:"color",values:[{label:"Black",hexColors:["#000000"]}]},{__typename:"MultipleChoiceOption",id:"id::40073451602084",displayName:"size",values:[{label:"XL"}]}]},{id:"id::40073450061988",name:"Black / XXL",sku:"",price:50,listPrice:null,requiresShipping:!0,availableForSale:!0,options:[{__typename:"MultipleChoiceOption",id:"id::40073450061988",displayName:"color",values:[{label:"Black",hexColors:["#000000"]}]},{__typename:"MultipleChoiceOption",id:"id::40073450061988",displayName:"size",values:[{label:"XXL"}]}]}],options:[{__typename:"MultipleChoiceOption",id:"id::6940501311652",displayName:"color",values:[{label:"Black",hexColors:["#000000"]}]},{__typename:"MultipleChoiceOption",id:"id::6940501278884",displayName:"size",values:[{label:"S"},{label:"M"},{label:"L"},{label:"XL"},{label:"XXL"}]}],description:"Show off your love for Next.js and Vercel with this unique, limited edition t-shirt. This design is part of a limited run, numbered drop at the June 2021 Next.js Conf. It features a unique, handcrafted triangle design. Get it while supplies last – only 200 of these shirts will be made! All proceeds will be donated to charity.",descriptionHtml:'<p><meta charset="utf-8"><span>Show off your love for Next.js and Vercel with this unique, </span><strong>limited edition</strong><span> t-shirt. This design is part of a limited run, numbered drop at the June 2021 Next.js Conf. It features a unique, handcrafted triangle design. Get it while supplies last – only 200 of these shirts will be made! </span><strong>All proceeds will be donated to charity.</strong></p>'},{id:"id::5447323156644",name:"Quarter Zip",vendor:"ACME",path:"/quarter-zip",slug:"quarter-zip",price:{value:90,currencyCode:"USD"},images:[{url:"https://static1.plasmic.app/commerce/quarter-zip-0.png",altText:null,width:1e3,height:1e3},{url:"https://static1.plasmic.app/commerce/quarter-zip-1.png",altText:null,width:1e3,height:1e3},{url:"https://static1.plasmic.app/commerce/quarter-zip-2.png",altText:null,width:1e3,height:1e3}],variants:[{id:"id::40065999569060",name:"Black / S",sku:"",price:90,listPrice:20,requiresShipping:!0,availableForSale:!0,options:[{__typename:"MultipleChoiceOption",id:"id::40065999569060",displayName:"color",values:[{label:"Black",hexColors:["#000000"]}]},{__typename:"MultipleChoiceOption",id:"id::40065999569060",displayName:"size",values:[{label:"S"}]}]},{id:"id::40008984756388",name:"Black / M",sku:"",price:90,listPrice:20,requiresShipping:!0,availableForSale:!0,options:[{__typename:"MultipleChoiceOption",id:"id::40008984756388",displayName:"color",values:[{label:"Black",hexColors:["#000000"]}]},{__typename:"MultipleChoiceOption",id:"id::40008984756388",displayName:"size",values:[{label:"M"}]}]},{id:"id::40065122828452",name:"Black / L",sku:"",price:90,listPrice:20,requiresShipping:!0,availableForSale:!0,options:[{__typename:"MultipleChoiceOption",id:"id::40065122828452",displayName:"color",values:[{label:"Black",hexColors:["#000000"]}]},{__typename:"MultipleChoiceOption",id:"id::40065122828452",displayName:"size",values:[{label:"L"}]}]},{id:"id::40065123713188",name:"Black / XL",sku:"",price:90,listPrice:20,requiresShipping:!0,availableForSale:!0,options:[{__typename:"MultipleChoiceOption",id:"id::40065123713188",displayName:"color",values:[{label:"Black",hexColors:["#000000"]}]},{__typename:"MultipleChoiceOption",id:"id::40065123713188",displayName:"size",values:[{label:"XL"}]}]},{id:"id::40065125286052",name:"Black / XXL",sku:"",price:90,listPrice:20,requiresShipping:!0,availableForSale:!0,options:[{__typename:"MultipleChoiceOption",id:"id::40065125286052",displayName:"color",values:[{label:"Black",hexColors:["#000000"]}]},{__typename:"MultipleChoiceOption",id:"id::40065125286052",displayName:"size",values:[{label:"XXL"}]}]}],options:[{__typename:"MultipleChoiceOption",id:"id::6940501835940",displayName:"color",values:[{label:"Black",hexColors:["#000000"]}]},{__typename:"MultipleChoiceOption",id:"id::6940501803172",displayName:"size",values:[{label:"S"},{label:"M"},{label:"L"},{label:"XL"},{label:"XXL"}]}],description:"Show off your love for Next.js and Vercel with this unique, limited edition quarter zip. This design is part of a limited run, numbered drop at the June 2021 Next.js Conf. It features a unique, handcrafted triangle design. Get it while supplies last – only 200 of these shirts will be made! All proceeds will be donated to charity.",descriptionHtml:"<p>Show off your love for Next.js and Vercel with this unique, <strong>limited edition</strong> quarter zip. This design is part of a limited run, numbered drop at the June 2021 Next.js Conf. It features a unique, handcrafted triangle design. Get it while supplies last – only 200 of these shirts will be made! <strong>All proceeds will be donated to charity.</strong></p>"},{id:"id::5447323812004",name:"Sticker",vendor:"ACME",path:"/sticker",slug:"sticker",price:{value:0,currencyCode:"USD"},images:[{url:"https://static1.plasmic.app/commerce/sticker-0.png",altText:null,width:900,height:900}],variants:[{id:"id::40008892580004",name:"Gradient",sku:"",price:0,listPrice:60,requiresShipping:!0,availableForSale:!0,options:[{__typename:"MultipleChoiceOption",id:"id::40008892580004",displayName:"color",values:[{label:"Gradient"}]}]}],options:[{__typename:"MultipleChoiceOption",id:"id::6940502524068",displayName:"color",values:[{label:"Gradient"}]}],description:"Wafer cupcake candy macaroon bonbon candy canes cheesecake candy. Donut chupa chups sesame snaps candy chocolate cake chocolate cake danish. Tart cotton candy gummies cotton candy sweet roll. Wafer pie chocolate cake. Caramels toffee gummies. Liquorice sweet oat cake chocolate candy canes toffee bear claw. Chocolate cupcake wafer. Halvah soufflé halvah. Dessert pastry toffee apple pie chocolate cake lemon drops. Tart carrot cake wafer halvah tiramisu fruitcake.",descriptionHtml:'<p><meta charset="utf-8">Wafer cupcake candy macaroon bonbon candy canes cheesecake candy. Donut chupa chups sesame snaps candy chocolate cake chocolate cake danish. Tart cotton candy gummies cotton candy sweet roll. Wafer pie chocolate cake. Caramels toffee gummies. Liquorice sweet oat cake chocolate candy canes toffee bear claw. Chocolate cupcake wafer. Halvah soufflé halvah. Dessert pastry toffee apple pie chocolate cake lemon drops. Tart carrot cake wafer halvah tiramisu fruitcake.<br></p>'},{id:"id::5447324270756",name:"Bomber Jacket",vendor:"Next.js",path:"/bomber-jacket",slug:"bomber-jacket",price:{value:635.99,currencyCode:"USD"},images:[{url:"https://static1.plasmic.app/commerce/bomber-jacket-0.png",altText:null,width:1e3,height:1e3},{url:"https://static1.plasmic.app/commerce/bomber-jacket-1.png",altText:null,width:1e3,height:1e3}],variants:[{id:"id::40046243905700",name:"L / Black",sku:"",price:635.99,listPrice:5200,requiresShipping:!0,availableForSale:!0,options:[{__typename:"MultipleChoiceOption",id:"id::40046243905700",displayName:"size",values:[{label:"L"}]},{__typename:"MultipleChoiceOption",id:"id::40046243905700",displayName:"color",values:[{label:"Black",hexColors:["#000000"]}]}]},{id:"id::40046243938468",name:"L / DarkOliveGreen",sku:"",price:635.99,listPrice:5200,requiresShipping:!0,availableForSale:!0,options:[{__typename:"MultipleChoiceOption",id:"id::40046243938468",displayName:"size",values:[{label:"L"}]},{__typename:"MultipleChoiceOption",id:"id::40046243938468",displayName:"color",values:[{label:"DarkOliveGreen",hexColors:["#556B2F"]}]}]},{id:"id::40046243971236",name:"XL / Black",sku:"",price:635.99,listPrice:5200,requiresShipping:!0,availableForSale:!0,options:[{__typename:"MultipleChoiceOption",id:"id::40046243971236",displayName:"size",values:[{label:"XL"}]},{__typename:"MultipleChoiceOption",id:"id::40046243971236",displayName:"color",values:[{label:"Black",hexColors:["#000000"]}]}]},{id:"id::40046244004004",name:"XL / DarkOliveGreen",sku:"",price:635.99,listPrice:5200,requiresShipping:!0,availableForSale:!0,options:[{__typename:"MultipleChoiceOption",id:"id::40046244004004",displayName:"size",values:[{label:"XL"}]},{__typename:"MultipleChoiceOption",id:"id::40046244004004",displayName:"color",values:[{label:"DarkOliveGreen",hexColors:["#556B2F"]}]}]},{id:"id::40046244036772",name:"XXL / Black",sku:"",price:635.99,listPrice:5200,requiresShipping:!0,availableForSale:!0,options:[{__typename:"MultipleChoiceOption",id:"id::40046244036772",displayName:"size",values:[{label:"XXL"}]},{__typename:"MultipleChoiceOption",id:"id::40046244036772",displayName:"color",values:[{label:"Black",hexColors:["#000000"]}]}]},{id:"id::40046244069540",name:"XXL / DarkOliveGreen",sku:"",price:635.99,listPrice:5200,requiresShipping:!0,availableForSale:!0,options:[{__typename:"MultipleChoiceOption",id:"id::40046244069540",displayName:"size",values:[{label:"XXL"}]},{__typename:"MultipleChoiceOption",id:"id::40046244069540",displayName:"color",values:[{label:"DarkOliveGreen",hexColors:["#556B2F"]}]}]}],options:[{__typename:"MultipleChoiceOption",id:"id::6940503015588",displayName:"size",values:[{label:"L"},{label:"XL"},{label:"XXL"}]},{__typename:"MultipleChoiceOption",id:"id::8655769764004",displayName:"color",values:[{label:"Black",hexColors:["#000000"]},{label:"DarkOliveGreen",hexColors:["#556B2F"]}]}],description:"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Praesent elementum facilisis leo vel fringilla est ullamcorper eget. At imperdiet dui accumsan sit amet nulla facilisi morbi tempus. Praesent elementum facilisis leo vel fringilla. Congue mauris rhoncus aenean vel. Egestas sed tempus urna et pharetra pharetra massa massa ultricies.",descriptionHtml:"<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Praesent elementum facilisis leo vel fringilla est ullamcorper eget. At imperdiet dui accumsan sit amet nulla facilisi morbi tempus. Praesent elementum facilisis leo vel fringilla. Congue mauris rhoncus aenean vel. Egestas sed tempus urna et pharetra pharetra massa massa ultricies.</p>"},{id:"id::5447324729508",name:"Short Sleeve T-Shirt",vendor:"Next.js",path:"/short-sleeve-t-shirt",slug:"short-sleeve-t-shirt",price:{value:35,currencyCode:"USD"},images:[{url:"https://static1.plasmic.app/commerce/short-sleeve-t-shirt-0.png",altText:null,width:1e3,height:1e3},{url:"https://static1.plasmic.app/commerce/short-sleeve-t-shirt-1.png",altText:null,width:1e3,height:1e3},{url:"https://static1.plasmic.app/commerce/short-sleeve-t-shirt-2.png",altText:null,width:1e3,height:1e3},{url:"https://static1.plasmic.app/commerce/short-sleeve-t-shirt-3.png",altText:null,width:1e3,height:1e3}],variants:[{id:"id::35180690669732",name:"M / gray",sku:"",price:35,listPrice:null,requiresShipping:!0,availableForSale:!0,options:[{__typename:"MultipleChoiceOption",id:"id::35180690669732",displayName:"size",values:[{label:"M"}]},{__typename:"MultipleChoiceOption",id:"id::35180690669732",displayName:"color",values:[{label:"gray",hexColors:["#808080"]}]}]},{id:"id::35180690702500",name:"L / gray",sku:"",price:35,listPrice:null,requiresShipping:!0,availableForSale:!0,options:[{__typename:"MultipleChoiceOption",id:"id::35180690702500",displayName:"size",values:[{label:"L"}]},{__typename:"MultipleChoiceOption",id:"id::35180690702500",displayName:"color",values:[{label:"gray",hexColors:["#808080"]}]}]},{id:"id::35180690735268",name:"XL / gray",sku:"",price:35,listPrice:null,requiresShipping:!0,availableForSale:!0,options:[{__typename:"MultipleChoiceOption",id:"id::35180690735268",displayName:"size",values:[{label:"XL"}]},{__typename:"MultipleChoiceOption",id:"id::35180690735268",displayName:"color",values:[{label:"gray",hexColors:["#808080"]}]}]},{id:"id::40046203437220",name:"M / beige",sku:"",price:35,listPrice:null,requiresShipping:!0,availableForSale:!0,options:[{__typename:"MultipleChoiceOption",id:"id::40046203437220",displayName:"size",values:[{label:"M"}]},{__typename:"MultipleChoiceOption",id:"id::40046203437220",displayName:"color",values:[{label:"beige",hexColors:["#F5F5DC"]}]}]},{id:"id::40046207369380",name:"L / beige",sku:"",price:35,listPrice:null,requiresShipping:!0,availableForSale:!0,options:[{__typename:"MultipleChoiceOption",id:"id::40046207369380",displayName:"size",values:[{label:"L"}]},{__typename:"MultipleChoiceOption",id:"id::40046207369380",displayName:"color",values:[{label:"beige",hexColors:["#F5F5DC"]}]}]},{id:"id::40046207729828",name:"XL / beige",sku:"",price:35,listPrice:null,requiresShipping:!0,availableForSale:!0,options:[{__typename:"MultipleChoiceOption",id:"id::40046207729828",displayName:"size",values:[{label:"XL"}]},{__typename:"MultipleChoiceOption",id:"id::40046207729828",displayName:"color",values:[{label:"beige",hexColors:["#F5F5DC"]}]}]},{id:"id::40046212612260",name:"M / white",sku:"",price:35,listPrice:null,requiresShipping:!0,availableForSale:!0,options:[{__typename:"MultipleChoiceOption",id:"id::40046212612260",displayName:"size",values:[{label:"M"}]},{__typename:"MultipleChoiceOption",id:"id::40046212612260",displayName:"color",values:[{label:"white",hexColors:["#FFFFFF"]}]}]},{id:"id::40046212907172",name:"L / white",sku:"",price:35,listPrice:null,requiresShipping:!0,availableForSale:!0,options:[{__typename:"MultipleChoiceOption",id:"id::40046212907172",displayName:"size",values:[{label:"L"}]},{__typename:"MultipleChoiceOption",id:"id::40046212907172",displayName:"color",values:[{label:"white",hexColors:["#FFFFFF"]}]}]},{id:"id::40046213300388",name:"XL / white",sku:"",price:35,listPrice:null,requiresShipping:!0,availableForSale:!0,options:[{__typename:"MultipleChoiceOption",id:"id::40046213300388",displayName:"size",values:[{label:"XL"}]},{__typename:"MultipleChoiceOption",id:"id::40046213300388",displayName:"color",values:[{label:"white",hexColors:["#FFFFFF"]}]}]},{id:"id::40046214742180",name:"M / DarkTurquoise",sku:"",price:35,listPrice:null,requiresShipping:!0,availableForSale:!0,options:[{__typename:"MultipleChoiceOption",id:"id::40046214742180",displayName:"size",values:[{label:"M"}]},{__typename:"MultipleChoiceOption",id:"id::40046214742180",displayName:"color",values:[{label:"DarkTurquoise",hexColors:["#00CED1"]}]}]},{id:"id::40046218346660",name:"L / DarkTurquoise",sku:"",price:35,listPrice:null,requiresShipping:!0,availableForSale:!0,options:[{__typename:"MultipleChoiceOption",id:"id::40046218346660",displayName:"size",values:[{label:"L"}]},{__typename:"MultipleChoiceOption",id:"id::40046218346660",displayName:"color",values:[{label:"DarkTurquoise",hexColors:["#00CED1"]}]}]},{id:"id::40046220214436",name:"XL / DarkTurquoise",sku:"",price:35,listPrice:null,requiresShipping:!0,availableForSale:!0,options:[{__typename:"MultipleChoiceOption",id:"id::40046220214436",displayName:"size",values:[{label:"XL"}]},{__typename:"MultipleChoiceOption",id:"id::40046220214436",displayName:"color",values:[{label:"DarkTurquoise",hexColors:["#00CED1"]}]}]}],options:[{__typename:"MultipleChoiceOption",id:"id::6940503474340",displayName:"size",values:[{label:"M"},{label:"L"},{label:"XL"}]},{__typename:"MultipleChoiceOption",id:"id::8655761178788",displayName:"color",values:[{label:"gray",hexColors:["#808080"]},{label:"beige",hexColors:["#F5F5DC"]},{label:"white",hexColors:["#FFFFFF"]},{label:"DarkTurquoise",hexColors:["#00CED1"]}]}],description:"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Praesent elementum facilisis leo vel fringilla est ullamcorper eget. At imperdiet dui accumsan sit amet nulla facilisi morbi tempus. Praesent elementum facilisis leo vel fringilla. Congue mauris rhoncus aenean vel. Egestas sed tempus urna et pharetra pharetra massa massa ultricies.",descriptionHtml:"<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Praesent elementum facilisis leo vel fringilla est ullamcorper eget. At imperdiet dui accumsan sit amet nulla facilisi morbi tempus. Praesent elementum facilisis leo vel fringilla. Congue mauris rhoncus aenean vel. Egestas sed tempus urna et pharetra pharetra massa massa ultricies.</p>"},{id:"id::5447325024420",name:"New Short Sleeve T-Shirt",vendor:"Next.js",path:"/new-short-sleeve-t-shirt",slug:"new-short-sleeve-t-shirt",price:{value:25,currencyCode:"USD"},images:[{url:"https://static1.plasmic.app/commerce/new-short-sleeve-t-shirt-0.png",altText:null,width:1e3,height:1e3},{url:"https://static1.plasmic.app/commerce/new-short-sleeve-t-shirt-1.png",altText:null,width:1e3,height:1e3},{url:"https://static1.plasmic.app/commerce/new-short-sleeve-t-shirt-2.png",altText:null,width:1e3,height:1e3},{url:"https://static1.plasmic.app/commerce/new-short-sleeve-t-shirt-3.png",altText:null,width:1e3,height:1e3}],variants:[{id:"id::40046230962340",name:"XS / white",sku:"",price:25,listPrice:null,requiresShipping:!0,availableForSale:!0,options:[{__typename:"MultipleChoiceOption",id:"id::40046230962340",displayName:"size",values:[{label:"XS"}]},{__typename:"MultipleChoiceOption",id:"id::40046230962340",displayName:"color",values:[{label:"white",hexColors:["#FFFFFF"]}]}]},{id:"id::40046230995108",name:"XS / grey",sku:"",price:25,listPrice:null,requiresShipping:!0,availableForSale:!0,options:[{__typename:"MultipleChoiceOption",id:"id::40046230995108",displayName:"size",values:[{label:"XS"}]},{__typename:"MultipleChoiceOption",id:"id::40046230995108",displayName:"color",values:[{label:"grey",hexColors:["#808080"]}]}]},{id:"id::40046231027876",name:"XS / DarkTurquoise",sku:"",price:25,listPrice:null,requiresShipping:!0,availableForSale:!0,options:[{__typename:"MultipleChoiceOption",id:"id::40046231027876",displayName:"size",values:[{label:"XS"}]},{__typename:"MultipleChoiceOption",id:"id::40046231027876",displayName:"color",values:[{label:"DarkTurquoise",hexColors:["#00CED1"]}]}]},{id:"id::40046231060644",name:"XS / LightSalmon",sku:"",price:25,listPrice:null,requiresShipping:!0,availableForSale:!0,options:[{__typename:"MultipleChoiceOption",id:"id::40046231060644",displayName:"size",values:[{label:"XS"}]},{__typename:"MultipleChoiceOption",id:"id::40046231060644",displayName:"color",values:[{label:"LightSalmon",hexColors:["#FFA07A"]}]}]},{id:"id::40046231093412",name:"S / white",sku:"",price:25,listPrice:null,requiresShipping:!0,availableForSale:!0,options:[{__typename:"MultipleChoiceOption",id:"id::40046231093412",displayName:"size",values:[{label:"S"}]},{__typename:"MultipleChoiceOption",id:"id::40046231093412",displayName:"color",values:[{label:"white",hexColors:["#FFFFFF"]}]}]},{id:"id::40046231126180",name:"S / grey",sku:"",price:25,listPrice:null,requiresShipping:!0,availableForSale:!0,options:[{__typename:"MultipleChoiceOption",id:"id::40046231126180",displayName:"size",values:[{label:"S"}]},{__typename:"MultipleChoiceOption",id:"id::40046231126180",displayName:"color",values:[{label:"grey",hexColors:["#808080"]}]}]},{id:"id::40046231158948",name:"S / DarkTurquoise",sku:"",price:25,listPrice:null,requiresShipping:!0,availableForSale:!0,options:[{__typename:"MultipleChoiceOption",id:"id::40046231158948",displayName:"size",values:[{label:"S"}]},{__typename:"MultipleChoiceOption",id:"id::40046231158948",displayName:"color",values:[{label:"DarkTurquoise",hexColors:["#00CED1"]}]}]},{id:"id::40046231191716",name:"S / LightSalmon",sku:"",price:25,listPrice:null,requiresShipping:!0,availableForSale:!0,options:[{__typename:"MultipleChoiceOption",id:"id::40046231191716",displayName:"size",values:[{label:"S"}]},{__typename:"MultipleChoiceOption",id:"id::40046231191716",displayName:"color",values:[{label:"LightSalmon",hexColors:["#FFA07A"]}]}]},{id:"id::40046231224484",name:"M / white",sku:"",price:25,listPrice:null,requiresShipping:!0,availableForSale:!0,options:[{__typename:"MultipleChoiceOption",id:"id::40046231224484",displayName:"size",values:[{label:"M"}]},{__typename:"MultipleChoiceOption",id:"id::40046231224484",displayName:"color",values:[{label:"white",hexColors:["#FFFFFF"]}]}]},{id:"id::40046231257252",name:"M / grey",sku:"",price:25,listPrice:null,requiresShipping:!0,availableForSale:!0,options:[{__typename:"MultipleChoiceOption",id:"id::40046231257252",displayName:"size",values:[{label:"M"}]},{__typename:"MultipleChoiceOption",id:"id::40046231257252",displayName:"color",values:[{label:"grey",hexColors:["#808080"]}]}]},{id:"id::40046231290020",name:"M / DarkTurquoise",sku:"",price:25,listPrice:null,requiresShipping:!0,availableForSale:!0,options:[{__typename:"MultipleChoiceOption",id:"id::40046231290020",displayName:"size",values:[{label:"M"}]},{__typename:"MultipleChoiceOption",id:"id::40046231290020",displayName:"color",values:[{label:"DarkTurquoise",hexColors:["#00CED1"]}]}]},{id:"id::40046231322788",name:"M / LightSalmon",sku:"",price:25,listPrice:null,requiresShipping:!0,availableForSale:!0,options:[{__typename:"MultipleChoiceOption",id:"id::40046231322788",displayName:"size",values:[{label:"M"}]},{__typename:"MultipleChoiceOption",id:"id::40046231322788",displayName:"color",values:[{label:"LightSalmon",hexColors:["#FFA07A"]}]}]},{id:"id::40046231355556",name:"L / white",sku:"",price:25,listPrice:null,requiresShipping:!0,availableForSale:!0,options:[{__typename:"MultipleChoiceOption",id:"id::40046231355556",displayName:"size",values:[{label:"L"}]},{__typename:"MultipleChoiceOption",id:"id::40046231355556",displayName:"color",values:[{label:"white",hexColors:["#FFFFFF"]}]}]},{id:"id::40046231388324",name:"L / grey",sku:"",price:25,listPrice:null,requiresShipping:!0,availableForSale:!0,options:[{__typename:"MultipleChoiceOption",id:"id::40046231388324",displayName:"size",values:[{label:"L"}]},{__typename:"MultipleChoiceOption",id:"id::40046231388324",displayName:"color",values:[{label:"grey",hexColors:["#808080"]}]}]},{id:"id::40046231421092",name:"L / DarkTurquoise",sku:"",price:25,listPrice:null,requiresShipping:!0,availableForSale:!0,options:[{__typename:"MultipleChoiceOption",id:"id::40046231421092",displayName:"size",values:[{label:"L"}]},{__typename:"MultipleChoiceOption",id:"id::40046231421092",displayName:"color",values:[{label:"DarkTurquoise",hexColors:["#00CED1"]}]}]},{id:"id::40046231453860",name:"L / LightSalmon",sku:"",price:25,listPrice:null,requiresShipping:!0,availableForSale:!0,options:[{__typename:"MultipleChoiceOption",id:"id::40046231453860",displayName:"size",values:[{label:"L"}]},{__typename:"MultipleChoiceOption",id:"id::40046231453860",displayName:"color",values:[{label:"LightSalmon",hexColors:["#FFA07A"]}]}]},{id:"id::40046231486628",name:"XL / white",sku:"",price:25,listPrice:null,requiresShipping:!0,availableForSale:!0,options:[{__typename:"MultipleChoiceOption",id:"id::40046231486628",displayName:"size",values:[{label:"XL"}]},{__typename:"MultipleChoiceOption",id:"id::40046231486628",displayName:"color",values:[{label:"white",hexColors:["#FFFFFF"]}]}]},{id:"id::40046231519396",name:"XL / grey",sku:"",price:25,listPrice:null,requiresShipping:!0,availableForSale:!0,options:[{__typename:"MultipleChoiceOption",id:"id::40046231519396",displayName:"size",values:[{label:"XL"}]},{__typename:"MultipleChoiceOption",id:"id::40046231519396",displayName:"color",values:[{label:"grey",hexColors:["#808080"]}]}]},{id:"id::40046231552164",name:"XL / DarkTurquoise",sku:"",price:25,listPrice:null,requiresShipping:!0,availableForSale:!0,options:[{__typename:"MultipleChoiceOption",id:"id::40046231552164",displayName:"size",values:[{label:"XL"}]},{__typename:"MultipleChoiceOption",id:"id::40046231552164",displayName:"color",values:[{label:"DarkTurquoise",hexColors:["#00CED1"]}]}]},{id:"id::40046231584932",name:"XL / LightSalmon",sku:"",price:25,listPrice:null,requiresShipping:!0,availableForSale:!0,options:[{__typename:"MultipleChoiceOption",id:"id::40046231584932",displayName:"size",values:[{label:"XL"}]},{__typename:"MultipleChoiceOption",id:"id::40046231584932",displayName:"color",values:[{label:"LightSalmon",hexColors:["#FFA07A"]}]}]}],options:[{__typename:"MultipleChoiceOption",id:"id::6940503769252",displayName:"size",values:[{label:"XS"},{label:"S"},{label:"M"},{label:"L"},{label:"XL"}]},{__typename:"MultipleChoiceOption",id:"id::8655765471396",displayName:"color",values:[{label:"white",hexColors:["#FFFFFF"]},{label:"grey",hexColors:["#808080"]},{label:"DarkTurquoise",hexColors:["#00CED1"]},{label:"LightSalmon",hexColors:["#FFA07A"]}]}],description:"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Praesent elementum facilisis leo vel fringilla est ullamcorper eget. At imperdiet dui accumsan sit amet nulla facilisi morbi tempus. Praesent elementum facilisis leo vel fringilla. Congue mauris rhoncus aenean vel. Egestas sed tempus urna et pharetra pharetra massa massa ultricies.",descriptionHtml:"<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Praesent elementum facilisis leo vel fringilla est ullamcorper eget. At imperdiet dui accumsan sit amet nulla facilisi morbi tempus. Praesent elementum facilisis leo vel fringilla. Congue mauris rhoncus aenean vel. Egestas sed tempus urna et pharetra pharetra massa massa ultricies.<br></p>"},{id:"id::6621772644516",name:"ACME Cup",vendor:"ACME",path:"/acme-cup",slug:"acme-cup",price:{value:25,currencyCode:"USD"},images:[{url:"https://static1.plasmic.app/commerce/acme-cup-0.png",altText:null,width:2048,height:2048},{url:"https://static1.plasmic.app/commerce/acme-cup-1.png",altText:null,width:2048,height:2048}],variants:[{id:"id::40064679805092",name:"White",sku:"200",price:25,listPrice:null,requiresShipping:!0,availableForSale:!0,options:[{__typename:"MultipleChoiceOption",id:"id::40064679805092",displayName:"color",values:[{label:"White",hexColors:["#FFFFFF"]}]}]},{id:"id::40064679837860",name:"Black",sku:"201",price:25,listPrice:null,requiresShipping:!0,availableForSale:!1,options:[{__typename:"MultipleChoiceOption",id:"id::40064679837860",displayName:"color",values:[{label:"Black",hexColors:["#000000"]}]}]}],options:[{__typename:"MultipleChoiceOption",id:"id::8505918849188",displayName:"color",values:[{label:"White",hexColors:["#FFFFFF"]},{label:"Black",hexColors:["#000000"]}]}],description:"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Praesent elementum facilisis leo vel fringilla est ullamcorper eget. At imperdiet dui accumsan sit amet nulla facilisi morbi tempus. Praesent elementum facilisis leo vel fringilla. Congue mauris rhoncus aenean vel. Egestas sed tempus urna et pharetra pharetra massa massa ultricies.",descriptionHtml:'<meta charset="utf-8"><span>Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Praesent elementum facilisis leo vel fringilla est ullamcorper eget. At imperdiet dui accumsan sit amet nulla facilisi morbi tempus. Praesent elementum facilisis leo vel fringilla. Congue mauris rhoncus aenean vel. Egestas sed tempus urna et pharetra pharetra massa massa ultricies.</span>'}]};function o(e,i){(null==i||i>e.length)&&(i=e.length);for(var t=0,a=Array(i);t<i;t++)a[t]=e[t];return a}function s(e,i,t,a,l,r,n){try{var o=e[r](n),s=o.value}catch(e){return void t(e)}o.done?i(s):Promise.resolve(s).then(a,l)}function u(e){return function(){var i=this,t=arguments;return new Promise((function(a,l){var r=e.apply(i,t);function n(e){s(r,a,l,n,o,"next",e)}function o(e){s(r,a,l,n,o,"throw",e)}n(void 0)}))}}function p(e,i){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(t)return(t=t.call(e)).next.bind(t);if(Array.isArray(e)||(t=function(e,i){if(e){if("string"==typeof e)return o(e,i);var t={}.toString.call(e).slice(8,-1);return"Object"===t&&e.constructor&&(t=e.constructor.name),"Map"===t||"Set"===t?Array.from(e):"Arguments"===t||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?o(e,i):void 0}}(e))||i&&e&&"number"==typeof e.length){t&&(e=t);var a=0;return function(){return a>=e.length?{done:!0}:{done:!1,value:e[a++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function c(){return(c=Object.assign?Object.assign.bind():function(e){for(var i=1;i<arguments.length;i++){var t=arguments[i];for(var a in t)({}).hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e}).apply(null,arguments)}function d(){d=function(){return i};var e,i={},t=Object.prototype,a=t.hasOwnProperty,l=Object.defineProperty||function(e,i,t){e[i]=t.value},r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.asyncIterator||"@@asyncIterator",s=r.toStringTag||"@@toStringTag";function u(e,i,t){return Object.defineProperty(e,i,{value:t,enumerable:!0,configurable:!0,writable:!0}),e[i]}try{u({},"")}catch(e){u=function(e,i,t){return e[i]=t}}function p(e,i,t,a){var r=Object.create((i&&i.prototype instanceof f?i:f).prototype),n=new L(a||[]);return l(r,"_invoke",{value:F(e,t,n)}),r}function c(e,i,t){try{return{type:"normal",arg:e.call(i,t)}}catch(e){return{type:"throw",arg:e}}}i.wrap=p;var m="suspendedStart",h="executing",y="completed",v={};function f(){}function g(){}function b(){}var C={};u(C,n,(function(){return this}));var _=Object.getPrototypeOf,S=_&&_(_(q([])));S&&S!==t&&a.call(S,n)&&(C=S);var k=b.prototype=f.prototype=Object.create(C);function w(e){["next","throw","return"].forEach((function(i){u(e,i,(function(e){return this._invoke(i,e)}))}))}function O(e,i){function t(l,r,n,o){var s=c(e[l],e,r);if("throw"!==s.type){var u=s.arg,p=u.value;return p&&"object"==typeof p&&a.call(p,"__await")?i.resolve(p.__await).then((function(e){t("next",e,n,o)}),(function(e){t("throw",e,n,o)})):i.resolve(p).then((function(e){u.value=e,n(u)}),(function(e){return t("throw",e,n,o)}))}o(s.arg)}var r;l(this,"_invoke",{value:function(e,a){function l(){return new i((function(i,l){t(e,a,i,l)}))}return r=r?r.then(l,l):l()}})}function F(i,t,a){var l=m;return function(r,n){if(l===h)throw Error("Generator is already running");if(l===y){if("throw"===r)throw n;return{value:e,done:!0}}for(a.method=r,a.arg=n;;){var o=a.delegate;if(o){var s=x(o,a);if(s){if(s===v)continue;return s}}if("next"===a.method)a.sent=a._sent=a.arg;else if("throw"===a.method){if(l===m)throw l=y,a.arg;a.dispatchException(a.arg)}else"return"===a.method&&a.abrupt("return",a.arg);l=h;var u=c(i,t,a);if("normal"===u.type){if(l=a.done?y:"suspendedYield",u.arg===v)continue;return{value:u.arg,done:a.done}}"throw"===u.type&&(l=y,a.method="throw",a.arg=u.arg)}}}function x(i,t){var a=t.method,l=i.iterator[a];if(l===e)return t.delegate=null,"throw"===a&&i.iterator.return&&(t.method="return",t.arg=e,x(i,t),"throw"===t.method)||"return"!==a&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+a+"' method")),v;var r=c(l,i.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,v;var n=r.arg;return n?n.done?(t[i.resultName]=n.value,t.next=i.nextLoc,"return"!==t.method&&(t.method="next",t.arg=e),t.delegate=null,v):n:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,v)}function M(e){var i={tryLoc:e[0]};1 in e&&(i.catchLoc=e[1]),2 in e&&(i.finallyLoc=e[2],i.afterLoc=e[3]),this.tryEntries.push(i)}function N(e){var i=e.completion||{};i.type="normal",delete i.arg,e.completion=i}function L(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(M,this),this.reset(!0)}function q(i){if(i||""===i){var t=i[n];if(t)return t.call(i);if("function"==typeof i.next)return i;if(!isNaN(i.length)){var l=-1,r=function t(){for(;++l<i.length;)if(a.call(i,l))return t.value=i[l],t.done=!1,t;return t.value=e,t.done=!0,t};return r.next=r}}throw new TypeError(typeof i+" is not iterable")}return g.prototype=b,l(k,"constructor",{value:b,configurable:!0}),l(b,"constructor",{value:g,configurable:!0}),g.displayName=u(b,s,"GeneratorFunction"),i.isGeneratorFunction=function(e){var i="function"==typeof e&&e.constructor;return!!i&&(i===g||"GeneratorFunction"===(i.displayName||i.name))},i.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,b):(e.__proto__=b,u(e,s,"GeneratorFunction")),e.prototype=Object.create(k),e},i.awrap=function(e){return{__await:e}},w(O.prototype),u(O.prototype,o,(function(){return this})),i.AsyncIterator=O,i.async=function(e,t,a,l,r){void 0===r&&(r=Promise);var n=new O(p(e,t,a,l),r);return i.isGeneratorFunction(t)?n:n.next().then((function(e){return e.done?e.value:n.next()}))},w(k),u(k,s,"Generator"),u(k,n,(function(){return this})),u(k,"toString",(function(){return"[object Generator]"})),i.keys=function(e){var i=Object(e),t=[];for(var a in i)t.push(a);return t.reverse(),function e(){for(;t.length;){var a=t.pop();if(a in i)return e.value=a,e.done=!1,e}return e.done=!0,e}},i.values=q,L.prototype={constructor:L,reset:function(i){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(N),!i)for(var t in this)"t"===t.charAt(0)&&a.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=e)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(i){if(this.done)throw i;var t=this;function l(a,l){return o.type="throw",o.arg=i,t.next=a,l&&(t.method="next",t.arg=e),!!l}for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r],o=n.completion;if("root"===n.tryLoc)return l("end");if(n.tryLoc<=this.prev){var s=a.call(n,"catchLoc"),u=a.call(n,"finallyLoc");if(s&&u){if(this.prev<n.catchLoc)return l(n.catchLoc,!0);if(this.prev<n.finallyLoc)return l(n.finallyLoc)}else if(s){if(this.prev<n.catchLoc)return l(n.catchLoc,!0)}else{if(!u)throw Error("try statement without catch or finally");if(this.prev<n.finallyLoc)return l(n.finallyLoc)}}}},abrupt:function(e,i){for(var t=this.tryEntries.length-1;t>=0;--t){var l=this.tryEntries[t];if(l.tryLoc<=this.prev&&a.call(l,"finallyLoc")&&this.prev<l.finallyLoc){var r=l;break}}r&&("break"===e||"continue"===e)&&r.tryLoc<=i&&i<=r.finallyLoc&&(r=null);var n=r?r.completion:{};return n.type=e,n.arg=i,r?(this.method="next",this.next=r.finallyLoc,v):this.complete(n)},complete:function(e,i){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&i&&(this.next=i),v},finish:function(e){for(var i=this.tryEntries.length-1;i>=0;--i){var t=this.tryEntries[i];if(t.finallyLoc===e)return this.complete(t.completion,t.afterLoc),N(t),v}},catch:function(e){for(var i=this.tryEntries.length-1;i>=0;--i){var t=this.tryEntries[i];if(t.tryLoc===e){var a=t.completion;if("throw"===a.type){var l=a.arg;N(t)}return l}}throw Error("illegal catch attempt")},delegateYield:function(i,t,a){return this.delegate={iterator:q(i),resultName:t,nextLoc:a},"next"===this.method&&(this.arg=e),v}},i}var m=function(e){var i;e=null!=(i=e)?i:r.get("localCartId");var t=r.get("localCartObj"),a=t?JSON.parse(t):void 0;return a&&a.id===e?a.cart:function(){var e={id:"",createdAt:"",currency:{code:"USD"},taxesIncluded:!1,lineItems:[],lineItemsSubtotalPrice:0,subtotalPrice:0,totalPrice:0},i=Date.now().toString();return r.set("localCartId",i),r.set("localCartObj",JSON.stringify({id:i,cart:e})),e}()},h=function(e,i,t){switch(t){case"price-asc":return e.price.value<i.price.value?-1:1;case"price-desc":return e.price.value<i.price.value?1:-1;case"trending-desc":return e.id.localeCompare(i.id);case"latest-desc":return-1*e.id.localeCompare(i.id);default:return 0}},y={locale:"en-us",cartCookie:"localCartId",fetcher:function(){var e=u(d().mark((function e(){var i;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return console.log("FETCHER"),e.next=3,fetch("./data.json");case 3:if(!(i=e.sent).ok){e.next=10;break}return e.next=7,i.json();case 7:return e.abrupt("return",e.sent.data);case 10:throw i;case 11:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),cart:{useCart:{fetchOptions:{query:"use-cart"},fetcher:function(e){return u(d().mark((function i(){return d().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.abrupt("return",m(e.input.cartId));case 2:case"end":return i.stop()}}),i)})))()},useHook:function(e){var i=e.useData;return function(e){var t=i({swrOptions:c({revalidateOnFocus:!1},null==e?void 0:e.swrOptions)});return a.useMemo((function(){return Object.create(t,{isEmpty:{get:function(){var e,i;return(null!=(e=null==(i=t.data)?void 0:i.lineItems.length)?e:0)<=0},enumerable:!0}})}),[t])}}},useAddItem:{fetchOptions:{query:"use-add-item"},fetcher:function(e){return u(d().mark((function i(){var t,a,o,s,u,c,h,y,v,f;return d().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if(!(a=e.input).quantity||Number.isInteger(a.quantity)&&!(a.quantity<1)){i.next=3;break}throw new l.CommerceError({message:"The item quantity has to be a valid integer greater than 0"});case 3:for(o={variantId:a.variantId,quantity:null!=(t=a.quantity)?t:1},s=m(),u=p(n.products);!(c=u()).done;)(y=(h=c.value).variants.find((function(e){return e.id===a.variantId})))&&(s.totalPrice+=y.price*(null!=(v=a.quantity)?v:1),s.currency.code=h.price.currencyCode,(f=s.lineItems.find((function(e){return e.variantId===o.variantId})))?f.quantity+=o.quantity:s.lineItems.push(o));return i.abrupt("return",(d=s,r.set("localCartObj",JSON.stringify({id:r.get("localCartId"),cart:d})),d));case 7:case"end":return i.stop()}var d}),i)})))()},useHook:function(e){var i=e.fetch;return function(){var e=l.useCart().mutate;return t.useCallback(function(){var t=u(d().mark((function t(a){var l;return d().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,i({input:a});case 2:return l=t.sent,t.next=5,e(l,!1);case 5:return t.abrupt("return",l);case 6:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),[i,e])}}},useUpdateItem:{fetchOptions:{query:""},fetcher:function(e){return u(d().mark((function e(){return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case 1:case"end":return e.stop()}}),e)})))()},useHook:function(e){return function(){return function(){var e=u(d().mark((function e(){return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",{});case 1:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}()}}},useRemoveItem:{fetchOptions:{query:""},fetcher:function(e){return u(d().mark((function e(){return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:case 1:case"end":return e.stop()}}),e)})))()},useHook:function(e){return function(){return function(){var e=u(d().mark((function e(i){return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",{});case 1:case"end":return e.stop()}}),e)})));return function(i){return e.apply(this,arguments)}}()}}}},products:{useSearch:{fetchOptions:{query:"use-search"},fetcher:function(e){return u(d().mark((function i(){var t,a,l,r,o,s,u,p;return d().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return a=(t=e.input).search,r=t.brandId,o=t.sort,s=t.count,u=n.products,(l=t.categoryId)&&(p=n.categories.find((function(e){return e.id===l})),u=n.products.filter((function(e){var i;return null==p||null==(i=p.products)?void 0:i.includes(e.id)}))),r&&(u=u.filter((function(e){return e.vendor.replace(/\s+/g,"-").toLowerCase()===(""+r).toLowerCase()}))),a&&(u=u.filter((function(e){return e.name.toLowerCase().includes((""+a).toLowerCase())||e.slug.toLowerCase().includes((""+a).toLowerCase())}))),o&&(u=u.sort((function(e,i){return h(e,i,o)}))),i.abrupt("return",{products:u.slice(0,s),found:u.length>0});case 8:case"end":return i.stop()}}),i)})))()},useHook:function(e){var i=e.useData;return function(e){return void 0===e&&(e={}),i({input:[["search",e.search],["prefixSearch",e.prefixSearch],["categoryId",e.categoryId],["brandId",e.brandId],["sort",e.sort],["locale",e.locale],["count",e.count]],swrOptions:c({revalidateOnFocus:!1},e.swrOptions)})}}},useProduct:{fetchOptions:{query:"use-product"},fetcher:function(e){return u(d().mark((function i(){var t,a;return d().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return a=e.input.id,i.abrupt("return",null!=(t=n.products.find((function(e){return[e.id,e.slug].includes(a)})))?t:null);case 3:case"end":return i.stop()}}),i)})))()},useHook:function(e){var i=e.useData;return function(e){return void 0===e&&(e={}),i({input:[["id",e.id]],swrOptions:c({revalidateOnFocus:!1},e.swrOptions)})}}}},site:{useCategories:{fetchOptions:{query:"use-categories"},fetcher:function(e){return u(d().mark((function i(){var t,a;return d().wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if(t=e.input.categoryId){i.next=4;break}return i.abrupt("return",n.categories);case 4:return a=n.categories.find((function(e){return e.id===t})),i.abrupt("return",a?[a]:[]);case 6:case"end":return i.stop()}}),i)})))()},useHook:function(e){var i=e.useData;return function(e){var t=i({input:[["categoryId",null==e?void 0:e.categoryId]],swrOptions:c({revalidateOnFocus:!1},null==e?void 0:e.swrOptions)});return a.useMemo((function(){return Object.create(t,{isEmpty:{get:function(){var e,i;return(null!=(e=null==(i=t.data)?void 0:i.length)?e:0)<=0},enumerable:!0}})}),[t])}}},useBrands:{fetchOptions:{query:"use-brands"},fetcher:function(e){return u(d().mark((function e(){var i;return d().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=n.products.map((function(e){return e.vendor})),e.abrupt("return",Array.from(new Set(i).values()).map((function(e){var i=e.replace(/\s+/g,"-").toLowerCase();return{entityId:i,name:e,path:"brands/"+i}})));case 3:case"end":return e.stop()}}),e)})))()},useHook:function(e){var i=e.useData;return function(e){var t=i({swrOptions:c({revalidateOnFocus:!1},null==e?void 0:e.swrOptions)});return a.useMemo((function(){return Object.create(t,{isEmpty:{get:function(){var e,i;return(null!=(e=null==(i=t.data)?void 0:i.length)?e:0)<=0},enumerable:!0}})}),[t])}}}}},v=l.getCommerceProvider(y),f={name:"plasmic-commerce-local-provider",displayName:"Local Provider",props:{},importPath:"@plasmicpkgs/commerce-local",importName:"CommerceProviderComponent"};function g(e){return a.createElement(v,null,e.children)}function b(e,t){!function(){e?e.registerGlobalContext.apply(e,arguments):i.apply(void 0,arguments)}(g,null!=t?t:f)}exports.CommerceProvider=v,exports.data=n,exports.localProvider=y,exports.registerAll=function(e){b(e)},exports.registerCommerceProvider=b,exports.useCommerce=function(){return l.useCommerce()};
|
|
2
2
|
//# sourceMappingURL=commerce-local.cjs.production.min.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commerce-local.cjs.production.min.js","sources":["../src/fetcher.ts","../src/utils/cart.ts","../src/const.ts","../src/utils/sort-product.ts","../src/provider.ts","../src/cart/use-cart.tsx","../src/cart/use-add-item.tsx","../src/cart/use-update-item.tsx","../src/cart/use-remove-item.tsx","../src/product/use-search.tsx","../src/product/use-product.tsx","../src/site/use-categories.ts","../src/site/use-brands.ts","../src/local.ts","../src/registerCommerceProvider.tsx","../src/index.tsx"],"sourcesContent":["import { Fetcher } from '@plasmicpkgs/commerce';\n\nexport const fetcher: Fetcher = async () => {\n console.log('FETCHER')\n const res = await fetch('./data.json')\n if (res.ok) {\n const { data } = await res.json()\n return data\n }\n throw res\n}\n","import { CartType } from \"@plasmicpkgs/commerce\";\nimport Cookies from \"js-cookie\";\nimport { LOCAL_CART_ID, LOCAL_CART_OBJ } from \"../const\";\n\nconst options: Cookies.CookieAttributes = {\n sameSite: \"none\",\n secure: true,\n};\n\nexport const createCart: () => CartType.Cart = () => {\n const cart = {\n id: \"\",\n createdAt: \"\",\n currency: { code: \"USD\" },\n taxesIncluded: false,\n lineItems: [],\n lineItemsSubtotalPrice: 0,\n subtotalPrice: 0,\n totalPrice: 0,\n };\n\n const cartId = Date.now().toString();\n\n Cookies.set(LOCAL_CART_ID, cartId);\n Cookies.set(\n LOCAL_CART_OBJ,\n JSON.stringify({\n id: cartId,\n cart,\n })\n );\n\n return cart;\n};\n\nexport const getCart: (cartId?: string) => CartType.Cart = (\n cartId?: string\n) => {\n cartId = cartId ?? Cookies.get(LOCAL_CART_ID);\n const cartStr = Cookies.get(LOCAL_CART_OBJ);\n const cart = cartStr ? JSON.parse(cartStr) : undefined;\n\n if (!cart || cart.id !== cartId) {\n return createCart();\n } else {\n return cart.cart;\n }\n};\n\nexport const cartUpdate = (newCart: CartType.Cart) => {\n Cookies.set(\n LOCAL_CART_OBJ,\n JSON.stringify({\n id: Cookies.get(LOCAL_CART_ID),\n cart: newCart,\n })\n );\n\n return newCart;\n};\n","export const LOCAL_CART_OBJ = \"localCartObj\";\n\nexport const LOCAL_CART_ID = \"localCartId\";\n","import data from \"../data.json\";\n\nexport const sortProduct = (\n a: typeof data.products[0],\n b: typeof data.products[0],\n sortKey: string\n) => {\n switch (sortKey) {\n case \"price-asc\":\n return a.price.value < b.price.value ? -1 : 1;\n case \"price-desc\":\n return a.price.value < b.price.value ? 1 : -1;\n case \"trending-desc\":\n return a.id.localeCompare(b.id);\n case \"latest-desc\":\n return a.id.localeCompare(b.id) * -1;\n default:\n return 0;\n }\n};\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes: Removed authentication, customer and wishlist hooks\n*/\nimport { fetcher } from './fetcher'\nimport { handler as useCart } from './cart/use-cart'\nimport { handler as useAddItem } from './cart/use-add-item'\nimport { handler as useUpdateItem } from './cart/use-update-item'\nimport { handler as useRemoveItem } from './cart/use-remove-item'\nimport { handler as useSearch } from './product/use-search'\nimport { handler as useProduct } from './product/use-product'\nimport { handler as useCategories } from './site/use-categories'\nimport { handler as useBrands } from './site/use-brands'\nimport { LOCAL_CART_ID } from './const'\nexport const localProvider = {\n locale: 'en-us',\n cartCookie: LOCAL_CART_ID,\n fetcher: fetcher,\n cart: { useCart, useAddItem, useUpdateItem, useRemoveItem },\n products: { useSearch, useProduct },\n site: { useCategories, useBrands }\n}\n\nexport type LocalProvider = typeof localProvider\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes:\n - Before: just returned an empty cart.\n - Now: Read cart from local storage.\n*/\nimport { SWRHook, useCart, UseCart } from \"@plasmicpkgs/commerce\";\nimport React from \"react\";\nimport { getCart } from \"../utils/cart\";\n\nexport default useCart as UseCart<typeof handler>;\n\nexport const handler: SWRHook<any> = {\n fetchOptions: {\n query: \"use-cart\",\n },\n async fetcher({ input, options, fetch }) {\n return getCart(input.cartId);\n },\n useHook: ({ useData }) => (input) => {\n const response = useData({\n swrOptions: { revalidateOnFocus: false, ...input?.swrOptions },\n });\n return React.useMemo(\n () =>\n Object.create(response, {\n isEmpty: {\n get() {\n return (response.data?.lineItems.length ?? 0) <= 0;\n },\n enumerable: true,\n },\n }),\n [response]\n );\n },\n};\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes:\n - Implemented a local cart\n - The items are added to local storage.\n*/\nimport {\n CommerceError,\n MutationHook,\n useAddItem,\n UseAddItem,\n} from \"@plasmicpkgs/commerce\";\nimport { useCallback } from \"react\";\nimport data from \"../data.json\";\nimport { cartUpdate, getCart } from \"../utils/cart\";\nimport useCart from \"./use-cart\";\n\nexport default useAddItem as UseAddItem<typeof handler>;\nexport const handler: MutationHook<any> = {\n fetchOptions: {\n query: \"use-add-item\",\n },\n async fetcher({ input: item, options, fetch }) {\n if (\n item.quantity &&\n (!Number.isInteger(item.quantity) || item.quantity! < 1)\n ) {\n throw new CommerceError({\n message: \"The item quantity has to be a valid integer greater than 0\",\n });\n }\n\n const lineItem = {\n variantId: item.variantId,\n quantity: item.quantity ?? 1,\n };\n\n const cart = getCart();\n for (const product of data.products) {\n const variant = (product.variants as any[]).find(\n (variant) => variant.id === item.variantId\n );\n if (variant) {\n cart.totalPrice += variant.price * (item.quantity ?? 1);\n cart.currency.code = product.price.currencyCode;\n const currentLineItem = cart.lineItems.find(\n (item) => item.variantId === lineItem.variantId\n );\n if (!currentLineItem) {\n cart.lineItems.push(lineItem as any);\n } else {\n currentLineItem.quantity += lineItem.quantity;\n }\n }\n }\n\n return cartUpdate(cart);\n },\n useHook: ({ fetch }) => () => {\n const { mutate } = useCart();\n return useCallback(\n async function addItem(input) {\n const data = await fetch({ input });\n await mutate(data, false);\n return data;\n },\n [fetch, mutate]\n );\n },\n};\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes: None\n*/\nimport { MutationHook } from '@plasmicpkgs/commerce'\nimport { useUpdateItem,\n UseUpdateItem,\n} from '@plasmicpkgs/commerce'\n\nexport default useUpdateItem as UseUpdateItem<any>\n\nexport const handler: MutationHook<any> = {\n fetchOptions: {\n query: '',\n },\n async fetcher({ input, options, fetch }) {},\n useHook:\n ({ fetch }) =>\n () => {\n return async function addItem() {\n return {}\n }\n },\n}\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes: None\n*/\nimport { MutationHook } from '@plasmicpkgs/commerce'\nimport {useRemoveItem,\n UseRemoveItem,\n} from '@plasmicpkgs/commerce'\n\nexport default useRemoveItem as UseRemoveItem<typeof handler>\n\nexport const handler: MutationHook<any> = {\n fetchOptions: {\n query: '',\n },\n async fetcher({ input, options, fetch }) {},\n useHook:\n ({ fetch }) =>\n () => {\n return async function removeItem(input) {\n return {}\n }\n },\n}\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes: None\n*/\nimport { SWRHook, useSearch, UseSearch } from \"@plasmicpkgs/commerce\";\nimport data from \"../data.json\";\nimport { sortProduct } from \"../utils/sort-product\";\nconst useSearchTyped: UseSearch<typeof handler> = useSearch;\nexport default useSearchTyped;\n\nexport const handler: SWRHook<any> = {\n fetchOptions: {\n query: \"use-search\",\n },\n async fetcher({ input, options, fetch }) {\n const { search, categoryId, brandId, sort, count } = input;\n\n let products = data.products;\n\n if (categoryId) {\n const category = data.categories.find(\n (category) => category.id === categoryId\n );\n products = data.products.filter((product) =>\n category?.products?.includes(product.id)\n );\n }\n\n if (brandId) {\n products = products.filter(\n (product) =>\n product.vendor.replace(/\\s+/g, \"-\").toLowerCase() ===\n `${brandId}`.toLowerCase()\n );\n }\n\n if (search) {\n products = products.filter(\n (product) =>\n product.name.toLowerCase().includes(`${search}`.toLowerCase()) ||\n product.slug.toLowerCase().includes(`${search}`.toLowerCase())\n );\n }\n\n if (sort) {\n products = products.sort((a, b) => sortProduct(a, b, sort));\n }\n\n return {\n products: products.slice(0, count),\n found: products.length > 0,\n };\n },\n useHook:\n ({ useData }) =>\n (input = {}) => {\n return useData({\n input: [\n [\"search\", input.search],\n [\"prefixSearch\", input.prefixSearch],\n [\"categoryId\", input.categoryId],\n [\"brandId\", input.brandId],\n [\"sort\", input.sort],\n [\"locale\", input.locale],\n [\"count\", input.count],\n ],\n swrOptions: {\n revalidateOnFocus: false,\n ...input.swrOptions,\n },\n });\n },\n};\n","import { SWRHook, useProduct, UseProduct } from \"@plasmicpkgs/commerce\";\nimport data from \"../data.json\";\nexport default useProduct as UseProduct<typeof handler>;\n\nexport const handler: SWRHook<any> = {\n fetchOptions: {\n query: \"use-product\",\n },\n async fetcher({ input, options, fetch }) {\n const { id } = input;\n\n return (\n data.products.find((product) =>\n [product.id, product.slug].includes(id)\n ) ?? null\n );\n },\n useHook: ({ useData }) => (input = {}) => {\n return useData({\n input: [[\"id\", input.id]],\n swrOptions: {\n revalidateOnFocus: false,\n ...input.swrOptions,\n },\n });\n },\n};\n","import { SWRHook, useCategories, UseCategories } from \"@plasmicpkgs/commerce\";\nimport React from \"react\";\nimport data from \"../data.json\";\nexport default useCategories as UseCategories<typeof handler>;\n\nexport const handler: SWRHook<any> = {\n fetchOptions: {\n query: \"use-categories\",\n },\n async fetcher({ input, options, fetch }) {\n const { categoryId } = input;\n if (!categoryId) {\n return data.categories;\n }\n const category = data.categories.find(\n (category) => category.id === categoryId\n );\n return category ? [category] : [];\n },\n useHook: ({ useData }) => (input) => {\n const response = useData({\n input: [[\"categoryId\", input?.categoryId]],\n swrOptions: { revalidateOnFocus: false, ...input?.swrOptions },\n });\n return React.useMemo(\n () =>\n Object.create(response, {\n isEmpty: {\n get() {\n return (response.data?.length ?? 0) <= 0;\n },\n enumerable: true,\n },\n }),\n [response]\n );\n },\n};\n","import { SWRHook, useBrands, UseBrands } from \"@plasmicpkgs/commerce\";\nimport React from \"react\";\nimport data from \"../data.json\";\nexport default useBrands as UseBrands<typeof handler>;\n\nexport const handler: SWRHook<any> = {\n fetchOptions: {\n query: \"use-brands\",\n },\n async fetcher({ input, options, fetch }) {\n const vendorsStrings = data.products.map((product) => product.vendor);\n return Array.from(new Set(vendorsStrings).values()).map((v) => {\n const id = v.replace(/\\s+/g, \"-\").toLowerCase();\n return {\n entityId: id,\n name: v,\n path: `brands/${id}`,\n };\n });\n },\n useHook: ({ useData }) => (input) => {\n const response = useData({\n swrOptions: { revalidateOnFocus: false, ...input?.swrOptions },\n });\n return React.useMemo(\n () =>\n Object.create(response, {\n isEmpty: {\n get() {\n return (response.data?.length ?? 0) <= 0;\n },\n enumerable: true,\n },\n }),\n [response]\n );\n },\n};\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes: Add export data\n*/\nexport * from \"./registerable\";\nexport { localProvider, data };\nexport type { LocalProvider };\nimport {\n getCommerceProvider,\n useCommerce as useCoreCommerce,\n} from \"@plasmicpkgs/commerce\";\nimport data from \"./data.json\";\nimport { localProvider, LocalProvider } from \"./provider\";\n\nexport const CommerceProvider = getCommerceProvider(localProvider);\n\nexport const useCommerce = () => useCoreCommerce<LocalProvider>();\n","import { GlobalContextMeta } from \"@plasmicapp/host\";\nimport registerGlobalContext from \"@plasmicapp/host/registerGlobalContext\";\nimport React from \"react\";\nimport { CommerceProvider } from \"./local\";\nimport { Registerable } from \"./registerable\";\n\ninterface CommerceProviderProps {\n children?: React.ReactNode;\n}\n\nexport const commerceProviderMeta: GlobalContextMeta<CommerceProviderProps> = {\n name: \"plasmic-commerce-local-provider\",\n displayName: \"Local Provider\",\n props: {},\n importPath: \"@plasmicpkgs/commerce-local\",\n importName: \"CommerceProviderComponent\",\n};\n\nfunction CommerceProviderComponent(props: CommerceProviderProps) {\n return <CommerceProvider>{props.children}</CommerceProvider>;\n}\n\nexport function registerCommerceProvider(\n loader?: Registerable,\n customCommerceProviderMeta?: GlobalContextMeta<CommerceProviderProps>\n) {\n const doRegisterComponent: typeof registerGlobalContext = (...args) =>\n loader\n ? loader.registerGlobalContext(...args)\n : registerGlobalContext(...args);\n doRegisterComponent(\n CommerceProviderComponent,\n customCommerceProviderMeta ?? commerceProviderMeta\n );\n}\n","import { Registerable } from \"./registerable\";\nimport { registerCommerceProvider } from \"./registerCommerceProvider\";\nexport * from \"./registerable\";\n\nexport * from \"./local\";\n\nexport function registerAll(loader?: Registerable) {\n registerCommerceProvider(loader);\n}\n\nexport { registerCommerceProvider };"],"names":["getCart","cartId","_cartId","Cookies","get","cartStr","cart","JSON","parse","undefined","id","createdAt","currency","code","taxesIncluded","lineItems","lineItemsSubtotalPrice","subtotalPrice","totalPrice","Date","now","toString","set","stringify","createCart","sortProduct","a","b","sortKey","price","value","localeCompare","localProvider","locale","cartCookie","fetcher","_ref","_asyncToGenerator","_regeneratorRuntime","mark","_callee","res","wrap","_context","prev","next","console","log","fetch","sent","ok","json","abrupt","data","stop","apply","arguments","useCart","fetchOptions","query","input","useHook","_ref2","useData","response","swrOptions","_extends","revalidateOnFocus","React","useMemo","Object","create","isEmpty","_response$data$lineIt","_response$data","length","enumerable","useAddItem","item","quantity","Number","isInteger","CommerceError","message","lineItem","variantId","_item$quantity","_iterator","_createForOfIteratorHelperLoose","products","_step","done","variant","product","variants","find","_item$quantity2","currencyCode","currentLineItem","push","newCart","mutate","useCallback","_addItem","_callee2","_context2","_x","useUpdateItem","useRemoveItem","_removeItem","useSearch","search","brandId","sort","count","categoryId","category","categories","filter","_category$products","includes","vendor","replace","toLowerCase","name","slug","slice","found","prefixSearch","useProduct","_data$products$find","site","useCategories","_response$data$length","useBrands","vendorsStrings","map","Array","from","Set","values","v","entityId","path","CommerceProvider","getCommerceProvider","commerceProviderMeta","displayName","props","importPath","importName","CommerceProviderComponent","children","registerCommerceProvider","loader","customCommerceProviderMeta","registerGlobalContext","doRegisterComponent","useCoreCommerce"],"mappings":"4npCAEO,ICiCMA,EAA8C,SACzDC,SAEAA,SAAMC,EAAGD,GAAMC,EAAIC,EAAQC,ICpCA,eDqC3B,IAAMC,EAAUF,EAAQC,ICvCI,gBDwCtBE,EAAOD,EAAUE,KAAKC,MAAMH,QAAWI,EAE7C,OAAKH,GAAQA,EAAKI,KAAOT,EAGhBK,EAAKA,KApC+B,WAC7C,IAAMA,EAAO,CACXI,GAAI,GACJC,UAAW,GACXC,SAAU,CAAEC,KAAM,OAClBC,eAAe,EACfC,UAAW,GACXC,uBAAwB,EACxBC,cAAe,EACfC,WAAY,GAGRjB,EAASkB,KAAKC,MAAMC,WAW1B,OATAlB,EAAQmB,ICrBmB,cDqBArB,GAC3BE,EAAQmB,ICxBoB,eD0B1Bf,KAAKgB,UAAU,CACbb,GAAIT,EACJK,KAAAA,KAIGA,EAWEkB,IEzCEC,EAAc,SACzBC,EACAC,EACAC,GAEA,OAAQA,GACN,IAAK,YACH,OAAOF,EAAEG,MAAMC,MAAQH,EAAEE,MAAMC,OAAS,EAAI,EAC9C,IAAK,aACH,OAAOJ,EAAEG,MAAMC,MAAQH,EAAEE,MAAMC,MAAQ,GAAK,EAC9C,IAAK,gBACH,OAAOJ,EAAEhB,GAAGqB,cAAcJ,EAAEjB,IAC9B,IAAK,cACH,OAAmC,EAA5BgB,EAAEhB,GAAGqB,cAAcJ,EAAEjB,IAC9B,QACE,OAAO,ICHAsB,EAAgB,CAC3BC,OAAQ,QACRC,WFd2B,cEe3BC,mBJfkB,IAAAC,EAAAC,EAAAC,IAAAC,MAAY,SAAAC,IAAA,IAAAC,EAAA,OAAAH,IAAAI,eAAAC,GAAA,cAAAA,EAAAC,KAAAD,EAAAE,MAAA,OACR,OAAtBC,QAAQC,IAAI,WAAUJ,EAAAE,OACJG,MAAM,e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AAY,OAGlB,CAACZ,SCpBMgF,EAAmBC,sBAAoBjH,GCJvCkH,EAAiE,CAC5EtB,KAAM,kCACNuB,YAAa,iBACbC,MAAO,GACPC,WAAY,8BACZC,WAAY,6BAGd,SAASC,EAA0BH,GACjC,OAAOhF,gBAAC4E,OAAkBI,EAAMI,mBAGlBC,EACdC,EACAC,IAE0D,WACxDD,EACIA,EAAOE,sBAAqBrG,MAA5BmG,EAAMlG,WACNoG,EAAqBrG,aAAAC,WAC3BqG,CACEN,QACAI,EAAAA,EAA8BT,kGC1BNQ,GAC1BD,EAAyBC,2DFSA,WAAH,OAASI"}
|
|
1
|
+
{"version":3,"file":"commerce-local.cjs.production.min.js","sources":["../src/fetcher.ts","../src/utils/cart.ts","../src/const.ts","../src/utils/sort-product.ts","../src/provider.ts","../src/cart/use-cart.tsx","../src/cart/use-add-item.tsx","../src/cart/use-update-item.tsx","../src/cart/use-remove-item.tsx","../src/product/use-search.tsx","../src/product/use-product.tsx","../src/site/use-categories.ts","../src/site/use-brands.ts","../src/local.ts","../src/registerCommerceProvider.tsx","../src/index.tsx"],"sourcesContent":["import { Fetcher } from '@plasmicpkgs/commerce';\n\nexport const fetcher: Fetcher = async () => {\n console.log('FETCHER')\n const res = await fetch('./data.json')\n if (res.ok) {\n const { data } = await res.json()\n return data\n }\n throw res\n}\n","import { CartType } from \"@plasmicpkgs/commerce\";\nimport Cookies from \"js-cookie\";\nimport { LOCAL_CART_ID, LOCAL_CART_OBJ } from \"../const\";\n\nconst options: Cookies.CookieAttributes = {\n sameSite: \"none\",\n secure: true,\n};\n\nexport const createCart: () => CartType.Cart = () => {\n const cart = {\n id: \"\",\n createdAt: \"\",\n currency: { code: \"USD\" },\n taxesIncluded: false,\n lineItems: [],\n lineItemsSubtotalPrice: 0,\n subtotalPrice: 0,\n totalPrice: 0,\n };\n\n const cartId = Date.now().toString();\n\n Cookies.set(LOCAL_CART_ID, cartId);\n Cookies.set(\n LOCAL_CART_OBJ,\n JSON.stringify({\n id: cartId,\n cart,\n })\n );\n\n return cart;\n};\n\nexport const getCart: (cartId?: string) => CartType.Cart = (\n cartId?: string\n) => {\n cartId = cartId ?? Cookies.get(LOCAL_CART_ID);\n const cartStr = Cookies.get(LOCAL_CART_OBJ);\n const cart = cartStr ? JSON.parse(cartStr) : undefined;\n\n if (!cart || cart.id !== cartId) {\n return createCart();\n } else {\n return cart.cart;\n }\n};\n\nexport const cartUpdate = (newCart: CartType.Cart) => {\n Cookies.set(\n LOCAL_CART_OBJ,\n JSON.stringify({\n id: Cookies.get(LOCAL_CART_ID),\n cart: newCart,\n })\n );\n\n return newCart;\n};\n","export const LOCAL_CART_OBJ = \"localCartObj\";\n\nexport const LOCAL_CART_ID = \"localCartId\";\n","import data from \"../data.json\";\n\nexport const sortProduct = (\n a: typeof data.products[0],\n b: typeof data.products[0],\n sortKey: string\n) => {\n switch (sortKey) {\n case \"price-asc\":\n return a.price.value < b.price.value ? -1 : 1;\n case \"price-desc\":\n return a.price.value < b.price.value ? 1 : -1;\n case \"trending-desc\":\n return a.id.localeCompare(b.id);\n case \"latest-desc\":\n return a.id.localeCompare(b.id) * -1;\n default:\n return 0;\n }\n};\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes: Removed authentication, customer and wishlist hooks\n*/\nimport { fetcher } from './fetcher'\nimport { handler as useCart } from './cart/use-cart'\nimport { handler as useAddItem } from './cart/use-add-item'\nimport { handler as useUpdateItem } from './cart/use-update-item'\nimport { handler as useRemoveItem } from './cart/use-remove-item'\nimport { handler as useSearch } from './product/use-search'\nimport { handler as useProduct } from './product/use-product'\nimport { handler as useCategories } from './site/use-categories'\nimport { handler as useBrands } from './site/use-brands'\nimport { LOCAL_CART_ID } from './const'\nexport const localProvider = {\n locale: 'en-us',\n cartCookie: LOCAL_CART_ID,\n fetcher: fetcher,\n cart: { useCart, useAddItem, useUpdateItem, useRemoveItem },\n products: { useSearch, useProduct },\n site: { useCategories, useBrands }\n}\n\nexport type LocalProvider = typeof localProvider\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes:\n - Before: just returned an empty cart.\n - Now: Read cart from local storage.\n*/\nimport { SWRHook, useCart, UseCart } from \"@plasmicpkgs/commerce\";\nimport React from \"react\";\nimport { getCart } from \"../utils/cart\";\n\nexport default useCart as UseCart<typeof handler>;\n\nexport const handler: SWRHook<any> = {\n fetchOptions: {\n query: \"use-cart\",\n },\n async fetcher({ input, options, fetch }) {\n return getCart(input.cartId);\n },\n useHook: ({ useData }) => (input) => {\n const response = useData({\n swrOptions: { revalidateOnFocus: false, ...input?.swrOptions },\n });\n return React.useMemo(\n () =>\n Object.create(response, {\n isEmpty: {\n get() {\n return (response.data?.lineItems.length ?? 0) <= 0;\n },\n enumerable: true,\n },\n }),\n [response]\n );\n },\n};\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes:\n - Implemented a local cart\n - The items are added to local storage.\n*/\nimport {\n CommerceError,\n MutationHook,\n useAddItem,\n UseAddItem,\n} from \"@plasmicpkgs/commerce\";\nimport { useCallback } from \"react\";\nimport data from \"../data.json\";\nimport { cartUpdate, getCart } from \"../utils/cart\";\nimport useCart from \"./use-cart\";\n\nexport default useAddItem as UseAddItem<typeof handler>;\nexport const handler: MutationHook<any> = {\n fetchOptions: {\n query: \"use-add-item\",\n },\n async fetcher({ input: item, options, fetch }) {\n if (\n item.quantity &&\n (!Number.isInteger(item.quantity) || item.quantity! < 1)\n ) {\n throw new CommerceError({\n message: \"The item quantity has to be a valid integer greater than 0\",\n });\n }\n\n const lineItem = {\n variantId: item.variantId,\n quantity: item.quantity ?? 1,\n };\n\n const cart = getCart();\n for (const product of data.products) {\n const variant = (product.variants as any[]).find(\n (variant) => variant.id === item.variantId\n );\n if (variant) {\n cart.totalPrice += variant.price * (item.quantity ?? 1);\n cart.currency.code = product.price.currencyCode;\n const currentLineItem = cart.lineItems.find(\n (item) => item.variantId === lineItem.variantId\n );\n if (!currentLineItem) {\n cart.lineItems.push(lineItem as any);\n } else {\n currentLineItem.quantity += lineItem.quantity;\n }\n }\n }\n\n return cartUpdate(cart);\n },\n useHook: ({ fetch }) => () => {\n const { mutate } = useCart();\n return useCallback(\n async function addItem(input) {\n const data = await fetch({ input });\n await mutate(data, false);\n return data;\n },\n [fetch, mutate]\n );\n },\n};\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes: None\n*/\nimport { MutationHook } from '@plasmicpkgs/commerce'\nimport { useUpdateItem,\n UseUpdateItem,\n} from '@plasmicpkgs/commerce'\n\nexport default useUpdateItem as UseUpdateItem<any>\n\nexport const handler: MutationHook<any> = {\n fetchOptions: {\n query: '',\n },\n async fetcher({ input, options, fetch }) {},\n useHook:\n ({ fetch }) =>\n () => {\n return async function addItem() {\n return {}\n }\n },\n}\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes: None\n*/\nimport { MutationHook } from '@plasmicpkgs/commerce'\nimport {useRemoveItem,\n UseRemoveItem,\n} from '@plasmicpkgs/commerce'\n\nexport default useRemoveItem as UseRemoveItem<typeof handler>\n\nexport const handler: MutationHook<any> = {\n fetchOptions: {\n query: '',\n },\n async fetcher({ input, options, fetch }) {},\n useHook:\n ({ fetch }) =>\n () => {\n return async function removeItem(input) {\n return {}\n }\n },\n}\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes: None\n*/\nimport { SWRHook, useSearch, UseSearch } from \"@plasmicpkgs/commerce\";\nimport data from \"../data.json\";\nimport { sortProduct } from \"../utils/sort-product\";\nconst useSearchTyped: UseSearch<typeof handler> = useSearch;\nexport default useSearchTyped;\n\nexport const handler: SWRHook<any> = {\n fetchOptions: {\n query: \"use-search\",\n },\n async fetcher({ input, options, fetch }) {\n const { search, categoryId, brandId, sort, count } = input;\n\n let products = data.products;\n\n if (categoryId) {\n const category = data.categories.find(\n (category) => category.id === categoryId\n );\n products = data.products.filter((product) =>\n category?.products?.includes(product.id)\n );\n }\n\n if (brandId) {\n products = products.filter(\n (product) =>\n product.vendor.replace(/\\s+/g, \"-\").toLowerCase() ===\n `${brandId}`.toLowerCase()\n );\n }\n\n if (search) {\n products = products.filter(\n (product) =>\n product.name.toLowerCase().includes(`${search}`.toLowerCase()) ||\n product.slug.toLowerCase().includes(`${search}`.toLowerCase())\n );\n }\n\n if (sort) {\n products = products.sort((a, b) => sortProduct(a, b, sort));\n }\n\n return {\n products: products.slice(0, count),\n found: products.length > 0,\n };\n },\n useHook:\n ({ useData }) =>\n (input = {}) => {\n return useData({\n input: [\n [\"search\", input.search],\n [\"prefixSearch\", input.prefixSearch],\n [\"categoryId\", input.categoryId],\n [\"brandId\", input.brandId],\n [\"sort\", input.sort],\n [\"locale\", input.locale],\n [\"count\", input.count],\n ],\n swrOptions: {\n revalidateOnFocus: false,\n ...input.swrOptions,\n },\n });\n },\n};\n","import { SWRHook, useProduct, UseProduct } from \"@plasmicpkgs/commerce\";\nimport data from \"../data.json\";\nexport default useProduct as UseProduct<typeof handler>;\n\nexport const handler: SWRHook<any> = {\n fetchOptions: {\n query: \"use-product\",\n },\n async fetcher({ input, options, fetch }) {\n const { id } = input;\n\n return (\n data.products.find((product) =>\n [product.id, product.slug].includes(id)\n ) ?? null\n );\n },\n useHook: ({ useData }) => (input = {}) => {\n return useData({\n input: [[\"id\", input.id]],\n swrOptions: {\n revalidateOnFocus: false,\n ...input.swrOptions,\n },\n });\n },\n};\n","import { SWRHook, useCategories, UseCategories } from \"@plasmicpkgs/commerce\";\nimport React from \"react\";\nimport data from \"../data.json\";\nexport default useCategories as UseCategories<typeof handler>;\n\nexport const handler: SWRHook<any> = {\n fetchOptions: {\n query: \"use-categories\",\n },\n async fetcher({ input, options, fetch }) {\n const { categoryId } = input;\n if (!categoryId) {\n return data.categories;\n }\n const category = data.categories.find(\n (category) => category.id === categoryId\n );\n return category ? [category] : [];\n },\n useHook: ({ useData }) => (input) => {\n const response = useData({\n input: [[\"categoryId\", input?.categoryId]],\n swrOptions: { revalidateOnFocus: false, ...input?.swrOptions },\n });\n return React.useMemo(\n () =>\n Object.create(response, {\n isEmpty: {\n get() {\n return (response.data?.length ?? 0) <= 0;\n },\n enumerable: true,\n },\n }),\n [response]\n );\n },\n};\n","import { SWRHook, useBrands, UseBrands } from \"@plasmicpkgs/commerce\";\nimport React from \"react\";\nimport data from \"../data.json\";\nexport default useBrands as UseBrands<typeof handler>;\n\nexport const handler: SWRHook<any> = {\n fetchOptions: {\n query: \"use-brands\",\n },\n async fetcher({ input, options, fetch }) {\n const vendorsStrings = data.products.map((product) => product.vendor);\n return Array.from(new Set(vendorsStrings).values()).map((v) => {\n const id = v.replace(/\\s+/g, \"-\").toLowerCase();\n return {\n entityId: id,\n name: v,\n path: `brands/${id}`,\n };\n });\n },\n useHook: ({ useData }) => (input) => {\n const response = useData({\n swrOptions: { revalidateOnFocus: false, ...input?.swrOptions },\n });\n return React.useMemo(\n () =>\n Object.create(response, {\n isEmpty: {\n get() {\n return (response.data?.length ?? 0) <= 0;\n },\n enumerable: true,\n },\n }),\n [response]\n );\n },\n};\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes: Add export data\n*/\nexport * from \"./registerable\";\nexport { localProvider, data };\nexport type { LocalProvider };\nimport {\n getCommerceProvider,\n useCommerce as useCoreCommerce,\n} from \"@plasmicpkgs/commerce\";\nimport data from \"./data.json\";\nimport { localProvider, LocalProvider } from \"./provider\";\n\nexport const CommerceProvider = getCommerceProvider(localProvider);\n\nexport const useCommerce = () => useCoreCommerce<LocalProvider>();\n","import { GlobalContextMeta } from \"@plasmicapp/host\";\nimport registerGlobalContext from \"@plasmicapp/host/registerGlobalContext\";\nimport React from \"react\";\nimport { CommerceProvider } from \"./local\";\nimport { Registerable } from \"./registerable\";\n\ninterface CommerceProviderProps {\n children?: React.ReactNode;\n}\n\nexport const commerceProviderMeta: GlobalContextMeta<CommerceProviderProps> = {\n name: \"plasmic-commerce-local-provider\",\n displayName: \"Local Provider\",\n props: {},\n importPath: \"@plasmicpkgs/commerce-local\",\n importName: \"CommerceProviderComponent\",\n};\n\nfunction CommerceProviderComponent(props: CommerceProviderProps) {\n return <CommerceProvider>{props.children}</CommerceProvider>;\n}\n\nexport function registerCommerceProvider(\n loader?: Registerable,\n customCommerceProviderMeta?: GlobalContextMeta<CommerceProviderProps>\n) {\n const doRegisterComponent: typeof registerGlobalContext = (...args) =>\n loader\n ? loader.registerGlobalContext(...args)\n : registerGlobalContext(...args);\n doRegisterComponent(\n CommerceProviderComponent,\n customCommerceProviderMeta ?? commerceProviderMeta\n );\n}\n","import { Registerable } from \"./registerable\";\nimport { registerCommerceProvider } from \"./registerCommerceProvider\";\nexport * from \"./registerable\";\n\nexport * from \"./local\";\n\nexport function registerAll(loader?: Registerable) {\n registerCommerceProvider(loader);\n}\n\nexport { registerCommerceProvider };"],"names":["getCart","cartId","_cartId","Cookies","get","cartStr","cart","JSON","parse","undefined","id","createdAt","currency","code","taxesIncluded","lineItems","lineItemsSubtotalPrice","subtotalPrice","totalPrice","Date","now","toString","set","stringify","createCart","sortProduct","a","b","sortKey","price","value","localeCompare","localProvider","locale","cartCookie","fetcher","_ref","_asyncToGenerator","_regeneratorRuntime","mark","_callee","res","wrap","_context","prev","next","console","log","fetch","sent","ok","json","abrupt","data","stop","apply","arguments","useCart","fetchOptions","query","input","useHook","_ref2","useData","response","swrOptions","_extends","revalidateOnFocus","React","useMemo","Object","create","isEmpty","_response$data$lineIt","_response$data","length","enumerable","useAddItem","item","quantity","Number","isInteger","CommerceError","message","lineItem","variantId","_item$quantity","_iterator","_createForOfIteratorHelperLoose","products","_step","done","variant","product","variants","find","_item$quantity2","currencyCode","currentLineItem","push","newCart","mutate","useCallback","_addItem","_callee2","_context2","_x","useUpdateItem","useRemoveItem","_removeItem","useSearch","search","brandId","sort","count","categoryId","category","categories","filter","_category$products","includes","vendor","replace","toLowerCase","name","slug","slice","found","prefixSearch","useProduct","_data$products$find","site","useCategories","_response$data$length","useBrands","vendorsStrings","map","Array","from","Set","values","v","entityId","path","CommerceProvider","getCommerceProvider","commerceProviderMeta","displayName","props","importPath","importName","CommerceProviderComponent","children","registerCommerceProvider","loader","customCommerceProviderMeta","registerGlobalContext","doRegisterComponent","useCoreCommerce"],"mappings":"wkpCAEO,ICiCMA,EAA8C,SACzDC,SAEAA,SAAMC,EAAGD,GAAMC,EAAIC,EAAQC,ICpCA,eDqC3B,IAAMC,EAAUF,EAAQC,ICvCI,gBDwCtBE,EAAOD,EAAUE,KAAKC,MAAMH,QAAWI,EAE7C,OAAKH,GAAQA,EAAKI,KAAOT,EAGhBK,EAAKA,KApC+B,WAC7C,IAAMA,EAAO,CACXI,GAAI,GACJC,UAAW,GACXC,SAAU,CAAEC,KAAM,OAClBC,eAAe,EACfC,UAAW,GACXC,uBAAwB,EACxBC,cAAe,EACfC,WAAY,GAGRjB,EAASkB,KAAKC,MAAMC,WAW1B,OATAlB,EAAQmB,ICrBmB,cDqBArB,GAC3BE,EAAQmB,ICxBoB,eD0B1Bf,KAAKgB,UAAU,CACbb,GAAIT,EACJK,KAAAA,KAIGA,EAWEkB,IEzCEC,EAAc,SACzBC,EACAC,EACAC,GAEA,OAAQA,GACN,IAAK,YACH,OAAOF,EAAEG,MAAMC,MAAQH,EAAEE,MAAMC,OAAS,EAAI,EAC9C,IAAK,aACH,OAAOJ,EAAEG,MAAMC,MAAQH,EAAEE,MAAMC,MAAQ,GAAK,EAC9C,IAAK,gBACH,OAAOJ,EAAEhB,GAAGqB,cAAcJ,EAAEjB,IAC9B,IAAK,cACH,OAAmC,EAA5BgB,EAAEhB,GAAGqB,cAAcJ,EAAEjB,IAC9B,QACE,OAAO,ICHAsB,EAAgB,CAC3BC,OAAQ,QACRC,WFd2B,cEe3BC,mBJfkB,IAAAC,EAAAC,EAAAC,IAAAC,MAAY,SAAAC,IAAA,IAAAC,EAAA,OAAAH,IAAAI,eAAAC,GAAA,cAAAA,EAAAC,KAAAD,EAAAE,MAAA,OACR,OAAtBC,QAAQC,IAAI,WAAUJ,EA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,IAAM,GAEzCzD,YAAY,OAGlB,CAACZ,SCpBMgF,EAAmBC,sBAAoBjH,GCJvCkH,EAAiE,CAC5EtB,KAAM,kCACNuB,YAAa,iBACbC,MAAO,GACPC,WAAY,8BACZC,WAAY,6BAGd,SAASC,EAA0BH,GACjC,OAAOhF,gBAAC4E,OAAkBI,EAAMI,mBAGlBC,EACdC,EACAC,IAE0D,WACxDD,EACIA,EAAOE,sBAAqBrG,MAA5BmG,EAAMlG,WACNoG,EAAqBrG,aAAAC,WAC3BqG,CACEN,QACAI,EAAAA,EAA8BT,kGC1BNQ,GAC1BD,EAAyBC,2DFSA,WAAH,OAASI"}
|
|
@@ -2226,6 +2226,62 @@ var data = {
|
|
|
2226
2226
|
products: products
|
|
2227
2227
|
};
|
|
2228
2228
|
|
|
2229
|
+
function _arrayLikeToArray(r, a) {
|
|
2230
|
+
(null == a || a > r.length) && (a = r.length);
|
|
2231
|
+
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
2232
|
+
return n;
|
|
2233
|
+
}
|
|
2234
|
+
function asyncGeneratorStep(n, t, e, r, o, a, c) {
|
|
2235
|
+
try {
|
|
2236
|
+
var i = n[a](c),
|
|
2237
|
+
u = i.value;
|
|
2238
|
+
} catch (n) {
|
|
2239
|
+
return void e(n);
|
|
2240
|
+
}
|
|
2241
|
+
i.done ? t(u) : Promise.resolve(u).then(r, o);
|
|
2242
|
+
}
|
|
2243
|
+
function _asyncToGenerator(n) {
|
|
2244
|
+
return function () {
|
|
2245
|
+
var t = this,
|
|
2246
|
+
e = arguments;
|
|
2247
|
+
return new Promise(function (r, o) {
|
|
2248
|
+
var a = n.apply(t, e);
|
|
2249
|
+
function _next(n) {
|
|
2250
|
+
asyncGeneratorStep(a, r, o, _next, _throw, "next", n);
|
|
2251
|
+
}
|
|
2252
|
+
function _throw(n) {
|
|
2253
|
+
asyncGeneratorStep(a, r, o, _next, _throw, "throw", n);
|
|
2254
|
+
}
|
|
2255
|
+
_next(void 0);
|
|
2256
|
+
});
|
|
2257
|
+
};
|
|
2258
|
+
}
|
|
2259
|
+
function _createForOfIteratorHelperLoose(r, e) {
|
|
2260
|
+
var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
2261
|
+
if (t) return (t = t.call(r)).next.bind(t);
|
|
2262
|
+
if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) {
|
|
2263
|
+
t && (r = t);
|
|
2264
|
+
var o = 0;
|
|
2265
|
+
return function () {
|
|
2266
|
+
return o >= r.length ? {
|
|
2267
|
+
done: !0
|
|
2268
|
+
} : {
|
|
2269
|
+
done: !1,
|
|
2270
|
+
value: r[o++]
|
|
2271
|
+
};
|
|
2272
|
+
};
|
|
2273
|
+
}
|
|
2274
|
+
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
2275
|
+
}
|
|
2276
|
+
function _extends() {
|
|
2277
|
+
return _extends = Object.assign ? Object.assign.bind() : function (n) {
|
|
2278
|
+
for (var e = 1; e < arguments.length; e++) {
|
|
2279
|
+
var t = arguments[e];
|
|
2280
|
+
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
2281
|
+
}
|
|
2282
|
+
return n;
|
|
2283
|
+
}, _extends.apply(null, arguments);
|
|
2284
|
+
}
|
|
2229
2285
|
function _regeneratorRuntime() {
|
|
2230
2286
|
_regeneratorRuntime = function () {
|
|
2231
2287
|
return e;
|
|
@@ -2334,7 +2390,7 @@ function _regeneratorRuntime() {
|
|
|
2334
2390
|
function makeInvokeMethod(e, r, n) {
|
|
2335
2391
|
var o = h;
|
|
2336
2392
|
return function (i, a) {
|
|
2337
|
-
if (o === f) throw
|
|
2393
|
+
if (o === f) throw Error("Generator is already running");
|
|
2338
2394
|
if (o === s) {
|
|
2339
2395
|
if ("throw" === i) throw a;
|
|
2340
2396
|
return {
|
|
@@ -2476,7 +2532,7 @@ function _regeneratorRuntime() {
|
|
|
2476
2532
|
} else if (c) {
|
|
2477
2533
|
if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);
|
|
2478
2534
|
} else {
|
|
2479
|
-
if (!u) throw
|
|
2535
|
+
if (!u) throw Error("try statement without catch or finally");
|
|
2480
2536
|
if (this.prev < i.finallyLoc) return handle(i.finallyLoc);
|
|
2481
2537
|
}
|
|
2482
2538
|
}
|
|
@@ -2516,7 +2572,7 @@ function _regeneratorRuntime() {
|
|
|
2516
2572
|
return o;
|
|
2517
2573
|
}
|
|
2518
2574
|
}
|
|
2519
|
-
throw
|
|
2575
|
+
throw Error("illegal catch attempt");
|
|
2520
2576
|
},
|
|
2521
2577
|
delegateYield: function (e, r, n) {
|
|
2522
2578
|
return this.delegate = {
|
|
@@ -2527,80 +2583,12 @@ function _regeneratorRuntime() {
|
|
|
2527
2583
|
}
|
|
2528
2584
|
}, e;
|
|
2529
2585
|
}
|
|
2530
|
-
function
|
|
2531
|
-
|
|
2532
|
-
|
|
2533
|
-
var
|
|
2534
|
-
|
|
2535
|
-
reject(error);
|
|
2536
|
-
return;
|
|
2537
|
-
}
|
|
2538
|
-
if (info.done) {
|
|
2539
|
-
resolve(value);
|
|
2540
|
-
} else {
|
|
2541
|
-
Promise.resolve(value).then(_next, _throw);
|
|
2542
|
-
}
|
|
2543
|
-
}
|
|
2544
|
-
function _asyncToGenerator(fn) {
|
|
2545
|
-
return function () {
|
|
2546
|
-
var self = this,
|
|
2547
|
-
args = arguments;
|
|
2548
|
-
return new Promise(function (resolve, reject) {
|
|
2549
|
-
var gen = fn.apply(self, args);
|
|
2550
|
-
function _next(value) {
|
|
2551
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value);
|
|
2552
|
-
}
|
|
2553
|
-
function _throw(err) {
|
|
2554
|
-
asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err);
|
|
2555
|
-
}
|
|
2556
|
-
_next(undefined);
|
|
2557
|
-
});
|
|
2558
|
-
};
|
|
2559
|
-
}
|
|
2560
|
-
function _extends() {
|
|
2561
|
-
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
2562
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
2563
|
-
var source = arguments[i];
|
|
2564
|
-
for (var key in source) {
|
|
2565
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
2566
|
-
target[key] = source[key];
|
|
2567
|
-
}
|
|
2568
|
-
}
|
|
2569
|
-
}
|
|
2570
|
-
return target;
|
|
2571
|
-
};
|
|
2572
|
-
return _extends.apply(this, arguments);
|
|
2573
|
-
}
|
|
2574
|
-
function _unsupportedIterableToArray(o, minLen) {
|
|
2575
|
-
if (!o) return;
|
|
2576
|
-
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
2577
|
-
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
2578
|
-
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
2579
|
-
if (n === "Map" || n === "Set") return Array.from(o);
|
|
2580
|
-
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
2581
|
-
}
|
|
2582
|
-
function _arrayLikeToArray(arr, len) {
|
|
2583
|
-
if (len == null || len > arr.length) len = arr.length;
|
|
2584
|
-
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
2585
|
-
return arr2;
|
|
2586
|
-
}
|
|
2587
|
-
function _createForOfIteratorHelperLoose(o, allowArrayLike) {
|
|
2588
|
-
var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
|
|
2589
|
-
if (it) return (it = it.call(o)).next.bind(it);
|
|
2590
|
-
if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
|
|
2591
|
-
if (it) o = it;
|
|
2592
|
-
var i = 0;
|
|
2593
|
-
return function () {
|
|
2594
|
-
if (i >= o.length) return {
|
|
2595
|
-
done: true
|
|
2596
|
-
};
|
|
2597
|
-
return {
|
|
2598
|
-
done: false,
|
|
2599
|
-
value: o[i++]
|
|
2600
|
-
};
|
|
2601
|
-
};
|
|
2586
|
+
function _unsupportedIterableToArray(r, a) {
|
|
2587
|
+
if (r) {
|
|
2588
|
+
if ("string" == typeof r) return _arrayLikeToArray(r, a);
|
|
2589
|
+
var t = {}.toString.call(r).slice(8, -1);
|
|
2590
|
+
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
|
|
2602
2591
|
}
|
|
2603
|
-
throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
2604
2592
|
}
|
|
2605
2593
|
|
|
2606
2594
|
var fetcher = /*#__PURE__*/function () {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"commerce-local.esm.js","sources":["../src/fetcher.ts","../src/const.ts","../src/utils/cart.ts","../src/cart/use-cart.tsx","../src/cart/use-add-item.tsx","../src/cart/use-update-item.tsx","../src/cart/use-remove-item.tsx","../src/utils/sort-product.ts","../src/product/use-search.tsx","../src/product/use-product.tsx","../src/site/use-categories.ts","../src/site/use-brands.ts","../src/provider.ts","../src/local.ts","../src/registerCommerceProvider.tsx","../src/index.tsx"],"sourcesContent":["import { Fetcher } from '@plasmicpkgs/commerce';\n\nexport const fetcher: Fetcher = async () => {\n console.log('FETCHER')\n const res = await fetch('./data.json')\n if (res.ok) {\n const { data } = await res.json()\n return data\n }\n throw res\n}\n","export const LOCAL_CART_OBJ = \"localCartObj\";\n\nexport const LOCAL_CART_ID = \"localCartId\";\n","import { CartType } from \"@plasmicpkgs/commerce\";\nimport Cookies from \"js-cookie\";\nimport { LOCAL_CART_ID, LOCAL_CART_OBJ } from \"../const\";\n\nconst options: Cookies.CookieAttributes = {\n sameSite: \"none\",\n secure: true,\n};\n\nexport const createCart: () => CartType.Cart = () => {\n const cart = {\n id: \"\",\n createdAt: \"\",\n currency: { code: \"USD\" },\n taxesIncluded: false,\n lineItems: [],\n lineItemsSubtotalPrice: 0,\n subtotalPrice: 0,\n totalPrice: 0,\n };\n\n const cartId = Date.now().toString();\n\n Cookies.set(LOCAL_CART_ID, cartId);\n Cookies.set(\n LOCAL_CART_OBJ,\n JSON.stringify({\n id: cartId,\n cart,\n })\n );\n\n return cart;\n};\n\nexport const getCart: (cartId?: string) => CartType.Cart = (\n cartId?: string\n) => {\n cartId = cartId ?? Cookies.get(LOCAL_CART_ID);\n const cartStr = Cookies.get(LOCAL_CART_OBJ);\n const cart = cartStr ? JSON.parse(cartStr) : undefined;\n\n if (!cart || cart.id !== cartId) {\n return createCart();\n } else {\n return cart.cart;\n }\n};\n\nexport const cartUpdate = (newCart: CartType.Cart) => {\n Cookies.set(\n LOCAL_CART_OBJ,\n JSON.stringify({\n id: Cookies.get(LOCAL_CART_ID),\n cart: newCart,\n })\n );\n\n return newCart;\n};\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes:\n - Before: just returned an empty cart.\n - Now: Read cart from local storage.\n*/\nimport { SWRHook, useCart, UseCart } from \"@plasmicpkgs/commerce\";\nimport React from \"react\";\nimport { getCart } from \"../utils/cart\";\n\nexport default useCart as UseCart<typeof handler>;\n\nexport const handler: SWRHook<any> = {\n fetchOptions: {\n query: \"use-cart\",\n },\n async fetcher({ input, options, fetch }) {\n return getCart(input.cartId);\n },\n useHook: ({ useData }) => (input) => {\n const response = useData({\n swrOptions: { revalidateOnFocus: false, ...input?.swrOptions },\n });\n return React.useMemo(\n () =>\n Object.create(response, {\n isEmpty: {\n get() {\n return (response.data?.lineItems.length ?? 0) <= 0;\n },\n enumerable: true,\n },\n }),\n [response]\n );\n },\n};\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes:\n - Implemented a local cart\n - The items are added to local storage.\n*/\nimport {\n CommerceError,\n MutationHook,\n useAddItem,\n UseAddItem,\n} from \"@plasmicpkgs/commerce\";\nimport { useCallback } from \"react\";\nimport data from \"../data.json\";\nimport { cartUpdate, getCart } from \"../utils/cart\";\nimport useCart from \"./use-cart\";\n\nexport default useAddItem as UseAddItem<typeof handler>;\nexport const handler: MutationHook<any> = {\n fetchOptions: {\n query: \"use-add-item\",\n },\n async fetcher({ input: item, options, fetch }) {\n if (\n item.quantity &&\n (!Number.isInteger(item.quantity) || item.quantity! < 1)\n ) {\n throw new CommerceError({\n message: \"The item quantity has to be a valid integer greater than 0\",\n });\n }\n\n const lineItem = {\n variantId: item.variantId,\n quantity: item.quantity ?? 1,\n };\n\n const cart = getCart();\n for (const product of data.products) {\n const variant = (product.variants as any[]).find(\n (variant) => variant.id === item.variantId\n );\n if (variant) {\n cart.totalPrice += variant.price * (item.quantity ?? 1);\n cart.currency.code = product.price.currencyCode;\n const currentLineItem = cart.lineItems.find(\n (item) => item.variantId === lineItem.variantId\n );\n if (!currentLineItem) {\n cart.lineItems.push(lineItem as any);\n } else {\n currentLineItem.quantity += lineItem.quantity;\n }\n }\n }\n\n return cartUpdate(cart);\n },\n useHook: ({ fetch }) => () => {\n const { mutate } = useCart();\n return useCallback(\n async function addItem(input) {\n const data = await fetch({ input });\n await mutate(data, false);\n return data;\n },\n [fetch, mutate]\n );\n },\n};\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes: None\n*/\nimport { MutationHook } from '@plasmicpkgs/commerce'\nimport { useUpdateItem,\n UseUpdateItem,\n} from '@plasmicpkgs/commerce'\n\nexport default useUpdateItem as UseUpdateItem<any>\n\nexport const handler: MutationHook<any> = {\n fetchOptions: {\n query: '',\n },\n async fetcher({ input, options, fetch }) {},\n useHook:\n ({ fetch }) =>\n () => {\n return async function addItem() {\n return {}\n }\n },\n}\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes: None\n*/\nimport { MutationHook } from '@plasmicpkgs/commerce'\nimport {useRemoveItem,\n UseRemoveItem,\n} from '@plasmicpkgs/commerce'\n\nexport default useRemoveItem as UseRemoveItem<typeof handler>\n\nexport const handler: MutationHook<any> = {\n fetchOptions: {\n query: '',\n },\n async fetcher({ input, options, fetch }) {},\n useHook:\n ({ fetch }) =>\n () => {\n return async function removeItem(input) {\n return {}\n }\n },\n}\n","import data from \"../data.json\";\n\nexport const sortProduct = (\n a: typeof data.products[0],\n b: typeof data.products[0],\n sortKey: string\n) => {\n switch (sortKey) {\n case \"price-asc\":\n return a.price.value < b.price.value ? -1 : 1;\n case \"price-desc\":\n return a.price.value < b.price.value ? 1 : -1;\n case \"trending-desc\":\n return a.id.localeCompare(b.id);\n case \"latest-desc\":\n return a.id.localeCompare(b.id) * -1;\n default:\n return 0;\n }\n};\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes: None\n*/\nimport { SWRHook, useSearch, UseSearch } from \"@plasmicpkgs/commerce\";\nimport data from \"../data.json\";\nimport { sortProduct } from \"../utils/sort-product\";\nconst useSearchTyped: UseSearch<typeof handler> = useSearch;\nexport default useSearchTyped;\n\nexport const handler: SWRHook<any> = {\n fetchOptions: {\n query: \"use-search\",\n },\n async fetcher({ input, options, fetch }) {\n const { search, categoryId, brandId, sort, count } = input;\n\n let products = data.products;\n\n if (categoryId) {\n const category = data.categories.find(\n (category) => category.id === categoryId\n );\n products = data.products.filter((product) =>\n category?.products?.includes(product.id)\n );\n }\n\n if (brandId) {\n products = products.filter(\n (product) =>\n product.vendor.replace(/\\s+/g, \"-\").toLowerCase() ===\n `${brandId}`.toLowerCase()\n );\n }\n\n if (search) {\n products = products.filter(\n (product) =>\n product.name.toLowerCase().includes(`${search}`.toLowerCase()) ||\n product.slug.toLowerCase().includes(`${search}`.toLowerCase())\n );\n }\n\n if (sort) {\n products = products.sort((a, b) => sortProduct(a, b, sort));\n }\n\n return {\n products: products.slice(0, count),\n found: products.length > 0,\n };\n },\n useHook:\n ({ useData }) =>\n (input = {}) => {\n return useData({\n input: [\n [\"search\", input.search],\n [\"prefixSearch\", input.prefixSearch],\n [\"categoryId\", input.categoryId],\n [\"brandId\", input.brandId],\n [\"sort\", input.sort],\n [\"locale\", input.locale],\n [\"count\", input.count],\n ],\n swrOptions: {\n revalidateOnFocus: false,\n ...input.swrOptions,\n },\n });\n },\n};\n","import { SWRHook, useProduct, UseProduct } from \"@plasmicpkgs/commerce\";\nimport data from \"../data.json\";\nexport default useProduct as UseProduct<typeof handler>;\n\nexport const handler: SWRHook<any> = {\n fetchOptions: {\n query: \"use-product\",\n },\n async fetcher({ input, options, fetch }) {\n const { id } = input;\n\n return (\n data.products.find((product) =>\n [product.id, product.slug].includes(id)\n ) ?? null\n );\n },\n useHook: ({ useData }) => (input = {}) => {\n return useData({\n input: [[\"id\", input.id]],\n swrOptions: {\n revalidateOnFocus: false,\n ...input.swrOptions,\n },\n });\n },\n};\n","import { SWRHook, useCategories, UseCategories } from \"@plasmicpkgs/commerce\";\nimport React from \"react\";\nimport data from \"../data.json\";\nexport default useCategories as UseCategories<typeof handler>;\n\nexport const handler: SWRHook<any> = {\n fetchOptions: {\n query: \"use-categories\",\n },\n async fetcher({ input, options, fetch }) {\n const { categoryId } = input;\n if (!categoryId) {\n return data.categories;\n }\n const category = data.categories.find(\n (category) => category.id === categoryId\n );\n return category ? [category] : [];\n },\n useHook: ({ useData }) => (input) => {\n const response = useData({\n input: [[\"categoryId\", input?.categoryId]],\n swrOptions: { revalidateOnFocus: false, ...input?.swrOptions },\n });\n return React.useMemo(\n () =>\n Object.create(response, {\n isEmpty: {\n get() {\n return (response.data?.length ?? 0) <= 0;\n },\n enumerable: true,\n },\n }),\n [response]\n );\n },\n};\n","import { SWRHook, useBrands, UseBrands } from \"@plasmicpkgs/commerce\";\nimport React from \"react\";\nimport data from \"../data.json\";\nexport default useBrands as UseBrands<typeof handler>;\n\nexport const handler: SWRHook<any> = {\n fetchOptions: {\n query: \"use-brands\",\n },\n async fetcher({ input, options, fetch }) {\n const vendorsStrings = data.products.map((product) => product.vendor);\n return Array.from(new Set(vendorsStrings).values()).map((v) => {\n const id = v.replace(/\\s+/g, \"-\").toLowerCase();\n return {\n entityId: id,\n name: v,\n path: `brands/${id}`,\n };\n });\n },\n useHook: ({ useData }) => (input) => {\n const response = useData({\n swrOptions: { revalidateOnFocus: false, ...input?.swrOptions },\n });\n return React.useMemo(\n () =>\n Object.create(response, {\n isEmpty: {\n get() {\n return (response.data?.length ?? 0) <= 0;\n },\n enumerable: true,\n },\n }),\n [response]\n );\n },\n};\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes: Removed authentication, customer and wishlist hooks\n*/\nimport { fetcher } from './fetcher'\nimport { handler as useCart } from './cart/use-cart'\nimport { handler as useAddItem } from './cart/use-add-item'\nimport { handler as useUpdateItem } from './cart/use-update-item'\nimport { handler as useRemoveItem } from './cart/use-remove-item'\nimport { handler as useSearch } from './product/use-search'\nimport { handler as useProduct } from './product/use-product'\nimport { handler as useCategories } from './site/use-categories'\nimport { handler as useBrands } from './site/use-brands'\nimport { LOCAL_CART_ID } from './const'\nexport const localProvider = {\n locale: 'en-us',\n cartCookie: LOCAL_CART_ID,\n fetcher: fetcher,\n cart: { useCart, useAddItem, useUpdateItem, useRemoveItem },\n products: { useSearch, useProduct },\n site: { useCategories, useBrands }\n}\n\nexport type LocalProvider = typeof localProvider\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes: Add export data\n*/\nexport * from \"./registerable\";\nexport { localProvider, data };\nexport type { LocalProvider };\nimport {\n getCommerceProvider,\n useCommerce as useCoreCommerce,\n} from \"@plasmicpkgs/commerce\";\nimport data from \"./data.json\";\nimport { localProvider, LocalProvider } from \"./provider\";\n\nexport const CommerceProvider = getCommerceProvider(localProvider);\n\nexport const useCommerce = () => useCoreCommerce<LocalProvider>();\n","import { GlobalContextMeta } from \"@plasmicapp/host\";\nimport registerGlobalContext from \"@plasmicapp/host/registerGlobalContext\";\nimport React from \"react\";\nimport { CommerceProvider } from \"./local\";\nimport { Registerable } from \"./registerable\";\n\ninterface CommerceProviderProps {\n children?: React.ReactNode;\n}\n\nexport const commerceProviderMeta: GlobalContextMeta<CommerceProviderProps> = {\n name: \"plasmic-commerce-local-provider\",\n displayName: \"Local Provider\",\n props: {},\n importPath: \"@plasmicpkgs/commerce-local\",\n importName: \"CommerceProviderComponent\",\n};\n\nfunction CommerceProviderComponent(props: CommerceProviderProps) {\n return <CommerceProvider>{props.children}</CommerceProvider>;\n}\n\nexport function registerCommerceProvider(\n loader?: Registerable,\n customCommerceProviderMeta?: GlobalContextMeta<CommerceProviderProps>\n) {\n const doRegisterComponent: typeof registerGlobalContext = (...args) =>\n loader\n ? loader.registerGlobalContext(...args)\n : registerGlobalContext(...args);\n doRegisterComponent(\n CommerceProviderComponent,\n customCommerceProviderMeta ?? commerceProviderMeta\n );\n}\n","import { Registerable } from \"./registerable\";\nimport { registerCommerceProvider } from \"./registerCommerceProvider\";\nexport * from \"./registerable\";\n\nexport * from \"./local\";\n\nexport function registerAll(loader?: Registerable) {\n registerCommerceProvider(loader);\n}\n\nexport { registerCommerceProvider };"],"names":["fetcher","_ref","_asyncToGenerator","_regeneratorRuntime","mark","_callee","res","_yield$res$json","data","wrap","_callee$","_context","prev","next","console","log","fetch","sent","ok","json","abrupt","stop","apply","arguments","LOCAL_CART_OBJ","LOCAL_CART_ID","createCart","cart","id","createdAt","currency","code","taxesIncluded","lineItems","lineItemsSubtotalPrice","subtotalPrice","totalPrice","cartId","Date","now","toString","Cookies","set","JSON","stringify","getCart","_cartId","get","cartStr","parse","undefined","cartUpdate","newCart","handler","fetchOptions","query","input","options","useHook","_ref2","useData","response","swrOptions","_extends","revalidateOnFocus","React","useMemo","Object","create","isEmpty","_response$data$lineIt","_response$data","length","enumerable","item","quantity","Number","isInteger","CommerceError","message","lineItem","variantId","_item$quantity","_iterator","_createForOfIteratorHelperLoose","products","_step","done","product","value","variant","variants","find","price","_item$quantity2","currencyCode","currentLineItem","push","_useCart","useCart","mutate","useCallback","_addItem","_callee2","_callee2$","_context2","addItem","_x","_removeItem","removeItem","sortProduct","a","b","sortKey","localeCompare","search","categoryId","brandId","sort","count","category","categories","filter","_category$products","includes","vendor","replace","toLowerCase","name","slug","slice","found","prefixSearch","locale","_data$products$find","_response$data$length","vendorsStrings","map","Array","from","Set","values","v","entityId","path","localProvider","cartCookie","useAddItem","useUpdateItem","useRemoveItem","useSearch","useProduct","site","useCategories","useBrands","CommerceProvider","getCommerceProvider","useCommerce","useCoreCommerce","commerceProviderMeta","displayName","props","importPath","importName","CommerceProviderComponent","children","registerCommerceProvider","loader","customCommerceProviderMeta","doRegisterComponent","registerGlobalContext","registerAll"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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
|
|
1
|
+
{"version":3,"file":"commerce-local.esm.js","sources":["../src/fetcher.ts","../src/const.ts","../src/utils/cart.ts","../src/cart/use-cart.tsx","../src/cart/use-add-item.tsx","../src/cart/use-update-item.tsx","../src/cart/use-remove-item.tsx","../src/utils/sort-product.ts","../src/product/use-search.tsx","../src/product/use-product.tsx","../src/site/use-categories.ts","../src/site/use-brands.ts","../src/provider.ts","../src/local.ts","../src/registerCommerceProvider.tsx","../src/index.tsx"],"sourcesContent":["import { Fetcher } from '@plasmicpkgs/commerce';\n\nexport const fetcher: Fetcher = async () => {\n console.log('FETCHER')\n const res = await fetch('./data.json')\n if (res.ok) {\n const { data } = await res.json()\n return data\n }\n throw res\n}\n","export const LOCAL_CART_OBJ = \"localCartObj\";\n\nexport const LOCAL_CART_ID = \"localCartId\";\n","import { CartType } from \"@plasmicpkgs/commerce\";\nimport Cookies from \"js-cookie\";\nimport { LOCAL_CART_ID, LOCAL_CART_OBJ } from \"../const\";\n\nconst options: Cookies.CookieAttributes = {\n sameSite: \"none\",\n secure: true,\n};\n\nexport const createCart: () => CartType.Cart = () => {\n const cart = {\n id: \"\",\n createdAt: \"\",\n currency: { code: \"USD\" },\n taxesIncluded: false,\n lineItems: [],\n lineItemsSubtotalPrice: 0,\n subtotalPrice: 0,\n totalPrice: 0,\n };\n\n const cartId = Date.now().toString();\n\n Cookies.set(LOCAL_CART_ID, cartId);\n Cookies.set(\n LOCAL_CART_OBJ,\n JSON.stringify({\n id: cartId,\n cart,\n })\n );\n\n return cart;\n};\n\nexport const getCart: (cartId?: string) => CartType.Cart = (\n cartId?: string\n) => {\n cartId = cartId ?? Cookies.get(LOCAL_CART_ID);\n const cartStr = Cookies.get(LOCAL_CART_OBJ);\n const cart = cartStr ? JSON.parse(cartStr) : undefined;\n\n if (!cart || cart.id !== cartId) {\n return createCart();\n } else {\n return cart.cart;\n }\n};\n\nexport const cartUpdate = (newCart: CartType.Cart) => {\n Cookies.set(\n LOCAL_CART_OBJ,\n JSON.stringify({\n id: Cookies.get(LOCAL_CART_ID),\n cart: newCart,\n })\n );\n\n return newCart;\n};\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes:\n - Before: just returned an empty cart.\n - Now: Read cart from local storage.\n*/\nimport { SWRHook, useCart, UseCart } from \"@plasmicpkgs/commerce\";\nimport React from \"react\";\nimport { getCart } from \"../utils/cart\";\n\nexport default useCart as UseCart<typeof handler>;\n\nexport const handler: SWRHook<any> = {\n fetchOptions: {\n query: \"use-cart\",\n },\n async fetcher({ input, options, fetch }) {\n return getCart(input.cartId);\n },\n useHook: ({ useData }) => (input) => {\n const response = useData({\n swrOptions: { revalidateOnFocus: false, ...input?.swrOptions },\n });\n return React.useMemo(\n () =>\n Object.create(response, {\n isEmpty: {\n get() {\n return (response.data?.lineItems.length ?? 0) <= 0;\n },\n enumerable: true,\n },\n }),\n [response]\n );\n },\n};\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes:\n - Implemented a local cart\n - The items are added to local storage.\n*/\nimport {\n CommerceError,\n MutationHook,\n useAddItem,\n UseAddItem,\n} from \"@plasmicpkgs/commerce\";\nimport { useCallback } from \"react\";\nimport data from \"../data.json\";\nimport { cartUpdate, getCart } from \"../utils/cart\";\nimport useCart from \"./use-cart\";\n\nexport default useAddItem as UseAddItem<typeof handler>;\nexport const handler: MutationHook<any> = {\n fetchOptions: {\n query: \"use-add-item\",\n },\n async fetcher({ input: item, options, fetch }) {\n if (\n item.quantity &&\n (!Number.isInteger(item.quantity) || item.quantity! < 1)\n ) {\n throw new CommerceError({\n message: \"The item quantity has to be a valid integer greater than 0\",\n });\n }\n\n const lineItem = {\n variantId: item.variantId,\n quantity: item.quantity ?? 1,\n };\n\n const cart = getCart();\n for (const product of data.products) {\n const variant = (product.variants as any[]).find(\n (variant) => variant.id === item.variantId\n );\n if (variant) {\n cart.totalPrice += variant.price * (item.quantity ?? 1);\n cart.currency.code = product.price.currencyCode;\n const currentLineItem = cart.lineItems.find(\n (item) => item.variantId === lineItem.variantId\n );\n if (!currentLineItem) {\n cart.lineItems.push(lineItem as any);\n } else {\n currentLineItem.quantity += lineItem.quantity;\n }\n }\n }\n\n return cartUpdate(cart);\n },\n useHook: ({ fetch }) => () => {\n const { mutate } = useCart();\n return useCallback(\n async function addItem(input) {\n const data = await fetch({ input });\n await mutate(data, false);\n return data;\n },\n [fetch, mutate]\n );\n },\n};\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes: None\n*/\nimport { MutationHook } from '@plasmicpkgs/commerce'\nimport { useUpdateItem,\n UseUpdateItem,\n} from '@plasmicpkgs/commerce'\n\nexport default useUpdateItem as UseUpdateItem<any>\n\nexport const handler: MutationHook<any> = {\n fetchOptions: {\n query: '',\n },\n async fetcher({ input, options, fetch }) {},\n useHook:\n ({ fetch }) =>\n () => {\n return async function addItem() {\n return {}\n }\n },\n}\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes: None\n*/\nimport { MutationHook } from '@plasmicpkgs/commerce'\nimport {useRemoveItem,\n UseRemoveItem,\n} from '@plasmicpkgs/commerce'\n\nexport default useRemoveItem as UseRemoveItem<typeof handler>\n\nexport const handler: MutationHook<any> = {\n fetchOptions: {\n query: '',\n },\n async fetcher({ input, options, fetch }) {},\n useHook:\n ({ fetch }) =>\n () => {\n return async function removeItem(input) {\n return {}\n }\n },\n}\n","import data from \"../data.json\";\n\nexport const sortProduct = (\n a: typeof data.products[0],\n b: typeof data.products[0],\n sortKey: string\n) => {\n switch (sortKey) {\n case \"price-asc\":\n return a.price.value < b.price.value ? -1 : 1;\n case \"price-desc\":\n return a.price.value < b.price.value ? 1 : -1;\n case \"trending-desc\":\n return a.id.localeCompare(b.id);\n case \"latest-desc\":\n return a.id.localeCompare(b.id) * -1;\n default:\n return 0;\n }\n};\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes: None\n*/\nimport { SWRHook, useSearch, UseSearch } from \"@plasmicpkgs/commerce\";\nimport data from \"../data.json\";\nimport { sortProduct } from \"../utils/sort-product\";\nconst useSearchTyped: UseSearch<typeof handler> = useSearch;\nexport default useSearchTyped;\n\nexport const handler: SWRHook<any> = {\n fetchOptions: {\n query: \"use-search\",\n },\n async fetcher({ input, options, fetch }) {\n const { search, categoryId, brandId, sort, count } = input;\n\n let products = data.products;\n\n if (categoryId) {\n const category = data.categories.find(\n (category) => category.id === categoryId\n );\n products = data.products.filter((product) =>\n category?.products?.includes(product.id)\n );\n }\n\n if (brandId) {\n products = products.filter(\n (product) =>\n product.vendor.replace(/\\s+/g, \"-\").toLowerCase() ===\n `${brandId}`.toLowerCase()\n );\n }\n\n if (search) {\n products = products.filter(\n (product) =>\n product.name.toLowerCase().includes(`${search}`.toLowerCase()) ||\n product.slug.toLowerCase().includes(`${search}`.toLowerCase())\n );\n }\n\n if (sort) {\n products = products.sort((a, b) => sortProduct(a, b, sort));\n }\n\n return {\n products: products.slice(0, count),\n found: products.length > 0,\n };\n },\n useHook:\n ({ useData }) =>\n (input = {}) => {\n return useData({\n input: [\n [\"search\", input.search],\n [\"prefixSearch\", input.prefixSearch],\n [\"categoryId\", input.categoryId],\n [\"brandId\", input.brandId],\n [\"sort\", input.sort],\n [\"locale\", input.locale],\n [\"count\", input.count],\n ],\n swrOptions: {\n revalidateOnFocus: false,\n ...input.swrOptions,\n },\n });\n },\n};\n","import { SWRHook, useProduct, UseProduct } from \"@plasmicpkgs/commerce\";\nimport data from \"../data.json\";\nexport default useProduct as UseProduct<typeof handler>;\n\nexport const handler: SWRHook<any> = {\n fetchOptions: {\n query: \"use-product\",\n },\n async fetcher({ input, options, fetch }) {\n const { id } = input;\n\n return (\n data.products.find((product) =>\n [product.id, product.slug].includes(id)\n ) ?? null\n );\n },\n useHook: ({ useData }) => (input = {}) => {\n return useData({\n input: [[\"id\", input.id]],\n swrOptions: {\n revalidateOnFocus: false,\n ...input.swrOptions,\n },\n });\n },\n};\n","import { SWRHook, useCategories, UseCategories } from \"@plasmicpkgs/commerce\";\nimport React from \"react\";\nimport data from \"../data.json\";\nexport default useCategories as UseCategories<typeof handler>;\n\nexport const handler: SWRHook<any> = {\n fetchOptions: {\n query: \"use-categories\",\n },\n async fetcher({ input, options, fetch }) {\n const { categoryId } = input;\n if (!categoryId) {\n return data.categories;\n }\n const category = data.categories.find(\n (category) => category.id === categoryId\n );\n return category ? [category] : [];\n },\n useHook: ({ useData }) => (input) => {\n const response = useData({\n input: [[\"categoryId\", input?.categoryId]],\n swrOptions: { revalidateOnFocus: false, ...input?.swrOptions },\n });\n return React.useMemo(\n () =>\n Object.create(response, {\n isEmpty: {\n get() {\n return (response.data?.length ?? 0) <= 0;\n },\n enumerable: true,\n },\n }),\n [response]\n );\n },\n};\n","import { SWRHook, useBrands, UseBrands } from \"@plasmicpkgs/commerce\";\nimport React from \"react\";\nimport data from \"../data.json\";\nexport default useBrands as UseBrands<typeof handler>;\n\nexport const handler: SWRHook<any> = {\n fetchOptions: {\n query: \"use-brands\",\n },\n async fetcher({ input, options, fetch }) {\n const vendorsStrings = data.products.map((product) => product.vendor);\n return Array.from(new Set(vendorsStrings).values()).map((v) => {\n const id = v.replace(/\\s+/g, \"-\").toLowerCase();\n return {\n entityId: id,\n name: v,\n path: `brands/${id}`,\n };\n });\n },\n useHook: ({ useData }) => (input) => {\n const response = useData({\n swrOptions: { revalidateOnFocus: false, ...input?.swrOptions },\n });\n return React.useMemo(\n () =>\n Object.create(response, {\n isEmpty: {\n get() {\n return (response.data?.length ?? 0) <= 0;\n },\n enumerable: true,\n },\n }),\n [response]\n );\n },\n};\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes: Removed authentication, customer and wishlist hooks\n*/\nimport { fetcher } from './fetcher'\nimport { handler as useCart } from './cart/use-cart'\nimport { handler as useAddItem } from './cart/use-add-item'\nimport { handler as useUpdateItem } from './cart/use-update-item'\nimport { handler as useRemoveItem } from './cart/use-remove-item'\nimport { handler as useSearch } from './product/use-search'\nimport { handler as useProduct } from './product/use-product'\nimport { handler as useCategories } from './site/use-categories'\nimport { handler as useBrands } from './site/use-brands'\nimport { LOCAL_CART_ID } from './const'\nexport const localProvider = {\n locale: 'en-us',\n cartCookie: LOCAL_CART_ID,\n fetcher: fetcher,\n cart: { useCart, useAddItem, useUpdateItem, useRemoveItem },\n products: { useSearch, useProduct },\n site: { useCategories, useBrands }\n}\n\nexport type LocalProvider = typeof localProvider\n","/*\n Forked from https://github.com/vercel/commerce/tree/main/packages/local/src\n Changes: Add export data\n*/\nexport * from \"./registerable\";\nexport { localProvider, data };\nexport type { LocalProvider };\nimport {\n getCommerceProvider,\n useCommerce as useCoreCommerce,\n} from \"@plasmicpkgs/commerce\";\nimport data from \"./data.json\";\nimport { localProvider, LocalProvider } from \"./provider\";\n\nexport const CommerceProvider = getCommerceProvider(localProvider);\n\nexport const useCommerce = () => useCoreCommerce<LocalProvider>();\n","import { GlobalContextMeta } from \"@plasmicapp/host\";\nimport registerGlobalContext from \"@plasmicapp/host/registerGlobalContext\";\nimport React from \"react\";\nimport { CommerceProvider } from \"./local\";\nimport { Registerable } from \"./registerable\";\n\ninterface CommerceProviderProps {\n children?: React.ReactNode;\n}\n\nexport const commerceProviderMeta: GlobalContextMeta<CommerceProviderProps> = {\n name: \"plasmic-commerce-local-provider\",\n displayName: \"Local Provider\",\n props: {},\n importPath: \"@plasmicpkgs/commerce-local\",\n importName: \"CommerceProviderComponent\",\n};\n\nfunction CommerceProviderComponent(props: CommerceProviderProps) {\n return <CommerceProvider>{props.children}</CommerceProvider>;\n}\n\nexport function registerCommerceProvider(\n loader?: Registerable,\n customCommerceProviderMeta?: GlobalContextMeta<CommerceProviderProps>\n) {\n const doRegisterComponent: typeof registerGlobalContext = (...args) =>\n loader\n ? loader.registerGlobalContext(...args)\n : registerGlobalContext(...args);\n doRegisterComponent(\n CommerceProviderComponent,\n customCommerceProviderMeta ?? commerceProviderMeta\n );\n}\n","import { Registerable } from \"./registerable\";\nimport { registerCommerceProvider } from \"./registerCommerceProvider\";\nexport * from \"./registerable\";\n\nexport * from \"./local\";\n\nexport function registerAll(loader?: Registerable) {\n registerCommerceProvider(loader);\n}\n\nexport { registerCommerceProvider };"],"names":["fetcher","_ref","_asyncToGenerator","_regeneratorRuntime","mark","_callee","res","_yield$res$json","data","wrap","_callee$","_context","prev","next","console","log","fetch","sent","ok","json","abrupt","stop","apply","arguments","LOCAL_CART_OBJ","LOCAL_CART_ID","createCart","cart","id","createdAt","currency","code","taxesIncluded","lineItems","lineItemsSubtotalPrice","subtotalPrice","totalPrice","cartId","Date","now","toString","Cookies","set","JSON","stringify","getCart","_cartId","get","cartStr","parse","undefined","cartUpdate","newCart","handler","fetchOptions","query","input","options","useHook","_ref2","useData","response","swrOptions","_extends","revalidateOnFocus","React","useMemo","Object","create","isEmpty","_response$data$lineIt","_response$data","length","enumerable","item","quantity","Number","isInteger","CommerceError","message","lineItem","variantId","_item$quantity","_iterator","_createForOfIteratorHelperLoose","products","_step","done","product","value","variant","variants","find","price","_item$quantity2","currencyCode","currentLineItem","push","_useCart","useCart","mutate","useCallback","_addItem","_callee2","_callee2$","_context2","addItem","_x","_removeItem","removeItem","sortProduct","a","b","sortKey","localeCompare","search","categoryId","brandId","sort","count","category","categories","filter","_category$products","includes","vendor","replace","toLowerCase","name","slug","slice","found","prefixSearch","locale","_data$products$find","_response$data$length","vendorsStrings","map","Array","from","Set","values","v","entityId","path","localProvider","cartCookie","useAddItem","useUpdateItem","useRemoveItem","useSearch","useProduct","site","useCategories","useBrands","CommerceProvider","getCommerceProvider","useCommerce","useCoreCommerce","commerceProviderMeta","displayName","props","importPath","importName","CommerceProviderComponent","children","registerCommerceProvider","loader","customCommerceProviderMeta","doRegisterComponent","registerGlobalContext","registerAll"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;EAC7BC,KAAK,EAAE,EAAE;EACTC,UAAU,EAAE,6BAA6B;EACzCC,UAAU,EAAE;CACb;AAED,SAASC,yBAAyBA,CAACH,KAA4B;EAC7D,OAAOhG,oBAAC0F,gBAAgB,QAAEM,KAAK,CAACI,QAAQ,CAAoB;AAC9D;AAEA,SAAgBC,wBAAwBA,CACtCC,MAAqB,EACrBC,0BAAqE;EAErE,IAAMC,mBAAmB,GAAiC,SAApDA,mBAAmBA;IAAA,OACvBF,MAAM,GACFA,MAAM,CAACG,qBAAqB,CAAApJ,KAAA,CAA5BiJ,MAAM,EAAAhJ,SAA8B,CAAC,GACrCmJ,qBAAqB,CAAApJ,KAAA,SAAAC,SAAQ,CAAC;;EACpCkJ,mBAAmB,CACjBL,yBAAyB,EACzBI,0BAA0B,WAA1BA,0BAA0B,GAAIT,oBAAoB,CACnD;AACH;;SC5BgBY,WAAWA,CAACJ,MAAqB;EAC/CD,wBAAwB,CAACC,MAAM,CAAC;AAClC;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plasmicpkgs/commerce-local",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.211",
|
|
4
4
|
"description": "Plasmic registration calls for local provider components",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"analyze": "size-limit --why"
|
|
19
19
|
},
|
|
20
20
|
"devDependencies": {
|
|
21
|
-
"@plasmicapp/host": "1.0.
|
|
21
|
+
"@plasmicapp/host": "1.0.213",
|
|
22
22
|
"@size-limit/preset-small-lib": "^4.11.0",
|
|
23
23
|
"@types/js-cookie": "^3.0.1",
|
|
24
24
|
"@types/node": "^14.0.26",
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
"react": ">=16.8.0"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
|
-
"@plasmicpkgs/commerce": "0.0.
|
|
36
|
+
"@plasmicpkgs/commerce": "0.0.211",
|
|
37
37
|
"@types/react": "^18.0.27"
|
|
38
38
|
},
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "3a42fbf1505e2f4e51f0a4d93cb4de16617bba84"
|
|
40
40
|
}
|