@nok-integration/storefront-react 0.19.52 → 0.20.5

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.
@@ -4403,6 +4403,53 @@ function requireContent() {
4403
4403
  })(content$1);
4404
4404
  return content$1;
4405
4405
  }
4406
+ var storefrontConfig = {};
4407
+ var hasRequiredStorefrontConfig;
4408
+ function requireStorefrontConfig() {
4409
+ if (hasRequiredStorefrontConfig) return storefrontConfig;
4410
+ hasRequiredStorefrontConfig = 1;
4411
+ (function(exports) {
4412
+ Object.defineProperty(exports, "__esModule", {
4413
+ value: true
4414
+ });
4415
+ exports.STOREFRONT_CONFIG_FALLBACK = exports.StorefrontConfig = exports.StorefrontMarketConfig = exports.StorefrontPresentationConfig = exports.StorefrontAnalyticsConfig = void 0;
4416
+ const zod_1 = requireZod();
4417
+ exports.StorefrontAnalyticsConfig = zod_1.z.object({
4418
+ ga4_measurement_id: zod_1.z.string().nullable(),
4419
+ debug: zod_1.z.boolean()
4420
+ });
4421
+ exports.StorefrontPresentationConfig = zod_1.z.object({
4422
+ show_cart_tax: zod_1.z.boolean(),
4423
+ show_size_charts: zod_1.z.boolean(),
4424
+ show_stock_alerts: zod_1.z.boolean()
4425
+ });
4426
+ exports.StorefrontMarketConfig = zod_1.z.object({
4427
+ default_country: zod_1.z.string(),
4428
+ default_lang: zod_1.z.string()
4429
+ });
4430
+ exports.StorefrontConfig = zod_1.z.object({
4431
+ analytics: exports.StorefrontAnalyticsConfig,
4432
+ presentation: exports.StorefrontPresentationConfig,
4433
+ market: exports.StorefrontMarketConfig
4434
+ });
4435
+ exports.STOREFRONT_CONFIG_FALLBACK = {
4436
+ analytics: {
4437
+ ga4_measurement_id: null,
4438
+ debug: false
4439
+ },
4440
+ presentation: {
4441
+ show_cart_tax: true,
4442
+ show_size_charts: true,
4443
+ show_stock_alerts: true
4444
+ },
4445
+ market: {
4446
+ default_country: "GB",
4447
+ default_lang: "en"
4448
+ }
4449
+ };
4450
+ })(storefrontConfig);
4451
+ return storefrontConfig;
4452
+ }
4406
4453
  var inventory = {};
4407
4454
  var hasRequiredInventory;
4408
4455
  function requireInventory() {
@@ -4885,6 +4932,7 @@ function requireClient() {
4885
4932
  client.createClient = createClient;
4886
4933
  const catalog_1 = requireCatalog();
4887
4934
  const content_1 = requireContent();
4935
+ const storefront_config_1 = requireStorefrontConfig();
4888
4936
  const inventory_1 = requireInventory();
4889
4937
  const cart_1 = requireCart();
4890
4938
  const session_1 = requireSession();
@@ -5012,6 +5060,13 @@ function requireClient() {
5012
5060
  schema: content_1.HomeContent
5013
5061
  })
5014
5062
  },
