@gfed-medusa/sf-lib-products 1.10.1 → 1.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/dist/components/behavior-tracker/index.d.ts.map +1 -1
  2. package/dist/components/behavior-tracker/index.js +1 -65
  3. package/dist/components/behavior-tracker/index.js.map +1 -1
  4. package/dist/components/browse-product-preview/index.d.ts +2 -2
  5. package/dist/components/browse-product-preview/index.d.ts.map +1 -1
  6. package/dist/components/pagination/index.d.ts +2 -2
  7. package/dist/components/product-actions/index.d.ts +2 -2
  8. package/dist/components/product-actions/index.d.ts.map +1 -1
  9. package/dist/components/product-price/index.d.ts +2 -2
  10. package/dist/components/product-price/index.d.ts.map +1 -1
  11. package/dist/components/product-tabs/index.d.ts +2 -2
  12. package/dist/components/product-tabs/index.d.ts.map +1 -1
  13. package/dist/components/refinement-list/sort-products/index.d.ts +2 -2
  14. package/dist/components/skeleton-product-preview/index.d.ts +2 -2
  15. package/dist/components/skeleton-related-products/index.d.ts +2 -2
  16. package/dist/components/skeleton-related-products/index.d.ts.map +1 -1
  17. package/dist/lib/data/cart.d.ts.map +1 -1
  18. package/dist/lib/data/cart.js +1 -3
  19. package/dist/lib/data/cart.js.map +1 -1
  20. package/dist/lib/gql/fragments/cart.d.ts +9 -9
  21. package/dist/lib/gql/fragments/cart.d.ts.map +1 -1
  22. package/dist/lib/gql/fragments/product.d.ts +16 -16
  23. package/dist/lib/gql/fragments/product.d.ts.map +1 -1
  24. package/dist/lib/gql/mutations/cart.d.ts +10 -10
  25. package/dist/lib/gql/mutations/cart.d.ts.map +1 -1
  26. package/dist/lib/gql/queries/cart.d.ts +2 -2
  27. package/dist/lib/gql/queries/product.d.ts +13 -13
  28. package/dist/templates/paginated-products/client.d.ts +2 -2
  29. package/dist/templates/paginated-products/client.d.ts.map +1 -1
  30. package/dist/templates/paginated-products/index.d.ts +2 -2
  31. package/dist/templates/paginated-products/index.d.ts.map +1 -1
  32. package/dist/templates/product-actions-wrapper/index.d.ts +2 -2
  33. package/dist/templates/product-actions-wrapper/index.d.ts.map +1 -1
  34. package/dist/templates/product-info/index.d.ts +2 -2
  35. package/dist/templates/store-template/index.d.ts +2 -2
  36. package/dist/types/graphql.d.ts +0 -4
  37. package/dist/types/graphql.d.ts.map +1 -1
  38. package/dist/types/graphql.js.map +1 -1
  39. package/package.json +3 -3
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/components/behavior-tracker/index.tsx"],"sourcesContent":[],"mappings":";;;UAuHiB,oBAAA;WACN;AADX;AAIgB,iBAAA,eAAA,CAAkB;EAAA;AAA+B,CAApB,EAAA,oBAAoB,CAAA,EAAA,IAAA"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/components/behavior-tracker/index.tsx"],"sourcesContent":[],"mappings":";;;UAiDiB,oBAAA;WACN;AADX;AAIgB,iBAAA,eAAA,CAAkB;EAAA;AAA+B,CAApB,EAAA,oBAAoB,CAAA,EAAA,IAAA"}
@@ -3,15 +3,9 @@
3
3
  import { useEffect, useRef } from "react";
4
4
  import { sendClientSignal } from "@gfed-medusa/sf-lib-common/lib/personalization/client-signal";
5
5
  import { SignalType } from "@gfed-medusa/sf-lib-common/types/graphql";
6
- import { PERSONALIZATION_CONFIG, getSegmentIdFromCollection } from "@gfed-medusa/sf-lib-common/lib/personalization/config";
7
- import { getSegmentCookie, setSegmentCookie } from "@gfed-medusa/sf-lib-common/lib/personalization/behavior-tracker";
8
- import { useStorefrontContext } from "@gfed-medusa/sf-lib-common/lib/data/context";
9
6
  import { useTimeOnPage } from "@gfed-medusa/sf-lib-common/lib/hooks/use-time-on-page";
10
7
 
11
8
  //#region src/components/behavior-tracker/index.tsx
12
- const PDP_HESITATION_MS = PERSONALIZATION_CONFIG.pdpHesitationMs;
13
- const HIGH_SCROLL_THRESHOLD = PERSONALIZATION_CONFIG.highScrollThreshold;
14
- const PRICE_THRESHOLD = PERSONALIZATION_CONFIG.priceThreshold;
15
9
  function getScrollPercentage() {
16
10
  const scrollTop = window.scrollY;
17
11
  const docHeight = document.documentElement.scrollHeight - window.innerHeight;
@@ -39,53 +33,14 @@ function throttle(fn, limit) {
39
33
  }
40
34
  });
41
35
  }
