@mediquo/elements 0.8.2 → 0.9.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 (107) hide show
  1. package/README.md +36 -1
  2. package/dist/chunks/appointment-card-skeleton-B_rJNvU9.js +1 -0
  3. package/dist/chunks/{documentation-view-BbMbGneD.js → documentation-view-DEXxBFrV.js} +1 -1
  4. package/dist/chunks/{index-uHvVQMNc.js → index-Btj1mwcE.js} +1 -1
  5. package/dist/chunks/next-appointment-card-6uXWTDx5.js +1 -0
  6. package/dist/chunks/next-appointment-card-Bc65OZ1_.d.ts +61 -0
  7. package/dist/chunks/{telemetry-client-7fvNqUSU.js → telemetry-client-BdPx4SXu.js} +1 -1
  8. package/dist/env.js +1 -1
  9. package/dist/mq-appointment-documentation.js +1 -1
  10. package/dist/mq-dashboard.js +1 -1
  11. package/dist/mq-documents.d.ts +4 -8
  12. package/dist/mq-documents.js +1 -1
  13. package/dist/mq-my-appointments.d.ts +2 -2
  14. package/dist/mq-my-appointments.js +1 -1
  15. package/dist/mq-next-appointments.d.ts +8 -47
  16. package/dist/mq-next-appointments.js +1 -1
  17. package/dist/mq-recent-documents.js +1 -1
  18. package/dist/mq-schedule-success.js +1 -1
  19. package/dist/mq-schedule.d.ts +12 -1
  20. package/dist/mq-schedule.js +1 -1
  21. package/dist/mq-support-chat.d.ts +1 -0
  22. package/dist/mq-support-chat.js +1 -1
  23. package/dist/mq-videocall.js +1 -1
  24. package/dist/react/mq-appointment-documentation.js +1 -1
  25. package/dist/react/mq-chat-room.js +1 -1
  26. package/dist/react/mq-dashboard.js +1 -1
  27. package/dist/react/mq-documents-page.d.ts +0 -1
  28. package/dist/react/mq-documents-page.js +1 -1
  29. package/dist/react/mq-documents.d.ts +0 -1
  30. package/dist/react/mq-documents.js +1 -1
  31. package/dist/react/mq-my-appointments.d.ts +1 -1
  32. package/dist/react/mq-my-appointments.js +1 -1
  33. package/dist/react/mq-next-appointments.d.ts +2 -0
  34. package/dist/react/mq-next-appointments.js +1 -1
  35. package/dist/react/mq-recent-documents.js +1 -1
  36. package/dist/react/mq-schedule-success.js +1 -1
  37. package/dist/react/mq-schedule.d.ts +4 -0
  38. package/dist/react/mq-schedule.js +1 -1
  39. package/dist/react/mq-support-chat.d.ts +3 -0
  40. package/dist/react/mq-support-chat.js +1 -1
  41. package/dist/react/mq-videocall.js +1 -1
  42. package/dist/theme.d.ts +1 -0
  43. package/dist/theme.js +1 -1
  44. package/dist/ui/icons/alert-circle-icon.js +1 -1
  45. package/dist/ui/icons/annotation-question-icon.d.ts +1 -1
  46. package/dist/ui/icons/annotation-question-icon.js +1 -1
  47. package/dist/ui/icons/arrow-narrow-left-icon.js +1 -1
  48. package/dist/ui/icons/arrow-right-icon.js +1 -1
  49. package/dist/ui/icons/briefcase-icon.d.ts +1 -1
  50. package/dist/ui/icons/briefcase-icon.js +1 -1
  51. package/dist/ui/icons/calendar-icon.d.ts +1 -1
  52. package/dist/ui/icons/calendar-icon.js +1 -1
  53. package/dist/ui/icons/chat-bubble-icon.d.ts +1 -1
  54. package/dist/ui/icons/chat-bubble-icon.js +1 -1
  55. package/dist/ui/icons/check-double-icon.js +1 -1
  56. package/dist/ui/icons/check-icon.js +1 -1
  57. package/dist/ui/icons/chevron-down-icon.js +1 -1
  58. package/dist/ui/icons/chevron-left-icon.js +1 -1
  59. package/dist/ui/icons/chevron-right-icon.js +1 -1
  60. package/dist/ui/icons/clock-icon.d.ts +1 -1
  61. package/dist/ui/icons/clock-icon.js +1 -1
  62. package/dist/ui/icons/dots-horizontal-icon.js +1 -1
  63. package/dist/ui/icons/download-02-icon.d.ts +1 -1
  64. package/dist/ui/icons/download-02-icon.js +1 -1
  65. package/dist/ui/icons/download-icon.d.ts +1 -1
  66. package/dist/ui/icons/download-icon.js +1 -1
  67. package/dist/ui/icons/file-icon.d.ts +1 -1
  68. package/dist/ui/icons/file-icon.js +1 -1
  69. package/dist/ui/icons/heartbeat-icon.js +1 -1
  70. package/dist/ui/icons/info-circle-outine-icon.d.ts +1 -1
  71. package/dist/ui/icons/info-circle-outine-icon.js +1 -1
  72. package/dist/ui/icons/message-bubble-icon.d.ts +1 -1
  73. package/dist/ui/icons/message-bubble-icon.js +1 -1
  74. package/dist/ui/icons/message-square-icon.d.ts +1 -1
  75. package/dist/ui/icons/message-square-icon.js +1 -1
  76. package/dist/ui/icons/mic-icon.d.ts +1 -1
  77. package/dist/ui/icons/mic-icon.js +1 -1
  78. package/dist/ui/icons/mic-off-icon.d.ts +1 -1
  79. package/dist/ui/icons/mic-off-icon.js +1 -1
  80. package/dist/ui/icons/phone-icon.d.ts +1 -1
  81. package/dist/ui/icons/phone-icon.js +1 -1
  82. package/dist/ui/icons/tag-icon.d.ts +1 -1
  83. package/dist/ui/icons/tag-icon.js +1 -1
  84. package/dist/ui/icons/time-left-icon.js +1 -1
  85. package/dist/ui/icons/types.d.ts +2 -1
  86. package/dist/ui/icons/types.js +1 -1
  87. package/dist/ui/icons/upload-icon.d.ts +1 -1
  88. package/dist/ui/icons/upload-icon.js +1 -1
  89. package/dist/ui/icons/video-icon.d.ts +1 -1
  90. package/dist/ui/icons/video-icon.js +1 -1
  91. package/dist/ui/icons/video-off-icon.d.ts +1 -1
  92. package/dist/ui/icons/video-off-icon.js +1 -1
  93. package/dist/ui/icons/x-icon.d.ts +1 -1
  94. package/dist/ui/icons/x-icon.js +1 -1
  95. package/dist/ui/mq-callout.js +1 -1
  96. package/dist/ui/mq-dialog.js +1 -1
  97. package/dist/ui/mq-input.d.ts +1 -1
  98. package/dist/ui/mq-select.d.ts +1 -1
  99. package/dist/ui/mq-tabs.d.ts +27 -7
  100. package/dist/ui/mq-tabs.js +79 -1
  101. package/dist/ui/mq-text-button.js +1 -1
  102. package/dist/ui/mq-textarea.d.ts +1 -1
  103. package/dist/ui/mq-unread-badge.js +1 -1
  104. package/package.json +2 -1
  105. package/dist/chunks/appointment-card-skeleton-D8gypuKh.js +0 -1
  106. package/dist/ui/icons/check-circle-icon.d.ts +0 -5
  107. package/dist/ui/icons/check-circle-icon.js +0 -1
