@fluid-app/portal-sdk 0.1.521 → 0.1.523

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 (50) hide show
  1. package/dist/{FluidProvider-1RcvRveh.cjs → FluidProvider-Ch_tyk-O.cjs} +3 -2
  2. package/dist/{FluidProvider-1RcvRveh.cjs.map → FluidProvider-Ch_tyk-O.cjs.map} +1 -1
  3. package/dist/{FluidProvider-D4NciHuM.mjs → FluidProvider-xCT9m0AV.mjs} +3 -2
  4. package/dist/{FluidProvider-D4NciHuM.mjs.map → FluidProvider-xCT9m0AV.mjs.map} +1 -1
  5. package/dist/{MessagingScreen-D3rPEhKs.mjs → MessagingScreen-BLeMJBlZ.mjs} +3 -3
  6. package/dist/{MessagingScreen-D8KHP1Ve.cjs → MessagingScreen-CsXm0cqp.cjs} +2 -2
  7. package/dist/{MessagingScreen-D8KHP1Ve.cjs.map → MessagingScreen-CsXm0cqp.cjs.map} +1 -1
  8. package/dist/{MessagingScreen-CODydTyP.mjs → MessagingScreen-Cx1HMX4z.mjs} +2 -2
  9. package/dist/{MessagingScreen-CODydTyP.mjs.map → MessagingScreen-Cx1HMX4z.mjs.map} +1 -1
  10. package/dist/{MessagingScreen-C4ODci0C.cjs → MessagingScreen-jDXAQrjW.cjs} +3 -3
  11. package/dist/{OrdersScreen-DLWgsnr_.mjs → OrdersScreen-C2qOTfFC.mjs} +3 -3
  12. package/dist/{OrdersScreen-DLWgsnr_.mjs.map → OrdersScreen-C2qOTfFC.mjs.map} +1 -1
  13. package/dist/{OrdersScreen-BVyouyIY.cjs → OrdersScreen-DR_Aiyui.cjs} +3 -3
  14. package/dist/{OrdersScreen-BVyouyIY.cjs.map → OrdersScreen-DR_Aiyui.cjs.map} +1 -1
  15. package/dist/{OrdersScreen-wMSTv3GN.mjs → OrdersScreen-DXDqL5ec.mjs} +3 -3
  16. package/dist/{OrdersScreen-DcwIkATf.cjs → OrdersScreen-RdIKrkWk.cjs} +3 -3
  17. package/dist/{ProfileScreen-D3eX2UyZ.mjs → ProfileScreen-5xAu0suR.mjs} +3 -3
  18. package/dist/{ProfileScreen-D3eX2UyZ.mjs.map → ProfileScreen-5xAu0suR.mjs.map} +1 -1
  19. package/dist/{ProfileScreen-D_dXM5FI.mjs → ProfileScreen-C5i0U4Cg.mjs} +4 -4
  20. package/dist/{ProfileScreen-B8xddobu.cjs → ProfileScreen-CVjKS2Tx.cjs} +3 -3
  21. package/dist/{ProfileScreen-B8xddobu.cjs.map → ProfileScreen-CVjKS2Tx.cjs.map} +1 -1
  22. package/dist/{ProfileScreen-BHDUQ45N.cjs → ProfileScreen-Ct1eY-TI.cjs} +4 -4
  23. package/dist/{SubscriptionsScreen-Dm_1xjOv.cjs → SubscriptionsScreen-BXBojuLi.cjs} +4 -4
  24. package/dist/{SubscriptionsScreen-Bm9yALAj.mjs → SubscriptionsScreen-C_Wt4-wY.mjs} +107 -43
  25. package/dist/SubscriptionsScreen-C_Wt4-wY.mjs.map +1 -0
  26. package/dist/{SubscriptionsScreen-m4rM6RFP.mjs → SubscriptionsScreen-CqLyS0HD.mjs} +4 -4
  27. package/dist/{SubscriptionsScreen-pod3ogsE.cjs → SubscriptionsScreen-DCDoF2c3.cjs} +107 -43
  28. package/dist/SubscriptionsScreen-DCDoF2c3.cjs.map +1 -0
  29. package/dist/build-widget-registry-C4vaFR1S.d.mts.map +1 -1
  30. package/dist/build-widget-registry-C7BPrtGS.d.cts.map +1 -1
  31. package/dist/{build-widget-registry-EXxP6gv1.mjs → build-widget-registry-DgPaypsV.mjs} +2 -1
  32. package/dist/{build-widget-registry-EXxP6gv1.mjs.map → build-widget-registry-DgPaypsV.mjs.map} +1 -1
  33. package/dist/{build-widget-registry-By1GKqAd.cjs → build-widget-registry-iHNtigmM.cjs} +2 -1
  34. package/dist/{build-widget-registry-By1GKqAd.cjs.map → build-widget-registry-iHNtigmM.cjs.map} +1 -1
  35. package/dist/index.cjs +17 -15
  36. package/dist/index.cjs.map +1 -1
  37. package/dist/index.mjs +18 -16
  38. package/dist/index.mjs.map +1 -1
  39. package/dist/styles/remote-widget-shadow.css +2 -2
  40. package/dist/{use-portal-card-add-3ds-flow-CjQi2W_2.cjs → use-portal-card-add-3ds-flow-BK7rp-NL.cjs} +3 -3
  41. package/dist/{use-portal-card-add-3ds-flow-CjQi2W_2.cjs.map → use-portal-card-add-3ds-flow-BK7rp-NL.cjs.map} +1 -1
  42. package/dist/{use-portal-card-add-3ds-flow-B3pU5kcB.mjs → use-portal-card-add-3ds-flow-DEPhZhOv.mjs} +3 -3
  43. package/dist/{use-portal-card-add-3ds-flow-B3pU5kcB.mjs.map → use-portal-card-add-3ds-flow-DEPhZhOv.mjs.map} +1 -1
  44. package/dist/utils/build-remote-widget-plugin-manifests.cjs +1 -1
  45. package/dist/utils/build-remote-widget-plugin-manifests.mjs +1 -1
  46. package/dist/utils/build-widget-registry.cjs +1 -1
  47. package/dist/utils/build-widget-registry.mjs +1 -1
  48. package/package.json +13 -13
  49. package/dist/SubscriptionsScreen-Bm9yALAj.mjs.map +0 -1
  50. package/dist/SubscriptionsScreen-pod3ogsE.cjs.map +0 -1
