@burdenoff/website-sdk 2026.716.3 → 2026.719.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -3917,6 +3917,10 @@ function ResourceLinks({
3917
3917
  function normalizeSearch(value) {
3918
3918
  return value.toLowerCase().trim();
3919
3919
  }
3920
+ function resolveWebsiteProductLogo(product) {
3921
+ if (product.logoUrl) return product.logoUrl;
3922
+ return `${product.websiteUrl.replace(/\/+$/, "")}/logo-icon.png`;
3923
+ }
3920
3924
  function filterProducts(products, query) {
3921
3925
  const normalized = normalizeSearch(query);
3922
3926
  if (!normalized) return products;
@@ -3931,6 +3935,9 @@ function WebsiteSwitcher({
3931
3935
  }) {
3932
3936
  const [open, setOpen] = useState(false);
3933
3937
  const [query, setQuery] = useState("");
3938
+ const [failedLogos, setFailedLogos] = useState(
3939
+ () => /* @__PURE__ */ new Set()
3940
+ );
3934
3941
  const filtered = useMemo(
3935
3942
  () => filterProducts(products, query),
3936
3943
  [products, query]
@@ -4009,15 +4016,21 @@ function WebsiteSwitcher({
4009
4016
  "text-foreground hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground"
4010
4017
  ),
4011
4018
  children: [
4012
- product.logoUrl ? /* @__PURE__ */ jsx(
4019
+ failedLogos.has(product.slug) ? /* @__PURE__ */ jsx("span", { className: "flex h-5 w-5 shrink-0 items-center justify-center rounded bg-primary/10 text-[10px] font-bold text-primary", children: product.name.charAt(0) }) : /* @__PURE__ */ jsx(
4013
4020
  "img",
4014
4021
  {
4015
- src: product.logoUrl,
4022
+ src: resolveWebsiteProductLogo(product),
4016
4023
  alt: "",
4017
4024
  "aria-hidden": "true",
4018
- className: "h-5 w-5 shrink-0 rounded object-contain"
4025
+ loading: "lazy",
4026
+ className: "h-5 w-5 shrink-0 rounded object-contain",
4027
+ onError: () => setFailedLogos((prev) => {
4028
+ const next = new Set(prev);
4029
+ next.add(product.slug);
4030
+ return next;
4031
+ })
4019
4032
  }
4020
- ) : /* @__PURE__ */ jsx("span", { className: "flex h-5 w-5 shrink-0 items-center justify-center rounded bg-primary/10 text-[10px] font-bold text-primary", children: product.name.charAt(0) }),
4033
+ ),
4021
4034
  /* @__PURE__ */ jsx("span", { className: "truncate", children: product.name })
4022
4035
  ]
4023
4036
  }
@@ -6240,7 +6253,11 @@ function TypeBadge({ type }) {
6240
6253
  return /* @__PURE__ */ jsx("span", { className: "inline-block text-xs px-2 py-0.5 rounded-full bg-primary/10 text-primary font-medium", children: labels[type] ?? type });
6241
6254
  }
6242
6255
  function ProductCard({ product, onClick, href }) {
6243
- const priceLabel = formatPrice2(product.price, product.currency, product.pricingModel);
6256
+ const priceLabel = formatPrice2(
6257
+ product.price,
6258
+ product.currency,
6259
+ product.pricingModel
6260
+ );
6244
6261
  const inner = /* @__PURE__ */ jsxs("div", { className: "group bg-card border border-border rounded-xl p-4 flex flex-col gap-3 transition-all duration-200 hover:shadow-md hover:border-primary/30 cursor-pointer h-full", children: [
6245
6262
  /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-2", children: [
6246
6263
  /* @__PURE__ */ jsx("div", { className: "w-12 h-12 rounded-lg bg-muted flex-shrink-0 overflow-hidden", children: product.icon ? /* @__PURE__ */ jsx(
@@ -6251,11 +6268,48 @@ function ProductCard({ product, onClick, href }) {
6251
6268
  "aria-hidden": "true",
6252
6269
  className: "w-full h-full object-cover"
6253
6270
  }
6254
- ) : /* @__PURE__ */ jsx("div", { className: "w-full h-full flex items-center justify-center bg-gradient-to-br from-primary/15 to-primary/5", children: /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 32 32", className: "w-8 h-8", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", children: [
6255
- /* @__PURE__ */ jsx("polygon", { points: "16,4 28,10 16,16 4,10", className: "fill-primary/30", stroke: "currentColor", strokeWidth: "0.6", strokeOpacity: "0.35" }),
6256
- /* @__PURE__ */ jsx("polygon", { points: "4,10 16,16 16,28 4,22", className: "fill-primary/15", stroke: "currentColor", strokeWidth: "0.6", strokeOpacity: "0.35" }),
6257
- /* @__PURE__ */ jsx("polygon", { points: "28,10 16,16 16,28 28,22", className: "fill-primary/20", stroke: "currentColor", strokeWidth: "0.6", strokeOpacity: "0.35" })
6258
- ] }) }) }),
6271
+ ) : /* @__PURE__ */ jsx("div", { className: "w-full h-full flex items-center justify-center bg-gradient-to-br from-primary/15 to-primary/5", children: /* @__PURE__ */ jsxs(
6272
+ "svg",
6273
+ {
6274
+ viewBox: "0 0 32 32",
6275
+ className: "w-8 h-8",
6276
+ fill: "none",
6277
+ xmlns: "http://www.w3.org/2000/svg",
6278
+ "aria-hidden": "true",
6279
+ children: [
6280
+ /* @__PURE__ */ jsx(
6281
+ "polygon",
6282
+ {
6283
+ points: "16,4 28,10 16,16 4,10",
6284
+ className: "fill-primary/30",
6285
+ stroke: "currentColor",
6286
+ strokeWidth: "0.6",
6287
+ strokeOpacity: "0.35"
6288
+ }
6289
+ ),
6290
+ /* @__PURE__ */ jsx(
6291
+ "polygon",
6292
+ {
6293
+ points: "4,10 16,16 16,28 4,22",
6294
+ className: "fill-primary/15",
6295
+ stroke: "currentColor",
6296
+ strokeWidth: "0.6",
6297
+ strokeOpacity: "0.35"
6298
+ }
6299
+ ),
6300
+ /* @__PURE__ */ jsx(
6301
+ "polygon",
6302
+ {
6303
+ points: "28,10 16,16 16,28 28,22",
6304
+ className: "fill-primary/20",
6305
+ stroke: "currentColor",
6306
+ strokeWidth: "0.6",
6307
+ strokeOpacity: "0.35"
6308
+ }
6309
+ )
6310
+ ]
6311
+ }
6312
+ ) }) }),
6259
6313
  /* @__PURE__ */ jsx(TypeBadge, { type: product.type })
6260
6314
  ] }),
6261
6315
  /* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
@@ -6364,7 +6418,11 @@ function FeaturedHeroCard({
6364
6418
  product,
6365
6419
  onNavigate
6366
6420
  }) {
6367
- const priceLabel = formatPrice2(product.price, product.currency, product.pricingModel);
6421
+ const priceLabel = formatPrice2(
6422
+ product.price,
6423
+ product.currency,
6424
+ product.pricingModel
6425
+ );
6368
6426
  return /* @__PURE__ */ jsxs(
6369
6427
  "button",
6370
6428
  {
@@ -6373,28 +6431,155 @@ function FeaturedHeroCard({
6373
6431
  className: "group w-full text-left h-full rounded-2xl border border-border bg-card overflow-hidden hover:border-primary/40 transition-all duration-300 hover:shadow-xl hover:shadow-primary/10 flex flex-col",
6374
6432
  children: [
6375
6433
  /* @__PURE__ */ jsxs("div", { className: "relative h-44 sm:h-52 bg-gradient-to-br from-primary/20 via-primary/8 to-background overflow-hidden flex-shrink-0", children: [
6376
- product.bannerUrl ? /* @__PURE__ */ jsx("img", { src: product.bannerUrl, alt: "", "aria-hidden": "true", className: "w-full h-full object-cover" }) : /* @__PURE__ */ jsxs(Fragment, { children: [
6377
- /* @__PURE__ */ jsxs("svg", { className: "absolute inset-0 w-full h-full opacity-[0.07]", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", children: [
6378
- /* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsx("pattern", { id: "fg-hero-grid", width: "36", height: "36", patternUnits: "userSpaceOnUse", children: /* @__PURE__ */ jsx("path", { d: "M 36 0 L 0 0 0 36", fill: "none", stroke: "currentColor", strokeWidth: "1" }) }) }),
6379
- /* @__PURE__ */ jsx("rect", { width: "100%", height: "100%", fill: "url(#fg-hero-grid)" })
6380
- ] }),
6381
- /* @__PURE__ */ jsx("div", { className: "absolute inset-0 flex items-center justify-center", "aria-hidden": "true", children: /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 64 64", className: "w-20 h-20 opacity-25", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
6382
- /* @__PURE__ */ jsx("polygon", { points: "32,8 56,20 32,32 8,20", className: "fill-primary/40", stroke: "currentColor", strokeWidth: "1", strokeOpacity: "0.5" }),
6383
- /* @__PURE__ */ jsx("polygon", { points: "8,20 32,32 32,56 8,44", className: "fill-primary/20", stroke: "currentColor", strokeWidth: "1", strokeOpacity: "0.5" }),
6384
- /* @__PURE__ */ jsx("polygon", { points: "56,20 32,32 32,56 56,44", className: "fill-primary/30", stroke: "currentColor", strokeWidth: "1", strokeOpacity: "0.5" })
6385
- ] }) })
6434
+ product.bannerUrl ? /* @__PURE__ */ jsx(
6435
+ "img",
6436
+ {
6437
+ src: product.bannerUrl,
6438
+ alt: "",
6439
+ "aria-hidden": "true",
6440
+ className: "w-full h-full object-cover"
6441
+ }
6442
+ ) : /* @__PURE__ */ jsxs(Fragment, { children: [
6443
+ /* @__PURE__ */ jsxs(
6444
+ "svg",
6445
+ {
6446
+ className: "absolute inset-0 w-full h-full opacity-[0.07]",
6447
+ xmlns: "http://www.w3.org/2000/svg",
6448
+ "aria-hidden": "true",
6449
+ children: [
6450
+ /* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsx(
6451
+ "pattern",
6452
+ {
6453
+ id: "fg-hero-grid",
6454
+ width: "36",
6455
+ height: "36",
6456
+ patternUnits: "userSpaceOnUse",
6457
+ children: /* @__PURE__ */ jsx(
6458
+ "path",
6459
+ {
6460
+ d: "M 36 0 L 0 0 0 36",
6461
+ fill: "none",
6462
+ stroke: "currentColor",
6463
+ strokeWidth: "1"
6464
+ }
6465
+ )
6466
+ }
6467
+ ) }),
6468
+ /* @__PURE__ */ jsx("rect", { width: "100%", height: "100%", fill: "url(#fg-hero-grid)" })
6469
+ ]
6470
+ }
6471
+ ),
6472
+ /* @__PURE__ */ jsx(
6473
+ "div",
6474
+ {
6475
+ className: "absolute inset-0 flex items-center justify-center",
6476
+ "aria-hidden": "true",
6477
+ children: /* @__PURE__ */ jsxs(
6478
+ "svg",
6479
+ {
6480
+ viewBox: "0 0 64 64",
6481
+ className: "w-20 h-20 opacity-25",
6482
+ fill: "none",
6483
+ xmlns: "http://www.w3.org/2000/svg",
6484
+ children: [
6485
+ /* @__PURE__ */ jsx(
6486
+ "polygon",
6487
+ {
6488
+ points: "32,8 56,20 32,32 8,20",
6489
+ className: "fill-primary/40",
6490
+ stroke: "currentColor",
6491
+ strokeWidth: "1",
6492
+ strokeOpacity: "0.5"
6493
+ }
6494
+ ),
6495
+ /* @__PURE__ */ jsx(
6496
+ "polygon",
6497
+ {
6498
+ points: "8,20 32,32 32,56 8,44",
6499
+ className: "fill-primary/20",
6500
+ stroke: "currentColor",
6501
+ strokeWidth: "1",
6502
+ strokeOpacity: "0.5"
6503
+ }
6504
+ ),
6505
+ /* @__PURE__ */ jsx(
6506
+ "polygon",
6507
+ {
6508
+ points: "56,20 32,32 32,56 56,44",
6509
+ className: "fill-primary/30",
6510
+ stroke: "currentColor",
6511
+ strokeWidth: "1",
6512
+ strokeOpacity: "0.5"
6513
+ }
6514
+ )
6515
+ ]
6516
+ }
6517
+ )
6518
+ }
6519
+ )
6386
6520
  ] }),
