@embedreach/components 0.1.17 → 0.1.18

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.
@@ -4316,19 +4316,19 @@ function Portal$5(props) {
4316
4316
  createRoot((dispose2) => insert(el, () => !clean() ? content() : dispose2(), null));
4317
4317
  onCleanup(cleanup);
4318
4318
  } else {
4319
- const container = createElement(props.isSVG ? "g" : "div", props.isSVG), renderRoot = useShadow && container.attachShadow ? container.attachShadow({
4319
+ const container2 = createElement(props.isSVG ? "g" : "div", props.isSVG), renderRoot = useShadow && container2.attachShadow ? container2.attachShadow({
4320
4320
  mode: "open"
4321
- }) : container;
4322
- Object.defineProperty(container, "_$host", {
4321
+ }) : container2;
4322
+ Object.defineProperty(container2, "_$host", {
4323
4323
  get() {
4324
4324
  return marker.parentNode;
4325
4325
  },
4326
4326
  configurable: true
4327
4327
  });
4328
4328
  insert(renderRoot, content);
4329
- el.appendChild(container);
4330
- props.ref && props.ref(container);
4331
- onCleanup(() => el.removeChild(container));
4329
+ el.appendChild(container2);
4330
+ props.ref && props.ref(container2);
4331
+ onCleanup(() => el.removeChild(container2));
4332
4332
  }
4333
4333
  },
4334
4334
  void 0,
@@ -7993,11 +7993,64 @@ const normalizeColor = (color2) => {
7993
7993
  return computed;
7994
7994
  };
7995
7995
  const isValidColor = (color2) => {
7996
+ if (/^\d+\s+\d+(?:\.\d+)?%\s+\d+(?:\.\d+)?%$/.test(color2.trim())) {
7997
+ return true;
7998
+ }
7996
7999
  const div = document.createElement("div");
7997
8000
  const prevColor = div.style.color;
7998
8001
  div.style.color = color2;
7999
8002
  return div.style.color !== prevColor;
8000
8003
  };
8004
+ const rgbToShadcnHsl = (r2, g2, b3) => {
8005
+ r2 /= 255;
8006
+ g2 /= 255;
8007
+ b3 /= 255;
8008
+ const max2 = Math.max(r2, g2, b3);
8009
+ const min2 = Math.min(r2, g2, b3);
8010
+ let h4 = 0, s3 = 0;
8011
+ const l2 = (max2 + min2) / 2;
8012
+ if (max2 !== min2) {
8013
+ const d4 = max2 - min2;
8014
+ s3 = l2 > 0.5 ? d4 / (2 - max2 - min2) : d4 / (max2 + min2);
8015
+ switch (max2) {
8016
+ case r2:
8017
+ h4 = (g2 - b3) / d4 + (g2 < b3 ? 6 : 0);
8018
+ break;
8019
+ case g2:
8020
+ h4 = (b3 - r2) / d4 + 2;
8021
+ break;
8022
+ case b3:
8023
+ h4 = (r2 - g2) / d4 + 4;
8024
+ break;
8025
+ }
8026
+ h4 *= 60;
8027
+ }
8028
+ return `${Math.round(h4)} ${Math.round(s3 * 100)}% ${Math.round(l2 * 100)}%`;
8029
+ };
8030
+ const extractRgb = (rgbColor) => {
8031
+ const matches = rgbColor.match(/\d+/g);
8032
+ if (!matches || matches.length < 3) {
8033
+ throw new Error(`Invalid RGB color format: ${rgbColor}`);
8034
+ }
8035
+ return [
8036
+ parseInt(matches[0], 10),
8037
+ parseInt(matches[1], 10),
8038
+ parseInt(matches[2], 10)
8039
+ ];
8040
+ };
8041
+ const toShadcnFormat = (color2) => {
8042
+ if (/^\d+\s+\d+(?:\.\d+)?%\s+\d+(?:\.\d+)?%$/.test(color2.trim())) {
8043
+ return color2.trim();
8044
+ }
8045
+ try {
8046
+ const rgbColor = normalizeColor(color2);
8047
+ const [r2, g2, b3] = extractRgb(rgbColor);
8048
+ return rgbToShadcnHsl(r2, g2, b3);
8049
+ } catch (e4) {
8050
+ console.warn(`Failed to convert color to shadcn format: ${color2}`, e4);
8051
+ return color2;
8052
+ }
8053
+ };
8001
8054
  const DEFAULT_THEME_STYLES = {
8002
8055
  primary: "hsl(222.2 47.4% 11.2%)",
8003
8056
  background: "hsl(0 0% 100%)",
@@ -8031,13 +8084,17 @@ const applyThemeStyles = (styles2) => {
8031
8084
  ${Object.entries(DEFAULT_THEME_STYLES).map(([key, defaultValue]) => {
8032
8085
  const userValue = styles2[key];
8033
8086
  let finalValue = defaultValue;
8034
- if (userValue && isValidColor(userValue)) {
8035
- try {
8036
- finalValue = normalizeColor(userValue);
8037
- } catch {
8038
- console.warn(
8039
- `Failed to normalize color for ${key}, using default`
8040
- );
8087
+ if (userValue !== void 0) {
8088
+ if (key === "radius") {
8089
+ finalValue = userValue;
8090
+ } else if (isValidColor(userValue)) {
8091
+ try {
8092
+ finalValue = toShadcnFormat(userValue);
8093
+ } catch (e4) {
8094
+ console.warn(
8095
+ `Failed to convert color for ${key}, using default`
8096
+ );
8097
+ }
8041
8098
  }
8042
8099
  }
8043
8100
  return `--reach-${key}: ${finalValue};`;
@@ -8050,7 +8107,7 @@ const applyThemeStyles = (styles2) => {
8050
8107
  const themeReducer = (state, action) => {
8051
8108
  switch (action.type) {
8052
8109
  case "set_theme":
8053
- if (action.payload) {
8110
+ if (action.payload && !state.theme) {
8054
8111
  applyThemeStyles(action.payload.styles);
8055
8112
  }
8056
8113
  return {
@@ -8086,7 +8143,7 @@ const { Provider } = createDataContext(
8086
8143
  },
8087
8144
  {
8088
8145
  theme: null,
8089
- loading: false,
8146
+ loading: true,
8090
8147
  error: null
8091
8148
  }
8092
8149
  );
@@ -10715,7 +10772,7 @@ class Browser {
10715
10772
  }
10716
10773
  Browser.type = "languageDetector";
10717
10774
  const ad_spend$1 = "Ad Spend";
10718
- const date$1 = "Date";
10775
+ const date$2 = "Date";
10719
10776
  const close$1 = "Close";
10720
10777
  const connected$1 = "Connected";
10721
10778
  const connecting$1 = "Connecting...";
@@ -11059,7 +11116,7 @@ const empty_state$1 = {
11059
11116
  };
11060
11117
  const enCommon = {
11061
11118
  ad_spend: ad_spend$1,
11062
- date: date$1,
11119
+ date: date$2,
11063
11120
  close: close$1,
11064
11121
  "continue": "Continue",
11065
11122
  connected: connected$1,
@@ -11098,7 +11155,7 @@ const enCommon = {
11098
11155
  empty_state: empty_state$1
11099
11156
  };
11100
11157
  const ad_spend = "Gasto en anuncios";
11101
- const date = "Fecha";
11158
+ const date$1 = "Fecha";
11102
11159
  const close = "Cerrar";
11103
11160
  const connected = "Conectado";
11104
11161
  const connecting = "Conectando...";
@@ -11442,7 +11499,7 @@ const empty_state = {
11442
11499
  };
11443
11500
  const esCommon = {
11444
11501
  ad_spend,
11445
- date,
11502
+ date: date$1,
11446
11503
  close,
11447
11504
  "continue": "Continuar",
11448
11505
  connected,
@@ -21881,7 +21938,7 @@ const ActionButtons$1 = ({
21881
21938
  )
21882
21939
  ] }) });
21883
21940
  };
21884
- const styles$4 = {
21941
+ const styles$5 = {
21885
21942
  iconWrapper: "mb-4",
21886
21943
  cardTitle: "text-lg font-medium mb-2",
21887
21944
  cardDescription: "text-sm text-gray-600",
@@ -21889,36 +21946,36 @@ const styles$4 = {
21889
21946
  };
21890
21947
  const OneTimeBroadcast = () => {
21891
21948
  return /* @__PURE__ */ jsxs("div", { children: [
21892
- /* @__PURE__ */ jsx("div", { className: styles$4.iconWrapper, children: "📨" }),
21893
- /* @__PURE__ */ jsx("h3", { className: styles$4.cardTitle, children: "One-Time Broadcast" }),
21894
- /* @__PURE__ */ jsx("p", { className: styles$4.cardDescription, children: "Send a single message to your current list, like announcing a sale or newsletter." })
21949
+ /* @__PURE__ */ jsx("div", { className: styles$5.iconWrapper, children: "📨" }),
21950
+ /* @__PURE__ */ jsx("h3", { className: styles$5.cardTitle, children: "One-Time Broadcast" }),
21951
+ /* @__PURE__ */ jsx("p", { className: styles$5.cardDescription, children: "Send a single message to your current list, like announcing a sale or newsletter." })
21895
21952
  ] });
21896
21953
  };
21897
21954
  const PatronEntersList = () => {
21898
21955
  return /* @__PURE__ */ jsxs("div", { children: [
21899
- /* @__PURE__ */ jsx("div", { className: styles$4.comingSoonBadge, children: "Coming Soon" }),
21900
- /* @__PURE__ */ jsx("div", { className: styles$4.iconWrapper, children: "✉️" }),
21901
- /* @__PURE__ */ jsx("h3", { className: styles$4.cardTitle, children: "Patron Enters a List" }),
21902
- /* @__PURE__ */ jsx("p", { className: styles$4.cardDescription, children: "Send whenever someone becomes qualified, like welcoming new subscribers who meet specific criteria." })
21956
+ /* @__PURE__ */ jsx("div", { className: styles$5.comingSoonBadge, children: "Coming Soon" }),
21957
+ /* @__PURE__ */ jsx("div", { className: styles$5.iconWrapper, children: "✉️" }),
21958
+ /* @__PURE__ */ jsx("h3", { className: styles$5.cardTitle, children: "Patron Enters a List" }),
21959
+ /* @__PURE__ */ jsx("p", { className: styles$5.cardDescription, children: "Send whenever someone becomes qualified, like welcoming new subscribers who meet specific criteria." })
21903
21960
  ] });
21904
21961
  };
21905
21962
  const DateMilestone = () => {
21906
21963
  return /* @__PURE__ */ jsxs("div", { children: [
21907
- /* @__PURE__ */ jsx("div", { className: styles$4.comingSoonBadge, children: "Coming Soon" }),
21908
- /* @__PURE__ */ jsx("div", { className: styles$4.iconWrapper, children: "📅" }),
21909
- /* @__PURE__ */ jsx("h3", { className: styles$4.cardTitle, children: "Date Milestone" }),
21910
- /* @__PURE__ */ jsx("p", { className: styles$4.cardDescription, children: "Schedules around specific dates in your contact data, like birthdays, membership anniversaries, or renewal dates." })
21964
+ /* @__PURE__ */ jsx("div", { className: styles$5.comingSoonBadge, children: "Coming Soon" }),
21965
+ /* @__PURE__ */ jsx("div", { className: styles$5.iconWrapper, children: "📅" }),
21966
+ /* @__PURE__ */ jsx("h3", { className: styles$5.cardTitle, children: "Date Milestone" }),
21967
+ /* @__PURE__ */ jsx("p", { className: styles$5.cardDescription, children: "Schedules around specific dates in your contact data, like birthdays, membership anniversaries, or renewal dates." })
21911
21968
  ] });
21912
21969
  };
21913
21970
  const RealtimeActivity = () => {
21914
21971
  return /* @__PURE__ */ jsxs("div", { children: [
21915
- /* @__PURE__ */ jsx("div", { className: styles$4.comingSoonBadge, children: "Coming Soon" }),
21916
- /* @__PURE__ */ jsx("div", { className: styles$4.iconWrapper, children: "📬" }),
21917
- /* @__PURE__ */ jsx("h3", { className: styles$4.cardTitle, children: "Realtime Activity" }),
21918
- /* @__PURE__ */ jsx("p", { className: styles$4.cardDescription, children: "Responds to immediate actions your contacts take, like abandoned carts, form submissions, or appointment bookings." })
21972
+ /* @__PURE__ */ jsx("div", { className: styles$5.comingSoonBadge, children: "Coming Soon" }),
21973
+ /* @__PURE__ */ jsx("div", { className: styles$5.iconWrapper, children: "📬" }),
21974
+ /* @__PURE__ */ jsx("h3", { className: styles$5.cardTitle, children: "Realtime Activity" }),
21975
+ /* @__PURE__ */ jsx("p", { className: styles$5.cardDescription, children: "Responds to immediate actions your contacts take, like abandoned carts, form submissions, or appointment bookings." })
21919
21976
  ] });
21920
21977
  };
21921
- const styles$3 = {
21978
+ const styles$4 = {
21922
21979
  title: "text-3xl mb-8",
21923
21980
  grid: "grid grid-cols-2 gap-6",
21924
21981
  card: "relative p-6 rounded-lg border border-gray-200 cursor-pointer flex flex-col items-center text-center hover:border-indigo-500 transition-colors",
@@ -21929,20 +21986,20 @@ const ChooseAutomationType = ({ onNext }) => {
21929
21986
  const onClick = (type) => {
21930
21987
  onNext(type);
21931
21988
  };
21932
- return /* @__PURE__ */ jsxs("div", { className: styles$3.container, children: [
21933
- /* @__PURE__ */ jsx("h1", { className: styles$3.title, children: "Choose Your Automation Type" }),
21934
- /* @__PURE__ */ jsxs("div", { className: styles$3.grid, children: [
21989
+ return /* @__PURE__ */ jsxs("div", { className: styles$4.container, children: [
21990
+ /* @__PURE__ */ jsx("h1", { className: styles$4.title, children: "Choose Your Automation Type" }),
21991
+ /* @__PURE__ */ jsxs("div", { className: styles$4.grid, children: [
21935
21992
  /* @__PURE__ */ jsx(
21936
21993
  "div",
21937
21994
  {
21938
- className: styles$3.card,
21995
+ className: styles$4.card,
21939
21996
  onClick: () => onClick(AutomationTriggerType.ONE_TIME),
21940
21997
  children: /* @__PURE__ */ jsx(OneTimeBroadcast, {})
21941
21998
  }
21942
21999
  ),
21943
- /* @__PURE__ */ jsx("div", { className: `${styles$3.card} ${styles$3.cardDisabled}`, children: /* @__PURE__ */ jsx(PatronEntersList, {}) }),
21944
- /* @__PURE__ */ jsx("div", { className: `${styles$3.card} ${styles$3.cardDisabled}`, children: /* @__PURE__ */ jsx(DateMilestone, {}) }),
21945
- /* @__PURE__ */ jsx("div", { className: `${styles$3.card} ${styles$3.cardDisabled}`, children: /* @__PURE__ */ jsx(RealtimeActivity, {}) })
22000
+ /* @__PURE__ */ jsx("div", { className: `${styles$4.card} ${styles$4.cardDisabled}`, children: /* @__PURE__ */ jsx(PatronEntersList, {}) }),
22001
+ /* @__PURE__ */ jsx("div", { className: `${styles$4.card} ${styles$4.cardDisabled}`, children: /* @__PURE__ */ jsx(DateMilestone, {}) }),
22002
+ /* @__PURE__ */ jsx("div", { className: `${styles$4.card} ${styles$4.cardDisabled}`, children: /* @__PURE__ */ jsx(RealtimeActivity, {}) })
21946
22003
  ] })
21947
22004
  ] });
21948
22005
  };
@@ -22060,7 +22117,7 @@ const CreateAutomationModal = ({
22060
22117
  });
22061
22118
  };
22062
22119
  if (isCreating || startedCreating) {
22063
- return /* @__PURE__ */ jsx("div", { className: styles$3.container, children: /* @__PURE__ */ jsx(SpinLoader, { text: ["Creating Automation", "Finishing up"] }) });
22120
+ return /* @__PURE__ */ jsx("div", { className: styles$4.container, children: /* @__PURE__ */ jsx(SpinLoader, { text: ["Creating Automation", "Finishing up"] }) });
22064
22121
  }
22065
22122
  return /* @__PURE__ */ jsxs("div", { className: "relative overflow-hidden", children: [
22066
22123
  /* @__PURE__ */ jsxs(AnimatePresence, { mode: "wait", children: [
@@ -22393,7 +22450,7 @@ const NameAndDescription = ({ nameAndDescriptionState, setNameAndDescriptionStat
22393
22450
  ] })
22394
22451
  ] }) });
22395
22452
  };
22396
- const styles$2 = {
22453
+ const styles$3 = {
22397
22454
  container: "relative p-6 border border-gray-200 rounded-lg"
22398
22455
  };
22399
22456
  const SegmentBuilder = ({
@@ -22470,12 +22527,12 @@ const SegmentBuilder = ({
22470
22527
  });
22471
22528
  };
22472
22529
  if (isLoading) {
22473
- return /* @__PURE__ */ jsx("div", { className: styles$2.container, children: /* @__PURE__ */ jsx(SpinLoader, { text: ["Fetching Segment data", "Finishing up"] }) });
22530
+ return /* @__PURE__ */ jsx("div", { className: styles$3.container, children: /* @__PURE__ */ jsx(SpinLoader, { text: ["Fetching Segment data", "Finishing up"] }) });
22474
22531
  }
22475
22532
  if (isCreating || startedCreating) {
22476
- return /* @__PURE__ */ jsx("div", { className: styles$2.container, children: /* @__PURE__ */ jsx(SpinLoader, { text: ["Creating Segment", "Finishing up"] }) });
22533
+ return /* @__PURE__ */ jsx("div", { className: styles$3.container, children: /* @__PURE__ */ jsx(SpinLoader, { text: ["Creating Segment", "Finishing up"] }) });
22477
22534
  }
22478
- return /* @__PURE__ */ jsxs("div", { className: styles$2.container, children: [
22535
+ return /* @__PURE__ */ jsxs("div", { className: styles$3.container, children: [
22479
22536
  /* @__PURE__ */ jsx(
22480
22537
  "button",
22481
22538
  {
@@ -23454,13 +23511,13 @@ const TableCell = React.forwardRef(({ className: className2, ...props }, ref) =>
23454
23511
  }
23455
23512
  ));
23456
23513
  TableCell.displayName = "TableCell";
23457
- const styles$1 = {
23514
+ const styles$2 = {
23458
23515
  container: "flex flex-col items-center justify-center h-full"
23459
23516
  };
23460
23517
  const AutomationRecipients = ({ automationId }) => {
23461
23518
  const { recipients, isLoading, fetchError } = useGetBusinessAutomationRecipients(automationId);
23462
23519
  if (isLoading) {
23463
- return /* @__PURE__ */ jsx("div", { className: styles$1.container, children: /* @__PURE__ */ jsx(SpinLoader, { text: ["Fetching Recipients", "Finishing up"] }) });
23520
+ return /* @__PURE__ */ jsx("div", { className: styles$2.container, children: /* @__PURE__ */ jsx(SpinLoader, { text: ["Fetching Recipients", "Finishing up"] }) });
23464
23521
  }
23465
23522
  if (fetchError) {
23466
23523
  return /* @__PURE__ */ jsxs("div", { children: [
@@ -25040,36 +25097,36 @@ const cva = (base2, config) => (props) => {
25040
25097
  }, []);
25041
25098
  return cx(base2, getVariantClassNames, getCompoundVariantClassNames, props === null || props === void 0 ? void 0 : props.class, props === null || props === void 0 ? void 0 : props.className);
25042
25099
  };
25043
- const base = "reach-styles-module__base___RP4iu";
25044
- const destructive = "reach-styles-module__destructive___BZSYi";
25045
- const outline = "reach-styles-module__outline___bNcaI";
25046
- const secondary = "reach-styles-module__secondary___osvqQ";
25100
+ const base$1 = "reach-styles-module__base___RP4iu";
25101
+ const destructive$1 = "reach-styles-module__destructive___BZSYi";
25102
+ const outline$1 = "reach-styles-module__outline___bNcaI";
25103
+ const secondary$1 = "reach-styles-module__secondary___osvqQ";
25047
25104
  const ghost = "reach-styles-module__ghost___uU77B";
25048
25105
  const link = "reach-styles-module__link___nSLOW";
25049
- const styles = {
25050
- base,
25106
+ const styles$1 = {
25107
+ base: base$1,
25051
25108
  "default": "reach-styles-module__default___pajjj",
25052
- destructive,
25053
- outline,
25054
- secondary,
25109
+ destructive: destructive$1,
25110
+ outline: outline$1,
25111
+ secondary: secondary$1,
25055
25112
  ghost,
25056
25113
  link
25057
25114
  };
25058
- const buttonVariants$1 = cva([styles.base, "debug-button"], {
25115
+ const buttonVariants = cva([styles$1.base], {
25059
25116
  variants: {
25060
25117
  variant: {
25061
- default: styles.default,
25062
- destructive: styles.destructive,
25063
- outline: styles.outline,
25064
- secondary: styles.secondary,
25065
- ghost: styles.ghost,
25066
- link: styles.link
25118
+ default: styles$1.default,
25119
+ destructive: styles$1.destructive,
25120
+ outline: styles$1.outline,
25121
+ secondary: styles$1.secondary,
25122
+ ghost: styles$1.ghost,
25123
+ link: styles$1.link
25067
25124
  },
25068
25125
  size: {
25069
- default: styles["size-default"],
25070
- sm: styles["size-sm"],
25071
- lg: styles["size-lg"],
25072
- icon: styles["size-icon"]
25126
+ default: styles$1["size-default"],
25127
+ sm: styles$1["size-sm"],
25128
+ lg: styles$1["size-lg"],
25129
+ icon: styles$1["size-icon"]
25073
25130
  }
25074
25131
  },
25075
25132
  defaultVariants: {
@@ -25083,7 +25140,7 @@ const Button$1 = React.forwardRef(
25083
25140
  return /* @__PURE__ */ jsx(
25084
25141
  Comp,
25085
25142
  {
25086
- className: cn$1(buttonVariants$1({ variant, size: size2, className: className2 })),
25143
+ className: cn$1(buttonVariants({ variant, size: size2, className: className2 })),
25087
25144
  ref,
25088
25145
  ...props
25089
25146
  }
@@ -25316,7 +25373,7 @@ var FocusScope = React.forwardRef((props, forwardedRef) => {
25316
25373
  onUnmountAutoFocus: onUnmountAutoFocusProp,
25317
25374
  ...scopeProps
25318
25375
  } = props;
25319
- const [container, setContainer] = React.useState(null);
25376
+ const [container2, setContainer] = React.useState(null);
25320
25377
  const onMountAutoFocus = useCallbackRef$1(onMountAutoFocusProp);
25321
25378
  const onUnmountAutoFocus = useCallbackRef$1(onUnmountAutoFocusProp);
25322
25379
  const lastFocusedElementRef = React.useRef(null);
@@ -25333,69 +25390,69 @@ var FocusScope = React.forwardRef((props, forwardedRef) => {
25333
25390
  React.useEffect(() => {
25334
25391
  if (trapped) {
25335
25392
  let handleFocusIn2 = function(event) {
25336
- if (focusScope.paused || !container) return;
25393
+ if (focusScope.paused || !container2) return;
25337
25394
  const target = event.target;
25338
- if (container.contains(target)) {
25395
+ if (container2.contains(target)) {
25339
25396
  lastFocusedElementRef.current = target;
25340
25397
  } else {
25341
25398
  focus(lastFocusedElementRef.current, { select: true });
25342
25399
  }
25343
25400
  }, handleFocusOut2 = function(event) {
25344
- if (focusScope.paused || !container) return;
25401
+ if (focusScope.paused || !container2) return;
25345
25402
  const relatedTarget = event.relatedTarget;
25346
25403
  if (relatedTarget === null) return;
25347
- if (!container.contains(relatedTarget)) {
25404
+ if (!container2.contains(relatedTarget)) {
25348
25405
  focus(lastFocusedElementRef.current, { select: true });
25349
25406
  }
25350
25407
  }, handleMutations2 = function(mutations) {
25351
25408
  const focusedElement = document.activeElement;
25352
25409
  if (focusedElement !== document.body) return;
25353
25410
  for (const mutation of mutations) {
25354
- if (mutation.removedNodes.length > 0) focus(container);
25411
+ if (mutation.removedNodes.length > 0) focus(container2);
25355
25412
  }
25356
25413
  };
25357
25414
  document.addEventListener("focusin", handleFocusIn2);
25358
25415
  document.addEventListener("focusout", handleFocusOut2);
25359
25416
  const mutationObserver = new MutationObserver(handleMutations2);
25360
- if (container) mutationObserver.observe(container, { childList: true, subtree: true });
25417
+ if (container2) mutationObserver.observe(container2, { childList: true, subtree: true });
25361
25418
  return () => {
25362
25419
  document.removeEventListener("focusin", handleFocusIn2);
25363
25420
  document.removeEventListener("focusout", handleFocusOut2);
25364
25421
  mutationObserver.disconnect();
25365
25422
  };
25366
25423
  }
25367
- }, [trapped, container, focusScope.paused]);
25424
+ }, [trapped, container2, focusScope.paused]);
25368
25425
  React.useEffect(() => {
25369
- if (container) {
25426
+ if (container2) {
25370
25427
  focusScopesStack.add(focusScope);
25371
25428
  const previouslyFocusedElement = document.activeElement;
25372
- const hasFocusedCandidate = container.contains(previouslyFocusedElement);
25429
+ const hasFocusedCandidate = container2.contains(previouslyFocusedElement);
25373
25430
  if (!hasFocusedCandidate) {
25374
25431
  const mountEvent = new CustomEvent(AUTOFOCUS_ON_MOUNT, EVENT_OPTIONS);
25375
- container.addEventListener(AUTOFOCUS_ON_MOUNT, onMountAutoFocus);
25376
- container.dispatchEvent(mountEvent);
25432
+ container2.addEventListener(AUTOFOCUS_ON_MOUNT, onMountAutoFocus);
25433
+ container2.dispatchEvent(mountEvent);
25377
25434
  if (!mountEvent.defaultPrevented) {
25378
- focusFirst$1(removeLinks(getTabbableCandidates(container)), { select: true });
25435
+ focusFirst$1(removeLinks(getTabbableCandidates(container2)), { select: true });
25379
25436
  if (document.activeElement === previouslyFocusedElement) {
25380
- focus(container);
25437
+ focus(container2);
25381
25438
  }
25382
25439
  }
25383
25440
  }
25384
25441
  return () => {
25385
- container.removeEventListener(AUTOFOCUS_ON_MOUNT, onMountAutoFocus);
25442
+ container2.removeEventListener(AUTOFOCUS_ON_MOUNT, onMountAutoFocus);
25386
25443
  setTimeout(() => {
25387
25444
  const unmountEvent = new CustomEvent(AUTOFOCUS_ON_UNMOUNT, EVENT_OPTIONS);
25388
- container.addEventListener(AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);
25389
- container.dispatchEvent(unmountEvent);
25445
+ container2.addEventListener(AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);
25446
+ container2.dispatchEvent(unmountEvent);
25390
25447
  if (!unmountEvent.defaultPrevented) {
25391
25448
  focus(previouslyFocusedElement ?? document.body, { select: true });
25392
25449
  }
25393
- container.removeEventListener(AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);
25450
+ container2.removeEventListener(AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);
25394
25451
  focusScopesStack.remove(focusScope);
25395
25452
  }, 0);
25396
25453
  };
25397
25454
  }
25398
- }, [container, onMountAutoFocus, onUnmountAutoFocus, focusScope]);
25455
+ }, [container2, onMountAutoFocus, onUnmountAutoFocus, focusScope]);
25399
25456
  const handleKeyDown = React.useCallback(
25400
25457
  (event) => {
25401
25458
  if (!loop && !trapped) return;
@@ -25403,11 +25460,11 @@ var FocusScope = React.forwardRef((props, forwardedRef) => {
25403
25460
  const isTabKey = event.key === "Tab" && !event.altKey && !event.ctrlKey && !event.metaKey;
25404
25461
  const focusedElement = document.activeElement;
25405
25462
  if (isTabKey && focusedElement) {
25406
- const container2 = event.currentTarget;
25407
- const [first, last] = getTabbableEdges(container2);
25463
+ const container22 = event.currentTarget;
25464
+ const [first, last] = getTabbableEdges(container22);
25408
25465
  const hasTabbableElementsInside = first && last;
25409
25466
  if (!hasTabbableElementsInside) {
25410
- if (focusedElement === container2) event.preventDefault();
25467
+ if (focusedElement === container22) event.preventDefault();
25411
25468
  } else {
25412
25469
  if (!event.shiftKey && focusedElement === last) {
25413
25470
  event.preventDefault();
@@ -25431,15 +25488,15 @@ function focusFirst$1(candidates, { select = false } = {}) {
25431
25488
  if (document.activeElement !== previouslyFocusedElement) return;
25432
25489
  }
25433
25490
  }
25434
- function getTabbableEdges(container) {
25435
- const candidates = getTabbableCandidates(container);
25436
- const first = findVisible(candidates, container);
25437
- const last = findVisible(candidates.reverse(), container);
25491
+ function getTabbableEdges(container2) {
25492
+ const candidates = getTabbableCandidates(container2);
25493
+ const first = findVisible(candidates, container2);
25494
+ const last = findVisible(candidates.reverse(), container2);
25438
25495
  return [first, last];
25439
25496
  }
25440
- function getTabbableCandidates(container) {
25497
+ function getTabbableCandidates(container2) {
25441
25498
  const nodes = [];
25442
- const walker2 = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, {
25499
+ const walker2 = document.createTreeWalker(container2, NodeFilter.SHOW_ELEMENT, {
25443
25500
  acceptNode: (node) => {
25444
25501
  const isHiddenInput = node.tagName === "INPUT" && node.type === "hidden";
25445
25502
  if (node.disabled || node.hidden || isHiddenInput) return NodeFilter.FILTER_SKIP;
@@ -25449,9 +25506,9 @@ function getTabbableCandidates(container) {
25449
25506
  while (walker2.nextNode()) nodes.push(walker2.currentNode);
25450
25507
  return nodes;
25451
25508
  }
25452
- function findVisible(elements, container) {
25509
+ function findVisible(elements, container2) {
25453
25510
  for (const element of elements) {
25454
- if (!isHidden(element, { upTo: container })) return element;
25511
+ if (!isHidden(element, { upTo: container2 })) return element;
25455
25512
  }
25456
25513
  }
25457
25514
  function isHidden(node, { upTo }) {
@@ -25508,8 +25565,8 @@ var Portal$4 = React.forwardRef((props, forwardedRef) => {
25508
25565
  const { container: containerProp, ...portalProps } = props;
25509
25566
  const [mounted, setMounted] = React.useState(false);
25510
25567
  useLayoutEffect2(() => setMounted(true), []);
25511
- const container = containerProp || mounted && globalThis?.document?.body;
25512
- return container ? ReactDOM__default.createPortal(/* @__PURE__ */ jsx(Primitive.div, { ...portalProps, ref: forwardedRef }), container) : null;
25568
+ const container2 = containerProp || mounted && globalThis?.document?.body;
25569
+ return container2 ? ReactDOM__default.createPortal(/* @__PURE__ */ jsx(Primitive.div, { ...portalProps, ref: forwardedRef }), container2) : null;
25513
25570
  });
25514
25571
  Portal$4.displayName = PORTAL_NAME$5;
25515
25572
  var count = 0;
@@ -26374,9 +26431,9 @@ var [PortalProvider$2, usePortalContext$2] = createDialogContext(PORTAL_NAME$4,
26374
26431
  forceMount: void 0
26375
26432
  });
26376
26433
  var DialogPortal$1 = (props) => {
26377
- const { __scopeDialog, forceMount, children: children2, container } = props;
26434
+ const { __scopeDialog, forceMount, children: children2, container: container2 } = props;
26378
26435
  const context = useDialogContext(PORTAL_NAME$4, __scopeDialog);
26379
- return /* @__PURE__ */ jsx(PortalProvider$2, { scope: __scopeDialog, forceMount, children: React.Children.map(children2, (child) => /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(Portal$4, { asChild: true, container, children: child }) })) });
26436
+ return /* @__PURE__ */ jsx(PortalProvider$2, { scope: __scopeDialog, forceMount, children: React.Children.map(children2, (child) => /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(Portal$4, { asChild: true, container: container2, children: child }) })) });
26380
26437
  };
26381
26438
  DialogPortal$1.displayName = PORTAL_NAME$4;
26382
26439
  var OVERLAY_NAME = "DialogOverlay";
@@ -29113,9 +29170,9 @@ var [PortalProvider$1, usePortalContext$1] = createMenuContext(PORTAL_NAME$3, {
29113
29170
  forceMount: void 0
29114
29171
  });
29115
29172
  var MenuPortal = (props) => {
29116
- const { __scopeMenu, forceMount, children: children2, container } = props;
29173
+ const { __scopeMenu, forceMount, children: children2, container: container2 } = props;
29117
29174
  const context = useMenuContext(PORTAL_NAME$3, __scopeMenu);
29118
- return /* @__PURE__ */ jsx(PortalProvider$1, { scope: __scopeMenu, forceMount, children: /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(Portal$4, { asChild: true, container, children: children2 }) }) });
29175
+ return /* @__PURE__ */ jsx(PortalProvider$1, { scope: __scopeMenu, forceMount, children: /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(Portal$4, { asChild: true, container: container2, children: children2 }) }) });
29119
29176
  };
29120
29177
  MenuPortal.displayName = PORTAL_NAME$3;
29121
29178
  var CONTENT_NAME$3 = "MenuContent";
@@ -35323,31 +35380,6 @@ function RootProvider(props) {
35323
35380
  function DayPicker(props) {
35324
35381
  return jsx(RootProvider, __assign({}, props, { children: jsx(Root, { initialProps: props }) }));
35325
35382
  }
35326
- const buttonVariants = cva(
35327
- "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
35328
- {
35329
- variants: {
35330
- variant: {
35331
- default: "bg-primary text-primary-foreground shadow hover:bg-primary/90",
35332
- destructive: "bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",
35333
- outline: "border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",
35334
- secondary: "bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",
35335
- ghost: "hover:bg-accent hover:text-accent-foreground",
35336
- link: "text-primary underline-offset-4 hover:underline"
35337
- },
35338
- size: {
35339
- default: "h-9 px-4 py-2",
35340
- sm: "h-8 rounded-md px-3 text-xs",
35341
- lg: "h-10 rounded-md px-8",
35342
- icon: "h-9 w-9"
35343
- }
35344
- },
35345
- defaultVariants: {
35346
- variant: "default",
35347
- size: "default"
35348
- }
35349
- }
35350
- );
35351
35383
  function Calendar({
35352
35384
  className: className2,
35353
35385
  classNames,
@@ -35487,9 +35519,9 @@ var [PortalProvider, usePortalContext] = createPopoverContext(PORTAL_NAME, {
35487
35519
  forceMount: void 0
35488
35520
  });
35489
35521
  var PopoverPortal = (props) => {
35490
- const { __scopePopover, forceMount, children: children2, container } = props;
35522
+ const { __scopePopover, forceMount, children: children2, container: container2 } = props;
35491
35523
  const context = usePopoverContext(PORTAL_NAME, __scopePopover);
35492
- return /* @__PURE__ */ jsx(PortalProvider, { scope: __scopePopover, forceMount, children: /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(Portal$4, { asChild: true, container, children: children2 }) }) });
35524
+ return /* @__PURE__ */ jsx(PortalProvider, { scope: __scopePopover, forceMount, children: /* @__PURE__ */ jsx(Presence, { present: forceMount || context.open, children: /* @__PURE__ */ jsx(Portal$4, { asChild: true, container: container2, children: children2 }) }) });
35493
35525
  };
35494
35526
  PopoverPortal.displayName = PORTAL_NAME;
35495
35527
  var CONTENT_NAME = "PopoverContent";
@@ -36546,61 +36578,76 @@ const EditAutomationPopup = ({
36546
36578
  ) })
36547
36579
  ] });
36548
36580
  };
36549
- const badgeVariants = cva(
36550
- "inline-flex items-center rounded-full border text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
36551
- {
36552
- variants: {
36553
- variant: {
36554
- default: "border-transparent bg-primary text-primary-foreground hover:bg-primary/80",
36555
- secondary: "border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",
36556
- destructive: "border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",
36557
- outline: "text-foreground",
36558
- google: "border-transparent bg-blue-100 font-normal dark:bg-blue-900/30 text-blue-700 dark:text-blue-300",
36559
- date: "border-transparent bg-gray-200 font-normal dark:bg-gray-800 text-gray-700 dark:text-gray-300"
36560
- },
36561
- size: {
36562
- default: "px-2.5 py-0.5",
36563
- sm: "px-1.5 py-0.5 text-[10px]"
36564
- },
36565
- iconOnly: {
36566
- true: "w-5 h-5 p-0 justify-center",
36567
- false: ""
36568
- }
36581
+ const base = "reach-styles-module__base___eJmcH";
36582
+ const secondary = "reach-styles-module__secondary___H-ae8";
36583
+ const destructive = "reach-styles-module__destructive___JsRNh";
36584
+ const outline = "reach-styles-module__outline___9FFlV";
36585
+ const google = "reach-styles-module__google___7eHwU";
36586
+ const date = "reach-styles-module__date___gU3Tt";
36587
+ const container = "reach-styles-module__container___5PrOx";
36588
+ const styles = {
36589
+ base,
36590
+ "default": "reach-styles-module__default___8NuEB",
36591
+ secondary,
36592
+ destructive,
36593
+ outline,
36594
+ google,
36595
+ date,
36596
+ container
36597
+ };
36598
+ const badgeVariants = cva([styles.base], {
36599
+ variants: {
36600
+ variant: {
36601
+ default: styles.default,
36602
+ secondary: styles.secondary,
36603
+ destructive: styles.destructive,
36604
+ outline: styles.outline,
36605
+ google: styles.google,
36606
+ date: styles.date
36569
36607
  },
36570
- compoundVariants: [
36608
+ size: {
36609
+ default: styles["size-default"],
36610
+ sm: styles["size-sm"]
36611
+ },
36612
+ iconOnly: {
36613
+ true: styles["icon-only"],
36614
+ false: ""
36615
+ }
36616
+ },
36617
+ compoundVariants: [
36618
+ {
36619
+ iconOnly: true,
36620
+ size: "sm",
36621
+ class: styles["icon-only-sm"]
36622
+ }
36623
+ ],
36624
+ defaultVariants: {
36625
+ variant: "default",
36626
+ size: "default",
36627
+ iconOnly: false
36628
+ }
36629
+ });
36630
+ const Badge = React.forwardRef(
36631
+ ({ className: className2, variant, size: size2, iconOnly, truncate, ...props }, ref) => {
36632
+ return /* @__PURE__ */ jsx(
36633
+ "div",
36571
36634
  {
36572
- iconOnly: true,
36573
- size: "sm",
36574
- class: "w-4 h-4"
36635
+ ref,
36636
+ className: cn(
36637
+ badgeVariants({ variant, size: size2, iconOnly }),
36638
+ truncate && "max-w-[90px]",
36639
+ className2
36640
+ ),
36641
+ ...props
36575
36642
  }
36576
- ],
36577
- defaultVariants: {
36578
- variant: "default",
36579
- size: "default",
36580
- iconOnly: false
36581
- }
36643
+ );
36582
36644
  }
36583
36645
  );
36584
- function Badge({
36585
- className: className2,
36586
- variant,
36587
- size: size2,
36588
- iconOnly,
36589
- truncate,
36590
- ...props
36591
- }) {
36592
- return /* @__PURE__ */ jsx(
36593
- "div",
36594
- {
36595
- className: cn$1(
36596
- badgeVariants({ variant, size: size2, iconOnly }),
36597
- truncate && "max-w-[90px]",
36598
- className2
36599
- ),
36600
- ...props
36601
- }
36602
- );
36603
- }
36646
+ Badge.displayName = "Badge";
36647
+ const BadgeContainer = React.forwardRef(({ className: className2, ...props }, ref) => {
36648
+ return /* @__PURE__ */ jsx("div", { ref, className: cn(styles.container, className2), ...props });
36649
+ });
36650
+ BadgeContainer.displayName = "BadgeContainer";
36604
36651
  const StatusBadge = ({
36605
36652
  status
36606
36653
  }) => {
@@ -36733,7 +36780,7 @@ const ViewAutomationModal = ({
36733
36780
  const mergedIconDefinitions = mergeIconDefinitions(iconDefinitions);
36734
36781
  const { automation, isFetching, isLoading, fetchError } = useGetBusinessAutomation(AUTOMATION_ID);
36735
36782
  if (!automation && (isFetching || isLoading)) {
36736
- return /* @__PURE__ */ jsx("div", { className: styles$3.container, children: /* @__PURE__ */ jsx(SpinLoader, { text: ["Fetching Automation data", "Finishing up"] }) });
36783
+ return /* @__PURE__ */ jsx("div", { className: styles$4.container, children: /* @__PURE__ */ jsx(SpinLoader, { text: ["Fetching Automation data", "Finishing up"] }) });
36737
36784
  }
36738
36785
  if (fetchError) {
36739
36786
  return /* @__PURE__ */ jsxs("div", { children: [
@@ -36744,7 +36791,7 @@ const ViewAutomationModal = ({
36744
36791
  if (!automation) {
36745
36792
  return /* @__PURE__ */ jsx("div", { children: "No automation found" });
36746
36793
  }
36747
- return /* @__PURE__ */ jsxs("div", { className: styles$3.container, children: [
36794
+ return /* @__PURE__ */ jsxs("div", { className: styles$4.container, children: [
36748
36795
  /* @__PURE__ */ jsx(
36749
36796
  ViewAutomationHeader,
36750
36797
  {