@mediquo/elements 0.3.2 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (138) hide show
  1. package/README.md +84 -1
  2. package/dist/chunks/api-chat-client-CqMn2JEn.js +1 -0
  3. package/dist/chunks/{apple-pay-outcomes-BlytM6W-.js → apple-pay-outcomes-CjCnBYOD.js} +1 -1
  4. package/dist/chunks/chunk-4FFT6DC2-CVWibomC.js +1 -0
  5. package/dist/chunks/chunk-GZF3YFSX-DM-GTqxg.js +1 -0
  6. package/dist/chunks/chunk-RCFIJTXZ-C6Ir0-sM.js +1 -0
  7. package/dist/chunks/chunk-S5RWG6G2-DPesx3Od.js +1 -0
  8. package/dist/chunks/chunk-YMQSBQHL-De_r7BNk.js +1 -0
  9. package/dist/chunks/chunk-YTQUGGS3-DmCGIoFy.js +1 -0
  10. package/dist/chunks/consume-CovVqBjI.js +1 -0
  11. package/dist/chunks/context-consumer-ESdICVAb.js +1 -0
  12. package/dist/chunks/context-provider--AKuwfs9.js +1 -0
  13. package/dist/chunks/create-component-BB-6Gu6l.js +1 -0
  14. package/dist/chunks/create-context-DqP79qjF.js +1 -0
  15. package/dist/chunks/documentation-view-fFbvjJqx.js +1 -0
  16. package/dist/chunks/external-CJj32K_p.js +1 -0
  17. package/dist/chunks/{format-Cm3B1GMy.js → format-CRFiCNHw.js} +1 -1
  18. package/dist/chunks/get-appointment-query-Ck68BEMg.js +1 -0
  19. package/dist/chunks/get-patient-profile-query-B0tUDJmT.js +1 -0
  20. package/dist/chunks/i18n-formats-DYS91YEa.js +1 -0
  21. package/dist/chunks/{index-B9iWdvW3.js → index-BJcdB5MT.js} +1 -1
  22. package/dist/chunks/index-CGnPsMVQ.js +1 -0
  23. package/dist/chunks/index-CLdWVaEs.js +1 -0
  24. package/dist/chunks/index-CvDnN2NR.js +1 -0
  25. package/dist/chunks/index-DNUbmrQl.d.ts +31 -0
  26. package/dist/chunks/index-Xcn-xs13.js +1 -0
  27. package/dist/chunks/index-czcKClL3.d.ts +47 -0
  28. package/dist/chunks/isBefore-CPpTogxo.js +1 -0
  29. package/dist/chunks/{isSameDay-DPfclwIL.js → isSameDay-CuhZMy1T.js} +1 -1
  30. package/dist/chunks/localized-decorator-BlOuLhym.js +1 -0
  31. package/dist/chunks/mq-layout-CGcdxGMQ.js +1 -0
  32. package/dist/chunks/mq-professional-presence-sync-cmg6CXhz.d.ts +22 -0
  33. package/dist/chunks/mq-unread-count-sync-DTn9dfR4.d.ts +22 -0
  34. package/dist/chunks/mutation-controller-CR2qcqhH.js +1 -0
  35. package/dist/chunks/parseISO-Dj3qSTG8.js +1 -0
  36. package/dist/chunks/price-BmA2Dl9f.js +1 -0
  37. package/dist/chunks/professional-overview-CfjgnTw4.js +1 -0
  38. package/dist/chunks/{provide-CfT7g_Zi.js → provide-D2fnEhT2.js} +1 -1
  39. package/dist/chunks/query-Cjvi4_dT.js +1 -0
  40. package/dist/chunks/query-controller-BlO1Ax65.js +1 -0
  41. package/dist/chunks/{refund-cancel-policy-Bm5djPds.js → refund-cancel-policy-D_tUYPyv.js} +1 -1
  42. package/dist/chunks/schemas.d-5LR6aN9I.d.ts +134 -0
  43. package/dist/chunks/telemetry-client-Ca71sobH.js +1 -0
  44. package/dist/env.js +1 -1
  45. package/dist/i18n.js +1 -1
  46. package/dist/mq-apple-pay-checkout.js +1 -1
  47. package/dist/mq-appointment-checkout.js +1 -1
  48. package/dist/mq-appointment-documentation.d.ts +48 -0
  49. package/dist/mq-appointment-documentation.js +1 -0
  50. package/dist/mq-chat-room.js +1 -1
  51. package/dist/mq-checkout.js +1 -1
  52. package/dist/mq-documents.d.ts +46 -0
  53. package/dist/mq-documents.js +1 -0
  54. package/dist/mq-google-pay-checkout.js +1 -1
  55. package/dist/mq-immediate-videocall-checkout.js +1 -1
  56. package/dist/mq-my-appointments.d.ts +48 -178
  57. package/dist/mq-my-appointments.js +1 -1
  58. package/dist/mq-professional-presence-sync.d.ts +30 -0
  59. package/dist/mq-professional-presence-sync.js +1 -0
  60. package/dist/mq-query-client-provider.js +1 -1
  61. package/dist/mq-schedule-success.d.ts +9 -0
  62. package/dist/mq-schedule-success.js +2 -2
  63. package/dist/mq-schedule.d.ts +24 -12
  64. package/dist/mq-schedule.js +1 -1
  65. package/dist/mq-session-provider.d.ts +28 -0
  66. package/dist/mq-session-provider.js +1 -0
  67. package/dist/mq-socket-provider.js +1 -1
  68. package/dist/mq-support-chat.js +1 -1
  69. package/dist/mq-terms-and-conditions.d.ts +23 -0
  70. package/dist/mq-terms-and-conditions.js +1 -0
  71. package/dist/mq-unread-count-sync.d.ts +21 -0
  72. package/dist/mq-unread-count-sync.js +1 -0
  73. package/dist/mq-videocall.d.ts +35 -26
  74. package/dist/mq-videocall.js +1 -1
  75. package/dist/react/mq-apple-pay-checkout.d.ts +15 -0
  76. package/dist/react/mq-apple-pay-checkout.js +2 -0
  77. package/dist/react/mq-appointment-checkout.d.ts +17 -0
  78. package/dist/react/mq-appointment-checkout.js +2 -0
  79. package/dist/react/mq-appointment-documentation.d.ts +28 -0
  80. package/dist/react/mq-appointment-documentation.js +2 -0
  81. package/dist/react/mq-chat-room.d.ts +21 -0
  82. package/dist/react/mq-chat-room.js +2 -0
  83. package/dist/react/mq-checkout.d.ts +18 -0
  84. package/dist/react/mq-checkout.js +2 -0
  85. package/dist/react/mq-documents.d.ts +13 -0
  86. package/dist/react/mq-documents.js +2 -0
  87. package/dist/react/mq-google-pay-checkout.d.ts +15 -0
  88. package/dist/react/mq-google-pay-checkout.js +2 -0
  89. package/dist/react/mq-immediate-videocall-checkout.d.ts +16 -0
  90. package/dist/react/mq-immediate-videocall-checkout.js +2 -0
  91. package/dist/react/mq-my-appointments.d.ts +30 -0
  92. package/dist/react/mq-my-appointments.js +2 -0
  93. package/dist/react/mq-professional-presence-sync.d.ts +7 -0
  94. package/dist/react/mq-professional-presence-sync.js +2 -0
  95. package/dist/react/mq-query-client-provider.d.ts +8 -0
  96. package/dist/react/mq-query-client-provider.js +2 -0
  97. package/dist/react/mq-schedule-success.d.ts +29 -0
  98. package/dist/react/mq-schedule-success.js +2 -0
  99. package/dist/react/mq-schedule.d.ts +33 -0
  100. package/dist/react/mq-schedule.js +2 -0
  101. package/dist/react/mq-session-provider.d.ts +10 -0
  102. package/dist/react/mq-session-provider.js +2 -0
  103. package/dist/react/mq-socket-provider.d.ts +9 -0
  104. package/dist/react/mq-socket-provider.js +2 -0
  105. package/dist/react/mq-support-chat.d.ts +15 -0
  106. package/dist/react/mq-support-chat.js +2 -0
  107. package/dist/react/mq-terms-and-conditions.d.ts +14 -0
  108. package/dist/react/mq-terms-and-conditions.js +2 -0
  109. package/dist/react/mq-theme-provider.d.ts +8 -0
  110. package/dist/react/mq-theme-provider.js +2 -0
  111. package/dist/react/mq-toast-container.d.ts +8 -0
  112. package/dist/react/mq-toast-container.js +2 -0
  113. package/dist/react/mq-unread-count-sync.d.ts +7 -0
  114. package/dist/react/mq-unread-count-sync.js +2 -0
  115. package/dist/react/mq-videocall.d.ts +37 -0
  116. package/dist/react/mq-videocall.js +2 -0
  117. package/dist/toast.d.ts +3 -0
  118. package/dist/toast.js +1 -0
  119. package/dist/ui/mq-calendar.js +1 -1
  120. package/dist/ui/mq-clamped-text.js +1 -1
  121. package/dist/ui/mq-time-slot-picker.js +1 -1
  122. package/package.json +53 -4
  123. package/dist/chunks/api-chat-client-BTBtu01T.js +0 -1
  124. package/dist/chunks/chunk-S5RWG6G2-oTcdgk2H.js +0 -1
  125. package/dist/chunks/chunk-YTQUGGS3-DN-JZpgG.js +0 -1
  126. package/dist/chunks/context-provider-CiMFpvDA.js +0 -1
  127. package/dist/chunks/exports-XZaVrMLd.js +0 -1
  128. package/dist/chunks/external-zAbuzxDj.js +0 -1
  129. package/dist/chunks/get-patient-profile-query-C8T8DJ7z.js +0 -1
  130. package/dist/chunks/index-BYHKNPG2.js +0 -1
  131. package/dist/chunks/index-Bxh8Qfwr.js +0 -1
  132. package/dist/chunks/isBefore-Cof0D841.js +0 -1
  133. package/dist/chunks/mq-layout-DpzeL9_i.js +0 -1
  134. package/dist/chunks/mutation-controller-OVT8NEt6.js +0 -1
  135. package/dist/chunks/parseISO-jT42c8Ob.js +0 -1
  136. package/dist/chunks/price-Dtdjx70D.js +0 -1
  137. package/dist/chunks/query-QJ1INUTG.js +0 -1
  138. package/dist/chunks/telemetry-client-CKCb9Gnf.js +0 -1