5063
+ storefrontConfig: {
5064
+ get: () => request({
5065
+ method: "GET",
5066
+ path: "/storefront-config",
5067
+ schema: storefront_config_1.StorefrontConfig
5068
+ })
5069
+ },
5015
5070
  inventory: {
5016
5071
  get: (sku) => request({
5017
5072
  method: "GET",
@@ -5275,7 +5330,7 @@ function NoScreenTitle({ children }) {
5275
5330
  }
5276
5331
  const ShopContext = createContext(null);
5277
5332
  function DaznShopProvider({ children, ...config }) {
5278
- const { apiBaseUrl, getToken, market, navigate: hostNavigate, prefetch: hostPrefetch, sessionTransport = "bearer", theme = "auto", notifications = "internal", onEvent, locale, assetBaseUrl } = config;
5333
+ const { apiBaseUrl, getToken, market, navigate: hostNavigate, prefetch: hostPrefetch, sessionTransport = "bearer", theme = "auto", notifications = "internal", features, onEvent, locale, assetBaseUrl } = config;
5279
5334
  const listeners = useRef(/* @__PURE__ */ new Set());
5280
5335
  const subscribe = useCallback((listener) => {
5281
5336
  listeners.current.add(listener);
@@ -5329,19 +5384,24 @@ function DaznShopProvider({ children, ...config }) {
5329
5384
  type: "ready"
5330
5385
  });
5331
5386
  }, []);
5387
+ const resolvedFeatures = useMemo(() => ({
5388
+ sizeCharts: features?.sizeCharts ?? true,
5389
+ stockAlerts: features?.stockAlerts ?? true
5390
+ }), [features?.sizeCharts, features?.stockAlerts]);
5332
5391
  const value2 = useMemo(() => ({
5333
5392
  api,
5334
5393
  market,
5335
5394
  products,
5336
5395
  theme,
5337
5396
  notifications,
5397
+ features: resolvedFeatures,
5338
5398
  locale,
5339
5399
  assetBaseUrl,
5340
5400
  emit,
5341
5401
  subscribe,
5342
5402
  navigate,
5343
5403
  prefetch: hostPrefetch ?? null
5344
- }), [api, market, products, theme, notifications, locale, assetBaseUrl, emit, subscribe, navigate, hostPrefetch]);
5404
+ }), [api, market, products, theme, resolvedFeatures, notifications, locale, assetBaseUrl, emit, subscribe, navigate, hostPrefetch]);
5345
5405
  return jsx(ShopContext.Provider, {
5346
5406
  value: value2,
5347
5407
  children: jsx(ScreenTitleProvider, {
@@ -5376,6 +5436,12 @@ function useShopEvent() {
5376
5436
  const emit = useShopOptional()?.emit;
5377
5437
  return useCallback((event) => emit?.(event), [emit]);
5378
5438
  }
5439
+ function useShopFeatures() {
5440
+ return useShopOptional()?.features ?? {
5441
+ sizeCharts: true,
5442
+ stockAlerts: true
5443
+ };
5444
+ }
5379
5445
  function ShopLink({ to, children, ...rest }) {
5380
5446
  const navigate = useNavigate();
5381
5447
  const prefetch = usePrefetch();
@@ -5531,13 +5597,13 @@ function Badge({ tone = "neutral", children }) {
5531
5597
  children
5532
5598
  });
5533
5599
  }
5534
- const button$1 = "_button_1u2uh_1";
5535
- const fullWidth = "_fullWidth_1u2uh_25";
5536
- const primary = "_primary_1u2uh_29";
5537
- const secondary = "_secondary_1u2uh_34";
5538
- const ghost = "_ghost_1u2uh_40";
5539
- const spinner = "_spinner_1u2uh_83";
5540
- const spin = "_spin_1u2uh_83";
5600
+ const button$1 = "_button_17pvl_1";
5601
+ const fullWidth = "_fullWidth_17pvl_25";
5602
+ const primary = "_primary_17pvl_29";
5603
+ const secondary = "_secondary_17pvl_34";
5604
+ const ghost = "_ghost_17pvl_40";
5605
+ const spinner = "_spinner_17pvl_83";
5606
+ const spin = "_spin_17pvl_83";
5541
5607
  const styles$Q = {
5542
5608
  button: button$1,
5543
5609
  fullWidth,
@@ -5580,8 +5646,8 @@ function Skeleton({ width, height, radius, className, circle }) {
5580
5646
  style
5581
5647
  });
5582
5648
  }
5583
- const surface$1 = "_surface_1xwok_10";
5584
- const fill = "_fill_1xwok_35";
5649
+ const surface$1 = "_surface_stwld_10";
5650
+ const fill = "_fill_stwld_35";
5585
5651
  const styles$O = {
5586
5652
  surface: surface$1,
5587
5653
  fill
@@ -5689,14 +5755,14 @@ function minorUnitExponent(currency) {
5689
5755
  }
5690
5756
  function formatMoney(money2, locale) {
5691
5757
  const exponent = minorUnitExponent(money2.currency);
5692
- const major = money2.amount / 10 ** exponent;
5758
+ const major2 = money2.amount / 10 ** exponent;
5693
5759
  try {
5694
5760
  return new Intl.NumberFormat(locale, {
5695
5761
  style: "currency",
5696
5762
  currency: money2.currency
5697
- }).format(major);
5763
+ }).format(major2);
5698
5764
  } catch {
5699
- return `${major.toFixed(exponent)} ${money2.currency}`;
5765
+ return `${major2.toFixed(exponent)} ${money2.currency}`;
5700
5766
  }
5701
5767
  }
5702
5768
  function discountPct(price2, compareAt2) {
@@ -6116,20 +6182,20 @@ function StatusBadge({ status }) {
6116
6182
  children: t(label2)
6117
6183
  });
6118
6184
  }
