@bpinternal/billing-ui 0.14.2 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -3,7 +3,7 @@ var bo = Object.defineProperty;
3
3
  var fo = (t, e, a) => e in t ? bo(t, e, { enumerable: !0, configurable: !0, writable: !0, value: a }) : t[e] = a;
4
4
  var or = (t, e, a) => fo(t, typeof e != "symbol" ? e + "" : e, a);
5
5
  import { jsx as l, jsxs as p, Fragment as Te } from "react/jsx-runtime";
6
- import { QueryClient as yo, hydrate as vo, dehydrate as _o, useQuery as $e, useMutation as Jt } from "@tanstack/react-query";
6
+ import { QueryClient as yo, hydrate as vo, dehydrate as _o, useQuery as Ve, useMutation as Jt } from "@tanstack/react-query";
7
7
  import { createElement as bt, isValidElement as Va, Fragment as No, cloneElement as Co, Children as So, createContext as qr, useContext as Ta, useCallback as It, useState as J, useRef as rn, useEffect as Oe, useMemo as Re, useSyncExternalStore as ko, useId as wo } from "react";
8
8
  import { loadStripe as To } from "@stripe/stripe-js";
9
9
  import { createPortal as Io } from "react-dom";
@@ -905,10 +905,10 @@ class Ha extends sn {
905
905
  W && W.res && this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.");
906
906
  }
907
907
  let B = [];
908
- const x = this.languageUtils.getFallbackCodes(this.options.fallbackLng, a.lng || this.language);
909
- if (this.options.saveMissingTo === "fallback" && x && x[0])
910
- for (let W = 0; W < x.length; W++)
911
- B.push(x[W]);
908
+ const P = this.languageUtils.getFallbackCodes(this.options.fallbackLng, a.lng || this.language);
909
+ if (this.options.saveMissingTo === "fallback" && P && P[0])
910
+ for (let W = 0; W < P.length; W++)
911
+ B.push(P[W]);
912
912
  else this.options.saveMissingTo === "all" ? B = this.languageUtils.toResolveHierarchy(a.lng || this.language) : B.push(a.lng || this.language);
913
913
  const H = (W, X, D) => {
914
914
  const ue = A && D !== h ? D : V;
@@ -3501,7 +3501,7 @@ const $c = ({
3501
3501
  }
3502
3502
  ) }) });
3503
3503
  };
