@botuyo/chat-widget-standalone 1.0.3 → 1.0.6
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/README.md +158 -226
- package/dist/{ChatWidget-DQS2YAHX.js → ChatWidget-3m1RqH_c.js} +6 -6
- package/dist/{ChatWidget-DQS2YAHX.js.map → ChatWidget-3m1RqH_c.js.map} +1 -1
- package/dist/botuyo-chat.css +1 -1
- package/dist/botuyo-chat.es.js +1 -1
- package/dist/botuyo-chat.es.js.map +1 -1
- package/dist/botuyo-chat.umd.css +1 -1
- package/dist/botuyo-chat.umd.js +1 -1
- package/dist/botuyo-chat.umd.js.map +1 -1
- package/dist/chunk-audio-C4Q6VB-1.js +13 -0
- package/dist/chunk-audio-C4Q6VB-1.js.map +1 -0
- package/dist/chunk-chat-ui-DmqgsaBa.js +104 -0
- package/dist/chunk-chat-ui-DmqgsaBa.js.map +1 -0
- package/dist/{chunk-gallery-DsrT5sHg.js → chunk-gallery-Ca7lW3V4.js} +2 -2
- package/dist/{chunk-gallery-DsrT5sHg.js.map → chunk-gallery-Ca7lW3V4.js.map} +1 -1
- package/dist/src/chat-widget/ChatWidget.d.ts.map +1 -1
- package/dist/src/chat-widget/components/AudioPlayer.d.ts.map +1 -1
- package/dist/src/chat-widget/components/ChatWindow.d.ts +2 -1
- package/dist/src/chat-widget/components/ChatWindow.d.ts.map +1 -1
- package/dist/src/chat-widget/components/Icons.d.ts +4 -1
- package/dist/src/chat-widget/components/Icons.d.ts.map +1 -1
- package/dist/src/chat-widget/components/InputArea.d.ts +2 -1
- package/dist/src/chat-widget/components/InputArea.d.ts.map +1 -1
- package/dist/src/chat-widget/components/InputArea.stories.d.ts +1 -0
- package/dist/src/chat-widget/components/InputArea.stories.d.ts.map +1 -1
- package/dist/src/chat-widget/components/VoiceCallDemo.d.ts +15 -0
- package/dist/src/chat-widget/components/VoiceCallDemo.d.ts.map +1 -0
- package/dist/src/chat-widget/types/index.d.ts +2 -0
- package/dist/src/chat-widget/types/index.d.ts.map +1 -1
- package/dist/standalone.d.ts.map +1 -1
- package/dist/stats-umd.html +1 -1
- package/dist/stats.html +1 -1
- package/package.json +149 -147
- package/dist/chunk-audio-DG36n3qS.js +0 -10
- package/dist/chunk-audio-DG36n3qS.js.map +0 -1
- package/dist/chunk-chat-ui-TnfA4tMe.js +0 -90
- package/dist/chunk-chat-ui-TnfA4tMe.js.map +0 -1
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import{r as e,j as r}from"./vendor-react-CtfcjTlq.js";import{g as a,c as s,R as t,L as l,P as o,a as n,C as c}from"./chunk-chat-ui-DmqgsaBa.js";const i=e.memo(function({url:i,isBot:d,primaryColor:u}){const[h,m]=e.useState(!1),[x,f]=e.useState(0),[p,j]=e.useState(0),[y,b]=e.useState(!0),[g,N]=e.useState(null),w=e.useRef(null),C=e.useMemo(()=>a({primaryColor:u}),[u]),k=e.useCallback(()=>{g||(h?w.current?.pause():w.current?.play().catch(e=>{console.error("[AudioPlayer] Play error:",e),N("Error al reproducir")}),m(!h))},[h,g]),v=e.useCallback(()=>{f(w.current?.duration||0)},[]),S=e.useCallback(()=>{b(!1),N(null)},[]),M=e.useCallback(()=>{console.error("[AudioPlayer] Failed to load audio:",i),b(!1),N("No se pudo cargar")},[i]),P=e.useCallback(()=>{b(!0),N(null),w.current&&w.current.load()},[]);/* @__PURE__ */
|
|
2
|
+
return r.jsxs("div",{className:s("flex items-center gap-3 py-1 min-w-[200px]",d?"text-foreground":"text-primary-foreground"),children:[
|
|
3
|
+
/* @__PURE__ */r.jsx("audio",{ref:w,src:i,preload:"metadata",onLoadedMetadata:v,onCanPlayThrough:S,onTimeUpdate:()=>j(w.current?.currentTime||0),onEnded:()=>m(!1),onError:M}),g?
|
|
4
|
+
/* @__PURE__ */r.jsx("button",{onClick:P,className:"w-8 h-8 rounded-full flex items-center justify-center shrink-0 bg-red-500/20 text-red-500 hover:bg-red-500/30 transition-colors",title:"Reintentar",children:/* @__PURE__ */r.jsx(t,{className:"w-4 h-4"})}):
|
|
5
|
+
/* @__PURE__ */r.jsx("button",{onClick:k,disabled:y,className:"w-8 h-8 rounded-full flex items-center justify-center shrink-0 transition-opacity",style:{backgroundColor:d?C:"hsl(var(--card))",color:d?"white":C,opacity:y?.6:1},children:y?/* @__PURE__ */r.jsx(l,{className:"w-4 h-4 animate-spin"}):h?/* @__PURE__ */r.jsx(o,{className:"w-4 h-4 fill-current"}):/* @__PURE__ */r.jsx(n,{className:"w-4 h-4 fill-current ml-0.5"})}),
|
|
6
|
+
/* @__PURE__ */r.jsx("div",{className:"flex-1 space-y-1",children:g?/* @__PURE__ */r.jsxs("div",{className:"flex items-center gap-1.5 text-red-500",children:[
|
|
7
|
+
/* @__PURE__ */r.jsx(c,{className:"w-3 h-3"}),
|
|
8
|
+
/* @__PURE__ */r.jsx("span",{className:"text-[9px] font-bold",children:g})]}):/* @__PURE__ */r.jsxs(r.Fragment,{children:[
|
|
9
|
+
/* @__PURE__ */r.jsx("div",{className:"relative h-1 w-full bg-current/20 rounded-full overflow-hidden",children:/* @__PURE__ */r.jsx("div",{className:"absolute h-full bg-current rounded-full transition-all",style:{width:`${p/x*100||0}%`}})}),
|
|
10
|
+
/* @__PURE__ */r.jsxs("div",{className:"flex justify-between text-[9px] font-bold opacity-60",children:[
|
|
11
|
+
/* @__PURE__ */r.jsxs("span",{children:[Math.floor(p/60),":",Math.floor(p%60).toString().padStart(2,"0")]}),
|
|
12
|
+
/* @__PURE__ */r.jsx("span",{children:y?"--:--":`${Math.floor(x/60)}:${Math.floor(x%60).toString().padStart(2,"0")}`})]})]})})]})});export{i as AudioPlayer};
|
|
13
|
+
//# sourceMappingURL=chunk-audio-C4Q6VB-1.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chunk-audio-C4Q6VB-1.js","sources":["../src/chat-widget/components/AudioPlayer.tsx"],"sourcesContent":["'use client'\r\n\r\nimport { useState, useRef, useMemo, memo, useCallback } from 'react'\r\nimport { Play, Pause, Loader2, AlertCircle, RotateCw } from './Icons'\r\nimport { cn } from '@/lib/utils'\r\nimport { getPrimaryColor } from '../utils/theme'\r\n\r\ninterface AudioPlayerProps {\r\n url: string\r\n isBot: boolean\r\n primaryColor?: string\r\n}\r\n\r\nexport type { AudioPlayerProps }\r\n\r\nexport const AudioPlayer = memo(function AudioPlayer({\r\n url,\r\n isBot,\r\n primaryColor,\r\n}: AudioPlayerProps) {\r\n const [isPlaying, setIsPlaying] = useState(false)\r\n const [duration, setDuration] = useState(0)\r\n const [currentTime, setCurrentTime] = useState(0)\r\n const [isLoading, setIsLoading] = useState(true)\r\n const [error, setError] = useState<string | null>(null)\r\n const audioRef = useRef<HTMLAudioElement>(null)\r\n\r\n const brandColor = useMemo(() => getPrimaryColor({ primaryColor }), [primaryColor])\r\n\r\n const togglePlay = useCallback(() => {\r\n if (error) return\r\n if (isPlaying) audioRef.current?.pause()\r\n else audioRef.current?.play().catch((e) => {\r\n console.error('[AudioPlayer] Play error:', e)\r\n setError('Error al reproducir')\r\n })\r\n setIsPlaying(!isPlaying)\r\n }, [isPlaying, error])\r\n\r\n const handleLoadedMetadata = useCallback(() => {\r\n setDuration(audioRef.current?.duration || 0)\r\n }, [])\r\n\r\n const handleCanPlayThrough = useCallback(() => {\r\n setIsLoading(false)\r\n setError(null)\r\n }, [])\r\n\r\n const handleError = useCallback(() => {\r\n console.error('[AudioPlayer] Failed to load audio:', url)\r\n setIsLoading(false)\r\n setError('No se pudo cargar')\r\n }, [url])\r\n\r\n const handleRetry = useCallback(() => {\r\n setIsLoading(true)\r\n setError(null)\r\n if (audioRef.current) {\r\n audioRef.current.load()\r\n }\r\n }, [])\r\n\r\n return (\r\n <div\r\n className={cn(\r\n 'flex items-center gap-3 py-1 min-w-[200px]',\r\n isBot ? 'text-foreground' : 'text-primary-foreground'\r\n )}\r\n >\r\n <audio\r\n ref={audioRef}\r\n src={url}\r\n preload=\"metadata\"\r\n onLoadedMetadata={handleLoadedMetadata}\r\n onCanPlayThrough={handleCanPlayThrough}\r\n onTimeUpdate={() => setCurrentTime(audioRef.current?.currentTime || 0)}\r\n onEnded={() => setIsPlaying(false)}\r\n onError={handleError}\r\n />\r\n \r\n {error ? (\r\n // Error state - show retry button\r\n <button\r\n onClick={handleRetry}\r\n className=\"w-8 h-8 rounded-full flex items-center justify-center shrink-0 bg-red-500/20 text-red-500 hover:bg-red-500/30 transition-colors\"\r\n title=\"Reintentar\"\r\n >\r\n <RotateCw className=\"w-4 h-4\" />\r\n </button>\r\n ) : (\r\n // Normal play/pause button\r\n <button\r\n onClick={togglePlay}\r\n disabled={isLoading}\r\n className=\"w-8 h-8 rounded-full flex items-center justify-center shrink-0 transition-opacity\"\r\n style={{\r\n backgroundColor: isBot ? brandColor : 'hsl(var(--card))',\r\n color: isBot ? 'white' : brandColor,\r\n opacity: isLoading ? 0.6 : 1,\r\n }}\r\n >\r\n {isLoading ? (\r\n <Loader2 className=\"w-4 h-4 animate-spin\" />\r\n ) : isPlaying ? (\r\n <Pause className=\"w-4 h-4 fill-current\" />\r\n ) : (\r\n <Play className=\"w-4 h-4 fill-current ml-0.5\" />\r\n )}\r\n </button>\r\n )}\r\n \r\n <div className=\"flex-1 space-y-1\">\r\n {error ? (\r\n <div className=\"flex items-center gap-1.5 text-red-500\">\r\n <AlertCircle className=\"w-3 h-3\" />\r\n <span className=\"text-[9px] font-bold\">{error}</span>\r\n </div>\r\n ) : (\r\n <>\r\n <div className=\"relative h-1 w-full bg-current/20 rounded-full overflow-hidden\">\r\n <div\r\n className=\"absolute h-full bg-current rounded-full transition-all\"\r\n style={{ width: `${(currentTime / duration) * 100 || 0}%` }}\r\n />\r\n </div>\r\n <div className=\"flex justify-between text-[9px] font-bold opacity-60\">\r\n <span>\r\n {Math.floor(currentTime / 60)}:\r\n {Math.floor(currentTime % 60)\r\n .toString()\r\n .padStart(2, '0')}\r\n </span>\r\n <span>\r\n {isLoading ? '--:--' : `${Math.floor(duration / 60)}:${Math.floor(duration % 60).toString().padStart(2, '0')}`}\r\n </span>\r\n </div>\r\n </>\r\n )}\r\n </div>\r\n </div>\r\n )\r\n})\r\n"],"names":["AudioPlayer","memo","url","isBot","primaryColor","isPlaying","setIsPlaying","useState","duration","setDuration","currentTime","setCurrentTime","isLoading","setIsLoading","error","setError","audioRef","useRef","brandColor","useMemo","getPrimaryColor","togglePlay","useCallback","current","pause","play","catch","e","console","handleLoadedMetadata","handleCanPlayThrough","handleError","handleRetry","load","jsxs","className","cn","children","jsx","ref","src","preload","onLoadedMetadata","onCanPlayThrough","onTimeUpdate","onEnded","onError","onClick","title","RotateCw","disabled","style","backgroundColor","color","opacity","Loader2","Pause","Play","AlertCircle","Fragment","width","Math","floor","toString","padStart"],"mappings":"gJAeO,MAAMA,EAAcC,EAAAA,KAAK,UAAqBC,IACnDA,EAAAC,MACAA,EAAAC,aACAA,IAEA,MAAOC,EAAWC,GAAgBC,EAAAA,UAAS,IACpCC,EAAUC,GAAeF,EAAAA,SAAS,IAClCG,EAAaC,GAAkBJ,EAAAA,SAAS,IACxCK,EAAWC,GAAgBN,EAAAA,UAAS,IACpCO,EAAOC,GAAYR,EAAAA,SAAwB,MAC5CS,EAAWC,EAAAA,OAAyB,MAEpCC,EAAaC,EAAAA,QAAQ,IAAMC,EAAgB,CAAEhB,iBAAiB,CAACA,IAE/DiB,EAAaC,EAAAA,YAAY,KACzBR,IACAT,EAAWW,EAASO,SAASC,UACnBD,SAASE,OAAOC,MAAOC,IACnCC,QAAQd,MAAM,4BAA6Ba,GAC3CZ,EAAS,yBAEXT,GAAcD,KACb,CAACA,EAAWS,IAETe,EAAuBP,EAAAA,YAAY,KACvCb,EAAYO,EAASO,SAASf,UAAY,IACzC,IAEGsB,EAAuBR,EAAAA,YAAY,KACvCT,GAAa,GACbE,EAAS,OACR,IAEGgB,EAAcT,EAAAA,YAAY,KAC9BM,QAAQd,MAAM,sCAAuCZ,GACrDW,GAAa,GACbE,EAAS,sBACR,CAACb,IAEE8B,EAAcV,EAAAA,YAAY,KAC9BT,GAAa,GACbE,EAAS,MACLC,EAASO,SACXP,EAASO,QAAQU,QAElB;AAEH,OACEC,EAAAA,KAAC,MAAA,CACCC,UAAWC,EACT,6CACAjC,EAAQ,kBAAoB,2BAG9BkC,SAAA;eAAAC,EAAAA,IAAC,QAAA,CACCC,IAAKvB,EACLwB,IAAKtC,EACLuC,QAAQ,WACRC,iBAAkBb,EAClBc,iBAAkBb,EAClBc,aAAc,IAAMjC,EAAeK,EAASO,SAASb,aAAe,GACpEmC,QAAS,IAAMvC,GAAa,GAC5BwC,QAASf,IAGVjB;eAECwB,EAAAA,IAAC,SAAA,CACCS,QAASf,EACTG,UAAU,kIACVa,MAAM,aAENX,wBAAAC,EAAAA,IAACW,EAAA,CAASd,UAAU;eAItBG,EAAAA,IAAC,SAAA,CACCS,QAAS1B,EACT6B,SAAUtC,EACVuB,UAAU,oFACVgB,MAAO,CACLC,gBAAiBjD,EAAQe,EAAa,mBACtCmC,MAAOlD,EAAQ,QAAUe,EACzBoC,QAAS1C,EAAY,GAAM,GAG5ByB,SAAAzB,iBACC0B,EAAAA,IAACiB,EAAA,CAAQpB,UAAU,yBACjB9B,iBACFiC,EAAAA,IAACkB,EAAA,CAAMrB,UAAU,wCAEjBG,EAAAA,IAACmB,EAAA,CAAKtB,UAAU;eAKtBG,EAAAA,IAAC,OAAIH,UAAU,mBACZE,0BACCH,EAAAA,KAAC,MAAA,CAAIC,UAAU,yCACbE,SAAA;iBAAAC,IAACoB,EAAA,CAAYvB,UAAU;eACvBG,EAAAA,IAAC,OAAA,CAAKH,UAAU,uBAAwBE,SAAAvB,sBAG1CoB,EAAAA,KAAAyB,EAAAA,SAAA,CACEtB,SAAA;iBAAAC,IAAC,MAAA,CAAIH,UAAU,iEACbE,wBAAAC,EAAAA,IAAC,MAAA,CACCH,UAAU,yDACVgB,MAAO,CAAES,MAAO,GAAIlD,EAAcF,EAAY,KAAO;iBAGzD0B,KAAC,MAAA,CAAIC,UAAU,uDACbE,SAAA;eAAAH,OAAC,OAAA,CACEG,SAAA,CAAAwB,KAAKC,MAAMpD,EAAc,IAAI,IAC7BmD,KAAKC,MAAMpD,EAAc,IACvBqD,WACAC,SAAS,EAAG;eAEjB1B,EAAAA,IAAC,QACED,SAAAzB,EAAY,QAAU,GAAGiD,KAAKC,MAAMtD,EAAW,OAAOqD,KAAKC,MAAMtD,EAAW,IAAIuD,WAAWC,SAAS,EAAG,mBAQxH"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import{r as e,j as t,a as r,M as s,R as o}from"./vendor-react-CtfcjTlq.js";import{c as n,d as a}from"./chunk-markdown-xGy7kpWU.js";const i={es:{online:"En línea",offline:"Desconectado",connecting:"Conectando...",con_amor_paseo_libre:"Con ❤️ por BotUyo",preview:"Vista previa",fotos:"Fotos",ubicacion:"Ubicación",input_placeholder:"Escribe un mensaje...",send:"Enviar",attach_photo:"Adjuntar foto",attach_location:"Compartir ubicación",recording:"Grabando...",rate_limit_exceeded:"Has enviado demasiados mensajes. Espera un momento.",connection_error:"Error de conexión",file_too_large:"Archivo demasiado grande",invalid_file:"Tipo de archivo no válido",extracted:{assistant:"Asistente",anterior:"Anterior",siguiente:"Siguiente",cerrar:"Cerrar",cerrar_chat:"Cerrar chat",abrir_chat:"Abrir chat",ver_ubicacion:"Ver ubicación"},accessibility:{closeChat:"Cerrar ventana de chat",closeChatHint:"Presiona Escape para cerrar",chatMessages:"Mensajes del chat",messageHistory:"Historial de mensajes",dialogDescription:"Ventana de chat con {{botName}}. Presiona Escape para cerrar. Usa Ctrl+Enter para enviar mensajes.",sendMessage:"Enviar mensaje",sendMessageHint:"Presiona Enter o Ctrl+Enter para enviar",typeMessage:"Escribe tu mensaje aquí",botMessage:"Mensaje del asistente",userMessage:"Tu mensaje",messageFrom:"Mensaje de {{sender}}",messageTime:"Enviado {{time}}",newMessage:"Nuevo mensaje recibido"}},en:{online:"Online",offline:"Offline",connecting:"Connecting...",con_amor_paseo_libre:"With ❤️ by BotUyo",preview:"Preview",fotos:"Photos",ubicacion:"Location",input_placeholder:"Type a message...",send:"Send",attach_photo:"Attach photo",attach_location:"Share location",recording:"Recording...",rate_limit_exceeded:"You have sent too many messages. Please wait.",connection_error:"Connection error",file_too_large:"File too large",invalid_file:"Invalid file type",extracted:{assistant:"Assistant",anterior:"Previous",siguiente:"Next",cerrar:"Close",cerrar_chat:"Close chat",abrir_chat:"Open chat",ver_ubicacion:"View location"},accessibility:{closeChat:"Close chat window",closeChatHint:"Press Escape to close",chatMessages:"Chat messages",messageHistory:"Message history",dialogDescription:"Chat window with {{botName}}. Press Escape to close. Use Ctrl+Enter to send messages.",sendMessage:"Send message",sendMessageHint:"Press Enter or Ctrl+Enter to send",typeMessage:"Type your message here",botMessage:"Assistant message",userMessage:"Your message",messageFrom:"Message from {{sender}}",messageTime:"Sent {{time}}",newMessage:"New message received"}},pt:{online:"Online",offline:"Desconectado",connecting:"Conectando...",con_amor_paseo_libre:"Com ❤️ por BotUyo",preview:"Visualizar",fotos:"Fotos",ubicacion:"Localização",input_placeholder:"Digite uma mensagem...",send:"Enviar",attach_photo:"Anexar foto",attach_location:"Compartilhar localização",recording:"Gravando...",rate_limit_exceeded:"Você enviou muitas mensagens. Aguarde um momento.",connection_error:"Erro de conexão",file_too_large:"Arquivo muito grande",invalid_file:"Tipo de arquivo inválido",extracted:{assistant:"Assistente",anterior:"Anterior",siguiente:"Próximo",cerrar:"Fechar",cerrar_chat:"Fechar chat",abrir_chat:"Abrir chat",ver_ubicacion:"Ver localização"},accessibility:{closeChat:"Fechar janela de chat",closeChatHint:"Pressione Escape para fechar",chatMessages:"Mensagens do chat",messageHistory:"Histórico de mensagens",dialogDescription:"Janela de chat com {{botName}}. Pressione Escape para fechar. Use Ctrl+Enter para enviar mensagens.",sendMessage:"Enviar mensagem",sendMessageHint:"Pressione Enter ou Ctrl+Enter para enviar",typeMessage:"Digite sua mensagem aqui",botMessage:"Mensagem do assistente",userMessage:"Sua mensagem",messageFrom:"Mensagem de {{sender}}",messageTime:"Enviado {{time}}",newMessage:"Nova mensagem recebida"}},fr:{online:"En ligne",offline:"Déconnecté",connecting:"Connexion...",con_amor_paseo_libre:"Avec ❤️ par BotUyo",preview:"Aperçu",fotos:"Photos",ubicacion:"Emplacement",input_placeholder:"Tapez un message...",send:"Envoyer",attach_photo:"Joindre une photo",attach_location:"Partager la localisation",recording:"Enregistrement...",rate_limit_exceeded:"Vous avez envoyé trop de messages. Veuillez patienter.",connection_error:"Erreur de connexion",file_too_large:"Fichier trop volumineux",invalid_file:"Type de fichier invalide",extracted:{assistant:"Assistant",anterior:"Précédent",siguiente:"Suivant",cerrar:"Fermer",cerrar_chat:"Fermer le chat",abrir_chat:"Ouvrir le chat",ver_ubicacion:"Voir l'emplacement"},accessibility:{closeChat:"Fermer la fenêtre de chat",closeChatHint:"Appuyez sur Échap pour fermer",chatMessages:"Messages du chat",messageHistory:"Historique des messages",dialogDescription:"Fenêtre de chat avec {{botName}}. Appuyez sur Échap pour fermer. Utilisez Ctrl+Entrée pour envoyer des messages.",sendMessage:"Envoyer un message",sendMessageHint:"Appuyez sur Entrée ou Ctrl+Entrée pour envoyer",typeMessage:"Tapez votre message ici",botMessage:"Message de l'assistant",userMessage:"Votre message",messageFrom:"Message de {{sender}}",messageTime:"Envoyé {{time}}",newMessage:"Nouveau message reçu"}}};function l(){if("undefined"==typeof navigator)return"es";const e=navigator.language.split("-")[0];return i[e]?e:"es"}const c=e.createContext(void 0),d="botuyo-chat-locale";function u({children:r,defaultLocale:s}){const[o,n]=e.useState(()=>{if(s)return s;if("undefined"!=typeof window){const e=localStorage.getItem(d);if(e)return e}return l()});return e.useEffect(()=>{if("undefined"==typeof window||s)return;const e=()=>{localStorage.getItem(d)||n(l())};return window.addEventListener("languagechange",e),()=>window.removeEventListener("languagechange",e)},[s]),/* @__PURE__ */t.jsx(c.Provider,{value:{locale:o,setLocale:e=>{["es","en","pt","fr"].includes(e)?(n(e),"undefined"!=typeof window&&localStorage.setItem(d,e)):console.warn(`[BotUyo] Locale "${e}" no es soportado. Manteniendo "${o}"`)}},children:r})}function m(t){const{locale:r,setLocale:s}=function(){const t=e.useContext(c);if(void 0===t)throw new Error("useLanguage debe usarse dentro de un LanguageProvider");return t}();return{t:e.useCallback(e=>{var s,o;return(s=i[r],(o=t?`${t}.${e}`:e).split(".").reduce((e,t)=>e?.[t],s)||o)||e},[r,t]),setLocale:s,currentLocale:r}}const h=(...e)=>e.filter((e,t,r)=>Boolean(e)&&""!==e.trim()&&r.indexOf(e)===t).join(" ").trim(),p=e=>{const t=(e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,r)=>r?r.toUpperCase():t.toLowerCase()))(e);return t.charAt(0).toUpperCase()+t.slice(1)};var g={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const f=e=>{for(const t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0;return!1},b=e.forwardRef(({color:t="currentColor",size:r=24,strokeWidth:s=2,absoluteStrokeWidth:o,className:n="",children:a,iconNode:i,...l},c)=>e.createElement("svg",{ref:c,...g,width:r,height:r,stroke:t,strokeWidth:o?24*Number(s)/Number(r):s,className:h("lucide",n),...!a&&!f(l)&&{"aria-hidden":"true"},...l},[...i.map(([t,r])=>e.createElement(t,r)),...Array.isArray(a)?a:[a]])),x=(t,r)=>{const s=e.forwardRef(({className:s,...o},n)=>{return e.createElement(b,{ref:n,iconNode:r,className:h(`lucide-${a=p(t),a.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${t}`,s),...o});var a});return s.displayName=p(t),s},v=x("arrow-right",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]),y=x("check-check",[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]]),w=x("chevron-left",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]),k=x("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]),j=x("circle-alert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]),C=x("download",[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]),N=x("external-link",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]),M=x("file",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}]]),z=x("heart",[["path",{d:"M2 9.5a5.5 5.5 0 0 1 9.591-3.676.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5",key:"mvr1a0"}]]),S=x("image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]),E=x("loader-circle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]),A=x("map-pin",[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]),F=x("message-circle",[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]]),_=x("mic-off",[["path",{d:"M12 19v3",key:"npa21l"}],["path",{d:"M15 9.34V5a3 3 0 0 0-5.68-1.33",key:"1gzdoj"}],["path",{d:"M16.95 16.95A7 7 0 0 1 5 12v-2",key:"cqa7eg"}],["path",{d:"M18.89 13.23A7 7 0 0 0 19 12v-2",key:"16hl24"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M9 9v3a3 3 0 0 0 5.12 2.12",key:"r2i35w"}]]),I=x("mic",[["path",{d:"M12 19v3",key:"npa21l"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["rect",{x:"9",y:"2",width:"6",height:"13",rx:"3",key:"s6n7sd"}]]),O=x("pause",[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]]),D=x("phone-off",[["path",{d:"M10.1 13.9a14 14 0 0 0 3.732 2.668 1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2 18 18 0 0 1-12.728-5.272",key:"1wngk7"}],["path",{d:"M22 2 2 22",key:"y4kqgn"}],["path",{d:"M4.76 13.582A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 .244.473",key:"10hv5p"}]]),T=x("phone",[["path",{d:"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",key:"9njp5v"}]]),L=x("play",[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]),R=x("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]),$=x("rotate-cw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]),U=x("send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]),P=x("shield-check",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]),W=x("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]),V=x("volume-2",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]]),B=x("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),H=x("zoom-in",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["line",{x1:"21",x2:"16.65",y1:"21",y2:"16.65",key:"13gj7c"}],["line",{x1:"11",x2:"11",y1:"8",y2:"14",key:"1vmskp"}],["line",{x1:"8",x2:"14",y1:"11",y2:"11",key:"durymu"}]]);function q(e){var t,r,s="";if("string"==typeof e||"number"==typeof e)s+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(r=q(e[t]))&&(s&&(s+=" "),s+=r)}else for(r in e)e[r]&&(s&&(s+=" "),s+=r);return s}const G=(e=/* @__PURE__ */new Map,t=null,r)=>({nextPart:e,validators:t,classGroupId:r}),K="-",Y=[],J=e=>{const t=X(e),{conflictingClassGroups:r,conflictingClassGroupModifiers:s}=e;return{getClassGroupId:e=>{if(e.startsWith("[")&&e.endsWith("]"))return Q(e);const r=e.split(K),s=""===r[0]&&r.length>1?1:0;return Z(r,s,t)},getConflictingClassGroupIds:(e,t)=>{if(t){const t=s[e],o=r[e];return t?o?((e,t)=>{const r=new Array(e.length+t.length);for(let s=0;s<e.length;s++)r[s]=e[s];for(let s=0;s<t.length;s++)r[e.length+s]=t[s];return r})(o,t):t:o||Y}return r[e]||Y}}},Z=(e,t,r)=>{if(0===e.length-t)return r.classGroupId;const s=e[t],o=r.nextPart.get(s);if(o){const r=Z(e,t+1,o);if(r)return r}const n=r.validators;if(null===n)return;const a=0===t?e.join(K):e.slice(t).join(K),i=n.length;for(let l=0;l<i;l++){const e=n[l];if(e.validator(a))return e.classGroupId}},Q=e=>-1===e.slice(1,-1).indexOf(":")?void 0:(()=>{const t=e.slice(1,-1),r=t.indexOf(":"),s=t.slice(0,r);return s?"arbitrary.."+s:void 0})(),X=e=>{const{theme:t,classGroups:r}=e;return ee(r,t)},ee=(e,t)=>{const r=G();for(const s in e){const o=e[s];te(o,r,s,t)}return r},te=(e,t,r,s)=>{const o=e.length;for(let n=0;n<o;n++){const o=e[n];re(o,t,r,s)}},re=(e,t,r,s)=>{"string"!=typeof e?"function"!=typeof e?ne(e,t,r,s):oe(e,t,r,s):se(e,t,r)},se=(e,t,r)=>{(""===e?t:ae(t,e)).classGroupId=r},oe=(e,t,r,s)=>{ie(e)?te(e(s),t,r,s):(null===t.validators&&(t.validators=[]),t.validators.push(((e,t)=>({classGroupId:e,validator:t}))(r,e)))},ne=(e,t,r,s)=>{const o=Object.entries(e),n=o.length;for(let a=0;a<n;a++){const[e,n]=o[a];te(n,ae(t,e),r,s)}},ae=(e,t)=>{let r=e;const s=t.split(K),o=s.length;for(let n=0;n<o;n++){const e=s[n];let t=r.nextPart.get(e);t||(t=G(),r.nextPart.set(e,t)),r=t}return r},ie=e=>"isThemeGetter"in e&&!0===e.isThemeGetter,le=e=>{if(e<1)return{get:()=>{},set:()=>{}};let t=0,r=/* @__PURE__ */Object.create(null),s=/* @__PURE__ */Object.create(null);const o=(o,n)=>{r[o]=n,t++,t>e&&(t=0,s=r,r=/* @__PURE__ */Object.create(null))};return{get(e){let t=r[e];return void 0!==t?t:void 0!==(t=s[e])?(o(e,t),t):void 0},set(e,t){e in r?r[e]=t:o(e,t)}}},ce=[],de=(e,t,r,s,o)=>({modifiers:e,hasImportantModifier:t,baseClassName:r,maybePostfixModifierPosition:s,isExternal:o}),ue=e=>{const{prefix:t,experimentalParseClassName:r}=e;let s=e=>{const t=[];let r,s=0,o=0,n=0;const a=e.length;for(let d=0;d<a;d++){const a=e[d];if(0===s&&0===o){if(":"===a){t.push(e.slice(n,d)),n=d+1;continue}if("/"===a){r=d;continue}}"["===a?s++:"]"===a?s--:"("===a?o++:")"===a&&o--}const i=0===t.length?e:e.slice(n);let l=i,c=!1;return i.endsWith("!")?(l=i.slice(0,-1),c=!0):i.startsWith("!")&&(l=i.slice(1),c=!0),de(t,c,l,r&&r>n?r-n:void 0)};if(t){const e=t+":",r=s;s=t=>t.startsWith(e)?r(t.slice(e.length)):de(ce,!1,t,void 0,!0)}if(r){const e=s;s=t=>r({className:t,parseClassName:e})}return s},me=e=>{const t=/* @__PURE__ */new Map;return e.orderSensitiveModifiers.forEach((e,r)=>{t.set(e,1e6+r)}),e=>{const r=[];let s=[];for(let o=0;o<e.length;o++){const n=e[o],a="["===n[0],i=t.has(n);a||i?(s.length>0&&(s.sort(),r.push(...s),s=[]),r.push(n)):s.push(n)}return s.length>0&&(s.sort(),r.push(...s)),r}},he=/\s+/,pe=e=>{if("string"==typeof e)return e;let t,r="";for(let s=0;s<e.length;s++)e[s]&&(t=pe(e[s]))&&(r&&(r+=" "),r+=t);return r},ge=[],fe=e=>{const t=t=>t[e]||ge;return t.isThemeGetter=!0,t},be=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,xe=/^\((?:(\w[\w-]*):)?(.+)\)$/i,ve=/^\d+\/\d+$/,ye=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,we=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,ke=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,je=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Ce=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,Ne=e=>ve.test(e),Me=e=>!!e&&!Number.isNaN(Number(e)),ze=e=>!!e&&Number.isInteger(Number(e)),Se=e=>e.endsWith("%")&&Me(e.slice(0,-1)),Ee=e=>ye.test(e),Ae=()=>!0,Fe=e=>we.test(e)&&!ke.test(e),_e=()=>!1,Ie=e=>je.test(e),Oe=e=>Ce.test(e),De=e=>!Le(e)&&!Ve(e),Te=e=>Je(e,et,_e),Le=e=>be.test(e),Re=e=>Je(e,tt,Fe),$e=e=>Je(e,rt,Me),Ue=e=>Je(e,Qe,_e),Pe=e=>Je(e,Xe,Oe),We=e=>Je(e,ot,Ie),Ve=e=>xe.test(e),Be=e=>Ze(e,tt),He=e=>Ze(e,st),qe=e=>Ze(e,Qe),Ge=e=>Ze(e,et),Ke=e=>Ze(e,Xe),Ye=e=>Ze(e,ot,!0),Je=(e,t,r)=>{const s=be.exec(e);return!!s&&(s[1]?t(s[1]):r(s[2]))},Ze=(e,t,r=!1)=>{const s=xe.exec(e);return!!s&&(s[1]?t(s[1]):r)},Qe=e=>"position"===e||"percentage"===e,Xe=e=>"image"===e||"url"===e,et=e=>"length"===e||"size"===e||"bg-size"===e,tt=e=>"length"===e,rt=e=>"number"===e,st=e=>"family-name"===e,ot=e=>"shadow"===e,nt=/* @__PURE__ */((e,...t)=>{let r,s,o,n;const a=e=>{const t=s(e);if(t)return t;const n=((e,t)=>{const{parseClassName:r,getClassGroupId:s,getConflictingClassGroupIds:o,sortModifiers:n}=t,a=[],i=e.trim().split(he);let l="";for(let c=i.length-1;c>=0;c-=1){const e=i[c],{isExternal:t,modifiers:d,hasImportantModifier:u,baseClassName:m,maybePostfixModifierPosition:h}=r(e);if(t){l=e+(l.length>0?" "+l:l);continue}let p=!!h,g=s(p?m.substring(0,h):m);if(!g){if(!p){l=e+(l.length>0?" "+l:l);continue}if(g=s(m),!g){l=e+(l.length>0?" "+l:l);continue}p=!1}const f=0===d.length?"":1===d.length?d[0]:n(d).join(":"),b=u?f+"!":f,x=b+g;if(a.indexOf(x)>-1)continue;a.push(x);const v=o(g,p);for(let r=0;r<v.length;++r){const e=v[r];a.push(b+e)}l=e+(l.length>0?" "+l:l)}return l})(e,r);return o(e,n),n};return n=i=>{const l=t.reduce((e,t)=>t(e),e());return r=(e=>({cache:le(e.cacheSize),parseClassName:ue(e),sortModifiers:me(e),...J(e)}))(l),s=r.cache.get,o=r.cache.set,n=a,a(i)},(...e)=>n(((...e)=>{let t,r,s=0,o="";for(;s<e.length;)(t=e[s++])&&(r=pe(t))&&(o&&(o+=" "),o+=r);return o})(...e))})(()=>{const e=fe("color"),t=fe("font"),r=fe("text"),s=fe("font-weight"),o=fe("tracking"),n=fe("leading"),a=fe("breakpoint"),i=fe("container"),l=fe("spacing"),c=fe("radius"),d=fe("shadow"),u=fe("inset-shadow"),m=fe("text-shadow"),h=fe("drop-shadow"),p=fe("blur"),g=fe("perspective"),f=fe("aspect"),b=fe("ease"),x=fe("animate"),v=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",Ve,Le],y=()=>[Ve,Le,l],w=()=>[Ne,"full","auto",...y()],k=()=>[ze,"none","subgrid",Ve,Le],j=()=>["auto",{span:["full",ze,Ve,Le]},ze,Ve,Le],C=()=>[ze,"auto",Ve,Le],N=()=>["auto","min","max","fr",Ve,Le],M=()=>["auto",...y()],z=()=>[Ne,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...y()],S=()=>[e,Ve,Le],E=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom",qe,Ue,{position:[Ve,Le]}],A=()=>["auto","cover","contain",Ge,Te,{size:[Ve,Le]}],F=()=>[Se,Be,Re],_=()=>["","none","full",c,Ve,Le],I=()=>["",Me,Be,Re],O=()=>[Me,Se,qe,Ue],D=()=>["","none",p,Ve,Le],T=()=>["none",Me,Ve,Le],L=()=>["none",Me,Ve,Le],R=()=>[Me,Ve,Le],$=()=>[Ne,"full",...y()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Ee],breakpoint:[Ee],color:[Ae],container:[Ee],"drop-shadow":[Ee],ease:["in","out","in-out"],font:[De],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Ee],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Ee],shadow:[Ee],spacing:["px",Me],text:[Ee],"text-shadow":[Ee],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",Ne,Le,Ve,f]}],container:["container"],columns:[{columns:[Me,Le,Ve,i]}],"break-after":[{"break-after":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-before":[{"break-before":["auto","avoid","all","avoid-page","page","left","right","column"]}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],sr:["sr-only","not-sr-only"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:v()}],overflow:[{overflow:["auto","hidden","clip","visible","scroll"]}],"overflow-x":[{"overflow-x":["auto","hidden","clip","visible","scroll"]}],"overflow-y":[{"overflow-y":["auto","hidden","clip","visible","scroll"]}],overscroll:[{overscroll:["auto","contain","none"]}],"overscroll-x":[{"overscroll-x":["auto","contain","none"]}],"overscroll-y":[{"overscroll-y":["auto","contain","none"]}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:w()}],"inset-x":[{"inset-x":w()}],"inset-y":[{"inset-y":w()}],start:[{start:w()}],end:[{end:w()}],top:[{top:w()}],right:[{right:w()}],bottom:[{bottom:w()}],left:[{left:w()}],visibility:["visible","invisible","collapse"],z:[{z:[ze,"auto",Ve,Le]}],basis:[{basis:[Ne,"full","auto",i,...y()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Me,Ne,"auto","initial","none",Le]}],grow:[{grow:["",Me,Ve,Le]}],shrink:[{shrink:["",Me,Ve,Le]}],order:[{order:[ze,"first","last","none",Ve,Le]}],"grid-cols":[{"grid-cols":k()}],"col-start-end":[{col:j()}],"col-start":[{"col-start":C()}],"col-end":[{"col-end":C()}],"grid-rows":[{"grid-rows":k()}],"row-start-end":[{row:j()}],"row-start":[{"row-start":C()}],"row-end":[{"row-end":C()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":N()}],"auto-rows":[{"auto-rows":N()}],gap:[{gap:y()}],"gap-x":[{"gap-x":y()}],"gap-y":[{"gap-y":y()}],"justify-content":[{justify:["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe","normal"]}],"justify-items":[{"justify-items":["start","end","center","stretch","center-safe","end-safe","normal"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],"align-content":[{content:["normal","start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"align-items":[{items:["start","end","center","stretch","center-safe","end-safe",{baseline:["","last"]}]}],"align-self":[{self:["auto","start","end","center","stretch","center-safe","end-safe",{baseline:["","last"]}]}],"place-content":[{"place-content":["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"]}],"place-items":[{"place-items":["start","end","center","stretch","center-safe","end-safe","baseline"]}],"place-self":[{"place-self":["auto","start","end","center","stretch","center-safe","end-safe"]}],p:[{p:y()}],px:[{px:y()}],py:[{py:y()}],ps:[{ps:y()}],pe:[{pe:y()}],pt:[{pt:y()}],pr:[{pr:y()}],pb:[{pb:y()}],pl:[{pl:y()}],m:[{m:M()}],mx:[{mx:M()}],my:[{my:M()}],ms:[{ms:M()}],me:[{me:M()}],mt:[{mt:M()}],mr:[{mr:M()}],mb:[{mb:M()}],ml:[{ml:M()}],"space-x":[{"space-x":y()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":y()}],"space-y-reverse":["space-y-reverse"],size:[{size:z()}],w:[{w:[i,"screen",...z()]}],"min-w":[{"min-w":[i,"screen","none",...z()]}],"max-w":[{"max-w":[i,"screen","none","prose",{screen:[a]},...z()]}],h:[{h:["screen","lh",...z()]}],"min-h":[{"min-h":["screen","lh","none",...z()]}],"max-h":[{"max-h":["screen","lh",...z()]}],"font-size":[{text:["base",r,Be,Re]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[s,Ve,$e]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Se,Le]}],"font-family":[{font:[He,Le,t]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:[o,Ve,Le]}],"line-clamp":[{"line-clamp":[Me,"none",Ve,$e]}],leading:[{leading:[n,...y()]}],"list-image":[{"list-image":["none",Ve,Le]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ve,Le]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:S()}],"text-color":[{text:S()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:["solid","dashed","dotted","double","wavy"]}],"text-decoration-thickness":[{decoration:[Me,"from-font","auto",Ve,Re]}],"text-decoration-color":[{decoration:S()}],"underline-offset":[{"underline-offset":[Me,"auto",Ve,Le]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:y()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ve,Le]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],wrap:[{wrap:["break-word","anywhere","normal"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ve,Le]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:E()}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","space","round"]}]}],"bg-size":[{bg:A()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},ze,Ve,Le],radial:["",Ve,Le],conic:[ze,Ve,Le]},Ke,Pe]}],"bg-color":[{bg:S()}],"gradient-from-pos":[{from:F()}],"gradient-via-pos":[{via:F()}],"gradient-to-pos":[{to:F()}],"gradient-from":[{from:S()}],"gradient-via":[{via:S()}],"gradient-to":[{to:S()}],rounded:[{rounded:_()}],"rounded-s":[{"rounded-s":_()}],"rounded-e":[{"rounded-e":_()}],"rounded-t":[{"rounded-t":_()}],"rounded-r":[{"rounded-r":_()}],"rounded-b":[{"rounded-b":_()}],"rounded-l":[{"rounded-l":_()}],"rounded-ss":[{"rounded-ss":_()}],"rounded-se":[{"rounded-se":_()}],"rounded-ee":[{"rounded-ee":_()}],"rounded-es":[{"rounded-es":_()}],"rounded-tl":[{"rounded-tl":_()}],"rounded-tr":[{"rounded-tr":_()}],"rounded-br":[{"rounded-br":_()}],"rounded-bl":[{"rounded-bl":_()}],"border-w":[{border:I()}],"border-w-x":[{"border-x":I()}],"border-w-y":[{"border-y":I()}],"border-w-s":[{"border-s":I()}],"border-w-e":[{"border-e":I()}],"border-w-t":[{"border-t":I()}],"border-w-r":[{"border-r":I()}],"border-w-b":[{"border-b":I()}],"border-w-l":[{"border-l":I()}],"divide-x":[{"divide-x":I()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":I()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:["solid","dashed","dotted","double","hidden","none"]}],"divide-style":[{divide:["solid","dashed","dotted","double","hidden","none"]}],"border-color":[{border:S()}],"border-color-x":[{"border-x":S()}],"border-color-y":[{"border-y":S()}],"border-color-s":[{"border-s":S()}],"border-color-e":[{"border-e":S()}],"border-color-t":[{"border-t":S()}],"border-color-r":[{"border-r":S()}],"border-color-b":[{"border-b":S()}],"border-color-l":[{"border-l":S()}],"divide-color":[{divide:S()}],"outline-style":[{outline:["solid","dashed","dotted","double","none","hidden"]}],"outline-offset":[{"outline-offset":[Me,Ve,Le]}],"outline-w":[{outline:["",Me,Be,Re]}],"outline-color":[{outline:S()}],shadow:[{shadow:["","none",d,Ye,We]}],"shadow-color":[{shadow:S()}],"inset-shadow":[{"inset-shadow":["none",u,Ye,We]}],"inset-shadow-color":[{"inset-shadow":S()}],"ring-w":[{ring:I()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:S()}],"ring-offset-w":[{"ring-offset":[Me,Re]}],"ring-offset-color":[{"ring-offset":S()}],"inset-ring-w":[{"inset-ring":I()}],"inset-ring-color":[{"inset-ring":S()}],"text-shadow":[{"text-shadow":["none",m,Ye,We]}],"text-shadow-color":[{"text-shadow":S()}],opacity:[{opacity:[Me,Ve,Le]}],"mix-blend":[{"mix-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity","plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"]}],"mask-clip":[{"mask-clip":["border","padding","content","fill","stroke","view"]},"mask-no-clip"],"mask-composite":[{mask:["add","subtract","intersect","exclude"]}],"mask-image-linear-pos":[{"mask-linear":[Me]}],"mask-image-linear-from-pos":[{"mask-linear-from":O()}],"mask-image-linear-to-pos":[{"mask-linear-to":O()}],"mask-image-linear-from-color":[{"mask-linear-from":S()}],"mask-image-linear-to-color":[{"mask-linear-to":S()}],"mask-image-t-from-pos":[{"mask-t-from":O()}],"mask-image-t-to-pos":[{"mask-t-to":O()}],"mask-image-t-from-color":[{"mask-t-from":S()}],"mask-image-t-to-color":[{"mask-t-to":S()}],"mask-image-r-from-pos":[{"mask-r-from":O()}],"mask-image-r-to-pos":[{"mask-r-to":O()}],"mask-image-r-from-color":[{"mask-r-from":S()}],"mask-image-r-to-color":[{"mask-r-to":S()}],"mask-image-b-from-pos":[{"mask-b-from":O()}],"mask-image-b-to-pos":[{"mask-b-to":O()}],"mask-image-b-from-color":[{"mask-b-from":S()}],"mask-image-b-to-color":[{"mask-b-to":S()}],"mask-image-l-from-pos":[{"mask-l-from":O()}],"mask-image-l-to-pos":[{"mask-l-to":O()}],"mask-image-l-from-color":[{"mask-l-from":S()}],"mask-image-l-to-color":[{"mask-l-to":S()}],"mask-image-x-from-pos":[{"mask-x-from":O()}],"mask-image-x-to-pos":[{"mask-x-to":O()}],"mask-image-x-from-color":[{"mask-x-from":S()}],"mask-image-x-to-color":[{"mask-x-to":S()}],"mask-image-y-from-pos":[{"mask-y-from":O()}],"mask-image-y-to-pos":[{"mask-y-to":O()}],"mask-image-y-from-color":[{"mask-y-from":S()}],"mask-image-y-to-color":[{"mask-y-to":S()}],"mask-image-radial":[{"mask-radial":[Ve,Le]}],"mask-image-radial-from-pos":[{"mask-radial-from":O()}],"mask-image-radial-to-pos":[{"mask-radial-to":O()}],"mask-image-radial-from-color":[{"mask-radial-from":S()}],"mask-image-radial-to-color":[{"mask-radial-to":S()}],"mask-image-radial-shape":[{"mask-radial":["circle","ellipse"]}],"mask-image-radial-size":[{"mask-radial":[{closest:["side","corner"],farthest:["side","corner"]}]}],"mask-image-radial-pos":[{"mask-radial-at":["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"]}],"mask-image-conic-pos":[{"mask-conic":[Me]}],"mask-image-conic-from-pos":[{"mask-conic-from":O()}],"mask-image-conic-to-pos":[{"mask-conic-to":O()}],"mask-image-conic-from-color":[{"mask-conic-from":S()}],"mask-image-conic-to-color":[{"mask-conic-to":S()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:E()}],"mask-repeat":[{mask:["no-repeat",{repeat:["","x","y","space","round"]}]}],"mask-size":[{mask:A()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ve,Le]}],filter:[{filter:["","none",Ve,Le]}],blur:[{blur:D()}],brightness:[{brightness:[Me,Ve,Le]}],contrast:[{contrast:[Me,Ve,Le]}],"drop-shadow":[{"drop-shadow":["","none",h,Ye,We]}],"drop-shadow-color":[{"drop-shadow":S()}],grayscale:[{grayscale:["",Me,Ve,Le]}],"hue-rotate":[{"hue-rotate":[Me,Ve,Le]}],invert:[{invert:["",Me,Ve,Le]}],saturate:[{saturate:[Me,Ve,Le]}],sepia:[{sepia:["",Me,Ve,Le]}],"backdrop-filter":[{"backdrop-filter":["","none",Ve,Le]}],"backdrop-blur":[{"backdrop-blur":D()}],"backdrop-brightness":[{"backdrop-brightness":[Me,Ve,Le]}],"backdrop-contrast":[{"backdrop-contrast":[Me,Ve,Le]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Me,Ve,Le]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Me,Ve,Le]}],"backdrop-invert":[{"backdrop-invert":["",Me,Ve,Le]}],"backdrop-opacity":[{"backdrop-opacity":[Me,Ve,Le]}],"backdrop-saturate":[{"backdrop-saturate":[Me,Ve,Le]}],"backdrop-sepia":[{"backdrop-sepia":["",Me,Ve,Le]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":y()}],"border-spacing-x":[{"border-spacing-x":y()}],"border-spacing-y":[{"border-spacing-y":y()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ve,Le]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[Me,"initial",Ve,Le]}],ease:[{ease:["linear","initial",b,Ve,Le]}],delay:[{delay:[Me,Ve,Le]}],animate:[{animate:["none",x,Ve,Le]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[g,Ve,Le]}],"perspective-origin":[{"perspective-origin":v()}],rotate:[{rotate:T()}],"rotate-x":[{"rotate-x":T()}],"rotate-y":[{"rotate-y":T()}],"rotate-z":[{"rotate-z":T()}],scale:[{scale:L()}],"scale-x":[{"scale-x":L()}],"scale-y":[{"scale-y":L()}],"scale-z":[{"scale-z":L()}],"scale-3d":["scale-3d"],skew:[{skew:R()}],"skew-x":[{"skew-x":R()}],"skew-y":[{"skew-y":R()}],transform:[{transform:[Ve,Le,"","none","gpu","cpu"]}],"transform-origin":[{origin:v()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:$()}],"translate-x":[{"translate-x":$()}],"translate-y":[{"translate-y":$()}],"translate-z":[{"translate-z":$()}],"translate-none":["translate-none"],accent:[{accent:S()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:S()}],"color-scheme":[{scheme:["normal","dark","light","light-dark","only-dark","only-light"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ve,Le]}],"field-sizing":[{"field-sizing":["fixed","content"]}],"pointer-events":[{"pointer-events":["auto","none"]}],resize:[{resize:["none","","y","x"]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":y()}],"scroll-mx":[{"scroll-mx":y()}],"scroll-my":[{"scroll-my":y()}],"scroll-ms":[{"scroll-ms":y()}],"scroll-me":[{"scroll-me":y()}],"scroll-mt":[{"scroll-mt":y()}],"scroll-mr":[{"scroll-mr":y()}],"scroll-mb":[{"scroll-mb":y()}],"scroll-ml":[{"scroll-ml":y()}],"scroll-p":[{"scroll-p":y()}],"scroll-px":[{"scroll-px":y()}],"scroll-py":[{"scroll-py":y()}],"scroll-ps":[{"scroll-ps":y()}],"scroll-pe":[{"scroll-pe":y()}],"scroll-pt":[{"scroll-pt":y()}],"scroll-pr":[{"scroll-pr":y()}],"scroll-pb":[{"scroll-pb":y()}],"scroll-pl":[{"scroll-pl":y()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ve,Le]}],fill:[{fill:["none",...S()]}],"stroke-w":[{stroke:[Me,Be,Re,$e]}],stroke:[{stroke:["none",...S()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-x","border-w-y","border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-x","border-color-y","border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],translate:["translate-x","translate-y","translate-none"],"translate-none":["translate","translate-x","translate-y","translate-z"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]},orderSensitiveModifiers:["*","**","after","backdrop","before","details-content","file","first-letter","first-line","marker","placeholder","selection"]}});function at(...e){return nt(function(){for(var e,t,r=0,s="",o=arguments.length;r<o;r++)(e=arguments[r])&&(t=q(e))&&(s&&(s+=" "),s+=t);return s}(e))}const it={background:"0 0% 100%",foreground:"240 10% 3.9%",card:"0 0% 100%",cardForeground:"240 10% 3.9%",primary:"160 84% 39%",primaryForeground:"0 0% 100%",muted:"240 4.8% 95.9%",mutedForeground:"240 3.8% 46.1%",border:"240 5.9% 90%",destructive:"0 84.2% 60.2%",radius:"0.5rem",spacing1:"0.25rem",spacing2:"0.5rem",spacing3:"0.75rem",spacing4:"1rem",spacing5:"0.75rem",spacing6:"1.5rem",spacing8:"2rem"},lt="hsl(160, 84%, 39%)";function ct(e,t){const r={...it,...t?.cssVariables||{},...e?.cssVariables||{}};return{primaryColor:e?.primaryColor||t?.primaryColor||lt,botName:e?.botName||t?.botName||"Asistente",logoUrl:e?.logoUrl||t?.logoUrl||"",position:e?.position||t?.position||"bottom-right",welcomeMessage:e?.welcomeMessage||t?.welcomeMessage||"¡Hola! ¿En qué puedo ayudarte?",inputPlaceholder:e?.inputPlaceholder||t?.inputPlaceholder||"Escribe un mensaje...",cssVariables:r}}function dt(e){return e.primaryColor||lt}const ut={enabled:!0,messageEntry:"spring",typingIndicator:"wave",buttonEffects:!0,smoothScroll:!0,speedMultiplier:1,staggerDelay:50,windowTransitions:!0,launcherPulse:!0},mt={glassmorphism:!0,gradients:!0,softShadows:!0,glowEffects:!0,particles:!1,soundEffects:!1,hapticFeedback:!0,shimmerLoading:!0,hoverLift:!0},ht=e.createContext(ut),pt=e.createContext(mt);function gt({children:r,animations:s,effects:o}){const n=e.useMemo(()=>({...ut,...s}),[s]),a=e.useMemo(()=>({...mt,...o}),[o]);/* @__PURE__ */
|
|
2
|
+
return t.jsx(ht.Provider,{value:n,children:/* @__PURE__ */t.jsx(pt.Provider,{value:a,children:r})})}function ft(){return e.useContext(ht)}function bt(){const t=e.useContext(pt);return{getGlassClass:()=>t.glassmorphism?"backdrop-blur-md bg-white/80 dark:bg-black/80":"",getShadowClass:()=>t.softShadows?"shadow-soft-xl":"shadow-md",getGlowClass:()=>t.glowEffects?"hover:shadow-primary/20":"",getHoverLiftClass:()=>t.hoverLift?"hover:-translate-y-1 hover:shadow-lg transition-all":"",getGradientClass:()=>t.gradients?"bg-gradient-to-br from-primary/10 to-transparent":"",getShimmerClass:()=>t.shimmerLoading?"animate-shimmer":"animate-pulse",triggerHaptic:()=>{t.hapticFeedback&&"vibrate"in navigator&&navigator.vibrate(10)},playSound:e=>{t.soundEffects&&console.log(`[Sound] ${e}`)},triggerParticles:e=>{t.particles&&console.log("[Particles] triggered on",e)}}}function xt(){return"undefined"!=typeof window&&!!window.DEBUG}const vt={log:(e,...t)=>{xt()&&console.log(`[BotUyo] ${e}`,...t)},warn:(e,...t)=>{xt()&&console.warn(`[BotUyo] ${e}`,...t)},error:(e,...t)=>{console.error(`[BotUyo] ${e}`,...t)},debug:(e,...t)=>{xt()},info:(e,...t)=>{xt()&&console.info(`[BotUyo] ${e}`,...t)}},yt=`data:image/svg+xml,${encodeURIComponent('\n<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64" width="64" height="64">\n <defs>\n <linearGradient id="bg" x1="0%" y1="0%" x2="100%" y2="100%">\n <stop offset="0%" style="stop-color:#10b981"/>\n <stop offset="100%" style="stop-color:#059669"/>\n </linearGradient>\n </defs>\n <circle cx="32" cy="32" r="32" fill="url(#bg)"/>\n <rect x="16" y="20" width="32" height="24" rx="4" fill="white"/>\n <circle cx="24" cy="30" r="3" fill="#10b981"/>\n <circle cx="40" cy="30" r="3" fill="#10b981"/>\n <rect x="22" y="36" width="20" height="3" rx="1.5" fill="#10b981"/>\n <rect x="28" y="12" width="8" height="8" rx="2" fill="white"/>\n</svg>\n')}`,wt=function(){const e=Math.floor(1200),t=2*e,r=44+t,s=new ArrayBuffer(r),o=new DataView(s);kt(o,0,"RIFF"),o.setUint32(4,r-8,!0),kt(o,8,"WAVE"),kt(o,12,"fmt "),o.setUint32(16,16,!0),o.setUint16(20,1,!0),o.setUint16(22,1,!0),o.setUint32(24,8e3,!0),o.setUint32(28,16e3,!0),o.setUint16(32,2,!0),o.setUint16(34,16,!0),kt(o,36,"data"),o.setUint32(40,t,!0);for(let i=0;i<e;i++){const t=i/8e3,r=1-i/e,s=Math.sin(2*Math.PI*880*t)*r*.5*32767;o.setInt16(44+2*i,s,!0)}const n=new Uint8Array(s);let a="";for(let i=0;i<n.length;i++)a+=String.fromCharCode(n[i]);return`data:audio/wav;base64,${btoa(a)}`}();function kt(e,t,r){for(let s=0;s<r.length;s++)e.setUint8(t+s,r.charCodeAt(s))}function jt(e,t,r){let s,o=r.initialDeps??[],n=!0;function a(){var a,i,l;let c;r.key&&(null==(a=r.debug)?void 0:a.call(r))&&(c=Date.now());const d=e();if(d.length===o.length&&!d.some((e,t)=>o[t]!==e))return s;let u;if(o=d,r.key&&(null==(i=r.debug)?void 0:i.call(r))&&(u=Date.now()),s=t(...d),r.key&&(null==(l=r.debug)?void 0:l.call(r))){const e=Math.round(100*(Date.now()-c))/100,t=Math.round(100*(Date.now()-u))/100,s=t/16,o=(e,t)=>{for(e=String(e);e.length<t;)e=" "+e;return e};console.info(`%c⏱ ${o(t,5)} /${o(e,5)} ms`,`\n font-size: .6rem;\n font-weight: bold;\n color: hsl(${Math.max(0,Math.min(120-120*s,120))}deg 100% 31%);`,null==r?void 0:r.key)}return!(null==r?void 0:r.onChange)||n&&r.skipInitialOnChange||r.onChange(s),n=!1,s}return a.updateDeps=e=>{o=e},a}function Ct(e,t){if(void 0===e)throw new Error("Unexpected undefined");return e}const Nt=(e,t,r)=>{let s;return function(...o){e.clearTimeout(s),s=e.setTimeout(()=>t.apply(this,o),r)}},Mt=e=>{const{offsetWidth:t,offsetHeight:r}=e;return{width:t,height:r}},zt=e=>e,St=e=>{const t=Math.max(e.startIndex-e.overscan,0),r=Math.min(e.endIndex+e.overscan,e.count-1),s=[];for(let o=t;o<=r;o++)s.push(o);return s},Et=(e,t)=>{const r=e.scrollElement;if(!r)return;const s=e.targetWindow;if(!s)return;const o=e=>{const{width:r,height:s}=e;t({width:Math.round(r),height:Math.round(s)})};if(o(Mt(r)),!s.ResizeObserver)return()=>{};const n=new s.ResizeObserver(t=>{const s=()=>{const e=t[0];if(null==e?void 0:e.borderBoxSize){const t=e.borderBoxSize[0];if(t)return void o({width:t.inlineSize,height:t.blockSize})}o(Mt(r))};e.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(s):s()});return n.observe(r,{box:"border-box"}),()=>{n.unobserve(r)}},At={passive:!0},Ft="undefined"==typeof window||"onscrollend"in window,_t=(e,t)=>{const r=e.scrollElement;if(!r)return;const s=e.targetWindow;if(!s)return;let o=0;const n=e.options.useScrollendEvent&&Ft?()=>{}:Nt(s,()=>{t(o,!1)},e.options.isScrollingResetDelay),a=s=>()=>{const{horizontal:a,isRtl:i}=e.options;o=a?r.scrollLeft*(i?-1:1):r.scrollTop,n(),t(o,s)},i=a(!0),l=a(!1);r.addEventListener("scroll",i,At);const c=e.options.useScrollendEvent&&Ft;return c&&r.addEventListener("scrollend",l,At),()=>{r.removeEventListener("scroll",i),c&&r.removeEventListener("scrollend",l)}},It=(e,t,r)=>{if(null==t?void 0:t.borderBoxSize){const e=t.borderBoxSize[0];if(e)return Math.round(e[r.options.horizontal?"inlineSize":"blockSize"])}return e[r.options.horizontal?"offsetWidth":"offsetHeight"]},Ot=(e,{adjustments:t=0,behavior:r},s)=>{var o,n;const a=e+t;null==(n=null==(o=s.scrollElement)?void 0:o.scrollTo)||n.call(o,{[s.options.horizontal?"left":"top"]:a,behavior:r})};class Dt{constructor(e){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.currentScrollToIndex=null,this.measurementsCache=[],this.itemSizeCache=/* @__PURE__ */new Map,this.laneAssignments=/* @__PURE__ */new Map,this.pendingMeasuredCacheIndexes=[],this.prevLanes=void 0,this.lanesChangedFlag=!1,this.lanesSettling=!1,this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=/* @__PURE__ */new Map,this.observer=/* @__PURE__ */(()=>{let e=null;const t=()=>e||(this.targetWindow&&this.targetWindow.ResizeObserver?e=new this.targetWindow.ResizeObserver(e=>{e.forEach(e=>{const t=()=>{this._measureElement(e.target,e)};this.options.useAnimationFrameWithResizeObserver?requestAnimationFrame(t):t()})}):null);return{disconnect:()=>{var r;null==(r=t())||r.disconnect(),e=null},observe:e=>{var r;return null==(r=t())?void 0:r.observe(e,{box:"border-box"})},unobserve:e=>{var r;return null==(r=t())?void 0:r.unobserve(e)}}})(),this.range=null,this.setOptions=e=>{Object.entries(e).forEach(([t,r])=>{void 0===r&&delete e[t]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:zt,rangeExtractor:St,onChange:()=>{},measureElement:It,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,isRtl:!1,useScrollendEvent:!1,useAnimationFrameWithResizeObserver:!1,...e}},this.notify=e=>{var t,r;null==(r=(t=this.options).onChange)||r.call(t,this,e)},this.maybeNotify=jt(()=>(this.calculateRange(),[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]),e=>{this.notify(e)},{key:!1,debug:()=>this.options.debug,initialDeps:[this.isScrolling,this.range?this.range.startIndex:null,this.range?this.range.endIndex:null]}),this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(e=>e()),this.unsubs=[],this.observer.disconnect(),this.scrollElement=null,this.targetWindow=null},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var e;const t=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==t){if(this.cleanup(),!t)return void this.maybeNotify();this.scrollElement=t,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=(null==(e=this.scrollElement)?void 0:e.window)??null,this.elementsCache.forEach(e=>{this.observer.observe(e)}),this.unsubs.push(this.options.observeElementRect(this,e=>{this.scrollRect=e,this.maybeNotify()})),this.unsubs.push(this.options.observeElementOffset(this,(e,t)=>{this.scrollAdjustments=0,this.scrollDirection=t?this.getScrollOffset()<e?"forward":"backward":null,this.scrollOffset=e,this.isScrolling=t,this.maybeNotify()})),this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0})}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??("function"==typeof this.options.initialOffset?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(e,t)=>{const r=/* @__PURE__ */new Map,s=/* @__PURE__ */new Map;for(let o=t-1;o>=0;o--){const t=e[o];if(r.has(t.lane))continue;const n=s.get(t.lane);if(null==n||t.end>n.end?s.set(t.lane,t):t.end<n.end&&r.set(t.lane,!0),r.size===this.options.lanes)break}return s.size===this.options.lanes?Array.from(s.values()).sort((e,t)=>e.end===t.end?e.index-t.index:e.end-t.end)[0]:void 0},this.getMeasurementOptions=jt(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled,this.options.lanes],(e,t,r,s,o,n)=>(void 0!==this.prevLanes&&this.prevLanes!==n&&(this.lanesChangedFlag=!0),this.prevLanes=n,this.pendingMeasuredCacheIndexes=[],{count:e,paddingStart:t,scrollMargin:r,getItemKey:s,enabled:o,lanes:n}),{key:!1}),this.getMeasurements=jt(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:e,paddingStart:t,scrollMargin:r,getItemKey:s,enabled:o,lanes:n},a)=>{if(!o)return this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),[];if(this.laneAssignments.size>e)for(const d of this.laneAssignments.keys())d>=e&&this.laneAssignments.delete(d);this.lanesChangedFlag&&(this.lanesChangedFlag=!1,this.lanesSettling=!0,this.measurementsCache=[],this.itemSizeCache.clear(),this.laneAssignments.clear(),this.pendingMeasuredCacheIndexes=[]),0!==this.measurementsCache.length||this.lanesSettling||(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(e=>{this.itemSizeCache.set(e.key,e.size)}));const i=this.lanesSettling?0:this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[],this.lanesSettling&&this.measurementsCache.length===e&&(this.lanesSettling=!1);const l=this.measurementsCache.slice(0,i),c=new Array(n).fill(void 0);for(let d=0;d<i;d++){const e=l[d];e&&(c[e.lane]=d)}for(let d=i;d<e;d++){const e=s(d),o=this.laneAssignments.get(d);let n,i;if(void 0!==o&&this.options.lanes>1){n=o;const e=c[n],s=void 0!==e?l[e]:void 0;i=s?s.end+this.options.gap:t+r}else{const e=1===this.options.lanes?l[d-1]:this.getFurthestMeasurement(l,d);i=e?e.end+this.options.gap:t+r,n=e?e.lane:d%this.options.lanes,this.options.lanes>1&&this.laneAssignments.set(d,n)}const u=a.get(e),m="number"==typeof u?u:this.options.estimateSize(d),h=i+m;l[d]={index:d,start:i,size:m,end:h,key:e,lane:n},c[n]=d}return this.measurementsCache=l,l},{key:!1,debug:()=>this.options.debug}),this.calculateRange=jt(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset(),this.options.lanes],(e,t,r,s)=>this.range=e.length>0&&t>0?function({measurements:e,outerSize:t,scrollOffset:r,lanes:s}){const o=e.length-1;if(e.length<=s)return{startIndex:0,endIndex:o};let n=Tt(0,o,t=>e[t].start,r),a=n;if(1===s)for(;a<o&&e[a].end<r+t;)a++;else if(s>1){const i=Array(s).fill(0);for(;a<o&&i.some(e=>e<r+t);){const t=e[a];i[t.lane]=t.end,a++}const l=Array(s).fill(r+t);for(;n>=0&&l.some(e=>e>=r);){const t=e[n];l[t.lane]=t.start,n--}n=Math.max(0,n-n%s),a=Math.min(o,a+(s-1-a%s))}return{startIndex:n,endIndex:a}}({measurements:e,outerSize:t,scrollOffset:r,lanes:s}):null,{key:!1,debug:()=>this.options.debug}),this.getVirtualIndexes=jt(()=>{let e=null,t=null;const r=this.calculateRange();return r&&(e=r.startIndex,t=r.endIndex),this.maybeNotify.updateDeps([this.isScrolling,e,t]),[this.options.rangeExtractor,this.options.overscan,this.options.count,e,t]},(e,t,r,s,o)=>null===s||null===o?[]:e({startIndex:s,endIndex:o,overscan:t,count:r}),{key:!1,debug:()=>this.options.debug}),this.indexFromElement=e=>{const t=this.options.indexAttribute,r=e.getAttribute(t);return r?parseInt(r,10):(console.warn(`Missing attribute name '${t}={index}' on measured element.`),-1)},this._measureElement=(e,t)=>{const r=this.indexFromElement(e),s=this.measurementsCache[r];if(!s)return;const o=s.key,n=this.elementsCache.get(o);n!==e&&(n&&this.observer.unobserve(n),this.observer.observe(e),this.elementsCache.set(o,e)),e.isConnected&&this.resizeItem(r,this.options.measureElement(e,t,this))},this.resizeItem=(e,t)=>{const r=this.measurementsCache[e];if(!r)return;const s=t-(this.itemSizeCache.get(r.key)??r.size);0!==s&&((void 0!==this.shouldAdjustScrollPositionOnItemSizeChange?this.shouldAdjustScrollPositionOnItemSizeChange(r,s,this):r.start<this.getScrollOffset()+this.scrollAdjustments)&&this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=s,behavior:void 0}),this.pendingMeasuredCacheIndexes.push(r.index),this.itemSizeCache=new Map(this.itemSizeCache.set(r.key,t)),this.notify(!1))},this.measureElement=e=>{e?this._measureElement(e,void 0):this.elementsCache.forEach((e,t)=>{e.isConnected||(this.observer.unobserve(e),this.elementsCache.delete(t))})},this.getVirtualItems=jt(()=>[this.getVirtualIndexes(),this.getMeasurements()],(e,t)=>{const r=[];for(let s=0,o=e.length;s<o;s++){const o=t[e[s]];r.push(o)}return r},{key:!1,debug:()=>this.options.debug}),this.getVirtualItemForOffset=e=>{const t=this.getMeasurements();if(0!==t.length)return Ct(t[Tt(0,t.length-1,e=>Ct(t[e]).start,e)])},this.getMaxScrollOffset=()=>{if(!this.scrollElement)return 0;if("scrollHeight"in this.scrollElement)return this.options.horizontal?this.scrollElement.scrollWidth-this.scrollElement.clientWidth:this.scrollElement.scrollHeight-this.scrollElement.clientHeight;{const e=this.scrollElement.document.documentElement;return this.options.horizontal?e.scrollWidth-this.scrollElement.innerWidth:e.scrollHeight-this.scrollElement.innerHeight}},this.getOffsetForAlignment=(e,t,r=0)=>{if(!this.scrollElement)return 0;const s=this.getSize(),o=this.getScrollOffset();"auto"===t&&(t=e>=o+s?"end":"start"),"center"===t?e+=(r-s)/2:"end"===t&&(e-=s);const n=this.getMaxScrollOffset();return Math.max(Math.min(n,e),0)},this.getOffsetForIndex=(e,t="auto")=>{e=Math.max(0,Math.min(e,this.options.count-1));const r=this.measurementsCache[e];if(!r)return;const s=this.getSize(),o=this.getScrollOffset();if("auto"===t)if(r.end>=o+s-this.options.scrollPaddingEnd)t="end";else{if(!(r.start<=o+this.options.scrollPaddingStart))return[o,t];t="start"}if("end"===t&&e===this.options.count-1)return[this.getMaxScrollOffset(),t];const n="end"===t?r.end+this.options.scrollPaddingEnd:r.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(n,t,r.size),t]},this.isDynamicMode=()=>this.elementsCache.size>0,this.scrollToOffset=(e,{align:t="start",behavior:r}={})=>{"smooth"===r&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(e,t),{adjustments:void 0,behavior:r})},this.scrollToIndex=(e,{align:t="auto",behavior:r}={})=>{"smooth"===r&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),e=Math.max(0,Math.min(e,this.options.count-1)),this.currentScrollToIndex=e;let s=0;const o=t=>{if(!this.targetWindow)return;const s=this.getOffsetForIndex(e,t);if(!s)return void console.warn("Failed to get offset for index:",e);const[o,a]=s;this._scrollToOffset(o,{adjustments:void 0,behavior:r}),this.targetWindow.requestAnimationFrame(()=>{const t=()=>{if(this.currentScrollToIndex!==e)return;const t=this.getScrollOffset(),r=this.getOffsetForIndex(e,a);var s,o;r?(s=r[0],o=t,Math.abs(s-o)<1.01||n(a)):console.warn("Failed to get offset for index:",e)};this.isDynamicMode()?this.targetWindow.requestAnimationFrame(t):t()})},n=t=>{this.targetWindow&&this.currentScrollToIndex===e&&(s++,s<10?this.targetWindow.requestAnimationFrame(()=>o(t)):console.warn(`Failed to scroll to index ${e} after 10 attempts.`))};o(t)},this.scrollBy=(e,{behavior:t}={})=>{"smooth"===t&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+e,{adjustments:void 0,behavior:t})},this.getTotalSize=()=>{var e;const t=this.getMeasurements();let r;if(0===t.length)r=this.options.paddingStart;else if(1===this.options.lanes)r=(null==(e=t[t.length-1])?void 0:e.end)??0;else{const e=Array(this.options.lanes).fill(null);let s=t.length-1;for(;s>=0&&e.some(e=>null===e);){const r=t[s];null===e[r.lane]&&(e[r.lane]=r.end),s--}r=Math.max(...e.filter(e=>null!==e))}return Math.max(r-this.options.scrollMargin+this.options.paddingEnd,0)},this._scrollToOffset=(e,{adjustments:t,behavior:r})=>{this.options.scrollToFn(e,{behavior:r,adjustments:t},this)},this.measure=()=>{this.itemSizeCache=/* @__PURE__ */new Map,this.laneAssignments=/* @__PURE__ */new Map,this.notify(!1)},this.setOptions(e)}}const Tt=(e,t,r,s)=>{for(;e<=t;){const o=(e+t)/2|0,n=r(o);if(n<s)e=o+1;else{if(!(n>s))return o;t=o-1}}return e>0?e-1:0},Lt="undefined"!=typeof document?e.useLayoutEffect:e.useEffect;const Rt=e.lazy(()=>import("./chunk-audio-C4Q6VB-1.js").then(e=>({default:e.AudioPlayer}))),$t=e.lazy(()=>import("./chunk-gallery-Ca7lW3V4.js").then(e=>({default:e.Gallery}))),Ut=e.memo(function({message:r,primaryColor:o,botAvatar:i,botName:l="Mar",avatars:c,isFirst:d=!0,isLast:u=!0,index:h=0}){const{t:p}=m("extracted"),g="user"===r.sender,f="system"===r.type||"system"===r.sender,b=!g&&!f,x=dt({primaryColor:o}),w=function(){const t=e.useContext(ht);return t.enabled&&"none"!==t.messageEntry?{slide:"animate-message-slide",fade:"animate-message-fade",scale:"animate-message-scale",spring:"animate-message-spring"}[t.messageEntry]||"animate-message-spring":""}(),k=e.useMemo(()=>{if(g)return null;if("text"===r.type){const e=r;if(e.emotion&&c?.[e.emotion])return c[e.emotion]}return i},[r,c,i,g]),j=({href:e,children:r})=>{if(!e)return null;const s=String(r).toLowerCase(),o=s.includes("reservar")||s.includes("ver")||s.includes("pagar");return e.includes("maps.google")||e.includes("goo.gl")?/* @__PURE__ */t.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"block my-2 no-underline group",children:/* @__PURE__ */t.jsxs("span",{className:"flex items-center gap-3 p-3 border rounded-xl shadow-sm group-hover:border-primary/30 transition-all",style:{backgroundColor:"hsl(var(--card))",borderColor:"hsl(var(--border))"},children:[
|
|
3
|
+
/* @__PURE__ */t.jsx("span",{className:"flex-shrink-0 p-2 rounded-full",style:{backgroundColor:`${x}1a`,color:x},children:/* @__PURE__ */t.jsx(A,{size:16,strokeWidth:2.5})}),
|
|
4
|
+
/* @__PURE__ */t.jsx("span",{className:"flex flex-col min-w-0 flex-1 text-[11px] font-bold text-foreground leading-tight uppercase tracking-tight",children:p("ver_ubicacion")}),
|
|
5
|
+
/* @__PURE__ */t.jsx(N,{size:12,className:"text-muted-foreground/40 group-hover:text-primary"})]})}):o?/* @__PURE__ */t.jsxs("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center justify-center gap-2 px-5 py-2.5 mt-2 text-[11px] font-black w-full sm:w-auto rounded-xl shadow-md uppercase tracking-widest transition-transform active:scale-95 text-white",style:{backgroundColor:x},children:[r," ",
|
|
6
|
+
/* @__PURE__ */t.jsx(v,{size:14})]}):/* @__PURE__ */t.jsx("a",{href:e,target:"_blank",rel:"noopener noreferrer",className:"font-bold underline decoration-primary/30 hover:decoration-primary transition-all",style:{color:g?"inherit":x},children:r})},z=({src:r,alt:s})=>r?/* @__PURE__ */t.jsx(e.Suspense,{fallback:/* @__PURE__ */t.jsx("div",{className:"my-3 animate-pulse",children:/* @__PURE__ */t.jsx("div",{className:"w-full h-48 bg-muted rounded-xl"})}),children:/* @__PURE__ */t.jsx($t,{images:[{src:r,alt:s}],radius:"rounded-xl"})}):null;return f?/* @__PURE__ */t.jsx("div",{className:"flex justify-center my-4 animate-in fade-in zoom-in-95 w-full",children:/* @__PURE__ */t.jsx("span",{className:"px-3 py-1 border rounded-full text-[9px] font-black uppercase tracking-widest",style:{backgroundColor:"hsl(var(--muted))",borderColor:"hsl(var(--border))",color:"hsl(var(--muted-foreground))"},children:r.content})}):/* @__PURE__ */t.jsxs("div",{className:at("flex w-full mb-0.5 group",w,g?"justify-end":"justify-start gap-3",d&&"mt-3",u&&"mb-3"),style:{animationDelay:50*h+"ms"},children:[!g&&/* @__PURE__ */t.jsx("div",{className:"w-9 shrink-0 flex flex-col justify-end pb-1",children:u?/* @__PURE__ */t.jsx("div",{className:"h-9 w-9 rounded-full overflow-hidden border shadow-sm",style:{borderColor:"hsl(var(--border))",backgroundColor:"hsl(var(--background))"},children:k?/* @__PURE__ */t.jsx("img",{src:k,alt:l,className:"h-full w-full object-cover"}):/* @__PURE__ */t.jsx("div",{className:"h-full w-full flex items-center justify-center text-white text-[10px] font-black uppercase",style:{backgroundColor:x},children:l.charAt(0)})}):/* @__PURE__ */t.jsx("div",{className:"w-9"})}),
|
|
7
|
+
/* @__PURE__ */t.jsxs("div",{className:at("max-w-[85%] shadow-sm transition-all duration-300 relative",g?"text-primary-foreground":"border",g?at("rounded-[18px]",d&&"rounded-tr-[4px]",!u&&"rounded-br-[4px]",!d&&!u&&"rounded-r-[4px]"):at("rounded-[18px]",d&&"rounded-tl-[4px]",!u&&"rounded-bl-[4px]",!d&&!u&&"rounded-l-[4px]")),style:g?{padding:"var(--spacing-4) var(--spacing-5)",backgroundColor:x,boxShadow:u?`0 8px 20px -6px ${x}33`:"none"}:{padding:"var(--spacing-4) var(--spacing-5)",backgroundColor:"hsl(var(--card))",borderColor:"hsl(var(--border) / 0.6)",color:"hsl(var(--foreground))"},children:[(()=>{switch(r.type){case"audio":/* @__PURE__ */
|
|
8
|
+
return t.jsx(e.Suspense,{fallback:/* @__PURE__ */t.jsxs("div",{className:"flex items-center gap-3 py-1 min-w-[200px] animate-pulse",children:[
|
|
9
|
+
/* @__PURE__ */t.jsx("div",{className:"w-8 h-8 rounded-full bg-muted"}),
|
|
10
|
+
/* @__PURE__ */t.jsx("div",{className:"flex-1 space-y-1",children:/* @__PURE__ */t.jsx("div",{className:"h-1 w-full bg-muted rounded-full"})})]}),children:/* @__PURE__ */t.jsx(Rt,{url:r.content,isBot:b,primaryColor:o})});case"image":{const s=r;/* @__PURE__ */
|
|
11
|
+
return t.jsx(e.Suspense,{fallback:/* @__PURE__ */t.jsx("div",{className:"my-3 animate-pulse",children:/* @__PURE__ */t.jsx("div",{className:"w-full h-48 bg-muted rounded-xl"})}),children:/* @__PURE__ */t.jsx($t,{images:[{src:s.imageUrl||s.content,alt:s.altText||"Imagen"}],radius:"rounded-xl"})})}case"location":{const e=r;/* @__PURE__ */
|
|
12
|
+
return t.jsx(j,{href:`https://www.google.com/maps/search/?api=1&query=${e.latitude},${e.longitude}`,children:"Ver ubicación"})}case"file":{const e=r,s=e.fileName?.split(".").pop()?.toLowerCase()||"",o=e.fileSize?`${(e.fileSize/1024/1024).toFixed(2)} MB`:"";/* @__PURE__ */
|
|
13
|
+
return t.jsxs("a",{href:e.fileUrl,download:e.fileName,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-3 p-3 border rounded-xl transition-all hover:scale-[1.02] group",style:{backgroundColor:g?"rgba(255,255,255,0.1)":"hsl(var(--muted))",borderColor:g?"rgba(255,255,255,0.2)":"hsl(var(--border))"},children:[
|
|
14
|
+
/* @__PURE__ */t.jsx("div",{className:"flex items-center justify-center w-10 h-10 rounded-lg shrink-0",style:{backgroundColor:g?"rgba(255,255,255,0.2)":`${x}1a`,color:g?"white":x},children:/* @__PURE__ */t.jsx(M,{size:20,strokeWidth:2.5})}),
|
|
15
|
+
/* @__PURE__ */t.jsxs("div",{className:"flex-1 min-w-0",children:[
|
|
16
|
+
/* @__PURE__ */t.jsx("p",{className:"text-sm font-bold truncate",children:e.fileName}),o&&/* @__PURE__ */t.jsxs("p",{className:"text-xs opacity-60 mt-0.5",children:[s?.toUpperCase()," • ",o]})]}),
|
|
17
|
+
/* @__PURE__ */t.jsx(C,{size:18,className:"shrink-0 opacity-60 group-hover:opacity-100 transition-opacity"})]})}default:/* @__PURE__ */
|
|
18
|
+
return t.jsx("div",{className:at("prose prose-sm max-w-none break-words leading-relaxed dark:prose-invert",g?"text-primary-foreground prose-p:text-white":"text-foreground"),children:/* @__PURE__ */t.jsx(s,{remarkPlugins:[a],rehypePlugins:[[n,{tagNames:["p","a","img","strong","em","ul","ol","li","br","span"],attributes:{a:["href","target","rel"],img:["src","alt"],span:["className"]},protocols:{a:{href:["http","https","mailto","tel"]},img:{src:["http","https","data"]}}}]],components:{a:j,img:z,p:({children:e})=>/* @__PURE__ */t.jsx("p",{className:"mb-0 last:mb-0",children:e})},children:r.content||""})})}})(),u&&/* @__PURE__ */t.jsxs("div",{className:at("flex items-center gap-1 mt-1.5 opacity-50 select-none text-[9px]",g?"justify-end":"justify-start"),children:[
|
|
19
|
+
/* @__PURE__ */t.jsx("span",{className:"font-bold tabular-nums uppercase tracking-tighter",children:(e=>{const t=new Date(e);return isNaN(t.getTime())?"":t.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit",hour12:!1})})(r.timestamp)}),g&&/* @__PURE__ */t.jsx(y,{className:"h-2.5 w-2.5"})]})]})]})},(e,t)=>e.message.id===t.message.id&&e.message.timestamp===t.message.timestamp&&e.primaryColor===t.primaryColor&&e.botAvatar===t.botAvatar&&e.botName===t.botName&&e.isFirst===t.isFirst&&e.isLast===t.isLast&&JSON.stringify(e.styles)===JSON.stringify(t.styles)),Pt=e.memo(function(){/* @__PURE__ */
|
|
20
|
+
return t.jsx("div",{className:at("flex items-center self-start animate-in fade-in duration-200","max-w-[85%] sm:max-w-[75%]"),children:/* @__PURE__ */t.jsx("div",{className:"border rounded-[18px] rounded-tl-[4px] px-4 py-3 shadow-soft-sm",style:{backgroundColor:"hsl(var(--card))",borderColor:"hsl(var(--border))"},children:/* @__PURE__ */t.jsx("div",{className:"flex items-center gap-1.5",children:[0,1,2].map(e=>/* @__PURE__ */t.jsx("span",{className:"h-1.5 w-1.5 rounded-full animate-bounce",style:{backgroundColor:"hsl(var(--primary) / 0.4)",animationDelay:150*e+"ms",animationDuration:"800ms"}},e))})})})});function Wt(e,t){const r=e.getTime()-t.getTime();return Math.floor(r/1e3/60)}function Vt(e){return new Intl.DateTimeFormat("es-ES",{hour:"2-digit",minute:"2-digit"}).format(e)}const Bt=e.memo(function({messages:s,isTyping:n,welcomeMessage:a="¡Hola! ¿En qué puedo ayudarte?",primaryColor:i,logoUrl:l,botName:c="Mar",bubbleStyles:d,avatars:u}){const m=e.useRef(null),h=e.useRef(null),[p,g]=e.useState(!1),[f,b]=e.useState(!1),x=dt({primaryColor:i}),v=s.length>100,y=(w={count:s.length,getScrollElement:()=>h.current,estimateSize:()=>80,overscan:5,enabled:v},function({useFlushSync:t=!0,...s}){const o=e.useReducer(()=>({}),{})[1],n={...s,onChange:(e,n)=>{var a;t&&n?r.flushSync(o):o(),null==(a=s.onChange)||a.call(s,e,n)}},[a]=e.useState(()=>new Dt(n));return a.setOptions(n),Lt(()=>a._didMount(),[]),Lt(()=>a._willUpdate()),a}({observeElementRect:Et,observeElementOffset:_t,scrollToFn:Ot,...w}));var w;e.useEffect(()=>{g(!0)},[]),e.useEffect(()=>{if(p&&(s.length>0||n)){const e=setTimeout(()=>{v?y.scrollToIndex(s.length-1,{align:"end",behavior:s.length<=1?"auto":"smooth"}):m.current?.scrollIntoView({behavior:s.length<=1?"auto":"smooth",block:"end"})},100);return()=>clearTimeout(e)}},[s.length,n,p,v,y]);const k=e=>{const t=new Date(e);return isNaN(t.getTime())?"":function(e){return function(e){const t=/* @__PURE__ */new Date;return e.getDate()===t.getDate()&&e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear()}(e)?`Hoy, ${Vt(e)}`:function(e){const t=/* @__PURE__ */new Date;return t.setDate(t.getDate()-1),e.getDate()===t.getDate()&&e.getMonth()===t.getMonth()&&e.getFullYear()===t.getFullYear()}(e)?`Ayer, ${Vt(e)}`:function(e){return new Intl.DateTimeFormat("es-ES",{day:"numeric",month:"long",hour:"2-digit",minute:"2-digit"}).format(e)}(e)}(t)};return p?v?/* @__PURE__ */t.jsxs("div",{ref:h,className:"flex-1 overflow-y-auto scroll-smooth bg-background/50 scrollbar-none",style:{padding:"var(--spacing-5)"},children:[
|
|
21
|
+
/* @__PURE__ */t.jsx("div",{style:{height:`${y.getTotalSize()}px`,width:"100%",position:"relative"},children:y.getVirtualItems().map(e=>{const r=s[e.index],o=e.index,n=s[o-1],a=s[o+1],m=n&&Wt(new Date(r.timestamp),new Date(n.timestamp))>15,h=n&&n.sender===r.sender&&Wt(new Date(r.timestamp),new Date(n.timestamp))<5&&!m,p=a&&a.sender===r.sender&&Wt(new Date(a.timestamp),new Date(r.timestamp))<5;/* @__PURE__ */
|
|
22
|
+
return t.jsxs("div",{style:{position:"absolute",top:0,left:0,width:"100%",transform:`translateY(${e.start}px)`},children:[m&&/* @__PURE__ */t.jsx("div",{className:"flex justify-center my-8 animate-in fade-in zoom-in-95",children:/* @__PURE__ */t.jsx("span",{className:"px-4 py-1.5 bg-muted/40 backdrop-blur-md rounded-full text-[10px] font-black text-muted-foreground uppercase tracking-[0.2em] border border-border/50 shadow-sm",children:k(r.timestamp)})}),
|
|
23
|
+
/* @__PURE__ */t.jsx(Ut,{message:r,primaryColor:i,botAvatar:l,botName:c,styles:d,avatars:u,isFirst:!h,isLast:!p})]},e.key)})}),n&&/* @__PURE__ */t.jsxs("div",{className:"flex items-end gap-3 mt-4 mb-2 animate-in fade-in slide-in-from-left-4 duration-500",children:[
|
|
24
|
+
/* @__PURE__ */t.jsx("div",{className:"w-8 h-8 rounded-xl bg-muted/60 border border-border/50 flex items-center justify-center shrink-0 shadow-soft-sm",children:/* @__PURE__ */t.jsxs("div",{className:"flex gap-[2px]",children:[
|
|
25
|
+
/* @__PURE__ */t.jsx("span",{className:"w-1 h-1 bg-primary/50 rounded-full animate-bounce [animation-delay:-0.3s]"}),
|
|
26
|
+
/* @__PURE__ */t.jsx("span",{className:"w-1 h-1 bg-primary/50 rounded-full animate-bounce [animation-delay:-0.15s]"}),
|
|
27
|
+
/* @__PURE__ */t.jsx("span",{className:"w-1 h-1 bg-primary/50 rounded-full animate-bounce"})]})}),
|
|
28
|
+
/* @__PURE__ */t.jsx(Pt,{})]})]}):/* @__PURE__ */t.jsxs("div",{ref:h,className:"flex-1 overflow-y-auto scroll-smooth p-4 bg-background/50 scrollbar-none",children:[
|
|
29
|
+
/* @__PURE__ */t.jsxs("div",{className:"min-h-full flex flex-col justify-end",children:[0===s.length&&/* @__PURE__ */t.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center py-16 text-center animate-in fade-in zoom-in-95 duration-1000",children:[
|
|
30
|
+
/* @__PURE__ */t.jsxs("div",{className:"relative h-24 w-24 mb-6",children:[
|
|
31
|
+
/* @__PURE__ */t.jsx("div",{className:"absolute inset-0 bg-primary/20 rounded-full animate-pulse blur-2xl"}),
|
|
32
|
+
/* @__PURE__ */t.jsx("div",{className:"relative h-full w-full rounded-[28px] border-2 border-primary/20 overflow-hidden bg-card shadow-soft-2xl transition-transform hover:scale-105 duration-500",children:f?/* @__PURE__ */t.jsx("div",{className:"h-full w-full flex items-center justify-center text-3xl",style:{backgroundColor:x},children:"👋"}):l?/* @__PURE__ */t.jsx("img",{src:l,className:"object-cover h-full w-full",alt:c,onError:()=>b(!0)}):/* @__PURE__ */t.jsx("div",{className:"h-full w-full flex items-center justify-center text-3xl",style:{backgroundColor:x},children:"👋"})})]}),
|
|
33
|
+
/* @__PURE__ */t.jsxs("div",{className:"space-y-2",children:[
|
|
34
|
+
/* @__PURE__ */t.jsx("h3",{className:"font-black text-xl text-foreground uppercase tracking-tighter italic",children:c}),
|
|
35
|
+
/* @__PURE__ */t.jsxs("p",{className:"text-[12px] font-bold text-muted-foreground italic px-10 leading-relaxed opacity-60",children:['"',a,'"']})]})]}),
|
|
36
|
+
/* @__PURE__ */t.jsx("div",{className:"flex flex-col",style:{gap:"var(--spacing-3)"},children:s.map((e,r)=>{const n=s[r-1],a=s[r+1],m=n&&Wt(new Date(e.timestamp),new Date(n.timestamp))>15,h=n&&n.sender===e.sender&&Wt(new Date(e.timestamp),new Date(n.timestamp))<5&&!m,p=a&&a.sender===e.sender&&Wt(new Date(a.timestamp),new Date(e.timestamp))<5;/* @__PURE__ */
|
|
37
|
+
return t.jsxs(o.Fragment,{children:[m&&/* @__PURE__ */t.jsx("div",{className:"flex justify-center my-8 animate-in fade-in zoom-in-95",children:/* @__PURE__ */t.jsx("span",{className:"px-4 py-1.5 bg-muted/40 backdrop-blur-md rounded-full text-[10px] font-black text-muted-foreground uppercase tracking-[0.2em] border border-border/50 shadow-sm",children:k(e.timestamp)})}),
|
|
38
|
+
/* @__PURE__ */t.jsx(Ut,{message:e,primaryColor:i,botAvatar:l,botName:c,styles:d,avatars:u,isFirst:!h,isLast:!p})]},e.id||`msg-${r}`)})}),
|
|
39
|
+
/* @__PURE__ */t.jsx("div",{ref:m,className:"h-6 shrink-0"})]}),n&&/* @__PURE__ */t.jsxs("div",{className:"flex items-end gap-3 mt-4 mb-2 animate-in fade-in slide-in-from-left-4 duration-500",children:[
|
|
40
|
+
/* @__PURE__ */t.jsx("div",{className:"w-8 h-8 rounded-xl bg-muted/60 border border-border/50 flex items-center justify-center shrink-0 shadow-soft-sm",children:/* @__PURE__ */t.jsxs("div",{className:"flex gap-[2px]",children:[
|
|
41
|
+
/* @__PURE__ */t.jsx("span",{className:"w-1 h-1 bg-primary/50 rounded-full animate-bounce [animation-delay:-0.3s]"}),
|
|
42
|
+
/* @__PURE__ */t.jsx("span",{className:"w-1 h-1 bg-primary/50 rounded-full animate-bounce [animation-delay:-0.15s]"}),
|
|
43
|
+
/* @__PURE__ */t.jsx("span",{className:"w-1 h-1 bg-primary/50 rounded-full animate-bounce"})]})}),
|
|
44
|
+
/* @__PURE__ */t.jsx(Pt,{})]})]}):/* @__PURE__ */t.jsx("div",{className:"flex-1 bg-background"})},(e,t)=>{if(e.messages.length!==t.messages.length)return!1;if(e.isTyping!==t.isTyping)return!1;if(e.primaryColor!==t.primaryColor)return!1;if(e.botName!==t.botName)return!1;if(e.logoUrl!==t.logoUrl)return!1;const r=e.messages[e.messages.length-1],s=t.messages[t.messages.length-1];return r?.id===s?.id}),Ht={"image/jpeg":[255,216,255],"image/png":[137,80,78,71,13,10,26,10],"image/webp":[82,73,70,70],"image/gif":[71,73,70,56],"audio/mpeg":[255,251],"audio/wav":[82,73,70,70],"audio/webm":[26,69,223,163],"audio/ogg":[79,103,103,83]};async function qt(e,t={}){const{maxSizeMB:r=10,allowedExtensions:s,checkMagicBytes:o=!0}=t;if(!function(e,t=10){const r=1024*t*1024;return e.size<=r}(e,r))return{valid:!1,error:`El archivo es demasiado grande. Máximo ${r}MB`};if(s&&!function(e,t){const r=e.name.split(".").pop()?.toLowerCase();return!!r&&t.includes(r)}(e,s))return{valid:!1,error:`Extensión no permitida. Solo: ${s.join(", ")}`};if(o){const t=await async function(e){try{const t=Ht[e.type];if(!t)return!0;const r=await e.slice(0,12).arrayBuffer(),s=new Uint8Array(r);return t.every((e,t)=>s[t]===e)}catch(t){return console.error("File validation error:",t),!1}}(e);if(!t)return{valid:!1,error:"El archivo está corrupto o no es del tipo indicado"}}return{valid:!0}}const Gt=1e3,Kt={enableImages:!0,enableAudio:!0,enableFiles:!0,enableLocation:!0,allowedFileTypes:["jpg","jpeg","png","webp","gif","pdf","doc","docx","txt","zip"],maxFileSizeMB:10};function Yt({isConnected:r,placeholder:s="Escribe un mensaje...",primaryColor:o,mediaConfig:n,onSendMessage:a,onSendAttachment:i,onSendLocation:l,onVoiceCall:c}){const{t:d}=m(),[u,h]=e.useState(""),[p,g]=e.useState(!1),[f,b]=e.useState(!1),[x,v]=e.useState(0),[y,w]=e.useState(null),[k,j]=e.useState(!1),[C,N]=e.useState(!1),z=e.useRef(null),F=e.useRef(null),_=e.useRef(null),O=e.useRef(null),D=e.useRef([]),L=e.useRef(null),$=dt({primaryColor:o}),P=e.useMemo(()=>({...Kt,...n}),[n]),V=e.useMemo(()=>P.enableImages||P.enableAudio||P.enableFiles||P.enableLocation,[P]),H=()=>{const e=u.trim();y?(i?.(y.file,y.type),w(null),h("")):e&&r&&(a(e),h("")),z.current&&(z.current.style.height="40px")},q=async e=>{const t=e.target.files?.[0];if(!t)return;g(!1);const r=await qt(t,{maxSizeMB:P.maxFileSizeMB||10,allowedExtensions:P.allowedFileTypes||["jpg","jpeg","png","webp","gif","pdf","doc","docx","txt","zip"],checkMagicBytes:!0});if(r.valid)if(t.type.startsWith("image/")&&P.enableImages){j(!0);try{const{default:e}=await import("./browser-image-compression-CsxM8KJN.js"),r={maxSizeMB:.8,maxWidthOrHeight:1200,useWebWorker:!0},s=await e(t,r);w({type:"image",file:s,previewUrl:URL.createObjectURL(s)})}catch(s){vt.error("Image compression failed:",s),w({type:"image",file:t,previewUrl:URL.createObjectURL(t)})}finally{j(!1)}}else w({type:"file",file:t,previewUrl:""});else alert(r.error||"Archivo no válido")},G=async e=>{if(O.current&&(e||(O.current.onstop=null),O.current.stop(),O.current.stream.getTracks().forEach(e=>e.stop())),L.current&&clearInterval(L.current),b(!1),v(0),e&&D.current.length>0){const e=new Blob(D.current,{type:"audio/webm"}),t=new File([e],`audio-${Date.now()}.webm`,{type:"audio/webm"}),r=await qt(t,{maxSizeMB:10});if(!r.valid)return vt.error("Audio validation failed:",r.error),alert(r.error),void(D.current=[]);i?.(t,"audio"),D.current=[]}};/* @__PURE__ */
|
|
45
|
+
return t.jsxs("div",{className:"relative",children:[(y||k)&&/* @__PURE__ */t.jsx("div",{className:"absolute bottom-full left-0 mb-2 p-2 rounded-2xl border shadow-soft-2xl animate-in slide-in-from-bottom-2 z-50",style:{backgroundColor:"hsl(var(--card))",borderColor:"hsl(var(--border))"},children:/* @__PURE__ */t.jsx("div",{className:"relative w-16 h-16",children:k?/* @__PURE__ */t.jsx("div",{className:"w-full h-full flex flex-col items-center justify-center bg-muted rounded-xl",children:/* @__PURE__ */t.jsx(E,{className:"animate-spin text-primary h-5 w-5"})}):"image"===y?.type?/* @__PURE__ */t.jsxs(t.Fragment,{children:[
|
|
46
|
+
/* @__PURE__ */t.jsx("img",{src:y?.previewUrl,className:"w-full h-full object-cover rounded-xl border",alt:d("preview")}),
|
|
47
|
+
/* @__PURE__ */t.jsx("button",{onClick:()=>w(null),className:"absolute -top-1.5 -right-1.5 bg-destructive text-white rounded-full p-1 shadow-md hover:scale-105",children:/* @__PURE__ */t.jsx(B,{size:10,strokeWidth:3})})]}):/* @__PURE__ */t.jsxs(t.Fragment,{children:[
|
|
48
|
+
/* @__PURE__ */t.jsxs("div",{className:"w-full h-full flex flex-col items-center justify-center bg-muted rounded-xl border",children:[
|
|
49
|
+
/* @__PURE__ */t.jsx(M,{className:"text-primary h-6 w-6"}),
|
|
50
|
+
/* @__PURE__ */t.jsx("span",{className:"text-[8px] mt-1 font-bold truncate max-w-[60px]",children:y?.file.name})]}),
|
|
51
|
+
/* @__PURE__ */t.jsx("button",{onClick:()=>w(null),className:"absolute -top-1.5 -right-1.5 bg-destructive text-white rounded-full p-1 shadow-md hover:scale-105",children:/* @__PURE__ */t.jsx(B,{size:10,strokeWidth:3})})]})})}),
|
|
52
|
+
/* @__PURE__ */t.jsx("input",{type:"file",accept:"image/*",className:"hidden",ref:_,onChange:q}),
|
|
53
|
+
/* @__PURE__ */t.jsx("input",{type:"file",accept:P.allowedFileTypes?.map(e=>`.${e}`).join(","),className:"hidden",ref:F,onChange:q}),
|
|
54
|
+
/* @__PURE__ */t.jsxs("div",{className:"flex items-center max-w-full",style:{gap:"var(--spacing-3)"},children:[V&&i&&/* @__PURE__ */t.jsxs("div",{className:"relative shrink-0",children:[p&&/* @__PURE__ */t.jsxs("div",{className:"absolute bottom-full left-0 flex flex-col animate-in fade-in slide-in-from-bottom-2 duration-300 z-[60]",style:{marginBottom:"var(--spacing-2)",gap:"var(--spacing-2)"},children:[P.enableImages&&/* @__PURE__ */t.jsxs("button",{onClick:()=>_.current?.click(),className:"flex items-center border shadow-soft-2xl rounded-2xl transition-colors text-[10px] font-black uppercase tracking-widest",style:{gap:"var(--spacing-3)",padding:"var(--spacing-3) var(--spacing-5)",backgroundColor:"hsl(var(--card))",borderColor:"hsl(var(--border))",color:"hsl(var(--card-foreground))"},children:[
|
|
55
|
+
/* @__PURE__ */t.jsx(S,{size:18,className:"text-blue-500"})," ",d("fotos")]}),P.enableFiles&&/* @__PURE__ */t.jsxs("button",{onClick:()=>F.current?.click(),className:"flex items-center border shadow-soft-2xl rounded-2xl transition-colors text-[10px] font-black uppercase tracking-widest",style:{gap:"var(--spacing-3)",padding:"var(--spacing-3) var(--spacing-5)",backgroundColor:"hsl(var(--card))",borderColor:"hsl(var(--border))",color:"hsl(var(--card-foreground))"},children:[
|
|
56
|
+
/* @__PURE__ */t.jsx(M,{size:18,className:"text-purple-500"})," Archivos"]}),P.enableLocation&&l&&/* @__PURE__ */t.jsxs("button",{onClick:()=>{N(!0),navigator.geolocation.getCurrentPosition(e=>{l?.({latitude:e.coords.latitude,longitude:e.coords.longitude}),N(!1),g(!1)},()=>N(!1))},className:"flex items-center border shadow-soft-2xl rounded-2xl transition-colors text-[10px] font-black uppercase tracking-widest",style:{gap:"var(--spacing-3)",padding:"var(--spacing-3) var(--spacing-5)",backgroundColor:"hsl(var(--card))",borderColor:"hsl(var(--border))",color:"hsl(var(--card-foreground))"},children:[C?/* @__PURE__ */t.jsx(E,{size:18,className:"animate-spin"}):/* @__PURE__ */t.jsx(A,{size:18,className:"text-emerald-500"})," ",d("ubicacion")]}),P.enableVoice&&c&&/* @__PURE__ */t.jsxs("button",{onClick:()=>{c?.(),g(!1)},className:"flex items-center border shadow-soft-2xl rounded-2xl transition-colors text-[10px] font-black uppercase tracking-widest",style:{gap:"var(--spacing-3)",padding:"var(--spacing-3) var(--spacing-5)",backgroundColor:"hsl(var(--card))",borderColor:"hsl(var(--border))",color:"hsl(var(--card-foreground))"},children:[
|
|
57
|
+
/* @__PURE__ */t.jsx(T,{size:18,className:"text-amber-500"})," Llamar"]})]}),
|
|
58
|
+
/* @__PURE__ */t.jsx("button",{onClick:()=>g(!p),className:at("h-10 w-10 rounded-full flex items-center justify-center transition-all shadow-sm z-10",p?"bg-muted text-foreground rotate-45":"bg-muted/50 text-muted-foreground hover:bg-muted"),children:/* @__PURE__ */t.jsx(R,{size:22,strokeWidth:2.5})})]}),
|
|
59
|
+
/* @__PURE__ */t.jsx("div",{className:at("flex-1 relative flex items-center min-w-0 rounded-[24px] border px-4 transition-all shadow-inner",f?"h-[44px]":"min-h-[40px] max-h-[120px]"),style:{backgroundColor:f?"hsl(var(--destructive) / 0.05)":"hsl(var(--muted))",borderColor:f?"hsl(var(--destructive))":"hsl(var(--border))"},children:f?/* @__PURE__ */t.jsxs("div",{className:"flex items-center w-full animate-in zoom-in-95",style:{gap:"var(--spacing-4)"},children:[
|
|
60
|
+
/* @__PURE__ */t.jsx("button",{onClick:()=>G(!1),className:"text-destructive/50 hover:text-destructive",children:/* @__PURE__ */t.jsx(W,{size:18})}),
|
|
61
|
+
/* @__PURE__ */t.jsxs("div",{className:"flex-1 flex items-center",style:{gap:"var(--spacing-2)"},children:[
|
|
62
|
+
/* @__PURE__ */t.jsx("div",{className:"flex gap-[3px]",children:[1,2,3,4].map(e=>/* @__PURE__ */t.jsx("span",{className:"w-[3px] h-3 bg-destructive/60 rounded-full animate-pulse",style:{animationDelay:.15*e+"s"}},e))}),
|
|
63
|
+
/* @__PURE__ */t.jsxs("span",{className:"text-destructive font-black text-[11px] tabular-nums",children:[Math.floor(x/60),":",(x%60).toString().padStart(2,"0")]})]}),
|
|
64
|
+
/* @__PURE__ */t.jsx("button",{onClick:()=>G(!0),className:"w-7 h-7 rounded-full bg-destructive flex items-center justify-center text-white shadow-lg",children:/* @__PURE__ */t.jsx(U,{size:12,fill:"currentColor"})})]}):/* @__PURE__ */t.jsxs("div",{className:"w-full relative flex items-center",children:[
|
|
65
|
+
/* @__PURE__ */t.jsx("textarea",{ref:z,rows:1,value:u,onKeyDown:e=>{"Enter"!==e.key||e.shiftKey||e.ctrlKey||e.metaKey?"Enter"===e.key&&(e.ctrlKey||e.metaKey)&&(e.preventDefault(),H()):(e.preventDefault(),H())},onChange:e=>{const t=e.target.value.slice(0,Gt);h(t),z.current&&(z.current.style.height="40px",z.current.style.height=`${Math.min(z.current.scrollHeight,120)}px`)},onFocus:()=>g(!1),placeholder:s,"aria-label":d("accessibility.typeMessage"),"aria-describedby":"send-message-hint","aria-invalid":u.length>Gt,disabled:!r,className:"w-full bg-transparent text-sm py-2.5 outline-none resize-none overflow-hidden leading-tight pr-8 scrollbar-none disabled:opacity-50",style:{scrollbarWidth:"none",msOverflowStyle:"none",color:"hsl(var(--foreground))"}}),
|
|
66
|
+
/* @__PURE__ */t.jsx("span",{id:"send-message-hint",className:"sr-only",children:d("accessibility.sendMessageHint")}),u.length>800&&/* @__PURE__ */t.jsx("span",{className:at("absolute right-0 text-[9px] font-bold tabular-nums",u.length>=Gt?"text-destructive":"text-muted-foreground/40"),children:Gt-u.length})]})}),!f&&/* @__PURE__ */t.jsx(t.Fragment,{children:u.trim()||y?/* @__PURE__ */t.jsx("button",{onClick:H,disabled:!r||k&&!!y,className:"h-10 w-10 rounded-full flex items-center justify-center transition-all active:scale-90 shadow-md shadow-primary/20 shrink-0 disabled:opacity-30 disabled:grayscale",style:{backgroundColor:$},children:/* @__PURE__ */t.jsx(U,{size:18,className:"text-white ml-0.5 fill-current"})}):P.enableAudio&&i?/* @__PURE__ */t.jsx("button",{onClick:async()=>{if(r)try{const e=await navigator.mediaDevices.getUserMedia({audio:!0}),t=new MediaRecorder(e);O.current=t,D.current=[],t.ondataavailable=e=>D.current.push(e.data),t.onstop=()=>{const e=new File([new Blob(D.current)],"voice.webm",{type:"audio/webm"});i?.(e,"audio")},t.start(),b(!0),L.current=setInterval(()=>v(e=>e+1),1e3)}catch{alert("Micrófono denegado o no disponible")}},disabled:!r,className:"h-10 w-10 rounded-full flex items-center justify-center transition-all active:scale-90 shadow-md shadow-primary/20 shrink-0 disabled:opacity-30 disabled:grayscale",style:{backgroundColor:$},children:/* @__PURE__ */t.jsx(I,{size:20,strokeWidth:2.5,className:"text-white"})}):/* @__PURE__ */t.jsx("button",{onClick:H,disabled:!r,className:"h-10 w-10 rounded-full flex items-center justify-center transition-all active:scale-90 shadow-md shadow-primary/20 shrink-0 disabled:opacity-30 disabled:grayscale",style:{backgroundColor:$},children:/* @__PURE__ */t.jsx(U,{size:18,className:"text-white ml-0.5 fill-current"})})})]})]})}function Jt(e,t){let r=0,s=null;return function(...o){const n=Date.now(),a=n-r,i=()=>{r=n,e(...o)};a>=t?(s&&(clearTimeout(s),s=null),i()):s||(s=setTimeout(()=>{i(),s=null},t-a))}}function Zt(t=640){const[r,s]=e.useState(()=>"undefined"!=typeof window&&window.innerWidth<t);return e.useEffect(()=>{const e=Jt(()=>{s(window.innerWidth<t)},250);return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[t]),r}const Qt="24px",Xt=["¡Hola! Gracias por llamar. ¿En qué puedo ayudarte hoy?","Entendido. Déjame revisar esa información para ti.","Claro, puedo ayudarte con eso. ¿Necesitas algo más?","Perfecto. Tu solicitud ha sido registrada.","No hay problema. ¿Tienes alguna otra consulta?"];function er({isOpen:r,onClose:s,primaryColor:o="#10b981"}){const[n,a]=e.useState("idle"),[i,l]=e.useState(0),[c,d]=e.useState(0),[u,m]=e.useState(null),[h,p]=e.useState([.15,.15,.15,.15,.15,.15,.15]),[g,f]=e.useState(""),[b,x]=e.useState(0),[v,y]=e.useState(!1),w=e.useRef(null),k=e.useRef(null),j=e.useRef(null),C=e.useRef(null),N=e.useRef(null),M=e.useRef(null),z=e.useRef(0),S=e.useCallback(()=>{const e=Xt[b%Xt.length];f(e),x(e=>e+1),a("speaking"),y(!1);const t=Math.max(2500,60*e.length);M.current=setTimeout(()=>{a("listening"),f(""),z.current=0},t)},[b]),E=e.useCallback(async()=>{try{a("connecting"),m(null);const e=await navigator.mediaDevices.getUserMedia({audio:{echoCancellation:!1,noiseSuppression:!1,autoGainControl:!1}});w.current=e;const t=new(window.AudioContext||window.webkitAudioContext);k.current=t,"suspended"===t.state&&await t.resume();const r=t.createAnalyser();r.fftSize=256,r.smoothingTimeConstant=.3,j.current=r,t.createMediaStreamSource(e).connect(r);const s=new Uint8Array(r.frequencyBinCount),o=7,n=()=>{if(!j.current)return;j.current.getByteTimeDomainData(s);let e=0;for(let o=0;o<s.length;o++){const t=(s[o]-128)/128;e+=t*t}const t=Math.sqrt(e/s.length),r=Math.min(15*t,1);d(r);const a=Array.from({length:o},(e,t)=>{const s=Math.abs(t-Math.floor(o/2)),n=.05+.1*Math.random(),a=r*(1-.12*s);return Math.max(.12,Math.min(1,a+n))});p(a),C.current=requestAnimationFrame(n)};n(),N.current=setInterval(()=>{l(e=>e+1)},1e3),a("speaking"),f(Xt[0]),x(1),M.current=setTimeout(()=>{a("listening"),f("")},3500)}catch(e){console.error("[VoiceCallDemo] Microphone error:",e),m("No se pudo acceder al micrófono"),a("idle")}},[]);e.useEffect(()=>{"listening"===n?c>.08?(y(!0),z.current=0):v&&c<.05&&(0===z.current?z.current=Date.now():(Date.now()-z.current)/1e3>=1&&S()):z.current=0},[c,n,v,S]);const A=e.useCallback(()=>{C.current&&(cancelAnimationFrame(C.current),C.current=null),N.current&&(clearInterval(N.current),N.current=null),M.current&&(clearTimeout(M.current),M.current=null),w.current&&(w.current.getTracks().forEach(e=>e.stop()),w.current=null),k.current&&(k.current.close(),k.current=null),j.current=null,d(0),l(0),p([.15,.15,.15,.15,.15,.15,.15]),a("idle"),f(""),y(!1),z.current=0},[]),F=e.useCallback(()=>{if(!w.current)return;const e=w.current.getAudioTracks()[0];e&&(e.enabled=!e.enabled,a(e.enabled?"listening":"muted"))},[]),O=e.useCallback(()=>{A(),s()},[A,s]);if(e.useEffect(()=>(r&&"idle"===n&&E(),()=>{r||A()}),[r,n,E,A]),e.useEffect(()=>()=>{A()},[A]),!r)return null;const L=Array.from({length:7},(e,t)=>{const r=(Date.now()/120+.6*t)%(2*Math.PI);return.25+.5*Math.sin(r)});/* @__PURE__ */
|
|
67
|
+
return t.jsxs("div",{className:"absolute inset-0 z-50 flex flex-col items-center justify-center rounded-2xl overflow-hidden",style:{background:"hsl(var(--background) / 0.98)",backdropFilter:"blur(10px)"},children:[
|
|
68
|
+
/* @__PURE__ */t.jsxs("div",{className:"absolute top-0 left-0 right-0 flex items-center justify-between p-4 border-b border-border/50",children:[
|
|
69
|
+
/* @__PURE__ */t.jsxs("div",{className:"flex items-center gap-2",children:[
|
|
70
|
+
/* @__PURE__ */t.jsx(T,{className:"h-4 w-4",style:{color:o}}),
|
|
71
|
+
/* @__PURE__ */t.jsx("span",{className:"text-sm font-medium",children:"Llamada"})]}),
|
|
72
|
+
/* @__PURE__ */t.jsx("span",{className:"text-sm font-mono text-muted-foreground",children:(e=>{const t=e%60;return`${Math.floor(e/60).toString().padStart(2,"0")}:${t.toString().padStart(2,"0")}`})(i)})]}),
|
|
73
|
+
/* @__PURE__ */t.jsxs("div",{className:"flex flex-col items-center gap-5 px-4",children:[
|
|
74
|
+
/* @__PURE__ */t.jsxs("div",{className:at("h-20 w-20 rounded-full flex items-center justify-center transition-all duration-150","connecting"===n&&"animate-pulse"),style:{backgroundColor:"muted"===n?"hsl(var(--muted))":"speaking"===n?"#3b82f620":`${o}20`,boxShadow:"listening"===n?`0 0 ${15+35*c}px ${o}50`:"speaking"===n?"0 0 25px #3b82f650":"none",transform:"listening"===n?`scale(${1+.08*c})`:"scale(1)"},children:["connecting"===n&&/* @__PURE__ */t.jsx(T,{className:"h-8 w-8 animate-bounce",style:{color:o}}),"listening"===n&&/* @__PURE__ */t.jsx(I,{className:"h-8 w-8",style:{color:o}}),"muted"===n&&/* @__PURE__ */t.jsx(_,{className:"h-8 w-8 text-muted-foreground"}),"speaking"===n&&/* @__PURE__ */t.jsx(V,{className:"h-8 w-8 text-blue-500"})]}),("listening"===n||"muted"===n||"speaking"===n)&&/* @__PURE__ */t.jsx("div",{className:"flex items-center gap-1.5 h-12",children:("speaking"===n?L:h).map((e,r)=>/* @__PURE__ */t.jsx("div",{className:"w-2 rounded-full",style:{height:`${Math.max(5,45*e)}px`,backgroundColor:"muted"===n?"hsl(var(--muted-foreground))":"speaking"===n?"#3b82f6":o,opacity:"muted"===n?.3:.85,transition:"height 60ms ease-out"}},r))}),"speaking"===n&&g&&/* @__PURE__ */t.jsx("div",{className:"max-w-[280px] p-3 rounded-xl text-center text-sm leading-relaxed",style:{backgroundColor:"hsl(var(--muted))",color:"hsl(var(--foreground))"},children:g}),u&&/* @__PURE__ */t.jsx("p",{className:"text-sm text-red-500 text-center px-4",children:u})]}),
|
|
75
|
+
/* @__PURE__ */t.jsxs("div",{className:"absolute bottom-6 flex items-center gap-4",children:[
|
|
76
|
+
/* @__PURE__ */t.jsx("button",{type:"button",onClick:F,disabled:"connecting"===n||"speaking"===n,className:at("h-12 w-12 rounded-full flex items-center justify-center","transition-all duration-200","focus:outline-none focus:ring-2 focus:ring-offset-2","disabled:opacity-50","muted"===n?"bg-amber-500 hover:bg-amber-600 text-white focus:ring-amber-500":"bg-muted hover:bg-muted/80 text-foreground focus:ring-primary"),"aria-label":"muted"===n?"Activar micrófono":"Silenciar",children:"muted"===n?/* @__PURE__ */t.jsx(_,{className:"h-5 w-5"}):/* @__PURE__ */t.jsx(I,{className:"h-5 w-5"})}),
|
|
77
|
+
/* @__PURE__ */t.jsx("button",{type:"button",onClick:O,className:at("h-14 w-14 rounded-full flex items-center justify-center","bg-red-500 hover:bg-red-600 text-white","shadow-lg transition-all duration-200","focus:outline-none focus:ring-2 focus:ring-red-500 focus:ring-offset-2","active:scale-95"),"aria-label":"Terminar llamada",children:/* @__PURE__ */t.jsx(D,{className:"h-6 w-6"})})]})]})}function tr({isOpen:r,isConnected:s,isTyping:o,messages:n,botName:a="Mar",logoUrl:i,welcomeMessage:l,inputPlaceholder:c,primaryColor:d,mediaConfig:u,onClose:h,onSendMessage:p,bubbleStyles:g,avatars:f,onSendAttachment:b,onSendLocation:x,onVoiceCall:v,theme:y}){const[w,k]=e.useState(!1),[j,C]=e.useState(!1),{t:N}=m(),M=Zt(),S=dt({primaryColor:d}),E=function({isOpen:t,height:r,bottom:s}){const o=Zt(),[n,a]=e.useState({}),i=e.useCallback(()=>{if(o){const e=()=>{window.visualViewport?a({height:`${window.visualViewport.height}px`,width:"100%",top:`${window.visualViewport.offsetTop}px`,left:"0px",bottom:"auto",right:"auto",transform:"none"}):a({height:"100dvh",width:"100%",top:"0px",left:"0px"})};return e(),window.visualViewport?.addEventListener("resize",e),window.visualViewport?.addEventListener("scroll",e),()=>{window.visualViewport?.removeEventListener("resize",e),window.visualViewport?.removeEventListener("scroll",e)}}{const e=parseFloat(s||Qt)||24,t=window.innerHeight-64-e;if(r){const e=parseFloat(r)||700,o=Math.min(e,t);a({height:`${o}px`,maxHeight:`${t}px`,bottom:s||Qt})}else{const e=Math.min(700,Math.max(500,t));a({height:`${e}px`,maxHeight:`${t}px`,bottom:s||Qt})}}},[o,r,s]);return e.useEffect(()=>{if(!t)return;const e=i();return window.addEventListener("resize",i),()=>{window.removeEventListener("resize",i),e&&e()}},[t,i]),n}({isOpen:r,height:y?.height,bottom:y?.bottom}),A=function({enabled:t,returnFocusRef:r,onEscape:s}){const o=e.useRef(null),n=e.useRef(null);return e.useEffect(()=>{if(!t)return;n.current=document.activeElement;const e=r?.current,a=o.current;if(!a)return;const i=setTimeout(()=>{const e=a.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');e.length>0?e[0].focus():a.focus()},100),l=e=>{if(a)if("Escape"!==e.key){if("Tab"===e.key){const t=a.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])');if(0===t.length)return;const r=t[0],s=t[t.length-1];e.shiftKey&&document.activeElement===r?(e.preventDefault(),s.focus()):e.shiftKey||document.activeElement!==s||(e.preventDefault(),r.focus())}}else s?.()};return document.addEventListener("keydown",l),()=>{clearTimeout(i),document.removeEventListener("keydown",l);const t=e||n.current;t&&"function"==typeof t.focus&&t.focus()}},[t,s,r]),o}({enabled:r,onEscape:h});if(e.useEffect(()=>{if(r)return M&&(document.body.style.overflow="hidden",document.body.style.position="fixed",document.body.style.width="100%"),()=>{document.body.style.overflow="",document.body.style.position="",document.body.style.width=""}},[r,M]),!r)return null;const F="bottom-left"===y?.position;/* @__PURE__ */
|
|
78
|
+
return t.jsxs(t.Fragment,{children:[
|
|
79
|
+
/* @__PURE__ */t.jsx("div",{id:"chat-window-description",className:"sr-only",children:N("accessibility.dialogDescription")}),
|
|
80
|
+
/* @__PURE__ */t.jsxs("div",{ref:A,role:"dialog","aria-modal":"true","aria-labelledby":"chat-window-title","aria-describedby":"chat-window-description",tabIndex:-1,className:at("flex flex-col overflow-hidden transition-all duration-500 ease-[cubic-bezier(0.16,1,0.3,1)]","text-foreground z-[9999]",!M&&["fixed",F?"left-6":"right-6","w-[350px] min-w-[350px] max-w-[350px]","rounded-[32px] border shadow-soft-2xl","animate-in fade-in zoom-in-95","slide-in-from-bottom-10"],M&&["fixed inset-0 w-full"]),style:{...E,backgroundColor:"hsl(var(--background))",borderColor:"hsl(var(--border))",color:"hsl(var(--foreground))"},children:[
|
|
81
|
+
/* @__PURE__ */t.jsx("header",{className:"relative shrink-0 border-b z-20",style:{padding:"var(--spacing-5)",backgroundColor:"hsl(var(--background) / 0.9)",borderColor:"hsl(var(--border))",backdropFilter:"blur(24px)"},children:/* @__PURE__ */t.jsxs("div",{className:"flex items-center justify-between",children:[
|
|
82
|
+
/* @__PURE__ */t.jsxs("div",{className:"flex items-center gap-3",children:[
|
|
83
|
+
/* @__PURE__ */t.jsxs("div",{className:"relative",children:[
|
|
84
|
+
/* @__PURE__ */t.jsx("div",{className:"h-10 w-10 rounded-2xl overflow-hidden bg-primary/10 border-2 border-background shadow-soft-sm",children:w?/* @__PURE__ */t.jsx("div",{className:"h-full w-full flex items-center justify-center bg-muted text-muted-foreground",children:/* @__PURE__ */t.jsx("svg",{className:"w-5 h-5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:/* @__PURE__ */t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M16 7a4 4 0 11-8 0 4 4 0 018 0zM12 14a7 7 0 00-7 7h14a7 7 0 00-7-7z"})})}):/* @__PURE__ */t.jsx("img",{src:i||yt,alt:a,className:"h-full w-full object-cover",onError:()=>k(!0)})}),
|
|
85
|
+
/* @__PURE__ */t.jsx("div",{className:at("absolute -bottom-0.5 -right-0.5 h-3.5 w-3.5 rounded-full border-2 border-background",s?"bg-emerald-500":"bg-amber-500 animate-pulse")})]}),
|
|
86
|
+
/* @__PURE__ */t.jsxs("div",{className:"flex flex-col",children:[
|
|
87
|
+
/* @__PURE__ */t.jsxs("div",{className:"flex items-center gap-1",children:[
|
|
88
|
+
/* @__PURE__ */t.jsx("span",{id:"chat-window-title",className:"font-black text-xs uppercase tracking-tight text-foreground",children:a}),
|
|
89
|
+
/* @__PURE__ */t.jsx(P,{className:"h-3 w-3 text-primary fill-primary/10"})]}),
|
|
90
|
+
/* @__PURE__ */t.jsxs("div",{id:"chat-window-description",className:"flex items-center gap-1.5 mt-0.5",children:[
|
|
91
|
+
/* @__PURE__ */t.jsx("span",{className:"flex h-1 w-1 rounded-full bg-emerald-500"}),
|
|
92
|
+
/* @__PURE__ */t.jsx("span",{className:"text-[9px] font-black text-muted-foreground uppercase tracking-[0.1em]",children:N(s?"online":"offline")})]})]})]}),
|
|
93
|
+
/* @__PURE__ */t.jsxs("div",{className:"flex items-center gap-2",children:[v&&/* @__PURE__ */t.jsx("button",{onClick:()=>C(!0),"aria-label":"Iniciar llamada de voz",title:"Llamar",className:"h-8 w-8 flex items-center justify-center rounded-full bg-emerald-500/10 hover:bg-emerald-500/20 text-emerald-600 transition-all active:scale-90 focus:outline-none focus:ring-2 focus:ring-emerald-500 focus:ring-offset-2",children:/* @__PURE__ */t.jsx(T,{className:"h-4 w-4","aria-hidden":"true"})}),
|
|
94
|
+
/* @__PURE__ */t.jsx("button",{onClick:h,"aria-label":N("accessibility.closeChat"),title:"Esc",className:"h-8 w-8 flex items-center justify-center rounded-full bg-muted/60 hover:bg-muted text-foreground transition-all active:scale-90 focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2",children:/* @__PURE__ */t.jsx(B,{className:"h-4 w-4","aria-hidden":"true"})})]})]})}),
|
|
95
|
+
/* @__PURE__ */t.jsxs("main",{role:"region","aria-label":N("accessibility.chatMessages"),className:"flex-1 min-h-0 relative flex flex-col",style:{padding:"var(--spacing-5)",backgroundColor:"hsl(var(--muted))"},children:[
|
|
96
|
+
/* @__PURE__ */t.jsx(Bt,{messages:n,isTyping:o,welcomeMessage:l,primaryColor:d,logoUrl:i,botName:a,bubbleStyles:g,avatars:f}),
|
|
97
|
+
/* @__PURE__ */t.jsx("div",{className:"absolute top-0 left-0 right-0 h-6 bg-gradient-to-b from-background/10 to-transparent pointer-events-none"})]}),
|
|
98
|
+
/* @__PURE__ */t.jsxs("footer",{className:"border-t",style:{paddingTop:"var(--spacing-5)",paddingLeft:"var(--spacing-5)",paddingRight:"var(--spacing-5)",paddingBottom:M?"max(var(--spacing-3), env(safe-area-inset-bottom))":"var(--spacing-3)",backgroundColor:"hsl(var(--background))",borderColor:"hsl(var(--border))"},children:[
|
|
99
|
+
/* @__PURE__ */t.jsx(Yt,{isConnected:s,placeholder:c,primaryColor:S,mediaConfig:u,onSendMessage:p,onSendAttachment:b,onSendLocation:x,onVoiceCall:v}),
|
|
100
|
+
/* @__PURE__ */t.jsxs("div",{className:"flex items-center justify-center gap-1 opacity-25 select-none",style:{marginTop:"var(--spacing-2)",paddingBottom:"var(--spacing-1)"},children:[
|
|
101
|
+
/* @__PURE__ */t.jsx(z,{className:"h-2 w-2 text-primary fill-primary"}),
|
|
102
|
+
/* @__PURE__ */t.jsx("span",{className:"text-[7px] font-bold uppercase tracking-[0.2em]",children:N("con_amor_paseo_libre")})]})]}),
|
|
103
|
+
/* @__PURE__ */t.jsx(er,{isOpen:j,onClose:()=>C(!1),primaryColor:S})]})]})}export{j as C,yt as D,E as L,F as M,O as P,$ as R,B as X,H as Z,L as a,w as b,at as c,k as d,u as e,ft as f,dt as g,bt as h,wt as i,Zt as j,gt as k,vt as l,ct as m,tr as n,Jt as t,m as u};
|
|
104
|
+
//# sourceMappingURL=chunk-chat-ui-DmqgsaBa.js.map
|