@mediquo/elements 0.8.1 → 0.8.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/api-chat-client-CJ1EGJe3.js +1 -0
- package/dist/chunks/{apple-pay-outcomes-BONpT54d.js → apple-pay-outcomes-B1LrUXHR.js} +1 -1
- package/dist/chunks/{appointment-action-unavailable-dialog-BYse3uIa.d.ts → appointment-action-unavailable-dialog-CTiL4nMo.d.ts} +1 -1
- package/dist/chunks/{appointment-card-skeleton-C3mV8Ky1.d.ts → appointment-card-skeleton-C2Sim4nR.d.ts} +3 -3
- package/dist/chunks/appointment-card-skeleton-D8gypuKh.js +1 -0
- package/dist/chunks/document.model.d-DIzMiOmd.d.ts +6 -0
- package/dist/chunks/{documentation-view-GZI-DC3e.js → documentation-view-BbMbGneD.js} +1 -1
- package/dist/chunks/index-Bw-MbGKw.js +1 -0
- package/dist/chunks/{index-PGYfkbm6.js → index-D6Hg-beW.js} +1 -1
- package/dist/chunks/{index-CDBk7hVW.d.ts → index-DTEtqjQF.d.ts} +0 -13
- package/dist/chunks/{index-KhJ8hC0H.d.ts → index-Dbbpnw8f.d.ts} +1 -1
- package/dist/chunks/index-DdkeWQrh.d.ts +53 -0
- package/dist/chunks/index-Nf3nZ9O3.d.ts +16 -0
- package/dist/chunks/index-iaTXVzFa.js +1 -0
- package/dist/chunks/index-uHvVQMNc.js +1 -0
- package/dist/chunks/{index.d-Bl682CAX.d.ts → index.d-XSe7Hy-Q.d.ts} +12 -0
- package/dist/chunks/{mq-chat-room-t3j3Tq4o.d.ts → mq-chat-room-jeDvIF1Z.d.ts} +1 -1
- package/dist/chunks/{mq-layout-L3TlCxI0.js → mq-layout-E5mKSz4A.js} +1 -1
- package/dist/chunks/{mq-layout-D1j50tKd.d.ts → mq-layout-TG2K4zRv.d.ts} +2 -5
- package/dist/chunks/{telemetry-client-CoWay8es.js → telemetry-client-7fvNqUSU.js} +1 -1
- package/dist/env.js +1 -1
- package/dist/mq-api-client-provider.d.ts +1 -1
- package/dist/mq-api-client-provider.js +1 -1
- package/dist/mq-apple-pay-checkout.d.ts +1 -1
- package/dist/mq-apple-pay-checkout.js +1 -1
- package/dist/mq-appointment-checkout.d.ts +1 -1
- package/dist/mq-appointment-checkout.js +1 -1
- package/dist/mq-appointment-documentation.d.ts +4 -3
- package/dist/mq-appointment-documentation.js +1 -1
- package/dist/mq-chat-room.d.ts +2 -2
- package/dist/mq-chat-room.js +1 -1
- package/dist/mq-checkout.d.ts +1 -1
- package/dist/mq-checkout.js +1 -1
- package/dist/mq-dashboard.d.ts +7 -6
- package/dist/mq-dashboard.js +1 -1
- package/dist/mq-documents.d.ts +9 -5
- package/dist/mq-documents.js +1 -1
- package/dist/mq-google-pay-checkout.d.ts +1 -1
- package/dist/mq-google-pay-checkout.js +1 -1
- package/dist/mq-immediate-videocall-checkout.d.ts +1 -1
- package/dist/mq-immediate-videocall-checkout.js +1 -1
- package/dist/mq-my-appointments.d.ts +4 -4
- package/dist/mq-my-appointments.js +1 -1
- package/dist/mq-next-appointments.d.ts +5 -4
- package/dist/mq-next-appointments.js +1 -1
- package/dist/mq-payment-poller.d.ts +1 -1
- package/dist/mq-payment-poller.js +1 -1
- package/dist/mq-recent-documents.d.ts +10 -6
- package/dist/mq-recent-documents.js +1 -1
- package/dist/mq-schedule-success.d.ts +2 -2
- package/dist/mq-schedule-success.js +1 -1
- package/dist/mq-schedule.d.ts +2 -2
- package/dist/mq-schedule.js +1 -1
- package/dist/mq-support-chat.d.ts +3 -3
- package/dist/mq-support-chat.js +1 -1
- package/dist/mq-terms-and-conditions.d.ts +2 -2
- package/dist/mq-terms-and-conditions.js +1 -1
- package/dist/mq-videocall.d.ts +4 -3
- package/dist/mq-videocall.js +1 -1
- package/dist/react/mq-api-client-provider.d.ts +1 -1
- package/dist/react/mq-api-client-provider.js +1 -1
- package/dist/react/mq-apple-pay-checkout.d.ts +1 -1
- package/dist/react/mq-apple-pay-checkout.js +1 -1
- package/dist/react/mq-appointment-checkout.d.ts +1 -1
- package/dist/react/mq-appointment-checkout.js +1 -1
- package/dist/react/mq-appointment-documentation.d.ts +4 -3
- package/dist/react/mq-appointment-documentation.js +1 -1
- package/dist/react/mq-chat-room.d.ts +2 -2
- package/dist/react/mq-chat-room.js +1 -1
- package/dist/react/mq-checkout.d.ts +1 -1
- package/dist/react/mq-checkout.js +1 -1
- package/dist/react/mq-dashboard.d.ts +6 -5
- package/dist/react/mq-dashboard.js +1 -1
- package/dist/react/mq-documents-page.d.ts +5 -2
- package/dist/react/mq-documents-page.js +1 -1
- package/dist/react/mq-documents.d.ts +5 -2
- package/dist/react/mq-documents.js +1 -1
- package/dist/react/mq-google-pay-checkout.d.ts +1 -1
- package/dist/react/mq-google-pay-checkout.js +1 -1
- package/dist/react/mq-immediate-videocall-checkout.d.ts +1 -1
- package/dist/react/mq-immediate-videocall-checkout.js +1 -1
- package/dist/react/mq-my-appointments.d.ts +4 -4
- package/dist/react/mq-my-appointments.js +1 -1
- package/dist/react/mq-next-appointments.d.ts +5 -4
- package/dist/react/mq-next-appointments.js +1 -1
- package/dist/react/mq-payment-poller.d.ts +1 -1
- package/dist/react/mq-payment-poller.js +1 -1
- package/dist/react/mq-recent-documents.d.ts +6 -2
- package/dist/react/mq-recent-documents.js +1 -1
- package/dist/react/mq-schedule-success.d.ts +2 -2
- package/dist/react/mq-schedule-success.js +1 -1
- package/dist/react/mq-schedule.d.ts +1 -1
- package/dist/react/mq-schedule.js +1 -1
- package/dist/react/mq-support-chat.d.ts +2 -2
- package/dist/react/mq-support-chat.js +1 -1
- package/dist/react/mq-terms-and-conditions.d.ts +2 -2
- package/dist/react/mq-terms-and-conditions.js +1 -1
- package/dist/react/mq-videocall.d.ts +4 -3
- package/dist/react/mq-videocall.js +1 -1
- package/dist/ui/icons/download-02-icon.d.ts +6 -0
- package/dist/ui/icons/download-02-icon.js +1 -0
- package/package.json +1 -1
- package/dist/chunks/api-chat-client-pGZWREjK.js +0 -1
- package/dist/chunks/appointment-card-skeleton-CAQmlCTm.js +0 -1
- package/dist/chunks/index-6gxzoTLM.js +0 -1
- package/dist/chunks/index-CoZKmhwT.js +0 -1
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
import * as lit_html from 'lit-html';
|
|
2
2
|
import * as lit from 'lit';
|
|
3
3
|
import { LitElement, PropertyValues } from 'lit';
|
|
4
|
-
import { M as MediquoApiChatClient } from './chunks/index.d-
|
|
4
|
+
import { M as MediquoApiChatClient } from './chunks/index.d-XSe7Hy-Q.js';
|
|
5
5
|
import { Env } from './env.js';
|
|
6
|
-
import './chunks/index-
|
|
7
|
-
import './
|
|
6
|
+
import './chunks/index-DdkeWQrh.js';
|
|
7
|
+
import './chunks/index-DTEtqjQF.js';
|
|
8
|
+
import './chunks/index-Nf3nZ9O3.js';
|
|
8
9
|
export { DownloadFileEvent, MqViewDocumentsEvent } from './events.js';
|
|
9
10
|
import 'axios';
|
|
10
11
|
import 'zod';
|
|
11
12
|
import './chunks/schemas.d-b6_AekBb.js';
|
|
13
|
+
import './chunks/document.model.d-DIzMiOmd.js';
|
|
14
|
+
import './ui/mq-button.js';
|
|
15
|
+
import './ui/mq-skeleton.js';
|
|
12
16
|
|
|
13
17
|
declare class MqRecentDocuments extends LitElement {
|
|
14
18
|
static styles: lit.CSSResult;
|
|
@@ -29,10 +33,10 @@ declare class MqRecentDocuments extends LitElement {
|
|
|
29
33
|
private get patientHash();
|
|
30
34
|
private getPatientDocumentsQuery;
|
|
31
35
|
private getOrganizationSpecialtiesQuery;
|
|
32
|
-
private get isEmpty();
|
|
33
|
-
protected updated(): void;
|
|
34
|
-
private specialtyNameOf;
|
|
35
36
|
private handleViewAll;
|
|
37
|
+
private renderEmptyState;
|
|
38
|
+
private renderSkeleton;
|
|
39
|
+
private renderError;
|
|
36
40
|
private renderDocuments;
|
|
37
41
|
render(): lit_html.TemplateResult<1>;
|
|
38
42
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isValidLocale as t,setLocale as e,getLocale as i,initLocalization as s}from"./i18n.js";import{_ as
|
|
1
|
+
import{isValidLocale as t,setLocale as e,getLocale as i,initLocalization as s}from"./i18n.js";import{_ as r,c as n}from"./chunks/custom-element-D2ziPxYE.js";import{e as o}from"./chunks/provide-BwI4DDGF.js";import{c as a}from"./chunks/consume-CovVqBjI.js";import{m as c}from"./chunks/runtime-Bg1WXVCx.js";import{l as p}from"./chunks/localized-decorator-BlOuLhym.js";import{Q as m}from"./chunks/query-controller-BlO1Ax65.js";import{A as h}from"./chunks/api-client-context-V1UAGtKW.js";import{l as u}from"./chunks/chunk-S5RWG6G2-DPesx3Od.js";import{a as l,t as d,r as k}from"./chunks/telemetry-client-7fvNqUSU.js";import{g as j}from"./chunks/get-patient-documents-query-NC9xCa_N.js";import{g}from"./chunks/get-patient-profile-query-4AO6xvVn.js";import{i as f,a as y,x as v}from"./chunks/lit-element-DiWJYFwC.js";import{n as b}from"./chunks/property-scuRaFcM.js";import{r as x}from"./chunks/state-LQivXIgA.js";import{setEnv as w}from"./env.js";import{t as S}from"./chunks/index-uHvVQMNc.js";import{MqViewDocumentsEvent as q}from"./events.js";export{DownloadFileEvent}from"./events.js";import{c as C,n as $}from"./chunks/api-chat-client-CJ1EGJe3.js";import"./chunks/index-Bw-MbGKw.js";import"./chunks/index-iaTXVzFa.js";import"./chunks/chunk-4FFT6DC2-CVWibomC.js";import"./chunks/external-CJj32K_p.js";import"./chunks/context-request-event-Dfydf1ub.js";import"./chunks/context-consumer-ESdICVAb.js";import"./chunks/chunk-RCFIJTXZ-C6Ir0-sM.js";import"./chunks/create-context-DqP79qjF.js";import"./chunks/query-Cjvi4_dT.js";import"./chunks/chunk-6CCJWPGL-TiaqZaPV.js";import"./chunks/blob-to-base64-CUL1trde.js";import"./ui/icons/download-02-icon.js";import"./ui/icons/types.js";import"./ui/mq-button.js";import"./chunks/class-map-Co76I6aw.js";import"./chunks/directive-2EDmOukv.js";import"./chunks/if-defined-BYeVdwgd.js";import"./ui/mq-toast.js";import"./ui/mq-skeleton.js";import"./chunks/style-map-CIdqdn7C.js";import"./chunks/chunk-HN62IQ7S-xbkIy7k_.js";import"./chunks/parseISO-Dj3qSTG8.js";import"./chunks/format-CRFiCNHw.js";import"./chunks/isBefore-CPpTogxo.js";import"./ui/icons/arrow-right-icon.js";import"./ui/icons/calendar-icon.js";import"./ui/icons/file-icon.js";const P=f`:host{display:flex;flex-direction:column;align-self:start;gap:var(--sp-4);width:100%;min-width:0;box-sizing:border-box}.card{display:flex;flex-direction:column;gap:var(--sp-3);min-width:0;box-sizing:border-box;background-color:var(--color-card,#fff);border:1px solid var(--color-border-subtle,#edecf1);border-radius:var(--mq-recent-documents-radius,12px);padding:var(--mq-recent-documents-padding,var(--sp-6))}`;let Q=class MqRecentDocuments extends y{constructor(){super(...arguments),this.apiClient=C(),this.getPatientProfileQuery=new m(this,()=>g(this.apiClient,{enabled:!this.loginToken})),this.getPatientDocumentsQuery=new m(this,()=>({...j(this.apiClient,{patient_hash:this.patientHash,page:1,per_page:3}),enabled:!!this.patientHash})),this.getOrganizationSpecialtiesQuery=new m(this,()=>l(this.apiClient)),this.handleViewAll=()=>{d.track(k(this.patientHash)),this.dispatchEvent(new q)}}static{this.styles=P}willUpdate(i){i.has("env")&&this.env&&w(this.env),i.has("locale")&&this.locale&&t(this.locale)&&e(this.locale);const s=$(i,{env:this.env,apiKey:this.apiKey,token:this.token,locale:this.locale},this.inheritedApiClient);s&&(this.apiClient=s)}get patientHash(){return this.loginToken?.patient.hash??this.getPatientProfileQuery.result?.data?.hash??""}renderEmptyState(){return v`<widget-empty-state icon="document" heading="${c("No tienes documentación")}" description="${c("Aquí se mostrarán tus recetas e informes médicos.")}"></widget-empty-state>`}renderSkeleton(){return v`<document-list placeholders="${3}"></document-list>`}renderError(){return v`<widget-empty-state icon="document" heading="${c("No hemos podido cargar tu documentación")}" description="${c("Vuelve a intentarlo en unos minutos.")}"></widget-empty-state>`}renderDocuments(){return this.getPatientDocumentsQuery.render({complete:t=>0===t.data.length?this.renderEmptyState():v`<document-list .documents="${S(t.data,this.getOrganizationSpecialtiesQuery.result?.data,i())}" patientHash="${this.patientHash}"></document-list>`,initial:()=>this.getPatientProfileQuery.result?.isError?this.renderError():this.renderSkeleton(),pending:()=>this.renderSkeleton(),error:()=>this.renderError()})}render(){return v`<section-header heading="${c("Documentos recientes")}" action-label="${c("Ver todas")}" @section-action="${this.handleViewAll}"></section-header><div class="card">${this.renderDocuments()}</div>`}};r([b({type:String,attribute:"api-key"})],Q.prototype,"apiKey",void 0),r([b({type:String,attribute:"token"})],Q.prototype,"token",void 0),r([b({type:String,attribute:"locale"})],Q.prototype,"locale",void 0),r([b({type:String,attribute:"env"})],Q.prototype,"env",void 0),r([a({context:h,subscribe:!0}),x()],Q.prototype,"inheritedApiClient",void 0),r([o({context:h}),x()],Q.prototype,"apiClient",void 0),r([a({context:u,subscribe:!0})],Q.prototype,"loginToken",void 0),Q=r([p(),n("mq-recent-documents")],Q),s();export{Q as MqRecentDocuments,q as MqViewDocumentsEvent};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import * as lit_html from 'lit-html';
|
|
2
2
|
import * as lit from 'lit';
|
|
3
3
|
import { LitElement, PropertyValues } from 'lit';
|
|
4
|
-
import { M as MediquoApiChatClient } from './chunks/index.d-
|
|
4
|
+
import { M as MediquoApiChatClient } from './chunks/index.d-XSe7Hy-Q.js';
|
|
5
5
|
import { Env } from './env.js';
|
|
6
6
|
import './ui/mq-callout.js';
|
|
7
7
|
import './ui/mq-button.js';
|
|
8
8
|
import './chunks/professional-overview-mO3tuMuH.js';
|
|
9
9
|
import './chunks/appointment-details-CVEDe_k0.js';
|
|
10
|
-
import './chunks/mq-chat-room-
|
|
10
|
+
import './chunks/mq-chat-room-jeDvIF1Z.js';
|
|
11
11
|
import './ui/mq-floating-bubble.js';
|
|
12
12
|
import './ui/mq-unread-badge.js';
|
|
13
13
|
import './ui/mq-skeleton.js';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{isValidLocale as t,setLocale as e,getLocale as i,initLocalization as o}from"./i18n.js";import{_ as n,c as a}from"./chunks/custom-element-D2ziPxYE.js";import{m as s,s as r}from"./chunks/runtime-Bg1WXVCx.js";import{l as c}from"./chunks/localized-decorator-BlOuLhym.js";import{A as p}from"./chunks/api-client-context-V1UAGtKW.js";import{i as l,a as d,x as m,E as u}from"./chunks/lit-element-DiWJYFwC.js";import{n as h}from"./chunks/property-scuRaFcM.js";import{r as v}from"./chunks/state-LQivXIgA.js";import{setEnv as g}from"./env.js";import{MqViewAppointmentsEvent as f,MqHomeEvent as k}from"./events.js";import{c as b,A as y,n as x,C as j}from"./chunks/api-chat-client-
|
|
1
|
+
import{isValidLocale as t,setLocale as e,getLocale as i,initLocalization as o}from"./i18n.js";import{_ as n,c as a}from"./chunks/custom-element-D2ziPxYE.js";import{m as s,s as r}from"./chunks/runtime-Bg1WXVCx.js";import{l as c}from"./chunks/localized-decorator-BlOuLhym.js";import{A as p}from"./chunks/api-client-context-V1UAGtKW.js";import{i as l,a as d,x as m,E as u}from"./chunks/lit-element-DiWJYFwC.js";import{n as h}from"./chunks/property-scuRaFcM.js";import{r as v}from"./chunks/state-LQivXIgA.js";import{setEnv as g}from"./env.js";import{MqViewAppointmentsEvent as f,MqHomeEvent as k}from"./events.js";import{c as b,A as y,n as x,C as j}from"./chunks/api-chat-client-CJ1EGJe3.js";import{checkIcon as w}from"./ui/icons/check-icon.js";import"./ui/mq-callout.js";import"./ui/mq-button.js";import{e as $}from"./chunks/provide-BwI4DDGF.js";import{c as q}from"./chunks/consume-CovVqBjI.js";import{l as C}from"./chunks/chunk-S5RWG6G2-DPesx3Od.js";import"./chunks/professional-overview-C4H_znIJ.js";import"./chunks/appointment-details-DXLBQnPN.js";import{Q as _}from"./chunks/query-controller-BlO1Ax65.js";import{s as S}from"./chunks/chunk-6CCJWPGL-TiaqZaPV.js";import{g as I}from"./chunks/get-appointment-query-C-gTTuiQ.js";import{g as z}from"./chunks/get-patient-profile-query-4AO6xvVn.js";import{g as A}from"./chunks/chunk-Y4EKUX25-QqMl3eiq.js";import{a as Q}from"./chunks/chunk-HN62IQ7S-xbkIy7k_.js";import{calendarIcon as O}from"./ui/icons/calendar-icon.js";import{chatbubbleIcon as T}from"./ui/icons/chat-bubble-icon.js";import{videoIcon as P}from"./ui/icons/video-icon.js";import"./mq-chat-room.js";import"./ui/mq-floating-bubble.js";import"./ui/mq-unread-badge.js";import{a as E,t as N,m as V,g as H,n as B,o as U,p as F}from"./chunks/telemetry-client-7fvNqUSU.js";import{f as G}from"./chunks/price-DU3YLTpk.js";import"./ui/mq-skeleton.js";import"./ui/mq-card.js";import{Q as M}from"./chunks/chunk-RCFIJTXZ-C6Ir0-sM.js";import{a as R}from"./chunks/addSeconds-ofMnxlgT.js";import"./chunks/chunk-4FFT6DC2-CVWibomC.js";import"./chunks/external-CJj32K_p.js";import"./chunks/create-context-DqP79qjF.js";import"./chunks/isBefore-CPpTogxo.js";import"./chunks/parseISO-Dj3qSTG8.js";import"./ui/icons/types.js";import"./ui/icons/info-circle-outine-icon.js";import"./chunks/class-map-Co76I6aw.js";import"./chunks/directive-2EDmOukv.js";import"./chunks/if-defined-BYeVdwgd.js";import"./chunks/context-request-event-Dfydf1ub.js";import"./chunks/context-consumer-ESdICVAb.js";import"./ui/icons/chevron-down-icon.js";import"./ui/mq-text-button.js";import"./ui/mq-avatar.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"./chunks/query-Cjvi4_dT.js";import"./chunks/format-CRFiCNHw.js";import"./theme.js";import"./ui/icons/x-icon.js";import"./chunks/chunk-BUV4MGML-CkhBbfUu.js";import"./ui/icons/chevron-left-icon.js";import"./chunks/query-CeeutdfT.js";import"./ui/icons/check-double-icon.js";import"./chunks/chunk-YTQUGGS3-DmCGIoFy.js";import"./chunks/mutation-controller-CR2qcqhH.js";import"./chunks/style-map-CIdqdn7C.js";const K=l`header{padding:var(--sp-6) var(--sp-4);display:flex;align-items:center;gap:var(--sp-2);max-width:var(--content-max-width);margin:0 auto}.summary{padding:var(--sp-6) var(--sp-4);background-color:var(--color-neutrals-background-weak);max-width:var(--content-max-width);margin:0 auto}.summary-content{display:flex;flex-direction:column;gap:var(--sp-4)}.manage-appointment{box-sizing:border-box;max-width:var(--content-max-width);margin:0 auto}`;let L=class MqScheduleSuccessSkeleton extends d{static{this.styles=K}render(){return m`<div><header><mq-skeleton width="220px" height="40px" border-radius="md"></mq-skeleton></header><div class="summary"><div class="summary-content"><mq-skeleton width="280px" height="32px" border-radius="md"></mq-skeleton><mq-skeleton width="100%" height="400px" border-radius="lg"></mq-skeleton><mq-skeleton width="100%" height="80px" border-radius="lg"></mq-skeleton></div></div><div class="manage-appointment"><mq-skeleton width="100%" height="313px" border-radius="lg"></mq-skeleton></div></div>`}};L=n([a("mq-schedule-success-skeleton")],L);const D=l`.success-title{display:flex;align-items:center;gap:var(--sp-2);margin-bottom:var(--sp-4)}header h1{font-family:var(--font-titles);font-size:var(--text-3xl);line-height:var(--text-3xl--line-height);font-weight:var(--font-weight-bold);margin:0}h2{font-family:var(--font-titles);font-size:var(--text-2xl);line-height:var(--text-2xl--line-height);font-weight:var(--font-weight-bold);margin:0;margin-bottom:var(--sp-6)}.summary{padding:var(--sp-6) var(--sp-4)}.professional-card{padding:var(--sp-4)}.appointment-summary{margin-bottom:var(--sp-2);display:flex;flex-direction:column;gap:var(--sp-4)}.add-to-calendar-container{padding-top:var(--sp-4);border-top:1px solid var(--color-neutrals-border-disabled)}.price-breakdown{display:flex;flex-direction:column;gap:var(--sp-2)}.price-row{display:flex;justify-content:space-between;gap:var(--sp-4);font-family:var(--font-body);font-size:var(--text-base);line-height:var(--text-base--line-height);color:var(--color-neutrals-text-default)}.price-row--total{font-weight:var(--font-weight-semibold)}.price-breakdown hr{width:100%;border:none;border-top:1px solid var(--color-neutrals-border-disabled);margin:var(--sp-1) 0}.floating-content{height:100%}.actions{display:flex;flex-direction:column;gap:var(--sp-4)}@media (min-width:768px){.actions{flex-direction:row}}.footer-cta{margin-top:var(--sp-4);padding:var(--sp-6) var(--sp-4)}.footer-cta h2{margin-bottom:var(--sp-2)}.footer-cta .description{font-family:var(--font-body);font-size:var(--text-base);line-height:var(--text-base--line-height);color:var(--color-neutrals-text-default);margin:0 0 var(--sp-6)}.footer-cta .actions{display:flex;flex-direction:column;gap:var(--sp-3)}`;class OpenVideocallEvent extends Event{static{this.eventName="open-videocall"}constructor(t){super(OpenVideocallEvent.eventName,{bubbles:!0,composed:!0}),this.detail=t}}let W=class MqScheduleSuccess extends d{constructor(){super(...arguments),this.kind="schedule",this.showNavCtas=!1,this._trackedPageView=!1,this.apiClient=b(),this.getPatientProfileQuery=new _(this,()=>z(this.apiClient)),this.getAppointmentQuery=new _(this,()=>I(this.apiClient,{id:this.appointmentId})),this.getCouponQuery=new _(this,()=>{return t=this.apiClient,e={appointmentId:this.appointmentId},i={enabled:!!this.appointmentId},{queryKey:S(t,"appointment-consultation-coupon",e.appointmentId),queryFn:()=>t.payments.getAppointmentConsultationCoupon(e.appointmentId),retry:!1,...i};var t,e,i}),this.getOrganizationSpecialtiesQuery=new _(this,()=>E(this.apiClient)),this.isChatOpen=!1,this.unreadQuery=new _(this,()=>A(this.apiClient,{roomId:Number(this.getAppointmentQuery.result?.data?.room_id)},{enabled:!!this.getAppointmentQuery.result?.data?.room_id})),this._getCalloutText=t=>{switch(t.channel){case y.videocall:return s("Te enviaremos un enlace al email indicado cuando sea el momento de conectarte a la vídeoconsulta. Asegúrate de tener buena conexión a internet y un dispositivo con cámara y micrófono.");case y.phonecall:return s(r`El profesional te llamará al
|
|
2
2
|
${this.getPatientProfileQuery.result?.data?.profile.phone??""} en el horario
|
|
3
3
|
seleccionado. Asegúrate de tener buena cobertura y poder atender en
|
|
4
4
|
el horario elegido.`);case y.chat:return s("El profesional te enviará un mensaje para que podamos coordinar la cita. Asegúrate de tener buena cobertura y poder atender en el horario elegido.");default:return u}}}static{this.styles=D}get _accessToken(){return this.token??this.loginToken?.access_token}get _timezone(){return this.timezone||Intl.DateTimeFormat().resolvedOptions().timeZone||"UTC"}willUpdate(i){i.has("env")&&this.env&&g(this.env),i.has("locale")&&this.locale&&t(this.locale)&&e(this.locale);const o=x(i,{env:this.env,apiKey:this.apiKey,token:this.token,locale:this.locale},this.inheritedApiClient);o&&(this.apiClient=o)}get _patientHash(){return this.getPatientProfileQuery.result?.data?.hash??""}connectedCallback(){super.connectedCallback(),this.queryClientContext?.invalidateQueries()}updated(){!this._trackedPageView&&this._patientHash&&(this._trackedPageView=!0,N.track(V(this._patientHash,this.appointmentId)))}renderPriceBreakdown(t,e,i){const o=t.price;if(null==o||o<=0)return u;const n=t.currency??"EUR",a=t.discount_amount??0,r=a>0,c=o-a,p=this.getCouponQuery.result?.data,l=p?.name??p?.code,d=r?p?.percent_off??Math.round(a/o*100):0,h=l?`${s("Promoción")} ${l}`:s("Promoción");return m`<div class="price-breakdown"><div class="price-row"><span>${i}</span> <span>${G({amount:o,currency:n},e)}</span></div>${r?m`<div class="price-row"><span>${h} (-${d}%)</span> <span>${G({amount:-a,currency:n},e)}</span></div><hr><div class="price-row price-row--total"><span>${s("Total")}</span> <span>${G({amount:c,currency:n},e)}</span></div>`:u}</div>`}render(){return this.getAppointmentQuery.render({pending:()=>m`<mq-schedule-success-skeleton></mq-schedule-success-skeleton>`,complete:t=>{const e=i(),o=Q(t.start_date),n=R(o,t.duration),a=this.getOrganizationSpecialtiesQuery.result?.data?.find(e=>e.id===Number(t.speciality_id)),c=H(a?.code??"",e,a?.name),p=t.channel===y.videocall,l=t.channel===y.phonecall,d=!0===t.has_chat_in_appointment,h=(p||l)&&d,v=this._accessToken;return m`<div><header><div class="success-title">${w()}<h1>${"schedule"===this.kind?s("Cita confirmada"):s("Cita modificada")}</h1></div><h2>${s(r`Resumen de la cita para ${t?.to?.name??""}`)}</h2></header><mq-card class="summary" roundness="md"><div class="appointment-summary"><professional-overview .name="${t.from.name??""}" .specialtyName="${c}" .collegiateNumber="${t.from.collegiate_number??void 0}" .description="${t.from.description??""}" .languages="${t.from.languages??[]}" .avatar="${t.from.avatar??""}" always-expanded-on-desktop></professional-overview><appointment-details .startsAt="${o.toISOString()}" .duration="${t.duration}" .channel="${t.channel}" .timezone="${this._timezone}"></appointment-details>${this.renderPriceBreakdown(t,e,c||s("Consulta"))}<div class="add-to-calendar-container"><mq-text-button fontWeight="bold" size="sm" @click="${()=>{N.track(B(this._patientHash,this.appointmentId));const e=function({title:t,description:e,startsAt:i,endsAt:o}){const n=t=>t.toISOString().replace(/[-:]/g,"").replace(/\.\d{3}/,""),a=n(i),s=n(o);return`https://www.google.com/calendar/render?${new URLSearchParams({action:"TEMPLATE",text:t,dates:`${a}/${s}`,...e&&{details:e}}).toString()}`}({title:s(r`Cita agendada de ${t.from.speciality??""}`),startsAt:o,endsAt:n,description:p&&t.consultation_short_url?s(r`Enlace a la cita: ${t.consultation_short_url}`):void 0});window.open(e,"_blank")}}">${O({size:24})} ${s("Añadir al calendario")}</mq-text-button></div>${h||p?m`<div class="actions">${h?m`<mq-button variant="primary" fullwidth size="md" @click="${()=>{N.track(U(this._patientHash,this.appointmentId)),this.isChatOpen=!this.isChatOpen}}">${T({size:24})} ${s("Chatear con el profesional")} ${(this.unreadQuery.result?.data?.unread_count??0)>0?m`<mq-unread-badge></mq-unread-badge>`:u}</mq-button>`:u} ${p?m`<mq-button variant="outline" fullwidth size="md" @click="${()=>{N.track(F(this._patientHash,this.appointmentId)),this.dispatchEvent(new OpenVideocallEvent({appointmentId:this.appointmentId}))}}">${P({size:24})} ${s("Ir a videollamada")}</mq-button>`:u}</div>`:u}</div><mq-callout background="default" variant="info" ?noPadding="${!(h||p)}">${this._getCalloutText(t)}</mq-callout></mq-card>${this.showNavCtas?m`<mq-card class="footer-cta" roundness="md"><h2>${s("Tus citas")}</h2><p class="description">${s("Accede, modifica o anula tus citas.")}</p><div class="actions"><mq-button variant="primary" size="md" fullwidth @click="${()=>{this.dispatchEvent(new f({tab:"next"}))}}">${s("Ver mis citas")}</mq-button><mq-button variant="outline" size="md" fullwidth @click="${()=>{this.dispatchEvent(new k)}}">${s("Volver al inicio")}</mq-button></div></mq-card>`:u}</div><mq-floating-bubble ?dismissable="${!1}" .open="${this.isChatOpen}" @mq-close="${()=>{this.isChatOpen=!1}}" hideCloseButton>${this.isChatOpen&&v?m`<div slot="content" class="floating-content"><mq-chat-room .consultationId="${t.id}" .consultationType="${j.appointment}" .token="${v}" .roomId="${Number(t.room_id)}" .professionalHash="${t.from.hash}" @mq-chat-room-close="${()=>{this.isChatOpen=!1}}"></mq-chat-room></div>`:u}</mq-floating-bubble>`}})}};n([h({type:String})],W.prototype,"kind",void 0),n([h({type:String})],W.prototype,"appointmentId",void 0),n([h({type:String,attribute:"api-key"})],W.prototype,"apiKey",void 0),n([h({type:String,attribute:"token"})],W.prototype,"token",void 0),n([h({type:String,attribute:"timezone"})],W.prototype,"timezone",void 0),n([h({type:String,attribute:"locale"})],W.prototype,"locale",void 0),n([h({type:String,attribute:"env"})],W.prototype,"env",void 0),n([h({type:Boolean,attribute:"show-nav-ctas"})],W.prototype,"showNavCtas",void 0),n([q({context:M,subscribe:!0})],W.prototype,"queryClientContext",void 0),n([q({context:C})],W.prototype,"loginToken",void 0),n([q({context:p,subscribe:!0}),v()],W.prototype,"inheritedApiClient",void 0),n([$({context:p}),v()],W.prototype,"apiClient",void 0),n([v()],W.prototype,"isChatOpen",void 0),W=n([c(),a("mq-schedule-success")],W),o();export{W as MqScheduleSuccess,OpenVideocallEvent};
|
package/dist/mq-schedule.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import * as lit_html_directive_js from 'lit-html/directive.js';
|
|
|
2
2
|
import * as lit_html_directives_keyed_js from 'lit-html/directives/keyed.js';
|
|
3
3
|
import * as lit from 'lit';
|
|
4
4
|
import { LitElement, PropertyValues, TemplateResult, nothing } from 'lit';
|
|
5
|
-
import { M as MediquoApiChatClient, c as GetScheduleServicesResponse, C as CreatePaymentLinkRequest, P as PaymentProvider, d as GetProfessionalsBySpecialtyAndServiceResponse } from './chunks/index.d-
|
|
5
|
+
import { M as MediquoApiChatClient, c as GetScheduleServicesResponse, C as CreatePaymentLinkRequest, P as PaymentProvider, d as GetProfessionalsBySpecialtyAndServiceResponse } from './chunks/index.d-XSe7Hy-Q.js';
|
|
6
6
|
import './ui/mq-button.js';
|
|
7
7
|
import { Env } from './env.js';
|
|
8
8
|
import * as lit_html from 'lit-html';
|
|
@@ -561,7 +561,7 @@ declare class ProfessionalsList extends LitElement {
|
|
|
561
561
|
private getOrganizationSpecialtiesQuery;
|
|
562
562
|
private getScheduleServicesQuery;
|
|
563
563
|
private getProfessionalsBySpecialtyAndServiceQuery;
|
|
564
|
-
render(): lit_html.TemplateResult<1> |
|
|
564
|
+
render(): typeof nothing | lit_html.TemplateResult<1> | null;
|
|
565
565
|
}
|
|
566
566
|
declare global {
|
|
567
567
|
interface HTMLElementTagNameMap {
|