@gfed-medusa/sf-lib-common 3.9.0 → 3.11.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 (69) hide show
  1. package/dist/components/breadcrumbs/index.d.ts +2 -2
  2. package/dist/components/cart-mismatch-banner/index.d.ts +2 -2
  3. package/dist/components/delete-button/index.d.ts +2 -2
  4. package/dist/components/delete-button/index.d.ts.map +1 -1
  5. package/dist/components/error-message/index.d.ts +2 -2
  6. package/dist/components/error-message/index.d.ts.map +1 -1
  7. package/dist/components/free-shipping-price-nudge/index.d.ts +2 -2
  8. package/dist/components/interactive-link/index.d.ts +2 -2
  9. package/dist/components/interactive-link/index.d.ts.map +1 -1
  10. package/dist/components/line-item-options/index.d.ts +2 -2
  11. package/dist/components/line-item-options/index.d.ts.map +1 -1
  12. package/dist/components/line-item-price/index.d.ts +2 -2
  13. package/dist/components/localized-client-link/index.d.ts +2 -2
  14. package/dist/components/localized-client-link/index.d.ts.map +1 -1
  15. package/dist/components/modal/index.d.ts +2 -2
  16. package/dist/components/modal/index.d.ts.map +1 -1
  17. package/dist/components/personalized-content/components/featured-category-rail.d.ts +2 -2
  18. package/dist/components/personalized-content/components/featured-category-rail.d.ts.map +1 -1
  19. package/dist/components/personalized-content/components/hero-banner.d.ts +2 -2
  20. package/dist/components/preview-price/index.d.ts +2 -2
  21. package/dist/components/product-card/index.d.ts +2 -2
  22. package/dist/components/product-card/index.d.ts.map +1 -1
  23. package/dist/components/product-preview/index.d.ts +2 -2
  24. package/dist/components/product-preview/index.d.ts.map +1 -1
  25. package/dist/components/submit-button/index.d.ts +2 -2
  26. package/dist/components/submit-button/index.d.ts.map +1 -1
  27. package/dist/lib/context/apollo-context.d.ts +2 -2
  28. package/dist/lib/context/modal-context.d.ts +2 -2
  29. package/dist/lib/data/context.d.ts +2 -2
  30. package/dist/lib/data/personalization.d.ts +3 -4
  31. package/dist/lib/data/personalization.d.ts.map +1 -1
  32. package/dist/lib/data/personalization.js +5 -9
  33. package/dist/lib/data/personalization.js.map +1 -1
  34. package/dist/lib/gql/fragments/cart.d.ts +9 -9
  35. package/dist/lib/gql/fragments/cart.d.ts.map +1 -1
  36. package/dist/lib/gql/fragments/customer.d.ts +3 -3
  37. package/dist/lib/gql/fragments/product.d.ts +8 -8
  38. package/dist/lib/gql/mutations/cart.d.ts +6 -6
  39. package/dist/lib/gql/mutations/cart.d.ts.map +1 -1
  40. package/dist/lib/gql/queries/cart.d.ts +2 -2
  41. package/dist/lib/gql/queries/collections.d.ts +3 -3
  42. package/dist/lib/gql/queries/customer.d.ts +2 -2
  43. package/dist/lib/gql/queries/footer.d.ts +3 -3
  44. package/dist/lib/gql/queries/order.d.ts +4 -4
  45. package/dist/lib/gql/queries/product-personalization.d.ts +2 -2
  46. package/dist/lib/gql/queries/product.d.ts +2 -2
  47. package/dist/lib/gql/queries/shipping.d.ts +3 -3
  48. package/dist/lib/gql/queries/shipping.d.ts.map +1 -1
  49. package/dist/lib/hooks/use-apollo.d.ts +2 -2
  50. package/dist/lib/hooks/use-apollo.d.ts.map +1 -1
  51. package/dist/lib/personalization/client-signal.d.ts +2 -10
  52. package/dist/lib/personalization/client-signal.d.ts.map +1 -1
  53. package/dist/lib/personalization/client-signal.js +3 -50
  54. package/dist/lib/personalization/client-signal.js.map +1 -1
  55. package/dist/lib/personalization/device-id.d.ts.map +1 -1
  56. package/dist/lib/personalization/device-id.js +1 -13
  57. package/dist/lib/personalization/device-id.js.map +1 -1
  58. package/dist/lib/personalization/personalization-gql.d.ts +4 -4
  59. package/dist/lib/personalization/personalization-gql.js +2 -2
  60. package/dist/lib/personalization/personalization-gql.js.map +1 -1
  61. package/dist/types/graphql.d.ts +46 -62
  62. package/dist/types/graphql.d.ts.map +1 -1
  63. package/dist/types/graphql.js +38 -351
  64. package/dist/types/graphql.js.map +1 -1
  65. package/package.json +1 -1
  66. package/dist/components/device-id-setter/index.d.ts +0 -5
  67. package/dist/components/device-id-setter/index.d.ts.map +0 -1
  68. package/dist/components/device-id-setter/index.js +0 -16
  69. package/dist/components/device-id-setter/index.js.map +0 -1
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime0 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime6 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/components/breadcrumbs/index.d.ts
4
4
  declare const SEPARATOR_ICONS: Record<string, React.ComponentType<{
@@ -14,7 +14,7 @@ declare function Breadcrumbs({
14
14
  iconClassName,
15
15
  iconSize,
16
16
  separatorIcon
17
- }: BreadcrumbsProps): react_jsx_runtime0.JSX.Element;
17
+ }: BreadcrumbsProps): react_jsx_runtime6.JSX.Element;
18
18
  //#endregion
19
19
  export { Breadcrumbs };
20
20
  //# sourceMappingURL=index.d.ts.map
@@ -1,11 +1,11 @@
1
1
  import { Cart, Customer } from "../../types/graphql.js";
2
- import * as react_jsx_runtime0 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime7 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/components/cart-mismatch-banner/index.d.ts
5
5
  declare function CartMismatchBanner(props: {
6
6
  customer: Customer;
7
7
  cart: Cart;
8
- }): react_jsx_runtime0.JSX.Element | undefined;
8
+ }): react_jsx_runtime7.JSX.Element | undefined;
9
9
  //#endregion
10
10
  export { CartMismatchBanner };
11
11
  //# sourceMappingURL=index.d.ts.map
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime11 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime8 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/components/delete-button/index.d.ts
4
4
  declare const DeleteButton: ({
@@ -9,7 +9,7 @@ declare const DeleteButton: ({
9
9
  id: string;
10
10
  children?: React.ReactNode;
11
11
  className?: string;
12
- }) => react_jsx_runtime11.JSX.Element;
12
+ }) => react_jsx_runtime8.JSX.Element;
13
13
  //#endregion
14
14
  export { DeleteButton };
15
15
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/components/delete-button/index.tsx"],"sourcesContent":[],"mappings":";;;cASM;;;;;;aAMO,KAAA,CAAM;EANb,SAAA,CAAA,EAAA,MAuCL;CAvCqB,EAAA,GAQrB,mBAAA,CAAA,GAAA,CAAA,OARqB"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/components/delete-button/index.tsx"],"sourcesContent":[],"mappings":";;;cASM;;;;;;aAMO,KAAA,CAAM;EANb,SAAA,CAAA,EAAA,MAuCL;CAvCqB,EAAA,GAQrB,kBAAA,CAAA,GAAA,CAAA,OARqB"}
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime16 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime9 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/components/error-message/index.d.ts
4
4
  declare const ErrorMessage: ({
@@ -7,7 +7,7 @@ declare const ErrorMessage: ({
7
7
  }: {
8
8
  error?: string | null;
9
9
  "data-testid"?: string;
10
- }) => react_jsx_runtime16.JSX.Element | null;
10
+ }) => react_jsx_runtime9.JSX.Element | null;
11
11
  //#endregion
12
12
  export { ErrorMessage };