3504
- function re() {
3504
+ function ne() {
3505
3505
  const t = Ta(on);
3506
3506
  if (!t)
3507
3507
  throw new Error("@bpinternal/billing-ui components must be rendered inside <BillingProvider>");
@@ -3542,7 +3542,7 @@ const we = {
3542
3542
  function Ri(t) {
3543
3543
  return typeof t == "object" && t !== null && t.code === 403;
3544
3544
  }
3545
- const Ae = {
3545
+ const Ie = {
3546
3546
  /** Everything for one workspace — use to invalidate/clear the whole scope. */
3547
3547
  root: (t) => ["bpb", t],
3548
3548
  plans: (t) => ["bpb", t, "plans"],
@@ -3559,18 +3559,18 @@ const Ae = {
3559
3559
  usageByBot: (t, e, a) => ["bpb", t, "usage-by-bot", e, a]
3560
3560
  };
3561
3561
  function rt() {
3562
- const { client: t, queryClient: e, scope: a } = re();
3563
- return $e({ queryKey: Ae.plans(a), queryFn: () => t.listPlans({}) }, e);
3562
+ const { client: t, queryClient: e, scope: a } = ne();
3563
+ return Ve({ queryKey: Ie.plans(a), queryFn: () => t.listPlans({}) }, e);
3564
3564
  }
3565
3565
  function Qt() {
3566
- const { client: t, queryClient: e, scope: a } = re();
3567
- return $e({ queryKey: Ae.addons(a), queryFn: () => t.listAddons({}) }, e);
3566
+ const { client: t, queryClient: e, scope: a } = ne();
3567
+ return Ve({ queryKey: Ie.addons(a), queryFn: () => t.listAddons({}) }, e);
3568
3568
  }
3569
- function Ve(t) {
3570
- const { client: e, queryClient: a, scope: n, refetchInterval: r } = re();
3571
- return $e(
3569
+ function $e(t) {
3570
+ const { client: e, queryClient: a, scope: n, refetchInterval: r } = ne();
3571
+ return Ve(
3572
3572
  {
3573
- queryKey: Ae.subscription(n),
3573
+ queryKey: Ie.subscription(n),
3574
3574
  queryFn: () => e.getSubscription({}),
3575
3575
  enabled: (t == null ? void 0 : t.enabled) ?? !0,
3576
3576
  refetchInterval: r
@@ -3579,14 +3579,21 @@ function Ve(t) {
3579
3579
  );
3580
3580
  }
3581
3581
  function Hc() {
3582
- const { data: t, error: e } = Ve();
3583
- return e ? Ri(e) ? !1 : e : t ? !0 : void 0;
3582
+ const { client: t, queryClient: e, scope: a } = ne(), { data: n, error: r } = Ve(
3583
+ {
3584
+ queryKey: Ie.subscription(a),
3585
+ queryFn: () => t.getSubscription({}),
3586
+ refetchInterval: !1
3587
+ },
3588
+ e
3589
+ );
3590
+ return r ? Ri(r) ? !1 : r : n ? !0 : void 0;
3584
3591
  }
3585
3592
  function ns(t, e) {
3586
- const { client: a, queryClient: n, scope: r } = re();
3587
- return $e(
3593
+ const { client: a, queryClient: n, scope: r } = ne();
3594
+ return Ve(
3588
3595
  {
3589
- queryKey: Ae.preview(r, t),
3596
+ queryKey: Ie.preview(r, t),
3590
3597
  queryFn: () => a.previewSubscriptionUpdate(t),
3591
3598
  enabled: (e == null ? void 0 : e.enabled) ?? !0
3592
3599
  },
@@ -3594,10 +3601,10 @@ function ns(t, e) {
3594
3601
  );
3595
3602
  }
3596
3603
  function rs(t) {
3597
- const { client: e, queryClient: a, scope: n } = re();
3598
- return $e(
3604
+ const { client: e, queryClient: a, scope: n } = ne();
3605
+ return Ve(
3599
3606
  {
3600
- queryKey: Ae.paymentMethod(n),
3607
+ queryKey: Ie.paymentMethod(n),
3601
3608
  queryFn: () => e.getPaymentMethod({}),
3602
3609
  enabled: (t == null ? void 0 : t.enabled) ?? !0
3603
3610
  },
@@ -3605,10 +3612,10 @@ function rs(t) {
3605
3612
  );
3606
3613
  }
3607
3614
  function ss(t) {
3608
- const { client: e, queryClient: a, scope: n } = re();
3609
- return $e(
3615
+ const { client: e, queryClient: a, scope: n } = ne();
3616
+ return Ve(
3610
3617
  {
3611
- queryKey: Ae.customer(n),
3618
+ queryKey: Ie.customer(n),
3612
3619
  queryFn: () => e.getCustomer({}),
3613
3620
  enabled: (t == null ? void 0 : t.enabled) ?? !0
3614
3621
  },
@@ -3616,10 +3623,10 @@ function ss(t) {
3616
3623
  );
3617
3624
  }
3618
3625
  function Ei(t) {
3619
- const { client: e, queryClient: a, scope: n, refetchInterval: r } = re();
3620
- return $e(
3626
+ const { client: e, queryClient: a, scope: n, refetchInterval: r } = ne();
3627
+ return Ve(
3621
3628
  {
3622
- queryKey: Ae.invoices(n),
3629
+ queryKey: Ie.invoices(n),
3623
3630
  queryFn: () => e.listInvoices({}),
3624
3631
  enabled: (t == null ? void 0 : t.enabled) ?? !0,
3625
3632
  refetchInterval: r
@@ -3628,10 +3635,10 @@ function Ei(t) {
3628
3635
  );
3629
3636
  }
3630
3637
  function os(t) {
3631
- const { client: e, queryClient: a, scope: n } = re();
3632
- return $e(
3638
+ const { client: e, queryClient: a, scope: n } = ne();
3639
+ return Ve(
3633
3640
  {
3634
- queryKey: Ae.readonly(n),
3641
+ queryKey: Ie.readonly(n),
3635
3642
  queryFn: () => e.getBillingReadonly({}),
3636
3643
  enabled: (t == null ? void 0 : t.enabled) ?? !0
3637
3644
  },
@@ -3639,10 +3646,10 @@ function os(t) {
3639
3646
  );
3640
3647
  }
3641
3648
  function is(t) {
3642
- const { client: e, queryClient: a, scope: n } = re();
3643
- return $e(
3649
+ const { client: e, queryClient: a, scope: n } = ne();
3650
+ return Ve(
3644
3651
  {
3645
- queryKey: Ae.autoRecharge(n),
3652
+ queryKey: Ie.autoRecharge(n),
3646
3653
  queryFn: () => e.getAutoRechargeSettings({}).then((r) => r.settings),
3647
3654
  enabled: (t == null ? void 0 : t.enabled) ?? !0
3648
3655
  },
@@ -3650,22 +3657,22 @@ function is(t) {
3650
3657
  );
3651
3658
  }
3652
3659
  function Li() {
3653
- const { client: t, queryClient: e, scope: a, notifyBillingChange: n } = re();
3660
+ const { client: t, queryClient: e, scope: a, notifyBillingChange: n } = ne();
3654
3661
  return Jt(
3655
3662
  {
3656
3663
  mutationFn: (r) => t.setAutoRechargeSettings(r).then((s) => s.settings),
3657
3664
  onSuccess: async (r) => {
3658
- e.setQueryData(Ae.autoRecharge(a), r), n({ type: "auto-recharge" });
3665
+ e.setQueryData(Ie.autoRecharge(a), r), n({ type: "auto-recharge" });
3659
3666
  }
3660
3667
  },
3661
3668
  e
3662
3669
  );
3663
3670
  }
3664
3671
  function Xt(t) {
3665
- const { client: e, queryClient: a, scope: n, refetchInterval: r } = re(), s = t != null && t.period ? new Date(t.period) : /* @__PURE__ */ new Date(), o = `${s.getUTCFullYear()}-${String(s.getUTCMonth() + 1).padStart(2, "0")}`;
3666
- return $e(
3672
+ const { client: e, queryClient: a, scope: n, refetchInterval: r } = ne(), s = t != null && t.period ? new Date(t.period) : /* @__PURE__ */ new Date(), o = `${s.getUTCFullYear()}-${String(s.getUTCMonth() + 1).padStart(2, "0")}`;
3673
+ return Ve(
3667
3674
  {
3668
- queryKey: Ae.usages(n, o),
3675
+ queryKey: Ie.usages(n, o),
3669
3676
  // Send a concrete datetime within the month; the API infers the month from it.
3670
3677
  queryFn: () => e.getWorkspaceUsages({ period: `${o}-01T00:00:00.000Z` }).then((i) => i.quotas),
3671
3678
  enabled: (t == null ? void 0 : t.enabled) ?? !0,
@@ -3675,10 +3682,10 @@ function Xt(t) {
3675
3682
  );
3676
3683
  }
3677
3684
  function Oi(t, e) {
3678
- const { client: a, queryClient: n, scope: r, refetchInterval: s } = re(), o = a.breakDownWorkspaceUsageByBot, i = a.listBots, d = typeof o == "function" && typeof i == "function", c = e != null && e.period ? new Date(e.period) : /* @__PURE__ */ new Date(), u = `${c.getUTCFullYear()}-${String(c.getUTCMonth() + 1).padStart(2, "0")}`;
3679
- return $e(
3685
+ const { client: a, queryClient: n, scope: r, refetchInterval: s } = ne(), o = a.breakDownWorkspaceUsageByBot, i = a.listBots, d = typeof o == "function" && typeof i == "function", c = e != null && e.period ? new Date(e.period) : /* @__PURE__ */ new Date(), u = `${c.getUTCFullYear()}-${String(c.getUTCMonth() + 1).padStart(2, "0")}`;
3686
+ return Ve(
3680
3687
  {
3681
- queryKey: Ae.usageByBot(r, t, u),
3688
+ queryKey: Ie.usageByBot(r, t, u),
3682
3689
  queryFn: async () => {
3683
3690
  const [m, h] = await Promise.all([
3684
3691
  o({ id: r, type: t, period: `${u}-01T00:00:00.000Z` }),
@@ -3693,39 +3700,39 @@ function Oi(t, e) {
3693
3700
  );
3694
3701
  }
3695
3702
  function Fi() {
3696
- const { client: t } = re();
3703
+ const { client: t } = ne();
3697
3704
  return typeof t.breakDownWorkspaceUsageByBot == "function" && typeof t.listBots == "function";
3698
3705
  }
3699
3706
  function ls() {
3700
- const { client: t, queryClient: e } = re();
3707
+ const { client: t, queryClient: e } = ne();
3701
3708
  return Jt({ mutationFn: () => t.createPaymentMethodIntent({}) }, e);
3702
3709
  }
3703
3710
  function ds() {
3704
- const { client: t, queryClient: e, scope: a, notifyBillingChange: n } = re();
3711
+ const { client: t, queryClient: e, scope: a, notifyBillingChange: n } = ne();
3705
3712
  return Jt(
3706
3713
  {
3707
3714
  mutationFn: (r) => t.setPaymentMethod(r),
3708
3715
  onSuccess: async () => {
3709
- await e.invalidateQueries({ queryKey: Ae.paymentMethod(a) }), n({ type: "payment-method" });
3716
+ await e.invalidateQueries({ queryKey: Ie.paymentMethod(a) }), n({ type: "payment-method" });
3710
3717
  }
3711
3718
  },
3712
3719
  e
3713
3720
  );
3714
3721
  }
3715
3722
  function cs() {
3716
- const { client: t, queryClient: e, scope: a, notifyBillingChange: n } = re();
3723
+ const { client: t, queryClient: e, scope: a, notifyBillingChange: n } = ne();
3717
3724
  return Jt(
3718
3725
  {
3719
3726
  mutationFn: (r) => t.setCustomer(r),
3720
3727
  onSuccess: async (r, s) => {
3721
- await e.invalidateQueries({ queryKey: Ae.customer(a) }), s.address && n({ type: "billing-address" });
3728
+ await e.invalidateQueries({ queryKey: Ie.customer(a) }), s.address && n({ type: "billing-address" });
3722
3729
  }
3723
3730
  },
3724
3731
  e
3725
3732
  );
3726
3733
  }
3727
3734
  function Mi() {
3728
- const { client: t, queryClient: e, scope: a, notifyBillingChange: n } = re();
3735
+ const { client: t, queryClient: e, scope: a, notifyBillingChange: n } = ne();
3729
3736
  return Jt(
3730
3737
  {
3731
3738
  mutationFn: async (r) => {
@@ -3733,8 +3740,8 @@ function Mi() {
3733
3740
  },
3734
3741
  onSuccess: async () => {
3735
3742
  await Promise.all([
3736
- e.invalidateQueries({ queryKey: Ae.subscription(a) }),
3737
- e.invalidateQueries({ queryKey: Ae.invoices(a) }),
3743
+ e.invalidateQueries({ queryKey: Ie.subscription(a) }),
3744
+ e.invalidateQueries({ queryKey: Ie.invoices(a) }),
3738
3745
  e.invalidateQueries({ queryKey: ["bpb", a, "preview"] })
3739
3746
  ]), n({ type: "addons" });
3740
3747
  }
@@ -3743,7 +3750,7 @@ function Mi() {
3743
3750
  );
3744
3751
  }
3745
3752
  function us() {
3746
- const { client: t, queryClient: e, scope: a, notifyBillingChange: n } = re();
3753
+ const { client: t, queryClient: e, scope: a, notifyBillingChange: n } = ne();
3747
3754
  return Jt(
3748
3755
  {
3749
3756
  mutationFn: async (r) => {
@@ -3751,9 +3758,9 @@ function us() {
3751
3758
  },
3752
3759
  onSuccess: async () => {
3753
3760
  await Promise.all([
3754
- e.invalidateQueries({ queryKey: Ae.subscription(a) }),
3755
- e.invalidateQueries({ queryKey: Ae.plans(a) }),
3756
- e.invalidateQueries({ queryKey: Ae.invoices(a) }),
3761
+ e.invalidateQueries({ queryKey: Ie.subscription(a) }),
3762
+ e.invalidateQueries({ queryKey: Ie.plans(a) }),
3763
+ e.invalidateQueries({ queryKey: Ie.invoices(a) }),
3757
3764
  e.invalidateQueries({ queryKey: ["bpb", a, "preview"] })
3758
3765
  ]), n({ type: "subscription" });
3759
3766
  }
@@ -4060,7 +4067,7 @@ const Ui = (t, e) => {
4060
4067
  return r(d, u), u;
4061
4068
  };
4062
4069
  return s = o, (...d) => s(sl(...d));
4063
- }, il = [], Ie = (t) => {
4070
+ }, il = [], Ae = (t) => {
4064
4071
  const e = (a) => a[t] || il;
4065
4072
  return e.isThemeGetter = !0, e;
4066
4073
  }, fs = /^\[(?:(\w[\w-]*):)?(.+)\]$/i, ys = /^\((?:(\w[\w-]*):)?(.+)\)$/i, ll = /^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/, dl = /^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/, cl = /\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/, ul = /^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/, pl = /^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/, ml = /^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/, ht = (t) => ll.test(t), ie = (t) => !!t && !Number.isNaN(Number(t)), Ye = (t) => !!t && Number.isInteger(Number(t)), Tn = (t) => t.endsWith("%") && ie(t.slice(0, -1)), it = (t) => dl.test(t), vs = () => !0, hl = (t) => (
@@ -4075,7 +4082,7 @@ const Ui = (t, e) => {
4075
4082
  const n = ys.exec(t);
4076
4083
  return n ? n[1] ? e(n[1]) : a : !1;
4077
4084
  }, _s = (t) => t === "position" || t === "percentage", Ns = (t) => t === "image" || t === "url", Cs = (t) => t === "length" || t === "size" || t === "bg-size", Ss = (t) => t === "length", Il = (t) => t === "number", ks = (t) => t === "family-name", ws = (t) => t === "number" || t === "weight", Ts = (t) => t === "shadow", Al = () => {
4078
- const t = Ie("color"), e = Ie("font"), a = Ie("text"), n = Ie("font-weight"), r = Ie("tracking"), s = Ie("leading"), o = Ie("breakpoint"), i = Ie("container"), d = Ie("spacing"), c = Ie("radius"), u = Ie("shadow"), m = Ie("inset-shadow"), h = Ie("text-shadow"), g = Ie("drop-shadow"), b = Ie("blur"), C = Ie("perspective"), _ = Ie("aspect"), v = Ie("ease"), N = Ie("animate"), S = () => ["auto", "avoid", "all", "avoid-page", "page", "left", "right", "column"], T = () => [
4085
+ const t = Ae("color"), e = Ae("font"), a = Ae("text"), n = Ae("font-weight"), r = Ae("tracking"), s = Ae("leading"), o = Ae("breakpoint"), i = Ae("container"), d = Ae("spacing"), c = Ae("radius"), u = Ae("shadow"), m = Ae("inset-shadow"), h = Ae("text-shadow"), g = Ae("drop-shadow"), b = Ae("blur"), C = Ae("perspective"), _ = Ae("aspect"), v = Ae("ease"), N = Ae("animate"), S = () => ["auto", "avoid", "all", "avoid-page", "page", "left", "right", "column"], T = () => [
4079
4086
  "center",
4080
4087
  "top",
4081
4088
  "bottom",
@@ -4095,7 +4102,7 @@ const Ui = (t, e) => {
4095
4102
  "left-bottom"
4096
4103
  ], I = () => [...T(), z, U], k = () => ["auto", "hidden", "clip", "visible", "scroll"], A = () => ["auto", "contain", "none"], w = () => [z, U, d], E = () => [ht, "full", "auto", ...w()], L = () => [Ye, "none", "subgrid", z, U], O = () => ["auto", {
4097
4104
  span: ["full", Ye, z, U]
4098
- }, Ye, z, U], Z = () => [Ye, "auto", z, U], V = () => ["auto", "min", "max", "fr", z, U], $ = () => ["start", "end", "center", "between", "around", "evenly", "stretch", "baseline", "center-safe", "end-safe"], B = () => ["start", "end", "center", "stretch", "center-safe", "end-safe"], x = () => ["auto", ...w()], H = () => [ht, "auto", "full", "dvw", "dvh", "lvw", "lvh", "svw", "svh", "min", "max", "fit", ...w()], W = () => [ht, "screen", "full", "dvw", "lvw", "svw", "min", "max", "fit", ...w()], X = () => [ht, "screen", "full", "lh", "dvh", "lvh", "svh", "min", "max", "fit", ...w()], D = () => [t, z, U], ue = () => [...T(), Ar, Ir, {
4105
+ }, Ye, z, U], Z = () => [Ye, "auto", z, U], V = () => ["auto", "min", "max", "fr", z, U], $ = () => ["start", "end", "center", "between", "around", "evenly", "stretch", "baseline", "center-safe", "end-safe"], B = () => ["start", "end", "center", "stretch", "center-safe", "end-safe"], P = () => ["auto", ...w()], H = () => [ht, "auto", "full", "dvw", "dvh", "lvw", "lvh", "svw", "svh", "min", "max", "fit", ...w()], W = () => [ht, "screen", "full", "dvw", "lvw", "svw", "min", "max", "fit", ...w()], X = () => [ht, "screen", "full", "lh", "dvh", "lvh", "svh", "min", "max", "fit", ...w()], D = () => [t, z, U], ue = () => [...T(), Ar, Ir, {
4099
4106
  position: [z, U]
4100
4107
  }], ee = () => ["no-repeat", {
4101
4108
  repeat: ["", "x", "y", "space", "round"]
@@ -4109,7 +4116,7 @@ const Ui = (t, e) => {
4109
4116
  c,
4110
4117
  z,
4111
4118
  U
4112
- ], G = () => ["", ie, la, wt], P = () => ["solid", "dashed", "dotted", "double"], be = () => ["normal", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "hue", "saturation", "color", "luminosity"], te = () => [ie, Tn, Ar, Ir], de = () => [
4119
+ ], G = () => ["", ie, la, wt], x = () => ["solid", "dashed", "dotted", "double"], be = () => ["normal", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "hue", "saturation", "color", "luminosity"], te = () => [ie, Tn, Ar, Ir], de = () => [
4113
4120
  // Deprecated since Tailwind CSS v4.0.0
4114
4121
  "",
4115
4122
  "none",
@@ -4702,77 +4709,77 @@ const Ui = (t, e) => {
4702
4709
  * @see https://tailwindcss.com/docs/margin
4703
4710
  */
4704
4711
  m: [{
4705
- m: x()
4712
+ m: P()
4706
4713
  }],
4707
4714
  /**
4708
4715
  * Margin Inline
4709
4716
  * @see https://tailwindcss.com/docs/margin
4710
4717
  */
4711
4718
  mx: [{
4712
- mx: x()
4719
+ mx: P()
4713
4720
  }],
4714
4721
  /**
4715
4722
  * Margin Block
4716
4723
  * @see https://tailwindcss.com/docs/margin
4717
4724
  */
4718
4725
  my: [{
4719
- my: x()
4726
+ my: P()
4720
4727
  }],
4721
4728
  /**
4722
4729
  * Margin Inline Start
4723
4730
  * @see https://tailwindcss.com/docs/margin
4724
4731
  */
4725
4732
  ms: [{
4726
- ms: x()
4733
+ ms: P()
4727
4734
  }],
4728
4735
  /**
4729
4736
  * Margin Inline End
4730
4737
  * @see https://tailwindcss.com/docs/margin
4731
4738
  */
4732
4739
  me: [{
4733
- me: x()
4740
+ me: P()
4734
4741
  }],
4735
4742
  /**
4736
4743
  * Margin Block Start
4737
4744
  * @see https://tailwindcss.com/docs/margin
4738
4745
  */
4739
4746
  mbs: [{
4740
- mbs: x()
4747
+ mbs: P()
4741
4748
  }],
4742
4749
  /**
4743
4750
  * Margin Block End
4744
4751
  * @see https://tailwindcss.com/docs/margin
4745
4752
  */
4746
4753
  mbe: [{
4747
- mbe: x()
4754
+ mbe: P()
4748
4755
  }],
4749
4756
  /**
4750
4757
  * Margin Top
4751
4758
  * @see https://tailwindcss.com/docs/margin
4752
4759
  */
4753
4760
  mt: [{
4754
- mt: x()
4761
+ mt: P()
4755
4762
  }],
4756
4763
  /**
4757
4764
  * Margin Right
4758
4765
  * @see https://tailwindcss.com/docs/margin
4759
4766
  */
4760
4767
  mr: [{
4761
- mr: x()
4768
+ mr: P()
4762
4769
  }],
4763
4770
  /**
4764
4771
  * Margin Bottom
4765
4772
  * @see https://tailwindcss.com/docs/margin
4766
4773
  */
4767
4774
  mb: [{
4768
- mb: x()
4775
+ mb: P()
4769
4776
  }],
4770
4777
  /**
4771
4778
  * Margin Left
4772
4779
  * @see https://tailwindcss.com/docs/margin
4773
4780
  */
4774
4781
  ml: [{
4775
- ml: x()
4782
+ ml: P()
4776
4783
  }],
4777
4784
  /**
4778
4785
  * Space Between X
@@ -5065,7 +5072,7 @@ const Ui = (t, e) => {
5065
5072
  * @see https://tailwindcss.com/docs/text-decoration-style
5066
5073
  */
5067
5074
  "text-decoration-style": [{
5068
- decoration: [...P(), "wavy"]
5075
+ decoration: [...x(), "wavy"]
5069
5076
  }],
5070
5077
  /**
5071
5078
  * Text Decoration Thickness
@@ -5482,14 +5489,14 @@ const Ui = (t, e) => {
5482
5489
  * @see https://tailwindcss.com/docs/border-style
5483
5490
  */
5484
5491
  "border-style": [{
5485
- border: [...P(), "hidden", "none"]
5492
+ border: [...x(), "hidden", "none"]
5486
5493
  }],
5487
5494
  /**
5488
5495
  * Divide Style
5489
5496
  * @see https://tailwindcss.com/docs/border-style#setting-the-divider-style
5490
5497
  */
5491
5498
  "divide-style": [{
5492
- divide: [...P(), "hidden", "none"]
5499
+ divide: [...x(), "hidden", "none"]
5493
5500
  }],
5494
5501
  /**
5495
5502
  * Border Color
@@ -5580,7 +5587,7 @@ const Ui = (t, e) => {
5580
5587
  * @see https://tailwindcss.com/docs/outline-style
5581
5588
  */
5582
5589
  "outline-style": [{
5583
- outline: [...P(), "none", "hidden"]
5590
+ outline: [...x(), "none", "hidden"]
5584
5591
  }],
5585
5592
  /**
5586
5593
  * Outline Offset
@@ -7276,7 +7283,7 @@ const Fe = ({
7276
7283
  document.body
7277
7284
  ) : null;
7278
7285
  }, Rt = () => {
7279
- const { manageBillingUrl: t } = re(), { t: e } = ge();
7286
+ const { manageBillingUrl: t } = ne(), { t: e } = ge();
7280
7287
  return /* @__PURE__ */ p("div", { className: "bpb-outdated", children: [
7281
7288
  /* @__PURE__ */ l("h3", { className: "bpb-outdated__title", children: e("outdatedTitle") }),
7282
7289
  /* @__PURE__ */ l("p", { className: "bpb-outdated__text", children: e("outdatedText") }),
@@ -7410,37 +7417,37 @@ const rd = ({
7410
7417
  onOpenChange: e,
7411
7418
  onSelectPlan: a,
7412
7419
  recommendedPlanId: n = "team",
7413
- defaultInterval: r = "year",
7420
+ defaultInterval: r = "month",
7414
7421
  excludePlanIds: s = [],
7415
7422
  planFeatures: o = {},
7416
7423
  featureDescriptions: i
7417
7424
  }) => {
7418
7425
  var M, K, G;
7419
- const { isOutdatedBilling: d, toast: c, analytics: u } = re(), { t: m } = ge(), [h, g] = J(r), { data: b, isLoading: C } = rt(), { data: _ } = Qt(), { data: v } = Ve({ enabled: t }), { data: N } = os({ enabled: t }), S = us(), T = (N == null ? void 0 : N.planReadonly) ?? !1;
7426
+ const { isOutdatedBilling: d, toast: c, analytics: u } = ne(), { t: m } = ge(), [h, g] = J(r), { data: b, isLoading: C } = rt(), { data: _ } = Qt(), { data: v } = $e({ enabled: t }), { data: N } = os({ enabled: t }), S = us(), T = (N == null ? void 0 : N.planReadonly) ?? !1;
7420
7427
  Oe(() => {
7421
7428
  t && u.capture(we.PLAN_PICKER_VIEWED, { interval: h });
7422
7429
  }, [t, u]);
7423
- const I = (P) => {
7424
- P !== h && u.capture(we.PLAN_INTERVAL_TOGGLED, { interval: P }), g(P);
7425
- }, k = v == null ? void 0 : v.plan.current.interval, A = b == null ? void 0 : b.find((P) => P.id === (v == null ? void 0 : v.plan.current.planId)), w = v ? A ? _e(A) : "community" : void 0, E = ((M = v == null ? void 0 : v.plan.next) == null ? void 0 : M.planId) ?? null, L = !!E && E !== (v == null ? void 0 : v.plan.current.planId), O = T || w === "enterprise" || w === "managed", Z = Re(() => b ? b.filter(
7426
- (P) => _e(P) !== "managed" && _e(P) !== "enterprise" && !s.includes(P.id)
7427
- ).sort((P, be) => Wt.indexOf(_e(P)) - Wt.indexOf(_e(be))) : [], [b, s]), V = Re(() => nd(Z), [Z]), $ = Ql(), B = Re(() => {
7430
+ const I = (x) => {
7431
+ x !== h && u.capture(we.PLAN_INTERVAL_TOGGLED, { interval: x }), g(x);
7432
+ }, k = v == null ? void 0 : v.plan.current.interval, A = b == null ? void 0 : b.find((x) => x.id === (v == null ? void 0 : v.plan.current.planId)), w = v ? A ? _e(A) : "community" : void 0, E = ((M = v == null ? void 0 : v.plan.next) == null ? void 0 : M.planId) ?? null, L = !!E && E !== (v == null ? void 0 : v.plan.current.planId), O = T || w === "enterprise" || w === "managed", Z = Re(() => b ? b.filter(
7433
+ (x) => _e(x) !== "managed" && _e(x) !== "enterprise" && !s.includes(x.id)
7434
+ ).sort((x, be) => Wt.indexOf(_e(x)) - Wt.indexOf(_e(be))) : [], [b, s]), V = Re(() => nd(Z), [Z]), $ = Ql(), B = Re(() => {
7428
7435
  var te;
7429
7436
  if (Z.length === 0)
7430
7437
  return null;
7431
- const P = Z.find(
7438
+ const x = Z.find(
7432
7439
  (de) => _e(de) === n || de.id === n
7433
7440
  ), be = Z.find((de) => _e(de) === w);
7434
- return ((te = P ?? be ?? Z[0]) == null ? void 0 : te.id) ?? null;
7435
- }, [Z, n, w]), [x, H] = J(void 0), [W, X] = J(t);
7441
+ return ((te = x ?? be ?? Z[0]) == null ? void 0 : te.id) ?? null;
7442
+ }, [Z, n, w]), [P, H] = J(void 0), [W, X] = J(t);
7436
7443
  W !== t && (X(t), H(void 0));
7437
- const D = x === void 0 ? B : x, ue = ((G = (K = b == null ? void 0 : b.find((P) => _e(P) === "enterprise")) == null ? void 0 : K.metadata) == null ? void 0 : G.contact_url) ?? Is, ee = (P) => {
7444
+ const D = P === void 0 ? B : P, ue = ((G = (K = b == null ? void 0 : b.find((x) => _e(x) === "enterprise")) == null ? void 0 : K.metadata) == null ? void 0 : G.contact_url) ?? Is, ee = (x) => {
7438
7445
  S.mutate(
7439
- { planId: P.id, interval: h },
7446
+ { planId: x.id, interval: h },
7440
7447
  {
7441
7448
  onSuccess: () => {
7442
7449
  u.capture(we.PLAN_DOWNGRADED, {
7443
- plan_name: Ne(P.name),
7450
+ plan_name: Ne(x.name),
7444
7451
  interval: h,
7445
7452
  previous_plan_name: A ? Ne(A.name) : void 0
7446
7453
  }), c({ type: "success", message: m("upgradeDowngradeSuccess") });
@@ -7498,15 +7505,15 @@ const rd = ({
7498
7505
  }
7499
7506
  ) }),
7500
7507
  /* @__PURE__ */ p("div", { className: "bpb-upgrade__grid", children: [
7501
- C && [0, 1, 2].map((P) => /* @__PURE__ */ p("div", { className: "bpb-plan-card", "aria-hidden": !0, children: [
7508
+ C && [0, 1, 2].map((x) => /* @__PURE__ */ p("div", { className: "bpb-plan-card", "aria-hidden": !0, children: [
7502
7509
  /* @__PURE__ */ l(me, { width: 120, height: 22 }),
7503
7510
  /* @__PURE__ */ l(me, { width: 90, height: 40 }),
7504
7511
  /* @__PURE__ */ l(me, { width: "100%", height: 36, rounded: !0 }),
7505
7512
  /* @__PURE__ */ l(me, { width: "100%", height: 140 })
7506
- ] }, P)),
7507
- Z.map((P, be) => {
7513
+ ] }, x)),
7514
+ Z.map((x, be) => {
7508
7515
  var sa, oa;
7509
- const te = _e(P), de = td(P, h), pe = ad(P, h), ae = (((sa = P.prices.month) == null ? void 0 : sa.amount) ?? 0) <= 0, fe = te === w, se = fe && (w === "community" || h === k), Ee = te === w && w !== "community" && h !== k, st = !!E && P.id === E && !se, pt = w !== void 0 && Wt.indexOf(te) < Wt.indexOf(w), Pe = (te === n || P.id === n) && !se, Ze = fe && L ? "cancel_downgrade" : se ? "current" : Ee ? "switch_interval" : st ? "next" : pt ? "downgrade" : "upgrade", ta = be > 0 ? Z[be - 1] : void 0, aa = o[te] ?? $n[te], Et = P.features.conversation_sessions, Lt = Gn(_, P, h), Ot = P.features.ai_spend, Ea = Ot !== void 0 ? m("planFeatureAiUsageIncluded", {
7516
+ const te = _e(x), de = td(x, h), pe = ad(x, h), ae = (((sa = x.prices.month) == null ? void 0 : sa.amount) ?? 0) <= 0, fe = te === w, se = fe && (w === "community" || h === k), Ee = te === w && w !== "community" && h !== k, st = !!E && x.id === E && !se, pt = w !== void 0 && Wt.indexOf(te) < Wt.indexOf(w), Pe = (te === n || x.id === n) && !se, Ze = fe && L ? "cancel_downgrade" : se ? "current" : Ee ? "switch_interval" : st ? "next" : pt ? "downgrade" : "upgrade", ta = be > 0 ? Z[be - 1] : void 0, aa = o[te] ?? $n[te], Et = x.features.conversation_sessions, Lt = Gn(_, x, h), Ot = x.features.ai_spend, Ea = Ot !== void 0 ? m("planFeatureAiUsageIncluded", {
7510
7517
  amount: le(Ot / tt, (de == null ? void 0 : de.currency) ?? "usd", 0)
7511
7518
  }) : void 0, vn = Ot !== void 0 && Et ? m("planFeatureDescAiUsageIncluded", {
7512
7519
  rate: le(
@@ -7524,7 +7531,7 @@ const rd = ({
7524
7531
  description: (i == null ? void 0 : i["AI usage included"]) ?? vn
7525
7532
  }
7526
7533
  } : {}
7527
- }, na = S.isPending && (Ze === "downgrade" && ((oa = S.variables) == null ? void 0 : oa.planId) === P.id || Ze === "cancel_downgrade"), xe = Ne(P.name), mt = !$ || D === P.id, ra = pe !== null && de ? /* @__PURE__ */ p(Te, { children: [
7534
+ }, na = S.isPending && (Ze === "downgrade" && ((oa = S.variables) == null ? void 0 : oa.planId) === x.id || Ze === "cancel_downgrade"), xe = Ne(x.name), mt = !$ || D === x.id, ra = pe !== null && de ? /* @__PURE__ */ p(Te, { children: [
7528
7535
  /* @__PURE__ */ l("span", { className: "bpb-plan-card__currency", children: za(de.currency) }),
7529
7536
  /* @__PURE__ */ l("span", { className: "bpb-plan-card__amount", children: Number.isInteger(pe) ? pe : pe.toFixed(2).replace(/\.00$/, "") }),
7530
7537
  /* @__PURE__ */ l("span", { className: "bpb-plan-card__per", children: m("upgradePerMonthSuffix", { currency: de.currency.toUpperCase() }) })
@@ -7538,7 +7545,7 @@ const rd = ({
7538
7545
  $ && "bpb-plan-card--accordion",
7539
7546
  $ && mt && "is-expanded"
7540
7547
  ),
7541
- "data-plan-id": P.id,
7548
+ "data-plan-id": x.id,
7542
7549
  children: [
7543
7550
  $ ? (
7544
7551
  /* Name + price stay visible collapsed, so tiers compare. */
@@ -7548,7 +7555,7 @@ const rd = ({
7548
7555
  type: "button",
7549
7556
  className: "bpb-plan-card__summary",
7550
7557
  "aria-expanded": mt,
7551
- onClick: () => H(mt ? null : P.id),
7558
+ onClick: () => H(mt ? null : x.id),
7552
7559
  children: [
7553
7560
  /* @__PURE__ */ p("span", { className: "bpb-plan-card__summary-text", children: [
7554
7561
  /* @__PURE__ */ p("span", { className: "bpb-plan-card__name", children: [
@@ -7568,12 +7575,12 @@ const rd = ({
7568
7575
  xe,
7569
7576
  Pe && /* @__PURE__ */ l(Ja, { className: "bpb-plan-card__badge", children: m("upgradeRecommended") })
7570
7577
  ] }),
7571
- /* @__PURE__ */ l("p", { className: "bpb-plan-card__tagline", children: m(Pr[_e(P)]) }),
7578
+ /* @__PURE__ */ l("p", { className: "bpb-plan-card__tagline", children: m(Pr[_e(x)]) }),
7572
7579
  /* @__PURE__ */ l("div", { className: "bpb-plan-card__price", children: ra })
7573
7580
  ] })
7574
7581
  ),
7575
7582
  mt && /* @__PURE__ */ p(Te, { children: [
7576
- $ && /* @__PURE__ */ l("p", { className: "bpb-plan-card__tagline", children: m(Pr[_e(P)]) }),
7583
+ $ && /* @__PURE__ */ l("p", { className: "bpb-plan-card__tagline", children: m(Pr[_e(x)]) }),
7577
7584
  Et !== void 0 && /* @__PURE__ */ p("div", { className: "bpb-plan-card__allowance", children: [
7578
7585
  /* @__PURE__ */ p("div", { className: "bpb-plan-card__metric", children: [
7579
7586
  /* @__PURE__ */ l("span", { className: "bpb-plan-card__metric-value", children: ve(Et) }),
@@ -7594,7 +7601,7 @@ const rd = ({
7594
7601
  block: !0,
7595
7602
  disabled: O || S.isPending,
7596
7603
  loading: na,
7597
- onClick: () => ee(P),
7604
+ onClick: () => ee(x),
7598
7605
  children: m("upgradeDowngrade")
7599
7606
  }
7600
7607
  ),
@@ -7607,10 +7614,10 @@ const rd = ({
7607
7614
  title: O ? m("upgradePlanManaged") : void 0,
7608
7615
  onClick: () => {
7609
7616
  u.capture(we.PLAN_UPGRADE_INITIATED, {
7610
- plan_name: Ne(P.name),
7617
+ plan_name: Ne(x.name),
7611
7618
  interval: h,
7612
7619
  current_plan_name: A ? Ne(A.name) : void 0
7613
- }), a(P.id, h);
7620
+ }), a(x.id, h);
7614
7621
  },
7615
7622
  children: m(h === "year" ? "upgradeSwitchToAnnual" : "upgradeSwitchToMonthly")
7616
7623
  }
@@ -7624,10 +7631,10 @@ const rd = ({
7624
7631
  title: O ? m("upgradePlanManaged") : void 0,
7625
7632
  onClick: () => {
7626
7633
  u.capture(we.PLAN_UPGRADE_INITIATED, {
7627
- plan_name: Ne(P.name),
7634
+ plan_name: Ne(x.name),
7628
7635
  interval: h,
7629
7636
  current_plan_name: A ? Ne(A.name) : void 0
7630
- }), a(P.id, h);
7637
+ }), a(x.id, h);
7631
7638
  },
7632
7639
  children: m("upgradeUpgrade")
7633
7640
  }
@@ -7644,7 +7651,7 @@ const rd = ({
7644
7651
  ] })
7645
7652
  ]
7646
7653
  },
7647
- P.id
7654
+ x.id
7648
7655
  );
7649
7656
  })
7650
7657
  ] }),
@@ -7776,7 +7783,7 @@ const id = 4, ld = ({
7776
7783
  onSubscribe: d
7777
7784
  }) => {
7778
7785
  var H, W, X, D, ue;
7779
- const { locale: c } = re(), { t: u } = ge(), { data: m } = Qt(), h = ((H = t == null ? void 0 : t.prices.month) == null ? void 0 : H.currency) ?? ((W = t == null ? void 0 : t.prices.year) == null ? void 0 : W.currency) ?? "usd", g = t == null ? void 0 : t.features.conversation_sessions, b = t && _e(t) === "community" ? u("conversationsUnit") : u("conversationsPerMonth"), C = t ? Gn(m, t, e) : null, _ = (a == null ? void 0 : a.costs.immediate.amountDue) ?? 0, v = (a == null ? void 0 : a.costs.immediate.accountBalance) ?? 0, N = (a == null ? void 0 : a.costs.nextCycle.total) ?? 0, S = a != null && a.nextBillingDate ? Pl(a.nextBillingDate, 1) : null, T = S && !Xa(S) ? ct(S, c) : null, I = t ? $n[_e(t)].slice(0, id) : [], k = t == null ? void 0 : t.features.ai_spend, A = k !== void 0 ? u("planFeatureAiUsageIncluded", { amount: le(k / tt, h, 0) }) : void 0, w = t ? ((X = t.prices[e]) == null ? void 0 : X.amount) ?? 0 : 0, E = (a == null ? void 0 : a.costs.immediate.lineItems) ?? [], L = E.filter((ee) => ee.type === "discount"), O = E.filter((ee) => ee.type === "proration_credit" || ee.type === "proration_charge").reduce((ee, ce) => ee + ce.amount, 0), Z = !!(a != null && a.subscription.plan.effectiveDate), V = ((D = t == null ? void 0 : t.prices.month) == null ? void 0 : D.amount) ?? 0, $ = ((ue = t == null ? void 0 : t.prices.year) == null ? void 0 : ue.amount) ?? 0, B = e === "year" && V > 0 && $ > 0 ? Math.round(V * 12 - $) : 0, x = Math.round(B / 12);
7786
+ const { locale: c } = ne(), { t: u } = ge(), { data: m } = Qt(), h = ((H = t == null ? void 0 : t.prices.month) == null ? void 0 : H.currency) ?? ((W = t == null ? void 0 : t.prices.year) == null ? void 0 : W.currency) ?? "usd", g = t == null ? void 0 : t.features.conversation_sessions, b = t && _e(t) === "community" ? u("conversationsUnit") : u("conversationsPerMonth"), C = t ? Gn(m, t, e) : null, _ = (a == null ? void 0 : a.costs.immediate.amountDue) ?? 0, v = (a == null ? void 0 : a.costs.immediate.accountBalance) ?? 0, N = (a == null ? void 0 : a.costs.nextCycle.total) ?? 0, S = a != null && a.nextBillingDate ? Pl(a.nextBillingDate, 1) : null, T = S && !Xa(S) ? ct(S, c) : null, I = t ? $n[_e(t)].slice(0, id) : [], k = t == null ? void 0 : t.features.ai_spend, A = k !== void 0 ? u("planFeatureAiUsageIncluded", { amount: le(k / tt, h, 0) }) : void 0, w = t ? ((X = t.prices[e]) == null ? void 0 : X.amount) ?? 0 : 0, E = (a == null ? void 0 : a.costs.immediate.lineItems) ?? [], L = E.filter((ee) => ee.type === "discount"), O = E.filter((ee) => ee.type === "proration_credit" || ee.type === "proration_charge").reduce((ee, ce) => ee + ce.amount, 0), Z = !!(a != null && a.subscription.plan.effectiveDate), V = ((D = t == null ? void 0 : t.prices.month) == null ? void 0 : D.amount) ?? 0, $ = ((ue = t == null ? void 0 : t.prices.year) == null ? void 0 : ue.amount) ?? 0, B = e === "year" && V > 0 && $ > 0 ? Math.round(V * 12 - $) : 0, P = Math.round(B / 12);
7780
7787
  return /* @__PURE__ */ p("div", { className: "bpb-summary-wrap", children: [
7781
7788
  /* @__PURE__ */ p("div", { className: "bpb-summary bpb-glow", children: [
7782
7789
  /* @__PURE__ */ l("h3", { className: "bpb-summary__title", children: t ? `${Ne(t.name)} plan` : /* @__PURE__ */ l(me, { width: 140, height: 24 }) }),
@@ -7862,7 +7869,7 @@ const id = 4, ld = ({
7862
7869
  B > 0 && /* @__PURE__ */ p("div", { className: "bpb-summary__savings", children: [
7863
7870
  /* @__PURE__ */ l(Hn, { size: 18, className: "bpb-summary__savings-icon" }),
7864
7871
  /* @__PURE__ */ l("span", { children: u("orderSavingsNote", {
7865
- monthlySavings: le(x, h, 0),
7872
+ monthlySavings: le(P, h, 0),
7866
7873
  yearlySavings: le(B, h, 0)
7867
7874
  }) })
7868
7875
  ] }),
@@ -8285,7 +8292,7 @@ const Bn = ({ label: t, invalid: e, className: a, id: n, ...r }) => t ? /* @__PU
8285
8292
  ] });
8286
8293
  }, gd = ({ planId: t, initialInterval: e, onSuccess: a }) => {
8287
8294
  var na;
8288
- const n = Gr(), r = Kr(), { email: s, toast: o, analytics: i, isDark: d } = re(), { t: c } = ge(), [u, m] = J(e), [h, g] = J("payment"), [b, C] = J(null), [_, v] = J(!1), [N, S] = J(!1), [T, I] = J(!1), [k, A] = J(void 0), [w, E] = J(!1), [L, O] = J(""), [Z, V] = J(""), [$, B] = J(""), [x, H] = J(!1), [W, X] = J({}), [D, ue] = J(!1), ee = ls(), { data: ce } = rt(), { data: M } = Ve(), { data: K, isLoading: G } = rs(), { data: P, isLoading: be, isError: te } = ss(), de = ce == null ? void 0 : ce.find((xe) => xe.id === t), pe = ((na = K == null ? void 0 : K.paymentMethod) == null ? void 0 : na.card) ?? null, ae = (P == null ? void 0 : P.address) ?? null;
8295
+ const n = Gr(), r = Kr(), { email: s, toast: o, analytics: i, isDark: d } = ne(), { t: c } = ge(), [u, m] = J(e), [h, g] = J("payment"), [b, C] = J(null), [_, v] = J(!1), [N, S] = J(!1), [T, I] = J(!1), [k, A] = J(void 0), [w, E] = J(!1), [L, O] = J(""), [Z, V] = J(""), [$, B] = J(""), [P, H] = J(!1), [W, X] = J({}), [D, ue] = J(!1), ee = ls(), { data: ce } = rt(), { data: M } = $e(), { data: K, isLoading: G } = rs(), { data: x, isLoading: be, isError: te } = ss(), de = ce == null ? void 0 : ce.find((xe) => xe.id === t), pe = ((na = K == null ? void 0 : K.paymentMethod) == null ? void 0 : na.card) ?? null, ae = (x == null ? void 0 : x.address) ?? null;
8289
8296
  Oe(() => {
8290
8297
  b === null && !G && K !== void 0 && C(pe ? "saved" : "new");
8291
8298
  }, [b, G, K, pe]), Oe(() => {
@@ -8303,7 +8310,7 @@ const Bn = ({ label: t, invalid: e, className: a, id: n, ...r }) => t ? /* @__PU
8303
8310
  i.capture(we.PAYMENT_METHOD_SELECTED, { method: xe === "saved" ? "saved_card" : "new_card" }), C(xe);
8304
8311
  }, Ea = (xe) => {
8305
8312
  v(xe), ue(!1);
8306
- }, vn = !!n && !!r && !!de && !be && !te && !se.isError && !!se.data && aa && Et && !x, _n = async () => {
8313
+ }, vn = !!n && !!r && !!de && !be && !te && !se.isError && !!se.data && aa && Et && !P, _n = async () => {
8307
8314
  var mt, ra, sa, oa;
8308
8315
  if (!n || !r || !de || be || te)
8309
8316
  return;
@@ -8356,13 +8363,13 @@ const Bn = ({ label: t, invalid: e, className: a, id: n, ...r }) => t ? /* @__PU
8356
8363
  };
8357
8364
  }
8358
8365
  }
8359
- const sr = w && L.trim() || qe || (P == null ? void 0 : P.name) || void 0, La = w && Z && $.trim() ? { type: Z, value: $.trim() } : void 0, mo = La ? [
8360
- ...((P == null ? void 0 : P.taxIds) ?? []).filter(
8366
+ const sr = w && L.trim() || qe || (x == null ? void 0 : x.name) || void 0, La = w && Z && $.trim() ? { type: Z, value: $.trim() } : void 0, mo = La ? [
8367
+ ...((x == null ? void 0 : x.taxIds) ?? []).filter(
8361
8368
  (He) => He.type !== La.type || He.value !== La.value
8362
8369
  ),
8363
8370
  La
8364
- ] : P == null ? void 0 : P.taxIds;
8365
- (Me || w || sr !== ((P == null ? void 0 : P.name) ?? void 0)) && await st.mutateAsync({
8371
+ ] : x == null ? void 0 : x.taxIds;
8372
+ (Me || w || sr !== ((x == null ? void 0 : x.name) ?? void 0)) && await st.mutateAsync({
8366
8373
  address: Me ?? ae ?? void 0,
8367
8374
  name: sr,
8368
8375
  taxIds: mo
@@ -8410,7 +8417,7 @@ const Bn = ({ label: t, invalid: e, className: a, id: n, ...r }) => t ? /* @__PU
8410
8417
  {
8411
8418
  stepNumber: 2,
8412
8419
  existingAddress: ae,
8413
- customerName: (P == null ? void 0 : P.name) ?? null,
8420
+ customerName: (x == null ? void 0 : x.name) ?? null,
8414
8421
  isLoading: be,
8415
8422
  editing: N,
8416
8423
  onEdit: () => S(!0),
@@ -8440,14 +8447,14 @@ const Bn = ({ label: t, invalid: e, className: a, id: n, ...r }) => t ? /* @__PU
8440
8447
  isLoadingPreview: se.isLoading,
8441
8448
  isPreviewError: se.isError,
8442
8449
  canSubscribe: vn,
8443
- isSubmitting: x,
8450
+ isSubmitting: P,
8444
8451
  submitError: W.general ?? null,
8445
8452
  onSubscribe: () => void _n()
8446
8453
  }
8447
8454
  ) })
8448
8455
  ] });
8449
8456
  }, bd = ({ open: t, onOpenChange: e, planId: a, interval: n, onBack: r, onSuccess: s }) => {
8450
- const { stripePromise: o, isDark: i, locale: d, isOutdatedBilling: c } = re(), { t: u } = ge(), m = Re(
8457
+ const { stripePromise: o, isDark: i, locale: d, isOutdatedBilling: c } = ne(), { t: u } = ge(), m = Re(
8451
8458
  () => ({
8452
8459
  appearance: Rs(i),
8453
8460
  locale: Ls(d)
@@ -8510,7 +8517,7 @@ const Bn = ({ label: t, invalid: e, className: a, id: n, ...r }) => t ? /* @__PU
8510
8517
  /* @__PURE__ */ l("div", { className: "bpb-upgrade-gate__actions", children: n ? /* @__PURE__ */ l(ke, { variant: "primary", className: "bpb-upgrade-gate__cta", onClick: n, children: a }) : /* @__PURE__ */ l(ke, { variant: "outline", onClick: r, children: s("close") }) })
8511
8518
  ] });
8512
8519
  }, eu = ({ open: t, onOpenChange: e, onSuccess: a, onUpgrade: n }) => {
8513
- const { isOutdatedBilling: r } = re(), { t: s } = ge();
8520
+ const { isOutdatedBilling: r } = ne(), { t: s } = ge();
8514
8521
  return r ? /* @__PURE__ */ l(
8515
8522
  Fe,
8516
8523
  {
@@ -8528,14 +8535,14 @@ const Bn = ({ label: t, invalid: e, className: a, id: n, ...r }) => t ? /* @__PU
8528
8535
  onUpgrade: a
8529
8536
  }) => {
8530
8537
  var D, ue, ee, ce;
8531
- const { toast: n, locale: r } = re(), { t: s } = ge(), { data: o } = Ve(), { data: i } = Qt(), { data: d } = rt(), { data: c } = os(), u = Mi(), [m, h] = J(null), g = d == null ? void 0 : d.find((M) => M.id === (o == null ? void 0 : o.plan.current.planId)), b = (o == null ? void 0 : o.plan.current.interval) ?? "month", C = (c == null ? void 0 : c.addonsReadonly) ?? !1, _ = o == null ? void 0 : o.plan.current.periodEnd, v = _ && !Xa(_) ? ct(_, r) : null, N = Re(() => {
8538
+ const { toast: n, locale: r } = ne(), { t: s } = ge(), { data: o } = $e(), { data: i } = Qt(), { data: d } = rt(), { data: c } = os(), u = Mi(), [m, h] = J(null), g = d == null ? void 0 : d.find((M) => M.id === (o == null ? void 0 : o.plan.current.planId)), b = (o == null ? void 0 : o.plan.current.interval) ?? "month", C = (c == null ? void 0 : c.addonsReadonly) ?? !1, _ = o == null ? void 0 : o.plan.current.periodEnd, v = _ && !Xa(_) ? ct(_, r) : null, N = Re(() => {
8532
8539
  var K;
8533
8540
  if (!o || !i)
8534
8541
  return null;
8535
8542
  const M = {};
8536
8543
  for (const G of i) {
8537
- const P = o.addons[G.id];
8538
- M[G.id] = ((K = P == null ? void 0 : P.next) == null ? void 0 : K.quantity) ?? (P == null ? void 0 : P.current.quantity) ?? 0;
8544
+ const x = o.addons[G.id];
8545
+ M[G.id] = ((K = x == null ? void 0 : x.next) == null ? void 0 : K.quantity) ?? (x == null ? void 0 : x.current.quantity) ?? 0;
8539
8546
  }
8540
8547
  return M;
8541
8548
  }, [o, i]), S = m ?? N, T = Re(() => !i || !g ? [] : i.flatMap((M) => {
@@ -8549,14 +8556,14 @@ const Bn = ({ label: t, invalid: e, className: a, id: n, ...r }) => t ? /* @__PU
8549
8556
  [g, b, S]
8550
8557
  ), w = ns(A ?? { plan: { planId: "", interval: b } }, {
8551
8558
  enabled: !!A && I
8552
- }), E = ((D = g == null ? void 0 : g.prices[b]) == null ? void 0 : D.currency) ?? "usd", L = ((ue = w.data) == null ? void 0 : ue.costs.immediate.amountDue) ?? 0, O = (ee = w.data) == null ? void 0 : ee.nextBillingDate, Z = O && !Xa(O) ? ct(O, r) : null, V = ((ce = g == null ? void 0 : g.prices[b]) == null ? void 0 : ce.amount) ?? 0, $ = V + k, B = g && S ? Ll(g, i, S) : [], x = (M, K) => K === "bytes" ? Kt(M) : ve(M), H = (M, K) => {
8553
- const G = i == null ? void 0 : i.find((de) => de.id === M), P = G == null ? void 0 : G.increments;
8554
- if (!P || K <= 0)
8559
+ }), E = ((D = g == null ? void 0 : g.prices[b]) == null ? void 0 : D.currency) ?? "usd", L = ((ue = w.data) == null ? void 0 : ue.costs.immediate.amountDue) ?? 0, O = (ee = w.data) == null ? void 0 : ee.nextBillingDate, Z = O && !Xa(O) ? ct(O, r) : null, V = ((ce = g == null ? void 0 : g.prices[b]) == null ? void 0 : ce.amount) ?? 0, $ = V + k, B = g && S ? Ll(g, i, S) : [], P = (M, K) => K === "bytes" ? Kt(M) : ve(M), H = (M, K) => {
8560
+ const G = i == null ? void 0 : i.find((de) => de.id === M), x = G == null ? void 0 : G.increments;
8561
+ if (!x || K <= 0)
8555
8562
  return null;
8556
- const be = P.conversation_sessions ?? 0;
8563
+ const be = x.conversation_sessions ?? 0;
8557
8564
  if (be > 0)
8558
8565
  return s("addonsConvos", { n: ve(be * K) });
8559
- const te = P.file_storage ?? 0;
8566
+ const te = x.file_storage ?? 0;
8560
8567
  return te > 0 ? Kt(te * K) : null;
8561
8568
  }, W = () => {
8562
8569
  S && u.mutate(
@@ -8589,7 +8596,7 @@ const Bn = ({ label: t, invalid: e, className: a, id: n, ...r }) => t ? /* @__PU
8589
8596
  ) : /* @__PURE__ */ p(Te, { children: [
8590
8597
  /* @__PURE__ */ l("div", { className: "bpb-addons", children: T.map(({ addon: M, price: K }) => {
8591
8598
  var de;
8592
- const G = ((de = o == null ? void 0 : o.addons[M.id]) == null ? void 0 : de.current.quantity) ?? 0, P = (S == null ? void 0 : S[M.id]) ?? 0, be = P !== G ? P === 0 ? v ? s("addonRemovedOnDate", { activeNow: G, date: v }) : s("addonRemovedNextCycle", { activeNow: G }) : v ? s("addonChangedOnDate", { activeNow: G, pending: P, date: v }) : s("addonChangedNextCycle", { activeNow: G, pending: P }) : G > 0 ? s("addonActiveOnly", { count: G }) : null, te = H(M.id, P);
8599
+ const G = ((de = o == null ? void 0 : o.addons[M.id]) == null ? void 0 : de.current.quantity) ?? 0, x = (S == null ? void 0 : S[M.id]) ?? 0, be = x !== G ? x === 0 ? v ? s("addonRemovedOnDate", { activeNow: G, date: v }) : s("addonRemovedNextCycle", { activeNow: G }) : v ? s("addonChangedOnDate", { activeNow: G, pending: x, date: v }) : s("addonChangedNextCycle", { activeNow: G, pending: x }) : G > 0 ? s("addonActiveOnly", { count: G }) : null, te = H(M.id, x);
8593
8600
  return /* @__PURE__ */ p("div", { className: "bpb-addon-row", children: [
8594
8601
  /* @__PURE__ */ p("div", { className: "bpb-addon-row__info", children: [
8595
8602
  /* @__PURE__ */ l("span", { className: "bpb-addon-row__name", children: gt[M.id] ? s(gt[M.id]) : ja(M.name) }),
@@ -8604,7 +8611,7 @@ const Bn = ({ label: t, invalid: e, className: a, id: n, ...r }) => t ? /* @__PU
8604
8611
  {
8605
8612
  className: j(
8606
8613
  "bpb-addon-row__status",
8607
- P !== G && "bpb-addon-row__status--changed"
8614
+ x !== G && "bpb-addon-row__status--changed"
8608
8615
  ),
8609
8616
  children: be
8610
8617
  }
@@ -8616,7 +8623,7 @@ const Bn = ({ label: t, invalid: e, className: a, id: n, ...r }) => t ? /* @__PU
8616
8623
  fd,
8617
8624
  {
8618
8625
  "aria-label": `${gt[M.id] ? s(gt[M.id]) : ja(M.name)} quantity`,
8619
- value: P,
8626
+ value: x,
8620
8627
  onChange: (pe) => h({ ...S ?? {}, [M.id]: pe })
8621
8628
  }
8622
8629
  )
@@ -8635,9 +8642,9 @@ const Bn = ({ label: t, invalid: e, className: a, id: n, ...r }) => t ? /* @__PU
8635
8642
  return /* @__PURE__ */ p("div", { className: "bpb-manage-addons__limit-row", children: [
8636
8643
  /* @__PURE__ */ l("span", { className: "bpb-manage-addons__limit-label", children: K ? s(K) : M.label }),
8637
8644
  /* @__PURE__ */ p("span", { className: "bpb-manage-addons__limit-values", children: [
8638
- /* @__PURE__ */ l("span", { className: "bpb-manage-addons__limit-now", children: x(M.now, M.unit) }),
8645
+ /* @__PURE__ */ l("span", { className: "bpb-manage-addons__limit-now", children: P(M.now, M.unit) }),
8639
8646
  /* @__PURE__ */ l("span", { className: "bpb-manage-addons__limit-arrow", "aria-hidden": !0, children: "→" }),
8640
- /* @__PURE__ */ l("span", { className: "bpb-manage-addons__limit-next", children: x(M.next, M.unit) })
8647
+ /* @__PURE__ */ l("span", { className: "bpb-manage-addons__limit-next", children: P(M.next, M.unit) })
8641
8648
  ] })
8642
8649
  ] }, M.key);
8643
8650
  })
@@ -8699,10 +8706,10 @@ const Bn = ({ label: t, invalid: e, className: a, id: n, ...r }) => t ? /* @__PU
8699
8706
  ] })
8700
8707
  ] });
8701
8708
  }, tu = ({ open: t, onOpenChange: e }) => {
8702
- const { isOutdatedBilling: a } = re(), { t: n } = ge();
8709
+ const { isOutdatedBilling: a } = ne(), { t: n } = ge();
8703
8710
  return a ? /* @__PURE__ */ l(Fe, { open: t, onOpenChange: e, size: "md", "aria-label": n("invoicesTitle"), className: "bpb-scope", children: /* @__PURE__ */ l(Rt, {}) }) : /* @__PURE__ */ l(Fe, { open: t, onOpenChange: e, size: "md", "aria-label": n("invoicesTitle"), className: "bpb-scope", children: /* @__PURE__ */ l(vd, { open: t }) });
8704
8711
  }, vd = ({ open: t }) => {
8705
- const { locale: e, analytics: a } = re(), { t: n } = ge(), { data: r, isLoading: s, isError: o } = Ei({ enabled: t }), i = (r == null ? void 0 : r.invoices) ?? [], d = {
8712
+ const { locale: e, analytics: a } = ne(), { t: n } = ge(), { data: r, isLoading: s, isError: o } = Ei({ enabled: t }), i = (r == null ? void 0 : r.invoices) ?? [], d = {
8706
8713
  paid: n("invoiceStatusPaid"),
8707
8714
  open: n("invoiceStatusDue"),
8708
8715
  draft: n("invoiceStatusDraft"),
@@ -8739,7 +8746,7 @@ const Bn = ({ label: t, invalid: e, className: a, id: n, ...r }) => t ? /* @__PU
8739
8746
  ] });
8740
8747
  }, au = ({ open: t, onOpenChange: e, onSuccess: a }) => {
8741
8748
  var g;
8742
- const { stripePromise: n, isDark: r, locale: s, isOutdatedBilling: o } = re(), { t: i } = ge(), d = ls(), c = (g = d.data) == null ? void 0 : g.clientSecret, { mutate: u, reset: m } = d;
8749
+ const { stripePromise: n, isDark: r, locale: s, isOutdatedBilling: o } = ne(), { t: i } = ge(), d = ls(), c = (g = d.data) == null ? void 0 : g.clientSecret, { mutate: u, reset: m } = d;
8743
8750
  Oe(() => {
8744
8751
  t && !o ? u() : m();
8745
8752
  }, [t, o, u, m]);
@@ -8787,7 +8794,7 @@ const Bn = ({ label: t, invalid: e, className: a, id: n, ...r }) => t ? /* @__PU
8787
8794
  onSuccess: a
8788
8795
  }) => {
8789
8796
  var pe;
8790
- const n = Gr(), r = Kr(), { toast: s, analytics: o } = re(), { t: i } = ge(), { data: d, isLoading: c } = rs(), { data: u, isLoading: m } = ss(), h = ds(), g = cs(), b = ((pe = d == null ? void 0 : d.paymentMethod) == null ? void 0 : pe.card) ?? null, C = (u == null ? void 0 : u.address) ?? null, _ = (u == null ? void 0 : u.taxIds) ?? [], [v, N] = J(!1), [S, T] = J(!1), [I, k] = J(!1), [A, w] = J(!1), [E, L] = J(null), [O, Z] = J(!1), [V, $] = J(!1), [B, x] = J({}), [H, W] = J(C == null ? void 0 : C.country), [X, D] = J(_.length > 0), [ue, ee] = J(null), ce = ue ?? _.map((ae) => ({ type: ae.type, value: ae.value })), M = Ms(H), K = v || !b, G = (ae, fe) => ee(ce.map((se, Ee) => Ee === ae ? { ...se, ...fe } : se)), P = () => {
8797
+ const n = Gr(), r = Kr(), { toast: s, analytics: o } = ne(), { t: i } = ge(), { data: d, isLoading: c } = rs(), { data: u, isLoading: m } = ss(), h = ds(), g = cs(), b = ((pe = d == null ? void 0 : d.paymentMethod) == null ? void 0 : pe.card) ?? null, C = (u == null ? void 0 : u.address) ?? null, _ = (u == null ? void 0 : u.taxIds) ?? [], [v, N] = J(!1), [S, T] = J(!1), [I, k] = J(!1), [A, w] = J(!1), [E, L] = J(null), [O, Z] = J(!1), [V, $] = J(!1), [B, P] = J({}), [H, W] = J(C == null ? void 0 : C.country), [X, D] = J(_.length > 0), [ue, ee] = J(null), ce = ue ?? _.map((ae) => ({ type: ae.type, value: ae.value })), M = Ms(H), K = v || !b, G = (ae, fe) => ee(ce.map((se, Ee) => Ee === ae ? { ...se, ...fe } : se)), x = () => {
8791
8798
  var ae;
8792
8799
  return ee([...ce, { type: ((ae = M[0]) == null ? void 0 : ae.type) ?? "", value: "" }]);
8793
8800
  }, be = (ae) => ee(ce.filter((fe, se) => se !== ae)), te = async () => {
@@ -8823,10 +8830,10 @@ const Bn = ({ label: t, invalid: e, className: a, id: n, ...r }) => t ? /* @__PU
8823
8830
  return;
8824
8831
  const { complete: fe, value: se } = await ae.getValue();
8825
8832
  if (!fe || !se.address) {
8826
- x({ address: i("paymentAddressIncomplete") });
8833
+ P({ address: i("paymentAddressIncomplete") });
8827
8834
  return;
8828
8835
  }
8829
- $(!0), x({});
8836
+ $(!0), P({});
8830
8837
  try {
8831
8838
  const { address: Ee, name: st } = se, pt = ce.filter((Pe) => !!Pe.type && Pe.value.trim() !== "").map((Pe) => ({ type: Pe.type, value: Pe.value.trim() }));
8832
8839
  await g.mutateAsync({
@@ -8843,7 +8850,7 @@ const Bn = ({ label: t, invalid: e, className: a, id: n, ...r }) => t ? /* @__PU
8843
8850
  }), o.capture(we.BILLING_ADDRESS_UPDATED), s({ type: "success", message: i("paymentDetailsUpdated") }), a == null || a();
8844
8851
  } catch (Ee) {
8845
8852
  const st = Ee instanceof Error ? Ee : void 0, pt = Os(st, i("paymentAddressError"));
8846
- x(pt), pt.taxId && D(!0), s({ type: "error", message: i("paymentDetailsUpdateError") });
8853
+ P(pt), pt.taxId && D(!0), s({ type: "error", message: i("paymentDetailsUpdateError") });
8847
8854
  } finally {
8848
8855
  $(!1);
8849
8856
  }
@@ -8964,7 +8971,7 @@ const Bn = ({ label: t, invalid: e, className: a, id: n, ...r }) => t ? /* @__PU
8964
8971
  }
8965
8972
  )
8966
8973
  ] }, fe)),
8967
- /* @__PURE__ */ l("button", { type: "button", className: "bpb-link-button bpb-tax__add", onClick: P, children: i("paymentTaxAdd") }),
8974
+ /* @__PURE__ */ l("button", { type: "button", className: "bpb-link-button bpb-tax__add", onClick: x, children: i("paymentTaxAdd") }),
8968
8975
  B.taxId && /* @__PURE__ */ l("p", { role: "alert", className: "bpb-payment-dialog__field-error", children: B.taxId })
8969
8976
  ] })
8970
8977
  ] }),
@@ -10159,7 +10166,7 @@ const Fr = (t, e) => {
10159
10166
  }
10160
10167
  };
10161
10168
  };
10162
- function ne(t) {
10169
+ function re(t) {
10163
10170
  if (!t)
10164
10171
  return {};
10165
10172
  const { errorMap: e, invalid_type_error: a, required_error: n, description: r } = t;
@@ -10338,7 +10345,7 @@ class oe {
10338
10345
  }
10339
10346
  transform(e) {
10340
10347
  return new Ke({
10341
- ...ne(this._def),
10348
+ ...re(this._def),
10342
10349
  schema: this,
10343
10350
  typeName: Y.ZodEffects,
10344
10351
  effect: { type: "transform", transform: e }
@@ -10347,7 +10354,7 @@ class oe {
10347
10354
  default(e) {
10348
10355
  const a = typeof e == "function" ? e : () => e;
10349
10356
  return new Ca({
10350
- ...ne(this._def),
10357
+ ...re(this._def),
10351
10358
  innerType: this,
10352
10359
  defaultValue: a,
10353
10360
  typeName: Y.ZodDefault
@@ -10357,13 +10364,13 @@ class oe {
10357
10364
  return new nr({
10358
10365
  typeName: Y.ZodBranded,
10359
10366
  type: this,
10360
- ...ne(this._def)
10367
+ ...re(this._def)
10361
10368
  });
10362
10369
  }
10363
10370
  catch(e) {
10364
10371
  const a = typeof e == "function" ? e : () => e;
10365
10372
  return new Sa({
10366
- ...ne(this._def),
10373
+ ...re(this._def),
10367
10374
  innerType: this,
10368
10375
  catchValue: a,
10369
10376
  typeName: Y.ZodCatch
@@ -10810,7 +10817,7 @@ We.create = (t) => new We({
10810
10817
  checks: [],
10811
10818
  typeName: Y.ZodString,
10812
10819
  coerce: (t == null ? void 0 : t.coerce) ?? !1,
10813
- ...ne(t)
10820
+ ...re(t)
10814
10821
  });
10815
10822
  function Gd(t, e) {
10816
10823
  const a = (t.toString().split(".")[1] || "").length, n = (e.toString().split(".")[1] || "").length, r = a > n ? a : n, s = Number.parseInt(t.toFixed(r).replace(".", "")), o = Number.parseInt(e.toFixed(r).replace(".", ""));
@@ -10987,7 +10994,7 @@ vt.create = (t) => new vt({
10987
10994
  checks: [],
10988
10995
  typeName: Y.ZodNumber,
10989
10996
  coerce: (t == null ? void 0 : t.coerce) || !1,
10990
- ...ne(t)
10997
+ ...re(t)
10991
10998
  });
10992
10999
  class _t extends oe {
10993
11000
  constructor() {
@@ -11121,7 +11128,7 @@ _t.create = (t) => new _t({
11121
11128
  checks: [],
11122
11129
  typeName: Y.ZodBigInt,
11123
11130
  coerce: (t == null ? void 0 : t.coerce) ?? !1,
11124
- ...ne(t)
11131
+ ...re(t)
11125
11132
  });
11126
11133
  class ma extends oe {
11127
11134
  _parse(e) {
@@ -11140,7 +11147,7 @@ f.ZodBoolean = ma;
11140
11147
  ma.create = (t) => new ma({
11141
11148
  typeName: Y.ZodBoolean,
11142
11149
  coerce: (t == null ? void 0 : t.coerce) || !1,
11143
- ...ne(t)
11150
+ ...re(t)
11144
11151
  });
11145
11152
  class xt extends oe {
11146
11153
  _parse(e) {
@@ -11219,7 +11226,7 @@ xt.create = (t) => new xt({
11219
11226
  checks: [],
11220
11227
  coerce: (t == null ? void 0 : t.coerce) || !1,
11221
11228
  typeName: Y.ZodDate,
11222
- ...ne(t)
11229
+ ...re(t)
11223
11230
  });
11224
11231
  class en extends oe {
11225
11232
  _parse(e) {
@@ -11237,7 +11244,7 @@ class en extends oe {
11237
11244
  f.ZodSymbol = en;
11238
11245
  en.create = (t) => new en({
11239
11246
  typeName: Y.ZodSymbol,
11240
- ...ne(t)
11247
+ ...re(t)
11241
11248
  });
11242
11249
  class ha extends oe {
11243
11250
  _parse(e) {
@@ -11255,7 +11262,7 @@ class ha extends oe {
11255
11262
  f.ZodUndefined = ha;
11256
11263
  ha.create = (t) => new ha({
11257
11264
  typeName: Y.ZodUndefined,
11258
- ...ne(t)
11265
+ ...re(t)
11259
11266
  });
11260
11267
  class ga extends oe {
11261
11268
  _parse(e) {
@@ -11273,7 +11280,7 @@ class ga extends oe {
11273
11280
  f.ZodNull = ga;
11274
11281
  ga.create = (t) => new ga({
11275
11282
  typeName: Y.ZodNull,
11276
- ...ne(t)
11283
+ ...re(t)
11277
11284
  });
11278
11285
  class Ht extends oe {
11279
11286
  constructor() {
@@ -11286,7 +11293,7 @@ class Ht extends oe {
11286
11293
  f.ZodAny = Ht;
11287
11294
  Ht.create = (t) => new Ht({
11288
11295
  typeName: Y.ZodAny,
11289
- ...ne(t)
11296
+ ...re(t)
11290
11297
  });
11291
11298
  class At extends oe {
11292
11299
  constructor() {
@@ -11299,7 +11306,7 @@ class At extends oe {
11299
11306
  f.ZodUnknown = At;
11300
11307
  At.create = (t) => new At({
11301
11308
  typeName: Y.ZodUnknown,
11302
- ...ne(t)
11309
+ ...re(t)
11303
11310
  });
11304
11311
  class ut extends oe {
11305
11312
  _parse(e) {
@@ -11314,7 +11321,7 @@ class ut extends oe {
11314
11321
  f.ZodNever = ut;
11315
11322
  ut.create = (t) => new ut({
11316
11323
  typeName: Y.ZodNever,
11317
- ...ne(t)
11324
+ ...re(t)
11318
11325
  });
11319
11326
  class tn extends oe {
11320
11327
  _parse(e) {
@@ -11332,7 +11339,7 @@ class tn extends oe {
11332
11339
  f.ZodVoid = tn;
11333
11340
  tn.create = (t) => new tn({
11334
11341
  typeName: Y.ZodVoid,
11335
- ...ne(t)
11342
+ ...re(t)
11336
11343
  });
11337
11344
  class Ge extends oe {
11338
11345
  _parse(e) {
@@ -11406,7 +11413,7 @@ Ge.create = (t, e) => new Ge({
11406
11413
  maxLength: null,
11407
11414
  exactLength: null,
11408
11415
  typeName: Y.ZodArray,
11409
- ...ne(e)
11416
+ ...re(e)
11410
11417
  });
11411
11418
  function jt(t) {
11412
11419
  if (t instanceof Se) {
@@ -11697,21 +11704,21 @@ Se.create = (t, e) => new Se({
11697
11704
  unknownKeys: "strip",
11698
11705
  catchall: ut.create(),
11699
11706
  typeName: Y.ZodObject,
11700
- ...ne(e)
11707
+ ...re(e)
11701
11708
  });
11702
11709
  Se.strictCreate = (t, e) => new Se({
11703
11710
  shape: () => t,
11704
11711
  unknownKeys: "strict",
11705
11712
  catchall: ut.create(),
11706
11713
  typeName: Y.ZodObject,
11707
- ...ne(e)
11714
+ ...re(e)
11708
11715
  });
11709
11716
  Se.lazycreate = (t, e) => new Se({
11710
11717
  shape: t,
11711
11718
  unknownKeys: "strip",
11712
11719
  catchall: ut.create(),
11713
11720
  typeName: Y.ZodObject,
11714
- ...ne(e)
11721
+ ...re(e)
11715
11722
  });
11716
11723
  class ba extends oe {
11717
11724
  _parse(e) {
@@ -11785,7 +11792,7 @@ f.ZodUnion = ba;
11785
11792
  ba.create = (t, e) => new ba({
11786
11793
  options: t,
11787
11794
  typeName: Y.ZodUnion,
11788
- ...ne(e)
11795
+ ...re(e)
11789
11796
  });
11790
11797
  const lt = (t) => t instanceof va ? lt(t.schema) : t instanceof Ke ? lt(t.innerType()) : t instanceof _a ? [t.value] : t instanceof Nt ? t.options : t instanceof Na ? F.util.objectValues(t.enum) : t instanceof Ca ? lt(t._def.innerType) : t instanceof ha ? [void 0] : t instanceof ga ? [null] : t instanceof et ? [void 0, ...lt(t.unwrap())] : t instanceof Ct ? [null, ...lt(t.unwrap())] : t instanceof nr || t instanceof ka ? lt(t.unwrap()) : t instanceof Sa ? lt(t._def.innerType) : [];
11791
11798
  class fn extends oe {
@@ -11846,7 +11853,7 @@ class fn extends oe {
11846
11853
  discriminator: e,
11847
11854
  options: a,
11848
11855
  optionsMap: r,
11849
- ...ne(n)
11856
+ ...re(n)
11850
11857
  });
11851
11858
  }
11852
11859
  }
@@ -11914,7 +11921,7 @@ fa.create = (t, e, a) => new fa({
11914
11921
  left: t,
11915
11922
  right: e,
11916
11923
  typeName: Y.ZodIntersection,
11917
- ...ne(a)
11924
+ ...re(a)
11918
11925
  });
11919
11926
  class nt extends oe {
11920
11927
  _parse(e) {
@@ -11964,7 +11971,7 @@ nt.create = (t, e) => {
11964
11971
  items: t,
11965
11972
  typeName: Y.ZodTuple,
11966
11973
  rest: null,
11967
- ...ne(e)
11974
+ ...re(e)
11968
11975
  });
11969
11976
  };
11970
11977
  class ya extends oe {
@@ -11999,12 +12006,12 @@ class ya extends oe {
11999
12006
  keyType: e,
12000
12007
  valueType: a,
12001
12008
  typeName: Y.ZodRecord,
12002
- ...ne(n)
12009
+ ...re(n)
12003
12010
  }) : new ya({
12004
12011
  keyType: We.create(),
12005
12012
  valueType: e,
12006
12013
  typeName: Y.ZodRecord,
12007
- ...ne(a)
12014
+ ...re(a)
12008
12015
  });
12009
12016
  }
12010
12017
  }
@@ -12056,7 +12063,7 @@ an.create = (t, e, a) => new an({
12056
12063
  valueType: e,
12057
12064
  keyType: t,
12058
12065
  typeName: Y.ZodMap,
12059
- ...ne(a)
12066
+ ...re(a)
12060
12067
  });
12061
12068
  class Pt extends oe {
12062
12069
  _parse(e) {
@@ -12121,7 +12128,7 @@ Pt.create = (t, e) => new Pt({
12121
12128
  minSize: null,
12122
12129
  maxSize: null,
12123
12130
  typeName: Y.ZodSet,
12124
- ...ne(e)
12131
+ ...re(e)
12125
12132
  });
12126
12133
  class Gt extends oe {
12127
12134
  constructor() {
@@ -12210,7 +12217,7 @@ class Gt extends oe {
12210
12217
  args: e || nt.create([]).rest(At.create()),
12211
12218
  returns: a || At.create(),
12212
12219
  typeName: Y.ZodFunction,
12213
- ...ne(n)
12220
+ ...re(n)
12214
12221
  });
12215
12222
  }
12216
12223
  }
@@ -12228,7 +12235,7 @@ f.ZodLazy = va;
12228
12235
  va.create = (t, e) => new va({
12229
12236
  getter: t,
12230
12237
  typeName: Y.ZodLazy,
12231
- ...ne(e)
12238
+ ...re(e)
12232
12239
  });
12233
12240
  class _a extends oe {
12234
12241
  _parse(e) {
@@ -12250,13 +12257,13 @@ f.ZodLiteral = _a;
12250
12257
  _a.create = (t, e) => new _a({
12251
12258
  value: t,
12252
12259
  typeName: Y.ZodLiteral,
12253
- ...ne(e)
12260
+ ...re(e)
12254
12261
  });
12255
12262
  function no(t, e) {
12256
12263
  return new Nt({
12257
12264
  values: t,
12258
12265
  typeName: Y.ZodEnum,
12259
- ...ne(e)
12266
+ ...re(e)
12260
12267
  });
12261
12268
  }
12262
12269
  class Nt extends oe {
@@ -12344,7 +12351,7 @@ f.ZodNativeEnum = Na;
12344
12351
  Na.create = (t, e) => new Na({
12345
12352
  values: t,
12346
12353
  typeName: Y.ZodNativeEnum,
12347
- ...ne(e)
12354
+ ...re(e)
12348
12355
  });
12349
12356
  class Yt extends oe {
12350
12357
  unwrap() {
@@ -12369,7 +12376,7 @@ f.ZodPromise = Yt;
12369
12376
  Yt.create = (t, e) => new Yt({
12370
12377
  type: t,
12371
12378
  typeName: Y.ZodPromise,
12372
- ...ne(e)
12379
+ ...re(e)
12373
12380
  });
12374
12381
  class Ke extends oe {
12375
12382
  innerType() {
@@ -12457,13 +12464,13 @@ Ke.create = (t, e, a) => new Ke({
12457
12464
  schema: t,
12458
12465
  typeName: Y.ZodEffects,
12459
12466
  effect: e,
12460
- ...ne(a)
12467
+ ...re(a)
12461
12468
  });
12462
12469
  Ke.createWithPreprocess = (t, e, a) => new Ke({
12463
12470
  schema: e,
12464
12471
  effect: { type: "preprocess", transform: t },
12465
12472
  typeName: Y.ZodEffects,
12466
- ...ne(a)
12473
+ ...re(a)
12467
12474
  });
12468
12475
  class et extends oe {
12469
12476
  _parse(e) {
@@ -12477,7 +12484,7 @@ f.ZodOptional = et;
12477
12484
  et.create = (t, e) => new et({
12478
12485
  innerType: t,
12479
12486
  typeName: Y.ZodOptional,
12480
- ...ne(e)
12487
+ ...re(e)
12481
12488
  });
12482
12489
  class Ct extends oe {
12483
12490
  _parse(e) {
@@ -12491,7 +12498,7 @@ f.ZodNullable = Ct;
12491
12498
  Ct.create = (t, e) => new Ct({
12492
12499
  innerType: t,
12493
12500
  typeName: Y.ZodNullable,
12494
- ...ne(e)
12501
+ ...re(e)
12495
12502
  });
12496
12503
  class Ca extends oe {
12497
12504
  _parse(e) {
@@ -12512,7 +12519,7 @@ Ca.create = (t, e) => new Ca({
12512
12519
  innerType: t,
12513
12520
  typeName: Y.ZodDefault,
12514
12521
  defaultValue: typeof e.default == "function" ? e.default : () => e.default,
12515
- ...ne(e)
12522
+ ...re(e)
12516
12523
  });
12517
12524
  class Sa extends oe {
12518
12525
  _parse(e) {
@@ -12556,7 +12563,7 @@ Sa.create = (t, e) => new Sa({
12556
12563
  innerType: t,
12557
12564
  typeName: Y.ZodCatch,
12558
12565
  catchValue: typeof e.catch == "function" ? e.catch : () => e.catch,
12559
- ...ne(e)
12566
+ ...re(e)
12560
12567
  });
12561
12568
  class nn extends oe {
12562
12569
  _parse(e) {
@@ -12574,7 +12581,7 @@ class nn extends oe {
12574
12581
  f.ZodNaN = nn;
12575
12582
  nn.create = (t) => new nn({
12576
12583
  typeName: Y.ZodNaN,
12577
- ...ne(t)
12584
+ ...re(t)
12578
12585
  });
12579
12586
  f.BRAND = Symbol("zod_brand");
12580
12587
  class nr extends oe {
@@ -12645,7 +12652,7 @@ f.ZodReadonly = ka;
12645
12652
  ka.create = (t, e) => new ka({
12646
12653
  innerType: t,
12647
12654
  typeName: Y.ZodReadonly,
12648
- ...ne(e)
12655
+ ...re(e)
12649
12656
  });
12650
12657
  function Mr(t, e) {
12651
12658
  const a = typeof t == "function" ? t(e) : typeof t == "string" ? { message: t } : t;
@@ -13251,7 +13258,7 @@ const nu = ({
13251
13258
  period: i
13252
13259
  }) => {
13253
13260
  var $, B;
13254
- const { isOutdatedBilling: d, analytics: c, scope: u } = re(), { t: m } = ge(), { data: h } = rt(), { data: g } = Qt(), { data: b } = Ve({ enabled: !d }), { data: C } = Xt({ period: i, enabled: !d }), _ = t !== void 0, [v, N] = J(!1), S = h == null ? void 0 : h.find((x) => x.id === (b == null ? void 0 : b.plan.current.planId)), T = b ? S ? _e(S) === "community" : !0 : !1, I = Re(() => yn(C).find((x) => x.key === "conversation_sessions"), [C]), k = !_ && !d && T && !!I && I.pct / 100 >= Pc && !v && !Zs(zr, u, "modal"), A = _ ? !!t : k;
13261
+ const { isOutdatedBilling: d, analytics: c, scope: u } = ne(), { t: m } = ge(), { data: h } = rt(), { data: g } = Qt(), { data: b } = $e({ enabled: !d }), { data: C } = Xt({ period: i, enabled: !d }), _ = t !== void 0, [v, N] = J(!1), S = h == null ? void 0 : h.find((P) => P.id === (b == null ? void 0 : b.plan.current.planId)), T = b ? S ? _e(S) === "community" : !0 : !1, I = Re(() => yn(C).find((P) => P.key === "conversation_sessions"), [C]), k = !_ && !d && T && !!I && I.pct / 100 >= Pc && !v && !Zs(zr, u, "modal"), A = _ ? !!t : k;
13255
13262
  Oe(() => {
13256
13263
  A && c.capture(we.PLAN_PICKER_VIEWED, {
13257
13264
  source: _ ? "outgrow_free" : "outgrow_free_auto",
@@ -13260,10 +13267,10 @@ const nu = ({
13260
13267
  }, [A, _, c]);
13261
13268
  const w = () => {
13262
13269
  _ || (qs(zr, u, "modal"), N(!0)), e == null || e(!1);
13263
- }, E = Re(() => h ? h.filter((x) => {
13264
- const H = _e(x);
13270
+ }, E = Re(() => h ? h.filter((P) => {
13271
+ const H = _e(P);
13265
13272
  return H !== "community" && H !== "enterprise" && H !== "managed";
13266
- }).sort((x, H) => Wt.indexOf(_e(x)) - Wt.indexOf(_e(H))) : [], [h]), L = ((B = ($ = h == null ? void 0 : h.find((x) => _e(x) === "enterprise")) == null ? void 0 : $.metadata) == null ? void 0 : B.contact_url) ?? Is;
13273
+ }).sort((P, H) => Wt.indexOf(_e(P)) - Wt.indexOf(_e(H))) : [], [h]), L = ((B = ($ = h == null ? void 0 : h.find((P) => _e(P) === "enterprise")) == null ? void 0 : $.metadata) == null ? void 0 : B.contact_url) ?? Is;
13267
13274
  if (d || !A)
13268
13275
  return null;
13269
13276
  const O = (I == null ? void 0 : I.quota) ?? (S == null ? void 0 : S.features.conversation_sessions) ?? 100, Z = (I == null ? void 0 : I.used) ?? 0, V = I && I.pct > 0 ? Math.min(100, Math.max(5, Math.round(I.pct))) : 0;
@@ -13301,17 +13308,17 @@ const nu = ({
13301
13308
  }
13302
13309
  ) })
13303
13310
  ] }),
13304
- /* @__PURE__ */ l("div", { className: "bpb-outgrow__grid", children: E.map((x, H) => {
13305
- const W = _e(x), X = Rc(x, r), D = Ec(x, r), ue = W === n || x.id === n, ee = x.features.conversation_sessions, ce = Gn(g, x, r), M = H > 0 ? E[H - 1] : void 0, K = (s[W] ?? $n[W]).slice(0, Dc);
13311
+ /* @__PURE__ */ l("div", { className: "bpb-outgrow__grid", children: E.map((P, H) => {
13312
+ const W = _e(P), X = Rc(P, r), D = Ec(P, r), ue = W === n || P.id === n, ee = P.features.conversation_sessions, ce = Gn(g, P, r), M = H > 0 ? E[H - 1] : void 0, K = (s[W] ?? $n[W]).slice(0, Dc);
13306
13313
  return /* @__PURE__ */ p(
13307
13314
  "div",
13308
13315
  {
13309
13316
  className: j("bpb-plan-card", ue && "bpb-plan-card--highlighted bpb-glow"),
13310
- "data-plan-id": x.id,
13317
+ "data-plan-id": P.id,
13311
13318
  children: [
13312
13319
  /* @__PURE__ */ p("div", { className: "bpb-plan-card__header", children: [
13313
13320
  /* @__PURE__ */ p("h3", { className: "bpb-plan-card__name", children: [
13314
- Ne(x.name),
13321
+ Ne(P.name),
13315
13322
  ue && /* @__PURE__ */ l(Ja, { className: "bpb-plan-card__badge", children: m("upgradeRecommended") })
13316
13323
  ] }),
13317
13324
  /* @__PURE__ */ l("div", { className: "bpb-plan-card__price", children: D !== null && X ? /* @__PURE__ */ p(Te, { children: [
@@ -13346,13 +13353,13 @@ const nu = ({
13346
13353
  block: !0,
13347
13354
  onClick: () => {
13348
13355
  c.capture(we.PLAN_UPGRADE_INITIATED, {
13349
- plan_name: Ne(x.name),
13356
+ plan_name: Ne(P.name),
13350
13357
  interval: r,
13351
13358
  source: "outgrow_free"
13352
- }), a(x.id, r), w();
13359
+ }), a(P.id, r), w();
13353
13360
  },
13354
13361
  children: [
13355
- m("outgrowUpgradeTo", { planName: Ne(x.name) }),
13362
+ m("outgrowUpgradeTo", { planName: Ne(P.name) }),
13356
13363
  ue && /* @__PURE__ */ l(Xn, { size: 15 })
13357
13364
  ]
13358
13365
  }
@@ -13360,16 +13367,16 @@ const nu = ({
13360
13367
  /* @__PURE__ */ p("ul", { className: "bpb-plan-card__features", children: [
13361
13368
  M && /* @__PURE__ */ l("li", { className: "bpb-outgrow__features-lead", children: m("outgrowEverythingIn", { planName: Ne(M.name) }) }),
13362
13369
  K.map((G) => {
13363
- const P = er(G), be = Kn[G], te = be !== void 0 ? m(be.label) : G, de = (o == null ? void 0 : o[G]) ?? (be !== void 0 ? m(be.desc) : void 0);
13370
+ const x = er(G), be = Kn[G], te = be !== void 0 ? m(be.label) : G, de = (o == null ? void 0 : o[G]) ?? (be !== void 0 ? m(be.desc) : void 0);
13364
13371
  return /* @__PURE__ */ p("li", { children: [
13365
- /* @__PURE__ */ l("span", { className: "bpb-plan-card__feature-chip", children: /* @__PURE__ */ l(P, { size: 13 }) }),
13372
+ /* @__PURE__ */ l("span", { className: "bpb-plan-card__feature-chip", children: /* @__PURE__ */ l(x, { size: 13 }) }),
13366
13373
  de ? /* @__PURE__ */ l(Qa, { label: te, children: de }) : /* @__PURE__ */ l("span", { children: te })
13367
13374
  ] }, G);
13368
13375
  })
13369
13376
  ] })
13370
13377
  ]
13371
13378
  },
13372
- x.id
13379
+ P.id
13373
13380
  );
13374
13381
  }) }),
13375
13382
  /* @__PURE__ */ p("footer", { className: "bpb-outgrow__footer", children: [
@@ -13482,13 +13489,13 @@ const nu = ({
13482
13489
  onIncreaseLimits: r
13483
13490
  }) => {
13484
13491
  var Z;
13485
- const { isOutdatedBilling: s, locale: o } = re(), { t: i } = ge(), d = Re(() => Lc(a, o), [a, o]), [c, u] = J(t ?? ((Z = d[0]) == null ? void 0 : Z.value) ?? ""), m = Fi(), h = Math.max(
13492
+ const { isOutdatedBilling: s, locale: o } = ne(), { t: i } = ge(), d = Re(() => Lc(a, o), [a, o]), [c, u] = J(t ?? ((Z = d[0]) == null ? void 0 : Z.value) ?? ""), m = Fi(), h = Math.max(
13486
13493
  0,
13487
13494
  d.findIndex((V) => V.value === c)
13488
13495
  ), g = (V) => {
13489
13496
  const $ = d[h + V];
13490
13497
  $ && u($.value);
13491
- }, { data: b, isLoading: C, isError: _ } = Xt({ period: c, enabled: !s }), { data: v } = Ve({ enabled: !s }), { data: N } = rt(), S = N == null ? void 0 : N.find((V) => V.id === (v == null ? void 0 : v.plan.current.planId)), T = S ? Ne(S.name) : void 0, I = S ? _e(S) : "community", k = I === "enterprise" || I === "managed", A = (V) => S == null ? void 0 : S.features[V];
13498
+ }, { data: b, isLoading: C, isError: _ } = Xt({ period: c, enabled: !s }), { data: v } = $e({ enabled: !s }), { data: N } = rt(), S = N == null ? void 0 : N.find((V) => V.id === (v == null ? void 0 : v.plan.current.planId)), T = S ? Ne(S.name) : void 0, I = S ? _e(S) : "community", k = I === "enterprise" || I === "managed", A = (V) => S == null ? void 0 : S.features[V];
13492
13499
  if (s)
13493
13500
  return /* @__PURE__ */ l("div", { className: j("bpb-usage bpb-scope", n), children: /* @__PURE__ */ l(Rt, {}) });
13494
13501
  if (C)
@@ -13607,7 +13614,7 @@ const nu = ({
13607
13614
  period: o,
13608
13615
  className: i
13609
13616
  }) => {
13610
- const { isOutdatedBilling: d, analytics: c, scope: u } = re(), { t: m } = ge(), { data: h } = Xt({ period: o, enabled: !d }), [g, b] = J({}), [C, _] = J(!1), [v, N] = J(null), S = h ? Object.entries(h).map(([O, Z]) => ({ key: O, pct: Z.quota > 0 ? (Z.usage ?? 0) / Z.quota : 0 })).filter((O) => O.pct >= e).sort((O, Z) => Z.pct - O.pct)[0] : void 0, T = !!S && (g[S.key] || Zs(jr, u, S.key));
13617
+ const { isOutdatedBilling: d, analytics: c, scope: u } = ne(), { t: m } = ge(), { data: h } = Xt({ period: o, enabled: !d }), [g, b] = J({}), [C, _] = J(!1), [v, N] = J(null), S = h ? Object.entries(h).map(([O, Z]) => ({ key: O, pct: Z.quota > 0 ? (Z.usage ?? 0) / Z.quota : 0 })).filter((O) => O.pct >= e).sort((O, Z) => Z.pct - O.pct)[0] : void 0, T = !!S && (g[S.key] || Zs(jr, u, S.key));
13611
13618
  if (d || !S || T)
13612
13619
  return null;
13613
13620
  const k = {
@@ -13690,7 +13697,7 @@ const nu = ({
13690
13697
  ] }),
13691
13698
  /* @__PURE__ */ l("p", { className: "bpb-action-card__description", children: a })
13692
13699
  ] }), wa = ({ children: t }) => /* @__PURE__ */ l("span", { className: "bpb-summary-card__icon", "aria-hidden": "true", children: t }), po = ({ isAddons: t, className: e }) => {
13693
- const { manageBillingUrl: a } = re(), { t: n } = ge(), r = () => a && window.open(a, "_blank", "noopener");
13700
+ const { manageBillingUrl: a } = ne(), { t: n } = ge(), r = () => a && window.open(a, "_blank", "noopener");
13694
13701
  return /* @__PURE__ */ p(
13695
13702
  "button",
13696
13703
  {
@@ -13720,7 +13727,7 @@ const nu = ({
13720
13727
  );
13721
13728
  }, iu = ({ onManage: t, className: e }) => {
13722
13729
  var C, _;
13723
- const { isOutdatedBilling: a } = re(), { t: n } = ge(), { data: r, isLoading: s } = Ve({ enabled: !a }), { data: o, isLoading: i } = rt();
13730
+ const { isOutdatedBilling: a } = ne(), { t: n } = ge(), { data: r, isLoading: s } = $e({ enabled: !a }), { data: o, isLoading: i } = rt();
13724
13731
  if (a)
13725
13732
  return /* @__PURE__ */ l(po, { isAddons: !1, className: e });
13726
13733
  if (s || i)
@@ -13756,7 +13763,7 @@ const nu = ({
13756
13763
  }
13757
13764
  );
13758
13765
  }, lu = ({ onManage: t, className: e }) => {
13759
- const { isOutdatedBilling: a } = re(), { t: n } = ge(), { data: r, isLoading: s } = Ve({ enabled: !a }), { data: o, isLoading: i } = Qt();
13766
+ const { isOutdatedBilling: a } = ne(), { t: n } = ge(), { data: r, isLoading: s } = $e({ enabled: !a }), { data: o, isLoading: i } = Qt();
13760
13767
  if (a)
13761
13768
  return /* @__PURE__ */ l(po, { isAddons: !0, className: e });
13762
13769
  if (s || i)
@@ -13798,7 +13805,7 @@ const nu = ({
13798
13805
  }
13799
13806
  );
13800
13807
  }, du = ({ onManage: t, className: e }) => {
13801
- const { isOutdatedBilling: a } = re(), { t: n } = ge(), { data: r, isLoading: s, isError: o } = is({ enabled: !a });
13808
+ const { isOutdatedBilling: a } = ne(), { t: n } = ge(), { data: r, isLoading: s, isError: o } = is({ enabled: !a });
13802
13809
  if (a)
13803
13810
  return null;
13804
13811
  if (s)
@@ -13857,7 +13864,7 @@ const nu = ({
13857
13864
  );
13858
13865
  }, cu = ({ onManage: t, className: e }) => {
13859
13866
  var W, X;
13860
- const { isOutdatedBilling: a, locale: n, manageBillingUrl: r, analytics: s } = re(), { t: o } = ge(), { data: i, isLoading: d } = Ve({ enabled: !a }), { data: c, isLoading: u } = rt(), { data: m, isLoading: h } = Qt();
13867
+ const { isOutdatedBilling: a, locale: n, manageBillingUrl: r, analytics: s } = ne(), { t: o } = ge(), { data: i, isLoading: d } = $e({ enabled: !a }), { data: c, isLoading: u } = rt(), { data: m, isLoading: h } = Qt();
13861
13868
  if (a) {
13862
13869
  const D = () => r && window.open(r, "_blank", "noopener");
13863
13870
  return /* @__PURE__ */ p(
@@ -13892,9 +13899,9 @@ const nu = ({
13892
13899
  ), S = ((X = b == null ? void 0 : b.prices[C]) == null ? void 0 : X.amount) ?? 0, T = (m ?? []).reduce((D, ue) => {
13893
13900
  const ee = b ? Wn(ue, b, C) : null;
13894
13901
  return D + (N[ue.id] ?? 0) * ((ee == null ? void 0 : ee.amount) ?? 0);
13895
- }, 0), I = S + T, k = C === "year" ? "/yr" : "/mo", A = Ol(b, m, N).find((D) => D.key === "conversation_sessions"), w = o(v === "community" ? "conversationsUnit" : "conversationsPerMonth"), E = v === "enterprise" || v === "managed", L = v !== "community" && !E, O = i == null ? void 0 : i.plan.next, Z = O && O.planId !== (g == null ? void 0 : g.planId), V = g == null ? void 0 : g.periodEnd, $ = L && !Z && V && !Xa(V) ? ct(V, n) : null, B = c == null ? void 0 : c.find((D) => D.id === (O == null ? void 0 : O.planId)), x = O == null ? void 0 : O.effectiveDate, H = Z && B && x ? o("planBannerDowngradesTo", {
13902
+ }, 0), I = S + T, k = C === "year" ? "/yr" : "/mo", A = Ol(b, m, N).find((D) => D.key === "conversation_sessions"), w = o(v === "community" ? "conversationsUnit" : "conversationsPerMonth"), E = v === "enterprise" || v === "managed", L = v !== "community" && !E, O = i == null ? void 0 : i.plan.next, Z = O && O.planId !== (g == null ? void 0 : g.planId), V = g == null ? void 0 : g.periodEnd, $ = L && !Z && V && !Xa(V) ? ct(V, n) : null, B = c == null ? void 0 : c.find((D) => D.id === (O == null ? void 0 : O.planId)), P = O == null ? void 0 : O.effectiveDate, H = Z && B && P ? o("planBannerDowngradesTo", {
13896
13903
  plan: Ne(B.name),
13897
- date: ct(x, n)
13904
+ date: ct(P, n)
13898
13905
  }) : null;
13899
13906
  return /* @__PURE__ */ p(
13900
13907
  "button",
@@ -13950,7 +13957,7 @@ const nu = ({
13950
13957
  className: r,
13951
13958
  style: s
13952
13959
  }) => {
13953
- const { isOutdatedBilling: o, locale: i } = re(), { t: d } = ge(), { data: c, isLoading: u } = Ve({ enabled: !o }), { data: m, isLoading: h } = rt(), { data: g, isLoading: b } = Xt({ period: e, enabled: !o });
13960
+ const { isOutdatedBilling: o, locale: i } = ne(), { t: d } = ge(), { data: c, isLoading: u } = $e({ enabled: !o }), { data: m, isLoading: h } = rt(), { data: g, isLoading: b } = Xt({ period: e, enabled: !o });
13954
13961
  if (o)
13955
13962
  return null;
13956
13963
  if (u || h || b)
@@ -14007,14 +14014,14 @@ const nu = ({
14007
14014
  ] }) : /* @__PURE__ */ p("div", { className: "bpb-plan-usage__head", children: [
14008
14015
  /* @__PURE__ */ l("span", { className: "bpb-plan-usage__plan", children: C ? Ne(C.name) : d("free") }),
14009
14016
  t && /* @__PURE__ */ l(yt, { size: 15, className: "bpb-plan-usage__chevron" })
14010
- ] }) }), x = j(
14017
+ ] }) }), P = j(
14011
14018
  "bpb-plan-usage bpb-scope",
14012
14019
  `bpb-plan-usage--${a}`,
14013
14020
  L && `bpb-plan-usage--${E}`,
14014
14021
  t && "bpb-plan-usage--clickable",
14015
14022
  r
14016
14023
  );
14017
- return t ? /* @__PURE__ */ l("button", { type: "button", className: x, style: s, onClick: t, children: B }) : /* @__PURE__ */ l("div", { className: x, style: s, children: B });
14024
+ return t ? /* @__PURE__ */ l("button", { type: "button", className: P, style: s, onClick: t, children: B }) : /* @__PURE__ */ l("div", { className: P, style: s, children: B });
14018
14025
  }, Fc = ({
14019
14026
  children: t,
14020
14027
  delay: e = 200,
@@ -14025,7 +14032,7 @@ const nu = ({
14025
14032
  block: o = !1,
14026
14033
  className: i
14027
14034
  }) => {
14028
- const { isOutdatedBilling: d, analytics: c, locale: u } = re(), { t: m } = ge(), { data: h } = Xt({ period: r, enabled: !d }), { data: g } = Ve({ enabled: !d }), { data: b } = rt(), [C, _] = J(!1), v = rn(null), N = () => {
14035
+ const { isOutdatedBilling: d, analytics: c, locale: u } = ne(), { t: m } = ge(), { data: h } = Xt({ period: r, enabled: !d }), { data: g } = $e({ enabled: !d }), { data: b } = rt(), [C, _] = J(!1), v = rn(null), N = () => {
14029
14036
  v.current && (clearTimeout(v.current), v.current = null);
14030
14037
  };
14031
14038
  Oe(() => N, []);
@@ -14071,7 +14078,7 @@ const nu = ({
14071
14078
  /* @__PURE__ */ l("span", { className: "bpb-usage-pop__period", children: m("usagePopoverTitle", { date: V }) })
14072
14079
  ] }) }),
14073
14080
  I.map((B) => {
14074
- const x = B.pct > 0 ? Math.max(5, B.pct) : 0;
14081
+ const P = B.pct > 0 ? Math.max(5, B.pct) : 0;
14075
14082
  return /* @__PURE__ */ p("span", { className: "bpb-usage-pop__item", children: [
14076
14083
  /* @__PURE__ */ p("span", { className: "bpb-usage-pop__head", children: [
14077
14084
  /* @__PURE__ */ l("span", { className: "bpb-usage-pop__name", children: uo(B.key, m) }),
@@ -14085,7 +14092,7 @@ const nu = ({
14085
14092
  "span",
14086
14093
  {
14087
14094
  className: j("bpb-usage-pop__fill", `bpb-usage-pop__fill--${rr(B.pct)}`),
14088
- style: { width: `${x}%` }
14095
+ style: { width: `${P}%` }
14089
14096
  }
14090
14097
  ) })
14091
14098
  ] }, B.key);
@@ -14115,7 +14122,7 @@ const nu = ({
14115
14122
  className: d,
14116
14123
  ...c
14117
14124
  }) => {
14118
- const { isOutdatedBilling: u } = re(), { data: m } = Xt({ period: i, enabled: !u }), h = yn(m);
14125
+ const { isOutdatedBilling: u } = ne(), { data: m } = Xt({ period: i, enabled: !u }), h = yn(m);
14119
14126
  if (u || h.length === 0)
14120
14127
  return null;
14121
14128
  const g = h[0], b = rr(g.pct), C = g.pct > 0 ? Math.max(5, g.pct) : 0, _ = (t - e) / 2, v = 2 * Math.PI * _, N = v * (1 - C / 100), S = c["aria-label"] ?? `${Math.round(g.pct)}% of your ${g.label.toLowerCase()} used`, T = /* @__PURE__ */ p(Te, { children: [
@@ -14166,7 +14173,7 @@ const nu = ({
14166
14173
  children: /* @__PURE__ */ l("span", { className: "bpb-switch__thumb" })
14167
14174
  }
14168
14175
  ), Vr = "ai_spend", Bc = 5, Pn = (t) => (t ?? 0) / tt, Dn = (t) => Math.round(t * tt), Zr = (t) => Number.isInteger(t) && t >= Bc, Uc = (t, e) => Number.isInteger(t) && t >= 0 && e > 0 && t % e === 0, mu = ({ open: t, onOpenChange: e, onSuccess: a, onUpgrade: n }) => {
14169
- const { isOutdatedBilling: r } = re(), { t: s } = ge();
14176
+ const { isOutdatedBilling: r } = ne(), { t: s } = ge();
14170
14177
  return r ? /* @__PURE__ */ l(
14171
14178
  Fe,
14172
14179
  {
@@ -14183,32 +14190,31 @@ const nu = ({
14183
14190
  onSuccess: e,
14184
14191
  onUpgrade: a
14185
14192
  }) => {
14186
- const { toast: n, analytics: r } = re(), { t: s } = ge(), {
14193
+ const { toast: n, analytics: r } = ne(), { t: s } = ge(), {
14187
14194
  data: o,
14188
14195
  isLoading: i,
14189
14196
  isError: d,
14190
14197
  refetch: c
14191
- } = Ve(), { data: u, isLoading: m, isError: h, refetch: g } = rt(), {
14198
+ } = $e(), { data: u, isLoading: m, isError: h, refetch: g } = rt(), {
14192
14199
  data: b,
14193
14200
  isLoading: C,
14194
14201
  isError: _,
14195
14202
  refetch: v
14196
14203
  } = is(), N = Li(), [S, T] = J(null), [I, k] = J(!1), [A, w] = J(!1), [E, L] = J(!1), O = i || m || C, Z = d || h || _, V = () => {
14197
14204
  c(), g(), v();
14198
- }, $ = u == null ? void 0 : u.find((pe) => pe.id === (o == null ? void 0 : o.plan.current.planId)), B = o ? $ ? _e($) === "community" : !0 : !1, x = b == null ? void 0 : b[Vr], H = Re(() => {
14199
- const pe = (x == null ? void 0 : x.maxAmount) != null, fe = (x == null ? void 0 : x.targetType) === "credit_grant" && (x == null ? void 0 : x.thresholdType) === "remaining_amount" ? x == null ? void 0 : x.threshold : null;
14205
+ }, $ = u == null ? void 0 : u.find((pe) => pe.id === (o == null ? void 0 : o.plan.current.planId)), B = o ? $ ? _e($) === "community" : !0 : !1, P = b == null ? void 0 : b[Vr], H = Re(() => {
14206
+ const pe = (P == null ? void 0 : P.maxAmount) != null, fe = (P == null ? void 0 : P.targetType) === "credit_grant" && (P == null ? void 0 : P.thresholdType) === "remaining_amount" ? P == null ? void 0 : P.threshold : null;
14200
14207
  return {
14201
14208
  thresholdInput: fe != null ? String(Math.round(Pn(fe))) : "",
14202
- chunkInput: (x == null ? void 0 : x.chunkSize) != null ? String(Math.round(Pn(x.chunkSize))) : "",
14203
- limitInput: (x == null ? void 0 : x.maxAmount) != null ? String(Math.round(Pn(x.maxAmount))) : "",
14209
+ chunkInput: (P == null ? void 0 : P.chunkSize) != null ? String(Math.round(Pn(P.chunkSize))) : "",
14210
+ limitInput: (P == null ? void 0 : P.maxAmount) != null ? String(Math.round(Pn(P.maxAmount))) : "",
14204
14211
  hasLimit: pe
14205
14212
  };
14206
- }, [x]), W = S ?? H, X = (pe) => T({ ...W, ...pe }), D = Number(W.thresholdInput), ue = Number(W.chunkInput), ee = Number(W.limitInput), ce = W.thresholdInput.trim() !== "" && Zr(D), M = Zr(ue), K = !W.hasLimit || W.limitInput.trim() !== "" && Uc(ee, ue), G = I && !ce, P = A && !M, be = E && !K, te = W.thresholdInput !== H.thresholdInput || W.chunkInput !== H.chunkInput || W.limitInput !== H.limitInput || W.hasLimit !== H.hasLimit, de = () => {
14213
+ }, [P]), W = S ?? H, X = (pe) => T({ ...W, ...pe }), D = Number(W.thresholdInput), ue = Number(W.chunkInput), ee = Number(W.limitInput), ce = W.thresholdInput.trim() !== "" && Zr(D), M = Zr(ue), K = !W.hasLimit || W.limitInput.trim() !== "" && Uc(ee, ue), G = I && !ce, x = A && !M, be = E && !K, te = W.thresholdInput !== H.thresholdInput || W.chunkInput !== H.chunkInput || W.limitInput !== H.limitInput || W.hasLimit !== H.hasLimit, de = () => {
14207
14214
  N.mutate(
14208
14215
  {
14209
14216
  settings: {
14210
14217
  [Vr]: {
14211
- enabled: (x == null ? void 0 : x.enabled) ?? !1,
14212
14218
  targetType: "credit_grant",
14213
14219
  thresholdType: "remaining_amount",
14214
14220
  threshold: Dn(D),
@@ -14302,7 +14308,7 @@ const nu = ({
14302
14308
  {
14303
14309
  className: j(
14304
14310
  "bpb-auto-recharge-dialog__panel",
14305
- P && "bpb-auto-recharge-dialog__panel--invalid"
14311
+ x && "bpb-auto-recharge-dialog__panel--invalid"
14306
14312
  ),
14307
14313
  children: [
14308
14314
  /* @__PURE__ */ l("label", { className: "bpb-auto-recharge-dialog__amount-label", htmlFor: "auto-recharge-chunk", children: s("autoRechargeChunkLabel") }),
@@ -14331,9 +14337,9 @@ const nu = ({
14331
14337
  {
14332
14338
  className: j(
14333
14339
  "bpb-auto-recharge-dialog__hint",
14334
- P && "bpb-auto-recharge-dialog__hint--error"
14340
+ x && "bpb-auto-recharge-dialog__hint--error"
14335
14341
  ),
14336
- children: s(P ? "autoRechargeChunkError" : "autoRechargeChunkHint")
14342
+ children: s(x ? "autoRechargeChunkError" : "autoRechargeChunkHint")
14337
14343
  }
14338
14344
  )
14339
14345
  ] }),
@@ -14405,7 +14411,7 @@ const nu = ({
14405
14411
  ] }) })
14406
14412
  }
14407
14413
  ),
14408
- !(x != null && x.enabled) && (x == null ? void 0 : x.disabledReason) && /* @__PURE__ */ l("p", { className: "bpb-auto-recharge-dialog__disabled-note", role: "alert", children: s("autoRechargeDisabledReason", { reason: x.disabledReason }) }),
14414
+ !(P != null && P.enabled) && (P == null ? void 0 : P.disabledReason) && /* @__PURE__ */ l("p", { className: "bpb-auto-recharge-dialog__disabled-note", role: "alert", children: s("autoRechargeDisabledReason", { reason: P.disabledReason }) }),
14409
14415
  /* @__PURE__ */ p("div", { className: "bpb-auto-recharge-dialog__actions", children: [
14410
14416
  /* @__PURE__ */ l(ke, { variant: "outline", onClick: () => t(!1), disabled: N.isPending, children: s("cancel") }),
14411
14417
  /* @__PURE__ */ l(
@@ -14491,7 +14497,7 @@ export {
14491
14497
  ja as addonDisplayName,
14492
14498
  Ll as addonLimitsPreview,
14493
14499
  Wn as addonPrice,
14494
- Ae as billingKeys,
14500
+ Ie as billingKeys,
14495
14501
  j as cn,
14496
14502
  Gn as conversationPackPrice,
14497
14503
  El as conversationsAddon,
@@ -14514,7 +14520,7 @@ export {
14514
14520
  rr as usageTier,
14515
14521
  Qt as useAddons,
14516
14522
  is as useAutoRechargeSettings,
14517
- re as useBilling,
14523
+ ne as useBilling,
14518
14524
  os as useBillingReadonly,
14519
14525
  ls as useCreatePaymentMethodIntent,
14520
14526
  ss as useCustomer,
@@ -14527,7 +14533,7 @@ export {
14527
14533
  cs as useSetCustomer,
14528
14534
  ds as useSetPaymentMethod,
14529
14535
  us as useSetSubscription,
14530
- Ve as useSubscription,
14536
+ $e as useSubscription,
14531
14537
  ns as useSubscriptionPreview,
14532
14538
  Fi as useSupportsUsageByBot,
14533
14539
  Xt as useUsage,