@livechat/platform-workflows 0.0.89 → 0.0.91

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.
package/dist/index.mjs CHANGED
@@ -1,78 +1,13 @@
1
1
  "use client"
2
- var __create = Object.create;
3
- var __defProp = Object.defineProperty;
4
- var __defProps = Object.defineProperties;
5
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
- var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
7
- var __getOwnPropNames = Object.getOwnPropertyNames;
8
- var __getOwnPropSymbols = Object.getOwnPropertySymbols;
9
- var __getProtoOf = Object.getPrototypeOf;
10
- var __hasOwnProp = Object.prototype.hasOwnProperty;
11
- var __propIsEnum = Object.prototype.propertyIsEnumerable;
12
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
13
- var __spreadValues = (a, b) => {
14
- for (var prop in b || (b = {}))
15
- if (__hasOwnProp.call(b, prop))
16
- __defNormalProp(a, prop, b[prop]);
17
- if (__getOwnPropSymbols)
18
- for (var prop of __getOwnPropSymbols(b)) {
19
- if (__propIsEnum.call(b, prop))
20
- __defNormalProp(a, prop, b[prop]);
21
- }
22
- return a;
23
- };
24
- var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
25
- var __objRest = (source, exclude) => {
26
- var target = {};
27
- for (var prop in source)
28
- if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
29
- target[prop] = source[prop];
30
- if (source != null && __getOwnPropSymbols)
31
- for (var prop of __getOwnPropSymbols(source)) {
32
- if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
33
- target[prop] = source[prop];
34
- }
35
- return target;
36
- };
37
- var __commonJS = (cb, mod) => function __require() {
38
- return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
39
- };
40
- var __copyProps = (to, from2, except, desc) => {
41
- if (from2 && typeof from2 === "object" || typeof from2 === "function") {
42
- for (let key of __getOwnPropNames(from2))
43
- if (!__hasOwnProp.call(to, key) && key !== except)
44
- __defProp(to, key, { get: () => from2[key], enumerable: !(desc = __getOwnPropDesc(from2, key)) || desc.enumerable });
45
- }
46
- return to;
47
- };
48
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
49
- // If the importer is in node compatibility mode or this is not an ESM
50
- // file that has been converted to a CommonJS file using a Babel-
51
- // compatible transform (i.e. "__esModule" has not been set), then set
52
- // "default" to the CommonJS "module.exports" for node compatibility.
53
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
54
- mod
55
- ));
56
- var __async = (__this, __arguments, generator) => {
57
- return new Promise((resolve, reject) => {
58
- var fulfilled = (value) => {
59
- try {
60
- step(generator.next(value));
61
- } catch (e) {
62
- reject(e);
63
- }
64
- };
65
- var rejected = (value) => {
66
- try {
67
- step(generator.throw(value));
68
- } catch (e) {
69
- reject(e);
70
- }
71
- };
72
- var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
73
- step((generator = generator.apply(__this, __arguments)).next());
74
- });
75
- };
2
+ import {
3
+ WORKFLOWS_TEST_SELECTORS,
4
+ __async,
5
+ __commonJS,
6
+ __objRest,
7
+ __spreadProps,
8
+ __spreadValues,
9
+ __toESM
10
+ } from "./chunk-Q53XLSIX.mjs";
76
11
 
77
12
  // ../../../node_modules/.pnpm/react-is@16.13.1/node_modules/react-is/cjs/react-is.production.min.js