6387
6521
  /* @__PURE__ */ jsx("span", { className: "absolute top-3 left-3 text-xs font-semibold px-2.5 py-1 rounded-full bg-primary text-primary-foreground shadow-sm", children: "Featured" }),
6388
- /* @__PURE__ */ jsx("div", { className: "absolute bottom-4 left-4 w-14 h-14 rounded-xl shadow-lg overflow-hidden border-2 border-background", children: product.icon ? /* @__PURE__ */ jsx("img", { src: product.icon, alt: "", "aria-hidden": "true", className: "w-full h-full object-cover" }) : /* @__PURE__ */ jsx("div", { className: "w-full h-full bg-gradient-to-br from-primary/25 to-primary/10 flex items-center justify-center", children: /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 32 32", className: "w-8 h-8", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", children: [
6389
- /* @__PURE__ */ jsx("polygon", { points: "16,4 28,10 16,16 4,10", className: "fill-primary/40", stroke: "currentColor", strokeWidth: "0.6", strokeOpacity: "0.4" }),
6390
- /* @__PURE__ */ jsx("polygon", { points: "4,10 16,16 16,28 4,22", className: "fill-primary/20", stroke: "currentColor", strokeWidth: "0.6", strokeOpacity: "0.4" }),
6391
- /* @__PURE__ */ jsx("polygon", { points: "28,10 16,16 16,28 28,22", className: "fill-primary/30", stroke: "currentColor", strokeWidth: "0.6", strokeOpacity: "0.4" })
6392
- ] }) }) })
6522
+ /* @__PURE__ */ jsx("div", { className: "absolute bottom-4 left-4 w-14 h-14 rounded-xl shadow-lg overflow-hidden border-2 border-background", children: product.icon ? /* @__PURE__ */ jsx(
6523
+ "img",
6524
+ {
6525
+ src: product.icon,
6526
+ alt: "",
6527
+ "aria-hidden": "true",
6528
+ className: "w-full h-full object-cover"
6529
+ }
6530
+ ) : /* @__PURE__ */ jsx("div", { className: "w-full h-full bg-gradient-to-br from-primary/25 to-primary/10 flex items-center justify-center", children: /* @__PURE__ */ jsxs(
6531
+ "svg",
6532
+ {
6533
+ viewBox: "0 0 32 32",
6534
+ className: "w-8 h-8",
6535
+ fill: "none",
6536
+ xmlns: "http://www.w3.org/2000/svg",
6537
+ "aria-hidden": "true",
6538
+ children: [
6539
+ /* @__PURE__ */ jsx(
6540
+ "polygon",
6541
+ {
6542
+ points: "16,4 28,10 16,16 4,10",
6543
+ className: "fill-primary/40",
6544
+ stroke: "currentColor",
6545
+ strokeWidth: "0.6",
6546
+ strokeOpacity: "0.4"
6547
+ }
6548
+ ),
6549
+ /* @__PURE__ */ jsx(
6550
+ "polygon",
6551
+ {
6552
+ points: "4,10 16,16 16,28 4,22",
6553
+ className: "fill-primary/20",
6554
+ stroke: "currentColor",
6555
+ strokeWidth: "0.6",
6556
+ strokeOpacity: "0.4"
6557
+ }
6558
+ ),
6559
+ /* @__PURE__ */ jsx(
6560
+ "polygon",
6561
+ {
6562
+ points: "28,10 16,16 16,28 28,22",
6563
+ className: "fill-primary/30",
6564
+ stroke: "currentColor",
6565
+ strokeWidth: "0.6",
6566
+ strokeOpacity: "0.4"
6567
+ }
6568
+ )
6569
+ ]
6570
+ }
6571
+ ) }) })
6393
6572
  ] }),