6119
- const viewport = "_viewport_1tc1q_14";
6120
- const anchor = "_anchor_1tc1q_41";
6121
- const caret = "_caret_1tc1q_59";
6122
- const toast = "_toast_1tc1q_82";
6123
- const text$4 = "_text_1tc1q_111";
6124
- const message$1 = "_message_1tc1q_120";
6125
- const action = "_action_1tc1q_133";
6126
- const neutral = "_neutral_1tc1q_158";
6127
- const success = "_success_1tc1q_163";
6128
- const critical$1 = "_critical_1tc1q_168";
6129
- const rich = "_rich_1tc1q_183";
6130
- const description = "_description_1tc1q_198";
6131
- const thumb$3 = "_thumb_1tc1q_216";
6132
- const thumbImage = "_thumbImage_1tc1q_227";
6185
+ const viewport = "_viewport_oz4st_14";
6186
+ const anchor = "_anchor_oz4st_41";
6187
+ const caret = "_caret_oz4st_59";
6188
+ const toast = "_toast_oz4st_82";
6189
+ const text$4 = "_text_oz4st_111";
6190
+ const message$1 = "_message_oz4st_120";
6191
+ const action = "_action_oz4st_133";
6192
+ const neutral = "_neutral_oz4st_158";
6193
+ const success = "_success_oz4st_163";
6194
+ const critical$1 = "_critical_oz4st_168";
6195
+ const rich = "_rich_oz4st_183";
6196
+ const description = "_description_oz4st_198";
6197
+ const thumb$3 = "_thumb_oz4st_216";
6198
+ const thumbImage = "_thumbImage_oz4st_227";
6133
6199
  const styles$K = {
6134
6200
  viewport,
6135
6201
  anchor,
@@ -6661,27 +6727,27 @@ function renderValue(key, pricing, format, t) {
6661
6727
  }
6662
6728
  return key === "discount" ? null : format(pricing[key]);
6663
6729
  }
6664
- const lines$1 = "_lines_15b52_19";
6665
- const line$2 = "_line_15b52_19";
6666
- const thumb$2 = "_thumb_15b52_34";
6667
- const image$9 = "_image_15b52_44";
6668
- const placeholder$8 = "_placeholder_15b52_51";
6669
- const lineBody = "_lineBody_15b52_56";
6670
- const lineText = "_lineText_15b52_65";
6671
- const lineTitle = "_lineTitle_15b52_75";
6672
- const lineMeta = "_lineMeta_15b52_107";
6673
- const detail$1 = "_detail_15b52_104";
6674
- const linePrice = "_linePrice_15b52_128";
6675
- const paid$3 = "_paid_15b52_140";
6676
- const was$4 = "_was_15b52_153";
6677
- const card$4 = "_card_15b52_176";
6678
- const cardTitle = "_cardTitle_15b52_184";
6679
- const cardBody = "_cardBody_15b52_196";
6680
- const summaryCard = "_summaryCard_15b52_168";
6681
- const itemsHeader = "_itemsHeader_15b52_14";
6682
- const itemsTitle = "_itemsTitle_15b52_225";
6683
- const itemsCount = "_itemsCount_15b52_236";
6684
- const cardLines = "_cardLines_15b52_255";
6730
+ const lines$1 = "_lines_1lx0d_19";
6731
+ const line$2 = "_line_1lx0d_19";
6732
+ const thumb$2 = "_thumb_1lx0d_34";
6733
+ const image$9 = "_image_1lx0d_44";
6734
+ const placeholder$8 = "_placeholder_1lx0d_51";
6735
+ const lineBody = "_lineBody_1lx0d_56";
6736
+ const lineText = "_lineText_1lx0d_65";
6737
+ const lineTitle = "_lineTitle_1lx0d_75";
6738
+ const lineMeta = "_lineMeta_1lx0d_106";
6739
+ const detail$1 = "_detail_1lx0d_103";
6740
+ const linePrice = "_linePrice_1lx0d_127";
6741
+ const paid$3 = "_paid_1lx0d_139";
6742
+ const was$4 = "_was_1lx0d_152";
6743
+ const card$4 = "_card_1lx0d_175";
6744
+ const cardTitle = "_cardTitle_1lx0d_183";
6745
+ const cardBody = "_cardBody_1lx0d_195";
6746
+ const summaryCard = "_summaryCard_1lx0d_167";
6747
+ const itemsHeader = "_itemsHeader_1lx0d_14";
6748
+ const itemsTitle = "_itemsTitle_1lx0d_238";
6749
+ const itemsCount = "_itemsCount_1lx0d_249";
6750
+ const cardLines = "_cardLines_1lx0d_268";
6685
6751
  const styles$F = {
6686
6752
  lines: lines$1,
6687
6753
  line: line$2,
@@ -7119,17 +7185,17 @@ function ReturnItemRow({ item: item2, className }) {
7119
7185
  })]
7120
7186
  });
7121
7187
  }
