@mediquo/elements 0.3.1 → 0.4.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.
- package/README.md +166 -15
- package/dist/chunks/{api-chat-client-BTBtu01T.js → api-chat-client-C8SqZtCa.js} +1 -1
- package/dist/chunks/{apple-pay-outcomes-BlytM6W-.js → apple-pay-outcomes-BNkcTbbM.js} +1 -1
- package/dist/chunks/create-component-BB-6Gu6l.js +1 -0
- package/dist/chunks/exports-G_7Ih_GH.js +1 -0
- package/dist/chunks/{index-B9iWdvW3.js → index-BJcdB5MT.js} +1 -1
- package/dist/chunks/index-DiqYAEHW.js +1 -0
- package/dist/chunks/{mq-layout-DpzeL9_i.js → mq-layout-CpIZTsV2.js} +1 -1
- package/dist/chunks/{price-Dtdjx70D.js → price-tImUmtpX.js} +1 -1
- package/dist/chunks/{refund-cancel-policy-Bm5djPds.js → refund-cancel-policy-CnbrIqH0.js} +1 -1
- package/dist/chunks/{telemetry-client-CKCb9Gnf.js → telemetry-client-BRVJU-fZ.js} +1 -1
- package/dist/env.js +1 -1
- package/dist/i18n.js +1 -1
- package/dist/mq-apple-pay-checkout.js +1 -1
- package/dist/mq-appointment-checkout.js +1 -1
- package/dist/mq-chat-room.js +1 -1
- package/dist/mq-checkout.js +1 -1
- package/dist/mq-google-pay-checkout.js +1 -1
- package/dist/mq-immediate-videocall-checkout.js +1 -1
- package/dist/mq-my-appointments.d.ts +6 -6
- package/dist/mq-my-appointments.js +1 -1
- package/dist/mq-schedule-success.js +2 -2
- package/dist/mq-schedule.d.ts +3 -3
- package/dist/mq-schedule.js +1 -1
- package/dist/mq-socket-provider.js +1 -1
- package/dist/mq-support-chat.d.ts +1 -1
- package/dist/mq-support-chat.js +1 -1
- package/dist/mq-videocall.js +1 -1
- package/dist/react/mq-apple-pay-checkout.d.ts +15 -0
- package/dist/react/mq-apple-pay-checkout.js +2 -0
- package/dist/react/mq-appointment-checkout.d.ts +17 -0
- package/dist/react/mq-appointment-checkout.js +2 -0
- package/dist/react/mq-chat-room.d.ts +19 -0
- package/dist/react/mq-chat-room.js +2 -0
- package/dist/react/mq-checkout.d.ts +18 -0
- package/dist/react/mq-checkout.js +2 -0
- package/dist/react/mq-google-pay-checkout.d.ts +15 -0
- package/dist/react/mq-google-pay-checkout.js +2 -0
- package/dist/react/mq-immediate-videocall-checkout.d.ts +16 -0
- package/dist/react/mq-immediate-videocall-checkout.js +2 -0
- package/dist/react/mq-my-appointments.d.ts +29 -0
- package/dist/react/mq-my-appointments.js +2 -0
- package/dist/react/mq-query-client-provider.d.ts +8 -0
- package/dist/react/mq-query-client-provider.js +2 -0
- package/dist/react/mq-schedule-success.d.ts +26 -0
- package/dist/react/mq-schedule-success.js +2 -0
- package/dist/react/mq-schedule.d.ts +31 -0
- package/dist/react/mq-schedule.js +2 -0
- package/dist/react/mq-socket-provider.d.ts +9 -0
- package/dist/react/mq-socket-provider.js +2 -0
- package/dist/react/mq-support-chat.d.ts +15 -0
- package/dist/react/mq-support-chat.js +2 -0
- package/dist/react/mq-theme-provider.d.ts +8 -0
- package/dist/react/mq-theme-provider.js +2 -0
- package/dist/react/mq-videocall.d.ts +25 -0
- package/dist/react/mq-videocall.js +2 -0
- package/dist/ui/mq-calendar.js +1 -1
- package/dist/ui/mq-clamped-text.js +1 -1
- package/dist/ui/mq-toast.js +1 -1
- package/package.json +25 -4
- package/dist/chunks/exports-XZaVrMLd.js +0 -1
- package/dist/chunks/index-BYHKNPG2.js +0 -1
package/dist/mq-videocall.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as t,t as e}from"./chunks/custom-element-DA9Fxvxd.js";import{a as i,i as o,E as s,x as n}from"./chunks/lit-element-DiWJYFwC.js";import{n as r}from"./chunks/property-scuRaFcM.js";import{spinnerIcon as a}from"./ui/icons/spinner-icon.js";import{e as l}from"./chunks/provide-CfT7g_Zi.js";import{h as d,s as c}from"./chunks/task-Bj8p7kJX.js";import{f as p,e as h,a as m,C as u,g as v,D as g,d as b,i as f}from"./chunks/api-chat-client-BTBtu01T.js";import{r as y}from"./chunks/state-LQivXIgA.js";import{n as w}from"./chunks/context-provider-CiMFpvDA.js";import{env as x}from"./env.js";import{m as k}from"./chunks/runtime-Bg1WXVCx.js";import{l as $}from"./chunks/parseISO-jT42c8Ob.js";import{t as z,v as _,a as S,n as q,o as T,p as O,g as C,q as E,c as j,r as I,s as R}from"./chunks/telemetry-client-CKCb9Gnf.js";import{getLocale as V}from"./i18n.js";import{calendarIcon as A}from"./ui/icons/calendar-icon.js";import"./ui/back-link.js";import{Q as D,c as P,M as U}from"./chunks/mutation-controller-OVT8NEt6.js";import{MqViewAppointmentsEvent as N,DownloadFileEvent as M}from"./events.js";import{clockIcon as W}from"./ui/icons/clock-icon.js";import{infoCircleOutineIcon as F}from"./ui/icons/info-circle-outine-icon.js";import"./ui/mq-button.js";import{l as L}from"./chunks/chunk-S5RWG6G2-oTcdgk2H.js";import{messageBubbleIcon as K}from"./ui/icons/message-bubble-icon.js";import{a as B}from"./chunks/exports-XZaVrMLd.js";import"./ui/mq-floating-bubble.js";import"./ui/mq-card.js";import"./ui/mq-unread-badge.js";import{chatbubbleIcon as Q}from"./ui/icons/chat-bubble-icon.js";import{micIcon as H}from"./ui/icons/mic-icon.js";import{micOffIcon as G}from"./ui/icons/mic-off-icon.js";import{videoIcon as Z}from"./ui/icons/video-icon.js";import{videoOffIcon as Y}from"./ui/icons/video-off-icon.js";import{g as J}from"./chunks/get-organization-setup-query-BMbuRi6v.js";import{l as X}from"./chunks/external-zAbuzxDj.js";import{e as tt}from"./chunks/query-CeeutdfT.js";import{downloadIcon as et}from"./ui/icons/download-icon.js";import{alertCircleIcon as it}from"./ui/icons/alert-circle-icon.js";import"./ui/mq-rating.js";import{toast as ot}from"./ui/mq-toast.js";import{heartBeatIcon as st}from"./ui/icons/heartbeat-icon.js";import{timeLeftIcon as nt}from"./ui/icons/time-left-icon.js";import"./chunks/mq-layout-DpzeL9_i.js";import"./ui/icons/types.js";import"./chunks/format-Cm3B1GMy.js";import"./chunks/isBefore-Cof0D841.js";import"./chunks/context-request-event-Dfydf1ub.js";import"./ui/icons/chevron-down-icon.js";import"./chunks/if-defined-BYeVdwgd.js";import"./ui/mq-text-button.js";import"./chunks/class-map-Co76I6aw.js";import"./chunks/directive-2EDmOukv.js";import"./ui/mq-avatar.js";import"./ui/icons/chevron-left-icon.js";import"./chunks/query-QJ1INUTG.js";import"./theme.js";import"./ui/icons/x-icon.js";import"./ui/mq-skeleton.js";import"./chunks/style-map-CIdqdn7C.js";import"./ui/icons/check-double-icon.js";import"./ui/icons/check-icon.js";import"./chunks/chunk-YTQUGGS3-DN-JZpgG.js";class PermissionController{constructor(t){this.state="prompt",this.host=t,t.addController(this)}async hostConnected(){await this.requestPermissions()}async requestPermissions(){try{const t=await navigator.mediaDevices.getUserMedia({video:!0,audio:!0});for(const e of t.getTracks())e.stop();this.state="granted"}catch{this.state="denied"}finally{this.host.requestUpdate()}}}class InvalidTokenError extends Error{}function rt(t){let e=t.replace(/-/g,"+").replace(/_/g,"/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return function(t){return decodeURIComponent(atob(t).replace(/(.)/g,(t,e)=>{let i=e.charCodeAt(0).toString(16).toUpperCase();return i.length<2&&(i="0"+i),"%"+i}))}(e)}catch(t){return atob(e)}}InvalidTokenError.prototype.name="InvalidTokenError";const at=w(Symbol("opentok-service")),lt=w(Symbol("params"));class OpenTokService{static{this.URL="https://static.opentok.com/v2/js/opentok.min.js"}_ensureLoaded(){if(!window.OT)throw new Error("OpenTok SDK is not loaded");return window.OT}load(){return new Promise((t,e)=>{if(window.OT)return void t();const i=document.createElement("script");i.src=OpenTokService.URL,i.onload=()=>{t()},i.onerror=e,document.head.appendChild(i)})}initSession(t,e){return this._ensureLoaded().initSession(t,e)}initPublisher(t,e,i){return this._ensureLoaded().initPublisher(t,e,i)}subscribe(t,e,i,o,s){return t.subscribe(e,i,o,s)}}const dt="waiting-room",ct="videocall",pt="documentation",ht="not-time-yet",mt="review";class OpenTokController{constructor(t,e,i,o,s){this.isLoading=!0,this.isSessionReady=!1,this.isReconnecting=!1,this.errorMessage="",this.session=null,this.streams=[],this.destroyedStreamIds=new Set,this.openTokService=new OpenTokService,this.session_token=null,this.hasLeftWaitingRoom=!1,this.host=t,t.addController(this),this.appointment=e,this.token=i,this.onCallStarted=o,this.onCallFinished=s,this._loadOpentok()}async _loadOpentok(){try{await this.openTokService.load(),this._initializeSession()}catch{this.isLoading=!1,this.errorMessage="Failed to load OpenTok script",this.host.requestUpdate()}}async _getSessionAndToken(){const t=await m.flash.joinCall({callId:this.appointment.call_id});return this.session_token=t.session_token,[t.session_id,t.session_token]}async _initializeSession(){try{const[t,e]=await this._getSessionAndToken();this.session=this.openTokService.initSession(x.OPENTOK_API_KEY,t),this.session.on("sessionConnected",()=>{this.isLoading=!1,this.isSessionReady=!0,this.host.requestUpdate()}),this.session.on("sessionDisconnected",()=>{this.isSessionReady=!1,this._leaveWaitingRoom(),setTimeout(()=>{this.onCallFinished(),this.host.requestUpdate()},1e3),this.host.requestUpdate()}),this.session.on("sessionReconnecting",()=>{this.isReconnecting=!0,this.host.requestUpdate()}),this.session.on("sessionReconnected",()=>{this.isReconnecting=!1;const t=this.streams.filter(t=>!this.destroyedStreamIds.has(t.streamId));this.streams=[],this.host.requestUpdate(),requestAnimationFrame(()=>{this.streams=t.filter(t=>!this.destroyedStreamIds.has(t.streamId)),this.host.requestUpdate()})}),this.session.on("streamCreated",t=>{this.streams=[...this.streams,t.stream],this.onCallStarted(),this.host.requestUpdate()}),this.session.on("streamDestroyed",t=>{t.stream?.streamId&&this.destroyedStreamIds.add(t.stream.streamId),setTimeout(()=>{this.streams=this.streams.filter(e=>e.streamId!==t.stream?.streamId),this._leaveWaitingRoom(),this.onCallFinished(),this.host.requestUpdate()},1e3)}),this.session.connect(e,t=>{t&&(this.isLoading=!1,this.errorMessage=`Failed to connect to session: ${t.message}`,this.host.requestUpdate())}),m.flash.setReady({professional_hash:this.appointment.from.hash,consultation_id:this.appointment.id,consultation_type:"appointment"})}catch(t){this.isLoading=!1,this.errorMessage=`Error initializing session: ${t instanceof Error?t.message:"Unknown error"}`,this.host.requestUpdate()}}_leaveWaitingRoom(){this.hasLeftWaitingRoom||(this.hasLeftWaitingRoom=!0,m.flash.leaveWaitingRoom({professional_hash:this.appointment.from.hash,consultation_id:this.appointment.id,consultation_type:"appointment"}))}hostDisconnected(){this._leaveWaitingRoom(),this.session&&(this.session.disconnect(),this.session.off("streamCreated"),this.session.off("streamDestroyed"),this.session.off("sessionConnected"),this.session.off("sessionDisconnected"),this.session.off("sessionReconnecting"),this.session.off("sessionReconnected"))}}let ut=class ChatCta extends i{constructor(){super(...arguments),this.text=k("Utiliza el chat para enviar el motivo de consulta, documentos o imágenes"),this.readonly=!1,this.isChatOpen=!1,this.unreadQuery=new D(this,()=>B(m,{roomId:this.roomId}))}static{this.styles=[o`.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 n`<mq-card class="chat-cta" roundness="md"><div class="cta-message">${F({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})} ${k("Chatea con el profesional")} ${(this.unreadQuery.result?.data?.unread_count??0)>0?n`<mq-unread-badge></mq-unread-badge>`:s}</mq-button></mq-card><mq-floating-bubble ?dismissable="${!1}" .open="${this.isChatOpen}" @mq-close="${()=>{this.isChatOpen=!1}}" hideCloseButton>${this.isChatOpen?n`<mq-chat-room slot="content" .consultationId="${this.consultationId}" .consultationType="${u.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>`:s}</mq-floating-bubble>`}};t([r({type:Number})],ut.prototype,"roomId",void 0),t([r({type:String})],ut.prototype,"professionalHash",void 0),t([r({type:String})],ut.prototype,"text",void 0),t([r({type:String})],ut.prototype,"consultationId",void 0),t([r({type:Boolean,reflect:!0})],ut.prototype,"readonly",void 0),t([r({attribute:!1})],ut.prototype,"onOpenChat",void 0),t([P({context:L})],ut.prototype,"loginToken",void 0),t([y()],ut.prototype,"isChatOpen",void 0),ut=t([$(),e("chat-cta")],ut);let vt=class NotTimeYetView extends i{static{this.styles=[o`back-link{display:block;margin-bottom:var(--size-3)}.title{font-family:var(--font-titles);font-size:var(--text-2xl);line-height:var(--text-2xl--line-height);color:var(--color-neutrals-text-default);font-weight:var(--font-weight-bold);margin:0;margin-bottom:var(--size-3)}.description{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);margin:0;margin-bottom:var(--size-3)}.details-card{background-color:var(--color-background);border-radius:var(--border-radius-xl);padding:var(--size-6) var(--size-4);display:flex;min-width:0;flex-direction:column;gap:var(--size-6);margin-bottom:var(--size-6)}.details-card-title{padding:14px 0;font-size:var(--text-base);line-height:100%;font-weight:var(--font-weight-medium);color:var(--color-gray-darker);text-align:left}.details-rows{display:flex;flex-direction:column;gap:var(--size-3)}.details-row{display:flex;align-items:center;gap:var(--size-2);font-family:var(--font-body);font-size:var(--text-base);line-height:var(--text-base--line-height);color:var(--color-neutrals-text-default);font-weight:var(--font-weight-semibold)}.details-row span::first-letter{text-transform:uppercase}@media (min-width:768px){.title{font-size:var(--text-5xl);line-height:var(--text-5xl--line-height)}.description{font-size:var(--text-base);line-height:var(--text-base--line-height);margin-bottom:var(--sp-6)}}`]}firstUpdated(){z.track(_(this.loginToken.patient.hash,this.appointment.id??""))}render(){const t=V()?.replace("_","-")??"es-ES",e=this.loginToken.patient.timezone,i=new Intl.DateTimeFormat(t,{dateStyle:"full",...e?{timeZone:e}:{}}),o=new Intl.DateTimeFormat(t,{timeStyle:"short",...e?{timeZone:e}:{}}),s=new Date(this.appointment.start_date),r=S(s,this.appointment.duration),a=e?v(e,s):"";return n`<back-link @mq-back="${t=>{t.stopPropagation(),this.dispatchEvent(new N({tab:"next"}))}}">${k("Salir")}</back-link><h1 class="title">${k("¡Aún no es la hora!")}</h1><p class="description">${k("Cuando falten 10 minutos para tu consulta, podrás acceder a la videoconsulta")}</p><div class="details-card"><professional-overview .name="${this.appointment.from.name??""}" .specialtyName="${this.appointment.from.speciality??""}" .collegiateNumber="${this.appointment.from.collegiate_number??void 0}" .description="${this.appointment.from.description??""}" .languages="${this.appointment.from.languages}" .avatar="${this.appointment.from.avatar??""}"></professional-overview><div class="details-rows"><div class="details-row">${A({size:24})} <span>${i.format(s)}</span></div><div class="details-row">${W({size:24})} <span>${o.format(s)} - ${o.format(r)}${a?` (${a})`:""}</span></div></div></div><chat-cta .consultationId="${this.appointment.id}" .roomId="${Number(this.appointment.room_id)}" .professionalHash="${this.appointment.from.hash}" .text="${k("Utiliza el chat para enviar el motivo de consulta, documentos o imágenes")}" .onOpenChat="${()=>{z.track(q(this.loginToken.patient.hash,this.appointment.id??""))}}"></chat-cta>`}};t([r({type:Object})],vt.prototype,"appointment",void 0),t([P({context:L})],vt.prototype,"loginToken",void 0),vt=t([$(),e("not-time-yet-view")],vt);let gt=class PermissionStatusBanner extends i{static{this.styles=o`:host{display:block;padding:var(--size-5) var(--size-6);background-color:#ebf9ff;border-radius:var(--border-radius-lg);text-align:center}span{color:var(--color-neutrals-text-default);font-size:var(--text-sm);line-height:var(--text-sm--line-height);font-weight:var(--font-weight-normal)}`}render(){return n`<span>${k("Espera a ser atendido sin salir de esta pantalla")}</span>`}};gt=t([$(),e("permission-status-banner")],gt);let bt=class WaitingRoomLayout extends i{constructor(){super(...arguments),this.isWaitingRoom=!1}static{this.styles=o`.information-container{padding:var(--size-5) var(--size-4);background-color:var(--color-neutrals-background-disabled)}.content{max-width:560px;margin:0 auto}.information-container h2{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(--size-4)}.information-container p{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}.video-container{margin-left:auto;margin-right:auto;margin-bottom:var(--size-6);position:relative;max-height:301px;aspect-ratio:9/16;border-radius:16px;overflow:hidden}@media (min-width:768px){.information-container{background-color:transparent;padding:var(--size-6) 0}.video-container{max-height:454px;aspect-ratio:16/9}.information-container h2{font-size:var(--text-4xl);line-height:var(--text-4xl--line-height)}.information-container p{font-size:var(--text-base);line-height:var(--text-base--line-height)}}`}firstUpdated(){this.isWaitingRoom&&z.track(T(this.loginToken.patient.hash,this.appointment.id??""))}render(){if(!this.isWaitingRoom)return n`<slot></slot>`;const t=V()?.replace("_","-")??"es-ES",e=this.loginToken.patient.timezone,i=e?{timeZone:e}:{},o=new Intl.DateTimeFormat(t,{dateStyle:"short",...i}),s=new Intl.DateTimeFormat(t,{timeStyle:"short",...i}),r=new Date(this.appointment.start_date),a=S(r,this.appointment.duration),l=e?v(e,r):"",d=o.format(r),c=`${s.format(r)} - ${s.format(a)}${l?` (${l})`:""}`;return n`<permission-status-banner></permission-status-banner><div class="content"><div class="information-container"><back-link @mq-back="${t=>{t.stopPropagation(),this.dispatchEvent(new N({tab:"next"}))}}">${k("Salir")}</back-link><h2>${k("Sala de espera")}</h2><div class="doctor-info"><p>${this.appointment.from.name}</p><p>${d}</p><p>${c}</p></div></div><div class="video-container"><slot></slot></div><chat-cta .consultationId="${this.appointment.id}" .roomId="${Number(this.appointment.room_id)}" .professionalHash="${this.appointment.from.hash}" .text="${k("Utiliza el chat para enviar el motivo de consulta, documentos o imágenes")}" .onOpenChat="${()=>{z.track(q(this.loginToken.patient.hash,this.appointment.id??""))}}"></chat-cta></div>`}};t([r({type:Object})],bt.prototype,"appointment",void 0),t([r({type:Boolean,attribute:"is-waiting-room"})],bt.prototype,"isWaitingRoom",void 0),t([P({context:L})],bt.prototype,"loginToken",void 0),bt=t([e("waiting-room-layout")],bt);class AppointmentCounterController{constructor(t,e){this.startsAtGetter=e,this.formattedTime="--:--",this.interval=null,this.host=t,t.addController(this)}async hostConnected(){this.interval=setInterval(()=>{const t=new Date,e=this.startsAtGetter(),i=t.getTime()-e.getTime(),o=Math.floor(i/1e3),s=Math.floor(o/60),n=o%60;this.formattedTime=`${s.toString().padStart(2,"0")}:${n.toString().padStart(2,"0")}`,this.host.requestUpdate()},1e3)}hostDisconnected(){this.interval&&clearInterval(this.interval)}}class ToggleAudioEvent extends Event{static{this.eventName="toggle-audio"}constructor(t){super(ToggleAudioEvent.eventName,{bubbles:!0,composed:!0}),this.isAudioOn=t}}class ToggleVideoEvent extends Event{static{this.eventName="toggle-video"}constructor(t){super(ToggleVideoEvent.eventName,{bubbles:!0,composed:!0}),this.isVideoOn=t}}class ToggleChatEvent extends Event{static{this.eventName="toggle-chat"}constructor(t){super(ToggleChatEvent.eventName,{bubbles:!0,composed:!0}),this.isChatOpen=t}}class ViewDocumentationEvent extends Event{static{this.eventName="view-documentation"}constructor(){super(ViewDocumentationEvent.eventName,{bubbles:!0,composed:!0})}}class DownloadFileEvent extends Event{static{this.eventName="download-file"}constructor(t,e){super(DownloadFileEvent.eventName,{bubbles:!0,composed:!0}),this.url=t,this.filename=e}}let ft=class PublisherControls extends i{constructor(){super(...arguments),this.isAudioOn=!1,this.isVideoOn=!0,this.isChatOpen=!1,this.chatEnabled=!1,this.isWaitingRoom=!1,this.unreadQuery=new D(this,()=>B(m,{roomId:this.roomId}))}static{this.styles=o`:host{display:flex;justify-content:space-between;gap:var(--size-4)}:host([is-waiting-room]){justify-content:center}.left-controls{display:flex;gap:var(--size-4)}.control-button{border:none;cursor:pointer;display:flex;align-items:center;justify-content:center;width:var(--size-10);height:var(--size-10);padding:var(--size-2);border-radius:12.5px;transition:all .2s ease-in-out}@media (min-width:768px){.control-button{width:var(--size-11);height:var(--size-11);padding:var(--size-2);border-radius:16px}}.control-button:hover{background-color:var(--color-gray-light)}.control-button:focus-visible{outline:0;box-shadow:0 0 0 2px var(--color-primary-light)}.control-button--on{background-color:var(--color-white);color:var(--color-primary)}.control-button--off{background-color:var(--color-white);color:var(--color-negative)}`}toggleAudio(){this.dispatchEvent(new ToggleAudioEvent(!this.isAudioOn))}toggleVideo(){this.dispatchEvent(new ToggleVideoEvent(!this.isVideoOn))}toggleChat(){this.dispatchEvent(new ToggleChatEvent(!this.isChatOpen))}render(){return n`<div class="left-controls">${this.isWaitingRoom||!this.chatEnabled?s:n`<button type="button" class="control-button control-button--on" @click="${this.toggleChat}">${Q({size:20})} ${(this.unreadQuery.result?.data?.unread_count??0)>0?n`<mq-unread-badge></mq-unread-badge>`:s}</button>`} <button type="button" class="control-button ${this.isAudioOn?"control-button--on":"control-button--off"}" @click="${this.toggleAudio}">${this.isAudioOn?H({size:20}):G({size:20})}</button> <button type="button" class="control-button ${this.isVideoOn?"control-button--on":"control-button--off"}" @click="${this.toggleVideo}">${this.isVideoOn?Z({size:20}):Y({size:20})}</button></div>`}};t([r({type:Boolean})],ft.prototype,"isAudioOn",void 0),t([r({type:Boolean})],ft.prototype,"isVideoOn",void 0),t([r({type:Boolean})],ft.prototype,"isChatOpen",void 0),t([r({type:Boolean})],ft.prototype,"chatEnabled",void 0),t([r({type:Boolean,reflect:!0,attribute:"is-waiting-room"})],ft.prototype,"isWaitingRoom",void 0),t([r({type:Number})],ft.prototype,"roomId",void 0),ft=t([e("publisher-controls")],ft);let yt=class VideoPublisher extends i{constructor(){super(...arguments),this.isWaitingRoom=!1,this.appointmentCounterController=new AppointmentCounterController(this,()=>new Date(this.startsAt)),this.getOrganizationSetupQuery=new D(this,()=>J(m)),this.isAudioOn=!0,this.isVideoOn=!0,this.isChatOpen=!1,this._handleVisibilityChange=()=>{"visible"===document.visibilityState&&this.publisher&&(this.publisher.publishAudio(!1),this.publisher.publishVideo(!1),setTimeout(()=>{this.publisher?.publishAudio(this.isAudioOn),this.publisher?.publishVideo(this.isVideoOn)},500))}}static{this.styles=o`:host{width:100%;height:100%;display:block}.OT_video-element{width:100%;height:100%;background:var(--color-black)}.OT_mute{display:none}video{border-radius:var(--border-radius-lg)}#video-publisher{width:100%;height:100%;transition:width .5s ease-in-out,height .5s ease-in-out;border-radius:var(--border-radius-lg)}:host(:not([is-waiting-room])) #video-publisher{width:121px;height:200px;z-index:50;border-radius:12px;overflow:hidden}:host([is-waiting-room]) .top-items{position:absolute;inset:0}:host(:not([is-waiting-room])) .top-items{position:absolute;z-index:50;top:var(--size-4);left:var(--size-4);right:var(--size-4);display:flex;justify-content:space-between;gap:var(--size-1)}.meta-container{display:flex;align-items:flex-start;gap:var(--size-1);min-width:0}.meta-item{background-color:var(--color-neutrals-text-default);padding:var(--size-2) var(--size-3);color:var(--color-white);font-size:var(--text-xs);line-height:var(--text-xs--line-height);flex-shrink:0}.meta-item:first-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex-shrink:1;min-width:0}publisher-controls{position:absolute;z-index:50;bottom:var(--size-4);left:var(--size-4);right:var(--size-4)}mq-chat-room{height:100%}@media (min-width:768px){:host(:not([is-waiting-room])) #video-publisher{width:250px;height:auto;aspect-ratio:16/9}:host(:not([is-waiting-room])) .top-items{top:var(--size-6);left:var(--size-6);right:var(--size-6)}}`}firstUpdated(t){super.firstUpdated(t),this.publisher=this.openTokService.initPublisher(this.publisherEl,{fitMode:"contain",width:"100%",height:"100%",audioFallbackEnabled:!1,insertMode:"append",mirror:!1,publishAudio:this.isAudioOn,publishVideo:this.isVideoOn},t=>{t&&X.error("error initializing publisher",t),this.session.publish(this.publisher)}),document.addEventListener("visibilitychange",this._handleVisibilityChange)}disconnectedCallback(){document.removeEventListener("visibilitychange",this._handleVisibilityChange),super.disconnectedCallback(),this.publisher?.destroy()}async _handleToggleAudioEvent(t){this.isAudioOn=t.isAudioOn,this.publisher.publishAudio(t.isAudioOn)}async _handleToggleVideoEvent(t){this.isVideoOn=t.isVideoOn,this.publisher.publishVideo(t.isVideoOn)}async _handleToggleChatEvent(t){this.isChatOpen=t.isChatOpen}render(){const t=!0===this.getOrganizationSetupQuery.result?.data?.appointments?.has_chat_in_appointment;return n`<div class="top-items">${this.isWaitingRoom?n`<div></div>`:n`<div class="meta-container"><span class="meta-item">${this.professionalName}</span> <span class="meta-item">${this.appointmentCounterController.formattedTime}</span></div>`}<div id="video-publisher"></div></div><publisher-controls .isAudioOn="${this.isAudioOn}" .isVideoOn="${this.isVideoOn}" .isChatOpen="${this.isChatOpen}" .chatEnabled="${t}" .roomId="${Number.parseInt(this.roomId,10)}" ?is-waiting-room="${this.isWaitingRoom}" @toggle-audio="${this._handleToggleAudioEvent}" @toggle-video="${this._handleToggleVideoEvent}" @toggle-chat="${this._handleToggleChatEvent}"></publisher-controls>${t?n`<mq-floating-bubble ?dismissable="${!1}" .open="${this.isChatOpen}" @mq-close="${()=>{this.isChatOpen=!1}}" hideCloseButton>${this.isChatOpen?n`<mq-chat-room slot="content" .consultationId="${this.consultationId}" .consultationType="${u.appointment}" token="${this.loginToken.access_token}" .roomId="${Number.parseInt(this.roomId,10)}" .professionalHash="${this.professionalHash}" @mq-chat-room-close="${()=>{this.isChatOpen=!1}}"></mq-chat-room>`:s}</mq-floating-bubble>`:s}`}};t([r({type:String})],yt.prototype,"consultationId",void 0),t([r({type:String})],yt.prototype,"apiKey",void 0),t([r({type:String})],yt.prototype,"token",void 0),t([r({type:String})],yt.prototype,"roomId",void 0),t([r({type:String})],yt.prototype,"professionalHash",void 0),t([r({type:Object})],yt.prototype,"session",void 0),t([r({type:String})],yt.prototype,"professionalName",void 0),t([r({type:String})],yt.prototype,"startsAt",void 0),t([r({type:Boolean,reflect:!0,attribute:"is-waiting-room"})],yt.prototype,"isWaitingRoom",void 0),t([P({context:at})],yt.prototype,"openTokService",void 0),t([P({context:L})],yt.prototype,"loginToken",void 0),t([tt("#video-publisher")],yt.prototype,"publisherEl",void 0),t([y()],yt.prototype,"isAudioOn",void 0),t([y()],yt.prototype,"isVideoOn",void 0),t([y()],yt.prototype,"isChatOpen",void 0),yt=t([e("video-publisher")],yt);let wt=class VideoSubscriber extends i{constructor(){super(...arguments),this.isVideoOn=!0,this._subscriberProperties={fitMode:"contain",insertMode:"append",width:"100%",height:"100%"},this._handleVisibilityChange=()=>{"visible"===document.visibilityState&&this.subscriber&&(this.subscriber.subscribeToAudio(!1),this.subscriber.subscribeToVideo(!1),setTimeout(()=>{this.subscriber?.subscribeToAudio(!0),this.subscriber?.subscribeToVideo(!0)},500),setTimeout(()=>this._resubscribe(),600))}}static{this.styles=o`:host{position:absolute;inset:0}.OT_subscriber{width:100%;height:100%;position:absolute;inset:0;background:var(--color-neutrals-background-default)}video{width:100%;height:100%}.video-disabled{position:absolute;inset:0;background:var(--color-gray-dark)}.hidden{display:none}`}firstUpdated(){this._subscribe(),document.addEventListener("visibilitychange",this._handleVisibilityChange)}_subscribe(){this.subscriber=this.openTokService.subscribe(this.session,this.stream,this.subscriberEl,this._subscriberProperties,t=>{}),this._attachSubscriberEvents()}_attachSubscriberEvents(){this.subscriber.on("connected",t=>{this.isVideoOn=t.target.stream?.hasVideo??!0}),this.subscriber.on("videoDisabled",()=>{this.isVideoOn=!1}),this.subscriber.on("videoEnabled",()=>{this.isVideoOn=!0}),this.subscriber.on("disconnected",()=>{this.isVideoOn=!1})}_resubscribe(){if(this.subscriber&&this.session&&this.subscriberEl){try{this.session.unsubscribe(this.subscriber)}catch{}this.subscriberEl.innerHTML="",this._subscribe()}}disconnectedCallback(){if(document.removeEventListener("visibilitychange",this._handleVisibilityChange),this.subscriber&&this.session)try{this.session.unsubscribe(this.subscriber)}catch{}super.disconnectedCallback()}render(){return n`<div id="video-subscriber" class="${this.isVideoOn?"":"hidden"}"></div>${this.isVideoOn?n``:n`<div class="video-disabled"></div>`}`}};t([r({type:Object})],wt.prototype,"session",void 0),t([r({type:Object})],wt.prototype,"stream",void 0),t([y()],wt.prototype,"isVideoOn",void 0),t([P({context:at})],wt.prototype,"openTokService",void 0),t([tt("#video-subscriber")],wt.prototype,"subscriberEl",void 0),wt=t([e("video-subscriber")],wt);let xt=class VideocallContent extends i{constructor(){super(...arguments),this.streams=[],this.isWaitingRoom=!1,this.isReconnecting=!1}static{this.styles=o`:host{display:block;position:relative;width:100%;height:100%;background:var(--color-gray-darkest);aspect-ratio:16/9}.reconnecting-overlay{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--size-3);background:rgba(0,0,0,.6);z-index:100}.reconnecting-overlay__text{color:var(--color-white);font-size:var(--text-sm);line-height:var(--text-sm--line-height)}.reconnecting-overlay__subtitle{color:var(--color-white);font-size:var(--text-xs);line-height:var(--text-xs--line-height);opacity:.85}`}firstUpdated(){this.isWaitingRoom||z.track(O(this.loginToken.patient.hash,this.appointment.id??""))}updated(t){t.has("isWaitingRoom")&&!0===t.get("isWaitingRoom")&&!this.isWaitingRoom&&z.track(O(this.loginToken.patient.hash,this.appointment.id??""))}render(){return n`<video-publisher .consultationId="${this.appointment.id}" .session="${this.session}" ?is-waiting-room="${this.isWaitingRoom}" .professionalName="${this.appointment.from.name??""}" .professionalHash="${this.appointment.from.hash}" .startsAt="${this.appointment.started_at??(new Date).toISOString()}" .apiKey="${this.apiKey}" .token="${this.token}" .roomId="${this.appointment.room_id}"></video-publisher>${0===this.streams.length?n``:this.streams.map(t=>n`<video-subscriber .session="${this.session}" .stream="${t}"></video-subscriber>`)} ${this.isReconnecting?n`<div class="reconnecting-overlay">${a({color:"var(--color-white)"})} <span class="reconnecting-overlay__text">${k("Reconectando...")} </span><span class="reconnecting-overlay__subtitle">${k("Espere mientras se restablece la conexión")}</span></div>`:""}`}};t([r({type:Object})],xt.prototype,"session",void 0),t([r({type:Array})],xt.prototype,"streams",void 0),t([r({type:String})],xt.prototype,"apiKey",void 0),t([r({type:String})],xt.prototype,"token",void 0),t([r({type:Object})],xt.prototype,"appointment",void 0),t([r({type:Boolean,reflect:!0,attribute:"is-waiting-room"})],xt.prototype,"isWaitingRoom",void 0),t([r({type:Boolean,reflect:!0,attribute:"is-reconnecting"})],xt.prototype,"isReconnecting",void 0),t([P({context:L})],xt.prototype,"loginToken",void 0),xt=t([$(),e("mq-videocall-content")],xt);let kt=class PageLayout extends i{constructor(){super(...arguments),this.yCentered=!1,this.background="solid"}static{this.styles=o`: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 n`<div><main><slot></slot></main></div>`}};t([r({type:Boolean,attribute:"y-centered"})],kt.prototype,"yCentered",void 0),t([r({type:String})],kt.prototype,"background",void 0),kt=t([e("page-layout")],kt);const $t=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 zt=class PatientDocument extends i{constructor(){super(...arguments),this.isDownloading=!1}static{this.styles=$t}getFormatter(){const t=V().replace("_","-");return new Intl.DateTimeFormat(t,{year:"numeric",month:"numeric",day:"numeric"})}async _handleDownload(){this.isDownloading=!0;const t=await m.flash.downloadDocument({url:this.downloadUrl}),e=await async function(t){return new Promise((e,i)=>{const o=new FileReader;o.onloadend=()=>e(o.result),o.onerror=i,o.readAsDataURL(t)})}(t);this.dispatchEvent(new M({url:e,filename:`${this.filename}.pdf`})),this.isDownloading=!1}formatKind(t){switch(t){case g.prescription:return k("Receta");case g.report:return k("Informe");case g.diagnosticTestPrescription:return k("Prescripción")}}render(){const t=this.getFormatter().format(new Date(this.date));return n`<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}">${et({size:24})}</mq-button>`}};t([r({type:String})],zt.prototype,"kind",void 0),t([r({type:String})],zt.prototype,"filename",void 0),t([r({type:String})],zt.prototype,"specialty",void 0),t([r({type:String})],zt.prototype,"description",void 0),t([r({type:String})],zt.prototype,"date",void 0),t([r({type:String})],zt.prototype,"downloadUrl",void 0),t([y()],zt.prototype,"isDownloading",void 0),zt=t([$(),e("patient-document")],zt);const _t=o`.title{margin:var(--size-3) 0;font-family:var(--font-titles);font-size:var(--text-2xl);line-height:var(--text-2xl--line-height);color:var(--color-neutrals-text-default);font-weight:var(--font-weight-bold)}.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 St=class DocumentationView extends i{constructor(){super(...arguments),this.canReconnect=!1,this._sharedocumentsTask=new d(this,{task:async([t])=>await m.flash.getSharedDocuments({appointment_id:t}),args:()=>[this.appointment.id]}),this.getOrganizationSpecialtiesQuery=new D(this,()=>C(m)),this.getOrganizationSetupQuery=new D(this,()=>J(m)),this._reconnectMutation=new U(this,{mutationFn:t=>m.appointments.reconnectAppointment(t),onSuccess:()=>{this.dispatchEvent(new CustomEvent("reconnect",{bubbles:!0,composed:!0}))}})}static{this.styles=_t}firstUpdated(){z.track(E(this.loginToken.patient.hash,this.appointment.id??""))}render(){const t=!0===this.getOrganizationSetupQuery.result?.data?.appointments?.has_chat_in_appointment,e=V(),i=e.replace("_","-"),o=this.loginToken.patient.timezone,r=o?{timeZone:o}:{},a=new Intl.DateTimeFormat(i,{dateStyle:"full",...r}),l=new Intl.DateTimeFormat(i,{hour:"2-digit",minute:"2-digit",...r}),d=new Date(this.appointment.start_date),p=S(d,this.appointment.duration),h=o?v(o,d):"";return n`<back-link @mq-back="${t=>{t.stopPropagation(),this.dispatchEvent(new N({tab:"history"}))}}">${k("Salir")}</back-link><h1 class="title">${k("Consulta finalizada")}</h1><p class="description">${k("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>${A()}</dt><dd>${a.format(d)}</dd></div><div class="description-list-item"><dt>${W()}</dt><dd>${l.format(d)} - ${l.format(p)}${h?` (${h})`:""}</dd></div></dl></mq-card><mq-card class="documents-card" roundness="md"><h2 class="documents-card-title">${k("Documentación")}</h2><div class="documents-list">${this._sharedocumentsTask?.render({pending:()=>n`<div class="document-item-skeleton"></div>`,complete:()=>0===this._sharedocumentsTask?.value?.length?n`<p class="documents-card-empty">${k("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=>n`<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 j(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="${()=>{z.track(I(this.loginToken.patient.hash,this.appointment.id??"")),this._sharedocumentsTask?.run()}}" .disabled="${this._sharedocumentsTask?.status===c.PENDING}">${k("Actualizar")}</mq-button></mq-card><div class="finished-consultation-footer">${this.canReconnect?n`<mq-button variant="primary" size="md" fullwidth ?disabled="${this._reconnectMutation.isPending}" @click="${()=>this._reconnectMutation.run({appointmentId:this.appointment.id})}">${k("Volver a la sala de espera")}</mq-button>`:s} ${t?n`<chat-cta .consultationId="${this.appointment.id}" .roomId="${Number(this.appointment.room_id)}" .professionalHash="${this.appointment.from.hash}" .text="${k("Puedes chatear con tu profesional hasta 48 horas finalizada tu cita")}" ?readonly="${b(this.appointment.expires_at)}" .onOpenChat="${()=>{z.track(R(this.loginToken.patient.hash,this.appointment.id??""))}}"></chat-cta>`:s}</div>`}};t([r({type:Object})],St.prototype,"appointment",void 0),t([r({type:String})],St.prototype,"token",void 0),t([r({type:Boolean,attribute:"can-reconnect"})],St.prototype,"canReconnect",void 0),t([P({context:L})],St.prototype,"loginToken",void 0),St=t([$(),e("documentation-view")],St);class ReviewSubmittedEvent extends Event{static{this.eventName="review-submitted"}constructor(){super(ReviewSubmittedEvent.eventName,{bubbles:!0,composed:!0})}}class ReviewSkippedEvent extends Event{static{this.eventName="review-skipped"}constructor(){super(ReviewSkippedEvent.eventName,{bubbles:!0,composed:!0})}}let qt=class ReviewView extends i{constructor(){super(...arguments),this.rating=0,this.comment="",this._reviewMutation=new U(this,{mutationFn:({rating:t,comment:e})=>m.consultations.postReview({consultation_id:this.appointment.id??"",consultation_type:u.appointment,rating:t,comment:e.trim()?e.trim():null}),onSuccess:()=>{this.dispatchEvent(new ReviewSubmittedEvent)},onError:t=>{!function(t){const e=t,i=e?.response?.status;return 400===i&&/already exists/i.test(e?.response?.data?.message??"")}(t)?ot.error(k("No se ha podido enviar el cuestionario")):this.dispatchEvent(new ReviewSubmittedEvent)}}),this._reconnectMutation=new U(this,{mutationFn:t=>m.appointments.reconnectAppointment(t),onSuccess:()=>{this.dispatchEvent(new CustomEvent("review-reconnect",{bubbles:!0,composed:!0}))},onError:()=>{ot.error(k("No se ha podido volver a la sala de espera"))}}),this.handleSkip=()=>{this.dispatchEvent(new ReviewSkippedEvent)},this.handleSubmit=()=>{this.rating<1||this.rating>5||this._reviewMutation.isPending||this._reviewMutation.run({rating:this.rating,comment:this.comment})}}static{this.styles=o`:host{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:100%;background-color:var(--color-background);box-sizing:border-box}.container{width:100%;max-width:500px;padding:var(--sp-6);display:flex;flex-direction:column;gap:var(--sp-5);box-sizing:border-box}.title{margin:0;padding:0 var(--sp-6);font-family:var(--font-titles);font-size:var(--text-2xl);line-height:var(--text-2xl--line-height);font-weight:var(--font-weight-normal);color:var(--color-primary);text-align:center}.rating{display:flex;flex-direction:column;align-items:center;gap:var(--sp-2);padding:var(--sp-1) var(--sp-6)}.subtitle{margin:0;font-family:var(--font-body);font-size:var(--text-sm);line-height:var(--text-sm--line-height);color:var(--color-text-icons--secondary);text-align:center}.comment-card{background-color:var(--color-white);border:var(--action-border-width) solid var(--color-border);border-radius:var(--border-radius-lg);box-shadow:0 4px 4px rgba(0,0,0,.05);padding:var(--sp-5);display:flex;flex-direction:column;gap:var(--sp-5)}.comment-header{display:flex;justify-content:space-between;align-items:flex-start;gap:var(--sp-3)}.comment-label{font-family:var(--font-body);font-size:var(--text-sm);line-height:var(--text-sm);font-weight:var(--font-weight-medium);color:var(--color-neutrals-text-default)}.comment-counter{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-text-icons--secondary);white-space:nowrap}.textarea{width:100%;box-sizing:border-box;height:var(--size-44);padding:var(--sp-3) var(--sp-4);background-color:var(--color-gray-lighter);border:var(--action-border-width) solid var(--color-border);border-radius:var(--border-radius-md);font-family:var(--font-body);font-size:var(--text-sm);line-height:var(--text-sm--line-height);color:var(--color-neutrals-text-default);resize:none}.textarea::placeholder{color:var(--color-text-icons--secondary);opacity:.6}.textarea:focus{outline:0;border-color:var(--color-primary)}.actions{display:flex;gap:var(--sp-4)}.btn{flex:1;height:var(--button-height-md);padding:var(--sp-2) var(--sp-4);border-radius:var(--border-radius-md);font-family:var(--font-body);font-size:var(--text-sm);line-height:var(--text-sm--line-height);font-weight:var(--font-weight-medium);cursor:pointer;transition:opacity .15s ease-in-out}.btn:focus-visible{outline:2px solid var(--color-primary);outline-offset:2px}.btn:disabled{cursor:not-allowed}.btn-skip{background:var(--color-white);border:var(--action-border-width) solid var(--color-primary);color:var(--color-primary)}.btn-skip:hover:not(:disabled){background:var(--color-primary-background-extraWeak)}.btn-submit{background:var(--color-primary);border:var(--action-border-width) solid var(--color-primary);color:var(--color-white)}.btn-submit:hover:not(:disabled){background:var(--color-primary-dark)}.btn-submit:disabled{opacity:.5}.waiting-card{background-color:var(--color-background-primary-light);border-radius:var(--border-radius-lg);padding:var(--sp-4);display:flex;flex-direction:column;gap:var(--sp-2)}.waiting-header{display:flex;align-items:center;gap:var(--sp-2);color:var(--color-neutrals-text-default)}.waiting-title{font-family:var(--font-body);font-size:var(--text-xs);line-height:1;font-weight:var(--font-weight-medium);color:var(--color-neutrals-text-default)}.waiting-body{margin:0;font-family:var(--font-body);font-size:var(--text-xs);line-height:var(--text-xs--line-height);color:var(--color-text-icons--secondary)}.waiting-link{background:0 0;border:0;padding:0;cursor:pointer;color:#3c50ec;font:inherit;text-decoration:none}.waiting-link:hover{text-decoration:none}.waiting-link:disabled{cursor:not-allowed;opacity:.6}`}render(){return n`<div class="container"><h1 class="title">${k("¿Qué tal ha ido tu cita?")}</h1><div class="rating"><mq-rating .value="${this.rating}" .label="${k("Valoración de la consulta")}" @mq-rating-change="${t=>{this.rating=t.value}}"></mq-rating><p class="subtitle">${k("(1 es muy malo, 5 es excelente)")}</p></div><div class="comment-card"><div class="comment-header"><span class="comment-label">${k("¿Tienes comentarios sobre la consulta?")}</span> <span class="comment-counter">${this.comment.length}/${240}</span></div><textarea class="textarea" maxlength="${240}" placeholder="${k("Comparte cómo fue la atención o si tuviste algún problema con la videollamada…")}" .value="${this.comment}" @input="${t=>{this.comment=t.target.value}}"></textarea><div class="actions"><button type="button" class="btn btn-skip" ?disabled="${this._reviewMutation.isPending}" @click="${this.handleSkip}">${k("Omitir")}</button> <button type="button" class="btn btn-submit" ?disabled="${this.rating<1||this._reviewMutation.isPending}" @click="${this.handleSubmit}">${k("Enviar")}</button></div></div><div class="waiting-card"><div class="waiting-header">${it({color:"currentColor",size:18})} <span class="waiting-title">${k("¿Ocurrió algún problema?")}</span></div><p class="waiting-body">${k("Si la cita no se ha podido realizar, puedes")} <button type="button" class="waiting-link" ?disabled="${this._reconnectMutation.isPending}" @click="${()=>this._reconnectMutation.run({appointmentId:this.appointment.id})}">${k("volver a la sala de espera.")}</button></p></div></div>`}};t([r({type:Object})],qt.prototype,"appointment",void 0),t([y()],qt.prototype,"rating",void 0),t([y()],qt.prototype,"comment",void 0),qt=t([$(),e("review-view")],qt);let Tt=class ErrorView extends i{static{this.styles=o`.container{display:grid;place-items:center;width:100%;max-width:447px;margin:0 auto}.card>:not(:first-child){margin-top:var(--size-8)}.title{font-family:var(--font-titles);color:var(--color-neutrals-text-default);font-size:var(--text-2xl);line-height:var(--text-2xl--line-height);font-weight:var(--font-weight-bold);margin:0;margin-bottom:var(--size-3)}.description{color:var(--color-neutrals-text-default);font-size:var(--text-sm);line-height:var(--text-sm--line-height);font-weight:400}`}render(){return n`<div class="container"><div class="card"><slot name="icon"></slot><div class="content"><h1 class="title">${this.title}</h1><p class="description">${this.message}</p></div></div></div>`}};t([r({type:String})],Tt.prototype,"title",void 0),t([r({type:String})],Tt.prototype,"message",void 0),Tt=t([e("error-view")],Tt);let Ot=class UnexpectedErrorView extends i{render(){return n`<error-view .title="${k("Error desconocido")}" .message="${k("Ha ocurrido un error al cargar la página. Por favor, intenta nuevamente o contacta al soporte.")}"><div slot="icon">${st()}</div></error-view>`}};Ot=t([$(),e("unexpected-error-view")],Ot);let Ct=class ExpiredAppointmentErrorView extends i{render(){return n`<error-view .title="${k("Consulta caducada")}" .message="${k("Parece que no te hemos encontrado a la hora de tu cita. Puedes programar otra consulta para resolver tus dudas.")}"><div slot="icon">${nt()}</div></error-view>`}};Ct=t([$(),e("expired-appointment-error-view")],Ct);let Et=class NotFoundErrorView extends i{static{this.styles=o`div{display:flex;flex-direction:column;gap:2px}span{font-size:var(--text-xs);line-height:var(--text-xs--line-height);font-weight:400;color:var(--color-gray-medium)}`}render(){return n`<error-view .title="${k("Página no encontrada")}" .message="${k("La página que estás buscando fue removida, renombrada o puede que no exista.")}"><div slot="icon"><span>404</span> ${st()}</div></error-view>`}};function jt(t){try{return function(t,e){if("string"!=typeof t)throw new InvalidTokenError("Invalid token specified: must be a string");e||(e={});const i=!0===e.header?0:1,o=t.split(".")[i];if("string"!=typeof o)throw new InvalidTokenError(`Invalid token specified: missing part #${i+1}`);let s;try{s=rt(o)}catch(t){throw new InvalidTokenError(`Invalid token specified: invalid base64 for part #${i+1} (${t.message})`)}try{return JSON.parse(s)}catch(t){throw new InvalidTokenError(`Invalid token specified: invalid json for part #${i+1} (${t.message})`)}}(t)}catch{return null}}Et=t([$(),e("not-found-error-view")],Et);let It=class MqVideocallProvider extends i{static{this.styles=o`*{box-sizing:border-box}:host{display:block;margin:0 auto;width:100%;height:100%}.centered{display:grid;place-items:center;height:100%;min-height:var(--mq-container-min-height)}documentation-view{display:block;padding:var(--sp-4)}`}constructor(){super(),this.opentokService=new OpenTokService,this.params={appointmentId:this.appointmentId,token:this.token,apiKey:this.apiKey},this.appointmentTask=new d(this,{task:async([t,,])=>{const[e,i,o]=await Promise.all([m.flash.getAppointment({appointmentId:t}),m.consultations.getReview(t).then(()=>!0).catch(()=>!1),m.organizations.getOrganizationSetup().catch(()=>{})]);return{appointment:e,hasReview:i,hasNps:!0===o?.appointments?.has_nps}},args:()=>[this.appointmentId,this.apiKey,this.token]})}willUpdate(t){if(this.appointmentTask.value&&!this.opentokController){const{appointment:t,hasReview:e,hasNps:i}=this.appointmentTask.value,o=function(t,e){return p(t)?t.status===h.finished||t.status===h.reporting?e?mt:pt:dt:ht}(t,i);this.screen=o===mt&&e?pt:o,this.params={appointmentId:this.appointmentId,token:this.token,apiKey:this.apiKey},this.opentokController=new OpenTokController(this,t,this.token,()=>{this.screen=ct},()=>{this.screen=!i||e?pt:mt})}}render(){const t=n`<div class="centered">${a({color:"var(--color-primary)"})}</div>`,e=n`<mq-layout background="transparent"><not-found-error-view></not-found-error-view></mq-layout>`;return this.appointmentTask.render({pending:()=>t,error:t=>{const i=jt(this.token);return i?.exp&&i.exp<Date.now()/1e3?n`<mq-layout background="transparent"><expired-appointment-error-view></expired-appointment-error-view></mq-layout>`:f(t)&&t.response?.status&&t.response.status<500?e:n`<mq-layout background="transparent"><unexpected-error-view></unexpected-error-view></mq-layout>`},complete:({appointment:i,hasNps:o})=>{if(this.opentokController?.isLoading)return t;if(this.opentokController?.errorMessage||!this.opentokController)return e;if(this.screen===ht)return n`<mq-layout background="transparent"><not-time-yet-view .appointment="${i}"></not-time-yet-view></mq-layout>`;if(this.screen===mt)return n`<mq-layout background="transparent"><review-view .appointment="${i}" @review-submitted="${()=>{this.screen=pt}}" @review-skipped="${()=>{this.screen=pt}}" @review-reconnect="${()=>{this.screen=dt}}"></review-view></mq-layout>`;if(this.screen===pt)return n`<mq-layout background="transparent"><documentation-view .appointment="${i}" .token="${this.token}" ?can-reconnect="${!o}" @reconnect="${()=>{this.screen=dt}}"></documentation-view></mq-layout>`;if(this.screen===dt||this.screen===ct){const e=this.opentokController.session;return e?n`<waiting-room-layout .appointment="${i}" ?is-waiting-room="${this.screen===dt}"><mq-videocall-content .apiKey="${this.apiKey}" .token="${this.token}" .session="${e}" .streams="${this.opentokController?.streams??[]}" ?is-waiting-room="${this.screen===dt}" ?is-reconnecting="${this.opentokController.isReconnecting}" .appointment="${i}"></mq-videocall-content></waiting-room-layout>`:t}return n`<mq-layout background="transparent"><unexpected-error-view></unexpected-error-view></mq-layout>`}})}};t([r({type:String,attribute:"appointment-id"})],It.prototype,"appointmentId",void 0),t([r({type:String,attribute:"api-key"})],It.prototype,"apiKey",void 0),t([r({type:String})],It.prototype,"token",void 0),t([y()],It.prototype,"screen",void 0),t([l({context:at})],It.prototype,"opentokService",void 0),t([l({context:lt})],It.prototype,"params",void 0),It=t([e("mq-videocall-provider")],It);let Rt=class PermissionsRequiredErrorView extends i{static{this.styles=o`.img-container{display:flex;justify-content:center}img{width:100%;height:auto;max-width:229px}`}render(){return n`<error-view .title="${k("Acepta los permisos de cámara y micrófono")}" .message="${k("Parece que has denegado los permisos necesarios para entrar a la videollamada. Edita los permisos en tu navegador para entrar. Una vez concedidos, debes refrescar esta pantalla.")}"><div class="img-container" slot="icon"><img src="${`${x.ASSETS_BASE_URL}/wc-videocall/Miccam_asset.png`}" alt="Miccam_asset" width="229" height="166.44"></div></error-view>`}};Rt=t([$(),e("permissions-required-error-view")],Rt);let Vt=class MqVideocall extends i{constructor(){super(...arguments),this._permissionController=new PermissionController(this)}static{this.styles=o`:host{display:block;width:100%;height:100%}.loading-spinner-container{height:100%;display:flex;flex-direction:column;justify-content:center;align-items:center}.permissions-required-error-view-container{height:100%;padding-left:var(--size-4);padding-right:var(--size-4);display:grid;place-items:center}`}render(){return"prompt"===this._permissionController.state?n`<div class="loading-spinner-container">${a({color:"var(--color-primary)"})}</div>`:"denied"===this._permissionController.state?n`<div class="permissions-required-error-view-container"><permissions-required-error-view></permissions-required-error-view></div>`:n`<mq-videocall-provider .appointmentId="${this.appointmentId}" .token="${this.token}" .apiKey="${this.apiKey}"></mq-videocall-provider>`}};t([r({type:String,attribute:"appointment-id"})],Vt.prototype,"appointmentId",void 0),t([r({type:String,attribute:"api-key"})],Vt.prototype,"apiKey",void 0),t([r({type:String})],Vt.prototype,"token",void 0),Vt=t([e("mq-videocall")],Vt);export{Vt as MqVideocall};
|
|
1
|
+
import{_ as t,t as e}from"./chunks/custom-element-DA9Fxvxd.js";import{a as i,i as o,E as s,x as n}from"./chunks/lit-element-DiWJYFwC.js";import{n as r}from"./chunks/property-scuRaFcM.js";import{spinnerIcon as a}from"./ui/icons/spinner-icon.js";import{e as l}from"./chunks/provide-CfT7g_Zi.js";import{h as d,s as c}from"./chunks/task-Bj8p7kJX.js";import{j as p,d as h,b as m,C as u,g as v,D as g,c as b,i as f}from"./chunks/api-chat-client-C8SqZtCa.js";import{r as y}from"./chunks/state-LQivXIgA.js";import{n as w}from"./chunks/context-provider-CiMFpvDA.js";import{env as x}from"./env.js";import{m as k}from"./chunks/runtime-Bg1WXVCx.js";import{l as $}from"./chunks/parseISO-jT42c8Ob.js";import{t as z,x as _,a as S,y as q,z as T,A as C,g as O,B as E,c as j,C as I,D as R}from"./chunks/telemetry-client-BRVJU-fZ.js";import{getLocale as V}from"./i18n.js";import{calendarIcon as A}from"./ui/icons/calendar-icon.js";import"./ui/back-link.js";import{Q as D,c as P,M as U}from"./chunks/mutation-controller-OVT8NEt6.js";import{MqViewAppointmentsEvent as N,DownloadFileEvent as M}from"./events.js";import{clockIcon as W}from"./ui/icons/clock-icon.js";import{infoCircleOutineIcon as F}from"./ui/icons/info-circle-outine-icon.js";import"./ui/mq-button.js";import{l as L}from"./chunks/chunk-S5RWG6G2-oTcdgk2H.js";import{messageBubbleIcon as K}from"./ui/icons/message-bubble-icon.js";import{g as B}from"./chunks/exports-G_7Ih_GH.js";import"./ui/mq-floating-bubble.js";import"./ui/mq-card.js";import"./ui/mq-unread-badge.js";import{chatbubbleIcon as Q}from"./ui/icons/chat-bubble-icon.js";import{micIcon as H}from"./ui/icons/mic-icon.js";import{micOffIcon as G}from"./ui/icons/mic-off-icon.js";import{videoIcon as Z}from"./ui/icons/video-icon.js";import{videoOffIcon as Y}from"./ui/icons/video-off-icon.js";import{g as J}from"./chunks/get-organization-setup-query-BMbuRi6v.js";import{l as X}from"./chunks/external-zAbuzxDj.js";import{e as tt}from"./chunks/query-CeeutdfT.js";import{downloadIcon as et}from"./ui/icons/download-icon.js";import{alertCircleIcon as it}from"./ui/icons/alert-circle-icon.js";import"./ui/mq-rating.js";import{toast as ot}from"./ui/mq-toast.js";import{heartBeatIcon as st}from"./ui/icons/heartbeat-icon.js";import{timeLeftIcon as nt}from"./ui/icons/time-left-icon.js";import"./chunks/mq-layout-CpIZTsV2.js";import"./ui/icons/types.js";import"./chunks/format-Cm3B1GMy.js";import"./chunks/isBefore-Cof0D841.js";import"./chunks/context-request-event-Dfydf1ub.js";import"./ui/icons/chevron-down-icon.js";import"./chunks/if-defined-BYeVdwgd.js";import"./ui/mq-text-button.js";import"./chunks/class-map-Co76I6aw.js";import"./chunks/directive-2EDmOukv.js";import"./ui/mq-avatar.js";import"./ui/icons/chevron-left-icon.js";import"./chunks/query-QJ1INUTG.js";import"./theme.js";import"./ui/icons/x-icon.js";import"./ui/mq-skeleton.js";import"./chunks/style-map-CIdqdn7C.js";import"./ui/icons/check-double-icon.js";import"./ui/icons/check-icon.js";import"./chunks/chunk-YTQUGGS3-DN-JZpgG.js";class PermissionController{constructor(t){this.state="prompt",this.host=t,t.addController(this)}async hostConnected(){await this.requestPermissions()}async requestPermissions(){try{const t=await navigator.mediaDevices.getUserMedia({video:!0,audio:!0});for(const e of t.getTracks())e.stop();this.state="granted"}catch{this.state="denied"}finally{this.host.requestUpdate()}}}class InvalidTokenError extends Error{}function rt(t){let e=t.replace(/-/g,"+").replace(/_/g,"/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw new Error("base64 string is not of the correct length")}try{return function(t){return decodeURIComponent(atob(t).replace(/(.)/g,(t,e)=>{let i=e.charCodeAt(0).toString(16).toUpperCase();return i.length<2&&(i="0"+i),"%"+i}))}(e)}catch(t){return atob(e)}}InvalidTokenError.prototype.name="InvalidTokenError";const at=w(Symbol("opentok-service")),lt=w(Symbol("params"));class OpenTokService{static{this.URL="https://static.opentok.com/v2/js/opentok.min.js"}_ensureLoaded(){if(!window.OT)throw new Error("OpenTok SDK is not loaded");return window.OT}load(){return new Promise((t,e)=>{if(window.OT)return void t();const i=document.createElement("script");i.src=OpenTokService.URL,i.onload=()=>{t()},i.onerror=e,document.head.appendChild(i)})}initSession(t,e){return this._ensureLoaded().initSession(t,e)}initPublisher(t,e,i){return this._ensureLoaded().initPublisher(t,e,i)}subscribe(t,e,i,o,s){return t.subscribe(e,i,o,s)}}const dt="waiting-room",ct="videocall",pt="documentation",ht="not-time-yet",mt="review";class OpenTokController{constructor(t,e,i,o,s){this.isLoading=!0,this.isSessionReady=!1,this.isReconnecting=!1,this.errorMessage="",this.session=null,this.streams=[],this.destroyedStreamIds=new Set,this.openTokService=new OpenTokService,this.session_token=null,this.hasLeftWaitingRoom=!1,this.host=t,t.addController(this),this.appointment=e,this.token=i,this.onCallStarted=o,this.onCallFinished=s,this._loadOpentok()}async _loadOpentok(){try{await this.openTokService.load(),this._initializeSession()}catch{this.isLoading=!1,this.errorMessage="Failed to load OpenTok script",this.host.requestUpdate()}}async _getSessionAndToken(){const t=await m.flash.joinCall({callId:this.appointment.call_id});return this.session_token=t.session_token,[t.session_id,t.session_token]}async _initializeSession(){try{const[t,e]=await this._getSessionAndToken();this.session=this.openTokService.initSession(x.OPENTOK_API_KEY,t),this.session.on("sessionConnected",()=>{this.isLoading=!1,this.isSessionReady=!0,this.host.requestUpdate()}),this.session.on("sessionDisconnected",()=>{this.isSessionReady=!1,this._leaveWaitingRoom(),setTimeout(()=>{this.onCallFinished(),this.host.requestUpdate()},1e3),this.host.requestUpdate()}),this.session.on("sessionReconnecting",()=>{this.isReconnecting=!0,this.host.requestUpdate()}),this.session.on("sessionReconnected",()=>{this.isReconnecting=!1;const t=this.streams.filter(t=>!this.destroyedStreamIds.has(t.streamId));this.streams=[],this.host.requestUpdate(),requestAnimationFrame(()=>{this.streams=t.filter(t=>!this.destroyedStreamIds.has(t.streamId)),this.host.requestUpdate()})}),this.session.on("streamCreated",t=>{this.streams=[...this.streams,t.stream],this.onCallStarted(),this.host.requestUpdate()}),this.session.on("streamDestroyed",t=>{t.stream?.streamId&&this.destroyedStreamIds.add(t.stream.streamId),setTimeout(()=>{this.streams=this.streams.filter(e=>e.streamId!==t.stream?.streamId),this._leaveWaitingRoom(),this.onCallFinished(),this.host.requestUpdate()},1e3)}),this.session.connect(e,t=>{t&&(this.isLoading=!1,this.errorMessage=`Failed to connect to session: ${t.message}`,this.host.requestUpdate())}),m.flash.setReady({professional_hash:this.appointment.from.hash,consultation_id:this.appointment.id,consultation_type:"appointment"})}catch(t){this.isLoading=!1,this.errorMessage=`Error initializing session: ${t instanceof Error?t.message:"Unknown error"}`,this.host.requestUpdate()}}_leaveWaitingRoom(){this.hasLeftWaitingRoom||(this.hasLeftWaitingRoom=!0,m.flash.leaveWaitingRoom({professional_hash:this.appointment.from.hash,consultation_id:this.appointment.id,consultation_type:"appointment"}))}hostDisconnected(){this._leaveWaitingRoom(),this.session&&(this.session.disconnect(),this.session.off("streamCreated"),this.session.off("streamDestroyed"),this.session.off("sessionConnected"),this.session.off("sessionDisconnected"),this.session.off("sessionReconnecting"),this.session.off("sessionReconnected"))}}let ut=class ChatCta extends i{constructor(){super(...arguments),this.text=k("Utiliza el chat para enviar el motivo de consulta, documentos o imágenes"),this.readonly=!1,this.isChatOpen=!1,this.unreadQuery=new D(this,()=>B(m,{roomId:this.roomId}))}static{this.styles=[o`.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 n`<mq-card class="chat-cta" roundness="md"><div class="cta-message">${F({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})} ${k("Chatea con el profesional")} ${(this.unreadQuery.result?.data?.unread_count??0)>0?n`<mq-unread-badge></mq-unread-badge>`:s}</mq-button></mq-card><mq-floating-bubble ?dismissable="${!1}" .open="${this.isChatOpen}" @mq-close="${()=>{this.isChatOpen=!1}}" hideCloseButton>${this.isChatOpen?n`<mq-chat-room slot="content" .consultationId="${this.consultationId}" .consultationType="${u.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>`:s}</mq-floating-bubble>`}};t([r({type:Number})],ut.prototype,"roomId",void 0),t([r({type:String})],ut.prototype,"professionalHash",void 0),t([r({type:String})],ut.prototype,"text",void 0),t([r({type:String})],ut.prototype,"consultationId",void 0),t([r({type:Boolean,reflect:!0})],ut.prototype,"readonly",void 0),t([r({attribute:!1})],ut.prototype,"onOpenChat",void 0),t([P({context:L})],ut.prototype,"loginToken",void 0),t([y()],ut.prototype,"isChatOpen",void 0),ut=t([$(),e("chat-cta")],ut);let vt=class NotTimeYetView extends i{static{this.styles=[o`back-link{display:block;margin-bottom:var(--size-3)}.title{font-family:var(--font-titles);font-size:var(--text-2xl);line-height:var(--text-2xl--line-height);color:var(--color-neutrals-text-default);font-weight:var(--font-weight-bold);margin:0;margin-bottom:var(--size-3)}.description{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);margin:0;margin-bottom:var(--size-3)}.details-card{background-color:var(--color-background);border-radius:var(--border-radius-xl);padding:var(--size-6) var(--size-4);display:flex;min-width:0;flex-direction:column;gap:var(--size-6);margin-bottom:var(--size-6)}.details-card-title{padding:14px 0;font-size:var(--text-base);line-height:100%;font-weight:var(--font-weight-medium);color:var(--color-gray-darker);text-align:left}.details-rows{display:flex;flex-direction:column;gap:var(--size-3)}.details-row{display:flex;align-items:center;gap:var(--size-2);font-family:var(--font-body);font-size:var(--text-base);line-height:var(--text-base--line-height);color:var(--color-neutrals-text-default);font-weight:var(--font-weight-semibold)}.details-row span::first-letter{text-transform:uppercase}@media (min-width:768px){.title{font-size:var(--text-5xl);line-height:var(--text-5xl--line-height)}.description{font-size:var(--text-base);line-height:var(--text-base--line-height);margin-bottom:var(--sp-6)}}`]}firstUpdated(){z.track(_(this.loginToken.patient.hash,this.appointment.id??""))}render(){const t=V()?.replace("_","-")??"es-ES",e=this.loginToken.patient.timezone,i=new Intl.DateTimeFormat(t,{dateStyle:"full",...e?{timeZone:e}:{}}),o=new Intl.DateTimeFormat(t,{timeStyle:"short",...e?{timeZone:e}:{}}),s=new Date(this.appointment.start_date),r=S(s,this.appointment.duration),a=e?v(e,s):"";return n`<back-link @mq-back="${t=>{t.stopPropagation(),this.dispatchEvent(new N({tab:"next"}))}}">${k("Salir")}</back-link><h1 class="title">${k("¡Aún no es la hora!")}</h1><p class="description">${k("Cuando falten 10 minutos para tu consulta, podrás acceder a la videoconsulta")}</p><div class="details-card"><professional-overview .name="${this.appointment.from.name??""}" .specialtyName="${this.appointment.from.speciality??""}" .collegiateNumber="${this.appointment.from.collegiate_number??void 0}" .description="${this.appointment.from.description??""}" .languages="${this.appointment.from.languages}" .avatar="${this.appointment.from.avatar??""}"></professional-overview><div class="details-rows"><div class="details-row">${A({size:24})} <span>${i.format(s)}</span></div><div class="details-row">${W({size:24})} <span>${o.format(s)} - ${o.format(r)}${a?` (${a})`:""}</span></div></div></div><chat-cta .consultationId="${this.appointment.id}" .roomId="${Number(this.appointment.room_id)}" .professionalHash="${this.appointment.from.hash}" .text="${k("Utiliza el chat para enviar el motivo de consulta, documentos o imágenes")}" .onOpenChat="${()=>{z.track(q(this.loginToken.patient.hash,this.appointment.id??""))}}"></chat-cta>`}};t([r({type:Object})],vt.prototype,"appointment",void 0),t([P({context:L})],vt.prototype,"loginToken",void 0),vt=t([$(),e("not-time-yet-view")],vt);let gt=class PermissionStatusBanner extends i{static{this.styles=o`:host{display:block;padding:var(--size-5) var(--size-6);background-color:#ebf9ff;border-radius:var(--border-radius-lg);text-align:center}span{color:var(--color-neutrals-text-default);font-size:var(--text-sm);line-height:var(--text-sm--line-height);font-weight:var(--font-weight-normal)}`}render(){return n`<span>${k("Espera a ser atendido sin salir de esta pantalla")}</span>`}};gt=t([$(),e("permission-status-banner")],gt);let bt=class WaitingRoomLayout extends i{constructor(){super(...arguments),this.isWaitingRoom=!1}static{this.styles=o`.information-container{padding:var(--size-5) var(--size-4);background-color:var(--color-neutrals-background-disabled)}.content{max-width:560px;margin:0 auto}.information-container h2{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(--size-4)}.information-container p{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}.video-container{margin-left:auto;margin-right:auto;margin-bottom:var(--size-6);position:relative;max-height:301px;aspect-ratio:9/16;border-radius:16px;overflow:hidden}@media (min-width:768px){.information-container{background-color:transparent;padding:var(--size-6) 0}.video-container{max-height:454px;aspect-ratio:16/9}.information-container h2{font-size:var(--text-4xl);line-height:var(--text-4xl--line-height)}.information-container p{font-size:var(--text-base);line-height:var(--text-base--line-height)}}`}firstUpdated(){this.isWaitingRoom&&z.track(T(this.loginToken.patient.hash,this.appointment.id??""))}render(){if(!this.isWaitingRoom)return n`<slot></slot>`;const t=V()?.replace("_","-")??"es-ES",e=this.loginToken.patient.timezone,i=e?{timeZone:e}:{},o=new Intl.DateTimeFormat(t,{dateStyle:"short",...i}),s=new Intl.DateTimeFormat(t,{timeStyle:"short",...i}),r=new Date(this.appointment.start_date),a=S(r,this.appointment.duration),l=e?v(e,r):"",d=o.format(r),c=`${s.format(r)} - ${s.format(a)}${l?` (${l})`:""}`;return n`<permission-status-banner></permission-status-banner><div class="content"><div class="information-container"><back-link @mq-back="${t=>{t.stopPropagation(),this.dispatchEvent(new N({tab:"next"}))}}">${k("Salir")}</back-link><h2>${k("Sala de espera")}</h2><div class="doctor-info"><p>${this.appointment.from.name}</p><p>${d}</p><p>${c}</p></div></div><div class="video-container"><slot></slot></div><chat-cta .consultationId="${this.appointment.id}" .roomId="${Number(this.appointment.room_id)}" .professionalHash="${this.appointment.from.hash}" .text="${k("Utiliza el chat para enviar el motivo de consulta, documentos o imágenes")}" .onOpenChat="${()=>{z.track(q(this.loginToken.patient.hash,this.appointment.id??""))}}"></chat-cta></div>`}};t([r({type:Object})],bt.prototype,"appointment",void 0),t([r({type:Boolean,attribute:"is-waiting-room"})],bt.prototype,"isWaitingRoom",void 0),t([P({context:L})],bt.prototype,"loginToken",void 0),bt=t([e("waiting-room-layout")],bt);class AppointmentCounterController{constructor(t,e){this.startsAtGetter=e,this.formattedTime="--:--",this.interval=null,this.host=t,t.addController(this)}async hostConnected(){this.interval=setInterval(()=>{const t=new Date,e=this.startsAtGetter(),i=t.getTime()-e.getTime(),o=Math.floor(i/1e3),s=Math.floor(o/60),n=o%60;this.formattedTime=`${s.toString().padStart(2,"0")}:${n.toString().padStart(2,"0")}`,this.host.requestUpdate()},1e3)}hostDisconnected(){this.interval&&clearInterval(this.interval)}}class ToggleAudioEvent extends Event{static{this.eventName="toggle-audio"}constructor(t){super(ToggleAudioEvent.eventName,{bubbles:!0,composed:!0}),this.isAudioOn=t}}class ToggleVideoEvent extends Event{static{this.eventName="toggle-video"}constructor(t){super(ToggleVideoEvent.eventName,{bubbles:!0,composed:!0}),this.isVideoOn=t}}class ToggleChatEvent extends Event{static{this.eventName="toggle-chat"}constructor(t){super(ToggleChatEvent.eventName,{bubbles:!0,composed:!0}),this.isChatOpen=t}}class ViewDocumentationEvent extends Event{static{this.eventName="view-documentation"}constructor(){super(ViewDocumentationEvent.eventName,{bubbles:!0,composed:!0})}}class DownloadFileEvent extends Event{static{this.eventName="download-file"}constructor(t,e){super(DownloadFileEvent.eventName,{bubbles:!0,composed:!0}),this.url=t,this.filename=e}}let ft=class PublisherControls extends i{constructor(){super(...arguments),this.isAudioOn=!1,this.isVideoOn=!0,this.isChatOpen=!1,this.chatEnabled=!1,this.isWaitingRoom=!1,this.unreadQuery=new D(this,()=>B(m,{roomId:this.roomId}))}static{this.styles=o`:host{display:flex;justify-content:space-between;gap:var(--size-4)}:host([is-waiting-room]){justify-content:center}.left-controls{display:flex;gap:var(--size-4)}.control-button{border:none;cursor:pointer;display:flex;align-items:center;justify-content:center;width:var(--size-10);height:var(--size-10);padding:var(--size-2);border-radius:12.5px;transition:all .2s ease-in-out}@media (min-width:768px){.control-button{width:var(--size-11);height:var(--size-11);padding:var(--size-2);border-radius:16px}}.control-button:hover{background-color:var(--color-gray-light)}.control-button:focus-visible{outline:0;box-shadow:0 0 0 2px var(--color-primary-light)}.control-button--on{background-color:var(--color-white);color:var(--color-primary)}.control-button--off{background-color:var(--color-white);color:var(--color-negative)}`}toggleAudio(){this.dispatchEvent(new ToggleAudioEvent(!this.isAudioOn))}toggleVideo(){this.dispatchEvent(new ToggleVideoEvent(!this.isVideoOn))}toggleChat(){this.dispatchEvent(new ToggleChatEvent(!this.isChatOpen))}render(){return n`<div class="left-controls">${this.isWaitingRoom||!this.chatEnabled?s:n`<button type="button" class="control-button control-button--on" @click="${this.toggleChat}">${Q({size:20})} ${(this.unreadQuery.result?.data?.unread_count??0)>0?n`<mq-unread-badge></mq-unread-badge>`:s}</button>`} <button type="button" class="control-button ${this.isAudioOn?"control-button--on":"control-button--off"}" @click="${this.toggleAudio}">${this.isAudioOn?H({size:20}):G({size:20})}</button> <button type="button" class="control-button ${this.isVideoOn?"control-button--on":"control-button--off"}" @click="${this.toggleVideo}">${this.isVideoOn?Z({size:20}):Y({size:20})}</button></div>`}};t([r({type:Boolean})],ft.prototype,"isAudioOn",void 0),t([r({type:Boolean})],ft.prototype,"isVideoOn",void 0),t([r({type:Boolean})],ft.prototype,"isChatOpen",void 0),t([r({type:Boolean})],ft.prototype,"chatEnabled",void 0),t([r({type:Boolean,reflect:!0,attribute:"is-waiting-room"})],ft.prototype,"isWaitingRoom",void 0),t([r({type:Number})],ft.prototype,"roomId",void 0),ft=t([e("publisher-controls")],ft);let yt=class VideoPublisher extends i{constructor(){super(...arguments),this.isWaitingRoom=!1,this.appointmentCounterController=new AppointmentCounterController(this,()=>new Date(this.startsAt)),this.getOrganizationSetupQuery=new D(this,()=>J(m)),this.isAudioOn=!0,this.isVideoOn=!0,this.isChatOpen=!1,this._handleVisibilityChange=()=>{"visible"===document.visibilityState&&this.publisher&&(this.publisher.publishAudio(!1),this.publisher.publishVideo(!1),setTimeout(()=>{this.publisher?.publishAudio(this.isAudioOn),this.publisher?.publishVideo(this.isVideoOn)},500))}}static{this.styles=o`:host{width:100%;height:100%;display:block}.OT_video-element{width:100%;height:100%;background:var(--color-black)}.OT_mute{display:none}video{border-radius:var(--border-radius-lg)}#video-publisher{width:100%;height:100%;transition:width .5s ease-in-out,height .5s ease-in-out;border-radius:var(--border-radius-lg)}:host(:not([is-waiting-room])) #video-publisher{width:121px;height:200px;z-index:50;border-radius:12px;overflow:hidden}:host([is-waiting-room]) .top-items{position:absolute;inset:0}:host(:not([is-waiting-room])) .top-items{position:absolute;z-index:50;top:var(--size-4);left:var(--size-4);right:var(--size-4);display:flex;justify-content:space-between;gap:var(--size-1)}.meta-container{display:flex;align-items:flex-start;gap:var(--size-1);min-width:0}.meta-item{background-color:var(--color-neutrals-text-default);padding:var(--size-2) var(--size-3);color:var(--color-white);font-size:var(--text-xs);line-height:var(--text-xs--line-height);flex-shrink:0}.meta-item:first-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;flex-shrink:1;min-width:0}publisher-controls{position:absolute;z-index:50;bottom:var(--size-4);left:var(--size-4);right:var(--size-4)}mq-chat-room{height:100%}@media (min-width:768px){:host(:not([is-waiting-room])) #video-publisher{width:250px;height:auto;aspect-ratio:16/9}:host(:not([is-waiting-room])) .top-items{top:var(--size-6);left:var(--size-6);right:var(--size-6)}}`}firstUpdated(t){super.firstUpdated(t),this.publisher=this.openTokService.initPublisher(this.publisherEl,{fitMode:"contain",width:"100%",height:"100%",audioFallbackEnabled:!1,insertMode:"append",mirror:!1,publishAudio:this.isAudioOn,publishVideo:this.isVideoOn},t=>{t&&X.error("error initializing publisher",t),this.session.publish(this.publisher)}),document.addEventListener("visibilitychange",this._handleVisibilityChange)}disconnectedCallback(){document.removeEventListener("visibilitychange",this._handleVisibilityChange),super.disconnectedCallback(),this.publisher?.destroy()}async _handleToggleAudioEvent(t){this.isAudioOn=t.isAudioOn,this.publisher.publishAudio(t.isAudioOn)}async _handleToggleVideoEvent(t){this.isVideoOn=t.isVideoOn,this.publisher.publishVideo(t.isVideoOn)}async _handleToggleChatEvent(t){this.isChatOpen=t.isChatOpen}render(){const t=!0===this.getOrganizationSetupQuery.result?.data?.appointments?.has_chat_in_appointment;return n`<div class="top-items">${this.isWaitingRoom?n`<div></div>`:n`<div class="meta-container"><span class="meta-item">${this.professionalName}</span> <span class="meta-item">${this.appointmentCounterController.formattedTime}</span></div>`}<div id="video-publisher"></div></div><publisher-controls .isAudioOn="${this.isAudioOn}" .isVideoOn="${this.isVideoOn}" .isChatOpen="${this.isChatOpen}" .chatEnabled="${t}" .roomId="${Number.parseInt(this.roomId,10)}" ?is-waiting-room="${this.isWaitingRoom}" @toggle-audio="${this._handleToggleAudioEvent}" @toggle-video="${this._handleToggleVideoEvent}" @toggle-chat="${this._handleToggleChatEvent}"></publisher-controls>${t?n`<mq-floating-bubble ?dismissable="${!1}" .open="${this.isChatOpen}" @mq-close="${()=>{this.isChatOpen=!1}}" hideCloseButton>${this.isChatOpen?n`<mq-chat-room slot="content" .consultationId="${this.consultationId}" .consultationType="${u.appointment}" token="${this.loginToken.access_token}" .roomId="${Number.parseInt(this.roomId,10)}" .professionalHash="${this.professionalHash}" @mq-chat-room-close="${()=>{this.isChatOpen=!1}}"></mq-chat-room>`:s}</mq-floating-bubble>`:s}`}};t([r({type:String})],yt.prototype,"consultationId",void 0),t([r({type:String})],yt.prototype,"apiKey",void 0),t([r({type:String})],yt.prototype,"token",void 0),t([r({type:String})],yt.prototype,"roomId",void 0),t([r({type:String})],yt.prototype,"professionalHash",void 0),t([r({type:Object})],yt.prototype,"session",void 0),t([r({type:String})],yt.prototype,"professionalName",void 0),t([r({type:String})],yt.prototype,"startsAt",void 0),t([r({type:Boolean,reflect:!0,attribute:"is-waiting-room"})],yt.prototype,"isWaitingRoom",void 0),t([P({context:at})],yt.prototype,"openTokService",void 0),t([P({context:L})],yt.prototype,"loginToken",void 0),t([tt("#video-publisher")],yt.prototype,"publisherEl",void 0),t([y()],yt.prototype,"isAudioOn",void 0),t([y()],yt.prototype,"isVideoOn",void 0),t([y()],yt.prototype,"isChatOpen",void 0),yt=t([e("video-publisher")],yt);let wt=class VideoSubscriber extends i{constructor(){super(...arguments),this.isVideoOn=!0,this._subscriberProperties={fitMode:"contain",insertMode:"append",width:"100%",height:"100%"},this._handleVisibilityChange=()=>{"visible"===document.visibilityState&&this.subscriber&&(this.subscriber.subscribeToAudio(!1),this.subscriber.subscribeToVideo(!1),setTimeout(()=>{this.subscriber?.subscribeToAudio(!0),this.subscriber?.subscribeToVideo(!0)},500),setTimeout(()=>this._resubscribe(),600))}}static{this.styles=o`:host{position:absolute;inset:0}.OT_subscriber{width:100%;height:100%;position:absolute;inset:0;background:var(--color-neutrals-background-default)}video{width:100%;height:100%}.video-disabled{position:absolute;inset:0;background:var(--color-gray-dark)}.hidden{display:none}`}firstUpdated(){this._subscribe(),document.addEventListener("visibilitychange",this._handleVisibilityChange)}_subscribe(){this.subscriber=this.openTokService.subscribe(this.session,this.stream,this.subscriberEl,this._subscriberProperties,t=>{}),this._attachSubscriberEvents()}_attachSubscriberEvents(){this.subscriber.on("connected",t=>{this.isVideoOn=t.target.stream?.hasVideo??!0}),this.subscriber.on("videoDisabled",()=>{this.isVideoOn=!1}),this.subscriber.on("videoEnabled",()=>{this.isVideoOn=!0}),this.subscriber.on("disconnected",()=>{this.isVideoOn=!1})}_resubscribe(){if(this.subscriber&&this.session&&this.subscriberEl){try{this.session.unsubscribe(this.subscriber)}catch{}this.subscriberEl.innerHTML="",this._subscribe()}}disconnectedCallback(){if(document.removeEventListener("visibilitychange",this._handleVisibilityChange),this.subscriber&&this.session)try{this.session.unsubscribe(this.subscriber)}catch{}super.disconnectedCallback()}render(){return n`<div id="video-subscriber" class="${this.isVideoOn?"":"hidden"}"></div>${this.isVideoOn?n``:n`<div class="video-disabled"></div>`}`}};t([r({type:Object})],wt.prototype,"session",void 0),t([r({type:Object})],wt.prototype,"stream",void 0),t([y()],wt.prototype,"isVideoOn",void 0),t([P({context:at})],wt.prototype,"openTokService",void 0),t([tt("#video-subscriber")],wt.prototype,"subscriberEl",void 0),wt=t([e("video-subscriber")],wt);let xt=class VideocallContent extends i{constructor(){super(...arguments),this.streams=[],this.isWaitingRoom=!1,this.isReconnecting=!1}static{this.styles=o`:host{display:block;position:relative;width:100%;height:100%;background:var(--color-gray-darkest);aspect-ratio:16/9}.reconnecting-overlay{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--size-3);background:rgba(0,0,0,.6);z-index:100}.reconnecting-overlay__text{color:var(--color-white);font-size:var(--text-sm);line-height:var(--text-sm--line-height)}.reconnecting-overlay__subtitle{color:var(--color-white);font-size:var(--text-xs);line-height:var(--text-xs--line-height);opacity:.85}`}firstUpdated(){this.isWaitingRoom||z.track(C(this.loginToken.patient.hash,this.appointment.id??""))}updated(t){t.has("isWaitingRoom")&&!0===t.get("isWaitingRoom")&&!this.isWaitingRoom&&z.track(C(this.loginToken.patient.hash,this.appointment.id??""))}render(){return n`<video-publisher .consultationId="${this.appointment.id}" .session="${this.session}" ?is-waiting-room="${this.isWaitingRoom}" .professionalName="${this.appointment.from.name??""}" .professionalHash="${this.appointment.from.hash}" .startsAt="${this.appointment.started_at??(new Date).toISOString()}" .apiKey="${this.apiKey}" .token="${this.token}" .roomId="${this.appointment.room_id}"></video-publisher>${0===this.streams.length?n``:this.streams.map(t=>n`<video-subscriber .session="${this.session}" .stream="${t}"></video-subscriber>`)} ${this.isReconnecting?n`<div class="reconnecting-overlay">${a({color:"var(--color-white)"})} <span class="reconnecting-overlay__text">${k("Reconectando...")} </span><span class="reconnecting-overlay__subtitle">${k("Espere mientras se restablece la conexión")}</span></div>`:""}`}};t([r({type:Object})],xt.prototype,"session",void 0),t([r({type:Array})],xt.prototype,"streams",void 0),t([r({type:String})],xt.prototype,"apiKey",void 0),t([r({type:String})],xt.prototype,"token",void 0),t([r({type:Object})],xt.prototype,"appointment",void 0),t([r({type:Boolean,reflect:!0,attribute:"is-waiting-room"})],xt.prototype,"isWaitingRoom",void 0),t([r({type:Boolean,reflect:!0,attribute:"is-reconnecting"})],xt.prototype,"isReconnecting",void 0),t([P({context:L})],xt.prototype,"loginToken",void 0),xt=t([$(),e("mq-videocall-content")],xt);let kt=class PageLayout extends i{constructor(){super(...arguments),this.yCentered=!1,this.background="solid"}static{this.styles=o`: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 n`<div><main><slot></slot></main></div>`}};t([r({type:Boolean,attribute:"y-centered"})],kt.prototype,"yCentered",void 0),t([r({type:String})],kt.prototype,"background",void 0),kt=t([e("page-layout")],kt);const $t=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 zt=class PatientDocument extends i{constructor(){super(...arguments),this.isDownloading=!1}static{this.styles=$t}getFormatter(){const t=V().replace("_","-");return new Intl.DateTimeFormat(t,{year:"numeric",month:"numeric",day:"numeric"})}async _handleDownload(){this.isDownloading=!0;const t=await m.flash.downloadDocument({url:this.downloadUrl}),e=await async function(t){return new Promise((e,i)=>{const o=new FileReader;o.onloadend=()=>e(o.result),o.onerror=i,o.readAsDataURL(t)})}(t);this.dispatchEvent(new M({url:e,filename:`${this.filename}.pdf`})),this.isDownloading=!1}formatKind(t){switch(t){case g.prescription:return k("Receta");case g.report:return k("Informe");case g.diagnosticTestPrescription:return k("Prescripción")}}render(){const t=this.getFormatter().format(new Date(this.date));return n`<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}">${et({size:24})}</mq-button>`}};t([r({type:String})],zt.prototype,"kind",void 0),t([r({type:String})],zt.prototype,"filename",void 0),t([r({type:String})],zt.prototype,"specialty",void 0),t([r({type:String})],zt.prototype,"description",void 0),t([r({type:String})],zt.prototype,"date",void 0),t([r({type:String})],zt.prototype,"downloadUrl",void 0),t([y()],zt.prototype,"isDownloading",void 0),zt=t([$(),e("patient-document")],zt);const _t=o`.title{margin:var(--size-3) 0;font-family:var(--font-titles);font-size:var(--text-2xl);line-height:var(--text-2xl--line-height);color:var(--color-neutrals-text-default);font-weight:var(--font-weight-bold)}.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 St=class DocumentationView extends i{constructor(){super(...arguments),this.canReconnect=!1,this._sharedocumentsTask=new d(this,{task:async([t])=>await m.flash.getSharedDocuments({appointment_id:t}),args:()=>[this.appointment.id]}),this.getOrganizationSpecialtiesQuery=new D(this,()=>O(m)),this.getOrganizationSetupQuery=new D(this,()=>J(m)),this._reconnectMutation=new U(this,{mutationFn:t=>m.appointments.reconnectAppointment(t),onSuccess:()=>{this.dispatchEvent(new CustomEvent("reconnect",{bubbles:!0,composed:!0}))}})}static{this.styles=_t}firstUpdated(){z.track(E(this.loginToken.patient.hash,this.appointment.id??""))}render(){const t=!0===this.getOrganizationSetupQuery.result?.data?.appointments?.has_chat_in_appointment,e=V(),i=e.replace("_","-"),o=this.loginToken.patient.timezone,r=o?{timeZone:o}:{},a=new Intl.DateTimeFormat(i,{dateStyle:"full",...r}),l=new Intl.DateTimeFormat(i,{hour:"2-digit",minute:"2-digit",...r}),d=new Date(this.appointment.start_date),p=S(d,this.appointment.duration),h=o?v(o,d):"";return n`<back-link @mq-back="${t=>{t.stopPropagation(),this.dispatchEvent(new N({tab:"history"}))}}">${k("Salir")}</back-link><h1 class="title">${k("Consulta finalizada")}</h1><p class="description">${k("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>${A()}</dt><dd>${a.format(d)}</dd></div><div class="description-list-item"><dt>${W()}</dt><dd>${l.format(d)} - ${l.format(p)}${h?` (${h})`:""}</dd></div></dl></mq-card><mq-card class="documents-card" roundness="md"><h2 class="documents-card-title">${k("Documentación")}</h2><div class="documents-list">${this._sharedocumentsTask?.render({pending:()=>n`<div class="document-item-skeleton"></div>`,complete:()=>0===this._sharedocumentsTask?.value?.length?n`<p class="documents-card-empty">${k("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=>n`<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 j(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="${()=>{z.track(I(this.loginToken.patient.hash,this.appointment.id??"")),this._sharedocumentsTask?.run()}}" .disabled="${this._sharedocumentsTask?.status===c.PENDING}">${k("Actualizar")}</mq-button></mq-card><div class="finished-consultation-footer">${this.canReconnect?n`<mq-button variant="primary" size="md" fullwidth ?disabled="${this._reconnectMutation.isPending}" @click="${()=>this._reconnectMutation.run({appointmentId:this.appointment.id})}">${k("Volver a la sala de espera")}</mq-button>`:s} ${t?n`<chat-cta .consultationId="${this.appointment.id}" .roomId="${Number(this.appointment.room_id)}" .professionalHash="${this.appointment.from.hash}" .text="${k("Puedes chatear con tu profesional hasta 48 horas finalizada tu cita")}" ?readonly="${b(this.appointment.expires_at)}" .onOpenChat="${()=>{z.track(R(this.loginToken.patient.hash,this.appointment.id??""))}}"></chat-cta>`:s}</div>`}};t([r({type:Object})],St.prototype,"appointment",void 0),t([r({type:String})],St.prototype,"token",void 0),t([r({type:Boolean,attribute:"can-reconnect"})],St.prototype,"canReconnect",void 0),t([P({context:L})],St.prototype,"loginToken",void 0),St=t([$(),e("documentation-view")],St);class ReviewSubmittedEvent extends Event{static{this.eventName="review-submitted"}constructor(){super(ReviewSubmittedEvent.eventName,{bubbles:!0,composed:!0})}}class ReviewSkippedEvent extends Event{static{this.eventName="review-skipped"}constructor(){super(ReviewSkippedEvent.eventName,{bubbles:!0,composed:!0})}}let qt=class ReviewView extends i{constructor(){super(...arguments),this.rating=0,this.comment="",this._reviewMutation=new U(this,{mutationFn:({rating:t,comment:e})=>m.consultations.postReview({consultation_id:this.appointment.id??"",consultation_type:u.appointment,rating:t,comment:e.trim()?e.trim():null}),onSuccess:()=>{this.dispatchEvent(new ReviewSubmittedEvent)},onError:t=>{!function(t){const e=t,i=e?.response?.status;return 400===i&&/already exists/i.test(e?.response?.data?.message??"")}(t)?ot.error(k("No se ha podido enviar el cuestionario")):this.dispatchEvent(new ReviewSubmittedEvent)}}),this._reconnectMutation=new U(this,{mutationFn:t=>m.appointments.reconnectAppointment(t),onSuccess:()=>{this.dispatchEvent(new CustomEvent("review-reconnect",{bubbles:!0,composed:!0}))},onError:()=>{ot.error(k("No se ha podido volver a la sala de espera"))}}),this.handleSkip=()=>{this.dispatchEvent(new ReviewSkippedEvent)},this.handleSubmit=()=>{this.rating<1||this.rating>5||this._reviewMutation.isPending||this._reviewMutation.run({rating:this.rating,comment:this.comment})}}static{this.styles=o`:host{display:flex;flex-direction:column;align-items:center;justify-content:center;min-height:100%;background-color:var(--color-background);box-sizing:border-box}.container{width:100%;max-width:500px;padding:var(--sp-6);display:flex;flex-direction:column;gap:var(--sp-5);box-sizing:border-box}.title{margin:0;padding:0 var(--sp-6);font-family:var(--font-titles);font-size:var(--text-2xl);line-height:var(--text-2xl--line-height);font-weight:var(--font-weight-normal);color:var(--color-primary);text-align:center}.rating{display:flex;flex-direction:column;align-items:center;gap:var(--sp-2);padding:var(--sp-1) var(--sp-6)}.subtitle{margin:0;font-family:var(--font-body);font-size:var(--text-sm);line-height:var(--text-sm--line-height);color:var(--color-text-icons--secondary);text-align:center}.comment-card{background-color:var(--color-white);border:var(--action-border-width) solid var(--color-border);border-radius:var(--border-radius-lg);box-shadow:0 4px 4px rgba(0,0,0,.05);padding:var(--sp-5);display:flex;flex-direction:column;gap:var(--sp-5)}.comment-header{display:flex;justify-content:space-between;align-items:flex-start;gap:var(--sp-3)}.comment-label{font-family:var(--font-body);font-size:var(--text-sm);line-height:var(--text-sm);font-weight:var(--font-weight-medium);color:var(--color-neutrals-text-default)}.comment-counter{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-text-icons--secondary);white-space:nowrap}.textarea{width:100%;box-sizing:border-box;height:var(--size-44);padding:var(--sp-3) var(--sp-4);background-color:var(--color-gray-lighter);border:var(--action-border-width) solid var(--color-border);border-radius:var(--border-radius-md);font-family:var(--font-body);font-size:var(--text-sm);line-height:var(--text-sm--line-height);color:var(--color-neutrals-text-default);resize:none}.textarea::placeholder{color:var(--color-text-icons--secondary);opacity:.6}.textarea:focus{outline:0;border-color:var(--color-primary)}.actions{display:flex;gap:var(--sp-4)}.btn{flex:1;height:var(--button-height-md);padding:var(--sp-2) var(--sp-4);border-radius:var(--border-radius-md);font-family:var(--font-body);font-size:var(--text-sm);line-height:var(--text-sm--line-height);font-weight:var(--font-weight-medium);cursor:pointer;transition:opacity .15s ease-in-out}.btn:focus-visible{outline:2px solid var(--color-primary);outline-offset:2px}.btn:disabled{cursor:not-allowed}.btn-skip{background:var(--color-white);border:var(--action-border-width) solid var(--color-primary);color:var(--color-primary)}.btn-skip:hover:not(:disabled){background:var(--color-primary-background-extraWeak)}.btn-submit{background:var(--color-primary);border:var(--action-border-width) solid var(--color-primary);color:var(--color-white)}.btn-submit:hover:not(:disabled){background:var(--color-primary-dark)}.btn-submit:disabled{opacity:.5}.waiting-card{background-color:var(--color-background-primary-light);border-radius:var(--border-radius-lg);padding:var(--sp-4);display:flex;flex-direction:column;gap:var(--sp-2)}.waiting-header{display:flex;align-items:center;gap:var(--sp-2);color:var(--color-neutrals-text-default)}.waiting-title{font-family:var(--font-body);font-size:var(--text-xs);line-height:1;font-weight:var(--font-weight-medium);color:var(--color-neutrals-text-default)}.waiting-body{margin:0;font-family:var(--font-body);font-size:var(--text-xs);line-height:var(--text-xs--line-height);color:var(--color-text-icons--secondary)}.waiting-link{background:0 0;border:0;padding:0;cursor:pointer;color:#3c50ec;font:inherit;text-decoration:none}.waiting-link:hover{text-decoration:none}.waiting-link:disabled{cursor:not-allowed;opacity:.6}`}render(){return n`<div class="container"><h1 class="title">${k("¿Qué tal ha ido tu cita?")}</h1><div class="rating"><mq-rating .value="${this.rating}" .label="${k("Valoración de la consulta")}" @mq-rating-change="${t=>{this.rating=t.value}}"></mq-rating><p class="subtitle">${k("(1 es muy malo, 5 es excelente)")}</p></div><div class="comment-card"><div class="comment-header"><span class="comment-label">${k("¿Tienes comentarios sobre la consulta?")}</span> <span class="comment-counter">${this.comment.length}/${240}</span></div><textarea class="textarea" maxlength="${240}" placeholder="${k("Comparte cómo fue la atención o si tuviste algún problema con la videollamada…")}" .value="${this.comment}" @input="${t=>{this.comment=t.target.value}}"></textarea><div class="actions"><button type="button" class="btn btn-skip" ?disabled="${this._reviewMutation.isPending}" @click="${this.handleSkip}">${k("Omitir")}</button> <button type="button" class="btn btn-submit" ?disabled="${this.rating<1||this._reviewMutation.isPending}" @click="${this.handleSubmit}">${k("Enviar")}</button></div></div><div class="waiting-card"><div class="waiting-header">${it({color:"currentColor",size:18})} <span class="waiting-title">${k("¿Ocurrió algún problema?")}</span></div><p class="waiting-body">${k("Si la cita no se ha podido realizar, puedes")} <button type="button" class="waiting-link" ?disabled="${this._reconnectMutation.isPending}" @click="${()=>this._reconnectMutation.run({appointmentId:this.appointment.id})}">${k("volver a la sala de espera.")}</button></p></div></div>`}};t([r({type:Object})],qt.prototype,"appointment",void 0),t([y()],qt.prototype,"rating",void 0),t([y()],qt.prototype,"comment",void 0),qt=t([$(),e("review-view")],qt);let Tt=class ErrorView extends i{static{this.styles=o`.container{display:grid;place-items:center;width:100%;max-width:447px;margin:0 auto}.card>:not(:first-child){margin-top:var(--size-8)}.title{font-family:var(--font-titles);color:var(--color-neutrals-text-default);font-size:var(--text-2xl);line-height:var(--text-2xl--line-height);font-weight:var(--font-weight-bold);margin:0;margin-bottom:var(--size-3)}.description{color:var(--color-neutrals-text-default);font-size:var(--text-sm);line-height:var(--text-sm--line-height);font-weight:400}`}render(){return n`<div class="container"><div class="card"><slot name="icon"></slot><div class="content"><h1 class="title">${this.title}</h1><p class="description">${this.message}</p></div></div></div>`}};t([r({type:String})],Tt.prototype,"title",void 0),t([r({type:String})],Tt.prototype,"message",void 0),Tt=t([e("error-view")],Tt);let Ct=class UnexpectedErrorView extends i{render(){return n`<error-view .title="${k("Error desconocido")}" .message="${k("Ha ocurrido un error al cargar la página. Por favor, intenta nuevamente o contacta al soporte.")}"><div slot="icon">${st()}</div></error-view>`}};Ct=t([$(),e("unexpected-error-view")],Ct);let Ot=class ExpiredAppointmentErrorView extends i{render(){return n`<error-view .title="${k("Consulta caducada")}" .message="${k("Parece que no te hemos encontrado a la hora de tu cita. Puedes programar otra consulta para resolver tus dudas.")}"><div slot="icon">${nt()}</div></error-view>`}};Ot=t([$(),e("expired-appointment-error-view")],Ot);let Et=class NotFoundErrorView extends i{static{this.styles=o`div{display:flex;flex-direction:column;gap:2px}span{font-size:var(--text-xs);line-height:var(--text-xs--line-height);font-weight:400;color:var(--color-gray-medium)}`}render(){return n`<error-view .title="${k("Página no encontrada")}" .message="${k("La página que estás buscando fue removida, renombrada o puede que no exista.")}"><div slot="icon"><span>404</span> ${st()}</div></error-view>`}};function jt(t){try{return function(t,e){if("string"!=typeof t)throw new InvalidTokenError("Invalid token specified: must be a string");e||(e={});const i=!0===e.header?0:1,o=t.split(".")[i];if("string"!=typeof o)throw new InvalidTokenError(`Invalid token specified: missing part #${i+1}`);let s;try{s=rt(o)}catch(t){throw new InvalidTokenError(`Invalid token specified: invalid base64 for part #${i+1} (${t.message})`)}try{return JSON.parse(s)}catch(t){throw new InvalidTokenError(`Invalid token specified: invalid json for part #${i+1} (${t.message})`)}}(t)}catch{return null}}Et=t([$(),e("not-found-error-view")],Et);let It=class MqVideocallProvider extends i{static{this.styles=o`*{box-sizing:border-box}:host{display:block;margin:0 auto;width:100%;height:100%}.centered{display:grid;place-items:center;height:100%;min-height:var(--mq-container-min-height)}documentation-view{display:block;padding:var(--sp-4)}`}constructor(){super(),this.opentokService=new OpenTokService,this.params={appointmentId:this.appointmentId,token:this.token,apiKey:this.apiKey},this.appointmentTask=new d(this,{task:async([t,,])=>{const[e,i,o]=await Promise.all([m.flash.getAppointment({appointmentId:t}),m.consultations.getReview(t).then(()=>!0).catch(()=>!1),m.organizations.getOrganizationSetup().catch(()=>{})]);return{appointment:e,hasReview:i,hasNps:!0===o?.appointments?.has_nps}},args:()=>[this.appointmentId,this.apiKey,this.token]})}willUpdate(t){if(this.appointmentTask.value&&!this.opentokController){const{appointment:t,hasReview:e,hasNps:i}=this.appointmentTask.value,o=function(t,e){return p(t)?t.status===h.finished||t.status===h.reporting?e?mt:pt:dt:ht}(t,i);this.screen=o===mt&&e?pt:o,this.params={appointmentId:this.appointmentId,token:this.token,apiKey:this.apiKey},this.opentokController=new OpenTokController(this,t,this.token,()=>{this.screen=ct},()=>{this.screen=!i||e?pt:mt})}}render(){const t=n`<div class="centered">${a({color:"var(--color-primary)"})}</div>`,e=n`<mq-layout background="transparent"><not-found-error-view></not-found-error-view></mq-layout>`;return this.appointmentTask.render({pending:()=>t,error:t=>{const i=jt(this.token);return i?.exp&&i.exp<Date.now()/1e3?n`<mq-layout background="transparent"><expired-appointment-error-view></expired-appointment-error-view></mq-layout>`:f(t)&&t.response?.status&&t.response.status<500?e:n`<mq-layout background="transparent"><unexpected-error-view></unexpected-error-view></mq-layout>`},complete:({appointment:i,hasNps:o})=>{if(this.opentokController?.isLoading)return t;if(this.opentokController?.errorMessage||!this.opentokController)return e;if(this.screen===ht)return n`<mq-layout background="transparent"><not-time-yet-view .appointment="${i}"></not-time-yet-view></mq-layout>`;if(this.screen===mt)return n`<mq-layout background="transparent"><review-view .appointment="${i}" @review-submitted="${()=>{this.screen=pt}}" @review-skipped="${()=>{this.screen=pt}}" @review-reconnect="${()=>{this.screen=dt}}"></review-view></mq-layout>`;if(this.screen===pt)return n`<mq-layout background="transparent"><documentation-view .appointment="${i}" .token="${this.token}" ?can-reconnect="${!o}" @reconnect="${()=>{this.screen=dt}}"></documentation-view></mq-layout>`;if(this.screen===dt||this.screen===ct){const e=this.opentokController.session;return e?n`<waiting-room-layout .appointment="${i}" ?is-waiting-room="${this.screen===dt}"><mq-videocall-content .apiKey="${this.apiKey}" .token="${this.token}" .session="${e}" .streams="${this.opentokController?.streams??[]}" ?is-waiting-room="${this.screen===dt}" ?is-reconnecting="${this.opentokController.isReconnecting}" .appointment="${i}"></mq-videocall-content></waiting-room-layout>`:t}return n`<mq-layout background="transparent"><unexpected-error-view></unexpected-error-view></mq-layout>`}})}};t([r({type:String,attribute:"appointment-id"})],It.prototype,"appointmentId",void 0),t([r({type:String,attribute:"api-key"})],It.prototype,"apiKey",void 0),t([r({type:String})],It.prototype,"token",void 0),t([y()],It.prototype,"screen",void 0),t([l({context:at})],It.prototype,"opentokService",void 0),t([l({context:lt})],It.prototype,"params",void 0),It=t([e("mq-videocall-provider")],It);let Rt=class PermissionsRequiredErrorView extends i{static{this.styles=o`.img-container{display:flex;justify-content:center}img{width:100%;height:auto;max-width:229px}`}render(){return n`<error-view .title="${k("Acepta los permisos de cámara y micrófono")}" .message="${k("Parece que has denegado los permisos necesarios para entrar a la videollamada. Edita los permisos en tu navegador para entrar. Una vez concedidos, debes refrescar esta pantalla.")}"><div class="img-container" slot="icon"><img src="${`${x.ASSETS_BASE_URL}/wc-videocall/Miccam_asset.png`}" alt="Miccam_asset" width="229" height="166.44"></div></error-view>`}};Rt=t([$(),e("permissions-required-error-view")],Rt);let Vt=class MqVideocall extends i{constructor(){super(...arguments),this._permissionController=new PermissionController(this)}static{this.styles=o`:host{display:block;width:100%;height:100%}.loading-spinner-container{height:100%;display:flex;flex-direction:column;justify-content:center;align-items:center}.permissions-required-error-view-container{height:100%;padding-left:var(--size-4);padding-right:var(--size-4);display:grid;place-items:center}`}render(){return"prompt"===this._permissionController.state?n`<div class="loading-spinner-container">${a({color:"var(--color-primary)"})}</div>`:"denied"===this._permissionController.state?n`<div class="permissions-required-error-view-container"><permissions-required-error-view></permissions-required-error-view></div>`:n`<mq-videocall-provider .appointmentId="${this.appointmentId}" .token="${this.token}" .apiKey="${this.apiKey}"></mq-videocall-provider>`}};t([r({type:String,attribute:"appointment-id"})],Vt.prototype,"appointmentId",void 0),t([r({type:String,attribute:"api-key"})],Vt.prototype,"apiKey",void 0),t([r({type:String})],Vt.prototype,"token",void 0),Vt=t([e("mq-videocall")],Vt);export{Vt as MqVideocall};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as _lit_react from '@lit/react';
|
|
2
|
+
import { EventName } from '@lit/react';
|
|
3
|
+
import { MqApplePayCheckout as MqApplePayCheckout$1, ApplePayCheckoutSuccessEvent, ApplePayCheckoutDeniedEvent, ApplePayCheckoutErrorEvent } from '../mq-apple-pay-checkout.js';
|
|
4
|
+
import 'lit';
|
|
5
|
+
import '../env.js';
|
|
6
|
+
import '../i18n.js';
|
|
7
|
+
import 'zod';
|
|
8
|
+
|
|
9
|
+
declare const MqApplePayCheckout: _lit_react.ReactWebComponent<MqApplePayCheckout$1, {
|
|
10
|
+
onPaymentSuccess: EventName<ApplePayCheckoutSuccessEvent>;
|
|
11
|
+
onPaymentDenied: EventName<ApplePayCheckoutDeniedEvent>;
|
|
12
|
+
onPaymentError: EventName<ApplePayCheckoutErrorEvent>;
|
|
13
|
+
}>;
|
|
14
|
+
|
|
15
|
+
export { MqApplePayCheckout };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{o as t}from"../chunks/create-component-BB-6Gu6l.js";import*as e from"react";import{MqApplePayCheckout as s}from"../mq-apple-pay-checkout.js";import"../chunks/custom-element-DA9Fxvxd.js";import"../chunks/runtime-Bg1WXVCx.js";import"../chunks/parseISO-jT42c8Ob.js";import"../chunks/login-token-task-BI-L2zSV.js";import"../chunks/task-Bj8p7kJX.js";import"../chunks/lit-element-DiWJYFwC.js";import"../chunks/external-zAbuzxDj.js";import"../chunks/property-scuRaFcM.js";import"../chunks/state-LQivXIgA.js";import"../env.js";import"../i18n.js";import"../chunks/api-chat-client-C8SqZtCa.js";import"../chunks/format-Cm3B1GMy.js";import"../chunks/isBefore-Cof0D841.js";import"../chunks/apple-pay-outcomes-BNkcTbbM.js";const o=t({react:e,tagName:"mq-apple-pay-checkout",elementClass:s,events:{onPaymentSuccess:"payment-success",onPaymentDenied:"payment-denied",onPaymentError:"payment-error"}});export{o as MqApplePayCheckout};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import * as _lit_react from '@lit/react';
|
|
2
|
+
import { EventName } from '@lit/react';
|
|
3
|
+
import { MqAppointmentCheckout as MqAppointmentCheckout$1, AppointmentPaidEvent } from '../mq-appointment-checkout.js';
|
|
4
|
+
import 'lit-html';
|
|
5
|
+
import '../chunks/schemas.d-BEA8Pl6w.js';
|
|
6
|
+
import 'zod';
|
|
7
|
+
import 'lit';
|
|
8
|
+
import '../env.js';
|
|
9
|
+
import '../i18n.js';
|
|
10
|
+
import '../mq-checkout.js';
|
|
11
|
+
import '../ui/mq-skeleton.js';
|
|
12
|
+
|
|
13
|
+
declare const MqAppointmentCheckout: _lit_react.ReactWebComponent<MqAppointmentCheckout$1, {
|
|
14
|
+
onPaymentSuccess: EventName<AppointmentPaidEvent>;
|
|
15
|
+
}>;
|
|
16
|
+
|
|
17
|
+
export { MqAppointmentCheckout };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{o as t}from"../chunks/create-component-BB-6Gu6l.js";import*as s from"react";import{MqAppointmentCheckout as e}from"../mq-appointment-checkout.js";import"../chunks/custom-element-DA9Fxvxd.js";import"../chunks/lit-element-DiWJYFwC.js";import"../chunks/property-scuRaFcM.js";import"../chunks/if-defined-BYeVdwgd.js";import"../chunks/api-chat-client-C8SqZtCa.js";import"../chunks/external-zAbuzxDj.js";import"../chunks/parseISO-jT42c8Ob.js";import"../chunks/runtime-Bg1WXVCx.js";import"../chunks/format-Cm3B1GMy.js";import"../chunks/isBefore-Cof0D841.js";import"../env.js";import"../mq-checkout.js";import"../chunks/task-Bj8p7kJX.js";import"../chunks/login-token-task-BI-L2zSV.js";import"../chunks/state-LQivXIgA.js";import"../theme.js";import"../i18n.js";import"../ui/mq-skeleton.js";import"../chunks/style-map-CIdqdn7C.js";import"../chunks/directive-2EDmOukv.js";const m=t({react:s,tagName:"mq-appointment-checkout",elementClass:e,events:{onPaymentSuccess:"payment-success"}});export{m as MqAppointmentCheckout};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as _lit_react from '@lit/react';
|
|
2
|
+
import { EventName } from '@lit/react';
|
|
3
|
+
import { M as MqChatRoom$1 } from '../chunks/mq-chat-room-DuG4RuIp.js';
|
|
4
|
+
import { MqChatRoomCloseEvent, MqChatRoomProfileEvent } from '../mq-chat-room.js';
|
|
5
|
+
import 'lit-html';
|
|
6
|
+
import 'lit';
|
|
7
|
+
import '../ui/mq-avatar.js';
|
|
8
|
+
import '../ui/mq-button.js';
|
|
9
|
+
import '../ui/mq-skeleton.js';
|
|
10
|
+
import 'zod';
|
|
11
|
+
import '../chunks/appointment.model.d-Dy50gMPg.js';
|
|
12
|
+
import '@tanstack/query-core';
|
|
13
|
+
|
|
14
|
+
declare const MqChatRoom: _lit_react.ReactWebComponent<MqChatRoom$1, {
|
|
15
|
+
onClose: EventName<MqChatRoomCloseEvent>;
|
|
16
|
+
onProfile: EventName<MqChatRoomProfileEvent>;
|
|
17
|
+
}>;
|
|
18
|
+
|
|
19
|
+
export { MqChatRoom };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{o as s}from"../chunks/create-component-BB-6Gu6l.js";import*as o from"react";import{M as t}from"../chunks/exports-G_7Ih_GH.js";import"../chunks/custom-element-DA9Fxvxd.js";import"../chunks/provide-CfT7g_Zi.js";import"../chunks/context-provider-CiMFpvDA.js";import"../chunks/context-request-event-Dfydf1ub.js";import"../chunks/mutation-controller-OVT8NEt6.js";import"../chunks/query-QJ1INUTG.js";import"../chunks/parseISO-jT42c8Ob.js";import"../chunks/runtime-Bg1WXVCx.js";import"../chunks/lit-element-DiWJYFwC.js";import"../chunks/property-scuRaFcM.js";import"../chunks/state-LQivXIgA.js";import"../theme.js";import"../chunks/api-chat-client-C8SqZtCa.js";import"../chunks/external-zAbuzxDj.js";import"../chunks/format-Cm3B1GMy.js";import"../chunks/isBefore-Cof0D841.js";import"../env.js";import"../ui/icons/x-icon.js";import"../ui/icons/types.js";import"../ui/mq-avatar.js";import"../chunks/class-map-Co76I6aw.js";import"../chunks/directive-2EDmOukv.js";import"../ui/mq-button.js";import"../ui/mq-skeleton.js";import"../chunks/style-map-CIdqdn7C.js";import"../chunks/if-defined-BYeVdwgd.js";import"../ui/icons/chevron-left-icon.js";import"../chunks/query-CeeutdfT.js";import"../events.js";import"../ui/icons/check-double-icon.js";import"../ui/icons/check-icon.js";import"../i18n.js";import"../chunks/chunk-YTQUGGS3-DN-JZpgG.js";const i=s({react:o,tagName:"mq-chat-room",elementClass:t,events:{onClose:"mq-chat-room-close",onProfile:"mq-chat-room-profile"}});export{i as MqChatRoom};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import * as _lit_react from '@lit/react';
|
|
2
|
+
import { EventName } from '@lit/react';
|
|
3
|
+
import { MqCheckout as MqCheckout$1, CheckoutSuccessEvent, CheckoutDeniedEvent, CheckoutErrorEvent, CheckoutRetryEvent } from '../mq-checkout.js';
|
|
4
|
+
import 'lit-html';
|
|
5
|
+
import 'lit';
|
|
6
|
+
import '../env.js';
|
|
7
|
+
import '../i18n.js';
|
|
8
|
+
import 'zod';
|
|
9
|
+
import '../ui/mq-skeleton.js';
|
|
10
|
+
|
|
11
|
+
declare const MqCheckout: _lit_react.ReactWebComponent<MqCheckout$1, {
|
|
12
|
+
onPaymentSuccess: EventName<CheckoutSuccessEvent>;
|
|
13
|
+
onPaymentDenied: EventName<CheckoutDeniedEvent>;
|
|
14
|
+
onPaymentError: EventName<CheckoutErrorEvent>;
|
|
15
|
+
onPaymentRetry: EventName<CheckoutRetryEvent>;
|
|
16
|
+
}>;
|
|
17
|
+
|
|
18
|
+
export { MqCheckout };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{o as t}from"../chunks/create-component-BB-6Gu6l.js";import*as e from"react";import{MqCheckout as s}from"../mq-checkout.js";import"../chunks/custom-element-DA9Fxvxd.js";import"../chunks/runtime-Bg1WXVCx.js";import"../chunks/parseISO-jT42c8Ob.js";import"../chunks/task-Bj8p7kJX.js";import"../chunks/lit-element-DiWJYFwC.js";import"../chunks/api-chat-client-C8SqZtCa.js";import"../chunks/external-zAbuzxDj.js";import"../chunks/format-Cm3B1GMy.js";import"../chunks/isBefore-Cof0D841.js";import"../env.js";import"../chunks/login-token-task-BI-L2zSV.js";import"../chunks/property-scuRaFcM.js";import"../chunks/state-LQivXIgA.js";import"../theme.js";import"../i18n.js";import"../ui/mq-skeleton.js";import"../chunks/style-map-CIdqdn7C.js";import"../chunks/directive-2EDmOukv.js";const m=t({react:e,tagName:"mq-checkout",elementClass:s,events:{onPaymentSuccess:"payment-success",onPaymentDenied:"payment-denied",onPaymentError:"payment-error",onPaymentRetry:"payment-retry"}});export{m as MqCheckout};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import * as _lit_react from '@lit/react';
|
|
2
|
+
import { EventName } from '@lit/react';
|
|
3
|
+
import { MqGooglePayCheckout as MqGooglePayCheckout$1, GooglePayCheckoutSuccessEvent, GooglePayCheckoutDeniedEvent, GooglePayCheckoutErrorEvent } from '../mq-google-pay-checkout.js';
|
|
4
|
+
import 'lit';
|
|
5
|
+
import '../env.js';
|
|
6
|
+
import '../i18n.js';
|
|
7
|
+
import 'zod';
|
|
8
|
+
|
|
9
|
+
declare const MqGooglePayCheckout: _lit_react.ReactWebComponent<MqGooglePayCheckout$1, {
|
|
10
|
+
onPaymentSuccess: EventName<GooglePayCheckoutSuccessEvent>;
|
|
11
|
+
onPaymentDenied: EventName<GooglePayCheckoutDeniedEvent>;
|
|
12
|
+
onPaymentError: EventName<GooglePayCheckoutErrorEvent>;
|
|
13
|
+
}>;
|
|
14
|
+
|
|
15
|
+
export { MqGooglePayCheckout };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{o as t}from"../chunks/create-component-BB-6Gu6l.js";import*as e from"react";import{MqGooglePayCheckout as s}from"../mq-google-pay-checkout.js";import"../chunks/custom-element-DA9Fxvxd.js";import"../chunks/runtime-Bg1WXVCx.js";import"../chunks/parseISO-jT42c8Ob.js";import"../chunks/login-token-task-BI-L2zSV.js";import"../chunks/task-Bj8p7kJX.js";import"../chunks/lit-element-DiWJYFwC.js";import"../chunks/external-zAbuzxDj.js";import"../chunks/property-scuRaFcM.js";import"../chunks/state-LQivXIgA.js";import"../env.js";import"../i18n.js";import"../chunks/api-chat-client-C8SqZtCa.js";import"../chunks/format-Cm3B1GMy.js";import"../chunks/isBefore-Cof0D841.js";import"../chunks/apple-pay-outcomes-BNkcTbbM.js";const o=t({react:e,tagName:"mq-google-pay-checkout",elementClass:s,events:{onPaymentSuccess:"payment-success",onPaymentDenied:"payment-denied",onPaymentError:"payment-error"}});export{o as MqGooglePayCheckout};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as _lit_react from '@lit/react';
|
|
2
|
+
import { EventName } from '@lit/react';
|
|
3
|
+
import { MqImmediateVideocallCheckout as MqImmediateVideocallCheckout$1, ImmediateVideocallPaidEvent } from '../mq-immediate-videocall-checkout.js';
|
|
4
|
+
import 'lit-html';
|
|
5
|
+
import 'lit';
|
|
6
|
+
import '../env.js';
|
|
7
|
+
import '../i18n.js';
|
|
8
|
+
import 'zod';
|
|
9
|
+
import '../mq-checkout.js';
|
|
10
|
+
import '../ui/mq-skeleton.js';
|
|
11
|
+
|
|
12
|
+
declare const MqImmediateVideocallCheckout: _lit_react.ReactWebComponent<MqImmediateVideocallCheckout$1, {
|
|
13
|
+
onPaymentSuccess: EventName<ImmediateVideocallPaidEvent>;
|
|
14
|
+
}>;
|
|
15
|
+
|
|
16
|
+
export { MqImmediateVideocallCheckout };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{o as t}from"../chunks/create-component-BB-6Gu6l.js";import*as s from"react";import{MqImmediateVideocallCheckout as e}from"../mq-immediate-videocall-checkout.js";import"../chunks/custom-element-DA9Fxvxd.js";import"../chunks/lit-element-DiWJYFwC.js";import"../chunks/property-scuRaFcM.js";import"../chunks/if-defined-BYeVdwgd.js";import"../chunks/api-chat-client-C8SqZtCa.js";import"../chunks/external-zAbuzxDj.js";import"../chunks/parseISO-jT42c8Ob.js";import"../chunks/runtime-Bg1WXVCx.js";import"../chunks/format-Cm3B1GMy.js";import"../chunks/isBefore-Cof0D841.js";import"../env.js";import"../mq-checkout.js";import"../chunks/task-Bj8p7kJX.js";import"../chunks/login-token-task-BI-L2zSV.js";import"../chunks/state-LQivXIgA.js";import"../theme.js";import"../i18n.js";import"../ui/mq-skeleton.js";import"../chunks/style-map-CIdqdn7C.js";import"../chunks/directive-2EDmOukv.js";const m=t({react:s,tagName:"mq-immediate-videocall-checkout",elementClass:e,events:{onPaymentSuccess:"payment-success"}});export{m as MqImmediateVideocallCheckout};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import * as _lit_react from '@lit/react';
|
|
2
|
+
import { EventName } from '@lit/react';
|
|
3
|
+
import '../chunks/appointment-details-DpzdYLjq.js';
|
|
4
|
+
import { MqMyAppointments as MqMyAppointments$1, MqMyAppointmentsSelectEvent, RequestAppointmentEvent } from '../mq-my-appointments.js';
|
|
5
|
+
import '../chunks/professional-overview-mO3tuMuH.js';
|
|
6
|
+
import 'lit-html';
|
|
7
|
+
import 'lit';
|
|
8
|
+
import '../chunks/appointment.model.d-Dy50gMPg.js';
|
|
9
|
+
import 'zod';
|
|
10
|
+
import '../ui/mq-tabs.js';
|
|
11
|
+
import '../ui/mq-card.js';
|
|
12
|
+
import '../chunks/mq-chat-room-DuG4RuIp.js';
|
|
13
|
+
import '../ui/mq-avatar.js';
|
|
14
|
+
import '../ui/mq-button.js';
|
|
15
|
+
import '../ui/mq-skeleton.js';
|
|
16
|
+
import '@tanstack/query-core';
|
|
17
|
+
import '../ui/mq-floating-bubble.js';
|
|
18
|
+
import '../chunks/price.d-CwLosdAN.js';
|
|
19
|
+
import '../ui/mq-dialog.js';
|
|
20
|
+
import '../ui/mq-unread-badge.js';
|
|
21
|
+
import '../ui/back-link.js';
|
|
22
|
+
import '../ui/mq-text-button.js';
|
|
23
|
+
|
|
24
|
+
declare const MqMyAppointments: _lit_react.ReactWebComponent<MqMyAppointments$1, {
|
|
25
|
+
onTabChange: EventName<MqMyAppointmentsSelectEvent>;
|
|
26
|
+
onRequestAppointment: EventName<RequestAppointmentEvent>;
|
|
27
|
+
}>;
|
|
28
|
+
|
|
29
|
+
export { MqMyAppointments };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{o as i}from"../chunks/create-component-BB-6Gu6l.js";import*as s from"react";import"../chunks/price-tImUmtpX.js";import{MqMyAppointments as t}from"../mq-my-appointments.js";import"../chunks/telemetry-client-BRVJU-fZ.js";import"../chunks/custom-element-DA9Fxvxd.js";import"../chunks/runtime-Bg1WXVCx.js";import"../chunks/parseISO-jT42c8Ob.js";import"../chunks/api-chat-client-C8SqZtCa.js";import"../chunks/external-zAbuzxDj.js";import"../chunks/format-Cm3B1GMy.js";import"../chunks/isBefore-Cof0D841.js";import"../env.js";import"../chunks/lit-element-DiWJYFwC.js";import"../chunks/property-scuRaFcM.js";import"../chunks/class-map-Co76I6aw.js";import"../chunks/directive-2EDmOukv.js";import"../i18n.js";import"../ui/icons/briefcase-icon.js";import"../ui/icons/types.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/mutation-controller-OVT8NEt6.js";import"../chunks/query-QJ1INUTG.js";import"../chunks/context-provider-CiMFpvDA.js";import"../chunks/context-request-event-Dfydf1ub.js";import"../chunks/chunk-S5RWG6G2-oTcdgk2H.js";import"../events.js";import"../ui/mq-tabs.js";import"../chunks/get-organization-setup-query-BMbuRi6v.js";import"../chunks/refund-cancel-policy-CnbrIqH0.js";import"../chunks/exports-G_7Ih_GH.js";import"../chunks/provide-CfT7g_Zi.js";import"../chunks/state-LQivXIgA.js";import"../theme.js";import"../ui/icons/x-icon.js";import"../ui/mq-avatar.js";import"../ui/mq-button.js";import"../ui/mq-skeleton.js";import"../chunks/style-map-CIdqdn7C.js";import"../chunks/if-defined-BYeVdwgd.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-DN-JZpgG.js";import"../ui/mq-card.js";import"../ui/mq-floating-bubble.js";import"../ui/mq-dialog.js";import"../ui/icons/video-icon.js";import"../ui/mq-unread-badge.js";import"../ui/mq-toast.js";import"../ui/back-link.js";import"../ui/mq-text-button.js";import"../ui/icons/chevron-down-icon.js";const o=i({react:s,tagName:"mq-my-appointments",elementClass:t,events:{onTabChange:"ontabchange",onRequestAppointment:"request-appointment"}});export{o as MqMyAppointments};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as _lit_react from '@lit/react';
|
|
2
|
+
import { QueryClientProvider } from '../mq-query-client-provider.js';
|
|
3
|
+
import 'lit-html';
|
|
4
|
+
import 'lit';
|
|
5
|
+
|
|
6
|
+
declare const MqQueryClientProvider: _lit_react.ReactWebComponent<QueryClientProvider, {}>;
|
|
7
|
+
|
|
8
|
+
export { MqQueryClientProvider };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{o as t}from"../chunks/create-component-BB-6Gu6l.js";import*as e from"react";import{QueryClientProvider as r}from"../mq-query-client-provider.js";import"../chunks/custom-element-DA9Fxvxd.js";import"../chunks/query-QJ1INUTG.js";import"../chunks/context-provider-CiMFpvDA.js";import"../chunks/context-request-event-Dfydf1ub.js";import"../chunks/provide-CfT7g_Zi.js";import"../chunks/lit-element-DiWJYFwC.js";import"../chunks/state-LQivXIgA.js";import"../chunks/property-scuRaFcM.js";import"../chunks/ensure-context-root-DbdqwnKB.js";const o=t({react:e,tagName:"mq-query-client-provider",elementClass:r});export{o as MqQueryClientProvider};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import * as _lit_react from '@lit/react';
|
|
2
|
+
import { EventName } from '@lit/react';
|
|
3
|
+
import { MqScheduleSuccess as MqScheduleSuccess$1, OpenVideocallEvent } from '../mq-schedule-success.js';
|
|
4
|
+
import 'lit-html';
|
|
5
|
+
import 'lit';
|
|
6
|
+
import '../env.js';
|
|
7
|
+
import '../ui/mq-callout.js';
|
|
8
|
+
import '../ui/mq-button.js';
|
|
9
|
+
import '../chunks/professional-overview-mO3tuMuH.js';
|
|
10
|
+
import '../ui/mq-text-button.js';
|
|
11
|
+
import '../ui/mq-avatar.js';
|
|
12
|
+
import '../chunks/appointment-details-DpzdYLjq.js';
|
|
13
|
+
import '../chunks/appointment.model.d-Dy50gMPg.js';
|
|
14
|
+
import 'zod';
|
|
15
|
+
import '../chunks/mq-chat-room-DuG4RuIp.js';
|
|
16
|
+
import '../ui/mq-skeleton.js';
|
|
17
|
+
import '@tanstack/query-core';
|
|
18
|
+
import '../ui/mq-floating-bubble.js';
|
|
19
|
+
import '../ui/mq-unread-badge.js';
|
|
20
|
+
import '../ui/mq-card.js';
|
|
21
|
+
|
|
22
|
+
declare const MqScheduleSuccess: _lit_react.ReactWebComponent<MqScheduleSuccess$1, {
|
|
23
|
+
onOpenVideocall: EventName<OpenVideocallEvent>;
|
|
24
|
+
}>;
|
|
25
|
+
|
|
26
|
+
export { MqScheduleSuccess };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{o as i}from"../chunks/create-component-BB-6Gu6l.js";import*as s from"react";import{MqScheduleSuccess as o}from"../mq-schedule-success.js";import"../i18n.js";import"../chunks/runtime-Bg1WXVCx.js";import"../chunks/external-zAbuzxDj.js";import"../chunks/custom-element-DA9Fxvxd.js";import"../chunks/parseISO-jT42c8Ob.js";import"../chunks/lit-element-DiWJYFwC.js";import"../chunks/property-scuRaFcM.js";import"../chunks/state-LQivXIgA.js";import"../env.js";import"../chunks/api-chat-client-C8SqZtCa.js";import"../chunks/format-Cm3B1GMy.js";import"../chunks/isBefore-Cof0D841.js";import"../ui/icons/check-icon.js";import"../ui/icons/types.js";import"../ui/mq-callout.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/mutation-controller-OVT8NEt6.js";import"../chunks/query-QJ1INUTG.js";import"../chunks/context-provider-CiMFpvDA.js";import"../chunks/context-request-event-Dfydf1ub.js";import"../chunks/chunk-S5RWG6G2-oTcdgk2H.js";import"../chunks/telemetry-client-BRVJU-fZ.js";import"../ui/icons/chevron-down-icon.js";import"../chunks/if-defined-BYeVdwgd.js";import"../ui/mq-text-button.js";import"../ui/mq-avatar.js";import"../chunks/price-tImUmtpX.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/get-patient-profile-query-C8T8DJ7z.js";import"../chunks/get-organization-setup-query-BMbuRi6v.js";import"../chunks/exports-G_7Ih_GH.js";import"../chunks/provide-CfT7g_Zi.js";import"../theme.js";import"../ui/icons/x-icon.js";import"../ui/mq-skeleton.js";import"../chunks/style-map-CIdqdn7C.js";import"../ui/icons/chevron-left-icon.js";import"../chunks/query-CeeutdfT.js";import"../events.js";import"../ui/icons/check-double-icon.js";import"../chunks/chunk-YTQUGGS3-DN-JZpgG.js";import"../ui/icons/chat-bubble-icon.js";import"../ui/icons/video-icon.js";import"../ui/mq-floating-bubble.js";import"../ui/mq-unread-badge.js";import"../ui/mq-card.js";const t=i({react:s,tagName:"mq-schedule-success",elementClass:o,events:{onOpenVideocall:"open-videocall"}});export{t as MqScheduleSuccess};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import * as _lit_react from '@lit/react';
|
|
2
|
+
import { EventName } from '@lit/react';
|
|
3
|
+
import { MqSchedule as MqSchedule$1, AppointmentCreatedEvent, AuthRequiredEvent } from '../mq-schedule.js';
|
|
4
|
+
import 'lit-html';
|
|
5
|
+
import 'lit';
|
|
6
|
+
import '../chunks/mq-layout-D8Mak16a.js';
|
|
7
|
+
import '../ui/mq-button.js';
|
|
8
|
+
import '../env.js';
|
|
9
|
+
import '../chunks/appointment.model.d-Dy50gMPg.js';
|
|
10
|
+
import 'zod';
|
|
11
|
+
import '../ui/mq-callout.js';
|
|
12
|
+
import '../ui/mq-text-button.js';
|
|
13
|
+
import '../chunks/professional-overview-mO3tuMuH.js';
|
|
14
|
+
import '../ui/mq-avatar.js';
|
|
15
|
+
import '../chunks/appointment-details-DpzdYLjq.js';
|
|
16
|
+
import '../ui/mq-clamped-text.js';
|
|
17
|
+
import '../ui/mq-card.js';
|
|
18
|
+
import '../chunks/price.d-CwLosdAN.js';
|
|
19
|
+
import '@tanstack/query-core';
|
|
20
|
+
import '../chunks/schemas.d-BEA8Pl6w.js';
|
|
21
|
+
import '../ui/mq-skeleton.js';
|
|
22
|
+
import '../ui/mq-select.js';
|
|
23
|
+
import '../ui/mq-time-slot-picker.js';
|
|
24
|
+
import '../ui/mq-calendar.js';
|
|
25
|
+
|
|
26
|
+
declare const MqSchedule: _lit_react.ReactWebComponent<MqSchedule$1, {
|
|
27
|
+
onAppointmentCreated: EventName<AppointmentCreatedEvent>;
|
|
28
|
+
onAuthRequired: EventName<AuthRequiredEvent>;
|
|
29
|
+
}>;
|
|
30
|
+
|
|
31
|
+
export { MqSchedule };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{o as i}from"../chunks/create-component-BB-6Gu6l.js";import*as t from"react";import{MqSchedule as s}from"../mq-schedule.js";import"../chunks/custom-element-DA9Fxvxd.js";import"../chunks/refund-cancel-policy-CnbrIqH0.js";import"../chunks/api-chat-client-C8SqZtCa.js";import"../chunks/external-zAbuzxDj.js";import"../chunks/parseISO-jT42c8Ob.js";import"../chunks/runtime-Bg1WXVCx.js";import"../chunks/format-Cm3B1GMy.js";import"../chunks/isBefore-Cof0D841.js";import"../env.js";import"../events.js";import"../chunks/mq-layout-CpIZTsV2.js";import"../chunks/lit-element-DiWJYFwC.js";import"../chunks/property-scuRaFcM.js";import"../chunks/mutation-controller-OVT8NEt6.js";import"../chunks/query-QJ1INUTG.js";import"../chunks/context-provider-CiMFpvDA.js";import"../chunks/context-request-event-Dfydf1ub.js";import"../chunks/get-patient-profile-query-C8T8DJ7z.js";import"../chunks/get-organization-setup-query-BMbuRi6v.js";import"../chunks/telemetry-client-BRVJU-fZ.js";import"../chunks/state-LQivXIgA.js";import"../i18n.js";import"../ui/icons/chevron-down-icon.js";import"../chunks/if-defined-BYeVdwgd.js";import"../ui/icons/types.js";import"../ui/mq-text-button.js";import"../chunks/class-map-Co76I6aw.js";import"../chunks/directive-2EDmOukv.js";import"../ui/mq-avatar.js";import"../ui/mq-button.js";import"../ui/mq-input.js";import"../chunks/query-CeeutdfT.js";import"../ui/icons/calendar-icon.js";import"../ui/mq-callout.js";import"../ui/icons/info-circle-outine-icon.js";import"../chunks/index-BJcdB5MT.js";import"../chunks/style-map-CIdqdn7C.js";import"../ui/icons/chevron-left-icon.js";import"../chunks/price-tImUmtpX.js";import"../ui/icons/briefcase-icon.js";import"../ui/icons/clock-icon.js";import"../ui/icons/message-bubble-icon.js";import"../ui/icons/phone-icon.js";import"../ui/mq-card.js";import"../ui/icons/spinner-icon.js";import"../ui/icons/tag-icon.js";import"../ui/mq-toast.js";import"../ui/icons/file-icon.js";import"../ui/icons/upload-icon.js";import"../ui/icons/x-icon.js";import"../ui/mq-textarea.js";import"../ui/mq-skeleton.js";import"../ui/mq-select.js";import"../chunks/index-DiqYAEHW.js";import"../ui/icons/chevron-right-icon.js";import"../chunks/isSameDay-DPfclwIL.js";import"../chunks/index-Bxh8Qfwr.js";import"../theme.js";const o=i({react:t,tagName:"mq-schedule",elementClass:s,events:{onAppointmentCreated:"appointment-created",onAuthRequired:"auth-required"}});export{o as MqSchedule};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as _lit_react from '@lit/react';
|
|
2
|
+
import { SocketProvider } from '../mq-socket-provider.js';
|
|
3
|
+
import 'lit-html';
|
|
4
|
+
import 'socket.io-client';
|
|
5
|
+
import 'lit';
|
|
6
|
+
|
|
7
|
+
declare const MqSocketProvider: _lit_react.ReactWebComponent<SocketProvider, {}>;
|
|
8
|
+
|
|
9
|
+
export { MqSocketProvider };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import{o as t}from"../chunks/create-component-BB-6Gu6l.js";import*as e from"react";import{SocketProvider as r}from"../mq-socket-provider.js";import"../chunks/custom-element-DA9Fxvxd.js";import"../chunks/provide-CfT7g_Zi.js";import"../chunks/context-provider-CiMFpvDA.js";import"../chunks/context-request-event-Dfydf1ub.js";import"../chunks/chunk-YTQUGGS3-DN-JZpgG.js";import"../chunks/external-zAbuzxDj.js";import"../chunks/lit-element-DiWJYFwC.js";import"../chunks/property-scuRaFcM.js";import"../chunks/state-LQivXIgA.js";const s=t({react:e,tagName:"mq-socket-provider",elementClass:r});export{s as MqSocketProvider};
|