@mediquo/elements 0.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (187) hide show
  1. package/README.md +22 -0
  2. package/dist/chunks/api-chat-client-BTBtu01T.js +1 -0
  3. package/dist/chunks/apple-pay-outcomes-BlytM6W-.js +1 -0
  4. package/dist/chunks/appointment-details-DpzdYLjq.d.ts +24 -0
  5. package/dist/chunks/appointment.model.d-Dy50gMPg.d.ts +171 -0
  6. package/dist/chunks/ca_ES-nttMFJzr.js +1 -0
  7. package/dist/chunks/chunk-S5RWG6G2-oTcdgk2H.js +1 -0
  8. package/dist/chunks/chunk-YTQUGGS3-DN-JZpgG.js +1 -0
  9. package/dist/chunks/class-map-Co76I6aw.js +1 -0
  10. package/dist/chunks/context-provider-CiMFpvDA.js +1 -0
  11. package/dist/chunks/context-request-event-Dfydf1ub.js +1 -0
  12. package/dist/chunks/custom-element-DA9Fxvxd.js +1 -0
  13. package/dist/chunks/de_DE-CrwfSJnS.js +1 -0
  14. package/dist/chunks/default-IpEn36CA.d.ts +5 -0
  15. package/dist/chunks/directive-2EDmOukv.js +1 -0
  16. package/dist/chunks/en_US-BslWF9nj.js +1 -0
  17. package/dist/chunks/ensure-context-root-DbdqwnKB.js +1 -0
  18. package/dist/chunks/exports-XZaVrMLd.js +1 -0
  19. package/dist/chunks/external-zAbuzxDj.js +1 -0
  20. package/dist/chunks/format-Cm3B1GMy.js +1 -0
  21. package/dist/chunks/get-organization-setup-query-BMbuRi6v.js +1 -0
  22. package/dist/chunks/get-patient-profile-query-C8T8DJ7z.js +1 -0
  23. package/dist/chunks/if-defined-BYeVdwgd.js +1 -0
  24. package/dist/chunks/index-B9iWdvW3.js +1 -0
  25. package/dist/chunks/index-BYHKNPG2.js +1 -0
  26. package/dist/chunks/index-Bxh8Qfwr.js +1 -0
  27. package/dist/chunks/isBefore-Cof0D841.js +1 -0
  28. package/dist/chunks/isSameDay-DPfclwIL.js +1 -0
  29. package/dist/chunks/lit-element-DiWJYFwC.js +1 -0
  30. package/dist/chunks/login-token-task-BI-L2zSV.js +1 -0
  31. package/dist/chunks/mq-chat-room-DuG4RuIp.d.ts +503 -0
  32. package/dist/chunks/mq-layout-D8Mak16a.d.ts +21 -0
  33. package/dist/chunks/mq-layout-DpzeL9_i.js +1 -0
  34. package/dist/chunks/mutation-controller-OVT8NEt6.js +1 -0
  35. package/dist/chunks/parseISO-jT42c8Ob.js +1 -0
  36. package/dist/chunks/price-Dtdjx70D.js +1 -0
  37. package/dist/chunks/price.d-CwLosdAN.d.ts +10 -0
  38. package/dist/chunks/professional-overview-mO3tuMuH.d.ts +25 -0
  39. package/dist/chunks/property-scuRaFcM.js +1 -0
  40. package/dist/chunks/provide-CfT7g_Zi.js +1 -0
  41. package/dist/chunks/pt_PT-CFbbWowX.js +1 -0
  42. package/dist/chunks/query-CeeutdfT.js +1 -0
  43. package/dist/chunks/query-QJ1INUTG.js +1 -0
  44. package/dist/chunks/refund-cancel-policy-Bm5djPds.js +1 -0
  45. package/dist/chunks/runtime-Bg1WXVCx.js +1 -0
  46. package/dist/chunks/schemas.d-BEA8Pl6w.d.ts +44 -0
  47. package/dist/chunks/state-LQivXIgA.js +1 -0
  48. package/dist/chunks/style-map-CIdqdn7C.js +1 -0
  49. package/dist/chunks/task-Bj8p7kJX.js +1 -0
  50. package/dist/chunks/telemetry-client-CKCb9Gnf.js +1 -0
  51. package/dist/env.d.ts +21 -0
  52. package/dist/env.js +1 -0
  53. package/dist/events.d.ts +141 -0
  54. package/dist/events.js +1 -0
  55. package/dist/i18n.d.ts +11 -0
  56. package/dist/i18n.js +1 -0
  57. package/dist/index.d.ts +5 -0
  58. package/dist/index.js +1 -0
  59. package/dist/mq-apple-pay-checkout.d.ts +82 -0
  60. package/dist/mq-apple-pay-checkout.js +1 -0
  61. package/dist/mq-appointment-checkout.d.ts +55 -0
  62. package/dist/mq-appointment-checkout.js +1 -0
  63. package/dist/mq-chat-room.d.ts +20 -0
  64. package/dist/mq-chat-room.js +1 -0
  65. package/dist/mq-checkout.d.ts +108 -0
  66. package/dist/mq-checkout.js +1 -0
  67. package/dist/mq-google-pay-checkout.d.ts +117 -0
  68. package/dist/mq-google-pay-checkout.js +1 -0
  69. package/dist/mq-immediate-videocall-checkout.d.ts +47 -0
  70. package/dist/mq-immediate-videocall-checkout.js +1 -0
  71. package/dist/mq-my-appointments.d.ts +602 -0
  72. package/dist/mq-my-appointments.js +1 -0
  73. package/dist/mq-query-client-provider.d.ts +17 -0
  74. package/dist/mq-query-client-provider.js +1 -0
  75. package/dist/mq-schedule-success.d.ts +84 -0
  76. package/dist/mq-schedule-success.js +4 -0
  77. package/dist/mq-schedule.d.ts +1013 -0
  78. package/dist/mq-schedule.js +1 -0
  79. package/dist/mq-socket-provider.d.ts +103 -0
  80. package/dist/mq-socket-provider.js +1 -0
  81. package/dist/mq-support-chat.d.ts +86 -0
  82. package/dist/mq-support-chat.js +1 -0
  83. package/dist/mq-theme-provider.d.ts +34 -0
  84. package/dist/mq-theme-provider.js +1 -0
  85. package/dist/mq-videocall.d.ts +151 -0
  86. package/dist/mq-videocall.js +1 -0
  87. package/dist/theme.d.ts +200 -0
  88. package/dist/theme.js +1 -0
  89. package/dist/ui/back-link.d.ts +21 -0
  90. package/dist/ui/back-link.js +1 -0
  91. package/dist/ui/icons/alert-circle-icon.d.ts +6 -0
  92. package/dist/ui/icons/alert-circle-icon.js +1 -0
  93. package/dist/ui/icons/annotation-question-icon.d.ts +6 -0
  94. package/dist/ui/icons/annotation-question-icon.js +1 -0
  95. package/dist/ui/icons/briefcase-icon.d.ts +6 -0
  96. package/dist/ui/icons/briefcase-icon.js +1 -0
  97. package/dist/ui/icons/calendar-icon.d.ts +6 -0
  98. package/dist/ui/icons/calendar-icon.js +1 -0
  99. package/dist/ui/icons/chat-bubble-icon.d.ts +6 -0
  100. package/dist/ui/icons/chat-bubble-icon.js +1 -0
  101. package/dist/ui/icons/check-circle-icon.d.ts +5 -0
  102. package/dist/ui/icons/check-circle-icon.js +1 -0
  103. package/dist/ui/icons/check-double-icon.d.ts +6 -0
  104. package/dist/ui/icons/check-double-icon.js +1 -0
  105. package/dist/ui/icons/check-icon.d.ts +6 -0
  106. package/dist/ui/icons/check-icon.js +1 -0
  107. package/dist/ui/icons/chevron-down-icon.d.ts +6 -0
  108. package/dist/ui/icons/chevron-down-icon.js +1 -0
  109. package/dist/ui/icons/chevron-left-icon.d.ts +6 -0
  110. package/dist/ui/icons/chevron-left-icon.js +1 -0
  111. package/dist/ui/icons/chevron-right-icon.d.ts +6 -0
  112. package/dist/ui/icons/chevron-right-icon.js +1 -0
  113. package/dist/ui/icons/clock-icon.d.ts +6 -0
  114. package/dist/ui/icons/clock-icon.js +1 -0
  115. package/dist/ui/icons/download-icon.d.ts +6 -0
  116. package/dist/ui/icons/download-icon.js +1 -0
  117. package/dist/ui/icons/file-icon.d.ts +6 -0
  118. package/dist/ui/icons/file-icon.js +1 -0
  119. package/dist/ui/icons/heartbeat-icon.d.ts +5 -0
  120. package/dist/ui/icons/heartbeat-icon.js +1 -0
  121. package/dist/ui/icons/info-circle-outine-icon.d.ts +6 -0
  122. package/dist/ui/icons/info-circle-outine-icon.js +1 -0
  123. package/dist/ui/icons/message-bubble-icon.d.ts +6 -0
  124. package/dist/ui/icons/message-bubble-icon.js +1 -0
  125. package/dist/ui/icons/message-square-icon.d.ts +6 -0
  126. package/dist/ui/icons/message-square-icon.js +1 -0
  127. package/dist/ui/icons/mic-icon.d.ts +6 -0
  128. package/dist/ui/icons/mic-icon.js +1 -0
  129. package/dist/ui/icons/mic-off-icon.d.ts +6 -0
  130. package/dist/ui/icons/mic-off-icon.js +1 -0
  131. package/dist/ui/icons/phone-icon.d.ts +6 -0
  132. package/dist/ui/icons/phone-icon.js +1 -0
  133. package/dist/ui/icons/spinner-icon.d.ts +6 -0
  134. package/dist/ui/icons/spinner-icon.js +1 -0
  135. package/dist/ui/icons/tag-icon.d.ts +6 -0
  136. package/dist/ui/icons/tag-icon.js +1 -0
  137. package/dist/ui/icons/time-left-icon.d.ts +5 -0
  138. package/dist/ui/icons/time-left-icon.js +1 -0
  139. package/dist/ui/icons/types.d.ts +9 -0
  140. package/dist/ui/icons/types.js +1 -0
  141. package/dist/ui/icons/upload-icon.d.ts +6 -0
  142. package/dist/ui/icons/upload-icon.js +1 -0
  143. package/dist/ui/icons/video-icon.d.ts +6 -0
  144. package/dist/ui/icons/video-icon.js +1 -0
  145. package/dist/ui/icons/video-off-icon.d.ts +6 -0
  146. package/dist/ui/icons/video-off-icon.js +1 -0
  147. package/dist/ui/icons/x-icon.d.ts +6 -0
  148. package/dist/ui/icons/x-icon.js +1 -0
  149. package/dist/ui/mq-avatar.d.ts +37 -0
  150. package/dist/ui/mq-avatar.js +1 -0
  151. package/dist/ui/mq-button.d.ts +34 -0
  152. package/dist/ui/mq-button.js +1 -0
  153. package/dist/ui/mq-calendar.d.ts +66 -0
  154. package/dist/ui/mq-calendar.js +1 -0
  155. package/dist/ui/mq-callout.d.ts +23 -0
  156. package/dist/ui/mq-callout.js +1 -0
  157. package/dist/ui/mq-card.d.ts +18 -0
  158. package/dist/ui/mq-card.js +1 -0
  159. package/dist/ui/mq-checkbox.d.ts +41 -0
  160. package/dist/ui/mq-checkbox.js +1 -0
  161. package/dist/ui/mq-clamped-text.d.ts +46 -0
  162. package/dist/ui/mq-clamped-text.js +1 -0
  163. package/dist/ui/mq-dialog.d.ts +53 -0
  164. package/dist/ui/mq-dialog.js +1 -0
  165. package/dist/ui/mq-floating-bubble.d.ts +42 -0
  166. package/dist/ui/mq-floating-bubble.js +1 -0
  167. package/dist/ui/mq-input.d.ts +41 -0
  168. package/dist/ui/mq-input.js +1 -0
  169. package/dist/ui/mq-rating.d.ts +30 -0
  170. package/dist/ui/mq-rating.js +1 -0
  171. package/dist/ui/mq-select.d.ts +83 -0
  172. package/dist/ui/mq-select.js +1 -0
  173. package/dist/ui/mq-skeleton.d.ts +18 -0
  174. package/dist/ui/mq-skeleton.js +1 -0
  175. package/dist/ui/mq-tabs.d.ts +56 -0
  176. package/dist/ui/mq-tabs.js +1 -0
  177. package/dist/ui/mq-text-button.d.ts +39 -0
  178. package/dist/ui/mq-text-button.js +1 -0
  179. package/dist/ui/mq-textarea.d.ts +38 -0
  180. package/dist/ui/mq-textarea.js +1 -0
  181. package/dist/ui/mq-time-slot-picker.d.ts +84 -0
  182. package/dist/ui/mq-time-slot-picker.js +1 -0
  183. package/dist/ui/mq-toast.d.ts +111 -0
  184. package/dist/ui/mq-toast.js +1 -0
  185. package/dist/ui/mq-unread-badge.d.ts +15 -0
  186. package/dist/ui/mq-unread-badge.js +1 -0
  187. package/package.json +176 -0
