@bigbinary/neeto-rules-frontend 0.2.4 → 0.3.0

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.js CHANGED
@@ -4,7 +4,7 @@ import React, { Component, useContext, useState, useRef, useEffect, useMemo, mem
4
4
  import { useFormikContext, FieldArray, Formik, Form, useField, ErrorMessage } from 'formik';
5
5
  import Scrollable from 'neetomolecules/Scrollable';
6
6
  import { MultiEmailInput, Input as Input$2, Textarea, ActionBlock, Select as Select$1, Radio } from '@bigbinary/neetoui/formik';
7
- import { Search, Check, Plus, Delete, Eye, Close, Refresh } from '@bigbinary/neeto-icons';
7
+ import { Search, Check, Plus, Delete, Eye, Down, Up, Close, Refresh } from '@bigbinary/neeto-icons';
8
8
  import { Dropdown as Dropdown$2, Typography, Input as Input$1, Checkbox, Pane, Button, DatePicker, Select, Label } from '@bigbinary/neetoui';
9
9
  import classNames from 'classnames';
10
10
  import { isNotEmpty, findBy, toLabelAndValue, noop as noop$2, removeBy } from '@bigbinary/neeto-commons-frontend/pure';
@@ -13,6 +13,7 @@ import * as dayjs from 'dayjs';
13
13
  import dayjs__default from 'dayjs';
14
14
  import { FormikEditor, isEditorEmpty } from '@bigbinary/neeto-editor';
15
15
  import * as yup from 'yup';
16
+ import PageLoader from 'neetomolecules/PageLoader';
16
17
  import { joinHyphenCase } from '@bigbinary/neeto-commons-frontend/utils';
17
18
  import { useDebounce, useHotKeys } from '@bigbinary/neeto-commons-frontend/react-utils';
18
19
 
@@ -5771,7 +5772,9 @@ var common$1 = {
5771
5772
  or: "or",
5772
5773
  search: "Search",
5773
5774
  as: "as",
5774
- "delete": "Delete"
5775
+ "delete": "Delete",
5776
+ viewMore: "View more",
5777
+ viewLess: "View less"
5775
5778
  };
5776
5779
  var form = {
5777
5780
  noEvents: "A rule without events will run hourly.",
@@ -5871,7 +5874,8 @@ var labels = {
5871
5874
  unassigned: "Unassigned",
5872
5875
  checked: "Checked",
5873
5876
  unchecked: "Unchecked",
5874
- text: "Text"
5877
+ text: "Text",
5878
+ ruleSummary: "Automation rule summary"
5875
5879
  };
5876
5880
  var placeholders$1 = {
5877
5881
  "if": "If",
@@ -5939,8 +5943,8 @@ var conditionVerbs = {
5939
5943
  anyTime: "Any time",
5940
5944
  during: "During",
5941
5945
  notDuring: "Not during",
5942
- anyOf: "Any of",
5943
- noneOf: "None of",
5946
+ anyOf: "Is",
5947
+ noneOf: "Is not",
5944
5948
  isBefore: "Is before",
5945
5949
  isAfter: "Is After"
5946
5950
  };
@@ -15717,7 +15721,7 @@ function cov_1l1zuel3qt() {
15717
15721
  }
15718
15722
  cov_1l1zuel3qt();
15719
15723
  cov_1l1zuel3qt().s[0]++;
15720
- var Title = function Title(_ref) {
15724
+ var Title$1 = function Title(_ref) {
15721
15725
  var title = _ref.title,
15722
15726
  children = _ref.children;
15723
15727
  cov_1l1zuel3qt().f[0]++;
@@ -16559,7 +16563,7 @@ var Actions$1 = function Actions(_ref) {
16559
16563
  setScrollToBottom(true);
16560
16564
  };
16561
16565
  cov_3lq6cjh4u().s[18]++;
16562
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Title, {
16566
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Title$1, {
16563
16567
  title: t("common.actions")
16564
16568
  }, /*#__PURE__*/React.createElement(FieldArray, {
16565
16569
  name: "actions",
@@ -26519,7 +26523,7 @@ var Conditions$1 = function Conditions(_ref2) {
26519
26523
  return index ? (cov_2otqdci4wd().b[4][0]++, t("placeholders.if").toLowerCase()) : (cov_2otqdci4wd().b[4][1]++, t("placeholders.if"));
26520
26524
  };
26521
26525
  cov_2otqdci4wd().s[22]++;
26522
- return /*#__PURE__*/React.createElement(Title, {
26526
+ return /*#__PURE__*/React.createElement(Title$1, {
26523
26527
  title: t("common.conditions")
26524
26528
  }, /*#__PURE__*/React.createElement(FieldArray, {
26525
26529
  name: "conditions",
@@ -31357,7 +31361,7 @@ var Events$2 = function Events() {
31357
31361
  arrayHelper.remove(index);
31358
31362
  };
31359
31363
  cov_dprwv7svz().s[12]++;
31360
- return /*#__PURE__*/React.createElement(Title, {
31364
+ return /*#__PURE__*/React.createElement(Title$1, {
31361
31365
  title: t("common.events")
31362
31366
  }, /*#__PURE__*/React.createElement(FieldArray, {
31363
31367
  name: "events",
@@ -33895,6 +33899,2886 @@ var NeetoRules$2 = function NeetoRules(_ref) {
33895
33899
  return /*#__PURE__*/React.createElement(BrowserRouter, null, /*#__PURE__*/React.createElement(Main, rest));
33896
33900
  };
33897
33901
 
33902
+ function cov_13jp1hsz0e() {
33903
+ var path = "/home/runner/work/neeto-rules-frontend/neeto-rules-frontend/src/components/RulePreview/Card.jsx";
33904
+ var hash = "060ed8cb86ad2890593771245657ef35803f1a4f";
33905
+ var global = new Function("return this")();
33906
+ var gcv = "__coverage__";
33907
+ var coverageData = {
33908
+ path: "/home/runner/work/neeto-rules-frontend/neeto-rules-frontend/src/components/RulePreview/Card.jsx",
33909
+ statementMap: {
33910
+ "0": {
33911
+ start: {
33912
+ line: 6,
33913
+ column: 14
33914
+ },
33915
+ end: {
33916
+ line: 15,
33917
+ column: 1
33918
+ }
33919
+ },
33920
+ "1": {
33921
+ start: {
33922
+ line: 7,
33923
+ column: 2
33924
+ },
33925
+ end: {
33926
+ line: 14,
33927
+ column: 5
33928
+ }
33929
+ },
33930
+ "2": {
33931
+ start: {
33932
+ line: 17,
33933
+ column: 0
33934
+ },
33935
+ end: {
33936
+ line: 20,
33937
+ column: 2
33938
+ }
33939
+ }
33940
+ },
33941
+ fnMap: {
33942
+ "0": {
33943
+ name: "(anonymous_0)",
33944
+ decl: {
33945
+ start: {
33946
+ line: 6,
33947
+ column: 14
33948
+ },
33949
+ end: {
33950
+ line: 6,
33951
+ column: 15
33952
+ }
33953
+ },
33954
+ loc: {
33955
+ start: {
33956
+ line: 7,
33957
+ column: 2
33958
+ },
33959
+ end: {
33960
+ line: 14,
33961
+ column: 5
33962
+ }
33963
+ },
33964
+ line: 7
33965
+ }
33966
+ },
33967
+ branchMap: {},
33968
+ s: {
33969
+ "0": 0,
33970
+ "1": 0,
33971
+ "2": 0
33972
+ },
33973
+ f: {
33974
+ "0": 0
33975
+ },
33976
+ b: {},
33977
+ _coverageSchema: "1a1c01bbd47fc00a2c39e90264f33305004495a9",
33978
+ hash: "060ed8cb86ad2890593771245657ef35803f1a4f"
33979
+ };
33980
+ var coverage = global[gcv] || (global[gcv] = {});
33981
+ if (!coverage[path] || coverage[path].hash !== hash) {
33982
+ coverage[path] = coverageData;
33983
+ }
33984
+ var actualCoverage = coverage[path];
33985
+ {
33986
+ // @ts-ignore
33987
+ cov_13jp1hsz0e = function () {
33988
+ return actualCoverage;
33989
+ };
33990
+ }
33991
+ return actualCoverage;
33992
+ }
33993
+ cov_13jp1hsz0e();
33994
+ cov_13jp1hsz0e().s[0]++;
33995
+ var Title = function Title(_ref) {
33996
+ var title = _ref.title,
33997
+ children = _ref.children;
33998
+ cov_13jp1hsz0e().f[0]++;
33999
+ cov_13jp1hsz0e().s[1]++;
34000
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Typography, {
34001
+ className: "neeto-ui-text-gray-800",
34002
+ style: "h5",
34003
+ weight: "semibold"
34004
+ }, title), /*#__PURE__*/React.createElement("div", {
34005
+ className: "neeto-ui-bg-gray-100 neeto-ui-rounded-sm my-3 p-4"
34006
+ }, children));
34007
+ };
34008
+ cov_13jp1hsz0e().s[2]++;
34009
+
34010
+ function cov_1yo87bzjl0() {
34011
+ var path = "/home/runner/work/neeto-rules-frontend/neeto-rules-frontend/src/components/RulePreview/MultiSelectValues.jsx";
34012
+ var hash = "ebc82c77b82c7a6b1fe37565159b52052ceca263";
34013
+ var global = new Function("return this")();
34014
+ var gcv = "__coverage__";
34015
+ var coverageData = {
34016
+ path: "/home/runner/work/neeto-rules-frontend/neeto-rules-frontend/src/components/RulePreview/MultiSelectValues.jsx",
34017
+ statementMap: {
34018
+ "0": {
34019
+ start: {
34020
+ line: 5,
34021
+ column: 26
34022
+ },
34023
+ end: {
34024
+ line: 28,
34025
+ column: 1
34026
+ }
34027
+ },
34028
+ "1": {
34029
+ start: {
34030
+ line: 6,
34031
+ column: 2
34032
+ },
34033
+ end: {
34034
+ line: 27,
34035
+ column: 5
34036
+ }
34037
+ },
34038
+ "2": {
34039
+ start: {
34040
+ line: 8,
34041
+ column: 6
34042
+ },
34043
+ end: {
34044
+ line: 25,
34045
+ column: 23
34046
+ }
34047
+ }
34048
+ },
34049
+ fnMap: {
34050
+ "0": {
34051
+ name: "(anonymous_0)",
34052
+ decl: {
34053
+ start: {
34054
+ line: 5,
34055
+ column: 26
34056
+ },
34057
+ end: {
34058
+ line: 5,
34059
+ column: 27
34060
+ }
34061
+ },
34062
+ loc: {
34063
+ start: {
34064
+ line: 6,
34065
+ column: 2
34066
+ },
34067
+ end: {
34068
+ line: 27,
34069
+ column: 5
34070
+ }
34071
+ },
34072
+ line: 6
34073
+ },
34074
+ "1": {
34075
+ name: "(anonymous_1)",
34076
+ decl: {
34077
+ start: {
34078
+ line: 7,
34079
+ column: 17
34080
+ },
34081
+ end: {
34082
+ line: 7,
34083
+ column: 18
34084
+ }
34085
+ },
34086
+ loc: {
34087
+ start: {
34088
+ line: 8,
34089
+ column: 6
34090
+ },
34091
+ end: {
34092
+ line: 25,
34093
+ column: 23
34094
+ }
34095
+ },
34096
+ line: 8
34097
+ }
34098
+ },
34099
+ branchMap: {
34100
+ "0": {
34101
+ loc: {
34102
+ start: {
34103
+ line: 9,
34104
+ column: 9
34105
+ },
34106
+ end: {
34107
+ line: 17,
34108
+ column: 9
34109
+ }
34110
+ },
34111
+ type: "binary-expr",
34112
+ locations: [{
34113
+ start: {
34114
+ line: 9,
34115
+ column: 9
34116
+ },
34117
+ end: {
34118
+ line: 9,
34119
+ column: 14
34120
+ }
34121
+ }, {
34122
+ start: {
34123
+ line: 10,
34124
+ column: 10
34125
+ },
34126
+ end: {
34127
+ line: 16,
34128
+ column: 23
34129
+ }
34130
+ }],
34131
+ line: 9
34132
+ }
34133
+ },
34134
+ s: {
34135
+ "0": 0,
34136
+ "1": 0,
34137
+ "2": 0
34138
+ },
34139
+ f: {
34140
+ "0": 0,
34141
+ "1": 0
34142
+ },
34143
+ b: {
34144
+ "0": [0, 0]
34145
+ },
34146
+ _coverageSchema: "1a1c01bbd47fc00a2c39e90264f33305004495a9",
34147
+ hash: "ebc82c77b82c7a6b1fe37565159b52052ceca263"
34148
+ };
34149
+ var coverage = global[gcv] || (global[gcv] = {});
34150
+ if (!coverage[path] || coverage[path].hash !== hash) {
34151
+ coverage[path] = coverageData;
34152
+ }
34153
+ var actualCoverage = coverage[path];
34154
+ {
34155
+ // @ts-ignore
34156
+ cov_1yo87bzjl0 = function () {
34157
+ return actualCoverage;
34158
+ };
34159
+ }
34160
+ return actualCoverage;
34161
+ }
34162
+ cov_1yo87bzjl0();
34163
+ cov_1yo87bzjl0().s[0]++;
34164
+ var MultiSelectValues = function MultiSelectValues(_ref) {
34165
+ var separator = _ref.separator,
34166
+ values = _ref.values;
34167
+ cov_1yo87bzjl0().f[0]++;
34168
+ cov_1yo87bzjl0().s[1]++;
34169
+ return /*#__PURE__*/React.createElement(React.Fragment, null, values === null || values === void 0 ? void 0 : values.map(function (value, idx) {
34170
+ cov_1yo87bzjl0().f[1]++;
34171
+ cov_1yo87bzjl0().s[2]++;
34172
+ return /*#__PURE__*/React.createElement(React.Fragment, {
34173
+ key: idx
34174
+ }, (cov_1yo87bzjl0().b[0][0]++, !!idx) && (cov_1yo87bzjl0().b[0][1]++, /*#__PURE__*/React.createElement(Typography, {
34175
+ className: "neeto-ui-text-gray-700",
34176
+ style: "h5",
34177
+ weight: "normal"
34178
+ }, separator)), /*#__PURE__*/React.createElement(Typography, {
34179
+ className: "neeto-ui-text-gray-800",
34180
+ style: "h5",
34181
+ weight: "semibold"
34182
+ }, value.toLowerCase()));
34183
+ }));
34184
+ };
34185
+
34186
+ function cov_l89oqcaez() {
34187
+ var path = "/home/runner/work/neeto-rules-frontend/neeto-rules-frontend/src/components/RulePreview/utils.js";
34188
+ var hash = "67d71dfe37d2327777bd145bf79ff7779c4b115d";
34189
+ var global = new Function("return this")();
34190
+ var gcv = "__coverage__";
34191
+ var coverageData = {
34192
+ path: "/home/runner/work/neeto-rules-frontend/neeto-rules-frontend/src/components/RulePreview/utils.js",
34193
+ statementMap: {
34194
+ "0": {
34195
+ start: {
34196
+ line: 3,
34197
+ column: 37
34198
+ },
34199
+ end: {
34200
+ line: 7,
34201
+ column: 25
34202
+ }
34203
+ },
34204
+ "1": {
34205
+ start: {
34206
+ line: 4,
34207
+ column: 2
34208
+ },
34209
+ end: {
34210
+ line: 7,
34211
+ column: 25
34212
+ }
34213
+ }
34214
+ },
34215
+ fnMap: {
34216
+ "0": {
34217
+ name: "(anonymous_0)",
34218
+ decl: {
34219
+ start: {
34220
+ line: 3,
34221
+ column: 37
34222
+ },
34223
+ end: {
34224
+ line: 3,
34225
+ column: 38
34226
+ }
34227
+ },
34228
+ loc: {
34229
+ start: {
34230
+ line: 4,
34231
+ column: 2
34232
+ },
34233
+ end: {
34234
+ line: 7,
34235
+ column: 25
34236
+ }
34237
+ },
34238
+ line: 4
34239
+ }
34240
+ },
34241
+ branchMap: {},
34242
+ s: {
34243
+ "0": 0,
34244
+ "1": 0
34245
+ },
34246
+ f: {
34247
+ "0": 0
34248
+ },
34249
+ b: {},
34250
+ _coverageSchema: "1a1c01bbd47fc00a2c39e90264f33305004495a9",
34251
+ hash: "67d71dfe37d2327777bd145bf79ff7779c4b115d"
34252
+ };
34253
+ var coverage = global[gcv] || (global[gcv] = {});
34254
+ if (!coverage[path] || coverage[path].hash !== hash) {
34255
+ coverage[path] = coverageData;
34256
+ }
34257
+ var actualCoverage = coverage[path];
34258
+ {
34259
+ // @ts-ignore
34260
+ cov_l89oqcaez = function () {
34261
+ return actualCoverage;
34262
+ };
34263
+ }
34264
+ return actualCoverage;
34265
+ }
34266
+ cov_l89oqcaez();
34267
+ cov_l89oqcaez().s[0]++;
34268
+ var getEntityDisplayValue = function getEntityDisplayValue(entitiy, entitiyOption) {
34269
+ var _findBy, _findBy$label;
34270
+ cov_l89oqcaez().f[0]++;
34271
+ cov_l89oqcaez().s[1]++;
34272
+ return (_findBy = findBy({
34273
+ value: entitiy.metadata.value
34274
+ }, entitiyOption.dropdownOptions)) === null || _findBy === void 0 ? void 0 : (_findBy$label = _findBy.label) === null || _findBy$label === void 0 ? void 0 : _findBy$label.toLowerCase();
34275
+ };
34276
+
34277
+ function cov_12s3p009b2() {
34278
+ var path = "/home/runner/work/neeto-rules-frontend/neeto-rules-frontend/src/components/RulePreview/ActionsDetail.jsx";
34279
+ var hash = "f649e2bb358ba3c6a0dec691b8f1c0f6ace29061";
34280
+ var global = new Function("return this")();
34281
+ var gcv = "__coverage__";
34282
+ var coverageData = {
34283
+ path: "/home/runner/work/neeto-rules-frontend/neeto-rules-frontend/src/components/RulePreview/ActionsDetail.jsx",
34284
+ statementMap: {
34285
+ "0": {
34286
+ start: {
34287
+ line: 13,
34288
+ column: 22
34289
+ },
34290
+ end: {
34291
+ line: 103,
34292
+ column: 1
34293
+ }
34294
+ },
34295
+ "1": {
34296
+ start: {
34297
+ line: 14,
34298
+ column: 34
34299
+ },
34300
+ end: {
34301
+ line: 14,
34302
+ column: 49
34303
+ }
34304
+ },
34305
+ "2": {
34306
+ start: {
34307
+ line: 15,
34308
+ column: 16
34309
+ },
34310
+ end: {
34311
+ line: 15,
34312
+ column: 32
34313
+ }
34314
+ },
34315
+ "3": {
34316
+ start: {
34317
+ line: 17,
34318
+ column: 22
34319
+ },
34320
+ end: {
34321
+ line: 17,
34322
+ column: 35
34323
+ }
34324
+ },
34325
+ "4": {
34326
+ start: {
34327
+ line: 19,
34328
+ column: 4
34329
+ },
34330
+ end: {
34331
+ line: 19,
34332
+ column: 78
34333
+ }
34334
+ },
34335
+ "5": {
34336
+ start: {
34337
+ line: 21,
34338
+ column: 19
34339
+ },
34340
+ end: {
34341
+ line: 24,
34342
+ column: 24
34343
+ }
34344
+ },
34345
+ "6": {
34346
+ start: {
34347
+ line: 22,
34348
+ column: 4
34349
+ },
34350
+ end: {
34351
+ line: 24,
34352
+ column: 24
34353
+ }
34354
+ },
34355
+ "7": {
34356
+ start: {
34357
+ line: 26,
34358
+ column: 29
34359
+ },
34360
+ end: {
34361
+ line: 56,
34362
+ column: 3
34363
+ }
34364
+ },
34365
+ "8": {
34366
+ start: {
34367
+ line: 27,
34368
+ column: 4
34369
+ },
34370
+ end: {
34371
+ line: 37,
34372
+ column: 5
34373
+ }
34374
+ },
34375
+ "9": {
34376
+ start: {
34377
+ line: 28,
34378
+ column: 6
34379
+ },
34380
+ end: {
34381
+ line: 36,
34382
+ column: 8
34383
+ }
34384
+ },
34385
+ "10": {
34386
+ start: {
34387
+ line: 39,
34388
+ column: 4
34389
+ },
34390
+ end: {
34391
+ line: 53,
34392
+ column: 5
34393
+ }
34394
+ },
34395
+ "11": {
34396
+ start: {
34397
+ line: 40,
34398
+ column: 21
34399
+ },
34400
+ end: {
34401
+ line: 45,
34402
+ column: 7
34403
+ }
34404
+ },
34405
+ "12": {
34406
+ start: {
34407
+ line: 43,
34408
+ column: 10
34409
+ },
34410
+ end: {
34411
+ line: 43,
34412
+ column: 47
34413
+ }
34414
+ },
34415
+ "13": {
34416
+ start: {
34417
+ line: 47,
34418
+ column: 6
34419
+ },
34420
+ end: {
34421
+ line: 52,
34422
+ column: 8
34423
+ }
34424
+ },
34425
+ "14": {
34426
+ start: {
34427
+ line: 55,
34428
+ column: 4
34429
+ },
34430
+ end: {
34431
+ line: 55,
34432
+ column: 16
34433
+ }
34434
+ },
34435
+ "15": {
34436
+ start: {
34437
+ line: 58,
34438
+ column: 23
34439
+ },
34440
+ end: {
34441
+ line: 74,
34442
+ column: 3
34443
+ }
34444
+ },
34445
+ "16": {
34446
+ start: {
34447
+ line: 59,
34448
+ column: 25
34449
+ },
34450
+ end: {
34451
+ line: 59,
34452
+ column: 78
34453
+ }
34454
+ },
34455
+ "17": {
34456
+ start: {
34457
+ line: 60,
34458
+ column: 4
34459
+ },
34460
+ end: {
34461
+ line: 60,
34462
+ column: 35
34463
+ }
34464
+ },
34465
+ "18": {
34466
+ start: {
34467
+ line: 60,
34468
+ column: 23
34469
+ },
34470
+ end: {
34471
+ line: 60,
34472
+ column: 35
34473
+ }
34474
+ },
34475
+ "19": {
34476
+ start: {
34477
+ line: 62,
34478
+ column: 4
34479
+ },
34480
+ end: {
34481
+ line: 73,
34482
+ column: 6
34483
+ }
34484
+ },
34485
+ "20": {
34486
+ start: {
34487
+ line: 76,
34488
+ column: 2
34489
+ },
34490
+ end: {
34491
+ line: 102,
34492
+ column: 4
34493
+ }
34494
+ },
34495
+ "21": {
34496
+ start: {
34497
+ line: 79,
34498
+ column: 8
34499
+ },
34500
+ end: {
34501
+ line: 88,
34502
+ column: 14
34503
+ }
34504
+ },
34505
+ "22": {
34506
+ start: {
34507
+ line: 97,
34508
+ column: 27
34509
+ },
34510
+ end: {
34511
+ line: 97,
34512
+ column: 63
34513
+ }
34514
+ },
34515
+ "23": {
34516
+ start: {
34517
+ line: 97,
34518
+ column: 52
34519
+ },
34520
+ end: {
34521
+ line: 97,
34522
+ column: 62
34523
+ }
34524
+ }
34525
+ },
34526
+ fnMap: {
34527
+ "0": {
34528
+ name: "(anonymous_0)",
34529
+ decl: {
34530
+ start: {
34531
+ line: 13,
34532
+ column: 22
34533
+ },
34534
+ end: {
34535
+ line: 13,
34536
+ column: 23
34537
+ }
34538
+ },
34539
+ loc: {
34540
+ start: {
34541
+ line: 13,
34542
+ column: 39
34543
+ },
34544
+ end: {
34545
+ line: 103,
34546
+ column: 1
34547
+ }
34548
+ },
34549
+ line: 13
34550
+ },
34551
+ "1": {
34552
+ name: "(anonymous_1)",
34553
+ decl: {
34554
+ start: {
34555
+ line: 21,
34556
+ column: 19
34557
+ },
34558
+ end: {
34559
+ line: 21,
34560
+ column: 20
34561
+ }
34562
+ },
34563
+ loc: {
34564
+ start: {
34565
+ line: 22,
34566
+ column: 4
34567
+ },
34568
+ end: {
34569
+ line: 24,
34570
+ column: 24
34571
+ }
34572
+ },
34573
+ line: 22
34574
+ },
34575
+ "2": {
34576
+ name: "(anonymous_2)",
34577
+ decl: {
34578
+ start: {
34579
+ line: 26,
34580
+ column: 29
34581
+ },
34582
+ end: {
34583
+ line: 26,
34584
+ column: 30
34585
+ }
34586
+ },
34587
+ loc: {
34588
+ start: {
34589
+ line: 26,
34590
+ column: 55
34591
+ },
34592
+ end: {
34593
+ line: 56,
34594
+ column: 3
34595
+ }
34596
+ },
34597
+ line: 26
34598
+ },
34599
+ "3": {
34600
+ name: "(anonymous_3)",
34601
+ decl: {
34602
+ start: {
34603
+ line: 42,
34604
+ column: 44
34605
+ },
34606
+ end: {
34607
+ line: 42,
34608
+ column: 45
34609
+ }
34610
+ },
34611
+ loc: {
34612
+ start: {
34613
+ line: 43,
34614
+ column: 10
34615
+ },
34616
+ end: {
34617
+ line: 43,
34618
+ column: 47
34619
+ }
34620
+ },
34621
+ line: 43
34622
+ },
34623
+ "4": {
34624
+ name: "(anonymous_4)",
34625
+ decl: {
34626
+ start: {
34627
+ line: 58,
34628
+ column: 23
34629
+ },
34630
+ end: {
34631
+ line: 58,
34632
+ column: 24
34633
+ }
34634
+ },
34635
+ loc: {
34636
+ start: {
34637
+ line: 58,
34638
+ column: 33
34639
+ },
34640
+ end: {
34641
+ line: 74,
34642
+ column: 3
34643
+ }
34644
+ },
34645
+ line: 58
34646
+ },
34647
+ "5": {
34648
+ name: "(anonymous_5)",
34649
+ decl: {
34650
+ start: {
34651
+ line: 78,
34652
+ column: 22
34653
+ },
34654
+ end: {
34655
+ line: 78,
34656
+ column: 23
34657
+ }
34658
+ },
34659
+ loc: {
34660
+ start: {
34661
+ line: 79,
34662
+ column: 8
34663
+ },
34664
+ end: {
34665
+ line: 88,
34666
+ column: 14
34667
+ }
34668
+ },
34669
+ line: 79
34670
+ },
34671
+ "6": {
34672
+ name: "(anonymous_6)",
34673
+ decl: {
34674
+ start: {
34675
+ line: 97,
34676
+ column: 21
34677
+ },
34678
+ end: {
34679
+ line: 97,
34680
+ column: 22
34681
+ }
34682
+ },
34683
+ loc: {
34684
+ start: {
34685
+ line: 97,
34686
+ column: 27
34687
+ },
34688
+ end: {
34689
+ line: 97,
34690
+ column: 63
34691
+ }
34692
+ },
34693
+ line: 97
34694
+ },
34695
+ "7": {
34696
+ name: "(anonymous_7)",
34697
+ decl: {
34698
+ start: {
34699
+ line: 97,
34700
+ column: 39
34701
+ },
34702
+ end: {
34703
+ line: 97,
34704
+ column: 40
34705
+ }
34706
+ },
34707
+ loc: {
34708
+ start: {
34709
+ line: 97,
34710
+ column: 52
34711
+ },
34712
+ end: {
34713
+ line: 97,
34714
+ column: 62
34715
+ }
34716
+ },
34717
+ line: 97
34718
+ }
34719
+ },
34720
+ branchMap: {
34721
+ "0": {
34722
+ loc: {
34723
+ start: {
34724
+ line: 19,
34725
+ column: 4
34726
+ },
34727
+ end: {
34728
+ line: 19,
34729
+ column: 78
34730
+ }
34731
+ },
34732
+ type: "cond-expr",
34733
+ locations: [{
34734
+ start: {
34735
+ line: 19,
34736
+ column: 41
34737
+ },
34738
+ end: {
34739
+ line: 19,
34740
+ column: 52
34741
+ }
34742
+ }, {
34743
+ start: {
34744
+ line: 19,
34745
+ column: 55
34746
+ },
34747
+ end: {
34748
+ line: 19,
34749
+ column: 78
34750
+ }
34751
+ }],
34752
+ line: 19
34753
+ },
34754
+ "1": {
34755
+ loc: {
34756
+ start: {
34757
+ line: 19,
34758
+ column: 4
34759
+ },
34760
+ end: {
34761
+ line: 19,
34762
+ column: 38
34763
+ }
34764
+ },
34765
+ type: "binary-expr",
34766
+ locations: [{
34767
+ start: {
34768
+ line: 19,
34769
+ column: 4
34770
+ },
34771
+ end: {
34772
+ line: 19,
34773
+ column: 12
34774
+ }
34775
+ }, {
34776
+ start: {
34777
+ line: 19,
34778
+ column: 16
34779
+ },
34780
+ end: {
34781
+ line: 19,
34782
+ column: 38
34783
+ }
34784
+ }],
34785
+ line: 19
34786
+ },
34787
+ "2": {
34788
+ loc: {
34789
+ start: {
34790
+ line: 22,
34791
+ column: 4
34792
+ },
34793
+ end: {
34794
+ line: 24,
34795
+ column: 24
34796
+ }
34797
+ },
34798
+ type: "cond-expr",
34799
+ locations: [{
34800
+ start: {
34801
+ line: 23,
34802
+ column: 8
34803
+ },
34804
+ end: {
34805
+ line: 23,
34806
+ column: 65
34807
+ }
34808
+ }, {
34809
+ start: {
34810
+ line: 24,
34811
+ column: 8
34812
+ },
34813
+ end: {
34814
+ line: 24,
34815
+ column: 24
34816
+ }
34817
+ }],
34818
+ line: 22
34819
+ },
34820
+ "3": {
34821
+ loc: {
34822
+ start: {
34823
+ line: 27,
34824
+ column: 4
34825
+ },
34826
+ end: {
34827
+ line: 37,
34828
+ column: 5
34829
+ }
34830
+ },
34831
+ type: "if",
34832
+ locations: [{
34833
+ start: {
34834
+ line: 27,
34835
+ column: 4
34836
+ },
34837
+ end: {
34838
+ line: 37,
34839
+ column: 5
34840
+ }
34841
+ }, {
34842
+ start: {
34843
+ line: undefined,
34844
+ column: undefined
34845
+ },
34846
+ end: {
34847
+ line: undefined,
34848
+ column: undefined
34849
+ }
34850
+ }],
34851
+ line: 27
34852
+ },
34853
+ "4": {
34854
+ loc: {
34855
+ start: {
34856
+ line: 39,
34857
+ column: 4
34858
+ },
34859
+ end: {
34860
+ line: 53,
34861
+ column: 5
34862
+ }
34863
+ },
34864
+ type: "if",
34865
+ locations: [{
34866
+ start: {
34867
+ line: 39,
34868
+ column: 4
34869
+ },
34870
+ end: {
34871
+ line: 53,
34872
+ column: 5
34873
+ }
34874
+ }, {
34875
+ start: {
34876
+ line: undefined,
34877
+ column: undefined
34878
+ },
34879
+ end: {
34880
+ line: undefined,
34881
+ column: undefined
34882
+ }
34883
+ }],
34884
+ line: 39
34885
+ },
34886
+ "5": {
34887
+ loc: {
34888
+ start: {
34889
+ line: 60,
34890
+ column: 4
34891
+ },
34892
+ end: {
34893
+ line: 60,
34894
+ column: 35
34895
+ }
34896
+ },
34897
+ type: "if",
34898
+ locations: [{
34899
+ start: {
34900
+ line: 60,
34901
+ column: 4
34902
+ },
34903
+ end: {
34904
+ line: 60,
34905
+ column: 35
34906
+ }
34907
+ }, {
34908
+ start: {
34909
+ line: undefined,
34910
+ column: undefined
34911
+ },
34912
+ end: {
34913
+ line: undefined,
34914
+ column: undefined
34915
+ }
34916
+ }],
34917
+ line: 60
34918
+ },
34919
+ "6": {
34920
+ loc: {
34921
+ start: {
34922
+ line: 90,
34923
+ column: 7
34924
+ },
34925
+ end: {
34926
+ line: 100,
34927
+ column: 7
34928
+ }
34929
+ },
34930
+ type: "binary-expr",
34931
+ locations: [{
34932
+ start: {
34933
+ line: 90,
34934
+ column: 7
34935
+ },
34936
+ end: {
34937
+ line: 90,
34938
+ column: 29
34939
+ }
34940
+ }, {
34941
+ start: {
34942
+ line: 91,
34943
+ column: 8
34944
+ },
34945
+ end: {
34946
+ line: 99,
34947
+ column: 14
34948
+ }
34949
+ }],
34950
+ line: 90
34951
+ },
34952
+ "7": {
34953
+ loc: {
34954
+ start: {
34955
+ line: 93,
34956
+ column: 18
34957
+ },
34958
+ end: {
34959
+ line: 93,
34960
+ column: 39
34961
+ }
34962
+ },
34963
+ type: "cond-expr",
34964
+ locations: [{
34965
+ start: {
34966
+ line: 93,
34967
+ column: 30
34968
+ },
34969
+ end: {
34970
+ line: 93,
34971
+ column: 34
34972
+ }
34973
+ }, {
34974
+ start: {
34975
+ line: 93,
34976
+ column: 37
34977
+ },
34978
+ end: {
34979
+ line: 93,
34980
+ column: 39
34981
+ }
34982
+ }],
34983
+ line: 93
34984
+ },
34985
+ "8": {
34986
+ loc: {
34987
+ start: {
34988
+ line: 94,
34989
+ column: 19
34990
+ },
34991
+ end: {
34992
+ line: 94,
34993
+ column: 74
34994
+ }
34995
+ },
34996
+ type: "cond-expr",
34997
+ locations: [{
34998
+ start: {
34999
+ line: 94,
35000
+ column: 31
35001
+ },
35002
+ end: {
35003
+ line: 94,
35004
+ column: 51
35005
+ }
35006
+ }, {
35007
+ start: {
35008
+ line: 94,
35009
+ column: 54
35010
+ },
35011
+ end: {
35012
+ line: 94,
35013
+ column: 74
35014
+ }
35015
+ }],
35016
+ line: 94
35017
+ }
35018
+ },
35019
+ s: {
35020
+ "0": 0,
35021
+ "1": 0,
35022
+ "2": 0,
35023
+ "3": 0,
35024
+ "4": 0,
35025
+ "5": 0,
35026
+ "6": 0,
35027
+ "7": 0,
35028
+ "8": 0,
35029
+ "9": 0,
35030
+ "10": 0,
35031
+ "11": 0,
35032
+ "12": 0,
35033
+ "13": 0,
35034
+ "14": 0,
35035
+ "15": 0,
35036
+ "16": 0,
35037
+ "17": 0,
35038
+ "18": 0,
35039
+ "19": 0,
35040
+ "20": 0,
35041
+ "21": 0,
35042
+ "22": 0,
35043
+ "23": 0
35044
+ },
35045
+ f: {
35046
+ "0": 0,
35047
+ "1": 0,
35048
+ "2": 0,
35049
+ "3": 0,
35050
+ "4": 0,
35051
+ "5": 0,
35052
+ "6": 0,
35053
+ "7": 0
35054
+ },
35055
+ b: {
35056
+ "0": [0, 0],
35057
+ "1": [0, 0],
35058
+ "2": [0, 0],
35059
+ "3": [0, 0],
35060
+ "4": [0, 0],
35061
+ "5": [0, 0],
35062
+ "6": [0, 0],
35063
+ "7": [0, 0],
35064
+ "8": [0, 0]
35065
+ },
35066
+ _coverageSchema: "1a1c01bbd47fc00a2c39e90264f33305004495a9",
35067
+ hash: "f649e2bb358ba3c6a0dec691b8f1c0f6ace29061"
35068
+ };
35069
+ var coverage = global[gcv] || (global[gcv] = {});
35070
+ if (!coverage[path] || coverage[path].hash !== hash) {
35071
+ coverage[path] = coverageData;
35072
+ }
35073
+ var actualCoverage = coverage[path];
35074
+ {
35075
+ // @ts-ignore
35076
+ cov_12s3p009b2 = function () {
35077
+ return actualCoverage;
35078
+ };
35079
+ }
35080
+ return actualCoverage;
35081
+ }
35082
+ cov_12s3p009b2();
35083
+ cov_12s3p009b2().s[0]++;
35084
+ var ActionsDetail = function ActionsDetail(_ref) {
35085
+ var actions = _ref.actions;
35086
+ cov_12s3p009b2().f[0]++;
35087
+ var _ref2 = (cov_12s3p009b2().s[1]++, useState(false)),
35088
+ _ref3 = _slicedToArray(_ref2, 2),
35089
+ viewMore = _ref3[0],
35090
+ setViewMore = _ref3[1];
35091
+ var _ref4 = (cov_12s3p009b2().s[2]++, useTranslation()),
35092
+ t = _ref4.t;
35093
+ var actionsList = (cov_12s3p009b2().s[3]++, actions.value);
35094
+ var allActions = (cov_12s3p009b2().s[4]++, (cov_12s3p009b2().b[1][0]++, viewMore) && (cov_12s3p009b2().b[1][1]++, actionsList.length > 4) ? (cov_12s3p009b2().b[0][0]++, actionsList) : (cov_12s3p009b2().b[0][1]++, actionsList.slice(0, 4)));
35095
+ cov_12s3p009b2().s[5]++;
35096
+ var getLabel = function getLabel(index) {
35097
+ cov_12s3p009b2().f[1]++;
35098
+ cov_12s3p009b2().s[6]++;
35099
+ return index ? (cov_12s3p009b2().b[2][0]++, t("common.and", {
35100
+ what: t("common.then").toLowerCase()
35101
+ })) : (cov_12s3p009b2().b[2][1]++, t("common.then"));
35102
+ };
35103
+ cov_12s3p009b2().s[7]++;
35104
+ var renderActionValues = function renderActionValues(action, actionOption) {
35105
+ cov_12s3p009b2().f[2]++;
35106
+ cov_12s3p009b2().s[8]++;
35107
+ if (actionOption.type === "dropdown") {
35108
+ cov_12s3p009b2().b[3][0]++;
35109
+ cov_12s3p009b2().s[9]++;
35110
+ return /*#__PURE__*/React.createElement(Typography, {
35111
+ className: "neeto-ui-text-gray-800",
35112
+ style: "h5",
35113
+ weight: "semibold"
35114
+ }, getEntityDisplayValue(action, actionOption));
35115
+ } else {
35116
+ cov_12s3p009b2().b[3][1]++;
35117
+ }
35118
+ cov_12s3p009b2().s[10]++;
35119
+ if (actionOption.type === "multiSelect") {
35120
+ cov_12s3p009b2().b[4][0]++;
35121
+ var values = (cov_12s3p009b2().s[11]++, pluck("label", actionOption.dropdownOptions.filter(function (_ref5) {
35122
+ var value = _ref5.value;
35123
+ cov_12s3p009b2().f[3]++;
35124
+ cov_12s3p009b2().s[12]++;
35125
+ return action.metadata.value.includes(value);
35126
+ })));
35127
+ cov_12s3p009b2().s[13]++;
35128
+ return /*#__PURE__*/React.createElement(MultiSelectValues, {
35129
+ separator: t("common.and", {
35130
+ what: ""
35131
+ }),
35132
+ values: values
35133
+ });
35134
+ } else {
35135
+ cov_12s3p009b2().b[4][1]++;
35136
+ }
35137
+ cov_12s3p009b2().s[14]++;
35138
+ return null;
35139
+ };
35140
+ cov_12s3p009b2().s[15]++;
35141
+ var renderAction = function renderAction(action) {
35142
+ cov_12s3p009b2().f[4]++;
35143
+ var actionOption = (cov_12s3p009b2().s[16]++, findBy({
35144
+ value: action.name
35145
+ }, actions.actionOptions));
35146
+ cov_12s3p009b2().s[17]++;
35147
+ if (!actionOption) {
35148
+ cov_12s3p009b2().b[5][0]++;
35149
+ cov_12s3p009b2().s[18]++;
35150
+ return null;
35151
+ } else {
35152
+ cov_12s3p009b2().b[5][1]++;
35153
+ }
35154
+ cov_12s3p009b2().s[19]++;
35155
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Typography, {
35156
+ className: "neeto-ui-text-gray-800",
35157
+ style: "h5",
35158
+ weight: "semibold"
35159
+ }, actionOption === null || actionOption === void 0 ? void 0 : actionOption.label.toLowerCase()), renderActionValues(action, actionOption));
35160
+ };
35161
+ cov_12s3p009b2().s[20]++;
35162
+ return /*#__PURE__*/React.createElement(Title, {
35163
+ title: t("common.then")
35164
+ }, allActions.map(function (action, index) {
35165
+ cov_12s3p009b2().f[5]++;
35166
+ cov_12s3p009b2().s[21]++;
35167
+ return /*#__PURE__*/React.createElement("div", {
35168
+ className: "mb-2 flex flex-wrap gap-x-1 gap-y-2",
35169
+ key: action.name
35170
+ }, /*#__PURE__*/React.createElement(Typography, {
35171
+ className: "neeto-ui-text-gray-700",
35172
+ style: "h5",
35173
+ weight: "normal"
35174
+ }, getLabel(index)), renderAction(action));
35175
+ }), (cov_12s3p009b2().b[6][0]++, actionsList.length > 4) && (cov_12s3p009b2().b[6][1]++, /*#__PURE__*/React.createElement("div", {
35176
+ className: "mt-3 w-full"
35177
+ }, /*#__PURE__*/React.createElement(Button, {
35178
+ icon: !viewMore ? (cov_12s3p009b2().b[7][0]++, Down) : (cov_12s3p009b2().b[7][1]++, Up),
35179
+ label: !viewMore ? (cov_12s3p009b2().b[8][0]++, t("common.viewMore")) : (cov_12s3p009b2().b[8][1]++, t("common.viewLess")),
35180
+ size: "small",
35181
+ style: "link",
35182
+ onClick: function onClick() {
35183
+ cov_12s3p009b2().f[6]++;
35184
+ cov_12s3p009b2().s[22]++;
35185
+ return setViewMore(function (prevState) {
35186
+ cov_12s3p009b2().f[7]++;
35187
+ cov_12s3p009b2().s[23]++;
35188
+ return !prevState;
35189
+ });
35190
+ }
35191
+ }))));
35192
+ };
35193
+
35194
+ function cov_h01t9qzwy() {
35195
+ var path = "/home/runner/work/neeto-rules-frontend/neeto-rules-frontend/src/components/RulePreview/ConditionsDetail.jsx";
35196
+ var hash = "fc61378f8f3779c202fa96af72a7593a3f420615";
35197
+ var global = new Function("return this")();
35198
+ var gcv = "__coverage__";
35199
+ var coverageData = {
35200
+ path: "/home/runner/work/neeto-rules-frontend/neeto-rules-frontend/src/components/RulePreview/ConditionsDetail.jsx",
35201
+ statementMap: {
35202
+ "0": {
35203
+ start: {
35204
+ line: 11,
35205
+ column: 25
35206
+ },
35207
+ end: {
35208
+ line: 118,
35209
+ column: 1
35210
+ }
35211
+ },
35212
+ "1": {
35213
+ start: {
35214
+ line: 12,
35215
+ column: 27
35216
+ },
35217
+ end: {
35218
+ line: 13,
35219
+ column: 45
35220
+ }
35221
+ },
35222
+ "2": {
35223
+ start: {
35224
+ line: 13,
35225
+ column: 4
35226
+ },
35227
+ end: {
35228
+ line: 13,
35229
+ column: 45
35230
+ }
35231
+ },
35232
+ "3": {
35233
+ start: {
35234
+ line: 15,
35235
+ column: 32
35236
+ },
35237
+ end: {
35238
+ line: 52,
35239
+ column: 3
35240
+ }
35241
+ },
35242
+ "4": {
35243
+ start: {
35244
+ line: 16,
35245
+ column: 4
35246
+ },
35247
+ end: {
35248
+ line: 26,
35249
+ column: 5
35250
+ }
35251
+ },
35252
+ "5": {
35253
+ start: {
35254
+ line: 17,
35255
+ column: 6
35256
+ },
35257
+ end: {
35258
+ line: 25,
35259
+ column: 8
35260
+ }
35261
+ },
35262
+ "6": {
35263
+ start: {
35264
+ line: 28,
35265
+ column: 4
35266
+ },
35267
+ end: {
35268
+ line: 37,
35269
+ column: 5
35270
+ }
35271
+ },
35272
+ "7": {
35273
+ start: {
35274
+ line: 29,
35275
+ column: 21
35276
+ },
35277
+ end: {
35278
+ line: 34,
35279
+ column: 7
35280
+ }
35281
+ },
35282
+ "8": {
35283
+ start: {
35284
+ line: 32,
35285
+ column: 10
35286
+ },
35287
+ end: {
35288
+ line: 32,
35289
+ column: 51
35290
+ }
35291
+ },
35292
+ "9": {
35293
+ start: {
35294
+ line: 36,
35295
+ column: 6
35296
+ },
35297
+ end: {
35298
+ line: 36,
35299
+ column: 78
35300
+ }
35301
+ },
35302
+ "10": {
35303
+ start: {
35304
+ line: 39,
35305
+ column: 4
35306
+ },
35307
+ end: {
35308
+ line: 49,
35309
+ column: 5
35310
+ }
35311
+ },
35312
+ "11": {
35313
+ start: {
35314
+ line: 40,
35315
+ column: 6
35316
+ },
35317
+ end: {
35318
+ line: 48,
35319
+ column: 8
35320
+ }
35321
+ },
35322
+ "12": {
35323
+ start: {
35324
+ line: 51,
35325
+ column: 4
35326
+ },
35327
+ end: {
35328
+ line: 51,
35329
+ column: 16
35330
+ }
35331
+ },
35332
+ "13": {
35333
+ start: {
35334
+ line: 54,
35335
+ column: 26
35336
+ },
35337
+ end: {
35338
+ line: 82,
35339
+ column: 3
35340
+ }
35341
+ },
35342
+ "14": {
35343
+ start: {
35344
+ line: 55,
35345
+ column: 28
35346
+ },
35347
+ end: {
35348
+ line: 58,
35349
+ column: 5
35350
+ }
35351
+ },
35352
+ "15": {
35353
+ start: {
35354
+ line: 59,
35355
+ column: 4
35356
+ },
35357
+ end: {
35358
+ line: 59,
35359
+ column: 38
35360
+ }
35361
+ },
35362
+ "16": {
35363
+ start: {
35364
+ line: 59,
35365
+ column: 26
35366
+ },
35367
+ end: {
35368
+ line: 59,
35369
+ column: 38
35370
+ }
35371
+ },
35372
+ "17": {
35373
+ start: {
35374
+ line: 61,
35375
+ column: 26
35376
+ },
35377
+ end: {
35378
+ line: 61,
35379
+ column: 71
35380
+ }
35381
+ },
35382
+ "18": {
35383
+ start: {
35384
+ line: 63,
35385
+ column: 4
35386
+ },
35387
+ end: {
35388
+ line: 81,
35389
+ column: 6
35390
+ }
35391
+ },
35392
+ "19": {
35393
+ start: {
35394
+ line: 84,
35395
+ column: 2
35396
+ },
35397
+ end: {
35398
+ line: 117,
35399
+ column: 4
35400
+ }
35401
+ },
35402
+ "20": {
35403
+ start: {
35404
+ line: 87,
35405
+ column: 8
35406
+ },
35407
+ end: {
35408
+ line: 114,
35409
+ column: 14
35410
+ }
35411
+ }
35412
+ },
35413
+ fnMap: {
35414
+ "0": {
35415
+ name: "(anonymous_0)",
35416
+ decl: {
35417
+ start: {
35418
+ line: 11,
35419
+ column: 25
35420
+ },
35421
+ end: {
35422
+ line: 11,
35423
+ column: 26
35424
+ }
35425
+ },
35426
+ loc: {
35427
+ start: {
35428
+ line: 11,
35429
+ column: 79
35430
+ },
35431
+ end: {
35432
+ line: 118,
35433
+ column: 1
35434
+ }
35435
+ },
35436
+ line: 11
35437
+ },
35438
+ "1": {
35439
+ name: "(anonymous_1)",
35440
+ decl: {
35441
+ start: {
35442
+ line: 12,
35443
+ column: 27
35444
+ },
35445
+ end: {
35446
+ line: 12,
35447
+ column: 28
35448
+ }
35449
+ },
35450
+ loc: {
35451
+ start: {
35452
+ line: 13,
35453
+ column: 4
35454
+ },
35455
+ end: {
35456
+ line: 13,
35457
+ column: 45
35458
+ }
35459
+ },
35460
+ line: 13
35461
+ },
35462
+ "2": {
35463
+ name: "(anonymous_2)",
35464
+ decl: {
35465
+ start: {
35466
+ line: 15,
35467
+ column: 32
35468
+ },
35469
+ end: {
35470
+ line: 15,
35471
+ column: 33
35472
+ }
35473
+ },
35474
+ loc: {
35475
+ start: {
35476
+ line: 15,
35477
+ column: 64
35478
+ },
35479
+ end: {
35480
+ line: 52,
35481
+ column: 3
35482
+ }
35483
+ },
35484
+ line: 15
35485
+ },
35486
+ "3": {
35487
+ name: "(anonymous_3)",
35488
+ decl: {
35489
+ start: {
35490
+ line: 31,
35491
+ column: 47
35492
+ },
35493
+ end: {
35494
+ line: 31,
35495
+ column: 48
35496
+ }
35497
+ },
35498
+ loc: {
35499
+ start: {
35500
+ line: 32,
35501
+ column: 10
35502
+ },
35503
+ end: {
35504
+ line: 32,
35505
+ column: 51
35506
+ }
35507
+ },
35508
+ line: 32
35509
+ },
35510
+ "4": {
35511
+ name: "(anonymous_4)",
35512
+ decl: {
35513
+ start: {
35514
+ line: 54,
35515
+ column: 26
35516
+ },
35517
+ end: {
35518
+ line: 54,
35519
+ column: 27
35520
+ }
35521
+ },
35522
+ loc: {
35523
+ start: {
35524
+ line: 54,
35525
+ column: 39
35526
+ },
35527
+ end: {
35528
+ line: 82,
35529
+ column: 3
35530
+ }
35531
+ },
35532
+ line: 54
35533
+ },
35534
+ "5": {
35535
+ name: "(anonymous_5)",
35536
+ decl: {
35537
+ start: {
35538
+ line: 86,
35539
+ column: 22
35540
+ },
35541
+ end: {
35542
+ line: 86,
35543
+ column: 23
35544
+ }
35545
+ },
35546
+ loc: {
35547
+ start: {
35548
+ line: 87,
35549
+ column: 8
35550
+ },
35551
+ end: {
35552
+ line: 114,
35553
+ column: 14
35554
+ }
35555
+ },
35556
+ line: 87
35557
+ }
35558
+ },
35559
+ branchMap: {
35560
+ "0": {
35561
+ loc: {
35562
+ start: {
35563
+ line: 13,
35564
+ column: 4
35565
+ },
35566
+ end: {
35567
+ line: 13,
35568
+ column: 45
35569
+ }
35570
+ },
35571
+ type: "cond-expr",
35572
+ locations: [{
35573
+ start: {
35574
+ line: 13,
35575
+ column: 33
35576
+ },
35577
+ end: {
35578
+ line: 13,
35579
+ column: 37
35580
+ }
35581
+ }, {
35582
+ start: {
35583
+ line: 13,
35584
+ column: 40
35585
+ },
35586
+ end: {
35587
+ line: 13,
35588
+ column: 45
35589
+ }
35590
+ }],
35591
+ line: 13
35592
+ },
35593
+ "1": {
35594
+ loc: {
35595
+ start: {
35596
+ line: 16,
35597
+ column: 4
35598
+ },
35599
+ end: {
35600
+ line: 26,
35601
+ column: 5
35602
+ }
35603
+ },
35604
+ type: "if",
35605
+ locations: [{
35606
+ start: {
35607
+ line: 16,
35608
+ column: 4
35609
+ },
35610
+ end: {
35611
+ line: 26,
35612
+ column: 5
35613
+ }
35614
+ }, {
35615
+ start: {
35616
+ line: undefined,
35617
+ column: undefined
35618
+ },
35619
+ end: {
35620
+ line: undefined,
35621
+ column: undefined
35622
+ }
35623
+ }],
35624
+ line: 16
35625
+ },
35626
+ "2": {
35627
+ loc: {
35628
+ start: {
35629
+ line: 28,
35630
+ column: 4
35631
+ },
35632
+ end: {
35633
+ line: 37,
35634
+ column: 5
35635
+ }
35636
+ },
35637
+ type: "if",
35638
+ locations: [{
35639
+ start: {
35640
+ line: 28,
35641
+ column: 4
35642
+ },
35643
+ end: {
35644
+ line: 37,
35645
+ column: 5
35646
+ }
35647
+ }, {
35648
+ start: {
35649
+ line: undefined,
35650
+ column: undefined
35651
+ },
35652
+ end: {
35653
+ line: undefined,
35654
+ column: undefined
35655
+ }
35656
+ }],
35657
+ line: 28
35658
+ },
35659
+ "3": {
35660
+ loc: {
35661
+ start: {
35662
+ line: 39,
35663
+ column: 4
35664
+ },
35665
+ end: {
35666
+ line: 49,
35667
+ column: 5
35668
+ }
35669
+ },
35670
+ type: "if",
35671
+ locations: [{
35672
+ start: {
35673
+ line: 39,
35674
+ column: 4
35675
+ },
35676
+ end: {
35677
+ line: 49,
35678
+ column: 5
35679
+ }
35680
+ }, {
35681
+ start: {
35682
+ line: undefined,
35683
+ column: undefined
35684
+ },
35685
+ end: {
35686
+ line: undefined,
35687
+ column: undefined
35688
+ }
35689
+ }],
35690
+ line: 39
35691
+ },
35692
+ "4": {
35693
+ loc: {
35694
+ start: {
35695
+ line: 59,
35696
+ column: 4
35697
+ },
35698
+ end: {
35699
+ line: 59,
35700
+ column: 38
35701
+ }
35702
+ },
35703
+ type: "if",
35704
+ locations: [{
35705
+ start: {
35706
+ line: 59,
35707
+ column: 4
35708
+ },
35709
+ end: {
35710
+ line: 59,
35711
+ column: 38
35712
+ }
35713
+ }, {
35714
+ start: {
35715
+ line: undefined,
35716
+ column: undefined
35717
+ },
35718
+ end: {
35719
+ line: undefined,
35720
+ column: undefined
35721
+ }
35722
+ }],
35723
+ line: 59
35724
+ },
35725
+ "5": {
35726
+ loc: {
35727
+ start: {
35728
+ line: 88,
35729
+ column: 11
35730
+ },
35731
+ end: {
35732
+ line: 96,
35733
+ column: 11
35734
+ }
35735
+ },
35736
+ type: "binary-expr",
35737
+ locations: [{
35738
+ start: {
35739
+ line: 88,
35740
+ column: 11
35741
+ },
35742
+ end: {
35743
+ line: 88,
35744
+ column: 17
35745
+ }
35746
+ }, {
35747
+ start: {
35748
+ line: 89,
35749
+ column: 12
35750
+ },
35751
+ end: {
35752
+ line: 95,
35753
+ column: 25
35754
+ }
35755
+ }],
35756
+ line: 88
35757
+ },
35758
+ "6": {
35759
+ loc: {
35760
+ start: {
35761
+ line: 97,
35762
+ column: 11
35763
+ },
35764
+ end: {
35765
+ line: 105,
35766
+ column: 11
35767
+ }
35768
+ },
35769
+ type: "binary-expr",
35770
+ locations: [{
35771
+ start: {
35772
+ line: 97,
35773
+ column: 11
35774
+ },
35775
+ end: {
35776
+ line: 97,
35777
+ column: 18
35778
+ }
35779
+ }, {
35780
+ start: {
35781
+ line: 98,
35782
+ column: 12
35783
+ },
35784
+ end: {
35785
+ line: 104,
35786
+ column: 25
35787
+ }
35788
+ }],
35789
+ line: 97
35790
+ }
35791
+ },
35792
+ s: {
35793
+ "0": 0,
35794
+ "1": 0,
35795
+ "2": 0,
35796
+ "3": 0,
35797
+ "4": 0,
35798
+ "5": 0,
35799
+ "6": 0,
35800
+ "7": 0,
35801
+ "8": 0,
35802
+ "9": 0,
35803
+ "10": 0,
35804
+ "11": 0,
35805
+ "12": 0,
35806
+ "13": 0,
35807
+ "14": 0,
35808
+ "15": 0,
35809
+ "16": 0,
35810
+ "17": 0,
35811
+ "18": 0,
35812
+ "19": 0,
35813
+ "20": 0
35814
+ },
35815
+ f: {
35816
+ "0": 0,
35817
+ "1": 0,
35818
+ "2": 0,
35819
+ "3": 0,
35820
+ "4": 0,
35821
+ "5": 0
35822
+ },
35823
+ b: {
35824
+ "0": [0, 0],
35825
+ "1": [0, 0],
35826
+ "2": [0, 0],
35827
+ "3": [0, 0],
35828
+ "4": [0, 0],
35829
+ "5": [0, 0],
35830
+ "6": [0, 0]
35831
+ },
35832
+ _coverageSchema: "1a1c01bbd47fc00a2c39e90264f33305004495a9",
35833
+ hash: "fc61378f8f3779c202fa96af72a7593a3f420615"
35834
+ };
35835
+ var coverage = global[gcv] || (global[gcv] = {});
35836
+ if (!coverage[path] || coverage[path].hash !== hash) {
35837
+ coverage[path] = coverageData;
35838
+ }
35839
+ var actualCoverage = coverage[path];
35840
+ {
35841
+ // @ts-ignore
35842
+ cov_h01t9qzwy = function () {
35843
+ return actualCoverage;
35844
+ };
35845
+ }
35846
+ return actualCoverage;
35847
+ }
35848
+ cov_h01t9qzwy();
35849
+ cov_h01t9qzwy().s[0]++;
35850
+ var ConditionsDetail = function ConditionsDetail(_ref) {
35851
+ var conditions = _ref.conditions,
35852
+ conditionOptions = _ref.conditionOptions,
35853
+ conditionVerbs = _ref.conditionVerbs;
35854
+ cov_h01t9qzwy().f[0]++;
35855
+ cov_h01t9qzwy().s[1]++;
35856
+ var getLogicOperator = function getLogicOperator(joinType) {
35857
+ cov_h01t9qzwy().f[1]++;
35858
+ cov_h01t9qzwy().s[2]++;
35859
+ return joinType === "or_operator" ? (cov_h01t9qzwy().b[0][0]++, "or") : (cov_h01t9qzwy().b[0][1]++, "and");
35860
+ };
35861
+ cov_h01t9qzwy().s[3]++;
35862
+ var renderConditionValues = function renderConditionValues(condition, conditionOption) {
35863
+ cov_h01t9qzwy().f[2]++;
35864
+ cov_h01t9qzwy().s[4]++;
35865
+ if (["email", "text", "number"].includes(conditionOption.type)) {
35866
+ var _condition$metadata$v;
35867
+ cov_h01t9qzwy().b[1][0]++;
35868
+ cov_h01t9qzwy().s[5]++;
35869
+ return /*#__PURE__*/React.createElement(Typography, {
35870
+ className: "neeto-ui-text-gray-800",
35871
+ style: "h5",
35872
+ weight: "semibold"
35873
+ }, (_condition$metadata$v = condition.metadata.value) === null || _condition$metadata$v === void 0 ? void 0 : _condition$metadata$v.toLowerCase());
35874
+ } else {
35875
+ cov_h01t9qzwy().b[1][1]++;
35876
+ }
35877
+ cov_h01t9qzwy().s[6]++;
35878
+ if (conditionOption.type === "multi-select") {
35879
+ cov_h01t9qzwy().b[2][0]++;
35880
+ var values = (cov_h01t9qzwy().s[7]++, pluck("label", conditionOption.dropdownOptions.filter(function (_ref2) {
35881
+ var value = _ref2.value;
35882
+ cov_h01t9qzwy().f[3]++;
35883
+ cov_h01t9qzwy().s[8]++;
35884
+ return condition.metadata.values.includes(value);
35885
+ })));
35886
+ cov_h01t9qzwy().s[9]++;
35887
+ return /*#__PURE__*/React.createElement(MultiSelectValues, {
35888
+ separator: t("common.or"),
35889
+ values: values
35890
+ });
35891
+ } else {
35892
+ cov_h01t9qzwy().b[2][1]++;
35893
+ }
35894
+ cov_h01t9qzwy().s[10]++;
35895
+ if (conditionOption.type === "dropdown") {
35896
+ cov_h01t9qzwy().b[3][0]++;
35897
+ cov_h01t9qzwy().s[11]++;
35898
+ return /*#__PURE__*/React.createElement(Typography, {
35899
+ className: "neeto-ui-text-gray-800",
35900
+ style: "h5",
35901
+ weight: "semibold"
35902
+ }, getEntityDisplayValue(condition, conditionOption));
35903
+ } else {
35904
+ cov_h01t9qzwy().b[3][1]++;
35905
+ }
35906
+ cov_h01t9qzwy().s[12]++;
35907
+ return null;
35908
+ };
35909
+ cov_h01t9qzwy().s[13]++;
35910
+ var renderCondition = function renderCondition(condition) {
35911
+ var _conditionVerbs$condi;
35912
+ cov_h01t9qzwy().f[4]++;
35913
+ var conditionOption = (cov_h01t9qzwy().s[14]++, findBy({
35914
+ value: condition.field
35915
+ }, conditionOptions));
35916
+ cov_h01t9qzwy().s[15]++;
35917
+ if (!conditionOption) {
35918
+ cov_h01t9qzwy().b[4][0]++;
35919
+ cov_h01t9qzwy().s[16]++;
35920
+ return null;
35921
+ } else {
35922
+ cov_h01t9qzwy().b[4][1]++;
35923
+ }
35924
+ var conditionVerb = (cov_h01t9qzwy().s[17]++, (_conditionVerbs$condi = conditionVerbs[condition.verb]) === null || _conditionVerbs$condi === void 0 ? void 0 : _conditionVerbs$condi.toLowerCase());
35925
+ cov_h01t9qzwy().s[18]++;
35926
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Typography, {
35927
+ className: "neeto-ui-text-gray-800",
35928
+ style: "h5",
35929
+ weight: "semibold"
35930
+ }, conditionOption === null || conditionOption === void 0 ? void 0 : conditionOption.label.toLowerCase()), /*#__PURE__*/React.createElement(Typography, {
35931
+ className: "neeto-ui-text-gray-800",
35932
+ style: "h5",
35933
+ weight: "semibold"
35934
+ }, conditionVerb), renderConditionValues(condition, conditionOption));
35935
+ };
35936
+ cov_h01t9qzwy().s[19]++;
35937
+ return /*#__PURE__*/React.createElement("div", {
35938
+ className: "mt-2"
35939
+ }, conditions.map(function (condition, index) {
35940
+ cov_h01t9qzwy().f[5]++;
35941
+ cov_h01t9qzwy().s[20]++;
35942
+ return /*#__PURE__*/React.createElement("div", {
35943
+ className: "mb-2 flex flex-wrap gap-x-2 gap-y-2",
35944
+ key: condition.id
35945
+ }, (cov_h01t9qzwy().b[5][0]++, !index) && (cov_h01t9qzwy().b[5][1]++, /*#__PURE__*/React.createElement(Typography, {
35946
+ className: "neeto-ui-text-gray-700",
35947
+ style: "h5",
35948
+ weight: "normal"
35949
+ }, t("common.and", {
35950
+ what: ""
35951
+ }))), (cov_h01t9qzwy().b[6][0]++, !!index) && (cov_h01t9qzwy().b[6][1]++, /*#__PURE__*/React.createElement(Typography, {
35952
+ className: "neeto-ui-text-gray-800",
35953
+ style: "h5",
35954
+ weight: "semibold"
35955
+ }, getLogicOperator(condition.joinType))), /*#__PURE__*/React.createElement(Typography, {
35956
+ className: "neeto-ui-text-gray-700",
35957
+ style: "h5",
35958
+ weight: "normal"
35959
+ }, t("common.when").toLowerCase()), renderCondition(condition));
35960
+ }));
35961
+ };
35962
+
35963
+ function cov_rr7czlpcc() {
35964
+ var path = "/home/runner/work/neeto-rules-frontend/neeto-rules-frontend/src/components/RulePreview/EventsDetail.jsx";
35965
+ var hash = "027ffb7dc7b431626e71008ddc8edc3a2d938d8a";
35966
+ var global = new Function("return this")();
35967
+ var gcv = "__coverage__";
35968
+ var coverageData = {
35969
+ path: "/home/runner/work/neeto-rules-frontend/neeto-rules-frontend/src/components/RulePreview/EventsDetail.jsx",
35970
+ statementMap: {
35971
+ "0": {
35972
+ start: {
35973
+ line: 12,
35974
+ column: 21
35975
+ },
35976
+ end: {
35977
+ line: 96,
35978
+ column: 1
35979
+ }
35980
+ },
35981
+ "1": {
35982
+ start: {
35983
+ line: 13,
35984
+ column: 34
35985
+ },
35986
+ end: {
35987
+ line: 13,
35988
+ column: 49
35989
+ }
35990
+ },
35991
+ "2": {
35992
+ start: {
35993
+ line: 15,
35994
+ column: 21
35995
+ },
35996
+ end: {
35997
+ line: 15,
35998
+ column: 48
35999
+ }
36000
+ },
36001
+ "3": {
36002
+ start: {
36003
+ line: 16,
36004
+ column: 20
36005
+ },
36006
+ end: {
36007
+ line: 18,
36008
+ column: 3
36009
+ }
36010
+ },
36011
+ "4": {
36012
+ start: {
36013
+ line: 17,
36014
+ column: 4
36015
+ },
36016
+ end: {
36017
+ line: 17,
36018
+ column: 37
36019
+ }
36020
+ },
36021
+ "5": {
36022
+ start: {
36023
+ line: 20,
36024
+ column: 25
36025
+ },
36026
+ end: {
36027
+ line: 20,
36028
+ column: 41
36029
+ }
36030
+ },
36031
+ "6": {
36032
+ start: {
36033
+ line: 22,
36034
+ column: 4
36035
+ },
36036
+ end: {
36037
+ line: 24,
36038
+ column: 34
36039
+ }
36040
+ },
36041
+ "7": {
36042
+ start: {
36043
+ line: 26,
36044
+ column: 27
36045
+ },
36046
+ end: {
36047
+ line: 29,
36048
+ column: 3
36049
+ }
36050
+ },
36051
+ "8": {
36052
+ start: {
36053
+ line: 31,
36054
+ column: 2
36055
+ },
36056
+ end: {
36057
+ line: 95,
36058
+ column: 4
36059
+ }
36060
+ },
36061
+ "9": {
36062
+ start: {
36063
+ line: 35,
36064
+ column: 10
36065
+ },
36066
+ end: {
36067
+ line: 61,
36068
+ column: 16
36069
+ }
36070
+ },
36071
+ "10": {
36072
+ start: {
36073
+ line: 90,
36074
+ column: 27
36075
+ },
36076
+ end: {
36077
+ line: 90,
36078
+ column: 63
36079
+ }
36080
+ },
36081
+ "11": {
36082
+ start: {
36083
+ line: 90,
36084
+ column: 52
36085
+ },
36086
+ end: {
36087
+ line: 90,
36088
+ column: 62
36089
+ }
36090
+ }
36091
+ },
36092
+ fnMap: {
36093
+ "0": {
36094
+ name: "(anonymous_0)",
36095
+ decl: {
36096
+ start: {
36097
+ line: 12,
36098
+ column: 21
36099
+ },
36100
+ end: {
36101
+ line: 12,
36102
+ column: 22
36103
+ }
36104
+ },
36105
+ loc: {
36106
+ start: {
36107
+ line: 12,
36108
+ column: 60
36109
+ },
36110
+ end: {
36111
+ line: 96,
36112
+ column: 1
36113
+ }
36114
+ },
36115
+ line: 12
36116
+ },
36117
+ "1": {
36118
+ name: "(anonymous_1)",
36119
+ decl: {
36120
+ start: {
36121
+ line: 16,
36122
+ column: 47
36123
+ },
36124
+ end: {
36125
+ line: 16,
36126
+ column: 48
36127
+ }
36128
+ },
36129
+ loc: {
36130
+ start: {
36131
+ line: 17,
36132
+ column: 4
36133
+ },
36134
+ end: {
36135
+ line: 17,
36136
+ column: 37
36137
+ }
36138
+ },
36139
+ line: 17
36140
+ },
36141
+ "2": {
36142
+ name: "(anonymous_2)",
36143
+ decl: {
36144
+ start: {
36145
+ line: 34,
36146
+ column: 23
36147
+ },
36148
+ end: {
36149
+ line: 34,
36150
+ column: 24
36151
+ }
36152
+ },
36153
+ loc: {
36154
+ start: {
36155
+ line: 35,
36156
+ column: 10
36157
+ },
36158
+ end: {
36159
+ line: 61,
36160
+ column: 16
36161
+ }
36162
+ },
36163
+ line: 35
36164
+ },
36165
+ "3": {
36166
+ name: "(anonymous_3)",
36167
+ decl: {
36168
+ start: {
36169
+ line: 90,
36170
+ column: 21
36171
+ },
36172
+ end: {
36173
+ line: 90,
36174
+ column: 22
36175
+ }
36176
+ },
36177
+ loc: {
36178
+ start: {
36179
+ line: 90,
36180
+ column: 27
36181
+ },
36182
+ end: {
36183
+ line: 90,
36184
+ column: 63
36185
+ }
36186
+ },
36187
+ line: 90
36188
+ },
36189
+ "4": {
36190
+ name: "(anonymous_4)",
36191
+ decl: {
36192
+ start: {
36193
+ line: 90,
36194
+ column: 39
36195
+ },
36196
+ end: {
36197
+ line: 90,
36198
+ column: 40
36199
+ }
36200
+ },
36201
+ loc: {
36202
+ start: {
36203
+ line: 90,
36204
+ column: 52
36205
+ },
36206
+ end: {
36207
+ line: 90,
36208
+ column: 62
36209
+ }
36210
+ },
36211
+ line: 90
36212
+ }
36213
+ },
36214
+ branchMap: {
36215
+ "0": {
36216
+ loc: {
36217
+ start: {
36218
+ line: 22,
36219
+ column: 4
36220
+ },
36221
+ end: {
36222
+ line: 24,
36223
+ column: 34
36224
+ }
36225
+ },
36226
+ type: "cond-expr",
36227
+ locations: [{
36228
+ start: {
36229
+ line: 23,
36230
+ column: 8
36231
+ },
36232
+ end: {
36233
+ line: 23,
36234
+ column: 22
36235
+ }
36236
+ }, {
36237
+ start: {
36238
+ line: 24,
36239
+ column: 8
36240
+ },
36241
+ end: {
36242
+ line: 24,
36243
+ column: 34
36244
+ }
36245
+ }],
36246
+ line: 22
36247
+ },
36248
+ "1": {
36249
+ loc: {
36250
+ start: {
36251
+ line: 22,
36252
+ column: 4
36253
+ },
36254
+ end: {
36255
+ line: 22,
36256
+ column: 41
36257
+ }
36258
+ },
36259
+ type: "binary-expr",
36260
+ locations: [{
36261
+ start: {
36262
+ line: 22,
36263
+ column: 4
36264
+ },
36265
+ end: {
36266
+ line: 22,
36267
+ column: 12
36268
+ }
36269
+ }, {
36270
+ start: {
36271
+ line: 22,
36272
+ column: 16
36273
+ },
36274
+ end: {
36275
+ line: 22,
36276
+ column: 41
36277
+ }
36278
+ }],
36279
+ line: 22
36280
+ },
36281
+ "2": {
36282
+ loc: {
36283
+ start: {
36284
+ line: 36,
36285
+ column: 13
36286
+ },
36287
+ end: {
36288
+ line: 44,
36289
+ column: 13
36290
+ }
36291
+ },
36292
+ type: "binary-expr",
36293
+ locations: [{
36294
+ start: {
36295
+ line: 36,
36296
+ column: 13
36297
+ },
36298
+ end: {
36299
+ line: 36,
36300
+ column: 19
36301
+ }
36302
+ }, {
36303
+ start: {
36304
+ line: 37,
36305
+ column: 14
36306
+ },
36307
+ end: {
36308
+ line: 43,
36309
+ column: 27
36310
+ }
36311
+ }],
36312
+ line: 36
36313
+ },
36314
+ "3": {
36315
+ loc: {
36316
+ start: {
36317
+ line: 45,
36318
+ column: 13
36319
+ },
36320
+ end: {
36321
+ line: 53,
36322
+ column: 13
36323
+ }
36324
+ },
36325
+ type: "binary-expr",
36326
+ locations: [{
36327
+ start: {
36328
+ line: 45,
36329
+ column: 13
36330
+ },
36331
+ end: {
36332
+ line: 45,
36333
+ column: 20
36334
+ }
36335
+ }, {
36336
+ start: {
36337
+ line: 46,
36338
+ column: 14
36339
+ },
36340
+ end: {
36341
+ line: 52,
36342
+ column: 27
36343
+ }
36344
+ }],
36345
+ line: 45
36346
+ },
36347
+ "4": {
36348
+ loc: {
36349
+ start: {
36350
+ line: 83,
36351
+ column: 7
36352
+ },
36353
+ end: {
36354
+ line: 93,
36355
+ column: 7
36356
+ }
36357
+ },
36358
+ type: "binary-expr",
36359
+ locations: [{
36360
+ start: {
36361
+ line: 83,
36362
+ column: 7
36363
+ },
36364
+ end: {
36365
+ line: 83,
36366
+ column: 32
36367
+ }
36368
+ }, {
36369
+ start: {
36370
+ line: 84,
36371
+ column: 8
36372
+ },
36373
+ end: {
36374
+ line: 92,
36375
+ column: 14
36376
+ }
36377
+ }],
36378
+ line: 83
36379
+ },
36380
+ "5": {
36381
+ loc: {
36382
+ start: {
36383
+ line: 86,
36384
+ column: 18
36385
+ },
36386
+ end: {
36387
+ line: 86,
36388
+ column: 39
36389
+ }
36390
+ },
36391
+ type: "cond-expr",
36392
+ locations: [{
36393
+ start: {
36394
+ line: 86,
36395
+ column: 30
36396
+ },
36397
+ end: {
36398
+ line: 86,
36399
+ column: 34
36400
+ }
36401
+ }, {
36402
+ start: {
36403
+ line: 86,
36404
+ column: 37
36405
+ },
36406
+ end: {
36407
+ line: 86,
36408
+ column: 39
36409
+ }
36410
+ }],
36411
+ line: 86
36412
+ },
36413
+ "6": {
36414
+ loc: {
36415
+ start: {
36416
+ line: 87,
36417
+ column: 19
36418
+ },
36419
+ end: {
36420
+ line: 87,
36421
+ column: 74
36422
+ }
36423
+ },
36424
+ type: "cond-expr",
36425
+ locations: [{
36426
+ start: {
36427
+ line: 87,
36428
+ column: 31
36429
+ },
36430
+ end: {
36431
+ line: 87,
36432
+ column: 51
36433
+ }
36434
+ }, {
36435
+ start: {
36436
+ line: 87,
36437
+ column: 54
36438
+ },
36439
+ end: {
36440
+ line: 87,
36441
+ column: 74
36442
+ }
36443
+ }],
36444
+ line: 87
36445
+ }
36446
+ },
36447
+ s: {
36448
+ "0": 0,
36449
+ "1": 0,
36450
+ "2": 0,
36451
+ "3": 0,
36452
+ "4": 0,
36453
+ "5": 0,
36454
+ "6": 0,
36455
+ "7": 0,
36456
+ "8": 0,
36457
+ "9": 0,
36458
+ "10": 0,
36459
+ "11": 0
36460
+ },
36461
+ f: {
36462
+ "0": 0,
36463
+ "1": 0,
36464
+ "2": 0,
36465
+ "3": 0,
36466
+ "4": 0
36467
+ },
36468
+ b: {
36469
+ "0": [0, 0],
36470
+ "1": [0, 0],
36471
+ "2": [0, 0],
36472
+ "3": [0, 0],
36473
+ "4": [0, 0],
36474
+ "5": [0, 0],
36475
+ "6": [0, 0]
36476
+ },
36477
+ _coverageSchema: "1a1c01bbd47fc00a2c39e90264f33305004495a9",
36478
+ hash: "027ffb7dc7b431626e71008ddc8edc3a2d938d8a"
36479
+ };
36480
+ var coverage = global[gcv] || (global[gcv] = {});
36481
+ if (!coverage[path] || coverage[path].hash !== hash) {
36482
+ coverage[path] = coverageData;
36483
+ }
36484
+ var actualCoverage = coverage[path];
36485
+ {
36486
+ // @ts-ignore
36487
+ cov_rr7czlpcc = function () {
36488
+ return actualCoverage;
36489
+ };
36490
+ }
36491
+ return actualCoverage;
36492
+ }
36493
+ cov_rr7czlpcc();
36494
+ cov_rr7czlpcc().s[0]++;
36495
+ var EventsDetail = function EventsDetail(_ref) {
36496
+ var _currentPerformer$lab;
36497
+ var events = _ref.events,
36498
+ performer = _ref.performer,
36499
+ conditions = _ref.conditions;
36500
+ cov_rr7czlpcc().f[0]++;
36501
+ var _ref2 = (cov_rr7czlpcc().s[1]++, useState(false)),
36502
+ _ref3 = _slicedToArray(_ref2, 2),
36503
+ viewMore = _ref3[0],
36504
+ setViewMore = _ref3[1];
36505
+ var eventNames = (cov_rr7czlpcc().s[2]++, pluck("name", events.value));
36506
+ var allEvents = (cov_rr7czlpcc().s[3]++, events.eventOptions.filter(function (event) {
36507
+ cov_rr7czlpcc().f[1]++;
36508
+ cov_rr7czlpcc().s[4]++;
36509
+ return eventNames === null || eventNames === void 0 ? void 0 : eventNames.includes(event.value);
36510
+ }));
36511
+ var conditionsList = (cov_rr7czlpcc().s[5]++, conditions.value);
36512
+ var allConditions = (cov_rr7czlpcc().s[6]++, (cov_rr7czlpcc().b[1][0]++, viewMore) && (cov_rr7czlpcc().b[1][1]++, conditionsList.length > 3) ? (cov_rr7czlpcc().b[0][0]++, conditionsList) : (cov_rr7czlpcc().b[0][1]++, conditionsList.slice(0, 3)));
36513
+ var currentPerformer = (cov_rr7czlpcc().s[7]++, findBy({
36514
+ value: performer.value
36515
+ }, performer.options));
36516
+ cov_rr7czlpcc().s[8]++;
36517
+ return /*#__PURE__*/React.createElement(Title, {
36518
+ title: t("common.when")
36519
+ }, /*#__PURE__*/React.createElement("div", {
36520
+ className: "flex flex-wrap gap-x-2 gap-y-2"
36521
+ }, allEvents.map(function (event, index) {
36522
+ cov_rr7czlpcc().f[2]++;
36523
+ cov_rr7czlpcc().s[9]++;
36524
+ return /*#__PURE__*/React.createElement("div", {
36525
+ className: "flex gap-x-2",
36526
+ key: index
36527
+ }, (cov_rr7czlpcc().b[2][0]++, !index) && (cov_rr7czlpcc().b[2][1]++, /*#__PURE__*/React.createElement(Typography, {
36528
+ className: "neeto-ui-text-gray-700 my-auto",
36529
+ style: "h5",
36530
+ weight: "normal"
36531
+ }, t("common.when"))), (cov_rr7czlpcc().b[3][0]++, !!index) && (cov_rr7czlpcc().b[3][1]++, /*#__PURE__*/React.createElement(Typography, {
36532
+ className: "neeto-ui-text-gray-700 my-auto",
36533
+ style: "h5",
36534
+ weight: "normal"
36535
+ }, t("common.or"))), /*#__PURE__*/React.createElement(Typography, {
36536
+ className: "neeto-ui-text-gray-800",
36537
+ style: "h5",
36538
+ weight: "semibold"
36539
+ }, event.label.toLowerCase()));
36540
+ }), /*#__PURE__*/React.createElement(Typography, {
36541
+ className: "neeto-ui-text-gray-700",
36542
+ style: "h5",
36543
+ weight: "normal"
36544
+ }, t("common.by")), /*#__PURE__*/React.createElement(Typography, {
36545
+ className: "neeto-ui-text-gray-800",
36546
+ style: "h5",
36547
+ weight: "semibold"
36548
+ }, currentPerformer === null || currentPerformer === void 0 ? void 0 : (_currentPerformer$lab = currentPerformer.label) === null || _currentPerformer$lab === void 0 ? void 0 : _currentPerformer$lab.toLowerCase())), /*#__PURE__*/React.createElement(ConditionsDetail, {
36549
+ conditionOptions: conditions.conditionOptions,
36550
+ conditionVerbs: conditions.verbs,
36551
+ conditions: allConditions
36552
+ }), (cov_rr7czlpcc().b[4][0]++, conditionsList.length > 3) && (cov_rr7czlpcc().b[4][1]++, /*#__PURE__*/React.createElement("div", {
36553
+ className: "mt-3 w-full"
36554
+ }, /*#__PURE__*/React.createElement(Button, {
36555
+ icon: !viewMore ? (cov_rr7czlpcc().b[5][0]++, Down) : (cov_rr7czlpcc().b[5][1]++, Up),
36556
+ label: !viewMore ? (cov_rr7czlpcc().b[6][0]++, t("common.viewMore")) : (cov_rr7czlpcc().b[6][1]++, t("common.viewLess")),
36557
+ size: "small",
36558
+ style: "link",
36559
+ onClick: function onClick() {
36560
+ cov_rr7czlpcc().f[3]++;
36561
+ cov_rr7czlpcc().s[10]++;
36562
+ return setViewMore(function (prevState) {
36563
+ cov_rr7czlpcc().f[4]++;
36564
+ cov_rr7czlpcc().s[11]++;
36565
+ return !prevState;
36566
+ });
36567
+ }
36568
+ }))));
36569
+ };
36570
+
36571
+ function cov_229plf36at() {
36572
+ var path = "/home/runner/work/neeto-rules-frontend/neeto-rules-frontend/src/components/RulePreview/index.jsx";
36573
+ var hash = "3462c6a4c7347e110f00d280be805931b49100da";
36574
+ var global = new Function("return this")();
36575
+ var gcv = "__coverage__";
36576
+ var coverageData = {
36577
+ path: "/home/runner/work/neeto-rules-frontend/neeto-rules-frontend/src/components/RulePreview/index.jsx",
36578
+ statementMap: {
36579
+ "0": {
36580
+ start: {
36581
+ line: 10,
36582
+ column: 20
36583
+ },
36584
+ end: {
36585
+ line: 73,
36586
+ column: 1
36587
+ }
36588
+ },
36589
+ "1": {
36590
+ start: {
36591
+ line: 11,
36592
+ column: 16
36593
+ },
36594
+ end: {
36595
+ line: 11,
36596
+ column: 32
36597
+ }
36598
+ },
36599
+ "2": {
36600
+ start: {
36601
+ line: 13,
36602
+ column: 2
36603
+ },
36604
+ end: {
36605
+ line: 13,
36606
+ column: 39
36607
+ }
36608
+ },
36609
+ "3": {
36610
+ start: {
36611
+ line: 13,
36612
+ column: 17
36613
+ },
36614
+ end: {
36615
+ line: 13,
36616
+ column: 39
36617
+ }
36618
+ },
36619
+ "4": {
36620
+ start: {
36621
+ line: 15,
36622
+ column: 2
36623
+ },
36624
+ end: {
36625
+ line: 72,
36626
+ column: 4
36627
+ }
36628
+ }
36629
+ },
36630
+ fnMap: {
36631
+ "0": {
36632
+ name: "(anonymous_0)",
36633
+ decl: {
36634
+ start: {
36635
+ line: 10,
36636
+ column: 20
36637
+ },
36638
+ end: {
36639
+ line: 10,
36640
+ column: 21
36641
+ }
36642
+ },
36643
+ loc: {
36644
+ start: {
36645
+ line: 10,
36646
+ column: 69
36647
+ },
36648
+ end: {
36649
+ line: 73,
36650
+ column: 1
36651
+ }
36652
+ },
36653
+ line: 10
36654
+ }
36655
+ },
36656
+ branchMap: {
36657
+ "0": {
36658
+ loc: {
36659
+ start: {
36660
+ line: 13,
36661
+ column: 2
36662
+ },
36663
+ end: {
36664
+ line: 13,
36665
+ column: 39
36666
+ }
36667
+ },
36668
+ type: "if",
36669
+ locations: [{
36670
+ start: {
36671
+ line: 13,
36672
+ column: 2
36673
+ },
36674
+ end: {
36675
+ line: 13,
36676
+ column: 39
36677
+ }
36678
+ }, {
36679
+ start: {
36680
+ line: undefined,
36681
+ column: undefined
36682
+ },
36683
+ end: {
36684
+ line: undefined,
36685
+ column: undefined
36686
+ }
36687
+ }],
36688
+ line: 13
36689
+ }
36690
+ },
36691
+ s: {
36692
+ "0": 0,
36693
+ "1": 0,
36694
+ "2": 0,
36695
+ "3": 0,
36696
+ "4": 0
36697
+ },
36698
+ f: {
36699
+ "0": 0
36700
+ },
36701
+ b: {
36702
+ "0": [0, 0]
36703
+ },
36704
+ _coverageSchema: "1a1c01bbd47fc00a2c39e90264f33305004495a9",
36705
+ hash: "3462c6a4c7347e110f00d280be805931b49100da"
36706
+ };
36707
+ var coverage = global[gcv] || (global[gcv] = {});
36708
+ if (!coverage[path] || coverage[path].hash !== hash) {
36709
+ coverage[path] = coverageData;
36710
+ }
36711
+ var actualCoverage = coverage[path];
36712
+ {
36713
+ // @ts-ignore
36714
+ cov_229plf36at = function () {
36715
+ return actualCoverage;
36716
+ };
36717
+ }
36718
+ return actualCoverage;
36719
+ }
36720
+ cov_229plf36at();
36721
+ cov_229plf36at().s[0]++;
36722
+ var RulePreview = function RulePreview(_ref) {
36723
+ var isLoading = _ref.isLoading,
36724
+ ruleDetails = _ref.ruleDetails,
36725
+ isOpen = _ref.isOpen,
36726
+ onClose = _ref.onClose;
36727
+ cov_229plf36at().f[0]++;
36728
+ var _ref2 = (cov_229plf36at().s[1]++, useTranslation()),
36729
+ t = _ref2.t;
36730
+ cov_229plf36at().s[2]++;
36731
+ if (isLoading) {
36732
+ cov_229plf36at().b[0][0]++;
36733
+ cov_229plf36at().s[3]++;
36734
+ return /*#__PURE__*/React.createElement(PageLoader, null);
36735
+ } else {
36736
+ cov_229plf36at().b[0][1]++;
36737
+ }
36738
+ cov_229plf36at().s[4]++;
36739
+ return /*#__PURE__*/React.createElement(Pane, {
36740
+ isOpen: isOpen,
36741
+ onClose: onClose
36742
+ }, /*#__PURE__*/React.createElement(Pane.Header, null, /*#__PURE__*/React.createElement(Typography, {
36743
+ style: "h2",
36744
+ weight: "semibold"
36745
+ }, t("labels.ruleSummary"))), /*#__PURE__*/React.createElement(Pane.Body, null, /*#__PURE__*/React.createElement("div", {
36746
+ className: "w-full"
36747
+ }, /*#__PURE__*/React.createElement("div", {
36748
+ className: "neeto-ui-rounded mb-4 border p-4"
36749
+ }, /*#__PURE__*/React.createElement("div", {
36750
+ className: "mb-3 flex flex-wrap justify-between gap-x-4"
36751
+ }, /*#__PURE__*/React.createElement(Typography, {
36752
+ className: "neeto-ui-text-gray-700 my-auto",
36753
+ style: "h5",
36754
+ weight: "semibold"
36755
+ }, t("common.name")), /*#__PURE__*/React.createElement("div", {
36756
+ className: "flex w-72 flex-wrap"
36757
+ }, /*#__PURE__*/React.createElement(Typography, {
36758
+ className: "neeto-ui-text-gray-800 my-auto",
36759
+ style: "h5",
36760
+ weight: "normal"
36761
+ }, ruleDetails.name.value))), /*#__PURE__*/React.createElement("hr", null), /*#__PURE__*/React.createElement("div", {
36762
+ className: "my-3 flex flex-wrap justify-between gap-x-2"
36763
+ }, /*#__PURE__*/React.createElement(Typography, {
36764
+ className: "neeto-ui-text-gray-700 my-auto",
36765
+ style: "h5",
36766
+ weight: "semibold"
36767
+ }, t("common.description")), /*#__PURE__*/React.createElement("div", {
36768
+ className: "flex w-72 flex-wrap"
36769
+ }, /*#__PURE__*/React.createElement(Typography, {
36770
+ className: "neeto-ui-text-gray-800 my-auto",
36771
+ style: "h5",
36772
+ weight: "normal"
36773
+ }, ruleDetails.description.value)))), /*#__PURE__*/React.createElement(EventsDetail, {
36774
+ conditions: ruleDetails.conditions,
36775
+ events: ruleDetails.events,
36776
+ performer: ruleDetails.performer
36777
+ }), /*#__PURE__*/React.createElement(ActionsDetail, {
36778
+ actions: ruleDetails.actions
36779
+ }))));
36780
+ };
36781
+
33898
36782
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
33899
36783
  try {
33900
36784
  var info = gen[key](arg);
@@ -71068,5 +73952,5 @@ function cov_2lkzw7diw1() {
71068
73952
  }
71069
73953
  cov_2lkzw7diw1();
71070
73954
 
71071
- export { Actions$1 as ActionForm, Conditions$1 as ConditionForm, NeetoRules as NeetoRulesForm, NeetoRules$2 as default };
73955
+ export { Actions$1 as ActionForm, Conditions$1 as ConditionForm, NeetoRules as NeetoRulesForm, RulePreview, NeetoRules$2 as default };
71072
73956
  //# sourceMappingURL=index.js.map