6394
6573
  /* @__PURE__ */ jsxs("div", { className: "p-5 flex flex-col flex-1", children: [
6395
6574
  /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-3 mb-2", children: [
6396
6575
  /* @__PURE__ */ jsx("h3", { className: "text-base font-bold text-foreground group-hover:text-primary transition-colors line-clamp-1", children: product.name }),
6397
- /* @__PURE__ */ jsx("span", { className: `text-sm font-bold flex-shrink-0 ${priceLabel === "Free" ? "text-emerald-500" : "text-foreground"}`, children: priceLabel })
6576
+ /* @__PURE__ */ jsx(
6577
+ "span",
6578
+ {
6579
+ className: `text-sm font-bold flex-shrink-0 ${priceLabel === "Free" ? "text-emerald-500" : "text-foreground"}`,
6580
+ children: priceLabel
6581
+ }
6582
+ )
6398
6583
  ] }),
6399
6584
  product.description && /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground line-clamp-2 leading-relaxed flex-1", children: product.description }),
6400
6585
  /* @__PURE__ */ jsxs("div", { className: "mt-3 flex items-center gap-2", children: [
@@ -6415,7 +6600,10 @@ function ScrollRow({
6415
6600
  }) {
6416
6601
  const ref = useRef(null);
6417
6602
  function scroll(dir) {
6418
- ref.current?.scrollBy({ left: dir === "r" ? 272 : -272, behavior: "smooth" });
6603
+ ref.current?.scrollBy({
6604
+ left: dir === "r" ? 272 : -272,
6605
+ behavior: "smooth"
6606
+ });
6419
6607
  }
6420
6608
  return /* @__PURE__ */ jsxs("div", { className: "relative group/row", children: [
6421
6609
  /* @__PURE__ */ jsx(
@@ -6425,7 +6613,19 @@ function ScrollRow({
6425
6613
  onClick: () => scroll("l"),
6426
6614
  "aria-label": "Scroll left",
6427
6615
  className: "absolute left-0 top-1/2 -translate-y-1/2 -translate-x-4 z-10 w-8 h-8 rounded-full bg-background border border-border shadow-md items-center justify-center text-muted-foreground hover:text-primary hover:border-primary/40 transition-all hidden sm:flex opacity-0 group-hover/row:opacity-100",
6428
- children: /* @__PURE__ */ jsx("svg", { viewBox: "0 0 16 16", className: "w-4 h-4", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsx("path", { d: "M10 3L6 8l4 5" }) })
6616
+ children: /* @__PURE__ */ jsx(
6617
+ "svg",
6618
+ {
6619
+ viewBox: "0 0 16 16",
6620
+ className: "w-4 h-4",
6621
+ fill: "none",
6622
+ stroke: "currentColor",
6623
+ strokeWidth: "1.5",
6624
+ strokeLinecap: "round",
6625
+ strokeLinejoin: "round",
6626
+ children: /* @__PURE__ */ jsx("path", { d: "M10 3L6 8l4 5" })
6627
+ }
6628
+ )
6429
6629
  }
6430
6630
  ),
6431
6631
  /* @__PURE__ */ jsx(
@@ -6434,7 +6634,13 @@ function ScrollRow({
6434
6634
  ref,
6435
6635
  className: "flex gap-3 overflow-x-auto pb-1 snap-x snap-mandatory",
6436
6636
  style: { scrollbarWidth: "none", msOverflowStyle: "none" },
6437
- children: products.map((product) => /* @__PURE__ */ jsx("div", { className: "flex-shrink-0 w-56 snap-start", children: /* @__PURE__ */ jsx(ProductCard, { product, onClick: () => onProductClick(product) }) }, product.id))
6637
+ children: products.map((product) => /* @__PURE__ */ jsx("div", { className: "flex-shrink-0 w-56 snap-start", children: /* @__PURE__ */ jsx(
6638
+ ProductCard,
6639
+ {
6640
+ product,
6641
+ onClick: () => onProductClick(product)
6642
+ }
6643
+ ) }, product.id))
6438
6644
  }
6439
6645
  ),
6440
6646
  /* @__PURE__ */ jsx(
@@ -6444,7 +6650,19 @@ function ScrollRow({
6444
6650
  onClick: () => scroll("r"),
6445
6651
  "aria-label": "Scroll right",
6446
6652
  className: "absolute right-0 top-1/2 -translate-y-1/2 translate-x-4 z-10 w-8 h-8 rounded-full bg-background border border-border shadow-md items-center justify-center text-muted-foreground hover:text-primary hover:border-primary/40 transition-all hidden sm:flex opacity-0 group-hover/row:opacity-100",
6447
- children: /* @__PURE__ */ jsx("svg", { viewBox: "0 0 16 16", className: "w-4 h-4", fill: "none", stroke: "currentColor", strokeWidth: "1.5", strokeLinecap: "round", strokeLinejoin: "round", children: /* @__PURE__ */ jsx("path", { d: "M6 3l4 5-4 5" }) })
6653
+ children: /* @__PURE__ */ jsx(
6654
+ "svg",
6655
+ {
6656
+ viewBox: "0 0 16 16",
6657
+ className: "w-4 h-4",
6658
+ fill: "none",
6659
+ stroke: "currentColor",
6660
+ strokeWidth: "1.5",
6661
+ strokeLinecap: "round",
6662
+ strokeLinejoin: "round",
6663
+ children: /* @__PURE__ */ jsx("path", { d: "M6 3l4 5-4 5" })
6664
+ }
6665
+ )
6448
6666
  }
6449
6667
  )
6450
6668
  ] });
@@ -6547,10 +6765,8 @@ function StoreHomePage({
6547
6765
  const [grouped, setGrouped] = useState(null);
6548
6766
  const [loading, setLoading] = useState(true);
6549
6767
  const [error, setError] = useState(null);
6550
- const [retryKey, setRetryKey] = useState(0);
6551
6768
  useEffect(() => {
6552
6769
  let cancelled = false;
6553
- let autoRetryTimer = null;
6554
6770
  async function load() {
6555
6771
  setLoading(true);
6556
6772
  try {
@@ -6564,15 +6780,7 @@ function StoreHomePage({
6564
6780
  setGrouped(res.data.homeGroupedProducts);
6565
6781
  setError(null);
6566
6782
  } catch {
6567
- if (!cancelled) {
6568
- if (retryKey < 1) {
6569
- autoRetryTimer = setTimeout(() => {
6570
- if (!cancelled) setRetryKey(1);
6571
- }, 2e3);
6572
- } else {
6573
- setError("Failed to load store. Please try again.");
6574
- }
6575
- }
6783
+ if (!cancelled) setError("Failed to load store. Please try again.");
6576
6784
  } finally {
6577
6785
  if (!cancelled) setLoading(false);
6578
6786
  }
@@ -6580,9 +6788,8 @@ function StoreHomePage({
6580
6788
  load();
6581
6789
  return () => {
6582
6790
  cancelled = true;
6583
- if (autoRetryTimer) clearTimeout(autoRetryTimer);
6584
6791
  };
6585
- }, [client, compatibleWith, retryKey]);
6792
+ }, [client, compatibleWith]);
6586
6793
  function navigate(path) {
6587
6794
  if (onNavigate) {
6588
6795
  onNavigate(path);
@@ -6610,16 +6817,65 @@ function StoreHomePage({
6610
6817
  }
6611
6818
  ),
6612
6819
  /* @__PURE__ */ jsxs("section", { className: "relative overflow-hidden pt-14 pb-12 sm:pt-20 sm:pb-16", children: [
6613
- /* @__PURE__ */ jsx("div", { className: "absolute inset-0 bg-gradient-to-b from-background via-primary/[0.06] to-background pointer-events-none", "aria-hidden": "true" }),
6614
- /* @__PURE__ */ jsxs("svg", { className: "absolute inset-0 w-full h-full opacity-[0.035] pointer-events-none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", children: [
6615
- /* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsx("pattern", { id: "store-home-grid", width: "40", height: "40", patternUnits: "userSpaceOnUse", children: /* @__PURE__ */ jsx("path", { d: "M 40 0 L 0 0 0 40", fill: "none", stroke: "currentColor", strokeWidth: "1" }) }) }),
6616
- /* @__PURE__ */ jsx("rect", { width: "100%", height: "100%", fill: "url(#store-home-grid)" })
6617
- ] }),
6618
- /* @__PURE__ */ jsx("div", { className: "absolute -top-16 left-1/3 w-80 h-80 rounded-full bg-primary/10 blur-3xl pointer-events-none", "aria-hidden": "true" }),
6619
- /* @__PURE__ */ jsx("div", { className: "absolute top-8 right-1/4 w-56 h-56 rounded-full bg-primary/8 blur-2xl pointer-events-none", "aria-hidden": "true" }),
6820
+ /* @__PURE__ */ jsx(
6821
+ "div",
6822
+ {
6823
+ className: "absolute inset-0 bg-gradient-to-b from-background via-primary/[0.06] to-background pointer-events-none",
6824
+ "aria-hidden": "true"
6825
+ }
6826
+ ),
6827
+ /* @__PURE__ */ jsxs(
6828
+ "svg",
6829
+ {
6830
+ className: "absolute inset-0 w-full h-full opacity-[0.035] pointer-events-none",
6831
+ xmlns: "http://www.w3.org/2000/svg",
6832
+ "aria-hidden": "true",
6833
+ children: [
6834
+ /* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsx(
6835
+ "pattern",
6836
+ {
6837
+ id: "store-home-grid",
6838
+ width: "40",
6839
+ height: "40",
6840
+ patternUnits: "userSpaceOnUse",
6841
+ children: /* @__PURE__ */ jsx(
6842
+ "path",
6843
+ {
6844
+ d: "M 40 0 L 0 0 0 40",
6845
+ fill: "none",
6846
+ stroke: "currentColor",
6847
+ strokeWidth: "1"
6848
+ }
6849
+ )
6850
+ }
6851
+ ) }),
6852
+ /* @__PURE__ */ jsx("rect", { width: "100%", height: "100%", fill: "url(#store-home-grid)" })
6853
+ ]
6854
+ }
6855
+ ),
6856
+ /* @__PURE__ */ jsx(
6857
+ "div",
6858
+ {
6859
+ className: "absolute -top-16 left-1/3 w-80 h-80 rounded-full bg-primary/10 blur-3xl pointer-events-none",
6860
+ "aria-hidden": "true"
6861
+ }
6862
+ ),
6863
+ /* @__PURE__ */ jsx(
6864
+ "div",
6865
+ {
6866
+ className: "absolute top-8 right-1/4 w-56 h-56 rounded-full bg-primary/8 blur-2xl pointer-events-none",
6867
+ "aria-hidden": "true"
6868
+ }
6869
+ ),
6620
6870
  /* @__PURE__ */ jsxs("div", { className: "relative max-w-4xl mx-auto px-4 sm:px-6 lg:px-8 text-center", children: [
6621
6871
  /* @__PURE__ */ jsxs("div", { className: "inline-flex items-center gap-2 px-3 py-1 rounded-full border border-primary/30 bg-primary/10 text-xs font-semibold text-primary mb-5", children: [
6622
- /* @__PURE__ */ jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-primary flex-shrink-0", "aria-hidden": "true" }),
6872
+ /* @__PURE__ */ jsx(
6873
+ "span",
6874
+ {
6875
+ className: "w-1.5 h-1.5 rounded-full bg-primary flex-shrink-0",
6876
+ "aria-hidden": "true"
6877
+ }
6878
+ ),
6623
6879
  "Community Marketplace"
6624
6880
  ] }),
6625
6881
  /* @__PURE__ */ jsx("h1", { className: "text-4xl sm:text-5xl md:text-6xl font-extrabold tracking-tight text-foreground mb-4 leading-[1.08]", children: resolvedTitle }),
@@ -6631,7 +6887,9 @@ function StoreHomePage({
6631
6887
  onSubmit: (e) => {
6632
6888
  e.preventDefault();
6633
6889
  const q = new FormData(e.currentTarget).get("q");
6634
- navigate(q.trim() ? `${browsePath}?q=${encodeURIComponent(q.trim())}` : browsePath);
6890
+ navigate(
6891
+ q.trim() ? `${browsePath}?q=${encodeURIComponent(q.trim())}` : browsePath
6892
+ );
6635
6893
  },
6636
6894
  children: [
6637
6895
  /* @__PURE__ */ jsx(
@@ -6673,9 +6931,23 @@ function StoreHomePage({
6673
6931
  /* @__PURE__ */ jsx("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4", children: [...Array(4)].map((_, i) => /* @__PURE__ */ jsx(GridCardSkeleton, {}, i)) })
6674
6932
  ] }) : error ? /* @__PURE__ */ jsxs("div", { className: "py-16 text-center", children: [
6675
6933
  /* @__PURE__ */ jsx("p", { className: "text-muted-foreground mb-4", children: error }),
6676
- /* @__PURE__ */ jsx("button", { type: "button", onClick: () => setRetryKey((k) => k + 1), className: "text-sm text-primary hover:underline", children: "Retry" })
6934
+ /* @__PURE__ */ jsx(
6935
+ "button",
6936
+ {
6937
+ type: "button",
6938
+ onClick: () => window.location.reload(),
6939
+ className: "text-sm text-primary hover:underline",
6940
+ children: "Retry"
6941
+ }
6942
+ )
6677
6943
  ] }) : featuredItems.length > 0 ? /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 lg:grid-cols-[1fr_2fr] gap-4 items-start", children: [
6678
- /* @__PURE__ */ jsx(FeaturedHeroCard, { product: featuredItems[0], onNavigate: navigate }),
6944
+ /* @__PURE__ */ jsx(
6945
+ FeaturedHeroCard,
6946
+ {
6947
+ product: featuredItems[0],
6948
+ onNavigate: navigate
6949
+ }
6950
+ ),
6679
6951
  /* @__PURE__ */ jsx("div", { className: "grid grid-cols-1 sm:grid-cols-2 gap-4", children: featuredItems.slice(1, 5).map((product) => /* @__PURE__ */ jsx(
6680
6952
  ProductCard,
6681
6953
  {
@@ -6696,7 +6968,13 @@ function StoreHomePage({
6696
6968
  onNavigate: navigate
6697
6969
  }
6698
6970
  ),
6699
- loading ? /* @__PURE__ */ jsx("div", { className: "flex gap-3 overflow-hidden", children: [...Array(5)].map((_, i) => /* @__PURE__ */ jsx(ScrollCardSkeleton, {}, i)) }) : /* @__PURE__ */ jsx(ScrollRow, { products: popularItems, onProductClick: handleProductClick })
6971
+ loading ? /* @__PURE__ */ jsx("div", { className: "flex gap-3 overflow-hidden", children: [...Array(5)].map((_, i) => /* @__PURE__ */ jsx(ScrollCardSkeleton, {}, i)) }) : /* @__PURE__ */ jsx(
6972
+ ScrollRow,
6973
+ {
6974
+ products: popularItems,
6975
+ onProductClick: handleProductClick
6976
+ }
6977
+ )
6700
6978
  ] }),
6701
6979
  (loading || freeItems.length > 0) && /* @__PURE__ */ jsxs("section", { children: [
6702
6980
  /* @__PURE__ */ jsx(
@@ -6719,16 +6997,35 @@ function StoreHomePage({
6719
6997
  ] })
6720
6998
  ] }),
6721
6999
  /* @__PURE__ */ jsxs("section", { className: "relative overflow-hidden border-t border-border", children: [
6722
- /* @__PURE__ */ jsx("div", { className: "absolute inset-0 bg-gradient-to-br from-primary/8 via-background to-primary/5 pointer-events-none", "aria-hidden": "true" }),
6723
- /* @__PURE__ */ jsx("div", { className: "absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-80 h-40 rounded-full bg-primary/12 blur-3xl pointer-events-none", "aria-hidden": "true" }),
7000
+ /* @__PURE__ */ jsx(
7001
+ "div",
7002
+ {
7003
+ className: "absolute inset-0 bg-gradient-to-br from-primary/8 via-background to-primary/5 pointer-events-none",
7004
+ "aria-hidden": "true"
7005
+ }
7006
+ ),
7007
+ /* @__PURE__ */ jsx(
7008
+ "div",
7009
+ {
7010
+ className: "absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-80 h-40 rounded-full bg-primary/12 blur-3xl pointer-events-none",
7011
+ "aria-hidden": "true"
7012
+ }
7013
+ ),
6724
7014
  /* @__PURE__ */ jsxs("div", { className: "relative max-w-2xl mx-auto px-4 py-16 text-center", children: [
6725
7015
  /* @__PURE__ */ jsxs("div", { className: "inline-flex items-center gap-2 px-3 py-1 rounded-full border border-primary/30 bg-primary/10 text-xs font-semibold text-primary mb-5", children: [
6726
- /* @__PURE__ */ jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-primary flex-shrink-0", "aria-hidden": "true" }),
7016
+ /* @__PURE__ */ jsx(
7017
+ "span",
7018
+ {
7019
+ className: "w-1.5 h-1.5 rounded-full bg-primary flex-shrink-0",
7020
+ "aria-hidden": "true"
7021
+ }
7022
+ ),
6727
7023
  "Become a publisher"
6728
7024
  ] }),
6729
7025
  /* @__PURE__ */ jsx("h2", { className: "text-2xl sm:text-3xl font-bold text-foreground mb-3", children: "Built something useful?" }),
6730
7026
  /* @__PURE__ */ jsxs("p", { className: "text-muted-foreground mb-8 max-w-lg mx-auto leading-relaxed", children: [
6731
- "Share your workflows, nodes, and integrations with ",
7027
+ "Share your workflows, nodes, and integrations with",
7028
+ " ",
6732
7029
  productName ?? "the",
6733
7030
  " community. Earn from your work or contribute for free."
6734
7031
  ] }),
@@ -6784,7 +7081,14 @@ var PRICING_OPTIONS = [
6784
7081
  ];
6785
7082
  function parseUrlParams() {
6786
7083
  if (typeof window === "undefined")
6787
- return { q: "", type: "", pricingModel: "", category: "", sortBy: "RELEVANCE", featured: false };
7084
+ return {
7085
+ q: "",
7086
+ type: "",
7087
+ pricingModel: "",
7088
+ category: "",
7089
+ sortBy: "RELEVANCE",
7090
+ featured: false
7091
+ };
6788
7092
  const p = new URLSearchParams(window.location.search);
6789
7093
  return {
6790
7094
  q: p.get("q") ?? "",
@@ -6836,7 +7140,9 @@ function StoreBrowsePage({
6836
7140
  const [featured, setFeatured] = useState(initial.featured);
6837
7141
  const [offset, setOffset] = useState(0);
6838
7142
  const [result, setResult] = useState(null);
6839
- const [allProducts, setAllProducts] = useState([]);
7143
+ const [allProducts, setAllProducts] = useState(
7144
+ []
7145
+ );
6840
7146
  const [categories, setCategories] = useState([]);
6841
7147
  const [loading, setLoading] = useState(true);
6842
7148
  const [loadingMore, setLoadingMore] = useState(false);
@@ -6880,7 +7186,16 @@ function StoreBrowsePage({
6880
7186
  return () => {
6881
7187
  cancelled = true;
6882
7188
  };
6883
- }, [client, search, type, pricingModel, category, sortBy, compatibleWith, featured]);
7189
+ }, [
7190
+ client,
7191
+ search,
7192
+ type,
7193
+ pricingModel,
7194
+ category,
7195
+ sortBy,
7196
+ compatibleWith,
7197
+ featured
7198
+ ]);
6884
7199
  function loadMore() {
6885
7200
  const nextOffset = offset + PAGE_SIZE;
6886
7201
  setLoadingMore(true);
@@ -7056,7 +7371,8 @@ function StoreBrowsePage({
7056
7371
  onClick: () => setFiltersOpen(!filtersOpen),
7057
7372
  className: "lg:hidden h-10 px-4 rounded-lg border border-border bg-background text-sm text-foreground hover:bg-muted/50 transition-colors",
7058
7373
  children: [
7059
- "Filters ",
7374
+ "Filters",
7375
+ " ",
7060
7376
  hasActiveFilters && /* @__PURE__ */ jsx("span", { className: "text-primary", children: "\u2022" })
7061
7377
  ]
7062
7378
  }
@@ -7070,14 +7386,32 @@ function StoreBrowsePage({
7070
7386
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 mb-4 flex-wrap", children: [
7071
7387
  /* @__PURE__ */ jsx("span", { className: "text-sm text-muted-foreground", children: loading ? "Loading\u2026" : `${result?.totalCount ?? 0} results` }),
7072
7388
  hasActiveFilters && /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap gap-1.5", children: [
7073
- search && /* @__PURE__ */ jsx(Chip, { label: `"${search}"`, onRemove: () => {
7074
- setSearch("");
7075
- setInputValue("");
7076
- } }),
7389
+ search && /* @__PURE__ */ jsx(
7390
+ Chip,
7391
+ {
7392
+ label: `"${search}"`,
7393
+ onRemove: () => {
7394
+ setSearch("");
7395
+ setInputValue("");
7396
+ }
7397
+ }
7398
+ ),
7077
7399
  type && /* @__PURE__ */ jsx(Chip, { label: type, onRemove: () => setType("") }),
7078
- pricingModel && /* @__PURE__ */ jsx(Chip, { label: pricingModel, onRemove: () => setPricingModel("") }),
7400
+ pricingModel && /* @__PURE__ */ jsx(
7401
+ Chip,
7402
+ {
7403
+ label: pricingModel,
7404
+ onRemove: () => setPricingModel("")
7405
+ }
7406
+ ),
7079
7407
  category && /* @__PURE__ */ jsx(Chip, { label: category, onRemove: () => setCategory("") }),
7080
- featured && /* @__PURE__ */ jsx(Chip, { label: "Featured", onRemove: () => setFeatured(false) })
7408
+ featured && /* @__PURE__ */ jsx(
7409
+ Chip,
7410
+ {
7411
+ label: "Featured",
7412
+ onRemove: () => setFeatured(false)
7413
+ }
7414
+ )
7081
7415
  ] })
7082
7416
  ] }),
7083
7417
  loading ? /* @__PURE__ */ jsx("div", { className: "grid grid-cols-1 sm:grid-cols-2 xl:grid-cols-3 gap-4", children: [...Array(12)].map((_, i) => /* @__PURE__ */ jsx(
@@ -7129,9 +7463,97 @@ function StoreBrowsePage({
7129
7463
  function Chip({ label, onRemove }) {
7130
7464
  return /* @__PURE__ */ jsxs("span", { className: "inline-flex items-center gap-1 text-xs bg-primary/10 text-primary rounded-full px-2.5 py-0.5 font-medium", children: [
7131
7465
  label,
7132
- /* @__PURE__ */ jsx("button", { type: "button", onClick: onRemove, "aria-label": `Remove ${label}`, className: "hover:opacity-70", children: "\xD7" })
7466
+ /* @__PURE__ */ jsx(
7467
+ "button",
7468
+ {
7469
+ type: "button",
7470
+ onClick: onRemove,
7471
+ "aria-label": `Remove ${label}`,
7472
+ className: "hover:opacity-70",
7473
+ children: "\xD7"
7474
+ }
7475
+ )
7133
7476
  ] });
7134
7477
  }
7478
+ function detectTheme() {
7479
+ if (typeof document === "undefined") return "light";
7480
+ const root = document.documentElement;
7481
+ return root.classList.contains("dark") || root.getAttribute("data-theme") === "dark" ? "dark" : "light";
7482
+ }
7483
+ function WorkflowEmbed({
7484
+ appUrl,
7485
+ productId,
7486
+ theme,
7487
+ clickToInteract = true,
7488
+ hideCta = false,
7489
+ className,
7490
+ onError
7491
+ }) {
7492
+ const iframeRef = useRef(null);
7493
+ const [status, setStatus] = useState("loading");
7494
+ const [interactive, setInteractive] = useState(!clickToInteract);
7495
+ const resolvedTheme = useMemo(() => theme ?? detectTheme(), [theme]);
7496
+ const src = useMemo(() => {
7497
+ const base = appUrl.replace(/\/+$/, "");
7498
+ const params = new URLSearchParams({
7499
+ productId,
7500
+ theme: resolvedTheme
7501
+ });
7502
+ if (hideCta) params.set("cta", "false");
7503
+ return `${base}/embed/workflow?${params.toString()}`;
7504
+ }, [appUrl, productId, resolvedTheme, hideCta]);
7505
+ useEffect(() => {
7506
+ const handler = (event) => {
7507
+ if (event.source !== iframeRef.current?.contentWindow) return;
7508
+ const data = event.data;
7509
+ if (data?.type === "fluidgrids:embed:loaded") setStatus("loaded");
7510
+ if (data?.type === "fluidgrids:embed:error") {
7511
+ setStatus("error");
7512
+ onError?.(data.message ?? "Failed to load workflow preview");
7513
+ }
7514
+ };
7515
+ window.addEventListener("message", handler);
7516
+ return () => window.removeEventListener("message", handler);
7517
+ }, [onError]);
7518
+ if (status === "error") return null;
7519
+ return /* @__PURE__ */ jsxs(
7520
+ "div",
7521
+ {
7522
+ className: `relative w-full overflow-hidden rounded-xl border border-border bg-muted ${className ?? ""}`,
7523
+ style: { aspectRatio: "16 / 9" },
7524
+ children: [
7525
+ status === "loading" && /* @__PURE__ */ jsx(
7526
+ "div",
7527
+ {
7528
+ className: "absolute inset-0 animate-pulse bg-muted",
7529
+ "aria-hidden": "true"
7530
+ }
7531
+ ),
7532
+ /* @__PURE__ */ jsx(
7533
+ "iframe",
7534
+ {
7535
+ ref: iframeRef,
7536
+ src,
7537
+ title: "Workflow preview",
7538
+ loading: "lazy",
7539
+ className: "h-full w-full border-0",
7540
+ style: interactive ? void 0 : { pointerEvents: "none" }
7541
+ }
7542
+ ),
7543
+ clickToInteract && !interactive && status === "loaded" && /* @__PURE__ */ jsx(
7544
+ "button",
7545
+ {
7546
+ type: "button",
7547
+ onClick: () => setInteractive(true),
7548
+ className: "absolute inset-0 flex items-end justify-center bg-transparent pb-4",
7549
+ "aria-label": "Click to explore the workflow",
7550
+ children: /* @__PURE__ */ jsx("span", { className: "rounded-full border border-border bg-background/90 px-4 py-1.5 text-xs font-medium text-foreground shadow-sm backdrop-blur transition-colors hover:bg-background", children: "Click to explore" })
7551
+ }
7552
+ )
7553
+ ]
7554
+ }
7555
+ );
7556
+ }
7135
7557
  var ANIM_STYLES = `
7136
7558
  @keyframes sdFadeUp {
7137
7559
  from { opacity: 0; transform: translateY(16px); }
@@ -7164,50 +7586,11 @@ var ANIM_STYLES = `
7164
7586
  .sd-d5 { animation-delay: 320ms; }
7165
7587
  .sd-d6 { animation-delay: 400ms; }
7166
7588
  `;
7167
- function mdInline(text) {
7168
- const parts = text.split(/(\*\*[^*]+\*\*)/g);
7169
- if (parts.length === 1) return text;
7170
- return /* @__PURE__ */ jsx(Fragment, { children: parts.map(
7171
- (part, i) => part.startsWith("**") && part.endsWith("**") ? /* @__PURE__ */ jsx("strong", { className: "font-semibold text-foreground", children: part.slice(2, -2) }, i) : part || null
7172
- ) });
7173
- }
7174
- function MdAbout({ content }) {
7175
- let key = 0;
7176
- const nodes = [];
7177
- let listItems = [];
7178
- const flushList = () => {
7179
- if (!listItems.length) return;
7180
- nodes.push(
7181
- /* @__PURE__ */ jsx("ul", { className: "list-disc list-inside space-y-0.5 my-2", children: listItems.map((item, i) => /* @__PURE__ */ jsx("li", { className: "text-sm leading-relaxed", children: mdInline(item) }, i)) }, key++)
7182
- );
7183
- listItems = [];
7184
- };
7185
- for (const line of content.split("\n")) {
7186
- if (!line.trim()) {
7187
- flushList();
7188
- continue;
7189
- }
7190
- const hm = line.match(/^(#{1,3})\s+(.*)/);
7191
- if (hm) {
7192
- flushList();
7193
- nodes.push(
7194
- /* @__PURE__ */ jsx("p", { className: "font-semibold text-foreground mt-4 first:mt-0 text-sm", children: mdInline(hm[2]) }, key++)
7195
- );
7196
- continue;
7197
- }
7198
- if (/^[-*]\s/.test(line)) {
7199
- listItems.push(line.replace(/^[-*]\s+/, ""));
7200
- continue;
7201
- }
7202
- flushList();
7203
- nodes.push(
7204
- /* @__PURE__ */ jsx("p", { className: "text-sm leading-relaxed mb-1", children: mdInline(line) }, key++)
7205
- );
7206
- }
7207
- flushList();
7208
- return /* @__PURE__ */ jsx(Fragment, { children: nodes });
7209
- }
7210
- function RatingBar({ label, count, total }) {
7589
+ function RatingBar({
7590
+ label,
7591
+ count,
7592
+ total
7593
+ }) {
7211
7594
  const pct = total > 0 ? Math.round(count / total * 100) : 0;
7212
7595
  return /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2 text-xs text-muted-foreground", children: [
7213
7596
  /* @__PURE__ */ jsx("span", { className: "w-12 text-right shrink-0", children: label }),
@@ -7223,12 +7606,63 @@ function RatingBar({ label, count, total }) {
7223
7606
  }
7224
7607
  function IconBlock({ src }) {
7225
7608
  return /* @__PURE__ */ jsxs("div", { className: "relative flex-shrink-0", children: [
7226
- /* @__PURE__ */ jsx("div", { className: "sd-gp absolute -inset-1.5 rounded-2xl bg-primary/30 blur-md pointer-events-none", "aria-hidden": "true" }),
7227
- /* @__PURE__ */ jsx("div", { className: "sd-si relative w-20 h-20 rounded-2xl overflow-hidden shadow-lg ring-1 ring-border", children: src ? /* @__PURE__ */ jsx("img", { src, alt: "", "aria-hidden": true, className: "w-full h-full object-cover" }) : /* @__PURE__ */ jsx("div", { className: "w-full h-full bg-gradient-to-br from-primary/25 to-primary/8 flex items-center justify-center", children: /* @__PURE__ */ jsxs("svg", { viewBox: "0 0 40 40", className: "w-10 h-10", fill: "none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", children: [
7228
- /* @__PURE__ */ jsx("polygon", { points: "20,4 34,11 20,18 6,11", className: "fill-primary/40", stroke: "currentColor", strokeWidth: "0.6", strokeOpacity: "0.4" }),
7229
- /* @__PURE__ */ jsx("polygon", { points: "6,11 20,18 20,34 6,27", className: "fill-primary/20", stroke: "currentColor", strokeWidth: "0.6", strokeOpacity: "0.4" }),
7230
- /* @__PURE__ */ jsx("polygon", { points: "34,11 20,18 20,34 34,27", className: "fill-primary/30", stroke: "currentColor", strokeWidth: "0.6", strokeOpacity: "0.4" })
7231
- ] }) }) })
7609
+ /* @__PURE__ */ jsx(
7610
+ "div",
7611
+ {
7612
+ className: "sd-gp absolute -inset-1.5 rounded-2xl bg-primary/30 blur-md pointer-events-none",
7613
+ "aria-hidden": "true"
7614
+ }
7615
+ ),
7616
+ /* @__PURE__ */ jsx("div", { className: "sd-si relative w-20 h-20 rounded-2xl overflow-hidden shadow-lg ring-1 ring-border", children: src ? /* @__PURE__ */ jsx(
7617
+ "img",
7618
+ {
7619
+ src,
7620
+ alt: "",
7621
+ "aria-hidden": true,
7622
+ className: "w-full h-full object-cover"
7623
+ }
7624
+ ) : /* @__PURE__ */ jsx("div", { className: "w-full h-full bg-gradient-to-br from-primary/25 to-primary/8 flex items-center justify-center", children: /* @__PURE__ */ jsxs(
7625
+ "svg",
7626
+ {
7627
+ viewBox: "0 0 40 40",
7628
+ className: "w-10 h-10",
7629
+ fill: "none",
7630
+ xmlns: "http://www.w3.org/2000/svg",
7631
+ "aria-hidden": "true",
7632
+ children: [
7633
+ /* @__PURE__ */ jsx(
7634
+ "polygon",
7635
+ {
7636
+ points: "20,4 34,11 20,18 6,11",
7637
+ className: "fill-primary/40",
7638
+ stroke: "currentColor",
7639
+ strokeWidth: "0.6",
7640
+ strokeOpacity: "0.4"
7641
+ }
7642
+ ),
7643
+ /* @__PURE__ */ jsx(
7644
+ "polygon",
7645
+ {
7646
+ points: "6,11 20,18 20,34 6,27",
7647
+ className: "fill-primary/20",
7648
+ stroke: "currentColor",
7649
+ strokeWidth: "0.6",
7650
+ strokeOpacity: "0.4"
7651
+ }
7652
+ ),
7653
+ /* @__PURE__ */ jsx(
7654
+ "polygon",
7655
+ {
7656
+ points: "34,11 20,18 20,34 34,27",
7657
+ className: "fill-primary/30",
7658
+ stroke: "currentColor",
7659
+ strokeWidth: "0.6",
7660
+ strokeOpacity: "0.4"
7661
+ }
7662
+ )
7663
+ ]
7664
+ }
7665
+ ) }) })
7232
7666
  ] });
7233
7667
  }
7234
7668
  function StoreProductDetailPage({
@@ -7244,6 +7678,7 @@ function StoreProductDetailPage({
7244
7678
  const [error, setError] = useState(null);
7245
7679
  const [activeScreenshot, setActiveScreenshot] = useState(0);
7246
7680
  const [screenshotKey, setScreenshotKey] = useState(0);
7681
+ const [embedFailed, setEmbedFailed] = useState(false);
7247
7682
  useEffect(() => {
7248
7683
  if (!slug && !id) {
7249
7684
  setError("Product not found.");
@@ -7297,11 +7732,30 @@ function StoreProductDetailPage({
7297
7732
  if (error || !details) {
7298
7733
  return /* @__PURE__ */ jsxs("div", { className: "max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-20 text-center", children: [
7299
7734
  /* @__PURE__ */ jsx("p", { className: "text-muted-foreground mb-4", children: error ?? "Product not found." }),
7300
- /* @__PURE__ */ jsx("button", { type: "button", onClick: () => navigate("/store"), className: "text-sm text-primary hover:underline", children: "Back to Store" })
7735
+ /* @__PURE__ */ jsx(
7736
+ "button",
7737
+ {
7738
+ type: "button",
7739
+ onClick: () => navigate("/store"),
7740
+ className: "text-sm text-primary hover:underline",
7741
+ children: "Back to Store"
7742
+ }
7743
+ )
7301
7744
  ] });
7302
7745
  }
7303
- const { product, publisher, reviews, reviewsCount, relatedProducts, ratingDistribution } = details;
7304
- const priceLabel = formatPrice2(product.price, product.currency, product.pricingModel);
7746
+ const {
7747
+ product,
7748
+ publisher,
7749
+ reviews,
7750
+ reviewsCount,
7751
+ relatedProducts,
7752
+ ratingDistribution
7753
+ } = details;
7754
+ const priceLabel = formatPrice2(
7755
+ product.price,
7756
+ product.currency,
7757
+ product.pricingModel
7758
+ );
7305
7759
  const screenshots = product.screenshots ?? [];
7306
7760
  const totalRatings = ratingDistribution ? ratingDistribution.fiveStars + ratingDistribution.fourStars + ratingDistribution.threeStars + ratingDistribution.twoStars + ratingDistribution.oneStar : 0;
7307
7761
  return /* @__PURE__ */ jsxs("div", { className: "w-full", children: [
@@ -7315,15 +7769,60 @@ function StoreProductDetailPage({
7315
7769
  }
7316
7770
  ),
7317
7771
  /* @__PURE__ */ jsxs("div", { className: "relative overflow-hidden", children: [
7318
- /* @__PURE__ */ jsx("div", { className: "absolute inset-0 bg-gradient-to-b from-primary/[0.07] via-background to-background pointer-events-none", "aria-hidden": "true" }),
7319
- /* @__PURE__ */ jsxs("svg", { className: "absolute inset-0 w-full h-full opacity-[0.04] pointer-events-none", xmlns: "http://www.w3.org/2000/svg", "aria-hidden": "true", children: [
7320
- /* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsx("pattern", { id: "sd-grid", width: "40", height: "40", patternUnits: "userSpaceOnUse", children: /* @__PURE__ */ jsx("path", { d: "M 40 0 L 0 0 0 40", fill: "none", stroke: "currentColor", strokeWidth: "1" }) }) }),
7321
- /* @__PURE__ */ jsx("rect", { width: "100%", height: "100%", fill: "url(#sd-grid)" })
7322
- ] }),
7323
- /* @__PURE__ */ jsx("div", { className: "absolute -top-12 -left-12 w-72 h-72 rounded-full bg-primary/10 blur-3xl pointer-events-none", "aria-hidden": "true" }),
7772
+ /* @__PURE__ */ jsx(
7773
+ "div",
7774
+ {
7775
+ className: "absolute inset-0 bg-gradient-to-b from-primary/[0.07] via-background to-background pointer-events-none",
7776
+ "aria-hidden": "true"
7777
+ }
7778
+ ),
7779
+ /* @__PURE__ */ jsxs(
7780
+ "svg",
7781
+ {
7782
+ className: "absolute inset-0 w-full h-full opacity-[0.04] pointer-events-none",
7783
+ xmlns: "http://www.w3.org/2000/svg",
7784
+ "aria-hidden": "true",
7785
+ children: [
7786
+ /* @__PURE__ */ jsx("defs", { children: /* @__PURE__ */ jsx(
7787
+ "pattern",
7788
+ {
7789
+ id: "sd-grid",
7790
+ width: "40",
7791
+ height: "40",
7792
+ patternUnits: "userSpaceOnUse",
7793
+ children: /* @__PURE__ */ jsx(
7794
+ "path",
7795
+ {
7796
+ d: "M 40 0 L 0 0 0 40",
7797
+ fill: "none",
7798
+ stroke: "currentColor",
7799
+ strokeWidth: "1"
7800
+ }
7801
+ )
7802
+ }
7803
+ ) }),
7804
+ /* @__PURE__ */ jsx("rect", { width: "100%", height: "100%", fill: "url(#sd-grid)" })
7805
+ ]
7806
+ }
7807
+ ),
7808
+ /* @__PURE__ */ jsx(
7809
+ "div",
7810
+ {
7811
+ className: "absolute -top-12 -left-12 w-72 h-72 rounded-full bg-primary/10 blur-3xl pointer-events-none",
7812
+ "aria-hidden": "true"
7813
+ }
7814
+ ),
7324
7815
  /* @__PURE__ */ jsxs("div", { className: "relative max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 pt-6 pb-8", children: [
7325
7816
  /* @__PURE__ */ jsxs("nav", { className: "sd-fi text-sm text-muted-foreground mb-6 flex items-center gap-1.5 flex-wrap", children: [
7326
- /* @__PURE__ */ jsx("button", { type: "button", onClick: () => navigate("/store"), className: "hover:text-primary transition-colors", children: "Store" }),
7817
+ /* @__PURE__ */ jsx(
7818
+ "button",
7819
+ {
7820
+ type: "button",
7821
+ onClick: () => navigate("/store"),
7822
+ className: "hover:text-primary transition-colors",
7823
+ children: "Store"
7824
+ }
7825
+ ),
7327
7826
  /* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: "\u203A" }),
7328
7827
  product.category && /* @__PURE__ */ jsxs(Fragment, { children: [
7329
7828
  /* @__PURE__ */ jsx(
@@ -7389,6 +7888,14 @@ function StoreProductDetailPage({
7389
7888
  }
7390
7889
  )
7391
7890
  ] }),
7891
+ product.type === "WORKFLOW" && !embedFailed && /* @__PURE__ */ jsx("div", { className: "sd-fu sd-d3 mb-8", children: /* @__PURE__ */ jsx(
7892
+ WorkflowEmbed,
7893
+ {
7894
+ appUrl: appLoginUrl,
7895
+ productId: product.id,
7896
+ onError: () => setEmbedFailed(true)
7897
+ }
7898
+ ) }),
7392
7899
  screenshots.length > 0 && /* @__PURE__ */ jsxs("div", { className: "sd-fu sd-d3 mb-8", children: [
7393
7900
  /* @__PURE__ */ jsx("div", { className: "rounded-xl overflow-hidden bg-muted aspect-video mb-3 shadow-md", children: /* @__PURE__ */ jsx(
7394
7901
  "img",
@@ -7405,19 +7912,33 @@ function StoreProductDetailPage({
7405
7912
  type: "button",
7406
7913
  onClick: () => switchScreenshot(i),
7407
7914
  className: `w-20 h-14 rounded-lg overflow-hidden flex-shrink-0 border-2 transition-all duration-200 ${i === activeScreenshot ? "border-primary shadow-sm shadow-primary/20" : "border-transparent opacity-50 hover:opacity-80"}`,
7408
- children: /* @__PURE__ */ jsx("img", { src, alt: `Thumbnail ${i + 1}`, className: "w-full h-full object-cover" })
7915
+ children: /* @__PURE__ */ jsx(
7916
+ "img",
7917
+ {
7918
+ src,
7919
+ alt: `Thumbnail ${i + 1}`,
7920
+ className: "w-full h-full object-cover"
7921
+ }
7922
+ )
7409
7923
  },
7410
7924
  i
7411
7925
  )) })
7412
7926
  ] }),
7413
7927
  product.longDescription && /* @__PURE__ */ jsxs("div", { className: "sd-fu sd-d4 mb-8", children: [
7414
7928
  /* @__PURE__ */ jsx("h2", { className: "text-lg font-bold text-foreground mb-3", children: "About" }),
7415
- /* @__PURE__ */ jsx("div", { className: "text-muted-foreground", children: /* @__PURE__ */ jsx(MdAbout, { content: product.longDescription }) })
7929
+ /* @__PURE__ */ jsx("div", { className: "prose prose-sm max-w-none text-muted-foreground leading-relaxed whitespace-pre-line", children: product.longDescription })
7416
7930
  ] }),
7417
7931
  publisher && /* @__PURE__ */ jsxs("div", { className: "sd-fu sd-d5 mb-8 p-4 rounded-xl border border-border bg-card hover:border-primary/30 transition-colors duration-300", children: [
7418
7932
  /* @__PURE__ */ jsx("h2", { className: "text-sm font-semibold text-foreground mb-3", children: "Publisher" }),
7419
7933
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3", children: [
7420
- publisher.logoUrl ? /* @__PURE__ */ jsx("img", { src: publisher.logoUrl, alt: publisher.name, className: "w-10 h-10 rounded-full object-cover" }) : /* @__PURE__ */ jsx("div", { className: "w-10 h-10 rounded-full bg-primary/10 flex items-center justify-center text-primary text-sm font-bold", children: publisher.name.charAt(0).toUpperCase() }),
7934
+ publisher.logoUrl ? /* @__PURE__ */ jsx(
7935
+ "img",
7936
+ {
7937
+ src: publisher.logoUrl,
7938
+ alt: publisher.name,
7939
+ className: "w-10 h-10 rounded-full object-cover"
7940
+ }
7941
+ ) : /* @__PURE__ */ jsx("div", { className: "w-10 h-10 rounded-full bg-primary/10 flex items-center justify-center text-primary text-sm font-bold", children: publisher.name.charAt(0).toUpperCase() }),
7421
7942
  /* @__PURE__ */ jsxs("div", { children: [
7422
7943
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-1.5", children: [
7423
7944
  /* @__PURE__ */ jsx("span", { className: "font-semibold text-foreground text-sm", children: publisher.name }),
@@ -7443,11 +7964,46 @@ function StoreProductDetailPage({
7443
7964
  ] })
7444
7965
  ] }),
7445
7966
  /* @__PURE__ */ jsxs("div", { className: "flex-1 space-y-1.5 pt-1", children: [
7446
- /* @__PURE__ */ jsx(RatingBar, { label: "5 \u2605", count: ratingDistribution.fiveStars, total: totalRatings }),
7447
- /* @__PURE__ */ jsx(RatingBar, { label: "4 \u2605", count: ratingDistribution.fourStars, total: totalRatings }),
7448
- /* @__PURE__ */ jsx(RatingBar, { label: "3 \u2605", count: ratingDistribution.threeStars, total: totalRatings }),
7449
- /* @__PURE__ */ jsx(RatingBar, { label: "2 \u2605", count: ratingDistribution.twoStars, total: totalRatings }),
7450
- /* @__PURE__ */ jsx(RatingBar, { label: "1 \u2605", count: ratingDistribution.oneStar, total: totalRatings })
7967
+ /* @__PURE__ */ jsx(
7968
+ RatingBar,
7969
+ {
7970
+ label: "5 \u2605",
7971
+ count: ratingDistribution.fiveStars,
7972
+ total: totalRatings
7973
+ }
7974
+ ),
7975
+ /* @__PURE__ */ jsx(
7976
+ RatingBar,
7977
+ {
7978
+ label: "4 \u2605",
7979
+ count: ratingDistribution.fourStars,
7980
+ total: totalRatings
7981
+ }
7982
+ ),
7983
+ /* @__PURE__ */ jsx(
7984
+ RatingBar,
7985
+ {
7986
+ label: "3 \u2605",
7987
+ count: ratingDistribution.threeStars,
7988
+ total: totalRatings
7989
+ }
7990
+ ),
7991
+ /* @__PURE__ */ jsx(
7992
+ RatingBar,
7993
+ {
7994
+ label: "2 \u2605",
7995
+ count: ratingDistribution.twoStars,
7996
+ total: totalRatings
7997
+ }
7998
+ ),
7999
+ /* @__PURE__ */ jsx(
8000
+ RatingBar,
8001
+ {
8002
+ label: "1 \u2605",
8003
+ count: ratingDistribution.oneStar,
8004
+ total: totalRatings
8005
+ }
8006
+ )
7451
8007
  ] })
7452
8008
  ] }),
7453
8009
  /* @__PURE__ */ jsx("div", { className: "space-y-3", children: reviews.slice(0, 5).map((review, idx) => /* @__PURE__ */ jsxs(
@@ -7462,11 +8018,14 @@ function StoreProductDetailPage({
7462
8018
  ] }),
7463
8019
  review.title && /* @__PURE__ */ jsx("p", { className: "font-semibold text-sm text-foreground mb-1", children: review.title }),
7464
8020
  review.comment && /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground leading-relaxed", children: review.comment }),
7465
- review.createdAt && /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground mt-2", children: new Date(review.createdAt).toLocaleDateString("en-US", {
7466
- year: "numeric",
7467
- month: "short",
7468
- day: "numeric"
7469
- }) })
8021
+ review.createdAt && /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground mt-2", children: new Date(review.createdAt).toLocaleDateString(
8022
+ "en-US",
8023
+ {
8024
+ year: "numeric",
8025
+ month: "short",
8026
+ day: "numeric"
8027
+ }
8028
+ ) })
7470
8029
  ]
7471
8030
  },
7472
8031
  review.id
@@ -7486,7 +8045,13 @@ function StoreProductDetailPage({
7486
8045
  ] }),
7487
8046
  /* @__PURE__ */ jsx("aside", { className: "lg:sticky lg:top-24 self-start", children: /* @__PURE__ */ jsxs("div", { className: "sd-fu sd-d4 bg-card border border-border rounded-xl p-5 space-y-4 hover:border-primary/30 transition-colors duration-300 hover:shadow-lg hover:shadow-primary/5", children: [
7488
8047
  /* @__PURE__ */ jsxs("div", { children: [
7489
- /* @__PURE__ */ jsx("div", { className: `text-3xl font-extrabold ${priceLabel === "Free" ? "text-emerald-500" : "text-foreground"}`, children: priceLabel }),
8048
+ /* @__PURE__ */ jsx(
8049
+ "div",
8050
+ {
8051
+ className: `text-3xl font-extrabold ${priceLabel === "Free" ? "text-emerald-500" : "text-foreground"}`,
8052
+ children: priceLabel
8053
+ }
8054
+ ),
7490
8055
  product.pricingModel === "SUBSCRIPTION" && /* @__PURE__ */ jsx("div", { className: "text-xs text-muted-foreground", children: "per month" })
7491
8056
  ] }),
7492
8057
  /* @__PURE__ */ jsx(