@mediquo/elements 0.4.0 → 0.5.1

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 (147) hide show
  1. package/README.md +86 -1
  2. package/dist/chunks/api-chat-client-vbjgaIRV.js +1 -0
  3. package/dist/chunks/{apple-pay-outcomes-BNkcTbbM.js → apple-pay-outcomes-DxrMPQqB.js} +1 -1
  4. package/dist/chunks/appointment-card-skeleton-1c7552Ln.d.ts +398 -0
  5. package/dist/chunks/appointment-card-skeleton-CYFfacro.js +1 -0
  6. package/dist/chunks/chunk-4FFT6DC2-CVWibomC.js +1 -0
  7. package/dist/chunks/chunk-GZF3YFSX-BzloXkVp.js +1 -0
  8. package/dist/chunks/chunk-RCFIJTXZ-C6Ir0-sM.js +1 -0
  9. package/dist/chunks/chunk-S5RWG6G2-DPesx3Od.js +1 -0
  10. package/dist/chunks/chunk-YMQSBQHL-De_r7BNk.js +1 -0
  11. package/dist/chunks/chunk-YTQUGGS3-p18naHsk.js +1 -0
  12. package/dist/chunks/consume-CovVqBjI.js +1 -0
  13. package/dist/chunks/context-consumer-ESdICVAb.js +1 -0
  14. package/dist/chunks/context-provider--AKuwfs9.js +1 -0
  15. package/dist/chunks/create-context-DqP79qjF.js +1 -0
  16. package/dist/chunks/documentation-view-CS4Q-UpO.js +1 -0
  17. package/dist/chunks/external-mrLCXx_f.js +1 -0
  18. package/dist/chunks/{format-Cm3B1GMy.js → format-CRFiCNHw.js} +1 -1
  19. package/dist/chunks/get-appointment-query-Ck68BEMg.js +1 -0
  20. package/dist/chunks/get-patient-documents-query-DIQH-TMM.js +1 -0
  21. package/dist/chunks/get-patient-profile-query-B0tUDJmT.js +1 -0
  22. package/dist/chunks/i18n-formats-DYS91YEa.js +1 -0
  23. package/dist/chunks/index-BJYWtEmT.js +1 -0
  24. package/dist/chunks/index-CGnPsMVQ.js +1 -0
  25. package/dist/chunks/index-CvDnN2NR.js +1 -0
  26. package/dist/chunks/index-DBMxJ4Dp.js +1 -0
  27. package/dist/chunks/index-DNUbmrQl.d.ts +31 -0
  28. package/dist/chunks/index-czcKClL3.d.ts +47 -0
  29. package/dist/chunks/index-yd2JNJSr.js +1 -0
  30. package/dist/chunks/isBefore-CPpTogxo.js +1 -0
  31. package/dist/chunks/{isSameDay-DPfclwIL.js → isSameDay-CuhZMy1T.js} +1 -1
  32. package/dist/chunks/localized-decorator-BlOuLhym.js +1 -0
  33. package/dist/chunks/mq-layout-CGcdxGMQ.js +1 -0
  34. package/dist/chunks/mq-professional-presence-sync-cmg6CXhz.d.ts +22 -0
  35. package/dist/chunks/mq-unread-count-sync-DTn9dfR4.d.ts +22 -0
  36. package/dist/chunks/mutation-controller-CR2qcqhH.js +1 -0
  37. package/dist/chunks/parseISO-Dj3qSTG8.js +1 -0
  38. package/dist/chunks/price-CdF63nRC.js +1 -0
  39. package/dist/chunks/professional-overview-CfjgnTw4.js +1 -0
  40. package/dist/chunks/{provide-CfT7g_Zi.js → provide-D2fnEhT2.js} +1 -1
  41. package/dist/chunks/query-Cjvi4_dT.js +1 -0
  42. package/dist/chunks/query-controller-BlO1Ax65.js +1 -0
  43. package/dist/chunks/{refund-cancel-policy-CnbrIqH0.js → refund-cancel-policy-Bl9qE8wD.js} +1 -1
  44. package/dist/chunks/schemas.d-5LR6aN9I.d.ts +134 -0
  45. package/dist/chunks/telemetry-client-BLJVs9me.js +1 -0
  46. package/dist/env.js +1 -1
  47. package/dist/events.d.ts +11 -1
  48. package/dist/events.js +1 -1
  49. package/dist/i18n.js +1 -1
  50. package/dist/index.d.ts +1 -1
  51. package/dist/index.js +1 -1
  52. package/dist/mq-apple-pay-checkout.js +1 -1
  53. package/dist/mq-appointment-checkout.js +1 -1
  54. package/dist/mq-appointment-documentation.d.ts +48 -0
  55. package/dist/mq-appointment-documentation.js +1 -0
  56. package/dist/mq-chat-room.js +1 -1
  57. package/dist/mq-checkout.js +1 -1
  58. package/dist/mq-dashboard.d.ts +224 -0
  59. package/dist/mq-dashboard.js +1 -0
  60. package/dist/mq-documents.d.ts +46 -0
  61. package/dist/mq-documents.js +1 -0
  62. package/dist/mq-google-pay-checkout.js +1 -1
  63. package/dist/mq-immediate-videocall-checkout.js +1 -1
  64. package/dist/mq-my-appointments.d.ts +13 -525
  65. package/dist/mq-my-appointments.js +1 -1
  66. package/dist/mq-professional-presence-sync.d.ts +30 -0
  67. package/dist/mq-professional-presence-sync.js +1 -0
  68. package/dist/mq-query-client-provider.js +1 -1
  69. package/dist/mq-schedule-success.d.ts +9 -0
  70. package/dist/mq-schedule-success.js +2 -2
  71. package/dist/mq-schedule.d.ts +22 -10
  72. package/dist/mq-schedule.js +1 -1
  73. package/dist/mq-session-provider.d.ts +28 -0
  74. package/dist/mq-session-provider.js +1 -0
  75. package/dist/mq-socket-provider.js +1 -1
  76. package/dist/mq-support-chat.js +1 -1
  77. package/dist/mq-terms-and-conditions.d.ts +23 -0
  78. package/dist/mq-terms-and-conditions.js +1 -0
  79. package/dist/mq-unread-count-sync.d.ts +21 -0
  80. package/dist/mq-unread-count-sync.js +1 -0
  81. package/dist/mq-videocall.d.ts +35 -26
  82. package/dist/mq-videocall.js +1 -1
  83. package/dist/react/mq-apple-pay-checkout.d.ts +24 -7
  84. package/dist/react/mq-apple-pay-checkout.js +1 -1
  85. package/dist/react/mq-appointment-checkout.d.ts +20 -5
  86. package/dist/react/mq-appointment-checkout.js +1 -1
  87. package/dist/react/mq-appointment-documentation.d.ts +39 -0
  88. package/dist/react/mq-appointment-documentation.js +2 -0
  89. package/dist/react/mq-chat-room.d.ts +31 -6
  90. package/dist/react/mq-chat-room.js +1 -1
  91. package/dist/react/mq-checkout.d.ts +22 -8
  92. package/dist/react/mq-checkout.js +1 -1
  93. package/dist/react/mq-dashboard.d.ts +57 -0
  94. package/dist/react/mq-dashboard.js +2 -0
  95. package/dist/react/mq-documents.d.ts +27 -0
  96. package/dist/react/mq-documents.js +2 -0
  97. package/dist/react/mq-google-pay-checkout.d.ts +29 -7
  98. package/dist/react/mq-google-pay-checkout.js +1 -1
  99. package/dist/react/mq-immediate-videocall-checkout.d.ts +15 -5
  100. package/dist/react/mq-immediate-videocall-checkout.js +1 -1
  101. package/dist/react/mq-my-appointments.d.ts +27 -6
  102. package/dist/react/mq-my-appointments.js +1 -1
  103. package/dist/react/mq-professional-presence-sync.d.ts +13 -0
  104. package/dist/react/mq-professional-presence-sync.js +2 -0
  105. package/dist/react/mq-query-client-provider.d.ts +9 -2
  106. package/dist/react/mq-query-client-provider.js +1 -1
  107. package/dist/react/mq-schedule-success.d.ts +31 -5
  108. package/dist/react/mq-schedule-success.js +1 -1
  109. package/dist/react/mq-schedule.d.ts +47 -6
  110. package/dist/react/mq-schedule.js +1 -1
  111. package/dist/react/mq-session-provider.d.ts +19 -0
  112. package/dist/react/mq-session-provider.js +2 -0
  113. package/dist/react/mq-socket-provider.d.ts +13 -2
  114. package/dist/react/mq-socket-provider.js +1 -1
  115. package/dist/react/mq-support-chat.d.ts +31 -2
  116. package/dist/react/mq-support-chat.js +1 -1
  117. package/dist/react/mq-terms-and-conditions.d.ts +30 -0
  118. package/dist/react/mq-terms-and-conditions.js +2 -0
  119. package/dist/react/mq-theme-provider.d.ts +13 -2
  120. package/dist/react/mq-toast-container.d.ts +16 -0
  121. package/dist/react/mq-toast-container.js +2 -0
  122. package/dist/react/mq-unread-count-sync.d.ts +13 -0
  123. package/dist/react/mq-unread-count-sync.js +2 -0
  124. package/dist/react/mq-videocall.d.ts +33 -3
  125. package/dist/react/mq-videocall.js +1 -1
  126. package/dist/toast.d.ts +3 -0
  127. package/dist/toast.js +1 -0
  128. package/dist/ui/mq-calendar.js +1 -1
  129. package/dist/ui/mq-time-slot-picker.js +1 -1
  130. package/dist/ui/mq-toast.js +1 -1
  131. package/package.json +33 -1
  132. package/dist/chunks/api-chat-client-C8SqZtCa.js +0 -1
  133. package/dist/chunks/chunk-S5RWG6G2-oTcdgk2H.js +0 -1
  134. package/dist/chunks/chunk-YTQUGGS3-DN-JZpgG.js +0 -1
  135. package/dist/chunks/context-provider-CiMFpvDA.js +0 -1
  136. package/dist/chunks/exports-G_7Ih_GH.js +0 -1
  137. package/dist/chunks/external-zAbuzxDj.js +0 -1
  138. package/dist/chunks/get-patient-profile-query-C8T8DJ7z.js +0 -1
  139. package/dist/chunks/index-Bxh8Qfwr.js +0 -1
  140. package/dist/chunks/index-DiqYAEHW.js +0 -1
  141. package/dist/chunks/isBefore-Cof0D841.js +0 -1
  142. package/dist/chunks/mq-layout-CpIZTsV2.js +0 -1
  143. package/dist/chunks/mutation-controller-OVT8NEt6.js +0 -1
  144. package/dist/chunks/parseISO-jT42c8Ob.js +0 -1
  145. package/dist/chunks/price-tImUmtpX.js +0 -1
  146. package/dist/chunks/query-QJ1INUTG.js +0 -1
  147. package/dist/chunks/telemetry-client-BRVJU-fZ.js +0 -1