@@ -1,11 +1,11 @@
1
1
  import "./src-BfINy9nC.mjs";
2
- import "./build-widget-registry-EXxP6gv1.mjs";
2
+ import "./build-widget-registry-DgPaypsV.mjs";
3
3
  import "./ScreenRenderer-saqQPGx2.mjs";
4
4
  import "./account-api-context-8vg35E7d.mjs";
5
5
  import "./use-optional-store-DpB_jK4Q.mjs";
6
6
  import "./use-mysite-portal-BlOgU7cc.mjs";
7
7
  import "./Combobox-D8ukt9Tb.mjs";
8
- import "./FluidProvider-D4NciHuM.mjs";
8
+ import "./FluidProvider-xCT9m0AV.mjs";
9
9
  import "./ContactsTranslationBridge-7hUvizHe.mjs";
10
10
  import "./prop-types-CwLyDfek.mjs";
11
11
  import "./MobileBottomSheet-BKm3ysnd.mjs";
@@ -33,7 +33,7 @@ import "./BulletListWidget-DvYksMFr.mjs";
33
33
  import "./preview-context-BWmZf_Qw.mjs";
34
34
  import "./CalendarWidget-XcCCAFsM.mjs";
35
35
  import "./error-state-Vy3ZKhKa.mjs";
36
- import { n as subscriptionsScreenPropertySchema, t as SubscriptionsScreen } from "./SubscriptionsScreen-Bm9yALAj.mjs";
36
+ import { n as subscriptionsScreenPropertySchema, t as SubscriptionsScreen } from "./SubscriptionsScreen-C_Wt4-wY.mjs";
37
37
  import "./WidgetLoadingSkeleton-VmD6A-rW.mjs";
38
38
  import "./CardWidget-BeTseq2w.mjs";
39
39
  import "./helpers-BmP1pE-e.mjs";
@@ -67,5 +67,5 @@ import "./translation-adapter-CGda4ZmZ.mjs";
67
67
  import "./translation-adapter-B735scDI.mjs";
68
68
  import "./sidebar-CQpJWKMc.mjs";
69
69
  import "./ScreenHeaderContext-DahYFA_m.mjs";
70
- import "./use-portal-card-add-3ds-flow-B3pU5kcB.mjs";
70
+ import "./use-portal-card-add-3ds-flow-DEPhZhOv.mjs";
71
71
  export { SubscriptionsScreen, subscriptionsScreenPropertySchema };
