@schematichq/schematic-components 0.4.0-rc.3 → 0.4.0-rc.4

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.
@@ -2097,7 +2097,7 @@ __export(src_exports, {
2097
2097
  module.exports = __toCommonJS(src_exports);
2098
2098
 
2099
2099
  // src/components/elements/included-features/IncludedFeatures.tsx
2100
- var import_react15 = require("react");
2100
+ var import_react16 = require("react");
2101
2101
 
2102
2102
  // node_modules/styled-components/node_modules/tslib/tslib.es6.mjs
2103
2103
  var __assign = function() {
@@ -8012,6 +8012,31 @@ function BillingPriceResponseDataFromJSONTyped(json, ignoreDiscriminator) {
8012
8012
  };
8013
8013
  }
8014
8014
 
8015
+ // src/api/models/BillingPriceView.ts
8016
+ function BillingPriceViewFromJSON(json) {
8017
+ return BillingPriceViewFromJSONTyped(json, false);
8018
+ }
8019
+ function BillingPriceViewFromJSONTyped(json, ignoreDiscriminator) {
8020
+ if (json == null) {
8021
+ return json;
8022
+ }
8023
+ return {
8024
+ createdAt: new Date(json["created_at"]),
8025
+ currency: json["currency"],
8026
+ id: json["id"],
8027
+ interval: json["interval"],
8028
+ meterId: json["meter_id"] == null ? void 0 : json["meter_id"],
8029
+ price: json["price"],
8030
+ priceExternalId: json["price_external_id"],
8031
+ priceId: json["price_id"],
8032
+ productExternalId: json["product_external_id"],
8033
+ productId: json["product_id"],
8034
+ productName: json["product_name"],
8035
+ updatedAt: new Date(json["updated_at"]),
8036
+ usageType: json["usage_type"]
8037
+ };
8038
+ }
8039
+
8015
8040
  // src/api/models/BillingProductDetailResponseData.ts
8016
8041
  function BillingProductDetailResponseDataFromJSON(json) {
8017
8042
  return BillingProductDetailResponseDataFromJSONTyped(json, false);
@@ -8084,7 +8109,8 @@ function BillingSubscriptionResponseDataFromJSONTyped(json, ignoreDiscriminator)
8084
8109
  periodStart: json["period_start"],
8085
8110
  status: json["status"],
8086
8111
  subscriptionExternalId: json["subscription_external_id"],
8087
- totalPrice: json["total_price"]
8112
+ totalPrice: json["total_price"],
8113
+ trialEnd: json["trial_end"] == null ? void 0 : json["trial_end"]
8088
8114
  };
8089
8115
  }
8090
8116
 
@@ -8173,7 +8199,8 @@ function BillingSubscriptionViewFromJSONTyped(json, ignoreDiscriminator) {
8173
8199
  ),
8174
8200
  status: json["status"],
8175
8201
  subscriptionExternalId: json["subscription_external_id"],
8176
- totalPrice: json["total_price"]
8202
+ totalPrice: json["total_price"],
8203
+ trialEnd: json["trial_end"] == null ? void 0 : json["trial_end"]
8177
8204
  };
8178
8205
  }
8179
8206
 
