hichatbot-chat-npm
Version:
Proyecto para la integración de la ventana flotante del chatbot, realizado en Vanilla JS puro para garantizar la integración con cualquier lenguaje.
519 lines (494 loc) • 97.2 kB
JavaScript
!function(t,e){t&&!t.getElementById("livereloadscript")&&((e=t.createElement("script")).async=1,e.src="//"+(self.location.host||"localhost").split(":")[0]+":35729/livereload.js?snipver=1",e.id="livereloadscript",t.getElementsByTagName("head")[0].appendChild(e))}(self.document),function(){"use strict";const t=globalThis,e=t.ShadowRoot&&(void 0===t.ShadyCSS||t.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,s=Symbol(),i=new WeakMap;class n{constructor(t,e,i){if(this._$cssResult$=!0,i!==s)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e}get styleSheet(){let t=this.o;const s=this.t;if(e&&void 0===t){const e=void 0!==s&&1===s.length;e&&(t=i.get(s)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),e&&i.set(s,t))}return t}toString(){return this.cssText}}const o=(t,...e)=>{const i=1===t.length?t[0]:e.reduce(((e,s,i)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+t[i+1]),t[0]);return new n(i,t,s)},r=e?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return(t=>new n("string"==typeof t?t:t+"",void 0,s))(e)})(t):t,{is:a,defineProperty:h,getOwnPropertyDescriptor:c,getOwnPropertyNames:l,getOwnPropertySymbols:p,getPrototypeOf:d}=Object,u=globalThis,f=u.trustedTypes,g=f?f.emptyScript:"",m=u.reactiveElementPolyfillSupport,y=(t,e)=>t,b={toAttribute(t,e){switch(e){case Boolean:t=t?g:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t)}return t},fromAttribute(t,e){let s=t;switch(e){case Boolean:s=null!==t;break;case Number:s=null===t?null:Number(t);break;case Object:case Array:try{s=JSON.parse(t)}catch(t){s=null}}return s}},_=(t,e)=>!a(t,e),v={attribute:!0,type:String,converter:b,reflect:!1,hasChanged:_};Symbol.metadata??=Symbol("metadata"),u.litPropertyMetadata??=new WeakMap;class x extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,e=v){if(e.state&&(e.attribute=!1),this._$Ei(),this.elementProperties.set(t,e),!e.noAccessor){const s=Symbol(),i=this.getPropertyDescriptor(t,s,e);void 0!==i&&h(this.prototype,t,i)}}static getPropertyDescriptor(t,e,s){const{get:i,set:n}=c(this.prototype,t)??{get(){return this[e]},set(t){this[e]=t}};return{get(){return i?.call(this)},set(e){const o=i?.call(this);n.call(this,e),this.requestUpdate(t,o,s)},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??v}static _$Ei(){if(this.hasOwnProperty(y("elementProperties")))return;const t=d(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties)}static finalize(){if(this.hasOwnProperty(y("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(y("properties"))){const t=this.properties,e=[...l(t),...p(t)];for(const s of e)this.createProperty(s,t[s])}const t=this[Symbol.metadata];if(null!==t){const e=litPropertyMetadata.get(t);if(void 0!==e)for(const[t,s]of e)this.elementProperties.set(t,s)}this._$Eh=new Map;for(const[t,e]of this.elementProperties){const s=this._$Eu(t,e);void 0!==s&&this._$Eh.set(s,t)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(t){const e=[];if(Array.isArray(t)){const s=new Set(t.flat(1/0).reverse());for(const t of s)e.unshift(r(t))}else void 0!==t&&e.push(r(t));return e}static _$Eu(t,e){const s=e.attribute;return!1===s?void 0:"string"==typeof s?s:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((t=>t(this)))}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.()}removeController(t){this._$EO?.delete(t)}_$E_(){const t=new Map,e=this.constructor.elementProperties;for(const s of e.keys())this.hasOwnProperty(s)&&(t.set(s,this[s]),delete this[s]);t.size>0&&(this._$Ep=t)}createRenderRoot(){const s=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return((s,i)=>{if(e)s.adoptedStyleSheets=i.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const e of i){const i=document.createElement("style"),n=t.litNonce;void 0!==n&&i.setAttribute("nonce",n),i.textContent=e.cssText,s.appendChild(i)}})(s,this.constructor.elementStyles),s}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((t=>t.hostConnected?.()))}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach((t=>t.hostDisconnected?.()))}attributeChangedCallback(t,e,s){this._$AK(t,s)}_$EC(t,e){const s=this.constructor.elementProperties.get(t),i=this.constructor._$Eu(t,s);if(void 0!==i&&!0===s.reflect){const n=(void 0!==s.converter?.toAttribute?s.converter:b).toAttribute(e,s.type);this._$Em=t,null==n?this.removeAttribute(i):this.setAttribute(i,n),this._$Em=null}}_$AK(t,e){const s=this.constructor,i=s._$Eh.get(t);if(void 0!==i&&this._$Em!==i){const t=s.getPropertyOptions(i),n="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:b;this._$Em=i,this[i]=n.fromAttribute(e,t.type),this._$Em=null}}requestUpdate(t,e,s){if(void 0!==t){if(s??=this.constructor.getPropertyOptions(t),!(s.hasChanged??_)(this[t],e))return;this.P(t,e,s)}!1===this.isUpdatePending&&(this._$ES=this._$ET())}P(t,e,s){this._$AL.has(t)||this._$AL.set(t,e),!0===s.reflect&&this._$Em!==t&&(this._$Ej??=new Set).add(t)}async _$ET(){this.isUpdatePending=!0;try{await this._$ES}catch(t){Promise.reject(t)}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,e]of this._$Ep)this[t]=e;this._$Ep=void 0}const t=this.constructor.elementProperties;if(t.size>0)for(const[e,s]of t)!0!==s.wrapped||this._$AL.has(e)||void 0===this[e]||this.P(e,this[e],s)}let t=!1;const e=this._$AL;try{t=this.shouldUpdate(e),t?(this.willUpdate(e),this._$EO?.forEach((t=>t.hostUpdate?.())),this.update(e)):this._$EU()}catch(e){throw t=!1,this._$EU(),e}t&&this._$AE(e)}willUpdate(t){}_$AE(t){this._$EO?.forEach((t=>t.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t)}_$EU(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return!0}update(t){this._$Ej&&=this._$Ej.forEach((t=>this._$EC(t,this[t]))),this._$EU()}updated(t){}firstUpdated(t){}}x.elementStyles=[],x.shadowRootOptions={mode:"open"},x[y("elementProperties")]=new Map,x[y("finalized")]=new Map,m?.({ReactiveElement:x}),(u.reactiveElementVersions??=[]).push("2.0.4");const w=globalThis,C=w.trustedTypes,E=C?C.createPolicy("lit-html",{createHTML:t=>t}):void 0,k="$lit$",A=`lit$${Math.random().toFixed(9).slice(2)}$`,$="?"+A,D=`<${$}>`,S=document,B=()=>S.createComment(""),T=t=>null===t||"object"!=typeof t&&"function"!=typeof t,F=Array.isArray,O="[ \t\n\f\r]",R=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,L=/-->/g,N=/>/g,M=RegExp(`>|${O}(?:([^\\s"'>=/]+)(${O}*=${O}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),P=/'/g,H=/"/g,U=/^(?:script|style|textarea|title)$/i,j=(t=>(e,...s)=>({_$litType$:t,strings:e,values:s}))(1),I=Symbol.for("lit-noChange"),q=Symbol.for("lit-nothing"),z=new WeakMap,V=S.createTreeWalker(S,129);function W(t,e){if(!F(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==E?E.createHTML(e):e}const Y=(t,e)=>{const s=t.length-1,i=[];let n,o=2===e?"<svg>":3===e?"<math>":"",r=R;for(let e=0;e<s;e++){const s=t[e];let a,h,c=-1,l=0;for(;l<s.length&&(r.lastIndex=l,h=r.exec(s),null!==h);)l=r.lastIndex,r===R?"!--"===h[1]?r=L:void 0!==h[1]?r=N:void 0!==h[2]?(U.test(h[2])&&(n=RegExp("</"+h[2],"g")),r=M):void 0!==h[3]&&(r=M):r===M?">"===h[0]?(r=n??R,c=-1):void 0===h[1]?c=-2:(c=r.lastIndex-h[2].length,a=h[1],r=void 0===h[3]?M:'"'===h[3]?H:P):r===H||r===P?r=M:r===L||r===N?r=R:(r=M,n=void 0);const p=r===M&&t[e+1].startsWith("/>")?" ":"";o+=r===R?s+D:c>=0?(i.push(a),s.slice(0,c)+k+s.slice(c)+A+p):s+A+(-2===c?e:p)}return[W(t,o+(t[s]||"<?>")+(2===e?"</svg>":3===e?"</math>":"")),i]};class K{constructor({strings:t,_$litType$:e},s){let i;this.parts=[];let n=0,o=0;const r=t.length-1,a=this.parts,[h,c]=Y(t,e);if(this.el=K.createElement(h,s),V.currentNode=this.el.content,2===e||3===e){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes)}for(;null!==(i=V.nextNode())&&a.length<r;){if(1===i.nodeType){if(i.hasAttributes())for(const t of i.getAttributeNames())if(t.endsWith(k)){const e=c[o++],s=i.getAttribute(t).split(A),r=/([.?@])?(.*)/.exec(e);a.push({type:1,index:n,name:r[2],strings:s,ctor:"."===r[1]?G:"?"===r[1]?tt:"@"===r[1]?et:X}),i.removeAttribute(t)}else t.startsWith(A)&&(a.push({type:6,index:n}),i.removeAttribute(t));if(U.test(i.tagName)){const t=i.textContent.split(A),e=t.length-1;if(e>0){i.textContent=C?C.emptyScript:"";for(let s=0;s<e;s++)i.append(t[s],B()),V.nextNode(),a.push({type:2,index:++n});i.append(t[e],B())}}}else if(8===i.nodeType)if(i.data===$)a.push({type:2,index:n});else{let t=-1;for(;-1!==(t=i.data.indexOf(A,t+1));)a.push({type:7,index:n}),t+=A.length-1}n++}}static createElement(t,e){const s=S.createElement("template");return s.innerHTML=t,s}}function Z(t,e,s=t,i){if(e===I)return e;let n=void 0!==i?s._$Co?.[i]:s._$Cl;const o=T(e)?void 0:e._$litDirective$;return n?.constructor!==o&&(n?._$AO?.(!1),void 0===o?n=void 0:(n=new o(t),n._$AT(t,s,i)),void 0!==i?(s._$Co??=[])[i]=n:s._$Cl=n),void 0!==n&&(e=Z(t,n._$AS(t,e.values),n,i)),e}class J{constructor(t,e){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=e}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:e},parts:s}=this._$AD,i=(t?.creationScope??S).importNode(e,!0);V.currentNode=i;let n=V.nextNode(),o=0,r=0,a=s[0];for(;void 0!==a;){if(o===a.index){let e;2===a.type?e=new Q(n,n.nextSibling,this,t):1===a.type?e=new a.ctor(n,a.name,a.strings,this,t):6===a.type&&(e=new st(n,this,t)),this._$AV.push(e),a=s[++r]}o!==a?.index&&(n=V.nextNode(),o++)}return V.currentNode=S,i}p(t){let e=0;for(const s of this._$AV)void 0!==s&&(void 0!==s.strings?(s._$AI(t,s,e),e+=s.strings.length-2):s._$AI(t[e])),e++}}class Q{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,e,s,i){this.type=2,this._$AH=q,this._$AN=void 0,this._$AA=t,this._$AB=e,this._$AM=s,this.options=i,this._$Cv=i?.isConnected??!0}get parentNode(){let t=this._$AA.parentNode;const e=this._$AM;return void 0!==e&&11===t?.nodeType&&(t=e.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,e=this){t=Z(this,t,e),T(t)?t===q||null==t||""===t?(this._$AH!==q&&this._$AR(),this._$AH=q):t!==this._$AH&&t!==I&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):(t=>F(t)||"function"==typeof t?.[Symbol.iterator])(t)?this.k(t):this._(t)}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t))}_(t){this._$AH!==q&&T(this._$AH)?this._$AA.nextSibling.data=t:this.T(S.createTextNode(t)),this._$AH=t}$(t){const{values:e,_$litType$:s}=t,i="number"==typeof s?this._$AC(t):(void 0===s.el&&(s.el=K.createElement(W(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===i)this._$AH.p(e);else{const t=new J(i,this),s=t.u(this.options);t.p(e),this.T(s),this._$AH=t}}_$AC(t){let e=z.get(t.strings);return void 0===e&&z.set(t.strings,e=new K(t)),e}k(t){F(this._$AH)||(this._$AH=[],this._$AR());const e=this._$AH;let s,i=0;for(const n of t)i===e.length?e.push(s=new Q(this.O(B()),this.O(B()),this,this.options)):s=e[i],s._$AI(n),i++;i<e.length&&(this._$AR(s&&s._$AB.nextSibling,i),e.length=i)}_$AR(t=this._$AA.nextSibling,e){for(this._$AP?.(!1,!0,e);t&&t!==this._$AB;){const e=t.nextSibling;t.remove(),t=e}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t))}}class X{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,e,s,i,n){this.type=1,this._$AH=q,this._$AN=void 0,this.element=t,this.name=e,this._$AM=i,this.options=n,s.length>2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=q}_$AI(t,e=this,s,i){const n=this.strings;let o=!1;if(void 0===n)t=Z(this,t,e,0),o=!T(t)||t!==this._$AH&&t!==I,o&&(this._$AH=t);else{const i=t;let r,a;for(t=n[0],r=0;r<n.length-1;r++)a=Z(this,i[s+r],e,r),a===I&&(a=this._$AH[r]),o||=!T(a)||a!==this._$AH[r],a===q?t=q:t!==q&&(t+=(a??"")+n[r+1]),this._$AH[r]=a}o&&!i&&this.j(t)}j(t){t===q?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"")}}class G extends X{constructor(){super(...arguments),this.type=3}j(t){this.element[this.name]=t===q?void 0:t}}class tt extends X{constructor(){super(...arguments),this.type=4}j(t){this.element.toggleAttribute(this.name,!!t&&t!==q)}}class et extends X{constructor(t,e,s,i,n){super(t,e,s,i,n),this.type=5}_$AI(t,e=this){if((t=Z(this,t,e,0)??q)===I)return;const s=this._$AH,i=t===q&&s!==q||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,n=t!==q&&(s===q||i);i&&this.element.removeEventListener(this.name,this,s),n&&this.element.addEventListener(this.name,this,t),this._$AH=t}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t)}}class st{constructor(t,e,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=e,this.options=s}get _$AU(){return this._$AM._$AU}_$AI(t){Z(this,t)}}const it=w.litHtmlPolyfillSupport;it?.(K,Q),(w.litHtmlVersions??=[]).push("3.2.1");class nt extends x{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const e=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=((t,e,s)=>{const i=s?.renderBefore??e;let n=i._$litPart$;if(void 0===n){const t=s?.renderBefore??null;i._$litPart$=n=new Q(e.insertBefore(B(),t),t,void 0,s??{})}return n._$AI(t),n})(e,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return I}}nt._$litElement$=!0,nt.finalized=!0,globalThis.litElementHydrateSupport?.({LitElement:nt});const ot=globalThis.litElementPolyfillSupport;ot?.({LitElement:nt}),(globalThis.litElementVersions??=[]).push("4.1.1");const rt=o`
:host {
display: block;
position: fixed;
bottom: -600px; /* Comienza fuera de la pantalla */
right: 64px;
width: min(100%, 416px);
height: calc(100vh - 20px); /* Ajusta dinámicamente el alto a la pantalla */
max-height: 600px; /* Asegura que no exceda los 600px en pantallas grandes */
z-index: 9999;
box-sizing: border-box;
animation: slide-up 0.4s cubic-bezier(0.25, 0.1, 0.25, 1) forwards; /* Animación más suave */
/* Adaptación para pantallas más pequeñas */
@media screen and (max-width: 500px) {
padding-left: 10px;
padding-right: 10px;
right: 0px;
border-radius: 8px;
}
@media screen and (max-width: 1024px){
animation: slide-up-mobile 0.4s cubic-bezier(0.25, 0.1, 0.25, 1) forwards; /* Animación más suave */
}
}
.layout-container {
width: 100%;
height: 100%;
border-radius: 18px;
background: #fff;
box-shadow: 1px 3px 20px 0px rgba(0, 0, 0, 0.2);
display: flex;
flex-direction: column;
overflow: hidden;
}
.header-container {
width: 100%;
height: 118px;
max-width: 416px;
max-height: 118px;
flex-shrink: 0;
background: var(--Fondo_sidebar, #fafafa);
box-sizing: border-box;
border-radius: 18px 18px 0px 0px; /* Bordes superiores redondeados */
}
.main-chat-container {
width: 100%;
height: 422px;
max-width: 416px;
max-height: 422px;
background: #fff; /* Fondo blanco */
overflow-y: auto; /* Habilita scroll si el contenido excede */
box-sizing: border-box;
}
.footer-container {
box-sizing: border-box;
width: 100%;
height: 60px;
max-width: 416px;
max-height: 60px;
flex-shrink: 0;
background: var(--Fondo_sidebar, #fafafa);
}
/* Definición de la animación */
@keyframes slide-up {
0% {
bottom: -600px; /* Fuera de la pantalla */
opacity: 0; /* Invisible */
}
100% {
bottom: 87px; /* Posición final */
opacity: 1; /* Totalmente visible */
}
}
/* Definición de la animación para pantallas pequeñas */
@keyframes slide-up-mobile {
0% {
bottom: -600px; /* Fuera de la pantalla */
opacity: 0; /* Invisible */
}
100% {
bottom: calc(5vh); /* Centrado dinámicamente */
opacity: 1; /* Totalmente visible */
}
}
`;customElements.define("layout-component",class extends nt{static styles=rt;render(){return j`
<div class="layout-container">
<!-- Header -->
<div class="header-container">
<slot name="header"></slot>
</div>
<!-- Main Chat -->
<div class="main-chat-container">
<slot name="main-chat"></slot>
</div>
<!-- Footer -->
<div class="footer-container">
<slot name="footer"></slot>
</div>
</div>
`}});const at=o`
.main-chat-layout {
width: 100%;
height: 100%;
display: flex;
flex-direction: column;
overflow: hidden; /* Evita desbordes */
box-sizing: border-box;
}
.message-body-container {
max-width: 100%;
height: 361px;
max-height: 361px;
box-sizing: border-box;
flex-shrink: 0;
overflow-y: auto; /* Habilita scroll si el contenido excede */
background: #fff; /* Fondo blanco */
scrollbar-width: thin; /* Scroll fino en Firefox */
scrollbar-color: rgba(0, 0, 0, 0.2) transparent; /* Colores en Firefox */
}
.input-message-container {
max-width: 416px;
height: 61px;
max-height: 61px;
flex-shrink: 0;
background: #fff; /* Fondo blanco */
border-top: 0.5px solid var(--Gray-5, #E0E0E0);
border-bottom: 0.5px solid var(--Gray-5, #E0E0E0);
box-sizing: border-box;
}`,ht=o`
.message-container {
display: flex;
width: 100%;
align-items: center;
background: #FFF;
}
.messages-body-container{
box-sizing: border-box;
display:flex;
flex-direction: column;
gap: 22px;
margin: 18px;
max-width: 416px;
height: auto;
background: #FFF;
}
.assistant {
justify-content: start;
}
.user{
justify-content: end;
}`,ct=o`
.message {
margin: 0px;
text-align: start;
padding: 20px;
max-width: 342px;
width: auto;
font-family: Manrope, sans-serif;
font-size: 16px;
font-style: normal;
font-weight: 500;
line-height: 22px;
box-sizing: border-box;
position: relative; /* Asegúrate de que el contenedor tenga posición relativa */
}
.assistant {
background: #F5F5F5;
border-radius: 0px 10px 10px 10px;
color: var(--Black_text, #1E1E1E);
}
.user {
border-radius: 10px 0px 10px 10px;
background: var(--Azul_chatbot, #1446FF);
color: #FFF;
}
.loader {
display:block;
width: 5px;
height: 5px;
border-radius: 50%;
background-color: #1446FF;
box-shadow: 8px 0 #1446FF, -8px 0 #1446FF;
position: relative;
animation: flash 0.5s ease-out infinite alternate;
}
@keyframes flash {
0% {
background-color: #c8d4ff;
box-shadow: 8px 0 #c8d4ff, -8px 0 #1446FF;
}
50% {
background-color: #1446FF;
box-shadow: 8px 0 #c8d4ff, -8px 0 #c8d4ff;
}
100% {
background-color: #c8d4ff;
box-shadow: 8px 0 #1446FF, -8px 0 #c8d4ff;
}
}
`;class lt extends nt{static properties={message:{type:String},userType:{type:String},loading:{type:Boolean}};static styles=ct;constructor(){super(),this.message="",this.userType="",this.loading=!1}_renderMessageWithBreaks(){return j`${this.message.split("\n").map((t=>j`${t}<br>`))}`}render(){return j`
<div>
<p class="message ${this.userType}">
${this.loading?j`<span class="loader"></span> <!-- Loader separado -->`:this._renderMessageWithBreaks()}
</p>
</div>
`}}customElements.define("message-component",lt);customElements.define("messages-body-component",class extends nt{static properties={messages:{type:Array}};static styles=ht;constructor(){super(),this.messages=[]}render(){const t=this.messages||[];return j`
<div class="messages-body-container">
${t[0]&&t.map((t=>j`
<div
class="message-container ${t?.userType}">
<message-component
.userType=${t?.userType}
.message=${t?.text}
.loading=${t?.loading}>
</message-component>
</div>
`))}
</div>
`}});const pt=o`
.input-message-container{
display: flex;
justify-content: center;
align-items: center;
max-width: 100%;
height: 100%;
box-sizing: border-box;
}
.input-message{
box-sizing: border-box;
padding: 18px 6px 18px 24px ;
border: 0px;
width: 100%;
color: black;
font-family: Manrope;
font-size: 16px;
font-style: normal;
font-weight: 500;
line-height: 22px;
outline: none;
transition: border-color 0.3s , box-shadow 0.3s ;
}
.input-message:focus {
border: 0.5px solid var(--Azul_chatbot, #1446FF); /* Cambia el borde */
background-color: white; /* Cambia el fondo */
}
.button-send{
cursor:pointer;
display: flex;
justify-content:center;
align-items: center;
border: 0px;
margin: 6px 18px;
border-radius: 100%;
width: 50px;
height: 50px;
max-width: 50px;
max-height: 50px;
flex-shrink: 0;
background-color: var(--Azul_chatbot, #1446FF);
box-shadow: 0px 2px 2px 0px rgba(0, 0, 0, 0.10);
}
.icon-send{
position: relative;
left: 2px;
width: 22px;
height: 19px;
max-width: 22px;
max-height: 19px;
}`;customElements.define("input-message-component",class extends nt{static properties={message:{type:String,state:!0},submit:{type:Function}};static styles=pt;constructor(){super(),this.message="",this.submit=async()=>{}}_handleInputChange(t){this.message=t.target.value}async _handleSubmit(){if(this.submit&&"function"==typeof this.submit&&this.message.trim().length>0)try{const t=this.message;this.message="",await this.submit(t)}catch(t){console.error("Problemas al comunicarse con el chat-bot: ",t?.message)}}_handleKeyPress(t){"Enter"===t.key&&this._handleSubmit()}render(){return j`
<div class="input-message-container">
<input
type="text"
class="input-message"
.value=${this.message}
@input=${this._handleInputChange}
@keypress=${this._handleKeyPress}
placeholder="Escribe tu mensaje..."
/>
<button
@click=${this._handleSubmit}
class="button-send"
aria-label="Enviar mensaje"
title="Enviar mensaje"
.disabled=${!this.message}
>
<img class="icon-send" src=${"data:image/svg+xml,%3Csvg%20width%3D%2223%22%20height%3D%2220%22%20viewBox%3D%220%200%2023%2020%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cmask%20id%3D%22mask0_1023_4570%22%20style%3D%22mask-type%3Aalpha%22%20maskUnits%3D%22userSpaceOnUse%22%20x%3D%220%22%20y%3D%220%22%20width%3D%2223%22%20height%3D%2221%22%3E%3Crect%20x%3D%220.441406%22%20y%3D%220.705887%22%20width%3D%2222.0588%22%20height%3D%2219.3015%22%20fill%3D%22%23D9D9D9%22%2F%3E%3C%2Fmask%3E%3Cg%20mask%3D%22url%28%23mask0_1023_4570%29%22%3E%3Cpath%20d%3D%22M2.1875%2019.3458C1.77114%2019.5121%201.37603%2019.4767%201.00218%2019.2396C0.628332%2019.0025%200.441406%2018.6571%200.441406%2018.2035V12.3838L9.98598%2010.0773L0.441406%207.77073V1.95099C0.441406%201.49741%200.628332%201.15205%201.00218%200.914914C1.37603%200.677782%201.77114%200.642398%202.1875%200.808758L21.429%208.92124C21.9416%209.15078%2022.198%209.53693%2022.198%2010.0797C22.198%2010.6224%2021.9416%2011.0069%2021.429%2011.2333L2.1875%2019.3458Z%22%20fill%3D%22white%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E"} alt="Icono de enviar" />
</button>
</div>
`}});class dt extends nt{static styles=at;static properties={messages:{type:Array},onSendMessage:{type:Function},isDragging:{type:Boolean},startY:{type:Number},scrollTopStart:{type:Number}};constructor(){super(),this.messages=[],this.onSendMessage=t=>{console.log("Mensaje enviado:",t)},this.isDragging=!1,this.startY=0,this.scrollTopStart=0}_scrollToBottom(){const t=this.renderRoot.querySelector(".message-body-container");t&&requestAnimationFrame((()=>{t.scrollTo({top:t.scrollHeight,behavior:"smooth"})}))}updated(t){t.has("messages")&&this._scrollToBottom()}_onMouseDown(t){this.isDragging=!0,this.startY=t.clientY;const e=this.renderRoot.querySelector(".message-body-container");this.scrollTopStart=e.scrollTop,t.preventDefault()}_onMouseMove(t){if(!this.isDragging)return;const e=this.renderRoot.querySelector(".message-body-container"),s=t.clientY-this.startY;e.scrollTop=this.scrollTopStart-s}_onMouseUp(){this.isDragging=!1}render(){return j`
<div class="main-chat-layout">
<!-- Message Body -->
<div class="message-body-container"
@mousedown=${this._onMouseDown}
@mousemove=${this._onMouseMove}
@mouseup=${this._onMouseUp}
@mouseleave=${this._onMouseUp}
>
<messages-body-component
.messages=${this.messages}
></messages-body-component>
</div>
<!-- Input Message -->
<div class="input-message-container">
<input-message-component
.submit=${this.onSendMessage}
></input-message-component>
</div>
</div>
`}}customElements.define("main-chat-layout",dt);const ut=o`
.header-container {
padding: 20px; /* Espaciado interno */
display: flex; /* Habilita el modelo de caja flexible */
align-items: center; /* Alinea elementos verticalmente al centro */
justify-content: start; /* Alinea elementos horizontalmente al inicio */
position: relative; /* Necesario si se posicionarán elementos hijos con valores absolutos */
width: 100%; /* Ancho por defecto: ocupa todo el espacio disponible */
height: 100%; /* Altura fija */
gap: 15px; /* Espaciado entre elementos flexibles */
background: var(
--Azul_chatbot,
#1446ff
); /* Fondo con variable o valor de color */
box-sizing: border-box;
}
.header-title {
margin: 0px;
color: var(--Fondo_sidebar, #fafafa);
font-family: Montserrat;
font-size: 20.23px;
font-style: normal;
font-weight: 300;
line-height: normal;
}
.header-title-span {
font-weight: 700;
}
.header-sub-title {
color: var(--Fondo_sidebar, #fafafa);
margin: 0px;
font-family: Manrope;
font-size: 16px;
font-style: normal;
font-weight: 500;
line-height: 22px;
}
.container-text {
display: flex;
flex-direction: column;
justify-content: center;
gap: 2.64px;
}
.icon-container {
width: 78px;
height: 78px;
flex-shrink: 0;
display: flex;
align-items: center;
justify-content: center;
background-color: #e7e7e7; /* Fondo gris para el ícono */
border-radius: 50%; /* Hacerlo circular */
}
/* Nueva clase para posicionar el icon-btn-component arriba a la derecha */
.header-button-position {
position: absolute;
top: 10px; /* Ajusta la distancia desde la parte superior */
right: 10px; /* Ajusta la distancia desde la parte derecha */
}
`;var ft="data:image/svg+xml,%3C%3Fxml%20version%3D%221.0%22%20encoding%3D%22UTF-8%22%3F%3E%3Csvg%20version%3D%221.1%22%20viewBox%3D%220%200%202048%201602%22%20width%3D%22533%22%20height%3D%22417%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20transform%3D%22translate%28370%2C2%29%22%20d%3D%22m0%200h20l16%205%2014%209%208%208%208%2013%205%2016v19l-4%2014-7%2013-6%207-10%208-14%207-10%203-1%20302%2013%203%2015%208%2011%209%209%209%2010%2014%2010%2018%201%203%204-1%2011-8%2015-9%2025-14%2021-10%2026-10%2031-10%2036-8%2028-4%2034-2h661l31%202%2031%204%2031%207%2027%208%2029%2011%2020%209%2025%2013%2015%209%206%204%2010-16%208-10%209-10%2010-8%2016-8%2011-3%201-48v-255l-8-1-11-5-10-6-10-10-8-13-5-17v-16l3-12%208-16%204-5h2l2-4%209-7%2012-6%2011-3h20l16%205%2010%206%2010%209%207%209%206%2013%202%208v21l-3%2011-7%2014-9%2010-11%208-11%205-10%203-1%20302%2010%202%2016%208%2011%208%206%205%2011%2014%209%2014%209%2019%206%2018%206%2026%202%2018v41l-3%2022-6%2024-4%2012v7l11%2028%207%2021%207%2028%206%2033%203%2028%202%2060%2025%207%2019%208%2023%2012%2013%209%2013%2010%2011%209%2015%2014%2015%2015%209%2011%2010%2011%2012%2016%2013%2018%2012%2019%209%2015%2012%2022%2012%2023%2013%2029%2012%2031%209%2025%2010%2034%208%2033%207%2038%205%2037%204%2049v17l-3%2035-4%2028-6%2031-8%2026-6%2015-10%2021-7%2011-8%2011-11%2012-10%2010-14%2010-16%208-18%206-11%202h-26l-25-5-21-7-16-8-16-9-13-9-16-12-12-11-8-7-15-15-7-8-12-14-14-18-14-20-12-19-13-22-10-18-10-22-4%201-8%208-7%208-9%209-8%207-8%208-28%2022-24%2016-20%2012-15%208-26%2012-36%2013-29%208-25%205-31%204-34%202h-647l-27-1-36-4-31-6-31-9-28-10-20-9-16-8-17-9-19-12-16-11-13-10-11-9-14-12-10-10-8-7-9-10-2-1-2%207-10%2019-12%2021-13%2021-13%2019-14%2019-11%2013-9%2011-11%2011-7%208-13%2012-8%207-17%2013-12%208-15%209-23%2011-20%206-22%204h-25l-15-3-17-6-15-8-13-10-8-7-7-8-10-12-9-14-10-19-8-21-7-23-6-29-4-26-3-28v-45l5-44%205-35%206-31%2010-40%2011-35%2011-29%2013-31%2012-25%2013-25%2012-21%2014-22%2011-15%2012-16%2011-13%209-11%2028-28%2011-9%2015-12%2012-8%2014-8%2016-8%2015-6%2013-4h3v-43l2-32%204-28%206-29%209-31%205-15%201-7-6-12-9-24-5-21-3-18-1-10v-35l4-28%205-20%207-19%209-19%2012-17%2011-12%2010-8%2016-8%2012-3v-303l-8-1-11-5-10-6-12-12-7-14-4-16v-12l3-14%208-16%209-10%208-6%2014-7z%22%20fill%3D%22%23010101%22%2F%3E%3Cpath%20transform%3D%22translate%28694%2C419%29%22%20d%3D%22m0%200h33l1%201v247l-1%201-47%201-25%202-20%204-27%209-17%208-14%208-16%2011-11%209-16%2015-7%208-10%2013-7%2011-8%2014-10%2021-8%2025-4%2021-1%209-1%2027v23l1%2023%204%2025%206%2021%208%2020%2011%2021%2010%2015%2011%2014%207%207%204%205%208%207%2015%2012%2013%209%2016%209%2020%209%2018%206%2023%205%2016%202%2014%201%20301%201%20379-1%2025-2%2020-4%2024-7%2021-9%2015-8%2013-9%2013-10%2014-12%2012-13%2012-16%2012-20%2010-21%209-27%204-20%202-22v-47l-3-30-5-22-9-24-11-22-11-17-10-13-11-12-11-11-17-13-16-10-15-8-25-10-17-5-24-4-15-1-58-1-1-1v-247l1-1h31l38%202%2030%204%2028%206%2027%208%2028%2010%2027%2012%2026%2014%2020%2013%2016%2011%2014%2011%2014%2012%2012%2011%2025%2025%209%2011%2013%2016%2013%2019%2010%2015%2018%2034%2013%2029%2012%2036%207%2028%205%2029%203%2031v317l-2%2026-5%2033-7%2029-9%2029-10%2025-14%2029-13%2023-14%2021-12%2016-11%2014-14%2015-7%208h-2l-1%203-8%207-9%209-11%209-12%2010-18%2013-21%2013-19%2011-24%2012-25%2010-31%2010-28%207-28%205-28%203-24%201h-637l-36-1-29-3-31-6-27-7-30-10-23-10-25-12-22-13-15-10-14-10-15-12-11-9-9-9-8-7-15-15-9-11-8-9-13-17-9-13-13-21-14-25-9-20-9-23-9-28-7-29-4-21-3-26-1-15-1-35v-43l1-237%203-31%205-28%208-33%2011-32%2013-30%2012-22%2011-19%208-12%2014-19%2013-16%2013-15%208-9h2l1-3%208-7%2014-13%2011-9%2017-13%2023-15%2015-9%2029-15%2021-9%2031-11%2034-9%2036-6%2020-2z%22%20fill%3D%22%23FDFDFD%22%2F%3E%3Cpath%20transform%3D%22translate%28734%2C420%29%22%20d%3D%22m0%200h571l1%20246-1%202h-571l-1-1v-246z%22%20fill%3D%22%23FDFDFD%22%2F%3E%3Cpath%20transform%3D%22translate%281756%2C930%29%22%20d%3D%22m0%200%209%206%2015%2013%2013%2012%2016%2016%209%2011%208%209%2015%2020%2011%2015%2011%2017%207%2011%206%2011%206%2010%206%2012%209%2017%2014%2032%207%2019%2013%2036%209%2030%2010%2044%206%2034%203%2023%203%2045v38l-3%2036-5%2030-4%2017-4%2014-7%2021-12%2025-12%2017-12%2014-8%207-6%207-11-1-17-4-17-6-16-8-16-9-13-9-16-12-12-11-8-7-15-15-7-8-12-14-14-18-14-20-12-19-13-22-10-18-10-22-3-2%206-8%2011-13%2011-15%207-10%2012-20%2014-27%2010-22%209-24%208-27%207-30%204-24%202-21%201-20z%22%20fill%3D%22%23808080%22%2F%3E%3Cpath%20transform%3D%22translate%28280%2C937%29%22%20d%3D%22m0%200h2l1%2044%201%20128%201%2026%203%2026%204%2022%207%2029%2010%2032%208%2020%2011%2024%2015%2027%208%2013%207%2011%209%2012%2011%2014%2012%2014%201%202h-2l-2%207-10%2019-12%2021-13%2021-13%2019-14%2019-11%2013-9%2011-11%2011-7%208-13%2012-8%207-17%2013-12%208-15%209-23%2011-20%206-15%203h-6l-7-8-11-11-13-17-9-15-10-22-9-27-6-24-5-34-2-26v-45l3-38%205-39%206-32%207-30%208-28%2011-32%2012-31%209-20%2012-25%2014-26%2016-26%2015-22%2014-19%2012-14%209-11%2011-11%207-8%2015-14z%22%20fill%3D%22%23808080%22%2F%3E%3Cpath%20transform%3D%22translate%281340%2C738%29%22%20d%3D%22m0%200h14l19%202%2020%205%2021%209%2018%2011%2011%209%2010%209%2011%2013%2011%2017%208%2017%206%2018%204%2022v30l-3%2018-5%2017-10%2021-12%2018-12%2014-12%2011-14%2010-21%2011-21%207-14%203-9%201h-27l-22-4-21-7-19-10-11-7-14-12-11-11-12-17-8-14-5-11-7-24-2-12-1-22%202-19%206-24%207-17%208-14%2011-15%209-10%207-7%2018-13%2018-10%2015-6%2019-5z%22%20fill%3D%22%23074ACB%22%2F%3E%3Cpath%20transform%3D%22translate%28697%2C738%29%22%20d%3D%22m0%200h14l20%202%2019%205%2015%206%2020%2011%2013%2010%2010%209%207%207%2012%2016%2010%2018%207%2018%205%2021%201%208v33l-3%2017-5%2017-9%2019-10%2015-7%209-9%2010-7%207-13%2010-19%2011-18%207-18%205-14%202h-28l-22-4-20-7-16-8-14-9-10-8-10-9-7-8-10-14-9-16-7-17-5-19-2-15v-25l3-19%205-17%209-21%2010-16%209-11%203-4h2l2-4h2v-2l14-11%2015-10%2016-8%2016-6%2021-4z%22%20fill%3D%22%23074ACB%22%2F%3E%3Cpath%20transform%3D%22translate%281756%2C869%29%22%20d%3D%22m0%200%208%201%2020%206%2021%209%2014%208%2015%2010%2012%209%2014%2012%2016%2015%209%209%207%208%2011%2013%2013%2017%2013%2018%2010%2015%2013%2022%209%2016%2010%2019%2011%2023%2013%2032%2013%2036%206%2019%2010%2038%207%2035%205%2031%203%2028%201%2014v65l-3%2031-4%2023-8%2032-10%2027-10%2019-11%2016-9%2011-6%207-11%209-10%207-10%206-16%206-19%204-11%201v-3l7-8%2010-12%2010-15%2012-23%209-25%205-17%205-24%205-37%201-14v-49l-2-29-4-34-6-36-6-28-9-33-12-36-14-36-12-27-13-26-11-20-14-23-12-18-14-19-10-13-13-15-11-12-11-11-8-7-13-11-15-11-1-8v-35z%22%20fill%3D%22%23FCFCFC%22%2F%3E%3Cpath%20transform%3D%22translate%28278%2C871%29%22%20d%3D%22m0%200h4l1%2017v27l-1%2015-5%205-15%2013-13%2012-10%2010-7%208-13%2015-14%2019-13%2018-12%2019-14%2024-12%2023-8%2016-11%2025-13%2033-12%2036-7%2024-9%2039-7%2043-4%2035-1%2011-1%2024v22l2%2030%205%2036%205%2024%208%2026%206%2015%208%2016%209%2015%209%2012%2012%2014%201%203h-9l-18-3-15-5-16-9-14-11-7-6-7-8-8-10-10-15-8-16-8-19-7-23-7-34-3-24-2-30v-36l3-42%204-30%209-47%208-32%2011-35%2015-40%2011-25%2012-25%2012-23%208-13%2010-17%2011-16%2013-18%2011-14%2011-13%2014-15%2014-14%208-7%2016-13%2017-12%2018-10%2021-9z%22%20fill%3D%22%23FBFBFB%22%2F%3E%3Cpath%20transform%3D%22translate%28693%2C797%29%22%20d%3D%22m0%200h23l16%204%2012%205%2014%209%2013%2012%2010%2014%205%2011%205%2017%201%206v20l-4%2017-5%2012-7%2012-11%2012-8%207-13%208-15%206-13%203h-24l-16-4-14-6-13-9-9-8-10-13-8-16-5-17-1-8v-11l3-17%206-17%2010-16%2012-12%2014-10%2015-7%2011-3z%22%20fill%3D%22%23010101%22%2F%3E%3Cpath%20transform%3D%22translate%281335%2C797%29%22%20d%3D%22m0%200h23l14%203%2017%207%2013%209%2013%2013%209%2014%206%2013%204%2016%201%2016-2%2016-6%2017-8%2014-12%2014-13%2010-14%207-17%205-5%201h-23l-16-4-12-5-14-9-10-9v-2l-3-1-10-14-6-13-4-15-1-6v-19l4-18%205-12%207-11%209-10%208-8%2010-7%2016-8z%22%20fill%3D%22%23010101%22%2F%3E%3Cpath%20transform%3D%22translate%28910%2C966%29%22%20d%3D%22m0%200h230l2%201-1%2014-3%2015-6%2018-8%2015-9%2012-11%2012-10%208-19%2011-16%206-19%204-10%201h-10l-16-2-16-4-16-7-15-9-13-11-11-12-11-18-5-11-5-17-3-19v-6z%22%20fill%3D%22%23FBFBFB%22%2F%3E%3Cpath%20transform%3D%22translate%28371%2C431%29%22%20d%3D%22m0%200h18l14%204%2011%206%2010%208%208%208%2013%2018%208%2016v5l-13%2011-11%209-10%209-8%207-19%2019-9%2011-12%2014-14%2019-15%2024-10%2018-9%2017-9%2020h-3l-8-19-7-24-4-20-2-21v-23l2-22%205-24%206-20%208-18%207-12%2012-16%208-8%2010-7%2012-6z%22%20fill%3D%22%23FCFCFC%22%2F%3E%3Cpath%20transform%3D%22translate%281630%2C431%29%22%20d%3D%22m0%200h18l13%204%2012%206%2011%209%209%209%2011%2016%208%2015%207%2019%205%2017%204%2024%201%2013v30l-2%2020-4%2021-6%2021-3-1-7-16-12-22-14-21-9-12-10-13-14-17-16-17-15-14-11-9-13-11-17-12-6-5%201-4%2010-16%209-10%206-7%2011-8%2012-6z%22%20fill%3D%22%23FCFCFC%22%2F%3E%3Cpath%20transform%3D%22translate%281632%2C7%29%22%20d%3D%22m0%200h14l13%203%2010%205%2012%2010%207%2010%205%2010%202%207%201%2013-2%2012-4%2011-7%2010-10%2010-16%208-7%202-13%201-13-2-12-5-11-8-8-9-7-14-3-14%201-14%204-13%207-12%2010-10%2014-8z%22%20fill%3D%22%23FBFBFB%22%2F%3E%3Cpath%20transform%3D%22translate%28372%2C7%29%22%20d%3D%22m0%200h14l14%203%2011%206%2011%209%207%2010%205%2011%202%209v15l-3%2013-6%2011-9%2010-11%208-9%204-7%202-12%201-14-2-12-5-11-8-8-9-8-16-2-9v-13l4-16%209-14%209-9%2014-8z%22%20fill%3D%22%23FBFBFB%22%2F%3E%3Cpath%20transform%3D%22translate%281905%2C1589%29%22%20d%3D%22m0%200v3%201l19-1v1l-21%203-2-2z%22%20fill%3D%22%23808080%22%2F%3E%3C%2Fsvg%3E";const gt=o`
.button-default {
display: flex;
justify-content: center;
align-items: center;
padding:0;
background-color: transparent;
cursor: pointer;
border: 0;
}
.button-default:hover {
border: 0; /* Quita el borde del botón */
background-color: transparent; /* H
}
.button-close{
width: 30px;
height: 30px;
}
`,mt=o`
.sm{
width: 19px;
height: 18px;
flex-shrink: 0;
margin-top: 5px;
}
.default{
width: 30px;
height: 30px;
flex-shrink: 0;
}
.md{
width: 80px;
height: 19px;
}
.profile{
width: 51px;
height: 40px;
}
`;customElements.define("icon-img-component",class extends nt{static properties={icon:{type:String},description:{type:String},iconStyle:{type:String}};static styles=mt;constructor(){super(),this.icon="",this.description="",this.iconStyle=""}render(){return j`
<img
class=${this.iconStyle}
src=${this.icon}
alt="${this.description}"
/>
`}});class yt extends nt{static properties={icon:{type:String},styleImg:{type:String},description:{type:String},styleBtn:{type:String},callback:{type:Function},isActive:{type:Boolean}};static styles=gt;constructor(){super(),this.styleImg="",this.styleBtn="",this.icon="",this.description="",this.callback=async()=>{},this.isActive=!0}render(){return j`
<button
@click=${this.callback}
class=${`button-default ${this.styleBtn}`}
aria-label=${this.description}
title=${this.description}
.disabled=${!this.isActive}
>
<icon-img-component
.iconStyle=${this.styleImg}
.icon=${this.icon}
.description=${`Icono de ${this.description}`}
>
</icon-img-component>
</button>
`}}customElements.define("icon-btn-component",yt);customElements.define("header-component",class extends nt{static properties={closeChat:{type:Function}};static styles=ut;constructor(){super(),this.closeChat=()=>{console.log("Chat toggled!")}}render(){return j`
<section class="header-container">
<div class="icon-container">
<icon-img-component
.iconStyle=${"profile"}
.icon=${ft}
.description=${"Icono de enviar"}
>
</icon-img-component>
</div>
<div class="container-text">
<h2 class="header-title">
<span class="header-title-span">HI CHAT</span> ASSISTANT
</h2>
<p class="header-sub-title">¡Hola! 👋 Estoy aquí para ayudarte</p>
</div>
<icon-btn-component
class="header-button-position"
.styleImg=${"default"}
.icon=${"data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%2230%22%20height%3D%2230%22%20viewBox%3D%220%200%2030%2030%22%20fill%3D%22none%22%3E%20%20%3Cmask%20id%3D%22mask0_1090_4558%22%20style%3D%22mask-type%3Aalpha%22%20maskUnits%3D%22userSpaceOnUse%22%20x%3D%220%22%20y%3D%220%22%20width%3D%2230%22%20height%3D%2230%22%3E%20%20%20%20%3Crect%20width%3D%2230%22%20height%3D%2230%22%20fill%3D%22%23BEBEBE%22%2F%3E%20%20%3C%2Fmask%3E%20%20%3Cg%20mask%3D%22url%28%23mask0_1090_4558%29%22%3E%20%20%20%20%3Cpath%20d%3D%22M16%2020.7316L8%2012.145L9.06674%2011L16%2018.4417L22.9333%2011L24%2012.145L16%2020.7316Z%22%20fill%3D%22%23BEBEBE%22%2F%3E%20%20%3C%2Fg%3E%3C%2Fsvg%3E"}
.description=${"Cerrar Hi chat Bot"}
.styleBtn=${"button-close"}
.callback=${this.closeChat.bind(this)}
>
</icon-btn-component>
</section>
`}});const bt=o`
.container-footer {
display: flex;
justify-content:space-evenly;
align-items: center;
width: 100%;
height: 100%;
flex-shrink: 0;
}
.text-footer{
color: var(--Gray-4, #BDBDBD);
font-family: Manrope;
font-size: 14px;
font-style: normal;
font-weight: 500;
line-height: 111%;
letter-spacing: 0.2px;
}
.container-right{
display: flex;
align-items: center;
}
`;customElements.define("footer-component",class extends nt{static styles=bt;render(){return j`
<div class="container-footer">
<icon-img-component
.icon=${"data:image/svg+xml,%3Csvg%20width%3D%2280%22%20height%3D%2219%22%20viewBox%3D%220%200%2080%2019%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M17.3631%201.2597H16.096C15.6293%201.2597%2015.251%201.63354%2015.251%202.09469V3.39307C15.251%203.85422%2015.6293%204.22806%2016.096%204.22806H17.3631C17.8298%204.22806%2018.2081%203.85422%2018.2081%203.39307V2.09469C18.2081%201.63354%2017.8298%201.2597%2017.3631%201.2597Z%22%20fill%3D%22%23BDBDBD%22%2F%3E%3Cpath%20d%3D%22M18.1379%206.19913H15.3218V17.5857H18.1379V6.19913Z%22%20fill%3D%22%23BDBDBD%22%2F%3E%3Cpath%20d%3D%22M44.3186%2012.0777C44.8272%2011.5442%2045.0727%2010.7596%2045.0549%209.72385C45.0391%208.47136%2044.6237%207.52444%2043.8089%206.88309C42.994%206.24174%2041.656%205.92087%2039.7948%205.9205C38.4649%205.9205%2037.3814%206.10612%2036.5442%206.47735C35.7071%206.84858%2035.0991%207.4709%2034.7204%208.34432C34.3371%209.21811%2034.1455%2010.4046%2034.1455%2011.9037C34.1455%2013.2957%2034.3371%2014.4321%2034.7204%2015.313C35.1037%2016.1939%2035.7218%2016.8392%2036.5748%2017.2488C37.427%2017.6592%2038.5576%2017.8644%2039.9664%2017.8644C40.4826%2017.8644%2041.0341%2017.8372%2041.6209%2017.7827C42.1912%2017.7309%2042.7583%2017.6496%2043.3201%2017.5393C43.8174%2017.4463%2044.3046%2017.3067%2044.7751%2017.1223L44.4919%2015.3365C43.7877%2015.4145%2043.0563%2015.4762%2042.2977%2015.5218C41.5391%2015.5673%2040.8702%2015.5906%2040.2909%2015.5917C39.5082%2015.5917%2038.8823%2015.4872%2038.4133%2015.2783C37.9444%2015.0694%2037.6079%2014.6791%2037.404%2014.1075C37.2728%2013.7081%2037.1892%2013.2949%2037.1548%2012.8763H41.793C42.9685%2012.8771%2043.8104%2012.6109%2044.3186%2012.0777ZM37.1112%2011.1369C37.1367%2010.4055%2037.2148%209.82402%2037.3479%209.39757C37.5122%208.87225%2037.7978%208.50886%2038.2049%208.30739C38.6119%208.10591%2039.1831%208.00555%2039.9183%208.0063C40.7633%208.0063%2041.3618%208.12998%2041.7137%208.37734C42.0657%208.6247%2042.2496%209.06533%2042.2654%209.69922C42.2654%2010.101%2042.191%2010.4411%2042.0423%2010.7195C41.8935%2010.9978%2041.5536%2011.1369%2041.0227%2011.1369H37.1112Z%22%20fill%3D%22%23BDBDBD%22%2F%3E%3Cpath%20d%3D%22M55.1967%205.9205C54.3517%205.9205%2053.4951%206.10612%2052.627%206.47735C51.8023%206.82955%2050.9814%207.32875%2050.1643%207.97496L49.9377%206.1992H47.6155V17.5852H50.4554V9.6024C51.0726%209.25966%2051.7071%208.9481%2052.3562%208.66892C52.9186%208.42387%2053.5253%208.29367%2054.1398%208.28612C54.6564%208.28612%2055.0242%208.40215%2055.2432%208.63422C55.4622%208.86628%2055.5717%209.29124%2055.5717%209.90909V17.5852H58.4116V9.05115C58.412%206.96442%2057.3404%205.92087%2055.1967%205.9205Z%22%20fill%3D%22%23BDBDBD%22%2F%3E%3Cpath%20d%3D%22M63.669%201.2597H62.4019C61.9352%201.2597%2061.5569%201.63354%2061.5569%202.09469V3.39307C61.5569%203.85422%2061.9352%204.22806%2062.4019%204.22806H63.669C64.1357%204.22806%2064.5141%203.85422%2064.5141%203.39307V2.09469C64.5141%201.63354%2064.1357%201.2597%2063.669%201.2597Z%22%20fill%3D%22%23BDBDBD%22%2F%3E%3Cpath%20d%3D%22M64.4437%206.19913H61.627V17.5857H64.4437V6.19913Z%22%20fill%3D%22%23BDBDBD%22%2F%3E%3Cpath%20d%3D%22M75.7559%2017.5851H78.6893L74.9811%2011.7413L78.4078%206.19913H75.4739L72.7795%2010.7446H72.4142L69.7006%206.19913H66.7666L70.1933%2011.7413L66.4851%2017.5851H69.4655L72.4754%2012.6227H72.7263L75.7559%2017.5851Z%22%20fill%3D%22%23BDBDBD%22%2F%3E%3Cpath%20d%3D%22M31.1986%200.934475C30.7681%200.919924%2030.4203%200.91153%2030.1541%200.91153C29.2777%200.91153%2028.5737%201.05069%2028.042%201.32902C27.534%201.58274%2027.1284%201.9998%2026.8922%202.51155C26.657%203.02195%2026.5395%203.6398%2026.5399%204.3651V6.20241L24.498%206.31434V8.14661H26.5399V17.585H29.3798V10.1703L27.3657%208.17963C27.363%208.17697%2027.3612%208.17358%2027.3605%208.1699C27.3597%208.16621%2027.3601%208.1624%2027.3616%208.15893C27.363%208.15545%2027.3655%208.15249%2027.3686%208.15039C27.3718%208.1483%2027.3755%208.14718%2027.3793%208.14717H32.8066V6.19905H29.3798V4.71487C29.3798%204.09665%2029.512%203.65603%2029.7763%203.39299C30.0406%203.12996%2030.5023%202.99844%2031.1612%202.99844H33.4381L33.7009%201.11916C33.3132%201.05103%2032.9213%201.0084%2032.5279%200.991559C32.0718%200.969546%2031.6286%200.950518%2031.1986%200.934475Z%22%20fill%3D%22%23BDBDBD%22%2F%3E%3Cpath%20d%3D%22M8.89245%205.92035C8.03228%205.92035%207.16002%206.11361%206.27569%206.50014C5.46083%206.86453%204.69301%207.3239%203.98856%207.86847C4.02764%207.64461%204.06219%207.40228%204.09165%207.14093C4.14794%206.60549%204.17536%206.06747%204.17378%205.52915L4.14999%201.35477H1.31006V17.585H4.14999V10.313L2.13474%208.32178C2.13196%208.3192%202.13005%208.31584%202.12926%208.31216C2.12847%208.30847%202.12884%208.30464%202.13032%208.30117C2.1318%208.29769%202.13432%208.29475%202.13754%208.29274C2.14076%208.29072%202.14452%208.28972%202.14833%208.28988H7.69565C7.74209%208.28988%207.78854%208.28596%207.83498%208.28596C8.35079%208.28596%208.7146%208.402%208.92644%208.63406C9.13827%208.86613%209.24381%209.29108%209.24305%209.90893V17.585H12.1062V9.051C12.1062%206.96427%2011.035%205.92072%208.89245%205.92035Z%22%20fill%3D%22%23BDBDBD%22%2F%3E%3C%2Fsvg%3E"}
.iconStyle=${"md"}
.description="Logo Hi Fenix"
>
</icon-img-component>
<div class="container-right">
<icon-img-component
.icon=${"data:image/svg+xml,%3Csvg%20width%3D%2219%22%20height%3D%2219%22%20viewBox%3D%220%200%2019%2019%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cmask%20id%3D%22mask0_1056_1039%22%20style%3D%22mask-type%3Aalpha%22%20maskUnits%3D%22userSpaceOnUse%22%20x%3D%220%22%20y%3D%220%22%20width%3D%2219%22%20height%3D%2219%22%3E%3Crect%20y%3D%220.387756%22%20width%3D%2219%22%20height%3D%2218%22%20fill%3D%22%23D9D9D9%22%2F%3E%3C%2Fmask%3E%3Cg%20mask%3D%22url%28%23mask0_1056_1039%29%22%3E%3Cpath%20d%3D%22M7.6%2012.1878H10.4C10.5983%2012.1878%2010.7646%2012.1207%2010.8988%2011.9865C11.0329%2011.8523%2011.1%2011.6861%2011.1%2011.4878V10.0878H9.7V10.7878H8.3V7.98776H9.7V8.68776H11.1V7.28776C11.1%207.08942%2011.0329%206.92317%2010.8988%206.78901C10.7646%206.65484%2010.5983%206.58776%2010.4%206.58776H7.6C7.40167%206.58776%207.23542%206.65484%207.10125%206.78901C6.96708%206.92317%206.9%207.08942%206.9%207.28776V11.4878C6.9%2011.6861%206.96708%2011.8523%207.10125%2011.9865C7.23542%2012.1207%207.40167%2012.1878%207.6%2012.1878ZM9%2016.3878C8.03167%2016.3878%207.12167%2016.204%206.27%2015.8365C5.41833%2015.469%204.6775%2014.9703%204.0475%2014.3403C3.4175%2013.7103%202.91875%2012.9694%202.55125%2012.1178C2.18375%2011.2661%202%2010.3561%202%209.38776C2%208.41942%202.18375%207.50942%202.55125%206.65776C2.91875%205.80609%203.4175%205.06526%204.0475%204.43526C4.6775%203.80526%205.41833%203.30651%206.27%202.93901C7.12167%202.57151%208.03167%202.38776%209%202.38776C9.96833%202.38776%2010.8783%202.57151%2011.73%202.93901C12.5817%203.30651%2013.3225%203.80526%2013.9525%204.43526C14.5825%205.06526%2015.0812%205.80609%2015.4487%206.65776C15.8162%207.50942%2016%208.41942%2016%209.38776C16%2010.3561%2015.8162%2011.2661%2015.4487%2012.1178C15.0812%2012.9694%2014.5825%2013.7103%2013.9525%2014.3403C13.3225%2014.9703%2012.5817%2015.469%2011.73%2015.8365C10.8783%2016.204%209.96833%2016.3878%209%2016.3878ZM9%2014.9878C10.5633%2014.9878%2011.8875%2014.4453%2012.9725%2013.3603C14.0575%2012.2753%2014.6%2010.9511%2014.6%209.38776C14.6%207.82442%2014.0575%206.50026%2012.9725%205.41526C11.8875%204.33026%2010.5633%203.78776%209%203.78776C7.43667%203.78776%206.1125%204.33026%205.0275%205.41526C3.9425%206.50026%203.4%207.82442%203.4%209.38776C3.4%2010.9511%203.9425%2012.2753%205.0275%2013.3603C6.1125%2014.4453%207.43667%2014.9878%209%2014.9878Z%22%20fill%3D%22%23BDBDBD%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E"}
.iconStyle=${"sm"}
.description="Logo Hi Fenix"
>
</icon-img-component>
<p class="text-footer">
Todos los derechos reservados
</p>
</div>
</div>
`}});const _t=Object.create(null);_t.open="0",_t.close="1",_t.ping="2",_t.pong="3",_t.message="4",_t.upgrade="5",_t.noop="6";const vt=Object.create(null);Object.keys(_t).forEach((t=>{vt[_t[t]]=t}));const xt={type:"error",data:"parser error"},wt="function"==typeof Blob||"und