@mediquo/elements 0.6.5 → 0.7.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 (118) hide show
  1. package/dist/chunks/action-unavailable-message-CzRDRmk9.js +1 -0
  2. package/dist/chunks/addSeconds-ofMnxlgT.js +1 -0
  3. package/dist/chunks/api-chat-client-BsiZ3A6g.js +1 -0
  4. package/dist/chunks/{apple-pay-outcomes-CnVRvAVS.js → apple-pay-outcomes-B4dOTOhL.js} +1 -1
  5. package/dist/chunks/{appointment-card-skeleton-1c7552Ln.d.ts → appointment-action-unavailable-dialog-ByWsZP0d.d.ts} +2 -86
  6. package/dist/chunks/appointment-card-skeleton-CwIuoOXV.js +1 -0
  7. package/dist/chunks/appointment-card-skeleton-DRWT9q2U.d.ts +91 -0
  8. package/dist/chunks/appointment-details-D7Rw3Hyl.js +1 -0
  9. package/dist/chunks/blob-to-base64-CUL1trde.js +1 -0
  10. package/dist/chunks/{context-consumer-ESdICVAb.js → chunk-6CCJWPGL-DlOpbEYH.js} +1 -1
  11. package/dist/chunks/chunk-BUV4MGML-Bn3JWCAv.js +1 -0
  12. package/dist/chunks/chunk-Y4EKUX25-CqL3lLdx.js +1 -0
  13. package/dist/chunks/consume-BhoQNO_8.js +1 -0
  14. package/dist/chunks/document.model.d-DIzMiOmd.d.ts +6 -0
  15. package/dist/chunks/documentation-view-Mqdp7yKi.js +1 -0
  16. package/dist/chunks/get-appointment-query-lJe75hGS.js +1 -0
  17. package/dist/chunks/get-organization-setup-query-DxHNY0w8.js +1 -0
  18. package/dist/chunks/get-patient-documents-query-D1SfC_k_.js +1 -0
  19. package/dist/chunks/get-patient-profile-query-DiU2f_QH.js +1 -0
  20. package/dist/chunks/get-schedule-services-query-Ckvz9Fqh.js +1 -0
  21. package/dist/chunks/i18n-formats-EgnwLxKt.js +1 -0
  22. package/dist/chunks/index-63zQSBy4.js +1 -0
  23. package/dist/chunks/index-CDBk7hVW.d.ts +28 -0
  24. package/dist/chunks/{index-DNUbmrQl.d.ts → index-CSJzkkRA.d.ts} +1 -4
  25. package/dist/chunks/index-CatvNhwL.js +1 -0
  26. package/dist/chunks/index-DZjrAnPq.js +1 -0
  27. package/dist/chunks/{index-DhfVmF4C.js → index-m_sTPA-8.js} +1 -1
  28. package/dist/chunks/price-DU3YLTpk.js +1 -0
  29. package/dist/chunks/query-controller-D7jBX4X7.js +1 -0
  30. package/dist/chunks/refund-cancel-policy-qaBi5AHH.js +1 -0
  31. package/dist/chunks/{schemas.d-5LR6aN9I.d.ts → schemas.d-D7bCe24u.d.ts} +20 -20
  32. package/dist/chunks/telemetry-client-Bkbn48Dd.js +1 -0
  33. package/dist/env.js +1 -1
  34. package/dist/mq-apple-pay-checkout.js +1 -1
  35. package/dist/mq-appointment-checkout.js +1 -1
  36. package/dist/mq-appointment-documentation.d.ts +2 -1
  37. package/dist/mq-appointment-documentation.js +1 -1
  38. package/dist/mq-chat-room.js +1 -1
  39. package/dist/mq-checkout.js +1 -1
  40. package/dist/mq-dashboard.d.ts +16 -6
  41. package/dist/mq-dashboard.js +1 -1
  42. package/dist/mq-documents.d.ts +2 -1
  43. package/dist/mq-documents.js +1 -1
  44. package/dist/mq-google-pay-checkout.js +1 -1
  45. package/dist/mq-immediate-videocall-checkout.js +1 -1
  46. package/dist/mq-my-appointments.d.ts +6 -5
  47. package/dist/mq-my-appointments.js +1 -1
  48. package/dist/mq-next-appointments.d.ts +88 -0
  49. package/dist/mq-next-appointments.js +1 -0
  50. package/dist/mq-payment-poller.js +1 -1
  51. package/dist/mq-professional-presence-sync.js +1 -1
  52. package/dist/mq-recent-documents.d.ts +60 -0
  53. package/dist/mq-recent-documents.js +1 -0
  54. package/dist/mq-schedule-success.js +2 -2
  55. package/dist/mq-schedule.d.ts +8 -9
  56. package/dist/mq-schedule.js +1 -1
  57. package/dist/mq-session-provider.d.ts +1 -1
  58. package/dist/mq-support-chat.js +1 -1
  59. package/dist/mq-terms-and-conditions.js +1 -1
  60. package/dist/mq-unread-count-sync.js +1 -1
  61. package/dist/mq-videocall.d.ts +2 -1
  62. package/dist/mq-videocall.js +1 -1
  63. package/dist/react/mq-apple-pay-checkout.js +1 -1
  64. package/dist/react/mq-appointment-checkout.js +1 -1
  65. package/dist/react/mq-appointment-documentation.d.ts +2 -1
  66. package/dist/react/mq-appointment-documentation.js +1 -1
  67. package/dist/react/mq-chat-room.js +1 -1
  68. package/dist/react/mq-checkout.js +1 -1
  69. package/dist/react/mq-dashboard.d.ts +8 -6
  70. package/dist/react/mq-dashboard.js +1 -1
  71. package/dist/react/mq-documents-page.d.ts +2 -1
  72. package/dist/react/mq-documents-page.js +1 -1
  73. package/dist/react/mq-documents.d.ts +2 -1
  74. package/dist/react/mq-documents.js +1 -1
  75. package/dist/react/mq-google-pay-checkout.js +1 -1
  76. package/dist/react/mq-immediate-videocall-checkout.js +1 -1
  77. package/dist/react/mq-my-appointments.d.ts +7 -6
  78. package/dist/react/mq-my-appointments.js +1 -1
  79. package/dist/react/mq-next-appointments.d.ts +38 -0
  80. package/dist/react/mq-next-appointments.js +2 -0
  81. package/dist/react/mq-payment-poller.js +1 -1
  82. package/dist/react/mq-professional-presence-sync.js +1 -1
  83. package/dist/react/mq-recent-documents.d.ts +27 -0
  84. package/dist/react/mq-recent-documents.js +2 -0
  85. package/dist/react/mq-schedule-success.js +1 -1
  86. package/dist/react/mq-schedule.d.ts +3 -3
  87. package/dist/react/mq-schedule.js +1 -1
  88. package/dist/react/mq-session-provider.d.ts +1 -1
  89. package/dist/react/mq-support-chat.js +1 -1
  90. package/dist/react/mq-terms-and-conditions.js +1 -1
  91. package/dist/react/mq-unread-count-sync.js +1 -1
  92. package/dist/react/mq-videocall.d.ts +2 -1
  93. package/dist/react/mq-videocall.js +1 -1
  94. package/dist/theme.d.ts +8 -0
  95. package/dist/theme.js +1 -1
  96. package/dist/ui/icons/arrow-right-icon.d.ts +6 -0
  97. package/dist/ui/icons/arrow-right-icon.js +1 -0
  98. package/dist/ui/icons/dots-horizontal-icon.d.ts +6 -0
  99. package/dist/ui/icons/dots-horizontal-icon.js +1 -0
  100. package/dist/ui/mq-clamped-text.js +1 -1
  101. package/package.json +9 -1
  102. package/dist/chunks/api-chat-client-BBL1U9EQ.js +0 -1
  103. package/dist/chunks/appointment-card-skeleton-C8VERHzq.js +0 -1
  104. package/dist/chunks/chunk-GZF3YFSX-DM-GTqxg.js +0 -1
  105. package/dist/chunks/chunk-YMQSBQHL-De_r7BNk.js +0 -1
  106. package/dist/chunks/consume-CovVqBjI.js +0 -1
  107. package/dist/chunks/documentation-view-DJCr5_MN.js +0 -1
  108. package/dist/chunks/get-appointment-query-Ck68BEMg.js +0 -1
  109. package/dist/chunks/get-organization-setup-query-BMbuRi6v.js +0 -1
  110. package/dist/chunks/get-patient-documents-query-DIQH-TMM.js +0 -1
  111. package/dist/chunks/get-patient-profile-query-B0tUDJmT.js +0 -1
  112. package/dist/chunks/i18n-formats-DYS91YEa.js +0 -1
  113. package/dist/chunks/index-KvIw19qY.js +0 -1
  114. package/dist/chunks/index-ShXzd7UZ.js +0 -1
  115. package/dist/chunks/price-LTnCz9kN.js +0 -1
  116. package/dist/chunks/query-controller-BlO1Ax65.js +0 -1
  117. package/dist/chunks/refund-cancel-policy-CXFTrFfo.js +0 -1
  118. package/dist/chunks/telemetry-client-BLJVs9me.js +0 -1
