@openmrs/esm-appointments-app 4.1.1-pre.997 → 4.2.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.
Files changed (65) hide show
  1. package/.turbo/turbo-build.log +19 -18
  2. package/dist/153.js +1 -1
  3. package/dist/153.js.map +1 -0
  4. package/dist/319.js +1 -1
  5. package/dist/34.js +1 -1
  6. package/dist/34.js.map +1 -0
  7. package/dist/351.js +1 -1
  8. package/dist/351.js.map +1 -0
  9. package/dist/352.js +1 -1
  10. package/dist/352.js.map +1 -0
  11. package/dist/430.js +1 -1
  12. package/dist/430.js.map +1 -0
  13. package/dist/437.js +1 -1
  14. package/dist/437.js.map +1 -0
  15. package/dist/45.js +1 -1
  16. package/dist/45.js.map +1 -0
  17. package/dist/456.js +1 -1
  18. package/dist/456.js.map +1 -0
  19. package/dist/458.js +2 -0
  20. package/dist/458.js.map +1 -0
  21. package/dist/497.js +1 -1
  22. package/dist/497.js.map +1 -0
  23. package/dist/542.js +1 -1
  24. package/dist/542.js.map +1 -0
  25. package/dist/568.js +1 -1
  26. package/dist/568.js.map +1 -0
  27. package/dist/574.js +1 -1
  28. package/dist/647.js +1 -1
  29. package/dist/647.js.map +1 -0
  30. package/dist/685.js +1 -1
  31. package/dist/685.js.map +1 -0
  32. package/dist/692.js +1 -1
  33. package/dist/692.js.map +1 -0
  34. package/dist/757.js +1 -1
  35. package/dist/784.js +1 -1
  36. package/dist/784.js.map +1 -0
  37. package/dist/807.js +1 -1
  38. package/dist/821.js +1 -1
  39. package/dist/821.js.map +1 -0
  40. package/dist/830.js +1 -1
  41. package/dist/830.js.map +1 -0
  42. package/dist/843.js +1 -1
  43. package/dist/843.js.map +1 -0
  44. package/dist/858.js +1 -1
  45. package/dist/858.js.map +1 -0
  46. package/dist/976.js +1 -1
  47. package/dist/976.js.map +1 -0
  48. package/dist/984.js +1 -1
  49. package/dist/984.js.map +1 -0
  50. package/dist/main.js +1 -1
  51. package/dist/main.js.map +1 -0
  52. package/dist/openmrs-esm-appointments-app.js +1 -1
  53. package/dist/openmrs-esm-appointments-app.js.buildmanifest.json +151 -103
  54. package/dist/openmrs-esm-appointments-app.js.map +1 -0
  55. package/dist/openmrs-esm-appointments-app.old +1 -1
  56. package/package.json +2 -2
  57. package/src/appointment-forms/appointments-forms.test.tsx +1 -1
  58. package/src/appointments/appointment-list.component.tsx +6 -6
  59. package/src/appointments/appointment-list.test.tsx +2 -2
  60. package/src/appointments-tabs/unscheduled-appointments.component.tsx +14 -9
  61. package/src/patient-search/patient-search.scss +1 -3
  62. package/translations/en.json +6 -7
  63. package/__mocks__/appointments.mock.ts +0 -411
  64. package/dist/285.js +0 -2
  65. /package/dist/{285.js.LICENSE.txt → 458.js.LICENSE.txt} +0 -0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@openmrs/esm-appointments-app",
3
- "version": "4.1.1-pre.997",
3
+ "version": "4.2.0",
4
4
  "description": "Appointments front-end module for the OpenMRS SPA",
5
5
  "browser": "dist/openmrs-esm-appointments-app.js",
6
6
  "main": "src/index.ts",
@@ -48,5 +48,5 @@
48
48
  "devDependencies": {
49
49
  "webpack": "^5.74.0"
50
50
  },
51
- "gitHead": "7d01214b946c97c287d3abd4cc6ab4199b50aead"
51
+ "gitHead": "efcece294b76304371efaffe7580529fb183b81a"
52
52
  }
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import { render, screen, within, fireEvent } from '@testing-library/react';
3
3
  import userEvent from '@testing-library/user-event';
4
4
  import { useConfig, usePatient } from '@openmrs/esm-framework';
5
- import { mockPatient, mockServices, mockProviders } from '../../__mocks__/appointments.mock';
5
+ import { mockPatient, mockServices, mockProviders } from '../../../../__mocks__/appointments.mock';
6
6
  import { mockLocations } from '../../../../__mocks__/locations.mock';
7
7
  import { mockSession } from '../../../../__mocks__/session.mock';
8
8
  import { MappedAppointment } from '../types';
@@ -10,7 +10,7 @@ import ScheduledAppointments from '../appointments-tabs/schedule-appointment.com
10
10
  import CheckInAppointments from '../appointments-tabs/checkedinappointments.component';
11
11
  import { useAppointmentDate } from '../helpers';
12
12
  import dayjs from 'dayjs';
13
- import UnScheduledAppointments from '../appointments-tabs/unscheduled-appointments.component';
13
+ import UnscheduledAppointments from '../appointments-tabs/unscheduled-appointments.component';
14
14
  import PendingAppointments from '../appointments-tabs/pending-appointments.component';
15
15
  import { useAppointments } from '../appointments-tabs/appointments-table.resource';
16
16
 