7122
- const page$6 = "_page_v0hbj_7";
7123
- const titles$2 = "_titles_v0hbj_15";
7124
- const title$k = "_title_v0hbj_15";
7125
- const subtitle$7 = "_subtitle_v0hbj_30";
7126
- const list$2 = "_list_v0hbj_38";
7127
- const card$3 = "_card_v0hbj_48";
7128
- const checkSlot = "_checkSlot_v0hbj_61";
7129
- const check = "_check_v0hbj_61";
7130
- const row$6 = "_row_v0hbj_105";
7131
- const reason = "_reason_v0hbj_112";
7132
- const reasonSet = "_reasonSet_v0hbj_132";
7188
+ const page$6 = "_page_15fz5_7";
7189
+ const titles$2 = "_titles_15fz5_15";
7190
+ const title$k = "_title_15fz5_15";
7191
+ const subtitle$7 = "_subtitle_15fz5_35";
7192
+ const list$2 = "_list_15fz5_43";
7193
+ const card$3 = "_card_15fz5_53";
7194
+ const checkSlot = "_checkSlot_15fz5_66";
7195
+ const check = "_check_15fz5_66";
7196
+ const row$6 = "_row_15fz5_110";
7197
+ const reason = "_reason_15fz5_135";
7198
+ const reasonSet = "_reasonSet_15fz5_155";
7133
7199
  const styles$B = {
7134
7200
  page: page$6,
7135
7201
  titles: titles$2,
@@ -7432,21 +7498,21 @@ function ReturnLabelView({ ret, onDone }) {
7432
7498
  })]
7433
7499
  });
7434
7500
  }
7435
- const page$4 = "_page_1l21t_8";
7436
- const titles$1 = "_titles_1l21t_15";
7437
- const title$i = "_title_1l21t_15";
7438
- const subtitle$5 = "_subtitle_1l21t_30";
7439
- const items$1 = "_items_1l21t_38";
7440
- const item$1 = "_item_1l21t_38";
7441
- const thumb = "_thumb_1l21t_53";
7442
- const img = "_img_1l21t_63";
7443
- const placeholder$6 = "_placeholder_1l21t_70";
7444
- const meta$2 = "_meta_1l21t_75";
7445
- const name$1 = "_name_1l21t_83";
7446
- const attrs = "_attrs_1l21t_103";
7447
- const price$2 = "_price_1l21t_118";
7448
- const paid$1 = "_paid_1l21t_127";
7449
- const was$2 = "_was_1l21t_135";
7501
+ const page$4 = "_page_g4vus_8";
7502
+ const titles$1 = "_titles_g4vus_15";
7503
+ const title$i = "_title_g4vus_15";
7504
+ const subtitle$5 = "_subtitle_g4vus_35";
7505
+ const items$1 = "_items_g4vus_43";
7506
+ const item$1 = "_item_g4vus_43";
7507
+ const thumb = "_thumb_g4vus_58";
7508
+ const img = "_img_g4vus_68";
7509
+ const placeholder$6 = "_placeholder_g4vus_75";
7510
+ const meta$2 = "_meta_g4vus_80";
7511
+ const name$1 = "_name_g4vus_88";
7512
+ const attrs = "_attrs_g4vus_108";
7513
+ const price$2 = "_price_g4vus_123";
7514
+ const paid$1 = "_paid_g4vus_132";
7515
+ const was$2 = "_was_g4vus_140";
7450
7516
  const styles$z = {
7451
7517
  page: page$4,
7452
7518
  titles: titles$1,
@@ -7644,22 +7710,22 @@ function ReturnFlowContent({ orderRef, returnRef, onDone, locale }) {
7644
7710
  busy
7645
7711
  });
7646
7712
  }
7647
- const page$3 = "_page_1qh0r_8";
7648
- const widget = "_widget_1qh0r_18";
7649
- const titleRow = "_titleRow_1qh0r_26";
7650
- const headline$1 = "_headline_1qh0r_42";
7651
- const track$5 = "_track_1qh0r_74";
7652
- const rule$1 = "_rule_1qh0r_99";
7653
- const help = "_help_1qh0r_109";
7654
- const helpTitle = "_helpTitle_1qh0r_115";
7655
- const helpRows = "_helpRows_1qh0r_122";
7656
- const helpRowEnd = "_helpRowEnd_1qh0r_131";
7657
- const helpStatus = "_helpStatus_1qh0r_139";
7658
- const helpRow = "_helpRow_1qh0r_122";
7659
- const cancel = "_cancel_1qh0r_197";
7660
- const cancelledHead = "_cancelledHead_1qh0r_221";
7661
- const cancelledTitle = "_cancelledTitle_1qh0r_227";
7662
- const cancelledMeta = "_cancelledMeta_1qh0r_236";
7713
+ const page$3 = "_page_1iwin_8";
7714
+ const widget = "_widget_1iwin_18";
7715
+ const titleRow = "_titleRow_1iwin_26";
7716
+ const headline$1 = "_headline_1iwin_42";
7717
+ const track$5 = "_track_1iwin_74";
7718
+ const rule$1 = "_rule_1iwin_99";
7719
+ const help = "_help_1iwin_109";
7720
+ const helpTitle = "_helpTitle_1iwin_115";
7721
+ const helpRows = "_helpRows_1iwin_122";
7722
+ const helpRowEnd = "_helpRowEnd_1iwin_131";
7723
+ const helpStatus = "_helpStatus_1iwin_139";
7724
+ const helpRow = "_helpRow_1iwin_122";
7725
+ const cancel = "_cancel_1iwin_197";
7726
+ const cancelledHead = "_cancelledHead_1iwin_221";
7727
+ const cancelledTitle = "_cancelledTitle_1iwin_227";
7728
+ const cancelledMeta = "_cancelledMeta_1iwin_241";
7663
7729
  const styles$y = {
7664
7730
  page: page$3,
7665
7731
  widget,
@@ -9112,25 +9178,25 @@ function QtyStepper({ qty, max, onChange, onRemove, disabled: disabled2, capDesc
9112
9178
  })]