13
13
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/components/error-message/index.tsx"],"sourcesContent":[],"mappings":";;;cAAM;;iBAAgB;AAMrB;;;AAAA,CAAA,EAAA,GAAA,mBAAA,CAAA,GAAA,CAAA,OAAA,GAaA,IAAA"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/components/error-message/index.tsx"],"sourcesContent":[],"mappings":";;;cAAM;;iBAAgB;AAMrB;;;AAAA,CAAA,EAAA,GAAA,kBAAA,CAAA,GAAA,CAAA,OAAA,GAaA,IAAA"}
@@ -1,5 +1,5 @@
1
1
  import { Cart, ShippingOption } from "../../types/graphql.js";
2
- import * as react_jsx_runtime2 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime5 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/components/free-shipping-price-nudge/index.d.ts
5
5
  declare function ShippingPriceNudge({
@@ -10,7 +10,7 @@ declare function ShippingPriceNudge({
10
10
  variant?: 'popup' | 'inline';
11
11
  cart: Cart;
12
12
  shippingOptions: ShippingOption[];
13
- }): react_jsx_runtime2.JSX.Element | undefined;
13
+ }): react_jsx_runtime5.JSX.Element | undefined;
14
14
  //#endregion
15
15
  export { ShippingPriceNudge };
16
16
  //# sourceMappingURL=index.d.ts.map
@@ -1,5 +1,5 @@
1
1
  import { LocalizedClientLink } from "../localized-client-link/index.js";
2
- import * as react_jsx_runtime3 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime11 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/components/interactive-link/index.d.ts
5
5
  type InteractiveLinkProps = React.ComponentPropsWithoutRef<typeof LocalizedClientLink> & {
@@ -14,7 +14,7 @@ declare const InteractiveLink: ({
14
14
  textClassName,
15
15
  iconClassName,
16
16
  ...props
17
- }: InteractiveLinkProps) => react_jsx_runtime3.JSX.Element;
17
+ }: InteractiveLinkProps) => react_jsx_runtime11.JSX.Element;
18
18
  //#endregion
19
19
  export { InteractiveLink };
20
20
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/components/interactive-link/index.tsx"],"sourcesContent":[],"mappings":";;;;KAKK,oBAAA,GAAuB,KAAA,CAAM,gCACzB;;;AAHsD,CAAA;AAEL,cAOpD,eA0BL,EAAA,CAAA;EAAA,IAAA;EAAA,QAAA;EAAA,OAAA;EAAA,SAAA;EAAA,aAAA;EAAA,aAAA;EAAA,GAAA;AAAA,CAAA,EAlBE,oBAkBF,EAAA,GAlBsB,kBAAA,CAAA,GAAA,CAAA,OAkBtB"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/components/interactive-link/index.tsx"],"sourcesContent":[],"mappings":";;;;KAKK,oBAAA,GAAuB,KAAA,CAAM,gCACzB;;;AAHsD,CAAA;AAEL,cAOpD,eA0BL,EAAA,CAAA;EAAA,IAAA;EAAA,QAAA;EAAA,OAAA;EAAA,SAAA;EAAA,aAAA;EAAA,aAAA;EAAA,GAAA;AAAA,CAAA,EAlBE,oBAkBF,EAAA,GAlBsB,mBAAA,CAAA,GAAA,CAAA,OAkBtB"}
@@ -1,5 +1,5 @@
1
1
  import { Maybe, ProductVariant } from "../../types/graphql.js";
2
- import * as react_jsx_runtime4 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime12 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/components/line-item-options/index.d.ts
5
5
  type LineItemOptionsProps = {
@@ -11,7 +11,7 @@ declare const LineItemOptions: ({
11
11
  variant,
12
12
  "data-testid": dataTestid,
13
13
  "data-value": dataValue
14
- }: LineItemOptionsProps) => react_jsx_runtime4.JSX.Element;
14
+ }: LineItemOptionsProps) => react_jsx_runtime12.JSX.Element;
15
15
  //#endregion
16
16
  export { LineItemOptions };
17
17
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/components/line-item-options/index.tsx"],"sourcesContent":[],"mappings":";;;;KAIK,oBAAA;YACO,MAAM;;EADb,YAAA,CAAA,EAGY,KAHZ,CAGkB,cAHE,CAAA;CACP;cAKZ,eALM,EAAA,CAAA;EAAA,OAAA;EAAA,aAAA,EAKa,UALb;EAAA,YAAA,EAKa;AALb,CAAA,EAST,oBATS,EAAA,GASW,kBAAA,CAAA,GAAA,CAAA,OATX"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/components/line-item-options/index.tsx"],"sourcesContent":[],"mappings":";;;;KAIK,oBAAA;YACO,MAAM;;EADb,YAAA,CAAA,EAGY,KAHZ,CAGkB,cAHE,CAAA;CACP;cAKZ,eALM,EAAA,CAAA;EAAA,OAAA;EAAA,aAAA,EAKa,UALb;EAAA,YAAA,EAKa;AALb,CAAA,EAST,oBATS,EAAA,GASW,mBAAA,CAAA,GAAA,CAAA,OATX"}
@@ -1,5 +1,5 @@
1
1
  import { LineItem } from "../../types/graphql.js";
2
- import * as react_jsx_runtime15 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime16 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/components/line-item-price/index.d.ts
5
5
  type LineItemPriceProps = {
@@ -11,7 +11,7 @@ declare const LineItemPrice: ({
11
11
  item,
12
12
  style,
13
13
  currencyCode
14
- }: LineItemPriceProps) => react_jsx_runtime15.JSX.Element;
14
+ }: LineItemPriceProps) => react_jsx_runtime16.JSX.Element;
15
15
  //#endregion
16
16
  export { LineItemPrice };
17
17
  //# sourceMappingURL=index.d.ts.map
@@ -1,5 +1,5 @@
1
1
  import { AnchorHTMLAttributes, DetailedHTMLProps } from "react";
2
- import * as react_jsx_runtime6 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime10 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/components/localized-client-link/index.d.ts
5
5
  type LocalizedClientLinkProps = DetailedHTMLProps<AnchorHTMLAttributes<HTMLAnchorElement>, HTMLAnchorElement> & {
@@ -10,7 +10,7 @@ declare const LocalizedClientLink: ({
10
10
  href,
11
11
  locale,
12
12
  ...props
13
- }: LocalizedClientLinkProps) => react_jsx_runtime6.JSX.Element;
13
+ }: LocalizedClientLinkProps) => react_jsx_runtime10.JSX.Element;
14
14
  //#endregion
15
15
  export { LocalizedClientLink };