42
- function emitSignal(type, payload) {
43
- const data = getSegmentCookie();
44
- if (!data.signals || typeof data.signals !== "object") data.signals = {};
45
- data.signals[type] = payload ?? true;
46
- setSegmentCookie(data);
47
- }
48
- const REPEAT_CATEGORY_THRESHOLD = 3;
49
- function trackRepeatedCategoryView(segment) {
50
- try {
51
- const data = getSegmentCookie();
52
- if (!data.signals || typeof data.signals !== "object") data.signals = {};
53
- const categoryCounts = data.signals["repeated-category-view"] ?? {};
54
- const newCount = (categoryCounts[segment] ?? 0) + 1;
55
- categoryCounts[segment] = newCount;
56
- data.signals["repeated-category-view"] = categoryCounts;
57
- if (newCount >= REPEAT_CATEGORY_THRESHOLD) emitSignal("repeated-category-view", {
58
- segment,
59
- count: newCount
60
- });
61
- setSegmentCookie(data);
62
- } catch {}
63
- }
64
- function addHistoryToCookie(segment) {
65
- try {
66
- const data = getSegmentCookie();
67
- if (!data.history || !Array.isArray(data.history)) data.history = [];
68
- data.history = [...data.history, segment].slice(-PERSONALIZATION_CONFIG.historyMaxLength);
69
- setSegmentCookie(data);
70
- } catch {}
71
- }
72
36
  function BehaviorTracker({ product }) {
73
- const { cartId } = useStorefrontContext();
74
- const hesitationTimeoutRef = useRef(null);
75
37
  const scrollHandlerRef = useRef(null);
76
- const scrollTrackedRef = useRef(false);
77
- useRef(false);
78
38
  const firedDepthRef = useRef(/* @__PURE__ */ new Set());
79
39
  const exitIntentFiredRef = useRef(false);
80
40
  useTimeOnPage("pdp", Boolean(product?.id));
81
41
  useEffect(() => {
82
42
  if (!product?.id) return;
83
43
  const collectionHandle = product.collection?.handle;
84
- const segment = getSegmentIdFromCollection(collectionHandle);
85
- if (segment) {
86
- addHistoryToCookie(segment);
87
- trackRepeatedCategoryView(segment);
88
- }
89
44
  const productPrice = getCheapestVariantPrice(product);
90
45
  sendClientSignal(SignalType.ProductView, {
91
46
  productId: product.id,
@@ -94,13 +49,6 @@ function BehaviorTracker({ product }) {
94
49
  category: collectionHandle,
95
50
  price: productPrice
96
51
  });
97
- const hasCart = Boolean(cartId);
98
- if (productPrice && productPrice >= PRICE_THRESHOLD && !hasCart) hesitationTimeoutRef.current = setTimeout(() => {
99
- emitSignal("pdp-hesitation", {
100
- productId: product.id,
101
- price: productPrice
102
- });
103
- }, PDP_HESITATION_MS);
104
52
  const handleScroll = throttle(() => {
105
53
  const scrollPct = Math.round(getScrollPercentage() * 100);
106
54
  for (const threshold of [
@@ -115,28 +63,16 @@ function BehaviorTracker({ product }) {
115
63
  page: window.location.pathname
116
64
  });
117
65
  }
118
- if (getScrollPercentage() >= HIGH_SCROLL_THRESHOLD && !hasCart && !scrollTrackedRef.current) {
119
- scrollTrackedRef.current = true;
120
- emitSignal("high-scroll-no-action", {
121
- productId: product.id,
122
- scrollDepth: HIGH_SCROLL_THRESHOLD
123
- });
124
- }
125
66
  }, 500);
126
67
  scrollHandlerRef.current = handleScroll;
127
68
  window.addEventListener("scroll", handleScroll, { passive: true });
128
69
  return () => {
129
- if (hesitationTimeoutRef.current !== null) {
130
- clearTimeout(hesitationTimeoutRef.current);
131
- hesitationTimeoutRef.current = null;
132
- }
133
70
  if (scrollHandlerRef.current !== null) {
134
71
  window.removeEventListener("scroll", scrollHandlerRef.current);
135
72
  scrollHandlerRef.current = null;
136
73
  }
137
- scrollTrackedRef.current = false;
138
74
  };
139
- }, [product, cartId]);
75
+ }, [product]);
140
76
  useEffect(() => {
141
77
  const handleMouseLeave = (e) => {
142
78
  if (e.clientY <= 0 && !exitIntentFiredRef.current) {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["cheapest: number | null"],"sources":["../../../src/components/behavior-tracker/index.tsx"],"sourcesContent":["'use client';\n\nimport { useEffect, useRef } from 'react';\n\nimport { sendClientSignal } from '@gfed-medusa/sf-lib-common/lib/personalization/client-signal';\nimport { SignalType } from '@gfed-medusa/sf-lib-common/types/graphql';\n\nimport {\n PERSONALIZATION_CONFIG,\n getSegmentIdFromCollection,\n} from '@gfed-medusa/sf-lib-common/lib/personalization/config';\nimport {\n getSegmentCookie,\n setSegmentCookie,\n} from '@gfed-medusa/sf-lib-common/lib/personalization/behavior-tracker';\nimport { useStorefrontContext } from '@gfed-medusa/sf-lib-common/lib/data/context';\nimport { useTimeOnPage } from '@gfed-medusa/sf-lib-common/lib/hooks/use-time-on-page';\nimport { Product } from '@/types/graphql';\n\nconst PDP_HESITATION_MS = PERSONALIZATION_CONFIG.pdpHesitationMs;\nconst HIGH_SCROLL_THRESHOLD = PERSONALIZATION_CONFIG.highScrollThreshold;\nconst PRICE_THRESHOLD = PERSONALIZATION_CONFIG.priceThreshold;\n\nfunction getScrollPercentage(): number {\n const scrollTop = window.scrollY;\n const docHeight =\n document.documentElement.scrollHeight - window.innerHeight;\n return docHeight > 0 ? scrollTop / docHeight : 0;\n}\n\nfunction getCheapestVariantPrice(product: Product): number | null {\n const variants = product.variants;\n if (!variants || variants.length === 0) return null;\n\n let cheapest: number | null = null;\n\n for (const variant of variants) {\n const priceObj = variant.price;\n if (priceObj && typeof priceObj.amount === 'number') {\n if (cheapest === null || priceObj.amount < cheapest) {\n cheapest = priceObj.amount;\n }\n }\n }\n\n return cheapest;\n}\n\nfunction throttle<T extends (...args: unknown[]) => void>(\n fn: T,\n limit: number\n): T {\n let lastCall = 0;\n return ((...args: unknown[]) => {\n const now = Date.now();\n if (now - lastCall >= limit) {\n lastCall = now;\n fn(...args);\n }\n }) as T;\n}\n\nfunction emitSignal(type: string, payload?: unknown) {\n const data = getSegmentCookie();\n\n if (!data.signals || typeof data.signals !== 'object') {\n data.signals = {};\n }\n\n (data.signals as Record<string, unknown>)[type] = payload ?? true;\n\n setSegmentCookie(data);\n}\n\nconst REPEAT_CATEGORY_THRESHOLD = 3;\n\nfunction trackRepeatedCategoryView(segment: string) {\n try {\n const data = getSegmentCookie();\n\n if (!data.signals || typeof data.signals !== 'object') {\n data.signals = {};\n }\n\n const categoryCounts = (data.signals as Record<string, unknown>)['repeated-category-view'] as Record<string, number> ?? {};\n const currentCount = categoryCounts[segment] ?? 0;\n const newCount = currentCount + 1;\n\n categoryCounts[segment] = newCount;\n (data.signals as Record<string, unknown>)['repeated-category-view'] = categoryCounts;\n\n if (newCount >= REPEAT_CATEGORY_THRESHOLD) {\n emitSignal('repeated-category-view', { segment, count: newCount });\n }\n\n setSegmentCookie(data);\n } catch {\n // Ignore\n }\n}\n\nfunction addHistoryToCookie(segment: string): void {\n try {\n const data = getSegmentCookie();\n\n if (!data.history || !Array.isArray(data.history)) {\n data.history = [];\n }\n\n const history = [...(data.history as string[]), segment].slice(\n -PERSONALIZATION_CONFIG.historyMaxLength\n );\n data.history = history;\n\n setSegmentCookie(data);\n } catch {\n }\n}\n\nexport interface BehaviorTrackerProps {\n product: Product;\n}\n\nexport function BehaviorTracker({ product }: BehaviorTrackerProps) {\n const { cartId } = useStorefrontContext();\n const hesitationTimeoutRef = useRef<ReturnType<typeof setTimeout> | null>(\n null\n );\n const scrollHandlerRef = useRef<(() => void) | null>(null);\n const scrollTrackedRef = useRef(false);\n const historyTrackedRef = useRef(false);\n const firedDepthRef = useRef<Set<number>>(new Set());\n const exitIntentFiredRef = useRef(false);\n\n useTimeOnPage('pdp', Boolean(product?.id));\n\n useEffect(() => {\n if (!product?.id) return;\n\n const collectionHandle = product.collection?.handle;\n const segment = getSegmentIdFromCollection(collectionHandle);\n\n if (segment) {\n addHistoryToCookie(segment);\n trackRepeatedCategoryView(segment);\n }\n\n const productPrice = getCheapestVariantPrice(product);\n void sendClientSignal(SignalType.ProductView, {\n productId: product.id,\n productName: product.title,\n productHandle: product.handle,\n category: collectionHandle,\n price: productPrice,\n });\n\n const hasCart = Boolean(cartId);\n\n if (productPrice && productPrice >= PRICE_THRESHOLD && !hasCart) {\n hesitationTimeoutRef.current = setTimeout(() => {\n emitSignal('pdp-hesitation', {\n productId: product.id,\n price: productPrice,\n });\n }, PDP_HESITATION_MS);\n }\n\n const handleScroll = throttle(() => {\n // SCROLL_DEPTH analytics signal — always runs independently\n const scrollPct = Math.round(getScrollPercentage() * 100);\n const depthThresholds = [25, 50, 75, 90];\n for (const threshold of depthThresholds) {\n if (scrollPct >= threshold && !firedDepthRef.current.has(threshold)) {\n firedDepthRef.current.add(threshold);\n void sendClientSignal(SignalType.ScrollDepth, {\n depth: threshold,\n page: window.location.pathname,\n });\n }\n }\n\n if (getScrollPercentage() >= HIGH_SCROLL_THRESHOLD && !hasCart && !scrollTrackedRef.current) {\n scrollTrackedRef.current = true;\n emitSignal('high-scroll-no-action', {\n productId: product.id,\n scrollDepth: HIGH_SCROLL_THRESHOLD,\n });\n }\n }, 500);\n\n scrollHandlerRef.current = handleScroll;\n window.addEventListener('scroll', handleScroll, { passive: true });\n\n return () => {\n if (hesitationTimeoutRef.current !== null) {\n clearTimeout(hesitationTimeoutRef.current);\n hesitationTimeoutRef.current = null;\n }\n if (scrollHandlerRef.current !== null) {\n window.removeEventListener('scroll', scrollHandlerRef.current);\n scrollHandlerRef.current = null;\n }\n scrollTrackedRef.current = false;\n };\n }, [product, cartId]);\n\n useEffect(() => {\n const handleMouseLeave = (e: MouseEvent) => {\n if (e.clientY <= 0 && !exitIntentFiredRef.current) {\n exitIntentFiredRef.current = true;\n void sendClientSignal(SignalType.ExitIntent, {\n page: window.location.pathname,\n });\n }\n };\n document.documentElement.addEventListener('mouseleave', handleMouseLeave);\n return () => document.documentElement.removeEventListener('mouseleave', handleMouseLeave);\n }, []);\n\n return null;\n}\n\nexport default BehaviorTracker;\n"],"mappings":"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"}
1
+ {"version":3,"file":"index.js","names":["cheapest: number | null"],"sources":["../../../src/components/behavior-tracker/index.tsx"],"sourcesContent":["'use client';\n\nimport { useEffect, useRef } from 'react';\n\nimport { sendClientSignal } from '@gfed-medusa/sf-lib-common/lib/personalization/client-signal';\nimport { SignalType } from '@gfed-medusa/sf-lib-common/types/graphql';\n\nimport { useTimeOnPage } from '@gfed-medusa/sf-lib-common/lib/hooks/use-time-on-page';\nimport { Product } from '@/types/graphql';\n\nfunction getScrollPercentage(): number {\n const scrollTop = window.scrollY;\n const docHeight =\n document.documentElement.scrollHeight - window.innerHeight;\n return docHeight > 0 ? scrollTop / docHeight : 0;\n}\n\nfunction getCheapestVariantPrice(product: Product): number | null {\n const variants = product.variants;\n if (!variants || variants.length === 0) return null;\n\n let cheapest: number | null = null;\n\n for (const variant of variants) {\n const priceObj = variant.price;\n if (priceObj && typeof priceObj.amount === 'number') {\n if (cheapest === null || priceObj.amount < cheapest) {\n cheapest = priceObj.amount;\n }\n }\n }\n\n return cheapest;\n}\n\nfunction throttle<T extends (...args: unknown[]) => void>(\n fn: T,\n limit: number\n): T {\n let lastCall = 0;\n return ((...args: unknown[]) => {\n const now = Date.now();\n if (now - lastCall >= limit) {\n lastCall = now;\n fn(...args);\n }\n }) as T;\n}\n\nexport interface BehaviorTrackerProps {\n product: Product;\n}\n\nexport function BehaviorTracker({ product }: BehaviorTrackerProps) {\n const scrollHandlerRef = useRef<(() => void) | null>(null);\n const firedDepthRef = useRef<Set<number>>(new Set());\n const exitIntentFiredRef = useRef(false);\n\n useTimeOnPage('pdp', Boolean(product?.id));\n\n useEffect(() => {\n if (!product?.id) return;\n\n const collectionHandle = product.collection?.handle;\n const productPrice = getCheapestVariantPrice(product);\n void sendClientSignal(SignalType.ProductView, {\n productId: product.id,\n productName: product.title,\n productHandle: product.handle,\n category: collectionHandle,\n price: productPrice,\n });\n\n const handleScroll = throttle(() => {\n const scrollPct = Math.round(getScrollPercentage() * 100);\n const depthThresholds = [25, 50, 75, 90];\n for (const threshold of depthThresholds) {\n if (scrollPct >= threshold && !firedDepthRef.current.has(threshold)) {\n firedDepthRef.current.add(threshold);\n void sendClientSignal(SignalType.ScrollDepth, {\n depth: threshold,\n page: window.location.pathname,\n });\n }\n }\n }, 500);\n\n scrollHandlerRef.current = handleScroll;\n window.addEventListener('scroll', handleScroll, { passive: true });\n\n return () => {\n if (scrollHandlerRef.current !== null) {\n window.removeEventListener('scroll', scrollHandlerRef.current);\n scrollHandlerRef.current = null;\n }\n };\n }, [product]);\n\n useEffect(() => {\n const handleMouseLeave = (e: MouseEvent) => {\n if (e.clientY <= 0 && !exitIntentFiredRef.current) {\n exitIntentFiredRef.current = true;\n void sendClientSignal(SignalType.ExitIntent, {\n page: window.location.pathname,\n });\n }\n };\n document.documentElement.addEventListener('mouseleave', handleMouseLeave);\n return () => document.documentElement.removeEventListener('mouseleave', handleMouseLeave);\n }, []);\n\n return null;\n}\n\nexport default BehaviorTracker;\n"],"mappings":";;;;;;;;AAUA,SAAS,sBAA8B;CACrC,MAAM,YAAY,OAAO;CACzB,MAAM,YACJ,SAAS,gBAAgB,eAAe,OAAO;AACjD,QAAO,YAAY,IAAI,YAAY,YAAY;;AAGjD,SAAS,wBAAwB,SAAiC;CAChE,MAAM,WAAW,QAAQ;AACzB,KAAI,CAAC,YAAY,SAAS,WAAW,EAAG,QAAO;CAE/C,IAAIA,WAA0B;AAE9B,MAAK,MAAM,WAAW,UAAU;EAC9B,MAAM,WAAW,QAAQ;AACzB,MAAI,YAAY,OAAO,SAAS,WAAW,UACzC;OAAI,aAAa,QAAQ,SAAS,SAAS,SACzC,YAAW,SAAS;;;AAK1B,QAAO;;AAGT,SAAS,SACP,IACA,OACG;CACH,IAAI,WAAW;AACf,UAAS,GAAG,SAAoB;EAC9B,MAAM,MAAM,KAAK,KAAK;AACtB,MAAI,MAAM,YAAY,OAAO;AAC3B,cAAW;AACX,MAAG,GAAG,KAAK;;;;AASjB,SAAgB,gBAAgB,EAAE,WAAiC;CACjE,MAAM,mBAAmB,OAA4B,KAAK;CAC1D,MAAM,gBAAgB,uBAAoB,IAAI,KAAK,CAAC;CACpD,MAAM,qBAAqB,OAAO,MAAM;AAExC,eAAc,OAAO,QAAQ,SAAS,GAAG,CAAC;AAE1C,iBAAgB;AACd,MAAI,CAAC,SAAS,GAAI;EAElB,MAAM,mBAAmB,QAAQ,YAAY;EAC7C,MAAM,eAAe,wBAAwB,QAAQ;AACrD,EAAK,iBAAiB,WAAW,aAAa;GAC5C,WAAW,QAAQ;GACnB,aAAa,QAAQ;GACrB,eAAe,QAAQ;GACvB,UAAU;GACV,OAAO;GACR,CAAC;EAEF,MAAM,eAAe,eAAe;GAClC,MAAM,YAAY,KAAK,MAAM,qBAAqB,GAAG,IAAI;AAEzD,QAAK,MAAM,aADa;IAAC;IAAI;IAAI;IAAI;IAAG,CAEtC,KAAI,aAAa,aAAa,CAAC,cAAc,QAAQ,IAAI,UAAU,EAAE;AACnE,kBAAc,QAAQ,IAAI,UAAU;AACpC,IAAK,iBAAiB,WAAW,aAAa;KAC5C,OAAO;KACP,MAAM,OAAO,SAAS;KACvB,CAAC;;KAGL,IAAI;AAEP,mBAAiB,UAAU;AAC3B,SAAO,iBAAiB,UAAU,cAAc,EAAE,SAAS,MAAM,CAAC;AAElE,eAAa;AACX,OAAI,iBAAiB,YAAY,MAAM;AACrC,WAAO,oBAAoB,UAAU,iBAAiB,QAAQ;AAC9D,qBAAiB,UAAU;;;IAG9B,CAAC,QAAQ,CAAC;AAEb,iBAAgB;EACd,MAAM,oBAAoB,MAAkB;AAC1C,OAAI,EAAE,WAAW,KAAK,CAAC,mBAAmB,SAAS;AACjD,uBAAmB,UAAU;AAC7B,IAAK,iBAAiB,WAAW,YAAY,EAC3C,MAAM,OAAO,SAAS,UACvB,CAAC;;;AAGN,WAAS,gBAAgB,iBAAiB,cAAc,iBAAiB;AACzE,eAAa,SAAS,gBAAgB,oBAAoB,cAAc,iBAAiB;IACxF,EAAE,CAAC;AAEN,QAAO;;AAGT,+BAAe"}
@@ -1,5 +1,5 @@
1
1
  import { BrowseProductHitFragment } from "../../types/graphql.js";
2
- import * as react_jsx_runtime16 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/components/browse-product-preview/index.d.ts
5
5
  type BrowseProductPreviewProps = {
@@ -11,7 +11,7 @@ declare const BrowseProductPreview: ({
11
11
  product,
12
12
  isFeatured,
13
13
  imageFetchPriority
14
- }: BrowseProductPreviewProps) => react_jsx_runtime16.JSX.Element;
14
+ }: BrowseProductPreviewProps) => react_jsx_runtime0.JSX.Element;
15
15
  //#endregion
16
16
  export { BrowseProductPreview };
17
17
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/components/browse-product-preview/index.tsx"],"sourcesContent":[],"mappings":";;;;KAkBK,yBAAA;WACM;;EADN,kBAAA,CAAA,EAAA,MAAA,GAAyB,MAAA,GAAA,KACnB;AAAwB,CAAA;cAwC7B,oBAAwB,EAAA,CAAA;EAAA,OAAA;EAAA,UAAA;EAAA;AAAA,CAAA,EAI3B,yBAJ2B,EAAA,GAIF,mBAAA,CAAA,GAAA,CAAA,OAJE"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/components/browse-product-preview/index.tsx"],"sourcesContent":[],"mappings":";;;;KAkBK,yBAAA;WACM;;EADN,kBAAA,CAAA,EAAA,MAAA,GAAyB,MAAA,GAAA,KACnB;AAAwB,CAAA;cAwC7B,oBAAwB,EAAA,CAAA;EAAA,OAAA;EAAA,UAAA;EAAA;AAAA,CAAA,EAI3B,yBAJ2B,EAAA,GAIF,kBAAA,CAAA,GAAA,CAAA,OAJE"}
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime0 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime1 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/components/pagination/index.d.ts
4
4
  declare function Pagination({
@@ -19,7 +19,7 @@ declare function Pagination({
19
19
  isLoading?: boolean;
20
20
  onLoadMore: () => void;
21
21
  'data-testid'?: string;
22
- }): react_jsx_runtime0.JSX.Element;
22
+ }): react_jsx_runtime1.JSX.Element;
23
23
  //#endregion
