@mediquo/elements 0.8.0 → 0.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +61 -5
- package/dist/chunks/action-unavailable-message-BIgsXk9u.js +1 -0
- package/dist/chunks/api-chat-client-CJ1EGJe3.js +1 -0
- package/dist/chunks/api-client-context-V1UAGtKW.js +1 -0
- package/dist/chunks/{apple-pay-outcomes-BpcbdGfO.js → apple-pay-outcomes-B1LrUXHR.js} +1 -1
- package/dist/chunks/appointment-action-unavailable-dialog-CTiL4nMo.d.ts +54 -0
- package/dist/chunks/{appointment-card-skeleton-B7dKtGv0.d.ts → appointment-card-skeleton-C2Sim4nR.d.ts} +5 -3
- package/dist/chunks/appointment-card-skeleton-D8gypuKh.js +1 -0
- package/dist/chunks/appointment-details-DXLBQnPN.js +1 -0
- package/dist/chunks/chunk-6CCJWPGL-TiaqZaPV.js +1 -0
- package/dist/chunks/{chunk-BUV4MGML-Bn3JWCAv.js → chunk-BUV4MGML-CkhBbfUu.js} +1 -1
- package/dist/chunks/chunk-HN62IQ7S-xbkIy7k_.js +1 -0
- package/dist/chunks/chunk-Y4EKUX25-QqMl3eiq.js +1 -0
- package/dist/chunks/consume-CovVqBjI.js +1 -0
- package/dist/chunks/{chunk-6CCJWPGL-DlOpbEYH.js → context-consumer-ESdICVAb.js} +1 -1
- package/dist/chunks/documentation-view-BbMbGneD.js +1 -0
- package/dist/chunks/{get-appointment-query-lJe75hGS.js → get-appointment-query-C-gTTuiQ.js} +1 -1
- package/dist/chunks/{get-organization-setup-query-DxHNY0w8.js → get-organization-setup-query-Dr1cXnHl.js} +1 -1
- package/dist/chunks/{get-patient-documents-query-D1SfC_k_.js → get-patient-documents-query-NC9xCa_N.js} +1 -1
- package/dist/chunks/{get-patient-profile-query-DiU2f_QH.js → get-patient-profile-query-4AO6xvVn.js} +1 -1
- package/dist/chunks/{get-schedule-services-query-Ckvz9Fqh.js → get-schedule-services-query-Fzvb9ug9.js} +1 -1
- package/dist/chunks/index-Bw-MbGKw.js +1 -0
- package/dist/chunks/{index-Ca-l41nB.js → index-CXb3gOFA.js} +1 -1
- package/dist/chunks/{index-63zQSBy4.js → index-CyteNROM.js} +1 -1
- package/dist/chunks/index-D6Hg-beW.js +1 -0
- package/dist/chunks/{index-CDBk7hVW.d.ts → index-DTEtqjQF.d.ts} +0 -13
- package/dist/chunks/{index-czcKClL3.d.ts → index-Dbbpnw8f.d.ts} +8 -0
- package/dist/chunks/index-DdkeWQrh.d.ts +53 -0
- package/dist/chunks/index-Nf3nZ9O3.d.ts +16 -0
- package/dist/chunks/index-iaTXVzFa.js +1 -0
- package/dist/chunks/index-uHvVQMNc.js +1 -0
- package/dist/chunks/index.d-XSe7Hy-Q.d.ts +2989 -0
- package/dist/chunks/login-token-task-Yib__6a9.js +1 -0
- package/dist/chunks/{mq-chat-room-CRPruRJD.d.ts → mq-chat-room-jeDvIF1Z.d.ts} +12 -227
- package/dist/chunks/mq-layout-E5mKSz4A.js +1 -0
- package/dist/chunks/{index-CSJzkkRA.d.ts → mq-layout-TG2K4zRv.d.ts} +20 -0
- package/dist/chunks/provide-BwI4DDGF.js +1 -0
- package/dist/chunks/query-controller-BlO1Ax65.js +1 -0
- package/dist/chunks/refund-cancel-policy-CcsJ-pMx.js +1 -0
- package/dist/chunks/{schemas.d-D7bCe24u.d.ts → schemas.d-b6_AekBb.d.ts} +12 -1
- package/dist/chunks/telemetry-client-7fvNqUSU.js +1 -0
- package/dist/env.js +1 -1
- package/dist/i18n.js +1 -1
- package/dist/mq-api-client-provider.d.ts +39 -0
- package/dist/mq-api-client-provider.js +1 -0
- package/dist/mq-apple-pay-checkout.d.ts +12 -0
- package/dist/mq-apple-pay-checkout.js +1 -1
- package/dist/mq-appointment-checkout.d.ts +3 -1
- package/dist/mq-appointment-checkout.js +1 -1
- package/dist/mq-appointment-documentation.d.ts +13 -4
- package/dist/mq-appointment-documentation.js +1 -1
- package/dist/mq-chat-room.d.ts +5 -2
- package/dist/mq-chat-room.js +1 -1
- package/dist/mq-checkout.d.ts +21 -1
- package/dist/mq-checkout.js +1 -1
- package/dist/mq-dashboard.d.ts +21 -120
- package/dist/mq-dashboard.js +1 -1
- package/dist/mq-documents.d.ts +21 -7
- package/dist/mq-documents.js +1 -1
- package/dist/mq-google-pay-checkout.d.ts +12 -0
- package/dist/mq-google-pay-checkout.js +1 -1
- package/dist/mq-immediate-videocall-checkout.d.ts +3 -0
- package/dist/mq-immediate-videocall-checkout.js +1 -1
- package/dist/mq-my-appointments.d.ts +11 -7
- package/dist/mq-my-appointments.js +1 -1
- package/dist/mq-next-appointments.d.ts +17 -6
- package/dist/mq-next-appointments.js +1 -1
- package/dist/mq-payment-poller.d.ts +11 -0
- package/dist/mq-payment-poller.js +1 -1
- package/dist/mq-professional-presence-sync.d.ts +1 -0
- package/dist/mq-professional-presence-sync.js +1 -1
- package/dist/mq-query-client-provider.d.ts +4 -1
- package/dist/mq-query-client-provider.js +1 -1
- package/dist/mq-recent-documents.d.ts +19 -30
- package/dist/mq-recent-documents.js +1 -1
- package/dist/mq-schedule-success.d.ts +12 -2
- package/dist/mq-schedule-success.js +2 -2
- package/dist/mq-schedule.d.ts +24 -220
- package/dist/mq-schedule.js +1 -1
- package/dist/mq-session-provider.d.ts +1 -1
- package/dist/mq-session-provider.js +1 -1
- package/dist/mq-socket-provider.js +1 -1
- package/dist/mq-support-chat.d.ts +12 -2
- package/dist/mq-support-chat.js +1 -1
- package/dist/mq-terms-and-conditions.d.ts +5 -1
- package/dist/mq-terms-and-conditions.js +1 -1
- package/dist/mq-unread-count-sync.d.ts +1 -0
- package/dist/mq-unread-count-sync.js +1 -1
- package/dist/mq-videocall.d.ts +13 -3
- package/dist/mq-videocall.js +1 -1
- package/dist/react/mq-api-client-provider.d.ts +26 -0
- package/dist/react/mq-api-client-provider.js +2 -0
- package/dist/react/mq-apple-pay-checkout.d.ts +4 -1
- package/dist/react/mq-apple-pay-checkout.js +1 -1
- package/dist/react/mq-appointment-checkout.d.ts +3 -1
- package/dist/react/mq-appointment-checkout.js +1 -1
- package/dist/react/mq-appointment-documentation.d.ts +6 -4
- package/dist/react/mq-appointment-documentation.js +1 -1
- package/dist/react/mq-chat-room.d.ts +5 -2
- package/dist/react/mq-chat-room.js +1 -1
- package/dist/react/mq-checkout.d.ts +4 -1
- package/dist/react/mq-checkout.js +1 -1
- package/dist/react/mq-dashboard.d.ts +12 -11
- package/dist/react/mq-dashboard.js +1 -1
- package/dist/react/mq-documents-page.d.ts +7 -3
- package/dist/react/mq-documents-page.js +1 -1
- package/dist/react/mq-documents.d.ts +7 -3
- package/dist/react/mq-documents.js +1 -1
- package/dist/react/mq-google-pay-checkout.d.ts +4 -1
- package/dist/react/mq-google-pay-checkout.js +1 -1
- package/dist/react/mq-immediate-videocall-checkout.d.ts +3 -0
- package/dist/react/mq-immediate-videocall-checkout.js +1 -1
- package/dist/react/mq-my-appointments.d.ts +10 -8
- package/dist/react/mq-my-appointments.js +1 -1
- package/dist/react/mq-next-appointments.d.ts +12 -8
- package/dist/react/mq-next-appointments.js +1 -1
- package/dist/react/mq-payment-poller.d.ts +4 -0
- package/dist/react/mq-payment-poller.js +1 -1
- package/dist/react/mq-professional-presence-sync.js +1 -1
- package/dist/react/mq-query-client-provider.d.ts +1 -0
- package/dist/react/mq-query-client-provider.js +1 -1
- package/dist/react/mq-recent-documents.d.ts +8 -3
- package/dist/react/mq-recent-documents.js +1 -1
- package/dist/react/mq-schedule-success.d.ts +5 -2
- package/dist/react/mq-schedule-success.js +1 -1
- package/dist/react/mq-schedule.d.ts +4 -2
- package/dist/react/mq-schedule.js +1 -1
- package/dist/react/mq-session-provider.d.ts +1 -1
- package/dist/react/mq-session-provider.js +1 -1
- package/dist/react/mq-socket-provider.js +1 -1
- package/dist/react/mq-support-chat.d.ts +5 -2
- package/dist/react/mq-support-chat.js +1 -1
- package/dist/react/mq-terms-and-conditions.d.ts +5 -1
- package/dist/react/mq-terms-and-conditions.js +1 -1
- package/dist/react/mq-toast-container.js +1 -1
- package/dist/react/mq-unread-count-sync.js +1 -1
- package/dist/react/mq-videocall.d.ts +6 -4
- package/dist/react/mq-videocall.js +1 -1
- package/dist/theme.js +1 -1
- package/dist/ui/icons/download-02-icon.d.ts +6 -0
- package/dist/ui/icons/download-02-icon.js +1 -0
- package/dist/ui/mq-calendar.js +1 -1
- package/dist/ui/mq-clamped-text.js +1 -1
- package/package.json +5 -1
- package/dist/chunks/action-unavailable-message-CRLimFj5.js +0 -1
- package/dist/chunks/api-chat-client-BiiYnU-b.js +0 -1
- package/dist/chunks/appointment-action-unavailable-dialog-Da2IATYj.d.ts +0 -321
- package/dist/chunks/appointment-card-skeleton-ZfTAElLq.js +0 -1
- package/dist/chunks/appointment-details-Bm3Uuw2g.js +0 -1
- package/dist/chunks/chunk-Y4EKUX25-CqL3lLdx.js +0 -1
- package/dist/chunks/consume-BhoQNO_8.js +0 -1
- package/dist/chunks/context-provider--AKuwfs9.js +0 -1
- package/dist/chunks/documentation-view-CTnpWIxq.js +0 -1
- package/dist/chunks/i18n-formats-EgnwLxKt.js +0 -1
- package/dist/chunks/index-CZ9HtP96.js +0 -1
- package/dist/chunks/index-DMiowcMQ.js +0 -1
- package/dist/chunks/index-DZjrAnPq.js +0 -1
- package/dist/chunks/login-token-task-BI-L2zSV.js +0 -1
- package/dist/chunks/mq-layout-BndHxkbb.js +0 -1
- package/dist/chunks/mq-layout-D8Mak16a.d.ts +0 -21
- package/dist/chunks/provide-D2fnEhT2.js +0 -1
- package/dist/chunks/query-controller-D7jBX4X7.js +0 -1
- package/dist/chunks/refund-cancel-policy-DV6bzqcu.js +0 -1
- package/dist/chunks/schemas.d-Bss7CeCZ.d.ts +0 -53
- package/dist/chunks/telemetry-client-Bkbn48Dd.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{h as a}from"./task-Bj8p7kJX.js";var s=class extends a{constructor(a,s,t){super(a,{task:async([a,t])=>await s().auth.loginToken({api_key:a,token:t}),...t})}};export{s as L};
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import * as lit_html from 'lit-html';
|
|
2
2
|
import * as lit from 'lit';
|
|
3
3
|
import { LitElement, PropertyValues } from 'lit';
|
|
4
|
+
import { M as MediquoApiChatClient, a as Message, I as ImageMessage, F as FileMessage } from './index.d-XSe7Hy-Q.js';
|
|
4
5
|
import '../ui/mq-avatar.js';
|
|
5
6
|
import '../ui/mq-button.js';
|
|
6
7
|
import '../ui/mq-skeleton.js';
|
|
7
|
-
import { z } from 'zod';
|
|
8
8
|
import { C as ConsultationType } from './appointment.model.d-BWwBLaEL.js';
|
|
9
|
+
import { z } from 'zod';
|
|
9
10
|
import { QueryClient } from '@tanstack/query-core';
|
|
10
11
|
|
|
11
12
|
/**
|
|
@@ -13,6 +14,7 @@ import { QueryClient } from '@tanstack/query-core';
|
|
|
13
14
|
* @fires mq-chat-room-close when the close button is clicked
|
|
14
15
|
*/
|
|
15
16
|
declare class ChatRoomHeader extends LitElement {
|
|
17
|
+
apiClient: MediquoApiChatClient;
|
|
16
18
|
static styles: lit.CSSResult;
|
|
17
19
|
professionalHash: string;
|
|
18
20
|
hideCloseButton: boolean;
|
|
@@ -30,232 +32,6 @@ declare global {
|
|
|
30
32
|
}
|
|
31
33
|
}
|
|
32
34
|
|
|
33
|
-
declare const StringMessageSchema: z.ZodObject<{
|
|
34
|
-
roomId: z.ZodNumber;
|
|
35
|
-
messageId: z.ZodString;
|
|
36
|
-
string: z.ZodString;
|
|
37
|
-
status: z.ZodNumber;
|
|
38
|
-
senderType: z.ZodEnum<["ordinary", "system"]>;
|
|
39
|
-
fromUserHash: z.ZodString;
|
|
40
|
-
auto: z.ZodUnion<[z.ZodLiteral<0>, z.ZodLiteral<1>]>;
|
|
41
|
-
createdAt: z.ZodNullable<z.ZodString>;
|
|
42
|
-
deletedAt: z.ZodNullable<z.ZodString>;
|
|
43
|
-
time: z.ZodNullable<z.ZodNumber>;
|
|
44
|
-
} & {
|
|
45
|
-
type: z.ZodLiteral<"string">;
|
|
46
|
-
attachment: z.ZodNull;
|
|
47
|
-
}, "strip", z.ZodTypeAny, {
|
|
48
|
-
string: string;
|
|
49
|
-
type: "string";
|
|
50
|
-
status: number;
|
|
51
|
-
roomId: number;
|
|
52
|
-
messageId: string;
|
|
53
|
-
senderType: "ordinary" | "system";
|
|
54
|
-
fromUserHash: string;
|
|
55
|
-
auto: 0 | 1;
|
|
56
|
-
createdAt: string | null;
|
|
57
|
-
deletedAt: string | null;
|
|
58
|
-
time: number | null;
|
|
59
|
-
attachment: null;
|
|
60
|
-
}, {
|
|
61
|
-
string: string;
|
|
62
|
-
type: "string";
|
|
63
|
-
status: number;
|
|
64
|
-
roomId: number;
|
|
65
|
-
messageId: string;
|
|
66
|
-
senderType: "ordinary" | "system";
|
|
67
|
-
fromUserHash: string;
|
|
68
|
-
auto: 0 | 1;
|
|
69
|
-
createdAt: string | null;
|
|
70
|
-
deletedAt: string | null;
|
|
71
|
-
time: number | null;
|
|
72
|
-
attachment: null;
|
|
73
|
-
}>;
|
|
74
|
-
declare const FileMessageSchema: z.ZodObject<{
|
|
75
|
-
roomId: z.ZodNumber;
|
|
76
|
-
messageId: z.ZodString;
|
|
77
|
-
string: z.ZodString;
|
|
78
|
-
status: z.ZodNumber;
|
|
79
|
-
senderType: z.ZodEnum<["ordinary", "system"]>;
|
|
80
|
-
fromUserHash: z.ZodString;
|
|
81
|
-
auto: z.ZodUnion<[z.ZodLiteral<0>, z.ZodLiteral<1>]>;
|
|
82
|
-
createdAt: z.ZodNullable<z.ZodString>;
|
|
83
|
-
deletedAt: z.ZodNullable<z.ZodString>;
|
|
84
|
-
time: z.ZodNullable<z.ZodNumber>;
|
|
85
|
-
} & {
|
|
86
|
-
type: z.ZodLiteral<"file">;
|
|
87
|
-
attachment: z.ZodObject<{
|
|
88
|
-
file_name: z.ZodString;
|
|
89
|
-
file_size: z.ZodNumber;
|
|
90
|
-
url: z.ZodString;
|
|
91
|
-
signed_url: z.ZodNullable<z.ZodString>;
|
|
92
|
-
type: z.ZodEnum<["uncategorized", "voice_note"]>;
|
|
93
|
-
meta: z.ZodObject<{
|
|
94
|
-
duration: z.ZodNumber;
|
|
95
|
-
}, "strip", z.ZodTypeAny, {
|
|
96
|
-
duration: number;
|
|
97
|
-
}, {
|
|
98
|
-
duration: number;
|
|
99
|
-
}>;
|
|
100
|
-
}, "strip", z.ZodTypeAny, {
|
|
101
|
-
url: string;
|
|
102
|
-
type: "uncategorized" | "voice_note";
|
|
103
|
-
file_name: string;
|
|
104
|
-
meta: {
|
|
105
|
-
duration: number;
|
|
106
|
-
};
|
|
107
|
-
file_size: number;
|
|
108
|
-
signed_url: string | null;
|
|
109
|
-
}, {
|
|
110
|
-
url: string;
|
|
111
|
-
type: "uncategorized" | "voice_note";
|
|
112
|
-
file_name: string;
|
|
113
|
-
meta: {
|
|
114
|
-
duration: number;
|
|
115
|
-
};
|
|
116
|
-
file_size: number;
|
|
117
|
-
signed_url: string | null;
|
|
118
|
-
}>;
|
|
119
|
-
}, "strip", z.ZodTypeAny, {
|
|
120
|
-
string: string;
|
|
121
|
-
type: "file";
|
|
122
|
-
status: number;
|
|
123
|
-
roomId: number;
|
|
124
|
-
messageId: string;
|
|
125
|
-
senderType: "ordinary" | "system";
|
|
126
|
-
fromUserHash: string;
|
|
127
|
-
auto: 0 | 1;
|
|
128
|
-
createdAt: string | null;
|
|
129
|
-
deletedAt: string | null;
|
|
130
|
-
time: number | null;
|
|
131
|
-
attachment: {
|
|
132
|
-
url: string;
|
|
133
|
-
type: "uncategorized" | "voice_note";
|
|
134
|
-
file_name: string;
|
|
135
|
-
meta: {
|
|
136
|
-
duration: number;
|
|
137
|
-
};
|
|
138
|
-
file_size: number;
|
|
139
|
-
signed_url: string | null;
|
|
140
|
-
};
|
|
141
|
-
}, {
|
|
142
|
-
string: string;
|
|
143
|
-
type: "file";
|
|
144
|
-
status: number;
|
|
145
|
-
roomId: number;
|
|
146
|
-
messageId: string;
|
|
147
|
-
senderType: "ordinary" | "system";
|
|
148
|
-
fromUserHash: string;
|
|
149
|
-
auto: 0 | 1;
|
|
150
|
-
createdAt: string | null;
|
|
151
|
-
deletedAt: string | null;
|
|
152
|
-
time: number | null;
|
|
153
|
-
attachment: {
|
|
154
|
-
url: string;
|
|
155
|
-
type: "uncategorized" | "voice_note";
|
|
156
|
-
file_name: string;
|
|
157
|
-
meta: {
|
|
158
|
-
duration: number;
|
|
159
|
-
};
|
|
160
|
-
file_size: number;
|
|
161
|
-
signed_url: string | null;
|
|
162
|
-
};
|
|
163
|
-
}>;
|
|
164
|
-
declare const ImageMessageSchema: z.ZodObject<{
|
|
165
|
-
roomId: z.ZodNumber;
|
|
166
|
-
messageId: z.ZodString;
|
|
167
|
-
string: z.ZodString;
|
|
168
|
-
status: z.ZodNumber;
|
|
169
|
-
senderType: z.ZodEnum<["ordinary", "system"]>;
|
|
170
|
-
fromUserHash: z.ZodString;
|
|
171
|
-
auto: z.ZodUnion<[z.ZodLiteral<0>, z.ZodLiteral<1>]>;
|
|
172
|
-
createdAt: z.ZodNullable<z.ZodString>;
|
|
173
|
-
deletedAt: z.ZodNullable<z.ZodString>;
|
|
174
|
-
time: z.ZodNullable<z.ZodNumber>;
|
|
175
|
-
} & {
|
|
176
|
-
type: z.ZodLiteral<"image">;
|
|
177
|
-
attachment: z.ZodObject<{
|
|
178
|
-
file_name: z.ZodString;
|
|
179
|
-
file_size: z.ZodNumber;
|
|
180
|
-
url: z.ZodString;
|
|
181
|
-
signed_url: z.ZodNullable<z.ZodString>;
|
|
182
|
-
type: z.ZodEnum<["uncategorized", "voice_note"]>;
|
|
183
|
-
meta: z.ZodObject<{
|
|
184
|
-
duration: z.ZodNumber;
|
|
185
|
-
}, "strip", z.ZodTypeAny, {
|
|
186
|
-
duration: number;
|
|
187
|
-
}, {
|
|
188
|
-
duration: number;
|
|
189
|
-
}>;
|
|
190
|
-
}, "strip", z.ZodTypeAny, {
|
|
191
|
-
url: string;
|
|
192
|
-
type: "uncategorized" | "voice_note";
|
|
193
|
-
file_name: string;
|
|
194
|
-
meta: {
|
|
195
|
-
duration: number;
|
|
196
|
-
};
|
|
197
|
-
file_size: number;
|
|
198
|
-
signed_url: string | null;
|
|
199
|
-
}, {
|
|
200
|
-
url: string;
|
|
201
|
-
type: "uncategorized" | "voice_note";
|
|
202
|
-
file_name: string;
|
|
203
|
-
meta: {
|
|
204
|
-
duration: number;
|
|
205
|
-
};
|
|
206
|
-
file_size: number;
|
|
207
|
-
signed_url: string | null;
|
|
208
|
-
}>;
|
|
209
|
-
}, "strip", z.ZodTypeAny, {
|
|
210
|
-
string: string;
|
|
211
|
-
type: "image";
|
|
212
|
-
status: number;
|
|
213
|
-
roomId: number;
|
|
214
|
-
messageId: string;
|
|
215
|
-
senderType: "ordinary" | "system";
|
|
216
|
-
fromUserHash: string;
|
|
217
|
-
auto: 0 | 1;
|
|
218
|
-
createdAt: string | null;
|
|
219
|
-
deletedAt: string | null;
|
|
220
|
-
time: number | null;
|
|
221
|
-
attachment: {
|
|
222
|
-
url: string;
|
|
223
|
-
type: "uncategorized" | "voice_note";
|
|
224
|
-
file_name: string;
|
|
225
|
-
meta: {
|
|
226
|
-
duration: number;
|
|
227
|
-
};
|
|
228
|
-
file_size: number;
|
|
229
|
-
signed_url: string | null;
|
|
230
|
-
};
|
|
231
|
-
}, {
|
|
232
|
-
string: string;
|
|
233
|
-
type: "image";
|
|
234
|
-
status: number;
|
|
235
|
-
roomId: number;
|
|
236
|
-
messageId: string;
|
|
237
|
-
senderType: "ordinary" | "system";
|
|
238
|
-
fromUserHash: string;
|
|
239
|
-
auto: 0 | 1;
|
|
240
|
-
createdAt: string | null;
|
|
241
|
-
deletedAt: string | null;
|
|
242
|
-
time: number | null;
|
|
243
|
-
attachment: {
|
|
244
|
-
url: string;
|
|
245
|
-
type: "uncategorized" | "voice_note";
|
|
246
|
-
file_name: string;
|
|
247
|
-
meta: {
|
|
248
|
-
duration: number;
|
|
249
|
-
};
|
|
250
|
-
file_size: number;
|
|
251
|
-
signed_url: string | null;
|
|
252
|
-
};
|
|
253
|
-
}>;
|
|
254
|
-
type StringMessage = z.infer<typeof StringMessageSchema>;
|
|
255
|
-
type FileMessage = z.infer<typeof FileMessageSchema>;
|
|
256
|
-
type ImageMessage = z.infer<typeof ImageMessageSchema>;
|
|
257
|
-
type Message = StringMessage | FileMessage | ImageMessage;
|
|
258
|
-
|
|
259
35
|
type MessageKind = "sent" | "received" | "system";
|
|
260
36
|
|
|
261
37
|
declare class TextMessageBubble extends LitElement {
|
|
@@ -389,6 +165,7 @@ declare global {
|
|
|
389
165
|
}
|
|
390
166
|
|
|
391
167
|
declare class ChatRoomMessages extends LitElement {
|
|
168
|
+
apiClient: MediquoApiChatClient;
|
|
392
169
|
static styles: lit.CSSResult[];
|
|
393
170
|
roomId: number;
|
|
394
171
|
professionalHash: string;
|
|
@@ -462,6 +239,7 @@ declare global {
|
|
|
462
239
|
* @fires mq-chat-room-chat when the profile is clicked
|
|
463
240
|
*/
|
|
464
241
|
declare class ChatRoomProfile extends LitElement {
|
|
242
|
+
apiClient: MediquoApiChatClient;
|
|
465
243
|
static styles: lit.CSSResult[];
|
|
466
244
|
professionalHash: string;
|
|
467
245
|
private getProfessionalQuery;
|
|
@@ -491,6 +269,13 @@ declare class MqChatRoom extends LitElement {
|
|
|
491
269
|
queryClientContext: QueryClient | undefined;
|
|
492
270
|
private socketController;
|
|
493
271
|
private readAllMessagesMutation;
|
|
272
|
+
/** The organization scope this element was mounted under, if any. */
|
|
273
|
+
private inheritedApiClient?;
|
|
274
|
+
/**
|
|
275
|
+
* This element's own transport, bound to its `api-key` and provided to every
|
|
276
|
+
* descendant. Never shared with another element.
|
|
277
|
+
*/
|
|
278
|
+
apiClient: MediquoApiChatClient;
|
|
494
279
|
willUpdate(_changedProperties: PropertyValues<this>): void;
|
|
495
280
|
render(): lit_html.TemplateResult<1>;
|
|
496
281
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as t,c as o}from"./custom-element-D2ziPxYE.js";import{c as e}from"./consume-CovVqBjI.js";import{A as i}from"./api-client-context-V1UAGtKW.js";import{i as n,a as r,x as a}from"./lit-element-DiWJYFwC.js";import{n as s}from"./property-scuRaFcM.js";import{r as l}from"./state-LQivXIgA.js";import{downloadIcon as d}from"../ui/icons/download-icon.js";import"../ui/mq-button.js";import{m as p}from"./runtime-Bg1WXVCx.js";import{l as c}from"./localized-decorator-BlOuLhym.js";import{D as C}from"./api-chat-client-CJ1EGJe3.js";import{b as m}from"./blob-to-base64-CUL1trde.js";import{DownloadFileEvent as f}from"../events.js";import{getLocale as g}from"../i18n.js";const h=n`:host{display:flex;justify-content:space-between;align-items:center;gap:var(--sp-4);width:100%}.left{display:flex;flex-direction:column;gap:var(--sp-1);flex:1;min-width:0}.tag{border-radius:var(--border-radius-sm);display:inline-flex;align-items:center;justify-content:center;padding:var(--sp-0_5) var(--sp-2);background-color:#e5e5e5;width:fit-content}.tag-label{font-family:var(--font-body);font-size:11px;font-weight:var(--font-weight-medium);color:var(--color-neutrals-text-default);text-transform:uppercase;letter-spacing:3px;line-height:normal}.title{font-family:var(--font-body);font-size:var(--text-sm);font-weight:var(--font-weight-bold);color:var(--color-neutrals-text-default);line-height:normal;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.description{font-family:var(--font-body);font-size:var(--text-sm);font-weight:var(--font-weight-normal);color:var(--color-neutrals-text-default);line-height:normal;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}`;let v=class PatientDocument extends r{constructor(){super(...arguments),this.isDownloading=!1}static{this.styles=h}getFormatter(){const t=g().replace("_","-");return new Intl.DateTimeFormat(t,{year:"numeric",month:"numeric",day:"numeric"})}async _handleDownload(){this.isDownloading=!0;const t=await this.apiClient.flash.downloadDocument({url:this.downloadUrl}),o=await m(t);this.dispatchEvent(new f({url:o,filename:`${this.filename}.pdf`})),this.isDownloading=!1}formatKind(t){switch(t){case C.prescription:return p("Receta");case C.report:return p("Informe");case C.diagnosticTestPrescription:return p("Prescripción")}}render(){const t=this.getFormatter().format(new Date(this.date));return a`<div class="left"><div class="tag"><span class="tag-label">${this.formatKind(this.kind)}</span></div><div class="title">${t} - ${this.specialty}</div><div class="description">${this.description}</div></div><mq-button variant="ghost" size="icon-lg" @click="${this._handleDownload}" ?disabled="${this.isDownloading}">${d({size:24})}</mq-button>`}};t([e({context:i,subscribe:!0})],v.prototype,"apiClient",void 0),t([s({type:String})],v.prototype,"kind",void 0),t([s({type:String})],v.prototype,"filename",void 0),t([s({type:String})],v.prototype,"specialty",void 0),t([s({type:String})],v.prototype,"description",void 0),t([s({type:String})],v.prototype,"date",void 0),t([s({type:String})],v.prototype,"downloadUrl",void 0),t([l()],v.prototype,"isDownloading",void 0),v=t([c(),o("patient-document")],v);let u=class MQLayout extends r{constructor(){super(...arguments),this.background="default",this.variant="default",this.showMediquoBranding=!0}static{this.styles=n`:host{--content-max-width:560px;display:flex;flex-direction:column;height:100%;width:100%;max-width:var(--content-max-width);margin:0 auto;background-color:var(--color-background)}:host([background=solid]){background-color:var(--color-background)}:host([background=transparent]){background-color:transparent}:host([variant=wide]){--content-max-width:1000px}.content{flex:1;padding:var(--mq-layout-padding,0)}footer{display:flex;flex-direction:column;align-items:center;gap:var(--sp-4);padding-top:var(--sp-10);padding-bottom:var(--sp-3);padding-inline:var(--mq-layout-padding,0);margin-bottom:var(--sp-3);text-align:center}.branding{display:flex;justify-content:center;align-items:center;gap:var(--size-2);font-family:var(--font-body);font-size:var(--text-sm);line-height:normal;font-weight:var(--font-weight-normal);color:var(--color-neutrals-text-default)}`}render(){return this.showMediquoBranding?a`<div class="content"><slot></slot></div><footer><div class="branding">${p("Servicio y plataforma prestados por")} ${a`<svg width="82" height="16" viewBox="0 0 82 16" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M52.4506 8.97739V10.5665C52.4506 11.1054 52.0077 11.5477 51.4682 11.5477C50.9288 11.5477 50.486 11.1054 50.486 10.5665V8.97739H48.8531C48.3276 8.97739 47.8984 8.54894 47.8984 8.02383C47.8984 7.49893 48.3276 7.07053 48.8531 7.07053H50.486V5.48128C50.486 4.94243 50.9288 4.5002 51.4682 4.5002C52.0077 4.5002 52.4506 4.94243 52.4506 5.48128V7.07053H54.0836C54.609 7.07053 55.0379 7.49893 55.0379 8.02383C55.0379 8.54894 54.609 8.97739 54.0836 8.97739H52.4506ZM56.8563 5.46693C56.055 3.75203 54.5229 2.55033 52.6531 2.16979C52.3272 2.10809 51.9339 2.06818 51.5273 2.05679C48.7327 2.10005 46.4191 3.93204 45.7665 6.6209C45.397 8.13705 45.6843 9.78156 46.555 11.134C47.4258 12.4867 48.8053 13.431 50.3396 13.7243C51.7168 13.9883 53.0199 13.8046 54.2312 13.1767L54.2853 13.1506C54.554 13.0306 54.8304 12.9977 55.1481 13.0559L55.2243 13.0728C55.8277 13.2312 56.4308 13.389 57.0345 13.5467C56.8787 12.9784 56.7231 12.4168 56.5656 11.86L56.5512 11.8035C56.4673 11.4258 56.5163 11.0837 56.7011 10.7579C57.5947 9.11014 57.6548 7.17549 56.8563 5.46693ZM59.2901 15.5846C59.0891 15.8486 58.7811 16 58.4446 16C58.2872 16 58.1621 15.967 58.0617 15.9405L57.0944 15.6878C56.3739 15.4997 55.6553 15.312 54.936 15.1233C53.8594 15.6379 52.7204 15.8988 51.5464 15.8988C51.0243 15.8988 50.4877 15.8466 49.9521 15.7439C47.8668 15.3452 45.9973 14.0703 44.823 12.2461C43.6488 10.4223 43.2634 8.19505 43.7656 6.13553C44.6446 2.51324 47.7615 0.0472629 51.5211 0.000260881L51.5409 0L51.5605 0.000391321C52.0913 0.0140876 52.5926 0.0651767 53.0508 0.152094C55.5798 0.666768 57.6424 2.28597 58.7224 4.59729C59.7655 6.82947 59.7232 9.34593 58.6144 11.5401C58.8921 12.5275 59.1643 13.5268 59.4414 14.5471C59.4869 14.7106 59.6124 15.1611 59.2901 15.5846ZM79.7577 8.77869C79.7577 7.05748 78.5162 5.63246 76.7557 5.63246C74.9582 5.63246 73.8092 7.03887 73.8092 8.7416V8.77869C73.8092 10.4814 75.0508 11.9064 76.7927 11.9064C78.6089 11.9064 79.7577 10.4999 79.7577 8.81573V8.77869ZM76.7557 13.868C73.7722 13.868 71.5669 11.5915 71.5669 8.81573V8.77869C71.5669 5.98404 73.7907 3.67068 76.7927 3.67068C79.7949 3.67068 82 5.94717 82 8.7416V8.77869C82 11.5545 79.7764 13.868 76.7557 13.868ZM68.7934 13.7387C68.1816 13.7387 67.6628 13.2571 67.6628 12.6281V12.1285C67.0328 13.0538 66.1247 13.8495 64.6051 13.8495C62.4 13.8495 61.1213 12.3691 61.1213 10.0925V4.89208C61.1213 4.2631 61.6216 3.76329 62.2331 3.76329C62.8633 3.76329 63.3637 4.2631 63.3637 4.89208V9.42637C63.3637 10.944 64.1233 11.7951 65.4575 11.7951C66.7547 11.7951 67.6628 10.9071 67.6628 9.38919V4.89208C67.6628 4.2631 68.1631 3.76329 68.7934 3.76329C69.4048 3.76329 69.9236 4.2631 69.9236 4.89208V12.6281C69.9236 13.2386 69.4233 13.7387 68.7934 13.7387ZM40.4153 3.76329C41.0454 3.76329 41.5457 4.2631 41.5457 4.89208V12.6281C41.5457 13.2571 41.0454 13.7387 40.4153 13.7387C39.8038 13.7387 39.3034 13.2571 39.3034 12.6281V4.89208C39.3034 4.2631 39.7852 3.76329 40.4153 3.76329ZM40.4153 2.4678C39.6925 2.4678 39.1368 2.02361 39.1368 1.35732V1.2464C39.1368 0.580156 39.6925 0.154442 40.4153 0.154442C41.1379 0.154442 41.694 0.580156 41.694 1.2464V1.35732C41.694 2.02361 41.1379 2.4678 40.4153 2.4678ZM34.7693 8.7416C34.7693 6.85382 33.435 5.6139 31.9339 5.6139C30.3961 5.6139 29.1173 6.79821 29.1173 8.7416V8.77869C29.1173 10.6665 30.4145 11.9064 31.9339 11.9064C33.435 11.9064 34.7693 10.6476 34.7693 8.77869V8.7416ZM35.8627 13.7387C35.2325 13.7387 34.7321 13.2571 34.7321 12.6281V12.0172C34.0095 13.0353 32.9903 13.8495 31.3966 13.8495C29.0988 13.8495 26.8566 12.0172 26.8566 8.77869V8.7416C26.8566 5.50298 29.0616 3.67068 31.3966 3.67068C33.0088 3.67068 34.028 4.4665 34.7321 5.39189V1.15383C34.7321 0.524632 35.2325 0.0434802 35.8439 0.0434802C36.4742 0.0434802 36.9745 0.524632 36.9745 1.15383V12.6281C36.9745 13.2571 36.4742 13.7387 35.8627 13.7387ZM21.0065 5.50298C19.6353 5.50298 18.6718 6.55763 18.4678 8.07548H23.4897C23.3416 6.63203 22.4892 5.50298 21.0065 5.50298ZM24.6203 9.55589H18.4864C18.7272 11.1477 19.8578 12.0357 21.3032 12.0357C22.2482 12.0357 22.9895 11.7028 23.6196 11.1846C23.7863 11.0548 23.9346 10.981 24.194 10.981C24.6945 10.981 25.0836 11.3698 25.0836 11.8879C25.0836 12.1654 24.9539 12.406 24.787 12.5727C23.8975 13.3683 22.7858 13.868 21.2662 13.868C18.4308 13.868 16.244 11.8136 16.244 8.79712V8.76021C16.244 5.96556 18.227 3.67068 21.0253 3.67068C24.1384 3.67068 25.6765 6.22475 25.6765 8.48246C25.6765 9.1117 25.1948 9.55589 24.6203 9.55589ZM13.7686 13.7387C13.1387 13.7387 12.6382 13.2571 12.6382 12.6281V8.09396C12.6382 6.53915 11.9155 5.70655 10.6555 5.70655C9.43232 5.70655 8.56142 6.55763 8.56142 8.13083V12.6281C8.56142 13.2571 8.06108 13.7387 7.44958 13.7387C6.81941 13.7387 6.3192 13.2571 6.3192 12.6281V8.07548C6.3192 6.55763 5.57796 5.70655 4.33625 5.70655C3.09479 5.70655 2.24235 6.63203 2.24235 8.13083V12.6281C2.24235 13.2571 1.74205 13.7387 1.1118 13.7387C0.500341 13.7387 0 13.2571 0 12.6281V4.89208C0 4.2631 0.481844 3.76329 1.1118 3.76329C1.74205 3.76329 2.24235 4.2631 2.24235 4.89208V5.35475C2.87235 4.48511 3.72475 3.67068 5.22586 3.67068C6.63431 3.67068 7.63481 4.35545 8.15378 5.39189C8.93198 4.35545 9.96987 3.67068 11.4522 3.67068C13.5833 3.67068 14.8804 5.02183 14.8804 7.40919V12.6281C14.8804 13.2571 14.3988 13.7387 13.7686 13.7387Z" fill="#0A0A22"/></svg>`}</div></footer>`:a`<div class="content"><slot></slot></div>`}};t([s({type:String})],u.prototype,"background",void 0),t([s()],u.prototype,"variant",void 0),t([s({type:Boolean,attribute:"show-mediquo-branding"})],u.prototype,"showMediquoBranding",void 0),u=t([c(),o("mq-layout")],u);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as lit_html from 'lit-html';
|
|
2
2
|
import * as lit from 'lit';
|
|
3
3
|
import { LitElement } from 'lit';
|
|
4
|
+
import { M as MediquoApiChatClient } from './index.d-XSe7Hy-Q.js';
|
|
4
5
|
import '../ui/mq-button.js';
|
|
5
6
|
import { D as DocumentType } from './document.model.d-DIzMiOmd.js';
|
|
6
7
|
|
|
@@ -8,6 +9,7 @@ import { D as DocumentType } from './document.model.d-DIzMiOmd.js';
|
|
|
8
9
|
* @fires download-file - Fired when the user requests a download (bubbles, composed; `url` and `filename` on the event)
|
|
9
10
|
*/
|
|
10
11
|
declare class PatientDocument extends LitElement {
|
|
12
|
+
apiClient: MediquoApiChatClient;
|
|
11
13
|
static styles: lit.CSSResult;
|
|
12
14
|
kind: DocumentType;
|
|
13
15
|
filename: string;
|
|
@@ -26,3 +28,21 @@ declare global {
|
|
|
26
28
|
"patient-document": PatientDocument;
|
|
27
29
|
}
|
|
28
30
|
}
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Presentational page frame: a centered content column with an optional
|
|
34
|
+
* "provided by mediquo" branding footer. Pure chrome — no navigation. Shared
|
|
35
|
+
* across features that need a full-screen wizard-style layout.
|
|
36
|
+
*/
|
|
37
|
+
declare class MQLayout extends LitElement {
|
|
38
|
+
static styles: lit.CSSResult;
|
|
39
|
+
background: "solid" | "default" | "transparent";
|
|
40
|
+
variant: "default" | "wide";
|
|
41
|
+
showMediquoBranding: boolean;
|
|
42
|
+
render(): lit_html.TemplateResult<1>;
|
|
43
|
+
}
|
|
44
|
+
declare global {
|
|
45
|
+
interface HTMLElementTagNameMap {
|
|
46
|
+
"mq-layout": MQLayout;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{s as t}from"./context-request-event-Dfydf1ub.js";class s{get value(){return this.o}set value(t){this.setValue(t)}setValue(t,o=!1){const n=o||!Object.is(t,this.o);this.o=t,n&&this.updateObservers()}constructor(t){this.subscriptions=new Map,this.updateObservers=()=>{for(const[t,{disposer:o}]of this.subscriptions)t(this.o,o)},void 0!==t&&(this.value=t)}addCallback(t,o,n){if(!n)return void t(this.value);this.subscriptions.has(t)||this.subscriptions.set(t,{disposer:()=>{this.subscriptions.delete(t)},consumerHost:o});const{disposer:r}=this.subscriptions.get(t);t(this.value,r)}clearCallbacks(){this.subscriptions.clear()}}let o=class e extends Event{constructor(t,o){super("context-provider",{bubbles:!0,composed:!0}),this.context=t,this.contextTarget=o}};class i extends s{constructor(o,n,r){super(void 0!==n.context?n.initialValue:r),this.onContextRequest=t=>{if(t.context!==this.context)return;const o=t.contextTarget??t.composedPath()[0];o!==this.host&&(t.stopPropagation(),this.addCallback(t.callback,o,t.subscribe))},this.onProviderRequest=o=>{if(o.context!==this.context)return;if((o.contextTarget??o.composedPath()[0])===this.host)return;const n=new Set;for(const[o,{consumerHost:r}]of this.subscriptions)n.has(o)||(n.add(o),r.dispatchEvent(new t(this.context,r,o,!0)));o.stopPropagation()},this.host=o,void 0!==n.context?this.context=n.context:this.context=n,this.attachListeners(),this.host.addController?.(this)}attachListeners(){this.host.addEventListener("context-request",this.onContextRequest),this.host.addEventListener("context-provider",this.onProviderRequest)}hostConnected(){this.host.dispatchEvent(new o(this.context,this.host))}}function n({context:t}){return(o,n)=>{const r=new WeakMap;if("object"==typeof n)return{get(){return o.get.call(this)},set(t){return r.get(this).setValue(t),o.set.call(this,t)},init(o){return r.set(this,new i(this,{context:t,initialValue:o})),o}};{o.constructor.addInitializer(o=>{r.set(o,new i(o,{context:t}))});const c=Object.getOwnPropertyDescriptor(o,n);let h;if(void 0===c){const t=new WeakMap;h={get(){return t.get(this)},set(o){r.get(this).setValue(o),t.set(this,o)},configurable:!0,enumerable:!0}}else{const t=c.set;h={...c,set(o){r.get(this).setValue(o),t?.call(this,o)}}}return void Object.defineProperty(o,n,h)}}}export{n as e,i};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{Q as t}from"./chunk-RCFIJTXZ-C6Ir0-sM.js";import{s as e}from"./context-consumer-ESdICVAb.js";import{S as s,p as r,r as i,s as n,a as u,n as a,i as h,b as o,t as c,c as l,f as d,d as p,e as f,g as y}from"./query-Cjvi4_dT.js";var b=class extends s{constructor(t,e){super(),this.options=e,this.#t=t,this.#e=null,this.#s=r(),this.bindMethods(),this.setOptions(e)}#t;#r=void 0;#i=void 0;#n=void 0;#u;#a;#s;#e;#h;#o;#c;#l;#d;#p;#f=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(this.#r.addObserver(this),R(this.#r,this.options)?this.#y():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return v(this.#r,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return v(this.#r,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#R(),this.#v(),this.#r.removeObserver(this)}setOptions(t){const e=this.options,s=this.#r;if(this.options=this.#t.defaultQueryOptions(t),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled&&"function"!=typeof this.options.enabled&&"boolean"!=typeof i(this.options.enabled,this.#r))throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#Q(),this.#r.setOptions(this.options),e._defaulted&&!n(this.options,e)&&this.#t.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#r,observer:this});const r=this.hasListeners();r&&Q(this.#r,s,this.options,e)&&this.#y(),this.updateResult(),!r||this.#r===s&&i(this.options.enabled,this.#r)===i(e.enabled,this.#r)&&u(this.options.staleTime,this.#r)===u(e.staleTime,this.#r)||this.#m();const a=this.#I();!r||this.#r===s&&i(this.options.enabled,this.#r)===i(e.enabled,this.#r)&&a===this.#p||this.#O(a)}getOptimisticResult(t){const e=this.#t.getQueryCache().build(this.#t,t),s=this.createResult(e,t);return function(t,e){if(!n(t.getCurrentResult(),e))return!0;return!1}(this,s)&&(this.#n=s,this.#a=this.options,this.#u=this.#r.state),s}getCurrentResult(){return this.#n}trackResult(t,e){return new Proxy(t,{get:(t,s)=>(this.trackProp(s),e?.(s),"promise"!==s||this.options.experimental_prefetchInRender||"pending"!==this.#s.status||this.#s.reject(new Error("experimental_prefetchInRender feature flag is not enabled")),Reflect.get(t,s))})}trackProp(t){this.#f.add(t)}getCurrentQuery(){return this.#r}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const e=this.#t.defaultQueryOptions(t),s=this.#t.getQueryCache().build(this.#t,e);return s.fetch().then(()=>this.createResult(s,e))}fetch(t){return this.#y({...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#n))}#y(t){this.#Q();let e=this.#r.fetch(this.options,t);return t?.throwOnError||(e=e.catch(a)),e}#m(){this.#R();const t=u(this.options.staleTime,this.#r);if(h||this.#n.isStale||!o(t))return;const e=c(this.#n.dataUpdatedAt,t)+1;this.#l=l.setTimeout(()=>{this.#n.isStale||this.updateResult()},e)}#I(){return("function"==typeof this.options.refetchInterval?this.options.refetchInterval(this.#r):this.options.refetchInterval)??!1}#O(t){this.#v(),this.#p=t,!h&&!1!==i(this.options.enabled,this.#r)&&o(this.#p)&&0!==this.#p&&(this.#d=l.setInterval(()=>{(this.options.refetchIntervalInBackground||d.isFocused())&&this.#y()},this.#p))}#b(){this.#m(),this.#O(this.#I())}#R(){this.#l&&(l.clearTimeout(this.#l),this.#l=void 0)}#v(){this.#d&&(l.clearInterval(this.#d),this.#d=void 0)}createResult(t,e){const s=this.#r,n=this.options,u=this.#n,a=this.#u,h=this.#a,o=t!==s?t.state:this.#i,{state:c}=t;let l,d={...c},y=!1;if(e._optimisticResults){const r=this.hasListeners(),i=!r&&R(t,e),u=r&&Q(t,s,e,n);(i||u)&&(d={...d,...p(c.data,t.options)}),"isRestoring"===e._optimisticResults&&(d.fetchStatus="idle")}let{error:b,errorUpdatedAt:v,status:I}=d;l=d.data;let O=!1;if(void 0!==e.placeholderData&&void 0===l&&"pending"===I){let t;u?.isPlaceholderData&&e.placeholderData===h?.placeholderData?(t=u.data,O=!0):t="function"==typeof e.placeholderData?e.placeholderData(this.#c?.state.data,this.#c):e.placeholderData,void 0!==t&&(I="success",l=f(u?.data,t,e),y=!0)}if(e.select&&void 0!==l&&!O)if(u&&l===a?.data&&e.select===this.#h)l=this.#o;else try{this.#h=e.select,l=e.select(l),l=f(u?.data,l,e),this.#o=l,this.#e=null}catch(t){this.#e=t}this.#e&&(b=this.#e,l=this.#o,v=Date.now(),I="error");const g="fetching"===d.fetchStatus,w="pending"===I,C="error"===I,S=w&&g,T=void 0!==l,F={status:I,fetchStatus:d.fetchStatus,isPending:w,isSuccess:"success"===I,isError:C,isInitialLoading:S,isLoading:S,data:l,dataUpdatedAt:d.dataUpdatedAt,error:b,errorUpdatedAt:v,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>o.dataUpdateCount||d.errorUpdateCount>o.errorUpdateCount,isFetching:g,isRefetching:g&&!w,isLoadingError:C&&!T,isPaused:"paused"===d.fetchStatus,isPlaceholderData:y,isRefetchError:C&&T,isStale:m(t,e),refetch:this.refetch,promise:this.#s,isEnabled:!1!==i(e.enabled,t)};if(this.options.experimental_prefetchInRender){const e=t=>{"error"===F.status?t.reject(F.error):void 0!==F.data&&t.resolve(F.data)},i=()=>{const t=this.#s=F.promise=r();e(t)},n=this.#s;switch(n.status){case"pending":t.queryHash===s.queryHash&&e(n);break;case"fulfilled":"error"!==F.status&&F.data===n.value||i();break;case"rejected":"error"===F.status&&F.error===n.reason||i()}}return F}updateResult(){const t=this.#n,e=this.createResult(this.#r,this.options);if(this.#u=this.#r.state,this.#a=this.options,void 0!==this.#u.data&&(this.#c=this.#r),n(e,t))return;this.#n=e;this.#g({listeners:(()=>{if(!t)return!0;const{notifyOnChangeProps:e}=this.options,s="function"==typeof e?e():e;if("all"===s||!s&&!this.#f.size)return!0;const r=new Set(s??this.#f);return this.options.throwOnError&&r.add("error"),Object.keys(this.#n).some(e=>{const s=e;return this.#n[s]!==t[s]&&r.has(s)})})()})}#Q(){const t=this.#t.getQueryCache().build(this.#t,this.options);if(t===this.#r)return;const e=this.#r;this.#r=t,this.#i=t.state,this.hasListeners()&&(e?.removeObserver(this),t.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#g(t){y.batch(()=>{t.listeners&&this.listeners.forEach(t=>{t(this.#n)}),this.#t.getQueryCache().notify({query:this.#r,type:"observerResultsUpdated"})})}};function R(t,e){return function(t,e){return!1!==i(e.enabled,t)&&void 0===t.state.data&&!("error"===t.state.status&&!1===e.retryOnMount)}(t,e)||void 0!==t.state.data&&v(t,e,e.refetchOnMount)}function v(t,e,s){if(!1!==i(e.enabled,t)&&"static"!==u(e.staleTime,t)){const r="function"==typeof s?s(t):s;return"always"===r||!1!==r&&m(t,e)}return!1}function Q(t,e,s,r){return(t!==e||!1===i(r.enabled,t))&&(!s.suspense||"error"!==t.state.status)&&m(t,s)}function m(t,e){return!1!==i(e.enabled,t)&&t.isStaleByTime(u(e.staleTime,t))}Promise.withResolvers||(Promise.withResolvers=function(){let t,e;const s=new this((s,r)=>{t=s,e=r});return{resolve:t,reject:e,promise:s}});var I=class{constructor(s,r,i){this.host=s,this.optionsFn=r,this._queryClient=i,this.whenQueryClient=Promise.withResolvers(),this.whenQueryObserver=Promise.withResolvers(),this.host.addController(this),this.context=new e(this.host,{context:t,subscribe:!0,callback:t=>{t&&(this.queryClient=t)}}),this.optionsFn&&this.observeQuery(this.optionsFn)}set queryClient(t){this._queryClient=t,t&&this.whenQueryClient.resolve(t),this.host.requestUpdate()}get queryClient(){return this._queryClient}async observeQuery(t,e=!0){const s=await this.whenQueryClient.promise,r=await this.getDefaultedOptions("function"==typeof t?t():t);this.queryObserver=new b(s,r),this.result=e?this.queryObserver.getOptimisticResult(r):void 0,this.host.requestUpdate(),this.whenQueryObserver.resolve(this.queryObserver)}async hostUpdate(){if(this.optionsFn){const t=await this.whenQueryObserver.promise,e=await this.getDefaultedOptions(this.optionsFn());t.setOptions(e)}}hostConnected(){this.subscribe()}async subscribe(){const t=await this.whenQueryObserver.promise;this.unsubscribe?.(),this.unsubscribe=t.subscribe(t=>{this.result=t,this.host.requestUpdate()}),t.updateResult(),this.host.requestUpdate()}hostDisconnected(){this.unsubscribe?.(),this.unsubscribe=void 0}async getDefaultedOptions(t){return(await this.whenQueryClient.promise).defaultQueryOptions(t)}render(t){const e=this.result;return"pending"!==e?.status||"idle"!==e?.fetchStatus||e?.data?e?.isPending?t.pending?.()??null:e?.isError?t.error?.(e?.error)??null:e?.isSuccess?t.complete(e?.data):t.initial?.()??null:t.initial?.()??null}};export{I as Q};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as n}from"./chunk-HN62IQ7S-xbkIy7k_.js";import{t}from"./parseISO-Dj3qSTG8.js";function r(n,r,o){const s=function(n,r){return+t(n)-+t(r)}(n,r)/1e3;return(c=o?.roundingMethod,n=>{const t=(c?Math[c]:Math.trunc)(n);return 0===t?0:t})(s);var c}function o(t){const{startsAtIso:o,refundPolicySeconds:s,now:c=new Date}=t,e=r(n(o),c);return!(e<0)&&(null==s||e>=s)}export{o as c};
|
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
import z from 'zod';
|
|
2
2
|
|
|
3
|
+
declare const LoginTokenRequestSchema: z.ZodObject<{
|
|
4
|
+
api_key: z.ZodString;
|
|
5
|
+
token: z.ZodString;
|
|
6
|
+
}, "strip", z.ZodTypeAny, {
|
|
7
|
+
token: string;
|
|
8
|
+
api_key: string;
|
|
9
|
+
}, {
|
|
10
|
+
token: string;
|
|
11
|
+
api_key: string;
|
|
12
|
+
}>;
|
|
13
|
+
type LoginTokenRequest = z.infer<typeof LoginTokenRequestSchema>;
|
|
3
14
|
declare const LoginTokenResponseSchema: z.ZodObject<{
|
|
4
15
|
access_token: z.ZodString;
|
|
5
16
|
patient: z.ZodObject<{
|
|
@@ -131,4 +142,4 @@ declare const LoginTokenResponseSchema: z.ZodObject<{
|
|
|
131
142
|
}>;
|
|
132
143
|
type LoginTokenResponse = z.infer<typeof LoginTokenResponseSchema>;
|
|
133
144
|
|
|
134
|
-
export type { LoginTokenResponse as L };
|
|
145
|
+
export type { LoginTokenResponse as L, LoginTokenRequest as a };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{s as t}from"./chunk-6CCJWPGL-TiaqZaPV.js";function e(e,n){return{queryKey:t(e,"organization-specialties"),queryFn:()=>e.organizations.getOrganizationSpecialties(),...n}}function n(t,e){return{action_type:"event",event_type:"access to videocall button click",patient_hash:t,id_appointment:e}}function i(t,e){return{action_type:"event",event_type:"open chat button click",patient_hash:t,id_appointment:e}}function a(t,e){return{action_type:"event",event_type:"modify appoinment button click",patient_hash:t,id_appointment:e}}function o(t,e){return{action_type:"event",event_type:"cancel appoinment button click",patient_hash:t,id_appointment:e}}function p(t,e){return{action_type:"event",event_type:"view appointment document list button click",patient_hash:t,id_appointment:e}}function s(t,e){return{action_type:"event",event_type:"repeat appointment button click",patient_hash:t,id_appointment:e}}function c(t,e){return{action_type:"event",event_type:"open chat button click",patient_hash:t,id_appointment:e}}function _(t,e){return{action_type:"event",event_type:"access to videocall button click",patient_hash:t,id_appointment:e}}function r(t,e){return{action_type:"event",event_type:"add to calendar button click",patient_hash:t,id_appointment:e}}function l(t,e){return{action_type:"pageview",event_type:"appointment success page view",patient_hash:t,id_appointment:e}}function u(t,e){return{action_type:"event",event_type:"open chat button click",patient_hash:t,id_appointment:e}}function d(t,e){return{action_type:"event",event_type:"update documentation",patient_hash:t,id_appointment:e}}function y(t,e){return{action_type:"pageview",event_type:"documentation page view",patient_hash:t,id_appointment:e}}function h(t){return{action_type:"event",event_type:"view documentation list button click",patient_hash:t}}function v(t,e){return{action_type:"event",event_type:"download document button click",patient_hash:t,id_document:e}}function g(t){return{action_type:"event",event_type:"make an appointment button click",patient_hash:t}}function m(t){return{action_type:"event",event_type:"view appointment list button click",patient_hash:t}}function f(t){return{action_type:"pageview",event_type:"home page view",patient_hash:t}}function E(t,e,n){return{action_type:"event",event_type:"find availability button click",patient_hash:t,speciality_id:e,service_id:n}}function S(t,e,n,i,a,o,p){return{action_type:"debug",event_type:"find availability result",patient_hash:t,speciality_id:e,service_id:n,first_slot_date:i,first_slot_professional_hash:a,total_professionals:o,total_slots:p}}function k(t,e,n,i,a){return{action_type:"event",event_type:"professional schedule slot button click",patient_hash:t,professional_hash:e,start_date:n,speciality_id:i,service_id:a}}function b(t,e,n,i){return{action_type:"event",event_type:"professional availability button click",patient_hash:t,professional_hash:e,speciality_id:n,service_id:i}}function T(t,e,n,i,a){return{action_type:"event",event_type:"confirm appointment button click",patient_hash:t,professional_hash:e,start_date:n,speciality_id:i,service_id:a}}function w(t){return{action_type:"pageview",event_type:"select professional step page view",patient_hash:t}}function P(t,e){return{action_type:"pageview",event_type:"not time yet pageview",patient_hash:t,id_appointment:e}}function C(t,e){return{action_type:"event",event_type:"open chat button click",patient_hash:t,id_appointment:e}}function D(t,e){return{action_type:"pageview",event_type:"waiting room pageview",patient_hash:t,id_appointment:e}}function q(t,e){return{action_type:"pageview",event_type:"videocall pageview",patient_hash:t,id_appointment:e}}var K={digestive_system:{de_DE:"Verdauungssystem",en_US:"Digestive System",es_ES:"Aparato Digestivo",ca_ES:"Aparell Digestiu",pt_PT:"Aparelho Digestivo"},orthopedic_surgery_traumatology:{de_DE:"Traumatologie und Orthopädische Chirurgie",en_US:"Traumatology and Orthopedic Surgery",es_ES:"Traumatología y Cirugía Ortopédica",ca_ES:"Traumatologia i Cirurgia Ortopèdica",pt_PT:"Traumatologia e Cirurgia Ortopédica"},gynecology:{de_DE:"Gynäkologie",en_US:"Gynecology",es_ES:"Ginecología",ca_ES:"Ginecologia",pt_PT:"Ginecologia"},endocrinology:{de_DE:"Endokrinologie",en_US:"Endocrinology",es_ES:"Endocrinología",ca_ES:"Endocrinologia",pt_PT:"Endocrinologia"},psychiatry:{de_DE:"Psychiatrie",en_US:"Psychiatry",es_ES:"Psiquiatría",ca_ES:"Psiquiatria",pt_PT:"Psiquiatria"}},O={videocall:{de_DE:"Videosprechstunde",en_US:"Videocall",es_ES:"Videoconsulta",ca_ES:"Videoconsulta",pt_PT:"Videoconsulta"},phonecall:{de_DE:"Telefonische Behandlung",en_US:"Phone consultation",es_ES:"Consulta telefónica",ca_ES:"Consulta telefònica",pt_PT:"Consulta telefónica"}},U={de_DE:"Konsultationspreis",en_US:"Consultation price",es_ES:"Precio de consulta",ca_ES:"Preu de consulta",pt_PT:"Preço da consulta"},G={videocall:"videocall",phonecall:"phonecall",adeslas_videocall:"videocall",adeslas_prod_videocall:"videocall",adeslas_phonecall:"phonecall",adeslas_prod_phonecall:"phonecall"};function A(t,e,n){if(!t)return n??"";const i=G[t];return i?O[i][e]:n??U[e]}var V={consulta_telefonica:"phonecall",videoconsulta:"videocall"},x={"aparato-digestivo":"digestive_system","cirugia-ortopedica-y-traumatologia":"orthopedic_surgery_traumatology",ginecologia:"gynecology",endocrinologia:"endocrinology",psiquiatria:"psychiatry"};function z(t,e,n){const i=n?.trim();if(i)return i;const a=K[t]?.[e];return void 0!==a?a:t}class HttpTransport{endpoint;apiKey;constructor(t,e){this.endpoint=t,this.apiKey=e}send(t){fetch(this.endpoint,{method:"POST",headers:{"Content-Type":"application/json","x-api-key":this.apiKey},body:JSON.stringify(t)}).catch(()=>{})}}class MediquoTelemetryClient{_apiKey=null;_transport=null;setApiKey(t){this._apiKey=t,this._buildTransport()}track(t){null!==this._transport&&this._transport.send(t)}_buildTransport(){null!==this._apiKey&&(this._transport=new HttpTransport("https://tracking.____.mediquo.com/sdk",this._apiKey))}}const j=new class AppTelemetryClient extends MediquoTelemetryClient{track(t){}};export{k as A,b as B,S as C,w as D,P as E,C as F,D as G,q as H,V as S,e as a,y as b,d as c,v as d,u as e,a as f,z as g,o as h,s as i,n as j,p as k,i as l,l as m,r as n,c as o,_ as p,g as q,h as r,f as s,j as t,x as u,m as v,A as w,T as x,E as y,K as z};
|
package/dist/env.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const E="https://mediquo-landing.s3.eu-central-1.amazonaws.com/sdk-web/elements",o="production",e="0.8.
|
|
1
|
+
const E="https://mediquo-landing.s3.eu-central-1.amazonaws.com/sdk-web/elements",o="production",e="0.8.2",n={development:{MODE:"development",MQ_DEFAULT_ENV:o,MQ_ELEMENTS_VERSION:e,OPENTOK_API_KEY:"47836441",ASSETS_BASE_URL:E},production:{MODE:"production",MQ_DEFAULT_ENV:o,MQ_ELEMENTS_VERSION:e,OPENTOK_API_KEY:"46655102",ASSETS_BASE_URL:E}};let t=o;const _=new Proxy({},{get:(E,o)=>n[t??"production"][o]});function S(E){t=E}export{E as ASSETS_BASE_URL,_ as env,S as setEnv};
|
package/dist/i18n.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{c as e}from"./chunks/runtime-Bg1WXVCx.js";import{l as
|
|
1
|
+
import{c as e}from"./chunks/runtime-Bg1WXVCx.js";import{l as n}from"./chunks/chunk-4FFT6DC2-CVWibomC.js";import{z as t}from"./chunks/external-CJj32K_p.js";const c=["ca_ES","de_DE","en_US","pt_PT"],s=t.enum(["en_US","pt_PT","de_DE","es_ES","ca_ES"]);function a(e){return s.safeParse(e).success}const o="__mqElementsLocalization__";function i(){const e=globalThis;return e[o]||(e[o]={initialized:!1}),e[o]}function r(){const t=i();if(!t.initialized){t.initialized=!0;try{const{setLocale:n,getLocale:s}=e({sourceLocale:"es_ES",targetLocales:c,loadLocale:async e=>{switch(e){case"en_US":default:return import("./chunks/en_US-BslWF9nj.js");case"pt_PT":return import("./chunks/pt_PT-CFbbWowX.js");case"de_DE":return import("./chunks/de_DE-CrwfSJnS.js");case"ca_ES":return import("./chunks/ca_ES-nttMFJzr.js")}}});t.setLocale=n,t.getLocale=s}catch(e){n.warn("Localization was already configured on this page.",e)}}}const u="Localization not initialized yet.";async function l(e){const{setLocale:t}=i();if(t)return t(e);n.warn(u)}function _(){const{getLocale:e}=i();return e?e():(n.warn(u),"es_ES")}export{_ as getLocale,r as initLocalization,a as isValidLocale,l as setLocale};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import * as lit_html from 'lit-html';
|
|
2
|
+
import { M as MediquoApiChatClient } from './chunks/index.d-XSe7Hy-Q.js';
|
|
3
|
+
import { LitElement, PropertyValues } from 'lit';
|
|
4
|
+
import { Env } from './env.js';
|
|
5
|
+
import 'axios';
|
|
6
|
+
import 'zod';
|
|
7
|
+
import './chunks/schemas.d-b6_AekBb.js';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Scopes a subtree to one organization.
|
|
11
|
+
*
|
|
12
|
+
* Elements that take their own `api-key` build their own client and need no
|
|
13
|
+
* provider. This one exists for the elements that are configured entirely by
|
|
14
|
+
* context — `mq-my-appointments`, `mq-unread-count-sync`,
|
|
15
|
+
* `mq-professional-presence-sync` — and for hosts that want to hand a whole
|
|
16
|
+
* branch to a single organization.
|
|
17
|
+
*
|
|
18
|
+
* Mount one per organization. Two providers with different `api-key`s can be
|
|
19
|
+
* alive at the same time: each subtree gets its own transport and its own
|
|
20
|
+
* cache scope.
|
|
21
|
+
*/
|
|
22
|
+
declare class MqApiClientProvider extends LitElement {
|
|
23
|
+
/** Organization every request under this provider is made for. */
|
|
24
|
+
apiKey?: string;
|
|
25
|
+
/** Patient session token. */
|
|
26
|
+
token?: string;
|
|
27
|
+
locale?: string;
|
|
28
|
+
env?: Env;
|
|
29
|
+
apiClient: MediquoApiChatClient;
|
|
30
|
+
protected willUpdate(changed: PropertyValues<this>): void;
|
|
31
|
+
render(): lit_html.TemplateResult<1>;
|
|
32
|
+
}
|
|
33
|
+
declare global {
|
|
34
|
+
interface HTMLElementTagNameMap {
|
|
35
|
+
"mq-api-client-provider": MqApiClientProvider;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export { MqApiClientProvider };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{_ as t,c as e}from"./chunks/custom-element-D2ziPxYE.js";import{e as o}from"./chunks/provide-BwI4DDGF.js";import{A as i}from"./chunks/api-client-context-V1UAGtKW.js";import{a as r,x as s}from"./chunks/lit-element-DiWJYFwC.js";import{n}from"./chunks/property-scuRaFcM.js";import{r as p}from"./chunks/state-LQivXIgA.js";import{setEnv as c}from"./env.js";import{c as a,n as m}from"./chunks/api-chat-client-CJ1EGJe3.js";import{e as h}from"./chunks/ensure-context-root-DbdqwnKB.js";import"./chunks/context-request-event-Dfydf1ub.js";import"./chunks/create-context-DqP79qjF.js";import"./chunks/chunk-HN62IQ7S-xbkIy7k_.js";import"./chunks/parseISO-Dj3qSTG8.js";import"./chunks/format-CRFiCNHw.js";import"./chunks/external-CJj32K_p.js";import"./chunks/isBefore-CPpTogxo.js";h();let u=class MqApiClientProvider extends r{constructor(){super(...arguments),this.apiClient=a()}willUpdate(t){t.has("env")&&this.env&&c(this.env);const e=m(t,{env:this.env,apiKey:this.apiKey,token:this.token,locale:this.locale});e&&(this.apiClient=e)}render(){return s`<slot></slot>`}};t([n({type:String,attribute:"api-key"})],u.prototype,"apiKey",void 0),t([n({type:String,attribute:"token"})],u.prototype,"token",void 0),t([n({type:String,attribute:"locale"})],u.prototype,"locale",void 0),t([n({type:String,attribute:"env"})],u.prototype,"env",void 0),t([o({context:i}),p()],u.prototype,"apiClient",void 0),u=t([e("mq-api-client-provider")],u);export{u as MqApiClientProvider};
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import * as lit from 'lit';
|
|
2
2
|
import { LitElement, PropertyValues } from 'lit';
|
|
3
|
+
import { M as MediquoApiChatClient } from './chunks/index.d-XSe7Hy-Q.js';
|
|
3
4
|
import { Env } from './env.js';
|
|
4
5
|
import { Locale } from './i18n.js';
|
|
6
|
+
import 'axios';
|
|
5
7
|
import 'zod';
|
|
8
|
+
import './chunks/schemas.d-b6_AekBb.js';
|
|
6
9
|
|
|
7
10
|
declare class ApplePayCheckoutSuccessEvent extends Event {
|
|
8
11
|
readonly detail: {
|
|
@@ -63,6 +66,15 @@ declare class MqApplePayCheckout extends LitElement {
|
|
|
63
66
|
private _suppressCancelEvent;
|
|
64
67
|
/** Ignores stale results from overlapping availability checks. */
|
|
65
68
|
private _availabilityGeneration;
|
|
69
|
+
/** The organization scope this element was mounted under, if any. */
|
|
70
|
+
private inheritedApiClient?;
|
|
71
|
+
/**
|
|
72
|
+
* This element's own transport, bound to its `api-key` and provided to every
|
|
73
|
+
* descendant. Never shared with another element.
|
|
74
|
+
*/
|
|
75
|
+
apiClient: MediquoApiChatClient;
|
|
76
|
+
/** Session token from the login exchange; survives a client rebuild. */
|
|
77
|
+
private _sessionToken?;
|
|
66
78
|
private _loginTokenTask;
|
|
67
79
|
protected willUpdate(changed: PropertyValues<this>): void;
|
|
68
80
|
private _refreshAvailability;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as e,c as t}from"./chunks/custom-element-D2ziPxYE.js";import{
|
|
1
|
+
import{_ as e,c as t}from"./chunks/custom-element-D2ziPxYE.js";import{e as a}from"./chunks/provide-BwI4DDGF.js";import{c as i}from"./chunks/consume-CovVqBjI.js";import{m as s}from"./chunks/runtime-Bg1WXVCx.js";import{l as n}from"./chunks/localized-decorator-BlOuLhym.js";import{A as o}from"./chunks/api-client-context-V1UAGtKW.js";import{L as r}from"./chunks/login-token-task-Yib__6a9.js";import{l as p}from"./chunks/chunk-4FFT6DC2-CVWibomC.js";import{i as l,a as c,x as h}from"./chunks/lit-element-DiWJYFwC.js";import{n as u}from"./chunks/property-scuRaFcM.js";import{r as y}from"./chunks/state-LQivXIgA.js";import{setEnv as d}from"./env.js";import{initLocalization as m,setLocale as v,isValidLocale as k}from"./i18n.js";import{c as b,n as f}from"./chunks/api-chat-client-CJ1EGJe3.js";import{u as P,s as _,r as E}from"./chunks/apple-pay-outcomes-B1LrUXHR.js";import"./chunks/context-request-event-Dfydf1ub.js";import"./chunks/context-consumer-ESdICVAb.js";import"./chunks/create-context-DqP79qjF.js";import"./chunks/task-Bj8p7kJX.js";import"./chunks/external-CJj32K_p.js";import"./chunks/chunk-HN62IQ7S-xbkIy7k_.js";import"./chunks/parseISO-Dj3qSTG8.js";import"./chunks/format-CRFiCNHw.js";import"./chunks/isBefore-CPpTogxo.js";function g(){if("undefined"==typeof navigator)return!1;const e=navigator.userAgent;return/Safari/i.test(e)&&!/Chrome|Chromium|Edg|OPR|Firefox|FxiOS/i.test(e)}async function S(e){if("undefined"==typeof window||!window.isSecureContext)return{available:!1,reason:"unsupported"};if(!function(){if("undefined"==typeof window)return!1;const e="undefined"!=typeof ApplePaySession&&"function"==typeof ApplePaySession.canMakePayments,t="undefined"!=typeof customElements&&void 0!==customElements.get("apple-pay-button");return e&&t}())return{available:!1,reason:"sdk-missing"};if(!e.trim())return{available:!1,reason:"merchant-id-missing"};const t=ApplePaySession;if(function(e){return"function"==typeof e.applePayCapabilities}(t))try{return function(e){switch(e){case"applePayUnsupported":return{available:!1,reason:"unsupported"};case"paymentCredentialsUnavailable":case"paymentCredentialsAvailable":case"paymentCredentialStatusUnknown":return{available:!0,usesQrFlow:!g()}}}((await t.applePayCapabilities(e)).paymentCredentialStatus)}catch{return t.canMakePayments()?{available:!0,usesQrFlow:!g()}:{available:!1,reason:"unsupported"}}return t.canMakePayments()?{available:!0,usesQrFlow:!g()}:{available:!1,reason:"unsupported"}}const A={es_ES:"es-ES",en_US:"en-US",pt_PT:"pt-PT",de_DE:"de-DE",ca_ES:"ca-ES"};try{m()}catch{}const C=["visa","masterCard","amex"],w=["supports3DS"],x=l`:host{display:flex;flex-direction:column;align-items:stretch;justify-content:center;gap:12px;width:100%;min-height:48px}.helper{margin:0;text-align:center;font-family:system-ui,sans-serif;font-size:13px;line-height:1.4;color:#6e6e73}.pay-row{display:block;width:100%}.pay-row--paying{opacity:.55;pointer-events:none}apple-pay-button{--apple-pay-button-width:100%;--apple-pay-button-height:48px;--apple-pay-button-border-radius:10px;--apple-pay-button-padding:0;display:block;width:100%;min-height:48px;cursor:pointer}.state{text-align:center;font-family:system-ui,sans-serif;font-size:15px;color:#86868b;margin:0}`;class ApplePayCheckoutSuccessEvent extends Event{static{this.eventName="payment-success"}constructor(e){super(ApplePayCheckoutSuccessEvent.eventName,{bubbles:!0,composed:!0}),this.detail=e}}class ApplePayCheckoutDeniedEvent extends Event{static{this.eventName="payment-denied"}constructor(e){super(ApplePayCheckoutDeniedEvent.eventName,{bubbles:!0,composed:!0}),this.detail=e}}class ApplePayCheckoutErrorEvent extends Event{static{this.eventName="payment-error"}constructor(e){super(ApplePayCheckoutErrorEvent.eventName,{bubbles:!0,composed:!0}),this.detail=e}}function j(e,t){p.warn(e,{error:t instanceof Error?t.message:String(t)})}let T=class MqApplePayCheckout extends c{constructor(){super(...arguments),this._availabilityPhase="checking",this._showQrHelper=!1,this._paying=!1,this._suppressCancelEvent=!1,this._availabilityGeneration=0,this.apiClient=b(),this._loginTokenTask=new r(this,()=>this.apiClient,{args:()=>[this.apiKey,this.token],onComplete:e=>{this._sessionToken=e.access_token,this.apiClient.setAuthToken(e.access_token),this._refreshAvailability()},onError:()=>{this.dispatchEvent(new ApplePayCheckoutErrorEvent({reason:"auth"}))}}),this._onPayClick=()=>{if(this._paying||"ready"!==this._availabilityPhase)return;let e;try{e=new ApplePaySession(3,this._buildPaymentRequest())}catch(e){return j("mq-apple-pay-checkout: failed to create ApplePaySession",e),void this.dispatchEvent(new ApplePayCheckoutErrorEvent({reason:"unsupported"}))}this._paying=!0,this._suppressCancelEvent=!1,e.onvalidatemerchant=async t=>{try{const a=await this.apiClient.payments.validateApplePayMerchant({order_id:this.sessionId,validation_url:t.validationURL});e.completeMerchantValidation(P(a))}catch(t){j("mq-apple-pay-checkout: validate-merchant failed",t),this._suppressCancelEvent=!0,this.dispatchEvent(new ApplePayCheckoutErrorEvent({reason:"merchant"})),e.abort(),this._paying=!1}},e.onpaymentauthorized=async t=>{try{const a=await this.apiClient.payments.authorizeApplePay({order_id:this.sessionId,token:_(t.payment.token)}),{status:i,consultation_id:s}=a.data,n=E(i,s,this.sessionId);switch(n.kind){case"success":e.completePayment(ApplePaySession.STATUS_SUCCESS),this.dispatchEvent(new ApplePayCheckoutSuccessEvent({sessionId:n.sessionId,reference:n.reference}));break;case"denied":e.completePayment(ApplePaySession.STATUS_FAILURE),this.dispatchEvent(new ApplePayCheckoutDeniedEvent({sessionId:n.sessionId}));break;case"error":e.completePayment(ApplePaySession.STATUS_FAILURE),this.dispatchEvent(new ApplePayCheckoutErrorEvent({reason:n.reason}))}}catch(t){j("mq-apple-pay-checkout: authorize failed",t),e.completePayment(ApplePaySession.STATUS_FAILURE),this.dispatchEvent(new ApplePayCheckoutErrorEvent({reason:"authorize"}))}finally{this._paying=!1}},e.oncancel=()=>{this._paying=!1,this._suppressCancelEvent?this._suppressCancelEvent=!1:this.dispatchEvent(new ApplePayCheckoutErrorEvent({reason:"cancelled"}))};try{e.begin()}catch(e){j("mq-apple-pay-checkout: session.begin() failed",e),this._paying=!1,this.dispatchEvent(new ApplePayCheckoutErrorEvent({reason:"unsupported"}))}}}static{this.styles=x}willUpdate(e){e.has("env")&&this.env&&d(this.env),e.has("locale")&&v(k(this.locale)?this.locale:"es_ES");const t=f(e,{env:this.env,apiKey:this.apiKey,token:this._sessionToken,locale:k(this.locale)?this.locale:"es_ES"},this.inheritedApiClient);t&&(this.apiClient=t),e.has("merchantId")&&this._loginTokenTask.value&&this._refreshAvailability()}async _refreshAvailability(){const e=++this._availabilityGeneration;this._availabilityPhase="checking",this._showQrHelper=!1;const t=await S(this.merchantId??"");e===this._availabilityGeneration&&(t.available?(this._availabilityPhase="ready",this._showQrHelper=t.usesQrFlow):this._availabilityPhase="unavailable")}get _resolvedLocale(){return k(this.locale)?this.locale:"es_ES"}_buildPaymentRequest(){return{countryCode:this.country,currencyCode:this.currency,supportedNetworks:[...C],merchantCapabilities:[...w],total:{label:this.label,amount:this.amount}}}_renderUnavailable(){return this.merchantId?.trim()?"undefined"==typeof ApplePaySession?h`<p class="state">${s("No se ha podido cargar Apple Pay. Comprueba la configuración del sitio e inténtalo de nuevo.")}</p>`:h`<p class="state">${s("Apple Pay no está disponible")}</p>`:h`<p class="state">${s("Falta el identificador de comercio de Apple Pay")}</p>`}render(){return this._loginTokenTask.render({pending:()=>h`<p class="state">${s("Preparando Apple Pay…")}</p>`,error:()=>h`<p class="state">${s("No hemos podido iniciar el pago")}</p>`,complete:()=>{return"checking"===this._availabilityPhase?h`<p class="state">${s("Comprobando Apple Pay…")}</p>`:"unavailable"===this._availabilityPhase?this._renderUnavailable():h`${this._showQrHelper?h`<p class="helper">${s("Para pagar con Apple Pay, escanea el código QR con tu iPhone (iOS 18 o posterior) y confirma el pago.")}</p>`:null}<div class="pay-row ${this._paying?"pay-row--paying":""}"><apple-pay-button buttonstyle="black" type="pay" locale="${e=this._resolvedLocale,A[e]??"es-ES"}" aria-label="${s("Pagar con Apple Pay")}" @click="${this._onPayClick}"></apple-pay-button></div>`;var e}})}};e([u({type:String,attribute:"env"})],T.prototype,"env",void 0),e([u({type:String,attribute:"api-key"})],T.prototype,"apiKey",void 0),e([u({type:String,attribute:"token"})],T.prototype,"token",void 0),e([u({type:String,attribute:"locale",reflect:!0})],T.prototype,"locale",void 0),e([u({type:String,attribute:"merchant-id"})],T.prototype,"merchantId",void 0),e([u({type:String,attribute:"session-id"})],T.prototype,"sessionId",void 0),e([u({type:String,attribute:"amount"})],T.prototype,"amount",void 0),e([u({type:String,attribute:"currency"})],T.prototype,"currency",void 0),e([u({type:String,attribute:"country"})],T.prototype,"country",void 0),e([u({type:String,attribute:"label"})],T.prototype,"label",void 0),e([y()],T.prototype,"_availabilityPhase",void 0),e([y()],T.prototype,"_showQrHelper",void 0),e([y()],T.prototype,"_paying",void 0),e([i({context:o,subscribe:!0}),y()],T.prototype,"inheritedApiClient",void 0),e([a({context:o}),y()],T.prototype,"apiClient",void 0),T=e([n(),t("mq-apple-pay-checkout")],T);export{ApplePayCheckoutDeniedEvent,ApplePayCheckoutErrorEvent,ApplePayCheckoutSuccessEvent,T as MqApplePayCheckout};
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import * as lit_html from 'lit-html';
|
|
2
|
-
import { C as CreatePaymentLinkRequest } from './chunks/
|
|
2
|
+
import { C as CreatePaymentLinkRequest } from './chunks/index.d-XSe7Hy-Q.js';
|
|
3
3
|
import { LitElement } from 'lit';
|
|
4
4
|
import { Env } from './env.js';
|
|
5
5
|
import { Locale } from './i18n.js';
|
|
6
6
|
import './mq-checkout.js';
|
|
7
|
+
import 'axios';
|
|
7
8
|
import 'zod';
|
|
9
|
+
import './chunks/schemas.d-b6_AekBb.js';
|
|
8
10
|
import './ui/mq-skeleton.js';
|
|
9
11
|
|
|
10
12
|
type PreconsultationDocument = NonNullable<CreatePaymentLinkRequest["preconsultation_documents"]>[number];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as t,c as e}from"./chunks/custom-element-D2ziPxYE.js";import{a as o,x as
|
|
1
|
+
import{_ as t,c as e}from"./chunks/custom-element-D2ziPxYE.js";import{a as o,x as s}from"./chunks/lit-element-DiWJYFwC.js";import{n as i}from"./chunks/property-scuRaFcM.js";import{o as n}from"./chunks/if-defined-BYeVdwgd.js";import"./mq-checkout.js";import"./chunks/provide-BwI4DDGF.js";import"./chunks/context-request-event-Dfydf1ub.js";import"./chunks/consume-CovVqBjI.js";import"./chunks/context-consumer-ESdICVAb.js";import"./chunks/runtime-Bg1WXVCx.js";import"./chunks/localized-decorator-BlOuLhym.js";import"./chunks/task-Bj8p7kJX.js";import"./chunks/api-chat-client-CJ1EGJe3.js";import"./chunks/chunk-HN62IQ7S-xbkIy7k_.js";import"./chunks/parseISO-Dj3qSTG8.js";import"./chunks/format-CRFiCNHw.js";import"./chunks/external-CJj32K_p.js";import"./chunks/isBefore-CPpTogxo.js";import"./env.js";import"./chunks/api-client-context-V1UAGtKW.js";import"./chunks/create-context-DqP79qjF.js";import"./chunks/login-token-task-Yib__6a9.js";import"./chunks/chunk-4FFT6DC2-CVWibomC.js";import"./chunks/state-LQivXIgA.js";import"./theme.js";import"./i18n.js";import"./ui/mq-skeleton.js";import"./chunks/style-map-CIdqdn7C.js";import"./chunks/directive-2EDmOukv.js";class AppointmentPaidEvent extends Event{static{this.eventName="payment-success"}constructor(t){super(AppointmentPaidEvent.eventName,{bubbles:!0,composed:!0}),this.detail=t}}let r=class MqAppointmentCheckout extends o{constructor(){super(...arguments),this._provideSession=async t=>{const e=await t.payments.createPaymentLink({slot_id:this.slotId,service_id:this.serviceId,specialty_id:this.specialtyId,consultation_reason:this.consultationReason,discount_code:this.discountCode,preconsultation_documents:this.preconsultationDocuments});return{sessionId:e.session_id,paymentUrl:e.payment_link}},this._onSuccess=t=>{t.stopPropagation(),this.dispatchEvent(new AppointmentPaidEvent({appointmentId:t.detail.reference}))}}render(){return s`<mq-checkout env="${n(this.env)}" api-key="${this.apiKey}" token="${this.token}" locale="${this.locale}" .provideSession="${this._provideSession}" @payment-success="${this._onSuccess}"></mq-checkout>`}};t([i({type:String,attribute:"env"})],r.prototype,"env",void 0),t([i({type:String,attribute:"api-key"})],r.prototype,"apiKey",void 0),t([i({type:String,attribute:"token"})],r.prototype,"token",void 0),t([i({type:String,attribute:"locale",reflect:!0})],r.prototype,"locale",void 0),t([i({type:String,attribute:"slot-id"})],r.prototype,"slotId",void 0),t([i({type:String,attribute:"service-id"})],r.prototype,"serviceId",void 0),t([i({type:String,attribute:"specialty-id"})],r.prototype,"specialtyId",void 0),t([i({type:String,attribute:"consultation-reason"})],r.prototype,"consultationReason",void 0),t([i({type:String,attribute:"discount-code"})],r.prototype,"discountCode",void 0),t([i({attribute:!1})],r.prototype,"preconsultationDocuments",void 0),r=t([e("mq-appointment-checkout")],r);export{AppointmentPaidEvent,r as MqAppointmentCheckout};
|