16
16
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/components/localized-client-link/index.tsx"],"sourcesContent":[],"mappings":";;;;KAWK,wBAAA,GAA2B,kBAC9B,qBAAqB,oBACrB;;;AANa,cAWT,mBAPuB,EAAA,CAAA;EAAA,QAAA;EAAA,IAAA;EAAA,MAAA;EAAA,GAAA;AAAA,CAAA,EAY1B,wBAZ0B,EAAA,GAYF,kBAAA,CAAA,GAAA,CAAA,OAZE"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/components/localized-client-link/index.tsx"],"sourcesContent":[],"mappings":";;;;KAWK,wBAAA,GAA2B,kBAC9B,qBAAqB,oBACrB;;;AANa,cAWT,mBAPuB,EAAA,CAAA;EAAA,QAAA;EAAA,IAAA;EAAA,MAAA;EAAA,GAAA;AAAA,CAAA,EAY1B,wBAZ0B,EAAA,GAYF,mBAAA,CAAA,GAAA,CAAA,OAZE"}
@@ -1,5 +1,5 @@
1
1
  import React from "react";
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/modal/index.d.ts
5
5
  type ModalProps = {
@@ -20,7 +20,7 @@ declare const Modal: {
20
20
  children,
21
21
  "data-testid": dataTestId,
22
22
  "aria-label": ariaLabel
23
- }: ModalProps): react_jsx_runtime1.JSX.Element;
23
+ }: ModalProps): react_jsx_runtime15.JSX.Element;
24
24
  Title: React.FC<{
25
25
  children: React.ReactNode;
26
26
  }>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/components/modal/index.tsx"],"sourcesContent":[],"mappings":";;;;KAQK,UAAA;;;EAAA,IAAA,CAAA,EAAA,OAAU,GAAA,QAAA,GAKH,OAAM;EAKZ,MAAA,CAAA,EAmEL,OAAA;YAxEW,KAAA,CAAM;;;;cAKZ;;;;;;;;;KAQH,aAAU,kBAAA,CAAA,GAAA,CAAA;;IAAV,QAAA,EA6D+B,KAAA,CAAM,SA7DrC;EAAU,CAAA,CAAA;EA6DqB,WAAM,UAAA,CAAA;cAeA,KAAA,CAAM;EAAN,CAAA,CAAA;;IAQD,QAAA,EAAN,KAAA,CAAM,SAAA;;EAIJ,MAAM,UAAA,CAAA;cAAN,KAAA,CAAM"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/components/modal/index.tsx"],"sourcesContent":[],"mappings":";;;;KAQK,UAAA;;;EAAA,IAAA,CAAA,EAAA,OAAU,GAAA,QAAA,GAKH,OAAM;EAKZ,MAAA,CAAA,EAmEL,OAAA;YAxEW,KAAA,CAAM;;;;cAKZ;;;;;;;;;KAQH,aAAU,mBAAA,CAAA,GAAA,CAAA;;IAAV,QAAA,EA6D+B,KAAA,CAAM,SA7DrC;EAAU,CAAA,CAAA;EA6DqB,WAAM,UAAA,CAAA;cAeA,KAAA,CAAM;EAAN,CAAA,CAAA;;IAQD,QAAA,EAAN,KAAA,CAAM,SAAA;;EAIJ,MAAM,UAAA,CAAA;cAAN,KAAA,CAAM"}
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime9 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime13 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/components/personalized-content/components/featured-category-rail.d.ts
4
4
  interface ProductPreview {
@@ -16,7 +16,7 @@ declare function FeaturedCategoryRail({
16
16
  title,
17
17
  handle,
18
18
  products
19
- }: FeaturedCategoryRailProps): react_jsx_runtime9.JSX.Element | null;
19
+ }: FeaturedCategoryRailProps): react_jsx_runtime13.JSX.Element | null;
20
20
  //#endregion
21
21
  export { FeaturedCategoryRail };
22
22
  //# sourceMappingURL=featured-category-rail.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"featured-category-rail.d.ts","names":[],"sources":["../../../../src/components/personalized-content/components/featured-category-rail.tsx"],"sourcesContent":[],"mappings":";;;UAKU,cAAA;;;EAAA,MAAA,EAAA,MAAA;EAOA,SAAA,CAAA,EAAA,MAAA,GAAA,IAAA;AAMV;UANU,yBAAA,CAM6B;EAAO,KAAA,EAAA,MAAA;EAAQ,MAAA,EAAA,MAAA;EAAY,QAAA,EAHtD,cAGsD,EAAA;;AAAyB,iBAA3E,oBAAA,CAA2E;EAAA,KAAA;EAAA,MAAA;EAAA;AAAA,CAAA,EAAzB,yBAAyB,CAAA,EAAA,kBAAA,CAAA,GAAA,CAAA,OAAA,GAAA,IAAA"}
1
+ {"version":3,"file":"featured-category-rail.d.ts","names":[],"sources":["../../../../src/components/personalized-content/components/featured-category-rail.tsx"],"sourcesContent":[],"mappings":";;;UAKU,cAAA;;;EAAA,MAAA,EAAA,MAAA;EAOA,SAAA,CAAA,EAAA,MAAA,GAAA,IAAA;AAMV;UANU,yBAAA,CAM6B;EAAO,KAAA,EAAA,MAAA;EAAQ,MAAA,EAAA,MAAA;EAAY,QAAA,EAHtD,cAGsD,EAAA;;AAAyB,iBAA3E,oBAAA,CAA2E;EAAA,KAAA;EAAA,MAAA;EAAA;AAAA,CAAA,EAAzB,yBAAyB,CAAA,EAAA,mBAAA,CAAA,GAAA,CAAA,OAAA,GAAA,IAAA"}
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime10 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime14 from "react/jsx-runtime";
2
2
 
3
3
  //#region src/components/personalized-content/components/hero-banner.d.ts
4
4
  interface HeroBannerProps {
@@ -25,7 +25,7 @@ declare function HeroBanner({
25
25
  cta,
26
26
  badge,
27
27
  backgroundColor
28
- }: HeroBannerProps): react_jsx_runtime10.JSX.Element | null;
28
+ }: HeroBannerProps): react_jsx_runtime14.JSX.Element | null;
29
29
  //#endregion
30
30
  export { HeroBanner };
31
31
  //# sourceMappingURL=hero-banner.d.ts.map
@@ -1,12 +1,12 @@
1
1
  import { VariantPrice } from "../../types/prices.js";
2
- import * as react_jsx_runtime14 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime17 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/components/preview-price/index.d.ts
5
5
  declare function PreviewPrice({
6
6
  price
7
7
  }: {
8
8
  price: VariantPrice;
9
- }): react_jsx_runtime14.JSX.Element | null;
9
+ }): react_jsx_runtime17.JSX.Element | null;
10
10
  //#endregion
11
11
  export { PreviewPrice };
12
12
  //# sourceMappingURL=index.d.ts.map
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime17 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
2
2
  import { VariantProps } from "class-variance-authority";
3
3
  import * as class_variance_authority_types0 from "class-variance-authority/types";
4
4
 
@@ -59,7 +59,7 @@ declare function ProductCard({
59
59
  variant,
60
60
  size,
61
61
  className
62
- }: ProductCardProps): react_jsx_runtime17.JSX.Element;
62
+ }: ProductCardProps): react_jsx_runtime0.JSX.Element;
63
63
  //#endregion
64
64
  export { ProductCard };
65
65
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/components/product-card/index.tsx"],"sourcesContent":[],"mappings":";;;;;cAYM;;;IAoBL,+BAAA,CAAA;AA5BiE,UA8BxD,KAAA,CAtBJ;EAsBI,OAAA,EAAK,MAAA;EAKL,GAAA,CAAA,EAAA,MAAO;AAYH;UAZJ,OAAA,CAe6C;EAC5C,EAAA,EAAA,MAAA;EADwB,KAAA,EAAA;IAAY,GAAA,EAAA,MAAA;IAuC/B,GAAA,CAAA,EAAA,MAAW;EACzB,CAAA;EACA,QAAA,CAAA,EAAA;IACA,QAAA,EAAA,MAAA;IACA,MAAA,EAAA,MAAA;EACA,CAAA;EACA,KAAA,EAAA,MAAA;EACA,IAAA,CAAA,EAAA,MAAA;EACC,KAAA,EAlDM,KAkDN;;UA/CO,gBAAA,SAAyB,YA+ChB,CAAA,OA/CoC,mBA+CpC,CAAA,CAAA;WA9CR;;;;;;;;;;;;;;;;;;;;;;;;;iBAsCK,WAAA;;;;;;;;GAQb,mBAAgB,mBAAA,CAAA,GAAA,CAAA"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/components/product-card/index.tsx"],"sourcesContent":[],"mappings":";;;;;cAYM;;;IAoBL,+BAAA,CAAA;AA5BiE,UA8BxD,KAAA,CAtBJ;EAsBI,OAAA,EAAK,MAAA;EAKL,GAAA,CAAA,EAAA,MAAO;AAYH;UAZJ,OAAA,CAe6C;EAC5C,EAAA,EAAA,MAAA;EADwB,KAAA,EAAA;IAAY,GAAA,EAAA,MAAA;IAuC/B,GAAA,CAAA,EAAA,MAAW;EACzB,CAAA;EACA,QAAA,CAAA,EAAA;IACA,QAAA,EAAA,MAAA;IACA,MAAA,EAAA,MAAA;EACA,CAAA;EACA,KAAA,EAAA,MAAA;EACA,IAAA,CAAA,EAAA,MAAA;EACC,KAAA,EAlDM,KAkDN;;UA/CO,gBAAA,SAAyB,YA+ChB,CAAA,OA/CoC,mBA+CpC,CAAA,CAAA;WA9CR;;;;;;;;;;;;;;;;;;;;;;;;;iBAsCK,WAAA;;;;;;;;GAQb,mBAAgB,kBAAA,CAAA,GAAA,CAAA"}
@@ -1,5 +1,5 @@
1
1
  import { Product } from "../../types/graphql.js";