24
24
  export { Pagination };
25
25
  //# sourceMappingURL=index.d.ts.map
@@ -1,5 +1,5 @@
1
1
  import { ProductActionsProduct } from "../../types/index.js";
2
- import * as react_jsx_runtime1 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime15 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/components/product-actions/index.d.ts
5
5
  type ProductActionsProps = {
@@ -13,7 +13,7 @@ declare function ProductActions({
13
13
  regionId,
14
14
  disabled,
15
15
  enableMobileActions
16
- }: ProductActionsProps): react_jsx_runtime1.JSX.Element;
16
+ }: ProductActionsProps): react_jsx_runtime15.JSX.Element;
17
17
  //#endregion
18
18
  export { ProductActionsProps, ProductActions as default };
19
19
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/components/product-actions/index.tsx"],"sourcesContent":[],"mappings":";;;;KAyBY,mBAAA;WACD;;EADC,QAAA,CAAA,EAAA,OAAA;EA2BY,mBAAc,CAAA,EAAA,OAAA;CACpC;AACA,iBAFsB,cAAA,CAEtB;EAAA,OAAA;EAAA,QAAA;EAAA,QAAA;EAAA;AAAA,CAAA,EAGC,mBAHD,CAAA,EAGoB,kBAAA,CAAA,GAAA,CAAA,OAHpB"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/components/product-actions/index.tsx"],"sourcesContent":[],"mappings":";;;;KAyBY,mBAAA;WACD;;EADC,QAAA,CAAA,EAAA,OAAA;EA2BY,mBAAc,CAAA,EAAA,OAAA;CACpC;AACA,iBAFsB,cAAA,CAEtB;EAAA,OAAA;EAAA,QAAA;EAAA,QAAA;EAAA;AAAA,CAAA,EAGC,mBAHD,CAAA,EAGoB,mBAAA,CAAA,GAAA,CAAA,OAHpB"}
@@ -1,6 +1,6 @@
1
1
  import { ProductVariant } from "../../types/graphql.js";
2
2
  import { ProductActionsProduct } from "../../types/index.js";
3
- import * as react_jsx_runtime15 from "react/jsx-runtime";
3
+ import * as react_jsx_runtime3 from "react/jsx-runtime";
4
4
 
5
5
  //#region src/components/product-price/index.d.ts
6
6
  declare function ProductPrice({
@@ -9,7 +9,7 @@ declare function ProductPrice({
9
9
  }: {
10
10
  product: ProductActionsProduct;
11
11
  variant?: ProductVariant;
12
- }): react_jsx_runtime15.JSX.Element;
12
+ }): react_jsx_runtime3.JSX.Element;
13
13
  //#endregion
14
14
  export { ProductPrice as default };
15
15
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/components/product-price/index.tsx"],"sourcesContent":[],"mappings":";;;;;iBAOwB,YAAA;;;AAFyB;WAMtC;YACC;AAPqC,CAAA,CAAA,EAQhD,mBAAA,CAAA,GAAA,CAAA,OANmC"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/components/product-price/index.tsx"],"sourcesContent":[],"mappings":";;;;;iBAOwB,YAAA;;;AAFyB;WAMtC;YACC;AAPqC,CAAA,CAAA,EAQhD,kBAAA,CAAA,GAAA,CAAA,OANmC"}
@@ -1,5 +1,5 @@
1
1
  import { Product } from "../../types/graphql.js";
2
- import * as react_jsx_runtime13 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime4 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/components/product-tabs/index.d.ts
5
5
  type ProductTabsProps = {
@@ -7,7 +7,7 @@ type ProductTabsProps = {
7
7
  };
8
8
  declare const ProductTabs: ({
9
9
  product
10
- }: ProductTabsProps) => react_jsx_runtime13.JSX.Element;
10
+ }: ProductTabsProps) => react_jsx_runtime4.JSX.Element;
11
11
  //#endregion
12
12
  export { ProductTabs as default };
13
13
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/components/product-tabs/index.tsx"],"sourcesContent":[],"mappings":";;;;KAcK,gBAAA;WACM;;AAL+B,cAQpC,WAJe,EAAA,CAAA;EAAA;AACH,CAAP,EAGuB,gBAHhB,EAAA,GAGgC,mBAAA,CAAA,GAAA,CAAA,OAHhC"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/components/product-tabs/index.tsx"],"sourcesContent":[],"mappings":";;;;KAcK,gBAAA;WACM;;AAL+B,cAQpC,WAJe,EAAA,CAAA;EAAA;AACH,CAAP,EAGuB,gBAHhB,EAAA,GAGgC,kBAAA,CAAA,GAAA,CAAA,OAHhC"}
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime14 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime11 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/components/refinement-list/sort-products/index.d.ts
4
4
  type SortOptions = 'price_asc' | 'price_desc' | 'created_at';
