@mediquo/elements 0.6.5 → 0.8.0-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (127) hide show
  1. package/dist/chunks/action-unavailable-message-DPH7oOl_.js +1 -0
  2. package/dist/chunks/addSeconds-ofMnxlgT.js +1 -0
  3. package/dist/chunks/api-chat-client-DLOZVIkT.js +1 -0
  4. package/dist/chunks/{apple-pay-outcomes-CnVRvAVS.js → apple-pay-outcomes-BMxr7x7j.js} +1 -1
  5. package/dist/chunks/{appointment-card-skeleton-1c7552Ln.d.ts → appointment-action-unavailable-dialog-Da2IATYj.d.ts} +9 -86
  6. package/dist/chunks/appointment-card-skeleton-B5b-O2Fh.js +1 -0
  7. package/dist/chunks/appointment-card-skeleton-B7dKtGv0.d.ts +91 -0
  8. package/dist/chunks/{appointment-details-DpzdYLjq.d.ts → appointment-details-CVEDe_k0.d.ts} +1 -1
  9. package/dist/chunks/appointment-details-Czlj6VHq.js +1 -0
  10. package/dist/chunks/{appointment.model.d-Dy50gMPg.d.ts → appointment.model.d-BWwBLaEL.d.ts} +3 -0
  11. package/dist/chunks/blob-to-base64-CUL1trde.js +1 -0
  12. package/dist/chunks/{context-consumer-ESdICVAb.js → chunk-6CCJWPGL-DlOpbEYH.js} +1 -1
  13. package/dist/chunks/chunk-BUV4MGML-Bn3JWCAv.js +1 -0
  14. package/dist/chunks/chunk-Y4EKUX25-CqL3lLdx.js +1 -0
  15. package/dist/chunks/consume-BhoQNO_8.js +1 -0
  16. package/dist/chunks/document.model.d-DIzMiOmd.d.ts +6 -0
  17. package/dist/chunks/documentation-view-BwT9Ol66.js +1 -0
  18. package/dist/chunks/get-appointment-query-lJe75hGS.js +1 -0
  19. package/dist/chunks/get-organization-setup-query-DxHNY0w8.js +1 -0
  20. package/dist/chunks/get-patient-documents-query-D1SfC_k_.js +1 -0
  21. package/dist/chunks/get-patient-profile-query-DiU2f_QH.js +1 -0
  22. package/dist/chunks/get-schedule-services-query-Ckvz9Fqh.js +1 -0
  23. package/dist/chunks/i18n-formats-EgnwLxKt.js +1 -0
  24. package/dist/chunks/index-63zQSBy4.js +1 -0
  25. package/dist/chunks/index-BgnerXfH.js +1 -0
  26. package/dist/chunks/{index-DhfVmF4C.js → index-C195MGA_.js} +1 -1
  27. package/dist/chunks/index-CDBk7hVW.d.ts +28 -0
  28. package/dist/chunks/{index-DNUbmrQl.d.ts → index-CSJzkkRA.d.ts} +1 -4
  29. package/dist/chunks/index-DZjrAnPq.js +1 -0
  30. package/dist/chunks/{mq-chat-room-DuG4RuIp.d.ts → mq-chat-room-CRPruRJD.d.ts} +1 -1
  31. package/dist/chunks/price-DU3YLTpk.js +1 -0
  32. package/dist/chunks/query-controller-D7jBX4X7.js +1 -0
  33. package/dist/chunks/refund-cancel-policy-DhD6jEtp.js +1 -0
  34. package/dist/chunks/{schemas.d-5LR6aN9I.d.ts → schemas.d-D7bCe24u.d.ts} +20 -20
  35. package/dist/chunks/telemetry-client-Bkbn48Dd.js +1 -0
  36. package/dist/env.js +1 -1
  37. package/dist/mq-apple-pay-checkout.js +1 -1
  38. package/dist/mq-appointment-checkout.js +1 -1
  39. package/dist/mq-appointment-documentation.d.ts +4 -3
  40. package/dist/mq-appointment-documentation.js +1 -1
  41. package/dist/mq-chat-room.d.ts +2 -2
  42. package/dist/mq-chat-room.js +1 -1
  43. package/dist/mq-checkout.js +1 -1
  44. package/dist/mq-dashboard.d.ts +23 -13
  45. package/dist/mq-dashboard.js +1 -1
  46. package/dist/mq-documents.d.ts +2 -1
  47. package/dist/mq-documents.js +1 -1
  48. package/dist/mq-google-pay-checkout.js +1 -1
  49. package/dist/mq-immediate-videocall-checkout.js +1 -1
  50. package/dist/mq-my-appointments.d.ts +9 -8
  51. package/dist/mq-my-appointments.js +1 -1
  52. package/dist/mq-next-appointments.d.ts +88 -0
  53. package/dist/mq-next-appointments.js +1 -0
  54. package/dist/mq-payment-poller.js +1 -1
  55. package/dist/mq-professional-presence-sync.js +1 -1
  56. package/dist/mq-recent-documents.d.ts +60 -0
  57. package/dist/mq-recent-documents.js +1 -0
  58. package/dist/mq-schedule-success.d.ts +3 -4
  59. package/dist/mq-schedule-success.js +2 -2
  60. package/dist/mq-schedule.d.ts +10 -11
  61. package/dist/mq-schedule.js +1 -1
  62. package/dist/mq-session-provider.d.ts +1 -1
  63. package/dist/mq-support-chat.d.ts +2 -2
  64. package/dist/mq-support-chat.js +1 -1
  65. package/dist/mq-terms-and-conditions.js +1 -1
  66. package/dist/mq-unread-count-sync.js +1 -1
  67. package/dist/mq-videocall.d.ts +4 -3
  68. package/dist/mq-videocall.js +1 -1
  69. package/dist/react/mq-apple-pay-checkout.js +1 -1
  70. package/dist/react/mq-appointment-checkout.js +1 -1
  71. package/dist/react/mq-appointment-documentation.d.ts +4 -3
  72. package/dist/react/mq-appointment-documentation.js +1 -1
  73. package/dist/react/mq-chat-room.d.ts +2 -2
  74. package/dist/react/mq-chat-room.js +1 -1
  75. package/dist/react/mq-checkout.js +1 -1
  76. package/dist/react/mq-dashboard.d.ts +11 -9
  77. package/dist/react/mq-dashboard.js +1 -1
  78. package/dist/react/mq-documents-page.d.ts +2 -1
  79. package/dist/react/mq-documents-page.js +1 -1
  80. package/dist/react/mq-documents.d.ts +2 -1
  81. package/dist/react/mq-documents.js +1 -1
  82. package/dist/react/mq-google-pay-checkout.js +1 -1
  83. package/dist/react/mq-immediate-videocall-checkout.js +1 -1
  84. package/dist/react/mq-my-appointments.d.ts +10 -9
  85. package/dist/react/mq-my-appointments.js +1 -1
  86. package/dist/react/mq-next-appointments.d.ts +38 -0
  87. package/dist/react/mq-next-appointments.js +2 -0
  88. package/dist/react/mq-payment-poller.js +1 -1
  89. package/dist/react/mq-professional-presence-sync.js +1 -1
  90. package/dist/react/mq-recent-documents.d.ts +27 -0
  91. package/dist/react/mq-recent-documents.js +2 -0
  92. package/dist/react/mq-schedule-success.d.ts +3 -3
  93. package/dist/react/mq-schedule-success.js +1 -1
  94. package/dist/react/mq-schedule.d.ts +5 -5
  95. package/dist/react/mq-schedule.js +1 -1
  96. package/dist/react/mq-session-provider.d.ts +1 -1
  97. package/dist/react/mq-support-chat.d.ts +2 -2
  98. package/dist/react/mq-support-chat.js +1 -1
  99. package/dist/react/mq-terms-and-conditions.js +1 -1
  100. package/dist/react/mq-unread-count-sync.js +1 -1
  101. package/dist/react/mq-videocall.d.ts +4 -3
  102. package/dist/react/mq-videocall.js +1 -1
  103. package/dist/theme.d.ts +8 -0
  104. package/dist/theme.js +1 -1
  105. package/dist/ui/icons/arrow-right-icon.d.ts +6 -0
  106. package/dist/ui/icons/arrow-right-icon.js +1 -0
  107. package/dist/ui/icons/dots-horizontal-icon.d.ts +6 -0
  108. package/dist/ui/icons/dots-horizontal-icon.js +1 -0
  109. package/dist/ui/mq-clamped-text.js +1 -1
  110. package/package.json +10 -2
  111. package/dist/chunks/api-chat-client-BBL1U9EQ.js +0 -1
  112. package/dist/chunks/appointment-card-skeleton-C8VERHzq.js +0 -1
  113. package/dist/chunks/chunk-GZF3YFSX-DM-GTqxg.js +0 -1
  114. package/dist/chunks/chunk-YMQSBQHL-De_r7BNk.js +0 -1
  115. package/dist/chunks/consume-CovVqBjI.js +0 -1
  116. package/dist/chunks/documentation-view-DJCr5_MN.js +0 -1
  117. package/dist/chunks/get-appointment-query-Ck68BEMg.js +0 -1
  118. package/dist/chunks/get-organization-setup-query-BMbuRi6v.js +0 -1
  119. package/dist/chunks/get-patient-documents-query-DIQH-TMM.js +0 -1
  120. package/dist/chunks/get-patient-profile-query-B0tUDJmT.js +0 -1
  121. package/dist/chunks/i18n-formats-DYS91YEa.js +0 -1
  122. package/dist/chunks/index-KvIw19qY.js +0 -1
  123. package/dist/chunks/index-ShXzd7UZ.js +0 -1
  124. package/dist/chunks/price-LTnCz9kN.js +0 -1
  125. package/dist/chunks/query-controller-BlO1Ax65.js +0 -1
  126. package/dist/chunks/refund-cancel-policy-CXFTrFfo.js +0 -1
  127. package/dist/chunks/telemetry-client-BLJVs9me.js +0 -1