9113
9179
  });
9114
9180
  }
9115
- const line = "_line_1ritd_6";
9116
- const row$5 = "_row_1ritd_12";
9117
- const pending = "_pending_1ritd_18";
9118
- const labels = "_labels_1ritd_24";
9119
- const lowStock$1 = "_lowStock_1ritd_39";
9120
- const media$1 = "_media_1ritd_49";
9121
- const image$5 = "_image_1ritd_59";
9122
- const placeholder$2 = "_placeholder_1ritd_75";
9123
- const saleBadge = "_saleBadge_1ritd_88";
9124
- const oos$1 = "_oos_1ritd_103";
9125
- const info$2 = "_info_1ritd_116";
9126
- const head = "_head_1ritd_124";
9127
- const meta = "_meta_1ritd_131";
9128
- const title$b = "_title_1ritd_146";
9129
- const details = "_details_1ritd_164";
9130
- const detail = "_detail_1ritd_164";
9131
- const price = "_price_1ritd_183";
9132
- const amount = "_amount_1ritd_191";
9133
- const was = "_was_1ritd_200";
9181
+ const line = "_line_1dx14_6";
9182
+ const row$5 = "_row_1dx14_12";
9183
+ const pending = "_pending_1dx14_18";
9184
+ const labels = "_labels_1dx14_24";
9185
+ const lowStock$1 = "_lowStock_1dx14_39";
9186
+ const media$1 = "_media_1dx14_49";
9187
+ const image$5 = "_image_1dx14_59";
9188
+ const placeholder$2 = "_placeholder_1dx14_75";
9189
+ const saleBadge = "_saleBadge_1dx14_88";
9190
+ const oos$1 = "_oos_1dx14_103";
9191
+ const info$2 = "_info_1dx14_116";
9192
+ const head = "_head_1dx14_124";
9193
+ const meta = "_meta_1dx14_131";
9194
+ const title$b = "_title_1dx14_146";
9195
+ const details = "_details_1dx14_164";
9196
+ const detail = "_detail_1dx14_164";
9197
+ const price = "_price_1dx14_183";
9198
+ const amount = "_amount_1dx14_191";
9199
+ const was = "_was_1dx14_200";
9134
9200
  const styles$m = {
9135
9201
  line,
9136
9202
  row: row$5,
@@ -9315,11 +9381,11 @@ function ShippingInfo() {
9315
9381
  })]
9316
9382
  });
9317
9383
  }
9318
- const bar = "_bar_v20rr_1";
9319
- const floating$1 = "_floating_v20rr_31";
9320
- const divider = "_divider_v20rr_37";
9321
- const info$1 = "_info_v20rr_41";
9322
- const actions = "_actions_v20rr_49";
9384
+ const bar = "_bar_23dkv_1";
9385
+ const floating$1 = "_floating_23dkv_52";
9386
+ const divider = "_divider_23dkv_58";
9387
+ const info$1 = "_info_23dkv_62";
9388
+ const actions = "_actions_23dkv_70";
9323
9389
  const styles$k = {
9324
9390
  bar,
9325
9391
  floating: floating$1,
@@ -9339,14 +9405,14 @@ function StickyCtaBar({ children, info: info2, variant = "floating" }) {
9339
9405
  })]
9340
9406
  });
9341
9407
  }
9342
- const surface = "_surface_15488_15";
9343
- const screen = "_screen_15488_20";
9344
- const body$3 = "_body_15488_12";
9345
- const items = "_items_15488_34";
9346
- const sectionHeader = "_sectionHeader_15488_40";
9347
- const sectionTitle = "_sectionTitle_15488_46";
9348
- const count = "_count_15488_55";
9349
- const lines = "_lines_15488_79";
9408
+ const surface = "_surface_1bdb0_15";
9409
+ const screen = "_screen_1bdb0_20";
9410
+ const body$3 = "_body_1bdb0_12";
9411
+ const items = "_items_1bdb0_34";
9412
+ const sectionHeader = "_sectionHeader_1bdb0_40";
9413
+ const sectionTitle = "_sectionTitle_1bdb0_46";
9414
+ const count = "_count_1bdb0_67";
9415
+ const lines = "_lines_1bdb0_91";
9350
9416
  const styles$j = {
9351
9417
  surface,
9352
9418
  screen,
@@ -9605,14 +9671,14 @@ function CartSheetProvider({ children }) {
9605
9671
  })]
