@embedreach/components 0.1.46 → 0.1.48

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.
@@ -5109,8 +5109,8 @@ function getMutationStatusColor({
5109
5109
  }) {
5110
5110
  return isPaused ? "purple" : status === "error" ? "red" : status === "pending" ? "yellow" : status === "success" ? "green" : "gray";
5111
5111
  }
5112
- function getQueryStatusColorByLabel(label) {
5113
- return label === "fresh" ? "green" : label === "stale" ? "yellow" : label === "paused" ? "purple" : label === "inactive" ? "gray" : "blue";
5112
+ function getQueryStatusColorByLabel(label2) {
5113
+ return label2 === "fresh" ? "green" : label2 === "stale" ? "yellow" : label2 === "paused" ? "purple" : label2 === "inactive" ? "gray" : "blue";
5114
5114
  }
5115
5115
  var displayValue = (value, beautify = false) => {
5116
5116
  const {
@@ -12538,7 +12538,7 @@ var [ToastProviderProvider, useToastProviderContext] = createToastContext(PROVID
12538
12538
  var ToastProvider$1 = (props) => {
12539
12539
  const {
12540
12540
  __scopeToast,
12541
- label = "Notification",
12541
+ label: label2 = "Notification",
12542
12542
  duration = 5e3,
12543
12543
  swipeDirection = "right",
12544
12544
  swipeThreshold = 50,
@@ -12548,7 +12548,7 @@ var ToastProvider$1 = (props) => {
12548
12548
  const [toastCount, setToastCount] = React.useState(0);
12549
12549
  const isFocusedToastEscapeKeyDownRef = React.useRef(false);
12550
12550
  const isClosePausedRef = React.useRef(false);
12551
- if (!label.trim()) {
12551
+ if (!label2.trim()) {
12552
12552
  console.error(
12553
12553
  `Invalid prop \`label\` supplied to \`${PROVIDER_NAME$1}\`. Expected non-empty \`string\`.`
12554
12554
  );
@@ -12557,7 +12557,7 @@ var ToastProvider$1 = (props) => {
12557
12557
  ToastProviderProvider,
12558
12558
  {
12559
12559
  scope: __scopeToast,
12560
- label,
12560
+ label: label2,
12561
12561
  duration,
12562
12562
  swipeDirection,
12563
12563
  swipeThreshold,
@@ -12582,7 +12582,7 @@ var ToastViewport$1 = React.forwardRef(
12582
12582
  const {
12583
12583
  __scopeToast,
12584
12584
  hotkey = VIEWPORT_DEFAULT_HOTKEY,
12585
- label = "Notifications ({hotkey})",
12585
+ label: label2 = "Notifications ({hotkey})",
12586
12586
  ...viewportProps
12587
12587
  } = props;
12588
12588
  const context = useToastProviderContext(VIEWPORT_NAME$1, __scopeToast);
@@ -12689,7 +12689,7 @@ var ToastViewport$1 = React.forwardRef(
12689
12689
  {
12690
12690
  ref: wrapperRef,
12691
12691
  role: "region",
12692
- "aria-label": label.replace("{hotkey}", hotkeyLabel),
12692
+ "aria-label": label2.replace("{hotkey}", hotkeyLabel),
12693
12693
  tabIndex: -1,
12694
12694
  style: { pointerEvents: hasToasts ? void 0 : "none" },
12695
12695
  children: [
@@ -14033,11 +14033,11 @@ const imageLabels = /* @__PURE__ */ new Set(["image", "url"]);
14033
14033
  const isArbitraryImage = (value) => getIsArbitraryValue(value, imageLabels, isImage);
14034
14034
  const isArbitraryShadow = (value) => getIsArbitraryValue(value, "", isShadow);
14035
14035
  const isAny = () => true;
14036
- const getIsArbitraryValue = (value, label, testValue) => {
14036
+ const getIsArbitraryValue = (value, label2, testValue) => {
14037
14037
  const result = arbitraryValueRegex.exec(value);
14038
14038
  if (result) {
14039
14039
  if (result[1]) {
14040
- return typeof label === "string" ? result[1] === label : label.has(result[1]);
14040
+ return typeof label2 === "string" ? result[1] === label2 : label2.has(result[1]);
14041
14041
  }
14042
14042
  return testValue(result[2]);
14043
14043
  }
@@ -20847,8 +20847,8 @@ function resolveAxisElastic(dragElastic, minLabel, maxLabel) {
20847
20847
  max: resolvePointElastic(dragElastic, maxLabel)
20848
20848
  };
20849
20849
  }
20850
- function resolvePointElastic(dragElastic, label) {
20851
- return typeof dragElastic === "number" ? dragElastic : dragElastic[label] || 0;
20850
+ function resolvePointElastic(dragElastic, label2) {
20851
+ return typeof dragElastic === "number" ? dragElastic : dragElastic[label2] || 0;
20852
20852
  }
20853
20853
  const createAxisDelta = () => ({
20854
20854
  translate: 0,
@@ -23752,6 +23752,7 @@ const BUSINESS_AUTOMATION_PATH = "/automations";
23752
23752
  const CHANNEL_SENDER_PATH = "/channel/senders";
23753
23753
  const CHANNEL_ACCOUNT_PATH = "/channel/accounts";
23754
23754
  const COMMUNICATION_GROUP_PATH = "/communication-groups";
23755
+ const STRIPO_PATH = "/stripo";
23755
23756
  const createAutomation = async (params) => {
23756
23757
  const response = await baseRequest(
23757
23758
  BUSINESS_AUTOMATION_PATH,
@@ -24021,7 +24022,7 @@ const sizeDefault$1 = "reach-styles-module__sizeDefault___8kU5A";
24021
24022
  const sizeSm$1 = "reach-styles-module__sizeSm___zPIEh";
24022
24023
  const sizeLg = "reach-styles-module__sizeLg___D2G8z";
24023
24024
  const sizeIcon = "reach-styles-module__sizeIcon___5XkYW";
24024
- const styles$6 = {
24025
+ const styles$7 = {
24025
24026
  base: base$2,
24026
24027
  "default": "reach-styles-module__default___ny1h7",
24027
24028
  destructive: destructive$2,
@@ -24034,21 +24035,21 @@ const styles$6 = {
24034
24035
  sizeLg,
24035
24036
  sizeIcon
24036
24037
  };
24037
- const buttonVariants = cva([styles$6.base], {
24038
+ const buttonVariants = cva([styles$7.base], {
24038
24039
  variants: {
24039
24040
  variant: {
24040
- default: styles$6.default,
24041
- destructive: styles$6.destructive,
24042
- outline: styles$6.outline,
24043
- secondary: styles$6.secondary,
24044
- ghost: styles$6.ghost,
24045
- link: styles$6.link
24041
+ default: styles$7.default,
24042
+ destructive: styles$7.destructive,
24043
+ outline: styles$7.outline,
24044
+ secondary: styles$7.secondary,
24045
+ ghost: styles$7.ghost,
24046
+ link: styles$7.link
24046
24047
  },
24047
24048
  size: {
24048
- default: styles$6.sizeDefault,
24049
- sm: styles$6.sizeSm,
24050
- lg: styles$6.sizeLg,
24051
- icon: styles$6.sizeIcon
24049
+ default: styles$7.sizeDefault,
24050
+ sm: styles$7.sizeSm,
24051
+ lg: styles$7.sizeLg,
24052
+ icon: styles$7.sizeIcon
24052
24053
  }
24053
24054
  },
24054
24055
  defaultVariants: {
@@ -24137,7 +24138,7 @@ const BigSelector = ({ onClick, title: title2, subtitle, icon, selected, disable
24137
24138
  }
24138
24139
  );
24139
24140
  };
24140
- const styles$5 = {
24141
+ const styles$6 = {
24141
24142
  title: "text-3xl mb-8",
24142
24143
  grid: "grid grid-cols-2 gap-6",
24143
24144
  container: "relative p-6 rounded-lg"
@@ -24146,9 +24147,9 @@ const ChooseAutomationType = ({ onNext, iconDefinitions }) => {
24146
24147
  const onClick = (type) => {
24147
24148
  onNext(type);
24148
24149
  };
24149
- return /* @__PURE__ */ jsxs("div", { className: styles$5.container, children: [
24150
- /* @__PURE__ */ jsx("h1", { className: styles$5.title, children: "Choose Your Automation Type" }),
24151
- /* @__PURE__ */ jsxs("div", { className: styles$5.grid, children: [
24150
+ return /* @__PURE__ */ jsxs("div", { className: styles$6.container, children: [
24151
+ /* @__PURE__ */ jsx("h1", { className: styles$6.title, children: "Choose Your Automation Type" }),
24152
+ /* @__PURE__ */ jsxs("div", { className: styles$6.grid, children: [
24152
24153
  /* @__PURE__ */ jsx(
24153
24154
  BigSelector,
24154
24155
  {
@@ -24203,16 +24204,16 @@ function UnreachableCaseStatement(x3, enumObj) {
24203
24204
  `Unreachable case statement: ${JSON.stringify(x3)}. Valid values are: ${Object.values(enumObj).join(", ")}`
24204
24205
  );
24205
24206
  }
24206
- const styles$4 = {
24207
+ const styles$5 = {
24207
24208
  iconWrapper: "mb-4 flex items-center justify-center",
24208
24209
  cardTitle: "text-lg font-medium mb-2",
24209
24210
  cardDescription: "text-sm text-gray-600"
24210
24211
  };
24211
24212
  const OneTimeBroadcast = ({ iconDefinitions }) => {
24212
24213
  return /* @__PURE__ */ jsxs("div", { children: [
24213
- /* @__PURE__ */ jsx("div", { className: styles$4.iconWrapper, children: /* @__PURE__ */ jsx(iconDefinitions.OneTimeBroadcast, {}) }),
24214
- /* @__PURE__ */ jsx("h3", { className: styles$4.cardTitle, children: "One-Time Broadcast" }),
24215
- /* @__PURE__ */ jsx("p", { className: styles$4.cardDescription, children: "Send a single message to your current list, like announcing a sale or newsletter." })
24214
+ /* @__PURE__ */ jsx("div", { className: styles$5.iconWrapper, children: /* @__PURE__ */ jsx(iconDefinitions.OneTimeBroadcast, {}) }),
24215
+ /* @__PURE__ */ jsx("h3", { className: styles$5.cardTitle, children: "One-Time Broadcast" }),
24216
+ /* @__PURE__ */ jsx("p", { className: styles$5.cardDescription, children: "Send a single message to your current list, like announcing a sale or newsletter." })
24216
24217
  ] });
24217
24218
  };
24218
24219
  const SetAutomationName = ({ selectedType, setAutomationName, automationName, iconDefinitions }) => {
@@ -24320,7 +24321,7 @@ const CreateAutomationModal = ({
24320
24321
  });
24321
24322
  };
24322
24323
  if (isCreating || startedCreating) {
24323
- return /* @__PURE__ */ jsx("div", { className: styles$5.container, children: /* @__PURE__ */ jsx(SpinLoader, { text: ["Creating Automation", "Finishing up"] }) });
24324
+ return /* @__PURE__ */ jsx("div", { className: styles$6.container, children: /* @__PURE__ */ jsx(SpinLoader, { text: ["Creating Automation", "Finishing up"] }) });
24324
24325
  }
24325
24326
  return /* @__PURE__ */ jsxs("div", { className: "relative overflow-hidden", children: [
24326
24327
  /* @__PURE__ */ jsxs(AnimatePresence, { mode: "wait", children: [
@@ -28533,7 +28534,7 @@ const sizeSm = "reach-styles-module__sizeSm___6T2oK";
28533
28534
  const iconOnly = "reach-styles-module__iconOnly___8vUSp";
28534
28535
  const iconOnlySm = "reach-styles-module__iconOnlySm___9ZKv9";
28535
28536
  const container = "reach-styles-module__container___6PQqs";
28536
- const styles$3 = {
28537
+ const styles$4 = {
28537
28538
  base: base$1,
28538
28539
  "default": "reach-styles-module__default___zeGU1",
28539
28540
  secondary: secondary$1,
@@ -28547,22 +28548,22 @@ const styles$3 = {
28547
28548
  iconOnlySm,
28548
28549
  container
28549
28550
  };
28550
- const badgeVariants = cva([styles$3.base], {
28551
+ const badgeVariants = cva([styles$4.base], {
28551
28552
  variants: {
28552
28553
  variant: {
28553
- default: styles$3.default,
28554
- secondary: styles$3.secondary,
28555
- destructive: styles$3.destructive,
28556
- outline: styles$3.outline,
28557
- google: styles$3.google,
28558
- date: styles$3.date
28554
+ default: styles$4.default,
28555
+ secondary: styles$4.secondary,
28556
+ destructive: styles$4.destructive,
28557
+ outline: styles$4.outline,
28558
+ google: styles$4.google,
28559
+ date: styles$4.date
28559
28560
  },
28560
28561
  size: {
28561
- default: styles$3.sizeDefault,
28562
- sm: styles$3.sizeSm
28562
+ default: styles$4.sizeDefault,
28563
+ sm: styles$4.sizeSm
28563
28564
  },
28564
28565
  iconOnly: {
28565
- true: styles$3.iconOnly,
28566
+ true: styles$4.iconOnly,
28566
28567
  false: ""
28567
28568
  }
28568
28569
  },
@@ -28570,7 +28571,7 @@ const badgeVariants = cva([styles$3.base], {
28570
28571
  {
28571
28572
  iconOnly: true,
28572
28573
  size: "sm",
28573
- class: styles$3.iconOnlySm
28574
+ class: styles$4.iconOnlySm
28574
28575
  }
28575
28576
  ],
28576
28577
  defaultVariants: {
@@ -28597,7 +28598,7 @@ const Badge = React.forwardRef(
28597
28598
  );
28598
28599
  Badge.displayName = "Badge";
28599
28600
  const BadgeContainer = React.forwardRef(({ className: className2, ...props }, ref) => {
28600
- return /* @__PURE__ */ jsx("div", { ref, className: cn$1(styles$3.container, className2), ...props });
28601
+ return /* @__PURE__ */ jsx("div", { ref, className: cn$1(styles$4.container, className2), ...props });
28601
28602
  });
28602
28603
  BadgeContainer.displayName = "BadgeContainer";
28603
28604
  var U = 1, Y$1 = 0.9, H = 0.8, J = 0.17, p = 0.1, u = 0.999, $ = 0.9999;
@@ -33497,7 +33498,7 @@ const MultiSelect = React.forwardRef(
33497
33498
  children: "Close"
33498
33499
  }
33499
33500
  ),
33500
- extraCommandItems && extraCommandItems
33501
+ extraCommandItems && extraCommandItems.map((item) => item(setIsPopoverOpen))
33501
33502
  ] }) })
33502
33503
  ] })
33503
33504
  ] })
@@ -35037,14 +35038,15 @@ const NameAndDescription = ({ nameAndDescriptionState, setNameAndDescriptionStat
35037
35038
  ] })
35038
35039
  ] }) });
35039
35040
  };
35040
- const styles$2 = {
35041
+ const styles$3 = {
35041
35042
  container: "relative rounded-lg"
35042
35043
  };
35043
35044
  const SegmentBuilder = ({
35044
35045
  onClose,
35045
- iconDefinitions,
35046
+ iconDefinitions: passedInIconDefinitions,
35046
35047
  segmentId
35047
35048
  }) => {
35049
+ const iconDefinitions = mergeIconDefinitions(passedInIconDefinitions);
35048
35050
  const SEGMENT_ID = segmentId || void 0;
35049
35051
  const { toast: toast2 } = useToast();
35050
35052
  const { segment: existingSegment } = useGetSegment(SEGMENT_ID);
@@ -35059,7 +35061,7 @@ const SegmentBuilder = ({
35059
35061
  });
35060
35062
  const [conditionNameToMetadata, setConditionNameToMetadata] = useState({});
35061
35063
  const isReadyToCreate = nameAndDescriptionState.name && nameAndDescriptionState.description && conditionState.some(
35062
- (condition) => condition.field && condition.operator && condition.value.length > 0
35064
+ (condition) => condition.field && condition.operator && (condition.operator === "exists" || condition.value.length > 0)
35063
35065
  );
35064
35066
  useEffect(() => {
35065
35067
  if (!segmentsConditions) return;
@@ -35191,17 +35193,17 @@ const SegmentBuilder = ({
35191
35193
  }
35192
35194
  };
35193
35195
  if (isLoading) {
35194
- return /* @__PURE__ */ jsx("div", { className: styles$2.container, children: /* @__PURE__ */ jsx(SpinLoader, { text: ["Fetching Segment data", "Finishing up"] }) });
35196
+ return /* @__PURE__ */ jsx("div", { className: styles$3.container, children: /* @__PURE__ */ jsx(SpinLoader, { text: ["Fetching Segment data", "Finishing up"] }) });
35195
35197
  }
35196
35198
  if (isCreating || startedCreating) {
35197
- return /* @__PURE__ */ jsx("div", { className: styles$2.container, children: /* @__PURE__ */ jsx(
35199
+ return /* @__PURE__ */ jsx("div", { className: styles$3.container, children: /* @__PURE__ */ jsx(
35198
35200
  SpinLoader,
35199
35201
  {
35200
35202
  text: SEGMENT_ID && existingSegment ? ["Updating Segment", "Finishing up"] : ["Creating Segment", "Finishing up"]
35201
35203
  }
35202
35204
  ) });
35203
35205
  }
35204
- return /* @__PURE__ */ jsxs("div", { className: styles$2.container, children: [
35206
+ return /* @__PURE__ */ jsxs("div", { className: styles$3.container, children: [
35205
35207
  /* @__PURE__ */ jsx("div", { className: "relative w-full flex justify-end mb-4", children: /* @__PURE__ */ jsx(
35206
35208
  Button$1,
35207
35209
  {
@@ -35959,14 +35961,14 @@ const InfoTooltip = ({ title: title2, alertText, Icon: Icon2 = Info, onClick })
35959
35961
  ] }) })
35960
35962
  ] }) });
35961
35963
  };
35962
- const styles$1 = {
35964
+ const styles$2 = {
35963
35965
  container: "flex flex-col items-center justify-center h-full"
35964
35966
  };
35965
35967
  const AutomationStatistics = ({ automationId, iconDefinitions }) => {
35966
35968
  const [activeTab, setActiveTab] = useState("email");
35967
35969
  const { statistics, isLoading: isStatisticsLoading } = useGetBusinessAutomationStatistics(automationId);
35968
35970
  if (isStatisticsLoading || !statistics) {
35969
- return /* @__PURE__ */ jsx("div", { className: styles$1.container, children: /* @__PURE__ */ jsx(SpinLoader, { text: ["Fetching Statistics", "Finishing up"] }) });
35971
+ return /* @__PURE__ */ jsx("div", { className: styles$2.container, children: /* @__PURE__ */ jsx(SpinLoader, { text: ["Fetching Statistics", "Finishing up"] }) });
35970
35972
  }
35971
35973
  const StatsGrid = () => {
35972
35974
  const statGridMainDiv = "flex items-center bg-white rounded-lg p-4 shadow-sm border border-gray-200 transform transition-all duration-300 hover:shadow-md";
@@ -38826,7 +38828,7 @@ const MissingDataForPreview = ({
38826
38828
  ] });
38827
38829
  };
38828
38830
  const EmailPreviewHtmlRenderer = ({ html, height, width }) => {
38829
- return /* @__PURE__ */ jsx("div", { className: "w-full h-full min-h-[300px] bg-white rounded-lg border-0 overflow-hidden transition-all duration-300 ease-in-out", children: html ? /* @__PURE__ */ jsx(
38831
+ return /* @__PURE__ */ jsx("div", { className: "w-full h-full min-h-[300px] bg-white rounded-lg border-0 overflow-hidden transition-all duration-300 ease-in-out flex items-center justify-center", children: html ? /* @__PURE__ */ jsx(
38830
38832
  "iframe",
38831
38833
  {
38832
38834
  title: "Email Preview",
@@ -38848,7 +38850,27 @@ const EmailPreview$1 = ({
38848
38850
  emailBody,
38849
38851
  emailBaseDomain
38850
38852
  }) => {
38851
- return /* @__PURE__ */ jsxs("div", { className: "space-y-6 ", children: [
38853
+ const [emailPreviewDimensions, setEmailPreviewDimensions] = useState({
38854
+ width: 0,
38855
+ height: 0
38856
+ });
38857
+ const emailPreviewDiv = useRef(null);
38858
+ useEffect(() => {
38859
+ const updateHeight = () => {
38860
+ if (emailPreviewDiv.current) {
38861
+ requestAnimationFrame(() => {
38862
+ setEmailPreviewDimensions({
38863
+ width: emailPreviewDiv.current ? emailPreviewDiv.current.offsetWidth - 100 : 0,
38864
+ height: emailPreviewDiv.current ? emailPreviewDiv.current.offsetHeight - 100 : 0
38865
+ });
38866
+ });
38867
+ }
38868
+ };
38869
+ updateHeight();
38870
+ window.addEventListener("resize", updateHeight);
38871
+ return () => window.removeEventListener("resize", updateHeight);
38872
+ }, [emailPreviewDiv]);
38873
+ return /* @__PURE__ */ jsxs("div", { className: "space-y-6 h-full", children: [
38852
38874
  /* @__PURE__ */ jsxs("div", { className: "bg-gray-50 p-5 rounded-lg space-y-4 border border-gray-100", children: [
38853
38875
  /* @__PURE__ */ jsxs("div", { className: "flex items-start gap-3", children: [
38854
38876
  /* @__PURE__ */ jsx("span", { className: "font-medium text-gray-700 w-24", children: "From:" }),
@@ -38863,7 +38885,21 @@ const EmailPreview$1 = ({
38863
38885
  /* @__PURE__ */ jsx("span", { className: "text-gray-600 italic", children: emailPreviewText })
38864
38886
  ] })
38865
38887
  ] }),
38866
- /* @__PURE__ */ jsx("div", { className: "border rounded-lg p-6 min-h-[300px] bg-white shadow-inner flex", children: /* @__PURE__ */ jsx(EmailPreviewHtmlRenderer, { html: emailBody, height: 500, width: 500 }) })
38888
+ /* @__PURE__ */ jsx(
38889
+ "div",
38890
+ {
38891
+ className: "border rounded-lg p-6 bg-white shadow-inner flex-1 h-full w-full items-center justify-center",
38892
+ ref: emailPreviewDiv,
38893
+ children: /* @__PURE__ */ jsx(
38894
+ EmailPreviewHtmlRenderer,
38895
+ {
38896
+ html: emailBody,
38897
+ height: emailPreviewDimensions.height,
38898
+ width: emailPreviewDimensions.width
38899
+ }
38900
+ )
38901
+ }
38902
+ )
38867
38903
  ] });
38868
38904
  };
38869
38905
  const SMSPreview$1 = ({ fromPhone, body }) => {
@@ -39119,7 +39155,7 @@ const AutomationRecipients = ({ automationId, iconDefinitions }) => {
39119
39155
  const { recipients, isLoading, fetchError } = useGetBusinessAutomationRecipients(automationId);
39120
39156
  const { isLoading: isStatisticsLoading } = useGetBusinessAutomationStatistics(automationId);
39121
39157
  if (isLoading || isStatisticsLoading) {
39122
- return /* @__PURE__ */ jsx("div", { className: styles$1.container, children: /* @__PURE__ */ jsx(SpinLoader, { text: ["Fetching Recipients", "Finishing up"] }) });
39158
+ return /* @__PURE__ */ jsx("div", { className: styles$2.container, children: /* @__PURE__ */ jsx(SpinLoader, { text: ["Fetching Recipients", "Finishing up"] }) });
39123
39159
  }
39124
39160
  if (fetchError) {
39125
39161
  return /* @__PURE__ */ jsxs("div", { children: [
@@ -40496,18 +40532,38 @@ const DropdownMenuSeparator = React.forwardRef(({ className: className2, ...prop
40496
40532
  }
40497
40533
  ));
40498
40534
  DropdownMenuSeparator.displayName = Separator2.displayName;
40499
- const StepIndicator = ({
40535
+ const stepIndicatorContainer = "reach-styles-module__stepIndicatorContainer___FoKXB";
40536
+ const iconContainer = "reach-styles-module__iconContainer___Ki-1n";
40537
+ const checkIcon = "reach-styles-module__checkIcon___-krUS";
40538
+ const minusIcon = "reach-styles-module__minusIcon___r5cKs";
40539
+ const minusIconActive = "reach-styles-module__minusIconActive___-4JHM";
40540
+ const minusIconInactive = "reach-styles-module__minusIconInactive___JtvVB";
40541
+ const label = "reach-styles-module__label___tiCMA";
40542
+ const labelActive = "reach-styles-module__labelActive___EXydD";
40543
+ const labelInactive = "reach-styles-module__labelInactive___g-J3r";
40544
+ const styles$1 = {
40545
+ stepIndicatorContainer,
40546
+ iconContainer,
40547
+ checkIcon,
40548
+ minusIcon,
40549
+ minusIconActive,
40550
+ minusIconInactive,
40500
40551
  label,
40552
+ labelActive,
40553
+ labelInactive
40554
+ };
40555
+ const StepIndicator = ({
40556
+ label: label2,
40501
40557
  isCompleted,
40502
40558
  isActive
40503
40559
  }) => {
40504
- return /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-3 py-3", children: [
40505
- isCompleted ? /* @__PURE__ */ jsx("div", { className: "w-6 h-6 flex items-center justify-center", children: /* @__PURE__ */ jsx(Check, { className: "w-4 h-4 text-emerald-500" }) }) : /* @__PURE__ */ jsx("div", { className: "w-6 h-6 flex items-center justify-center", children: /* @__PURE__ */ jsx(
40560
+ return /* @__PURE__ */ jsxs("div", { className: styles$1.stepIndicatorContainer, children: [
40561
+ isCompleted ? /* @__PURE__ */ jsx("div", { className: styles$1.iconContainer, children: /* @__PURE__ */ jsx(Check, { className: styles$1.checkIcon }) }) : /* @__PURE__ */ jsx("div", { className: styles$1.iconContainer, children: /* @__PURE__ */ jsx(
40506
40562
  Minus,
40507
40563
  {
40508
40564
  className: cn$1(
40509
- "w-4 h-4",
40510
- isActive ? "text-[var(--reach-primary)]" : "text-gray-600"
40565
+ styles$1.minusIcon,
40566
+ isActive ? styles$1.minusIconActive : styles$1.minusIconInactive
40511
40567
  )
40512
40568
  }
40513
40569
  ) }),
@@ -40515,10 +40571,10 @@ const StepIndicator = ({
40515
40571
  "span",
40516
40572
  {
40517
40573
  className: cn$1(
40518
- "text-sm font-medium",
40519
- isActive ? "text-gray-900" : "text-gray-400"
40574
+ styles$1.label,
40575
+ isActive ? styles$1.labelActive : styles$1.labelInactive
40520
40576
  ),
40521
- children: label
40577
+ children: label2
40522
40578
  }
40523
40579
  )
40524
40580
  ] });
@@ -40775,16 +40831,18 @@ const stripoKeys = {
40775
40831
  demoTemplate: () => [...stripoKeys.templates(), "demo"]
40776
40832
  };
40777
40833
  const getStripoToken = async () => {
40778
- const response = await baseRequest("/stripo/token");
40834
+ const response = await baseRequest(`${STRIPO_PATH}/token`);
40779
40835
  return response.data;
40780
40836
  };
40781
40837
  const getEditorData = async () => {
40782
- const response = await baseRequest("/stripo/editor-data");
40838
+ const response = await baseRequest(
40839
+ `${STRIPO_PATH}/editor-data`
40840
+ );
40783
40841
  return response.data;
40784
40842
  };
40785
40843
  const getTemplate = async (automationId) => {
40786
40844
  const response = await baseRequest(
40787
- `/stripo/template/${automationId}`
40845
+ `${STRIPO_PATH}/template/${automationId}`
40788
40846
  );
40789
40847
  return response.data;
40790
40848
  };
@@ -41052,8 +41110,8 @@ const EmailPreview = ({ automation }) => {
41052
41110
  if (emailPreviewDiv.current) {
41053
41111
  requestAnimationFrame(() => {
41054
41112
  setEmailPreviewDimensions({
41055
- width: emailPreviewDiv.current?.offsetWidth || 0,
41056
- height: emailPreviewDiv.current?.offsetHeight || 0
41113
+ width: emailPreviewDiv.current ? emailPreviewDiv.current.offsetWidth - 100 : 0,
41114
+ height: emailPreviewDiv.current ? emailPreviewDiv.current.offsetHeight - 100 : 0
41057
41115
  });
41058
41116
  });
41059
41117
  }
@@ -41123,12 +41181,6 @@ const EmailPreview = ({ automation }) => {
41123
41181
  getCommunicationGroup2(communicationGroupId, {
41124
41182
  onSuccess: (data) => {
41125
41183
  setDataFromFetch(data);
41126
- },
41127
- onError: () => {
41128
- console.log("error");
41129
- },
41130
- onSettled: () => {
41131
- console.log("onSettled");
41132
41184
  }
41133
41185
  });
41134
41186
  }
@@ -41594,7 +41646,7 @@ const SMSPreview = ({ automation, iconDefinitions }) => {
41594
41646
  return /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(SpinLoader, { text: ["Loading..."] }) });
41595
41647
  }
41596
41648
  const smsChannelSenders = channelSenders.channel_senders?.filter(
41597
- (sender) => sender.channel_sender_metadata.from
41649
+ (sender) => sender.channel_sender_metadata.from || sender.channel_sender_metadata.messageServiceSid
41598
41650
  );
41599
41651
  return /* @__PURE__ */ jsxs("div", { children: [
41600
41652
  /* @__PURE__ */ jsx(Dialog, { open: showSmsEditor, onOpenChange: setShowSmsEditor, children: /* @__PURE__ */ jsxs(DialogContent, { children: [
@@ -45234,11 +45286,11 @@ function WeekNumber(props) {
45234
45286
  if (!onWeekNumberClick) {
45235
45287
  return jsx("span", { className: classNames.weeknumber, style: styles2.weeknumber, children: content2 });
45236
45288
  }
45237
- var label = labelWeekNumber2(Number(weekNumber), { locale: locale2 });
45289
+ var label2 = labelWeekNumber2(Number(weekNumber), { locale: locale2 });
45238
45290
  var handleClick = function(e4) {
45239
45291
  onWeekNumberClick(weekNumber, dates2, e4);
45240
45292
  };
45241
- return jsx(Button, { name: "week-number", "aria-label": label, className: classNames.weeknumber, style: styles2.weeknumber, onClick: handleClick, children: content2 });
45293
+ return jsx(Button, { name: "week-number", "aria-label": label2, className: classNames.weeknumber, style: styles2.weeknumber, onClick: handleClick, children: content2 });
45242
45294
  }
45243
45295
  function Row(props) {
45244
45296
  var _a, _b;
@@ -45941,7 +45993,7 @@ const SegmentSection = ({
45941
45993
  allSegments,
45942
45994
  onAddSegment,
45943
45995
  onRemoveSegment,
45944
- onCreateSegment,
45996
+ setOpenCreateSegmentDialog,
45945
45997
  iconDefinitions
45946
45998
  }) => {
45947
45999
  const handleValueChange = (newValues) => {
@@ -45950,54 +46002,43 @@ const SegmentSection = ({
45950
46002
  segmentsToAdd.forEach(onAddSegment);
45951
46003
  segmentsToRemove.forEach(onRemoveSegment);
45952
46004
  };
45953
- const [openSegmentBuilder, setOpenSegmentBuilder] = useState(false);
45954
46005
  const [segmentSelectedIds, setSegmentSelectedIds] = useState([]);
45955
46006
  const options = allSegments.map((segment) => ({
45956
46007
  label: segment.name,
45957
46008
  value: segment.id
45958
46009
  }));
45959
- return /* @__PURE__ */ jsxs("div", { children: [
45960
- /* @__PURE__ */ jsx(Dialog, { open: openSegmentBuilder, onOpenChange: setOpenSegmentBuilder, children: /* @__PURE__ */ jsx(DialogContent, { hideCloseButton: true, children: /* @__PURE__ */ jsx(
45961
- SegmentBuilder,
45962
- {
45963
- iconDefinitions,
45964
- onClose: (createdSegment) => {
45965
- if (createdSegment === "error") {
45966
- console.error("Error creating segment");
45967
- setOpenSegmentBuilder(false);
45968
- } else if (createdSegment === false) {
45969
- setOpenSegmentBuilder(false);
45970
- } else if (createdSegment) {
45971
- onCreateSegment();
45972
- setOpenSegmentBuilder(false);
45973
- }
45974
- }
45975
- }
45976
- ) }) }),
45977
- /* @__PURE__ */ jsx(
45978
- MultiSelect,
45979
- {
45980
- selectedValues: segmentSelectedIds,
45981
- setSelectedValues: setSegmentSelectedIds,
45982
- options,
45983
- defaultValue: segments,
45984
- onValueChange: handleValueChange,
45985
- placeholder: "Select segments",
45986
- maxCount: 5,
45987
- extraCommandItems: /* @__PURE__ */ jsxs(
46010
+ useEffect(() => {
46011
+ setSegmentSelectedIds(segments);
46012
+ }, [segments]);
46013
+ return /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(
46014
+ MultiSelect,
46015
+ {
46016
+ selectedValues: segmentSelectedIds,
46017
+ setSelectedValues: setSegmentSelectedIds,
46018
+ options,
46019
+ defaultValue: segments,
46020
+ onValueChange: handleValueChange,
46021
+ placeholder: "Select segments",
46022
+ maxCount: 5,
46023
+ extraCommandItems: [
46024
+ (closePopup) => /* @__PURE__ */ jsxs(
45988
46025
  CommandItem,
45989
46026
  {
45990
- onSelect: () => setOpenSegmentBuilder(true),
46027
+ onSelect: () => {
46028
+ closePopup(false);
46029
+ setOpenCreateSegmentDialog(true);
46030
+ },
45991
46031
  className: "cursor-pointer",
45992
46032
  children: [
45993
46033
  /* @__PURE__ */ jsx(iconDefinitions.PlusIcon, { className: "w-4 h-4" }),
45994
46034
  "New"
45995
46035
  ]
45996
- }
46036
+ },
46037
+ "new-segment"
45997
46038
  )
45998
- }
45999
- )
46000
- ] });
46039
+ ]
46040
+ }
46041
+ ) });
46001
46042
  };
46002
46043
  const SelectSegments = ({
46003
46044
  iconDefinitions,
@@ -46005,7 +46046,7 @@ const SelectSegments = ({
46005
46046
  excludedSegments,
46006
46047
  handleAddSegment,
46007
46048
  handleRemoveSegment,
46008
- handleCreateSegment,
46049
+ setOpenCreateSegmentDialog,
46009
46050
  segments,
46010
46051
  defaultIsExcludeOpen = false
46011
46052
  }) => {
@@ -46018,7 +46059,7 @@ const SelectSegments = ({
46018
46059
  allSegments: segments?.segments || [],
46019
46060
  onAddSegment: (id2) => handleAddSegment(id2, "include"),
46020
46061
  onRemoveSegment: (id2) => handleRemoveSegment(id2, "include"),
46021
- onCreateSegment: handleCreateSegment,
46062
+ setOpenCreateSegmentDialog,
46022
46063
  iconDefinitions
46023
46064
  }
46024
46065
  ),
@@ -46058,7 +46099,7 @@ const SelectSegments = ({
46058
46099
  allSegments: segments?.segments || [],
46059
46100
  onAddSegment: (id2) => handleAddSegment(id2, "exclude"),
46060
46101
  onRemoveSegment: (id2) => handleRemoveSegment(id2, "exclude"),
46061
- onCreateSegment: handleCreateSegment,
46102
+ setOpenCreateSegmentDialog,
46062
46103
  iconDefinitions
46063
46104
  }
46064
46105
  )
@@ -46068,6 +46109,7 @@ const SelectSegments = ({
46068
46109
  ] });
46069
46110
  };
46070
46111
  const SelectAudience = ({ iconDefinitions, automation }) => {
46112
+ const { toast: toast2 } = useToast();
46071
46113
  const [openCreateSegmentDialog, setOpenCreateSegmentDialog] = React__default.useState(false);
46072
46114
  const [initialStateSet, setInitialStateSet] = React__default.useState(false);
46073
46115
  const { segments, isLoading, refetchSegments } = useListSegments();
@@ -46101,8 +46143,9 @@ const SelectAudience = ({ iconDefinitions, automation }) => {
46101
46143
  setExcludedSegments((prev) => prev.filter((id2) => id2 !== segmentId));
46102
46144
  }
46103
46145
  };
46104
- const handleCreateSegment = () => {
46105
- setOpenCreateSegmentDialog(true);
46146
+ const handleCreateSegment = (segmentId) => {
46147
+ refetchSegments();
46148
+ setIncludedSegments((prev) => [...prev, segmentId]);
46106
46149
  };
46107
46150
  useEffect(() => {
46108
46151
  const hasSegmentsChanged = JSON.stringify(automation.includeSegmentIds) !== JSON.stringify(includedSegments) || JSON.stringify(automation.excludeSegmentIds) !== JSON.stringify(excludedSegments);
@@ -46152,6 +46195,8 @@ const SelectAudience = ({ iconDefinitions, automation }) => {
46152
46195
  setInitialStateSet(true);
46153
46196
  return;
46154
46197
  }
46198
+ console.log("automation.includeSegmentIds", automation.includeSegmentIds);
46199
+ console.log("automation.excludeSegmentIds", automation.excludeSegmentIds);
46155
46200
  if (allUsersSelected) {
46156
46201
  setSelectedAudience("all");
46157
46202
  } else {
@@ -46167,8 +46212,8 @@ const SelectAudience = ({ iconDefinitions, automation }) => {
46167
46212
  allUsersSelected,
46168
46213
  getAllUsersSegment,
46169
46214
  updateAutomation2,
46170
- automation.includeSegmentIds.length,
46171
- automation.excludeSegmentIds.length
46215
+ automation.includeSegmentIds,
46216
+ automation.excludeSegmentIds
46172
46217
  ]);
46173
46218
  if (isLoading || !segments || !initialStateSet) {
46174
46219
  return /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(SpinLoader, { text: ["Fetching segments", "Finishing up"] }) });
@@ -46178,19 +46223,35 @@ const SelectAudience = ({ iconDefinitions, automation }) => {
46178
46223
  Dialog,
46179
46224
  {
46180
46225
  open: openCreateSegmentDialog,
46226
+ modal: true,
46181
46227
  onOpenChange: setOpenCreateSegmentDialog,
46182
- children: /* @__PURE__ */ jsx(DialogContent, { className: "max-w-4xl", children: /* @__PURE__ */ jsx(
46183
- SegmentBuilder,
46184
- {
46185
- iconDefinitions,
46186
- onClose: (result) => {
46187
- if (result !== false && result !== "error") {
46188
- refetchSegments();
46228
+ children: /* @__PURE__ */ jsxs(DialogContent, { hideCloseButton: true, children: [
46229
+ /* @__PURE__ */ jsxs(VisuallyHidden, { children: [
46230
+ /* @__PURE__ */ jsx(DialogTitle, { children: "Create Segment" }),
46231
+ /* @__PURE__ */ jsx(DialogDescription, { children: "Create a new segment to use in your automation." })
46232
+ ] }),
46233
+ /* @__PURE__ */ jsx(
46234
+ SegmentBuilder,
46235
+ {
46236
+ iconDefinitions,
46237
+ onClose: (createdSegment) => {
46238
+ if (createdSegment === "error") {
46239
+ toast2({
46240
+ title: "Error creating segment",
46241
+ description: "Please try again",
46242
+ variant: "destructive"
46243
+ });
46244
+ setOpenCreateSegmentDialog(false);
46245
+ } else if (createdSegment === false) {
46246
+ setOpenCreateSegmentDialog(false);
46247
+ } else if (createdSegment) {
46248
+ handleCreateSegment(createdSegment);
46249
+ setOpenCreateSegmentDialog(false);
46250
+ }
46189
46251
  }
46190
- setOpenCreateSegmentDialog(false);
46191
46252
  }
46192
- }
46193
- ) })
46253
+ )
46254
+ ] })
46194
46255
  }
46195
46256
  ),
46196
46257
  /* @__PURE__ */ jsx("div", { className: " w-full", children: /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-2 gap-8", children: [
@@ -46227,7 +46288,7 @@ const SelectAudience = ({ iconDefinitions, automation }) => {
46227
46288
  excludedSegments,
46228
46289
  handleAddSegment,
46229
46290
  handleRemoveSegment,
46230
- handleCreateSegment,
46291
+ setOpenCreateSegmentDialog,
46231
46292
  segments,
46232
46293
  defaultIsExcludeOpen: automation.excludeSegmentIds?.length > 0
46233
46294
  }
@@ -46827,7 +46888,7 @@ const ViewAutomationHeader = ({
46827
46888
  /* @__PURE__ */ jsx(iconDefinitions.DropdownMenuTrigger, { className: "ml-2 h-4 w-4" })
46828
46889
  ] }) }),
46829
46890
  /* @__PURE__ */ jsxs(DropdownMenuContent, { children: [
46830
- (automation.status === AutomationStatus.DRAFT || automation.status === AutomationStatus.ACTIVE) && /* @__PURE__ */ jsx(
46891
+ automation.status === AutomationStatus.DRAFT && /* @__PURE__ */ jsx(
46831
46892
  DropdownMenuItem,
46832
46893
  {
46833
46894
  onClick: () => setOpenEditAutomationPopup(true),
@@ -46892,12 +46953,13 @@ const ViewAutomationHeader = ({
46892
46953
  ] });
46893
46954
  };
46894
46955
  const ViewAutomationModalContent = ({
46895
- iconDefinitions,
46956
+ iconDefinitions: passedInIconDefinitions,
46896
46957
  autoOpenEditPopup,
46897
46958
  automationId,
46898
46959
  showBackButton = false,
46899
46960
  logoUrl
46900
46961
  }) => {
46962
+ const iconDefinitions = mergeIconDefinitions(passedInIconDefinitions);
46901
46963
  const params = useParams();
46902
46964
  const [searchParams] = useSearchParams();
46903
46965
  const FINAL_AUTOMATION_ID = automationId || params?.automationId || searchParams.get("automationId");
@@ -46909,7 +46971,7 @@ const ViewAutomationModalContent = ({
46909
46971
  return /* @__PURE__ */ jsx("div", { children: "Invalid automation ID" });
46910
46972
  }
46911
46973
  if (!automation && (isFetching || isLoading)) {
46912
- return /* @__PURE__ */ jsx("div", { className: styles$5.container, children: /* @__PURE__ */ jsx(SpinLoader, { text: ["Fetching Automation data", "Finishing up"] }) });
46974
+ return /* @__PURE__ */ jsx("div", { className: styles$6.container, children: /* @__PURE__ */ jsx(SpinLoader, { text: ["Fetching Automation data", "Finishing up"] }) });
46913
46975
  }
46914
46976
  if (fetchError) {
46915
46977
  return /* @__PURE__ */ jsxs("div", { children: [
@@ -46920,7 +46982,7 @@ const ViewAutomationModalContent = ({
46920
46982
  if (!automation) {
46921
46983
  return /* @__PURE__ */ jsx("div", { children: "No automation found" });
46922
46984
  }
46923
- return /* @__PURE__ */ jsxs("div", { className: styles$5.container, children: [
46985
+ return /* @__PURE__ */ jsxs("div", { className: styles$6.container, children: [
46924
46986
  /* @__PURE__ */ jsx(
46925
46987
  ViewAutomationHeader,
46926
46988
  {