@planningcenter/chat-react-native 4.4.1-qa-staging.29 → 4.4.1-qa-staging.31

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.
Files changed (82) hide show
  1. package/build/components/conversation/message_list.d.ts.map +1 -1
  2. package/build/components/conversation/message_list.js +155 -123
  3. package/build/components/conversation/message_list.js.map +1 -1
  4. package/build/components/conversations/conversations.d.ts.map +1 -1
  5. package/build/components/conversations/conversations.js +1 -0
  6. package/build/components/conversations/conversations.js.map +1 -1
  7. package/build/components/display/filter_dropdown.d.ts +16 -0
  8. package/build/components/display/filter_dropdown.d.ts.map +1 -1
  9. package/build/components/display/filter_dropdown.js +103 -57
  10. package/build/components/display/filter_dropdown.js.map +1 -1
  11. package/build/components/display/keyboard_scroll_view.d.ts.map +1 -1
  12. package/build/components/display/keyboard_scroll_view.js +1 -0
  13. package/build/components/display/keyboard_scroll_view.js.map +1 -1
  14. package/build/hooks/direct_messages/use_direct_message_candidates.d.ts +3 -1
  15. package/build/hooks/direct_messages/use_direct_message_candidates.d.ts.map +1 -1
  16. package/build/hooks/direct_messages/use_direct_message_candidates.js +42 -29
  17. package/build/hooks/direct_messages/use_direct_message_candidates.js.map +1 -1
  18. package/build/navigation/index.d.ts.map +1 -1
  19. package/build/navigation/index.js +11 -3
  20. package/build/navigation/index.js.map +1 -1
  21. package/build/screens/conversation_details_screen.d.ts.map +1 -1
  22. package/build/screens/conversation_details_screen.js +1 -0
  23. package/build/screens/conversation_details_screen.js.map +1 -1
  24. package/build/screens/conversation_select_recipients/conversation_new_entry_screen.d.ts.map +1 -1
  25. package/build/screens/conversation_select_recipients/conversation_new_entry_screen.js +1 -0
  26. package/build/screens/conversation_select_recipients/conversation_new_entry_screen.js.map +1 -1
  27. package/build/screens/conversation_select_recipients/conversation_select_direct_message_recipients_screen.d.ts.map +1 -1
  28. package/build/screens/conversation_select_recipients/conversation_select_direct_message_recipients_screen.js +409 -308
  29. package/build/screens/conversation_select_recipients/conversation_select_direct_message_recipients_screen.js.map +1 -1
  30. package/build/screens/conversation_select_recipients/conversation_select_group_recipients_screen.d.ts.map +1 -1
  31. package/build/screens/conversation_select_recipients/conversation_select_group_recipients_screen.js +1 -0
  32. package/build/screens/conversation_select_recipients/conversation_select_group_recipients_screen.js.map +1 -1
  33. package/build/screens/conversation_select_recipients/conversation_select_teams_i_lead_recipients_screen.d.ts.map +1 -1
  34. package/build/screens/conversation_select_recipients/conversation_select_teams_i_lead_recipients_screen.js +1 -0
  35. package/build/screens/conversation_select_recipients/conversation_select_teams_i_lead_recipients_screen.js.map +1 -1
  36. package/build/screens/conversations/components/filter_dropdown_list_header_component.d.ts.map +1 -1
  37. package/build/screens/conversations/components/filter_dropdown_list_header_component.js +146 -81
  38. package/build/screens/conversations/components/filter_dropdown_list_header_component.js.map +1 -1
  39. package/build/screens/get_help_screen.js +56 -62
  40. package/build/screens/get_help_screen.js.map +1 -1
  41. package/build/screens/group_notification_settings_screen.js +3 -2
  42. package/build/screens/group_notification_settings_screen.js.map +1 -1
  43. package/build/screens/notification_settings_screen.d.ts.map +1 -1
  44. package/build/screens/notification_settings_screen.js +1 -0
  45. package/build/screens/notification_settings_screen.js.map +1 -1
  46. package/build/screens/preferred_app_selection_screen.js +45 -39
  47. package/build/screens/preferred_app_selection_screen.js.map +1 -1
  48. package/build/screens/search/components/search_results_list.d.ts +4 -1
  49. package/build/screens/search/components/search_results_list.d.ts.map +1 -1
  50. package/build/screens/search/components/search_results_list.js +176 -138
  51. package/build/screens/search/components/search_results_list.js.map +1 -1
  52. package/build/screens/search/search_screen.d.ts.map +1 -1
  53. package/build/screens/search/search_screen.js +21 -28
  54. package/build/screens/search/search_screen.js.map +1 -1
  55. package/build/screens/settings_screen.d.ts.map +1 -1
  56. package/build/screens/settings_screen.js +7 -6
  57. package/build/screens/settings_screen.js.map +1 -1
  58. package/package.json +3 -3
  59. package/src/components/conversation/__tests__/message_list.test.tsx +4 -0
  60. package/src/components/conversation/message_list.tsx +6 -0
  61. package/src/components/conversations/conversations.tsx +1 -0
  62. package/src/components/display/filter_dropdown.tsx +50 -18
  63. package/src/components/display/keyboard_scroll_view.tsx +1 -0
  64. package/src/hooks/direct_messages/use_direct_message_candidates.ts +2 -2
  65. package/src/navigation/index.tsx +11 -2
  66. package/src/screens/conversation_details_screen.tsx +1 -0
  67. package/src/screens/conversation_select_recipients/__tests__/conversation_select_direct_message_recipients_screen.test.tsx +83 -0
  68. package/src/screens/conversation_select_recipients/conversation_new_entry_screen.tsx +4 -1
  69. package/src/screens/conversation_select_recipients/conversation_select_direct_message_recipients_screen.tsx +104 -69
  70. package/src/screens/conversation_select_recipients/conversation_select_group_recipients_screen.tsx +1 -0
  71. package/src/screens/conversation_select_recipients/conversation_select_teams_i_lead_recipients_screen.tsx +1 -0
  72. package/src/screens/conversations/components/__tests__/filter_dropdown_list_header_component.test.tsx +0 -21
  73. package/src/screens/conversations/components/filter_dropdown_list_header_component.tsx +39 -8
  74. package/src/screens/get_help_screen.tsx +4 -4
  75. package/src/screens/group_notification_settings_screen.tsx +3 -3
  76. package/src/screens/notification_settings_screen.tsx +1 -0
  77. package/src/screens/preferred_app_selection_screen.tsx +4 -4
  78. package/src/screens/search/__tests__/search_screen.test.tsx +5 -7
  79. package/src/screens/search/components/__tests__/search_results_list.test.tsx +6 -2
  80. package/src/screens/search/components/search_results_list.tsx +29 -8
  81. package/src/screens/search/search_screen.tsx +8 -18
  82. package/src/screens/settings_screen.tsx +25 -25