@@ -0,0 +1 @@
1
+ import{s as t}from"./chunk-6CCJWPGL-DlOpbEYH.js";import{_ as e,c as i}from"./custom-element-D2ziPxYE.js";import{Q as o}from"./chunk-RCFIJTXZ-C6Ir0-sM.js";import{M as n}from"./mutation-controller-CR2qcqhH.js";import{h as a,f as s}from"./price-DU3YLTpk.js";import{getLocale as r}from"../i18n.js";import"../ui/mq-button.js";import"../ui/mq-dialog.js";import{c as l}from"./consume-BhoQNO_8.js";import{m as p,s as m}from"./runtime-Bg1WXVCx.js";import{l as c}from"./localized-decorator-BlOuLhym.js";import{a as d,i as h,x as u}from"./lit-element-DiWJYFwC.js";import{n as f}from"./property-scuRaFcM.js";import{a as v}from"./api-chat-client-DLOZVIkT.js";function g(e,i){return{queryKey:t(e,"appointments",i),queryFn:()=>e.appointments.getAppointments(i)}}let b=class CancelAppointmentConfirmationDialog extends d{constructor(){super(...arguments),this.open=!1,this.cancelAppointmentMutation=new n(this,{mutationFn:async t=>v.appointments.cancelAppointment(t),onSuccess:()=>{this.queryClientContext?.invalidateQueries(),this.dispatchEvent(new CustomEvent("success",{bubbles:!0,composed:!0}))}}),this.handleClose=()=>{this.open=!1,this.dispatchEvent(new CustomEvent("cancel",{bubbles:!0,composed:!0}))},this.handleDismissClick=()=>{this.open=!1,this.dispatchEvent(new CustomEvent("cancel",{bubbles:!0,composed:!0}))},this.handleConfirmClick=()=>{this.cancelAppointmentMutation.run({id:this.appointmentId})}}static{this.styles=h`:host{display:contents}h2{font-family:var(--font-titles);font-size:var(--text-2xl);line-height:var(--text-2xl--line-height);font-weight:var(--font-weight-bold);margin:0}p{font-family:var(--font-body);font-size:var(--text-sm);line-height:var(--text-sm--line-height);font-weight:var(--font-weight-normal);margin:0}.subheading-payable{font-size:var(--text-base);line-height:22px}.price-rows{display:flex;flex-direction:column;font-family:var(--font-body);font-size:var(--text-sm);font-weight:var(--font-weight-medium);line-height:var(--text-sm--line-height);color:var(--color-card-foreground);width:100%;margin-bottom:var(--sp-4)}.price-row{display:flex;align-items:center;justify-content:space-between;min-height:34px;gap:var(--sp-2)}.price-row span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.actions{display:flex;gap:var(--sp-3);margin-top:var(--sp-4);justify-content:flex-end;flex-wrap:wrap}`}render(){const t=r(),e=this.price,i=a(e),o=this.cancelAppointmentMutation.isPending;if(i){const i=s(e,t),n=`-${i}`;return u`<mq-dialog .open="${this.open}" @mq-close="${this.handleClose}" dismissable><h2 slot="heading">${p("Confirmar cancelación")}</h2><p slot="subheading" class="subheading-payable">${p("¿Seguro que quieres cancelar esta cita? Se te devolverá el importe pagado en un plazo de 5-10 días hábiles.")}</p><div><div class="price-rows"><div class="price-row"><span>${p("Importe pagado")}</span> <span>${i}</span></div><div class="price-row"><span>${p("Importe a devolver")}</span> <span>${n}</span></div></div><div class="actions"><mq-button variant="outline" ?disabled="${o}" @click="${this.handleDismissClick}">${p("Volver")}</mq-button><mq-button variant="primary" ?disabled="${o}" @click="${this.handleConfirmClick}">${p("Confirmar")}</mq-button></div></div></mq-dialog>`}return u`<mq-dialog .open="${this.open}" @mq-close="${this.handleClose}" dismissable><h2 slot="heading">${p("Confirmar cancelación")}</h2><p slot="subheading">${p("¿Seguro que quieres cancelar esta cita?")}</p><div><div class="actions"><mq-button variant="outline" ?disabled="${o}" @click="${this.handleDismissClick}">${p("Cancelar")}</mq-button><mq-button variant="primary" ?disabled="${o}" @click="${this.handleConfirmClick}">${p("Confirmar")}</mq-button></div></div></mq-dialog>`}};e([f({type:Boolean,reflect:!0})],b.prototype,"open",void 0),e([l({context:o,subscribe:!0})],b.prototype,"queryClientContext",void 0),e([f({type:String})],b.prototype,"appointmentId",void 0),e([f({type:Object})],b.prototype,"price",void 0),b=e([c(),i("cancel-appointment-confirmation-dialog")],b);let y=class AppointmentActionUnavailableDialog extends d{constructor(){super(...arguments),this.open=!1,this.heading="",this.message="",this.handleClose=()=>{this.open=!1,this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0}))}}static{this.styles=h`:host{display:contents}mq-dialog::part(dialog){max-width:343px;min-width:0}h2{font-family:var(--font-titles);font-size:var(--text-2xl);line-height:var(--text-2xl--line-height);font-weight:var(--font-weight-bold);margin:0}p{font-family:var(--font-body);font-size:var(--text-sm);line-height:var(--text-sm--line-height);font-weight:var(--font-weight-normal);margin:0}.actions{display:flex;margin-top:var(--sp-4)}`}render(){return u`<mq-dialog .open="${this.open}" @mq-close="${this.handleClose}" dismissable><h2 slot="heading">${this.heading}</h2><p slot="subheading">${this.message}</p><div class="actions"><mq-button variant="primary" fullwidth @click="${this.handleClose}">${p("Volver")}</mq-button></div></mq-dialog>`}};function $(t){const{action:e,refundPolicySeconds:i}=t,o=null!=i&&i<3600,n=Math.ceil((i??0)/60),a=Math.ceil((i??0)/3600);return p(0===(o?n:a)?"modify"===e?"Esta cita ya ha pasado, por lo que no se puede modificar.":"Esta cita ya ha pasado, por lo que no se puede anular.":"modify"===e?o?m`Lo sentimos, como faltan menos de ${n} minutos para tu cita no podemos modificarla.`:m`Lo sentimos, como faltan menos de ${a} horas para tu cita no podemos modificarla.`:o?m`Lo sentimos, como faltan menos de ${n} minutos para tu cita no podemos anularla.`:m`Lo sentimos, como faltan menos de ${a} horas para tu cita no podemos anularla.`)}e([f({type:Boolean,reflect:!0})],y.prototype,"open",void 0),e([f({type:String})],y.prototype,"heading",void 0),e([f({type:String})],y.prototype,"message",void 0),y=e([c(),i("appointment-action-unavailable-dialog")],y);export{g as a,$ as g};
@@ -0,0 +1 @@
1
+ import{c as r,t}from"./parseISO-Dj3qSTG8.js";function n(n,a,e){return function(n,a){return r(n,+t(n)+a)}(n,1e3*a)}export{n as a};
@@ -0,0 +1 @@
1
+ import{p as t}from"./parseISO-Dj3qSTG8.js";import{f as e}from"./format-CRFiCNHw.js";import{z as n,o as r,s as i,n as s,a as o,e as a,b as l,r as c,u,c as d,d as p,f as h,l as f,g as m,i as g}from"./external-CJj32K_p.js";import{i as b}from"./isBefore-CPpTogxo.js";import{env as y}from"../env.js";function _(e){return t(`${e.replace(" ","T")}Z`)}function v(t){const n=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds()));return e(n,"yyyy-MM-dd HH:mm:ss")}function w(t,e){try{const n=new Intl.DateTimeFormat("en",{timeZone:t,timeZoneName:"shortOffset"}).formatToParts(e);return n.find(t=>"timeZoneName"===t.type)?.value??""}catch{return""}}var C=n.enum(["pending","expired","accepted","inCall","declined","cancelled","finished","free_of_charge","owed","unpaid","reporting"]),E=C.enum,R=n.enum(["videocall","chat","phonecall"]),O=R.enum,S=n.object({id:n.string().uuid(),room_id:n.string(),channel:R,consultation_short_url:n.string().url().nullable(),call_id:n.string().url(),duration:n.number(),from:n.object({hash:n.string(),name:n.string().nullable(),avatar:n.string().url().nullable(),speciality:n.string().nullable(),collegiate_number:n.string().nullable(),is_dismissed:n.boolean(),languages:n.array(n.string()),description:n.string().nullable()}),to:n.object({id:n.number(),hash:n.string(),name:n.string().nullable(),avatar:n.string().url().nullable(),is_dismissed:n.boolean()}),speciality_id:n.number().nullable(),has_chat_in_appointment:n.boolean().optional(),created_at:n.string(),status:C,seconds_to_open:n.number().nonnegative(),start_date:n.string(),started_at:n.string().nullable(),expires_at:n.string().nullable(),consultation_reason:n.string().nullable(),preconsultation_documents:n.array(n.object({file_path:n.string(),file_name:n.string(),id:n.string().uuid()})).nullable(),service_id:n.string().uuid().nullable(),price:n.number().nullable().optional(),currency:n.string().nullable().optional(),discount_amount:n.number().nullable().optional()}),A=n.enum(["appointment","chat","immediate"]),T=A.enum;function j(t){return 0===t.seconds_to_open}function x(t){if(!t)return!1;const e=new Date,n=_(t);return b(n,e)}r({consultation_id:i(),consultation_type:A,rating:s().int().min(1).max(5),comment:i().nullable().optional()});var P=r({rating:s().int().optional(),comment:i().nullable().optional()}).passthrough();function k(t){return r({data:o(t),meta:r({current_page:s(),last_page:s(),per_page:s(),total:s()})})}var N=n.enum(["prescription","report","diagnosticTestPrescription"]),U=N.enum,L=n.enum(["published","draft"]);L.enum;var D=n.object({document_id:n.string().uuid(),document_type:N,name:n.string(),professional:n.object({speciality_id:n.number()}),status:L,url:n.string().url(),created_at:n.string()}),F=r({hash:i(),profile:r({first_name:i().nullable(),last_name:i().nullable(),birth_date:i().nullable(),gender:a(["male","female"]).nullable(),email:i().nullable(),phone_prefix:i().nullable(),phone:i().nullable(),billing:r({tax_id:i().nullable(),address:i().nullable(),country_code:i().nullable(),region:i().nullable(),postal_code:i().nullable()})})});function B(t){const e=t?.profile;return`${e?.first_name??""} ${e?.last_name??""}`.trim()}function I(t){return[t?.profile.first_name,t?.profile.last_name,t?.profile.email,t?.profile.phone,t?.profile.birth_date,t?.profile?.billing?.tax_id].every(t=>null!==t)}n.object({appointmentId:n.string()});var $=S;n.object({callId:n.string()});var M=n.object({session_id:n.string(),session_token:n.string()});n.object({professional_hash:n.string(),consultation_id:n.string(),consultation_type:n.enum(["appointment"])}),n.object({professional_hash:n.string(),consultation_id:n.string(),consultation_type:n.enum(["appointment"])}),n.object({appointment_id:n.string()});var q=n.array(D);n.object({url:n.string().url()}),n.object({first_name:F.shape.profile.shape.first_name,last_name:F.shape.profile.shape.last_name,tax_id:F.shape.profile.shape.billing.shape.tax_id,birth_date:F.shape.profile.shape.birth_date,gender:F.shape.profile.shape.gender.optional(),email:F.shape.profile.shape.email,phone_prefix:F.shape.profile.shape.phone_prefix,phone:F.shape.profile.shape.phone,terms_accepted:n.boolean(),privacy_accepted:n.boolean()}),n.object({patient_hash:n.string(),page:n.number().optional(),per_page:n.number().optional()});var z=k(D);r({slot_id:i().uuid(),service_id:i().uuid(),specialty_id:i(),consultation_reason:i().optional(),preconsultation_documents:o(r({file_path:i(),file_name:i()})).optional(),discount_code:i().optional(),return_url:i().url().optional()});var H=r({id:i(),percent_off:s(),code:i(),after_discount_amount:s().nullable()}),J=r({id:i(),percent_off:s(),code:i(),name:i().nullish()}),K={Addon:"addon",Stripe:"stripe"},W=r({session_id:i(),payment_link:i().url(),provider:l(K).optional()});r({video_call_schedule_id:i()});var V=W;r({professional_hash:i().uuid()});var X=W,G={Paid:"paid",Unpaid:"unpaid",Denied:"denied"},Z=r({status:l(G),consultation_id:i(),consultation_type:i()});r({order_id:i(),validation_url:i().url()});var Q=c(u());r({order_id:i(),token:i()});var Y=r({data:r({status:l(G),consultation_id:i(),consultation_type:i().optional()})});r({order_id:i(),token:i()});var tt=r({data:r({status:l(G),consultation_id:i(),consultation_type:i().optional()})}),et=n.array(n.object({id:n.number(),name:n.string(),code:n.string()})),nt=n.object({primary_color:n.string().nullable(),logo:n.string().nullable(),favicon:n.string().nullable(),support_professional:n.object({hash:n.string().nullable()}).optional(),home:n.object({title:n.string().nullable(),description:n.string().nullable(),image_url:n.string().nullable()}),appointments:n.object({reserve_conditions:n.string().nullable(),seconds_before_start_to_refund_on_cancel:n.number().nullable(),has_nps:n.boolean().optional(),has_chat_in_appointment:n.boolean().optional(),has_discount_coupons_show:n.boolean().optional(),payment_provider:n.nativeEnum(K).nullish()}),legal_consent:n.object({terms_url:n.string().nullable(),privacy_url:n.string().nullable()})}),rt=a(["monday","tuesday","wednesday","thursday","friday","saturday","sunday","working_week","weekend","all_week"]);rt.enum;var it=r({days_of_week:rt,from_time:i(),to_time:i()});r({hash:i().uuid()});var st=r({hash:i().uuid(),active_absence:r({id:i().uuid(),finishes_at:i()}).nullable(),avatar:i().url().nullable(),collegiate_number:i().nullable(),description:i().nullable(),is_available:d(),name:i(),overview:i().nullable(),schedule_description:i().nullable(),speciality_id:s().nullable(),status:a(["online","offline"]),title:i().nullable(),chat_schedule:r({channel:R,duration:s(),name:i(),timezone:i(),starts_at:i(),gaps:o(it)}).nullable()});function ot(t){return t.active_absence?"absent":"online"===t.status?"online":"offline"}a(["online","offline","absent"]),r({roomId:s()});var at=F;r({first_name:i(),last_name:i(),tax_id:i(),birth_date:i(),gender:a(["male","female"]),email:i(),phone_prefix:i(),phone:i(),terms_accepted:d(),privacy_accepted:d()}),r({terms_accepted:d(),privacy_accepted:d(),commercial_accepted:d()}),r({hash:i().uuid()});var lt=r({id:s(),hash:i().uuid(),speciality_alias:i(),name:i(),avatar:i().url(),description:i(),collegiate_number:i(),languages:o(i()),centers:o(r({id:i().uuid(),name:i()}))});p([f(1),f(2),f(3)]);var ct={Sent:1,Received:2,Read:3},ut=r({roomId:s(),messageId:i().uuid(),string:i(),status:s(),senderType:a(["ordinary","system"]),fromUserHash:i().uuid(),auto:p([f(0),f(1)]),createdAt:i().nullable(),deletedAt:i().nullable(),time:s().nullable()}),dt=r({file_name:i(),file_size:s(),url:i().url(),signed_url:i().url().nullable(),type:a(["uncategorized","voice_note"]),meta:r({duration:s()})}),pt=ut.extend({type:f("string"),attachment:h()}),ht=ut.extend({type:f("file"),attachment:dt}),ft=ut.extend({type:f("image"),attachment:dt});r({roomId:s()});var mt=o(p([pt,ht,ft]));r({roomId:s()});var gt=r({unread_count:s()});r({professional_hash:i()});var bt=r({room_id:s()}),yt=a(["available","reserved"]),_t=yt.enum,vt=r({id:i().uuid(),channel:R,duration:s(),starts_at:i(),finishes_at:i(),professional:r({id:i().uuid(),name:i()}),services:o(r({id:i().uuid(),name:i()})),speciality:r({id:s(),price:r({amount:s(),currency:i()}).nullish()}),status:yt}),wt=n.array(n.object({id:n.string().uuid(),name:n.string(),code:n.string(),channel:R,price:n.object({amount:n.number(),currency:n.string()}).nullable()})),Ct=n.array(n.object({id:n.string().uuid(),avatar:n.string().url().nullable(),description:n.string().nullable(),collegiate_number:n.string().nullable(),languages:n.array(n.string()),name:n.string(),slots:n.array(vt),speciality:n.object({id:n.number()}),tax_id:n.string().nullable()}));n.object({speciality_id:n.number(),organization_schedule_service_id:n.string().uuid(),closest_slots_days:n.number().optional(),slots_per_day:n.number().optional()}),n.object({service_id:n.string().uuid(),professional_hash:n.string().uuid(),starts_at:n.string(),finishes_at:n.string(),rescheduling_appointment_id:n.string().uuid().optional()});var Et=n.array(vt),Rt=n.array(n.object({id:n.number(),name:n.string(),code:n.string().nullish(),price:n.object({amount:n.number(),currency:n.string()}).nullable()}));n.object({slot_id:n.string().uuid(),service_id:n.string().uuid().optional(),speciality_id:n.number().optional()});var Ot=vt;r({status:o(C).optional(),order:r({field:a(["starts_at"]).optional(),direction:a(["asc","desc"]).optional()}).optional(),page:s().optional(),per_page:s().optional()});var St=k(r({appointment:r({id:i().uuid(),url:i().url(),starts_at:i(),duration:s(),status:C,channel:R,expires_at:i().nullable(),service_id:i().uuid().nullable(),has_chat_in_appointment:d().optional()}),room:r({id:s()}),price:r({amount:s(),currency:i()}).nullable(),patient:r({hash:i().uuid()}),slots:o(m()),professional:r({hash:i().uuid(),name:i(),avatar:i().url().optional(),description:i().optional(),languages:o(i()),collegiate_number:i().optional()}),speciality:r({id:s(),name:i()})}));r({slot_id:i().uuid(),service_id:i().uuid(),consultation_reason:i().optional(),preconsultation_documents:o(r({file_path:i(),file_name:i()})).optional(),discount_code:i().optional()});var At=r({appointment:r({id:i().uuid()})});r({id:i().uuid()});var Tt=S,jt=r({file_path:i(),presigned_storage_url:i().url()});r({id:i().uuid(),slot_id:i().uuid(),consultation_reason:i().optional(),preconsultation_documents:o(r({file_path:i(),file_name:i()})).optional()}),r({id:i().uuid()}),r({appointment_id:i().uuid(),consultation_reason:i().optional()}),r({appointment_id:i().uuid(),file_path:i(),file_name:i()}),r({appointment_id:i().uuid(),document_id:i().uuid()}),r({appointmentId:i().uuid()}),n.object({api_key:n.string(),token:n.string()});var xt=n.object({access_token:n.string(),patient:n.object({hash:n.string(),country_code:n.string(),timezone:n.string(),first_name:n.string(),last_name:n.string().nullable(),name:n.string(),birth_date:n.string().nullable(),email:n.string().email().nullable(),language_code:n.string(),phone:n.string(),phone_prefix:n.string(),tax_id:n.string().nullable(),legal_consent:n.object({accepted_at:n.string().nullable(),last_version_at:n.string().nullable(),terms_url:n.string(),privacy_url:n.string(),has_commercial_communications:n.boolean(),organization_name:n.string()})})});r({file:g(File)});var Pt=r({url:i().url()});function kt(t,e){return function(){return t.apply(e,arguments)}}const{toString:Nt}=Object.prototype,{getPrototypeOf:Ut}=Object,{iterator:Lt,toStringTag:Dt}=Symbol,Ft=(Bt=Object.create(null),t=>{const e=Nt.call(t);return Bt[e]||(Bt[e]=e.slice(8,-1).toLowerCase())});var Bt;const It=t=>(t=t.toLowerCase(),e=>Ft(e)===t),$t=t=>e=>typeof e===t,{isArray:Mt}=Array,qt=$t("undefined");function zt(t){return null!==t&&!qt(t)&&null!==t.constructor&&!qt(t.constructor)&&Kt(t.constructor.isBuffer)&&t.constructor.isBuffer(t)}const Ht=It("ArrayBuffer");const Jt=$t("string"),Kt=$t("function"),Wt=$t("number"),Vt=t=>null!==t&&"object"==typeof t,Xt=t=>{if("object"!==Ft(t))return!1;const e=Ut(t);return!(null!==e&&e!==Object.prototype&&null!==Object.getPrototypeOf(e)||Dt in t||Lt in t)},Gt=It("Date"),Zt=It("File"),Qt=It("Blob"),Yt=It("FileList"),te=It("URLSearchParams"),[ee,ne,re,ie]=["ReadableStream","Request","Response","Headers"].map(It);function se(t,e,{allOwnKeys:n=!1}={}){if(null==t)return;let r,i;if("object"!=typeof t&&(t=[t]),Mt(t))for(r=0,i=t.length;r<i;r++)e.call(null,t[r],r,t);else{if(zt(t))return;const i=n?Object.getOwnPropertyNames(t):Object.keys(t),s=i.length;let o;for(r=0;r<s;r++)o=i[r],e.call(null,t[o],o,t)}}function oe(t,e){if(zt(t))return null;e=e.toLowerCase();const n=Object.keys(t);let r,i=n.length;for(;i-- >0;)if(r=n[i],e===r.toLowerCase())return r;return null}const ae="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,le=t=>!qt(t)&&t!==ae;const ce=(ue="undefined"!=typeof Uint8Array&&Ut(Uint8Array),t=>ue&&t instanceof ue);var ue;const de=It("HTMLFormElement"),pe=(({hasOwnProperty:t})=>(e,n)=>t.call(e,n))(Object.prototype),he=It("RegExp"),fe=(t,e)=>{const n=Object.getOwnPropertyDescriptors(t),r={};se(n,(n,i)=>{let s;!1!==(s=e(n,i,t))&&(r[i]=s||n)}),Object.defineProperties(t,r)};const me=It("AsyncFunction"),ge=(be="function"==typeof setImmediate,ye=Kt(ae.postMessage),be?setImmediate:ye?(_e=`axios@${Math.random()}`,ve=[],ae.addEventListener("message",({source:t,data:e})=>{t===ae&&e===_e&&ve.length&&ve.shift()()},!1),t=>{ve.push(t),ae.postMessage(_e,"*")}):t=>setTimeout(t));var be,ye,_e,ve;const we="undefined"!=typeof queueMicrotask?queueMicrotask.bind(ae):"undefined"!=typeof process&&process.nextTick||ge;var Ce={isArray:Mt,isArrayBuffer:Ht,isBuffer:zt,isFormData:t=>{let e;return t&&("function"==typeof FormData&&t instanceof FormData||Kt(t.append)&&("formdata"===(e=Ft(t))||"object"===e&&Kt(t.toString)&&"[object FormData]"===t.toString()))},isArrayBufferView:function(t){let e;return e="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&Ht(t.buffer),e},isString:Jt,isNumber:Wt,isBoolean:t=>!0===t||!1===t,isObject:Vt,isPlainObject:Xt,isEmptyObject:t=>{if(!Vt(t)||zt(t))return!1;try{return 0===Object.keys(t).length&&Object.getPrototypeOf(t)===Object.prototype}catch(t){return!1}},isReadableStream:ee,isRequest:ne,isResponse:re,isHeaders:ie,isUndefined:qt,isDate:Gt,isFile:Zt,isBlob:Qt,isRegExp:he,isFunction:Kt,isStream:t=>Vt(t)&&Kt(t.pipe),isURLSearchParams:te,isTypedArray:ce,isFileList:Yt,forEach:se,merge:function t(){const{caseless:e}=le(this)&&this||{},n={},r=(r,i)=>{const s=e&&oe(n,i)||i;Xt(n[s])&&Xt(r)?n[s]=t(n[s],r):Xt(r)?n[s]=t({},r):Mt(r)?n[s]=r.slice():n[s]=r};for(let t=0,e=arguments.length;t<e;t++)arguments[t]&&se(arguments[t],r);return n},extend:(t,e,n,{allOwnKeys:r}={})=>(se(e,(e,r)=>{n&&Kt(e)?t[r]=kt(e,n):t[r]=e},{allOwnKeys:r}),t),trim:t=>t.trim?t.trim():t.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:t=>(65279===t.charCodeAt(0)&&(t=t.slice(1)),t),inherits:(t,e,n,r)=>{t.prototype=Object.create(e.prototype,r),t.prototype.constructor=t,Object.defineProperty(t,"super",{value:e.prototype}),n&&Object.assign(t.prototype,n)},toFlatObject:(t,e,n,r)=>{let i,s,o;const a={};if(e=e||{},null==t)return e;do{for(i=Object.getOwnPropertyNames(t),s=i.length;s-- >0;)o=i[s],r&&!r(o,t,e)||a[o]||(e[o]=t[o],a[o]=!0);t=!1!==n&&Ut(t)}while(t&&(!n||n(t,e))&&t!==Object.prototype);return e},kindOf:Ft,kindOfTest:It,endsWith:(t,e,n)=>{t=String(t),(void 0===n||n>t.length)&&(n=t.length),n-=e.length;const r=t.indexOf(e,n);return-1!==r&&r===n},toArray:t=>{if(!t)return null;if(Mt(t))return t;let e=t.length;if(!Wt(e))return null;const n=new Array(e);for(;e-- >0;)n[e]=t[e];return n},forEachEntry:(t,e)=>{const n=(t&&t[Lt]).call(t);let r;for(;(r=n.next())&&!r.done;){const n=r.value;e.call(t,n[0],n[1])}},matchAll:(t,e)=>{let n;const r=[];for(;null!==(n=t.exec(e));)r.push(n);return r},isHTMLForm:de,hasOwnProperty:pe,hasOwnProp:pe,reduceDescriptors:fe,freezeMethods:t=>{fe(t,(e,n)=>{if(Kt(t)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=t[n];Kt(r)&&(e.enumerable=!1,"writable"in e?e.writable=!1:e.set||(e.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))})},toObjectSet:(t,e)=>{const n={},r=t=>{t.forEach(t=>{n[t]=!0})};return Mt(t)?r(t):r(String(t).split(e)),n},toCamelCase:t=>t.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(t,e,n){return e.toUpperCase()+n}),noop:()=>{},toFiniteNumber:(t,e)=>null!=t&&Number.isFinite(t=+t)?t:e,findKey:oe,global:ae,isContextDefined:le,isSpecCompliantForm:function(t){return!!(t&&Kt(t.append)&&"FormData"===t[Dt]&&t[Lt])},toJSONObject:t=>{const e=new Array(10),n=(t,r)=>{if(Vt(t)){if(e.indexOf(t)>=0)return;if(zt(t))return t;if(!("toJSON"in t)){e[r]=t;const i=Mt(t)?[]:{};return se(t,(t,e)=>{const s=n(t,r+1);!qt(s)&&(i[e]=s)}),e[r]=void 0,i}}return t};return n(t,0)},isAsyncFn:me,isThenable:t=>t&&(Vt(t)||Kt(t))&&Kt(t.then)&&Kt(t.catch),setImmediate:ge,asap:we,isIterable:t=>null!=t&&Kt(t[Lt])};function Ee(t,e,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=t,this.name="AxiosError",e&&(this.code=e),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i,this.status=i.status?i.status:null)}Ce.inherits(Ee,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:Ce.toJSONObject(this.config),code:this.code,status:this.status}}});const Re=Ee.prototype,Oe={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(t=>{Oe[t]={value:t}}),Object.defineProperties(Ee,Oe),Object.defineProperty(Re,"isAxiosError",{value:!0}),Ee.from=(t,e,n,r,i,s)=>{const o=Object.create(Re);return Ce.toFlatObject(t,o,function(t){return t!==Error.prototype},t=>"isAxiosError"!==t),Ee.call(o,t.message,e,n,r,i),o.cause=t,o.name=t.name,s&&Object.assign(o,s),o};function Se(t){return Ce.isPlainObject(t)||Ce.isArray(t)}function Ae(t){return Ce.endsWith(t,"[]")?t.slice(0,-2):t}function Te(t,e,n){return t?t.concat(e).map(function(t,e){return t=Ae(t),!n&&e?"["+t+"]":t}).join(n?".":""):e}const je=Ce.toFlatObject(Ce,{},null,function(t){return/^is[A-Z]/.test(t)});function xe(t,e,n){if(!Ce.isObject(t))throw new TypeError("target must be an object");e=e||new FormData;const r=(n=Ce.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(t,e){return!Ce.isUndefined(e[t])})).metaTokens,i=n.visitor||c,s=n.dots,o=n.indexes,a=(n.Blob||"undefined"!=typeof Blob&&Blob)&&Ce.isSpecCompliantForm(e);if(!Ce.isFunction(i))throw new TypeError("visitor must be a function");function l(t){if(null===t)return"";if(Ce.isDate(t))return t.toISOString();if(Ce.isBoolean(t))return t.toString();if(!a&&Ce.isBlob(t))throw new Ee("Blob is not supported. Use a Buffer instead.");return Ce.isArrayBuffer(t)||Ce.isTypedArray(t)?a&&"function"==typeof Blob?new Blob([t]):Buffer.from(t):t}function c(t,n,i){let a=t;if(t&&!i&&"object"==typeof t)if(Ce.endsWith(n,"{}"))n=r?n:n.slice(0,-2),t=JSON.stringify(t);else if(Ce.isArray(t)&&function(t){return Ce.isArray(t)&&!t.some(Se)}(t)||(Ce.isFileList(t)||Ce.endsWith(n,"[]"))&&(a=Ce.toArray(t)))return n=Ae(n),a.forEach(function(t,r){!Ce.isUndefined(t)&&null!==t&&e.append(!0===o?Te([n],r,s):null===o?n:n+"[]",l(t))}),!1;return!!Se(t)||(e.append(Te(i,n,s),l(t)),!1)}const u=[],d=Object.assign(je,{defaultVisitor:c,convertValue:l,isVisitable:Se});if(!Ce.isObject(t))throw new TypeError("data must be an object");return function t(n,r){if(!Ce.isUndefined(n)){if(-1!==u.indexOf(n))throw Error("Circular reference detected in "+r.join("."));u.push(n),Ce.forEach(n,function(n,s){!0===(!(Ce.isUndefined(n)||null===n)&&i.call(e,n,Ce.isString(s)?s.trim():s,r,d))&&t(n,r?r.concat(s):[s])}),u.pop()}}(t),e}function Pe(t){const e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'()~]|%20|%00/g,function(t){return e[t]})}function ke(t,e){this._pairs=[],t&&xe(t,this,e)}const Ne=ke.prototype;function Ue(t){return encodeURIComponent(t).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Le(t,e,n){if(!e)return t;const r=n&&n.encode||Ue;Ce.isFunction(n)&&(n={serialize:n});const i=n&&n.serialize;let s;if(s=i?i(e,n):Ce.isURLSearchParams(e)?e.toString():new ke(e,n).toString(r),s){const e=t.indexOf("#");-1!==e&&(t=t.slice(0,e)),t+=(-1===t.indexOf("?")?"?":"&")+s}return t}Ne.append=function(t,e){this._pairs.push([t,e])},Ne.toString=function(t){const e=t?function(e){return t.call(this,e,Pe)}:Pe;return this._pairs.map(function(t){return e(t[0])+"="+e(t[1])},"").join("&")};class InterceptorManager{constructor(){this.handlers=[]}use(t,e,n){return this.handlers.push({fulfilled:t,rejected:e,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){Ce.forEach(this.handlers,function(e){null!==e&&t(e)})}}var De={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Fe={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:ke,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};const Be="undefined"!=typeof window&&"undefined"!=typeof document,Ie="object"==typeof navigator&&navigator||void 0,$e=Be&&(!Ie||["ReactNative","NativeScript","NS"].indexOf(Ie.product)<0),Me="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,qe=Be&&window.location.href||"http://localhost";var ze={...Object.freeze({__proto__:null,hasBrowserEnv:Be,hasStandardBrowserEnv:$e,hasStandardBrowserWebWorkerEnv:Me,navigator:Ie,origin:qe}),...Fe};function He(t){function e(t,n,r,i){let s=t[i++];if("__proto__"===s)return!0;const o=Number.isFinite(+s),a=i>=t.length;if(s=!s&&Ce.isArray(r)?r.length:s,a)return Ce.hasOwnProp(r,s)?r[s]=[r[s],n]:r[s]=n,!o;r[s]&&Ce.isObject(r[s])||(r[s]=[]);return e(t,n,r[s],i)&&Ce.isArray(r[s])&&(r[s]=function(t){const e={},n=Object.keys(t);let r;const i=n.length;let s;for(r=0;r<i;r++)s=n[r],e[s]=t[s];return e}(r[s])),!o}if(Ce.isFormData(t)&&Ce.isFunction(t.entries)){const n={};return Ce.forEachEntry(t,(t,r)=>{e(function(t){return Ce.matchAll(/\w+|\[(\w*)]/g,t).map(t=>"[]"===t[0]?"":t[1]||t[0])}(t),r,n,0)}),n}return null}const Je={transitional:De,adapter:["xhr","http","fetch"],transformRequest:[function(t,e){const n=e.getContentType()||"",r=n.indexOf("application/json")>-1,i=Ce.isObject(t);i&&Ce.isHTMLForm(t)&&(t=new FormData(t));if(Ce.isFormData(t))return r?JSON.stringify(He(t)):t;if(Ce.isArrayBuffer(t)||Ce.isBuffer(t)||Ce.isStream(t)||Ce.isFile(t)||Ce.isBlob(t)||Ce.isReadableStream(t))return t;if(Ce.isArrayBufferView(t))return t.buffer;if(Ce.isURLSearchParams(t))return e.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let s;if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(t,e){return xe(t,new ze.classes.URLSearchParams,{visitor:function(t,e,n,r){return ze.isNode&&Ce.isBuffer(t)?(this.append(e,t.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...e})}(t,this.formSerializer).toString();if((s=Ce.isFileList(t))||n.indexOf("multipart/form-data")>-1){const e=this.env&&this.env.FormData;return xe(s?{"files[]":t}:t,e&&new e,this.formSerializer)}}return i||r?(e.setContentType("application/json",!1),function(t,e,n){if(Ce.isString(t))try{return(e||JSON.parse)(t),Ce.trim(t)}catch(t){if("SyntaxError"!==t.name)throw t}return(n||JSON.stringify)(t)}(t)):t}],transformResponse:[function(t){const e=this.transitional||Je.transitional,n=e&&e.forcedJSONParsing,r="json"===this.responseType;if(Ce.isResponse(t)||Ce.isReadableStream(t))return t;if(t&&Ce.isString(t)&&(n&&!this.responseType||r)){const n=!(e&&e.silentJSONParsing)&&r;try{return JSON.parse(t)}catch(t){if(n){if("SyntaxError"===t.name)throw Ee.from(t,Ee.ERR_BAD_RESPONSE,this,null,this.response);throw t}}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ze.classes.FormData,Blob:ze.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};Ce.forEach(["delete","get","head","post","put","patch"],t=>{Je.headers[t]={}});const Ke=Ce.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);const We=Symbol("internals");function Ve(t){return t&&String(t).trim().toLowerCase()}function Xe(t){return!1===t||null==t?t:Ce.isArray(t)?t.map(Xe):String(t)}function Ge(t,e,n,r,i){return Ce.isFunction(r)?r.call(this,e,n):(i&&(e=n),Ce.isString(e)?Ce.isString(r)?-1!==e.indexOf(r):Ce.isRegExp(r)?r.test(e):void 0:void 0)}let Ze=class AxiosHeaders{constructor(t){t&&this.set(t)}set(t,e,n){const r=this;function i(t,e,n){const i=Ve(e);if(!i)throw new Error("header name must be a non-empty string");const s=Ce.findKey(r,i);(!s||void 0===r[s]||!0===n||void 0===n&&!1!==r[s])&&(r[s||e]=Xe(t))}const s=(t,e)=>Ce.forEach(t,(t,n)=>i(t,n,e));if(Ce.isPlainObject(t)||t instanceof this.constructor)s(t,e);else if(Ce.isString(t)&&(t=t.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(t.trim()))s((t=>{const e={};let n,r,i;return t&&t.split("\n").forEach(function(t){i=t.indexOf(":"),n=t.substring(0,i).trim().toLowerCase(),r=t.substring(i+1).trim(),!n||e[n]&&Ke[n]||("set-cookie"===n?e[n]?e[n].push(r):e[n]=[r]:e[n]=e[n]?e[n]+", "+r:r)}),e})(t),e);else if(Ce.isObject(t)&&Ce.isIterable(t)){let n,r,i={};for(const e of t){if(!Ce.isArray(e))throw TypeError("Object iterator must return a key-value pair");i[r=e[0]]=(n=i[r])?Ce.isArray(n)?[...n,e[1]]:[n,e[1]]:e[1]}s(i,e)}else null!=t&&i(e,t,n);return this}get(t,e){if(t=Ve(t)){const n=Ce.findKey(this,t);if(n){const t=this[n];if(!e)return t;if(!0===e)return function(t){const e=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(t);)e[r[1]]=r[2];return e}(t);if(Ce.isFunction(e))return e.call(this,t,n);if(Ce.isRegExp(e))return e.exec(t);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,e){if(t=Ve(t)){const n=Ce.findKey(this,t);return!(!n||void 0===this[n]||e&&!Ge(0,this[n],n,e))}return!1}delete(t,e){const n=this;let r=!1;function i(t){if(t=Ve(t)){const i=Ce.findKey(n,t);!i||e&&!Ge(0,n[i],i,e)||(delete n[i],r=!0)}}return Ce.isArray(t)?t.forEach(i):i(t),r}clear(t){const e=Object.keys(this);let n=e.length,r=!1;for(;n--;){const i=e[n];t&&!Ge(0,this[i],i,t,!0)||(delete this[i],r=!0)}return r}normalize(t){const e=this,n={};return Ce.forEach(this,(r,i)=>{const s=Ce.findKey(n,i);if(s)return e[s]=Xe(r),void delete e[i];const o=t?function(t){return t.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,e,n)=>e.toUpperCase()+n)}(i):String(i).trim();o!==i&&delete e[i],e[o]=Xe(r),n[o]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const e=Object.create(null);return Ce.forEach(this,(n,r)=>{null!=n&&!1!==n&&(e[r]=t&&Ce.isArray(n)?n.join(", "):n)}),e}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,e])=>t+": "+e).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...e){const n=new this(t);return e.forEach(t=>n.set(t)),n}static accessor(t){const e=(this[We]=this[We]={accessors:{}}).accessors,n=this.prototype;function r(t){const r=Ve(t);e[r]||(!function(t,e){const n=Ce.toCamelCase(" "+e);["get","set","has"].forEach(r=>{Object.defineProperty(t,r+n,{value:function(t,n,i){return this[r].call(this,e,t,n,i)},configurable:!0})})}(n,t),e[r]=!0)}return Ce.isArray(t)?t.forEach(r):r(t),this}};function Qe(t,e){const n=this||Je,r=e||n,i=Ze.from(r.headers);let s=r.data;return Ce.forEach(t,function(t){s=t.call(n,s,i.normalize(),e?e.status:void 0)}),i.normalize(),s}function Ye(t){return!(!t||!t.__CANCEL__)}function tn(t,e,n){Ee.call(this,t??"canceled",Ee.ERR_CANCELED,e,n),this.name="CanceledError"}function en(t,e,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?e(new Ee("Request failed with status code "+n.status,[Ee.ERR_BAD_REQUEST,Ee.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):t(n)}Ze.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Ce.reduceDescriptors(Ze.prototype,({value:t},e)=>{let n=e[0].toUpperCase()+e.slice(1);return{get:()=>t,set(t){this[n]=t}}}),Ce.freezeMethods(Ze),Ce.inherits(tn,Ee,{__CANCEL__:!0});const nn=(t,e,n=3)=>{let r=0;const i=function(t,e){t=t||10;const n=new Array(t),r=new Array(t);let i,s=0,o=0;return e=void 0!==e?e:1e3,function(a){const l=Date.now(),c=r[o];i||(i=l),n[s]=a,r[s]=l;let u=o,d=0;for(;u!==s;)d+=n[u++],u%=t;if(s=(s+1)%t,s===o&&(o=(o+1)%t),l-i<e)return;const p=c&&l-c;return p?Math.round(1e3*d/p):void 0}}(50,250);return function(t,e){let n,r,i=0,s=1e3/e;const o=(e,s=Date.now())=>{i=s,n=null,r&&(clearTimeout(r),r=null),t(...e)};return[(...t)=>{const e=Date.now(),a=e-i;a>=s?o(t,e):(n=t,r||(r=setTimeout(()=>{r=null,o(n)},s-a)))},()=>n&&o(n)]}(n=>{const s=n.loaded,o=n.lengthComputable?n.total:void 0,a=s-r,l=i(a);r=s;t({loaded:s,total:o,progress:o?s/o:void 0,bytes:a,rate:l||void 0,estimated:l&&o&&s<=o?(o-s)/l:void 0,event:n,lengthComputable:null!=o,[e?"download":"upload"]:!0})},n)},rn=(t,e)=>{const n=null!=t;return[r=>e[0]({lengthComputable:n,total:t,loaded:r}),e[1]]},sn=t=>(...e)=>Ce.asap(()=>t(...e));var on=ze.hasStandardBrowserEnv?((t,e)=>n=>(n=new URL(n,ze.origin),t.protocol===n.protocol&&t.host===n.host&&(e||t.port===n.port)))(new URL(ze.origin),ze.navigator&&/(msie|trident)/i.test(ze.navigator.userAgent)):()=>!0,an=ze.hasStandardBrowserEnv?{write(t,e,n,r,i,s){const o=[t+"="+encodeURIComponent(e)];Ce.isNumber(n)&&o.push("expires="+new Date(n).toGMTString()),Ce.isString(r)&&o.push("path="+r),Ce.isString(i)&&o.push("domain="+i),!0===s&&o.push("secure"),document.cookie=o.join("; ")},read(t){const e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove(t){this.write(t,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function ln(t,e,n){let r=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e);return t&&(r||0==n)?function(t,e){return e?t.replace(/\/?\/$/,"")+"/"+e.replace(/^\/+/,""):t}(t,e):e}const cn=t=>t instanceof Ze?{...t}:t;function un(t,e){e=e||{};const n={};function r(t,e,n,r){return Ce.isPlainObject(t)&&Ce.isPlainObject(e)?Ce.merge.call({caseless:r},t,e):Ce.isPlainObject(e)?Ce.merge({},e):Ce.isArray(e)?e.slice():e}function i(t,e,n,i){return Ce.isUndefined(e)?Ce.isUndefined(t)?void 0:r(void 0,t,0,i):r(t,e,0,i)}function s(t,e){if(!Ce.isUndefined(e))return r(void 0,e)}function o(t,e){return Ce.isUndefined(e)?Ce.isUndefined(t)?void 0:r(void 0,t):r(void 0,e)}function a(n,i,s){return s in e?r(n,i):s in t?r(void 0,n):void 0}const l={url:s,method:s,data:s,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a,headers:(t,e,n)=>i(cn(t),cn(e),0,!0)};return Ce.forEach(Object.keys({...t,...e}),function(r){const s=l[r]||i,o=s(t[r],e[r],r);Ce.isUndefined(o)&&s!==a||(n[r]=o)}),n}var dn=t=>{const e=un({},t);let n,{data:r,withXSRFToken:i,xsrfHeaderName:s,xsrfCookieName:o,headers:a,auth:l}=e;if(e.headers=a=Ze.from(a),e.url=Le(ln(e.baseURL,e.url,e.allowAbsoluteUrls),t.params,t.paramsSerializer),l&&a.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),Ce.isFormData(r))if(ze.hasStandardBrowserEnv||ze.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(!1!==(n=a.getContentType())){const[t,...e]=n?n.split(";").map(t=>t.trim()).filter(Boolean):[];a.setContentType([t||"multipart/form-data",...e].join("; "))}if(ze.hasStandardBrowserEnv&&(i&&Ce.isFunction(i)&&(i=i(e)),i||!1!==i&&on(e.url))){const t=s&&o&&an.read(o);t&&a.set(s,t)}return e};var pn="undefined"!=typeof XMLHttpRequest&&function(t){return new Promise(function(e,n){const r=dn(t);let i=r.data;const s=Ze.from(r.headers).normalize();let o,a,l,c,u,{responseType:d,onUploadProgress:p,onDownloadProgress:h}=r;function f(){c&&c(),u&&u(),r.cancelToken&&r.cancelToken.unsubscribe(o),r.signal&&r.signal.removeEventListener("abort",o)}let m=new XMLHttpRequest;function g(){if(!m)return;const r=Ze.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders());en(function(t){e(t),f()},function(t){n(t),f()},{data:d&&"text"!==d&&"json"!==d?m.response:m.responseText,status:m.status,statusText:m.statusText,headers:r,config:t,request:m}),m=null}m.open(r.method.toUpperCase(),r.url,!0),m.timeout=r.timeout,"onloadend"in m?m.onloadend=g:m.onreadystatechange=function(){m&&4===m.readyState&&(0!==m.status||m.responseURL&&0===m.responseURL.indexOf("file:"))&&setTimeout(g)},m.onabort=function(){m&&(n(new Ee("Request aborted",Ee.ECONNABORTED,t,m)),m=null)},m.onerror=function(){n(new Ee("Network Error",Ee.ERR_NETWORK,t,m)),m=null},m.ontimeout=function(){let e=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const i=r.transitional||De;r.timeoutErrorMessage&&(e=r.timeoutErrorMessage),n(new Ee(e,i.clarifyTimeoutError?Ee.ETIMEDOUT:Ee.ECONNABORTED,t,m)),m=null},void 0===i&&s.setContentType(null),"setRequestHeader"in m&&Ce.forEach(s.toJSON(),function(t,e){m.setRequestHeader(e,t)}),Ce.isUndefined(r.withCredentials)||(m.withCredentials=!!r.withCredentials),d&&"json"!==d&&(m.responseType=r.responseType),h&&([l,u]=nn(h,!0),m.addEventListener("progress",l)),p&&m.upload&&([a,c]=nn(p),m.upload.addEventListener("progress",a),m.upload.addEventListener("loadend",c)),(r.cancelToken||r.signal)&&(o=e=>{m&&(n(!e||e.type?new tn(null,t,m):e),m.abort(),m=null)},r.cancelToken&&r.cancelToken.subscribe(o),r.signal&&(r.signal.aborted?o():r.signal.addEventListener("abort",o)));const b=function(t){const e=/^([-+\w]{1,25})(:?\/\/|:)/.exec(t);return e&&e[1]||""}(r.url);b&&-1===ze.protocols.indexOf(b)?n(new Ee("Unsupported protocol "+b+":",Ee.ERR_BAD_REQUEST,t)):m.send(i||null)})};const hn=(t,e)=>{const{length:n}=t=t?t.filter(Boolean):[];if(e||n){let n,r=new AbortController;const i=function(t){if(!n){n=!0,o();const e=t instanceof Error?t:this.reason;r.abort(e instanceof Ee?e:new tn(e instanceof Error?e.message:e))}};let s=e&&setTimeout(()=>{s=null,i(new Ee(`timeout ${e} of ms exceeded`,Ee.ETIMEDOUT))},e);const o=()=>{t&&(s&&clearTimeout(s),s=null,t.forEach(t=>{t.unsubscribe?t.unsubscribe(i):t.removeEventListener("abort",i)}),t=null)};t.forEach(t=>t.addEventListener("abort",i));const{signal:a}=r;return a.unsubscribe=()=>Ce.asap(o),a}},fn=function*(t,e){let n=t.byteLength;if(n<e)return void(yield t);let r,i=0;for(;i<n;)r=i+e,yield t.slice(i,r),i=r},mn=async function*(t){if(t[Symbol.asyncIterator])return void(yield*t);const e=t.getReader();try{for(;;){const{done:t,value:n}=await e.read();if(t)break;yield n}}finally{await e.cancel()}},gn=(t,e,n,r)=>{const i=async function*(t,e){for await(const n of mn(t))yield*fn(n,e)}(t,e);let s,o=0,a=t=>{s||(s=!0,r&&r(t))};return new ReadableStream({async pull(t){try{const{done:e,value:r}=await i.next();if(e)return a(),void t.close();let s=r.byteLength;if(n){let t=o+=s;n(t)}t.enqueue(new Uint8Array(r))}catch(t){throw a(t),t}},cancel:t=>(a(t),i.return())},{highWaterMark:2})},bn="function"==typeof fetch&&"function"==typeof Request&&"function"==typeof Response,yn=bn&&"function"==typeof ReadableStream,_n=bn&&("function"==typeof TextEncoder?(vn=new TextEncoder,t=>vn.encode(t)):async t=>new Uint8Array(await new Response(t).arrayBuffer()));var vn;const wn=(t,...e)=>{try{return!!t(...e)}catch(t){return!1}},Cn=yn&&wn(()=>{let t=!1;const e=new Request(ze.origin,{body:new ReadableStream,method:"POST",get duplex(){return t=!0,"half"}}).headers.has("Content-Type");return t&&!e}),En=yn&&wn(()=>Ce.isReadableStream(new Response("").body)),Rn={stream:En&&(t=>t.body)};var On;bn&&(On=new Response,["text","arrayBuffer","blob","formData","stream"].forEach(t=>{!Rn[t]&&(Rn[t]=Ce.isFunction(On[t])?e=>e[t]():(e,n)=>{throw new Ee(`Response type '${t}' is not supported`,Ee.ERR_NOT_SUPPORT,n)})}));const Sn=async(t,e)=>{const n=Ce.toFiniteNumber(t.getContentLength());return n??(async t=>{if(null==t)return 0;if(Ce.isBlob(t))return t.size;if(Ce.isSpecCompliantForm(t)){const e=new Request(ze.origin,{method:"POST",body:t});return(await e.arrayBuffer()).byteLength}return Ce.isArrayBufferView(t)||Ce.isArrayBuffer(t)?t.byteLength:(Ce.isURLSearchParams(t)&&(t+=""),Ce.isString(t)?(await _n(t)).byteLength:void 0)})(e)};const An={http:null,xhr:pn,fetch:bn&&(async t=>{let{url:e,method:n,data:r,signal:i,cancelToken:s,timeout:o,onDownloadProgress:a,onUploadProgress:l,responseType:c,headers:u,withCredentials:d="same-origin",fetchOptions:p}=dn(t);c=c?(c+"").toLowerCase():"text";let h,f=hn([i,s&&s.toAbortSignal()],o);const m=f&&f.unsubscribe&&(()=>{f.unsubscribe()});let g;try{if(l&&Cn&&"get"!==n&&"head"!==n&&0!==(g=await Sn(u,r))){let t,n=new Request(e,{method:"POST",body:r,duplex:"half"});if(Ce.isFormData(r)&&(t=n.headers.get("content-type"))&&u.setContentType(t),n.body){const[t,e]=rn(g,nn(sn(l)));r=gn(n.body,65536,t,e)}}Ce.isString(d)||(d=d?"include":"omit");const i="credentials"in Request.prototype;h=new Request(e,{...p,signal:f,method:n.toUpperCase(),headers:u.normalize().toJSON(),body:r,duplex:"half",credentials:i?d:void 0});let s=await fetch(h,p);const o=En&&("stream"===c||"response"===c);if(En&&(a||o&&m)){const t={};["status","statusText","headers"].forEach(e=>{t[e]=s[e]});const e=Ce.toFiniteNumber(s.headers.get("content-length")),[n,r]=a&&rn(e,nn(sn(a),!0))||[];s=new Response(gn(s.body,65536,n,()=>{r&&r(),m&&m()}),t)}c=c||"text";let b=await Rn[Ce.findKey(Rn,c)||"text"](s,t);return!o&&m&&m(),await new Promise((e,n)=>{en(e,n,{data:b,headers:Ze.from(s.headers),status:s.status,statusText:s.statusText,config:t,request:h})})}catch(e){if(m&&m(),e&&"TypeError"===e.name&&/Load failed|fetch/i.test(e.message))throw Object.assign(new Ee("Network Error",Ee.ERR_NETWORK,t,h),{cause:e.cause||e});throw Ee.from(e,e&&e.code,t,h)}})};Ce.forEach(An,(t,e)=>{if(t){try{Object.defineProperty(t,"name",{value:e})}catch(t){}Object.defineProperty(t,"adapterName",{value:e})}});const Tn=t=>`- ${t}`,jn=t=>Ce.isFunction(t)||null===t||!1===t;var xn=t=>{t=Ce.isArray(t)?t:[t];const{length:e}=t;let n,r;const i={};for(let s=0;s<e;s++){let e;if(n=t[s],r=n,!jn(n)&&(r=An[(e=String(n)).toLowerCase()],void 0===r))throw new Ee(`Unknown adapter '${e}'`);if(r)break;i[e||"#"+s]=r}if(!r){const t=Object.entries(i).map(([t,e])=>`adapter ${t} `+(!1===e?"is not supported by the environment":"is not available in the build"));throw new Ee("There is no suitable adapter to dispatch the request "+(e?t.length>1?"since :\n"+t.map(Tn).join("\n"):" "+Tn(t[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return r};function Pn(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new tn(null,t)}function kn(t){Pn(t),t.headers=Ze.from(t.headers),t.data=Qe.call(t,t.transformRequest),-1!==["post","put","patch"].indexOf(t.method)&&t.headers.setContentType("application/x-www-form-urlencoded",!1);return xn(t.adapter||Je.adapter)(t).then(function(e){return Pn(t),e.data=Qe.call(t,t.transformResponse,e),e.headers=Ze.from(e.headers),e},function(e){return Ye(e)||(Pn(t),e&&e.response&&(e.response.data=Qe.call(t,t.transformResponse,e.response),e.response.headers=Ze.from(e.response.headers))),Promise.reject(e)})}const Nn="1.11.0",Un={};["object","boolean","number","function","string","symbol"].forEach((t,e)=>{Un[t]=function(n){return typeof n===t||"a"+(e<1?"n ":" ")+t}});const Ln={};Un.transitional=function(t,e,n){function r(t,e){return"[Axios v"+Nn+"] Transitional option '"+t+"'"+e+(n?". "+n:"")}return(n,i,s)=>{if(!1===t)throw new Ee(r(i," has been removed"+(e?" in "+e:"")),Ee.ERR_DEPRECATED);return e&&!Ln[i]&&(Ln[i]=!0,console.warn(r(i," has been deprecated since v"+e+" and will be removed in the near future"))),!t||t(n,i,s)}},Un.spelling=function(t){return(e,n)=>(console.warn(`${n} is likely a misspelling of ${t}`),!0)};var Dn={assertOptions:function(t,e,n){if("object"!=typeof t)throw new Ee("options must be an object",Ee.ERR_BAD_OPTION_VALUE);const r=Object.keys(t);let i=r.length;for(;i-- >0;){const s=r[i],o=e[s];if(o){const e=t[s],n=void 0===e||o(e,s,t);if(!0!==n)throw new Ee("option "+s+" must be "+n,Ee.ERR_BAD_OPTION_VALUE);continue}if(!0!==n)throw new Ee("Unknown option "+s,Ee.ERR_BAD_OPTION)}},validators:Un};const Fn=Dn.validators;let Bn=class Axios{constructor(t){this.defaults=t||{},this.interceptors={request:new InterceptorManager,response:new InterceptorManager}}async request(t,e){try{return await this._request(t,e)}catch(t){if(t instanceof Error){let e={};Error.captureStackTrace?Error.captureStackTrace(e):e=new Error;const n=e.stack?e.stack.replace(/^.+\n/,""):"";try{t.stack?n&&!String(t.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(t.stack+="\n"+n):t.stack=n}catch(t){}}throw t}}_request(t,e){"string"==typeof t?(e=e||{}).url=t:e=t||{},e=un(this.defaults,e);const{transitional:n,paramsSerializer:r,headers:i}=e;void 0!==n&&Dn.assertOptions(n,{silentJSONParsing:Fn.transitional(Fn.boolean),forcedJSONParsing:Fn.transitional(Fn.boolean),clarifyTimeoutError:Fn.transitional(Fn.boolean)},!1),null!=r&&(Ce.isFunction(r)?e.paramsSerializer={serialize:r}:Dn.assertOptions(r,{encode:Fn.function,serialize:Fn.function},!0)),void 0!==e.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?e.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:e.allowAbsoluteUrls=!0),Dn.assertOptions(e,{baseUrl:Fn.spelling("baseURL"),withXsrfToken:Fn.spelling("withXSRFToken")},!0),e.method=(e.method||this.defaults.method||"get").toLowerCase();let s=i&&Ce.merge(i.common,i[e.method]);i&&Ce.forEach(["delete","get","head","post","put","patch","common"],t=>{delete i[t]}),e.headers=Ze.concat(s,i);const o=[];let a=!0;this.interceptors.request.forEach(function(t){"function"==typeof t.runWhen&&!1===t.runWhen(e)||(a=a&&t.synchronous,o.unshift(t.fulfilled,t.rejected))});const l=[];let c;this.interceptors.response.forEach(function(t){l.push(t.fulfilled,t.rejected)});let u,d=0;if(!a){const t=[kn.bind(this),void 0];for(t.unshift(...o),t.push(...l),u=t.length,c=Promise.resolve(e);d<u;)c=c.then(t[d++],t[d++]);return c}u=o.length;let p=e;for(d=0;d<u;){const t=o[d++],e=o[d++];try{p=t(p)}catch(t){e.call(this,t);break}}try{c=kn.call(this,p)}catch(t){return Promise.reject(t)}for(d=0,u=l.length;d<u;)c=c.then(l[d++],l[d++]);return c}getUri(t){return Le(ln((t=un(this.defaults,t)).baseURL,t.url,t.allowAbsoluteUrls),t.params,t.paramsSerializer)}};Ce.forEach(["delete","get","head","options"],function(t){Bn.prototype[t]=function(e,n){return this.request(un(n||{},{method:t,url:e,data:(n||{}).data}))}}),Ce.forEach(["post","put","patch"],function(t){function e(e){return function(n,r,i){return this.request(un(i||{},{method:t,headers:e?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}Bn.prototype[t]=e(),Bn.prototype[t+"Form"]=e(!0)});const In={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(In).forEach(([t,e])=>{In[e]=t});const $n=function t(e){const n=new Bn(e),r=kt(Bn.prototype.request,n);return Ce.extend(r,Bn.prototype,n,{allOwnKeys:!0}),Ce.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return t(un(e,n))},r}(Je);$n.Axios=Bn,$n.CanceledError=tn,$n.CancelToken=class CancelToken{constructor(t){if("function"!=typeof t)throw new TypeError("executor must be a function.");let e;this.promise=new Promise(function(t){e=t});const n=this;this.promise.then(t=>{if(!n._listeners)return;let e=n._listeners.length;for(;e-- >0;)n._listeners[e](t);n._listeners=null}),this.promise.then=t=>{let e;const r=new Promise(t=>{n.subscribe(t),e=t}).then(t);return r.cancel=function(){n.unsubscribe(e)},r},t(function(t,r,i){n.reason||(n.reason=new tn(t,r,i),e(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){this.reason?t(this.reason):this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const e=this._listeners.indexOf(t);-1!==e&&this._listeners.splice(e,1)}toAbortSignal(){const t=new AbortController,e=e=>{t.abort(e)};return this.subscribe(e),t.signal.unsubscribe=()=>this.unsubscribe(e),t.signal}static source(){let t;return{token:new CancelToken(function(e){t=e}),cancel:t}}},$n.isCancel=Ye,$n.VERSION=Nn,$n.toFormData=xe,$n.AxiosError=Ee,$n.Cancel=$n.CanceledError,$n.all=function(t){return Promise.all(t)},$n.spread=function(t){return function(e){return t.apply(null,e)}},$n.isAxiosError=function(t){return Ce.isObject(t)&&!0===t.isAxiosError},$n.mergeConfig=un,$n.AxiosHeaders=Ze,$n.formToJSON=t=>He(Ce.isHTMLForm(t)?new FormData(t):t),$n.getAdapter=xn,$n.HttpStatusCode=In,$n.default=$n;const{Axios:Mn,AxiosError:qn,CanceledError:zn,isCancel:Hn,CancelToken:Jn,VERSION:Kn,all:Wn,Cancel:Vn,isAxiosError:Xn,spread:Gn,toFormData:Zn,AxiosHeaders:Qn,HttpStatusCode:Yn,formToJSON:tr,getAdapter:er,mergeConfig:nr}=$n;var rr=class{constructor(t,e){this.httpClient=t,this.validate=e}async getAppointments(t){return this.httpClient.get("/appointments/v1",{params:t}).then(this.validate(St))}async createAppointment(t){return this.httpClient.post(`/appointments/v1/slots/${t.slot_id}`,t).then(t=>t.data).then(this.validate(At))}async getAppointment(t){return this.httpClient.get(`/api/v1/appointments/${t.id}`).then(t=>t.data).then(this.validate(Tt))}async getDocumentsStorage(){return this.httpClient.get("/appointments/v1/documents/storage").then(t=>t.data).then(this.validate(jt))}async rescheduleAppointment(t){const{id:e,...n}=t;return this.httpClient.put(`/appointments/v1/${e}/reschedule`,n)}async cancelAppointment(t){return this.httpClient.put(`/appointments/v1/${t.id}/cancel`)}async updateAppointment(t){const{appointment_id:e,...n}=t;return this.httpClient.put(`/appointments/v1/${e}/update`,n)}async addDocument(t){const{appointment_id:e,...n}=t;return this.httpClient.post(`/appointments/v1/${e}/consultation-document`,n)}async deleteDocument(t){return this.httpClient.delete(`/appointments/v1/${t.appointment_id}/consultation-document/${t.document_id}`)}async reconnectAppointment(t){return this.httpClient.put(`/appointments/v1/${t.appointmentId}/reconnect`)}},ir=class{constructor(t,e){this.httpClient=t,this.validate=e}async loginToken(t){return this.httpClient.post("/login/v1/token",{token:t.token},{headers:{"x-api-key":t.api_key}}).then(this.validate(xt))}};var sr=class{constructor(t,e){this.httpClient=t,this.validate=e}async postReview(t){return this.httpClient.post("/consultations/v1/review",t)}async startChatConsultation(t){return this.httpClient.put(`/consultations/v1/chat/professionals/${encodeURIComponent(t)}/consult`).then(()=>{})}async getReview(t){return this.httpClient.get(`/consultations/v1/review/${t}`).then(t=>t.data).then(this.validate(P))}},or=class{constructor(t,e){this.httpClient=t,this.validate=e}async uploadFile(t){const e=new FormData;return e.append("file",t.file,t.file.name),this.httpClient.post("/documents/v1/upload-file",e,{headers:{"Content-Type":"multipart/form-data"}}).then(this.validate(Pt))}},ar=class{constructor(t,e){this.httpClient=t,this.validate=e}async getAppointment(t){return this.httpClient.get(`/flash/v1/appointments/${t.appointmentId}`).then(t=>t.data).then(this.validate($))}async joinCall(t){return this.httpClient.get(`/flash/v1/calls/${t.callId}/join`).then(t=>t.data).then(this.validate(M))}async setReady(t){return this.httpClient.post(`/flash/v1/waiting/${t.professional_hash}/ready`,{consultation_id:t.consultation_id,consultation_type:t.consultation_type})}async leaveWaitingRoom(t){return this.httpClient.post(`/flash/v1/waiting/${t.professional_hash}/leave`,{consultation_id:t.consultation_id,consultation_type:t.consultation_type})}async getSharedDocuments(t){return this.httpClient.get(`/flash/v1/appointments/${t.appointment_id}/documents`).then(t=>t.data).then(this.validate(q))}async downloadDocument(t){return this.httpClient.get(t.url,{responseType:"blob"}).then(t=>t.data)}async updatePatientProfile(t){return this.httpClient.put("/flash/v1/profile",t)}async getPatientDocuments(t){return this.httpClient.get(`/flash/v1/patients/${t.patient_hash}/documents`,{params:{page:t.page,per_page:t.per_page}}).then(this.validate(z))}},lr=class{constructor(t,e){this.httpClient=t,this.validate=e}async getOrganizationSpecialties(){return this.httpClient.get("/organizations/v1/specialities").then(t=>t.data).then(this.validate(et))}async getOrganizationSetup(){return this.httpClient.get("/organizations/v1/setup").then(t=>t.data).then(this.validate(nt))}},cr=class{constructor(t,e){this.httpClient=t,this.validate=e}async createPaymentLink(t){const{specialty_id:e,...n}=t,r={...n,speciality_id:e};return this.httpClient.post("/payments/v1/schedule",r).then(t=>t.data).then(this.validate(W))}async createImmediateVideocallPaymentLink(t){return this.httpClient.post("/payments/v1/immediate-videocall",t).then(t=>t.data).then(this.validate(V))}async createChatConsultationPaymentLink(t){return this.httpClient.post("/payments/v1/schedule",t).then(t=>t.data).then(this.validate(X))}async getConsultationCoupon(t,e){return this.httpClient.get(`/payments/v1/consultation-coupon/${encodeURIComponent(t)}`,{params:{amount:e}}).then(t=>t.data).then(this.validate(H))}async getAppointmentConsultationCoupon(t){return this.httpClient.get(`/payments/v1/appointment/${encodeURIComponent(t)}/consultation-coupon`).then(t=>t.data).then(this.validate(J))}async getPaymentSession(t){return this.httpClient.get(`/payments/v1/session/${t}`).then(t=>t.data).then(this.validate(Z))}async validateApplePayMerchant(t){return this.httpClient.post("/payments/v1/apple-pay/validate-merchant",t).then(this.validate(Q))}async authorizeApplePay(t){return this.httpClient.post("/payments/v1/apple-pay/authorize",t).then(this.validate(Y))}async authorizeGooglePay(t){return this.httpClient.post("/payments/v1/google-pay/authorize",t).then(this.validate(tt))}},ur=class{constructor(t,e){this.httpClient=t,this.validate=e}async getProfessional(t){return this.httpClient.get(`sdk/v1/professionals/${t.hash}`).then(t=>t.data).then(this.validate(st))}async readAllMessages(t){return this.httpClient.put(`sdk/v1/rooms/${t.roomId}/messages/read`).then(t=>t.data)}},dr=class{constructor(t,e){this.httpClient=t,this.validate=e}async getPatientProfile(){return this.httpClient.get("/profile/v1/patients").then(t=>t.data).then(this.validate(at))}async getProfessionalPublicProfile(t){return this.httpClient.get(`/profile/v1/public/professionals/${t.hash}`).then(t=>t.data).then(this.validate(lt))}async acceptLegalConsent(t){return this.httpClient.post("/profile/v1/legal-consent",t)}},pr=class{constructor(t,e){this.httpClient=t,this.validate=e}async getRoomMessages(t){return this.httpClient.get(`api/v1/rooms/${t.roomId}/messages`).then(t=>t.data).then(this.validate(mt))}async getUnreadMessagesCount(t){return this.httpClient.get(`chat/v1/${t.roomId}/unread-count`).then(t=>t.data).then(this.validate(gt))}async createSupportRoom(t){return this.httpClient.post("chat/v1/support-room",t).then(t=>t.data).then(this.validate(bt))}},hr=class{constructor(t,e){this.httpClient=t,this.validate=e}async getScheduleServices(){return this.httpClient.get("/schedules/v1/services").then(t=>t.data).then(this.validate(wt))}async getProfessionalsBySpecialtyAndService(t){return this.httpClient.get("/schedules/v1/professionals",{params:t}).then(t=>t.data).then(this.validate(Ct))}async getScheduleServiceProfessionalSlots(t){return this.httpClient.get(`/schedules/v1/services/${t.service_id}/professionals/${t.professional_hash}/slots`,{params:{starts_at:t.starts_at,finishes_at:t.finishes_at,rescheduling_appointment_id:t.rescheduling_appointment_id}}).then(t=>t.data).then(this.validate(Et))}async getScheduleServiceSpecialities(t){return this.httpClient.get(`/schedules/v1/services/${t}/specialities`).then(t=>t.data).then(this.validate(Rt))}async getScheduleSlot(t){return this.httpClient.get(`schedules/v1/slot/${t.slot_id}`,{params:{service_id:t.service_id,speciality_id:t.speciality_id}}).then(t=>t.data).then(this.validate(Ot))}};var fr={development:"https://chat-dev.mediquo.com",production:"https://chat.mediquo.com"},mr=class{constructor({env:t="production",baseURL:e,debug:n}={}){const r=e??fr[t];var i;this.httpClient=(i=r,$n.create({baseURL:i,headers:{"Content-Type":"application/json"}}));const s=(o={debug:n},t=>e=>{const n=t.safeParse(e.data);if(n.error&&o?.debug){const t=e.config?.url??"";console.warn(`[Validation Error]${t?` - URL: ${t}`:""}\n${r=n.error,r.issues.map(t=>`${t.path.join(".")}: ${t.message}`).join("\n")}`)}var r;return n.data??e.data});var o;this.flash=new ar(this.httpClient,s),this.auth=new ir(this.httpClient,s),this.appointments=new rr(this.httpClient,s),this.payments=new cr(this.httpClient,s),this.schedules=new hr(this.httpClient,s),this.organizations=new lr(this.httpClient,s),this.profile=new dr(this.httpClient,s),this.professionals=new ur(this.httpClient,s),this.rooms=new pr(this.httpClient,s),this.documents=new or(this.httpClient,s),this.consultations=new sr(this.httpClient,s)}setAuthToken(t){this.httpClient.defaults.headers.common.Authorization=`Bearer ${t}`}setApiKey(t){this._apiKey=t,this.httpClient.defaults.headers.common["x-api-key"]=t}getApiKey(){return this._apiKey}setLanguage(t){this.httpClient.defaults.headers.common["Accept-Language"]=t}};let gr=null,br=null;const yr=new Proxy({},{get:(t,e)=>(gr&&br===y.MODE||(gr=new mr({env:y.MODE,debug:"development"===y.MODE}),br=y.MODE),gr)[e]});export{O as A,T as C,U as D,ct as M,G as P,_t as S,yr as a,_ as b,E as c,ot as d,Xn as e,K as f,w as g,v as h,x as i,B as j,I as k,j as l};
@@ -1 +1 @@
1
- import{P as n}from"./api-chat-client-BBL1U9EQ.js";function e(e,r,t){return e===n.Paid?{kind:"success",sessionId:t,reference:r}:e===n.Denied?{kind:"denied",sessionId:t}:{kind:"error",reason:"authorize"}}function r(n){const e=n.merchant_session;return null===e||"object"!=typeof e||Array.isArray(e)?n:e}function t(n){if("string"==typeof n)return n;if(null!==n&&"object"==typeof n&&"paymentData"in n){const e=n.paymentData;if("string"==typeof e)return e;if(null!=e)return JSON.stringify(e)}return JSON.stringify(n)}export{e as r,t as s,r as u};
1
+ import{P as n}from"./api-chat-client-DLOZVIkT.js";function e(e,r,t){return e===n.Paid?{kind:"success",sessionId:t,reference:r}:e===n.Denied?{kind:"denied",sessionId:t}:{kind:"error",reason:"authorize"}}function r(n){const e=n.merchant_session;return null===e||"object"!=typeof e||Array.isArray(e)?n:e}function t(n){if("string"==typeof n)return n;if(null!==n&&"object"==typeof n&&"paymentData"in n){const e=n.paymentData;if("string"==typeof e)return e;if(null!=e)return JSON.stringify(e)}return JSON.stringify(n)}export{e as r,t as s,r as u};
@@ -1,18 +1,11 @@
1
+ import { z } from 'zod';
1
2
  import * as lit_html from 'lit-html';
2
3
  import * as lit from 'lit';
3
4
  import { LitElement } from 'lit';
4
- import { z } from 'zod';
5
- import './appointment-details-DpzdYLjq.js';
6
- import '../ui/mq-card.js';
7
- import './professional-overview-mO3tuMuH.js';
8
- import { L as LoginTokenResponse } from './schemas.d-5LR6aN9I.js';
9
- import './mq-chat-room-DuG4RuIp.js';
10
- import '../ui/mq-floating-bubble.js';
11
5
  import { P as PriceInCents } from './price.d-CwLosdAN.js';
12
6
  import '../ui/mq-button.js';
13
7
  import '../ui/mq-dialog.js';
14
8
  import { QueryClient } from '@tanstack/query-core';
15
- import '../ui/mq-unread-badge.js';
16
9
 
17
10
  declare const GetAppointmentsResponseSchema: z.ZodObject<{
18
11
  data: z.ZodArray<z.ZodObject<{
@@ -25,6 +18,7 @@ declare const GetAppointmentsResponseSchema: z.ZodObject<{
25
18
  channel: z.ZodEnum<["videocall", "chat", "phonecall"]>;
26
19
  expires_at: z.ZodNullable<z.ZodString>;
27
20
  service_id: z.ZodNullable<z.ZodString>;
21
+ has_chat_in_appointment: z.ZodOptional<z.ZodBoolean>;
28
22
  }, "strip", z.ZodTypeAny, {
29
23
  url: string;
30
24
  status: "pending" | "expired" | "accepted" | "inCall" | "declined" | "cancelled" | "finished" | "free_of_charge" | "owed" | "unpaid" | "reporting";
@@ -34,6 +28,7 @@ declare const GetAppointmentsResponseSchema: z.ZodObject<{
34
28
  expires_at: string | null;
35
29
  service_id: string | null;
36
30
  starts_at: string;
31
+ has_chat_in_appointment?: boolean | undefined;
37
32
  }, {
38
33
  url: string;
39
34
  status: "pending" | "expired" | "accepted" | "inCall" | "declined" | "cancelled" | "finished" | "free_of_charge" | "owed" | "unpaid" | "reporting";
@@ -43,6 +38,7 @@ declare const GetAppointmentsResponseSchema: z.ZodObject<{
43
38
  expires_at: string | null;
44
39
  service_id: string | null;
45
40
  starts_at: string;
41
+ has_chat_in_appointment?: boolean | undefined;
46
42
  }>;
47
43
  room: z.ZodObject<{
48
44
  id: z.ZodNumber;
@@ -119,6 +115,7 @@ declare const GetAppointmentsResponseSchema: z.ZodObject<{
119
115
  expires_at: string | null;
120
116
  service_id: string | null;
121
117
  starts_at: string;
118
+ has_chat_in_appointment?: boolean | undefined;
122
119
  };
123
120
  room: {
124
121
  id: number;
@@ -153,6 +150,7 @@ declare const GetAppointmentsResponseSchema: z.ZodObject<{
153
150
  expires_at: string | null;
154
151
  service_id: string | null;
155
152
  starts_at: string;
153
+ has_chat_in_appointment?: boolean | undefined;
156
154
  };
157
155
  room: {
158
156
  id: number;
@@ -205,6 +203,7 @@ declare const GetAppointmentsResponseSchema: z.ZodObject<{
205
203
  expires_at: string | null;
206
204
  service_id: string | null;
207
205
  starts_at: string;
206
+ has_chat_in_appointment?: boolean | undefined;
208
207
  };
209
208
  room: {
210
209
  id: number;
@@ -247,6 +246,7 @@ declare const GetAppointmentsResponseSchema: z.ZodObject<{
247
246
  expires_at: string | null;
248
247
  service_id: string | null;
249
248
  starts_at: string;
249
+ has_chat_in_appointment?: boolean | undefined;
250
250
  };
251
251
  room: {
252
252
  id: number;
@@ -318,81 +318,4 @@ declare global {
318
318
  }
319
319
  }
320
320
 
321
- type RepeatTarget = {
322
- specialty: string;
323
- service: string;
324
- };
325
- /**
326
- * Action buttons block for an appointment card.
327
- *
328
- * The modify / cancel / repeat actions are ALWAYS rendered with a normal
329
- * (enabled) appearance. When the corresponding action is currently
330
- * unavailable, clicking it opens an informational dialog explaining why
331
- * instead of executing the action — and no telemetry is tracked for that
332
- * blocked click.
333
- *
334
- * Chat toggle and cancel-confirmation are owned by the parent card, so this
335
- * element only emits `toggle-chat` and `request-cancel` for those.
336
- */
337
- declare class AppointmentCardActions extends LitElement {
338
- static styles: lit.CSSResult;
339
- loginToken: LoginTokenResponse;
340
- variant: "next" | "history";
341
- appointmentId: string;
342
- isVideocall: boolean;
343
- hasChatSupport: boolean;
344
- unreadCount: number;
345
- isModifyUnavailable: boolean;
346
- isCancelUnavailable: boolean;
347
- hasNoSlots: boolean;
348
- modifyUnavailableMessage: string;
349
- cancelUnavailableMessage: string;
350
- repeatTarget: RepeatTarget | null;
351
- professionalHash: string;
352
- private openDialog;
353
- private get patientHash();
354
- private renderChatButton;
355
- private handleModifyClick;
356
- private handleCancelClick;
357
- private handleRepeatClick;
358
- private renderNextActions;
359
- private renderHistoryActions;
360
- private handleDialogClose;
361
- render(): lit_html.TemplateResult<1>;
362
- }
363
- declare global {
364
- interface HTMLElementTagNameMap {
365
- "appointment-card-actions": AppointmentCardActions;
366
- }
367
- }
368
-
369
- declare class AppointmentCard extends LitElement {
370
- static styles: lit.CSSResult;
371
- appointmentResource: GetAppointmentsResponse["data"][number];
372
- specialtyId: number;
373
- variant: "next" | "history";
374
- detailsVariant: "default" | "wide";
375
- loginToken: LoginTokenResponse;
376
- private isChatOpen;
377
- private isCancelDialogOpen;
378
- private unreadQuery;
379
- private getOrganizationSpecialtiesQuery;
380
- private getOrganizationSetupQuery;
381
- private getScheduleServicesQuery;
382
- render(): lit_html.TemplateResult<1>;
383
- }
384
- declare global {
385
- interface HTMLElementTagNameMap {
386
- "appointment-card": AppointmentCard;
387
- }
388
- }
389
-
390
- declare class AppointmentCardSkeleton extends LitElement {
391
- static styles: lit.CSSResult;
392
- render(): lit_html.TemplateResult<1>;
393
- }
394
- declare global {
395
- interface HTMLElementTagNameMap {
396
- "appointment-card-skeleton": AppointmentCardSkeleton;
397
- }
398
- }
321
+ export type { GetAppointmentsResponse as G };
@@ -0,0 +1 @@
1
+ import{_ as t,c as e}from"./custom-element-D2ziPxYE.js";import{c as i}from"./consume-BhoQNO_8.js";import{m as a}from"./runtime-Bg1WXVCx.js";import{l as o}from"./localized-decorator-BlOuLhym.js";import{Q as n}from"./query-controller-D7jBX4X7.js";import{g as s}from"./get-organization-setup-query-DxHNY0w8.js";import{g as p,a as r}from"./i18n-formats-EgnwLxKt.js";import{g as l}from"./get-schedule-services-query-Ckvz9Fqh.js";import{g as c}from"./chunk-Y4EKUX25-CqL3lLdx.js";import{a as d,i as h,E as m,x as u}from"./lit-element-DiWJYFwC.js";import{n as g}from"./property-scuRaFcM.js";import{r as v}from"./state-LQivXIgA.js";import{getLocale as f}from"../i18n.js";import{a as y,A as b,i as $}from"./api-chat-client-DLOZVIkT.js";import"./appointment-details-Czlj6VHq.js";import"../ui/mq-card.js";import"./professional-overview-C4H_znIJ.js";import{l as C}from"./chunk-S5RWG6G2-DPesx3Od.js";import"../mq-chat-room.js";import"../ui/mq-floating-bubble.js";import{g as x}from"./action-unavailable-message-DPH7oOl_.js";import{t as k,c as R,e as q,f as j,g as w,h as S,i as D}from"./telemetry-client-Bkbn48Dd.js";import{e as O}from"./class-map-Co76I6aw.js";import{MqAppointmentRescheduleEvent as I,MqAppointmentBookEvent as M,MqAppointmentJoinVideocallEvent as U,MqAppointmentViewDocumentationEvent as _}from"../events.js";import{messageBubbleIcon as H}from"../ui/icons/message-bubble-icon.js";import{videoIcon as z}from"../ui/icons/video-icon.js";import"../ui/mq-button.js";import"../ui/mq-unread-badge.js";import{c as A}from"./refund-cancel-policy-DhD6jEtp.js";import{toast as E}from"../ui/mq-toast.js";let N=class AppointmentCardActions extends d{constructor(){super(...arguments),this.variant="next",this.isVideocall=!1,this.hasChatSupport=!1,this.unreadCount=0,this.isModifyUnavailable=!1,this.isCancelUnavailable=!1,this.hasNoSlots=!1,this.modifyUnavailableMessage="",this.cancelUnavailableMessage="",this.repeatTarget=null,this.professionalHash="",this.openDialog=null,this.handleModifyClick=()=>{this.isModifyUnavailable?this.openDialog="modify":(k.track(R(this.patientHash,this.appointmentId)),this.dispatchEvent(new I({appointmentId:this.appointmentId})))},this.handleCancelClick=()=>{this.isCancelUnavailable?this.openDialog="cancel":(k.track(q(this.patientHash,this.appointmentId)),this.dispatchEvent(new CustomEvent("request-cancel",{bubbles:!0,composed:!0})))},this.handleRepeatClick=()=>{this.hasNoSlots?this.openDialog="repeat-no-slots":this.repeatTarget?(k.track(j(this.patientHash,this.appointmentId)),this.dispatchEvent(new M({specialty:this.repeatTarget.specialty,service:this.repeatTarget.service,professional:this.professionalHash}))):this.openDialog="repeat-error"},this.handleDialogClose=()=>{this.openDialog=null}}static{this.styles=h`:host{display:contents}.actions{display:flex;gap:var(--sp-3);margin-top:var(--sp-2)}.actions.next{flex-direction:column}.actions-secondary{display:flex;gap:var(--sp-3)}.actions mq-button{flex:1}`}get patientHash(){return this.loginToken.patient.hash}renderChatButton(){return u`<mq-button variant="primary" fullwidth noPadding @click="${()=>{this.dispatchEvent(new CustomEvent("toggle-chat",{bubbles:!0,composed:!0}))}}">${H({size:24})} ${a("Chat")} ${this.unreadCount>0?u`<mq-unread-badge></mq-unread-badge>`:m}</mq-button>`}renderNextActions(){return u`${this.isVideocall?u`<mq-button variant="outline" fullwidth noPadding @click="${()=>{k.track(w(this.patientHash,this.appointmentId)),this.dispatchEvent(new U({appointmentId:this.appointmentId}))}}">${z({size:24})} ${a("Ir a videollamada")}</mq-button>`:m}<div class="actions-secondary">${this.hasChatSupport?this.renderChatButton():m}<mq-button variant="outline" fullwidth noPadding @click="${this.handleModifyClick}">${a("Modificar")}</mq-button><mq-button variant="outline-negative" fullwidth noPadding @click="${this.handleCancelClick}">${a("Cancelar")}</mq-button></div>`}renderHistoryActions(){return u`${this.hasChatSupport?this.renderChatButton():m}<mq-button variant="outline" fullwidth noPadding @click="${()=>{k.track(S(this.patientHash,this.appointmentId)),this.dispatchEvent(new _({appointmentId:this.appointmentId}))}}">${a("Documentos")}</mq-button><mq-button variant="outline" fullwidth noPadding @click="${this.handleRepeatClick}">${a("Repetir")}</mq-button>`}render(){return u`<div class="${O({actions:!0,next:"next"===this.variant})}">${"next"===this.variant?this.renderNextActions():this.renderHistoryActions()}</div><appointment-action-unavailable-dialog .open="${"modify"===this.openDialog}" .heading="${a("Modificar cita")}" .message="${this.modifyUnavailableMessage}" @close="${this.handleDialogClose}"></appointment-action-unavailable-dialog><appointment-action-unavailable-dialog .open="${"cancel"===this.openDialog}" .heading="${a("Anular cita")}" .message="${this.cancelUnavailableMessage}" @close="${this.handleDialogClose}"></appointment-action-unavailable-dialog><appointment-action-unavailable-dialog .open="${"repeat-no-slots"===this.openDialog}" .heading="${a("Repetir cita")}" .message="${a("Este profesional no tiene horarios disponibles")}" @close="${this.handleDialogClose}"></appointment-action-unavailable-dialog><appointment-action-unavailable-dialog .open="${"repeat-error"===this.openDialog}" .heading="${a("Repetir cita")}" .message="${a("Lo sentimos, no hemos podido repetir tu cita. Por favor, contacta con soporte.")}" @close="${this.handleDialogClose}"></appointment-action-unavailable-dialog>`}};t([i({context:C})],N.prototype,"loginToken",void 0),t([g({type:String})],N.prototype,"variant",void 0),t([g({type:String})],N.prototype,"appointmentId",void 0),t([g({type:Boolean})],N.prototype,"isVideocall",void 0),t([g({type:Boolean})],N.prototype,"hasChatSupport",void 0),t([g({type:Number})],N.prototype,"unreadCount",void 0),t([g({type:Boolean})],N.prototype,"isModifyUnavailable",void 0),t([g({type:Boolean})],N.prototype,"isCancelUnavailable",void 0),t([g({type:Boolean})],N.prototype,"hasNoSlots",void 0),t([g({type:String})],N.prototype,"modifyUnavailableMessage",void 0),t([g({type:String})],N.prototype,"cancelUnavailableMessage",void 0),t([g({type:Object})],N.prototype,"repeatTarget",void 0),t([g({type:String})],N.prototype,"professionalHash",void 0),t([v()],N.prototype,"openDialog",void 0),N=t([o(),e("appointment-card-actions")],N);let T=class AppointmentCard extends d{constructor(){super(...arguments),this.variant="next",this.detailsVariant="wide",this.isChatOpen=!1,this.isCancelDialogOpen=!1,this.unreadQuery=new n(this,()=>c(y,{roomId:this.appointmentResource?.room?.id})),this.getOrganizationSpecialtiesQuery=new n(this,()=>p(y,{enabled:!!this.appointmentResource?.speciality?.id})),this.getOrganizationSetupQuery=new n(this,()=>s(y)),this.getScheduleServicesQuery=new n(this,()=>l(y))}static{this.styles=h`:host{display:flex}.card{width:100%;padding:var(--sp-6);display:flex;flex-direction:column;gap:var(--sp-4);justify-content:space-between}.card-top-content{display:flex;flex-direction:column;gap:var(--sp-6)}.see-details{color:var(--color-primary-link-default);font-size:var(--text-sm);line-height:var(--text-sm--line-height);font-weight:var(--font-weight-bold)}.see-details:hover{text-decoration:underline}.chevron-down{width:16px;height:16px;transition:transform .2s ease}.appointment-details{display:flex;flex-direction:column;gap:12px}.clock-icon-wrapper{width:24px;height:24px;display:flex;align-items:center;justify-content:center;flex-shrink:0}.clock-icon-wrapper svg{width:100%;height:100%}.appointment-type{display:flex;align-items:center;gap:12px;font-size:18px;color:#2c3e50}.actions{display:flex;gap:var(--sp-3);margin-top:var(--sp-2)}.actions.next{flex-direction:column}.actions-secondary{display:flex;gap:var(--sp-3)}.actions mq-button{flex:1}`}render(){const t=this.appointmentResource.appointment.channel===b.videocall,e=this.appointmentResource.appointment.channel===b.phonecall,i=!0===this.appointmentResource.appointment.has_chat_in_appointment,o=(t||e)&&i,n=f(),s=$(this.appointmentResource.appointment.expires_at),p=0===this.appointmentResource.slots.length,l=this.getOrganizationSetupQuery.result?.data?.appointments?.seconds_before_start_to_refund_on_cancel,c=A({startsAtIso:this.appointmentResource.appointment.starts_at,refundPolicySeconds:l}),d=s||p||!c,h=s||!c,g=x({action:"modify",refundPolicySeconds:l}),v=x({action:"cancel",refundPolicySeconds:l}),y=this.getOrganizationSpecialtiesQuery.result?.data?.find(t=>Number(t.id)===Number(this.appointmentResource.speciality.id)),C=r(y?.code??"",n,y?.name??this.appointmentResource.speciality.name),R=this.getScheduleServicesQuery.result?.data?.find(t=>t.id===this.appointmentResource.appointment.service_id)?.code,q=y?.code&&R?{specialty:y.code,service:R}:null;return u`<mq-card class="card" roundness="md"><div class="card-top-content"><professional-overview .specialtyName="${C??""}" .collegiateNumber="${this.appointmentResource.professional.collegiate_number??void 0}" .description="${this.appointmentResource.professional.description??""}" .languages="${this.appointmentResource.professional.languages}" .avatar="${this.appointmentResource.professional.avatar??""}" .name="${this.appointmentResource.professional.name}"></professional-overview><appointment-details .startsAt="${this.appointmentResource.appointment.starts_at}" .duration="${this.appointmentResource.appointment.duration}" .channel="${this.appointmentResource.appointment.channel}" .timezone="${this.loginToken?.patient?.timezone}" variant="${this.detailsVariant}"></appointment-details></div><appointment-card-actions .variant="${this.variant}" .appointmentId="${this.appointmentResource.appointment.id??""}" .isVideocall="${t}" .hasChatSupport="${o}" .unreadCount="${this.unreadQuery.result?.data?.unread_count??0}" .isModifyUnavailable="${d}" .isCancelUnavailable="${h}" .hasNoSlots="${p}" .modifyUnavailableMessage="${g}" .cancelUnavailableMessage="${v}" .repeatTarget="${q}" .professionalHash="${this.appointmentResource.professional.hash}" @toggle-chat="${()=>{this.isChatOpen=!this.isChatOpen,this.isChatOpen&&k.track(D(this.loginToken.patient.hash,this.appointmentResource.appointment.id??""))}}" @request-cancel="${()=>{this.isCancelDialogOpen=!0}}"></appointment-card-actions><mq-floating-bubble ?dismissable="${!1}" .open="${this.isChatOpen}" @mq-close="${()=>{this.isChatOpen=!1}}" hideCloseButton>${this.isChatOpen?u`<mq-chat-room slot="content" .consultationId="${this.appointmentResource.appointment.id}" consultation-type="appointment" token="${this.loginToken.access_token}" .roomId="${this.appointmentResource.room.id}" .professionalHash="${this.appointmentResource.professional.hash}" @mq-chat-room-close="${()=>{this.isChatOpen=!1}}" ?readonly="${s}"></mq-chat-room>`:m}</mq-floating-bubble><cancel-appointment-confirmation-dialog .appointmentId="${this.appointmentResource.appointment.id}" .price="${this.appointmentResource.price??void 0}" .open="${this.isCancelDialogOpen}" @cancel="${()=>{this.isCancelDialogOpen=!1}}" @success="${()=>{this.isCancelDialogOpen=!1,E.success(a("Consulta anulada correctamente")),this.dispatchEvent(new CustomEvent("appointment-cancel-confirmed",{bubbles:!0,composed:!0,detail:{id:this.appointmentResource.appointment.id}}))}}"></cancel-appointment-confirmation-dialog></mq-card>`}};t([g({type:Object})],T.prototype,"appointmentResource",void 0),t([g({type:Number})],T.prototype,"specialtyId",void 0),t([g({type:String})],T.prototype,"variant",void 0),t([g({type:String})],T.prototype,"detailsVariant",void 0),t([i({context:C})],T.prototype,"loginToken",void 0),t([v()],T.prototype,"isChatOpen",void 0),t([v()],T.prototype,"isCancelDialogOpen",void 0),T=t([o(),e("appointment-card")],T);let P=class AppointmentCardSkeleton extends d{static{this.styles=h`div{border-radius:var(--border-radius-md);background:color-mix(in srgb,var(--color-neutrals-background-disabled) 50%,#fff 50%);height:337px;width:100%}`}render(){return u`<div></div>`}};P=t([e("appointment-card-skeleton")],P);
@@ -0,0 +1,91 @@
1
+ import * as lit_html from 'lit-html';
2
+ import * as lit from 'lit';
3
+ import { LitElement } from 'lit';
4
+ import { G as GetAppointmentsResponse } from './appointment-action-unavailable-dialog-Da2IATYj.js';
5
+ import './appointment-details-CVEDe_k0.js';
6
+ import '../ui/mq-card.js';
7
+ import './professional-overview-mO3tuMuH.js';
8
+ import { L as LoginTokenResponse } from './schemas.d-D7bCe24u.js';
9
+ import './mq-chat-room-CRPruRJD.js';
10
+ import '../ui/mq-floating-bubble.js';
11
+ import '../ui/mq-button.js';
12
+ import '../ui/mq-unread-badge.js';
13
+
14
+ type RepeatTarget = {
15
+ specialty: string;
16
+ service: string;
17
+ };
18
+ /**
19
+ * Action buttons block for an appointment card.
20
+ *
21
+ * The modify / cancel / repeat actions are ALWAYS rendered with a normal
22
+ * (enabled) appearance. When the corresponding action is currently
23
+ * unavailable, clicking it opens an informational dialog explaining why
24
+ * instead of executing the action — and no telemetry is tracked for that
25
+ * blocked click.
26
+ *
27
+ * Chat toggle and cancel-confirmation are owned by the parent card, so this
28
+ * element only emits `toggle-chat` and `request-cancel` for those.
29
+ */
30
+ declare class AppointmentCardActions extends LitElement {
31
+ static styles: lit.CSSResult;
32
+ loginToken: LoginTokenResponse;
33
+ variant: "next" | "history";
34
+ appointmentId: string;
35
+ isVideocall: boolean;
36
+ hasChatSupport: boolean;
37
+ unreadCount: number;
38
+ isModifyUnavailable: boolean;
39
+ isCancelUnavailable: boolean;
40
+ hasNoSlots: boolean;
41
+ modifyUnavailableMessage: string;
42
+ cancelUnavailableMessage: string;
43
+ repeatTarget: RepeatTarget | null;
44
+ professionalHash: string;
45
+ private openDialog;
46
+ private get patientHash();
47
+ private renderChatButton;
48
+ private handleModifyClick;
49
+ private handleCancelClick;
50
+ private handleRepeatClick;
51
+ private renderNextActions;
52
+ private renderHistoryActions;
53
+ private handleDialogClose;
54
+ render(): lit_html.TemplateResult<1>;
55
+ }
56
+ declare global {
57
+ interface HTMLElementTagNameMap {
58
+ "appointment-card-actions": AppointmentCardActions;
59
+ }
60
+ }
61
+
62
+ declare class AppointmentCard extends LitElement {
63
+ static styles: lit.CSSResult;
64
+ appointmentResource: GetAppointmentsResponse["data"][number];
65
+ specialtyId: number;
66
+ variant: "next" | "history";
67
+ detailsVariant: "default" | "wide";
68
+ loginToken: LoginTokenResponse;
69
+ private isChatOpen;
70
+ private isCancelDialogOpen;
71
+ private unreadQuery;
72
+ private getOrganizationSpecialtiesQuery;
73
+ private getOrganizationSetupQuery;
74
+ private getScheduleServicesQuery;
75
+ render(): lit_html.TemplateResult<1>;
76
+ }
77
+ declare global {
78
+ interface HTMLElementTagNameMap {
79
+ "appointment-card": AppointmentCard;
80
+ }
81
+ }
82
+
83
+ declare class AppointmentCardSkeleton extends LitElement {
84
+ static styles: lit.CSSResult;
85
+ render(): lit_html.TemplateResult<1>;
86
+ }
87
+ declare global {
88
+ interface HTMLElementTagNameMap {
89
+ "appointment-card-skeleton": AppointmentCardSkeleton;
90
+ }
91
+ }
@@ -1,7 +1,7 @@
1
1
  import * as lit_html from 'lit-html';
2
2
  import * as lit from 'lit';
3
3
  import { LitElement } from 'lit';
4
- import { A as AppointmentChannel } from './appointment.model.d-Dy50gMPg.js';
4
+ import { A as AppointmentChannel } from './appointment.model.d-BWwBLaEL.js';
5
5
 
6
6
  declare class AppointmentDetails extends LitElement {
7
7
  static styles: lit.CSSResult;
@@ -0,0 +1 @@
1
+ import{_ as t,c as e}from"./custom-element-D2ziPxYE.js";import{m as i}from"./runtime-Bg1WXVCx.js";import{l as o}from"./localized-decorator-BlOuLhym.js";import{g as n}from"./api-chat-client-DLOZVIkT.js";import{a}from"./addSeconds-ofMnxlgT.js";import{i as r,a as s,E as l,x as p}from"./lit-element-DiWJYFwC.js";import{n as m}from"./property-scuRaFcM.js";import{e as c}from"./class-map-Co76I6aw.js";import{getLocale as h}from"../i18n.js";import{briefcaseIcon as d}from"../ui/icons/briefcase-icon.js";import{calendarIcon as f}from"../ui/icons/calendar-icon.js";import{clockIcon as u}from"../ui/icons/clock-icon.js";import{messageBubbleIcon as v}from"../ui/icons/message-bubble-icon.js";import{phoneIcon as w}from"../ui/icons/phone-icon.js";const g=r`.appointment-details{display:flex;flex-direction:column;gap:var(--sp-3)}.detail-row{display:inline-flex;width:fit-content;align-items:center;gap:var(--sp-2);color:var(--color-neutrals-text-default);font-family:var(--font-body);font-size:var(--text-sm);line-height:var(--text-sm--line-height);font-weight:var(--font-weight-bold)}.detail-row svg{flex-shrink:0}.detail-row span::first-letter{text-transform:uppercase}.detail-row.full-width{width:100%}:host([strike-through]) .detail-row span{text-decoration:line-through}@media (min-width:768px){.appointment-details.wide{flex-direction:row;flex-wrap:wrap}}`;let y=class AppointmentDetails extends s{constructor(){super(...arguments),this.channel=void 0,this.variant="default",this.strikeThrough=!1,this.timezone=void 0,this._appointmentChannelToLabel=t=>{switch(t){case"videocall":return i("Videoconsulta");case"chat":return i("Chat");case"phonecall":return i("Consulta telefónica");default:return""}},this._appointmentChannelToIcon=t=>{switch(t){case"videocall":return d({size:24});case"chat":return v({size:24});case"phonecall":return w({size:24});default:return l}}}static{this.styles=g}render(){const t=h().replace("_","-"),e=new Intl.DateTimeFormat(t,{weekday:"long",year:"numeric",month:"long",day:"numeric",...this.timezone?{timeZone:this.timezone}:{}}),i=new Intl.DateTimeFormat(t,{timeStyle:"short",...this.timezone?{timeZone:this.timezone}:{}}),o=new Date(this.startsAt),r=a(o,this.duration),s=e.format(o),m=i.format(o),d=i.format(r),v=this.timezone?n(this.timezone,o):"";return p`<div class="${c({"appointment-details":!0,wide:"wide"===this.variant})}"><div class="detail-row">${f({size:24})} <span>${s}</span></div><div class="detail-row">${u({size:24})} <span>${m} - ${d}${v?` (${v})`:""}</span></div>${this.channel?p`<div class="detail-row full-width">${this._appointmentChannelToIcon(this.channel)} <span>${this._appointmentChannelToLabel(this.channel)}</span></div>`:l}</div>`}};t([m({type:String})],y.prototype,"startsAt",void 0),t([m({type:Number})],y.prototype,"duration",void 0),t([m({type:String})],y.prototype,"channel",void 0),t([m({type:String})],y.prototype,"variant",void 0),t([m({type:Boolean,attribute:"strike-through"})],y.prototype,"strikeThrough",void 0),t([m({type:String})],y.prototype,"timezone",void 0),y=t([o(),e("appointment-details")],y);export{y as A};
@@ -57,6 +57,7 @@ declare const AppointmentSchema: z.ZodObject<{
57
57
  is_dismissed: boolean;
58
58
  }>;
59
59
  speciality_id: z.ZodNullable<z.ZodNumber>;
60
+ has_chat_in_appointment: z.ZodOptional<z.ZodBoolean>;
60
61
  created_at: z.ZodString;
61
62
  status: z.ZodEnum<["pending", "expired", "accepted", "inCall", "declined", "cancelled", "finished", "free_of_charge", "owed", "unpaid", "reporting"]>;
62
63
  seconds_to_open: z.ZodNumber;
@@ -119,6 +120,7 @@ declare const AppointmentSchema: z.ZodObject<{
119
120
  file_name: string;
120
121
  }[] | null;
121
122
  service_id: string | null;
123
+ has_chat_in_appointment?: boolean | undefined;
122
124
  price?: number | null | undefined;
123
125
  currency?: string | null | undefined;
124
126
  discount_amount?: number | null | undefined;
@@ -160,6 +162,7 @@ declare const AppointmentSchema: z.ZodObject<{
160
162
  file_name: string;
161
163
  }[] | null;
162
164
  service_id: string | null;
165
+ has_chat_in_appointment?: boolean | undefined;
163
166
  price?: number | null | undefined;
164
167
  currency?: string | null | undefined;
165
168
  discount_amount?: number | null | undefined;
@@ -0,0 +1 @@
1
+ async function e(e){return new Promise((n,r)=>{const o=new FileReader;o.onloadend=()=>n(o.result),o.onerror=r,o.readAsDataURL(e)})}export{e as b};
@@ -1 +1 @@
1
- import{s as t}from"./context-request-event-Dfydf1ub.js";class s{constructor(t,i,e,h){if(this.subscribe=!1,this.provided=!1,this.value=void 0,this.t=(t,i)=>{this.unsubscribe&&(this.unsubscribe!==i&&(this.provided=!1,this.unsubscribe()),this.subscribe||this.unsubscribe()),this.value=t,this.host.requestUpdate(),this.provided&&!this.subscribe||(this.provided=!0,this.callback&&this.callback(t,i)),this.unsubscribe=i},this.host=t,void 0!==i.context){const t=i;this.context=t.context,this.callback=t.callback,this.subscribe=t.subscribe??!1}else this.context=i,this.callback=e,this.subscribe=h??!1;this.host.addController(this)}hostConnected(){this.dispatchRequest()}hostDisconnected(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=void 0)}dispatchRequest(){this.host.dispatchEvent(new t(this.context,this.host,this.t,this.subscribe))}}export{s};
1
+ import{s as t}from"./context-request-event-Dfydf1ub.js";class s{constructor(t,i,e,h){if(this.subscribe=!1,this.provided=!1,this.value=void 0,this.t=(t,i)=>{this.unsubscribe&&(this.unsubscribe!==i&&(this.provided=!1,this.unsubscribe()),this.subscribe||this.unsubscribe()),this.value=t,this.host.requestUpdate(),this.provided&&!this.subscribe||(this.provided=!0,this.callback&&this.callback(t,i)),this.unsubscribe=i},this.host=t,void 0!==i.context){const t=i;this.context=t.context,this.callback=t.callback,this.subscribe=t.subscribe??!1}else this.context=i,this.callback=e,this.subscribe=h??!1;this.host.addController(this)}hostConnected(){this.dispatchRequest()}hostDisconnected(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=void 0)}dispatchRequest(){this.host.dispatchEvent(new t(this.context,this.host,this.t,this.subscribe))}}function i(t,...i){return[t.getApiKey()??"_",...i]}export{s as a,i as s};
@@ -0,0 +1 @@
1
+ import{s}from"./chunk-6CCJWPGL-DlOpbEYH.js";function e(e,o,r){return{queryKey:s(e,"professionals",o.hash),queryFn:()=>e.professionals.getProfessional(o),staleTime:0,...r}}export{e as g};
@@ -0,0 +1 @@
1
+ import{z as e}from"./external-CJj32K_p.js";import{s}from"./chunk-6CCJWPGL-DlOpbEYH.js";var r=e.enum(["ordinary","system"]).enum;function n(e,r,n){return{queryKey:s(e,"unread-messages",r),queryFn:()=>e.rooms.getUnreadMessagesCount(r),staleTime:0,...n}}export{r as S,n as g};
@@ -0,0 +1 @@
1
+ import{a as t}from"./chunk-6CCJWPGL-DlOpbEYH.js";function c({context:c,subscribe:e}){return(i,n)=>{"object"==typeof n?n.addInitializer(function(){new t(this,{context:c,callback:t=>{i.set.call(this,t)},subscribe:e})}):i.constructor.addInitializer(i=>{new t(i,{context:c,callback:t=>{i[n]=t},subscribe:e})})}}export{c};
@@ -0,0 +1,6 @@
1
+ import z from 'zod';
2
+
3
+ declare const DocumentTypeSchema: z.ZodEnum<["prescription", "report", "diagnosticTestPrescription"]>;
4
+ type DocumentType = z.infer<typeof DocumentTypeSchema>;
5
+
6
+ export type { DocumentType as D };
@@ -0,0 +1 @@
1
+ import{_ as t,c as e}from"./custom-element-D2ziPxYE.js";import{m as i}from"./runtime-Bg1WXVCx.js";import{l as o}from"./localized-decorator-BlOuLhym.js";import{h as a,s as n}from"./task-Bj8p7kJX.js";import{a as s,C as r,g as d,i as l}from"./api-chat-client-DLOZVIkT.js";import{a as c}from"./addSeconds-ofMnxlgT.js";import{a as m,i as p,E as h,x as u}from"./lit-element-DiWJYFwC.js";import{n as f}from"./property-scuRaFcM.js";import{getLocale as g}from"../i18n.js";import{calendarIcon as v}from"../ui/icons/calendar-icon.js";import{clockIcon as y}from"../ui/icons/clock-icon.js";import{r as b}from"./state-LQivXIgA.js";import{infoCircleOutineIcon as x}from"../ui/icons/info-circle-outine-icon.js";import"../ui/mq-button.js";import{l as $}from"./chunk-S5RWG6G2-DPesx3Od.js";import{messageBubbleIcon as k}from"../ui/icons/message-bubble-icon.js";import"../mq-chat-room.js";import"../ui/mq-floating-bubble.js";import"../ui/mq-card.js";import"../ui/mq-unread-badge.js";import{c as w}from"./consume-BhoQNO_8.js";import{Q as q}from"./query-controller-D7jBX4X7.js";import{g as z}from"./chunk-Y4EKUX25-CqL3lLdx.js";import"../ui/mq-page-title.js";import"./index-BgnerXfH.js";import{M as j}from"./mutation-controller-CR2qcqhH.js";import{g as _,a as C}from"./i18n-formats-EgnwLxKt.js";import{t as T,d as O,a as I,b as S}from"./telemetry-client-Bkbn48Dd.js";import{MqViewAppointmentsEvent as D}from"../events.js";let E=class ChatCta extends m{constructor(){super(...arguments),this.text=i("Utiliza el chat para enviar el motivo de consulta, documentos o imágenes"),this.readonly=!1,this.isChatOpen=!1,this.unreadQuery=new q(this,()=>z(s,{roomId:this.roomId}))}static{this.styles=[p`.chat-cta{padding:var(--sp-6) var(--sp-4);display:flex;flex-direction:column;gap:var(--sp-4)}.cta-message{display:inline-flex;align-items:center;justify-content:center;gap:var(--sp-4);font-family:var(--font-body);font-size:var(--text-sm);line-height:var(--text-sm--line-height);color:var(--color-neutrals-text-default)}.cta-message svg{flex-shrink:0}mq-button svg{flex-shrink:0}mq-chat-room{height:100%}@media (min-width:768px){.chat-cta{padding:var(--sp-6)}mq-button{max-width:323px;margin:0 auto}}`]}render(){return u`<mq-card class="chat-cta" roundness="md"><div class="cta-message">${x({size:24})} <span>${this.text}</span></div><mq-button variant="primary" size="md" fullwidth @click="${()=>{this.isChatOpen=!this.isChatOpen,this.isChatOpen&&this.onOpenChat?.()}}">${k({size:24})} ${i("Chatea con el profesional")} ${(this.unreadQuery.result?.data?.unread_count??0)>0?u`<mq-unread-badge></mq-unread-badge>`:h}</mq-button></mq-card><mq-floating-bubble ?dismissable="${!1}" .open="${this.isChatOpen}" @mq-close="${()=>{this.isChatOpen=!1}}" hideCloseButton>${this.isChatOpen?u`<mq-chat-room slot="content" .consultationId="${this.consultationId}" .consultationType="${r.appointment}" token="${this.loginToken.access_token}" .roomId="${this.roomId}" .professionalHash="${this.professionalHash}" ?readonly="${this.readonly}" @mq-chat-room-close="${()=>{this.isChatOpen=!1}}"></mq-chat-room>`:h}</mq-floating-bubble>`}};t([f({type:Number})],E.prototype,"roomId",void 0),t([f({type:String})],E.prototype,"professionalHash",void 0),t([f({type:String})],E.prototype,"text",void 0),t([f({type:String})],E.prototype,"consultationId",void 0),t([f({type:Boolean,reflect:!0})],E.prototype,"readonly",void 0),t([f({attribute:!1})],E.prototype,"onOpenChat",void 0),t([w({context:$})],E.prototype,"loginToken",void 0),t([b()],E.prototype,"isChatOpen",void 0),E=t([o(),e("chat-cta")],E);let B=class PageLayout extends m{constructor(){super(...arguments),this.yCentered=!1,this.background="solid"}static{this.styles=p`:host([background=transparent]){background-color:transparent}:host([background=solid]){background-color:var(--color-background)}:host([y-centered]) div{display:grid;place-items:center}div{width:100%;max-width:1000px;padding:var(--mq-layout-padding,0);margin:0 auto;box-sizing:border-box}:host([y-centered]) div{height:100%}main{width:100%}`}render(){return u`<div><main><slot></slot></main></div>`}};t([f({type:Boolean,attribute:"y-centered"})],B.prototype,"yCentered",void 0),t([f({type:String})],B.prototype,"background",void 0),B=t([e("page-layout")],B);const H=p`mq-page-title{margin:var(--size-3) 0}.description{font-size:var(--text-sm);line-height:var(--text-sm--line-height);color:var(--color-neutrals-text-default);font-weight:var(--font-weight-normal);margin:0;margin-bottom:var(--size-5)}.professional-card{padding:var(--size-4);margin-bottom:var(--size-4)}.professional-card>:not(:first-child){margin-top:var(--size-4)}.professional-name{font-family:var(--font-titles);font-size:var(--text-lg);line-height:var(--text-lg--line-height);color:var(--color-neutrals-text-default);font-weight:var(--font-weight-bold);margin:0;margin-bottom:var(--size-1)}.professional-speciality{font-size:var(--text-base);line-height:var(--text-base--line-height);color:var(--color-neutrals-text-default);font-weight:var(--font-weight-normal);margin:0}.description-list{display:flex;flex-direction:column;gap:var(--size-4)}.description-list-item{display:flex;flex-direction:row;align-items:center;gap:var(--size-2);color:var(--color-neutrals-text-default)}.description-list-item dt{display:inline-flex}.description-list-item dd{margin:0;font-family:var(--font-body);font-size:var(--text-base);line-height:var(--text-base--line-height);font-weight:var(--font-weight-semibold)}.description-list-item dd::first-letter{text-transform:uppercase}.documents-card{padding:var(--size-4);margin-bottom:var(--size-6)}.documents-card-empty{font-family:var(--font-body);font-size:var(--text-sm);line-height:var(--text-sm--line-height);color:var(--color-neutrals-text-default);font-weight:var(--font-weight-normal)}.documents-card-title{font-family:var(--font-titles);font-size:var(--text-lg);line-height:var(--text-lg--line-height);color:var(--color-neutrals-text-default);font-weight:var(--font-weight-bold);margin:0;margin-bottom:var(--size-4)}.documents-list{margin-bottom:var(--size-4)}.documents-list>:not(:first-child){margin-top:var(--size-2)}.finished-consultation-footer{display:flex;flex-direction:column;gap:var(--size-5)}.document-item-skeleton{height:57px;width:100%;background-color:var(--color-muted);animation:skeleton-pulse 1.5s infinite}@keyframes skeleton-pulse{0%{opacity:1}50%{opacity:.6}100%{opacity:1}}@media (min-width:768px){.description-list{flex-direction:row}mq-button{display:block;max-width:323px;margin:0 auto}}`;let P=class DocumentationView extends m{constructor(){super(...arguments),this.canReconnect=!1,this._sharedocumentsTask=new a(this,{task:async([t])=>await s.flash.getSharedDocuments({appointment_id:t}),args:()=>[this.appointment.id]}),this.getOrganizationSpecialtiesQuery=new q(this,()=>_(s)),this._reconnectMutation=new j(this,{mutationFn:t=>s.appointments.reconnectAppointment(t),onSuccess:()=>{this.dispatchEvent(new CustomEvent("reconnect",{bubbles:!0,composed:!0}))}})}static{this.styles=H}firstUpdated(){T.track(O(this.loginToken.patient.hash,this.appointment.id??""))}render(){const t=!0===this.appointment.has_chat_in_appointment,e=g(),o=e.replace("_","-"),a=this.loginToken.patient.timezone,s=a?{timeZone:a}:{},r=new Intl.DateTimeFormat(o,{dateStyle:"full",...s}),m=new Intl.DateTimeFormat(o,{hour:"2-digit",minute:"2-digit",...s}),p=new Date(this.appointment.start_date),f=c(p,this.appointment.duration),b=a?d(a,p):"";return u`<mq-page-title .title="${i("Consulta finalizada")}" back-label="${i("Salir")}" @mq-back="${t=>{t.stopPropagation(),this.dispatchEvent(new D({tab:"history"}))}}"></mq-page-title><p class="description">${i("Si tu médico ha generado alguna documentación podrás verla y descargarla aquí, desde la sección de documentación, tu correo o el chat.")}</p><mq-card class="professional-card" roundness="md"><div><h2 class="professional-name">${this.appointment.from.name}</h2><p class="professional-speciality">${this.appointment.from.speciality}</p></div><dl class="description-list"><div class="description-list-item"><dt>${v()}</dt><dd>${r.format(p)}</dd></div><div class="description-list-item"><dt>${y()}</dt><dd>${m.format(p)} - ${m.format(f)}${b?` (${b})`:""}</dd></div></dl></mq-card><mq-card class="documents-card" roundness="md"><h2 class="documents-card-title">${i("Documentación")}</h2><div class="documents-list">${this._sharedocumentsTask?.render({pending:()=>u`<div class="document-item-skeleton"></div>`,complete:()=>0===this._sharedocumentsTask?.value?.length?u`<p class="documents-card-empty">${i("El médico está terminando de gestionar tu consulta. Actualiza en unos minutos para ver si tienes documentación.")}</p>`:this._sharedocumentsTask?.value?.map(t=>u`<patient-document .kind="${t.document_type}" .filename="${t.name}" .specialty="${(()=>{const i=this.getOrganizationSpecialtiesQuery.result?.data?.find(e=>e.id===t.professional.speciality_id);return C(i?.code??"",e,i?.name)})()}" .description="${t.name}" .date="${t.created_at}" .downloadUrl="${t.url}"></patient-document>`)})}</div><mq-button variant="outline" size="md" fullwidth @click="${()=>{T.track(I(this.loginToken.patient.hash,this.appointment.id??"")),this._sharedocumentsTask?.run()}}" .disabled="${this._sharedocumentsTask?.status===n.PENDING}">${i("Actualizar")}</mq-button></mq-card><div class="finished-consultation-footer">${this.canReconnect?u`<mq-button variant="primary" size="md" fullwidth ?disabled="${this._reconnectMutation.isPending}" @click="${()=>this._reconnectMutation.run({appointmentId:this.appointment.id})}">${i("Volver a la sala de espera")}</mq-button>`:h} ${t?u`<chat-cta .consultationId="${this.appointment.id}" .roomId="${Number(this.appointment.room_id)}" .professionalHash="${this.appointment.from.hash}" .text="${i("Puedes chatear con tu profesional hasta 48 horas finalizada tu cita")}" ?readonly="${l(this.appointment.expires_at)}" .onOpenChat="${()=>{T.track(S(this.loginToken.patient.hash,this.appointment.id??""))}}"></chat-cta>`:h}</div>`}};t([f({type:Object})],P.prototype,"appointment",void 0),t([f({type:String})],P.prototype,"token",void 0),t([f({type:Boolean,attribute:"can-reconnect"})],P.prototype,"canReconnect",void 0),t([w({context:$})],P.prototype,"loginToken",void 0),P=t([o(),e("documentation-view")],P);
@@ -0,0 +1 @@
1
+ import{s as n}from"./chunk-6CCJWPGL-DlOpbEYH.js";function t(t,e,p){return{queryKey:n(t,"appointments",e.id),queryFn:()=>t.appointments.getAppointment(e),...p}}export{t as g};
@@ -0,0 +1 @@
1
+ import{s as n}from"./chunk-6CCJWPGL-DlOpbEYH.js";function r(r,t){return{queryKey:n(r,"organization-setup"),queryFn:()=>r.organizations.getOrganizationSetup(),...t}}export{r as g};
@@ -0,0 +1 @@
1
+ import{s as t}from"./chunk-6CCJWPGL-DlOpbEYH.js";function e(e,n){return{queryKey:t(e,"patient-documents",n),queryFn:()=>e.flash.getPatientDocuments(n)}}export{e as g};
@@ -0,0 +1 @@
1
+ import{s as e}from"./chunk-6CCJWPGL-DlOpbEYH.js";function r(r,t){return{queryKey:e(r,"patient-profile"),queryFn:()=>r.profile.getPatientProfile(),...t}}export{r as g};
@@ -0,0 +1 @@
1
+ import{s as e}from"./chunk-6CCJWPGL-DlOpbEYH.js";function s(s){return{queryKey:e(s,"schedule-services"),queryFn:()=>s.schedules.getScheduleServices()}}export{s as g};
@@ -0,0 +1 @@
1
+ import{s as o}from"./chunk-6CCJWPGL-DlOpbEYH.js";function a(a,e){return{queryKey:o(a,"organization-specialties"),queryFn:()=>a.organizations.getOrganizationSpecialties(),...e}}var e={digestive_system:{de_DE:"Verdauungssystem",en_US:"Digestive System",es_ES:"Aparato Digestivo",ca_ES:"Aparell Digestiu",pt_PT:"Aparelho Digestivo"},orthopedic_surgery_traumatology:{de_DE:"Traumatologie und Orthopädische Chirurgie",en_US:"Traumatology and Orthopedic Surgery",es_ES:"Traumatología y Cirugía Ortopédica",ca_ES:"Traumatologia i Cirurgia Ortopèdica",pt_PT:"Traumatologia e Cirurgia Ortopédica"},gynecology:{de_DE:"Gynäkologie",en_US:"Gynecology",es_ES:"Ginecología",ca_ES:"Ginecologia",pt_PT:"Ginecologia"},endocrinology:{de_DE:"Endokrinologie",en_US:"Endocrinology",es_ES:"Endocrinología",ca_ES:"Endocrinologia",pt_PT:"Endocrinologia"},psychiatry:{de_DE:"Psychiatrie",en_US:"Psychiatry",es_ES:"Psiquiatría",ca_ES:"Psiquiatria",pt_PT:"Psiquiatria"}},i={videocall:{de_DE:"Videosprechstunde",en_US:"Videocall",es_ES:"Videoconsulta",ca_ES:"Videoconsulta",pt_PT:"Videoconsulta"},phonecall:{de_DE:"Telefonische Behandlung",en_US:"Phone consultation",es_ES:"Consulta telefónica",ca_ES:"Consulta telefònica",pt_PT:"Consulta telefónica"}},n={de_DE:"Konsultationspreis",en_US:"Consultation price",es_ES:"Precio de consulta",ca_ES:"Preu de consulta",pt_PT:"Preço da consulta"},t={videocall:"videocall",phonecall:"phonecall",adeslas_videocall:"videocall",adeslas_prod_videocall:"videocall",adeslas_phonecall:"phonecall",adeslas_prod_phonecall:"phonecall"};function l(o,a,e){if(!o)return e??"";const l=t[o];return l?i[l][a]:e??n[a]}var r={consulta_telefonica:"phonecall",videoconsulta:"videocall"},c={"aparato-digestivo":"digestive_system","cirugia-ortopedica-y-traumatologia":"orthopedic_surgery_traumatology",ginecologia:"gynecology",endocrinologia:"endocrinology",psiquiatria:"psychiatry"};function s(o,a,i){const n=i?.trim();if(n)return n;const t=e[o]?.[a];return void 0!==t?t:o}export{r as S,s as a,c as b,l as c,e as d,a as g};
@@ -0,0 +1 @@
1
+ import{_ as t,c as e}from"./custom-element-D2ziPxYE.js";import{E as s,i,a as o,x as n}from"./lit-element-DiWJYFwC.js";import{n as r}from"./property-scuRaFcM.js";import{r as l}from"./state-LQivXIgA.js";import{e as a}from"./class-map-Co76I6aw.js";import{i as d,t as c,e as p}from"./directive-2EDmOukv.js";import{o as v}from"./style-map-CIdqdn7C.js";import"../ui/mq-text-button.js";const u={},m=(t,e=u)=>t._$AH=e,x=(t,e)=>{const s=t._$AN;if(void 0===s)return!1;for(const t of s)t._$AO?.(e,!1),x(t,e);return!0},$=t=>{let e,s;do{if(void 0===(e=t._$AM))break;s=e._$AN,s.delete(t),t=e}while(0===s?.size)},b=t=>{for(let e;e=t._$AM;t=e){let s=e._$AN;if(void 0===s)e._$AN=s=new Set;else if(s.has(t))break;s.add(t),A(e)}};function _(t){void 0!==this._$AN?($(this),this._$AM=t,b(this)):this._$AM=t}function g(t,e=!1,s=0){const i=this._$AH,o=this._$AN;if(void 0!==o&&0!==o.size)if(e)if(Array.isArray(i))for(let t=s;t<i.length;t++)x(i[t],!1),$(i[t]);else null!=i&&(x(i,!1),$(i));else x(this,t)}const A=t=>{t.type==c.CHILD&&(t._$AP??=g,t._$AQ??=_)};class f extends d{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,e,s){super._$AT(t,e,s),b(this),this.isConnected=t._$AU}_$AO(t,e=!0){t!==this.isConnected&&(this.isConnected=t,t?this.reconnected?.():this.disconnected?.()),e&&(x(this,t),$(this))}setValue(t){if((t=>void 0===t.strings)(this._$Ct))this._$Ct._$AI(t,this);else{const e=[...this._$Ct._$AH];e[this._$Ci]=t,this._$Ct._$AI(e,this,0)}}disconnected(){}reconnected(){}}class h{}const y=new WeakMap,w=p(class extends f{render(t){return s}update(t,[e]){const i=e!==this.G;return i&&void 0!==this.G&&this.rt(void 0),(i||this.lt!==this.ct)&&(this.G=e,this.ht=t.options?.host,this.rt(this.ct=t.element)),s}rt(t){if(this.isConnected||(t=void 0),"function"==typeof this.G){const e=this.ht??globalThis;let s=y.get(e);void 0===s&&(s=new WeakMap,y.set(e,s)),void 0!==s.get(this.G)&&this.G.call(this.ht,void 0),s.set(this.G,t),void 0!==t&&this.G.call(this.ht,t)}else this.G.value=t}get lt(){return"function"==typeof this.G?y.get(this.ht??globalThis)?.get(this.G):this.G?.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}}),C=i`:host{display:flex;flex-direction:column;gap:var(--sp-1)}.text{margin:0}.text.is-clamped{display:-webkit-box;-webkit-box-orient:vertical;overflow:hidden}.toggle{align-self:flex-start}`;let G=class MqClampedText extends o{constructor(){super(...arguments),this.lines=2,this.expandLabel="",this.collapseLabel="",this.expanded=!1,this.overflowing=!1,this.textRef=new h,this.measure=()=>{const t=this.textRef.value;if(!t||this.expanded)return;const e=t.scrollHeight-t.clientHeight>1;e!==this.overflowing&&(this.overflowing=e)}}static{this.styles=C}updated(){const t=this.textRef.value;t&&!this.resizeObserver&&(this.resizeObserver=new ResizeObserver(()=>this.measure()),this.resizeObserver.observe(t)),this.measure()}disconnectedCallback(){super.disconnectedCallback(),this.resizeObserver?.disconnect(),this.resizeObserver=void 0}render(){return n`<div ${w(this.textRef)} class="text ${a({"is-clamped":!this.expanded})}" style="${v({"-webkit-line-clamp":this.expanded?"":String(this.lines)})}"><slot @slotchange="${this.measure}"></slot></div>${this.expanded||this.overflowing?n`<mq-text-button class="toggle" type="button" size="sm" fontWeight="normal" underlined @click="${()=>{this.expanded=!this.expanded}}">${this.expanded?this.collapseLabel:this.expandLabel}</mq-text-button>`:s}`}};t([r({type:Number})],G.prototype,"lines",void 0),t([r({type:String,attribute:"expand-label"})],G.prototype,"expandLabel",void 0),t([r({type:String,attribute:"collapse-label"})],G.prototype,"collapseLabel",void 0),t([l()],G.prototype,"expanded",void 0),t([l()],G.prototype,"overflowing",void 0),G=t([e("mq-clamped-text")],G);export{G as M,f,m};
@@ -0,0 +1 @@
1
+ import{_ as t,c as e}from"./custom-element-D2ziPxYE.js";import{i as o,a as i,x as r}from"./lit-element-DiWJYFwC.js";import{n}from"./property-scuRaFcM.js";import{r as a}from"./state-LQivXIgA.js";import{downloadIcon as s}from"../ui/icons/download-icon.js";import"../ui/mq-button.js";import{m as l}from"./runtime-Bg1WXVCx.js";import{l as d}from"./localized-decorator-BlOuLhym.js";import{a as p,D as c}from"./api-chat-client-DLOZVIkT.js";import{b as m}from"./blob-to-base64-CUL1trde.js";import{DownloadFileEvent as f}from"../events.js";import{getLocale as h}from"../i18n.js";const v=o`:host{display:flex;justify-content:space-between;align-items:center;gap:var(--sp-4);width:100%}.left{display:flex;flex-direction:column;gap:var(--sp-1);flex:1;min-width:0}.tag{border-radius:var(--border-radius-sm);display:inline-flex;align-items:center;justify-content:center;padding:var(--sp-0_5) var(--sp-2);background-color:#e5e5e5;width:fit-content}.tag-label{font-family:var(--font-body);font-size:11px;font-weight:var(--font-weight-medium);color:var(--color-neutrals-text-default);text-transform:uppercase;letter-spacing:3px;line-height:normal}.title{font-family:var(--font-body);font-size:var(--text-sm);font-weight:var(--font-weight-bold);color:var(--color-neutrals-text-default);line-height:normal;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.description{font-family:var(--font-body);font-size:var(--text-sm);font-weight:var(--font-weight-normal);color:var(--color-neutrals-text-default);line-height:normal;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}`;let g=class PatientDocument extends i{constructor(){super(...arguments),this.isDownloading=!1}static{this.styles=v}getFormatter(){const t=h().replace("_","-");return new Intl.DateTimeFormat(t,{year:"numeric",month:"numeric",day:"numeric"})}async _handleDownload(){this.isDownloading=!0;const t=await p.flash.downloadDocument({url:this.downloadUrl}),e=await m(t);this.dispatchEvent(new f({url:e,filename:`${this.filename}.pdf`})),this.isDownloading=!1}formatKind(t){switch(t){case c.prescription:return l("Receta");case c.report:return l("Informe");case c.diagnosticTestPrescription:return l("Prescripción")}}render(){const t=this.getFormatter().format(new Date(this.date));return r`<div class="left"><div class="tag"><span class="tag-label">${this.formatKind(this.kind)}</span></div><div class="title">${t} - ${this.specialty}</div><div class="description">${this.description}</div></div><mq-button variant="ghost" size="icon-lg" @click="${this._handleDownload}" ?disabled="${this.isDownloading}">${s({size:24})}</mq-button>`}};t([n({type:String})],g.prototype,"kind",void 0),t([n({type:String})],g.prototype,"filename",void 0),t([n({type:String})],g.prototype,"specialty",void 0),t([n({type:String})],g.prototype,"description",void 0),t([n({type:String})],g.prototype,"date",void 0),t([n({type:String})],g.prototype,"downloadUrl",void 0),t([a()],g.prototype,"isDownloading",void 0),g=t([d(),e("patient-document")],g);