78
13
  var require_react_is_production_min = __commonJS({
@@ -442,9 +377,9 @@ var require_hoist_non_react_statics_cjs = __commonJS({
442
377
  }
443
378
  });
444
379
 
445
- // ../../../node_modules/.pnpm/@babel+runtime@7.26.0/node_modules/@babel/runtime/helpers/extends.js
380
+ // ../../../node_modules/.pnpm/@babel+runtime@7.26.9/node_modules/@babel/runtime/helpers/extends.js
446
381
  var require_extends = __commonJS({
447
- "../../../node_modules/.pnpm/@babel+runtime@7.26.0/node_modules/@babel/runtime/helpers/extends.js"(exports, module) {
382
+ "../../../node_modules/.pnpm/@babel+runtime@7.26.9/node_modules/@babel/runtime/helpers/extends.js"(exports, module) {
448
383
  "use strict";
449
384
  function _extends2() {
450
385
  return module.exports = _extends2 = Object.assign ? Object.assign.bind() : function(n) {
@@ -1339,7 +1274,7 @@ var createCache = function createCache2(options) {
1339
1274
  return cache;
1340
1275
  };
1341
1276
 
1342
- // ../../../node_modules/.pnpm/@babel+runtime@7.26.0/node_modules/@babel/runtime/helpers/esm/extends.js
1277
+ // ../../../node_modules/.pnpm/@babel+runtime@7.26.9/node_modules/@babel/runtime/helpers/esm/extends.js
1343
1278
  function _extends() {
1344
1279
  return _extends = Object.assign ? Object.assign.bind() : function(n) {
1345
1280
  for (var e = 1; e < arguments.length; e++) {
@@ -2063,7 +1998,7 @@ var useDeleteWorkflow = () => {
2063
1998
  );
2064
1999
  }),
2065
2000
  {
2066
- onSuccess: (_, workflow) => {
2001
+ onSuccess: (_2, workflow) => {
2067
2002
  queryClient.removeQueries(queryKeys.workflow.get(workflow.id));
2068
2003
  if (workflow.related_workflow_id) {
2069
2004
  queryClient.setQueryData(
@@ -2092,7 +2027,7 @@ var usePublishWorkflowDraft = () => {
2092
2027
  return { id: data.id };
2093
2028
  }),
2094
2029
  {
2095
- onSuccess: (_, draft) => __async(void 0, null, function* () {
2030
+ onSuccess: (_2, draft) => __async(void 0, null, function* () {
2096
2031
  if (draft.related_workflow_id) {
2097
2032
  const workflow = yield api2.integrations.text.platform.workflow.workflows.getWorkflow(
2098
2033
  draft.related_workflow_id
@@ -2129,7 +2064,7 @@ var useActivateWorkflow = () => {
2129
2064
  );
2130
2065
  }),
2131
2066
  {
2132
- onSuccess: (_, { id }) => {
2067
+ onSuccess: (_2, { id }) => {
2133
2068
  queryClient.setQueryData(
2134
2069
  queryKeys.workflow.get(id),
2135
2070
  (workflow) => workflow ? __spreadProps(__spreadValues({}, workflow), { active: true }) : workflow
@@ -2300,17 +2235,17 @@ function Waitlist({ image }) {
2300
2235
  var Waitlist_default = Waitlist;
2301
2236
 
2302
2237
  // src/views/Workflows/index.tsx
2303
- import { useEffect as useEffect20 } from "react";
2304
- import { Navigate as Navigate2, Route as Route6, Routes as Routes6, useNavigate as useNavigate21 } from "react-router-dom";
2238
+ import { useEffect as useEffect21 } from "react";
2239
+ import { Navigate as Navigate2, Route as Route6, Routes as Routes6, useNavigate as useNavigate22 } from "react-router-dom";
2305
2240
  import { Loader as Loader6 } from "@livechat/developer-studio-ui-react";
2306
2241
 
2307
2242
  // src/views/Workflows/Creator/index.tsx
2308
2243
  import {
2309
2244
  Route as Route3,
2310
2245
  Routes as Routes3,
2311
- useLocation as useLocation5,
2312
- useNavigate as useNavigate13,
2313
- useParams as useParams4
2246
+ useLocation as useLocation6,
2247
+ useNavigate as useNavigate14,
2248
+ useParams as useParams5
2314
2249
  } from "react-router-dom";
2315
2250
  import {
2316
2251
  Loader as Loader3,
@@ -2348,7 +2283,7 @@ var WORKFLOW_TRIGGER_OUTPUT_SCHEMA = (body) => ({
2348
2283
  }
2349
2284
  });
2350
2285
  var WORKFLOW_HTTP_TASK_SCHEMA = (name = "http", overrides) => {
2351
- var _a, _b;
2286
+ var _a, _b, _c;
2352
2287
  return {
2353
2288
  required: ["type", "name", "inputParameters"],
2354
2289
  properties: {
@@ -2367,7 +2302,7 @@ var WORKFLOW_HTTP_TASK_SCHEMA = (name = "http", overrides) => {
2367
2302
  (overrides == null ? void 0 : overrides.body) ? "body" : void 0
2368
2303
  ].filter(Boolean),
2369
2304
  properties: {
2370
- uri: {
2305
+ uri: (_a = overrides == null ? void 0 : overrides.uri) != null ? _a : {
2371
2306
  type: "string",
2372
2307
  title: "URI"
2373
2308
  },
@@ -2376,7 +2311,7 @@ var WORKFLOW_HTTP_TASK_SCHEMA = (name = "http", overrides) => {
2376
2311
  title: "Method",
2377
2312
  enum: ["GET", "POST", "PATCH", "PUT", "DELETE"]
2378
2313
  },
2379
- headers: (_a = overrides == null ? void 0 : overrides.headers) != null ? _a : {
2314
+ headers: (_b = overrides == null ? void 0 : overrides.headers) != null ? _b : {
2380
2315
  type: "object",
2381
2316
  title: "Headers",
2382
2317
  properties: {},
@@ -2384,7 +2319,7 @@ var WORKFLOW_HTTP_TASK_SCHEMA = (name = "http", overrides) => {
2384
2319
  type: "string"
2385
2320
  }
2386
2321
  },
2387
- body: (_b = overrides == null ? void 0 : overrides.body) != null ? _b : {
2322
+ body: (_c = overrides == null ? void 0 : overrides.body) != null ? _c : {
2388
2323
  type: "object",
2389
2324
  title: "Body",
2390
2325
  properties: {},
@@ -2409,10 +2344,19 @@ var WORKFLOW_HTTP_TASK_SCHEMA = (name = "http", overrides) => {
2409
2344
  };
2410
2345
  var WORKFLOW_HTTP_TASK_INPUT_SCHEMA = (body, query) => ({
2411
2346
  type: "object",
2412
- required: [body ? "body" : void 0, query ? "query" : void 0].filter(
2413
- Boolean
2414
- ),
2415
- properties: __spreadValues(__spreadValues({}, query ? {
2347
+ required: [
2348
+ "uri",
2349
+ body ? "body" : void 0,
2350
+ query ? "query" : void 0
2351
+ ].filter(Boolean),
2352
+ properties: __spreadValues(__spreadValues({
2353
+ uri: query ? {
2354
+ type: "string",
2355
+ queryParams: query
2356
+ } : {
2357
+ type: "string"
2358
+ }
2359
+ }, query ? {
2416
2360
  query
2417
2361
  } : {}), body ? {
2418
2362
  body
@@ -4972,7 +4916,7 @@ var webhookSpecs2 = {
4972
4916
  required: [],
4973
4917
  properties: {
4974
4918
  targetAgentId: {
4975
- type: "string",
4919
+ $ref: "#/$defs/livechat_agent",
4976
4920
  title: "Target Agent email"
4977
4921
  }
4978
4922
  }
@@ -5458,9 +5402,7 @@ var webhookSpecs2 = {
5458
5402
  required: [],
5459
5403
  properties: {
5460
5404
  tag: {
5461
- type: "string",
5462
- title: "Tag",
5463
- description: "The name of the tag."
5405
+ $ref: "#/$defs/livechat_tag"
5464
5406
  },
5465
5407
  exact: {
5466
5408
  type: "boolean",
@@ -6119,7 +6061,7 @@ var livechatTriggerTemplates = () => ({
6119
6061
  source: IntegrationNames5.LiveChat,
6120
6062
  event: {
6121
6063
  name: TextLivechatEventNames.ChatTagged,
6122
- tag: "tag",
6064
+ tag: void 0,
6123
6065
  exact: false
6124
6066
  },
6125
6067
  headers: {
@@ -6335,12 +6277,9 @@ var mailchimpTaskConfigs = () => ({
6335
6277
  specification: {
6336
6278
  input: WORKFLOW_HTTP_TASK_INPUT_SCHEMA({
6337
6279
  type: "object",
6338
- required: ["list_id", "first_name", "last_name", "email"],
6280
+ required: ["list_id", "email", "first_name", "last_name"],
6339
6281
  properties: {
6340
6282
  list_id: {
6341
- type: "string",
6342
- title: "Mailchimp audience ID",
6343
- description: "The unique ID of your audience. <a href='https://mailchimp.com/help/find-audience-id/' target='_blank' rel='noreferrer nofollow'>Here's<a/> how to find it.",
6344
6283
  $ref: "#/$defs/mailchimp_audience"
6345
6284
  },
6346
6285
  email: {
@@ -6392,9 +6331,6 @@ var mailchimpTaskConfigs = () => ({
6392
6331
  required: ["list_id"],
6393
6332
  properties: {
6394
6333
  list_id: {
6395
- type: "string",
6396
- title: "Mailchimp audience ID",
6397
- description: "The unique ID of your audience. <a href='https://mailchimp.com/help/find-audience-id/' target='_blank' rel='noreferrer nofollow'>Here's<a/> how to find it.",
6398
6334
  $ref: "#/$defs/mailchimp_audience"
6399
6335
  }
6400
6336
  }
@@ -6428,10 +6364,7 @@ var mailchimpTaskConfigs = () => ({
6428
6364
  required: ["campaign_id"],
6429
6365
  properties: {
6430
6366
  campaign_id: {
6431
- type: "string",
6432
- title: "Campaign ID",
6433
- description: `The unique ID for the campaign. You'll find it by going to the Campaigns page in Mailchimp and selecting View Email from the drop-down list for the campaign. The URL indicates the campaign ID by the prefix "id=".`
6434
- // $ref: '#/$defs/mailchimp_campaign',
6367
+ $ref: "#/$defs/mailchimp_campaign"
6435
6368
  }
6436
6369
  }
6437
6370
  }),
@@ -6457,12 +6390,9 @@ var mailchimpTaskConfigs = () => ({
6457
6390
  specification: {
6458
6391
  input: WORKFLOW_HTTP_TASK_INPUT_SCHEMA({
6459
6392
  type: "object",
6460
- required: ["list_id", "first_name", "last_name", "email"],
6393
+ required: ["list_id", "email", "first_name", "last_name"],
6461
6394
  properties: {
6462
6395
  list_id: {
6463
- type: "string",
6464
- title: "Mailchimp audience ID",
6465
- description: "The unique ID of your audience. <a href='https://mailchimp.com/help/find-audience-id/' target='_blank' rel='noreferrer nofollow'>Here's<a/> how to find it.",
6466
6396
  $ref: "#/$defs/mailchimp_audience"
6467
6397
  },
6468
6398
  email: {
@@ -6506,12 +6436,9 @@ var mailchimpTaskConfigs = () => ({
6506
6436
  specification: {
6507
6437
  input: WORKFLOW_HTTP_TASK_INPUT_SCHEMA({
6508
6438
  type: "object",
6509
- required: ["list_id", "first_name", "last_name", "email"],
6439
+ required: ["list_id", "email", "first_name", "last_name"],
6510
6440
  properties: {
6511
6441
  list_id: {
6512
- type: "string",
6513
- title: "Mailchimp audience ID",
6514
- description: "The unique ID of your audience. <a href='https://mailchimp.com/help/find-audience-id/' target='_blank' rel='noreferrer nofollow'>Here's<a/> how to find it.",
6515
6442
  $ref: "#/$defs/mailchimp_audience"
6516
6443
  },
6517
6444
  email: {
@@ -6558,9 +6485,6 @@ var mailchimpTaskConfigs = () => ({
6558
6485
  required: ["list_id", "email"],
6559
6486
  properties: {
6560
6487
  list_id: {
6561
- type: "string",
6562
- title: "Mailchimp audience ID",
6563
- description: "The unique ID of your audience. <a href='https://mailchimp.com/help/find-audience-id/' target='_blank' rel='noreferrer nofollow'>Here's<a/> how to find it.",
6564
6488
  $ref: "#/$defs/mailchimp_audience"
6565
6489
  },
6566
6490
  email: {
@@ -6594,9 +6518,6 @@ var mailchimpTaskConfigs = () => ({
6594
6518
  required: ["list_id", "email"],
6595
6519
  properties: {
6596
6520
  list_id: {
6597
- type: "string",
6598
- title: "Mailchimp audience ID",
6599
- description: "The unique ID of your audience. <a href='https://mailchimp.com/help/find-audience-id/' target='_blank' rel='noreferrer nofollow'>Here's<a/> how to find it.",
6600
6521
  $ref: "#/$defs/mailchimp_audience"
6601
6522
  },
6602
6523
  email: {
@@ -6630,9 +6551,6 @@ var mailchimpTaskConfigs = () => ({
6630
6551
  required: ["list_id", "email", "tag"],
6631
6552
  properties: {
6632
6553
  list_id: {
6633
- type: "string",
6634
- title: "Mailchimp audience ID",
6635
- description: "The unique ID of your audience. <a href='https://mailchimp.com/help/find-audience-id/' target='_blank' rel='noreferrer nofollow'>Here's<a/> how to find it.",
6636
6554
  $ref: "#/$defs/mailchimp_audience"
6637
6555
  },
6638
6556
  email: {
@@ -6671,9 +6589,6 @@ var mailchimpTaskConfigs = () => ({
6671
6589
  required: ["list_id", "email", "name"],
6672
6590
  properties: {
6673
6591
  list_id: {
6674
- type: "string",
6675
- title: "Mailchimp audience ID",
6676
- description: "The unique ID of your audience. <a href='https://mailchimp.com/help/find-audience-id/' target='_blank' rel='noreferrer nofollow'>Here's<a/> how to find it.",
6677
6592
  $ref: "#/$defs/mailchimp_audience"
6678
6593
  },
6679
6594
  email: {
@@ -6728,9 +6643,6 @@ var mailchimpTaskConfigs = () => ({
6728
6643
  required: ["list_id", "email", "note"],
6729
6644
  properties: {
6730
6645
  list_id: {
6731
- type: "string",
6732
- title: "Mailchimp audience ID",
6733
- description: "The unique ID of your audience. <a href='https://mailchimp.com/help/find-audience-id/' target='_blank' rel='noreferrer nofollow'>Here's<a/> how to find it.",
6734
6646
  $ref: "#/$defs/mailchimp_audience"
6735
6647
  },
6736
6648
  email: {
@@ -6769,9 +6681,6 @@ var mailchimpTaskConfigs = () => ({
6769
6681
  required: ["list_id", "email", "tag"],
6770
6682
  properties: {
6771
6683
  list_id: {
6772
- type: "string",
6773
- title: "Mailchimp audience ID",
6774
- description: "The unique ID of your audience. <a href='https://mailchimp.com/help/find-audience-id/' target='_blank' rel='noreferrer nofollow'>Here's<a/> how to find it.",
6775
6684
  $ref: "#/$defs/mailchimp_audience"
6776
6685
  },
6777
6686
  email: {
@@ -6809,9 +6718,6 @@ var mailchimpTaskConfigs = () => ({
6809
6718
  required: ["list_id", "email"],
6810
6719
  properties: {
6811
6720
  list_id: {
6812
- type: "string",
6813
- title: "Mailchimp audience ID",
6814
- description: "The unique ID of your audience. <a href='https://mailchimp.com/help/find-audience-id/' target='_blank' rel='noreferrer nofollow'>Here's<a/> how to find it.",
6815
6721
  $ref: "#/$defs/mailchimp_audience"
6816
6722
  },
6817
6723
  email: {
@@ -6875,9 +6781,6 @@ var mailchimpTaskConfigs = () => ({
6875
6781
  required: ["list_id", "email"],
6876
6782
  properties: {
6877
6783
  list_id: {
6878
- type: "string",
6879
- title: "Mailchimp audience ID",
6880
- description: "The unique ID of your audience. <a href='https://mailchimp.com/help/find-audience-id/' target='_blank' rel='noreferrer nofollow'>Here's<a/> how to find it.",
6881
6784
  $ref: "#/$defs/mailchimp_audience"
6882
6785
  },
6883
6786
  email: {
@@ -7051,10 +6954,8 @@ var mailchimpTaskConfigs = () => ({
7051
6954
  required: ["list_id", "query"],
7052
6955
  properties: {
7053
6956
  list_id: {
7054
- type: "string",
7055
- title: "Mailchimp audience ID",
7056
- description: "The unique ID of your audience. <a href='https://mailchimp.com/help/find-audience-id/' target='_blank' rel='noreferrer nofollow'>Here's<a/> how to find it.",
7057
- $ref: "#/$defs/mailchimp_audience"
6957
+ $ref: "#/$defs/mailchimp_audience",
6958
+ minLength: 1
7058
6959
  },
7059
6960
  query: {
7060
6961
  type: "string",
@@ -7228,10 +7129,7 @@ var mailchimpTaskConfigs = () => ({
7228
7129
  required: ["campaign_id"],
7229
7130
  properties: {
7230
7131
  campaign_id: {
7231
- type: "string",
7232
- title: "Campaign ID",
7233
- description: `The unique ID for the campaign. You'll find it by going to the Campaigns page in Mailchimp and selecting View Email from the drop-down list for the campaign. The URL indicates the campaign ID by the prefix "id=".`
7234
- //$ref: '#/$defs/mailchimp_campaign'
7132
+ $ref: "#/$defs/mailchimp_campaign"
7235
7133
  }
7236
7134
  }
7237
7135
  }),
@@ -9463,7 +9361,7 @@ var WORKFLOW_SCHEMA_DEFS = {
9463
9361
  },
9464
9362
  ...Object.values(WorkflowSpecification.config.tasks).map(
9465
9363
  (config2) => {
9466
- var _a, _b;
9364
+ var _a, _b, _c, _d;
9467
9365
  return {
9468
9366
  if: {
9469
9367
  properties: {
@@ -9472,7 +9370,8 @@ var WORKFLOW_SCHEMA_DEFS = {
9472
9370
  }
9473
9371
  },
9474
9372
  then: WORKFLOW_HTTP_TASK_SCHEMA(config2.key, {
9475
- body: (_b = (_a = config2.specification.input) == null ? void 0 : _a.properties) == null ? void 0 : _b.body
9373
+ uri: (_b = (_a = config2.specification.input) == null ? void 0 : _a.properties) == null ? void 0 : _b.uri,
9374
+ body: (_d = (_c = config2.specification.input) == null ? void 0 : _c.properties) == null ? void 0 : _d.body
9476
9375
  })
9477
9376
  };
9478
9377
  }
@@ -9499,6 +9398,10 @@ var WORKFLOW_SCHEMA_DEFS = {
9499
9398
  }),
9500
9399
  $defs: {
9501
9400
  mailchimp_audience: {
9401
+ type: "string",
9402
+ title: "Mailchimp audience ID",
9403
+ description: "The unique ID of your audience. <a href='https://mailchimp.com/help/find-audience-id/' target='_blank' rel='noreferrer nofollow'>Here's<a/> how to find it.",
9404
+ visible: true,
9502
9405
  "x-ref": {
9503
9406
  provider: "mailchimp",
9504
9407
  product: "mailchimp",
@@ -9508,17 +9411,23 @@ var WORKFLOW_SCHEMA_DEFS = {
9508
9411
  }
9509
9412
  },
9510
9413
  mailchimp_campaign: {
9511
- "x-ref": {
9512
- provider: "mailchimp",
9513
- product: "mailchimp",
9514
- name: "campaign",
9515
- displayField: "name",
9516
- valueField: "id"
9517
- }
9414
+ type: "string",
9415
+ title: "Campaign ID",
9416
+ description: `The unique ID for the campaign. You'll find it by going to the Campaigns page in Mailchimp and selecting View Email from the drop-down list for the campaign. The URL indicates the campaign ID by the prefix "id=".`,
9417
+ visible: true
9418
+ // TODO WD: it not ready yet, but WIP on BE side
9419
+ // 'x-ref': {
9420
+ // provider: 'mailchimp',
9421
+ // product: 'mailchimp',
9422
+ // name: 'campaign',
9423
+ // displayField: 'name',
9424
+ // valueField: 'id'
9425
+ // }
9518
9426
  },
9519
9427
  helpdesk_ticket: {
9520
9428
  title: "Ticket ID",
9521
9429
  type: "string",
9430
+ visible: true,
9522
9431
  "x-ref": {
9523
9432
  provider: "text",
9524
9433
  product: "helpdesk",
@@ -9530,6 +9439,7 @@ var WORKFLOW_SCHEMA_DEFS = {
9530
9439
  helpdesk_tag: {
9531
9440
  title: "Tag",
9532
9441
  type: "string",
9442
+ visible: true,
9533
9443
  "x-ref": {
9534
9444
  provider: "text",
9535
9445
  product: "helpdesk",
@@ -9541,21 +9451,24 @@ var WORKFLOW_SCHEMA_DEFS = {
9541
9451
  helpdesk_agent: {
9542
9452
  title: "Agent",
9543
9453
  type: "string",
9454
+ visible: true,
9544
9455
  "x-ref": {
9545
9456
  provider: "text",
9546
9457
  product: "helpdesk",
9547
9458
  name: "agent",
9548
9459
  displayField: "email",
9549
- valueField: "email"
9460
+ valueField: "ID"
9550
9461
  }
9551
9462
  },
9552
9463
  livechat_chat_id: {
9553
9464
  title: "Chat ID",
9554
- type: "string"
9465
+ type: "string",
9466
+ visible: true
9555
9467
  },
9556
9468
  livechat_tag: {
9557
9469
  title: "Tag",
9558
9470
  type: "string",
9471
+ visible: true,
9559
9472
  "x-ref": {
9560
9473
  provider: "text",
9561
9474
  product: "livechat",
@@ -9568,6 +9481,7 @@ var WORKFLOW_SCHEMA_DEFS = {
9568
9481
  title: "Agent",
9569
9482
  type: "string",
9570
9483
  format: "email",
9484
+ visible: true,
9571
9485
  "x-ref": {
9572
9486
  provider: "text",
9573
9487
  product: "livechat",
@@ -9579,6 +9493,7 @@ var WORKFLOW_SCHEMA_DEFS = {
9579
9493
  livechat_group: {
9580
9494
  title: "Group",
9581
9495
  type: "number",
9496
+ visible: true,
9582
9497
  "x-ref": {
9583
9498
  provider: "text",
9584
9499
  product: "livechat",
@@ -12657,8 +12572,8 @@ var getWorkflowTemplates = () => [
12657
12572
  ];
12658
12573
 
12659
12574
  // src/views/Workflows/Creator/Modals/AddTask/Modal.tsx
12660
- import { useEffect as useEffect4, useMemo as useMemo3, useState as useState5 } from "react";
12661
- import { NavLink, useLocation, useNavigate as useNavigate3, useParams } from "react-router-dom";
12575
+ import { useEffect as useEffect5, useMemo as useMemo4, useState as useState5 } from "react";
12576
+ import { NavLink, useLocation as useLocation2, useNavigate as useNavigate4, useParams as useParams2 } from "react-router-dom";
12662
12577
  import {
12663
12578
  Button as Button2,
12664
12579
  DesignToken as DesignToken4,
@@ -13138,13 +13053,13 @@ var ProductIcon_default = ProductIcon;
13138
13053
  // src/views/Workflows/Creator/Provider/index.tsx
13139
13054
  import {
13140
13055
  createContext as createContext4,
13141
- useCallback as useCallback2,
13056
+ useCallback as useCallback4,
13142
13057
  useContext as useContext6,
13143
- useEffect as useEffect3,
13144
- useRef as useRef2,
13058
+ useEffect as useEffect4,
13059
+ useRef as useRef3,
13145
13060
  useState as useState4
13146
13061
  } from "react";
13147
- import { useNavigate as useNavigate2 } from "react-router-dom";
13062
+ import { useNavigate as useNavigate3 } from "react-router-dom";
13148
13063
  import { ReactFlowProvider, useReactFlow } from "reactflow";
13149
13064
  import debounce from "lodash.debounce";
13150
13065
  import { WorkflowDefinitionTaskType as WorkflowDefinitionTaskType12 } from "@livechat/developer-studio-api";
@@ -13384,15 +13299,39 @@ var DEFAULT_NODE_HEIGHT = {
13384
13299
  default: 65
13385
13300
  };
13386
13301
 
13302
+ // src/views/Workflows/Creator/Provider/navigation/hooks.ts
13303
+ import { useCallback, useEffect as useEffect2, useRef as useRef2 } from "react";
13304
+ import { useLocation, useNavigate as useNavigate2, useParams } from "react-router-dom";
13305
+ function useReplaceWorkflowIdInUrl() {
13306
+ const navigate = useNavigate2();
13307
+ const location = useLocation();
13308
+ const { id } = useParams();
13309
+ const latestPathRef = useRef2(location.pathname);
13310
+ useEffect2(() => {
13311
+ latestPathRef.current = location.pathname;
13312
+ }, [location.pathname]);
13313
+ return useCallback(
13314
+ (newId) => {
13315
+ if (!id) {
13316
+ navigate(`/workflow/${newId}`);
13317
+ return;
13318
+ }
13319
+ const latestPath = latestPathRef.current.replace(`/${id}`, `/${newId}`);
13320
+ navigate(latestPath, { replace: true });
13321
+ },
13322
+ [navigate, id]
13323
+ );
13324
+ }
13325
+
13387
13326
  // src/views/Workflows/Creator/Provider/state/data/hooks.ts
13388
- import { useCallback, useEffect as useEffect2, useState as useState3 } from "react";
13327
+ import { useCallback as useCallback2, useEffect as useEffect3, useState as useState3 } from "react";
13389
13328
  function useWorkflowData(workflow) {
13390
13329
  const [actions, setActions] = useState3({});
13391
13330
  const [selection, setSelection] = useState3();
13392
13331
  const [pendingWorkflow, setPendingWorkflow] = useState3(
13393
13332
  () => JSON.parse(JSON.stringify(workflow))
13394
13333
  );
13395
- const setAction = useCallback(
13334
+ const setAction = useCallback2(
13396
13335
  (action, value) => {
13397
13336
  setActions((prevState) => __spreadProps(__spreadValues({}, prevState), {
13398
13337
  [action]: value
@@ -13400,10 +13339,10 @@ function useWorkflowData(workflow) {
13400
13339
  },
13401
13340
  []
13402
13341
  );
13403
- useEffect2(() => {
13342
+ useEffect3(() => {
13404
13343
  setPendingWorkflow(JSON.parse(JSON.stringify(workflow)));
13405
13344
  setSelection((prevState) => {
13406
- if ((prevState == null ? void 0 : prevState.kind) === "trigger") {
13345
+ if ((prevState == null ? void 0 : prevState.kind) === "trigger" && !workflow.trigger.type) {
13407
13346
  return void 0;
13408
13347
  }
13409
13348
  if ((prevState == null ? void 0 : prevState.kind) === "task") {
@@ -13690,9 +13629,27 @@ var getWorkflowContexts = (workflow, external) => {
13690
13629
  };
13691
13630
 
13692
13631
  // src/views/Workflows/Creator/Provider/state/metadata/hooks.ts
13693
- import { useMemo as useMemo2 } from "react";
13632
+ import { useMemo as useMemo3 } from "react";
13694
13633
  import { useFetchIntegrationCredentialsQuery } from "@livechat/platform-integrations";
13695
13634
 
13635
+ // src/views/Workflows/Creator/Provider/state/metadata/utils.ts
13636
+ import { WorkflowDefinitionTaskType as WorkflowDefinitionTaskType11 } from "@livechat/developer-studio-api";
13637
+ var flattenTasks = (tasks) => (Array.isArray(tasks) ? tasks : Object.values(tasks)).flatMap((task2) => {
13638
+ if (task2.type === WorkflowDefinitionTaskType11.switch) {
13639
+ return [
13640
+ task2,
13641
+ ...Object.values(task2.decisionCases).flatMap((a) => flattenTasks(a)),
13642
+ ...task2.defaultCase ? flattenTasks(task2.defaultCase) : []
13643
+ ];
13644
+ } else if (task2.type === WorkflowDefinitionTaskType11.forkJoin) {
13645
+ return [task2, ...task2.forkTasks.flatMap((a) => flattenTasks(a))];
13646
+ }
13647
+ return [task2];
13648
+ });
13649
+
13650
+ // src/views/Workflows/Creator/Provider/state/metadata/validation/hooks.ts
13651
+ import { useCallback as useCallback3, useMemo as useMemo2 } from "react";
13652
+
13696
13653
  // src/hooks/user.ts
13697
13654
  import { useMutation as useMutation2, useQuery as useQuery3, useQueryClient as useQueryClient2 } from "@tanstack/react-query";
13698
13655
  import { api as api3 } from "@livechat/developer-studio-api";
@@ -13725,7 +13682,7 @@ var useUpdateOrganizationProducts = () => {
13725
13682
  product: productName
13726
13683
  }),
13727
13684
  {
13728
- onSuccess: (_) => {
13685
+ onSuccess: (_2) => {
13729
13686
  void queryClient.refetchQueries({
13730
13687
  queryKey: userQueryKeys.accounts.products.getOrganizationProducts
13731
13688
  });
@@ -13735,33 +13692,62 @@ var useUpdateOrganizationProducts = () => {
13735
13692
  return { updateOrganizationProducts, isLoading };
13736
13693
  };
13737
13694
 
13738
- // src/views/Workflows/Creator/Provider/state/metadata/utils.ts
13739
- import { WorkflowDefinitionTaskType as WorkflowDefinitionTaskType11 } from "@livechat/developer-studio-api";
13740
- var flattenTasks = (tasks) => (Array.isArray(tasks) ? tasks : Object.values(tasks)).flatMap((task2) => {
13741
- if (task2.type === WorkflowDefinitionTaskType11.switch) {
13742
- return [
13743
- task2,
13744
- ...Object.values(task2.decisionCases).flatMap((a) => flattenTasks(a)),
13745
- ...task2.defaultCase ? flattenTasks(task2.defaultCase) : []
13746
- ];
13747
- } else if (task2.type === WorkflowDefinitionTaskType11.forkJoin) {
13748
- return [task2, ...task2.forkTasks.flatMap((a) => flattenTasks(a))];
13749
- }
13750
- return [task2];
13751
- });
13752
-
13753
13695
  // src/views/Workflows/Creator/Provider/state/metadata/validation/utils.ts
13754
- import Ajv from "ajv";
13696
+ import Ajv, { _ } from "ajv";
13755
13697
  import AjvWithErrors from "ajv-errors";
13756
13698
  import { IntegrationNames as IntegrationNames12 } from "@livechat/developer-studio-api";
13757
- var ajv = AjvWithErrors(
13699
+ var keywords = {
13700
+ urlWithQueryParams: {
13701
+ keyword: "queryParams",
13702
+ type: "string",
13703
+ schemaType: "object",
13704
+ metaSchema: {
13705
+ type: "object",
13706
+ properties: {
13707
+ queryParams: {
13708
+ type: "object"
13709
+ }
13710
+ }
13711
+ },
13712
+ error: {
13713
+ message: () => "This field cannot be empty",
13714
+ params: (cxt) => _`{ param: ${cxt.params.param} }`
13715
+ },
13716
+ code(cxt) {
13717
+ const { data, schema } = cxt;
13718
+ cxt.gen.if(
13719
+ _`typeof ${data} === "string" && ${data}.includes("?")`,
13720
+ () => {
13721
+ const params = _`Object.fromEntries(new URL(${data}).searchParams.entries())`;
13722
+ for (const param of Object.keys(schema.properties || {})) {
13723
+ cxt.gen.if(
13724
+ _`!(${param} in ${params}) || ${params}[${param}].length <= 0`,
13725
+ () => {
13726
+ cxt.error(
13727
+ true,
13728
+ { param },
13729
+ {
13730
+ instancePath: param
13731
+ }
13732
+ );
13733
+ }
13734
+ );
13735
+ }
13736
+ },
13737
+ () => {
13738
+ cxt.error(true, { param: "URL" });
13739
+ }
13740
+ );
13741
+ }
13742
+ }
13743
+ };
13744
+ var getValidator = () => AjvWithErrors(
13758
13745
  new Ajv({
13759
13746
  strict: false,
13760
13747
  allErrors: true
13761
- })
13762
- );
13763
- var validateSchema = (workflow, frames) => {
13764
- const validate = ajv.compile(WORKFLOW_SCHEMA());
13748
+ }).addKeyword(keywords.urlWithQueryParams)
13749
+ ).compile(WORKFLOW_SCHEMA());
13750
+ var validateSchema = (workflow, frames, validateFunction) => {
13765
13751
  const resolved = __spreadProps(__spreadValues({}, workflow), {
13766
13752
  definition: __spreadProps(__spreadValues({}, workflow.definition), {
13767
13753
  tasks: workflow.definition.tasks.map(
@@ -13782,8 +13768,8 @@ var validateSchema = (workflow, frames) => {
13782
13768
  }
13783
13769
  )
13784
13770
  });
13785
- validate(resolved);
13786
- return validate.errors || [];
13771
+ validateFunction(resolved);
13772
+ return validateFunction.errors || [];
13787
13773
  };
13788
13774
  var validateTasks = (workflow, frames, products) => {
13789
13775
  function taskCompiler(task2, baseInstancePath) {
@@ -14093,11 +14079,11 @@ function flattenErrorSchema(workflow, schema) {
14093
14079
  }).filter(([, value]) => Boolean(value))
14094
14080
  );
14095
14081
  }
14096
- var getWorkflowValidation = (workflow, internal, external) => {
14082
+ var getWorkflowValidation = (workflow, internal, external, validator3) => {
14097
14083
  const rawErrors = [
14098
14084
  ...validateTrigger(workflow, internal.frames, external.products),
14099
14085
  ...validateTasks(workflow, internal.frames, external.products),
14100
- ...validateSchema(workflow, internal.frames)
14086
+ ...validateSchema(workflow, internal.frames, validator3)
14101
14087
  ].filter(
14102
14088
  (rawError) => Boolean(rawError)
14103
14089
  ).map((rawError) => {
@@ -14151,11 +14137,29 @@ var getWorkflowValidation = (workflow, internal, external) => {
14151
14137
  };
14152
14138
  };
14153
14139
 
14140
+ // src/views/Workflows/Creator/Provider/state/metadata/validation/hooks.ts
14141
+ function useWorkflowValidator() {
14142
+ const organizationProducts = useFetchOrganizationProducts();
14143
+ const validator3 = useMemo2(getValidator, []);
14144
+ const validate = useCallback3(
14145
+ (workflow, internal) => getWorkflowValidation(
14146
+ workflow,
14147
+ internal,
14148
+ {
14149
+ products: organizationProducts.data
14150
+ },
14151
+ validator3
14152
+ ),
14153
+ [validator3, organizationProducts.data]
14154
+ );
14155
+ return validate;
14156
+ }
14157
+
14154
14158
  // src/views/Workflows/Creator/Provider/state/metadata/hooks.ts
14155
14159
  function useWorkflowMetadata(workflow) {
14156
14160
  const credentialsQuery = useFetchIntegrationCredentialsQuery();
14157
- const organizationProducts = useFetchOrganizationProducts();
14158
- const metadata = useMemo2(() => {
14161
+ const validator3 = useWorkflowValidator();
14162
+ const metadata = useMemo3(() => {
14159
14163
  var _a;
14160
14164
  const elements = {
14161
14165
  trigger: workflow.trigger,
@@ -14169,19 +14173,13 @@ function useWorkflowMetadata(workflow) {
14169
14173
  const frames = getWorkflowContexts(workflow, {
14170
14174
  credentials: (_a = credentialsQuery.data) != null ? _a : []
14171
14175
  });
14172
- const validation = getWorkflowValidation(
14173
- workflow,
14174
- { frames },
14175
- {
14176
- products: organizationProducts.data
14177
- }
14178
- );
14176
+ const validation = validator3(workflow, { frames });
14179
14177
  return {
14180
14178
  elements,
14181
14179
  frames,
14182
14180
  validation
14183
14181
  };
14184
- }, [workflow, credentialsQuery.data, organizationProducts.data]);
14182
+ }, [validator3, workflow, credentialsQuery.data]);
14185
14183
  return {
14186
14184
  metadata
14187
14185
  };
@@ -14278,8 +14276,9 @@ function WorkflowCreatorProviderBase({
14278
14276
  }) {
14279
14277
  var _a, _b;
14280
14278
  const { fitView } = useReactFlow();
14281
- const navigate = useNavigate2();
14279
+ const navigate = useNavigate3();
14282
14280
  const notifications = useNotificationContext2();
14281
+ const replaceWorkflowId = useReplaceWorkflowIdInUrl();
14283
14282
  const createWorkflowAction = useCreateWorkflow();
14284
14283
  const createWorkflowDraftAction = useCreateWorkflowDraft();
14285
14284
  const updateWorkflowAction = useUpdateWorkflow();
@@ -14290,22 +14289,22 @@ function WorkflowCreatorProviderBase({
14290
14289
  state,
14291
14290
  updaters: { setWorkflow, setAction, setSelection }
14292
14291
  } = useWorkflowState(workflow, options);
14293
- const autosaveStateRef = useRef2(state);
14294
- const autosaveWorkflowRef = useRef2(
14292
+ const autosaveStateRef = useRef3(state);
14293
+ const autosaveWorkflowRef = useRef3(
14295
14294
  debounce(() => __async(this, null, function* () {
14296
14295
  yield save(true);
14297
14296
  }), 500)
14298
14297
  );
14299
14298
  const autosaveWorkflow = autosaveWorkflowRef.current;
14300
- useEffect3(() => {
14299
+ useEffect4(() => {
14301
14300
  return () => {
14302
14301
  autosaveWorkflow.cancel();
14303
14302
  };
14304
14303
  }, [autosaveWorkflow]);
14305
- useEffect3(() => {
14304
+ useEffect4(() => {
14306
14305
  autosaveStateRef.current = state;
14307
14306
  }, [state]);
14308
- const focus = useCallback2(
14307
+ const focus = useCallback4(
14309
14308
  (identifier2) => {
14310
14309
  setTimeout(
14311
14310
  () => fitView(
@@ -14326,7 +14325,7 @@ function WorkflowCreatorProviderBase({
14326
14325
  },
14327
14326
  [fitView]
14328
14327
  );
14329
- const toggle = useCallback2(
14328
+ const toggle = useCallback4(
14330
14329
  (params) => {
14331
14330
  setTimeout(() => {
14332
14331
  setSelection(() => {
@@ -14350,7 +14349,7 @@ function WorkflowCreatorProviderBase({
14350
14349
  },
14351
14350
  [focus, setSelection]
14352
14351
  );
14353
- const validate = useCallback2(() => {
14352
+ const validate = useCallback4(() => {
14354
14353
  var _a2;
14355
14354
  const state2 = autosaveStateRef.current;
14356
14355
  if (((_a2 = options == null ? void 0 : options.validation) == null ? void 0 : _a2.strategy) !== "non-blocking" && !state2.metadata.validation.isValid) {
@@ -14381,21 +14380,21 @@ function WorkflowCreatorProviderBase({
14381
14380
  }
14382
14381
  return true;
14383
14382
  }, [(_a = options == null ? void 0 : options.validation) == null ? void 0 : _a.strategy, toggle]);
14384
- const replaceWorkflow = useCallback2(
14383
+ const replaceWorkflow = useCallback4(
14385
14384
  (workflow2) => {
14386
14385
  setWorkflow(workflow2);
14387
14386
  void autosaveWorkflowRef.current();
14388
14387
  },
14389
14388
  [autosaveWorkflowRef, setWorkflow]
14390
14389
  );
14391
- const changeWorkflow = useCallback2(
14390
+ const changeWorkflow = useCallback4(
14392
14391
  (change) => {
14393
14392
  setWorkflow((prevState) => applyChange(prevState, change(prevState)));
14394
14393
  void autosaveWorkflowRef.current();
14395
14394
  },
14396
14395
  [autosaveWorkflowRef, setWorkflow]
14397
14396
  );
14398
- const goToAddTrigger = useCallback2(() => {
14397
+ const goToAddTrigger = useCallback4(() => {
14399
14398
  navigate(
14400
14399
  `${basePath}/trigger/${OTHER_TYPES.SYSTEM}/${"manual" /* Manual */}`,
14401
14400
  {
@@ -14405,7 +14404,7 @@ function WorkflowCreatorProviderBase({
14405
14404
  }
14406
14405
  );
14407
14406
  }, [basePath, navigate]);
14408
- const addTrigger = useCallback2(
14407
+ const addTrigger = useCallback4(
14409
14408
  (trigger) => {
14410
14409
  changeWorkflow(() => ({
14411
14410
  trigger
@@ -14419,7 +14418,7 @@ function WorkflowCreatorProviderBase({
14419
14418
  },
14420
14419
  [changeWorkflow, toggle]
14421
14420
  );
14422
- const updateTrigger = useCallback2(
14421
+ const updateTrigger = useCallback4(
14423
14422
  (trigger) => {
14424
14423
  changeWorkflow(() => ({
14425
14424
  trigger
@@ -14427,7 +14426,7 @@ function WorkflowCreatorProviderBase({
14427
14426
  },
14428
14427
  [changeWorkflow]
14429
14428
  );
14430
- const removeTrigger = useCallback2(() => {
14429
+ const removeTrigger = useCallback4(() => {
14431
14430
  var _a2;
14432
14431
  const state2 = autosaveStateRef.current;
14433
14432
  replaceWorkflow(__spreadProps(__spreadValues({}, state2.workflow), {
@@ -14437,7 +14436,7 @@ function WorkflowCreatorProviderBase({
14437
14436
  toggle();
14438
14437
  }
14439
14438
  }, [replaceWorkflow, toggle]);
14440
- const goToAddTask = useCallback2(
14439
+ const goToAddTask = useCallback4(
14441
14440
  (taskReference, parentTaskReference) => {
14442
14441
  navigate(`${basePath}/add`, {
14443
14442
  state: {
@@ -14449,7 +14448,7 @@ function WorkflowCreatorProviderBase({
14449
14448
  },
14450
14449
  [state.metadata.frames, navigate, basePath]
14451
14450
  );
14452
- const addTask = useCallback2(
14451
+ const addTask = useCallback4(
14453
14452
  (task2, targetTaskReference, parentTaskReference) => {
14454
14453
  var _a2;
14455
14454
  const existingTasks = Object.values(state.metadata.elements.tasks).filter((x) => x.taskReferenceName.includes(task2.taskReferenceName)).sort((a, b) => {
@@ -14558,7 +14557,7 @@ function WorkflowCreatorProviderBase({
14558
14557
  },
14559
14558
  [state.workflow.definition.tasks, changeWorkflow, toggle]
14560
14559
  );
14561
- const updateTask = useCallback2(
14560
+ const updateTask = useCallback4(
14562
14561
  (targetTaskReferenceName, targetTask) => {
14563
14562
  changeWorkflow((workflow2) => ({
14564
14563
  definition: {
@@ -14575,7 +14574,7 @@ function WorkflowCreatorProviderBase({
14575
14574
  },
14576
14575
  [changeWorkflow]
14577
14576
  );
14578
- const removeTask = useCallback2(
14577
+ const removeTask = useCallback4(
14579
14578
  (targetTaskReferenceName) => {
14580
14579
  var _a2;
14581
14580
  changeWorkflow((workflow2) => ({
@@ -14596,7 +14595,7 @@ function WorkflowCreatorProviderBase({
14596
14595
  },
14597
14596
  [(_b = state.selection) == null ? void 0 : _b.id, changeWorkflow, toggle]
14598
14597
  );
14599
- const save = useCallback2(
14598
+ const save = useCallback4(
14600
14599
  (silent) => __async(this, null, function* () {
14601
14600
  const state2 = autosaveStateRef.current;
14602
14601
  if (!state2.workflow.draft && !validate()) {
@@ -14625,7 +14624,7 @@ function WorkflowCreatorProviderBase({
14625
14624
  "Workflow has been created successfully"
14626
14625
  );
14627
14626
  }
14628
- navigate(`/workflow/${workflowId}`);
14627
+ replaceWorkflowId(workflowId);
14629
14628
  }
14630
14629
  } finally {
14631
14630
  setAction("isSaving", false);
@@ -14635,13 +14634,13 @@ function WorkflowCreatorProviderBase({
14635
14634
  createWorkflowAction,
14636
14635
  updateWorkflowAction,
14637
14636
  notifications,
14637
+ replaceWorkflowId,
14638
14638
  validate,
14639
- navigate,
14640
14639
  setWorkflow,
14641
14640
  setAction
14642
14641
  ]
14643
14642
  );
14644
- const activate = useCallback2(() => __async(this, null, function* () {
14643
+ const activate = useCallback4(() => __async(this, null, function* () {
14645
14644
  const state2 = autosaveStateRef.current;
14646
14645
  if (state2.workflow.draft) {
14647
14646
  return;
@@ -14665,7 +14664,7 @@ function WorkflowCreatorProviderBase({
14665
14664
  setAction("isActivating", false);
14666
14665
  }
14667
14666
  }), [activateWorkflowAction, notifications, validate, setWorkflow, setAction]);
14668
- const remove = useCallback2(() => __async(this, null, function* () {
14667
+ const remove = useCallback4(() => __async(this, null, function* () {
14669
14668
  const state2 = autosaveStateRef.current;
14670
14669
  setAction("isRemoving", true);
14671
14670
  try {
@@ -14684,7 +14683,7 @@ function WorkflowCreatorProviderBase({
14684
14683
  setAction("isRemoving", false);
14685
14684
  }
14686
14685
  }), [setAction, navigate, notifications, deleteWorkflowAction]);
14687
- const createDraft = useCallback2(
14686
+ const createDraft = useCallback4(
14688
14687
  (options2) => __async(this, null, function* () {
14689
14688
  const state2 = autosaveStateRef.current;
14690
14689
  if (state2.workflow.draft) {
@@ -14722,7 +14721,7 @@ function WorkflowCreatorProviderBase({
14722
14721
  setAction
14723
14722
  ]
14724
14723
  );
14725
- const publishDraft = useCallback2(
14724
+ const publishDraft = useCallback4(
14726
14725
  (options2) => __async(this, null, function* () {
14727
14726
  var _a2;
14728
14727
  const state2 = autosaveStateRef.current;
@@ -14767,7 +14766,7 @@ function WorkflowCreatorProviderBase({
14767
14766
  createWorkflowAction
14768
14767
  ]
14769
14768
  );
14770
- const discardDraft = useCallback2(() => __async(this, null, function* () {
14769
+ const discardDraft = useCallback4(() => __async(this, null, function* () {
14771
14770
  const state2 = autosaveStateRef.current;
14772
14771
  setAction("isDiscarding", true);
14773
14772
  try {
@@ -14874,7 +14873,16 @@ var itemOptionCss = (active) => css`
14874
14873
  `;
14875
14874
  function ItemOption({ option, onClick, active }) {
14876
14875
  return /* @__PURE__ */ jsx4("div", { css: itemOptionCss(active), onClick, children: /* @__PURE__ */ jsxs2(Column2, { setColumnPadding: "0", width: 6, children: [
14877
- /* @__PURE__ */ jsx4(Text2, { noMargin: true, children: option.name }),
14876
+ /* @__PURE__ */ jsx4(
14877
+ Text2,
14878
+ {
14879
+ "data-testid": WORKFLOWS_TEST_SELECTORS.views.workflows.creator.modals.addTask.taskCard(
14880
+ option.key
14881
+ ),
14882
+ noMargin: true,
14883
+ children: option.name
14884
+ }
14885
+ ),
14878
14886
  /* @__PURE__ */ jsx4(
14879
14887
  Text2,
14880
14888
  {
@@ -14937,11 +14945,11 @@ var Options_default = AddWorkflowTaskOptions;
14937
14945
  function AddWorkflowTaskModal({ basePath, onClose }) {
14938
14946
  var _a;
14939
14947
  const [search, setSearch] = useState5("");
14940
- const location = useLocation();
14941
- const navigate = useNavigate3();
14942
- const params = useParams();
14948
+ const location = useLocation2();
14949
+ const navigate = useNavigate4();
14950
+ const params = useParams2();
14943
14951
  const [state, setState] = useState5();
14944
- const config2 = useMemo3(
14952
+ const config2 = useMemo4(
14945
14953
  () => [
14946
14954
  // {
14947
14955
  // name: "system",
@@ -15101,7 +15109,7 @@ function AddWorkflowTaskModal({ basePath, onClose }) {
15101
15109
  const amplitudeWorkflowsJourney = workflowsBlockAmplitudeJourneyFactory(
15102
15110
  user == null ? void 0 : user.meta.email
15103
15111
  );
15104
- useEffect4(() => {
15112
+ useEffect5(() => {
15105
15113
  var _a2, _b, _c, _d, _e, _f, _g;
15106
15114
  if (!params.task) {
15107
15115
  const service = (_a2 = params.service) != null ? _a2 : "livechat";
@@ -15170,11 +15178,13 @@ function AddWorkflowTaskModal({ basePath, onClose }) {
15170
15178
  height: 500px;
15171
15179
  width: 650px;
15172
15180
  `,
15181
+ "data-testid": WORKFLOWS_TEST_SELECTORS.views.workflows.creator.modals.addTask.wrapper,
15173
15182
  footer: /* @__PURE__ */ jsxs2(Row2, { flexEnd: true, gap: `var(${SpacingToken3.Spacing2})`, notPadded: true, children: [
15174
15183
  /* @__PURE__ */ jsx4(Button2, { kind: "secondary", onClick: onClose, size: "medium", children: "Cancel" }),
15175
15184
  /* @__PURE__ */ jsx4(
15176
15185
  Button2,
15177
15186
  {
15187
+ "data-testid": WORKFLOWS_TEST_SELECTORS.views.workflows.creator.modals.addTask.saveButton,
15178
15188
  disabled: !(state == null ? void 0 : state.task),
15179
15189
  kind: "primary",
15180
15190
  onClick: () => {
@@ -15275,7 +15285,16 @@ function AddWorkflowTaskModal({ basePath, onClose }) {
15275
15285
  end: false,
15276
15286
  state: location.state,
15277
15287
  to: `${basePath}/${name}`,
15278
- children: /* @__PURE__ */ jsx4(Text3, { size: "md", children: displayName })
15288
+ children: /* @__PURE__ */ jsx4(
15289
+ Text3,
15290
+ {
15291
+ "data-testid": WORKFLOWS_TEST_SELECTORS.views.workflows.creator.modals.addTask.taskCategoryButton(
15292
+ name
15293
+ ),
15294
+ size: "md",
15295
+ children: displayName
15296
+ }
15297
+ )
15279
15298
  }
15280
15299
  )
15281
15300
  ]
@@ -15328,8 +15347,8 @@ function AddWorkflowTaskModal({ basePath, onClose }) {
15328
15347
  var Modal_default = AddWorkflowTaskModal;
15329
15348
 
15330
15349
  // src/views/Workflows/Creator/Modals/AddTrigger/Modal.tsx
15331
- import { useEffect as useEffect5, useMemo as useMemo4, useState as useState6 } from "react";
15332
- import { NavLink as NavLink2, useLocation as useLocation2, useNavigate as useNavigate4, useParams as useParams2 } from "react-router-dom";
15350
+ import { useEffect as useEffect6, useMemo as useMemo5, useState as useState6 } from "react";
15351
+ import { NavLink as NavLink2, useLocation as useLocation3, useNavigate as useNavigate5, useParams as useParams3 } from "react-router-dom";
15333
15352
  import {
15334
15353
  Button as Button3,
15335
15354
  DesignToken as DesignToken6,
@@ -15380,7 +15399,17 @@ var itemOptionCss2 = (active) => css`
15380
15399
  `;
15381
15400
  function ItemOption2({ option, onClick, active }) {
15382
15401
  return /* @__PURE__ */ jsx4("div", { css: itemOptionCss2(active), onClick, children: /* @__PURE__ */ jsxs2(Column4, { setColumnPadding: "0", width: 6, children: [
15383
- /* @__PURE__ */ jsx4(Text4, { bold: true, noMargin: true, children: option.name }),
15402
+ /* @__PURE__ */ jsx4(
15403
+ Text4,
15404
+ {
15405
+ bold: true,
15406
+ "data-testid": WORKFLOWS_TEST_SELECTORS.views.workflows.creator.modals.addTrigger.triggerCard(
15407
+ option.key
15408
+ ),
15409
+ noMargin: true,
15410
+ children: option.name
15411
+ }
15412
+ ),
15384
15413
  /* @__PURE__ */ jsx4(
15385
15414
  Text4,
15386
15415
  {
@@ -15445,7 +15474,7 @@ function AddWorkflowTriggerModal({
15445
15474
  onClose
15446
15475
  }) {
15447
15476
  const [search, setSearch] = useState6("");
15448
- const config2 = useMemo4(
15477
+ const config2 = useMemo5(
15449
15478
  () => [
15450
15479
  {
15451
15480
  name: OTHER_TYPES.SYSTEM,
@@ -15571,16 +15600,16 @@ function AddWorkflowTriggerModal({
15571
15600
  ],
15572
15601
  []
15573
15602
  );
15574
- const location = useLocation2();
15575
- const navigate = useNavigate4();
15576
- const params = useParams2();
15603
+ const location = useLocation3();
15604
+ const navigate = useNavigate5();
15605
+ const params = useParams3();
15577
15606
  const [state, setState] = useState6();
15578
15607
  const { addTrigger } = useWorkflowCreator();
15579
15608
  const { user } = useUserContext4();
15580
15609
  const amplitudeWorkflowsJourney = workflowsBlockAmplitudeJourneyFactory(
15581
15610
  user == null ? void 0 : user.meta.email
15582
15611
  );
15583
- useEffect5(() => {
15612
+ useEffect6(() => {
15584
15613
  var _a, _b;
15585
15614
  if (!params.trigger) {
15586
15615
  const firstTrigger = (_b = (_a = config2.find((el) => el.name === params.service)) == null ? void 0 : _a.values.sort((a, b) => a.name.localeCompare(b.name))[0]) == null ? void 0 : _b.key;
@@ -15608,11 +15637,13 @@ function AddWorkflowTriggerModal({
15608
15637
  height: 500px;
15609
15638
  width: 650px;
15610
15639
  `,
15640
+ "data-testid": WORKFLOWS_TEST_SELECTORS.views.workflows.creator.modals.addTrigger.wrapper,
15611
15641
  footer: /* @__PURE__ */ jsxs2(Row3, { flexEnd: true, gap: `var(${SpacingToken5.Spacing2})`, notPadded: true, children: [
15612
15642
  /* @__PURE__ */ jsx4(Button3, { kind: "secondary", onClick: onClose, size: "medium", children: "Cancel" }),
15613
15643
  /* @__PURE__ */ jsx4(
15614
15644
  Button3,
15615
15645
  {
15646
+ "data-testid": WORKFLOWS_TEST_SELECTORS.views.workflows.creator.modals.addTrigger.saveButton,
15616
15647
  disabled: !(state == null ? void 0 : state.trigger),
15617
15648
  kind: "primary",
15618
15649
  onClick: () => {
@@ -15713,7 +15744,16 @@ function AddWorkflowTriggerModal({
15713
15744
  end: false,
15714
15745
  state: location.state,
15715
15746
  to: `${basePath}/${name}`,
15716
- children: /* @__PURE__ */ jsx4(Text5, { size: "md", children: displayName })
15747
+ children: /* @__PURE__ */ jsx4(
15748
+ Text5,
15749
+ {
15750
+ "data-testid": WORKFLOWS_TEST_SELECTORS.views.workflows.creator.modals.addTrigger.triggerCategoryButton(
15751
+ name
15752
+ ),
15753
+ size: "md",
15754
+ children: displayName
15755
+ }
15756
+ )
15717
15757
  }
15718
15758
  )
15719
15759
  ]
@@ -15840,7 +15880,7 @@ function DeleteWorkflowModal({
15840
15880
  }
15841
15881
 
15842
15882
  // src/views/Workflows/Creator/Modals/Edit/Modal.tsx
15843
- import { useNavigate as useNavigate5 } from "react-router-dom";
15883
+ import { useNavigate as useNavigate6 } from "react-router-dom";
15844
15884
  import { Error as Error3 } from "@livechat/design-system-icons";
15845
15885
  import {
15846
15886
  Button as Button5,
@@ -15854,7 +15894,7 @@ import {
15854
15894
  } from "@livechat/developer-studio-ui-react";
15855
15895
  import { Fragment as Fragment5, jsx as jsx8, jsxs as jsxs4 } from "react/jsx-runtime";
15856
15896
  function EditWorkflowModal({ onClose }) {
15857
- const navigate = useNavigate5();
15897
+ const navigate = useNavigate6();
15858
15898
  const {
15859
15899
  state: {
15860
15900
  workflow,
@@ -15911,7 +15951,7 @@ function EditWorkflowModal({ onClose }) {
15911
15951
  }
15912
15952
 
15913
15953
  // src/views/Workflows/Creator/Modals/Execute/Modal.tsx
15914
- import { useCallback as useCallback3 } from "react";
15954
+ import { useCallback as useCallback5 } from "react";
15915
15955
  import { Field, Form } from "react-final-form";
15916
15956
  import validator from "validator";
15917
15957
  import {
@@ -15929,7 +15969,7 @@ function ExecuteWorkflowModal({
15929
15969
  onClose
15930
15970
  }) {
15931
15971
  const executeMutation = useExecuteWorkflow();
15932
- const onSubmit = useCallback3(
15972
+ const onSubmit = useCallback5(
15933
15973
  (data) => __async(this, null, function* () {
15934
15974
  yield executeMutation.mutateAsync({
15935
15975
  workflow,
@@ -16011,10 +16051,10 @@ function ExecuteWorkflowModal({
16011
16051
  var Modal_default3 = ExecuteWorkflowModal;
16012
16052
 
16013
16053
  // src/views/Workflows/Creator/Modals/Preview/Modal.tsx
16014
- import { useCallback as useCallback13 } from "react";
16015
- import { useNavigate as useNavigate9 } from "react-router-dom";
16054
+ import { useCallback as useCallback16 } from "react";
16055
+ import { useNavigate as useNavigate10 } from "react-router-dom";
16016
16056
 
16017
- // ../../../node_modules/.pnpm/@emotion+styled@11.14.0_@emotion+react@11.14.0_@types+react@18.3.18_react@18.3.1__@types+react@18.3.18_react@18.3.1/node_modules/@emotion/styled/base/dist/emotion-styled-base.esm.js
16057
+ // ../../../node_modules/.pnpm/@emotion+styled@11.14.0_@emotion+react@11.14.0_@types+react@18.3.18_react@18.3.1/node_modules/@emotion/styled/base/dist/emotion-styled-base.esm.js
16018
16058
  import * as React4 from "react";
16019
16059
 
16020
16060
  // ../../../node_modules/.pnpm/@emotion+is-prop-valid@1.3.1/node_modules/@emotion/is-prop-valid/dist/emotion-is-prop-valid.esm.js
@@ -16026,7 +16066,7 @@ var isPropValid = /* @__PURE__ */ memoize(
16026
16066
  /* Z+1 */
16027
16067
  );
16028
16068
 
16029
- // ../../../node_modules/.pnpm/@emotion+styled@11.14.0_@emotion+react@11.14.0_@types+react@18.3.18_react@18.3.1__@types+react@18.3.18_react@18.3.1/node_modules/@emotion/styled/base/dist/emotion-styled-base.esm.js
16069
+ // ../../../node_modules/.pnpm/@emotion+styled@11.14.0_@emotion+react@11.14.0_@types+react@18.3.18_react@18.3.1/node_modules/@emotion/styled/base/dist/emotion-styled-base.esm.js
16030
16070
  var isBrowser5 = typeof document !== "undefined";
16031
16071
  var isDevelopment4 = false;
16032
16072
  var testOmitPropsOnStringTag = isPropValid;
@@ -16165,7 +16205,7 @@ var createStyled = function createStyled2(tag, options) {
16165
16205
  };
16166
16206
  };
16167
16207
 
16168
- // ../../../node_modules/.pnpm/@emotion+styled@11.14.0_@emotion+react@11.14.0_@types+react@18.3.18_react@18.3.1__@types+react@18.3.18_react@18.3.1/node_modules/@emotion/styled/dist/emotion-styled.esm.js
16208
+ // ../../../node_modules/.pnpm/@emotion+styled@11.14.0_@emotion+react@11.14.0_@types+react@18.3.18_react@18.3.1/node_modules/@emotion/styled/dist/emotion-styled.esm.js
16169
16209
  var import_extends5 = __toESM(require_extends());
16170
16210
  import "react";
16171
16211
  var tags = [
@@ -16322,7 +16362,7 @@ import {
16322
16362
  import { Row as Row11 } from "@livechat/developer-studio-ui-react";
16323
16363
 
16324
16364
  // src/views/Workflows/Creator/Builder/Diagram.tsx
16325
- import { useCallback as useCallback12, useEffect as useEffect17 } from "react";
16365
+ import { useCallback as useCallback15, useEffect as useEffect18 } from "react";
16326
16366
  import ReactFlow, {
16327
16367
  addEdge,
16328
16368
  Background,
@@ -16350,6 +16390,7 @@ function AddTaskNode(node2) {
16350
16390
  /* @__PURE__ */ jsx4(
16351
16391
  Button7,
16352
16392
  {
16393
+ "data-testid": WORKFLOWS_TEST_SELECTORS.views.workflows.creator.builder.nodes.add.task.button,
16353
16394
  icon: /* @__PURE__ */ jsx4(Icon4, { size: "large", source: Add }),
16354
16395
  id: node2.id,
16355
16396
  kind: "secondary",
@@ -16382,6 +16423,7 @@ function AddTriggerNode(node2) {
16382
16423
  /* @__PURE__ */ jsx4(
16383
16424
  Button8,
16384
16425
  {
16426
+ "data-testid": WORKFLOWS_TEST_SELECTORS.views.workflows.creator.builder.nodes.add.trigger.button,
16385
16427
  icon: /* @__PURE__ */ jsx4(Icon5, { size: "large", source: Add2 }),
16386
16428
  id: node2.id,
16387
16429
  kind: "primary",
@@ -16495,7 +16537,7 @@ import SchemaForm from "@rjsf/core";
16495
16537
  import validator2 from "@rjsf/validator-ajv8";
16496
16538
 
16497
16539
  // src/views/Workflows/Creator/Builder/Forms/Schema/overrides/Fields/CustomString/Field.tsx
16498
- import { useEffect as useEffect9, useMemo as useMemo6, useState as useState12 } from "react";
16540
+ import { useCallback as useCallback9, useEffect as useEffect10, useMemo as useMemo7, useState as useState12 } from "react";
16499
16541
  import { getDefaultRegistry } from "@rjsf/core";
16500
16542
  import { MoreHoriz } from "@livechat/design-system-icons";
16501
16543
  import {
@@ -16509,7 +16551,7 @@ import { Intro as Intro2, Row as Row7 } from "@livechat/developer-studio-ui-reac
16509
16551
  import { useFetchIntegrationResourceQuery } from "@livechat/platform-integrations";
16510
16552
 
16511
16553
  // src/views/Workflows/Creator/Builder/Forms/Schema/overrides/Fields/CustomTags/Field.tsx
16512
- import { useRef as useRef5, useState as useState10 } from "react";
16554
+ import { useRef as useRef6, useState as useState10 } from "react";
16513
16555
  import { useOnClickOutside } from "@livechat/developer-studio-ui-react";
16514
16556
 
16515
16557
  // src/views/Workflows/Creator/Builder/Forms/Schema/overrides/Fields/CustomTags/TagsPicker/Picker.tsx
@@ -16952,7 +16994,7 @@ function CustomTagsPicker({
16952
16994
  }
16953
16995
 
16954
16996
  // src/views/Workflows/Creator/Builder/Forms/Schema/overrides/Fields/CustomTags/TagsInput/Input.tsx
16955
- import { useCallback as useCallback6, useEffect as useEffect7, useRef as useRef4 } from "react";
16997
+ import { useCallback as useCallback8, useEffect as useEffect8, useRef as useRef5 } from "react";
16956
16998
  import debounce3 from "lodash.debounce";
16957
16999
  import { Tooltip as Tooltip3 } from "@livechat/design-system-react-components";
16958
17000
 
@@ -17003,7 +17045,7 @@ function CustomTagTemplate(tagData, { settings: _s }) {
17003
17045
  }
17004
17046
 
17005
17047
  // src/views/Workflows/Creator/Builder/Forms/Schema/overrides/Fields/CustomTags/TagsInput/Tag/Tooltip.tsx
17006
- import { useCallback as useCallback4, useState as useState9 } from "react";
17048
+ import { useCallback as useCallback6, useState as useState9 } from "react";
17007
17049
  import debounce2 from "lodash.debounce";
17008
17050
  import {
17009
17051
  DesignToken as DesignToken10,
@@ -17022,8 +17064,8 @@ var useCustomTagsInputTagTooltipData = () => {
17022
17064
  visible: false
17023
17065
  }
17024
17066
  );
17025
- const setTooltipDataDebounced = useCallback4(debounce2(setTooltipData, 50), []);
17026
- const showTagTooltip = useCallback4(
17067
+ const setTooltipDataDebounced = useCallback6(debounce2(setTooltipData, 50), []);
17068
+ const showTagTooltip = useCallback6(
17027
17069
  (tag, tagElement) => {
17028
17070
  const rect = tagElement.getBoundingClientRect();
17029
17071
  const tooltipPosition = {
@@ -17038,7 +17080,7 @@ var useCustomTagsInputTagTooltipData = () => {
17038
17080
  },
17039
17081
  [setTooltipDataDebounced]
17040
17082
  );
17041
- const hideTagTooltip = useCallback4(() => {
17083
+ const hideTagTooltip = useCallback6(() => {
17042
17084
  setTooltipDataDebounced({
17043
17085
  visible: false
17044
17086
  });
@@ -17107,10 +17149,10 @@ function CustomTagsInputTagTooltip({
17107
17149
  }
17108
17150
 
17109
17151
  // src/views/Workflows/Creator/Builder/Forms/Schema/overrides/Fields/CustomTags/TagsInput/Tags.tsx
17110
- import { memo as memo3, useCallback as useCallback5, useEffect as useEffect6, useMemo as useMemo5, useRef as useRef3 } from "react";
17152
+ import { memo as memo3, useCallback as useCallback7, useEffect as useEffect7, useMemo as useMemo6, useRef as useRef4 } from "react";
17111
17153
  import Tagify from "@yaireo/tagify";
17112
17154
  import { jsx as jsx9 } from "react/jsx-runtime";
17113
- var noop = (_) => _;
17155
+ var noop = (_2) => _2;
17114
17156
  var isSameDeep = (a, b) => {
17115
17157
  const trans = (x) => typeof x === "string" ? x : JSON.stringify(x);
17116
17158
  return trans(a) === trans(b);
@@ -17191,12 +17233,12 @@ function TagifyWrapper({
17191
17233
  defaultValue,
17192
17234
  showDropdown
17193
17235
  }) {
17194
- const mountedRef = useRef3();
17195
- const inputElmRef = useRef3(null);
17196
- const tagify = useRef3();
17197
- const lastClassNameRef = useRef3();
17236
+ const mountedRef = useRef4();
17237
+ const inputElmRef = useRef4(null);
17238
+ const tagify = useRef4();
17239
+ const lastClassNameRef = useRef4();
17198
17240
  const _value = defaultValue || value;
17199
- const inputAttrs = useMemo5(
17241
+ const inputAttrs = useMemo6(
17200
17242
  () => ({
17201
17243
  ref: inputElmRef,
17202
17244
  name,
@@ -17209,10 +17251,10 @@ function TagifyWrapper({
17209
17251
  }),
17210
17252
  []
17211
17253
  );
17212
- const setFocus = useCallback5(() => {
17254
+ const setFocus = useCallback7(() => {
17213
17255
  autoFocus && tagify.current.DOM.input.focus();
17214
17256
  }, [tagify]);
17215
- useEffect6(() => {
17257
+ useEffect7(() => {
17216
17258
  templatesToString(settings2.templates);
17217
17259
  settings2.userInput = userInput;
17218
17260
  if (InputMode === "textarea") settings2.mode = "mix";
@@ -17230,70 +17272,70 @@ function TagifyWrapper({
17230
17272
  t.destroy();
17231
17273
  };
17232
17274
  }, []);
17233
- useEffect6(() => {
17275
+ useEffect7(() => {
17234
17276
  tagify.current.off("change").on("change", onChange);
17235
17277
  }, [onChange]);
17236
- useEffect6(() => {
17278
+ useEffect7(() => {
17237
17279
  tagify.current.off("input").on("input", onInput);
17238
17280
  }, [onInput]);
17239
- useEffect6(() => {
17281
+ useEffect7(() => {
17240
17282
  tagify.current.off("add").on("add", onAdd);
17241
17283
  }, [onAdd]);
17242
- useEffect6(() => {
17284
+ useEffect7(() => {
17243
17285
  tagify.current.off("remove").on("remove", onRemove);
17244
17286
  }, [onRemove]);
17245
- useEffect6(() => {
17287
+ useEffect7(() => {
17246
17288
  tagify.current.off("invalid").on("invalid", onInvalid);
17247
17289
  }, [onInvalid]);
17248
- useEffect6(() => {
17290
+ useEffect7(() => {
17249
17291
  tagify.current.off("keydown").on("keydown", onKeydown);
17250
17292
  }, [onKeydown]);
17251
- useEffect6(() => {
17293
+ useEffect7(() => {
17252
17294
  tagify.current.off("focus").on("focus", onFocus);
17253
17295
  }, [onFocus]);
17254
- useEffect6(() => {
17296
+ useEffect7(() => {
17255
17297
  tagify.current.off("blur").on("blur", onBlur);
17256
17298
  }, [onBlur]);
17257
- useEffect6(() => {
17299
+ useEffect7(() => {
17258
17300
  tagify.current.off("click").on("click", onClick);
17259
17301
  }, [onClick]);
17260
- useEffect6(() => {
17302
+ useEffect7(() => {
17261
17303
  tagify.current.off("edit:input").on("edit:input", onEditInput);
17262
17304
  }, [onEditInput]);
17263
- useEffect6(() => {
17305
+ useEffect7(() => {
17264
17306
  tagify.current.off("edit:beforeUpdate").on("edit:beforeUpdate", onEditBeforeUpdate);
17265
17307
  }, [onEditBeforeUpdate]);
17266
- useEffect6(() => {
17308
+ useEffect7(() => {
17267
17309
  tagify.current.off("edit:updated").on("edit:updated", onEditUpdated);
17268
17310
  }, [onEditUpdated]);
17269
- useEffect6(() => {
17311
+ useEffect7(() => {
17270
17312
  tagify.current.off("edit:start").on("edit:start", onEditStart);
17271
17313
  }, [onEditStart]);
17272
- useEffect6(() => {
17314
+ useEffect7(() => {
17273
17315
  tagify.current.off("edit:keydown").on("edit:keydown", onEditKeydown);
17274
17316
  }, [onEditKeydown]);
17275
- useEffect6(() => {
17317
+ useEffect7(() => {
17276
17318
  tagify.current.off("dropdown:show").on("dropdown:show", onDropdownShow);
17277
17319
  }, [onDropdownShow]);
17278
- useEffect6(() => {
17320
+ useEffect7(() => {
17279
17321
  tagify.current.off("dropdown:hide").on("dropdown:hide", onDropdownHide);
17280
17322
  }, [onDropdownHide]);
17281
- useEffect6(() => {
17323
+ useEffect7(() => {
17282
17324
  tagify.current.off("dropdown:select").on("dropdown:select", onDropdownSelect);
17283
17325
  }, [onDropdownSelect]);
17284
- useEffect6(() => {
17326
+ useEffect7(() => {
17285
17327
  tagify.current.off("dropdown:scroll").on("dropdown:scroll", onDropdownScroll);
17286
17328
  }, [onDropdownScroll]);
17287
- useEffect6(() => {
17329
+ useEffect7(() => {
17288
17330
  tagify.current.off("dropdown:noMatch").on("dropdown:noMatch", onDropdownNoMatch);
17289
17331
  }, [onDropdownNoMatch]);
17290
- useEffect6(() => {
17332
+ useEffect7(() => {
17291
17333
  tagify.current.off("dropdown:updated").on("dropdown:updated", onDropdownUpdated);
17292
17334
  }, [onDropdownUpdated]);
17293
- useEffect6(() => {
17335
+ useEffect7(() => {
17294
17336
  setFocus();
17295
17337
  }, [autoFocus]);
17296
- useEffect6(() => {
17338
+ useEffect7(() => {
17297
17339
  if (mountedRef.current) {
17298
17340
  tagify.current.settings.whitelist.length = 0;
17299
17341
  (whitelist == null ? void 0 : whitelist.length) && tagify.current.settings.whitelist.push(
@@ -17301,13 +17343,13 @@ function TagifyWrapper({
17301
17343
  );
17302
17344
  }
17303
17345
  }, [whitelist]);
17304
- useEffect6(() => {
17346
+ useEffect7(() => {
17305
17347
  const currentValue = tagify.current.getInputValue();
17306
17348
  if (mountedRef.current && !isSameDeep(value, currentValue)) {
17307
17349
  tagify.current.loadOriginalValues(value);
17308
17350
  }
17309
17351
  }, [value]);
17310
- useEffect6(() => {
17352
+ useEffect7(() => {
17311
17353
  if (mountedRef.current) {
17312
17354
  const { added, removed } = compareStrings(
17313
17355
  lastClassNameRef.current,
@@ -17322,33 +17364,33 @@ function TagifyWrapper({
17322
17364
  }
17323
17365
  lastClassNameRef.current = className;
17324
17366
  }, [className]);
17325
- useEffect6(() => {
17367
+ useEffect7(() => {
17326
17368
  if (mountedRef.current) {
17327
17369
  tagify.current.loading(loading);
17328
17370
  }
17329
17371
  }, [loading]);
17330
- useEffect6(() => {
17372
+ useEffect7(() => {
17331
17373
  if (mountedRef.current) {
17332
17374
  tagify.current.setReadonly(readOnly != null ? readOnly : false);
17333
17375
  }
17334
17376
  }, [readOnly]);
17335
- useEffect6(() => {
17377
+ useEffect7(() => {
17336
17378
  if (mountedRef.current) {
17337
17379
  tagify.current.setDisabled(disabled != null ? disabled : false);
17338
17380
  }
17339
17381
  }, [disabled]);
17340
- useEffect6(() => {
17382
+ useEffect7(() => {
17341
17383
  if (mountedRef.current) {
17342
17384
  const current = tagify.current;
17343
17385
  current.userInput = userInput;
17344
17386
  }
17345
17387
  }, [userInput]);
17346
- useEffect6(() => {
17388
+ useEffect7(() => {
17347
17389
  if (mountedRef.current) {
17348
17390
  tagify.current.setPlaceholder(placeholder2);
17349
17391
  }
17350
17392
  }, [placeholder2]);
17351
- useEffect6(() => {
17393
+ useEffect7(() => {
17352
17394
  const t = tagify.current;
17353
17395
  if (mountedRef.current) {
17354
17396
  if (showDropdown) {
@@ -17359,7 +17401,7 @@ function TagifyWrapper({
17359
17401
  }
17360
17402
  }
17361
17403
  }, [showDropdown]);
17362
- useEffect6(() => {
17404
+ useEffect7(() => {
17363
17405
  mountedRef.current = true;
17364
17406
  }, []);
17365
17407
  return (
@@ -17471,23 +17513,23 @@ function CustomTagsInput({
17471
17513
  renderPicker,
17472
17514
  renderPickerTrigger
17473
17515
  }) {
17474
- const tagifyRef = useRef4();
17516
+ const tagifyRef = useRef5();
17475
17517
  const [tooltipData, { showTagTooltip, hideTagTooltip }] = useCustomTagsInputTagTooltipData();
17476
- const updateAllIcons = useCallback6(() => {
17518
+ const updateAllIcons = useCallback8(() => {
17477
17519
  const tagify = tagifyRef.current;
17478
17520
  if (!tagify) {
17479
17521
  return;
17480
17522
  }
17481
17523
  tagify.value.forEach(updateCustomTagsInputTagIcon);
17482
17524
  }, []);
17483
- const getCurrentValue = useCallback6(() => {
17525
+ const getCurrentValue = useCallback8(() => {
17484
17526
  const tagify = tagifyRef.current;
17485
17527
  if (!tagify) {
17486
17528
  return "";
17487
17529
  }
17488
17530
  return tagify.getMixedTagsAsString().replace(trim2 ? /\s+/g : /\r\n$/, "").replaceAll("[[", "${").replaceAll("]]", "}").replaceAll("\u200B", "").replaceAll("\xA0", "");
17489
17531
  }, [trim2]);
17490
- const setCurrentValue = useCallback6(
17532
+ const setCurrentValue = useCallback8(
17491
17533
  (value2, frame) => {
17492
17534
  const tagify = tagifyRef.current;
17493
17535
  if (!tagify) {
@@ -17498,14 +17540,14 @@ function CustomTagsInput({
17498
17540
  },
17499
17541
  [updateAllIcons]
17500
17542
  );
17501
- const handleChange = useCallback6(
17543
+ const handleChange = useCallback8(
17502
17544
  debounce3(() => {
17503
17545
  onChange(getCurrentValue());
17504
17546
  updateAllIcons();
17505
17547
  }, 300),
17506
17548
  [onChange, getCurrentValue, updateAllIcons]
17507
17549
  );
17508
- const handleKeyDown = useCallback6(
17550
+ const handleKeyDown = useCallback8(
17509
17551
  (e) => {
17510
17552
  if (e.detail.event.key !== "Backspace") {
17511
17553
  return;
@@ -17516,7 +17558,7 @@ function CustomTagsInput({
17516
17558
  },
17517
17559
  [handleChange]
17518
17560
  );
17519
- const addTag = useCallback6(
17561
+ const addTag = useCallback8(
17520
17562
  (tag) => {
17521
17563
  const tagify = tagifyRef.current;
17522
17564
  if (!tagify) {
@@ -17532,7 +17574,7 @@ function CustomTagsInput({
17532
17574
  },
17533
17575
  [trim2, onPickerToggle]
17534
17576
  );
17535
- useEffect7(() => {
17577
+ useEffect8(() => {
17536
17578
  const tagify = tagifyRef.current;
17537
17579
  if (!tagify) {
17538
17580
  return;
@@ -17558,7 +17600,7 @@ function CustomTagsInput({
17558
17600
  showTagTooltip,
17559
17601
  hideTagTooltip
17560
17602
  ]);
17561
- useEffect7(() => {
17603
+ useEffect8(() => {
17562
17604
  const tagify = tagifyRef.current;
17563
17605
  if (!tagify) {
17564
17606
  return;
@@ -17609,9 +17651,7 @@ function CustomTagsInput({
17609
17651
  // src/views/Workflows/Creator/Builder/Forms/Schema/overrides/Fields/CustomTags/TagsPicker/Trigger.tsx
17610
17652
  import { Add as Add4 } from "@livechat/design-system-icons";
17611
17653
  import { Button as Button10, Icon as Icon8 } from "@livechat/design-system-react-components";
17612
- function CustomTagsPickerTrigger({
17613
- onClick
17614
- }) {
17654
+ function CustomTagsPickerTrigger({ onClick }) {
17615
17655
  return /* @__PURE__ */ jsx4(
17616
17656
  Button10,
17617
17657
  {
@@ -17624,7 +17664,6 @@ function CustomTagsPickerTrigger({
17624
17664
  min-height: 28px;
17625
17665
  width: 28px;
17626
17666
  min-width: 28px;
17627
- z-index: 1000;
17628
17667
  `,
17629
17668
  icon: /* @__PURE__ */ jsx4(Icon8, { source: Add4 }),
17630
17669
  kind: "plain",
@@ -17646,7 +17685,7 @@ function CustomTagsField({
17646
17685
  wrapperCss: wrapperCss3,
17647
17686
  onChange
17648
17687
  }) {
17649
- const wrapperRef = useRef5(null);
17688
+ const wrapperRef = useRef6(null);
17650
17689
  const [isPickerVisible, setIsPickerVisible] = useState10(false);
17651
17690
  useOnClickOutside(wrapperRef, () => {
17652
17691
  setIsPickerVisible(false);
@@ -17714,7 +17753,7 @@ function DynamicCustomStringField(props) {
17714
17753
  }
17715
17754
 
17716
17755
  // src/views/Workflows/Creator/Builder/Forms/Schema/overrides/Fields/CustomString/Modes/Predefined.tsx
17717
- import { useEffect as useEffect8, useState as useState11 } from "react";
17756
+ import { useEffect as useEffect9, useState as useState11 } from "react";
17718
17757
  import { DesignToken as DesignToken11, Picker } from "@livechat/design-system-react-components";
17719
17758
  var pickerCustomStyles = (readonly) => css`
17720
17759
  flex: 1;
@@ -17729,11 +17768,11 @@ function PredefinedCustomStringField(props) {
17729
17768
  const { resourceQuery, onChange, schema } = props;
17730
17769
  const resourceConfig = schema["x-ref"];
17731
17770
  const [pickerOptions, setPickerOptions] = useState11([]);
17732
- useEffect8(() => {
17771
+ useEffect9(() => {
17733
17772
  var _a2, _b;
17734
17773
  if (!resourceConfig) {
17735
17774
  if (resourceQuery.data) {
17736
- onChange(null);
17775
+ onChange("");
17737
17776
  }
17738
17777
  return;
17739
17778
  }
@@ -17765,17 +17804,29 @@ var {
17765
17804
  fields: { StringField }
17766
17805
  } = getDefaultRegistry();
17767
17806
  function CustomStringField(props) {
17768
- var _a;
17807
+ var _a, _b, _c;
17769
17808
  const onChange = props.onChange;
17770
17809
  const resourceConfig = props.schema["x-ref"];
17771
17810
  const resourceQuery = useFetchIntegrationResourceQuery(resourceConfig);
17811
+ const [pristine, setPristine] = useState12(true);
17772
17812
  const [isPredefinedMode, setIsPredefinedMode] = useState12(
17773
17813
  () => {
17774
- var _a2, _b, _c;
17775
- return ((_a2 = resourceQuery.data) == null ? void 0 : _a2.items.some((item) => item.key === props.formData)) || !props.formData && ((_c = (_b = resourceQuery.data) == null ? void 0 : _b.items.length) != null ? _c : 0) > 0 || void 0;
17814
+ var _a2, _b2, _c2;
17815
+ return ((_a2 = resourceQuery.data) == null ? void 0 : _a2.items.some((item) => item.key === props.formData)) || !props.formData && ((_c2 = (_b2 = resourceQuery.data) == null ? void 0 : _b2.items.length) != null ? _c2 : 0) > 0 || void 0;
17776
17816
  }
17777
17817
  );
17778
- const modeSelectorOptions = useMemo6(
17818
+ const handleChange = useCallback9(
17819
+ (value) => {
17820
+ setPristine(false);
17821
+ if (value !== "") {
17822
+ onChange(value);
17823
+ return;
17824
+ }
17825
+ onChange(props.schema.required ? null : void 0);
17826
+ },
17827
+ [onChange, props.schema.required]
17828
+ );
17829
+ const modeSelectorOptions = useMemo7(
17779
17830
  () => [
17780
17831
  resourceConfig ? {
17781
17832
  key: "predefined",
@@ -17791,8 +17842,10 @@ function CustomStringField(props) {
17791
17842
  }
17792
17843
  ) }),
17793
17844
  onClick: () => {
17794
- onChange(null);
17795
- setIsPredefinedMode(true);
17845
+ handleChange("");
17846
+ setTimeout(() => {
17847
+ setIsPredefinedMode(true);
17848
+ }, 50);
17796
17849
  }
17797
17850
  } : void 0,
17798
17851
  {
@@ -17809,28 +17862,47 @@ function CustomStringField(props) {
17809
17862
  }
17810
17863
  ) }),
17811
17864
  onClick: () => {
17812
- onChange(null);
17865
+ handleChange("");
17813
17866
  setTimeout(() => {
17814
17867
  setIsPredefinedMode(false);
17815
- }, 0);
17868
+ }, 50);
17816
17869
  }
17817
17870
  }
17818
17871
  ].filter(Boolean),
17819
- [resourceConfig, onChange, setIsPredefinedMode]
17872
+ [resourceConfig, handleChange, setIsPredefinedMode]
17820
17873
  );
17821
- useEffect9(() => {
17822
- var _a2, _b, _c;
17874
+ useEffect10(() => {
17875
+ var _a2, _b2, _c2;
17876
+ if (!pristine && !props.formData) {
17877
+ return;
17878
+ }
17823
17879
  setIsPredefinedMode(
17824
17880
  ((_a2 = resourceQuery.data) == null ? void 0 : _a2.items.some(
17825
17881
  (option) => option.key === props.formData
17826
- )) || !props.formData && ((_c = (_b = resourceQuery.data) == null ? void 0 : _b.items.length) != null ? _c : 0) > 0
17882
+ )) || !props.formData && ((_c2 = (_b2 = resourceQuery.data) == null ? void 0 : _b2.items.length) != null ? _c2 : 0) > 0
17827
17883
  );
17828
- }, [(_a = resourceQuery.data) == null ? void 0 : _a.items, props.formData]);
17884
+ }, [(_a = resourceQuery.data) == null ? void 0 : _a.items, props.formData, pristine]);
17885
+ useEffect10(() => {
17886
+ setPristine(true);
17887
+ }, [(_c = (_b = props.formContext) == null ? void 0 : _b.frame.__meta) == null ? void 0 : _c.index]);
17829
17888
  if (props.schema.enum || props.schema.oneOf) {
17830
17889
  return /* @__PURE__ */ jsx4(StringField, __spreadValues({}, props));
17831
17890
  }
17832
17891
  return /* @__PURE__ */ jsxs2(Row7, { gap: `var(${SpacingToken11.Spacing1})`, notPadded: true, children: [
17833
- isPredefinedMode ? /* @__PURE__ */ jsx4(PredefinedCustomStringField, __spreadProps(__spreadValues({}, props), { resourceQuery })) : /* @__PURE__ */ jsx4(DynamicCustomStringField, __spreadProps(__spreadValues({}, props), { resourceQuery })),
17892
+ /* @__PURE__ */ jsx4("br", {}),
17893
+ isPredefinedMode ? /* @__PURE__ */ jsx4(
17894
+ PredefinedCustomStringField,
17895
+ __spreadProps(__spreadValues({}, props), {
17896
+ onChange: handleChange,
17897
+ resourceQuery
17898
+ })
17899
+ ) : /* @__PURE__ */ jsx4(
17900
+ DynamicCustomStringField,
17901
+ __spreadProps(__spreadValues({}, props), {
17902
+ onChange: handleChange,
17903
+ resourceQuery
17904
+ })
17905
+ ),
17834
17906
  modeSelectorOptions.length > 1 && /* @__PURE__ */ jsx4(
17835
17907
  ActionMenu,
17836
17908
  {
@@ -17839,9 +17911,9 @@ function CustomStringField(props) {
17839
17911
  triggerRenderer: /* @__PURE__ */ jsx4(
17840
17912
  Button11,
17841
17913
  {
17914
+ disabled: props.readonly,
17842
17915
  icon: /* @__PURE__ */ jsx4(Icon9, { source: MoreHoriz }),
17843
- kind: "secondary",
17844
- disabled: props.readonly
17916
+ kind: "secondary"
17845
17917
  }
17846
17918
  )
17847
17919
  }
@@ -17866,12 +17938,12 @@ function CustomAddButton(props) {
17866
17938
  return /* @__PURE__ */ jsx4(
17867
17939
  Button12,
17868
17940
  {
17941
+ disabled: props.disabled,
17869
17942
  icon: /* @__PURE__ */ jsx4(Icon10, { source: Add5 }),
17870
17943
  kind: "secondary",
17871
17944
  onClick: (e) => {
17872
17945
  onClick && onClick(e);
17873
17946
  },
17874
- disabled: props.disabled,
17875
17947
  size: "medium",
17876
17948
  children: "Add property"
17877
17949
  }
@@ -17888,9 +17960,9 @@ function CustomRemoveButton(props) {
17888
17960
  width: var(${SpacingToken12.Spacing6}) !important;
17889
17961
  padding: 1px;
17890
17962
  `,
17963
+ disabled: props.disabled,
17891
17964
  icon: /* @__PURE__ */ jsx4(Icon10, { source: Delete }),
17892
17965
  kind: "text",
17893
- disabled: props.disabled,
17894
17966
  onClick: (e) => {
17895
17967
  onClick && onClick(e);
17896
17968
  }
@@ -17908,9 +17980,9 @@ function CustomMoveUpButton(props) {
17908
17980
  width: var(${SpacingToken12.Spacing6}) !important;
17909
17981
  padding: 1px;
17910
17982
  `,
17983
+ disabled: props.disabled,
17911
17984
  icon: /* @__PURE__ */ jsx4(Icon10, { source: ArrowUpward }),
17912
17985
  kind: "text",
17913
- disabled: props.disabled,
17914
17986
  onClick: (e) => {
17915
17987
  onClick && onClick(e);
17916
17988
  }
@@ -17928,9 +18000,9 @@ function CustomMoveDownButton(props) {
17928
18000
  width: var(${SpacingToken12.Spacing6}) !important;
17929
18001
  padding: 1px;
17930
18002
  `,
18003
+ disabled: props.disabled,
17931
18004
  icon: /* @__PURE__ */ jsx4(Icon10, { source: ArrowDownward }),
17932
18005
  kind: "text",
17933
- disabled: props.disabled,
17934
18006
  onClick: (e) => {
17935
18007
  onClick && onClick(e);
17936
18008
  }
@@ -18045,11 +18117,11 @@ function CustomArrayFieldTemplate(props) {
18045
18117
  uiSchema
18046
18118
  }
18047
18119
  ),
18048
- /* @__PURE__ */ jsx10("div", { className: "row array-item-list", children: items == null ? void 0 : items.map((_a) => {
18120
+ /* @__PURE__ */ jsx10("div", { className: "row array-item-list", children: items.map((_a) => {
18049
18121
  var _b = _a, { key } = _b, itemProps = __objRest(_b, ["key"]);
18050
18122
  return /* @__PURE__ */ jsx10(ArrayFieldItemTemplate, __spreadValues({}, itemProps), key);
18051
18123
  }) }),
18052
- canAdd && /* @__PURE__ */ jsx10(
18124
+ canAdd ? /* @__PURE__ */ jsx10(
18053
18125
  AddButton,
18054
18126
  {
18055
18127
  className: "array-item-add",
@@ -18058,7 +18130,7 @@ function CustomArrayFieldTemplate(props) {
18058
18130
  registry,
18059
18131
  uiSchema
18060
18132
  }
18061
- )
18133
+ ) : null
18062
18134
  ] });
18063
18135
  }
18064
18136
 
@@ -18342,7 +18414,7 @@ function CustomObjectFieldTemplate(props) {
18342
18414
  const [touched, setTouched] = useState13({});
18343
18415
  const newProperties = properties.map((prop) => {
18344
18416
  return __spreadProps(__spreadValues({}, prop), {
18345
- hidden: !(prop.content.props.required || touched[prop.name] || ADDITIONAL_PROPERTY_FLAG3 in prop.content.props.schema || (Array.isArray(prop.content.props.formData) ? prop.content.props.formData.length > 0 : prop.content.props.formData)),
18417
+ hidden: !(touched[prop.name] || prop.content.props.required || prop.content.props.schema.visible || ADDITIONAL_PROPERTY_FLAG3 in prop.content.props.schema || (Array.isArray(prop.content.props.formData) ? prop.content.props.formData.length > 0 : prop.content.props.formData)),
18346
18418
  content: __spreadProps(__spreadValues({}, prop.content), {
18347
18419
  props: __spreadProps(__spreadValues({}, prop.content.props), {
18348
18420
  onChange: (value, newErrorSchema, id) => {
@@ -18940,7 +19012,7 @@ function HttpNodeBase({
18940
19012
  var Base_default2 = HttpNodeBase;
18941
19013
 
18942
19014
  // src/views/Workflows/Creator/Builder/Forms/Schema/Wrapper.tsx
18943
- import { useMemo as useMemo7, useState as useState15 } from "react";
19015
+ import { useMemo as useMemo8, useState as useState15 } from "react";
18944
19016
  import { Error as Error4 } from "@livechat/design-system-icons";
18945
19017
  import {
18946
19018
  Icon as Icon15,
@@ -18959,8 +19031,8 @@ import {
18959
19031
  } from "@livechat/platform-integrations";
18960
19032
 
18961
19033
  // src/views/Workflows/Creator/Builder/Forms/Schema/integrations/Text/index.tsx
18962
- import { useCallback as useCallback7 } from "react";
18963
- import { useLocation as useLocation3 } from "react-router-dom";
19034
+ import { useCallback as useCallback10 } from "react";
19035
+ import { useLocation as useLocation4 } from "react-router-dom";
18964
19036
  import { Button as Button15, SpacingToken as SpacingToken17 } from "@livechat/design-system-react-components";
18965
19037
  import {
18966
19038
  Card,
@@ -18974,7 +19046,7 @@ import {
18974
19046
  triggerAccountsAction
18975
19047
  } from "@livechat/platform-integrations";
18976
19048
  function GlobalAccounts(props) {
18977
- const { pathname } = useLocation3();
19049
+ const { pathname } = useLocation4();
18978
19050
  const notifications = useNotificationContext3();
18979
19051
  const { user } = useUserContext7();
18980
19052
  const organizationProductsQuery = useFetchOrganizationProducts();
@@ -18985,7 +19057,7 @@ function GlobalAccounts(props) {
18985
19057
  const needToBeActivated = organizationProductsQuery.data ? !organizationProductsQuery.data.find(
18986
19058
  (product) => product.product === props.product
18987
19059
  ) : void 0;
18988
- const refetch = useCallback7(() => {
19060
+ const refetch = useCallback10(() => {
18989
19061
  void organizationProductsQuery.refetch();
18990
19062
  }, [organizationProductsQuery]);
18991
19063
  return /* @__PURE__ */ jsxs2(Column8, { gap: `var(${SpacingToken17.Spacing3})`, notPadded: true, children: [
@@ -19061,11 +19133,11 @@ function CustomSchemaFormWrapper({
19061
19133
  preselectedTab,
19062
19134
  tabsMetadata
19063
19135
  }) {
19064
- const spec = useMemo7(() => WorkflowSpecification.getItemConfig(data), [data]);
19136
+ const spec = useMemo8(() => WorkflowSpecification.getItemConfig(data), [data]);
19065
19137
  const [selectedTab, setSelectedTab] = useState15(
19066
19138
  preselectedTab != null ? preselectedTab : !spec || spec.specification.input ? "parameters" : spec && spec.customization.provider !== OTHER_TYPES.SYSTEM ? "connection" : void 0
19067
19139
  );
19068
- const tabItems = useMemo7(
19140
+ const tabItems = useMemo8(
19069
19141
  () => [
19070
19142
  !spec || spec.specification.input ? { id: "parameters", title: "Parameters" } : void 0,
19071
19143
  spec && spec.customization.provider !== OTHER_TYPES.SYSTEM ? {
@@ -19184,15 +19256,7 @@ function HttpNodeForm({
19184
19256
  data
19185
19257
  }),
19186
19258
  formData: queryParams,
19187
- formErrors: ((_l = (_k = (_j = metadata.errors) == null ? void 0 : _j.inputParameters) == null ? void 0 : _k.http_request) == null ? void 0 : _l.uri) ? Object.fromEntries(
19188
- Object.entries(queryParams).map((entry) => {
19189
- var _a2, _b2, _c2;
19190
- return [
19191
- entry[0],
19192
- (_c2 = (_b2 = (_a2 = metadata.errors) == null ? void 0 : _a2.inputParameters) == null ? void 0 : _b2.http_request) == null ? void 0 : _c2.uri
19193
- ];
19194
- })
19195
- ) : void 0,
19259
+ formErrors: ((_l = (_k = (_j = metadata.errors) == null ? void 0 : _j.inputParameters) == null ? void 0 : _k.http_request) == null ? void 0 : _l.uri) ? metadata.errors.inputParameters.http_request.uri : void 0,
19196
19260
  onChange: (formData) => {
19197
19261
  onChange(__spreadProps(__spreadValues({}, data), {
19198
19262
  inputParameters: __spreadProps(__spreadValues({}, data.inputParameters), {
@@ -20170,8 +20234,8 @@ function TriggerNode(node2) {
20170
20234
  var Node_default6 = memo9(TriggerNode);
20171
20235
 
20172
20236
  // src/views/Workflows/Creator/Builder/Controls/CustomControls.tsx
20173
- import { useEffect as useEffect16 } from "react";
20174
- import { useLocation as useLocation4, useNavigate as useNavigate7 } from "react-router-dom";
20237
+ import { useEffect as useEffect17 } from "react";
20238
+ import { useLocation as useLocation5, useNavigate as useNavigate8 } from "react-router-dom";
20175
20239
  import { ControlButton, Controls, useReactFlow as useReactFlow2 } from "reactflow";
20176
20240
  import {
20177
20241
  ArrowAutofitWidth,
@@ -20317,7 +20381,7 @@ function StopGenerateButton() {
20317
20381
  }
20318
20382
 
20319
20383
  // src/views/Workflows/Common/One/widget/message-box/AskButton.tsx
20320
- import { useEffect as useEffect11, useState as useState22 } from "react";
20384
+ import { useEffect as useEffect12, useState as useState22 } from "react";
20321
20385
  import { useLexicalComposerContext as useLexicalComposerContext3 } from "@lexical/react/LexicalComposerContext";
20322
20386
  import {
20323
20387
  Button as Button17,
@@ -20326,7 +20390,7 @@ import {
20326
20390
  } from "@livechat/design-system-react-components";
20327
20391
 
20328
20392
  // src/views/Workflows/Common/One/hooks/useAboveCharacterLimit.ts
20329
- import { useEffect as useEffect10, useState as useState21 } from "react";
20393
+ import { useEffect as useEffect11, useState as useState21 } from "react";
20330
20394
  import { useLexicalComposerContext } from "@lexical/react/LexicalComposerContext";
20331
20395
 
20332
20396
  // src/views/Workflows/Common/One/widget/message-box/constants.ts
@@ -20336,7 +20400,7 @@ var ONE_CHARACTER_LIMIT = 1e4;
20336
20400
  var useAboveCharacterLimit = () => {
20337
20401
  const [editor] = useLexicalComposerContext();
20338
20402
  const [aboveLimit, setAboveLimit] = useState21(0);
20339
- useEffect10(() => {
20403
+ useEffect11(() => {
20340
20404
  const registerTextContentListener = editor.registerTextContentListener(
20341
20405
  (textContent) => {
20342
20406
  setAboveLimit(textContent.length - ONE_CHARACTER_LIMIT);
@@ -20353,13 +20417,13 @@ var useAboveCharacterLimit = () => {
20353
20417
  };
20354
20418
 
20355
20419
  // src/views/Workflows/Common/One/hooks/useSendOneMessage.ts
20356
- import { useCallback as useCallback8, useContext as useContext8 } from "react";
20420
+ import { useCallback as useCallback11, useContext as useContext8 } from "react";
20357
20421
  import { useLexicalComposerContext as useLexicalComposerContext2 } from "@lexical/react/LexicalComposerContext";
20358
20422
  import { CLEAR_EDITOR_COMMAND } from "lexical";
20359
20423
  var useSendOneMessage = () => {
20360
20424
  const [editor] = useLexicalComposerContext2();
20361
20425
  const { sendMessage: sendMessage2 } = useContext8(OneMessagesContext);
20362
- const onSend = useCallback8(() => {
20426
+ const onSend = useCallback11(() => {
20363
20427
  var _a;
20364
20428
  const messageToSend = (_a = editor.getRootElement()) == null ? void 0 : _a.innerText.trim();
20365
20429
  if (!messageToSend) {
@@ -20378,7 +20442,7 @@ function AskButton() {
20378
20442
  const isLoading = false;
20379
20443
  const { isAboveLimit } = useAboveCharacterLimit();
20380
20444
  const handleSend = useSendOneMessage();
20381
- useEffect11(() => {
20445
+ useEffect12(() => {
20382
20446
  const registerTextContentListener = editor.registerTextContentListener(
20383
20447
  (textContent) => {
20384
20448
  setIsDisabled(!textContent);
@@ -20452,34 +20516,34 @@ import { HistoryPlugin } from "@lexical/react/LexicalHistoryPlugin";
20452
20516
  import { PlainTextPlugin } from "@lexical/react/LexicalPlainTextPlugin";
20453
20517
 
20454
20518
  // src/views/Workflows/Common/One/widget/message-box/custom-plugins/AutoFocusPlugin.tsx
20455
- import { useCallback as useCallback9, useEffect as useEffect12 } from "react";
20519
+ import { useCallback as useCallback12, useEffect as useEffect13 } from "react";
20456
20520
  import { useLexicalComposerContext as useLexicalComposerContext4 } from "@lexical/react/LexicalComposerContext";
20457
20521
  function AutoFocusPlugin() {
20458
20522
  const [editor] = useLexicalComposerContext4();
20459
- const handleFocus = useCallback9(() => {
20523
+ const handleFocus = useCallback12(() => {
20460
20524
  editor.focus();
20461
20525
  }, [editor]);
20462
- useEffect12(() => {
20526
+ useEffect13(() => {
20463
20527
  handleFocus();
20464
20528
  }, []);
20465
20529
  return null;
20466
20530
  }
20467
20531
 
20468
20532
  // src/views/Workflows/Common/One/widget/message-box/custom-plugins/EnterDownPlugin.tsx
20469
- import { useCallback as useCallback10, useEffect as useEffect13 } from "react";
20533
+ import { useCallback as useCallback13, useEffect as useEffect14 } from "react";
20470
20534
  import { useLexicalComposerContext as useLexicalComposerContext5 } from "@lexical/react/LexicalComposerContext";
20471
20535
  import { COMMAND_PRIORITY_LOW, KEY_ENTER_COMMAND } from "lexical";
20472
20536
  function EnterDownPlugin({ isCommandMenuVisibleRef }) {
20473
20537
  const [editor] = useLexicalComposerContext5();
20474
20538
  const isLoading = false;
20475
20539
  const handleSendMessage = useSendOneMessage();
20476
- const onEnterDown = useCallback10(() => {
20540
+ const onEnterDown = useCallback13(() => {
20477
20541
  if (isLoading || (isCommandMenuVisibleRef == null ? void 0 : isCommandMenuVisibleRef.current)) {
20478
20542
  return;
20479
20543
  }
20480
20544
  handleSendMessage({ enter: true, messageBox: true });
20481
20545
  }, [handleSendMessage, isLoading, isCommandMenuVisibleRef]);
20482
- useEffect13(
20546
+ useEffect14(
20483
20547
  () => editor.registerCommand(
20484
20548
  KEY_ENTER_COMMAND,
20485
20549
  (event) => {
@@ -20542,10 +20606,10 @@ function OneMessageBox() {
20542
20606
  }
20543
20607
 
20544
20608
  // src/views/Workflows/Common/One/widget/OneChatFeedContent.tsx
20545
- import { useRef as useRef7 } from "react";
20609
+ import { useRef as useRef8 } from "react";
20546
20610
 
20547
20611
  // src/views/Workflows/Common/One/hooks/useScroll.ts
20548
- import { useCallback as useCallback11, useEffect as useEffect14, useRef as useRef6 } from "react";
20612
+ import { useCallback as useCallback14, useEffect as useEffect15, useRef as useRef7 } from "react";
20549
20613
  import debounce4 from "lodash.debounce";
20550
20614
  var useScroll = ({
20551
20615
  oneChatFeedRef,
@@ -20553,10 +20617,10 @@ var useScroll = ({
20553
20617
  additionalEvents
20554
20618
  }) => {
20555
20619
  const oneScrollPosition = 0;
20556
- const currentScrollPosition = useRef6(null);
20557
- const isScrolledToBottom = useRef6(true);
20558
- const timeoutRef = useRef6(null);
20559
- const scrollToBottom = useCallback11(() => {
20620
+ const currentScrollPosition = useRef7(null);
20621
+ const isScrolledToBottom = useRef7(true);
20622
+ const timeoutRef = useRef7(null);
20623
+ const scrollToBottom = useCallback14(() => {
20560
20624
  if (timeoutRef.current) {
20561
20625
  clearTimeout(timeoutRef.current);
20562
20626
  }
@@ -20572,7 +20636,7 @@ var useScroll = ({
20572
20636
  }
20573
20637
  };
20574
20638
  }, []);
20575
- useEffect14(() => {
20639
+ useEffect15(() => {
20576
20640
  var _a;
20577
20641
  if (!oneScrollPosition) {
20578
20642
  scrollToBottom();
@@ -20581,12 +20645,12 @@ var useScroll = ({
20581
20645
  (_a = oneChatFeedRef.current) == null ? void 0 : _a.scrollTo({ top: oneScrollPosition });
20582
20646
  currentScrollPosition.current = oneScrollPosition;
20583
20647
  }, []);
20584
- useEffect14(() => {
20648
+ useEffect15(() => {
20585
20649
  if (additionalEvents && isScrolledToBottom.current) {
20586
20650
  scrollToBottom();
20587
20651
  }
20588
20652
  }, [scrollToBottom, additionalEvents]);
20589
- useEffect14(() => {
20653
+ useEffect15(() => {
20590
20654
  const [lastGroupEvent] = groupedEvents.slice(-1)[0];
20591
20655
  const isLastMessageFromAgent = lastGroupEvent.authorType === "agent" /* Agent */;
20592
20656
  if (isLastMessageFromAgent || isScrolledToBottom.current) {
@@ -21155,7 +21219,7 @@ function OneErrorEvent({ eventId }) {
21155
21219
  }
21156
21220
 
21157
21221
  // src/views/Workflows/Common/One/widget/events/OneImageEvent.tsx
21158
- import { useEffect as useEffect15, useState as useState23 } from "react";
21222
+ import { useEffect as useEffect16, useState as useState23 } from "react";
21159
21223
 
21160
21224
  // src/views/Workflows/Common/One/components/SkeletonLine.tsx
21161
21225
  import { DesignToken as DesignToken26 } from "@livechat/design-system-react-components";
@@ -21219,7 +21283,7 @@ function SkeletonLine({
21219
21283
  // src/views/Workflows/Common/One/widget/events/OneImageEvent.tsx
21220
21284
  function OneImageEvent({ imageUrl }) {
21221
21285
  const [isLoaded, setIsLoaded] = useState23(false);
21222
- useEffect15(() => {
21286
+ useEffect16(() => {
21223
21287
  const image = new Image();
21224
21288
  image.src = imageUrl;
21225
21289
  image.onload = () => {
@@ -21370,7 +21434,7 @@ var MarkdownEventRenderer = ({ children }) => /* @__PURE__ */ jsx4(
21370
21434
  );
21371
21435
 
21372
21436
  // src/views/Workflows/Common/One/components/NavigateButton.tsx
21373
- import { useNavigate as useNavigate6 } from "react-router-dom";
21437
+ import { useNavigate as useNavigate7 } from "react-router-dom";
21374
21438
  import { Add as Add7, ArrowForward, OpenInNew } from "@livechat/design-system-icons";
21375
21439
  import {
21376
21440
  Button as Button19,
@@ -21392,7 +21456,7 @@ function NavigateButton({
21392
21456
  kind,
21393
21457
  iconPosition
21394
21458
  }) {
21395
- const navigate = useNavigate6();
21459
+ const navigate = useNavigate7();
21396
21460
  const handleButtonClick = () => {
21397
21461
  if (isExternal) {
21398
21462
  window.open(url, "_blank");
@@ -21824,7 +21888,7 @@ function OneChatFeedContent({
21824
21888
  updateWorkflow,
21825
21889
  previewWorkflow
21826
21890
  }) {
21827
- const oneChatFeedRef = useRef7(null);
21891
+ const oneChatFeedRef = useRef8(null);
21828
21892
  const { groupedEvents, hasAdditionalEvents } = useOneMessagesContext();
21829
21893
  const { handleScroll } = useScroll({
21830
21894
  oneChatFeedRef,
@@ -21919,15 +21983,15 @@ function CustomControls({
21919
21983
  previewWorkflow
21920
21984
  }) {
21921
21985
  var _a;
21922
- const navigate = useNavigate7();
21986
+ const navigate = useNavigate8();
21923
21987
  const { fitView, zoomIn, zoomOut } = useReactFlow2();
21924
21988
  const { toggleOneWidget, isOpen } = useOneWidgetContext();
21925
21989
  const {
21926
21990
  state: { visibility },
21927
21991
  focus
21928
21992
  } = useWorkflowCreator();
21929
- const location = useLocation4();
21930
- useEffect16(() => {
21993
+ const location = useLocation5();
21994
+ useEffect17(() => {
21931
21995
  var _a2;
21932
21996
  if ((_a2 = location.state) == null ? void 0 : _a2.openOne) {
21933
21997
  if (!isOpen) {
@@ -22033,7 +22097,7 @@ var CustomControls_default = CustomControls;
22033
22097
 
22034
22098
  // src/views/Workflows/Creator/Builder/Controls/SwitcherControls.tsx
22035
22099
  import { useState as useState26 } from "react";
22036
- import { useNavigate as useNavigate8 } from "react-router-dom";
22100
+ import { useNavigate as useNavigate9 } from "react-router-dom";
22037
22101
  import { Controls as Controls2 } from "reactflow";
22038
22102
  import { SegmentedControl } from "@livechat/design-system-react-components";
22039
22103
  import { jsx as jsx13 } from "react/jsx-runtime";
@@ -22045,7 +22109,7 @@ function SwitcherControls({
22045
22109
  const [currentView, setCurrentView] = useState26(
22046
22110
  isDraft ? "draft" : "published"
22047
22111
  );
22048
- const navigate = useNavigate8();
22112
+ const navigate = useNavigate9();
22049
22113
  const {
22050
22114
  focus,
22051
22115
  state: { visibility }
@@ -22574,13 +22638,13 @@ function WorkflowBuilder() {
22574
22638
  []
22575
22639
  );
22576
22640
  const [edges, setEdges, onEdgesChange] = useEdgesState([]);
22577
- const onConnect = useCallback12(
22641
+ const onConnect = useCallback15(
22578
22642
  (params) => {
22579
22643
  setEdges((eds) => addEdge(params, eds));
22580
22644
  },
22581
22645
  [setEdges]
22582
22646
  );
22583
- useEffect17(() => {
22647
+ useEffect18(() => {
22584
22648
  void (() => __async(this, null, function* () {
22585
22649
  const { nodes: nodes2, edges: edges2 } = yield convertWorkflowDefinitionToReactflow(
22586
22650
  workflow
@@ -22712,8 +22776,8 @@ function PreviewWorkflowModal({
22712
22776
  onApply,
22713
22777
  onClose
22714
22778
  }) {
22715
- const navigate = useNavigate9();
22716
- const handleClose = useCallback13(
22779
+ const navigate = useNavigate10();
22780
+ const handleClose = useCallback16(
22717
22781
  (target) => {
22718
22782
  if (onClose) {
22719
22783
  onClose();
@@ -22727,7 +22791,7 @@ function PreviewWorkflowModal({
22727
22791
  },
22728
22792
  [onClose, navigate]
22729
22793
  );
22730
- const handleApply = useCallback13(() => {
22794
+ const handleApply = useCallback16(() => {
22731
22795
  if (onApply) {
22732
22796
  onApply();
22733
22797
  }
@@ -22818,39 +22882,56 @@ function PublishWorkflowModal({
22818
22882
  },
22819
22883
  publishDraft
22820
22884
  } = useWorkflowCreator();
22821
- return /* @__PURE__ */ jsx15(Modal7, { heading: true, onClose, children: /* @__PURE__ */ jsx15(
22822
- ActionModalContent3,
22885
+ return /* @__PURE__ */ jsx15(
22886
+ Modal7,
22823
22887
  {
22824
- actions: /* @__PURE__ */ jsxs8(Fragment9, { children: [
22825
- /* @__PURE__ */ jsx15(Button24, { kind: "secondary", onClick: onClose, children: "Cancel" }),
22826
- /* @__PURE__ */ jsx15(
22827
- Button24,
22828
- {
22829
- kind: "primary",
22830
- loading: isPublishing,
22831
- onClick: () => void publishDraft({
22832
- confirmed: true
22833
- }),
22834
- children: "Publish workflow"
22835
- }
22836
- )
22837
- ] }),
22838
- heading: "You are publishing a workflow",
22839
- icon: /* @__PURE__ */ jsx15(
22840
- Icon26,
22888
+ "data-testid": WORKFLOWS_TEST_SELECTORS.views.workflows.creator.modals.publish.wrapper,
22889
+ heading: true,
22890
+ onClose,
22891
+ children: /* @__PURE__ */ jsx15(
22892
+ ActionModalContent3,
22841
22893
  {
22842
- customColor: `var(${DesignToken33.ContentBasicDisabled})`,
22843
- size: "xxlarge",
22844
- source: Error5
22894
+ actions: /* @__PURE__ */ jsxs8(Fragment9, { children: [
22895
+ /* @__PURE__ */ jsx15(
22896
+ Button24,
22897
+ {
22898
+ "data-testid": WORKFLOWS_TEST_SELECTORS.views.workflows.creator.modals.publish.cancelButton,
22899
+ kind: "secondary",
22900
+ onClick: onClose,
22901
+ children: "Cancel"
22902
+ }
22903
+ ),
22904
+ /* @__PURE__ */ jsx15(
22905
+ Button24,
22906
+ {
22907
+ "data-testid": WORKFLOWS_TEST_SELECTORS.views.workflows.creator.modals.publish.saveButton,
22908
+ kind: "primary",
22909
+ loading: isPublishing,
22910
+ onClick: () => void publishDraft({
22911
+ confirmed: true
22912
+ }),
22913
+ children: "Publish workflow"
22914
+ }
22915
+ )
22916
+ ] }),
22917
+ heading: "You are publishing a workflow",
22918
+ icon: /* @__PURE__ */ jsx15(
22919
+ Icon26,
22920
+ {
22921
+ customColor: `var(${DesignToken33.ContentBasicDisabled})`,
22922
+ size: "xxlarge",
22923
+ source: Error5
22924
+ }
22925
+ ),
22926
+ children: "Once published, this will be the working version of your workflow and will\xA0be\xA0automatically set to active."
22845
22927
  }
22846
- ),
22847
- children: "Once published, this will be the working version of your workflow and will\xA0be\xA0automatically set to active."
22928
+ )
22848
22929
  }
22849
- ) });
22930
+ );
22850
22931
  }
22851
22932
 
22852
22933
  // src/views/Workflows/Creator/View.tsx
22853
- import { useEffect as useEffect19 } from "react";
22934
+ import { useEffect as useEffect20 } from "react";
22854
22935
  import { Route as Route2, Routes as Routes2 } from "react-router-dom";
22855
22936
  import { useReactFlow as useReactFlow3 } from "reactflow";
22856
22937
  import {
@@ -22868,7 +22949,7 @@ var sendMessage = (type) => {
22868
22949
  import { Navigate, Route, Routes } from "react-router-dom";
22869
22950
 
22870
22951
  // src/views/Workflows/Creator/Panels/Details/Panel.tsx
22871
- import { useNavigate as useNavigate10, useParams as useParams3 } from "react-router-dom";
22952
+ import { useNavigate as useNavigate11, useParams as useParams4 } from "react-router-dom";
22872
22953
  import { Close as Close3 } from "@livechat/design-system-icons";
22873
22954
  import {
22874
22955
  Button as Button25,
@@ -22889,11 +22970,14 @@ import { Row as Row14 } from "@livechat/developer-studio-ui-react";
22889
22970
  // src/views/Workflows/Creator/Panels/Details/Executions/List.tsx
22890
22971
  import { CheckCircle as CheckCircle2, CloseCircle as CloseCircle2 } from "@livechat/design-system-icons";
22891
22972
  import {
22892
- Badge as Badge2,
22893
22973
  DesignToken as DesignToken34,
22894
22974
  Icon as Icon27,
22895
- SpacingToken as SpacingToken29
22975
+ SpacingToken as SpacingToken29,
22976
+ Tag as Tag2
22896
22977
  } from "@livechat/design-system-react-components";
22978
+ import {
22979
+ WorkflowExecutionStatus
22980
+ } from "@livechat/developer-studio-api";
22897
22981
  import { formatUSADate, Row as Row12 } from "@livechat/developer-studio-ui-react";
22898
22982
  var tableCss = css`
22899
22983
  font-size: 13px;
@@ -22927,22 +23011,18 @@ function WorkflowExecutionList({
22927
23011
  /* @__PURE__ */ jsx4("td", { children: formatUSADate(execution.started_at) }),
22928
23012
  /* @__PURE__ */ jsx4("td", { children: formatUSADate(execution.ended_at) }),
22929
23013
  /* @__PURE__ */ jsx4("td", { children: /* @__PURE__ */ jsx4(
22930
- Badge2,
23014
+ Tag2,
22931
23015
  {
22932
- css: css`
22933
- display: flex;
22934
- background-color: ${execution.status === "COMPLETED" ? `var(${DesignToken34.SurfaceAccentEmphasisLowPositive})` : `var(${DesignToken34.SurfaceAccentEmphasisLowNegative})`};
22935
- color: ${execution.status === "COMPLETED" ? `var(${DesignToken34.ContentBasicPositive})` : `var(${DesignToken34.ContentBasicNegative})`};
22936
- `,
22937
- children: /* @__PURE__ */ jsxs2(Row12, { gap: 4, notPadded: true, children: [
22938
- /* @__PURE__ */ jsx4(
22939
- Icon27,
22940
- {
22941
- source: execution.status === "COMPLETED" ? CheckCircle2 : CloseCircle2
22942
- }
22943
- ),
22944
- execution.status
22945
- ] })
23016
+ kind: execution.status === WorkflowExecutionStatus.Completed ? "success" : "error",
23017
+ leftNode: /* @__PURE__ */ jsx4(
23018
+ Icon27,
23019
+ {
23020
+ size: "small",
23021
+ source: execution.status === WorkflowExecutionStatus.Completed ? CheckCircle2 : CloseCircle2
23022
+ }
23023
+ ),
23024
+ size: "small",
23025
+ children: execution.status
22946
23026
  }
22947
23027
  ) })
22948
23028
  ] }, execution.id)) : /* @__PURE__ */ jsx4("tr", { children: /* @__PURE__ */ jsx4("td", { align: "center", colSpan: 4, children: "No executions" }) }) })
@@ -23048,8 +23128,8 @@ function WorkflowDetailsPanel({
23048
23128
  onClose
23049
23129
  }) {
23050
23130
  var _a, _b, _c, _d, _e;
23051
- const navigate = useNavigate10();
23052
- const { id, tab } = useParams3();
23131
+ const navigate = useNavigate11();
23132
+ const { id, tab } = useParams4();
23053
23133
  const workflowQuery = useFetchWorkflow(id);
23054
23134
  const workflowExecutionsQuery = useFetchWorkflowExecutionList(id);
23055
23135
  const relatedWorkflowQuery = useFetchWorkflow(
@@ -23163,8 +23243,8 @@ function WorkflowDetails({
23163
23243
  }
23164
23244
 
23165
23245
  // src/views/Workflows/Creator/Panels/Editor/Panel.tsx
23166
- import { useRef as useRef8, useState as useState27 } from "react";
23167
- import { useNavigate as useNavigate11 } from "react-router-dom";
23246
+ import { useRef as useRef9, useState as useState27 } from "react";
23247
+ import { useNavigate as useNavigate12 } from "react-router-dom";
23168
23248
  import { Editor } from "@monaco-editor/react";
23169
23249
  import { Close as Close4 } from "@livechat/design-system-icons";
23170
23250
  import {
@@ -23195,13 +23275,13 @@ function configureMonaco(monaco) {
23195
23275
  });
23196
23276
  }
23197
23277
  function WorkflowEditorPanel({ onClose }) {
23198
- const navigate = useNavigate11();
23278
+ const navigate = useNavigate12();
23199
23279
  const {
23200
23280
  state: { workflow },
23201
23281
  replaceWorkflow,
23202
23282
  focus
23203
23283
  } = useWorkflowCreator();
23204
- const editorRef = useRef8();
23284
+ const editorRef = useRef9();
23205
23285
  const [, setIsModified] = useState27(false);
23206
23286
  const [, setJsonErrors] = useState27([]);
23207
23287
  const filteredWorkflow = {
@@ -23437,64 +23517,71 @@ function WorkflowElementPanel() {
23437
23517
  }
23438
23518
  };
23439
23519
  const revertIconColor = getWorkflowsEnv("isHeadless") && ((config2 == null ? void 0 : config2.customization.provider) === IntegrationNames18.OpenAI || (config2 == null ? void 0 : config2.customization.provider) === IntegrationNames18.BigCommerce);
23440
- return /* @__PURE__ */ jsxs2(Wrapper4, { children: [
23441
- /* @__PURE__ */ jsxs2(Row16, { center: true, setRowPadding: "12px 24px", spaceBetween: true, children: [
23442
- /* @__PURE__ */ jsx4(
23443
- Header7,
23444
- {
23445
- css: css`
23520
+ return /* @__PURE__ */ jsxs2(
23521
+ Wrapper4,
23522
+ {
23523
+ "data-testid": WORKFLOWS_TEST_SELECTORS.views.workflows.creator.panels.element.wrapper,
23524
+ children: [
23525
+ " ",
23526
+ /* @__PURE__ */ jsxs2(Row16, { center: true, setRowPadding: "12px 24px", spaceBetween: true, children: [
23527
+ /* @__PURE__ */ jsx4(
23528
+ Header7,
23529
+ {
23530
+ css: css`
23446
23531
  max-width: 85%;
23447
23532
  `,
23448
- children: /* @__PURE__ */ jsxs2(Title7, { children: [
23449
- (config2 == null ? void 0 : config2.customization.product) ? /* @__PURE__ */ jsx4(
23450
- ProductIcon_default,
23451
- {
23452
- center: true,
23453
- disabled: false,
23454
- height: 10,
23455
- product: config2.customization.provider,
23456
- revertColors: revertIconColor,
23457
- width: 10
23458
- }
23459
- ) : /* @__PURE__ */ jsx4("div", { children: /* @__PURE__ */ jsx4(
23460
- Icon30,
23461
- {
23462
- css: css`
23533
+ children: /* @__PURE__ */ jsxs2(Title7, { children: [
23534
+ (config2 == null ? void 0 : config2.customization.product) ? /* @__PURE__ */ jsx4(
23535
+ ProductIcon_default,
23536
+ {
23537
+ center: true,
23538
+ disabled: false,
23539
+ height: 10,
23540
+ product: config2.customization.provider,
23541
+ revertColors: revertIconColor,
23542
+ width: 10
23543
+ }
23544
+ ) : /* @__PURE__ */ jsx4("div", { children: /* @__PURE__ */ jsx4(
23545
+ Icon30,
23546
+ {
23547
+ css: css`
23463
23548
  width: var(${SpacingToken33.Spacing6});
23464
23549
  `,
23465
- size: "xlarge",
23466
- source: Automation2
23467
- }
23468
- ) }),
23469
- /* @__PURE__ */ jsxs2(Column13, { noFlexBasis: true, notPadded: true, children: [
23470
- /* @__PURE__ */ jsxs2("strong", { children: [
23471
- ((_d = frame == null ? void 0 : frame.__meta) == null ? void 0 : _d.index) !== void 0 ? `${frame.__meta.index}. ` : "",
23472
- (_e = config2 == null ? void 0 : config2.customization.displayName) != null ? _e : data.type === NodeNames.switch ? "Condition" : data.type === NodeNames.http ? "Custom HTTP" : data.type === NodeNames.terminate ? "End workflow" : ""
23473
- ] }),
23474
- (_f = config2 == null ? void 0 : config2.customization.description) != null ? _f : data.type === NodeNames.switch ? "Conditional execution" : data.type === NodeNames.http ? "Make an HTTP request" : data.type === NodeNames.terminate ? "End the workflow" : ""
23475
- ] })
23476
- ] })
23477
- }
23478
- ),
23479
- /* @__PURE__ */ jsx4(
23480
- Button27,
23481
- {
23482
- kind: "plain",
23483
- onClick: () => {
23484
- toggle();
23485
- },
23486
- children: /* @__PURE__ */ jsx4(Icon30, { source: Close5 })
23487
- }
23488
- )
23489
- ] }),
23490
- /* @__PURE__ */ jsx4(Row16, { css: formCss, children: contentHandler() })
23491
- ] });
23550
+ size: "xlarge",
23551
+ source: Automation2
23552
+ }
23553
+ ) }),
23554
+ /* @__PURE__ */ jsxs2(Column13, { noFlexBasis: true, notPadded: true, children: [
23555
+ /* @__PURE__ */ jsxs2("strong", { children: [
23556
+ ((_d = frame == null ? void 0 : frame.__meta) == null ? void 0 : _d.index) !== void 0 ? `${frame.__meta.index}. ` : "",
23557
+ (_e = config2 == null ? void 0 : config2.customization.displayName) != null ? _e : data.type === NodeNames.switch ? "Condition" : data.type === NodeNames.http ? "Custom HTTP" : data.type === NodeNames.terminate ? "End workflow" : ""
23558
+ ] }),
23559
+ (_f = config2 == null ? void 0 : config2.customization.description) != null ? _f : data.type === NodeNames.switch ? "Conditional execution" : data.type === NodeNames.http ? "Make an HTTP request" : data.type === NodeNames.terminate ? "End the workflow" : ""
23560
+ ] })
23561
+ ] })
23562
+ }
23563
+ ),
23564
+ /* @__PURE__ */ jsx4(
23565
+ Button27,
23566
+ {
23567
+ kind: "plain",
23568
+ onClick: () => {
23569
+ toggle();
23570
+ },
23571
+ children: /* @__PURE__ */ jsx4(Icon30, { source: Close5 })
23572
+ }
23573
+ )
23574
+ ] }),
23575
+ /* @__PURE__ */ jsx4(Row16, { css: formCss, children: contentHandler() })
23576
+ ]
23577
+ }
23578
+ );
23492
23579
  }
23493
23580
  var Panel_default3 = WorkflowElementPanel;
23494
23581
 
23495
23582
  // src/views/Workflows/Creator/Navbar.tsx
23496
- import { useEffect as useEffect18, useRef as useRef9, useState as useState28 } from "react";
23497
- import { useNavigate as useNavigate12 } from "react-router-dom";
23583
+ import { useEffect as useEffect19, useRef as useRef10, useState as useState28 } from "react";
23584
+ import { useNavigate as useNavigate13 } from "react-router-dom";
23498
23585
  import { ChevronDown as ChevronDown3, Close as Close6 } from "@livechat/design-system-icons";
23499
23586
  import {
23500
23587
  ActionMenu as ActionMenu2,
@@ -23515,7 +23602,7 @@ import {
23515
23602
  } from "@livechat/developer-studio-ui-react";
23516
23603
  function WorkflowCreatorNavbar() {
23517
23604
  var _a, _b, _c, _d, _e;
23518
- const navigate = useNavigate12();
23605
+ const navigate = useNavigate13();
23519
23606
  const {
23520
23607
  state: {
23521
23608
  workflow,
@@ -23528,14 +23615,14 @@ function WorkflowCreatorNavbar() {
23528
23615
  publishDraft,
23529
23616
  toggle
23530
23617
  } = useWorkflowCreator();
23531
- const inputRef = useRef9(null);
23618
+ const inputRef = useRef10(null);
23532
23619
  const [isNameChanging, setIsNameChanging] = useState28(false);
23533
23620
  const [workflowName, setWorkflowName] = useState28(workflow.name);
23534
23621
  const { user } = useUserContext8();
23535
23622
  const amplitudeWorkflowsJourney = workflowsBlockAmplitudeJourneyFactory(
23536
23623
  user == null ? void 0 : user.meta.email
23537
23624
  );
23538
- useEffect18(() => {
23625
+ useEffect19(() => {
23539
23626
  setWorkflowName(workflow.name);
23540
23627
  }, [workflow.name]);
23541
23628
  useOnClickOutside2(inputRef, () => {
@@ -23707,6 +23794,7 @@ function WorkflowCreatorNavbar() {
23707
23794
  triggerRenderer: /* @__PURE__ */ jsx4(
23708
23795
  Switch,
23709
23796
  {
23797
+ "data-testid": WORKFLOWS_TEST_SELECTORS.views.workflows.creator.navbar.activateSwitch,
23710
23798
  on: workflow.active,
23711
23799
  onChange: () => void activate(),
23712
23800
  size: "medium",
@@ -23729,7 +23817,15 @@ function WorkflowCreatorNavbar() {
23729
23817
  workflow.draft ? !workflow.trigger.type || !workflow.definition.tasks.length ? /* @__PURE__ */ jsxs2(
23730
23818
  Tooltip8,
23731
23819
  {
23732
- triggerRenderer: /* @__PURE__ */ jsx4(Button28, { disabled: true, kind: "primary", children: "Publish" }),
23820
+ triggerRenderer: /* @__PURE__ */ jsx4(
23821
+ Button28,
23822
+ {
23823
+ "data-testid": WORKFLOWS_TEST_SELECTORS.views.workflows.creator.navbar.publishButton,
23824
+ disabled: true,
23825
+ kind: "primary",
23826
+ children: "Publish"
23827
+ }
23828
+ ),
23733
23829
  children: [
23734
23830
  !workflow.trigger.type && "To publish a workflow, add a trigger.",
23735
23831
  !workflow.definition.tasks.length && "To publish a workflow, add at least one task."
@@ -23738,6 +23834,7 @@ function WorkflowCreatorNavbar() {
23738
23834
  ) : /* @__PURE__ */ jsx4(
23739
23835
  Button28,
23740
23836
  {
23837
+ "data-testid": WORKFLOWS_TEST_SELECTORS.views.workflows.creator.navbar.publishButton,
23741
23838
  disabled: !workflow.definition.tasks.length,
23742
23839
  kind: "primary",
23743
23840
  loading: isPublishing,
@@ -23752,6 +23849,7 @@ function WorkflowCreatorNavbar() {
23752
23849
  ) : /* @__PURE__ */ jsx4(
23753
23850
  Button28,
23754
23851
  {
23852
+ "data-testid": WORKFLOWS_TEST_SELECTORS.views.workflows.creator.navbar.editButton,
23755
23853
  kind: "primary",
23756
23854
  loading: isCreating,
23757
23855
  onClick: () => {
@@ -23795,7 +23893,7 @@ function WorkflowCreatorView() {
23795
23893
  focus
23796
23894
  } = useWorkflowCreator();
23797
23895
  const { fitView } = useReactFlow3();
23798
- useEffect19(() => {
23896
+ useEffect20(() => {
23799
23897
  if (getWorkflowsEnv("isLiveChatMode")) {
23800
23898
  sendMessage("closeSideNav" /* CloseSideNav */);
23801
23899
  const timeoutId = setTimeout(() => {
@@ -23839,9 +23937,9 @@ var View_default = WorkflowCreatorView;
23839
23937
  // src/views/Workflows/Creator/index.tsx
23840
23938
  function WorkflowCreator() {
23841
23939
  var _a, _b, _c;
23842
- const location = useLocation5();
23843
- const { id } = useParams4();
23844
- const navigate = useNavigate13();
23940
+ const location = useLocation6();
23941
+ const { id } = useParams5();
23942
+ const navigate = useNavigate14();
23845
23943
  const workflowQuery = useFetchWorkflow(id === "new" ? void 0 : id);
23846
23944
  const credentialsQuery = useFetchIntegrationCredentialsQuery2();
23847
23945
  const organizationProducts = useFetchOrganizationProducts2();
@@ -23980,12 +24078,12 @@ import { Row as Row27 } from "@livechat/developer-studio-ui-react";
23980
24078
  import { Route as Route4, Routes as Routes4 } from "react-router-dom";
23981
24079
 
23982
24080
  // src/views/Workflows/List/Modals/PreviewTemplate/index.tsx
23983
- import { useMemo as useMemo8 } from "react";
23984
- import { useParams as useParams5 } from "react-router-dom";
24081
+ import { useMemo as useMemo9 } from "react";
24082
+ import { useParams as useParams6 } from "react-router-dom";
23985
24083
 
23986
24084
  // src/views/Workflows/List/Modals/PreviewTemplate/Modal.tsx
23987
- import { useCallback as useCallback14 } from "react";
23988
- import { useNavigate as useNavigate14 } from "react-router-dom";
24085
+ import { useCallback as useCallback17 } from "react";
24086
+ import { useNavigate as useNavigate15 } from "react-router-dom";
23989
24087
  import { ArrowBackFilled } from "@livechat/design-system-icons";
23990
24088
  import {
23991
24089
  Button as Button29,
@@ -23996,7 +24094,7 @@ import {
23996
24094
  ModalHeader as ModalHeader5,
23997
24095
  RadiusToken as RadiusToken19,
23998
24096
  SpacingToken as SpacingToken37,
23999
- Tag as Tag2,
24097
+ Tag as Tag3,
24000
24098
  Text as Text19
24001
24099
  } from "@livechat/design-system-react-components";
24002
24100
  import {
@@ -24092,7 +24190,7 @@ function WorkflowTemplatePreviewModal({
24092
24190
  template,
24093
24191
  onClose
24094
24192
  }) {
24095
- const navigate = useNavigate14();
24193
+ const navigate = useNavigate15();
24096
24194
  const {
24097
24195
  save,
24098
24196
  state: {
@@ -24103,7 +24201,7 @@ function WorkflowTemplatePreviewModal({
24103
24201
  const amplitudeWorkflowsJourney = workflowsBlockAmplitudeJourneyFactory(
24104
24202
  user == null ? void 0 : user.meta.email
24105
24203
  );
24106
- const handleClose = useCallback14(
24204
+ const handleClose = useCallback17(
24107
24205
  (target) => {
24108
24206
  if (onClose) {
24109
24207
  onClose();
@@ -24122,7 +24220,7 @@ function WorkflowTemplatePreviewModal({
24122
24220
  return products.map((product, i) => {
24123
24221
  const icon2 = templateIcons[i];
24124
24222
  return /* @__PURE__ */ jsx4(
24125
- Tag2,
24223
+ Tag3,
24126
24224
  {
24127
24225
  leftNode: /* @__PURE__ */ jsx4(ProductIcon_default, { height: 4, product: icon2, width: 4 }),
24128
24226
  size: "small",
@@ -24249,8 +24347,8 @@ function WorkflowTemplatePreview({
24249
24347
  workflow,
24250
24348
  onClose
24251
24349
  }) {
24252
- const flowTemplates = useMemo8(() => getWorkflowTemplates(), []);
24253
- const params = useParams5();
24350
+ const flowTemplates = useMemo9(() => getWorkflowTemplates(), []);
24351
+ const params = useParams6();
24254
24352
  const template = flowTemplates.find((t) => t.id === params.template);
24255
24353
  const targetWorkflow = workflow || (template == null ? void 0 : template.workflow);
24256
24354
  if (!template) {
@@ -24281,12 +24379,12 @@ function WorkflowTemplatePreview({
24281
24379
  var PreviewTemplate_default = WorkflowTemplatePreview;
24282
24380
 
24283
24381
  // src/views/Workflows/List/Modals/Create/Modal.tsx
24284
- import { useCallback as useCallback17 } from "react";
24285
- import { useNavigate as useNavigate17 } from "react-router-dom";
24382
+ import { useCallback as useCallback20 } from "react";
24383
+ import { useNavigate as useNavigate18 } from "react-router-dom";
24286
24384
  import { Modal as Modal9, ModalHeader as ModalHeader6 } from "@livechat/design-system-react-components";
24287
24385
 
24288
24386
  // src/views/Workflows/List/Home/Home.tsx
24289
- import { useMemo as useMemo9, useState as useState31 } from "react";
24387
+ import { useMemo as useMemo10, useState as useState31 } from "react";
24290
24388
  import { FiletypeOther, OneColored } from "@livechat/design-system-icons";
24291
24389
  import {
24292
24390
  DesignToken as DesignToken43,
@@ -24296,7 +24394,7 @@ import {
24296
24394
  import { Column as Column17, Intro as Intro3, Row as Row24 } from "@livechat/developer-studio-ui-react";
24297
24395
 
24298
24396
  // src/views/Workflows/List/Modals/TemplateList/Filters/Category.tsx
24299
- import { useCallback as useCallback15, useState as useState29 } from "react";
24397
+ import { useCallback as useCallback18, useState as useState29 } from "react";
24300
24398
  import {
24301
24399
  ChatDots as ChatDots2,
24302
24400
  CurrencyDollar as CurrencyDollar2,
@@ -24319,7 +24417,7 @@ function WorkflowTemplatesCategoryFilter({
24319
24417
  }) {
24320
24418
  var _a;
24321
24419
  const [isVisible, setIsVisible] = useState29(false);
24322
- const getItem = useCallback15(
24420
+ const getItem = useCallback18(
24323
24421
  (key, category, icon2) => ({
24324
24422
  key,
24325
24423
  element: /* @__PURE__ */ jsxs2(Row20, { gap: `var(${SpacingToken38.Spacing1});`, notPadded: true, children: [
@@ -24374,7 +24472,7 @@ function WorkflowTemplatesCategoryFilter({
24374
24472
  var Category_default = WorkflowTemplatesCategoryFilter;
24375
24473
 
24376
24474
  // src/views/Workflows/List/Modals/TemplateList/Filters/Product.tsx
24377
- import { useCallback as useCallback16, useState as useState30 } from "react";
24475
+ import { useCallback as useCallback19, useState as useState30 } from "react";
24378
24476
  import {
24379
24477
  Chatgpt,
24380
24478
  HelpDeskColored,
@@ -24397,7 +24495,7 @@ function WorkflowTemplatesProductFilter({
24397
24495
  }) {
24398
24496
  var _a;
24399
24497
  const [isVisible, setIsVisible] = useState30(false);
24400
- const getItem = useCallback16(
24498
+ const getItem = useCallback19(
24401
24499
  (key, product, icon2) => ({
24402
24500
  key,
24403
24501
  element: /* @__PURE__ */ jsxs2(Row21, { gap: `var(${SpacingToken39.Spacing1});`, notPadded: true, children: [
@@ -24454,7 +24552,7 @@ function WorkflowTemplatesProductFilter({
24454
24552
  var Product_default = WorkflowTemplatesProductFilter;
24455
24553
 
24456
24554
  // src/views/Workflows/List/Home/Cards/Scratch.tsx
24457
- import { useNavigate as useNavigate15 } from "react-router-dom";
24555
+ import { useNavigate as useNavigate16 } from "react-router-dom";
24458
24556
  import {
24459
24557
  Heading as Heading6,
24460
24558
  Icon as Icon36,
@@ -24471,7 +24569,7 @@ function WorkflowScratchCard({
24471
24569
  icon: icon2,
24472
24570
  openOne
24473
24571
  }) {
24474
- const navigate = useNavigate15();
24572
+ const navigate = useNavigate16();
24475
24573
  const { user } = useUserContext10();
24476
24574
  const amplitudeWorkflowsJourney = workflowsBlockAmplitudeJourneyFactory(
24477
24575
  user == null ? void 0 : user.meta.email
@@ -24503,7 +24601,7 @@ function WorkflowScratchCard({
24503
24601
  var Scratch_default = WorkflowScratchCard;
24504
24602
 
24505
24603
  // src/views/Workflows/List/Home/Cards/Template.tsx
24506
- import { useNavigate as useNavigate16 } from "react-router-dom";
24604
+ import { useNavigate as useNavigate17 } from "react-router-dom";
24507
24605
  import {
24508
24606
  DesignToken as DesignToken42,
24509
24607
  Heading as Heading7,
@@ -24525,7 +24623,7 @@ function WorkflowTemplateCard({
24525
24623
  icons,
24526
24624
  category
24527
24625
  }) {
24528
- const navigate = useNavigate16();
24626
+ const navigate = useNavigate17();
24529
24627
  return /* @__PURE__ */ jsx4(
24530
24628
  Card3,
24531
24629
  {
@@ -24571,7 +24669,7 @@ var Grid = newStyled.div`
24571
24669
  function WorkflowsHome({ isOnModal }) {
24572
24670
  const [product, setProduct] = useState31("All");
24573
24671
  const [category, setCategory] = useState31("All");
24574
- const flowTemplates = useMemo9(() => getWorkflowTemplates(), []);
24672
+ const flowTemplates = useMemo10(() => getWorkflowTemplates(), []);
24575
24673
  const filters = [
24576
24674
  (template) => product === "All" || template.products.includes(product),
24577
24675
  (template) => category === "All" || template.category.includes(category)
@@ -24673,8 +24771,8 @@ var Home_default = WorkflowsHome;
24673
24771
 
24674
24772
  // src/views/Workflows/List/Modals/Create/Modal.tsx
24675
24773
  function WorkflowCreateModal({ onClose }) {
24676
- const navigate = useNavigate17();
24677
- const handleClose = useCallback17(() => {
24774
+ const navigate = useNavigate18();
24775
+ const handleClose = useCallback20(() => {
24678
24776
  if (onClose) {
24679
24777
  onClose();
24680
24778
  return;
@@ -24708,7 +24806,7 @@ var Create_default = WorkflowCreate;
24708
24806
 
24709
24807
  // src/views/Workflows/List/View.tsx
24710
24808
  import { useState as useState33 } from "react";
24711
- import { useNavigate as useNavigate20 } from "react-router-dom";
24809
+ import { useNavigate as useNavigate21 } from "react-router-dom";
24712
24810
  import {
24713
24811
  Button as Button35,
24714
24812
  DesignToken as DesignToken46,
@@ -24724,8 +24822,8 @@ import {
24724
24822
  } from "@livechat/developer-studio-ui-react";
24725
24823
 
24726
24824
  // src/views/Workflows/Creator/LiveChatNavbar.tsx
24727
- import { useCallback as useCallback18 } from "react";
24728
- import { useNavigate as useNavigate18 } from "react-router-dom";
24825
+ import { useCallback as useCallback21 } from "react";
24826
+ import { useNavigate as useNavigate19 } from "react-router-dom";
24729
24827
  import { LayoutSidebarLeft } from "@livechat/design-system-icons";
24730
24828
  import {
24731
24829
  Button as Button32,
@@ -24749,12 +24847,12 @@ var wrapperCss = (hasData) => css`
24749
24847
  }`}
24750
24848
  `;
24751
24849
  function LiveChatNavbar() {
24752
- const navigate = useNavigate18();
24850
+ const navigate = useNavigate19();
24753
24851
  const workflows = useFetchWorkflows({});
24754
24852
  const isLoading = workflows.isLoading;
24755
24853
  const hasNoData = workflows.isSuccess && workflows.data.length === 0;
24756
24854
  const hasData = !isLoading && !hasNoData;
24757
- const handleClick = useCallback18(() => {
24855
+ const handleClick = useCallback21(() => {
24758
24856
  sendMessage("toggleSideNav" /* ToggleSideNav */);
24759
24857
  }, []);
24760
24858
  return /* @__PURE__ */ jsxs2("div", { css: wrapperCss(hasData), children: [
@@ -24856,7 +24954,7 @@ function WorkflowStatusFilter({
24856
24954
  var StatusFilter_default = WorkflowStatusFilter;
24857
24955
 
24858
24956
  // src/views/Workflows/List/Grid/Table.tsx
24859
- import { useNavigate as useNavigate19 } from "react-router-dom";
24957
+ import { useNavigate as useNavigate20 } from "react-router-dom";
24860
24958
  import {
24861
24959
  Delete as Delete3,
24862
24960
  Info as Info2,
@@ -24871,7 +24969,7 @@ import {
24871
24969
  Icon as Icon39,
24872
24970
  SpacingToken as SpacingToken44,
24873
24971
  Switch as Switch2,
24874
- Tag as Tag3,
24972
+ Tag as Tag4,
24875
24973
  Text as Text21,
24876
24974
  Tooltip as Tooltip9
24877
24975
  } from "@livechat/design-system-react-components";
@@ -24886,7 +24984,7 @@ import {
24886
24984
  } from "@livechat/developer-studio-ui-react";
24887
24985
  function WorkflowsTable({ workflowsQuery, state }) {
24888
24986
  var _a, _b, _c;
24889
- const navigate = useNavigate19();
24987
+ const navigate = useNavigate20();
24890
24988
  const notifications = useNotificationContext5();
24891
24989
  const deleteAction = useDeleteWorkflow();
24892
24990
  const activateWorkflowAction = useActivateWorkflow();
@@ -24934,7 +25032,7 @@ function WorkflowsTable({ workflowsQuery, state }) {
24934
25032
  /* @__PURE__ */ jsx4("td", { width: "45%", children: /* @__PURE__ */ jsxs2(Row25, { gap: `var(${SpacingToken44.Spacing2})`, noWrap: true, notPadded: true, children: [
24935
25033
  /* @__PURE__ */ jsx4(Text21, { noMargin: true, size: "sm", children: workflow.name }),
24936
25034
  workflow.related_workflow_id ? /* @__PURE__ */ jsx4(
24937
- Tag3,
25035
+ Tag4,
24938
25036
  {
24939
25037
  css: css`
24940
25038
  color: #68afff;
@@ -25130,7 +25228,7 @@ var markedStyles = css`
25130
25228
  `;
25131
25229
  function WorkflowListView() {
25132
25230
  var _a;
25133
- const navigate = useNavigate20();
25231
+ const navigate = useNavigate21();
25134
25232
  const [state, setState] = useState33({
25135
25233
  filters: {
25136
25234
  status: "All",
@@ -25220,9 +25318,9 @@ var List_default2 = WorkflowList;
25220
25318
  // src/views/Workflows/index.tsx
25221
25319
  import { jsx as jsx16, jsxs as jsxs9 } from "react/jsx-runtime";
25222
25320
  function Workflows() {
25223
- const navigate = useNavigate21();
25321
+ const navigate = useNavigate22();
25224
25322
  const { userHasInstalledWorkflows, isWorkflowAppLoading } = useFetchUserInstalledWorkflows();
25225
- useEffect20(() => {
25323
+ useEffect21(() => {
25226
25324
  if (isWorkflowAppLoading) {
25227
25325
  return;
25228
25326
  }
@@ -25298,6 +25396,7 @@ function WorkflowsModule({ waitlistImage }) {
25298
25396
  }
25299
25397
  export {
25300
25398
  LoginError_default as LoginError,
25399
+ WORKFLOWS_TEST_SELECTORS,
25301
25400
  WorkflowsModule,
25302
25401
  config,
25303
25402
  getWorkflowsEnv,