9606
9672
  });
9607
9673
  }
9608
- const gallery = "_gallery_1wmgz_1";
9609
- const track$2 = "_track_1wmgz_5";
9610
- const slide$1 = "_slide_1wmgz_20";
9611
- const image$4 = "_image_1wmgz_27";
9612
- const placeholder$1 = "_placeholder_1wmgz_31";
9613
- const dots$2 = "_dots_1wmgz_49";
9614
- const dot$2 = "_dot_1wmgz_49";
9615
- const dotActive$2 = "_dotActive_1wmgz_100";
9674
+ const gallery = "_gallery_1vbj7_1";
9675
+ const track$2 = "_track_1vbj7_5";
9676
+ const slide$1 = "_slide_1vbj7_20";
9677
+ const image$4 = "_image_1vbj7_27";
9678
+ const placeholder$1 = "_placeholder_1vbj7_31";
9679
+ const dots$2 = "_dots_1vbj7_49";
9680
+ const dot$2 = "_dot_1vbj7_49";
9681
+ const dotActive$2 = "_dotActive_1vbj7_100";
9616
9682
  const styles$i = {
9617
9683
  gallery,
9618
9684
  track: track$2,
@@ -9912,6 +9978,7 @@ const styles$g = {
9912
9978
  function SizeSelector({ sizes, selected: selected2, onSelect, error: error2 = false, lowStock: lowStock2, guide }) {
9913
9979
  const t = useT();
9914
9980
  const [guideOpen, setGuideOpen] = useState(false);
9981
+ const showGuide = useShopFeatures().sizeCharts && guide !== void 0;
9915
9982
  return jsxs("section", {
9916
9983
  className: styles$g.root,
9917
9984
  "aria-labelledby": "size-heading",
@@ -9921,7 +9988,7 @@ function SizeSelector({ sizes, selected: selected2, onSelect, error: error2 = fa
9921
9988
  id: "size-heading",
9922
9989
  className: styles$g.title,
9923
9990
  children: "Size"
9924
- }), guide && jsxs("button", {
9991
+ }), showGuide && jsxs("button", {
9925
9992
  type: "button",
9926
9993
  className: styles$g.sizeGuide,
9927
9994
  onClick: () => setGuideOpen(true),
@@ -9983,7 +10050,7 @@ function SizeSelector({ sizes, selected: selected2, onSelect, error: error2 = fa
9983
10050
  className: styles$g.lowStock,
9984
10051
  role: "status",
9985
10052
  children: lowStock2
9986
- }), guide && guideOpen && jsx(SizeGuideSheet, {
10053
+ }), showGuide && guideOpen && jsx(SizeGuideSheet, {
9987
10054
  guide,
9988
10055
  onClose: () => setGuideOpen(false)
9989
10056
  })]
@@ -10341,6 +10408,7 @@ function ProductDetail({ product, inventory: inventory2, recommendations = [] })
10341
10408
  const [busy, setBusy] = useState(null);
10342
10409
  const [sizeError, setSizeError] = useState(false);
10343
10410
  const [reminded, setReminded] = useState([]);
10411
+ const features = useShopFeatures();
10344
10412
  const [added, setAdded] = useState([]);
10345
10413
  const sizeRef = useRef(null);
10346
10414
  const colourRef = useRef(null);
@@ -10498,12 +10566,16 @@ function ProductDetail({ product, inventory: inventory2, recommendations = [] })
10498
10566
  loading: busy === "add",
10499
10567
  disabled: busy !== null,
10500
10568
  children: busy === "add" ? t("Adding to cart") : inCart ? t("Go to cart") : t("Add to cart")
10501
- }) : jsx(Button, {
10569
+ }) : features.stockAlerts ? jsx(Button, {
10502
10570
  variant: "primary",
10503
10571
  onClick: handleRemind,
10504
10572
  loading: busy === "remind",
10505
10573
  disabled: alerted || busy !== null,
10506
10574
  children: alerted ? t("We'll remind you") : t("Remind me when available")
10575
+ }) : jsx(Button, {
10576
+ variant: "primary",
10577
+ disabled: true,
10578
+ children: t("Out of stock")
10507
10579
  });
10508
10580
  return jsxs(ShopSurface, {
10509
10581
  tone: "light",
@@ -10768,10 +10840,10 @@ function ReviewCarousel({ quotes }) {
10768
10840
  })]
10769
10841
  });
10770
10842
  }
10771
- const section$1 = "_section_82ve5_1";
10772
- const row$2 = "_row_82ve5_9";
10773
- const title$4 = "_title_82ve5_21";
10774
- const body = "_body_82ve5_48";
10843
+ const section$1 = "_section_1nrsi_1";
10844
+ const row$2 = "_row_1nrsi_9";
10845
+ const title$4 = "_title_1nrsi_20";
10846
+ const body = "_body_1nrsi_43";
10775
10847
  const styles$5 = {
10776
10848
  section: section$1,
10777
10849
  row: row$2,
@@ -10839,12 +10911,12 @@ function ExploreList({ title: title2, links }) {
10839
10911
  })]
