@sparrowengg/integrations-templates-frontend 1.9.84-beta.5 → 1.9.84-beta.7

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.
@@ -3,6 +3,7 @@ import Arrow from '../commons/icons/arrow.js';
3
3
  import { Mapping as Mapping$1 } from './components/mapping.js';
4
4
  import { surveySparrowURL } from '../commons/constants/index.js';
5
5
  import DraftModal from '../commons/components/draftModal.js';
6
+ import '../node_modules/dayjs/dayjs.min.js';
6
7
  import { ThemeProvider } from '../node_modules/@sparrowengg/twigs-react/dist/es/theme-provider/theme-provider.js';
7
8
  import { Box } from '../node_modules/@sparrowengg/twigs-react/dist/es/box/box.js';
8
9
  import { Flex } from '../node_modules/@sparrowengg/twigs-react/dist/es/flex/flex.js';
@@ -14,7 +15,34 @@ import { Button } from '../node_modules/@sparrowengg/twigs-react/dist/es/button/
14
15
  import { ChevronRightIcon } from '../node_modules/@sparrowengg/twigs-react-icons/dist/es/icons/chevron-right.js';
15
16
  import { IconButton } from '../node_modules/@sparrowengg/twigs-react/dist/es/button/icon-button.js';
16
17
  import { ArrowLeftIcon } from '../node_modules/@sparrowengg/twigs-react-icons/dist/es/icons/arrow-left.js';
18
+ import { Tooltip } from '../node_modules/@sparrowengg/twigs-react/dist/es/tooltip/tooltip.js';
19
+ import { FormInput } from '../node_modules/@sparrowengg/twigs-react/dist/es/input/form-input.js';
20
+ import { Checkbox } from '../node_modules/@sparrowengg/twigs-react/dist/es/checkbox/checkbox.js';
21
+ import { Switch } from '../node_modules/@sparrowengg/twigs-react/dist/es/switch/switch.js';
22
+ import { c as components } from '../node_modules/react-select/dist/index-a301f526.esm.js';
23
+ import { PlusIcon } from '../node_modules/@sparrowengg/twigs-react-icons/dist/es/icons/plus.js';
24
+ import { Chip } from '../node_modules/@sparrowengg/twigs-react/dist/es/chip/chip.js';
25
+ import { TickCircleFillIcon } from '../node_modules/@sparrowengg/twigs-react-icons/dist/es/icons/tick-circle-fill.js';
17
26
 