2
- import * as react_jsx_runtime12 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime0 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/components/product-preview/index.d.ts
5
5
  type ProductPreviewProduct = Pick<Product, 'id' | 'title' | 'handle' | 'thumbnail' | 'images' | 'variants'>;
@@ -12,7 +12,7 @@ declare function ProductPreview({
12
12
  product,
13
13
  isFeatured,
14
14
  imageFetchPriority
15
- }: ProductPreviewProps): react_jsx_runtime12.JSX.Element;
15
+ }: ProductPreviewProps): react_jsx_runtime0.JSX.Element;
16
16
  //#endregion
17
17
  export { ProductPreview, ProductPreviewProduct, ProductPreviewProps };
18
18
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/components/product-preview/index.tsx"],"sourcesContent":[],"mappings":";;;;KASY,qBAAA,GAAwB,KAClC;KAIU,mBAAA;WACD;EANC,UAAA,CAAA,EAAA,OAAA;EAKA,kBAAA,CAAA,EAAA,MAAmB,GAAA,MACpB,GAAA,KAAA;AAGT,CAAA;iBAEO,cAAA,CACP;EAAA,OAAA;EAAA,UAAA;EAAA;AAAA,CAAA,EAGC,mBAHD,CAAA,EAGoB,mBAAA,CAAA,GAAA,CAAA,OAHpB"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/components/product-preview/index.tsx"],"sourcesContent":[],"mappings":";;;;KASY,qBAAA,GAAwB,KAClC;KAIU,mBAAA;WACD;EANC,UAAA,CAAA,EAAA,OAAA;EAKA,kBAAA,CAAA,EAAA,MAAmB,GAAA,MACpB,GAAA,KAAA;AAGT,CAAA;iBAEO,cAAA,CACP;EAAA,OAAA;EAAA,UAAA;EAAA;AAAA,CAAA,EAGC,mBAHD,CAAA,EAGoB,kBAAA,CAAA,GAAA,CAAA,OAHpB"}
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import * as react_jsx_runtime13 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime1 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/components/submit-button/index.d.ts
5
5
  declare function SubmitButton({
@@ -14,7 +14,7 @@ declare function SubmitButton({
14
14
  className?: string;
15
15
  'data-testid'?: string;
16
16
  isLoading?: boolean;
17
- }): react_jsx_runtime13.JSX.Element;
17
+ }): react_jsx_runtime1.JSX.Element;
18
18
  //#endregion
19
19
  export { SubmitButton };
20
20
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/components/submit-button/index.tsx"],"sourcesContent":[],"mappings":";;;;iBAQS,YAAA;;;;iBAIQ;;;YAGL,KAAA,CAAM;;EAPT,SAAA,CAAA,EAAA,MAAY;EACnB,aAAA,CAAA,EAAA,MAAA;EACA,SAAA,CAAA,EAAA,OAAA;CACA,CAAA,EASD,mBAAA,CAAA,GAAA,CAAA,OATC"}
1
+ {"version":3,"file":"index.d.ts","names":[],"sources":["../../../src/components/submit-button/index.tsx"],"sourcesContent":[],"mappings":";;;;iBAQS,YAAA;;;;iBAIQ;;;YAGL,KAAA,CAAM;;EAPT,SAAA,CAAA,EAAA,MAAY;EACnB,aAAA,CAAA,EAAA,MAAA;EACA,SAAA,CAAA,EAAA,OAAA;CACA,CAAA,EASD,kBAAA,CAAA,GAAA,CAAA,OATC"}
@@ -1,10 +1,10 @@
1
1
  import { PropsWithChildren } from "react";
2
- import * as react_jsx_runtime5 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime3 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/lib/context/apollo-context.d.ts
5
5
  declare function ApolloClientProvider({
6
6
  children
7
- }: PropsWithChildren): react_jsx_runtime5.JSX.Element;
7
+ }: PropsWithChildren): react_jsx_runtime3.JSX.Element;
8
8
  //#endregion
9
9
  export { ApolloClientProvider };
10
10
  //# sourceMappingURL=apollo-context.d.ts.map
@@ -1,5 +1,5 @@
1
1
  import React from "react";
2
- import * as react_jsx_runtime7 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime2 from "react/jsx-runtime";
3
3
 
4
4
  //#region src/lib/context/modal-context.d.ts
5
5
  interface ModalContext {
@@ -13,7 +13,7 @@ interface ModalProviderProps {
13
13
  declare const ModalProvider: ({
14
14
  children,
15
15
  close
16
- }: ModalProviderProps) => react_jsx_runtime7.JSX.Element;
16
+ }: ModalProviderProps) => react_jsx_runtime2.JSX.Element;
17
17
  declare const useModal: () => ModalContext;
18
18
  //#endregion
19
19
  export { ModalProvider, useModal };
@@ -1,6 +1,6 @@
1
1
  import { useStorefrontActions } from "./client-actions.js";
2
2
  import { ReactNode } from "react";
3
- import * as react_jsx_runtime8 from "react/jsx-runtime";
3
+ import * as react_jsx_runtime4 from "react/jsx-runtime";
4
4
 
5
5
  //#region src/lib/data/context.d.ts
6
6
  interface StorefrontContext {
@@ -15,7 +15,7 @@ interface StorefrontProviderProps {
15
15
  declare const StorefrontProvider: ({
16
16
  children,
17
17
  value
18
- }: StorefrontProviderProps) => react_jsx_runtime8.JSX.Element;
18
+ }: StorefrontProviderProps) => react_jsx_runtime4.JSX.Element;
19
19
  declare const useStorefrontContext: () => StorefrontContext;
20
20
  //#endregion
21
21
  export { StorefrontContext, StorefrontProvider, useStorefrontActions, useStorefrontContext };
@@ -2,8 +2,8 @@ import { StorefrontContext } from "./context.js";
2
2
 
3
3
  //#region src/lib/data/personalization.d.ts
4
4
  declare function getDeviceIdFromCookieHeader(cookieHeader?: string): string;