@@ -1,8 +1,8 @@
1
1
  require("./chunk-9hOWP6kD.cjs");
2
- const require_build_widget_registry = require("./build-widget-registry-By1GKqAd.cjs");
2
+ const require_build_widget_registry = require("./build-widget-registry-iHNtigmM.cjs");
3
3
  const require_use_optional_store = require("./use-optional-store-CIM4spDu.cjs");
4
4
  const require_Combobox = require("./Combobox-CReJLJfk.cjs");
5
- const require_FluidProvider = require("./FluidProvider-1RcvRveh.cjs");
5
+ const require_FluidProvider = require("./FluidProvider-Ch_tyk-O.cjs");
6
6
  const require_fetch_client = require("./fetch-client-wO-vh6_f.cjs");
7
7
  const require_ContactsTranslationBridge = require("./ContactsTranslationBridge-MTW9WS-j.cjs");
8
8
  const require_prop_types = require("./prop-types-B7bFaw8n.cjs");
@@ -17,7 +17,7 @@ const require_AppNavigationContext = require("./AppNavigationContext-C6FeqL-k.cj
17
17
  const require_use_store = require("./use-store-CZPKdvkG.cjs");
18
18
  const require_sidebar = require("./sidebar-zkV-HxHW.cjs");
19
19
  const require_ScreenHeaderContext = require("./ScreenHeaderContext-Df1DvpEW.cjs");
20
- const require_use_portal_card_add_3ds_flow = require("./use-portal-card-add-3ds-flow-CjQi2W_2.cjs");
20
+ const require_use_portal_card_add_3ds_flow = require("./use-portal-card-add-3ds-flow-BK7rp-NL.cjs");
21
21
  const require_isAfter = require("./isAfter-DvjGDS5r.cjs");
22
22
  let react = require("react");
23
23
  let _tanstack_react_query = require("@tanstack/react-query");
@@ -8649,14 +8649,22 @@ function useUpdateAutoApplyPoints({ queryKeys, currentSubscriptionToken, onSucce
8649
8649
  * this component renders: the host owns the surrounding layout, so it has to
8650
8650
  * know whether to draw the frame rather than leaving an empty one behind.
8651
8651
  *
8652
- * An absent `pointsEnabled` counts as off rather than on. The field is
8653
- * additive, so an older payload, or a read path that quietly drops it, must
8654
- * hide a setting that could not act instead of offering it.
8652
+ * Two ways a control cannot act, and both hide it:
8653
+ *
8654
+ * - An absent `pointsEnabled` counts as off rather than on. The field is
8655
+ * additive, so an older payload, or a read path that quietly drops it, must
8656
+ * hide a setting that could not act instead of offering it.
8657
+ * - A payload with no renewal bundle can only be written through the host's
8658
+ * fallback writer, because the bundle-aware port needs a scope and both
8659
+ * token arrays and such a server sends neither. A host that supplies no
8660
+ * fallback writer therefore has no way to honour a toggle, so offering one
8661
+ * would take a customer's choice and drop it.
8655
8662
  *
8656
8663
  * Returns true when the control should render.
8657
8664
  */
8658
- function autoApplyPointsControlVisible(pointsEnabled) {
8659
- return pointsEnabled === true;
8665
+ function autoApplyPointsControlVisible(input) {
8666
+ if (input.pointsEnabled !== true) return false;
8667
+ return input.renewalBundle != null || input.hasFallbackWrite;
8660
8668
  }
8661
8669
  /**
8662
8670
  * Resolve what the auto-apply-points switch shows, from server state alone.
@@ -8675,7 +8683,11 @@ function autoApplyPointsControlVisible(pointsEnabled) {
8675
8683
  */
8676
8684
  function autoApplyPointsControlState(input) {
8677
8685
  return {
8678
- visible: autoApplyPointsControlVisible(input.pointsEnabled),
8686
+ visible: autoApplyPointsControlVisible({
8687
+ pointsEnabled: input.pointsEnabled,
8688
+ renewalBundle: input.renewalBundle,
8689
+ hasFallbackWrite: input.hasFallbackWrite
8690
+ }),
8679
8691
  checked: input.autoApplyPoints === true,
8680
8692
  disabled: input.subscriptionDisabled || input.writeInFlight
8681
8693
  };
@@ -8715,6 +8727,32 @@ function autoApplyPointsMembershipDrifted(input) {
8715
8727
  const expected = input.confirmedScope === "bundle" ? input.renderedTokens : [input.targetToken];
8716
8728
  return [...input.resolvedTokens].sort().join("\0") !== [...expected].sort().join("\0");
8717
8729
  }
8730
+ /**
8731
+ * Whether choosing "just this one" would leave the renewal group disagreeing.
8732
+ *
8733
+ * The consequence copy in the fan-out dialog is asserted to a customer, so it
8734
+ * is rendered only when it is true of the choice in front of them. Three ways
8735
+ * this goes wrong if derived loosely:
8736
+ *
8737
+ * - A single-record change can REUNIFY a mixed group rather than split it.
8738
+ * The target being the only opted-out member of an otherwise opted-in
8739
+ * bundle is the case: turning it on leaves every member agreeing, so
8740
+ * claiming a split there describes the opposite of what happens (AC-21).
8741
+ * - `auto_apply_points_state` alone cannot answer it. A "mixed" bundle can
8742
+ * end up unanimous and an "all" bundle can end up mixed, and which one
8743
+ * depends on the value being written and on which member is the target.
8744
+ * - A bundle-scoped write moves every member to the same value, so it can
8745
+ * never partition the group.
8746
+ *
8747
+ * Returns true when the members would hold different values afterwards.
8748
+ */
8749
+ function autoApplyPointsSplitsRenewal(input) {
8750
+ if (input.scope === "bundle") return false;
8751
+ const members = input.renewalBundle?.members ?? [];
8752
+ if (members.length < 2) return false;
8753
+ const after = members.map((member) => member.subscription_token === input.targetToken ? input.nextValue : member.auto_apply_points);
8754
+ return after.some((value) => value !== after[0]);
8755
+ }
8718
8756
  //#endregion
8719
8757
  //#region ../../subscriptions/ui/src/components/AutoApplyPointsFanOutDialog.tsx
8720
8758
  /**
@@ -8727,8 +8765,14 @@ function autoApplyPointsMembershipDrifted(input) {
8727
8765
  * this gets a focus trap, escape-to-close and backdrop dismissal for free
8728
8766
  * rather than reimplementing dialog semantics by hand.
8729
8767
  */
8730
- function AutoApplyPointsFanOutDialog({ bundle, pointsLabel, nextValue, presentation = "dialog", onConfirmAll, onConfirmOne, onCancel }) {
8768
+ function AutoApplyPointsFanOutDialog({ bundle, pointsLabel, targetToken, nextValue, presentation = "dialog", onConfirmAll, onConfirmOne, onCancel }) {
8731
8769
  const { t } = useSubscriptionsTranslation();
8770
+ const wouldSplit = autoApplyPointsSplitsRenewal({
8771
+ renewalBundle: bundle,
8772
+ targetToken,
8773
+ nextValue,
8774
+ scope: "subscription"
8775
+ });
8732
8776
  return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_ResponsiveDialog.ResponsiveDialog, {
8733
8777
  open: true,
8734
8778
  onOpenChange: (next) => {
@@ -8737,32 +8781,39 @@ function AutoApplyPointsFanOutDialog({ bundle, pointsLabel, nextValue, presentat
8737
8781
  title: t(nextValue ? "auto_apply_points_bundle_title" : "auto_apply_points_bundle_title_off", { label: pointsLabel }),
8738
8782
  description: t("auto_apply_points_bundle_body"),
8739
8783
  presentation,
8740
- children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", {
8741
- className: "space-y-1 text-sm",
8742
- children: bundle.members.map((bundleMember) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", {
8743
- className: "text-foreground",
8744
- children: bundleMember.status === "paused" ? t("auto_apply_points_bundle_member_paused", { name: bundleMember.label }) : bundleMember.label
8745
- }, bundleMember.subscription_token))
8746
- }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.DialogFooter, { children: [
8747
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Button, {
8748
- type: "button",
8749
- className: "bg-muted text-foreground ring-border hover:bg-muted/80 h-10 min-w-[70px] rounded p-3 ring-1",
8750
- onClick: onCancel,
8751
- children: t("auto_apply_points_bundle_cancel")
8752
- }),
8753
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Button, {
8754
- type: "button",
8755
- className: "bg-muted text-foreground ring-border hover:bg-muted/80 h-10 min-w-[70px] rounded p-3 ring-1",
8756
- onClick: onConfirmOne,
8757
- children: t("auto_apply_points_bundle_confirm_one")
8784
+ children: [
8785
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)("ul", {
8786
+ className: "space-y-1 text-sm",
8787
+ children: bundle.members.map((bundleMember) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", {
8788
+ className: "text-foreground",
8789
+ children: bundleMember.status === "paused" ? t("auto_apply_points_bundle_member_paused", { name: bundleMember.label }) : bundleMember.label
8790
+ }, bundleMember.subscription_token))
8758
8791
  }),
8759
- /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Button, {
8760
- type: "button",
8761
- className: "bg-primary text-primary-foreground h-10 min-w-[70px] rounded p-3 hover:opacity-90",
8762
- onClick: onConfirmAll,
8763
- children: t(nextValue ? "auto_apply_points_bundle_confirm_all" : "auto_apply_points_bundle_confirm_all_off")
8764
- })
8765
- ] })]
8792
+ wouldSplit ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("p", {
8793
+ className: "text-muted-foreground mt-3 text-sm",
8794
+ children: t("auto_apply_points_bundle_split_warning")
8795
+ }) : null,
8796
+ /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_src.DialogFooter, { children: [
8797
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Button, {
8798
+ type: "button",
8799
+ className: "bg-muted text-foreground ring-border hover:bg-muted/80 h-10 min-w-[70px] rounded p-3 ring-1",
8800
+ onClick: onCancel,
8801
+ children: t("auto_apply_points_bundle_cancel")
8802
+ }),
8803
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Button, {
8804
+ type: "button",
8805
+ className: "bg-muted text-foreground ring-border hover:bg-muted/80 h-10 min-w-[70px] rounded p-3 ring-1",
8806
+ onClick: onConfirmOne,
8807
+ children: t("auto_apply_points_bundle_confirm_one")
8808
+ }),
8809
+ /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_src.Button, {
8810
+ type: "button",
8811
+ className: "bg-primary text-primary-foreground h-10 min-w-[70px] rounded p-3 hover:opacity-90",
8812
+ onClick: onConfirmAll,
8813
+ children: t(nextValue ? "auto_apply_points_bundle_confirm_all" : "auto_apply_points_bundle_confirm_all_off")
8814
+ })
8815
+ ] })
8816
+ ]
8766
8817
  });