@@ -8608,10 +8635,12 @@ function PlanEntitlementResponseDataFromJSONTyped(json, ignoreDiscriminator) {
8608
8635
  feature: json["feature"] == null ? void 0 : FeatureResponseDataFromJSON(json["feature"]),
8609
8636
  featureId: json["feature_id"],
8610
8637
  id: json["id"],
8638
+ meteredPrice: json["metered_price"] == null ? void 0 : BillingPriceViewFromJSON(json["metered_price"]),
8611
8639
  metricPeriod: json["metric_period"] == null ? void 0 : json["metric_period"],
8612
8640
  metricPeriodMonthReset: json["metric_period_month_reset"] == null ? void 0 : json["metric_period_month_reset"],
8613
8641
  plan: json["plan"] == null ? void 0 : PlanResponseDataFromJSON(json["plan"]),
8614
8642
  planId: json["plan_id"],
8643
+ priceBehavior: json["price_behavior"] == null ? void 0 : json["price_behavior"],
8615
8644
  ruleId: json["rule_id"],
8616
8645
  updatedAt: new Date(json["updated_at"]),
8617
8646
  valueBool: json["value_bool"] == null ? void 0 : json["value_bool"],
@@ -8646,6 +8675,7 @@ function CompanyPlanDetailResponseDataFromJSONTyped(json, ignoreDiscriminator) {
8646
8675
  icon: json["icon"],
8647
8676
  id: json["id"],
8648
8677
  isDefault: json["is_default"],
8678
+ isFree: json["is_free"],
8649
8679
  isTrialable: json["is_trialable"],
8650
8680
  monthlyPrice: json["monthly_price"] == null ? void 0 : BillingPriceResponseDataFromJSON(json["monthly_price"]),
8651
8681
  name: json["name"],
@@ -9718,7 +9748,7 @@ var EmbedProvider = ({
9718
9748
  (0, import_react3.useEffect)(() => {
9719
9749
  if (accessToken) {
9720
9750
  const { headers = {} } = apiConfig ?? {};
9721
- headers["X-Schematic-Components-Version"] = "0.4.0-rc.3";
9751
+ headers["X-Schematic-Components-Version"] = "0.4.0-rc.4";
9722
9752
  headers["X-Schematic-Session-ID"] = sessionIdRef.current;
9723
9753
  const config = new Configuration({
9724
9754
  ...apiConfig,
@@ -9999,7 +10029,7 @@ var Root = (0, import_react7.forwardRef)(
9999
10029
  Root.displayName = "Root";
10000
10030
 
10001
10031
  // src/components/layout/viewport/Viewport.tsx
10002
- var import_react12 = require("react");
10032
+ var import_react13 = require("react");
10003
10033
 
10004
10034
  // src/components/ui/box/styles.ts
10005
10035
  var Box = dt.div((props) => {
@@ -10387,7 +10417,7 @@ var Loader = dt.div`
10387
10417
  border-top-color: ${({ theme, $color }) => $color || theme.primary};
10388
10418
  border-radius: 50%;
10389
10419
  transition: all 0.1s;
10390
- animation: ${spin} 1.5s linear infinite;
10420
+ animation: 1.5s linear infinite ${spin};
10391
10421
 
10392
10422
  ${({ $size = "md", $isLoading = true }) => {
10393
10423
  let px;
@@ -10445,82 +10475,79 @@ var Container2 = dt(Box)`
10445
10475
 
10446
10476
  // src/components/ui/modal/Modal.tsx
10447
10477
  var import_jsx_runtime6 = require("react/jsx-runtime");
10448
- var Modal = ({
10449
- children,
10450
- contentRef,
10451
- size = "auto",
10452
- top = 0,
10453
- onClose,
10454
- ...rest
10455
- }) => {
10456
- const theme = nt();
10457
- const { setLayout } = useEmbed();
10458
- const isLightBackground = useIsLightBackground();
10459
- const handleClose = (0, import_react9.useCallback)(() => {
10460
- setLayout("portal");
10461
- onClose?.();
10462
- }, [setLayout, onClose]);
10463
- return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
10464
- Container2,
10465
- {
10466
- tabIndex: 0,
10467
- onClick: (event) => {
10468
- if (event.target === event.currentTarget) {
10469
- handleClose();
10470
- }
10471
- },
10472
- onKeyDown: (event) => {
10473
- if (event.key === "Escape") {
10474
- handleClose();
10475
- }
10476
- },
10477
- ...rest,
10478
- $position: "absolute",
10479
- $top: "50%",
10480
- $left: "50%",
10481
- $zIndex: "999999",
10482
- $transform: "translate(-50%, -50%)",
10483
- $width: "100%",
10484
- $height: "100%",
10485
- $marginTop: `${top}px`,
10486
- $backgroundColor: isLightBackground ? "hsla(0, 0%, 85%, 0.8)" : "hsla(0, 0%, 0%, 0.8)",
10487
- $overflow: "hidden",
10488
- $scrollbarColor: `${isLightBackground ? "hsla(0, 0%, 0%, 0.15)" : "hsla(0, 0%, 100%, 0.15)"} transparent`,
10489
- $scrollbarWidth: "thin",
10490
- $scrollbarGutter: "stable both-edges",
10491
- children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
10492
- Flex,
10493
- {
10494
- ref: contentRef,
10495
- $position: "relative",
10496
- $top: "50%",
10497
- $left: "50%",
10498
- $transform: "translate(-50%, -50%)",
10499
- $flexDirection: "column",
10500
- $overflow: "auto",
10501
- $width: "100%",
10502
- $height: "100vh",
10503
- $backgroundColor: theme.card.background,
10504
- $boxShadow: "0px 1px 20px 0px #1018280F, 0px 1px 3px 0px #1018281A;",
10505
- role: "dialog",
10506
- "aria-modal": "true",
10507
- $viewport: {
10508
- sm: {
10509
- ...size === "auto" ? { $width: "fit-content", $height: "fit-content" } : {
10510
- $width: "100%",
10511
- ...size === "lg" ? { $height: "100%" } : { $height: "fit-content" },
10512
- $maxWidth: size === "sm" ? "480px" : size === "md" ? "688px" : "1356px",
10513
- $maxHeight: "860px"
10514
- },
10515
- $borderRadius: "0.5rem"
10516
- }
10517
- },
10518
- children
10519
- }
10520
- )
10521
- }
10522
- );
10523
- };
10478
+ var Modal = (0, import_react9.forwardRef)(
10479
+ ({ children, contentRef, size = "auto", top = 0, onClose, ...rest }, ref) => {
10480
+ const theme = nt();
10481
+ const { setLayout } = useEmbed();
10482
+ const isLightBackground = useIsLightBackground();
10483
+ const handleClose = (0, import_react9.useCallback)(() => {
10484
+ setLayout("portal");
10485
+ onClose?.();
10486
+ }, [setLayout, onClose]);
10487
+ return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
10488
+ Container2,
10489
+ {
10490
+ ref,
10491
+ tabIndex: 0,
10492
+ onClick: (event) => {
10493
+ if (event.target === event.currentTarget) {
10494
+ handleClose();
10495
+ }
10496
+ },
10497
+ onKeyDown: (event) => {
10498
+ if (event.key === "Escape") {
10499
+ handleClose();
10500
+ }
10501
+ },
10502
+ ...rest,
10503
+ $position: "absolute",
10504
+ $top: "50%",
10505
+ $left: "50%",
10506
+ $zIndex: "999999",
10507
+ $transform: "translate(-50%, -50%)",
10508
+ $width: "100%",
10509
+ $height: "100%",
10510
+ $marginTop: `${top}px`,
10511
+ $backgroundColor: isLightBackground ? "hsla(0, 0%, 85%, 0.8)" : "hsla(0, 0%, 0%, 0.8)",
10512
+ $overflow: "hidden",
10513
+ $scrollbarColor: `${isLightBackground ? "hsla(0, 0%, 0%, 0.15)" : "hsla(0, 0%, 100%, 0.15)"} transparent`,
10514
+ $scrollbarWidth: "thin",
10515
+ $scrollbarGutter: "stable both-edges",
10516
+ children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
10517
+ Flex,
10518
+ {
10519
+ ref: contentRef,
10520
+ $position: "relative",
10521
+ $top: "50%",
10522
+ $left: "50%",
10523
+ $transform: "translate(-50%, -50%)",
10524
+ $flexDirection: "column",
10525
+ $overflow: "auto",
10526
+ $width: "100%",
10527
+ $height: "100vh",
10528
+ $backgroundColor: theme.card.background,
10529
+ $boxShadow: "0px 1px 20px 0px #1018280F, 0px 1px 3px 0px #1018281A;",
10530
+ role: "dialog",
10531
+ "aria-modal": "true",
10532
+ $viewport: {
10533
+ md: {
10534
+ ...size === "auto" ? { $width: "fit-content", $height: "fit-content" } : {
10535
+ $width: "100%",
10536
+ ...size === "lg" ? { $height: "100%" } : { $height: "fit-content" },
10537
+ $maxWidth: size === "sm" ? "480px" : size === "md" ? "688px" : "1356px",
10538
+ $maxHeight: "860px"
10539
+ },
10540
+ $borderRadius: "0.5rem"
10541
+ }
10542
+ },
10543
+ children
10544
+ }
10545
+ )
10546
+ }
10547
+ );
10548
+ }
10549
+ );
10550
+ Modal.displayName = "Modal";
10524
10551
 
10525
10552
  // src/components/ui/modal/ModalHeader.tsx
10526
10553
  var import_react10 = require("react");
@@ -10557,7 +10584,7 @@ var ModalHeader = ({
10557
10584
  $borderBottomColor: isLightBackground ? "hsla(0, 0%, 0%, 0.15)" : "hsla(0, 0%, 100%, 0.15)"
10558
10585
  },
10559
10586
  $viewport: {
10560
- sm: {
10587
+ md: {
10561
10588
  $height: "5rem",
10562
10589
  $padding: "0 1.5rem 0 3rem"
10563
10590
  }
@@ -10686,35 +10713,126 @@ var Text = dt.span.attrs(({ onClick }) => ({
10686
10713
  `}
10687
10714
  `;
10688
10715
 
10716
+ // src/components/ui/tooltip/Tooltip.tsx
10717
+ var import_react11 = require("react");
10718
+ var import_react_dom = require("react-dom");
10719
+
10689
10720
  // src/components/ui/tooltip/styles.ts
10690
- var TooltipWrapper = dt(Box)`
10691
- position: relative;
10721
+ var Trigger = dt(Box)``;
10722
+ var coords = (position2) => {
10723
+ let x2 = 0;
10724
+ let y2 = 0;
10725
+ switch (position2) {
10726
+ case "top":
10727
+ x2 = -50;
10728
+ y2 = -100;
10729
+ break;
10730
+ case "right":
10731
+ x2 = 0;
10732
+ y2 = -50;
10733
+ break;
10734
+ case "bottom":
10735
+ x2 = -50;
10736
+ y2 = 0;
10737
+ break;
10738
+ case "left":
10739
+ x2 = -100;
10740
+ y2 = -50;
10741
+ break;
10742
+ }
10743
+ return { x: x2, y: y2 };
10744
+ };
10745
+ var arrowCoords = (position2) => {
10746
+ let x2 = 0;
10747
+ let y2 = 0;
10748
+ switch (position2) {
10749
+ case "top":
10750
+ x2 = -50;
10751
+ y2 = -50;
10752
+ break;
10753
+ case "right":
10754
+ x2 = 50;
10755
+ y2 = -50;
10756
+ break;
10757
+ case "bottom":
10758
+ x2 = -50;
10759
+ y2 = 50;
10760
+ break;
10761
+ case "left":
10762
+ x2 = -50;
10763
+ y2 = -50;
10764
+ break;
10765
+ }
10766
+ return { x: x2, y: y2 };
10767
+ };
10768
+ var origin = (position2) => {
10769
+ const o2 = {
10770
+ x: position2 === "top" ? "bottom" : position2 === "bottom" ? "top" : "center",
10771
+ y: position2 === "left" ? "right" : position2 === "right" ? "left" : "center"
10772
+ };
10773
+ return o2;
10774
+ };
10775
+ var grow = (translate) => {
10776
+ return mt`
10777
+ 0% {
10778
+ opacity: 0;
10779
+ transform: translate(${translate.x}%, ${translate.y}%) scale(0);
10780
+ }
10692
10781
 
10693
- .tooltip {
10782
+ 100% {
10783
+ opacity: 1;
10784
+ transform: translate(${translate.x}%, ${translate.y}%) scale(1);
10785
+ }
10786
+ `;
10787
+ };
10788
+ var Content = dt(Box).withConfig({
10789
+ shouldForwardProp: (prop) => !["x", "y", "position", "zIndex"].includes(prop)
10790
+ })(({ x: x2, y: y2, position: position2, zIndex }) => {
10791
+ const translate = coords(position2);
10792
+ const arrowTranslate = arrowCoords(position2);
10793
+ const transformOrigin = origin(position2);
10794
+ return lt`
10694
10795
  position: absolute;
10695
- left: 50%;
10696
- transform: translateX(-50%);
10697
- bottom: 100%;
10796
+ top: calc(
10797
+ ${y2}px -
10798
+ ${position2 === "top" ? 0.75 : position2 === "bottom" ? -0.75 : 0}rem
10799
+ );
10800
+ left: calc(
10801
+ ${x2}px -
10802
+ ${position2 === "left" ? 0.75 : position2 === "right" ? -0.75 : 0}rem
10803
+ );
10804
+ transform: translate(${translate.x}%, ${translate.y}%);
10805
+ z-index: ${zIndex};
10698
10806
  line-height: 1;
10699
10807
  width: max-content;
10700
10808
  max-width: 100%;
10701
- margin-bottom: 0.75rem;
10702
10809
  padding: ${1 / 1.15}rem 1rem;
10703
10810
  text-align: left;
10811
+ opacity: 0;
10704
10812
  background-color: ${({ theme }) => theme.card.background};
10705
10813
  border-radius: ${({ theme }) => `${theme.card.borderRadius / TEXT_BASE_SIZE}rem`};
10706
10814
  filter: drop-shadow(0px 1px 20px #1018280f)
10707
10815
  drop-shadow(0px 1px 3px #1018281a);
10708
- transition: opacity 0.1s 0.2s ease-in-out;
10709
- opacity: 0;
10710
- visibility: hidden;
10816
+ transform-origin: ${transformOrigin.x} ${transformOrigin.y};
10817
+ animation: 0.2s ease-in-out 0.1s both ${grow(translate)};
10711
10818
 
10712
10819
  &::after {
10713
10820
  position: absolute;
10714
10821
  z-index: 0;
10715
- top: 100%;
10716
- left: 50%;
10717
- transform: translate(-50%, -50%);
10822
+ ${position2 === "top" ? lt`
10823
+ top: 100%;
10824
+ left: 50%;
10825
+ ` : position2 === "right" ? lt`
10826
+ top: 50%;
10827
+ right: 100%;
10828
+ ` : position2 === "bottom" ? lt`
10829
+ bottom: 100%;
10830
+ left: 50%;
10831
+ ` : lt`
10832
+ top: 50%;
10833
+ left: 100%;
10834
+ `};
10835
+ transform: translate(${arrowTranslate.x}%, ${arrowTranslate.y}%);
10718
10836
  content: "";
10719
10837
  display: block;
10720
10838
  width: 1rem;
@@ -10722,22 +10840,54 @@ var TooltipWrapper = dt(Box)`
10722
10840
  clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%);
10723
10841
  background-color: ${({ theme }) => theme.card.background};
10724
10842
  }
10725
- }
10726
-
10727
- &:hover {
10728
- .tooltip {
10729
- opacity: 1;
10730
- visibility: visible;
10731
- }
10732
- }
10733
- `;
10843
+ `;
10844
+ });
10734
10845
 
10735
10846
  // src/components/ui/tooltip/Tooltip.tsx
10736
10847
  var import_jsx_runtime9 = require("react/jsx-runtime");
10737
- var Tooltip = ({ label, description, ...rest }) => {
10738
- return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(TooltipWrapper, { ...rest, children: [
10739
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Box, { children: label }),
10740
- /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Box, { className: "tooltip", children: description })
10848
+ var Tooltip = ({
10849
+ trigger,
10850
+ content,
10851
+ position: position2 = "top",
10852
+ zIndex = 1,
10853
+ ...rest
10854
+ }) => {
10855
+ const ref = (0, import_react11.useRef)(null);
10856
+ const [show, setShow] = (0, import_react11.useState)(false);
10857
+ const [coords2, setCoords] = (0, import_react11.useState)({ x: 0, y: 0 });
10858
+ (0, import_react11.useLayoutEffect)(() => {
10859
+ if (ref.current) {
10860
+ const { top: offsetTop, left: offsetLeft } = document.body.getBoundingClientRect();
10861
+ const rect = ref.current.getBoundingClientRect();
10862
+ let x2 = position2 === "left" ? rect.left : rect.right;
10863
+ if (position2 === "top" || position2 === "bottom") {
10864
+ x2 -= rect.width / 2;
10865
+ }
10866
+ let y2 = position2 === "top" ? rect.top : rect.bottom;
10867
+ if (position2 === "left" || position2 === "right") {
10868
+ y2 -= rect.height / 2;
10869
+ }
10870
+ setCoords({
10871
+ x: Math.round(x2 - offsetLeft),
10872
+ y: Math.round(y2 - offsetTop)
10873
+ });
10874
+ }
10875
+ }, [position2, trigger]);
10876
+ return /* @__PURE__ */ (0, import_jsx_runtime9.jsxs)(import_jsx_runtime9.Fragment, { children: [
10877
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(
10878
+ Trigger,
10879
+ {
10880
+ ref,
10881
+ onPointerEnter: () => setShow(true),
10882
+ onPointerLeave: () => setShow(false),
10883
+ ...rest,
10884
+ children: trigger
10885
+ }
10886
+ ),
10887
+ show && (0, import_react_dom.createPortal)(
10888
+ /* @__PURE__ */ (0, import_jsx_runtime9.jsx)(Content, { ...coords2, position: position2, zIndex, children: content }),
10889
+ document.body
10890
+ )
10741
10891
  ] });
10742
10892
  };
10743
10893
 
@@ -10745,101 +10895,109 @@ var Tooltip = ({ label, description, ...rest }) => {
10745
10895
  var import_jsx_runtime10 = require("react/jsx-runtime");
10746
10896
  var Badge = () => {
10747
10897
  const { settings } = useEmbed();
10748
- return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(Flex, { $justifyContent: settings.badge.alignment, $alignItems: "center", children: [
10749
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Box, { $fontSize: "0.75rem", $marginRight: "0.5rem", children: "Powered by" }),
10750
- /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
10751
- "svg",
10752
- {
10753
- width: 86,
10754
- height: 16,
10755
- viewBox: "0 0 86 16",
10756
- style: { marginTop: "0.125rem" },
10757
- children: [
10758
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
10759
- "path",
10760
- {
10761
- d: "M21.2354 6.16227C21.1796 5.95015 21.0494 5.76779 20.8261 5.61893C20.6028 5.46635 20.3423 5.39564 20.0408 5.39564C19.3151 5.39564 18.7941 5.69708 18.7941 6.2367C18.7941 6.49721 18.9095 6.69073 19.1402 6.81726C19.3635 6.94379 19.732 7.07033 20.2344 7.18569C21.0084 7.37177 21.4922 7.51691 21.9686 7.7402C22.203 7.85557 22.3928 7.97465 22.5305 8.10863C22.7948 8.3803 22.9548 8.74501 22.9362 9.20276C22.9176 9.86147 22.6571 10.375 22.1547 10.7397C21.6523 11.1082 20.9563 11.2905 20.0818 11.2905C19.2072 11.2905 18.5597 11.1268 18.0312 10.8067C17.5065 10.4867 17.2013 10.0215 17.1194 9.41116L18.6192 9.27719C18.6974 9.57491 18.8723 9.7982 19.1514 9.94706C19.4305 10.0959 19.7394 10.1778 20.0818 10.1778C20.4614 10.1778 20.7777 10.0996 21.0308 9.9359C21.2838 9.77959 21.4104 9.56002 21.4104 9.28835C21.4104 8.90876 21.0531 8.61104 20.5991 8.43613C20.3683 8.35053 20.0855 8.27238 19.7468 8.19423C19.2705 8.07886 18.8946 7.97094 18.6155 7.87418C18.3364 7.78486 18.0908 7.66205 17.8712 7.51319C17.4358 7.21547 17.2832 6.8247 17.2832 6.2367C17.2832 5.61521 17.5325 5.13141 18.0312 4.79648C18.5262 4.46526 19.2035 4.29407 20.0669 4.29407C21.5853 4.29407 22.5752 4.9044 22.7389 6.05807L21.228 6.16227H21.2354Z",
10762
- fill: "currentColor"
10763
- }
10764
- ),
10765
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
10766
- "path",
10767
- {
10768
- d: "M29.4145 8.9796L30.7803 9.55271C30.49 10.0923 30.0621 10.5129 29.5001 10.8217C28.9382 11.1344 28.3167 11.2944 27.6319 11.2944C26.9472 11.2944 26.3629 11.1567 25.8121 10.8701C25.2613 10.5873 24.8147 10.1742 24.4835 9.6383C24.1523 9.09868 23.9811 8.48835 23.9811 7.79987C23.9811 7.11138 24.1486 6.49361 24.4835 5.95771C24.8147 5.41809 25.2613 5.00873 25.8121 4.72589C26.3629 4.44305 26.9732 4.30164 27.6319 4.30164C28.2906 4.30164 28.9382 4.45794 29.5038 4.77427C30.0658 5.08688 30.4938 5.51113 30.7803 6.05075L29.4145 6.62015C29.0535 5.93539 28.3985 5.56323 27.6319 5.56323C27.0327 5.56323 26.5303 5.77536 26.1135 6.19961C25.6967 6.62387 25.492 7.15977 25.492 7.80731C25.492 8.45486 25.6967 8.99076 26.1135 9.40757C26.5303 9.83182 27.0327 10.0439 27.6319 10.0439C28.3985 10.0439 29.0535 9.66807 29.4145 8.98703V8.9796Z",
10769
- fill: "currentColor"
10770
- }
10771
- ),
10772
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
10773
- "path",
10774
- {
10775
- d: "M37.4386 11.2049V7.80341C37.4386 6.35945 36.9139 5.59282 35.697 5.59282C35.0978 5.59282 34.614 5.7975 34.2419 6.21059C33.8623 6.61996 33.6725 7.15214 33.6725 7.80713V11.2086H32.1615V1.9234H33.6725V5.47745C34.1004 4.73315 35.001 4.29773 36.1919 4.29773C37.167 4.29773 37.8666 4.59917 38.302 5.19834C38.7375 5.7975 38.9533 6.66834 38.9533 7.80341V11.2049H37.4349H37.4386Z",
10776
- fill: "currentColor"
10777
- }
10778
- ),
10779
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
10780
- "path",
10781
- {
10782
- d: "M46.5692 5.38819C47.2167 6.07295 47.5777 7.1187 47.5107 8.30587H41.8242C41.9284 8.83805 42.1741 9.26602 42.5611 9.59352C42.9481 9.92473 43.4022 10.0885 43.9157 10.0885C44.8052 10.0885 45.5234 9.59724 45.8844 8.78222L47.1795 9.40372C46.8818 9.99172 46.4352 10.4495 45.8509 10.7881C45.2629 11.1268 44.6191 11.2943 43.9157 11.2943C42.9295 11.2943 42.0178 10.9444 41.3516 10.3453C40.6855 9.7461 40.2649 8.83432 40.2649 7.79602C40.2649 6.75771 40.6892 5.84222 41.3516 5.23933C42.0178 4.64017 42.9295 4.29034 43.9157 4.29034C44.9801 4.29034 45.9216 4.69971 46.5692 5.38447V5.38819ZM42.5388 6.00224C42.1592 6.32974 41.921 6.75772 41.8205 7.29734H46.0221C45.9179 6.75772 45.6835 6.3223 45.3039 5.99852C44.9243 5.67847 44.4628 5.51473 43.9195 5.51473C43.3761 5.51473 42.9221 5.67847 42.5425 6.00597L42.5388 6.00224Z",
10783
- fill: "currentColor"
10784
- }
10785
- ),
10786
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
10787
- "path",
10788
- {
10789
- d: "M59.7699 5.23933C60.1495 5.86827 60.3132 6.68329 60.3132 7.80347V11.2049H58.8023V7.80347C58.8023 6.35952 58.3371 5.59288 57.2318 5.59288C56.6438 5.59288 56.1861 5.79384 55.8586 6.19577C55.5311 6.60141 55.3673 7.13731 55.3673 7.80347V11.2049H53.8489V7.80347C53.8489 6.35952 53.3838 5.59288 52.2785 5.59288C51.6905 5.59288 51.2327 5.79384 50.9052 6.19577C50.574 6.60141 50.4102 7.13731 50.4102 7.80347V11.2049H48.8993V4.39827H50.3433L50.4102 5.47379C50.8196 4.65878 51.5825 4.29407 52.8106 4.29407C53.9606 4.29407 54.7161 4.78531 55.077 5.76407C55.5199 4.81508 56.4428 4.29407 57.7677 4.29407C58.7093 4.29407 59.3829 4.61412 59.7699 5.23562V5.23933Z",
10790
- fill: "currentColor"
10791
- }
10792
- ),
10793
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
10794
- "path",
10795
- {
10796
- d: "M67.4264 5.47382L67.4934 4.3983H68.9373V11.205H67.4934L67.4264 10.1294C67.0282 10.9147 66.1797 11.3092 64.8809 11.3017C63.102 11.3427 61.591 9.79823 61.6283 7.8035C61.591 5.8162 63.102 4.2606 64.8809 4.29782C66.0643 4.29782 67.0096 4.7444 67.4264 5.47754V5.47382ZM66.8049 9.37398C67.2217 8.95717 67.4264 8.43243 67.4264 7.79605C67.4264 7.15967 67.2217 6.64238 66.8049 6.21813C66.3881 5.80132 65.8782 5.58919 65.2828 5.58919C64.6874 5.58919 64.1887 5.80132 63.7719 6.21813C63.355 6.64238 63.1504 7.16711 63.1504 7.79605C63.1504 8.42499 63.355 8.95717 63.7719 9.37398C64.1887 9.79823 64.6911 10.0104 65.2828 10.0104C65.8745 10.0104 66.3881 9.79823 66.8049 9.37398Z",
10797
- fill: "currentColor"
10798
- }
10799
- ),
10800
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
10801
- "path",
10802
- {
10803
- d: "M71.3891 2.85757H72.8926V4.39828H74.6455V5.58172H72.8926V8.9683C72.8926 9.5898 73.1048 9.90985 73.5923 9.96568C73.89 10.0252 74.2398 10.0141 74.6455 9.9359V11.1863C74.1989 11.257 73.7858 11.2943 73.4062 11.2943C72.6731 11.2943 72.1595 11.1082 71.8543 10.7323C71.5454 10.3639 71.3891 9.79076 71.3891 9.02041V5.58172H70.4215V4.39828H71.3891V2.85757Z",
10804
- fill: "currentColor"
10805
- }
10806
- ),
10807
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
10808
- "path",
10809
- {
10810
- d: "M76.1747 3.15526C75.9923 2.98035 75.903 2.76078 75.903 2.50772C75.903 2.25466 75.9923 2.04997 76.1747 1.86762C76.3496 1.69271 76.5691 1.60339 76.8222 1.60339C77.0753 1.60339 77.2874 1.69271 77.4623 1.86762C77.6372 2.04997 77.7265 2.2621 77.7265 2.50772C77.7265 2.75334 77.6372 2.97291 77.4623 3.15526C77.2874 3.33762 77.0678 3.42694 76.8222 3.42694C76.5766 3.42694 76.3496 3.33762 76.1747 3.15526ZM76.0593 4.39826H77.5777V11.2049H76.0593V4.39826Z",
10811
- fill: "currentColor"
10812
- }
10813
- ),
10814
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
10815
- "path",
10816
- {
10817
- d: "M84.3023 8.9796L85.6681 9.55271C85.3778 10.0923 84.9498 10.5129 84.3879 10.8217C83.8259 11.1344 83.2044 11.2944 82.5197 11.2944C81.8349 11.2944 81.2506 11.1567 80.6998 10.8701C80.1491 10.5873 79.7025 10.1742 79.3713 9.6383C79.04 9.09868 78.8689 8.48835 78.8689 7.79987C78.8689 7.11138 79.0363 6.49361 79.3713 5.95771C79.7025 5.41809 80.1528 5.00873 80.6998 4.72589C81.2469 4.44305 81.8609 4.30164 82.5197 4.30164C83.1784 4.30164 83.8259 4.45794 84.3916 4.77427C84.9535 5.08688 85.3815 5.51113 85.6681 6.05075L84.3023 6.62015C83.9413 5.93539 83.2863 5.56323 82.5197 5.56323C81.9205 5.56323 81.4181 5.77536 81.0013 6.19961C80.5845 6.62387 80.3798 7.15977 80.3798 7.80731C80.3798 8.45486 80.5845 8.99076 81.0013 9.40757C81.4181 9.83182 81.9205 10.0439 82.5197 10.0439C83.2863 10.0439 83.9413 9.66807 84.3023 8.98703V8.9796Z",
10818
- fill: "currentColor"
10819
- }
10820
- ),
10821
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
10822
- "path",
10823
- {
10824
- d: "M5.93091 10.8141L7.2758 9.41753L3.83719 5.84667C2.98568 4.9624 2.98568 3.52157 3.83719 2.63731C4.68871 1.75305 6.07617 1.75305 6.92769 2.63731L10.3663 6.20817L11.7112 4.81156L8.27258 1.24069C6.67975 -0.413401 4.08513 -0.413401 2.4923 1.24069C0.899472 2.89479 0.899472 5.58919 2.4923 7.24328L5.93091 10.8141Z",
10825
- fill: "currentColor"
10826
- }
10827
- ),
10828
- /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
10829
- "path",
10830
- {
10831
- d: "M6.05827 3.54751C5.68761 3.1626 5.08404 3.1626 4.71338 3.54751C4.34272 3.93243 4.34272 4.55921 4.71338 4.94413L9.02103 9.41746L5.93054 12.6268L1.62288 8.15349C1.25223 7.76857 0.648653 7.76857 0.277994 8.15349C-0.0926647 8.5384 -0.0926647 9.16519 0.277994 9.5501L5.93054 15.4201L11.7108 9.41746L6.05827 3.54751Z",
10832
- fill: "currentColor"
10833
- }
10834
- )
10835
- ]
10836
- }
10837
- )
10838
- ] });
10898
+ return /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
10899
+ Flex,
10900
+ {
10901
+ $justifyContent: settings.badge.alignment,
10902
+ $alignItems: "center",
10903
+ $gridColumn: "1 / -1",
10904
+ children: [
10905
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Box, { $fontSize: "0.75rem", $marginRight: "0.5rem", children: "Powered by" }),
10906
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)(
10907
+ "svg",
10908
+ {
10909
+ width: 86,
10910
+ height: 16,
10911
+ viewBox: "0 0 86 16",
10912
+ style: { marginTop: "0.125rem" },
10913
+ children: [
10914
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
10915
+ "path",
10916
+ {
10917
+ d: "M21.2354 6.16227C21.1796 5.95015 21.0494 5.76779 20.8261 5.61893C20.6028 5.46635 20.3423 5.39564 20.0408 5.39564C19.3151 5.39564 18.7941 5.69708 18.7941 6.2367C18.7941 6.49721 18.9095 6.69073 19.1402 6.81726C19.3635 6.94379 19.732 7.07033 20.2344 7.18569C21.0084 7.37177 21.4922 7.51691 21.9686 7.7402C22.203 7.85557 22.3928 7.97465 22.5305 8.10863C22.7948 8.3803 22.9548 8.74501 22.9362 9.20276C22.9176 9.86147 22.6571 10.375 22.1547 10.7397C21.6523 11.1082 20.9563 11.2905 20.0818 11.2905C19.2072 11.2905 18.5597 11.1268 18.0312 10.8067C17.5065 10.4867 17.2013 10.0215 17.1194 9.41116L18.6192 9.27719C18.6974 9.57491 18.8723 9.7982 19.1514 9.94706C19.4305 10.0959 19.7394 10.1778 20.0818 10.1778C20.4614 10.1778 20.7777 10.0996 21.0308 9.9359C21.2838 9.77959 21.4104 9.56002 21.4104 9.28835C21.4104 8.90876 21.0531 8.61104 20.5991 8.43613C20.3683 8.35053 20.0855 8.27238 19.7468 8.19423C19.2705 8.07886 18.8946 7.97094 18.6155 7.87418C18.3364 7.78486 18.0908 7.66205 17.8712 7.51319C17.4358 7.21547 17.2832 6.8247 17.2832 6.2367C17.2832 5.61521 17.5325 5.13141 18.0312 4.79648C18.5262 4.46526 19.2035 4.29407 20.0669 4.29407C21.5853 4.29407 22.5752 4.9044 22.7389 6.05807L21.228 6.16227H21.2354Z",
10918
+ fill: "currentColor"
10919
+ }
10920
+ ),
10921
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
10922
+ "path",
10923
+ {
10924
+ d: "M29.4145 8.9796L30.7803 9.55271C30.49 10.0923 30.0621 10.5129 29.5001 10.8217C28.9382 11.1344 28.3167 11.2944 27.6319 11.2944C26.9472 11.2944 26.3629 11.1567 25.8121 10.8701C25.2613 10.5873 24.8147 10.1742 24.4835 9.6383C24.1523 9.09868 23.9811 8.48835 23.9811 7.79987C23.9811 7.11138 24.1486 6.49361 24.4835 5.95771C24.8147 5.41809 25.2613 5.00873 25.8121 4.72589C26.3629 4.44305 26.9732 4.30164 27.6319 4.30164C28.2906 4.30164 28.9382 4.45794 29.5038 4.77427C30.0658 5.08688 30.4938 5.51113 30.7803 6.05075L29.4145 6.62015C29.0535 5.93539 28.3985 5.56323 27.6319 5.56323C27.0327 5.56323 26.5303 5.77536 26.1135 6.19961C25.6967 6.62387 25.492 7.15977 25.492 7.80731C25.492 8.45486 25.6967 8.99076 26.1135 9.40757C26.5303 9.83182 27.0327 10.0439 27.6319 10.0439C28.3985 10.0439 29.0535 9.66807 29.4145 8.98703V8.9796Z",
10925
+ fill: "currentColor"
10926
+ }
10927
+ ),
10928
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
10929
+ "path",
10930
+ {
10931
+ d: "M37.4386 11.2049V7.80341C37.4386 6.35945 36.9139 5.59282 35.697 5.59282C35.0978 5.59282 34.614 5.7975 34.2419 6.21059C33.8623 6.61996 33.6725 7.15214 33.6725 7.80713V11.2086H32.1615V1.9234H33.6725V5.47745C34.1004 4.73315 35.001 4.29773 36.1919 4.29773C37.167 4.29773 37.8666 4.59917 38.302 5.19834C38.7375 5.7975 38.9533 6.66834 38.9533 7.80341V11.2049H37.4349H37.4386Z",
10932
+ fill: "currentColor"
10933
+ }
10934
+ ),
10935
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
10936
+ "path",
10937
+ {
10938
+ d: "M46.5692 5.38819C47.2167 6.07295 47.5777 7.1187 47.5107 8.30587H41.8242C41.9284 8.83805 42.1741 9.26602 42.5611 9.59352C42.9481 9.92473 43.4022 10.0885 43.9157 10.0885C44.8052 10.0885 45.5234 9.59724 45.8844 8.78222L47.1795 9.40372C46.8818 9.99172 46.4352 10.4495 45.8509 10.7881C45.2629 11.1268 44.6191 11.2943 43.9157 11.2943C42.9295 11.2943 42.0178 10.9444 41.3516 10.3453C40.6855 9.7461 40.2649 8.83432 40.2649 7.79602C40.2649 6.75771 40.6892 5.84222 41.3516 5.23933C42.0178 4.64017 42.9295 4.29034 43.9157 4.29034C44.9801 4.29034 45.9216 4.69971 46.5692 5.38447V5.38819ZM42.5388 6.00224C42.1592 6.32974 41.921 6.75772 41.8205 7.29734H46.0221C45.9179 6.75772 45.6835 6.3223 45.3039 5.99852C44.9243 5.67847 44.4628 5.51473 43.9195 5.51473C43.3761 5.51473 42.9221 5.67847 42.5425 6.00597L42.5388 6.00224Z",
10939
+ fill: "currentColor"
10940
+ }
10941
+ ),
10942
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
10943
+ "path",
10944
+ {
10945
+ d: "M59.7699 5.23933C60.1495 5.86827 60.3132 6.68329 60.3132 7.80347V11.2049H58.8023V7.80347C58.8023 6.35952 58.3371 5.59288 57.2318 5.59288C56.6438 5.59288 56.1861 5.79384 55.8586 6.19577C55.5311 6.60141 55.3673 7.13731 55.3673 7.80347V11.2049H53.8489V7.80347C53.8489 6.35952 53.3838 5.59288 52.2785 5.59288C51.6905 5.59288 51.2327 5.79384 50.9052 6.19577C50.574 6.60141 50.4102 7.13731 50.4102 7.80347V11.2049H48.8993V4.39827H50.3433L50.4102 5.47379C50.8196 4.65878 51.5825 4.29407 52.8106 4.29407C53.9606 4.29407 54.7161 4.78531 55.077 5.76407C55.5199 4.81508 56.4428 4.29407 57.7677 4.29407C58.7093 4.29407 59.3829 4.61412 59.7699 5.23562V5.23933Z",
10946
+ fill: "currentColor"
10947
+ }
10948
+ ),
10949
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
10950
+ "path",
10951
+ {
10952
+ d: "M67.4264 5.47382L67.4934 4.3983H68.9373V11.205H67.4934L67.4264 10.1294C67.0282 10.9147 66.1797 11.3092 64.8809 11.3017C63.102 11.3427 61.591 9.79823 61.6283 7.8035C61.591 5.8162 63.102 4.2606 64.8809 4.29782C66.0643 4.29782 67.0096 4.7444 67.4264 5.47754V5.47382ZM66.8049 9.37398C67.2217 8.95717 67.4264 8.43243 67.4264 7.79605C67.4264 7.15967 67.2217 6.64238 66.8049 6.21813C66.3881 5.80132 65.8782 5.58919 65.2828 5.58919C64.6874 5.58919 64.1887 5.80132 63.7719 6.21813C63.355 6.64238 63.1504 7.16711 63.1504 7.79605C63.1504 8.42499 63.355 8.95717 63.7719 9.37398C64.1887 9.79823 64.6911 10.0104 65.2828 10.0104C65.8745 10.0104 66.3881 9.79823 66.8049 9.37398Z",
10953
+ fill: "currentColor"
10954
+ }
10955
+ ),
10956
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
10957
+ "path",
10958
+ {
10959
+ d: "M71.3891 2.85757H72.8926V4.39828H74.6455V5.58172H72.8926V8.9683C72.8926 9.5898 73.1048 9.90985 73.5923 9.96568C73.89 10.0252 74.2398 10.0141 74.6455 9.9359V11.1863C74.1989 11.257 73.7858 11.2943 73.4062 11.2943C72.6731 11.2943 72.1595 11.1082 71.8543 10.7323C71.5454 10.3639 71.3891 9.79076 71.3891 9.02041V5.58172H70.4215V4.39828H71.3891V2.85757Z",
10960
+ fill: "currentColor"
10961
+ }
10962
+ ),
10963
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
10964
+ "path",
10965
+ {
10966
+ d: "M76.1747 3.15526C75.9923 2.98035 75.903 2.76078 75.903 2.50772C75.903 2.25466 75.9923 2.04997 76.1747 1.86762C76.3496 1.69271 76.5691 1.60339 76.8222 1.60339C77.0753 1.60339 77.2874 1.69271 77.4623 1.86762C77.6372 2.04997 77.7265 2.2621 77.7265 2.50772C77.7265 2.75334 77.6372 2.97291 77.4623 3.15526C77.2874 3.33762 77.0678 3.42694 76.8222 3.42694C76.5766 3.42694 76.3496 3.33762 76.1747 3.15526ZM76.0593 4.39826H77.5777V11.2049H76.0593V4.39826Z",
10967
+ fill: "currentColor"
10968
+ }
10969
+ ),
10970
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
10971
+ "path",
10972
+ {
10973
+ d: "M84.3023 8.9796L85.6681 9.55271C85.3778 10.0923 84.9498 10.5129 84.3879 10.8217C83.8259 11.1344 83.2044 11.2944 82.5197 11.2944C81.8349 11.2944 81.2506 11.1567 80.6998 10.8701C80.1491 10.5873 79.7025 10.1742 79.3713 9.6383C79.04 9.09868 78.8689 8.48835 78.8689 7.79987C78.8689 7.11138 79.0363 6.49361 79.3713 5.95771C79.7025 5.41809 80.1528 5.00873 80.6998 4.72589C81.2469 4.44305 81.8609 4.30164 82.5197 4.30164C83.1784 4.30164 83.8259 4.45794 84.3916 4.77427C84.9535 5.08688 85.3815 5.51113 85.6681 6.05075L84.3023 6.62015C83.9413 5.93539 83.2863 5.56323 82.5197 5.56323C81.9205 5.56323 81.4181 5.77536 81.0013 6.19961C80.5845 6.62387 80.3798 7.15977 80.3798 7.80731C80.3798 8.45486 80.5845 8.99076 81.0013 9.40757C81.4181 9.83182 81.9205 10.0439 82.5197 10.0439C83.2863 10.0439 83.9413 9.66807 84.3023 8.98703V8.9796Z",
10974
+ fill: "currentColor"
10975
+ }
10976
+ ),
10977
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
10978
+ "path",
10979
+ {
10980
+ d: "M5.93091 10.8141L7.2758 9.41753L3.83719 5.84667C2.98568 4.9624 2.98568 3.52157 3.83719 2.63731C4.68871 1.75305 6.07617 1.75305 6.92769 2.63731L10.3663 6.20817L11.7112 4.81156L8.27258 1.24069C6.67975 -0.413401 4.08513 -0.413401 2.4923 1.24069C0.899472 2.89479 0.899472 5.58919 2.4923 7.24328L5.93091 10.8141Z",
10981
+ fill: "currentColor"
10982
+ }
10983
+ ),
10984
+ /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
10985
+ "path",
10986
+ {
10987
+ d: "M6.05827 3.54751C5.68761 3.1626 5.08404 3.1626 4.71338 3.54751C4.34272 3.93243 4.34272 4.55921 4.71338 4.94413L9.02103 9.41746L5.93054 12.6268L1.62288 8.15349C1.25223 7.76857 0.648653 7.76857 0.277994 8.15349C-0.0926647 8.5384 -0.0926647 9.16519 0.277994 9.5501L5.93054 15.4201L11.7108 9.41746L6.05827 3.54751Z",
10988
+ fill: "currentColor"
10989
+ }
10990
+ )
10991
+ ]
10992
+ }
10993
+ )
10994
+ ]
10995
+ }
10996
+ );
10839
10997
  };
10840
10998
 
10841
10999
  // src/components/layout/RenderLayout.tsx
10842
- var import_react11 = require("react");
11000
+ var import_react12 = require("react");
10843
11001
  var import_jsx_runtime11 = require("react/jsx-runtime");
10844
11002
  var Disabled = () => {
10845
11003
  const theme = nt();
@@ -10881,14 +11039,14 @@ var Disabled = () => {
10881
11039
  var Success = () => {
10882
11040
  const theme = nt();
10883
11041
  const { hydrate, data, api, setLayout, isPending } = useEmbed();
10884
- const [isOpen, setIsOpen] = (0, import_react11.useState)(true);
10885
- (0, import_react11.useEffect)(() => {
11042
+ const [isOpen, setIsOpen] = (0, import_react12.useState)(true);
11043
+ (0, import_react12.useEffect)(() => {
10886
11044
  if (api && data.component?.id) {
10887
11045
  hydrate();
10888
11046
  setTimeout(() => setIsOpen(false), 2e3);
10889
11047
  }
10890
11048
  }, [api, data.component?.id, hydrate]);
10891
- (0, import_react11.useEffect)(() => {
11049
+ (0, import_react12.useEffect)(() => {
10892
11050
  if (!isPending && !isOpen) {
10893
11051
  setLayout("portal");
10894
11052
  }
@@ -10949,40 +11107,40 @@ var RenderLayout = ({ children }) => {
10949
11107
  };
10950
11108
 
10951
11109
  // src/components/layout/viewport/styles.ts
10952
- var StyledViewport = dt(Flex)`
10953
- flex-wrap: wrap;
10954
- place-content: start;
11110
+ var StyledViewport = dt(Box).attrs(({ theme }) => ({
11111
+ $gridTemplateColumns: `repeat(auto-fill, minmax(300px, 1fr))`,
11112
+ $viewport: {
11113
+ xl: {
11114
+ $gridTemplateColumns: `repeat(${theme.numberOfColumns}, minmax(300px, 1fr))`
11115
+ }
11116
+ }
11117
+ })).withConfig({
11118
+ shouldForwardProp: (prop) => !["$numberOfColumns", "numberOfColumns"].includes(prop)
11119
+ })`
11120
+ display: grid;
11121
+
10955
11122
  margin-left: auto;
10956
11123
  margin-right: auto;
10957
- gap: 2rem;
11124
+ gap: 1rem;
10958
11125
  `;
10959
11126
 
10960
11127
  // src/components/layout/viewport/Viewport.tsx
10961
11128
  var import_jsx_runtime12 = require("react/jsx-runtime");
10962
- var Viewport = (0, import_react12.forwardRef)(
11129
+ var Viewport = (0, import_react13.forwardRef)(
10963
11130
  ({ children, ...props }, ref) => {
10964
- const theme = nt();
10965
- return /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(
10966
- StyledViewport,
10967
- {
10968
- ref,
10969
- $numberOfColumns: theme.numberOfColumns,
10970
- ...props,
10971
- children: [
10972
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(RenderLayout, { children }),
10973
- /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Badge, {})
10974
- ]
10975
- }
10976
- );
11131
+ return /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(import_jsx_runtime12.Fragment, { children: /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(StyledViewport, { ref, ...props, children: [
11132
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(RenderLayout, { children }),
11133
+ /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(Badge, {})
11134
+ ] }) });
10977
11135
  }
10978
11136
  );
10979
11137
  Viewport.displayName = "Viewport";
10980
11138
 
10981
11139
  // src/components/layout/column/Column.tsx
10982
- var import_react14 = require("react");
11140
+ var import_react15 = require("react");
10983
11141
 
10984
11142
  // src/components/layout/card/Card.tsx
10985
- var import_react13 = require("react");
11143
+ var import_react14 = require("react");
10986
11144
 
10987
11145
  // src/components/layout/card/styles.ts
10988
11146
  var Element = dt(Box)``;
@@ -11026,7 +11184,7 @@ var StyledCard = dt.div(({ theme }) => {
11026
11184
 
11027
11185
  // src/components/layout/card/Card.tsx
11028
11186
  var import_jsx_runtime13 = require("react/jsx-runtime");
11029
- var Card = (0, import_react13.forwardRef)(
11187
+ var Card = (0, import_react14.forwardRef)(
11030
11188
  ({ children, className }, ref) => {
11031
11189
  return /* @__PURE__ */ (0, import_jsx_runtime13.jsx)(StyledCard, { ref, className, children });
11032
11190
  }
@@ -11035,14 +11193,12 @@ Card.displayName = "Card";
11035
11193
 
11036
11194
  // src/components/layout/column/styles.ts
11037
11195
  var StyledColumn = dt.div`
11038
- flex-grow: 1;
11039
- flex-basis: ${({ theme }) => `calc(${100 / theme.numberOfColumns}% - ${(theme.numberOfColumns - 1) / theme.numberOfColumns}rem)`};
11040
11196
  height: min-content;
11041
11197
  `;
11042
11198
 
11043
11199
  // src/components/layout/column/Column.tsx
11044
11200
  var import_jsx_runtime14 = require("react/jsx-runtime");
11045
- var Column = (0, import_react14.forwardRef)(
11201
+ var Column = (0, import_react15.forwardRef)(
11046
11202
  ({ children, basis, ...props }, ref) => {
11047
11203
  return /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(StyledColumn, { ref, ...props, children: /* @__PURE__ */ (0, import_jsx_runtime14.jsx)(Card, { children }) });
11048
11204
  }
@@ -11075,11 +11231,11 @@ function resolveDesignProps(props) {
11075
11231
  visibleFeatures: props.visibleFeatures
11076
11232
  };
11077
11233
  }
11078
- var IncludedFeatures = (0, import_react15.forwardRef)(({ className, ...rest }, ref) => {
11234
+ var IncludedFeatures = (0, import_react16.forwardRef)(({ className, ...rest }, ref) => {
11079
11235
  const props = resolveDesignProps(rest);
11080
11236
  const theme = nt();
11081
11237
  const { data } = useEmbed();
11082
- const elements = (0, import_react15.useRef)([]);
11238
+ const elements = (0, import_react16.useRef)([]);
11083
11239
  const shouldWrapChildren = useWrapChildren(elements.current);
11084
11240
  const isLightBackground = useIsLightBackground();
11085
11241
  const featureUsage = props.visibleFeatures ? props.visibleFeatures.reduce((acc, id) => {
@@ -11191,7 +11347,7 @@ var IncludedFeatures = (0, import_react15.forwardRef)(({ className, ...rest }, r
11191
11347
  IncludedFeatures.displayName = "IncludedFeatures";
11192
11348
 
11193
11349
  // src/components/elements/invoices/Invoices.tsx
11194
- var import_react16 = require("react");
11350
+ var import_react17 = require("react");
11195
11351
  var import_jsx_runtime16 = require("react/jsx-runtime");
11196
11352
  function resolveDesignProps2(props) {
11197
11353
  return {
@@ -11245,18 +11401,18 @@ var InvoiceDate = ({ date, fontStyle, url }) => {
11245
11401
  }
11246
11402
  return dateText;
11247
11403
  };
11248
- var Invoices = (0, import_react16.forwardRef)(({ className, data, ...rest }, ref) => {
11404
+ var Invoices = (0, import_react17.forwardRef)(({ className, data, ...rest }, ref) => {
11249
11405
  const props = resolveDesignProps2(rest);
11250
11406
  const theme = nt();
11251
11407
  const { api } = useEmbed();
11252
- const [invoices, setInvoices] = (0, import_react16.useState)(() => formatInvoices(data));
11253
- const [listSize, setListSize] = (0, import_react16.useState)(props.limit.number);
11408
+ const [invoices, setInvoices] = (0, import_react17.useState)(() => formatInvoices(data));
11409
+ const [listSize, setListSize] = (0, import_react17.useState)(props.limit.number);
11254
11410
  const toggleListSize = () => {
11255
11411
  setListSize(
11256
11412
  (prev2) => prev2 !== props.limit.number ? props.limit.number : 12
11257
11413
  );
11258
11414
  };
11259
- (0, import_react16.useEffect)(() => {
11415
+ (0, import_react17.useEffect)(() => {
11260
11416
  api?.listInvoices().then(({ data: data2 }) => {
11261
11417
  setInvoices(formatInvoices(data2));
11262
11418
  });
@@ -11322,7 +11478,7 @@ var Invoices = (0, import_react16.forwardRef)(({ className, data, ...rest }, ref
11322
11478
  Invoices.displayName = "Invoices";
11323
11479
 
11324
11480
  // src/components/elements/metered-features/MeteredFeatures.tsx
11325
- var import_react17 = require("react");
11481
+ var import_react18 = require("react");
11326
11482
  var import_pluralize2 = __toESM(require_pluralize());
11327
11483
 
11328
11484
  // src/components/elements/metered-features/styles.ts
@@ -11369,9 +11525,9 @@ function resolveDesignProps3(props) {
11369
11525
  visibleFeatures: props.visibleFeatures
11370
11526
  };
11371
11527
  }
11372
- var MeteredFeatures = (0, import_react17.forwardRef)(({ className, ...rest }, ref) => {
11528
+ var MeteredFeatures = (0, import_react18.forwardRef)(({ className, ...rest }, ref) => {
11373
11529
  const props = resolveDesignProps3(rest);
11374
- const elements = (0, import_react17.useRef)([]);
11530
+ const elements = (0, import_react18.useRef)([]);
11375
11531
  const shouldWrapChildren = useWrapChildren(elements.current);
11376
11532
  const theme = nt();
11377
11533
  const { data } = useEmbed();
@@ -11493,8 +11649,8 @@ var MeteredFeatures = (0, import_react17.forwardRef)(({ className, ...rest }, re
11493
11649
  MeteredFeatures.displayName = "MeteredFeatures";
11494
11650
 
11495
11651
  // src/components/elements/payment-method/PaymentMethod.tsx
11496
- var import_react22 = require("react");
11497
- var import_react_dom = require("react-dom");
11652
+ var import_react23 = require("react");
11653
+ var import_react_dom2 = require("react-dom");
11498
11654
 
11499
11655
  // node_modules/@stripe/stripe-js/dist/index.mjs
11500
11656
  var V3_URL = "https://js.stripe.com/v3";
@@ -11634,7 +11790,7 @@ var loadStripe = function loadStripe2() {
11634
11790
  var import_react_stripe_js3 = require("@stripe/react-stripe-js");
11635
11791
 
11636
11792
  // src/components/shared/checkout-dialog/CheckoutDialog.tsx
11637
- var import_react19 = require("react");
11793
+ var import_react20 = require("react");
11638
11794
 
11639
11795
  // src/components/shared/checkout-dialog/Navigation.tsx
11640
11796
  var import_jsx_runtime18 = require("react/jsx-runtime");
@@ -11661,7 +11817,7 @@ var Navigation = ({
11661
11817
  {
11662
11818
  $display: "none",
11663
11819
  $viewport: {
11664
- sm: {
11820
+ md: {
11665
11821
  $display: "block"
11666
11822
  }
11667
11823
  },
@@ -11711,7 +11867,7 @@ var Navigation = ({
11711
11867
  $cursor: "pointer"
11712
11868
  },
11713
11869
  $viewport: {
11714
- sm: {
11870
+ md: {
11715
11871
  $fontSize: `${19 / TEXT_BASE_SIZE}rem`
11716
11872
  }
11717
11873
  },
@@ -11739,7 +11895,7 @@ var Navigation = ({
11739
11895
  };
11740
11896
 
11741
11897
  // src/components/shared/checkout-dialog/Sidebar.tsx
11742
- var import_react18 = require("react");
11898
+ var import_react19 = require("react");
11743
11899
  var import_jsx_runtime19 = require("react/jsx-runtime");
11744
11900
  var Sidebar = ({
11745
11901
  addOns,
@@ -11762,7 +11918,7 @@ var Sidebar = ({
11762
11918
  const theme = nt();
11763
11919
  const { api, data, mode, setLayout } = useEmbed();
11764
11920
  const isLightBackground = useIsLightBackground();
11765
- const subscriptionPrice = (0, import_react18.useMemo)(() => {
11921
+ const subscriptionPrice = (0, import_react19.useMemo)(() => {
11766
11922
  if (!selectedPlan || !selectedPlan.monthlyPrice || !selectedPlan.yearlyPrice) {
11767
11923
  return;
11768
11924
  }
@@ -11770,7 +11926,7 @@ var Sidebar = ({
11770
11926
  (planPeriod === "month" ? selectedPlan.monthlyPrice : selectedPlan.yearlyPrice)?.price
11771
11927
  );
11772
11928
  }, [selectedPlan, planPeriod]);
11773
- const checkout = (0, import_react18.useCallback)(async () => {
11929
+ const checkout = (0, import_react19.useCallback)(async () => {
11774
11930
  const priceId = (planPeriod === "month" ? selectedPlan?.monthlyPrice : selectedPlan?.yearlyPrice)?.id;
11775
11931
  if (!api || !selectedPlan || !priceId) {
11776
11932
  return;
@@ -11836,12 +11992,13 @@ var Sidebar = ({
11836
11992
  ref: checkoutRef,
11837
11993
  tabIndex: 0,
11838
11994
  $flexDirection: "column",
11995
+ $flexShrink: 0,
11839
11996
  $overflow: "auto",
11840
11997
  $backgroundColor: theme.card.background,
11841
11998
  $borderRadius: "0 0 0.5rem",
11842
11999
  $boxShadow: "0px 1px 20px 0px #1018280F, 0px 1px 3px 0px #1018281A;",
11843
12000
  $viewport: {
11844
- sm: {
12001
+ md: {
11845
12002
  $width: "21.5rem"
11846
12003
  }
11847
12004
  },
@@ -12408,7 +12565,7 @@ var Plan = ({
12408
12565
  $borderStyle: "solid",
12409
12566
  $borderColor: isLightBackground ? "hsla(0, 0%, 0%, 0.175)" : "hsla(0, 0%, 100%, 0.175)",
12410
12567
  $viewport: {
12411
- sm: {
12568
+ md: {
12412
12569
  $gap: "1rem"
12413
12570
  }
12414
12571
  },
@@ -12547,8 +12704,8 @@ var Plan = ({
12547
12704
  children: !plan.valid ? /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(
12548
12705
  Tooltip,
12549
12706
  {
12550
- label: "Over usage limit",
12551
- description: "Current usage exceeds the limit of this plan."
12707
+ trigger: "Over usage limit",
12708
+ content: "Current usage exceeds the limit of this plan."
12552
12709
  }
12553
12710
  ) : "Choose plan"
12554
12711
  }
@@ -12782,28 +12939,29 @@ var CheckoutDialog = ({
12782
12939
  }) => {
12783
12940
  const theme = nt();
12784
12941
  const { api, data } = useEmbed();
12785
- const contentRef = (0, import_react19.useRef)(null);
12786
- const checkoutRef = (0, import_react19.useRef)(null);
12787
- const [checkoutStage, setCheckoutStage] = (0, import_react19.useState)("plan");
12788
- const [planPeriod, setPlanPeriod] = (0, import_react19.useState)(
12942
+ const modalRef = (0, import_react20.useRef)(null);
12943
+ const contentRef = (0, import_react20.useRef)(null);
12944
+ const checkoutRef = (0, import_react20.useRef)(null);
12945
+ const [checkoutStage, setCheckoutStage] = (0, import_react20.useState)("plan");
12946
+ const [planPeriod, setPlanPeriod] = (0, import_react20.useState)(
12789
12947
  initialPeriod || data.company?.plan?.planPeriod || "month"
12790
12948
  );
12791
- const [charges, setCharges] = (0, import_react19.useState)();
12792
- const [paymentMethodId, setPaymentMethodId] = (0, import_react19.useState)();
12793
- const [isLoading, setIsLoading] = (0, import_react19.useState)(false);
12794
- const [error, setError] = (0, import_react19.useState)();
12795
- const [showPaymentForm, setShowPaymentForm] = (0, import_react19.useState)(
12949
+ const [charges, setCharges] = (0, import_react20.useState)();
12950
+ const [paymentMethodId, setPaymentMethodId] = (0, import_react20.useState)();
12951
+ const [isLoading, setIsLoading] = (0, import_react20.useState)(false);
12952
+ const [error, setError] = (0, import_react20.useState)();
12953
+ const [showPaymentForm, setShowPaymentForm] = (0, import_react20.useState)(
12796
12954
  !data.subscription?.paymentMethod
12797
12955
  );
12798
- const [stripe, setStripe] = (0, import_react19.useState)(null);
12799
- const [setupIntent, setSetupIntent] = (0, import_react19.useState)();
12800
- const [top, setTop] = (0, import_react19.useState)(0);
12956
+ const [stripe, setStripe] = (0, import_react20.useState)(null);
12957
+ const [setupIntent, setSetupIntent] = (0, import_react20.useState)();
12958
+ const [top, setTop] = (0, import_react20.useState)(0);
12801
12959
  const {
12802
12960
  plans: availablePlans,
12803
12961
  addOns: availableAddOns,
12804
12962
  periods: availablePeriods
12805
12963
  } = useAvailablePlans(planPeriod);
12806
- const checkoutStages = (0, import_react19.useMemo)(() => {
12964
+ const checkoutStages = (0, import_react20.useMemo)(() => {
12807
12965
  const checkoutStages2 = [
12808
12966
  {
12809
12967
  id: "plan",
@@ -12825,20 +12983,20 @@ var CheckoutDialog = ({
12825
12983
  return checkoutStages2;
12826
12984
  }, [availableAddOns]);
12827
12985
  const currentPlan = data.company?.plan;
12828
- const [selectedPlan, setSelectedPlan] = (0, import_react19.useState)(
12986
+ const [selectedPlan, setSelectedPlan] = (0, import_react20.useState)(
12829
12987
  () => availablePlans.find(
12830
12988
  (plan) => plan.id === (typeof initialPlanId !== "undefined" ? initialPlanId : currentPlan?.id)
12831
12989
  )
12832
12990
  );
12833
12991
  const currentAddOns = data.company?.addOns || [];
12834
- const [addOns, setAddOns] = (0, import_react19.useState)(
12992
+ const [addOns, setAddOns] = (0, import_react20.useState)(
12835
12993
  () => availableAddOns.map((addOn) => ({
12836
12994
  ...addOn,
12837
12995
  isSelected: typeof initialAddOnId !== "undefined" ? addOn.id === initialAddOnId : currentAddOns.some((currentAddOn) => addOn.id === currentAddOn.id)
12838
12996
  }))
12839
12997
  );
12840
12998
  const isLightBackground = useIsLightBackground();
12841
- const previewCheckout = (0, import_react19.useCallback)(
12999
+ const previewCheckout = (0, import_react20.useCallback)(
12842
13000
  async (plan, addOns2, newPeriod) => {
12843
13001
  const period = newPeriod || planPeriod;
12844
13002
  const planPriceId = period === "month" ? plan?.monthlyPrice?.id : plan?.yearlyPrice?.id;
@@ -12884,14 +13042,14 @@ var CheckoutDialog = ({
12884
13042
  },
12885
13043
  [api, planPeriod]
12886
13044
  );
12887
- const selectPlan = (0, import_react19.useCallback)(
13045
+ const selectPlan = (0, import_react20.useCallback)(
12888
13046
  (plan, newPeriod) => {
12889
13047
  setSelectedPlan(plan);
12890
13048
  previewCheckout(plan, addOns, newPeriod);
12891
13049
  },
12892
13050
  [addOns, previewCheckout]
12893
13051
  );
12894
- const changePlanPeriod = (0, import_react19.useCallback)(
13052
+ const changePlanPeriod = (0, import_react20.useCallback)(
12895
13053
  (period) => {
12896
13054
  if (selectedPlan) {
12897
13055
  selectPlan(selectedPlan, period);
@@ -12900,7 +13058,7 @@ var CheckoutDialog = ({
12900
13058
  },
12901
13059
  [selectedPlan, selectPlan, setPlanPeriod]
12902
13060
  );
12903
- const toggleAddOn = (0, import_react19.useCallback)(
13061
+ const toggleAddOn = (0, import_react20.useCallback)(
12904
13062
  (id, newPeriod) => {
12905
13063
  const updatedAddOns = addOns.map((addOn) => ({
12906
13064
  ...addOn,
@@ -12914,12 +13072,12 @@ var CheckoutDialog = ({
12914
13072
  },
12915
13073
  [selectedPlan, addOns, planPeriod, previewCheckout]
12916
13074
  );
12917
- (0, import_react19.useEffect)(() => {
13075
+ (0, import_react20.useEffect)(() => {
12918
13076
  if (!stripe && setupIntent?.publishableKey) {
12919
13077
  setStripe(loadStripe(setupIntent.publishableKey));
12920
13078
  }
12921
13079
  }, [stripe, setupIntent?.publishableKey]);
12922
- (0, import_react19.useLayoutEffect)(() => {
13080
+ (0, import_react20.useLayoutEffect)(() => {
12923
13081
  const parent = portal || document.body;
12924
13082
  const value = Math.abs(parent.getBoundingClientRect().top ?? 0);
12925
13083
  setTop(value);
@@ -12928,7 +13086,7 @@ var CheckoutDialog = ({
12928
13086
  parent.style.overflow = "";
12929
13087
  };
12930
13088
  }, [portal]);
12931
- (0, import_react19.useLayoutEffect)(() => {
13089
+ (0, import_react20.useLayoutEffect)(() => {
12932
13090
  if (contentRef.current) {
12933
13091
  contentRef.current.scrollTo({
12934
13092
  top: 0,
@@ -12940,198 +13098,207 @@ var CheckoutDialog = ({
12940
13098
  const activeCheckoutStage = checkoutStages.find(
12941
13099
  (stage) => stage.id === checkoutStage
12942
13100
  );
12943
- return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(Modal, { id: "select-plan-dialog", size: "lg", top, contentRef, children: [
12944
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(ModalHeader, { bordered: true, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
12945
- Flex,
12946
- {
12947
- $flexWrap: "wrap",
12948
- $gap: "0.5rem",
12949
- $viewport: {
12950
- sm: {
12951
- $gap: "1rem"
12952
- }
12953
- },
12954
- children: checkoutStages.map((stage, index, stages) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
12955
- Navigation,
13101
+ return /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
13102
+ Modal,
13103
+ {
13104
+ ref: modalRef,
13105
+ id: "select-plan-dialog",
13106
+ size: "lg",
13107
+ top,
13108
+ contentRef,
13109
+ children: [
13110
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(ModalHeader, { bordered: true, children: /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
13111
+ Flex,
12956
13112
  {
12957
- name: stage.name,
12958
- index,
12959
- activeIndex: checkoutStages.findIndex(
12960
- (s2) => s2.id === checkoutStage
12961
- ),
12962
- isLast: index === stages.length - 1,
12963
- onClick: () => setCheckoutStage(stage.id)
12964
- },
12965
- stage.id
12966
- ))
12967
- }
12968
- ) }),
12969
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
12970
- Flex,
12971
- {
12972
- $position: "relative",
12973
- $flexDirection: "column",
12974
- $height: "auto",
12975
- $viewport: {
12976
- sm: {
12977
- $flexDirection: "row",
12978
- $height: "calc(100% - 5rem)"
12979
- }
12980
- },
12981
- children: [
12982
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
12983
- Flex,
12984
- {
12985
- $flexDirection: "column",
12986
- $flexGrow: "1",
12987
- $gap: "1.5rem",
12988
- $padding: "1.5rem",
12989
- $backgroundColor: isLightBackground ? "hsla(0, 0%, 0%, 0.025)" : "hsla(0, 0%, 100%, 0.025)",
12990
- $overflow: "auto",
12991
- $viewport: {
12992
- sm: {
12993
- $gap: "1rem",
12994
- $padding: "2rem 2.5rem 2rem 2.5rem"
12995
- }
13113
+ $flexWrap: "wrap",
13114
+ $gap: "0.5rem",
13115
+ $viewport: {
13116
+ md: {
13117
+ $gap: "1rem"
13118
+ }
13119
+ },
13120
+ children: checkoutStages.map((stage, index, stages) => /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
13121
+ Navigation,
13122
+ {
13123
+ name: stage.name,
13124
+ index,
13125
+ activeIndex: checkoutStages.findIndex(
13126
+ (s2) => s2.id === checkoutStage
13127
+ ),
13128
+ isLast: index === stages.length - 1,
13129
+ onClick: () => setCheckoutStage(stage.id)
12996
13130
  },
12997
- children: [
12998
- /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
12999
- Flex,
13000
- {
13001
- $flexDirection: "column",
13002
- $gap: "1.5rem",
13003
- $viewport: {
13004
- sm: {
13005
- $flexDirection: "row",
13006
- $justifyContent: "space-between",
13007
- $alignItems: "start",
13008
- $gap: "1rem"
13009
- }
13010
- },
13011
- children: [
13012
- activeCheckoutStage && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
13013
- Flex,
13014
- {
13015
- $flexDirection: "column",
13016
- $alignItems: "center",
13017
- $gap: "0.25rem",
13018
- $viewport: {
13019
- sm: {
13020
- $alignItems: "start",
13021
- $gap: "1rem",
13022
- $marginBottom: "1rem"
13131
+ stage.id
13132
+ ))
13133
+ }
13134
+ ) }),
13135
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
13136
+ Flex,
13137
+ {
13138
+ $position: "relative",
13139
+ $flexDirection: "column",
13140
+ $height: "auto",
13141
+ $viewport: {
13142
+ md: {
13143
+ $flexDirection: "row",
13144
+ $height: "calc(100% - 5rem)"
13145
+ }
13146
+ },
13147
+ children: [
13148
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
13149
+ Flex,
13150
+ {
13151
+ $flexDirection: "column",
13152
+ $flexGrow: "1",
13153
+ $gap: "1.5rem",
13154
+ $padding: "1.5rem",
13155
+ $backgroundColor: isLightBackground ? "hsla(0, 0%, 0%, 0.025)" : "hsla(0, 0%, 100%, 0.025)",
13156
+ $overflow: "auto",
13157
+ $viewport: {
13158
+ md: {
13159
+ $padding: "2rem 2.5rem 2rem 2.5rem"
13160
+ }
13161
+ },
13162
+ children: [
13163
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
13164
+ Flex,
13165
+ {
13166
+ $flexDirection: "column",
13167
+ $flexWrap: "wrap",
13168
+ $gap: "1.5rem",
13169
+ $viewport: {
13170
+ md: {
13171
+ $flexDirection: "row",
13172
+ $justifyContent: "space-between",
13173
+ $alignItems: "start",
13174
+ $gap: "1rem"
13175
+ }
13176
+ },
13177
+ children: [
13178
+ activeCheckoutStage && /* @__PURE__ */ (0, import_jsx_runtime24.jsxs)(
13179
+ Flex,
13180
+ {
13181
+ $flexDirection: "column",
13182
+ $alignItems: "center",
13183
+ $gap: "0.25rem",
13184
+ $viewport: {
13185
+ md: {
13186
+ $alignItems: "start"
13187
+ }
13188
+ },
13189
+ children: [
13190
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
13191
+ Text,
13192
+ {
13193
+ as: "h3",
13194
+ $font: theme.typography.heading3.fontFamily,
13195
+ $size: theme.typography.heading3.fontSize,
13196
+ $weight: theme.typography.heading3.fontWeight,
13197
+ $color: theme.typography.heading3.color,
13198
+ $marginBottom: "0.5rem",
13199
+ children: activeCheckoutStage.label
13200
+ }
13201
+ ),
13202
+ activeCheckoutStage?.description && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
13203
+ Text,
13204
+ {
13205
+ as: "p",
13206
+ $font: theme.typography.text.fontFamily,
13207
+ $size: theme.typography.text.fontSize,
13208
+ $weight: theme.typography.text.fontWeight,
13209
+ $color: theme.typography.text.color,
13210
+ children: activeCheckoutStage.description
13211
+ }
13212
+ )
13213
+ ]
13023
13214
  }
13024
- },
13025
- children: [
13026
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
13027
- Text,
13028
- {
13029
- as: "h3",
13030
- $font: theme.typography.heading3.fontFamily,
13031
- $size: theme.typography.heading3.fontSize,
13032
- $weight: theme.typography.heading3.fontWeight,
13033
- $color: theme.typography.heading3.color,
13034
- $marginBottom: "0.5rem",
13035
- children: activeCheckoutStage.label
13036
- }
13037
- ),
13038
- activeCheckoutStage?.description && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
13039
- Text,
13040
- {
13041
- as: "p",
13042
- $font: theme.typography.text.fontFamily,
13043
- $size: theme.typography.text.fontSize,
13044
- $weight: theme.typography.text.fontWeight,
13045
- $color: theme.typography.text.color,
13046
- children: activeCheckoutStage.description
13047
- }
13048
- )
13049
- ]
13050
- }
13051
- ),
13052
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
13053
- PeriodToggle,
13054
- {
13055
- options: availablePeriods,
13056
- selectedOption: planPeriod,
13057
- selectedPlan,
13058
- onChange: changePlanPeriod
13059
- }
13060
- )
13061
- ]
13062
- }
13063
- ),
13064
- checkoutStage === "plan" && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
13065
- Plan,
13066
- {
13067
- isLoading,
13068
- period: planPeriod,
13069
- plans: availablePlans,
13070
- currentPlan,
13071
- selectedPlan,
13072
- selectPlan
13073
- }
13074
- ),
13075
- checkoutStage === "addons" && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
13076
- AddOns,
13077
- {
13078
- isLoading,
13079
- period: planPeriod,
13080
- addOns,
13081
- toggle: (id) => toggleAddOn(id)
13082
- }
13083
- ),
13084
- checkoutStage === "checkout" && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
13085
- Checkout,
13086
- {
13087
- setPaymentMethodId: (id) => setPaymentMethodId(id),
13088
- togglePaymentForm: () => setShowPaymentForm((prev2) => !prev2),
13089
- setupIntent,
13090
- showPaymentForm,
13091
- stripe
13092
- }
13093
- )
13094
- ]
13095
- }
13096
- ),
13097
- /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
13098
- Sidebar,
13099
- {
13100
- addOns,
13101
- charges,
13102
- checkoutRef,
13103
- checkoutStage,
13104
- currentAddOns,
13105
- currentPlan,
13106
- error,
13107
- isLoading,
13108
- paymentMethodId,
13109
- planPeriod,
13110
- selectedPlan,
13111
- setCheckoutStage: (stage) => setCheckoutStage(stage),
13112
- setError: (msg) => setError(msg),
13113
- setSetupIntent: (intent) => setSetupIntent(intent),
13114
- showPaymentForm,
13115
- toggleLoading: () => setIsLoading((prev2) => !prev2)
13116
- }
13117
- )
13118
- ]
13119
- }
13120
- )
13121
- ] });
13215
+ ),
13216
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
13217
+ PeriodToggle,
13218
+ {
13219
+ options: availablePeriods,
13220
+ selectedOption: planPeriod,
13221
+ selectedPlan,
13222
+ onChange: changePlanPeriod,
13223
+ layerRef: modalRef
13224
+ }
13225
+ )
13226
+ ]
13227
+ }
13228
+ ),
13229
+ checkoutStage === "plan" && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
13230
+ Plan,
13231
+ {
13232
+ isLoading,
13233
+ period: planPeriod,
13234
+ plans: availablePlans,
13235
+ currentPlan,
13236
+ selectedPlan,
13237
+ selectPlan
13238
+ }
13239
+ ),
13240
+ checkoutStage === "addons" && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
13241
+ AddOns,
13242
+ {
13243
+ isLoading,
13244
+ period: planPeriod,
13245
+ addOns,
13246
+ toggle: (id) => toggleAddOn(id)
13247
+ }
13248
+ ),
13249
+ checkoutStage === "checkout" && /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
13250
+ Checkout,
13251
+ {
13252
+ setPaymentMethodId: (id) => setPaymentMethodId(id),
13253
+ togglePaymentForm: () => setShowPaymentForm((prev2) => !prev2),
13254
+ setupIntent,
13255
+ showPaymentForm,
13256
+ stripe
13257
+ }
13258
+ )
13259
+ ]
13260
+ }
13261
+ ),
13262
+ /* @__PURE__ */ (0, import_jsx_runtime24.jsx)(
13263
+ Sidebar,
13264
+ {
13265
+ addOns,
13266
+ charges,
13267
+ checkoutRef,
13268
+ checkoutStage,
13269
+ currentAddOns,
13270
+ currentPlan,
13271
+ error,
13272
+ isLoading,
13273
+ paymentMethodId,
13274
+ planPeriod,
13275
+ selectedPlan,
13276
+ setCheckoutStage: (stage) => setCheckoutStage(stage),
13277
+ setError: (msg) => setError(msg),
13278
+ setSetupIntent: (intent) => setSetupIntent(intent),
13279
+ showPaymentForm,
13280
+ toggleLoading: () => setIsLoading((prev2) => !prev2)
13281
+ }
13282
+ )
13283
+ ]
13284
+ }
13285
+ )
13286
+ ]
13287
+ }
13288
+ );
13122
13289
  };
13123
13290
 
13124
13291
  // src/components/shared/payment-form/PaymentForm.tsx
13125
- var import_react20 = require("react");
13292
+ var import_react21 = require("react");
13126
13293
  var import_react_stripe_js2 = require("@stripe/react-stripe-js");
13127
13294
  var import_jsx_runtime25 = require("react/jsx-runtime");
13128
13295
  var PaymentForm = ({ onConfirm }) => {
13129
13296
  const stripe = (0, import_react_stripe_js2.useStripe)();
13130
13297
  const elements = (0, import_react_stripe_js2.useElements)();
13131
13298
  const { api } = useEmbed();
13132
- const [message, setMessage] = (0, import_react20.useState)(null);
13133
- const [isLoading, setIsLoading] = (0, import_react20.useState)(false);
13134
- const [isConfirmed, setIsConfirmed] = (0, import_react20.useState)(false);
13299
+ const [message, setMessage] = (0, import_react21.useState)(null);
13300
+ const [isLoading, setIsLoading] = (0, import_react21.useState)(false);
13301
+ const [isConfirmed, setIsConfirmed] = (0, import_react21.useState)(false);
13135
13302
  const handleSubmit = async (event) => {
13136
13303
  event.preventDefault();
13137
13304
  if (!api || !stripe || !elements) {
@@ -13192,15 +13359,34 @@ var PaymentForm = ({ onConfirm }) => {
13192
13359
  };
13193
13360
 
13194
13361
  // src/components/shared/period-toggle/PeriodToggle.tsx
13362
+ var import_react22 = require("react");
13195
13363
  var import_jsx_runtime26 = require("react/jsx-runtime");
13196
13364
  var PeriodToggle = ({
13197
13365
  options,
13198
13366
  selectedOption,
13199
13367
  selectedPlan,
13200
- onChange
13368
+ onChange,
13369
+ layerRef
13201
13370
  }) => {
13202
13371
  const theme = nt();
13203
13372
  const isLightBackground = useIsLightBackground();
13373
+ const [tooltipZIndex, setTooltipZIndex] = (0, import_react22.useState)(1);
13374
+ const savingsPercentage = (0, import_react22.useMemo)(() => {
13375
+ if (selectedPlan) {
13376
+ const monthly = (selectedPlan?.monthlyPrice?.price || 0) * 12;
13377
+ const yearly = selectedPlan?.yearlyPrice?.price || 0;
13378
+ return Math.round((monthly - yearly) / monthly * 1e4) / 100;
13379
+ }
13380
+ return 0;
13381
+ }, [selectedPlan]);
13382
+ (0, import_react22.useLayoutEffect)(() => {
13383
+ const element = layerRef?.current;
13384
+ if (element) {
13385
+ const style = getComputedStyle(element);
13386
+ const value = style.getPropertyValue("z-index");
13387
+ setTooltipZIndex(parseInt(value) + 1);
13388
+ }
13389
+ }, [layerRef]);
13204
13390
  return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
13205
13391
  Flex,
13206
13392
  {
@@ -13212,7 +13398,7 @@ var PeriodToggle = ({
13212
13398
  $borderRadius: "2.5rem",
13213
13399
  $cursor: "pointer",
13214
13400
  $viewport: {
13215
- sm: {
13401
+ md: {
13216
13402
  $width: "fit-content"
13217
13403
  }
13218
13404
  },
@@ -13225,13 +13411,14 @@ var PeriodToggle = ({
13225
13411
  $justifyContent: "center",
13226
13412
  $alignItems: "center",
13227
13413
  $flexGrow: 1,
13414
+ $whiteSpace: "nowrap",
13228
13415
  $padding: "0.75rem 1rem",
13229
13416
  ...option === selectedOption && {
13230
13417
  $backgroundColor: isLightBackground ? "hsl(0, 0%, 92.5%)" : "hsl(0, 0%, 7.5%)"
13231
13418
  },
13232
13419
  $borderRadius: "2.5rem",
13233
13420
  $viewport: {
13234
- sm: {
13421
+ md: {
13235
13422
  $padding: "0.375rem 1rem"
13236
13423
  }
13237
13424
  },
@@ -13252,14 +13439,26 @@ var PeriodToggle = ({
13252
13439
  },
13253
13440
  option
13254
13441
  );
13255
- if (option === "year") {
13442
+ if (option === "year" && savingsPercentage > 0) {
13256
13443
  return /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
13257
13444
  Tooltip,
13258
13445
  {
13259
- label: element,
13260
- description: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(Savings, { plan: selectedPlan, period: selectedOption }),
13446
+ trigger: element,
13447
+ content: /* @__PURE__ */ (0, import_jsx_runtime26.jsx)(
13448
+ Text,
13449
+ {
13450
+ $font: theme.typography.text.fontFamily,
13451
+ $size: 11,
13452
+ $weight: theme.typography.text.fontWeight,
13453
+ $color: theme.primary,
13454
+ $leading: 1,
13455
+ children: selectedOption === "month" ? `Save up to ${savingsPercentage}% with yearly billing` : `You are saving ${savingsPercentage}% with yearly billing`
13456
+ }
13457
+ ),
13458
+ zIndex: tooltipZIndex,
13261
13459
  $flexGrow: 1
13262
- }
13460
+ },
13461
+ option
13263
13462
  );
13264
13463
  }
13265
13464
  return element;
@@ -13268,34 +13467,8 @@ var PeriodToggle = ({
13268
13467
  );
13269
13468
  };
13270
13469
 
13271
- // src/components/shared/savings/Savings.tsx
13272
- var import_react21 = require("react");
13273
- var import_jsx_runtime27 = require("react/jsx-runtime");
13274
- var Savings = ({ plan, period }) => {
13275
- const theme = nt();
13276
- const savingsPercentage = (0, import_react21.useMemo)(() => {
13277
- if (plan) {
13278
- const monthly = (plan?.monthlyPrice?.price || 0) * 12;
13279
- const yearly = plan?.yearlyPrice?.price || 0;
13280
- return Math.round((monthly - yearly) / monthly * 1e4) / 100;
13281
- }
13282
- return 0;
13283
- }, [plan]);
13284
- return savingsPercentage > 0 && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
13285
- Text,
13286
- {
13287
- $font: theme.typography.text.fontFamily,
13288
- $size: 11,
13289
- $weight: theme.typography.text.fontWeight,
13290
- $color: theme.primary,
13291
- $leading: 1,
13292
- children: period === "month" ? `Save up to ${savingsPercentage}% with yearly billing` : `You are saving ${savingsPercentage}% with yearly billing`
13293
- }
13294
- );
13295
- };
13296
-
13297
13470
  // src/components/elements/payment-method/PaymentMethod.tsx
13298
- var import_jsx_runtime28 = require("react/jsx-runtime");
13471
+ var import_jsx_runtime27 = require("react/jsx-runtime");
13299
13472
  var resolveDesignProps4 = (props) => {
13300
13473
  return {
13301
13474
  header: {
@@ -13318,9 +13491,9 @@ var PaymentMethodElement = ({
13318
13491
  const theme = nt();
13319
13492
  const isLightBackground = useIsLightBackground();
13320
13493
  const sizeFactor = size === "lg" ? 2 : size === "md" ? 1 : 0.5;
13321
- return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Flex, { $flexDirection: "column", $gap: `${sizeFactor}rem`, children: [
13322
- props.header.isVisible && /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Flex, { $justifyContent: "space-between", $alignItems: "center", children: [
13323
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
13494
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Flex, { $flexDirection: "column", $gap: `${sizeFactor}rem`, children: [
13495
+ props.header.isVisible && /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Flex, { $justifyContent: "space-between", $alignItems: "center", children: [
13496
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
13324
13497
  Text,
13325
13498
  {
13326
13499
  $font: theme.typography[props.header.fontStyle].fontFamily,
@@ -13330,7 +13503,7 @@ var PaymentMethodElement = ({
13330
13503
  children: "Payment Method"
13331
13504
  }
13332
13505
  ),
13333
- props.functions.showExpiration && typeof monthsToExpiration === "number" && monthsToExpiration < 4 && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
13506
+ props.functions.showExpiration && typeof monthsToExpiration === "number" && monthsToExpiration < 4 && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
13334
13507
  Text,
13335
13508
  {
13336
13509
  $font: theme.typography.text.fontFamily,
@@ -13340,7 +13513,7 @@ var PaymentMethodElement = ({
13340
13513
  }
13341
13514
  )
13342
13515
  ] }),
13343
- /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
13516
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(
13344
13517
  Flex,
13345
13518
  {
13346
13519
  $justifyContent: "space-between",
@@ -13349,8 +13522,8 @@ var PaymentMethodElement = ({
13349
13522
  $padding: `${sizeFactor / 2}rem ${sizeFactor}rem`,
13350
13523
  $borderRadius: "9999px",
13351
13524
  children: [
13352
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Text, { $font: theme.typography.text.fontFamily, $size: 14, children: cardLast4 ? `\u{1F4B3} Card ending in ${cardLast4}` : "Other existing payment method" }),
13353
- props.functions.allowEdit && onEdit && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
13525
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Text, { $font: theme.typography.text.fontFamily, $size: 14, children: cardLast4 ? `\u{1F4B3} Card ending in ${cardLast4}` : "Other existing payment method" }),
13526
+ props.functions.allowEdit && onEdit && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
13354
13527
  Text,
13355
13528
  {
13356
13529
  onClick: onEdit,
@@ -13367,20 +13540,20 @@ var PaymentMethodElement = ({
13367
13540
  )
13368
13541
  ] });
13369
13542
  };
13370
- var PaymentMethod = (0, import_react22.forwardRef)(({ children, className, portal, allowEdit = true, ...rest }, ref) => {
13543
+ var PaymentMethod = (0, import_react23.forwardRef)(({ children, className, portal, allowEdit = true, ...rest }, ref) => {
13371
13544
  const props = resolveDesignProps4(rest);
13372
13545
  const theme = nt();
13373
13546
  const { api, data, layout, setLayout } = useEmbed();
13374
- const [isLoading, setIsLoading] = (0, import_react22.useState)(false);
13375
- const [error, setError] = (0, import_react22.useState)();
13376
- const [showPaymentForm, setShowPaymentForm] = (0, import_react22.useState)(
13547
+ const [isLoading, setIsLoading] = (0, import_react23.useState)(false);
13548
+ const [error, setError] = (0, import_react23.useState)();
13549
+ const [showPaymentForm, setShowPaymentForm] = (0, import_react23.useState)(
13377
13550
  () => typeof data.subscription?.paymentMethod === "undefined"
13378
13551
  );
13379
- const [stripe, setStripe] = (0, import_react22.useState)(null);
13380
- const [setupIntent, setSetupIntent] = (0, import_react22.useState)();
13381
- const [top, setTop] = (0, import_react22.useState)(0);
13552
+ const [stripe, setStripe] = (0, import_react23.useState)(null);
13553
+ const [setupIntent, setSetupIntent] = (0, import_react23.useState)();
13554
+ const [top, setTop] = (0, import_react23.useState)(0);
13382
13555
  const isLightBackground = useIsLightBackground();
13383
- const paymentMethod = (0, import_react22.useMemo)(() => {
13556
+ const paymentMethod = (0, import_react23.useMemo)(() => {
13384
13557
  const { paymentMethodType, cardLast4, cardExpMonth, cardExpYear } = data.subscription?.paymentMethod || {};
13385
13558
  let monthsToExpiration;
13386
13559
  if (typeof cardExpYear === "number" && typeof cardExpMonth === "number") {
@@ -13400,7 +13573,7 @@ var PaymentMethod = (0, import_react22.forwardRef)(({ children, className, porta
13400
13573
  monthsToExpiration
13401
13574
  };
13402
13575
  }, [data.subscription?.paymentMethod]);
13403
- const createSetupIntent = (0, import_react22.useCallback)(async () => {
13576
+ const createSetupIntent = (0, import_react23.useCallback)(async () => {
13404
13577
  if (!api || !data.component?.id) {
13405
13578
  return;
13406
13579
  }
@@ -13417,7 +13590,7 @@ var PaymentMethod = (0, import_react22.forwardRef)(({ children, className, porta
13417
13590
  setIsLoading(false);
13418
13591
  }
13419
13592
  }, [api, data.component?.id]);
13420
- const updatePaymentMethod = (0, import_react22.useCallback)(
13593
+ const updatePaymentMethod = (0, import_react23.useCallback)(
13421
13594
  async (id) => {
13422
13595
  if (!api || !id) {
13423
13596
  return;
@@ -13438,12 +13611,12 @@ var PaymentMethod = (0, import_react22.forwardRef)(({ children, className, porta
13438
13611
  },
13439
13612
  [api, setLayout]
13440
13613
  );
13441
- (0, import_react22.useEffect)(() => {
13614
+ (0, import_react23.useEffect)(() => {
13442
13615
  if (!stripe && setupIntent?.publishableKey) {
13443
13616
  setStripe(loadStripe(setupIntent.publishableKey));
13444
13617
  }
13445
13618
  }, [stripe, setupIntent?.publishableKey]);
13446
- (0, import_react22.useLayoutEffect)(() => {
13619
+ (0, import_react23.useLayoutEffect)(() => {
13447
13620
  const parent = portal || document.body;
13448
13621
  const value = Math.abs(parent.getBoundingClientRect().top ?? 0);
13449
13622
  setTop(value);
@@ -13455,8 +13628,8 @@ var PaymentMethod = (0, import_react22.forwardRef)(({ children, className, porta
13455
13628
  if (!paymentMethod.paymentMethodType) {
13456
13629
  return null;
13457
13630
  }
13458
- return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Element, { ref, className, children: [
13459
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
13631
+ return /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Element, { ref, className, children: [
13632
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
13460
13633
  PaymentMethodElement,
13461
13634
  {
13462
13635
  ...allowEdit && { onEdit: () => setLayout("payment") },
@@ -13464,9 +13637,9 @@ var PaymentMethod = (0, import_react22.forwardRef)(({ children, className, porta
13464
13637
  ...props
13465
13638
  }
13466
13639
  ),
13467
- layout === "payment" && (0, import_react_dom.createPortal)(
13468
- /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Modal, { size: "md", top, onClose: () => setShowPaymentForm(false), children: [
13469
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(ModalHeader, { bordered: true, children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
13640
+ layout === "payment" && (0, import_react_dom2.createPortal)(
13641
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Modal, { size: "md", top, onClose: () => setShowPaymentForm(false), children: [
13642
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(ModalHeader, { bordered: true, children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
13470
13643
  Text,
13471
13644
  {
13472
13645
  $font: theme.typography.text.fontFamily,
@@ -13476,7 +13649,7 @@ var PaymentMethod = (0, import_react22.forwardRef)(({ children, className, porta
13476
13649
  children: "Edit payment method"
13477
13650
  }
13478
13651
  ) }),
13479
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Flex, { $position: "relative", $height: "calc(100% - 5rem)", children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
13652
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Flex, { $position: "relative", $height: "calc(100% - 5rem)", children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
13480
13653
  Flex,
13481
13654
  {
13482
13655
  $flexDirection: "column",
@@ -13485,8 +13658,8 @@ var PaymentMethod = (0, import_react22.forwardRef)(({ children, className, porta
13485
13658
  $padding: "2rem 2.5rem 2rem 2.5rem",
13486
13659
  $backgroundColor: isLightBackground ? "hsla(0, 0%, 0%, 0.025)" : "hsla(0, 0%, 100%, 0.025)",
13487
13660
  $overflow: "auto",
13488
- children: /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(import_jsx_runtime28.Fragment, { children: [
13489
- showPaymentForm ? /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
13661
+ children: /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(import_jsx_runtime27.Fragment, { children: [
13662
+ showPaymentForm ? /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
13490
13663
  import_react_stripe_js3.Elements,
13491
13664
  {
13492
13665
  stripe,
@@ -13517,15 +13690,15 @@ var PaymentMethod = (0, import_react22.forwardRef)(({ children, className, porta
13517
13690
  },
13518
13691
  clientSecret: setupIntent?.setupIntentClientSecret
13519
13692
  },
13520
- children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
13693
+ children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
13521
13694
  PaymentForm,
13522
13695
  {
13523
13696
  onConfirm: (value) => updatePaymentMethod(value)
13524
13697
  }
13525
13698
  )
13526
13699
  }
13527
- ) : /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Flex, { $flexDirection: "column", $gap: "2rem", children: [
13528
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
13700
+ ) : /* @__PURE__ */ (0, import_jsx_runtime27.jsxs)(Flex, { $flexDirection: "column", $gap: "2rem", children: [
13701
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
13529
13702
  PaymentMethodElement,
13530
13703
  {
13531
13704
  size: "lg",
@@ -13533,7 +13706,7 @@ var PaymentMethod = (0, import_react22.forwardRef)(({ children, className, porta
13533
13706
  ...props
13534
13707
  }
13535
13708
  ),
13536
- /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Box, { children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
13709
+ /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Box, { children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
13537
13710
  Text,
13538
13711
  {
13539
13712
  onClick: createSetupIntent,
@@ -13545,7 +13718,7 @@ var PaymentMethod = (0, import_react22.forwardRef)(({ children, className, porta
13545
13718
  }
13546
13719
  ) })
13547
13720
  ] }),
13548
- !isLoading && error && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(Box, { children: /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
13721
+ !isLoading && error && /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(Box, { children: /* @__PURE__ */ (0, import_jsx_runtime27.jsx)(
13549
13722
  Text,
13550
13723
  {
13551
13724
  $font: theme.typography.text.fontFamily,
@@ -13566,9 +13739,9 @@ var PaymentMethod = (0, import_react22.forwardRef)(({ children, className, porta
13566
13739
  PaymentMethod.displayName = "PaymentMethod";
13567
13740
 
13568
13741
  // src/components/elements/plan-manager/PlanManager.tsx
13569
- var import_react23 = require("react");
13570
- var import_react_dom2 = require("react-dom");
13571
- var import_jsx_runtime29 = require("react/jsx-runtime");
13742
+ var import_react24 = require("react");
13743
+ var import_react_dom3 = require("react-dom");
13744
+ var import_jsx_runtime28 = require("react/jsx-runtime");
13572
13745
  var resolveDesignProps5 = (props) => {
13573
13746
  return {
13574
13747
  header: {
@@ -13582,7 +13755,7 @@ var resolveDesignProps5 = (props) => {
13582
13755
  },
13583
13756
  price: {
13584
13757
  isVisible: props.header?.price?.isVisible ?? true,
13585
- fontStyle: props.header?.price?.fontStyle ?? "text"
13758
+ fontStyle: props.header?.price?.fontStyle ?? "heading3"
13586
13759
  }
13587
13760
  },
13588
13761
  addOns: {
@@ -13597,7 +13770,7 @@ var resolveDesignProps5 = (props) => {
13597
13770
  }
13598
13771
  };
13599
13772
  };
13600
- var PlanManager = (0, import_react23.forwardRef)(({ children, className, portal, ...rest }, ref) => {
13773
+ var PlanManager = (0, import_react24.forwardRef)(({ children, className, portal, ...rest }, ref) => {
13601
13774
  const props = resolveDesignProps5(rest);
13602
13775
  const theme = nt();
13603
13776
  const { data, layout, setLayout } = useEmbed();
@@ -13607,7 +13780,7 @@ var PlanManager = (0, import_react23.forwardRef)(({ children, className, portal,
13607
13780
  canChangePlan: data.capabilities?.checkout ?? true,
13608
13781
  currentPlan: data.company?.plan
13609
13782
  };
13610
- return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
13783
+ return /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
13611
13784
  Element,
13612
13785
  {
13613
13786
  as: Flex,
@@ -13616,7 +13789,7 @@ var PlanManager = (0, import_react23.forwardRef)(({ children, className, portal,
13616
13789
  $flexDirection: "column",
13617
13790
  $gap: "2rem",
13618
13791
  children: [
13619
- props.header.isVisible && currentPlan && /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
13792
+ props.header.isVisible && currentPlan && /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
13620
13793
  Flex,
13621
13794
  {
13622
13795
  $justifyContent: "space-between",
@@ -13624,8 +13797,8 @@ var PlanManager = (0, import_react23.forwardRef)(({ children, className, portal,
13624
13797
  $flexWrap: "wrap",
13625
13798
  $gap: "1rem",
13626
13799
  children: [
13627
- /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Flex, { $flexDirection: "column", $gap: "1rem", children: [
13628
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
13800
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Flex, { $flexDirection: "column", $gap: "1rem", children: [
13801
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
13629
13802
  Text,
13630
13803
  {
13631
13804
  as: Box,
@@ -13637,7 +13810,7 @@ var PlanManager = (0, import_react23.forwardRef)(({ children, className, portal,
13637
13810
  children: currentPlan.name
13638
13811
  }
13639
13812
  ),
13640
- props.header.description.isVisible && currentPlan.description && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
13813
+ props.header.description.isVisible && currentPlan.description && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
13641
13814
  Text,
13642
13815
  {
13643
13816
  as: Box,
@@ -13649,8 +13822,8 @@ var PlanManager = (0, import_react23.forwardRef)(({ children, className, portal,
13649
13822
  }
13650
13823
  )
13651
13824
  ] }),
13652
- props.header.price.isVisible && typeof currentPlan.planPrice === "number" && currentPlan.planPeriod && /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Box, { children: [
13653
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
13825
+ props.header.price.isVisible && typeof currentPlan.planPrice === "number" && currentPlan.planPeriod && /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Box, { children: [
13826
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
13654
13827
  Text,
13655
13828
  {
13656
13829
  $font: theme.typography[props.header.price.fontStyle].fontFamily,
@@ -13660,7 +13833,7 @@ var PlanManager = (0, import_react23.forwardRef)(({ children, className, portal,
13660
13833
  children: formatCurrency(currentPlan.planPrice)
13661
13834
  }
13662
13835
  ),
13663
- /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
13836
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
13664
13837
  Text,
13665
13838
  {
13666
13839
  $font: theme.typography[props.header.price.fontStyle].fontFamily,
@@ -13677,8 +13850,8 @@ var PlanManager = (0, import_react23.forwardRef)(({ children, className, portal,
13677
13850
  ]
13678
13851
  }
13679
13852
  ),
13680
- props.addOns.isVisible && addOns.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Flex, { $flexDirection: "column", $gap: "1rem", children: [
13681
- props.addOns.showLabel && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
13853
+ props.addOns.isVisible && addOns.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(Flex, { $flexDirection: "column", $gap: "1rem", children: [
13854
+ props.addOns.showLabel && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
13682
13855
  Text,
13683
13856
  {
13684
13857
  $font: theme.typography.text.fontFamily,
@@ -13689,7 +13862,7 @@ var PlanManager = (0, import_react23.forwardRef)(({ children, className, portal,
13689
13862
  children: "Addons"
13690
13863
  }
13691
13864
  ),
13692
- addOns.map((addOn) => /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
13865
+ addOns.map((addOn) => /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
13693
13866
  Flex,
13694
13867
  {
13695
13868
  $justifyContent: "space-between",
@@ -13697,7 +13870,7 @@ var PlanManager = (0, import_react23.forwardRef)(({ children, className, portal,
13697
13870
  $flexWrap: "wrap",
13698
13871
  $gap: "1rem",
13699
13872
  children: [
13700
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
13873
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
13701
13874
  Text,
13702
13875
  {
13703
13876
  $font: theme.typography[props.addOns.fontStyle].fontFamily,
@@ -13707,7 +13880,7 @@ var PlanManager = (0, import_react23.forwardRef)(({ children, className, portal,
13707
13880
  children: addOn.name
13708
13881
  }
13709
13882
  ),
13710
- addOn.planPrice && addOn.planPeriod && /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
13883
+ addOn.planPrice && addOn.planPeriod && /* @__PURE__ */ (0, import_jsx_runtime28.jsxs)(
13711
13884
  Text,
13712
13885
  {
13713
13886
  $font: theme.typography.text.fontFamily,
@@ -13726,7 +13899,7 @@ var PlanManager = (0, import_react23.forwardRef)(({ children, className, portal,
13726
13899
  addOn.id
13727
13900
  ))
13728
13901
  ] }),
13729
- canChangePlan && props.callToAction.isVisible && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
13902
+ canChangePlan && props.callToAction.isVisible && /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(
13730
13903
  EmbedButton,
13731
13904
  {
13732
13905
  onClick: () => {
@@ -13737,8 +13910,8 @@ var PlanManager = (0, import_react23.forwardRef)(({ children, className, portal,
13737
13910
  children: "Change Plan"
13738
13911
  }
13739
13912
  ),
13740
- canChangePlan && layout === "checkout" && (0, import_react_dom2.createPortal)(
13741
- /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(CheckoutDialog, { ...portal && { portal } }),
13913
+ canChangePlan && layout === "checkout" && (0, import_react_dom3.createPortal)(
13914
+ /* @__PURE__ */ (0, import_jsx_runtime28.jsx)(CheckoutDialog, { ...portal && { portal } }),
13742
13915
  portal || document.body
13743
13916
  )
13744
13917
  ]
@@ -13748,10 +13921,10 @@ var PlanManager = (0, import_react23.forwardRef)(({ children, className, portal,
13748
13921
  PlanManager.displayName = "PlanManager";
13749
13922
 
13750
13923
  // src/components/elements/pricing-table/PricingTable.tsx
13751
- var import_react24 = require("react");
13752
- var import_react_dom3 = require("react-dom");
13924
+ var import_react25 = require("react");
13925
+ var import_react_dom4 = require("react-dom");
13753
13926
  var import_pluralize4 = __toESM(require_pluralize());
13754
- var import_jsx_runtime30 = require("react/jsx-runtime");
13927
+ var import_jsx_runtime29 = require("react/jsx-runtime");
13755
13928
  var resolveDesignProps6 = (props) => {
13756
13929
  return {
13757
13930
  showPeriodToggle: props.showPeriodToggle ?? true,
@@ -13791,21 +13964,21 @@ var resolveDesignProps6 = (props) => {
13791
13964
  }
13792
13965
  };
13793
13966
  };
13794
- var PricingTable = (0, import_react24.forwardRef)(({ children, className, portal, ...rest }, ref) => {
13967
+ var PricingTable = (0, import_react25.forwardRef)(({ children, className, portal, ...rest }, ref) => {
13795
13968
  const props = resolveDesignProps6(rest);
13796
13969
  const theme = nt();
13797
13970
  const { data, layout, setLayout } = useEmbed();
13798
- const [selectedPeriod, setSelectedPeriod] = (0, import_react24.useState)(
13971
+ const [selectedPeriod, setSelectedPeriod] = (0, import_react25.useState)(
13799
13972
  () => data.company?.plan?.planPeriod || "month"
13800
13973
  );
13801
- const [selectedPlanId, setSelectedPlanId] = (0, import_react24.useState)();
13802
- const [selectedAddOnId, setSelectedAddOnId] = (0, import_react24.useState)();
13974
+ const [selectedPlanId, setSelectedPlanId] = (0, import_react25.useState)();
13975
+ const [selectedAddOnId, setSelectedAddOnId] = (0, import_react25.useState)();
13803
13976
  const { plans, addOns, periods } = useAvailablePlans(selectedPeriod);
13804
13977
  const isLightBackground = useIsLightBackground();
13805
13978
  const canChangePlan = data.capabilities?.checkout ?? true;
13806
13979
  const cardPadding = theme.card.padding / TEXT_BASE_SIZE;
13807
13980
  const currentPlanIndex = plans.findIndex((plan) => plan.current);
13808
- return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
13981
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
13809
13982
  FussyChild,
13810
13983
  {
13811
13984
  ref,
@@ -13814,8 +13987,8 @@ var PricingTable = (0, import_react24.forwardRef)(({ children, className, portal
13814
13987
  $flexDirection: "column",
13815
13988
  $gap: "2rem",
13816
13989
  children: [
13817
- /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(Box, { children: [
13818
- /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
13990
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Box, { children: [
13991
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
13819
13992
  Flex,
13820
13993
  {
13821
13994
  $flexDirection: "column",
@@ -13824,13 +13997,13 @@ var PricingTable = (0, import_react24.forwardRef)(({ children, className, portal
13824
13997
  $gap: "1rem",
13825
13998
  $marginBottom: "1rem",
13826
13999
  $viewport: {
13827
- sm: {
14000
+ md: {
13828
14001
  $flexDirection: "row",
13829
14002
  $justifyContent: "space-between"
13830
14003
  }
13831
14004
  },
13832
14005
  children: [
13833
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
14006
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
13834
14007
  Text,
13835
14008
  {
13836
14009
  $font: theme.typography[props.header.fontStyle].fontFamily,
@@ -13840,7 +14013,7 @@ var PricingTable = (0, import_react24.forwardRef)(({ children, className, portal
13840
14013
  children: props.header.isVisible && props.plans.isVisible && plans.length > 0 && "Plans"
13841
14014
  }
13842
14015
  ),
13843
- props.showPeriodToggle && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
14016
+ props.showPeriodToggle && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
13844
14017
  PeriodToggle,
13845
14018
  {
13846
14019
  options: periods,
@@ -13851,7 +14024,7 @@ var PricingTable = (0, import_react24.forwardRef)(({ children, className, portal
13851
14024
  ]
13852
14025
  }
13853
14026
  ),
13854
- props.plans.isVisible && plans.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
14027
+ props.plans.isVisible && plans.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
13855
14028
  Box,
13856
14029
  {
13857
14030
  $display: "grid",
@@ -13859,7 +14032,7 @@ var PricingTable = (0, import_react24.forwardRef)(({ children, className, portal
13859
14032
  $gap: "1rem",
13860
14033
  children: plans.map((plan, index, self2) => {
13861
14034
  const isActivePlan = plan.current && data.company?.plan?.planPeriod === selectedPeriod;
13862
- return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
14035
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
13863
14036
  Flex,
13864
14037
  {
13865
14038
  $position: "relative",
@@ -13872,7 +14045,7 @@ var PricingTable = (0, import_react24.forwardRef)(({ children, className, portal
13872
14045
  $outlineColor: isActivePlan ? theme.primary : "transparent",
13873
14046
  ...theme.card.hasShadow && { $boxShadow: cardBoxShadow },
13874
14047
  children: [
13875
- /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
14048
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
13876
14049
  Flex,
13877
14050
  {
13878
14051
  $flexDirection: "column",
@@ -13882,7 +14055,7 @@ var PricingTable = (0, import_react24.forwardRef)(({ children, className, portal
13882
14055
  $borderStyle: "solid",
13883
14056
  $borderColor: isLightBackground ? "hsla(0, 0%, 0%, 0.175)" : "hsla(0, 0%, 100%, 0.175)",
13884
14057
  children: [
13885
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Box, { children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
14058
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Box, { children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
13886
14059
  Text,
13887
14060
  {
13888
14061
  $font: theme.typography[props.plans.name.fontStyle].fontFamily,
@@ -13892,7 +14065,7 @@ var PricingTable = (0, import_react24.forwardRef)(({ children, className, portal
13892
14065
  children: plan.name
13893
14066
  }
13894
14067
  ) }),
13895
- props.plans.description.isVisible && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Box, { $marginBottom: "0.5rem", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
14068
+ props.plans.description.isVisible && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Box, { $marginBottom: "0.5rem", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
13896
14069
  Text,
13897
14070
  {
13898
14071
  $font: theme.typography[props.plans.description.fontStyle].fontFamily,
@@ -13902,8 +14075,8 @@ var PricingTable = (0, import_react24.forwardRef)(({ children, className, portal
13902
14075
  children: plan.description
13903
14076
  }
13904
14077
  ) }),
13905
- /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(Box, { children: [
13906
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
14078
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Box, { children: [
14079
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
13907
14080
  Text,
13908
14081
  {
13909
14082
  $font: theme.typography[props.plans.name.fontStyle].fontFamily,
@@ -13915,7 +14088,7 @@ var PricingTable = (0, import_react24.forwardRef)(({ children, className, portal
13915
14088
  )
13916
14089
  }
13917
14090
  ),
13918
- /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
14091
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
13919
14092
  Text,
13920
14093
  {
13921
14094
  $font: theme.typography[props.plans.name.fontStyle].fontFamily,
@@ -13929,7 +14102,7 @@ var PricingTable = (0, import_react24.forwardRef)(({ children, className, portal
13929
14102
  }
13930
14103
  )
13931
14104
  ] }),
13932
- isActivePlan && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
14105
+ isActivePlan && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
13933
14106
  Flex,
13934
14107
  {
13935
14108
  $position: "absolute",
@@ -13946,7 +14119,7 @@ var PricingTable = (0, import_react24.forwardRef)(({ children, className, portal
13946
14119
  ]
13947
14120
  }
13948
14121
  ),
13949
- /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
14122
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
13950
14123
  Flex,
13951
14124
  {
13952
14125
  $flexDirection: "column",
@@ -13955,8 +14128,8 @@ var PricingTable = (0, import_react24.forwardRef)(({ children, className, portal
13955
14128
  $gap: `${cardPadding}rem`,
13956
14129
  $padding: `${0.75 * cardPadding}rem ${cardPadding}rem 0`,
13957
14130
  children: [
13958
- props.plans.showEntitlements && /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(Flex, { $flexDirection: "column", $gap: "1rem", $flexGrow: "1", children: [
13959
- props.plans.showInclusionText && index > 0 && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Box, { $marginBottom: "1.5rem", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
14131
+ props.plans.showEntitlements && /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Flex, { $flexDirection: "column", $gap: "1rem", $flexGrow: "1", children: [
14132
+ props.plans.showInclusionText && index > 0 && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Box, { $marginBottom: "1.5rem", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
13960
14133
  Text,
13961
14134
  {
13962
14135
  $font: theme.typography.text.fontFamily,
@@ -13971,8 +14144,8 @@ var PricingTable = (0, import_react24.forwardRef)(({ children, className, portal
13971
14144
  }
13972
14145
  ) }),
13973
14146
  plan.entitlements.map((entitlement) => {
13974
- return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(Flex, { $gap: "1rem", children: [
13975
- props.plans.showFeatureIcons && entitlement.feature?.icon && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
14147
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Flex, { $gap: "1rem", children: [
14148
+ props.plans.showFeatureIcons && entitlement.feature?.icon && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
13976
14149
  IconRound,
13977
14150
  {
13978
14151
  name: entitlement.feature.icon,
@@ -13983,14 +14156,14 @@ var PricingTable = (0, import_react24.forwardRef)(({ children, className, portal
13983
14156
  ]
13984
14157
  }
13985
14158
  ),
13986
- entitlement.feature?.name && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Flex, { $alignItems: "center", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
14159
+ entitlement.feature?.name && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Flex, { $alignItems: "center", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
13987
14160
  Text,
13988
14161
  {
13989
14162
  $font: theme.typography.text.fontFamily,
13990
14163
  $size: theme.typography.text.fontSize,
13991
14164
  $weight: theme.typography.text.fontWeight,
13992
14165
  $color: theme.typography.text.color,
13993
- children: entitlement.valueType === "numeric" || entitlement.valueType === "unlimited" || entitlement.valueType === "trait" ? /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_jsx_runtime30.Fragment, { children: [
14166
+ children: entitlement.valueType === "numeric" || entitlement.valueType === "unlimited" || entitlement.valueType === "trait" ? /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_jsx_runtime29.Fragment, { children: [
13994
14167
  typeof entitlement.valueNumeric === "number" ? `${formatNumber(entitlement.valueNumeric)} ${(0, import_pluralize4.default)(entitlement.feature.name, entitlement.valueNumeric)}` : `Unlimited ${(0, import_pluralize4.default)(entitlement.feature.name)}`,
13995
14168
  entitlement.metricPeriod && ` per ${{
13996
14169
  billing: "billing period",
@@ -14004,7 +14177,7 @@ var PricingTable = (0, import_react24.forwardRef)(({ children, className, portal
14004
14177
  ] }, entitlement.id);
14005
14178
  })
14006
14179
  ] }),
14007
- isActivePlan ? /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
14180
+ isActivePlan ? /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
14008
14181
  Flex,
14009
14182
  {
14010
14183
  $justifyContent: "center",
@@ -14012,7 +14185,7 @@ var PricingTable = (0, import_react24.forwardRef)(({ children, className, portal
14012
14185
  $gap: "0.25rem",
14013
14186
  $padding: "0.625rem 0",
14014
14187
  children: [
14015
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
14188
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
14016
14189
  Icon2,
14017
14190
  {
14018
14191
  name: "check-rounded",
@@ -14023,7 +14196,7 @@ var PricingTable = (0, import_react24.forwardRef)(({ children, className, portal
14023
14196
  }
14024
14197
  }
14025
14198
  ),
14026
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
14199
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
14027
14200
  Text,
14028
14201
  {
14029
14202
  $size: 15,
@@ -14034,7 +14207,7 @@ var PricingTable = (0, import_react24.forwardRef)(({ children, className, portal
14034
14207
  )
14035
14208
  ]
14036
14209
  }
14037
- ) : (props.upgrade.isVisible || props.downgrade.isVisible) && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
14210
+ ) : (props.upgrade.isVisible || props.downgrade.isVisible) && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
14038
14211
  EmbedButton,
14039
14212
  {
14040
14213
  disabled: !plan.valid,
@@ -14052,11 +14225,11 @@ var PricingTable = (0, import_react24.forwardRef)(({ children, className, portal
14052
14225
  $color: props.downgrade.buttonStyle,
14053
14226
  $variant: "outline"
14054
14227
  },
14055
- children: !plan.valid ? /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
14228
+ children: !plan.valid ? /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
14056
14229
  Tooltip,
14057
14230
  {
14058
- label: "Over usage limit",
14059
- description: "Current usage exceeds the limit of this plan."
14231
+ trigger: "Over usage limit",
14232
+ content: "Current usage exceeds the limit of this plan."
14060
14233
  }
14061
14234
  ) : "Choose plan"
14062
14235
  }
@@ -14072,14 +14245,14 @@ var PricingTable = (0, import_react24.forwardRef)(({ children, className, portal
14072
14245
  }
14073
14246
  )
14074
14247
  ] }),
14075
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Box, { children: props.addOns.isVisible && addOns.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_jsx_runtime30.Fragment, { children: [
14076
- props.header.isVisible && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
14248
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Box, { children: props.addOns.isVisible && addOns.length > 0 && /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_jsx_runtime29.Fragment, { children: [
14249
+ props.header.isVisible && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
14077
14250
  Flex,
14078
14251
  {
14079
14252
  $justifyContent: "space-between",
14080
14253
  $alignItems: "center",
14081
14254
  $marginBottom: "1rem",
14082
- children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
14255
+ children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
14083
14256
  Text,
14084
14257
  {
14085
14258
  $font: theme.typography[props.header.fontStyle].fontFamily,
@@ -14091,7 +14264,7 @@ var PricingTable = (0, import_react24.forwardRef)(({ children, className, portal
14091
14264
  )
14092
14265
  }
14093
14266
  ),
14094
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
14267
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
14095
14268
  Box,
14096
14269
  {
14097
14270
  $display: "grid",
@@ -14099,7 +14272,7 @@ var PricingTable = (0, import_react24.forwardRef)(({ children, className, portal
14099
14272
  $gap: "1rem",
14100
14273
  children: addOns.map((addOn, index) => {
14101
14274
  const isActiveAddOn = addOn.current && selectedPeriod === data.company?.addOns.find((a2) => a2.id === addOn.id)?.planPeriod;
14102
- return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
14275
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
14103
14276
  Flex,
14104
14277
  {
14105
14278
  $position: "relative",
@@ -14113,8 +14286,8 @@ var PricingTable = (0, import_react24.forwardRef)(({ children, className, portal
14113
14286
  $outlineColor: isActiveAddOn ? theme.primary : "transparent",
14114
14287
  ...theme.card.hasShadow && { $boxShadow: cardBoxShadow },
14115
14288
  children: [
14116
- /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(Flex, { $flexDirection: "column", $gap: "0.75rem", children: [
14117
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Box, { children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
14289
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Flex, { $flexDirection: "column", $gap: "0.75rem", children: [
14290
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Box, { children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
14118
14291
  Text,
14119
14292
  {
14120
14293
  $font: theme.typography[props.plans.name.fontStyle].fontFamily,
@@ -14124,7 +14297,7 @@ var PricingTable = (0, import_react24.forwardRef)(({ children, className, portal
14124
14297
  children: addOn.name
14125
14298
  }
14126
14299
  ) }),
14127
- props.addOns.showDescription && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Box, { $marginBottom: "0.5rem", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
14300
+ props.addOns.showDescription && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Box, { $marginBottom: "0.5rem", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
14128
14301
  Text,
14129
14302
  {
14130
14303
  $font: theme.typography[props.plans.description.fontStyle].fontFamily,
@@ -14134,8 +14307,8 @@ var PricingTable = (0, import_react24.forwardRef)(({ children, className, portal
14134
14307
  children: addOn.description
14135
14308
  }
14136
14309
  ) }),
14137
- /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(Box, { children: [
14138
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
14310
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Box, { children: [
14311
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
14139
14312
  Text,
14140
14313
  {
14141
14314
  $font: theme.typography[props.plans.name.fontStyle].fontFamily,
@@ -14147,7 +14320,7 @@ var PricingTable = (0, import_react24.forwardRef)(({ children, className, portal
14147
14320
  )
14148
14321
  }
14149
14322
  ),
14150
- /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
14323
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
14151
14324
  Text,
14152
14325
  {
14153
14326
  $font: theme.typography[props.plans.name.fontStyle].fontFamily,
@@ -14161,7 +14334,7 @@ var PricingTable = (0, import_react24.forwardRef)(({ children, className, portal
14161
14334
  }
14162
14335
  )
14163
14336
  ] }),
14164
- isActiveAddOn && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
14337
+ isActiveAddOn && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
14165
14338
  Flex,
14166
14339
  {
14167
14340
  $position: "absolute",
@@ -14176,7 +14349,7 @@ var PricingTable = (0, import_react24.forwardRef)(({ children, className, portal
14176
14349
  }
14177
14350
  )
14178
14351
  ] }),
14179
- /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
14352
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(
14180
14353
  Flex,
14181
14354
  {
14182
14355
  $flexDirection: "column",
@@ -14184,7 +14357,7 @@ var PricingTable = (0, import_react24.forwardRef)(({ children, className, portal
14184
14357
  $gap: `${cardPadding}rem`,
14185
14358
  $flexGrow: "1",
14186
14359
  children: [
14187
- props.addOns.showEntitlements && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
14360
+ props.addOns.showEntitlements && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
14188
14361
  Flex,
14189
14362
  {
14190
14363
  $flexDirection: "column",
@@ -14192,15 +14365,15 @@ var PricingTable = (0, import_react24.forwardRef)(({ children, className, portal
14192
14365
  $gap: "1rem",
14193
14366
  $flexGrow: "1",
14194
14367
  children: addOn.entitlements.map((entitlement) => {
14195
- return /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
14368
+ return /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
14196
14369
  Flex,
14197
14370
  {
14198
14371
  $flexWrap: "wrap",
14199
14372
  $justifyContent: "space-between",
14200
14373
  $alignItems: "center",
14201
14374
  $gap: "1rem",
14202
- children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(Flex, { $gap: "1rem", children: [
14203
- props.addOns.showFeatureIcons && entitlement.feature?.icon && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
14375
+ children: /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(Flex, { $gap: "1rem", children: [
14376
+ props.addOns.showFeatureIcons && entitlement.feature?.icon && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
14204
14377
  IconRound,
14205
14378
  {
14206
14379
  name: entitlement.feature.icon,
@@ -14211,14 +14384,14 @@ var PricingTable = (0, import_react24.forwardRef)(({ children, className, portal
14211
14384
  ]
14212
14385
  }
14213
14386
  ),
14214
- entitlement.feature?.name && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Flex, { $alignItems: "center", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
14387
+ entitlement.feature?.name && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(Flex, { $alignItems: "center", children: /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
14215
14388
  Text,
14216
14389
  {
14217
14390
  $font: theme.typography.text.fontFamily,
14218
14391
  $size: theme.typography.text.fontSize,
14219
14392
  $weight: theme.typography.text.fontWeight,
14220
14393
  $color: theme.typography.text.color,
14221
- children: entitlement.valueType === "numeric" || entitlement.valueType === "unlimited" || entitlement.valueType === "trait" ? /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(import_jsx_runtime30.Fragment, { children: [
14394
+ children: entitlement.valueType === "numeric" || entitlement.valueType === "unlimited" || entitlement.valueType === "trait" ? /* @__PURE__ */ (0, import_jsx_runtime29.jsxs)(import_jsx_runtime29.Fragment, { children: [
14222
14395
  typeof entitlement.valueNumeric === "number" ? `${formatNumber(entitlement.valueNumeric)} ${(0, import_pluralize4.default)(entitlement.feature.name, entitlement.valueNumeric)}` : `Unlimited ${(0, import_pluralize4.default)(entitlement.feature.name)}`,
14223
14396
  entitlement.metricPeriod && ` per ${{
14224
14397
  billing: "billing period",
@@ -14236,7 +14409,7 @@ var PricingTable = (0, import_react24.forwardRef)(({ children, className, portal
14236
14409
  })
14237
14410
  }
14238
14411
  ),
14239
- props.upgrade.isVisible && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
14412
+ props.upgrade.isVisible && /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
14240
14413
  EmbedButton,
14241
14414
  {
14242
14415
  disabled: !addOn.valid,
@@ -14261,8 +14434,8 @@ var PricingTable = (0, import_react24.forwardRef)(({ children, className, portal
14261
14434
  }
14262
14435
  )
14263
14436
  ] }) }),
14264
- canChangePlan && layout === "checkout" && (0, import_react_dom3.createPortal)(
14265
- /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
14437
+ canChangePlan && layout === "checkout" && (0, import_react_dom4.createPortal)(
14438
+ /* @__PURE__ */ (0, import_jsx_runtime29.jsx)(
14266
14439
  CheckoutDialog,
14267
14440
  {
14268
14441
  initialPeriod: selectedPeriod,
@@ -14279,8 +14452,8 @@ var PricingTable = (0, import_react24.forwardRef)(({ children, className, portal
14279
14452
  PricingTable.displayName = "PricingTable";
14280
14453
 
14281
14454
  // src/components/elements/upcoming-bill/UpcomingBill.tsx
14282
- var import_react25 = require("react");
14283
- var import_jsx_runtime31 = require("react/jsx-runtime");
14455
+ var import_react26 = require("react");
14456
+ var import_jsx_runtime30 = require("react/jsx-runtime");
14284
14457
  function resolveDesignProps7(props) {
14285
14458
  return {
14286
14459
  header: {
@@ -14299,11 +14472,11 @@ function resolveDesignProps7(props) {
14299
14472
  }
14300
14473
  };
14301
14474
  }
14302
- var UpcomingBill = (0, import_react25.forwardRef)(({ className, ...rest }, ref) => {
14475
+ var UpcomingBill = (0, import_react26.forwardRef)(({ className, ...rest }, ref) => {
14303
14476
  const props = resolveDesignProps7(rest);
14304
14477
  const theme = nt();
14305
14478
  const { data } = useEmbed();
14306
- const { upcomingInvoice } = (0, import_react25.useMemo)(() => {
14479
+ const { upcomingInvoice } = (0, import_react26.useMemo)(() => {
14307
14480
  return {
14308
14481
  upcomingInvoice: {
14309
14482
  ...typeof data.upcomingInvoice?.amountDue === "number" && {
@@ -14321,14 +14494,14 @@ var UpcomingBill = (0, import_react25.forwardRef)(({ className, ...rest }, ref)
14321
14494
  if (typeof upcomingInvoice.amountDue !== "number" || !upcomingInvoice.dueDate) {
14322
14495
  return null;
14323
14496
  }
14324
- return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(Element, { ref, className, children: [
14325
- props.header.isVisible && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
14497
+ return /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(Element, { ref, className, children: [
14498
+ props.header.isVisible && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
14326
14499
  Flex,
14327
14500
  {
14328
14501
  $justifyContent: "space-between",
14329
14502
  $alignItems: "center",
14330
14503
  $margin: "0 0 1rem",
14331
- children: /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
14504
+ children: /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(
14332
14505
  Text,
14333
14506
  {
14334
14507
  $font: theme.typography[props.header.fontStyle].fontFamily,
@@ -14344,8 +14517,8 @@ var UpcomingBill = (0, import_react25.forwardRef)(({ className, ...rest }, ref)
14344
14517
  )
14345
14518
  }
14346
14519
  ),
14347
- /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(Flex, { $justifyContent: "space-between", $alignItems: "start", $gap: "1rem", children: [
14348
- props.price.isVisible && /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Flex, { $alignItems: "end", $flexGrow: "1", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
14520
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsxs)(Flex, { $justifyContent: "space-between", $alignItems: "start", $gap: "1rem", children: [
14521
+ props.price.isVisible && /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Flex, { $alignItems: "end", $flexGrow: "1", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
14349
14522
  Text,
14350
14523
  {
14351
14524
  $font: theme.typography[props.price.fontStyle].fontFamily,
@@ -14356,7 +14529,7 @@ var UpcomingBill = (0, import_react25.forwardRef)(({ className, ...rest }, ref)
14356
14529
  children: formatCurrency(upcomingInvoice.amountDue)
14357
14530
  }
14358
14531
  ) }),
14359
- /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Box, { $lineHeight: 1.15, $maxWidth: "10rem", $textAlign: "right", children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
14532
+ /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(Box, { $lineHeight: 1.15, $maxWidth: "10rem", $textAlign: "right", children: /* @__PURE__ */ (0, import_jsx_runtime30.jsx)(
14360
14533
  Text,
14361
14534
  {
14362
14535
  $font: theme.typography[props.contractEndDate.fontStyle].fontFamily,
@@ -14373,10 +14546,10 @@ var UpcomingBill = (0, import_react25.forwardRef)(({ className, ...rest }, ref)
14373
14546
  UpcomingBill.displayName = "UpcomingBill";
14374
14547
 
14375
14548
  // src/components/embed/ComponentTree.tsx
14376
- var import_react27 = require("react");
14549
+ var import_react28 = require("react");
14377
14550
 
14378
14551
  // src/components/embed/renderer.ts
14379
- var import_react26 = require("react");
14552
+ var import_react27 = require("react");
14380
14553
  var components = {
14381
14554
  Root,
14382
14555
  Viewport,
@@ -14408,7 +14581,7 @@ function createRenderer(options) {
14408
14581
  const { className, ...rest } = props;
14409
14582
  const resolvedProps = component === "div" ? rest : props;
14410
14583
  const resolvedChildren = children.map(renderNode);
14411
- return (0, import_react26.createElement)(
14584
+ return (0, import_react27.createElement)(
14412
14585
  component,
14413
14586
  {
14414
14587
  key: index,
@@ -14421,10 +14594,10 @@ function createRenderer(options) {
14421
14594
  }
14422
14595
 
14423
14596
  // src/components/embed/ComponentTree.tsx
14424
- var import_jsx_runtime32 = require("react/jsx-runtime");
14597
+ var import_jsx_runtime31 = require("react/jsx-runtime");
14425
14598
  var Loading = () => {
14426
14599
  const theme = nt();
14427
- return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
14600
+ return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
14428
14601
  Flex,
14429
14602
  {
14430
14603
  $width: "100%",
@@ -14432,13 +14605,13 @@ var Loading = () => {
14432
14605
  $alignItems: "center",
14433
14606
  $justifyContent: "center",
14434
14607
  $padding: `${theme.card.padding / TEXT_BASE_SIZE}rem`,
14435
- children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Loader, { $size: "2xl", $color: "#194BFB" })
14608
+ children: /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Loader, { $size: "2xl", $color: "#194BFB" })
14436
14609
  }
14437
14610
  );
14438
14611
  };
14439
14612
  var Error2 = ({ message }) => {
14440
14613
  const theme = nt();
14441
- return /* @__PURE__ */ (0, import_jsx_runtime32.jsxs)(
14614
+ return /* @__PURE__ */ (0, import_jsx_runtime31.jsxs)(
14442
14615
  Flex,
14443
14616
  {
14444
14617
  $flexDirection: "column",
@@ -14449,7 +14622,7 @@ var Error2 = ({ message }) => {
14449
14622
  $alignItems: "center",
14450
14623
  $justifyContent: "center",
14451
14624
  children: [
14452
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
14625
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
14453
14626
  Box,
14454
14627
  {
14455
14628
  $marginBottom: `${8 / TEXT_BASE_SIZE}rem`,
@@ -14460,7 +14633,7 @@ var Error2 = ({ message }) => {
14460
14633
  children: "404 Error"
14461
14634
  }
14462
14635
  ),
14463
- /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(
14636
+ /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(
14464
14637
  Box,
14465
14638
  {
14466
14639
  $marginBottom: `${8 / TEXT_BASE_SIZE}rem`,
@@ -14477,31 +14650,31 @@ var Error2 = ({ message }) => {
14477
14650
  };
14478
14651
  var ComponentTree = () => {
14479
14652
  const { error, nodes } = useEmbed();
14480
- const [children, setChildren] = (0, import_react27.useState)(/* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Loading, {}));
14481
- (0, import_react27.useEffect)(() => {
14653
+ const [children, setChildren] = (0, import_react28.useState)(/* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Loading, {}));
14654
+ (0, import_react28.useEffect)(() => {
14482
14655
  const renderer = createRenderer();
14483
14656
  setChildren(nodes.map(renderer));
14484
14657
  }, [nodes]);
14485
14658
  if (error) {
14486
14659
  console.error(error);
14487
- return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Error2, { message: error.message });
14660
+ return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Error2, { message: error.message });
14488
14661
  }
14489
- if (import_react27.Children.count(children) === 0) {
14490
- return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(Loading, {});
14662
+ if (import_react28.Children.count(children) === 0) {
14663
+ return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(Loading, {});
14491
14664
  }
14492
- return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(import_jsx_runtime32.Fragment, { children });
14665
+ return /* @__PURE__ */ (0, import_jsx_runtime31.jsx)(import_jsx_runtime31.Fragment, { children });
14493
14666
  };
14494
14667
 
14495
14668
  // src/components/embed/Embed.tsx
14496
- var import_jsx_runtime33 = require("react/jsx-runtime");
14669
+ var import_jsx_runtime32 = require("react/jsx-runtime");
14497
14670
  var SchematicEmbed = ({ id, accessToken, apiConfig }) => {
14498
14671
  if (accessToken?.length === 0) {
14499
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { children: "Please provide an access token." });
14672
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { children: "Please provide an access token." });
14500
14673
  }
14501
14674
  if (!accessToken?.startsWith("token_")) {
14502
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)("div", { children: 'Invalid access token; your temporary access token will start with "token_".' });
14675
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)("div", { children: 'Invalid access token; your temporary access token will start with "token_".' });
14503
14676
  }
14504
- return /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(EmbedProvider, { id, accessToken, apiConfig, children: /* @__PURE__ */ (0, import_jsx_runtime33.jsx)(ComponentTree, {}) });
14677
+ return /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(EmbedProvider, { id, accessToken, apiConfig, children: /* @__PURE__ */ (0, import_jsx_runtime32.jsx)(ComponentTree, {}) });
14505
14678
  };
14506
14679
  /*! Bundled license information:
14507
14680