@embedreach/components 0.1.74 → 0.1.76

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.
@@ -4802,24 +4802,24 @@ var escapeKey = (key) => key.replace(/\./g, "\\.");
4802
4802
  var stringifyPath = (path2) => path2.map(String).map(escapeKey).join(".");
4803
4803
  var parsePath$1 = (string) => {
4804
4804
  const result = [];
4805
- let segment = "";
4805
+ let segment2 = "";
4806
4806
  for (let i3 = 0; i3 < string.length; i3++) {
4807
4807
  let char = string.charAt(i3);
4808
4808
  const isEscapedDot = char === "\\" && string.charAt(i3 + 1) === ".";
4809
4809
  if (isEscapedDot) {
4810
- segment += ".";
4810
+ segment2 += ".";
4811
4811
  i3++;
4812
4812
  continue;
4813
4813
  }
4814
4814
  const isEndOfSegment = char === ".";
4815
4815
  if (isEndOfSegment) {
4816
- result.push(segment);
4817
- segment = "";
4816
+ result.push(segment2);
4817
+ segment2 = "";
4818
4818
  continue;
4819
4819
  }
4820
- segment += char;
4820
+ segment2 += char;
4821
4821
  }
4822
- const lastSegment = segment;
4822
+ const lastSegment = segment2;
4823
4823
  result.push(lastSegment);
4824
4824
  return result;
4825
4825
  };
@@ -5904,8 +5904,8 @@ function e(e4) {
5904
5904
  }
5905
5905
  return t3.prototype = new Error(), t3.prototype.name = e4, t3.prototype.constructor = t3, t3;
5906
5906
  }