10840
10912
  });
10841
10913
  }
10842
- const pcp = "_pcp_yu17f_6";
10843
- const blocks = "_blocks_yu17f_25";
10844
- const featured = "_featured_yu17f_38";
10845
- const gridBlock = "_gridBlock_yu17f_39";
10846
- const blockTitle = "_blockTitle_yu17f_46";
10847
- const grid = "_grid_yu17f_39";
10914
+ const pcp = "_pcp_1kft8_6";
10915
+ const blocks = "_blocks_1kft8_24";
10916
+ const featured = "_featured_1kft8_36";
10917
+ const gridBlock = "_gridBlock_1kft8_37";
10918
+ const blockTitle = "_blockTitle_1kft8_44";
10919
+ const grid = "_grid_1kft8_37";
10848
10920
  const styles$3 = {
10849
10921
  pcp,
10850
10922
  blocks,
@@ -11101,24 +11173,24 @@ function ProductView({ sku, initialData, showRecommendations = true, onNotFound
11101
11173
  })
11102
11174
  });
11103
11175
  }
11104
- const showcase = "_showcase_15pba_14";
11105
- const panel = "_panel_15pba_57";
11106
- const image = "_image_15pba_122";
11107
- const hero = "_hero_15pba_162";
11108
- const heroContent = "_heroContent_15pba_254";
11109
- const heroText = "_heroText_15pba_278";
11110
- const logo = "_logo_15pba_287";
11111
- const heroTitle = "_heroTitle_15pba_307";
11112
- const heroSub = "_heroSub_15pba_331";
11113
- const swipe = "_swipe_15pba_350";
11114
- const swipeLabel = "_swipeLabel_15pba_357";
11115
- const chevron$1 = "_chevron_15pba_363";
11116
- const overlay$1 = "_overlay_15pba_11";
11117
- const copy = "_copy_15pba_398";
11118
- const title$2 = "_title_15pba_403";
11119
- const subtitle$1 = "_subtitle_15pba_410";
11120
- const cta = "_cta_15pba_416";
11121
- const mosaic = "_mosaic_15pba_460";
11176
+ const showcase = "_showcase_9ibf6_14";
11177
+ const panel = "_panel_9ibf6_40";
11178
+ const image = "_image_9ibf6_93";
11179
+ const hero = "_hero_9ibf6_133";
11180
+ const heroContent = "_heroContent_9ibf6_224";
11181
+ const heroText = "_heroText_9ibf6_248";
11182
+ const logo = "_logo_9ibf6_257";
11183
+ const heroTitle = "_heroTitle_9ibf6_277";
11184
+ const heroSub = "_heroSub_9ibf6_301";
11185
+ const swipe = "_swipe_9ibf6_320";
11186
+ const swipeLabel = "_swipeLabel_9ibf6_327";
11187
+ const chevron$1 = "_chevron_9ibf6_333";
11188
+ const overlay$1 = "_overlay_9ibf6_11";
11189
+ const copy = "_copy_9ibf6_368";
11190
+ const title$2 = "_title_9ibf6_373";
11191
+ const subtitle$1 = "_subtitle_9ibf6_380";
11192
+ const cta = "_cta_9ibf6_386";
11193
+ const mosaic = "_mosaic_9ibf6_430";
11122
11194
  const styles$2 = {
11123
11195
  showcase,
11124
11196
  panel,
@@ -11151,10 +11223,19 @@ function useDocumentSnap(ref, enabled = true) {
11151
11223
  const top2 = () => window.scrollTo(0, 0);
11152
11224
  top2();
11153
11225
  const frame2 = typeof window.requestAnimationFrame === "function" ? window.requestAnimationFrame(top2) : null;
11226
+ const history = window.history;
11227
+ const previousRestoration = history && "scrollRestoration" in history ? history.scrollRestoration : null;
11228
+ if (previousRestoration !== null) history.scrollRestoration = "manual";
11229
+ const onPageShow = (event) => {
11230
+ if (event.persisted) top2();
11231
+ };
11232
+ window.addEventListener("pageshow", onPageShow);
11154
11233
  return () => {
11155
11234
  if (frame2 !== null && typeof window.cancelAnimationFrame === "function") {
11156
11235
  window.cancelAnimationFrame(frame2);
11157
11236
  }
11237
+ window.removeEventListener("pageshow", onPageShow);
11238
+ if (previousRestoration !== null) history.scrollRestoration = previousRestoration;
11158
11239
  root2.style.scrollSnapType = previousType;
11159
11240
  root2.style.scrollPaddingTop = previousPadding;
11160
11241
  };
@@ -11276,17 +11357,27 @@ function useSlides() {
11276
11357
  }, [shop]);
11277
11358
  return fetched ?? fallback;
11278
11359
  }