package/README.md CHANGED
@@ -69,6 +69,16 @@ schedule?.addEventListener("back", () => {
69
69
 
70
70
  Most features accept `api-key`, `token`, `locale`, and `env` when used standalone. See the [documentation](https://wc-showcase.mediquo.com) for per-component attributes and events.
71
71
 
72
+ `mq-schedule` offers no digital wallet in its payment step unless the host opts
73
+ in. Add `google-pay-enabled` or `apple-pay-enabled` to offer them; each still
74
+ requires device support and a gateway that accepts wallets.
75
+
76
+ ```html
77
+ <mq-schedule api-key="YOUR_API_KEY" apple-pay-enabled></mq-schedule>
78
+ ```
79
+
80
+ In React, the same flags are `googlePayEnabled` / `applePayEnabled` on `MqSchedule`.
81
+
72
82
  ## Providers
73
83
 
74
84
  Mount these as ancestors of the features that need them:
@@ -249,6 +259,16 @@ Keep the brand's token values in the host application (or a shared host package)
249
259
  not in `@mediquo/elements`. This keeps the published package brand-neutral while
250
260
  letting integrators render any look on top of it.
251
261
 
262
+ ### Icons
263
+
264
+ Every icon this package renders is drawn in this repository, on a single 24 grid
265
+ at the design system's icon stroke, and inherits `currentColor`. The only
266
+ artwork we do not draw is the Google Pay and Apple Pay brand marks, which their
267
+ owners require us to display unmodified.
268
+
269
+ See [`src/ui/icons/ICONS.md`](./src/ui/icons/ICONS.md) for the full inventory
270
+ and the rules for adding a new icon.
271
+
252
272
  ## Events
253
273
 
254
274
  Components describe **what the user did**, never **where to navigate**. Listen for the actions you care about and own routing in the host.
@@ -267,7 +287,7 @@ Shared contract (also exported from `@mediquo/elements/events`):
267
287
  | `mq-view-documents` | — | Open the full documents list (from `mq-dashboard`) |
268
288
  | `mq-download-file` | `{ url, filename }` | Host should persist / download a file |
269
289
 
270
- Feature-specific events (e.g. `appointment-created` on `mq-schedule`) are documented per component.
290
+ `mq-download-file` is emitted by `mq-chat-room` and also bubbles from `mq-support-chat` (nested room). Feature-specific events (e.g. `appointment-created` on `mq-schedule`) are documented per component.
271
291
 
272
292
  ```ts
273
293
  import { DownloadFileEvent } from "@mediquo/elements/events";
@@ -278,6 +298,21 @@ el.addEventListener(DownloadFileEvent.eventName, (event) => {
278
298
  });
279
299
  ```
280
300
 
301
+ In React, the same callback is `onDownloadFile` on `MqChatRoom` and `MqSupportChat`:
302
+
303
+ ```ts
304
+ import { MqSupportChat } from "@mediquo/elements/react/mq-support-chat";
305
+
306
+ <MqSupportChat
307
+ apiKey="TENANT_KEY"
308
+ token="..."
309
+ onDownloadFile={(event) => {
310
+ const { url, filename } = event.detail;
311
+ // save or trigger a download
312
+ }}
313
+ />
314
+ ```
315
+
281
316
  ## Locale and environment
282
317
 
283
318
  Supported locales: `es_ES`, `en_US`, `pt_PT`, `de_DE`, `ca_ES`.
@@ -0,0 +1 @@
1
+ import{_ as t,c as e}from"./custom-element-D2ziPxYE.js";import{c as i}from"./consume-CovVqBjI.js";import{m as a}from"./runtime-Bg1WXVCx.js";import{l as o}from"./localized-decorator-BlOuLhym.js";import{Q as n}from"./query-controller-BlO1Ax65.js";import{A as s}from"./api-client-context-V1UAGtKW.js";import{g as p}from"./get-organization-setup-query-Dr1cXnHl.js";import{t as r,c as l,d as c,k as d,a as h,l as m,g as u,e as g,b as v}from"./telemetry-client-BdPx4SXu.js";import{g as f}from"./get-schedule-services-query-Fzvb9ug9.js";import{g as y}from"./chunk-Y4EKUX25-QqMl3eiq.js";import{a as b,i as $,E as C,x}from"./lit-element-DiWJYFwC.js";import{n as k}from"./property-scuRaFcM.js";import{r as R}from"./state-LQivXIgA.js";import{getLocale as q}from"../i18n.js";import"./appointment-details-DXLBQnPN.js";import"../ui/mq-card.js";import"./professional-overview-C4H_znIJ.js";import{l as j}from"./chunk-S5RWG6G2-DPesx3Od.js";import"../mq-chat-room.js";import"../ui/mq-floating-bubble.js";import{A as w,i as S}from"./api-chat-client-CJ1EGJe3.js";import{g as D}from"./action-unavailable-message-BIgsXk9u.js";import{e as I}from"./class-map-Co76I6aw.js";import{MqAppointmentRescheduleEvent as O,MqAppointmentBookEvent as M,MqAppointmentJoinVideocallEvent as U,MqAppointmentViewDocumentationEvent as _}from"../events.js";import{messageBubbleIcon as A}from"../ui/icons/message-bubble-icon.js";import{videoIcon as H}from"../ui/icons/video-icon.js";import"../ui/mq-button.js";import"../ui/mq-unread-badge.js";import{c as z}from"./refund-cancel-policy-CcsJ-pMx.js";import{toast as E}from"../ui/mq-toast.js";let N=class AppointmentCardActions extends b{constructor(){super(...arguments),this.variant="next",this.isVideocall=!1,this.hasChatSupport=!1,this.unreadCount=0,this.isModifyUnavailable=!1,this.isCancelUnavailable=!1,this.hasNoSlots=!1,this.modifyUnavailableMessage="",this.cancelUnavailableMessage="",this.repeatTarget=null,this.professionalHash="",this.openDialog=null,this.handleModifyClick=()=>{this.isModifyUnavailable?this.openDialog="modify":(r.track(l(this.patientHash,this.appointmentId)),this.dispatchEvent(new O({appointmentId:this.appointmentId})))},this.handleCancelClick=()=>{this.isCancelUnavailable?this.openDialog="cancel":(r.track(c(this.patientHash,this.appointmentId)),this.dispatchEvent(new CustomEvent("request-cancel",{bubbles:!0,composed:!0})))},this.handleRepeatClick=()=>{this.hasNoSlots?this.openDialog="repeat-no-slots":this.repeatTarget?(r.track(d(this.patientHash,this.appointmentId)),this.dispatchEvent(new M({specialty:this.repeatTarget.specialty,service:this.repeatTarget.service,professional:this.professionalHash}))):this.openDialog="repeat-error"},this.handleDialogClose=()=>{this.openDialog=null}}static{this.styles=$`:host{display:contents}.actions{display:flex;gap:var(--sp-3);margin-top:var(--sp-2)}.actions.next{flex-direction:column}.actions-secondary{display:flex;gap:var(--sp-3)}.actions mq-button{flex:1}`}get patientHash(){return this.loginToken.patient.hash}renderChatButton(){return x`<mq-button variant="primary" fullwidth noPadding @click="${()=>{this.dispatchEvent(new CustomEvent("toggle-chat",{bubbles:!0,composed:!0}))}}">${A({size:24})} ${a("Chat")} ${this.unreadCount>0?x`<mq-unread-badge></mq-unread-badge>`:C}</mq-button>`}renderNextActions(){return x`${this.isVideocall?x`<mq-button variant="outline" fullwidth noPadding @click="${()=>{r.track(h(this.patientHash,this.appointmentId)),this.dispatchEvent(new U({appointmentId:this.appointmentId}))}}">${H({size:24})} ${a("Ir a videollamada")}</mq-button>`:C}<div class="actions-secondary">${this.hasChatSupport?this.renderChatButton():C}<mq-button variant="outline" fullwidth noPadding @click="${this.handleModifyClick}">${a("Modificar")}</mq-button><mq-button variant="outline-negative" fullwidth noPadding @click="${this.handleCancelClick}">${a("Cancelar")}</mq-button></div>`}renderHistoryActions(){return x`${this.hasChatSupport?this.renderChatButton():C}<mq-button variant="outline" fullwidth noPadding @click="${()=>{r.track(m(this.patientHash,this.appointmentId)),this.dispatchEvent(new _({appointmentId:this.appointmentId}))}}">${a("Documentos")}</mq-button><mq-button variant="outline" fullwidth noPadding @click="${this.handleRepeatClick}">${a("Repetir")}</mq-button>`}render(){return x`<div class="${I({actions:!0,next:"next"===this.variant})}">${"next"===this.variant?this.renderNextActions():this.renderHistoryActions()}</div><appointment-action-unavailable-dialog .open="${"modify"===this.openDialog}" .heading="${a("Modificar cita")}" .message="${this.modifyUnavailableMessage}" @close="${this.handleDialogClose}"></appointment-action-unavailable-dialog><appointment-action-unavailable-dialog .open="${"cancel"===this.openDialog}" .heading="${a("Anular cita")}" .message="${this.cancelUnavailableMessage}" @close="${this.handleDialogClose}"></appointment-action-unavailable-dialog><appointment-action-unavailable-dialog .open="${"repeat-no-slots"===this.openDialog}" .heading="${a("Repetir cita")}" .message="${a("Este profesional no tiene horarios disponibles")}" @close="${this.handleDialogClose}"></appointment-action-unavailable-dialog><appointment-action-unavailable-dialog .open="${"repeat-error"===this.openDialog}" .heading="${a("Repetir cita")}" .message="${a("Lo sentimos, no hemos podido repetir tu cita. Por favor, contacta con soporte.")}" @close="${this.handleDialogClose}"></appointment-action-unavailable-dialog>`}};t([i({context:j})],N.prototype,"loginToken",void 0),t([k({type:String})],N.prototype,"variant",void 0),t([k({type:String})],N.prototype,"appointmentId",void 0),t([k({type:Boolean})],N.prototype,"isVideocall",void 0),t([k({type:Boolean})],N.prototype,"hasChatSupport",void 0),t([k({type:Number})],N.prototype,"unreadCount",void 0),t([k({type:Boolean})],N.prototype,"isModifyUnavailable",void 0),t([k({type:Boolean})],N.prototype,"isCancelUnavailable",void 0),t([k({type:Boolean})],N.prototype,"hasNoSlots",void 0),t([k({type:String})],N.prototype,"modifyUnavailableMessage",void 0),t([k({type:String})],N.prototype,"cancelUnavailableMessage",void 0),t([k({type:Object})],N.prototype,"repeatTarget",void 0),t([k({type:String})],N.prototype,"professionalHash",void 0),t([R()],N.prototype,"openDialog",void 0),N=t([o(),e("appointment-card-actions")],N);let T=class AppointmentCard extends b{constructor(){super(...arguments),this.variant="next",this.detailsVariant="wide",this.isChatOpen=!1,this.isCancelDialogOpen=!1,this.unreadQuery=new n(this,()=>y(this.apiClient,{roomId:this.appointmentResource?.room?.id})),this.getOrganizationSpecialtiesQuery=new n(this,()=>u(this.apiClient,{enabled:!!this.appointmentResource?.speciality?.id})),this.getOrganizationSetupQuery=new n(this,()=>p(this.apiClient)),this.getScheduleServicesQuery=new n(this,()=>f(this.apiClient))}static{this.styles=$`:host{display:flex}.card{width:100%;padding:var(--sp-6);display:flex;flex-direction:column;gap:var(--sp-4);justify-content:space-between}.card-top-content{display:flex;flex-direction:column;gap:var(--sp-6)}.see-details{color:var(--color-primary-link-default);font-size:var(--text-sm);line-height:var(--text-sm--line-height);font-weight:var(--font-weight-bold)}.see-details:hover{text-decoration:underline}.chevron-down{width:16px;height:16px;transition:transform .2s ease}.appointment-details{display:flex;flex-direction:column;gap:12px}.clock-icon-wrapper{width:24px;height:24px;display:flex;align-items:center;justify-content:center;flex-shrink:0}.clock-icon-wrapper svg{width:100%;height:100%}.appointment-type{display:flex;align-items:center;gap:12px;font-size:18px;color:#2c3e50}.actions{display:flex;gap:var(--sp-3);margin-top:var(--sp-2)}.actions.next{flex-direction:column}.actions-secondary{display:flex;gap:var(--sp-3)}.actions mq-button{flex:1}`}render(){const t=this.appointmentResource.appointment.channel===w.videocall,e=this.appointmentResource.appointment.channel===w.phonecall,i=!0===this.appointmentResource.appointment.has_chat_in_appointment,o=(t||e)&&i,n=q(),s=S(this.appointmentResource.appointment.expires_at),p=0===this.appointmentResource.slots.length,l=this.getOrganizationSetupQuery.result?.data?.appointments?.seconds_before_start_to_refund_on_cancel,c=z({startsAtIso:this.appointmentResource.appointment.starts_at,refundPolicySeconds:l}),d=s||p||!c,h=s||!c,m=D({action:"modify",refundPolicySeconds:l}),u=D({action:"cancel",refundPolicySeconds:l}),f=this.getOrganizationSpecialtiesQuery.result?.data?.find(t=>Number(t.id)===Number(this.appointmentResource.speciality.id)),y=g(f?.code??"",n,f?.name??this.appointmentResource.speciality.name),b=this.getScheduleServicesQuery.result?.data?.find(t=>t.id===this.appointmentResource.appointment.service_id)?.code,$=f?.code&&b?{specialty:f.code,service:b}:null;return x`<mq-card class="card" roundness="md"><div class="card-top-content"><professional-overview .specialtyName="${y??""}" .collegiateNumber="${this.appointmentResource.professional.collegiate_number??void 0}" .description="${this.appointmentResource.professional.description??""}" .languages="${this.appointmentResource.professional.languages}" .avatar="${this.appointmentResource.professional.avatar??""}" .name="${this.appointmentResource.professional.name}"></professional-overview><appointment-details .startsAt="${this.appointmentResource.appointment.starts_at}" .duration="${this.appointmentResource.appointment.duration}" .channel="${this.appointmentResource.appointment.channel}" .timezone="${this.loginToken?.patient?.timezone}" variant="${this.detailsVariant}"></appointment-details></div><appointment-card-actions .variant="${this.variant}" .appointmentId="${this.appointmentResource.appointment.id??""}" .isVideocall="${t}" .hasChatSupport="${o}" .unreadCount="${this.unreadQuery.result?.data?.unread_count??0}" .isModifyUnavailable="${d}" .isCancelUnavailable="${h}" .hasNoSlots="${p}" .modifyUnavailableMessage="${m}" .cancelUnavailableMessage="${u}" .repeatTarget="${$}" .professionalHash="${this.appointmentResource.professional.hash}" @toggle-chat="${()=>{this.isChatOpen=!this.isChatOpen,this.isChatOpen&&r.track(v(this.loginToken.patient.hash,this.appointmentResource.appointment.id??""))}}" @request-cancel="${()=>{this.isCancelDialogOpen=!0}}"></appointment-card-actions><mq-floating-bubble ?dismissable="${!1}" .open="${this.isChatOpen}" @mq-close="${()=>{this.isChatOpen=!1}}" hideCloseButton>${this.isChatOpen?x`<mq-chat-room slot="content" .consultationId="${this.appointmentResource.appointment.id}" consultation-type="appointment" token="${this.loginToken.access_token}" .roomId="${this.appointmentResource.room.id}" .professionalHash="${this.appointmentResource.professional.hash}" @mq-chat-room-close="${()=>{this.isChatOpen=!1}}" ?readonly="${s}"></mq-chat-room>`:C}</mq-floating-bubble><cancel-appointment-confirmation-dialog .appointmentId="${this.appointmentResource.appointment.id}" .price="${this.appointmentResource.price??void 0}" .open="${this.isCancelDialogOpen}" @cancel="${()=>{this.isCancelDialogOpen=!1}}" @success="${()=>{this.isCancelDialogOpen=!1,E.success(a("Consulta anulada correctamente")),this.dispatchEvent(new CustomEvent("appointment-cancel-confirmed",{bubbles:!0,composed:!0,detail:{id:this.appointmentResource.appointment.id}}))}}"></cancel-appointment-confirmation-dialog></mq-card>`}};t([i({context:s,subscribe:!0})],T.prototype,"apiClient",void 0),t([k({type:Object})],T.prototype,"appointmentResource",void 0),t([k({type:Number})],T.prototype,"specialtyId",void 0),t([k({type:String})],T.prototype,"variant",void 0),t([k({type:String})],T.prototype,"detailsVariant",void 0),t([i({context:j})],T.prototype,"loginToken",void 0),t([R()],T.prototype,"isChatOpen",void 0),t([R()],T.prototype,"isCancelDialogOpen",void 0),T=t([o(),e("appointment-card")],T);let P=class AppointmentCardSkeleton extends b{static{this.styles=$`div{border-radius:var(--border-radius-md);background:color-mix(in srgb,var(--color-neutrals-background-disabled) 50%,#fff 50%);height:337px;width:100%}`}render(){return x`<div></div>`}};P=t([e("appointment-card-skeleton")],P);
@@ -1 +1 @@
1
- import{_ as t,c as e}from"./custom-element-D2ziPxYE.js";import{m as i}from"./runtime-Bg1WXVCx.js";import{l as o}from"./localized-decorator-BlOuLhym.js";import{h as a,s as n}from"./task-Bj8p7kJX.js";import{A as s}from"./api-client-context-V1UAGtKW.js";import{C as r,i as l}from"./api-chat-client-CJ1EGJe3.js";import{g as d}from"./chunk-HN62IQ7S-xbkIy7k_.js";import{a as c}from"./addSeconds-ofMnxlgT.js";import{a as m,i as p,E as h,x as u}from"./lit-element-DiWJYFwC.js";import{n as f}from"./property-scuRaFcM.js";import{getLocale as g}from"../i18n.js";import{calendarIcon as v}from"../ui/icons/calendar-icon.js";import{clockIcon as y}from"../ui/icons/clock-icon.js";import{r as b}from"./state-LQivXIgA.js";import{infoCircleOutineIcon as x}from"../ui/icons/info-circle-outine-icon.js";import"../ui/mq-button.js";import{l as $}from"./chunk-S5RWG6G2-DPesx3Od.js";import{messageBubbleIcon as k}from"../ui/icons/message-bubble-icon.js";import"../mq-chat-room.js";import"../ui/mq-floating-bubble.js";import"../ui/mq-card.js";import"../ui/mq-unread-badge.js";import{c as q}from"./consume-CovVqBjI.js";import{Q as w}from"./query-controller-BlO1Ax65.js";import{g as z}from"./chunk-Y4EKUX25-QqMl3eiq.js";import"../ui/mq-page-title.js";import"./mq-layout-E5mKSz4A.js";import{M as j}from"./mutation-controller-CR2qcqhH.js";import{a as C,t as _,b as I,g as T,c as O,e as S}from"./telemetry-client-7fvNqUSU.js";import{MqViewAppointmentsEvent as D}from"../events.js";let E=class ChatCta extends m{constructor(){super(...arguments),this.text=i("Utiliza el chat para enviar el motivo de consulta, documentos o imágenes"),this.readonly=!1,this.isChatOpen=!1,this.unreadQuery=new w(this,()=>z(this.apiClient,{roomId:this.roomId}))}static{this.styles=[p`.chat-cta{padding:var(--sp-6) var(--sp-4);display:flex;flex-direction:column;gap:var(--sp-4)}.cta-message{display:inline-flex;align-items:center;justify-content:center;gap:var(--sp-4);font-family:var(--font-body);font-size:var(--text-sm);line-height:var(--text-sm--line-height);color:var(--color-neutrals-text-default)}.cta-message svg{flex-shrink:0}mq-button svg{flex-shrink:0}mq-chat-room{height:100%}@media (min-width:768px){.chat-cta{padding:var(--sp-6)}mq-button{max-width:323px;margin:0 auto}}`]}render(){return u`<mq-card class="chat-cta" roundness="md"><div class="cta-message">${x({size:24})} <span>${this.text}</span></div><mq-button variant="primary" size="md" fullwidth @click="${()=>{this.isChatOpen=!this.isChatOpen,this.isChatOpen&&this.onOpenChat?.()}}">${k({size:24})} ${i("Chatea con el profesional")} ${(this.unreadQuery.result?.data?.unread_count??0)>0?u`<mq-unread-badge></mq-unread-badge>`:h}</mq-button></mq-card><mq-floating-bubble ?dismissable="${!1}" .open="${this.isChatOpen}" @mq-close="${()=>{this.isChatOpen=!1}}" hideCloseButton>${this.isChatOpen?u`<mq-chat-room slot="content" .consultationId="${this.consultationId}" .consultationType="${r.appointment}" token="${this.loginToken.access_token}" .roomId="${this.roomId}" .professionalHash="${this.professionalHash}" ?readonly="${this.readonly}" @mq-chat-room-close="${()=>{this.isChatOpen=!1}}"></mq-chat-room>`:h}</mq-floating-bubble>`}};t([q({context:s,subscribe:!0})],E.prototype,"apiClient",void 0),t([f({type:Number})],E.prototype,"roomId",void 0),t([f({type:String})],E.prototype,"professionalHash",void 0),t([f({type:String})],E.prototype,"text",void 0),t([f({type:String})],E.prototype,"consultationId",void 0),t([f({type:Boolean,reflect:!0})],E.prototype,"readonly",void 0),t([f({attribute:!1})],E.prototype,"onOpenChat",void 0),t([q({context:$})],E.prototype,"loginToken",void 0),t([b()],E.prototype,"isChatOpen",void 0),E=t([o(),e("chat-cta")],E);let Q=class PageLayout extends m{constructor(){super(...arguments),this.yCentered=!1,this.background="solid"}static{this.styles=p`:host([background=transparent]){background-color:transparent}:host([background=solid]){background-color:var(--color-background)}:host([y-centered]) div{display:grid;place-items:center}div{width:100%;max-width:1000px;padding:var(--mq-layout-padding,0);margin:0 auto;box-sizing:border-box}:host([y-centered]) div{height:100%}main{width:100%}`}render(){return u`<div><main><slot></slot></main></div>`}};t([f({type:Boolean,attribute:"y-centered"})],Q.prototype,"yCentered",void 0),t([f({type:String})],Q.prototype,"background",void 0),Q=t([e("page-layout")],Q);const H=p`mq-page-title{margin:var(--size-3) 0}.description{font-size:var(--text-sm);line-height:var(--text-sm--line-height);color:var(--color-neutrals-text-default);font-weight:var(--font-weight-normal);margin:0;margin-bottom:var(--size-5)}.professional-card{padding:var(--size-4);margin-bottom:var(--size-4)}.professional-card>:not(:first-child){margin-top:var(--size-4)}.professional-name{font-family:var(--font-titles);font-size:var(--text-lg);line-height:var(--text-lg--line-height);color:var(--color-neutrals-text-default);font-weight:var(--font-weight-bold);margin:0;margin-bottom:var(--size-1)}.professional-speciality{font-size:var(--text-base);line-height:var(--text-base--line-height);color:var(--color-neutrals-text-default);font-weight:var(--font-weight-normal);margin:0}.description-list{display:flex;flex-direction:column;gap:var(--size-4)}.description-list-item{display:flex;flex-direction:row;align-items:center;gap:var(--size-2);color:var(--color-neutrals-text-default)}.description-list-item dt{display:inline-flex}.description-list-item dd{margin:0;font-family:var(--font-body);font-size:var(--text-base);line-height:var(--text-base--line-height);font-weight:var(--font-weight-semibold)}.description-list-item dd::first-letter{text-transform:uppercase}.documents-card{padding:var(--size-4);margin-bottom:var(--size-6)}.documents-card-empty{font-family:var(--font-body);font-size:var(--text-sm);line-height:var(--text-sm--line-height);color:var(--color-neutrals-text-default);font-weight:var(--font-weight-normal)}.documents-card-title{font-family:var(--font-titles);font-size:var(--text-lg);line-height:var(--text-lg--line-height);color:var(--color-neutrals-text-default);font-weight:var(--font-weight-bold);margin:0;margin-bottom:var(--size-4)}.documents-list{margin-bottom:var(--size-4)}.documents-list>:not(:first-child){margin-top:var(--size-2)}.finished-consultation-footer{display:flex;flex-direction:column;gap:var(--size-5)}.document-item-skeleton{height:57px;width:100%;background-color:var(--color-muted);animation:skeleton-pulse 1.5s infinite}@keyframes skeleton-pulse{0%{opacity:1}50%{opacity:.6}100%{opacity:1}}@media (min-width:768px){.description-list{flex-direction:row}mq-button{display:block;max-width:323px;margin:0 auto}}`;let N=class DocumentationView extends m{constructor(){super(...arguments),this.canReconnect=!1,this._sharedocumentsTask=new a(this,{task:async([t])=>await this.apiClient.flash.getSharedDocuments({appointment_id:t}),args:()=>[this.appointment.id]}),this.getOrganizationSpecialtiesQuery=new w(this,()=>C(this.apiClient)),this._reconnectMutation=new j(this,{mutationFn:t=>this.apiClient.appointments.reconnectAppointment(t),onSuccess:()=>{this.dispatchEvent(new CustomEvent("reconnect",{bubbles:!0,composed:!0}))}})}static{this.styles=H}firstUpdated(){_.track(I(this.loginToken.patient.hash,this.appointment.id??""))}render(){const t=!0===this.appointment.has_chat_in_appointment,e=g(),o=e.replace("_","-"),a=this.loginToken.patient.timezone,s=a?{timeZone:a}:{},r=new Intl.DateTimeFormat(o,{dateStyle:"full",...s}),m=new Intl.DateTimeFormat(o,{hour:"2-digit",minute:"2-digit",...s}),p=new Date(this.appointment.start_date),f=c(p,this.appointment.duration),b=a?d(a,p):"";return u`<mq-page-title .title="${i("Consulta finalizada")}" back-label="${i("Salir")}" @mq-back="${t=>{t.stopPropagation(),this.dispatchEvent(new D({tab:"history"}))}}"></mq-page-title><p class="description">${i("Si tu médico ha generado alguna documentación podrás verla y descargarla aquí, desde la sección de documentación, tu correo o el chat.")}</p><mq-card class="professional-card" roundness="md"><div><h2 class="professional-name">${this.appointment.from.name}</h2><p class="professional-speciality">${this.appointment.from.speciality}</p></div><dl class="description-list"><div class="description-list-item"><dt>${v()}</dt><dd>${r.format(p)}</dd></div><div class="description-list-item"><dt>${y()}</dt><dd>${m.format(p)} - ${m.format(f)}${b?` (${b})`:""}</dd></div></dl></mq-card><mq-card class="documents-card" roundness="md"><h2 class="documents-card-title">${i("Documentación")}</h2><div class="documents-list">${this._sharedocumentsTask?.render({pending:()=>u`<div class="document-item-skeleton"></div>`,complete:()=>0===this._sharedocumentsTask?.value?.length?u`<p class="documents-card-empty">${i("El médico está terminando de gestionar tu consulta. Actualiza en unos minutos para ver si tienes documentación.")}</p>`:this._sharedocumentsTask?.value?.map(t=>u`<patient-document .kind="${t.document_type}" .filename="${t.name}" .specialty="${(()=>{const i=this.getOrganizationSpecialtiesQuery.result?.data?.find(e=>e.id===t.professional.speciality_id);return T(i?.code??"",e,i?.name)})()}" .description="${t.name}" .date="${t.created_at}" .downloadUrl="${t.url}"></patient-document>`)})}</div><mq-button variant="outline" size="md" fullwidth @click="${()=>{_.track(O(this.loginToken.patient.hash,this.appointment.id??"")),this._sharedocumentsTask?.run()}}" .disabled="${this._sharedocumentsTask?.status===n.PENDING}">${i("Actualizar")}</mq-button></mq-card><div class="finished-consultation-footer">${this.canReconnect?u`<mq-button variant="primary" size="md" fullwidth ?disabled="${this._reconnectMutation.isPending}" @click="${()=>this._reconnectMutation.run({appointmentId:this.appointment.id})}">${i("Volver a la sala de espera")}</mq-button>`:h} ${t?u`<chat-cta .consultationId="${this.appointment.id}" .roomId="${Number(this.appointment.room_id)}" .professionalHash="${this.appointment.from.hash}" .text="${i("Puedes chatear con tu profesional hasta 48 horas finalizada tu cita")}" ?readonly="${l(this.appointment.expires_at)}" .onOpenChat="${()=>{_.track(S(this.loginToken.patient.hash,this.appointment.id??""))}}"></chat-cta>`:h}</div>`}};t([q({context:s,subscribe:!0})],N.prototype,"apiClient",void 0),t([f({type:Object})],N.prototype,"appointment",void 0),t([f({type:String})],N.prototype,"token",void 0),t([f({type:Boolean,attribute:"can-reconnect"})],N.prototype,"canReconnect",void 0),t([q({context:$})],N.prototype,"loginToken",void 0),N=t([o(),e("documentation-view")],N);
1
+ import{_ as t,c as e}from"./custom-element-D2ziPxYE.js";import{m as i}from"./runtime-Bg1WXVCx.js";import{l as o}from"./localized-decorator-BlOuLhym.js";import{h as a,s as n}from"./task-Bj8p7kJX.js";import{A as s}from"./api-client-context-V1UAGtKW.js";import{C as r,i as l}from"./api-chat-client-CJ1EGJe3.js";import{g as d}from"./chunk-HN62IQ7S-xbkIy7k_.js";import{a as c}from"./addSeconds-ofMnxlgT.js";import{a as m,i as p,E as h,x as u}from"./lit-element-DiWJYFwC.js";import{n as f}from"./property-scuRaFcM.js";import{getLocale as g}from"../i18n.js";import{calendarIcon as v}from"../ui/icons/calendar-icon.js";import{clockIcon as y}from"../ui/icons/clock-icon.js";import{r as b}from"./state-LQivXIgA.js";import{infoCircleOutineIcon as x}from"../ui/icons/info-circle-outine-icon.js";import"../ui/mq-button.js";import{l as $}from"./chunk-S5RWG6G2-DPesx3Od.js";import{messageBubbleIcon as k}from"../ui/icons/message-bubble-icon.js";import"../mq-chat-room.js";import"../ui/mq-floating-bubble.js";import"../ui/mq-card.js";import"../ui/mq-unread-badge.js";import{c as q}from"./consume-CovVqBjI.js";import{Q as w}from"./query-controller-BlO1Ax65.js";import{g as z}from"./chunk-Y4EKUX25-QqMl3eiq.js";import"../ui/mq-page-title.js";import"./mq-layout-E5mKSz4A.js";import{M as j}from"./mutation-controller-CR2qcqhH.js";import{g as C,t as _,h as I,e as T,i as O,j as S}from"./telemetry-client-BdPx4SXu.js";import{MqViewAppointmentsEvent as D}from"../events.js";let E=class ChatCta extends m{constructor(){super(...arguments),this.text=i("Utiliza el chat para enviar el motivo de consulta, documentos o imágenes"),this.readonly=!1,this.isChatOpen=!1,this.unreadQuery=new w(this,()=>z(this.apiClient,{roomId:this.roomId}))}static{this.styles=[p`.chat-cta{padding:var(--sp-6) var(--sp-4);display:flex;flex-direction:column;gap:var(--sp-4)}.cta-message{display:inline-flex;align-items:center;justify-content:center;gap:var(--sp-4);font-family:var(--font-body);font-size:var(--text-sm);line-height:var(--text-sm--line-height);color:var(--color-neutrals-text-default)}.cta-message svg{flex-shrink:0}mq-button svg{flex-shrink:0}mq-chat-room{height:100%}@media (min-width:768px){.chat-cta{padding:var(--sp-6)}mq-button{max-width:323px;margin:0 auto}}`]}render(){return u`<mq-card class="chat-cta" roundness="md"><div class="cta-message">${x({size:24})} <span>${this.text}</span></div><mq-button variant="primary" size="md" fullwidth @click="${()=>{this.isChatOpen=!this.isChatOpen,this.isChatOpen&&this.onOpenChat?.()}}">${k({size:24})} ${i("Chatea con el profesional")} ${(this.unreadQuery.result?.data?.unread_count??0)>0?u`<mq-unread-badge></mq-unread-badge>`:h}</mq-button></mq-card><mq-floating-bubble ?dismissable="${!1}" .open="${this.isChatOpen}" @mq-close="${()=>{this.isChatOpen=!1}}" hideCloseButton>${this.isChatOpen?u`<mq-chat-room slot="content" .consultationId="${this.consultationId}" .consultationType="${r.appointment}" token="${this.loginToken.access_token}" .roomId="${this.roomId}" .professionalHash="${this.professionalHash}" ?readonly="${this.readonly}" @mq-chat-room-close="${()=>{this.isChatOpen=!1}}"></mq-chat-room>`:h}</mq-floating-bubble>`}};t([q({context:s,subscribe:!0})],E.prototype,"apiClient",void 0),t([f({type:Number})],E.prototype,"roomId",void 0),t([f({type:String})],E.prototype,"professionalHash",void 0),t([f({type:String})],E.prototype,"text",void 0),t([f({type:String})],E.prototype,"consultationId",void 0),t([f({type:Boolean,reflect:!0})],E.prototype,"readonly",void 0),t([f({attribute:!1})],E.prototype,"onOpenChat",void 0),t([q({context:$})],E.prototype,"loginToken",void 0),t([b()],E.prototype,"isChatOpen",void 0),E=t([o(),e("chat-cta")],E);let Q=class PageLayout extends m{constructor(){super(...arguments),this.yCentered=!1,this.background="solid"}static{this.styles=p`:host([background=transparent]){background-color:transparent}:host([background=solid]){background-color:var(--color-background)}:host([y-centered]) div{display:grid;place-items:center}div{width:100%;max-width:1000px;padding:var(--mq-layout-padding,0);margin:0 auto;box-sizing:border-box}:host([y-centered]) div{height:100%}main{width:100%}`}render(){return u`<div><main><slot></slot></main></div>`}};t([f({type:Boolean,attribute:"y-centered"})],Q.prototype,"yCentered",void 0),t([f({type:String})],Q.prototype,"background",void 0),Q=t([e("page-layout")],Q);const H=p`mq-page-title{margin:var(--size-3) 0}.description{font-size:var(--text-sm);line-height:var(--text-sm--line-height);color:var(--color-neutrals-text-default);font-weight:var(--font-weight-normal);margin:0;margin-bottom:var(--size-5)}.professional-card{padding:var(--size-4);margin-bottom:var(--size-4)}.professional-card>:not(:first-child){margin-top:var(--size-4)}.professional-name{font-family:var(--font-titles);font-size:var(--text-lg);line-height:var(--text-lg--line-height);color:var(--color-neutrals-text-default);font-weight:var(--font-weight-bold);margin:0;margin-bottom:var(--size-1)}.professional-speciality{font-size:var(--text-base);line-height:var(--text-base--line-height);color:var(--color-neutrals-text-default);font-weight:var(--font-weight-normal);margin:0}.description-list{display:flex;flex-direction:column;gap:var(--size-4)}.description-list-item{display:flex;flex-direction:row;align-items:center;gap:var(--size-2);color:var(--color-neutrals-text-default)}.description-list-item dt{display:inline-flex}.description-list-item dd{margin:0;font-family:var(--font-body);font-size:var(--text-base);line-height:var(--text-base--line-height);font-weight:var(--font-weight-semibold)}.description-list-item dd::first-letter{text-transform:uppercase}.documents-card{padding:var(--size-4);margin-bottom:var(--size-6)}.documents-card-empty{font-family:var(--font-body);font-size:var(--text-sm);line-height:var(--text-sm--line-height);color:var(--color-neutrals-text-default);font-weight:var(--font-weight-normal)}.documents-card-title{font-family:var(--font-titles);font-size:var(--text-lg);line-height:var(--text-lg--line-height);color:var(--color-neutrals-text-default);font-weight:var(--font-weight-bold);margin:0;margin-bottom:var(--size-4)}.documents-list{margin-bottom:var(--size-4)}.documents-list>:not(:first-child){margin-top:var(--size-2)}.finished-consultation-footer{display:flex;flex-direction:column;gap:var(--size-5)}.document-item-skeleton{height:57px;width:100%;background-color:var(--color-muted);animation:skeleton-pulse 1.5s infinite}@keyframes skeleton-pulse{0%{opacity:1}50%{opacity:.6}100%{opacity:1}}@media (min-width:768px){.description-list{flex-direction:row}mq-button{display:block;max-width:323px;margin:0 auto}}`;let N=class DocumentationView extends m{constructor(){super(...arguments),this.canReconnect=!1,this._sharedocumentsTask=new a(this,{task:async([t])=>await this.apiClient.flash.getSharedDocuments({appointment_id:t}),args:()=>[this.appointment.id]}),this.getOrganizationSpecialtiesQuery=new w(this,()=>C(this.apiClient)),this._reconnectMutation=new j(this,{mutationFn:t=>this.apiClient.appointments.reconnectAppointment(t),onSuccess:()=>{this.dispatchEvent(new CustomEvent("reconnect",{bubbles:!0,composed:!0}))}})}static{this.styles=H}firstUpdated(){_.track(I(this.loginToken.patient.hash,this.appointment.id??""))}render(){const t=!0===this.appointment.has_chat_in_appointment,e=g(),o=e.replace("_","-"),a=this.loginToken.patient.timezone,s=a?{timeZone:a}:{},r=new Intl.DateTimeFormat(o,{dateStyle:"full",...s}),m=new Intl.DateTimeFormat(o,{hour:"2-digit",minute:"2-digit",...s}),p=new Date(this.appointment.start_date),f=c(p,this.appointment.duration),b=a?d(a,p):"";return u`<mq-page-title .title="${i("Consulta finalizada")}" back-label="${i("Salir")}" @mq-back="${t=>{t.stopPropagation(),this.dispatchEvent(new D({tab:"history"}))}}"></mq-page-title><p class="description">${i("Si tu médico ha generado alguna documentación podrás verla y descargarla aquí, desde la sección de documentación, tu correo o el chat.")}</p><mq-card class="professional-card" roundness="md"><div><h2 class="professional-name">${this.appointment.from.name}</h2><p class="professional-speciality">${this.appointment.from.speciality}</p></div><dl class="description-list"><div class="description-list-item"><dt>${v()}</dt><dd>${r.format(p)}</dd></div><div class="description-list-item"><dt>${y()}</dt><dd>${m.format(p)} - ${m.format(f)}${b?` (${b})`:""}</dd></div></dl></mq-card><mq-card class="documents-card" roundness="md"><h2 class="documents-card-title">${i("Documentación")}</h2><div class="documents-list">${this._sharedocumentsTask?.render({pending:()=>u`<div class="document-item-skeleton"></div>`,complete:()=>0===this._sharedocumentsTask?.value?.length?u`<p class="documents-card-empty">${i("El médico está terminando de gestionar tu consulta. Actualiza en unos minutos para ver si tienes documentación.")}</p>`:this._sharedocumentsTask?.value?.map(t=>u`<patient-document .kind="${t.document_type}" .filename="${t.name}" .specialty="${(()=>{const i=this.getOrganizationSpecialtiesQuery.result?.data?.find(e=>e.id===t.professional.speciality_id);return T(i?.code??"",e,i?.name)})()}" .description="${t.name}" .date="${t.created_at}" .downloadUrl="${t.url}"></patient-document>`)})}</div><mq-button variant="outline" size="md" fullwidth @click="${()=>{_.track(O(this.loginToken.patient.hash,this.appointment.id??"")),this._sharedocumentsTask?.run()}}" .disabled="${this._sharedocumentsTask?.status===n.PENDING}">${i("Actualizar")}</mq-button></mq-card><div class="finished-consultation-footer">${this.canReconnect?u`<mq-button variant="primary" size="md" fullwidth ?disabled="${this._reconnectMutation.isPending}" @click="${()=>this._reconnectMutation.run({appointmentId:this.appointment.id})}">${i("Volver a la sala de espera")}</mq-button>`:h} ${t?u`<chat-cta .consultationId="${this.appointment.id}" .roomId="${Number(this.appointment.room_id)}" .professionalHash="${this.appointment.from.hash}" .text="${i("Puedes chatear con tu profesional hasta 48 horas finalizada tu cita")}" ?readonly="${l(this.appointment.expires_at)}" .onOpenChat="${()=>{_.track(S(this.loginToken.patient.hash,this.appointment.id??""))}}"></chat-cta>`:h}</div>`}};t([q({context:s,subscribe:!0})],N.prototype,"apiClient",void 0),t([f({type:Object})],N.prototype,"appointment",void 0),t([f({type:String})],N.prototype,"token",void 0),t([f({type:Boolean,attribute:"can-reconnect"})],N.prototype,"canReconnect",void 0),t([q({context:$})],N.prototype,"loginToken",void 0),N=t([o(),e("documentation-view")],N);
@@ -1 +1 @@
1
- import{_ as t,c as e}from"./custom-element-D2ziPxYE.js";import{t as o,d as i,g as r}from"./telemetry-client-7fvNqUSU.js";import{i as a,a as s,x as n,E as d}from"./lit-element-DiWJYFwC.js";import{n as l}from"./property-scuRaFcM.js";import{c}from"./consume-CovVqBjI.js";import{m as p}from"./runtime-Bg1WXVCx.js";import{l as m}from"./localized-decorator-BlOuLhym.js";import{A as h}from"./api-client-context-V1UAGtKW.js";import{D as f}from"./api-chat-client-CJ1EGJe3.js";import{b as u}from"./blob-to-base64-CUL1trde.js";import{r as g}from"./state-LQivXIgA.js";import{DownloadFileEvent as y}from"../events.js";import{getLocale as v}from"../i18n.js";import{download02Icon as w}from"../ui/icons/download-02-icon.js";import"../ui/mq-button.js";import{toast as b}from"../ui/mq-toast.js";import"../ui/mq-skeleton.js";const x=a`:host{display:flex;align-items:center;gap:var(--sp-3);padding:var(--sp-1) 0;width:100%;min-width:0;box-sizing:border-box}.details{display:flex;flex-direction:column;align-items:flex-start;gap:6px;flex:1;min-width:0}.tag{display:inline-flex;align-items:center;border-radius:var(--border-radius-sm);padding:var(--sp-1) var(--sp-2);font-family:var(--font-body);font-size:var(--text-xs);line-height:1.35;font-weight:var(--font-weight-normal)}.tag.prescription{background-color:var(--color-feedback--info-subtle,#eceefd);color:var(--color-feedback--info-text,#4a1ea7)}.tag.report{background-color:var(--color-feedback--warning-subtle,#ffebce);color:var(--color-feedback--warning-text,#8f4700)}.tag.diagnostic-test-prescription{background-color:var(--color-feedback--success-subtle,#e8f6ec);color:var(--color-feedback--success-text,#16653a)}.text{display:flex;flex-direction:column;gap:var(--sp-1);width:100%;min-width:0}.name{font-family:var(--font-body);font-size:var(--text-sm);line-height:1.35;font-weight:var(--font-weight-normal);color:var(--color-text-icons--primary,#0a0a22);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.meta{font-family:var(--font-body);font-size:var(--text-xs);line-height:1.35;font-weight:var(--font-weight-normal);color:var(--color-text-icons--secondary,#6d658b);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}`;let k=class DocumentRow extends s{constructor(){super(...arguments),this.documentId="",this.name="",this.specialty="",this.date="",this.downloadUrl="",this.patientHash="",this.isDownloading=!1,this.handleDownload=async()=>{this.isDownloading=!0;try{o.track(i(this.patientHash,this.documentId));const t=await this.apiClient.flash.downloadDocument({url:this.downloadUrl}),e=await u(t);this.dispatchEvent(new y({url:e,filename:`${this.name}.pdf`}))}catch{b.error(p("No hemos podido descargar el documento."))}finally{this.isDownloading=!1}}}static{this.styles=x}formatDate(){const t=new Date(this.date);if(Number.isNaN(t.getTime()))return"";const e=v().replace("_","-");return new Intl.DateTimeFormat(e,{day:"2-digit",month:"2-digit",year:"2-digit"}).format(t)}formatKind(){switch(this.kind){case f.prescription:return p("Receta");case f.report:return p("Informe");case f.diagnosticTestPrescription:return p("Orden médica")}}get kindClass(){return(this.kind??"").replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}get metaLine(){return[this.formatDate(),this.specialty].filter(Boolean).join(" - ")}render(){return n`<div class="details"><span class="tag ${this.kindClass}">${this.formatKind()}</span><div class="text"><span class="name" title="${this.name}">${this.name}</span> <span class="meta">${this.metaLine}</span></div></div><mq-button variant="outline" size="icon-lg" aria-label="${p("Descargar documento")}" ?disabled="${this.isDownloading}" @click="${this.handleDownload}">${w({size:24})}</mq-button>`}};function $(t,e,o){return t.map(t=>{const i=e?.find(e=>Number(e.id)===Number(t.professional.speciality_id));return{documentId:t.document_id,kind:t.document_type,name:t.name,specialty:r(i?.code??"",o,i?.name??t.professional.speciality_name),date:t.created_at,downloadUrl:t.url}})}t([c({context:h,subscribe:!0})],k.prototype,"apiClient",void 0),t([l({type:String})],k.prototype,"documentId",void 0),t([l({type:String})],k.prototype,"kind",void 0),t([l({type:String})],k.prototype,"name",void 0),t([l({type:String})],k.prototype,"specialty",void 0),t([l({type:String})],k.prototype,"date",void 0),t([l({type:String})],k.prototype,"downloadUrl",void 0),t([l({type:String})],k.prototype,"patientHash",void 0),t([g()],k.prototype,"isDownloading",void 0),k=t([m(),e("document-row")],k);const j=a`:host{display:flex;flex-direction:column;gap:var(--sp-3);width:100%;min-width:0;box-sizing:border-box}.divider{height:1px;width:100%;background-color:var(--color-border-subtle,#edecf1);flex-shrink:0}`;let D=class DocumentList extends s{constructor(){super(...arguments),this.documents=[],this.patientHash="",this.placeholders=0}static{this.styles=j}get rows(){return this.placeholders>0?Array.from({length:this.placeholders},()=>n`<mq-skeleton height="${"77px"}"></mq-skeleton>`):this.documents.map(t=>n`<document-row documentId="${t.documentId}" kind="${t.kind}" name="${t.name}" specialty="${t.specialty}" date="${t.date}" downloadUrl="${t.downloadUrl}" patientHash="${this.patientHash}"></document-row>`)}render(){const t=this.rows;return t.map((e,o)=>n`${e} ${o<t.length-1?n`<div class="divider"></div>`:d}`)}};t([l({type:Array})],D.prototype,"documents",void 0),t([l({type:String})],D.prototype,"patientHash",void 0),t([l({type:Number})],D.prototype,"placeholders",void 0),D=t([e("document-list")],D);export{$ as t};
1
+ import{_ as t,c as e}from"./custom-element-D2ziPxYE.js";import{t as o,f as i,e as r}from"./telemetry-client-BdPx4SXu.js";import{i as a,a as s,x as n,E as d}from"./lit-element-DiWJYFwC.js";import{n as l}from"./property-scuRaFcM.js";import{c}from"./consume-CovVqBjI.js";import{m as p}from"./runtime-Bg1WXVCx.js";import{l as m}from"./localized-decorator-BlOuLhym.js";import{A as h}from"./api-client-context-V1UAGtKW.js";import{D as f}from"./api-chat-client-CJ1EGJe3.js";import{b as u}from"./blob-to-base64-CUL1trde.js";import{r as g}from"./state-LQivXIgA.js";import{DownloadFileEvent as y}from"../events.js";import{getLocale as v}from"../i18n.js";import{download02Icon as w}from"../ui/icons/download-02-icon.js";import"../ui/mq-button.js";import{toast as b}from"../ui/mq-toast.js";import"../ui/mq-skeleton.js";const x=a`:host{display:flex;align-items:center;gap:var(--sp-3);padding:var(--sp-1) 0;width:100%;min-width:0;box-sizing:border-box}.details{display:flex;flex-direction:column;align-items:flex-start;gap:6px;flex:1;min-width:0}.tag{display:inline-flex;align-items:center;border-radius:var(--border-radius-sm);padding:var(--sp-1) var(--sp-2);font-family:var(--font-body);font-size:var(--text-xs);line-height:1.35;font-weight:var(--font-weight-normal)}.tag.prescription{background-color:var(--color-feedback--info-subtle,#eceefd);color:var(--color-feedback--info-text,#4a1ea7)}.tag.report{background-color:var(--color-feedback--warning-subtle,#ffebce);color:var(--color-feedback--warning-text,#8f4700)}.tag.diagnostic-test-prescription{background-color:var(--color-feedback--success-subtle,#e8f6ec);color:var(--color-feedback--success-text,#16653a)}.text{display:flex;flex-direction:column;gap:var(--sp-1);width:100%;min-width:0}.name{font-family:var(--font-body);font-size:var(--text-sm);line-height:1.35;font-weight:var(--font-weight-normal);color:var(--color-text-icons--primary,#0a0a22);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.meta{font-family:var(--font-body);font-size:var(--text-xs);line-height:1.35;font-weight:var(--font-weight-normal);color:var(--color-text-icons--secondary,#6d658b);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}`;let k=class DocumentRow extends s{constructor(){super(...arguments),this.documentId="",this.name="",this.specialty="",this.date="",this.downloadUrl="",this.patientHash="",this.isDownloading=!1,this.handleDownload=async()=>{this.isDownloading=!0;try{o.track(i(this.patientHash,this.documentId));const t=await this.apiClient.flash.downloadDocument({url:this.downloadUrl}),e=await u(t);this.dispatchEvent(new y({url:e,filename:`${this.name}.pdf`}))}catch{b.error(p("No hemos podido descargar el documento."))}finally{this.isDownloading=!1}}}static{this.styles=x}formatDate(){const t=new Date(this.date);if(Number.isNaN(t.getTime()))return"";const e=v().replace("_","-");return new Intl.DateTimeFormat(e,{day:"2-digit",month:"2-digit",year:"2-digit"}).format(t)}formatKind(){switch(this.kind){case f.prescription:return p("Receta");case f.report:return p("Informe");case f.diagnosticTestPrescription:return p("Orden médica")}}get kindClass(){return(this.kind??"").replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}get metaLine(){return[this.formatDate(),this.specialty].filter(Boolean).join(" - ")}render(){return n`<div class="details"><span class="tag ${this.kindClass}">${this.formatKind()}</span><div class="text"><span class="name" title="${this.name}">${this.name}</span> <span class="meta">${this.metaLine}</span></div></div><mq-button variant="outline" size="icon-lg" aria-label="${p("Descargar documento")}" ?disabled="${this.isDownloading}" @click="${this.handleDownload}">${w({size:24})}</mq-button>`}};function $(t,e,o){return t.map(t=>{const i=e?.find(e=>Number(e.id)===Number(t.professional.speciality_id));return{documentId:t.document_id,kind:t.document_type,name:t.name,specialty:r(i?.code??"",o,i?.name??t.professional.speciality_name),date:t.created_at,downloadUrl:t.url}})}t([c({context:h,subscribe:!0})],k.prototype,"apiClient",void 0),t([l({type:String})],k.prototype,"documentId",void 0),t([l({type:String})],k.prototype,"kind",void 0),t([l({type:String})],k.prototype,"name",void 0),t([l({type:String})],k.prototype,"specialty",void 0),t([l({type:String})],k.prototype,"date",void 0),t([l({type:String})],k.prototype,"downloadUrl",void 0),t([l({type:String})],k.prototype,"patientHash",void 0),t([g()],k.prototype,"isDownloading",void 0),k=t([m(),e("document-row")],k);const j=a`:host{display:flex;flex-direction:column;gap:var(--sp-3);width:100%;min-width:0;box-sizing:border-box}.divider{height:1px;width:100%;background-color:var(--color-border-subtle,#edecf1);flex-shrink:0}`;let D=class DocumentList extends s{constructor(){super(...arguments),this.documents=[],this.patientHash="",this.placeholders=0}static{this.styles=j}get rows(){return this.placeholders>0?Array.from({length:this.placeholders},()=>n`<mq-skeleton height="${"77px"}"></mq-skeleton>`):this.documents.map(t=>n`<document-row documentId="${t.documentId}" kind="${t.kind}" name="${t.name}" specialty="${t.specialty}" date="${t.date}" downloadUrl="${t.downloadUrl}" patientHash="${this.patientHash}"></document-row>`)}render(){const t=this.rows;return t.map((e,o)=>n`${e} ${o<t.length-1?n`<div class="divider"></div>`:d}`)}};t([l({type:Array})],D.prototype,"documents",void 0),t([l({type:String})],D.prototype,"patientHash",void 0),t([l({type:Number})],D.prototype,"placeholders",void 0),D=t([e("document-list")],D);export{$ as t};
@@ -0,0 +1 @@
1
+ import{_ as e,c as t}from"./custom-element-D2ziPxYE.js";import{c as i}from"./consume-CovVqBjI.js";import{m as n,s as o}from"./runtime-Bg1WXVCx.js";import{l as a}from"./localized-decorator-BlOuLhym.js";import{Q as s}from"./query-controller-BlO1Ax65.js";import{A as r}from"./api-client-context-V1UAGtKW.js";import{l}from"./chunk-S5RWG6G2-DPesx3Od.js";import{i as c,A as p}from"./api-chat-client-CJ1EGJe3.js";import{g as m}from"./get-organization-setup-query-Dr1cXnHl.js";import{g as d,t as h,a as u,b as g,c as f,d as v,e as b}from"./telemetry-client-BdPx4SXu.js";import{g as y}from"./chunk-Y4EKUX25-QqMl3eiq.js";import{c as $}from"./refund-cancel-policy-CcsJ-pMx.js";import{i as x,a as w,E as C,x as O}from"./lit-element-DiWJYFwC.js";import{n as k}from"./property-scuRaFcM.js";import{r as j}from"./state-LQivXIgA.js";import{g as M}from"./action-unavailable-message-BIgsXk9u.js";import{MqAppointmentJoinVideocallEvent as z,MqAppointmentRescheduleEvent as q}from"../events.js";import{getLocale as I}from"../i18n.js";import{calendarIcon as R}from"../ui/icons/calendar-icon.js";import{dotsHorizontalIcon as S}from"../ui/icons/dots-horizontal-icon.js";import{messageBubbleIcon as _}from"../ui/icons/message-bubble-icon.js";import{phoneIcon as D}from"../ui/icons/phone-icon.js";import{videoIcon as E}from"../ui/icons/video-icon.js";import"../mq-chat-room.js";import"./professional-overview-C4H_znIJ.js";import"../ui/mq-button.js";import"../ui/mq-floating-bubble.js";import"../ui/mq-unread-badge.js";import{toast as T}from"../ui/mq-toast.js";const P=x`:host{display:flex;flex-direction:column;justify-content:space-between;gap:var(--sp-6);flex:1;width:100%;min-width:0;box-sizing:border-box;color:var(--color-text-icons--primary,#0a0a22)}professional-overview{--avatar-size-lg:66px;--text-lg--line-height:1.35;display:block}.details{display:flex;flex-direction:column;align-items:flex-start;gap:var(--sp-3)}.detail-row{display:inline-flex;align-items:center;gap:var(--sp-2);font-family:var(--font-body);font-size:var(--text-sm);line-height:1.35;font-weight:var(--font-weight-normal)}.detail-row svg{flex-shrink:0}.detail-row span::first-letter{text-transform:uppercase}.footer{display:flex;flex-direction:column;gap:var(--sp-4)}.reminder{font-family:var(--font-body);font-size:var(--text-sm);line-height:1.35;font-weight:var(--font-weight-normal);color:var(--color-text-icons--secondary,#6d658b);margin:0}.actions{--button-height-md:2.75rem;display:flex;align-items:stretch;gap:10px}.actions>mq-button{flex:1;min-width:0}.overflow{position:relative;flex:0 0 auto}.chat-label{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.chat-badge{--mq-unread-badge-size:8px;flex-shrink:0}@media (max-width:767px){.actions{flex-wrap:wrap}.actions>mq-button.join{order:1;flex:1 0 100%}}.menu{position:absolute;right:0;bottom:calc(100% + var(--sp-2));z-index:2;display:flex;flex-direction:column;min-width:176px;padding:var(--sp-1);background-color:var(--color-card,#fff);border:1px solid var(--color-border-subtle,#edecf1);border-radius:var(--border-radius-lg);box-shadow:var(--shadow-lg)}.menu-item{display:block;width:100%;background:0 0;border:none;border-radius:var(--border-radius-sm);padding:var(--sp-2) var(--sp-3);cursor:pointer;text-align:left;font-family:var(--font-body);font-size:var(--text-sm);line-height:1.35;color:var(--color-text-icons--primary,#0a0a22)}.menu-item:hover{background-color:var(--color-muted)}.menu-item.negative{color:var(--color-negative)}`;let U=class NextAppointmentCard extends w{constructor(){super(...arguments),this.token="",this.patientHash="",this.isChatOpen=!1,this.isMenuOpen=!1,this.isCancelDialogOpen=!1,this.openDialog=null,this.getUnreadMessagesQuery=new s(this,()=>({...y(this.apiClient,{roomId:this.appointmentResource?.room?.id}),enabled:!!this.appointmentResource?.room?.id})),this.getOrganizationSetupQuery=new s(this,()=>m(this.apiClient)),this.getOrganizationSpecialtiesQuery=new s(this,()=>d(this.apiClient,{enabled:!!this.appointmentResource?.speciality?.id})),this.closeMenuOnOutsideClick=e=>{e.composedPath().includes(this)||(this.isMenuOpen=!1)},this.closeMenuOnEscape=e=>{"Escape"===e.key&&(this.isMenuOpen=!1)},this.handleJoinVideocall=()=>{h.track(u(this.sessionPatientHash,this.appointmentId)),this.dispatchEvent(new z({appointmentId:this.appointmentId}))},this.handleToggleChat=()=>{this.isChatOpen=!this.isChatOpen,this.isChatOpen&&h.track(g(this.sessionPatientHash,this.appointmentId))},this.handleModify=()=>{this.isMenuOpen=!1,this.isModifyUnavailable?this.openDialog="modify":(h.track(f(this.sessionPatientHash,this.appointmentId)),this.dispatchEvent(new q({appointmentId:this.appointmentId})))},this.handleCancel=()=>{this.isMenuOpen=!1,this.isCancelUnavailable?this.openDialog="cancel":(h.track(v(this.sessionPatientHash,this.appointmentId)),this.isCancelDialogOpen=!0)}}static{this.styles=P}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this.closeMenuOnOutsideClick),document.addEventListener("keydown",this.closeMenuOnEscape)}disconnectedCallback(){document.removeEventListener("click",this.closeMenuOnOutsideClick),document.removeEventListener("keydown",this.closeMenuOnEscape),super.disconnectedCallback()}get appointmentId(){return this.appointmentResource.appointment.id??""}get channel(){return this.appointmentResource.appointment.channel}get sessionToken(){return this.token||this.loginToken?.access_token||""}get sessionPatientHash(){return this.patientHash||this.loginToken?.patient?.hash||""}get sessionTimezone(){return this.timezone??this.loginToken?.patient?.timezone}get unreadCount(){return this.getUnreadMessagesQuery.result?.data?.unread_count??0}get specialtyName(){const e=this.getOrganizationSpecialtiesQuery.result?.data?.find(e=>Number(e.id)===Number(this.appointmentResource.speciality?.id));return b(e?.code??"",I(),e?.name??this.appointmentResource.speciality?.name)}get hasChatSupport(){return this.appointmentResource.appointment.has_chat_in_appointment??this.getOrganizationSetupQuery.result?.data?.appointments?.has_chat_in_appointment??!1}get isExpired(){return c(this.appointmentResource.appointment.expires_at)}get refundPolicySeconds(){return this.getOrganizationSetupQuery.result?.data?.appointments?.seconds_before_start_to_refund_on_cancel}get policyAllowsModifyOrCancel(){return $({startsAtIso:this.appointmentResource.appointment.starts_at,refundPolicySeconds:this.refundPolicySeconds})}get isModifyUnavailable(){return this.isExpired||0===this.appointmentResource.slots.length||!this.policyAllowsModifyOrCancel}get isCancelUnavailable(){return this.isExpired||!this.policyAllowsModifyOrCancel}get modifyUnavailableMessage(){return M({action:"modify",refundPolicySeconds:this.refundPolicySeconds})}get cancelUnavailableMessage(){return M({action:"cancel",refundPolicySeconds:this.refundPolicySeconds})}channelIcon(){switch(this.channel){case p.videocall:return E({size:20});case p.phonecall:return D({size:20});default:return _({size:20})}}channelLabel(){switch(this.channel){case p.videocall:return n("Videoconsulta");case p.phonecall:return n("Consulta telefónica");default:return n("Chat")}}formatWhen(){const e=I().replace("_","-"),t=this.sessionTimezone?{timeZone:this.sessionTimezone}:{},i=new Date(this.appointmentResource.appointment.starts_at);if(Number.isNaN(i.getTime()))return"";const a=new Intl.DateTimeFormat(e,{weekday:"long",day:"numeric",month:"long",year:"numeric",...t}).format(i),s=new Intl.DateTimeFormat(e,{timeStyle:"short",...t}).format(i);return n(o`${a}, ${s} h`)}renderActions(){const e=this.channel===p.videocall;return O`<div class="actions">${this.hasChatSupport?O`<mq-button variant="outline" @click="${this.handleToggleChat}"><span class="chat-label">${n("Ir a chat")}</span> ${this.unreadCount>0?O`<mq-unread-badge class="chat-badge"></mq-unread-badge>`:C}</mq-button>`:C} ${e?O`<mq-button class="join" variant="primary" @click="${this.handleJoinVideocall}">${n("Unirse a la videoconsulta")}</mq-button>`:C}<div class="overflow"><mq-button variant="outline" size="icon-lg" aria-label="${n("Más opciones")}" aria-haspopup="menu" aria-expanded="${this.isMenuOpen}" @click="${()=>{this.isMenuOpen=!this.isMenuOpen}}">${S({size:16})}</mq-button>${this.isMenuOpen?O`<div class="menu" role="menu"><button class="menu-item" type="button" role="menuitem" @click="${this.handleModify}">${n("Modificar cita")}</button> <button class="menu-item negative" type="button" role="menuitem" @click="${this.handleCancel}">${n("Anular cita")}</button></div>`:C}</div></div>`}render(){const{professional:e}=this.appointmentResource,t=this.formatWhen();return O`<professional-overview .name="${e.name}" .specialtyName="${this.specialtyName}" .collegiateNumber="${e.collegiate_number??void 0}" .description="${e.description??""}" .languages="${e.languages??[]}" .avatar="${e.avatar??""}"></professional-overview><div class="details">${t?O`<div class="detail-row">${R({size:20})} <span>${t}</span></div>`:C}<div class="detail-row">${this.channelIcon()} <span>${this.channelLabel()}</span></div></div><div class="footer"><p class="reminder">${n("Recibirás un recordatorio 15 minutos antes de la consulta")}</p>${this.renderActions()}</div><mq-floating-bubble ?dismissable="${!1}" .open="${this.isChatOpen}" hideCloseButton @mq-close="${()=>{this.isChatOpen=!1}}">${this.isChatOpen?O`<mq-chat-room slot="content" .consultationId="${this.appointmentResource.appointment.id}" consultation-type="appointment" token="${this.sessionToken}" .roomId="${this.appointmentResource.room.id}" .professionalHash="${e.hash}" ?readonly="${this.isExpired}" @mq-chat-room-close="${()=>{this.isChatOpen=!1}}"></mq-chat-room>`:C}</mq-floating-bubble><appointment-action-unavailable-dialog .open="${"modify"===this.openDialog}" .heading="${n("Modificar cita")}" .message="${this.modifyUnavailableMessage}" @close="${()=>{this.openDialog=null}}"></appointment-action-unavailable-dialog><appointment-action-unavailable-dialog .open="${"cancel"===this.openDialog}" .heading="${n("Anular cita")}" .message="${this.cancelUnavailableMessage}" @close="${()=>{this.openDialog=null}}"></appointment-action-unavailable-dialog><cancel-appointment-confirmation-dialog .appointmentId="${this.appointmentResource.appointment.id}" .price="${this.appointmentResource.price??void 0}" .open="${this.isCancelDialogOpen}" @cancel="${()=>{this.isCancelDialogOpen=!1}}" @success="${()=>{this.isCancelDialogOpen=!1,T.success(n("Consulta anulada correctamente")),this.dispatchEvent(new CustomEvent("appointment-cancel-confirmed",{bubbles:!0,composed:!0,detail:{id:this.appointmentId}}))}}"></cancel-appointment-confirmation-dialog>`}};e([i({context:r,subscribe:!0})],U.prototype,"apiClient",void 0),e([i({context:l,subscribe:!0})],U.prototype,"loginToken",void 0),e([k({type:Object})],U.prototype,"appointmentResource",void 0),e([k({type:String})],U.prototype,"token",void 0),e([k({type:String})],U.prototype,"patientHash",void 0),e([k({type:String})],U.prototype,"timezone",void 0),e([j()],U.prototype,"isChatOpen",void 0),e([j()],U.prototype,"isMenuOpen",void 0),e([j()],U.prototype,"isCancelDialogOpen",void 0),e([j()],U.prototype,"openDialog",void 0),U=e([a(),t("next-appointment-card")],U);
@@ -0,0 +1,61 @@
1
+ import * as lit_html from 'lit-html';
2
+ import * as lit from 'lit';
3
+ import { LitElement } from 'lit';
4
+ import { M as MediquoApiChatClient, G as GetAppointmentsResponse } from './index.d-XSe7Hy-Q.js';
5
+ import { L as LoginTokenResponse } from './schemas.d-b6_AekBb.js';
6
+ import './mq-chat-room-jeDvIF1Z.js';
7
+ import './appointment-action-unavailable-dialog-CTiL4nMo.js';
8
+ import './professional-overview-mO3tuMuH.js';
9
+ import '../ui/mq-button.js';
10
+ import '../ui/mq-floating-bubble.js';
11
+ import '../ui/mq-unread-badge.js';
12
+
13
+ declare class NextAppointmentCard extends LitElement {
14
+ static styles: lit.CSSResult;
15
+ apiClient: MediquoApiChatClient;
16
+ loginToken?: LoginTokenResponse;
17
+ appointmentResource: GetAppointmentsResponse["data"][number];
18
+ token: string;
19
+ patientHash: string;
20
+ timezone?: string;
21
+ private isChatOpen;
22
+ private isMenuOpen;
23
+ private isCancelDialogOpen;
24
+ private openDialog;
25
+ private getUnreadMessagesQuery;
26
+ private getOrganizationSetupQuery;
27
+ private getOrganizationSpecialtiesQuery;
28
+ private closeMenuOnOutsideClick;
29
+ private closeMenuOnEscape;
30
+ connectedCallback(): void;
31
+ disconnectedCallback(): void;
32
+ private get appointmentId();
33
+ private get channel();
34
+ private get sessionToken();
35
+ private get sessionPatientHash();
36
+ private get sessionTimezone();
37
+ private get unreadCount();
38
+ private get specialtyName();
39
+ private get hasChatSupport();
40
+ private get isExpired();
41
+ private get refundPolicySeconds();
42
+ private get policyAllowsModifyOrCancel();
43
+ private get isModifyUnavailable();
44
+ private get isCancelUnavailable();
45
+ private get modifyUnavailableMessage();
46
+ private get cancelUnavailableMessage();
47
+ private channelIcon;
48
+ private channelLabel;
49
+ private formatWhen;
50
+ private handleJoinVideocall;
51
+ private handleToggleChat;
52
+ private handleModify;
53
+ private handleCancel;
54
+ private renderActions;
55
+ render(): lit_html.TemplateResult<1>;
56
+ }
57
+ declare global {
58
+ interface HTMLElementTagNameMap {
59
+ "next-appointment-card": NextAppointmentCard;
60
+ }
61
+ }
@@ -1 +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};
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,n as a,i as b,a as c,o as d,z as e,v as f,e as g,y as h,d as i,u as j,s as k,p 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.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};
1
+ const E="https://mediquo-landing.s3.eu-central-1.amazonaws.com/sdk-web/elements",o="production",e="0.9.0",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};
@@ -1 +1 @@
1
- import{isValidLocale as t,setLocale as e,initLocalization as i}from"./i18n.js";import{_ as s,c as o}from"./chunks/custom-element-D2ziPxYE.js";import{e as r}from"./chunks/provide-BwI4DDGF.js";import{c as n}from"./chunks/consume-CovVqBjI.js";import{Q as a}from"./chunks/query-controller-BlO1Ax65.js";import{A as c}from"./chunks/api-client-context-V1UAGtKW.js";import{g as p}from"./chunks/get-appointment-query-C-gTTuiQ.js";import{a as d,i as m,x as l}from"./chunks/lit-element-DiWJYFwC.js";import{n as u}from"./chunks/property-scuRaFcM.js";import{r as k}from"./chunks/state-LQivXIgA.js";import{setEnv as h}from"./env.js";import{c as v,n as j}from"./chunks/api-chat-client-CJ1EGJe3.js";import"./chunks/documentation-view-BbMbGneD.js";import"./ui/mq-card.js";import"./chunks/mq-layout-E5mKSz4A.js";import"./chunks/runtime-Bg1WXVCx.js";import"./chunks/chunk-4FFT6DC2-CVWibomC.js";import"./chunks/external-CJj32K_p.js";import"./chunks/context-request-event-Dfydf1ub.js";import"./chunks/context-consumer-ESdICVAb.js";import"./chunks/chunk-RCFIJTXZ-C6Ir0-sM.js";import"./chunks/create-context-DqP79qjF.js";import"./chunks/query-Cjvi4_dT.js";import"./chunks/chunk-6CCJWPGL-TiaqZaPV.js";import"./chunks/chunk-HN62IQ7S-xbkIy7k_.js";import"./chunks/parseISO-Dj3qSTG8.js";import"./chunks/format-CRFiCNHw.js";import"./chunks/isBefore-CPpTogxo.js";import"./chunks/localized-decorator-BlOuLhym.js";import"./chunks/task-Bj8p7kJX.js";import"./chunks/addSeconds-ofMnxlgT.js";import"./ui/icons/calendar-icon.js";import"./ui/icons/types.js";import"./ui/icons/clock-icon.js";import"./ui/icons/info-circle-outine-icon.js";import"./ui/mq-button.js";import"./chunks/class-map-Co76I6aw.js";import"./chunks/directive-2EDmOukv.js";import"./chunks/if-defined-BYeVdwgd.js";import"./chunks/chunk-S5RWG6G2-DPesx3Od.js";import"./ui/icons/message-bubble-icon.js";import"./mq-chat-room.js";import"./theme.js";import"./ui/icons/x-icon.js";import"./ui/mq-avatar.js";import"./ui/mq-skeleton.js";import"./chunks/style-map-CIdqdn7C.js";import"./chunks/chunk-BUV4MGML-CkhBbfUu.js";import"./ui/icons/chevron-left-icon.js";import"./chunks/query-CeeutdfT.js";import"./events.js";import"./chunks/chunk-Y4EKUX25-QqMl3eiq.js";import"./ui/icons/check-double-icon.js";import"./ui/icons/check-icon.js";import"./chunks/chunk-YTQUGGS3-DmCGIoFy.js";import"./chunks/mutation-controller-CR2qcqhH.js";import"./ui/mq-floating-bubble.js";import"./ui/mq-unread-badge.js";import"./ui/mq-page-title.js";import"./ui/icons/arrow-narrow-left-icon.js";import"./chunks/telemetry-client-7fvNqUSU.js";import"./ui/icons/download-icon.js";import"./chunks/blob-to-base64-CUL1trde.js";let b=class DocumentationViewSkeleton extends d{static{this.styles=m`.skeleton{border-radius:var(--border-radius-md);background-color:#f0f0f0;animation:skeleton-pulse 1.5s infinite}.page-title-skeleton{display:flex;align-items:center;gap:var(--sp-3);margin-bottom:var(--size-3)}.back-button-skeleton{width:var(--size-10);height:var(--size-10);border-radius:var(--border-radius-full);flex-shrink:0}.title-bar-skeleton{width:120px;height:24px;border-radius:var(--border-radius-sm)}@media (min-width:768px){.page-title-skeleton{gap:var(--sp-6)}.title-bar-skeleton{width:200px;height:32px}}.description-skeleton{width:100%;height:16px;border-radius:var(--border-radius-sm);margin-bottom:var(--size-2)}.description-skeleton:last-of-type{width:70%;margin-bottom:var(--size-5)}.professional-card{padding:var(--size-4);margin-bottom:var(--size-4)}.professional-name-skeleton{width:180px;height:24px;border-radius:var(--border-radius-sm);margin-bottom:var(--size-1)}.professional-speciality-skeleton{width:140px;height:16px;border-radius:var(--border-radius-sm);margin-bottom:var(--size-4)}.description-list{display:flex;flex-direction:column;gap:var(--size-4)}.description-list-item{display:flex;flex-direction:row;align-items:center;gap:var(--size-2);font-family:var(--font-body)}.icon-skeleton{width:20px;height:20px;border-radius:var(--border-radius-sm)}.text-skeleton{width:120px;height:16px;border-radius:var(--border-radius-sm)}.documents-card{padding:var(--size-4);margin-bottom:var(--size-6)}.documents-card .skeleton{background-color:var(--color-muted)}.documents-card-title-skeleton{width:150px;height:24px;border-radius:var(--border-radius-sm);margin-bottom:var(--size-4)}.button-skeleton{width:100%;height:44px;border-radius:var(--border-radius-md);margin-top:var(--size-4)}@keyframes skeleton-pulse{0%{opacity:1}50%{opacity:.6}100%{opacity:1}}`}render(){return l`<div class="page-title-skeleton"><div class="skeleton back-button-skeleton"></div><div class="skeleton title-bar-skeleton"></div></div><div class="skeleton description-skeleton"></div><div class="skeleton description-skeleton"></div><mq-card class="professional-card" roundness="md"><div><div class="skeleton professional-name-skeleton"></div><div class="skeleton professional-speciality-skeleton"></div></div><dl class="description-list"><div class="description-list-item"><div class="skeleton icon-skeleton"></div><div class="skeleton text-skeleton"></div></div><div class="description-list-item"><div class="skeleton icon-skeleton"></div><div class="skeleton text-skeleton"></div></div></dl></mq-card><mq-card class="documents-card" roundness="md"><div class="skeleton documents-card-title-skeleton"></div><div class="skeleton button-skeleton"></div></mq-card>`}};b=s([o("documentation-view-skeleton")],b);let g=class MqAppointmentDocumentation extends d{constructor(){super(...arguments),this.getAppointmentQuery=new a(this,()=>p(this.apiClient,{id:this.appointmentId})),this.apiClient=v()}willUpdate(i){i.has("env")&&this.env&&h(this.env),i.has("locale")&&this.locale&&t(this.locale)&&e(this.locale);const s=j(i,{env:this.env,apiKey:this.apiKey,token:this.token,locale:this.locale},this.inheritedApiClient);s&&(this.apiClient=s)}render(){return l`<mq-layout background="transparent">${this.getAppointmentQuery.render({complete:t=>l`<documentation-view .token="${this.token}" .appointment="${t}"></documentation-view>`,error:()=>l``,pending:()=>l`<documentation-view-skeleton></documentation-view-skeleton>`})}</mq-layout>`}};s([u({type:String,attribute:"appointment-id"})],g.prototype,"appointmentId",void 0),s([u({type:String,attribute:"token"})],g.prototype,"token",void 0),s([u({type:String,attribute:"api-key"})],g.prototype,"apiKey",void 0),s([u({type:String,attribute:"locale"})],g.prototype,"locale",void 0),s([u({type:String,attribute:"env"})],g.prototype,"env",void 0),s([n({context:c,subscribe:!0}),k()],g.prototype,"inheritedApiClient",void 0),s([r({context:c}),k()],g.prototype,"apiClient",void 0),g=s([o("mq-appointment-documentation")],g),i();export{g as MqAppointmentDocumentation};
1
+ import{isValidLocale as t,setLocale as e,initLocalization as i}from"./i18n.js";import{_ as s,c as o}from"./chunks/custom-element-D2ziPxYE.js";import{e as r}from"./chunks/provide-BwI4DDGF.js";import{c as n}from"./chunks/consume-CovVqBjI.js";import{Q as a}from"./chunks/query-controller-BlO1Ax65.js";import{A as c}from"./chunks/api-client-context-V1UAGtKW.js";import{g as p}from"./chunks/get-appointment-query-C-gTTuiQ.js";import{a as d,i as m,x as l}from"./chunks/lit-element-DiWJYFwC.js";import{n as u}from"./chunks/property-scuRaFcM.js";import{r as k}from"./chunks/state-LQivXIgA.js";import{setEnv as h}from"./env.js";import{c as v,n as j}from"./chunks/api-chat-client-CJ1EGJe3.js";import"./chunks/documentation-view-DEXxBFrV.js";import"./ui/mq-card.js";import"./chunks/mq-layout-E5mKSz4A.js";import"./chunks/runtime-Bg1WXVCx.js";import"./chunks/chunk-4FFT6DC2-CVWibomC.js";import"./chunks/external-CJj32K_p.js";import"./chunks/context-request-event-Dfydf1ub.js";import"./chunks/context-consumer-ESdICVAb.js";import"./chunks/chunk-RCFIJTXZ-C6Ir0-sM.js";import"./chunks/create-context-DqP79qjF.js";import"./chunks/query-Cjvi4_dT.js";import"./chunks/chunk-6CCJWPGL-TiaqZaPV.js";import"./chunks/chunk-HN62IQ7S-xbkIy7k_.js";import"./chunks/parseISO-Dj3qSTG8.js";import"./chunks/format-CRFiCNHw.js";import"./chunks/isBefore-CPpTogxo.js";import"./chunks/localized-decorator-BlOuLhym.js";import"./chunks/task-Bj8p7kJX.js";import"./chunks/addSeconds-ofMnxlgT.js";import"./ui/icons/calendar-icon.js";import"./chunks/if-defined-BYeVdwgd.js";import"./ui/icons/types.js";import"./ui/icons/clock-icon.js";import"./ui/icons/info-circle-outine-icon.js";import"./ui/mq-button.js";import"./chunks/class-map-Co76I6aw.js";import"./chunks/directive-2EDmOukv.js";import"./chunks/chunk-S5RWG6G2-DPesx3Od.js";import"./ui/icons/message-bubble-icon.js";import"./mq-chat-room.js";import"./theme.js";import"./ui/icons/x-icon.js";import"./ui/mq-avatar.js";import"./ui/mq-skeleton.js";import"./chunks/style-map-CIdqdn7C.js";import"./chunks/chunk-BUV4MGML-CkhBbfUu.js";import"./ui/icons/chevron-left-icon.js";import"./chunks/query-CeeutdfT.js";import"./events.js";import"./chunks/chunk-Y4EKUX25-QqMl3eiq.js";import"./ui/icons/check-double-icon.js";import"./ui/icons/check-icon.js";import"./chunks/chunk-YTQUGGS3-DmCGIoFy.js";import"./chunks/mutation-controller-CR2qcqhH.js";import"./ui/mq-floating-bubble.js";import"./ui/mq-unread-badge.js";import"./ui/mq-page-title.js";import"./ui/icons/arrow-narrow-left-icon.js";import"./chunks/telemetry-client-BdPx4SXu.js";import"./ui/icons/download-icon.js";import"./chunks/blob-to-base64-CUL1trde.js";let b=class DocumentationViewSkeleton extends d{static{this.styles=m`.skeleton{border-radius:var(--border-radius-md);background-color:#f0f0f0;animation:skeleton-pulse 1.5s infinite}.page-title-skeleton{display:flex;align-items:center;gap:var(--sp-3);margin-bottom:var(--size-3)}.back-button-skeleton{width:var(--size-10);height:var(--size-10);border-radius:var(--border-radius-full);flex-shrink:0}.title-bar-skeleton{width:120px;height:24px;border-radius:var(--border-radius-sm)}@media (min-width:768px){.page-title-skeleton{gap:var(--sp-6)}.title-bar-skeleton{width:200px;height:32px}}.description-skeleton{width:100%;height:16px;border-radius:var(--border-radius-sm);margin-bottom:var(--size-2)}.description-skeleton:last-of-type{width:70%;margin-bottom:var(--size-5)}.professional-card{padding:var(--size-4);margin-bottom:var(--size-4)}.professional-name-skeleton{width:180px;height:24px;border-radius:var(--border-radius-sm);margin-bottom:var(--size-1)}.professional-speciality-skeleton{width:140px;height:16px;border-radius:var(--border-radius-sm);margin-bottom:var(--size-4)}.description-list{display:flex;flex-direction:column;gap:var(--size-4)}.description-list-item{display:flex;flex-direction:row;align-items:center;gap:var(--size-2);font-family:var(--font-body)}.icon-skeleton{width:20px;height:20px;border-radius:var(--border-radius-sm)}.text-skeleton{width:120px;height:16px;border-radius:var(--border-radius-sm)}.documents-card{padding:var(--size-4);margin-bottom:var(--size-6)}.documents-card .skeleton{background-color:var(--color-muted)}.documents-card-title-skeleton{width:150px;height:24px;border-radius:var(--border-radius-sm);margin-bottom:var(--size-4)}.button-skeleton{width:100%;height:44px;border-radius:var(--border-radius-md);margin-top:var(--size-4)}@keyframes skeleton-pulse{0%{opacity:1}50%{opacity:.6}100%{opacity:1}}`}render(){return l`<div class="page-title-skeleton"><div class="skeleton back-button-skeleton"></div><div class="skeleton title-bar-skeleton"></div></div><div class="skeleton description-skeleton"></div><div class="skeleton description-skeleton"></div><mq-card class="professional-card" roundness="md"><div><div class="skeleton professional-name-skeleton"></div><div class="skeleton professional-speciality-skeleton"></div></div><dl class="description-list"><div class="description-list-item"><div class="skeleton icon-skeleton"></div><div class="skeleton text-skeleton"></div></div><div class="description-list-item"><div class="skeleton icon-skeleton"></div><div class="skeleton text-skeleton"></div></div></dl></mq-card><mq-card class="documents-card" roundness="md"><div class="skeleton documents-card-title-skeleton"></div><div class="skeleton button-skeleton"></div></mq-card>`}};b=s([o("documentation-view-skeleton")],b);let g=class MqAppointmentDocumentation extends d{constructor(){super(...arguments),this.getAppointmentQuery=new a(this,()=>p(this.apiClient,{id:this.appointmentId})),this.apiClient=v()}willUpdate(i){i.has("env")&&this.env&&h(this.env),i.has("locale")&&this.locale&&t(this.locale)&&e(this.locale);const s=j(i,{env:this.env,apiKey:this.apiKey,token:this.token,locale:this.locale},this.inheritedApiClient);s&&(this.apiClient=s)}render(){return l`<mq-layout background="transparent">${this.getAppointmentQuery.render({complete:t=>l`<documentation-view .token="${this.token}" .appointment="${t}"></documentation-view>`,error:()=>l``,pending:()=>l`<documentation-view-skeleton></documentation-view-skeleton>`})}</mq-layout>`}};s([u({type:String,attribute:"appointment-id"})],g.prototype,"appointmentId",void 0),s([u({type:String,attribute:"token"})],g.prototype,"token",void 0),s([u({type:String,attribute:"api-key"})],g.prototype,"apiKey",void 0),s([u({type:String,attribute:"locale"})],g.prototype,"locale",void 0),s([u({type:String,attribute:"env"})],g.prototype,"env",void 0),s([n({context:c,subscribe:!0}),k()],g.prototype,"inheritedApiClient",void 0),s([r({context:c}),k()],g.prototype,"apiClient",void 0),g=s([o("mq-appointment-documentation")],g),i();export{g as MqAppointmentDocumentation};
@@ -1 +1 @@
1
- import{getLocale as t,isValidLocale as e,setLocale as i,initLocalization as o}from"./i18n.js";import{_ as n,c as r}from"./chunks/custom-element-D2ziPxYE.js";import{e as a}from"./chunks/provide-BwI4DDGF.js";import{c as s}from"./chunks/consume-CovVqBjI.js";import{l}from"./chunks/localized-decorator-BlOuLhym.js";import{m as c}from"./chunks/runtime-Bg1WXVCx.js";import{Q as p}from"./chunks/query-controller-BlO1Ax65.js";import{A as d}from"./chunks/api-client-context-V1UAGtKW.js";import{l as h}from"./chunks/chunk-S5RWG6G2-DPesx3Od.js";import{g as m}from"./chunks/get-organization-setup-query-Dr1cXnHl.js";import{t as u,q as v,v as g,a as f,g as b,r as x,s as w}from"./chunks/telemetry-client-7fvNqUSU.js";import{i as k,a as y,E as C,x as j}from"./chunks/lit-element-DiWJYFwC.js";import{n as $}from"./chunks/property-scuRaFcM.js";import{r as q}from"./chunks/state-LQivXIgA.js";import{setEnv as z}from"./env.js";import{g as V,a as _,c as S,n as H}from"./chunks/api-chat-client-CJ1EGJe3.js";import"./chunks/mq-layout-E5mKSz4A.js";import"./ui/mq-skeleton.js";import{g as M}from"./chunks/chunk-BUV4MGML-CkhBbfUu.js";import{S as A,a as B,b as Q}from"./chunks/index-BJYWtEmT.js";import{messageSquareIcon as T}from"./ui/icons/message-square-icon.js";import"./ui/mq-avatar.js";import"./ui/mq-button.js";import{o as E}from"./chunks/style-map-CIdqdn7C.js";import{MqAppointmentBookEvent as D,MqViewAppointmentsEvent as U,MqViewDocumentsEvent as Z}from"./events.js";export{MqAppointmentJoinVideocallEvent,MqAppointmentRescheduleEvent,MqAppointmentViewDocumentationEvent}from"./events.js";import{g as I}from"./chunks/get-patient-documents-query-NC9xCa_N.js";import"./ui/mq-card.js";import{a as P}from"./chunks/action-unavailable-message-BIgsXk9u.js";import"./chunks/appointment-card-skeleton-D8gypuKh.js";import"./chunks/chunk-4FFT6DC2-CVWibomC.js";import"./chunks/external-CJj32K_p.js";import"./chunks/context-request-event-Dfydf1ub.js";import"./chunks/context-consumer-ESdICVAb.js";import"./chunks/chunk-RCFIJTXZ-C6Ir0-sM.js";import"./chunks/create-context-DqP79qjF.js";import"./chunks/query-Cjvi4_dT.js";import"./chunks/chunk-6CCJWPGL-TiaqZaPV.js";import"./chunks/chunk-HN62IQ7S-xbkIy7k_.js";import"./chunks/parseISO-Dj3qSTG8.js";import"./chunks/format-CRFiCNHw.js";import"./chunks/isBefore-CPpTogxo.js";import"./ui/icons/download-icon.js";import"./ui/icons/types.js";import"./chunks/blob-to-base64-CUL1trde.js";import"./chunks/directive-2EDmOukv.js";import"./chunks/class-map-Co76I6aw.js";import"./chunks/if-defined-BYeVdwgd.js";import"./chunks/mutation-controller-CR2qcqhH.js";import"./chunks/price-DU3YLTpk.js";import"./ui/mq-dialog.js";import"./ui/icons/x-icon.js";import"./chunks/get-schedule-services-query-Fzvb9ug9.js";import"./chunks/chunk-Y4EKUX25-QqMl3eiq.js";import"./chunks/appointment-details-DXLBQnPN.js";import"./chunks/addSeconds-ofMnxlgT.js";import"./ui/icons/briefcase-icon.js";import"./ui/icons/calendar-icon.js";import"./ui/icons/clock-icon.js";import"./ui/icons/message-bubble-icon.js";import"./ui/icons/phone-icon.js";import"./chunks/professional-overview-C4H_znIJ.js";import"./ui/icons/chevron-down-icon.js";import"./ui/mq-text-button.js";import"./mq-chat-room.js";import"./theme.js";import"./ui/icons/chevron-left-icon.js";import"./chunks/query-CeeutdfT.js";import"./ui/icons/check-double-icon.js";import"./ui/icons/check-icon.js";import"./chunks/chunk-YTQUGGS3-DmCGIoFy.js";import"./ui/mq-floating-bubble.js";import"./ui/icons/video-icon.js";import"./ui/mq-unread-badge.js";import"./chunks/refund-cancel-policy-CcsJ-pMx.js";import"./ui/mq-toast.js";const G=k`*{box-sizing:border-box}:host{display:block;--color-text-icons--success:#34c759}@keyframes banner-reveal{from{grid-template-rows:0fr}to{grid-template-rows:1fr}}.reveal{display:grid;grid-template-rows:1fr;animation:banner-reveal .4s cubic-bezier(.22,1,.36,1)}@media (prefers-reduced-motion:reduce){.reveal{animation:none}}.clip{min-height:0;overflow:hidden}.banner{position:relative;display:flex;align-items:center;gap:var(--sp-3);width:100%;padding:var(--sp-2) var(--sp-3);background:linear-gradient(105.4deg,color-mix(in srgb,var(--color-primary) 35%,#000) 0,var(--color-primary-dark,color-mix(in srgb,var(--color-primary) 70%,#000)) 30%,var(--color-primary) 65%,color-mix(in srgb,var(--color-primary) 70%,#fff) 100%);font-family:var(--font-body)}.avatar{position:relative;flex-shrink:0;width:var(--size-10);height:var(--size-10);--avatar-size:var(--size-10)}.avatar mq-avatar{width:var(--size-10);height:var(--size-10)}.online-dot{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%) translate(calc(var(--avatar-size) * .35355),calc(var(--avatar-size) * -.35355));width:var(--size-2_5);height:var(--size-2_5);border-radius:var(--border-radius-full);background-color:var(--color-gray-medium);border:2px solid var(--color-white)}.online-dot[data-presence=online]{background-color:var(--color-text-icons--success)}.online-dot[data-presence=absent]{background-color:var(--color-negative)}.mobile-info{display:flex;flex-direction:column;gap:var(--sp-1);min-width:0;flex:1}.mobile-title{margin:0;font-size:var(--text-xs);font-weight:var(--font-weight-semibold);line-height:normal;color:var(--color-white);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mobile-title .mobile-role{color:#9b90ae}.mobile-welcome{margin:0;font-size:var(--text-xs);font-weight:var(--font-weight-normal);line-height:normal;color:var(--color-white);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cta-overlay{position:absolute;inset:0;width:100%;height:100%;margin:0;padding:0;border:none;background:0 0;cursor:pointer;font:inherit;color:inherit;z-index:1}.cta-overlay:focus-visible{outline:2px solid var(--color-white);outline-offset:-3px}.cta-mobile{flex-shrink:0;display:inline-grid;place-items:center;width:var(--size-7);height:var(--size-7);color:var(--color-white)}.identity{display:none;flex-direction:column;gap:var(--sp-0_5);flex-shrink:0;min-width:0;max-width:180px}.role{margin:0;font-size:var(--text-xxs);line-height:14px;font-weight:var(--font-weight-bold);letter-spacing:.5px;text-transform:uppercase;color:#9b90ae;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.name{margin:0;font-size:15px;line-height:21px;font-weight:var(--font-weight-bold);color:var(--color-white);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.divider{display:none;flex-shrink:0;width:1px;height:var(--size-8);background-color:#9b90ae}.welcome{display:none;flex:1;min-width:0;margin:0;font-size:var(--text-sm);line-height:19.5px;color:var(--color-white);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cta-desktop{display:none;flex-shrink:0}.icon-wrap{position:relative;display:inline-grid;place-items:center}.unread-dot{position:absolute;top:-1px;right:-1px;width:6px;height:6px;border-radius:var(--border-radius-full);background-color:var(--color-negative)}@media (min-width:768px){.banner{gap:var(--sp-5);padding:var(--sp-4) var(--sp-10)}.avatar,.avatar mq-avatar{width:var(--size-12);height:var(--size-12)}.avatar{--avatar-size:var(--size-12)}.cta-mobile,.cta-overlay,.mobile-info{display:none}.identity{display:flex}.divider{display:block}.welcome{display:block}.cta-desktop{display:inline-block}}`;let L=class SupportChatBanner extends y{constructor(){super(...arguments),this._unreadCount=0,this._professionalQuery=new p(this,()=>M(this.apiClient,{hash:this.professionalHash??""},{enabled:Boolean(this.professionalHash)})),this._onUnreadChange=t=>{this._unreadCount=t.count??0}}static{this.styles=G}connectedCallback(){super.connectedCallback(),window.addEventListener(A.eventName,this._onUnreadChange),window.dispatchEvent(new B)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener(A.eventName,this._onUnreadChange)}get _hasUnread(){return this._unreadCount>0}_toggleSupportChat(){window.dispatchEvent(new Q)}_ctaIcon(t=16){return j`<span class="icon-wrap">${T({size:t,color:"currentColor"})} ${this._hasUnread?j`<span class="unread-dot"></span>`:C}</span>`}render(){return this.professionalHash?this._professionalQuery.render({pending:()=>j``,error:()=>j``,complete:t=>{const e=t.title??c("Asesor comercial"),i=V(t);return j`<div class="reveal"><div class="clip"><div class="banner"><button class="cta-overlay" type="button" aria-label="${c("Iniciar chat con asesor comercial")}" @click="${this._toggleSupportChat}"></button> <span class="avatar"><mq-avatar .src="${t.avatar??void 0}" .fallback="${t.name}" .alt="${t.name}"></mq-avatar><span class="online-dot" data-presence="${i}"></span> </span><span class="mobile-info"><p class="mobile-title">${t.title?j`<span class="mobile-role">${t.title}</span> - ${t.name}`:t.name}</p><p class="mobile-welcome">${c("¿Cómo puedo ayudarte?")}</p></span><span class="cta-mobile" aria-hidden="true">${this._ctaIcon(28)} </span><span class="identity"><p class="role">${e}</p><p class="name">${t.name}</p></span><span class="divider" aria-hidden="true"></span><p class="welcome">${c("¿Cómo puedo ayudarte?")}</p><mq-button class="cta-desktop" variant="outline-inverted" size="md" @click="${this._toggleSupportChat}">${c("Chatea conmigo")} ${this._ctaIcon()}</mq-button></div></div></div>`}}):C}};n([s({context:d,subscribe:!0})],L.prototype,"apiClient",void 0),n([$({type:String,attribute:"professional-hash"})],L.prototype,"professionalHash",void 0),n([q()],L.prototype,"_unreadCount",void 0),L=n([l(),r("support-chat-banner")],L);const N=k`:host{padding:var(--size-6) var(--size-4);border-radius:var(--border-radius-md);background-color:var(--color-top-banner-background,transparent);display:block}.banner-inner{display:grid;grid-template-columns:1fr;gap:var(--sp-3);align-items:stretch}.banner-inner:not(.single-column) .top-banner-image{order:-1}.banner-inner.single-column{grid-template-columns:1fr}.top-banner-info{margin:0;text-align:left;display:flex;flex-direction:column;gap:var(--size-4)}.top-banner-info h3{font-family:var(--font-titles);font-size:var(--text-lg);line-height:var(--text-lg--line-height);font-weight:var(--font-weight-bold);color:var(--color-neutrals-text-default);margin:0;margin-bottom:var(--size-2)}.top-banner-info p{font-family:var(--font-body);font-size:var(--text-sm);line-height:var(--text-sm--line-height);font-weight:var(--font-weight-normal);color:var(--color-neutrals-text-default);margin:0}.top-banner-actions{display:flex;flex-direction:column;gap:var(--size-2)}.top-banner-image{background-size:cover;background-position:center;background-repeat:no-repeat;border-radius:8px;min-width:151px;min-height:11rem;position:relative}@media (min-width:768px){:host{padding:var(--sp-6)}.banner-inner{gap:var(--sp-8)}.banner-inner:not(.single-column){grid-template-columns:1fr 1fr}.banner-inner:not(.single-column) .top-banner-image{order:0}.top-banner-image{border-radius:4px;min-height:0}.top-banner-info h3{font-size:var(--text-xl);line-height:var(--text-xl--line-height)}.top-banner-info p{font-size:var(--text-base);line-height:var(--text-base--line-height)}}@media (min-width:1024px){.top-banner-info{width:100%;max-width:364px;margin-left:auto;margin-right:auto}.top-banner-info h3{font-size:var(--text-2xl);line-height:var(--text-2xl--line-height)}}`;let R=class TopBanner extends y{static{this.styles=N}_handleBook(){u.track(v(this.loginToken.patient.hash)),this.dispatchEvent(new D)}_handleViewAppointments(){u.track(g(this.loginToken.patient.hash)),this.dispatchEvent(new U({tab:"next"}))}render(){const t=this.orgSetup.home.title||c("Cita con un especialista en menos de 72 horas"),e=this.orgSetup.home.description||c("Traumatología, ginecología, endocrinología, digestivo o psiquiatría"),i=this.orgSetup.home.image_url;return j`<div class="banner-inner ${i?"":"single-column"}"><div class="top-banner-info"><div>${t?j`<h3>${t}</h3>`:C} ${e?j`<p>${e}</p>`:C}</div><div class="top-banner-actions"><mq-button variant="primary" fullwidth @click="${this._handleBook}">${c("Pedir cita")}</mq-button><mq-button variant="outline" fullwidth @click="${this._handleViewAppointments}">${c("Ver todas mis citas")}</mq-button></div></div>${i?j`<div class="top-banner-image" style="${E({background:`linear-gradient(180deg, rgba(0, 0, 0, 0) 68.17%, rgba(0, 0, 0, 0.2) 100%), url('${i}') lightgray 50% / cover no-repeat`})}"></div>`:C}</div>`}};n([s({context:h})],R.prototype,"loginToken",void 0),n([$({attribute:!1})],R.prototype,"orgSetup",void 0),R=n([l(),r("top-banner")],R);const K=k`:host{border-radius:var(--border-radius-md);box-sizing:border-box;width:100%;display:flex;flex-direction:column;gap:var(--sp-4);padding:var(--sp-6);background-color:var(--color-card);border:1px solid var(--color-border);box-shadow:var(--shadow-sm);margin:0 auto}svg{flex-shrink:0;width:25px;height:auto}.title{font-family:var(--font-titles);font-size:var(--text-lg);line-height:var(--text-base--line-height);font-weight:var(--font-weight-bold);color:var(--color-neutrals-text-default);margin:0}.description{font-family:var(--font-body);font-size:var(--text-xs);line-height:var(--text-xs--line-height);font-weight:var(--font-weight-normal);color:var(--color-neutrals-text-default);margin:0}.content{display:flex;flex-direction:column;gap:var(--sp-4)}@media (min-width:768px){:host{align-items:start;flex-direction:row;gap:var(--sp-6)}svg{width:32px;height:auto}.description{font-size:var(--text-base);line-height:var(--text-base--line-height)}}`;let F=class HomeEmptyState extends y{constructor(){super(...arguments),this.title="",this.description="",this.icon="document"}static{this.styles=K}render(){return j`${"document"===this.icon?function({color:t="currentColor"}){return j`<svg width="32" height="40" viewBox="0 0 32 40" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M24 18H8V16H24V18ZM24 23H8V25H24V23ZM24 30H8V32H24V30ZM32 39V10C32 9.86867 31.9742 9.73862 31.9239 9.61728C31.8737 9.49594 31.8001 9.38568 31.7072 9.2928L22.7064 0.2952C22.5672 0.15435 22.3889 0.0585355 22.1947 0.0201668C22.0004 -0.018202 21.7991 0.00264228 21.6168 0.08C21.4342 0.155546 21.278 0.283605 21.1682 0.447954C21.0584 0.612303 20.9999 0.805545 21 1.0032V10C20.9999 10.1314 21.0257 10.2614 21.0759 10.3828C21.1261 10.5042 21.1998 10.6145 21.2927 10.7073C21.3855 10.8002 21.4958 10.8739 21.6172 10.9241C21.7386 10.9743 21.8686 11.0001 22 11H30V38H2V2H19V0H1C0.734784 0 0.480429 0.105357 0.292893 0.292893C0.105357 0.48043 0 0.734784 0 1V39C-4.20445e-08 39.1314 0.0258922 39.2615 0.0761969 39.3829C0.126502 39.5042 0.200233 39.6145 0.293176 39.7074C0.386119 39.8003 0.496453 39.8739 0.617871 39.9241C0.739289 39.9743 0.869411 40.0001 1.0008 40H31.0008C31.2659 39.9998 31.52 39.8943 31.7074 39.7068C31.8948 39.5193 32 39.2651 32 39ZM23 3.416L28.5856 9.0016H23V3.416Z" fill="${t}"/></svg>`}({color:"var(--color-primary)"}):function({color:t="currentColor"}){return j`<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M20 20.9512C22.2362 20.9487 24.38 20.057 25.9612 18.4717C27.5424 16.8864 28.4319 14.7371 28.4344 12.4952V8.45605C28.4344 6.21336 27.5458 4.06254 25.964 2.47672C24.3823 0.890903 22.2369 0 20 0C17.7631 0 15.6177 0.890903 14.036 2.47672C12.4542 4.06254 11.5656 6.21336 11.5656 8.45605V12.4952C11.5681 14.7371 12.4576 16.8864 14.0388 18.4717C15.62 20.057 17.7638 20.9487 20 20.9512ZM13.5656 8.45605C13.5656 6.74516 14.2435 5.10434 15.4502 3.89456C16.6569 2.68478 18.2935 2.00513 20 2.00513C21.7065 2.00513 23.3431 2.68478 24.5498 3.89456C25.7565 5.10434 26.4344 6.74516 26.4344 8.45605V12.4952C26.4344 14.2061 25.7565 15.8469 24.5498 17.0567C23.3431 18.2665 21.7065 18.9461 20 18.9461C18.2935 18.9461 16.6569 18.2665 15.4502 17.0567C14.2435 15.8469 13.5656 14.2061 13.5656 12.4952V8.45605ZM36.24 24.1386C33.9712 21.9859 30.8304 20.5414 27.156 19.9607C26.9367 19.9252 26.7119 19.964 26.517 20.0709C26.3222 20.1778 26.1684 20.3467 26.08 20.551C25.1576 22.6748 22.86 24.9623 20 24.9623C17.14 24.9623 14.8392 22.6756 13.92 20.551C13.8316 20.3474 13.6783 20.179 13.4842 20.0721C13.29 19.9653 13.066 19.9261 12.8472 19.9607C9.1696 20.5414 6.0288 21.9859 3.76 24.1386C1.3 26.4718 0 29.53 0 32.982V40H2V32.982C2 30.0946 3.084 27.5401 5.1344 25.5951C6.484 24.3118 8.2088 23.3197 10.2112 22.6524V29.0231H9.2272C8.42757 29.024 7.66093 29.3428 7.0955 29.9097C6.53008 30.4765 6.21205 31.2452 6.2112 32.0468V36.7974C6.21162 37.2613 6.39556 37.7061 6.72266 38.0341C7.04976 38.3622 7.49331 38.5468 7.956 38.5475H8.996V36.5424H8.2072V32.0468C8.20762 31.7768 8.3148 31.518 8.50525 31.327C8.69569 31.1361 8.95387 31.0287 9.2232 31.0282H13.2C13.467 31.0287 13.7229 31.1352 13.9117 31.3245C14.1005 31.5137 14.2068 31.7703 14.2072 32.038V36.5424H13V38.5475H14.484C14.9418 38.5471 15.3808 38.3646 15.7046 38.0401C16.0284 37.7156 16.2106 37.2756 16.2112 36.8167V32.038C16.2104 31.2387 15.8933 30.4723 15.3295 29.9071C14.7657 29.3419 14.0013 29.024 13.204 29.0231H12.2112V22.1166C12.2848 22.1006 12.3576 22.0837 12.432 22.0693C13.1066 23.3192 14.0396 24.4103 15.1688 25.2695C16.64 26.3795 18.3096 26.9666 20 26.9666C21.6904 26.9666 23.36 26.3795 24.8312 25.2695C25.6704 24.6323 26.4026 23.8647 27 22.9957V32.9636C26.3723 33.2245 25.8562 33.6985 25.5421 34.3025C25.2279 34.9066 25.1358 35.6022 25.2817 36.2675C25.4277 36.9329 25.8025 37.5255 26.3405 37.9416C26.8784 38.3578 27.5453 38.5709 28.2242 38.5437C28.9032 38.5164 29.5509 38.2506 30.054 37.7927C30.5571 37.3348 30.8835 36.7141 30.976 36.0392C31.0685 35.3643 30.9212 34.6783 30.5599 34.1013C30.1987 33.5243 29.6465 33.0932 29 32.8834V22.4118C31.3392 23.0679 33.3416 24.149 34.8656 25.5951C36.916 27.5393 38 30.0946 38 32.982V40H40V32.982C40 29.53 38.7 26.4718 36.24 24.1386ZM28.1056 36.5424C27.9287 36.5424 27.7558 36.4898 27.6087 36.3912C27.4616 36.2927 27.347 36.1527 27.2793 35.9888C27.2116 35.825 27.1939 35.6447 27.2284 35.4707C27.2629 35.2968 27.3481 35.137 27.4732 35.0116C27.5982 34.8862 27.7576 34.8008 27.9311 34.7662C28.1046 34.7316 28.2844 34.7493 28.4479 34.8172C28.6113 34.8851 28.751 35 28.8493 35.1475C28.9475 35.2949 29 35.4683 29 35.6457C28.9998 35.8834 28.9055 36.1114 28.7378 36.2795C28.5701 36.4476 28.3427 36.5421 28.1056 36.5424Z" fill="${t}"/></svg>`}({color:"var(--color-primary)"})}<div class="content"><p class="title">${this.title}</p><p class="description">${this.description}</p></div>`}};n([$({type:String})],F.prototype,"title",void 0),n([$({type:String})],F.prototype,"description",void 0),n([$({type:String})],F.prototype,"icon",void 0),F=n([l(),r("home-empty-state")],F);const J=k`:host{display:block;max-width:var(--content-max-width);margin:0 auto}.title{font-family:var(--font-titles);font-size:var(--text-2xl);line-height:var(--text-2xl--line-height);font-weight:var(--font-weight-bold);color:var(--color-neutrals-text-default);margin:0;margin-bottom:var(--sp-4)}.container{padding:var(--sp-6) var(--sp-4)}.documents-list{border-radius:var(--border-radius-md);padding:var(--sp-3);background-color:var(--color-muted);display:flex;flex-direction:column;gap:var(--sp-3);margin-bottom:var(--sp-6)}hr{width:100%;border:none;border-top:1px solid #e5e5e5;margin:0}.button-container{max-width:332px;margin:0 auto}`;let O=class RecentDocuments extends y{constructor(){super(...arguments),this.getPatientDocumentsQuery=new p(this,()=>I(this.apiClient,{patient_hash:this.loginToken.patient.hash,page:1,per_page:2})),this.getOrganizationSpecialtiesQuery=new p(this,()=>f(this.apiClient))}static{this.styles=J}renderDocuments(){return this.getPatientDocumentsQuery.render({complete:e=>{const i=t();return 0===e.data.length?j`<home-empty-state icon="document" title="${c("No tienes documentación")}" description="${c("Aquí se mostrarán tus recetas e informes médicos. Consulta a tu profesional de salud para recibir documentación.")}"></home-empty-state>`:j`<mq-card class="container" roundness="md"><div class="documents-list">${e.data.map((t,o)=>{const n=this.getOrganizationSpecialtiesQuery.result?.data?.find(e=>e.id===t.professional.speciality_id),r=b(n?.code??"",i,n?.name);return j`<patient-document filename="${t.name}" kind="${t.document_type}" specialty="${r}" description="${t.name}" date="${t.created_at}" downloadUrl="${t.url}"></patient-document>${o<e.data.length-1?j`<hr>`:C}`})}</div><div class="button-container"><mq-button variant="primary" size="md" fullwidth @click="${()=>{u.track(x(this.loginToken.patient.hash)),this.dispatchEvent(new Z)}}">${c("Ver toda la documentación")}</mq-button></div></mq-card>`},pending:()=>j`<mq-card class="container" roundness="md"><div class="documents-list"><mq-skeleton height="57px"></mq-skeleton><hr><mq-skeleton height="57px"></mq-skeleton></div></mq-card>`})}render(){return j`<h2 class="title">${c("Documentación más reciente")}</h2>${this.renderDocuments()}`}};n([s({context:d,subscribe:!0})],O.prototype,"apiClient",void 0),n([s({context:h})],O.prototype,"loginToken",void 0),O=n([l(),r("recent-documents")],O);const W=[_.pending,_.accepted],X=k`:host{display:block}.title{font-family:var(--font-titles);font-size:var(--text-2xl);line-height:var(--text-2xl--line-height);font-weight:var(--font-weight-bold);color:var(--color-neutrals-text-default);margin:0;margin-bottom:var(--sp-4)}.container{background-color:var(--color-neutrals-background-weak);padding:var(--sp-6) var(--sp-4)}.appointment-card{margin-bottom:var(--sp-6)}`;let Y=class NextAppointments extends y{constructor(){super(...arguments),this.getAppointmentsQuery=new p(this,()=>P(this.apiClient,{status:W,order:{field:"starts_at",direction:"asc"},page:1,per_page:1}))}static{this.styles=X}renderAppointment(){return this.getAppointmentsQuery.render({complete:t=>{const e=t.data?.[0];return e?j`<div class="appointment-card"><appointment-card .appointmentResource="${e}" .specialtyId="${e.speciality?.id}" variant="next" detailsVariant="default"></appointment-card></div>`:j`<home-empty-state icon="doctor" title="${c("No tienes próximas citas")}" description="${c("Cuando agendes una cita, aparecerá aquí para que puedas consultarla, modificarla o cancelarla.")}"></home-empty-state>`},pending:()=>j`<div class="appointment-card"><appointment-card-skeleton></appointment-card-skeleton></div>`})}render(){return j`<h2 class="title">${c("Próxima cita")}</h2>${this.renderAppointment()}`}};n([s({context:d,subscribe:!0})],Y.prototype,"apiClient",void 0),Y=n([l(),r("next-appointments")],Y);const tt=k`:host{display:flex;flex-direction:column;height:100%}.support-banner{display:block;flex-shrink:0;margin-bottom:var(--sp-4)}mq-layout{flex:1 1 auto;min-height:0}.banner-area{margin-top:calc(-1 * var(--sp-4));margin-left:calc(-1 * var(--sp-4));margin-right:calc(-1 * var(--sp-4))}.content{display:flex;flex-direction:column;padding-top:var(--sp-6);gap:var(--sp-6)}next-appointments{width:100%}recent-documents{width:100%}@media (min-width:768px){.banner-area{margin:0 auto}.content{flex-direction:row}next-appointments{width:50%}recent-documents{width:50%}}`;let et=class MqDashboard extends y{constructor(){super(...arguments),this.showMediquoBranding=!0,this._trackedPageView=!1,this.orgSetupQuery=new p(this,()=>m(this.apiClient)),this.apiClient=S()}static{this.styles=tt}willUpdate(t){t.has("env")&&this.env&&z(this.env),t.has("locale")&&this.locale&&e(this.locale)&&i(this.locale);const o=H(t,{env:this.env,apiKey:this.apiKey,token:this.token,locale:this.locale},this.inheritedApiClient);o&&(this.apiClient=o)}updated(){!this._trackedPageView&&this.loginToken?.patient.hash&&(this._trackedPageView=!0,u.track(w(this.loginToken.patient.hash)))}render(){return j`${this.orgSetupQuery.render({pending:()=>j``,complete:t=>t.support_professional?.hash?j`<support-chat-banner class="support-banner" professional-hash="${t.support_professional.hash}"></support-chat-banner>`:j``})}<mq-layout background="transparent" variant="wide" .showMediquoBranding="${this.showMediquoBranding}">${this.orgSetupQuery.render({pending:()=>j`<mq-skeleton class="banner-area" width="100%" height="296px" border-radius="none"></mq-skeleton>`,complete:t=>j`<top-banner class="banner-area" .orgSetup="${t}"></top-banner>`})}<div class="content"><next-appointments></next-appointments><recent-documents></recent-documents></div></mq-layout>`}};n([$({type:String,attribute:"api-key"})],et.prototype,"apiKey",void 0),n([$({type:String,attribute:"token"})],et.prototype,"token",void 0),n([$({type:String,attribute:"locale"})],et.prototype,"locale",void 0),n([$({type:String,attribute:"env"})],et.prototype,"env",void 0),n([$({type:Boolean,attribute:"show-mediquo-branding"})],et.prototype,"showMediquoBranding",void 0),n([s({context:h})],et.prototype,"loginToken",void 0),n([s({context:d,subscribe:!0}),q()],et.prototype,"inheritedApiClient",void 0),n([a({context:d}),q()],et.prototype,"apiClient",void 0),et=n([l(),r("mq-dashboard")],et),o();export{D as MqAppointmentBookEvent,et as MqDashboard,U as MqViewAppointmentsEvent,Z as MqViewDocumentsEvent};
1
+ import{getLocale as t,isValidLocale as e,setLocale as i,initLocalization as o}from"./i18n.js";import{_ as n,c as r}from"./chunks/custom-element-D2ziPxYE.js";import{e as a}from"./chunks/provide-BwI4DDGF.js";import{c as s}from"./chunks/consume-CovVqBjI.js";import{l}from"./chunks/localized-decorator-BlOuLhym.js";import{m as c}from"./chunks/runtime-Bg1WXVCx.js";import{Q as p}from"./chunks/query-controller-BlO1Ax65.js";import{A as d}from"./chunks/api-client-context-V1UAGtKW.js";import{l as h}from"./chunks/chunk-S5RWG6G2-DPesx3Od.js";import{g as m}from"./chunks/get-organization-setup-query-Dr1cXnHl.js";import{t as u,q as v,v as g,g as f,e as b,r as x,s as w}from"./chunks/telemetry-client-BdPx4SXu.js";import{i as k,a as y,E as C,x as j}from"./chunks/lit-element-DiWJYFwC.js";import{n as $}from"./chunks/property-scuRaFcM.js";import{r as q}from"./chunks/state-LQivXIgA.js";import{setEnv as z}from"./env.js";import{g as V,a as _,c as S,n as H}from"./chunks/api-chat-client-CJ1EGJe3.js";import"./chunks/mq-layout-E5mKSz4A.js";import"./ui/mq-skeleton.js";import{g as M}from"./chunks/chunk-BUV4MGML-CkhBbfUu.js";import{S as A,a as B,b as Q}from"./chunks/index-BJYWtEmT.js";import{messageSquareIcon as T}from"./ui/icons/message-square-icon.js";import"./ui/mq-avatar.js";import"./ui/mq-button.js";import{o as E}from"./chunks/style-map-CIdqdn7C.js";import{MqAppointmentBookEvent as D,MqViewAppointmentsEvent as U,MqViewDocumentsEvent as Z}from"./events.js";export{MqAppointmentJoinVideocallEvent,MqAppointmentRescheduleEvent,MqAppointmentViewDocumentationEvent}from"./events.js";import{g as I}from"./chunks/get-patient-documents-query-NC9xCa_N.js";import"./ui/mq-card.js";import{a as P}from"./chunks/action-unavailable-message-BIgsXk9u.js";import"./chunks/appointment-card-skeleton-B_rJNvU9.js";import"./chunks/chunk-4FFT6DC2-CVWibomC.js";import"./chunks/external-CJj32K_p.js";import"./chunks/context-request-event-Dfydf1ub.js";import"./chunks/context-consumer-ESdICVAb.js";import"./chunks/chunk-RCFIJTXZ-C6Ir0-sM.js";import"./chunks/create-context-DqP79qjF.js";import"./chunks/query-Cjvi4_dT.js";import"./chunks/chunk-6CCJWPGL-TiaqZaPV.js";import"./chunks/chunk-HN62IQ7S-xbkIy7k_.js";import"./chunks/parseISO-Dj3qSTG8.js";import"./chunks/format-CRFiCNHw.js";import"./chunks/isBefore-CPpTogxo.js";import"./ui/icons/download-icon.js";import"./chunks/if-defined-BYeVdwgd.js";import"./ui/icons/types.js";import"./chunks/blob-to-base64-CUL1trde.js";import"./chunks/directive-2EDmOukv.js";import"./chunks/class-map-Co76I6aw.js";import"./chunks/mutation-controller-CR2qcqhH.js";import"./chunks/price-DU3YLTpk.js";import"./ui/mq-dialog.js";import"./ui/icons/x-icon.js";import"./chunks/get-schedule-services-query-Fzvb9ug9.js";import"./chunks/chunk-Y4EKUX25-QqMl3eiq.js";import"./chunks/appointment-details-DXLBQnPN.js";import"./chunks/addSeconds-ofMnxlgT.js";import"./ui/icons/briefcase-icon.js";import"./ui/icons/calendar-icon.js";import"./ui/icons/clock-icon.js";import"./ui/icons/message-bubble-icon.js";import"./ui/icons/phone-icon.js";import"./chunks/professional-overview-C4H_znIJ.js";import"./ui/icons/chevron-down-icon.js";import"./ui/mq-text-button.js";import"./mq-chat-room.js";import"./theme.js";import"./ui/icons/chevron-left-icon.js";import"./chunks/query-CeeutdfT.js";import"./ui/icons/check-double-icon.js";import"./ui/icons/check-icon.js";import"./chunks/chunk-YTQUGGS3-DmCGIoFy.js";import"./ui/mq-floating-bubble.js";import"./ui/icons/video-icon.js";import"./ui/mq-unread-badge.js";import"./chunks/refund-cancel-policy-CcsJ-pMx.js";import"./ui/mq-toast.js";const G=k`*{box-sizing:border-box}:host{display:block;--color-text-icons--success:#34c759}@keyframes banner-reveal{from{grid-template-rows:0fr}to{grid-template-rows:1fr}}.reveal{display:grid;grid-template-rows:1fr;animation:banner-reveal .4s cubic-bezier(.22,1,.36,1)}@media (prefers-reduced-motion:reduce){.reveal{animation:none}}.clip{min-height:0;overflow:hidden}.banner{position:relative;display:flex;align-items:center;gap:var(--sp-3);width:100%;padding:var(--sp-2) var(--sp-3);background:linear-gradient(105.4deg,color-mix(in srgb,var(--color-primary) 35%,#000) 0,var(--color-primary-dark,color-mix(in srgb,var(--color-primary) 70%,#000)) 30%,var(--color-primary) 65%,color-mix(in srgb,var(--color-primary) 70%,#fff) 100%);font-family:var(--font-body)}.avatar{position:relative;flex-shrink:0;width:var(--size-10);height:var(--size-10);--avatar-size:var(--size-10)}.avatar mq-avatar{width:var(--size-10);height:var(--size-10)}.online-dot{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%) translate(calc(var(--avatar-size) * .35355),calc(var(--avatar-size) * -.35355));width:var(--size-2_5);height:var(--size-2_5);border-radius:var(--border-radius-full);background-color:var(--color-gray-medium);border:2px solid var(--color-white)}.online-dot[data-presence=online]{background-color:var(--color-text-icons--success)}.online-dot[data-presence=absent]{background-color:var(--color-negative)}.mobile-info{display:flex;flex-direction:column;gap:var(--sp-1);min-width:0;flex:1}.mobile-title{margin:0;font-size:var(--text-xs);font-weight:var(--font-weight-semibold);line-height:normal;color:var(--color-white);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mobile-title .mobile-role{color:#9b90ae}.mobile-welcome{margin:0;font-size:var(--text-xs);font-weight:var(--font-weight-normal);line-height:normal;color:var(--color-white);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cta-overlay{position:absolute;inset:0;width:100%;height:100%;margin:0;padding:0;border:none;background:0 0;cursor:pointer;font:inherit;color:inherit;z-index:1}.cta-overlay:focus-visible{outline:2px solid var(--color-white);outline-offset:-3px}.cta-mobile{flex-shrink:0;display:inline-grid;place-items:center;width:var(--size-7);height:var(--size-7);color:var(--color-white)}.identity{display:none;flex-direction:column;gap:var(--sp-0_5);flex-shrink:0;min-width:0;max-width:180px}.role{margin:0;font-size:var(--text-xxs);line-height:14px;font-weight:var(--font-weight-bold);letter-spacing:.5px;text-transform:uppercase;color:#9b90ae;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.name{margin:0;font-size:15px;line-height:21px;font-weight:var(--font-weight-bold);color:var(--color-white);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.divider{display:none;flex-shrink:0;width:1px;height:var(--size-8);background-color:#9b90ae}.welcome{display:none;flex:1;min-width:0;margin:0;font-size:var(--text-sm);line-height:19.5px;color:var(--color-white);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cta-desktop{display:none;flex-shrink:0}.icon-wrap{position:relative;display:inline-grid;place-items:center}.unread-dot{position:absolute;top:-1px;right:-1px;width:6px;height:6px;border-radius:var(--border-radius-full);background-color:var(--color-negative)}@media (min-width:768px){.banner{gap:var(--sp-5);padding:var(--sp-4) var(--sp-10)}.avatar,.avatar mq-avatar{width:var(--size-12);height:var(--size-12)}.avatar{--avatar-size:var(--size-12)}.cta-mobile,.cta-overlay,.mobile-info{display:none}.identity{display:flex}.divider{display:block}.welcome{display:block}.cta-desktop{display:inline-block}}`;let L=class SupportChatBanner extends y{constructor(){super(...arguments),this._unreadCount=0,this._professionalQuery=new p(this,()=>M(this.apiClient,{hash:this.professionalHash??""},{enabled:Boolean(this.professionalHash)})),this._onUnreadChange=t=>{this._unreadCount=t.count??0}}static{this.styles=G}connectedCallback(){super.connectedCallback(),window.addEventListener(A.eventName,this._onUnreadChange),window.dispatchEvent(new B)}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener(A.eventName,this._onUnreadChange)}get _hasUnread(){return this._unreadCount>0}_toggleSupportChat(){window.dispatchEvent(new Q)}_ctaIcon(t=16){return j`<span class="icon-wrap">${T({size:t,color:"currentColor"})} ${this._hasUnread?j`<span class="unread-dot"></span>`:C}</span>`}render(){return this.professionalHash?this._professionalQuery.render({pending:()=>j``,error:()=>j``,complete:t=>{const e=t.title??c("Asesor comercial"),i=V(t);return j`<div class="reveal"><div class="clip"><div class="banner"><button class="cta-overlay" type="button" aria-label="${c("Iniciar chat con asesor comercial")}" @click="${this._toggleSupportChat}"></button> <span class="avatar"><mq-avatar .src="${t.avatar??void 0}" .fallback="${t.name}" .alt="${t.name}"></mq-avatar><span class="online-dot" data-presence="${i}"></span> </span><span class="mobile-info"><p class="mobile-title">${t.title?j`<span class="mobile-role">${t.title}</span> - ${t.name}`:t.name}</p><p class="mobile-welcome">${c("¿Cómo puedo ayudarte?")}</p></span><span class="cta-mobile" aria-hidden="true">${this._ctaIcon(28)} </span><span class="identity"><p class="role">${e}</p><p class="name">${t.name}</p></span><span class="divider" aria-hidden="true"></span><p class="welcome">${c("¿Cómo puedo ayudarte?")}</p><mq-button class="cta-desktop" variant="outline-inverted" size="md" @click="${this._toggleSupportChat}">${c("Chatea conmigo")} ${this._ctaIcon()}</mq-button></div></div></div>`}}):C}};n([s({context:d,subscribe:!0})],L.prototype,"apiClient",void 0),n([$({type:String,attribute:"professional-hash"})],L.prototype,"professionalHash",void 0),n([q()],L.prototype,"_unreadCount",void 0),L=n([l(),r("support-chat-banner")],L);const N=k`:host{padding:var(--size-6) var(--size-4);border-radius:var(--border-radius-md);background-color:var(--color-top-banner-background,transparent);display:block}.banner-inner{display:grid;grid-template-columns:1fr;gap:var(--sp-3);align-items:stretch}.banner-inner:not(.single-column) .top-banner-image{order:-1}.banner-inner.single-column{grid-template-columns:1fr}.top-banner-info{margin:0;text-align:left;display:flex;flex-direction:column;gap:var(--size-4)}.top-banner-info h3{font-family:var(--font-titles);font-size:var(--text-lg);line-height:var(--text-lg--line-height);font-weight:var(--font-weight-bold);color:var(--color-neutrals-text-default);margin:0;margin-bottom:var(--size-2)}.top-banner-info p{font-family:var(--font-body);font-size:var(--text-sm);line-height:var(--text-sm--line-height);font-weight:var(--font-weight-normal);color:var(--color-neutrals-text-default);margin:0}.top-banner-actions{display:flex;flex-direction:column;gap:var(--size-2)}.top-banner-image{background-size:cover;background-position:center;background-repeat:no-repeat;border-radius:8px;min-width:151px;min-height:11rem;position:relative}@media (min-width:768px){:host{padding:var(--sp-6)}.banner-inner{gap:var(--sp-8)}.banner-inner:not(.single-column){grid-template-columns:1fr 1fr}.banner-inner:not(.single-column) .top-banner-image{order:0}.top-banner-image{border-radius:4px;min-height:0}.top-banner-info h3{font-size:var(--text-xl);line-height:var(--text-xl--line-height)}.top-banner-info p{font-size:var(--text-base);line-height:var(--text-base--line-height)}}@media (min-width:1024px){.top-banner-info{width:100%;max-width:364px;margin-left:auto;margin-right:auto}.top-banner-info h3{font-size:var(--text-2xl);line-height:var(--text-2xl--line-height)}}`;let R=class TopBanner extends y{static{this.styles=N}_handleBook(){u.track(v(this.loginToken.patient.hash)),this.dispatchEvent(new D)}_handleViewAppointments(){u.track(g(this.loginToken.patient.hash)),this.dispatchEvent(new U({tab:"next"}))}render(){const t=this.orgSetup.home.title||c("Cita con un especialista en menos de 72 horas"),e=this.orgSetup.home.description||c("Traumatología, ginecología, endocrinología, digestivo o psiquiatría"),i=this.orgSetup.home.image_url;return j`<div class="banner-inner ${i?"":"single-column"}"><div class="top-banner-info"><div>${t?j`<h3>${t}</h3>`:C} ${e?j`<p>${e}</p>`:C}</div><div class="top-banner-actions"><mq-button variant="primary" fullwidth @click="${this._handleBook}">${c("Pedir cita")}</mq-button><mq-button variant="outline" fullwidth @click="${this._handleViewAppointments}">${c("Ver todas mis citas")}</mq-button></div></div>${i?j`<div class="top-banner-image" style="${E({background:`linear-gradient(180deg, rgba(0, 0, 0, 0) 68.17%, rgba(0, 0, 0, 0.2) 100%), url('${i}') lightgray 50% / cover no-repeat`})}"></div>`:C}</div>`}};n([s({context:h})],R.prototype,"loginToken",void 0),n([$({attribute:!1})],R.prototype,"orgSetup",void 0),R=n([l(),r("top-banner")],R);const K=k`:host{border-radius:var(--border-radius-md);box-sizing:border-box;width:100%;display:flex;flex-direction:column;gap:var(--sp-4);padding:var(--sp-6);background-color:var(--color-card);border:1px solid var(--color-border);box-shadow:var(--shadow-sm);margin:0 auto}svg{flex-shrink:0;width:25px;height:auto}.title{font-family:var(--font-titles);font-size:var(--text-lg);line-height:var(--text-base--line-height);font-weight:var(--font-weight-bold);color:var(--color-neutrals-text-default);margin:0}.description{font-family:var(--font-body);font-size:var(--text-xs);line-height:var(--text-xs--line-height);font-weight:var(--font-weight-normal);color:var(--color-neutrals-text-default);margin:0}.content{display:flex;flex-direction:column;gap:var(--sp-4)}@media (min-width:768px){:host{align-items:start;flex-direction:row;gap:var(--sp-6)}svg{width:32px;height:auto}.description{font-size:var(--text-base);line-height:var(--text-base--line-height)}}`;let F=class HomeEmptyState extends y{constructor(){super(...arguments),this.title="",this.description="",this.icon="document"}static{this.styles=K}render(){return j`${"document"===this.icon?function({color:t="currentColor"}){return j`<svg width="32" height="40" viewBox="0 0 32 40" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M24 18H8V16H24V18ZM24 23H8V25H24V23ZM24 30H8V32H24V30ZM32 39V10C32 9.86867 31.9742 9.73862 31.9239 9.61728C31.8737 9.49594 31.8001 9.38568 31.7072 9.2928L22.7064 0.2952C22.5672 0.15435 22.3889 0.0585355 22.1947 0.0201668C22.0004 -0.018202 21.7991 0.00264228 21.6168 0.08C21.4342 0.155546 21.278 0.283605 21.1682 0.447954C21.0584 0.612303 20.9999 0.805545 21 1.0032V10C20.9999 10.1314 21.0257 10.2614 21.0759 10.3828C21.1261 10.5042 21.1998 10.6145 21.2927 10.7073C21.3855 10.8002 21.4958 10.8739 21.6172 10.9241C21.7386 10.9743 21.8686 11.0001 22 11H30V38H2V2H19V0H1C0.734784 0 0.480429 0.105357 0.292893 0.292893C0.105357 0.48043 0 0.734784 0 1V39C-4.20445e-08 39.1314 0.0258922 39.2615 0.0761969 39.3829C0.126502 39.5042 0.200233 39.6145 0.293176 39.7074C0.386119 39.8003 0.496453 39.8739 0.617871 39.9241C0.739289 39.9743 0.869411 40.0001 1.0008 40H31.0008C31.2659 39.9998 31.52 39.8943 31.7074 39.7068C31.8948 39.5193 32 39.2651 32 39ZM23 3.416L28.5856 9.0016H23V3.416Z" fill="${t}"/></svg>`}({color:"var(--color-primary)"}):function({color:t="currentColor"}){return j`<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M20 20.9512C22.2362 20.9487 24.38 20.057 25.9612 18.4717C27.5424 16.8864 28.4319 14.7371 28.4344 12.4952V8.45605C28.4344 6.21336 27.5458 4.06254 25.964 2.47672C24.3823 0.890903 22.2369 0 20 0C17.7631 0 15.6177 0.890903 14.036 2.47672C12.4542 4.06254 11.5656 6.21336 11.5656 8.45605V12.4952C11.5681 14.7371 12.4576 16.8864 14.0388 18.4717C15.62 20.057 17.7638 20.9487 20 20.9512ZM13.5656 8.45605C13.5656 6.74516 14.2435 5.10434 15.4502 3.89456C16.6569 2.68478 18.2935 2.00513 20 2.00513C21.7065 2.00513 23.3431 2.68478 24.5498 3.89456C25.7565 5.10434 26.4344 6.74516 26.4344 8.45605V12.4952C26.4344 14.2061 25.7565 15.8469 24.5498 17.0567C23.3431 18.2665 21.7065 18.9461 20 18.9461C18.2935 18.9461 16.6569 18.2665 15.4502 17.0567C14.2435 15.8469 13.5656 14.2061 13.5656 12.4952V8.45605ZM36.24 24.1386C33.9712 21.9859 30.8304 20.5414 27.156 19.9607C26.9367 19.9252 26.7119 19.964 26.517 20.0709C26.3222 20.1778 26.1684 20.3467 26.08 20.551C25.1576 22.6748 22.86 24.9623 20 24.9623C17.14 24.9623 14.8392 22.6756 13.92 20.551C13.8316 20.3474 13.6783 20.179 13.4842 20.0721C13.29 19.9653 13.066 19.9261 12.8472 19.9607C9.1696 20.5414 6.0288 21.9859 3.76 24.1386C1.3 26.4718 0 29.53 0 32.982V40H2V32.982C2 30.0946 3.084 27.5401 5.1344 25.5951C6.484 24.3118 8.2088 23.3197 10.2112 22.6524V29.0231H9.2272C8.42757 29.024 7.66093 29.3428 7.0955 29.9097C6.53008 30.4765 6.21205 31.2452 6.2112 32.0468V36.7974C6.21162 37.2613 6.39556 37.7061 6.72266 38.0341C7.04976 38.3622 7.49331 38.5468 7.956 38.5475H8.996V36.5424H8.2072V32.0468C8.20762 31.7768 8.3148 31.518 8.50525 31.327C8.69569 31.1361 8.95387 31.0287 9.2232 31.0282H13.2C13.467 31.0287 13.7229 31.1352 13.9117 31.3245C14.1005 31.5137 14.2068 31.7703 14.2072 32.038V36.5424H13V38.5475H14.484C14.9418 38.5471 15.3808 38.3646 15.7046 38.0401C16.0284 37.7156 16.2106 37.2756 16.2112 36.8167V32.038C16.2104 31.2387 15.8933 30.4723 15.3295 29.9071C14.7657 29.3419 14.0013 29.024 13.204 29.0231H12.2112V22.1166C12.2848 22.1006 12.3576 22.0837 12.432 22.0693C13.1066 23.3192 14.0396 24.4103 15.1688 25.2695C16.64 26.3795 18.3096 26.9666 20 26.9666C21.6904 26.9666 23.36 26.3795 24.8312 25.2695C25.6704 24.6323 26.4026 23.8647 27 22.9957V32.9636C26.3723 33.2245 25.8562 33.6985 25.5421 34.3025C25.2279 34.9066 25.1358 35.6022 25.2817 36.2675C25.4277 36.9329 25.8025 37.5255 26.3405 37.9416C26.8784 38.3578 27.5453 38.5709 28.2242 38.5437C28.9032 38.5164 29.5509 38.2506 30.054 37.7927C30.5571 37.3348 30.8835 36.7141 30.976 36.0392C31.0685 35.3643 30.9212 34.6783 30.5599 34.1013C30.1987 33.5243 29.6465 33.0932 29 32.8834V22.4118C31.3392 23.0679 33.3416 24.149 34.8656 25.5951C36.916 27.5393 38 30.0946 38 32.982V40H40V32.982C40 29.53 38.7 26.4718 36.24 24.1386ZM28.1056 36.5424C27.9287 36.5424 27.7558 36.4898 27.6087 36.3912C27.4616 36.2927 27.347 36.1527 27.2793 35.9888C27.2116 35.825 27.1939 35.6447 27.2284 35.4707C27.2629 35.2968 27.3481 35.137 27.4732 35.0116C27.5982 34.8862 27.7576 34.8008 27.9311 34.7662C28.1046 34.7316 28.2844 34.7493 28.4479 34.8172C28.6113 34.8851 28.751 35 28.8493 35.1475C28.9475 35.2949 29 35.4683 29 35.6457C28.9998 35.8834 28.9055 36.1114 28.7378 36.2795C28.5701 36.4476 28.3427 36.5421 28.1056 36.5424Z" fill="${t}"/></svg>`}({color:"var(--color-primary)"})}<div class="content"><p class="title">${this.title}</p><p class="description">${this.description}</p></div>`}};n([$({type:String})],F.prototype,"title",void 0),n([$({type:String})],F.prototype,"description",void 0),n([$({type:String})],F.prototype,"icon",void 0),F=n([l(),r("home-empty-state")],F);const J=k`:host{display:block;max-width:var(--content-max-width);margin:0 auto}.title{font-family:var(--font-titles);font-size:var(--text-2xl);line-height:var(--text-2xl--line-height);font-weight:var(--font-weight-bold);color:var(--color-neutrals-text-default);margin:0;margin-bottom:var(--sp-4)}.container{padding:var(--sp-6) var(--sp-4)}.documents-list{border-radius:var(--border-radius-md);padding:var(--sp-3);background-color:var(--color-muted);display:flex;flex-direction:column;gap:var(--sp-3);margin-bottom:var(--sp-6)}hr{width:100%;border:none;border-top:1px solid #e5e5e5;margin:0}.button-container{max-width:332px;margin:0 auto}`;let O=class RecentDocuments extends y{constructor(){super(...arguments),this.getPatientDocumentsQuery=new p(this,()=>I(this.apiClient,{patient_hash:this.loginToken.patient.hash,page:1,per_page:2})),this.getOrganizationSpecialtiesQuery=new p(this,()=>f(this.apiClient))}static{this.styles=J}renderDocuments(){return this.getPatientDocumentsQuery.render({complete:e=>{const i=t();return 0===e.data.length?j`<home-empty-state icon="document" title="${c("No tienes documentación")}" description="${c("Aquí se mostrarán tus recetas e informes médicos. Consulta a tu profesional de salud para recibir documentación.")}"></home-empty-state>`:j`<mq-card class="container" roundness="md"><div class="documents-list">${e.data.map((t,o)=>{const n=this.getOrganizationSpecialtiesQuery.result?.data?.find(e=>e.id===t.professional.speciality_id),r=b(n?.code??"",i,n?.name);return j`<patient-document filename="${t.name}" kind="${t.document_type}" specialty="${r}" description="${t.name}" date="${t.created_at}" downloadUrl="${t.url}"></patient-document>${o<e.data.length-1?j`<hr>`:C}`})}</div><div class="button-container"><mq-button variant="primary" size="md" fullwidth @click="${()=>{u.track(x(this.loginToken.patient.hash)),this.dispatchEvent(new Z)}}">${c("Ver toda la documentación")}</mq-button></div></mq-card>`},pending:()=>j`<mq-card class="container" roundness="md"><div class="documents-list"><mq-skeleton height="57px"></mq-skeleton><hr><mq-skeleton height="57px"></mq-skeleton></div></mq-card>`})}render(){return j`<h2 class="title">${c("Documentación más reciente")}</h2>${this.renderDocuments()}`}};n([s({context:d,subscribe:!0})],O.prototype,"apiClient",void 0),n([s({context:h})],O.prototype,"loginToken",void 0),O=n([l(),r("recent-documents")],O);const W=[_.pending,_.accepted],X=k`:host{display:block}.title{font-family:var(--font-titles);font-size:var(--text-2xl);line-height:var(--text-2xl--line-height);font-weight:var(--font-weight-bold);color:var(--color-neutrals-text-default);margin:0;margin-bottom:var(--sp-4)}.container{background-color:var(--color-neutrals-background-weak);padding:var(--sp-6) var(--sp-4)}.appointment-card{margin-bottom:var(--sp-6)}`;let Y=class NextAppointments extends y{constructor(){super(...arguments),this.getAppointmentsQuery=new p(this,()=>P(this.apiClient,{status:W,order:{field:"starts_at",direction:"asc"},page:1,per_page:1}))}static{this.styles=X}renderAppointment(){return this.getAppointmentsQuery.render({complete:t=>{const e=t.data?.[0];return e?j`<div class="appointment-card"><appointment-card .appointmentResource="${e}" .specialtyId="${e.speciality?.id}" variant="next" detailsVariant="default"></appointment-card></div>`:j`<home-empty-state icon="doctor" title="${c("No tienes próximas citas")}" description="${c("Cuando agendes una cita, aparecerá aquí para que puedas consultarla, modificarla o cancelarla.")}"></home-empty-state>`},pending:()=>j`<div class="appointment-card"><appointment-card-skeleton></appointment-card-skeleton></div>`})}render(){return j`<h2 class="title">${c("Próxima cita")}</h2>${this.renderAppointment()}`}};n([s({context:d,subscribe:!0})],Y.prototype,"apiClient",void 0),Y=n([l(),r("next-appointments")],Y);const tt=k`:host{display:flex;flex-direction:column;height:100%}.support-banner{display:block;flex-shrink:0;margin-bottom:var(--sp-4)}mq-layout{flex:1 1 auto;min-height:0}.banner-area{margin-top:calc(-1 * var(--sp-4));margin-left:calc(-1 * var(--sp-4));margin-right:calc(-1 * var(--sp-4))}.content{display:flex;flex-direction:column;padding-top:var(--sp-6);gap:var(--sp-6)}next-appointments{width:100%}recent-documents{width:100%}@media (min-width:768px){.banner-area{margin:0 auto}.content{flex-direction:row}next-appointments{width:50%}recent-documents{width:50%}}`;let et=class MqDashboard extends y{constructor(){super(...arguments),this.showMediquoBranding=!0,this._trackedPageView=!1,this.orgSetupQuery=new p(this,()=>m(this.apiClient)),this.apiClient=S()}static{this.styles=tt}willUpdate(t){t.has("env")&&this.env&&z(this.env),t.has("locale")&&this.locale&&e(this.locale)&&i(this.locale);const o=H(t,{env:this.env,apiKey:this.apiKey,token:this.token,locale:this.locale},this.inheritedApiClient);o&&(this.apiClient=o)}updated(){!this._trackedPageView&&this.loginToken?.patient.hash&&(this._trackedPageView=!0,u.track(w(this.loginToken.patient.hash)))}render(){return j`${this.orgSetupQuery.render({pending:()=>j``,complete:t=>t.support_professional?.hash?j`<support-chat-banner class="support-banner" professional-hash="${t.support_professional.hash}"></support-chat-banner>`:j``})}<mq-layout background="transparent" variant="wide" .showMediquoBranding="${this.showMediquoBranding}">${this.orgSetupQuery.render({pending:()=>j`<mq-skeleton class="banner-area" width="100%" height="296px" border-radius="none"></mq-skeleton>`,complete:t=>j`<top-banner class="banner-area" .orgSetup="${t}"></top-banner>`})}<div class="content"><next-appointments></next-appointments><recent-documents></recent-documents></div></mq-layout>`}};n([$({type:String,attribute:"api-key"})],et.prototype,"apiKey",void 0),n([$({type:String,attribute:"token"})],et.prototype,"token",void 0),n([$({type:String,attribute:"locale"})],et.prototype,"locale",void 0),n([$({type:String,attribute:"env"})],et.prototype,"env",void 0),n([$({type:Boolean,attribute:"show-mediquo-branding"})],et.prototype,"showMediquoBranding",void 0),n([s({context:h})],et.prototype,"loginToken",void 0),n([s({context:d,subscribe:!0}),q()],et.prototype,"inheritedApiClient",void 0),n([a({context:d}),q()],et.prototype,"apiClient",void 0),et=n([l(),r("mq-dashboard")],et),o();export{D as MqAppointmentBookEvent,et as MqDashboard,U as MqViewAppointmentsEvent,Z as MqViewDocumentsEvent};
@@ -5,7 +5,6 @@ import { M as MediquoApiChatClient } from './chunks/index.d-XSe7Hy-Q.js';
5
5
  import { Env } from './env.js';
