@fluid-app/portal-sdk 0.1.518 → 0.1.520

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/dist/{ContactsScreen-By9x021F.mjs → ContactsScreen-5tn5LOdL.mjs} +2 -2
  2. package/dist/{ContactsScreen-DP5A5yQN.mjs → ContactsScreen-BIjEr68m.mjs} +2 -2
  3. package/dist/{ContactsScreen-DP5A5yQN.mjs.map → ContactsScreen-BIjEr68m.mjs.map} +1 -1
  4. package/dist/{ContactsScreen-DV0hoorh.cjs → ContactsScreen-CQeHdBSj.cjs} +2 -2
  5. package/dist/{ContactsScreen-B6_KXScY.cjs → ContactsScreen-DJsCRndV.cjs} +2 -2
  6. package/dist/{ContactsScreen-B6_KXScY.cjs.map → ContactsScreen-DJsCRndV.cjs.map} +1 -1
  7. package/dist/{FluidProvider-DYN-3PCs.mjs → FluidProvider-BsXK_zQv.mjs} +3 -2
  8. package/dist/{FluidProvider-DYN-3PCs.mjs.map → FluidProvider-BsXK_zQv.mjs.map} +1 -1
  9. package/dist/{FluidProvider-DwwVnnFW.cjs → FluidProvider-xECI7Cct.cjs} +2 -1
  10. package/dist/FluidProvider-xECI7Cct.cjs.map +1 -0
  11. package/dist/{MessagingScreen-CUOhRPr-.mjs → MessagingScreen-Bwne_Hx_.mjs} +3 -3
  12. package/dist/{MessagingScreen-CEHNxhs9.cjs → MessagingScreen-C4CaUUMV.cjs} +3 -3
  13. package/dist/{MessagingScreen-CEHNxhs9.cjs.map → MessagingScreen-C4CaUUMV.cjs.map} +1 -1
  14. package/dist/{MessagingScreen-B-J6jRWH.cjs → MessagingScreen-CBjR49dn.cjs} +3 -3
  15. package/dist/{MessagingScreen-B5zl1dov.mjs → MessagingScreen-DnRfW8T_.mjs} +3 -3
  16. package/dist/{MessagingScreen-B5zl1dov.mjs.map → MessagingScreen-DnRfW8T_.mjs.map} +1 -1
  17. package/dist/{MySiteScreen-DV7iYs_P.mjs → MySiteScreen-BOwQw4Ud.mjs} +2 -2
  18. package/dist/{MySiteScreen-q4tciAP1.cjs → MySiteScreen-C6_2pJ3S.cjs} +2 -2
  19. package/dist/{MySiteScreen-q4tciAP1.cjs.map → MySiteScreen-C6_2pJ3S.cjs.map} +1 -1
  20. package/dist/{MySiteScreen-CAvKw9Yo.mjs → MySiteScreen-CktOXvV5.mjs} +2 -2
  21. package/dist/{MySiteScreen-CAvKw9Yo.mjs.map → MySiteScreen-CktOXvV5.mjs.map} +1 -1
  22. package/dist/{MySiteScreen-DMZyJGuY.cjs → MySiteScreen-nmG9-sZI.cjs} +2 -2
  23. package/dist/{OrdersScreen-CInfDm3v.cjs → OrdersScreen-C_JKIGjS.cjs} +2 -2
  24. package/dist/{OrdersScreen-CxN6w55q.cjs → OrdersScreen-Cok9YH0q.cjs} +2 -2
  25. package/dist/{OrdersScreen-CxN6w55q.cjs.map → OrdersScreen-Cok9YH0q.cjs.map} +1 -1
  26. package/dist/{OrdersScreen-2s7JqOac.mjs → OrdersScreen-Cypqeqk0.mjs} +2 -2
  27. package/dist/{OrdersScreen-BJH8PmWZ.mjs → OrdersScreen-DlJU28Ll.mjs} +2 -2
  28. package/dist/{OrdersScreen-BJH8PmWZ.mjs.map → OrdersScreen-DlJU28Ll.mjs.map} +1 -1
  29. package/dist/{ProfileScreen-thlAvVV-.mjs → ProfileScreen-DF2jFZN3.mjs} +3 -3
  30. package/dist/{ProfileScreen-thlAvVV-.mjs.map → ProfileScreen-DF2jFZN3.mjs.map} +1 -1
  31. package/dist/{ProfileScreen-CQia71t1.mjs → ProfileScreen-DNMonsJC.mjs} +4 -4
  32. package/dist/{ProfileScreen-DdhsKq8b.cjs → ProfileScreen-QucOM0vU.cjs} +4 -4
  33. package/dist/{ProfileScreen-DDo49SL5.cjs → ProfileScreen-kJiYhRI9.cjs} +3 -3
  34. package/dist/{ProfileScreen-DDo49SL5.cjs.map → ProfileScreen-kJiYhRI9.cjs.map} +1 -1
  35. package/dist/{SubscriptionsScreen-AW_duq75.cjs → SubscriptionsScreen-CrKfJmYj.cjs} +4 -4
  36. package/dist/{SubscriptionsScreen-C0ZFD-A5.mjs → SubscriptionsScreen-CsfDx795.mjs} +4 -4
  37. package/dist/{SubscriptionsScreen-CRHFGux0.cjs → SubscriptionsScreen-D2Thca-o.cjs} +105 -57
  38. package/dist/SubscriptionsScreen-D2Thca-o.cjs.map +1 -0
  39. package/dist/{SubscriptionsScreen-CdDBKpkc.mjs → SubscriptionsScreen-DBYCi-c3.mjs} +106 -58
  40. package/dist/SubscriptionsScreen-DBYCi-c3.mjs.map +1 -0
  41. package/dist/index.cjs +21 -21
  42. package/dist/index.mjs +21 -21
  43. package/dist/{sidebar-DS8r8yy1.mjs → sidebar-CQpJWKMc.mjs} +2 -2
  44. package/dist/{sidebar-DS8r8yy1.mjs.map → sidebar-CQpJWKMc.mjs.map} +1 -1
  45. package/dist/{sidebar-Cu7C835M.cjs → sidebar-zkV-HxHW.cjs} +7 -1
  46. package/dist/{sidebar-Cu7C835M.cjs.map → sidebar-zkV-HxHW.cjs.map} +1 -1
  47. package/dist/{use-portal-card-add-3ds-flow-B2Ca5nEr.mjs → use-portal-card-add-3ds-flow-C8Otluj_.mjs} +2 -2
  48. package/dist/{use-portal-card-add-3ds-flow-B2Ca5nEr.mjs.map → use-portal-card-add-3ds-flow-C8Otluj_.mjs.map} +1 -1
  49. package/dist/{use-portal-card-add-3ds-flow-Bvs0RcyI.cjs → use-portal-card-add-3ds-flow-D7IUv-eA.cjs} +2 -2
  50. package/dist/{use-portal-card-add-3ds-flow-Bvs0RcyI.cjs.map → use-portal-card-add-3ds-flow-D7IUv-eA.cjs.map} +1 -1
  51. package/package.json +13 -13
  52. package/dist/FluidProvider-DwwVnnFW.cjs.map +0 -1
  53. package/dist/SubscriptionsScreen-CRHFGux0.cjs.map +0 -1
  54. package/dist/SubscriptionsScreen-CdDBKpkc.mjs.map +0 -1