package/README.md CHANGED
@@ -77,15 +77,68 @@ Mount these as ancestors of the features that need them:
77
77
  | `mq-theme-provider` | `@mediquo/elements/mq-theme-provider` | Always — design tokens |
78
78
  | `mq-query-client-provider` | `@mediquo/elements/mq-query-client-provider` | Data-fetching features (`mq-schedule`, `mq-chat-room`, …) |
79
79
  | `mq-socket-provider` | `@mediquo/elements/mq-socket-provider` | Realtime features (`mq-chat-room`) |
80
+ | `mq-session-provider` | `@mediquo/elements/mq-session-provider` | Features that read the patient session — `mq-my-appointments`, `mq-videocall`, `mq-appointment-documentation`, background sync |
81
+
82
+ Set `mq-session-provider`'s `session` as a **property** (it's the login-token
83
+ response object from your auth exchange, not a string attribute):
80
84
 
81
85
  ```html
82
86
  <mq-theme-provider theme="mediquo">
83
87
  <mq-query-client-provider>
84
88
  <mq-socket-provider>
85
- <!-- feature elements -->
89
+ <mq-session-provider id="session">
90
+ <!-- feature elements -->
91
+ </mq-session-provider>
86
92
  </mq-socket-provider>
87
93
  </mq-query-client-provider>
88
94
  </mq-theme-provider>
95
+
96
+ <script type="module">
97
+ document.querySelector("#session").session = loginTokenResponse;
98
+ </script>
99
+ ```
100
+
101
+ In React, pass it as a prop: `<MqSessionProvider session={loginTokenResponse}>`.
102
+
103
+ ## Background sync
104
+
105
+ Two headless elements keep the shared query cache in sync with realtime socket
106
+ events, so unread badges and presence indicators update without refetching.
107
+ Mount each once, anywhere under the query-client + socket providers; they render
108
+ nothing:
109
+
110
+ | Element | Import | Keeps in sync |
111
+ | --- | --- | --- |
112
+ | `mq-unread-count-sync` | `@mediquo/elements/mq-unread-count-sync` | Per-room unread counts (incoming messages) |
113
+ | `mq-professional-presence-sync` | `@mediquo/elements/mq-professional-presence-sync` | Professional `active_absence` (presence) |
114
+
115
+ ```html
116
+ <mq-query-client-provider>
117
+ <mq-socket-provider>
118
+ <mq-unread-count-sync></mq-unread-count-sync>
119
+ <mq-professional-presence-sync></mq-professional-presence-sync>
120
+ <!-- feature elements whose cached data these keep fresh -->
121
+ </mq-socket-provider>
122
+ </mq-query-client-provider>
123
+ ```
124
+
125
+ For a Lit host that prefers wiring the logic into its own element, the
126
+ `UnreadCountSyncController` / `ProfessionalPresenceSyncController` reactive
127
+ controllers are exported from the same subpaths.
128
+
129
+ ## Toasts
130
+
131
+ Mount one `<mq-toast-container>` and drive it imperatively with
132
+ `registerToastContainer`:
133
+
134
+ ```ts
135
+ import { registerToastContainer, toast } from "@mediquo/elements/toast";
136
+
137
+ // Point the toast API at a container that inherits your theme/token context:
138
+ registerToastContainer(document.querySelector("mq-toast-container"));
139
+
140
+ toast.success("Saved");
141
+ toast.error("Something went wrong");
89
142
  ```
90
143
 
91
144
  ## Theming
@@ -109,6 +162,36 @@ const theme = createTheme({
109
162
  });