@@ -13,7 +13,7 @@ declare const SortProducts: ({
13
13
  sortBy,
14
14
  setQueryParams,
15
15
  variant
16
- }: SortProductsProps) => react_jsx_runtime14.JSX.Element;
16
+ }: SortProductsProps) => react_jsx_runtime11.JSX.Element;
17
17
  //#endregion
18
18
  export { SortOptions, SortProducts as default };
19
19
  //# sourceMappingURL=index.d.ts.map
@@ -1,7 +1,7 @@
1
- import * as react_jsx_runtime9 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime8 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/components/skeleton-product-preview/index.d.ts
4
- declare const SkeletonProductPreview: () => react_jsx_runtime9.JSX.Element;
4
+ declare const SkeletonProductPreview: () => react_jsx_runtime8.JSX.Element;
5
5
  //#endregion
6
6
  export { SkeletonProductPreview as default };
7
7
  //# sourceMappingURL=index.d.ts.map
@@ -1,7 +1,7 @@
1
- import * as react_jsx_runtime11 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime9 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/components/skeleton-related-products/index.d.ts
4
- declare const SkeletonRelatedProducts: () => react_jsx_runtime11.JSX.Element;
4
+ declare const SkeletonRelatedProducts: () => react_jsx_runtime9.JSX.Element;
5
5
  //#endregion
6
6
  export { SkeletonRelatedProducts as default };
7
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/components/skeleton-related-products/index.tsx"],"sourcesContent":[],"mappings":";;;cAGM,+BAAuB,mBAAA,CAAA,GAAA,CAAA"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/components/skeleton-related-products/index.tsx"],"sourcesContent":[],"mappings":";;;cAGM,+BAAuB,kBAAA,CAAA,GAAA,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"cart.d.ts","names":[],"sources":["../../../src/lib/data/cart.ts"],"sourcesContent":[],"mappings":";;;;cAsCa,oCAEN,sBACJ,QAAQ;cAmBE,yCAEN,sBACJ,QAAQ;AAzBE,cAgGA,SA5EZ,EAAA,CAAA;EAAA,SAAA;EAAA,QAAA;EAAA;CAAA,EAAA;EAlBM,SAAA,EAAA,MAAA;EACI,QAAA,EAAA,MAAA;EAAR,WAAA,EAAA,MAAA;CAAO,EAAA,GAuGP,OAvGO,CAuGC,sBAvGD,CAAA,gBAAA,CAAA,GAAA,IAAA,CAAA"}
1
+ {"version":3,"file":"cart.d.ts","names":[],"sources":["../../../src/lib/data/cart.ts"],"sourcesContent":[],"mappings":";;;;cAqCa,oCAEN,sBACJ,QAAQ;cAmBE,yCAEN,sBACJ,QAAQ;AAzBE,cAgGA,SA5EZ,EAAA,CAAA;EAAA,SAAA;EAAA,QAAA;EAAA;CAAA,EAAA;EAlBM,SAAA,EAAA,MAAA;EACI,QAAA,EAAA,MAAA;EAAR,WAAA,EAAA,MAAA;CAAO,EAAA,GAuGP,OAvGO,CAuGC,sBAvGD,CAAA,gBAAA,CAAA,GAAA,IAAA,CAAA"}
@@ -9,7 +9,6 @@ import { getCacheTag, getCartId } from "@gfed-medusa/sf-lib-common/lib/data/cook
9
9
  import { createServerApolloClient, graphqlFetch, graphqlMutation } from "@gfed-medusa/sf-lib-common/lib/gql/apollo-client";
10
10
  import { resolveNextContext } from "@gfed-medusa/sf-lib-common/lib/data/next-context";
11
11
  import { sendSignal } from "@gfed-medusa/sf-lib-common/lib/data/personalization";
12
- import { retrieveCustomer } from "@gfed-medusa/sf-lib-common/lib/data/customer";
13
12
 
14
13
  //#region src/lib/data/cart.ts
15
14
  const retrieveCart = async (cartId, ctx) => {
@@ -82,11 +81,10 @@ const addToCart = async ({ variantId, quantity, countryCode }) => {
82
81
  revalidateTag(getCacheTag("carts", ctx));
83
82
  revalidateTag(getCacheTag("fulfillment", ctx));
84
83
  } catch {}
85
- const cartUserId = ctx.cookieHeader?.includes("_medusa_jwt=") ? (await retrieveCustomer(ctx).catch(() => null))?.id : void 0;
86
84
  sendSignal(SignalType.CartAdd, ctx, {
87
85
  variantId,
88
86
  quantity
89
- }, void 0, cartUserId);
87
+ });
90
88
  }
91
89
  return lineItem;
