@standhigher/besttrack-page-extension 0.5.10 → 0.5.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -11,11 +11,10 @@ import {
11
11
  isValidTrackingNumber,
12
12
  resolveShopifyResources,
13
13
  safeTrackingPageUrl
14
- } from "./chunk-KEW42Y26.js";
14
+ } from "./chunk-KD7KFFFK.js";
15
15
 
16
- // src/ready-to-go.tsx
17
- import { createContext, useCallback as useCallback2, useContext, useEffect as useEffect2, useMemo as useMemo2, useRef, useState as useState2 } from "react";
18
- import { parseProductReferences } from "@standhigher/puck-page-builder/runtime";
16
+ // src/tracking-runtime.tsx
17
+ import { createContext, useCallback, useContext, useEffect, useMemo, useRef, useState } from "react";
19
18
 
20
19
  // src/shopify-track-page/i18n/locales.ts
21
20
  var SUPPORTED_LOCALES = [
@@ -106,6 +105,11 @@ function formatTrackingDateTime(time, locale, options = {}) {
106
105
  }).format(date);
107
106
  }
108
107
 
108
+ // src/shopify-track-page/pages/home/asText.ts
109
+ function asText(value) {
110
+ return typeof value === "string" ? value : "";
111
+ }
112
+
109
113
  // src/shopify-track-page/timeline.ts