5907
- const t = e("LaunchDarklyUnexpectedResponseError"), n = e("LaunchDarklyInvalidEnvironmentIdError"), r$1 = e("LaunchDarklyInvalidUserError"), o = e("LaunchDarklyInvalidEventKeyError"), i = e("LaunchDarklyInvalidArgumentError"), a = e("LaunchDarklyFlagFetchError");
5908
- for (var s3 = { LDUnexpectedResponseError: t, LDInvalidEnvironmentIdError: n, LDInvalidUserError: r$1, LDInvalidEventKeyError: o, LDInvalidArgumentError: i, LDInvalidDataError: e("LaunchDarklyInvalidDataError"), LDFlagFetchError: a, LDTimeoutError: e("LaunchDarklyTimeoutError"), isHttpErrorRecoverable: function(e4) {
5907
+ const t$1 = e("LaunchDarklyUnexpectedResponseError"), n = e("LaunchDarklyInvalidEnvironmentIdError"), r$1 = e("LaunchDarklyInvalidUserError"), o = e("LaunchDarklyInvalidEventKeyError"), i = e("LaunchDarklyInvalidArgumentError"), a = e("LaunchDarklyFlagFetchError");
5908
+ for (var s3 = { LDUnexpectedResponseError: t$1, LDInvalidEnvironmentIdError: n, LDInvalidUserError: r$1, LDInvalidEventKeyError: o, LDInvalidArgumentError: i, LDInvalidDataError: e("LaunchDarklyInvalidDataError"), LDFlagFetchError: a, LDTimeoutError: e("LaunchDarklyTimeoutError"), isHttpErrorRecoverable: function(e4) {
5909
5909
  return !(e4 >= 400 && e4 < 500) || (400 === e4 || 408 === e4 || 429 === e4);
5910
5910
  } }, c2 = function(e4) {
5911
5911
  var t3 = m$2(e4), n2 = t3[0], r2 = t3[1];
@@ -9914,6 +9914,18 @@ const Send = createLucideIcon("Send", [
9914
9914
  ],
9915
9915
  ["path", { d: "m21.854 2.147-10.94 10.939", key: "12cjpa" }]
9916
9916
  ]);
9917
+ /**
9918
+ * @license lucide-react v0.464.0 - ISC
9919
+ *
9920
+ * This source code is licensed under the ISC license.
9921
+ * See the LICENSE file in the root directory of this source tree.
9922
+ */
9923
+ const Settings2 = createLucideIcon("Settings2", [
9924
+ ["path", { d: "M20 7h-9", key: "3s1dr2" }],
9925
+ ["path", { d: "M14 17H5", key: "gfn3mx" }],
9926
+ ["circle", { cx: "17", cy: "17", r: "3", key: "18b49y" }],
9927
+ ["circle", { cx: "7", cy: "7", r: "3", key: "dfmy0x" }]
9928
+ ]);
9917
9929
  /**
9918
9930
  * @license lucide-react v0.464.0 - ISC
9919
9931
  *
@@ -9930,6 +9942,25 @@ const ShieldBan = createLucideIcon("ShieldBan", [
9930
9942
  ],
9931
9943
  ["path", { d: "m4.243 5.21 14.39 12.472", key: "1c9a7c" }]
9932
9944
  ]);
9945
+ /**
9946
+ * @license lucide-react v0.464.0 - ISC
9947
+ *
9948
+ * This source code is licensed under the ISC license.
9949
+ * See the LICENSE file in the root directory of this source tree.
9950
+ */
9951
+ const Sparkles = createLucideIcon("Sparkles", [
9952
+ [
9953
+ "path",
9954
+ {
9955
+ d: "M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",
9956
+ key: "4pj2yx"
9957
+ }
9958
+ ],
9959
+ ["path", { d: "M20 3v4", key: "1olli1" }],
9960
+ ["path", { d: "M22 5h-4", key: "1gvqau" }],
9961
+ ["path", { d: "M4 17v2", key: "vumght" }],
9962
+ ["path", { d: "M5 18H3", key: "zchphs" }]
9963
+ ]);
9933
9964
  /**
9934
9965
  * @license lucide-react v0.464.0 - ISC
9935
9966
  *
@@ -12787,45 +12818,64 @@ const toShadcnFormat = (color2) => {
12787
12818
  }
12788
12819
  };
12789
12820
  const DEFAULT_THEME_STYLES = {
12790
- // Base colors
12821
+ // Base colors - Pure white background with rich dark text
12791
12822
  background: "0 0% 100%",
12792
- foreground: "240 10% 3.9%",
12793
- // Card elements
12823
+ // Pure white
12824
+ foreground: "225 15% 16%",
12825
+ // Rich dark gray with minimal color cast
12826
+ // Card elements - Clean white
12794
12827
  card: "0 0% 100%",
12795
- "card-foreground": "240 10% 3.9%",
12796
- // Popover elements
12828
+ "card-foreground": "225 15% 16%",
12829
+ // Popover elements - Consistent with cards
12797
12830
  popover: "0 0% 100%",
12798
- "popover-foreground": "240 10% 3.9%",
12799
- // Primary brand colors
12800
- primary: "240 5.9% 10%",
12801
- "primary-foreground": "0 0% 98%",
12802
- // Secondary elements
12803
- secondary: "240 4.8% 95.9%",
12804
- "secondary-foreground": "240 5.9% 10%",
12805
- // Muted elements
12806
- muted: "240 4.8% 95.9%",
12807
- "muted-foreground": "240 3.8% 46.1%",
12808
- // Accent elements
12809
- accent: "240 4.8% 95.9%",
12810
- "accent-foreground": "240 5.9% 10%",
12811
- // Destructive elements
12831
+ "popover-foreground": "225 15% 16%",
12832
+ // Primary brand colors - Deep slate with subtle warmth
12833
+ primary: "210 30% 25%",
12834
+ // Deep slate blue-gray, sophisticated and neutral
12835
+ "primary-foreground": "0 0% 100%",
12836
+ // Pure white for contrast
12837
+ // Secondary elements - Subtle contrast
12838
+ secondary: "210 15% 94%",
12839
+ // Very light gray with slight coolness
12840
+ "secondary-foreground": "210 30% 25%",
12841
+ // Matching primary
12842
+ // Muted elements - Neutral, refined
12843
+ muted: "210 10% 96%",
12844
+ // Very light neutral
12845
+ "muted-foreground": "220 10% 45%",
12846
+ // Mid-tone for muted text
12847
+ // Accent elements - Subtle accent
12848
+ accent: "210 15% 94%",
12849
+ // Matches secondary for consistency
12850
+ "accent-foreground": "210 30% 25%",
12851
+ // Matching primary
12852
+ // Destructive elements - Keep your existing red
12812
12853
  destructive: "0 84.2% 60.2%",
12813
- "destructive-foreground": "0 0% 98%",
12814
- // Borders and inputs
12815
- border: "240 5.9% 90%",
12816
- input: "240 5.9% 90%",
12817
- ring: "240 10% 3.9%",
12818
- // Chart colors
12819
- "chart-1": "12 76% 61%",
12820
- "chart-2": "173 58% 39%",
12821
- "chart-3": "197 37% 24%",
12822
- "chart-4": "43 74% 66%",
12823
- "chart-5": "27 87% 67%",
12824
- // Border radius
12825
- radius: "0.5rem",
12826
- // Fonts
12827
- "font-body": 'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',
12828
- "font-heading": 'system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'
12854
+ // Keeping your original red
12855
+ "destructive-foreground": "0 0% 100%",
12856
+ // White for contrast
12857
+ // Borders and inputs - Subtle
12858
+ border: "220 13% 90%",
12859
+ // Soft gray
12860
+ input: "220 13% 90%",
12861
+ ring: "210 30% 25%",
12862
+ // Matches primary for focus states
12863
+ // Chart colors - Harmonious palette that works with your red
12864
+ "chart-1": "210 50% 50%",
12865
+ // Slate blue
12866
+ "chart-2": "260 50% 55%",
12867
+ // Purple
12868
+ "chart-3": "150 50% 45%",
12869
+ // Green
12870
+ "chart-4": "325 50% 55%",
12871
+ // Magenta
12872
+ "chart-5": "45 80% 55%",
12873
+ // Gold
12874
+ // Border radius - Slightly more rounded
12875
+ radius: "0.625rem",
12876
+ // Fonts - Modern and readable
12877
+ "font-body": 'Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',
12878
+ "font-heading": '"Plus Jakarta Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'
12829
12879
  };
12830
12880
  const applyThemeStyles = (styles2) => {
12831
12881
  const existingStyles = document.getElementById("reach-theme-styles");
@@ -12930,67 +12980,6 @@ const ThemeInitializer = ({ initialTheme, children: children2 }) => {
12930
12980
  const Provider$1 = ({ initialTheme, children: children2 }) => {
12931
12981
  return /* @__PURE__ */ jsx(BaseProvider, { children: /* @__PURE__ */ jsx(ThemeInitializer, { initialTheme, children: children2 }) });
12932
12982
  };
12933
- const matchHtmlEntity = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g;
12934
- const htmlEntities = {
12935
- "&amp;": "&",
12936
- "&#38;": "&",
12937
- "&lt;": "<",
12938
- "&#60;": "<",
12939
- "&gt;": ">",
12940
- "&#62;": ">",
12941
- "&apos;": "'",
12942
- "&#39;": "'",
12943
- "&quot;": '"',
12944
- "&#34;": '"',
12945
- "&nbsp;": " ",
12946
- "&#160;": " ",
12947
- "&copy;": "©",
12948
- "&#169;": "©",
12949
- "&reg;": "®",
12950
- "&#174;": "®",
12951
- "&hellip;": "…",
12952
- "&#8230;": "…",
12953
- "&#x2F;": "/",
12954
- "&#47;": "/"
12955
- };
12956
- const unescapeHtmlEntity = (m4) => htmlEntities[m4];
12957
- const unescape$1 = (text) => text.replace(matchHtmlEntity, unescapeHtmlEntity);
12958
- let defaultOptions$2 = {
12959
- bindI18n: "languageChanged",
12960
- bindI18nStore: "",
12961
- transEmptyNodeValue: "",
12962
- transSupportBasicHtmlNodes: true,
12963
- transWrapTextNodes: "",
12964
- transKeepBasicHtmlNodesFor: ["br", "strong", "i", "p"],
12965
- useSuspense: true,
12966
- unescape: unescape$1
12967
- };
12968
- const setDefaults = (options = {}) => {
12969
- defaultOptions$2 = {
12970
- ...defaultOptions$2,
12971
- ...options
12972
- };
12973
- };
12974
- const initReactI18next = {
12975
- type: "3rdParty",
12976
- init(instance2) {
12977
- setDefaults(instance2.options.react);
12978
- }
12979
- };
12980
- const I18nContext = createContext$1();
12981
- function I18nextProvider({
12982
- i18n,
12983
- defaultNS,
12984
- children: children2
12985
- }) {
12986
- const value = useMemo(() => ({
12987
- i18n,
12988
- defaultNS
12989
- }), [i18n, defaultNS]);
12990
- return createElement$1(I18nContext.Provider, {
12991
- value
12992
- }, children2);
12993
- }
12994
12983
  const isString = (obj) => typeof obj === "string";
12995
12984
  const defer = () => {
12996
12985
  let res;
@@ -15186,7 +15175,7 @@ instance.reloadResources;
15186
15175
  instance.use;
15187
15176
  instance.changeLanguage;
15188
15177
  instance.getFixedT;
15189
- instance.t;
15178
+ const t = instance.t;
15190
15179
  instance.exists;
15191
15180
  instance.setDefaultNamespace;
15192
15181
  instance.hasLoadedNamespace;
@@ -15554,6 +15543,67 @@ class Browser {
15554
15543
  }
15555
15544
  }
15556
15545
  Browser.type = "languageDetector";
15546
+ const matchHtmlEntity = /&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g;
15547
+ const htmlEntities = {
15548
+ "&amp;": "&",
15549
+ "&#38;": "&",
15550
+ "&lt;": "<",
15551
+ "&#60;": "<",
15552
+ "&gt;": ">",
15553
+ "&#62;": ">",
15554
+ "&apos;": "'",
15555
+ "&#39;": "'",
15556
+ "&quot;": '"',
15557
+ "&#34;": '"',
15558
+ "&nbsp;": " ",
15559
+ "&#160;": " ",
15560
+ "&copy;": "©",
15561
+ "&#169;": "©",
15562
+ "&reg;": "®",
15563
+ "&#174;": "®",
15564
+ "&hellip;": "…",
15565
+ "&#8230;": "…",
15566
+ "&#x2F;": "/",
15567
+ "&#47;": "/"
15568
+ };
15569
+ const unescapeHtmlEntity = (m4) => htmlEntities[m4];
15570
+ const unescape$1 = (text) => text.replace(matchHtmlEntity, unescapeHtmlEntity);
15571
+ let defaultOptions$2 = {
15572
+ bindI18n: "languageChanged",
15573
+ bindI18nStore: "",
15574
+ transEmptyNodeValue: "",
15575
+ transSupportBasicHtmlNodes: true,
15576
+ transWrapTextNodes: "",
15577
+ transKeepBasicHtmlNodesFor: ["br", "strong", "i", "p"],
15578
+ useSuspense: true,
15579
+ unescape: unescape$1
15580
+ };
15581
+ const setDefaults = (options = {}) => {
15582
+ defaultOptions$2 = {
15583
+ ...defaultOptions$2,
15584
+ ...options
15585
+ };
15586
+ };
15587
+ const initReactI18next = {
15588
+ type: "3rdParty",
15589
+ init(instance2) {
15590
+ setDefaults(instance2.options.react);
15591
+ }
15592
+ };
15593
+ const I18nContext = createContext$1();
15594
+ function I18nextProvider({
15595
+ i18n,
15596
+ defaultNS,
15597
+ children: children2
15598
+ }) {
15599
+ const value = useMemo(() => ({
15600
+ i18n,
15601
+ defaultNS
15602
+ }), [i18n, defaultNS]);
15603
+ return createElement$1(I18nContext.Provider, {
15604
+ value
15605
+ }, children2);
15606
+ }
15557
15607
  const ad_spend$1 = "Ad Spend";
15558
15608
  const date$2 = "Date";
15559
15609
  const close$1 = "Close";
@@ -16000,6 +16050,20 @@ const enCommon = {
16000
16050
  magic_link: magic_link$1,
16001
16051
  empty_state: empty_state$1
16002
16052
  };
16053
+ const user$1 = "User";
16054
+ const user_other$1 = "Users";
16055
+ const automation$1 = "Automation";
16056
+ const automation_other$1 = "Automations";
16057
+ const segment$1 = "Segment";
16058
+ const segment_other$1 = "Segments";
16059
+ const enEngage = {
16060
+ user: user$1,
16061
+ user_other: user_other$1,
16062
+ automation: automation$1,
16063
+ automation_other: automation_other$1,
16064
+ segment: segment$1,
16065
+ segment_other: segment_other$1
16066
+ };
16003
16067
  const ad_spend = "Gasto en anuncios";
16004
16068
  const date$1 = "Fecha";
16005
16069
  const close = "Cerrar";
@@ -16446,12 +16510,28 @@ const esCommon = {
16446
16510
  magic_link,
16447
16511
  empty_state
16448
16512
  };
16513
+ const user = "Usuario";
16514
+ const user_other = "Usuarios";
16515
+ const automation = "Automatización";
16516
+ const automation_other = "Automatizaciones";
16517
+ const segment = "Segmento";
16518
+ const segment_other = "Segmentos";
16519
+ const esEngage = {
16520
+ user,
16521
+ user_other,
16522
+ automation,
16523
+ automation_other,
16524
+ segment,
16525
+ segment_other
16526
+ };
16449
16527
  const resources = {
16450
16528
  en: {
16451
- common: enCommon
16529
+ common: enCommon,
16530
+ engage: enEngage
16452
16531
  },
16453
16532
  es: {
16454
- common: esCommon
16533
+ common: esCommon,
16534
+ engage: esEngage
16455
16535
  }
16456
16536
  };
16457
16537
  instance.use(Browser).use(initReactI18next).init({
@@ -16492,6 +16572,424 @@ instance.use(Browser).use(initReactI18next).init({
16492
16572
  convertDetectedLanguage: (lng) => lng.split("-")[0]
16493
16573
  }
16494
16574
  });
16575
+ const defaultTranslations = {
16576
+ engage: {
16577
+ user: "User",
16578
+ user_other: "Users",
16579
+ automation: "Automation",
16580
+ automation_other: "Automations",
16581
+ segment: "Segment",
16582
+ segment_other: "Segments"
16583
+ },
16584
+ common: {
16585
+ ad_spend: "Ad Spend",
16586
+ date: "Date",
16587
+ close: "Close",
16588
+ continue: "Continue",
16589
+ connected: "Connected",
16590
+ connecting: "Connecting...",
16591
+ reauth_required: "Re-authentication required",
16592
+ reauth_required_description: "Re-authentication required for one of your ad accounts",
16593
+ reauthenticate: "Reauthenticate",
16594
+ account_settings: "Account Settings",
16595
+ manage_account_settings: "Manage your account settings",
16596
+ copy: "Copy",
16597
+ copied: "Copied",
16598
+ error: "An error occurred",
16599
+ filter: "Filter",
16600
+ finishingUp: "Finishing up...",
16601
+ loading: "Loading...",
16602
+ need_help: "Need help? let us know",
16603
+ next: "Next",
16604
+ next_steps: "Next steps:",
16605
+ number: "{{number}}",
16606
+ previous: "Previous",
16607
+ revenue: "Revenue",
16608
+ revenue_from_ads: "Revenue From Ads",
16609
+ roas: "ROAS",
16610
+ return_on_ad_spend: "Return on Ad Spend",
16611
+ select_dates: "Select dates",
16612
+ total_ads_spend: "Total Ads Spend",
16613
+ measure: {
16614
+ dashboard: {
16615
+ title: "Marketing ROI Dashboard",
16616
+ subtitle: "Track and analyze how your marketing efforts are driving sales",
16617
+ reach_managed_campaign_banner: "Your ads are being managed by Reach. We’ll automatically optimize them to drive the best results."
16618
+ }
16619
+ },
16620
+ authentication: {
16621
+ required: "Authentication required",
16622
+ failed: "Authentication failed",
16623
+ connect_account_title: "Connect Your {{provider}} Account",
16624
+ connect_account_description: "To create and manage ad campaigns, please connect your {{provider}} account",
16625
+ connect_account_button: "Continue with {{provider}}",
16626
+ connect_account_TOS: "By connecting, you agree to our Terms of Service and Privacy Policy"
16627
+ },
16628
+ theme: {
16629
+ loading: "Loading theme...",
16630
+ error: "Error loading theme: {{message}}"
16631
+ },
16632
+ dates: {
16633
+ last_week: "Last week",
16634
+ last_month: "Last month",
16635
+ last_quarter: "Last quarter",
16636
+ last_year: "Last year"
16637
+ },
16638
+ campaigns: {
16639
+ setup: {
16640
+ card_header: "Run paid digital ads to get new leads & customers",
16641
+ title: "Create your first AI-driven Ad campaign in 4 simple clicks",
16642
+ description: "Welcome to the future of advertising! Our AI-powered campaign builder helps you effortlessly design and manage ads that reach your target audience with precision. Get started now to unlock the potential of automated, data-driven advertising.",
16643
+ button: "Set up paid ads",
16644
+ next_steps_description: "Already running ads? Track Your Marketing Results with a few clicks.",
16645
+ link_to_analytics: "Connect your existing accounts to get instant insights into your marketing performance."
16646
+ },
16647
+ how_it_works: {
16648
+ dialog_title: "How It Works",
16649
+ title: "Setup your ad campaign",
16650
+ step1: {
16651
+ title: "Set up budget & review your ads",
16652
+ description: "Define how much you want to spend, review the ad designs, and configure who you want to reach."
16653
+ },
16654
+ step2: {
16655
+ title: "We’ll publish & optimize your ads on Google",
16656
+ description: "We’ll do the hard work of publishing & continuously optimizing your ads on Google making sure you’re getting the best possible return on investment."
16657
+ },
16658
+ step3: {
16659
+ title: "See Customers & Results",
16660
+ description: "When a customer buys from you, we’ll notify you and show you the total revenue driven to your business from each dollar invested in ads. "
16661
+ }
16662
+ },
16663
+ ads_builder: {
16664
+ dialog_trigger: "New campaign",
16665
+ title: "Ads Wizard",
16666
+ description: "Create your new ad campaign",
16667
+ review_ad_themes: "Review Ad Themes",
16668
+ example_ad_preview: "Example Ad Preview",
16669
+ example_ad_preview_description: "Here's an example of how prospective customers might see your ads. We will automagically tweak the copy based on your products offered, and improve targeting based on what results in the most dollars to your business."
16670
+ }
16671
+ },
16672
+ analytics: {
16673
+ setup_analytics: "Setup analytics",
16674
+ setup_analytics_description: "Let's get you started with analytics. Connect your data sources to start tracking your customers.",
16675
+ connect_data: {
16676
+ title: "Connect Your Data",
16677
+ description: "We bring all of your ads data together to give you a clear view of which customers are coming in from where."
16678
+ },
16679
+ install_pixel: {
16680
+ copied_to_clipboard: "Copied to clipboard",
16681
+ copied_to_clipboard_description: "The tracking pixel code has been copied to your clipboard.",
16682
+ title: "Install our Tracking Pixel",
16683
+ description: "In order to get a complete picture of how users are interacting with your website, it’s important for the Reach analytics code to be on every page of your website and within as many third-party tools that you use as possible.",
16684
+ card_title: "Install the Snippet inside the <HEAD> of every page",
16685
+ third_party_pages_your_tracking_pixel: "Your Tracking Pixel:",
16686
+ card_description: "Copy this following text and insert it inside of the <HEAD> tags on all pages.",
16687
+ error_generating_pixel_code: "Error generating pixel code - please contact your administrator",
16688
+ third_party_pages_question: "Do you use any websites or landing pages for marketing your business?",
16689
+ third_party_pages_yes: "Yes, I have marketing websites",
16690
+ third_party_pages_no: "No, I don't use any websites",
16691
+ third_party_pages_why_asking: "Why We're Asking For This",
16692
+ third_party_pages_why_asking_description: "Adding our tracking pixel to your website allows us to:",
16693
+ third_party_pages_why_asking_list_1: "Understand how visitors interact with your pages",
16694
+ third_party_pages_why_asking_list_2: "Measure which ads are driving visitors to your site",
16695
+ third_party_pages_why_asking_list_3: "Track conversions from your campaigns",
16696
+ third_party_pages_enter_marketing_website: "Enter your marketing website:",
16697
+ third_party_pages_we_will_use_this_to_help_you_install_the_tracking_pixel: "We'll use this to help you install the tracking pixel",
16698
+ third_party_pages_select_your_website_platform: "Select your website platform:"
16699
+ },
16700
+ third_party_installation_guides: {
16701
+ title: "Installation Guides",
16702
+ description: "These guides will help you add the Reach analytics snippet to your website. The process works with any website builder or platform and most third-party tools.",
16703
+ installation_guide: "{{name}} Installation Guide",
16704
+ official_guide: "Official Guide",
16705
+ shopify: {
16706
+ step_1: "From your Shopify admin, go to Online Store > Themes",
16707
+ step_2: "Find the theme you want to edit, click the … button to open the actions menu, and then click Edit code",
16708
+ step_3: 'Open "theme.liquid"',
16709
+ step_4: "Find the </head> tag",
16710
+ step_5: "Paste the code snippet from the section above just before it"
16711
+ },
16712
+ google_tag_manager: {
16713
+ step_1: "Go to https://tagmanager.google.com",
16714
+ step_2: "Sign in to your Google Account",
16715
+ step_3: "Click the Accounts tab, then select Create Account",
16716
+ step_4: "Enter an account name and select your country location",
16717
+ step_5: "In Container Setup, enter a container name (e.g., your website URL)",
16718
+ step_6: 'Select "Web" as the container type',
16719
+ step_7: "Click Create and agree to the Terms of Service",
16720
+ step_8: "Once created, you'll receive two code snippets to install:",
16721
+ step_9: "• Place the first snippet in the <head> of your page",
16722
+ step_10: "• Place the second snippet immediately after the opening <body> tag",
16723
+ step_11: "In the Tags tab, click the + button to create a new tag",
16724
+ step_12: 'Select "Google Analytics: Universal Analytics" as the tag type',
16725
+ special_note: "Make sure you have the Google Tag Manager container code already installed on your site before adding this tag."
16726
+ },
16727
+ hubspot: {
16728
+ step_1: "Go to Settings → Content → Pages",
16729
+ step_2: 'In the upper left, select a domain to edit its settings. Or select "Default settings for all domains"',
16730
+ step_3: 'Paste the code from the section above to the "Site Header HTML" field',
16731
+ step_4: 'Click "Save"'
16732
+ },
16733
+ wordpress: {
16734
+ step_1: "We recommend using the popular WPCode Plugin",
16735
+ step_2: 'In the plugin, select "+ Add Snippet"',
16736
+ step_3: 'When presented with a menu of options, navigate to "Add Your Custom Code (New Snippet)" and select "Use snippet"',
16737
+ step_4: "Paste the code snippet from the section above",
16738
+ step_5: 'For Insert Method, choose "Auto Insert"',
16739
+ step_6: 'For Location, select "Site Wide Header"',
16740
+ step_7: "Be sure to save your snippet"
16741
+ },
16742
+ squarespace: {
16743
+ step_1: "Go to Settings → Advanced → Code Injection",
16744
+ step_2: 'Paste the code from the section above into the "Header" field',
16745
+ step_3: 'Click "Save"'
16746
+ },
16747
+ wix: {
16748
+ step_1: "Go to Settings → Custom Code",
16749
+ step_2: 'Click "+ Add Custom Code"',
16750
+ step_3: "Paste the code from the section above",
16751
+ step_4: 'Click "Apply"',
16752
+ step_5: 'Set "Add Code to Pages" to "All Pages"'
16753
+ },
16754
+ webflow: {
16755
+ step_1: "Open your project settings",
16756
+ step_2: 'Navigate to "Custom Code"',
16757
+ step_3: 'Paste the code from the section above into the "Head Code" section',
16758
+ step_4: 'Click "Save Changes"'
16759
+ },
16760
+ third_party_systems: {
16761
+ step_1: "Check if your third-party tools (lead forms, scheduling tools, etc.) allow custom code injection",
16762
+ step_2: 'Look for options labeled "Custom Code", "Embed Code", or "Advanced Settings"',
16763
+ step_3: "Paste the same tracking code into these sections where available",
16764
+ step_4: "Common locations include:",
16765
+ step_5: "• Head section of your website (for tracking scripts and styles)",
16766
+ step_6: "• Footer section of your website (for tracking scripts and styles)",
16767
+ special_note: "This helps ensure consistent tracking across all your customer touchpoints, even when using external tools."
16768
+ },
16769
+ custom: {
16770
+ step_1: "Locate your website's HTML template or main layout file",
16771
+ step_2: "Find the </head> tag in your HTML",
16772
+ step_3: "Paste the code snippet just before the </head> tag",
16773
+ step_4: "Save the file and deploy your changes"
16774
+ }
16775
+ },
16776
+ success: {
16777
+ title: "Success!",
16778
+ description: "You have successfully connected your data sources and installed our tracking pixel.",
16779
+ what_next: "What happens next?",
16780
+ step_1: "Your ad data will start syncing automatically",
16781
+ step_2: "The pixel will begin tracking conversions on your site",
16782
+ step_3: "You'll see your first analytics reports within 24 hours"
16783
+ }
16784
+ },
16785
+ dashboard: {
16786
+ banners: {
16787
+ metrics_crunching: {
16788
+ title: "Crunching your data",
16789
+ description: "You have successfully connected your ad accounts. We're now crunching your data. Check back soon for relevant metrics."
16790
+ },
16791
+ revoked_accounts: {
16792
+ title: "Your ad accounts have been revoked",
16793
+ description: "Please reconnect your ad accounts to continue using the dashboard."
16794
+ }
16795
+ },
16796
+ roas_chart: {
16797
+ title: "Ad Spend vs Revenue Over Time",
16798
+ campaign_not_available: "Chart is not available for individual campaigns yet"
16799
+ },
16800
+ customer_acquisition: {
16801
+ title: "Client Acquisition",
16802
+ description: "See how many new clients you acquired from each channel",
16803
+ client: "Client",
16804
+ source: "Source",
16805
+ total_spent: "Total Spent",
16806
+ total_revenue: "Total Revenue",
16807
+ status: "Status",
16808
+ no_data: "No data available",
16809
+ source_breakdown: "Source",
16810
+ payment_status: "Payment Status",
16811
+ paid: "Paid",
16812
+ unpaid: "Unpaid",
16813
+ invoice_details: "Invoice Details",
16814
+ amount: "Amount",
16815
+ service: "Service",
16816
+ invoice_date: "Invoice Date"
16817
+ },
16818
+ channel_performance: {
16819
+ title: "Channel Performance",
16820
+ description: "See how each channel performs",
16821
+ channel: "Channel",
16822
+ spend: "Spend",
16823
+ revenue: "Revenue",
16824
+ roas: "ROAS",
16825
+ new_customers: "New Customers"
16826
+ },
16827
+ traffic_conversion: {
16828
+ title: "Traffic Conversion Funnel"
16829
+ },
16830
+ tabs: {
16831
+ overview: "Overview",
16832
+ channel_performance: "Channel Performance",
16833
+ campaign_performance: "Campaign Performance",
16834
+ customer_acquisition: "Customer Acquisition",
16835
+ traffic_conversion: "Traffic Conversion"
16836
+ },
16837
+ metrics: {
16838
+ ads_spend: "Ads Spend",
16839
+ ads_spend_description: "The amount spent on ads in a given period. Sum of all sub-ads accounts (e.g. insta, google). Excluding agency fees",
16840
+ direct_measured_revenue: "Direct Measured Revenue",
16841
+ direct_measured_revenue_description: "The amount of revenue directly measured from ads",
16842
+ measured_revenue: "Measured Revenue",
16843
+ measured_revenue_description: "The amount of revenue measured from ads",
16844
+ direct_measured_conversions: "Direct Measured Conversions",
16845
+ direct_measured_conversions_description: "The amount of conversions directly measured from ads",
16846
+ measured_conversions: "Measured Conversions",
16847
+ measured_conversions_description: "The amount of conversions measured from ads",
16848
+ roas: "ROAS",
16849
+ roas_description: "This is the ratio of the revenue to the ads spend",
16850
+ impressions: "Impressions",
16851
+ impressions_description: "Number of times your ads were shown to potential customers",
16852
+ clicks: "Clicks/Actions",
16853
+ clicks_description: "Total interactions with your ads, including clicks and other actions",
16854
+ website_visitors: "Website Visitors",
16855
+ website_visitors_description: "Unique visitors to your website from advertising campaigns",
16856
+ new_leads: "New Leads",
16857
+ new_leads_description: "New potential customers who provided contact information",
16858
+ customer_ltv: "Customer LTV",
16859
+ customer_ltv_description: "Average lifetime value of customers acquired through ads",
16860
+ new_customers: "New Customers",
16861
+ new_customers_description: "New customers who made a purchase or took an action",
16862
+ new_leads_conversion_rate: "New Leads Conversion Rate",
16863
+ new_leads_conversion_rate_description: "The ratio of new leads to the total number of leads",
16864
+ new_customers_conversion_rate: "New Customers Conversion Rate",
16865
+ new_customers_conversion_rate_description: "The ratio of new customers to the total number of customers",
16866
+ cost_per_click: "Cost Per Click",
16867
+ cost_per_click_description: "The amount spent per click on your ads",
16868
+ click_conversion_rate: "Click Conversion Rate",
16869
+ click_conversion_rate_description: "The ratio of clicks to the total number of clicks",
16870
+ click_through_rate: "Click Through Rate",
16871
+ click_through_rate_description: "The ratio of clicks to the total number of impressions",
16872
+ conversion_rate: "Conversion Rate",
16873
+ conversion_rate_description: "The ratio of conversions to the total number of clicks",
16874
+ total_conversion: "Total Conversion",
16875
+ total_conversion_description: "The total number of conversions from your ads",
16876
+ cac: "CAC",
16877
+ cac_description: "The amount spent per customer acquisition",
16878
+ revenue_per_click: "Revenue Per Click",
16879
+ revenue_per_click_description: "The amount of revenue generated per click on your ads",
16880
+ revenue_per_new_customer: "Revenue Per New Customer",
16881
+ revenue_per_new_customer_description: "The amount of revenue generated per new customer",
16882
+ reengaged_customers: "Reengaged Customers",
16883
+ reengaged_customers_description: "The number of customers who have been reengaged with your ads",
16884
+ expected_revenue: "Expected Revenue",
16885
+ expected_revenue_description: "The amount of revenue you expect to generate from your ads",
16886
+ estimated_revenue: "Estimated Revenue",
16887
+ estimated_revenue_description: "The amount of revenue you expect to generate from your ads"
16888
+ },
16889
+ title: "Marketing Revenue Dashboard",
16890
+ settings_sheet: {
16891
+ setup: "Setup",
16892
+ connected_accounts: "Connected Accounts",
16893
+ setup_analytics: "Setup analytics",
16894
+ setup_analytics_description: "Configure your analytics tracking",
16895
+ setup_campaigns: "Setup campaigns",
16896
+ setup_campaigns_description: "Set up your first campaign",
16897
+ legal: "Legal",
16898
+ terms_of_service: "Terms of Service",
16899
+ privacy_policy: "Privacy Policy"
16900
+ }
16901
+ },
16902
+ setup: {
16903
+ how_it_works: {
16904
+ title: "How It Works",
16905
+ dialog_title: "Setup Marketing Insights",
16906
+ connect_ads_title: "Connect your Ads Accounts",
16907
+ connect_ads_description: "Link your advertising accounts from platforms like Google and Meta to consolidate all your campaign data in one place. This enables comprehensive tracking and analysis of your marketing spend.",
16908
+ install_pixel_title: "Install Our Tracking Pixel",
16909
+ install_pixel_description: "Add our lightweight tracking code to your website to accurately measure customer interactions and conversions. This simple integration helps identify which ads are driving real results for your business.",
16910
+ see_customers_results_title: "See Customers & Results",
16911
+ see_customers_results_description: "Get clear insights into your marketing performance with detailed analytics on customer acquisition, conversion rates, and return on ad spend. Make data-driven decisions to optimize your campaigns and grow your business.",
16912
+ still_have_more_questions: "Still have more questions?",
16913
+ get_started: "Get Started"
16914
+ },
16915
+ initial_setup: {
16916
+ wizard_title: "Connect your ad accounts and see exactly how your campaigns drive revenue",
16917
+ title: "Unlock Clear Insights into Your Marketing Performance",
16918
+ description: "Stop guessing and start knowing. Our performance dashboard gives you a complete view of your marketing efforts, including ad spend, conversions, and return on ad spend (ROAS).",
16919
+ description_2: "With a simple setup process, you’ll have actionable insights at your fingertips to help you make smarter decisions and grow your business.",
16920
+ setup_performance_analytics: "Setup Performance Analytics",
16921
+ next_steps_description: "If you're not running ads yet, you can launch your first AI-powered ad campaign in minutes.",
16922
+ next_steps_link: "We will prompt you to connect your ad accounts and set up your first campaign."
16923
+ }
16924
+ },
16925
+ oauth: {
16926
+ selectAccount: {
16927
+ title: "Select {{platform}} Account",
16928
+ description: "Choose the {{platform}} account you want to connect.",
16929
+ loading: "Loading accounts...",
16930
+ loadingPlatform: "Loading {{platform}} accounts...",
16931
+ loadingDescription: "Please wait while we fetch your available accounts...",
16932
+ noAccounts: "No {{platform}} accounts were found for your account.",
16933
+ noAccountsDescription: "Please make sure you have access to a {{platform}} account and try again.",
16934
+ selectAccountPlaceholder: "Select an account",
16935
+ searchPlaceholder: "Search accounts...",
16936
+ fetchAccounts: "Fetching accounts...",
16937
+ noAccountSelected: "No account selected",
16938
+ enableTrackingParams: "Enable Tracking Parameters",
16939
+ enableTrackingParamsDescription: "Append the reach campaign id parameter to your ad platform tracking settings. We will not overwrite any existing tracking parameters. Required for accurate tracking.",
16940
+ google: {
16941
+ selectAccountDescription: "Select the Google Ads account you want to connect to view your data. These will be linked to our MCC for optimal tracking.",
16942
+ mccAccounts: "MCC Accounts",
16943
+ directAccounts: "Direct Accounts"
16944
+ },
16945
+ meta: {
16946
+ selectAccountDescription: "Choose the Meta Ads account you want to connect to view your data."
16947
+ }
16948
+ },
16949
+ success: {
16950
+ connection: {
16951
+ title: "Connected successfully",
16952
+ description: "Your {{provider}} account has been connected."
16953
+ },
16954
+ revoke: {
16955
+ title: "Account revoked",
16956
+ description: "Your {{provider}} account has been revoked."
16957
+ }
16958
+ },
16959
+ error: {
16960
+ title: "Connection failed",
16961
+ description: "Failed to connect account"
16962
+ },
16963
+ revoke: {
16964
+ title: "Revoke access",
16965
+ description: "Are you sure? Revoking access will remove the connection you have and you will be unable to view your ad metrics.",
16966
+ cancel: "Cancel",
16967
+ revoke: "Revoke",
16968
+ error: {
16969
+ title: "Error",
16970
+ description: "Failed to revoke access"
16971
+ }
16972
+ }
16973
+ },
16974
+ magic_link: {
16975
+ get_started: "Get Started",
16976
+ description: "Reach will be embedded within your platform dashboard but until then, you can get started with a magic link. Log in to your account and start creating AI-powered campaigns or measuring your ad spend and performance.",
16977
+ create_campaigns: "Create AI-generated ad campaigns in minutes",
16978
+ unlock_insights: "Unlock insights into your ad spend and performance",
16979
+ save_time: "Save time with automated campaign optimization",
16980
+ request_new_magic_link: "Request New Magic Link",
16981
+ go_to_dashboard: "Go to Dashboard",
16982
+ continuation_disclaimer: "By continuing, you agree to our <terms_of_service>Terms of Service</terms_of_service> and <privacy_policy>Privacy Policy</privacy_policy>."
16983
+ },
16984
+ empty_state: {
16985
+ analytics: {
16986
+ title: "You haven't connected any ad accounts yet",
16987
+ description: "You can connect your ad accounts in minutes and start driving more customers to your business.",
16988
+ button_text: "Setup analytics"
16989
+ }
16990
+ }
16991
+ }
16992
+ };
16495
16993
  const I18nProvider = ({
16496
16994
  children: children2,
16497
16995
  initialLanguage
@@ -16517,6 +17015,30 @@ const ReachProvider = ({
16517
17015
  }
16518
17016
  return createQueryClient();
16519
17017
  });
17018
+ useEffect(() => {
17019
+ if (language?.overrides) {
17020
+ const createLanguageBundle = (namespace, lang) => {
17021
+ const overrides = language?.overrides?.[namespace]?.[lang];
17022
+ if (!overrides) return defaultTranslations.common;
17023
+ return {
17024
+ ...defaultTranslations.common,
17025
+ ...Object.entries(overrides).reduce(
17026
+ (acc, [key, value]) => ({
17027
+ ...acc,
17028
+ [key]: value
17029
+ }),
17030
+ {}
17031
+ )
17032
+ };
17033
+ };
17034
+ Object.keys(language.overrides).forEach((namespace) => {
17035
+ const enBundle = createLanguageBundle(namespace, "en");
17036
+ const esBundle = createLanguageBundle(namespace, "es");
17037
+ instance.addResourceBundle("en", namespace, enBundle, true, true);
17038
+ instance.addResourceBundle("es", namespace, esBundle, true, true);
17039
+ });
17040
+ }
17041
+ }, [language?.overrides]);
16520
17042
  return /* @__PURE__ */ jsx("div", { "data-reach-root": true, className: "h-full w-full", children: /* @__PURE__ */ jsxs(QueryClientProvider, { client: queryClient, children: [
16521
17043
  /* @__PURE__ */ jsx(
16522
17044
  D$1,
@@ -16538,7 +17060,7 @@ const ReachProvider = ({
16538
17060
  useCamelCaseFlagKeys: false,
16539
17061
  sendEventsOnFlagRead: true
16540
17062
  },
16541
- children: /* @__PURE__ */ jsx(I18nProvider, { initialLanguage: language, children: /* @__PURE__ */ jsx(Provider$1, { initialTheme: theme2, children: /* @__PURE__ */ jsxs(Provider$2, { children: [
17063
+ children: /* @__PURE__ */ jsx(I18nProvider, { initialLanguage: language?.default, children: /* @__PURE__ */ jsx(Provider$1, { initialTheme: theme2, children: /* @__PURE__ */ jsxs(Provider$2, { children: [
16542
17064
  children2,
16543
17065
  /* @__PURE__ */ jsx(Toaster, {})
16544
17066
  ] }) }) })
@@ -26403,12 +26925,12 @@ const BigSelector = ({ onClick, title: title2, subtitle, icon, selected, disable
26403
26925
  "button",
26404
26926
  {
26405
26927
  onClick,
26406
- className: `flex flex-col items-center justify-center rounded-lg border-[3px] p-4 transition-all duration-300 ease-in-out ${disabled ? "opacity-50 cursor-not-allowed" : selected ? "scale-[1.02] hover:scale-[1.04] [border-color:hsl(var(--reach-primary))] [background-color:hsl(var(--reach-primary)/0.05)]" : "border-gray-200 hover:[border-color:hsl(var(--reach-primary))] hover:bg-gray-50"}`,
26928
+ className: `flex flex-col items-center justify-center rounded-lg border-[3px] p-6 transition-all duration-300 ease-in-out ${disabled ? "opacity-50 cursor-not-allowed" : selected ? "scale-[1.02] hover:scale-[1.04] [border-color:hsl(var(--reach-primary))] [background-color:hsl(var(--reach-primary)/0.05)]" : "border-gray-200 hover:[border-color:hsl(var(--reach-primary))] hover:bg-gray-50"}`,
26407
26929
  children: [
26408
26930
  icon,
26409
- /* @__PURE__ */ jsxs("div", { className: "text-center", children: [
26931
+ /* @__PURE__ */ jsxs("div", { className: "text-center mt-3", children: [
26410
26932
  /* @__PURE__ */ jsx("div", { className: "text-sm font-medium text-gray-900", children: title2 }),
26411
- /* @__PURE__ */ jsx("div", { className: "text-xs text-gray-500", children: subtitle })
26933
+ /* @__PURE__ */ jsx("div", { className: "text-xs text-gray-500 mt-1", children: subtitle })
26412
26934
  ] })
26413
26935
  ]
26414
26936
  }
@@ -26709,7 +27231,7 @@ const CreateAutomationModal = ({
26709
27231
  return /* @__PURE__ */ jsx("div", { className: styles$3.container, children: /* @__PURE__ */ jsx(SpinLoader, { text: ["Creating Automation", "Finishing up"] }) });
26710
27232
  }
26711
27233
  return /* @__PURE__ */ jsxs("div", { className: "relative overflow-y-auto h-full p-8", children: [
26712
- /* @__PURE__ */ jsxs(AnimatePresence, { mode: "wait", children: [
27234
+ /* @__PURE__ */ jsxs(AnimatePresence, { children: [
26713
27235
  currentStep === CreateAutomationModalStep.ChooseAutomationType && /* @__PURE__ */ jsx(BlurDiv, { children: /* @__PURE__ */ jsx(
26714
27236
  ChooseAutomationType,
26715
27237
  {
@@ -27218,7 +27740,7 @@ function computeScore(path2, index2) {
27218
27740
  initialScore += indexRouteValue;
27219
27741
  }
27220
27742
  return segments.filter((s3) => !isSplat(s3)).reduce(
27221
- (score, segment) => score + (paramRe.test(segment) ? dynamicSegmentValue : segment === "" ? emptySegmentValue : staticSegmentValue),
27743
+ (score, segment2) => score + (paramRe.test(segment2) ? dynamicSegmentValue : segment2 === "" ? emptySegmentValue : staticSegmentValue),
27222
27744
  initialScore
27223
27745
  );
27224
27746
  }
@@ -27379,11 +27901,11 @@ function resolvePath(to, fromPathname = "/") {
27379
27901
  function resolvePathname(relativePath, fromPathname) {
27380
27902
  let segments = fromPathname.replace(/\/+$/, "").split("/");
27381
27903
  let relativeSegments = relativePath.split("/");
27382
- relativeSegments.forEach((segment) => {
27383
- if (segment === "..") {
27904
+ relativeSegments.forEach((segment2) => {
27905
+ if (segment2 === "..") {
27384
27906
  if (segments.length > 1) segments.pop();
27385
- } else if (segment !== ".") {
27386
- segments.push(segment);
27907
+ } else if (segment2 !== ".") {
27908
+ segments.push(segment2);
27387
27909
  }
27388
27910
  });
27389
27911
  return segments.length > 1 ? segments.join("/") : "/";
@@ -33907,8 +34429,8 @@ const AutomationTable = memo$1(
33907
34429
  title: "No Automations Found",
33908
34430
  description: "Create your first automation to get started."
33909
34431
  },
33910
- onRowClick: (automation) => {
33911
- onViewAutomation(automation.id);
34432
+ onRowClick: (automation2) => {
34433
+ onViewAutomation(automation2.id);
33912
34434
  },
33913
34435
  className: "rounded-lg bg-background"
33914
34436
  }
@@ -34099,6 +34621,16 @@ const updateSegment = async (params, segmentId) => {
34099
34621
  );
34100
34622
  return response.data;
34101
34623
  };
34624
+ const textToSegment = async (userInput) => {
34625
+ const response = await baseRequest(
34626
+ `${BUSINESS_SEGMENT_PATH}/text-to-segment`,
34627
+ {
34628
+ method: "POST",
34629
+ body: JSON.stringify({ text: userInput })
34630
+ }
34631
+ );
34632
+ return response.data;
34633
+ };
34102
34634
  var JSONSchemaType = /* @__PURE__ */ ((JSONSchemaType2) => {
34103
34635
  JSONSchemaType2["String"] = "string";
34104
34636
  JSONSchemaType2["Number"] = "number";
@@ -34121,6 +34653,8 @@ var ConditionOperatorEnumType = /* @__PURE__ */ ((ConditionOperatorEnumType2) =>
34121
34653
  ConditionOperatorEnumType2["GREATER_THAN"] = "greater_than";
34122
34654
  ConditionOperatorEnumType2["LESS_THAN"] = "less_than";
34123
34655
  ConditionOperatorEnumType2["EXISTS"] = "exists";
34656
+ ConditionOperatorEnumType2["EQUALS_MONTH_DAY"] = "equals_month_day";
34657
+ ConditionOperatorEnumType2["EQUALS_MONTH_DAY_YEAR"] = "equals_month_day_year";
34124
34658
  return ConditionOperatorEnumType2;
34125
34659
  })(ConditionOperatorEnumType || {});
34126
34660
  const useSegment = () => {
@@ -34241,7 +34775,9 @@ const operatorToHumanReadable = {
34241
34775
  [ConditionOperatorEnumType.NOT_EQUALS]: "Not Equals",
34242
34776
  [ConditionOperatorEnumType.GREATER_THAN]: "Greater Than",
34243
34777
  [ConditionOperatorEnumType.LESS_THAN]: "Less Than",
34244
- [ConditionOperatorEnumType.EXISTS]: "Exists"
34778
+ [ConditionOperatorEnumType.EXISTS]: "Exists",
34779
+ [ConditionOperatorEnumType.EQUALS_MONTH_DAY]: "Month and Day Matches",
34780
+ [ConditionOperatorEnumType.EQUALS_MONTH_DAY_YEAR]: "Month, Day, and Year Matches"
34245
34781
  };
34246
34782
  const buildInFieldToHumanReadable = {
34247
34783
  email: "Email",
@@ -35302,7 +35838,7 @@ const ComboboxSelect = ({
35302
35838
  Button$1,
35303
35839
  {
35304
35840
  "aria-expanded": open,
35305
- className: "w-[200px] justify-between",
35841
+ className: "w-[200px] overflow-hidden justify-between",
35306
35842
  variant: "outline",
35307
35843
  children: [
35308
35844
  value ? options.find((option) => option.value === value)?.label : placeholder,
@@ -41720,18 +42256,20 @@ var DateUnit = /* @__PURE__ */ ((DateUnit2) => {
41720
42256
  ConditionOperatorEnumType.EXISTS
41721
42257
  ],
41722
42258
  [JSONSchemaType.Date]: [
41723
- ConditionOperatorEnumType.EQUALS,
41724
- ConditionOperatorEnumType.NOT_EQUALS,
41725
42259
  ConditionOperatorEnumType.GREATER_THAN,
41726
42260
  ConditionOperatorEnumType.LESS_THAN,
41727
- ConditionOperatorEnumType.EXISTS
42261
+ ConditionOperatorEnumType.EXISTS,
42262
+ ConditionOperatorEnumType.EQUALS_MONTH_DAY,
42263
+ ConditionOperatorEnumType.EQUALS_MONTH_DAY_YEAR
41728
42264
  ],
41729
42265
  [JSONSchemaType.DateTime]: [
41730
42266
  ConditionOperatorEnumType.EQUALS,
41731
42267
  ConditionOperatorEnumType.NOT_EQUALS,
41732
42268
  ConditionOperatorEnumType.GREATER_THAN,
41733
42269
  ConditionOperatorEnumType.LESS_THAN,
41734
- ConditionOperatorEnumType.EXISTS
42270
+ ConditionOperatorEnumType.EXISTS,
42271
+ ConditionOperatorEnumType.EQUALS_MONTH_DAY,
42272
+ ConditionOperatorEnumType.EQUALS_MONTH_DAY_YEAR
41735
42273
  ],
41736
42274
  [JSONSchemaType.Integer]: [
41737
42275
  ConditionOperatorEnumType.EQUALS,
@@ -41811,7 +42349,7 @@ const ValueInput = ({
41811
42349
  }
41812
42350
  );
41813
42351
  React.useEffect(() => {
41814
- if (operator !== ConditionOperatorEnumType.EQUALS && isRelativeMode) {
42352
+ if (operator !== ConditionOperatorEnumType.EQUALS_MONTH_DAY && operator !== ConditionOperatorEnumType.EQUALS_MONTH_DAY_YEAR && isRelativeMode) {
41815
42353
  setIsRelativeMode(false);
41816
42354
  onChange(date2 ? [date2] : []);
41817
42355
  }
@@ -41871,7 +42409,7 @@ const ValueInput = ({
41871
42409
  );
41872
42410
  }
41873
42411
  if (fieldType === JSONSchemaType.Date || fieldType === JSONSchemaType.DateTime) {
41874
- const showRelativeDateOption = operator === ConditionOperatorEnumType.EQUALS;
42412
+ const showRelativeDateOption = operator === ConditionOperatorEnumType.EQUALS_MONTH_DAY || operator === ConditionOperatorEnumType.EQUALS_MONTH_DAY_YEAR;
41875
42413
  const handleRelativeDateChange = (newRelativeDate) => {
41876
42414
  if (validateRelativeDate(newRelativeDate)) {
41877
42415
  setRelativeDate(newRelativeDate);
@@ -42175,14 +42713,150 @@ const ConditionRow = ({
42175
42713
  ] })
42176
42714
  ] });
42177
42715
  };
42716
+ const PromptBuilderStyle = ({ onSelectStyle }) => {
42717
+ const [selectedStyle, setSelectedStyle] = useState(
42718
+ null
42719
+ );
42720
+ return /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4 p-4 max-w-4xl mx-auto", children: [
42721
+ /* @__PURE__ */ jsx(
42722
+ BigSelector,
42723
+ {
42724
+ onClick: () => {
42725
+ setSelectedStyle("ai");
42726
+ onSelectStyle("ai");
42727
+ },
42728
+ title: "Build with AI",
42729
+ subtitle: "Describe your audience in plain language and let AI create the conditions",
42730
+ icon: /* @__PURE__ */ jsx("div", { className: "h-12 w-12 rounded-full bg-primary/10 flex items-center justify-center", children: /* @__PURE__ */ jsx("div", { className: "w-6 h-6 text-[hsl(var(--reach-primary))]", children: /* @__PURE__ */ jsx(Sparkles, { className: "w-full h-full" }) }) }),
42731
+ selected: selectedStyle === "ai"
42732
+ }
42733
+ ),
42734
+ /* @__PURE__ */ jsx(
42735
+ BigSelector,
42736
+ {
42737
+ onClick: () => {
42738
+ setSelectedStyle("manual");
42739
+ onSelectStyle("manual");
42740
+ },
42741
+ title: "Build Manually",
42742
+ subtitle: `Create your ${t("engage:segment")} by configuring conditions directly`,
42743
+ icon: /* @__PURE__ */ jsx("div", { className: "h-12 w-12 rounded-full bg-primary/10 flex items-center justify-center", children: /* @__PURE__ */ jsx("div", { className: "w-6 h-6 text-[hsl(var(--reach-primary))]", children: /* @__PURE__ */ jsx(Settings2, { className: "w-full h-full" }) }) }),
42744
+ selected: selectedStyle === "manual"
42745
+ }
42746
+ )
42747
+ ] });
42748
+ };
42749
+ const SegmentBuilderHeader = ({
42750
+ segmentId,
42751
+ setOpen,
42752
+ setTextToSegment,
42753
+ promptBuilderStyle,
42754
+ textToSegment: textToSegment2
42755
+ }) => {
42756
+ return /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(DialogHeader, { className: "", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
42757
+ /* @__PURE__ */ jsx(DialogTitle, { className: "text-3xl font-normal", children: segmentId ? `Edit ${t("engage:segment")}` : `Create ${t("engage:segment")}` }),
42758
+ /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
42759
+ promptBuilderStyle === false && textToSegment2 === false && /* @__PURE__ */ jsx(TooltipProvider, { children: /* @__PURE__ */ jsxs(Tooltip, { children: [
42760
+ /* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsx(
42761
+ Button$1,
42762
+ {
42763
+ variant: "outline",
42764
+ size: "sm",
42765
+ onClick: () => setTextToSegment(true),
42766
+ children: /* @__PURE__ */ jsx(Sparkles, { className: "h-4 w-3" })
42767
+ }
42768
+ ) }),
42769
+ /* @__PURE__ */ jsx(TooltipContent, { children: /* @__PURE__ */ jsxs("p", { children: [
42770
+ "Use AI to create ",
42771
+ t("engage:segment"),
42772
+ " by describing them in natural language"
42773
+ ] }) })
42774
+ ] }) }),
42775
+ /* @__PURE__ */ jsx(
42776
+ Button$1,
42777
+ {
42778
+ variant: "ghost",
42779
+ size: "icon",
42780
+ onClick: () => setOpen(false),
42781
+ className: "h-8 w-8",
42782
+ children: /* @__PURE__ */ jsx(X$1, { className: "h-4 w-4" })
42783
+ }
42784
+ )
42785
+ ] })
42786
+ ] }) }) });
42787
+ };
42788
+ const BasicLoader = () => {
42789
+ return /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center @container", children: /* @__PURE__ */ jsxs("div", { className: "relative h-8 w-8", children: [
42790
+ /* @__PURE__ */ jsx("div", { className: "absolute inset-0 rounded-full border-2 border-primary/20" }),
42791
+ /* @__PURE__ */ jsx("div", { className: "absolute inset-0 animate-spin rounded-full border-2 border-primary border-t-transparent" })
42792
+ ] }) });
42793
+ };
42794
+ const TextToSegment = ({ setTextToSegment, setSegment }) => {
42795
+ const [userInput, setUserInput] = React__default.useState("");
42796
+ const [isLoading, setIsLoading] = React__default.useState(false);
42797
+ const { toast: toast2 } = useToast();
42798
+ const getSegment2 = async () => {
42799
+ if (!userInput) {
42800
+ toast2({
42801
+ title: "Please enter a description",
42802
+ description: "Please enter a description of your target audience",
42803
+ variant: "destructive"
42804
+ });
42805
+ return;
42806
+ }
42807
+ setIsLoading(true);
42808
+ const response = await textToSegment(userInput);
42809
+ if (response.success && response.conditions) {
42810
+ toast2({
42811
+ title: `${t("engage:segment")} conditions built successfully 🚀`,
42812
+ description: `Your ${t("engage:segment")} conditions have been built successfully`
42813
+ });
42814
+ setSegment(response.conditions);
42815
+ } else {
42816
+ toast2({
42817
+ title: `${t("engage:segment")} build failed`,
42818
+ description: "Please try again",
42819
+ variant: "destructive"
42820
+ });
42821
+ }
42822
+ setTextToSegment(false);
42823
+ setIsLoading(false);
42824
+ };
42825
+ return /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-6 p-4", children: [
42826
+ /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
42827
+ /* @__PURE__ */ jsx("h3", { className: "text-lg font-semibold text-foreground", children: "Describe your audience" }),
42828
+ /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: "Describe the audience you want to target in plain language, and our AI will create the conditions for you." })
42829
+ ] }),
42830
+ /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
42831
+ /* @__PURE__ */ jsxs(AnimatePresence, { children: [
42832
+ isLoading && /* @__PURE__ */ jsx(BlurDiv, { children: /* @__PURE__ */ jsx(BasicLoader, {}) }),
42833
+ !isLoading && /* @__PURE__ */ jsx(BlurDiv, { children: /* @__PURE__ */ jsx(
42834
+ Textarea,
42835
+ {
42836
+ placeholder: "Describe your target audience...",
42837
+ className: "min-h-[120px] resize-none",
42838
+ value: userInput,
42839
+ onChange: (e4) => setUserInput(e4.target.value)
42840
+ }
42841
+ ) })
42842
+ ] }),
42843
+ /* @__PURE__ */ jsx("div", { className: "flex justify-end gap-2", children: /* @__PURE__ */ jsxs(Button$1, { onClick: getSegment2, children: [
42844
+ /* @__PURE__ */ jsx(Sparkles, { className: "h-4 w-4" }),
42845
+ "Generate ",
42846
+ t("engage:segment")
42847
+ ] }) })
42848
+ ] })
42849
+ ] });
42850
+ };
42178
42851
  function SegmentBuilder({
42179
42852
  segmentId,
42180
42853
  setOpen,
42181
42854
  onSegmentUpdated
42182
42855
  }) {
42183
42856
  const { toast: toast2 } = useToast();
42857
+ const newSegment = segmentId === void 0;
42184
42858
  const [isLoading, setIsLoading] = React.useState(false);
42185
- const [segment, setSegment] = React.useState({
42859
+ const [segment2, setSegment] = React.useState({
42186
42860
  version: "1.0",
42187
42861
  id: "",
42188
42862
  name: "",
@@ -42193,6 +42867,10 @@ function SegmentBuilder({
42193
42867
  const { segment: existingSegment, isLoading: isLoadingSegment } = useGetSegment(segmentId || "");
42194
42868
  const { updateSegment: updateSegment2 } = useUpdateSegment(segmentId);
42195
42869
  const { createSegment: createSegment2, isCreating, segmentsConditions } = useSegment();
42870
+ const [textToSegment2, setTextToSegment] = React.useState(false);
42871
+ const [promptBuilderStyle, setPromptBuilderStyle] = React.useState(
42872
+ newSegment ? true : false
42873
+ );
42196
42874
  React.useEffect(() => {
42197
42875
  if (!segmentsConditions) {
42198
42876
  return;
@@ -42227,18 +42905,18 @@ function SegmentBuilder({
42227
42905
  }
42228
42906
  }, [existingSegment, segmentsConditions]);
42229
42907
  const updateCondition = (index2, condition) => {
42230
- const newConditions = [...segment.conditions];
42908
+ const newConditions = [...segment2.conditions];
42231
42909
  newConditions[index2] = condition;
42232
- setSegment({ ...segment, conditions: newConditions });
42910
+ setSegment({ ...segment2, conditions: newConditions });
42233
42911
  };
42234
42912
  const duplicateCondition = (index2) => {
42235
- const newConditions = [...segment.conditions];
42236
- newConditions.splice(index2 + 1, 0, { ...segment.conditions[index2] });
42237
- setSegment({ ...segment, conditions: newConditions });
42913
+ const newConditions = [...segment2.conditions];
42914
+ newConditions.splice(index2 + 1, 0, { ...segment2.conditions[index2] });
42915
+ setSegment({ ...segment2, conditions: newConditions });
42238
42916
  };
42239
42917
  const deleteCondition = (index2) => {
42240
- const newConditions = segment.conditions.filter((_2, i3) => i3 !== index2);
42241
- setSegment({ ...segment, conditions: newConditions });
42918
+ const newConditions = segment2.conditions.filter((_2, i3) => i3 !== index2);
42919
+ setSegment({ ...segment2, conditions: newConditions });
42242
42920
  };
42243
42921
  const hasRelativeDate = (condition) => {
42244
42922
  return condition.value.some(
@@ -42265,10 +42943,10 @@ function SegmentBuilder({
42265
42943
  error: "EXISTS operator can only be used with an empty array"
42266
42944
  };
42267
42945
  }
42268
- if (hasRelativeDate(condition) && condition.operator !== ConditionOperatorEnumType.EQUALS) {
42946
+ if (hasRelativeDate(condition) && condition.operator !== ConditionOperatorEnumType.EQUALS_MONTH_DAY && condition.operator !== ConditionOperatorEnumType.EQUALS_MONTH_DAY_YEAR) {
42269
42947
  return {
42270
42948
  valid: false,
42271
- error: "Relative dates can only be used with the EQUALS operator"
42949
+ error: "Relative dates can only be used with the month and day or month, day, and year operator"
42272
42950
  };
42273
42951
  }
42274
42952
  }
@@ -42278,7 +42956,7 @@ function SegmentBuilder({
42278
42956
  };
42279
42957
  };
42280
42958
  const handleSave = async () => {
42281
- if (!segment.name || !segment.description) {
42959
+ if (!segment2.name || !segment2.description) {
42282
42960
  toast2({
42283
42961
  title: "Name and description are required",
42284
42962
  description: "Please ensure all fields are filled out",
@@ -42286,7 +42964,7 @@ function SegmentBuilder({
42286
42964
  });
42287
42965
  return;
42288
42966
  }
42289
- const { valid, error: error2 } = validationConditions(segment.conditions);
42967
+ const { valid, error: error2 } = validationConditions(segment2.conditions);
42290
42968
  if (!valid) {
42291
42969
  toast2({
42292
42970
  title: "Conditions are invalid",
@@ -42300,9 +42978,9 @@ function SegmentBuilder({
42300
42978
  if (segmentId && existingSegment) {
42301
42979
  updateSegment2(
42302
42980
  {
42303
- name: segment.name,
42304
- description: segment.description,
42305
- conditions: segment.conditions
42981
+ name: segment2.name,
42982
+ description: segment2.description,
42983
+ conditions: segment2.conditions
42306
42984
  },
42307
42985
  {
42308
42986
  onSuccess: () => {
@@ -42310,7 +42988,7 @@ function SegmentBuilder({
42310
42988
  title: "Segment updated successfully"
42311
42989
  });
42312
42990
  setOpen(false);
42313
- onSegmentUpdated?.(segment.id);
42991
+ onSegmentUpdated?.(segment2.id);
42314
42992
  },
42315
42993
  onError: () => {
42316
42994
  toast2({
@@ -42325,9 +43003,9 @@ function SegmentBuilder({
42325
43003
  } else {
42326
43004
  createSegment2(
42327
43005
  {
42328
- name: segment.name,
42329
- description: segment.description,
42330
- conditions: segment.conditions
43006
+ name: segment2.name,
43007
+ description: segment2.description,
43008
+ conditions: segment2.conditions
42331
43009
  },
42332
43010
  {
42333
43011
  onSuccess: () => {
@@ -42335,7 +43013,7 @@ function SegmentBuilder({
42335
43013
  title: "Segment created successfully"
42336
43014
  });
42337
43015
  setOpen(false);
42338
- onSegmentUpdated?.(segment.id);
43016
+ onSegmentUpdated?.(segment2.id);
42339
43017
  },
42340
43018
  onError: () => {
42341
43019
  toast2({
@@ -42364,9 +43042,9 @@ function SegmentBuilder({
42364
43042
  }
42365
43043
  const addCondition = () => {
42366
43044
  setSegment({
42367
- ...segment,
43045
+ ...segment2,
42368
43046
  conditions: [
42369
- ...segment.conditions,
43047
+ ...segment2.conditions,
42370
43048
  {
42371
43049
  field: segmentsConditions.conditions[0].field,
42372
43050
  operator: segmentsConditions.conditions[0].operators[0],
@@ -42375,131 +43053,163 @@ function SegmentBuilder({
42375
43053
  ]
42376
43054
  });
42377
43055
  };
42378
- return /* @__PURE__ */ jsxs("div", { className: "flex flex-1 flex-col overflow-hidden", children: [
42379
- /* @__PURE__ */ jsx("div", { className: "flex flex-1 flex-col overflow-hidden px-8 py-2", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-1 flex-col gap-4 overflow-visible", children: [
42380
- /* @__PURE__ */ jsxs("div", { className: "mb-6 grid grid-cols-2 gap-2", children: [
42381
- /* @__PURE__ */ jsxs("div", { className: "grid gap-2", children: [
42382
- /* @__PURE__ */ jsx(Label$2, { className: "text-muted-foreground text-xs", children: "Name" }),
42383
- /* @__PURE__ */ jsx(
42384
- Input,
42385
- {
42386
- placeholder: "Segment name",
42387
- value: segment.name,
42388
- onChange: (e4) => setSegment({ ...segment, name: e4.target.value })
42389
- }
42390
- )
42391
- ] }),
42392
- /* @__PURE__ */ jsxs("div", { className: "grid gap-2", children: [
42393
- /* @__PURE__ */ jsx(Label$2, { className: "text-muted-foreground text-xs", children: "Description" }),
42394
- /* @__PURE__ */ jsx(
42395
- Input,
42396
- {
42397
- placeholder: "Segment description",
42398
- value: segment.description,
42399
- onChange: (e4) => setSegment({ ...segment, description: e4.target.value })
42400
- }
42401
- )
42402
- ] })
42403
- ] }),
42404
- segment.conditions.length > 0 && /* @__PURE__ */ jsx("div", { className: "flex-1 overflow-y-auto pb-8", children: /* @__PURE__ */ jsx("div", { className: "grid", children: /* @__PURE__ */ jsx(AnimatePresence, { mode: "popLayout", children: segment.conditions.map((condition, index2) => /* @__PURE__ */ jsxs(
42405
- motion.div,
43056
+ return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(AnimatePresence, { children: [
43057
+ /* @__PURE__ */ jsx(
43058
+ SegmentBuilderHeader,
43059
+ {
43060
+ segmentId,
43061
+ setOpen,
43062
+ setTextToSegment,
43063
+ promptBuilderStyle,
43064
+ textToSegment: textToSegment2
43065
+ },
43066
+ "segment-builder-header"
43067
+ ),
43068
+ promptBuilderStyle ? /* @__PURE__ */ jsx(BlurDiv, { children: /* @__PURE__ */ jsx(
43069
+ PromptBuilderStyle,
43070
+ {
43071
+ onSelectStyle: (style2) => {
43072
+ if (style2 === "ai") {
43073
+ setTextToSegment(true);
43074
+ }
43075
+ setPromptBuilderStyle(false);
43076
+ }
43077
+ }
43078
+ ) }, "prompt-builder-style") : /* @__PURE__ */ jsx(BlurDiv, { children: /* @__PURE__ */ jsxs("div", { className: "flex flex-1 flex-col overflow-hidden", children: [
43079
+ /* @__PURE__ */ jsx("div", { className: "flex flex-1 flex-col overflow-hidden px-8 py-2", children: /* @__PURE__ */ jsx("div", { className: "flex flex-1 flex-col gap-4 overflow-visible", children: /* @__PURE__ */ jsx(AnimatePresence, { children: textToSegment2 ? /* @__PURE__ */ jsx(BlurDiv, { children: /* @__PURE__ */ jsx(
43080
+ TextToSegment,
42406
43081
  {
42407
- initial: { opacity: 0, x: -20 },
42408
- animate: { opacity: 1, x: 0 },
42409
- exit: { opacity: 0, x: 20 },
42410
- transition: {
42411
- type: "spring",
42412
- stiffness: 300,
42413
- damping: 30,
42414
- mass: 0.5
42415
- },
42416
- children: [
42417
- index2 > 0 && /* @__PURE__ */ jsxs(
42418
- motion.div,
43082
+ setTextToSegment,
43083
+ setSegment: (conditions) => setSegment({ ...segment2, conditions })
43084
+ }
43085
+ ) }) : /* @__PURE__ */ jsxs(BlurDiv, { children: [
43086
+ /* @__PURE__ */ jsxs("div", { className: "mb-6 grid grid-cols-2 gap-2", children: [
43087
+ /* @__PURE__ */ jsxs("div", { className: "grid gap-2", children: [
43088
+ /* @__PURE__ */ jsx(Label$2, { className: "text-muted-foreground text-xs", children: "Name" }),
43089
+ /* @__PURE__ */ jsx(
43090
+ Input,
42419
43091
  {
42420
- className: "relative flex items-center gap-3 py-1",
42421
- initial: { opacity: 0 },
42422
- animate: { opacity: 1 },
42423
- transition: { delay: 0.1 },
42424
- children: [
42425
- /* @__PURE__ */ jsx(
42426
- motion.div,
42427
- {
42428
- className: "h-px flex-1 bg-border",
42429
- initial: { scaleX: 0 },
42430
- animate: { scaleX: 1 },
42431
- transition: {
42432
- type: "spring",
42433
- stiffness: 300,
42434
- damping: 30,
42435
- mass: 0.5
42436
- }
42437
- }
42438
- ),
42439
- /* @__PURE__ */ jsx(
42440
- motion.span,
42441
- {
42442
- className: "text-muted-foreground text-xs",
42443
- initial: { opacity: 0 },
42444
- animate: { opacity: 1 },
42445
- transition: { delay: 0.2 },
42446
- children: "AND"
42447
- }
42448
- ),
42449
- /* @__PURE__ */ jsx(
42450
- motion.div,
42451
- {
42452
- className: "h-px flex-1 bg-border",
42453
- initial: { scaleX: 0 },
42454
- animate: { scaleX: 1 },
42455
- transition: {
42456
- type: "spring",
42457
- stiffness: 300,
42458
- damping: 30,
42459
- mass: 0.5
42460
- }
42461
- }
42462
- )
42463
- ]
43092
+ placeholder: `${t("engage:segment")} name`,
43093
+ value: segment2.name,
43094
+ onChange: (e4) => setSegment({ ...segment2, name: e4.target.value })
42464
43095
  }
42465
- ),
43096
+ )
43097
+ ] }),
43098
+ /* @__PURE__ */ jsxs("div", { className: "grid gap-2", children: [
43099
+ /* @__PURE__ */ jsx(Label$2, { className: "text-muted-foreground text-xs", children: "Description" }),
42466
43100
  /* @__PURE__ */ jsx(
42467
- ConditionRow,
43101
+ Input,
42468
43102
  {
42469
- condition,
42470
- onUpdate: (condition2) => updateCondition(index2, condition2),
42471
- segmentsConditions,
42472
- onDuplicate: () => duplicateCondition(index2),
42473
- onDelete: () => deleteCondition(index2)
43103
+ placeholder: `${t("engage:segment")} description`,
43104
+ value: segment2.description,
43105
+ onChange: (e4) => setSegment({
43106
+ ...segment2,
43107
+ description: e4.target.value
43108
+ })
42474
43109
  }
42475
43110
  )
42476
- ]
42477
- },
42478
- index2
42479
- )) }) }) })
42480
- ] }) }),
42481
- /* @__PURE__ */ jsx("div", { className: "border-t px-8 py-4", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
42482
- /* @__PURE__ */ jsxs(Button$1, { variant: "secondary", onClick: addCondition, children: [
42483
- /* @__PURE__ */ jsx(Plus, { className: "h-4 w-4" }),
42484
- "Add Condition"
42485
- ] }),
42486
- /* @__PURE__ */ jsxs("div", { className: "flex gap-2", children: [
42487
- /* @__PURE__ */ jsx(Button$1, { variant: "secondary", onClick: () => setOpen(false), children: "Cancel" }),
42488
- /* @__PURE__ */ jsx(
42489
- Button$1,
43111
+ ] })
43112
+ ] }),
43113
+ segment2.conditions.length > 0 && /* @__PURE__ */ jsx("div", { className: "flex-1 overflow-y-auto pb-8", children: /* @__PURE__ */ jsx("div", { className: "grid", children: /* @__PURE__ */ jsx(AnimatePresence, { mode: "popLayout", children: segment2.conditions.map((condition, index2) => /* @__PURE__ */ jsxs(
43114
+ motion.div,
42490
43115
  {
42491
- variant: "secondary",
42492
- onClick: handleSave,
42493
- disabled: isLoading || isCreating,
42494
- children: isLoading || isCreating ? /* @__PURE__ */ jsxs(Fragment, { children: [
42495
- /* @__PURE__ */ jsx(LoaderCircle, { className: "mr-2 h-4 w-4 animate-spin" }),
42496
- segmentId ? "Updating..." : "Creating..."
42497
- ] }) : segmentId ? "Update" : "Create"
42498
- }
42499
- )
42500
- ] })
42501
- ] }) })
42502
- ] });
43116
+ initial: { opacity: 0, x: -20 },
43117
+ animate: { opacity: 1, x: 0 },
43118
+ exit: { opacity: 0, x: 20 },
43119
+ transition: {
43120
+ type: "spring",
43121
+ stiffness: 300,
43122
+ damping: 30,
43123
+ mass: 0.5
43124
+ },
43125
+ children: [
43126
+ index2 > 0 && /* @__PURE__ */ jsxs(
43127
+ motion.div,
43128
+ {
43129
+ className: "relative flex items-center gap-3 py-1",
43130
+ initial: { opacity: 0 },
43131
+ animate: { opacity: 1 },
43132
+ transition: { delay: 0.1 },
43133
+ children: [
43134
+ /* @__PURE__ */ jsx(
43135
+ motion.div,
43136
+ {
43137
+ className: "h-px flex-1 bg-border",
43138
+ initial: { scaleX: 0 },
43139
+ animate: { scaleX: 1 },
43140
+ transition: {
43141
+ type: "spring",
43142
+ stiffness: 300,
43143
+ damping: 30,
43144
+ mass: 0.5
43145
+ }
43146
+ }
43147
+ ),
43148
+ /* @__PURE__ */ jsx(
43149
+ motion.span,
43150
+ {
43151
+ className: "text-muted-foreground text-xs",
43152
+ initial: { opacity: 0 },
43153
+ animate: { opacity: 1 },
43154
+ transition: { delay: 0.2 },
43155
+ children: "AND"
43156
+ }
43157
+ ),
43158
+ /* @__PURE__ */ jsx(
43159
+ motion.div,
43160
+ {
43161
+ className: "h-px flex-1 bg-border",
43162
+ initial: { scaleX: 0 },
43163
+ animate: { scaleX: 1 },
43164
+ transition: {
43165
+ type: "spring",
43166
+ stiffness: 300,
43167
+ damping: 30,
43168
+ mass: 0.5
43169
+ }
43170
+ }
43171
+ )
43172
+ ]
43173
+ }
43174
+ ),
43175
+ /* @__PURE__ */ jsx(
43176
+ ConditionRow,
43177
+ {
43178
+ condition,
43179
+ onUpdate: (condition2) => updateCondition(index2, condition2),
43180
+ segmentsConditions,
43181
+ onDuplicate: () => duplicateCondition(index2),
43182
+ onDelete: () => deleteCondition(index2)
43183
+ }
43184
+ )
43185
+ ]
43186
+ },
43187
+ index2
43188
+ )) }) }) })
43189
+ ] }) }) }) }),
43190
+ /* @__PURE__ */ jsx("div", { className: "border-t px-8 py-4", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
43191
+ /* @__PURE__ */ jsxs(Button$1, { variant: "secondary", onClick: addCondition, children: [
43192
+ /* @__PURE__ */ jsx(Plus, { className: "h-4 w-4" }),
43193
+ "Add Condition"
43194
+ ] }),
43195
+ /* @__PURE__ */ jsxs("div", { className: "flex gap-2", children: [
43196
+ /* @__PURE__ */ jsx(Button$1, { variant: "secondary", onClick: () => setOpen(false), children: "Cancel" }),
43197
+ /* @__PURE__ */ jsx(
43198
+ Button$1,
43199
+ {
43200
+ variant: "secondary",
43201
+ onClick: handleSave,
43202
+ disabled: isLoading || isCreating,
43203
+ children: isLoading || isCreating ? /* @__PURE__ */ jsxs(Fragment, { children: [
43204
+ /* @__PURE__ */ jsx(LoaderCircle, { className: "mr-2 h-4 w-4 animate-spin" }),
43205
+ segmentId ? "Updating..." : "Creating..."
43206
+ ] }) : segmentId ? "Update" : "Create"
43207
+ }
43208
+ )
43209
+ ] })
43210
+ ] }) })
43211
+ ] }) }, "manual-builder-style")
43212
+ ] }) });
42503
43213
  }
42504
43214
  function SegmentBuilderDialog({
42505
43215
  open,
@@ -42517,20 +43227,17 @@ function SegmentBuilderDialog({
42517
43227
  className: "flex max-h-[86vh] flex-col gap-0 overflow-visible max-w-5xl w-full",
42518
43228
  hideCloseButton: true,
42519
43229
  children: [
42520
- /* @__PURE__ */ jsx(DialogHeader, { className: "", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
42521
- /* @__PURE__ */ jsx(DialogTitle, { className: "text-3xl font-normal", children: segmentId ? "Edit Segment" : "Create Segment" }),
42522
- /* @__PURE__ */ jsx(VisuallyHidden$1, { children: /* @__PURE__ */ jsx(DialogDescription, { children: segmentId ? "Edit Segment" : "Create Segment" }) }),
42523
- /* @__PURE__ */ jsx(
42524
- Button$1,
42525
- {
42526
- variant: "ghost",
42527
- size: "icon",
42528
- onClick: () => setOpen(false),
42529
- className: "h-8 w-8",
42530
- children: /* @__PURE__ */ jsx(X$1, { className: "h-4 w-4" })
42531
- }
42532
- )
42533
- ] }) }),
43230
+ /* @__PURE__ */ jsxs(VisuallyHidden$1, { children: [
43231
+ /* @__PURE__ */ jsxs(DialogTitle, { children: [
43232
+ t("engage:segment"),
43233
+ " Builder"
43234
+ ] }),
43235
+ /* @__PURE__ */ jsxs(DialogDescription, { children: [
43236
+ "Build a ",
43237
+ t("engage:segment"),
43238
+ " to target your audience"
43239
+ ] })
43240
+ ] }),
42534
43241
  /* @__PURE__ */ jsx(
42535
43242
  SegmentBuilder,
42536
43243
  {
@@ -42592,7 +43299,8 @@ const AllSegmentList = () => {
42592
43299
  onClick: () => setCreateNewSegmentDialogOpen(true),
42593
43300
  children: [
42594
43301
  /* @__PURE__ */ jsx(Plus, {}),
42595
- "Create New Segment"
43302
+ "Create New ",
43303
+ t("engage:segment")
42596
43304
  ]
42597
43305
  }
42598
43306
  ) })
@@ -42649,8 +43357,8 @@ const AllSegmentList = () => {
42649
43357
  title: "No Segments Found",
42650
43358
  description: "Create your first segment to get started."
42651
43359
  },
42652
- onRowClick: (segment) => {
42653
- if (segment.type !== BusinessSegmentTypeEnum.CUSTOM) {
43360
+ onRowClick: (segment2) => {
43361
+ if (segment2.type !== BusinessSegmentTypeEnum.CUSTOM) {
42654
43362
  toast2({
42655
43363
  title: "This segment is not editable",
42656
43364
  description: "Only custom segments can be edited",
@@ -42658,7 +43366,7 @@ const AllSegmentList = () => {
42658
43366
  });
42659
43367
  return;
42660
43368
  }
42661
- setSelectedSegment(segment.id);
43369
+ setSelectedSegment(segment2.id);
42662
43370
  setCreateNewSegmentDialogOpen(true);
42663
43371
  },
42664
43372
  className: "rounded-lg bg-white"
@@ -42680,7 +43388,7 @@ const EngageMain = ({
42680
43388
  const tabs = [
42681
43389
  {
42682
43390
  id: "automations",
42683
- label: "Automations",
43391
+ label: `${t("engage:automation", { count: 2 })}`,
42684
43392
  content: /* @__PURE__ */ jsx(
42685
43393
  AllAutomationList,
42686
43394
  {
@@ -42691,7 +43399,7 @@ const EngageMain = ({
42691
43399
  },
42692
43400
  {
42693
43401
  id: "segments",
42694
- label: "Segments",
43402
+ label: `${t("engage:segment", { count: 2 })}`,
42695
43403
  content: /* @__PURE__ */ jsx(AllSegmentList, {})
42696
43404
  }
42697
43405
  ];
@@ -42778,7 +43486,7 @@ var AutomationSteps = /* @__PURE__ */ ((AutomationSteps2) => {
42778
43486
  return AutomationSteps2;
42779
43487
  })(AutomationSteps || {});
42780
43488
  const validateAutomationStep = async (args) => {
42781
- const { currentStep, automation, communicationGroup } = args;
43489
+ const { currentStep, automation: automation2, communicationGroup } = args;
42782
43490
  if (currentStep === 0) {
42783
43491
  return {
42784
43492
  canMove: true,
@@ -42787,12 +43495,12 @@ const validateAutomationStep = async (args) => {
42787
43495
  }
42788
43496
  if (currentStep === 1) {
42789
43497
  return {
42790
- canMove: automation.includeSegmentIds.length > 0,
43498
+ canMove: automation2.includeSegmentIds.length > 0,
42791
43499
  errorMessage: "Please ensure you have selected at least one segment"
42792
43500
  };
42793
43501
  }
42794
43502
  if (currentStep === 2) {
42795
- const actionDataCommunication = automation.action_data?.find(
43503
+ const actionDataCommunication = automation2.action_data?.find(
42796
43504
  (action) => action.action_type === "send_communication"
42797
43505
  );
42798
43506
  if (!actionDataCommunication) {
@@ -42827,7 +43535,7 @@ const validateAutomationStep = async (args) => {
42827
43535
  if (currentStep === 3) {
42828
43536
  return {
42829
43537
  canMove: Boolean(
42830
- isOneTimeTriggerMetadata(automation.trigger_metadata) && automation.trigger_metadata.scheduled_at && new Date(automation.trigger_metadata.scheduled_at) > /* @__PURE__ */ new Date() && automation.action_data?.some(
43538
+ isOneTimeTriggerMetadata(automation2.trigger_metadata) && automation2.trigger_metadata.scheduled_at && new Date(automation2.trigger_metadata.scheduled_at) > /* @__PURE__ */ new Date() && automation2.action_data?.some(
42831
43539
  (action) => action.action_type === "send_communication" && action.action_metadata.communication_group_id
42832
43540
  )
42833
43541
  ),
@@ -42839,17 +43547,17 @@ const validateAutomationStep = async (args) => {
42839
43547
  errorMessage: null
42840
43548
  };
42841
43549
  };
42842
- const useRecipientStats = (automation) => {
43550
+ const useRecipientStats = (automation2) => {
42843
43551
  const { data: estimatedMatches } = useGetCountOfBusinessAutomationRecipients({
42844
- include_segments: automation?.includeSegmentIds ?? [],
42845
- exclude_segments: automation?.excludeSegmentIds ?? []
43552
+ include_segments: automation2?.includeSegmentIds ?? [],
43553
+ exclude_segments: automation2?.excludeSegmentIds ?? []
42846
43554
  });
42847
43555
  const estimatedMatchesStats = useMemo(() => {
42848
43556
  if (!estimatedMatches?.recipients) return { emails: 0, phones: 0 };
42849
43557
  return estimatedMatches.recipients.reduce(
42850
- (acc, user) => ({
42851
- emails: acc.emails + (user.email ? 1 : 0),
42852
- phones: acc.phones + (user.phone ? 1 : 0)
43558
+ (acc, user2) => ({
43559
+ emails: acc.emails + (user2.email ? 1 : 0),
43560
+ phones: acc.phones + (user2.phone ? 1 : 0)
42853
43561
  }),
42854
43562
  { emails: 0, phones: 0 }
42855
43563
  );
@@ -42867,14 +43575,14 @@ const useAutomation = (automationId, existingAutomation) => {
42867
43575
  isLoading: isFetchLoading,
42868
43576
  invalidateAutomation: originalInvalidateAutomation
42869
43577
  } = useGetBusinessAutomation(automationId);
42870
- const automation = fetchedAutomation;
43578
+ const automation2 = fetchedAutomation;
42871
43579
  const { updateAutomation: updateAutomation2, isUpdating } = useUpdateBusinessAutomation(automationId);
42872
- const communicationGroupId = automation?.action_data?.find(
43580
+ const communicationGroupId = automation2?.action_data?.find(
42873
43581
  (action) => action.action_type === "send_communication"
42874
43582
  )?.action_metadata.communication_group_id;
42875
43583
  const { communicationGroup, isGetting: isLoadingCommunicationGroup } = useGetCommunicationGroup(communicationGroupId || void 0);
42876
43584
  const { updateCommunicationGroup: updateCommunicationGroup2, isUpdating: isUpdatingCommunicationGroup } = useUpdateCommunicationGroup();
42877
- const { estimatedMatchesStats } = useRecipientStats(automation);
43585
+ const { estimatedMatchesStats } = useRecipientStats(automation2);
42878
43586
  const [isValidatingStep, setIsValidatingStep] = useState(false);
42879
43587
  const [isLoading, setIsLoading] = useState(false);
42880
43588
  const invalidateAutomation = useCallback(() => {
@@ -42900,7 +43608,7 @@ const useAutomation = (automationId, existingAutomation) => {
42900
43608
  }, []);
42901
43609
  const validateStep = useCallback(
42902
43610
  async (currentStep) => {
42903
- if (!automation) {
43611
+ if (!automation2) {
42904
43612
  return {
42905
43613
  canMove: false,
42906
43614
  errorMessage: "Automation not loaded"
@@ -42910,7 +43618,7 @@ const useAutomation = (automationId, existingAutomation) => {
42910
43618
  setIsValidatingStep(true);
42911
43619
  return await validateAutomationStep({
42912
43620
  currentStep,
42913
- automation,
43621
+ automation: automation2,
42914
43622
  communicationGroup
42915
43623
  });
42916
43624
  } finally {
@@ -42919,7 +43627,7 @@ const useAutomation = (automationId, existingAutomation) => {
42919
43627
  }
42920
43628
  }
42921
43629
  },
42922
- [automation, communicationGroup]
43630
+ [automation2, communicationGroup]
42923
43631
  );
42924
43632
  const setIsLoadingSafe = useCallback((loading2) => {
42925
43633
  if (mountedRef.current) {
@@ -42927,7 +43635,7 @@ const useAutomation = (automationId, existingAutomation) => {
42927
43635
  }
42928
43636
  }, []);
42929
43637
  return {
42930
- automation,
43638
+ automation: automation2,
42931
43639
  updateAutomation: updateAutomation2,
42932
43640
  communicationGroup,
42933
43641
  updateCommunicationGroup: updateCommunicationGroup2,
@@ -43173,7 +43881,7 @@ const PreviewPanel = ({ emailPreview, smsPreview, iconDefinitions }) => {
43173
43881
  }
43174
43882
  )
43175
43883
  ] }),
43176
- /* @__PURE__ */ jsx("div", { className: "p-6", children: /* @__PURE__ */ jsxs(AnimatePresence, { mode: "wait", children: [
43884
+ /* @__PURE__ */ jsx("div", { className: "p-6", children: /* @__PURE__ */ jsxs(AnimatePresence, { children: [
43177
43885
  selectedTab === "email" && emailPreview && /* @__PURE__ */ jsx(
43178
43886
  motion.div,
43179
43887
  {
@@ -43316,7 +44024,7 @@ const AutomationContent = ({
43316
44024
  const AutomationRecipients = ({
43317
44025
  automationId,
43318
44026
  iconDefinitions,
43319
- automation,
44027
+ automation: automation2,
43320
44028
  isLoading: isLoadingRecipients
43321
44029
  }) => {
43322
44030
  const { recipients, isLoading, fetchError } = useGetBusinessAutomationRecipients(automationId);
@@ -43348,7 +44056,7 @@ const AutomationRecipients = ({
43348
44056
  {
43349
44057
  automationId,
43350
44058
  iconDefinitions,
43351
- automation
44059
+ automation: automation2
43352
44060
  }
43353
44061
  ) }),
43354
44062
  /* @__PURE__ */ jsx(Separator$2, { className: "my-4" }),
@@ -45212,7 +45920,7 @@ const initStripo = (options) => {
45212
45920
  });
45213
45921
  };
45214
45922
  const StripoWrapper = ({
45215
- automation,
45923
+ automation: automation2,
45216
45924
  setShowStripoEditor,
45217
45925
  saveClicked,
45218
45926
  setSaveClicked,
@@ -45223,7 +45931,7 @@ const StripoWrapper = ({
45223
45931
  const stripoOpenedOnce = useRef(false);
45224
45932
  const containerRef = useRef(null);
45225
45933
  const { data: template2, isLoading: isTemplateLoading } = useStripoTemplate(
45226
- automation.id
45934
+ automation2.id
45227
45935
  );
45228
45936
  const { data: editorData, isLoading: isEditorDataLoading } = useStripoEditorData();
45229
45937
  const [stripoEmailSaved, setStripoEmailSaved] = useState(false);
@@ -45320,7 +46028,7 @@ const StripoWrapper = ({
45320
46028
  ) });
45321
46029
  };
45322
46030
  const EmailPreview = ({
45323
- automation,
46031
+ automation: automation2,
45324
46032
  mergeFieldsResponse,
45325
46033
  communicationGroup,
45326
46034
  updateCommunicationGroup: updateCommunicationGroup2
@@ -45346,7 +46054,7 @@ const EmailPreview = ({
45346
46054
  null
45347
46055
  );
45348
46056
  const { refetchAutomation: refreshAutomation } = useGetBusinessAutomation(
45349
- automation.id
46057
+ automation2.id
45350
46058
  );
45351
46059
  const [showHelpDialog, setShowHelpDialog] = useState(false);
45352
46060
  const initialRenderRef = useRef(true);
@@ -45597,7 +46305,7 @@ const EmailPreview = ({
45597
46305
  StripoWrapper,
45598
46306
  {
45599
46307
  showStripoEditor,
45600
- automation,
46308
+ automation: automation2,
45601
46309
  setShowStripoEditor,
45602
46310
  saveClicked,
45603
46311
  setSaveClicked,
@@ -45983,14 +46691,14 @@ const useMe = () => {
45983
46691
  });
45984
46692
  return query;
45985
46693
  };
45986
- const SMSPreview = ({ automation, iconDefinitions, mergeFieldsResponse }) => {
46694
+ const SMSPreview = ({ automation: automation2, iconDefinitions, mergeFieldsResponse }) => {
45987
46695
  const [isUpdating, setIsUpdating] = useState(false);
45988
46696
  const _getCommunicationGroupFromAutomation = useCallback(() => {
45989
- const actionGroup = automation.action_data?.find(
46697
+ const actionGroup = automation2.action_data?.find(
45990
46698
  (action) => action.action_type === "send_communication"
45991
46699
  );
45992
46700
  return actionGroup?.action_metadata.communication_group_id;
45993
- }, [automation.action_data]);
46701
+ }, [automation2.action_data]);
45994
46702
  const [mergeFieldValue, setMergeFieldValue] = useState("");
45995
46703
  const [fromNumber, setFromNumber] = useState(null);
45996
46704
  const [initCompanyName, setInitCompanyName] = useState(false);
@@ -46205,7 +46913,7 @@ ${message2}` : message2
46205
46913
  ] });
46206
46914
  };
46207
46915
  const EditCampaignContent = ({
46208
- automation,
46916
+ automation: automation2,
46209
46917
  iconDefinitions,
46210
46918
  getExtraMergeFields,
46211
46919
  communicationGroup,
@@ -46247,7 +46955,7 @@ const EditCampaignContent = ({
46247
46955
  setExpandedChannels(["email"]);
46248
46956
  return;
46249
46957
  }
46250
- }, [automation, communicationGroup]);
46958
+ }, [automation2, communicationGroup]);
46251
46959
  const setSelectedChannelsBasedOnCommunicationGroup = useCallback(
46252
46960
  (data) => {
46253
46961
  const finalSelectedChannels = [];
@@ -46416,7 +47124,7 @@ const EditCampaignContent = ({
46416
47124
  /* @__PURE__ */ jsx(
46417
47125
  EmailPreview,
46418
47126
  {
46419
- automation,
47127
+ automation: automation2,
46420
47128
  iconDefinitions,
46421
47129
  updateAutomation: updateAutomation2,
46422
47130
  communicationGroup,
@@ -46432,7 +47140,7 @@ const EditCampaignContent = ({
46432
47140
  /* @__PURE__ */ jsx(
46433
47141
  SMSPreview,
46434
47142
  {
46435
- automation,
47143
+ automation: automation2,
46436
47144
  iconDefinitions,
46437
47145
  mergeFieldsResponse
46438
47146
  }
@@ -46518,9 +47226,9 @@ const EstimatedMatchesView = ({
46518
47226
  const contactStats = React__default.useMemo(() => {
46519
47227
  if (!data?.recipients) return { emails: 0, phones: 0 };
46520
47228
  return data.recipients.reduce(
46521
- (acc, user) => ({
46522
- emails: acc.emails + (user.email ? 1 : 0),
46523
- phones: acc.phones + (user.phone ? 1 : 0)
47229
+ (acc, user2) => ({
47230
+ emails: acc.emails + (user2.email ? 1 : 0),
47231
+ phones: acc.phones + (user2.phone ? 1 : 0)
46524
47232
  }),
46525
47233
  { emails: 0, phones: 0 }
46526
47234
  );
@@ -46687,10 +47395,10 @@ const ComboboxDemo = ({
46687
47395
  ] }) })
46688
47396
  ] });
46689
47397
  };
46690
- const OneTimeBroadcastMetadata = ({ automation }) => {
47398
+ const OneTimeBroadcastMetadata = ({ automation: automation2 }) => {
46691
47399
  const _getDateFromAutomation = () => {
46692
- if (isOneTimeTriggerMetadata(automation.trigger_metadata) && automation.trigger_metadata.scheduled_at) {
46693
- return new Date(automation.trigger_metadata.scheduled_at);
47400
+ if (isOneTimeTriggerMetadata(automation2.trigger_metadata) && automation2.trigger_metadata.scheduled_at) {
47401
+ return new Date(automation2.trigger_metadata.scheduled_at);
46694
47402
  }
46695
47403
  return addMinutes(/* @__PURE__ */ new Date(), 15);
46696
47404
  };
@@ -46699,9 +47407,9 @@ const OneTimeBroadcastMetadata = ({ automation }) => {
46699
47407
  _getDateFromAutomation() < /* @__PURE__ */ new Date() ? "Please select a time in the future" : null
46700
47408
  );
46701
47409
  const [timeInput, setTimeInput] = React.useState(format$1(date2, "HH:mm"));
46702
- const { updateAutomation: updateAutomation2 } = useUpdateBusinessAutomation(automation.id);
47410
+ const { updateAutomation: updateAutomation2 } = useUpdateBusinessAutomation(automation2.id);
46703
47411
  const [timezone, setTimezone] = React.useState(
46704
- isOneTimeTriggerMetadata(automation.trigger_metadata) && automation.trigger_metadata.timezone ? automation.trigger_metadata.timezone : Intl.DateTimeFormat().resolvedOptions().timeZone
47412
+ isOneTimeTriggerMetadata(automation2.trigger_metadata) && automation2.trigger_metadata.timezone ? automation2.trigger_metadata.timezone : Intl.DateTimeFormat().resolvedOptions().timeZone
46705
47413
  );
46706
47414
  const timezones = Intl.supportedValuesOf("timeZone");
46707
47415
  const timezoneOptions = timezones.map((tz) => ({
@@ -46770,7 +47478,7 @@ const OneTimeBroadcastMetadata = ({ automation }) => {
46770
47478
  timezone
46771
47479
  }
46772
47480
  });
46773
- }, [date2, timezone, updateAutomation2, automation.id]);
47481
+ }, [date2, timezone, updateAutomation2, automation2.id]);
46774
47482
  return /* @__PURE__ */ jsxs("div", { className: "flex flex-col items-center justify-center h-full", children: [
46775
47483
  /* @__PURE__ */ jsxs("div", { className: "flex flex-col sm:flex-row gap-2 w-full ", children: [
46776
47484
  /* @__PURE__ */ jsxs(Popover, { children: [
@@ -46834,7 +47542,7 @@ const OneTimeBroadcastMetadata = ({ automation }) => {
46834
47542
  ] })
46835
47543
  ] });
46836
47544
  };
46837
- const SelectTime = ({ iconDefinitions, automation, updateAutomation: updateAutomation2 }) => {
47545
+ const SelectTime = ({ iconDefinitions, automation: automation2, updateAutomation: updateAutomation2 }) => {
46838
47546
  const [deliveryOption, setDeliveryOption] = useState(null);
46839
47547
  return /* @__PURE__ */ jsx("div", { className: "@container", children: /* @__PURE__ */ jsx(
46840
47548
  motion.div,
@@ -46885,11 +47593,11 @@ const SelectTime = ({ iconDefinitions, automation, updateAutomation: updateAutom
46885
47593
  exit: { opacity: 0, height: 0 },
46886
47594
  transition: { duration: 0.3 },
46887
47595
  className: "overflow-hidden mt-8",
46888
- children: /* @__PURE__ */ jsx("div", { className: "bg-gray-50 rounded-xl p-5 border border-gray-100 flex items-center justify-center", children: /* @__PURE__ */ jsx(OneTimeBroadcastMetadata, { automation }) })
47596
+ children: /* @__PURE__ */ jsx("div", { className: "bg-gray-50 rounded-xl p-5 border border-gray-100 flex items-center justify-center", children: /* @__PURE__ */ jsx(OneTimeBroadcastMetadata, { automation: automation2 }) })
46889
47597
  }
46890
47598
  ) })
46891
47599
  ] }),
46892
- isOneTimeTriggerMetadata(automation.trigger_metadata) && automation.trigger_metadata.scheduled_at && /* @__PURE__ */ jsxs(
47600
+ isOneTimeTriggerMetadata(automation2.trigger_metadata) && automation2.trigger_metadata.scheduled_at && /* @__PURE__ */ jsxs(
46893
47601
  motion.div,
46894
47602
  {
46895
47603
  initial: { opacity: 0, y: 10, scale: 0.98 },
@@ -46919,7 +47627,7 @@ const SelectTime = ({ iconDefinitions, automation, updateAutomation: updateAutom
46919
47627
  transition: { delay: 0.4, duration: 0.4 },
46920
47628
  className: "text-md font-bold text-gray-800",
46921
47629
  children: new Date(
46922
- automation.trigger_metadata.scheduled_at
47630
+ automation2.trigger_metadata.scheduled_at
46923
47631
  ).toLocaleString("en-US", {
46924
47632
  weekday: "long",
46925
47633
  month: "long",
@@ -46929,7 +47637,7 @@ const SelectTime = ({ iconDefinitions, automation, updateAutomation: updateAutom
46929
47637
  minute: "2-digit",
46930
47638
  hour12: true,
46931
47639
  timeZoneName: "short",
46932
- timeZone: automation.trigger_metadata.timezone || void 0
47640
+ timeZone: automation2.trigger_metadata.timezone || void 0
46933
47641
  })
46934
47642
  }
46935
47643
  )
@@ -46941,13 +47649,13 @@ const SelectTime = ({ iconDefinitions, automation, updateAutomation: updateAutom
46941
47649
  ) });
46942
47650
  };
46943
47651
  const PreviewAndSchedule = ({
46944
- automation,
47652
+ automation: automation2,
46945
47653
  iconDefinitions,
46946
47654
  isLoading,
46947
47655
  communicationGroup,
46948
47656
  updateAutomation: externalUpdateAutomation
46949
47657
  }) => {
46950
- const { updateAutomation: businessUpdateAutomation } = useUpdateBusinessAutomation(automation.id);
47658
+ const { updateAutomation: businessUpdateAutomation } = useUpdateBusinessAutomation(automation2.id);
46951
47659
  const updateAutomation2 = externalUpdateAutomation || ((params) => businessUpdateAutomation(params));
46952
47660
  const { channelSenders } = useChannelSender();
46953
47661
  const { channelAccounts } = useChannelAccount();
@@ -47033,15 +47741,15 @@ const PreviewAndSchedule = ({
47033
47741
  {
47034
47742
  subtitle: "Estimated recipient count may vary at time of delivery",
47035
47743
  iconDefinitions,
47036
- includeSegments: automation.includeSegmentIds,
47037
- excludeSegments: automation.excludeSegmentIds
47744
+ includeSegments: automation2.includeSegmentIds,
47745
+ excludeSegments: automation2.excludeSegmentIds
47038
47746
  }
47039
47747
  )
47040
47748
  ] }),
47041
- automation.trigger_type === AutomationTriggerType.ONE_TIME && /* @__PURE__ */ jsx(Card, { className: "p-4 shadow-sm border-none mt-4", children: /* @__PURE__ */ jsx(
47749
+ automation2.trigger_type === AutomationTriggerType.ONE_TIME && /* @__PURE__ */ jsx(Card, { className: "p-4 shadow-sm border-none mt-4", children: /* @__PURE__ */ jsx(
47042
47750
  SelectTime,
47043
47751
  {
47044
- automation,
47752
+ automation: automation2,
47045
47753
  iconDefinitions,
47046
47754
  updateAutomation: updateAutomation2
47047
47755
  }
@@ -47059,7 +47767,7 @@ const AllOrSelectSegmentPicker = ({ iconDefinitions, onSelectionChange, defaultV
47059
47767
  BigSelector,
47060
47768
  {
47061
47769
  onClick: () => handleSelect("all"),
47062
- title: "All patrons",
47770
+ title: `All ${t("engage:user", { count: 2 })}`,
47063
47771
  subtitle: "Send to everyone",
47064
47772
  icon: /* @__PURE__ */ jsx(iconDefinitions.UsersIcon, { className: "w-5 h-5 mb-2 text-gray-600" }),
47065
47773
  selected: selected === "all"
@@ -47069,7 +47777,7 @@ const AllOrSelectSegmentPicker = ({ iconDefinitions, onSelectionChange, defaultV
47069
47777
  BigSelector,
47070
47778
  {
47071
47779
  onClick: () => handleSelect("segments"),
47072
- title: "Select patrons",
47780
+ title: `Select ${t("engage:user", { count: 2 })}`,
47073
47781
  subtitle: "Choose from segments",
47074
47782
  icon: /* @__PURE__ */ jsx(iconDefinitions.UserEdit, { className: "w-5 h-5 mb-2 text-gray-600" }),
47075
47783
  selected: selected === "segments"
@@ -47092,9 +47800,9 @@ const SegmentSection = ({
47092
47800
  segmentsToRemove.forEach(onRemoveSegment);
47093
47801
  };
47094
47802
  const [segmentSelectedIds, setSegmentSelectedIds] = useState([]);
47095
- const options = allSegments.map((segment) => ({
47096
- label: segment.name,
47097
- value: segment.id
47803
+ const options = allSegments.map((segment2) => ({
47804
+ label: segment2.name,
47805
+ value: segment2.id
47098
47806
  }));
47099
47807
  useEffect(() => {
47100
47808
  setSegmentSelectedIds(segments);
@@ -47197,22 +47905,22 @@ const SelectSegments = ({
47197
47905
  ] })
47198
47906
  ] });
47199
47907
  };
47200
- const SelectAudience = ({ iconDefinitions, automation }) => {
47908
+ const SelectAudience = ({ iconDefinitions, automation: automation2 }) => {
47201
47909
  const [openCreateSegmentDialog, setOpenCreateSegmentDialog] = React__default.useState(false);
47202
47910
  const [initialStateSet, setInitialStateSet] = React__default.useState(false);
47203
47911
  const { segments, isLoading } = useListSegments();
47204
- const { updateAutomation: updateAutomation2 } = useUpdateBusinessAutomation(automation.id);
47912
+ const { updateAutomation: updateAutomation2 } = useUpdateBusinessAutomation(automation2.id);
47205
47913
  const [includedSegments, setIncludedSegments] = React__default.useState(
47206
- automation.includeSegmentIds || []
47914
+ automation2.includeSegmentIds || []
47207
47915
  );
47208
47916
  const [excludedSegments, setExcludedSegments] = React__default.useState(
47209
- automation.excludeSegmentIds || []
47917
+ automation2.excludeSegmentIds || []
47210
47918
  );
47211
47919
  const allUsersSelected = includedSegments.length === 1 && excludedSegments.length === 0 && /**
47212
47920
  * Check if the all users segment is selected in the atuomation
47213
47921
  */
47214
47922
  segments?.data?.find(
47215
- (segment) => segment.type === BusinessSegmentTypeEnum.ALL_USERS && segment.id === includedSegments[0]
47923
+ (segment2) => segment2.type === BusinessSegmentTypeEnum.ALL_USERS && segment2.id === includedSegments[0]
47216
47924
  ) !== void 0;
47217
47925
  const [selectedAudience, setSelectedAudience] = useState(
47218
47926
  allUsersSelected ? "all" : "segments"
@@ -47232,7 +47940,7 @@ const SelectAudience = ({ iconDefinitions, automation }) => {
47232
47940
  }
47233
47941
  };
47234
47942
  useEffect(() => {
47235
- const hasSegmentsChanged = JSON.stringify(automation.includeSegmentIds) !== JSON.stringify(includedSegments) || JSON.stringify(automation.excludeSegmentIds) !== JSON.stringify(excludedSegments);
47943
+ const hasSegmentsChanged = JSON.stringify(automation2.includeSegmentIds) !== JSON.stringify(includedSegments) || JSON.stringify(automation2.excludeSegmentIds) !== JSON.stringify(excludedSegments);
47236
47944
  if (hasSegmentsChanged) {
47237
47945
  updateAutomation2({
47238
47946
  include_segments: includedSegments,
@@ -47242,14 +47950,14 @@ const SelectAudience = ({ iconDefinitions, automation }) => {
47242
47950
  }, [
47243
47951
  includedSegments,
47244
47952
  excludedSegments,
47245
- automation.includeSegmentIds,
47246
- automation.excludeSegmentIds,
47953
+ automation2.includeSegmentIds,
47954
+ automation2.excludeSegmentIds,
47247
47955
  updateAutomation2,
47248
- automation.id
47956
+ automation2.id
47249
47957
  ]);
47250
47958
  const getAllUsersSegment = useCallback(() => {
47251
47959
  return segments?.data?.find(
47252
- (segment) => segment.type === BusinessSegmentTypeEnum.ALL_USERS
47960
+ (segment2) => segment2.type === BusinessSegmentTypeEnum.ALL_USERS
47253
47961
  );
47254
47962
  }, [segments]);
47255
47963
  useEffect(() => {
@@ -47268,7 +47976,7 @@ const SelectAudience = ({ iconDefinitions, automation }) => {
47268
47976
  if (!segments) {
47269
47977
  return;
47270
47978
  }
47271
- if (automation.includeSegmentIds.length === 0 && automation.excludeSegmentIds.length === 0) {
47979
+ if (automation2.includeSegmentIds.length === 0 && automation2.excludeSegmentIds.length === 0) {
47272
47980
  setSelectedAudience("all");
47273
47981
  const allUsersSegment = getAllUsersSegment();
47274
47982
  if (allUsersSegment) {
@@ -47295,9 +48003,9 @@ const SelectAudience = ({ iconDefinitions, automation }) => {
47295
48003
  allUsersSelected,
47296
48004
  getAllUsersSegment,
47297
48005
  updateAutomation2,
47298
- automation.includeSegmentIds,
47299
- automation.excludeSegmentIds,
47300
- automation.id
48006
+ automation2.includeSegmentIds,
48007
+ automation2.excludeSegmentIds,
48008
+ automation2.id
47301
48009
  ]);
47302
48010
  if (isLoading || !segments || !initialStateSet) {
47303
48011
  return /* @__PURE__ */ jsx("div", { children: /* @__PURE__ */ jsx(SpinLoader, { text: ["Fetching segments", "Finishing up"] }) });
@@ -47341,7 +48049,7 @@ const SelectAudience = ({ iconDefinitions, automation }) => {
47341
48049
  defaultValue: selectedAudience
47342
48050
  }
47343
48051
  ),
47344
- /* @__PURE__ */ jsx(AnimatePresence, { mode: "wait", children: selectedAudience === "segments" && /* @__PURE__ */ jsx(
48052
+ /* @__PURE__ */ jsx(AnimatePresence, { children: selectedAudience === "segments" && /* @__PURE__ */ jsx(
47345
48053
  motion.div,
47346
48054
  {
47347
48055
  initial: { opacity: 0, height: 0 },
@@ -47359,7 +48067,7 @@ const SelectAudience = ({ iconDefinitions, automation }) => {
47359
48067
  handleRemoveSegment,
47360
48068
  setOpenCreateSegmentDialog,
47361
48069
  segments,
47362
- defaultIsExcludeOpen: automation.excludeSegmentIds?.length > 0
48070
+ defaultIsExcludeOpen: automation2.excludeSegmentIds?.length > 0
47363
48071
  }
47364
48072
  )
47365
48073
  }
@@ -47430,14 +48138,14 @@ const lineVariant = {
47430
48138
  }
47431
48139
  }
47432
48140
  };
47433
- const TriggerEditAutomation = ({ automation }) => {
48141
+ const TriggerEditAutomation = ({ automation: automation2 }) => {
47434
48142
  const [getSegmentResponse, setGetSegmentResponse] = useState(void 0);
47435
48143
  useEffect(() => {
47436
48144
  const getSegmentData = async () => {
47437
- if (automation.trigger_metadata.trigger_type !== AutomationTriggerType.TRIGGER_BASED) {
48145
+ if (automation2.trigger_metadata.trigger_type !== AutomationTriggerType.TRIGGER_BASED) {
47438
48146
  return;
47439
48147
  }
47440
- const triggerSegmentId = automation.trigger_metadata.event_filter.segment_id;
48148
+ const triggerSegmentId = automation2.trigger_metadata.event_filter.segment_id;
47441
48149
  const segmentResponse = await getSegment(triggerSegmentId);
47442
48150
  if (!segmentResponse) {
47443
48151
  return;
@@ -47445,7 +48153,7 @@ const TriggerEditAutomation = ({ automation }) => {
47445
48153
  setGetSegmentResponse(segmentResponse);
47446
48154
  };
47447
48155
  getSegmentData();
47448
- }, [automation.trigger_metadata, automation.trigger_metadata.trigger_type]);
48156
+ }, [automation2.trigger_metadata, automation2.trigger_metadata.trigger_type]);
47449
48157
  if (!getSegmentResponse) {
47450
48158
  return /* @__PURE__ */ jsx("div", { className: "flex items-center justify-center min-h-[200px]", children: /* @__PURE__ */ jsx(SpinLoader, {}) });
47451
48159
  }
@@ -47536,7 +48244,7 @@ const TriggerEditAutomation = ({ automation }) => {
47536
48244
  ) });
47537
48245
  };
47538
48246
  const useAutomationSteps = ({
47539
- automation,
48247
+ automation: automation2,
47540
48248
  updateAutomation: updateAutomation2,
47541
48249
  communicationGroup,
47542
48250
  updateCommunicationGroup: updateCommunicationGroup2,
@@ -47545,9 +48253,9 @@ const useAutomationSteps = ({
47545
48253
  handleSaveAsDraft,
47546
48254
  isLoading
47547
48255
  }) => {
47548
- if (!automation) return [];
48256
+ if (!automation2) return [];
47549
48257
  return [
47550
- ...automation.trigger_type === AutomationTriggerType.TRIGGER_BASED ? [
48258
+ ...automation2.trigger_type === AutomationTriggerType.TRIGGER_BASED ? [
47551
48259
  {
47552
48260
  id: "trigger",
47553
48261
  title: "Trigger",
@@ -47561,7 +48269,7 @@ const useAutomationSteps = ({
47561
48269
  TriggerEditAutomation,
47562
48270
  {
47563
48271
  iconDefinitions,
47564
- automation
48272
+ automation: automation2
47565
48273
  }
47566
48274
  )
47567
48275
  }
@@ -47580,7 +48288,7 @@ const useAutomationSteps = ({
47580
48288
  title: "Audience",
47581
48289
  step: AutomationSteps.SelectAudience,
47582
48290
  isValid: () => {
47583
- return automation.includeSegmentIds.length > 0;
48291
+ return automation2.includeSegmentIds.length > 0;
47584
48292
  },
47585
48293
  content: /* @__PURE__ */ jsx(
47586
48294
  TitleAndContent,
@@ -47590,7 +48298,7 @@ const useAutomationSteps = ({
47590
48298
  SelectAudience,
47591
48299
  {
47592
48300
  iconDefinitions,
47593
- automation
48301
+ automation: automation2
47594
48302
  }
47595
48303
  )
47596
48304
  }
@@ -47601,7 +48309,7 @@ const useAutomationSteps = ({
47601
48309
  /**
47602
48310
  * We dont show the back button for one_time_based automations
47603
48311
  */
47604
- hideBack: automation.trigger_type === AutomationTriggerType.ONE_TIME ? true : false,
48312
+ hideBack: automation2.trigger_type === AutomationTriggerType.ONE_TIME ? true : false,
47605
48313
  backDisabled: false,
47606
48314
  nextDisabled: () => false
47607
48315
  }
@@ -47611,7 +48319,7 @@ const useAutomationSteps = ({
47611
48319
  title: "Content",
47612
48320
  step: AutomationSteps.SelectCommunication,
47613
48321
  isValid: () => {
47614
- const actionDataCommunication = automation.action_data?.find(
48322
+ const actionDataCommunication = automation2.action_data?.find(
47615
48323
  (action) => action.action_type === "send_communication"
47616
48324
  );
47617
48325
  if (!actionDataCommunication || !actionDataCommunication.action_metadata.communication_group_id) {
@@ -47633,7 +48341,7 @@ const useAutomationSteps = ({
47633
48341
  /* @__PURE__ */ jsx(
47634
48342
  EditCampaignContent,
47635
48343
  {
47636
- automation,
48344
+ automation: automation2,
47637
48345
  updateAutomation: updateAutomation2,
47638
48346
  communicationGroup,
47639
48347
  updateCommunicationGroup: updateCommunicationGroup2,
@@ -47656,7 +48364,7 @@ const useAutomationSteps = ({
47656
48364
  step: AutomationSteps.PreviewAndSchedule,
47657
48365
  isValid: () => {
47658
48366
  return Boolean(
47659
- automation.trigger_metadata?.trigger_type === AutomationTriggerType.ONE_TIME && automation.trigger_metadata?.scheduled_at && new Date(automation.trigger_metadata.scheduled_at) > /* @__PURE__ */ new Date() && automation.action_data?.some(
48367
+ automation2.trigger_metadata?.trigger_type === AutomationTriggerType.ONE_TIME && automation2.trigger_metadata?.scheduled_at && new Date(automation2.trigger_metadata.scheduled_at) > /* @__PURE__ */ new Date() && automation2.action_data?.some(
47660
48368
  (action) => action.action_type === "send_communication" && action.action_metadata.communication_group_id
47661
48369
  )
47662
48370
  );
@@ -47669,7 +48377,7 @@ const useAutomationSteps = ({
47669
48377
  content: /* @__PURE__ */ jsx(
47670
48378
  PreviewAndSchedule,
47671
48379
  {
47672
- automation,
48380
+ automation: automation2,
47673
48381
  iconDefinitions,
47674
48382
  isLoading,
47675
48383
  communicationGroup
@@ -47679,12 +48387,12 @@ const useAutomationSteps = ({
47679
48387
  ),
47680
48388
  footerConfig: {
47681
48389
  backText: "Back",
47682
- nextText: automation.trigger_metadata?.trigger_type === AutomationTriggerType.ONE_TIME ? "Schedule" : "Start",
48390
+ nextText: automation2.trigger_metadata?.trigger_type === AutomationTriggerType.ONE_TIME ? "Schedule" : "Start",
47683
48391
  hideBack: false,
47684
48392
  backDisabled: false,
47685
48393
  nextDisabled: () => {
47686
- return automation.trigger_metadata?.trigger_type === AutomationTriggerType.ONE_TIME && !(automation.trigger_metadata?.scheduled_at && new Date(automation.trigger_metadata?.scheduled_at) > /* @__PURE__ */ new Date() && Boolean(
47687
- automation.action_data?.some(
48394
+ return automation2.trigger_metadata?.trigger_type === AutomationTriggerType.ONE_TIME && !(automation2.trigger_metadata?.scheduled_at && new Date(automation2.trigger_metadata?.scheduled_at) > /* @__PURE__ */ new Date() && Boolean(
48395
+ automation2.action_data?.some(
47688
48396
  (action) => action.action_type === "send_communication" && action.action_metadata.communication_group_id
47689
48397
  )
47690
48398
  ));
@@ -47751,7 +48459,7 @@ const BackNextButtonGroup = ({
47751
48459
  ] });
47752
48460
  };
47753
48461
  const EditAutomation = ({
47754
- automation,
48462
+ automation: automation2,
47755
48463
  updateAutomation: updateAutomation2,
47756
48464
  communicationGroup,
47757
48465
  updateCommunicationGroup: updateCommunicationGroup2,
@@ -47770,7 +48478,7 @@ const EditAutomation = ({
47770
48478
  /**
47771
48479
  * We dont show the trigger step for trigger based automations
47772
48480
  */
47773
- automation.trigger_type === AutomationTriggerType.TRIGGER_BASED ? AutomationSteps.SelectTrigger : AutomationSteps.SelectAudience
48481
+ automation2.trigger_type === AutomationTriggerType.TRIGGER_BASED ? AutomationSteps.SelectTrigger : AutomationSteps.SelectAudience
47774
48482
  );
47775
48483
  const [isValidatingStep, setIsValidatingStep] = useState(false);
47776
48484
  const handleSaveAsDraft = () => {
@@ -47786,7 +48494,7 @@ const EditAutomation = ({
47786
48494
  setIsLoading(false);
47787
48495
  };
47788
48496
  const STEPS = useAutomationSteps({
47789
- automation,
48497
+ automation: automation2,
47790
48498
  iconDefinitions,
47791
48499
  getExtraMergeFields,
47792
48500
  handleSaveAsDraft,
@@ -47842,7 +48550,7 @@ const EditAutomation = ({
47842
48550
  const handleNextStep = async () => {
47843
48551
  const { canMove, errorMessage } = await validateCanGoToNextStep({
47844
48552
  currentStep,
47845
- automation,
48553
+ automation: automation2,
47846
48554
  communicationGroup
47847
48555
  });
47848
48556
  if (!canMove) {
@@ -47873,7 +48581,7 @@ const EditAutomation = ({
47873
48581
  for (let step = currentStep; step < targetStep; step++) {
47874
48582
  const { canMove, errorMessage } = await validateCanGoToNextStep({
47875
48583
  currentStep: step,
47876
- automation,
48584
+ automation: automation2,
47877
48585
  communicationGroup
47878
48586
  });
47879
48587
  if (!canMove) {
@@ -47896,19 +48604,19 @@ const EditAutomation = ({
47896
48604
  }
47897
48605
  ),
47898
48606
  logoUrl && /* @__PURE__ */ jsx("div", { className: "flex-shrink-0", children: /* @__PURE__ */ jsx("img", { src: logoUrl, alt: "Logo", className: "w-6 h-6" }) }),
47899
- /* @__PURE__ */ jsx("h1", { className: "text-xl font-bold leading-none", children: automation.name }),
48607
+ /* @__PURE__ */ jsx("h1", { className: "text-xl font-bold leading-none", children: automation2.name }),
47900
48608
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-4", children: [
47901
48609
  /* @__PURE__ */ jsx(
47902
48610
  Badge,
47903
48611
  {
47904
- variant: automation.status === AutomationStatus.ACTIVE ? "default" : automation.status === AutomationStatus.DRAFT ? "secondary" : "outline",
47905
- children: automation.status === AutomationStatus.ACTIVE ? "Active" : automation.status === AutomationStatus.DRAFT ? "Draft" : "Inactive"
48612
+ variant: automation2.status === AutomationStatus.ACTIVE ? "default" : automation2.status === AutomationStatus.DRAFT ? "secondary" : "outline",
48613
+ children: automation2.status === AutomationStatus.ACTIVE ? "Active" : automation2.status === AutomationStatus.DRAFT ? "Draft" : "Inactive"
47906
48614
  }
47907
48615
  ),
47908
48616
  /* @__PURE__ */ jsxs("span", { className: "text-xs text-gray-500", children: [
47909
48617
  "Last modified",
47910
48618
  " ",
47911
- automation?.updated_at ? formatDistanceToNow(new Date(automation.updated_at)) + " ago" : "N/A"
48619
+ automation2?.updated_at ? formatDistanceToNow(new Date(automation2.updated_at)) + " ago" : "N/A"
47912
48620
  ] })
47913
48621
  ] })
47914
48622
  ] });
@@ -47951,7 +48659,7 @@ const EditAutomation = ({
47951
48659
  },
47952
48660
  step.step
47953
48661
  )) });
47954
- const renderContent = () => /* @__PURE__ */ jsx("section", { className: "flex-1 mr-6 w-full relative rounded-xl bg-gray-100 ml-6 @[1000px]:ml-0", children: /* @__PURE__ */ jsx("div", { className: "absolute overflow-y-auto top-0 left-0 right-0 bottom-0 flex-1 h-full flex-col flex", children: /* @__PURE__ */ jsx(AnimatePresence, { mode: "wait", children: /* @__PURE__ */ jsx(BlurDiv, { className: "pt-0 h-full", children: STEPS.find((step) => step.step === currentStep)?.content }, currentStep) }) }) });
48662
+ const renderContent = () => /* @__PURE__ */ jsx("section", { className: "flex-1 mr-6 w-full relative rounded-xl bg-gray-100 ml-6 @[1000px]:ml-0", children: /* @__PURE__ */ jsx("div", { className: "absolute overflow-y-auto top-0 left-0 right-0 bottom-0 flex-1 h-full flex-col flex", children: /* @__PURE__ */ jsx(AnimatePresence, { children: /* @__PURE__ */ jsx(BlurDiv, { className: "pt-0 h-full", children: STEPS.find((step) => step.step === currentStep)?.content }, currentStep) }) }) });
47955
48663
  const renderFooter = () => /* @__PURE__ */ jsx("footer", { className: "w-full flex justify-end shadow-md z-10 items-center h-16 px-6", children: /* @__PURE__ */ jsx(
47956
48664
  BackNextButtonGroup,
47957
48665
  {
@@ -48003,14 +48711,14 @@ const validatePhoneNumber = (phoneNumber) => {
48003
48711
  const PhoneUtils = {
48004
48712
  validatePhoneNumber
48005
48713
  };
48006
- const SendPreviewPopup = ({ automation, type, setOpenSendPreviewPopup, iconDefinitions }) => {
48714
+ const SendPreviewPopup = ({ automation: automation2, type, setOpenSendPreviewPopup, iconDefinitions }) => {
48007
48715
  const [recipient, setRecipient] = useState("");
48008
48716
  const [error2, setError2] = useState("");
48009
48717
  const [senderId, setSenderId] = useState(null);
48010
48718
  const [finishedLoading, setFinishedLoading] = useState(false);
48011
48719
  const { sendTestCommunication: sendTestCommunication2, sendError, isSendSuccess } = useSendTestCommunication();
48012
48720
  const { toast: toast2 } = useToast();
48013
- const actionDataCommunication = automation.action_data?.find(
48721
+ const actionDataCommunication = automation2.action_data?.find(
48014
48722
  (action) => action.action_type === "send_communication"
48015
48723
  );
48016
48724
  const communicationGroupId = actionDataCommunication?.action_metadata.communication_group_id;
@@ -48082,7 +48790,7 @@ const SendPreviewPopup = ({ automation, type, setOpenSendPreviewPopup, iconDefin
48082
48790
  setError2("No sender found, please update the automation first!");
48083
48791
  return;
48084
48792
  }
48085
- const actionDataCommunication2 = automation.action_data?.find(
48793
+ const actionDataCommunication2 = automation2.action_data?.find(
48086
48794
  (action) => action.action_type === "send_communication"
48087
48795
  );
48088
48796
  const communicationGroupId2 = actionDataCommunication2?.action_metadata.communication_group_id;
@@ -48135,7 +48843,7 @@ const SendPreviewPopup = ({ automation, type, setOpenSendPreviewPopup, iconDefin
48135
48843
  ] });
48136
48844
  };
48137
48845
  const ViewAutomationHeaderContainer = ({
48138
- automation,
48846
+ automation: automation2,
48139
48847
  updateAutomation: updateAutomation2,
48140
48848
  communicationGroup,
48141
48849
  updateCommunicationGroup: updateCommunicationGroup2,
@@ -48186,7 +48894,7 @@ const ViewAutomationHeaderContainer = ({
48186
48894
  };
48187
48895
  const handleDuplicateAutomation = async () => {
48188
48896
  const { id: duplicatedId } = await duplicateBusinessAutomation(
48189
- automation.id
48897
+ automation2.id
48190
48898
  );
48191
48899
  if (!duplicatedId) {
48192
48900
  toast2({
@@ -48224,7 +48932,7 @@ const ViewAutomationHeaderContainer = ({
48224
48932
  /* @__PURE__ */ jsx(
48225
48933
  EditAutomation,
48226
48934
  {
48227
- automation,
48935
+ automation: automation2,
48228
48936
  updateAutomation: updateAutomation2,
48229
48937
  communicationGroup,
48230
48938
  updateCommunicationGroup: updateCommunicationGroup2,
@@ -48279,7 +48987,7 @@ const ViewAutomationHeaderContainer = ({
48279
48987
  /* @__PURE__ */ jsx(
48280
48988
  SendPreviewPopup,
48281
48989
  {
48282
- automation,
48990
+ automation: automation2,
48283
48991
  type: "sms",
48284
48992
  setOpenSendPreviewPopup: setOpenSendPreviewSmsPopup,
48285
48993
  iconDefinitions: mergedIconDefinitions
@@ -48301,7 +49009,7 @@ const ViewAutomationHeaderContainer = ({
48301
49009
  /* @__PURE__ */ jsx(
48302
49010
  SendPreviewPopup,
48303
49011
  {
48304
- automation,
49012
+ automation: automation2,
48305
49013
  type: "email",
48306
49014
  setOpenSendPreviewPopup: setOpenSendPreviewEmailPopup,
48307
49015
  iconDefinitions: mergedIconDefinitions
@@ -48318,12 +49026,15 @@ const ViewAutomationHeaderContainer = ({
48318
49026
  /* @__PURE__ */ jsxs("div", { children: [
48319
49027
  /* @__PURE__ */ jsxs("div", { className: "flex items-center gap-2", children: [
48320
49028
  /* @__PURE__ */ jsxs("h1", { className: "text-2xl font-semibold mb-1", children: [
48321
- automation.name,
49029
+ automation2.name,
48322
49030
  " "
48323
49031
  ] }),
48324
- /* @__PURE__ */ jsx(StatusBadge, { status: automation.status })
49032
+ /* @__PURE__ */ jsx(StatusBadge, { status: automation2.status })
48325
49033
  ] }),
48326
- /* @__PURE__ */ jsx("div", { className: "text-sm text-gray-600", children: "View and edit this email campaign" })
49034
+ /* @__PURE__ */ jsxs("div", { className: "text-sm text-gray-600", children: [
49035
+ "View and edit this ",
49036
+ t("engage:automation")
49037
+ ] })
48327
49038
  ] }),
48328
49039
  renderActionsMenu()
48329
49040
  ] });
@@ -48333,9 +49044,9 @@ const ViewAutomationHeaderContainer = ({
48333
49044
  /* @__PURE__ */ jsx(mergedIconDefinitions.DropdownMenuTrigger, { className: "ml-2 h-4 w-4" })
48334
49045
  ] }) }),
48335
49046
  /* @__PURE__ */ jsxs(DropdownMenuContent, { children: [
48336
- automation.status === AutomationStatus.DRAFT && /* @__PURE__ */ jsx(DropdownMenuItem, { onClick: () => setOpenEditAutomationPopup(true), children: "Edit" }),
48337
- automation.status === AutomationStatus.ACTIVE && /* @__PURE__ */ jsx(DropdownMenuItem, { onClick: convertToDraft, children: "Convert to Draft" }),
48338
- automation.status !== AutomationStatus.COMPLETED && automation.status !== AutomationStatus.FAILED && automation.status !== AutomationStatus.DEACTIVATED && /* @__PURE__ */ jsx(
49047
+ automation2.status === AutomationStatus.DRAFT && /* @__PURE__ */ jsx(DropdownMenuItem, { onClick: () => setOpenEditAutomationPopup(true), children: "Edit" }),
49048
+ automation2.status === AutomationStatus.ACTIVE && /* @__PURE__ */ jsx(DropdownMenuItem, { onClick: convertToDraft, children: "Convert to Draft" }),
49049
+ automation2.status !== AutomationStatus.COMPLETED && automation2.status !== AutomationStatus.FAILED && automation2.status !== AutomationStatus.DEACTIVATED && /* @__PURE__ */ jsx(
48339
49050
  DropdownMenuItem,
48340
49051
  {
48341
49052
  onClick: () => setCancelAutomationConfirmationPopup(true),
@@ -48350,29 +49061,29 @@ const ViewAutomationHeaderContainer = ({
48350
49061
  const renderAutomationDetails = () => /* @__PURE__ */ jsx("div", { className: "@container", children: /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 @[750px]:grid-cols-2 gap-6", children: [
48351
49062
  /* @__PURE__ */ jsxs("div", { className: "", children: [
48352
49063
  /* @__PURE__ */ jsx("div", { className: "text-sm text-muted-foreground", children: "Name" }),
48353
- /* @__PURE__ */ jsx("div", { className: "font-medium truncate", children: automation.name })
49064
+ /* @__PURE__ */ jsx("div", { className: "font-medium truncate", children: automation2.name })
48354
49065
  ] }),
48355
- automation.description && /* @__PURE__ */ jsxs("div", { className: "", children: [
49066
+ automation2.description && /* @__PURE__ */ jsxs("div", { className: "", children: [
48356
49067
  /* @__PURE__ */ jsx("div", { className: "text-sm text-muted-foreground", children: "Description" }),
48357
- /* @__PURE__ */ jsx("div", { className: "font-medium whitespace-pre-wrap", children: automation.description })
49068
+ /* @__PURE__ */ jsx("div", { className: "font-medium whitespace-pre-wrap", children: automation2.description })
48358
49069
  ] }),
48359
49070
  /* @__PURE__ */ jsxs("div", { children: [
48360
49071
  /* @__PURE__ */ jsx("div", { className: "text-sm text-muted-foreground", children: "Date Created" }),
48361
- /* @__PURE__ */ jsx("div", { className: "font-medium", children: format$1(new Date(automation.created_at), "h:mma MM/dd/yy") })
49072
+ /* @__PURE__ */ jsx("div", { className: "font-medium", children: format$1(new Date(automation2.created_at), "h:mma MM/dd/yy") })
48362
49073
  ] }),
48363
- automation.trigger_type === AutomationTriggerType.ONE_TIME && isOneTimeTriggerMetadata(automation.trigger_metadata) && /* @__PURE__ */ jsxs("div", { children: [
49074
+ automation2.trigger_type === AutomationTriggerType.ONE_TIME && isOneTimeTriggerMetadata(automation2.trigger_metadata) && /* @__PURE__ */ jsxs("div", { children: [
48364
49075
  /* @__PURE__ */ jsx("div", { className: "text-sm text-muted-foreground", children: "Type" }),
48365
49076
  /* @__PURE__ */ jsx("div", { className: "font-medium", children: "One Time" })
48366
49077
  ] }),
48367
- automation.trigger_type === AutomationTriggerType.TRIGGER_BASED && isTriggerBasedTriggerMetadata(automation.trigger_metadata) && /* @__PURE__ */ jsxs("div", { children: [
49078
+ automation2.trigger_type === AutomationTriggerType.TRIGGER_BASED && isTriggerBasedTriggerMetadata(automation2.trigger_metadata) && /* @__PURE__ */ jsxs("div", { children: [
48368
49079
  /* @__PURE__ */ jsx("div", { className: "text-sm text-muted-foreground", children: "Type" }),
48369
49080
  /* @__PURE__ */ jsx("div", { className: "font-medium", children: "Trigger Based" })
48370
49081
  ] }),
48371
49082
  /* @__PURE__ */ jsx("div", { className: "col-span-1 @[400px]:col-span-2", children: /* @__PURE__ */ jsx("div", { className: "border-t border-gray-200" }) }),
48372
- automation.trigger_type === AutomationTriggerType.ONE_TIME && isOneTimeTriggerMetadata(automation.trigger_metadata) && automation.trigger_metadata.scheduled_at && /* @__PURE__ */ jsxs("div", { children: [
49083
+ automation2.trigger_type === AutomationTriggerType.ONE_TIME && isOneTimeTriggerMetadata(automation2.trigger_metadata) && automation2.trigger_metadata.scheduled_at && /* @__PURE__ */ jsxs("div", { children: [
48373
49084
  /* @__PURE__ */ jsx("div", { className: "text-sm text-gray-600", children: "Scheduled For" }),
48374
49085
  /* @__PURE__ */ jsx("div", { className: "font-medium", children: format$1(
48375
- new Date(automation.trigger_metadata.scheduled_at),
49086
+ new Date(automation2.trigger_metadata.scheduled_at),
48376
49087
  "h:mma MM/dd/yy"
48377
49088
  ) })
48378
49089
  ] })
@@ -48408,7 +49119,7 @@ const ViewAutomationContent = ({
48408
49119
  const shouldAutoOpenEditPopup = autoOpenEditPopup || searchParams.get("autoOpenEditPopup");
48409
49120
  const shouldShowBackButton = searchParams.get("showBackButton") === "true" || showBackButton;
48410
49121
  const {
48411
- automation,
49122
+ automation: automation2,
48412
49123
  updateAutomation: updateAutomation2,
48413
49124
  communicationGroup,
48414
49125
  updateCommunicationGroup: updateCommunicationGroup2,
@@ -48418,14 +49129,14 @@ const ViewAutomationContent = ({
48418
49129
  validateStep,
48419
49130
  estimatedMatchesStats
48420
49131
  } = useAutomation(effectiveAutomationId);
48421
- if (!automation || !communicationGroup) {
49132
+ if (!automation2 || !communicationGroup) {
48422
49133
  return /* @__PURE__ */ jsx("div", { className: "flex h-screen items-center justify-center", children: /* @__PURE__ */ jsx(SpinLoader, { text: ["Fetching Automation data", "Finishing up"] }) });
48423
49134
  }
48424
49135
  return /* @__PURE__ */ jsxs("div", { className: "bg-background", children: [
48425
49136
  /* @__PURE__ */ jsx(
48426
49137
  ViewAutomationHeader,
48427
49138
  {
48428
- automation,
49139
+ automation: automation2,
48429
49140
  updateAutomation: updateAutomation2,
48430
49141
  communicationGroup,
48431
49142
  updateCommunicationGroup: updateCommunicationGroup2,
@@ -48465,9 +49176,9 @@ const ViewAutomationContent = ({
48465
49176
  content: /* @__PURE__ */ jsx(
48466
49177
  AutomationRecipients,
48467
49178
  {
48468
- automationId: automation.id,
49179
+ automationId: automation2.id,
48469
49180
  iconDefinitions: finalIconDefinitions,
48470
- automation,
49181
+ automation: automation2,
48471
49182
  isLoading
48472
49183
  }
48473
49184
  )