5
- declare function sendSignal(type: string, ctx: StorefrontContext, payload?: Record<string, unknown>, url?: string, userId?: string): Promise<boolean>;
6
- declare function sendPageViewSignal(surface: string, ctx: StorefrontContext, payload?: Record<string, unknown>, userId?: string): Promise<boolean>;
5
+ declare function sendSignal(type: string, ctx: StorefrontContext, payload?: Record<string, unknown>, url?: string): Promise<boolean>;
6
+ declare function sendPageViewSignal(surface: string, ctx: StorefrontContext, payload?: Record<string, unknown>): Promise<boolean>;
7
7
  interface PersonalizedComponent {
8
8
  component: string;
9
9
  contentId: string | null;
@@ -29,10 +29,9 @@ declare function getPersonalization(surface: string, page: string, deviceId: str
29
29
  cartValue?: number;
30
30
  category?: string;
31
31
  searchQuery?: string;
32
- }, userId?: string): Promise<PersonalizationResult | null>;
32
+ }): Promise<PersonalizationResult | null>;
33
33
  interface ConversionInput {
34
34
  deviceId: string;
35
- userId?: string;
36
35
  checkoutSignalId?: string;
37
36
  orderId: string;
38
37
  amount: number;
@@ -1 +1 @@
1
- {"version":3,"file":"personalization.d.ts","names":[],"sources":["../../../src/lib/data/personalization.ts"],"sourcesContent":[],"mappings":";;;iBAWgB,2BAAA;iBAMM,UAAA,oBAEf,6BACK,yDAGT;AAZa,iBA0CA,kBAAA,CA1C2B,OAAA,EAAA,MAAA,EAAA,GAAA,EA4CpC,iBA5CoC,EAAA,OAAA,CAAA,EA6C/B,MA7C+B,CAAA,MAAA,EAAA,OAAA,CAAA,EAAA,MAAA,CAAA,EAAA,MAAA,CAAA,EA+CxC,OA/CwC,CAAA,OAAA,CAAA;AAMrB,UA6CL,qBAAA,CA7Ce;EAEzB,SAAA,EAAA,MAAA;EACK,SAAA,EAAA,MAAA,GAAA,IAAA;EAGT,cAAA,EA0Ce,MA1Cf,CAAA,MAAA,EAAA,OAAA,CAAA;EAAO,QAAA,EAAA,MAAA;EA8BM,SAAA,EAAA,MAAA;EAET,KAAA,EAAA,MAAA;;AAGJ,UAac,wBAAA,CAbd;EAAO,MAAA,EAAA,MAAA;EAIO,UAAA,EAAA,MAAA;EASA,OAAA,EAAA,MAAA,EAAA;EAOA,YAAA,EAAA,MAAA;AAwBjB;AAIO,UA5BU,qBAAA,CA4BV;EAQI,UAAA,EAnCG,qBAmCH,EAAA;EAAR,SAAA,EAlCU,wBAkCV;EAAO,QAAA,EAAA,MAAA;EA6BA,QAAA,EAAA,MAAA;AAUV;AACS,iBApDa,kBAAA,CAoDb,OAAA,EAAA,MAAA,EAAA,IAAA,EAAA,MAAA,EAAA,QAAA,EAAA,MAAA,EAAA,GAAA,EAhDF,iBAgDE,EAAA,QAAA,EAAA;EACF,SAAA,CAAA,EAAA,MAAA;EACJ,SAAA,CAAA,EAAA,MAAA;EAAO,QAAA,CAAA,EAAA,MAAA;;qBA1CP,QAAQ;UA6BD,eAAA;;;;;;;UAOA;;;;;;;;iBAGY,gBAAA,QACb,sBACF,oBACJ"}
1
+ {"version":3,"file":"personalization.d.ts","names":[],"sources":["../../../src/lib/data/personalization.ts"],"sourcesContent":[],"mappings":";;;iBAWgB,2BAAA;iBAMM,UAAA,oBAEf,6BACK,wCAET;AAXa,iBAuCA,kBAAA,CAvC2B,OAAA,EAAA,MAAA,EAAA,GAAA,EAyCpC,iBAzCoC,EAAA,OAAA,CAAA,EA0C/B,MA1C+B,CAAA,MAAA,EAAA,OAAA,CAAA,CAAA,EA2CxC,OA3CwC,CAAA,OAAA,CAAA;AAMrB,UAyCL,qBAAA,CAzCe;EAEzB,SAAA,EAAA,MAAA;EACK,SAAA,EAAA,MAAA,GAAA,IAAA;EAET,cAAA,EAuCe,MAvCf,CAAA,MAAA,EAAA,OAAA,CAAA;EAAO,QAAA,EAAA,MAAA;EA4BM,SAAA,EAAA,MAAA;EAET,KAAA,EAAA,MAAA;;AAEJ,UAac,wBAAA,CAbd;EAAO,MAAA,EAAA,MAAA;EAIO,UAAA,EAAA,MAAA;EASA,OAAA,EAAA,MAAA,EAAA;EAOA,YAAA,EAAA,MAAA;AAuBjB;AAIO,UA3BU,qBAAA,CA2BV;EAOI,UAAA,EAjCG,qBAiCH,EAAA;EAAR,SAAA,EAhCU,wBAgCV;EAAO,QAAA,EAAA,MAAA;EA0BA,QAAA,EAAA,MAAA;AASV;AACS,iBA/Ca,kBAAA,CA+Cb,OAAA,EAAA,MAAA,EAAA,IAAA,EAAA,MAAA,EAAA,QAAA,EAAA,MAAA,EAAA,GAAA,EA3CF,iBA2CE,EAAA,QAAA,EAAA;EACF,SAAA,CAAA,EAAA,MAAA;EACJ,SAAA,CAAA,EAAA,MAAA;EAAO,QAAA,CAAA,EAAA,MAAA;;IAtCP,QAAQ;UA0BD,eAAA;;;;;;UAMA;;;;;;;;iBAGY,gBAAA,QACb,sBACF,oBACJ"}
@@ -8,16 +8,14 @@ function getDeviceIdFromCookieHeader(cookieHeader) {
8
8
  const match = cookieHeader.match(/* @__PURE__ */ new RegExp(`${DEVICE_ID_COOKIE}=([^;]+)`));
9
9
  return match ? decodeURIComponent(match[1] ?? "") : "";
10
10
  }
11
- async function sendSignal(type, ctx, payload, url, userId) {
11
+ async function sendSignal(type, ctx, payload, url) {
12
12
  const deviceId = getDeviceIdFromCookieHeader(ctx.cookieHeader);
13
- if (!deviceId) return false;
14
13
  const apolloClient = createServerApolloClient(ctx.cookieHeader);
15
14
  try {
16
15
  await graphqlMutation({
17
16
  mutation: SEND_SIGNAL_MUTATION,
18
17
  variables: { input: {
19
18
  deviceId,
20
- ...userId ? { userId } : {},
21
19
  type,
22
20
  payload: payload ?? {},
23
21
  url: url ?? "",
@@ -30,14 +28,13 @@ async function sendSignal(type, ctx, payload, url, userId) {
30
28
  return false;
31
29
  }
32
30
  }
33
- function sendPageViewSignal(surface, ctx, payload, userId) {
31
+ function sendPageViewSignal(surface, ctx, payload) {
34
32
  return sendSignal("PAGE_VIEW", ctx, {
35
33
  ...payload,
36
34
  surface
37
- }, void 0, userId);
35
+ });
38
36
  }
39
- async function getPersonalization(surface, page, deviceId, ctx, context, userId) {
40
- if (!deviceId) return null;
37
+ async function getPersonalization(surface, page, deviceId, ctx, context) {
41
38
  const apolloClient = createServerApolloClient(ctx.cookieHeader);
42
39
  try {
43
40
  return (await graphqlFetch({
@@ -48,8 +45,7 @@ async function getPersonalization(surface, page, deviceId, ctx, context, userId)
48
45
  page,
49
46
  ...context
50
47
  },
51
- deviceId,
52
- ...userId ? { userId } : {}
48
+ deviceId
53
49
  }
54
50
  }, apolloClient))?.personalize ?? null;
55
51
  } catch (error) {
@@ -1 +1 @@
1
- {"version":3,"file":"personalization.js","names":[],"sources":["../../../src/lib/data/personalization.ts"],"sourcesContent":["import { createServerApolloClient, graphqlFetch, graphqlMutation } from '@/lib/gql/apollo-client';\n\nimport {\n PERSONALIZE_QUERY,\n SEND_SIGNAL_MUTATION,\n SUBMIT_CONVERSION_MUTATION,\n} from '@/lib/personalization/personalization-gql';\nimport type { StorefrontContext } from './context';\n\nconst DEVICE_ID_COOKIE = '_jg_device_id';\n\nexport function getDeviceIdFromCookieHeader(cookieHeader?: string): string {\n if (!cookieHeader) return '';\n const match = cookieHeader.match(new RegExp(`${DEVICE_ID_COOKIE}=([^;]+)`));\n return match ? decodeURIComponent(match[1] ?? '') : '';\n}\n\nexport async function sendSignal(\n type: string,\n ctx: StorefrontContext,\n payload?: Record<string, unknown>,\n url?: string,\n userId?: string\n): Promise<boolean> {\n const deviceId = getDeviceIdFromCookieHeader(ctx.cookieHeader);\n if (!deviceId) return false;\n\n const apolloClient = createServerApolloClient(ctx.cookieHeader);\n\n try {\n await graphqlMutation<Record<string, unknown>, { input: Record<string, unknown> }>(\n {\n mutation: SEND_SIGNAL_MUTATION,\n variables: {\n input: {\n deviceId,\n ...(userId ? { userId } : {}),\n type,\n payload: payload ?? {},\n url: url ?? '',\n timestamp: Date.now(),\n },\n },\n },\n apolloClient\n );\n return true;\n } catch (error) {\n console.warn('[sendSignal] Failed to send signal:', type, error);\n return false;\n }\n}\n\nexport function sendPageViewSignal(\n surface: string,\n ctx: StorefrontContext,\n payload?: Record<string, unknown>,\n userId?: string\n): Promise<boolean> {\n return sendSignal('PAGE_VIEW', ctx, { ...payload, surface }, undefined, userId);\n}\n\nexport interface PersonalizedComponent {\n component: string;\n contentId: string | null;\n propsOverrides: Record<string, unknown>;\n priority: number;\n reasoning: string;\n score: number;\n}\n\nexport interface PersonalizationReasoning {\n intent: string;\n confidence: number;\n factors: string[];\n modelVersion: string;\n}\n\nexport interface PersonalizationResult {\n components: PersonalizedComponent[];\n reasoning: PersonalizationReasoning;\n cacheKey: string;\n servedAt: string;\n}\n\ntype PersonalizeQueryResult = {\n personalize: PersonalizationResult;\n};\n\ntype PersonalizeQueryVariables = {\n input: {\n surface: string;\n page: string;\n productId?: string;\n cartValue?: number;\n category?: string;\n searchQuery?: string;\n };\n deviceId: string;\n userId?: string;\n};\n\nexport async function getPersonalization(\n surface: string,\n page: string,\n deviceId: string,\n ctx: StorefrontContext,\n context?: {\n productId?: string;\n cartValue?: number;\n category?: string;\n searchQuery?: string;\n },\n userId?: string\n): Promise<PersonalizationResult | null> {\n if (!deviceId) return null;\n\n const apolloClient = createServerApolloClient(ctx.cookieHeader);\n\n try {\n const data = await graphqlFetch<PersonalizeQueryResult, PersonalizeQueryVariables>(\n {\n query: PERSONALIZE_QUERY,\n variables: {\n input: {\n surface,\n page,\n ...context,\n },\n deviceId,\n ...(userId ? { userId } : {}),\n },\n },\n apolloClient\n );\n\n return data?.personalize ?? null;\n } catch (error) {\n console.error('[getPersonalization]', error);\n return null;\n }\n}\n\ninterface ConversionInput {\n deviceId: string;\n userId?: string;\n checkoutSignalId?: string;\n orderId: string;\n amount: number;\n currency: string;\n items?: Array<{ productId: string; variantId?: string; quantity: number; price: number; category?: string }>;\n}\n\nexport async function submitConversion(\n input: ConversionInput,\n ctx: StorefrontContext\n): Promise<boolean> {\n if (!input.deviceId) return false;\n\n const apolloClient = createServerApolloClient(ctx.cookieHeader);\n\n try {\n await graphqlMutation<Record<string, boolean>, { input: ConversionInput }>(\n {\n mutation: SUBMIT_CONVERSION_MUTATION,\n variables: { input },\n },\n apolloClient\n );\n return true;\n } catch (error) {\n console.error('[submitConversion] Failed:', error);\n return false;\n }\n}\n"],"mappings":";;;;AASA,MAAM,mBAAmB;AAEzB,SAAgB,4BAA4B,cAA+B;AACzE,KAAI,CAAC,aAAc,QAAO;CAC1B,MAAM,QAAQ,aAAa,sBAAM,IAAI,OAAO,GAAG,iBAAiB,UAAU,CAAC;AAC3E,QAAO,QAAQ,mBAAmB,MAAM,MAAM,GAAG,GAAG;;AAGtD,eAAsB,WACpB,MACA,KACA,SACA,KACA,QACkB;CAClB,MAAM,WAAW,4BAA4B,IAAI,aAAa;AAC9D,KAAI,CAAC,SAAU,QAAO;CAEtB,MAAM,eAAe,yBAAyB,IAAI,aAAa;AAE/D,KAAI;AACF,QAAM,gBACJ;GACE,UAAU;GACV,WAAW,EACT,OAAO;IACL;IACA,GAAI,SAAS,EAAE,QAAQ,GAAG,EAAE;IAC5B;IACA,SAAS,WAAW,EAAE;IACtB,KAAK,OAAO;IACZ,WAAW,KAAK,KAAK;IACtB,EACF;GACF,EACD,aACD;AACD,SAAO;UACA,OAAO;AACd,UAAQ,KAAK,uCAAuC,MAAM,MAAM;AAChE,SAAO;;;AAIX,SAAgB,mBACd,SACA,KACA,SACA,QACkB;AAClB,QAAO,WAAW,aAAa,KAAK;EAAE,GAAG;EAAS;EAAS,EAAE,QAAW,OAAO;;AA2CjF,eAAsB,mBACpB,SACA,MACA,UACA,KACA,SAMA,QACuC;AACvC,KAAI,CAAC,SAAU,QAAO;CAEtB,MAAM,eAAe,yBAAyB,IAAI,aAAa;AAE/D,KAAI;AAiBF,UAhBa,MAAM,aACjB;GACE,OAAO;GACP,WAAW;IACT,OAAO;KACL;KACA;KACA,GAAG;KACJ;IACD;IACA,GAAI,SAAS,EAAE,QAAQ,GAAG,EAAE;IAC7B;GACF,EACD,aACD,GAEY,eAAe;UACrB,OAAO;AACd,UAAQ,MAAM,wBAAwB,MAAM;AAC5C,SAAO;;;AAcX,eAAsB,iBACpB,OACA,KACkB;AAClB,KAAI,CAAC,MAAM,SAAU,QAAO;CAE5B,MAAM,eAAe,yBAAyB,IAAI,aAAa;AAE/D,KAAI;AACF,QAAM,gBACJ;GACE,UAAU;GACV,WAAW,EAAE,OAAO;GACrB,EACD,aACD;AACD,SAAO;UACA,OAAO;AACd,UAAQ,MAAM,8BAA8B,MAAM;AAClD,SAAO"}
1
+ {"version":3,"file":"personalization.js","names":[],"sources":["../../../src/lib/data/personalization.ts"],"sourcesContent":["import { createServerApolloClient, graphqlFetch, graphqlMutation } from '@/lib/gql/apollo-client';\n\nimport {\n PERSONALIZE_QUERY,\n SEND_SIGNAL_MUTATION,\n SUBMIT_CONVERSION_MUTATION,\n} from '@/lib/personalization/personalization-gql';\nimport type { StorefrontContext } from './context';\n\nconst DEVICE_ID_COOKIE = '_jg_device_id';\n\nexport function getDeviceIdFromCookieHeader(cookieHeader?: string): string {\n if (!cookieHeader) return '';\n const match = cookieHeader.match(new RegExp(`${DEVICE_ID_COOKIE}=([^;]+)`));\n return match ? decodeURIComponent(match[1] ?? '') : '';\n}\n\nexport async function sendSignal(\n type: string,\n ctx: StorefrontContext,\n payload?: Record<string, unknown>,\n url?: string,\n): Promise<boolean> {\n const deviceId = getDeviceIdFromCookieHeader(ctx.cookieHeader);\n\n const apolloClient = createServerApolloClient(ctx.cookieHeader);\n\n try {\n await graphqlMutation<Record<string, unknown>, { input: Record<string, unknown> }>(\n {\n mutation: SEND_SIGNAL_MUTATION,\n variables: {\n input: {\n deviceId,\n type,\n payload: payload ?? {},\n url: url ?? '',\n timestamp: Date.now(),\n },\n },\n },\n apolloClient\n );\n return true;\n } catch (error) {\n console.warn('[sendSignal] Failed to send signal:', type, error);\n return false;\n }\n}\n\nexport function sendPageViewSignal(\n surface: string,\n ctx: StorefrontContext,\n payload?: Record<string, unknown>,\n): Promise<boolean> {\n return sendSignal('PAGE_VIEW', ctx, { ...payload, surface });\n}\n\nexport interface PersonalizedComponent {\n component: string;\n contentId: string | null;\n propsOverrides: Record<string, unknown>;\n priority: number;\n reasoning: string;\n score: number;\n}\n\nexport interface PersonalizationReasoning {\n intent: string;\n confidence: number;\n factors: string[];\n modelVersion: string;\n}\n\nexport interface PersonalizationResult {\n components: PersonalizedComponent[];\n reasoning: PersonalizationReasoning;\n cacheKey: string;\n servedAt: string;\n}\n\ntype PersonalizeQueryResult = {\n personalize: PersonalizationResult;\n};\n\ntype PersonalizeQueryVariables = {\n input: {\n surface: string;\n page: string;\n productId?: string;\n cartValue?: number;\n category?: string;\n searchQuery?: string;\n };\n deviceId: string;\n};\n\nexport async function getPersonalization(\n surface: string,\n page: string,\n deviceId: string,\n ctx: StorefrontContext,\n context?: {\n productId?: string;\n cartValue?: number;\n category?: string;\n searchQuery?: string;\n },\n): Promise<PersonalizationResult | null> {\n const apolloClient = createServerApolloClient(ctx.cookieHeader);\n\n try {\n const data = await graphqlFetch<PersonalizeQueryResult, PersonalizeQueryVariables>(\n {\n query: PERSONALIZE_QUERY,\n variables: {\n input: {\n surface,\n page,\n ...context,\n },\n deviceId,\n },\n },\n apolloClient\n );\n\n return data?.personalize ?? null;\n } catch (error) {\n console.error('[getPersonalization]', error);\n return null;\n }\n}\n\ninterface ConversionInput {\n deviceId: string;\n checkoutSignalId?: string;\n orderId: string;\n amount: number;\n currency: string;\n items?: Array<{ productId: string; variantId?: string; quantity: number; price: number; category?: string }>;\n}\n\nexport async function submitConversion(\n input: ConversionInput,\n ctx: StorefrontContext\n): Promise<boolean> {\n if (!input.deviceId) return false;\n\n const apolloClient = createServerApolloClient(ctx.cookieHeader);\n\n try {\n await graphqlMutation<Record<string, boolean>, { input: ConversionInput }>(\n {\n mutation: SUBMIT_CONVERSION_MUTATION,\n variables: { input },\n },\n apolloClient\n );\n return true;\n } catch (error) {\n console.error('[submitConversion] Failed:', error);\n return false;\n }\n}\n"],"mappings":";;;;AASA,MAAM,mBAAmB;AAEzB,SAAgB,4BAA4B,cAA+B;AACzE,KAAI,CAAC,aAAc,QAAO;CAC1B,MAAM,QAAQ,aAAa,sBAAM,IAAI,OAAO,GAAG,iBAAiB,UAAU,CAAC;AAC3E,QAAO,QAAQ,mBAAmB,MAAM,MAAM,GAAG,GAAG;;AAGtD,eAAsB,WACpB,MACA,KACA,SACA,KACkB;CAClB,MAAM,WAAW,4BAA4B,IAAI,aAAa;CAE9D,MAAM,eAAe,yBAAyB,IAAI,aAAa;AAE/D,KAAI;AACF,QAAM,gBACJ;GACE,UAAU;GACV,WAAW,EACT,OAAO;IACL;IACA;IACA,SAAS,WAAW,EAAE;IACtB,KAAK,OAAO;IACZ,WAAW,KAAK,KAAK;IACtB,EACF;GACF,EACD,aACD;AACD,SAAO;UACA,OAAO;AACd,UAAQ,KAAK,uCAAuC,MAAM,MAAM;AAChE,SAAO;;;AAIX,SAAgB,mBACd,SACA,KACA,SACkB;AAClB,QAAO,WAAW,aAAa,KAAK;EAAE,GAAG;EAAS;EAAS,CAAC;;AA0C9D,eAAsB,mBACpB,SACA,MACA,UACA,KACA,SAMuC;CACvC,MAAM,eAAe,yBAAyB,IAAI,aAAa;AAE/D,KAAI;AAgBF,UAfa,MAAM,aACjB;GACE,OAAO;GACP,WAAW;IACT,OAAO;KACL;KACA;KACA,GAAG;KACJ;IACD;IACD;GACF,EACD,aACD,GAEY,eAAe;UACrB,OAAO;AACd,UAAQ,MAAM,wBAAwB,MAAM;AAC5C,SAAO;;;AAaX,eAAsB,iBACpB,OACA,KACkB;AAClB,KAAI,CAAC,MAAM,SAAU,QAAO;CAE5B,MAAM,eAAe,yBAAyB,IAAI,aAAa;AAE/D,KAAI;AACF,QAAM,gBACJ;GACE,UAAU;GACV,WAAW,EAAE,OAAO;GACrB,EACD,aACD;AACD,SAAO;UACA,OAAO;AACd,UAAQ,MAAM,8BAA8B,MAAM;AAClD,SAAO"}
@@ -1,14 +1,14 @@
1
- import * as _apollo_client10 from "@apollo/client";
1
+ import * as _apollo_client0 from "@apollo/client";
2
2
 
3
3
  //#region src/lib/gql/fragments/cart.d.ts
4
- declare const LINE_ITEM_FRAGMENT: _apollo_client10.DocumentNode;
5
- declare const COUNTRY_FRAGMENT: _apollo_client10.DocumentNode;
6
- declare const REGION_FRAGMENT: _apollo_client10.DocumentNode;
7
- declare const SHIPPING_METHODS_FRAGMENT: _apollo_client10.DocumentNode;
8
- declare const PAYMENT_COLLECTION_FRAGMENT: _apollo_client10.DocumentNode;
9
- declare const ADDRESS_FRAGMENT: _apollo_client10.DocumentNode;
10
- declare const PROMOTION_FRAGMENT: _apollo_client10.DocumentNode;
11
- declare const CART_FRAGMENT: _apollo_client10.DocumentNode;
4
+ declare const LINE_ITEM_FRAGMENT: _apollo_client0.DocumentNode;
5
+ declare const COUNTRY_FRAGMENT: _apollo_client0.DocumentNode;
6
+ declare const REGION_FRAGMENT: _apollo_client0.DocumentNode;
7
+ declare const SHIPPING_METHODS_FRAGMENT: _apollo_client0.DocumentNode;
8
+ declare const PAYMENT_COLLECTION_FRAGMENT: _apollo_client0.DocumentNode;
9
+ declare const ADDRESS_FRAGMENT: _apollo_client0.DocumentNode;
10
+ declare const PROMOTION_FRAGMENT: _apollo_client0.DocumentNode;
11
+ declare const CART_FRAGMENT: _apollo_client0.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,gBAAA,CAjB8B;cAmBlB,kBAOZ,gBAAA,CAP4B;cAShB,iBAWZ,gBAAA,CAX2B;AA5Bf,cAyCA,yBAxBZ,EAkCA,gBAAA,CAVqC,YAxBrC;AAEY,cAkCA,2BA3BZ,EA6CA,gBAAA,CAlBuC,YA3BvC;AAEY,cA6CA,gBAlCZ,EA4CA,gBAAA,CAV4B,YAlC5B;AAEY,cA4CA,kBAlCZ,EA4CA,gBAAA,CAV8B,YAlC9B;AAEY,cA4CA,aA1BZ,EAqEA,gBAAA,CA3CyB,YA5Cc"}
1
+ {"version":3,"file":"cart.d.ts","names":[],"sources":["../../../../src/lib/gql/fragments/cart.ts"],"sourcesContent":[],"mappings":";;;cAIa,oBAiBZ,eAAA,CAjB8B;cAmBlB,kBAOZ,eAAA,CAP4B;cAShB,iBAWZ,eAAA,CAX2B;AA5Bf,cAyCA,yBAxBZ,EAkCA,eAAA,CAVqC,YAxBrC;AAEY,cAkCA,2BA3BZ,EA6CA,eAAA,CAlBuC,YA3BvC;AAEY,cA6CA,gBAlCZ,EA4CA,eAAA,CAV4B,YAlC5B;AAEY,cA4CA,kBAlCZ,EA4CA,eAAA,CAV8B,YAlC9B;AAEY,cA4CA,aA1BZ,EAqEA,eAAA,CA3CyB,YA5Cc"}
@@ -1,8 +1,8 @@
1
- import * as _apollo_client18 from "@apollo/client";
1
+ import * as _apollo_client11 from "@apollo/client";
2
2
 
3
3
  //#region src/lib/gql/fragments/customer.d.ts
4
- declare const CUSTOMER_ADDRESS_FRAGMENT: _apollo_client18.DocumentNode;
5
- declare const CUSTOMER_FRAGMENT: _apollo_client18.DocumentNode;
4
+ declare const CUSTOMER_ADDRESS_FRAGMENT: _apollo_client11.DocumentNode;
5
+ declare const CUSTOMER_FRAGMENT: _apollo_client11.DocumentNode;
6
6
  //#endregion
7
7
  export { CUSTOMER_ADDRESS_FRAGMENT, CUSTOMER_FRAGMENT };
8
8
  //# sourceMappingURL=customer.d.ts.map
@@ -1,13 +1,13 @@
1
- import * as _apollo_client20 from "@apollo/client";
1
+ import * as _apollo_client15 from "@apollo/client";
2
2
 
3
3
  //#region src/lib/gql/fragments/product.d.ts
4
- declare const PRICE_FRAGMENT: _apollo_client20.DocumentNode;
5
- declare const PRODUCT_VARIANT_FRAGMENT: _apollo_client20.DocumentNode;
6
- declare const PRODUCT_CATEGORY_FRAGMENT: _apollo_client20.DocumentNode;
7
- declare const PRODUCT_COLLECTION_FRAGMENT: _apollo_client20.DocumentNode;
8
- declare const PRODUCT_IMAGE_FRAGMENT: _apollo_client20.DocumentNode;
9
- declare const COLLECTION_PRODUCTS_FRAGMENT: _apollo_client20.DocumentNode;
10
- declare const COLLECTION_PRODUCTS_HOME_FRAGMENT: _apollo_client20.DocumentNode;
4
+ declare const PRICE_FRAGMENT: _apollo_client15.DocumentNode;
5
+ declare const PRODUCT_VARIANT_FRAGMENT: _apollo_client15.DocumentNode;
6
+ declare const PRODUCT_CATEGORY_FRAGMENT: _apollo_client15.DocumentNode;
7
+ declare const PRODUCT_COLLECTION_FRAGMENT: _apollo_client15.DocumentNode;
8
+ declare const PRODUCT_IMAGE_FRAGMENT: _apollo_client15.DocumentNode;
9
+ declare const COLLECTION_PRODUCTS_FRAGMENT: _apollo_client15.DocumentNode;
10
+ declare const COLLECTION_PRODUCTS_HOME_FRAGMENT: _apollo_client15.DocumentNode;
11
11
  //#endregion
12
12
  export { COLLECTION_PRODUCTS_FRAGMENT, COLLECTION_PRODUCTS_HOME_FRAGMENT, PRICE_FRAGMENT, PRODUCT_CATEGORY_FRAGMENT, PRODUCT_COLLECTION_FRAGMENT, PRODUCT_IMAGE_FRAGMENT, PRODUCT_VARIANT_FRAGMENT };
13
13
  //# sourceMappingURL=product.d.ts.map
@@ -1,11 +1,11 @@
1
- import * as _apollo_client5 from "@apollo/client";
1
+ import * as _apollo_client22 from "@apollo/client";
2
2
 
3
3
  //#region src/lib/gql/mutations/cart.d.ts
4
- declare const CREATE_CART_MUTATION: _apollo_client5.DocumentNode;
5
- declare const CREATE_LINE_ITEM_MUTATION: _apollo_client5.DocumentNode;
6
- declare const UPDATE_CART_MUTATION: _apollo_client5.DocumentNode;
7
- declare const DELETE_LINE_ITEM_MUTATION: _apollo_client5.DocumentNode;
8
- declare const TRANSFER_CART_MUTATION: _apollo_client5.DocumentNode;
4
+ declare const CREATE_CART_MUTATION: _apollo_client22.DocumentNode;
5
+ declare const CREATE_LINE_ITEM_MUTATION: _apollo_client22.DocumentNode;
6
+ declare const UPDATE_CART_MUTATION: _apollo_client22.DocumentNode;
7
+ declare const DELETE_LINE_ITEM_MUTATION: _apollo_client22.DocumentNode;
8
+ declare const TRANSFER_CART_MUTATION: _apollo_client22.DocumentNode;
9
9
  //#endregion
10
10
  export { CREATE_CART_MUTATION, CREATE_LINE_ITEM_MUTATION, DELETE_LINE_ITEM_MUTATION, TRANSFER_CART_MUTATION, UPDATE_CART_MUTATION };
11
11
  //# sourceMappingURL=cart.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"cart.d.ts","names":[],"sources":["../../../../src/lib/gql/mutations/cart.ts"],"sourcesContent":[],"mappings":";;;cAQa,sBAOZ,eAAA,CAPgC;cASpB,2BAWZ,eAAA,CAXqC;cAazB,sBAgBZ,eAAA,CAhBgC;AAtBpB,cAwCA,yBAjCZ,EAyCA,eAAA,CARqC,YAjCrC;AAEY,cAyCA,sBA9BZ,EAqCA,eAAA,CAPkC,YA9BlC"}
1
+ {"version":3,"file":"cart.d.ts","names":[],"sources":["../../../../src/lib/gql/mutations/cart.ts"],"sourcesContent":[],"mappings":";;;cAQa,sBAOZ,gBAAA,CAPgC;cASpB,2BAWZ,gBAAA,CAXqC;cAazB,sBAgBZ,gBAAA,CAhBgC;AAtBpB,cAwCA,yBAjCZ,EAyCA,gBAAA,CARqC,YAjCrC;AAEY,cAyCA,sBA9BZ,EAqCA,gBAAA,CAPkC,YA9BlC"}
@@ -1,7 +1,7 @@
1
- import * as _apollo_client29 from "@apollo/client";
1
+ import * as _apollo_client30 from "@apollo/client";
2
2
 
3
3
  //#region src/lib/gql/queries/cart.d.ts
4
- declare const GET_CART_QUERY: _apollo_client29.DocumentNode;
4
+ declare const GET_CART_QUERY: _apollo_client30.DocumentNode;
5
5
  //#endregion
6
6
  export { GET_CART_QUERY };
7
7
  //# sourceMappingURL=cart.d.ts.map
@@ -1,8 +1,8 @@
1
- import * as _apollo_client30 from "@apollo/client";
1
+ import * as _apollo_client31 from "@apollo/client";
2
2
 
3
3
  //#region src/lib/gql/queries/collections.d.ts
4
- declare const GET_COLLECTIONS_QUERY: _apollo_client30.DocumentNode;
5
- declare const GET_COLLECTIONS_HOME_QUERY: _apollo_client30.DocumentNode;
4
+ declare const GET_COLLECTIONS_QUERY: _apollo_client31.DocumentNode;
5
+ declare const GET_COLLECTIONS_HOME_QUERY: _apollo_client31.DocumentNode;
6
6
  //#endregion
7
7
  export { GET_COLLECTIONS_HOME_QUERY, GET_COLLECTIONS_QUERY };
8
8
  //# sourceMappingURL=collections.d.ts.map
@@ -1,7 +1,7 @@
1
- import * as _apollo_client33 from "@apollo/client";
1
+ import * as _apollo_client29 from "@apollo/client";
2
2
 
3
3
  //#region src/lib/gql/queries/customer.d.ts
4
- declare const GET_CUSTOMER_QUERY: _apollo_client33.DocumentNode;
4
+ declare const GET_CUSTOMER_QUERY: _apollo_client29.DocumentNode;
5
5
  //#endregion
6
6
  export { GET_CUSTOMER_QUERY };
7
7
  //# sourceMappingURL=customer.d.ts.map
@@ -1,8 +1,8 @@
1
- import * as _apollo_client34 from "@apollo/client";
1
+ import * as _apollo_client33 from "@apollo/client";
2
2
 
3
3
  //#region src/lib/gql/queries/footer.d.ts
4
- declare const GET_FOOTER_QUERY: _apollo_client34.DocumentNode;
5
- declare const GET_FOOTER_DATA_QUERY: _apollo_client34.DocumentNode;
4
+ declare const GET_FOOTER_QUERY: _apollo_client33.DocumentNode;
5
+ declare const GET_FOOTER_DATA_QUERY: _apollo_client33.DocumentNode;
6
6
  //#endregion
7
7
  export { GET_FOOTER_DATA_QUERY, GET_FOOTER_QUERY };
8
8
  //# sourceMappingURL=footer.d.ts.map