110
114
  var DEFAULT_INFO_NODE = {
111
115
  node: "InfoReceived",
@@ -202,7 +206,7 @@ var legacyNodeStepMap = /* @__PURE__ */ new Map([
202
206
  ["Returning", "delivered"]
203
207
  ]);
204
208
  var getStepKeyForStatus = (status) => {
205
- const normalized = status?.trim() ?? "";
209
+ const normalized = asText(status).trim();
206
210
  if (!normalized) return null;
207
211
  const exactMatch = subStatusStepMap.get(normalized) ?? legacyNodeStepMap.get(normalized);
208
212
  if (exactMatch) return exactMatch;
@@ -234,16 +238,16 @@ var buildStepsFromStatusRecords = (records, locale) => {
234
238
  };
235
239
  var buildStepsFromRawEvents = (events, locale) => buildStepsFromStatusRecords(
236
240
  events.map((event) => ({
237
- status: event.sub_status || event.stage || "",
238
- fallbackStatus: event.stage,
239
- time: event.time
241
+ status: asText(event.sub_status) || asText(event.stage),
242
+ fallbackStatus: asText(event.stage) || void 0,
243
+ time: asText(event.time)
240
244
  })),
241
245
  locale
242
246
  );
243
247
  var buildStepsFromNodes = (nodeList, locale) => buildStepsFromStatusRecords(
244
248
  nodeList.map((node) => ({
245
- status: node.node,
246
- time: node.time
249
+ status: asText(node.node),
250
+ time: asText(node.time)
247
251
  })),
248
252
  locale
249
253
  );
@@ -273,7 +277,7 @@ var monthIndexMap = /* @__PURE__ */ new Map([
273
277
  ["dec", 11],
274
278
  ["december", 11]
275
279
  ]);
276
- var normalizeNodeTime = (time) => time.replace(/\s+/g, " ").trim();
280
+ var normalizeNodeTime = (time) => asText(time).replace(/\s+/g, " ").trim();
277
281
  var toParsedNodeTime = ({
278
282
  year,
279
283
  monthIndex,
@@ -367,8 +371,8 @@ var formatNodeTime = (time, locale) => formatTrackingDateTime(normalizeNodeTime(
367
371
  var formatNodeDateLabel = (time, locale) => formatTrackingDateLabel(normalizeNodeTime(time), locale);
368
372
  function formatEstimatedDelivery(estimatedDelivery, locale) {
369
373
  if (!estimatedDelivery || !locale) return null;
370
- const from = estimatedDelivery.from.trim();
371
- const to = estimatedDelivery.to.trim();
374
+ const from = asText(estimatedDelivery.from).trim();
375
+ const to = asText(estimatedDelivery.to).trim();
372
376
  if (!from || !to) return null;
373
377
  const dateText = from === to ? formatTrackingDateLabel(from, locale) : `${formatTrackingDateLabel(from, locale)}-${formatTrackingDateLabel(to, locale)}`;
374
378
  return {
@@ -401,7 +405,7 @@ var getLatestTrackingTimestamp = (milestone, now = /* @__PURE__ */ new Date()) =
401
405
  };
402
406
  var hasActualDelivery = (milestone) => {
403
407
  const statuses = milestone.rawEventList?.length ? milestone.rawEventList.flatMap((event) => [event.sub_status, event.stage]) : milestone.nodeList.map((node) => node.node);
404
- return statuses.some((status) => /^delivered(?:_|$)/i.test(status.trim()));
408
+ return statuses.some((status) => /^delivered(?:_|$)/i.test(asText(status).trim()));
405
409
  };
406
410
  function shouldShowEstimatedDelivery(milestone, now = /* @__PURE__ */ new Date()) {
407
411
  const estimatedDelivery = milestone?.estimated_delivery;
@@ -469,14 +473,14 @@ var sortShippingDetailsByTime = (details, syntheticPrefixLength = 0) => {
469
473
  };
470
474
  var buildShippingDetailsFromRecords = (records, locale) => {
471
475
  const filtered = records.filter(
472
- (record) => record.location.trim() || record.description.trim() || record.time.trim()
476
+ (record) => asText(record.location).trim() || asText(record.description).trim() || asText(record.time).trim()
473
477
  );
474
478
  if (filtered.length === 0) return [];
475
479
  const rawDetails = filtered.map((record, index) => {
476
480
  const timeMeta = getNodeTimeMeta(record.time);
477
481
  return {
478
482
  index,
479
- description: [record.location.trim(), record.description.trim()].filter(Boolean).join(", "),
483
+ description: [asText(record.location).trim(), asText(record.description).trim()].filter(Boolean).join(", "),
480
484
  time: formatNodeTime(record.time, locale),
481
485
  timestamp: timeMeta?.timestamp ?? null,
482
486
  hasYear: timeMeta?.hasYear ?? false
@@ -491,10 +495,10 @@ var buildShippingDetailsFromRecords = (records, locale) => {
491
495
  };
492
496
  var buildShippingDetails = (nodeList, locale) => buildShippingDetailsFromRecords(nodeList, locale);
493
497
  var hasRawTrackingSignal = (event) => Boolean(
494
- event.sub_status.trim() || event.location.trim() || event.country.trim() || event.state.trim() || event.city.trim() || event.street.trim() || getStepKeyForStatus(event.stage)
498
+ asText(event.sub_status).trim() || asText(event.location).trim() || asText(event.country).trim() || asText(event.state).trim() || asText(event.city).trim() || asText(event.street).trim() || getStepKeyForStatus(event.stage)
495
499
  );
496
500
  var getSyntheticRawEventPrefixLength = (events) => {
497
- const firstEventStage = events[0]?.stage.trim().toLowerCase();
501
+ const firstEventStage = asText(events[0]?.stage).trim().toLowerCase();
498
502
  if (firstEventStage !== "order confirmed" && firstEventStage !== "package picked up") {
499
503
  return 0;
500
504
  }
@@ -519,7 +523,7 @@ function buildShippingDetailsFromMilestone(milestone, locale) {
519
523
  }
520
524
  var buildShippingDetailsFromRawEvents = (events, locale) => {
521
525
  const filtered = events.filter(
522
- (event) => event.location.trim() || event.description.trim() || event.time.trim()
526
+ (event) => asText(event.location).trim() || asText(event.description).trim() || asText(event.time).trim()
523
527
  );
524
528
  if (filtered.length === 0) return [];
525
529
  const syntheticPrefixLength = getSyntheticRawEventPrefixLength(filtered);
@@ -527,7 +531,7 @@ var buildShippingDetailsFromRawEvents = (events, locale) => {
527
531
  const timeMeta = getNodeTimeMeta(event.time);
528
532
  return {
529
533
  index,
530
- description: [event.location.trim(), event.description.trim()].filter(Boolean).join(", "),
534
+ description: [asText(event.location).trim(), asText(event.description).trim()].filter(Boolean).join(", "),
531
535
  time: formatNodeTime(event.time, locale),
532
536
  timestamp: timeMeta?.timestamp ?? null,
533
537
  hasYear: timeMeta?.hasYear ?? false
@@ -540,6 +544,66 @@ var buildShippingDetailsFromRawEvents = (events, locale) => {
540
544
  isLatest: index === 0
541
545
  }));
542
546
  };
547
+ var sanitizeTrackingNode = (node) => ({
548
+ node: asText(node?.node),
549
+ description: asText(node?.description),
550
+ time: asText(node?.time),
551
+ location: asText(node?.location),
552
+ country: asText(node?.country),
553
+ state: asText(node?.state),
554
+ city: asText(node?.city),
555
+ street: asText(node?.street),
556
+ carrier: asText(node?.carrier)
557
+ });
558
+ var sanitizeRawEvent = (event) => ({
559
+ stage: asText(event?.stage),
560
+ sub_status: asText(event?.sub_status),
561
+ description: asText(event?.description),
562
+ time: asText(event?.time),
563
+ location: asText(event?.location),
564
+ country: asText(event?.country),
565
+ state: asText(event?.state),
566
+ city: asText(event?.city),
567
+ street: asText(event?.street)
568
+ });
569
+ var sanitizePackageItem = (item) => ({
570
+ product_id: asText(item?.product_id),
571
+ variant_id: asText(item?.variant_id),
572
+ title: asText(item?.title),
573
+ variant_title: asText(item?.variant_title),
574
+ image_url: asText(item?.image_url),
575
+ quantity: typeof item?.quantity === "number" && Number.isFinite(item.quantity) ? item.quantity : 0
576
+ });
577
+ var sanitizeEstimatedDelivery = (estimatedDelivery) => {
578
+ if (!estimatedDelivery) return void 0;
579
+ return {
580
+ ...estimatedDelivery,
581
+ from: asText(estimatedDelivery.from),
582
+ to: asText(estimatedDelivery.to)
583
+ };
584
+ };
585
+ var sanitizeMilestone = (milestone) => ({
586
+ tracking_number: asText(milestone?.tracking_number),
587
+ nodeList: Array.isArray(milestone?.nodeList) ? milestone.nodeList.map(sanitizeTrackingNode) : [],
588
+ rawEventList: Array.isArray(milestone?.rawEventList) ? milestone.rawEventList.map(sanitizeRawEvent) : void 0,
589
+ carrier: asText(milestone?.carrier),
590
+ package_items: Array.isArray(milestone?.package_items) ? milestone.package_items.map(sanitizePackageItem) : [],
591
+ estimated_delivery: sanitizeEstimatedDelivery(milestone?.estimated_delivery)
592
+ });
593
+ var sanitizeMilestones = (milestones) => Array.isArray(milestones) ? milestones.map(sanitizeMilestone) : [];
594
+ function mergeDisplayValues(previous, next) {
595
+ const normalizedNext = next.filter(Boolean);
596
+ if (normalizedNext.length === 0) {
597
+ return previous;
598
+ }
599
+ const merged = [...normalizedNext];
600
+ previous.forEach((value) => {
601
+ if (!normalizedNext.includes(value)) {
602
+ merged.push(value);
603
+ }
604
+ });
605
+ return merged.slice(0, 3);
606
+ }
543
607
  function normalizeOrderValue(value) {
544
608
  return value.trim();
545
609
  }
@@ -819,7 +883,7 @@ function mapShopifyTrackQueryResponse(response, request, locale = "EN") {
819
883
  return emptyResult();
820
884
  }
821
885
  const data = response.data;
822
- const milestones = data?.mileStoneList ?? [];
886
+ const milestones = sanitizeMilestones(data?.mileStoneList);
823
887
  const shipments = milestones.map((milestone, index) => mapMilestone(milestone, locale, index));
824
888
  const primary = shipments[0] ?? mapMilestone(void 0, locale, 0);
825
889
  const trackingNumber = request.mode === "tracking" ? request.trackingNumber.trim() : primary.trackingNumber || "";
@@ -838,6 +902,7 @@ function mapShopifyTrackQueryResponse(response, request, locale = "EN") {
838
902
  events: primary.events,
839
903
  orderItems: primary.orderItems,
840
904
  ad,
905
+ // 旧接口广告是本次响应共用配置,因此复制到各包裹,切换后仍能读取同一广告。
841
906
  shipments: shipments.map((shipment) => ({ ...shipment, ad }))
842
907
  };
843
908
  }
@@ -921,11 +986,342 @@ function createShopifyRecommendationsQuery(post) {
921
986
  };
922
987
  }
923
988
 
989
+ // src/tracking-block-model.ts
990
+ import { parseProductReferences } from "@standhigher/puck-page-builder/runtime";
991
+ function defaultProgress(status) {
992
+ const steps = [
993
+ { id: "ordered", label: "Ordered", icon: "check" },
994
+ { id: "ready", label: "Order Ready", icon: "bag" },
995
+ { id: "transit", label: "In Transit", icon: "truck" },
996
+ { id: "out", label: "Out for Delivery", icon: "box" },
997
+ { id: "delivered", label: "Delivered", icon: "check" }
998
+ ];
999
+ const normalized = status.toLowerCase();
1000
+ const current = normalized.includes("deliver") ? normalized.includes("out for") ? 3 : 4 : normalized.includes("transit") ? 2 : normalized.includes("ready") ? 1 : 0;
1001
+ return steps.map((step, index) => ({
1002
+ ...step,
1003
+ state: index < current ? "complete" : index === current ? "current" : "upcoming"
1004
+ }));
1005
+ }
1006
+ function previewTrackingPageResult(trackingNumber = "BT-2048-DEMO") {
1007
+ return {
1008
+ trackingNumber,
1009
+ status: "In transit",
1010
+ carrier: "BestTrack demo carrier",
1011
+ latestEvent: "Shipment accepted at the regional hub",
1012
+ updatedAt: "Sep 17, 10:00 AM",
1013
+ destination: "Shanghai",
1014
+ estimatedDelivery: "Sep 22 - Sep 24",
1015
+ progress: defaultProgress("In transit"),
1016
+ events: [
1017
+ { id: "hub", title: "Shipment accepted at the regional hub", at: "Sep 17, 10:00 AM", state: "current" },
1018
+ { id: "info", title: "The order has been placed and confirmed.", at: "Sep 16, 3:31 PM", state: "complete" }
1019
+ ],
1020
+ orderItems: [{ id: "demo-order-item", title: "Demo shipment item", quantity: 1, description: "Product details are available in your order." }],
1021
+ // 演示结果保留该字段供画布取样;正式 Web 推荐仍通过 recommendationItems 读取独立来源。
1022
+ recommendations: [
1023
+ { id: "shipping-protection", title: "Shipping protection", description: "Extra assurance for your next delivery.", price: { amount: 900, currencyCode: "USD" } },
1024
+ { id: "delivery-alerts", title: "Delivery alerts", description: "Receive an update at every milestone.", price: { amount: 400, currencyCode: "USD" } }
1025
+ ]
1026
+ };
1027
+ }
1028
+ function configuredRecommendations(products) {
1029
+ return parseProductReferences(products).map((product) => ({
1030
+ id: product.id,
1031
+ title: product.title || product.id,
1032
+ description: "",
1033
+ imageUrl: product.imageUrl,
1034
+ // 商品引用快照保存 handle;先生成店铺商品地址,渲染卡片时仍需经过 URL 安全检查。
1035
+ href: resolveShopifyRecommendHref(void 0, product.handle),
1036
+ ...product.price ? { price: product.price } : {}
1037
+ }));
1038
+ }
1039
+ function trackingEvents(result) {
1040
+ if (result?.events?.length) return result.events;
1041
+ if (result?.latestEvent) return [{ id: "latest", title: result.latestEvent, at: result.updatedAt, state: "current" }];
1042
+ return [];
1043
+ }
1044
+ function formatRecommendationPrice(price) {
1045
+ if (!price || !Number.isInteger(price.amount)) return "";
1046
+ return `$ ${(price.amount / 100).toFixed(2)}`;
1047
+ }
1048
+ function trackingSteps(result) {
1049
+ return result.progress?.length ? result.progress : defaultProgress(result.status);
1050
+ }
1051
+ function recommendationItems(products, runtime) {
1052
+ const configured = configuredRecommendations(products);
1053
+ return configured.length ? configured : runtime.recommendations.phase === "success" ? runtime.recommendations.items : [];
1054
+ }
1055
+ function trackingSelection(result, recentQueries) {
1056
+ const identity = recentQueries.length > 0 ? { mode: recentQueries[0].mode, values: recentQueries.map((item) => item.value).slice(0, 3) } : { mode: "tracking", values: result.trackingNumber ? [result.trackingNumber] : [] };
1057
+ const shipmentValues = (result.shipments ?? []).map((shipment, index) => shipment.trackingNumber || shipment.label || `shipment #${index + 1}`);
1058
+ return { identity, shipmentValues };
1059
+ }
1060
+ function trackingBlockState({ phase, autoQueryDemo = false }) {
1061
+ return {
1062
+ showResult: phase === "success",
1063
+ showNotFound: phase === "empty",
1064
+ showUnavailable: phase === "error",
1065
+ showProgress: phase === "success" || phase === "empty" || phase === "error",
1066
+ showDelivery: phase === "success" || phase === "error",
1067
+ showEstimatedDelivery: !autoQueryDemo
1068
+ };
1069
+ }
1070
+
1071
+ // src/tracking-runtime.tsx
1072
+ import { jsx } from "react/jsx-runtime";
1073
+ function recentQueryFromRequest(request, result) {
1074
+ if (request.mode === "order") {
1075
+ const value2 = request.orderNumber.trim() || result.orderNumber?.trim() || "";
1076
+ if (!value2) return null;
1077
+ return { mode: "order", value: value2, email: request.email.trim() || void 0, result };
1078
+ }
1079
+ const value = request.trackingNumber.trim() || result.trackingNumber.trim();
1080
+ if (!value) return null;
1081
+ return { mode: "tracking", value, result };
1082
+ }
1083
+ function mergeRecentQueries(previous, next) {
1084
+ if (previous[0] && (previous[0].mode !== next.mode || next.mode === "order" && previous[0].email !== next.email)) return [next];
1085
+ const values = mergeDisplayValues(previous.map((item) => item.value), [next.value]);
1086
+ const byValue = new Map(previous.map((item) => [item.value, item]));
1087
+ byValue.set(next.value, next);
1088
+ return values.flatMap((value) => {
1089
+ const item = byValue.get(value);
1090
+ return item ? [item] : [];
1091
+ });
1092
+ }
1093
+ function resultWithShipment(result, index) {
1094
+ const shipment = result.shipments?.[index];
1095
+ if (!shipment) return result;
1096
+ return {
1097
+ ...result,
1098
+ trackingNumber: shipment.trackingNumber || result.trackingNumber,
1099
+ status: shipment.status || result.status,
1100
+ carrier: shipment.carrier,
1101
+ latestEvent: shipment.latestEvent,
1102
+ updatedAt: shipment.updatedAt,
1103
+ destination: shipment.destination,
1104
+ estimatedDelivery: shipment.estimatedDelivery,
1105
+ progress: shipment.progress ?? result.progress,
1106
+ events: shipment.events ?? result.events,
1107
+ orderItems: shipment.orderItems ?? result.orderItems,
1108
+ ad: shipment.ad ?? result.ad
1109
+ };
1110
+ }
1111
+ var initialRuntime = {
1112
+ phase: "idle",
1113
+ recentQueries: [],
1114
+ selectedRecentIndex: 0,
1115
+ selectionRevision: 0,
1116
+ selectedShipmentIndex: 0,
1117
+ selectRecentQuery() {
1118
+ return void 0;
1119
+ },
1120
+ selectShipment() {
1121
+ return void 0;
1122
+ },
1123
+ recommendations: { phase: "idle", items: [] },
1124
+ autoQueryFromUrl: false,
1125
+ autoQueryDemo: false,
1126
+ reset() {
1127
+ return void 0;
1128
+ },
1129
+ async query() {
1130
+ return void 0;
1131
+ }
1132
+ };
1133
+ var TrackingRuntimeContext = createContext(initialRuntime);
1134
+ async function queryMockTracking(request) {
1135
+ return previewTrackingPageResult(request.mode === "tracking" ? request.trackingNumber : request.orderNumber);
1136
+ }
1137
+ function TrackingRuntimeProvider({ children, query: injectedQuery, queryRecommendations, transport, autoQueryFromUrl, autoQueryDemo = false, watermark, adPreview, resourceResolution }) {
1138
+ const [state, setState] = useState({ phase: "idle" });
1139
+ const [recentQueries, setRecentQueries] = useState([]);
1140
+ const [selectedRecentIndex, setSelectedRecentIndex] = useState(0);
1141
+ const [selectionRevision, setSelectionRevision] = useState(0);
1142
+ const [selectedShipmentIndex, setSelectedShipmentIndex] = useState(0);
1143
+ const requestId = useRef(0);
1144
+ const resolvedQuery = useMemo(() => {
1145
+ if (injectedQuery) return injectedQuery;
1146
+ if (transport) return createShopifyTrackQuery(transport);
1147
+ return void 0;
1148
+ }, [injectedQuery, transport]);
1149
+ const resolvedRecommendations = useMemo(() => {
1150
+ if (queryRecommendations) return queryRecommendations;
1151
+ if (transport) return createShopifyRecommendationsQuery(transport.post);
1152
+ return void 0;
1153
+ }, [queryRecommendations, transport]);
1154
+ const live = Boolean(resolvedQuery);
1155
+ const [recommendationLoad, setRecommendationLoad] = useState(() => ({ source: resolvedRecommendations, state: { phase: resolvedRecommendations ? "loading" : "idle", items: [] } }));
1156
+ const recommendations = useMemo(() => recommendationLoad.source === resolvedRecommendations ? recommendationLoad.state : { phase: resolvedRecommendations ? "loading" : "idle", items: [] }, [recommendationLoad, resolvedRecommendations]);
1157
+ if (recommendationLoad.source !== resolvedRecommendations) {
1158
+ setRecommendationLoad({ source: resolvedRecommendations, state: recommendations });
1159
+ }
1160
+ useEffect(() => {
1161
+ if (!resolvedRecommendations) return;
1162
+ let active = true;
1163
+ void Promise.resolve().then(resolvedRecommendations).then((items) => {
1164
+ if (!active) return;
1165
+ setRecommendationLoad({ source: resolvedRecommendations, state: { phase: items.length ? "success" : "empty", items } });
1166
+ }).catch(() => {
1167
+ if (!active) return;
1168
+ setRecommendationLoad({ source: resolvedRecommendations, state: { phase: "error", items: [] } });
1169
+ });
1170
+ return () => {
1171
+ active = false;
1172
+ };
1173
+ }, [resolvedRecommendations]);
1174
+ const query = useCallback(async (request) => {
1175
+ const currentRequestId = ++requestId.current;
1176
+ setState({ phase: "loading" });
1177
+ try {
1178
+ const result = live ? await resolvedQuery(request) : await queryMockTracking(request);
1179
+ if (currentRequestId !== requestId.current) return;
1180
+ if (isEmptyTrackingPageResult(result)) {
1181
+ setState({ phase: "empty", result });
1182
+ return;
1183
+ }
1184
+ const recent = recentQueryFromRequest(request, result);
1185
+ if (recent) {
1186
+ setRecentQueries((previous) => mergeRecentQueries(previous, recent));
1187
+ setSelectedRecentIndex(0);
1188
+ setSelectedShipmentIndex(0);
1189
+ }
1190
+ setState({ phase: "success", result: resultWithShipment(result, 0) });
1191
+ } catch {
1192
+ if (currentRequestId !== requestId.current) return;
1193
+ setState({ phase: "error", error: "We couldn\u2019t retrieve this order right now. Please try again later." });
1194
+ }
1195
+ }, [live, resolvedQuery]);
1196
+ const selectRecentQuery = useCallback((index) => {
1197
+ const item = recentQueries[index];
1198
+ if (!item) return;
1199
+ requestId.current += 1;
1200
+ setSelectionRevision((revision) => revision + 1);
1201
+ setSelectedRecentIndex(index);
1202
+ setSelectedShipmentIndex(0);
1203
+ setState({ phase: "success", result: resultWithShipment(item.result, 0) });
1204
+ }, [recentQueries]);
1205
+ const selectShipment = useCallback((index) => {
1206
+ const full = recentQueries[selectedRecentIndex]?.result ?? state.result;
1207
+ if (!full?.shipments?.[index]) return;
1208
+ requestId.current += 1;
1209
+ setSelectedShipmentIndex(index);
1210
+ setState({ phase: "success", result: resultWithShipment(full, index) });
1211
+ }, [recentQueries, selectedRecentIndex, state.result]);
1212
+ const reset = useCallback(() => {
1213
+ requestId.current += 1;
1214
+ setState({ phase: "idle" });
1215
+ setRecentQueries([]);
1216
+ setSelectedRecentIndex(0);
1217
+ setSelectedShipmentIndex(0);
1218
+ }, []);
1219
+ const resolveAutoQuery = autoQueryFromUrl ?? Boolean(transport && !injectedQuery);
1220
+ const resolvedWatermark = useMemo(
1221
+ () => watermark ?? { visible: !shouldHidePoweredBy() },
1222
+ [watermark]
1223
+ );
1224
+ const value = useMemo(() => ({
1225
+ ...state,
1226
+ adPreview,
1227
+ resourceResolution,
1228
+ reset,
1229
+ query,
1230
+ recentQueries,
1231
+ selectedRecentIndex,
1232
+ selectionRevision,
1233
+ selectedShipmentIndex,
1234
+ selectRecentQuery,
1235
+ selectShipment,
1236
+ recommendations,
1237
+ autoQueryFromUrl: resolveAutoQuery,
1238
+ autoQueryDemo,
1239
+ watermark: resolvedWatermark
1240
+ }), [adPreview, resourceResolution, reset, autoQueryDemo, query, recentQueries, recommendations, resolveAutoQuery, resolvedWatermark, selectRecentQuery, selectShipment, selectedRecentIndex, selectionRevision, selectedShipmentIndex, state]);
1241
+ return /* @__PURE__ */ jsx(TrackingRuntimeContext.Provider, { value, children });
1242
+ }
1243
+ function useTrackingRuntime() {
1244
+ return useContext(TrackingRuntimeContext);
1245
+ }
1246
+
1247
+ // src/tracking-query-form.ts
1248
+ import { useEffect as useEffect2, useRef as useRef2, useState as useState2 } from "react";
1249
+ function useTrackingQueryForm({ initialTrackingNumber, initialOrderNumber = "", initialMode = "tracking", onComplete, onQuery, phase }) {
1250
+ const runtime = useTrackingRuntime();
1251
+ const query = onQuery ?? runtime.query;
1252
+ const loading = (phase ?? runtime.phase) === "loading";
1253
+ const [locationState] = useState2(() => runtime.autoQueryFromUrl ? readTrackingQueryLocationState() : void 0);
1254
+ const [mode, updateMode] = useState2(locationState?.tab ?? initialMode);
1255
+ const [trackingNumber, setTrackingNumber] = useState2(locationState?.trackingNumber || initialTrackingNumber);
1256
+ const [orderNumber, setOrderNumber] = useState2(locationState?.orderNumber || initialOrderNumber);
1257
+ const [email, setEmail] = useState2(locationState?.email ?? "");
1258
+ const [localError, setLocalError] = useState2("");
1259
+ const [firstInvalidField, setFirstInvalidField] = useState2();
1260
+ const autoQueryStarted = useRef2(false);
1261
+ const previewDemoTrackingNumber = useRef2(trackingNumber);
1262
+ const selected = runtime.recentQueries[runtime.selectedRecentIndex];
1263
+ const [lastSelectionRevision, setLastSelectionRevision] = useState2(runtime.selectionRevision);
1264
+ if (lastSelectionRevision !== runtime.selectionRevision) {
1265
+ setLastSelectionRevision(runtime.selectionRevision);
1266
+ if (selected) {
1267
+ updateMode(selected.mode);
1268
+ setLocalError("");
1269
+ setFirstInvalidField(void 0);
1270
+ if (selected.mode === "tracking") setTrackingNumber(selected.value);
1271
+ else {
1272
+ setOrderNumber(selected.value);
1273
+ setEmail(selected.email ?? "");
1274
+ }
1275
+ }
1276
+ }
1277
+ useEffect2(() => {
1278
+ if (autoQueryStarted.current) return;
1279
+ if (locationState?.canAutoQuery) {
1280
+ autoQueryStarted.current = true;
1281
+ void query(locationState.tab === "tracking" ? { mode: "tracking", trackingNumber: locationState.trackingNumber } : { mode: "order", orderNumber: locationState.orderNumber, email: locationState.email }).finally(onComplete);
1282
+ return;
1283
+ }
1284
+ const demoTrackingNumber = previewDemoTrackingNumber.current.trim();
1285
+ if (!runtime.autoQueryDemo || !demoTrackingNumber) return;
1286
+ autoQueryStarted.current = true;
1287
+ void query({ mode: "tracking", trackingNumber: demoTrackingNumber });
1288
+ }, [locationState, onComplete, query, runtime.autoQueryDemo]);
1289
+ const setMode = (next) => {
1290
+ updateMode(next);
1291
+ setLocalError("");
1292
+ setFirstInvalidField(void 0);
1293
+ };
1294
+ const submit = (event) => {
1295
+ event.preventDefault();
1296
+ if (loading) return;
1297
+ setLocalError("");
1298
+ setFirstInvalidField(void 0);
1299
+ if (mode === "order") {
1300
+ if (!orderNumber.trim() || !email.trim()) {
1301
+ setLocalError("Please enter your order number and email address");
1302
+ setFirstInvalidField(!orderNumber.trim() ? "order" : "email");
1303
+ return;
1304
+ }
1305
+ syncTrackingQueryToUrl("order", orderNumber.trim(), email.trim());
1306
+ void query({ mode: "order", orderNumber: orderNumber.trim(), email: email.trim() }).finally(onComplete);
1307
+ return;
1308
+ }
1309
+ if (!trackingNumber.trim()) {
1310
+ setLocalError("Please enter your tracking number");
1311
+ setFirstInvalidField("tracking");
1312
+ return;
1313
+ }
1314
+ syncTrackingQueryToUrl("tracking", trackingNumber.trim());
1315
+ void query({ mode: "tracking", trackingNumber: trackingNumber.trim() }).finally(onComplete);
1316
+ };
1317
+ return { mode, setMode, trackingNumber, setTrackingNumber, orderNumber, setOrderNumber, email, setEmail, localError, firstInvalidField, loading, submit };
1318
+ }
1319
+
924
1320
  // src/track-page-display.tsx
925
- import { useCallback, useEffect, useMemo, useState } from "react";
1321
+ import { useCallback as useCallback2, useEffect as useEffect3, useMemo as useMemo2, useState as useState3 } from "react";
926
1322
  import Autoplay from "embla-carousel-autoplay";
927
1323
  import useEmblaCarousel from "embla-carousel-react";
928
- import { Fragment, jsx, jsxs } from "react/jsx-runtime";
1324
+ import { Fragment, jsx as jsx2, jsxs } from "react/jsx-runtime";
929
1325
  var pageFont = { fontFamily: "var(--pb-font-family, Inter, system-ui, sans-serif)" };
930
1326
  var contentWidth = {
931
1327
  width: "min(1248px, 100%)",
@@ -958,46 +1354,31 @@ function safeHref(value) {
958
1354
  function safeImageUrl(value) {
959
1355
  return safeTrackingPageUrl(value);
960
1356
  }
961
- function defaultProgress(status) {
962
- const steps = [
963
- { id: "ordered", label: "Ordered", icon: "check" },
964
- { id: "ready", label: "Order Ready", icon: "bag" },
965
- { id: "transit", label: "In Transit", icon: "truck" },
966
- { id: "out", label: "Out for Delivery", icon: "box" },
967
- { id: "delivered", label: "Delivered", icon: "check" }
968
- ];
969
- const normalized = status.toLowerCase();
970
- const current = normalized.includes("deliver") ? normalized.includes("out for") ? 3 : 4 : normalized.includes("transit") ? 2 : normalized.includes("ready") ? 1 : 0;
971
- return steps.map((step, index) => ({
972
- ...step,
973
- state: index < current ? "complete" : index === current ? "current" : "upcoming"
974
- }));
975
- }
976
1357
  function StepIcon({ name, done }) {
977
1358
  const fill = done ? "#ffffff" : "currentColor";
978
1359
  const common = { width: 24, height: 24, viewBox: "0 0 24 24", "aria-hidden": true, style: { width: 24, height: 24, display: "block" } };
979
1360
  if (name === "bag") {
980
1361
  return /* @__PURE__ */ jsxs("svg", { ...common, children: [
981
- /* @__PURE__ */ jsx("path", { fill, d: "M9.9 12.9c0-.239.095-.468.264-.636A.9.9 0 0 1 10.8 12h2.4a.9.9 0 1 1 0 1.8h-2.4a.9.9 0 0 1-.9-.9Z" }),
982
- /* @__PURE__ */ jsx("path", { fill, fillRule: "evenodd", d: "M6.3 4.2a2.1 2.1 0 0 0-2.1 2.1v2.4c0 .714.357 1.344.9 1.723V16.5a3.3 3.3 0 0 0 3.3 3.3h7.2a3.3 3.3 0 0 0 3.3-3.3v-6.077c.543-.379.9-1.009.9-1.723V6.3a2.1 2.1 0 0 0-2.1-2.1H6.3Zm10.8 6.6H6.9V16.5a1.5 1.5 0 0 0 1.5 1.5h7.2a1.5 1.5 0 0 0 1.5-1.5V10.8ZM6 6.3c0-.08.032-.156.088-.212A.3.3 0 0 1 6.3 6h11.4a.3.3 0 0 1 .3.3v2.4a.3.3 0 0 1-.3.3H6.3a.3.3 0 0 1-.3-.3V6.3Z" })
1362
+ /* @__PURE__ */ jsx2("path", { fill, d: "M9.9 12.9c0-.239.095-.468.264-.636A.9.9 0 0 1 10.8 12h2.4a.9.9 0 1 1 0 1.8h-2.4a.9.9 0 0 1-.9-.9Z" }),
1363
+ /* @__PURE__ */ jsx2("path", { fill, fillRule: "evenodd", d: "M6.3 4.2a2.1 2.1 0 0 0-2.1 2.1v2.4c0 .714.357 1.344.9 1.723V16.5a3.3 3.3 0 0 0 3.3 3.3h7.2a3.3 3.3 0 0 0 3.3-3.3v-6.077c.543-.379.9-1.009.9-1.723V6.3a2.1 2.1 0 0 0-2.1-2.1H6.3Zm10.8 6.6H6.9V16.5a1.5 1.5 0 0 0 1.5 1.5h7.2a1.5 1.5 0 0 0 1.5-1.5V10.8ZM6 6.3c0-.08.032-.156.088-.212A.3.3 0 0 1 6.3 6h11.4a.3.3 0 0 1 .3.3v2.4a.3.3 0 0 1-.3.3H6.3a.3.3 0 0 1-.3-.3V6.3Z" })
983
1364
  ] });
984
1365
  }
985
1366
  if (name === "truck") {
986
1367
  return /* @__PURE__ */ jsxs("svg", { ...common, children: [
987
- /* @__PURE__ */ jsx("path", { fill, fillRule: "evenodd", d: "M4.8 6.3c0-.239.095-.468.264-.636A.9.9 0 0 1 5.7 5.4h8.389a3.3 3.3 0 0 1 3.174 2.394l.512 1.793a.6.6 0 0 0 .216.207l2.017.505A2.7 2.7 0 0 1 21.6 12.337V13.8a2.1 2.1 0 0 1-1.238 1.916 3.6 3.6 0 0 1-3.012 3.474 3.6 3.6 0 0 1-4.564-2.29H10.8a3.6 3.6 0 0 1-6.75-.903A3.6 3.6 0 0 1 5.05 15H4.5a.9.9 0 0 1 0-1.8h3a2.7 2.7 0 0 1 2.442 1.5h7.758A3.58 3.58 0 0 1 19.54 14.1a.45.45 0 0 0 .26-.198V12.336a.3.3 0 0 0-.228-.29l-2.018-.504a2.7 2.7 0 0 1-1.56-1.46l-.512-1.793A1.5 1.5 0 0 0 14.09 7.2H5.7a.9.9 0 0 1-.9-.9Zm3 11.1a1.2 1.2 0 1 0 0-2.4 1.2 1.2 0 0 0 0 2.4Zm9.6 0a1.2 1.2 0 1 0 0-2.4 1.2 1.2 0 0 0 0 2.4Z" }),
988
- /* @__PURE__ */ jsx("path", { fill, d: "M3.9 9.6a.9.9 0 0 0 0 1.8h6a.9.9 0 0 0 0-1.8h-6Z" })
1368
+ /* @__PURE__ */ jsx2("path", { fill, fillRule: "evenodd", d: "M4.8 6.3c0-.239.095-.468.264-.636A.9.9 0 0 1 5.7 5.4h8.389a3.3 3.3 0 0 1 3.174 2.394l.512 1.793a.6.6 0 0 0 .216.207l2.017.505A2.7 2.7 0 0 1 21.6 12.337V13.8a2.1 2.1 0 0 1-1.238 1.916 3.6 3.6 0 0 1-3.012 3.474 3.6 3.6 0 0 1-4.564-2.29H10.8a3.6 3.6 0 0 1-6.75-.903A3.6 3.6 0 0 1 5.05 15H4.5a.9.9 0 0 1 0-1.8h3a2.7 2.7 0 0 1 2.442 1.5h7.758A3.58 3.58 0 0 1 19.54 14.1a.45.45 0 0 0 .26-.198V12.336a.3.3 0 0 0-.228-.29l-2.018-.504a2.7 2.7 0 0 1-1.56-1.46l-.512-1.793A1.5 1.5 0 0 0 14.09 7.2H5.7a.9.9 0 0 1-.9-.9Zm3 11.1a1.2 1.2 0 1 0 0-2.4 1.2 1.2 0 0 0 0 2.4Zm9.6 0a1.2 1.2 0 1 0 0-2.4 1.2 1.2 0 0 0 0 2.4Z" }),
1369
+ /* @__PURE__ */ jsx2("path", { fill, d: "M3.9 9.6a.9.9 0 0 0 0 1.8h6a.9.9 0 0 0 0-1.8h-6Z" })
989
1370
  ] });
990
1371
  }
991
1372
  if (name === "box") {
992
1373
  return /* @__PURE__ */ jsxs("svg", { ...common, children: [
993
- /* @__PURE__ */ jsx("path", { fill, d: "M15.995 5.672a1.05 1.05 0 1 0-1.39-1.578l-3.43 4.164-1.126-1.691a1.05 1.05 0 1 0-1.726 1.2l1.576 2.364a1.35 1.35 0 0 0 2.175.096l3.943-4.555Z" }),
994
- /* @__PURE__ */ jsx("path", { fill, fillRule: "evenodd", d: "M5.832 8.26a1.05 1.05 0 0 1 1.221 1.353L6.187 12H9.168a1.65 1.65 0 0 1 1.422 1.026l.191.569a.3.3 0 0 0 .284.205h1.87a.3.3 0 0 0 .284-.204l.191-.57A1.65 1.65 0 0 1 14.832 12H17.813l-.403-2.718a1.05 1.05 0 0 1 1.78-.837 1.05 1.05 0 0 1 .355 1.152L19.686 12.37c.076.51.114 1.023.114 1.538V15.9a3.9 3.9 0 0 1-3.9 3.9H8.1a3.9 3.9 0 0 1-3.9-3.9v-1.992c0-.516.038-1.029.113-1.54l.497-3.35a1.05 1.05 0 0 1 1.022-.828ZM6 13.908V13.8h2.952l.12.364a2.1 2.1 0 0 0 1.992 1.436h1.872a2.1 2.1 0 0 0 1.992-1.436l.12-.364H18v2.1a1.8 1.8 0 0 1-1.8 1.8H8.1A1.8 1.8 0 0 1 6 15.9v-1.992Z" })
1374
+ /* @__PURE__ */ jsx2("path", { fill, d: "M15.995 5.672a1.05 1.05 0 1 0-1.39-1.578l-3.43 4.164-1.126-1.691a1.05 1.05 0 1 0-1.726 1.2l1.576 2.364a1.35 1.35 0 0 0 2.175.096l3.943-4.555Z" }),
1375
+ /* @__PURE__ */ jsx2("path", { fill, fillRule: "evenodd", d: "M5.832 8.26a1.05 1.05 0 0 1 1.221 1.353L6.187 12H9.168a1.65 1.65 0 0 1 1.422 1.026l.191.569a.3.3 0 0 0 .284.205h1.87a.3.3 0 0 0 .284-.204l.191-.57A1.65 1.65 0 0 1 14.832 12H17.813l-.403-2.718a1.05 1.05 0 0 1 1.78-.837 1.05 1.05 0 0 1 .355 1.152L19.686 12.37c.076.51.114 1.023.114 1.538V15.9a3.9 3.9 0 0 1-3.9 3.9H8.1a3.9 3.9 0 0 1-3.9-3.9v-1.992c0-.516.038-1.029.113-1.54l.497-3.35a1.05 1.05 0 0 1 1.022-.828ZM6 13.908V13.8h2.952l.12.364a2.1 2.1 0 0 0 1.992 1.436h1.872a2.1 2.1 0 0 0 1.992-1.436l.12-.364H18v2.1a1.8 1.8 0 0 1-1.8 1.8H8.1A1.8 1.8 0 0 1 6 15.9v-1.992Z" })
995
1376
  ] });
996
1377
  }
997
- return /* @__PURE__ */ jsx("svg", { ...common, children: /* @__PURE__ */ jsx("path", { fill, fillRule: "evenodd", d: "M18.852 6.187a1.05 1.05 0 0 1 .154 1.264l-8.161 10.63a1.35 1.35 0 0 1-2.177.081L4.99 13.444a1.05 1.05 0 0 1 1.431-1.534l3.188 4.176 7.98-10.187a1.05 1.05 0 0 1 1.263-.712Z" }) });
1378
+ return /* @__PURE__ */ jsx2("svg", { ...common, children: /* @__PURE__ */ jsx2("path", { fill, fillRule: "evenodd", d: "M18.852 6.187a1.05 1.05 0 0 1 .154 1.264l-8.161 10.63a1.35 1.35 0 0 1-2.177.081L4.99 13.444a1.05 1.05 0 0 1 1.431-1.534l3.188 4.176 7.98-10.187a1.05 1.05 0 0 1 1.263-.712Z" }) });
998
1379
  }
999
1380
  function ProductImage({ src, alt, size = 60 }) {
1000
- const [failed, setFailed] = useState(false);
1381
+ const [failed, setFailed] = useState3(false);
1001
1382
  const safeSrc = safeImageUrl(src);
1002
1383
  const box = {
1003
1384
  width: size,
@@ -1008,9 +1389,9 @@ function ProductImage({ src, alt, size = 60 }) {
1008
1389
  background: "#f1f5f9"
1009
1390
  };
1010
1391
  if (!safeSrc || failed) {
1011
- return /* @__PURE__ */ jsx("span", { "aria-label": alt + " image unavailable", style: { ...box, display: "grid", placeItems: "center", color: "#94a3b8", fontSize: 12 }, children: alt.slice(0, 1).toUpperCase() });
1392
+ return /* @__PURE__ */ jsx2("span", { "aria-label": alt + " image unavailable", style: { ...box, display: "grid", placeItems: "center", color: "#94a3b8", fontSize: 12 }, children: alt.slice(0, 1).toUpperCase() });
1012
1393
  }
1013
- return /* @__PURE__ */ jsx("img", { src: safeSrc, alt, onError: () => setFailed(true), style: box });
1394
+ return /* @__PURE__ */ jsx2("img", { src: safeSrc, alt, onError: () => setFailed(true), style: box });
1014
1395
  }
1015
1396
  var hexColor = /^#(?:[\da-f]{3}|[\da-f]{4}|[\da-f]{6}|[\da-f]{8})$/i;
1016
1397
  var defaultProgressColor = "#0f172a";
@@ -1021,20 +1402,20 @@ function TrackingProgress({ steps, color }) {
1021
1402
  const active = progressColor(color);
1022
1403
  const cells = Math.max(steps.length, 1);
1023
1404
  return /* @__PURE__ */ jsxs("div", { className: "bt-progress", role: "region", "aria-label": "Delivery progress", style: { marginTop: 32, width: "100%", maxWidth: 1200, marginLeft: "auto", marginRight: "auto", overflow: "visible" }, children: [
1024
- /* @__PURE__ */ jsx("style", { children: trackingProgressStyles }),
1405
+ /* @__PURE__ */ jsx2("style", { children: trackingProgressStyles }),
1025
1406
  /* @__PURE__ */ jsxs("div", { style: { position: "relative", display: "grid", gridTemplateColumns: `repeat(${cells}, minmax(0, 1fr))`, columnGap: 4, width: "100%", alignItems: "start" }, children: [
1026
- cells > 1 ? /* @__PURE__ */ jsx("div", { className: "bt-progress__line", "aria-hidden": "true", style: { position: "absolute", left: `calc(50% / ${cells})`, right: `calc(50% / ${cells})`, height: 6, display: "flex", zIndex: 0, pointerEvents: "none" }, children: steps.slice(0, -1).map((step, index) => {
1407
+ cells > 1 ? /* @__PURE__ */ jsx2("div", { className: "bt-progress__line", "aria-hidden": "true", style: { position: "absolute", left: `calc(50% / ${cells})`, right: `calc(50% / ${cells})`, height: 6, display: "flex", zIndex: 0, pointerEvents: "none" }, children: steps.slice(0, -1).map((step, index) => {
1027
1408
  const done = step.state === "complete" || step.state === "current";
1028
1409
  const nextDone = steps[index + 1]?.state === "complete" || steps[index + 1]?.state === "current";
1029
- return /* @__PURE__ */ jsx("span", { style: { flex: 1, height: 6, borderRadius: 999, background: done && nextDone ? active : `color-mix(in srgb, ${active} 25%, transparent)` } }, step.id + "-line");
1410
+ return /* @__PURE__ */ jsx2("span", { style: { flex: 1, height: 6, borderRadius: 999, background: done && nextDone ? active : `color-mix(in srgb, ${active} 25%, transparent)` } }, step.id + "-line");
1030
1411
  }) }) : null,
1031
1412
  steps.map((step, index) => {
1032
1413
  const done = step.state === "complete" || step.state === "current";
1033
1414
  return /* @__PURE__ */ jsxs("div", { style: { minWidth: 0, display: "flex", flexDirection: "column", alignItems: "center", position: "relative", zIndex: 1 }, children: [
1034
- /* @__PURE__ */ jsx("span", { className: "bt-progress__icon", "aria-label": step.label + " " + step.state, style: { display: "flex", flexShrink: 0, alignItems: "center", justifyContent: "center", borderRadius: 9999, border: `1px solid ${active}`, background: done ? active : "#fff", color: active }, children: /* @__PURE__ */ jsx(StepIcon, { name: step.icon ?? (index === 0 || index === steps.length - 1 ? "check" : index === 1 ? "bag" : index === 2 ? "truck" : "box"), done }) }),
1415
+ /* @__PURE__ */ jsx2("span", { className: "bt-progress__icon", "aria-label": step.label + " " + step.state, style: { display: "flex", flexShrink: 0, alignItems: "center", justifyContent: "center", borderRadius: 9999, border: `1px solid ${active}`, background: done ? active : "#fff", color: active }, children: /* @__PURE__ */ jsx2(StepIcon, { name: step.icon ?? (index === 0 || index === steps.length - 1 ? "check" : index === 1 ? "bag" : index === 2 ? "truck" : "box"), done }) }),
1035
1416
  /* @__PURE__ */ jsxs("div", { className: "bt-progress__copy", style: { width: "100%", maxWidth: "100%", boxSizing: "border-box", textAlign: "center", padding: "0 2px" }, children: [
1036
- /* @__PURE__ */ jsx("p", { className: "bt-progress__label", style: { margin: 0, fontWeight: 500, color: "#334155", overflowWrap: "anywhere", wordBreak: "break-word" }, children: step.label }),
1037
- step.date ? /* @__PURE__ */ jsx("p", { style: { margin: "6px 0 0", fontSize: 12, lineHeight: "16px", color: "#94a3b8", overflowWrap: "anywhere" }, children: step.date }) : null
1417
+ /* @__PURE__ */ jsx2("p", { className: "bt-progress__label", style: { margin: 0, fontWeight: 500, color: "#334155", overflowWrap: "anywhere", wordBreak: "break-word" }, children: step.label }),
1418
+ step.date ? /* @__PURE__ */ jsx2("p", { style: { margin: "6px 0 0", fontSize: 12, lineHeight: "16px", color: "#94a3b8", overflowWrap: "anywhere" }, children: step.date }) : null
1038
1419
  ] })
1039
1420
  ] }, step.id);
1040
1421
  })
@@ -1043,57 +1424,53 @@ function TrackingProgress({ steps, color }) {
1043
1424
  }
1044
1425
  function ShippingTimeline({ events }) {
1045
1426
  if (!events.length) {
1046
- return /* @__PURE__ */ jsx("p", { style: { margin: "16px 0 0", color: "#475569", fontSize: 14 }, children: "Shipping events will appear when the carrier publishes them." });
1427
+ return /* @__PURE__ */ jsx2("p", { style: { margin: "16px 0 0", color: "#475569", fontSize: 14 }, children: "Shipping events will appear when the carrier publishes them." });
1047
1428
  }
1048
- return /* @__PURE__ */ jsx("div", { "aria-label": "Shipping events", style: { marginTop: 16, display: "flex", flexDirection: "column", gap: 20 }, children: events.map((event, index) => {
1429
+ return /* @__PURE__ */ jsx2("div", { "aria-label": "Shipping events", style: { marginTop: 16, display: "flex", flexDirection: "column", gap: 20 }, children: events.map((event, index) => {
1049
1430
  const latest = event.state === "current" || index === 0;
1050
1431
  return /* @__PURE__ */ jsxs("div", { style: { position: "relative", paddingLeft: 28, paddingBottom: index < events.length - 1 ? 20 : 0 }, children: [
1051
- /* @__PURE__ */ jsx("span", { "aria-hidden": "true", style: { position: "absolute", left: 0, top: 2, width: 16, height: 16, borderRadius: 9999, background: latest ? "#16a34a" : "#cbd5e1" } }),
1052
- index < events.length - 1 ? /* @__PURE__ */ jsx("span", { "aria-hidden": "true", style: { position: "absolute", left: 7, top: 20, width: 1, height: "100%", background: "#e2e8f0" } }) : null,
1432
+ /* @__PURE__ */ jsx2("span", { "aria-hidden": "true", style: { position: "absolute", left: 0, top: 2, width: 16, height: 16, borderRadius: 9999, background: latest ? "#16a34a" : "#cbd5e1" } }),
1433
+ index < events.length - 1 ? /* @__PURE__ */ jsx2("span", { "aria-hidden": "true", style: { position: "absolute", left: 7, top: 20, width: 1, height: "100%", background: "#e2e8f0" } }) : null,
1053
1434
  /* @__PURE__ */ jsxs("p", { style: { margin: 0, fontSize: 14, fontWeight: 500, lineHeight: 1.5, color: latest ? "#c01400" : "#64748b" }, children: [
1054
1435
  event.title,
1055
1436
  event.detail ? ", " + event.detail : ""
1056
1437
  ] }),
1057
- event.at ? /* @__PURE__ */ jsx("p", { style: { margin: "4px 0 0", fontSize: 12, lineHeight: 1.5, color: latest ? "rgba(192, 20, 0, 0.8)" : "#94a3b8" }, children: event.at }) : null
1438
+ event.at ? /* @__PURE__ */ jsx2("p", { style: { margin: "4px 0 0", fontSize: 12, lineHeight: 1.5, color: latest ? "rgba(192, 20, 0, 0.8)" : "#94a3b8" }, children: event.at }) : null
1058
1439
  ] }, event.id);
1059
1440
  }) });
1060
1441
  }
1061
1442
  function PackageContents({ items }) {
1062
- if (!items.length) return /* @__PURE__ */ jsx("p", { style: { margin: 0, color: "#64748b", fontSize: 14 }, children: "Package contents are not available for this shipment." });
1063
- return /* @__PURE__ */ jsx("div", { style: { display: "flex", flexDirection: "column", gap: 12 }, children: items.map((item) => {
1443
+ if (!items.length) return /* @__PURE__ */ jsx2("p", { style: { margin: 0, color: "#64748b", fontSize: 14 }, children: "Package contents are not available for this shipment." });
1444
+ return /* @__PURE__ */ jsx2("div", { style: { display: "flex", flexDirection: "column", gap: 12 }, children: items.map((item) => {
1064
1445
  const title = item.title;
1065
1446
  return /* @__PURE__ */ jsxs("article", { style: { display: "flex", alignItems: "center", gap: 12, padding: "8px 0" }, children: [
1066
- /* @__PURE__ */ jsx(ProductImage, { src: item.imageUrl, alt: title }),
1447
+ /* @__PURE__ */ jsx2(ProductImage, { src: item.imageUrl, alt: title }),
1067
1448
  /* @__PURE__ */ jsxs("div", { style: { flex: 1, minWidth: 0 }, children: [
1068
- /* @__PURE__ */ jsx("p", { style: { margin: 0, fontSize: 14, fontWeight: 500, color: "#1e293b", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: title }),
1069
- item.description ? /* @__PURE__ */ jsx("p", { style: { margin: "4px 0 0", fontSize: 13, color: "#64748b" }, children: item.description }) : null,
1449
+ /* @__PURE__ */ jsx2("p", { style: { margin: 0, fontSize: 14, fontWeight: 500, color: "#1e293b", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" }, children: title }),
1450
+ item.description ? /* @__PURE__ */ jsx2("p", { style: { margin: "4px 0 0", fontSize: 13, color: "#64748b" }, children: item.description }) : null,
1070
1451
  /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexWrap: "wrap", alignItems: "center", gap: 8, marginTop: 4 }, children: [
1071
1452
  /* @__PURE__ */ jsxs("p", { style: { margin: 0, fontSize: 13, color: "#64748b" }, children: [
1072
1453
  "x",
1073
1454
  item.quantity
1074
1455
  ] }),
1075
- safeHref(item.href) ? /* @__PURE__ */ jsx("a", { href: safeHref(item.href), style: { display: "inline-flex", minHeight: 32, alignItems: "center", padding: "6px 16px", border: "1px solid #cbd5e1", borderRadius: 6, color: "#1e293b", fontSize: 13, fontWeight: 500, textDecoration: "none" }, children: "Reorder" }) : null
1456
+ safeHref(item.href) ? /* @__PURE__ */ jsx2("a", { href: safeHref(item.href), style: { display: "inline-flex", minHeight: 32, alignItems: "center", padding: "6px 16px", border: "1px solid #cbd5e1", borderRadius: 6, color: "#1e293b", fontSize: 13, fontWeight: 500, textDecoration: "none" }, children: "Reorder" }) : null
1076
1457
  ] })
1077
1458
  ] })
1078
1459
  ] }, item.id);
1079
1460
  }) });
1080
1461
  }
1081
- function formatTrackPageRecommendPrice(price) {
1082
- if (!price || !Number.isInteger(price.amount)) return "";
1083
- return `$ ${(price.amount / 100).toFixed(2)}`;
1084
- }
1085
1462
  function RecommendationCards({ items }) {
1086
- const autoplay = useMemo(() => Autoplay({ delay: 3e3, stopOnInteraction: false, stopOnMouseEnter: true }), []);
1463
+ const autoplay = useMemo2(() => Autoplay({ delay: 3e3, stopOnInteraction: false, stopOnMouseEnter: true }), []);
1087
1464
  const [emblaRef, emblaApi] = useEmblaCarousel({ loop: true, align: "start", slidesToScroll: 1 }, [autoplay]);
1088
- const [canScrollPrev, setCanScrollPrev] = useState(false);
1089
- const [canScrollNext, setCanScrollNext] = useState(false);
1090
- const [hideButtons, setHideButtons] = useState(false);
1091
- const onSelect = useCallback(() => {
1465
+ const [canScrollPrev, setCanScrollPrev] = useState3(false);
1466
+ const [canScrollNext, setCanScrollNext] = useState3(false);
1467
+ const [hideButtons, setHideButtons] = useState3(false);
1468
+ const onSelect = useCallback2(() => {
1092
1469
  if (!emblaApi) return;
1093
1470
  setCanScrollPrev(emblaApi.canScrollPrev());
1094
1471
  setCanScrollNext(emblaApi.canScrollNext());
1095
1472
  }, [emblaApi]);
1096
- useEffect(() => {
1473
+ useEffect3(() => {
1097
1474
  if (!emblaApi) return;
1098
1475
  const frame = window.requestAnimationFrame(onSelect);
1099
1476
  emblaApi.on("select", onSelect);
@@ -1104,7 +1481,7 @@ function RecommendationCards({ items }) {
1104
1481
  emblaApi.off("reInit", onSelect);
1105
1482
  };
1106
1483
  }, [emblaApi, onSelect]);
1107
- useEffect(() => {
1484
+ useEffect3(() => {
1108
1485
  if (typeof window.matchMedia !== "function") return;
1109
1486
  const media = window.matchMedia("(max-width: 768px)");
1110
1487
  const update = () => setHideButtons(media.matches);
@@ -1113,7 +1490,7 @@ function RecommendationCards({ items }) {
1113
1490
  return () => media.removeEventListener("change", update);
1114
1491
  }, []);
1115
1492
  if (items.length === 0) return null;
1116
- const arrow = (points) => /* @__PURE__ */ jsx("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: /* @__PURE__ */ jsx("polyline", { points }) });
1493
+ const arrow = (points) => /* @__PURE__ */ jsx2("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: /* @__PURE__ */ jsx2("polyline", { points }) });
1117
1494
  const buttonStyle = {
1118
1495
  position: "absolute",
1119
1496
  top: 115,
@@ -1132,21 +1509,21 @@ function RecommendationCards({ items }) {
1132
1509
  padding: 0
1133
1510
  };
1134
1511
  return /* @__PURE__ */ jsxs("div", { "aria-label": "Recommended products carousel", style: { position: "relative", marginLeft: "min(48px, 4%)", marginRight: "min(48px, 4%)" }, children: [
1135
- !hideButtons && canScrollPrev ? /* @__PURE__ */ jsx("button", { type: "button", "aria-label": "Previous", onClick: () => emblaApi?.scrollPrev(), style: { ...buttonStyle, left: -40 }, children: arrow("15 18 9 12 15 6") }) : null,
1136
- /* @__PURE__ */ jsx("div", { ref: emblaRef, style: { overflow: "hidden" }, children: /* @__PURE__ */ jsx("div", { style: { display: "flex" }, children: items.map((item) => {
1512
+ !hideButtons && canScrollPrev ? /* @__PURE__ */ jsx2("button", { type: "button", "aria-label": "Previous", onClick: () => emblaApi?.scrollPrev(), style: { ...buttonStyle, left: -40 }, children: arrow("15 18 9 12 15 6") }) : null,
1513
+ /* @__PURE__ */ jsx2("div", { ref: emblaRef, style: { overflow: "hidden" }, children: /* @__PURE__ */ jsx2("div", { style: { display: "flex" }, children: items.map((item) => {
1137
1514
  const href = safeHref(item.href);
1138
- const displayPrice = formatTrackPageRecommendPrice(item.price);
1515
+ const displayPrice = formatRecommendationPrice(item.price);
1139
1516
  const card = /* @__PURE__ */ jsxs(Fragment, { children: [
1140
- /* @__PURE__ */ jsx("div", { style: { width: 262, height: 262, maxWidth: "100%", borderRadius: 8, border: "1px solid #E3E3E3", overflow: "hidden", background: "#f1f5f9" }, children: /* @__PURE__ */ jsx(ProductImage, { src: item.imageUrl, alt: item.title, size: 262 }) }),
1517
+ /* @__PURE__ */ jsx2("div", { style: { width: 262, height: 262, maxWidth: "100%", borderRadius: 8, border: "1px solid #E3E3E3", overflow: "hidden", background: "#f1f5f9" }, children: /* @__PURE__ */ jsx2(ProductImage, { src: item.imageUrl, alt: item.title, size: 262 }) }),
1141
1518
  /* @__PURE__ */ jsxs("div", { style: { padding: "12px 8px", textAlign: "center", fontSize: 14 }, children: [
1142
- /* @__PURE__ */ jsx("p", { style: { margin: 0, color: "#334155" }, children: item.title }),
1143
- displayPrice ? /* @__PURE__ */ jsx("p", { style: { margin: "4px 0 0", fontWeight: 600, color: "#0f172a" }, children: displayPrice }) : null,
1144
- item.description ? /* @__PURE__ */ jsx("p", { style: { margin: "4px 0 0", color: "#64748b", fontSize: 13 }, children: item.description }) : null
1519
+ /* @__PURE__ */ jsx2("p", { style: { margin: 0, color: "#334155" }, children: item.title }),
1520
+ displayPrice ? /* @__PURE__ */ jsx2("p", { style: { margin: "4px 0 0", fontWeight: 600, color: "#0f172a" }, children: displayPrice }) : null,
1521
+ item.description ? /* @__PURE__ */ jsx2("p", { style: { margin: "4px 0 0", color: "#64748b", fontSize: 13 }, children: item.description }) : null
1145
1522
  ] })
1146
1523
  ] });
1147
- return /* @__PURE__ */ jsx("div", { style: { flex: "0 0 286px", minWidth: 0, paddingRight: 24, boxSizing: "border-box" }, children: href ? /* @__PURE__ */ jsx("a", { href, style: { display: "block", width: 262, maxWidth: "100%", textDecoration: "none", color: "inherit" }, children: card }) : /* @__PURE__ */ jsx("div", { style: { width: 262, maxWidth: "100%" }, children: card }) }, item.id);
1524
+ return /* @__PURE__ */ jsx2("div", { style: { flex: "0 0 286px", minWidth: 0, paddingRight: 24, boxSizing: "border-box" }, children: href ? /* @__PURE__ */ jsx2("a", { href, style: { display: "block", width: 262, maxWidth: "100%", textDecoration: "none", color: "inherit" }, children: card }) : /* @__PURE__ */ jsx2("div", { style: { width: 262, maxWidth: "100%" }, children: card }) }, item.id);
1148
1525
  }) }) }),
1149
- !hideButtons && canScrollNext ? /* @__PURE__ */ jsx("button", { type: "button", "aria-label": "Next", onClick: () => emblaApi?.scrollNext(), style: { ...buttonStyle, right: -40 }, children: arrow("9 18 15 12 9 6") }) : null
1526
+ !hideButtons && canScrollNext ? /* @__PURE__ */ jsx2("button", { type: "button", "aria-label": "Next", onClick: () => emblaApi?.scrollNext(), style: { ...buttonStyle, right: -40 }, children: arrow("9 18 15 12 9 6") }) : null
1150
1527
  ] });
1151
1528
  }
1152
1529
  var trackingPageAdSlotStyle = {
@@ -1169,41 +1546,92 @@ var trackingPageAdImageStyle = {
1169
1546
  objectPosition: "center"
1170
1547
  };
1171
1548
  function TrackingPageAdSlot({ ad, disableLink = false }) {
1172
- const [failedUrl, setFailedUrl] = useState();
1549
+ const [failedUrl, setFailedUrl] = useState3();
1173
1550
  const imageUrl = safeImageUrl(ad?.imageUrl);
1174
1551
  if (!imageUrl || failedUrl === imageUrl) return null;
1175
- const content = /* @__PURE__ */ jsx("img", { src: imageUrl, alt: ad?.alt ?? "Promotion", loading: "lazy", onError: () => setFailedUrl(imageUrl), style: trackingPageAdImageStyle });
1552
+ const content = /* @__PURE__ */ jsx2("img", { src: imageUrl, alt: ad?.alt ?? "Promotion", loading: "lazy", onError: () => setFailedUrl(imageUrl), style: trackingPageAdImageStyle });
1176
1553
  const href = safeHref(ad?.href);
1177
- if (!href || disableLink) return /* @__PURE__ */ jsx("div", { "data-tracking-page-ad": true, style: trackingPageAdSlotStyle, children: content });
1178
- return /* @__PURE__ */ jsx("a", { "data-tracking-page-ad": true, href, target: "_blank", rel: "noopener noreferrer", style: trackingPageAdSlotStyle, children: content });
1554
+ if (!href || disableLink) return /* @__PURE__ */ jsx2("div", { "data-tracking-page-ad": true, style: trackingPageAdSlotStyle, children: content });
1555
+ return /* @__PURE__ */ jsx2("a", { "data-tracking-page-ad": true, href, target: "_blank", rel: "noopener noreferrer", style: trackingPageAdSlotStyle, children: content });
1179
1556
  }
1180
1557
  function EstimatedDeliveryCard({ dateText, steps = 5 }) {
1181
1558
  const trackInset = `max(0px, calc(50% / ${Math.max(steps, 1)} - var(--bt-progress-icon, 44px) / 2))`;
1182
1559
  return /* @__PURE__ */ jsxs("div", { "aria-label": "Est. Delivery", className: "bt-edd-card", style: { margin: `16px ${trackInset} 0`, width: "auto", boxSizing: "border-box", border: "1px solid transparent", borderRadius: 10, backgroundColor: "#eaf4ff", padding: "20px 22px 18px", textAlign: "left" }, children: [
1183
- /* @__PURE__ */ jsx("p", { style: { margin: 0, color: "#202124", fontSize: 13, fontWeight: 700, lineHeight: 1.3 }, children: "Est. Delivery" }),
1184
- /* @__PURE__ */ jsx("p", { style: { margin: "6px 0 0", color: "#202124", fontSize: 22, fontWeight: 700, lineHeight: 1.15, letterSpacing: 0, overflowWrap: "anywhere", wordBreak: "break-word" }, children: dateText }),
1185
- /* @__PURE__ */ jsx("p", { style: { margin: "6px 0 0", color: "#5f6368", fontSize: 13, fontWeight: 400, lineHeight: 1.35 }, children: "Estimated time may update as tracking progresses." })
1560
+ /* @__PURE__ */ jsx2("p", { style: { margin: 0, color: "#202124", fontSize: 13, fontWeight: 700, lineHeight: 1.3 }, children: "Est. Delivery" }),
1561
+ /* @__PURE__ */ jsx2("p", { style: { margin: "6px 0 0", color: "#202124", fontSize: 22, fontWeight: 700, lineHeight: 1.15, letterSpacing: 0, overflowWrap: "anywhere", wordBreak: "break-word" }, children: dateText }),
1562
+ /* @__PURE__ */ jsx2("p", { style: { margin: "6px 0 0", color: "#5f6368", fontSize: 13, fontWeight: 400, lineHeight: 1.35 }, children: "Estimated time may update as tracking progresses." })
1563
+ ] });
1564
+ }
1565
+ var orderBadgeRowStyle = {
1566
+ display: "flex",
1567
+ flexWrap: "wrap",
1568
+ alignItems: "center",
1569
+ justifyContent: "center",
1570
+ gap: 12,
1571
+ margin: "0 auto"
1572
+ };
1573
+ var orderBadgeStyle = (active) => ({
1574
+ appearance: "none",
1575
+ height: 36,
1576
+ minWidth: 128,
1577
+ borderRadius: 8,
1578
+ border: `1px solid ${active ? "#c01400" : "#cbd5e1"}`,
1579
+ padding: "0 16px",
1580
+ font: "inherit",
1581
+ fontSize: 14,
1582
+ fontWeight: 600,
1583
+ color: active ? "#c01400" : "#64748b",
1584
+ background: "transparent",
1585
+ cursor: "pointer"
1586
+ });
1587
+ function TrackPageOrderBadges({
1588
+ values,
1589
+ selectedIndex,
1590
+ onSelect,
1591
+ style
1592
+ }) {
1593
+ if (values.length === 0) return null;
1594
+ return /* @__PURE__ */ jsx2("div", { style: { ...orderBadgeRowStyle, ...style }, children: values.map((value, index) => {
1595
+ const active = selectedIndex === index;
1596
+ return /* @__PURE__ */ jsx2(
1597
+ "button",
1598
+ {
1599
+ type: "button",
1600
+ "aria-pressed": active,
1601
+ onClick: () => onSelect(index),
1602
+ style: orderBadgeStyle(active),
1603
+ children: value
1604
+ },
1605
+ `${value}-${index}`
1606
+ );
1607
+ }) });
1608
+ }
1609
+ function TrackPageQueryNumber({ mode, value }) {
1610
+ return /* @__PURE__ */ jsxs("p", { style: { margin: 0, fontSize: 20, fontWeight: 400, lineHeight: 1.4, color: "#000", overflowWrap: "anywhere" }, children: [
1611
+ mode === "order" ? "Order" : "Tracking",
1612
+ ": ",
1613
+ value
1186
1614
  ] });
1187
1615
  }
1188
1616
  function SectionShell({ title, children, bordered = true, resultAnchor = false }) {
1189
- return /* @__PURE__ */ jsx("section", { "aria-label": title, "data-tracking-result": resultAnchor ? "" : void 0, style: { ...pageFont, background: "var(--pb-color-background, #fff)", color: "var(--pb-color-text, #0f172a)", borderBottom: bordered ? "1px solid #f1f5f9" : "0" }, children });
1617
+ return /* @__PURE__ */ jsx2("section", { "aria-label": title, "data-tracking-result": resultAnchor ? "" : void 0, style: { ...pageFont, background: "var(--pb-color-background, #fff)", color: "var(--pb-color-text, #0f172a)", borderBottom: bordered ? "1px solid #f1f5f9" : "0" }, children });
1190
1618
  }
1191
1619
 
1192
1620
  // src/shopify-track-page/assets/not-found.png.ts
1193
1621
  var not_found_png_default = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAcQAAAHECAYAAACnX1ofAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAOdEVYdFNvZnR3YXJlAEZpZ21hnrGWYwAAWjpJREFUeAHtvXm0JFd95/mLfO/VvrxXVIEkSqoHEosQA8IgL6wlPGx22wJmEHOGthF9OGPTPm6QfQ7HhralOnRzZuZMj4E/2kvTM9IMZppljIQHs9nWAyyMG2SEDYhFy5NAQiUVqirVpqpXL2Pu9+b9Rf7iZmS+93KLiMzvp05WZEbciIyIfDd+97deEUIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEE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588ny8nJ62WWXCd7Pzs6md999t2+Hdd3QNouLi35/XY997P6bN2/236Pb7We0s99rj63HiY+3nnPENpyXbacmL73u+BrQFuemAw09rj0HPUa3+6Jti9Dr1uOcOnWqoddctJ+ei72Htl3RfdD39t7b841/M7uP3gPbzh4rXme/w/6+em5Y6vHQBteL993+1uwx9Rjbt29vFv0ewP6Odr29j/HfkV1XtB3nifV63HD/RAcgdgBhtVpjIgepDlpBeB8LQArECkKBWDGKTKXABDBgkRi/RxZUEExlNsBD9H3o9Hgw4gHkNQ88ALHNPaCS/fv3+8Y//vGPsx3ddv/leDBhPdroUtHP+uDTtrr/uXPnGg6/DW30u+zxtK3d15yP1wxs26L99fa5ddm16/fZ69Bzxrr4uouuy9JsNpNNmzY17bEsdh98d7c2eq3x53AtabjGxN7bsN1fH87joYceyh6ovc5bj3nRRRdlv4O9fr1n2s68l26/k9sPbxPbRu9//D1FfzPmvOLr67geey/t8fSexfcmvgfxtRRdl54DrssdV8L1+fd6fBXiKjBjjRx9D+/VvGq1RhCCpixpQSAOKRn+IhXCRsQFbTC1WqEGxmhQwL333puLEoYZyGo+QQvwh4yFh3tw+Ycqlqurq8nhw4flKU95iujSgnVA18/MzKTYB0t8Dvunbrs/jjtm6o6doD3a4D3Woa1db/d120W36/4ShAOOa7+36Nzs8e32+Fz0+/S44b3/Tj22nrM9f2k97PUccVzRe6D72Ws31yD2erCfbtf7btvY8yi61/huvR9F567rwu65c47ui+j9j++rPW50P/368HeS6j3Qfewx9Rj2vkf3396P7Lcw15b9vcXfFf8thHuYmbLt7xb/rYX1/vt0vfm7aeoxpDU48B9U2EI49hKQkc/YBiWl2ocjwUihWDH4a1SLjgRujedWYQg0IAa+DfWFuM7ZUK1DR7rQzvDZPsDtsaFpuGP5925k65ftANY0OXLkiI568Z26TPbu3evbuu1+ic9o65aJ+kYisy8CLsRut8cxx8oeathmj4Xtui7eN2nXBUg1aMh89k3iSE0TWJR9p1kv8bXg+/W4eq5oE1+j3q843F7Pseh+6L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IIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQsh08P8D6wH8vd+UWaQAAAAASUVORK5CYII=";
1194
1622
 
1195
1623
  // src/tracking-not-found.tsx
1196
- import { jsx as jsx2, jsxs as jsxs2 } from "react/jsx-runtime";
1624
+ import { jsx as jsx3, jsxs as jsxs2 } from "react/jsx-runtime";
1197
1625
  function TrackingNotFound({ resultAnchor = false } = {}) {
1198
1626
  return /* @__PURE__ */ jsxs2("section", { "aria-label": "Order not found", role: "status", "data-tracking-result": resultAnchor ? "" : void 0, style: { display: "flex", flexDirection: "column", alignItems: "center", justifyContent: "center", padding: "80px 24px", gap: 16 }, children: [
1199
- /* @__PURE__ */ jsx2("img", { src: not_found_png_default, alt: "", width: 180, height: 180, style: { width: 180, height: 180, objectFit: "contain" } }),
1200
- /* @__PURE__ */ jsx2("p", { style: { margin: 0, fontSize: 16, fontWeight: 500, color: "#475569" }, children: "Can not find order" })
1627
+ /* @__PURE__ */ jsx3("img", { src: not_found_png_default, alt: "", width: 180, height: 180, style: { width: 180, height: 180, objectFit: "contain" } }),
1628
+ /* @__PURE__ */ jsx3("p", { style: { margin: 0, fontSize: 16, fontWeight: 500, color: "#475569" }, children: "Can not find order" })
1201
1629
  ] });
1202
1630
  }
1203
1631
 
1204
1632
  // src/tracking-loading.tsx
1205
1633
  import { useId } from "react";
1206
- import { Fragment as Fragment2, jsx as jsx3, jsxs as jsxs3 } from "react/jsx-runtime";
1634
+ import { Fragment as Fragment2, jsx as jsx4, jsxs as jsxs3 } from "react/jsx-runtime";
1207
1635
  var loadingStyles = `
1208
1636
  @keyframes bt-tracking-pin-float {
1209
1637
  0%, 100% { transform: translateY(-1px); }
@@ -1221,129 +1649,43 @@ var loadingStyles = `
1221
1649
  function TrackingLoading() {
1222
1650
  const id = useId();
1223
1651
  return /* @__PURE__ */ jsxs3(Fragment2, { children: [
1224
- /* @__PURE__ */ jsx3("style", { children: loadingStyles }),
1652
+ /* @__PURE__ */ jsx4("style", { children: loadingStyles }),
1225
1653
  /* @__PURE__ */ jsxs3("div", { role: "status", "aria-label": "\u67E5\u8BE2\u4E2D...", "aria-live": "polite", "aria-atomic": "true", style: { display: "flex", flexDirection: "column", alignItems: "center", gap: 16, marginTop: 56, paddingBottom: 8, textAlign: "center" }, children: [
1226
- /* @__PURE__ */ jsx3("p", { style: { margin: 0, color: "var(--pb-color-muted, #64748b)", fontSize: 14, fontWeight: 400, lineHeight: "20px" }, children: "\u67E5\u8BE2\u4E2D..." }),
1654
+ /* @__PURE__ */ jsx4("p", { style: { margin: 0, color: "var(--pb-color-muted, #64748b)", fontSize: 14, fontWeight: 400, lineHeight: "20px" }, children: "\u67E5\u8BE2\u4E2D..." }),
1227
1655
  /* @__PURE__ */ jsxs3("svg", { width: "56", height: "64", viewBox: "0 0 56 64", fill: "none", "aria-hidden": "true", focusable: "false", style: { display: "block", flexShrink: 0, overflow: "visible" }, children: [
1228
1656
  /* @__PURE__ */ jsxs3("defs", { children: [
1229
1657
  /* @__PURE__ */ jsxs3("linearGradient", { id: `${id}-top`, x1: "10", y1: "28", x2: "44", y2: "40", gradientUnits: "userSpaceOnUse", children: [
1230
- /* @__PURE__ */ jsx3("stop", { stopColor: "#FFF0DA" }),
1231
- /* @__PURE__ */ jsx3("stop", { offset: "1", stopColor: "#EABD8E" })
1658
+ /* @__PURE__ */ jsx4("stop", { stopColor: "#FFF0DA" }),
1659
+ /* @__PURE__ */ jsx4("stop", { offset: "1", stopColor: "#EABD8E" })
1232
1660
  ] }),
1233
1661
  /* @__PURE__ */ jsxs3("linearGradient", { id: `${id}-left`, x1: "11", y1: "35", x2: "29", y2: "60", gradientUnits: "userSpaceOnUse", children: [
1234
- /* @__PURE__ */ jsx3("stop", { stopColor: "#FFE8CD" }),
1235
- /* @__PURE__ */ jsx3("stop", { offset: "1", stopColor: "#F3C79C" })
1662
+ /* @__PURE__ */ jsx4("stop", { stopColor: "#FFE8CD" }),
1663
+ /* @__PURE__ */ jsx4("stop", { offset: "1", stopColor: "#F3C79C" })
1236
1664
  ] }),
1237
1665
  /* @__PURE__ */ jsxs3("linearGradient", { id: `${id}-right`, x1: "28", y1: "40", x2: "45", y2: "52", gradientUnits: "userSpaceOnUse", children: [
1238
- /* @__PURE__ */ jsx3("stop", { stopColor: "#F8D2AA" }),
1239
- /* @__PURE__ */ jsx3("stop", { offset: "1", stopColor: "#DCA574" })
1666
+ /* @__PURE__ */ jsx4("stop", { stopColor: "#F8D2AA" }),
1667
+ /* @__PURE__ */ jsx4("stop", { offset: "1", stopColor: "#DCA574" })
1240
1668
  ] }),
1241
1669
  /* @__PURE__ */ jsxs3("linearGradient", { id: `${id}-pin`, x1: "21", y1: "8", x2: "35", y2: "25", gradientUnits: "userSpaceOnUse", children: [
1242
- /* @__PURE__ */ jsx3("stop", { stopColor: "#FFD18A" }),
1243
- /* @__PURE__ */ jsx3("stop", { offset: "1", stopColor: "#F6A34A" })
1670
+ /* @__PURE__ */ jsx4("stop", { stopColor: "#FFD18A" }),
1671
+ /* @__PURE__ */ jsx4("stop", { offset: "1", stopColor: "#F6A34A" })
1244
1672
  ] })
1245
1673
  ] }),
1246
- /* @__PURE__ */ jsx3("path", { d: "m11 35 17-10 17 10-17 10-17-10Z", fill: `url(#${id}-top)` }),
1247
- /* @__PURE__ */ jsx3("path", { d: "M11 35v19l17 10V45L11 35Z", fill: `url(#${id}-left)` }),
1248
- /* @__PURE__ */ jsx3("path", { d: "M28 45v19l17-10V35L28 45Z", fill: `url(#${id}-right)` }),
1249
- /* @__PURE__ */ jsx3("path", { d: "m18 31 17 10v19l4-2V39L22 29l-4 2Z", fill: "#FFF3E0", fillOpacity: ".6" }),
1250
- /* @__PURE__ */ jsx3("path", { d: "M11 35 28 45 45 35M28 45v19", stroke: "#FFF8EC", strokeOpacity: ".35", strokeWidth: ".7" }),
1251
- /* @__PURE__ */ jsx3("g", { className: "bt-tracking-loading__pin", children: /* @__PURE__ */ jsx3("path", { d: "M28 8a7 7 0 0 0-7 7c0 5 7 12 7 12s7-7 7-12a7 7 0 0 0-7-7Zm0 4a3 3 0 1 1 0 6 3 3 0 0 1 0-6Z", fill: `url(#${id}-pin)`, fillRule: "evenodd" }) })
1674
+ /* @__PURE__ */ jsx4("path", { d: "m11 35 17-10 17 10-17 10-17-10Z", fill: `url(#${id}-top)` }),
1675
+ /* @__PURE__ */ jsx4("path", { d: "M11 35v19l17 10V45L11 35Z", fill: `url(#${id}-left)` }),
1676
+ /* @__PURE__ */ jsx4("path", { d: "M28 45v19l17-10V35L28 45Z", fill: `url(#${id}-right)` }),
1677
+ /* @__PURE__ */ jsx4("path", { d: "m18 31 17 10v19l4-2V39L22 29l-4 2Z", fill: "#FFF3E0", fillOpacity: ".6" }),
1678
+ /* @__PURE__ */ jsx4("path", { d: "M11 35 28 45 45 35M28 45v19", stroke: "#FFF8EC", strokeOpacity: ".35", strokeWidth: ".7" }),
1679
+ /* @__PURE__ */ jsx4("g", { className: "bt-tracking-loading__pin", children: /* @__PURE__ */ jsx4("path", { d: "M28 8a7 7 0 0 0-7 7c0 5 7 12 7 12s7-7 7-12a7 7 0 0 0-7-7Zm0 4a3 3 0 1 1 0 6 3 3 0 0 1 0-6Z", fill: `url(#${id}-pin)`, fillRule: "evenodd" }) })
1252
1680
  ] })
1253
1681
  ] })
1254
1682
  ] });
1255
1683
  }
1256
1684
 
1257
1685
  // src/ready-to-go.tsx
1258
- import { Fragment as Fragment3, jsx as jsx4, jsxs as jsxs4 } from "react/jsx-runtime";
1259
- var initialRuntime = {
1260
- phase: "idle",
1261
- recommendations: { phase: "idle", items: [] },
1262
- autoQueryFromUrl: false,
1263
- autoQueryDemo: false,
1264
- async query() {
1265
- return void 0;
1266
- }
1267
- };
1268
- var ReadyToGoRuntimeContext = createContext(initialRuntime);
1269
- function previewReadyToGoTracking(trackingNumber = "BT-2048-DEMO") {
1270
- return {
1271
- trackingNumber,
1272
- status: "In transit",
1273
- carrier: "BestTrack demo carrier",
1274
- latestEvent: "Shipment accepted at the regional hub",
1275
- updatedAt: "Sep 17, 10:00 AM",
1276
- destination: "Shanghai",
1277
- estimatedDelivery: "Sep 22 - Sep 24",
1278
- progress: defaultProgress("In transit"),
1279
- events: [
1280
- { id: "hub", title: "Shipment accepted at the regional hub", at: "Sep 17, 10:00 AM", state: "current" },
1281
- { id: "info", title: "The order has been placed and confirmed.", at: "Sep 16, 3:31 PM", state: "complete" }
1282
- ],
1283
- orderItems: [{ id: "demo-order-item", title: "Demo shipment item", quantity: 1, description: "Product details are available in your order." }],
1284
- recommendations: [
1285
- { id: "shipping-protection", title: "Shipping protection", description: "Extra assurance for your next delivery.", price: { amount: 900, currencyCode: "USD" } },
1286
- { id: "delivery-alerts", title: "Delivery alerts", description: "Receive an update at every milestone.", price: { amount: 400, currencyCode: "USD" } }
1287
- ]
1288
- };
1289
- }
1290
- async function queryMockReadyToGoTracking(request) {
1291
- return previewReadyToGoTracking(request.mode === "tracking" ? request.trackingNumber : request.orderNumber);
1292
- }
1293
- function ReadyToGoRuntimeProvider({ children, query: injectedQuery, queryRecommendations, transport, autoQueryFromUrl, autoQueryDemo = false, watermark, adPreview }) {
1294
- const [state, setState] = useState2({ phase: "idle" });
1295
- const [recommendations, setRecommendations] = useState2(() => queryRecommendations || transport ? { phase: "loading", items: [] } : { phase: "idle", items: [] });
1296
- const requestId = useRef(0);
1297
- const resolvedQuery = useMemo2(() => {
1298
- if (injectedQuery) return injectedQuery;
1299
- if (transport) return createShopifyTrackQuery(transport);
1300
- return void 0;
1301
- }, [injectedQuery, transport]);
1302
- const resolvedRecommendations = useMemo2(() => {
1303
- if (queryRecommendations) return queryRecommendations;
1304
- if (transport) return createShopifyRecommendationsQuery(transport.post);
1305
- return void 0;
1306
- }, [queryRecommendations, transport]);
1307
- const live = Boolean(resolvedQuery);
1308
- useEffect2(() => {
1309
- if (!resolvedRecommendations) return;
1310
- let active = true;
1311
- void resolvedRecommendations().then((items) => {
1312
- if (!active) return;
1313
- setRecommendations({ phase: items.length ? "success" : "empty", items });
1314
- }).catch(() => {
1315
- if (!active) return;
1316
- setRecommendations({ phase: "error", items: [] });
1317
- });
1318
- return () => {
1319
- active = false;
1320
- };
1321
- }, [resolvedRecommendations]);
1322
- const query = useCallback2(async (request) => {
1323
- const currentRequestId = ++requestId.current;
1324
- setState({ phase: "loading" });
1325
- try {
1326
- const result = live ? await resolvedQuery(request) : await queryMockReadyToGoTracking(request);
1327
- if (currentRequestId !== requestId.current) return;
1328
- setState({ phase: isEmptyTrackingPageResult(result) ? "empty" : "success", result });
1329
- } catch {
1330
- if (currentRequestId !== requestId.current) return;
1331
- setState({ phase: "error", error: "We couldn\u2019t retrieve this order right now. Please try again later." });
1332
- }
1333
- }, [live, resolvedQuery]);
1334
- const resolveAutoQuery = autoQueryFromUrl ?? Boolean(transport && !injectedQuery);
1335
- const resolvedWatermark = useMemo2(
1336
- () => watermark ?? { visible: !shouldHidePoweredBy() },
1337
- [watermark]
1338
- );
1339
- const value = useMemo2(() => ({ ...state, adPreview, query, recommendations, autoQueryFromUrl: resolveAutoQuery, autoQueryDemo, watermark: resolvedWatermark }), [adPreview, autoQueryDemo, query, recommendations, resolveAutoQuery, resolvedWatermark, state]);
1340
- return /* @__PURE__ */ jsx4(ReadyToGoRuntimeContext.Provider, { value, children });
1341
- }
1342
- function useReadyToGoRuntime() {
1343
- return useContext(ReadyToGoRuntimeContext);
1344
- }
1686
+ import { Fragment as Fragment3, jsx as jsx5, jsxs as jsxs4 } from "react/jsx-runtime";
1345
1687
  function RuntimeWatermark({ watermark }) {
1346
- return watermark?.visible ? /* @__PURE__ */ jsx4("small", { style: { display: "block", marginTop: "auto", paddingTop: 28, textAlign: "center", fontSize: 12, lineHeight: "17px", fontStyle: "italic", color: "#b8b8b8" }, children: watermark.label || "Powered by BestTrack" }) : null;
1688
+ return watermark?.visible ? /* @__PURE__ */ jsx5("small", { style: { display: "block", marginTop: "auto", paddingTop: 28, textAlign: "center", fontSize: 12, lineHeight: "17px", fontStyle: "italic", color: "#b8b8b8" }, children: watermark.label || "Powered by BestTrack" }) : null;
1347
1689
  }
1348
1690
  var heroStyle = {
1349
1691
  ...pageFont,
@@ -1435,12 +1777,12 @@ function submitButtonStyle(props, loading = false) {
1435
1777
  };
1436
1778
  }
1437
1779
  function ReadyToGoTextField({ value, onChange }) {
1438
- return /* @__PURE__ */ jsx4("input", { "aria-label": "Ready-to-go text", value: typeof value === "string" ? value : "", onChange: (event) => onChange(event.target.value) });
1780
+ return /* @__PURE__ */ jsx5("input", { "aria-label": "Ready-to-go text", value: typeof value === "string" ? value : "", onChange: (event) => onChange(event.target.value) });
1439
1781
  }
1440
1782
  function InlineText({ block, name, fallback }) {
1441
1783
  const value = text(block, name, fallback);
1442
- if (!block.selected) return /* @__PURE__ */ jsx4("span", { "data-ready-to-go-editor-field": name, children: value });
1443
- return /* @__PURE__ */ jsx4(
1784
+ if (!block.selected) return /* @__PURE__ */ jsx5("span", { "data-ready-to-go-editor-field": name, children: value });
1785
+ return /* @__PURE__ */ jsx5(
1444
1786
  "input",
1445
1787
  {
1446
1788
  "aria-label": "Canvas " + name,
@@ -1469,53 +1811,56 @@ function InlineText({ block, name, fallback }) {
1469
1811
  }
1470
1812
  );
1471
1813
  }
1472
- function eventsFrom(result) {
1473
- if (result?.events?.length) return result.events;
1474
- if (result?.latestEvent) return [{ id: "latest", title: result.latestEvent, at: result.updatedAt, state: "current" }];
1475
- return [];
1476
- }
1477
- function ProgressResult({ result, showEstimatedDelivery = true, color }) {
1478
- const steps = result.progress?.length ? result.progress : defaultProgress(result.status);
1814
+ function ProgressResult({
1815
+ result,
1816
+ showEstimatedDelivery = true,
1817
+ color,
1818
+ recentQueries = [],
1819
+ selectedRecentIndex = 0,
1820
+ onSelectRecent,
1821
+ selectedShipmentIndex = 0,
1822
+ onSelectShipment
1823
+ }) {
1824
+ const steps = trackingSteps(result);
1825
+ const { identity, shipmentValues } = trackingSelection(result, recentQueries);
1479
1826
  return /* @__PURE__ */ jsxs4(Fragment3, { children: [
1480
- /* @__PURE__ */ jsxs4("p", { style: { margin: 0, fontSize: 20, lineHeight: 1.4, color: "#000", overflowWrap: "anywhere" }, children: [
1481
- "Tracking: ",
1482
- result.trackingNumber
1483
- ] }),
1484
- /* @__PURE__ */ jsx4("h2", { style: { margin: "clamp(24px, 8%, 48px) 0 0", fontSize: 32, lineHeight: 1.25, fontWeight: 700, color: "#303030", overflowWrap: "anywhere" }, children: result.status }),
1827
+ identity.values.length > 1 && onSelectRecent ? /* @__PURE__ */ jsx5(TrackPageOrderBadges, { values: identity.values.slice(0, 3), selectedIndex: selectedRecentIndex, onSelect: onSelectRecent }) : identity.values[0] ? /* @__PURE__ */ jsx5(TrackPageQueryNumber, { mode: identity.mode, value: identity.values[0] }) : null,
1828
+ shipmentValues.length > 1 && onSelectShipment ? /* @__PURE__ */ jsx5(TrackPageOrderBadges, { values: shipmentValues, selectedIndex: selectedShipmentIndex, onSelect: onSelectShipment, style: { marginTop: 8 } }) : null,
1829
+ /* @__PURE__ */ jsx5("h2", { style: { margin: "clamp(24px, 8%, 48px) 0 0", fontSize: 32, lineHeight: 1.25, fontWeight: 700, color: "#303030", overflowWrap: "anywhere" }, children: result.status }),
1485
1830
  /* @__PURE__ */ jsxs4("div", { className: "bt-progress-band", children: [
1486
- showEstimatedDelivery && result.estimatedDelivery ? /* @__PURE__ */ jsx4(EstimatedDeliveryCard, { dateText: result.estimatedDelivery, steps: steps.length }) : null,
1487
- /* @__PURE__ */ jsx4(TrackingProgress, { steps, color })
1831
+ showEstimatedDelivery && result.estimatedDelivery ? /* @__PURE__ */ jsx5(EstimatedDeliveryCard, { dateText: result.estimatedDelivery, steps: steps.length }) : null,
1832
+ /* @__PURE__ */ jsx5(TrackingProgress, { steps, color })
1488
1833
  ] })
1489
1834
  ] });
1490
1835
  }
1491
1836
  function DeliveryResult({ heading, contentsHeading, carrierHeading, result, editing }) {
1492
1837
  return /* @__PURE__ */ jsxs4("div", { style: { ...contentWidth, display: "grid", gridTemplateColumns: "repeat(auto-fit, minmax(min(100%, 280px), 500px))", gap: 40, justifyContent: "center", alignItems: "start" }, children: [
1493
1838
  /* @__PURE__ */ jsxs4("div", { children: [
1494
- /* @__PURE__ */ jsx4("h3", { style: { margin: 0, fontSize: 20, lineHeight: "20px", fontWeight: 700 }, children: heading }),
1495
- /* @__PURE__ */ jsx4(ShippingTimeline, { events: eventsFrom(result) })
1839
+ /* @__PURE__ */ jsx5("h3", { style: { margin: 0, fontSize: 20, lineHeight: "20px", fontWeight: 700 }, children: heading }),
1840
+ /* @__PURE__ */ jsx5(ShippingTimeline, { events: trackingEvents(result) })
1496
1841
  ] }),
1497
1842
  /* @__PURE__ */ jsxs4("div", { style: { display: "flex", flexDirection: "column", gap: 24 }, children: [
1498
- /* @__PURE__ */ jsx4(TrackingPageAdSlot, { ad: result.ad, disableLink: editing }),
1843
+ /* @__PURE__ */ jsx5(TrackingPageAdSlot, { ad: result.ad, disableLink: editing }),
1499
1844
  /* @__PURE__ */ jsxs4("div", { children: [
1500
- /* @__PURE__ */ jsx4("h3", { style: { margin: "0 0 12px", fontSize: 18, fontWeight: 700 }, children: contentsHeading }),
1501
- /* @__PURE__ */ jsx4(PackageContents, { items: result.orderItems ?? [] })
1845
+ /* @__PURE__ */ jsx5("h3", { style: { margin: "0 0 12px", fontSize: 18, fontWeight: 700 }, children: contentsHeading }),
1846
+ /* @__PURE__ */ jsx5(PackageContents, { items: result.orderItems ?? [] })
1502
1847
  ] }),
1503
1848
  /* @__PURE__ */ jsxs4("div", { children: [
1504
- /* @__PURE__ */ jsx4("h3", { style: { margin: "0 0 12px", fontSize: 18, fontWeight: 700 }, children: carrierHeading }),
1505
- /* @__PURE__ */ jsx4("p", { style: { margin: 0, fontSize: 14, fontWeight: 600, color: "#1e293b" }, children: result.carrier ?? "Not available" }),
1506
- /* @__PURE__ */ jsx4("p", { style: { margin: "8px 0 0", fontSize: 14, color: "#64748b" }, children: result.destination ?? "Destination details are not available." })
1849
+ /* @__PURE__ */ jsx5("h3", { style: { margin: "0 0 12px", fontSize: 18, fontWeight: 700 }, children: carrierHeading }),
1850
+ /* @__PURE__ */ jsx5("p", { style: { margin: 0, fontSize: 14, fontWeight: 600, color: "#1e293b" }, children: result.carrier ?? "Not available" }),
1851
+ /* @__PURE__ */ jsx5("p", { style: { margin: "8px 0 0", fontSize: 14, color: "#64748b" }, children: result.destination ?? "Destination details are not available." })
1507
1852
  ] })
1508
1853
  ] })
1509
1854
  ] });
1510
1855
  }
1511
1856
  function ReadyToGoQueryEditor(block) {
1512
- return /* @__PURE__ */ jsx4("section", { "aria-label": "Ready-to-go query editor", style: editorHeroStyle, children: /* @__PURE__ */ jsxs4("div", { role: "region", "aria-label": "Ready-to-go tracking query", style: editorFormCardStyle, children: [
1857
+ return /* @__PURE__ */ jsx5("section", { "aria-label": "Ready-to-go query editor", style: editorHeroStyle, children: /* @__PURE__ */ jsxs4("div", { role: "region", "aria-label": "Ready-to-go tracking query", style: editorFormCardStyle, children: [
1513
1858
  /* @__PURE__ */ jsxs4("div", { style: { display: "flex", width: "100%", borderBottom: "1px solid #cbd5e1" }, children: [
1514
- /* @__PURE__ */ jsx4("div", { style: { ...tabStyle(true), display: "flex", alignItems: "center", justifyContent: "center", cursor: "default" }, children: /* @__PURE__ */ jsx4(InlineText, { block, name: "trackingTabLabel", fallback: "Tracking Number" }) }),
1515
- /* @__PURE__ */ jsx4("div", { style: { ...tabStyle(false), display: "flex", alignItems: "center", justifyContent: "center", cursor: "default" }, children: /* @__PURE__ */ jsx4(InlineText, { block, name: "orderTabLabel", fallback: "Order Number" }) })
1859
+ /* @__PURE__ */ jsx5("div", { style: { ...tabStyle(true), display: "flex", alignItems: "center", justifyContent: "center", cursor: "default" }, children: /* @__PURE__ */ jsx5(InlineText, { block, name: "trackingTabLabel", fallback: "Tracking Number" }) }),
1860
+ /* @__PURE__ */ jsx5("div", { style: { ...tabStyle(false), display: "flex", alignItems: "center", justifyContent: "center", cursor: "default" }, children: /* @__PURE__ */ jsx5(InlineText, { block, name: "orderTabLabel", fallback: "Order Number" }) })
1516
1861
  ] }),
1517
1862
  /* @__PURE__ */ jsxs4("div", { style: { marginTop: 24, display: "flex", flexDirection: "column", gap: 16, flex: 1 }, children: [
1518
- /* @__PURE__ */ jsx4(
1863
+ /* @__PURE__ */ jsx5(
1519
1864
  "input",
1520
1865
  {
1521
1866
  "aria-label": "Canvas default tracking number",
@@ -1530,153 +1875,113 @@ function ReadyToGoQueryEditor(block) {
1530
1875
  }
1531
1876
  }
1532
1877
  ),
1533
- /* @__PURE__ */ jsx4("div", { style: submitButtonStyle(block), children: /* @__PURE__ */ jsx4(InlineText, { block, name: "submitLabel", fallback: "Track Your Order" }) })
1878
+ /* @__PURE__ */ jsx5("div", { style: submitButtonStyle(block), children: /* @__PURE__ */ jsx5(InlineText, { block, name: "submitLabel", fallback: "Track Your Order" }) })
1534
1879
  ] }),
1535
- /* @__PURE__ */ jsx4("p", { style: { marginTop: "auto", paddingTop: 28, textAlign: "center", fontSize: 12, lineHeight: "17px", fontStyle: "italic", color: "#b8b8b8" }, children: "Powered by BestTrack" })
1880
+ /* @__PURE__ */ jsx5("p", { style: { marginTop: "auto", paddingTop: 28, textAlign: "center", fontSize: 12, lineHeight: "17px", fontStyle: "italic", color: "#b8b8b8" }, children: "Powered by BestTrack" })
1536
1881
  ] }) });
1537
1882
  }
1538
1883
  function ReadyToGoProgressEditor(block) {
1539
- return /* @__PURE__ */ jsx4("section", { "aria-label": "Ready-to-go progress editor", style: { ...pageFont, background: "var(--pb-color-background, #fff)", color: "var(--pb-color-text, #0f172a)", borderBottom: "1px solid #f1f5f9" }, children: /* @__PURE__ */ jsx4("div", { style: { ...contentWidth, textAlign: "center", width: "min(1248px, 100%)" }, children: /* @__PURE__ */ jsx4(ProgressResult, { result: previewReadyToGoTracking(), showEstimatedDelivery: false, color: text(block, "progressColor") }) }) });
1884
+ return /* @__PURE__ */ jsx5("section", { "aria-label": "Ready-to-go progress editor", style: { ...pageFont, background: "var(--pb-color-background, #fff)", color: "var(--pb-color-text, #0f172a)", borderBottom: "1px solid #f1f5f9" }, children: /* @__PURE__ */ jsx5("div", { style: { ...contentWidth, textAlign: "center", width: "min(1248px, 100%)" }, children: /* @__PURE__ */ jsx5(ProgressResult, { result: previewTrackingPageResult(), showEstimatedDelivery: false, color: text(block, "progressColor") }) }) });
1540
1885
  }
1541
1886
  function ReadyToGoDeliveryEditor(block) {
1542
- const { adPreview } = useReadyToGoRuntime();
1543
- return /* @__PURE__ */ jsx4("section", { "aria-label": "Ready-to-go delivery editor", style: { ...pageFont, background: "var(--pb-color-background, #fff)", color: "var(--pb-color-text, #0f172a)", borderBottom: "1px solid #f1f5f9" }, children: /* @__PURE__ */ jsx4(
1887
+ const { adPreview } = useTrackingRuntime();
1888
+ return /* @__PURE__ */ jsx5("section", { "aria-label": "Ready-to-go delivery editor", style: { ...pageFont, background: "var(--pb-color-background, #fff)", color: "var(--pb-color-text, #0f172a)", borderBottom: "1px solid #f1f5f9" }, children: /* @__PURE__ */ jsx5(
1544
1889
  DeliveryResult,
1545
1890
  {
1546
- heading: /* @__PURE__ */ jsx4(InlineText, { block, name: "heading", fallback: "Shipping Details" }),
1547
- contentsHeading: /* @__PURE__ */ jsx4(InlineText, { block, name: "contentsHeading", fallback: "Package Contents" }),
1548
- carrierHeading: /* @__PURE__ */ jsx4(InlineText, { block, name: "carrierHeading", fallback: "Carrier" }),
1891
+ heading: /* @__PURE__ */ jsx5(InlineText, { block, name: "heading", fallback: "Shipping Details" }),
1892
+ contentsHeading: /* @__PURE__ */ jsx5(InlineText, { block, name: "contentsHeading", fallback: "Package Contents" }),
1893
+ carrierHeading: /* @__PURE__ */ jsx5(InlineText, { block, name: "carrierHeading", fallback: "Carrier" }),
1549
1894
  editing: true,
1550
- result: { ...previewReadyToGoTracking(), ad: adPreview ?? void 0 }
1895
+ result: { ...previewTrackingPageResult(), ad: adPreview ?? void 0 }
1551
1896
  }
1552
1897
  ) });
1553
1898
  }
1554
- function configuredRecommendations(products) {
1555
- return parseProductReferences(products).map((product) => ({
1556
- id: product.id,
1557
- title: product.title || product.id,
1558
- description: "",
1559
- imageUrl: product.imageUrl,
1560
- // Product snapshots only persist the Shopify handle. Resolve the generated
1561
- // storefront path before RecommendationCards applies its URL safety check.
1562
- href: resolveShopifyRecommendHref(void 0, product.handle),
1563
- ...product.price ? { price: product.price } : {}
1564
- }));
1565
- }
1566
1899
  function ReadyToGoRecommendationsEditor(block) {
1567
1900
  const selected = configuredRecommendations(block.products);
1568
- const items = selected.length ? selected : previewReadyToGoTracking().recommendations ?? [];
1569
- return /* @__PURE__ */ jsx4("section", { "aria-label": "Ready-to-go recommendations editor", style: { ...pageFont, background: "var(--pb-color-background, #fff)", color: "var(--pb-color-text, #0f172a)" }, children: /* @__PURE__ */ jsxs4("div", { style: contentWidth, children: [
1570
- /* @__PURE__ */ jsx4("h3", { style: { margin: 0, textAlign: "center", fontSize: 20, lineHeight: "20px", fontWeight: 700 }, children: /* @__PURE__ */ jsx4(InlineText, { block, name: "heading", fallback: "You may also like..." }) }),
1571
- /* @__PURE__ */ jsx4("div", { style: { marginTop: 24 }, children: /* @__PURE__ */ jsx4(RecommendationCards, { items }) })
1901
+ const items = selected.length ? selected : previewTrackingPageResult().recommendations ?? [];
1902
+ return /* @__PURE__ */ jsx5("section", { "aria-label": "Ready-to-go recommendations editor", style: { ...pageFont, background: "var(--pb-color-background, #fff)", color: "var(--pb-color-text, #0f172a)" }, children: /* @__PURE__ */ jsxs4("div", { style: contentWidth, children: [
1903
+ /* @__PURE__ */ jsx5("h3", { style: { margin: 0, textAlign: "center", fontSize: 20, lineHeight: "20px", fontWeight: 700 }, children: /* @__PURE__ */ jsx5(InlineText, { block, name: "heading", fallback: "You may also like..." }) }),
1904
+ /* @__PURE__ */ jsx5("div", { style: { marginTop: 24 }, children: /* @__PURE__ */ jsx5(RecommendationCards, { items }) })
1572
1905
  ] }) });
1573
1906
  }
1574
1907
  function ReadyToGoQueryBlock(props) {
1575
- const runtime = useReadyToGoRuntime();
1576
- const [locationState] = useState2(() => runtime.autoQueryFromUrl ? readTrackingQueryLocationState() : void 0);
1577
- const [mode, setMode] = useState2(locationState?.tab ?? (text(props, "defaultQueryMode", "tracking") === "order" ? "order" : "tracking"));
1578
- const [trackingNumber, setTrackingNumber] = useState2(locationState?.trackingNumber || text(props, "defaultTrackingNumber", "BT-2048-DEMO"));
1579
- const [orderNumber, setOrderNumber] = useState2(locationState?.orderNumber || text(props, "defaultOrderNumber", ""));
1580
- const [email, setEmail] = useState2(locationState?.email ?? "");
1581
- const [localError, setLocalError] = useState2("");
1582
- const autoQueryStarted = useRef(false);
1583
- const previewDemoTrackingNumber = useRef(trackingNumber);
1908
+ const runtime = useTrackingRuntime();
1909
+ const { mode, setMode, trackingNumber, setTrackingNumber, orderNumber, setOrderNumber, email, setEmail, localError, loading, submit } = useTrackingQueryForm({
1910
+ initialTrackingNumber: text(props, "defaultTrackingNumber", "BT-2048-DEMO"),
1911
+ initialOrderNumber: text(props, "defaultOrderNumber", ""),
1912
+ initialMode: text(props, "defaultQueryMode", "tracking") === "order" ? "order" : "tracking",
1913
+ onComplete: scrollToTrackingResult
1914
+ });
1584
1915
  const submitLabel = text(props, "submitLabel", "Track Your Order");
1585
1916
  const trackingTabLabel = text(props, "trackingTabLabel", "Tracking Number");
1586
1917
  const orderTabLabel = text(props, "orderTabLabel", "Order Number");
1587
- useEffect2(() => {
1588
- if (autoQueryStarted.current) return;
1589
- if (locationState?.canAutoQuery) {
1590
- autoQueryStarted.current = true;
1591
- void runtime.query(locationState.tab === "tracking" ? { mode: "tracking", trackingNumber: locationState.trackingNumber } : { mode: "order", orderNumber: locationState.orderNumber, email: locationState.email }).finally(() => scrollToTrackingResult());
1592
- return;
1593
- }
1594
- const demoTrackingNumber = previewDemoTrackingNumber.current.trim();
1595
- if (!runtime.autoQueryDemo || !demoTrackingNumber) return;
1596
- autoQueryStarted.current = true;
1597
- void runtime.query({ mode: "tracking", trackingNumber: demoTrackingNumber });
1598
- }, [locationState, runtime]);
1599
- const submit = (event) => {
1600
- event.preventDefault();
1601
- if (runtime.phase === "loading") return;
1602
- setLocalError("");
1603
- if (mode === "order") {
1604
- if (!orderNumber.trim() || !email.trim()) {
1605
- setLocalError("Please enter your order number and email address");
1606
- return;
1607
- }
1608
- syncTrackingQueryToUrl("order", orderNumber.trim(), email.trim());
1609
- void runtime.query({ mode: "order", orderNumber: orderNumber.trim(), email: email.trim() }).finally(() => scrollToTrackingResult());
1610
- return;
1611
- }
1612
- if (!trackingNumber.trim()) {
1613
- setLocalError("Please enter your tracking number");
1614
- return;
1615
- }
1616
- syncTrackingQueryToUrl("tracking", trackingNumber.trim());
1617
- void runtime.query({ mode: "tracking", trackingNumber: trackingNumber.trim() }).finally(() => scrollToTrackingResult());
1618
- };
1619
- const loading = runtime.phase === "loading";
1620
- return /* @__PURE__ */ jsx4("section", { style: heroStyle, children: /* @__PURE__ */ jsxs4("div", { role: "region", "aria-label": "Ready-to-go tracking query", style: formCardStyle, children: [
1918
+ return /* @__PURE__ */ jsx5("section", { style: heroStyle, children: /* @__PURE__ */ jsxs4("div", { role: "region", "aria-label": "Ready-to-go tracking query", style: formCardStyle, children: [
1621
1919
  /* @__PURE__ */ jsxs4("div", { role: "tablist", "aria-label": "Tracking method", style: { display: "flex", width: "100%", borderBottom: "1px solid #cbd5e1" }, children: [
1622
- /* @__PURE__ */ jsx4("button", { type: "button", role: "tab", "aria-selected": mode === "tracking", onClick: () => {
1623
- setMode("tracking");
1624
- setLocalError("");
1625
- }, style: tabStyle(mode === "tracking"), children: trackingTabLabel }),
1626
- /* @__PURE__ */ jsx4("button", { type: "button", role: "tab", "aria-selected": mode === "order", onClick: () => {
1627
- setMode("order");
1628
- setLocalError("");
1629
- }, style: tabStyle(mode === "order"), children: orderTabLabel })
1920
+ /* @__PURE__ */ jsx5("button", { type: "button", role: "tab", "aria-selected": mode === "tracking", onClick: () => setMode("tracking"), style: tabStyle(mode === "tracking"), children: trackingTabLabel }),
1921
+ /* @__PURE__ */ jsx5("button", { type: "button", role: "tab", "aria-selected": mode === "order", onClick: () => setMode("order"), style: tabStyle(mode === "order"), children: orderTabLabel })
1630
1922
  ] }),
1631
1923
  /* @__PURE__ */ jsxs4("form", { onSubmit: submit, style: { marginTop: 24, display: "flex", flexDirection: "column", gap: 16, flex: 1 }, children: [
1632
1924
  mode === "order" ? /* @__PURE__ */ jsxs4(Fragment3, { children: [
1633
- /* @__PURE__ */ jsx4("label", { htmlFor: "ready-to-go-order-number", style: { position: "absolute", width: 1, height: 1, overflow: "hidden", clipPath: "inset(50%)" }, children: "Order number" }),
1634
- /* @__PURE__ */ jsx4("input", { id: "ready-to-go-order-number", "aria-label": "Order number", value: orderNumber, onChange: (event) => setOrderNumber(event.target.value), placeholder: "Order Number", style: inputStyle }),
1635
- /* @__PURE__ */ jsx4("label", { htmlFor: "ready-to-go-email", style: { position: "absolute", width: 1, height: 1, overflow: "hidden", clipPath: "inset(50%)" }, children: "Email" }),
1636
- /* @__PURE__ */ jsx4("input", { id: "ready-to-go-email", "aria-label": "Email", value: email, onChange: (event) => setEmail(event.target.value), placeholder: "Email", style: inputStyle })
1925
+ /* @__PURE__ */ jsx5("label", { htmlFor: "ready-to-go-order-number", style: { position: "absolute", width: 1, height: 1, overflow: "hidden", clipPath: "inset(50%)" }, children: "Order number" }),
1926
+ /* @__PURE__ */ jsx5("input", { id: "ready-to-go-order-number", "aria-label": "Order number", value: orderNumber, onChange: (event) => setOrderNumber(event.target.value), placeholder: "Order Number", style: inputStyle }),
1927
+ /* @__PURE__ */ jsx5("label", { htmlFor: "ready-to-go-email", style: { position: "absolute", width: 1, height: 1, overflow: "hidden", clipPath: "inset(50%)" }, children: "Email" }),
1928
+ /* @__PURE__ */ jsx5("input", { id: "ready-to-go-email", "aria-label": "Email", value: email, onChange: (event) => setEmail(event.target.value), placeholder: "Email", style: inputStyle })
1637
1929
  ] }) : /* @__PURE__ */ jsxs4(Fragment3, { children: [
1638
- /* @__PURE__ */ jsx4("label", { htmlFor: "ready-to-go-tracking-number", style: { position: "absolute", width: 1, height: 1, overflow: "hidden", clipPath: "inset(50%)" }, children: "Tracking number" }),
1639
- /* @__PURE__ */ jsx4("input", { id: "ready-to-go-tracking-number", "aria-label": "Tracking number", value: trackingNumber, onChange: (event) => setTrackingNumber(event.target.value), placeholder: "Tracking Number", style: inputStyle })
1930
+ /* @__PURE__ */ jsx5("label", { htmlFor: "ready-to-go-tracking-number", style: { position: "absolute", width: 1, height: 1, overflow: "hidden", clipPath: "inset(50%)" }, children: "Tracking number" }),
1931
+ /* @__PURE__ */ jsx5("input", { id: "ready-to-go-tracking-number", "aria-label": "Tracking number", value: trackingNumber, onChange: (event) => setTrackingNumber(event.target.value), placeholder: "Tracking Number", style: inputStyle })
1640
1932
  ] }),
1641
- localError ? /* @__PURE__ */ jsx4("p", { style: { margin: 0, textAlign: "center", fontSize: 12, color: "#f43f5e" }, children: localError }) : null,
1642
- /* @__PURE__ */ jsx4("button", { type: "submit", disabled: loading, style: { ...submitButtonStyle(props, loading), border: 0, font: "inherit", fontSize: 15, fontWeight: 600, cursor: loading ? "wait" : "pointer", opacity: loading ? 0.7 : 1 }, children: submitLabel }),
1643
- runtime.phase === "error" ? /* @__PURE__ */ jsx4("p", { role: "alert", style: { margin: 0, textAlign: "center", fontSize: 12, color: "#f43f5e" }, children: runtime.error }) : null
1933
+ localError ? /* @__PURE__ */ jsx5("p", { role: "alert", style: { margin: 0, textAlign: "center", fontSize: 12, color: "#f43f5e" }, children: localError }) : null,
1934
+ /* @__PURE__ */ jsx5("button", { type: "submit", disabled: loading, style: { ...submitButtonStyle(props, loading), border: 0, font: "inherit", fontSize: 15, fontWeight: 600, cursor: loading ? "wait" : "pointer", opacity: loading ? 0.7 : 1 }, children: submitLabel }),
1935
+ runtime.phase === "error" ? /* @__PURE__ */ jsx5("p", { role: "alert", style: { margin: 0, textAlign: "center", fontSize: 12, color: "#f43f5e" }, children: runtime.error }) : null
1644
1936
  ] }),
1645
- /* @__PURE__ */ jsx4(RuntimeWatermark, { watermark: runtime.watermark }),
1646
- loading ? /* @__PURE__ */ jsx4(TrackingLoading, {}) : null
1937
+ /* @__PURE__ */ jsx5(RuntimeWatermark, { watermark: runtime.watermark }),
1938
+ loading ? /* @__PURE__ */ jsx5(TrackingLoading, {}) : null
1647
1939
  ] }) });
1648
1940
  }
1649
1941
  function ReadyToGoProgressBlock(props) {
1650
- const runtime = useReadyToGoRuntime();
1942
+ const runtime = useTrackingRuntime();
1943
+ const visibility = trackingBlockState(runtime);
1651
1944
  const result = runtime.result;
1652
- if (runtime.phase === "idle" || runtime.phase === "loading") return null;
1653
- if (runtime.phase === "empty") return /* @__PURE__ */ jsx4(TrackingNotFound, { resultAnchor: true });
1654
- return /* @__PURE__ */ jsx4(SectionShell, { title: "Shipment progress", resultAnchor: true, children: /* @__PURE__ */ jsxs4("div", { style: { ...contentWidth, textAlign: "center", width: "min(1248px, 100%)" }, children: [
1655
- runtime.phase === "error" ? /* @__PURE__ */ jsx4("p", { style: { margin: 0, color: "#b42318" }, children: "Shipment progress is temporarily unavailable." }) : null,
1656
- runtime.phase === "success" && result ? /* @__PURE__ */ jsx4(ProgressResult, { result, showEstimatedDelivery: !runtime.autoQueryDemo, color: text(props, "progressColor") }) : null
1945
+ if (!visibility.showProgress) return null;
1946
+ if (visibility.showNotFound) return /* @__PURE__ */ jsx5(TrackingNotFound, { resultAnchor: true });
1947
+ return /* @__PURE__ */ jsx5(SectionShell, { title: "Shipment progress", resultAnchor: true, children: /* @__PURE__ */ jsxs4("div", { style: { ...contentWidth, textAlign: "center", width: "min(1248px, 100%)" }, children: [
1948
+ visibility.showUnavailable ? /* @__PURE__ */ jsx5("p", { style: { margin: 0, color: "#b42318" }, children: "Shipment progress is temporarily unavailable." }) : null,
1949
+ visibility.showResult && result ? /* @__PURE__ */ jsx5(
1950
+ ProgressResult,
1951
+ {
1952
+ result,
1953
+ showEstimatedDelivery: visibility.showEstimatedDelivery,
1954
+ color: text(props, "progressColor"),
1955
+ recentQueries: runtime.recentQueries,
1956
+ selectedRecentIndex: runtime.selectedRecentIndex,
1957
+ onSelectRecent: runtime.selectRecentQuery,
1958
+ selectedShipmentIndex: runtime.selectedShipmentIndex,
1959
+ onSelectShipment: runtime.selectShipment
1960
+ }
1961
+ ) : null
1657
1962
  ] }) });
1658
1963
  }
1659
1964
  function ReadyToGoDeliveryBlock(props) {
1660
- const runtime = useReadyToGoRuntime();
1661
- if (runtime.phase === "idle" || runtime.phase === "loading" || runtime.phase === "empty") return null;
1965
+ const runtime = useTrackingRuntime();
1966
+ const visibility = trackingBlockState(runtime);
1967
+ if (!visibility.showDelivery) return null;
1662
1968
  const heading = text(props, "heading", "Shipping Details");
1663
1969
  const contentsHeading = text(props, "contentsHeading", "Package Contents");
1664
1970
  const carrierHeading = text(props, "carrierHeading", "Carrier");
1665
1971
  const result = runtime.result;
1666
- return /* @__PURE__ */ jsx4(SectionShell, { title: heading, children: runtime.phase === "success" && result ? /* @__PURE__ */ jsx4(DeliveryResult, { heading, contentsHeading, carrierHeading, result }) : /* @__PURE__ */ jsx4("div", { style: { ...contentWidth, display: "grid", gridTemplateColumns: "repeat(auto-fit, minmax(min(100%, 280px), 500px))", gap: 40, justifyContent: "center", alignItems: "start" }, children: /* @__PURE__ */ jsxs4("div", { children: [
1667
- /* @__PURE__ */ jsx4("h3", { style: { margin: 0, fontSize: 20, lineHeight: "20px", fontWeight: 700 }, children: heading }),
1668
- runtime.phase === "error" ? /* @__PURE__ */ jsx4("p", { style: { margin: "16px 0 0", color: "#b42318" }, children: "Delivery details are temporarily unavailable." }) : null
1972
+ return /* @__PURE__ */ jsx5(SectionShell, { title: heading, children: visibility.showResult && result ? /* @__PURE__ */ jsx5(DeliveryResult, { heading, contentsHeading, carrierHeading, result }) : /* @__PURE__ */ jsx5("div", { style: { ...contentWidth, display: "grid", gridTemplateColumns: "repeat(auto-fit, minmax(min(100%, 280px), 500px))", gap: 40, justifyContent: "center", alignItems: "start" }, children: /* @__PURE__ */ jsxs4("div", { children: [
1973
+ /* @__PURE__ */ jsx5("h3", { style: { margin: 0, fontSize: 20, lineHeight: "20px", fontWeight: 700 }, children: heading }),
1974
+ visibility.showUnavailable ? /* @__PURE__ */ jsx5("p", { style: { margin: "16px 0 0", color: "#b42318" }, children: "Delivery details are temporarily unavailable." }) : null
1669
1975
  ] }) }) });
1670
1976
  }
1671
1977
  function ReadyToGoRecommendationsBlock(props) {
1672
- const runtime = useReadyToGoRuntime();
1978
+ const runtime = useTrackingRuntime();
1673
1979
  const heading = text(props, "heading", "You may also like...");
1674
- const configured = configuredRecommendations(props.products);
1675
- const items = configured.length ? configured : runtime.recommendations.phase === "success" ? runtime.recommendations.items : [];
1980
+ const items = recommendationItems(props.products, runtime);
1676
1981
  if (!items.length) return null;
1677
- return /* @__PURE__ */ jsx4(SectionShell, { title: heading, bordered: false, children: /* @__PURE__ */ jsxs4("div", { style: contentWidth, children: [
1678
- /* @__PURE__ */ jsx4("h3", { style: { margin: 0, textAlign: "center", fontSize: 20, lineHeight: "20px", fontWeight: 700 }, children: heading }),
1679
- /* @__PURE__ */ jsx4("div", { style: { marginTop: 24 }, children: /* @__PURE__ */ jsx4(RecommendationCards, { items }) })
1982
+ return /* @__PURE__ */ jsx5(SectionShell, { title: heading, bordered: false, children: /* @__PURE__ */ jsxs4("div", { style: contentWidth, children: [
1983
+ /* @__PURE__ */ jsx5("h3", { style: { margin: 0, textAlign: "center", fontSize: 20, lineHeight: "20px", fontWeight: 700 }, children: heading }),
1984
+ /* @__PURE__ */ jsx5("div", { style: { marginTop: 24 }, children: /* @__PURE__ */ jsx5(RecommendationCards, { items }) })
1680
1985
  ] }) });
1681
1986
  }
1682
1987
 
@@ -1776,12 +2081,12 @@ var readyToGoBlocks = withTemplatePolicy([
1776
2081
  },
1777
2082
  render: { web: ReadyToGoRecommendationsBlock, editor: ReadyToGoRecommendationsEditor }
1778
2083
  }
1779
- ], ["besttrack.ready-to-go.query", "besttrack.ready-to-go.progress", "besttrack.ready-to-go.delivery"]);
2084
+ ], ["besttrack.ready-to-go.query", "besttrack.ready-to-go.progress", "besttrack.ready-to-go.delivery", "besttrack.ready-to-go.recommendations"]);
1780
2085
  var readyToGoTemplatePolicy = defineTemplatePolicy(
1781
2086
  "besttrack.ready-to-go",
1782
2087
  "Ready-to-go",
1783
2088
  readyToGoBlocks.map((block) => block.type),
1784
- ["besttrack.ready-to-go.query", "besttrack.ready-to-go.progress", "besttrack.ready-to-go.delivery"]
2089
+ ["besttrack.ready-to-go.query", "besttrack.ready-to-go.progress", "besttrack.ready-to-go.delivery", "besttrack.ready-to-go.recommendations"]
1785
2090
  );
1786
2091
  function createReadyToGoTemplate() {
1787
2092
  return {
@@ -1831,11 +2136,11 @@ var bestTrackPageExtension = Object.freeze({
1831
2136
  import { createPageDocument as createPageDocument2 } from "@standhigher/puck-page-builder/runtime";
1832
2137
 
1833
2138
  // src/branded.tsx
1834
- import { createContext as createContext2, useCallback as useCallback3, useContext as useContext2, useMemo as useMemo3, useRef as useRef3, useState as useState4 } from "react";
2139
+ import { useState as useState5 } from "react";
1835
2140
 
1836
2141
  // src/tracking-query-experience.tsx
1837
- import { useEffect as useEffect3, useId as useId2, useRef as useRef2, useState as useState3 } from "react";
1838
- import { Fragment as Fragment4, jsx as jsx5, jsxs as jsxs5 } from "react/jsx-runtime";
2142
+ import { useEffect as useEffect4, useId as useId2, useRef as useRef3, useState as useState4 } from "react";
2143
+ import { Fragment as Fragment4, jsx as jsx6, jsxs as jsxs5 } from "react/jsx-runtime";
1839
2144
  var srOnly = {
1840
2145
  position: "absolute",
1841
2146
  width: 1,
@@ -1879,11 +2184,6 @@ var defaultSubmitStyle = (loading) => ({
1879
2184
  fontWeight: 700,
1880
2185
  cursor: loading ? "wait" : "pointer"
1881
2186
  });
1882
- function fieldError(field) {
1883
- if (field === "tracking") return "Enter a valid tracking number.";
1884
- if (field === "order") return "Enter a valid order number.";
1885
- return "Enter a valid email address.";
1886
- }
1887
2187
  function TrackingQueryCard({
1888
2188
  phase,
1889
2189
  onQuery,
@@ -1897,7 +2197,6 @@ function TrackingQueryCard({
1897
2197
  trackingPlaceholder = "Enter your tracking number",
1898
2198
  orderPlaceholder = "Enter your order number",
1899
2199
  emailPlaceholder = "Enter your email",
1900
- emptyMessage = "We couldn't find an order or shipment for that number.",
1901
2200
  errorMessage = "We couldn't retrieve this order right now. Please try again later.",
1902
2201
  trackingInputLabel = "Tracking number",
1903
2202
  orderInputLabel = "Order number",
@@ -1924,20 +2223,16 @@ function TrackingQueryCard({
1924
2223
  const orderTabId = useId2();
1925
2224
  const tabPanelId = useId2();
1926
2225
  const queryStatusId = useId2();
1927
- const [mode, setMode] = useState3(initialMode);
1928
- const [trackingNumber, setTrackingNumber] = useState3(initialTrackingNumber);
1929
- const [orderNumber, setOrderNumber] = useState3(initialOrderNumber);
1930
- const [email, setEmail] = useState3("");
1931
- const [errors, setErrors] = useState3({});
1932
- const cardRef = useRef2(null);
1933
- const resultRef = useRef2(null);
1934
- const trackingInputRef = useRef2(null);
1935
- const orderInputRef = useRef2(null);
1936
- const emailInputRef = useRef2(null);
1937
- const tabRefs = useRef2({ tracking: null, order: null });
1938
- const loading = phase === "loading";
1939
- const terminalPhase = phase === "success" || phase === "empty" || phase === "error";
1940
- useEffect3(() => {
2226
+ const { mode, setMode, trackingNumber, setTrackingNumber, orderNumber, setOrderNumber, email, setEmail, localError, firstInvalidField, loading, submit } = useTrackingQueryForm({ initialTrackingNumber, initialOrderNumber, initialMode, onQuery, phase });
2227
+ const cardRef = useRef3(null);
2228
+ const resultRef = useRef3(null);
2229
+ const trackingInputRef = useRef3(null);
2230
+ const orderInputRef = useRef3(null);
2231
+ const emailInputRef = useRef3(null);
2232
+ const tabRefs = useRef3({ tracking: null, order: null });
2233
+ const visibility = trackingBlockState({ phase });
2234
+ const terminalPhase = visibility.showProgress;
2235
+ useEffect4(() => {
1941
2236
  if (!terminalPhase) return;
1942
2237
  const card = cardRef.current;
1943
2238
  const resultNode = resultRef.current;
@@ -1946,13 +2241,12 @@ function TrackingQueryCard({
1946
2241
  }
1947
2242
  resultNode?.focus({ preventScroll: true });
1948
2243
  }, [phase, terminalPhase]);
1949
- const focusField = (field) => {
1950
- const input = field === "tracking" ? trackingInputRef.current : field === "order" ? orderInputRef.current : emailInputRef.current;
2244
+ useEffect4(() => {
2245
+ const input = firstInvalidField === "tracking" ? trackingInputRef.current : firstInvalidField === "order" ? orderInputRef.current : firstInvalidField === "email" ? emailInputRef.current : null;
1951
2246
  input?.focus();
1952
- };
2247
+ }, [firstInvalidField, localError]);
1953
2248
  const setActiveMode = (nextMode, moveFocus = false) => {
1954
2249
  setMode(nextMode);
1955
- setErrors({});
1956
2250
  if (moveFocus) tabRefs.current[nextMode]?.focus();
1957
2251
  };
1958
2252
  const onTabKeyDown = (event, currentMode) => {
@@ -1963,273 +2257,186 @@ function TrackingQueryCard({
1963
2257
  event.preventDefault();
1964
2258
  setActiveMode(nextMode, true);
1965
2259
  };
1966
- const clearError = (field) => {
1967
- setErrors((current) => {
1968
- if (!current[field]) return current;
1969
- const next = { ...current };
1970
- delete next[field];
1971
- return next;
1972
- });
1973
- };
1974
- const submit = (event) => {
1975
- event.preventDefault();
1976
- if (loading) return;
1977
- const nextErrors = {};
1978
- const normalizedTrackingNumber = trackingNumber.trim();
1979
- const normalizedOrderNumber = orderNumber.trim();
1980
- const normalizedEmail = email.trim();
1981
- if (mode === "tracking" && !isValidTrackingNumber(normalizedTrackingNumber)) nextErrors.tracking = fieldError("tracking");
1982
- if (mode === "order" && !isValidOrderNumber(normalizedOrderNumber)) nextErrors.order = fieldError("order");
1983
- if (mode === "order" && !isValidOrderEmail(normalizedEmail)) nextErrors.email = fieldError("email");
1984
- const firstInvalidField = mode === "tracking" ? "tracking" : nextErrors.order ? "order" : nextErrors.email ? "email" : void 0;
1985
- if (firstInvalidField && nextErrors[firstInvalidField]) {
1986
- setErrors(nextErrors);
1987
- focusField(firstInvalidField);
1988
- return;
1989
- }
1990
- setErrors({});
1991
- void onQuery(mode === "tracking" ? { mode, trackingNumber: normalizedTrackingNumber } : { mode, orderNumber: normalizedOrderNumber, email: normalizedEmail });
1992
- };
1993
- const errorFor = (field) => errors[field];
2260
+ const errorFor = (field) => firstInvalidField === field ? localError : void 0;
1994
2261
  const inputWithError = (field) => ({ ...inputStyle2, borderColor: errorFor(field) ? "#b42318" : inputStyle2.borderColor ?? "#cbd5e1" });
1995
- const message = phase === "empty" ? emptyMessage : phase === "error" ? errorMessage : void 0;
2262
+ const message = visibility.showUnavailable ? errorMessage : void 0;
1996
2263
  const cardData = cardDataAttribute ? { [cardDataAttribute]: "true" } : {};
1997
2264
  const resultData = resultDataAttribute ? { [resultDataAttribute]: "true" } : {};
1998
2265
  const activeTabId = mode === "tracking" ? trackingTabId : orderTabId;
1999
- const resultLabel = phase === "success" ? "Tracking result" : "Tracking query status";
2266
+ const resultLabel = visibility.showResult ? "Tracking result" : "Tracking query status";
2000
2267
  return /* @__PURE__ */ jsxs5("div", { ref: cardRef, "data-tracking-query-card": true, ...cardData, "aria-busy": loading || void 0, style: { boxSizing: "border-box", minWidth: 0, maxWidth: "100%", overflowX: "hidden", overflowY: "auto", overscrollBehavior: "contain", scrollPaddingBlock: 16, ...cardStyle2 }, children: [
2001
- /* @__PURE__ */ jsx5("h1", { style: { margin: "0 0 28px", textAlign: "center", ...headingStyle }, children: heading }),
2268
+ /* @__PURE__ */ jsx6("h1", { style: { margin: "0 0 28px", textAlign: "center", ...headingStyle }, children: heading }),
2002
2269
  /* @__PURE__ */ jsxs5("div", { role: "tablist", "aria-label": "Tracking method", style: { display: "grid", gridTemplateColumns: "1fr 1fr", borderBottom: "1px solid #cbd5e1", marginBottom: 18, ...tabListStyle }, children: [
2003
- /* @__PURE__ */ jsx5("button", { ref: (element) => {
2270
+ /* @__PURE__ */ jsx6("button", { ref: (element) => {
2004
2271
  tabRefs.current.tracking = element;
2005
2272
  }, id: trackingTabId, type: "button", role: "tab", "aria-selected": mode === "tracking", "aria-controls": tabPanelId, tabIndex: mode === "tracking" ? 0 : -1, onClick: () => setActiveMode("tracking"), onKeyDown: (event) => onTabKeyDown(event, "tracking"), style: tabStyle2(mode === "tracking"), children: trackingTabLabel }),
2006
- /* @__PURE__ */ jsx5("button", { ref: (element) => {
2273
+ /* @__PURE__ */ jsx6("button", { ref: (element) => {
2007
2274
  tabRefs.current.order = element;
2008
2275
  }, id: orderTabId, type: "button", role: "tab", "aria-selected": mode === "order", "aria-controls": tabPanelId, tabIndex: mode === "order" ? 0 : -1, onClick: () => setActiveMode("order"), onKeyDown: (event) => onTabKeyDown(event, "order"), style: tabStyle2(mode === "order"), children: orderTabLabel })
2009
2276
  ] }),
2010
- /* @__PURE__ */ jsx5("div", { id: tabPanelId, role: "tabpanel", "aria-labelledby": activeTabId, children: /* @__PURE__ */ jsxs5("form", { noValidate: true, onSubmit: submit, style: { display: "grid", gap: 12, minWidth: 0, ...formStyle }, children: [
2277
+ /* @__PURE__ */ jsx6("div", { id: tabPanelId, role: "tabpanel", "aria-labelledby": activeTabId, children: /* @__PURE__ */ jsxs5("form", { noValidate: true, onSubmit: submit, style: { display: "grid", gap: 12, minWidth: 0, ...formStyle }, children: [
2011
2278
  mode === "tracking" ? /* @__PURE__ */ jsxs5("div", { children: [
2012
- /* @__PURE__ */ jsx5("label", { htmlFor: trackingInputId, style: srOnly, children: trackingInputLabel }),
2013
- /* @__PURE__ */ jsx5("input", { ref: trackingInputRef, id: trackingInputId, "aria-label": trackingInputLabel, "aria-invalid": Boolean(errorFor("tracking")), "aria-describedby": errorFor("tracking") ? trackingInputId + "-error" : void 0, value: trackingNumber, onChange: (event) => {
2279
+ /* @__PURE__ */ jsx6("label", { htmlFor: trackingInputId, style: srOnly, children: trackingInputLabel }),
2280
+ /* @__PURE__ */ jsx6("input", { ref: trackingInputRef, id: trackingInputId, "aria-label": trackingInputLabel, "aria-invalid": Boolean(errorFor("tracking")), "aria-describedby": errorFor("tracking") ? trackingInputId + "-error" : void 0, value: trackingNumber, onChange: (event) => {
2014
2281
  setTrackingNumber(event.target.value);
2015
- clearError("tracking");
2016
2282
  }, placeholder: trackingPlaceholder, style: inputWithError("tracking") }),
2017
- errorFor("tracking") ? /* @__PURE__ */ jsx5("p", { id: trackingInputId + "-error", role: "alert", style: { margin: "6px 0 0", color: "#b42318", fontSize: 13 }, children: errorFor("tracking") }) : null
2283
+ errorFor("tracking") ? /* @__PURE__ */ jsx6("p", { id: trackingInputId + "-error", role: "alert", style: { margin: "6px 0 0", color: "#b42318", fontSize: 13 }, children: errorFor("tracking") }) : null
2018
2284
  ] }) : /* @__PURE__ */ jsxs5(Fragment4, { children: [
2019
2285
  /* @__PURE__ */ jsxs5("div", { children: [
2020
- /* @__PURE__ */ jsx5("label", { htmlFor: orderInputId, style: srOnly, children: orderInputLabel }),
2021
- /* @__PURE__ */ jsx5("input", { ref: orderInputRef, id: orderInputId, "aria-label": orderInputLabel, "aria-invalid": Boolean(errorFor("order")), "aria-describedby": errorFor("order") ? orderInputId + "-error" : void 0, value: orderNumber, onChange: (event) => {
2286
+ /* @__PURE__ */ jsx6("label", { htmlFor: orderInputId, style: srOnly, children: orderInputLabel }),
2287
+ /* @__PURE__ */ jsx6("input", { ref: orderInputRef, id: orderInputId, "aria-label": orderInputLabel, "aria-invalid": Boolean(errorFor("order")), "aria-describedby": errorFor("order") ? orderInputId + "-error" : void 0, value: orderNumber, onChange: (event) => {
2022
2288
  setOrderNumber(event.target.value);
2023
- clearError("order");
2024
2289
  }, placeholder: orderPlaceholder, style: inputWithError("order") }),
2025
- errorFor("order") ? /* @__PURE__ */ jsx5("p", { id: orderInputId + "-error", role: "alert", style: { margin: "6px 0 0", color: "#b42318", fontSize: 13 }, children: errorFor("order") }) : null
2290
+ errorFor("order") ? /* @__PURE__ */ jsx6("p", { id: orderInputId + "-error", role: "alert", style: { margin: "6px 0 0", color: "#b42318", fontSize: 13 }, children: errorFor("order") }) : null
2026
2291
  ] }),
2027
2292
  /* @__PURE__ */ jsxs5("div", { children: [
2028
- /* @__PURE__ */ jsx5("label", { htmlFor: emailInputId, style: srOnly, children: emailInputLabel }),
2029
- /* @__PURE__ */ jsx5("input", { ref: emailInputRef, id: emailInputId, type: "email", "aria-label": emailInputLabel, "aria-invalid": Boolean(errorFor("email")), "aria-describedby": errorFor("email") ? emailInputId + "-error" : void 0, value: email, onChange: (event) => {
2293
+ /* @__PURE__ */ jsx6("label", { htmlFor: emailInputId, style: srOnly, children: emailInputLabel }),
2294
+ /* @__PURE__ */ jsx6("input", { ref: emailInputRef, id: emailInputId, type: "email", "aria-label": emailInputLabel, "aria-invalid": Boolean(errorFor("email")), "aria-describedby": errorFor("email") ? emailInputId + "-error" : void 0, value: email, onChange: (event) => {
2030
2295
  setEmail(event.target.value);
2031
- clearError("email");
2032
2296
  }, placeholder: emailPlaceholder, style: inputWithError("email") }),
2033
- errorFor("email") ? /* @__PURE__ */ jsx5("p", { id: emailInputId + "-error", role: "alert", style: { margin: "6px 0 0", color: "#b42318", fontSize: 13 }, children: errorFor("email") }) : null
2297
+ errorFor("email") ? /* @__PURE__ */ jsx6("p", { id: emailInputId + "-error", role: "alert", style: { margin: "6px 0 0", color: "#b42318", fontSize: 13 }, children: errorFor("email") }) : null
2034
2298
  ] })
2035
2299
  ] }),
2036
- /* @__PURE__ */ jsx5("button", { type: "submit", disabled: loading, style: submitStyle(loading), children: submitLabel })
2300
+ /* @__PURE__ */ jsx6("button", { type: "submit", disabled: loading, style: submitStyle(loading), children: submitLabel })
2037
2301
  ] }) }),
2038
- message ? /* @__PURE__ */ jsx5("p", { id: queryStatusId, role: phase === "error" ? "alert" : "status", "aria-live": phase === "error" ? "assertive" : "polite", style: { margin: "16px 0 0", color: phase === "error" ? "#b42318" : "#64748b", ...messageStyle }, children: message }) : null,
2039
- phase === "success" ? /* @__PURE__ */ jsx5("p", { id: queryStatusId, role: "status", "aria-live": "polite", style: srOnly, children: "Tracking details loaded." }) : null,
2040
- terminalPhase ? /* @__PURE__ */ jsx5("div", { ref: resultRef, role: "region", "aria-label": resultLabel, "aria-describedby": queryStatusId, "data-tracking-query-result": true, ...resultData, "data-testid": resultTestId, tabIndex: -1, style: { minWidth: 0, overflowWrap: "anywhere", marginTop: phase === "success" ? 20 : 0, ...resultStyle }, children: phase === "success" ? result : null }) : null,
2302
+ message ? /* @__PURE__ */ jsx6("p", { id: queryStatusId, role: "alert", "aria-live": "assertive", style: { margin: "16px 0 0", color: "#b42318", ...messageStyle }, children: message }) : null,
2303
+ visibility.showResult ? /* @__PURE__ */ jsx6("p", { id: queryStatusId, role: "status", "aria-live": "polite", style: srOnly, children: "Tracking details loaded." }) : null,
2304
+ terminalPhase ? /* @__PURE__ */ jsx6("div", { ref: resultRef, role: "region", "aria-label": resultLabel, "aria-describedby": queryStatusId, "data-tracking-query-result": true, ...resultData, "data-testid": resultTestId, tabIndex: -1, style: { minWidth: 0, overflowWrap: "anywhere", marginTop: visibility.showResult ? 20 : 0, ...resultStyle }, children: visibility.showResult ? result : visibility.showNotFound ? /* @__PURE__ */ jsx6("div", { id: queryStatusId, children: /* @__PURE__ */ jsx6(TrackingNotFound, {}) }) : /* @__PURE__ */ jsxs5(Fragment4, { children: [
2305
+ /* @__PURE__ */ jsx6("section", { "aria-label": "Shipment progress", children: /* @__PURE__ */ jsx6("p", { style: { color: "#b42318" }, children: "Shipment progress is temporarily unavailable." }) }),
2306
+ /* @__PURE__ */ jsx6("section", { "aria-label": "Shipping Details", children: /* @__PURE__ */ jsx6("p", { style: { color: "#b42318" }, children: "Delivery details are temporarily unavailable." }) })
2307
+ ] }) }) : null,
2041
2308
  watermark,
2042
- loading ? /* @__PURE__ */ jsx5(TrackingLoading, {}) : null
2309
+ loading ? /* @__PURE__ */ jsx6(TrackingLoading, {}) : null
2043
2310
  ] });
2044
2311
  }
2045
- function defaultProgress2(status) {
2046
- const steps = [
2047
- { id: "ordered", label: "Ordered", icon: "check" },
2048
- { id: "ready", label: "Order Ready", icon: "bag" },
2049
- { id: "transit", label: "In Transit", icon: "truck" },
2050
- { id: "out", label: "Out for Delivery", icon: "box" },
2051
- { id: "delivered", label: "Delivered", icon: "check" }
2052
- ];
2053
- const normalized = status.toLowerCase();
2054
- const current = normalized.includes("deliver") ? normalized.includes("out for") ? 3 : 4 : normalized.includes("transit") ? 2 : normalized.includes("ready") ? 1 : 0;
2055
- return steps.map((step, index) => ({ ...step, state: index < current ? "complete" : index === current ? "current" : "upcoming" }));
2056
- }
2057
2312
  function TrackingProgressDetails({ steps }) {
2058
- return /* @__PURE__ */ jsx5("ol", { "aria-label": "Delivery progress", style: { display: "grid", gridTemplateColumns: "repeat(5, minmax(0, 1fr))", gap: 4, margin: "20px 0 0", padding: 0, listStyle: "none" }, children: steps.slice(0, 5).map((step, index) => /* @__PURE__ */ jsxs5("li", { style: { minWidth: 0, textAlign: "center", color: step.state === "upcoming" ? "#64748b" : "#0f172a" }, children: [
2059
- /* @__PURE__ */ jsx5("span", { "aria-label": step.label + " " + step.state, style: { display: "grid", placeItems: "center", width: 28, height: 28, margin: "0 auto", border: "1px solid " + (step.state === "upcoming" ? "#94a3b8" : "#0f172a"), borderRadius: "50%", background: step.state === "current" ? "#0f172a" : "#fff", color: step.state === "current" ? "#fff" : "#0f172a", fontSize: 13, fontWeight: 700 }, children: step.state === "complete" || step.state === "current" ? "\u2713" : index + 1 }),
2060
- /* @__PURE__ */ jsx5("span", { style: { display: "block", marginTop: 6, overflowWrap: "anywhere", fontSize: 11, lineHeight: 1.25 }, children: step.label }),
2061
- step.date ? /* @__PURE__ */ jsx5("span", { style: { display: "block", marginTop: 3, color: "#94a3b8", fontSize: 10, lineHeight: 1.2 }, children: step.date }) : null
2313
+ return /* @__PURE__ */ jsx6("ol", { "aria-label": "Delivery progress", style: { display: "grid", gridTemplateColumns: `repeat(${steps.length}, minmax(0, 1fr))`, gap: 4, margin: "20px 0 0", padding: 0, listStyle: "none" }, children: steps.map((step, index) => /* @__PURE__ */ jsxs5("li", { style: { minWidth: 0, textAlign: "center", color: step.state === "upcoming" ? "#64748b" : "#0f172a" }, children: [
2314
+ /* @__PURE__ */ jsx6("span", { "aria-label": step.label + " " + step.state, style: { display: "grid", placeItems: "center", width: 28, height: 28, margin: "0 auto", border: "1px solid " + (step.state === "upcoming" ? "#94a3b8" : "#0f172a"), borderRadius: "50%", background: step.state === "current" ? "#0f172a" : "#fff", color: step.state === "current" ? "#fff" : "#0f172a", fontSize: 13, fontWeight: 700 }, children: step.state === "complete" || step.state === "current" ? "\u2713" : index + 1 }),
2315
+ /* @__PURE__ */ jsx6("span", { style: { display: "block", marginTop: 6, overflowWrap: "anywhere", fontSize: 11, lineHeight: 1.25 }, children: step.label }),
2316
+ step.date ? /* @__PURE__ */ jsx6("span", { style: { display: "block", marginTop: 3, color: "#94a3b8", fontSize: 10, lineHeight: 1.2 }, children: step.date }) : null
2062
2317
  ] }, step.id)) });
2063
2318
  }
2064
2319
  function TrackingEvents({ result }) {
2065
- const [expanded, setExpanded] = useState3(false);
2066
- const events = result.events ?? (result.latestEvent ? [{ id: "latest", title: result.latestEvent, at: result.updatedAt, state: "current" }] : []);
2067
- if (!events.length) return /* @__PURE__ */ jsx5("p", { style: { margin: "12px 0 0", color: "#64748b", fontSize: 14 }, children: "Tracking events are not available yet. Please try again later." });
2068
- const visibleEvents = events.slice(0, expanded ? 50 : 3);
2069
- return /* @__PURE__ */ jsxs5("div", { "aria-label": "Shipping events", style: { marginTop: 16 }, children: [
2070
- /* @__PURE__ */ jsx5("ol", { style: { display: "grid", gap: 14, margin: 0, padding: 0, listStyle: "none" }, children: visibleEvents.map((event, index) => /* @__PURE__ */ jsxs5("li", { style: { position: "relative", minWidth: 0, paddingLeft: 22, overflowWrap: "anywhere" }, children: [
2071
- /* @__PURE__ */ jsx5("span", { "aria-hidden": "true", style: { position: "absolute", left: 0, top: 4, width: 10, height: 10, borderRadius: "50%", background: event.state === "current" || index === 0 ? "#111827" : "#cbd5e1" } }),
2072
- /* @__PURE__ */ jsx5("strong", { style: { display: "block", fontSize: 14 }, children: event.title }),
2073
- event.detail ? /* @__PURE__ */ jsx5("span", { style: { display: "block", marginTop: 2, color: "#64748b", fontSize: 13 }, children: event.detail }) : null,
2074
- event.at ? /* @__PURE__ */ jsx5("time", { style: { display: "block", marginTop: 3, color: "#94a3b8", fontSize: 12 }, children: event.at }) : null
2075
- ] }, event.id)) }),
2076
- events.length > 3 ? /* @__PURE__ */ jsx5("button", { type: "button", onClick: () => setExpanded((current) => !current), style: { minWidth: 44, minHeight: 44, marginTop: 14, padding: "6px 12px", border: "1px solid #cbd5e1", borderRadius: 6, background: "#fff", color: "#0f172a", font: "inherit", fontSize: 13, cursor: "pointer" }, children: expanded ? "Show recent events" : "Show all events" }) : null
2077
- ] });
2320
+ const events = trackingEvents(result);
2321
+ if (!events.length) return /* @__PURE__ */ jsx6("p", { style: { margin: "12px 0 0", color: "#64748b", fontSize: 14 }, children: "Tracking events are not available yet. Please try again later." });
2322
+ return /* @__PURE__ */ jsx6("div", { "aria-label": "Shipping events", style: { marginTop: 16 }, children: /* @__PURE__ */ jsx6("ol", { style: { display: "grid", gap: 14, margin: 0, padding: 0, listStyle: "none" }, children: events.map((event, index) => /* @__PURE__ */ jsxs5("li", { style: { position: "relative", minWidth: 0, paddingLeft: 22, overflowWrap: "anywhere" }, children: [
2323
+ /* @__PURE__ */ jsx6("span", { "aria-hidden": "true", style: { position: "absolute", left: 0, top: 4, width: 10, height: 10, borderRadius: "50%", background: event.state === "current" || index === 0 ? "#111827" : "#cbd5e1" } }),
2324
+ /* @__PURE__ */ jsx6("strong", { style: { display: "block", fontSize: 14 }, children: event.title }),
2325
+ event.detail ? /* @__PURE__ */ jsx6("span", { style: { display: "block", marginTop: 2, color: "#64748b", fontSize: 13 }, children: event.detail }) : null,
2326
+ event.at ? /* @__PURE__ */ jsx6("time", { style: { display: "block", marginTop: 3, color: "#94a3b8", fontSize: 12 }, children: event.at }) : null
2327
+ ] }, event.id)) }) });
2078
2328
  }
2079
2329
  function TrackingOrderItemImage({ src, title }) {
2080
- const [failed, setFailed] = useState3(false);
2330
+ const [failed, setFailed] = useState4(false);
2081
2331
  const imageUrl = safeTrackingPageUrl(src);
2082
- if (!imageUrl || failed) return /* @__PURE__ */ jsx5("span", { "aria-label": title + " image unavailable", style: { display: "grid", width: 56, height: 56, placeItems: "center", borderRadius: 6, background: "#e2e8f0", color: "#64748b", fontSize: 13 }, children: title.slice(0, 1).toUpperCase() });
2083
- return /* @__PURE__ */ jsx5("img", { src: imageUrl, alt: "", onError: () => setFailed(true), style: { width: 56, height: 56, borderRadius: 6, objectFit: "cover", background: "#f1f5f9" } });
2332
+ if (!imageUrl || failed) return /* @__PURE__ */ jsx6("span", { "aria-label": title + " image unavailable", style: { display: "grid", width: 56, height: 56, placeItems: "center", borderRadius: 6, background: "#e2e8f0", color: "#64748b", fontSize: 13 }, children: title.slice(0, 1).toUpperCase() });
2333
+ return /* @__PURE__ */ jsx6("img", { src: imageUrl, alt: "", onError: () => setFailed(true), style: { width: 56, height: 56, borderRadius: 6, objectFit: "cover", background: "#f1f5f9" } });
2084
2334
  }
2085
2335
  function TrackingOrderItems({ items }) {
2086
- if (!items.length) return null;
2087
2336
  return /* @__PURE__ */ jsxs5("section", { "aria-label": "Order items", style: { marginTop: 24, borderTop: "1px solid #e2e8f0", paddingTop: 18 }, children: [
2088
- /* @__PURE__ */ jsx5("h2", { style: { margin: 0, fontSize: 16 }, children: "Items in your order" }),
2089
- /* @__PURE__ */ jsx5("div", { style: { display: "grid", gap: 12, marginTop: 12 }, children: items.map((item) => {
2090
- const price = item.price ? formatTrackingPageMoney(item.price) : void 0;
2091
- const href = safeTrackingPageUrl(item.href);
2092
- return /* @__PURE__ */ jsxs5("article", { style: { display: "grid", gridTemplateColumns: "56px minmax(0, 1fr)", gap: 12, alignItems: "center" }, children: [
2093
- /* @__PURE__ */ jsx5(TrackingOrderItemImage, { src: item.imageUrl, title: item.title }),
2094
- /* @__PURE__ */ jsxs5("div", { style: { minWidth: 0, overflowWrap: "anywhere" }, children: [
2095
- href ? /* @__PURE__ */ jsx5("a", { href, style: { color: "inherit", fontWeight: 700, overflowWrap: "anywhere" }, children: item.title }) : /* @__PURE__ */ jsx5("strong", { style: { overflowWrap: "anywhere" }, children: item.title }),
2096
- item.description ? /* @__PURE__ */ jsx5("p", { style: { margin: "3px 0 0", color: "#64748b", fontSize: 13 }, children: item.description }) : null,
2097
- /* @__PURE__ */ jsxs5("p", { style: { display: "flex", flexWrap: "wrap", gap: 8, margin: "4px 0 0", color: "#475569", fontSize: 13 }, children: [
2098
- /* @__PURE__ */ jsxs5("span", { children: [
2099
- "Qty ",
2100
- item.quantity
2337
+ /* @__PURE__ */ jsx6("h2", { style: { margin: 0, fontSize: 16 }, children: "Items in your order" }),
2338
+ /* @__PURE__ */ jsxs5("div", { style: { display: "grid", gap: 12, marginTop: 12 }, children: [
2339
+ !items.length ? /* @__PURE__ */ jsx6("p", { style: { margin: 0, color: "#64748b", fontSize: 14 }, children: "Package contents are not available for this shipment." }) : null,
2340
+ items.map((item) => {
2341
+ const price = item.price ? formatTrackingPageMoney(item.price) : void 0;
2342
+ const href = safeTrackingPageUrl(item.href);
2343
+ return /* @__PURE__ */ jsxs5("article", { style: { display: "grid", gridTemplateColumns: "56px minmax(0, 1fr)", gap: 12, alignItems: "center" }, children: [
2344
+ /* @__PURE__ */ jsx6(TrackingOrderItemImage, { src: item.imageUrl, title: item.title }),
2345
+ /* @__PURE__ */ jsxs5("div", { style: { minWidth: 0, overflowWrap: "anywhere" }, children: [
2346
+ href ? /* @__PURE__ */ jsx6("a", { href, style: { color: "inherit", fontWeight: 700, overflowWrap: "anywhere" }, children: item.title }) : /* @__PURE__ */ jsx6("strong", { style: { overflowWrap: "anywhere" }, children: item.title }),
2347
+ item.description ? /* @__PURE__ */ jsx6("p", { style: { margin: "3px 0 0", color: "#64748b", fontSize: 13 }, children: item.description }) : null,
2348
+ /* @__PURE__ */ jsxs5("p", { style: { display: "flex", flexWrap: "wrap", gap: 8, margin: "4px 0 0", color: "#475569", fontSize: 13 }, children: [
2349
+ /* @__PURE__ */ jsxs5("span", { children: [
2350
+ "Qty ",
2351
+ item.quantity
2352
+ ] }),
2353
+ price?.amount ? /* @__PURE__ */ jsxs5("span", { children: [
2354
+ price.amount,
2355
+ price.startsAt ? " and up" : ""
2356
+ ] }) : null,
2357
+ price?.compareAt ? /* @__PURE__ */ jsx6("s", { style: { color: "#94a3b8" }, children: price.compareAt }) : null
2101
2358
  ] }),
2102
- price?.amount ? /* @__PURE__ */ jsxs5("span", { children: [
2103
- price.amount,
2104
- price.startsAt ? " and up" : ""
2105
- ] }) : null,
2106
- price?.compareAt ? /* @__PURE__ */ jsx5("s", { style: { color: "#94a3b8" }, children: price.compareAt }) : null
2359
+ href ? /* @__PURE__ */ jsx6("a", { href, style: { display: "inline-flex", alignItems: "center", minHeight: 32, marginTop: 6, padding: "6px 12px", border: "1px solid #cbd5e1", borderRadius: 6, color: "inherit", fontSize: 13 }, children: "Reorder" }) : null
2107
2360
  ] })
2108
- ] })
2109
- ] }, item.id);
2110
- }) })
2361
+ ] }, item.id);
2362
+ })
2363
+ ] })
2111
2364
  ] });
2112
2365
  }
2113
- function TrackingQueryResultDetails({ result, onTrackAnother, trackAnotherLabel = "Track another" }) {
2114
- const [copied, setCopied] = useState3(false);
2115
- const progress = result.progress?.length === 5 ? result.progress : defaultProgress2(result.status);
2366
+ function TrackingQueryResultDetails({ result, onTrackAnother, trackAnotherLabel = "Track another", showShipments = true }) {
2367
+ const [copied, setCopied] = useState4(false);
2368
+ const runtime = useTrackingRuntime();
2369
+ const visibility = trackingBlockState(runtime);
2370
+ const progress = trackingSteps(result);
2371
+ const { identity, shipmentValues } = trackingSelection(result, runtime.recentQueries);
2116
2372
  const copyTrackingNumber = () => {
2117
2373
  if (typeof navigator !== "undefined" && navigator.clipboard?.writeText) {
2118
2374
  void navigator.clipboard.writeText(result.trackingNumber).then(() => setCopied(true)).catch(() => void 0);
2119
2375
  }
2120
2376
  };
2121
2377
  return /* @__PURE__ */ jsxs5("section", { "aria-label": "Tracking result details", style: { minWidth: 0, overflowWrap: "anywhere" }, children: [
2378
+ identity.values.length > 1 ? /* @__PURE__ */ jsx6(TrackPageOrderBadges, { values: identity.values, selectedIndex: runtime.selectedRecentIndex, onSelect: runtime.selectRecentQuery, style: { marginBottom: 16 } }) : identity.values[0] ? /* @__PURE__ */ jsx6("div", { style: { marginBottom: 16 }, children: /* @__PURE__ */ jsx6(TrackPageQueryNumber, { mode: identity.mode, value: identity.values[0] }) }) : null,
2379
+ showShipments && shipmentValues.length > 1 ? /* @__PURE__ */ jsx6(TrackPageOrderBadges, { values: shipmentValues, selectedIndex: runtime.selectedShipmentIndex, onSelect: runtime.selectShipment, style: { marginBottom: 16 } }) : null,
2122
2380
  /* @__PURE__ */ jsxs5("div", { style: { display: "flex", flexWrap: "wrap", alignItems: "start", justifyContent: "space-between", gap: 12 }, children: [
2123
2381
  /* @__PURE__ */ jsxs5("div", { style: { minWidth: 0, flex: "1 1 180px" }, children: [
2124
2382
  /* @__PURE__ */ jsxs5("strong", { style: { fontSize: 17 }, children: [
2125
2383
  "Your order is ",
2126
2384
  result.status || "being updated"
2127
2385
  ] }),
2128
- result.estimatedDelivery ? /* @__PURE__ */ jsxs5("p", { style: { margin: "5px 0 0", color: "#475569", fontSize: 14 }, children: [
2386
+ visibility.showEstimatedDelivery && result.estimatedDelivery ? /* @__PURE__ */ jsxs5("p", { style: { margin: "5px 0 0", color: "#475569", fontSize: 14 }, children: [
2129
2387
  "Estimated delivery: ",
2130
2388
  result.estimatedDelivery
2131
2389
  ] }) : null
2132
2390
  ] }),
2133
- onTrackAnother ? /* @__PURE__ */ jsx5("button", { type: "button", onClick: onTrackAnother, style: { minWidth: 44, minHeight: 44, flex: "0 0 auto", padding: "6px 10px", border: "1px solid #cbd5e1", borderRadius: 6, background: "#fff", color: "#0f172a", font: "inherit", fontSize: 12, cursor: "pointer" }, children: trackAnotherLabel }) : null
2391
+ onTrackAnother ? /* @__PURE__ */ jsx6("button", { type: "button", onClick: onTrackAnother, style: { minWidth: 44, minHeight: 44, flex: "0 0 auto", padding: "6px 10px", border: "1px solid #cbd5e1", borderRadius: 6, background: "#fff", color: "#0f172a", font: "inherit", fontSize: 12, cursor: "pointer" }, children: trackAnotherLabel }) : null
2134
2392
  ] }),
2135
- /* @__PURE__ */ jsx5(TrackingProgressDetails, { steps: progress }),
2393
+ /* @__PURE__ */ jsx6(TrackingProgressDetails, { steps: progress }),
2136
2394
  /* @__PURE__ */ jsxs5("div", { style: { display: "grid", gridTemplateColumns: "repeat(auto-fit, minmax(min(100%, 140px), 1fr))", gap: 10, marginTop: 22, padding: 12, borderRadius: 8, background: "#f8fafc", color: "#334155", fontSize: 13 }, children: [
2137
2395
  /* @__PURE__ */ jsxs5("span", { style: { minWidth: 0, overflowWrap: "anywhere" }, children: [
2138
- /* @__PURE__ */ jsx5("strong", { children: "Carrier" }),
2139
- /* @__PURE__ */ jsx5("br", {}),
2140
- result.carrier || "\u2014"
2396
+ /* @__PURE__ */ jsx6("strong", { children: "Carrier" }),
2397
+ /* @__PURE__ */ jsx6("br", {}),
2398
+ result.carrier ?? "Not available"
2141
2399
  ] }),
2142
2400
  /* @__PURE__ */ jsxs5("span", { style: { minWidth: 0, overflowWrap: "anywhere" }, children: [
2143
- /* @__PURE__ */ jsx5("strong", { children: "Tracking number" }),
2144
- /* @__PURE__ */ jsx5("br", {}),
2145
- /* @__PURE__ */ jsx5("span", { children: result.trackingNumber }),
2401
+ /* @__PURE__ */ jsx6("strong", { children: "Tracking number" }),
2402
+ /* @__PURE__ */ jsx6("br", {}),
2403
+ /* @__PURE__ */ jsx6("span", { children: result.trackingNumber }),
2146
2404
  " ",
2147
- /* @__PURE__ */ jsx5("button", { type: "button", onClick: copyTrackingNumber, style: { minWidth: 44, minHeight: 44, border: 0, background: "transparent", color: "#0f172a", font: "inherit", fontSize: 12, fontWeight: 700, cursor: "pointer" }, children: copied ? "Copied" : "Copy" })
2405
+ /* @__PURE__ */ jsx6("button", { type: "button", onClick: copyTrackingNumber, style: { minWidth: 44, minHeight: 44, border: 0, background: "transparent", color: "#0f172a", font: "inherit", fontSize: 12, fontWeight: 700, cursor: "pointer" }, children: copied ? "Copied" : "Copy" })
2148
2406
  ] }),
2149
2407
  /* @__PURE__ */ jsxs5("span", { style: { minWidth: 0, overflowWrap: "anywhere" }, children: [
2150
- /* @__PURE__ */ jsx5("strong", { children: "Destination" }),
2151
- /* @__PURE__ */ jsx5("br", {}),
2152
- result.destination || "\u2014"
2408
+ /* @__PURE__ */ jsx6("strong", { children: "Destination" }),
2409
+ /* @__PURE__ */ jsx6("br", {}),
2410
+ result.destination ?? "Destination details are not available."
2153
2411
  ] }),
2154
2412
  /* @__PURE__ */ jsxs5("span", { style: { minWidth: 0, overflowWrap: "anywhere" }, children: [
2155
- /* @__PURE__ */ jsx5("strong", { children: "Transit time" }),
2156
- /* @__PURE__ */ jsx5("br", {}),
2413
+ /* @__PURE__ */ jsx6("strong", { children: "Transit time" }),
2414
+ /* @__PURE__ */ jsx6("br", {}),
2157
2415
  result.transitDuration || "\u2014"
2158
2416
  ] }),
2159
2417
  result.orderNumber ? /* @__PURE__ */ jsxs5("span", { style: { minWidth: 0, overflowWrap: "anywhere" }, children: [
2160
- /* @__PURE__ */ jsx5("strong", { children: "Order number" }),
2161
- /* @__PURE__ */ jsx5("br", {}),
2418
+ /* @__PURE__ */ jsx6("strong", { children: "Order number" }),
2419
+ /* @__PURE__ */ jsx6("br", {}),
2162
2420
  result.orderNumber
2163
2421
  ] }) : null
2164
2422
  ] }),
2165
2423
  /* @__PURE__ */ jsxs5("section", { "aria-label": "Tracking timeline", style: { marginTop: 24, borderTop: "1px solid #e2e8f0", paddingTop: 18 }, children: [
2166
- /* @__PURE__ */ jsx5("h2", { style: { margin: 0, fontSize: 16 }, children: "Tracking timeline" }),
2167
- /* @__PURE__ */ jsx5(TrackingEvents, { result })
2424
+ /* @__PURE__ */ jsx6("h2", { style: { margin: 0, fontSize: 16 }, children: "Tracking timeline" }),
2425
+ /* @__PURE__ */ jsx6(TrackingEvents, { result })
2168
2426
  ] }),
2169
- /* @__PURE__ */ jsx5(TrackingOrderItems, { items: result.orderItems ?? [] })
2427
+ /* @__PURE__ */ jsx6(TrackingPageAdSlot, { ad: result.ad }),
2428
+ /* @__PURE__ */ jsx6(TrackingOrderItems, { items: result.orderItems ?? [] })
2170
2429
  ] });
2171
2430
  }
2172
2431
 
2173
2432
  // src/branded.tsx
2174
- import { jsx as jsx6, jsxs as jsxs6 } from "react/jsx-runtime";
2175
- var initialRuntime2 = {
2176
- phase: "idle",
2177
- selectedShipmentId: null,
2178
- async query() {
2179
- return void 0;
2180
- },
2181
- reset() {
2182
- return void 0;
2183
- },
2184
- selectShipment() {
2185
- return void 0;
2186
- }
2187
- };
2188
- var BrandedRuntimeContext = createContext2(initialRuntime2);
2433
+ import { jsx as jsx7, jsxs as jsxs6 } from "react/jsx-runtime";
2434
+ var BrandedRuntimeProvider = TrackingRuntimeProvider;
2435
+ var useBrandedRuntime = useTrackingRuntime;
2189
2436
  var contentWidth2 = { width: "min(1200px, 100%)", margin: "0 auto", padding: "0 clamp(16px, 4vw, 48px)", boxSizing: "border-box" };
2190
2437
  var cardStyle = { background: "#fff", color: "#0a0a0a", border: "1px solid #e7e7e7", borderRadius: 10, fontFamily: "var(--pb-font-family)" };
2191
- function BrandedRuntimeProvider({ children, query: injectedQuery, watermark }) {
2192
- const [state, setState] = useState4({ phase: "idle" });
2193
- const [selectedShipmentId, setSelectedShipmentId] = useState4(null);
2194
- const requestId = useRef3(0);
2195
- const query = useCallback3(async (request) => {
2196
- const currentRequestId = ++requestId.current;
2197
- setState({ phase: "loading" });
2198
- try {
2199
- if (!injectedQuery) throw new Error("tracking-query-not-configured");
2200
- const result = await injectedQuery(request);
2201
- if (currentRequestId !== requestId.current) return;
2202
- setSelectedShipmentId(result.shipments?.[0]?.id ?? null);
2203
- setState({ phase: isEmptyTrackingPageResult(result) ? "empty" : "success", result });
2204
- } catch {
2205
- if (currentRequestId !== requestId.current) return;
2206
- setState({ phase: "error", error: "tracking-query-failed" });
2207
- }
2208
- }, [injectedQuery]);
2209
- const reset = useCallback3(() => {
2210
- requestId.current += 1;
2211
- setSelectedShipmentId(null);
2212
- setState({ phase: "idle" });
2213
- }, []);
2214
- const displayedResult = useMemo3(() => {
2215
- if (!state.result) return void 0;
2216
- const shipment = state.result.shipments?.find((item) => item.id === selectedShipmentId);
2217
- return shipment ? { ...state.result, ...shipment } : state.result;
2218
- }, [selectedShipmentId, state.result]);
2219
- const selectShipment = useCallback3((id) => {
2220
- if (state.result?.shipments?.some((shipment) => shipment.id === id)) setSelectedShipmentId(id);
2221
- }, [state.result]);
2222
- const value = useMemo3(
2223
- () => ({ ...state, displayedResult, selectedShipmentId, query, reset, selectShipment, watermark }),
2224
- [displayedResult, query, reset, selectedShipmentId, selectShipment, state, watermark]
2225
- );
2226
- return /* @__PURE__ */ jsx6(BrandedRuntimeContext.Provider, { value, children });
2227
- }
2228
- function useBrandedRuntime() {
2229
- return useContext2(BrandedRuntimeContext);
2230
- }
2231
2438
  function RuntimeWatermark2({ watermark }) {
2232
- return watermark?.visible ? /* @__PURE__ */ jsx6("small", { style: { display: "block", marginTop: 10, color: "#8a8a8a", fontSize: 8, textAlign: "right" }, children: watermark.label || "Powered by BestTrack" }) : null;
2439
+ return watermark?.visible ? /* @__PURE__ */ jsx7("small", { style: { display: "block", marginTop: 10, color: "#8a8a8a", fontSize: 8, textAlign: "right" }, children: watermark.label || "Powered by BestTrack" }) : null;
2233
2440
  }
2234
2441
  function text3(props, key, fallback) {
2235
2442
  return typeof props[key] === "string" ? props[key] : fallback;
@@ -2240,31 +2447,31 @@ function shipmentLabels(value) {
2240
2447
  return typeof value === "string" ? value.split("|").map((label, index) => ({ id: "configured-" + index, label: label.trim() })).filter((item) => item.label) : [];
2241
2448
  }
2242
2449
  function ProductImage2({ src, alt }) {
2243
- const [failed, setFailed] = useState4(false);
2450
+ const [failed, setFailed] = useState5(false);
2244
2451
  const safeSrc = safeImageUrl2(src);
2245
2452
  if (!safeSrc || failed) {
2246
- return /* @__PURE__ */ jsx6("span", { "aria-label": alt + " image unavailable", style: { display: "grid", placeItems: "center", width: 72, height: 72, flex: "0 0 auto", borderRadius: 6, background: "#f2f2f2", color: "#6b6b6b", fontSize: 14 }, children: alt.slice(0, 1).toUpperCase() });
2453
+ return /* @__PURE__ */ jsx7("span", { "aria-label": alt + " image unavailable", style: { display: "grid", placeItems: "center", width: 72, height: 72, flex: "0 0 auto", borderRadius: 6, background: "#f2f2f2", color: "#6b6b6b", fontSize: 14 }, children: alt.slice(0, 1).toUpperCase() });
2247
2454
  }
2248
- return /* @__PURE__ */ jsx6("img", { src: safeSrc, alt, onError: () => setFailed(true), style: { width: 72, height: 72, flex: "0 0 auto", borderRadius: 6, objectFit: "cover", background: "#f2f2f2" } });
2455
+ return /* @__PURE__ */ jsx7("img", { src: safeSrc, alt, onError: () => setFailed(true), style: { width: 72, height: 72, flex: "0 0 auto", borderRadius: 6, objectFit: "cover", background: "#f2f2f2" } });
2249
2456
  }
2250
- function ShipmentSwitcher({ shipmentLabels: configuredLabels }) {
2457
+ function ShipmentSwitcher() {
2251
2458
  const runtime = useBrandedRuntime();
2252
- const configuredShipments = shipmentLabels(configuredLabels);
2253
- const shipments = runtime.phase === "idle" || runtime.phase === "loading" ? configuredShipments : runtime.result?.shipments ?? [];
2254
- if (!shipments.length) return null;
2255
- return /* @__PURE__ */ jsx6("div", { "aria-label": "Shipment switcher", style: { ...contentWidth2, minWidth: 0, minHeight: 56, display: "flex", alignItems: "center", gap: 8, overflowX: "auto", whiteSpace: "nowrap" }, children: shipments.map((shipment, index) => {
2256
- const selected = (runtime.selectedShipmentId ?? shipments[0]?.id) === shipment.id;
2257
- return /* @__PURE__ */ jsx6("button", { type: "button", onClick: () => runtime.selectShipment(shipment.id), "aria-pressed": selected, style: { minWidth: 92, minHeight: 44, padding: "0 12px", border: selected ? "1px solid #1a1a1a" : "1px solid #e7e7e7", borderRadius: 4, background: "#fff", color: "#0a0a0a", fontSize: 11, fontWeight: selected ? 700 : 400, cursor: "pointer" }, children: shipment.label || "Shipment #" + (index + 1) }, shipment.id);
2459
+ const shipments = trackingBlockState(runtime).showResult ? runtime.result?.shipments ?? [] : [];
2460
+ if (shipments.length < 2 || !runtime.result) return null;
2461
+ const { shipmentValues } = trackingSelection(runtime.result, runtime.recentQueries);
2462
+ return /* @__PURE__ */ jsx7("div", { "aria-label": "Shipment switcher", style: { ...contentWidth2, minWidth: 0, minHeight: 56, display: "flex", alignItems: "center", gap: 8, overflowX: "auto", whiteSpace: "nowrap" }, children: shipments.map((shipment, index) => {
2463
+ const selected = runtime.selectedShipmentIndex === index;
2464
+ return /* @__PURE__ */ jsx7("button", { type: "button", onClick: () => runtime.selectShipment(index), "aria-pressed": selected, style: { minWidth: 92, minHeight: 44, padding: "0 12px", border: selected ? "1px solid #1a1a1a" : "1px solid #e7e7e7", borderRadius: 4, background: "#fff", color: "#0a0a0a", fontSize: 11, fontWeight: selected ? 700 : 400, cursor: "pointer" }, children: shipmentValues[index] }, shipment.id);
2258
2465
  }) });
2259
2466
  }
2260
2467
  function QueryHero(props) {
2261
2468
  const runtime = useBrandedRuntime();
2262
- const [heroImageFailed, setHeroImageFailed] = useState4(false);
2263
- const result = runtime.displayedResult;
2469
+ const [heroImageFailed, setHeroImageFailed] = useState5(false);
2470
+ const result = runtime.result;
2264
2471
  return /* @__PURE__ */ jsxs6("div", { style: { position: "relative", minWidth: 0, minHeight: "clamp(520px, 44vw, 560px)", display: "grid", overflow: "hidden", background: "linear-gradient(135deg, #dedbd4, #b9b3aa)" }, children: [
2265
- !heroImageFailed && safeImageUrl2(props.heroImageUrl) ? /* @__PURE__ */ jsx6("img", { src: safeImageUrl2(props.heroImageUrl), alt: "", onError: () => setHeroImageFailed(true), style: { position: "absolute", inset: 0, width: "100%", height: "100%", objectFit: "cover" } }) : null,
2266
- /* @__PURE__ */ jsx6("div", { "aria-hidden": "true", style: { position: "absolute", inset: 0, background: "rgba(255,255,255,0.12)" } }),
2267
- /* @__PURE__ */ jsx6("div", { style: { ...contentWidth2, position: "relative", zIndex: 1, display: "grid", alignItems: "center", width: "100%", minWidth: 0, paddingTop: "clamp(24px, 5vw, 48px)", paddingBottom: "clamp(24px, 5vw, 48px)" }, children: /* @__PURE__ */ jsx6(
2472
+ !heroImageFailed && safeImageUrl2(props.heroImageUrl) ? /* @__PURE__ */ jsx7("img", { src: safeImageUrl2(props.heroImageUrl), alt: "", onError: () => setHeroImageFailed(true), style: { position: "absolute", inset: 0, width: "100%", height: "100%", objectFit: "cover" } }) : null,
2473
+ /* @__PURE__ */ jsx7("div", { "aria-hidden": "true", style: { position: "absolute", inset: 0, background: "rgba(255,255,255,0.12)" } }),
2474
+ /* @__PURE__ */ jsx7("div", { style: { ...contentWidth2, position: "relative", zIndex: 1, display: "grid", alignItems: "center", width: "100%", minWidth: 0, paddingTop: "clamp(24px, 5vw, 48px)", paddingBottom: "clamp(24px, 5vw, 48px)" }, children: /* @__PURE__ */ jsx7(
2268
2475
  TrackingQueryCard,
2269
2476
  {
2270
2477
  phase: runtime.phase,
@@ -2288,34 +2495,38 @@ function QueryHero(props) {
2288
2495
  formStyle: { gap: 12 },
2289
2496
  inputStyle: { width: "100%", height: 48, padding: "0 16px", boxSizing: "border-box", border: "1px solid #e2e2e2", borderRadius: 10, font: "inherit" },
2290
2497
  submitStyle: (loading) => ({ width: "100%", minHeight: 48, marginTop: 12, border: 0, borderRadius: 10, background: loading ? "#6b6b6b" : "#000", color: "#fff", font: "inherit", cursor: loading ? "wait" : "pointer" }),
2291
- result: result ? /* @__PURE__ */ jsx6(TrackingQueryResultDetails, { result, onTrackAnother: runtime.reset, trackAnotherLabel: text3(props, "trackAnotherLabel", "Track another order") }) : null,
2498
+ result: result ? /* @__PURE__ */ jsx7(TrackingQueryResultDetails, { showShipments: false, result, onTrackAnother: runtime.reset, trackAnotherLabel: text3(props, "trackAnotherLabel", "Track another order") }) : null,
2292
2499
  resultStyle: { padding: 16, border: "1px solid #e7e7e7", borderRadius: 8, background: "#fffdf0" },
2293
- watermark: /* @__PURE__ */ jsx6(RuntimeWatermark2, { watermark: runtime.watermark })
2500
+ watermark: /* @__PURE__ */ jsx7(RuntimeWatermark2, { watermark: runtime.watermark })
2294
2501
  }
2295
2502
  ) })
2296
2503
  ] });
2297
2504
  }
2298
2505
  function PackageContents2({ items }) {
2299
- if (!items?.length) return /* @__PURE__ */ jsx6("p", { style: { margin: 0, color: "#6b6b6b" }, children: "Package contents are not available for this shipment." });
2300
- return /* @__PURE__ */ jsx6("div", { style: { display: "grid", gap: 16 }, children: items.map((item) => /* @__PURE__ */ jsxs6("article", { style: { display: "flex", alignItems: "flex-start", gap: 14, minWidth: 0 }, children: [
2301
- /* @__PURE__ */ jsx6(ProductImage2, { src: item.imageUrl, alt: item.title }),
2302
- /* @__PURE__ */ jsxs6("div", { style: { minWidth: 0, overflowWrap: "anywhere" }, children: [
2303
- /* @__PURE__ */ jsx6("strong", { children: item.title }),
2304
- /* @__PURE__ */ jsx6("p", { style: { margin: "5px 0", color: "#6b6b6b", fontSize: 14 }, children: item.description ?? "Product details are available in your order." }),
2305
- /* @__PURE__ */ jsxs6("small", { style: { color: "#6b6b6b" }, children: [
2306
- "Qty ",
2307
- item.quantity
2506
+ if (!items?.length) return /* @__PURE__ */ jsx7("p", { style: { margin: 0, color: "#6b6b6b" }, children: "Package contents are not available for this shipment." });
2507
+ return /* @__PURE__ */ jsx7("div", { style: { display: "grid", gap: 16 }, children: items.map((item) => {
2508
+ const href = safeHref2(item.href);
2509
+ return /* @__PURE__ */ jsxs6("article", { style: { display: "flex", alignItems: "flex-start", gap: 14, minWidth: 0 }, children: [
2510
+ /* @__PURE__ */ jsx7(ProductImage2, { src: item.imageUrl, alt: item.title }),
2511
+ /* @__PURE__ */ jsxs6("div", { style: { minWidth: 0, overflowWrap: "anywhere" }, children: [
2512
+ /* @__PURE__ */ jsx7("strong", { children: item.title }),
2513
+ item.description ? /* @__PURE__ */ jsx7("p", { style: { margin: "5px 0", color: "#6b6b6b", fontSize: 14 }, children: item.description }) : null,
2514
+ /* @__PURE__ */ jsxs6("small", { style: { color: "#6b6b6b" }, children: [
2515
+ "Qty ",
2516
+ item.quantity
2517
+ ] }),
2518
+ href ? /* @__PURE__ */ jsx7("a", { href, style: { display: "inline-flex", alignItems: "center", minHeight: 32, marginLeft: 8, padding: "6px 12px", border: "1px solid #e7e7e7", borderRadius: 6, color: "inherit", fontSize: 13 }, children: "Reorder" }) : null
2308
2519
  ] })
2309
- ] })
2310
- ] }, item.id)) });
2520
+ ] }, item.id);
2521
+ }) });
2311
2522
  }
2312
2523
  function BrandedTextField({ value, onChange }) {
2313
- return /* @__PURE__ */ jsx6("input", { "aria-label": "Branded text", value: typeof value === "string" ? value : "", onChange: (event) => onChange(event.target.value) });
2524
+ return /* @__PURE__ */ jsx7("input", { "aria-label": "Branded text", value: typeof value === "string" ? value : "", onChange: (event) => onChange(event.target.value) });
2314
2525
  }
2315
2526
  function InlineText2({ block, name, fallback }) {
2316
2527
  const value = text3(block, name, fallback);
2317
- if (!block.selected) return /* @__PURE__ */ jsx6("span", { "data-branded-editor-field": name, children: value });
2318
- return /* @__PURE__ */ jsx6(
2528
+ if (!block.selected) return /* @__PURE__ */ jsx7("span", { "data-branded-editor-field": name, children: value });
2529
+ return /* @__PURE__ */ jsx7(
2319
2530
  "input",
2320
2531
  {
2321
2532
  "aria-label": "Canvas " + name,
@@ -2345,22 +2556,22 @@ function InlineText2({ block, name, fallback }) {
2345
2556
  );
2346
2557
  }
2347
2558
  function EditorSurface({ block, children }) {
2348
- return /* @__PURE__ */ jsx6("section", { "aria-label": "Branded editor preview", style: { ...cardStyle, outline: block.selected ? "2px solid #2563eb" : "1px dashed #cbd5e1", outlineOffset: -2, padding: 24 }, children });
2559
+ return /* @__PURE__ */ jsx7("section", { "aria-label": "Branded editor preview", style: { ...cardStyle, outline: block.selected ? "2px solid #2563eb" : "1px dashed #cbd5e1", outlineOffset: -2, padding: 24 }, children });
2349
2560
  }
2350
2561
  function BrandedAnnouncementEditor(block) {
2351
- return /* @__PURE__ */ jsx6("section", { "aria-label": "Branded announcement editor", style: { minHeight: 36, display: "grid", placeItems: "center", padding: "0 16px", background: "#252525", color: "#fff", fontFamily: "var(--pb-font-family)", fontSize: 12, textAlign: "center" }, children: /* @__PURE__ */ jsx6(InlineText2, { block, name: "message", fallback: "Check out our summer sale" }) });
2562
+ return /* @__PURE__ */ jsx7("section", { "aria-label": "Branded announcement editor", style: { minHeight: 36, display: "grid", placeItems: "center", padding: "0 16px", background: "#252525", color: "#fff", fontFamily: "var(--pb-font-family)", fontSize: 12, textAlign: "center" }, children: /* @__PURE__ */ jsx7(InlineText2, { block, name: "message", fallback: "Check out our summer sale" }) });
2352
2563
  }
2353
2564
  function BrandedTrackingExperienceEditor(block) {
2354
2565
  const labels = shipmentLabels(block.shipmentLabels);
2355
2566
  return /* @__PURE__ */ jsxs6("section", { "aria-label": "Branded tracking experience editor", style: { background: "#fffdf0", fontFamily: "var(--pb-font-family)" }, children: [
2356
- /* @__PURE__ */ jsx6("div", { style: { ...contentWidth2, minHeight: 56, display: "flex", alignItems: "center", gap: 8, overflowX: "auto" }, children: labels.map((shipment, index) => /* @__PURE__ */ jsx6("span", { style: { minWidth: 92, padding: "9px 12px", border: index === 0 ? "1px solid #1a1a1a" : "1px solid #e7e7e7", borderRadius: 4, background: "#fff", fontSize: 11, fontWeight: index === 0 ? 700 : 400 }, children: shipment.label }, shipment.id)) }),
2357
- /* @__PURE__ */ jsx6("div", { style: { minHeight: 360, display: "grid", placeItems: "center", padding: 16, background: "linear-gradient(135deg, #dedbd4, #b9b3aa)" }, children: /* @__PURE__ */ jsxs6(EditorSurface, { block, children: [
2358
- /* @__PURE__ */ jsx6("h1", { style: { margin: "0 0 28px", textAlign: "center", fontSize: 32 }, children: /* @__PURE__ */ jsx6(InlineText2, { block, name: "heading", fallback: "Track your order" }) }),
2567
+ /* @__PURE__ */ jsx7("div", { style: { ...contentWidth2, minHeight: 56, display: "flex", alignItems: "center", gap: 8, overflowX: "auto" }, children: labels.map((shipment, index) => /* @__PURE__ */ jsx7("span", { style: { minWidth: 92, padding: "9px 12px", border: index === 0 ? "1px solid #1a1a1a" : "1px solid #e7e7e7", borderRadius: 4, background: "#fff", fontSize: 11, fontWeight: index === 0 ? 700 : 400 }, children: shipment.label }, shipment.id)) }),
2568
+ /* @__PURE__ */ jsx7("div", { style: { minHeight: 360, display: "grid", placeItems: "center", padding: 16, background: "linear-gradient(135deg, #dedbd4, #b9b3aa)" }, children: /* @__PURE__ */ jsxs6(EditorSurface, { block, children: [
2569
+ /* @__PURE__ */ jsx7("h1", { style: { margin: "0 0 28px", textAlign: "center", fontSize: 32 }, children: /* @__PURE__ */ jsx7(InlineText2, { block, name: "heading", fallback: "Track your order" }) }),
2359
2570
  /* @__PURE__ */ jsxs6("div", { style: { display: "grid", gridTemplateColumns: "1fr 1fr", borderBottom: "1px solid #e7e7e7", marginBottom: 20, textAlign: "center" }, children: [
2360
- /* @__PURE__ */ jsx6("span", { style: { padding: 10 }, children: /* @__PURE__ */ jsx6(InlineText2, { block, name: "orderTabLabel", fallback: "Order Number" }) }),
2361
- /* @__PURE__ */ jsx6("strong", { style: { padding: 10, borderBottom: "2px solid #0a0a0a" }, children: /* @__PURE__ */ jsx6(InlineText2, { block, name: "trackingTabLabel", fallback: "Tracking Number" }) })
2571
+ /* @__PURE__ */ jsx7("span", { style: { padding: 10 }, children: /* @__PURE__ */ jsx7(InlineText2, { block, name: "orderTabLabel", fallback: "Order Number" }) }),
2572
+ /* @__PURE__ */ jsx7("strong", { style: { padding: 10, borderBottom: "2px solid #0a0a0a" }, children: /* @__PURE__ */ jsx7(InlineText2, { block, name: "trackingTabLabel", fallback: "Tracking Number" }) })
2362
2573
  ] }),
2363
- /* @__PURE__ */ jsx6("input", { "aria-label": "Canvas default tracking number", readOnly: !block.selected, value: text3(block, "defaultTrackingNumber", "DEMO-YQTRACK9999"), onMouseDown: (event) => block.selected && event.stopPropagation(), onClick: (event) => block.selected && event.stopPropagation(), onChange: (event) => block.onPropsChange({ defaultTrackingNumber: event.currentTarget.value }), style: {
2574
+ /* @__PURE__ */ jsx7("input", { "aria-label": "Canvas default tracking number", readOnly: !block.selected, value: text3(block, "defaultTrackingNumber", "DEMO-YQTRACK9999"), onMouseDown: (event) => block.selected && event.stopPropagation(), onClick: (event) => block.selected && event.stopPropagation(), onChange: (event) => block.onPropsChange({ defaultTrackingNumber: event.currentTarget.value }), style: {
2364
2575
  width: "100%",
2365
2576
  height: 44,
2366
2577
  boxSizing: "border-box",
@@ -2371,42 +2582,42 @@ function BrandedTrackingExperienceEditor(block) {
2371
2582
  background: "#fff",
2372
2583
  font: "inherit"
2373
2584
  } }),
2374
- /* @__PURE__ */ jsx6("div", { style: { display: "grid", placeItems: "center", minHeight: 46, marginTop: 16, borderRadius: 10, background: "#000", color: "#fff", fontWeight: 700 }, children: /* @__PURE__ */ jsx6(InlineText2, { block, name: "submitLabel", fallback: "Track" }) }),
2375
- /* @__PURE__ */ jsx6("small", { style: { display: "block", marginTop: 10, color: "#8a8a8a", fontSize: 9, textAlign: "right" }, children: "Powered by BestTrack" })
2585
+ /* @__PURE__ */ jsx7("div", { style: { display: "grid", placeItems: "center", minHeight: 46, marginTop: 16, borderRadius: 10, background: "#000", color: "#fff", fontWeight: 700 }, children: /* @__PURE__ */ jsx7(InlineText2, { block, name: "submitLabel", fallback: "Track" }) }),
2586
+ /* @__PURE__ */ jsx7("small", { style: { display: "block", marginTop: 10, color: "#8a8a8a", fontSize: 9, textAlign: "right" }, children: "Powered by BestTrack" })
2376
2587
  ] }) })
2377
2588
  ] });
2378
2589
  }
2379
2590
  function BrandedQueryEditor(block) {
2380
- return /* @__PURE__ */ jsx6(BrandedTrackingExperienceEditor, { ...block });
2591
+ return /* @__PURE__ */ jsx7(BrandedTrackingExperienceEditor, { ...block });
2381
2592
  }
2382
2593
  function BrandedOrderItemsEditor(block) {
2383
2594
  return /* @__PURE__ */ jsxs6(EditorSurface, { block, children: [
2384
- /* @__PURE__ */ jsx6("h2", { style: { margin: 0 }, children: /* @__PURE__ */ jsx6(InlineText2, { block, name: "heading", fallback: "What's Inside" }) }),
2385
- /* @__PURE__ */ jsx6("p", { style: { color: "#6b6b6b" }, children: "Package contents appear after a consumer tracking query." })
2595
+ /* @__PURE__ */ jsx7("h2", { style: { margin: 0 }, children: /* @__PURE__ */ jsx7(InlineText2, { block, name: "heading", fallback: "What's Inside" }) }),
2596
+ /* @__PURE__ */ jsx7("p", { style: { color: "#6b6b6b" }, children: "Package contents appear after a consumer tracking query." })
2386
2597
  ] });
2387
2598
  }
2388
2599
  function BrandedRecommendationsEditor(block) {
2389
2600
  return /* @__PURE__ */ jsxs6(EditorSurface, { block, children: [
2390
- /* @__PURE__ */ jsx6("h2", { style: { margin: 0, textAlign: "center" }, children: /* @__PURE__ */ jsx6(InlineText2, { block, name: "heading", fallback: "You might also like" }) }),
2391
- /* @__PURE__ */ jsx6("p", { style: { color: "#6b6b6b", textAlign: "center" }, children: "Recommendations appear with the active shipment." })
2601
+ /* @__PURE__ */ jsx7("h2", { style: { margin: 0, textAlign: "center" }, children: /* @__PURE__ */ jsx7(InlineText2, { block, name: "heading", fallback: "You might also like" }) }),
2602
+ /* @__PURE__ */ jsx7("p", { style: { color: "#6b6b6b", textAlign: "center" }, children: "Recommended products load independently of tracking queries." })
2392
2603
  ] });
2393
2604
  }
2394
2605
  function BrandedQuickLinksEditor(block) {
2395
2606
  return /* @__PURE__ */ jsxs6(EditorSurface, { block, children: [
2396
- /* @__PURE__ */ jsx6("h2", { children: /* @__PURE__ */ jsx6(InlineText2, { block, name: "heading", fallback: "Need help?" }) }),
2607
+ /* @__PURE__ */ jsx7("h2", { children: /* @__PURE__ */ jsx7(InlineText2, { block, name: "heading", fallback: "Need help?" }) }),
2397
2608
  /* @__PURE__ */ jsxs6("div", { style: { display: "flex", gap: 20 }, children: [
2398
- /* @__PURE__ */ jsx6(InlineText2, { block, name: "primaryLabel", fallback: "Shipping help" }),
2399
- /* @__PURE__ */ jsx6(InlineText2, { block, name: "secondaryLabel", fallback: "Contact us" })
2609
+ /* @__PURE__ */ jsx7(InlineText2, { block, name: "primaryLabel", fallback: "Shipping help" }),
2610
+ /* @__PURE__ */ jsx7(InlineText2, { block, name: "secondaryLabel", fallback: "Contact us" })
2400
2611
  ] })
2401
2612
  ] });
2402
2613
  }
2403
2614
  function BrandedBlogEditor(block) {
2404
2615
  return /* @__PURE__ */ jsxs6(EditorSurface, { block, children: [
2405
- /* @__PURE__ */ jsx6("h2", { children: /* @__PURE__ */ jsx6(InlineText2, { block, name: "heading", fallback: "From our journal" }) }),
2616
+ /* @__PURE__ */ jsx7("h2", { children: /* @__PURE__ */ jsx7(InlineText2, { block, name: "heading", fallback: "From our journal" }) }),
2406
2617
  /* @__PURE__ */ jsxs6("article", { children: [
2407
- /* @__PURE__ */ jsx6("strong", { children: /* @__PURE__ */ jsx6(InlineText2, { block, name: "articleTitle", fallback: "Delivery tips for every season" }) }),
2408
- /* @__PURE__ */ jsx6("p", { children: /* @__PURE__ */ jsx6(InlineText2, { block, name: "excerpt", fallback: "Simple ways to make every delivery feel considered." }) }),
2409
- /* @__PURE__ */ jsx6(InlineText2, { block, name: "linkLabel", fallback: "Read the story" })
2618
+ /* @__PURE__ */ jsx7("strong", { children: /* @__PURE__ */ jsx7(InlineText2, { block, name: "articleTitle", fallback: "Delivery tips for every season" }) }),
2619
+ /* @__PURE__ */ jsx7("p", { children: /* @__PURE__ */ jsx7(InlineText2, { block, name: "excerpt", fallback: "Simple ways to make every delivery feel considered." }) }),
2620
+ /* @__PURE__ */ jsx7(InlineText2, { block, name: "linkLabel", fallback: "Read the story" })
2410
2621
  ] })
2411
2622
  ] });
2412
2623
  }
@@ -2414,53 +2625,55 @@ function BrandedAnnouncementBlock(props) {
2414
2625
  const message = text3(props, "message", "");
2415
2626
  const href = safeHref2(props.href);
2416
2627
  if (!message) return null;
2417
- return /* @__PURE__ */ jsx6("section", { "aria-label": "Branded announcement", style: { minHeight: 36, display: "grid", placeItems: "center", padding: "0 16px", background: "#252525", color: "#fff", fontFamily: "var(--pb-font-family)", fontSize: 12, textAlign: "center" }, children: href ? /* @__PURE__ */ jsx6("a", { href, style: { color: "inherit", textDecoration: "none" }, children: message }) : message });
2628
+ return /* @__PURE__ */ jsx7("section", { "aria-label": "Branded announcement", style: { minHeight: 36, display: "grid", placeItems: "center", padding: "0 16px", background: "#252525", color: "#fff", fontFamily: "var(--pb-font-family)", fontSize: 12, textAlign: "center" }, children: href ? /* @__PURE__ */ jsx7("a", { href, style: { color: "inherit", textDecoration: "none" }, children: message }) : message });
2418
2629
  }
2419
2630
  function BrandedTrackingExperienceBlock(props) {
2420
2631
  return /* @__PURE__ */ jsxs6("section", { "aria-label": "Branded tracking experience", style: { background: "#fffdf0", fontFamily: "var(--pb-font-family)" }, children: [
2421
- /* @__PURE__ */ jsx6(ShipmentSwitcher, { shipmentLabels: props.shipmentLabels }),
2422
- /* @__PURE__ */ jsx6(QueryHero, { ...props })
2632
+ /* @__PURE__ */ jsx7(ShipmentSwitcher, {}),
2633
+ /* @__PURE__ */ jsx7(QueryHero, { ...props })
2423
2634
  ] });
2424
2635
  }
2425
2636
  function BrandedQueryBlock(props) {
2426
2637
  return /* @__PURE__ */ jsxs6("section", { "aria-label": "Branded tracking query", style: { background: "#fffdf0", fontFamily: "var(--pb-font-family)" }, children: [
2427
- /* @__PURE__ */ jsx6(ShipmentSwitcher, { shipmentLabels: props.shipmentLabels }),
2428
- /* @__PURE__ */ jsx6(QueryHero, { ...props })
2638
+ /* @__PURE__ */ jsx7(ShipmentSwitcher, {}),
2639
+ /* @__PURE__ */ jsx7(QueryHero, { ...props })
2429
2640
  ] });
2430
2641
  }
2431
2642
  function BrandedOrderItemsBlock(props) {
2432
2643
  const runtime = useBrandedRuntime();
2433
- const items = runtime.displayedResult?.orderItems ?? [];
2644
+ const visibility = trackingBlockState(runtime);
2645
+ if (!visibility.showDelivery) return null;
2646
+ const items = runtime.result?.orderItems ?? [];
2434
2647
  const title = text3(props, "heading", "What's Inside");
2435
- return /* @__PURE__ */ jsx6("section", { "aria-label": title, style: { background: "#fffdf0", color: "#0a0a0a", fontFamily: "var(--pb-font-family)", padding: "clamp(28px, 4vw, 48px) 0" }, children: /* @__PURE__ */ jsxs6("div", { style: contentWidth2, children: [
2648
+ return /* @__PURE__ */ jsx7("section", { "aria-label": title, style: { background: "#fffdf0", color: "#0a0a0a", fontFamily: "var(--pb-font-family)", padding: "clamp(28px, 4vw, 48px) 0" }, children: /* @__PURE__ */ jsxs6("div", { style: contentWidth2, children: [
2436
2649
  /* @__PURE__ */ jsxs6("h2", { style: { margin: "0 0 20px", fontSize: 20 }, children: [
2437
2650
  title,
2438
- runtime.phase === "success" ? " (" + items.length + ")" : ""
2651
+ visibility.showResult ? " (" + items.length + ")" : ""
2439
2652
  ] }),
2440
- runtime.phase === "success" ? /* @__PURE__ */ jsx6(PackageContents2, { items }) : /* @__PURE__ */ jsx6("p", { style: { margin: 0, color: runtime.phase === "error" ? "#b42318" : "#6b6b6b" }, children: runtime.phase === "error" ? "Order items are temporarily unavailable." : "Track an order to see what is inside." })
2653
+ visibility.showResult ? /* @__PURE__ */ jsx7(PackageContents2, { items }) : /* @__PURE__ */ jsx7("p", { style: { margin: 0, color: "#b42318" }, children: "Order items are temporarily unavailable." })
2441
2654
  ] }) });
2442
2655
  }
2443
2656
  function RecommendationCard({ item }) {
2444
2657
  const href = safeHref2(item.href);
2445
- const price = item.price ? formatTrackingPageMoney(item.price) : void 0;
2658
+ const price = formatRecommendationPrice(item.price);
2446
2659
  return /* @__PURE__ */ jsxs6("article", { style: { overflow: "hidden", borderRadius: 6, background: "#fff", boxShadow: "0 1px 2px rgb(0 0 0 / 8%)" }, children: [
2447
- /* @__PURE__ */ jsx6(ProductImage2, { src: item.imageUrl, alt: item.title }),
2660
+ /* @__PURE__ */ jsx7(ProductImage2, { src: item.imageUrl, alt: item.title }),
2448
2661
  /* @__PURE__ */ jsxs6("div", { style: { padding: 14 }, children: [
2449
- /* @__PURE__ */ jsx6("strong", { children: item.title }),
2450
- price?.amount ? /* @__PURE__ */ jsx6("p", { style: { margin: "6px 0", fontWeight: 700 }, children: price.amount }) : null,
2451
- /* @__PURE__ */ jsx6("p", { style: { margin: "6px 0", color: "#6b6b6b", fontSize: 13 }, children: item.description }),
2452
- !href ? /* @__PURE__ */ jsx6("span", { style: { color: "#6b6b6b", fontSize: 13, fontWeight: 700 }, children: "View product" }) : /* @__PURE__ */ jsx6("a", { href, style: { color: "#0a0a0a", fontSize: 13, fontWeight: 700 }, children: "View product" })
2662
+ /* @__PURE__ */ jsx7("strong", { children: item.title }),
2663
+ price ? /* @__PURE__ */ jsx7("p", { style: { margin: "6px 0", fontWeight: 700 }, children: price }) : null,
2664
+ /* @__PURE__ */ jsx7("p", { style: { margin: "6px 0", color: "#6b6b6b", fontSize: 13 }, children: item.description }),
2665
+ !href ? /* @__PURE__ */ jsx7("span", { style: { color: "#6b6b6b", fontSize: 13, fontWeight: 700 }, children: "View product" }) : /* @__PURE__ */ jsx7("a", { href, style: { color: "#0a0a0a", fontSize: 13, fontWeight: 700 }, children: "View product" })
2453
2666
  ] })
2454
2667
  ] });
2455
2668
  }
2456
2669
  function BrandedRecommendationsBlock(props) {
2457
2670
  const runtime = useBrandedRuntime();
2458
- const recommendations = runtime.displayedResult?.recommendations ?? [];
2671
+ const recommendations = recommendationItems(props.products, runtime);
2459
2672
  const title = text3(props, "heading", "You might also like");
2460
- if ((runtime.phase === "success" || runtime.phase === "empty") && !recommendations.length && text3(props, "hideWhenEmpty", "false") === "true") return null;
2461
- return /* @__PURE__ */ jsx6("section", { "aria-label": title, style: { background: "#fffdf0", color: "#0a0a0a", fontFamily: "var(--pb-font-family)", padding: "clamp(28px, 4vw, 48px) 0" }, children: /* @__PURE__ */ jsxs6("div", { style: contentWidth2, children: [
2462
- /* @__PURE__ */ jsx6("h2", { style: { margin: "0 0 24px", textAlign: "center", fontSize: 20 }, children: title }),
2463
- runtime.phase === "loading" ? /* @__PURE__ */ jsx6("div", { "aria-label": "Loading recommendations", style: { display: "grid", gridTemplateColumns: "repeat(auto-fit, minmax(220px, 1fr))", gap: 16 }, children: [0, 1, 2].map((item) => /* @__PURE__ */ jsx6("span", { style: { display: "block", height: 220, borderRadius: 6, background: "#e7e7e7" } }, item)) }) : runtime.phase === "success" && recommendations.length ? /* @__PURE__ */ jsx6("div", { style: { display: "grid", gridTemplateColumns: "repeat(auto-fit, minmax(220px, 1fr))", gap: 16 }, children: recommendations.map((item) => /* @__PURE__ */ jsx6(RecommendationCard, { item }, item.id)) }) : /* @__PURE__ */ jsx6("p", { style: { margin: 0, textAlign: "center", color: runtime.phase === "error" ? "#b42318" : "#6b6b6b" }, children: runtime.phase === "error" ? "Recommendations are temporarily unavailable." : runtime.phase === "empty" ? "No recommendations are available for that number." : "Recommendations will appear with your order." })
2673
+ if (!recommendations.length) return null;
2674
+ return /* @__PURE__ */ jsx7("section", { "aria-label": title, style: { background: "#fffdf0", color: "#0a0a0a", fontFamily: "var(--pb-font-family)", padding: "clamp(28px, 4vw, 48px) 0" }, children: /* @__PURE__ */ jsxs6("div", { style: contentWidth2, children: [
2675
+ /* @__PURE__ */ jsx7("h2", { style: { margin: "0 0 24px", textAlign: "center", fontSize: 20 }, children: title }),
2676
+ /* @__PURE__ */ jsx7("div", { style: { display: "grid", gridTemplateColumns: "repeat(auto-fit, minmax(220px, 1fr))", gap: 16 }, children: recommendations.map((item) => /* @__PURE__ */ jsx7(RecommendationCard, { item }, item.id)) })
2464
2677
  ] }) });
2465
2678
  }
2466
2679
  function BrandedQuickLinksBlock(props) {
@@ -2468,10 +2681,10 @@ function BrandedQuickLinksBlock(props) {
2468
2681
  const primaryHref = safeHref2(props.primaryHref);
2469
2682
  const secondaryHref = safeHref2(props.secondaryHref);
2470
2683
  return /* @__PURE__ */ jsxs6("section", { "aria-label": title, style: { ...cardStyle, margin: "24px auto", maxWidth: 1200, padding: 24 }, children: [
2471
- /* @__PURE__ */ jsx6("h2", { children: title }),
2684
+ /* @__PURE__ */ jsx7("h2", { children: title }),
2472
2685
  /* @__PURE__ */ jsxs6("div", { style: { display: "grid", gridTemplateColumns: "repeat(auto-fit, minmax(180px, 1fr))", gap: 16 }, children: [
2473
- primaryHref ? /* @__PURE__ */ jsx6("a", { href: primaryHref, style: { color: "#0a0a0a" }, children: text3(props, "primaryLabel", "Shipping help") }) : /* @__PURE__ */ jsx6("span", { children: text3(props, "primaryLabel", "Shipping help") }),
2474
- secondaryHref ? /* @__PURE__ */ jsx6("a", { href: secondaryHref, style: { color: "#0a0a0a" }, children: text3(props, "secondaryLabel", "Contact us") }) : /* @__PURE__ */ jsx6("span", { children: text3(props, "secondaryLabel", "Contact us") })
2686
+ primaryHref ? /* @__PURE__ */ jsx7("a", { href: primaryHref, style: { color: "#0a0a0a" }, children: text3(props, "primaryLabel", "Shipping help") }) : /* @__PURE__ */ jsx7("span", { children: text3(props, "primaryLabel", "Shipping help") }),
2687
+ secondaryHref ? /* @__PURE__ */ jsx7("a", { href: secondaryHref, style: { color: "#0a0a0a" }, children: text3(props, "secondaryLabel", "Contact us") }) : /* @__PURE__ */ jsx7("span", { children: text3(props, "secondaryLabel", "Contact us") })
2475
2688
  ] })
2476
2689
  ] });
2477
2690
  }
@@ -2479,11 +2692,11 @@ function BrandedBlogBlock(props) {
2479
2692
  const title = text3(props, "heading", "From our journal");
2480
2693
  const href = safeHref2(props.articleHref);
2481
2694
  return /* @__PURE__ */ jsxs6("section", { "aria-label": title, style: { ...cardStyle, margin: "24px auto", maxWidth: 1200, padding: 24 }, children: [
2482
- /* @__PURE__ */ jsx6("h2", { children: title }),
2695
+ /* @__PURE__ */ jsx7("h2", { children: title }),
2483
2696
  /* @__PURE__ */ jsxs6("article", { children: [
2484
- /* @__PURE__ */ jsx6("strong", { children: text3(props, "articleTitle", "Delivery tips for every season") }),
2485
- /* @__PURE__ */ jsx6("p", { children: text3(props, "excerpt", "Simple ways to make every delivery feel considered.") }),
2486
- href ? /* @__PURE__ */ jsx6("a", { href, style: { color: "#0a0a0a" }, children: text3(props, "linkLabel", "Read the story") }) : /* @__PURE__ */ jsx6("span", { children: text3(props, "linkLabel", "Read the story") })
2697
+ /* @__PURE__ */ jsx7("strong", { children: text3(props, "articleTitle", "Delivery tips for every season") }),
2698
+ /* @__PURE__ */ jsx7("p", { children: text3(props, "excerpt", "Simple ways to make every delivery feel considered.") }),
2699
+ href ? /* @__PURE__ */ jsx7("a", { href, style: { color: "#0a0a0a" }, children: text3(props, "linkLabel", "Read the story") }) : /* @__PURE__ */ jsx7("span", { children: text3(props, "linkLabel", "Read the story") })
2487
2700
  ] })
2488
2701
  ] });
2489
2702
  }
@@ -2499,16 +2712,18 @@ var brandedBlocks = withTemplatePolicy2([
2499
2712
  { type: "besttrack.branded.tracking-experience", version: 1, label: "Tracking experience", category: "BestTrack Branded", targets: ["web"], defaultProps: { heading: "Track your order", submitLabel: "Track", trackAnotherLabel: "Track another order", defaultTrackingNumber: "DEMO-YQTRACK9999", defaultOrderNumber: "", defaultQueryMode: "tracking", trackingTabLabel: "Tracking Number", orderTabLabel: "Order Number", shipmentLabels: "Shipment #1|Shipment #2|Shipment #3", heroImageUrl: "https://images.unsplash.com/photo-1596462502278-27bfdc403348?auto=format&fit=crop&w=1600&q=85" }, defaultVariant: "brand", variants: [{ id: "brand", label: "Brand" }, { id: "compact", label: "Compact", theme: { spacing: "12px" } }], fields: { heading: text4("Heading"), submitLabel: text4("Button label"), trackAnotherLabel: text4("Track another label"), defaultTrackingNumber: text4("Default tracking number"), defaultOrderNumber: text4("Default order number"), defaultQueryMode: text4("Default query mode"), trackingTabLabel: text4("Tracking tab label"), orderTabLabel: text4("Order tab label"), shipmentLabels: text4("Shipment labels (separate with |)"), heroImageUrl: httpsUrl("Hero image URL") }, render: { web: BrandedTrackingExperienceBlock, editor: BrandedTrackingExperienceEditor } },
2500
2713
  { type: "besttrack.branded.query", version: 1, label: "Order query", category: "BestTrack Branded", targets: ["web"], defaultProps: { heading: "Track your order", submitLabel: "Track", defaultTrackingNumber: "DEMO-YQTRACK9999", defaultOrderNumber: "", defaultQueryMode: "tracking", trackingTabLabel: "Tracking Number", orderTabLabel: "Order Number", shipmentLabels: "Shipment #1|Shipment #2|Shipment #3", heroImageUrl: "https://images.unsplash.com/photo-1596462502278-27bfdc403348?auto=format&fit=crop&w=1600&q=85" }, defaultVariant: "brand", variants: [{ id: "brand", label: "Brand" }, { id: "compact", label: "Compact", theme: { spacing: "12px" } }], fields: { heading: text4("Heading"), submitLabel: text4("Button label"), defaultTrackingNumber: text4("Default tracking number"), defaultOrderNumber: text4("Default order number"), defaultQueryMode: text4("Default query mode"), trackingTabLabel: text4("Tracking tab label"), orderTabLabel: text4("Order tab label"), shipmentLabels: text4("Shipment labels (separate with |)"), heroImageUrl: httpsUrl("Hero image URL") }, render: { web: BrandedQueryBlock, editor: BrandedQueryEditor } },
2501
2714
  { type: "besttrack.branded.order-items", version: 1, label: "Order items", category: "BestTrack Branded", targets: ["web"], defaultProps: { heading: "What's Inside" }, defaultVariant: "brand", variants: [{ id: "brand", label: "Brand" }, { id: "minimal", label: "Minimal" }], fields: { heading: text4("Heading") }, render: { web: BrandedOrderItemsBlock, editor: BrandedOrderItemsEditor } },
2502
- { type: "besttrack.branded.recommendations", version: 1, label: "Recommended products", category: "BestTrack Branded", targets: ["web"], defaultProps: { heading: "You might also like", hideWhenEmpty: "false" }, defaultVariant: "brand", variants: [{ id: "brand", label: "Brand" }, { id: "editorial", label: "Editorial", theme: { "color.surface": "#fffdf0" } }], fields: { heading: text4("Heading"), hideWhenEmpty: text4("Hide when empty (true/false)") }, render: { web: BrandedRecommendationsBlock, editor: BrandedRecommendationsEditor } },
2715
+ // products 接入与 Ready-to-go 相同的商家选品优先规则;hideWhenEmpty 仅保留旧文档兼容,
2716
+ // 不再提供编辑开关,因为三套模板都在没有可用推荐时隐藏内容。
2717
+ { type: "besttrack.branded.recommendations", version: 1, label: "Recommended products", category: "BestTrack Branded", targets: ["web"], defaultProps: { heading: "You might also like", hideWhenEmpty: "false", products: [] }, defaultVariant: "brand", variants: [{ id: "brand", label: "Brand" }, { id: "editorial", label: "Editorial", theme: { "color.surface": "#fffdf0" } }], fields: { heading: text4("Heading"), products: { field: "besttrack.branded.products", label: "\u63A8\u8350\u5546\u54C1 (Shopify)", control: "products", group: "Content" } }, render: { web: BrandedRecommendationsBlock, editor: BrandedRecommendationsEditor } },
2503
2718
  { type: "besttrack.branded.quick-links", version: 1, label: "Quick links", category: "BestTrack Branded", targets: ["web"], defaultProps: { heading: "Need help?", primaryLabel: "Shipping help", primaryHref: "https://example.com/pages/shipping", secondaryLabel: "Contact us", secondaryHref: "https://example.com/pages/contact" }, defaultVariant: "brand", variants: [{ id: "brand", label: "Brand" }], fields: { heading: text4("Heading"), primaryLabel: text4("Primary link label"), primaryHref: httpsUrl("Primary link URL"), secondaryLabel: text4("Secondary link label"), secondaryHref: httpsUrl("Secondary link URL") }, render: { web: BrandedQuickLinksBlock, editor: BrandedQuickLinksEditor } },
2504
2719
  { type: "besttrack.branded.blog", version: 1, label: "Blog", category: "BestTrack Branded", targets: ["web"], defaultProps: { heading: "From our journal", articleTitle: "Delivery tips for every season", excerpt: "Simple ways to make every delivery feel considered.", articleHref: "https://example.com/blogs/news", linkLabel: "Read the story" }, defaultVariant: "brand", variants: [{ id: "brand", label: "Brand" }], fields: { heading: text4("Heading"), articleTitle: text4("Article title"), excerpt: text4("Excerpt", { control: "textarea" }), articleHref: httpsUrl("Article URL"), linkLabel: text4("Link label") }, render: { web: BrandedBlogBlock, editor: BrandedBlogEditor } }
2505
- ], ["besttrack.branded.announcement", "besttrack.branded.tracking-experience"]);
2720
+ ], ["besttrack.branded.announcement", "besttrack.branded.tracking-experience", "besttrack.branded.recommendations"]);
2506
2721
  var brandedDefaultBlockTypes = brandedBlocks.filter((block) => !["besttrack.branded.query", "besttrack.branded.order-items"].includes(block.type)).map((block) => block.type);
2507
2722
  var brandedTemplatePolicy = defineTemplatePolicy(
2508
2723
  "besttrack.branded",
2509
2724
  "Branded",
2510
2725
  brandedDefaultBlockTypes,
2511
- ["besttrack.branded.announcement", "besttrack.branded.tracking-experience"]
2726
+ ["besttrack.branded.announcement", "besttrack.branded.tracking-experience", "besttrack.branded.recommendations"]
2512
2727
  );
2513
2728
  function createBrandedTemplate() {
2514
2729
  const templateBlocks = brandedBlocks.filter((block) => brandedDefaultBlockTypes.includes(block.type));
@@ -2520,40 +2735,16 @@ var bestTrackBrandedExtension = Object.freeze({ name: "besttrack.branded", versi
2520
2735
  import { createPageDocument as createPageDocument3 } from "@standhigher/puck-page-builder/runtime";
2521
2736
 
2522
2737
  // src/sales.tsx
2523
- import { createContext as createContext3, useCallback as useCallback4, useContext as useContext3, useMemo as useMemo4, useRef as useRef4, useState as useState5 } from "react";
2524
- import { Fragment as Fragment5, jsx as jsx7, jsxs as jsxs7 } from "react/jsx-runtime";
2525
- var initialRuntime3 = { phase: "idle", async query() {
2526
- return void 0;
2527
- } };
2528
- var SalesRuntimeContext = createContext3(initialRuntime3);
2738
+ import { useState as useState6 } from "react";
2739
+ import { Fragment as Fragment5, jsx as jsx8, jsxs as jsxs7 } from "react/jsx-runtime";
2740
+ var SalesRuntimeProvider = TrackingRuntimeProvider;
2741
+ var useSalesRuntime = useTrackingRuntime;
2529
2742
  var contentWidth3 = { boxSizing: "border-box", width: "min(1120px, calc(100% - 32px))", margin: "0 auto" };
2530
2743
  var sectionStyle = { ...contentWidth3, marginTop: "clamp(32px, 6vw, 72px)", color: "var(--pb-color-text)", fontFamily: "var(--pb-font-family)" };
2531
2744
  var panelStyle = { boxSizing: "border-box", border: "1px solid var(--pb-color-border)", borderRadius: "var(--pb-radius)", padding: "clamp(20px, 3vw, 32px)", background: "var(--pb-color-surface)", color: "var(--pb-color-text)", overflowWrap: "anywhere" };
2532
2745
  var gridStyle = { display: "grid", gridTemplateColumns: "repeat(auto-fit, minmax(min(100%, 220px), 1fr))", gap: "clamp(16px, 2vw, 24px)" };
2533
- function SalesRuntimeProvider({ children, query: injectedQuery, watermark, resourceResolution }) {
2534
- const [state, setState] = useState5({ phase: "idle" });
2535
- const requestId = useRef4(0);
2536
- const query = useCallback4(async (request) => {
2537
- const currentRequestId = ++requestId.current;
2538
- setState({ phase: "loading" });
2539
- try {
2540
- if (!injectedQuery) throw new Error("tracking-query-not-configured");
2541
- const result = await injectedQuery(request);
2542
- if (currentRequestId !== requestId.current) return;
2543
- setState({ phase: isEmptyTrackingPageResult(result) ? "empty" : "success", result });
2544
- } catch {
2545
- if (currentRequestId !== requestId.current) return;
2546
- setState({ phase: "error" });
2547
- }
2548
- }, [injectedQuery]);
2549
- const value = useMemo4(() => ({ ...state, query, watermark, resourceResolution }), [query, resourceResolution, state, watermark]);
2550
- return /* @__PURE__ */ jsx7(SalesRuntimeContext.Provider, { value, children });
2551
- }
2552
- function useSalesRuntime() {
2553
- return useContext3(SalesRuntimeContext);
2554
- }
2555
2746
  function RuntimeWatermark3({ watermark }) {
2556
- return watermark?.visible ? /* @__PURE__ */ jsx7("small", { style: { display: "block", marginTop: 14, color: "var(--pb-color-muted)", fontSize: 11, textAlign: "right" }, children: watermark.label || "Powered by BestTrack" }) : null;
2747
+ return watermark?.visible ? /* @__PURE__ */ jsx8("small", { style: { display: "block", marginTop: 14, color: "var(--pb-color-muted)", fontSize: 11, textAlign: "right" }, children: watermark.label || "Powered by BestTrack" }) : null;
2557
2748
  }
2558
2749
  function text5(props, key, fallback) {
2559
2750
  const value = props[key];
@@ -2562,28 +2753,28 @@ function text5(props, key, fallback) {
2562
2753
  var safeHref3 = safeTrackingPageUrl;
2563
2754
  var safeImageUrl3 = safeTrackingPageUrl;
2564
2755
  function Status({ children, alert = false }) {
2565
- return /* @__PURE__ */ jsx7("p", { role: alert ? "alert" : "status", "aria-live": alert ? "assertive" : "polite", style: { margin: "16px 0 0", color: alert ? "#a61b1b" : "var(--pb-color-muted)" }, children });
2756
+ return /* @__PURE__ */ jsx8("p", { role: alert ? "alert" : "status", "aria-live": alert ? "assertive" : "polite", style: { margin: "16px 0 0", color: alert ? "#a61b1b" : "var(--pb-color-muted)" }, children });
2566
2757
  }
2567
2758
  function Section({ title, children, busy = false }) {
2568
- return /* @__PURE__ */ jsx7("section", { "aria-label": title, "aria-busy": busy || void 0, style: sectionStyle, children: /* @__PURE__ */ jsxs7("div", { style: panelStyle, children: [
2569
- /* @__PURE__ */ jsx7("h2", { style: { margin: "0 0 20px", fontSize: "clamp(24px, 3vw, 34px)", lineHeight: 1.15 }, children: title }),
2759
+ return /* @__PURE__ */ jsx8("section", { "aria-label": title, "aria-busy": busy || void 0, style: sectionStyle, children: /* @__PURE__ */ jsxs7("div", { style: panelStyle, children: [
2760
+ /* @__PURE__ */ jsx8("h2", { style: { margin: "0 0 20px", fontSize: "clamp(24px, 3vw, 34px)", lineHeight: 1.15 }, children: title }),
2570
2761
  children
2571
2762
  ] }) });
2572
2763
  }
2573
2764
  function ProductImage3({ src, alt }) {
2574
- const [failed, setFailed] = useState5(false);
2765
+ const [failed, setFailed] = useState6(false);
2575
2766
  const safeSrc = safeImageUrl3(src);
2576
- if (!safeSrc || failed) return /* @__PURE__ */ jsx7("span", { "aria-label": `${alt} image unavailable`, role: "img", style: { display: "grid", placeItems: "center", width: 76, height: 76, flex: "0 0 auto", border: "1px solid var(--pb-color-border)", borderRadius: "calc(var(--pb-radius) / 1.5)", background: "var(--pb-color-background)", color: "var(--pb-color-muted)", fontWeight: 700 }, children: alt.slice(0, 1).toUpperCase() });
2577
- return /* @__PURE__ */ jsx7("img", { src: safeSrc, alt, onError: () => setFailed(true), style: { width: 76, height: 76, flex: "0 0 auto", borderRadius: "calc(var(--pb-radius) / 1.5)", objectFit: "cover", background: "var(--pb-color-background)" } });
2767
+ if (!safeSrc || failed) return /* @__PURE__ */ jsx8("span", { "aria-label": `${alt} image unavailable`, role: "img", style: { display: "grid", placeItems: "center", width: 76, height: 76, flex: "0 0 auto", border: "1px solid var(--pb-color-border)", borderRadius: "calc(var(--pb-radius) / 1.5)", background: "var(--pb-color-background)", color: "var(--pb-color-muted)", fontWeight: 700 }, children: alt.slice(0, 1).toUpperCase() });
2768
+ return /* @__PURE__ */ jsx8("img", { src: safeSrc, alt, onError: () => setFailed(true), style: { width: 76, height: 76, flex: "0 0 auto", borderRadius: "calc(var(--pb-radius) / 1.5)", objectFit: "cover", background: "var(--pb-color-background)" } });
2578
2769
  }
2579
2770
  function HeroAsset({ src }) {
2580
- const [failed, setFailed] = useState5(false);
2771
+ const [failed, setFailed] = useState6(false);
2581
2772
  const safeSrc = safeImageUrl3(src);
2582
2773
  if (!safeSrc || failed) return null;
2583
- return /* @__PURE__ */ jsx7("img", { "data-sales-hero-image": true, src: safeSrc, alt: "", "aria-hidden": "true", onError: () => setFailed(true), style: { position: "absolute", inset: 0, width: "100%", height: "100%", objectFit: "cover", opacity: 0.62 } });
2774
+ return /* @__PURE__ */ jsx8("img", { "data-sales-hero-image": true, src: safeSrc, alt: "", "aria-hidden": "true", onError: () => setFailed(true), style: { position: "absolute", inset: 0, width: "100%", height: "100%", objectFit: "cover", opacity: 0.62 } });
2584
2775
  }
2585
2776
  function SalesTextField({ value, onChange }) {
2586
- return /* @__PURE__ */ jsx7("input", { "aria-label": "Sales text", value: typeof value === "string" ? value : "", onChange: (event) => onChange(event.target.value) });
2777
+ return /* @__PURE__ */ jsx8("input", { "aria-label": "Sales text", value: typeof value === "string" ? value : "", onChange: (event) => onChange(event.target.value) });
2587
2778
  }
2588
2779
  var editorSurfaceStyle = { boxSizing: "border-box", border: "1px solid #dfddd7", borderRadius: 10, padding: 24, background: "#ffffff", color: "#0a0a0a", fontFamily: "Arial, Helvetica, sans-serif" };
2589
2780
  var editorCardStyle = { boxSizing: "border-box", padding: 18, border: "1px solid #dfddd7", borderRadius: 7, background: "#f7f5f0" };
@@ -2592,8 +2783,8 @@ function editorText(block, name, fallback) {
2592
2783
  }
2593
2784
  function SalesInlineText({ block, name, fallback, style }) {
2594
2785
  const value = editorText(block, name, fallback);
2595
- if (!block.selected) return /* @__PURE__ */ jsx7("span", { "data-sales-editor-field": name, style, children: value });
2596
- return /* @__PURE__ */ jsx7("input", { "aria-label": `Canvas ${name}`, "data-sales-editor-field": name, value, onMouseDown: (event) => event.stopPropagation(), onClick: (event) => event.stopPropagation(), onChange: (event) => block.onPropsChange({ [name]: event.currentTarget.value }), style: {
2786
+ if (!block.selected) return /* @__PURE__ */ jsx8("span", { "data-sales-editor-field": name, style, children: value });
2787
+ return /* @__PURE__ */ jsx8("input", { "aria-label": `Canvas ${name}`, "data-sales-editor-field": name, value, onMouseDown: (event) => event.stopPropagation(), onClick: (event) => event.stopPropagation(), onChange: (event) => block.onPropsChange({ [name]: event.currentTarget.value }), style: {
2597
2788
  boxSizing: "border-box",
2598
2789
  width: "100%",
2599
2790
  /* border: "1px dashed currentColor", */
@@ -2610,55 +2801,55 @@ function SalesInlineText({ block, name, fallback, style }) {
2610
2801
  } });
2611
2802
  }
2612
2803
  function SalesEditorSurface({ block, children }) {
2613
- return /* @__PURE__ */ jsx7("section", { "aria-label": "Sales editor preview", style: { ...editorSurfaceStyle, outline: block.selected ? "2px solid #2563eb" : void 0, outlineOffset: -2 }, children });
2804
+ return /* @__PURE__ */ jsx8("section", { "aria-label": "Sales editor preview", style: { ...editorSurfaceStyle, outline: block.selected ? "2px solid #2563eb" : void 0, outlineOffset: -2 }, children });
2614
2805
  }
2615
2806
  function SalesAnnouncementEditor(block) {
2616
- return /* @__PURE__ */ jsx7("section", { "aria-label": "Sales announcement editor", style: { display: "grid", minHeight: 38, placeItems: "center", boxSizing: "border-box", padding: "10px 16px", borderBottom: "1px solid #dfddd7", background: "#f7f5f0", color: "#0a0a0a", fontFamily: "Arial, Helvetica, sans-serif", fontSize: 13, fontWeight: 700, textAlign: "center" }, children: /* @__PURE__ */ jsx7(SalesInlineText, { block, name: "message", fallback: "Free delivery on orders over $50" }) });
2807
+ return /* @__PURE__ */ jsx8("section", { "aria-label": "Sales announcement editor", style: { display: "grid", minHeight: 38, placeItems: "center", boxSizing: "border-box", padding: "10px 16px", borderBottom: "1px solid #dfddd7", background: "#f7f5f0", color: "#0a0a0a", fontFamily: "Arial, Helvetica, sans-serif", fontSize: 13, fontWeight: 700, textAlign: "center" }, children: /* @__PURE__ */ jsx8(SalesInlineText, { block, name: "message", fallback: "Free delivery on orders over $50" }) });
2617
2808
  }
2618
2809
  function SalesQueryEditor(block) {
2619
2810
  const imageUrl = safeImageUrl3(block.heroImageUrl);
2620
2811
  const trackingNumber = editorText(block, "defaultTrackingNumber", "BT-2048-DEMO");
2621
2812
  return /* @__PURE__ */ jsxs7("section", { "aria-label": "Sales Hero query editor", style: { position: "relative", display: "grid", minHeight: "clamp(460px, 52vw, 620px)", placeItems: "center", boxSizing: "border-box", overflow: "hidden", padding: "clamp(28px, 6vw, 72px) 16px", background: "#0a0a0a", fontFamily: "Arial, Helvetica, sans-serif" }, children: [
2622
- imageUrl ? /* @__PURE__ */ jsx7("img", { src: imageUrl, alt: "", "aria-hidden": "true", style: { position: "absolute", inset: 0, width: "100%", height: "100%", objectFit: "cover", opacity: 0.62 } }) : null,
2623
- /* @__PURE__ */ jsx7("div", { "aria-hidden": "true", style: { position: "absolute", inset: 0, background: "rgb(0 0 0 / 42%)" } }),
2813
+ imageUrl ? /* @__PURE__ */ jsx8("img", { src: imageUrl, alt: "", "aria-hidden": "true", style: { position: "absolute", inset: 0, width: "100%", height: "100%", objectFit: "cover", opacity: 0.62 } }) : null,
2814
+ /* @__PURE__ */ jsx8("div", { "aria-hidden": "true", style: { position: "absolute", inset: 0, background: "rgb(0 0 0 / 42%)" } }),
2624
2815
  /* @__PURE__ */ jsxs7("div", { style: { position: "relative", zIndex: 1, boxSizing: "border-box", width: "min(560px, 100%)", padding: "clamp(28px, 5vw, 48px)", borderRadius: 10, background: "#ffffff", color: "#0a0a0a", boxShadow: "0 20px 56px rgb(0 0 0 / 28%)" }, children: [
2625
- /* @__PURE__ */ jsx7("h1", { style: { margin: "0 0 28px", fontSize: "clamp(32px, 5vw, 48px)", fontWeight: 800, letterSpacing: "-0.035em", lineHeight: 1.02, textAlign: "center" }, children: /* @__PURE__ */ jsx7(SalesInlineText, { block, name: "heading", fallback: "Track your order" }) }),
2626
- /* @__PURE__ */ jsx7("input", { "aria-label": "Canvas default tracking number", readOnly: !block.selected, value: trackingNumber, onMouseDown: (event) => block.selected && event.stopPropagation(), onClick: (event) => block.selected && event.stopPropagation(), onChange: (event) => block.onPropsChange({ defaultTrackingNumber: event.currentTarget.value }), style: { boxSizing: "border-box", width: "100%", minHeight: 58, padding: "12px 16px", border: "1px solid #dfddd7", borderRadius: 8, background: "#ffffff", color: "#0a0a0a", font: "inherit", fontSize: 17 } }),
2627
- /* @__PURE__ */ jsx7("div", { style: { display: "grid", minHeight: 58, placeItems: "center", marginTop: 14, padding: "12px 18px", borderRadius: 8, background: "#0a0a0a", color: "#ffffff", fontSize: 16, fontWeight: 700 }, children: /* @__PURE__ */ jsx7(SalesInlineText, { block, name: "submitLabel", fallback: "Track order" }) }),
2628
- /* @__PURE__ */ jsx7("small", { style: { display: "block", marginTop: 14, color: "#6b6b6b", fontSize: 11, textAlign: "right" }, children: "Powered by BestTrack" })
2816
+ /* @__PURE__ */ jsx8("h1", { style: { margin: "0 0 28px", fontSize: "clamp(32px, 5vw, 48px)", fontWeight: 800, letterSpacing: "-0.035em", lineHeight: 1.02, textAlign: "center" }, children: /* @__PURE__ */ jsx8(SalesInlineText, { block, name: "heading", fallback: "Track your order" }) }),
2817
+ /* @__PURE__ */ jsx8("input", { "aria-label": "Canvas default tracking number", readOnly: !block.selected, value: trackingNumber, onMouseDown: (event) => block.selected && event.stopPropagation(), onClick: (event) => block.selected && event.stopPropagation(), onChange: (event) => block.onPropsChange({ defaultTrackingNumber: event.currentTarget.value }), style: { boxSizing: "border-box", width: "100%", minHeight: 58, padding: "12px 16px", border: "1px solid #dfddd7", borderRadius: 8, background: "#ffffff", color: "#0a0a0a", font: "inherit", fontSize: 17 } }),
2818
+ /* @__PURE__ */ jsx8("div", { style: { display: "grid", minHeight: 58, placeItems: "center", marginTop: 14, padding: "12px 18px", borderRadius: 8, background: "#0a0a0a", color: "#ffffff", fontSize: 16, fontWeight: 700 }, children: /* @__PURE__ */ jsx8(SalesInlineText, { block, name: "submitLabel", fallback: "Track order" }) }),
2819
+ /* @__PURE__ */ jsx8("small", { style: { display: "block", marginTop: 14, color: "#6b6b6b", fontSize: 11, textAlign: "right" }, children: "Powered by BestTrack" })
2629
2820
  ] })
2630
2821
  ] });
2631
2822
  }
2632
2823
  function SalesOrderItemsEditor(block) {
2633
2824
  return /* @__PURE__ */ jsxs7(SalesEditorSurface, { block, children: [
2634
- /* @__PURE__ */ jsx7("h2", { style: { margin: "0 0 20px" }, children: /* @__PURE__ */ jsx7(SalesInlineText, { block, name: "heading", fallback: "Items in your order" }) }),
2825
+ /* @__PURE__ */ jsx8("h2", { style: { margin: "0 0 20px" }, children: /* @__PURE__ */ jsx8(SalesInlineText, { block, name: "heading", fallback: "Items in your order" }) }),
2635
2826
  /* @__PURE__ */ jsxs7("article", { style: { ...editorCardStyle, display: "flex", alignItems: "center", gap: 14 }, children: [
2636
- /* @__PURE__ */ jsx7("span", { "aria-hidden": "true", style: { width: 68, height: 68, borderRadius: 7, background: "#dfddd7" } }),
2827
+ /* @__PURE__ */ jsx8("span", { "aria-hidden": "true", style: { width: 68, height: 68, borderRadius: 7, background: "#dfddd7" } }),
2637
2828
  /* @__PURE__ */ jsxs7("span", { children: [
2638
- /* @__PURE__ */ jsx7("strong", { children: "Order item" }),
2639
- /* @__PURE__ */ jsx7("br", {}),
2640
- /* @__PURE__ */ jsx7("small", { style: { color: "#6b6b6b" }, children: "Items appear after a successful tracking query." })
2829
+ /* @__PURE__ */ jsx8("strong", { children: "Order item" }),
2830
+ /* @__PURE__ */ jsx8("br", {}),
2831
+ /* @__PURE__ */ jsx8("small", { style: { color: "#6b6b6b" }, children: "Items appear after a successful tracking query." })
2641
2832
  ] })
2642
2833
  ] })
2643
2834
  ] });
2644
2835
  }
2645
2836
  function SalesOtherTrackingEditor(block) {
2646
2837
  return /* @__PURE__ */ jsxs7(SalesEditorSurface, { block, children: [
2647
- /* @__PURE__ */ jsx7("h2", { style: { margin: "0 0 20px" }, children: /* @__PURE__ */ jsx7(SalesInlineText, { block, name: "heading", fallback: "Other shipments" }) }),
2648
- /* @__PURE__ */ jsx7("p", { style: { margin: 0, color: "#6b6b6b" }, children: /* @__PURE__ */ jsx7(SalesInlineText, { block, name: "emptyMessage", fallback: "No other shipments are linked to this order." }) })
2838
+ /* @__PURE__ */ jsx8("h2", { style: { margin: "0 0 20px" }, children: /* @__PURE__ */ jsx8(SalesInlineText, { block, name: "heading", fallback: "Other shipments" }) }),
2839
+ /* @__PURE__ */ jsx8("p", { style: { margin: 0, color: "#6b6b6b" }, children: /* @__PURE__ */ jsx8(SalesInlineText, { block, name: "emptyMessage", fallback: "No other shipments are linked to this order." }) })
2649
2840
  ] });
2650
2841
  }
2651
2842
  function SalesServiceCardsEditor(block) {
2652
2843
  return /* @__PURE__ */ jsxs7(SalesEditorSurface, { block, children: [
2653
- /* @__PURE__ */ jsx7("h2", { style: { margin: "0 0 20px" }, children: /* @__PURE__ */ jsx7(SalesInlineText, { block, name: "heading", fallback: "Shop with confidence" }) }),
2844
+ /* @__PURE__ */ jsx8("h2", { style: { margin: "0 0 20px" }, children: /* @__PURE__ */ jsx8(SalesInlineText, { block, name: "heading", fallback: "Shop with confidence" }) }),
2654
2845
  /* @__PURE__ */ jsxs7("div", { style: { display: "grid", gridTemplateColumns: "repeat(auto-fit, minmax(min(100%, 180px), 1fr))", gap: 14 }, children: [
2655
2846
  /* @__PURE__ */ jsxs7("article", { style: editorCardStyle, children: [
2656
- /* @__PURE__ */ jsx7("strong", { children: /* @__PURE__ */ jsx7(SalesInlineText, { block, name: "firstTitle", fallback: "Easy returns" }) }),
2657
- /* @__PURE__ */ jsx7("p", { style: { marginBottom: 0, color: "#6b6b6b" }, children: /* @__PURE__ */ jsx7(SalesInlineText, { block, name: "firstDescription", fallback: "Simple support when plans change." }) })
2847
+ /* @__PURE__ */ jsx8("strong", { children: /* @__PURE__ */ jsx8(SalesInlineText, { block, name: "firstTitle", fallback: "Easy returns" }) }),
2848
+ /* @__PURE__ */ jsx8("p", { style: { marginBottom: 0, color: "#6b6b6b" }, children: /* @__PURE__ */ jsx8(SalesInlineText, { block, name: "firstDescription", fallback: "Simple support when plans change." }) })
2658
2849
  ] }),
2659
2850
  /* @__PURE__ */ jsxs7("article", { style: editorCardStyle, children: [
2660
- /* @__PURE__ */ jsx7("strong", { children: /* @__PURE__ */ jsx7(SalesInlineText, { block, name: "secondTitle", fallback: "Secure delivery" }) }),
2661
- /* @__PURE__ */ jsx7("p", { style: { marginBottom: 0, color: "#6b6b6b" }, children: /* @__PURE__ */ jsx7(SalesInlineText, { block, name: "secondDescription", fallback: "Follow every milestone in one place." }) })
2851
+ /* @__PURE__ */ jsx8("strong", { children: /* @__PURE__ */ jsx8(SalesInlineText, { block, name: "secondTitle", fallback: "Secure delivery" }) }),
2852
+ /* @__PURE__ */ jsx8("p", { style: { marginBottom: 0, color: "#6b6b6b" }, children: /* @__PURE__ */ jsx8(SalesInlineText, { block, name: "secondDescription", fallback: "Follow every milestone in one place." }) })
2662
2853
  ] })
2663
2854
  ] })
2664
2855
  ] });
@@ -2666,39 +2857,39 @@ function SalesServiceCardsEditor(block) {
2666
2857
  function SalesProductCategoriesEditor(block) {
2667
2858
  const collection = isShopifyResourceReference(block.collection, "collection") ? block.collection : void 0;
2668
2859
  return /* @__PURE__ */ jsxs7(SalesEditorSurface, { block, children: [
2669
- /* @__PURE__ */ jsx7("h2", { style: { margin: "0 0 20px" }, children: /* @__PURE__ */ jsx7(SalesInlineText, { block, name: "heading", fallback: "Shop by category" }) }),
2860
+ /* @__PURE__ */ jsx8("h2", { style: { margin: "0 0 20px" }, children: /* @__PURE__ */ jsx8(SalesInlineText, { block, name: "heading", fallback: "Shop by category" }) }),
2670
2861
  /* @__PURE__ */ jsxs7("div", { style: { ...editorCardStyle, display: "flex", justifyContent: "space-between", fontWeight: 700 }, children: [
2671
- /* @__PURE__ */ jsx7("span", { children: collection?.title ?? "Choose a collection in the inspector" }),
2672
- /* @__PURE__ */ jsx7("span", { "aria-hidden": "true", children: "\u2192" })
2862
+ /* @__PURE__ */ jsx8("span", { children: collection?.title ?? "Choose a collection in the inspector" }),
2863
+ /* @__PURE__ */ jsx8("span", { "aria-hidden": "true", children: "\u2192" })
2673
2864
  ] })
2674
2865
  ] });
2675
2866
  }
2676
2867
  function SalesFeaturedProductEditor(block) {
2677
2868
  const product = isShopifyResourceReference(block.product, "product") ? block.product : void 0;
2678
2869
  return /* @__PURE__ */ jsxs7(SalesEditorSurface, { block, children: [
2679
- /* @__PURE__ */ jsx7("h2", { style: { margin: "0 0 20px" }, children: /* @__PURE__ */ jsx7(SalesInlineText, { block, name: "heading", fallback: "Featured product" }) }),
2870
+ /* @__PURE__ */ jsx8("h2", { style: { margin: "0 0 20px" }, children: /* @__PURE__ */ jsx8(SalesInlineText, { block, name: "heading", fallback: "Featured product" }) }),
2680
2871
  /* @__PURE__ */ jsxs7("div", { style: { ...editorCardStyle, display: "flex", justifyContent: "space-between", fontWeight: 700 }, children: [
2681
- /* @__PURE__ */ jsx7("span", { children: product?.title ?? "Choose a product in the inspector" }),
2682
- /* @__PURE__ */ jsx7("span", { "aria-hidden": "true", children: "\u2192" })
2872
+ /* @__PURE__ */ jsx8("span", { children: product?.title ?? "Choose a product in the inspector" }),
2873
+ /* @__PURE__ */ jsx8("span", { "aria-hidden": "true", children: "\u2192" })
2683
2874
  ] }),
2684
- /* @__PURE__ */ jsx7("small", { style: { display: "block", marginTop: 10, color: "#6b6b6b" }, children: "Availability is supplied by the authorized runtime." })
2875
+ /* @__PURE__ */ jsx8("small", { style: { display: "block", marginTop: 10, color: "#6b6b6b" }, children: "Availability is supplied by the authorized runtime." })
2685
2876
  ] });
2686
2877
  }
2687
2878
  function SalesRecommendationsEditor(block) {
2688
2879
  return /* @__PURE__ */ jsxs7(SalesEditorSurface, { block, children: [
2689
- /* @__PURE__ */ jsx7("h2", { style: { margin: "0 0 20px" }, children: /* @__PURE__ */ jsx7(SalesInlineText, { block, name: "heading", fallback: "Complete your order" }) }),
2690
- /* @__PURE__ */ jsx7("div", { style: { ...editorCardStyle, color: "#6b6b6b" }, children: "Recommended products appear after a successful tracking query." })
2880
+ /* @__PURE__ */ jsx8("h2", { style: { margin: "0 0 20px" }, children: /* @__PURE__ */ jsx8(SalesInlineText, { block, name: "heading", fallback: "Complete your order" }) }),
2881
+ /* @__PURE__ */ jsx8("div", { style: { ...editorCardStyle, color: "#6b6b6b" }, children: "Recommended products load independently of tracking queries." })
2691
2882
  ] });
2692
2883
  }
2693
2884
  function SalesAnnouncementBlock(props) {
2694
- return /* @__PURE__ */ jsx7("section", { "aria-label": "Sales announcement", "data-sales-announcement": true, style: { display: "grid", minHeight: 38, placeItems: "center", boxSizing: "border-box", padding: "10px 16px", borderBottom: "1px solid var(--pb-color-border)", background: "var(--pb-color-background)", color: "var(--pb-color-text)", fontFamily: "var(--pb-font-family)", fontSize: 13, textAlign: "center" }, children: /* @__PURE__ */ jsx7("strong", { children: text5(props, "message", "Free delivery on orders over $50") }) });
2885
+ return /* @__PURE__ */ jsx8("section", { "aria-label": "Sales announcement", "data-sales-announcement": true, style: { display: "grid", minHeight: 38, placeItems: "center", boxSizing: "border-box", padding: "10px 16px", borderBottom: "1px solid var(--pb-color-border)", background: "var(--pb-color-background)", color: "var(--pb-color-text)", fontFamily: "var(--pb-font-family)", fontSize: 13, textAlign: "center" }, children: /* @__PURE__ */ jsx8("strong", { children: text5(props, "message", "Free delivery on orders over $50") }) });
2695
2886
  }
2696
2887
  function SalesQueryBlock(props) {
2697
2888
  const runtime = useSalesRuntime();
2698
2889
  return /* @__PURE__ */ jsxs7("section", { "aria-label": "Sales tracking query", "aria-busy": runtime.phase === "loading" || void 0, "data-sales-hero": true, style: { position: "relative", display: "grid", minHeight: "clamp(460px, 52vw, 620px)", boxSizing: "border-box", overflow: "hidden", padding: "clamp(28px, 6vw, 72px) 16px", background: "var(--pb-color-text)", color: "var(--pb-color-surface)", fontFamily: "var(--pb-font-family)" }, children: [
2699
- /* @__PURE__ */ jsx7(HeroAsset, { src: props.heroImageUrl }),
2700
- /* @__PURE__ */ jsx7("div", { "aria-hidden": "true", style: { position: "absolute", inset: 0, background: "rgb(0 0 0 / 42%)" } }),
2701
- /* @__PURE__ */ jsx7("div", { style: { ...contentWidth3, position: "relative", zIndex: 1, display: "grid", alignItems: "center", width: "100%", minWidth: 0 }, children: /* @__PURE__ */ jsx7(
2890
+ /* @__PURE__ */ jsx8(HeroAsset, { src: props.heroImageUrl }),
2891
+ /* @__PURE__ */ jsx8("div", { "aria-hidden": "true", style: { position: "absolute", inset: 0, background: "rgb(0 0 0 / 42%)" } }),
2892
+ /* @__PURE__ */ jsx8("div", { style: { ...contentWidth3, position: "relative", zIndex: 1, display: "grid", alignItems: "center", width: "100%", minWidth: 0 }, children: /* @__PURE__ */ jsx8(
2702
2893
  TrackingQueryCard,
2703
2894
  {
2704
2895
  phase: runtime.phase,
@@ -2707,6 +2898,7 @@ function SalesQueryBlock(props) {
2707
2898
  submitLabel: text5(props, "submitLabel", "Track order"),
2708
2899
  initialTrackingNumber: text5(props, "defaultTrackingNumber", "BT-2048-DEMO"),
2709
2900
  initialOrderNumber: text5(props, "defaultOrderNumber", ""),
2901
+ initialMode: text5(props, "defaultQueryMode", "tracking") === "order" ? "order" : "tracking",
2710
2902
  emptyMessage: "We couldn\u2019t find an order for that number.",
2711
2903
  errorMessage: "We couldn\u2019t retrieve this order right now. Please try again later.",
2712
2904
  trackingInputLabel: "Sales tracking number",
@@ -2721,9 +2913,9 @@ function SalesQueryBlock(props) {
2721
2913
  formStyle: { gap: 14 },
2722
2914
  inputStyle: { boxSizing: "border-box", width: "100%", minHeight: 58, padding: "12px 16px", border: "1px solid var(--pb-color-border)", borderRadius: "calc(var(--pb-radius) / 1.25)", background: "var(--pb-color-surface)", color: "var(--pb-color-text)", font: "inherit", fontSize: 17 },
2723
2915
  submitStyle: (loading) => ({ width: "100%", minHeight: 58, padding: "12px 18px", border: 0, borderRadius: "calc(var(--pb-radius) / 1.25)", background: loading ? "#64748b" : "var(--pb-color-text)", color: "var(--pb-color-surface)", font: "inherit", fontSize: 16, fontWeight: 700, cursor: loading ? "wait" : "pointer" }),
2724
- result: runtime.result ? /* @__PURE__ */ jsx7(TrackingQueryResultDetails, { result: runtime.result }) : null,
2916
+ result: runtime.result ? /* @__PURE__ */ jsx8(TrackingQueryResultDetails, { result: runtime.result }) : null,
2725
2917
  resultStyle: { padding: 16, border: "1px solid var(--pb-color-border)", borderRadius: "calc(var(--pb-radius) / 1.25)", background: "var(--pb-color-background)" },
2726
- watermark: /* @__PURE__ */ jsx7(RuntimeWatermark3, { watermark: runtime.watermark })
2918
+ watermark: /* @__PURE__ */ jsx8(RuntimeWatermark3, { watermark: runtime.watermark })
2727
2919
  }
2728
2920
  ) })
2729
2921
  ] });
@@ -2731,127 +2923,132 @@ function SalesQueryBlock(props) {
2731
2923
  function SalesOrderItemsBlock(props) {
2732
2924
  const runtime = useSalesRuntime();
2733
2925
  const title = text5(props, "heading", "Items in your order");
2926
+ const visibility = trackingBlockState(runtime);
2927
+ if (!visibility.showDelivery) return null;
2734
2928
  const items = runtime.result?.orderItems ?? [];
2735
- return /* @__PURE__ */ jsx7(Section, { title, busy: runtime.phase === "loading", children: runtime.phase === "error" ? /* @__PURE__ */ jsx7(Status, { alert: true, children: "Order items are temporarily unavailable." }) : runtime.phase === "empty" ? /* @__PURE__ */ jsx7(Status, { children: "No order items are available for that number." }) : runtime.phase === "success" && items.length ? /* @__PURE__ */ jsx7("ul", { style: { display: "grid", gap: 12, margin: 0, padding: 0, listStyle: "none" }, children: items.map((item) => {
2929
+ return /* @__PURE__ */ jsx8(Section, { title, children: visibility.showUnavailable ? /* @__PURE__ */ jsx8(Status, { alert: true, children: "Order items are temporarily unavailable." }) : items.length ? /* @__PURE__ */ jsx8("ul", { style: { display: "grid", gap: 12, margin: 0, padding: 0, listStyle: "none" }, children: items.map((item) => {
2736
2930
  const href = safeHref3(item.href);
2737
2931
  const itemTitle = text5(item, "title", "Order item");
2738
- const itemContent = href ? /* @__PURE__ */ jsx7("a", { href, style: { color: "inherit" }, children: itemTitle }) : itemTitle;
2932
+ const itemContent = href ? /* @__PURE__ */ jsx8("a", { href, style: { color: "inherit" }, children: itemTitle }) : itemTitle;
2739
2933
  return /* @__PURE__ */ jsxs7("li", { style: { display: "flex", alignItems: "center", gap: 16, minWidth: 0, padding: 14, border: "1px solid var(--pb-color-border)", borderRadius: "calc(var(--pb-radius) / 1.5)", background: "var(--pb-color-background)" }, children: [
2740
- /* @__PURE__ */ jsx7(ProductImage3, { src: item.imageUrl, alt: itemTitle }),
2934
+ /* @__PURE__ */ jsx8(ProductImage3, { src: item.imageUrl, alt: itemTitle }),
2741
2935
  /* @__PURE__ */ jsxs7("span", { style: { minWidth: 0 }, children: [
2742
- /* @__PURE__ */ jsx7("strong", { children: itemContent }),
2743
- /* @__PURE__ */ jsx7("br", {}),
2936
+ /* @__PURE__ */ jsx8("strong", { children: itemContent }),
2937
+ /* @__PURE__ */ jsx8("br", {}),
2744
2938
  /* @__PURE__ */ jsxs7("small", { style: { color: "var(--pb-color-muted)" }, children: [
2745
2939
  "Qty ",
2746
- Number.isFinite(item.quantity) && item.quantity > 0 ? item.quantity : 1
2940
+ item.quantity
2747
2941
  ] }),
2748
2942
  item.description ? /* @__PURE__ */ jsxs7(Fragment5, { children: [
2749
- /* @__PURE__ */ jsx7("br", {}),
2750
- /* @__PURE__ */ jsx7("small", { style: { color: "var(--pb-color-muted)" }, children: item.description })
2751
- ] }) : null
2943
+ /* @__PURE__ */ jsx8("br", {}),
2944
+ /* @__PURE__ */ jsx8("small", { style: { color: "var(--pb-color-muted)" }, children: item.description })
2945
+ ] }) : null,
2946
+ href ? /* @__PURE__ */ jsx8("a", { href, style: { display: "inline-flex", alignItems: "center", minHeight: 32, marginLeft: 8, padding: "6px 12px", border: "1px solid var(--pb-color-border)", borderRadius: 6, color: "inherit", fontSize: 13 }, children: "Reorder" }) : null
2752
2947
  ] })
2753
2948
  ] }, item.id);
2754
- }) }) : /* @__PURE__ */ jsx7(Status, { children: runtime.phase === "loading" ? "Loading order items\u2026" : "Order items appear after a successful query." }) });
2949
+ }) }) : /* @__PURE__ */ jsx8(Status, { children: "Package contents are not available for this shipment." }) });
2755
2950
  }
2756
2951
  function SalesOtherTrackingBlock(props) {
2757
2952
  const runtime = useSalesRuntime();
2758
2953
  const title = text5(props, "heading", "Other shipments");
2759
- const shipments = (runtime.result?.shipments ?? []).filter((shipment) => shipment.trackingNumber !== runtime.result?.trackingNumber);
2760
- return /* @__PURE__ */ jsx7(Section, { title, busy: runtime.phase === "loading", children: runtime.phase === "error" ? /* @__PURE__ */ jsx7(Status, { alert: true, children: "Additional shipments are unavailable." }) : runtime.phase === "empty" ? /* @__PURE__ */ jsx7(Status, { children: "No additional shipments are available for that number." }) : runtime.phase === "success" && shipments.length ? /* @__PURE__ */ jsx7("ul", { style: { display: "grid", gridTemplateColumns: "repeat(auto-fit, minmax(min(100%, 220px), 1fr))", gap: 12, margin: 0, padding: 0, listStyle: "none" }, children: shipments.map((shipment) => /* @__PURE__ */ jsxs7("li", { style: { padding: 16, border: "1px solid var(--pb-color-border)", borderRadius: "calc(var(--pb-radius) / 1.5)", background: "var(--pb-color-background)" }, children: [
2761
- /* @__PURE__ */ jsx7("strong", { children: text5(shipment, "label", "Shipment") }),
2762
- shipment.status ? /* @__PURE__ */ jsx7("p", { style: { margin: "8px 0 0", color: "var(--pb-color-muted)" }, children: shipment.status }) : null,
2763
- shipment.trackingNumber ? /* @__PURE__ */ jsx7("small", { style: { display: "block", marginTop: 8, color: "var(--pb-color-muted)" }, children: shipment.trackingNumber }) : null
2764
- ] }, shipment.id)) }) : runtime.phase === "success" ? /* @__PURE__ */ jsx7(Status, { children: text5(props, "emptyMessage", "No other shipments are linked to this order.") }) : /* @__PURE__ */ jsx7(Status, { children: runtime.phase === "loading" ? "Loading other shipments\u2026" : "Other tracking numbers appear with your order result." }) });
2954
+ const shipments = runtime.result?.shipments ?? [];
2955
+ if (!trackingBlockState(runtime).showResult || shipments.length < 2 || !runtime.result) return null;
2956
+ const { shipmentValues } = trackingSelection(runtime.result, runtime.recentQueries);
2957
+ return /* @__PURE__ */ jsx8(Section, { title, children: /* @__PURE__ */ jsx8("ul", { style: { display: "grid", gridTemplateColumns: "repeat(auto-fit, minmax(min(100%, 220px), 1fr))", gap: 12, margin: 0, padding: 0, listStyle: "none" }, children: shipments.map((shipment, index) => /* @__PURE__ */ jsxs7("li", { style: { padding: 16, border: "1px solid var(--pb-color-border)", borderRadius: "calc(var(--pb-radius) / 1.5)", background: "var(--pb-color-background)" }, children: [
2958
+ /* @__PURE__ */ jsx8("button", { type: "button", "aria-pressed": runtime.selectedShipmentIndex === index, onClick: () => runtime.selectShipment(index), style: { minHeight: 44, border: 0, background: "transparent", color: "inherit", font: "inherit", fontWeight: 700, cursor: "pointer" }, children: shipmentValues[index] }),
2959
+ shipment.status ? /* @__PURE__ */ jsx8("p", { style: { margin: "8px 0 0", color: "var(--pb-color-muted)" }, children: shipment.status }) : null
2960
+ ] }, shipment.id)) }) });
2765
2961
  }
2766
2962
  function SalesServiceCardsBlock(props) {
2767
2963
  const title = text5(props, "heading", "Shop with confidence");
2768
- return /* @__PURE__ */ jsx7(Section, { title, children: /* @__PURE__ */ jsxs7("div", { style: gridStyle, children: [
2964
+ return /* @__PURE__ */ jsx8(Section, { title, children: /* @__PURE__ */ jsxs7("div", { style: gridStyle, children: [
2769
2965
  /* @__PURE__ */ jsxs7("article", { style: { padding: 20, border: "1px solid var(--pb-color-border)", borderRadius: "calc(var(--pb-radius) / 1.5)", background: "var(--pb-color-background)" }, children: [
2770
- /* @__PURE__ */ jsx7("strong", { children: text5(props, "firstTitle", "Easy returns") }),
2771
- /* @__PURE__ */ jsx7("p", { style: { marginBottom: 0, color: "var(--pb-color-muted)" }, children: text5(props, "firstDescription", "Simple support when plans change.") })
2966
+ /* @__PURE__ */ jsx8("strong", { children: text5(props, "firstTitle", "Easy returns") }),
2967
+ /* @__PURE__ */ jsx8("p", { style: { marginBottom: 0, color: "var(--pb-color-muted)" }, children: text5(props, "firstDescription", "Simple support when plans change.") })
2772
2968
  ] }),
2773
2969
  /* @__PURE__ */ jsxs7("article", { style: { padding: 20, border: "1px solid var(--pb-color-border)", borderRadius: "calc(var(--pb-radius) / 1.5)", background: "var(--pb-color-background)" }, children: [
2774
- /* @__PURE__ */ jsx7("strong", { children: text5(props, "secondTitle", "Secure delivery") }),
2775
- /* @__PURE__ */ jsx7("p", { style: { marginBottom: 0, color: "var(--pb-color-muted)" }, children: text5(props, "secondDescription", "Follow every milestone in one place.") })
2970
+ /* @__PURE__ */ jsx8("strong", { children: text5(props, "secondTitle", "Secure delivery") }),
2971
+ /* @__PURE__ */ jsx8("p", { style: { marginBottom: 0, color: "var(--pb-color-muted)" }, children: text5(props, "secondDescription", "Follow every milestone in one place.") })
2776
2972
  ] })
2777
2973
  ] }) });
2778
2974
  }
2779
2975
  function SalesProductCategoriesBlock(props) {
2780
2976
  const title = text5(props, "heading", "Shop by category");
2781
2977
  const runtime = useSalesRuntime();
2782
- if (props.collection !== void 0 && props.collection !== null && !isShopifyResourceReference(props.collection, "collection")) return /* @__PURE__ */ jsx7(Section, { title, children: /* @__PURE__ */ jsx7(Status, { alert: true, children: "Collection reference is invalid." }) });
2978
+ if (props.collection !== void 0 && props.collection !== null && !isShopifyResourceReference(props.collection, "collection")) return /* @__PURE__ */ jsx8(Section, { title, children: /* @__PURE__ */ jsx8(Status, { alert: true, children: "Collection reference is invalid." }) });
2783
2979
  const collection = isShopifyResourceReference(props.collection, "collection") ? props.collection : void 0;
2784
- if (!collection) return /* @__PURE__ */ jsx7(Section, { title, children: /* @__PURE__ */ jsx7(Status, { children: "No collection selected. Choose a collection through an authorized resource integration." }) });
2980
+ if (!collection) return /* @__PURE__ */ jsx8(Section, { title, children: /* @__PURE__ */ jsx8(Status, { children: "No collection selected. Choose a collection through an authorized resource integration." }) });
2785
2981
  const resolved = getResolvedShopifyResource(collection, runtime.resourceResolution);
2786
2982
  const error = getShopifyResourceResolutionError(collection, runtime.resourceResolution);
2787
- if (error) return /* @__PURE__ */ jsx7(Section, { title, children: /* @__PURE__ */ jsx7(Status, { alert: true, children: error.code === "missing" ? "This collection is no longer available." : "Collection details are temporarily unavailable." }) });
2788
- if (!resolved) return /* @__PURE__ */ jsx7(Section, { title, children: /* @__PURE__ */ jsx7(Status, { children: "Collection details are resolved by the authorized runtime." }) });
2983
+ if (error) return /* @__PURE__ */ jsx8(Section, { title, children: /* @__PURE__ */ jsx8(Status, { alert: true, children: error.code === "missing" ? "This collection is no longer available." : "Collection details are temporarily unavailable." }) });
2984
+ if (!resolved) return /* @__PURE__ */ jsx8(Section, { title, children: /* @__PURE__ */ jsx8(Status, { children: "Collection details are resolved by the authorized runtime." }) });
2789
2985
  const content = /* @__PURE__ */ jsxs7(Fragment5, { children: [
2790
- /* @__PURE__ */ jsx7("span", { children: resolved.title }),
2791
- /* @__PURE__ */ jsx7("span", { "aria-hidden": "true", children: "\u2192" })
2986
+ /* @__PURE__ */ jsx8("span", { children: resolved.title }),
2987
+ /* @__PURE__ */ jsx8("span", { "aria-hidden": "true", children: "\u2192" })
2792
2988
  ] });
2793
2989
  const style = { display: "flex", minHeight: 72, alignItems: "center", justifyContent: "space-between", gap: 16, padding: 18, border: "1px solid var(--pb-color-border)", borderRadius: "calc(var(--pb-radius) / 1.5)", background: "var(--pb-color-background)", color: "inherit", fontWeight: 700, textDecoration: "none" };
2794
- return /* @__PURE__ */ jsx7(Section, { title, children: resolved.href ? /* @__PURE__ */ jsx7("a", { href: resolved.href, style, children: content }) : /* @__PURE__ */ jsx7("div", { style, children: content }) });
2990
+ return /* @__PURE__ */ jsx8(Section, { title, children: resolved.href ? /* @__PURE__ */ jsx8("a", { href: resolved.href, style, children: content }) : /* @__PURE__ */ jsx8("div", { style, children: content }) });
2795
2991
  }
2796
2992
  function SalesFeaturedProductBlock(props) {
2797
2993
  const runtime = useSalesRuntime();
2798
2994
  const title = text5(props, "heading", "Featured product");
2799
- if (props.product !== void 0 && props.product !== null && !isShopifyResourceReference(props.product, "product")) return /* @__PURE__ */ jsx7(Section, { title, children: /* @__PURE__ */ jsx7(Status, { alert: true, children: "Product reference is invalid." }) });
2995
+ if (props.product !== void 0 && props.product !== null && !isShopifyResourceReference(props.product, "product")) return /* @__PURE__ */ jsx8(Section, { title, children: /* @__PURE__ */ jsx8(Status, { alert: true, children: "Product reference is invalid." }) });
2800
2996
  const product = isShopifyResourceReference(props.product, "product") ? props.product : void 0;
2801
- if (!product) return /* @__PURE__ */ jsx7(Section, { title, children: /* @__PURE__ */ jsx7(Status, { children: "No product selected. Choose a product through an authorized resource integration." }) });
2997
+ if (!product) return /* @__PURE__ */ jsx8(Section, { title, children: /* @__PURE__ */ jsx8(Status, { children: "No product selected. Choose a product through an authorized resource integration." }) });
2802
2998
  const resolved = getResolvedShopifyResource(product, runtime.resourceResolution);
2803
2999
  const error = getShopifyResourceResolutionError(product, runtime.resourceResolution);
2804
- if (error) return /* @__PURE__ */ jsx7(Section, { title, children: /* @__PURE__ */ jsx7(Status, { alert: true, children: error.code === "missing" ? "This product is no longer available." : "Product details are temporarily unavailable." }) });
2805
- if (!resolved) return /* @__PURE__ */ jsx7(Section, { title, children: /* @__PURE__ */ jsx7(Status, { children: "Product details and availability are resolved by the authorized runtime." }) });
3000
+ if (error) return /* @__PURE__ */ jsx8(Section, { title, children: /* @__PURE__ */ jsx8(Status, { alert: true, children: error.code === "missing" ? "This product is no longer available." : "Product details are temporarily unavailable." }) });
3001
+ if (!resolved) return /* @__PURE__ */ jsx8(Section, { title, children: /* @__PURE__ */ jsx8(Status, { children: "Product details and availability are resolved by the authorized runtime." }) });
2806
3002
  const available = resolved.availability === "available";
2807
3003
  const body = /* @__PURE__ */ jsxs7(Fragment5, { children: [
2808
- /* @__PURE__ */ jsx7(ProductImage3, { src: resolved.imageUrl, alt: resolved.title }),
3004
+ /* @__PURE__ */ jsx8(ProductImage3, { src: resolved.imageUrl, alt: resolved.title }),
2809
3005
  /* @__PURE__ */ jsxs7("span", { style: { minWidth: 0, flex: 1 }, children: [
2810
- /* @__PURE__ */ jsx7("strong", { children: resolved.title }),
2811
- /* @__PURE__ */ jsx7("br", {}),
2812
- /* @__PURE__ */ jsx7("small", { style: { color: "var(--pb-color-muted)" }, children: available ? "Available" : resolved.availability === "sold-out" ? "Sold out" : "Unavailable" })
3006
+ /* @__PURE__ */ jsx8("strong", { children: resolved.title }),
3007
+ /* @__PURE__ */ jsx8("br", {}),
3008
+ /* @__PURE__ */ jsx8("small", { style: { color: "var(--pb-color-muted)" }, children: available ? "Available" : resolved.availability === "sold-out" ? "Sold out" : "Unavailable" })
2813
3009
  ] })
2814
3010
  ] });
2815
3011
  const style = { display: "flex", alignItems: "center", gap: 16, padding: 14, border: "1px solid var(--pb-color-border)", borderRadius: "calc(var(--pb-radius) / 1.5)", background: "var(--pb-color-background)", color: "inherit", textDecoration: "none" };
2816
- return /* @__PURE__ */ jsx7(Section, { title, children: available && resolved.href ? /* @__PURE__ */ jsx7("a", { href: resolved.href, style, children: body }) : /* @__PURE__ */ jsx7("div", { style, children: body }) });
3012
+ return /* @__PURE__ */ jsx8(Section, { title, children: available && resolved.href ? /* @__PURE__ */ jsx8("a", { href: resolved.href, style, children: body }) : /* @__PURE__ */ jsx8("div", { style, children: body }) });
2817
3013
  }
2818
3014
  function SalesRecommendationsBlock(props) {
2819
3015
  const runtime = useSalesRuntime();
2820
3016
  const title = text5(props, "heading", "Complete your order");
2821
- const recommendations = runtime.result?.recommendations ?? [];
2822
- return /* @__PURE__ */ jsx7(Section, { title, busy: runtime.phase === "loading", children: runtime.phase === "error" ? /* @__PURE__ */ jsx7(Status, { alert: true, children: "Recommendations are temporarily unavailable." }) : runtime.phase === "empty" ? /* @__PURE__ */ jsx7(Status, { children: "No recommendations are available for that number." }) : runtime.phase === "success" && recommendations.length ? /* @__PURE__ */ jsx7("div", { style: gridStyle, children: recommendations.map((item) => {
3017
+ const recommendations = recommendationItems(props.products, runtime);
3018
+ if (!recommendations.length) return null;
3019
+ return /* @__PURE__ */ jsx8(Section, { title, children: /* @__PURE__ */ jsx8("div", { style: gridStyle, children: recommendations.map((item) => {
2823
3020
  const href = safeHref3(item.href);
2824
3021
  const itemTitle = text5(item, "title", "Recommended product");
2825
- const price = item.price ? formatTrackingPageMoney(item.price) : void 0;
3022
+ const price = formatRecommendationPrice(item.price);
2826
3023
  return /* @__PURE__ */ jsxs7("article", { style: { display: "grid", gap: 14, minWidth: 0, padding: 18, border: "1px solid var(--pb-color-border)", borderRadius: "calc(var(--pb-radius) / 1.5)", background: "var(--pb-color-background)" }, children: [
2827
- /* @__PURE__ */ jsx7(ProductImage3, { src: item.imageUrl, alt: itemTitle }),
3024
+ /* @__PURE__ */ jsx8(ProductImage3, { src: item.imageUrl, alt: itemTitle }),
2828
3025
  /* @__PURE__ */ jsxs7("div", { children: [
2829
- /* @__PURE__ */ jsx7("strong", { children: href ? /* @__PURE__ */ jsx7("a", { href, style: { color: "inherit" }, children: itemTitle }) : itemTitle }),
2830
- price?.amount ? /* @__PURE__ */ jsx7("small", { style: { display: "block", marginTop: 5, color: "var(--pb-color-muted)" }, children: price.amount }) : null,
2831
- item.description ? /* @__PURE__ */ jsx7("p", { style: { marginBottom: 0, color: "var(--pb-color-muted)" }, children: item.description }) : null
3026
+ /* @__PURE__ */ jsx8("strong", { children: href ? /* @__PURE__ */ jsx8("a", { href, style: { color: "inherit" }, children: itemTitle }) : itemTitle }),
3027
+ price ? /* @__PURE__ */ jsx8("small", { style: { display: "block", marginTop: 5, color: "var(--pb-color-muted)" }, children: price }) : null,
3028
+ item.description ? /* @__PURE__ */ jsx8("p", { style: { marginBottom: 0, color: "var(--pb-color-muted)" }, children: item.description }) : null
2832
3029
  ] })
2833
3030
  ] }, item.id);
2834
- }) }) : /* @__PURE__ */ jsx7(Status, { children: runtime.phase === "success" ? "No recommendations are available for this order." : runtime.phase === "loading" ? "Loading recommendations\u2026" : "Recommended products appear with your order result." }) });
3031
+ }) }) });
2835
3032
  }
2836
3033
 
2837
3034
  // src/shopify-resources.tsx
2838
- import { createContext as createContext4, useCallback as useCallback5, useContext as useContext4, useState as useState6 } from "react";
2839
- import { jsx as jsx8, jsxs as jsxs8 } from "react/jsx-runtime";
2840
- var ShopifyResourceBrowserContext = createContext4(void 0);
3035
+ import { createContext as createContext2, useCallback as useCallback3, useContext as useContext2, useState as useState7 } from "react";
3036
+ import { jsx as jsx9, jsxs as jsxs8 } from "react/jsx-runtime";
3037
+ var ShopifyResourceBrowserContext = createContext2(void 0);
2841
3038
  function ShopifyResourcePickerProvider({ browser, children }) {
2842
- return /* @__PURE__ */ jsx8(ShopifyResourceBrowserContext.Provider, { value: browser, children });
3039
+ return /* @__PURE__ */ jsx9(ShopifyResourceBrowserContext.Provider, { value: browser, children });
2843
3040
  }
2844
3041
  var pickerSurface = { marginTop: 8, padding: 12, border: "1px solid #c9cccf", borderRadius: 8, background: "#fff", color: "#202223" };
2845
3042
  var pickerButton = { minHeight: 32, padding: "6px 10px", border: "1px solid #8c9196", borderRadius: 6, background: "#fff", color: "#202223", font: "inherit", cursor: "pointer" };
2846
3043
  function ResourceField({ value, onChange, kind }) {
2847
- const browser = useContext4(ShopifyResourceBrowserContext);
3044
+ const browser = useContext2(ShopifyResourceBrowserContext);
2848
3045
  const selected = isShopifyResourceReference(value, kind) ? value : void 0;
2849
- const [open, setOpen] = useState6(false);
2850
- const [query, setQuery] = useState6("");
2851
- const [items, setItems] = useState6([]);
2852
- const [cursor, setCursor] = useState6();
2853
- const [state, setState] = useState6("idle");
2854
- const search = useCallback5(async (nextQuery, nextCursor, append = false) => {
3046
+ const [open, setOpen] = useState7(false);
3047
+ const [query, setQuery] = useState7("");
3048
+ const [items, setItems] = useState7([]);
3049
+ const [cursor, setCursor] = useState7();
3050
+ const [state, setState] = useState7("idle");
3051
+ const search = useCallback3(async (nextQuery, nextCursor, append = false) => {
2855
3052
  if (!browser) return;
2856
3053
  setState("loading");
2857
3054
  try {
@@ -2867,15 +3064,15 @@ function ResourceField({ value, onChange, kind }) {
2867
3064
  const name = kind === "product" ? "product" : "collection";
2868
3065
  return /* @__PURE__ */ jsxs8("div", { "data-shopify-resource-field": kind, children: [
2869
3066
  selected ? /* @__PURE__ */ jsxs8("p", { style: { margin: "0 0 8px" }, children: [
2870
- /* @__PURE__ */ jsx8("strong", { children: selected.title }),
2871
- /* @__PURE__ */ jsx8("br", {}),
2872
- /* @__PURE__ */ jsx8("small", { children: selected.id })
3067
+ /* @__PURE__ */ jsx9("strong", { children: selected.title }),
3068
+ /* @__PURE__ */ jsx9("br", {}),
3069
+ /* @__PURE__ */ jsx9("small", { children: selected.id })
2873
3070
  ] }) : /* @__PURE__ */ jsxs8("p", { style: { margin: "0 0 8px" }, children: [
2874
3071
  "No ",
2875
3072
  name,
2876
3073
  " selected."
2877
3074
  ] }),
2878
- /* @__PURE__ */ jsx8("button", { type: "button", style: pickerButton, onClick: () => {
3075
+ /* @__PURE__ */ jsx9("button", { type: "button", style: pickerButton, onClick: () => {
2879
3076
  if (open) {
2880
3077
  setOpen(false);
2881
3078
  return;
@@ -2893,32 +3090,32 @@ function ResourceField({ value, onChange, kind }) {
2893
3090
  "Search ",
2894
3091
  name,
2895
3092
  "s",
2896
- /* @__PURE__ */ jsx8("input", { "aria-label": `Search ${name}s`, value: query, onChange: (event) => setQuery(event.currentTarget.value), style: { boxSizing: "border-box", display: "block", width: "100%", minHeight: 32, marginTop: 4, padding: "6px 8px" } })
3093
+ /* @__PURE__ */ jsx9("input", { "aria-label": `Search ${name}s`, value: query, onChange: (event) => setQuery(event.currentTarget.value), style: { boxSizing: "border-box", display: "block", width: "100%", minHeight: 32, marginTop: 4, padding: "6px 8px" } })
2897
3094
  ] }),
2898
- /* @__PURE__ */ jsx8("button", { type: "submit", disabled: state === "loading", style: { ...pickerButton, marginTop: 8 }, children: state === "loading" ? "Searching\u2026" : "Search" })
3095
+ /* @__PURE__ */ jsx9("button", { type: "submit", disabled: state === "loading", style: { ...pickerButton, marginTop: 8 }, children: state === "loading" ? "Searching\u2026" : "Search" })
2899
3096
  ] }),
2900
- state === "error" ? /* @__PURE__ */ jsx8("p", { role: "alert", children: "The authorized resource service is unavailable. Try again later." }) : null,
3097
+ state === "error" ? /* @__PURE__ */ jsx9("p", { role: "alert", children: "The authorized resource service is unavailable. Try again later." }) : null,
2901
3098
  state === "idle" && !items.length ? /* @__PURE__ */ jsxs8("p", { role: "status", children: [
2902
3099
  "No ",
2903
3100
  name,
2904
3101
  "s found."
2905
3102
  ] }) : null,
2906
- items.length ? /* @__PURE__ */ jsx8("ul", { style: { display: "grid", gap: 6, margin: "12px 0", padding: 0, listStyle: "none" }, children: items.map((item) => /* @__PURE__ */ jsx8("li", { children: /* @__PURE__ */ jsxs8("button", { type: "button", style: { ...pickerButton, width: "100%", textAlign: "left" }, onClick: () => {
3103
+ items.length ? /* @__PURE__ */ jsx9("ul", { style: { display: "grid", gap: 6, margin: "12px 0", padding: 0, listStyle: "none" }, children: items.map((item) => /* @__PURE__ */ jsx9("li", { children: /* @__PURE__ */ jsxs8("button", { type: "button", style: { ...pickerButton, width: "100%", textAlign: "left" }, onClick: () => {
2907
3104
  onChange(item);
2908
3105
  setOpen(false);
2909
3106
  }, children: [
2910
- /* @__PURE__ */ jsx8("strong", { children: item.title }),
2911
- item.handle ? /* @__PURE__ */ jsx8("small", { style: { display: "block" }, children: item.handle }) : null
3107
+ /* @__PURE__ */ jsx9("strong", { children: item.title }),
3108
+ item.handle ? /* @__PURE__ */ jsx9("small", { style: { display: "block" }, children: item.handle }) : null
2912
3109
  ] }) }, item.id)) }) : null,
2913
- cursor ? /* @__PURE__ */ jsx8("button", { type: "button", disabled: state === "loading", style: pickerButton, onClick: () => void search(query, cursor, true), children: "Load more" }) : null
3110
+ cursor ? /* @__PURE__ */ jsx9("button", { type: "button", disabled: state === "loading", style: pickerButton, onClick: () => void search(query, cursor, true), children: "Load more" }) : null
2914
3111
  ] }) : null
2915
3112
  ] });
2916
3113
  }
2917
3114
  function ShopifyProductResourceField(props) {
2918
- return /* @__PURE__ */ jsx8(ResourceField, { ...props, kind: "product" });
3115
+ return /* @__PURE__ */ jsx9(ResourceField, { ...props, kind: "product" });
2919
3116
  }
2920
3117
  function ShopifyCollectionResourceField(props) {
2921
- return /* @__PURE__ */ jsx8(ResourceField, { ...props, kind: "collection" });
3118
+ return /* @__PURE__ */ jsx9(ResourceField, { ...props, kind: "collection" });
2922
3119
  }
2923
3120
 
2924
3121
  // src/sales-definition.ts
@@ -2968,13 +3165,14 @@ var salesBlocks = withTemplatePolicy3([
2968
3165
  { type: "besttrack.sales.service-cards", version: 1, label: "Service cards", category: "BestTrack Sales", targets: ["web"], defaultProps: { heading: "Shop with confidence", firstTitle: "Easy returns", firstDescription: "Simple support when plans change.", secondTitle: "Secure delivery", secondDescription: "Follow every milestone in one place." }, defaultVariant: "hero", variants: [{ id: "hero", label: "Sales Hero" }, { id: "commerce", label: "Commerce" }], fields: { heading: shortText("Heading"), firstTitle: shortText("First card title"), firstDescription: longText("First card description"), secondTitle: shortText("Second card title"), secondDescription: longText("Second card description") }, validate: textProps([["heading", 120], ["firstTitle", 120], ["firstDescription", 280], ["secondTitle", 120], ["secondDescription", 280]]), render: { web: SalesServiceCardsBlock, editor: SalesServiceCardsEditor } },
2969
3166
  { type: "besttrack.sales.product-categories", version: 3, label: "Product categories", category: "BestTrack Sales", targets: ["web"], defaultProps: { heading: "Shop by category", collection: { id: "gid://shopify/Collection/1", kind: "collection", title: "Featured collection", handle: "featured" } }, defaultVariant: "hero", variants: [{ id: "hero", label: "Sales Hero" }, { id: "commerce", label: "Commerce" }, { id: "grid", label: "Grid", theme: { "color.surface": "#f8fafc" } }], fields: { heading: shortText("Heading"), collection: { field: "besttrack.shopify.collection", label: "Collection", group: "Resource", description: "Browse through an authorized host integration. Only a stable ID and minimal display copy are saved." } }, validate: validateCategories, render: { web: SalesProductCategoriesBlock, editor: SalesProductCategoriesEditor } },
2970
3167
  { type: "besttrack.sales.featured-product", version: 1, label: "Featured product", category: "BestTrack Sales", targets: ["web"], defaultProps: { heading: "Featured product", product: { id: "gid://shopify/Product/1", kind: "product", title: "Featured product", handle: "featured-product" } }, defaultVariant: "hero", variants: [{ id: "hero", label: "Sales Hero" }, { id: "commerce", label: "Commerce" }], fields: { heading: shortText("Heading"), product: { field: "besttrack.shopify.product", label: "Product", group: "Resource", description: "Browse through an authorized host integration. Current availability is resolved only at runtime." } }, validate: validateFeaturedProduct, render: { web: SalesFeaturedProductBlock, editor: SalesFeaturedProductEditor } },
2971
- { type: "besttrack.sales.recommendations", version: 1, label: "Recommended products", category: "BestTrack Sales", targets: ["web"], defaultProps: { heading: "Complete your order" }, defaultVariant: "hero", variants: [{ id: "hero", label: "Sales Hero" }, { id: "commerce", label: "Commerce" }, { id: "grid", label: "Product grid", theme: { "color.surface": "#f8fafc" } }], fields: { heading: shortText("Heading") }, validate: textProps([["heading", 120]]), render: { web: SalesRecommendationsBlock, editor: SalesRecommendationsEditor } }
2972
- ], ["besttrack.sales.announcement", "besttrack.sales.query"]);
3168
+ // 与另外两套模板一样保存商家选品配置;空数组表示交给独立推荐来源,不能改读查单推荐。
3169
+ { type: "besttrack.sales.recommendations", version: 1, label: "Recommended products", category: "BestTrack Sales", targets: ["web"], defaultProps: { heading: "Complete your order", products: [] }, defaultVariant: "hero", variants: [{ id: "hero", label: "Sales Hero" }, { id: "commerce", label: "Commerce" }, { id: "grid", label: "Product grid", theme: { "color.surface": "#f8fafc" } }], fields: { heading: shortText("Heading"), products: { field: "besttrack.sales.products", label: "\u63A8\u8350\u5546\u54C1 (Shopify)", control: "products", group: "Content" } }, validate: textProps([["heading", 120]]), render: { web: SalesRecommendationsBlock, editor: SalesRecommendationsEditor } }
3170
+ ], ["besttrack.sales.announcement", "besttrack.sales.query", "besttrack.sales.order-items", "besttrack.sales.other-tracking", "besttrack.sales.recommendations"]);
2973
3171
  var salesTemplatePolicy = defineTemplatePolicy(
2974
3172
  "besttrack.sales",
2975
3173
  "Sales",
2976
3174
  salesBlocks.map((block) => block.type),
2977
- ["besttrack.sales.announcement", "besttrack.sales.query"]
3175
+ ["besttrack.sales.announcement", "besttrack.sales.query", "besttrack.sales.order-items", "besttrack.sales.other-tracking", "besttrack.sales.recommendations"]
2978
3176
  );
2979
3177
  function createSalesTemplate() {
2980
3178
  return { id: "besttrack.sales", version: 3, name: "Sales", target: "web", source: "built-in", requiredBlocks: salesBlocks.map((block) => block.type), theme: { "color.primary": "#000000", "color.background": "#f7f5f0", "color.surface": "#ffffff", "color.text": "#0a0a0a", "color.muted": "#6b6b6b", "color.border": "#dfddd7", "font.family": "Arial, Helvetica, sans-serif", radius: "10px", spacing: "24px" }, create: () => createPageDocument3({ pageId: "besttrack-sales", target: "web", templateId: "besttrack.sales", templateVersion: 3, settings: { locale: "en", seoTitle: "Shop and track your order" }, blocks: salesBlocks.map((block, index) => ({ id: "sales-" + (index + 1), type: block.type, version: block.version, props: block.defaultProps, variant: block.defaultVariant, style: {} })) }) };
@@ -2982,13 +3180,14 @@ function createSalesTemplate() {
2982
3180
  var bestTrackSalesExtension = Object.freeze({ name: "besttrack.sales", version: "0.8.0", fields: [{ type: "besttrack.sales.text", component: SalesTextField }, { type: "besttrack.shopify.collection", component: ShopifyCollectionResourceField }, { type: "besttrack.shopify.product", component: ShopifyProductResourceField }], blocks: salesBlocks, templates: [createSalesTemplate()] });
2983
3181
  export {
2984
3182
  BrandedRuntimeProvider,
2985
- ReadyToGoRuntimeProvider,
3183
+ TrackingRuntimeProvider as ReadyToGoRuntimeProvider,
2986
3184
  SHOPIFY_RECOMMEND_PATH,
2987
3185
  SHOPIFY_TRACK_QUERY_PATH,
2988
3186
  SalesRuntimeProvider,
2989
3187
  ShopifyCollectionResourceField,
2990
3188
  ShopifyProductResourceField,
2991
3189
  ShopifyResourcePickerProvider,
3190
+ TrackingRuntimeProvider,
2992
3191
  bestTrackBrandedExtension,
2993
3192
  bestTrackPageExtension,
2994
3193
  bestTrackSalesExtension,
@@ -3022,6 +3221,7 @@ export {
3022
3221
  salesTemplatePolicy,
3023
3222
  shouldHidePoweredBy,
3024
3223
  syncTrackingQueryToUrl,
3224
+ useTrackingRuntime,
3025
3225
  withShopifyAppProxyPrefix,
3026
3226
  withShopifyTrackCacheBust
3027
3227
  };