92
90
  } catch (error) {
@@ -1 +1 @@
1
- {"version":3,"file":"cart.js","names":["error: any"],"sources":["../../../src/lib/data/cart.ts"],"sourcesContent":["'use server';\n\nimport type { StorefrontContext } from '@gfed-medusa/sf-lib-common/lib/data/context';\nimport { setCartIdAction } from '@gfed-medusa/sf-lib-common/lib/data/cookies-actions';\nimport {\n getCacheTag,\n getCartId,\n} from '@gfed-medusa/sf-lib-common/lib/data/cookies-utils';\nimport {\n createServerApolloClient,\n graphqlFetch,\n graphqlMutation,\n} from '@gfed-medusa/sf-lib-common/lib/gql/apollo-client';\nimport {\n Cart,\n CreateCartMutation,\n CreateCartMutationVariables,\n CreateLineItemMutation,\n CreateLineItemMutationVariables,\n GetCartQuery,\n GetCartQueryVariables,\n UpdateCartMutation,\n UpdateCartMutationVariables,\n} from '@gfed-medusa/sf-lib-common/types/graphql';\n\nimport {\n CREATE_CART_MUTATION,\n CREATE_LINE_ITEM_MUTATION,\n UPDATE_CART_MUTATION,\n} from '@/lib/gql/mutations/cart';\nimport { GET_CART_QUERY } from '@/lib/gql/queries/cart';\n\nimport { getRegion } from './regions';\nimport { resolveNextContext } from '@gfed-medusa/sf-lib-common/lib/data/next-context';\nimport { sendSignal } from '@gfed-medusa/sf-lib-common/lib/data/personalization';\nimport { SignalType } from '@gfed-medusa/sf-lib-common/types/graphql';\nimport { retrieveCustomer } from '@gfed-medusa/sf-lib-common/lib/data/customer';\n\nexport const retrieveCart = async (\n cartId: string,\n ctx: StorefrontContext\n): Promise<Cart | null> => {\n const id = cartId || getCartId(ctx);\n if (!id) {\n return null;\n }\n\n try {\n const data = await graphqlFetch<GetCartQuery, GetCartQueryVariables>({\n query: GET_CART_QUERY,\n variables: { id },\n });\n\n return data?.cart ?? null;\n } catch (error) {\n console.error('Failed to fetch cart:', error);\n return null;\n }\n};\n\nexport const getOrSetCart = async (\n countryCode: string,\n ctx: StorefrontContext\n): Promise<Cart | null> => {\n const region = await getRegion(countryCode, ctx);\n\n if (!region) {\n throw new Error(`Region not found for country code: ${countryCode}`);\n }\n\n let cart = await retrieveCart(getCartId(ctx) || '', ctx);\n\n const apolloClient = createServerApolloClient(ctx.cookieHeader);\n\n if (!cart) {\n const data = await graphqlMutation<\n CreateCartMutation,\n CreateCartMutationVariables\n >(\n {\n mutation: CREATE_CART_MUTATION,\n variables: {\n data: { regionId: region.id },\n },\n },\n apolloClient\n );\n\n cart = data?.createCart ?? null;\n\n if (cart) {\n await setCartIdAction(cart.id);\n\n try {\n const { revalidateTag } = await import('next/cache');\n const cartCacheTag = getCacheTag('carts', ctx);\n revalidateTag(cartCacheTag);\n } catch {\n // Not in Next.js environment, skip revalidation\n }\n }\n }\n\n if (cart && cart.regionId !== region.id) {\n const data = await graphqlMutation<\n UpdateCartMutation,\n UpdateCartMutationVariables\n >(\n {\n mutation: UPDATE_CART_MUTATION,\n variables: {\n id: cart.id,\n data: { regionId: region.id },\n },\n },\n apolloClient\n );\n\n cart = data?.updateCart ?? cart;\n\n if (cart) {\n try {\n const { revalidateTag } = await import('next/cache');\n const cartCacheTag = getCacheTag('carts', ctx);\n revalidateTag(cartCacheTag);\n } catch {\n // Not in Next.js environment\n }\n }\n }\n\n return cart;\n};\n\nexport const addToCart = async (\n {\n variantId,\n quantity,\n countryCode,\n }: {\n variantId: string;\n quantity: number;\n countryCode: string;\n }\n): Promise<CreateLineItemMutation['createLineItem'] | null> => {\n if (!variantId) {\n throw new Error('Missing variant ID when adding to cart');\n }\n\n if (!countryCode) {\n throw new Error('Missing country code when adding to cart');\n }\n\n const ctx = await resolveNextContext();\n const apolloClient = createServerApolloClient(ctx.cookieHeader ?? '');\n const cart = await getOrSetCart(countryCode, ctx);\n\n if (!cart) {\n throw new Error('Error retrieving or creating cart');\n }\n\n try {\n const result = await graphqlMutation<\n CreateLineItemMutation,\n CreateLineItemMutationVariables\n >(\n {\n mutation: CREATE_LINE_ITEM_MUTATION,\n variables: {\n cartId: cart.id,\n data: {\n variantId: variantId,\n quantity,\n },\n },\n },\n apolloClient\n );\n\n const lineItem = result?.createLineItem ?? null;\n\n if (lineItem) {\n try {\n const { revalidateTag } = await import('next/cache');\n const cartCacheTag = getCacheTag('carts', ctx);\n revalidateTag(cartCacheTag);\n const fulfillmentCacheTag = getCacheTag('fulfillment', ctx);\n revalidateTag(fulfillmentCacheTag);\n } catch {\n // Not in Next.js environment\n }\n\n // Send cart add signal for personalization\n const cartUserId = ctx.cookieHeader?.includes('_medusa_jwt=')\n ? (await retrieveCustomer(ctx).catch(() => null))?.id\n : undefined;\n void sendSignal(SignalType.CartAdd, ctx, { variantId, quantity }, undefined, cartUserId);\n }\n\n return lineItem;\n } catch (error: any) {\n console.error('GraphQL addToCart error:', error.message);\n throw error;\n }\n};\n"],"mappings":";;;;;;;;;;;;;;AAsCA,MAAa,eAAe,OAC1B,QACA,QACyB;CACzB,MAAM,KAAK,UAAU,UAAU,IAAI;AACnC,KAAI,CAAC,GACH,QAAO;AAGT,KAAI;AAMF,UALa,MAAM,aAAkD;GACnE,OAAO;GACP,WAAW,EAAE,IAAI;GAClB,CAAC,GAEW,QAAQ;UACd,OAAO;AACd,UAAQ,MAAM,yBAAyB,MAAM;AAC7C,SAAO;;;AAIX,MAAa,eAAe,OAC1B,aACA,QACyB;CACzB,MAAM,SAAS,MAAM,UAAU,aAAa,IAAI;AAEhD,KAAI,CAAC,OACH,OAAM,IAAI,MAAM,sCAAsC,cAAc;CAGtE,IAAI,OAAO,MAAM,aAAa,UAAU,IAAI,IAAI,IAAI,IAAI;CAExD,MAAM,eAAe,yBAAyB,IAAI,aAAa;AAE/D,KAAI,CAAC,MAAM;AAcT,UAba,MAAM,gBAIjB;GACE,UAAU;GACV,WAAW,EACT,MAAM,EAAE,UAAU,OAAO,IAAI,EAC9B;GACF,EACD,aACD,GAEY,cAAc;AAE3B,MAAI,MAAM;AACR,SAAM,gBAAgB,KAAK,GAAG;AAE9B,OAAI;IACF,MAAM,EAAE,kBAAkB,MAAM,OAAO;AAEvC,kBADqB,YAAY,SAAS,IAAI,CACnB;WACrB;;;AAMZ,KAAI,QAAQ,KAAK,aAAa,OAAO,IAAI;AAevC,UAda,MAAM,gBAIjB;GACE,UAAU;GACV,WAAW;IACT,IAAI,KAAK;IACT,MAAM,EAAE,UAAU,OAAO,IAAI;IAC9B;GACF,EACD,aACD,GAEY,cAAc;AAE3B,MAAI,KACF,KAAI;GACF,MAAM,EAAE,kBAAkB,MAAM,OAAO;AAEvC,iBADqB,YAAY,SAAS,IAAI,CACnB;UACrB;;AAMZ,QAAO;;AAGT,MAAa,YAAY,OACvB,EACE,WACA,UACA,kBAM2D;AAC7D,KAAI,CAAC,UACH,OAAM,IAAI,MAAM,yCAAyC;AAG3D,KAAI,CAAC,YACH,OAAM,IAAI,MAAM,2CAA2C;CAG7D,MAAM,MAAM,MAAM,oBAAoB;CACtC,MAAM,eAAe,yBAAyB,IAAI,gBAAgB,GAAG;CACrE,MAAM,OAAO,MAAM,aAAa,aAAa,IAAI;AAEjD,KAAI,CAAC,KACH,OAAM,IAAI,MAAM,oCAAoC;AAGtD,KAAI;EAkBF,MAAM,YAjBS,MAAM,gBAInB;GACE,UAAU;GACV,WAAW;IACT,QAAQ,KAAK;IACb,MAAM;KACO;KACX;KACD;IACF;GACF,EACD,aACD,GAEwB,kBAAkB;AAE3C,MAAI,UAAU;AACZ,OAAI;IACF,MAAM,EAAE,kBAAkB,MAAM,OAAO;AAEvC,kBADqB,YAAY,SAAS,IAAI,CACnB;AAE3B,kBAD4B,YAAY,eAAe,IAAI,CACzB;WAC5B;GAKR,MAAM,aAAa,IAAI,cAAc,SAAS,eAAe,IACxD,MAAM,iBAAiB,IAAI,CAAC,YAAY,KAAK,GAAG,KACjD;AACJ,GAAK,WAAW,WAAW,SAAS,KAAK;IAAE;IAAW;IAAU,EAAE,QAAW,WAAW;;AAG1F,SAAO;UACAA,OAAY;AACnB,UAAQ,MAAM,4BAA4B,MAAM,QAAQ;AACxD,QAAM"}
1
+ {"version":3,"file":"cart.js","names":["error: any"],"sources":["../../../src/lib/data/cart.ts"],"sourcesContent":["'use server';\n\nimport type { StorefrontContext } from '@gfed-medusa/sf-lib-common/lib/data/context';\nimport { setCartIdAction } from '@gfed-medusa/sf-lib-common/lib/data/cookies-actions';\nimport {\n getCacheTag,\n getCartId,\n} from '@gfed-medusa/sf-lib-common/lib/data/cookies-utils';\nimport {\n createServerApolloClient,\n graphqlFetch,\n graphqlMutation,\n} from '@gfed-medusa/sf-lib-common/lib/gql/apollo-client';\nimport {\n Cart,\n CreateCartMutation,\n CreateCartMutationVariables,\n CreateLineItemMutation,\n CreateLineItemMutationVariables,\n GetCartQuery,\n GetCartQueryVariables,\n UpdateCartMutation,\n UpdateCartMutationVariables,\n} from '@gfed-medusa/sf-lib-common/types/graphql';\n\nimport {\n CREATE_CART_MUTATION,\n CREATE_LINE_ITEM_MUTATION,\n UPDATE_CART_MUTATION,\n} from '@/lib/gql/mutations/cart';\nimport { GET_CART_QUERY } from '@/lib/gql/queries/cart';\n\nimport { getRegion } from './regions';\nimport { resolveNextContext } from '@gfed-medusa/sf-lib-common/lib/data/next-context';\nimport { sendSignal } from '@gfed-medusa/sf-lib-common/lib/data/personalization';\nimport { SignalType } from '@gfed-medusa/sf-lib-common/types/graphql';\n\nexport const retrieveCart = async (\n cartId: string,\n ctx: StorefrontContext\n): Promise<Cart | null> => {\n const id = cartId || getCartId(ctx);\n if (!id) {\n return null;\n }\n\n try {\n const data = await graphqlFetch<GetCartQuery, GetCartQueryVariables>({\n query: GET_CART_QUERY,\n variables: { id },\n });\n\n return data?.cart ?? null;\n } catch (error) {\n console.error('Failed to fetch cart:', error);\n return null;\n }\n};\n\nexport const getOrSetCart = async (\n countryCode: string,\n ctx: StorefrontContext\n): Promise<Cart | null> => {\n const region = await getRegion(countryCode, ctx);\n\n if (!region) {\n throw new Error(`Region not found for country code: ${countryCode}`);\n }\n\n let cart = await retrieveCart(getCartId(ctx) || '', ctx);\n\n const apolloClient = createServerApolloClient(ctx.cookieHeader);\n\n if (!cart) {\n const data = await graphqlMutation<\n CreateCartMutation,\n CreateCartMutationVariables\n >(\n {\n mutation: CREATE_CART_MUTATION,\n variables: {\n data: { regionId: region.id },\n },\n },\n apolloClient\n );\n\n cart = data?.createCart ?? null;\n\n if (cart) {\n await setCartIdAction(cart.id);\n\n try {\n const { revalidateTag } = await import('next/cache');\n const cartCacheTag = getCacheTag('carts', ctx);\n revalidateTag(cartCacheTag);\n } catch {\n // Not in Next.js environment, skip revalidation\n }\n }\n }\n\n if (cart && cart.regionId !== region.id) {\n const data = await graphqlMutation<\n UpdateCartMutation,\n UpdateCartMutationVariables\n >(\n {\n mutation: UPDATE_CART_MUTATION,\n variables: {\n id: cart.id,\n data: { regionId: region.id },\n },\n },\n apolloClient\n );\n\n cart = data?.updateCart ?? cart;\n\n if (cart) {\n try {\n const { revalidateTag } = await import('next/cache');\n const cartCacheTag = getCacheTag('carts', ctx);\n revalidateTag(cartCacheTag);\n } catch {\n // Not in Next.js environment\n }\n }\n }\n\n return cart;\n};\n\nexport const addToCart = async (\n {\n variantId,\n quantity,\n countryCode,\n }: {\n variantId: string;\n quantity: number;\n countryCode: string;\n }\n): Promise<CreateLineItemMutation['createLineItem'] | null> => {\n if (!variantId) {\n throw new Error('Missing variant ID when adding to cart');\n }\n\n if (!countryCode) {\n throw new Error('Missing country code when adding to cart');\n }\n\n const ctx = await resolveNextContext();\n const apolloClient = createServerApolloClient(ctx.cookieHeader ?? '');\n const cart = await getOrSetCart(countryCode, ctx);\n\n if (!cart) {\n throw new Error('Error retrieving or creating cart');\n }\n\n try {\n const result = await graphqlMutation<\n CreateLineItemMutation,\n CreateLineItemMutationVariables\n >(\n {\n mutation: CREATE_LINE_ITEM_MUTATION,\n variables: {\n cartId: cart.id,\n data: {\n variantId: variantId,\n quantity,\n },\n },\n },\n apolloClient\n );\n\n const lineItem = result?.createLineItem ?? null;\n\n if (lineItem) {\n try {\n const { revalidateTag } = await import('next/cache');\n const cartCacheTag = getCacheTag('carts', ctx);\n revalidateTag(cartCacheTag);\n const fulfillmentCacheTag = getCacheTag('fulfillment', ctx);\n revalidateTag(fulfillmentCacheTag);\n } catch {\n // Not in Next.js environment\n }\n\n // Send cart add signal for personalization\n void sendSignal(SignalType.CartAdd, ctx, { variantId, quantity });\n }\n\n return lineItem;\n } catch (error: any) {\n console.error('GraphQL addToCart error:', error.message);\n throw error;\n }\n};\n"],"mappings":";;;;;;;;;;;;;AAqCA,MAAa,eAAe,OAC1B,QACA,QACyB;CACzB,MAAM,KAAK,UAAU,UAAU,IAAI;AACnC,KAAI,CAAC,GACH,QAAO;AAGT,KAAI;AAMF,UALa,MAAM,aAAkD;GACnE,OAAO;GACP,WAAW,EAAE,IAAI;GAClB,CAAC,GAEW,QAAQ;UACd,OAAO;AACd,UAAQ,MAAM,yBAAyB,MAAM;AAC7C,SAAO;;;AAIX,MAAa,eAAe,OAC1B,aACA,QACyB;CACzB,MAAM,SAAS,MAAM,UAAU,aAAa,IAAI;AAEhD,KAAI,CAAC,OACH,OAAM,IAAI,MAAM,sCAAsC,cAAc;CAGtE,IAAI,OAAO,MAAM,aAAa,UAAU,IAAI,IAAI,IAAI,IAAI;CAExD,MAAM,eAAe,yBAAyB,IAAI,aAAa;AAE/D,KAAI,CAAC,MAAM;AAcT,UAba,MAAM,gBAIjB;GACE,UAAU;GACV,WAAW,EACT,MAAM,EAAE,UAAU,OAAO,IAAI,EAC9B;GACF,EACD,aACD,GAEY,cAAc;AAE3B,MAAI,MAAM;AACR,SAAM,gBAAgB,KAAK,GAAG;AAE9B,OAAI;IACF,MAAM,EAAE,kBAAkB,MAAM,OAAO;AAEvC,kBADqB,YAAY,SAAS,IAAI,CACnB;WACrB;;;AAMZ,KAAI,QAAQ,KAAK,aAAa,OAAO,IAAI;AAevC,UAda,MAAM,gBAIjB;GACE,UAAU;GACV,WAAW;IACT,IAAI,KAAK;IACT,MAAM,EAAE,UAAU,OAAO,IAAI;IAC9B;GACF,EACD,aACD,GAEY,cAAc;AAE3B,MAAI,KACF,KAAI;GACF,MAAM,EAAE,kBAAkB,MAAM,OAAO;AAEvC,iBADqB,YAAY,SAAS,IAAI,CACnB;UACrB;;AAMZ,QAAO;;AAGT,MAAa,YAAY,OACvB,EACE,WACA,UACA,kBAM2D;AAC7D,KAAI,CAAC,UACH,OAAM,IAAI,MAAM,yCAAyC;AAG3D,KAAI,CAAC,YACH,OAAM,IAAI,MAAM,2CAA2C;CAG7D,MAAM,MAAM,MAAM,oBAAoB;CACtC,MAAM,eAAe,yBAAyB,IAAI,gBAAgB,GAAG;CACrE,MAAM,OAAO,MAAM,aAAa,aAAa,IAAI;AAEjD,KAAI,CAAC,KACH,OAAM,IAAI,MAAM,oCAAoC;AAGtD,KAAI;EAkBF,MAAM,YAjBS,MAAM,gBAInB;GACE,UAAU;GACV,WAAW;IACT,QAAQ,KAAK;IACb,MAAM;KACO;KACX;KACD;IACF;GACF,EACD,aACD,GAEwB,kBAAkB;AAE3C,MAAI,UAAU;AACZ,OAAI;IACF,MAAM,EAAE,kBAAkB,MAAM,OAAO;AAEvC,kBADqB,YAAY,SAAS,IAAI,CACnB;AAE3B,kBAD4B,YAAY,eAAe,IAAI,CACzB;WAC5B;AAKR,GAAK,WAAW,WAAW,SAAS,KAAK;IAAE;IAAW;IAAU,CAAC;;AAGnE,SAAO;UACAA,OAAY;AACnB,UAAQ,MAAM,4BAA4B,MAAM,QAAQ;AACxD,QAAM"}
@@ -1,14 +1,14 @@
1
- import * as _apollo_client0 from "@apollo/client";
1
+ import * as _apollo_client14 from "@apollo/client";
2
2
 
3
3
  //#region src/lib/gql/fragments/cart.d.ts
4
- declare const LINE_ITEM_FRAGMENT: _apollo_client0.DocumentNode;
5
- declare const ADDRESS_FRAGMENT: _apollo_client0.DocumentNode;
6
- declare const SHIPPING_METHODS_FRAGMENT: _apollo_client0.DocumentNode;
7
- declare const PAYMENT_COLLECTION_FRAGMENT: _apollo_client0.DocumentNode;
8
- declare const COUNTRY_FRAGMENT: _apollo_client0.DocumentNode;
9
- declare const REGION_FRAGMENT: _apollo_client0.DocumentNode;
10
- declare const PROMOTION_FRAGMENT: _apollo_client0.DocumentNode;
11
- declare const CART_FRAGMENT: _apollo_client0.DocumentNode;
4
+ declare const LINE_ITEM_FRAGMENT: _apollo_client14.DocumentNode;
5
+ declare const ADDRESS_FRAGMENT: _apollo_client14.DocumentNode;
6
+ declare const SHIPPING_METHODS_FRAGMENT: _apollo_client14.DocumentNode;
7
+ declare const PAYMENT_COLLECTION_FRAGMENT: _apollo_client14.DocumentNode;
8
+ declare const COUNTRY_FRAGMENT: _apollo_client14.DocumentNode;
9
+ declare const REGION_FRAGMENT: _apollo_client14.DocumentNode;
10
+ declare const PROMOTION_FRAGMENT: _apollo_client14.DocumentNode;
11
+ declare const CART_FRAGMENT: _apollo_client14.DocumentNode;
12
12
  //#endregion
13
13
  export { ADDRESS_FRAGMENT, CART_FRAGMENT, COUNTRY_FRAGMENT, LINE_ITEM_FRAGMENT, PAYMENT_COLLECTION_FRAGMENT, PROMOTION_FRAGMENT, REGION_FRAGMENT, SHIPPING_METHODS_FRAGMENT };
14
14
  //# sourceMappingURL=cart.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"cart.d.ts","names":[],"sources":["../../../../src/lib/gql/fragments/cart.ts"],"sourcesContent":[],"mappings":";;;cAIa,oBAiBZ,eAAA,CAjB8B;cAmBlB,kBAUZ,eAAA,CAV4B;cAYhB,2BAUZ,eAAA,CAVqC;AA/BzB,cA2CA,2BA1BZ,EA4CA,eAAA,CAlBuC,YA1BvC;AAEY,cA4CA,gBAlCZ,EAyCA,eAAA,CAP4B,YAlC5B;AAEY,cAyCA,eA/BZ,EA0CA,eAAA,CAX2B,YA/B3B;AAEY,cA0CA,kBAxBZ,EAkCA,eAAA,CAV8B,YAxB9B;AAEY,cAkCA,aA3BZ,EAsEA,eAAA,CA3CyB,YA3BzB"}
1
+ {"version":3,"file":"cart.d.ts","names":[],"sources":["../../../../src/lib/gql/fragments/cart.ts"],"sourcesContent":[],"mappings":";;;cAIa,oBAiBZ,gBAAA,CAjB8B;cAmBlB,kBAUZ,gBAAA,CAV4B;cAYhB,2BAUZ,gBAAA,CAVqC;AA/BzB,cA2CA,2BA1BZ,EA4CA,gBAAA,CAlBuC,YA1BvC;AAEY,cA4CA,gBAlCZ,EAyCA,gBAAA,CAP4B,YAlC5B;AAEY,cAyCA,eA/BZ,EA0CA,gBAAA,CAX2B,YA/B3B;AAEY,cA0CA,kBAxBZ,EAkCA,gBAAA,CAV8B,YAxB9B;AAEY,cAkCA,aA3BZ,EAsEA,gBAAA,CA3CyB,YA3BzB"}
@@ -1,21 +1,21 @@
1
- import * as _apollo_client16 from "@apollo/client";
1
+ import * as _apollo_client0 from "@apollo/client";
2
2
 
3
3
  //#region src/lib/gql/fragments/product.d.ts
4
- declare const PRODUCT_IMAGE_FRAGMENT: _apollo_client16.DocumentNode;
5
- declare const PRODUCT_TAG_FRAGMENT: _apollo_client16.DocumentNode;
6
- declare const PRODUCT_OPTION_FRAGMENT: _apollo_client16.DocumentNode;
7
- declare const PRICE_FRAGMENT: _apollo_client16.DocumentNode;
8
- declare const PRODUCT_VARIANT_CONTENT_FRAGMENT: _apollo_client16.DocumentNode;
9
- declare const PRODUCT_VARIANT_PRICING_FRAGMENT: _apollo_client16.DocumentNode;
10
- declare const PRODUCT_VARIANT_FRAGMENT: _apollo_client16.DocumentNode;
11
- declare const PRODUCT_CATEGORY_FRAGMENT: _apollo_client16.DocumentNode;
12
- declare const PRODUCT_COLLECTION_FRAGMENT: _apollo_client16.DocumentNode;
13
- declare const PRODUCT_CONTENT_FRAGMENT: _apollo_client16.DocumentNode;
14
- declare const PRODUCT_FRAGMENT: _apollo_client16.DocumentNode;
15
- declare const PRODUCT_PREVIEW_FRAGMENT: _apollo_client16.DocumentNode;
16
- declare const COLLECTION_PRODUCTS_FRAGMENT: _apollo_client16.DocumentNode;
17
- declare const PRODUCT_HIT_FRAGMENT: _apollo_client16.DocumentNode;
18
- declare const BROWSE_PRODUCT_HIT_FRAGMENT: _apollo_client16.DocumentNode;
4
+ declare const PRODUCT_IMAGE_FRAGMENT: _apollo_client0.DocumentNode;
5
+ declare const PRODUCT_TAG_FRAGMENT: _apollo_client0.DocumentNode;
6
+ declare const PRODUCT_OPTION_FRAGMENT: _apollo_client0.DocumentNode;
7
+ declare const PRICE_FRAGMENT: _apollo_client0.DocumentNode;
8
+ declare const PRODUCT_VARIANT_CONTENT_FRAGMENT: _apollo_client0.DocumentNode;
9
+ declare const PRODUCT_VARIANT_PRICING_FRAGMENT: _apollo_client0.DocumentNode;
10
+ declare const PRODUCT_VARIANT_FRAGMENT: _apollo_client0.DocumentNode;
11
+ declare const PRODUCT_CATEGORY_FRAGMENT: _apollo_client0.DocumentNode;
12
+ declare const PRODUCT_COLLECTION_FRAGMENT: _apollo_client0.DocumentNode;
13
+ declare const PRODUCT_CONTENT_FRAGMENT: _apollo_client0.DocumentNode;
14
+ declare const PRODUCT_FRAGMENT: _apollo_client0.DocumentNode;
15
+ declare const PRODUCT_PREVIEW_FRAGMENT: _apollo_client0.DocumentNode;
16
+ declare const COLLECTION_PRODUCTS_FRAGMENT: _apollo_client0.DocumentNode;
17
+ declare const PRODUCT_HIT_FRAGMENT: _apollo_client0.DocumentNode;
18
+ declare const BROWSE_PRODUCT_HIT_FRAGMENT: _apollo_client0.DocumentNode;
19
19
  //#endregion
20
20
  export { BROWSE_PRODUCT_HIT_FRAGMENT, COLLECTION_PRODUCTS_FRAGMENT, PRICE_FRAGMENT, PRODUCT_CATEGORY_FRAGMENT, PRODUCT_COLLECTION_FRAGMENT, PRODUCT_CONTENT_FRAGMENT, PRODUCT_FRAGMENT, PRODUCT_HIT_FRAGMENT, PRODUCT_IMAGE_FRAGMENT, PRODUCT_OPTION_FRAGMENT, PRODUCT_PREVIEW_FRAGMENT, PRODUCT_TAG_FRAGMENT, PRODUCT_VARIANT_CONTENT_FRAGMENT, PRODUCT_VARIANT_FRAGMENT, PRODUCT_VARIANT_PRICING_FRAGMENT };
21
21
  //# sourceMappingURL=product.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"product.d.ts","names":[],"sources":["../../../../src/lib/gql/fragments/product.ts"],"sourcesContent":[],"mappings":";;;cAEa,wBAKZ,gBAAA,CALkC;cAOtB,sBAIZ,gBAAA,CAJgC;cAMpB,yBASZ,gBAAA,CATmC;AAbvB,cAwBA,cAnBZ,EAyBA,gBAAA,CAN0B,YAnB1B;AAEY,cAyBA,gCArBZ,EAkCA,gBAAA,CAb4C,YArB5C;AAEY,cAkCA,gCAzBZ,EAqCA,gBAAA,CAZ4C,YAzB5C;AAEY,cAqCA,wBA/BZ,EAoDA,gBAAA,CArBoC,YA/BpC;AAEY,cAoDA,yBAvCZ,EA+CA,gBAAA,CARqC,YAvCrC;AAEY,cA+CA,2BAnCZ,EAyCA,gBAAA,CANuC,YAnCvC;AAEY,cAyCA,wBApBZ,EAuEA,gBAAA,CAnDoC,YApBpC;AAEY,cAuEA,gBA/DZ,EAoGA,gBAAA,CArC4B,YA/D5B;AAEY,cAoGA,wBA9FZ,EAgHA,gBAAA,CAlBoC,YA9FpC;AAEY,cAgHA,4BA7DZ,EAoFA,gBAAA,CAvBwC,YA7DxC;AAEY,cAoFA,oBA/CZ,EAuDA,gBAAA,CARgC,YA/ChC;AAEY,cAuDA,2BArCZ,EA+CA,gBAAA,CAVuC,YArCvC"}
1
+ {"version":3,"file":"product.d.ts","names":[],"sources":["../../../../src/lib/gql/fragments/product.ts"],"sourcesContent":[],"mappings":";;;cAEa,wBAKZ,eAAA,CALkC;cAOtB,sBAIZ,eAAA,CAJgC;cAMpB,yBASZ,eAAA,CATmC;AAbvB,cAwBA,cAnBZ,EAyBA,eAAA,CAN0B,YAnB1B;AAEY,cAyBA,gCArBZ,EAkCA,eAAA,CAb4C,YArB5C;AAEY,cAkCA,gCAzBZ,EAqCA,eAAA,CAZ4C,YAzB5C;AAEY,cAqCA,wBA/BZ,EAoDA,eAAA,CArBoC,YA/BpC;AAEY,cAoDA,yBAvCZ,EA+CA,eAAA,CARqC,YAvCrC;AAEY,cA+CA,2BAnCZ,EAyCA,eAAA,CANuC,YAnCvC;AAEY,cAyCA,wBApBZ,EAuEA,eAAA,CAnDoC,YApBpC;AAEY,cAuEA,gBA/DZ,EAoGA,eAAA,CArC4B,YA/D5B;AAEY,cAoGA,wBA9FZ,EAgHA,eAAA,CAlBoC,YA9FpC;AAEY,cAgHA,4BA7DZ,EAoFA,eAAA,CAvBwC,YA7DxC;AAEY,cAoFA,oBA/CZ,EAuDA,eAAA,CARgC,YA/ChC;AAEY,cAuDA,2BArCZ,EA+CA,eAAA,CAVuC,YArCvC"}
@@ -1,15 +1,15 @@
1
- import * as _apollo_client7 from "@apollo/client";
1
+ import * as _apollo_client35 from "@apollo/client";
2
2
 
3
3
  //#region src/lib/gql/mutations/cart.d.ts
4
- declare const CREATE_CART_MUTATION: _apollo_client7.DocumentNode;
5
- declare const UPDATE_CART_MUTATION: _apollo_client7.DocumentNode;
6
- declare const CREATE_LINE_ITEM_MUTATION: _apollo_client7.DocumentNode;
7
- declare const UPDATE_LINE_ITEM_MUTATION: _apollo_client7.DocumentNode;
8
- declare const DELETE_LINE_ITEM_MUTATION: _apollo_client7.DocumentNode;
9
- declare const ADD_SHIPPING_METHOD_MUTATION: _apollo_client7.DocumentNode;
10
- declare const COMPLETE_CART_MUTATION: _apollo_client7.DocumentNode;
11
- declare const TRANSFER_CART_MUTATION: _apollo_client7.DocumentNode;
12
- declare const APPLY_PROMOTIONS_MUTATION: _apollo_client7.DocumentNode;
4
+ declare const CREATE_CART_MUTATION: _apollo_client35.DocumentNode;
5
+ declare const UPDATE_CART_MUTATION: _apollo_client35.DocumentNode;
6
+ declare const CREATE_LINE_ITEM_MUTATION: _apollo_client35.DocumentNode;
7
+ declare const UPDATE_LINE_ITEM_MUTATION: _apollo_client35.DocumentNode;
8
+ declare const DELETE_LINE_ITEM_MUTATION: _apollo_client35.DocumentNode;
9
+ declare const ADD_SHIPPING_METHOD_MUTATION: _apollo_client35.DocumentNode;
10
+ declare const COMPLETE_CART_MUTATION: _apollo_client35.DocumentNode;
11
+ declare const TRANSFER_CART_MUTATION: _apollo_client35.DocumentNode;
12
+ declare const APPLY_PROMOTIONS_MUTATION: _apollo_client35.DocumentNode;
13
13
  //#endregion
14
14
  export { ADD_SHIPPING_METHOD_MUTATION, APPLY_PROMOTIONS_MUTATION, COMPLETE_CART_MUTATION, CREATE_CART_MUTATION, CREATE_LINE_ITEM_MUTATION, DELETE_LINE_ITEM_MUTATION, TRANSFER_CART_MUTATION, UPDATE_CART_MUTATION, UPDATE_LINE_ITEM_MUTATION };
15
15
  //# sourceMappingURL=cart.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"cart.d.ts","names":[],"sources":["../../../../src/lib/gql/mutations/cart.ts"],"sourcesContent":[],"mappings":";;;cAUa,sBAOZ,eAAA,CAPgC;cASpB,sBAgBZ,eAAA,CAhBgC;cAkBpB,2BAWZ,eAAA,CAXqC;AA3BzB,cAwCA,yBAjCZ,EAgDA,eAAA,CAfqC,YAjCrC;AAEY,cAgDA,yBAhCZ,EAwCA,eAAA,CARqC,YAhCrC;AAEY,cAwCA,4BA7BZ,EA4CA,eAAA,CAfwC,YA7BxC;AAEY,cA4CA,sBA7BZ,EAqFA,eAAA,CAxDkC,YA7BlC;AAEY,cAqFA,sBA7EZ,EAoFA,eAAA,CAPkC,YA7ElC;AAEY,cAoFA,yBArEZ,EA4EA,eAAA,CAPqC,YArErC"}
1
+ {"version":3,"file":"cart.d.ts","names":[],"sources":["../../../../src/lib/gql/mutations/cart.ts"],"sourcesContent":[],"mappings":";;;cAUa,sBAOZ,gBAAA,CAPgC;cASpB,sBAgBZ,gBAAA,CAhBgC;cAkBpB,2BAWZ,gBAAA,CAXqC;AA3BzB,cAwCA,yBAjCZ,EAgDA,gBAAA,CAfqC,YAjCrC;AAEY,cAgDA,yBAhCZ,EAwCA,gBAAA,CARqC,YAhCrC;AAEY,cAwCA,4BA7BZ,EA4CA,gBAAA,CAfwC,YA7BxC;AAEY,cA4CA,sBA7BZ,EAqFA,gBAAA,CAxDkC,YA7BlC;AAEY,cAqFA,sBA7EZ,EAoFA,gBAAA,CAPkC,YA7ElC;AAEY,cAoFA,yBArEZ,EA4EA,gBAAA,CAPqC,YArErC"}
@@ -1,7 +1,7 @@
1
- import * as _apollo_client31 from "@apollo/client";
1
+ import * as _apollo_client22 from "@apollo/client";
2
2
 
3
3
  //#region src/lib/gql/queries/cart.d.ts
4
- declare const GET_CART_QUERY: _apollo_client31.DocumentNode;
4
+ declare const GET_CART_QUERY: _apollo_client22.DocumentNode;
5
5
  //#endregion
6
6
  export { GET_CART_QUERY };
7
7
  //# sourceMappingURL=cart.d.ts.map
@@ -1,18 +1,18 @@
1
- import * as _apollo_client32 from "@apollo/client";
1
+ import * as _apollo_client23 from "@apollo/client";
2
2
 
3
3
  //#region src/lib/gql/queries/product.d.ts
4
- declare const GET_PRODUCTS_QUERY: _apollo_client32.DocumentNode;
5
- declare const GET_PRODUCTS_PREVIEW_QUERY: _apollo_client32.DocumentNode;
6
- declare const GET_PRODUCT_QUERY: _apollo_client32.DocumentNode;
7
- declare const GET_PRODUCT_CONTENT_BY_HANDLE_QUERY: _apollo_client32.DocumentNode;
8
- declare const GET_PRODUCT_PRICING_QUERY: _apollo_client32.DocumentNode;
9
- declare const GET_PRODUCT_CATEGORIES_QUERY: _apollo_client32.DocumentNode;
10
- declare const GET_PRODUCT_CATEGORY_QUERY: _apollo_client32.DocumentNode;
11
- declare const GET_COLLECTIONS_QUERY: _apollo_client32.DocumentNode;
12
- declare const GET_COLLECTIONS_SUMMARY_QUERY: _apollo_client32.DocumentNode;
13
- declare const GET_COLLECTION_QUERY: _apollo_client32.DocumentNode;
14
- declare const SEARCH_SUGGESTIONS_QUERY: _apollo_client32.DocumentNode;
15
- declare const BROWSE_PRODUCTS_QUERY: _apollo_client32.DocumentNode;
4
+ declare const GET_PRODUCTS_QUERY: _apollo_client23.DocumentNode;
5
+ declare const GET_PRODUCTS_PREVIEW_QUERY: _apollo_client23.DocumentNode;
6
+ declare const GET_PRODUCT_QUERY: _apollo_client23.DocumentNode;
7
+ declare const GET_PRODUCT_CONTENT_BY_HANDLE_QUERY: _apollo_client23.DocumentNode;
8
+ declare const GET_PRODUCT_PRICING_QUERY: _apollo_client23.DocumentNode;
9
+ declare const GET_PRODUCT_CATEGORIES_QUERY: _apollo_client23.DocumentNode;
10
+ declare const GET_PRODUCT_CATEGORY_QUERY: _apollo_client23.DocumentNode;
11
+ declare const GET_COLLECTIONS_QUERY: _apollo_client23.DocumentNode;
12
+ declare const GET_COLLECTIONS_SUMMARY_QUERY: _apollo_client23.DocumentNode;
13
+ declare const GET_COLLECTION_QUERY: _apollo_client23.DocumentNode;
14
+ declare const SEARCH_SUGGESTIONS_QUERY: _apollo_client23.DocumentNode;
15
+ declare const BROWSE_PRODUCTS_QUERY: _apollo_client23.DocumentNode;
16
16
  //#endregion
17
17
  export { BROWSE_PRODUCTS_QUERY, GET_COLLECTIONS_QUERY, GET_COLLECTIONS_SUMMARY_QUERY, GET_COLLECTION_QUERY, GET_PRODUCTS_PREVIEW_QUERY, GET_PRODUCTS_QUERY, GET_PRODUCT_CATEGORIES_QUERY, GET_PRODUCT_CATEGORY_QUERY, GET_PRODUCT_CONTENT_BY_HANDLE_QUERY, GET_PRODUCT_PRICING_QUERY, GET_PRODUCT_QUERY, SEARCH_SUGGESTIONS_QUERY };
18
18
  //# sourceMappingURL=product.d.ts.map
@@ -1,6 +1,6 @@
1
1
  import { BrowseProductHitFragment } from "../../types/graphql.js";
2
2
  import { SortOptions } from "../../components/refinement-list/sort-products/index.js";
3
- import * as react_jsx_runtime4 from "react/jsx-runtime";
3
+ import * as react_jsx_runtime16 from "react/jsx-runtime";
4
4
 
5
5
  //#region src/templates/paginated-products/client.d.ts
6
6
  type PaginatedProductsClientProps = {
@@ -24,7 +24,7 @@ declare function PaginatedProductsClient({
24
24
  categoryId,
25
25
  productsIds,
26
26
  countryCode
27
- }: PaginatedProductsClientProps): react_jsx_runtime4.JSX.Element;
27
+ }: PaginatedProductsClientProps): react_jsx_runtime16.JSX.Element;
28
28
  //#endregion