6
6
  import './chunks/index-DdkeWQrh.js';
7
7
  import './chunks/index-Nf3nZ9O3.js';
8
- import './ui/mq-page-title.js';
9
8
  import 'axios';
10
9
  import 'zod';
11
10
  import './chunks/schemas.d-b6_AekBb.js';
@@ -67,14 +66,11 @@ declare global {
67
66
  }
68
67
 
69
68
  /**
70
- * Page-level variant of `mq-documents`: the documents list plus the page chrome
71
- * a standalone screen needs — a title and a back affordance.
69
+ * Page-level variant of `mq-documents`: the documents list inside the padding
70
+ * and max-width a standalone screen needs.
72
71
  *
73
- * The chrome is always on. Hosts that provide their own title and back
74
- * navigation mount `mq-documents` instead, which stays content-only.
75
- *
76
- * Back is decoupled from routing: `mq-page-title` emits `mq-back` with
77
- * `source: "documents"`, and the host decides where that goes.
72
+ * The screen carries no title and no back affordance: the shell that mounts it
73
+ * owns both, through its sidebar and its breadcrumb.
78
74
  *
79
75
  * Props are forwarded verbatim to the inner `mq-documents`, which owns the
80
76
  * env/token/locale wiring — this element adds no side effects of its own.
@@ -1 +1 @@
1
- import{isValidLocale as t,setLocale as e,getLocale as i,initLocalization as n}from"./i18n.js";import{_ as o,c as r}from"./chunks/custom-element-D2ziPxYE.js";import{e as s}from"./chunks/provide-BwI4DDGF.js";import{c as a}from"./chunks/consume-CovVqBjI.js";import{m as c,s as p}from"./chunks/runtime-Bg1WXVCx.js";import{l as u}from"./chunks/localized-decorator-BlOuLhym.js";import{Q as l}from"./chunks/query-controller-BlO1Ax65.js";import{A as m}from"./chunks/api-client-context-V1UAGtKW.js";import{a as d}from"./chunks/telemetry-client-7fvNqUSU.js";import{g as h}from"./chunks/get-patient-documents-query-NC9xCa_N.js";import{g}from"./chunks/get-patient-profile-query-4AO6xvVn.js";import{i as y,a as k,x as v}from"./chunks/lit-element-DiWJYFwC.js";import{n as f}from"./chunks/property-scuRaFcM.js";import{r as j}from"./chunks/state-LQivXIgA.js";import{setEnv as b}from"./env.js";import{t as x}from"./chunks/index-uHvVQMNc.js";import{c as P,n as $}from"./chunks/api-chat-client-CJ1EGJe3.js";import{chevronLeftIcon as q}from"./ui/icons/chevron-left-icon.js";import{chevronRightIcon as S}from"./ui/icons/chevron-right-icon.js";import"./chunks/index-iaTXVzFa.js";import{o as w}from"./chunks/if-defined-BYeVdwgd.js";import"./ui/mq-page-title.js";import"./chunks/chunk-4FFT6DC2-CVWibomC.js";import"./chunks/external-CJj32K_p.js";import"./chunks/context-request-event-Dfydf1ub.js";import"./chunks/context-consumer-ESdICVAb.js";import"./chunks/chunk-RCFIJTXZ-C6Ir0-sM.js";import"./chunks/create-context-DqP79qjF.js";import"./chunks/query-Cjvi4_dT.js";import"./chunks/chunk-6CCJWPGL-TiaqZaPV.js";import"./chunks/blob-to-base64-CUL1trde.js";import"./events.js";import"./ui/icons/download-02-icon.js";import"./ui/icons/types.js";import"./ui/mq-button.js";import"./chunks/class-map-Co76I6aw.js";import"./chunks/directive-2EDmOukv.js";import"./ui/mq-toast.js";import"./ui/mq-skeleton.js";import"./chunks/style-map-CIdqdn7C.js";import"./chunks/chunk-HN62IQ7S-xbkIy7k_.js";import"./chunks/parseISO-Dj3qSTG8.js";import"./chunks/format-CRFiCNHw.js";import"./chunks/isBefore-CPpTogxo.js";import"./ui/icons/calendar-icon.js";import"./ui/icons/file-icon.js";import"./ui/icons/arrow-narrow-left-icon.js";const _=y`:host{display:block}.container{background-color:var(--color-card,#fff);border:1px solid var(--color-border-subtle,#edecf1);padding:var(--mq-documents-padding,var(--sp-6));border-radius:var(--mq-documents-radius,12px)}.pagination{display:flex;align-items:center;justify-content:center;gap:var(--sp-2_5);margin-top:var(--sp-4)}.pagination-text{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}.pagination-button{background:0 0;border:none;cursor:pointer;padding:0;display:flex;align-items:center;justify-content:center;width:24px;height:24px;color:var(--color-neutrals-text-default)}.pagination-button:disabled{opacity:0;cursor:not-allowed}.pagination-button:not(:disabled):hover{opacity:.7}`;let C=class MqDocuments extends k{constructor(){super(...arguments),this.currentPage=1,this.apiClient=P(),this.getPatientProfileQuery=new l(this,()=>g(this.apiClient)),this.getPatientDocumentsQuery=new l(this,()=>({...h(this.apiClient,{patient_hash:this._patientHash,page:this.currentPage,per_page:6}),enabled:!!this._patientHash})),this.getOrganizationSpecialtiesQuery=new l(this,()=>d(this.apiClient))}static{this.styles=_}willUpdate(i){i.has("env")&&this.env&&b(this.env),i.has("locale")&&this.locale&&t(this.locale)&&e(this.locale);const n=$(i,{env:this.env,apiKey:this.apiKey,token:this.token,locale:this.locale},this.inheritedApiClient);n&&(this.apiClient=n)}get _patientHash(){return this.getPatientProfileQuery.result?.data?.hash??""}handlePreviousPage(){this.currentPage>1&&(this.currentPage-=1)}handleNextPage(){const t=this.getPatientDocumentsQuery.result?.data?.meta?.last_page??1;this.currentPage<t&&(this.currentPage+=1)}renderSkeleton(){return v`<document-list placeholders="${6}"></document-list>`}renderEmptyState(){return v`<widget-empty-state icon="document" heading="${c("No tienes documentación")}" description="${c("Aquí se mostrarán tus recetas e informes médicos.")}"></widget-empty-state>`}renderError(){return v`<widget-empty-state icon="document" heading="${c("No hemos podido cargar tu documentación")}" description="${c("Vuelve a intentarlo en unos minutos.")}"></widget-empty-state>`}renderDocuments(){return this.getPatientDocumentsQuery.render({complete:t=>0===t.data.length?this.renderEmptyState():v`<document-list .documents="${x(t.data,this.getOrganizationSpecialtiesQuery.result?.data,i())}" patientHash="${this._patientHash}"></document-list>${this.renderPagination(t.meta)}`,initial:()=>this.getPatientProfileQuery.result?.isError?this.renderError():this.renderSkeleton(),pending:()=>this.renderSkeleton(),error:()=>this.renderError()})}renderPagination(t){const e=t.current_page>1,i=t.current_page<t.last_page;return v`<div class="pagination"><button class="pagination-button" @click="${this.handlePreviousPage}" ?disabled="${!e}" aria-label="${c("Página anterior")}">${q({size:24})}</button> <span class="pagination-text">${c(p`${t.current_page} de ${t.last_page}`)} </span><button class="pagination-button" @click="${this.handleNextPage}" ?disabled="${!i}" aria-label="${c("Página siguiente")}">${S({size:24})}</button></div>`}render(){return v`<div class="container">${this.renderDocuments()}</div>`}};o([f({type:String,attribute:"api-key"})],C.prototype,"apiKey",void 0),o([f({type:String,attribute:"token"})],C.prototype,"token",void 0),o([f({type:String,attribute:"locale"})],C.prototype,"locale",void 0),o([f({type:String,attribute:"env"})],C.prototype,"env",void 0),o([j()],C.prototype,"currentPage",void 0),o([a({context:m,subscribe:!0}),j()],C.prototype,"inheritedApiClient",void 0),o([s({context:m}),j()],C.prototype,"apiClient",void 0),C=o([u(),r("mq-documents")],C);const Q=y`:host{display:block}.container{display:flex;flex-direction:column;gap:var(--size-3)}`;let D=class MqDocumentsPage extends k{static{this.styles=Q}render(){return v`<div class="container"><mq-page-title source="documents" .title="${c("Mis documentos")}"></mq-page-title><mq-documents api-key="${w(this.apiKey)}" token="${w(this.token)}" locale="${w(this.locale)}" env="${w(this.env)}"></mq-documents></div>`}};o([f({type:String,attribute:"api-key"})],D.prototype,"apiKey",void 0),o([f({type:String,attribute:"token"})],D.prototype,"token",void 0),o([f({type:String,attribute:"locale"})],D.prototype,"locale",void 0),o([f({type:String,attribute:"env"})],D.prototype,"env",void 0),D=o([u(),r("mq-documents-page")],D),n();export{C as MqDocuments,D as MqDocumentsPage};
1
+ import{isValidLocale as t,setLocale as e,getLocale as i,initLocalization as n}from"./i18n.js";import{_ as o,c as r}from"./chunks/custom-element-D2ziPxYE.js";import{e as s}from"./chunks/provide-BwI4DDGF.js";import{c as a}from"./chunks/consume-CovVqBjI.js";import{m as c,s as p}from"./chunks/runtime-Bg1WXVCx.js";import{l as u}from"./chunks/localized-decorator-BlOuLhym.js";import{Q as l}from"./chunks/query-controller-BlO1Ax65.js";import{A as m}from"./chunks/api-client-context-V1UAGtKW.js";import{g as d}from"./chunks/telemetry-client-BdPx4SXu.js";import{g as h}from"./chunks/get-patient-documents-query-NC9xCa_N.js";import{g}from"./chunks/get-patient-profile-query-4AO6xvVn.js";import{i as y,a as k,x as v}from"./chunks/lit-element-DiWJYFwC.js";import{n as f}from"./chunks/property-scuRaFcM.js";import{r as j}from"./chunks/state-LQivXIgA.js";import{setEnv as b}from"./env.js";import{t as x}from"./chunks/index-Btj1mwcE.js";import{c as P,n as $}from"./chunks/api-chat-client-CJ1EGJe3.js";import{chevronLeftIcon as q}from"./ui/icons/chevron-left-icon.js";import{chevronRightIcon as S}from"./ui/icons/chevron-right-icon.js";import"./chunks/index-iaTXVzFa.js";import{o as _}from"./chunks/if-defined-BYeVdwgd.js";import"./chunks/chunk-4FFT6DC2-CVWibomC.js";import"./chunks/external-CJj32K_p.js";import"./chunks/context-request-event-Dfydf1ub.js";import"./chunks/context-consumer-ESdICVAb.js";import"./chunks/chunk-RCFIJTXZ-C6Ir0-sM.js";import"./chunks/create-context-DqP79qjF.js";import"./chunks/query-Cjvi4_dT.js";import"./chunks/chunk-6CCJWPGL-TiaqZaPV.js";import"./chunks/blob-to-base64-CUL1trde.js";import"./events.js";import"./ui/icons/download-02-icon.js";import"./ui/icons/types.js";import"./ui/mq-button.js";import"./chunks/class-map-Co76I6aw.js";import"./chunks/directive-2EDmOukv.js";import"./ui/mq-toast.js";import"./ui/mq-skeleton.js";import"./chunks/style-map-CIdqdn7C.js";import"./chunks/chunk-HN62IQ7S-xbkIy7k_.js";import"./chunks/parseISO-Dj3qSTG8.js";import"./chunks/format-CRFiCNHw.js";import"./chunks/isBefore-CPpTogxo.js";import"./ui/icons/calendar-icon.js";import"./ui/icons/file-icon.js";const w=y`:host{display:block}.container{background-color:var(--color-card,#fff);border:1px solid var(--color-border-subtle,#edecf1);padding:var(--mq-documents-padding,var(--sp-6));border-radius:var(--mq-documents-radius,12px)}.pagination{display:flex;align-items:center;justify-content:center;gap:var(--sp-2_5);margin-top:var(--sp-4)}.pagination-text{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}.pagination-button{background:0 0;border:none;cursor:pointer;padding:0;display:flex;align-items:center;justify-content:center;width:24px;height:24px;color:var(--color-neutrals-text-default)}.pagination-button:disabled{opacity:0;cursor:not-allowed}.pagination-button:not(:disabled):hover{opacity:.7}`;let C=class MqDocuments extends k{constructor(){super(...arguments),this.currentPage=1,this.apiClient=P(),this.getPatientProfileQuery=new l(this,()=>g(this.apiClient)),this.getPatientDocumentsQuery=new l(this,()=>({...h(this.apiClient,{patient_hash:this._patientHash,page:this.currentPage,per_page:6}),enabled:!!this._patientHash})),this.getOrganizationSpecialtiesQuery=new l(this,()=>d(this.apiClient))}static{this.styles=w}willUpdate(i){i.has("env")&&this.env&&b(this.env),i.has("locale")&&this.locale&&t(this.locale)&&e(this.locale);const n=$(i,{env:this.env,apiKey:this.apiKey,token:this.token,locale:this.locale},this.inheritedApiClient);n&&(this.apiClient=n)}get _patientHash(){return this.getPatientProfileQuery.result?.data?.hash??""}handlePreviousPage(){this.currentPage>1&&(this.currentPage-=1)}handleNextPage(){const t=this.getPatientDocumentsQuery.result?.data?.meta?.last_page??1;this.currentPage<t&&(this.currentPage+=1)}renderSkeleton(){return v`<document-list placeholders="${6}"></document-list>`}renderEmptyState(){return v`<widget-empty-state icon="document" heading="${c("No tienes documentación")}" description="${c("Aquí se mostrarán tus recetas e informes médicos.")}"></widget-empty-state>`}renderError(){return v`<widget-empty-state icon="document" heading="${c("No hemos podido cargar tu documentación")}" description="${c("Vuelve a intentarlo en unos minutos.")}"></widget-empty-state>`}renderDocuments(){return this.getPatientDocumentsQuery.render({complete:t=>0===t.data.length?this.renderEmptyState():v`<document-list .documents="${x(t.data,this.getOrganizationSpecialtiesQuery.result?.data,i())}" patientHash="${this._patientHash}"></document-list>${this.renderPagination(t.meta)}`,initial:()=>this.getPatientProfileQuery.result?.isError?this.renderError():this.renderSkeleton(),pending:()=>this.renderSkeleton(),error:()=>this.renderError()})}renderPagination(t){const e=t.current_page>1,i=t.current_page<t.last_page;return v`<div class="pagination"><button class="pagination-button" @click="${this.handlePreviousPage}" ?disabled="${!e}" aria-label="${c("Página anterior")}">${q({size:24})}</button> <span class="pagination-text">${c(p`${t.current_page} de ${t.last_page}`)} </span><button class="pagination-button" @click="${this.handleNextPage}" ?disabled="${!i}" aria-label="${c("Página siguiente")}">${S({size:24})}</button></div>`}render(){return v`<div class="container">${this.renderDocuments()}</div>`}};o([f({type:String,attribute:"api-key"})],C.prototype,"apiKey",void 0),o([f({type:String,attribute:"token"})],C.prototype,"token",void 0),o([f({type:String,attribute:"locale"})],C.prototype,"locale",void 0),o([f({type:String,attribute:"env"})],C.prototype,"env",void 0),o([j()],C.prototype,"currentPage",void 0),o([a({context:m,subscribe:!0}),j()],C.prototype,"inheritedApiClient",void 0),o([s({context:m}),j()],C.prototype,"apiClient",void 0),C=o([u(),r("mq-documents")],C);const Q=y`:host{display:block}.container{display:flex;flex-direction:column;gap:var(--size-3);padding-top:var(--sp-10)}`;let D=class MqDocumentsPage extends k{static{this.styles=Q}render(){return v`<div class="container"><mq-documents api-key="${_(this.apiKey)}" token="${_(this.token)}" locale="${_(this.locale)}" env="${_(this.env)}"></mq-documents></div>`}};o([f({type:String,attribute:"api-key"})],D.prototype,"apiKey",void 0),o([f({type:String,attribute:"token"})],D.prototype,"token",void 0),o([f({type:String,attribute:"locale"})],D.prototype,"locale",void 0),o([f({type:String,attribute:"env"})],D.prototype,"env",void 0),D=o([u(),r("mq-documents-page")],D),n();export{C as MqDocuments,D as MqDocumentsPage};
@@ -2,12 +2,12 @@ export { A as AppointmentDetails } from './chunks/appointment-details-CVEDe_k0.j
2
2
  import * as lit_html from 'lit-html';
3
3
  import * as lit from 'lit';
4
4
  import { LitElement } from 'lit';
5
- import { z } from 'zod';
6
5
  import { MqTabsSelectEvent } from './ui/mq-tabs.js';
6
+ import { z } from 'zod';
7
7
  import { M as MediquoApiChatClient } from './chunks/index.d-XSe7Hy-Q.js';
8
8
  import './chunks/appointment-card-skeleton-C2Sim4nR.js';
9
9
  import './ui/mq-button.js';
10
- import './ui/mq-page-title.js';
10
+ import './chunks/next-appointment-card-Bc65OZ1_.js';
11
11
  export { P as ProfessionalOverview } from './chunks/professional-overview-mO3tuMuH.js';
12
12
  import './chunks/appointment.model.d-BWwBLaEL.js';
13
13
  import 'axios';