110
163
  ```
111
164
 
165
+ ### Brand themes (e.g. Adeslas) via `custom-tokens`
166
+
167
+ `@mediquo/elements` intentionally ships **only** the design-system-owned themes
168
+ (`default`, `mediquo`). Partner brands such as Adeslas are **not** built into the
169
+ package — the host owns the brand and supplies it through `custom-tokens`.
170
+
171
+ `custom-tokens` is raw CSS injected into the provider's shadow root **after** the
172
+ selected theme, so it can override any token the design system exposes. There is
173
+ no token a built-in theme can set that `custom-tokens` cannot — the surface is
174
+ complete by construction. Pass the brand's token set as a `:host { … }`-free list
175
+ of custom properties:
176
+
177
+ ```html
178
+ <mq-theme-provider
179
+ theme="default"
180
+ custom-tokens="
181
+ --color-primary: #6f2c91;
182
+ --color-primary-hover: #5a2475;
183
+ --font-titles: 'Adeslas', sans-serif;
184
+ /* …the rest of the brand's token overrides… */
185
+ "
186
+ >
187
+ <!-- … -->
188
+ </mq-theme-provider>
189
+ ```
190
+
191
+ Keep the brand's token values in the host application (or a shared host package),
192
+ not in `@mediquo/elements`. This keeps the published package brand-neutral while
193
+ letting integrators render any look on top of it.
194
+
112
195
  ## Events
113
196
 
114
197
  Components describe **what the user did**, never **where to navigate**. Listen for the actions you care about and own routing in the host.
@@ -0,0 +1 @@
1
+ import{o as e,n as t,a as n,z as r,s as i,e as s,b as o,r as a,u as l,c,d as u,f as d,l as p,g as h,i as f}from"./external-CJj32K_p.js";import{p as m}from"./parseISO-Dj3qSTG8.js";import{f as g}from"./format-CRFiCNHw.js";import{i as b}from"./isBefore-CPpTogxo.js";import{env as y}from"../env.js";function _(r){return e({data:n(r),meta:e({current_page:t(),last_page:t(),per_page:t(),total:t()})})}var v=r.enum(["prescription","report","diagnosticTestPrescription"]),w=v.enum,E=r.enum(["published","draft"]);E.enum;var C=r.object({document_id:r.string().uuid(),document_type:v,name:r.string(),professional:r.object({speciality_id:r.number()}),status:E,url:r.string().url(),created_at:r.string()}),R=e({hash:i(),profile:e({first_name:i().nullable(),last_name:i().nullable(),birth_date:i().nullable(),gender:s(["male","female"]).nullable(),email:i().nullable(),phone_prefix:i().nullable(),phone:i().nullable(),billing:e({tax_id:i().nullable(),address:i().nullable(),country_code:i().nullable(),region:i().nullable(),postal_code:i().nullable()})})});function O(e){const t=e?.profile;return`${t?.first_name??""} ${t?.last_name??""}`.trim()}function S(e){return[e?.profile.first_name,e?.profile.last_name,e?.profile.email,e?.profile.phone,e?.profile.birth_date,e?.profile?.billing?.tax_id].every(e=>null!==e)}function A(e){return m(`${e.replace(" ","T")}Z`)}function T(e){const t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds()));return g(t,"yyyy-MM-dd HH:mm:ss")}function j(e,t){try{const n=new Intl.DateTimeFormat("en",{timeZone:e,timeZoneName:"shortOffset"}).formatToParts(t);return n.find(e=>"timeZoneName"===e.type)?.value??""}catch{return""}}var x=r.enum(["pending","expired","accepted","inCall","declined","cancelled","finished","free_of_charge","owed","unpaid","reporting"]),P=x.enum,k=r.enum(["videocall","chat","phonecall"]),N=k.enum,U=r.object({id:r.string().uuid(),room_id:r.string(),channel:k,consultation_short_url:r.string().url().nullable(),call_id:r.string().url(),duration:r.number(),from:r.object({hash:r.string(),name:r.string().nullable(),avatar:r.string().url().nullable(),speciality:r.string().nullable(),collegiate_number:r.string().nullable(),is_dismissed:r.boolean(),languages:r.array(r.string()),description:r.string().nullable()}),to:r.object({id:r.number(),hash:r.string(),name:r.string().nullable(),avatar:r.string().url().nullable(),is_dismissed:r.boolean()}),speciality_id:r.number().nullable(),created_at:r.string(),status:x,seconds_to_open:r.number().nonnegative(),start_date:r.string(),started_at:r.string().nullable(),expires_at:r.string().nullable(),consultation_reason:r.string().nullable(),preconsultation_documents:r.array(r.object({file_path:r.string(),file_name:r.string(),id:r.string().uuid()})).nullable(),service_id:r.string().uuid().nullable(),price:r.number().nullable().optional(),currency:r.string().nullable().optional(),discount_amount:r.number().nullable().optional()}),D=r.enum(["appointment","chat","immediate"]),L=D.enum;function F(e){return 0===e.seconds_to_open}function B(e){if(!e)return!1;const t=new Date,n=A(e);return b(n,t)}r.object({appointmentId:r.string()});var I=U;r.object({callId:r.string()});var $=r.object({session_id:r.string(),session_token:r.string()});r.object({professional_hash:r.string(),consultation_id:r.string(),consultation_type:r.enum(["appointment"])}),r.object({professional_hash:r.string(),consultation_id:r.string(),consultation_type:r.enum(["appointment"])}),r.object({appointment_id:r.string()});var M=r.array(C);r.object({url:r.string().url()}),r.object({first_name:R.shape.profile.shape.first_name,last_name:R.shape.profile.shape.last_name,tax_id:R.shape.profile.shape.billing.shape.tax_id,birth_date:R.shape.profile.shape.birth_date,gender:R.shape.profile.shape.gender.optional(),email:R.shape.profile.shape.email,phone_prefix:R.shape.profile.shape.phone_prefix,phone:R.shape.profile.shape.phone,terms_accepted:r.boolean(),privacy_accepted:r.boolean()}),r.object({patient_hash:r.string(),page:r.number().optional(),per_page:r.number().optional()});var q=_(C),z=r.array(r.object({id:r.number(),name:r.string(),code:r.string()})),H=r.object({primary_color:r.string().nullable(),logo:r.string().nullable(),favicon:r.string().nullable(),support_professional:r.object({hash:r.string().nullable()}).optional(),home:r.object({title:r.string().nullable(),description:r.string().nullable(),image_url:r.string().nullable()}),appointments:r.object({reserve_conditions:r.string().nullable(),seconds_before_start_to_refund_on_cancel:r.number().nullable(),has_nps:r.boolean().optional(),has_chat_in_appointment:r.boolean().optional(),has_discount_coupons_show:r.boolean().optional()}),legal_consent:r.object({terms_url:r.string().nullable(),privacy_url:r.string().nullable()})});e({slot_id:i().uuid(),service_id:i().uuid(),specialty_id:i(),consultation_reason:i().optional(),preconsultation_documents:n(e({file_path:i(),file_name:i()})).optional(),discount_code:i().optional()});var J=e({id:i(),percent_off:t(),code:i(),after_discount_amount:t().nullable()}),W=e({id:i(),percent_off:t(),code:i(),name:i().nullish()}),V=e({session_id:i(),payment_link:i().url()});e({video_call_schedule_id:i()});var K=V,X={Paid:"paid",Unpaid:"unpaid",Denied:"denied"},G=e({status:o(X),consultation_id:i(),consultation_type:i()});e({order_id:i(),validation_url:i().url()});var Z=a(l());e({order_id:i(),token:i()});var Q=e({data:e({status:o(X),consultation_id:i(),consultation_type:i().optional()})});e({order_id:i(),token:i()});var Y=e({data:e({status:o(X),consultation_id:i(),consultation_type:i().optional()})}),ee=s(["monday","tuesday","wednesday","thursday","friday","saturday","sunday","working_week","weekend","all_week"]);ee.enum;var te=e({days_of_week:ee,from_time:i(),to_time:i()});e({hash:i().uuid()});var ne=e({hash:i().uuid(),active_absence:e({id:i().uuid(),finishes_at:i()}).nullable(),avatar:i().url().nullable(),collegiate_number:i().nullable(),description:i().nullable(),is_available:c(),name:i(),overview:i().nullable(),schedule_description:i().nullable(),speciality_id:t().nullable(),status:s(["online","offline"]),title:i().nullable(),chat_schedule:e({channel:k,duration:t(),name:i(),timezone:i(),starts_at:i(),gaps:n(te)}).nullable()});function re(e){return e.active_absence?"absent":"online"===e.status?"online":"offline"}s(["online","offline","absent"]),e({roomId:t()});var ie=R;e({first_name:i(),last_name:i(),tax_id:i(),birth_date:i(),gender:s(["male","female"]),email:i(),phone_prefix:i(),phone:i(),terms_accepted:c(),privacy_accepted:c()}),e({terms_accepted:c(),privacy_accepted:c(),commercial_accepted:c()}),e({hash:i().uuid()});var se=e({id:t(),hash:i().uuid(),speciality_alias:i(),name:i(),avatar:i().url(),description:i(),collegiate_number:i(),languages:n(i()),centers:n(e({id:i().uuid(),name:i()}))});u([p(1),p(2),p(3)]);var oe={Sent:1,Received:2,Read:3},ae=e({roomId:t(),messageId:i().uuid(),string:i(),status:t(),senderType:s(["ordinary","system"]),fromUserHash:i().uuid(),auto:u([p(0),p(1)]),createdAt:i().nullable(),deletedAt:i().nullable(),time:t().nullable()}),le=e({file_name:i(),file_size:t(),url:i().url(),signed_url:i().url().nullable(),type:s(["uncategorized","voice_note"]),meta:e({duration:t()})}),ce=ae.extend({type:p("string"),attachment:d()}),ue=ae.extend({type:p("file"),attachment:le}),de=ae.extend({type:p("image"),attachment:le});e({roomId:t()});var pe=n(u([ce,ue,de]));e({roomId:t()});var he=e({unread_count:t()});e({professional_hash:i()});var fe=e({room_id:t()}),me=s(["available","reserved"]),ge=me.enum,be=e({id:i().uuid(),channel:k,duration:t(),starts_at:i(),finishes_at:i(),professional:e({id:i().uuid(),name:i()}),services:n(e({id:i().uuid(),name:i()})),speciality:e({id:t(),price:e({amount:t(),currency:i()}).nullish()}),status:me}),ye=r.array(r.object({id:r.string().uuid(),name:r.string(),code:r.string(),channel:k,price:r.object({amount:r.number(),currency:r.string()}).nullable()})),_e=r.array(r.object({id:r.string().uuid(),avatar:r.string().url().nullable(),description:r.string().nullable(),collegiate_number:r.string().nullable(),languages:r.array(r.string()),name:r.string(),slots:r.array(be),speciality:r.object({id:r.number()}),tax_id:r.string().nullable()}));r.object({speciality_id:r.number(),organization_schedule_service_id:r.string().uuid(),closest_slots_days:r.number().optional(),slots_per_day:r.number().optional()}),r.object({service_id:r.string().uuid(),professional_hash:r.string().uuid(),starts_at:r.string(),finishes_at:r.string(),rescheduling_appointment_id:r.string().uuid().optional()});var ve=r.array(be),we=r.array(r.object({id:r.number(),name:r.string(),code:r.string().nullish(),price:r.object({amount:r.number(),currency:r.string()}).nullable()}));r.object({slot_id:r.string().uuid(),service_id:r.string().uuid().optional(),speciality_id:r.number().optional()});var Ee=be;e({status:n(x).optional(),order:e({field:s(["starts_at"]).optional(),direction:s(["asc","desc"]).optional()}).optional(),page:t().optional(),per_page:t().optional()});var Ce=_(e({appointment:e({id:i().uuid(),url:i().url(),starts_at:i(),duration:t(),status:x,channel:k,expires_at:i().nullable(),service_id:i().uuid().nullable()}),room:e({id:t()}),price:e({amount:t(),currency:i()}).nullable(),patient:e({hash:i().uuid()}),slots:n(h()),professional:e({hash:i().uuid(),name:i(),avatar:i().url().optional(),description:i().optional(),languages:n(i()),collegiate_number:i().optional()}),speciality:e({id:t(),name:i()})}));e({slot_id:i().uuid(),service_id:i().uuid(),consultation_reason:i().optional(),preconsultation_documents:n(e({file_path:i(),file_name:i()})).optional(),discount_code:i().optional()});var Re=e({appointment:e({id:i().uuid()})});e({id:i().uuid()});var Oe=U,Se=e({file_path:i(),presigned_storage_url:i().url()});e({id:i().uuid(),slot_id:i().uuid(),consultation_reason:i().optional(),preconsultation_documents:n(e({file_path:i(),file_name:i()})).optional()}),e({id:i().uuid()}),e({appointment_id:i().uuid(),consultation_reason:i().optional()}),e({appointment_id:i().uuid(),file_path:i(),file_name:i()}),e({appointment_id:i().uuid(),document_id:i().uuid()}),e({appointmentId:i().uuid()}),r.object({api_key:r.string(),token:r.string()});var Ae=r.object({access_token:r.string(),patient:r.object({hash:r.string(),country_code:r.string(),timezone:r.string(),first_name:r.string(),last_name:r.string(),name:r.string(),birth_date:r.string(),email:r.string().email(),language_code:r.string(),phone:r.string(),phone_prefix:r.string(),tax_id:r.string(),legal_consent:r.object({accepted_at:r.string().nullable(),last_version_at:r.string().nullable(),terms_url:r.string(),privacy_url:r.string(),has_commercial_communications:r.boolean(),organization_name:r.string()})})});e({consultation_id:i(),consultation_type:D,rating:t().int().min(1).max(5),comment:i().nullable().optional()});var Te=e({rating:t().int().optional(),comment:i().nullable().optional()}).passthrough();e({file:f(File)});var je=e({url:i().url()});function xe(e,t){return function(){return e.apply(t,arguments)}}const{toString:Pe}=Object.prototype,{getPrototypeOf:ke}=Object,{iterator:Ne,toStringTag:Ue}=Symbol,De=(Le=Object.create(null),e=>{const t=Pe.call(e);return Le[t]||(Le[t]=t.slice(8,-1).toLowerCase())});var Le;const Fe=e=>(e=e.toLowerCase(),t=>De(t)===e),Be=e=>t=>typeof t===e,{isArray:Ie}=Array,$e=Be("undefined");function Me(e){return null!==e&&!$e(e)&&null!==e.constructor&&!$e(e.constructor)&&He(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const qe=Fe("ArrayBuffer");const ze=Be("string"),He=Be("function"),Je=Be("number"),We=e=>null!==e&&"object"==typeof e,Ve=e=>{if("object"!==De(e))return!1;const t=ke(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Ue in e||Ne in e)},Ke=Fe("Date"),Xe=Fe("File"),Ge=Fe("Blob"),Ze=Fe("FileList"),Qe=Fe("URLSearchParams"),[Ye,et,tt,nt]=["ReadableStream","Request","Response","Headers"].map(Fe);function rt(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,i;if("object"!=typeof e&&(e=[e]),Ie(e))for(r=0,i=e.length;r<i;r++)t.call(null,e[r],r,e);else{if(Me(e))return;const i=n?Object.getOwnPropertyNames(e):Object.keys(e),s=i.length;let o;for(r=0;r<s;r++)o=i[r],t.call(null,e[o],o,e)}}function it(e,t){if(Me(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r,i=n.length;for(;i-- >0;)if(r=n[i],t===r.toLowerCase())return r;return null}const st="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,ot=e=>!$e(e)&&e!==st;const at=(lt="undefined"!=typeof Uint8Array&&ke(Uint8Array),e=>lt&&e instanceof lt);var lt;const ct=Fe("HTMLFormElement"),ut=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),dt=Fe("RegExp"),pt=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};rt(n,(n,i)=>{let s;!1!==(s=t(n,i,e))&&(r[i]=s||n)}),Object.defineProperties(e,r)};const ht=Fe("AsyncFunction"),ft=(mt="function"==typeof setImmediate,gt=He(st.postMessage),mt?setImmediate:gt?(bt=`axios@${Math.random()}`,yt=[],st.addEventListener("message",({source:e,data:t})=>{e===st&&t===bt&&yt.length&&yt.shift()()},!1),e=>{yt.push(e),st.postMessage(bt,"*")}):e=>setTimeout(e));var mt,gt,bt,yt;const _t="undefined"!=typeof queueMicrotask?queueMicrotask.bind(st):"undefined"!=typeof process&&process.nextTick||ft;var vt={isArray:Ie,isArrayBuffer:qe,isBuffer:Me,isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||He(e.append)&&("formdata"===(t=De(e))||"object"===t&&He(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&qe(e.buffer),t},isString:ze,isNumber:Je,isBoolean:e=>!0===e||!1===e,isObject:We,isPlainObject:Ve,isEmptyObject:e=>{if(!We(e)||Me(e))return!1;try{return 0===Object.keys(e).length&&Object.getPrototypeOf(e)===Object.prototype}catch(e){return!1}},isReadableStream:Ye,isRequest:et,isResponse:tt,isHeaders:nt,isUndefined:$e,isDate:Ke,isFile:Xe,isBlob:Ge,isRegExp:dt,isFunction:He,isStream:e=>We(e)&&He(e.pipe),isURLSearchParams:Qe,isTypedArray:at,isFileList:Ze,forEach:rt,merge:function e(){const{caseless:t}=ot(this)&&this||{},n={},r=(r,i)=>{const s=t&&it(n,i)||i;Ve(n[s])&&Ve(r)?n[s]=e(n[s],r):Ve(r)?n[s]=e({},r):Ie(r)?n[s]=r.slice():n[s]=r};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&rt(arguments[e],r);return n},extend:(e,t,n,{allOwnKeys:r}={})=>(rt(t,(t,r)=>{n&&He(t)?e[r]=xe(t,n):e[r]=t},{allOwnKeys:r}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let i,s,o;const a={};if(t=t||{},null==e)return t;do{for(i=Object.getOwnPropertyNames(e),s=i.length;s-- >0;)o=i[s],r&&!r(o,e,t)||a[o]||(t[o]=e[o],a[o]=!0);e=!1!==n&&ke(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:De,kindOfTest:Fe,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(Ie(e))return e;let t=e.length;if(!Je(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Ne]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:ct,hasOwnProperty:ut,hasOwnProp:ut,reduceDescriptors:pt,freezeMethods:e=>{pt(e,(t,n)=>{if(He(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];He(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))})},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach(e=>{n[e]=!0})};return Ie(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(e,t,n){return t.toUpperCase()+n}),noop:()=>{},toFiniteNumber:(e,t)=>null!=e&&Number.isFinite(e=+e)?e:t,findKey:it,global:st,isContextDefined:ot,isSpecCompliantForm:function(e){return!!(e&&He(e.append)&&"FormData"===e[Ue]&&e[Ne])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(We(e)){if(t.indexOf(e)>=0)return;if(Me(e))return e;if(!("toJSON"in e)){t[r]=e;const i=Ie(e)?[]:{};return rt(e,(e,t)=>{const s=n(e,r+1);!$e(s)&&(i[t]=s)}),t[r]=void 0,i}}return e};return n(e,0)},isAsyncFn:ht,isThenable:e=>e&&(We(e)||He(e))&&He(e.then)&&He(e.catch),setImmediate:ft,asap:_t,isIterable:e=>null!=e&&He(e[Ne])};function wt(e,t,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i,this.status=i.status?i.status:null)}vt.inherits(wt,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:vt.toJSONObject(this.config),code:this.code,status:this.status}}});const Et=wt.prototype,Ct={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{Ct[e]={value:e}}),Object.defineProperties(wt,Ct),Object.defineProperty(Et,"isAxiosError",{value:!0}),wt.from=(e,t,n,r,i,s)=>{const o=Object.create(Et);return vt.toFlatObject(e,o,function(e){return e!==Error.prototype},e=>"isAxiosError"!==e),wt.call(o,e.message,t,n,r,i),o.cause=e,o.name=e.name,s&&Object.assign(o,s),o};function Rt(e){return vt.isPlainObject(e)||vt.isArray(e)}function Ot(e){return vt.endsWith(e,"[]")?e.slice(0,-2):e}function St(e,t,n){return e?e.concat(t).map(function(e,t){return e=Ot(e),!n&&t?"["+e+"]":e}).join(n?".":""):t}const At=vt.toFlatObject(vt,{},null,function(e){return/^is[A-Z]/.test(e)});function Tt(e,t,n){if(!vt.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=vt.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(e,t){return!vt.isUndefined(t[e])})).metaTokens,i=n.visitor||c,s=n.dots,o=n.indexes,a=(n.Blob||"undefined"!=typeof Blob&&Blob)&&vt.isSpecCompliantForm(t);if(!vt.isFunction(i))throw new TypeError("visitor must be a function");function l(e){if(null===e)return"";if(vt.isDate(e))return e.toISOString();if(vt.isBoolean(e))return e.toString();if(!a&&vt.isBlob(e))throw new wt("Blob is not supported. Use a Buffer instead.");return vt.isArrayBuffer(e)||vt.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function c(e,n,i){let a=e;if(e&&!i&&"object"==typeof e)if(vt.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(vt.isArray(e)&&function(e){return vt.isArray(e)&&!e.some(Rt)}(e)||(vt.isFileList(e)||vt.endsWith(n,"[]"))&&(a=vt.toArray(e)))return n=Ot(n),a.forEach(function(e,r){!vt.isUndefined(e)&&null!==e&&t.append(!0===o?St([n],r,s):null===o?n:n+"[]",l(e))}),!1;return!!Rt(e)||(t.append(St(i,n,s),l(e)),!1)}const u=[],d=Object.assign(At,{defaultVisitor:c,convertValue:l,isVisitable:Rt});if(!vt.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!vt.isUndefined(n)){if(-1!==u.indexOf(n))throw Error("Circular reference detected in "+r.join("."));u.push(n),vt.forEach(n,function(n,s){!0===(!(vt.isUndefined(n)||null===n)&&i.call(t,n,vt.isString(s)?s.trim():s,r,d))&&e(n,r?r.concat(s):[s])}),u.pop()}}(e),t}function jt(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(e){return t[e]})}function xt(e,t){this._pairs=[],e&&Tt(e,this,t)}const Pt=xt.prototype;function kt(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Nt(e,t,n){if(!t)return e;const r=n&&n.encode||kt;vt.isFunction(n)&&(n={serialize:n});const i=n&&n.serialize;let s;if(s=i?i(t,n):vt.isURLSearchParams(t)?t.toString():new xt(t,n).toString(r),s){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+s}return e}Pt.append=function(e,t){this._pairs.push([e,t])},Pt.toString=function(e){const t=e?function(t){return e.call(this,t,jt)}:jt;return this._pairs.map(function(e){return t(e[0])+"="+t(e[1])},"").join("&")};class InterceptorManager{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){vt.forEach(this.handlers,function(t){null!==t&&e(t)})}}var Ut={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},Dt={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:xt,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};const Lt="undefined"!=typeof window&&"undefined"!=typeof document,Ft="object"==typeof navigator&&navigator||void 0,Bt=Lt&&(!Ft||["ReactNative","NativeScript","NS"].indexOf(Ft.product)<0),It="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,$t=Lt&&window.location.href||"http://localhost";var Mt={...Object.freeze({__proto__:null,hasBrowserEnv:Lt,hasStandardBrowserEnv:Bt,hasStandardBrowserWebWorkerEnv:It,navigator:Ft,origin:$t}),...Dt};function qt(e){function t(e,n,r,i){let s=e[i++];if("__proto__"===s)return!0;const o=Number.isFinite(+s),a=i>=e.length;if(s=!s&&vt.isArray(r)?r.length:s,a)return vt.hasOwnProp(r,s)?r[s]=[r[s],n]:r[s]=n,!o;r[s]&&vt.isObject(r[s])||(r[s]=[]);return t(e,n,r[s],i)&&vt.isArray(r[s])&&(r[s]=function(e){const t={},n=Object.keys(e);let r;const i=n.length;let s;for(r=0;r<i;r++)s=n[r],t[s]=e[s];return t}(r[s])),!o}if(vt.isFormData(e)&&vt.isFunction(e.entries)){const n={};return vt.forEachEntry(e,(e,r)=>{t(function(e){return vt.matchAll(/\w+|\[(\w*)]/g,e).map(e=>"[]"===e[0]?"":e[1]||e[0])}(e),r,n,0)}),n}return null}const zt={transitional:Ut,adapter:["xhr","http","fetch"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,i=vt.isObject(e);i&&vt.isHTMLForm(e)&&(e=new FormData(e));if(vt.isFormData(e))return r?JSON.stringify(qt(e)):e;if(vt.isArrayBuffer(e)||vt.isBuffer(e)||vt.isStream(e)||vt.isFile(e)||vt.isBlob(e)||vt.isReadableStream(e))return e;if(vt.isArrayBufferView(e))return e.buffer;if(vt.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let s;if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return Tt(e,new Mt.classes.URLSearchParams,{visitor:function(e,t,n,r){return Mt.isNode&&vt.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)},...t})}(e,this.formSerializer).toString();if((s=vt.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return Tt(s?{"files[]":e}:e,t&&new t,this.formSerializer)}}return i||r?(t.setContentType("application/json",!1),function(e,t,n){if(vt.isString(e))try{return(t||JSON.parse)(e),vt.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||zt.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(vt.isResponse(e)||vt.isReadableStream(e))return e;if(e&&vt.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(e){if(n){if("SyntaxError"===e.name)throw wt.from(e,wt.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Mt.classes.FormData,Blob:Mt.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};vt.forEach(["delete","get","head","post","put","patch"],e=>{zt.headers[e]={}});const Ht=vt.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);const Jt=Symbol("internals");function Wt(e){return e&&String(e).trim().toLowerCase()}function Vt(e){return!1===e||null==e?e:vt.isArray(e)?e.map(Vt):String(e)}function Kt(e,t,n,r,i){return vt.isFunction(r)?r.call(this,t,n):(i&&(t=n),vt.isString(t)?vt.isString(r)?-1!==t.indexOf(r):vt.isRegExp(r)?r.test(t):void 0:void 0)}let Xt=class AxiosHeaders{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function i(e,t,n){const i=Wt(t);if(!i)throw new Error("header name must be a non-empty string");const s=vt.findKey(r,i);(!s||void 0===r[s]||!0===n||void 0===n&&!1!==r[s])&&(r[s||t]=Vt(e))}const s=(e,t)=>vt.forEach(e,(e,n)=>i(e,n,t));if(vt.isPlainObject(e)||e instanceof this.constructor)s(e,t);else if(vt.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim()))s((e=>{const t={};let n,r,i;return e&&e.split("\n").forEach(function(e){i=e.indexOf(":"),n=e.substring(0,i).trim().toLowerCase(),r=e.substring(i+1).trim(),!n||t[n]&&Ht[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t})(e),t);else if(vt.isObject(e)&&vt.isIterable(e)){let n,r,i={};for(const t of e){if(!vt.isArray(t))throw TypeError("Object iterator must return a key-value pair");i[r=t[0]]=(n=i[r])?vt.isArray(n)?[...n,t[1]]:[n,t[1]]:t[1]}s(i,t)}else null!=e&&i(t,e,n);return this}get(e,t){if(e=Wt(e)){const n=vt.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(vt.isFunction(t))return t.call(this,e,n);if(vt.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Wt(e)){const n=vt.findKey(this,e);return!(!n||void 0===this[n]||t&&!Kt(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function i(e){if(e=Wt(e)){const i=vt.findKey(n,e);!i||t&&!Kt(0,n[i],i,t)||(delete n[i],r=!0)}}return vt.isArray(e)?e.forEach(i):i(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const i=t[n];e&&!Kt(0,this[i],i,e,!0)||(delete this[i],r=!0)}return r}normalize(e){const t=this,n={};return vt.forEach(this,(r,i)=>{const s=vt.findKey(n,i);if(s)return t[s]=Vt(r),void delete t[i];const o=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(e,t,n)=>t.toUpperCase()+n)}(i):String(i).trim();o!==i&&delete t[i],t[o]=Vt(r),n[o]=!0}),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return vt.forEach(this,(n,r)=>{null!=n&&!1!==n&&(t[r]=e&&vt.isArray(n)?n.join(", "):n)}),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([e,t])=>e+": "+t).join("\n")}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach(e=>n.set(e)),n}static accessor(e){const t=(this[Jt]=this[Jt]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=Wt(e);t[r]||(!function(e,t){const n=vt.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(e,n,i){return this[r].call(this,t,e,n,i)},configurable:!0})})}(n,e),t[r]=!0)}return vt.isArray(e)?e.forEach(r):r(e),this}};function Gt(e,t){const n=this||zt,r=t||n,i=Xt.from(r.headers);let s=r.data;return vt.forEach(e,function(e){s=e.call(n,s,i.normalize(),t?t.status:void 0)}),i.normalize(),s}function Zt(e){return!(!e||!e.__CANCEL__)}function Qt(e,t,n){wt.call(this,e??"canceled",wt.ERR_CANCELED,t,n),this.name="CanceledError"}function Yt(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new wt("Request failed with status code "+n.status,[wt.ERR_BAD_REQUEST,wt.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}Xt.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),vt.reduceDescriptors(Xt.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[n]=e}}}),vt.freezeMethods(Xt),vt.inherits(Qt,wt,{__CANCEL__:!0});const en=(e,t,n=3)=>{let r=0;const i=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let i,s=0,o=0;return t=void 0!==t?t:1e3,function(a){const l=Date.now(),c=r[o];i||(i=l),n[s]=a,r[s]=l;let u=o,d=0;for(;u!==s;)d+=n[u++],u%=e;if(s=(s+1)%e,s===o&&(o=(o+1)%e),l-i<t)return;const p=c&&l-c;return p?Math.round(1e3*d/p):void 0}}(50,250);return function(e,t){let n,r,i=0,s=1e3/t;const o=(t,s=Date.now())=>{i=s,n=null,r&&(clearTimeout(r),r=null),e(...t)};return[(...e)=>{const t=Date.now(),a=t-i;a>=s?o(e,t):(n=e,r||(r=setTimeout(()=>{r=null,o(n)},s-a)))},()=>n&&o(n)]}(n=>{const s=n.loaded,o=n.lengthComputable?n.total:void 0,a=s-r,l=i(a);r=s;e({loaded:s,total:o,progress:o?s/o:void 0,bytes:a,rate:l||void 0,estimated:l&&o&&s<=o?(o-s)/l:void 0,event:n,lengthComputable:null!=o,[t?"download":"upload"]:!0})},n)},tn=(e,t)=>{const n=null!=e;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},nn=e=>(...t)=>vt.asap(()=>e(...t));var rn=Mt.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Mt.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Mt.origin),Mt.navigator&&/(msie|trident)/i.test(Mt.navigator.userAgent)):()=>!0,sn=Mt.hasStandardBrowserEnv?{write(e,t,n,r,i,s){const o=[e+"="+encodeURIComponent(t)];vt.isNumber(n)&&o.push("expires="+new Date(n).toGMTString()),vt.isString(r)&&o.push("path="+r),vt.isString(i)&&o.push("domain="+i),!0===s&&o.push("secure"),document.cookie=o.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function on(e,t,n){let r=!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t);return e&&(r||0==n)?function(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}const an=e=>e instanceof Xt?{...e}:e;function ln(e,t){t=t||{};const n={};function r(e,t,n,r){return vt.isPlainObject(e)&&vt.isPlainObject(t)?vt.merge.call({caseless:r},e,t):vt.isPlainObject(t)?vt.merge({},t):vt.isArray(t)?t.slice():t}function i(e,t,n,i){return vt.isUndefined(t)?vt.isUndefined(e)?void 0:r(void 0,e,0,i):r(e,t,0,i)}function s(e,t){if(!vt.isUndefined(t))return r(void 0,t)}function o(e,t){return vt.isUndefined(t)?vt.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function a(n,i,s){return s in t?r(n,i):s in e?r(void 0,n):void 0}const l={url:s,method:s,data:s,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,withXSRFToken:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:a,headers:(e,t,n)=>i(an(e),an(t),0,!0)};return vt.forEach(Object.keys({...e,...t}),function(r){const s=l[r]||i,o=s(e[r],t[r],r);vt.isUndefined(o)&&s!==a||(n[r]=o)}),n}var cn=e=>{const t=ln({},e);let n,{data:r,withXSRFToken:i,xsrfHeaderName:s,xsrfCookieName:o,headers:a,auth:l}=t;if(t.headers=a=Xt.from(a),t.url=Nt(on(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),l&&a.set("Authorization","Basic "+btoa((l.username||"")+":"+(l.password?unescape(encodeURIComponent(l.password)):""))),vt.isFormData(r))if(Mt.hasStandardBrowserEnv||Mt.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(!1!==(n=a.getContentType())){const[e,...t]=n?n.split(";").map(e=>e.trim()).filter(Boolean):[];a.setContentType([e||"multipart/form-data",...t].join("; "))}if(Mt.hasStandardBrowserEnv&&(i&&vt.isFunction(i)&&(i=i(t)),i||!1!==i&&rn(t.url))){const e=s&&o&&sn.read(o);e&&a.set(s,e)}return t};var un="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise(function(t,n){const r=cn(e);let i=r.data;const s=Xt.from(r.headers).normalize();let o,a,l,c,u,{responseType:d,onUploadProgress:p,onDownloadProgress:h}=r;function f(){c&&c(),u&&u(),r.cancelToken&&r.cancelToken.unsubscribe(o),r.signal&&r.signal.removeEventListener("abort",o)}let m=new XMLHttpRequest;function g(){if(!m)return;const r=Xt.from("getAllResponseHeaders"in m&&m.getAllResponseHeaders());Yt(function(e){t(e),f()},function(e){n(e),f()},{data:d&&"text"!==d&&"json"!==d?m.response:m.responseText,status:m.status,statusText:m.statusText,headers:r,config:e,request:m}),m=null}m.open(r.method.toUpperCase(),r.url,!0),m.timeout=r.timeout,"onloadend"in m?m.onloadend=g:m.onreadystatechange=function(){m&&4===m.readyState&&(0!==m.status||m.responseURL&&0===m.responseURL.indexOf("file:"))&&setTimeout(g)},m.onabort=function(){m&&(n(new wt("Request aborted",wt.ECONNABORTED,e,m)),m=null)},m.onerror=function(){n(new wt("Network Error",wt.ERR_NETWORK,e,m)),m=null},m.ontimeout=function(){let t=r.timeout?"timeout of "+r.timeout+"ms exceeded":"timeout exceeded";const i=r.transitional||Ut;r.timeoutErrorMessage&&(t=r.timeoutErrorMessage),n(new wt(t,i.clarifyTimeoutError?wt.ETIMEDOUT:wt.ECONNABORTED,e,m)),m=null},void 0===i&&s.setContentType(null),"setRequestHeader"in m&&vt.forEach(s.toJSON(),function(e,t){m.setRequestHeader(t,e)}),vt.isUndefined(r.withCredentials)||(m.withCredentials=!!r.withCredentials),d&&"json"!==d&&(m.responseType=r.responseType),h&&([l,u]=en(h,!0),m.addEventListener("progress",l)),p&&m.upload&&([a,c]=en(p),m.upload.addEventListener("progress",a),m.upload.addEventListener("loadend",c)),(r.cancelToken||r.signal)&&(o=t=>{m&&(n(!t||t.type?new Qt(null,e,m):t),m.abort(),m=null)},r.cancelToken&&r.cancelToken.subscribe(o),r.signal&&(r.signal.aborted?o():r.signal.addEventListener("abort",o)));const b=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(r.url);b&&-1===Mt.protocols.indexOf(b)?n(new wt("Unsupported protocol "+b+":",wt.ERR_BAD_REQUEST,e)):m.send(i||null)})};const dn=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let n,r=new AbortController;const i=function(e){if(!n){n=!0,o();const t=e instanceof Error?e:this.reason;r.abort(t instanceof wt?t:new Qt(t instanceof Error?t.message:t))}};let s=t&&setTimeout(()=>{s=null,i(new wt(`timeout ${t} of ms exceeded`,wt.ETIMEDOUT))},t);const o=()=>{e&&(s&&clearTimeout(s),s=null,e.forEach(e=>{e.unsubscribe?e.unsubscribe(i):e.removeEventListener("abort",i)}),e=null)};e.forEach(e=>e.addEventListener("abort",i));const{signal:a}=r;return a.unsubscribe=()=>vt.asap(o),a}},pn=function*(e,t){let n=e.byteLength;if(n<t)return void(yield e);let r,i=0;for(;i<n;)r=i+t,yield e.slice(i,r),i=r},hn=async function*(e){if(e[Symbol.asyncIterator])return void(yield*e);const t=e.getReader();try{for(;;){const{done:e,value:n}=await t.read();if(e)break;yield n}}finally{await t.cancel()}},fn=(e,t,n,r)=>{const i=async function*(e,t){for await(const n of hn(e))yield*pn(n,t)}(e,t);let s,o=0,a=e=>{s||(s=!0,r&&r(e))};return new ReadableStream({async pull(e){try{const{done:t,value:r}=await i.next();if(t)return a(),void e.close();let s=r.byteLength;if(n){let e=o+=s;n(e)}e.enqueue(new Uint8Array(r))}catch(e){throw a(e),e}},cancel:e=>(a(e),i.return())},{highWaterMark:2})},mn="function"==typeof fetch&&"function"==typeof Request&&"function"==typeof Response,gn=mn&&"function"==typeof ReadableStream,bn=mn&&("function"==typeof TextEncoder?(yn=new TextEncoder,e=>yn.encode(e)):async e=>new Uint8Array(await new Response(e).arrayBuffer()));var yn;const _n=(e,...t)=>{try{return!!e(...t)}catch(e){return!1}},vn=gn&&_n(()=>{let e=!1;const t=new Request(Mt.origin,{body:new ReadableStream,method:"POST",get duplex(){return e=!0,"half"}}).headers.has("Content-Type");return e&&!t}),wn=gn&&_n(()=>vt.isReadableStream(new Response("").body)),En={stream:wn&&(e=>e.body)};var Cn;mn&&(Cn=new Response,["text","arrayBuffer","blob","formData","stream"].forEach(e=>{!En[e]&&(En[e]=vt.isFunction(Cn[e])?t=>t[e]():(t,n)=>{throw new wt(`Response type '${e}' is not supported`,wt.ERR_NOT_SUPPORT,n)})}));const Rn=async(e,t)=>{const n=vt.toFiniteNumber(e.getContentLength());return n??(async e=>{if(null==e)return 0;if(vt.isBlob(e))return e.size;if(vt.isSpecCompliantForm(e)){const t=new Request(Mt.origin,{method:"POST",body:e});return(await t.arrayBuffer()).byteLength}return vt.isArrayBufferView(e)||vt.isArrayBuffer(e)?e.byteLength:(vt.isURLSearchParams(e)&&(e+=""),vt.isString(e)?(await bn(e)).byteLength:void 0)})(t)};const On={http:null,xhr:un,fetch:mn&&(async e=>{let{url:t,method:n,data:r,signal:i,cancelToken:s,timeout:o,onDownloadProgress:a,onUploadProgress:l,responseType:c,headers:u,withCredentials:d="same-origin",fetchOptions:p}=cn(e);c=c?(c+"").toLowerCase():"text";let h,f=dn([i,s&&s.toAbortSignal()],o);const m=f&&f.unsubscribe&&(()=>{f.unsubscribe()});let g;try{if(l&&vn&&"get"!==n&&"head"!==n&&0!==(g=await Rn(u,r))){let e,n=new Request(t,{method:"POST",body:r,duplex:"half"});if(vt.isFormData(r)&&(e=n.headers.get("content-type"))&&u.setContentType(e),n.body){const[e,t]=tn(g,en(nn(l)));r=fn(n.body,65536,e,t)}}vt.isString(d)||(d=d?"include":"omit");const i="credentials"in Request.prototype;h=new Request(t,{...p,signal:f,method:n.toUpperCase(),headers:u.normalize().toJSON(),body:r,duplex:"half",credentials:i?d:void 0});let s=await fetch(h,p);const o=wn&&("stream"===c||"response"===c);if(wn&&(a||o&&m)){const e={};["status","statusText","headers"].forEach(t=>{e[t]=s[t]});const t=vt.toFiniteNumber(s.headers.get("content-length")),[n,r]=a&&tn(t,en(nn(a),!0))||[];s=new Response(fn(s.body,65536,n,()=>{r&&r(),m&&m()}),e)}c=c||"text";let b=await En[vt.findKey(En,c)||"text"](s,e);return!o&&m&&m(),await new Promise((t,n)=>{Yt(t,n,{data:b,headers:Xt.from(s.headers),status:s.status,statusText:s.statusText,config:e,request:h})})}catch(t){if(m&&m(),t&&"TypeError"===t.name&&/Load failed|fetch/i.test(t.message))throw Object.assign(new wt("Network Error",wt.ERR_NETWORK,e,h),{cause:t.cause||t});throw wt.from(t,t&&t.code,e,h)}})};vt.forEach(On,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}});const Sn=e=>`- ${e}`,An=e=>vt.isFunction(e)||null===e||!1===e;var Tn=e=>{e=vt.isArray(e)?e:[e];const{length:t}=e;let n,r;const i={};for(let s=0;s<t;s++){let t;if(n=e[s],r=n,!An(n)&&(r=On[(t=String(n)).toLowerCase()],void 0===r))throw new wt(`Unknown adapter '${t}'`);if(r)break;i[t||"#"+s]=r}if(!r){const e=Object.entries(i).map(([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build"));throw new wt("There is no suitable adapter to dispatch the request "+(t?e.length>1?"since :\n"+e.map(Sn).join("\n"):" "+Sn(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return r};function jn(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Qt(null,e)}function xn(e){jn(e),e.headers=Xt.from(e.headers),e.data=Gt.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return Tn(e.adapter||zt.adapter)(e).then(function(t){return jn(e),t.data=Gt.call(e,e.transformResponse,t),t.headers=Xt.from(t.headers),t},function(t){return Zt(t)||(jn(e),t&&t.response&&(t.response.data=Gt.call(e,e.transformResponse,t.response),t.response.headers=Xt.from(t.response.headers))),Promise.reject(t)})}const Pn="1.11.0",kn={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{kn[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}});const Nn={};kn.transitional=function(e,t,n){function r(e,t){return"[Axios v"+Pn+"] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,i,s)=>{if(!1===e)throw new wt(r(i," has been removed"+(t?" in "+t:"")),wt.ERR_DEPRECATED);return t&&!Nn[i]&&(Nn[i]=!0,console.warn(r(i," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,i,s)}},kn.spelling=function(e){return(t,n)=>(console.warn(`${n} is likely a misspelling of ${e}`),!0)};var Un={assertOptions:function(e,t,n){if("object"!=typeof e)throw new wt("options must be an object",wt.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let i=r.length;for(;i-- >0;){const s=r[i],o=t[s];if(o){const t=e[s],n=void 0===t||o(t,s,e);if(!0!==n)throw new wt("option "+s+" must be "+n,wt.ERR_BAD_OPTION_VALUE);continue}if(!0!==n)throw new wt("Unknown option "+s,wt.ERR_BAD_OPTION)}},validators:kn};const Dn=Un.validators;let Ln=class Axios{constructor(e){this.defaults=e||{},this.interceptors={request:new InterceptorManager,response:new InterceptorManager}}async request(e,t){try{return await this._request(e,t)}catch(e){if(e instanceof Error){let t={};Error.captureStackTrace?Error.captureStackTrace(t):t=new Error;const n=t.stack?t.stack.replace(/^.+\n/,""):"";try{e.stack?n&&!String(e.stack).endsWith(n.replace(/^.+\n.+\n/,""))&&(e.stack+="\n"+n):e.stack=n}catch(e){}}throw e}}_request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=ln(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:i}=t;void 0!==n&&Un.assertOptions(n,{silentJSONParsing:Dn.transitional(Dn.boolean),forcedJSONParsing:Dn.transitional(Dn.boolean),clarifyTimeoutError:Dn.transitional(Dn.boolean)},!1),null!=r&&(vt.isFunction(r)?t.paramsSerializer={serialize:r}:Un.assertOptions(r,{encode:Dn.function,serialize:Dn.function},!0)),void 0!==t.allowAbsoluteUrls||(void 0!==this.defaults.allowAbsoluteUrls?t.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:t.allowAbsoluteUrls=!0),Un.assertOptions(t,{baseUrl:Dn.spelling("baseURL"),withXsrfToken:Dn.spelling("withXSRFToken")},!0),t.method=(t.method||this.defaults.method||"get").toLowerCase();let s=i&&vt.merge(i.common,i[t.method]);i&&vt.forEach(["delete","get","head","post","put","patch","common"],e=>{delete i[e]}),t.headers=Xt.concat(s,i);const o=[];let a=!0;this.interceptors.request.forEach(function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(a=a&&e.synchronous,o.unshift(e.fulfilled,e.rejected))});const l=[];let c;this.interceptors.response.forEach(function(e){l.push(e.fulfilled,e.rejected)});let u,d=0;if(!a){const e=[xn.bind(this),void 0];for(e.unshift(...o),e.push(...l),u=e.length,c=Promise.resolve(t);d<u;)c=c.then(e[d++],e[d++]);return c}u=o.length;let p=t;for(d=0;d<u;){const e=o[d++],t=o[d++];try{p=e(p)}catch(e){t.call(this,e);break}}try{c=xn.call(this,p)}catch(e){return Promise.reject(e)}for(d=0,u=l.length;d<u;)c=c.then(l[d++],l[d++]);return c}getUri(e){return Nt(on((e=ln(this.defaults,e)).baseURL,e.url,e.allowAbsoluteUrls),e.params,e.paramsSerializer)}};vt.forEach(["delete","get","head","options"],function(e){Ln.prototype[e]=function(t,n){return this.request(ln(n||{},{method:e,url:t,data:(n||{}).data}))}}),vt.forEach(["post","put","patch"],function(e){function t(t){return function(n,r,i){return this.request(ln(i||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}Ln.prototype[e]=t(),Ln.prototype[e+"Form"]=t(!0)});const Fn={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Fn).forEach(([e,t])=>{Fn[t]=e});const Bn=function e(t){const n=new Ln(t),r=xe(Ln.prototype.request,n);return vt.extend(r,Ln.prototype,n,{allOwnKeys:!0}),vt.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(ln(t,n))},r}(zt);Bn.Axios=Ln,Bn.CanceledError=Qt,Bn.CancelToken=class CancelToken{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise(function(e){t=e});const n=this;this.promise.then(e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null}),this.promise.then=e=>{let t;const r=new Promise(e=>{n.subscribe(e),t=e}).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e(function(e,r,i){n.reason||(n.reason=new Qt(e,r,i),t(n.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}toAbortSignal(){const e=new AbortController,t=t=>{e.abort(t)};return this.subscribe(t),e.signal.unsubscribe=()=>this.unsubscribe(t),e.signal}static source(){let e;return{token:new CancelToken(function(t){e=t}),cancel:e}}},Bn.isCancel=Zt,Bn.VERSION=Pn,Bn.toFormData=Tt,Bn.AxiosError=wt,Bn.Cancel=Bn.CanceledError,Bn.all=function(e){return Promise.all(e)},Bn.spread=function(e){return function(t){return e.apply(null,t)}},Bn.isAxiosError=function(e){return vt.isObject(e)&&!0===e.isAxiosError},Bn.mergeConfig=ln,Bn.AxiosHeaders=Xt,Bn.formToJSON=e=>qt(vt.isHTMLForm(e)?new FormData(e):e),Bn.getAdapter=Tn,Bn.HttpStatusCode=Fn,Bn.default=Bn;const{Axios:In,AxiosError:$n,CanceledError:Mn,isCancel:qn,CancelToken:zn,VERSION:Hn,all:Jn,Cancel:Wn,isAxiosError:Vn,spread:Kn,toFormData:Xn,AxiosHeaders:Gn,HttpStatusCode:Zn,formToJSON:Qn,getAdapter:Yn,mergeConfig:er}=Bn;var tr=class{constructor(e,t){this.httpClient=e,this.validate=t}async getAppointments(e){return this.httpClient.get("/appointments/v1",{params:e}).then(this.validate(Ce))}async createAppointment(e){return this.httpClient.post(`/appointments/v1/slots/${e.slot_id}`,e).then(e=>e.data).then(this.validate(Re))}async getAppointment(e){return this.httpClient.get(`/api/v1/appointments/${e.id}`).then(e=>e.data).then(this.validate(Oe))}async getDocumentsStorage(){return this.httpClient.get("/appointments/v1/documents/storage").then(e=>e.data).then(this.validate(Se))}async rescheduleAppointment(e){const{id:t,...n}=e;return this.httpClient.put(`/appointments/v1/${t}/reschedule`,n)}async cancelAppointment(e){return this.httpClient.put(`/appointments/v1/${e.id}/cancel`)}async updateAppointment(e){const{appointment_id:t,...n}=e;return this.httpClient.put(`/appointments/v1/${t}/update`,n)}async addDocument(e){const{appointment_id:t,...n}=e;return this.httpClient.post(`/appointments/v1/${t}/consultation-document`,n)}async deleteDocument(e){return this.httpClient.delete(`/appointments/v1/${e.appointment_id}/consultation-document/${e.document_id}`)}async reconnectAppointment(e){return this.httpClient.put(`/appointments/v1/${e.appointmentId}/reconnect`)}},nr=class{constructor(e,t){this.httpClient=e,this.validate=t}async loginToken(e){return this.httpClient.post("/login/v1/token",{token:e.token},{headers:{"x-api-key":e.api_key}}).then(this.validate(Ae))}};var rr=class{constructor(e,t){this.httpClient=e,this.validate=t}async postReview(e){return this.httpClient.post("/consultations/v1/review",e)}async getReview(e){return this.httpClient.get(`/consultations/v1/review/${e}`).then(e=>e.data).then(this.validate(Te))}},ir=class{constructor(e,t){this.httpClient=e,this.validate=t}async uploadFile(e){const t=new FormData;return t.append("file",e.file,e.file.name),this.httpClient.post("/documents/v1/upload-file",t,{headers:{"Content-Type":"multipart/form-data"}}).then(this.validate(je))}},sr=class{constructor(e,t){this.httpClient=e,this.validate=t}async getAppointment(e){return this.httpClient.get(`/flash/v1/appointments/${e.appointmentId}`).then(e=>e.data).then(this.validate(I))}async joinCall(e){return this.httpClient.get(`/flash/v1/calls/${e.callId}/join`).then(e=>e.data).then(this.validate($))}async setReady(e){return this.httpClient.post(`/flash/v1/waiting/${e.professional_hash}/ready`,{consultation_id:e.consultation_id,consultation_type:e.consultation_type})}async leaveWaitingRoom(e){return this.httpClient.post(`/flash/v1/waiting/${e.professional_hash}/leave`,{consultation_id:e.consultation_id,consultation_type:e.consultation_type})}async getSharedDocuments(e){return this.httpClient.get(`/flash/v1/appointments/${e.appointment_id}/documents`).then(e=>e.data).then(this.validate(M))}async downloadDocument(e){return this.httpClient.get(e.url,{responseType:"blob"}).then(e=>e.data)}async updatePatientProfile(e){return this.httpClient.put("/flash/v1/profile",e)}async getPatientDocuments(e){return this.httpClient.get(`/flash/v1/patients/${e.patient_hash}/documents`,{params:{page:e.page,per_page:e.per_page}}).then(this.validate(q))}},or=class{constructor(e,t){this.httpClient=e,this.validate=t}async getOrganizationSpecialties(){return this.httpClient.get("/organizations/v1/specialities").then(e=>e.data).then(this.validate(z))}async getOrganizationSetup(){return this.httpClient.get("/organizations/v1/setup").then(e=>e.data).then(this.validate(H))}},ar=class{constructor(e,t){this.httpClient=e,this.validate=t}async createPaymentLink(e){const{specialty_id:t,...n}=e,r={...n,speciality_id:t};return this.httpClient.post("/payments/v1/schedule",r).then(e=>e.data).then(this.validate(V))}async createImmediateVideocallPaymentLink(e){return this.httpClient.post("/payments/v1/immediate-videocall",e).then(e=>e.data).then(this.validate(K))}async getConsultationCoupon(e,t){return this.httpClient.get(`/payments/v1/consultation-coupon/${encodeURIComponent(e)}`,{params:{amount:t}}).then(e=>e.data).then(this.validate(J))}async getAppointmentConsultationCoupon(e){return this.httpClient.get(`/payments/v1/appointment/${encodeURIComponent(e)}/consultation-coupon`).then(e=>e.data).then(this.validate(W))}async getPaymentSession(e){return this.httpClient.get(`/payments/v1/session/${e}`).then(e=>e.data).then(this.validate(G))}async validateApplePayMerchant(e){return this.httpClient.post("/payments/v1/apple-pay/validate-merchant",e).then(this.validate(Z))}async authorizeApplePay(e){return this.httpClient.post("/payments/v1/apple-pay/authorize",e).then(this.validate(Q))}async authorizeGooglePay(e){return this.httpClient.post("/payments/v1/google-pay/authorize",e).then(this.validate(Y))}},lr=class{constructor(e,t){this.httpClient=e,this.validate=t}async getProfessional(e){return this.httpClient.get(`sdk/v1/professionals/${e.hash}`).then(e=>e.data).then(this.validate(ne))}async readAllMessages(e){return this.httpClient.put(`sdk/v1/rooms/${e.roomId}/messages/read`).then(e=>e.data)}},cr=class{constructor(e,t){this.httpClient=e,this.validate=t}async getPatientProfile(){return this.httpClient.get("/profile/v1/patients").then(e=>e.data).then(this.validate(ie))}async getProfessionalPublicProfile(e){return this.httpClient.get(`/profile/v1/public/professionals/${e.hash}`).then(e=>e.data).then(this.validate(se))}async acceptLegalConsent(e){return this.httpClient.post("/profile/v1/legal-consent",e)}},ur=class{constructor(e,t){this.httpClient=e,this.validate=t}async getRoomMessages(e){return this.httpClient.get(`api/v1/rooms/${e.roomId}/messages`).then(e=>e.data).then(this.validate(pe))}async getUnreadMessagesCount(e){return this.httpClient.get(`chat/v1/${e.roomId}/unread-count`).then(e=>e.data).then(this.validate(he))}async createSupportRoom(e){return this.httpClient.post("chat/v1/support-room",e).then(e=>e.data).then(this.validate(fe))}},dr=class{constructor(e,t){this.httpClient=e,this.validate=t}async getScheduleServices(){return this.httpClient.get("/schedules/v1/services").then(e=>e.data).then(this.validate(ye))}async getProfessionalsBySpecialtyAndService(e){return this.httpClient.get("/schedules/v1/professionals",{params:e}).then(e=>e.data).then(this.validate(_e))}async getScheduleServiceProfessionalSlots(e){return this.httpClient.get(`/schedules/v1/services/${e.service_id}/professionals/${e.professional_hash}/slots`,{params:{starts_at:e.starts_at,finishes_at:e.finishes_at,rescheduling_appointment_id:e.rescheduling_appointment_id}}).then(e=>e.data).then(this.validate(ve))}async getScheduleServiceSpecialities(e){return this.httpClient.get(`/schedules/v1/services/${e}/specialities`).then(e=>e.data).then(this.validate(we))}async getScheduleSlot(e){return this.httpClient.get(`schedules/v1/slot/${e.slot_id}`,{params:{service_id:e.service_id,speciality_id:e.speciality_id}}).then(e=>e.data).then(this.validate(Ee))}};var pr={development:"https://chat-dev.mediquo.com",production:"https://chat.mediquo.com"},hr=class{constructor({env:e="production",baseURL:t,debug:n}={}){const r=t??pr[e];var i;this.httpClient=(i=r,Bn.create({baseURL:i,headers:{"Content-Type":"application/json"}}));const s=(o={debug:n},e=>t=>{const n=e.safeParse(t.data);if(n.error&&o?.debug){const e=t.config?.url??"";console.warn(`[Validation Error]${e?` - URL: ${e}`:""}\n${r=n.error,r.issues.map(e=>`${e.path.join(".")}: ${e.message}`).join("\n")}`)}var r;return n.data??t.data});var o;this.flash=new sr(this.httpClient,s),this.auth=new nr(this.httpClient,s),this.appointments=new tr(this.httpClient,s),this.payments=new ar(this.httpClient,s),this.schedules=new dr(this.httpClient,s),this.organizations=new or(this.httpClient,s),this.profile=new cr(this.httpClient,s),this.professionals=new lr(this.httpClient,s),this.rooms=new ur(this.httpClient,s),this.documents=new ir(this.httpClient,s),this.consultations=new rr(this.httpClient,s)}setAuthToken(e){this.httpClient.defaults.headers.common.Authorization=`Bearer ${e}`}setApiKey(e){this.httpClient.defaults.headers.common["x-api-key"]=e}setLanguage(e){this.httpClient.defaults.headers.common["Accept-Language"]=e}};let fr=null,mr=null;const gr=new Proxy({},{get:(e,t)=>(fr&&mr===y.MODE||(fr=new hr({env:y.MODE,debug:"development"===y.MODE}),mr=y.MODE),fr)[t]});export{N as A,L as C,w as D,oe as M,X as P,ge as S,gr as a,j as b,Vn as c,P as d,T as e,O as f,A as g,S as h,B as i,F as j,re as k};
@@ -1 +1 @@
1
- import{P as n}from"./api-chat-client-BTBtu01T.js";function e(e,r,t){return e===n.Paid?{kind:"success",sessionId:t,reference:r}:e===n.Denied?{kind:"denied",sessionId:t}:{kind:"error",reason:"authorize"}}function r(n){const e=n.merchant_session;return null===e||"object"!=typeof e||Array.isArray(e)?n:e}function t(n){if("string"==typeof n)return n;if(null!==n&&"object"==typeof n&&"paymentData"in n){const e=n.paymentData;if("string"==typeof e)return e;if(null!=e)return JSON.stringify(e)}return JSON.stringify(n)}export{e as r,t as s,r as u};
1
+ import{P as n}from"./api-chat-client-CqMn2JEn.js";function e(e,r,t){return e===n.Paid?{kind:"success",sessionId:t,reference:r}:e===n.Denied?{kind:"denied",sessionId:t}:{kind:"error",reason:"authorize"}}function r(n){const e=n.merchant_session;return null===e||"object"!=typeof e||Array.isArray(e)?n:e}function t(n){if("string"==typeof n)return n;if(null!==n&&"object"==typeof n&&"paymentData"in n){const e=n.paymentData;if("string"==typeof e)return e;if(null!=e)return JSON.stringify(e)}return JSON.stringify(n)}export{e as r,t as s,r as u};
@@ -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-CJj32K_p.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-CJj32K_p.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
+ const e=new Set(["children","localName","ref","style","className"]),t=new WeakMap,n=(e,n,r,s,a)=>{const o=a?.[n];void 0===o?(e[n]=r,null==r&&n in HTMLElement.prototype&&e.removeAttribute(n)):r!==s&&((e,n,r)=>{let s=t.get(e);void 0===s&&t.set(e,s=new Map);let a=s.get(n);void 0!==r?void 0===a?(s.set(n,a={handleEvent:r}),e.addEventListener(n,a)):a.handleEvent=r:void 0!==a&&(s.delete(n),e.removeEventListener(n,a))})(e,o,r)},r=({react:t,tagName:r,elementClass:s,events:a,displayName:o})=>{const c=new Set(Object.keys(a??{})),l=t.forwardRef((o,l)=>{const u=t.useRef(new Map),i=t.useRef(null),d={},f={};for(const[t,n]of Object.entries(o))e.has(t)?d["className"===t?"class":t]=n:c.has(t)||t in s.prototype?f[t]=n:d[t]=n;return t.useLayoutEffect(()=>{if(null===i.current)return;const e=new Map;for(const t in f)n(i.current,t,o[t],u.current.get(t),a),u.current.delete(t),e.set(t,o[t]);for(const[e,t]of u.current)n(i.current,e,void 0,t,a);u.current=e}),t.useLayoutEffect(()=>{i.current?.removeAttribute("defer-hydration")},[]),d.suppressHydrationWarning=!0,t.createElement(r,{...d,ref:t.useCallback(e=>{i.current=e,"function"==typeof l?l(e):null!==l&&(l.current=e)},[l])})});return l.displayName=o??s.name,l};export{r as o};
@@ -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-CqMn2JEn.js";import{t as c,d as m,a as p,b as h,c as u}from"./telemetry-client-Ca71sobH.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-DM-GTqxg.js";import"../ui/back-link.js";import"./index-Xcn-xs13.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,Oe as b,ne 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};