claudius-chat-widget 1.12.0 → 1.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/claudius.cjs +6 -6
- package/dist/claudius.css +1 -1
- package/dist/claudius.iife.js +14 -14
- package/dist/claudius.js +852 -739
- package/dist/index.d.cts +28 -0
- package/dist/index.d.ts +28 -0
- package/package.json +1 -1
package/dist/claudius.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
"use strict";var Se=Object.defineProperty;var Ce=(t,
|
|
1
|
+
"use strict";var Se=Object.defineProperty;var Ce=(e,t,r)=>t in e?Se(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var Y=(e,t,r)=>Ce(e,typeof t!="symbol"?t+"":t,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),l=require("react");class A extends Error{constructor(t,r,s,n){super(t),this.status=r,this.code=s,this.retryAfter=n,this.name="ChatApiError"}}class ee extends Error{constructor(){super("Request debounced"),this.name="DebounceError"}}const Me=3e4;class ge{constructor(t,r){Y(this,"baseUrl");Y(this,"maxRetries");Y(this,"debounceMs");Y(this,"timeoutMs");Y(this,"lastSendTime",0);this.baseUrl=t,this.maxRetries=(r==null?void 0:r.maxRetries)??2,this.debounceMs=(r==null?void 0:r.debounceMs)??300,this.timeoutMs=(r==null?void 0:r.timeoutMs)??Me}async sendMessage(t){if(this.debounceMs>0&&Date.now()-this.lastSendTime<this.debounceMs)throw new ee;this.lastSendTime=Date.now();let r;for(let s=0;s<=this.maxRetries;s++)try{const n=await this.fetchWithTimeout(t);if(n.ok)return await n.json();const o=await n.json().catch(()=>({})),i=n.headers.get("Retry-After"),u=i?Number(i):void 0;if(r=new A(o.error??`Request failed with status ${n.status}`,n.status,o.code,u),!this.isRetryable(n.status))throw r;if(s<this.maxRetries){const c=this.getRetryDelay(n,s);await this.delay(c)}}catch(n){if(n instanceof A){if(!this.isRetryable(n.status,n.code))throw n;if(r=n,s<this.maxRetries){const o=this.getRetryDelay(null,s);await this.delay(o)}}else if(r=new A("Failed to connect. Please try again.",0,"NETWORK_ERROR"),s<this.maxRetries){const o=this.getRetryDelay(null,s);await this.delay(o)}}throw r}async streamMessage(t,r={}){var n;if(typeof ReadableStream>"u")return this.sendMessage(t);if(this.debounceMs>0&&Date.now()-this.lastSendTime<this.debounceMs)throw new ee;this.lastSendTime=Date.now();let s;for(let o=0;o<=this.maxRetries;o++){let i;try{i=await this.fetchStream(t,r.signal)}catch(c){if((n=r.signal)!=null&&n.aborted)return{reply:"",aborted:!0};if(s=c instanceof A?c:new A("Failed to connect. Please try again.",0,"NETWORK_ERROR"),!this.isRetryable(s.status,s.code))throw s;o<this.maxRetries&&await this.delay(this.getRetryDelay(null,o));continue}if(i.status===404||i.status===405)return this.lastSendTime=0,this.sendMessage(t);if(!i.ok){const c=await i.json().catch(()=>({})),d=i.headers.get("Retry-After");if(s=new A(c.error??`Request failed with status ${i.status}`,i.status,c.code,d?Number(d):void 0),!this.isRetryable(i.status))throw s;o<this.maxRetries&&await this.delay(this.getRetryDelay(i,o));continue}if(!(i.headers.get("Content-Type")??"").includes("text/event-stream"))try{return await i.json()}catch{return this.lastSendTime=0,this.sendMessage(t)}return i.body?this.readSseStream(i.body,r):(this.lastSendTime=0,this.sendMessage(t))}throw s}async readSseStream(t,r){var f,y,k,R,j,x,v;const s=t.getReader(),n=new TextDecoder;let o="",i="";const u=[];let c;const d=()=>{s.cancel().catch(()=>{})};(f=r.signal)==null||f.addEventListener("abort",d,{once:!0});try{for(;;){let S;try{S=await s.read()}catch(w){if((y=r.signal)!=null&&y.aborted)break;throw w}if((k=r.signal)!=null&&k.aborted||S.done)break;o+=n.decode(S.value,{stream:!0});let O;for(;(O=o.indexOf(`
|
|
2
2
|
|
|
3
|
-
`))!==-1;){const
|
|
4
|
-
`))s.startsWith("event:")?
|
|
5
|
-
`));return typeof s!="object"||s===null?null:{event:
|
|
6
|
-
`),r=
|
|
7
|
-
`);return e.map((r,s)=>a.jsxs("span",{children:[Xe(r,`l${s}`),s<e.length-1&&a.jsx("br",{})]},s))}const Qe=u.memo(function({role:e,content:r,isStreaming:s=!1,sources:n,onSourceClick:o,isSourceActive:i}){const l=e==="user",c=s?ze(r):r;return a.jsxs("div",{className:`${l?"ml-auto":"mr-auto"} max-w-[85%]`,children:[a.jsx("div",{className:`rounded-claudius-bubble px-4 py-2.5 text-sm leading-relaxed font-body ${l?"bg-claudius-user-bubble text-claudius-user-bubble-text rounded-br-claudius-tail":"bg-claudius-assistant-bubble text-claudius-assistant-bubble-text rounded-bl-claudius-tail"}`,children:Ze(c)}),!l&&n&&n.length>0&&o&&a.jsx("div",{className:"mt-1",children:a.jsx(We,{count:n.length,isActive:i??!1,onClick:o})})]})}),re=2e3,et=1800;function tt({onSend:t,isLoading:e,isStreaming:r=!1,onStop:s,placeholder:n,translations:o}){const[i,l]=u.useState(""),c=u.useRef(null),d=i.length,h=d>=et,p=d>=re,N=n??(o==null?void 0:o.placeholder)??"Type your message...",E=(o==null?void 0:o.sendMessage)??"Send message",T=(o==null?void 0:o.stopGenerating)??"Stop generating",y=(o==null?void 0:o.typeYourMessage)??"Type your message",w=r&&!!s;u.useEffect(()=>{var x;e||(x=c.current)==null||x.focus()},[e]);const C=x=>{x.preventDefault();const S=i.trim();!S||p||(t(S),l(""))},v=x=>{const S=x.target.value;S.length<=re&&l(S)};return a.jsxs("form",{onSubmit:C,className:"border-t border-claudius-border bg-claudius-surface p-3",children:[a.jsxs("div",{className:"flex gap-2",children:[a.jsx("input",{ref:c,type:"text",value:i,onChange:v,placeholder:N,disabled:e,"aria-label":y,"aria-describedby":h?"char-count":void 0,className:"flex-1 rounded-claudius-sm border border-claudius-border bg-claudius-field px-3 py-2 text-sm font-body text-claudius-text placeholder:text-claudius-text-muted focus:border-claudius-accent focus:outline-none focus:ring-1 focus:ring-claudius-accent disabled:opacity-50"}),w?a.jsx("button",{type:"button",onClick:s,"aria-label":T,className:"flex h-11 w-11 shrink-0 items-center justify-center rounded-claudius-sm bg-claudius-accent text-claudius-accent-text transition-colors hover:opacity-90",children:a.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:a.jsx("rect",{x:"6",y:"6",width:"12",height:"12",rx:"1.5"})})}):a.jsx("button",{type:"submit",disabled:e||p,"aria-label":E,className:"flex h-11 w-11 shrink-0 items-center justify-center rounded-claudius-sm bg-claudius-accent text-claudius-accent-text transition-colors hover:opacity-90 disabled:opacity-50",children:a.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("line",{x1:"22",y1:"2",x2:"11",y2:"13"}),a.jsx("polygon",{points:"22 2 15 22 11 13 2 9 22 2"})]})})]}),h&&a.jsxs("div",{id:"char-count",className:`mt-1 text-xs text-right ${p?"text-claudius-error":"text-claudius-text-muted"}`,"aria-live":"polite",children:[d,"/",re]})]})}const rt=["blog","page","external"],st={blog:"Blog",page:"Page",external:"External"};function nt(t){try{return new URL(t).hostname}catch{return t}}const ot=u.memo(function({sources:e,onClose:r}){const s=rt.map(o=>({type:o,label:st[o],items:e.filter(i=>i.type===o)})).filter(o=>o.items.length>0),n=e.length===1?"1 source found":`${e.length} sources found`;return a.jsxs("div",{className:"absolute inset-y-0 left-0 z-10 flex w-[280px] flex-col border-r-2 border-claudius-border bg-claudius-surface rounded-r-claudius-lg transition-transform duration-200 ease-out",children:[a.jsxs("div",{className:"flex items-center justify-between border-b border-claudius-border px-4 py-3",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"text-sm font-heading font-semibold text-claudius-text",children:"Sources"}),a.jsx("p",{className:"text-xs text-claudius-text-muted",children:n})]}),a.jsx("button",{onClick:r,"aria-label":"Close sources",className:"flex h-7 w-7 items-center justify-center rounded-claudius-full text-claudius-text-muted transition-colors hover:bg-claudius-surface-muted hover:text-claudius-text",children:a.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),a.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),a.jsx("div",{className:"flex-1 overflow-y-auto px-3 py-3 space-y-4",children:s.map(o=>a.jsxs("div",{children:[a.jsx("h4",{className:"mb-2 text-xs font-semibold uppercase tracking-wide text-claudius-text-muted",children:o.label}),a.jsx("div",{className:"space-y-2",children:o.items.map(i=>{const l=xe(i.url);return l?a.jsxs("a",{href:l,target:"_blank",rel:"noopener noreferrer",className:"block rounded-claudius-md border-2 border-claudius-border bg-claudius-surface-muted p-3 transition-colors hover:bg-claudius-border",children:[a.jsx("p",{className:"truncate text-sm font-medium text-claudius-text",children:i.title}),a.jsx("p",{className:"mt-0.5 text-xs text-claudius-text-muted",children:nt(l)})]},l):null})})]},o.type))})]})});function at({title:t,subtitle:e,titleId:r,closeLabel:s,onClose:n}){return a.jsxs("div",{className:"flex items-center gap-3 bg-claudius-accent px-5 py-4",children:[a.jsx("div",{"aria-hidden":"true",className:"flex h-8 w-8 items-center justify-center rounded-claudius-full bg-claudius-accent-soft text-sm font-bold text-claudius-accent-text",children:t.charAt(0).toUpperCase()}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h2",{id:r,className:"text-sm font-heading font-semibold text-claudius-accent-text",children:t}),a.jsx("p",{className:"text-xs text-claudius-accent-text",children:e})]}),a.jsx("button",{onClick:n,"aria-label":s,className:"flex h-10 w-10 items-center justify-center rounded-claudius-full text-claudius-accent-text-muted transition-colors hover:bg-claudius-accent-soft hover:text-claudius-accent-text",children:a.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),a.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})}function it({message:t,retryLabel:e,onRetry:r}){return a.jsxs("div",{role:"alert",className:"mx-auto flex max-w-[90%] flex-col items-center gap-2 rounded-claudius-sm bg-claudius-error-surface px-3 py-2 text-center text-xs text-claudius-error",children:[a.jsx("span",{children:t}),r&&a.jsx("button",{type:"button",onClick:r,className:"rounded-claudius-md bg-claudius-error px-3 py-1 text-xs font-semibold text-claudius-error-text transition-opacity hover:opacity-90 focus:outline-none focus-visible:ring-2 focus-visible:ring-claudius-error focus-visible:ring-offset-1",children:e})]})}function ct({label:t}){return a.jsx("div",{role:"status","aria-live":"polite","aria-label":t,className:"mr-auto flex max-w-[85%]",children:a.jsxs("div",{className:"flex gap-1 rounded-claudius-bubble rounded-bl-claudius-tail bg-claudius-assistant-bubble px-4 py-3",children:[a.jsx("span",{className:"h-2 w-2 motion-safe:animate-bounce rounded-claudius-full bg-claudius-text-muted [animation-delay:0ms]"}),a.jsx("span",{className:"h-2 w-2 motion-safe:animate-bounce rounded-claudius-full bg-claudius-text-muted [animation-delay:150ms]"}),a.jsx("span",{className:"h-2 w-2 motion-safe:animate-bounce rounded-claudius-full bg-claudius-text-muted [animation-delay:300ms]"})]})})}function ut(t,e,r){const[s,n]=u.useState(0),o=u.useRef(0),i=u.useRef(0),l=u.useRef(0),c=u.useRef(!1);return u.useEffect(()=>{const d=t.current;if(!r||!d)return;const h=E=>{if(d.scrollTop>0){c.current=!1;return}c.current=!0,i.current=E.touches[0].clientY,l.current=Date.now()},p=E=>{if(!c.current)return;let T=E.touches[0].clientY-i.current;T<0&&(T=T*.3),o.current=T,n(T)},N=()=>{if(!c.current)return;c.current=!1;const E=o.current,T=(Date.now()-l.current)/1e3,y=d.getBoundingClientRect().height,w=T>.05&&E>0&&E/T>500,C=E>y*.3;w||C?e():(o.current=0,n(0))};return d.addEventListener("touchstart",h,{passive:!0}),d.addEventListener("touchmove",p,{passive:!0}),d.addEventListener("touchend",N),()=>{d.removeEventListener("touchstart",h),d.removeEventListener("touchmove",p),d.removeEventListener("touchend",N)}},[t,e,r]),{offsetY:s}}const lt='a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';function dt(t,e){u.useEffect(()=>{const r=t.current;if(!r)return;const s=n=>{if(n.key!=="Tab")return;const o=Array.from(r.querySelectorAll(lt)).filter(d=>!d.hasAttribute("aria-hidden"));if(o.length===0)return;const i=o[0],l=o[o.length-1],c=document.activeElement;n.shiftKey&&c===i?(n.preventDefault(),l.focus()):!n.shiftKey&&c===l&&(n.preventDefault(),i.focus())};return r.addEventListener("keydown",s),()=>r.removeEventListener("keydown",s)},[t,e])}const ft=/\*\*([^*]+)\*\*/g,ht=/\*([^*]+)\*/g,mt=/https?:\/\/[^\s)]+/g;function gt(t){return t.replace(ft,"$1").replace(ht,"$1").replace(mt,e=>{try{return new URL(e).hostname}catch{return e}})}const xt={"bottom-right":"bottom-24 right-3 sm:right-6","bottom-left":"bottom-24 left-3 sm:left-6","top-right":"top-24 right-3 sm:right-6","top-left":"top-24 left-3 sm:left-6"};function bt({messages:t,isLoading:e,isStreaming:r=!1,streamingMessageId:s=null,error:n,canRetry:o=!1,onSend:i,onStop:l,onRetry:c,onClose:d,title:h="Chat",subtitle:p="Ask me anything",welcomeMessage:N="Hi! How can I help you today?",placeholder:E,position:T="bottom-right",translations:y,isMobile:w=!1}){const C=u.useId(),v=u.useRef(null),x=u.useRef(null),[S,I]=u.useState(null);dt(v,!0);const{offsetY:B}=ut(x,d,w),_=B!==0,b=typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia("(prefers-reduced-motion: reduce)").matches:!1;u.useEffect(()=>{const m=x.current;m&&(m.scrollTop=m.scrollHeight)},[t,e]),u.useEffect(()=>{const m=G=>{G.key==="Escape"&&!G.isComposing&&d()};return document.addEventListener("keydown",m),()=>document.removeEventListener("keydown",m)},[d]);const U=(y==null?void 0:y.closeChat)??"Close chat",D=(y==null?void 0:y.chatMessages)??"Chat messages",O=[...t].reverse().find(m=>m.role==="assistant");return a.jsxs("div",{ref:v,role:"dialog","aria-modal":w?"true":void 0,"aria-labelledby":C,className:w?"claudius-bottom-sheet fixed inset-x-0 bottom-0 z-50 flex h-[90vh] w-full flex-col overflow-hidden rounded-t-claudius-lg bg-claudius-surface shadow-claudius-elevated font-body":`fixed ${xt[T]} z-50 flex h-[min(500px,calc(100vh-7rem))] w-[calc(100vw-1.5rem)] max-w-[380px] sm:max-w-[400px] md:max-w-[440px] flex-col overflow-hidden rounded-claudius-lg bg-claudius-surface shadow-claudius-elevated font-body`,style:w&&!b?{transform:`translateY(${Math.max(0,B)}px)`}:void 0,"data-dragging":_||void 0,children:[w&&a.jsx("div",{className:"flex justify-center py-2","aria-hidden":"true",children:a.jsx("div",{className:"h-1 w-8 rounded-claudius-full bg-claudius-border"})}),a.jsx(at,{title:h,subtitle:p,titleId:C,closeLabel:U,onClose:d}),a.jsxs("div",{className:"relative flex-1 overflow-hidden",children:[S&&a.jsx(ot,{sources:S.sources,onClose:()=>I(null)}),a.jsxs("div",{ref:x,role:"log","aria-label":D,className:"h-full space-y-3 overflow-y-auto px-4 py-4",children:[t.length===0&&!n&&a.jsx("div",{className:"mr-auto flex max-w-[85%]",children:a.jsx("div",{className:"rounded-claudius-bubble rounded-bl-claudius-tail bg-claudius-assistant-bubble px-4 py-2.5 text-sm leading-relaxed text-claudius-assistant-bubble-text",children:N})}),t.map(m=>a.jsx(Qe,{role:m.role,content:m.content,isStreaming:m.id===s,sources:m.sources,isSourceActive:(S==null?void 0:S.messageId)===m.id,onSourceClick:()=>{(S==null?void 0:S.messageId)===m.id?I(null):m.sources&&m.sources.length>0&&I({messageId:m.id,sources:m.sources})}},m.id)),e&&!(s!==null&&t.some(m=>m.id===s))&&a.jsx(ct,{label:(y==null?void 0:y.typingIndicator)??"Assistant is typing"}),n&&a.jsx(it,{message:n,retryLabel:(y==null?void 0:y.errorRetry)??"Retry",onRetry:o&&c&&!e?c:void 0})]})]}),a.jsx("div",{"data-claudius-live":"assistant","aria-live":"polite","aria-atomic":"true",className:"sr-only",children:O&&O.id!==s?gt(O.content):""}),a.jsx(tt,{onSend:i,isLoading:e,isStreaming:r,onStop:l,placeholder:E,translations:y})]})}function pt({message:t,position:e,onOpen:r,onDismiss:s,dismissLabel:n}){const o=e.startsWith("bottom"),i=e.endsWith("right"),l=["claudius-greeting-bubble","fixed z-40 max-w-xs",o?"bottom-20":"top-20",i?"right-4":"left-4"].join(" ");return a.jsxs("div",{className:l,role:"status","aria-live":"polite",children:[a.jsx("button",{type:"button",onClick:r,className:"block w-full rounded-claudius-lg bg-claudius-surface p-4 pr-8 text-left text-sm font-body text-claudius-text shadow-claudius-floating ring-1 ring-claudius-border transition hover:shadow-claudius-floating-hover focus:outline-none focus:ring-2 focus:ring-claudius-accent",children:t}),a.jsx("button",{type:"button",onClick:c=>{c.stopPropagation(),s()},"aria-label":n,className:"absolute right-1 top-1 flex h-6 w-6 items-center justify-center rounded-claudius-full text-claudius-text-muted hover:bg-claudius-surface-muted focus:outline-none focus:ring-2 focus:ring-claudius-accent",children:a.jsx("span",{"aria-hidden":"true",children:"×"})})]})}const be={title:"Chat",subtitle:"Ask me anything",welcomeMessage:"Hi! How can I help you today?",closeChat:"Close chat",chatMessages:"Chat messages",typingIndicator:"Assistant is typing",placeholder:"Type your message...",sendMessage:"Send message",stopGenerating:"Stop generating",typeYourMessage:"Type your message",openChat:"Open chat",dismissGreeting:"Dismiss greeting",errorGeneric:"Something went wrong. Please try again.",errorConnection:"Failed to connect. Please try again.",errorTimeout:"Request timed out. Please try again.",errorRateLimitMinute:"Too many requests. Please wait a minute.",errorRateLimitHour:"Hourly limit reached. Please try again later.",errorRetry:"Retry"},pe=be;function yt(t){return{...pe,...t}}const wt={title:"Chat",subtitle:"Pregúntame lo que quieras",welcomeMessage:"¡Hola! ¿En qué puedo ayudarte hoy?",closeChat:"Cerrar chat",chatMessages:"Mensajes del chat",typingIndicator:"El asistente está escribiendo",placeholder:"Escribe tu mensaje...",sendMessage:"Enviar mensaje",stopGenerating:"Detener la respuesta",typeYourMessage:"Escribe tu mensaje",openChat:"Abrir chat",dismissGreeting:"Descartar saludo",errorGeneric:"Algo salió mal. Inténtalo de nuevo.",errorConnection:"No se pudo conectar. Inténtalo de nuevo.",errorTimeout:"La solicitud tardó demasiado. Inténtalo de nuevo.",errorRateLimitMinute:"Demasiadas solicitudes. Espera un minuto.",errorRateLimitHour:"Has alcanzado el límite por hora. Inténtalo más tarde.",errorRetry:"Reintentar"},vt={title:"Chat",subtitle:"Posez-moi vos questions",welcomeMessage:"Bonjour ! Comment puis-je vous aider aujourd'hui ?",closeChat:"Fermer le chat",chatMessages:"Messages du chat",typingIndicator:"L'assistant écrit",placeholder:"Saisissez votre message...",sendMessage:"Envoyer le message",stopGenerating:"Arrêter la génération",typeYourMessage:"Saisissez votre message",openChat:"Ouvrir le chat",dismissGreeting:"Ignorer le message d'accueil",errorGeneric:"Une erreur s'est produite. Veuillez réessayer.",errorConnection:"Échec de la connexion. Veuillez réessayer.",errorTimeout:"La requête a expiré. Veuillez réessayer.",errorRateLimitMinute:"Trop de requêtes. Veuillez patienter une minute.",errorRateLimitHour:"Limite horaire atteinte. Veuillez réessayer plus tard.",errorRetry:"Réessayer"},Rt={title:"Chat",subtitle:"Fragen Sie mich alles",welcomeMessage:"Hallo! Wie kann ich Ihnen heute helfen?",closeChat:"Chat schließen",chatMessages:"Chat-Nachrichten",typingIndicator:"Der Assistent schreibt",placeholder:"Geben Sie Ihre Nachricht ein...",sendMessage:"Nachricht senden",stopGenerating:"Generierung stoppen",typeYourMessage:"Geben Sie Ihre Nachricht ein",openChat:"Chat öffnen",dismissGreeting:"Begrüßung schließen",errorGeneric:"Etwas ist schiefgelaufen. Bitte versuchen Sie es erneut.",errorConnection:"Verbindung fehlgeschlagen. Bitte versuchen Sie es erneut.",errorTimeout:"Zeitüberschreitung der Anfrage. Bitte versuchen Sie es erneut.",errorRateLimitMinute:"Zu viele Anfragen. Bitte warten Sie eine Minute.",errorRateLimitHour:"Stündliches Limit erreicht. Bitte versuchen Sie es später erneut.",errorRetry:"Erneut versuchen"},oe={en:be,es:wt,fr:vt,de:Rt};function fe(t){if(!t)return;const e=t.toLowerCase().split("-")[0];return Object.prototype.hasOwnProperty.call(oe,e)?e:void 0}function ye(){const t=typeof document<"u"?fe(document.documentElement.lang):void 0;if(t)return t;const e=typeof navigator<"u"?fe(navigator.language):void 0;return e||"en"}function we(t={}){const{locale:e,translations:r}=t,s=oe[e??ye()];return r?{...s,...r}:{...s}}const he=["accent","accentText","accentSoft","accentTextMuted","surface","surfaceMuted","text","textMuted","border","userBubble","userBubbleText","assistantBubble","assistantBubbleText","field","error","errorSurface","errorText","link","scrim"],Et=["sm","md","lg","full","tail"],Tt=["elevated","floating","floatingHover"],jt=["heading","body"],ae={default:{name:"default"},minimal:{name:"minimal",colors:{accent:"#171717",accentText:"#ffffff",surface:"#ffffff",surfaceMuted:"#f5f5f5",text:"#171717",textMuted:"#737373",border:"#e5e5e5",link:"#171717"},colorsDark:{accent:"#fafafa",accentText:"#171717",surface:"#0a0a0a",surfaceMuted:"#1c1c1c",text:"#fafafa",textMuted:"#a3a3a3",border:"#2e2e2e",field:"#1c1c1c",link:"#fafafa"},radii:{sm:"4px",md:"6px",lg:"10px"},shadows:{elevated:"0 4px 16px rgb(0 0 0 / 0.12)",floating:"0 2px 8px rgb(0 0 0 / 0.12)",floatingHover:"0 4px 12px rgb(0 0 0 / 0.16)"}},playful:{name:"playful",colors:{accent:"#8b5cf6",surfaceMuted:"#f5f3ff",assistantBubbleText:"#4c1d95",link:"#7c3aed"},colorsDark:{accent:"#a78bfa",surfaceMuted:"#2e1065",assistantBubbleText:"#ede9fe",link:"#c4b5fd"},radii:{sm:"12px",md:"16px",lg:"24px",tail:"8px"},shadows:{elevated:"0 24px 48px -12px rgb(139 92 246 / 0.35)",floating:"0 10px 20px -5px rgb(139 92 246 / 0.4)",floatingHover:"0 16px 28px -6px rgb(139 92 246 / 0.5)"},fonts:{heading:"ui-rounded, 'Hiragino Maru Gothic ProN', system-ui",body:"ui-rounded, 'Hiragino Maru Gothic ProN', system-ui"}},corporate:{name:"corporate",colors:{accent:"#1e3a5f",surfaceMuted:"#f3f4f6",text:"#1f2937",textMuted:"#6b7280",border:"#d1d5db",link:"#1d4ed8"},colorsDark:{accent:"#2c5282",link:"#93c5fd"},radii:{sm:"4px",md:"6px",lg:"8px",tail:"2px"},shadows:{elevated:"0 8px 24px rgb(15 23 42 / 0.16)",floating:"0 4px 12px rgb(15 23 42 / 0.18)",floatingHover:"0 6px 16px rgb(15 23 42 / 0.24)"},fonts:{heading:"'Segoe UI', 'Helvetica Neue', Arial, system-ui",body:"'Segoe UI', 'Helvetica Neue', Arial, system-ui"}}};function St(t){return Object.prototype.hasOwnProperty.call(ae,t)}const Ct=new Set(["light","dark","auto"]);function Mt(t){if(t===void 0)return{mode:"light"};if(typeof t=="string"){if(Ct.has(t))return{mode:t};if(St(t)){const e=ae[t];return{mode:e.colorScheme??"light",theme:e}}return{mode:"light",url:t}}return{mode:t.colorScheme??"light",theme:t}}function kt(t){return t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`)}function Nt(t,e){console.warn(`[Claudius] Ignoring unknown theme token "${e}" in "${t}"`)}function V(t,e,r,s,n,o=""){if(n)for(const[i,l]of Object.entries(n)){if(!s.includes(i)){Nt(e,i);continue}typeof l=="string"&&(t[`${r}${kt(i)}${o}`]=l)}}function Lt(t){const e={};V(e,"colors","--cl-color-",he,t.colors);for(const[r,s]of Object.entries({...e}))e[`${r}-dark`]=s;return V(e,"colorsDark","--cl-color-",he,t.colorsDark,"-dark"),V(e,"radii","--cl-radius-",Et,t.radii),V(e,"shadows","--cl-shadow-",Tt,t.shadows),V(e,"fonts","--cl-font-",jt,t.fonts),e}function At(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}function Ot(t){const e=u.useMemo(()=>Mt(t),[t]),[r,s]=u.useState(null),n=e.url;u.useEffect(()=>{if(s(null),!n)return;const c=new AbortController;return fetch(n,{signal:c.signal}).then(d=>{if(!d.ok)throw new Error(`HTTP ${d.status}`);return d.json()}).then(d=>{if(!At(d))throw new Error("theme JSON must be an object");s(d)}).catch(d=>{c.signal.aborted||console.error(`[Claudius] Failed to load theme from ${n}:`,d)}),()=>c.abort()},[n]);const o=e.theme??r??null,i=(r==null?void 0:r.colorScheme)??e.mode,l=u.useMemo(()=>o?Lt(o):{},[o]);return{mode:i,cssVars:l}}const ve="claudius:triggers:dismissed";function It(){if(typeof window>"u")return!1;try{return window.sessionStorage.getItem(ve)==="1"}catch{return!1}}function Dt(){if(!(typeof window>"u"))try{window.sessionStorage.setItem(ve,"1")}catch{}}function _t({apiUrl:t,title:e,subtitle:r,welcomeMessage:s,placeholder:n,persistMessages:o,storageKeyPrefix:i,requestTimeoutMs:l,theme:c="light",accentColor:d,position:h="bottom-right",locale:p,translations:N,triggers:E,plugins:T,streaming:y=!0}){const[w,C]=u.useState(!1),[v,x]=u.useState(null),[S,I]=u.useState(It),B=u.useRef(!1),_=Pe("(max-width: 639px)"),b=u.useMemo(()=>we({locale:p,translations:N}),[p,N]),{messages:U,isLoading:D,isStreaming:O,streamingMessageId:m,error:G,canRetry:K,sendMessage:F,stop:ee,retry:te}=He({apiUrl:t,persistMessages:o,storageKeyPrefix:i,timeoutMs:l,translations:b,plugins:T,streaming:y}),q=u.useRef(null),J=u.useRef(w),{mode:f,cssVars:M}=Ot(c),[k,W]=u.useState(!1);u.useEffect(()=>{if(f!=="auto")return;const P=window.matchMedia("(prefers-color-scheme: dark)");W(P.matches);const ce=je=>W(je.matches);return P.addEventListener("change",ce),()=>P.removeEventListener("change",ce)},[f]),u.useEffect(()=>{var P;J.current&&!w&&((P=q.current)==null||P.focus()),J.current=w},[w]);const g=u.useCallback(()=>{I(!0),Dt()},[]),R=u.useCallback(()=>{C(!1),B.current&&(B.current=!1,g())},[g]),L=u.useCallback(()=>{C(P=>!P)},[]),j=u.useCallback(()=>{B.current=!0,x(null),C(!0)},[]),$=u.useCallback(P=>{x(P)},[]),H=u.useCallback(()=>{x(null),j()},[j]),Y=u.useCallback(()=>{x(null),g()},[g]);$e({triggers:E,enabled:!S&&!w,onOpen:j,onGreeting:$});const ie=f==="dark"||f==="auto"&&k,X={...M,...d?{"--cl-color-accent":d,"--cl-color-accent-dark":d}:{}},Te=Object.keys(X).length>0?X:void 0;return a.jsx("div",{className:"claudius-root",style:Te,children:a.jsxs("div",{"data-claudius-dark":ie?"true":"false",children:[w&&_&&a.jsx("div",{className:"claudius-scrim fixed inset-0 z-40 bg-claudius-scrim",onClick:R,"aria-hidden":"true"}),w&&a.jsx(bt,{messages:U,isLoading:D,isStreaming:O,streamingMessageId:m,error:G,canRetry:K,onSend:F,onStop:ee,onRetry:te,onClose:R,title:e??b.title,subtitle:r??b.subtitle,welcomeMessage:s??b.welcomeMessage,placeholder:n??b.placeholder,position:h,translations:b,isMobile:_}),!(w&&_)&&a.jsx(Ue,{ref:q,isOpen:w,onClick:L,position:h,translations:b}),!w&&v&&a.jsx(pt,{message:v,position:h,onOpen:H,onDismiss:Y,dismissLabel:b.dismissGreeting})]})})}function Ht(t){const{onEvent:e,includeContent:r=!0}=t,s=n=>r?n:"";return{name:"analytics",onBeforeSend(n){e({type:"message_sent",role:"user",content:s(n.content),chars:n.content.length})},onAfterReceive(n){e({type:"message_received",role:"assistant",content:s(n.content),chars:n.content.length})},onError(n){e({type:"chat_error",message:n.message,code:n.code})}}}const Re=[/\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b/g,/\b\d{3}-\d{2}-\d{4}\b/g,/\b(?:\d[ -]?){13,16}\b/g,/\b(?:\+?1[-.\s]?)?\(?\d{3}\)?[-.\s]?\d{3}[-.\s]?\d{4}\b/g];function Ee(t,e,r){return e.reduce((s,n)=>(n.lastIndex=0,s.replace(n,r)),t)}function Pt(t={}){const{patterns:e=Re,replacement:r="[redacted]",redactReplies:s=!1}=t,n=o=>{const i=Ee(o.content,e,r);if(i!==o.content)return{...o,content:i}};return{name:"redact-pii",onBeforeSend:n,onAfterReceive:s?n:void 0}}function Bt(t,e,r){return typeof t=="function"?t(e):t instanceof RegExp?t.test(e):r?e.includes(t):e.toLowerCase().includes(t.toLowerCase())}function $t(t){const{rules:e,caseSensitive:r=!1}=t;return{name:"canned-responses",onBeforeSend(s,n){for(const o of e)if(Bt(o.match,s.content,r)){n.respondWith(o.reply);return}}}}exports.ChatApiClient=me;exports.ChatApiError=A;exports.ChatWidget=_t;exports.DEFAULT_PII_PATTERNS=Re;exports.DebounceError=Q;exports.builtinThemes=ae;exports.createTranslations=yt;exports.defaultTranslations=pe;exports.detectLocale=ye;exports.locales=oe;exports.pluginAnalytics=Ht;exports.pluginCannedResponses=$t;exports.pluginRedactPII=Pt;exports.redactText=Ee;exports.resolveTranslations=we;
|
|
3
|
+
`))!==-1;){const w=o.slice(0,O);o=o.slice(O+2);const h=ke(w);if(h){if(h.event==="chunk"){const E=typeof h.data.text=="string"?h.data.text:"";E&&(i+=E,(R=r.onChunk)==null||R.call(r,E,i))}else if(h.event==="tool"){if(typeof h.data.name=="string"){const E=h.data;u.push(E),(j=r.onToolUse)==null||j.call(r,E,u)}}else if(h.event==="done"){const E=Array.isArray(h.data.toolUses)?h.data.toolUses:u;c={reply:typeof h.data.reply=="string"?h.data.reply:i,sources:h.data.sources,...E.length>0?{toolUses:E}:{}}}else if(h.event==="error")throw new A(typeof h.data.error=="string"?h.data.error:"Something went wrong. Please try again.",0,"STREAM_ERROR")}}}}finally{(x=r.signal)==null||x.removeEventListener("abort",d),s.releaseLock()}if((v=r.signal)!=null&&v.aborted)return{reply:i,aborted:!0,...u.length>0?{toolUses:u}:{}};if(c)return c;throw new A("Connection interrupted. Please try again.",0,"STREAM_ERROR")}async fetchStream(t,r){const s=new AbortController,n=()=>s.abort();r==null||r.addEventListener("abort",n,{once:!0});let o=!1;const i=this.timeoutMs>0?setTimeout(()=>{o=!0,s.abort()},this.timeoutMs):void 0;try{return await fetch(`${this.baseUrl}/api/chat/stream`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({messages:t}),signal:s.signal})}catch(u){throw o?new A("Request timed out. Please try again.",0,"TIMEOUT"):u}finally{i!==void 0&&clearTimeout(i),r==null||r.removeEventListener("abort",n)}}async fetchWithTimeout(t){if(this.timeoutMs<=0)return fetch(`${this.baseUrl}/api/chat`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({messages:t})});const r=new AbortController,s=setTimeout(()=>r.abort(),this.timeoutMs);try{return await fetch(`${this.baseUrl}/api/chat`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({messages:t}),signal:r.signal})}catch(n){throw r.signal.aborted?new A("Request timed out. Please try again.",0,"TIMEOUT"):n}finally{clearTimeout(s)}}isRetryable(t,r){return r==="TIMEOUT"||r==="NETWORK_ERROR"?!0:t===429||t===503}getRetryDelay(t,r){if(t&&t.status===429){const s=t.headers.get("Retry-After");if(s){const n=Number(s);return Math.min(n*1e3,6e4)}}return r===0?1e3:3e3}delay(t){return new Promise(r=>setTimeout(r,t))}}function ke(e){let t="message";const r=[];for(const s of e.split(`
|
|
4
|
+
`))s.startsWith("event:")?t=s.slice(6).trim():s.startsWith("data:")&&r.push(s.slice(5).trimStart());if(r.length===0)return null;try{const s=JSON.parse(r.join(`
|
|
5
|
+
`));return typeof s!="object"||s===null?null:{event:t,data:s}}catch{return null}}function xe(e){return typeof e=="string"?{content:e}:e}function ae(e,t,r){console.error(`[claudius] plugin "${e.name}" failed in ${t}:`,r)}async function Ne(e,t,r){let s=t;for(const n of e){if(!n.onBeforeSend)continue;let o=null;const i={...r,respondWith(u){o={type:"respond",message:s,reply:xe(u)}},abort(u){o={type:"abort",reason:u}}};try{const u=await n.onBeforeSend(s,i);if(o)return o;u&&(s=u)}catch(u){ae(n,"onBeforeSend",u)}}return{type:"send",message:s}}async function Le(e,t,r){let s=t;for(const n of e)if(n.onAfterReceive)try{const o=await n.onAfterReceive(s,r);o&&(s=o)}catch(o){ae(n,"onAfterReceive",o)}return s}async function Ae(e,t,r){for(const s of e){if(!s.onError)continue;let n=null;const o={...r,respondWith(i){n=xe(i)}};try{if(await s.onError(t,o),n)return n}catch(i){ae(s,"onError",i)}}return null}const Oe=200,Ie="claudius:messages";function De(e,t){let r;try{r=new URL(t).host}catch{r=t}return`${e}:${r}`}function oe(){try{return typeof sessionStorage<"u"?sessionStorage:null}catch{return null}}function _e(e){const t=oe();if(!t)return[];try{const r=t.getItem(e);if(!r)return[];const s=JSON.parse(r);return Array.isArray(s)?s:[]}catch{return[]}}function He({apiUrl:e,persistMessages:t=!0,storageKeyPrefix:r=Ie,timeoutMs:s,translations:n,plugins:o,streaming:i=!0}){const u=l.useMemo(()=>new ge(e,{debounceMs:0,timeoutMs:s}),[e,s]),c=De(r,e),d=t?_e(c):[],[f,y]=l.useState(d),[k,R]=l.useState(!1),[j,x]=l.useState(!1),[v,S]=l.useState(null),[O,w]=l.useState(null),[h,E]=l.useState(!1),U=l.useRef(d.length),$=l.useRef(!1),p=l.useRef(d),F=l.useRef(null),D=l.useRef(o??[]);D.current=o??[];const I=l.useCallback(m=>{if(!t)return;const N=oe();if(N)try{const C=m.slice(-Oe);N.setItem(c,JSON.stringify(C))}catch{}},[t,c]),g=()=>(U.current+=1,`msg-${U.current}`),G=l.useCallback((m,N)=>{if(!n)return N??"Something went wrong. Please try again.";switch(m){case"TIMEOUT":return n.errorTimeout;case"NETWORK_ERROR":return n.errorConnection;case"RATE_LIMITED":return N!=null&&N.includes("minute")?n.errorRateLimitMinute:n.errorRateLimitHour;case"VALIDATION_ERROR":case"CONFIG_ERROR":case"SERVICE_ERROR":case"UNKNOWN_ERROR":default:return N??n.errorGeneric}},[n]),J=l.useCallback(m=>!(m instanceof A)||m.code==="TIMEOUT"||m.code==="NETWORK_ERROR"||m.code==="RATE_LIMITED"||m.code==="SERVICE_ERROR"||m.code==="UNKNOWN_ERROR"||m.status>=500||m.status===0,[]),V=l.useCallback(async m=>{R(!0),$.current=!0,w(null),E(!1);const N=i&&typeof u.streamMessage=="function";let C=null;const W=b=>{if(C===null){C=g(),S(C);const M=[...p.current,{id:C,role:"assistant",content:"",...b}];p.current=M,y(M)}else{const M=C,T=p.current.map(H=>H.id===M?{...H,...b}:H);p.current=T,y(T)}},_=()=>{if(C===null)return;const b=C,M=p.current.filter(T=>T.id!==b);p.current=M,y(M)};try{let b,M,T,H=!1;if(N){const P=new AbortController;F.current=P,x(!0);const z=await u.streamMessage(m,{signal:P.signal,onChunk:(se,L)=>W({content:L}),onToolUse:(se,L)=>W({toolUses:[...L]})});b=z.reply,M=z.sources,T=z.toolUses,H=z.aborted??!1}else{const P=await u.sendMessage(m);b=P.reply,M=P.sources,T=P.toolUses}if(H&&!b){_();return}let B={id:C??g(),role:"assistant",content:b,sources:M,toolUses:T};D.current.length>0&&!H&&(B=await Le(D.current,B,{messages:m,apiUrl:e}));const K=C!==null?p.current.map(P=>P.id===B.id?B:P):[...m,B];p.current=K,y(K),I(K)}catch(b){if(b instanceof ee)return;if(C!==null){I(p.current),b instanceof A?w(G(b.code,b.message)):w((n==null?void 0:n.errorConnection)??"Failed to connect. Please try again."),E(!1);return}if(D.current.length>0){const M=b instanceof Error?b:new Error(String(b)),T=await Ae(D.current,M,{messages:m,apiUrl:e});if(T){const H={id:g(),role:"assistant",content:T.content,sources:T.sources},B=[...m,H];p.current=B,y(B),I(B),w(null),E(!1);return}}b instanceof A?w(G(b.code,b.message)):w((n==null?void 0:n.errorConnection)??"Failed to connect. Please try again."),E(J(b))}finally{R(!1),$.current=!1,x(!1),S(null),F.current=null}},[e,u,G,J,I,i,n]),te=l.useCallback(()=>{var m;(m=F.current)==null||m.abort()},[]),re=l.useCallback(async m=>{const N=m.trim();if(!N||$.current)return;const C={id:g(),role:"user",content:N};let W=C;if(D.current.length>0){const b=await Ne(D.current,C,{messages:p.current,apiUrl:e});if(b.type==="abort")return;if(b.type==="respond"){const M={id:g(),role:"assistant",content:b.reply.content,sources:b.reply.sources},T=[...p.current,b.message,M];p.current=T,y(T),I(T),w(null),E(!1);return}W=b.message}const _=[...p.current,W];p.current=_,y(_),I(_),await V(_)},[e,I,V]),X=l.useCallback(async()=>{if($.current)return;const m=p.current[p.current.length-1];!m||m.role!=="user"||await V(p.current)},[V]),Z=l.useCallback(()=>{if(p.current=[],y([]),w(null),E(!1),t){const m=oe();if(!m)return;try{m.removeItem(c)}catch{}}},[t,c]);return{messages:f,isLoading:k,isStreaming:j,streamingMessageId:v,error:O,canRetry:h,sendMessage:re,stop:te,retry:X,clearMessages:Z}}function Be(e){const[t,r]=l.useState(()=>typeof window>"u"?!1:window.matchMedia(e).matches);return l.useEffect(()=>{const s=window.matchMedia(e);r(s.matches);const n=o=>r(o.matches);return s.addEventListener("change",n),()=>s.removeEventListener("change",n)},[e]),t}function Q(e,t){return e instanceof RegExp?e.test(t):t.toLowerCase().includes(e.toLowerCase())}function Pe(){const e=document.documentElement,t=document.body,r=e.scrollTop||t.scrollTop||0,s=Math.max(e.scrollHeight,t.scrollHeight),n=e.clientHeight||window.innerHeight,o=s-n;return o<=0?100:r/o*100}function $e({triggers:e,enabled:t,onOpen:r,onGreeting:s}){l.useEffect(()=>{if(!t||!e||e.length===0)return;const n=new Set,o=[],i=typeof window<"u"?window.location.href:"",u=(c,d)=>{n.has(c)||(n.add(c),d==="open"?r():s(d.greeting))};return e.forEach((c,d)=>{switch(c.on){case"url":{Q(c.pattern,i)&&u(d,c.action);break}case"time":{if(c.matchUrl&&!Q(c.matchUrl,i))return;const f=window.setTimeout(()=>u(d,c.action),Math.max(0,c.seconds*1e3));o.push(()=>window.clearTimeout(f));break}case"scroll":{if(c.matchUrl&&!Q(c.matchUrl,i))return;const f=()=>{Pe()>=c.percent&&u(d,c.action)};f(),window.addEventListener("scroll",f,{passive:!0}),o.push(()=>window.removeEventListener("scroll",f));break}case"exit-intent":{if(c.matchUrl&&!Q(c.matchUrl,i))return;const f=y=>{y.clientY<=0&&u(d,c.action)};document.addEventListener("mouseleave",f),o.push(()=>document.removeEventListener("mouseleave",f));break}}}),()=>{o.forEach(c=>c())}},[e,t,r,s])}const Ue={"bottom-right":"bottom-6 right-6","bottom-left":"bottom-6 left-6","top-right":"top-6 right-6","top-left":"top-6 left-6"},Ge=l.forwardRef(function({isOpen:t,onClick:r,position:s="bottom-right",translations:n},o){const i=t?(n==null?void 0:n.closeChat)??"Close chat":(n==null?void 0:n.openChat)??"Open chat";return a.jsx("button",{ref:o,onClick:r,"aria-label":i,className:`fixed ${Ue[s]} z-50 flex h-14 w-14 items-center justify-center rounded-claudius-full bg-claudius-accent text-claudius-accent-text shadow-claudius-floating transition-transform hover:scale-105 focus:outline-none focus:ring-2 focus:ring-claudius-accent focus:ring-offset-2`,children:t?a.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),a.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}):a.jsx("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:a.jsx("path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z"})})})}),We=l.memo(function({count:t,isActive:r,onClick:s}){return a.jsxs("button",{onClick:s,"aria-label":"View sources",title:"View sources",className:`group relative flex h-7 w-7 items-center justify-center rounded-claudius-full transition-colors ${r?"bg-claudius-accent text-claudius-accent-text":"text-claudius-text-muted hover:bg-claudius-surface-muted hover:text-claudius-text"}`,children:[a.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("path",{d:"M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z"}),a.jsx("polyline",{points:"14 2 14 8 20 8"}),a.jsx("line",{x1:"16",y1:"13",x2:"8",y2:"13"}),a.jsx("line",{x1:"16",y1:"17",x2:"8",y2:"17"})]}),a.jsx("span",{className:"absolute -right-1 -top-1 flex h-4 min-w-4 items-center justify-center rounded-claudius-full bg-claudius-accent px-1 text-[10px] font-bold text-claudius-accent-text",children:t})]})}),Fe=["http:","https:"];function be(e){if(!e||typeof e!="string")return null;const t=e.trim();if(!t)return null;try{const r=new URL(t);return Fe.includes(r.protocol)?t:null}catch{return null}}function ze(e){const t=e.lastIndexOf(`
|
|
6
|
+
`),r=t===-1?"":e.slice(0,t+1);let s=t===-1?e:e.slice(t+1);return s=Ke(s),s=qe(s),r+s}function Ve(e){const t=[];for(let r=0;r<e.length-1;r++)e[r]==="*"&&e[r+1]==="*"&&(t.push(r),r++);return t}function Ye(e){const t=[];for(let r=0;r<e.length;r++)if(e[r]==="*"){if(e[r+1]==="*"){r++;continue}t.push(r)}return t}function Ke(e){const t=Ve(e);if(t.length%2===0)return e;const r=t[t.length-1],s=e.slice(r+2);return s.trim()===""?e.slice(0,r)+s:e+"**"}function qe(e){const t=Ye(e);if(t.length%2===0)return e;const r=t[t.length-1],s=e.slice(r+1);return s.trim()===""?e.slice(0,r)+s:e+"*"}function Je({toolUse:e,usedLabel:t,detailsLabel:r}){const[s,n]=l.useState(!1),o=e.input!==void 0||e.result!==void 0;return a.jsxs("div",{className:"text-xs text-claudius-text-muted",children:[a.jsxs("button",{type:"button",disabled:!o,onClick:()=>n(i=>!i),"aria-expanded":o?s:void 0,className:"flex items-center gap-1.5 rounded-claudius-full border border-claudius-border bg-claudius-surface px-2 py-0.5 hover:opacity-80 disabled:cursor-default disabled:hover:opacity-100",children:[a.jsx("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:a.jsx("path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z"})}),a.jsxs("span",{children:[t," ",a.jsx("span",{className:"font-mono text-claudius-text",children:e.name}),e.isError&&a.jsx("span",{className:"text-claudius-error",children:" ✕"})]}),o&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"sr-only",children:r}),a.jsx("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",className:s?"rotate-180":void 0,children:a.jsx("polyline",{points:"6 9 12 15 18 9"})})]})]}),s&&o&&a.jsxs("div",{className:"mt-1 overflow-x-auto rounded-claudius-sm border border-claudius-border bg-claudius-field p-2 font-mono",children:[e.input!==void 0&&a.jsx("pre",{className:"whitespace-pre-wrap break-all",children:JSON.stringify(e.input,null,2)}),e.result!==void 0&&a.jsx("pre",{className:"mt-1 whitespace-pre-wrap break-all border-t border-claudius-border pt-1",children:e.result})]})]})}const ue=/(https?:\/\/[^\s)]+)/,de=/(\*\*[^*]+\*\*)/,fe=/(\*[^*]+\*)/;function Xe(e,t){const r=e.match(/[.,;:!?'"]+$/),s=r?e.slice(0,-r[0].length):e,n=r?r[0]:"",o=be(s);return o?a.jsxs(a.Fragment,{children:[a.jsxs("a",{href:o,target:"_blank",rel:"noopener noreferrer",className:"underline font-medium hover:opacity-80 text-claudius-link",children:[o.replace(/^https?:\/\//,""),a.jsx("span",{className:"sr-only",children:" (opens in a new tab)"})]},t),n]}):e}function Ze(e,t){const r=e.split(de),s=[];return r.forEach((n,o)=>{if(de.test(n)){const i=n.slice(2,-2);s.push(a.jsx("strong",{children:i},`${t}-b${o}`))}else n.split(fe).forEach((u,c)=>{if(fe.test(u)){const d=u.slice(1,-1);s.push(a.jsx("em",{children:d},`${t}-b${o}-i${c}`))}else u.split(ue).forEach((f,y)=>{ue.test(f)?s.push(Xe(f,`${t}-b${o}-i${c}-u${y}`)):f&&s.push(f)})})}),s}function Qe(e){const t=e.split(`
|
|
7
|
+
`);return t.map((r,s)=>a.jsxs("span",{children:[Ze(r,`l${s}`),s<t.length-1&&a.jsx("br",{})]},s))}const et=l.memo(function({role:t,content:r,isStreaming:s=!1,sources:n,toolUses:o,toolUsedLabel:i="Used tool:",toolDetailsLabel:u="Tool details",onSourceClick:c,isSourceActive:d}){const f=t==="user",y=s?ze(r):r,k=f||r!==""||!(o!=null&&o.length);return a.jsxs("div",{className:`${f?"ml-auto":"mr-auto"} max-w-[85%]`,children:[k&&a.jsx("div",{className:`rounded-claudius-bubble px-4 py-2.5 text-sm leading-relaxed font-body ${f?"bg-claudius-user-bubble text-claudius-user-bubble-text rounded-br-claudius-tail":"bg-claudius-assistant-bubble text-claudius-assistant-bubble-text rounded-bl-claudius-tail"}`,children:Qe(y)}),!f&&o&&o.length>0&&a.jsx("div",{className:"mt-1 space-y-1",children:o.map((R,j)=>a.jsx(Je,{toolUse:R,usedLabel:i,detailsLabel:u},`${R.name}-${j}`))}),!f&&n&&n.length>0&&c&&a.jsx("div",{className:"mt-1",children:a.jsx(We,{count:n.length,isActive:d??!1,onClick:c})})]})}),ne=2e3,tt=1800;function rt({onSend:e,isLoading:t,isStreaming:r=!1,onStop:s,placeholder:n,translations:o}){const[i,u]=l.useState(""),c=l.useRef(null),d=i.length,f=d>=tt,y=d>=ne,k=n??(o==null?void 0:o.placeholder)??"Type your message...",R=(o==null?void 0:o.sendMessage)??"Send message",j=(o==null?void 0:o.stopGenerating)??"Stop generating",x=(o==null?void 0:o.typeYourMessage)??"Type your message",v=r&&!!s;l.useEffect(()=>{var w;t||(w=c.current)==null||w.focus()},[t]);const S=w=>{w.preventDefault();const h=i.trim();!h||y||(e(h),u(""))},O=w=>{const h=w.target.value;h.length<=ne&&u(h)};return a.jsxs("form",{onSubmit:S,className:"border-t border-claudius-border bg-claudius-surface p-3",children:[a.jsxs("div",{className:"flex gap-2",children:[a.jsx("input",{ref:c,type:"text",value:i,onChange:O,placeholder:k,disabled:t,"aria-label":x,"aria-describedby":f?"char-count":void 0,className:"flex-1 rounded-claudius-sm border border-claudius-border bg-claudius-field px-3 py-2 text-sm font-body text-claudius-text placeholder:text-claudius-text-muted focus:border-claudius-accent focus:outline-none focus:ring-1 focus:ring-claudius-accent disabled:opacity-50"}),v?a.jsx("button",{type:"button",onClick:s,"aria-label":j,className:"flex h-11 w-11 shrink-0 items-center justify-center rounded-claudius-sm bg-claudius-accent text-claudius-accent-text transition-colors hover:opacity-90",children:a.jsx("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true",children:a.jsx("rect",{x:"6",y:"6",width:"12",height:"12",rx:"1.5"})})}):a.jsx("button",{type:"submit",disabled:t||y,"aria-label":R,className:"flex h-11 w-11 shrink-0 items-center justify-center rounded-claudius-sm bg-claudius-accent text-claudius-accent-text transition-colors hover:opacity-90 disabled:opacity-50",children:a.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("line",{x1:"22",y1:"2",x2:"11",y2:"13"}),a.jsx("polygon",{points:"22 2 15 22 11 13 2 9 22 2"})]})})]}),f&&a.jsxs("div",{id:"char-count",className:`mt-1 text-xs text-right ${y?"text-claudius-error":"text-claudius-text-muted"}`,"aria-live":"polite",children:[d,"/",ne]})]})}const st=["blog","page","external"],nt={blog:"Blog",page:"Page",external:"External"};function ot(e){try{return new URL(e).hostname}catch{return e}}const at=l.memo(function({sources:t,onClose:r}){const s=st.map(o=>({type:o,label:nt[o],items:t.filter(i=>i.type===o)})).filter(o=>o.items.length>0),n=t.length===1?"1 source found":`${t.length} sources found`;return a.jsxs("div",{className:"absolute inset-y-0 left-0 z-10 flex w-[280px] flex-col border-r-2 border-claudius-border bg-claudius-surface rounded-r-claudius-lg transition-transform duration-200 ease-out",children:[a.jsxs("div",{className:"flex items-center justify-between border-b border-claudius-border px-4 py-3",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"text-sm font-heading font-semibold text-claudius-text",children:"Sources"}),a.jsx("p",{className:"text-xs text-claudius-text-muted",children:n})]}),a.jsx("button",{onClick:r,"aria-label":"Close sources",className:"flex h-7 w-7 items-center justify-center rounded-claudius-full text-claudius-text-muted transition-colors hover:bg-claudius-surface-muted hover:text-claudius-text",children:a.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),a.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]}),a.jsx("div",{className:"flex-1 overflow-y-auto px-3 py-3 space-y-4",children:s.map(o=>a.jsxs("div",{children:[a.jsx("h4",{className:"mb-2 text-xs font-semibold uppercase tracking-wide text-claudius-text-muted",children:o.label}),a.jsx("div",{className:"space-y-2",children:o.items.map(i=>{const u=be(i.url);return u?a.jsxs("a",{href:u,target:"_blank",rel:"noopener noreferrer",className:"block rounded-claudius-md border-2 border-claudius-border bg-claudius-surface-muted p-3 transition-colors hover:bg-claudius-border",children:[a.jsx("p",{className:"truncate text-sm font-medium text-claudius-text",children:i.title}),a.jsx("p",{className:"mt-0.5 text-xs text-claudius-text-muted",children:ot(u)})]},u):null})})]},o.type))})]})});function it({title:e,subtitle:t,titleId:r,closeLabel:s,onClose:n}){return a.jsxs("div",{className:"flex items-center gap-3 bg-claudius-accent px-5 py-4",children:[a.jsx("div",{"aria-hidden":"true",className:"flex h-8 w-8 items-center justify-center rounded-claudius-full bg-claudius-accent-soft text-sm font-bold text-claudius-accent-text",children:e.charAt(0).toUpperCase()}),a.jsxs("div",{className:"flex-1",children:[a.jsx("h2",{id:r,className:"text-sm font-heading font-semibold text-claudius-accent-text",children:e}),a.jsx("p",{className:"text-xs text-claudius-accent-text",children:t})]}),a.jsx("button",{onClick:n,"aria-label":s,className:"flex h-10 w-10 items-center justify-center rounded-claudius-full text-claudius-accent-text-muted transition-colors hover:bg-claudius-accent-soft hover:text-claudius-accent-text",children:a.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round","aria-hidden":"true",children:[a.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),a.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]})})]})}function ct({message:e,retryLabel:t,onRetry:r}){return a.jsxs("div",{role:"alert",className:"mx-auto flex max-w-[90%] flex-col items-center gap-2 rounded-claudius-sm bg-claudius-error-surface px-3 py-2 text-center text-xs text-claudius-error",children:[a.jsx("span",{children:e}),r&&a.jsx("button",{type:"button",onClick:r,className:"rounded-claudius-md bg-claudius-error px-3 py-1 text-xs font-semibold text-claudius-error-text transition-opacity hover:opacity-90 focus:outline-none focus-visible:ring-2 focus-visible:ring-claudius-error focus-visible:ring-offset-1",children:t})]})}function lt({label:e}){return a.jsx("div",{role:"status","aria-live":"polite","aria-label":e,className:"mr-auto flex max-w-[85%]",children:a.jsxs("div",{className:"flex gap-1 rounded-claudius-bubble rounded-bl-claudius-tail bg-claudius-assistant-bubble px-4 py-3",children:[a.jsx("span",{className:"h-2 w-2 motion-safe:animate-bounce rounded-claudius-full bg-claudius-text-muted [animation-delay:0ms]"}),a.jsx("span",{className:"h-2 w-2 motion-safe:animate-bounce rounded-claudius-full bg-claudius-text-muted [animation-delay:150ms]"}),a.jsx("span",{className:"h-2 w-2 motion-safe:animate-bounce rounded-claudius-full bg-claudius-text-muted [animation-delay:300ms]"})]})})}function ut(e,t,r){const[s,n]=l.useState(0),o=l.useRef(0),i=l.useRef(0),u=l.useRef(0),c=l.useRef(!1);return l.useEffect(()=>{const d=e.current;if(!r||!d)return;const f=R=>{if(d.scrollTop>0){c.current=!1;return}c.current=!0,i.current=R.touches[0].clientY,u.current=Date.now()},y=R=>{if(!c.current)return;let j=R.touches[0].clientY-i.current;j<0&&(j=j*.3),o.current=j,n(j)},k=()=>{if(!c.current)return;c.current=!1;const R=o.current,j=(Date.now()-u.current)/1e3,x=d.getBoundingClientRect().height,v=j>.05&&R>0&&R/j>500,S=R>x*.3;v||S?t():(o.current=0,n(0))};return d.addEventListener("touchstart",f,{passive:!0}),d.addEventListener("touchmove",y,{passive:!0}),d.addEventListener("touchend",k),()=>{d.removeEventListener("touchstart",f),d.removeEventListener("touchmove",y),d.removeEventListener("touchend",k)}},[e,t,r]),{offsetY:s}}const dt='a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';function ft(e,t){l.useEffect(()=>{const r=e.current;if(!r)return;const s=n=>{if(n.key!=="Tab")return;const o=Array.from(r.querySelectorAll(dt)).filter(d=>!d.hasAttribute("aria-hidden"));if(o.length===0)return;const i=o[0],u=o[o.length-1],c=document.activeElement;n.shiftKey&&c===i?(n.preventDefault(),u.focus()):!n.shiftKey&&c===u&&(n.preventDefault(),i.focus())};return r.addEventListener("keydown",s),()=>r.removeEventListener("keydown",s)},[e,t])}const ht=/\*\*([^*]+)\*\*/g,mt=/\*([^*]+)\*/g,gt=/https?:\/\/[^\s)]+/g;function xt(e){return e.replace(ht,"$1").replace(mt,"$1").replace(gt,t=>{try{return new URL(t).hostname}catch{return t}})}const bt={"bottom-right":"bottom-24 right-3 sm:right-6","bottom-left":"bottom-24 left-3 sm:left-6","top-right":"top-24 right-3 sm:right-6","top-left":"top-24 left-3 sm:left-6"};function pt({messages:e,isLoading:t,isStreaming:r=!1,streamingMessageId:s=null,error:n,canRetry:o=!1,onSend:i,onStop:u,onRetry:c,onClose:d,title:f="Chat",subtitle:y="Ask me anything",welcomeMessage:k="Hi! How can I help you today?",placeholder:R,position:j="bottom-right",translations:x,isMobile:v=!1}){const S=l.useId(),O=l.useRef(null),w=l.useRef(null),[h,E]=l.useState(null);ft(O,!0);const{offsetY:U}=ut(w,d,v),$=U!==0,p=typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia("(prefers-reduced-motion: reduce)").matches:!1;l.useEffect(()=>{const g=w.current;g&&(g.scrollTop=g.scrollHeight)},[e,t]),l.useEffect(()=>{const g=G=>{G.key==="Escape"&&!G.isComposing&&d()};return document.addEventListener("keydown",g),()=>document.removeEventListener("keydown",g)},[d]);const F=(x==null?void 0:x.closeChat)??"Close chat",D=(x==null?void 0:x.chatMessages)??"Chat messages",I=[...e].reverse().find(g=>g.role==="assistant");return a.jsxs("div",{ref:O,role:"dialog","aria-modal":v?"true":void 0,"aria-labelledby":S,className:v?"claudius-bottom-sheet fixed inset-x-0 bottom-0 z-50 flex h-[90vh] w-full flex-col overflow-hidden rounded-t-claudius-lg bg-claudius-surface shadow-claudius-elevated font-body":`fixed ${bt[j]} z-50 flex h-[min(500px,calc(100vh-7rem))] w-[calc(100vw-1.5rem)] max-w-[380px] sm:max-w-[400px] md:max-w-[440px] flex-col overflow-hidden rounded-claudius-lg bg-claudius-surface shadow-claudius-elevated font-body`,style:v&&!p?{transform:`translateY(${Math.max(0,U)}px)`}:void 0,"data-dragging":$||void 0,children:[v&&a.jsx("div",{className:"flex justify-center py-2","aria-hidden":"true",children:a.jsx("div",{className:"h-1 w-8 rounded-claudius-full bg-claudius-border"})}),a.jsx(it,{title:f,subtitle:y,titleId:S,closeLabel:F,onClose:d}),a.jsxs("div",{className:"relative flex-1 overflow-hidden",children:[h&&a.jsx(at,{sources:h.sources,onClose:()=>E(null)}),a.jsxs("div",{ref:w,role:"log","aria-label":D,className:"h-full space-y-3 overflow-y-auto px-4 py-4",children:[e.length===0&&!n&&a.jsx("div",{className:"mr-auto flex max-w-[85%]",children:a.jsx("div",{className:"rounded-claudius-bubble rounded-bl-claudius-tail bg-claudius-assistant-bubble px-4 py-2.5 text-sm leading-relaxed text-claudius-assistant-bubble-text",children:k})}),e.map(g=>a.jsx(et,{role:g.role,content:g.content,isStreaming:g.id===s,sources:g.sources,toolUses:g.toolUses,toolUsedLabel:x==null?void 0:x.toolUsed,toolDetailsLabel:x==null?void 0:x.toolDetails,isSourceActive:(h==null?void 0:h.messageId)===g.id,onSourceClick:()=>{(h==null?void 0:h.messageId)===g.id?E(null):g.sources&&g.sources.length>0&&E({messageId:g.id,sources:g.sources})}},g.id)),t&&!(s!==null&&e.some(g=>g.id===s&&g.content.length>0))&&a.jsx(lt,{label:(x==null?void 0:x.typingIndicator)??"Assistant is typing"}),n&&a.jsx(ct,{message:n,retryLabel:(x==null?void 0:x.errorRetry)??"Retry",onRetry:o&&c&&!t?c:void 0})]})]}),a.jsx("div",{"data-claudius-live":"assistant","aria-live":"polite","aria-atomic":"true",className:"sr-only",children:I&&I.id!==s?xt(I.content):""}),a.jsx(rt,{onSend:i,isLoading:t,isStreaming:r,onStop:u,placeholder:R,translations:x})]})}function yt({message:e,position:t,onOpen:r,onDismiss:s,dismissLabel:n}){const o=t.startsWith("bottom"),i=t.endsWith("right"),u=["claudius-greeting-bubble","fixed z-40 max-w-xs",o?"bottom-20":"top-20",i?"right-4":"left-4"].join(" ");return a.jsxs("div",{className:u,role:"status","aria-live":"polite",children:[a.jsx("button",{type:"button",onClick:r,className:"block w-full rounded-claudius-lg bg-claudius-surface p-4 pr-8 text-left text-sm font-body text-claudius-text shadow-claudius-floating ring-1 ring-claudius-border transition hover:shadow-claudius-floating-hover focus:outline-none focus:ring-2 focus:ring-claudius-accent",children:e}),a.jsx("button",{type:"button",onClick:c=>{c.stopPropagation(),s()},"aria-label":n,className:"absolute right-1 top-1 flex h-6 w-6 items-center justify-center rounded-claudius-full text-claudius-text-muted hover:bg-claudius-surface-muted focus:outline-none focus:ring-2 focus:ring-claudius-accent",children:a.jsx("span",{"aria-hidden":"true",children:"×"})})]})}const pe={title:"Chat",subtitle:"Ask me anything",welcomeMessage:"Hi! How can I help you today?",closeChat:"Close chat",chatMessages:"Chat messages",typingIndicator:"Assistant is typing",placeholder:"Type your message...",sendMessage:"Send message",stopGenerating:"Stop generating",toolUsed:"Used tool:",toolDetails:"Tool details",typeYourMessage:"Type your message",openChat:"Open chat",dismissGreeting:"Dismiss greeting",errorGeneric:"Something went wrong. Please try again.",errorConnection:"Failed to connect. Please try again.",errorTimeout:"Request timed out. Please try again.",errorRateLimitMinute:"Too many requests. Please wait a minute.",errorRateLimitHour:"Hourly limit reached. Please try again later.",errorRetry:"Retry"},ye=pe;function wt(e){return{...ye,...e}}const vt={title:"Chat",subtitle:"Pregúntame lo que quieras",welcomeMessage:"¡Hola! ¿En qué puedo ayudarte hoy?",closeChat:"Cerrar chat",chatMessages:"Mensajes del chat",typingIndicator:"El asistente está escribiendo",placeholder:"Escribe tu mensaje...",sendMessage:"Enviar mensaje",stopGenerating:"Detener la respuesta",toolUsed:"Herramienta usada:",toolDetails:"Detalles de la herramienta",typeYourMessage:"Escribe tu mensaje",openChat:"Abrir chat",dismissGreeting:"Descartar saludo",errorGeneric:"Algo salió mal. Inténtalo de nuevo.",errorConnection:"No se pudo conectar. Inténtalo de nuevo.",errorTimeout:"La solicitud tardó demasiado. Inténtalo de nuevo.",errorRateLimitMinute:"Demasiadas solicitudes. Espera un minuto.",errorRateLimitHour:"Has alcanzado el límite por hora. Inténtalo más tarde.",errorRetry:"Reintentar"},Rt={title:"Chat",subtitle:"Posez-moi vos questions",welcomeMessage:"Bonjour ! Comment puis-je vous aider aujourd'hui ?",closeChat:"Fermer le chat",chatMessages:"Messages du chat",typingIndicator:"L'assistant écrit",placeholder:"Saisissez votre message...",sendMessage:"Envoyer le message",stopGenerating:"Arrêter la génération",toolUsed:"Outil utilisé :",toolDetails:"Détails de l'outil",typeYourMessage:"Saisissez votre message",openChat:"Ouvrir le chat",dismissGreeting:"Ignorer le message d'accueil",errorGeneric:"Une erreur s'est produite. Veuillez réessayer.",errorConnection:"Échec de la connexion. Veuillez réessayer.",errorTimeout:"La requête a expiré. Veuillez réessayer.",errorRateLimitMinute:"Trop de requêtes. Veuillez patienter une minute.",errorRateLimitHour:"Limite horaire atteinte. Veuillez réessayer plus tard.",errorRetry:"Réessayer"},Et={title:"Chat",subtitle:"Fragen Sie mich alles",welcomeMessage:"Hallo! Wie kann ich Ihnen heute helfen?",closeChat:"Chat schließen",chatMessages:"Chat-Nachrichten",typingIndicator:"Der Assistent schreibt",placeholder:"Geben Sie Ihre Nachricht ein...",sendMessage:"Nachricht senden",stopGenerating:"Generierung stoppen",toolUsed:"Verwendetes Tool:",toolDetails:"Tool-Details",typeYourMessage:"Geben Sie Ihre Nachricht ein",openChat:"Chat öffnen",dismissGreeting:"Begrüßung schließen",errorGeneric:"Etwas ist schiefgelaufen. Bitte versuchen Sie es erneut.",errorConnection:"Verbindung fehlgeschlagen. Bitte versuchen Sie es erneut.",errorTimeout:"Zeitüberschreitung der Anfrage. Bitte versuchen Sie es erneut.",errorRateLimitMinute:"Zu viele Anfragen. Bitte warten Sie eine Minute.",errorRateLimitHour:"Stündliches Limit erreicht. Bitte versuchen Sie es später erneut.",errorRetry:"Erneut versuchen"},ie={en:pe,es:vt,fr:Rt,de:Et};function he(e){if(!e)return;const t=e.toLowerCase().split("-")[0];return Object.prototype.hasOwnProperty.call(ie,t)?t:void 0}function we(){const e=typeof document<"u"?he(document.documentElement.lang):void 0;if(e)return e;const t=typeof navigator<"u"?he(navigator.language):void 0;return t||"en"}function ve(e={}){const{locale:t,translations:r}=e,s=ie[t??we()];return r?{...s,...r}:{...s}}const me=["accent","accentText","accentSoft","accentTextMuted","surface","surfaceMuted","text","textMuted","border","userBubble","userBubbleText","assistantBubble","assistantBubbleText","field","error","errorSurface","errorText","link","scrim"],jt=["sm","md","lg","full","tail"],Tt=["elevated","floating","floatingHover"],St=["heading","body"],ce={default:{name:"default"},minimal:{name:"minimal",colors:{accent:"#171717",accentText:"#ffffff",surface:"#ffffff",surfaceMuted:"#f5f5f5",text:"#171717",textMuted:"#737373",border:"#e5e5e5",link:"#171717"},colorsDark:{accent:"#fafafa",accentText:"#171717",surface:"#0a0a0a",surfaceMuted:"#1c1c1c",text:"#fafafa",textMuted:"#a3a3a3",border:"#2e2e2e",field:"#1c1c1c",link:"#fafafa"},radii:{sm:"4px",md:"6px",lg:"10px"},shadows:{elevated:"0 4px 16px rgb(0 0 0 / 0.12)",floating:"0 2px 8px rgb(0 0 0 / 0.12)",floatingHover:"0 4px 12px rgb(0 0 0 / 0.16)"}},playful:{name:"playful",colors:{accent:"#8b5cf6",surfaceMuted:"#f5f3ff",assistantBubbleText:"#4c1d95",link:"#7c3aed"},colorsDark:{accent:"#a78bfa",surfaceMuted:"#2e1065",assistantBubbleText:"#ede9fe",link:"#c4b5fd"},radii:{sm:"12px",md:"16px",lg:"24px",tail:"8px"},shadows:{elevated:"0 24px 48px -12px rgb(139 92 246 / 0.35)",floating:"0 10px 20px -5px rgb(139 92 246 / 0.4)",floatingHover:"0 16px 28px -6px rgb(139 92 246 / 0.5)"},fonts:{heading:"ui-rounded, 'Hiragino Maru Gothic ProN', system-ui",body:"ui-rounded, 'Hiragino Maru Gothic ProN', system-ui"}},corporate:{name:"corporate",colors:{accent:"#1e3a5f",surfaceMuted:"#f3f4f6",text:"#1f2937",textMuted:"#6b7280",border:"#d1d5db",link:"#1d4ed8"},colorsDark:{accent:"#2c5282",link:"#93c5fd"},radii:{sm:"4px",md:"6px",lg:"8px",tail:"2px"},shadows:{elevated:"0 8px 24px rgb(15 23 42 / 0.16)",floating:"0 4px 12px rgb(15 23 42 / 0.18)",floatingHover:"0 6px 16px rgb(15 23 42 / 0.24)"},fonts:{heading:"'Segoe UI', 'Helvetica Neue', Arial, system-ui",body:"'Segoe UI', 'Helvetica Neue', Arial, system-ui"}}};function Ct(e){return Object.prototype.hasOwnProperty.call(ce,e)}const Mt=new Set(["light","dark","auto"]);function kt(e){if(e===void 0)return{mode:"light"};if(typeof e=="string"){if(Mt.has(e))return{mode:e};if(Ct(e)){const t=ce[e];return{mode:t.colorScheme??"light",theme:t}}return{mode:"light",url:e}}return{mode:e.colorScheme??"light",theme:e}}function Nt(e){return e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function Lt(e,t){console.warn(`[Claudius] Ignoring unknown theme token "${t}" in "${e}"`)}function q(e,t,r,s,n,o=""){if(n)for(const[i,u]of Object.entries(n)){if(!s.includes(i)){Lt(t,i);continue}typeof u=="string"&&(e[`${r}${Nt(i)}${o}`]=u)}}function At(e){const t={};q(t,"colors","--cl-color-",me,e.colors);for(const[r,s]of Object.entries({...t}))t[`${r}-dark`]=s;return q(t,"colorsDark","--cl-color-",me,e.colorsDark,"-dark"),q(t,"radii","--cl-radius-",jt,e.radii),q(t,"shadows","--cl-shadow-",Tt,e.shadows),q(t,"fonts","--cl-font-",St,e.fonts),t}function Ot(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function It(e){const t=l.useMemo(()=>kt(e),[e]),[r,s]=l.useState(null),n=t.url;l.useEffect(()=>{if(s(null),!n)return;const c=new AbortController;return fetch(n,{signal:c.signal}).then(d=>{if(!d.ok)throw new Error(`HTTP ${d.status}`);return d.json()}).then(d=>{if(!Ot(d))throw new Error("theme JSON must be an object");s(d)}).catch(d=>{c.signal.aborted||console.error(`[Claudius] Failed to load theme from ${n}:`,d)}),()=>c.abort()},[n]);const o=t.theme??r??null,i=(r==null?void 0:r.colorScheme)??t.mode,u=l.useMemo(()=>o?At(o):{},[o]);return{mode:i,cssVars:u}}const Re="claudius:triggers:dismissed";function Dt(){if(typeof window>"u")return!1;try{return window.sessionStorage.getItem(Re)==="1"}catch{return!1}}function _t(){if(!(typeof window>"u"))try{window.sessionStorage.setItem(Re,"1")}catch{}}function Ht({apiUrl:e,title:t,subtitle:r,welcomeMessage:s,placeholder:n,persistMessages:o,storageKeyPrefix:i,requestTimeoutMs:u,theme:c="light",accentColor:d,position:f="bottom-right",locale:y,translations:k,triggers:R,plugins:j,streaming:x=!0}){const[v,S]=l.useState(!1),[O,w]=l.useState(null),[h,E]=l.useState(Dt),U=l.useRef(!1),$=Be("(max-width: 639px)"),p=l.useMemo(()=>ve({locale:y,translations:k}),[y,k]),{messages:F,isLoading:D,isStreaming:I,streamingMessageId:g,error:G,canRetry:J,sendMessage:V,stop:te,retry:re}=He({apiUrl:e,persistMessages:o,storageKeyPrefix:i,timeoutMs:u,translations:p,plugins:j,streaming:x}),X=l.useRef(null),Z=l.useRef(v),{mode:m,cssVars:N}=It(c),[C,W]=l.useState(!1);l.useEffect(()=>{if(m!=="auto")return;const L=window.matchMedia("(prefers-color-scheme: dark)");W(L.matches);const le=Te=>W(Te.matches);return L.addEventListener("change",le),()=>L.removeEventListener("change",le)},[m]),l.useEffect(()=>{var L;Z.current&&!v&&((L=X.current)==null||L.focus()),Z.current=v},[v]);const _=l.useCallback(()=>{E(!0),_t()},[]),b=l.useCallback(()=>{S(!1),U.current&&(U.current=!1,_())},[_]),M=l.useCallback(()=>{S(L=>!L)},[]),T=l.useCallback(()=>{U.current=!0,w(null),S(!0)},[]),H=l.useCallback(L=>{w(L)},[]),B=l.useCallback(()=>{w(null),T()},[T]),K=l.useCallback(()=>{w(null),_()},[_]);$e({triggers:R,enabled:!h&&!v,onOpen:T,onGreeting:H});const P=m==="dark"||m==="auto"&&C,z={...N,...d?{"--cl-color-accent":d,"--cl-color-accent-dark":d}:{}},se=Object.keys(z).length>0?z:void 0;return a.jsx("div",{className:"claudius-root",style:se,children:a.jsxs("div",{"data-claudius-dark":P?"true":"false",children:[v&&$&&a.jsx("div",{className:"claudius-scrim fixed inset-0 z-40 bg-claudius-scrim",onClick:b,"aria-hidden":"true"}),v&&a.jsx(pt,{messages:F,isLoading:D,isStreaming:I,streamingMessageId:g,error:G,canRetry:J,onSend:V,onStop:te,onRetry:re,onClose:b,title:t??p.title,subtitle:r??p.subtitle,welcomeMessage:s??p.welcomeMessage,placeholder:n??p.placeholder,position:f,translations:p,isMobile:$}),!(v&&$)&&a.jsx(Ge,{ref:X,isOpen:v,onClick:M,position:f,translations:p}),!v&&O&&a.jsx(yt,{message:O,position:f,onOpen:B,onDismiss:K,dismissLabel:p.dismissGreeting})]})})}function Bt(e){const{onEvent:t,includeContent:r=!0}=e,s=n=>r?n:"";return{name:"analytics",onBeforeSend(n){t({type:"message_sent",role:"user",content:s(n.content),chars:n.content.length})},onAfterReceive(n){t({type:"message_received",role:"assistant",content:s(n.content),chars:n.content.length})},onError(n){t({type:"chat_error",message:n.message,code:n.code})}}}const Ee=[/\b[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}\b/g,/\b\d{3}-\d{2}-\d{4}\b/g,/\b(?:\d[ -]?){13,16}\b/g,/\b(?:\+?1[-.\s]?)?\(?\d{3}\)?[-.\s]?\d{3}[-.\s]?\d{4}\b/g];function je(e,t,r){return t.reduce((s,n)=>(n.lastIndex=0,s.replace(n,r)),e)}function Pt(e={}){const{patterns:t=Ee,replacement:r="[redacted]",redactReplies:s=!1}=e,n=o=>{const i=je(o.content,t,r);if(i!==o.content)return{...o,content:i}};return{name:"redact-pii",onBeforeSend:n,onAfterReceive:s?n:void 0}}function $t(e,t,r){return typeof e=="function"?e(t):e instanceof RegExp?e.test(t):r?t.includes(e):t.toLowerCase().includes(e.toLowerCase())}function Ut(e){const{rules:t,caseSensitive:r=!1}=e;return{name:"canned-responses",onBeforeSend(s,n){for(const o of t)if($t(o.match,s.content,r)){n.respondWith(o.reply);return}}}}exports.ChatApiClient=ge;exports.ChatApiError=A;exports.ChatWidget=Ht;exports.DEFAULT_PII_PATTERNS=Ee;exports.DebounceError=ee;exports.builtinThemes=ce;exports.createTranslations=wt;exports.defaultTranslations=ye;exports.detectLocale=we;exports.locales=ie;exports.pluginAnalytics=Bt;exports.pluginCannedResponses=Ut;exports.pluginRedactPII=Pt;exports.redactText=je;exports.resolveTranslations=ve;
|
package/dist/claudius.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.\!container{width:100%!important}.container{width:100%}@media(min-width:640px){.\!container{max-width:640px!important}.container{max-width:640px}}@media(min-width:768px){.\!container{max-width:768px!important}.container{max-width:768px}}@media(min-width:1024px){.\!container{max-width:1024px!important}.container{max-width:1024px}}@media(min-width:1280px){.\!container{max-width:1280px!important}.container{max-width:1280px}}@media(min-width:1536px){.\!container{max-width:1536px!important}.container{max-width:1536px}}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.visible{visibility:visible}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{top:0;right:0;bottom:0;left:0}.inset-x-0{left:0;right:0}.inset-y-0{top:0;bottom:0}.-right-1{right:-.25rem}.-top-1{top:-.25rem}.bottom-0{bottom:0}.bottom-20{bottom:5rem}.bottom-24{bottom:6rem}.bottom-6{bottom:1.5rem}.left-0{left:0}.left-3{left:.75rem}.left-4{left:1rem}.left-6{left:1.5rem}.right-1{right:.25rem}.right-3{right:.75rem}.right-4{right:1rem}.right-6{right:1.5rem}.top-1{top:.25rem}.top-20{top:5rem}.top-24{top:6rem}.top-6{top:1.5rem}.z-10{z-index:10}.z-40{z-index:40}.z-50{z-index:50}.mx-auto{margin-left:auto;margin-right:auto}.mb-2{margin-bottom:.5rem}.ml-auto{margin-left:auto}.mr-auto{margin-right:auto}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.block{display:block}.inline{display:inline}.flex{display:flex}.hidden{display:none}.h-1{height:.25rem}.h-10{height:2.5rem}.h-11{height:2.75rem}.h-14{height:3.5rem}.h-2{height:.5rem}.h-4{height:1rem}.h-6{height:1.5rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-\[90vh\]{height:90vh}.h-\[min\(500px\,calc\(100vh-7rem\)\)\]{height:min(500px,calc(100vh - 7rem))}.h-full{height:100%}.w-10{width:2.5rem}.w-11{width:2.75rem}.w-14{width:3.5rem}.w-2{width:.5rem}.w-6{width:1.5rem}.w-7{width:1.75rem}.w-8{width:2rem}.w-\[280px\]{width:280px}.w-\[calc\(100vw-1\.5rem\)\]{width:calc(100vw - 1.5rem)}.w-full{width:100%}.min-w-4{min-width:1rem}.max-w-\[380px\]{max-width:380px}.max-w-\[85\%\]{max-width:85%}.max-w-\[90\%\]{max-width:90%}.max-w-xs{max-width:20rem}.flex-1{flex:1 1 0%}.shrink-0{flex-shrink:0}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.rounded{border-radius:.25rem}.rounded-claudius-bubble{border-radius:var(--claudius-radius-bubble, var(--cl-radius-lg, 16px))}.rounded-claudius-full{border-radius:var(--cl-radius-full, 9999px)}.rounded-claudius-lg{border-radius:var(--claudius-radius-card, var(--cl-radius-lg, 16px))}.rounded-claudius-md{border-radius:var(--claudius-radius-button, var(--cl-radius-md, 12px))}.rounded-claudius-sm{border-radius:var(--cl-radius-sm, 8px)}.rounded-r-claudius-lg{border-top-right-radius:var(--claudius-radius-card, var(--cl-radius-lg, 16px));border-bottom-right-radius:var(--claudius-radius-card, var(--cl-radius-lg, 16px))}.rounded-t-claudius-lg{border-top-left-radius:var(--claudius-radius-card, var(--cl-radius-lg, 16px));border-top-right-radius:var(--claudius-radius-card, var(--cl-radius-lg, 16px))}.rounded-bl-claudius-tail{border-bottom-left-radius:var(--cl-radius-tail, 2px)}.rounded-br-claudius-tail{border-bottom-right-radius:var(--cl-radius-tail, 2px)}.border{border-width:1px}.border-2{border-width:2px}.border-b{border-bottom-width:1px}.border-r-2{border-right-width:2px}.border-t{border-top-width:1px}.border-claudius-border{border-color:var(--claudius-border, var(--cl-color-border, #e2e8f0))}.bg-claudius-accent{background-color:var(--claudius-primary, var(--cl-color-accent, #2563eb))}.bg-claudius-accent-soft{background-color:var(--cl-color-accent-soft, rgb(255 255 255 / .2))}.bg-claudius-assistant-bubble{background-color:var(--claudius-assistant-bg, var(--cl-color-assistant-bubble, var(--cl-color-surface-muted, #f1f5f9)))}.bg-claudius-border{background-color:var(--claudius-border, var(--cl-color-border, #e2e8f0))}.bg-claudius-error{background-color:var(--claudius-error, var(--cl-color-error, #dc2626))}.bg-claudius-error-surface{background-color:var(--claudius-error-bg, var(--cl-color-error-surface, #fef2f2))}.bg-claudius-field{background-color:var(--cl-color-field, #ffffff)}.bg-claudius-scrim{background-color:var(--cl-color-scrim, rgb(0 0 0 / .5))}.bg-claudius-surface{background-color:var(--cl-color-surface, #ffffff)}.bg-claudius-surface-muted{background-color:var(--claudius-light, var(--cl-color-surface-muted, #f1f5f9))}.bg-claudius-text-muted{background-color:var(--claudius-gray, var(--cl-color-text-muted, #64748b))}.bg-claudius-user-bubble{background-color:var(--claudius-user-bg, var(--cl-color-user-bubble, var(--cl-color-accent, #2563eb)))}.p-3{padding:.75rem}.p-4{padding:1rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.pr-8{padding-right:2rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.font-body{font-family:var(--claudius-font-body, var(--cl-font-body, system-ui)),sans-serif}.font-heading{font-family:var(--claudius-font-heading, var(--cl-font-heading, system-ui)),sans-serif}.text-\[10px\]{font-size:10px}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.italic{font-style:italic}.leading-relaxed{line-height:1.625}.tracking-wide{letter-spacing:.025em}.text-claudius-accent-text{color:var(--cl-color-accent-text, #ffffff)}.text-claudius-accent-text-muted{color:var(--cl-color-accent-text-muted, rgb(255 255 255 / .7))}.text-claudius-assistant-bubble-text{color:var(--claudius-assistant-text, var(--cl-color-assistant-bubble-text, var(--cl-color-text, #1e293b)))}.text-claudius-error{color:var(--claudius-error, var(--cl-color-error, #dc2626))}.text-claudius-error-text{color:var(--cl-color-error-text, #ffffff)}.text-claudius-link{color:var(--cl-color-link, currentColor)}.text-claudius-text{color:var(--claudius-dark, var(--cl-color-text, #1e293b))}.text-claudius-text-muted{color:var(--claudius-gray, var(--cl-color-text-muted, #64748b))}.text-claudius-user-bubble-text{color:var(--claudius-user-text, var(--cl-color-user-bubble-text, #ffffff))}.underline{text-decoration-line:underline}.shadow-claudius-elevated{--tw-shadow: var(--cl-shadow-elevated, 0 25px 50px -12px rgb(0 0 0 / .25));--tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-claudius-floating{--tw-shadow: var(--cl-shadow-floating, 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1));--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.ring-1{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-claudius-border{--tw-ring-color: var(--claudius-border, var(--cl-color-border, #e2e8f0))}.sepia{--tw-sepia: sepia(100%);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-200{transition-duration:.2s}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}.\[animation-delay\:0ms\]{animation-delay:0ms}.\[animation-delay\:150ms\]{animation-delay:.15s}.\[animation-delay\:300ms\]{animation-delay:.3s}[data-claudius-dark=true]{--cl-color-accent: var(--cl-color-accent-dark, #2563eb);--cl-color-accent-text: var(--cl-color-accent-text-dark, #ffffff);--cl-color-accent-soft: var( --cl-color-accent-soft-dark, rgb(255 255 255 / .2) );--cl-color-accent-text-muted: var( --cl-color-accent-text-muted-dark, rgb(255 255 255 / .7) );--cl-color-surface: var(--cl-color-surface-dark, #111827);--cl-color-surface-muted: var(--cl-color-surface-muted-dark, #1f2937);--cl-color-text: var(--cl-color-text-dark, #f3f4f6);--cl-color-text-muted: var(--cl-color-text-muted-dark, #9ca3af);--cl-color-border: var(--cl-color-border-dark, #374151);--cl-color-user-bubble: var( --cl-color-user-bubble-dark, var(--cl-color-accent) );--cl-color-user-bubble-text: var(--cl-color-user-bubble-text-dark, #ffffff);--cl-color-assistant-bubble: var( --cl-color-assistant-bubble-dark, var(--cl-color-surface-muted) );--cl-color-assistant-bubble-text: var( --cl-color-assistant-bubble-text-dark, #e5e7eb );--cl-color-field: var(--cl-color-field-dark, #1f2937);--cl-color-error: var(--cl-color-error-dark, #f87171);--cl-color-error-surface: var( --cl-color-error-surface-dark, rgb(127 29 29 / .3) );--cl-color-error-text: var(--cl-color-error-text-dark, #ffffff);--cl-color-link: var(--cl-color-link-dark, #60a5fa);--cl-color-scrim: var(--cl-color-scrim-dark, rgb(0 0 0 / .5))}.claudius-bottom-sheet{transition:transform .3s cubic-bezier(.32,.72,0,1)}.claudius-bottom-sheet[data-dragging=true]{transition:none}.claudius-scrim{transition:opacity .3s ease}@media(prefers-reduced-motion:reduce){.claudius-bottom-sheet{transition:opacity .2s ease;transform:none!important}.claudius-scrim{transition:opacity .15s ease}}.placeholder\:text-claudius-text-muted::-moz-placeholder{color:var(--claudius-gray, var(--cl-color-text-muted, #64748b))}.placeholder\:text-claudius-text-muted::placeholder{color:var(--claudius-gray, var(--cl-color-text-muted, #64748b))}.hover\:scale-105:hover{--tw-scale-x: 1.05;--tw-scale-y: 1.05;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:bg-claudius-accent-soft:hover{background-color:var(--cl-color-accent-soft, rgb(255 255 255 / .2))}.hover\:bg-claudius-border:hover{background-color:var(--claudius-border, var(--cl-color-border, #e2e8f0))}.hover\:bg-claudius-surface-muted:hover{background-color:var(--claudius-light, var(--cl-color-surface-muted, #f1f5f9))}.hover\:text-claudius-accent-text:hover{color:var(--cl-color-accent-text, #ffffff)}.hover\:text-claudius-text:hover{color:var(--claudius-dark, var(--cl-color-text, #1e293b))}.hover\:opacity-80:hover{opacity:.8}.hover\:opacity-90:hover{opacity:.9}.hover\:shadow-claudius-floating-hover:hover{--tw-shadow: var(--cl-shadow-floating-hover, 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1));--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.focus\:border-claudius-accent:focus{border-color:var(--claudius-primary, var(--cl-color-accent, #2563eb))}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-1:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-claudius-accent:focus{--tw-ring-color: var(--claudius-primary, var(--cl-color-accent, #2563eb))}.focus\:ring-offset-2:focus{--tw-ring-offset-width: 2px}.focus-visible\:ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-claudius-error:focus-visible{--tw-ring-color: var(--claudius-error, var(--cl-color-error, #dc2626))}.focus-visible\:ring-offset-1:focus-visible{--tw-ring-offset-width: 1px}.disabled\:opacity-50:disabled{opacity:.5}@media(prefers-reduced-motion:no-preference){@keyframes bounce{0%,to{transform:translateY(-25%);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:none;animation-timing-function:cubic-bezier(0,0,.2,1)}}.motion-safe\:animate-bounce{animation:bounce 1s infinite}}@media(min-width:640px){.sm\:left-6{left:1.5rem}.sm\:right-6{right:1.5rem}.sm\:max-w-\[400px\]{max-width:400px}}@media(min-width:768px){.md\:max-w-\[440px\]{max-width:440px}}
|
|
1
|
+
*,:before,:after{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }::backdrop{--tw-border-spacing-x: 0;--tw-border-spacing-y: 0;--tw-translate-x: 0;--tw-translate-y: 0;--tw-rotate: 0;--tw-skew-x: 0;--tw-skew-y: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness: proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-color: rgb(59 130 246 / .5);--tw-ring-offset-shadow: 0 0 #0000;--tw-ring-shadow: 0 0 #0000;--tw-shadow: 0 0 #0000;--tw-shadow-colored: 0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: ;--tw-contain-size: ;--tw-contain-layout: ;--tw-contain-paint: ;--tw-contain-style: }*,:before,:after{box-sizing:border-box;border-width:0;border-style:solid;border-color:#e5e7eb}:before,:after{--tw-content: ""}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-feature-settings:normal;font-variation-settings:normal;-webkit-tap-highlight-color:transparent}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-feature-settings:normal;font-variation-settings:normal;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;letter-spacing:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}button,input:where([type=button]),input:where([type=reset]),input:where([type=submit]){-webkit-appearance:button;background-color:transparent;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:baseline}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dl,dd,h1,h2,h3,h4,h5,h6,hr,figure,p,pre{margin:0}fieldset{margin:0;padding:0}legend{padding:0}ol,ul,menu{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}button,[role=button]{cursor:pointer}:disabled{cursor:default}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]:where(:not([hidden=until-found])){display:none}.\!container{width:100%!important}.container{width:100%}@media(min-width:640px){.\!container{max-width:640px!important}.container{max-width:640px}}@media(min-width:768px){.\!container{max-width:768px!important}.container{max-width:768px}}@media(min-width:1024px){.\!container{max-width:1024px!important}.container{max-width:1024px}}@media(min-width:1280px){.\!container{max-width:1280px!important}.container{max-width:1280px}}@media(min-width:1536px){.\!container{max-width:1536px!important}.container{max-width:1536px}}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.visible{visibility:visible}.static{position:static}.fixed{position:fixed}.absolute{position:absolute}.relative{position:relative}.inset-0{top:0;right:0;bottom:0;left:0}.inset-x-0{left:0;right:0}.inset-y-0{top:0;bottom:0}.-right-1{right:-.25rem}.-top-1{top:-.25rem}.bottom-0{bottom:0}.bottom-20{bottom:5rem}.bottom-24{bottom:6rem}.bottom-6{bottom:1.5rem}.left-0{left:0}.left-3{left:.75rem}.left-4{left:1rem}.left-6{left:1.5rem}.right-1{right:.25rem}.right-3{right:.75rem}.right-4{right:1rem}.right-6{right:1.5rem}.top-1{top:.25rem}.top-20{top:5rem}.top-24{top:6rem}.top-6{top:1.5rem}.z-10{z-index:10}.z-40{z-index:40}.z-50{z-index:50}.mx-auto{margin-left:auto;margin-right:auto}.mb-2{margin-bottom:.5rem}.ml-auto{margin-left:auto}.mr-auto{margin-right:auto}.mt-0\.5{margin-top:.125rem}.mt-1{margin-top:.25rem}.block{display:block}.inline{display:inline}.flex{display:flex}.hidden{display:none}.h-1{height:.25rem}.h-10{height:2.5rem}.h-11{height:2.75rem}.h-14{height:3.5rem}.h-2{height:.5rem}.h-4{height:1rem}.h-6{height:1.5rem}.h-7{height:1.75rem}.h-8{height:2rem}.h-\[90vh\]{height:90vh}.h-\[min\(500px\,calc\(100vh-7rem\)\)\]{height:min(500px,calc(100vh - 7rem))}.h-full{height:100%}.w-10{width:2.5rem}.w-11{width:2.75rem}.w-14{width:3.5rem}.w-2{width:.5rem}.w-6{width:1.5rem}.w-7{width:1.75rem}.w-8{width:2rem}.w-\[280px\]{width:280px}.w-\[calc\(100vw-1\.5rem\)\]{width:calc(100vw - 1.5rem)}.w-full{width:100%}.min-w-4{min-width:1rem}.max-w-\[380px\]{max-width:380px}.max-w-\[85\%\]{max-width:85%}.max-w-\[90\%\]{max-width:90%}.max-w-xs{max-width:20rem}.flex-1{flex:1 1 0%}.shrink-0{flex-shrink:0}.rotate-180{--tw-rotate: 180deg;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.transform{transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-center{justify-content:center}.justify-between{justify-content:space-between}.gap-1{gap:.25rem}.gap-1\.5{gap:.375rem}.gap-2{gap:.5rem}.gap-3{gap:.75rem}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.25rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem * var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.5rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem * var(--tw-space-y-reverse))}.space-y-3>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(.75rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.75rem * var(--tw-space-y-reverse))}.space-y-4>:not([hidden])~:not([hidden]){--tw-space-y-reverse: 0;margin-top:calc(1rem * calc(1 - var(--tw-space-y-reverse)));margin-bottom:calc(1rem * var(--tw-space-y-reverse))}.overflow-hidden{overflow:hidden}.overflow-x-auto{overflow-x:auto}.overflow-y-auto{overflow-y:auto}.truncate{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.whitespace-pre-wrap{white-space:pre-wrap}.break-all{word-break:break-all}.rounded{border-radius:.25rem}.rounded-claudius-bubble{border-radius:var(--claudius-radius-bubble, var(--cl-radius-lg, 16px))}.rounded-claudius-full{border-radius:var(--cl-radius-full, 9999px)}.rounded-claudius-lg{border-radius:var(--claudius-radius-card, var(--cl-radius-lg, 16px))}.rounded-claudius-md{border-radius:var(--claudius-radius-button, var(--cl-radius-md, 12px))}.rounded-claudius-sm{border-radius:var(--cl-radius-sm, 8px)}.rounded-r-claudius-lg{border-top-right-radius:var(--claudius-radius-card, var(--cl-radius-lg, 16px));border-bottom-right-radius:var(--claudius-radius-card, var(--cl-radius-lg, 16px))}.rounded-t-claudius-lg{border-top-left-radius:var(--claudius-radius-card, var(--cl-radius-lg, 16px));border-top-right-radius:var(--claudius-radius-card, var(--cl-radius-lg, 16px))}.rounded-bl-claudius-tail{border-bottom-left-radius:var(--cl-radius-tail, 2px)}.rounded-br-claudius-tail{border-bottom-right-radius:var(--cl-radius-tail, 2px)}.border{border-width:1px}.border-2{border-width:2px}.border-b{border-bottom-width:1px}.border-r-2{border-right-width:2px}.border-t{border-top-width:1px}.border-claudius-border{border-color:var(--claudius-border, var(--cl-color-border, #e2e8f0))}.bg-claudius-accent{background-color:var(--claudius-primary, var(--cl-color-accent, #2563eb))}.bg-claudius-accent-soft{background-color:var(--cl-color-accent-soft, rgb(255 255 255 / .2))}.bg-claudius-assistant-bubble{background-color:var(--claudius-assistant-bg, var(--cl-color-assistant-bubble, var(--cl-color-surface-muted, #f1f5f9)))}.bg-claudius-border{background-color:var(--claudius-border, var(--cl-color-border, #e2e8f0))}.bg-claudius-error{background-color:var(--claudius-error, var(--cl-color-error, #dc2626))}.bg-claudius-error-surface{background-color:var(--claudius-error-bg, var(--cl-color-error-surface, #fef2f2))}.bg-claudius-field{background-color:var(--cl-color-field, #ffffff)}.bg-claudius-scrim{background-color:var(--cl-color-scrim, rgb(0 0 0 / .5))}.bg-claudius-surface{background-color:var(--cl-color-surface, #ffffff)}.bg-claudius-surface-muted{background-color:var(--claudius-light, var(--cl-color-surface-muted, #f1f5f9))}.bg-claudius-text-muted{background-color:var(--claudius-gray, var(--cl-color-text-muted, #64748b))}.bg-claudius-user-bubble{background-color:var(--claudius-user-bg, var(--cl-color-user-bubble, var(--cl-color-accent, #2563eb)))}.p-2{padding:.5rem}.p-3{padding:.75rem}.p-4{padding:1rem}.px-1{padding-left:.25rem;padding-right:.25rem}.px-2{padding-left:.5rem;padding-right:.5rem}.px-3{padding-left:.75rem;padding-right:.75rem}.px-4{padding-left:1rem;padding-right:1rem}.px-5{padding-left:1.25rem;padding-right:1.25rem}.py-0\.5{padding-top:.125rem;padding-bottom:.125rem}.py-1{padding-top:.25rem;padding-bottom:.25rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.py-2\.5{padding-top:.625rem;padding-bottom:.625rem}.py-3{padding-top:.75rem;padding-bottom:.75rem}.py-4{padding-top:1rem;padding-bottom:1rem}.pr-8{padding-right:2rem}.pt-1{padding-top:.25rem}.text-left{text-align:left}.text-center{text-align:center}.text-right{text-align:right}.font-body{font-family:var(--claudius-font-body, var(--cl-font-body, system-ui)),sans-serif}.font-heading{font-family:var(--claudius-font-heading, var(--cl-font-heading, system-ui)),sans-serif}.font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.text-\[10px\]{font-size:10px}.text-sm{font-size:.875rem;line-height:1.25rem}.text-xs{font-size:.75rem;line-height:1rem}.font-bold{font-weight:700}.font-medium{font-weight:500}.font-semibold{font-weight:600}.uppercase{text-transform:uppercase}.italic{font-style:italic}.leading-relaxed{line-height:1.625}.tracking-wide{letter-spacing:.025em}.text-claudius-accent-text{color:var(--cl-color-accent-text, #ffffff)}.text-claudius-accent-text-muted{color:var(--cl-color-accent-text-muted, rgb(255 255 255 / .7))}.text-claudius-assistant-bubble-text{color:var(--claudius-assistant-text, var(--cl-color-assistant-bubble-text, var(--cl-color-text, #1e293b)))}.text-claudius-error{color:var(--claudius-error, var(--cl-color-error, #dc2626))}.text-claudius-error-text{color:var(--cl-color-error-text, #ffffff)}.text-claudius-link{color:var(--cl-color-link, currentColor)}.text-claudius-text{color:var(--claudius-dark, var(--cl-color-text, #1e293b))}.text-claudius-text-muted{color:var(--claudius-gray, var(--cl-color-text-muted, #64748b))}.text-claudius-user-bubble-text{color:var(--claudius-user-text, var(--cl-color-user-bubble-text, #ffffff))}.underline{text-decoration-line:underline}.shadow-claudius-elevated{--tw-shadow: var(--cl-shadow-elevated, 0 25px 50px -12px rgb(0 0 0 / .25));--tw-shadow-colored: 0 25px 50px -12px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.shadow-claudius-floating{--tw-shadow: var(--cl-shadow-floating, 0 10px 15px -3px rgb(0 0 0 / .1), 0 4px 6px -4px rgb(0 0 0 / .1));--tw-shadow-colored: 0 10px 15px -3px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.ring-1{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.ring-claudius-border{--tw-ring-color: var(--claudius-border, var(--cl-color-border, #e2e8f0))}.sepia{--tw-sepia: sepia(100%);filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.filter{filter:var(--tw-blur) var(--tw-brightness) var(--tw-contrast) var(--tw-grayscale) var(--tw-hue-rotate) var(--tw-invert) var(--tw-saturate) var(--tw-sepia) var(--tw-drop-shadow)}.transition{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-opacity{transition-property:opacity;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.transition-transform{transition-property:transform;transition-timing-function:cubic-bezier(.4,0,.2,1);transition-duration:.15s}.duration-200{transition-duration:.2s}.ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}.\[animation-delay\:0ms\]{animation-delay:0ms}.\[animation-delay\:150ms\]{animation-delay:.15s}.\[animation-delay\:300ms\]{animation-delay:.3s}[data-claudius-dark=true]{--cl-color-accent: var(--cl-color-accent-dark, #2563eb);--cl-color-accent-text: var(--cl-color-accent-text-dark, #ffffff);--cl-color-accent-soft: var( --cl-color-accent-soft-dark, rgb(255 255 255 / .2) );--cl-color-accent-text-muted: var( --cl-color-accent-text-muted-dark, rgb(255 255 255 / .7) );--cl-color-surface: var(--cl-color-surface-dark, #111827);--cl-color-surface-muted: var(--cl-color-surface-muted-dark, #1f2937);--cl-color-text: var(--cl-color-text-dark, #f3f4f6);--cl-color-text-muted: var(--cl-color-text-muted-dark, #9ca3af);--cl-color-border: var(--cl-color-border-dark, #374151);--cl-color-user-bubble: var( --cl-color-user-bubble-dark, var(--cl-color-accent) );--cl-color-user-bubble-text: var(--cl-color-user-bubble-text-dark, #ffffff);--cl-color-assistant-bubble: var( --cl-color-assistant-bubble-dark, var(--cl-color-surface-muted) );--cl-color-assistant-bubble-text: var( --cl-color-assistant-bubble-text-dark, #e5e7eb );--cl-color-field: var(--cl-color-field-dark, #1f2937);--cl-color-error: var(--cl-color-error-dark, #f87171);--cl-color-error-surface: var( --cl-color-error-surface-dark, rgb(127 29 29 / .3) );--cl-color-error-text: var(--cl-color-error-text-dark, #ffffff);--cl-color-link: var(--cl-color-link-dark, #60a5fa);--cl-color-scrim: var(--cl-color-scrim-dark, rgb(0 0 0 / .5))}.claudius-bottom-sheet{transition:transform .3s cubic-bezier(.32,.72,0,1)}.claudius-bottom-sheet[data-dragging=true]{transition:none}.claudius-scrim{transition:opacity .3s ease}@media(prefers-reduced-motion:reduce){.claudius-bottom-sheet{transition:opacity .2s ease;transform:none!important}.claudius-scrim{transition:opacity .15s ease}}.placeholder\:text-claudius-text-muted::-moz-placeholder{color:var(--claudius-gray, var(--cl-color-text-muted, #64748b))}.placeholder\:text-claudius-text-muted::placeholder{color:var(--claudius-gray, var(--cl-color-text-muted, #64748b))}.hover\:scale-105:hover{--tw-scale-x: 1.05;--tw-scale-y: 1.05;transform:translate(var(--tw-translate-x),var(--tw-translate-y)) rotate(var(--tw-rotate)) skew(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y))}.hover\:bg-claudius-accent-soft:hover{background-color:var(--cl-color-accent-soft, rgb(255 255 255 / .2))}.hover\:bg-claudius-border:hover{background-color:var(--claudius-border, var(--cl-color-border, #e2e8f0))}.hover\:bg-claudius-surface-muted:hover{background-color:var(--claudius-light, var(--cl-color-surface-muted, #f1f5f9))}.hover\:text-claudius-accent-text:hover{color:var(--cl-color-accent-text, #ffffff)}.hover\:text-claudius-text:hover{color:var(--claudius-dark, var(--cl-color-text, #1e293b))}.hover\:opacity-80:hover{opacity:.8}.hover\:opacity-90:hover{opacity:.9}.hover\:shadow-claudius-floating-hover:hover{--tw-shadow: var(--cl-shadow-floating-hover, 0 20px 25px -5px rgb(0 0 0 / .1), 0 8px 10px -6px rgb(0 0 0 / .1));--tw-shadow-colored: 0 20px 25px -5px var(--tw-shadow-color);box-shadow:var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)}.focus\:border-claudius-accent:focus{border-color:var(--claudius-primary, var(--cl-color-accent, #2563eb))}.focus\:outline-none:focus{outline:2px solid transparent;outline-offset:2px}.focus\:ring-1:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(1px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-2:focus{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus\:ring-claudius-accent:focus{--tw-ring-color: var(--claudius-primary, var(--cl-color-accent, #2563eb))}.focus\:ring-offset-2:focus{--tw-ring-offset-width: 2px}.focus-visible\:ring-2:focus-visible{--tw-ring-offset-shadow: var(--tw-ring-inset) 0 0 0 var(--tw-ring-offset-width) var(--tw-ring-offset-color);--tw-ring-shadow: var(--tw-ring-inset) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color);box-shadow:var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow, 0 0 #0000)}.focus-visible\:ring-claudius-error:focus-visible{--tw-ring-color: var(--claudius-error, var(--cl-color-error, #dc2626))}.focus-visible\:ring-offset-1:focus-visible{--tw-ring-offset-width: 1px}.disabled\:cursor-default:disabled{cursor:default}.disabled\:opacity-50:disabled{opacity:.5}.disabled\:hover\:opacity-100:hover:disabled{opacity:1}@media(prefers-reduced-motion:no-preference){@keyframes bounce{0%,to{transform:translateY(-25%);animation-timing-function:cubic-bezier(.8,0,1,1)}50%{transform:none;animation-timing-function:cubic-bezier(0,0,.2,1)}}.motion-safe\:animate-bounce{animation:bounce 1s infinite}}@media(min-width:640px){.sm\:left-6{left:1.5rem}.sm\:right-6{right:1.5rem}.sm\:max-w-\[400px\]{max-width:400px}}@media(min-width:768px){.md\:max-w-\[440px\]{max-width:440px}}
|