@@ -0,0 +1 @@
1
+ import{n as t}from"./context-provider-CiMFpvDA.js";var e=t(Symbol.for("tanstack-lit-query")),s=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},i={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)},n=new class{#t=i;#e=!1;setTimeoutProvider(t){this.#t=t}setTimeout(t,e){return this.#t.setTimeout(t,e)}clearTimeout(t){this.#t.clearTimeout(t)}setInterval(t,e){return this.#t.setInterval(t,e)}clearInterval(t){this.#t.clearInterval(t)}};var r="undefined"==typeof window||"Deno"in globalThis;function o(){}function a(t,e){return"function"==typeof t?t(e):t}function c(t){return"number"==typeof t&&t>=0&&t!==1/0}function u(t,e){return Math.max(t+(e||0)-Date.now(),0)}function h(t,e){return"function"==typeof t?t(e):t}function l(t,e){return"function"==typeof t?t(e):t}function d(t,e){const{type:s="all",exact:i,fetchStatus:n,predicate:r,queryKey:o,stale:a}=t;if(o)if(i){if(e.queryHash!==p(o,e.options))return!1}else if(!v(e.queryKey,o))return!1;if("all"!==s){const t=e.isActive();if("active"===s&&!t)return!1;if("inactive"===s&&t)return!1}return("boolean"!=typeof a||e.isStale()===a)&&((!n||n===e.state.fetchStatus)&&!(r&&!r(e)))}function f(t,e){const{exact:s,status:i,predicate:n,mutationKey:r}=t;if(r){if(!e.options.mutationKey)return!1;if(s){if(y(e.options.mutationKey)!==y(r))return!1}else if(!v(e.options.mutationKey,r))return!1}return(!i||e.state.status===i)&&!(n&&!n(e))}function p(t,e){return(e?.queryKeyHashFn||y)(t)}function y(t){return JSON.stringify(t,(t,e)=>w(e)?Object.keys(e).sort().reduce((t,s)=>(t[s]=e[s],t),{}):e)}function v(t,e){return t===e||typeof t==typeof e&&(!(!t||!e||"object"!=typeof t||"object"!=typeof e)&&Object.keys(e).every(s=>v(t[s],e[s])))}var b=Object.prototype.hasOwnProperty;function m(t,e){if(t===e)return t;const s=S(t)&&S(e);if(!(s||w(t)&&w(e)))return e;const i=(s?t:Object.keys(t)).length,n=s?e:Object.keys(e),r=n.length,o=s?new Array(r):{};let a=0;for(let c=0;c<r;c++){const r=s?c:n[c],u=t[r],h=e[r];if(u===h){o[r]=u,(s?c<i:b.call(t,r))&&a++;continue}if(null===u||null===h||"object"!=typeof u||"object"!=typeof h){o[r]=h;continue}const l=m(u,h);o[r]=l,l===u&&a++}return i===r&&a===i?t:o}function g(t,e){if(!e||Object.keys(t).length!==Object.keys(e).length)return!1;for(const s in t)if(t[s]!==e[s])return!1;return!0}function S(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function w(t){if(!O(t))return!1;const e=t.constructor;if(void 0===e)return!0;const s=e.prototype;return!!O(s)&&(!!s.hasOwnProperty("isPrototypeOf")&&Object.getPrototypeOf(t)===Object.prototype)}function O(t){return"[object Object]"===Object.prototype.toString.call(t)}function F(t,e,s){return"function"==typeof s.structuralSharing?s.structuralSharing(t,e):!1!==s.structuralSharing?m(t,e):e}function C(t,e,s=0){const i=[...t,e];return s&&i.length>s?i.slice(1):i}function T(t,e,s=0){const i=[e,...t];return s&&i.length>s?i.slice(0,-1):i}var j=Symbol();function q(t,e){return!t.queryFn&&e?.initialPromise?()=>e.initialPromise:t.queryFn&&t.queryFn!==j?t.queryFn:()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`))}var U=new class extends s{#s;#i;#n;constructor(){super(),this.#n=t=>{if(!r&&window.addEventListener){const e=()=>t();return window.addEventListener("visibilitychange",e,!1),()=>{window.removeEventListener("visibilitychange",e)}}}}onSubscribe(){this.#i||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#i?.(),this.#i=void 0)}setEventListener(t){this.#n=t,this.#i?.(),this.#i=t(t=>{"boolean"==typeof t?this.setFocused(t):this.onFocus()})}setFocused(t){this.#s!==t&&(this.#s=t,this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(e=>{e(t)})}isFocused(){return"boolean"==typeof this.#s?this.#s:"hidden"!==globalThis.document?.visibilityState}};function A(){let t,e;const s=new Promise((s,i)=>{t=s,e=i});function i(t){Object.assign(s,t),delete s.resolve,delete s.reject}return s.status="pending",s.catch(()=>{}),s.resolve=e=>{i({status:"fulfilled",value:e}),t(e)},s.reject=t=>{i({status:"rejected",reason:t}),e(t)},s}var E=function(t){setTimeout(t,0)};var R=function(){let t=[],e=0,s=t=>{t()},i=t=>{t()},n=E;const r=i=>{e?t.push(i):n(()=>{s(i)})};return{batch:r=>{let o;e++;try{o=r()}finally{e--,e||(()=>{const e=t;t=[],e.length&&n(()=>{i(()=>{e.forEach(t=>{s(t)})})})})()}return o},batchCalls:t=>(...e)=>{r(()=>{t(...e)})},schedule:r,setNotifyFunction:t=>{s=t},setBatchNotifyFunction:t=>{i=t},setScheduler:t=>{n=t}}}(),P=new class extends s{#r=!0;#i;#n;constructor(){super(),this.#n=t=>{if(!r&&window.addEventListener){const e=()=>t(!0),s=()=>t(!1);return window.addEventListener("online",e,!1),window.addEventListener("offline",s,!1),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",s)}}}}onSubscribe(){this.#i||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#i?.(),this.#i=void 0)}setEventListener(t){this.#n=t,this.#i?.(),this.#i=t(this.setOnline.bind(this))}setOnline(t){this.#r!==t&&(this.#r=t,this.listeners.forEach(e=>{e(t)}))}isOnline(){return this.#r}};function D(t){return Math.min(1e3*2**t,3e4)}function L(t){return"online"!==(t??"online")||P.isOnline()}var k=class extends Error{constructor(t){super("CancelledError"),this.revert=t?.revert,this.silent=t?.silent}};function I(t){let e,s=!1,i=0;const o=A(),a=()=>"pending"!==o.status,c=()=>U.isFocused()&&("always"===t.networkMode||P.isOnline())&&t.canRun(),u=()=>L(t.networkMode)&&t.canRun(),h=t=>{a()||(e?.(),o.resolve(t))},l=t=>{a()||(e?.(),o.reject(t))},d=()=>new Promise(s=>{e=t=>{(a()||c())&&s(t)},t.onPause?.()}).then(()=>{e=void 0,a()||t.onContinue?.()}),f=()=>{if(a())return;let e;const o=0===i?t.initialPromise:void 0;try{e=o??t.fn()}catch(t){e=Promise.reject(t)}Promise.resolve(e).then(h).catch(e=>{if(a())return;const o=t.retry??(r?0:3),u=t.retryDelay??D,h="function"==typeof u?u(i,e):u,p=!0===o||"number"==typeof o&&i<o||"function"==typeof o&&o(i,e);var y;!s&&p?(i++,t.onFail?.(i,e),(y=h,new Promise(t=>{n.setTimeout(t,y)})).then(()=>c()?void 0:d()).then(()=>{s?l(e):f()})):l(e)})};return{promise:o,status:()=>o.status,cancel:e=>{if(!a()){const s=new k(e);l(s),t.onCancel?.(s)}},continue:()=>(e?.(),o),cancelRetry:()=>{s=!0},continueRetry:()=>{s=!1},canStart:u,start:()=>(u()?f():d().then(f),o)}}var K=class{#o;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),c(this.gcTime)&&(this.#o=n.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(r?1/0:3e5))}clearGcTimeout(){this.#o&&(n.clearTimeout(this.#o),this.#o=void 0)}},M=class extends K{#a;#c;#u;#h;#l;#d;#f;constructor(t){super(),this.#f=!1,this.#d=t.defaultOptions,this.setOptions(t.options),this.observers=[],this.#h=t.client,this.#u=this.#h.getQueryCache(),this.queryKey=t.queryKey,this.queryHash=t.queryHash,this.#a=G(this.options),this.state=t.state??this.#a,this.scheduleGc()}get meta(){return this.options.meta}get promise(){return this.#l?.promise}setOptions(t){if(this.options={...this.#d,...t},this.updateGcTime(this.options.gcTime),this.state&&void 0===this.state.data){const t=G(this.options);void 0!==t.data&&(this.setData(t.data,{updatedAt:t.dataUpdatedAt,manual:!0}),this.#a=t)}}optionalRemove(){this.observers.length||"idle"!==this.state.fetchStatus||this.#u.remove(this)}setData(t,e){const s=F(this.state.data,t,this.options);return this.#p({data:s,type:"success",dataUpdatedAt:e?.updatedAt,manual:e?.manual}),s}setState(t,e){this.#p({type:"setState",state:t,setStateOptions:e})}cancel(t){const e=this.#l?.promise;return this.#l?.cancel(t),e?e.then(o).catch(o):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.#a)}isActive(){return this.observers.some(t=>!1!==l(t.options.enabled,this))}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===j||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0&&this.observers.some(t=>"static"===h(t.options.staleTime,this))}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):void 0===this.state.data||this.state.isInvalidated}isStaleByTime(t=0){return void 0===this.state.data||"static"!==t&&(!!this.state.isInvalidated||!u(this.state.dataUpdatedAt,t))}onFocus(){const t=this.observers.find(t=>t.shouldFetchOnWindowFocus());t?.refetch({cancelRefetch:!1}),this.#l?.continue()}onOnline(){const t=this.observers.find(t=>t.shouldFetchOnReconnect());t?.refetch({cancelRefetch:!1}),this.#l?.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),this.#u.notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(e=>e!==t),this.observers.length||(this.#l&&(this.#f?this.#l.cancel({revert:!0}):this.#l.cancelRetry()),this.scheduleGc()),this.#u.notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#p({type:"invalidate"})}async fetch(t,e){if("idle"!==this.state.fetchStatus&&"rejected"!==this.#l?.status())if(void 0!==this.state.data&&e?.cancelRefetch)this.cancel({silent:!0});else if(this.#l)return this.#l.continueRetry(),this.#l.promise;if(t&&this.setOptions(t),!this.options.queryFn){const t=this.observers.find(t=>t.options.queryFn);t&&this.setOptions(t.options)}const s=new AbortController,i=t=>{Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(this.#f=!0,s.signal)})},n=()=>{const t=q(this.options,e),s=(()=>{const t={client:this.#h,queryKey:this.queryKey,meta:this.meta};return i(t),t})();return this.#f=!1,this.options.persister?this.options.persister(t,s,this):t(s)},r=(()=>{const t={fetchOptions:e,options:this.options,queryKey:this.queryKey,client:this.#h,state:this.state,fetchFn:n};return i(t),t})();this.options.behavior?.onFetch(r,this),this.#c=this.state,"idle"!==this.state.fetchStatus&&this.state.fetchMeta===r.fetchOptions?.meta||this.#p({type:"fetch",meta:r.fetchOptions?.meta}),this.#l=I({initialPromise:e?.initialPromise,fn:r.fetchFn,onCancel:t=>{t instanceof k&&t.revert&&this.setState({...this.#c,fetchStatus:"idle"}),s.abort()},onFail:(t,e)=>{this.#p({type:"failed",failureCount:t,error:e})},onPause:()=>{this.#p({type:"pause"})},onContinue:()=>{this.#p({type:"continue"})},retry:r.options.retry,retryDelay:r.options.retryDelay,networkMode:r.options.networkMode,canRun:()=>!0});try{const t=await this.#l.start();if(void 0===t)throw new Error(`${this.queryHash} data is undefined`);return this.setData(t),this.#u.config.onSuccess?.(t,this),this.#u.config.onSettled?.(t,this.state.error,this),t}catch(t){if(t instanceof k){if(t.silent)return this.#l.promise;if(t.revert){if(void 0===this.state.data)throw t;return this.state.data}}throw this.#p({type:"error",error:t}),this.#u.config.onError?.(t,this),this.#u.config.onSettled?.(this.state.data,t,this),t}finally{this.scheduleGc()}}#p(t){this.state=(e=>{switch(t.type){case"failed":return{...e,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...e,fetchStatus:"paused"};case"continue":return{...e,fetchStatus:"fetching"};case"fetch":return{...e,...x(e.data,this.options),fetchMeta:t.meta??null};case"success":const s={...e,data:t.data,dataUpdateCount:e.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return this.#c=t.manual?s:void 0,s;case"error":const i=t.error;return{...e,error:i,errorUpdateCount:e.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:e.fetchFailureCount+1,fetchFailureReason:i,fetchStatus:"idle",status:"error"};case"invalidate":return{...e,isInvalidated:!0};case"setState":return{...e,...t.state}}})(this.state),R.batch(()=>{this.observers.forEach(t=>{t.onQueryUpdate()}),this.#u.notify({query:this,type:"updated",action:t})})}};function x(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:L(e.networkMode)?"fetching":"paused",...void 0===t&&{error:null,status:"pending"}}}function G(t){const e="function"==typeof t.initialData?t.initialData():t.initialData,s=void 0!==e,i=s?"function"==typeof t.initialDataUpdatedAt?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:s?i??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:s?"success":"pending",fetchStatus:"idle"}}export{e as Q,K as R,s as S,h as a,c as b,n as c,x as d,F as e,U as f,R as g,q as h,r as i,T as j,C as k,I as l,f as m,o as n,p as o,A as p,M as q,l as r,g as s,u as t,d as u,P as v,a as w,y as x,v as y,j as z};
@@ -0,0 +1 @@
1
+ import{c as e}from"./api-chat-client-BTBtu01T.js";import{t}from"./parseISO-jT42c8Ob.js";function n(e,n,r){const s=function(e,n){return+t(e)-+t(n)}(e,n)/1e3;return(c=r?.roundingMethod,e=>{const t=(c?Math[c]:Math.trunc)(e);return 0===t?0:t})(s);var c}function r(e){return{queryKey:["schedule-services"],queryFn:()=>e.schedules.getScheduleServices()}}function s(t){const{startsAtIso:r,refundPolicySeconds:s,now:c=new Date}=t,o=n(e(r),c);return!(o<0)&&(null==s||o>=s)}export{s as c,r as g};
@@ -0,0 +1 @@
1
+ const e="lit-localize-status",t=(e,...t)=>({strTag:!0,strings:e,values:t}),r=(e,t,r)=>{let s=e[0];for(let o=1;o<e.length;o++)s+=t[r?r[o-1]:o-1],s+=e[o];return s},s=e=>{return"string"!=typeof(t=e)&&"strTag"in t?r(e.strings,e.values):e;var t};let o=s,n=!1;class Deferred{constructor(){this.settled=!1,this.promise=new Promise((e,t)=>{this._resolve=e,this._reject=t})}resolve(e){this.settled=!0,this._resolve(e)}reject(e){this.settled=!0,this._reject(e)}}const i=[];for(let e=0;e<256;e++)i[e]=(e>>4&15).toString(16)+(15&e).toString(16);function l(e,t){return(t?"h":"s")+function(e){let t=0,r=8997,s=0,o=33826,n=0,l=40164,a=0,c=52210;for(let i=0;i<e.length;i++)r^=e.charCodeAt(i),t=435*r,s=435*o,n=435*l,a=435*c,n+=r<<8,a+=o<<8,s+=t>>>16,r=65535&t,n+=s>>>16,o=65535&s,c=a+(n>>>16)&65535,l=65535&n;return i[c>>8]+i[255&c]+i[l>>8]+i[255&l]+i[o>>8]+i[255&o]+i[r>>8]+i[255&r]}("string"==typeof e?e:e.join(""))}const a=new WeakMap,c=new Map;function u(e,t,o){if(e){const s=o?.id??function(e){const t="string"==typeof e?e:e.strings;let r=c.get(t);void 0===r&&(r=l(t,"string"!=typeof e&&!("strTag"in e)),c.set(t,r));return r}(t),n=e[s];if(n){if("string"==typeof n)return n;if("strTag"in n)return r(n.strings,t.values,n.values);{let e=a.get(n);return void 0===e&&(e=n.values,a.set(n,e)),{...n,values:e.map(e=>t.values[e])}}}}return s(t)}function d(t){window.dispatchEvent(new CustomEvent(e,{detail:t}))}let f,g,v,h,p,w="",m=new Deferred;m.resolve();let L=0;const y=e=>(function(e){if(n)throw new Error("lit-localize can only be configured once");o=e,n=!0}((e,t)=>u(p,e,t)),w=g=e.sourceLocale,v=new Set(e.targetLocales),v.add(e.sourceLocale),h=e.loadLocale,{getLocale:j,setLocale:E}),j=()=>w,E=e=>{if(e===(f??w))return m.promise;if(!v||!h)throw new Error("Internal error");if(!v.has(e))throw new Error("Invalid locale code");L++;const t=L;f=e,m.settled&&(m=new Deferred),d({status:"loading",loadingLocale:e});return(e===g?Promise.resolve({templates:void 0}):h(e)).then(r=>{L===t&&(w=e,f=void 0,p=r.templates,d({status:"ready",readyLocale:e}),m.resolve())},r=>{L===t&&(d({status:"error",errorLocale:e,errorMessage:r.toString()}),m.reject(r))}),m.promise};export{e as L,y as c,o as m,t as s};
@@ -0,0 +1,44 @@
1
+ import { z } from 'zod';
2
+
3
+ declare const CreatePaymentLinkRequestSchema: z.ZodObject<{
4
+ slot_id: z.ZodString;
5
+ service_id: z.ZodString;
6
+ /** ID of the medical specialty the booking belongs to. */
7
+ specialty_id: z.ZodString;
8
+ consultation_reason: z.ZodOptional<z.ZodString>;
9
+ preconsultation_documents: z.ZodOptional<z.ZodArray<z.ZodObject<{
10
+ file_path: z.ZodString;
11
+ file_name: z.ZodString;
12
+ }, "strip", z.ZodTypeAny, {
13
+ file_path: string;
14
+ file_name: string;
15
+ }, {
16
+ file_path: string;
17
+ file_name: string;
18
+ }>, "many">>;
19
+ /** Discount coupon code applied to the booking, if any. */
20
+ discount_code: z.ZodOptional<z.ZodString>;
21
+ }, "strip", z.ZodTypeAny, {
22
+ service_id: string;
23
+ slot_id: string;
24
+ specialty_id: string;
25
+ consultation_reason?: string | undefined;
26
+ preconsultation_documents?: {
27
+ file_path: string;
28
+ file_name: string;
29
+ }[] | undefined;
30
+ discount_code?: string | undefined;
31
+ }, {
32
+ service_id: string;
33
+ slot_id: string;
34
+ specialty_id: string;
35
+ consultation_reason?: string | undefined;
36
+ preconsultation_documents?: {
37
+ file_path: string;
38
+ file_name: string;
39
+ }[] | undefined;
40
+ discount_code?: string | undefined;
41
+ }>;
42
+ type CreatePaymentLinkRequest = z.infer<typeof CreatePaymentLinkRequestSchema>;
43
+
44
+ export type { CreatePaymentLinkRequest as C };
@@ -0,0 +1 @@
1
+ import{n as t}from"./property-scuRaFcM.js";function r(r){return t({...r,state:!0,attribute:!1})}export{r};
@@ -0,0 +1 @@
1
+ import{T as t}from"./lit-element-DiWJYFwC.js";import{e,i as r,t as s}from"./directive-2EDmOukv.js";const n="important",i=" !"+n,o=e(class extends r{constructor(t){if(super(t),t.type!==s.ATTRIBUTE||"style"!==t.name||t.strings?.length>2)throw Error("The `styleMap` directive must be used in the `style` attribute and must be the only part in the attribute.")}render(t){return Object.keys(t).reduce((e,r)=>{const s=t[r];return null==s?e:e+`${r=r.includes("-")?r:r.replace(/(?:^(webkit|moz|ms|o)|)(?=[A-Z])/g,"-$&").toLowerCase()}:${s};`},"")}update(e,[r]){const{style:s}=e.element;if(void 0===this.ft)return this.ft=new Set(Object.keys(r)),this.render(r);for(const t of this.ft)null==r[t]&&(this.ft.delete(t),t.includes("-")?s.removeProperty(t):s[t]=null);for(const t in r){const e=r[t];if(null!=e){this.ft.add(t);const r="string"==typeof e&&e.endsWith(i);t.includes("-")||r?s.setProperty(t,r?e.slice(0,-11):e,r?n:""):s[t]=e}}return t}});export{o};
@@ -0,0 +1 @@
1
+ import{f as t}from"./lit-element-DiWJYFwC.js";const i={PENDING:1},s=Symbol();class h{get taskComplete(){return this.t||(1===this.i?this.t=new Promise((t,i)=>{this.o=t,this.h=i}):3===this.i?this.t=Promise.reject(this.l):this.t=Promise.resolve(this.u)),this.t}constructor(t,i,s){this.p=0,this.i=0,(this._=t).addController(this);const r="object"==typeof i?i:{task:i,args:s};this.v=r.task,this.j=r.args,this.m=r.argsEqual??e,this.k=r.onComplete,this.A=r.onError,this.autoRun=r.autoRun??!0,"initialValue"in r&&(this.u=r.initialValue,this.i=2,this.O=this.T?.())}hostUpdate(){!0===this.autoRun&&this.S()}hostUpdated(){"afterUpdate"===this.autoRun&&this.S()}T(){if(void 0===this.j)return;const t=this.j();if(!Array.isArray(t))throw Error("The args function must return an array");return t}async S(){const t=this.T(),i=this.O;this.O=t,t===i||void 0===t||void 0!==i&&this.m(i,t)||await this.run(t)}async run(t){let i,e;t??=this.T(),this.O=t,1===this.i?this.q?.abort():(this.t=void 0,this.o=void 0,this.h=void 0),this.i=1,"afterUpdate"===this.autoRun?queueMicrotask(()=>this._.requestUpdate()):this._.requestUpdate();const r=++this.p;this.q=new AbortController;let a=!1;try{i=await this.v(t,{signal:this.q.signal})}catch(t){a=!0,e=t}if(this.p===r){if(i===s)this.i=0;else{if(!1===a){try{this.k?.(i)}catch{}this.i=2,this.o?.(i)}else{try{this.A?.(e)}catch{}this.i=3,this.h?.(e)}this.u=i,this.l=e}this._.requestUpdate()}}abort(t){1===this.i&&this.q?.abort(t)}get value(){return this.u}get error(){return this.l}get status(){return this.i}render(t){switch(this.i){case 0:return t.initial?.();case 1:return t.pending?.();case 2:return t.complete?.(this.value);case 3:return t.error?.(this.error);default:throw Error("Unexpected status: "+this.i)}}}const e=(i,s)=>i===s||i.length===s.length&&i.every((i,e)=>!t(i,s[e]));export{h,i as s};
@@ -0,0 +1 @@
1
+ import{c as t,t as e,l as a}from"./parseISO-jT42c8Ob.js";import{_ as i,t as n}from"./custom-element-DA9Fxvxd.js";import{m as o,s}from"./runtime-Bg1WXVCx.js";import{i as r,a as p,x as l,E as c}from"./lit-element-DiWJYFwC.js";import{n as d}from"./property-scuRaFcM.js";import{r as u}from"./state-LQivXIgA.js";import{getLocale as _}from"../i18n.js";import{chevronDownIcon as h}from"../ui/icons/chevron-down-icon.js";import"../ui/mq-text-button.js";import"../ui/mq-avatar.js";function y(a,i,n){return function(a,i){return t(a,+e(a)+i)}(a,1e3*i)}function v(t,e){return{queryKey:["organization-specialties"],queryFn:()=>t.organizations.getOrganizationSpecialties(),...e}}const m=r`.header{display:flex;align-items:center;gap:var(--sp-4);margin-bottom:0}.header.expanded{margin-bottom:var(--sp-4)}@media (max-width:768px){.header{--avatar-size-lg:var(--avatar-size-md)}}.professional-info{flex:1}.professional-name{font-family:var(--font-titles);font-size:var(--text-lg);line-height:var(--text-lg--line-height);font-weight:var(--font-weight-bold);color:var(--color-neutral-link-dark);margin:0}.professional-specialty{font-family:var(--font-body);font-size:var(--text-sm);line-height:var(--text-sm--line-height);font-weight:var(--font-weight-normal);color:var(--color-neutral-text-default);margin:0}.collegiate-number{font-family:var(--font-body);font-size:var(--text-xs);line-height:var(--text-xs--line-height);color:var(--color-neutrals-text-medium);margin:0;text-transform:uppercase}.languages{display:flex;flex-wrap:wrap;gap:var(--sp-3)}.language-pill{display:inline-block;background-color:#e5e5e5;color:var(--colors-neutral-text-default);font-family:var(--font-body);font-size:var(--text-xs);line-height:var(--text-xs--line-height);font-weight:var(--font-weight-medium);padding:var(--sp-1) var(--sp-2);border-radius:26px;text-transform:uppercase}.description{font-family:var(--font-body);font-size:var(--text-xs);line-height:var(--text-xs--line-height);font-weight:var(--font-weight-normal);margin-bottom:0;color:var(--color-neutrals-text-medium)}.icon{transition:transform .1s ease-in-out}.rotate-180{transform:rotate(180deg)}.details{display:grid;grid-template-rows:0fr;transition:grid-template-rows .2s ease-out;overflow:hidden}.details[data-expanded=true]{grid-template-rows:1fr}.details-content{overflow:hidden}.details-content>:not(:first-child){margin-top:var(--sp-3)}@media (min-width:769px){:host([always-expanded-on-desktop]) .details{grid-template-rows:1fr}:host([always-expanded-on-desktop]) mq-text-button{display:none}:host([always-expanded-on-desktop]) .header{margin-bottom:var(--sp-4)}}`;let g=class ProfessionalOverview extends p{constructor(){super(...arguments),this.alwaysExpandedOnDesktop=!1,this.detailsExpanded=!1}static{this.styles=m}render(){const t=_().replace("_","-"),e=this.languages.map(e=>l`<span class="language-pill">${new Intl.DisplayNames(t,{type:"language"}).of(e)}</span>`);return l`<div class="header ${this.detailsExpanded?"expanded":""}"><mq-avatar src="${this.avatar}" fallback="${this.name}" alt="${this.name}" size="lg"></mq-avatar><div class="professional-info"><h2 class="professional-name">${this.name}</h2>${this.specialtyName?l`<p class="professional-specialty">${this.specialtyName}</p>`:c}<mq-text-button type="button" size="sm" fontWeight="bold" @click="${()=>{this.detailsExpanded=!this.detailsExpanded}}">${this.detailsExpanded?o("Ocultar detalles"):o("Ver detalles")} ${h({size:24,className:"icon "+(this.detailsExpanded?"rotate-180":"")})}</mq-text-button></div></div><div class="details" data-expanded="${this.detailsExpanded}"><div class="details-content"><div class="languages">${e}</div>${this.collegiateNumber?l`<p class="collegiate-number">${o(s`Nº COL. ${this.collegiateNumber}`)}</p>`:c}<p class="description">${this.description}</p></div></div>`}};i([d({type:String})],g.prototype,"name",void 0),i([d({type:String})],g.prototype,"specialtyName",void 0),i([d({type:String})],g.prototype,"collegiateNumber",void 0),i([d({type:String})],g.prototype,"description",void 0),i([d({type:Array})],g.prototype,"languages",void 0),i([d({type:String})],g.prototype,"avatar",void 0),i([d({type:Boolean,reflect:!0,attribute:"always-expanded-on-desktop"})],g.prototype,"alwaysExpandedOnDesktop",void 0),i([u()],g.prototype,"detailsExpanded",void 0),g=i([a(),n("professional-overview")],g);var f={digestive_system:{de_DE:"Verdauungssystem",en_US:"Digestive System",es_ES:"Aparato Digestivo",ca_ES:"Aparell Digestiu",pt_PT:"Aparelho Digestivo"},orthopedic_surgery_traumatology:{de_DE:"Traumatologie und Orthopädische Chirurgie",en_US:"Traumatology and Orthopedic Surgery",es_ES:"Traumatología y Cirugía Ortopédica",ca_ES:"Traumatologia i Cirurgia Ortopèdica",pt_PT:"Traumatologia e Cirurgia Ortopédica"},gynecology:{de_DE:"Gynäkologie",en_US:"Gynecology",es_ES:"Ginecología",ca_ES:"Ginecologia",pt_PT:"Ginecologia"},endocrinology:{de_DE:"Endokrinologie",en_US:"Endocrinology",es_ES:"Endocrinología",ca_ES:"Endocrinologia",pt_PT:"Endocrinologia"},psychiatry:{de_DE:"Psychiatrie",en_US:"Psychiatry",es_ES:"Psiquiatría",ca_ES:"Psiquiatria",pt_PT:"Psiquiatria"}},x={videocall:{de_DE:"Videosprechstunde",en_US:"Videocall",es_ES:"Videoconsulta",ca_ES:"Videoconsulta",pt_PT:"Videoconsulta"},phonecall:{de_DE:"Telefonische Behandlung",en_US:"Phone consultation",es_ES:"Consulta telefónica",ca_ES:"Consulta telefònica",pt_PT:"Consulta telefónica"}},b={de_DE:"Konsultationspreis",en_US:"Consultation price",es_ES:"Precio de consulta",ca_ES:"Preu de consulta",pt_PT:"Preço da consulta"},w={videocall:"videocall",phonecall:"phonecall",adeslas_videocall:"videocall",adeslas_prod_videocall:"videocall",adeslas_phonecall:"phonecall",adeslas_prod_phonecall:"phonecall"};function E(t,e,a){if(!t)return a??"";const i=w[t];return i?x[i][e]:a??b[e]}var S={consulta_telefonica:"phonecall",videoconsulta:"videocall"},k={"aparato-digestivo":"digestive_system","cirugia-ortopedica-y-traumatologia":"orthopedic_surgery_traumatology",ginecologia:"gynecology",endocrinologia:"endocrinology",psiquiatria:"psychiatry"};function T(t,e,a){const i=a?.trim();if(i)return i;const n=f[t]?.[e];return void 0!==n?n:t}function P(t,e){return{action_type:"event",event_type:"access to videocall button click",patient_hash:t,id_appointment:e}}function q(t,e){return{action_type:"event",event_type:"open chat button click",patient_hash:t,id_appointment:e}}function $(t,e){return{action_type:"event",event_type:"modify appoinment button click",patient_hash:t,id_appointment:e}}function D(t,e){return{action_type:"event",event_type:"cancel appoinment button click",patient_hash:t,id_appointment:e}}function z(t,e){return{action_type:"event",event_type:"view appointment document list button click",patient_hash:t,id_appointment:e}}function C(t,e){return{action_type:"event",event_type:"repeat appointment button click",patient_hash:t,id_appointment:e}}function O(t,e){return{action_type:"event",event_type:"open chat button click",patient_hash:t,id_appointment:e}}function j(t,e){return{action_type:"event",event_type:"access to videocall button click",patient_hash:t,id_appointment:e}}function K(t,e){return{action_type:"event",event_type:"add to calendar button click",patient_hash:t,id_appointment:e}}function N(t,e){return{action_type:"pageview",event_type:"appointment success page view",patient_hash:t,id_appointment:e}}function U(t,e){return{action_type:"event",event_type:"open chat button click",patient_hash:t,id_appointment:e}}function A(t,e){return{action_type:"event",event_type:"update documentation",patient_hash:t,id_appointment:e}}function V(t,e){return{action_type:"pageview",event_type:"documentation page view",patient_hash:t,id_appointment:e}}function G(t,e,a){return{action_type:"event",event_type:"find availability button click",patient_hash:t,speciality_id:e,service_id:a}}function B(t,e,a,i,n,o,s){return{action_type:"debug",event_type:"find availability result",patient_hash:t,speciality_id:e,service_id:a,first_slot_date:i,first_slot_professional_hash:n,total_professionals:o,total_slots:s}}function H(t,e,a,i,n){return{action_type:"event",event_type:"professional schedule slot button click",patient_hash:t,professional_hash:e,start_date:a,speciality_id:i,service_id:n}}function I(t,e,a,i){return{action_type:"event",event_type:"professional availability button click",patient_hash:t,professional_hash:e,speciality_id:a,service_id:i}}function M(t,e,a,i,n){return{action_type:"event",event_type:"confirm appointment button click",patient_hash:t,professional_hash:e,start_date:a,speciality_id:i,service_id:n}}function F(t){return{action_type:"pageview",event_type:"select professional step page view",patient_hash:t}}function J(t,e){return{action_type:"pageview",event_type:"not time yet pageview",patient_hash:t,id_appointment:e}}function L(t,e){return{action_type:"event",event_type:"open chat button click",patient_hash:t,id_appointment:e}}function W(t,e){return{action_type:"pageview",event_type:"waiting room pageview",patient_hash:t,id_appointment:e}}function Q(t,e){return{action_type:"pageview",event_type:"videocall pageview",patient_hash:t,id_appointment:e}}class HttpTransport{endpoint;apiKey;constructor(t,e){this.endpoint=t,this.apiKey=e}send(t){fetch(this.endpoint,{method:"POST",headers:{"Content-Type":"application/json","x-api-key":this.apiKey},body:JSON.stringify(t)}).catch(()=>{})}}class MediquoTelemetryClient{_apiKey=null;_transport=null;setApiKey(t){this._apiKey=t,this._buildTransport()}track(t){null!==this._transport&&this._transport.send(t)}_buildTransport(){null!==this._apiKey&&(this._transport=new HttpTransport("https://tracking.____.mediquo.com/sdk",this._apiKey))}}const R=new class AppTelemetryClient extends MediquoTelemetryClient{track(t){}};export{H as A,I as B,B as C,F as D,g as P,S,y as a,N as b,T as c,K as d,O as e,j as f,v as g,$ as h,D as i,C as j,P as k,z as l,q as m,L as n,W as o,Q as p,V as q,A as r,U as s,R as t,k as u,J as v,E as w,M as x,G as y,f as z};
package/dist/env.d.ts ADDED
@@ -0,0 +1,21 @@
1
+ type Env = "development" | "production";
2
+ type Envs = Readonly<{
3
+ MODE: Env;
4
+ OPENTOK_API_KEY: string;
5
+ ASSETS_BASE_URL: string;
6
+ MQ_DEFAULT_ENV: Env;
7
+ MQ_ELEMENTS_VERSION: string;
8
+ }>;
9
+ /** Base URL for `@mediquo/elements` assets. */
10
+ declare const ASSETS_BASE_URL = "https://mediquo-landing.s3.eu-central-1.amazonaws.com/sdk-web/elements";
11
+ declare const env: Readonly<{
12
+ MODE: Env;
13
+ OPENTOK_API_KEY: string;
14
+ ASSETS_BASE_URL: string;
15
+ MQ_DEFAULT_ENV: Env;
16
+ MQ_ELEMENTS_VERSION: string;
17
+ }>;
18
+ declare function setEnv(mode: Envs["MODE"]): void;
19
+
20
+ export { ASSETS_BASE_URL, env, setEnv };
21
+ export type { Env };
package/dist/env.js ADDED
@@ -0,0 +1 @@
1
+ const E="https://mediquo-landing.s3.eu-central-1.amazonaws.com/sdk-web/elements",o="production",e="0.3.1",n={development:{MODE:"development",MQ_DEFAULT_ENV:o,MQ_ELEMENTS_VERSION:e,OPENTOK_API_KEY:"47836441",ASSETS_BASE_URL:E},production:{MODE:"production",MQ_DEFAULT_ENV:o,MQ_ELEMENTS_VERSION:e,OPENTOK_API_KEY:"46655102",ASSETS_BASE_URL:E}};let t=o;const _=new Proxy({},{get:(E,o)=>n[t??"production"][o]});function S(E){t=E}export{E as ASSETS_BASE_URL,_ as env,S as setEnv};
@@ -0,0 +1,141 @@
1
+ /**
2
+ * Public event contract for `@mediquo/elements`.
3
+ *
4
+ * Model: **one callback event per action**. A component emits an event
5
+ * describing *what the user did* — never *where to navigate*. The integrator
6
+ * decides navigation by adding a listener per action it cares about. There is
7
+ * no umbrella `MqNavigateEvent` and no central route vocabulary, so every
8
+ * component stays usable in isolation.
9
+ *
10
+ * Convention (matches `@mediquo/web-components`): a class extending `Event`,
11
+ * with a `static eventName`, dispatched `{ bubbles: true, composed: true }`.
12
+ * All names are `mq-*` prefixed to keep the published contract collision-free.
13
+ *
14
+ * The `HTMLElementEventMap` augmentation at the bottom gives hosts a single
15
+ * typed surface (autocomplete + checking on `addEventListener`), recovering the
16
+ * type-safety the discarded discriminated-union event used to provide.
17
+ */
18
+ /** Which tab of the appointments list the host should land on. */
19
+ type MqAppointmentsTab = "next" | "history";
20
+ /**
21
+ * Generic "back" chrome, emitted by the presentational `back-link` primitive.
22
+ *
23
+ * `back-link` knows nothing about routes. When a back action has a *semantic*
24
+ * destination (go home, view appointments on a given tab), the feature
25
+ * component emits the corresponding named event below instead of leaning on
26
+ * this one. `source` is an optional discriminator so that a single listener on
27
+ * a common ancestor can still tell emitters apart under composition, where
28
+ * `composed: true` retargets `event.target` to the outer host.
29
+ */
30
+ declare class MqBackEvent extends Event {
31
+ readonly detail: {
32
+ source?: string;
33
+ };
34
+ static eventName: string;
35
+ constructor(detail?: {
36
+ source?: string;
37
+ });
38
+ }
39
+ /** The user asked to return to the home screen (from `mq-my-appointments`). */
40
+ declare class MqHomeEvent extends Event {
41
+ static eventName: string;
42
+ constructor();
43
+ }
44
+ /**
45
+ * The user asked to view their appointments list on a specific tab.
46
+ *
47
+ * Carries `tab` on purpose: the discriminator (finished consultation → history,
48
+ * upcoming → next) is only known at the emitting call-site and cannot be
49
+ * reconstructed by the host afterwards. Mirrors the existing
50
+ * `ViewAppointmentsEvent { tab }` precedent in `@mediquo/web-components`.
51
+ */
52
+ declare class MqViewAppointmentsEvent extends Event {
53
+ readonly detail: {
54
+ tab: MqAppointmentsTab;
55
+ };
56
+ static eventName: string;
57
+ constructor(detail: {
58
+ tab: MqAppointmentsTab;
59
+ });
60
+ }
61
+ /** The user asked to reschedule an appointment. */
62
+ declare class MqAppointmentRescheduleEvent extends Event {
63
+ readonly detail: {
64
+ appointmentId: string;
65
+ };
66
+ static eventName: string;
67
+ constructor(detail: {
68
+ appointmentId: string;
69
+ });
70
+ }
71
+ /** The user asked to book a new appointment (optionally pre-filtered). */
72
+ declare class MqAppointmentBookEvent extends Event {
73
+ readonly detail: {
74
+ specialty?: string;
75
+ service?: string;
76
+ professional?: string;
77
+ };
78
+ static eventName: string;
79
+ constructor(detail?: {
80
+ specialty?: string;
81
+ service?: string;
82
+ professional?: string;
83
+ });
84
+ }
85
+ /** The user asked to join the videocall of an appointment. */
86
+ declare class MqAppointmentJoinVideocallEvent extends Event {
87
+ readonly detail: {
88
+ appointmentId: string;
89
+ };
90
+ static eventName: string;
91
+ constructor(detail: {
92
+ appointmentId: string;
93
+ });
94
+ }
95
+ /**
96
+ * The user asked to open an appointment's documentation.
97
+ *
98
+ * Folded into the `mq-appointment-*` family (was `goto-documentation` in
99
+ * `@mediquo/web-components`) so the action inventory is complete and the
100
+ * naming is consistent across the contract.
101
+ */
102
+ declare class MqAppointmentViewDocumentationEvent extends Event {
103
+ readonly detail: {
104
+ appointmentId: string;
105
+ };
106
+ static eventName: string;
107
+ constructor(detail: {
108
+ appointmentId: string;
109
+ });
110
+ }
111
+ /**
112
+ * Request to download a file (url + filename). Shared across the package
113
+ * (emitted by chat-room / videocall), so it lives in the events contract
114
+ * rather than colocated in a single feature.
115
+ */
116
+ declare class DownloadFileEvent extends Event {
117
+ readonly detail: {
118
+ url: string;
119
+ filename: string;
120
+ };
121
+ static eventName: string;
122
+ constructor(detail: {
123
+ url: string;
124
+ filename: string;
125
+ });
126
+ }
127
+ declare global {
128
+ interface HTMLElementEventMap {
129
+ "mq-back": MqBackEvent;
130
+ "mq-home": MqHomeEvent;
131
+ "mq-view-appointments": MqViewAppointmentsEvent;
132
+ "mq-appointment-reschedule": MqAppointmentRescheduleEvent;
133
+ "mq-appointment-book": MqAppointmentBookEvent;
134
+ "mq-appointment-join-videocall": MqAppointmentJoinVideocallEvent;
135
+ "mq-appointment-view-documentation": MqAppointmentViewDocumentationEvent;
136
+ "mq-download-file": DownloadFileEvent;
137
+ }
138
+ }
139
+
140
+ export { DownloadFileEvent, MqAppointmentBookEvent, MqAppointmentJoinVideocallEvent, MqAppointmentRescheduleEvent, MqAppointmentViewDocumentationEvent, MqBackEvent, MqHomeEvent, MqViewAppointmentsEvent };
141
+ export type { MqAppointmentsTab };
package/dist/events.js ADDED
@@ -0,0 +1 @@
1
+ class MqBackEvent extends Event{static{this.eventName="mq-back"}constructor(e={}){super(MqBackEvent.eventName,{bubbles:!0,composed:!0}),this.detail=e}}class MqHomeEvent extends Event{static{this.eventName="mq-home"}constructor(){super(MqHomeEvent.eventName,{bubbles:!0,composed:!0})}}class MqViewAppointmentsEvent extends Event{static{this.eventName="mq-view-appointments"}constructor(e){super(MqViewAppointmentsEvent.eventName,{bubbles:!0,composed:!0}),this.detail=e}}class MqAppointmentRescheduleEvent extends Event{static{this.eventName="mq-appointment-reschedule"}constructor(e){super(MqAppointmentRescheduleEvent.eventName,{bubbles:!0,composed:!0}),this.detail=e}}class MqAppointmentBookEvent extends Event{static{this.eventName="mq-appointment-book"}constructor(e={}){super(MqAppointmentBookEvent.eventName,{bubbles:!0,composed:!0}),this.detail=e}}class MqAppointmentJoinVideocallEvent extends Event{static{this.eventName="mq-appointment-join-videocall"}constructor(e){super(MqAppointmentJoinVideocallEvent.eventName,{bubbles:!0,composed:!0}),this.detail=e}}class MqAppointmentViewDocumentationEvent extends Event{static{this.eventName="mq-appointment-view-documentation"}constructor(e){super(MqAppointmentViewDocumentationEvent.eventName,{bubbles:!0,composed:!0}),this.detail=e}}class DownloadFileEvent extends Event{static{this.eventName="mq-download-file"}constructor(e){super(DownloadFileEvent.eventName,{bubbles:!0,composed:!0}),this.detail=e}}export{DownloadFileEvent,MqAppointmentBookEvent,MqAppointmentJoinVideocallEvent,MqAppointmentRescheduleEvent,MqAppointmentViewDocumentationEvent,MqBackEvent,MqHomeEvent,MqViewAppointmentsEvent};
package/dist/i18n.d.ts ADDED
@@ -0,0 +1,11 @@
1
+ import z from 'zod';
2
+
3
+ declare const LocaleSchema: z.ZodEnum<["en_US", "pt_PT", "de_DE", "es_ES", "ca_ES"]>;
4
+ type Locale = z.infer<typeof LocaleSchema>;
5
+ declare function isValidLocale(locale: string): locale is Locale;
6
+ declare function initLocalization(): void;
7
+ declare function setLocale(locale: Locale): Promise<void>;
8
+ declare function getLocale(): Locale;
9
+
10
+ export { getLocale, initLocalization, isValidLocale, setLocale };
11
+ export type { Locale };
package/dist/i18n.js ADDED
@@ -0,0 +1 @@
1
+ import{c as e}from"./chunks/runtime-Bg1WXVCx.js";import{z as t,l as n}from"./chunks/external-zAbuzxDj.js";const c=["ca_ES","de_DE","en_US","pt_PT"],s=t.enum(["en_US","pt_PT","de_DE","es_ES","ca_ES"]);function a(e){return s.safeParse(e).success}const o="__mqElementsLocalization__";function i(){const e=globalThis;return e[o]||(e[o]={initialized:!1}),e[o]}function r(){const t=i();if(!t.initialized){t.initialized=!0;try{const{setLocale:n,getLocale:s}=e({sourceLocale:"es_ES",targetLocales:c,loadLocale:async e=>{switch(e){case"en_US":default:return import("./chunks/en_US-BslWF9nj.js");case"pt_PT":return import("./chunks/pt_PT-CFbbWowX.js");case"de_DE":return import("./chunks/de_DE-CrwfSJnS.js");case"ca_ES":return import("./chunks/ca_ES-nttMFJzr.js")}}});t.setLocale=n,t.getLocale=s}catch(e){n.warn("Localization was already configured on this page.",e)}}}const u="Localization not initialized yet.";async function l(e){const{setLocale:t}=i();if(t)return t(e);n.warn(u)}function _(){const{getLocale:e}=i();return e?e():(n.warn(u),"es_ES")}export{_ as getLocale,r as initLocalization,a as isValidLocale,l as setLocale};
@@ -0,0 +1,5 @@
1
+ export { MqThemeProvider, ThemeName } from './mq-theme-provider.js';
2
+ export { DownloadFileEvent, MqAppointmentBookEvent, MqAppointmentJoinVideocallEvent, MqAppointmentRescheduleEvent, MqAppointmentViewDocumentationEvent, MqAppointmentsTab, MqBackEvent, MqHomeEvent, MqViewAppointmentsEvent } from './events.js';
3
+ export { d as defaultTheme } from './chunks/default-IpEn36CA.js';
4
+ import 'lit-html';
5
+ import 'lit';
package/dist/index.js ADDED
@@ -0,0 +1 @@
1
+ export{MqThemeProvider}from"./mq-theme-provider.js";export{DownloadFileEvent,MqAppointmentBookEvent,MqAppointmentJoinVideocallEvent,MqAppointmentRescheduleEvent,MqAppointmentViewDocumentationEvent,MqBackEvent,MqHomeEvent,MqViewAppointmentsEvent}from"./events.js";export{defaultTheme}from"./theme.js";import"./chunks/custom-element-DA9Fxvxd.js";import"./chunks/lit-element-DiWJYFwC.js";import"./chunks/property-scuRaFcM.js";import"./chunks/state-LQivXIgA.js";import"./chunks/ensure-context-root-DbdqwnKB.js";import"./chunks/context-request-event-Dfydf1ub.js";
@@ -0,0 +1,82 @@
1
+ import * as lit from 'lit';
2
+ import { LitElement, PropertyValues } from 'lit';
3
+ import { Env } from './env.js';
4
+ import { Locale } from './i18n.js';
5
+ import 'zod';
6
+
7
+ declare class ApplePayCheckoutSuccessEvent extends Event {
8
+ readonly detail: {
9
+ sessionId: string;
10
+ reference: string;
11
+ };
12
+ static eventName: string;
13
+ constructor(detail: {
14
+ sessionId: string;
15
+ reference: string;
16
+ });
17
+ }
18
+ declare class ApplePayCheckoutDeniedEvent extends Event {
19
+ readonly detail: {
20
+ sessionId: string;
21
+ };
22
+ static eventName: string;
23
+ constructor(detail: {
24
+ sessionId: string;
25
+ });
26
+ }
27
+ type ApplePayCheckoutErrorReason = "auth" | "unsupported" | "merchant" | "authorize" | "cancelled";
28
+ declare class ApplePayCheckoutErrorEvent extends Event {
29
+ readonly detail: {
30
+ reason: ApplePayCheckoutErrorReason;
31
+ };
32
+ static eventName: string;
33
+ constructor(detail: {
34
+ reason: ApplePayCheckoutErrorReason;
35
+ });
36
+ }
37
+ /**
38
+ * Apple Pay checkout for top-level pages on a domain verified with Apple.
39
+ * The host must load the pinned Apple Pay JS SDK before mounting this element.
40
+ *
41
+ * @fires payment-success - Payment authorized. Detail: `{ sessionId, reference }`.
42
+ * @fires payment-denied - Payment rejected by the backend. Detail: `{ sessionId }`.
43
+ * @fires payment-error - Auth, unsupported device, merchant validation or authorization failure. Detail: `{ reason }`.
44
+ */
45
+ declare class MqApplePayCheckout extends LitElement {
46
+ static styles: lit.CSSResult;
47
+ env?: Env;
48
+ apiKey: string;
49
+ token: string;
50
+ locale: Locale;
51
+ /** Apple Pay merchant identifier (`merchant.com…`). Required for availability checks. */
52
+ merchantId: string;
53
+ /** Backend order id (same as the integrator's `session_id`). */
54
+ sessionId: string;
55
+ amount: string;
56
+ currency: string;
57
+ country: string;
58
+ label: string;
59
+ private _availabilityPhase;
60
+ private _showQrHelper;
61
+ private _paying;
62
+ /** Suppresses `oncancel` after we already reported an error and called `abort()`. */
63
+ private _suppressCancelEvent;
64
+ /** Ignores stale results from overlapping availability checks. */
65
+ private _availabilityGeneration;
66
+ private _loginTokenTask;
67
+ protected willUpdate(changed: PropertyValues<this>): void;
68
+ private _refreshAvailability;
69
+ private get _resolvedLocale();
70
+ private _buildPaymentRequest;
71
+ private _onPayClick;
72
+ private _renderUnavailable;
73
+ render(): unknown;
74
+ }
75
+ declare global {
76
+ interface HTMLElementTagNameMap {
77
+ "mq-apple-pay-checkout": MqApplePayCheckout;
78
+ }
79
+ }
80
+
81
+ export { ApplePayCheckoutDeniedEvent, ApplePayCheckoutErrorEvent, ApplePayCheckoutSuccessEvent, MqApplePayCheckout };
82
+ export type { ApplePayCheckoutErrorReason };
@@ -0,0 +1 @@
1
+ import{_ as e,t}from"./chunks/custom-element-DA9Fxvxd.js";import{m as a}from"./chunks/runtime-Bg1WXVCx.js";import{l as s}from"./chunks/parseISO-jT42c8Ob.js";import{L as i}from"./chunks/login-token-task-BI-L2zSV.js";import{l as n}from"./chunks/external-zAbuzxDj.js";import{i as o,a as r,x as p}from"./chunks/lit-element-DiWJYFwC.js";import{n as l}from"./chunks/property-scuRaFcM.js";import{r as c}from"./chunks/state-LQivXIgA.js";import{setEnv as h}from"./env.js";import{initLocalization as u,isValidLocale as y,setLocale as d}from"./i18n.js";import{a as m}from"./chunks/api-chat-client-BTBtu01T.js";import{u as v,s as b,r as f}from"./chunks/apple-pay-outcomes-BlytM6W-.js";import"./chunks/task-Bj8p7kJX.js";import"./chunks/format-Cm3B1GMy.js";import"./chunks/isBefore-Cof0D841.js";function k(){if("undefined"==typeof navigator)return!1;const e=navigator.userAgent;return/Safari/i.test(e)&&!/Chrome|Chromium|Edg|OPR|Firefox|FxiOS/i.test(e)}async function P(e){if("undefined"==typeof window||!window.isSecureContext)return{available:!1,reason:"unsupported"};if(!function(){if("undefined"==typeof window)return!1;const e="undefined"!=typeof ApplePaySession&&"function"==typeof ApplePaySession.canMakePayments,t="undefined"!=typeof customElements&&void 0!==customElements.get("apple-pay-button");return e&&t}())return{available:!1,reason:"sdk-missing"};if(!e.trim())return{available:!1,reason:"merchant-id-missing"};const t=ApplePaySession;if(function(e){return"function"==typeof e.applePayCapabilities}(t))try{return function(e){switch(e){case"applePayUnsupported":return{available:!1,reason:"unsupported"};case"paymentCredentialsUnavailable":case"paymentCredentialsAvailable":case"paymentCredentialStatusUnknown":return{available:!0,usesQrFlow:!k()}}}((await t.applePayCapabilities(e)).paymentCredentialStatus)}catch{return t.canMakePayments()?{available:!0,usesQrFlow:!k()}:{available:!1,reason:"unsupported"}}return t.canMakePayments()?{available:!0,usesQrFlow:!k()}:{available:!1,reason:"unsupported"}}const g={es_ES:"es-ES",en_US:"en-US",pt_PT:"pt-PT",de_DE:"de-DE",ca_ES:"ca-ES"};try{u()}catch{}const E=["visa","masterCard","amex"],_=["supports3DS"],S=o`:host{display:flex;flex-direction:column;align-items:stretch;justify-content:center;gap:12px;width:100%;min-height:48px}.helper{margin:0;text-align:center;font-family:system-ui,sans-serif;font-size:13px;line-height:1.4;color:#6e6e73}.pay-row{display:block;width:100%}.pay-row--paying{opacity:.55;pointer-events:none}apple-pay-button{--apple-pay-button-width:100%;--apple-pay-button-height:48px;--apple-pay-button-border-radius:10px;--apple-pay-button-padding:0;display:block;width:100%;min-height:48px;cursor:pointer}.state{text-align:center;font-family:system-ui,sans-serif;font-size:15px;color:#86868b;margin:0}`;class ApplePayCheckoutSuccessEvent extends Event{static{this.eventName="payment-success"}constructor(e){super(ApplePayCheckoutSuccessEvent.eventName,{bubbles:!0,composed:!0}),this.detail=e}}class ApplePayCheckoutDeniedEvent extends Event{static{this.eventName="payment-denied"}constructor(e){super(ApplePayCheckoutDeniedEvent.eventName,{bubbles:!0,composed:!0}),this.detail=e}}class ApplePayCheckoutErrorEvent extends Event{static{this.eventName="payment-error"}constructor(e){super(ApplePayCheckoutErrorEvent.eventName,{bubbles:!0,composed:!0}),this.detail=e}}function A(e,t){n.warn(e,{error:t instanceof Error?t.message:String(t)})}let w=class MqApplePayCheckout extends r{constructor(){super(...arguments),this._availabilityPhase="checking",this._showQrHelper=!1,this._paying=!1,this._suppressCancelEvent=!1,this._availabilityGeneration=0,this._loginTokenTask=new i(this,m,{args:()=>[this.apiKey,this.token],onComplete:e=>{m.setAuthToken(e.access_token),this._refreshAvailability()},onError:()=>{this.dispatchEvent(new ApplePayCheckoutErrorEvent({reason:"auth"}))}}),this._onPayClick=()=>{if(this._paying||"ready"!==this._availabilityPhase)return;let e;try{e=new ApplePaySession(3,this._buildPaymentRequest())}catch(e){return A("mq-apple-pay-checkout: failed to create ApplePaySession",e),void this.dispatchEvent(new ApplePayCheckoutErrorEvent({reason:"unsupported"}))}this._paying=!0,this._suppressCancelEvent=!1,e.onvalidatemerchant=async t=>{try{const a=await m.payments.validateApplePayMerchant({order_id:this.sessionId,validation_url:t.validationURL});e.completeMerchantValidation(v(a))}catch(t){A("mq-apple-pay-checkout: validate-merchant failed",t),this._suppressCancelEvent=!0,this.dispatchEvent(new ApplePayCheckoutErrorEvent({reason:"merchant"})),e.abort(),this._paying=!1}},e.onpaymentauthorized=async t=>{try{const a=await m.payments.authorizeApplePay({order_id:this.sessionId,token:b(t.payment.token)}),{status:s,consultation_id:i}=a.data,n=f(s,i,this.sessionId);switch(n.kind){case"success":e.completePayment(ApplePaySession.STATUS_SUCCESS),this.dispatchEvent(new ApplePayCheckoutSuccessEvent({sessionId:n.sessionId,reference:n.reference}));break;case"denied":e.completePayment(ApplePaySession.STATUS_FAILURE),this.dispatchEvent(new ApplePayCheckoutDeniedEvent({sessionId:n.sessionId}));break;case"error":e.completePayment(ApplePaySession.STATUS_FAILURE),this.dispatchEvent(new ApplePayCheckoutErrorEvent({reason:n.reason}))}}catch(t){A("mq-apple-pay-checkout: authorize failed",t),e.completePayment(ApplePaySession.STATUS_FAILURE),this.dispatchEvent(new ApplePayCheckoutErrorEvent({reason:"authorize"}))}finally{this._paying=!1}},e.oncancel=()=>{this._paying=!1,this._suppressCancelEvent?this._suppressCancelEvent=!1:this.dispatchEvent(new ApplePayCheckoutErrorEvent({reason:"cancelled"}))};try{e.begin()}catch(e){A("mq-apple-pay-checkout: session.begin() failed",e),this._paying=!1,this.dispatchEvent(new ApplePayCheckoutErrorEvent({reason:"unsupported"}))}}}static{this.styles=S}willUpdate(e){if(e.has("env")&&this.env&&h(this.env),e.has("apiKey")&&m.setApiKey(this.apiKey),e.has("locale")){const e=y(this.locale)?this.locale:"es_ES";d(e),m.setLanguage(e)}e.has("merchantId")&&this._loginTokenTask.value&&this._refreshAvailability()}async _refreshAvailability(){const e=++this._availabilityGeneration;this._availabilityPhase="checking",this._showQrHelper=!1;const t=await P(this.merchantId??"");e===this._availabilityGeneration&&(t.available?(this._availabilityPhase="ready",this._showQrHelper=t.usesQrFlow):this._availabilityPhase="unavailable")}get _resolvedLocale(){return y(this.locale)?this.locale:"es_ES"}_buildPaymentRequest(){return{countryCode:this.country,currencyCode:this.currency,supportedNetworks:[...E],merchantCapabilities:[..._],total:{label:this.label,amount:this.amount}}}_renderUnavailable(){return this.merchantId?.trim()?"undefined"==typeof ApplePaySession?p`<p class="state">${a("No se ha podido cargar Apple Pay. Comprueba la configuración del sitio e inténtalo de nuevo.")}</p>`:p`<p class="state">${a("Apple Pay no está disponible")}</p>`:p`<p class="state">${a("Falta el identificador de comercio de Apple Pay")}</p>`}render(){return this._loginTokenTask.render({pending:()=>p`<p class="state">${a("Preparando Apple Pay…")}</p>`,error:()=>p`<p class="state">${a("No hemos podido iniciar el pago")}</p>`,complete:()=>{return"checking"===this._availabilityPhase?p`<p class="state">${a("Comprobando Apple Pay…")}</p>`:"unavailable"===this._availabilityPhase?this._renderUnavailable():p`${this._showQrHelper?p`<p class="helper">${a("Para pagar con Apple Pay, escanea el código QR con tu iPhone (iOS 18 o posterior) y confirma el pago.")}</p>`:null}<div class="pay-row ${this._paying?"pay-row--paying":""}"><apple-pay-button buttonstyle="black" type="pay" locale="${e=this._resolvedLocale,g[e]??"es-ES"}" aria-label="${a("Pagar con Apple Pay")}" @click="${this._onPayClick}"></apple-pay-button></div>`;var e}})}};e([l({type:String,attribute:"env"})],w.prototype,"env",void 0),e([l({type:String,attribute:"api-key"})],w.prototype,"apiKey",void 0),e([l({type:String,attribute:"token"})],w.prototype,"token",void 0),e([l({type:String,attribute:"locale",reflect:!0})],w.prototype,"locale",void 0),e([l({type:String,attribute:"merchant-id"})],w.prototype,"merchantId",void 0),e([l({type:String,attribute:"session-id"})],w.prototype,"sessionId",void 0),e([l({type:String,attribute:"amount"})],w.prototype,"amount",void 0),e([l({type:String,attribute:"currency"})],w.prototype,"currency",void 0),e([l({type:String,attribute:"country"})],w.prototype,"country",void 0),e([l({type:String,attribute:"label"})],w.prototype,"label",void 0),e([c()],w.prototype,"_availabilityPhase",void 0),e([c()],w.prototype,"_showQrHelper",void 0),e([c()],w.prototype,"_paying",void 0),w=e([s(),t("mq-apple-pay-checkout")],w);export{ApplePayCheckoutDeniedEvent,ApplePayCheckoutErrorEvent,ApplePayCheckoutSuccessEvent,w as MqApplePayCheckout};
@@ -0,0 +1,55 @@
1
+ import * as lit_html from 'lit-html';
2
+ import { C as CreatePaymentLinkRequest } from './chunks/schemas.d-BEA8Pl6w.js';
3
+ import { LitElement } from 'lit';
4
+ import { Env } from './env.js';
5
+ import { Locale } from './i18n.js';
6
+ import './mq-checkout.js';
7
+ import 'zod';
8
+ import './ui/mq-skeleton.js';
9
+
10
+ type PreconsultationDocument = NonNullable<CreatePaymentLinkRequest["preconsultation_documents"]>[number];
11
+ declare class AppointmentPaidEvent extends Event {
12
+ readonly detail: {
13
+ appointmentId: string;
14
+ };
15
+ static eventName: string;
16
+ constructor(detail: {
17
+ appointmentId: string;
18
+ });
19
+ }
20
+ /**
21
+ * Appointment-specific checkout. Creates a payment session from a `slot-id` +
22
+ * `service-id` via `createPaymentLink` and delegates the entire payment UX to
23
+ * the agnostic `<mq-checkout>`. Re-creation on retry is handled by `mq-checkout`
24
+ * calling the same `provideSession` factory again — no host wiring required.
25
+ *
26
+ * Must be rendered inside `<mq-theme-provider>`.
27
+ *
28
+ * @fires payment-success - Payment confirmed. Detail: `{ appointmentId }`.
29
+ * @fires payment-denied - Payment rejected. Bubbles from `<mq-checkout>`. Detail: `{ sessionId }`.
30
+ * @fires payment-error - Auth, session creation or timeout failure. Bubbles from `<mq-checkout>`. Detail: `{ reason }`.
31
+ */
32
+ declare class MqAppointmentCheckout extends LitElement {
33
+ env?: Env;
34
+ apiKey: string;
35
+ token: string;
36
+ locale: Locale;
37
+ slotId: string;
38
+ serviceId: string;
39
+ specialtyId: string;
40
+ consultationReason?: string;
41
+ /** Discount coupon code applied to the booking. The coupon UI lives in the host app. */
42
+ discountCode?: string;
43
+ /** Optional pre-consultation documents. Set as a JS property, not an attribute. */
44
+ preconsultationDocuments?: PreconsultationDocument[];
45
+ private _provideSession;
46
+ private _onSuccess;
47
+ render(): lit_html.TemplateResult<1>;
48
+ }
49
+ declare global {
50
+ interface HTMLElementTagNameMap {
51
+ "mq-appointment-checkout": MqAppointmentCheckout;
52
+ }
53
+ }
54
+
55
+ export { AppointmentPaidEvent, MqAppointmentCheckout };
@@ -0,0 +1 @@
1
+ import{_ as t,t as e}from"./chunks/custom-element-DA9Fxvxd.js";import{a as o,x as i}from"./chunks/lit-element-DiWJYFwC.js";import{n as s}from"./chunks/property-scuRaFcM.js";import{o as n}from"./chunks/if-defined-BYeVdwgd.js";import{a as p}from"./chunks/api-chat-client-BTBtu01T.js";import"./mq-checkout.js";import"./chunks/external-zAbuzxDj.js";import"./chunks/parseISO-jT42c8Ob.js";import"./chunks/runtime-Bg1WXVCx.js";import"./chunks/format-Cm3B1GMy.js";import"./chunks/isBefore-Cof0D841.js";import"./env.js";import"./chunks/task-Bj8p7kJX.js";import"./chunks/login-token-task-BI-L2zSV.js";import"./chunks/state-LQivXIgA.js";import"./theme.js";import"./i18n.js";import"./ui/mq-skeleton.js";import"./chunks/style-map-CIdqdn7C.js";import"./chunks/directive-2EDmOukv.js";class AppointmentPaidEvent extends Event{static{this.eventName="payment-success"}constructor(t){super(AppointmentPaidEvent.eventName,{bubbles:!0,composed:!0}),this.detail=t}}let r=class MqAppointmentCheckout extends o{constructor(){super(...arguments),this._provideSession=async()=>{const t=await p.payments.createPaymentLink({slot_id:this.slotId,service_id:this.serviceId,specialty_id:this.specialtyId,consultation_reason:this.consultationReason,discount_code:this.discountCode,preconsultation_documents:this.preconsultationDocuments});return{sessionId:t.session_id,paymentUrl:t.payment_link}},this._onSuccess=t=>{t.stopPropagation(),this.dispatchEvent(new AppointmentPaidEvent({appointmentId:t.detail.reference}))}}render(){return i`<mq-checkout env="${n(this.env)}" api-key="${this.apiKey}" token="${this.token}" locale="${this.locale}" .provideSession="${this._provideSession}" @payment-success="${this._onSuccess}"></mq-checkout>`}};t([s({type:String,attribute:"env"})],r.prototype,"env",void 0),t([s({type:String,attribute:"api-key"})],r.prototype,"apiKey",void 0),t([s({type:String,attribute:"token"})],r.prototype,"token",void 0),t([s({type:String,attribute:"locale",reflect:!0})],r.prototype,"locale",void 0),t([s({type:String,attribute:"slot-id"})],r.prototype,"slotId",void 0),t([s({type:String,attribute:"service-id"})],r.prototype,"serviceId",void 0),t([s({type:String,attribute:"specialty-id"})],r.prototype,"specialtyId",void 0),t([s({type:String,attribute:"consultation-reason"})],r.prototype,"consultationReason",void 0),t([s({type:String,attribute:"discount-code"})],r.prototype,"discountCode",void 0),t([s({attribute:!1})],r.prototype,"preconsultationDocuments",void 0),r=t([e("mq-appointment-checkout")],r);export{AppointmentPaidEvent,r as MqAppointmentCheckout};
@@ -0,0 +1,20 @@
1
+ export { M as MqChatRoom } from './chunks/mq-chat-room-DuG4RuIp.js';
2
+ import 'lit-html';
3
+ import 'lit';
4
+ import './ui/mq-avatar.js';
5
+ import './ui/mq-button.js';
6
+ import './ui/mq-skeleton.js';
7
+ import 'zod';
8
+ import './chunks/appointment.model.d-Dy50gMPg.js';
9
+ import '@tanstack/query-core';
10
+
11
+ declare class MqChatRoomCloseEvent extends Event {
12
+ static eventName: string;
13
+ constructor();
14
+ }
15
+ declare class MqChatRoomProfileEvent extends Event {
16
+ static eventName: string;
17
+ constructor();
18
+ }
19
+
20
+ export { MqChatRoomCloseEvent, MqChatRoomProfileEvent };
@@ -0,0 +1 @@
1
+ export{M as MqChatRoom,b as MqChatRoomCloseEvent,c as MqChatRoomProfileEvent}from"./chunks/exports-XZaVrMLd.js";import"./chunks/custom-element-DA9Fxvxd.js";import"./chunks/provide-CfT7g_Zi.js";import"./chunks/context-provider-CiMFpvDA.js";import"./chunks/context-request-event-Dfydf1ub.js";import"./chunks/mutation-controller-OVT8NEt6.js";import"./chunks/query-QJ1INUTG.js";import"./chunks/parseISO-jT42c8Ob.js";import"./chunks/runtime-Bg1WXVCx.js";import"./chunks/lit-element-DiWJYFwC.js";import"./chunks/property-scuRaFcM.js";import"./chunks/state-LQivXIgA.js";import"./theme.js";import"./chunks/api-chat-client-BTBtu01T.js";import"./chunks/external-zAbuzxDj.js";import"./chunks/format-Cm3B1GMy.js";import"./chunks/isBefore-Cof0D841.js";import"./env.js";import"./ui/icons/x-icon.js";import"./ui/icons/types.js";import"./ui/mq-avatar.js";import"./chunks/class-map-Co76I6aw.js";import"./chunks/directive-2EDmOukv.js";import"./ui/mq-button.js";import"./ui/mq-skeleton.js";import"./chunks/style-map-CIdqdn7C.js";import"./chunks/if-defined-BYeVdwgd.js";import"./ui/icons/chevron-left-icon.js";import"./chunks/query-CeeutdfT.js";import"./events.js";import"./ui/icons/check-double-icon.js";import"./ui/icons/check-icon.js";import"./i18n.js";import"./chunks/chunk-YTQUGGS3-DN-JZpgG.js";
@@ -0,0 +1,108 @@
1
+ import * as lit_html from 'lit-html';
2
+ import * as lit from 'lit';
3
+ import { LitElement, PropertyValues } from 'lit';
4
+ import { Env } from './env.js';
5
+ import { Locale } from './i18n.js';
6
+ import './ui/mq-skeleton.js';
7
+ import 'zod';
8
+
9
+ /** The minimal session contract `mq-checkout` needs to render the gateway. */
10
+ interface CheckoutSession {
11
+ /** Identifier used to poll the payment status. */
12
+ sessionId: string;
13
+ /** Fully-qualified URL of the payment portal embedded in the iframe. */
14
+ paymentUrl: string;
15
+ }
16
+ /** Async factory the host supplies to create (and re-create, on retry) a session. */
17
+ type ProvideSession = () => Promise<CheckoutSession>;
18
+ declare class CheckoutSuccessEvent extends Event {
19
+ readonly detail: {
20
+ sessionId: string;
21
+ reference: string;
22
+ };
23
+ static eventName: string;
24
+ constructor(detail: {
25
+ sessionId: string;
26
+ reference: string;
27
+ });
28
+ }
29
+ declare class CheckoutDeniedEvent extends Event {
30
+ readonly detail: {
31
+ sessionId: string;
32
+ };
33
+ static eventName: string;
34
+ constructor(detail: {
35
+ sessionId: string;
36
+ });
37
+ }
38
+ type CheckoutErrorReason = "auth" | "session" | "timeout";
39
+ declare class CheckoutErrorEvent extends Event {
40
+ readonly detail: {
41
+ reason: CheckoutErrorReason;
42
+ };
43
+ static eventName: string;
44
+ constructor(detail: {
45
+ reason: CheckoutErrorReason;
46
+ });
47
+ }
48
+ declare class CheckoutRetryEvent extends Event {
49
+ static eventName: string;
50
+ constructor();
51
+ }
52
+ /**
53
+ * Use-case agnostic payment gateway. Embeds the Mediquo payment portal in an
54
+ * iframe, polls the backend for completion and surfaces the outcome through
55
+ * generic events. It knows nothing about appointments — the host provides a
56
+ * `provideSession` callback that returns `{ sessionId, paymentUrl }`, which the
57
+ * component invokes for the initial load and again on every retry, so retries
58
+ * are transparent to the integrator.
59
+ *
60
+ * Must be rendered inside `<mq-theme-provider>`.
61
+ *
62
+ * @fires payment-success - Payment confirmed (status === "paid"). Detail: `{ sessionId, reference }`.
63
+ * @fires payment-denied - Payment rejected (status === "denied"). Detail: `{ sessionId }`.
64
+ * @fires payment-error - Auth, session creation or polling timeout failure. Detail: `{ reason }`.
65
+ * @fires payment-retry - Notification only — the portal requested a retry. Re-creation is handled internally.
66
+ */
67
+ declare class MqCheckout extends LitElement {
68
+ static styles: lit.CSSResult[];
69
+ /**
70
+ * Backend environment. Applied before authentication, so set it once at
71
+ * mount — changing it later rebuilds the API client and drops the session.
72
+ */
73
+ env?: Env;
74
+ apiKey: string;
75
+ token: string;
76
+ locale: Locale;
77
+ /**
78
+ * Async factory returning the payment session. Set as a JS property
79
+ * (`el.provideSession = …` / `.provideSession=${…}`), never an attribute.
80
+ */
81
+ provideSession?: ProvideSession;
82
+ private _iframeLoaded;
83
+ private _iframeHeight;
84
+ private _sessionEpoch;
85
+ private _currentSessionId;
86
+ private _paymentOrigin;
87
+ private _loginTokenTask;
88
+ private _sessionTask;
89
+ private _paymentPoll;
90
+ get _timedOut(): boolean;
91
+ connectedCallback(): void;
92
+ disconnectedCallback(): void;
93
+ protected willUpdate(changed: PropertyValues<this>): void;
94
+ private _onIframeLoad;
95
+ private _onMessage;
96
+ private _renderState;
97
+ private _renderLoading;
98
+ private _renderFrame;
99
+ render(): lit_html.TemplateResult<1> | undefined;
100
+ }
101
+ declare global {
102
+ interface HTMLElementTagNameMap {
103
+ "mq-checkout": MqCheckout;
104
+ }
105
+ }
106
+
107
+ export { CheckoutDeniedEvent, CheckoutErrorEvent, CheckoutRetryEvent, CheckoutSuccessEvent, MqCheckout };
108
+ export type { CheckoutErrorReason, CheckoutSession, ProvideSession };