29
29
  export { PaginatedProductsClient as default };
30
30
  //# sourceMappingURL=client.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"client.d.ts","names":[],"sources":["../../../src/templates/paginated-products/client.tsx"],"sourcesContent":[],"mappings":";;;;;KAkBK,4BAAA;mBACc;;EADd,iBAAA,EAAA,MAAA;EA6HmB,YAAA,EAAA,MAAA;EACtB,MAAA,CAAA,EAzHS,WAyHT;EACA,YAAA,CAAA,EAAA,MAAA;EACA,UAAA,CAAA,EAAA,MAAA;EACA,WAAA,CAAA,EAAA,MAAA,EAAA;EACA,WAAA,EAAA,MAAA;CACA;AACA,iBAPsB,uBAAA,CAOtB;EAAA,eAAA;EAAA,iBAAA;EAAA,iBAAA;EAAA,YAAA;EAAA,MAAA;EAAA,YAAA;EAAA,UAAA;EAAA,WAAA;EAAA;AAAA,CAAA,EAGC,4BAHD,CAAA,EAG6B,kBAAA,CAAA,GAAA,CAAA,OAH7B"}
1
+ {"version":3,"file":"client.d.ts","names":[],"sources":["../../../src/templates/paginated-products/client.tsx"],"sourcesContent":[],"mappings":";;;;;KAkBK,4BAAA;mBACc;;EADd,iBAAA,EAAA,MAAA;EA6HmB,YAAA,EAAA,MAAA;EACtB,MAAA,CAAA,EAzHS,WAyHT;EACA,YAAA,CAAA,EAAA,MAAA;EACA,UAAA,CAAA,EAAA,MAAA;EACA,WAAA,CAAA,EAAA,MAAA,EAAA;EACA,WAAA,EAAA,MAAA;CACA;AACA,iBAPsB,uBAAA,CAOtB;EAAA,eAAA;EAAA,iBAAA;EAAA,iBAAA;EAAA,YAAA;EAAA,MAAA;EAAA,YAAA;EAAA,UAAA;EAAA,WAAA;EAAA;AAAA,CAAA,EAGC,4BAHD,CAAA,EAG6B,mBAAA,CAAA,GAAA,CAAA,OAH7B"}
@@ -1,5 +1,5 @@
1
1
  import { SortOptions } from "../../components/refinement-list/sort-products/index.js";