@@ -1 +0,0 @@
1
- import{_ as t,c as e}from"./custom-element-D2ziPxYE.js";import{c as i}from"./consume-CovVqBjI.js";import{m as a,s as o}from"./runtime-Bg1WXVCx.js";import{l as n}from"./localized-decorator-BlOuLhym.js";import{Q as s}from"./query-controller-BlO1Ax65.js";import{g as p}from"./get-organization-setup-query-BMbuRi6v.js";import{g as r,a as l}from"./i18n-formats-DYS91YEa.js";import{g as c,c as d}from"./refund-cancel-policy-CXFTrFfo.js";import{g as h}from"./chunk-GZF3YFSX-DM-GTqxg.js";import{a as m,i as u,x as g,E as v}from"./lit-element-DiWJYFwC.js";import{n as f}from"./property-scuRaFcM.js";import{r as y}from"./state-LQivXIgA.js";import{getLocale as b}from"../i18n.js";import{a as $,A as C,i as x}from"./api-chat-client-BBL1U9EQ.js";import{h as q,f as w}from"./price-LTnCz9kN.js";import"../ui/mq-card.js";import"./professional-overview-C4H_znIJ.js";import{l as k}from"./chunk-S5RWG6G2-DPesx3Od.js";import"../mq-chat-room.js";import"../ui/mq-floating-bubble.js";import{Q as j}from"./chunk-RCFIJTXZ-C6Ir0-sM.js";import{M as S}from"./mutation-controller-CR2qcqhH.js";import"../ui/mq-button.js";import"../ui/mq-dialog.js";import{t as R,j as D,k as I,l as M,n as O,o as E,p as z}from"./telemetry-client-BLJVs9me.js";import{e as A}from"./class-map-Co76I6aw.js";import{MqAppointmentRescheduleEvent as U,MqAppointmentBookEvent as _,MqAppointmentJoinVideocallEvent as H,MqAppointmentViewDocumentationEvent as N}from"../events.js";import{messageBubbleIcon as T}from"../ui/icons/message-bubble-icon.js";import{videoIcon as B}from"../ui/icons/video-icon.js";import"../ui/mq-unread-badge.js";import{toast as P}from"../ui/mq-toast.js";function Q(t,e){return{queryKey:["appointments",e],queryFn:()=>t.appointments.getAppointments(e)}}let V=class CancelAppointmentConfirmationDialog extends m{constructor(){super(...arguments),this.open=!1,this.cancelAppointmentMutation=new S(this,{mutationFn:async t=>$.appointments.cancelAppointment(t),onSuccess:()=>{this.queryClientContext?.invalidateQueries(),this.dispatchEvent(new CustomEvent("success",{bubbles:!0,composed:!0}))}}),this.handleClose=()=>{this.open=!1,this.dispatchEvent(new CustomEvent("cancel",{bubbles:!0,composed:!0}))},this.handleDismissClick=()=>{this.open=!1,this.dispatchEvent(new CustomEvent("cancel",{bubbles:!0,composed:!0}))},this.handleConfirmClick=()=>{this.cancelAppointmentMutation.run({id:this.appointmentId})}}static{this.styles=u`:host{display:contents}h2{font-family:var(--font-titles);font-size:var(--text-2xl);line-height:var(--text-2xl--line-height);font-weight:var(--font-weight-bold);margin:0}p{font-family:var(--font-body);font-size:var(--text-sm);line-height:var(--text-sm--line-height);font-weight:var(--font-weight-normal);margin:0}.subheading-payable{font-size:var(--text-base);line-height:22px}.price-rows{display:flex;flex-direction:column;font-family:var(--font-body);font-size:var(--text-sm);font-weight:var(--font-weight-medium);line-height:var(--text-sm--line-height);color:var(--color-card-foreground);width:100%;margin-bottom:var(--sp-4)}.price-row{display:flex;align-items:center;justify-content:space-between;min-height:34px;gap:var(--sp-2)}.price-row span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.actions{display:flex;gap:var(--sp-3);margin-top:var(--sp-4);justify-content:flex-end;flex-wrap:wrap}`}render(){const t=b(),e=this.price,i=q(e),o=this.cancelAppointmentMutation.isPending;if(i){const i=w(e,t),n=`-${i}`;return g`<mq-dialog .open="${this.open}" @mq-close="${this.handleClose}" dismissable><h2 slot="heading">${a("Confirmar cancelación")}</h2><p slot="subheading" class="subheading-payable">${a("¿Seguro que quieres cancelar esta cita? Se te devolverá el importe pagado en un plazo de 5-10 días hábiles.")}</p><div><div class="price-rows"><div class="price-row"><span>${a("Importe pagado")}</span> <span>${i}</span></div><div class="price-row"><span>${a("Importe a devolver")}</span> <span>${n}</span></div></div><div class="actions"><mq-button variant="outline" ?disabled="${o}" @click="${this.handleDismissClick}">${a("Volver")}</mq-button><mq-button variant="primary" ?disabled="${o}" @click="${this.handleConfirmClick}">${a("Confirmar")}</mq-button></div></div></mq-dialog>`}return g`<mq-dialog .open="${this.open}" @mq-close="${this.handleClose}" dismissable><h2 slot="heading">${a("Confirmar cancelación")}</h2><p slot="subheading">${a("¿Seguro que quieres cancelar esta cita?")}</p><div><div class="actions"><mq-button variant="outline" ?disabled="${o}" @click="${this.handleDismissClick}">${a("Cancelar")}</mq-button><mq-button variant="primary" ?disabled="${o}" @click="${this.handleConfirmClick}">${a("Confirmar")}</mq-button></div></div></mq-dialog>`}};t([f({type:Boolean,reflect:!0})],V.prototype,"open",void 0),t([i({context:j,subscribe:!0})],V.prototype,"queryClientContext",void 0),t([f({type:String})],V.prototype,"appointmentId",void 0),t([f({type:Object})],V.prototype,"price",void 0),V=t([n(),e("cancel-appointment-confirmation-dialog")],V);let F=class AppointmentActionUnavailableDialog extends m{constructor(){super(...arguments),this.open=!1,this.heading="",this.message="",this.handleClose=()=>{this.open=!1,this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0}))}}static{this.styles=u`:host{display:contents}mq-dialog::part(dialog){max-width:343px;min-width:0}h2{font-family:var(--font-titles);font-size:var(--text-2xl);line-height:var(--text-2xl--line-height);font-weight:var(--font-weight-bold);margin:0}p{font-family:var(--font-body);font-size:var(--text-sm);line-height:var(--text-sm--line-height);font-weight:var(--font-weight-normal);margin:0}.actions{display:flex;margin-top:var(--sp-4)}`}render(){return g`<mq-dialog .open="${this.open}" @mq-close="${this.handleClose}" dismissable><h2 slot="heading">${this.heading}</h2><p slot="subheading">${this.message}</p><div class="actions"><mq-button variant="primary" fullwidth @click="${this.handleClose}">${a("Volver")}</mq-button></div></mq-dialog>`}};t([f({type:Boolean,reflect:!0})],F.prototype,"open",void 0),t([f({type:String})],F.prototype,"heading",void 0),t([f({type:String})],F.prototype,"message",void 0),F=t([n(),e("appointment-action-unavailable-dialog")],F);let L=class AppointmentCardActions extends m{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(D(this.patientHash,this.appointmentId)),this.dispatchEvent(new U({appointmentId:this.appointmentId})))},this.handleCancelClick=()=>{this.isCancelUnavailable?this.openDialog="cancel":(R.track(I(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(M(this.patientHash,this.appointmentId)),this.dispatchEvent(new _({specialty:this.repeatTarget.specialty,service:this.repeatTarget.service,professional:this.professionalHash}))):this.openDialog="repeat-error"},this.handleDialogClose=()=>{this.openDialog=null}}static{this.styles=u`: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 g`<mq-button variant="primary" fullwidth noPadding @click="${()=>{this.dispatchEvent(new CustomEvent("toggle-chat",{bubbles:!0,composed:!0}))}}">${T({size:24})} ${a("Chat")} ${this.unreadCount>0?g`<mq-unread-badge></mq-unread-badge>`:v}</mq-button>`}renderNextActions(){return g`${this.isVideocall?g`<mq-button variant="outline" fullwidth noPadding @click="${()=>{R.track(O(this.patientHash,this.appointmentId)),this.dispatchEvent(new H({appointmentId:this.appointmentId}))}}">${B({size:24})} ${a("Ir a videollamada")}</mq-button>`:v}<div class="actions-secondary">${this.hasChatSupport?this.renderChatButton():v}<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 g`${this.hasChatSupport?this.renderChatButton():v}<mq-button variant="outline" fullwidth noPadding @click="${()=>{R.track(E(this.patientHash,this.appointmentId)),this.dispatchEvent(new N({appointmentId:this.appointmentId}))}}">${a("Documentos")}</mq-button><mq-button variant="outline" fullwidth noPadding @click="${this.handleRepeatClick}">${a("Repetir")}</mq-button>`}render(){return g`<div class="${A({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>`}};function G(t){const{action:e,refundPolicySeconds:i}=t,n=null!=i&&i<3600,s=Math.ceil((i??0)/60),p=Math.ceil((i??0)/3600);return a(0===(n?s:p)?"modify"===e?"Esta cita ya ha pasado, por lo que no se puede modificar.":"Esta cita ya ha pasado, por lo que no se puede anular.":"modify"===e?n?o`Lo sentimos, como faltan menos de ${s} minutos para tu cita no podemos modificarla.`:o`Lo sentimos, como faltan menos de ${p} horas para tu cita no podemos modificarla.`:n?o`Lo sentimos, como faltan menos de ${s} minutos para tu cita no podemos anularla.`:o`Lo sentimos, como faltan menos de ${p} horas para tu cita no podemos anularla.`)}t([i({context:k})],L.prototype,"loginToken",void 0),t([f({type:String})],L.prototype,"variant",void 0),t([f({type:String})],L.prototype,"appointmentId",void 0),t([f({type:Boolean})],L.prototype,"isVideocall",void 0),t([f({type:Boolean})],L.prototype,"hasChatSupport",void 0),t([f({type:Number})],L.prototype,"unreadCount",void 0),t([f({type:Boolean})],L.prototype,"isModifyUnavailable",void 0),t([f({type:Boolean})],L.prototype,"isCancelUnavailable",void 0),t([f({type:Boolean})],L.prototype,"hasNoSlots",void 0),t([f({type:String})],L.prototype,"modifyUnavailableMessage",void 0),t([f({type:String})],L.prototype,"cancelUnavailableMessage",void 0),t([f({type:Object})],L.prototype,"repeatTarget",void 0),t([f({type:String})],L.prototype,"professionalHash",void 0),t([y()],L.prototype,"openDialog",void 0),L=t([n(),e("appointment-card-actions")],L);let X=class AppointmentCard extends m{constructor(){super(...arguments),this.variant="next",this.detailsVariant="wide",this.isChatOpen=!1,this.isCancelDialogOpen=!1,this.unreadQuery=new s(this,()=>h($,{roomId:this.appointmentResource?.room?.id})),this.getOrganizationSpecialtiesQuery=new s(this,()=>r($,{enabled:!!this.appointmentResource?.speciality?.id})),this.getOrganizationSetupQuery=new s(this,()=>p($)),this.getScheduleServicesQuery=new s(this,()=>c($))}static{this.styles=u`: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===C.videocall,e=this.appointmentResource.appointment.channel===C.phonecall,i=!0===this.getOrganizationSetupQuery.result?.data?.appointments?.has_chat_in_appointment,o=(t||e)&&i,n=b(),s=x(this.appointmentResource.appointment.expires_at),p=0===this.appointmentResource.slots.length,r=this.getOrganizationSetupQuery.result?.data?.appointments?.seconds_before_start_to_refund_on_cancel,c=d({startsAtIso:this.appointmentResource.appointment.starts_at,refundPolicySeconds:r}),h=s||p||!c,m=s||!c,u=G({action:"modify",refundPolicySeconds:r}),f=G({action:"cancel",refundPolicySeconds:r}),y=this.getOrganizationSpecialtiesQuery.result?.data?.find(t=>Number(t.id)===Number(this.appointmentResource.speciality.id)),$=l(y?.code??"",n,y?.name??this.appointmentResource.speciality.name),q=this.getScheduleServicesQuery.result?.data?.find(t=>t.id===this.appointmentResource.appointment.service_id)?.code,w=y?.code&&q?{specialty:y.code,service:q}:null;return g`<mq-card class="card" roundness="md"><div class="card-top-content"><professional-overview .specialtyName="${$??""}" .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="${h}" .isCancelUnavailable="${m}" .hasNoSlots="${p}" .modifyUnavailableMessage="${u}" .cancelUnavailableMessage="${f}" .repeatTarget="${w}" .professionalHash="${this.appointmentResource.professional.hash}" @toggle-chat="${()=>{this.isChatOpen=!this.isChatOpen,this.isChatOpen&&R.track(z(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?g`<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>`:v}</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,P.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([f({type:Object})],X.prototype,"appointmentResource",void 0),t([f({type:Number})],X.prototype,"specialtyId",void 0),t([f({type:String})],X.prototype,"variant",void 0),t([f({type:String})],X.prototype,"detailsVariant",void 0),t([i({context:k})],X.prototype,"loginToken",void 0),t([y()],X.prototype,"isChatOpen",void 0),t([y()],X.prototype,"isCancelDialogOpen",void 0),X=t([n(),e("appointment-card")],X);let Z=class AppointmentCardSkeleton extends m{static{this.styles=u`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 g`<div></div>`}};Z=t([e("appointment-card-skeleton")],Z);export{Q as g};
@@ -1 +0,0 @@
1
- import{z as e}from"./external-CJj32K_p.js";var r=e.enum(["ordinary","system"]).enum;function s(e,r,s){return{queryKey:["unread-messages",r],queryFn:()=>e.rooms.getUnreadMessagesCount(r),staleTime:0,...s}}export{r as S,s as g};
@@ -1 +0,0 @@
1
- function e(e,s,o){return{queryKey:["professionals",s.hash],queryFn:()=>e.professionals.getProfessional(s),staleTime:0,...o}}export{e as g};
@@ -1 +0,0 @@
1
- import{s as t}from"./context-consumer-ESdICVAb.js";function c({context:c,subscribe:e}){return(n,i)=>{"object"==typeof i?i.addInitializer(function(){new t(this,{context:c,callback:t=>{n.set.call(this,t)},subscribe:e})}):n.constructor.addInitializer(n=>{new t(n,{context:c,callback:t=>{n[i]=t},subscribe:e})})}}export{c};
@@ -1 +0,0 @@
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,C as r,b as l,i as d}from"./api-chat-client-BBL1U9EQ.js";import{t as c,d as m,a as p,b as h,c as u}from"./telemetry-client-BLJVs9me.js";import{a as g,i as f,E as v,x as y}from"./lit-element-DiWJYFwC.js";import{n as b}from"./property-scuRaFcM.js";import{getLocale as x}from"../i18n.js";import{calendarIcon as $}from"../ui/icons/calendar-icon.js";import{clockIcon as k}from"../ui/icons/clock-icon.js";import{r as w}from"./state-LQivXIgA.js";import{infoCircleOutineIcon as z}from"../ui/icons/info-circle-outine-icon.js";import"../ui/mq-button.js";import{l as q}from"./chunk-S5RWG6G2-DPesx3Od.js";import{messageBubbleIcon as j}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 _}from"./consume-CovVqBjI.js";import{Q as C}from"./query-controller-BlO1Ax65.js";import{g as O}from"./chunk-GZF3YFSX-DM-GTqxg.js";import"../ui/mq-page-title.js";import"./index-KvIw19qY.js";import{M as S}from"./mutation-controller-CR2qcqhH.js";import{g as T}from"./get-organization-setup-query-BMbuRi6v.js";import{g as I,a as D}from"./i18n-formats-DYS91YEa.js";import{MqViewAppointmentsEvent as Q}from"../events.js";let E=class ChatCta extends g{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 C(this,()=>O(s,{roomId:this.roomId}))}static{this.styles=[f`.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 y`<mq-card class="chat-cta" roundness="md"><div class="cta-message">${z({size:24})} <span>${this.text}</span></div><mq-button variant="primary" size="md" fullwidth @click="${()=>{this.isChatOpen=!this.isChatOpen,this.isChatOpen&&this.onOpenChat?.()}}">${j({size:24})} ${i("Chatea con el profesional")} ${(this.unreadQuery.result?.data?.unread_count??0)>0?y`<mq-unread-badge></mq-unread-badge>`:v}</mq-button></mq-card><mq-floating-bubble ?dismissable="${!1}" .open="${this.isChatOpen}" @mq-close="${()=>{this.isChatOpen=!1}}" hideCloseButton>${this.isChatOpen?y`<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>`:v}</mq-floating-bubble>`}};t([b({type:Number})],E.prototype,"roomId",void 0),t([b({type:String})],E.prototype,"professionalHash",void 0),t([b({type:String})],E.prototype,"text",void 0),t([b({type:String})],E.prototype,"consultationId",void 0),t([b({type:Boolean,reflect:!0})],E.prototype,"readonly",void 0),t([b({attribute:!1})],E.prototype,"onOpenChat",void 0),t([_({context:q})],E.prototype,"loginToken",void 0),t([w()],E.prototype,"isChatOpen",void 0),E=t([o(),e("chat-cta")],E);let F=class PageLayout extends g{constructor(){super(...arguments),this.yCentered=!1,this.background="solid"}static{this.styles=f`: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 y`<div><main><slot></slot></main></div>`}};t([b({type:Boolean,attribute:"y-centered"})],F.prototype,"yCentered",void 0),t([b({type:String})],F.prototype,"background",void 0),F=t([e("page-layout")],F);const B=f`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 G=class DocumentationView extends g{constructor(){super(...arguments),this.canReconnect=!1,this._sharedocumentsTask=new a(this,{task:async([t])=>await s.flash.getSharedDocuments({appointment_id:t}),args:()=>[this.appointment.id]}),this.getOrganizationSpecialtiesQuery=new C(this,()=>I(s)),this.getOrganizationSetupQuery=new C(this,()=>T(s)),this._reconnectMutation=new S(this,{mutationFn:t=>s.appointments.reconnectAppointment(t),onSuccess:()=>{this.dispatchEvent(new CustomEvent("reconnect",{bubbles:!0,composed:!0}))}})}static{this.styles=B}firstUpdated(){c.track(m(this.loginToken.patient.hash,this.appointment.id??""))}render(){const t=!0===this.getOrganizationSetupQuery.result?.data?.appointments?.has_chat_in_appointment,e=x(),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}),g=new Date(this.appointment.start_date),f=p(g,this.appointment.duration),b=a?l(a,g):"";return y`<mq-page-title .title="${i("Consulta finalizada")}" back-label="${i("Salir")}" @mq-back="${t=>{t.stopPropagation(),this.dispatchEvent(new Q({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>${$()}</dt><dd>${r.format(g)}</dd></div><div class="description-list-item"><dt>${k()}</dt><dd>${m.format(g)} - ${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:()=>y`<div class="document-item-skeleton"></div>`,complete:()=>0===this._sharedocumentsTask?.value?.length?y`<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=>y`<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 D(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="${()=>{c.track(h(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?y`<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>`:v} ${t?y`<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="${d(this.appointment.expires_at)}" .onOpenChat="${()=>{c.track(u(this.loginToken.patient.hash,this.appointment.id??""))}}"></chat-cta>`:v}</div>`}};t([b({type:Object})],G.prototype,"appointment",void 0),t([b({type:String})],G.prototype,"token",void 0),t([b({type:Boolean,attribute:"can-reconnect"})],G.prototype,"canReconnect",void 0),t([_({context:q})],G.prototype,"loginToken",void 0),G=t([o(),e("documentation-view")],G);
@@ -1 +0,0 @@
1
- function n(n,t,e){return{queryKey:["appointments",t.id],queryFn:()=>n.appointments.getAppointment(t),...e}}export{n as g};
@@ -1 +0,0 @@
1
- function n(n,t){return{queryKey:["organization-setup"],queryFn:()=>n.organizations.getOrganizationSetup(),...t}}export{n as g};
@@ -1 +0,0 @@
1
- function e(e,t){return{queryKey:["patient-documents",t],queryFn:()=>e.flash.getPatientDocuments(t)}}export{e as g};
@@ -1 +0,0 @@
1
- function e(e,r){return{queryKey:["patient-profile"],queryFn:()=>e.profile.getPatientProfile(),...r}}export{e as g};
@@ -1 +0,0 @@
1
- function o(o,a){return{queryKey:["organization-specialties"],queryFn:()=>o.organizations.getOrganizationSpecialties(),...a}}var a={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"}},e={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"}},i={de_DE:"Konsultationspreis",en_US:"Consultation price",es_ES:"Precio de consulta",ca_ES:"Preu de consulta",pt_PT:"Preço da consulta"},n={videocall:"videocall",phonecall:"phonecall",adeslas_videocall:"videocall",adeslas_prod_videocall:"videocall",adeslas_phonecall:"phonecall",adeslas_prod_phonecall:"phonecall"};function t(o,a,t){if(!o)return t??"";const l=n[o];return l?e[l][a]:t??i[a]}var l={consulta_telefonica:"phonecall",videoconsulta:"videocall"},c={"aparato-digestivo":"digestive_system","cirugia-ortopedica-y-traumatologia":"orthopedic_surgery_traumatology",ginecologia:"gynecology",endocrinologia:"endocrinology",psiquiatria:"psychiatry"};function r(o,e,i){const n=i?.trim();if(n)return n;const t=a[o]?.[e];return void 0!==t?t:o}export{l as S,r as a,c as b,t as c,a as d,o as g};
@@ -1 +0,0 @@
1
- import{_ as t,c as e}from"./custom-element-D2ziPxYE.js";import{i as o,a as i,x as r}from"./lit-element-DiWJYFwC.js";import{n}from"./property-scuRaFcM.js";import{r as a}from"./state-LQivXIgA.js";import{downloadIcon as s}from"../ui/icons/download-icon.js";import"../ui/mq-button.js";import{m as l}from"./runtime-Bg1WXVCx.js";import{l as d}from"./localized-decorator-BlOuLhym.js";import{a as p,D as c}from"./api-chat-client-BBL1U9EQ.js";import{DownloadFileEvent as m}from"../events.js";import{getLocale as f}from"../i18n.js";const h=o`:host{display:flex;justify-content:space-between;align-items:center;gap:var(--sp-4);width:100%}.left{display:flex;flex-direction:column;gap:var(--sp-1);flex:1;min-width:0}.tag{border-radius:var(--border-radius-sm);display:inline-flex;align-items:center;justify-content:center;padding:var(--sp-0_5) var(--sp-2);background-color:#e5e5e5;width:fit-content}.tag-label{font-family:var(--font-body);font-size:11px;font-weight:var(--font-weight-medium);color:var(--color-neutrals-text-default);text-transform:uppercase;letter-spacing:3px;line-height:normal}.title{font-family:var(--font-body);font-size:var(--text-sm);font-weight:var(--font-weight-bold);color:var(--color-neutrals-text-default);line-height:normal;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.description{font-family:var(--font-body);font-size:var(--text-sm);font-weight:var(--font-weight-normal);color:var(--color-neutrals-text-default);line-height:normal;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}`;let u=class PatientDocument extends i{constructor(){super(...arguments),this.isDownloading=!1}static{this.styles=h}getFormatter(){const t=f().replace("_","-");return new Intl.DateTimeFormat(t,{year:"numeric",month:"numeric",day:"numeric"})}async _handleDownload(){this.isDownloading=!0;const t=await p.flash.downloadDocument({url:this.downloadUrl}),e=await async function(t){return new Promise((e,o)=>{const i=new FileReader;i.onloadend=()=>e(i.result),i.onerror=o,i.readAsDataURL(t)})}(t);this.dispatchEvent(new m({url:e,filename:`${this.filename}.pdf`})),this.isDownloading=!1}formatKind(t){switch(t){case c.prescription:return l("Receta");case c.report:return l("Informe");case c.diagnosticTestPrescription:return l("Prescripción")}}render(){const t=this.getFormatter().format(new Date(this.date));return r`<div class="left"><div class="tag"><span class="tag-label">${this.formatKind(this.kind)}</span></div><div class="title">${t} - ${this.specialty}</div><div class="description">${this.description}</div></div><mq-button variant="ghost" size="icon-lg" @click="${this._handleDownload}" ?disabled="${this.isDownloading}">${s({size:24})}</mq-button>`}};t([n({type:String})],u.prototype,"kind",void 0),t([n({type:String})],u.prototype,"filename",void 0),t([n({type:String})],u.prototype,"specialty",void 0),t([n({type:String})],u.prototype,"description",void 0),t([n({type:String})],u.prototype,"date",void 0),t([n({type:String})],u.prototype,"downloadUrl",void 0),t([a()],u.prototype,"isDownloading",void 0),u=t([d(),e("patient-document")],u);
@@ -1 +0,0 @@
1
- import{_ as t,c as e}from"./custom-element-D2ziPxYE.js";import{E as s,i,a as o,x as n}from"./lit-element-DiWJYFwC.js";import{n as r}from"./property-scuRaFcM.js";import{r as l}from"./state-LQivXIgA.js";import{e as a}from"./class-map-Co76I6aw.js";import{i as d,t as c,e as p}from"./directive-2EDmOukv.js";import{o as v}from"./style-map-CIdqdn7C.js";import"../ui/mq-text-button.js";const u=(t,e)=>{const s=t._$AN;if(void 0===s)return!1;for(const t of s)t._$AO?.(e,!1),u(t,e);return!0},m=t=>{let e,s;do{if(void 0===(e=t._$AM))break;s=e._$AN,s.delete(t),t=e}while(0===s?.size)},x=t=>{for(let e;e=t._$AM;t=e){let s=e._$AN;if(void 0===s)e._$AN=s=new Set;else if(s.has(t))break;s.add(t),g(e)}};function $(t){void 0!==this._$AN?(m(this),this._$AM=t,x(this)):this._$AM=t}function b(t,e=!1,s=0){const i=this._$AH,o=this._$AN;if(void 0!==o&&0!==o.size)if(e)if(Array.isArray(i))for(let t=s;t<i.length;t++)u(i[t],!1),m(i[t]);else null!=i&&(u(i,!1),m(i));else u(this,t)}const g=t=>{t.type==c.CHILD&&(t._$AP??=b,t._$AQ??=$)};class f extends d{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,s){super._$AT(t,e,s),x(this),this.isConnected=t._$AU}_$AO(t,e=!0){t!==this.isConnected&&(this.isConnected=t,t?this.reconnected?.():this.disconnected?.()),e&&(u(this,t),m(this))}setValue(t){if((t=>void 0===t.strings)(this._$Ct))this._$Ct._$AI(t,this);else{const e=[...this._$Ct._$AH];e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}disconnected(){}reconnected(){}}class h{}const _=new WeakMap,A=p(class extends f{render(t){return s}update(t,[e]){const i=e!==this.G;return i&&void 0!==this.G&&this.rt(void 0),(i||this.lt!==this.ct)&&(this.G=e,this.ht=t.options?.host,this.rt(this.ct=t.element)),s}rt(t){if(this.isConnected||(t=void 0),"function"==typeof this.G){const e=this.ht??globalThis;let s=_.get(e);void 0===s&&(s=new WeakMap,_.set(e,s)),void 0!==s.get(this.G)&&this.G.call(this.ht,void 0),s.set(this.G,t),void 0!==t&&this.G.call(this.ht,t)}else this.G.value=t}get lt(){return"function"==typeof this.G?_.get(this.ht??globalThis)?.get(this.G):this.G?.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}}),y=i`:host{display:flex;flex-direction:column;gap:var(--sp-1)}.text{margin:0}.text.is-clamped{display:-webkit-box;-webkit-box-orient:vertical;overflow:hidden}.toggle{align-self:flex-start}`;let w=class MqClampedText extends o{constructor(){super(...arguments),this.lines=2,this.expandLabel="",this.collapseLabel="",this.expanded=!1,this.overflowing=!1,this.textRef=new h,this.measure=()=>{const t=this.textRef.value;if(!t||this.expanded)return;const e=t.scrollHeight-t.clientHeight>1;e!==this.overflowing&&(this.overflowing=e)}}static{this.styles=y}updated(){const t=this.textRef.value;t&&!this.resizeObserver&&(this.resizeObserver=new ResizeObserver(()=>this.measure()),this.resizeObserver.observe(t)),this.measure()}disconnectedCallback(){super.disconnectedCallback(),this.resizeObserver?.disconnect(),this.resizeObserver=void 0}render(){return n`<div ${A(this.textRef)} class="text ${a({"is-clamped":!this.expanded})}" style="${v({"-webkit-line-clamp":this.expanded?"":String(this.lines)})}"><slot @slotchange="${this.measure}"></slot></div>${this.expanded||this.overflowing?n`<mq-text-button class="toggle" type="button" size="sm" fontWeight="normal" underlined @click="${()=>{this.expanded=!this.expanded}}">${this.expanded?this.collapseLabel:this.expandLabel}</mq-text-button>`:s}`}};t([r({type:Number})],w.prototype,"lines",void 0),t([r({type:String,attribute:"expand-label"})],w.prototype,"expandLabel",void 0),t([r({type:String,attribute:"collapse-label"})],w.prototype,"collapseLabel",void 0),t([l()],w.prototype,"expanded",void 0),t([l()],w.prototype,"overflowing",void 0),w=t([e("mq-clamped-text")],w);export{w as M,f};
@@ -1 +0,0 @@
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{b as n}from"./api-chat-client-BBL1U9EQ.js";import{a as r}from"./telemetry-client-BLJVs9me.js";import{i as a,a as s,E as l,x as m}from"./lit-element-DiWJYFwC.js";import{n as p}from"./property-scuRaFcM.js";import{e as c}from"./class-map-Co76I6aw.js";import{getLocale as h}from"../i18n.js";import{briefcaseIcon as d}from"../ui/icons/briefcase-icon.js";import{calendarIcon as u}from"../ui/icons/calendar-icon.js";import{clockIcon as f}from"../ui/icons/clock-icon.js";import{messageBubbleIcon as v}from"../ui/icons/message-bubble-icon.js";import{phoneIcon as w}from"../ui/icons/phone-icon.js";const y=a`.appointment-details{display:flex;flex-direction:column;gap:var(--sp-3)}.detail-row{display:inline-flex;width:fit-content;align-items:center;gap:var(--sp-2);color:var(--color-neutrals-text-default);font-family:var(--font-body);font-size:var(--text-sm);line-height:var(--text-sm--line-height);font-weight:var(--font-weight-bold)}.detail-row svg{flex-shrink:0}.detail-row span::first-letter{text-transform:uppercase}.detail-row.full-width{width:100%}:host([strike-through]) .detail-row span{text-decoration:line-through}@media (min-width:768px){.appointment-details.wide{flex-direction:row;flex-wrap:wrap}}`;let g=class AppointmentDetails extends s{constructor(){super(...arguments),this.channel=void 0,this.variant="default",this.strikeThrough=!1,this.timezone=void 0,this._appointmentChannelToLabel=t=>{switch(t){case"videocall":return i("Videoconsulta");case"chat":return i("Chat");case"phonecall":return i("Consulta telefónica");default:return""}},this._appointmentChannelToIcon=t=>{switch(t){case"videocall":return d({size:24});case"chat":return v({size:24});case"phonecall":return w({size:24});default:return l}}}static{this.styles=y}render(){const t=h().replace("_","-"),e=new Intl.DateTimeFormat(t,{weekday:"long",year:"numeric",month:"long",day:"numeric",...this.timezone?{timeZone:this.timezone}:{}}),i=new Intl.DateTimeFormat(t,{timeStyle:"short",...this.timezone?{timeZone:this.timezone}:{}}),o=new Date(this.startsAt),a=r(o,this.duration),s=e.format(o),p=i.format(o),d=i.format(a),v=this.timezone?n(this.timezone,o):"";return m`<div class="${c({"appointment-details":!0,wide:"wide"===this.variant})}"><div class="detail-row">${u({size:24})} <span>${s}</span></div><div class="detail-row">${f({size:24})} <span>${p} - ${d}${v?` (${v})`:""}</span></div>${this.channel?m`<div class="detail-row full-width">${this._appointmentChannelToIcon(this.channel)} <span>${this._appointmentChannelToLabel(this.channel)}</span></div>`:l}</div>`}};function x(t){return t/100}function z(t,e){const i=e.replaceAll("_","-");return new Intl.NumberFormat(i,{style:"currency",currency:t.currency}).format(x(t.amount))}function j(t){return null!=t&&t.amount>0}t([p({type:String})],g.prototype,"startsAt",void 0),t([p({type:Number})],g.prototype,"duration",void 0),t([p({type:String})],g.prototype,"channel",void 0),t([p({type:String})],g.prototype,"variant",void 0),t([p({type:Boolean,attribute:"strike-through"})],g.prototype,"strikeThrough",void 0),t([p({type:String})],g.prototype,"timezone",void 0),g=t([o(),e("appointment-details")],g);export{g as A,x as c,z as f,j as h};
@@ -1 +0,0 @@
1
- import{Q as t}from"./chunk-RCFIJTXZ-C6Ir0-sM.js";import{s as e}from"./context-consumer-ESdICVAb.js";import{S as s,p as r,r as i,s as n,a as u,n as a,i as h,b as o,t as c,c as l,f as d,d as p,e as f,g as y}from"./query-Cjvi4_dT.js";var b=class extends s{constructor(t,e){super(),this.options=e,this.#t=t,this.#e=null,this.#s=r(),this.bindMethods(),this.setOptions(e)}#t;#r=void 0;#i=void 0;#n=void 0;#u;#a;#s;#e;#h;#o;#c;#l;#d;#p;#f=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){1===this.listeners.size&&(this.#r.addObserver(this),R(this.#r,this.options)?this.#y():this.updateResult(),this.#b())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return v(this.#r,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return v(this.#r,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#R(),this.#v(),this.#r.removeObserver(this)}setOptions(t){const e=this.options,s=this.#r;if(this.options=this.#t.defaultQueryOptions(t),void 0!==this.options.enabled&&"boolean"!=typeof this.options.enabled&&"function"!=typeof this.options.enabled&&"boolean"!=typeof i(this.options.enabled,this.#r))throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");this.#Q(),this.#r.setOptions(this.options),e._defaulted&&!n(this.options,e)&&this.#t.getQueryCache().notify({type:"observerOptionsUpdated",query:this.#r,observer:this});const r=this.hasListeners();r&&Q(this.#r,s,this.options,e)&&this.#y(),this.updateResult(),!r||this.#r===s&&i(this.options.enabled,this.#r)===i(e.enabled,this.#r)&&u(this.options.staleTime,this.#r)===u(e.staleTime,this.#r)||this.#m();const a=this.#I();!r||this.#r===s&&i(this.options.enabled,this.#r)===i(e.enabled,this.#r)&&a===this.#p||this.#O(a)}getOptimisticResult(t){const e=this.#t.getQueryCache().build(this.#t,t),s=this.createResult(e,t);return function(t,e){if(!n(t.getCurrentResult(),e))return!0;return!1}(this,s)&&(this.#n=s,this.#a=this.options,this.#u=this.#r.state),s}getCurrentResult(){return this.#n}trackResult(t,e){return new Proxy(t,{get:(t,s)=>(this.trackProp(s),e?.(s),"promise"!==s||this.options.experimental_prefetchInRender||"pending"!==this.#s.status||this.#s.reject(new Error("experimental_prefetchInRender feature flag is not enabled")),Reflect.get(t,s))})}trackProp(t){this.#f.add(t)}getCurrentQuery(){return this.#r}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const e=this.#t.defaultQueryOptions(t),s=this.#t.getQueryCache().build(this.#t,e);return s.fetch().then(()=>this.createResult(s,e))}fetch(t){return this.#y({...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#n))}#y(t){this.#Q();let e=this.#r.fetch(this.options,t);return t?.throwOnError||(e=e.catch(a)),e}#m(){this.#R();const t=u(this.options.staleTime,this.#r);if(h||this.#n.isStale||!o(t))return;const e=c(this.#n.dataUpdatedAt,t)+1;this.#l=l.setTimeout(()=>{this.#n.isStale||this.updateResult()},e)}#I(){return("function"==typeof this.options.refetchInterval?this.options.refetchInterval(this.#r):this.options.refetchInterval)??!1}#O(t){this.#v(),this.#p=t,!h&&!1!==i(this.options.enabled,this.#r)&&o(this.#p)&&0!==this.#p&&(this.#d=l.setInterval(()=>{(this.options.refetchIntervalInBackground||d.isFocused())&&this.#y()},this.#p))}#b(){this.#m(),this.#O(this.#I())}#R(){this.#l&&(l.clearTimeout(this.#l),this.#l=void 0)}#v(){this.#d&&(l.clearInterval(this.#d),this.#d=void 0)}createResult(t,e){const s=this.#r,n=this.options,u=this.#n,a=this.#u,h=this.#a,o=t!==s?t.state:this.#i,{state:c}=t;let l,d={...c},y=!1;if(e._optimisticResults){const r=this.hasListeners(),i=!r&&R(t,e),u=r&&Q(t,s,e,n);(i||u)&&(d={...d,...p(c.data,t.options)}),"isRestoring"===e._optimisticResults&&(d.fetchStatus="idle")}let{error:b,errorUpdatedAt:v,status:I}=d;l=d.data;let O=!1;if(void 0!==e.placeholderData&&void 0===l&&"pending"===I){let t;u?.isPlaceholderData&&e.placeholderData===h?.placeholderData?(t=u.data,O=!0):t="function"==typeof e.placeholderData?e.placeholderData(this.#c?.state.data,this.#c):e.placeholderData,void 0!==t&&(I="success",l=f(u?.data,t,e),y=!0)}if(e.select&&void 0!==l&&!O)if(u&&l===a?.data&&e.select===this.#h)l=this.#o;else try{this.#h=e.select,l=e.select(l),l=f(u?.data,l,e),this.#o=l,this.#e=null}catch(t){this.#e=t}this.#e&&(b=this.#e,l=this.#o,v=Date.now(),I="error");const g="fetching"===d.fetchStatus,w="pending"===I,C="error"===I,S=w&&g,T=void 0!==l,F={status:I,fetchStatus:d.fetchStatus,isPending:w,isSuccess:"success"===I,isError:C,isInitialLoading:S,isLoading:S,data:l,dataUpdatedAt:d.dataUpdatedAt,error:b,errorUpdatedAt:v,failureCount:d.fetchFailureCount,failureReason:d.fetchFailureReason,errorUpdateCount:d.errorUpdateCount,isFetched:d.dataUpdateCount>0||d.errorUpdateCount>0,isFetchedAfterMount:d.dataUpdateCount>o.dataUpdateCount||d.errorUpdateCount>o.errorUpdateCount,isFetching:g,isRefetching:g&&!w,isLoadingError:C&&!T,isPaused:"paused"===d.fetchStatus,isPlaceholderData:y,isRefetchError:C&&T,isStale:m(t,e),refetch:this.refetch,promise:this.#s,isEnabled:!1!==i(e.enabled,t)};if(this.options.experimental_prefetchInRender){const e=t=>{"error"===F.status?t.reject(F.error):void 0!==F.data&&t.resolve(F.data)},i=()=>{const t=this.#s=F.promise=r();e(t)},n=this.#s;switch(n.status){case"pending":t.queryHash===s.queryHash&&e(n);break;case"fulfilled":"error"!==F.status&&F.data===n.value||i();break;case"rejected":"error"===F.status&&F.error===n.reason||i()}}return F}updateResult(){const t=this.#n,e=this.createResult(this.#r,this.options);if(this.#u=this.#r.state,this.#a=this.options,void 0!==this.#u.data&&(this.#c=this.#r),n(e,t))return;this.#n=e;this.#g({listeners:(()=>{if(!t)return!0;const{notifyOnChangeProps:e}=this.options,s="function"==typeof e?e():e;if("all"===s||!s&&!this.#f.size)return!0;const r=new Set(s??this.#f);return this.options.throwOnError&&r.add("error"),Object.keys(this.#n).some(e=>{const s=e;return this.#n[s]!==t[s]&&r.has(s)})})()})}#Q(){const t=this.#t.getQueryCache().build(this.#t,this.options);if(t===this.#r)return;const e=this.#r;this.#r=t,this.#i=t.state,this.hasListeners()&&(e?.removeObserver(this),t.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#b()}#g(t){y.batch(()=>{t.listeners&&this.listeners.forEach(t=>{t(this.#n)}),this.#t.getQueryCache().notify({query:this.#r,type:"observerResultsUpdated"})})}};function R(t,e){return function(t,e){return!1!==i(e.enabled,t)&&void 0===t.state.data&&!("error"===t.state.status&&!1===e.retryOnMount)}(t,e)||void 0!==t.state.data&&v(t,e,e.refetchOnMount)}function v(t,e,s){if(!1!==i(e.enabled,t)&&"static"!==u(e.staleTime,t)){const r="function"==typeof s?s(t):s;return"always"===r||!1!==r&&m(t,e)}return!1}function Q(t,e,s,r){return(t!==e||!1===i(r.enabled,t))&&(!s.suspense||"error"!==t.state.status)&&m(t,s)}function m(t,e){return!1!==i(e.enabled,t)&&t.isStaleByTime(u(e.staleTime,t))}Promise.withResolvers||(Promise.withResolvers=function(){let t,e;const s=new this((s,r)=>{t=s,e=r});return{resolve:t,reject:e,promise:s}});var I=class{constructor(s,r,i){this.host=s,this.optionsFn=r,this._queryClient=i,this.whenQueryClient=Promise.withResolvers(),this.whenQueryObserver=Promise.withResolvers(),this.host.addController(this),this.context=new e(this.host,{context:t,subscribe:!0,callback:t=>{t&&(this.queryClient=t)}}),this.optionsFn&&this.observeQuery(this.optionsFn)}set queryClient(t){this._queryClient=t,t&&this.whenQueryClient.resolve(t),this.host.requestUpdate()}get queryClient(){return this._queryClient}async observeQuery(t,e=!0){const s=await this.whenQueryClient.promise,r=await this.getDefaultedOptions("function"==typeof t?t():t);this.queryObserver=new b(s,r),this.result=e?this.queryObserver.getOptimisticResult(r):void 0,this.host.requestUpdate(),this.whenQueryObserver.resolve(this.queryObserver)}async hostUpdate(){if(this.optionsFn){const t=await this.whenQueryObserver.promise,e=await this.getDefaultedOptions(this.optionsFn());t.setOptions(e)}}hostConnected(){this.subscribe()}async subscribe(){const t=await this.whenQueryObserver.promise;this.unsubscribe?.(),this.unsubscribe=t.subscribe(t=>{this.result=t,this.host.requestUpdate()}),t.updateResult(),this.host.requestUpdate()}hostDisconnected(){this.unsubscribe?.(),this.unsubscribe=void 0}async getDefaultedOptions(t){return(await this.whenQueryClient.promise).defaultQueryOptions(t)}render(t){const e=this.result;return"pending"!==e?.status||"idle"!==e?.fetchStatus||e?.data?e?.isPending?t.pending?.()??null:e?.isError?t.error?.(e?.error)??null:e?.isSuccess?t.complete(e?.data):t.initial?.()??null:t.initial?.()??null}};export{I as Q};
@@ -1 +0,0 @@
1
- import{g as e}from"./api-chat-client-BBL1U9EQ.js";import{t}from"./parseISO-Dj3qSTG8.js";function n(e,n,r){const s=function(e,n){return+t(e)-+t(n)}(e,n)/1e3;return(c=r?.roundingMethod,e=>{const t=(c?Math[c]:Math.trunc)(e);return 0===t?0:t})(s);var c}function r(e){return{queryKey:["schedule-services"],queryFn:()=>e.schedules.getScheduleServices()}}function s(t){const{startsAtIso:r,refundPolicySeconds:s,now:c=new Date}=t,o=n(e(r),c);return!(o<0)&&(null==s||o>=s)}export{s as c,r as g};
@@ -1 +0,0 @@
1
- import{c as t,t as e}from"./parseISO-Dj3qSTG8.js";function n(n,i,a){return function(n,i){return t(n,+e(n)+i)}(n,1e3*i)}function i(t,e){return{action_type:"event",event_type:"access to videocall button click",patient_hash:t,id_appointment:e}}function a(t,e){return{action_type:"event",event_type:"open chat button click",patient_hash:t,id_appointment:e}}function p(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 s(t,e){return{action_type:"event",event_type:"view appointment document list button click",patient_hash:t,id_appointment:e}}function c(t,e){return{action_type:"event",event_type:"repeat appointment button click",patient_hash:t,id_appointment:e}}function _(t,e){return{action_type:"event",event_type:"open chat button click",patient_hash:t,id_appointment:e}}function r(t,e){return{action_type:"event",event_type:"access to videocall button click",patient_hash:t,id_appointment:e}}function u(t,e){return{action_type:"event",event_type:"add to calendar button click",patient_hash:t,id_appointment:e}}function h(t,e){return{action_type:"pageview",event_type:"appointment success page view",patient_hash:t,id_appointment:e}}function y(t,e){return{action_type:"event",event_type:"open chat button click",patient_hash:t,id_appointment:e}}function l(t,e){return{action_type:"event",event_type:"update documentation",patient_hash:t,id_appointment:e}}function v(t,e){return{action_type:"pageview",event_type:"documentation page view",patient_hash:t,id_appointment:e}}function d(t){return{action_type:"event",event_type:"view documentation list button click",patient_hash:t}}function f(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 b(t){return{action_type:"pageview",event_type:"home page view",patient_hash:t}}function k(t,e,n){return{action_type:"event",event_type:"find availability button click",patient_hash:t,speciality_id:e,service_id:n}}function w(t,e,n,i,a,p,o){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:p,total_slots:o}}function g(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 T(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 K(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 C(t){return{action_type:"pageview",event_type:"select professional step page view",patient_hash:t}}function q(t,e){return{action_type:"pageview",event_type:"not time yet pageview",patient_hash:t,id_appointment:e}}function x(t,e){return{action_type:"event",event_type:"open chat button click",patient_hash:t,id_appointment:e}}function j(t,e){return{action_type:"pageview",event_type:"waiting room pageview",patient_hash:t,id_appointment:e}}function A(t,e){return{action_type:"pageview",event_type:"videocall pageview",patient_hash:t,id_appointment:e}}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 O=new class AppTelemetryClient extends MediquoTelemetryClient{track(t){}};export{x as A,j as B,A as C,n as a,l as b,y as c,v as d,h as e,u as f,_ as g,r as h,b as i,p as j,o as k,c as l,f as m,i as n,s as o,a as p,k as q,d as r,K as s,O as t,g as u,m as v,T as w,w as x,C as y,q as z};