@@ -63,9 +63,9 @@ const AppointmentList: React.FC = () => {
63
63
  className={styles.tabs}>
64
64
  <TabList style={{ paddingLeft: '1rem' }} aria-label="Appointment tabs" contained>
65
65
  <Tab>{t('scheduled', 'Scheduled')}</Tab>
66
- <Tab>{t('unScheduled', 'UnScheduled')}</Tab>
66
+ <Tab>{t('unscheduled', 'Unscheduled')}</Tab>
67
67
  <Tab>{t('completed', 'Completed')}</Tab>
68
- <Tab disabled={!isToday}>{t('checkedIn', 'CheckedIn')}</Tab>
68
+ <Tab disabled={!isToday}>{t('checkedIn', 'Checked in')}</Tab>
69
69
  <Tab>{t('pending', 'Pending')}</Tab>
70
70
  <Button
71
71
  className={styles.calendarButton}
@@ -73,8 +73,8 @@ const AppointmentList: React.FC = () => {
73
73
  onClick={() => navigate({ to: `${spaBasePath}/calendar` })}
74
74
  renderIcon={(props) => <Calendar size={16} {...props} />}
75
75
  data-floating-menu-primary-focus
76
- iconDescription={t('viewCalendar', 'View Calendar')}>
77
- {t('viewCalendar', 'View Calendar')}
76
+ iconDescription={t('viewCalendar', 'View calendar')}>
77
+ {t('viewCalendar', 'View calendar')}
78
78
  </Button>
79
79
  </TabList>
80
80
  <TabPanels>
@@ -82,7 +82,7 @@ const AppointmentList: React.FC = () => {
82
82
  <ScheduledAppointments status={AppointmentTypes.SCHEDULED} />
83
83
  </TabPanel>
84
84
  <TabPanel style={{ padding: 0 }}>
85
- <UnScheduledAppointments />
85
+ <UnscheduledAppointments />
86
86
  </TabPanel>
87
87
  <TabPanel style={{ padding: 0 }}>{<CompletedAppointments status={AppointmentTypes.COMPLETED} />}</TabPanel>
88
88
  {isToday && (
@@ -22,8 +22,8 @@ describe('AppointmentList', () => {
22
22
 
23
23
  const scheduledAppointmentsTab = screen.getByRole('tab', { name: /^scheduled$/i });
24
24
  const completedAppointmentsTab = screen.getByRole('tab', { name: /completed/i });
25
- const unsheduledAppointment = screen.getByRole('tab', { name: /^unScheduled$/i });
26
- const pendingAppointments = screen.getByRole('tab', { name: /^unScheduled$/i });
25
+ const unsheduledAppointment = screen.getByRole('tab', { name: /^unscheduled$/i });
26
+ const pendingAppointments = screen.getByRole('tab', { name: /^unscheduled$/i });
27
27
 
28
28
  expect(scheduledAppointmentsTab).toBeInTheDocument();
29
29
  expect(completedAppointmentsTab).toBeInTheDocument();
@@ -21,12 +21,12 @@ import { ConfigurableLink, formatDatetime, usePagination } from '@openmrs/esm-fr
21
21
  import { EmptyState } from '../empty-state/empty-state.component';
22
22
  import isEmpty from 'lodash-es/isEmpty';
23
23
 
24
- const UnScheduledAppointments: React.FC = () => {
24
+ const UnscheduledAppointments: React.FC = () => {
25
25
  const { t } = useTranslation();
26
26
  const { isLoading: isVisitLoading, visits } = useVisits();
27
27
  const { appointments, isLoading } = useAppointments();
28
28
  const patientUuids = appointments?.map(({ patientUuid }) => patientUuid);
29
- const filteredAppointment = useMemo(
29
+ const filteredAppointments = useMemo(
30
30
  () => (!isVisitLoading ? visits?.filter((visit) => !patientUuids.includes(visit.patient.uuid)) : []),
31
31
  [isVisitLoading, patientUuids, visits],
32
32
  );
@@ -49,7 +49,7 @@ const UnScheduledAppointments: React.FC = () => {
49
49
  },
50
50
  ];
51
51
 
52
- const { results, currentPage, goTo } = usePagination(filteredAppointment, 10);
52
+ const { results, currentPage, goTo } = usePagination(filteredAppointments, 10);
53
53
 
54
54
  const rowData = results?.map((visit) => ({
55
55
  id: `${visit.uuid}`,
@@ -66,25 +66,30 @@ const UnScheduledAppointments: React.FC = () => {
66
66
  }));
67
67
 
68
68
  const pageSizes = useMemo(() => {
69
- const numberOfPages = Math.ceil(filteredAppointment.length / 10);
69
+ const numberOfPages = Math.ceil(filteredAppointments.length / 10);
70
70
  return [...Array(numberOfPages).keys()].map((x) => {
71
71
  return (x + 1) * 10;
72
72
  });
73
- }, [filteredAppointment]);
73
+ }, [filteredAppointments]);
74
74
 
75
75
  if (isLoading && isVisitLoading) {
76
76
  return <DataTableSkeleton />;
77
77
  }
78
78
 
79
- if (isEmpty(filteredAppointment)) {
80
- return <EmptyState headerTitle="UnScheduled Appointments" displayText="UnScheduled Appointments" />;
79
+ if (isEmpty(filteredAppointments)) {
80
+ return (
81
+ <EmptyState
82
+ headerTitle={t('unscheduledAppointments', 'Unscheduled appointments')}
83
+ displayText={t('unscheduledAppointments_lower', 'unscheduled appointments')}
84
+ />
85
+ );
81
86
  }
82
87
 
83
88
  return (
84
89
  <div>
85
90
  <DataTable rows={rowData} headers={headerData} isSortable>
86
91
  {({ rows, headers, getHeaderProps, getTableProps, onInputChange }) => (
87
- <TableContainer title={`${t('unScheduledAppointments', 'UnScheduled appointments')} ${rowData.length}`}>
92
+ <TableContainer title={`${t('UnscheduledAppointments', 'Unscheduled appointments')} ${rowData.length}`}>
88
93
  <TableToolbar>
89
94
  <TableToolbarContent>
90
95
  <TableToolbarSearch style={{ backgroundColor: '#f4f4f4' }} tabIndex={0} onChange={onInputChange} />
@@ -126,4 +131,4 @@ const UnScheduledAppointments: React.FC = () => {
126
131
  );
127
132
  };
128
133
 
129
- export default UnScheduledAppointments;
134
+ export default UnscheduledAppointments;
@@ -9,9 +9,7 @@
9
9
  [data-extension-id='patient-search-bar'] {
10
10
  & > div {
11
11
  width: 100%;
12
- & form {
13
- margin: 0.0125rem;
14
- }
12
+
15
13
  & input {
16
14
  background-color: $ui-02;
17
15
  border-bottom: none;
@@ -37,6 +37,7 @@
37
37
  "chooseProvider": "Select Provider",
38
38
  "chooseQueue": "Select a queue",
39
39
  "chooseService": "Select service",
40
+ "comment": "Comment",
40
41
  "community": "Community",
41
42
  "complete": "Complete",
42
43
  "completed": "Completed",
@@ -47,17 +48,14 @@
47
48
  "date": "Date",
48
49
  "dateAndTimeOfVisit": "Date and time of visit",
49
50
  "dateTime": "Date & time",
50
- "day": "Day",
51
51
  "defaulters": "Defaulters",
52
52
  "discard": "Discard",
53
- "doubleBooking": "Appointment double booking",
54
- "doublePatientBooking": "There exist an appointment on the specified service and appointment date",
55
53
  "downloadAppointmentList": "Download appointment list",
56
54
  "durationMins": "Duration min",
57
55
  "editAppointment": "Edit Appointment",
58
56
  "editAppointments": "Edit Appointment",
59
57
  "emergency": "Emergency",
60
- "emptyStateText": "There are no {displayText.toLowerCase()} to display",
58
+ "emptyStateText": "There are no {{displayText}} to display",
61
59
  "encounters": "Encounters",
62
60
  "encounterType": "Encounter type",
63
61
  "endTime": "End Time",
@@ -66,7 +64,6 @@
66
64
  "exitAndChangeStatus": "Change status",
67
65
  "facility": "Facility",
68
66
  "filter": "Filter",
69
- "frequency": "Frequency",
70
67
  "futureScheduledVisits": " {count, plural, one{{count} visit} other{{count} visits}} scheduled for dates in the future",
71
68
  "futureScheduledVisits_plural": "",
72
69
  "getAppointmentReminder": "Would you like to get a reminder about this appointment?",
@@ -130,8 +127,10 @@
130
127
  "time": "Time",
131
128
  "todaysAppointments": "Today's Appointments",
132
129
  "total": "Total",
133
- "unScheduled": "UnScheduled",
134
- "unScheduledAppointments": "UnScheduled appointments",
130
+ "typeInComments": "Type in appointment comment",
131
+ "unscheduled": "Unscheduled",
132
+ "unscheduledAppointments": "Unscheduled appointments",
133
+ "unscheduledAppointments_lower": "unscheduled appointments",
135
134
  "upcomming": "Upcoming",
136
135
  "view": "View",
137
136
  "viewCalendar": "View Calendar",
@@ -1,411 +0,0 @@
1
- // export const mockAppointmentsData = {
2
- // data: [
3
- // {
4
- // uuid: '7cd38a6d-377e-491b-8284-b04cf8b8c6d8',
5
- // appointmentNumber: '0000',
6
- // patient: {
7
- // identifier: '100GEJ',
8
- // name: 'John Wilson',
9
- // uuid: '8673ee4f-e2ab-4077-ba55-4980f408773e',
10
- // gender: 'M',
11
- // age: 35,
12
- // birthdate: '1986-04-03T00:00:00.000+0000',
13
- // phoneNumber: '0700000000',
14
- // },
15
- // service: {
16
- // appointmentServiceId: 1,
17
- // name: 'Outpatient',
18
- // description: null,
19
- // speciality: {},
20
- // startTime: '',
21
- // endTime: '',
22
- // maxAppointmentsLimit: null,
23
- // durationMins: null,
24
- // location: {},
25
- // uuid: 'e2ec9cf0-ec38-4d2b-af6c-59c82fa30b90',
26
- // initialAppointmentStatus: 'Scheduled',
27
- // creatorName: null,
28
- // },
29
- // serviceType: {
30
- // display: 'HIV Clinic',
31
- // uuid: '53d58ff1-0c45-4e2e-9bd2-9cc826cb46e1',
32
- // duration: 15,
33
- // },
34
- // provider: {
35
- // uuid: 'f9badd80-ab76-11e2-9e96-0800200c9a66',
36
- // person: { uuid: '24252571-dd5a-11e6-9d9c-0242ac150002', display: 'Dr James Cook' },
37
- // },
38
- // location: { name: 'HIV Clinic', uuid: '2131aff8-2e2a-480a-b7ab-4ac53250262b' },
39
- // startDateTime: 1630326900000,
40
- // endDateTime: 1630327200000,
41
- // appointmentKind: 'WalkIn',
42
- // status: 'Scheduled',
43
- // comments: 'Walk in appointments',
44
- // additionalInfo: null,
45
- // providers: [],
46
- // recurring: false,
47
- // },
48
- // {
49
- // uuid: 'e10ce4e3-0e91-4b97-bc6c-9b5068e58428',
50
- // appointmentNumber: '0000',
51
- // patient: {
52
- // identifier: '100GEJ',
53
- // name: 'John Wilson',
54
- // uuid: '8673ee4f-e2ab-4077-ba55-4980f408773e',
55
- // gender: 'M',
56
- // age: 35,
57
- // birthdate: '1986-04-03T00:00:00.000+0000',
58
- // phoneNumber: '0700000000',
59
- // },
60
- // service: {
61
- // appointmentServiceId: 1,
62
- // name: 'Outpatient',
63
- // description: null,
64
- // speciality: {},
65
- // startTime: '',
66
- // endTime: '',
67
- // maxAppointmentsLimit: null,
68
- // durationMins: null,
69
- // location: {},
70
- // uuid: 'e2ec9cf0-ec38-4d2b-af6c-59c82fa30b90',
71
- // initialAppointmentStatus: 'Scheduled',
72
- // creatorName: null,
73
- // },
74
- // serviceType: {
75
- // display: 'HIV Clinic',
76
- // uuid: '53d58ff1-0c45-4e2e-9bd2-9cc826cb46e1',
77
- // duration: 15,
78
- // },
79
- // provider: {
80
- // uuid: 'f9badd80-ab76-11e2-9e96-0800200c9a66',
81
- // person: { uuid: '24252571-dd5a-11e6-9d9c-0242ac150002', display: 'Dr James Cook' },
82
- // },
83
- // location: { name: 'HIV Clinic', uuid: '2131aff8-2e2a-480a-b7ab-4ac53250262b' },
84
- // startDateTime: 1631278200000,
85
- // endDateTime: 1631278560000,
86
- // appointmentKind: 'WalkIn',
87
- // status: 'Scheduled',
88
- // comments: 'Some additional notes',
89
- // additionalInfo: null,
90
- // providers: [],
91
- // recurring: false,
92
- // },
93
- // {
94
- // uuid: 'cdb0676f-0805-4c3e-bfef-7757a005e892',
95
- // appointmentNumber: '0000',
96
- // patient: {
97
- // identifier: '100GEJ',
98
- // name: 'John Wilson',
99
- // uuid: '8673ee4f-e2ab-4077-ba55-4980f408773e',
100
- // gender: 'M',
101
- // age: 35,
102
- // birthdate: '1986-04-03T00:00:00.000+0000',
103
- // phoneNumber: '0700000000',
104
- // },
105
- // service: {
106
- // appointmentServiceId: 1,
107
- // name: 'Outpatient',
108
- // description: null,
109
- // speciality: {},
110
- // startTime: '',
111
- // endTime: '',
112
- // maxAppointmentsLimit: null,
113
- // durationMins: null,
114
- // location: {},
115
- // uuid: 'e2ec9cf0-ec38-4d2b-af6c-59c82fa30b90',
116
- // initialAppointmentStatus: 'Scheduled',
117
- // creatorName: null,
118
- // },
119
- // serviceType: {
120
- // display: 'TB Clinic',
121
- // uuid: '4a228e52-0bfe-11ed-861d-0242ac120002',
122
- // duration: 15,
123
- // },
124
- // provider: null,
125
- // location: { name: 'TB Clinic', uuid: '2131aff8-2e2a-480a-b7ab-4ac53250262b' },
126
- // startDateTime: 1631537400000,
127
- // endDateTime: 1631537760000,
128
- // appointmentKind: 'WalkIn',
129
- // status: 'Scheduled',
130
- // comments: 'Some additional notes',
131
- // additionalInfo: null,
132
- // providers: [],
133
- // recurring: false,
134
- // },
135
- // {
136
- // uuid: '66565d8b-4849-4b7c-966a-554d6073f80c',
137
- // appointmentNumber: '0000',
138
- // patient: {
139
- // identifier: '100GEJ',
140
- // name: 'John Wilson',
141
- // uuid: '8673ee4f-e2ab-4077-ba55-4980f408773e',
142
- // gender: 'M',
143
- // age: 35,
144
- // birthdate: '1986-04-03T00:00:00.000+0000',
145
- // phoneNumber: '0700000000',
146
- // },
147
- // service: {
148
- // appointmentServiceId: 1,
149
- // name: 'Outpatient',
150
- // description: null,
151
- // speciality: {},
152
- // startTime: '',
153
- // endTime: '',
154
- // maxAppointmentsLimit: null,
155
- // durationMins: null,
156
- // location: {},
157
- // uuid: 'e2ec9cf0-ec38-4d2b-af6c-59c82fa30b90',
158
- // initialAppointmentStatus: 'Scheduled',
159
- // creatorName: null,
160
- // },
161
- // serviceType: {
162
- // display: 'HIV Clinic',
163
- // uuid: '53d58ff1-0c45-4e2e-9bd2-9cc826cb46e1',
164
- // duration: 15,
165
- // },
166
- // provider: null,
167
- // location: { name: 'HIV Clinic', uuid: '2131aff8-2e2a-480a-b7ab-4ac53250262b' },
168
- // startDateTime: 1631605800000,
169
- // endDateTime: 1631606100000,
170
- // appointmentKind: 'WalkIn',
171
- // status: 'Scheduled',
172
- // comments: 'Some additional notes',
173
- // additionalInfo: null,
174
- // providers: [],
175
- // recurring: false,
176
- // },
177
- // {
178
- // uuid: '45dcc19d-dd14-4a07-95c6-afa264972a34',
179
- // appointmentNumber: '0000',
180
- // patient: {
181
- // identifier: '100GEJ',
182
- // name: 'John Wilson',
183
- // uuid: '8673ee4f-e2ab-4077-ba55-4980f408773e',
184
- // gender: 'M',
185
- // age: 35,
186
- // birthdate: '1986-04-03T00:00:00.000+0000',
187
- // phoneNumber: '0700000000',
188
- // },
189
- // service: {
190
- // appointmentServiceId: 1,
191
- // name: 'Outpatient',
192
- // description: null,
193
- // speciality: {},
194
- // startTime: '',
195
- // endTime: '',
196
- // maxAppointmentsLimit: null,
197
- // durationMins: null,
198
- // location: {},
199
- // uuid: 'e2ec9cf0-ec38-4d2b-af6c-59c82fa30b90',
200
- // initialAppointmentStatus: 'Scheduled',
201
- // creatorName: null,
202
- // },
203
- // serviceType: {
204
- // display: 'TB Clinic',
205
- // uuid: '4a228e52-0bfe-11ed-861d-0242ac120002',
206
- // duration: 15,
207
- // },
208
- // provider: {
209
- // uuid: 'f9badd80-ab76-11e2-9e96-0800200c9a66',
210
- // person: { uuid: '24252571-dd5a-11e6-9d9c-0242ac150002', display: 'Dr James Cook' },
211
- // },
212
- // location: { name: 'TB Clinic', uuid: '2131aff8-2e2a-480a-b7ab-4ac53250262b' },
213
- // startDateTime: 1631623800000,
214
- // endDateTime: 1631624160000,
215
- // appointmentKind: 'WalkIn',
216
- // status: 'Scheduled',
217
- // comments: 'Some additional notes',
218
- // additionalInfo: null,
219
- // providers: [],
220
- // recurring: false,
221
- // },
222
- // {
223
- // uuid: 'fa4657ad-db46-487d-8e2e-a3858c906ae6',
224
- // appointmentNumber: '0000',
225
- // patient: {
226
- // identifier: '100GEJ',
227
- // name: 'John Wilson',
228
- // uuid: '8673ee4f-e2ab-4077-ba55-4980f408773e',
229
- // gender: 'M',
230
- // age: 35,
231
- // birthdate: '1986-04-03T00:00:00.000+0000',
232
- // phoneNumber: '0700000000',
233
- // },
234
- // service: {
235
- // appointmentServiceId: 1,
236
- // name: 'Outpatient',
237
- // description: null,
238
- // speciality: {},
239
- // startTime: '',
240
- // endTime: '',
241
- // maxAppointmentsLimit: null,
242
- // durationMins: null,
243
- // location: {},
244
- // uuid: 'e2ec9cf0-ec38-4d2b-af6c-59c82fa30b90',
245
- // initialAppointmentStatus: 'Scheduled',
246
- // creatorName: null,
247
- // },
248
- // serviceType: {
249
- // display: 'TB Clinic',
250
- // uuid: '4a228e52-0bfe-11ed-861d-0242ac120002',
251
- // duration: 15,
252
- // },
253
- // provider: null,
254
- // location: { name: 'TB Clinic', uuid: '2131aff8-2e2a-480a-b7ab-4ac53250262b' },
255
- // startDateTime: 1631712720000,
256
- // endDateTime: 1631713080000,
257
- // appointmentKind: 'WalkIn',
258
- // status: 'Scheduled',
259
- // comments: 'Some value',
260
- // additionalInfo: null,
261
- // providers: [],
262
- // recurring: false,
263
- // },
264
- // ],
265
- // };
266
-
267
- // export const mockAppointments = {
268
- // pastAppointments: [
269
- // {
270
- // uuid: 'a4662406-2bfe-49be-8465-6dbdfe9b4d5d',
271
- // appointmentNumber: '0000',
272
- // patient: {
273
- // identifier: '1003R8',
274
- // name: 'Brian Evans',
275
- // uuid: '8f75dbf1-833d-498a-bc99-3a24cad5cee9',
276
- // },
277
- // service: {
278
- // appointmentServiceId: 1,
279
- // name: 'HIV return visit',
280
- // description: null,
281
- // speciality: {},
282
- // startTime: '',
283
- // endTime: '',
284
- // maxAppointmentsLimit: null,
285
- // durationMins: null,
286
- // location: {},
287
- // uuid: 'e2ec9cf0-ec38-4d2b-af6c-59c82fa30b90',
288
- // color: '#006400',
289
- // initialAppointmentStatus: 'Scheduled',
290
- // creatorName: null,
291
- // },
292
- // serviceType: null,
293
- // provider: null,
294
- // location: {
295
- // name: 'Outpatient Clinic',
296
- // uuid: 'f76c0c8e-2c3a-443c-b26d-96a9f3847764',
297
- // },
298
- // startDateTime: '2021-10-28T11:14:17.064Z',
299
- // endDateTime: 1649935800000,
300
- // appointmentKind: 'Scheduled',
301
- // status: 'Scheduled',
302
- // comments: null,
303
- // additionalInfo: null,
304
- // teleconsultation: null,
305
- // providers: [],
306
- // voided: false,
307
- // extensions: {
308
- // patientEmailDefined: false,
309
- // },
310
- // teleconsultationLink: null,
311
- // recurring: false.valueOf,
312
- // },
313
- // ],
314
- // upcomingAppointments: [
315
- // {
316
- // uuid: 'a4662406-2bfe-49be-8465-6dbdfe9b4d5d',
317
- // appointmentNumber: '0000',
318
- // patient: {
319
- // identifier: '1003R8',
320
- // name: 'Brian Evans',
321
- // uuid: '8f75dbf1-833d-498a-bc99-3a24cad5cee9',
322
- // },
323
- // service: {
324
- // appointmentServiceId: 1,
325
- // name: 'Clinical observation',
326
- // description: null,
327
- // speciality: {},
328
- // startTime: '',
329
- // endTime: '',
330
- // maxAppointmentsLimit: null,
331
- // durationMins: null,
332
- // location: {},
333
- // uuid: 'e2ec9cf0-ec38-4d2b-af6c-59c82fa30b90',
334
- // color: '#006400',
335
- // initialAppointmentStatus: 'Scheduled',
336
- // creatorName: null,
337
- // },
338
- // serviceType: null,
339
- // provider: null,
340
- // location: {
341
- // name: 'Outpatient Clinic',
342
- // uuid: 'f76c0c8e-2c3a-443c-b26d-96a9f3847764',
343
- // },
344
- // startDateTime: 1649934000000,
345
- // endDateTime: 1649935800000,
346
- // appointmentKind: 'Scheduled',
347
- // status: 'Scheduled',
348
- // comments: null,
349
- // additionalInfo: null,
350
- // teleconsultation: null,
351
- // providers: [],
352
- // voided: false,
353
- // extensions: {
354
- // patientEmailDefined: false,
355
- // },
356
- // teleconsultationLink: null,
357
- // recurring: false.valueOf,
358
- // },
359
- // ],
360
- // };
361
-
362
- export const mockPatient = {
363
- identifier: '100GEJ',
364
- name: 'John Wilson',
365
- uuid: '8673ee4f-e2ab-4077-ba55-4980f408773e',
366
- gender: 'M',
367
- age: 35,
368
- birthdate: '1986-04-03T00:00:00.000+0000',
369
- phoneNumber: '0700000000',
370
- };
371
-
372
- export const mockServices = [
373
- { uuid: '176052c7-5fd4-4b33-89cc-7bae6848c65a', display: 'Clinical consultation' },
374
- { uuid: 'd80ff12a-06a7-11ed-b939-0242ac120002', display: 'Triage' },
375
- ];
376
-
377
- export const mockServiceTypes = {
378
- data: [
379
- {
380
- name: 'HIV Clinic',
381
- uuid: '7bff050e-9a83-4fdb-9212-1a4c2cee349b',
382
- duration: 15,
383
- },
384
- {
385
- name: 'Drug Dispense',
386
- uuid: '0e960ced-d35e-43de-b87f-bc08ef3b6ec3',
387
- duration: 15,
388
- },
389
- ],
390
- };
391
-
392
- export const mockFrequency = {
393
- data: [
394
- { uuid: 'b127d100-bccb-4699-b30e-fe60a068ca46', display: 'Daily' },
395
- { uuid: 'dbc32cf4-e11d-4006-b398-c71204cfc0d0', display: 'Weekly' },
396
- { uuid: '6e263ecd-173e-4ee1-a9a5-df1f8d5b274b', display: 'Monthly' },
397
- ],
398
- };
399
-
400
- export const mockProviders = {
401
- data: [
402
- {
403
- uuid: 'f9badd80-ab76-11e2-9e96-0800200c9a66',
404
- person: { uuid: '24252571-dd5a-11e6-9d9c-0242ac150002', display: 'Dr James Cook' },
405
- },
406
- {
407
- uuid: '3191eddf-5cc5-4fa4-94ef-dfc25e8d33e4',
408
- person: { uuid: '89af8ba6-2ec5-4d77-b3ed-7e9e02448e96', display: 'Dr Amstrong Neil' },
409
- },
410
- ],
411
- };
package/dist/285.js DELETED
@@ -1,2 +0,0 @@
1
- /*! For license information please see 285.js.LICENSE.txt */
2
- (self.webpackChunk_openmrs_esm_appointments_app=self.webpackChunk_openmrs_esm_appointments_app||[]).push([[285],{2609:t=>{"use strict";t.exports=function(t){var e=[];return e.toString=function(){return this.map((function(e){var n=t(e);return e[2]?"@media ".concat(e[2]," {").concat(n,"}"):n})).join("")},e.i=function(t,n,r){"string"==typeof t&&(t=[[null,t,""]]);var i={};if(r)for(var s=0;s<this.length;s++){var o=this[s][0];null!=o&&(i[o]=!0)}for(var a=0;a<t.length;a++){var u=[].concat(t[a]);r&&i[u[0]]||(n&&(u[2]?u[2]="".concat(n," and ").concat(u[2]):u[2]=n),e.push(u))}},e}},8879:function(t){t.exports=function(){"use strict";var t=6e4,e=36e5,n="millisecond",r="second",i="minute",s="hour",o="day",a="week",u="month",c="quarter",f="year",d="date",l="Invalid Date",h=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,p=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,v={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],n=t%100;return"["+t+(e[(n-20)%10]||e[n]||e[0])+"]"}},m=function(t,e,n){var r=String(t);return!r||r.length>=e?t:""+Array(e+1-r.length).join(n)+t},g={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return(e<=0?"+":"-")+m(r,2,"0")+":"+m(i,2,"0")},m:function t(e,n){if(e.date()<n.date())return-t(n,e);var r=12*(n.year()-e.year())+(n.month()-e.month()),i=e.clone().add(r,u),s=n-i<0,o=e.clone().add(r+(s?-1:1),u);return+(-(r+(n-i)/(s?i-o:o-i))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(t){return{M:u,y:f,w:a,d:o,D:d,h:s,m:i,s:r,ms:n,Q:c}[t]||String(t||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}},y="en",$={};$[y]=v;var w=function(t){return t instanceof D},S=function t(e,n,r){var i;if(!e)return y;if("string"==typeof e){var s=e.toLowerCase();$[s]&&(i=s),n&&($[s]=n,i=s);var o=e.split("-");if(!i&&o.length>1)return t(o[0])}else{var a=e.name;$[a]=e,i=a}return!r&&i&&(y=i),i||!r&&y},M=function(t,e){if(w(t))return t.clone();var n="object"==typeof e?e:{};return n.date=t,n.args=arguments,new D(n)},b=g;b.l=S,b.i=w,b.w=function(t,e){return M(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var D=function(){function v(t){this.$L=S(t.locale,null,!0),this.parse(t)}var m=v.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(b.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var r=e.match(h);if(r){var i=r[2]-1||0,s=(r[7]||"0").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.$x=t.x||{},this.init()},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},m.$utils=function(){return b},m.isValid=function(){return!(this.$d.toString()===l)},m.isSame=function(t,e){var n=M(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return M(t)<this.startOf(e)},m.isBefore=function(t,e){return this.endOf(e)<M(t)},m.$g=function(t,e,n){return b.u(t)?this[e]:this.set(n,t)},m.unix=function(){return Math.floor(this.valueOf()/1e3)},m.valueOf=function(){return this.$d.getTime()},m.startOf=function(t,e){var n=this,c=!!b.u(e)||e,l=b.p(t),h=function(t,e){var r=b.w(n.$u?Date.UTC(n.$y,e,t):new Date(n.$y,e,t),n);return c?r:r.endOf(o)},p=function(t,e){return b.w(n.toDate()[t].apply(n.toDate("s"),(c?[0,0,0,0]:[23,59,59,999]).slice(e)),n)},v=this.$W,m=this.$M,g=this.$D,y="set"+(this.$u?"UTC":"");switch(l){case f:return c?h(1,0):h(31,11);case u:return c?h(1,m):h(0,m+1);case a:var $=this.$locale().weekStart||0,w=(v<$?v+7:v)-$;return h(c?g-w:g+(6-w),m);case o:case d:return p(y+"Hours",0);case s:return p(y+"Minutes",1);case i:return p(y+"Seconds",2);case r:return p(y+"Milliseconds",3);default:return this.clone()}},m.endOf=function(t){return this.startOf(t,!1)},m.$set=function(t,e){var a,c=b.p(t),l="set"+(this.$u?"UTC":""),h=(a={},a[o]=l+"Date",a[d]=l+"Date",a[u]=l+"Month",a[f]=l+"FullYear",a[s]=l+"Hours",a[i]=l+"Minutes",a[r]=l+"Seconds",a[n]=l+"Milliseconds",a)[c],p=c===o?this.$D+(e-this.$W):e;if(c===u||c===f){var v=this.clone().set(d,1);v.$d[h](p),v.init(),this.$d=v.set(d,Math.min(this.$D,v.daysInMonth())).$d}else h&&this.$d[h](p);return this.init(),this},m.set=function(t,e){return this.clone().$set(t,e)},m.get=function(t){return this[b.p(t)]()},m.add=function(n,c){var d,l=this;n=Number(n);var h=b.p(c),p=function(t){var e=M(l);return b.w(e.date(e.date()+Math.round(t*n)),l)};if(h===u)return this.set(u,this.$M+n);if(h===f)return this.set(f,this.$y+n);if(h===o)return p(1);if(h===a)return p(7);var v=(d={},d[i]=t,d[s]=e,d[r]=1e3,d)[h]||1,m=this.$d.getTime()+n*v;return b.w(m,this)},m.subtract=function(t,e){return this.add(-1*t,e)},m.format=function(t){var e=this,n=this.$locale();if(!this.isValid())return n.invalidDate||l;var r=t||"YYYY-MM-DDTHH:mm:ssZ",i=b.z(this),s=this.$H,o=this.$m,a=this.$M,u=n.weekdays,c=n.months,f=function(t,n,i,s){return t&&(t[n]||t(e,r))||i[n].slice(0,s)},d=function(t){return b.s(s%12||12,t,"0")},h=n.meridiem||function(t,e,n){var r=t<12?"AM":"PM";return n?r.toLowerCase():r},v={YY:String(this.$y).slice(-2),YYYY:this.$y,M:a+1,MM:b.s(a+1,2,"0"),MMM:f(n.monthsShort,a,c,3),MMMM:f(c,a),D:this.$D,DD:b.s(this.$D,2,"0"),d:String(this.$W),dd:f(n.weekdaysMin,this.$W,u,2),ddd:f(n.weekdaysShort,this.$W,u,3),dddd:u[this.$W],H:String(s),HH:b.s(s,2,"0"),h:d(1),hh:d(2),a:h(s,o,!0),A:h(s,o,!1),m:String(o),mm:b.s(o,2,"0"),s:String(this.$s),ss:b.s(this.$s,2,"0"),SSS:b.s(this.$ms,3,"0"),Z:i};return r.replace(p,(function(t,e){return e||v[t]||i.replace(":","")}))},m.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},m.diff=function(n,d,l){var h,p=b.p(d),v=M(n),m=(v.utcOffset()-this.utcOffset())*t,g=this-v,y=b.m(this,v);return y=(h={},h[f]=y/12,h[u]=y,h[c]=y/3,h[a]=(g-m)/6048e5,h[o]=(g-m)/864e5,h[s]=g/e,h[i]=g/t,h[r]=g/1e3,h)[p]||g,l?y:b.a(y)},m.daysInMonth=function(){return this.endOf(u).$D},m.$locale=function(){return $[this.$L]},m.locale=function(t,e){if(!t)return this.$L;var n=this.clone(),r=S(t,e,!0);return r&&(n.$L=r),n},m.clone=function(){return b.w(this.$d,this)},m.toDate=function(){return new Date(this.valueOf())},m.toJSON=function(){return this.isValid()?this.toISOString():null},m.toISOString=function(){return this.$d.toISOString()},m.toString=function(){return this.$d.toUTCString()},v}(),_=D.prototype;return M.prototype=_,[["$ms",n],["$s",r],["$m",i],["$H",s],["$W",o],["$M",u],["$y",f],["$D",d]].forEach((function(t){_[t[1]]=function(e){return this.$g(e,t[0],t[1])}})),M.extend=function(t,e){return t.$i||(t(e,D,M),t.$i=!0),M},M.locale=S,M.isDayjs=w,M.unix=function(t){return M(1e3*t)},M.en=$[y],M.Ls=$,M.p={},M}()},6062:t=>{"use strict";var e=[];function n(t){for(var n=-1,r=0;r<e.length;r++)if(e[r].identifier===t){n=r;break}return n}function r(t,r){for(var s={},o=[],a=0;a<t.length;a++){var u=t[a],c=r.base?u[0]+r.base:u[0],f=s[c]||0,d="".concat(c," ").concat(f);s[c]=f+1;var l=n(d),h={css:u[1],media:u[2],sourceMap:u[3],supports:u[4],layer:u[5]};if(-1!==l)e[l].references++,e[l].updater(h);else{var p=i(h,r);r.byIndex=a,e.splice(a,0,{identifier:d,updater:p,references:1})}o.push(d)}return o}function i(t,e){var n=e.domAPI(e);return n.update(t),function(e){if(e){if(e.css===t.css&&e.media===t.media&&e.sourceMap===t.sourceMap&&e.supports===t.supports&&e.layer===t.layer)return;n.update(t=e)}else n.remove()}}t.exports=function(t,i){var s=r(t=t||[],i=i||{});return function(t){t=t||[];for(var o=0;o<s.length;o++){var a=n(s[o]);e[a].references--}for(var u=r(t,i),c=0;c<s.length;c++){var f=n(s[c]);0===e[f].references&&(e[f].updater(),e.splice(f,1))}s=u}}},6793:t=>{"use strict";var e={};t.exports=function(t,n){var r=function(t){if(void 0===e[t]){var n=document.querySelector(t);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(t){n=null}e[t]=n}return e[t]}(t);if(!r)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");r.appendChild(n)}},1173:t=>{"use strict";t.exports=function(t){var e=document.createElement("style");return t.setAttributes(e,t.attributes),t.insert(e,t.options),e}},7892:(t,e,n)=>{"use strict";t.exports=function(t){var e=n.nc;e&&t.setAttribute("nonce",e)}},4036:t=>{"use strict";t.exports=function(t){var e=t.insertStyleElement(t);return{update:function(n){!function(t,e,n){var r="";n.supports&&(r+="@supports (".concat(n.supports,") {")),n.media&&(r+="@media ".concat(n.media," {"));var i=void 0!==n.layer;i&&(r+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),r+=n.css,i&&(r+="}"),n.media&&(r+="}"),n.supports&&(r+="}");var s=n.sourceMap;s&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(s))))," */")),e.styleTagTransform(r,t,e.options)}(e,t,n)},remove:function(){!function(t){if(null===t.parentNode)return!1;t.parentNode.removeChild(t)}(e)}}}},2464:t=>{"use strict";t.exports=function(t,e){if(e.styleSheet)e.styleSheet.cssText=t;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(t))}}},452:(t,e,n)=>{"use strict";var r=n(268),i="function"==typeof Object.is?Object.is:function(t,e){return t===e&&(0!==t||1/t==1/e)||t!=t&&e!=e},s=r.useState,o=r.useEffect,a=r.useLayoutEffect,u=r.useDebugValue;function c(t){var e=t.getSnapshot;t=t.value;try{var n=e();return!i(t,n)}catch(t){return!0}}var f="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(t,e){return e()}:function(t,e){var n=e(),r=s({inst:{value:n,getSnapshot:e}}),i=r[0].inst,f=r[1];return a((function(){i.value=n,i.getSnapshot=e,c(i)&&f({inst:i})}),[t,n,e]),o((function(){return c(i)&&f({inst:i}),t((function(){c(i)&&f({inst:i})}))}),[t]),u(n),n};e.useSyncExternalStore=void 0!==r.useSyncExternalStore?r.useSyncExternalStore:f},3100:(t,e,n)=>{"use strict";t.exports=n(452)},9984:(t,e,n)=>{"use strict";n.d(e,{J$:()=>q,ZP:()=>z,JG:()=>A,kY:()=>J});var r=n(268),i=n(3100);const s=new WeakMap,o={},a=()=>{},u=a(),c=Object,f=t=>t===u,d=t=>"function"==typeof t,l=(t,e)=>({...t,...e}),h="undefined",p=typeof window!=h,v=typeof document!=h,m=(t,e)=>{const n=s.get(t);return[()=>t.get(e)||o,r=>{const i=t.get(e);n[5](e,l(i,r),i||o)},n[6]]},g=new WeakMap;let y=0;const $=t=>{const e=typeof t,n=t&&t.constructor,r=n==Date;let i,s;if(c(t)!==t||r||n==RegExp)i=r?t.toJSON():"symbol"==e?t.toString():"string"==e?JSON.stringify(t):""+t;else{if(i=g.get(t),i)return i;if(i=++y+"~",g.set(t,i),n==Array){for(i="@",s=0;s<t.length;s++)i+=$(t[s])+",";g.set(t,i)}if(n==c){i="#";const e=c.keys(t).sort();for(;!f(s=e.pop());)f(t[s])||(i+=s+":"+$(t[s])+",");g.set(t,i)}}return i};let w=!0;const[S,M]=p&&window.addEventListener?[window.addEventListener.bind(window),window.removeEventListener.bind(window)]:[a,a],b={isOnline:()=>w,isVisible:()=>{const t=v&&document.visibilityState;return f(t)||"hidden"!==t}},D={initFocus:t=>(v&&document.addEventListener("visibilitychange",t),S("focus",t),()=>{v&&document.removeEventListener("visibilitychange",t),M("focus",t)}),initReconnect:t=>{const e=()=>{w=!0,t()},n=()=>{w=!1};return S("online",e),S("offline",n),()=>{M("online",e),M("offline",n)}}},_=!r.useId,O=!p||"Deno"in window,E=O?r.useEffect:r.useLayoutEffect,T="undefined"!=typeof navigator&&navigator.connection,k=!O&&T&&(["slow-2g","2g"].includes(T.effectiveType)||T.saveData),x=t=>{if(d(t))try{t=t()}catch(e){t=""}const e=t;return[t="string"==typeof t?t:(Array.isArray(t)?t.length:t)?$(t):"",e]};let C=0;const L=()=>++C;async function R(...t){const[e,n,r,i]=t,o=l({populateCache:!0,throwOnError:!0},"boolean"==typeof i?{revalidate:i}:i||{});let a=o.populateCache;const c=o.rollbackOnError;let h=o.optimisticData;const p=!1!==o.revalidate,v=o.throwOnError;if(d(n)){const t=n,r=[],i=e.keys();for(let n=i.next();!n.done;n=i.next()){const i=n.value;!i.startsWith("$inf$")&&t(e.get(i)._k)&&r.push(i)}return Promise.all(r.map(g))}return g(n);async function g(n){const[i]=x(n);if(!i)return;const[o,l]=m(e,i),[g,y,$]=s.get(e),w=g[i],S=()=>p&&(delete $[i],w&&w[0])?w[0](2).then((()=>o().data)):o().data;if(t.length<3)return S();let M,b=r;const D=L();y[i]=[D,0];const _=!f(h),O=o(),E=O.data,T=O._c,k=f(T)?E:T;if(_&&(h=d(h)?h(k):h,l({data:h,_c:k})),d(b))try{b=b(k)}catch(t){M=t}if(b&&d(b.then)){if(b=await b.catch((t=>{M=t})),D!==y[i][0]){if(M)throw M;return b}M&&_&&(t=>"function"==typeof c?c(t):!1!==c)(M)&&(a=!0,b=k,l({data:b,_c:u}))}a&&(M||(d(a)&&(b=a(b,k)),l({data:b,_c:u}))),y[i][1]=L();const C=await S();if(l({_c:u}),!M)return a?C:b;if(v)throw M}}const I=(t,e)=>{for(const n in t)t[n][0]&&t[n][0](e)},V=(t,e)=>{if(!s.has(t)){const n=l(D,e),r={},i=R.bind(u,t);let o=a;const c={},f=(t,e)=>{const n=c[t]||[];return c[t]=n,n.push(e),()=>n.splice(n.indexOf(e),1)},d=(e,n,r)=>{t.set(e,n);const i=c[e];if(i)for(let t=i.length;t--;)i[t](r,n)},h=()=>{if(!s.has(t)&&(s.set(t,[r,{},{},{},i,d,f]),!O)){const e=n.initFocus(setTimeout.bind(u,I.bind(u,r,0))),i=n.initReconnect(setTimeout.bind(u,I.bind(u,r,1)));o=()=>{e&&e(),i&&i(),s.delete(t)}}};return h(),[t,i,h,o]}return[t,s.get(t)[4]]},[W,A]=V(new Map),H=l({onLoadingSlow:a,onSuccess:a,onError:a,onErrorRetry:(t,e,n,r,i)=>{const s=n.errorRetryCount,o=i.retryCount,a=~~((Math.random()+.5)*(1<<(o<8?o:8)))*n.errorRetryInterval;!f(s)&&o>s||setTimeout(r,a,i)},onDiscarded:a,revalidateOnFocus:!0,revalidateOnReconnect:!0,revalidateIfStale:!0,shouldRetryOnError:!0,errorRetryInterval:k?1e4:5e3,focusThrottleInterval:5e3,dedupingInterval:2e3,loadingTimeout:k?5e3:3e3,compare:(t,e)=>$(t)==$(e),isPaused:()=>!1,cache:W,mutate:A,fallback:{}},b),Y=(t,e)=>{const n=l(t,e);if(e){const{use:r,fallback:i}=t,{use:s,fallback:o}=e;r&&s&&(n.use=r.concat(s)),i&&o&&(n.fallback=l(i,o))}return n},F=(0,r.createContext)({}),P=p&&window.__SWR_DEVTOOLS_USE__,N=P?window.__SWR_DEVTOOLS_USE__:[],J=()=>l(H,(0,r.useContext)(F)),U=N.concat((t=>(e,n,r)=>t(e,n&&((...t)=>{const r=x(e)[0],[,,,i]=s.get(W),o=i[r];return o?(delete i[r],o):n(...t)}),r)));P&&(window.__SWR_DEVTOOLS_REACT__=r);const j={dedupe:!0},q=c.defineProperty((t=>{const{value:e}=t,n=(0,r.useContext)(F),i=d(e),s=(0,r.useMemo)((()=>i?e(n):e),[i,n,e]),o=(0,r.useMemo)((()=>i?s:Y(n,s)),[i,n,s]),a=s&&s.provider,[c]=(0,r.useState)((()=>a?V(a(o.cache||W),s):u));return c&&(o.cache=c[0],o.mutate=c[1]),E((()=>{if(c)return c[2]&&c[2](),c[3]}),[]),(0,r.createElement)(F.Provider,l(t,{value:o}))}),"defaultValue",{value:H});var Z,z=(Z=(t,e,n)=>{const{cache:o,compare:a,suspense:c,fallbackData:v,revalidateOnMount:g,refreshInterval:y,refreshWhenHidden:$,refreshWhenOffline:w,keepPreviousData:S}=n,[M,b,D]=s.get(o),[T,k]=x(t),C=(0,r.useRef)(!1),I=(0,r.useRef)(!1),V=(0,r.useRef)(T),W=(0,r.useRef)(e),A=(0,r.useRef)(n),H=()=>A.current,Y=()=>H().isVisible()&&H().isOnline(),[F,P,N]=m(o,T),J=(0,r.useRef)({}).current,U=f(v)?n.fallback[T]:v,q=(t,e)=>{let n=!0;for(const r in J){const i=r;a(e[i],t[i])||"data"===i&&f(t[i])&&a(e[i],tt)||(n=!1)}return n},Z=(0,r.useMemo)((()=>{const t=!!T&&!!e&&(f(g)?!H().isPaused()&&!c:g),n=()=>{const e=F(),n=l(e);return delete n._k,t?{isValidating:!0,isLoading:!0,...n}:n};let r=n();return()=>{const t=n();return q(t,r)?r:r=t}}),[o,T]),z=(0,i.useSyncExternalStore)((0,r.useCallback)((t=>N(T,((e,n)=>{q(e,n)||t()}))),[o,T]),Z,Z),B=!C.current,G=z.data,Q=f(G)?U:G,K=z.error,X=(0,r.useRef)(Q),tt=S?f(G)?X.current:G:Q,et=B&&!f(g)?g:!H().isPaused()&&(c?!f(Q)&&n.revalidateIfStale:f(Q)||n.revalidateIfStale),nt=!!(T&&e&&B&&et),rt=f(z.isValidating)?nt:z.isValidating,it=f(z.isLoading)?nt:z.isLoading,st=(0,r.useCallback)((async t=>{const e=W.current;if(!T||!e||I.current||H().isPaused())return!1;let r,i,s=!0;const o=t||{},c=!D[T]||!o.dedupe,l=()=>_?!I.current&&T===V.current&&C.current:T===V.current,h={isValidating:!1,isLoading:!1},p=()=>{P(h)},v=()=>{const t=D[T];t&&t[1]===i&&delete D[T]},m={isValidating:!0};f(F().data)&&(m.isLoading=!0);try{if(c&&(P(m),n.loadingTimeout&&f(F().data)&&setTimeout((()=>{s&&l()&&H().onLoadingSlow(T,n)}),n.loadingTimeout),D[T]=[e(k),L()]),[r,i]=D[T],r=await r,c&&setTimeout(v,n.dedupingInterval),!D[T]||D[T][1]!==i)return c&&l()&&H().onDiscarded(T),!1;h.error=u;const t=b[T];if(!f(t)&&(i<=t[0]||i<=t[1]||0===t[1]))return p(),c&&l()&&H().onDiscarded(T),!1;const o=F().data;h.data=a(o,r)?o:r,c&&l()&&H().onSuccess(r,T,n)}catch(t){v();const e=H(),{shouldRetryOnError:n}=e;e.isPaused()||(h.error=t,c&&l()&&(e.onError(t,T,e),(!0===n||d(n)&&n(t))&&Y()&&e.onErrorRetry(t,T,e,st,{retryCount:(o.retryCount||0)+1,dedupe:!0})))}return s=!1,p(),!0}),[T,o]),ot=(0,r.useCallback)(((...t)=>R(o,V.current,...t)),[]);if(E((()=>{W.current=e,A.current=n,f(G)||(X.current=G)})),E((()=>{if(!T)return;const t=st.bind(u,j);let e=0;const n=((t,e,n)=>{const r=e[t]||(e[t]=[]);return r.push(n),()=>{const t=r.indexOf(n);t>=0&&(r[t]=r[r.length-1],r.pop())}})(T,M,(n=>{if(0==n){const n=Date.now();H().revalidateOnFocus&&n>e&&Y()&&(e=n+H().focusThrottleInterval,t())}else if(1==n)H().revalidateOnReconnect&&Y()&&t();else if(2==n)return st()}));return I.current=!1,V.current=T,C.current=!0,P({_k:k}),et&&(f(Q)||O?t():(r=t,p&&typeof window.requestAnimationFrame!=h?window.requestAnimationFrame(r):setTimeout(r,1))),()=>{I.current=!0,n()};var r}),[T]),E((()=>{let t;function e(){const e=d(y)?y(Q):y;e&&-1!==t&&(t=setTimeout(n,e))}function n(){F().error||!$&&!H().isVisible()||!w&&!H().isOnline()?e():st(j).then(e)}return e(),()=>{t&&(clearTimeout(t),t=-1)}}),[y,$,w,T]),(0,r.useDebugValue)(tt),c&&f(Q)&&T){if(!_&&O)throw new Error("Fallback data is required when using suspense in SSR.");throw W.current=e,A.current=n,I.current=!1,f(K)?st(j):K}return{mutate:ot,get data(){return J.data=!0,tt},get error(){return J.error=!0,K},get isValidating(){return J.isValidating=!0,rt},get isLoading(){return J.isLoading=!0,it}}},function(...t){const e=J(),[n,r,i]=(t=>d(t[1])?[t[0],t[1],t[2]||{}]:[t[0],null,(null===t[1]?t[2]:t[1])||{}])(t),s=Y(e,i);let o=Z;const{use:a}=s,u=(a||[]).concat(U);for(let t=u.length;t--;)o=u[t](o);return o(n,r||s.fetcher||null,s)})}}]);
File without changes