2
- import * as react_jsx_runtime8 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime12 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/templates/paginated-products/index.d.ts
5
5
  declare function PaginatedProducts({
@@ -16,7 +16,7 @@ declare function PaginatedProducts({
16
16
  categoryId?: string;
17
17
  productsIds?: string[];
18
18
  countryCode: string;
19
- }): Promise<react_jsx_runtime8.JSX.Element>;
19
+ }): Promise<react_jsx_runtime12.JSX.Element>;
20
20
  //#endregion
21
21
  export { PaginatedProducts as default };
22
22
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/templates/paginated-products/index.tsx"],"sourcesContent":[],"mappings":";;;;iBAmB8B,iBAAA;;;;;;;;WAQnB;;EARmB,YAAA,CAAA,EAAA,MAAiB;EAC7C,UAAA,CAAA,EAAA,MAAA;EACA,WAAA,CAAA,EAAA,MAAA,EAAA;EACA,WAAA,EAAA,MAAA;CACA,CAAA,EAUD,OAVC,CAUD,kBAAA,CAAA,GAAA,CAAA,OAAA,CAVC"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/templates/paginated-products/index.tsx"],"sourcesContent":[],"mappings":";;;;iBAmB8B,iBAAA;;;;;;;;WAQnB;;EARmB,YAAA,CAAA,EAAA,MAAiB;EAC7C,UAAA,CAAA,EAAA,MAAA;EACA,WAAA,CAAA,EAAA,MAAA,EAAA;EACA,WAAA,EAAA,MAAA;CACA,CAAA,EAUD,OAVC,CAUD,mBAAA,CAAA,GAAA,CAAA,OAAA,CAVC"}
@@ -1,6 +1,6 @@
1
1
  import { ProductActionsProduct } from "../../types/index.js";