@@ -2,7 +2,7 @@ import { $t as addYears, Bt as isAfter, C as SheetTitle, D as SelectItem, E as S
2
2
  import { A as isCardPaymentDescriptor, B as normalizeCardBrand, Ct as usePayApi, I as resolvePaymentMethodDisplay, N as normalizePaymentDescriptor, P as paymentDescriptorLabel, z as getPaymentBrandName } from "./build-widget-registry-B5HGhRhG.mjs";
3
3
  import { i as useOptionalStore } from "./use-optional-store-DpB_jK4Q.mjs";
4
4
  import { r as useCountriesApi } from "./Combobox-D8ukt9Tb.mjs";
5
- import { c as createSubscriptionsTranslationAdapter, l as subscriptionsDomain } from "./FluidProvider-DYN-3PCs.mjs";
5
+ import { c as createSubscriptionsTranslationAdapter, l as subscriptionsDomain } from "./FluidProvider-BsXK_zQv.mjs";
6
6
  import { i as toApiErrorBody, r as isApiError } from "./fetch-client-VuLKnuMk.mjs";
7
7
  import { i as useFluidContext } from "./ContactsTranslationBridge-DWMYBg0T.mjs";
8
8
  import { $ as subscriptionsCancel, Q as subscriptionBundlesList, T as usePortalTenantClient, Z as subscriptionBundlesCreate, at as subscriptionsResume, ct as subscriptionsSkip, et as subscriptionsFailedCycleWaiverCreate, it as subscriptionsReactivate, lt as subscriptionsUpdate, nt as subscriptionsList, ot as subscriptionsRetry, rt as subscriptionsPause, st as subscriptionsShow, tt as subscriptionsFailedCycleWaiverPreview } from "./prop-types-MDYLEtXz.mjs";
@@ -14,10 +14,10 @@ import { t as MobileActionSheet } from "./MobileActionSheet-DBKhO5th.mjs";
14
14
  import { t as ResponsiveDialog } from "./ResponsiveDialog-C1p9IkQx.mjs";
15
15
  import { n as useAppNavigation } from "./AppNavigationContext-PCbmG3nH.mjs";
16
16
  import { t as useStore } from "./use-store-BdJfR_s4.mjs";
17
- import { f as useSidebar } from "./sidebar-DS8r8yy1.mjs";
17
+ import { p as useSidebar, r as SidebarContext } from "./sidebar-CQpJWKMc.mjs";
18
18
  import { n as ScreenHeaderBreadcrumbs } from "./ScreenHeaderContext-DahYFA_m.mjs";
19
- import { _ as ProfileTranslationBridge, a as getBrowserInfo, c as EditPaymentMethodDialog, d as getCardDisplayName, f as getCardExpiry, g as EllipsesDropdown, h as ConfirmActionDialog, i as isThreeDsRequiredCreate, l as FluidPayCoreProvider, n as createFluidPayApiAdapter, o as CreditCardFormDialog, p as getPaymentMethodLogoBrand, r as mapToFluidPayPaymentMethod, s as AddressFormDialog, t as usePortalCardAdd3DSFlow, u as PaymentIcon, v as useProfileTranslation } from "./use-portal-card-add-3ds-flow-B2Ca5nEr.mjs";
20
- import { createContext, use, useCallback, useEffect, useId, useMemo, useRef, useState } from "react";
19
+ import { _ as ProfileTranslationBridge, a as getBrowserInfo, c as EditPaymentMethodDialog, d as getCardDisplayName, f as getCardExpiry, g as EllipsesDropdown, h as ConfirmActionDialog, i as isThreeDsRequiredCreate, l as FluidPayCoreProvider, n as createFluidPayApiAdapter, o as CreditCardFormDialog, p as getPaymentMethodLogoBrand, r as mapToFluidPayPaymentMethod, s as AddressFormDialog, t as usePortalCardAdd3DSFlow, u as PaymentIcon, v as useProfileTranslation } from "./use-portal-card-add-3ds-flow-C8Otluj_.mjs";
20
+ import { createContext, use, useCallback, useContext, useEffect, useId, useMemo, useRef, useState } from "react";
21
21
  import { useInfiniteQuery, useIsFetching, useMutation, useQuery, useQueryClient } from "@tanstack/react-query";
22
22
  import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
23
23
  import { AlertCircle, CalendarDays, CalendarIcon, Check, ChevronDown, ChevronLeft, ChevronRight, CreditCard, Ellipsis, ImageOff, Minus, Package, Pause, Play, Plus, RefreshCw, Repeat, RotateCcw, SkipForward, Truck, XCircle } from "lucide-react";
@@ -8542,7 +8542,7 @@ function PortalSubscriptionShippingAddressSectionInner({ addressId, address: cur
8542
8542
  * 6. Never lets a stalled sibling invalidation hold up the target's own
8543
8543
  * awaited refetch.
8544
8544
  */
8545
- function useUpdateAutoApplyPoints({ currentSubscriptionToken, onSuccess, onError } = {}) {
8545
+ function useUpdateAutoApplyPoints({ queryKeys, currentSubscriptionToken, onSuccess, onError }) {
8546
8546
  const api = useAutoApplyPointsApi();
8547
8547
  const queryClient = useQueryClient();
8548
8548
  const latestTokenRef = useRef(currentSubscriptionToken);
@@ -8556,17 +8556,16 @@ function useUpdateAutoApplyPoints({ currentSubscriptionToken, onSuccess, onError
8556
8556
  onSuccess: async (result, variables) => {
8557
8557
  const siblingTokens = [...new Set([...result.resolvedSubscriptionTokens, ...variables.bundleTokens ?? []])].filter((token) => token !== variables.subscriptionToken);
8558
8558
  Promise.all(siblingTokens.map((token) => queryClient.invalidateQueries({
8559
- queryKey: subscriptionsKeys.detail(token),
8559
+ queryKey: queryKeys.detail(token),
8560
8560
  exact: true
8561
8561
  }).catch(() => {})));
8562
- queryClient.invalidateQueries({ queryKey: subscriptionsKeys.lists });
8563
- queryClient.invalidateQueries({ queryKey: subscriptionsKeys.infiniteLists });
8562
+ for (const listKey of queryKeys.lists) queryClient.invalidateQueries({ queryKey: listKey });
8564
8563
  await queryClient.refetchQueries({
8565
- queryKey: subscriptionsKeys.detail(variables.subscriptionToken),
8564
+ queryKey: queryKeys.detail(variables.subscriptionToken),
8566
8565
  exact: true
8567
8566
  });
8568
8567
  if (latestTokenRef.current && latestTokenRef.current !== variables.subscriptionToken) return;
8569
- const refreshedDetail = queryClient.getQueryData(subscriptionsKeys.detail(variables.subscriptionToken));
8568
+ const refreshedDetail = queryClient.getQueryData(queryKeys.detail(variables.subscriptionToken));
8570
8569
  onSuccess?.({
8571
8570
  result,
8572
8571
  refreshed: refreshedDetail?.subscription.auto_apply_points === variables.autoApplyPoints,
@@ -8580,16 +8579,30 @@ function useUpdateAutoApplyPoints({ currentSubscriptionToken, onSuccess, onError
8580
8579
  });
8581
8580
  }
8582
8581
  //#endregion
8583
- //#region src/subscriptions/subscription-auto-apply-points.ts
8582
+ //#region ../../subscriptions/ui/src/lib/auto-apply-points.ts
8583
+ /**
8584
+ * Whether the control belongs on this subscription at all.
8585
+ *
8586
+ * Split out of the state below because a host needs the same answer before
8587
+ * this component renders: the host owns the surrounding layout, so it has to
8588
+ * know whether to draw the frame rather than leaving an empty one behind.
8589
+ *
8590
+ * An absent `pointsEnabled` counts as off rather than on. The field is
8591
+ * additive, so an older payload, or a read path that quietly drops it, must
8592
+ * hide a setting that could not act instead of offering it.
8593
+ *
8594
+ * Returns true when the control should render.
8595
+ */
8596
+ function autoApplyPointsControlVisible(pointsEnabled) {
8597
+ return pointsEnabled === true;
8598
+ }
8584
8599
  /**
8585
8600
  * Resolve what the auto-apply-points switch shows, from server state alone.
8586
8601
  *
8587
8602
  * Three rules, each written against a specific way this can go wrong:
8588
8603
  *
8589
- * - A company that does not run a points program never sees the control. An
8590
- * absent `pointsEnabled` counts as off rather than on: the field is
8591
- * additive, so an older payload, or a read path that quietly drops it,
8592
- * must hide a setting that could not act instead of offering it.
8604
+ * - A company that does not run a points program never sees the control.
8605
+ * See autoApplyPointsControlVisible for why an absent flag counts as off.
8593
8606
  * - `checked` comes from the payload and never from a default. Defaulting to
8594
8607
  * off would render the switch unset while the server held the customer's
8595
8608
  * opt-in, which reads as "their choice was lost".
@@ -8600,7 +8613,7 @@ function useUpdateAutoApplyPoints({ currentSubscriptionToken, onSuccess, onError
8600
8613
  */
8601
8614
  function autoApplyPointsControlState(input) {
8602
8615
  return {
8603
- visible: input.pointsEnabled === true,
8616
+ visible: autoApplyPointsControlVisible(input.pointsEnabled),
8604
8617
  checked: input.autoApplyPoints === true,
8605
8618
  disabled: input.subscriptionDisabled || input.writeInFlight
8606
8619
  };
@@ -8641,7 +8654,7 @@ function autoApplyPointsMembershipDrifted(input) {
8641
8654
  return [...input.resolvedTokens].sort().join("\0") !== [...expected].sort().join("\0");
8642
8655
  }
8643
8656
  //#endregion
8644
- //#region src/subscriptions/BundleFanOutDialog.tsx
8657
+ //#region ../../subscriptions/ui/src/components/AutoApplyPointsFanOutDialog.tsx
8645
8658
  /**
8646
8659
  * Asks whether a points opt-in applies to the whole renewal group.
8647
8660
  *
@@ -8652,9 +8665,8 @@ function autoApplyPointsMembershipDrifted(input) {
8652
8665
  * this gets a focus trap, escape-to-close and backdrop dismissal for free
8653
8666
  * rather than reimplementing dialog semantics by hand.
8654
8667
  */
8655
- function BundleFanOutDialog({ bundle, pointsLabel, nextValue, onConfirmAll, onConfirmOne, onCancel }) {
8668
+ function AutoApplyPointsFanOutDialog({ bundle, pointsLabel, nextValue, presentation = "dialog", onConfirmAll, onConfirmOne, onCancel }) {
8656
8669
  const { t } = useSubscriptionsTranslation();
8657
- const { isMobile } = useSidebar();
8658
8670
  return /* @__PURE__ */ jsxs(ResponsiveDialog, {
8659
8671
  open: true,
8660
8672
  onOpenChange: (next) => {
@@ -8662,7 +8674,7 @@ function BundleFanOutDialog({ bundle, pointsLabel, nextValue, onConfirmAll, onCo
8662
8674
  },
8663
8675
  title: t(nextValue ? "auto_apply_points_bundle_title" : "auto_apply_points_bundle_title_off", { label: pointsLabel }),
8664
8676
  description: t("auto_apply_points_bundle_body"),
8665
- presentation: isMobile ? "bottom-sheet" : "dialog",
8677
+ presentation,
8666
8678
  children: [/* @__PURE__ */ jsx("ul", {
8667
8679
  className: "space-y-1 text-sm",
8668
8680
  children: bundle.members.map((bundleMember) => /* @__PURE__ */ jsx("li", {
@@ -8692,19 +8704,26 @@ function BundleFanOutDialog({ bundle, pointsLabel, nextValue, onConfirmAll, onCo
8692
8704
  });
8693
8705
  }
8694
8706
  //#endregion
8695
- //#region src/subscriptions/PortalSubscriptionAutoApplyPointsSection.tsx
8707
+ //#region ../../subscriptions/ui/src/components/AutoApplyPointsSection.tsx
8696
8708
  /**
8697
8709
  * Lets a customer turn automatic points redemption on or off for one
8698
- * subscription. The switch reads the stored choice from the payload and writes
8699
- * through the subscription update the portal already owns, so an explicit
8700
- * "off" is a real write rather than a locally remembered preference.
8710
+ * subscription. The switch reads the stored choice from the payload and
8711
+ * writes it through, so an explicit "off" is a real write rather than a
8712
+ * locally remembered preference.
8713
+ *
8714
+ * Host-neutral. Everything the portal used to reach for directly, its store
8715
+ * label, its shell presentation and its query keys, arrives as a prop, so the
8716
+ * checkout renders the same control against its own cache and transport.
8717
+ *
8718
+ * Renders the row and nothing around it. Surrounding layout belongs to the
8719
+ * host, which knows how the row sits on its own screen; a host that draws a
8720
+ * frame should ask autoApplyPointsControlVisible first, because this renders
8721
+ * nothing for a company without a points program.
8701
8722
  */
8702
- function PortalSubscriptionAutoApplyPointsSection({ autoApplyPoints, pointsEnabled, subscriptionToken, disabled, renewalBundle, onSuccess, onError }) {
8723
+ function AutoApplyPointsSection({ autoApplyPoints, pointsEnabled, subscriptionToken, disabled, renewalBundle, pointsLabel, queryKeys, presentation = "dialog", onSuccess, onError }) {
8703
8724
  const { t } = useSubscriptionsTranslation();
8704
8725
  const labelId = useId();
8705
8726
  const queryClient = useQueryClient();
8706
- const { data: store } = useOptionalStore();
8707
- const pointsLabel = store?.reward_points_label_plural || "points";
8708
8727
  const latestSubscriptionTokenRef = useRef(subscriptionToken);
8709
8728
  latestSubscriptionTokenRef.current = subscriptionToken;
8710
8729
  const [pendingValue, setPendingValue] = useState(null);
@@ -8716,24 +8735,26 @@ function PortalSubscriptionAutoApplyPointsSection({ autoApplyPoints, pointsEnabl
8716
8735
  confirmedRef.current = false;
8717
8736
  }
8718
8737
  const updateSubscription = useUpdateSubscriptionInfo({
8738
+ skipAutoInvalidate: true,
8719
8739
  onSuccess: async ({ subscriptionToken: updatedSubscriptionToken, body }) => {
8720
- if (!isCurrentSubscriptionPaymentAttempt(latestSubscriptionTokenRef.current, updatedSubscriptionToken)) return;
8740
+ for (const listKey of queryKeys.lists) queryClient.invalidateQueries({ queryKey: listKey });
8721
8741
  await queryClient.refetchQueries({
8722
- queryKey: subscriptionsKeys.detail(updatedSubscriptionToken),
8742
+ queryKey: queryKeys.detail(updatedSubscriptionToken),
8723
8743
  exact: true
8724
8744
  });
8725
- if (!isCurrentSubscriptionPaymentAttempt(latestSubscriptionTokenRef.current, updatedSubscriptionToken)) return;
8726
- if (queryClient.getQueryData(subscriptionsKeys.detail(updatedSubscriptionToken))?.subscription.auto_apply_points !== body.auto_apply_points) {
8745
+ if (latestSubscriptionTokenRef.current !== updatedSubscriptionToken) return;
8746
+ if (queryClient.getQueryData(queryKeys.detail(updatedSubscriptionToken))?.subscription.auto_apply_points !== body.auto_apply_points) {
8727
8747
  onSuccess?.(t("auto_apply_points_saved_but_not_refreshed", { label: pointsLabel }), "warning");
8728
8748
  return;
8729
8749
  }
8730
8750
  onSuccess?.(t("auto_apply_points_updated", { label: pointsLabel }));
8731
8751
  },
8732
8752
  onError: (error, { subscriptionToken: failedSubscriptionToken }) => {
8733
- if (isCurrentSubscriptionPaymentAttempt(latestSubscriptionTokenRef.current, failedSubscriptionToken)) onError?.(t("failed_to_update_auto_apply_points", { label: pointsLabel }), error);
8753
+ if (latestSubscriptionTokenRef.current === failedSubscriptionToken) onError?.(t("failed_to_update_auto_apply_points", { label: pointsLabel }), error);
8734
8754
  }
8735
8755
  });
8736
8756
  const fanOut = useUpdateAutoApplyPoints({
8757
+ queryKeys,
8737
8758
  currentSubscriptionToken: subscriptionToken,
8738
8759
  onSuccess: ({ result, refreshed, variables }) => {
8739
8760
  if (autoApplyPointsMembershipDrifted({
@@ -8760,7 +8781,7 @@ function PortalSubscriptionAutoApplyPointsSection({ autoApplyPoints, pointsEnabl
8760
8781
  }
8761
8782
  });
8762
8783
  const detailRefetching = useIsFetching({
8763
- queryKey: subscriptionsKeys.detail(subscriptionToken),
8784
+ queryKey: queryKeys.detail(subscriptionToken),
8764
8785
  exact: true
8765
8786
  }) > 0;
8766
8787
  const control = autoApplyPointsControlState({
@@ -8804,31 +8825,58 @@ function PortalSubscriptionAutoApplyPointsSection({ autoApplyPoints, pointsEnabl
8804
8825
  });
8805
8826
  }
8806
8827
  if (!control.visible) return null;
8807
- return /* @__PURE__ */ jsxs("div", {
8828
+ return /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsxs("div", {
8829
+ className: "flex items-start justify-between gap-4",
8830
+ children: [/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("p", {
8831
+ id: labelId,
8832
+ className: "text-foreground text-sm font-medium",
8833
+ children: t("auto_apply_points_each_renewal", { label: pointsLabel })
8834
+ }), /* @__PURE__ */ jsx("p", {
8835
+ className: "text-muted-foreground mt-1 text-sm",
8836
+ children: t("auto_apply_points_partial_balance")
8837
+ })] }), /* @__PURE__ */ jsx(Switch, {
8838
+ "aria-labelledby": labelId,
8839
+ checked: control.checked,
8840
+ disabled: control.disabled,
8841
+ onCheckedChange: requestChange
8842
+ })]
8843
+ }), pendingValue !== null && renewalBundle ? /* @__PURE__ */ jsx(AutoApplyPointsFanOutDialog, {
8844
+ bundle: renewalBundle,
8845
+ pointsLabel,
8846
+ nextValue: pendingValue,
8847
+ presentation,
8848
+ onConfirmAll: () => confirm("bundle"),
8849
+ onConfirmOne: () => confirm("subscription"),
8850
+ onCancel: () => setPendingValue(null)
8851
+ }) : null] });
8852
+ }
8853
+ //#endregion
8854
+ //#region src/subscriptions/PortalSubscriptionAutoApplyPointsSection.tsx
8855
+ /**
8856
+ * The portal's binding for the auto-apply-points control.
8857
+ *
8858
+ * The control itself is host-neutral and lives in
8859
+ * @fluid-app/subscriptions-ui. Everything this file still does is portal:
8860
+ * resolving the store's points label, the shell's presentation, the portal's
8861
+ * own query keys, and the separator this row sits in on the detail screen.
8862
+ * Kept as a wrapper rather than a renamed re-export so its callers and their
8863
+ * tests carry on passing the props they always did.
8864
+ */
8865
+ function PortalSubscriptionAutoApplyPointsSection(props) {
8866
+ const { data: store } = useOptionalStore();
8867
+ const sidebar = useContext(SidebarContext);
8868
+ if (!autoApplyPointsControlVisible(props.pointsEnabled)) return null;
8869
+ return /* @__PURE__ */ jsx("div", {
8808
8870
  className: "border-border mb-6 border-b pb-4",
8809
- children: [/* @__PURE__ */ jsxs("div", {
8810
- className: "flex items-start justify-between gap-4",
8811
- children: [/* @__PURE__ */ jsxs("div", { children: [/* @__PURE__ */ jsx("p", {
8812
- id: labelId,
8813
- className: "text-foreground text-sm font-medium",
8814
- children: t("auto_apply_points_each_renewal", { label: pointsLabel })
8815
- }), /* @__PURE__ */ jsx("p", {
8816
- className: "text-muted-foreground mt-1 text-sm",
8817
- children: t("auto_apply_points_partial_balance")
8818
- })] }), /* @__PURE__ */ jsx(Switch, {
8819
- "aria-labelledby": labelId,
8820
- checked: control.checked,
8821
- disabled: control.disabled,
8822
- onCheckedChange: requestChange
8823
- })]
8824
- }), pendingValue !== null && renewalBundle ? /* @__PURE__ */ jsx(BundleFanOutDialog, {
8825
- bundle: renewalBundle,
8826
- pointsLabel,
8827
- nextValue: pendingValue,
8828
- onConfirmAll: () => confirm("bundle"),
8829
- onConfirmOne: () => confirm("subscription"),
8830
- onCancel: () => setPendingValue(null)
8831
- }) : null]
8871
+ children: /* @__PURE__ */ jsx(AutoApplyPointsSection, {
8872
+ ...props,
8873
+ pointsLabel: store?.reward_points_label_plural || "points",
8874
+ presentation: sidebar?.isMobile ? "bottom-sheet" : "dialog",
8875
+ queryKeys: {
8876
+ detail: subscriptionsKeys.detail,
8877
+ lists: [subscriptionsKeys.lists, subscriptionsKeys.infiniteLists]
8878
+ }
8879
+ })
8832
8880
  });
8833
8881
  }
8834
8882
  //#endregion
@@ -9031,4 +9079,4 @@ const subscriptionsScreenPropertySchema = {
9031
9079
  //#endregion
9032
9080
  export { subscriptionsScreenPropertySchema as n, SubscriptionsScreen as t };
9033
9081
 
9034
- //# sourceMappingURL=SubscriptionsScreen-CdDBKpkc.mjs.map
9082
+ //# sourceMappingURL=SubscriptionsScreen-DBYCi-c3.mjs.map