8767
8818
  }
8768
8819
  //#endregion
@@ -8782,7 +8833,7 @@ function AutoApplyPointsFanOutDialog({ bundle, pointsLabel, nextValue, presentat
8782
8833
  * frame should ask autoApplyPointsControlVisible first, because this renders
8783
8834
  * nothing for a company without a points program.
8784
8835
  */
8785
- function AutoApplyPointsSection({ autoApplyPoints, pointsEnabled, subscriptionToken, disabled, renewalBundle, pointsLabel, queryKeys, presentation = "dialog", onSuccess, onError }) {
8836
+ function AutoApplyPointsSection({ autoApplyPoints, pointsEnabled, subscriptionToken, disabled, renewalBundle, pointsLabel, queryKeys, presentation = "dialog", fallbackWrite, onSuccess, onError }) {
8786
8837
  const { t } = useSubscriptionsTranslation();
8787
8838
  const labelId = (0, react.useId)();
8788
8839
  const queryClient = (0, _tanstack_react_query.useQueryClient)();
@@ -8796,16 +8847,19 @@ function AutoApplyPointsSection({ autoApplyPoints, pointsEnabled, subscriptionTo
8796
8847
  setPendingValue(null);
8797
8848
  confirmedRef.current = false;
8798
8849
  }
8799
- const updateSubscription = useUpdateSubscriptionInfo({
8800
- skipAutoInvalidate: true,
8801
- onSuccess: async ({ subscriptionToken: updatedSubscriptionToken, body }) => {
8850
+ const updateSubscription = (0, _tanstack_react_query.useMutation)({
8851
+ mutationFn: (variables) => {
8852
+ if (!fallbackWrite) return Promise.reject(/* @__PURE__ */ new Error("auto-apply-points: no fallbackWrite supplied for a payload without a renewal bundle"));
8853
+ return fallbackWrite(variables);
8854
+ },
8855
+ onSuccess: async (_written, { subscriptionToken: updatedSubscriptionToken, autoApplyPoints: writtenValue }) => {
8802
8856
  for (const listKey of queryKeys.lists) queryClient.invalidateQueries({ queryKey: listKey });
8803
8857
  await queryClient.refetchQueries({
8804
8858
  queryKey: queryKeys.detail(updatedSubscriptionToken),
8805
8859
  exact: true
8806
8860
  });
8807
8861
  if (latestSubscriptionTokenRef.current !== updatedSubscriptionToken) return;
8808
- if (queryClient.getQueryData(queryKeys.detail(updatedSubscriptionToken))?.subscription.auto_apply_points !== body.auto_apply_points) {
8862
+ if (queryClient.getQueryData(queryKeys.detail(updatedSubscriptionToken))?.subscription.auto_apply_points !== writtenValue) {
8809
8863
  onSuccess?.(t("auto_apply_points_saved_but_not_refreshed", { label: pointsLabel }), "warning");
8810
8864
  return;
8811
8865
  }
@@ -8849,6 +8903,8 @@ function AutoApplyPointsSection({ autoApplyPoints, pointsEnabled, subscriptionTo
8849
8903
  const control = autoApplyPointsControlState({
8850
8904
  autoApplyPoints,
8851
8905
  pointsEnabled,
8906
+ renewalBundle,
8907
+ hasFallbackWrite: fallbackWrite != null,
8852
8908
  subscriptionDisabled: disabled,
8853
8909
  writeInFlight: updateSubscription.isPending && updateSubscription.variables?.subscriptionToken === subscriptionToken || fanOut.isPending && (fanOut.variables?.subscriptionToken === subscriptionToken || fanOut.variables?.bundleTokens?.includes(subscriptionToken)) || detailRefetching
8854
8910
  });
@@ -8857,7 +8913,7 @@ function AutoApplyPointsSection({ autoApplyPoints, pointsEnabled, subscriptionTo
8857
8913
  if (route === "fallback") {
8858
8914
  updateSubscription.mutate({
8859
8915
  subscriptionToken,
8860
- body: { auto_apply_points: next }
8916
+ autoApplyPoints: next
8861
8917
  });
8862
8918
  return;
8863
8919
  }
@@ -8905,6 +8961,7 @@ function AutoApplyPointsSection({ autoApplyPoints, pointsEnabled, subscriptionTo
8905
8961
  }), pendingValue !== null && renewalBundle ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AutoApplyPointsFanOutDialog, {
8906
8962
  bundle: renewalBundle,
8907
8963
  pointsLabel,
8964
+ targetToken: subscriptionToken,
8908
8965
  nextValue: pendingValue,
8909
8966
  presentation,
8910
8967
  onConfirmAll: () => confirm("bundle"),
@@ -8927,13 +8984,20 @@ function AutoApplyPointsSection({ autoApplyPoints, pointsEnabled, subscriptionTo
8927
8984
  function PortalSubscriptionAutoApplyPointsSection(props) {
8928
8985
  const { data: store } = require_use_optional_store.useOptionalStore();
8929
8986
  const sidebar = (0, react.useContext)(require_sidebar.SidebarContext);
8930
- if (!autoApplyPointsControlVisible(props.pointsEnabled)) return null;
8987
+ const api = useSubscriptionsApi();
8988
+ const fallbackWrite = (0, react.useCallback)(({ subscriptionToken, autoApplyPoints }) => api.updateSubscriptionInfo(subscriptionToken, { auto_apply_points: autoApplyPoints }), [api]);
8989
+ if (!autoApplyPointsControlVisible({
8990
+ pointsEnabled: props.pointsEnabled,
8991
+ renewalBundle: props.renewalBundle,
8992
+ hasFallbackWrite: true
8993
+ })) return null;
8931
8994
  return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
8932
8995
  className: "border-border mb-6 border-b pb-4",
8933
8996
  children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(AutoApplyPointsSection, {
8934
8997
  ...props,
8935
8998
  pointsLabel: store?.reward_points_label_plural || "points",
8936
8999
  presentation: sidebar?.isMobile ? "bottom-sheet" : "dialog",
9000
+ fallbackWrite,
8937
9001
  queryKeys: {
8938
9002
  detail: subscriptionsKeys.detail,
8939
9003
  lists: [subscriptionsKeys.lists, subscriptionsKeys.infiniteLists]
@@ -9152,4 +9216,4 @@ Object.defineProperty(exports, "subscriptionsScreenPropertySchema", {
9152
9216
  }
9153
9217
  });
9154
9218
 
9155
- //# sourceMappingURL=SubscriptionsScreen-pod3ogsE.cjs.map
9219
+ //# sourceMappingURL=SubscriptionsScreen-DCDoF2c3.cjs.map