2
2
  import { Region } from "@gfed-medusa/sf-lib-common/types/graphql";
3
- import * as react_jsx_runtime3 from "react/jsx-runtime";
3
+ import * as react_jsx_runtime13 from "react/jsx-runtime";
4
4
 
5
5
  //#region src/templates/product-actions-wrapper/index.d.ts
6
6
  /**
@@ -12,7 +12,7 @@ declare function ProductActionsWrapper({
12
12
  }: {
13
13
  product: ProductActionsProduct;
14
14
  region: Region;
15
- }): Promise<react_jsx_runtime3.JSX.Element>;
15
+ }): Promise<react_jsx_runtime13.JSX.Element>;
16
16
  //#endregion
17
17
  export { ProductActionsWrapper as default };
18
18
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/templates/product-actions-wrapper/index.tsx"],"sourcesContent":[],"mappings":";;;;;;;;AAa8B,iBAAA,qBAAA,CAAqB;EAAA,OAAA;EAAA;CAAA,EAAA;EACjD,OAAA,EAGS,qBAHT;EACA,MAAA,EAGQ,MAHR;CAES,CAAA,EAEV,OAFU,CAEV,kBAAA,CAAA,GAAA,CAAA,OAAA,CAFU"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/templates/product-actions-wrapper/index.tsx"],"sourcesContent":[],"mappings":";;;;;;;;AAa8B,iBAAA,qBAAA,CAAqB;EAAA,OAAA;EAAA;CAAA,EAAA;EACjD,OAAA,EAGS,qBAHT;EACA,MAAA,EAGQ,MAHR;CAES,CAAA,EAEV,OAFU,CAEV,mBAAA,CAAA,GAAA,CAAA,OAAA,CAFU"}
@@ -1,5 +1,5 @@
1
1
  import { Product } from "../../types/graphql.js";
2
- import * as react_jsx_runtime10 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime14 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/templates/product-info/index.d.ts
5
5
  type ProductInfoProps = {
@@ -7,7 +7,7 @@ type ProductInfoProps = {
7
7
  };
8
8
  declare const ProductInfo: ({
9
9
  product
10
- }: ProductInfoProps) => react_jsx_runtime10.JSX.Element;
10
+ }: ProductInfoProps) => react_jsx_runtime14.JSX.Element;
11
11
  //#endregion
12
12
  export { ProductInfo as default };
13
13
  //# sourceMappingURL=index.d.ts.map