11360
+ const RESIZED_BETWEEN_TOOLBARS = /\b(CriOS|FxiOS|EdgiOS|OPiOS|OPT)\b/;
11361
+ function useViewportKind() {
11362
+ const [kind, setKind] = useState(void 0);
11363
+ useEffect(() => {
11364
+ if (RESIZED_BETWEEN_TOOLBARS.test(navigator.userAgent)) setKind("fixed");
11365
+ }, []);
11366
+ return kind;
11367
+ }
11279
11368
  function HomeShowcase() {
11280
11369
  const t = useT();
11281
11370
  const assetUrl = useAssetUrl();
11282
11371
  const panels = useSlides();
11283
11372
  const showcaseRef = useRef(null);
11284
11373
  useDocumentSnap(showcaseRef);
11374
+ const viewport2 = useViewportKind();
11285
11375
  return jsx(ShopSurface, {
11286
11376
  tone: "dark",
11287
11377
  children: jsxs("div", {
11288
11378
  className: styles$2.showcase,
11289
11379
  ref: showcaseRef,
11380
+ "data-viewport": viewport2,
11290
11381
  children: [jsxs("section", {
11291
11382
  className: `${styles$2.panel} ${styles$2.hero}`,
11292
11383
  "aria-label": t("DAZN Shop"),
@@ -11797,6 +11888,102 @@ function ShopMenuSheet({ open, onClose, onManageOrders, onHelp, closeLabel, labe
11797
11888
  })]
11798
11889
  });
11799
11890
  }
11891
+ function major(money2) {
11892
+ return money2.amount / 100;
11893
+ }
11894
+ function toGa4Event(event) {
11895
+ switch (event.type) {
11896
+ case "product_viewed":
11897
+ return {
11898
+ name: "view_item",
11899
+ params: {
11900
+ items: [{
11901
+ item_id: event.sku
11902
+ }]
11903
+ }
11904
+ };
11905
+ case "add_to_cart":
11906
+ return {
11907
+ name: "add_to_cart",
11908
+ params: {
11909
+ items: [{
11910
+ item_id: event.sku,
11911
+ quantity: event.qty,
11912
+ ...event.title ? {
11913
+ item_name: event.title
11914
+ } : {},
11915
+ ...event.attributes?.colour ? {
11916
+ item_variant: event.attributes.colour
11917
+ } : {},
11918
+ ...event.size ? {
11919
+ item_category: event.size
11920
+ } : {}
11921
+ }]
11922
+ }
11923
+ };
11924
+ case "remove_from_cart":
11925
+ return {
11926
+ name: "remove_from_cart",
11927
+ params: {
11928
+ items: [{
11929
+ item_id: event.sku,
11930
+ quantity: event.qty
11931
+ }]
11932
+ }
11933
+ };
11934
+ case "cart_updated":
11935
+ return {
11936
+ name: "view_cart",
11937
+ params: {
11938
+ currency: event.subtotal.currency,
11939
+ value: major(event.subtotal),
11940
+ items: []
11941
+ }
11942
+ };
11943
+ case "checkout_handoff":
11944
+ return {
11945
+ name: "begin_checkout",
11946
+ params: {
11947
+ checkout_id: event.cartId
11948
+ }
11949
+ };
11950
+ case "stock_alert_requested":
11951
+ return {
11952
+ name: "join_group",
11953
+ params: {
11954
+ group_id: `back_in_stock:${event.sku}`
11955
+ }
11956
+ };
11957
+ case "return_requested":
11958
+ return {
11959
+ name: "refund",
11960
+ params: {
11961
+ transaction_id: event.orderRef,
11962
+ items: []
11963
+ }
11964
+ };
11965
+ case "error":
11966
+ return {
11967
+ name: "exception",
11968
+ params: {
11969
+ description: `${event.scope}:${event.code ?? "unknown"}`,
11970
+ fatal: false
11971
+ }
11972
+ };
11973
+ case "ready":
11974
+ case "navigate":
11975
+ case "support_requested":
11976
+ case "order_cancellation_requested":
11977
+ case "reorder_requested":
11978
+ case "session_required":
11979
+ case "session_expired":
11980
+ case "notification":
11981
+ return null;
11982
+ default: {
11983
+ return null;
11984
+ }
11985
+ }
11986
+ }
11800
11987
  export {
11801
11988
  Badge,
11802
11989
  BottomSheet,
@@ -11879,6 +12066,7 @@ export {
11879
12066
  resolveSku,
11880
12067
  sizeOptions,
11881
12068
  swatchColour,
12069
+ toGa4Event,
11882
12070
  treatmentFor,
11883
12071
  useAssetUrl,
11884
12072
  useCartCount,