@mediquo/elements 0.6.0 → 0.6.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-BBL1U9EQ.js +1 -0
- package/dist/chunks/{apple-pay-outcomes-0ozxSHyb.js → apple-pay-outcomes-CnVRvAVS.js} +1 -1
- package/dist/chunks/{appointment-card-skeleton-hglMW7x6.js → appointment-card-skeleton-C8VERHzq.js} +1 -1
- package/dist/chunks/custom-element-D2ziPxYE.js +1 -0
- package/dist/chunks/{documentation-view-geQU8ttU.js → documentation-view-DXSjqDwQ.js} +1 -1
- package/dist/chunks/{index-CvDnN2NR.js → index-Ca-l41nB.js} +1 -1
- package/dist/chunks/{index-BBUiLb3Y.js → index-DhfVmF4C.js} +1 -1
- package/dist/chunks/{index-Bx8TWBsk.js → index-KvIw19qY.js} +1 -1
- package/dist/chunks/{index-BJcdB5MT.js → index-ShXzd7UZ.js} +1 -1
- package/dist/chunks/{index-CGnPsMVQ.js → index-m6lXVNW0.js} +1 -1
- package/dist/chunks/{mq-layout-CGcdxGMQ.js → mq-layout-BndHxkbb.js} +1 -1
- package/dist/chunks/{price-DIhNpS8n.js → price-LTnCz9kN.js} +1 -1
- package/dist/chunks/{professional-overview-CfjgnTw4.js → professional-overview-C4H_znIJ.js} +1 -1
- package/dist/chunks/{refund-cancel-policy-BQDnePq9.js → refund-cancel-policy-CXFTrFfo.js} +1 -1
- package/dist/chunks/{schemas.d-5CaMrfOq.d.ts → schemas.d-Bss7CeCZ.d.ts} +3 -0
- package/dist/env.js +1 -1
- package/dist/index.js +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.js +1 -1
- package/dist/mq-chat-room.js +1 -1
- package/dist/mq-checkout.js +1 -1
- package/dist/mq-dashboard.js +1 -1
- package/dist/mq-documents.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.js +1 -1
- package/dist/mq-payment-poller.js +1 -1
- package/dist/mq-professional-presence-sync.js +1 -1
- package/dist/mq-query-client-provider.js +1 -1
- package/dist/mq-schedule-success.js +1 -1
- package/dist/mq-schedule.d.ts +4 -5
- package/dist/mq-schedule.js +1 -1
- package/dist/mq-session-provider.js +1 -1
- package/dist/mq-socket-provider.js +1 -1
- package/dist/mq-support-chat.js +1 -1
- package/dist/mq-terms-and-conditions.js +1 -1
- package/dist/mq-theme-provider.js +1 -1
- package/dist/mq-unread-count-sync.js +1 -1
- package/dist/mq-videocall.js +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.js +1 -1
- package/dist/react/mq-chat-room.js +1 -1
- package/dist/react/mq-checkout.js +1 -1
- package/dist/react/mq-dashboard.js +1 -1
- package/dist/react/mq-documents-page.js +1 -1
- package/dist/react/mq-documents.js +1 -1
- package/dist/react/mq-google-pay-checkout.js +1 -1
- package/dist/react/mq-immediate-videocall-checkout.js +1 -1
- package/dist/react/mq-my-appointments.js +1 -1
- package/dist/react/mq-payment-poller.js +1 -1
- package/dist/react/mq-professional-presence-sync.js +1 -1
- package/dist/react/mq-query-client-provider.js +1 -1
- package/dist/react/mq-schedule-success.js +1 -1
- package/dist/react/mq-schedule.d.ts +3 -4
- package/dist/react/mq-schedule.js +1 -1
- package/dist/react/mq-session-provider.js +1 -1
- package/dist/react/mq-socket-provider.js +1 -1
- package/dist/react/mq-support-chat.js +1 -1
- package/dist/react/mq-terms-and-conditions.js +1 -1
- package/dist/react/mq-theme-provider.js +1 -1
- package/dist/react/mq-toast-container.js +1 -1
- package/dist/react/mq-unread-count-sync.js +1 -1
- package/dist/react/mq-videocall.js +1 -1
- package/dist/toast.js +1 -1
- package/dist/ui/back-link.js +1 -1
- package/dist/ui/mq-avatar.js +1 -1
- package/dist/ui/mq-button.js +1 -1
- package/dist/ui/mq-calendar.js +1 -1
- package/dist/ui/mq-callout.js +1 -1
- package/dist/ui/mq-card.js +1 -1
- package/dist/ui/mq-checkbox.js +1 -1
- package/dist/ui/mq-clamped-text.js +1 -1
- package/dist/ui/mq-dialog.js +1 -1
- package/dist/ui/mq-floating-bubble.js +1 -1
- package/dist/ui/mq-input.js +1 -1
- package/dist/ui/mq-rating.js +1 -1
- package/dist/ui/mq-select.js +1 -1
- package/dist/ui/mq-skeleton.js +1 -1
- package/dist/ui/mq-tabs.js +1 -1
- package/dist/ui/mq-text-button.js +1 -1
- package/dist/ui/mq-textarea.js +1 -1
- package/dist/ui/mq-time-slot-picker.js +1 -1
- package/dist/ui/mq-toast.js +1 -1
- package/dist/ui/mq-unread-badge.js +1 -1
- package/package.json +1 -1
- package/dist/chunks/api-chat-client-1Vz6ZOwp.js +0 -1
- package/dist/chunks/custom-element-DA9Fxvxd.js +0 -1
package/dist/mq-documents.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isValidLocale as t,setLocale as e,getLocale as i,initLocalization as n}from"./i18n.js";import{_ as o,
|
|
1
|
+
import{isValidLocale as t,setLocale as e,getLocale as i,initLocalization as n}from"./i18n.js";import{_ as o,c as r}from"./chunks/custom-element-D2ziPxYE.js";import{m as s,s as a}from"./chunks/runtime-Bg1WXVCx.js";import{l as c}from"./chunks/localized-decorator-BlOuLhym.js";import{Q as p}from"./chunks/query-controller-BlO1Ax65.js";import{g as l,a as u}from"./chunks/i18n-formats-DYS91YEa.js";import{g as d}from"./chunks/get-patient-documents-query-DIQH-TMM.js";import{g as m}from"./chunks/get-patient-profile-query-B0tUDJmT.js";import{i as h,a as g,x as v,E as k}from"./chunks/lit-element-DiWJYFwC.js";import{n as y}from"./chunks/property-scuRaFcM.js";import{r as f}from"./chunks/state-LQivXIgA.js";import{setEnv as b}from"./env.js";import{a as j}from"./chunks/api-chat-client-BBL1U9EQ.js";import{chevronLeftIcon as x}from"./ui/icons/chevron-left-icon.js";import{chevronRightIcon as $}from"./ui/icons/chevron-right-icon.js";import"./chunks/index-KvIw19qY.js";import"./ui/mq-skeleton.js";import{o as P}from"./chunks/if-defined-BYeVdwgd.js";import"./ui/back-link.js";import"./chunks/chunk-4FFT6DC2-CVWibomC.js";import"./chunks/external-CJj32K_p.js";import"./chunks/chunk-RCFIJTXZ-C6Ir0-sM.js";import"./chunks/create-context-DqP79qjF.js";import"./chunks/context-consumer-ESdICVAb.js";import"./chunks/context-request-event-Dfydf1ub.js";import"./chunks/query-Cjvi4_dT.js";import"./chunks/parseISO-Dj3qSTG8.js";import"./chunks/format-CRFiCNHw.js";import"./chunks/isBefore-CPpTogxo.js";import"./ui/icons/types.js";import"./ui/icons/download-icon.js";import"./ui/mq-button.js";import"./chunks/class-map-Co76I6aw.js";import"./chunks/directive-2EDmOukv.js";import"./events.js";import"./chunks/style-map-CIdqdn7C.js";import"./ui/mq-text-button.js";const q=h`:host{display:block}.container{background-color:var(--color-card);padding:var(--mq-documents-padding,var(--sp-5) var(--sp-4));border-radius:var(--border-radius-md)}.documents-list{border-radius:var(--border-radius-md);background-color:var(--color-muted);padding:var(--sp-3);display:flex;flex-direction:column;gap:var(--sp-4)}.empty{font-family:var(--font-body);font-size:var(--text-sm);color:var(--color-neutrals-text-default);text-align:center;padding:var(--sp-6) var(--sp-4);margin:0}hr{width:100%;border:none;border-top:1px solid var(--color-border);margin:0}.pagination{display:flex;align-items:center;justify-content:center;gap:var(--sp-2_5);margin-top:var(--sp-4)}.pagination-text{font-family:var(--font-body);font-size:var(--text-sm);font-weight:var(--font-weight-normal);color:var(--color-neutrals-text-default);line-height:normal}.pagination-button{background:0 0;border:none;cursor:pointer;padding:0;display:flex;align-items:center;justify-content:center;width:24px;height:24px;color:var(--color-neutrals-text-default)}.pagination-button:disabled{opacity:0;cursor:not-allowed}.pagination-button:not(:disabled):hover{opacity:.7}@media (min-width:768px){.documents-list{padding:var(--sp-6)}}`;let _=class MqDocuments extends g{constructor(){super(...arguments),this.currentPage=1,this.getPatientProfileQuery=new p(this,()=>m(j)),this.getPatientDocumentsQuery=new p(this,()=>({...d(j,{patient_hash:this._patientHash,page:this.currentPage,per_page:6}),enabled:!!this._patientHash})),this.getOrganizationSpecialtiesQuery=new p(this,()=>l(j))}static{this.styles=q}willUpdate(i){i.has("env")&&this.env&&b(this.env),i.has("apiKey")&&this.apiKey&&j.setApiKey(this.apiKey),i.has("token")&&this.token&&j.setAuthToken(this.token),i.has("locale")&&this.locale&&t(this.locale)&&(e(this.locale),j.setLanguage(this.locale))}get _patientHash(){return this.getPatientProfileQuery.result?.data?.hash??""}handlePreviousPage(){this.currentPage>1&&(this.currentPage-=1)}handleNextPage(){const t=this.getPatientDocumentsQuery.result?.data?.meta?.last_page??1;this.currentPage<t&&(this.currentPage+=1)}renderDocuments(){return this.getPatientDocumentsQuery.render({complete:t=>{const e=i();return 0===t.data.length?v`<p class="empty">${s("Aquí se mostrarán tus recetas e informes médicos.")}</p>`:v`<div class="documents-list">${t.data.map((i,n)=>v`<patient-document filename="${i.name}" kind="${i.document_type}" specialty="${(()=>{const t=this.getOrganizationSpecialtiesQuery.result?.data?.find(t=>t.id===i.professional.speciality_id);return u(t?.code??"",e,t?.name)})()}" description="${i.name}" date="${i.created_at}" downloadUrl="${i.url}"></patient-document>${n<t.data.length-1?v`<hr>`:k}`)}</div>${this.renderPagination(t.meta)}`},pending:()=>v`<div class="documents-list"><mq-skeleton height="57px"></mq-skeleton><hr><mq-skeleton height="57px"></mq-skeleton><hr><mq-skeleton height="57px"></mq-skeleton></div>`})}renderPagination(t){const e=t.current_page>1,i=t.current_page<t.last_page;return v`<div class="pagination"><button class="pagination-button" @click="${this.handlePreviousPage}" ?disabled="${!e}" aria-label="${s("Página anterior")}">${x({size:24})}</button> <span class="pagination-text">${s(a`${t.current_page} de ${t.last_page}`)} </span><button class="pagination-button" @click="${this.handleNextPage}" ?disabled="${!i}" aria-label="${s("Página siguiente")}">${$({size:24})}</button></div>`}render(){return v`<div class="container">${this.renderDocuments()}</div>`}};o([y({type:String,attribute:"api-key"})],_.prototype,"apiKey",void 0),o([y({type:String,attribute:"token"})],_.prototype,"token",void 0),o([y({type:String,attribute:"locale"})],_.prototype,"locale",void 0),o([y({type:String,attribute:"env"})],_.prototype,"env",void 0),o([f()],_.prototype,"currentPage",void 0),_=o([c(),r("mq-documents")],_);const w=h`:host{display:block}.title{margin:var(--sp-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)}`;let S=class MqDocumentsPage extends g{static{this.styles=w}render(){return v`<back-link source="documents">${s("Volver")}</back-link><h1 class="title">${s("Mis documentos")}</h1><mq-documents api-key="${P(this.apiKey)}" token="${P(this.token)}" locale="${P(this.locale)}" env="${P(this.env)}"></mq-documents>`}};o([y({type:String,attribute:"api-key"})],S.prototype,"apiKey",void 0),o([y({type:String,attribute:"token"})],S.prototype,"token",void 0),o([y({type:String,attribute:"locale"})],S.prototype,"locale",void 0),o([y({type:String,attribute:"env"})],S.prototype,"env",void 0),S=o([c(),r("mq-documents-page")],S),n();export{_ as MqDocuments,S as MqDocumentsPage};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as t,t as e}from"./chunks/custom-element-DA9Fxvxd.js";import{m as a}from"./chunks/runtime-Bg1WXVCx.js";import{l as n}from"./chunks/localized-decorator-BlOuLhym.js";import{L as o}from"./chunks/login-token-task-BI-L2zSV.js";import{l as i}from"./chunks/chunk-4FFT6DC2-CVWibomC.js";import{i as s,a as r,x as l}from"./chunks/lit-element-DiWJYFwC.js";import{n as c}from"./chunks/property-scuRaFcM.js";import{r as h}from"./chunks/state-LQivXIgA.js";import{setEnv as u}from"./env.js";import{initLocalization as p,isValidLocale as y,setLocale as d}from"./i18n.js";import{e as m,a as g}from"./chunks/api-chat-client-1Vz6ZOwp.js";import{r as v}from"./chunks/apple-pay-outcomes-0ozxSHyb.js";import"./chunks/task-Bj8p7kJX.js";import"./chunks/external-CJj32K_p.js";import"./chunks/parseISO-Dj3qSTG8.js";import"./chunks/format-CRFiCNHw.js";import"./chunks/isBefore-CPpTogxo.js";function b(){return"undefined"!=typeof google&&"function"==typeof google.payments?.api?.PaymentsClient}const _=["PAN_ONLY","CRYPTOGRAM_3DS"],k=["VISA","MASTERCARD","AMEX"];function f(t){return{type:"PAYMENT_GATEWAY",parameters:{gateway:"globalpayments",gatewayMerchantId:t}}}function C(t){return{type:"CARD",parameters:{allowedAuthMethods:[..._],allowedCardNetworks:[...k]},tokenizationSpecification:f(t)}}function w(t){return[C(t)]}function E(t,e){return"test"===e?"TEST":"production"===e?"PRODUCTION":"development"===t?"TEST":"PRODUCTION"}function P(t,e){return function(t,e){return{apiVersion:2,apiVersionMinor:0,allowedPaymentMethods:w(t.gatewayMerchantId),merchantInfo:{merchantId:t.merchantId,merchantName:t.merchantName},transactionInfo:{totalPriceStatus:"FINAL",totalPrice:e.amount,currencyCode:e.currencyCode,countryCode:e.countryCode}}}(t,e)}async function I(t,e,a,n={}){if("undefined"==typeof window||!window.isSecureContext)return i.warn("google-pay: unavailable outside a secure context"),{available:!1,reason:"unsupported"};if(!t.trim())return i.warn("google-pay: missing merchant id"),{available:!1,reason:"merchant-id-missing"};if(!e.trim())return i.warn("google-pay: missing gateway merchant id"),{available:!1,reason:"gateway-merchant-id-missing"};if(!await function(t=8e3,e){return b()?Promise.resolve(!0):t<=0||e?.aborted?Promise.resolve(!1):new Promise(a=>{const n=Date.now()+t,o=t=>{clearInterval(s),e?.removeEventListener("abort",i),a(t)},i=()=>o(!1),s=setInterval(()=>{b()?o(!0):Date.now()>=n&&o(!1)},100);e?.addEventListener("abort",i,{once:!0})})}(n.sdkWaitTimeoutMs,n.signal))return i.warn("google-pay: pay.js was not loaded by the host page"),{available:!1,reason:"sdk-missing"};const o=E(a,n.gatewayEnvironment);try{const t=new google.payments.api.PaymentsClient({environment:o}),a=await t.isReadyToPay(function(t){return{apiVersion:2,apiVersionMinor:0,allowedPaymentMethods:w(t)}}(e));return a.result?{available:!0}:(i.warn("google-pay: isReadyToPay returned false",{environment:o}),{available:!1,reason:"unsupported"})}catch(t){return i.warn("google-pay: isReadyToPay threw",{environment:o,error:t instanceof Error?t.message:String(t)}),{available:!1,reason:"unsupported"}}}function G(t,e){return function(t){if(function(t){return"object"==typeof t&&null!==t&&"statusCode"in t&&"string"==typeof t.statusCode}(t)){const e=t.statusCode.toUpperCase();if("CANCELED"===e||"CANCELLED"===e)return!0}if(t instanceof Error){const e=t.message.toLowerCase();return e.includes("cancel")||e.includes("closed")||e.includes("abort")}return!1}(t)?{kind:"cancelled"}:m(t)&&400===t.response?.status?{kind:"denied",sessionId:e}:{kind:"authorize"}}function S(t){if(null!==t&&"object"==typeof t){const e=t.paymentMethodData?.tokenizationData,a=e?.token;if("string"==typeof a&&a.length>0)return a}throw new Error("Invalid Google Pay payment data: missing tokenizationData.token")}try{p()}catch{}const T=s`:host{display:flex;flex-direction:column;align-items:stretch;justify-content:center;gap:12px;width:100%;min-height:48px}.pay-row{display:block;width:100%}.pay-row--paying{opacity:.55;pointer-events:none}::slotted([slot=google-pay-button]){display:block;width:100%;height:var(--mq-google-pay-button-height,48px)}.state{text-align:center;font-family:system-ui,sans-serif;font-size:15px;color:#86868b;margin:0}`;class GooglePayCheckoutSuccessEvent extends Event{static{this.eventName="payment-success"}constructor(t){super(GooglePayCheckoutSuccessEvent.eventName,{bubbles:!0,composed:!0}),this.detail=t}}class GooglePayCheckoutDeniedEvent extends Event{static{this.eventName="payment-denied"}constructor(t){super(GooglePayCheckoutDeniedEvent.eventName,{bubbles:!0,composed:!0}),this.detail=t}}class GooglePayCheckoutErrorEvent extends Event{static{this.eventName="payment-error"}constructor(t){super(GooglePayCheckoutErrorEvent.eventName,{bubbles:!0,composed:!0}),this.detail=t}}const A=new Set(["sdk-missing","unsupported"]);function j(t,e){i.warn(t,{error:e instanceof Error?e.message:String(e)})}let D=class MqGooglePayCheckout extends r{constructor(){super(...arguments),this._availabilityPhase="checking",this._unavailableReason=null,this._paying=!1,this._paymentsClient=null,this._paymentsClientEnvironment=null,this._buttonHost=null,this._availabilityGeneration=0,this._availabilityAbortController=null,this._terminalErrorDispatched=!1,this._loginTokenTask=new o(this,g,{args:()=>[this.apiKey,this.token],onComplete:t=>{g.setAuthToken(t.access_token),this._refreshAvailability()},onError:()=>{this.dispatchEvent(new GooglePayCheckoutErrorEvent({reason:"auth"}))}}),this._onPayClick=()=>{this._paying||"ready"!==this._availabilityPhase||this._processPayment()}}static{this.styles=T}willUpdate(t){if(t.has("env")&&(this.env&&u(this.env),this._resetPaymentsClient()),t.has("gatewayEnvironment")&&this._resetPaymentsClient(),t.has("apiKey")&&g.setApiKey(this.apiKey),t.has("locale")){const t=y(this.locale)?this.locale:"es_ES";d(t),g.setLanguage(t)}(t.has("merchantId")||t.has("gatewayMerchantId")||t.has("env")||t.has("gatewayEnvironment"))&&this._loginTokenTask.value&&this._refreshAvailability()}connectedCallback(){super.connectedCallback(),this._availabilityAbortController=new AbortController,this._terminalErrorDispatched=!1}disconnectedCallback(){this._availabilityAbortController?.abort(),this._availabilityAbortController=null,this._resetPaymentsClient(),super.disconnectedCallback()}_dispatchTerminalError(){this._terminalErrorDispatched||(this._terminalErrorDispatched=!0,this.dispatchEvent(new GooglePayCheckoutErrorEvent({reason:"unsupported"})))}_resetPaymentsClient(){this._paymentsClient=null,this._paymentsClientEnvironment=null,this._removeButtonHost()}_getPaymentsClient(){const t=E(this.env,this.gatewayEnvironment);return this._paymentsClient&&this._paymentsClientEnvironment===t||(this._paymentsClient=new google.payments.api.PaymentsClient({environment:t}),this._paymentsClientEnvironment=t,this._buttonHost=null),this._paymentsClient}async _refreshAvailability(){const t=++this._availabilityGeneration;this._availabilityPhase="checking",this._unavailableReason=null,this._removeButtonHost();const e=await I(this.merchantId??"",this.gatewayMerchantId??"",this.env,{signal:this._availabilityAbortController?.signal,gatewayEnvironment:this.gatewayEnvironment});if(t===this._availabilityGeneration&&this.isConnected){if(!e.available)return this._availabilityPhase="unavailable",this._unavailableReason=e.reason,void(A.has(e.reason)&&this._dispatchTerminalError());this._availabilityPhase="ready",this._unavailableReason=null}}_ensureButtonHost(){const t=this.querySelector(':scope > [slot="google-pay-button"]');if(t)return t;const e=document.createElement("div");return e.slot="google-pay-button",this.appendChild(e),e}_removeButtonHost(){this.querySelector(':scope > [slot="google-pay-button"]')?.remove(),this._buttonHost=null}_mountGooglePayButton(){if(this._buttonHost||"ready"!==this._availabilityPhase)return;const t=this._ensureButtonHost();try{const e=this._getPaymentsClient().createButton({onClick:this._onPayClick,buttonColor:"black",buttonType:"pay",buttonSizeMode:"fill"});t.replaceChildren(e),this._buttonHost=t}catch(t){j("mq-google-pay-checkout: failed to create Google Pay button",t),this._removeButtonHost(),this._availabilityPhase="unavailable",this._unavailableReason="unsupported",this._dispatchTerminalError()}}updated(t){super.updated(t),"ready"===this._availabilityPhase&&this._mountGooglePayButton()}async _processPayment(){this._paying=!0;try{const t=await this._getPaymentsClient().loadPaymentData(P({merchantId:this.merchantId,gatewayMerchantId:this.gatewayMerchantId,merchantName:this.merchantName||this.label},{amount:this.amount,currencyCode:this.currency,countryCode:this.country})),e=await g.payments.authorizeGooglePay({order_id:this.sessionId,token:S(t)}),{status:a,consultation_id:n}=e.data,o=v(a,n,this.sessionId);switch(o.kind){case"success":this.dispatchEvent(new GooglePayCheckoutSuccessEvent({sessionId:o.sessionId,reference:o.reference}));break;case"denied":this.dispatchEvent(new GooglePayCheckoutDeniedEvent({sessionId:o.sessionId}));break;case"error":this.dispatchEvent(new GooglePayCheckoutErrorEvent({reason:o.reason}))}}catch(t){const e=G(t,this.sessionId);switch(e.kind){case"cancelled":this.dispatchEvent(new GooglePayCheckoutErrorEvent({reason:"cancelled"}));break;case"denied":this.dispatchEvent(new GooglePayCheckoutDeniedEvent({sessionId:e.sessionId}));break;case"authorize":j("mq-google-pay-checkout: authorize failed",t),this.dispatchEvent(new GooglePayCheckoutErrorEvent({reason:"authorize"}))}}finally{this._paying=!1}}_renderUnavailable(){switch(this._unavailableReason){case"merchant-id-missing":return l`<p class="state">${a("Falta el identificador de comercio de Google Pay")}</p>`;case"gateway-merchant-id-missing":return l`<p class="state">${a("Falta el identificador de pasarela de Google Pay")}</p>`;case"sdk-missing":return l`<p class="state">${a("No se ha podido cargar Google Pay. Comprueba la configuración del sitio e inténtalo de nuevo.")}</p>`;default:return l`<p class="state">${a("Google Pay no está disponible. Prueba con tarjeta u otro método de pago.")}</p>`}}render(){return this._loginTokenTask.render({pending:()=>l`<p class="state">${a("Preparando Google Pay…")}</p>`,error:()=>l`<p class="state">${a("No hemos podido iniciar el pago")}</p>`,complete:()=>"checking"===this._availabilityPhase?l`<p class="state">${a("Comprobando Google Pay…")}</p>`:"unavailable"===this._availabilityPhase?this._renderUnavailable():l`<div class="pay-row ${this._paying?"pay-row--paying":""}"><slot name="google-pay-button"></slot></div>`})}};t([c({type:String,attribute:"env"})],D.prototype,"env",void 0),t([c({type:String,attribute:"gateway-environment"})],D.prototype,"gatewayEnvironment",void 0),t([c({type:String,attribute:"api-key"})],D.prototype,"apiKey",void 0),t([c({type:String,attribute:"token"})],D.prototype,"token",void 0),t([c({type:String,attribute:"locale",reflect:!0})],D.prototype,"locale",void 0),t([c({type:String,attribute:"merchant-id"})],D.prototype,"merchantId",void 0),t([c({type:String,attribute:"gateway-merchant-id"})],D.prototype,"gatewayMerchantId",void 0),t([c({type:String,attribute:"merchant-name"})],D.prototype,"merchantName",void 0),t([c({type:String,attribute:"session-id"})],D.prototype,"sessionId",void 0),t([c({type:String,attribute:"amount"})],D.prototype,"amount",void 0),t([c({type:String,attribute:"currency"})],D.prototype,"currency",void 0),t([c({type:String,attribute:"country"})],D.prototype,"country",void 0),t([c({type:String,attribute:"label"})],D.prototype,"label",void 0),t([h()],D.prototype,"_availabilityPhase",void 0),t([h()],D.prototype,"_unavailableReason",void 0),t([h()],D.prototype,"_paying",void 0),D=t([n(),e("mq-google-pay-checkout")],D);export{GooglePayCheckoutDeniedEvent,GooglePayCheckoutErrorEvent,GooglePayCheckoutSuccessEvent,D as MqGooglePayCheckout};
|
|
1
|
+
import{_ as t,c as e}from"./chunks/custom-element-D2ziPxYE.js";import{m as a}from"./chunks/runtime-Bg1WXVCx.js";import{l as n}from"./chunks/localized-decorator-BlOuLhym.js";import{L as o}from"./chunks/login-token-task-BI-L2zSV.js";import{l as i}from"./chunks/chunk-4FFT6DC2-CVWibomC.js";import{i as s,a as r,x as l}from"./chunks/lit-element-DiWJYFwC.js";import{n as c}from"./chunks/property-scuRaFcM.js";import{r as h}from"./chunks/state-LQivXIgA.js";import{setEnv as u}from"./env.js";import{initLocalization as p,isValidLocale as y,setLocale as d}from"./i18n.js";import{e as m,a as g}from"./chunks/api-chat-client-BBL1U9EQ.js";import{r as v}from"./chunks/apple-pay-outcomes-CnVRvAVS.js";import"./chunks/task-Bj8p7kJX.js";import"./chunks/external-CJj32K_p.js";import"./chunks/parseISO-Dj3qSTG8.js";import"./chunks/format-CRFiCNHw.js";import"./chunks/isBefore-CPpTogxo.js";function b(){return"undefined"!=typeof google&&"function"==typeof google.payments?.api?.PaymentsClient}const _=["PAN_ONLY","CRYPTOGRAM_3DS"],k=["VISA","MASTERCARD","AMEX"];function f(t){return{type:"PAYMENT_GATEWAY",parameters:{gateway:"globalpayments",gatewayMerchantId:t}}}function C(t){return{type:"CARD",parameters:{allowedAuthMethods:[..._],allowedCardNetworks:[...k]},tokenizationSpecification:f(t)}}function w(t){return[C(t)]}function E(t,e){return"test"===e?"TEST":"production"===e?"PRODUCTION":"development"===t?"TEST":"PRODUCTION"}function P(t,e){return function(t,e){return{apiVersion:2,apiVersionMinor:0,allowedPaymentMethods:w(t.gatewayMerchantId),merchantInfo:{merchantId:t.merchantId,merchantName:t.merchantName},transactionInfo:{totalPriceStatus:"FINAL",totalPrice:e.amount,currencyCode:e.currencyCode,countryCode:e.countryCode}}}(t,e)}async function I(t,e,a,n={}){if("undefined"==typeof window||!window.isSecureContext)return i.warn("google-pay: unavailable outside a secure context"),{available:!1,reason:"unsupported"};if(!t.trim())return i.warn("google-pay: missing merchant id"),{available:!1,reason:"merchant-id-missing"};if(!e.trim())return i.warn("google-pay: missing gateway merchant id"),{available:!1,reason:"gateway-merchant-id-missing"};if(!await function(t=8e3,e){return b()?Promise.resolve(!0):t<=0||e?.aborted?Promise.resolve(!1):new Promise(a=>{const n=Date.now()+t,o=t=>{clearInterval(s),e?.removeEventListener("abort",i),a(t)},i=()=>o(!1),s=setInterval(()=>{b()?o(!0):Date.now()>=n&&o(!1)},100);e?.addEventListener("abort",i,{once:!0})})}(n.sdkWaitTimeoutMs,n.signal))return i.warn("google-pay: pay.js was not loaded by the host page"),{available:!1,reason:"sdk-missing"};const o=E(a,n.gatewayEnvironment);try{const t=new google.payments.api.PaymentsClient({environment:o}),a=await t.isReadyToPay(function(t){return{apiVersion:2,apiVersionMinor:0,allowedPaymentMethods:w(t)}}(e));return a.result?{available:!0}:(i.warn("google-pay: isReadyToPay returned false",{environment:o}),{available:!1,reason:"unsupported"})}catch(t){return i.warn("google-pay: isReadyToPay threw",{environment:o,error:t instanceof Error?t.message:String(t)}),{available:!1,reason:"unsupported"}}}function G(t,e){return function(t){if(function(t){return"object"==typeof t&&null!==t&&"statusCode"in t&&"string"==typeof t.statusCode}(t)){const e=t.statusCode.toUpperCase();if("CANCELED"===e||"CANCELLED"===e)return!0}if(t instanceof Error){const e=t.message.toLowerCase();return e.includes("cancel")||e.includes("closed")||e.includes("abort")}return!1}(t)?{kind:"cancelled"}:m(t)&&400===t.response?.status?{kind:"denied",sessionId:e}:{kind:"authorize"}}function S(t){if(null!==t&&"object"==typeof t){const e=t.paymentMethodData?.tokenizationData,a=e?.token;if("string"==typeof a&&a.length>0)return a}throw new Error("Invalid Google Pay payment data: missing tokenizationData.token")}try{p()}catch{}const T=s`:host{display:flex;flex-direction:column;align-items:stretch;justify-content:center;gap:12px;width:100%;min-height:48px}.pay-row{display:block;width:100%}.pay-row--paying{opacity:.55;pointer-events:none}::slotted([slot=google-pay-button]){display:block;width:100%;height:var(--mq-google-pay-button-height,48px)}.state{text-align:center;font-family:system-ui,sans-serif;font-size:15px;color:#86868b;margin:0}`;class GooglePayCheckoutSuccessEvent extends Event{static{this.eventName="payment-success"}constructor(t){super(GooglePayCheckoutSuccessEvent.eventName,{bubbles:!0,composed:!0}),this.detail=t}}class GooglePayCheckoutDeniedEvent extends Event{static{this.eventName="payment-denied"}constructor(t){super(GooglePayCheckoutDeniedEvent.eventName,{bubbles:!0,composed:!0}),this.detail=t}}class GooglePayCheckoutErrorEvent extends Event{static{this.eventName="payment-error"}constructor(t){super(GooglePayCheckoutErrorEvent.eventName,{bubbles:!0,composed:!0}),this.detail=t}}const A=new Set(["sdk-missing","unsupported"]);function j(t,e){i.warn(t,{error:e instanceof Error?e.message:String(e)})}let D=class MqGooglePayCheckout extends r{constructor(){super(...arguments),this._availabilityPhase="checking",this._unavailableReason=null,this._paying=!1,this._paymentsClient=null,this._paymentsClientEnvironment=null,this._buttonHost=null,this._availabilityGeneration=0,this._availabilityAbortController=null,this._terminalErrorDispatched=!1,this._loginTokenTask=new o(this,g,{args:()=>[this.apiKey,this.token],onComplete:t=>{g.setAuthToken(t.access_token),this._refreshAvailability()},onError:()=>{this.dispatchEvent(new GooglePayCheckoutErrorEvent({reason:"auth"}))}}),this._onPayClick=()=>{this._paying||"ready"!==this._availabilityPhase||this._processPayment()}}static{this.styles=T}willUpdate(t){if(t.has("env")&&(this.env&&u(this.env),this._resetPaymentsClient()),t.has("gatewayEnvironment")&&this._resetPaymentsClient(),t.has("apiKey")&&g.setApiKey(this.apiKey),t.has("locale")){const t=y(this.locale)?this.locale:"es_ES";d(t),g.setLanguage(t)}(t.has("merchantId")||t.has("gatewayMerchantId")||t.has("env")||t.has("gatewayEnvironment"))&&this._loginTokenTask.value&&this._refreshAvailability()}connectedCallback(){super.connectedCallback(),this._availabilityAbortController=new AbortController,this._terminalErrorDispatched=!1}disconnectedCallback(){this._availabilityAbortController?.abort(),this._availabilityAbortController=null,this._resetPaymentsClient(),super.disconnectedCallback()}_dispatchTerminalError(){this._terminalErrorDispatched||(this._terminalErrorDispatched=!0,this.dispatchEvent(new GooglePayCheckoutErrorEvent({reason:"unsupported"})))}_resetPaymentsClient(){this._paymentsClient=null,this._paymentsClientEnvironment=null,this._removeButtonHost()}_getPaymentsClient(){const t=E(this.env,this.gatewayEnvironment);return this._paymentsClient&&this._paymentsClientEnvironment===t||(this._paymentsClient=new google.payments.api.PaymentsClient({environment:t}),this._paymentsClientEnvironment=t,this._buttonHost=null),this._paymentsClient}async _refreshAvailability(){const t=++this._availabilityGeneration;this._availabilityPhase="checking",this._unavailableReason=null,this._removeButtonHost();const e=await I(this.merchantId??"",this.gatewayMerchantId??"",this.env,{signal:this._availabilityAbortController?.signal,gatewayEnvironment:this.gatewayEnvironment});if(t===this._availabilityGeneration&&this.isConnected){if(!e.available)return this._availabilityPhase="unavailable",this._unavailableReason=e.reason,void(A.has(e.reason)&&this._dispatchTerminalError());this._availabilityPhase="ready",this._unavailableReason=null}}_ensureButtonHost(){const t=this.querySelector(':scope > [slot="google-pay-button"]');if(t)return t;const e=document.createElement("div");return e.slot="google-pay-button",this.appendChild(e),e}_removeButtonHost(){this.querySelector(':scope > [slot="google-pay-button"]')?.remove(),this._buttonHost=null}_mountGooglePayButton(){if(this._buttonHost||"ready"!==this._availabilityPhase)return;const t=this._ensureButtonHost();try{const e=this._getPaymentsClient().createButton({onClick:this._onPayClick,buttonColor:"black",buttonType:"pay",buttonSizeMode:"fill"});t.replaceChildren(e),this._buttonHost=t}catch(t){j("mq-google-pay-checkout: failed to create Google Pay button",t),this._removeButtonHost(),this._availabilityPhase="unavailable",this._unavailableReason="unsupported",this._dispatchTerminalError()}}updated(t){super.updated(t),"ready"===this._availabilityPhase&&this._mountGooglePayButton()}async _processPayment(){this._paying=!0;try{const t=await this._getPaymentsClient().loadPaymentData(P({merchantId:this.merchantId,gatewayMerchantId:this.gatewayMerchantId,merchantName:this.merchantName||this.label},{amount:this.amount,currencyCode:this.currency,countryCode:this.country})),e=await g.payments.authorizeGooglePay({order_id:this.sessionId,token:S(t)}),{status:a,consultation_id:n}=e.data,o=v(a,n,this.sessionId);switch(o.kind){case"success":this.dispatchEvent(new GooglePayCheckoutSuccessEvent({sessionId:o.sessionId,reference:o.reference}));break;case"denied":this.dispatchEvent(new GooglePayCheckoutDeniedEvent({sessionId:o.sessionId}));break;case"error":this.dispatchEvent(new GooglePayCheckoutErrorEvent({reason:o.reason}))}}catch(t){const e=G(t,this.sessionId);switch(e.kind){case"cancelled":this.dispatchEvent(new GooglePayCheckoutErrorEvent({reason:"cancelled"}));break;case"denied":this.dispatchEvent(new GooglePayCheckoutDeniedEvent({sessionId:e.sessionId}));break;case"authorize":j("mq-google-pay-checkout: authorize failed",t),this.dispatchEvent(new GooglePayCheckoutErrorEvent({reason:"authorize"}))}}finally{this._paying=!1}}_renderUnavailable(){switch(this._unavailableReason){case"merchant-id-missing":return l`<p class="state">${a("Falta el identificador de comercio de Google Pay")}</p>`;case"gateway-merchant-id-missing":return l`<p class="state">${a("Falta el identificador de pasarela de Google Pay")}</p>`;case"sdk-missing":return l`<p class="state">${a("No se ha podido cargar Google Pay. Comprueba la configuración del sitio e inténtalo de nuevo.")}</p>`;default:return l`<p class="state">${a("Google Pay no está disponible. Prueba con tarjeta u otro método de pago.")}</p>`}}render(){return this._loginTokenTask.render({pending:()=>l`<p class="state">${a("Preparando Google Pay…")}</p>`,error:()=>l`<p class="state">${a("No hemos podido iniciar el pago")}</p>`,complete:()=>"checking"===this._availabilityPhase?l`<p class="state">${a("Comprobando Google Pay…")}</p>`:"unavailable"===this._availabilityPhase?this._renderUnavailable():l`<div class="pay-row ${this._paying?"pay-row--paying":""}"><slot name="google-pay-button"></slot></div>`})}};t([c({type:String,attribute:"env"})],D.prototype,"env",void 0),t([c({type:String,attribute:"gateway-environment"})],D.prototype,"gatewayEnvironment",void 0),t([c({type:String,attribute:"api-key"})],D.prototype,"apiKey",void 0),t([c({type:String,attribute:"token"})],D.prototype,"token",void 0),t([c({type:String,attribute:"locale",reflect:!0})],D.prototype,"locale",void 0),t([c({type:String,attribute:"merchant-id"})],D.prototype,"merchantId",void 0),t([c({type:String,attribute:"gateway-merchant-id"})],D.prototype,"gatewayMerchantId",void 0),t([c({type:String,attribute:"merchant-name"})],D.prototype,"merchantName",void 0),t([c({type:String,attribute:"session-id"})],D.prototype,"sessionId",void 0),t([c({type:String,attribute:"amount"})],D.prototype,"amount",void 0),t([c({type:String,attribute:"currency"})],D.prototype,"currency",void 0),t([c({type:String,attribute:"country"})],D.prototype,"country",void 0),t([c({type:String,attribute:"label"})],D.prototype,"label",void 0),t([h()],D.prototype,"_availabilityPhase",void 0),t([h()],D.prototype,"_unavailableReason",void 0),t([h()],D.prototype,"_paying",void 0),D=t([n(),e("mq-google-pay-checkout")],D);export{GooglePayCheckoutDeniedEvent,GooglePayCheckoutErrorEvent,GooglePayCheckoutSuccessEvent,D as MqGooglePayCheckout};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as e,t}from"./chunks/custom-element-
|
|
1
|
+
import{_ as e,c as t}from"./chunks/custom-element-D2ziPxYE.js";import{a as i,x as s}from"./chunks/lit-element-DiWJYFwC.js";import{n as o}from"./chunks/property-scuRaFcM.js";import{o as n}from"./chunks/if-defined-BYeVdwgd.js";import{a as r}from"./chunks/api-chat-client-BBL1U9EQ.js";import"./mq-checkout.js";import"./chunks/external-CJj32K_p.js";import"./chunks/parseISO-Dj3qSTG8.js";import"./chunks/format-CRFiCNHw.js";import"./chunks/isBefore-CPpTogxo.js";import"./env.js";import"./chunks/runtime-Bg1WXVCx.js";import"./chunks/localized-decorator-BlOuLhym.js";import"./chunks/task-Bj8p7kJX.js";import"./chunks/login-token-task-BI-L2zSV.js";import"./chunks/chunk-4FFT6DC2-CVWibomC.js";import"./chunks/state-LQivXIgA.js";import"./theme.js";import"./i18n.js";import"./ui/mq-skeleton.js";import"./chunks/style-map-CIdqdn7C.js";import"./chunks/directive-2EDmOukv.js";class ImmediateVideocallPaidEvent extends Event{static{this.eventName="payment-success"}constructor(e){super(ImmediateVideocallPaidEvent.eventName,{bubbles:!0,composed:!0}),this.detail=e}}let a=class MqImmediateVideocallCheckout extends i{constructor(){super(...arguments),this._provideSession=async()=>{const e=await r.payments.createImmediateVideocallPaymentLink({video_call_schedule_id:this.videoCallScheduleId});return{sessionId:e.session_id,paymentUrl:e.payment_link}},this._onSuccess=e=>{e.stopPropagation(),this.dispatchEvent(new ImmediateVideocallPaidEvent({videoCallId:e.detail.reference}))}}render(){return s`<mq-checkout env="${n(this.env)}" api-key="${this.apiKey}" token="${this.token}" locale="${this.locale}" .provideSession="${this._provideSession}" @payment-success="${this._onSuccess}"></mq-checkout>`}};e([o({type:String,attribute:"env"})],a.prototype,"env",void 0),e([o({type:String,attribute:"api-key"})],a.prototype,"apiKey",void 0),e([o({type:String,attribute:"token"})],a.prototype,"token",void 0),e([o({type:String,attribute:"locale",reflect:!0})],a.prototype,"locale",void 0),e([o({type:String,attribute:"video-call-schedule-id"})],a.prototype,"videoCallScheduleId",void 0),a=e([t("mq-immediate-videocall-checkout")],a);export{ImmediateVideocallPaidEvent,a as MqImmediateVideocallCheckout};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export{A as AppointmentDetails}from"./chunks/price-DIhNpS8n.js";import{_ as t,t as e}from"./chunks/custom-element-DA9Fxvxd.js";import{c as i}from"./chunks/consume-CovVqBjI.js";import{m as n,s}from"./chunks/runtime-Bg1WXVCx.js";import{l as o}from"./chunks/localized-decorator-BlOuLhym.js";import{l as a}from"./chunks/chunk-S5RWG6G2-DPesx3Od.js";import{a as r,i as p,x as l}from"./chunks/lit-element-DiWJYFwC.js";import{n as c}from"./chunks/property-scuRaFcM.js";import{e as m}from"./chunks/external-CJj32K_p.js";import{MqHomeEvent as d}from"./events.js";import"./ui/mq-tabs.js";import{d as u,a as h}from"./chunks/api-chat-client-1Vz6ZOwp.js";import{g as v}from"./chunks/appointment-card-skeleton-hglMW7x6.js";import"./ui/mq-button.js";import{Q as g}from"./chunks/query-controller-BlO1Ax65.js";import"./ui/back-link.js";export{P as ProfessionalOverview}from"./chunks/professional-overview-CfjgnTw4.js";import"./chunks/telemetry-client-BLJVs9me.js";import"./chunks/parseISO-Dj3qSTG8.js";import"./chunks/class-map-Co76I6aw.js";import"./chunks/directive-2EDmOukv.js";import"./i18n.js";import"./chunks/chunk-4FFT6DC2-CVWibomC.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/context-consumer-ESdICVAb.js";import"./chunks/context-request-event-Dfydf1ub.js";import"./chunks/create-context-DqP79qjF.js";import"./chunks/format-CRFiCNHw.js";import"./chunks/isBefore-CPpTogxo.js";import"./env.js";import"./chunks/get-organization-setup-query-BMbuRi6v.js";import"./chunks/i18n-formats-DYS91YEa.js";import"./chunks/refund-cancel-policy-BQDnePq9.js";import"./chunks/chunk-GZF3YFSX-DM-GTqxg.js";import"./chunks/state-LQivXIgA.js";import"./ui/mq-card.js";import"./mq-chat-room.js";import"./chunks/provide-D2fnEhT2.js";import"./chunks/context-provider--AKuwfs9.js";import"./theme.js";import"./ui/icons/x-icon.js";import"./ui/mq-avatar.js";import"./ui/mq-skeleton.js";import"./chunks/style-map-CIdqdn7C.js";import"./chunks/chunk-YMQSBQHL-De_r7BNk.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-DmCGIoFy.js";import"./chunks/chunk-RCFIJTXZ-C6Ir0-sM.js";import"./chunks/mutation-controller-CR2qcqhH.js";import"./chunks/query-Cjvi4_dT.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/mq-text-button.js";import"./ui/icons/chevron-down-icon.js";const b=m(["next","history"]).enum;class MqMyAppointmentsSelectEvent extends Event{static{this.eventName="ontabchange"}constructor(t){super(MqMyAppointmentsSelectEvent.eventName,{bubbles:!0,composed:!0}),this.value=t}}let x=class EmptyState extends r{static{this.styles=p`.container{border-radius:var(--border-radius-md);background-color:var(--color-neutrals-background-weak);padding:var(--sp-10) var(--sp-6)}.card{border-radius:var(--border-radius-md);max-width:512px;margin:0 auto;background-color:var(--color-neutrals-background-extraWeak);padding:var(--sp-6);display:flex;flex-direction:column;align-items:center;gap:var(--sp-3)}.card>*{max-width:323px;margin:0 auto}.title{font-family:var(--font-body);font-size:var(--text-lg);line-height:var(--text-lg--line-height);font-weight:var(--font-weight-bold);color:var(--color-neutrals-text-default);margin:0}.description{font-family:var(--font-body);font-size:var(--text-xs);line-height:var(--text-xs--line-height);font-weight:var(--font-weight-normal);text-align:center;color:var(--color-neutrals-text-default);margin:0}@media (min-width:768px){.container{padding:var(--sp-6)}mq-button{max-width:323px}}`}handleRequestAppointment(){this.dispatchEvent(new CustomEvent("request-appointment",{bubbles:!0,composed:!0}))}render(){return l`<div class="container"><div class="card">${function({color:t="currentColor"}){return l`<svg width="31" height="32" viewBox="0 0 31 32" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M29.6 2.4H23.2V0H21.6V2.4H18.4V0H16.8V2.4H13.6V0H12V2.4H8.8V0H7.2V2.4H0.8C0.587827 2.4 0.384344 2.48429 0.234315 2.63431C0.0842855 2.78434 0 2.98783 0 3.2V31.2C0 31.4122 0.0842855 31.6157 0.234315 31.7657C0.384344 31.9157 0.587827 32 0.8 32H29.6C29.8122 32 30.0157 31.9157 30.1657 31.7657C30.3157 31.6157 30.4 31.4122 30.4 31.2V3.2C30.4 2.98783 30.3157 2.78434 30.1657 2.63431C30.0157 2.48429 29.8122 2.4 29.6 2.4ZM28.8 30.4H1.6V10.4H27.2V8.8H1.6V4H7.2V7.2H8.8V4H12V7.2H13.6V4H16.8V7.2H18.4V4H21.6V7.2H23.2V4H28.8V30.4ZM3.2 19.2H9.6V12.8H3.2V19.2ZM4.8 14.4H8V17.6H4.8V14.4ZM20.8 19.2H27.2V12.8H20.8V19.2ZM22.4 14.4H25.6V17.6H22.4V14.4ZM12 19.2H18.4V12.8H12V19.2ZM13.6 14.4H16.8V17.6H13.6V14.4ZM3.2 28H9.6V21.6H3.2V28ZM4.8 23.2H8V26.4H4.8V23.2ZM20.8 28H27.2V21.6H20.8V28ZM22.4 23.2H25.6V26.4H22.4V23.2ZM12 28H18.4V21.6H12V28ZM13.6 23.2H16.8V26.4H13.6V23.2Z" fill="${t}"/></svg>`}({color:"var(--color-primary)"})}<p class="title">${this.title}</p><p class="description">${this.description}</p><mq-button variant="primary" size="md" fullwidth @click="${this.handleRequestAppointment}">${n("Pedir cita")}</mq-button></div></div>`}};t([c({type:String})],x.prototype,"title",void 0),t([c({type:String})],x.prototype,"description",void 0),x=t([e("empty-state")],x);const f=[u.pending,u.accepted],k=p`.appointments-list{display:grid;grid-template-columns:1fr;gap:var(--sp-6);margin-bottom:var(--sp-6)}@media (min-width:768px){.appointments-list{grid-template-columns:repeat(2,1fr)}}`;let y=class NextAppointmentsTab extends r{constructor(){super(...arguments),this.getAppointmentsQuery=new g(this,()=>v(h,{status:f,order:{field:"starts_at",direction:"asc"}}))}static{this.styles=k}render(){return this.getAppointmentsQuery.render({complete:t=>l`${t.data.length>0?l`<div class="appointments-list">${t.data.map(t=>l`<appointment-card .appointmentResource="${t}" .specialtyId="${t.speciality?.id}"></appointment-card>`)}</div>`:l`<empty-state title="${n("No tienes próximas citas")}" description="${n("Agenda una consulta médica cuando la necesites. Aquí verás todos los detalles y podrás gestionar tus próximas citas.")}"></empty-state>`}`,pending:()=>l`<div class="appointments-list"><appointment-card-skeleton></appointment-card-skeleton><appointment-card-skeleton></appointment-card-skeleton><appointment-card-skeleton></appointment-card-skeleton></div>`})}};y=t([o(),e("next-appointments-tab")],y);const j=[u.finished,u.reporting];let q=class AppointmentsHistoryTab extends r{constructor(){super(...arguments),this.getAppointmentsQuery=new g(this,()=>v(h,{status:j,order:{field:"starts_at",direction:"desc"}}))}static{this.styles=p`.appointments-list{display:grid;grid-template-columns:1fr;gap:var(--sp-6);margin-bottom:var(--sp-6)}@media (min-width:768px){.appointments-list{grid-template-columns:repeat(2,1fr)}}`}render(){return this.getAppointmentsQuery.render({complete:t=>l`${t.data.length>0?l`<div class="appointments-list">${t.data.map(t=>l`<appointment-card .appointmentResource="${t}" .specialtyId="${t.speciality?.id}" variant="history"></appointment-card>`)}</div>`:l`<empty-state title="${n("No tienes citas en el historial")}" description="${n("Aquí verás todas las citas que has tenido. Puedes acceder a los documentos de cada consulta y reagendar una cita si es necesario.")}"></empty-state>`}`,pending:()=>l`<div class="appointments-list"><appointment-card-skeleton></appointment-card-skeleton><appointment-card-skeleton></appointment-card-skeleton><appointment-card-skeleton></appointment-card-skeleton></div>`})}};q=t([o(),e("appointments-history-tab")],q);const H=p`.container{display:flex;flex-direction:column;gap:var(--size-3)}h1{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-neutral-link-dark);margin:0}p{font-family:var(--font-body);font-size:var(--text-base);line-height:var(--text-base--line-height);font-weight:var(--font-weight-normal);color:var(--color-neutral-link-dark);margin:0}.user-info{display:flex;align-items:center;justify-content:space-between}@media (min-width:768px){h1{font-size:var(--text-3xl);line-height:var(--text-3xl--line-height)}mq-tabs-list{max-width:435px}}`;let w=class MqMyAppointments extends r{constructor(){super(...arguments),this.tab=b.next}static{this.styles=H}handleSelect(t){this.dispatchEvent(new MqMyAppointmentsSelectEvent(t.value))}render(){return l`<div class="container"><back-link @mq-back="${t=>{t.stopPropagation(),this.dispatchEvent(new d)}}">${n("Volver al inicio")}</back-link><h1>${n("Mis citas")}</h1><div class="user-info"><p>${n(s`Para: ${this.loginToken.patient.name}`)}</p></div><mq-tabs .value="${this.tab}" @onvaluechange="${this.handleSelect}"><mq-tabs-list><mq-tabs-trigger value="${b.next}">${n("Próximas citas")}</mq-tabs-trigger><mq-tabs-trigger value="${b.history}">${n("Histórico")}</mq-tabs-trigger></mq-tabs-list><mq-tabs-content value="${b.next}"><next-appointments-tab></next-appointments-tab></mq-tabs-content><mq-tabs-content value="${b.history}"><appointments-history-tab></appointments-history-tab></mq-tabs-content></mq-tabs></div>`}};t([i({context:a})],w.prototype,"loginToken",void 0),t([c({type:String,reflect:!0})],w.prototype,"tab",void 0),w=t([o(),e("mq-my-appointments")],w);const V=p`:host{display:block}.request-appointment-cta{box-sizing:border-box;display:flex;flex-direction:column;align-items:center;justify-content:space-between;padding:var(--sp-12) var(--sp-4);background:var(--color-card);gap:var(--sp-4)}.title-body{display:flex;flex-direction:column;gap:var(--sp-2);flex:1}.title{font-family:var(--font-titles);font-size:var(--text-2xl);line-height:var(--text-2xl--line-height);font-weight:var(--font-weight-bold);color:var(--color-neutrals-text-default);margin:0;text-align:center}.subtitle{font-family:var(--font-body);font-size:var(--text-base);line-height:var(--text-base--line-height);font-weight:var(--font-weight-normal);color:var(--color-neutrals-text-default);margin:0;display:none}mq-button{width:100%}.button-text-desktop{display:none}.button-text-mobile{display:inline}@media (min-width:768px){.request-appointment-cta{flex-direction:row;padding:var(--sp-12) var(--sp-20);gap:var(--sp-2)}.title-body{align-items:flex-start;flex:1;max-width:843px}.title{font-size:var(--text-3xl);line-height:var(--text-3xl--line-height);font-weight:var(--font-weight-extrabold);text-align:left}.subtitle{display:block}mq-button{width:auto;flex-shrink:0;--button-height-md:var(--button-height-lg);--text-sm:var(--text-base);--text-sm--line-height:var(--text-base--line-height)}.button-text-desktop{display:inline}.button-text-mobile{display:none}}`;class RequestAppointmentEvent extends Event{static{this.eventName="request-appointment"}constructor(){super(RequestAppointmentEvent.eventName,{bubbles:!0,composed:!0})}}let $=class RequestAppointmentCta extends r{static{this.styles=V}handleRequestAppointment(){this.dispatchEvent(new RequestAppointmentEvent)}render(){return l`<div class="request-appointment-cta"><div class="title-body"><h2 class="title">${n("Nueva cita de especialidades digitales")}</h2><p class="subtitle">${n("Realiza la búsqueda en tu cuadro médico digital")}</p></div><mq-button variant="primary" size="md" fullwidth @click="${this.handleRequestAppointment}"><span class="button-text-mobile">${n("Pedir cita")}</span> <span class="button-text-desktop">${n("Pedir una nueva cita")}</span></mq-button></div>`}};$=t([o(),e("request-appointment-cta")],$);export{w as MqMyAppointments,MqMyAppointmentsSelectEvent,$ as RequestAppointmentCta,RequestAppointmentEvent};
|
|
1
|
+
export{A as AppointmentDetails}from"./chunks/price-LTnCz9kN.js";import{_ as t,c as e}from"./chunks/custom-element-D2ziPxYE.js";import{c as i}from"./chunks/consume-CovVqBjI.js";import{m as n,s}from"./chunks/runtime-Bg1WXVCx.js";import{l as o}from"./chunks/localized-decorator-BlOuLhym.js";import{l as a}from"./chunks/chunk-S5RWG6G2-DPesx3Od.js";import{a as r,i as p,x as l}from"./chunks/lit-element-DiWJYFwC.js";import{n as c}from"./chunks/property-scuRaFcM.js";import{e as m}from"./chunks/external-CJj32K_p.js";import{MqHomeEvent as d}from"./events.js";import"./ui/mq-tabs.js";import{d as u,a as h}from"./chunks/api-chat-client-BBL1U9EQ.js";import{g as v}from"./chunks/appointment-card-skeleton-C8VERHzq.js";import"./ui/mq-button.js";import{Q as g}from"./chunks/query-controller-BlO1Ax65.js";import"./ui/back-link.js";export{P as ProfessionalOverview}from"./chunks/professional-overview-C4H_znIJ.js";import"./chunks/telemetry-client-BLJVs9me.js";import"./chunks/parseISO-Dj3qSTG8.js";import"./chunks/class-map-Co76I6aw.js";import"./chunks/directive-2EDmOukv.js";import"./i18n.js";import"./chunks/chunk-4FFT6DC2-CVWibomC.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/context-consumer-ESdICVAb.js";import"./chunks/context-request-event-Dfydf1ub.js";import"./chunks/create-context-DqP79qjF.js";import"./chunks/format-CRFiCNHw.js";import"./chunks/isBefore-CPpTogxo.js";import"./env.js";import"./chunks/get-organization-setup-query-BMbuRi6v.js";import"./chunks/i18n-formats-DYS91YEa.js";import"./chunks/refund-cancel-policy-CXFTrFfo.js";import"./chunks/chunk-GZF3YFSX-DM-GTqxg.js";import"./chunks/state-LQivXIgA.js";import"./ui/mq-card.js";import"./mq-chat-room.js";import"./chunks/provide-D2fnEhT2.js";import"./chunks/context-provider--AKuwfs9.js";import"./theme.js";import"./ui/icons/x-icon.js";import"./ui/mq-avatar.js";import"./ui/mq-skeleton.js";import"./chunks/style-map-CIdqdn7C.js";import"./chunks/chunk-YMQSBQHL-De_r7BNk.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-DmCGIoFy.js";import"./chunks/chunk-RCFIJTXZ-C6Ir0-sM.js";import"./chunks/mutation-controller-CR2qcqhH.js";import"./chunks/query-Cjvi4_dT.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/mq-text-button.js";import"./ui/icons/chevron-down-icon.js";const b=m(["next","history"]).enum;class MqMyAppointmentsSelectEvent extends Event{static{this.eventName="ontabchange"}constructor(t){super(MqMyAppointmentsSelectEvent.eventName,{bubbles:!0,composed:!0}),this.value=t}}let x=class EmptyState extends r{static{this.styles=p`.container{border-radius:var(--border-radius-md);background-color:var(--color-neutrals-background-weak);padding:var(--sp-10) var(--sp-6)}.card{border-radius:var(--border-radius-md);max-width:512px;margin:0 auto;background-color:var(--color-neutrals-background-extraWeak);padding:var(--sp-6);display:flex;flex-direction:column;align-items:center;gap:var(--sp-3)}.card>*{max-width:323px;margin:0 auto}.title{font-family:var(--font-body);font-size:var(--text-lg);line-height:var(--text-lg--line-height);font-weight:var(--font-weight-bold);color:var(--color-neutrals-text-default);margin:0}.description{font-family:var(--font-body);font-size:var(--text-xs);line-height:var(--text-xs--line-height);font-weight:var(--font-weight-normal);text-align:center;color:var(--color-neutrals-text-default);margin:0}@media (min-width:768px){.container{padding:var(--sp-6)}mq-button{max-width:323px}}`}handleRequestAppointment(){this.dispatchEvent(new CustomEvent("request-appointment",{bubbles:!0,composed:!0}))}render(){return l`<div class="container"><div class="card">${function({color:t="currentColor"}){return l`<svg width="31" height="32" viewBox="0 0 31 32" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M29.6 2.4H23.2V0H21.6V2.4H18.4V0H16.8V2.4H13.6V0H12V2.4H8.8V0H7.2V2.4H0.8C0.587827 2.4 0.384344 2.48429 0.234315 2.63431C0.0842855 2.78434 0 2.98783 0 3.2V31.2C0 31.4122 0.0842855 31.6157 0.234315 31.7657C0.384344 31.9157 0.587827 32 0.8 32H29.6C29.8122 32 30.0157 31.9157 30.1657 31.7657C30.3157 31.6157 30.4 31.4122 30.4 31.2V3.2C30.4 2.98783 30.3157 2.78434 30.1657 2.63431C30.0157 2.48429 29.8122 2.4 29.6 2.4ZM28.8 30.4H1.6V10.4H27.2V8.8H1.6V4H7.2V7.2H8.8V4H12V7.2H13.6V4H16.8V7.2H18.4V4H21.6V7.2H23.2V4H28.8V30.4ZM3.2 19.2H9.6V12.8H3.2V19.2ZM4.8 14.4H8V17.6H4.8V14.4ZM20.8 19.2H27.2V12.8H20.8V19.2ZM22.4 14.4H25.6V17.6H22.4V14.4ZM12 19.2H18.4V12.8H12V19.2ZM13.6 14.4H16.8V17.6H13.6V14.4ZM3.2 28H9.6V21.6H3.2V28ZM4.8 23.2H8V26.4H4.8V23.2ZM20.8 28H27.2V21.6H20.8V28ZM22.4 23.2H25.6V26.4H22.4V23.2ZM12 28H18.4V21.6H12V28ZM13.6 23.2H16.8V26.4H13.6V23.2Z" fill="${t}"/></svg>`}({color:"var(--color-primary)"})}<p class="title">${this.title}</p><p class="description">${this.description}</p><mq-button variant="primary" size="md" fullwidth @click="${this.handleRequestAppointment}">${n("Pedir cita")}</mq-button></div></div>`}};t([c({type:String})],x.prototype,"title",void 0),t([c({type:String})],x.prototype,"description",void 0),x=t([e("empty-state")],x);const f=[u.pending,u.accepted],k=p`.appointments-list{display:grid;grid-template-columns:1fr;gap:var(--sp-6);margin-bottom:var(--sp-6)}@media (min-width:768px){.appointments-list{grid-template-columns:repeat(2,1fr)}}`;let y=class NextAppointmentsTab extends r{constructor(){super(...arguments),this.getAppointmentsQuery=new g(this,()=>v(h,{status:f,order:{field:"starts_at",direction:"asc"}}))}static{this.styles=k}render(){return this.getAppointmentsQuery.render({complete:t=>l`${t.data.length>0?l`<div class="appointments-list">${t.data.map(t=>l`<appointment-card .appointmentResource="${t}" .specialtyId="${t.speciality?.id}"></appointment-card>`)}</div>`:l`<empty-state title="${n("No tienes próximas citas")}" description="${n("Agenda una consulta médica cuando la necesites. Aquí verás todos los detalles y podrás gestionar tus próximas citas.")}"></empty-state>`}`,pending:()=>l`<div class="appointments-list"><appointment-card-skeleton></appointment-card-skeleton><appointment-card-skeleton></appointment-card-skeleton><appointment-card-skeleton></appointment-card-skeleton></div>`})}};y=t([o(),e("next-appointments-tab")],y);const j=[u.finished,u.reporting];let q=class AppointmentsHistoryTab extends r{constructor(){super(...arguments),this.getAppointmentsQuery=new g(this,()=>v(h,{status:j,order:{field:"starts_at",direction:"desc"}}))}static{this.styles=p`.appointments-list{display:grid;grid-template-columns:1fr;gap:var(--sp-6);margin-bottom:var(--sp-6)}@media (min-width:768px){.appointments-list{grid-template-columns:repeat(2,1fr)}}`}render(){return this.getAppointmentsQuery.render({complete:t=>l`${t.data.length>0?l`<div class="appointments-list">${t.data.map(t=>l`<appointment-card .appointmentResource="${t}" .specialtyId="${t.speciality?.id}" variant="history"></appointment-card>`)}</div>`:l`<empty-state title="${n("No tienes citas en el historial")}" description="${n("Aquí verás todas las citas que has tenido. Puedes acceder a los documentos de cada consulta y reagendar una cita si es necesario.")}"></empty-state>`}`,pending:()=>l`<div class="appointments-list"><appointment-card-skeleton></appointment-card-skeleton><appointment-card-skeleton></appointment-card-skeleton><appointment-card-skeleton></appointment-card-skeleton></div>`})}};q=t([o(),e("appointments-history-tab")],q);const H=p`.container{display:flex;flex-direction:column;gap:var(--size-3)}h1{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-neutral-link-dark);margin:0}p{font-family:var(--font-body);font-size:var(--text-base);line-height:var(--text-base--line-height);font-weight:var(--font-weight-normal);color:var(--color-neutral-link-dark);margin:0}.user-info{display:flex;align-items:center;justify-content:space-between}@media (min-width:768px){h1{font-size:var(--text-3xl);line-height:var(--text-3xl--line-height)}mq-tabs-list{max-width:435px}}`;let w=class MqMyAppointments extends r{constructor(){super(...arguments),this.tab=b.next}static{this.styles=H}handleSelect(t){this.dispatchEvent(new MqMyAppointmentsSelectEvent(t.value))}render(){return l`<div class="container"><back-link @mq-back="${t=>{t.stopPropagation(),this.dispatchEvent(new d)}}">${n("Volver al inicio")}</back-link><h1>${n("Mis citas")}</h1><div class="user-info"><p>${n(s`Para: ${this.loginToken.patient.name}`)}</p></div><mq-tabs .value="${this.tab}" @onvaluechange="${this.handleSelect}"><mq-tabs-list><mq-tabs-trigger value="${b.next}">${n("Próximas citas")}</mq-tabs-trigger><mq-tabs-trigger value="${b.history}">${n("Histórico")}</mq-tabs-trigger></mq-tabs-list><mq-tabs-content value="${b.next}"><next-appointments-tab></next-appointments-tab></mq-tabs-content><mq-tabs-content value="${b.history}"><appointments-history-tab></appointments-history-tab></mq-tabs-content></mq-tabs></div>`}};t([i({context:a})],w.prototype,"loginToken",void 0),t([c({type:String,reflect:!0})],w.prototype,"tab",void 0),w=t([o(),e("mq-my-appointments")],w);const V=p`:host{display:block}.request-appointment-cta{box-sizing:border-box;display:flex;flex-direction:column;align-items:center;justify-content:space-between;padding:var(--sp-12) var(--sp-4);background:var(--color-card);gap:var(--sp-4)}.title-body{display:flex;flex-direction:column;gap:var(--sp-2);flex:1}.title{font-family:var(--font-titles);font-size:var(--text-2xl);line-height:var(--text-2xl--line-height);font-weight:var(--font-weight-bold);color:var(--color-neutrals-text-default);margin:0;text-align:center}.subtitle{font-family:var(--font-body);font-size:var(--text-base);line-height:var(--text-base--line-height);font-weight:var(--font-weight-normal);color:var(--color-neutrals-text-default);margin:0;display:none}mq-button{width:100%}.button-text-desktop{display:none}.button-text-mobile{display:inline}@media (min-width:768px){.request-appointment-cta{flex-direction:row;padding:var(--sp-12) var(--sp-20);gap:var(--sp-2)}.title-body{align-items:flex-start;flex:1;max-width:843px}.title{font-size:var(--text-3xl);line-height:var(--text-3xl--line-height);font-weight:var(--font-weight-extrabold);text-align:left}.subtitle{display:block}mq-button{width:auto;flex-shrink:0;--button-height-md:var(--button-height-lg);--text-sm:var(--text-base);--text-sm--line-height:var(--text-base--line-height)}.button-text-desktop{display:inline}.button-text-mobile{display:none}}`;class RequestAppointmentEvent extends Event{static{this.eventName="request-appointment"}constructor(){super(RequestAppointmentEvent.eventName,{bubbles:!0,composed:!0})}}let $=class RequestAppointmentCta extends r{static{this.styles=V}handleRequestAppointment(){this.dispatchEvent(new RequestAppointmentEvent)}render(){return l`<div class="request-appointment-cta"><div class="title-body"><h2 class="title">${n("Nueva cita de especialidades digitales")}</h2><p class="subtitle">${n("Realiza la búsqueda en tu cuadro médico digital")}</p></div><mq-button variant="primary" size="md" fullwidth @click="${this.handleRequestAppointment}"><span class="button-text-mobile">${n("Pedir cita")}</span> <span class="button-text-desktop">${n("Pedir una nueva cita")}</span></mq-button></div>`}};$=t([o(),e("request-appointment-cta")],$);export{w as MqMyAppointments,MqMyAppointmentsSelectEvent,$ as RequestAppointmentCta,RequestAppointmentEvent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isValidLocale as t,setLocale as e,initLocalization as i}from"./i18n.js";import{_ as s,
|
|
1
|
+
import{isValidLocale as t,setLocale as e,initLocalization as i}from"./i18n.js";import{_ as s,c as o}from"./chunks/custom-element-D2ziPxYE.js";import{m as a}from"./chunks/runtime-Bg1WXVCx.js";import{l as r}from"./chunks/localized-decorator-BlOuLhym.js";import{a as n,P as l}from"./chunks/api-chat-client-BBL1U9EQ.js";import{i as p,a as d,x as c}from"./chunks/lit-element-DiWJYFwC.js";import{n as h}from"./chunks/property-scuRaFcM.js";import{r as m}from"./chunks/state-LQivXIgA.js";import{setEnv as u}from"./env.js";import{MqPaymentSucceededEvent as v}from"./events.js";import{spinnerIcon as f}from"./ui/icons/spinner-icon.js";import"./chunks/chunk-4FFT6DC2-CVWibomC.js";import"./chunks/external-CJj32K_p.js";import"./chunks/parseISO-Dj3qSTG8.js";import"./chunks/format-CRFiCNHw.js";import"./chunks/isBefore-CPpTogxo.js";import"./ui/icons/types.js";const y=p`:host{display:flex;flex-direction:column;align-items:center;justify-content:center;flex:1;min-height:320px;padding:var(--sp-8)}.panel{display:flex;flex-direction:column;align-items:center;gap:var(--sp-4);width:100%;max-width:480px;box-sizing:border-box;padding:var(--sp-8);text-align:center}.title{font-family:var(--font-titles);font-size:var(--text-2xl);line-height:var(--text-2xl--line-height);font-weight:var(--font-weight-bold);color:var(--color-neutrals-text-default);margin:0}.message{font-family:var(--font-body);font-size:var(--text-base);line-height:var(--text-base--line-height);color:var(--color-neutrals-text-subtle);margin:0}`;let g=class MqPaymentPoller extends d{constructor(){super(...arguments),this.timeoutMs=9e4,this._view="verifying",this._deadline=0,this._settled=!1}static{this.styles=y}willUpdate(i){i.has("env")&&this.env&&u(this.env),i.has("apiKey")&&this.apiKey&&n.setApiKey(this.apiKey),i.has("token")&&this.token&&n.setAuthToken(this.token),i.has("locale")&&this.locale&&t(this.locale)&&(e(this.locale),n.setLanguage(this.locale))}updated(t){t.has("sessionId")&&this._restart()}disconnectedCallback(){this._stop(),super.disconnectedCallback()}_restart(){this._stop(),this._settled=!1,this._view="verifying",this.sessionId&&(this._deadline=Date.now()+this.timeoutMs,this._pollOnce(),this._intervalId=setInterval(()=>{this._pollOnce()},2e3))}_stop(){void 0!==this._intervalId&&(clearInterval(this._intervalId),this._intervalId=void 0)}_settle(t){this._stop(),this._settled=!0,this._view=t}async _pollOnce(){const t=this.sessionId;if(this._settled||!t)return;if(Date.now()>=this._deadline)return void this._settle("timeout");let e;try{e=await n.payments.getPaymentSession(t)}catch{return}return this._settled||t!==this.sessionId?void 0:e.status===l.Paid?(this._stop(),this._settled=!0,void this.dispatchEvent(new v({appointmentId:e.consultation_id,consultationType:e.consultation_type}))):void(e.status===l.Denied&&this._settle("denied"))}_renderVerifying(){return c`<div class="panel" role="status" aria-live="polite">${f({size:40,color:"var(--color-primary-default)"})}<p class="message">${a("Verificando tu pago...")}</p></div>`}_renderDenied(){return c`<div class="panel" role="alert"><p class="title">${a("Tu pago no se ha completado")}</p><p class="message">${a("El pago ha sido rechazado y no hemos creado la cita. No se te ha cobrado nada: vuelve a intentarlo con otro método de pago.")}</p></div>`}_renderTimeout(){return c`<div class="panel" role="alert"><p class="title">${a("No hemos podido confirmar tu pago")}</p><p class="message">${a("Ha ocurrido un problema al verificar el estado de tu pago. Por favor, contacta con soporte si el cargo se ha realizado.")}</p></div>`}render(){switch(this._view){case"denied":return this._renderDenied();case"timeout":return this._renderTimeout();default:return this._renderVerifying()}}};s([h({type:String,attribute:"session-id"})],g.prototype,"sessionId",void 0),s([h({type:String,attribute:"api-key"})],g.prototype,"apiKey",void 0),s([h({type:String,attribute:"token"})],g.prototype,"token",void 0),s([h({type:String,attribute:"locale"})],g.prototype,"locale",void 0),s([h({type:String,attribute:"env"})],g.prototype,"env",void 0),s([h({type:Number,attribute:"timeout-ms"})],g.prototype,"timeoutMs",void 0),s([m()],g.prototype,"_view",void 0),g=s([r(),o("mq-payment-poller")],g),i();export{g as MqPaymentPoller,v as MqPaymentSucceededEvent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as e,
|
|
1
|
+
import{_ as e,c as s}from"./chunks/custom-element-D2ziPxYE.js";import{a as t,E as n}from"./chunks/lit-element-DiWJYFwC.js";import{s as r}from"./chunks/context-consumer-ESdICVAb.js";import{Q as c}from"./chunks/chunk-RCFIJTXZ-C6Ir0-sM.js";import{S as o,a as i}from"./chunks/chunk-YTQUGGS3-DmCGIoFy.js";import{g as a}from"./chunks/chunk-YMQSBQHL-De_r7BNk.js";import{g as h,a as l}from"./chunks/api-chat-client-BBL1U9EQ.js";import"./chunks/context-request-event-Dfydf1ub.js";import"./chunks/create-context-DqP79qjF.js";import"./chunks/external-CJj32K_p.js";import"./chunks/parseISO-Dj3qSTG8.js";import"./chunks/format-CRFiCNHw.js";import"./chunks/isBefore-CPpTogxo.js";import"./env.js";class ProfessionalPresenceSyncController{constructor(e){this.host=e,this.clearTimers=new Map,this._onAbsenceCreated=e=>{if(!e?.professional_hash||!e.finishes_at)return;const{professional_hash:s,id:t,finishes_at:n}=e;this._setActiveAbsence(s,{id:t,finishes_at:n}),this._clearTimer(s);const r=h(n).getTime()-Date.now();r>0&&r<2147483647&&this.clearTimers.set(s,setTimeout(()=>{this.clearTimers.delete(s),this._setActiveAbsence(s,null)},r))},this._onAbsenceCancelled=e=>{e?.professional_hash&&(this._clearTimer(e.professional_hash),this._setActiveAbsence(e.professional_hash,null))},new r(this.host,{context:o,subscribe:!0,callback:e=>{e&&e!==this.socket&&(this.socket=e,this.socket.on(i.absence_created,this._onAbsenceCreated),this.socket.on(i.absence_cancelled,this._onAbsenceCancelled))}}),new r(this.host,{context:c,subscribe:!0,callback:e=>{e&&(this.queryClient=e)}}),this.host.addController(this)}_queryKey(e){return a(l,{hash:e}).queryKey}_setActiveAbsence(e,s){this.queryClient?.setQueryData(this._queryKey(e),e=>e?{...e,active_absence:s}:void 0)}_clearTimer(e){const s=this.clearTimers.get(e);s&&(clearTimeout(s),this.clearTimers.delete(e))}hostConnected(){}hostDisconnected(){this.socket?.off(i.absence_created,this._onAbsenceCreated),this.socket?.off(i.absence_cancelled,this._onAbsenceCancelled);for(const e of this.clearTimers.values())clearTimeout(e);this.clearTimers.clear()}}let m=class MqProfessionalPresenceSync extends t{constructor(){super(...arguments),this._controller=new ProfessionalPresenceSyncController(this)}createRenderRoot(){return this}render(){return n}};m=e([s("mq-professional-presence-sync")],m);export{m as MqProfessionalPresenceSync,ProfessionalPresenceSyncController};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as t,t as e}from"./chunks/custom-element-DA9Fxvxd.js";import{Q as s}from"./chunks/chunk-RCFIJTXZ-C6Ir0-sM.js";import{e as i}from"./chunks/provide-D2fnEhT2.js";import{h as a,j as r,k as n,R as o,l as u,g as h,S as c,m as l,n as d,o as f,Q as y,q as p,f as m,u as g,a as v,v as b,w as C,x as q,y as O}from"./chunks/query-Cjvi4_dT.js";import{x as P,a as w}from"./chunks/lit-element-DiWJYFwC.js";import{r as Q}from"./chunks/state-LQivXIgA.js";import{e as x}from"./chunks/ensure-context-root-DbdqwnKB.js";import"./chunks/create-context-DqP79qjF.js";import"./chunks/context-provider--AKuwfs9.js";import"./chunks/context-request-event-Dfydf1ub.js";import"./chunks/property-scuRaFcM.js";var D=Object.defineProperty;function M(t){return{onFetch:(e,s)=>{const i=e.options,o=e.fetchOptions?.meta?.fetchMore?.direction,u=e.state.data?.pages||[],h=e.state.data?.pageParams||[];let c={pages:[],pageParams:[]},l=0;const d=async()=>{let s=!1;const d=a(e.options,e.fetchOptions),f=async(t,i,a)=>{if(s)return Promise.reject();if(null==i&&t.pages.length)return Promise.resolve(t);const o=(()=>{const t={client:e.client,queryKey:e.queryKey,pageParam:i,direction:a?"backward":"forward",meta:e.options.meta};var r;return r=t,Object.defineProperty(r,"signal",{enumerable:!0,get:()=>(e.signal.aborted?s=!0:e.signal.addEventListener("abort",()=>{s=!0}),e.signal)}),t})(),u=await d(o),{maxPages:h}=e.options,c=a?r:n;return{pages:c(t.pages,u,h),pageParams:c(t.pageParams,i,h)}};if(o&&u.length){const t="backward"===o,e={pages:u,pageParams:h},s=(t?A:k)(i,e);c=await f(e,s,t)}else{const e=t??u.length;do{const t=0===l?h[0]??i.initialPageParam:k(i,c);if(l>0&&null==t)break;c=await f(c,t),l++}while(l<e)}return c};e.options.persister?e.fetchFn=()=>e.options.persister?.(d,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},s):e.fetchFn=d}}}function k(t,{pages:e,pageParams:s}){const i=e.length-1;return e.length>0?t.getNextPageParam(e[i],e,s[i],s):void 0}function A(t,{pages:e,pageParams:s}){return e.length>0?t.getPreviousPageParam?.(e[0],e,s[0],s):void 0}var j=class extends o{#t;#e;#s;constructor(t){super(),this.mutationId=t.mutationId,this.#e=t.mutationCache,this.#t=[],this.state=t.state||{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0},this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){this.#t.includes(t)||(this.#t.push(t),this.clearGcTimeout(),this.#e.notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){this.#t=this.#t.filter(e=>e!==t),this.scheduleGc(),this.#e.notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){this.#t.length||("pending"===this.state.status?this.scheduleGc():this.#e.remove(this))}continue(){return this.#s?.continue()??this.execute(this.state.variables)}async execute(t){const e=()=>{this.#i({type:"continue"})};this.#s=u({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(t,e)=>{this.#i({type:"failed",failureCount:t,error:e})},onPause:()=>{this.#i({type:"pause"})},onContinue:e,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#e.canRun(this)});const s="pending"===this.state.status,i=!this.#s.canStart();try{if(s)e();else{this.#i({type:"pending",variables:t,isPaused:i}),await(this.#e.config.onMutate?.(t,this));const e=await(this.options.onMutate?.(t));e!==this.state.context&&this.#i({type:"pending",context:e,variables:t,isPaused:i})}const a=await this.#s.start();return await(this.#e.config.onSuccess?.(a,t,this.state.context,this)),await(this.options.onSuccess?.(a,t,this.state.context)),await(this.#e.config.onSettled?.(a,null,this.state.variables,this.state.context,this)),await(this.options.onSettled?.(a,null,t,this.state.context)),this.#i({type:"success",data:a}),a}catch(e){try{throw await(this.#e.config.onError?.(e,t,this.state.context,this)),await(this.options.onError?.(e,t,this.state.context)),await(this.#e.config.onSettled?.(void 0,e,this.state.variables,this.state.context,this)),await(this.options.onSettled?.(void 0,e,t,this.state.context)),e}finally{this.#i({type:"error",error:e})}}finally{this.#e.runNext(this)}}#i(t){this.state=(e=>{switch(t.type){case"failed":return{...e,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...e,isPaused:!0};case"continue":return{...e,isPaused:!1};case"pending":return{...e,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...e,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...e,data:void 0,error:t.error,failureCount:e.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}})(this.state),h.batch(()=>{this.#t.forEach(e=>{e.onMutationUpdate(t)}),this.#e.notify({mutation:this,type:"updated",action:t})})}};var E=class extends c{constructor(t={}){super(),this.config=t,this.#a=new Set,this.#r=new Map,this.#n=0}#a;#r;#n;build(t,e,s){const i=new j({mutationCache:this,mutationId:++this.#n,options:t.defaultMutationOptions(e),state:s});return this.add(i),i}add(t){this.#a.add(t);const e=K(t);if("string"==typeof e){const s=this.#r.get(e);s?s.push(t):this.#r.set(e,[t])}this.notify({type:"added",mutation:t})}remove(t){if(this.#a.delete(t)){const e=K(t);if("string"==typeof e){const s=this.#r.get(e);if(s)if(s.length>1){const e=s.indexOf(t);-1!==e&&s.splice(e,1)}else s[0]===t&&this.#r.delete(e)}}this.notify({type:"removed",mutation:t})}canRun(t){const e=K(t);if("string"==typeof e){const s=this.#r.get(e),i=s?.find(t=>"pending"===t.state.status);return!i||i===t}return!0}runNext(t){const e=K(t);if("string"==typeof e){const s=this.#r.get(e)?.find(e=>e!==t&&e.state.isPaused);return s?.continue()??Promise.resolve()}return Promise.resolve()}clear(){h.batch(()=>{this.#a.forEach(t=>{this.notify({type:"removed",mutation:t})}),this.#a.clear(),this.#r.clear()})}getAll(){return Array.from(this.#a)}find(t){const e={exact:!0,...t};return this.getAll().find(t=>l(e,t))}findAll(t={}){return this.getAll().filter(e=>l(t,e))}notify(t){h.batch(()=>{this.listeners.forEach(e=>{e(t)})})}resumePausedMutations(){const t=this.getAll().filter(t=>t.state.isPaused);return h.batch(()=>Promise.all(t.map(t=>t.continue().catch(d))))}};function K(t){return t.options.scope?.id}var F=class extends c{constructor(t={}){super(),this.config=t,this.#o=new Map}#o;build(t,e,s){const i=e.queryKey,a=e.queryHash??f(i,e);let r=this.get(a);return r||(r=new y({client:t,queryKey:i,queryHash:a,options:t.defaultQueryOptions(e),state:s,defaultOptions:t.getQueryDefaults(i)}),this.add(r)),r}add(t){this.#o.has(t.queryHash)||(this.#o.set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const e=this.#o.get(t.queryHash);e&&(t.destroy(),e===t&&this.#o.delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){h.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return this.#o.get(t)}getAll(){return[...this.#o.values()]}find(t){const e={exact:!0,...t};return this.getAll().find(t=>p(e,t))}findAll(t={}){const e=this.getAll();return Object.keys(t).length>0?e.filter(e=>p(t,e)):e}notify(t){h.batch(()=>{this.listeners.forEach(e=>{e(t)})})}onFocus(){h.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){h.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},R=class{#u;#e;#h;#c;#l;#d;#f;#y;constructor(t={}){this.#u=t.queryCache||new F,this.#e=t.mutationCache||new E,this.#h=t.defaultOptions||{},this.#c=new Map,this.#l=new Map,this.#d=0}mount(){this.#d++,1===this.#d&&(this.#f=m.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#u.onFocus())}),this.#y=g.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#u.onOnline())}))}unmount(){this.#d--,0===this.#d&&(this.#f?.(),this.#f=void 0,this.#y?.(),this.#y=void 0)}isFetching(t){return this.#u.findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return this.#e.findAll({...t,status:"pending"}).length}getQueryData(t){const e=this.defaultQueryOptions({queryKey:t});return this.#u.get(e.queryHash)?.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),s=this.#u.build(this,e),i=s.state.data;return void 0===i?this.fetchQuery(t):(t.revalidateIfStale&&s.isStaleByTime(v(e.staleTime,s))&&this.prefetchQuery(e),Promise.resolve(i))}getQueriesData(t){return this.#u.findAll(t).map(({queryKey:t,state:e})=>[t,e.data])}setQueryData(t,e,s){const i=this.defaultQueryOptions({queryKey:t}),a=this.#u.get(i.queryHash),r=a?.state.data,n=b(e,r);if(void 0!==n)return this.#u.build(this,i).setData(n,{...s,manual:!0})}setQueriesData(t,e,s){return h.batch(()=>this.#u.findAll(t).map(({queryKey:t})=>[t,this.setQueryData(t,e,s)]))}getQueryState(t){const e=this.defaultQueryOptions({queryKey:t});return this.#u.get(e.queryHash)?.state}removeQueries(t){const e=this.#u;h.batch(()=>{e.findAll(t).forEach(t=>{e.remove(t)})})}resetQueries(t,e){const s=this.#u;return h.batch(()=>(s.findAll(t).forEach(t=>{t.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const s={revert:!0,...e},i=h.batch(()=>this.#u.findAll(t).map(t=>t.cancel(s)));return Promise.all(i).then(d).catch(d)}invalidateQueries(t,e={}){return h.batch(()=>(this.#u.findAll(t).forEach(t=>{t.invalidate()}),"none"===t?.refetchType?Promise.resolve():this.refetchQueries({...t,type:t?.refetchType??t?.type??"active"},e)))}refetchQueries(t,e={}){const s={...e,cancelRefetch:e.cancelRefetch??!0},i=h.batch(()=>this.#u.findAll(t).filter(t=>!t.isDisabled()&&!t.isStatic()).map(t=>{let e=t.fetch(void 0,s);return s.throwOnError||(e=e.catch(d)),"paused"===t.state.fetchStatus?Promise.resolve():e}));return Promise.all(i).then(d)}fetchQuery(t){const e=this.defaultQueryOptions(t);void 0===e.retry&&(e.retry=!1);const s=this.#u.build(this,e);return s.isStaleByTime(v(e.staleTime,s))?s.fetch(e):Promise.resolve(s.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(d).catch(d)}fetchInfiniteQuery(t){return t.behavior=M(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(d).catch(d)}ensureInfiniteQueryData(t){return t.behavior=M(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return g.isOnline()?this.#e.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#u}getMutationCache(){return this.#e}getDefaultOptions(){return this.#h}setDefaultOptions(t){this.#h=t}setQueryDefaults(t,e){this.#c.set(C(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...this.#c.values()],s={};return e.forEach(e=>{q(t,e.queryKey)&&Object.assign(s,e.defaultOptions)}),s}setMutationDefaults(t,e){this.#l.set(C(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...this.#l.values()],s={};return e.forEach(e=>{q(t,e.mutationKey)&&Object.assign(s,e.defaultOptions)}),s}defaultQueryOptions(t){if(t._defaulted)return t;const e={...this.#h.queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=f(e.queryKey,e)),void 0===e.refetchOnReconnect&&(e.refetchOnReconnect="always"!==e.networkMode),void 0===e.throwOnError&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===O&&(e.enabled=!1),e}defaultMutationOptions(t){return t?._defaulted?t:{...this.#h.mutations,...t?.mutationKey&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){this.#u.clear(),this.#e.clear()}},S=t=>{class QueryClientMixinClass extends t{constructor(){super(...arguments),this.queryClient=new R({defaultOptions:{queries:{staleTime:6e4}}})}connectedCallback(){super.connectedCallback(),this.queryClient.mount()}disconnectedCallback(){super.disconnectedCallback(),this.queryClient.unmount()}}return((t,e,s)=>{for(var i,a=void 0,r=t.length-1;r>=0;r--)(i=t[r])&&(a=i(e,s,a)||a);a&&D(e,s,a)})([i({context:s}),Q()],QueryClientMixinClass.prototype,"queryClient"),QueryClientMixinClass};x();let I=class QueryClientProvider extends(S(w)){render(){return P`<slot></slot>`}};I=t([e("mq-query-client-provider")],I);export{I as QueryClientProvider};
|
|
1
|
+
import{_ as t,c as e}from"./chunks/custom-element-D2ziPxYE.js";import{Q as s}from"./chunks/chunk-RCFIJTXZ-C6Ir0-sM.js";import{e as i}from"./chunks/provide-D2fnEhT2.js";import{h as a,j as r,k as n,R as o,l as u,g as h,S as c,m as l,n as d,o as f,Q as y,q as p,f as m,u as g,a as v,v as b,w as C,x as q,y as O}from"./chunks/query-Cjvi4_dT.js";import{x as P,a as w}from"./chunks/lit-element-DiWJYFwC.js";import{r as Q}from"./chunks/state-LQivXIgA.js";import{e as x}from"./chunks/ensure-context-root-DbdqwnKB.js";import"./chunks/create-context-DqP79qjF.js";import"./chunks/context-provider--AKuwfs9.js";import"./chunks/context-request-event-Dfydf1ub.js";import"./chunks/property-scuRaFcM.js";var D=Object.defineProperty;function M(t){return{onFetch:(e,s)=>{const i=e.options,o=e.fetchOptions?.meta?.fetchMore?.direction,u=e.state.data?.pages||[],h=e.state.data?.pageParams||[];let c={pages:[],pageParams:[]},l=0;const d=async()=>{let s=!1;const d=a(e.options,e.fetchOptions),f=async(t,i,a)=>{if(s)return Promise.reject();if(null==i&&t.pages.length)return Promise.resolve(t);const o=(()=>{const t={client:e.client,queryKey:e.queryKey,pageParam:i,direction:a?"backward":"forward",meta:e.options.meta};var r;return r=t,Object.defineProperty(r,"signal",{enumerable:!0,get:()=>(e.signal.aborted?s=!0:e.signal.addEventListener("abort",()=>{s=!0}),e.signal)}),t})(),u=await d(o),{maxPages:h}=e.options,c=a?r:n;return{pages:c(t.pages,u,h),pageParams:c(t.pageParams,i,h)}};if(o&&u.length){const t="backward"===o,e={pages:u,pageParams:h},s=(t?A:k)(i,e);c=await f(e,s,t)}else{const e=t??u.length;do{const t=0===l?h[0]??i.initialPageParam:k(i,c);if(l>0&&null==t)break;c=await f(c,t),l++}while(l<e)}return c};e.options.persister?e.fetchFn=()=>e.options.persister?.(d,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},s):e.fetchFn=d}}}function k(t,{pages:e,pageParams:s}){const i=e.length-1;return e.length>0?t.getNextPageParam(e[i],e,s[i],s):void 0}function A(t,{pages:e,pageParams:s}){return e.length>0?t.getPreviousPageParam?.(e[0],e,s[0],s):void 0}var j=class extends o{#t;#e;#s;constructor(t){super(),this.mutationId=t.mutationId,this.#e=t.mutationCache,this.#t=[],this.state=t.state||{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0},this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){this.#t.includes(t)||(this.#t.push(t),this.clearGcTimeout(),this.#e.notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){this.#t=this.#t.filter(e=>e!==t),this.scheduleGc(),this.#e.notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){this.#t.length||("pending"===this.state.status?this.scheduleGc():this.#e.remove(this))}continue(){return this.#s?.continue()??this.execute(this.state.variables)}async execute(t){const e=()=>{this.#i({type:"continue"})};this.#s=u({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(t,e)=>{this.#i({type:"failed",failureCount:t,error:e})},onPause:()=>{this.#i({type:"pause"})},onContinue:e,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#e.canRun(this)});const s="pending"===this.state.status,i=!this.#s.canStart();try{if(s)e();else{this.#i({type:"pending",variables:t,isPaused:i}),await(this.#e.config.onMutate?.(t,this));const e=await(this.options.onMutate?.(t));e!==this.state.context&&this.#i({type:"pending",context:e,variables:t,isPaused:i})}const a=await this.#s.start();return await(this.#e.config.onSuccess?.(a,t,this.state.context,this)),await(this.options.onSuccess?.(a,t,this.state.context)),await(this.#e.config.onSettled?.(a,null,this.state.variables,this.state.context,this)),await(this.options.onSettled?.(a,null,t,this.state.context)),this.#i({type:"success",data:a}),a}catch(e){try{throw await(this.#e.config.onError?.(e,t,this.state.context,this)),await(this.options.onError?.(e,t,this.state.context)),await(this.#e.config.onSettled?.(void 0,e,this.state.variables,this.state.context,this)),await(this.options.onSettled?.(void 0,e,t,this.state.context)),e}finally{this.#i({type:"error",error:e})}}finally{this.#e.runNext(this)}}#i(t){this.state=(e=>{switch(t.type){case"failed":return{...e,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...e,isPaused:!0};case"continue":return{...e,isPaused:!1};case"pending":return{...e,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...e,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...e,data:void 0,error:t.error,failureCount:e.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}})(this.state),h.batch(()=>{this.#t.forEach(e=>{e.onMutationUpdate(t)}),this.#e.notify({mutation:this,type:"updated",action:t})})}};var E=class extends c{constructor(t={}){super(),this.config=t,this.#a=new Set,this.#r=new Map,this.#n=0}#a;#r;#n;build(t,e,s){const i=new j({mutationCache:this,mutationId:++this.#n,options:t.defaultMutationOptions(e),state:s});return this.add(i),i}add(t){this.#a.add(t);const e=K(t);if("string"==typeof e){const s=this.#r.get(e);s?s.push(t):this.#r.set(e,[t])}this.notify({type:"added",mutation:t})}remove(t){if(this.#a.delete(t)){const e=K(t);if("string"==typeof e){const s=this.#r.get(e);if(s)if(s.length>1){const e=s.indexOf(t);-1!==e&&s.splice(e,1)}else s[0]===t&&this.#r.delete(e)}}this.notify({type:"removed",mutation:t})}canRun(t){const e=K(t);if("string"==typeof e){const s=this.#r.get(e),i=s?.find(t=>"pending"===t.state.status);return!i||i===t}return!0}runNext(t){const e=K(t);if("string"==typeof e){const s=this.#r.get(e)?.find(e=>e!==t&&e.state.isPaused);return s?.continue()??Promise.resolve()}return Promise.resolve()}clear(){h.batch(()=>{this.#a.forEach(t=>{this.notify({type:"removed",mutation:t})}),this.#a.clear(),this.#r.clear()})}getAll(){return Array.from(this.#a)}find(t){const e={exact:!0,...t};return this.getAll().find(t=>l(e,t))}findAll(t={}){return this.getAll().filter(e=>l(t,e))}notify(t){h.batch(()=>{this.listeners.forEach(e=>{e(t)})})}resumePausedMutations(){const t=this.getAll().filter(t=>t.state.isPaused);return h.batch(()=>Promise.all(t.map(t=>t.continue().catch(d))))}};function K(t){return t.options.scope?.id}var F=class extends c{constructor(t={}){super(),this.config=t,this.#o=new Map}#o;build(t,e,s){const i=e.queryKey,a=e.queryHash??f(i,e);let r=this.get(a);return r||(r=new y({client:t,queryKey:i,queryHash:a,options:t.defaultQueryOptions(e),state:s,defaultOptions:t.getQueryDefaults(i)}),this.add(r)),r}add(t){this.#o.has(t.queryHash)||(this.#o.set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const e=this.#o.get(t.queryHash);e&&(t.destroy(),e===t&&this.#o.delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){h.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return this.#o.get(t)}getAll(){return[...this.#o.values()]}find(t){const e={exact:!0,...t};return this.getAll().find(t=>p(e,t))}findAll(t={}){const e=this.getAll();return Object.keys(t).length>0?e.filter(e=>p(t,e)):e}notify(t){h.batch(()=>{this.listeners.forEach(e=>{e(t)})})}onFocus(){h.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){h.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},R=class{#u;#e;#h;#c;#l;#d;#f;#y;constructor(t={}){this.#u=t.queryCache||new F,this.#e=t.mutationCache||new E,this.#h=t.defaultOptions||{},this.#c=new Map,this.#l=new Map,this.#d=0}mount(){this.#d++,1===this.#d&&(this.#f=m.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#u.onFocus())}),this.#y=g.subscribe(async t=>{t&&(await this.resumePausedMutations(),this.#u.onOnline())}))}unmount(){this.#d--,0===this.#d&&(this.#f?.(),this.#f=void 0,this.#y?.(),this.#y=void 0)}isFetching(t){return this.#u.findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return this.#e.findAll({...t,status:"pending"}).length}getQueryData(t){const e=this.defaultQueryOptions({queryKey:t});return this.#u.get(e.queryHash)?.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),s=this.#u.build(this,e),i=s.state.data;return void 0===i?this.fetchQuery(t):(t.revalidateIfStale&&s.isStaleByTime(v(e.staleTime,s))&&this.prefetchQuery(e),Promise.resolve(i))}getQueriesData(t){return this.#u.findAll(t).map(({queryKey:t,state:e})=>[t,e.data])}setQueryData(t,e,s){const i=this.defaultQueryOptions({queryKey:t}),a=this.#u.get(i.queryHash),r=a?.state.data,n=b(e,r);if(void 0!==n)return this.#u.build(this,i).setData(n,{...s,manual:!0})}setQueriesData(t,e,s){return h.batch(()=>this.#u.findAll(t).map(({queryKey:t})=>[t,this.setQueryData(t,e,s)]))}getQueryState(t){const e=this.defaultQueryOptions({queryKey:t});return this.#u.get(e.queryHash)?.state}removeQueries(t){const e=this.#u;h.batch(()=>{e.findAll(t).forEach(t=>{e.remove(t)})})}resetQueries(t,e){const s=this.#u;return h.batch(()=>(s.findAll(t).forEach(t=>{t.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const s={revert:!0,...e},i=h.batch(()=>this.#u.findAll(t).map(t=>t.cancel(s)));return Promise.all(i).then(d).catch(d)}invalidateQueries(t,e={}){return h.batch(()=>(this.#u.findAll(t).forEach(t=>{t.invalidate()}),"none"===t?.refetchType?Promise.resolve():this.refetchQueries({...t,type:t?.refetchType??t?.type??"active"},e)))}refetchQueries(t,e={}){const s={...e,cancelRefetch:e.cancelRefetch??!0},i=h.batch(()=>this.#u.findAll(t).filter(t=>!t.isDisabled()&&!t.isStatic()).map(t=>{let e=t.fetch(void 0,s);return s.throwOnError||(e=e.catch(d)),"paused"===t.state.fetchStatus?Promise.resolve():e}));return Promise.all(i).then(d)}fetchQuery(t){const e=this.defaultQueryOptions(t);void 0===e.retry&&(e.retry=!1);const s=this.#u.build(this,e);return s.isStaleByTime(v(e.staleTime,s))?s.fetch(e):Promise.resolve(s.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(d).catch(d)}fetchInfiniteQuery(t){return t.behavior=M(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(d).catch(d)}ensureInfiniteQueryData(t){return t.behavior=M(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return g.isOnline()?this.#e.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#u}getMutationCache(){return this.#e}getDefaultOptions(){return this.#h}setDefaultOptions(t){this.#h=t}setQueryDefaults(t,e){this.#c.set(C(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...this.#c.values()],s={};return e.forEach(e=>{q(t,e.queryKey)&&Object.assign(s,e.defaultOptions)}),s}setMutationDefaults(t,e){this.#l.set(C(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...this.#l.values()],s={};return e.forEach(e=>{q(t,e.mutationKey)&&Object.assign(s,e.defaultOptions)}),s}defaultQueryOptions(t){if(t._defaulted)return t;const e={...this.#h.queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=f(e.queryKey,e)),void 0===e.refetchOnReconnect&&(e.refetchOnReconnect="always"!==e.networkMode),void 0===e.throwOnError&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===O&&(e.enabled=!1),e}defaultMutationOptions(t){return t?._defaulted?t:{...this.#h.mutations,...t?.mutationKey&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){this.#u.clear(),this.#e.clear()}},S=t=>{class QueryClientMixinClass extends t{constructor(){super(...arguments),this.queryClient=new R({defaultOptions:{queries:{staleTime:6e4}}})}connectedCallback(){super.connectedCallback(),this.queryClient.mount()}disconnectedCallback(){super.disconnectedCallback(),this.queryClient.unmount()}}return((t,e,s)=>{for(var i,a=void 0,r=t.length-1;r>=0;r--)(i=t[r])&&(a=i(e,s,a)||a);a&&D(e,s,a)})([i({context:s}),Q()],QueryClientMixinClass.prototype,"queryClient"),QueryClientMixinClass};x();let I=class QueryClientProvider extends(S(w)){render(){return P`<slot></slot>`}};I=t([e("mq-query-client-provider")],I);export{I as QueryClientProvider};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{isValidLocale as t,setLocale as e,getLocale as i,initLocalization as o}from"./i18n.js";import{_ as n,
|
|
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{i as p,a as l,x as d,E as m}from"./chunks/lit-element-DiWJYFwC.js";import{n as u}from"./chunks/property-scuRaFcM.js";import{r as h}from"./chunks/state-LQivXIgA.js";import{setEnv as v}from"./env.js";import{MqViewAppointmentsEvent as g,MqHomeEvent as f}from"./events.js";import{a as k,A as y,g as b,C as x}from"./chunks/api-chat-client-BBL1U9EQ.js";import{checkIcon as j}from"./ui/icons/check-icon.js";import"./ui/mq-callout.js";import"./ui/mq-button.js";import{c as w}from"./chunks/consume-CovVqBjI.js";import{l as $}from"./chunks/chunk-S5RWG6G2-DPesx3Od.js";import"./chunks/professional-overview-C4H_znIJ.js";import{f as q}from"./chunks/price-LTnCz9kN.js";import{Q as C}from"./chunks/query-controller-BlO1Ax65.js";import{g as _}from"./chunks/get-appointment-query-Ck68BEMg.js";import{g as S}from"./chunks/get-organization-setup-query-BMbuRi6v.js";import{g as z}from"./chunks/get-patient-profile-query-B0tUDJmT.js";import{g as I}from"./chunks/chunk-GZF3YFSX-DM-GTqxg.js";import{calendarIcon as O}from"./ui/icons/calendar-icon.js";import{chatbubbleIcon as Q}from"./ui/icons/chat-bubble-icon.js";import{videoIcon as A}from"./ui/icons/video-icon.js";import"./mq-chat-room.js";import"./ui/mq-floating-bubble.js";import"./ui/mq-unread-badge.js";import{g as T,a as P}from"./chunks/i18n-formats-DYS91YEa.js";import"./ui/mq-skeleton.js";import"./ui/mq-card.js";import{Q as E}from"./chunks/chunk-RCFIJTXZ-C6Ir0-sM.js";import{t as N,e as V,a as F,f as H,g as B,h as G}from"./chunks/telemetry-client-BLJVs9me.js";import"./chunks/chunk-4FFT6DC2-CVWibomC.js";import"./chunks/external-CJj32K_p.js";import"./chunks/parseISO-Dj3qSTG8.js";import"./chunks/format-CRFiCNHw.js";import"./chunks/isBefore-CPpTogxo.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/context-consumer-ESdICVAb.js";import"./chunks/context-request-event-Dfydf1ub.js";import"./chunks/create-context-DqP79qjF.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"./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/provide-D2fnEhT2.js";import"./chunks/context-provider--AKuwfs9.js";import"./theme.js";import"./ui/icons/x-icon.js";import"./chunks/chunk-YMQSBQHL-De_r7BNk.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=p`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 M=class MqScheduleSuccessSkeleton extends l{static{this.styles=K}render(){return d`<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>`}};M=n([a("mq-schedule-success-skeleton")],M);const R=p`.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 U=class MqScheduleSuccess extends l{constructor(){super(...arguments),this.kind="schedule",this.showNavCtas=!1,this._trackedPageView=!1,this.getPatientProfileQuery=new C(this,()=>z(k)),this.getAppointmentQuery=new C(this,()=>_(k,{id:this.appointmentId})),this.getCouponQuery=new C(this,()=>{return t=k,e={appointmentId:this.appointmentId},i={enabled:!!this.appointmentId},{queryKey:["appointment-consultation-coupon",e.appointmentId],queryFn:()=>t.payments.getAppointmentConsultationCoupon(e.appointmentId),retry:!1,...i};var t,e,i}),this.getOrganizationSpecialtiesQuery=new C(this,()=>T(k)),this.getOrganizationSetupQuery=new C(this,()=>S(k)),this.isChatOpen=!1,this.unreadQuery=new C(this,()=>I(k,{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 m}}}static{this.styles=R}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&&v(this.env),i.has("apiKey")&&this.apiKey&&k.setApiKey(this.apiKey),i.has("token")&&this.token&&k.setAuthToken(this.token),i.has("locale")&&this.locale&&t(this.locale)&&(e(this.locale),k.setLanguage(this.locale))}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 m;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,u=r?p?.percent_off??Math.round(a/o*100):0,h=l?`${s("Promoción")} ${l}`:s("Promoción");return d`<div class="price-breakdown"><div class="price-row"><span>${i}</span> <span>${q({amount:o,currency:n},e)}</span></div>${r?d`<div class="price-row"><span>${h} (-${u}%)</span> <span>${q({amount:-a,currency:n},e)}</span></div><hr><div class="price-row price-row--total"><span>${s("Total")}</span> <span>${q({amount:c,currency:n},e)}</span></div>`:m}</div>`}render(){return this.getAppointmentQuery.render({pending:()=>d`<mq-schedule-success-skeleton></mq-schedule-success-skeleton>`,complete:t=>{const e=i(),o=b(t.start_date),n=F(o,t.duration),a=this.getOrganizationSpecialtiesQuery.result?.data?.find(e=>e.id===Number(t.speciality_id)),c=P(a?.code??"",e,a?.name),p=t.channel===y.videocall,l=t.channel===y.phonecall,u=!0===this.getOrganizationSetupQuery.result?.data?.appointments?.has_chat_in_appointment,h=(p||l)&&u,v=this._accessToken;return d`<div><header><div class="success-title">${j()}<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(H(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?d`<div class="actions">${h?d`<mq-button variant="primary" fullwidth size="md" @click="${()=>{N.track(B(this._patientHash,this.appointmentId)),this.isChatOpen=!this.isChatOpen}}">${Q({size:24})} ${s("Chatear con el profesional")} ${(this.unreadQuery.result?.data?.unread_count??0)>0?d`<mq-unread-badge></mq-unread-badge>`:m}</mq-button>`:m} ${p?d`<mq-button variant="outline" fullwidth size="md" @click="${()=>{N.track(G(this._patientHash,this.appointmentId)),this.dispatchEvent(new OpenVideocallEvent({appointmentId:this.appointmentId}))}}">${A({size:24})} ${s("Ir a videollamada")}</mq-button>`:m}</div>`:m}</div><mq-callout background="default" variant="info" ?noPadding="${!(h||p)}">${this._getCalloutText(t)}</mq-callout></mq-card>${this.showNavCtas?d`<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 g({tab:"next"}))}}">${s("Ver mis citas")}</mq-button><mq-button variant="outline" size="md" fullwidth @click="${()=>{this.dispatchEvent(new f)}}">${s("Volver al inicio")}</mq-button></div></mq-card>`:m}</div><mq-floating-bubble ?dismissable="${!1}" .open="${this.isChatOpen}" @mq-close="${()=>{this.isChatOpen=!1}}" hideCloseButton>${this.isChatOpen&&v?d`<div slot="content" class="floating-content"><mq-chat-room .consultationId="${t.id}" .consultationType="${x.appointment}" .token="${v}" .roomId="${Number(t.room_id)}" .professionalHash="${t.from.hash}" @mq-chat-room-close="${()=>{this.isChatOpen=!1}}"></mq-chat-room></div>`:m}</mq-floating-bubble>`}})}};n([u({type:String})],U.prototype,"kind",void 0),n([u({type:String})],U.prototype,"appointmentId",void 0),n([u({type:String,attribute:"api-key"})],U.prototype,"apiKey",void 0),n([u({type:String,attribute:"token"})],U.prototype,"token",void 0),n([u({type:String,attribute:"timezone"})],U.prototype,"timezone",void 0),n([u({type:String,attribute:"locale"})],U.prototype,"locale",void 0),n([u({type:String,attribute:"env"})],U.prototype,"env",void 0),n([u({type:Boolean,attribute:"show-nav-ctas"})],U.prototype,"showNavCtas",void 0),n([w({context:E,subscribe:!0})],U.prototype,"queryClientContext",void 0),n([w({context:$})],U.prototype,"loginToken",void 0),n([h()],U.prototype,"isChatOpen",void 0),U=n([c(),a("mq-schedule-success")],U),o();export{U as MqScheduleSuccess,OpenVideocallEvent};
|
package/dist/mq-schedule.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import * as lit_html from 'lit-html';
|
|
2
2
|
import * as lit from 'lit';
|
|
3
3
|
import { LitElement, PropertyValues, TemplateResult, nothing } from 'lit';
|
|
4
|
-
import './chunks/mq-layout-D8Mak16a.js';
|
|
5
4
|
import './ui/mq-button.js';
|
|
6
5
|
import { Env } from './env.js';
|
|
7
6
|
import { A as AppointmentChannel, a as Appointment } from './chunks/appointment.model.d-Dy50gMPg.js';
|
|
@@ -14,7 +13,7 @@ import './ui/mq-clamped-text.js';
|
|
|
14
13
|
import './ui/mq-card.js';
|
|
15
14
|
import { P as PriceInCents } from './chunks/price.d-CwLosdAN.js';
|
|
16
15
|
import { QueryClient } from '@tanstack/query-core';
|
|
17
|
-
import { C as CreatePaymentLinkRequest, P as PaymentProvider } from './chunks/schemas.d-
|
|
16
|
+
import { C as CreatePaymentLinkRequest, P as PaymentProvider } from './chunks/schemas.d-Bss7CeCZ.js';
|
|
18
17
|
import './ui/mq-skeleton.js';
|
|
19
18
|
import './ui/mq-select.js';
|
|
20
19
|
import './ui/mq-time-slot-picker.js';
|
|
@@ -550,6 +549,7 @@ declare class ConfirmStep extends LitElement {
|
|
|
550
549
|
/** Discount applied in the summary; threaded through so the code reaches the
|
|
551
550
|
* booking payload and persists into the payment step. */
|
|
552
551
|
appliedDiscount: AppliedDiscount | null;
|
|
552
|
+
returnUrl?: string;
|
|
553
553
|
private reason;
|
|
554
554
|
private attachedFiles;
|
|
555
555
|
get isPaymentFlow(): boolean;
|
|
@@ -954,7 +954,6 @@ declare class MqSchedule extends LitElement {
|
|
|
954
954
|
requiresPayment: boolean;
|
|
955
955
|
/** Appointment ID — required when kind="reschedule". */
|
|
956
956
|
appointmentId?: string;
|
|
957
|
-
showMediquoBranding: boolean;
|
|
958
957
|
/** When `false`, hides the back button on the wizard's first step. */
|
|
959
958
|
showBackButton: boolean;
|
|
960
959
|
/** Mediquo API key. Required when used standalone (outside mq-router). */
|
|
@@ -975,6 +974,7 @@ declare class MqSchedule extends LitElement {
|
|
|
975
974
|
* Omit when the parent tab polls the payment session (default schedule web flow).
|
|
976
975
|
*/
|
|
977
976
|
applePaySuccessUrl?: string;
|
|
977
|
+
returnUrl?: string;
|
|
978
978
|
/** IANA timezone for slot times; the host supplies it (not in the profile),
|
|
979
979
|
* defaulting to the browser's. */
|
|
980
980
|
timezone?: string;
|
|
@@ -994,8 +994,7 @@ declare class MqSchedule extends LitElement {
|
|
|
994
994
|
private _hostConfig;
|
|
995
995
|
private _renderStep;
|
|
996
996
|
private renderReschedulePolicyBlocked;
|
|
997
|
-
|
|
998
|
-
render(): lit_html.TemplateResult<1>;
|
|
997
|
+
render(): typeof lit_html.nothing | lit_html.TemplateResult;
|
|
999
998
|
}
|
|
1000
999
|
declare global {
|
|
1001
1000
|
interface HTMLElementTagNameMap {
|