@@ -15,10 +15,10 @@ import { useFindOrCreateDirectMessageConversation } from '../../hooks/direct_mes
15
15
  import { useDebouncedSearchTerm } from '../../hooks/use_debounced_search_term';
16
16
  import { availableFeatures, useFeatures } from '../../hooks/use_features';
17
17
  import { ResultsHeading } from './components/results_heading';
18
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
18
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
19
19
  const MAX_RECIPIENTS = 9;
20
20
  export function ConversationSelectDirectMessageRecipientsScreen(t0) {
21
- const $ = _c(55);
21
+ const $ = _c(51);
22
22
  const {
23
23
  route
24
24
  } = t0;
@@ -205,99 +205,85 @@ export function ConversationSelectDirectMessageRecipientsScreen(t0) {
205
205
  t14 = $[27];
206
206
  }
207
207
  let t15;
208
- if ($[28] !== styles.errorBanner) {
209
- t15 = /*#__PURE__*/_jsx(Banner, {
210
- appearance: "error",
211
- description: "Couldn't load people right now. Try again.",
212
- style: styles.errorBanner
208
+ if ($[28] !== t12 || $[29] !== t14) {
209
+ t15 = /*#__PURE__*/_jsxs(_Fragment, {
210
+ children: [t12, t14]
213
211
  });
214
- $[28] = styles.errorBanner;
215
- $[29] = t15;
212
+ $[28] = t12;
213
+ $[29] = t14;
214
+ $[30] = t15;
216
215
  } else {
217
- t15 = $[29];
216
+ t15 = $[30];
218
217
  }
219
218
  let t16;
220
- if ($[30] !== debouncedTerm || $[31] !== selectPerson || $[32] !== selectedPeople) {
219
+ if ($[31] !== debouncedTerm || $[32] !== selectPerson || $[33] !== selectedPeople || $[34] !== t15) {
221
220
  t16 = /*#__PURE__*/_jsx(CandidateResults, {
222
221
  term: debouncedTerm,
223
222
  selectedPeople: selectedPeople,
224
- onSelect: selectPerson
223
+ onSelect: selectPerson,
224
+ header: t15
225
225
  });
226
- $[30] = debouncedTerm;
227
- $[31] = selectPerson;
228
- $[32] = selectedPeople;
229
- $[33] = t16;
226
+ $[31] = debouncedTerm;
227
+ $[32] = selectPerson;
228
+ $[33] = selectedPeople;
229
+ $[34] = t15;
230
+ $[35] = t16;
230
231
  } else {
231
- t16 = $[33];
232
+ t16 = $[35];
232
233
  }
233
234
  let t17;
234
- if ($[34] !== debouncedTerm || $[35] !== t15 || $[36] !== t16) {
235
- t17 = /*#__PURE__*/_jsx(ComponentErrorBoundary, {
236
- fallback: t15,
237
- children: t16
238
- }, debouncedTerm);
239
- $[34] = debouncedTerm;
240
- $[35] = t15;
241
- $[36] = t16;
242
- $[37] = t17;
243
- } else {
244
- t17 = $[37];
245
- }
246
- let t18;
247
- if ($[38] !== styles.candidateResultsContainer || $[39] !== t17) {
248
- t18 = /*#__PURE__*/_jsx(View, {
235
+ if ($[36] !== styles.candidateResultsContainer || $[37] !== t16) {
236
+ t17 = /*#__PURE__*/_jsx(View, {
249
237
  style: styles.candidateResultsContainer,
250
- children: t17
238
+ children: t16
251
239
  });
252
- $[38] = styles.candidateResultsContainer;
253
- $[39] = t17;
254
- $[40] = t18;
240
+ $[36] = styles.candidateResultsContainer;
241
+ $[37] = t16;
242
+ $[38] = t17;
255
243
  } else {
256
- t18 = $[40];
244
+ t17 = $[38];
257
245
  }
258
- const t19 = selectedPeople.size === 0 || validationPending || warnings.length > 0 || isFinding;
259
- const t20 = validationPending || isFinding;
260
- let t21;
261
- if ($[41] !== findOrCreateConversation || $[42] !== recipientIds) {
262
- t21 = () => findOrCreateConversation(recipientIds);
263
- $[41] = findOrCreateConversation;
264
- $[42] = recipientIds;
265
- $[43] = t21;
246
+ const t18 = selectedPeople.size === 0 || validationPending || warnings.length > 0 || isFinding;
247
+ const t19 = validationPending || isFinding;
248
+ let t20;
249
+ if ($[39] !== findOrCreateConversation || $[40] !== recipientIds) {
250
+ t20 = () => findOrCreateConversation(recipientIds);
251
+ $[39] = findOrCreateConversation;
252
+ $[40] = recipientIds;
253
+ $[41] = t20;
266
254
  } else {
267
- t21 = $[43];
255
+ t20 = $[41];
268
256
  }
269
- let t22;
270
- if ($[44] !== buttonText || $[45] !== t19 || $[46] !== t20 || $[47] !== t21 || $[48] !== warnings) {
271
- t22 = /*#__PURE__*/_jsx(ActionButton, {
257
+ let t21;
258
+ if ($[42] !== buttonText || $[43] !== t18 || $[44] !== t19 || $[45] !== t20 || $[46] !== warnings) {
259
+ t21 = /*#__PURE__*/_jsx(ActionButton, {
272
260
  title: buttonText,
273
- disabled: t19,
274
- loading: t20,
275
- onPress: t21,
261
+ disabled: t18,
262
+ loading: t19,
263
+ onPress: t20,
276
264
  warnings: warnings
277
265
  });
278
- $[44] = buttonText;
279
- $[45] = t19;
280
- $[46] = t20;
266
+ $[42] = buttonText;
267
+ $[43] = t18;
268
+ $[44] = t19;
269
+ $[45] = t20;
270
+ $[46] = warnings;
281
271
  $[47] = t21;
282
- $[48] = warnings;
283
- $[49] = t22;
284
272
  } else {
285
- t22 = $[49];
273
+ t21 = $[47];
286
274
  }
287
- let t23;
288
- if ($[50] !== t12 || $[51] !== t14 || $[52] !== t18 || $[53] !== t22) {
289
- t23 = /*#__PURE__*/_jsxs(KeyboardView, {
290
- children: [t12, t14, t18, t22]
275
+ let t22;
276
+ if ($[48] !== t17 || $[49] !== t21) {
277
+ t22 = /*#__PURE__*/_jsxs(KeyboardView, {
278
+ children: [t17, t21]
291
279
  });
292
- $[50] = t12;
293
- $[51] = t14;
294
- $[52] = t18;
295
- $[53] = t22;
296
- $[54] = t23;
280
+ $[48] = t17;
281
+ $[49] = t21;
282
+ $[50] = t22;
297
283
  } else {
298
- t23 = $[54];
284
+ t22 = $[50];
299
285
  }
300
- return t23;
286
+ return t22;
301
287
  }
302
288
  function _temp(person) {
303
289
  return [person.id, {
@@ -523,227 +509,312 @@ function PersonChip(t0) {
523
509
  return t8;
524
510
  }
525
511
  function CandidateResults(t0) {
526
- const $ = _c(45);
512
+ const $ = _c(60);
527
513
  const {
528
514
  term,
529
515
  selectedPeople,
530
- onSelect
516
+ onSelect,
517
+ header
531
518
  } = t0;
532
519
  const styles = useStyles();
520
+ let t1;
521
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
522
+ t1 = {
523
+ throwOnError: false
524
+ };
525
+ $[0] = t1;
526
+ } else {
527
+ t1 = $[0];
528
+ }
533
529
  const {
534
530
  data,
535
- isFetching
536
- } = useDirectMessageCandidates(term);
531
+ isFetching,
532
+ isError
533
+ } = useDirectMessageCandidates(term, t1);
537
534
  const {
538
535
  groups,
539
536
  teams,
540
537
  resultsDescription
541
538
  } = useDirectMessageAffiliations();
542
- if (term.length < 1) {
543
- if (selectedPeople.size > 0) {
544
- return null;
545
- }
546
- let t1;
547
- if ($[0] !== styles.emptyStateIcon) {
548
- t1 = /*#__PURE__*/_jsx(Icon, {
549
- name: "churchCenter.people",
550
- size: 40,
551
- style: styles.emptyStateIcon
552
- });
553
- $[0] = styles.emptyStateIcon;
554
- $[1] = t1;
555
- } else {
556
- t1 = $[1];
557
- }
558
- let t2;
559
- if ($[2] !== styles.emptyStateTitle) {
560
- t2 = /*#__PURE__*/_jsx(Text, {
561
- style: styles.emptyStateTitle,
562
- children: "Search for people to direct message"
563
- });
564
- $[2] = styles.emptyStateTitle;
565
- $[3] = t2;
566
- } else {
567
- t2 = $[3];
568
- }
569
- let t3;
570
- if ($[4] !== styles.emptyStateSubtitle) {
571
- t3 = /*#__PURE__*/_jsx(Text, {
572
- variant: "secondary",
573
- style: styles.emptyStateSubtitle,
574
- children: "Start a conversation with people in your groups and teams."
575
- });
576
- $[4] = styles.emptyStateSubtitle;
577
- $[5] = t3;
578
- } else {
579
- t3 = $[5];
580
- }
539
+ let t2;
540
+ if ($[1] !== data?.data) {
541
+ t2 = data?.data ?? [];
542
+ $[1] = data?.data;
543
+ $[2] = t2;
544
+ } else {
545
+ t2 = $[2];
546
+ }
547
+ let t3;
548
+ if ($[3] !== selectedPeople || $[4] !== t2) {
581
549
  let t4;
582
- if ($[6] !== styles.emptyState || $[7] !== t1 || $[8] !== t2 || $[9] !== t3) {
583
- t4 = /*#__PURE__*/_jsxs(View, {
584
- style: styles.emptyState,
585
- children: [t1, t2, t3]
586
- });
587
- $[6] = styles.emptyState;
588
- $[7] = t1;
589
- $[8] = t2;
590
- $[9] = t3;
591
- $[10] = t4;
550
+ if ($[6] !== selectedPeople) {
551
+ t4 = c => !selectedPeople.has(c.id);
552
+ $[6] = selectedPeople;
553
+ $[7] = t4;
592
554
  } else {
593
- t4 = $[10];
555
+ t4 = $[7];
594
556
  }
595
- return t4;
557
+ t3 = t2.filter(t4);
558
+ $[3] = selectedPeople;
559
+ $[4] = t2;
560
+ $[5] = t3;
561
+ } else {
562
+ t3 = $[5];
596
563
  }
564
+ const unselectedCandidates = t3;
565
+ const hasTruncated = (data?.meta.totalCount ?? 0) > (data?.data.length ?? 0);
597
566
  const isAtLimit = selectedPeople.size >= MAX_RECIPIENTS;
598
- if (isAtLimit) {
599
- let t1;
600
- if ($[11] !== styles.emptyStateSubtitle) {
601
- t1 = /*#__PURE__*/_jsxs(Text, {
602
- variant: "secondary",
603
- style: styles.emptyStateSubtitle,
604
- children: ["You can add up to ", MAX_RECIPIENTS, " people to a direct message."]
605
- });
606
- $[11] = styles.emptyStateSubtitle;
607
- $[12] = t1;
608
- } else {
609
- t1 = $[12];
567
+ const showsResults = term.length >= 1 && !isAtLimit && !isError && unselectedCandidates.length > 0;
568
+ let t4;
569
+ bb0: {
570
+ if (showsResults) {
571
+ t4 = null;
572
+ break bb0;
610
573
  }
611
- let t2;
612
- if ($[13] !== styles.emptyState || $[14] !== t1) {
613
- t2 = /*#__PURE__*/_jsx(View, {
614
- style: styles.emptyState,
615
- children: t1
616
- });
617
- $[13] = styles.emptyState;
618
- $[14] = t1;
619
- $[15] = t2;
620
- } else {
621
- t2 = $[15];
574
+ if (term.length < 1) {
575
+ if (selectedPeople.size > 0) {
576
+ t4 = null;
577
+ break bb0;
578
+ }
579
+ let t5;
580
+ if ($[8] !== styles.emptyStateIcon) {
581
+ t5 = /*#__PURE__*/_jsx(Icon, {
582
+ name: "churchCenter.people",
583
+ size: 40,
584
+ style: styles.emptyStateIcon
585
+ });
586
+ $[8] = styles.emptyStateIcon;
587
+ $[9] = t5;
588
+ } else {
589
+ t5 = $[9];
590
+ }
591
+ let t6;
592
+ if ($[10] !== styles.emptyStateTitle) {
593
+ t6 = /*#__PURE__*/_jsx(Text, {
594
+ style: styles.emptyStateTitle,
595
+ children: "Search for people to direct message"
596
+ });
597
+ $[10] = styles.emptyStateTitle;
598
+ $[11] = t6;
599
+ } else {
600
+ t6 = $[11];
601
+ }
602
+ let t7;
603
+ if ($[12] !== styles.emptyStateSubtitle) {
604
+ t7 = /*#__PURE__*/_jsx(Text, {
605
+ variant: "secondary",
606
+ style: styles.emptyStateSubtitle,
607
+ children: "Start a conversation with people in your groups and teams."
608
+ });
609
+ $[12] = styles.emptyStateSubtitle;
610
+ $[13] = t7;
611
+ } else {
612
+ t7 = $[13];
613
+ }
614
+ let t8;
615
+ if ($[14] !== styles.emptyState || $[15] !== t5 || $[16] !== t6 || $[17] !== t7) {
616
+ t8 = /*#__PURE__*/_jsxs(View, {
617
+ style: styles.emptyState,
618
+ children: [t5, t6, t7]
619
+ });
620
+ $[14] = styles.emptyState;
621
+ $[15] = t5;
622
+ $[16] = t6;
623
+ $[17] = t7;
624
+ $[18] = t8;
625
+ } else {
626
+ t8 = $[18];
627
+ }
628
+ t4 = t8;
629
+ break bb0;
622
630
  }
623
- return t2;
624
- }
625
- let t1;
626
- if ($[16] !== data?.data) {
627
- t1 = data?.data ?? [];
628
- $[16] = data?.data;
629
- $[17] = t1;
630
- } else {
631
- t1 = $[17];
632
- }
633
- let t2;
634
- if ($[18] !== selectedPeople || $[19] !== t1) {
635
- let t3;
636
- if ($[21] !== selectedPeople) {
637
- t3 = c => !selectedPeople.has(c.id);
638
- $[21] = selectedPeople;
639
- $[22] = t3;
640
- } else {
641
- t3 = $[22];
631
+ if (isError) {
632
+ let t5;
633
+ if ($[19] !== styles.errorBanner) {
634
+ t5 = /*#__PURE__*/_jsx(Banner, {
635
+ appearance: "error",
636
+ description: "Couldn't load people right now. Try again.",
637
+ style: styles.errorBanner
638
+ });
639
+ $[19] = styles.errorBanner;
640
+ $[20] = t5;
641
+ } else {
642
+ t5 = $[20];
643
+ }
644
+ let t6;
645
+ if ($[21] !== term) {
646
+ t6 = /*#__PURE__*/_jsx(CandidateSearchError, {
647
+ term: term
648
+ });
649
+ $[21] = term;
650
+ $[22] = t6;
651
+ } else {
652
+ t6 = $[22];
653
+ }
654
+ let t7;
655
+ if ($[23] !== t5 || $[24] !== t6 || $[25] !== term) {
656
+ t7 = /*#__PURE__*/_jsx(ComponentErrorBoundary, {
657
+ fallback: t5,
658
+ children: t6
659
+ }, term);
660
+ $[23] = t5;
661
+ $[24] = t6;
662
+ $[25] = term;
663
+ $[26] = t7;
664
+ } else {
665
+ t7 = $[26];
666
+ }
667
+ t4 = t7;
668
+ break bb0;
642
669
  }
643
- t2 = t1.filter(t3);
644
- $[18] = selectedPeople;
645
- $[19] = t1;
646
- $[20] = t2;
647
- } else {
648
- t2 = $[20];
649
- }
650
- const unselectedCandidates = t2;
651
- const hasTruncated = (data?.meta.totalCount ?? 0) > (data?.data.length ?? 0);
652
- if (isFetching && unselectedCandidates.length === 0) {
653
- let t3;
654
- if ($[23] === Symbol.for("react.memo_cache_sentinel")) {
655
- t3 = /*#__PURE__*/_jsx(Spinner, {});
656
- $[23] = t3;
657
- } else {
658
- t3 = $[23];
670
+ if (isAtLimit) {
671
+ let t5;
672
+ if ($[27] !== styles.emptyStateSubtitle) {
673
+ t5 = /*#__PURE__*/_jsxs(Text, {
674
+ variant: "secondary",
675
+ style: styles.emptyStateSubtitle,
676
+ children: ["You can add up to ", MAX_RECIPIENTS, " people to a direct message."]
677
+ });
678
+ $[27] = styles.emptyStateSubtitle;
679
+ $[28] = t5;
680
+ } else {
681
+ t5 = $[28];
682
+ }
683
+ let t6;
684
+ if ($[29] !== styles.emptyState || $[30] !== t5) {
685
+ t6 = /*#__PURE__*/_jsx(View, {
686
+ style: styles.emptyState,
687
+ children: t5
688
+ });
689
+ $[29] = styles.emptyState;
690
+ $[30] = t5;
691
+ $[31] = t6;
692
+ } else {
693
+ t6 = $[31];
694
+ }
695
+ t4 = t6;
696
+ break bb0;
659
697
  }
660
- let t4;
661
- if ($[24] !== styles.emptyState) {
662
- t4 = /*#__PURE__*/_jsx(View, {
663
- style: styles.emptyState,
664
- children: t3
665
- });
666
- $[24] = styles.emptyState;
667
- $[25] = t4;
668
- } else {
669
- t4 = $[25];
698
+ if (isFetching) {
699
+ let t5;
700
+ if ($[32] === Symbol.for("react.memo_cache_sentinel")) {
701
+ t5 = /*#__PURE__*/_jsx(Spinner, {});
702
+ $[32] = t5;
703
+ } else {
704
+ t5 = $[32];
705
+ }
706
+ let t6;
707
+ if ($[33] !== styles.emptyState) {
708
+ t6 = /*#__PURE__*/_jsx(View, {
709
+ style: styles.emptyState,
710
+ children: t5
711
+ });
712
+ $[33] = styles.emptyState;
713
+ $[34] = t6;
714
+ } else {
715
+ t6 = $[34];
716
+ }
717
+ t4 = t6;
718
+ break bb0;
670
719
  }
671
- return t4;
672
- }
673
- if (!isFetching && unselectedCandidates.length === 0) {
674
- let t3;
675
- if ($[26] !== styles.emptyStateIcon) {
676
- t3 = /*#__PURE__*/_jsx(Icon, {
720
+ let t5;
721
+ if ($[35] !== styles.emptyStateIcon) {
722
+ t5 = /*#__PURE__*/_jsx(Icon, {
677
723
  name: "general.search",
678
724
  size: 32,
679
725
  style: styles.emptyStateIcon
680
726
  });
681
- $[26] = styles.emptyStateIcon;
682
- $[27] = t3;
727
+ $[35] = styles.emptyStateIcon;
728
+ $[36] = t5;
683
729
  } else {
684
- t3 = $[27];
730
+ t5 = $[36];
685
731
  }
686
- let t4;
687
- if ($[28] !== styles.emptyStateTitle || $[29] !== term) {
688
- t4 = /*#__PURE__*/_jsxs(Text, {
732
+ let t6;
733
+ if ($[37] !== styles.emptyStateTitle || $[38] !== term) {
734
+ t6 = /*#__PURE__*/_jsxs(Text, {
689
735
  style: styles.emptyStateTitle,
690
736
  children: ["No matches for \"", term, "\""]
691
737
  });
692
- $[28] = styles.emptyStateTitle;
693
- $[29] = term;
694
- $[30] = t4;
738
+ $[37] = styles.emptyStateTitle;
739
+ $[38] = term;
740
+ $[39] = t6;
695
741
  } else {
696
- t4 = $[30];
742
+ t6 = $[39];
697
743
  }
698
- let t5;
699
- if ($[31] !== styles.emptyStateSubtitle) {
700
- t5 = /*#__PURE__*/_jsx(Text, {
744
+ let t7;
745
+ if ($[40] !== styles.emptyStateSubtitle) {
746
+ t7 = /*#__PURE__*/_jsx(Text, {
701
747
  variant: "secondary",
702
748
  style: styles.emptyStateSubtitle,
703
749
  children: "Try a different name, or check that you share a group or team with them."
704
750
  });
705
- $[31] = styles.emptyStateSubtitle;
706
- $[32] = t5;
751
+ $[40] = styles.emptyStateSubtitle;
752
+ $[41] = t7;
707
753
  } else {
708
- t5 = $[32];
754
+ t7 = $[41];
709
755
  }
710
- let t6;
711
- if ($[33] !== styles.emptyState || $[34] !== t3 || $[35] !== t4 || $[36] !== t5) {
712
- t6 = /*#__PURE__*/_jsxs(View, {
756
+ let t8;
757
+ if ($[42] !== styles.emptyState || $[43] !== t5 || $[44] !== t6 || $[45] !== t7) {
758
+ t8 = /*#__PURE__*/_jsxs(View, {
713
759
  style: styles.emptyState,
714
- children: [t3, t4, t5]
760
+ children: [t5, t6, t7]
715
761
  });
716
- $[33] = styles.emptyState;
717
- $[34] = t3;
718
- $[35] = t4;
719
- $[36] = t5;
720
- $[37] = t6;
762
+ $[42] = styles.emptyState;
763
+ $[43] = t5;
764
+ $[44] = t6;
765
+ $[45] = t7;
766
+ $[46] = t8;
721
767
  } else {
722
- t6 = $[37];
768
+ t8 = $[46];
723
769
  }
724
- return t6;
770
+ t4 = t8;
725
771
  }
726
- let t3;
727
- if ($[38] !== groups || $[39] !== hasTruncated || $[40] !== onSelect || $[41] !== resultsDescription || $[42] !== teams || $[43] !== unselectedCandidates) {
728
- t3 = /*#__PURE__*/_jsx(CandidateList, {
729
- candidates: unselectedCandidates,
730
- hasTruncated: hasTruncated,
731
- description: resultsDescription,
772
+ const emptyState = t4;
773
+ let t5;
774
+ if ($[47] !== showsResults || $[48] !== unselectedCandidates) {
775
+ t5 = showsResults ? unselectedCandidates : [];
776
+ $[47] = showsResults;
777
+ $[48] = unselectedCandidates;
778
+ $[49] = t5;
779
+ } else {
780
+ t5 = $[49];
781
+ }
782
+ const t6 = showsResults && hasTruncated;
783
+ const t7 = showsResults ? resultsDescription : null;
784
+ let t8;
785
+ if ($[50] !== emptyState || $[51] !== groups || $[52] !== header || $[53] !== onSelect || $[54] !== showsResults || $[55] !== t5 || $[56] !== t6 || $[57] !== t7 || $[58] !== teams) {
786
+ t8 = /*#__PURE__*/_jsx(CandidateList, {
787
+ header: header,
788
+ candidates: t5,
789
+ hasTruncated: t6,
790
+ description: t7,
791
+ showsHeading: showsResults,
792
+ emptyState: emptyState,
732
793
  groups: groups,
733
794
  teams: teams,
734
795
  onSelect: onSelect
735
796
  });
736
- $[38] = groups;
737
- $[39] = hasTruncated;
738
- $[40] = onSelect;
739
- $[41] = resultsDescription;
740
- $[42] = teams;
741
- $[43] = unselectedCandidates;
742
- $[44] = t3;
797
+ $[50] = emptyState;
798
+ $[51] = groups;
799
+ $[52] = header;
800
+ $[53] = onSelect;
801
+ $[54] = showsResults;
802
+ $[55] = t5;
803
+ $[56] = t6;
804
+ $[57] = t7;
805
+ $[58] = teams;
806
+ $[59] = t8;
743
807
  } else {
744
- t3 = $[44];
808
+ t8 = $[59];
745
809
  }
746
- return t3;
810
+ return t8;
811
+ }
812
+ function CandidateSearchError(t0) {
813
+ const {
814
+ term
815
+ } = t0;
816
+ useDirectMessageCandidates(term);
817
+ return null;
747
818
  }
748
819
  function candidateBadges(candidate) {
749
820
  const badges = [];
@@ -765,11 +836,14 @@ function candidateAffiliationNames(candidate, groups, teams) {
765
836
  })];
766
837
  }
767
838
  function CandidateList(t0) {
768
- const $ = _c(36);
839
+ const $ = _c(47);
769
840
  const {
841
+ header,
770
842
  candidates,
771
843
  hasTruncated,
772
844
  description,
845
+ showsHeading,
846
+ emptyState,
773
847
  groups,
774
848
  teams,
775
849
  onSelect
@@ -791,17 +865,20 @@ function CandidateList(t0) {
791
865
  let t5;
792
866
  let t6;
793
867
  let t7;
794
- if ($[2] !== available || $[3] !== candidates || $[4] !== description || $[5] !== groups || $[6] !== onSelect || $[7] !== styles || $[8] !== teams) {
868
+ let t8;
869
+ let t9;
870
+ if ($[2] !== available || $[3] !== candidates || $[4] !== description || $[5] !== emptyState || $[6] !== groups || $[7] !== header || $[8] !== onSelect || $[9] !== showsHeading || $[10] !== styles || $[11] !== teams) {
795
871
  const dmDisabled = candidates.filter(_temp3);
796
872
  T0 = FlatList;
797
873
  t3 = available;
798
- t4 = "handled";
799
- t5 = _temp4;
800
- if ($[16] !== groups || $[17] !== onSelect || $[18] !== teams) {
801
- t6 = t8 => {
874
+ t4 = "automatic";
875
+ t5 = "handled";
876
+ t6 = _temp4;
877
+ if ($[21] !== groups || $[22] !== onSelect || $[23] !== teams) {
878
+ t7 = t10 => {
802
879
  const {
803
880
  item: item_0
804
- } = t8;
881
+ } = t10;
805
882
  return /*#__PURE__*/_jsx(CandidateItem, {
806
883
  candidate: item_0,
807
884
  badges: candidateBadges(item_0),
@@ -809,22 +886,35 @@ function CandidateList(t0) {
809
886
  onSelect: () => onSelect(item_0)
810
887
  });
811
888
  };
812
- $[16] = groups;
813
- $[17] = onSelect;
814
- $[18] = teams;
815
- $[19] = t6;
889
+ $[21] = groups;
890
+ $[22] = onSelect;
891
+ $[23] = teams;
892
+ $[24] = t7;
816
893
  } else {
817
- t6 = $[19];
894
+ t7 = $[24];
818
895
  }
819
- if ($[20] !== description) {
820
- t7 = /*#__PURE__*/_jsx(ResultsHeading, {
896
+ let t10;
897
+ if ($[25] !== description || $[26] !== showsHeading) {
898
+ t10 = showsHeading && /*#__PURE__*/_jsx(ResultsHeading, {
821
899
  description: description
822
900
  });
823
- $[20] = description;
824
- $[21] = t7;
901
+ $[25] = description;
902
+ $[26] = showsHeading;
903
+ $[27] = t10;
825
904
  } else {
826
- t7 = $[21];
905
+ t10 = $[27];
827
906
  }
907
+ if ($[28] !== header || $[29] !== t10) {
908
+ t8 = /*#__PURE__*/_jsxs(_Fragment, {
909
+ children: [header, t10]
910
+ });
911
+ $[28] = header;
912
+ $[29] = t10;
913
+ $[30] = t8;
914
+ } else {
915
+ t8 = $[30];
916
+ }
917
+ t9 = emptyState;
828
918
  t2 = dmDisabled.length > 0 && /*#__PURE__*/_jsxs(_Fragment, {
829
919
  children: [/*#__PURE__*/_jsx(View, {
830
920
  style: styles.unavailableHeader,
@@ -843,29 +933,36 @@ function CandidateList(t0) {
843
933
  $[2] = available;
844
934
  $[3] = candidates;
845
935
  $[4] = description;
846
- $[5] = groups;
847
- $[6] = onSelect;
848
- $[7] = styles;
849
- $[8] = teams;
850
- $[9] = T0;
851
- $[10] = t2;
852
- $[11] = t3;
853
- $[12] = t4;
854
- $[13] = t5;
855
- $[14] = t6;
856
- $[15] = t7;
936
+ $[5] = emptyState;
937
+ $[6] = groups;
938
+ $[7] = header;
939
+ $[8] = onSelect;
940
+ $[9] = showsHeading;
941
+ $[10] = styles;
942
+ $[11] = teams;
943
+ $[12] = T0;
944
+ $[13] = t2;
945
+ $[14] = t3;
946
+ $[15] = t4;
947
+ $[16] = t5;
948
+ $[17] = t6;
949
+ $[18] = t7;
950
+ $[19] = t8;
951
+ $[20] = t9;
857
952
  } else {
858
- T0 = $[9];
859
- t2 = $[10];
860
- t3 = $[11];
861
- t4 = $[12];
862
- t5 = $[13];
863
- t6 = $[14];
864
- t7 = $[15];
953
+ T0 = $[12];
954
+ t2 = $[13];
955
+ t3 = $[14];
956
+ t4 = $[15];
957
+ t5 = $[16];
958
+ t6 = $[17];
959
+ t7 = $[18];
960
+ t8 = $[19];
961
+ t9 = $[20];
865
962
  }
866
- let t8;
867
- if ($[22] !== hasTruncated || $[23] !== styles) {
868
- t8 = hasTruncated && /*#__PURE__*/_jsx(View, {
963
+ let t10;
964
+ if ($[31] !== hasTruncated || $[32] !== styles) {
965
+ t10 = hasTruncated && /*#__PURE__*/_jsx(View, {
869
966
  style: styles.truncatedFooter,
870
967
  children: /*#__PURE__*/_jsx(Text, {
871
968
  variant: "secondary",
@@ -873,45 +970,49 @@ function CandidateList(t0) {
873
970
  children: "Keep typing to narrow your results."
874
971
  })
875
972
  });
876
- $[22] = hasTruncated;
877
- $[23] = styles;
878
- $[24] = t8;
973
+ $[31] = hasTruncated;
974
+ $[32] = styles;
975
+ $[33] = t10;
879
976
  } else {
880
- t8 = $[24];
977
+ t10 = $[33];
881
978
  }
882
- let t9;
883
- if ($[25] !== t2 || $[26] !== t8) {
884
- t9 = /*#__PURE__*/_jsxs(_Fragment, {
885
- children: [t2, t8]
979
+ let t11;
980
+ if ($[34] !== t10 || $[35] !== t2) {
981
+ t11 = /*#__PURE__*/_jsxs(_Fragment, {
982
+ children: [t2, t10]
886
983
  });
887
- $[25] = t2;
888
- $[26] = t8;
889
- $[27] = t9;
984
+ $[34] = t10;
985
+ $[35] = t2;
986
+ $[36] = t11;
890
987
  } else {
891
- t9 = $[27];
988
+ t11 = $[36];
892
989
  }
893
- let t10;
894
- if ($[28] !== T0 || $[29] !== t3 || $[30] !== t4 || $[31] !== t5 || $[32] !== t6 || $[33] !== t7 || $[34] !== t9) {
895
- t10 = /*#__PURE__*/_jsx(T0, {
990
+ let t12;
991
+ if ($[37] !== T0 || $[38] !== t11 || $[39] !== t3 || $[40] !== t4 || $[41] !== t5 || $[42] !== t6 || $[43] !== t7 || $[44] !== t8 || $[45] !== t9) {
992
+ t12 = /*#__PURE__*/_jsx(T0, {
896
993
  data: t3,
897
- keyboardShouldPersistTaps: t4,
898
- keyExtractor: t5,
899
- renderItem: t6,
900
- ListHeaderComponent: t7,
901
- ListFooterComponent: t9
994
+ contentInsetAdjustmentBehavior: t4,
995
+ keyboardShouldPersistTaps: t5,
996
+ keyExtractor: t6,
997
+ renderItem: t7,
998
+ ListHeaderComponent: t8,
999
+ ListEmptyComponent: t9,
1000
+ ListFooterComponent: t11
902
1001
  });
903
- $[28] = T0;
904
- $[29] = t3;
905
- $[30] = t4;
906
- $[31] = t5;
907
- $[32] = t6;
908
- $[33] = t7;
909
- $[34] = t9;
910
- $[35] = t10;
1002
+ $[37] = T0;
1003
+ $[38] = t11;
1004
+ $[39] = t3;
1005
+ $[40] = t4;
1006
+ $[41] = t5;
1007
+ $[42] = t6;
1008
+ $[43] = t7;
1009
+ $[44] = t8;
1010
+ $[45] = t9;
1011
+ $[46] = t12;
911
1012
  } else {
912
- t10 = $[35];
1013
+ t12 = $[46];
913
1014
  }
914
- return t10;
1015
+ return t12;
915
1016
  }
916
1017
  function _temp4(item) {
917
1018
  return item.id;