@embedreach/components 0.3.39 → 0.3.40

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.
@@ -31555,6 +31555,7 @@ const statusDraft = "reach-styles-module__statusDraft___3BUrD";
31555
31555
  const statusDeactivated = "reach-styles-module__statusDeactivated___xVw1N";
31556
31556
  const statusFailed = "reach-styles-module__statusFailed___VQiDA";
31557
31557
  const statusRunning = "reach-styles-module__statusRunning___1iEjx";
31558
+ const statusSending = "reach-styles-module__statusSending___ZPEvQ";
31558
31559
  const statusScheduled = "reach-styles-module__statusScheduled___jsdbl";
31559
31560
  const statusQueued = "reach-styles-module__statusQueued___lYgbS";
31560
31561
  const statusPartiallyCancelled = "reach-styles-module__statusPartiallyCancelled___yLZUc";
@@ -31585,6 +31586,7 @@ const styles$6 = {
31585
31586
  statusDeactivated,
31586
31587
  statusFailed,
31587
31588
  statusRunning,
31589
+ statusSending,
31588
31590
  statusScheduled,
31589
31591
  statusQueued,
31590
31592
  statusPartiallyCancelled,
@@ -31611,6 +31613,7 @@ const badgeVariants = cva([styles$6.base], {
31611
31613
  statusDeactivated: styles$6.statusDeactivated,
31612
31614
  statusFailed: styles$6.statusFailed,
31613
31615
  statusRunning: styles$6.statusRunning,
31616
+ statusSending: styles$6.statusSending,
31614
31617
  segmentAllUsers: styles$6.segmentAllUsers,
31615
31618
  segmentManaged: styles$6.segmentManaged,
31616
31619
  segmentCustom: styles$6.segmentCustom,
@@ -32048,6 +32051,22 @@ const useDirectFeedbackEnabled = () => {
32048
32051
  const reputationConfig = partner?.feature_customizations?.reputation;
32049
32052
  return reputationConfig?.directFeedbackEnabled ?? true;
32050
32053
  };
32054
+ const useSmsEnabled = () => {
32055
+ const { config } = useConfig();
32056
+ const { data: partner } = usePartner$1();
32057
+ const mergedConfig = mergeFeatureConfig(
32058
+ {
32059
+ hideFeature: config.hideFeature,
32060
+ enableFeature: config.enableFeature
32061
+ },
32062
+ {
32063
+ hideFeature: partner?.feature_customizations?.hideFeature,
32064
+ enableFeature: partner?.feature_customizations?.enableFeature
32065
+ }
32066
+ );
32067
+ const isHidden2 = mergedConfig.hideFeature?.engage?.sms;
32068
+ return !isHidden2;
32069
+ };
32051
32070
  const ReputationMethodologyDialogContent = () => {
32052
32071
  const isDirectFeedbackEnabled = useDirectFeedbackEnabled();
32053
32072
  const containerVariants = {
@@ -35768,6 +35787,7 @@ var SmsRegistrationApplicationStatus = /* @__PURE__ */ ((SmsRegistrationApplicat
35768
35787
  SmsRegistrationApplicationStatus2["IN_REVIEW"] = "in_review";
35769
35788
  SmsRegistrationApplicationStatus2["APPROVED"] = "approved";
35770
35789
  SmsRegistrationApplicationStatus2["REJECTED"] = "rejected";
35790
+ SmsRegistrationApplicationStatus2["ARCHIVED"] = "archived";
35771
35791
  return SmsRegistrationApplicationStatus2;
35772
35792
  })(SmsRegistrationApplicationStatus || {});
35773
35793
  const getSmsChannelSenders = (args) => {
@@ -37291,9 +37311,10 @@ const useAutomationSelection = () => {
37291
37311
  },
37292
37312
  onError: (error2) => {
37293
37313
  console.error("Error updating automations:", error2);
37314
+ const errorMessage = error2 instanceof Error ? error2.message : "Please try again.";
37294
37315
  toast2({
37295
37316
  title: "Error updating automations",
37296
- description: "Please try again.",
37317
+ description: errorMessage,
37297
37318
  variant: "destructive"
37298
37319
  });
37299
37320
  }
@@ -65961,6 +65982,7 @@ const measure$1 = {
65961
65982
  columns: {
65962
65983
  campaign: "Campaign",
65963
65984
  client: "Client",
65985
+ keyword: "Keyword",
65964
65986
  first_marketing_click_date: "First Marketing Click Date",
65965
65987
  source: "Source",
65966
65988
  total_amount: "Total Amount"
@@ -66816,6 +66838,7 @@ const measure = {
66816
66838
  columns: {
66817
66839
  campaign: "Campaña",
66818
66840
  client: "Cliente",
66841
+ keyword: "Palabra clave",
66819
66842
  first_marketing_click_date: "Fecha del primer clic de marketing",
66820
66843
  source: "Fuente",
66821
66844
  total_amount: "Cantidad total"
@@ -67759,6 +67782,7 @@ const defaultTranslations = {
67759
67782
  columns: {
67760
67783
  campaign: "Campaign",
67761
67784
  client: "Client",
67785
+ keyword: "Keyword",
67762
67786
  first_marketing_click_date: "First Marketing Click Date",
67763
67787
  source: "Source",
67764
67788
  total_amount: "Total Amount"
@@ -69623,39 +69647,448 @@ const previewSegmentRecipients = async (params) => {
69623
69647
  pagination: result.data.pagination
69624
69648
  };
69625
69649
  };
69626
- var JSONSchemaType = /* @__PURE__ */ ((JSONSchemaType2) => {
69650
+ var DateUnit;
69651
+ (function(DateUnit2) {
69652
+ DateUnit2["DAYS"] = "days";
69653
+ })(DateUnit || (DateUnit = {}));
69654
+ var RelativeDateDirection;
69655
+ (function(RelativeDateDirection2) {
69656
+ RelativeDateDirection2["BEFORE"] = "before";
69657
+ RelativeDateDirection2["AFTER"] = "after";
69658
+ })(RelativeDateDirection || (RelativeDateDirection = {}));
69659
+ const ConditionFieldEnum = z$2.enum([
69660
+ "userId",
69661
+ "email",
69662
+ "phone",
69663
+ "firstName",
69664
+ "lastName"
69665
+ ]);
69666
+ const sqlSegmentConditionSchema = z$2.object({
69667
+ sql_segment_id: z$2.string()
69668
+ });
69669
+ var ConditionOperatorEnumType;
69670
+ (function(ConditionOperatorEnumType2) {
69671
+ ConditionOperatorEnumType2["EQUALS"] = "equals";
69672
+ ConditionOperatorEnumType2["NOT_EQUALS"] = "not_equals";
69673
+ ConditionOperatorEnumType2["GREATER_THAN"] = "greater_than";
69674
+ ConditionOperatorEnumType2["LESS_THAN"] = "less_than";
69675
+ ConditionOperatorEnumType2["EXISTS"] = "exists";
69676
+ ConditionOperatorEnumType2["NOT_EXISTS"] = "not_exists";
69677
+ ConditionOperatorEnumType2["EQUALS_MONTH_DAY"] = "equals_month_day";
69678
+ ConditionOperatorEnumType2["EQUALS_MONTH_DAY_YEAR"] = "equals_month_day_year";
69679
+ ConditionOperatorEnumType2["BETWEEN_MONTH_DAY"] = "between_month_day";
69680
+ ConditionOperatorEnumType2["BETWEEN_MONTH_DAY_YEAR"] = "between_month_day_year";
69681
+ ConditionOperatorEnumType2["ARRAY_CONTAINS"] = "array_contains";
69682
+ })(ConditionOperatorEnumType || (ConditionOperatorEnumType = {}));
69683
+ const ConditionOperatorEnum = z$2.nativeEnum(ConditionOperatorEnumType);
69684
+ const relativeDateSchema = z$2.object({
69685
+ type: z$2.literal("relative"),
69686
+ value: z$2.number().describe("Number of days to add/subtract from today"),
69687
+ unit: z$2.nativeEnum(DateUnit),
69688
+ direction: z$2.nativeEnum(RelativeDateDirection)
69689
+ });
69690
+ const betweenDateSchema = z$2.object({
69691
+ startDate: z$2.union([z$2.coerce.date(), relativeDateSchema]),
69692
+ endDate: z$2.union([z$2.coerce.date(), relativeDateSchema])
69693
+ });
69694
+ const fieldConditionSchema = z$2.object({
69695
+ field: z$2.union([ConditionFieldEnum, z$2.string()]),
69696
+ value: z$2.array(z$2.union([
69697
+ z$2.string(),
69698
+ z$2.number(),
69699
+ z$2.boolean(),
69700
+ z$2.date(),
69701
+ relativeDateSchema,
69702
+ betweenDateSchema
69703
+ ])).describe("The value to compare the field against (string, number, boolean, date)"),
69704
+ operator: ConditionOperatorEnum
69705
+ });
69706
+ function isFieldCondition(condition) {
69707
+ return "field" in condition;
69708
+ }
69709
+ const ConditionSchema = z$2.union([
69710
+ fieldConditionSchema,
69711
+ sqlSegmentConditionSchema
69712
+ ]);
69713
+ z$2.array(fieldConditionSchema);
69714
+ z$2.array(ConditionSchema);
69715
+ var CurrencyCode;
69716
+ (function(CurrencyCode2) {
69717
+ CurrencyCode2["USD"] = "USD";
69718
+ CurrencyCode2["CAD"] = "CAD";
69719
+ CurrencyCode2["EUR"] = "EUR";
69720
+ CurrencyCode2["AED"] = "AED";
69721
+ CurrencyCode2["AFN"] = "AFN";
69722
+ CurrencyCode2["ALL"] = "ALL";
69723
+ CurrencyCode2["AMD"] = "AMD";
69724
+ CurrencyCode2["ARS"] = "ARS";
69725
+ CurrencyCode2["AUD"] = "AUD";
69726
+ CurrencyCode2["AZN"] = "AZN";
69727
+ CurrencyCode2["BAM"] = "BAM";
69728
+ CurrencyCode2["BDT"] = "BDT";
69729
+ CurrencyCode2["BGN"] = "BGN";
69730
+ CurrencyCode2["BHD"] = "BHD";
69731
+ CurrencyCode2["BIF"] = "BIF";
69732
+ CurrencyCode2["BND"] = "BND";
69733
+ CurrencyCode2["BOB"] = "BOB";
69734
+ CurrencyCode2["BRL"] = "BRL";
69735
+ CurrencyCode2["BWP"] = "BWP";
69736
+ CurrencyCode2["BYN"] = "BYN";
69737
+ CurrencyCode2["BZD"] = "BZD";
69738
+ CurrencyCode2["CDF"] = "CDF";
69739
+ CurrencyCode2["CHF"] = "CHF";
69740
+ CurrencyCode2["CLP"] = "CLP";
69741
+ CurrencyCode2["CNY"] = "CNY";
69742
+ CurrencyCode2["COP"] = "COP";
69743
+ CurrencyCode2["CRC"] = "CRC";
69744
+ CurrencyCode2["CVE"] = "CVE";
69745
+ CurrencyCode2["CZK"] = "CZK";
69746
+ CurrencyCode2["DJF"] = "DJF";
69747
+ CurrencyCode2["DKK"] = "DKK";
69748
+ CurrencyCode2["DOP"] = "DOP";
69749
+ CurrencyCode2["DZD"] = "DZD";
69750
+ CurrencyCode2["EEK"] = "EEK";
69751
+ CurrencyCode2["EGP"] = "EGP";
69752
+ CurrencyCode2["ERN"] = "ERN";
69753
+ CurrencyCode2["ETB"] = "ETB";
69754
+ CurrencyCode2["GBP"] = "GBP";
69755
+ CurrencyCode2["GEL"] = "GEL";
69756
+ CurrencyCode2["GHS"] = "GHS";
69757
+ CurrencyCode2["GNF"] = "GNF";
69758
+ CurrencyCode2["GTQ"] = "GTQ";
69759
+ CurrencyCode2["HKD"] = "HKD";
69760
+ CurrencyCode2["HNL"] = "HNL";
69761
+ CurrencyCode2["HRK"] = "HRK";
69762
+ CurrencyCode2["HUF"] = "HUF";
69763
+ CurrencyCode2["IDR"] = "IDR";
69764
+ CurrencyCode2["ILS"] = "ILS";
69765
+ CurrencyCode2["INR"] = "INR";
69766
+ CurrencyCode2["IQD"] = "IQD";
69767
+ CurrencyCode2["IRR"] = "IRR";
69768
+ CurrencyCode2["ISK"] = "ISK";
69769
+ CurrencyCode2["JMD"] = "JMD";
69770
+ CurrencyCode2["JOD"] = "JOD";
69771
+ CurrencyCode2["JPY"] = "JPY";
69772
+ CurrencyCode2["KES"] = "KES";
69773
+ CurrencyCode2["KHR"] = "KHR";
69774
+ CurrencyCode2["KMF"] = "KMF";
69775
+ CurrencyCode2["KRW"] = "KRW";
69776
+ CurrencyCode2["KWD"] = "KWD";
69777
+ CurrencyCode2["KZT"] = "KZT";
69778
+ CurrencyCode2["LBP"] = "LBP";
69779
+ CurrencyCode2["LKR"] = "LKR";
69780
+ CurrencyCode2["LTL"] = "LTL";
69781
+ CurrencyCode2["LVL"] = "LVL";
69782
+ CurrencyCode2["LYD"] = "LYD";
69783
+ CurrencyCode2["MAD"] = "MAD";
69784
+ CurrencyCode2["MDL"] = "MDL";
69785
+ CurrencyCode2["MGA"] = "MGA";
69786
+ CurrencyCode2["MKD"] = "MKD";
69787
+ CurrencyCode2["MMK"] = "MMK";
69788
+ CurrencyCode2["MOP"] = "MOP";
69789
+ CurrencyCode2["MUR"] = "MUR";
69790
+ CurrencyCode2["MXN"] = "MXN";
69791
+ CurrencyCode2["MYR"] = "MYR";
69792
+ CurrencyCode2["MZN"] = "MZN";
69793
+ CurrencyCode2["NAD"] = "NAD";
69794
+ CurrencyCode2["NGN"] = "NGN";
69795
+ CurrencyCode2["NIO"] = "NIO";
69796
+ CurrencyCode2["NOK"] = "NOK";
69797
+ CurrencyCode2["NPR"] = "NPR";
69798
+ CurrencyCode2["NZD"] = "NZD";
69799
+ CurrencyCode2["OMR"] = "OMR";
69800
+ CurrencyCode2["PAB"] = "PAB";
69801
+ CurrencyCode2["PEN"] = "PEN";
69802
+ CurrencyCode2["PHP"] = "PHP";
69803
+ CurrencyCode2["PKR"] = "PKR";
69804
+ CurrencyCode2["PLN"] = "PLN";
69805
+ CurrencyCode2["PYG"] = "PYG";
69806
+ CurrencyCode2["QAR"] = "QAR";
69807
+ CurrencyCode2["RON"] = "RON";
69808
+ CurrencyCode2["RSD"] = "RSD";
69809
+ CurrencyCode2["RUB"] = "RUB";
69810
+ CurrencyCode2["RWF"] = "RWF";
69811
+ CurrencyCode2["SAR"] = "SAR";
69812
+ CurrencyCode2["SDG"] = "SDG";
69813
+ CurrencyCode2["SEK"] = "SEK";
69814
+ CurrencyCode2["SGD"] = "SGD";
69815
+ CurrencyCode2["SOS"] = "SOS";
69816
+ CurrencyCode2["SYP"] = "SYP";
69817
+ CurrencyCode2["THB"] = "THB";
69818
+ CurrencyCode2["TND"] = "TND";
69819
+ CurrencyCode2["TOP"] = "TOP";
69820
+ CurrencyCode2["TRY"] = "TRY";
69821
+ CurrencyCode2["TTD"] = "TTD";
69822
+ CurrencyCode2["TWD"] = "TWD";
69823
+ CurrencyCode2["TZS"] = "TZS";
69824
+ CurrencyCode2["UAH"] = "UAH";
69825
+ CurrencyCode2["UGX"] = "UGX";
69826
+ CurrencyCode2["UYU"] = "UYU";
69827
+ CurrencyCode2["UZS"] = "UZS";
69828
+ CurrencyCode2["VEF"] = "VEF";
69829
+ CurrencyCode2["VND"] = "VND";
69830
+ CurrencyCode2["XAF"] = "XAF";
69831
+ CurrencyCode2["XOF"] = "XOF";
69832
+ CurrencyCode2["YER"] = "YER";
69833
+ CurrencyCode2["ZAR"] = "ZAR";
69834
+ CurrencyCode2["ZMK"] = "ZMK";
69835
+ CurrencyCode2["ZWL"] = "ZWL";
69836
+ })(CurrencyCode || (CurrencyCode = {}));
69837
+ const jsonLogicSchema = z$2.union([
69838
+ z$2.boolean(),
69839
+ z$2.string(),
69840
+ z$2.number(),
69841
+ z$2.null(),
69842
+ z$2.record(z$2.any()),
69843
+ z$2.array(z$2.any())
69844
+ ]);
69845
+ const schemaMappingEnum = z$2.enum([
69846
+ "contacts_schema",
69847
+ "transactions_schema",
69848
+ "custom_schema",
69849
+ "combined_schema",
69850
+ // this is a combined schema that contains both contacts and transactions data
69851
+ "locations_schema",
69852
+ /**
69853
+ * This is a schema that contains customer fields for a business (e.g. number of dogs owned, etc.)
69854
+ */
69855
+ "customer_fields"
69856
+ ]);
69857
+ var JSONSchemaType;
69858
+ (function(JSONSchemaType2) {
69627
69859
  JSONSchemaType2["String"] = "string";
69628
69860
  JSONSchemaType2["Number"] = "number";
69629
69861
  JSONSchemaType2["Integer"] = "integer";
69630
69862
  JSONSchemaType2["Boolean"] = "boolean";
69863
+ JSONSchemaType2["Array"] = "array";
69631
69864
  JSONSchemaType2["Date"] = "date";
69632
69865
  JSONSchemaType2["DateTime"] = "date-time";
69633
- JSONSchemaType2["Array"] = "array";
69634
69866
  JSONSchemaType2["ReachResource"] = "reach-resource";
69635
- return JSONSchemaType2;
69636
- })(JSONSchemaType || {});
69637
- var BusinessSegmentTypeEnum = /* @__PURE__ */ ((BusinessSegmentTypeEnum2) => {
69867
+ })(JSONSchemaType || (JSONSchemaType = {}));
69868
+ const contactStatusSchema = z$2.object({
69869
+ field: z$2.string(),
69870
+ activeValue: z$2.string(),
69871
+ deactivatedValue: z$2.string()
69872
+ });
69873
+ const contactSourceSchema = z$2.object({
69874
+ type: z$2.literal(schemaMappingEnum.enum.contacts_schema),
69875
+ schemaId: z$2.string().uuid("schemaID must be a UUID referencing a schema definition of type contacts_schema"),
69876
+ email: z$2.string().optional(),
69877
+ phone: z$2.string().optional(),
69878
+ userId: z$2.string().min(1, "User ID field is required"),
69879
+ firstName: z$2.string().optional(),
69880
+ lastName: z$2.string().optional(),
69881
+ fullName: z$2.string().optional(),
69882
+ location: z$2.string().optional(),
69883
+ status: contactStatusSchema.optional(),
69884
+ createdDate: z$2.string().min(1, "Created date field is required"),
69885
+ emailOptOut: z$2.string().optional(),
69886
+ emailOptIn: z$2.string().optional(),
69887
+ emailOptOutTimestamp: z$2.string().optional(),
69888
+ smsOptOut: z$2.string().optional(),
69889
+ smsOptIn: z$2.string().optional(),
69890
+ urlPattern: z$2.string().optional(),
69891
+ smsOptOutTimestamp: z$2.string().optional()
69892
+ }).refine((data) => {
69893
+ const hasFirstAndLast = data.firstName && data.lastName;
69894
+ const hasFullName = data.fullName;
69895
+ return hasFirstAndLast || hasFullName;
69896
+ }, {
69897
+ message: "Either both first name and last name, or full name must be provided",
69898
+ path: ["firstName"]
69899
+ // This will show the error on the firstName field
69900
+ }).refine((data) => {
69901
+ const hasEmail = data.email && data.email.trim().length > 0;
69902
+ const hasPhone = data.phone && data.phone.trim().length > 0;
69903
+ return hasEmail || hasPhone;
69904
+ }, {
69905
+ message: "Either email or phone (or both) must be provided",
69906
+ path: ["email"]
69907
+ // This will show the error on the email field
69908
+ });
69909
+ const locationSourceSchema = z$2.object({
69910
+ type: z$2.literal(schemaMappingEnum.enum.locations_schema),
69911
+ schemaId: z$2.string().uuid("schemaID must be a UUID referencing a schema definition of type locations_schema"),
69912
+ id_field: z$2.string().min(1, "ID field is required"),
69913
+ name: z$2.string().optional(),
69914
+ address_line_1: z$2.string().optional(),
69915
+ address_line_2: z$2.string().optional(),
69916
+ address_line_3: z$2.string().optional(),
69917
+ locality: z$2.string().optional(),
69918
+ district: z$2.string().optional(),
69919
+ postal_code: z$2.string().optional(),
69920
+ country_code: z$2.string().optional(),
69921
+ phone: z$2.string().optional(),
69922
+ email: z$2.string().optional(),
69923
+ website: z$2.string().optional(),
69924
+ urlPattern: z$2.string().optional()
69925
+ });
69926
+ const contactSchemaMappingSchema = z$2.object({
69927
+ primarySource: contactSourceSchema,
69928
+ additionalSources: z$2.array(contactSourceSchema).optional()
69929
+ });
69930
+ const billableEventFilterConditionSchema = z$2.object({
69931
+ path: z$2.string().describe('Dot notation path to the value, e.g., "primaryServiceType.serviceType.isVisit"'),
69932
+ operator: z$2.enum([
69933
+ "eq",
69934
+ "neq",
69935
+ "gt",
69936
+ "lt",
69937
+ "gte",
69938
+ "lte",
69939
+ "exists",
69940
+ "not_exists"
69941
+ ]),
69942
+ value: z$2.any().describe('The value to compare against. Not used for "exists" and "not_exists"')
69943
+ });
69944
+ z$2.object({
69945
+ logicalOperator: z$2.enum(["AND", "OR"]).default("AND"),
69946
+ conditions: z$2.array(billableEventFilterConditionSchema)
69947
+ });
69948
+ const transactionAmountSchema = z$2.object({
69949
+ field: z$2.string().min(1, "Amount field is required"),
69950
+ // the field that contains the amount
69951
+ currencyField: z$2.string().optional(),
69952
+ // the field that contains the currency
69953
+ currency: z$2.nativeEnum(CurrencyCode).optional()
69954
+ // the currency of the amount (If has currency field, this is ignored)
69955
+ });
69956
+ const transactionDatesSchema = z$2.object({
69957
+ createdDate: z$2.string().optional(),
69958
+ paidDate: z$2.string().optional(),
69959
+ dueDate: z$2.string().optional(),
69960
+ startDate: z$2.string().optional(),
69961
+ endDate: z$2.string().optional()
69962
+ });
69963
+ const transactionSchema = z$2.object({
69964
+ type: z$2.literal(schemaMappingEnum.enum.transactions_schema),
69965
+ eventType: z$2.string(),
69966
+ schemaId: z$2.string().uuid("schemaID must be a UUID referencing a schema definition of type transactions_schema"),
69967
+ id_field: z$2.string().min(1, "ID field is required"),
69968
+ userId: z$2.string().min(1, "User ID field is required"),
69969
+ amount: transactionAmountSchema,
69970
+ dates: transactionDatesSchema,
69971
+ locationId: z$2.string().optional().describe("Location ID field"),
69972
+ metadata: z$2.array(z$2.string()).optional(),
69973
+ filter: jsonLogicSchema.optional().describe("JSONLogic rule to conditionally create billable events from resources. See: https://jsonlogic.com/"),
69974
+ urlPattern: z$2.string().optional()
69975
+ });
69976
+ const customEventSchema = z$2.object({
69977
+ type: z$2.literal(schemaMappingEnum.enum.custom_schema),
69978
+ id_field: z$2.string().min(1, "ID field is required"),
69979
+ date: z$2.string().min(1, "Date field is required"),
69980
+ userId: z$2.string().min(1, "User ID field is required"),
69981
+ metadata: z$2.array(z$2.string()).optional(),
69982
+ schemaId: z$2.string().min(1, "Schema ID is required")
69983
+ });
69984
+ z$2.object({
69985
+ type: z$2.literal(schemaMappingEnum.enum.combined_schema),
69986
+ contactsSchema: contactSchemaMappingSchema.optional(),
69987
+ transactionsSchema: z$2.array(transactionSchema).optional(),
69988
+ customSchema: z$2.array(customEventSchema).optional(),
69989
+ locationsSchema: z$2.array(locationSourceSchema).optional()
69990
+ });
69991
+ var BusinessSegmentTypeEnum;
69992
+ (function(BusinessSegmentTypeEnum2) {
69638
69993
  BusinessSegmentTypeEnum2["ALL_USERS"] = "all_users";
69639
69994
  BusinessSegmentTypeEnum2["MANAGED"] = "managed";
69640
69995
  BusinessSegmentTypeEnum2["CUSTOM"] = "custom";
69641
69996
  BusinessSegmentTypeEnum2["ONE_OFF"] = "one_off";
69642
69997
  BusinessSegmentTypeEnum2["SQL"] = "sql";
69643
- return BusinessSegmentTypeEnum2;
69644
- })(BusinessSegmentTypeEnum || {});
69645
- var ConditionOperatorEnumType = /* @__PURE__ */ ((ConditionOperatorEnumType2) => {
69646
- ConditionOperatorEnumType2["EQUALS"] = "equals";
69647
- ConditionOperatorEnumType2["NOT_EQUALS"] = "not_equals";
69648
- ConditionOperatorEnumType2["GREATER_THAN"] = "greater_than";
69649
- ConditionOperatorEnumType2["LESS_THAN"] = "less_than";
69650
- ConditionOperatorEnumType2["EXISTS"] = "exists";
69651
- ConditionOperatorEnumType2["NOT_EXISTS"] = "not_exists";
69652
- ConditionOperatorEnumType2["EQUALS_MONTH_DAY"] = "equals_month_day";
69653
- ConditionOperatorEnumType2["EQUALS_MONTH_DAY_YEAR"] = "equals_month_day_year";
69654
- ConditionOperatorEnumType2["BETWEEN_MONTH_DAY"] = "between_month_day";
69655
- ConditionOperatorEnumType2["BETWEEN_MONTH_DAY_YEAR"] = "between_month_day_year";
69656
- ConditionOperatorEnumType2["ARRAY_CONTAINS"] = "array_contains";
69657
- return ConditionOperatorEnumType2;
69658
- })(ConditionOperatorEnumType || {});
69998
+ })(BusinessSegmentTypeEnum || (BusinessSegmentTypeEnum = {}));
69999
+ z$2.object({
70000
+ name: z$2.string().describe("A friendly name for the segment"),
70001
+ description: z$2.string().describe("A friendly description for the segment").optional(),
70002
+ conditions: z$2.array(ConditionSchema).describe("The conditions to include in the segment"),
70003
+ type: z$2.enum([BusinessSegmentTypeEnum.CUSTOM, BusinessSegmentTypeEnum.ONE_OFF]).describe("The type of segment").default(BusinessSegmentTypeEnum.CUSTOM).optional()
70004
+ });
70005
+ z$2.object({
70006
+ id: z$2.string().describe("The id of the segment"),
70007
+ name: z$2.string().describe("A friendly name for the segment"),
70008
+ description: z$2.string().describe("A friendly description for the segment").optional(),
70009
+ createdAt: z$2.date().nullable().describe("The date and time the segment was created"),
70010
+ type: z$2.nativeEnum(BusinessSegmentTypeEnum).describe("The type of segment")
70011
+ });
70012
+ z$2.object({
70013
+ name: z$2.string().optional().describe("A friendly name for the segment"),
70014
+ description: z$2.string().optional().describe("A friendly description for the segment"),
70015
+ conditions: z$2.array(ConditionSchema).optional().describe("The conditions to include in the segment")
70016
+ });
70017
+ z$2.object({
70018
+ id: z$2.string().describe("The id of the segment"),
70019
+ name: z$2.string().describe("A friendly name for the segment"),
70020
+ description: z$2.string().describe("A friendly description for the segment").optional(),
70021
+ createdAt: z$2.date().nullable().describe("The date and time the segment was created"),
70022
+ type: z$2.nativeEnum(BusinessSegmentTypeEnum).describe("The type of segment")
70023
+ });
70024
+ z$2.object({
70025
+ results: z$2.array(z$2.object({
70026
+ id: z$2.string().describe("The id of the segment"),
70027
+ name: z$2.string().describe("A friendly name for the segment"),
70028
+ description: z$2.string().describe("A friendly description for the segment").optional(),
70029
+ createdAt: z$2.date().nullable().describe("The date and time the segment was created"),
70030
+ type: z$2.nativeEnum(BusinessSegmentTypeEnum).describe("The type of segment"),
70031
+ userCount: z$2.number().describe("The number of users in the segment"),
70032
+ phoneCount: z$2.number().describe("The number of phone numbers in the segment"),
70033
+ emailCount: z$2.number().describe("The number of emails in the segment"),
70034
+ userCountUpdatedAt: z$2.date().describe("The date and time the user count was updated")
70035
+ })).describe("The segments"),
70036
+ pagination: z$2.object({
70037
+ hasNextPage: z$2.boolean().nullable().describe("Whether there is a next page"),
70038
+ cursor: z$2.string().nullable().describe("The cursor to start from"),
70039
+ total: z$2.number().nullable().describe("The total number of segments")
70040
+ })
70041
+ });
70042
+ z$2.object({
70043
+ id: z$2.string().describe("The id of the segment"),
70044
+ name: z$2.string().describe("A friendly name for the segment"),
70045
+ description: z$2.string().describe("A friendly description for the segment").optional(),
70046
+ createdAt: z$2.date().nullable().describe("The date and time the segment was created"),
70047
+ type: z$2.nativeEnum(BusinessSegmentTypeEnum).describe("The type of segment"),
70048
+ conditions: z$2.array(ConditionSchema).describe("The conditions to include in the segment")
70049
+ });
70050
+ z$2.object({
70051
+ conditions: z$2.array(z$2.object({
70052
+ field: z$2.string().describe("The field to include in the segment"),
70053
+ operators: z$2.array(ConditionOperatorEnum).describe("The operators to include in the segment"),
70054
+ type: z$2.nativeEnum(JSONSchemaType).describe("The type of segment"),
70055
+ itemType: z$2.nativeEnum(JSONSchemaType).optional().describe("If the type is an array, this is the type of the items"),
70056
+ options: z$2.array(z$2.object({
70057
+ displayName: z$2.string().describe("The display name of the option"),
70058
+ id: z$2.string().describe("The id of the option")
70059
+ })).optional().describe("The options to include in the segment"),
70060
+ description: z$2.string().optional().describe("The description of the condition")
70061
+ })).describe("The conditions to include in the segment")
70062
+ });
70063
+ z$2.object({
70064
+ count: z$2.number().describe("The number of users in the segment"),
70065
+ recipients: z$2.array(z$2.object({
70066
+ firstName: z$2.string().nullable().describe("The first name of the recipient"),
70067
+ lastName: z$2.string().nullable().describe("The last name of the recipient"),
70068
+ email: z$2.string().nullable().describe("The email of the recipient"),
70069
+ phone: z$2.string().nullable().describe("The phone of the recipient"),
70070
+ id: z$2.string().nullable().describe("The reach id of the recipient"),
70071
+ externalId: z$2.string().nullable().describe("The external id of the recipient"),
70072
+ emailOptedOut: z$2.boolean().optional().describe("Whether the user has opted out of email"),
70073
+ smsOptedOut: z$2.boolean().optional().describe("Whether the user has opted out of SMS")
70074
+ })).describe("The recipients in the segment (paginated)"),
70075
+ pagination: z$2.object({
70076
+ hasNextPage: z$2.boolean().describe("Whether there are more pages"),
70077
+ cursor: z$2.string().nullable().describe("Cursor for the next page (null if no more pages)")
70078
+ }).describe("Pagination metadata")
70079
+ });
70080
+ z$2.object({
70081
+ success: z$2.boolean().describe("Whether the text to segment was successful"),
70082
+ failureReason: z$2.string().optional().describe("The reason the text to segment was not successful."),
70083
+ conditions: z$2.array(ConditionSchema).optional().describe("The conditions to include in the segment. If the text to segment was not successful, this will be null"),
70084
+ title: z$2.string().optional().describe("A suggested title for the segment generated by AI"),
70085
+ description: z$2.string().optional().describe("A suggested description for the segment generated by AI")
70086
+ });
70087
+ z$2.object({
70088
+ cursor: z$2.string().optional().describe("The cursor to start from"),
70089
+ limit: z$2.coerce.number().optional().describe("The limit of items to return, default is 100"),
70090
+ search: z$2.string().optional().describe("The search query to filter by segment name")
70091
+ });
69659
70092
  const segmentKeys = {
69660
70093
  all: ["segments"],
69661
70094
  lists: (params) => [
@@ -69756,11 +70189,26 @@ const useGetCountOfBusinessAutomationRecipientsDebounced = (includeSegments, exc
69756
70189
  const [debouncedIncludeSegments, setDebouncedIncludeSegments] = useState(includeSegments);
69757
70190
  const [debouncedExcludeSegments, setDebouncedExcludeSegments] = useState(excludeSegments);
69758
70191
  const [debouncedSearch, setDebouncedSearch] = useState(options?.search || "");
70192
+ const [accumulatedRecipients, setAccumulatedRecipients] = useState([]);
70193
+ const [currentCursor, setCurrentCursor] = useState(
70194
+ options?.cursor
70195
+ );
70196
+ const includeSegmentsKey = JSON.stringify(debouncedIncludeSegments);
70197
+ const excludeSegmentsKey = JSON.stringify(debouncedExcludeSegments);
70198
+ useEffect(() => {
70199
+ setAccumulatedRecipients([]);
70200
+ setCurrentCursor(void 0);
70201
+ }, [
70202
+ includeSegmentsKey,
70203
+ excludeSegmentsKey,
70204
+ debouncedSearch,
70205
+ options?.filter
70206
+ ]);
69759
70207
  useEffect(() => {
69760
70208
  const timer = setTimeout(() => {
69761
70209
  setDebouncedIncludeSegments(includeSegments);
69762
70210
  setDebouncedExcludeSegments(excludeSegments);
69763
- }, options?.debounceMs);
70211
+ }, options?.debounceMs ?? 500);
69764
70212
  return () => clearTimeout(timer);
69765
70213
  }, [includeSegments, excludeSegments, options?.debounceMs]);
69766
70214
  useEffect(() => {
@@ -69779,6 +70227,7 @@ const useGetCountOfBusinessAutomationRecipientsDebounced = (includeSegments, exc
69779
70227
  debouncedSearch
69780
70228
  ),
69781
70229
  filter2,
70230
+ currentCursor || "initial",
69782
70231
  options?.limit ?? 100
69783
70232
  ],
69784
70233
  queryFn: () => getCountOfBusinessAutomationRecipients({
@@ -69787,18 +70236,41 @@ const useGetCountOfBusinessAutomationRecipientsDebounced = (includeSegments, exc
69787
70236
  automationId,
69788
70237
  search: debouncedSearch || void 0,
69789
70238
  limit: options?.limit ?? 100,
69790
- filter: filter2
70239
+ filter: filter2,
70240
+ cursor: currentCursor
69791
70241
  }),
69792
70242
  enabled: (options?.enabled ?? true) && !!automationId,
69793
- staleTime: 0
70243
+ staleTime: 0,
69794
70244
  // Always refetch when query key changes (including filter changes)
70245
+ placeholderData: keepPreviousData
70246
+ // Keep previous data while fetching
69795
70247
  });
70248
+ useEffect(() => {
70249
+ if (query.data?.recipients) {
70250
+ if (currentCursor) {
70251
+ setAccumulatedRecipients((prev) => [...prev, ...query.data.recipients]);
70252
+ } else {
70253
+ setAccumulatedRecipients(query.data.recipients);
70254
+ }
70255
+ }
70256
+ }, [query.data, currentCursor]);
70257
+ const handleLoadMore = () => {
70258
+ if (query.data?.pagination.hasNextPage && query.data.pagination.cursor && !query.isFetching) {
70259
+ setCurrentCursor(query.data.pagination.cursor);
70260
+ options?.onLoadMore?.(query.data.pagination.cursor);
70261
+ }
70262
+ };
69796
70263
  return {
69797
- data: query.data,
69798
- isLoading: query.isLoading,
70264
+ data: query.data ? {
70265
+ ...query.data,
70266
+ recipients: accumulatedRecipients
70267
+ } : void 0,
70268
+ isLoading: query.isLoading && accumulatedRecipients.length === 0,
69799
70269
  isFetching: query.isFetching,
69800
70270
  error: query.error,
69801
- refetch: query.refetch
70271
+ refetch: query.refetch,
70272
+ hasMore: query.data?.pagination.hasNextPage ?? false,
70273
+ loadMore: handleLoadMore
69802
70274
  };
69803
70275
  };
69804
70276
  const useGetSegment = (segmentId) => {
@@ -79839,6 +80311,7 @@ const primarySourceEnum = z$2.enum([
79839
80311
  "Attentive SMS",
79840
80312
  "Google Ads",
79841
80313
  "Google Organic Search",
80314
+ "Google Business Profile",
79842
80315
  "Facebook Ads",
79843
80316
  "Facebook Organic",
79844
80317
  "Instagram Ads",
@@ -79856,7 +80329,7 @@ const primarySourceEnum = z$2.enum([
79856
80329
  sourceTypeEnum.enum;
79857
80330
  primarySourceEnum.enum;
79858
80331
  z$2.object({
79859
- primary_source: primarySourceEnum,
80332
+ primary_source: z$2.union([primarySourceEnum, z$2.string()]),
79860
80333
  source_type: sourceTypeEnum,
79861
80334
  utm_source: z$2.string().nullable(),
79862
80335
  utm_medium: z$2.string().nullable(),
@@ -79868,7 +80341,8 @@ z$2.object({
79868
80341
  ad_account_id: z$2.string().nullable().optional(),
79869
80342
  ad_platform: adAccountPlatformEnum.nullable().optional(),
79870
80343
  visit_id: z$2.string().nullable(),
79871
- visit_date: z$2.string().nullable()
80344
+ visit_date: z$2.string().nullable(),
80345
+ keyword: z$2.string().nullable().optional()
79872
80346
  });
79873
80347
  const dashboardFilterReducer = (state, action) => {
79874
80348
  switch (action.type) {
@@ -83368,7 +83842,7 @@ const getAutomationStatusVariant = (status) => {
83368
83842
  case AutomationStatus.RUNNING:
83369
83843
  return "statusRunning";
83370
83844
  case AutomationStatus.SENDING:
83371
- return "statusScheduled";
83845
+ return "statusSending";
83372
83846
  case AutomationStatus.SCHEDULED:
83373
83847
  return "statusQueued";
83374
83848
  case AutomationStatus.PARTIALLY_CANCELLED:
@@ -83435,7 +83909,7 @@ function createNameColumn(nameAccessor = "name", headerText, showDescription = f
83435
83909
  [AutomationStatus.DEACTIVATED]: "bg-red-500",
83436
83910
  [AutomationStatus.FAILED]: "bg-red-500",
83437
83911
  [AutomationStatus.RUNNING]: "bg-yellow-500",
83438
- [AutomationStatus.SENDING]: "bg-indigo-500",
83912
+ [AutomationStatus.SENDING]: "bg-yellow-500",
83439
83913
  [AutomationStatus.SCHEDULED]: "bg-purple-500",
83440
83914
  [AutomationStatus.PARTIALLY_CANCELLED]: "bg-red-500",
83441
83915
  [AutomationStatus.CANCELLED]: "bg-red-500",
@@ -84095,14 +84569,62 @@ const AIContentLoading = ({
84095
84569
  /* @__PURE__ */ jsx("div", { className: "text-sm text-muted-foreground", children: /* @__PURE__ */ jsx("p", { children: "This usually takes about 60 seconds. We're crafting personalized content just for you." }) })
84096
84570
  ] }) });
84097
84571
  };
84572
+ const IMAGE_STYLE_STORAGE_KEY = "reach-ai-image-style";
84573
+ const IMAGE_STYLE_OPTIONS = [
84574
+ {
84575
+ value: "illustration",
84576
+ label: "Illustration",
84577
+ description: "Clean, modern digital artwork"
84578
+ },
84579
+ {
84580
+ value: "photorealistic",
84581
+ label: "Photo-like",
84582
+ description: "Lifelike, like a real photo"
84583
+ },
84584
+ {
84585
+ value: "graphic_design",
84586
+ label: "Bold & Colorful",
84587
+ description: "Bold shapes and vibrant colors"
84588
+ },
84589
+ {
84590
+ value: "cartoon",
84591
+ label: "Cartoon",
84592
+ description: "Fun, playful animated style"
84593
+ },
84594
+ {
84595
+ value: "minimalist",
84596
+ label: "Minimalist",
84597
+ description: "Simple and clean with white space"
84598
+ },
84599
+ {
84600
+ value: "watercolor",
84601
+ label: "Watercolor",
84602
+ description: "Soft, artistic painted look"
84603
+ }
84604
+ ];
84098
84605
  const AIContentPrompt = forwardRef(({ onGenerateContent, onPromptChange }, ref) => {
84099
84606
  const { sendNotificationAsync } = useSlackNotification();
84100
84607
  const { generateContent, generateContentError, isGeneratingContent } = useGenerateAIContent();
84101
84608
  const {
84102
84609
  state: { selectedChannels }
84103
84610
  } = useContext(Context);
84611
+ const flags = ne$1();
84612
+ const useGemini = flags["use-gemini-image-generation"] ?? false;
84104
84613
  const [localPrompt, setLocalPrompt] = useState("");
84614
+ const [imageStyle, setImageStyle] = useState(() => {
84615
+ if (typeof window !== "undefined") {
84616
+ const saved = localStorage.getItem(IMAGE_STYLE_STORAGE_KEY);
84617
+ if (saved && IMAGE_STYLE_OPTIONS.some((option) => option.value === saved)) {
84618
+ return saved;
84619
+ }
84620
+ }
84621
+ return "illustration";
84622
+ });
84105
84623
  const promptRef = useRef(localPrompt);
84624
+ const handleImageStyleChange = (value) => {
84625
+ setImageStyle(value);
84626
+ localStorage.setItem(IMAGE_STYLE_STORAGE_KEY, value);
84627
+ };
84106
84628
  useEffect(() => {
84107
84629
  promptRef.current = localPrompt;
84108
84630
  }, [localPrompt]);
@@ -84122,7 +84644,9 @@ const AIContentPrompt = forwardRef(({ onGenerateContent, onPromptChange }, ref)
84122
84644
  generateContent(
84123
84645
  {
84124
84646
  userPrompt: currentPrompt,
84125
- selectedChannels
84647
+ selectedChannels,
84648
+ imageStyle,
84649
+ imageProvider: useGemini ? "gemini" : "openai"
84126
84650
  },
84127
84651
  {
84128
84652
  onSuccess: (data) => {
@@ -84169,7 +84693,7 @@ const AIContentPrompt = forwardRef(({ onGenerateContent, onPromptChange }, ref)
84169
84693
  /* @__PURE__ */ jsx("div", { className: "absolute -bottom-2 -right-2", children: /* @__PURE__ */ jsx(BetaTag, { size: "sm" }) })
84170
84694
  ] }) }),
84171
84695
  /* @__PURE__ */ jsx("h2", { className: "text-2xl font-bold", children: "Generate Content with AI" }),
84172
- /* @__PURE__ */ jsx("p", { className: "text-muted-foreground", children: "Describe the context of your email, any images you'd like included, tone, and what you want to achieve" })
84696
+ /* @__PURE__ */ jsx("div", { className: "py-3", children: /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm", children: "Describe what you want your message to say and we'll generate the content for you with marketing optimized best practices. Up to one image will be AI-generated for you." }) })
84173
84697
  ] }),
84174
84698
  /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
84175
84699
  /* @__PURE__ */ jsx("div", { className: "flex justify-center", children: /* @__PURE__ */ jsx(
@@ -84183,6 +84707,33 @@ const AIContentPrompt = forwardRef(({ onGenerateContent, onPromptChange }, ref)
84183
84707
  disabled: isGeneratingContent
84184
84708
  }
84185
84709
  ) }),
84710
+ /* @__PURE__ */ jsx("div", { className: "flex justify-center", children: /* @__PURE__ */ jsxs("div", { className: "w-full max-w-2xl", children: [
84711
+ /* @__PURE__ */ jsx(Label$1, { htmlFor: "image-style", className: "block mb-1", children: "Image Style" }),
84712
+ /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm mb-2", children: "Choose how AI-generated images will look in your message" }),
84713
+ /* @__PURE__ */ jsxs(
84714
+ Select,
84715
+ {
84716
+ value: imageStyle,
84717
+ onValueChange: (value) => handleImageStyleChange(value),
84718
+ disabled: isGeneratingContent,
84719
+ children: [
84720
+ /* @__PURE__ */ jsx(SelectTrigger, { id: "image-style", className: "w-full", children: /* @__PURE__ */ jsx(SelectValue, { children: IMAGE_STYLE_OPTIONS.find((o2) => o2.value === imageStyle)?.label }) }),
84721
+ /* @__PURE__ */ jsx(SelectContent, { children: IMAGE_STYLE_OPTIONS.map((option) => /* @__PURE__ */ jsx(
84722
+ SelectItem,
84723
+ {
84724
+ value: option.value,
84725
+ className: "py-2",
84726
+ children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col", children: [
84727
+ /* @__PURE__ */ jsx("span", { children: option.label }),
84728
+ /* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children: option.description })
84729
+ ] })
84730
+ },
84731
+ option.value
84732
+ )) })
84733
+ ]
84734
+ }
84735
+ )
84736
+ ] }) }),
84186
84737
  generateContentError && /* @__PURE__ */ jsx("div", { className: "bg-destructive/10 border border-destructive/20 rounded-lg p-4", children: /* @__PURE__ */ jsx("p", { className: "text-sm text-destructive", children: "Error generating content. Please try again or contact an administrator." }) })
84187
84738
  ] })
84188
84739
  ]
@@ -84213,7 +84764,7 @@ const ContentBuilderStyleStep = () => {
84213
84764
  children: "Content Builder Style"
84214
84765
  }
84215
84766
  ),
84216
- /* @__PURE__ */ jsx(MinorText, { className: "text-muted-foreground text-sm", children: "Choose how you want to create your content" })
84767
+ /* @__PURE__ */ jsx("p", { className: "text-muted-foreground text-sm", children: "Choose how you want to create your content" })
84217
84768
  ] }),
84218
84769
  /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4 w-full max-w-4xl mx-auto", children: [
84219
84770
  /* @__PURE__ */ jsx("div", { id: "wizard-ai-builder-option", className: "min-w-0 w-full h-full", children: /* @__PURE__ */ jsx(
@@ -85309,7 +85860,7 @@ const ComboboxSelect = ({
85309
85860
  }
85310
85861
  );
85311
85862
  };
85312
- const SendPreviewPopup = ({ automation: automation2, type, setOpenSendPreviewPopup, open }) => {
85863
+ const SendPreviewPopup = ({ type, setOpenSendPreviewPopup, open }) => {
85313
85864
  const [recipient, setRecipient] = useState("");
85314
85865
  const [error2, setError2] = useState("");
85315
85866
  const [senderId, setSenderId] = useState(null);
@@ -85321,11 +85872,8 @@ const SendPreviewPopup = ({ automation: automation2, type, setOpenSendPreviewPop
85321
85872
  const { sendTestCommunication: sendTestCommunication2, sendError, isSendSuccess } = useSendTestCommunication();
85322
85873
  const { toast: toast2 } = useToast();
85323
85874
  const { segments } = useListSegments();
85324
- const actionDataCommunication = automation2.actionData?.find(
85325
- (action) => action.actionType === "send_communication"
85326
- );
85327
- const communicationGroupId = actionDataCommunication?.actionMetadata.communicationGroupId;
85328
- const { communicationGroup, isGetting: isGettingCommunicationGroup } = useGetCommunicationGroup(communicationGroupId ?? void 0);
85875
+ const { communicationGroup, isGetting: isGettingCommunicationGroup } = useCurrentCommunicationGroup();
85876
+ const communicationGroupId = communicationGroup?.id;
85329
85877
  const fetchUsersIfNeeded = React__default.useCallback(async () => {
85330
85878
  if (hasAttemptedFetch || allUsersForDropdown?.recipients || !segments) {
85331
85879
  return;
@@ -85365,6 +85913,7 @@ const SendPreviewPopup = ({ automation: automation2, type, setOpenSendPreviewPop
85365
85913
  ]);
85366
85914
  const filteredRecipients = React__default.useMemo(() => {
85367
85915
  return [...allUsersForDropdown?.recipients ?? []].filter((recipient2) => {
85916
+ if (!recipient2.id) return false;
85368
85917
  if (!recipient2.firstName || !recipient2.lastName) return false;
85369
85918
  if (type === "email" && !recipient2.email) return false;
85370
85919
  if (type === "sms" && !recipient2.phone) return false;
@@ -85377,7 +85926,7 @@ const SendPreviewPopup = ({ automation: automation2, type, setOpenSendPreviewPop
85377
85926
  const nameB = `${b3.firstName} ${b3.lastName}`.toLowerCase();
85378
85927
  return nameA.localeCompare(nameB);
85379
85928
  });
85380
- return sortedRecipients.map((recipient2) => ({
85929
+ return sortedRecipients.filter((recipient2) => recipient2.id !== null).map((recipient2) => ({
85381
85930
  value: recipient2.id,
85382
85931
  label: `${recipient2.firstName} ${recipient2.lastName}`,
85383
85932
  id: recipient2.id,
@@ -85464,15 +86013,14 @@ const SendPreviewPopup = ({ automation: automation2, type, setOpenSendPreviewPop
85464
86013
  setError2("No sender found, please update the automation first!");
85465
86014
  return;
85466
86015
  }
85467
- const actionDataCommunication2 = automation2.actionData?.find(
85468
- (action) => action.actionType === "send_communication"
85469
- );
85470
- const communicationGroupId2 = actionDataCommunication2?.actionMetadata.communicationGroupId;
85471
- if (!communicationGroupId2) {
85472
- return Promise.resolve(null);
86016
+ if (!communicationGroupId) {
86017
+ setError2(
86018
+ "No communication group found. Please select a communication step first."
86019
+ );
86020
+ return;
85473
86021
  }
85474
86022
  sendTestCommunication2({
85475
- id: communicationGroupId2,
86023
+ id: communicationGroupId,
85476
86024
  params: type === "email" ? {
85477
86025
  emailAddress: recipient,
85478
86026
  previewAsRecipientId: selectedPreviewAsRecipientId
@@ -106856,7 +107404,8 @@ function MultiSelectDialog({
106856
107404
  emptyMessage = "No items found",
106857
107405
  extraCommandItems = [],
106858
107406
  canOpen = true,
106859
- singleSelect = false
107407
+ singleSelect = false,
107408
+ totalCount
106860
107409
  }) {
106861
107410
  const [open, setOpen2] = React.useState(false);
106862
107411
  const [searchQuery, setSearchQuery] = React.useState("");
@@ -107088,10 +107637,7 @@ function MultiSelectDialog({
107088
107637
  ] }) }),
107089
107638
  !singleSelect && /* @__PURE__ */ jsx("div", { className: "px-6 pb-4", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between text-sm", children: [
107090
107639
  /* @__PURE__ */ jsxs("span", { className: "text-muted-foreground", children: [
107091
- selectedCount,
107092
- " of ",
107093
- cleanedOptions.length,
107094
- " selected",
107640
+ totalCount !== void 0 ? `${selectedCount} of ${totalCount} selected` : `${selectedCount} selected`,
107095
107641
  maxCount && ` (max ${maxCount})`
107096
107642
  ] }),
107097
107643
  /* @__PURE__ */ jsxs("div", { className: "flex gap-2", children: [
@@ -107346,7 +107892,8 @@ const SMSEditor = ({
107346
107892
  imageBase64,
107347
107893
  isUpdating,
107348
107894
  hasUnsavedChanges,
107349
- communicationGroupId
107895
+ communicationGroupId,
107896
+ hasDynamicMergeFieldImage = false
107350
107897
  }) => {
107351
107898
  const [characterCount, setCharacterCount] = useState(0);
107352
107899
  const [isAddImagePopoverOpen, setIsAddImagePopoverOpen] = useState(false);
@@ -107472,6 +108019,68 @@ const SMSEditor = ({
107472
108019
  if (!editor) {
107473
108020
  return /* @__PURE__ */ jsx("div", { children: "Loading editor..." });
107474
108021
  }
108022
+ const isAddImageDisabled = (initialImageUrls?.length || 0) >= 1 || isRemovingImage || imageBase64 !== null || isUpdatingCommunicationGroup || hasDynamicMergeFieldImage;
108023
+ const addImageButton = /* @__PURE__ */ jsxs(
108024
+ Popover,
108025
+ {
108026
+ modal: true,
108027
+ open: isAddImagePopoverOpen,
108028
+ onOpenChange: setIsAddImagePopoverOpen,
108029
+ children: [
108030
+ /* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
108031
+ Button$1,
108032
+ {
108033
+ variant: "outline",
108034
+ disabled: isAddImageDisabled,
108035
+ className: "flex items-center gap-2",
108036
+ children: [
108037
+ "Add Image",
108038
+ /* @__PURE__ */ jsx(ChevronDown, { className: "h-3 w-3" })
108039
+ ]
108040
+ }
108041
+ ) }),
108042
+ /* @__PURE__ */ jsx(PopoverContent, { className: "w-56 p-3 z-[100]", align: "start", children: /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
108043
+ /* @__PURE__ */ jsxs(
108044
+ Button$1,
108045
+ {
108046
+ variant: "ghost",
108047
+ size: "sm",
108048
+ onClick: handleAddImageFromFile,
108049
+ className: "w-full justify-start gap-2 h-9",
108050
+ children: [
108051
+ /* @__PURE__ */ jsx(Upload, { className: "h-4 w-4" }),
108052
+ "Upload from file"
108053
+ ]
108054
+ }
108055
+ ),
108056
+ /* @__PURE__ */ jsxs(
108057
+ Button$1,
108058
+ {
108059
+ variant: "ghost",
108060
+ size: "sm",
108061
+ onClick: handleAddImageFromUrl,
108062
+ className: "w-full justify-start gap-2 h-9",
108063
+ children: [
108064
+ /* @__PURE__ */ jsx(Link$1, { className: "h-4 w-4" }),
108065
+ "Add from URL"
108066
+ ]
108067
+ }
108068
+ ),
108069
+ /* @__PURE__ */ jsx("div", { className: "text-xs text-muted-foreground pt-1 border-t", children: "Maximum size of all images: 5MB. We will try to compress the image if possible." })
108070
+ ] }) })
108071
+ ]
108072
+ }
108073
+ );
108074
+ const addImageButtonWithTooltip = isAddImageDisabled && hasDynamicMergeFieldImage ? /* @__PURE__ */ jsx(
108075
+ InfoTooltip,
108076
+ {
108077
+ title: "Image attachment limit",
108078
+ description: "We've identified an image that will be added to this message through a merge field. To ensure image quality, we don't allow uploading extra images.",
108079
+ asChild: true,
108080
+ className: "cursor-not-allowed",
108081
+ children: /* @__PURE__ */ jsx("span", { className: "inline-block cursor-not-allowed", children: addImageButton })
108082
+ }
108083
+ ) : addImageButton;
107475
108084
  return /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
107476
108085
  /* @__PURE__ */ jsxs("div", { ref: editorRef, className: "relative", children: [
107477
108086
  /* @__PURE__ */ jsx(EditorContent, { id: "wizard-sms-editor-input", editor }),
@@ -107513,57 +108122,7 @@ const SMSEditor = ({
107513
108122
  disabled: isRemovingImage || isUpdatingCommunicationGroup,
107514
108123
  children: "Remove Image"
107515
108124
  }
107516
- ) : /* @__PURE__ */ jsxs(
107517
- Popover,
107518
- {
107519
- modal: true,
107520
- open: isAddImagePopoverOpen,
107521
- onOpenChange: setIsAddImagePopoverOpen,
107522
- children: [
107523
- /* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
107524
- Button$1,
107525
- {
107526
- variant: "outline",
107527
- disabled: (initialImageUrls?.length || 0) >= 1 || isRemovingImage || imageBase64 !== null || isUpdatingCommunicationGroup,
107528
- className: "flex items-center gap-2",
107529
- children: [
107530
- "Add Image",
107531
- /* @__PURE__ */ jsx(ChevronDown, { className: "h-3 w-3" })
107532
- ]
107533
- }
107534
- ) }),
107535
- /* @__PURE__ */ jsx(PopoverContent, { className: "w-56 p-3 z-[100]", align: "start", children: /* @__PURE__ */ jsxs("div", { className: "space-y-2", children: [
107536
- /* @__PURE__ */ jsxs(
107537
- Button$1,
107538
- {
107539
- variant: "ghost",
107540
- size: "sm",
107541
- onClick: handleAddImageFromFile,
107542
- className: "w-full justify-start gap-2 h-9",
107543
- children: [
107544
- /* @__PURE__ */ jsx(Upload, { className: "h-4 w-4" }),
107545
- "Upload from file"
107546
- ]
107547
- }
107548
- ),
107549
- /* @__PURE__ */ jsxs(
107550
- Button$1,
107551
- {
107552
- variant: "ghost",
107553
- size: "sm",
107554
- onClick: handleAddImageFromUrl,
107555
- className: "w-full justify-start gap-2 h-9",
107556
- children: [
107557
- /* @__PURE__ */ jsx(Link$1, { className: "h-4 w-4" }),
107558
- "Add from URL"
107559
- ]
107560
- }
107561
- ),
107562
- /* @__PURE__ */ jsx("div", { className: "text-xs text-muted-foreground pt-1 border-t", children: "Maximum size of all images: 5MB. We will try to compress the image if possible." })
107563
- ] }) })
107564
- ]
107565
- }
107566
- ),
108125
+ ) : addImageButtonWithTooltip,
107567
108126
  /* @__PURE__ */ jsx(Dialog, { open: isUrlDialogOpen, onOpenChange: setIsUrlDialogOpen, children: /* @__PURE__ */ jsxs(DialogContent, { className: "sm:max-w-md", children: [
107568
108127
  /* @__PURE__ */ jsxs(DialogHeader$1, { children: [
107569
108128
  /* @__PURE__ */ jsx(DialogTitle, { children: "Add Image from URL" }),
@@ -108392,7 +108951,8 @@ const SMSEditorContent = React__default.memo(
108392
108951
  imageBase64,
108393
108952
  isUpdating: isUpdatingCommunicationGroup || isUploadingImage,
108394
108953
  hasUnsavedChanges,
108395
- communicationGroupId
108954
+ communicationGroupId,
108955
+ hasDynamicMergeFieldImage: dynamicMergeFieldImages.length > 0
108396
108956
  }
108397
108957
  )
108398
108958
  ] }),
@@ -109727,54 +110287,6 @@ var AutomationAudienceSelectorType = /* @__PURE__ */ ((AutomationAudienceSelecto
109727
110287
  const generateOneOffSegmentName = (automationId) => {
109728
110288
  return `ONE-OFF-SEGMENT-${automationId}`;
109729
110289
  };
109730
- var DateUnit = /* @__PURE__ */ ((DateUnit2) => {
109731
- DateUnit2["DAYS"] = "days";
109732
- return DateUnit2;
109733
- })(DateUnit || {});
109734
- ({
109735
- [JSONSchemaType.String]: [
109736
- ConditionOperatorEnumType.EQUALS,
109737
- ConditionOperatorEnumType.NOT_EQUALS,
109738
- ConditionOperatorEnumType.EXISTS
109739
- ],
109740
- [JSONSchemaType.Number]: [
109741
- ConditionOperatorEnumType.EQUALS,
109742
- ConditionOperatorEnumType.NOT_EQUALS,
109743
- ConditionOperatorEnumType.GREATER_THAN,
109744
- ConditionOperatorEnumType.LESS_THAN,
109745
- ConditionOperatorEnumType.EXISTS
109746
- ],
109747
- [JSONSchemaType.Boolean]: [
109748
- ConditionOperatorEnumType.EQUALS,
109749
- ConditionOperatorEnumType.NOT_EQUALS,
109750
- ConditionOperatorEnumType.EXISTS
109751
- ],
109752
- [JSONSchemaType.Date]: [
109753
- ConditionOperatorEnumType.GREATER_THAN,
109754
- ConditionOperatorEnumType.LESS_THAN,
109755
- ConditionOperatorEnumType.EXISTS,
109756
- ConditionOperatorEnumType.EQUALS_MONTH_DAY,
109757
- ConditionOperatorEnumType.EQUALS_MONTH_DAY_YEAR
109758
- ],
109759
- [JSONSchemaType.DateTime]: [
109760
- ConditionOperatorEnumType.EQUALS,
109761
- ConditionOperatorEnumType.NOT_EQUALS,
109762
- ConditionOperatorEnumType.GREATER_THAN,
109763
- ConditionOperatorEnumType.LESS_THAN,
109764
- ConditionOperatorEnumType.EXISTS,
109765
- ConditionOperatorEnumType.EQUALS_MONTH_DAY,
109766
- ConditionOperatorEnumType.EQUALS_MONTH_DAY_YEAR
109767
- ],
109768
- [JSONSchemaType.Integer]: [
109769
- ConditionOperatorEnumType.EQUALS,
109770
- ConditionOperatorEnumType.NOT_EQUALS,
109771
- ConditionOperatorEnumType.GREATER_THAN,
109772
- ConditionOperatorEnumType.LESS_THAN,
109773
- ConditionOperatorEnumType.EXISTS
109774
- ],
109775
- [JSONSchemaType.ReachResource]: [ConditionOperatorEnumType.EQUALS],
109776
- [JSONSchemaType.Array]: [ConditionOperatorEnumType.EQUALS]
109777
- });
109778
110290
  const PromptBuilderStyle = ({ onSelectStyle }) => {
109779
110291
  const [selectedStyle, setSelectedStyle] = useState(null);
109780
110292
  return /* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 md:grid-cols-2 gap-4 p-4 max-w-4xl mx-auto", children: [
@@ -109846,7 +110358,6 @@ const RecipientsTable = ({
109846
110358
  audienceMode,
109847
110359
  isSegmentBuilder = false,
109848
110360
  isLoading = false,
109849
- totalCount,
109850
110361
  searchQuery = "",
109851
110362
  onSearchChange,
109852
110363
  onLoadMore,
@@ -109921,8 +110432,8 @@ const RecipientsTable = ({
109921
110432
  if (!container2 || isLoadingMoreState || !hasMoreItems || isLoadingMoreRef.current)
109922
110433
  return;
109923
110434
  const { scrollTop, scrollHeight, clientHeight } = container2;
109924
- const scrollPercentage = (scrollTop + clientHeight) / scrollHeight;
109925
- if (scrollPercentage > 0.9) {
110435
+ const distanceFromBottom = scrollHeight - (scrollTop + clientHeight);
110436
+ if (distanceFromBottom < 100) {
109926
110437
  loadMore();
109927
110438
  }
109928
110439
  }, [loadMore, isLoadingMoreState, hasMoreItems]);
@@ -109986,17 +110497,10 @@ const RecipientsTable = ({
109986
110497
  )
109987
110498
  ] })
109988
110499
  ] }),
109989
- searchQuery.trim() && filteredRecipients.length > 0 ? /* @__PURE__ */ jsx("div", { className: "flex-shrink-0 px-3 py-2 bg-blue-50/50 border-b border-blue-100/50", children: /* @__PURE__ */ jsxs("p", { className: "text-xs text-blue-700", children: [
110500
+ searchQuery.trim() && filteredRecipients.length > 0 && /* @__PURE__ */ jsx("div", { className: "flex-shrink-0 px-3 py-2 bg-blue-50/50 border-b border-blue-100/50", children: /* @__PURE__ */ jsxs("p", { className: "text-xs text-blue-700", children: [
109990
110501
  'Showing all users matching "',
109991
110502
  searchQuery,
109992
110503
  '"'
109993
- ] }) }) : totalCount !== void 0 && totalCount > filteredRecipients.length && filteredRecipients.length > 0 && /* @__PURE__ */ jsx("div", { className: "flex-shrink-0 px-3 py-2 bg-blue-50/50 border-b border-blue-100/50", children: /* @__PURE__ */ jsxs("p", { className: "text-xs text-blue-700", children: [
109994
- "Showing first ",
109995
- filteredRecipients.length.toLocaleString(),
109996
- " of",
109997
- " ",
109998
- totalCount.toLocaleString(),
109999
- " recipients. Use search to find specific recipients."
110000
110504
  ] }) }),
110001
110505
  /* @__PURE__ */ jsx(AnimatePresence, { mode: "wait", children: isSearchOpen && /* @__PURE__ */ jsxs(
110002
110506
  motion.div,
@@ -111097,6 +111601,50 @@ const TabsContent = React.forwardRef(({ className, ...props2 }, ref) => /* @__PU
111097
111601
  }
111098
111602
  ));
111099
111603
  TabsContent.displayName = Content.displayName;
111604
+ ({
111605
+ [JSONSchemaType.String]: [
111606
+ ConditionOperatorEnumType.EQUALS,
111607
+ ConditionOperatorEnumType.NOT_EQUALS,
111608
+ ConditionOperatorEnumType.EXISTS
111609
+ ],
111610
+ [JSONSchemaType.Number]: [
111611
+ ConditionOperatorEnumType.EQUALS,
111612
+ ConditionOperatorEnumType.NOT_EQUALS,
111613
+ ConditionOperatorEnumType.GREATER_THAN,
111614
+ ConditionOperatorEnumType.LESS_THAN,
111615
+ ConditionOperatorEnumType.EXISTS
111616
+ ],
111617
+ [JSONSchemaType.Boolean]: [
111618
+ ConditionOperatorEnumType.EQUALS,
111619
+ ConditionOperatorEnumType.NOT_EQUALS,
111620
+ ConditionOperatorEnumType.EXISTS
111621
+ ],
111622
+ [JSONSchemaType.Date]: [
111623
+ ConditionOperatorEnumType.GREATER_THAN,
111624
+ ConditionOperatorEnumType.LESS_THAN,
111625
+ ConditionOperatorEnumType.EXISTS,
111626
+ ConditionOperatorEnumType.EQUALS_MONTH_DAY,
111627
+ ConditionOperatorEnumType.EQUALS_MONTH_DAY_YEAR
111628
+ ],
111629
+ [JSONSchemaType.DateTime]: [
111630
+ ConditionOperatorEnumType.EQUALS,
111631
+ ConditionOperatorEnumType.NOT_EQUALS,
111632
+ ConditionOperatorEnumType.GREATER_THAN,
111633
+ ConditionOperatorEnumType.LESS_THAN,
111634
+ ConditionOperatorEnumType.EXISTS,
111635
+ ConditionOperatorEnumType.EQUALS_MONTH_DAY,
111636
+ ConditionOperatorEnumType.EQUALS_MONTH_DAY_YEAR
111637
+ ],
111638
+ [JSONSchemaType.Integer]: [
111639
+ ConditionOperatorEnumType.EQUALS,
111640
+ ConditionOperatorEnumType.NOT_EQUALS,
111641
+ ConditionOperatorEnumType.GREATER_THAN,
111642
+ ConditionOperatorEnumType.LESS_THAN,
111643
+ ConditionOperatorEnumType.EXISTS
111644
+ ],
111645
+ [JSONSchemaType.ReachResource]: [ConditionOperatorEnumType.EQUALS],
111646
+ [JSONSchemaType.Array]: [ConditionOperatorEnumType.EQUALS]
111647
+ });
111100
111648
  var SingleDatePreset = /* @__PURE__ */ ((SingleDatePreset2) => {
111101
111649
  SingleDatePreset2["Today"] = "today";
111102
111650
  SingleDatePreset2["Yesterday"] = "yesterday";
@@ -111311,8 +111859,8 @@ const formatDateForDisplay = (value) => {
111311
111859
  }
111312
111860
  if (typeof value === "object" && "startDate" in value && "endDate" in value) {
111313
111861
  const betweenDate = value;
111314
- const startStr = formatDateForDisplay(betweenDate.startDate);
111315
- const endStr = formatDateForDisplay(betweenDate.endDate);
111862
+ const startStr = betweenDate.startDate ? formatDateForDisplay(betweenDate.startDate) : "Select start date...";
111863
+ const endStr = betweenDate.endDate ? formatDateForDisplay(betweenDate.endDate) : "Select end date...";
111316
111864
  return `${startStr} - ${endStr}`;
111317
111865
  }
111318
111866
  return "Select date...";
@@ -111952,7 +112500,7 @@ const DateValueDialog = ({
111952
112500
  /* @__PURE__ */ jsxs("div", { children: [
111953
112501
  "Parsed as:",
111954
112502
  " ",
111955
- showBetweenDateOption && "startDate" in aiParsedDate && "endDate" in aiParsedDate ? `${formatDateForDisplay(aiParsedDate.startDate)} to ${formatDateForDisplay(aiParsedDate.endDate)}` : formatDateForDisplay(aiParsedDate)
112503
+ showBetweenDateOption && "startDate" in aiParsedDate && "endDate" in aiParsedDate ? `${aiParsedDate.startDate ? formatDateForDisplay(aiParsedDate.startDate) : "..."} to ${aiParsedDate.endDate ? formatDateForDisplay(aiParsedDate.endDate) : "..."}` : formatDateForDisplay(aiParsedDate)
111956
112504
  ] })
111957
112505
  ] }),
111958
112506
  !showBetweenDateOption && /* @__PURE__ */ jsxs("div", { className: "space-y-4", children: [
@@ -112422,7 +112970,8 @@ const ValueInput = ({
112422
112970
  onChange,
112423
112971
  options,
112424
112972
  toast: toast2,
112425
- viewOnly = false
112973
+ viewOnly = false,
112974
+ totalCount
112426
112975
  }) => {
112427
112976
  const [isDateDialogOpen, setIsDateDialogOpen] = React.useState(false);
112428
112977
  if (fieldType === JSONSchemaType.String || fieldType === JSONSchemaType.ReachResource || fieldType === JSONSchemaType.Array) {
@@ -112458,7 +113007,8 @@ const ValueInput = ({
112458
113007
  onChange(selectedIds);
112459
113008
  }
112460
113009
  },
112461
- isLoading: !options || options.length === 0
113010
+ isLoading: !options || options.length === 0,
113011
+ totalCount
112462
113012
  }
112463
113013
  );
112464
113014
  }
@@ -112550,6 +113100,11 @@ const ConditionRow = ({
112550
113100
  const cardRef = useRef(null);
112551
113101
  const [buttonPosition, setButtonPosition] = useState({ top: 0, right: 0 });
112552
113102
  const hoverTimeoutRef = useRef(null);
113103
+ const { segments } = useListSegments();
113104
+ const allUsersSegment = segments?.find(
113105
+ (segment2) => segment2.type === BusinessSegmentTypeEnum.ALL_USERS
113106
+ );
113107
+ const totalCount = condition.field === "userId" ? allUsersSegment?.userCount : void 0;
112553
113108
  const getMetadataForField = (field) => {
112554
113109
  const fieldMetadata = segmentsConditions.conditions.find(
112555
113110
  (condition2) => condition2.field === field
@@ -112813,7 +113368,8 @@ const ConditionRow = ({
112813
113368
  value: condition.value,
112814
113369
  onChange: (newValue) => onUpdate({ ...condition, value: newValue }),
112815
113370
  toast: toast2,
112816
- viewOnly
113371
+ viewOnly,
113372
+ totalCount
112817
113373
  }
112818
113374
  ) })
112819
113375
  ] })
@@ -113352,7 +113908,7 @@ function SegmentBuilder({
113352
113908
  return;
113353
113909
  }
113354
113910
  if (existingSegment) {
113355
- const mappedConditions = existingSegment.conditions.map((condition) => ({
113911
+ const mappedConditions = existingSegment.conditions.filter(isFieldCondition).map((condition) => ({
113356
113912
  field: condition.field,
113357
113913
  operator: condition.operator,
113358
113914
  value: condition.value
@@ -113361,20 +113917,20 @@ function SegmentBuilder({
113361
113917
  version: "1.0",
113362
113918
  id: existingSegment.id,
113363
113919
  name: existingSegment.name,
113364
- description: existingSegment.description,
113920
+ description: existingSegment.description || "",
113365
113921
  logic: "AND",
113366
113922
  conditions: mappedConditions,
113367
- type: existingSegment.type
113923
+ type: existingSegment.type,
113924
+ createdAt: existingSegment.createdAt
113368
113925
  });
113369
113926
  } else {
113370
113927
  setSegment((prevSegment) => ({
113371
113928
  version: "1.0",
113372
113929
  id: "",
113373
113930
  name: prevSegment?.name || "",
113374
- // Preserve existing name
113375
113931
  description: prevSegment?.description || "",
113376
- // Preserve existing description
113377
113932
  logic: "AND",
113933
+ createdAt: null,
113378
113934
  conditions: [
113379
113935
  /**
113380
113936
  * Use the first fields of segment conditions to create a new segment
@@ -113408,12 +113964,12 @@ function SegmentBuilder({
113408
113964
  };
113409
113965
  const hasRelativeDate = (condition) => {
113410
113966
  return condition.value.some((value) => {
113411
- return typeof value === "object" && "type" in value && value.type === "relative";
113967
+ return typeof value === "object" && value !== null && "type" in value && value.type === "relative";
113412
113968
  });
113413
113969
  };
113414
113970
  const hasBetweenDate = (condition) => {
113415
113971
  return condition.value.some(
113416
- (value) => typeof value === "object" && "startDate" in value && "endDate" in value
113972
+ (value) => typeof value === "object" && value !== null && "startDate" in value && "endDate" in value
113417
113973
  );
113418
113974
  };
113419
113975
  const validationConditions = (conditions) => {
@@ -113579,12 +114135,15 @@ function SegmentBuilder({
113579
114135
  (c3) => c3.field === condition.field
113580
114136
  );
113581
114137
  if (fieldMetadata?.type === JSONSchemaType.Date) {
113582
- condition.value = condition.value.map((value) => {
113583
- if (value instanceof Date) {
113584
- return value.toISOString().split("T")[0];
113585
- }
113586
- return value;
113587
- });
114138
+ return {
114139
+ ...condition,
114140
+ value: condition.value.map((value) => {
114141
+ if (value instanceof Date) {
114142
+ return value.toISOString().split("T")[0];
114143
+ }
114144
+ return value;
114145
+ })
114146
+ };
113588
114147
  }
113589
114148
  return condition;
113590
114149
  });
@@ -113680,16 +114239,14 @@ function SegmentBuilder({
113680
114239
  });
113681
114240
  };
113682
114241
  const addCondition = () => {
114242
+ const newCondition = {
114243
+ field: segmentsConditions.conditions[0].field,
114244
+ operator: segmentsConditions.conditions[0].operators[0],
114245
+ value: []
114246
+ };
113683
114247
  setSegment({
113684
114248
  ...segment2,
113685
- conditions: [
113686
- ...segment2.conditions,
113687
- {
113688
- field: segmentsConditions.conditions[0].field,
113689
- operator: segmentsConditions.conditions[0].operators[0],
113690
- value: []
113691
- }
113692
- ]
114249
+ conditions: [...segment2.conditions, newCondition]
113693
114250
  });
113694
114251
  };
113695
114252
  return /* @__PURE__ */ jsxs(Fragment$1, { children: [
@@ -113763,7 +114320,12 @@ function SegmentBuilder({
113763
114320
  {
113764
114321
  segment: segment2,
113765
114322
  setSegment,
113766
- segmentsConditions,
114323
+ segmentsConditions: {
114324
+ conditions: segmentsConditions?.conditions.map((c3) => ({
114325
+ ...c3,
114326
+ operators: c3.operators
114327
+ })) ?? []
114328
+ },
113767
114329
  updateCondition,
113768
114330
  duplicateCondition,
113769
114331
  deleteCondition,
@@ -114222,6 +114784,13 @@ const SelectIndividualUsersContent = ({ selectedUserIds, onUserSelectionChange,
114222
114784
  const [isLoadingUsers, setIsLoadingUsers] = useState(false);
114223
114785
  const [hasAttemptedFetch, setHasAttemptedFetch] = useState(false);
114224
114786
  const { segments } = useListSegments();
114787
+ const allUsersSegment = React__default.useMemo(
114788
+ () => segments?.find(
114789
+ (segment2) => segment2.type === BusinessSegmentTypeEnum.ALL_USERS
114790
+ ),
114791
+ [segments]
114792
+ );
114793
+ const totalUserCount = allUsersSegment?.userCount ?? 0;
114225
114794
  useEffect(() => {
114226
114795
  setTempSelectedUserIds(selectedUserIds);
114227
114796
  }, [selectedUserIds]);
@@ -114232,12 +114801,12 @@ const SelectIndividualUsersContent = ({ selectedUserIds, onUserSelectionChange,
114232
114801
  setHasAttemptedFetch(true);
114233
114802
  setIsLoadingUsers(true);
114234
114803
  try {
114235
- const allUsersSegment = segments.find(
114804
+ const allUsersSegment2 = segments.find(
114236
114805
  (segment2) => segment2.type === BusinessSegmentTypeEnum.ALL_USERS
114237
114806
  );
114238
- if (allUsersSegment) {
114807
+ if (allUsersSegment2) {
114239
114808
  const allUsersResponse = await getCountOfBusinessAutomationRecipients({
114240
- includeSegments: [allUsersSegment.id],
114809
+ includeSegments: [allUsersSegment2.id],
114241
114810
  excludeSegments: []
114242
114811
  });
114243
114812
  setAllUsersForDropdown(allUsersResponse);
@@ -114263,7 +114832,7 @@ const SelectIndividualUsersContent = ({ selectedUserIds, onUserSelectionChange,
114263
114832
  ]);
114264
114833
  const userOptions = React__default.useMemo(() => {
114265
114834
  if (!allUsersForDropdown?.recipients) return [];
114266
- return allUsersForDropdown.recipients.map((recipient) => {
114835
+ return allUsersForDropdown.recipients.filter((recipient) => recipient.externalId !== null).map((recipient) => {
114267
114836
  const hasEmail = !!recipient.email;
114268
114837
  const hasPhone = !!recipient.phone;
114269
114838
  const emailOptedOut = recipient.emailOptedOut || false;
@@ -114280,23 +114849,31 @@ const SelectIndividualUsersContent = ({ selectedUserIds, onUserSelectionChange,
114280
114849
  }
114281
114850
  }
114282
114851
  return {
114283
- label: getDisplayName(recipient, "Unnamed User"),
114852
+ label: getDisplayName(
114853
+ {
114854
+ firstName: recipient.firstName ?? "",
114855
+ lastName: recipient.lastName ?? "",
114856
+ email: recipient.email ?? void 0,
114857
+ phone: recipient.phone ?? void 0
114858
+ },
114859
+ "Unnamed User"
114860
+ ),
114284
114861
  value: recipient.externalId,
114285
114862
  disabled: isDisabled,
114286
114863
  disabledReason,
114287
114864
  customComponent: /* @__PURE__ */ jsx(
114288
114865
  ContactMethodPills,
114289
114866
  {
114290
- email: recipient.email,
114291
- phone: recipient.phone,
114867
+ email: recipient.email ?? void 0,
114868
+ phone: recipient.phone ?? void 0,
114292
114869
  size: "sm"
114293
114870
  }
114294
114871
  ),
114295
114872
  searchData: {
114296
- email: recipient.email,
114297
- phone: recipient.phone,
114298
- firstName: recipient.firstName,
114299
- lastName: recipient.lastName
114873
+ email: recipient.email ?? void 0,
114874
+ phone: recipient.phone ?? void 0,
114875
+ firstName: recipient.firstName ?? void 0,
114876
+ lastName: recipient.lastName ?? void 0
114300
114877
  }
114301
114878
  };
114302
114879
  });
@@ -114335,7 +114912,8 @@ const SelectIndividualUsersContent = ({ selectedUserIds, onUserSelectionChange,
114335
114912
  title: "Select Individual Users",
114336
114913
  searchPlaceholder: RECIPIENT_SEARCH_PLACEHOLDER,
114337
114914
  emptyMessage: "No users found",
114338
- canOpen: canEditAudience
114915
+ canOpen: canEditAudience,
114916
+ totalCount: totalUserCount
114339
114917
  }
114340
114918
  )
114341
114919
  ] });
@@ -114497,7 +115075,6 @@ const AutomationAudienceSelectorMain = ({ title: title2 = "Preview Audience" })
114497
115075
  const [initialStateSet, setInitialStateSet] = useState(false);
114498
115076
  const [selectedFilter, setSelectedFilter] = useState("all");
114499
115077
  const [searchQuery, setSearchQuery] = useState("");
114500
- const [limit, setLimit] = React__default.useState(100);
114501
115078
  const { segments, isLoading } = useListSegments();
114502
115079
  const { updateAutomation: updateAutomation2 } = useUpdateBusinessAutomation(
114503
115080
  automation2?.id ?? ""
@@ -114539,16 +115116,19 @@ const AutomationAudienceSelectorMain = ({ title: title2 = "Preview Audience" })
114539
115116
  count: totalCount,
114540
115117
  emailCount,
114541
115118
  phoneCount,
114542
- recipients: []
115119
+ recipients: [],
115120
+ pagination: {
115121
+ hasNextPage: false,
115122
+ cursor: null
115123
+ }
114543
115124
  };
114544
115125
  }, [segments, includedSegments, excludedSegments]);
114545
- React__default.useEffect(() => {
114546
- setLimit(100);
114547
- }, [searchQuery, includedSegments, excludedSegments, selectedFilter]);
114548
115126
  const {
114549
115127
  data: recipientsData,
114550
115128
  isLoading: isLoadingRecipients,
114551
- isFetching: isFetchingRecipients
115129
+ isFetching: isFetchingRecipients,
115130
+ hasMore,
115131
+ loadMore
114552
115132
  } = useGetCountOfBusinessAutomationRecipientsDebounced(
114553
115133
  includedSegments,
114554
115134
  excludedSegments,
@@ -114557,7 +115137,8 @@ const AutomationAudienceSelectorMain = ({ title: title2 = "Preview Audience" })
114557
115137
  debounceMs: 500,
114558
115138
  enabled: !!automation2?.id && initialStateSet && (includedSegments.length > 0 || excludedSegments.length > 0),
114559
115139
  search: searchQuery,
114560
- limit,
115140
+ limit: 100,
115141
+ // Default page size
114561
115142
  filter: selectedFilter
114562
115143
  }
114563
115144
  );
@@ -114578,8 +115159,8 @@ const AutomationAudienceSelectorMain = ({ title: title2 = "Preview Audience" })
114578
115159
  (recipient) => ({
114579
115160
  firstName: recipient.firstName ?? "",
114580
115161
  lastName: recipient.lastName ?? "",
114581
- email: recipient.email,
114582
- phone: recipient.phone
115162
+ email: recipient.email ?? void 0,
115163
+ phone: recipient.phone ?? void 0
114583
115164
  })
114584
115165
  );
114585
115166
  setFilterChanged(false);
@@ -114590,14 +115171,12 @@ const AutomationAudienceSelectorMain = ({ title: title2 = "Preview Audience" })
114590
115171
  return [];
114591
115172
  }
114592
115173
  if (recipientsData?.recipients !== void 0) {
114593
- return recipientsData.recipients.map(
114594
- (recipient) => ({
114595
- firstName: recipient.firstName ?? "",
114596
- lastName: recipient.lastName ?? "",
114597
- email: recipient.email,
114598
- phone: recipient.phone
114599
- })
114600
- );
115174
+ return recipientsData.recipients.map((recipient) => ({
115175
+ firstName: recipient.firstName ?? "",
115176
+ lastName: recipient.lastName ?? "",
115177
+ email: recipient.email ?? void 0,
115178
+ phone: recipient.phone ?? void 0
115179
+ }));
114601
115180
  }
114602
115181
  return previousRecipientsRef.current;
114603
115182
  }, [recipientsData?.recipients, filterChanged]);
@@ -114610,13 +115189,18 @@ const AutomationAudienceSelectorMain = ({ title: title2 = "Preview Audience" })
114610
115189
  emailCount: countResponse.emailCount,
114611
115190
  phoneCount: countResponse.phoneCount,
114612
115191
  // Use API recipients for display (filtered by selectedFilter)
114613
- recipients: recipientsData?.recipients || []
115192
+ recipients: recipientsData?.recipients || [],
115193
+ // Include pagination from API response
115194
+ pagination: recipientsData?.pagination || {
115195
+ hasNextPage: false,
115196
+ cursor: null
115197
+ }
114614
115198
  };
114615
115199
  }, [countResponse, recipientsData]);
114616
115200
  const handleLoadMore = React__default.useCallback(() => {
114617
- if (isFetchingRecipients || isLoadingRecipients) return;
114618
- setLimit((prev) => prev + 100);
114619
- }, [isFetchingRecipients, isLoadingRecipients]);
115201
+ if (isFetchingRecipients || isLoadingRecipients || !hasMore) return;
115202
+ loadMore();
115203
+ }, [isFetchingRecipients, isLoadingRecipients, hasMore, loadMore]);
114620
115204
  const allUsersSelected = includedSegments.length === 1 && excludedSegments.length === 0 && segments?.find(
114621
115205
  (segment2) => segment2.type === BusinessSegmentTypeEnum.ALL_USERS && segment2.id === includedSegments[0]
114622
115206
  ) !== void 0;
@@ -114923,6 +115507,7 @@ const AutomationAudienceSelectorMain = ({ title: title2 = "Preview Audience" })
114923
115507
  searchQuery,
114924
115508
  onSearchChange: setSearchQuery,
114925
115509
  onLoadMore: handleLoadMore,
115510
+ hasMore,
114926
115511
  isLoadingMore: (
114927
115512
  // Only show bottom loading indicator if filter hasn't changed (pagination)
114928
115513
  isFetchingRecipients && !filterChanged
@@ -116792,6 +117377,7 @@ const styles$1 = {
116792
117377
  headerActions
116793
117378
  };
116794
117379
  const EmailAttributionDialogContent = () => {
117380
+ const isSmsEnabled = useSmsEnabled();
116795
117381
  const containerVariants = {
116796
117382
  hidden: { opacity: 0 },
116797
117383
  visible: {
@@ -116817,9 +117403,9 @@ const EmailAttributionDialogContent = () => {
116817
117403
  description: "Short attribution lookback period"
116818
117404
  },
116819
117405
  {
116820
- icon: Eye,
116821
- title: "Engagement Required",
116822
- description: "Must click or open email"
117406
+ icon: Mail,
117407
+ title: "Send-Based Attribution",
117408
+ description: "Based on email send, not clicks"
116823
117409
  },
116824
117410
  {
116825
117411
  icon: Target,
@@ -116835,16 +117421,11 @@ const EmailAttributionDialogContent = () => {
116835
117421
  },
116836
117422
  {
116837
117423
  number: 2,
116838
- title: "Customer Engagement",
116839
- description: "The customer either clicks a link or opens the email (engagement is required for attribution)."
116840
- },
116841
- {
116842
- number: 3,
116843
117424
  title: "Purchase Occurs",
116844
- description: "Within 5 days of the email engagement, the customer makes a purchase."
117425
+ description: "Within 5 days of when the email was sent, the customer makes a purchase."
116845
117426
  },
116846
117427
  {
116847
- number: 4,
117428
+ number: 3,
116848
117429
  title: "Revenue Attribution",
116849
117430
  description: "The purchase revenue is attributed to the specific automation that sent the email."
116850
117431
  }
@@ -116853,7 +117434,7 @@ const EmailAttributionDialogContent = () => {
116853
117434
  {
116854
117435
  id: 1,
116855
117436
  title: "Valid Email Attribution",
116856
- description: "Customer receives email, engages with it, and purchases within 5 days",
117437
+ description: "Customer receives email and purchases within 5 days",
116857
117438
  steps: [
116858
117439
  {
116859
117440
  platform: "Email Campaign",
@@ -116874,12 +117455,12 @@ const EmailAttributionDialogContent = () => {
116874
117455
  color: "bg-green-600"
116875
117456
  }
116876
117457
  ],
116877
- attribution: "Email campaign gets 100% credit (customer engaged and purchased within 5 days)"
117458
+ attribution: "Email campaign gets 100% credit (customer purchased within 5 days of when email was sent)"
116878
117459
  },
116879
117460
  {
116880
117461
  id: 2,
116881
- title: "No Engagement - No Attribution",
116882
- description: "Customer receives email but never opens or clicks, then purchases",
117462
+ title: "Valid Attribution Without Click",
117463
+ description: "Customer receives email but never clicks, then purchases",
116883
117464
  steps: [
116884
117465
  {
116885
117466
  platform: "Email Campaign",
@@ -116889,7 +117470,7 @@ const EmailAttributionDialogContent = () => {
116889
117470
  },
116890
117471
  {
116891
117472
  platform: "Customer",
116892
- action: "No Engagement",
117473
+ action: "No Click",
116893
117474
  day: "Day 1-5",
116894
117475
  color: "bg-gray-400"
116895
117476
  },
@@ -116900,12 +117481,12 @@ const EmailAttributionDialogContent = () => {
116900
117481
  color: "bg-green-600"
116901
117482
  }
116902
117483
  ],
116903
- attribution: "No attribution (email was sent but customer never engaged with it)"
117484
+ attribution: "Email campaign gets 100% credit (customer purchased within 5 days of when email was sent)"
116904
117485
  },
116905
117486
  {
116906
117487
  id: 3,
116907
117488
  title: "Attribution Window Expired",
116908
- description: "Customer engaged with email but purchased outside the 5-day window",
117489
+ description: "Customer purchased more than 5 days after the email was sent",
116909
117490
  steps: [
116910
117491
  {
116911
117492
  platform: "Email Campaign",
@@ -116926,7 +117507,7 @@ const EmailAttributionDialogContent = () => {
116926
117507
  color: "bg-green-600"
116927
117508
  }
116928
117509
  ],
116929
- attribution: "No attribution (purchase occurred 7 days after email engagement, outside 5-day window)"
117510
+ attribution: "No attribution (purchase occurred 7 days after email was sent, outside 5-day window)"
116930
117511
  }
116931
117512
  ];
116932
117513
  const keyPoints = [
@@ -116934,10 +117515,7 @@ const EmailAttributionDialogContent = () => {
116934
117515
  text: "Only emails sent through automations count for attribution"
116935
117516
  },
116936
117517
  {
116937
- text: "Customer must click or open the email for attribution to occur"
116938
- },
116939
- {
116940
- text: "The 5-day window starts from when the email was sent, not when it was opened"
117518
+ text: "The 5-day window starts from when the email was sent"
116941
117519
  },
116942
117520
  {
116943
117521
  text: "Revenue is attributed to the specific automation that sent the email"
@@ -116963,8 +117541,8 @@ const EmailAttributionDialogContent = () => {
116963
117541
  FeatureHighlights,
116964
117542
  {
116965
117543
  highlights: featureHighlights,
116966
- cardTitle: "Email Engagement Attribution Model",
116967
- cardDescription: "We use a 5-day engagement-based attribution model that requires customer interaction with your emails",
117544
+ cardTitle: "Email Send Attribution Model",
117545
+ cardDescription: "We use a 5-day send-based attribution model. When an email is sent, any purchase within 5 days is attributed to that automation.",
116968
117546
  cardIcon: MousePointer
116969
117547
  }
116970
117548
  ) }),
@@ -116992,7 +117570,141 @@ const EmailAttributionDialogContent = () => {
116992
117570
  points: keyPoints,
116993
117571
  variant: "highlighted"
116994
117572
  }
116995
- ) })
117573
+ ) }),
117574
+ isSmsEnabled && /* @__PURE__ */ jsxs(Fragment$1, { children: [
117575
+ /* @__PURE__ */ jsx(motion.div, { variants: itemVariants2, children: /* @__PURE__ */ jsx(
117576
+ DialogHeader,
117577
+ {
117578
+ title: "SMS Attribution Methodology",
117579
+ description: "How we track and attribute conversions to your SMS marketing automations",
117580
+ icon: MessageSquare
117581
+ }
117582
+ ) }),
117583
+ /* @__PURE__ */ jsx(motion.div, { variants: itemVariants2, children: /* @__PURE__ */ jsx(
117584
+ FeatureHighlights,
117585
+ {
117586
+ highlights: [
117587
+ {
117588
+ icon: Clock,
117589
+ title: "5-Day Window",
117590
+ description: "Short attribution lookback period"
117591
+ },
117592
+ {
117593
+ icon: Target,
117594
+ title: "Automation-Linked",
117595
+ description: "Tied to specific campaigns"
117596
+ }
117597
+ ],
117598
+ cardTitle: "SMS Send Attribution Model",
117599
+ cardDescription: "We use a 5-day send-based attribution model. When an SMS is sent, any purchase within 5 days is attributed to that automation.",
117600
+ cardIcon: MousePointer
117601
+ }
117602
+ ) }),
117603
+ /* @__PURE__ */ jsx(motion.div, { variants: itemVariants2, children: /* @__PURE__ */ jsx(
117604
+ ProcessSteps,
117605
+ {
117606
+ steps: [
117607
+ {
117608
+ number: 1,
117609
+ title: "SMS Sent via Automation",
117610
+ description: "An SMS is sent to a customer through one of your marketing automations."
117611
+ },
117612
+ {
117613
+ number: 2,
117614
+ title: "Purchase Occurs",
117615
+ description: "Within 5 days of when the SMS was sent, the customer makes a purchase."
117616
+ },
117617
+ {
117618
+ number: 3,
117619
+ title: "Revenue Attribution",
117620
+ description: "The purchase revenue is attributed to the specific automation that sent the SMS."
117621
+ }
117622
+ ],
117623
+ title: "How SMS Attribution Works",
117624
+ icon: TrendingUp
117625
+ }
117626
+ ) }),
117627
+ /* @__PURE__ */ jsx(motion.div, { variants: itemVariants2, children: /* @__PURE__ */ jsx(
117628
+ ExpandableScenarios,
117629
+ {
117630
+ scenarios: [
117631
+ {
117632
+ id: 4,
117633
+ title: "Valid SMS Attribution",
117634
+ description: "Customer receives SMS and purchases within 5 days",
117635
+ steps: [
117636
+ {
117637
+ platform: "SMS Campaign",
117638
+ action: "Sent",
117639
+ day: "Day 1",
117640
+ color: "bg-blue-500"
117641
+ },
117642
+ {
117643
+ platform: "Customer",
117644
+ action: "Clicked",
117645
+ day: "Day 1",
117646
+ color: "bg-green-500"
117647
+ },
117648
+ {
117649
+ platform: "Purchase",
117650
+ action: "Completed",
117651
+ day: "Day 3",
117652
+ color: "bg-green-600"
117653
+ }
117654
+ ],
117655
+ attribution: "SMS campaign gets 100% credit (customer purchased within 5 days of when SMS was sent)"
117656
+ },
117657
+ {
117658
+ id: 6,
117659
+ title: "Attribution Window Expired",
117660
+ description: "Customer purchased more than 5 days after the SMS was sent",
117661
+ steps: [
117662
+ {
117663
+ platform: "SMS Campaign",
117664
+ action: "Sent",
117665
+ day: "Day 1",
117666
+ color: "bg-blue-500"
117667
+ },
117668
+ {
117669
+ platform: "Customer",
117670
+ action: "Clicked",
117671
+ day: "Day 1",
117672
+ color: "bg-green-500"
117673
+ },
117674
+ {
117675
+ platform: "Purchase",
117676
+ action: "Completed",
117677
+ day: "Day 8",
117678
+ color: "bg-green-600"
117679
+ }
117680
+ ],
117681
+ attribution: "No attribution (purchase occurred 7 days after SMS was sent, outside 5-day window)"
117682
+ }
117683
+ ],
117684
+ title: "SMS Attribution Scenarios",
117685
+ description: "See how different SMS engagement patterns are attributed",
117686
+ icon: Eye
117687
+ }
117688
+ ) }),
117689
+ /* @__PURE__ */ jsx(motion.div, { variants: itemVariants2, children: /* @__PURE__ */ jsx(
117690
+ KeyPointsList,
117691
+ {
117692
+ title: "Important Notes",
117693
+ points: [
117694
+ {
117695
+ text: "Only SMS messages sent through automations count for attribution"
117696
+ },
117697
+ {
117698
+ text: "The 5-day window starts from when the SMS was sent"
117699
+ },
117700
+ {
117701
+ text: "Revenue is attributed to the specific automation that sent the SMS"
117702
+ }
117703
+ ],
117704
+ variant: "highlighted"
117705
+ }
117706
+ ) })
117707
+ ] })
116996
117708
  ]
116997
117709
  }
116998
117710
  );
@@ -117262,6 +117974,7 @@ const AutomationStatistics = ({
117262
117974
  }) => {
117263
117975
  const [isLinkClickStatsOpen, setIsLinkClickStatsOpen] = useState(false);
117264
117976
  const [isEmailAttributionOpen, setIsEmailAttributionOpen] = useState(false);
117977
+ const isSmsEnabled = useSmsEnabled();
117265
117978
  const {
117266
117979
  statistics: automationStatistics,
117267
117980
  isLoading: isAutomationStatisticsLoading
@@ -117386,7 +118099,7 @@ const AutomationStatistics = ({
117386
118099
  statistics,
117387
118100
  automationId,
117388
118101
  onLinkClickStatsOpen: () => setIsLinkClickStatsOpen(true),
117389
- includeSms,
118102
+ includeSms: includeSms && isSmsEnabled,
117390
118103
  showErrors
117391
118104
  }
117392
118105
  )
@@ -117834,7 +118547,7 @@ function SegmentList() {
117834
118547
  const segmentsMapped = useMemo(
117835
118548
  () => segments ? segments.map((segment2) => ({
117836
118549
  ...segment2,
117837
- updated_at: segment2.createdAt.toString(),
118550
+ updated_at: segment2.createdAt?.toString(),
117838
118551
  user_count: segment2.userCount,
117839
118552
  user_count_updated_at: segment2.userCountUpdatedAt
117840
118553
  })) : [],