@@ -0,0 +1 @@
1
+ import{_ as t,t as e}from"./custom-element-DA9Fxvxd.js";import{c as i}from"./consume-CovVqBjI.js";import{m as a,s as o}from"./runtime-Bg1WXVCx.js";import{l as n}from"./localized-decorator-BlOuLhym.js";import{Q as s}from"./query-controller-BlO1Ax65.js";import{g as p}from"./get-organization-setup-query-BMbuRi6v.js";import{g as r,a as l}from"./i18n-formats-DYS91YEa.js";import{g as c,c as d}from"./refund-cancel-policy-Bl9qE8wD.js";import{g as h}from"./chunk-GZF3YFSX-BzloXkVp.js";import{a as m,i as u,x as g,E as v}from"./lit-element-DiWJYFwC.js";import{n as f}from"./property-scuRaFcM.js";import{r as y}from"./state-LQivXIgA.js";import{getLocale as b}from"../i18n.js";import{a as $,A as C,i as x}from"./api-chat-client-vbjgaIRV.js";import{h as q,f as w}from"./price-CdF63nRC.js";import"../ui/mq-card.js";import"./professional-overview-CfjgnTw4.js";import{l as k}from"./chunk-S5RWG6G2-DPesx3Od.js";import"../mq-chat-room.js";import"../ui/mq-floating-bubble.js";import{Q as j}from"./chunk-RCFIJTXZ-C6Ir0-sM.js";import{M as S}from"./mutation-controller-CR2qcqhH.js";import"../ui/mq-button.js";import"../ui/mq-dialog.js";import{t as R,j as D,k as I,l as M,n as O,o as E,p as z}from"./telemetry-client-BLJVs9me.js";import{e as A}from"./class-map-Co76I6aw.js";import{MqAppointmentRescheduleEvent as U,MqAppointmentBookEvent as _,MqAppointmentJoinVideocallEvent as H,MqAppointmentViewDocumentationEvent as N}from"../events.js";import{messageBubbleIcon as T}from"../ui/icons/message-bubble-icon.js";import{videoIcon as B}from"../ui/icons/video-icon.js";import"../ui/mq-unread-badge.js";import{toast as P}from"../ui/mq-toast.js";function Q(t,e){return{queryKey:["appointments",e],queryFn:()=>t.appointments.getAppointments(e)}}let V=class CancelAppointmentConfirmationDialog extends m{constructor(){super(...arguments),this.open=!1,this.cancelAppointmentMutation=new S(this,{mutationFn:async t=>$.appointments.cancelAppointment(t),onSuccess:()=>{this.queryClientContext?.invalidateQueries(),this.dispatchEvent(new CustomEvent("success",{bubbles:!0,composed:!0}))}}),this.handleClose=()=>{this.open=!1,this.dispatchEvent(new CustomEvent("cancel",{bubbles:!0,composed:!0}))},this.handleDismissClick=()=>{this.open=!1,this.dispatchEvent(new CustomEvent("cancel",{bubbles:!0,composed:!0}))},this.handleConfirmClick=()=>{this.cancelAppointmentMutation.run({id:this.appointmentId})}}static{this.styles=u`:host{display:contents}h2{font-family:var(--font-titles);font-size:var(--text-2xl);line-height:var(--text-2xl--line-height);font-weight:var(--font-weight-bold);margin:0}p{font-family:var(--font-body);font-size:var(--text-sm);line-height:var(--text-sm--line-height);font-weight:var(--font-weight-normal);margin:0}.subheading-payable{font-size:var(--text-base);line-height:22px}.price-rows{display:flex;flex-direction:column;font-family:var(--font-body);font-size:var(--text-sm);font-weight:var(--font-weight-medium);line-height:var(--text-sm--line-height);color:var(--color-card-foreground);width:100%;margin-bottom:var(--sp-4)}.price-row{display:flex;align-items:center;justify-content:space-between;min-height:34px;gap:var(--sp-2)}.price-row span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.actions{display:flex;gap:var(--sp-3);margin-top:var(--sp-4);justify-content:flex-end;flex-wrap:wrap}`}render(){const t=b(),e=this.price,i=q(e),o=this.cancelAppointmentMutation.isPending;if(i){const i=w(e,t),n=`-${i}`;return g`<mq-dialog .open="${this.open}" @mq-close="${this.handleClose}" dismissable><h2 slot="heading">${a("Confirmar cancelación")}</h2><p slot="subheading" class="subheading-payable">${a("¿Seguro que quieres cancelar esta cita? Se te devolverá el importe pagado en un plazo de 5-10 días hábiles.")}</p><div><div class="price-rows"><div class="price-row"><span>${a("Importe pagado")}</span> <span>${i}</span></div><div class="price-row"><span>${a("Importe a devolver")}</span> <span>${n}</span></div></div><div class="actions"><mq-button variant="outline" ?disabled="${o}" @click="${this.handleDismissClick}">${a("Volver")}</mq-button><mq-button variant="primary" ?disabled="${o}" @click="${this.handleConfirmClick}">${a("Confirmar")}</mq-button></div></div></mq-dialog>`}return g`<mq-dialog .open="${this.open}" @mq-close="${this.handleClose}" dismissable><h2 slot="heading">${a("Confirmar cancelación")}</h2><p slot="subheading">${a("¿Seguro que quieres cancelar esta cita?")}</p><div><div class="actions"><mq-button variant="outline" ?disabled="${o}" @click="${this.handleDismissClick}">${a("Cancelar")}</mq-button><mq-button variant="primary" ?disabled="${o}" @click="${this.handleConfirmClick}">${a("Confirmar")}</mq-button></div></div></mq-dialog>`}};t([f({type:Boolean,reflect:!0})],V.prototype,"open",void 0),t([i({context:j,subscribe:!0})],V.prototype,"queryClientContext",void 0),t([f({type:String})],V.prototype,"appointmentId",void 0),t([f({type:Object})],V.prototype,"price",void 0),V=t([n(),e("cancel-appointment-confirmation-dialog")],V);let F=class AppointmentActionUnavailableDialog extends m{constructor(){super(...arguments),this.open=!1,this.heading="",this.message="",this.handleClose=()=>{this.open=!1,this.dispatchEvent(new CustomEvent("close",{bubbles:!0,composed:!0}))}}static{this.styles=u`:host{display:contents}mq-dialog::part(dialog){max-width:343px;min-width:0}h2{font-family:var(--font-titles);font-size:var(--text-2xl);line-height:var(--text-2xl--line-height);font-weight:var(--font-weight-bold);margin:0}p{font-family:var(--font-body);font-size:var(--text-sm);line-height:var(--text-sm--line-height);font-weight:var(--font-weight-normal);margin:0}.actions{display:flex;margin-top:var(--sp-4)}`}render(){return g`<mq-dialog .open="${this.open}" @mq-close="${this.handleClose}" dismissable><h2 slot="heading">${this.heading}</h2><p slot="subheading">${this.message}</p><div class="actions"><mq-button variant="primary" fullwidth @click="${this.handleClose}">${a("Volver")}</mq-button></div></mq-dialog>`}};t([f({type:Boolean,reflect:!0})],F.prototype,"open",void 0),t([f({type:String})],F.prototype,"heading",void 0),t([f({type:String})],F.prototype,"message",void 0),F=t([n(),e("appointment-action-unavailable-dialog")],F);let L=class AppointmentCardActions extends m{constructor(){super(...arguments),this.variant="next",this.isVideocall=!1,this.hasChatSupport=!1,this.unreadCount=0,this.isModifyUnavailable=!1,this.isCancelUnavailable=!1,this.hasNoSlots=!1,this.modifyUnavailableMessage="",this.cancelUnavailableMessage="",this.repeatTarget=null,this.professionalHash="",this.openDialog=null,this.handleModifyClick=()=>{this.isModifyUnavailable?this.openDialog="modify":(R.track(D(this.patientHash,this.appointmentId)),this.dispatchEvent(new U({appointmentId:this.appointmentId})))},this.handleCancelClick=()=>{this.isCancelUnavailable?this.openDialog="cancel":(R.track(I(this.patientHash,this.appointmentId)),this.dispatchEvent(new CustomEvent("request-cancel",{bubbles:!0,composed:!0})))},this.handleRepeatClick=()=>{this.hasNoSlots?this.openDialog="repeat-no-slots":this.repeatTarget?(R.track(M(this.patientHash,this.appointmentId)),this.dispatchEvent(new _({specialty:this.repeatTarget.specialty,service:this.repeatTarget.service,professional:this.professionalHash}))):this.openDialog="repeat-error"},this.handleDialogClose=()=>{this.openDialog=null}}static{this.styles=u`:host{display:contents}.actions{display:flex;gap:var(--sp-3);margin-top:var(--sp-2)}.actions.next{flex-direction:column}.actions-secondary{display:flex;gap:var(--sp-3)}.actions mq-button{flex:1}`}get patientHash(){return this.loginToken.patient.hash}renderChatButton(){return g`<mq-button variant="primary" fullwidth noPadding @click="${()=>{this.dispatchEvent(new CustomEvent("toggle-chat",{bubbles:!0,composed:!0}))}}">${T({size:24})} ${a("Chat")} ${this.unreadCount>0?g`<mq-unread-badge></mq-unread-badge>`:v}</mq-button>`}renderNextActions(){return g`${this.isVideocall?g`<mq-button variant="outline" fullwidth noPadding @click="${()=>{R.track(O(this.patientHash,this.appointmentId)),this.dispatchEvent(new H({appointmentId:this.appointmentId}))}}">${B({size:24})} ${a("Ir a videollamada")}</mq-button>`:v}<div class="actions-secondary">${this.hasChatSupport?this.renderChatButton():v}<mq-button variant="outline" fullwidth noPadding @click="${this.handleModifyClick}">${a("Modificar")}</mq-button><mq-button variant="outline-negative" fullwidth noPadding @click="${this.handleCancelClick}">${a("Cancelar")}</mq-button></div>`}renderHistoryActions(){return g`${this.hasChatSupport?this.renderChatButton():v}<mq-button variant="outline" fullwidth noPadding @click="${()=>{R.track(E(this.patientHash,this.appointmentId)),this.dispatchEvent(new N({appointmentId:this.appointmentId}))}}">${a("Documentos")}</mq-button><mq-button variant="outline" fullwidth noPadding @click="${this.handleRepeatClick}">${a("Repetir")}</mq-button>`}render(){return g`<div class="${A({actions:!0,next:"next"===this.variant})}">${"next"===this.variant?this.renderNextActions():this.renderHistoryActions()}</div><appointment-action-unavailable-dialog .open="${"modify"===this.openDialog}" .heading="${a("Modificar cita")}" .message="${this.modifyUnavailableMessage}" @close="${this.handleDialogClose}"></appointment-action-unavailable-dialog><appointment-action-unavailable-dialog .open="${"cancel"===this.openDialog}" .heading="${a("Anular cita")}" .message="${this.cancelUnavailableMessage}" @close="${this.handleDialogClose}"></appointment-action-unavailable-dialog><appointment-action-unavailable-dialog .open="${"repeat-no-slots"===this.openDialog}" .heading="${a("Repetir cita")}" .message="${a("Este profesional no tiene horarios disponibles")}" @close="${this.handleDialogClose}"></appointment-action-unavailable-dialog><appointment-action-unavailable-dialog .open="${"repeat-error"===this.openDialog}" .heading="${a("Repetir cita")}" .message="${a("Lo sentimos, no hemos podido repetir tu cita. Por favor, contacta con soporte.")}" @close="${this.handleDialogClose}"></appointment-action-unavailable-dialog>`}};function G(t){const{action:e,refundPolicySeconds:i}=t,n=null!=i&&i<3600,s=Math.ceil((i??0)/60),p=Math.ceil((i??0)/3600);return a(0===(n?s:p)?"modify"===e?"Esta cita ya ha pasado, por lo que no se puede modificar.":"Esta cita ya ha pasado, por lo que no se puede anular.":"modify"===e?n?o`Lo sentimos, como faltan menos de ${s} minutos para tu cita no podemos modificarla.`:o`Lo sentimos, como faltan menos de ${p} horas para tu cita no podemos modificarla.`:n?o`Lo sentimos, como faltan menos de ${s} minutos para tu cita no podemos anularla.`:o`Lo sentimos, como faltan menos de ${p} horas para tu cita no podemos anularla.`)}t([i({context:k})],L.prototype,"loginToken",void 0),t([f({type:String})],L.prototype,"variant",void 0),t([f({type:String})],L.prototype,"appointmentId",void 0),t([f({type:Boolean})],L.prototype,"isVideocall",void 0),t([f({type:Boolean})],L.prototype,"hasChatSupport",void 0),t([f({type:Number})],L.prototype,"unreadCount",void 0),t([f({type:Boolean})],L.prototype,"isModifyUnavailable",void 0),t([f({type:Boolean})],L.prototype,"isCancelUnavailable",void 0),t([f({type:Boolean})],L.prototype,"hasNoSlots",void 0),t([f({type:String})],L.prototype,"modifyUnavailableMessage",void 0),t([f({type:String})],L.prototype,"cancelUnavailableMessage",void 0),t([f({type:Object})],L.prototype,"repeatTarget",void 0),t([f({type:String})],L.prototype,"professionalHash",void 0),t([y()],L.prototype,"openDialog",void 0),L=t([n(),e("appointment-card-actions")],L);let X=class AppointmentCard extends m{constructor(){super(...arguments),this.variant="next",this.detailsVariant="wide",this.isChatOpen=!1,this.isCancelDialogOpen=!1,this.unreadQuery=new s(this,()=>h($,{roomId:this.appointmentResource?.room?.id})),this.getOrganizationSpecialtiesQuery=new s(this,()=>r($,{enabled:!!this.appointmentResource?.speciality?.id})),this.getOrganizationSetupQuery=new s(this,()=>p($)),this.getScheduleServicesQuery=new s(this,()=>c($))}static{this.styles=u`:host{display:flex}.card{width:100%;padding:var(--sp-6);display:flex;flex-direction:column;gap:var(--sp-4);justify-content:space-between}.card-top-content{display:flex;flex-direction:column;gap:var(--sp-6)}.see-details{color:var(--color-primary-link-default);font-size:var(--text-sm);line-height:var(--text-sm--line-height);font-weight:var(--font-weight-bold)}.see-details:hover{text-decoration:underline}.chevron-down{width:16px;height:16px;transition:transform .2s ease}.appointment-details{display:flex;flex-direction:column;gap:12px}.clock-icon-wrapper{width:24px;height:24px;display:flex;align-items:center;justify-content:center;flex-shrink:0}.clock-icon-wrapper svg{width:100%;height:100%}.appointment-type{display:flex;align-items:center;gap:12px;font-size:18px;color:#2c3e50}.actions{display:flex;gap:var(--sp-3);margin-top:var(--sp-2)}.actions.next{flex-direction:column}.actions-secondary{display:flex;gap:var(--sp-3)}.actions mq-button{flex:1}`}render(){const t=this.appointmentResource.appointment.channel===C.videocall,e=this.appointmentResource.appointment.channel===C.phonecall,i=!0===this.getOrganizationSetupQuery.result?.data?.appointments?.has_chat_in_appointment,o=(t||e)&&i,n=b(),s=x(this.appointmentResource.appointment.expires_at),p=0===this.appointmentResource.slots.length,r=this.getOrganizationSetupQuery.result?.data?.appointments?.seconds_before_start_to_refund_on_cancel,c=d({startsAtIso:this.appointmentResource.appointment.starts_at,refundPolicySeconds:r}),h=s||p||!c,m=s||!c,u=G({action:"modify",refundPolicySeconds:r}),f=G({action:"cancel",refundPolicySeconds:r}),y=this.getOrganizationSpecialtiesQuery.result?.data?.find(t=>Number(t.id)===Number(this.appointmentResource.speciality.id)),$=l(y?.code??"",n,y?.name??this.appointmentResource.speciality.name),q=this.getScheduleServicesQuery.result?.data?.find(t=>t.id===this.appointmentResource.appointment.service_id)?.code,w=y?.code&&q?{specialty:y.code,service:q}:null;return g`<mq-card class="card" roundness="md"><div class="card-top-content"><professional-overview .specialtyName="${$??""}" .collegiateNumber="${this.appointmentResource.professional.collegiate_number??void 0}" .description="${this.appointmentResource.professional.description??""}" .languages="${this.appointmentResource.professional.languages}" .avatar="${this.appointmentResource.professional.avatar??""}" .name="${this.appointmentResource.professional.name}"></professional-overview><appointment-details .startsAt="${this.appointmentResource.appointment.starts_at}" .duration="${this.appointmentResource.appointment.duration}" .channel="${this.appointmentResource.appointment.channel}" .timezone="${this.loginToken?.patient?.timezone}" variant="${this.detailsVariant}"></appointment-details></div><appointment-card-actions .variant="${this.variant}" .appointmentId="${this.appointmentResource.appointment.id??""}" .isVideocall="${t}" .hasChatSupport="${o}" .unreadCount="${this.unreadQuery.result?.data?.unread_count??0}" .isModifyUnavailable="${h}" .isCancelUnavailable="${m}" .hasNoSlots="${p}" .modifyUnavailableMessage="${u}" .cancelUnavailableMessage="${f}" .repeatTarget="${w}" .professionalHash="${this.appointmentResource.professional.hash}" @toggle-chat="${()=>{this.isChatOpen=!this.isChatOpen,this.isChatOpen&&R.track(z(this.loginToken.patient.hash,this.appointmentResource.appointment.id??""))}}" @request-cancel="${()=>{this.isCancelDialogOpen=!0}}"></appointment-card-actions><mq-floating-bubble ?dismissable="${!1}" .open="${this.isChatOpen}" @mq-close="${()=>{this.isChatOpen=!1}}" hideCloseButton>${this.isChatOpen?g`<mq-chat-room slot="content" .consultationId="${this.appointmentResource.appointment.id}" consultation-type="appointment" token="${this.loginToken.access_token}" .roomId="${this.appointmentResource.room.id}" .professionalHash="${this.appointmentResource.professional.hash}" @mq-chat-room-close="${()=>{this.isChatOpen=!1}}" ?readonly="${s}"></mq-chat-room>`:v}</mq-floating-bubble><cancel-appointment-confirmation-dialog .appointmentId="${this.appointmentResource.appointment.id}" .price="${this.appointmentResource.price??void 0}" .open="${this.isCancelDialogOpen}" @cancel="${()=>{this.isCancelDialogOpen=!1}}" @success="${()=>{this.isCancelDialogOpen=!1,P.success(a("Consulta anulada correctamente")),this.dispatchEvent(new CustomEvent("appointment-cancel-confirmed",{bubbles:!0,composed:!0,detail:{id:this.appointmentResource.appointment.id}}))}}"></cancel-appointment-confirmation-dialog></mq-card>`}};t([f({type:Object})],X.prototype,"appointmentResource",void 0),t([f({type:Number})],X.prototype,"specialtyId",void 0),t([f({type:String})],X.prototype,"variant",void 0),t([f({type:String})],X.prototype,"detailsVariant",void 0),t([i({context:k})],X.prototype,"loginToken",void 0),t([y()],X.prototype,"isChatOpen",void 0),t([y()],X.prototype,"isCancelDialogOpen",void 0),X=t([n(),e("appointment-card")],X);let Z=class AppointmentCardSkeleton extends m{static{this.styles=u`div{border-radius:var(--border-radius-md);background:color-mix(in srgb,var(--color-neutrals-background-disabled) 50%,#fff 50%);height:337px;width:100%}`}render(){return g`<div></div>`}};Z=t([e("appointment-card-skeleton")],Z);export{Q as g};
@@ -0,0 +1 @@
1
+ var o=new class _Logger{static{this.prefix="[@mediquo/web-components]"}#o(o,...e){console[o](_Logger.prefix,...e)}debug(...o){this.#o("debug",...o)}info(...o){this.#o("info",...o)}warn(...o){this.#o("warn",...o)}error(...o){this.#o("error",...o)}};export{o as l};
@@ -0,0 +1 @@
1
+ import{z as e}from"./external-mrLCXx_f.js";var r=e.enum(["ordinary","system"]).enum;function s(e,r,s){return{queryKey:["unread-messages",r],queryFn:()=>e.rooms.getUnreadMessagesCount(r),staleTime:0,...s}}export{r as S,s as g};
@@ -0,0 +1 @@
1
+ import{n as t}from"./create-context-DqP79qjF.js";var r=t(Symbol.for("tanstack-lit-query"));export{r as Q};
@@ -0,0 +1 @@
1
+ import{n as o}from"./create-context-DqP79qjF.js";var t=o(Symbol("login-token"));export{t as l};
@@ -0,0 +1 @@
1
+ function e(e,s,o){return{queryKey:["professionals",s.hash],queryFn:()=>e.professionals.getProfessional(s),staleTime:0,...o}}export{e as g};
@@ -0,0 +1 @@
1
+ import{n as e}from"./create-context-DqP79qjF.js";import{z as t}from"./external-mrLCXx_f.js";var n=e(Symbol.for("mq-socket")),a=t.enum(["message","messageStatus","room_accepted","room_rejected","call_requested","call_rejected","call_picked_up","appointment_created","appointment_cancelled","appointment_accepted","appointment_finished","appointment_expired","appointment_owed","appointment_paid","appointment_unpaid","appointment_uncharged","appointment_rescheduled","absence_cancelled","absence_created","appointment_reporting","consultation_assigned","consultation_finished","consultation_skipped","call_joined","message_deleted","stop_typing","typing","joinRoom"]).enum,o=class _EventReceivedEvent extends Event{constructor(e,t){super(_EventReceivedEvent.eventName,{bubbles:!0,composed:!0}),this.name=e,this.data=t}static{this.eventName="mq-event-received"}};export{o as E,n as S,a};
@@ -0,0 +1 @@
1
+ import{s as t}from"./context-consumer-ESdICVAb.js";function c({context:c,subscribe:e}){return(n,i)=>{"object"==typeof i?i.addInitializer(function(){new t(this,{context:c,callback:t=>{n.set.call(this,t)},subscribe:e})}):n.constructor.addInitializer(n=>{new t(n,{context:c,callback:t=>{n[i]=t},subscribe:e})})}}export{c};
@@ -0,0 +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};
@@ -0,0 +1 @@
1
+ import{s as t}from"./context-request-event-Dfydf1ub.js";class s{get value(){return this.o}set value(t){this.setValue(t)}setValue(t,o=!1){const n=o||!Object.is(t,this.o);this.o=t,n&&this.updateObservers()}constructor(t){this.subscriptions=new Map,this.updateObservers=()=>{for(const[t,{disposer:o}]of this.subscriptions)t(this.o,o)},void 0!==t&&(this.value=t)}addCallback(t,o,n){if(!n)return void t(this.value);this.subscriptions.has(t)||this.subscriptions.set(t,{disposer:()=>{this.subscriptions.delete(t)},consumerHost:o});const{disposer:r}=this.subscriptions.get(t);t(this.value,r)}clearCallbacks(){this.subscriptions.clear()}}class e extends Event{constructor(t,o){super("context-provider",{bubbles:!0,composed:!0}),this.context=t,this.contextTarget=o}}class i extends s{constructor(o,n,r){super(void 0!==n.context?n.initialValue:r),this.onContextRequest=t=>{if(t.context!==this.context)return;const o=t.contextTarget??t.composedPath()[0];o!==this.host&&(t.stopPropagation(),this.addCallback(t.callback,o,t.subscribe))},this.onProviderRequest=o=>{if(o.context!==this.context)return;if((o.contextTarget??o.composedPath()[0])===this.host)return;const n=new Set;for(const[o,{consumerHost:r}]of this.subscriptions)n.has(o)||(n.add(o),r.dispatchEvent(new t(this.context,r,o,!0)));o.stopPropagation()},this.host=o,void 0!==n.context?this.context=n.context:this.context=n,this.attachListeners(),this.host.addController?.(this)}attachListeners(){this.host.addEventListener("context-request",this.onContextRequest),this.host.addEventListener("context-provider",this.onProviderRequest)}hostConnected(){this.host.dispatchEvent(new e(this.context,this.host))}}export{i};
@@ -0,0 +1 @@
1
+ function n(n){return n}export{n};
@@ -0,0 +1 @@
1
+ import{_ as t,t as e}from"./custom-element-DA9Fxvxd.js";import{m as i}from"./runtime-Bg1WXVCx.js";import{l as o}from"./localized-decorator-BlOuLhym.js";import{h as a,s as n}from"./task-Bj8p7kJX.js";import{a as s,C as r,b as l,i as d}from"./api-chat-client-vbjgaIRV.js";import{t as c,d as m,a as p,b as h,c as u}from"./telemetry-client-BLJVs9me.js";import{a as f,i as g,E as v,x as y}from"./lit-element-DiWJYFwC.js";import{n as b}from"./property-scuRaFcM.js";import{getLocale as x}from"../i18n.js";import{calendarIcon as $}from"../ui/icons/calendar-icon.js";import{clockIcon as k}from"../ui/icons/clock-icon.js";import{r as w}from"./state-LQivXIgA.js";import{infoCircleOutineIcon as z}from"../ui/icons/info-circle-outine-icon.js";import"../ui/mq-button.js";import{l as q}from"./chunk-S5RWG6G2-DPesx3Od.js";import{messageBubbleIcon as j}from"../ui/icons/message-bubble-icon.js";import"../mq-chat-room.js";import"../ui/mq-floating-bubble.js";import"../ui/mq-card.js";import"../ui/mq-unread-badge.js";import{c as _}from"./consume-CovVqBjI.js";import{Q as C}from"./query-controller-BlO1Ax65.js";import{g as O}from"./chunk-GZF3YFSX-BzloXkVp.js";import"../ui/back-link.js";import"./index-DBMxJ4Dp.js";import{M as S}from"./mutation-controller-CR2qcqhH.js";import{g as T}from"./get-organization-setup-query-BMbuRi6v.js";import{g as I,a as D}from"./i18n-formats-DYS91YEa.js";import{MqViewAppointmentsEvent as Q}from"../events.js";let E=class ChatCta extends f{constructor(){super(...arguments),this.text=i("Utiliza el chat para enviar el motivo de consulta, documentos o imágenes"),this.readonly=!1,this.isChatOpen=!1,this.unreadQuery=new C(this,()=>O(s,{roomId:this.roomId}))}static{this.styles=[g`.chat-cta{padding:var(--sp-6) var(--sp-4);display:flex;flex-direction:column;gap:var(--sp-4)}.cta-message{display:inline-flex;align-items:center;justify-content:center;gap:var(--sp-4);font-family:var(--font-body);font-size:var(--text-sm);line-height:var(--text-sm--line-height);color:var(--color-neutrals-text-default)}.cta-message svg{flex-shrink:0}mq-button svg{flex-shrink:0}mq-chat-room{height:100%}@media (min-width:768px){.chat-cta{padding:var(--sp-6)}mq-button{max-width:323px;margin:0 auto}}`]}render(){return y`<mq-card class="chat-cta" roundness="md"><div class="cta-message">${z({size:24})} <span>${this.text}</span></div><mq-button variant="primary" size="md" fullwidth @click="${()=>{this.isChatOpen=!this.isChatOpen,this.isChatOpen&&this.onOpenChat?.()}}">${j({size:24})} ${i("Chatea con el profesional")} ${(this.unreadQuery.result?.data?.unread_count??0)>0?y`<mq-unread-badge></mq-unread-badge>`:v}</mq-button></mq-card><mq-floating-bubble ?dismissable="${!1}" .open="${this.isChatOpen}" @mq-close="${()=>{this.isChatOpen=!1}}" hideCloseButton>${this.isChatOpen?y`<mq-chat-room slot="content" .consultationId="${this.consultationId}" .consultationType="${r.appointment}" token="${this.loginToken.access_token}" .roomId="${this.roomId}" .professionalHash="${this.professionalHash}" ?readonly="${this.readonly}" @mq-chat-room-close="${()=>{this.isChatOpen=!1}}"></mq-chat-room>`:v}</mq-floating-bubble>`}};t([b({type:Number})],E.prototype,"roomId",void 0),t([b({type:String})],E.prototype,"professionalHash",void 0),t([b({type:String})],E.prototype,"text",void 0),t([b({type:String})],E.prototype,"consultationId",void 0),t([b({type:Boolean,reflect:!0})],E.prototype,"readonly",void 0),t([b({attribute:!1})],E.prototype,"onOpenChat",void 0),t([_({context:q})],E.prototype,"loginToken",void 0),t([w()],E.prototype,"isChatOpen",void 0),E=t([o(),e("chat-cta")],E);let F=class PageLayout extends f{constructor(){super(...arguments),this.yCentered=!1,this.background="solid"}static{this.styles=g`:host([background=transparent]){background-color:transparent}:host([background=solid]){background-color:var(--color-background)}:host([y-centered]) div{display:grid;place-items:center}div{width:100%;max-width:1000px;padding:var(--mq-layout-padding,0);margin:0 auto;box-sizing:border-box}:host([y-centered]) div{height:100%}main{width:100%}`}render(){return y`<div><main><slot></slot></main></div>`}};t([b({type:Boolean,attribute:"y-centered"})],F.prototype,"yCentered",void 0),t([b({type:String})],F.prototype,"background",void 0),F=t([e("page-layout")],F);const B=g`.title{margin:var(--size-3) 0;font-family:var(--font-titles);font-size:var(--text-2xl);line-height:var(--text-2xl--line-height);color:var(--color-neutrals-text-default);font-weight:var(--font-weight-bold)}.description{font-size:var(--text-sm);line-height:var(--text-sm--line-height);color:var(--color-neutrals-text-default);font-weight:var(--font-weight-normal);margin:0;margin-bottom:var(--size-5)}.professional-card{padding:var(--size-4);margin-bottom:var(--size-4)}.professional-card>:not(:first-child){margin-top:var(--size-4)}.professional-name{font-family:var(--font-titles);font-size:var(--text-lg);line-height:var(--text-lg--line-height);color:var(--color-neutrals-text-default);font-weight:var(--font-weight-bold);margin:0;margin-bottom:var(--size-1)}.professional-speciality{font-size:var(--text-base);line-height:var(--text-base--line-height);color:var(--color-neutrals-text-default);font-weight:var(--font-weight-normal);margin:0}.description-list{display:flex;flex-direction:column;gap:var(--size-4)}.description-list-item{display:flex;flex-direction:row;align-items:center;gap:var(--size-2);color:var(--color-neutrals-text-default)}.description-list-item dt{display:inline-flex}.description-list-item dd{margin:0;font-family:var(--font-body);font-size:var(--text-base);line-height:var(--text-base--line-height);font-weight:var(--font-weight-semibold)}.description-list-item dd::first-letter{text-transform:uppercase}.documents-card{padding:var(--size-4);margin-bottom:var(--size-6)}.documents-card-empty{font-family:var(--font-body);font-size:var(--text-sm);line-height:var(--text-sm--line-height);color:var(--color-neutrals-text-default);font-weight:var(--font-weight-normal)}.documents-card-title{font-family:var(--font-titles);font-size:var(--text-lg);line-height:var(--text-lg--line-height);color:var(--color-neutrals-text-default);font-weight:var(--font-weight-bold);margin:0;margin-bottom:var(--size-4)}.documents-list{margin-bottom:var(--size-4)}.documents-list>:not(:first-child){margin-top:var(--size-2)}.finished-consultation-footer{display:flex;flex-direction:column;gap:var(--size-5)}.document-item-skeleton{height:57px;width:100%;background-color:var(--color-muted);animation:skeleton-pulse 1.5s infinite}@keyframes skeleton-pulse{0%{opacity:1}50%{opacity:.6}100%{opacity:1}}@media (min-width:768px){.description-list{flex-direction:row}mq-button{display:block;max-width:323px;margin:0 auto}}`;let G=class DocumentationView extends f{constructor(){super(...arguments),this.canReconnect=!1,this._sharedocumentsTask=new a(this,{task:async([t])=>await s.flash.getSharedDocuments({appointment_id:t}),args:()=>[this.appointment.id]}),this.getOrganizationSpecialtiesQuery=new C(this,()=>I(s)),this.getOrganizationSetupQuery=new C(this,()=>T(s)),this._reconnectMutation=new S(this,{mutationFn:t=>s.appointments.reconnectAppointment(t),onSuccess:()=>{this.dispatchEvent(new CustomEvent("reconnect",{bubbles:!0,composed:!0}))}})}static{this.styles=B}firstUpdated(){c.track(m(this.loginToken.patient.hash,this.appointment.id??""))}render(){const t=!0===this.getOrganizationSetupQuery.result?.data?.appointments?.has_chat_in_appointment,e=x(),o=e.replace("_","-"),a=this.loginToken.patient.timezone,s=a?{timeZone:a}:{},r=new Intl.DateTimeFormat(o,{dateStyle:"full",...s}),m=new Intl.DateTimeFormat(o,{hour:"2-digit",minute:"2-digit",...s}),f=new Date(this.appointment.start_date),g=p(f,this.appointment.duration),b=a?l(a,f):"";return y`<back-link @mq-back="${t=>{t.stopPropagation(),this.dispatchEvent(new Q({tab:"history"}))}}">${i("Salir")}</back-link><h1 class="title">${i("Consulta finalizada")}</h1><p class="description">${i("Si tu médico ha generado alguna documentación podrás verla y descargarla aquí, desde la sección de documentación, tu correo o el chat.")}</p><mq-card class="professional-card" roundness="md"><div><h2 class="professional-name">${this.appointment.from.name}</h2><p class="professional-speciality">${this.appointment.from.speciality}</p></div><dl class="description-list"><div class="description-list-item"><dt>${$()}</dt><dd>${r.format(f)}</dd></div><div class="description-list-item"><dt>${k()}</dt><dd>${m.format(f)} - ${m.format(g)}${b?` (${b})`:""}</dd></div></dl></mq-card><mq-card class="documents-card" roundness="md"><h2 class="documents-card-title">${i("Documentación")}</h2><div class="documents-list">${this._sharedocumentsTask?.render({pending:()=>y`<div class="document-item-skeleton"></div>`,complete:()=>0===this._sharedocumentsTask?.value?.length?y`<p class="documents-card-empty">${i("El médico está terminando de gestionar tu consulta. Actualiza en unos minutos para ver si tienes documentación.")}</p>`:this._sharedocumentsTask?.value?.map(t=>y`<patient-document .kind="${t.document_type}" .filename="${t.name}" .specialty="${(()=>{const i=this.getOrganizationSpecialtiesQuery.result?.data?.find(e=>e.id===t.professional.speciality_id);return D(i?.code??"",e,i?.name)})()}" .description="${t.name}" .date="${t.created_at}" .downloadUrl="${t.url}"></patient-document>`)})}</div><mq-button variant="outline" size="md" fullwidth @click="${()=>{c.track(h(this.loginToken.patient.hash,this.appointment.id??"")),this._sharedocumentsTask?.run()}}" .disabled="${this._sharedocumentsTask?.status===n.PENDING}">${i("Actualizar")}</mq-button></mq-card><div class="finished-consultation-footer">${this.canReconnect?y`<mq-button variant="primary" size="md" fullwidth ?disabled="${this._reconnectMutation.isPending}" @click="${()=>this._reconnectMutation.run({appointmentId:this.appointment.id})}">${i("Volver a la sala de espera")}</mq-button>`:v} ${t?y`<chat-cta .consultationId="${this.appointment.id}" .roomId="${Number(this.appointment.room_id)}" .professionalHash="${this.appointment.from.hash}" .text="${i("Puedes chatear con tu profesional hasta 48 horas finalizada tu cita")}" ?readonly="${d(this.appointment.expires_at)}" .onOpenChat="${()=>{c.track(u(this.loginToken.patient.hash,this.appointment.id??""))}}"></chat-cta>`:v}</div>`}};t([b({type:Object})],G.prototype,"appointment",void 0),t([b({type:String})],G.prototype,"token",void 0),t([b({type:Boolean,attribute:"can-reconnect"})],G.prototype,"canReconnect",void 0),t([_({context:q})],G.prototype,"loginToken",void 0),G=t([o(),e("documentation-view")],G);
@@ -0,0 +1 @@
1
+ var e,t;!function(e){e.assertEqual=e=>{},e.assertIs=function(e){},e.assertNever=function(e){throw new Error},e.arrayToEnum=e=>{const t={};for(const a of e)t[a]=a;return t},e.getValidEnumValues=t=>{const a=e.objectKeys(t).filter(e=>"number"!=typeof t[t[e]]),s={};for(const e of a)s[e]=t[e];return e.objectValues(s)},e.objectValues=t=>e.objectKeys(t).map(function(e){return t[e]}),e.objectKeys="function"==typeof Object.keys?e=>Object.keys(e):e=>{const t=[];for(const a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.push(a);return t},e.find=(e,t)=>{for(const a of e)if(t(a))return a},e.isInteger="function"==typeof Number.isInteger?e=>Number.isInteger(e):e=>"number"==typeof e&&Number.isFinite(e)&&Math.floor(e)===e,e.joinValues=function(e,t=" | "){return e.map(e=>"string"==typeof e?`'${e}'`:e).join(t)},e.jsonStringifyReplacer=(e,t)=>"bigint"==typeof t?t.toString():t}(e||(e={})),function(e){e.mergeShapes=(e,t)=>({...e,...t})}(t||(t={}));const a=e.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),s=e=>{switch(typeof e){case"undefined":return a.undefined;case"string":return a.string;case"number":return Number.isNaN(e)?a.nan:a.number;case"boolean":return a.boolean;case"function":return a.function;case"bigint":return a.bigint;case"symbol":return a.symbol;case"object":return Array.isArray(e)?a.array:null===e?a.null:e.then&&"function"==typeof e.then&&e.catch&&"function"==typeof e.catch?a.promise:"undefined"!=typeof Map&&e instanceof Map?a.map:"undefined"!=typeof Set&&e instanceof Set?a.set:"undefined"!=typeof Date&&e instanceof Date?a.date:a.object;default:return a.unknown}},n=e.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class ZodError extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=e=>{this.issues=[...this.issues,e]},this.addIssues=(e=[])=>{this.issues=[...this.issues,...e]};const t=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,t):this.__proto__=t,this.name="ZodError",this.issues=e}format(e){const t=e||function(e){return e.message},a={_errors:[]},s=e=>{for(const n of e.issues)if("invalid_union"===n.code)n.unionErrors.map(s);else if("invalid_return_type"===n.code)s(n.returnTypeError);else if("invalid_arguments"===n.code)s(n.argumentsError);else if(0===n.path.length)a._errors.push(t(n));else{let e=a,s=0;for(;s<n.path.length;){const a=n.path[s];s===n.path.length-1?(e[a]=e[a]||{_errors:[]},e[a]._errors.push(t(n))):e[a]=e[a]||{_errors:[]},e=e[a],s++}}};return s(this),a}static assert(e){if(!(e instanceof ZodError))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,e.jsonStringifyReplacer,2)}get isEmpty(){return 0===this.issues.length}flatten(e=e=>e.message){const t={},a=[];for(const s of this.issues)if(s.path.length>0){const a=s.path[0];t[a]=t[a]||[],t[a].push(e(s))}else a.push(e(s));return{formErrors:a,fieldErrors:t}}get formErrors(){return this.flatten()}}ZodError.create=e=>new ZodError(e);const r=(t,s)=>{let r;switch(t.code){case n.invalid_type:r=t.received===a.undefined?"Required":`Expected ${t.expected}, received ${t.received}`;break;case n.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,e.jsonStringifyReplacer)}`;break;case n.unrecognized_keys:r=`Unrecognized key(s) in object: ${e.joinValues(t.keys,", ")}`;break;case n.invalid_union:r="Invalid input";break;case n.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${e.joinValues(t.options)}`;break;case n.invalid_enum_value:r=`Invalid enum value. Expected ${e.joinValues(t.options)}, received '${t.received}'`;break;case n.invalid_arguments:r="Invalid function arguments";break;case n.invalid_return_type:r="Invalid function return type";break;case n.invalid_date:r="Invalid date";break;case n.invalid_string:"object"==typeof t.validation?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,"number"==typeof t.validation.position&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:e.assertNever(t.validation):r="regex"!==t.validation?`Invalid ${t.validation}`:"Invalid";break;case n.too_small:r="array"===t.type?`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:"string"===t.type?`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:"number"===t.type||"bigint"===t.type?`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:"date"===t.type?`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:"Invalid input";break;case n.too_big:r="array"===t.type?`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:"string"===t.type?`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:"number"===t.type?`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:"bigint"===t.type?`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:"date"===t.type?`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:"Invalid input";break;case n.custom:r="Invalid input";break;case n.invalid_intersection_types:r="Intersection results could not be merged";break;case n.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case n.not_finite:r="Number must be finite";break;default:r=s.defaultError,e.assertNever(t)}return{message:r}};let i=r;function o(){return i}const d=e=>{const{data:t,path:a,errorMaps:s,issueData:n}=e,r=[...a,...n.path||[]],i={...n,path:r};if(void 0!==n.message)return{...n,path:r,message:n.message};let o="";const d=s.filter(e=>!!e).slice().reverse();for(const e of d)o=e(i,{data:t,defaultError:o}).message;return{...n,path:r,message:o}};function c(e,t){const a=o(),s=d({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,a,a===r?void 0:r].filter(e=>!!e)});e.common.issues.push(s)}class ParseStatus{constructor(){this.value="valid"}dirty(){"valid"===this.value&&(this.value="dirty")}abort(){"aborted"!==this.value&&(this.value="aborted")}static mergeArray(e,t){const a=[];for(const s of t){if("aborted"===s.status)return u;"dirty"===s.status&&e.dirty(),a.push(s.value)}return{status:e.value,value:a}}static async mergeObjectAsync(e,t){const a=[];for(const e of t){const t=await e.key,s=await e.value;a.push({key:t,value:s})}return ParseStatus.mergeObjectSync(e,a)}static mergeObjectSync(e,t){const a={};for(const s of t){const{key:t,value:n}=s;if("aborted"===t.status)return u;if("aborted"===n.status)return u;"dirty"===t.status&&e.dirty(),"dirty"===n.status&&e.dirty(),"__proto__"===t.value||void 0===n.value&&!s.alwaysSet||(a[t.value]=n.value)}return{status:e.value,value:a}}}const u=Object.freeze({status:"aborted"}),l=e=>({status:"dirty",value:e}),p=e=>({status:"valid",value:e}),h=e=>"aborted"===e.status,m=e=>"dirty"===e.status,f=e=>"valid"===e.status,y=e=>"undefined"!=typeof Promise&&e instanceof Promise;var _;!function(e){e.errToObj=e=>"string"==typeof e?{message:e}:e||{},e.toString=e=>"string"==typeof e?e:e?.message}(_||(_={}));class ParseInputLazyPath{constructor(e,t,a,s){this._cachedPath=[],this.parent=e,this.data=t,this._path=a,this._key=s}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const g=(e,t)=>{if(f(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const t=new ZodError(e.common.issues);return this._error=t,this._error}}};function v(e){if(!e)return{};const{errorMap:t,invalid_type_error:a,required_error:s,description:n}=e;if(t&&(a||s))throw new Error('Can\'t use "invalid_type_error" or "required_error" in conjunction with custom error map.');if(t)return{errorMap:t,description:n};return{errorMap:(t,n)=>{const{message:r}=e;return"invalid_enum_value"===t.code?{message:r??n.defaultError}:void 0===n.data?{message:r??s??n.defaultError}:"invalid_type"!==t.code?{message:n.defaultError}:{message:r??a??n.defaultError}},description:n}}class ZodType{get description(){return this._def.description}_getType(e){return s(e.data)}_getOrReturnCtx(e,t){return t||{common:e.parent.common,data:e.data,parsedType:s(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new ParseStatus,ctx:{common:e.parent.common,data:e.data,parsedType:s(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const t=this._parse(e);if(y(t))throw new Error("Synchronous parse encountered promise.");return t}_parseAsync(e){const t=this._parse(e);return Promise.resolve(t)}parse(e,t){const a=this.safeParse(e,t);if(a.success)return a.data;throw a.error}safeParse(e,t){const a={common:{issues:[],async:t?.async??!1,contextualErrorMap:t?.errorMap},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:s(e)},n=this._parseSync({data:e,path:a.path,parent:a});return g(a,n)}"~validate"(e){const t={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:s(e)};if(!this["~standard"].async)try{const a=this._parseSync({data:e,path:[],parent:t});return f(a)?{value:a.value}:{issues:t.common.issues}}catch(e){e?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),t.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:t}).then(e=>f(e)?{value:e.value}:{issues:t.common.issues})}async parseAsync(e,t){const a=await this.safeParseAsync(e,t);if(a.success)return a.data;throw a.error}async safeParseAsync(e,t){const a={common:{issues:[],contextualErrorMap:t?.errorMap,async:!0},path:t?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:s(e)},n=this._parse({data:e,path:a.path,parent:a}),r=await(y(n)?n:Promise.resolve(n));return g(a,r)}refine(e,t){const a=e=>"string"==typeof t||void 0===t?{message:t}:"function"==typeof t?t(e):t;return this._refinement((t,s)=>{const r=e(t),i=()=>s.addIssue({code:n.custom,...a(t)});return"undefined"!=typeof Promise&&r instanceof Promise?r.then(e=>!!e||(i(),!1)):!!r||(i(),!1)})}refinement(e,t){return this._refinement((a,s)=>!!e(a)||(s.addIssue("function"==typeof t?t(a,s):t),!1))}_refinement(e){return new ZodEffects({schema:this,typeName:X.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:e=>this["~validate"](e)}}optional(){return ZodOptional.create(this,this._def)}nullable(){return ZodNullable.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ZodArray.create(this)}promise(){return ZodPromise.create(this,this._def)}or(e){return ZodUnion.create([this,e],this._def)}and(e){return ZodIntersection.create(this,e,this._def)}transform(e){return new ZodEffects({...v(this._def),schema:this,typeName:X.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const t="function"==typeof e?e:()=>e;return new ZodDefault({...v(this._def),innerType:this,defaultValue:t,typeName:X.ZodDefault})}brand(){return new ZodBranded({typeName:X.ZodBranded,type:this,...v(this._def)})}catch(e){const t="function"==typeof e?e:()=>e;return new ZodCatch({...v(this._def),innerType:this,catchValue:t,typeName:X.ZodCatch})}describe(e){return new(0,this.constructor)({...this._def,description:e})}pipe(e){return ZodPipeline.create(this,e)}readonly(){return ZodReadonly.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Z=/^c[^\s-]{8,}$/i,b=/^[0-9a-z]+$/,k=/^[0-9A-HJKMNP-TV-Z]{26}$/i,x=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,w=/^[a-z0-9_-]{21}$/i,T=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,N=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,O=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;let S;const A=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,E=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,j=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,C=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,P=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,I=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,R="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",$=new RegExp(`^${R}$`);function L(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:null==e.precision&&(t=`${t}(\\.\\d+)?`);return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${e.precision?"+":"?"}`}function M(e){return new RegExp(`^${L(e)}$`)}function z(e){let t=`${R}T${L(e)}`;const a=[];return a.push(e.local?"Z?":"Z"),e.offset&&a.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${a.join("|")})`,new RegExp(`^${t}$`)}function D(e,t){return!("v4"!==t&&t||!A.test(e))||!("v6"!==t&&t||!j.test(e))}function F(e,t){if(!T.test(e))return!1;try{const[a]=e.split(".");if(!a)return!1;const s=a.replace(/-/g,"+").replace(/_/g,"/").padEnd(a.length+(4-a.length%4)%4,"="),n=JSON.parse(atob(s));return"object"==typeof n&&null!==n&&((!("typ"in n)||"JWT"===n?.typ)&&(!!n.alg&&(!t||n.alg===t)))}catch{return!1}}function U(e,t){return!("v4"!==t&&t||!E.test(e))||!("v6"!==t&&t||!C.test(e))}class ZodString extends ZodType{_parse(t){this._def.coerce&&(t.data=String(t.data));if(this._getType(t)!==a.string){const e=this._getOrReturnCtx(t);return c(e,{code:n.invalid_type,expected:a.string,received:e.parsedType}),u}const s=new ParseStatus;let r;for(const a of this._def.checks)if("min"===a.kind)t.data.length<a.value&&(r=this._getOrReturnCtx(t,r),c(r,{code:n.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),s.dirty());else if("max"===a.kind)t.data.length>a.value&&(r=this._getOrReturnCtx(t,r),c(r,{code:n.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),s.dirty());else if("length"===a.kind){const e=t.data.length>a.value,i=t.data.length<a.value;(e||i)&&(r=this._getOrReturnCtx(t,r),e?c(r,{code:n.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):i&&c(r,{code:n.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),s.dirty())}else if("email"===a.kind)O.test(t.data)||(r=this._getOrReturnCtx(t,r),c(r,{validation:"email",code:n.invalid_string,message:a.message}),s.dirty());else if("emoji"===a.kind)S||(S=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),S.test(t.data)||(r=this._getOrReturnCtx(t,r),c(r,{validation:"emoji",code:n.invalid_string,message:a.message}),s.dirty());else if("uuid"===a.kind)x.test(t.data)||(r=this._getOrReturnCtx(t,r),c(r,{validation:"uuid",code:n.invalid_string,message:a.message}),s.dirty());else if("nanoid"===a.kind)w.test(t.data)||(r=this._getOrReturnCtx(t,r),c(r,{validation:"nanoid",code:n.invalid_string,message:a.message}),s.dirty());else if("cuid"===a.kind)Z.test(t.data)||(r=this._getOrReturnCtx(t,r),c(r,{validation:"cuid",code:n.invalid_string,message:a.message}),s.dirty());else if("cuid2"===a.kind)b.test(t.data)||(r=this._getOrReturnCtx(t,r),c(r,{validation:"cuid2",code:n.invalid_string,message:a.message}),s.dirty());else if("ulid"===a.kind)k.test(t.data)||(r=this._getOrReturnCtx(t,r),c(r,{validation:"ulid",code:n.invalid_string,message:a.message}),s.dirty());else if("url"===a.kind)try{new URL(t.data)}catch{r=this._getOrReturnCtx(t,r),c(r,{validation:"url",code:n.invalid_string,message:a.message}),s.dirty()}else if("regex"===a.kind){a.regex.lastIndex=0;a.regex.test(t.data)||(r=this._getOrReturnCtx(t,r),c(r,{validation:"regex",code:n.invalid_string,message:a.message}),s.dirty())}else if("trim"===a.kind)t.data=t.data.trim();else if("includes"===a.kind)t.data.includes(a.value,a.position)||(r=this._getOrReturnCtx(t,r),c(r,{code:n.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),s.dirty());else if("toLowerCase"===a.kind)t.data=t.data.toLowerCase();else if("toUpperCase"===a.kind)t.data=t.data.toUpperCase();else if("startsWith"===a.kind)t.data.startsWith(a.value)||(r=this._getOrReturnCtx(t,r),c(r,{code:n.invalid_string,validation:{startsWith:a.value},message:a.message}),s.dirty());else if("endsWith"===a.kind)t.data.endsWith(a.value)||(r=this._getOrReturnCtx(t,r),c(r,{code:n.invalid_string,validation:{endsWith:a.value},message:a.message}),s.dirty());else if("datetime"===a.kind){z(a).test(t.data)||(r=this._getOrReturnCtx(t,r),c(r,{code:n.invalid_string,validation:"datetime",message:a.message}),s.dirty())}else if("date"===a.kind){$.test(t.data)||(r=this._getOrReturnCtx(t,r),c(r,{code:n.invalid_string,validation:"date",message:a.message}),s.dirty())}else if("time"===a.kind){M(a).test(t.data)||(r=this._getOrReturnCtx(t,r),c(r,{code:n.invalid_string,validation:"time",message:a.message}),s.dirty())}else"duration"===a.kind?N.test(t.data)||(r=this._getOrReturnCtx(t,r),c(r,{validation:"duration",code:n.invalid_string,message:a.message}),s.dirty()):"ip"===a.kind?D(t.data,a.version)||(r=this._getOrReturnCtx(t,r),c(r,{validation:"ip",code:n.invalid_string,message:a.message}),s.dirty()):"jwt"===a.kind?F(t.data,a.alg)||(r=this._getOrReturnCtx(t,r),c(r,{validation:"jwt",code:n.invalid_string,message:a.message}),s.dirty()):"cidr"===a.kind?U(t.data,a.version)||(r=this._getOrReturnCtx(t,r),c(r,{validation:"cidr",code:n.invalid_string,message:a.message}),s.dirty()):"base64"===a.kind?P.test(t.data)||(r=this._getOrReturnCtx(t,r),c(r,{validation:"base64",code:n.invalid_string,message:a.message}),s.dirty()):"base64url"===a.kind?I.test(t.data)||(r=this._getOrReturnCtx(t,r),c(r,{validation:"base64url",code:n.invalid_string,message:a.message}),s.dirty()):e.assertNever(a);return{status:s.value,value:t.data}}_regex(e,t,a){return this.refinement(t=>e.test(t),{validation:t,code:n.invalid_string,..._.errToObj(a)})}_addCheck(e){return new ZodString({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",..._.errToObj(e)})}url(e){return this._addCheck({kind:"url",..._.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",..._.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",..._.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",..._.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",..._.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",..._.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",..._.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",..._.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",..._.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",..._.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",..._.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",..._.errToObj(e)})}datetime(e){return"string"==typeof e?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:void 0===e?.precision?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,..._.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return"string"==typeof e?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:void 0===e?.precision?null:e?.precision,..._.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",..._.errToObj(e)})}regex(e,t){return this._addCheck({kind:"regex",regex:e,..._.errToObj(t)})}includes(e,t){return this._addCheck({kind:"includes",value:e,position:t?.position,..._.errToObj(t?.message)})}startsWith(e,t){return this._addCheck({kind:"startsWith",value:e,..._.errToObj(t)})}endsWith(e,t){return this._addCheck({kind:"endsWith",value:e,..._.errToObj(t)})}min(e,t){return this._addCheck({kind:"min",value:e,..._.errToObj(t)})}max(e,t){return this._addCheck({kind:"max",value:e,..._.errToObj(t)})}length(e,t){return this._addCheck({kind:"length",value:e,..._.errToObj(t)})}nonempty(e){return this.min(1,_.errToObj(e))}trim(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new ZodString({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>"datetime"===e.kind)}get isDate(){return!!this._def.checks.find(e=>"date"===e.kind)}get isTime(){return!!this._def.checks.find(e=>"time"===e.kind)}get isDuration(){return!!this._def.checks.find(e=>"duration"===e.kind)}get isEmail(){return!!this._def.checks.find(e=>"email"===e.kind)}get isURL(){return!!this._def.checks.find(e=>"url"===e.kind)}get isEmoji(){return!!this._def.checks.find(e=>"emoji"===e.kind)}get isUUID(){return!!this._def.checks.find(e=>"uuid"===e.kind)}get isNANOID(){return!!this._def.checks.find(e=>"nanoid"===e.kind)}get isCUID(){return!!this._def.checks.find(e=>"cuid"===e.kind)}get isCUID2(){return!!this._def.checks.find(e=>"cuid2"===e.kind)}get isULID(){return!!this._def.checks.find(e=>"ulid"===e.kind)}get isIP(){return!!this._def.checks.find(e=>"ip"===e.kind)}get isCIDR(){return!!this._def.checks.find(e=>"cidr"===e.kind)}get isBase64(){return!!this._def.checks.find(e=>"base64"===e.kind)}get isBase64url(){return!!this._def.checks.find(e=>"base64url"===e.kind)}get minLength(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxLength(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}function V(e,t){const a=(e.toString().split(".")[1]||"").length,s=(t.toString().split(".")[1]||"").length,n=a>s?a:s;return Number.parseInt(e.toFixed(n).replace(".",""))%Number.parseInt(t.toFixed(n).replace(".",""))/10**n}ZodString.create=e=>new ZodString({checks:[],typeName:X.ZodString,coerce:e?.coerce??!1,...v(e)});class ZodNumber extends ZodType{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){this._def.coerce&&(t.data=Number(t.data));if(this._getType(t)!==a.number){const e=this._getOrReturnCtx(t);return c(e,{code:n.invalid_type,expected:a.number,received:e.parsedType}),u}let s;const r=new ParseStatus;for(const a of this._def.checks)if("int"===a.kind)e.isInteger(t.data)||(s=this._getOrReturnCtx(t,s),c(s,{code:n.invalid_type,expected:"integer",received:"float",message:a.message}),r.dirty());else if("min"===a.kind){(a.inclusive?t.data<a.value:t.data<=a.value)&&(s=this._getOrReturnCtx(t,s),c(s,{code:n.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),r.dirty())}else if("max"===a.kind){(a.inclusive?t.data>a.value:t.data>=a.value)&&(s=this._getOrReturnCtx(t,s),c(s,{code:n.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),r.dirty())}else"multipleOf"===a.kind?0!==V(t.data,a.value)&&(s=this._getOrReturnCtx(t,s),c(s,{code:n.not_multiple_of,multipleOf:a.value,message:a.message}),r.dirty()):"finite"===a.kind?Number.isFinite(t.data)||(s=this._getOrReturnCtx(t,s),c(s,{code:n.not_finite,message:a.message}),r.dirty()):e.assertNever(a);return{status:r.value,value:t.data}}gte(e,t){return this.setLimit("min",e,!0,_.toString(t))}gt(e,t){return this.setLimit("min",e,!1,_.toString(t))}lte(e,t){return this.setLimit("max",e,!0,_.toString(t))}lt(e,t){return this.setLimit("max",e,!1,_.toString(t))}setLimit(e,t,a,s){return new ZodNumber({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:a,message:_.toString(s)}]})}_addCheck(e){return new ZodNumber({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:_.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:_.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:_.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:_.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:_.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:_.toString(t)})}finite(e){return this._addCheck({kind:"finite",message:_.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:_.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:_.toString(e)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}get isInt(){return!!this._def.checks.find(t=>"int"===t.kind||"multipleOf"===t.kind&&e.isInteger(t.value))}get isFinite(){let e=null,t=null;for(const a of this._def.checks){if("finite"===a.kind||"int"===a.kind||"multipleOf"===a.kind)return!0;"min"===a.kind?(null===t||a.value>t)&&(t=a.value):"max"===a.kind&&(null===e||a.value<e)&&(e=a.value)}return Number.isFinite(t)&&Number.isFinite(e)}}ZodNumber.create=e=>new ZodNumber({checks:[],typeName:X.ZodNumber,coerce:e?.coerce||!1,...v(e)});class ZodBigInt extends ZodType{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==a.bigint)return this._getInvalidInput(t);let s;const r=new ParseStatus;for(const a of this._def.checks)if("min"===a.kind){(a.inclusive?t.data<a.value:t.data<=a.value)&&(s=this._getOrReturnCtx(t,s),c(s,{code:n.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),r.dirty())}else if("max"===a.kind){(a.inclusive?t.data>a.value:t.data>=a.value)&&(s=this._getOrReturnCtx(t,s),c(s,{code:n.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),r.dirty())}else"multipleOf"===a.kind?t.data%a.value!==BigInt(0)&&(s=this._getOrReturnCtx(t,s),c(s,{code:n.not_multiple_of,multipleOf:a.value,message:a.message}),r.dirty()):e.assertNever(a);return{status:r.value,value:t.data}}_getInvalidInput(e){const t=this._getOrReturnCtx(e);return c(t,{code:n.invalid_type,expected:a.bigint,received:t.parsedType}),u}gte(e,t){return this.setLimit("min",e,!0,_.toString(t))}gt(e,t){return this.setLimit("min",e,!1,_.toString(t))}lte(e,t){return this.setLimit("max",e,!0,_.toString(t))}lt(e,t){return this.setLimit("max",e,!1,_.toString(t))}setLimit(e,t,a,s){return new ZodBigInt({...this._def,checks:[...this._def.checks,{kind:e,value:t,inclusive:a,message:_.toString(s)}]})}_addCheck(e){return new ZodBigInt({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:_.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:_.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:_.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:_.toString(e)})}multipleOf(e,t){return this._addCheck({kind:"multipleOf",value:e,message:_.toString(t)})}get minValue(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return e}get maxValue(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return e}}ZodBigInt.create=e=>new ZodBigInt({checks:[],typeName:X.ZodBigInt,coerce:e?.coerce??!1,...v(e)});class ZodBoolean extends ZodType{_parse(e){this._def.coerce&&(e.data=Boolean(e.data));if(this._getType(e)!==a.boolean){const t=this._getOrReturnCtx(e);return c(t,{code:n.invalid_type,expected:a.boolean,received:t.parsedType}),u}return p(e.data)}}ZodBoolean.create=e=>new ZodBoolean({typeName:X.ZodBoolean,coerce:e?.coerce||!1,...v(e)});class ZodDate extends ZodType{_parse(t){this._def.coerce&&(t.data=new Date(t.data));if(this._getType(t)!==a.date){const e=this._getOrReturnCtx(t);return c(e,{code:n.invalid_type,expected:a.date,received:e.parsedType}),u}if(Number.isNaN(t.data.getTime())){return c(this._getOrReturnCtx(t),{code:n.invalid_date}),u}const s=new ParseStatus;let r;for(const a of this._def.checks)"min"===a.kind?t.data.getTime()<a.value&&(r=this._getOrReturnCtx(t,r),c(r,{code:n.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),s.dirty()):"max"===a.kind?t.data.getTime()>a.value&&(r=this._getOrReturnCtx(t,r),c(r,{code:n.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),s.dirty()):e.assertNever(a);return{status:s.value,value:new Date(t.data.getTime())}}_addCheck(e){return new ZodDate({...this._def,checks:[...this._def.checks,e]})}min(e,t){return this._addCheck({kind:"min",value:e.getTime(),message:_.toString(t)})}max(e,t){return this._addCheck({kind:"max",value:e.getTime(),message:_.toString(t)})}get minDate(){let e=null;for(const t of this._def.checks)"min"===t.kind&&(null===e||t.value>e)&&(e=t.value);return null!=e?new Date(e):null}get maxDate(){let e=null;for(const t of this._def.checks)"max"===t.kind&&(null===e||t.value<e)&&(e=t.value);return null!=e?new Date(e):null}}ZodDate.create=e=>new ZodDate({checks:[],coerce:e?.coerce||!1,typeName:X.ZodDate,...v(e)});class ZodSymbol extends ZodType{_parse(e){if(this._getType(e)!==a.symbol){const t=this._getOrReturnCtx(e);return c(t,{code:n.invalid_type,expected:a.symbol,received:t.parsedType}),u}return p(e.data)}}ZodSymbol.create=e=>new ZodSymbol({typeName:X.ZodSymbol,...v(e)});class ZodUndefined extends ZodType{_parse(e){if(this._getType(e)!==a.undefined){const t=this._getOrReturnCtx(e);return c(t,{code:n.invalid_type,expected:a.undefined,received:t.parsedType}),u}return p(e.data)}}ZodUndefined.create=e=>new ZodUndefined({typeName:X.ZodUndefined,...v(e)});class ZodNull extends ZodType{_parse(e){if(this._getType(e)!==a.null){const t=this._getOrReturnCtx(e);return c(t,{code:n.invalid_type,expected:a.null,received:t.parsedType}),u}return p(e.data)}}ZodNull.create=e=>new ZodNull({typeName:X.ZodNull,...v(e)});class ZodAny extends ZodType{constructor(){super(...arguments),this._any=!0}_parse(e){return p(e.data)}}ZodAny.create=e=>new ZodAny({typeName:X.ZodAny,...v(e)});class ZodUnknown extends ZodType{constructor(){super(...arguments),this._unknown=!0}_parse(e){return p(e.data)}}ZodUnknown.create=e=>new ZodUnknown({typeName:X.ZodUnknown,...v(e)});class ZodNever extends ZodType{_parse(e){const t=this._getOrReturnCtx(e);return c(t,{code:n.invalid_type,expected:a.never,received:t.parsedType}),u}}ZodNever.create=e=>new ZodNever({typeName:X.ZodNever,...v(e)});class ZodVoid extends ZodType{_parse(e){if(this._getType(e)!==a.undefined){const t=this._getOrReturnCtx(e);return c(t,{code:n.invalid_type,expected:a.void,received:t.parsedType}),u}return p(e.data)}}ZodVoid.create=e=>new ZodVoid({typeName:X.ZodVoid,...v(e)});class ZodArray extends ZodType{_parse(e){const{ctx:t,status:s}=this._processInputParams(e),r=this._def;if(t.parsedType!==a.array)return c(t,{code:n.invalid_type,expected:a.array,received:t.parsedType}),u;if(null!==r.exactLength){const e=t.data.length>r.exactLength.value,a=t.data.length<r.exactLength.value;(e||a)&&(c(t,{code:e?n.too_big:n.too_small,minimum:a?r.exactLength.value:void 0,maximum:e?r.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:r.exactLength.message}),s.dirty())}if(null!==r.minLength&&t.data.length<r.minLength.value&&(c(t,{code:n.too_small,minimum:r.minLength.value,type:"array",inclusive:!0,exact:!1,message:r.minLength.message}),s.dirty()),null!==r.maxLength&&t.data.length>r.maxLength.value&&(c(t,{code:n.too_big,maximum:r.maxLength.value,type:"array",inclusive:!0,exact:!1,message:r.maxLength.message}),s.dirty()),t.common.async)return Promise.all([...t.data].map((e,a)=>r.type._parseAsync(new ParseInputLazyPath(t,e,t.path,a)))).then(e=>ParseStatus.mergeArray(s,e));const i=[...t.data].map((e,a)=>r.type._parseSync(new ParseInputLazyPath(t,e,t.path,a)));return ParseStatus.mergeArray(s,i)}get element(){return this._def.type}min(e,t){return new ZodArray({...this._def,minLength:{value:e,message:_.toString(t)}})}max(e,t){return new ZodArray({...this._def,maxLength:{value:e,message:_.toString(t)}})}length(e,t){return new ZodArray({...this._def,exactLength:{value:e,message:_.toString(t)}})}nonempty(e){return this.min(1,e)}}function B(e){if(e instanceof ZodObject){const t={};for(const a in e.shape){const s=e.shape[a];t[a]=ZodOptional.create(B(s))}return new ZodObject({...e._def,shape:()=>t})}return e instanceof ZodArray?new ZodArray({...e._def,type:B(e.element)}):e instanceof ZodOptional?ZodOptional.create(B(e.unwrap())):e instanceof ZodNullable?ZodNullable.create(B(e.unwrap())):e instanceof ZodTuple?ZodTuple.create(e.items.map(e=>B(e))):e}ZodArray.create=(e,t)=>new ZodArray({type:e,minLength:null,maxLength:null,exactLength:null,typeName:X.ZodArray,...v(t)});class ZodObject extends ZodType{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(null!==this._cached)return this._cached;const t=this._def.shape(),a=e.objectKeys(t);return this._cached={shape:t,keys:a},this._cached}_parse(e){if(this._getType(e)!==a.object){const t=this._getOrReturnCtx(e);return c(t,{code:n.invalid_type,expected:a.object,received:t.parsedType}),u}const{status:t,ctx:s}=this._processInputParams(e),{shape:r,keys:i}=this._getCached(),o=[];if(!(this._def.catchall instanceof ZodNever&&"strip"===this._def.unknownKeys))for(const e in s.data)i.includes(e)||o.push(e);const d=[];for(const e of i){const t=r[e],a=s.data[e];d.push({key:{status:"valid",value:e},value:t._parse(new ParseInputLazyPath(s,a,s.path,e)),alwaysSet:e in s.data})}if(this._def.catchall instanceof ZodNever){const e=this._def.unknownKeys;if("passthrough"===e)for(const e of o)d.push({key:{status:"valid",value:e},value:{status:"valid",value:s.data[e]}});else if("strict"===e)o.length>0&&(c(s,{code:n.unrecognized_keys,keys:o}),t.dirty());else if("strip"!==e)throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const e=this._def.catchall;for(const t of o){const a=s.data[t];d.push({key:{status:"valid",value:t},value:e._parse(new ParseInputLazyPath(s,a,s.path,t)),alwaysSet:t in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const e=[];for(const t of d){const a=await t.key,s=await t.value;e.push({key:a,value:s,alwaysSet:t.alwaysSet})}return e}).then(e=>ParseStatus.mergeObjectSync(t,e)):ParseStatus.mergeObjectSync(t,d)}get shape(){return this._def.shape()}strict(e){return _.errToObj,new ZodObject({...this._def,unknownKeys:"strict",...void 0!==e?{errorMap:(t,a)=>{const s=this._def.errorMap?.(t,a).message??a.defaultError;return"unrecognized_keys"===t.code?{message:_.errToObj(e).message??s}:{message:s}}}:{}})}strip(){return new ZodObject({...this._def,unknownKeys:"strip"})}passthrough(){return new ZodObject({...this._def,unknownKeys:"passthrough"})}extend(e){return new ZodObject({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new ZodObject({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:X.ZodObject})}setKey(e,t){return this.augment({[e]:t})}catchall(e){return new ZodObject({...this._def,catchall:e})}pick(t){const a={};for(const s of e.objectKeys(t))t[s]&&this.shape[s]&&(a[s]=this.shape[s]);return new ZodObject({...this._def,shape:()=>a})}omit(t){const a={};for(const s of e.objectKeys(this.shape))t[s]||(a[s]=this.shape[s]);return new ZodObject({...this._def,shape:()=>a})}deepPartial(){return B(this)}partial(t){const a={};for(const s of e.objectKeys(this.shape)){const e=this.shape[s];t&&!t[s]?a[s]=e:a[s]=e.optional()}return new ZodObject({...this._def,shape:()=>a})}required(t){const a={};for(const s of e.objectKeys(this.shape))if(t&&!t[s])a[s]=this.shape[s];else{let e=this.shape[s];for(;e instanceof ZodOptional;)e=e._def.innerType;a[s]=e}return new ZodObject({...this._def,shape:()=>a})}keyof(){return q(e.objectKeys(this.shape))}}ZodObject.create=(e,t)=>new ZodObject({shape:()=>e,unknownKeys:"strip",catchall:ZodNever.create(),typeName:X.ZodObject,...v(t)}),ZodObject.strictCreate=(e,t)=>new ZodObject({shape:()=>e,unknownKeys:"strict",catchall:ZodNever.create(),typeName:X.ZodObject,...v(t)}),ZodObject.lazycreate=(e,t)=>new ZodObject({shape:e,unknownKeys:"strip",catchall:ZodNever.create(),typeName:X.ZodObject,...v(t)});class ZodUnion extends ZodType{_parse(e){const{ctx:t}=this._processInputParams(e),a=this._def.options;if(t.common.async)return Promise.all(a.map(async e=>{const a={...t,common:{...t.common,issues:[]},parent:null};return{result:await e._parseAsync({data:t.data,path:t.path,parent:a}),ctx:a}})).then(function(e){for(const t of e)if("valid"===t.result.status)return t.result;for(const a of e)if("dirty"===a.result.status)return t.common.issues.push(...a.ctx.common.issues),a.result;const a=e.map(e=>new ZodError(e.ctx.common.issues));return c(t,{code:n.invalid_union,unionErrors:a}),u});{let e;const s=[];for(const n of a){const a={...t,common:{...t.common,issues:[]},parent:null},r=n._parseSync({data:t.data,path:t.path,parent:a});if("valid"===r.status)return r;"dirty"!==r.status||e||(e={result:r,ctx:a}),a.common.issues.length&&s.push(a.common.issues)}if(e)return t.common.issues.push(...e.ctx.common.issues),e.result;const r=s.map(e=>new ZodError(e));return c(t,{code:n.invalid_union,unionErrors:r}),u}}get options(){return this._def.options}}ZodUnion.create=(e,t)=>new ZodUnion({options:e,typeName:X.ZodUnion,...v(t)});const K=t=>t instanceof ZodLazy?K(t.schema):t instanceof ZodEffects?K(t.innerType()):t instanceof ZodLiteral?[t.value]:t instanceof ZodEnum?t.options:t instanceof ZodNativeEnum?e.objectValues(t.enum):t instanceof ZodDefault?K(t._def.innerType):t instanceof ZodUndefined?[void 0]:t instanceof ZodNull?[null]:t instanceof ZodOptional?[void 0,...K(t.unwrap())]:t instanceof ZodNullable?[null,...K(t.unwrap())]:t instanceof ZodBranded||t instanceof ZodReadonly?K(t.unwrap()):t instanceof ZodCatch?K(t._def.innerType):[];class ZodDiscriminatedUnion extends ZodType{_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==a.object)return c(t,{code:n.invalid_type,expected:a.object,received:t.parsedType}),u;const s=this.discriminator,r=t.data[s],i=this.optionsMap.get(r);return i?t.common.async?i._parseAsync({data:t.data,path:t.path,parent:t}):i._parseSync({data:t.data,path:t.path,parent:t}):(c(t,{code:n.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[s]}),u)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,t,a){const s=new Map;for(const a of t){const t=K(a.shape[e]);if(!t.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(const n of t){if(s.has(n))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(n)}`);s.set(n,a)}}return new ZodDiscriminatedUnion({typeName:X.ZodDiscriminatedUnion,discriminator:e,options:t,optionsMap:s,...v(a)})}}function W(t,n){const r=s(t),i=s(n);if(t===n)return{valid:!0,data:t};if(r===a.object&&i===a.object){const a=e.objectKeys(n),s=e.objectKeys(t).filter(e=>-1!==a.indexOf(e)),r={...t,...n};for(const e of s){const a=W(t[e],n[e]);if(!a.valid)return{valid:!1};r[e]=a.data}return{valid:!0,data:r}}if(r===a.array&&i===a.array){if(t.length!==n.length)return{valid:!1};const e=[];for(let a=0;a<t.length;a++){const s=W(t[a],n[a]);if(!s.valid)return{valid:!1};e.push(s.data)}return{valid:!0,data:e}}return r===a.date&&i===a.date&&+t===+n?{valid:!0,data:t}:{valid:!1}}class ZodIntersection extends ZodType{_parse(e){const{status:t,ctx:a}=this._processInputParams(e),s=(e,s)=>{if(h(e)||h(s))return u;const r=W(e.value,s.value);return r.valid?((m(e)||m(s))&&t.dirty(),{status:t.value,value:r.data}):(c(a,{code:n.invalid_intersection_types}),u)};return a.common.async?Promise.all([this._def.left._parseAsync({data:a.data,path:a.path,parent:a}),this._def.right._parseAsync({data:a.data,path:a.path,parent:a})]).then(([e,t])=>s(e,t)):s(this._def.left._parseSync({data:a.data,path:a.path,parent:a}),this._def.right._parseSync({data:a.data,path:a.path,parent:a}))}}ZodIntersection.create=(e,t,a)=>new ZodIntersection({left:e,right:t,typeName:X.ZodIntersection,...v(a)});class ZodTuple extends ZodType{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==a.array)return c(s,{code:n.invalid_type,expected:a.array,received:s.parsedType}),u;if(s.data.length<this._def.items.length)return c(s,{code:n.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),u;!this._def.rest&&s.data.length>this._def.items.length&&(c(s,{code:n.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),t.dirty());const r=[...s.data].map((e,t)=>{const a=this._def.items[t]||this._def.rest;return a?a._parse(new ParseInputLazyPath(s,e,s.path,t)):null}).filter(e=>!!e);return s.common.async?Promise.all(r).then(e=>ParseStatus.mergeArray(t,e)):ParseStatus.mergeArray(t,r)}get items(){return this._def.items}rest(e){return new ZodTuple({...this._def,rest:e})}}ZodTuple.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new ZodTuple({items:e,typeName:X.ZodTuple,rest:null,...v(t)})};class ZodRecord extends ZodType{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==a.object)return c(s,{code:n.invalid_type,expected:a.object,received:s.parsedType}),u;const r=[],i=this._def.keyType,o=this._def.valueType;for(const e in s.data)r.push({key:i._parse(new ParseInputLazyPath(s,e,s.path,e)),value:o._parse(new ParseInputLazyPath(s,s.data[e],s.path,e)),alwaysSet:e in s.data});return s.common.async?ParseStatus.mergeObjectAsync(t,r):ParseStatus.mergeObjectSync(t,r)}get element(){return this._def.valueType}static create(e,t,a){return new ZodRecord(t instanceof ZodType?{keyType:e,valueType:t,typeName:X.ZodRecord,...v(a)}:{keyType:ZodString.create(),valueType:e,typeName:X.ZodRecord,...v(t)})}}class ZodMap extends ZodType{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==a.map)return c(s,{code:n.invalid_type,expected:a.map,received:s.parsedType}),u;const r=this._def.keyType,i=this._def.valueType,o=[...s.data.entries()].map(([e,t],a)=>({key:r._parse(new ParseInputLazyPath(s,e,s.path,[a,"key"])),value:i._parse(new ParseInputLazyPath(s,t,s.path,[a,"value"]))}));if(s.common.async){const e=new Map;return Promise.resolve().then(async()=>{for(const a of o){const s=await a.key,n=await a.value;if("aborted"===s.status||"aborted"===n.status)return u;"dirty"!==s.status&&"dirty"!==n.status||t.dirty(),e.set(s.value,n.value)}return{status:t.value,value:e}})}{const e=new Map;for(const a of o){const s=a.key,n=a.value;if("aborted"===s.status||"aborted"===n.status)return u;"dirty"!==s.status&&"dirty"!==n.status||t.dirty(),e.set(s.value,n.value)}return{status:t.value,value:e}}}}ZodMap.create=(e,t,a)=>new ZodMap({valueType:t,keyType:e,typeName:X.ZodMap,...v(a)});class ZodSet extends ZodType{_parse(e){const{status:t,ctx:s}=this._processInputParams(e);if(s.parsedType!==a.set)return c(s,{code:n.invalid_type,expected:a.set,received:s.parsedType}),u;const r=this._def;null!==r.minSize&&s.data.size<r.minSize.value&&(c(s,{code:n.too_small,minimum:r.minSize.value,type:"set",inclusive:!0,exact:!1,message:r.minSize.message}),t.dirty()),null!==r.maxSize&&s.data.size>r.maxSize.value&&(c(s,{code:n.too_big,maximum:r.maxSize.value,type:"set",inclusive:!0,exact:!1,message:r.maxSize.message}),t.dirty());const i=this._def.valueType;function o(e){const a=new Set;for(const s of e){if("aborted"===s.status)return u;"dirty"===s.status&&t.dirty(),a.add(s.value)}return{status:t.value,value:a}}const d=[...s.data.values()].map((e,t)=>i._parse(new ParseInputLazyPath(s,e,s.path,t)));return s.common.async?Promise.all(d).then(e=>o(e)):o(d)}min(e,t){return new ZodSet({...this._def,minSize:{value:e,message:_.toString(t)}})}max(e,t){return new ZodSet({...this._def,maxSize:{value:e,message:_.toString(t)}})}size(e,t){return this.min(e,t).max(e,t)}nonempty(e){return this.min(1,e)}}ZodSet.create=(e,t)=>new ZodSet({valueType:e,minSize:null,maxSize:null,typeName:X.ZodSet,...v(t)});class ZodFunction extends ZodType{constructor(){super(...arguments),this.validate=this.implement}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==a.function)return c(t,{code:n.invalid_type,expected:a.function,received:t.parsedType}),u;function s(e,a){return d({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,o(),r].filter(e=>!!e),issueData:{code:n.invalid_arguments,argumentsError:a}})}function i(e,a){return d({data:e,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,o(),r].filter(e=>!!e),issueData:{code:n.invalid_return_type,returnTypeError:a}})}const l={errorMap:t.common.contextualErrorMap},h=t.data;if(this._def.returns instanceof ZodPromise){const e=this;return p(async function(...t){const a=new ZodError([]),n=await e._def.args.parseAsync(t,l).catch(e=>{throw a.addIssue(s(t,e)),a}),r=await Reflect.apply(h,this,n);return await e._def.returns._def.type.parseAsync(r,l).catch(e=>{throw a.addIssue(i(r,e)),a})})}{const e=this;return p(function(...t){const a=e._def.args.safeParse(t,l);if(!a.success)throw new ZodError([s(t,a.error)]);const n=Reflect.apply(h,this,a.data),r=e._def.returns.safeParse(n,l);if(!r.success)throw new ZodError([i(n,r.error)]);return r.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new ZodFunction({...this._def,args:ZodTuple.create(e).rest(ZodUnknown.create())})}returns(e){return new ZodFunction({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,t,a){return new ZodFunction({args:e||ZodTuple.create([]).rest(ZodUnknown.create()),returns:t||ZodUnknown.create(),typeName:X.ZodFunction,...v(a)})}}class ZodLazy extends ZodType{get schema(){return this._def.getter()}_parse(e){const{ctx:t}=this._processInputParams(e);return this._def.getter()._parse({data:t.data,path:t.path,parent:t})}}ZodLazy.create=(e,t)=>new ZodLazy({getter:e,typeName:X.ZodLazy,...v(t)});class ZodLiteral extends ZodType{_parse(e){if(e.data!==this._def.value){const t=this._getOrReturnCtx(e);return c(t,{received:t.data,code:n.invalid_literal,expected:this._def.value}),u}return{status:"valid",value:e.data}}get value(){return this._def.value}}function q(e,t){return new ZodEnum({values:e,typeName:X.ZodEnum,...v(t)})}ZodLiteral.create=(e,t)=>new ZodLiteral({value:e,typeName:X.ZodLiteral,...v(t)});class ZodEnum extends ZodType{_parse(t){if("string"!=typeof t.data){const a=this._getOrReturnCtx(t),s=this._def.values;return c(a,{expected:e.joinValues(s),received:a.parsedType,code:n.invalid_type}),u}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){const e=this._getOrReturnCtx(t),a=this._def.values;return c(e,{received:e.data,code:n.invalid_enum_value,options:a}),u}return p(t.data)}get options(){return this._def.values}get enum(){const e={};for(const t of this._def.values)e[t]=t;return e}get Values(){const e={};for(const t of this._def.values)e[t]=t;return e}get Enum(){const e={};for(const t of this._def.values)e[t]=t;return e}extract(e,t=this._def){return ZodEnum.create(e,{...this._def,...t})}exclude(e,t=this._def){return ZodEnum.create(this.options.filter(t=>!e.includes(t)),{...this._def,...t})}}ZodEnum.create=q;class ZodNativeEnum extends ZodType{_parse(t){const s=e.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==a.string&&r.parsedType!==a.number){const t=e.objectValues(s);return c(r,{expected:e.joinValues(t),received:r.parsedType,code:n.invalid_type}),u}if(this._cache||(this._cache=new Set(e.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){const t=e.objectValues(s);return c(r,{received:r.data,code:n.invalid_enum_value,options:t}),u}return p(t.data)}get enum(){return this._def.values}}ZodNativeEnum.create=(e,t)=>new ZodNativeEnum({values:e,typeName:X.ZodNativeEnum,...v(t)});class ZodPromise extends ZodType{unwrap(){return this._def.type}_parse(e){const{ctx:t}=this._processInputParams(e);if(t.parsedType!==a.promise&&!1===t.common.async)return c(t,{code:n.invalid_type,expected:a.promise,received:t.parsedType}),u;const s=t.parsedType===a.promise?t.data:Promise.resolve(t.data);return p(s.then(e=>this._def.type.parseAsync(e,{path:t.path,errorMap:t.common.contextualErrorMap})))}}ZodPromise.create=(e,t)=>new ZodPromise({type:e,typeName:X.ZodPromise,...v(t)});class ZodEffects extends ZodType{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===X.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){const{status:a,ctx:s}=this._processInputParams(t),n=this._def.effect||null,r={addIssue:e=>{c(s,e),e.fatal?a.abort():a.dirty()},get path(){return s.path}};if(r.addIssue=r.addIssue.bind(r),"preprocess"===n.type){const e=n.transform(s.data,r);if(s.common.async)return Promise.resolve(e).then(async e=>{if("aborted"===a.value)return u;const t=await this._def.schema._parseAsync({data:e,path:s.path,parent:s});return"aborted"===t.status?u:"dirty"===t.status||"dirty"===a.value?l(t.value):t});{if("aborted"===a.value)return u;const t=this._def.schema._parseSync({data:e,path:s.path,parent:s});return"aborted"===t.status?u:"dirty"===t.status||"dirty"===a.value?l(t.value):t}}if("refinement"===n.type){const e=e=>{const t=n.refinement(e,r);if(s.common.async)return Promise.resolve(t);if(t instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return e};if(!1===s.common.async){const t=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});return"aborted"===t.status?u:("dirty"===t.status&&a.dirty(),e(t.value),{status:a.value,value:t.value})}return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(t=>"aborted"===t.status?u:("dirty"===t.status&&a.dirty(),e(t.value).then(()=>({status:a.value,value:t.value}))))}if("transform"===n.type){if(!1===s.common.async){const e=this._def.schema._parseSync({data:s.data,path:s.path,parent:s});if(!f(e))return u;const t=n.transform(e.value,r);if(t instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:a.value,value:t}}return this._def.schema._parseAsync({data:s.data,path:s.path,parent:s}).then(e=>f(e)?Promise.resolve(n.transform(e.value,r)).then(e=>({status:a.value,value:e})):u)}e.assertNever(n)}}ZodEffects.create=(e,t,a)=>new ZodEffects({schema:e,typeName:X.ZodEffects,effect:t,...v(a)}),ZodEffects.createWithPreprocess=(e,t,a)=>new ZodEffects({schema:t,effect:{type:"preprocess",transform:e},typeName:X.ZodEffects,...v(a)});class ZodOptional extends ZodType{_parse(e){return this._getType(e)===a.undefined?p(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ZodOptional.create=(e,t)=>new ZodOptional({innerType:e,typeName:X.ZodOptional,...v(t)});class ZodNullable extends ZodType{_parse(e){return this._getType(e)===a.null?p(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}ZodNullable.create=(e,t)=>new ZodNullable({innerType:e,typeName:X.ZodNullable,...v(t)});class ZodDefault extends ZodType{_parse(e){const{ctx:t}=this._processInputParams(e);let s=t.data;return t.parsedType===a.undefined&&(s=this._def.defaultValue()),this._def.innerType._parse({data:s,path:t.path,parent:t})}removeDefault(){return this._def.innerType}}ZodDefault.create=(e,t)=>new ZodDefault({innerType:e,typeName:X.ZodDefault,defaultValue:"function"==typeof t.default?t.default:()=>t.default,...v(t)});class ZodCatch extends ZodType{_parse(e){const{ctx:t}=this._processInputParams(e),a={...t,common:{...t.common,issues:[]}},s=this._def.innerType._parse({data:a.data,path:a.path,parent:{...a}});return y(s)?s.then(e=>({status:"valid",value:"valid"===e.status?e.value:this._def.catchValue({get error(){return new ZodError(a.common.issues)},input:a.data})})):{status:"valid",value:"valid"===s.status?s.value:this._def.catchValue({get error(){return new ZodError(a.common.issues)},input:a.data})}}removeCatch(){return this._def.innerType}}ZodCatch.create=(e,t)=>new ZodCatch({innerType:e,typeName:X.ZodCatch,catchValue:"function"==typeof t.catch?t.catch:()=>t.catch,...v(t)});class ZodNaN extends ZodType{_parse(e){if(this._getType(e)!==a.nan){const t=this._getOrReturnCtx(e);return c(t,{code:n.invalid_type,expected:a.nan,received:t.parsedType}),u}return{status:"valid",value:e.data}}}ZodNaN.create=e=>new ZodNaN({typeName:X.ZodNaN,...v(e)});const J=Symbol("zod_brand");class ZodBranded extends ZodType{_parse(e){const{ctx:t}=this._processInputParams(e),a=t.data;return this._def.type._parse({data:a,path:t.path,parent:t})}unwrap(){return this._def.type}}class ZodPipeline extends ZodType{_parse(e){const{status:t,ctx:a}=this._processInputParams(e);if(a.common.async){return(async()=>{const e=await this._def.in._parseAsync({data:a.data,path:a.path,parent:a});return"aborted"===e.status?u:"dirty"===e.status?(t.dirty(),l(e.value)):this._def.out._parseAsync({data:e.value,path:a.path,parent:a})})()}{const e=this._def.in._parseSync({data:a.data,path:a.path,parent:a});return"aborted"===e.status?u:"dirty"===e.status?(t.dirty(),{status:"dirty",value:e.value}):this._def.out._parseSync({data:e.value,path:a.path,parent:a})}}static create(e,t){return new ZodPipeline({in:e,out:t,typeName:X.ZodPipeline})}}class ZodReadonly extends ZodType{_parse(e){const t=this._def.innerType._parse(e),a=e=>(f(e)&&(e.value=Object.freeze(e.value)),e);return y(t)?t.then(e=>a(e)):a(t)}unwrap(){return this._def.innerType}}function Y(e,t){const a="function"==typeof e?e(t):"string"==typeof e?{message:e}:e;return"string"==typeof a?{message:a}:a}function H(e,t={},a){return e?ZodAny.create().superRefine((s,n)=>{const r=e(s);if(r instanceof Promise)return r.then(e=>{if(!e){const e=Y(t,s),r=e.fatal??a??!0;n.addIssue({code:"custom",...e,fatal:r})}});if(!r){const e=Y(t,s),r=e.fatal??a??!0;n.addIssue({code:"custom",...e,fatal:r})}}):ZodAny.create()}ZodReadonly.create=(e,t)=>new ZodReadonly({innerType:e,typeName:X.ZodReadonly,...v(t)});const G={object:ZodObject.lazycreate};var X;!function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"}(X||(X={}));const Q=(e,t={message:`Input not instance of ${e.name}`})=>H(t=>t instanceof e,t),ee=ZodString.create,te=ZodNumber.create,ae=ZodNaN.create,se=ZodBigInt.create,ne=ZodBoolean.create,re=ZodDate.create,ie=ZodSymbol.create,oe=ZodUndefined.create,de=ZodNull.create,ce=ZodAny.create,ue=ZodUnknown.create,le=ZodNever.create,pe=ZodVoid.create,he=ZodArray.create,me=ZodObject.create,fe=ZodObject.strictCreate,ye=ZodUnion.create,_e=ZodDiscriminatedUnion.create,ge=ZodIntersection.create,ve=ZodTuple.create,Ze=ZodRecord.create,be=ZodMap.create,ke=ZodSet.create,xe=ZodFunction.create,we=ZodLazy.create,Te=ZodLiteral.create,Ne=ZodEnum.create,Oe=ZodNativeEnum.create,Se=ZodPromise.create,Ae=ZodEffects.create,Ee=ZodOptional.create,je=ZodNullable.create,Ce=ZodEffects.createWithPreprocess,Pe=ZodPipeline.create,Ie={string:e=>ZodString.create({...e,coerce:!0}),number:e=>ZodNumber.create({...e,coerce:!0}),boolean:e=>ZodBoolean.create({...e,coerce:!0}),bigint:e=>ZodBigInt.create({...e,coerce:!0}),date:e=>ZodDate.create({...e,coerce:!0})},Re=u;var $e=Object.freeze({__proto__:null,BRAND:J,DIRTY:l,EMPTY_PATH:[],INVALID:u,NEVER:Re,OK:p,ParseStatus,Schema:ZodType,ZodAny,ZodArray,ZodBigInt,ZodBoolean,ZodBranded,ZodCatch,ZodDate,ZodDefault,ZodDiscriminatedUnion,ZodEffects,ZodEnum,ZodError,get ZodFirstPartyTypeKind(){return X},ZodFunction,ZodIntersection,ZodIssueCode:n,ZodLazy,ZodLiteral,ZodMap,ZodNaN,ZodNativeEnum,ZodNever,ZodNull,ZodNullable,ZodNumber,ZodObject,ZodOptional,ZodParsedType:a,ZodPipeline,ZodPromise,ZodReadonly,ZodRecord,ZodSchema:ZodType,ZodSet,ZodString,ZodSymbol,ZodTransformer:ZodEffects,ZodTuple,ZodType,ZodUndefined,ZodUnion,ZodUnknown,ZodVoid,addIssueToContext:c,any:ce,array:he,bigint:se,boolean:ne,coerce:Ie,custom:H,date:re,datetimeRegex:z,defaultErrorMap:r,discriminatedUnion:_e,effect:Ae,enum:Ne,function:xe,getErrorMap:o,getParsedType:s,instanceof:Q,intersection:ge,isAborted:h,isAsync:y,isDirty:m,isValid:f,late:G,lazy:we,literal:Te,makeIssue:d,map:be,nan:ae,nativeEnum:Oe,never:le,null:de,nullable:je,number:te,object:me,get objectUtil(){return t},oboolean:()=>ne().optional(),onumber:()=>te().optional(),optional:Ee,ostring:()=>ee().optional(),pipeline:Pe,preprocess:Ce,promise:Se,quotelessJson:e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),record:Ze,set:ke,setErrorMap:function(e){i=e},strictObject:fe,string:ee,symbol:ie,transformer:Ae,tuple:ve,undefined:oe,union:ye,unknown:ue,get util(){return e},void:pe});export{he as a,ne as b,Oe as c,ye as d,Ne as e,de as f,ce as g,Q as i,Te as l,te as n,me as o,Ze as r,ee as s,ue as u,$e as z};
@@ -1 +1 @@
1
- import{a as t,t as e,c as n,n as r,s as a,m as o,b as i,g as u}from"./parseISO-jT42c8Ob.js";function s(e,n){return t(e,{...n,weekStartsOn:1})}function c(t,r){const a=e(t,r?.in),o=a.getFullYear(),i=n(a,0);i.setFullYear(o+1,0,4),i.setHours(0,0,0,0);const u=s(i),c=n(a,0);c.setFullYear(o,0,4),c.setHours(0,0,0,0);const d=s(c);return a.getTime()>=u.getTime()?o+1:a.getTime()>=d.getTime()?o:o-1}function d(t){const n=e(t),r=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()));return r.setUTCFullYear(n.getFullYear()),+t-+r}function h(t){return!(!((n=t)instanceof Date||"object"==typeof n&&"[object Date]"===Object.prototype.toString.call(n))&&"number"!=typeof t||isNaN(+e(t)));var n}const l={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function m(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}const f={date:m({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:m({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:m({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},g={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function w(t){return(e,n)=>{let r;if("formatting"===(n?.context?String(n.context):"standalone")&&t.formattingValues){const e=t.defaultFormattingWidth||t.defaultWidth,a=n?.width?String(n.width):e;r=t.formattingValues[a]||t.formattingValues[e]}else{const e=t.defaultWidth,a=n?.width?String(n.width):t.defaultWidth;r=t.values[a]||t.values[e]}return r[t.argumentCallback?t.argumentCallback(e):e]}}function b(t){return(e,n={})=>{const r=n.width,a=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],o=e.match(a);if(!o)return null;const i=o[0],u=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],s=Array.isArray(u)?function(t,e){for(let n=0;n<t.length;n++)if(e(t[n]))return n;return}(u,t=>t.test(i)):function(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n;return}(u,t=>t.test(i));let c;c=t.valueCallback?t.valueCallback(s):s,c=n.valueCallback?n.valueCallback(c):c;return{value:c,rest:e.slice(i.length)}}}var y;const p={code:"en-US",formatDistance:(t,e,n)=>{let r;const a=l[t];return r="string"==typeof a?a:1===e?a.one:a.other.replace("{{count}}",e.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r},formatLong:f,formatRelative:(t,e,n,r)=>g[t],localize:{ordinalNumber:(t,e)=>{const n=Number(t),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:w({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:w({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:t=>t-1}),month:w({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:w({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:w({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(y={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:t=>parseInt(t,10)},(t,e={})=>{const n=t.match(y.matchPattern);if(!n)return null;const r=n[0],a=t.match(y.parsePattern);if(!a)return null;let o=y.valueCallback?y.valueCallback(a[0]):a[0];return o=e.valueCallback?e.valueCallback(o):o,{value:o,rest:t.slice(r.length)}}),era:b({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:b({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:t=>t+1}),month:b({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:b({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:b({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}};function M(t,n){const i=e(t,n?.in),u=function(t,e,n){const[i,u]=r(n?.in,t,e),s=a(i),c=a(u),h=+s-d(s),l=+c-d(c);return Math.round((h-l)/o)}(i,function(t,n){const r=e(t,n?.in);return r.setFullYear(r.getFullYear(),0,1),r.setHours(0,0,0,0),r}(i));return u+1}function v(t,r){const a=e(t,r?.in),o=+s(a)-+function(t,e){const r=c(t,e),a=n(t,0);return a.setFullYear(r,0,4),a.setHours(0,0,0,0),s(a)}(a);return Math.round(o/i)+1}function x(r,a){const o=e(r,a?.in),i=o.getFullYear(),s=u(),c=a?.firstWeekContainsDate??a?.locale?.options?.firstWeekContainsDate??s.firstWeekContainsDate??s.locale?.options?.firstWeekContainsDate??1,d=n(a?.in||r,0);d.setFullYear(i+1,0,c),d.setHours(0,0,0,0);const h=t(d,a),l=n(a?.in||r,0);l.setFullYear(i,0,c),l.setHours(0,0,0,0);const m=t(l,a);return+o>=+h?i+1:+o>=+m?i:i-1}function P(r,a){const o=e(r,a?.in),s=+t(o,a)-+function(e,r){const a=u(),o=r?.firstWeekContainsDate??r?.locale?.options?.firstWeekContainsDate??a.firstWeekContainsDate??a.locale?.options?.firstWeekContainsDate??1,i=x(e,r),s=n(r?.in||e,0);return s.setFullYear(i,0,o),s.setHours(0,0,0,0),t(s,r)}(o,a);return Math.round(s/i)+1}function k(t,e){return(t<0?"-":"")+Math.abs(t).toString().padStart(e,"0")}const S={y(t,e){const n=t.getFullYear(),r=n>0?n:1-n;return k("yy"===e?r%100:r,e.length)},M(t,e){const n=t.getMonth();return"M"===e?String(n+1):k(n+1,2)},d:(t,e)=>k(t.getDate(),e.length),a(t,e){const n=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return"am"===n?"a.m.":"p.m."}},h:(t,e)=>k(t.getHours()%12||12,e.length),H:(t,e)=>k(t.getHours(),e.length),m:(t,e)=>k(t.getMinutes(),e.length),s:(t,e)=>k(t.getSeconds(),e.length),S(t,e){const n=e.length,r=t.getMilliseconds();return k(Math.trunc(r*Math.pow(10,n-3)),e.length)}},W="midnight",D="noon",T="morning",Y="afternoon",C="evening",q="night",F={G:function(t,e,n){const r=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});default:return n.era(r,{width:"wide"})}},y:function(t,e,n){if("yo"===e){const e=t.getFullYear(),r=e>0?e:1-e;return n.ordinalNumber(r,{unit:"year"})}return S.y(t,e)},Y:function(t,e,n,r){const a=x(t,r),o=a>0?a:1-a;if("YY"===e){return k(o%100,2)}return"Yo"===e?n.ordinalNumber(o,{unit:"year"}):k(o,e.length)},R:function(t,e){return k(c(t),e.length)},u:function(t,e){return k(t.getFullYear(),e.length)},Q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(r);case"QQ":return k(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(r);case"qq":return k(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,e,n){const r=t.getMonth();switch(e){case"M":case"MM":return S.M(t,e);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(t,e,n){const r=t.getMonth();switch(e){case"L":return String(r+1);case"LL":return k(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(t,e,n,r){const a=P(t,r);return"wo"===e?n.ordinalNumber(a,{unit:"week"}):k(a,e.length)},I:function(t,e,n){const r=v(t);return"Io"===e?n.ordinalNumber(r,{unit:"week"}):k(r,e.length)},d:function(t,e,n){return"do"===e?n.ordinalNumber(t.getDate(),{unit:"date"}):S.d(t,e)},D:function(t,e,n){const r=M(t);return"Do"===e?n.ordinalNumber(r,{unit:"dayOfYear"}):k(r,e.length)},E:function(t,e,n){const r=t.getDay();switch(e){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(t,e,n,r){const a=t.getDay(),o=(a-r.weekStartsOn+8)%7||7;switch(e){case"e":return String(o);case"ee":return k(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(a,{width:"short",context:"formatting"});default:return n.day(a,{width:"wide",context:"formatting"})}},c:function(t,e,n,r){const a=t.getDay(),o=(a-r.weekStartsOn+8)%7||7;switch(e){case"c":return String(o);case"cc":return k(o,e.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(a,{width:"narrow",context:"standalone"});case"cccccc":return n.day(a,{width:"short",context:"standalone"});default:return n.day(a,{width:"wide",context:"standalone"})}},i:function(t,e,n){const r=t.getDay(),a=0===r?7:r;switch(e){case"i":return String(a);case"ii":return k(a,e.length);case"io":return n.ordinalNumber(a,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(t,e,n){const r=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(t,e,n){const r=t.getHours();let a;switch(a=12===r?D:0===r?W:r/12>=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(a,{width:"narrow",context:"formatting"});default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(t,e,n){const r=t.getHours();let a;switch(a=r>=17?C:r>=12?Y:r>=4?T:q,e){case"B":case"BB":case"BBB":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(a,{width:"narrow",context:"formatting"});default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(t,e,n){if("ho"===e){let e=t.getHours()%12;return 0===e&&(e=12),n.ordinalNumber(e,{unit:"hour"})}return S.h(t,e)},H:function(t,e,n){return"Ho"===e?n.ordinalNumber(t.getHours(),{unit:"hour"}):S.H(t,e)},K:function(t,e,n){const r=t.getHours()%12;return"Ko"===e?n.ordinalNumber(r,{unit:"hour"}):k(r,e.length)},k:function(t,e,n){let r=t.getHours();return 0===r&&(r=24),"ko"===e?n.ordinalNumber(r,{unit:"hour"}):k(r,e.length)},m:function(t,e,n){return"mo"===e?n.ordinalNumber(t.getMinutes(),{unit:"minute"}):S.m(t,e)},s:function(t,e,n){return"so"===e?n.ordinalNumber(t.getSeconds(),{unit:"second"}):S.s(t,e)},S:function(t,e){return S.S(t,e)},X:function(t,e,n){const r=t.getTimezoneOffset();if(0===r)return"Z";switch(e){case"X":return O(r);case"XXXX":case"XX":return E(r);default:return E(r,":")}},x:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"x":return O(r);case"xxxx":case"xx":return E(r);default:return E(r,":")}},O:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+N(r,":");default:return"GMT"+E(r,":")}},z:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+N(r,":");default:return"GMT"+E(r,":")}},t:function(t,e,n){return k(Math.trunc(+t/1e3),e.length)},T:function(t,e,n){return k(+t,e.length)}};function N(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),a=Math.trunc(r/60),o=r%60;return 0===o?n+String(a):n+String(a)+e+k(o,2)}function O(t,e){if(t%60==0){return(t>0?"-":"+")+k(Math.abs(t)/60,2)}return E(t,e)}function E(t,e=""){const n=t>0?"-":"+",r=Math.abs(t);return n+k(Math.trunc(r/60),2)+e+k(r%60,2)}const H=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});default:return e.date({width:"full"})}},z=(t,e)=>{switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});default:return e.time({width:"full"})}},j={p:z,P:(t,e)=>{const n=t.match(/(P+)(p+)?/)||[],r=n[1],a=n[2];if(!a)return H(t,e);let o;switch(r){case"P":o=e.dateTime({width:"short"});break;case"PP":o=e.dateTime({width:"medium"});break;case"PPP":o=e.dateTime({width:"long"});break;default:o=e.dateTime({width:"full"})}return o.replace("{{date}}",H(r,e)).replace("{{time}}",z(a,e))}},L=/^D+$/,Q=/^Y+$/,G=["D","DD","YY","YYYY"];const X=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,A=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,B=/^'([^]*?)'?$/,$=/''/g,J=/[a-zA-Z]/;function I(t,n,r){const a=u(),o=a.locale??p,i=a.firstWeekContainsDate??a.locale?.options?.firstWeekContainsDate??1,s=a.weekStartsOn??a.locale?.options?.weekStartsOn??0,c=e(t,r?.in);if(!h(c))throw new RangeError("Invalid time value");let d=n.match(A).map(t=>{const e=t[0];if("p"===e||"P"===e){return(0,j[e])(t,o.formatLong)}return t}).join("").match(X).map(t=>{if("''"===t)return{isToken:!1,value:"'"};const e=t[0];if("'"===e)return{isToken:!1,value:R(t)};if(F[e])return{isToken:!0,value:t};if(e.match(J))throw new RangeError("Format string contains an unescaped latin alphabet character `"+e+"`");return{isToken:!1,value:t}});o.localize.preprocessor&&(d=o.localize.preprocessor(c,d));const l={firstWeekContainsDate:i,weekStartsOn:s,locale:o};return d.map(e=>{if(!e.isToken)return e.value;const r=e.value;(function(t){return Q.test(t)}(r)||function(t){return L.test(t)}(r))&&function(t,e,n){const r=function(t,e,n){const r="Y"===t[0]?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}(t,e,n);if(console.warn(r),G.includes(t))throw new RangeError(r)}(r,n,String(t));return(0,F[r[0]])(c,r,o.localize,l)}).join("")}function R(t){const e=t.match(B);return e?e[1].replace($,"'"):t}export{I as f,h as i};
1
+ import{a as t,t as e,c as n,n as r,s as a,m as o,b as i,g as u}from"./parseISO-Dj3qSTG8.js";function s(e,n){return t(e,{...n,weekStartsOn:1})}function c(t,r){const a=e(t,r?.in),o=a.getFullYear(),i=n(a,0);i.setFullYear(o+1,0,4),i.setHours(0,0,0,0);const u=s(i),c=n(a,0);c.setFullYear(o,0,4),c.setHours(0,0,0,0);const d=s(c);return a.getTime()>=u.getTime()?o+1:a.getTime()>=d.getTime()?o:o-1}function d(t){const n=e(t),r=new Date(Date.UTC(n.getFullYear(),n.getMonth(),n.getDate(),n.getHours(),n.getMinutes(),n.getSeconds(),n.getMilliseconds()));return r.setUTCFullYear(n.getFullYear()),+t-+r}function h(t){return!(!((n=t)instanceof Date||"object"==typeof n&&"[object Date]"===Object.prototype.toString.call(n))&&"number"!=typeof t||isNaN(+e(t)));var n}const l={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function m(t){return(e={})=>{const n=e.width?String(e.width):t.defaultWidth;return t.formats[n]||t.formats[t.defaultWidth]}}const f={date:m({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:m({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:m({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},g={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function w(t){return(e,n)=>{let r;if("formatting"===(n?.context?String(n.context):"standalone")&&t.formattingValues){const e=t.defaultFormattingWidth||t.defaultWidth,a=n?.width?String(n.width):e;r=t.formattingValues[a]||t.formattingValues[e]}else{const e=t.defaultWidth,a=n?.width?String(n.width):t.defaultWidth;r=t.values[a]||t.values[e]}return r[t.argumentCallback?t.argumentCallback(e):e]}}function b(t){return(e,n={})=>{const r=n.width,a=r&&t.matchPatterns[r]||t.matchPatterns[t.defaultMatchWidth],o=e.match(a);if(!o)return null;const i=o[0],u=r&&t.parsePatterns[r]||t.parsePatterns[t.defaultParseWidth],s=Array.isArray(u)?function(t,e){for(let n=0;n<t.length;n++)if(e(t[n]))return n;return}(u,t=>t.test(i)):function(t,e){for(const n in t)if(Object.prototype.hasOwnProperty.call(t,n)&&e(t[n]))return n;return}(u,t=>t.test(i));let c;c=t.valueCallback?t.valueCallback(s):s,c=n.valueCallback?n.valueCallback(c):c;return{value:c,rest:e.slice(i.length)}}}var y;const p={code:"en-US",formatDistance:(t,e,n)=>{let r;const a=l[t];return r="string"==typeof a?a:1===e?a.one:a.other.replace("{{count}}",e.toString()),n?.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r},formatLong:f,formatRelative:(t,e,n,r)=>g[t],localize:{ordinalNumber:(t,e)=>{const n=Number(t),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:w({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:w({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:t=>t-1}),month:w({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:w({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:w({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})},match:{ordinalNumber:(y={matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:t=>parseInt(t,10)},(t,e={})=>{const n=t.match(y.matchPattern);if(!n)return null;const r=n[0],a=t.match(y.parsePattern);if(!a)return null;let o=y.valueCallback?y.valueCallback(a[0]):a[0];return o=e.valueCallback?e.valueCallback(o):o,{value:o,rest:t.slice(r.length)}}),era:b({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:b({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:t=>t+1}),month:b({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:b({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:b({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},options:{weekStartsOn:0,firstWeekContainsDate:1}};function M(t,n){const i=e(t,n?.in),u=function(t,e,n){const[i,u]=r(n?.in,t,e),s=a(i),c=a(u),h=+s-d(s),l=+c-d(c);return Math.round((h-l)/o)}(i,function(t,n){const r=e(t,n?.in);return r.setFullYear(r.getFullYear(),0,1),r.setHours(0,0,0,0),r}(i));return u+1}function v(t,r){const a=e(t,r?.in),o=+s(a)-+function(t,e){const r=c(t,e),a=n(t,0);return a.setFullYear(r,0,4),a.setHours(0,0,0,0),s(a)}(a);return Math.round(o/i)+1}function x(r,a){const o=e(r,a?.in),i=o.getFullYear(),s=u(),c=a?.firstWeekContainsDate??a?.locale?.options?.firstWeekContainsDate??s.firstWeekContainsDate??s.locale?.options?.firstWeekContainsDate??1,d=n(a?.in||r,0);d.setFullYear(i+1,0,c),d.setHours(0,0,0,0);const h=t(d,a),l=n(a?.in||r,0);l.setFullYear(i,0,c),l.setHours(0,0,0,0);const m=t(l,a);return+o>=+h?i+1:+o>=+m?i:i-1}function P(r,a){const o=e(r,a?.in),s=+t(o,a)-+function(e,r){const a=u(),o=r?.firstWeekContainsDate??r?.locale?.options?.firstWeekContainsDate??a.firstWeekContainsDate??a.locale?.options?.firstWeekContainsDate??1,i=x(e,r),s=n(r?.in||e,0);return s.setFullYear(i,0,o),s.setHours(0,0,0,0),t(s,r)}(o,a);return Math.round(s/i)+1}function k(t,e){return(t<0?"-":"")+Math.abs(t).toString().padStart(e,"0")}const S={y(t,e){const n=t.getFullYear(),r=n>0?n:1-n;return k("yy"===e?r%100:r,e.length)},M(t,e){const n=t.getMonth();return"M"===e?String(n+1):k(n+1,2)},d:(t,e)=>k(t.getDate(),e.length),a(t,e){const n=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.toUpperCase();case"aaa":return n;case"aaaaa":return n[0];default:return"am"===n?"a.m.":"p.m."}},h:(t,e)=>k(t.getHours()%12||12,e.length),H:(t,e)=>k(t.getHours(),e.length),m:(t,e)=>k(t.getMinutes(),e.length),s:(t,e)=>k(t.getSeconds(),e.length),S(t,e){const n=e.length,r=t.getMilliseconds();return k(Math.trunc(r*Math.pow(10,n-3)),e.length)}},W="midnight",D="noon",T="morning",Y="afternoon",C="evening",q="night",F={G:function(t,e,n){const r=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});default:return n.era(r,{width:"wide"})}},y:function(t,e,n){if("yo"===e){const e=t.getFullYear(),r=e>0?e:1-e;return n.ordinalNumber(r,{unit:"year"})}return S.y(t,e)},Y:function(t,e,n,r){const a=x(t,r),o=a>0?a:1-a;if("YY"===e){return k(o%100,2)}return"Yo"===e?n.ordinalNumber(o,{unit:"year"}):k(o,e.length)},R:function(t,e){return k(c(t),e.length)},u:function(t,e){return k(t.getFullYear(),e.length)},Q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(r);case"QQ":return k(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(t,e,n){const r=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(r);case"qq":return k(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(t,e,n){const r=t.getMonth();switch(e){case"M":case"MM":return S.M(t,e);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(t,e,n){const r=t.getMonth();switch(e){case"L":return String(r+1);case"LL":return k(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(t,e,n,r){const a=P(t,r);return"wo"===e?n.ordinalNumber(a,{unit:"week"}):k(a,e.length)},I:function(t,e,n){const r=v(t);return"Io"===e?n.ordinalNumber(r,{unit:"week"}):k(r,e.length)},d:function(t,e,n){return"do"===e?n.ordinalNumber(t.getDate(),{unit:"date"}):S.d(t,e)},D:function(t,e,n){const r=M(t);return"Do"===e?n.ordinalNumber(r,{unit:"dayOfYear"}):k(r,e.length)},E:function(t,e,n){const r=t.getDay();switch(e){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(t,e,n,r){const a=t.getDay(),o=(a-r.weekStartsOn+8)%7||7;switch(e){case"e":return String(o);case"ee":return k(o,2);case"eo":return n.ordinalNumber(o,{unit:"day"});case"eee":return n.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(a,{width:"short",context:"formatting"});default:return n.day(a,{width:"wide",context:"formatting"})}},c:function(t,e,n,r){const a=t.getDay(),o=(a-r.weekStartsOn+8)%7||7;switch(e){case"c":return String(o);case"cc":return k(o,e.length);case"co":return n.ordinalNumber(o,{unit:"day"});case"ccc":return n.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(a,{width:"narrow",context:"standalone"});case"cccccc":return n.day(a,{width:"short",context:"standalone"});default:return n.day(a,{width:"wide",context:"standalone"})}},i:function(t,e,n){const r=t.getDay(),a=0===r?7:r;switch(e){case"i":return String(a);case"ii":return k(a,e.length);case"io":return n.ordinalNumber(a,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(t,e,n){const r=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(t,e,n){const r=t.getHours();let a;switch(a=12===r?D:0===r?W:r/12>=1?"pm":"am",e){case"b":case"bb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(a,{width:"narrow",context:"formatting"});default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(t,e,n){const r=t.getHours();let a;switch(a=r>=17?C:r>=12?Y:r>=4?T:q,e){case"B":case"BB":case"BBB":return n.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(a,{width:"narrow",context:"formatting"});default:return n.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(t,e,n){if("ho"===e){let e=t.getHours()%12;return 0===e&&(e=12),n.ordinalNumber(e,{unit:"hour"})}return S.h(t,e)},H:function(t,e,n){return"Ho"===e?n.ordinalNumber(t.getHours(),{unit:"hour"}):S.H(t,e)},K:function(t,e,n){const r=t.getHours()%12;return"Ko"===e?n.ordinalNumber(r,{unit:"hour"}):k(r,e.length)},k:function(t,e,n){let r=t.getHours();return 0===r&&(r=24),"ko"===e?n.ordinalNumber(r,{unit:"hour"}):k(r,e.length)},m:function(t,e,n){return"mo"===e?n.ordinalNumber(t.getMinutes(),{unit:"minute"}):S.m(t,e)},s:function(t,e,n){return"so"===e?n.ordinalNumber(t.getSeconds(),{unit:"second"}):S.s(t,e)},S:function(t,e){return S.S(t,e)},X:function(t,e,n){const r=t.getTimezoneOffset();if(0===r)return"Z";switch(e){case"X":return O(r);case"XXXX":case"XX":return E(r);default:return E(r,":")}},x:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"x":return O(r);case"xxxx":case"xx":return E(r);default:return E(r,":")}},O:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+N(r,":");default:return"GMT"+E(r,":")}},z:function(t,e,n){const r=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+N(r,":");default:return"GMT"+E(r,":")}},t:function(t,e,n){return k(Math.trunc(+t/1e3),e.length)},T:function(t,e,n){return k(+t,e.length)}};function N(t,e=""){const n=t>0?"-":"+",r=Math.abs(t),a=Math.trunc(r/60),o=r%60;return 0===o?n+String(a):n+String(a)+e+k(o,2)}function O(t,e){if(t%60==0){return(t>0?"-":"+")+k(Math.abs(t)/60,2)}return E(t,e)}function E(t,e=""){const n=t>0?"-":"+",r=Math.abs(t);return n+k(Math.trunc(r/60),2)+e+k(r%60,2)}const H=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});default:return e.date({width:"full"})}},z=(t,e)=>{switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});default:return e.time({width:"full"})}},j={p:z,P:(t,e)=>{const n=t.match(/(P+)(p+)?/)||[],r=n[1],a=n[2];if(!a)return H(t,e);let o;switch(r){case"P":o=e.dateTime({width:"short"});break;case"PP":o=e.dateTime({width:"medium"});break;case"PPP":o=e.dateTime({width:"long"});break;default:o=e.dateTime({width:"full"})}return o.replace("{{date}}",H(r,e)).replace("{{time}}",z(a,e))}},L=/^D+$/,Q=/^Y+$/,G=["D","DD","YY","YYYY"];const X=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,A=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,B=/^'([^]*?)'?$/,$=/''/g,J=/[a-zA-Z]/;function I(t,n,r){const a=u(),o=a.locale??p,i=a.firstWeekContainsDate??a.locale?.options?.firstWeekContainsDate??1,s=a.weekStartsOn??a.locale?.options?.weekStartsOn??0,c=e(t,r?.in);if(!h(c))throw new RangeError("Invalid time value");let d=n.match(A).map(t=>{const e=t[0];if("p"===e||"P"===e){return(0,j[e])(t,o.formatLong)}return t}).join("").match(X).map(t=>{if("''"===t)return{isToken:!1,value:"'"};const e=t[0];if("'"===e)return{isToken:!1,value:R(t)};if(F[e])return{isToken:!0,value:t};if(e.match(J))throw new RangeError("Format string contains an unescaped latin alphabet character `"+e+"`");return{isToken:!1,value:t}});o.localize.preprocessor&&(d=o.localize.preprocessor(c,d));const l={firstWeekContainsDate:i,weekStartsOn:s,locale:o};return d.map(e=>{if(!e.isToken)return e.value;const r=e.value;(function(t){return Q.test(t)}(r)||function(t){return L.test(t)}(r))&&function(t,e,n){const r=function(t,e,n){const r="Y"===t[0]?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${r} to the input \`${n}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}(t,e,n);if(console.warn(r),G.includes(t))throw new RangeError(r)}(r,n,String(t));return(0,F[r[0]])(c,r,o.localize,l)}).join("")}function R(t){const e=t.match(B);return e?e[1].replace($,"'"):t}export{I as f,h as i};
@@ -0,0 +1 @@
1
+ function n(n,t,e){return{queryKey:["appointments",t.id],queryFn:()=>n.appointments.getAppointment(t),...e}}export{n as g};
@@ -0,0 +1 @@
1
+ function e(e,t){return{queryKey:["patient-documents",t],queryFn:()=>e.flash.getPatientDocuments(t)}}export{e as g};
@@ -0,0 +1 @@
1
+ function e(e,r){return{queryKey:["patient-profile"],queryFn:()=>e.profile.getPatientProfile(),...r}}export{e as g};
@@ -0,0 +1 @@
1
+ function o(o,a){return{queryKey:["organization-specialties"],queryFn:()=>o.organizations.getOrganizationSpecialties(),...a}}var a={digestive_system:{de_DE:"Verdauungssystem",en_US:"Digestive System",es_ES:"Aparato Digestivo",ca_ES:"Aparell Digestiu",pt_PT:"Aparelho Digestivo"},orthopedic_surgery_traumatology:{de_DE:"Traumatologie und Orthopädische Chirurgie",en_US:"Traumatology and Orthopedic Surgery",es_ES:"Traumatología y Cirugía Ortopédica",ca_ES:"Traumatologia i Cirurgia Ortopèdica",pt_PT:"Traumatologia e Cirurgia Ortopédica"},gynecology:{de_DE:"Gynäkologie",en_US:"Gynecology",es_ES:"Ginecología",ca_ES:"Ginecologia",pt_PT:"Ginecologia"},endocrinology:{de_DE:"Endokrinologie",en_US:"Endocrinology",es_ES:"Endocrinología",ca_ES:"Endocrinologia",pt_PT:"Endocrinologia"},psychiatry:{de_DE:"Psychiatrie",en_US:"Psychiatry",es_ES:"Psiquiatría",ca_ES:"Psiquiatria",pt_PT:"Psiquiatria"}},e={videocall:{de_DE:"Videosprechstunde",en_US:"Videocall",es_ES:"Videoconsulta",ca_ES:"Videoconsulta",pt_PT:"Videoconsulta"},phonecall:{de_DE:"Telefonische Behandlung",en_US:"Phone consultation",es_ES:"Consulta telefónica",ca_ES:"Consulta telefònica",pt_PT:"Consulta telefónica"}},i={de_DE:"Konsultationspreis",en_US:"Consultation price",es_ES:"Precio de consulta",ca_ES:"Preu de consulta",pt_PT:"Preço da consulta"},n={videocall:"videocall",phonecall:"phonecall",adeslas_videocall:"videocall",adeslas_prod_videocall:"videocall",adeslas_phonecall:"phonecall",adeslas_prod_phonecall:"phonecall"};function t(o,a,t){if(!o)return t??"";const l=n[o];return l?e[l][a]:t??i[a]}var l={consulta_telefonica:"phonecall",videoconsulta:"videocall"},c={"aparato-digestivo":"digestive_system","cirugia-ortopedica-y-traumatologia":"orthopedic_surgery_traumatology",ginecologia:"gynecology",endocrinologia:"endocrinology",psiquiatria:"psychiatry"};function r(o,e,i){const n=i?.trim();if(n)return n;const t=a[o]?.[e];return void 0!==t?t:o}export{l as S,r as a,c as b,t as c,a as d,o as g};
@@ -0,0 +1 @@
1
+ class SupportChatToggleRequestEvent extends Event{static{this.eventName="mq-support-chat-toggle-request"}constructor(){super(SupportChatToggleRequestEvent.eventName,{bubbles:!0,composed:!0})}}class SupportChatUnreadRequestEvent extends Event{static{this.eventName="mq-support-chat-unread-request"}constructor(){super(SupportChatUnreadRequestEvent.eventName,{bubbles:!0,composed:!0})}}class SupportChatUnreadChangeEvent extends Event{static{this.eventName="mq-support-chat-unread-change"}constructor(e){super(SupportChatUnreadChangeEvent.eventName,{bubbles:!0,composed:!0}),this.count=e}}class SupportChatOpenEvent extends Event{static{this.eventName="mq-support-chat-open"}constructor(){super(SupportChatOpenEvent.eventName,{bubbles:!0,composed:!0})}}class SupportChatCloseEvent extends Event{static{this.eventName="mq-support-chat-close"}constructor(){super(SupportChatCloseEvent.eventName,{bubbles:!0,composed:!0})}}export{SupportChatUnreadChangeEvent as S,SupportChatUnreadRequestEvent as a,SupportChatToggleRequestEvent as b,SupportChatOpenEvent as c,SupportChatCloseEvent as d};
@@ -0,0 +1 @@
1
+ import{_ as t,t as e}from"./custom-element-DA9Fxvxd.js";import{x as a,i,a as r}from"./lit-element-DiWJYFwC.js";import{n as s}from"./property-scuRaFcM.js";import{e as o}from"./class-map-Co76I6aw.js";import{t as n,c as l,p as d,s as c}from"./parseISO-Dj3qSTG8.js";import{f as h}from"./format-CRFiCNHw.js";import"../ui/mq-skeleton.js";import{m}from"./runtime-Bg1WXVCx.js";import{l as v}from"./localized-decorator-BlOuLhym.js";import{i as p}from"./isSameDay-CuhZMy1T.js";function u(t,e,a){const i=n(t,a?.in);return isNaN(e)?l(t,NaN):e?(i.setDate(i.getDate()+e),i):i}function g(t,e){const a=d(t);if(e)try{const t=new Intl.DateTimeFormat("en-CA",{timeZone:e,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",hourCycle:"h23"}).formatToParts(a),i=e=>t.find(t=>t.type===e)?.value??"";return{dateKey:`${i("year")}-${i("month")}-${i("day")}`,label:`${i("hour")}:${i("minute")}`}}catch{}return{dateKey:h(c(a),"yyyy-MM-dd"),label:h(a,"HH:mm")}}const y=i`:host{display:block;font-family:var(--font-body)}.time-slot-picker{display:flex;flex-direction:column;gap:var(--sp-4);border-radius:var(--border-radius-lg);transition:opacity .2s}.time-slot-picker.is-loading{opacity:.6}.picker-content{display:flex;flex-direction:column;gap:var(--sp-4)}.columns-wrapper{position:relative;display:flex;flex-direction:column;gap:var(--sp-4);flex:1;min-width:0}.grid-container{display:grid;grid-template-columns:repeat(var(--visible-days,4),1fr);gap:var(--sp-2);position:relative}.dates-header{position:sticky;top:0;display:contents;z-index:10;padding-bottom:var(--sp-2)}.nav-button{position:absolute;top:var(--sp-9);transform:translateY(-50%);display:flex;align-items:center;justify-content:center;width:var(--size-6);height:var(--size-6);border:none;cursor:pointer;transition:background-color .2s;background:var(--color-primary);color:var(--color-white);border-radius:var(--border-radius-full);padding:0;z-index:20}.nav-button-prev{left:0;transform:translate(-50%,-50%)}.nav-button-next{right:0;transform:translate(50%,-50%)}.nav-button:hover:not(:disabled){background:var(--color-primary-dark)}.nav-button:disabled{background:var(--color-neutrals-background-disabled);color:var(--color-neutrals-text-medium);cursor:not-allowed}.date-card{box-sizing:border-box;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:var(--sp-2) var(--sp-3);border:1px solid var(--color-neutrals-border-disabled);background:var(--color-white);border-radius:var(--border-radius-lg);transition:all .2s;min-width:var(--sp-16);height:var(--sp-18);flex:1}.date-weekday{font-size:var(--text-sm);line-height:var(--text-sm--line-height);font-weight:var(--font-weight-normal);color:var(--color-neutrals-text-default);text-transform:capitalize}.date-day{font-size:var(--text-xl);font-weight:var(--font-weight-normal);color:var(--color-neutrals-text-default)}.date-month{font-size:var(--text-sm);line-height:var(--text-sm--line-height);font-weight:var(--font-weight-normal);color:var(--color-neutrals-text-default);text-transform:capitalize}.time-slots-container{display:contents}.time-slots-column{display:flex;flex-direction:column;gap:var(--sp-2)}.time-slot{padding:var(--sp-2) var(--sp-1);border:1px solid var(--color-border);background:var(--color-muted);border-radius:var(--border-radius-md);cursor:pointer;transition:all .2s;font-family:var(--font-body);font-size:var(--text-sm);font-weight:var(--font-weight-medium);color:var(--color-neutrals-text-default);text-align:center;min-width:var(--sp-16);height:var(--sp-11)}.time-slot:hover{background:var(--color-primary-light)}.time-slot.selected{border-color:var(--color-primary);background:var(--color-primary);color:var(--color-white);font-weight:var(--font-weight-bold)}.empty-state{display:flex;align-items:center;justify-content:center;padding:var(--sp-12) var(--sp-6);text-align:center;grid-column:1/-1;font-size:var(--text-sm);color:var(--color-neutrals-text-weak)}`;class WindowChangeEvent extends Event{static{this.eventName="window-change"}constructor(t){super(WindowChangeEvent.eventName,{bubbles:!0,composed:!0}),this.detail=t}}class SlotSelectEvent extends Event{static{this.eventName="slot-select"}constructor(t){super(SlotSelectEvent.eventName,{bubbles:!0,composed:!0}),this.detail=t}}let f=class MqTimeSlotPicker extends r{constructor(){super(...arguments),this.locale="es-ES",this.slots=[],this.visibleDays=4,this.isLoading=!1,this.handlePrevious=()=>{if(!this.canGoPrevious)return;const t=u(this.getStartDate(),-this.visibleDays),e=c(new Date),a=t<e?e:t,i=this.formatDate(a);this.dispatchEvent(new WindowChangeEvent({windowStartDate:i}))},this.handleNext=()=>{const t=u(this.getStartDate(),this.visibleDays),e=this.formatDate(t);this.dispatchEvent(new WindowChangeEvent({windowStartDate:e}))},this.handleTimeSlotSelect=(t,e)=>{const a=this.formatDate(t.date);this.selectedDate=a,this.selectedSlotKey=e.key,this.dispatchEvent(new SlotSelectEvent({slot:{key:e.key,date:e.date}}))}}static{this.styles=[y]}getStartDate(){return this.windowStartDate?c(d(this.windowStartDate)):c(new Date)}get slotsByDate(){const t=new Map;for(const e of this.slots){const{dateKey:a,label:i}=g(e.date,this.timezone);t.has(a)||t.set(a,[]),t.get(a)?.push({key:e.key,label:i,date:e.date})}for(const e of t.values())e.sort((t,e)=>{const a=d(t.date),i=d(e.date);return a.getTime()-i.getTime()});return t}get visibleDaysList(){const t=this.getStartDate(),e=[],a=this.slotsByDate;for(let i=0;i<this.visibleDays;i++){const r=u(t,i),s=this.formatDate(r),o=a.get(s)||[];e.push({date:r,slots:o})}return e}get canGoPrevious(){return this.getStartDate()>c(new Date)}formatDate(t){return h(t,"yyyy-MM-dd")}formatDayHeader(t){return{weekday:new Intl.DateTimeFormat(this.locale,{weekday:"short"}).format(t),day:new Intl.DateTimeFormat(this.locale,{day:"numeric"}).format(t),month:new Intl.DateTimeFormat(this.locale,{month:"short"}).format(t)}}isDateSelected(t){if(!this.selectedDate)return!1;const e=d(this.selectedDate);return p(t,e)}isTimeSlotSelected(t,e){return this.isDateSelected(t.date)&&this.selectedSlotKey===e.key}get hasSlots(){return this.slots.length>0}renderSkeletonSlots(){return a`${Array.from({length:this.visibleDays}).map((t,e)=>{const i=[2,3,4,3],r=i[e%i.length]??3;return a`<div class="time-slots-column">${Array.from({length:r}).map(()=>a`<mq-skeleton width="100%" height="40px" border-radius="md"></mq-skeleton>`)}</div>`})}`}renderEmptyState(){return a`<div class="empty-state">${m("No hay horarios disponibles")}</div>`}render(){const t=this.canGoPrevious,e=!this.isLoading&&!this.hasSlots;return a`<div class="${o({"time-slot-picker":!0,"is-loading":this.isLoading})}" style="--visible-days:${this.visibleDays}"><div class="picker-content"><div class="columns-wrapper">${t?a`<button class="nav-button nav-button-prev" @click="${this.handlePrevious}" ?disabled="${this.isLoading}" aria-label="${m("Fechas anteriores")}">${a`<svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_1510_1791)"><path d="M8.05454 11.9155L2.72136 6.29527C2.69487 6.26742 2.67385 6.23433 2.65951 6.19791C2.64517 6.16149 2.63779 6.12245 2.63779 6.08302C2.63779 6.04359 2.64517 6.00454 2.65951 5.96812C2.67385 5.9317 2.69487 5.89862 2.72136 5.87077L8.2124 0.0844726L8.61523 0.508968L3.32539 6.08302L8.45738 11.491L8.05454 11.9155Z" fill="currentColor"/></g><defs><clipPath id="clip0_1510_1791"><rect width="11.831" height="11.2273" fill="currentColor" transform="translate(11.2402 0.0844727) rotate(90)"/></clipPath></defs></svg>`}</button>`:null} ${a`<button class="nav-button nav-button-next" @click="${this.handleNext}" ?disabled="${this.isLoading}" aria-label="${m("Fechas siguientes")}">${a`<svg width="12" height="12" viewBox="0 0 12 12" fill="none" xmlns="http://www.w3.org/2000/svg"><g clip-path="url(#clip0_1510_474)"><path d="M3.94546 0.0845423L9.27864 5.70473C9.30513 5.73258 9.32615 5.76566 9.34049 5.80209C9.35483 5.83851 9.36221 5.87755 9.36221 5.91698C9.36221 5.95641 9.35483 5.99546 9.34049 6.03188C9.32615 6.0683 9.30513 6.10138 9.27864 6.12923L3.7876 11.9155L3.38477 11.491L8.67461 5.91698L3.54262 0.509039L3.94546 0.0845423Z" fill="currentColor"/></g><defs><clipPath id="clip0_1510_474"><rect width="11.831" height="11.2273" fill="currentColor" transform="translate(0.759766 11.9155) rotate(-90)"/></clipPath></defs></svg>`}</button>`}<div class="grid-container"><div class="dates-header">${this.visibleDaysList.map(t=>{const{weekday:e,day:i,month:r}=this.formatDayHeader(t.date);return a`<div class="date-card"><div class="date-weekday">${e}</div><div class="date-day">${i}</div><div class="date-month">${r}</div></div>`})}</div><div class="time-slots-container">${e?this.renderEmptyState():this.isLoading?this.renderSkeletonSlots():this.visibleDaysList.map(t=>{const e=this.isDateSelected(t.date);return a`<div class="${o({"time-slots-column":!0,active:e})}">${t.slots.map(e=>{const i=this.isTimeSlotSelected(t,e);return a`<button class="${o({"time-slot":!0,selected:i})}" @click="${()=>this.handleTimeSlotSelect(t,e)}">${e.label}</button>`})}</div>`})}</div></div></div></div></div>`}};t([s({type:String})],f.prototype,"locale",void 0),t([s({type:String})],f.prototype,"timezone",void 0),t([s({type:Array})],f.prototype,"slots",void 0),t([s({type:String,attribute:"selected-date"})],f.prototype,"selectedDate",void 0),t([s({type:String,attribute:"selected-slot-key"})],f.prototype,"selectedSlotKey",void 0),t([s({type:String,attribute:"window-start-date"})],f.prototype,"windowStartDate",void 0),t([s({type:Number,attribute:"visible-days"})],f.prototype,"visibleDays",void 0),t([s({type:Boolean,attribute:"is-loading"})],f.prototype,"isLoading",void 0),f=t([v(),e("mq-time-slot-picker")],f);export{f as M,SlotSelectEvent as S,WindowChangeEvent as W,u as a};
@@ -0,0 +1 @@
1
+ import{_ as t,t as e}from"./custom-element-DA9Fxvxd.js";import{m as a}from"./runtime-Bg1WXVCx.js";import{l as r}from"./localized-decorator-BlOuLhym.js";import{i as n,a as s,x as o}from"./lit-element-DiWJYFwC.js";import{n as i}from"./property-scuRaFcM.js";import{r as l}from"./state-LQivXIgA.js";import{e as d}from"./class-map-Co76I6aw.js";import{chevronLeftIcon as c}from"../ui/icons/chevron-left-icon.js";import{chevronRightIcon as v}from"../ui/icons/chevron-right-icon.js";import{spinnerIcon as h}from"../ui/icons/spinner-icon.js";import{t as u,c as p,n as g,g as m,p as y,a as b,s as f}from"./parseISO-Dj3qSTG8.js";import{i as D}from"./isSameDay-CuhZMy1T.js";import{i as k}from"./isBefore-CPpTogxo.js";function w(t,e,a){const r=u(t,a?.in);if(isNaN(e))return p(t,NaN);if(!e)return r;const n=r.getDate(),s=p(t,r.getTime());s.setMonth(r.getMonth()+e+1,0);return n>=s.getDate()?s:(r.setFullYear(s.getFullYear(),s.getMonth(),n),r)}function M(t,e){const a=u(t,e?.in),r=a.getMonth();return a.setFullYear(a.getFullYear(),r+1,0),a.setHours(23,59,59,999),a}function x(t,e){const{start:a,end:r}=function(t,e){const[a,r]=g(t,e.start,e.end);return{start:a,end:r}}(e?.in,t);let n=+a>+r;const s=n?+a:+r,o=n?r:a;o.setHours(0,0,0,0);const i=[];for(;+o<=s;)i.push(p(a,o)),o.setDate(o.getDate()+1),o.setHours(0,0,0,0);return n?i.reverse():i}function S(t,e){const a=u(t,e?.in);return a.setDate(1),a.setHours(0,0,0,0),a}function j(t,e){const a=m(),r=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??a.weekStartsOn??a.locale?.options?.weekStartsOn??0,n=u(t,e?.in),s=n.getDay(),o=6+(s<r?-7:0)-(s-r);return n.setDate(n.getDate()+o),n.setHours(23,59,59,999),n}function E(t,e){return+u(t)>+u(e)}function $(t,e){return D(p(t,t),function(t){return p(t,Date.now())}(t))}const N=n`:host{display:block;font-family:var(--font-body)}.calendar{background:var(--color-card);border-radius:var(--border-radius-lg);user-select:none}.calendar-header{display:flex;align-items:center;justify-content:space-between;background:var(--color-primary-background-extraWeak);padding:var(--sp-4);border-radius:var(--border-radius-lg) var(--border-radius-lg) 0 0}.calendar-header-title{font-family:var(--font-titles);font-size:var(--text-lg);font-weight:var(--font-weight-bold);color:var(--color-gray-darkest)}.calendar-body{position:relative;transition:opacity .2s}.calendar-body.loading{opacity:.4;pointer-events:none}.calendar-nav{display:flex;gap:var(--sp-2)}.calendar-nav-button{display:flex;align-items:center;justify-content:center;width:var(--size-8);height:var(--size-8);border:none;background:0 0;border-radius:var(--border-radius-md);cursor:pointer;transition:background-color .2s;color:var(--color-gray-darkest);padding:0}.calendar-nav-button:hover{background:var(--color-background-primary-light)}.calendar-nav-button:disabled{opacity:.3;cursor:not-allowed}.calendar-weekdays{display:grid;grid-template-columns:repeat(7,var(--sp-11));justify-content:space-between;padding:var(--sp-4) var(--sp-4) var(--sp-2) var(--sp-4)}.calendar-weekday{text-align:center;font-size:var(--text-sm);font-weight:var(--font-weight-bold);color:var(--color-gray-darkest);padding:var(--sp-2)}.calendar-days{display:grid;gap:var(--sp-1);grid-template-columns:repeat(7,var(--sp-11));justify-content:space-between;padding:0 var(--sp-4) var(--sp-4) var(--sp-4)}.calendar-day{width:var(--sp-11);height:var(--sp-11);display:flex;align-items:center;justify-content:center;border:none;background:0 0;border-radius:var(--border-radius-full);cursor:pointer;font-family:var(--font-body);font-size:var(--text-sm);font-weight:var(--font-weight-medium);color:var(--color-gray-darkest);transition:all .2s;padding:0;position:relative}.calendar-day:hover:not(:disabled):not(.other-month){background:var(--color-gray-lighter)}.calendar-day.other-month{color:var(--color-gray-medium);background:0 0}.calendar-day:disabled{color:var(--color-gray-medium);background:0 0;cursor:not-allowed}.calendar-day.available:not(.selected){background:var(--color-primary);color:var(--color-white);font-weight:var(--font-weight-semibold)}.calendar-day.available:hover:not(:disabled):not(.selected){background:var(--color-primary-dark)}.calendar-day.selected{background:var(--color-primary);color:var(--color-white);font-weight:var(--font-weight-bold)}.calendar-day.selected:hover:not(:disabled){background:var(--color-primary-dark)}.calendar-day-empty{width:var(--sp-11);height:var(--sp-11)}.calendar-spinner{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);display:flex;align-items:center;justify-content:center;pointer-events:none;z-index:10}@media (min-width:640px){.calendar-weekdays{gap:var(--sp-2)}.calendar-days{gap:var(--sp-2)}}@media (min-width:768px){.calendar-weekdays{gap:var(--sp-3)}.calendar-days{gap:var(--sp-3)}}@media (min-width:1024px){.calendar-weekdays{gap:var(--sp-4)}.calendar-days{gap:var(--sp-4)}}`;class DateSelectEvent extends Event{static{this.eventName="date-select"}constructor(t){super(DateSelectEvent.eventName,{bubbles:!0,composed:!0}),this.detail=t}}class PrevMonthEvent extends Event{static{this.eventName="prev-month"}constructor(t){super(PrevMonthEvent.eventName,{bubbles:!0,composed:!0}),this.detail=t}}class NextMonthEvent extends Event{static{this.eventName="next-month"}constructor(t){super(NextMonthEvent.eventName,{bubbles:!0,composed:!0}),this.detail=t}}let C=class MqCalendar extends s{constructor(){super(...arguments),this.locale="es-ES",this.isLoading=!1,this.handlePrevMonth=()=>{const t=this.getCurrentMonthDate(),e=w(t,-1,a);var a;this.dispatchEvent(new PrevMonthEvent({currentMonth:e.toISOString()}))},this.handleNextMonth=()=>{const t=w(this.getCurrentMonthDate(),1);this.dispatchEvent(new NextMonthEvent({currentMonth:t.toISOString()}))},this.handleDayClick=t=>{t.isDisabled||(this.selectedDate=t.date,this.value=t.date.toISOString(),this.dispatchEvent(new DateSelectEvent({date:t.date.toISOString()})),this.requestUpdate())}}static{this.styles=[N]}connectedCallback(){super.connectedCallback(),this.value&&(this.selectedDate=y(this.value))}getMonthYear(){const t=this.getCurrentMonthDate();return new Intl.DateTimeFormat(this.locale,{month:"long",year:"numeric"}).format(t)}getCurrentMonthDate(){return this.currentMonth?y(this.currentMonth):new Date}getWeekdays(){const t=b(new Date(2024,0,1),{weekStartsOn:1}),e=x({start:t,end:j(t,{weekStartsOn:1})}),a=new Intl.DateTimeFormat(this.locale,{weekday:"narrow"});return e.map(t=>a.format(t).toUpperCase())}getDaysInMonth(){const t=this.getCurrentMonthDate(),e=S(t),a=M(t);return x({start:b(e,{weekStartsOn:1}),end:j(a,{weekStartsOn:1})}).map(e=>{const a=function(t,e,a){const[r,n]=g(a?.in,t,e);return r.getFullYear()===n.getFullYear()&&r.getMonth()===n.getMonth()}(e,t);return this.createCalendarDay(e,a)})}createCalendarDay(t,e){const a=f(t),r=$(a),n=this.isDateAvailable(a);return{date:a,isCurrentMonth:e,isToday:r,isDisabled:this.isDateDisabled(a,n),isSelected:!!this.selectedDate&&D(a,this.selectedDate),isAvailable:n}}isDateAvailable(t){if(!this.availableDays||0===this.availableDays.length)return!1;const e=f(t);return this.availableDays.some(t=>{const a=f(y(t));return D(e,a)})}isDateDisabled(t,e){const a=f(t);if(this.availableDays&&this.availableDays.length>0)return!e;if(this.minDate){const t=f(y(this.minDate));if(k(a,t))return!0}if(this.maxDate){if(E(a,f(y(this.maxDate))))return!0}return!1}render(){const t=this.getDaysInMonth(),e=this.getWeekdays();return o`<div class="calendar"><div class="calendar-header"><button class="calendar-nav-button" @click="${this.handlePrevMonth}" aria-label="${a("Mes anterior")}">${c({size:24})}</button><div class="calendar-header-title">${this.getMonthYear()}</div><button class="calendar-nav-button" @click="${this.handleNextMonth}" aria-label="${a("Mes siguiente")}">${v({size:24})}</button></div><div class="calendar-body ${this.isLoading?"loading":""}"><div class="calendar-weekdays">${e.map(t=>o`<div class="calendar-weekday">${t}</div>`)}</div><div class="calendar-days">${t.map(t=>t.isCurrentMonth?o`<button class="${d({"calendar-day":!0,"other-month":!t.isCurrentMonth,today:t.isToday,selected:t.isSelected,available:t.isAvailable})}" ?disabled="${t.isDisabled||this.isLoading}" @click="${()=>this.handleDayClick(t)}" aria-label="${t.date.toLocaleDateString(this.locale)}">${t.date.getDate()}</button>`:o`<div class="calendar-day-empty"></div>`)}</div>${this.isLoading?o`<div class="calendar-spinner">${h({size:40,color:"var(--color-primary)"})}</div>`:""}</div></div>`}};t([i({type:String})],C.prototype,"locale",void 0),t([i({type:String,attribute:"min-date"})],C.prototype,"minDate",void 0),t([i({type:String,attribute:"max-date"})],C.prototype,"maxDate",void 0),t([i({type:String})],C.prototype,"value",void 0),t([i({type:Boolean,attribute:"is-loading"})],C.prototype,"isLoading",void 0),t([i({type:String,attribute:"current-month"})],C.prototype,"currentMonth",void 0),t([i({type:Array,attribute:"available-days"})],C.prototype,"availableDays",void 0),t([l()],C.prototype,"selectedDate",void 0),C=t([r(),e("mq-calendar")],C);export{DateSelectEvent as D,C as M,NextMonthEvent as N,PrevMonthEvent as P,M as e,E as i,S as s};
@@ -0,0 +1 @@
1
+ import{_ as t,t as e}from"./custom-element-DA9Fxvxd.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-vbjgaIRV.js";import{DownloadFileEvent as m}from"../events.js";import{getLocale as f}from"../i18n.js";const h=o`:host{display:flex;justify-content:space-between;align-items:center;gap:var(--sp-4);width:100%}.left{display:flex;flex-direction:column;gap:var(--sp-1);flex:1;min-width:0}.tag{border-radius:var(--border-radius-sm);display:inline-flex;align-items:center;justify-content:center;padding:var(--sp-0_5) var(--sp-2);background-color:#e5e5e5;width:fit-content}.tag-label{font-family:var(--font-body);font-size:11px;font-weight:var(--font-weight-medium);color:var(--color-neutrals-text-default);text-transform:uppercase;letter-spacing:3px;line-height:normal}.title{font-family:var(--font-body);font-size:var(--text-sm);font-weight:var(--font-weight-bold);color:var(--color-neutrals-text-default);line-height:normal;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.description{font-family:var(--font-body);font-size:var(--text-sm);font-weight:var(--font-weight-normal);color:var(--color-neutrals-text-default);line-height:normal;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}`;let u=class PatientDocument extends i{constructor(){super(...arguments),this.isDownloading=!1}static{this.styles=h}getFormatter(){const t=f().replace("_","-");return new Intl.DateTimeFormat(t,{year:"numeric",month:"numeric",day:"numeric"})}async _handleDownload(){this.isDownloading=!0;const t=await p.flash.downloadDocument({url:this.downloadUrl}),e=await async function(t){return new Promise((e,o)=>{const i=new FileReader;i.onloadend=()=>e(i.result),i.onerror=o,i.readAsDataURL(t)})}(t);this.dispatchEvent(new m({url:e,filename:`${this.filename}.pdf`})),this.isDownloading=!1}formatKind(t){switch(t){case c.prescription:return l("Receta");case c.report:return l("Informe");case c.diagnosticTestPrescription:return l("Prescripción")}}render(){const t=this.getFormatter().format(new Date(this.date));return r`<div class="left"><div class="tag"><span class="tag-label">${this.formatKind(this.kind)}</span></div><div class="title">${t} - ${this.specialty}</div><div class="description">${this.description}</div></div><mq-button variant="ghost" size="icon-lg" @click="${this._handleDownload}" ?disabled="${this.isDownloading}">${s({size:24})}</mq-button>`}};t([n({type:String})],u.prototype,"kind",void 0),t([n({type:String})],u.prototype,"filename",void 0),t([n({type:String})],u.prototype,"specialty",void 0),t([n({type:String})],u.prototype,"description",void 0),t([n({type:String})],u.prototype,"date",void 0),t([n({type:String})],u.prototype,"downloadUrl",void 0),t([a()],u.prototype,"isDownloading",void 0),u=t([d(),e("patient-document")],u);
@@ -0,0 +1,31 @@
1
+ import * as lit_html from 'lit-html';
2
+ import * as lit from 'lit';
3
+ import { LitElement } from 'lit';
4
+ import '../ui/mq-button.js';
5
+ import z from 'zod';
6
+
7
+ declare const DocumentTypeSchema: z.ZodEnum<["prescription", "report", "diagnosticTestPrescription"]>;
8
+ type DocumentType = z.infer<typeof DocumentTypeSchema>;
9
+
10
+ /**
11
+ * @fires download-file - Fired when the user requests a download (bubbles, composed; `url` and `filename` on the event)
12
+ */
13
+ declare class PatientDocument extends LitElement {
14
+ static styles: lit.CSSResult;
15
+ kind: DocumentType;
16
+ filename: string;
17
+ specialty: string;
18
+ description: string;
19
+ date: string;
20
+ downloadUrl: string;
21
+ isDownloading: boolean;
22
+ private getFormatter;
23
+ private _handleDownload;
24
+ private formatKind;
25
+ render(): lit_html.TemplateResult<1>;
26
+ }
27
+ declare global {
28
+ interface HTMLElementTagNameMap {
29
+ "patient-document": PatientDocument;
30
+ }
31
+ }
@@ -0,0 +1,47 @@
1
+ import * as lit_html from 'lit-html';
2
+ import * as lit from 'lit';
3
+ import { LitElement, PropertyValues } from 'lit';
4
+ import '../ui/mq-checkbox.js';
5
+ import '../ui/mq-button.js';
6
+ import { Env } from '../env.js';
7
+
8
+ type TermsAndConditionsAcceptEvent = CustomEvent<{
9
+ accepted: boolean;
10
+ }>;
11
+ type TermsAndConditionsContinueEvent = CustomEvent<void>;
12
+ /**
13
+ * @fires continue - Fired when the continue button is clicked
14
+ *
15
+ * @slot - Default slot for checkbox label content (can include links)
16
+ * @slot page-title - Slot for the main page title (can include any HTML)
17
+ * @slot page-subtitle - Slot for the main page subtitle (can include any HTML)
18
+ * @slot terms-title - Slot for the terms section title (can include any HTML)
19
+ * @slot terms-description - Slot for the terms section description (can include any HTML)
20
+ * @slot checkbox-label - Slot for the checkbox label (can include any HTML)
21
+ * @slot button-text - Slot for the button text (can include any HTML)
22
+ */
23
+ declare class MqTermsAndConditions extends LitElement {
24
+ static styles: lit.CSSResult;
25
+ disabled: boolean;
26
+ hasCommercialCommunications: boolean;
27
+ /** Mediquo API key. Required when used standalone (outside mq-router). */
28
+ apiKey?: string;
29
+ /** Already-exchanged access token. Required when used standalone. */
30
+ token?: string;
31
+ /** Environment override ("development" | "production"). Optional. */
32
+ env?: Env;
33
+ private _accepted;
34
+ protected willUpdate(changed: PropertyValues<this>): void;
35
+ private handleCheckboxChange;
36
+ private acceptLegalConsentMutation;
37
+ private handleContinue;
38
+ render(): lit_html.TemplateResult<1>;
39
+ }
40
+ declare global {
41
+ interface HTMLElementTagNameMap {
42
+ "mq-terms-and-conditions": MqTermsAndConditions;
43
+ }
44
+ }
45
+
46
+ export { MqTermsAndConditions as M };
47
+ export type { TermsAndConditionsContinueEvent as T, TermsAndConditionsAcceptEvent as a };
@@ -0,0 +1 @@
1
+ import{_ as t,t as e}from"./custom-element-DA9Fxvxd.js";import{i,a as o,x as n}from"./lit-element-DiWJYFwC.js";import{n as a}from"./property-scuRaFcM.js";import{r as s}from"./state-LQivXIgA.js";import"../ui/mq-checkbox.js";import"../ui/mq-button.js";import{M as r}from"./mutation-controller-CR2qcqhH.js";import{setEnv as l}from"../env.js";import{a as h}from"./api-chat-client-vbjgaIRV.js";const c=i`.page-header{box-sizing:border-box;width:100%;display:none}.page-title{font-family:var(--font-body);font-size:var(--text-2xl);line-height:var(--text-2xl--line-height);font-weight:var(--font-weight-bold);color:var(--color-neutrals-text-default)}.page-title ::slotted(*){margin:0;margin-bottom:var(--sp-2);font-family:inherit;font-size:inherit;line-height:inherit;font-weight:inherit;color:inherit}.page-subtitle{font-family:var(--font-body);font-size:var(--text-base);line-height:var(--text-base--line-height);font-weight:var(--font-weight-normal);color:var(--color-neutrals-text-subtle)}.page-subtitle ::slotted(*){margin:0;font-family:inherit;font-size:inherit;line-height:inherit;font-weight:inherit;color:inherit}.terms-section{box-sizing:border-box;width:100%;display:flex;flex-direction:column;gap:var(--sp-6);background-color:var(--color-neutrals-background-weak);padding:var(--sp-6);border-radius:var(--border-radius-md)}.terms-title{font-family:var(--font-titles);font-size:var(--text-2xl);line-height:var(--text-2xl--line-height);font-weight:var(--font-weight-bold);color:var(--color-neutrals-text-default)}.terms-title ::slotted(*){margin:0;margin-bottom:var(--sp-2);font-family:inherit;font-size:inherit;line-height:inherit;font-weight:inherit;color:inherit}.terms-description{font-family:var(--font-body);font-size:var(--text-sm);line-height:var(--text-sm--line-height);font-weight:var(--font-weight-normal);color:var(--color-neutrals-text-default)}.terms-description ::slotted(*){margin:0;font-family:inherit;font-size:inherit;line-height:inherit;font-weight:inherit;color:inherit}.checkbox-container{display:flex;gap:var(--sp-3);align-items:flex-start;cursor:pointer}.checkbox-label{font-family:var(--font-body);font-size:var(--text-base);line-height:var(--text-base--line-height);font-weight:var(--font-weight-normal);color:var(--color-neutrals-text-default);flex:1}@media (min-width:768px){.page-header{display:block;margin-bottom:var(--sp-10)}.page-title{font-size:var(--text-3xl);line-height:var(--text-3xl--line-height)}.page-title ::slotted(*){font-size:inherit;line-height:inherit}.page-subtitle{font-size:var(--text-base);line-height:var(--text-base--line-height)}.page-subtitle ::slotted(*){font-size:inherit;line-height:inherit}.terms-title{font-size:var(--text-2xl);line-height:var(--text-2xl--line-height)}.terms-title ::slotted(*){font-size:inherit;line-height:inherit}.terms-description{font-size:var(--text-base);line-height:var(--text-base--line-height)}.terms-description ::slotted(*){font-size:inherit;line-height:inherit}.checkbox-label{font-size:var(--text-base);line-height:var(--text-base--line-height)}}`;let d=class MqTermsAndConditions extends o{constructor(){super(...arguments),this.disabled=!1,this.hasCommercialCommunications=!1,this._accepted=!1,this.acceptLegalConsentMutation=new r(this,{mutationFn:async t=>h.profile.acceptLegalConsent(t),onSuccess:()=>{this.dispatchEvent(new CustomEvent("continue"))}})}static{this.styles=c}willUpdate(t){t.has("env")&&this.env&&l(this.env),t.has("apiKey")&&this.apiKey&&h.setApiKey(this.apiKey),t.has("token")&&this.token&&h.setAuthToken(this.token)}handleCheckboxChange(t){this._accepted=t.detail.checked}handleContinue(){this._accepted&&!this.disabled&&this.acceptLegalConsentMutation.run({terms_accepted:!0,privacy_accepted:!0,commercial_accepted:this.hasCommercialCommunications})}render(){const t=!this._accepted||this.disabled;return n`<div class="page-header"><div class="page-title"><slot name="page-title"></slot></div><div class="page-subtitle"><slot name="page-subtitle"></slot></div></div><div class="terms-section"><div><div class="terms-title"><slot name="terms-title"></slot></div><div class="terms-description"><slot name="terms-description"></slot></div></div><div class="checkbox-container"><mq-checkbox id="terms-checkbox" @change="${this.handleCheckboxChange}" ?disabled="${this.disabled}"></mq-checkbox><label class="checkbox-label" for="terms-checkbox"><slot name="checkbox-label"></slot></label></div><mq-button variant="primary" size="md" fullwidth ?disabled="${this.acceptLegalConsentMutation.isPending||t}" @click="${this.handleContinue}"><slot name="button-text"></slot></mq-button></div>`}};t([a({type:Boolean})],d.prototype,"disabled",void 0),t([a({type:Boolean})],d.prototype,"hasCommercialCommunications",void 0),t([a({type:String,attribute:"api-key"})],d.prototype,"apiKey",void 0),t([a({type:String,attribute:"token"})],d.prototype,"token",void 0),t([a({type:String,attribute:"env"})],d.prototype,"env",void 0),t([s()],d.prototype,"_accepted",void 0),d=t([e("mq-terms-and-conditions")],d);export{d as M};
@@ -0,0 +1 @@
1
+ import{t as r}from"./parseISO-Dj3qSTG8.js";function t(t,o){return+r(t)<+r(o)}export{t as i};
@@ -1 +1 @@
1
- import{n as s,s as n}from"./parseISO-jT42c8Ob.js";function r(r,o,t){const[a,i]=s(t?.in,r,o);return+n(a)===+n(i)}export{r as i};
1
+ import{n as s,s as n}from"./parseISO-Dj3qSTG8.js";function r(r,o,t){const[a,i]=s(t?.in,r,o);return+n(a)===+n(i)}export{r as i};
@@ -0,0 +1 @@
1
+ import{L as t}from"./runtime-Bg1WXVCx.js";class LocalizeController{constructor(t){this.__litLocalizeEventHandler=t=>{"ready"===t.detail.status&&this.host.requestUpdate()},this.host=t}hostConnected(){window.addEventListener(t,this.__litLocalizeEventHandler)}hostDisconnected(){window.removeEventListener(t,this.__litLocalizeEventHandler)}}const e=t=>t.addController(new LocalizeController(t)),o=()=>(t,o)=>(t.addInitializer(e),t);export{o as l};