27
+ var __defProp = Object.defineProperty;
28
+ var __defProps = Object.defineProperties;
29
+ var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
30
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
31
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
32
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
33
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
34
+ var __spreadValues = (a, b) => {
35
+ for (var prop in b || (b = {}))
36
+ if (__hasOwnProp.call(b, prop))
37
+ __defNormalProp(a, prop, b[prop]);
38
+ if (__getOwnPropSymbols)
39
+ for (var prop of __getOwnPropSymbols(b)) {
40
+ if (__propIsEnum.call(b, prop))
41
+ __defNormalProp(a, prop, b[prop]);
42
+ }
43
+ return a;
44
+ };
45
+ var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
18
46
  const Mapping = ({
19
47
  havingTypeDropdown,
20
48
  onSaveMappingLoader,
@@ -38,9 +66,12 @@ const Mapping = ({
38
66
  onSaveHandler,
39
67
  editField,
40
68
  previousMappingHandler,
41
- draftHandler
69
+ draftHandler,
70
+ configuration
42
71
  }) => {
43
- const [previousMapping, setPreviousMapping] = useState(hasPreviousMapping != null ? hasPreviousMapping : false);
72
+ const [previousMapping, setPreviousMapping] = useState(
73
+ hasPreviousMapping != null ? hasPreviousMapping : false
74
+ );
44
75
  useEffect(() => {
45
76
  if (!!(editField == null ? void 0 : editField.id)) {
46
77
  setFields(editField.fieldValues);
@@ -82,7 +113,9 @@ const Mapping = ({
82
113
  accounts,
83
114
  events,
84
115
  actions,
85
- navigateMappingPage
116
+ navigateMappingPage,
117
+ configuration,
118
+ editFieldId: editField == null ? void 0 : editField.id
86
119
  }
87
120
  ) : /* @__PURE__ */ React__default.createElement(
88
121
  Mapping$1,
@@ -109,7 +142,9 @@ const EventSetup = ({
109
142
  accounts,
110
143
  events,
111
144
  actions,
112
- navigateMappingPage
145
+ navigateMappingPage,
146
+ configuration,
147
+ editFieldId
113
148
  }) => {
114
149
  useEffect(() => {
115
150
  if (actions == null ? void 0 : actions.value) {
@@ -126,13 +161,22 @@ const EventSetup = ({
126
161
  alignItems: "center",
127
162
  justifyContent: "center"
128
163
  },
129
- /* @__PURE__ */ React__default.createElement(Box, { css: { width: 488 } }, /* @__PURE__ */ React__default.createElement(Heading, { size: "h5" }, "Account Details"), /* @__PURE__ */ React__default.createElement(Flex, { gap: "$2", css: { marginTop: "$4" } }, /* @__PURE__ */ React__default.createElement(Text, { size: "sm", css: { color: "$neutral500" } }, "Survey Name:"), /* @__PURE__ */ React__default.createElement(Text, { size: "sm", weight: "medium", css: { color: "$neutral800" } }, surveyDetails.surveyName)), /* @__PURE__ */ React__default.createElement(Flex, { flexDirection: "column", gap: "$8", css: { marginTop: "$16" } }, (accounts == null ? void 0 : accounts.hasAccounts) && /* @__PURE__ */ React__default.createElement(Flex, { gap: "$2", flexDirection: "column" }, /* @__PURE__ */ React__default.createElement(FormLabel, { size: "xs", css: { fontWeight: "$5" } }, "Choose Account"), /* @__PURE__ */ React__default.createElement(
164
+ /* @__PURE__ */ React__default.createElement(Box, { css: { width: 488 } }, configuration.hasConfiguration ? /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(
165
+ ConfigurationSetup,
166
+ {
167
+ configuration,
168
+ surveyName: surveyDetails.surveyName,
169
+ editField: editFieldId
170
+ }
171
+ )) : /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, /* @__PURE__ */ React__default.createElement(Heading, { size: "h5" }, configuration == null ? void 0 : configuration.title), /* @__PURE__ */ React__default.createElement(Flex, { gap: "$2", css: { marginTop: "$4" } }, /* @__PURE__ */ React__default.createElement(Text, { size: "sm", css: { color: "$neutral500" } }, "Survey Name:"), /* @__PURE__ */ React__default.createElement(Text, { size: "sm", weight: "medium", css: { color: "$neutral800" } }, surveyDetails.surveyName)), /* @__PURE__ */ React__default.createElement(Flex, { flexDirection: "column", gap: "$8", css: { marginTop: "$16" } }, (accounts == null ? void 0 : accounts.hasAccounts) && /* @__PURE__ */ React__default.createElement(Flex, { gap: "$2", flexDirection: "column" }, /* @__PURE__ */ React__default.createElement(FormLabel, { size: "xs", css: { fontWeight: "$5" } }, "Choose Account"), /* @__PURE__ */ React__default.createElement(
130
172
  Select,
131
173
  {
132
174
  value: accounts.value,
133
175
  options: accounts.options,
134
176
  placeholder: "",
135
- onChange: (value) => accounts.onChangeHandler(value),
177
+ onChange: (value) => accounts.onChangeHandler(
178
+ value
179
+ ),
136
180
  size: "lg"
137
181
  }
138
182
  )), (events == null ? void 0 : events.hasEvents) && /* @__PURE__ */ React__default.createElement(Flex, { gap: "$2", flexDirection: "column" }, /* @__PURE__ */ React__default.createElement(FormLabel, { size: "xs", css: { fontWeight: "$5" } }, "Choose Object"), /* @__PURE__ */ React__default.createElement(
@@ -141,7 +185,9 @@ const EventSetup = ({
141
185
  options: events.options,
142
186
  value: events == null ? void 0 : events.value,
143
187
  placeholder: "",
144
- onChange: (value) => events.onChangeHandler(value),
188
+ onChange: (value) => events.onChangeHandler(
189
+ value
190
+ ),
145
191
  size: "lg"
146
192
  }
147
193
  )), (actions == null ? void 0 : actions.hasActions) && /* @__PURE__ */ React__default.createElement(Flex, { gap: "$2", flexDirection: "column" }, /* @__PURE__ */ React__default.createElement(FormLabel, { size: "xs", css: { fontWeight: "$5" } }, "Choose Action"), /* @__PURE__ */ React__default.createElement(
@@ -151,13 +197,15 @@ const EventSetup = ({
151
197
  options: actions.options,
152
198
  value: actions == null ? void 0 : actions.value,
153
199
  placeholder: "",
154
- onChange: (value) => actions.onChangeHandler(value)
200
+ onChange: (value) => actions.onChangeHandler(
201
+ value
202
+ )
155
203
  }
156
- ))), /* @__PURE__ */ React__default.createElement(
204
+ )))), /* @__PURE__ */ React__default.createElement(
157
205
  Button,
158
206
  {
159
207
  size: "lg",
160
- disabled: !actions.value || !events.value,
208
+ disabled: configuration.hasConfiguration ? false : !actions.value || !events.value,
161
209
  rightIcon: /* @__PURE__ */ React__default.createElement(ChevronRightIcon, null),
162
210
  css: { marginTop: "$16" },
163
211
  onClick: () => navigateMappingPage()
@@ -215,14 +263,21 @@ const MappingHeader = ({
215
263
  padding: "$8 $12"
216
264
  }
217
265
  },
218
- isDraftModalOpen && /* @__PURE__ */ React__default.createElement(DraftModal, { onSaveHandler: async () => {
219
- await draftHandler("MAPPING", editFieldId == null ? void 0 : editFieldId.toString());
220
- setIsDraftModalOpen(false);
221
- await previousMappingHandler();
222
- }, onCloseHandler: () => setIsDraftModalOpen(false), onCancel: async () => {
223
- await previousMappingHandler();
224
- setIsDraftModalOpen(false);
225
- } }),
266
+ isDraftModalOpen && /* @__PURE__ */ React__default.createElement(
267
+ DraftModal,
268
+ {
269
+ onSaveHandler: async () => {
270
+ await draftHandler("MAPPING", editFieldId == null ? void 0 : editFieldId.toString());
271
+ setIsDraftModalOpen(false);
272
+ await previousMappingHandler();
273
+ },
274
+ onCloseHandler: () => setIsDraftModalOpen(false),
275
+ onCancel: async () => {
276
+ await previousMappingHandler();
277
+ setIsDraftModalOpen(false);
278
+ }
279
+ }
280
+ ),
226
281
  /* @__PURE__ */ React__default.createElement(
227
282
  Flex,
228
283
  {
@@ -230,7 +285,15 @@ const MappingHeader = ({
230
285
  alignItems: "center",
231
286
  css: { visibility: hasPreviousMapping ? "visible" : "hidden" }
232
287
  },
233
- /* @__PURE__ */ React__default.createElement(IconButton, { onClick: () => setIsDraftModalOpen(true), color: "default", icon: /* @__PURE__ */ React__default.createElement(ArrowLeftIcon, null), size: "lg" }),
288
+ /* @__PURE__ */ React__default.createElement(
289
+ IconButton,
290
+ {
291
+ onClick: () => previousMappingHandler(),
292
+ color: "default",
293
+ icon: /* @__PURE__ */ React__default.createElement(ArrowLeftIcon, null),
294
+ size: "lg"
295
+ }
296
+ ),
234
297
  /* @__PURE__ */ React__default.createElement(Heading, { size: "h6" }, editFieldId ? "Edit Mapping" : "New Mapping")
235
298
  ),
236
299
  /* @__PURE__ */ React__default.createElement(
@@ -280,6 +343,345 @@ const MappingHeader = ({
280
343
  )
281
344
  );
282
345
  };
346
+ const ConfigurationSetup = ({
347
+ configuration,
348
+ surveyName,
349
+ editField
350
+ }) => {
351
+ var _a;
352
+ return /* @__PURE__ */ React__default.createElement(Box, { css: { maxWidth: 488, width: "100%" } }, /* @__PURE__ */ React__default.createElement(Heading, { size: "h5" }, configuration == null ? void 0 : configuration.title), /* @__PURE__ */ React__default.createElement(Flex, { gap: "$2", css: { marginTop: "$4" } }, /* @__PURE__ */ React__default.createElement(Text, { size: "sm", css: { color: "$neutral500" } }, "Survey Name:"), /* @__PURE__ */ React__default.createElement(
353
+ Tooltip,
354
+ {
355
+ content: (surveyName == null ? void 0 : surveyName.length) > 25 ? surveyName : "",
356
+ css: {
357
+ zIndex: "9999999 !important",
358
+ fontFamily: "DM Sans !important"
359
+ }
360
+ },
361
+ /* @__PURE__ */ React__default.createElement(Box, null, /* @__PURE__ */ React__default.createElement(
362
+ Text,
363
+ {
364
+ size: "sm",
365
+ weight: "medium",
366
+ truncate: true,
367
+ css: { color: "$neutral800", maxWidth: "270px" }
368
+ },
369
+ surveyName
370
+ ))
371
+ )), /* @__PURE__ */ React__default.createElement(
372
+ Flex,
373
+ {
374
+ flexDirection: "column",
375
+ gap: "$8",
376
+ css: {
377
+ marginTop: "$12",
378
+ "& label": {
379
+ color: "$neutral800"
380
+ }
381
+ }
382
+ },
383
+ (_a = configuration.configurationFields) == null ? void 0 : _a.map((field) => {
384
+ return /* @__PURE__ */ React__default.createElement(
385
+ Configuration,
386
+ {
387
+ field,
388
+ configuredFields: configuration.configuredFields
389
+ }
390
+ );
391
+ })
392
+ ));
393
+ };
394
+ const Configuration = ({
395
+ field,
396
+ configuredFields,
397
+ responseImportType = null
398
+ }) => {
399
+ var _a, _b, _c, _d;
400
+ let fieldValue = null;
401
+ fieldValue = (_b = (_a = configuredFields == null ? void 0 : configuredFields[field.id]) == null ? void 0 : _a.value) != null ? _b : null;
402
+ const [error, setError] = useState({
403
+ errorMessage: "",
404
+ error: false,
405
+ id: null
406
+ });
407
+ switch (field.fieldType) {
408
+ case "switch":
409
+ return /* @__PURE__ */ React__default.createElement(
410
+ Flex,
411
+ {
412
+ gap: "$4",
413
+ alignItems: "center",
414
+ css: {
415
+ marginBlockStart: "$12",
416
+ borderTop: "$borderWidths$xs solid $neutral200",
417
+ paddingTop: "$16"
418
+ }
419
+ },
420
+ /* @__PURE__ */ React__default.createElement(
421
+ Switch,
422
+ {
423
+ disabled: field == null ? void 0 : field.disabled,
424
+ size: "sm",
425
+ checked: field == null ? void 0 : field.value,
426
+ onChange: (value) => field.onChangeHandler({
427
+ id: field.id,
428
+ value
429
+ })
430
+ }
431
+ ),
432
+ /* @__PURE__ */ React__default.createElement(Text, { size: "md", weight: "regular", css: { color: "$neutral900" } }, field.label)
433
+ );
434
+ case "checkbox":
435
+ return /* @__PURE__ */ React__default.createElement(Flex, { flexDirection: "column", alignItems: "start", gap: "$4" }, /* @__PURE__ */ React__default.createElement(Flex, { gap: "$4", alignItems: "center" }, /* @__PURE__ */ React__default.createElement(
436
+ Checkbox,
437
+ {
438
+ disabled: field == null ? void 0 : field.disabled,
439
+ checked: !!fieldValue,
440
+ onChange: (value) => field.onChangeHandler({
441
+ id: field.id,
442
+ value
443
+ })
444
+ }
445
+ ), /* @__PURE__ */ React__default.createElement(Text, { size: "sm", weight: "regular", css: { color: "$neutral900" } }, field.label)), /* @__PURE__ */ React__default.createElement(Text, { size: "sm", weight: "regular", css: { color: "$neutral500" } }, field.value ? field.ifChecked() : field.ifUnchecked(responseImportType)));
446
+ case "input":
447
+ return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, (field == null ? void 0 : field.id) === "spreadsheet" ? /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, ((_c = configuredFields == null ? void 0 : configuredFields.action) == null ? void 0 : _c.value) ? /* @__PURE__ */ React__default.createElement(
448
+ Box,
449
+ {
450
+ className: "dm-sans",
451
+ css: {
452
+ label: {
453
+ fontSize: "$xs !important"
454
+ }
455
+ }
456
+ },
457
+ /* @__PURE__ */ React__default.createElement(
458
+ FormInput,
459
+ __spreadProps(__spreadValues(__spreadProps(__spreadValues({
460
+ disabled: field == null ? void 0 : field.disabled
461
+ }, error.id === field.id && {
462
+ error: error.errorMessage,
463
+ errorBorder: error.error
464
+ }), {
465
+ label: field.label,
466
+ value: typeof fieldValue === "object" ? "" : fieldValue || "",
467
+ size: "lg"
468
+ }), field.pattern && {
469
+ pattern: field.pattern
470
+ }), {
471
+ onChange: (event) => {
472
+ if (field == null ? void 0 : field.pattern) {
473
+ const pattern = new RegExp(field.pattern);
474
+ if (!pattern.test(event.currentTarget.value) && event.currentTarget.value !== "") {
475
+ setError({
476
+ errorMessage: field.errorMessage,
477
+ error: true,
478
+ id: field.id
479
+ });
480
+ } else {
481
+ setError({
482
+ errorMessage: "",
483
+ error: false,
484
+ id: null
485
+ });
486
+ }
487
+ field.onChangeHandler({
488
+ id: field.id,
489
+ value: event.currentTarget.value
490
+ });
491
+ } else {
492
+ field.onChangeHandler({
493
+ id: field.id,
494
+ value: event.currentTarget.value
495
+ });
496
+ }
497
+ }
498
+ })
499
+ )
500
+ ) : null) : /* @__PURE__ */ React__default.createElement(
501
+ Box,
502
+ {
503
+ className: "dm-sans",
504
+ css: {
505
+ label: {
506
+ fontSize: "$xs !important"
507
+ }
508
+ }
509
+ },
510
+ /* @__PURE__ */ React__default.createElement(
511
+ FormInput,
512
+ __spreadProps(__spreadValues(__spreadProps(__spreadValues({
513
+ disabled: field == null ? void 0 : field.disabled
514
+ }, error.id === field.id && {
515
+ error: error.errorMessage,
516
+ errorBorder: error.error
517
+ }), {
518
+ label: field.label,
519
+ value: typeof fieldValue === "object" ? "" : fieldValue || "",
520
+ size: "lg"
521
+ }), field.pattern && {
522
+ pattern: field.pattern
523
+ }), {
524
+ onChange: (event) => {
525
+ if (field == null ? void 0 : field.pattern) {
526
+ const pattern = new RegExp(field.pattern);
527
+ if (!pattern.test(event.currentTarget.value) && event.currentTarget.value !== "") {
528
+ setError({
529
+ errorMessage: field.errorMessage,
530
+ error: true,
531
+ id: field.id
532
+ });
533
+ } else {
534
+ setError({
535
+ errorMessage: "",
536
+ error: false,
537
+ id: null
538
+ });
539
+ }
540
+ field.onChangeHandler({
541
+ id: field.id,
542
+ value: event.currentTarget.value
543
+ });
544
+ } else {
545
+ field.onChangeHandler({
546
+ id: field.id,
547
+ value: event.currentTarget.value
548
+ });
549
+ }
550
+ }
551
+ })
552
+ )
553
+ ));
554
+ default:
555
+ return /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, field.id === "spreadsheet" ? /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, ((_d = configuredFields == null ? void 0 : configuredFields.action) == null ? void 0 : _d.value) ? /* @__PURE__ */ React__default.createElement(
556
+ Flex,
557
+ {
558
+ gap: "$2",
559
+ flexDirection: "column",
560
+ css: {
561
+ cursor: "pointer !important",
562
+ ".twigs-select__indicator": {
563
+ width: "14px !important",
564
+ color: "#848484 !important"
565
+ }
566
+ }
567
+ },
568
+ /* @__PURE__ */ React__default.createElement(FormLabel, { size: "xs", css: { fontWeight: "$5" } }, field.label),
569
+ /* @__PURE__ */ React__default.createElement(CustomAddNewSelect, { field })
570
+ ) : null) : /* @__PURE__ */ React__default.createElement(
571
+ Flex,
572
+ {
573
+ gap: "$2",
574
+ flexDirection: "column",
575
+ css: {
576
+ cursor: "pointer !important",
577
+ ".twigs-select__indicator": {
578
+ width: "14px !important",
579
+ color: "#848484 !important"
580
+ }
581
+ }
582
+ },
583
+ /* @__PURE__ */ React__default.createElement(FormLabel, { size: "xs", css: { fontWeight: "$5" } }, field.label),
584
+ /* @__PURE__ */ React__default.createElement(CustomAddNewSelect, { field })
585
+ ));
586
+ }
587
+ };
588
+ const CustomAddNewSelect = ({ field }) => {
589
+ return /* @__PURE__ */ React__default.createElement(
590
+ Select,
591
+ {
592
+ isDisabled: field == null ? void 0 : field.disabled,
593
+ placeholder: "",
594
+ size: "lg",
595
+ css: {
596
+ cursor: "pointer"
597
+ },
598
+ components: {
599
+ Option: CustomShareOption,
600
+ SingleValue: CustomSingleValue
601
+ },
602
+ styles: {
603
+ singleValue: (provided, state) => __spreadProps(__spreadValues({}, provided), {
604
+ display: "flex",
605
+ alignItems: "center",
606
+ cursor: "pointer"
607
+ })
608
+ },
609
+ value: field.value,
610
+ onChange: (value) => {
611
+ var _a;
612
+ field.onChangeHandler({
613
+ id: (_a = field == null ? void 0 : field.id) != null ? _a : field == null ? void 0 : field.label,
614
+ value
615
+ });
616
+ },
617
+ options: field.options
618
+ }
619
+ );
620
+ };
621
+ const CustomShareOption = (props) => {
622
+ if (props.data.value === "ADD_NEW") {
623
+ return /* @__PURE__ */ React__default.createElement(
624
+ Tooltip,
625
+ {
626
+ content: props.data.tooltip || "",
627
+ css: {
628
+ zIndex: 999999999,
629
+ fontFamily: "DM Sans !important"
630
+ }
631
+ },
632
+ /* @__PURE__ */ React__default.createElement(Box, null, /* @__PURE__ */ React__default.createElement(components.Option, __spreadValues({}, props), /* @__PURE__ */ React__default.createElement(
633
+ Flex,
634
+ {
635
+ justifyContent: "center",
636
+ alignItems: "center",
637
+ css: { cursor: "pointer", zIndex: 999999999 }
638
+ },
639
+ /* @__PURE__ */ React__default.createElement(
640
+ Flex,
641
+ {
642
+ gap: "$2",
643
+ alignItems: "center",
644
+ css: {
645
+ color: "$primary500",
646
+ fontSize: "$sm",
647
+ fontWeight: "$7"
648
+ }
649
+ },
650
+ /* @__PURE__ */ React__default.createElement(PlusIcon, { size: 16, color: "#4A9CA6" }),
651
+ "Add Account"
652
+ )
653
+ )))
654
+ );
655
+ } else {
656
+ return /* @__PURE__ */ React__default.createElement(components.Option, __spreadValues({}, props), /* @__PURE__ */ React__default.createElement(
657
+ Flex,
658
+ {
659
+ css: { cursor: "pointer", zIndex: 999999999 },
660
+ alignItems: "center",
661
+ justifyContent: "space-between",
662
+ gap: "$2"
663
+ },
664
+ /* @__PURE__ */ React__default.createElement(Text, { size: "sm" }, props.label),
665
+ " ",
666
+ props.data.isAddonAccount && /* @__PURE__ */ React__default.createElement(
667
+ Chip,
668
+ {
669
+ color: "primary",
670
+ size: "sm",
671
+ leftElement: /* @__PURE__ */ React__default.createElement(TickCircleFillIcon, null)
672
+ },
673
+ "In Use (Add-on)"
674
+ )
675
+ ));
676
+ }
677
+ };
678
+ const CustomSingleValue = (props) => {
679
+ if (props.data.value === "ADD_NEW") {
680
+ return /* @__PURE__ */ React__default.createElement(components.SingleValue, __spreadValues({}, props), /* @__PURE__ */ React__default.createElement(Flex, { css: { cursor: "pointer" }, alignItems: "center", gap: "$2" }, /* @__PURE__ */ React__default.createElement(PlusIcon, { size: 16 }), /* @__PURE__ */ React__default.createElement(Text, { size: "sm" }, props.data.label)));
681
+ } else {
682
+ return /* @__PURE__ */ React__default.createElement(components.SingleValue, __spreadValues({}, props), /* @__PURE__ */ React__default.createElement(Flex, { css: { cursor: "pointer" }, alignItems: "center", gap: "$2" }, /* @__PURE__ */ React__default.createElement(Text, { size: "sm" }, props.data.label)));
683
+ }
684
+ };
283
685
 
284
686
  export { Mapping };
285
687
  //# sourceMappingURL=index.js.map