cas-ds-web-components 1.3.20 → 1.3.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/build/cas-booking-box.js
CHANGED
|
@@ -306,7 +306,7 @@
|
|
|
306
306
|
* @license
|
|
307
307
|
* Copyright 2018 Google LLC
|
|
308
308
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
309
|
-
*/const qt=ke(class extends Ee{constructor(n){var t;if(super(n),n.type!==we.ATTRIBUTE||n.name!=="class"||((t=n.strings)===null||t===void 0?void 0:t.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(n){return" "+Object.keys(n).filter(t=>n[t]).join(" ")+" "}update(n,[t]){var e,i;if(this.it===void 0){this.it=new Set,n.strings!==void 0&&(this.nt=new Set(n.strings.join(" ").split(/\s/).filter(a=>a!=="")));for(const a in t)t[a]&&!(!((e=this.nt)===null||e===void 0)&&e.has(a))&&this.it.add(a);return this.render(t)}const o=n.element.classList;this.it.forEach(a=>{a in t||(o.remove(a),this.it.delete(a))});for(const a in t){const s=!!t[a];s===this.it.has(a)||!((i=this.nt)===null||i===void 0)&&i.has(a)||(s?(o.add(a),this.it.add(a)):(o.remove(a),this.it.delete(a)))}return H}}),Se=[{name:"Consulta médica",items:[{name:"Consulta pediátrica",link:"https://www.clinicaalemana.cl/consulta-pediatrica-2026"},{name:"Presencial",link:"https://reserva.alemana.cl/reserva/portal/busqueda"},{name:"Teleconsulta",link:"https://agenda.clinicaalemana.cl/paciente"},{name:"TeleUrgencia",link:"https://www.clinicaalemana.cl/telemedicina/teleurgencia"},{name:"A domicilio",link:"https://www.clinicaalemana.cl/servicios-clinicos/servicios-a-domicilio"},{name:"Teledermatología",link:"https://teledermatologia.clinicaalemana.cl/"}]},{name:"Rehabilitación y bienestar",items:[{name:"Kinesiología",link:"https://agenda.clinicaalemana.cl/rehabilitacion-y-bienestar/seleccion-categoria"},{name:"Masoterapia",link:"https://agenda.clinicaalemana.cl/examenes-y-procedimientos/masoterapia/masoterapia-masaje-deportivo/disponibilidad"}]},{name:"Exámenes y procedimientos",items:[{name:"Presencial",link:"https://www.clinicaalemana.cl/examenes-y-procedimientos"}]},{name:"Vacunas",items:[{name:"Viajeros",link:"https://www.clinicaalemana.cl/especialidades/vacunatorio/reserva-vacuna-fiebre-amarilla"},{name:"TeleAsesoría pediátrica",link:"https://www.clinicaalemana.cl/especialidades/vacunatorio/asesoria-en-vacunacion-pediatrica"}]}],Ce=[{name:"Consulta médica",link:"https://reserva.clinicaalemana.cl/alemana-integral"},{name:"Exámenes y procedimientos",link:"https://www.clinicaalemana.cl/examenes-y-procedimientos"}],pt=Se,Wt=Ce;class V extends R{constructor(){super(),this.hidden=!1,this.tipoDeAtencion="",this.tipoDeAtencionIntegral="",this.modalidad="",this.dataTipoDeAtencion=[],this.dataModalidad=[],this.opcionSelecionada="Paciente",this.focused=!1,this.refresh=!1,this.link=""}changeHandler(t){var i,o;const e=t.target.name;if(this[e]=t.composedPath()[0].value,this.handleErrorTipoDeAtencion(!1),this.handleErrorModalidad(!1),e==="tipoDeAtencionIntegral"&&(this.tipoDeAtencion="",this.modalidad=""),e==="tipoDeAtencion"){this.modalidad="",this.refresh=!0,this.handleFocusModalidad(!0),this.handleFocusTipoDeAtencion(!1);const a=((o=(i=pt.find(s=>s.name===this.tipoDeAtencion))==null?void 0:i.items)==null?void 0:o.map(s=>s.name))||[];t.target.value==="Consulta pediátrica"&&this.handleLink(),this.dataModalidad=[...a],this.requestUpdate(),setTimeout(()=>{this.refresh=!1,this.requestUpdate()},100)}e==="modalidad"&&this.handleFocusModalidad(!1),this.handleLink()}handleFocusTipoDeAtencion(t){const e=this.shadowRoot.getElementById("tipoDeAtencion");e==null||e.setAttribute("active",t)}handleFocusModalidad(t){const e=this.shadowRoot.getElementById("modalidad");e==null||e.setAttribute("active",t)}handleErrorTipoDeAtencion(t){const e=this.shadowRoot.getElementById("tipoDeAtencion");t?e==null||e.setAttribute("isSelectError",!0):e==null||e.removeAttribute("isSelectError")}handleErrorModalidad(t){const e=this.shadowRoot.getElementById("modalidad");t?e==null||e.setAttribute("isSelectError",!0):e==null||e.removeAttribute("isSelectError")}handleLink(){let t="";this.tipoDeAtencionIntegral!==""&&(t=Wt.find(i=>i.name===this.tipoDeAtencionIntegral).link),this.tipoDeAtencion!==""&&this.modalidad!==""&&(t=pt.find(i=>i.name===this.tipoDeAtencion).items.find(i=>i.name===this.modalidad).link),this.tipoDeAtencion==="Consulta pediátrica"&&(t="https://www.clinicaalemana.cl/consulta-pediatrica-2025"),this.link=t;const e=this.shadowRoot.querySelector(".btn-action");this.link!==""?e.setAttribute("href",this.link):e.removeAttribute("href")}submit(){this.link!==""?this.handleMark({category:"reservar_hora"}):this.tipoDeAtencion===""?(this.handleErrorTipoDeAtencion(!0),this.handleErrorModalidad(!0)):(this.handleFocusModalidad(!1),this.handleErrorModalidad(!0))}handleMark({category:t,action:e,label:i}){const o={event:"evento-interactivo","evento-interactivo-categoria":t,"evento-interactivo-accion":e||this.tipoDeAtencion||this.tipoDeAtencionIntegral||"reservar_hora","evento-interactivo-etiqueta":i||this.modalidad,opcion_seleccionada:this.opcionSelecionada};console.log("devLayer_ ",o);try{window.dataLayer.push(o)}catch{console.log("event push failed")}}eventHandler(){this.removeAttribute("hidden");let t=this.shadowRoot.getElementById("backdrop");t.style.display="flex",this.hidden=!1,this.focused=!0,this.requestUpdate()}firstUpdated(){if(this.handleParameter(),setTimeout(()=>{this.handleTab()},1e3),this.onlyView||document.addEventListener("openBookingBox",()=>{this.eventHandler()}),window.innerWidth>1023){const t=this.shadowRoot.querySelector(".booking-box");let e=this.shadowRoot.getElementById("backdrop");t.addEventListener("focusin",()=>{this.focused=!0,e.style.display="flex",this.requestUpdate()})}}handleTab(t){this.tipoDeAtencion="",this.tipoDeAtencionIntegral="",this.modalidad="",this.handleLink();const e={1:"Paciente",2:"Alemana Integral"};this.opcionSelecionada=e[t]??"Paciente";const i=this.shadowRoot.querySelectorAll("[data-view]");if(t){const o=this.shadowRoot.querySelectorAll(".top .item");this.shadowRoot.querySelector(".option-box").setAttribute("current-view",t.toString()),i.forEach(s=>{s.getAttribute("data-view")===t.toString()?s.style.display="flex":s.style.display="none"}),o.forEach(s=>{s.getAttribute("data-tab")===t.toString()?s.querySelector("cas-radio").setAttribute("checked",!0):s.querySelector("cas-radio").removeAttribute("checked")})}else Array.from(i).filter(a=>a.getAttribute("data-view")==="2").forEach(a=>{a.style.display="none"})}handleParameter(){new URLSearchParams(window.location.search).get("rsv")==="true"&&this.eventHandler()}closeHandler(){let t=this.shadowRoot.getElementById("backdrop");t.style.display="none",this.hidden=!1,this.focused=!1,this.requestUpdate()}handleOverrideTime(){this.handleMark({category:"anular_hora"})}render(){const t=qt({"booking-box":!0,hidden:this.hidden,home:this.home,focused:this.focused}),e=qt({backdrop:!0,hidden:this.hidden});return ct`
|
|
309
|
+
*/const qt=ke(class extends Ee{constructor(n){var t;if(super(n),n.type!==we.ATTRIBUTE||n.name!=="class"||((t=n.strings)===null||t===void 0?void 0:t.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(n){return" "+Object.keys(n).filter(t=>n[t]).join(" ")+" "}update(n,[t]){var e,i;if(this.it===void 0){this.it=new Set,n.strings!==void 0&&(this.nt=new Set(n.strings.join(" ").split(/\s/).filter(a=>a!=="")));for(const a in t)t[a]&&!(!((e=this.nt)===null||e===void 0)&&e.has(a))&&this.it.add(a);return this.render(t)}const o=n.element.classList;this.it.forEach(a=>{a in t||(o.remove(a),this.it.delete(a))});for(const a in t){const s=!!t[a];s===this.it.has(a)||!((i=this.nt)===null||i===void 0)&&i.has(a)||(s?(o.add(a),this.it.add(a)):(o.remove(a),this.it.delete(a)))}return H}}),Se=[{name:"Consulta médica",items:[{name:"Consulta pediátrica",link:"https://www.clinicaalemana.cl/consulta-pediatrica-2026"},{name:"Presencial",link:"https://reserva.alemana.cl/reserva/portal/busqueda"},{name:"Teleconsulta",link:"https://agenda.clinicaalemana.cl/paciente"},{name:"TeleUrgencia",link:"https://www.clinicaalemana.cl/telemedicina/teleurgencia"},{name:"A domicilio",link:"https://www.clinicaalemana.cl/servicios-clinicos/servicios-a-domicilio"},{name:"Teledermatología",link:"https://teledermatologia.clinicaalemana.cl/"}]},{name:"Rehabilitación y bienestar",items:[{name:"Kinesiología",link:"https://agenda.clinicaalemana.cl/rehabilitacion-y-bienestar/seleccion-categoria"},{name:"Masoterapia",link:"https://agenda.clinicaalemana.cl/examenes-y-procedimientos/masoterapia/masoterapia-masaje-deportivo/disponibilidad"}]},{name:"Exámenes y procedimientos",items:[{name:"Presencial",link:"https://www.clinicaalemana.cl/examenes-y-procedimientos"},{name:"A domicilio",link:"https://www.clinicaalemana.cl/servicios-clinicos/servicios-a-domicilio/examenes-laboratorio-domicilio"}]},{name:"Vacunas",items:[{name:"Viajeros",link:"https://www.clinicaalemana.cl/especialidades/vacunatorio/reserva-vacuna-fiebre-amarilla"},{name:"TeleAsesoría pediátrica",link:"https://www.clinicaalemana.cl/especialidades/vacunatorio/asesoria-en-vacunacion-pediatrica"}]}],Ce=[{name:"Consulta médica",link:"https://reserva.clinicaalemana.cl/alemana-integral"},{name:"Exámenes y procedimientos",link:"https://www.clinicaalemana.cl/examenes-y-procedimientos"}],pt=Se,Wt=Ce;class V extends R{constructor(){super(),this.hidden=!1,this.tipoDeAtencion="",this.tipoDeAtencionIntegral="",this.modalidad="",this.dataTipoDeAtencion=[],this.dataModalidad=[],this.opcionSelecionada="Paciente",this.focused=!1,this.refresh=!1,this.link=""}changeHandler(t){var i,o;const e=t.target.name;if(this[e]=t.composedPath()[0].value,this.handleErrorTipoDeAtencion(!1),this.handleErrorModalidad(!1),e==="tipoDeAtencionIntegral"&&(this.tipoDeAtencion="",this.modalidad=""),e==="tipoDeAtencion"){this.modalidad="",this.refresh=!0,this.handleFocusModalidad(!0),this.handleFocusTipoDeAtencion(!1);const a=((o=(i=pt.find(s=>s.name===this.tipoDeAtencion))==null?void 0:i.items)==null?void 0:o.map(s=>s.name))||[];t.target.value==="Consulta pediátrica"&&this.handleLink(),this.dataModalidad=[...a],this.requestUpdate(),setTimeout(()=>{this.refresh=!1,this.requestUpdate()},100)}e==="modalidad"&&this.handleFocusModalidad(!1),this.handleLink()}handleFocusTipoDeAtencion(t){const e=this.shadowRoot.getElementById("tipoDeAtencion");e==null||e.setAttribute("active",t)}handleFocusModalidad(t){const e=this.shadowRoot.getElementById("modalidad");e==null||e.setAttribute("active",t)}handleErrorTipoDeAtencion(t){const e=this.shadowRoot.getElementById("tipoDeAtencion");t?e==null||e.setAttribute("isSelectError",!0):e==null||e.removeAttribute("isSelectError")}handleErrorModalidad(t){const e=this.shadowRoot.getElementById("modalidad");t?e==null||e.setAttribute("isSelectError",!0):e==null||e.removeAttribute("isSelectError")}handleLink(){let t="";this.tipoDeAtencionIntegral!==""&&(t=Wt.find(i=>i.name===this.tipoDeAtencionIntegral).link),this.tipoDeAtencion!==""&&this.modalidad!==""&&(t=pt.find(i=>i.name===this.tipoDeAtencion).items.find(i=>i.name===this.modalidad).link),this.tipoDeAtencion==="Consulta pediátrica"&&(t="https://www.clinicaalemana.cl/consulta-pediatrica-2025"),this.link=t;const e=this.shadowRoot.querySelector(".btn-action");this.link!==""?e.setAttribute("href",this.link):e.removeAttribute("href")}submit(){this.link!==""?this.handleMark({category:"reservar_hora"}):this.tipoDeAtencion===""?(this.handleErrorTipoDeAtencion(!0),this.handleErrorModalidad(!0)):(this.handleFocusModalidad(!1),this.handleErrorModalidad(!0))}handleMark({category:t,action:e,label:i}){const o={event:"evento-interactivo","evento-interactivo-categoria":t,"evento-interactivo-accion":e||this.tipoDeAtencion||this.tipoDeAtencionIntegral||"reservar_hora","evento-interactivo-etiqueta":i||this.modalidad,opcion_seleccionada:this.opcionSelecionada};console.log("devLayer_ ",o);try{window.dataLayer.push(o)}catch{console.log("event push failed")}}eventHandler(){this.removeAttribute("hidden");let t=this.shadowRoot.getElementById("backdrop");t.style.display="flex",this.hidden=!1,this.focused=!0,this.requestUpdate()}firstUpdated(){if(this.handleParameter(),setTimeout(()=>{this.handleTab()},1e3),this.onlyView||document.addEventListener("openBookingBox",()=>{this.eventHandler()}),window.innerWidth>1023){const t=this.shadowRoot.querySelector(".booking-box");let e=this.shadowRoot.getElementById("backdrop");t.addEventListener("focusin",()=>{this.focused=!0,e.style.display="flex",this.requestUpdate()})}}handleTab(t){this.tipoDeAtencion="",this.tipoDeAtencionIntegral="",this.modalidad="",this.handleLink();const e={1:"Paciente",2:"Alemana Integral"};this.opcionSelecionada=e[t]??"Paciente";const i=this.shadowRoot.querySelectorAll("[data-view]");if(t){const o=this.shadowRoot.querySelectorAll(".top .item");this.shadowRoot.querySelector(".option-box").setAttribute("current-view",t.toString()),i.forEach(s=>{s.getAttribute("data-view")===t.toString()?s.style.display="flex":s.style.display="none"}),o.forEach(s=>{s.getAttribute("data-tab")===t.toString()?s.querySelector("cas-radio").setAttribute("checked",!0):s.querySelector("cas-radio").removeAttribute("checked")})}else Array.from(i).filter(a=>a.getAttribute("data-view")==="2").forEach(a=>{a.style.display="none"})}handleParameter(){new URLSearchParams(window.location.search).get("rsv")==="true"&&this.eventHandler()}closeHandler(){let t=this.shadowRoot.getElementById("backdrop");t.style.display="none",this.hidden=!1,this.focused=!1,this.requestUpdate()}handleOverrideTime(){this.handleMark({category:"anular_hora"})}render(){const t=qt({"booking-box":!0,hidden:this.hidden,home:this.home,focused:this.focused}),e=qt({backdrop:!0,hidden:this.hidden});return ct`
|
|
310
310
|
<div class="${e}" id="backdrop" @click="${this.closeHandler}"></div>
|
|
311
311
|
<div class="booking-box-main-cont" id="booking-box-main-cont">
|
|
312
312
|
<div class="${t}" id="booking-box" tabindex="0">
|
|
@@ -16,7 +16,7 @@ var __publicField = (obj, key, value) => {
|
|
|
16
16
|
document.head.appendChild(font2);
|
|
17
17
|
})();
|
|
18
18
|
const name = "@eloisa-ds/all-components";
|
|
19
|
-
const version$1 = "1.3.
|
|
19
|
+
const version$1 = "1.3.22";
|
|
20
20
|
const dependencies = {};
|
|
21
21
|
const main = "./index.js";
|
|
22
22
|
const module$1 = "./index.mjs";
|
|
@@ -1024,8 +1024,7 @@ var __publicField = (obj, key, value) => {
|
|
|
1024
1024
|
position: fixed;
|
|
1025
1025
|
top: 0;
|
|
1026
1026
|
width: 100%;
|
|
1027
|
-
transition: opacity
|
|
1028
|
-
will-change: height;
|
|
1027
|
+
transition: opacity 50ms ease-in-out;
|
|
1029
1028
|
opacity: 0;
|
|
1030
1029
|
animation: fadeIn 50ms ease-in-out;
|
|
1031
1030
|
animation-fill-mode: forwards;
|
|
@@ -2874,11 +2873,11 @@ var __publicField = (obj, key, value) => {
|
|
|
2874
2873
|
{
|
|
2875
2874
|
name: "Presencial",
|
|
2876
2875
|
link: "https://www.clinicaalemana.cl/examenes-y-procedimientos"
|
|
2876
|
+
},
|
|
2877
|
+
{
|
|
2878
|
+
name: "A domicilio",
|
|
2879
|
+
link: "https://www.clinicaalemana.cl/servicios-clinicos/servicios-a-domicilio/examenes-laboratorio-domicilio"
|
|
2877
2880
|
}
|
|
2878
|
-
// {
|
|
2879
|
-
// name: 'A domicilio',
|
|
2880
|
-
// link: 'https://www.clinicaalemana.cl/servicios-clinicos/servicios-a-domicilio/examenes-laboratorio-domicilio',
|
|
2881
|
-
// },
|
|
2882
2881
|
]
|
|
2883
2882
|
},
|
|
2884
2883
|
{
|
|
@@ -24842,7 +24841,8 @@ var __publicField = (obj, key, value) => {
|
|
|
24842
24841
|
this.isMacbookAir = getIsMacbookAir();
|
|
24843
24842
|
this.isDesktop = getIsDesktop();
|
|
24844
24843
|
this.lastScrollPosition = 0;
|
|
24845
|
-
|
|
24844
|
+
const cachedAlertHeight = parseInt(sessionStorage.getItem("cas-alert-height") || "0");
|
|
24845
|
+
this.spaceHeight = 180 + cachedAlertHeight;
|
|
24846
24846
|
}
|
|
24847
24847
|
connectedCallback() {
|
|
24848
24848
|
super.connectedCallback();
|
|
@@ -24964,6 +24964,7 @@ var __publicField = (obj, key, value) => {
|
|
|
24964
24964
|
const { showAlert, alert: alert2 } = data3;
|
|
24965
24965
|
if (showAlert) {
|
|
24966
24966
|
if (!alert2 || !alert2.enabled) {
|
|
24967
|
+
sessionStorage.removeItem("cas-alert-height");
|
|
24967
24968
|
return false;
|
|
24968
24969
|
}
|
|
24969
24970
|
let currentDate = /* @__PURE__ */ new Date();
|
|
@@ -24999,6 +25000,7 @@ var __publicField = (obj, key, value) => {
|
|
|
24999
25000
|
const tagAlert = this.shadowRoot.querySelector("cas-alert");
|
|
25000
25001
|
tagAlert?.addEventListener("close", () => {
|
|
25001
25002
|
sessionStorage.setItem("hideAlert", "true");
|
|
25003
|
+
sessionStorage.removeItem("cas-alert-height");
|
|
25002
25004
|
this.showAlert = false;
|
|
25003
25005
|
this.spaceHeight = head + preHead + taxonomy2;
|
|
25004
25006
|
bottom.style.top = `${head + preHead}px`;
|
|
@@ -25011,6 +25013,7 @@ var __publicField = (obj, key, value) => {
|
|
|
25011
25013
|
this.spaceHeight = head + preHead + taxonomy2 + alert2;
|
|
25012
25014
|
bottom.style.top = `${head + preHead + alert2}px`;
|
|
25013
25015
|
}
|
|
25016
|
+
sessionStorage.setItem("cas-alert-height", String(Math.round(alert2)));
|
|
25014
25017
|
} else {
|
|
25015
25018
|
if (this.type !== VARIANTS$1.HOME) {
|
|
25016
25019
|
this.spaceHeight = head;
|
|
@@ -13,7 +13,7 @@ import { x as x$1, i as i$b, r as r$7, s as s$8, a as x$2, T as T$6, o as o$d, D
|
|
|
13
13
|
document.head.appendChild(font2);
|
|
14
14
|
})();
|
|
15
15
|
const name = "@eloisa-ds/all-components";
|
|
16
|
-
const version$1 = "1.3.
|
|
16
|
+
const version$1 = "1.3.22";
|
|
17
17
|
const dependencies = {};
|
|
18
18
|
const main = "./index.js";
|
|
19
19
|
const module$1 = "./index.mjs";
|
|
@@ -208,8 +208,7 @@ const styles$u = i$b`
|
|
|
208
208
|
position: fixed;
|
|
209
209
|
top: 0;
|
|
210
210
|
width: 100%;
|
|
211
|
-
transition: opacity
|
|
212
|
-
will-change: height;
|
|
211
|
+
transition: opacity 50ms ease-in-out;
|
|
213
212
|
opacity: 0;
|
|
214
213
|
animation: fadeIn 50ms ease-in-out;
|
|
215
214
|
animation-fill-mode: forwards;
|
|
@@ -2058,11 +2057,11 @@ const dataPatient = [
|
|
|
2058
2057
|
{
|
|
2059
2058
|
name: "Presencial",
|
|
2060
2059
|
link: "https://www.clinicaalemana.cl/examenes-y-procedimientos"
|
|
2060
|
+
},
|
|
2061
|
+
{
|
|
2062
|
+
name: "A domicilio",
|
|
2063
|
+
link: "https://www.clinicaalemana.cl/servicios-clinicos/servicios-a-domicilio/examenes-laboratorio-domicilio"
|
|
2061
2064
|
}
|
|
2062
|
-
// {
|
|
2063
|
-
// name: 'A domicilio',
|
|
2064
|
-
// link: 'https://www.clinicaalemana.cl/servicios-clinicos/servicios-a-domicilio/examenes-laboratorio-domicilio',
|
|
2065
|
-
// },
|
|
2066
2065
|
]
|
|
2067
2066
|
},
|
|
2068
2067
|
{
|
|
@@ -24026,7 +24025,8 @@ class CasHeader extends s$8 {
|
|
|
24026
24025
|
this.isMacbookAir = getIsMacbookAir();
|
|
24027
24026
|
this.isDesktop = getIsDesktop();
|
|
24028
24027
|
this.lastScrollPosition = 0;
|
|
24029
|
-
|
|
24028
|
+
const cachedAlertHeight = parseInt(sessionStorage.getItem("cas-alert-height") || "0");
|
|
24029
|
+
this.spaceHeight = 180 + cachedAlertHeight;
|
|
24030
24030
|
}
|
|
24031
24031
|
connectedCallback() {
|
|
24032
24032
|
super.connectedCallback();
|
|
@@ -24148,6 +24148,7 @@ class CasHeader extends s$8 {
|
|
|
24148
24148
|
const { showAlert, alert } = data3;
|
|
24149
24149
|
if (showAlert) {
|
|
24150
24150
|
if (!alert || !alert.enabled) {
|
|
24151
|
+
sessionStorage.removeItem("cas-alert-height");
|
|
24151
24152
|
return false;
|
|
24152
24153
|
}
|
|
24153
24154
|
let currentDate = /* @__PURE__ */ new Date();
|
|
@@ -24183,6 +24184,7 @@ class CasHeader extends s$8 {
|
|
|
24183
24184
|
const tagAlert = this.shadowRoot.querySelector("cas-alert");
|
|
24184
24185
|
tagAlert?.addEventListener("close", () => {
|
|
24185
24186
|
sessionStorage.setItem("hideAlert", "true");
|
|
24187
|
+
sessionStorage.removeItem("cas-alert-height");
|
|
24186
24188
|
this.showAlert = false;
|
|
24187
24189
|
this.spaceHeight = head + preHead + taxonomy2;
|
|
24188
24190
|
bottom.style.top = `${head + preHead}px`;
|
|
@@ -24195,6 +24197,7 @@ class CasHeader extends s$8 {
|
|
|
24195
24197
|
this.spaceHeight = head + preHead + taxonomy2 + alert;
|
|
24196
24198
|
bottom.style.top = `${head + preHead + alert}px`;
|
|
24197
24199
|
}
|
|
24200
|
+
sessionStorage.setItem("cas-alert-height", String(Math.round(alert)));
|
|
24198
24201
|
} else {
|
|
24199
24202
|
if (this.type !== VARIANTS$1.HOME) {
|
|
24200
24203
|
this.spaceHeight = head;
|
package/build/cas-header.js
CHANGED
|
@@ -38,8 +38,7 @@
|
|
|
38
38
|
position: fixed;
|
|
39
39
|
top: 0;
|
|
40
40
|
width: 100%;
|
|
41
|
-
transition: opacity
|
|
42
|
-
will-change: height;
|
|
41
|
+
transition: opacity 50ms ease-in-out;
|
|
43
42
|
opacity: 0;
|
|
44
43
|
animation: fadeIn 50ms ease-in-out;
|
|
45
44
|
animation-fill-mode: forwards;
|
|
@@ -1069,7 +1068,7 @@
|
|
|
1069
1068
|
* @license
|
|
1070
1069
|
* Copyright 2018 Google LLC
|
|
1071
1070
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
1072
|
-
*/const pe=Wa(class extends _r{constructor(s){var t;if(super(s),s.type!==fr.ATTRIBUTE||s.name!=="class"||((t=s.strings)===null||t===void 0?void 0:t.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(s){return" "+Object.keys(s).filter(t=>s[t]).join(" ")+" "}update(s,[t]){var e,i;if(this.it===void 0){this.it=new Set,s.strings!==void 0&&(this.nt=new Set(s.strings.join(" ").split(/\s/).filter(h=>h!=="")));for(const h in t)t[h]&&!(!((e=this.nt)===null||e===void 0)&&e.has(h))&&this.it.add(h);return this.render(t)}const a=s.element.classList;this.it.forEach(h=>{h in t||(a.remove(h),this.it.delete(h))});for(const h in t){const o=!!t[h];o===this.it.has(h)||!((i=this.nt)===null||i===void 0)&&i.has(h)||(o?(a.add(h),this.it.add(h)):(a.remove(h),this.it.delete(h)))}return Lt}}),Mr=[{name:"Consulta médica",items:[{name:"Consulta pediátrica",link:"https://www.clinicaalemana.cl/consulta-pediatrica-2026"},{name:"Presencial",link:"https://reserva.alemana.cl/reserva/portal/busqueda"},{name:"Teleconsulta",link:"https://agenda.clinicaalemana.cl/paciente"},{name:"TeleUrgencia",link:"https://www.clinicaalemana.cl/telemedicina/teleurgencia"},{name:"A domicilio",link:"https://www.clinicaalemana.cl/servicios-clinicos/servicios-a-domicilio"},{name:"Teledermatología",link:"https://teledermatologia.clinicaalemana.cl/"}]},{name:"Rehabilitación y bienestar",items:[{name:"Kinesiología",link:"https://agenda.clinicaalemana.cl/rehabilitacion-y-bienestar/seleccion-categoria"},{name:"Masoterapia",link:"https://agenda.clinicaalemana.cl/examenes-y-procedimientos/masoterapia/masoterapia-masaje-deportivo/disponibilidad"}]},{name:"Exámenes y procedimientos",items:[{name:"Presencial",link:"https://www.clinicaalemana.cl/examenes-y-procedimientos"}]},{name:"Vacunas",items:[{name:"Viajeros",link:"https://www.clinicaalemana.cl/especialidades/vacunatorio/reserva-vacuna-fiebre-amarilla"},{name:"TeleAsesoría pediátrica",link:"https://www.clinicaalemana.cl/especialidades/vacunatorio/asesoria-en-vacunacion-pediatrica"}]}],zr=[{name:"Consulta médica",link:"https://reserva.clinicaalemana.cl/alemana-integral"},{name:"Exámenes y procedimientos",link:"https://www.clinicaalemana.cl/examenes-y-procedimientos"}],S1=Mr,Za=zr;class ve extends b{constructor(){super(),this.hidden=!1,this.tipoDeAtencion="",this.tipoDeAtencionIntegral="",this.modalidad="",this.dataTipoDeAtencion=[],this.dataModalidad=[],this.opcionSelecionada="Paciente",this.focused=!1,this.refresh=!1,this.link=""}changeHandler(t){var i,a;const e=t.target.name;if(this[e]=t.composedPath()[0].value,this.handleErrorTipoDeAtencion(!1),this.handleErrorModalidad(!1),e==="tipoDeAtencionIntegral"&&(this.tipoDeAtencion="",this.modalidad=""),e==="tipoDeAtencion"){this.modalidad="",this.refresh=!0,this.handleFocusModalidad(!0),this.handleFocusTipoDeAtencion(!1);const h=((a=(i=S1.find(o=>o.name===this.tipoDeAtencion))==null?void 0:i.items)==null?void 0:a.map(o=>o.name))||[];t.target.value==="Consulta pediátrica"&&this.handleLink(),this.dataModalidad=[...h],this.requestUpdate(),setTimeout(()=>{this.refresh=!1,this.requestUpdate()},100)}e==="modalidad"&&this.handleFocusModalidad(!1),this.handleLink()}handleFocusTipoDeAtencion(t){const e=this.shadowRoot.getElementById("tipoDeAtencion");e==null||e.setAttribute("active",t)}handleFocusModalidad(t){const e=this.shadowRoot.getElementById("modalidad");e==null||e.setAttribute("active",t)}handleErrorTipoDeAtencion(t){const e=this.shadowRoot.getElementById("tipoDeAtencion");t?e==null||e.setAttribute("isSelectError",!0):e==null||e.removeAttribute("isSelectError")}handleErrorModalidad(t){const e=this.shadowRoot.getElementById("modalidad");t?e==null||e.setAttribute("isSelectError",!0):e==null||e.removeAttribute("isSelectError")}handleLink(){let t="";this.tipoDeAtencionIntegral!==""&&(t=Za.find(i=>i.name===this.tipoDeAtencionIntegral).link),this.tipoDeAtencion!==""&&this.modalidad!==""&&(t=S1.find(i=>i.name===this.tipoDeAtencion).items.find(i=>i.name===this.modalidad).link),this.tipoDeAtencion==="Consulta pediátrica"&&(t="https://www.clinicaalemana.cl/consulta-pediatrica-2025"),this.link=t;const e=this.shadowRoot.querySelector(".btn-action");this.link!==""?e.setAttribute("href",this.link):e.removeAttribute("href")}submit(){this.link!==""?this.handleMark({category:"reservar_hora"}):this.tipoDeAtencion===""?(this.handleErrorTipoDeAtencion(!0),this.handleErrorModalidad(!0)):(this.handleFocusModalidad(!1),this.handleErrorModalidad(!0))}handleMark({category:t,action:e,label:i}){const a={event:"evento-interactivo","evento-interactivo-categoria":t,"evento-interactivo-accion":e||this.tipoDeAtencion||this.tipoDeAtencionIntegral||"reservar_hora","evento-interactivo-etiqueta":i||this.modalidad,opcion_seleccionada:this.opcionSelecionada};console.log("devLayer_ ",a);try{window.dataLayer.push(a)}catch{console.log("event push failed")}}eventHandler(){this.removeAttribute("hidden");let t=this.shadowRoot.getElementById("backdrop");t.style.display="flex",this.hidden=!1,this.focused=!0,this.requestUpdate()}firstUpdated(){if(this.handleParameter(),setTimeout(()=>{this.handleTab()},1e3),this.onlyView||document.addEventListener("openBookingBox",()=>{this.eventHandler()}),window.innerWidth>1023){const t=this.shadowRoot.querySelector(".booking-box");let e=this.shadowRoot.getElementById("backdrop");t.addEventListener("focusin",()=>{this.focused=!0,e.style.display="flex",this.requestUpdate()})}}handleTab(t){this.tipoDeAtencion="",this.tipoDeAtencionIntegral="",this.modalidad="",this.handleLink();const e={1:"Paciente",2:"Alemana Integral"};this.opcionSelecionada=e[t]??"Paciente";const i=this.shadowRoot.querySelectorAll("[data-view]");if(t){const a=this.shadowRoot.querySelectorAll(".top .item");this.shadowRoot.querySelector(".option-box").setAttribute("current-view",t.toString()),i.forEach(o=>{o.getAttribute("data-view")===t.toString()?o.style.display="flex":o.style.display="none"}),a.forEach(o=>{o.getAttribute("data-tab")===t.toString()?o.querySelector("cas-radio").setAttribute("checked",!0):o.querySelector("cas-radio").removeAttribute("checked")})}else Array.from(i).filter(h=>h.getAttribute("data-view")==="2").forEach(h=>{h.style.display="none"})}handleParameter(){new URLSearchParams(window.location.search).get("rsv")==="true"&&this.eventHandler()}closeHandler(){let t=this.shadowRoot.getElementById("backdrop");t.style.display="none",this.hidden=!1,this.focused=!1,this.requestUpdate()}handleOverrideTime(){this.handleMark({category:"anular_hora"})}render(){const t=pe({"booking-box":!0,hidden:this.hidden,home:this.home,focused:this.focused}),e=pe({backdrop:!0,hidden:this.hidden});return f`
|
|
1071
|
+
*/const pe=Wa(class extends _r{constructor(s){var t;if(super(s),s.type!==fr.ATTRIBUTE||s.name!=="class"||((t=s.strings)===null||t===void 0?void 0:t.length)>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(s){return" "+Object.keys(s).filter(t=>s[t]).join(" ")+" "}update(s,[t]){var e,i;if(this.it===void 0){this.it=new Set,s.strings!==void 0&&(this.nt=new Set(s.strings.join(" ").split(/\s/).filter(h=>h!=="")));for(const h in t)t[h]&&!(!((e=this.nt)===null||e===void 0)&&e.has(h))&&this.it.add(h);return this.render(t)}const a=s.element.classList;this.it.forEach(h=>{h in t||(a.remove(h),this.it.delete(h))});for(const h in t){const o=!!t[h];o===this.it.has(h)||!((i=this.nt)===null||i===void 0)&&i.has(h)||(o?(a.add(h),this.it.add(h)):(a.remove(h),this.it.delete(h)))}return Lt}}),Mr=[{name:"Consulta médica",items:[{name:"Consulta pediátrica",link:"https://www.clinicaalemana.cl/consulta-pediatrica-2026"},{name:"Presencial",link:"https://reserva.alemana.cl/reserva/portal/busqueda"},{name:"Teleconsulta",link:"https://agenda.clinicaalemana.cl/paciente"},{name:"TeleUrgencia",link:"https://www.clinicaalemana.cl/telemedicina/teleurgencia"},{name:"A domicilio",link:"https://www.clinicaalemana.cl/servicios-clinicos/servicios-a-domicilio"},{name:"Teledermatología",link:"https://teledermatologia.clinicaalemana.cl/"}]},{name:"Rehabilitación y bienestar",items:[{name:"Kinesiología",link:"https://agenda.clinicaalemana.cl/rehabilitacion-y-bienestar/seleccion-categoria"},{name:"Masoterapia",link:"https://agenda.clinicaalemana.cl/examenes-y-procedimientos/masoterapia/masoterapia-masaje-deportivo/disponibilidad"}]},{name:"Exámenes y procedimientos",items:[{name:"Presencial",link:"https://www.clinicaalemana.cl/examenes-y-procedimientos"},{name:"A domicilio",link:"https://www.clinicaalemana.cl/servicios-clinicos/servicios-a-domicilio/examenes-laboratorio-domicilio"}]},{name:"Vacunas",items:[{name:"Viajeros",link:"https://www.clinicaalemana.cl/especialidades/vacunatorio/reserva-vacuna-fiebre-amarilla"},{name:"TeleAsesoría pediátrica",link:"https://www.clinicaalemana.cl/especialidades/vacunatorio/asesoria-en-vacunacion-pediatrica"}]}],zr=[{name:"Consulta médica",link:"https://reserva.clinicaalemana.cl/alemana-integral"},{name:"Exámenes y procedimientos",link:"https://www.clinicaalemana.cl/examenes-y-procedimientos"}],S1=Mr,Za=zr;class ve extends b{constructor(){super(),this.hidden=!1,this.tipoDeAtencion="",this.tipoDeAtencionIntegral="",this.modalidad="",this.dataTipoDeAtencion=[],this.dataModalidad=[],this.opcionSelecionada="Paciente",this.focused=!1,this.refresh=!1,this.link=""}changeHandler(t){var i,a;const e=t.target.name;if(this[e]=t.composedPath()[0].value,this.handleErrorTipoDeAtencion(!1),this.handleErrorModalidad(!1),e==="tipoDeAtencionIntegral"&&(this.tipoDeAtencion="",this.modalidad=""),e==="tipoDeAtencion"){this.modalidad="",this.refresh=!0,this.handleFocusModalidad(!0),this.handleFocusTipoDeAtencion(!1);const h=((a=(i=S1.find(o=>o.name===this.tipoDeAtencion))==null?void 0:i.items)==null?void 0:a.map(o=>o.name))||[];t.target.value==="Consulta pediátrica"&&this.handleLink(),this.dataModalidad=[...h],this.requestUpdate(),setTimeout(()=>{this.refresh=!1,this.requestUpdate()},100)}e==="modalidad"&&this.handleFocusModalidad(!1),this.handleLink()}handleFocusTipoDeAtencion(t){const e=this.shadowRoot.getElementById("tipoDeAtencion");e==null||e.setAttribute("active",t)}handleFocusModalidad(t){const e=this.shadowRoot.getElementById("modalidad");e==null||e.setAttribute("active",t)}handleErrorTipoDeAtencion(t){const e=this.shadowRoot.getElementById("tipoDeAtencion");t?e==null||e.setAttribute("isSelectError",!0):e==null||e.removeAttribute("isSelectError")}handleErrorModalidad(t){const e=this.shadowRoot.getElementById("modalidad");t?e==null||e.setAttribute("isSelectError",!0):e==null||e.removeAttribute("isSelectError")}handleLink(){let t="";this.tipoDeAtencionIntegral!==""&&(t=Za.find(i=>i.name===this.tipoDeAtencionIntegral).link),this.tipoDeAtencion!==""&&this.modalidad!==""&&(t=S1.find(i=>i.name===this.tipoDeAtencion).items.find(i=>i.name===this.modalidad).link),this.tipoDeAtencion==="Consulta pediátrica"&&(t="https://www.clinicaalemana.cl/consulta-pediatrica-2025"),this.link=t;const e=this.shadowRoot.querySelector(".btn-action");this.link!==""?e.setAttribute("href",this.link):e.removeAttribute("href")}submit(){this.link!==""?this.handleMark({category:"reservar_hora"}):this.tipoDeAtencion===""?(this.handleErrorTipoDeAtencion(!0),this.handleErrorModalidad(!0)):(this.handleFocusModalidad(!1),this.handleErrorModalidad(!0))}handleMark({category:t,action:e,label:i}){const a={event:"evento-interactivo","evento-interactivo-categoria":t,"evento-interactivo-accion":e||this.tipoDeAtencion||this.tipoDeAtencionIntegral||"reservar_hora","evento-interactivo-etiqueta":i||this.modalidad,opcion_seleccionada:this.opcionSelecionada};console.log("devLayer_ ",a);try{window.dataLayer.push(a)}catch{console.log("event push failed")}}eventHandler(){this.removeAttribute("hidden");let t=this.shadowRoot.getElementById("backdrop");t.style.display="flex",this.hidden=!1,this.focused=!0,this.requestUpdate()}firstUpdated(){if(this.handleParameter(),setTimeout(()=>{this.handleTab()},1e3),this.onlyView||document.addEventListener("openBookingBox",()=>{this.eventHandler()}),window.innerWidth>1023){const t=this.shadowRoot.querySelector(".booking-box");let e=this.shadowRoot.getElementById("backdrop");t.addEventListener("focusin",()=>{this.focused=!0,e.style.display="flex",this.requestUpdate()})}}handleTab(t){this.tipoDeAtencion="",this.tipoDeAtencionIntegral="",this.modalidad="",this.handleLink();const e={1:"Paciente",2:"Alemana Integral"};this.opcionSelecionada=e[t]??"Paciente";const i=this.shadowRoot.querySelectorAll("[data-view]");if(t){const a=this.shadowRoot.querySelectorAll(".top .item");this.shadowRoot.querySelector(".option-box").setAttribute("current-view",t.toString()),i.forEach(o=>{o.getAttribute("data-view")===t.toString()?o.style.display="flex":o.style.display="none"}),a.forEach(o=>{o.getAttribute("data-tab")===t.toString()?o.querySelector("cas-radio").setAttribute("checked",!0):o.querySelector("cas-radio").removeAttribute("checked")})}else Array.from(i).filter(h=>h.getAttribute("data-view")==="2").forEach(h=>{h.style.display="none"})}handleParameter(){new URLSearchParams(window.location.search).get("rsv")==="true"&&this.eventHandler()}closeHandler(){let t=this.shadowRoot.getElementById("backdrop");t.style.display="none",this.hidden=!1,this.focused=!1,this.requestUpdate()}handleOverrideTime(){this.handleMark({category:"anular_hora"})}render(){const t=pe({"booking-box":!0,hidden:this.hidden,home:this.home,focused:this.focused}),e=pe({backdrop:!0,hidden:this.hidden});return f`
|
|
1073
1072
|
<div class="${e}" id="backdrop" @click="${this.closeHandler}"></div>
|
|
1074
1073
|
<div class="booking-box-main-cont" id="booking-box-main-cont">
|
|
1075
1074
|
<div class="${t}" id="booking-box" tabindex="0">
|
|
@@ -6390,7 +6389,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|
|
6390
6389
|
</div>
|
|
6391
6390
|
</div>
|
|
6392
6391
|
</div>
|
|
6393
|
-
`}}M(i1,"styles",b3),M(i1,"shadowRootOptions",{...b.shadowRootOptions,mode:"open"}),M(i1,"properties",{theme:{type:String},size:{type:Number},disableMode:{type:Boolean}});const Do=()=>window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",y3=s=>{const t=document.querySelector("body");s==="dark"?t==null||t.classList.add("eloisa-ds-dark-mode"):t==null||t.classList.remove("eloisa-ds-dark-mode")};function x3(s=null,t){let e=localStorage.getItem("theme")??Do(),i=e==="dark";const a=()=>{e=Do(),i=e==="dark"};return s!==null?(i=s==="true",e=i?"dark":"light"):window.matchMedia("(prefers-color-scheme: dark)").addListener(a),{theme:e,isDark:i}}const{mobile:A3,tablet:C3,macbookAir:w3,desktop:$3}=n3,Vo=()=>window.matchMedia(`(max-width: ${A3}px)`).matches,Bo=()=>window.matchMedia(`(max-width: ${C3}px)`).matches,Uo=()=>window.matchMedia(`(max-width: ${w3}px)`).matches,jo=()=>window.matchMedia(`(max-width: ${$3}px)`).matches;class G0 extends b{constructor(){super(),this.showAlert=!1,this.alert={},this.type=B.HOME,this.theme="light",this.disableMode="true",this.disableDarkModeDefault="false",this.isMobile=Vo(),this.isTablet=Bo(),this.isMacbookAir=Uo(),this.isDesktop=jo(),this.lastScrollPosition=0
|
|
6392
|
+
`}}M(i1,"styles",b3),M(i1,"shadowRootOptions",{...b.shadowRootOptions,mode:"open"}),M(i1,"properties",{theme:{type:String},size:{type:Number},disableMode:{type:Boolean}});const Do=()=>window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",y3=s=>{const t=document.querySelector("body");s==="dark"?t==null||t.classList.add("eloisa-ds-dark-mode"):t==null||t.classList.remove("eloisa-ds-dark-mode")};function x3(s=null,t){let e=localStorage.getItem("theme")??Do(),i=e==="dark";const a=()=>{e=Do(),i=e==="dark"};return s!==null?(i=s==="true",e=i?"dark":"light"):window.matchMedia("(prefers-color-scheme: dark)").addListener(a),{theme:e,isDark:i}}const{mobile:A3,tablet:C3,macbookAir:w3,desktop:$3}=n3,Vo=()=>window.matchMedia(`(max-width: ${A3}px)`).matches,Bo=()=>window.matchMedia(`(max-width: ${C3}px)`).matches,Uo=()=>window.matchMedia(`(max-width: ${w3}px)`).matches,jo=()=>window.matchMedia(`(max-width: ${$3}px)`).matches;class G0 extends b{constructor(){super(),this.showAlert=!1,this.alert={},this.type=B.HOME,this.theme="light",this.disableMode="true",this.disableDarkModeDefault="false",this.isMobile=Vo(),this.isTablet=Bo(),this.isMacbookAir=Uo(),this.isDesktop=jo(),this.lastScrollPosition=0;const t=parseInt(sessionStorage.getItem("cas-alert-height")||"0");this.spaceHeight=180+t}connectedCallback(){super.connectedCallback(),this.type===B.HOME&&window.addEventListener("scroll",this.handleScroll.bind(this)),window.addEventListener("resize",this.handleResize.bind(this)),window.addEventListener("resize",this.handleSpaces.bind(this))}disconnectedCallback(){this.type===B.HOME&&window.removeEventListener("scroll",this.handleScroll.bind(this)),window.removeEventListener("resize",this.handleResize.bind(this)),window.removeEventListener("resize",this.handleSpaces.bind(this)),super.disconnectedCallback()}handleScroll(){const t=window.pageYOffset||document.documentElement.scrollTop,e=this.shadowRoot.querySelector("header"),i=this.shadowRoot.querySelector("cas-header-taxonomy"),a=this.spaceHeight+"px";t<=this.spaceHeight||t<this.lastScrollPosition?(i.setAttribute("collapsed","false"),i.style.transform="translateY(0)",e.style.height=a):(i.setAttribute("collapsed","true"),i.style.transform="translateY(-100%)",e.style.height=`${this.spaceHeight-72}px`),this.lastScrollPosition=t}handleResize(){const t=this.isMobile,e=this.isTablet,i=this.isMacbookAir,a=this.isDesktop;this.isMobile=Vo(),this.isTablet=Bo(),this.isMacbookAir=Uo(),this.isDesktop=jo(),(t!==this.isMobile||e!==this.isTablet||i!==this.isMacbookAir||a!==this.isDesktop)&&this.requestUpdate()}handleTheme({theme:t}){const e={theme:t,isDark:t==="dark"},i=new CustomEvent("themeChange",{detail:e});this.theme=t,this.defaultDarkMode(),document.dispatchEvent(i)}defaultDarkMode(){y3(this.theme);const t=document.querySelector("head");if(this.disableDarkModeDefault!=="true"&&this.theme==="dark"){const e=document.createElement("style");e.setAttribute("data-name","eloisa-ds-dark-mode"),e.innerHTML=`
|
|
6394
6393
|
// * {
|
|
6395
6394
|
// filter: invert(1) hue-rotate(180deg);
|
|
6396
6395
|
// }
|
|
@@ -6407,7 +6406,7 @@ subject to an additional IP rights grant found at http://polymer.github.io/PATEN
|
|
|
6407
6406
|
// img {
|
|
6408
6407
|
// filter: none;
|
|
6409
6408
|
// }
|
|
6410
|
-
`,t==null||t.appendChild(e)}else{const e=document.querySelector('[data-name="eloisa-ds-dark-mode"]');e==null||e.remove()}}handleEvents(){const t=a=>{this.setAttribute("darkMode",a.detail.isDark)},e=()=>{this.handleTheme({theme:"dark"})},i=()=>{this.handleTheme({theme:"light"})};document.addEventListener("themeChange",t),document.addEventListener("onDarkMode",e),document.addEventListener("onLightMode",i),setTimeout(()=>{const a=this.disableMode==="true";this.darkMode==="true"&&!a&&e(),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",function(o){!localStorage.getItem("theme")&&!a&&(o.matches?e():i())})},1e3)}async handleAlert(){const t=new WebSocket("wss://sjm3jibuni.execute-api.us-east-1.amazonaws.com/prod");t.onopen=function(){t.send(JSON.stringify({action:"getAlert"}))},t.onmessage=e=>{const i=JSON.parse(e.data);if((i==null?void 0:i.type)==="getAlert"){const{showAlert:a,alert:h}=i;if(a){if(!h||!h.enabled)return
|
|
6409
|
+
`,t==null||t.appendChild(e)}else{const e=document.querySelector('[data-name="eloisa-ds-dark-mode"]');e==null||e.remove()}}handleEvents(){const t=a=>{this.setAttribute("darkMode",a.detail.isDark)},e=()=>{this.handleTheme({theme:"dark"})},i=()=>{this.handleTheme({theme:"light"})};document.addEventListener("themeChange",t),document.addEventListener("onDarkMode",e),document.addEventListener("onLightMode",i),setTimeout(()=>{const a=this.disableMode==="true";this.darkMode==="true"&&!a&&e(),window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",function(o){!localStorage.getItem("theme")&&!a&&(o.matches?e():i())})},1e3)}async handleAlert(){const t=new WebSocket("wss://sjm3jibuni.execute-api.us-east-1.amazonaws.com/prod");t.onopen=function(){t.send(JSON.stringify({action:"getAlert"}))},t.onmessage=e=>{const i=JSON.parse(e.data);if((i==null?void 0:i.type)==="getAlert"){const{showAlert:a,alert:h}=i;if(a){if(!h||!h.enabled)return sessionStorage.removeItem("cas-alert-height"),!1;let o=new Date,r=new Date(h==null?void 0:h.startDate),n=new Date(h==null?void 0:h.endDate);if(o>r&&o<n){let l=sessionStorage.getItem("hideAlert");this.showAlert=!l&&a,this.alert={title:h==null?void 0:h.Titulo,text:h==null?void 0:h.Contenido,active:h==null?void 0:h.enabled},console.log("Alerta activa"),this.delay(200).then(()=>this.handleSpaces())}else return!1;this.requestUpdate()}}}}async delay(t){return new Promise(e=>setTimeout(e,t))}async handleSpaces(){var h,o,r;const t=this.shadowRoot.querySelector("cas-header-taxonomy"),e=(h=this.shadowRoot.querySelector("cas-header-head"))==null?void 0:h.getClientRects()[0].height,i=(o=this.shadowRoot.querySelector("cas-header-pre-head"))==null?void 0:o.getClientRects()[0].height,a=(r=this.shadowRoot.querySelector("cas-header-taxonomy"))==null?void 0:r.getClientRects()[0].height;if(this.showAlert){const n=this.shadowRoot.querySelector("cas-alert");n==null||n.addEventListener("close",()=>{sessionStorage.setItem("hideAlert","true"),sessionStorage.removeItem("cas-alert-height"),this.showAlert=!1,this.spaceHeight=e+i+a,t.style.top=`${e+i}px`,this.requestUpdate()});const l=n==null?void 0:n.getClientRects()[0].height;this.type!==B.HOME?this.spaceHeight=e+l:(this.spaceHeight=e+i+a+l,t.style.top=`${e+i+l}px`),sessionStorage.setItem("cas-alert-height",String(Math.round(l)))}else this.type!==B.HOME?this.spaceHeight=e:(this.spaceHeight=e+i+a,t.style.top=`${e+i}px`);this.requestUpdate()}async firstUpdated(){const t=this.disableMode==="true",{theme:e}=x3(this.darkMode);this.theme=t?"light":e,this.defaultDarkMode(),this.handleEvents(),await this.handleAlert(),await this.delay(200),this.handleSpaces()}render(){const{alert:t,type:e,bookingBox:i,theme:a}=this,h=i==="true";return f`
|
|
6411
6410
|
<header class="container ${this.type}" data-theme=${a} style="height: ${this.spaceHeight}px">
|
|
6412
6411
|
${this.showAlert?f`<cas-alert
|
|
6413
6412
|
showCloseButton
|