claudius-chat-widget 1.13.0 → 1.15.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 CHANGED
@@ -1,7 +1,7 @@
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(`
1
+ "use strict";var _e=Object.defineProperty;var Be=(e,t,r)=>t in e?_e(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r;var J=(e,t,r)=>Be(e,typeof t!="symbol"?t+"":t,r);Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const a=require("react/jsx-runtime"),l=require("react");class _ extends Error{constructor(t,r,n,s){super(t),this.status=r,this.code=n,this.retryAfter=s,this.name="ChatApiError"}}class ie extends Error{constructor(){super("Request debounced"),this.name="DebounceError"}}const Pe=3e4;function He(e,t){const r=atob(e),n=new Uint8Array(r.length);for(let s=0;s<r.length;s++)n[s]=r.charCodeAt(s);return new Blob([n],{type:t})}class Ce{constructor(t,r){J(this,"baseUrl");J(this,"maxRetries");J(this,"debounceMs");J(this,"timeoutMs");J(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)??Pe}async sendMessage(t){if(this.debounceMs>0&&Date.now()-this.lastSendTime<this.debounceMs)throw new ie;this.lastSendTime=Date.now();let r;for(let n=0;n<=this.maxRetries;n++)try{const s=await this.fetchWithTimeout(t);if(s.ok)return await s.json();const o=await s.json().catch(()=>({})),i=s.headers.get("Retry-After"),c=i?Number(i):void 0;if(r=new _(o.error??`Request failed with status ${s.status}`,s.status,o.code,c),!this.isRetryable(s.status))throw r;if(n<this.maxRetries){const u=this.getRetryDelay(s,n);await this.delay(u)}}catch(s){if(s instanceof _){if(!this.isRetryable(s.status,s.code))throw s;if(r=s,n<this.maxRetries){const o=this.getRetryDelay(null,n);await this.delay(o)}}else if(r=new _("Failed to connect. Please try again.",0,"NETWORK_ERROR"),n<this.maxRetries){const o=this.getRetryDelay(null,n);await this.delay(o)}}throw r}buildRequest(t){if(!t.some(o=>{var i;return(i=o.attachments)==null?void 0:i.some(c=>!!c.data)}))return{headers:{"Content-Type":"application/json"},body:JSON.stringify({messages:t})};const n=new FormData,s=t.map(o=>o.attachments?{...o,attachments:o.attachments.map(i=>{const c={...i};return delete c.data,c})}:o);n.append("payload",JSON.stringify({messages:s}));for(const o of t)for(const i of o.attachments??[])i.data&&n.append(i.id,He(i.data,i.mediaType),i.name);return{body:n}}async streamMessage(t,r={}){var s;if(typeof ReadableStream>"u")return this.sendMessage(t);if(this.debounceMs>0&&Date.now()-this.lastSendTime<this.debounceMs)throw new ie;this.lastSendTime=Date.now();let n;for(let o=0;o<=this.maxRetries;o++){let i;try{i=await this.fetchStream(t,r.signal)}catch(u){if((s=r.signal)!=null&&s.aborted)return{reply:"",aborted:!0};if(n=u instanceof _?u:new _("Failed to connect. Please try again.",0,"NETWORK_ERROR"),!this.isRetryable(n.status,n.code))throw n;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 u=await i.json().catch(()=>({})),d=i.headers.get("Retry-After");if(n=new _(u.error??`Request failed with status ${i.status}`,i.status,u.code,d?Number(d):void 0),!this.isRetryable(i.status))throw n;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 n}async readSseStream(t,r){var p,b,D,E,C,m,k;const n=t.getReader(),s=new TextDecoder;let o="",i="";const c=[];let u;const d=()=>{n.cancel().catch(()=>{})};(p=r.signal)==null||p.addEventListener("abort",d,{once:!0});try{for(;;){let T;try{T=await n.read()}catch(A){if((b=r.signal)!=null&&b.aborted)break;throw A}if((D=r.signal)!=null&&D.aborted||T.done)break;o+=s.decode(T.value,{stream:!0});let S;for(;(S=o.indexOf(`
2
2
 
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;
3
+ `))!==-1;){const A=o.slice(0,S);o=o.slice(S+2);const v=$e(A);if(v){if(v.event==="chunk"){const y=typeof v.data.text=="string"?v.data.text:"";y&&(i+=y,(E=r.onChunk)==null||E.call(r,y,i))}else if(v.event==="tool"){if(typeof v.data.name=="string"){const y=v.data;c.push(y),(C=r.onToolUse)==null||C.call(r,y,c)}}else if(v.event==="done"){const y=Array.isArray(v.data.toolUses)?v.data.toolUses:c;u={reply:typeof v.data.reply=="string"?v.data.reply:i,sources:v.data.sources,...y.length>0?{toolUses:y}:{},...Array.isArray(v.data.attachments)?{attachments:v.data.attachments}:{}}}else if(v.event==="error")throw new _(typeof v.data.error=="string"?v.data.error:"Something went wrong. Please try again.",0,"STREAM_ERROR")}}}}finally{(m=r.signal)==null||m.removeEventListener("abort",d),n.releaseLock()}if((k=r.signal)!=null&&k.aborted)return{reply:i,aborted:!0,...c.length>0?{toolUses:c}:{}};if(u)return u;throw new _("Connection interrupted. Please try again.",0,"STREAM_ERROR")}async fetchStream(t,r){const n=new AbortController,s=()=>n.abort();r==null||r.addEventListener("abort",s,{once:!0});let o=!1;const i=this.timeoutMs>0?setTimeout(()=>{o=!0,n.abort()},this.timeoutMs):void 0,{headers:c,body:u}=this.buildRequest(t);try{return await fetch(`${this.baseUrl}/api/chat/stream`,{method:"POST",headers:c,body:u,signal:n.signal})}catch(d){throw o?new _("Request timed out. Please try again.",0,"TIMEOUT"):d}finally{i!==void 0&&clearTimeout(i),r==null||r.removeEventListener("abort",s)}}async fetchWithTimeout(t){const{headers:r,body:n}=this.buildRequest(t);if(this.timeoutMs<=0)return fetch(`${this.baseUrl}/api/chat`,{method:"POST",headers:r,body:n});const s=new AbortController,o=setTimeout(()=>s.abort(),this.timeoutMs);try{return await fetch(`${this.baseUrl}/api/chat`,{method:"POST",headers:r,body:n,signal:s.signal})}catch(i){throw s.signal.aborted?new _("Request timed out. Please try again.",0,"TIMEOUT"):i}finally{clearTimeout(o)}}isRetryable(t,r){return r==="TIMEOUT"||r==="NETWORK_ERROR"?!0:t===429||t===503}getRetryDelay(t,r){if(t&&t.status===429){const n=t.headers.get("Retry-After");if(n){const s=Number(n);return Math.min(s*1e3,6e4)}}return r===0?1e3:3e3}delay(t){return new Promise(r=>setTimeout(r,t))}}function $e(e){let t="message";const r=[];for(const n of e.split(`
4
+ `))n.startsWith("event:")?t=n.slice(6).trim():n.startsWith("data:")&&r.push(n.slice(5).trimStart());if(r.length===0)return null;try{const n=JSON.parse(r.join(`
5
+ `));return typeof n!="object"||n===null?null:{event:t,data:n}}catch{return null}}function Ae(e){return typeof e=="string"?{content:e}:e}function he(e,t,r){console.error(`[claudius] plugin "${e.name}" failed in ${t}:`,r)}async function ze(e,t,r){let n=t;for(const s of e){if(!s.onBeforeSend)continue;let o=null;const i={...r,respondWith(c){o={type:"respond",message:n,reply:Ae(c)}},abort(c){o={type:"abort",reason:c}}};try{const c=await s.onBeforeSend(n,i);if(o)return o;c&&(n=c)}catch(c){he(s,"onBeforeSend",c)}}return{type:"send",message:n}}async function Fe(e,t,r){let n=t;for(const s of e)if(s.onAfterReceive)try{const o=await s.onAfterReceive(n,r);o&&(n=o)}catch(o){he(s,"onAfterReceive",o)}return n}async function Ue(e,t,r){for(const n of e){if(!n.onError)continue;let s=null;const o={...r,respondWith(i){s=Ae(i)}};try{if(await n.onError(t,o),s)return s}catch(i){he(n,"onError",i)}}return null}const se={maxSizeBytes:5*1024*1024,maxCount:5,allowedTypes:["image/jpeg","image/png","image/gif","image/webp","application/pdf"]};function Ge(e){return e?e===!0?se:{maxSizeBytes:e.maxSizeBytes??se.maxSizeBytes,maxCount:e.maxCount??se.maxCount,allowedTypes:(e.allowedTypes??se.allowedTypes).map(t=>t.trim().toLowerCase()).filter(Boolean)}:null}function de(e){if(!Number.isFinite(e)||e<0)return"0 B";if(e<1024)return`${e} B`;const t=e/1024;if(t<1024)return`${Math.round(t)} KB`;const r=t/1024;return`${Number.isInteger(r)?r:r.toFixed(1)} MB`}const We={png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",webp:"image/webp",pdf:"application/pdf"};function Se(e){var n;const t=(e.type||"").trim().toLowerCase();if(t)return t;const r=((n=e.name.split(".").pop())==null?void 0:n.toLowerCase())??"";return We[r]??""}function Ve(e){return e.startsWith("image/")}function Ye(e){if(Ve(e.mediaType)){if(e.url)try{const t=new URL(e.url);if(t.protocol==="http:"||t.protocol==="https:")return e.url}catch{}if(e.data)return`data:${e.mediaType};base64,${e.data}`}}function qe(e,t,r){const n=[],s=[];let o=Math.max(0,r.maxCount-t);for(const i of e){const c=Se(i);!c||!r.allowedTypes.includes(c)?s.push({file:i,reason:"type"}):i.size>r.maxSizeBytes||i.size===0?s.push({file:i,reason:"size"}):o<=0?s.push({file:i,reason:"count"}):(n.push(i),o-=1)}return{accepted:n,rejected:s}}function Ke(e){return new Promise((t,r)=>{const n=new FileReader;n.onerror=()=>r(n.error??new Error("Failed to read file")),n.onload=()=>{const s=String(n.result??""),o=s.indexOf(",");t(o>=0?s.slice(o+1):s)},n.readAsDataURL(e)})}let be=0;function Qe(){return be+=1,`att-${Date.now().toString(36)}-${be}`}async function Je(e){const t=await Ke(e);return{id:Qe(),name:e.name||"attachment",mediaType:Se(e),size:e.size,data:t}}function Xe(e){return e.map(t=>{var r;return(r=t.attachments)!=null&&r.some(n=>n.data)?{...t,attachments:t.attachments.map(n=>{if(!n.data)return n;const s={...n};return delete s.data,s})}:t})}function Ze(e,t){if(!t||t.length===0)return e;const r=new Map(t.map(n=>[n.id,n]));return e.map(n=>{var s;return(s=n.attachments)!=null&&s.some(o=>r.has(o.id))?{...n,attachments:n.attachments.map(o=>{const i=r.get(o.id);if(!i)return o;const c={...o,key:i.key,url:i.url,expiresAt:i.expiresAt};return delete c.data,c})}:n})}const et=200,tt="claudius:messages";function rt(e,t){let r;try{r=new URL(t).host}catch{r=t}return`${e}:${r}`}function fe(){try{return typeof sessionStorage<"u"?sessionStorage:null}catch{return null}}function nt(e){const t=fe();if(!t)return[];try{const r=t.getItem(e);if(!r)return[];const n=JSON.parse(r);return Array.isArray(n)?n:[]}catch{return[]}}function st({apiUrl:e,persistMessages:t=!0,storageKeyPrefix:r=tt,timeoutMs:n,translations:s,plugins:o,streaming:i=!0}){const c=l.useMemo(()=>new Ce(e,{debounceMs:0,timeoutMs:n}),[e,n]),u=rt(r,e),d=t?nt(u):[],[p,b]=l.useState(d),[D,E]=l.useState(!1),[C,m]=l.useState(!1),[k,T]=l.useState(null),[S,A]=l.useState(null),[v,y]=l.useState(!1),P=l.useRef(d.length),z=l.useRef(!1),j=l.useRef(d),F=l.useRef(null),M=l.useRef(o??[]);M.current=o??[];const O=l.useCallback(g=>{if(!t)return;const f=fe();if(f)try{const h=Xe(g.slice(-et));f.setItem(u,JSON.stringify(h))}catch{}},[t,u]),B=()=>(P.current+=1,`msg-${P.current}`),w=l.useCallback((g,f)=>{if(!s)return f??"Something went wrong. Please try again.";switch(g){case"TIMEOUT":return s.errorTimeout;case"NETWORK_ERROR":return s.errorConnection;case"RATE_LIMITED":return f!=null&&f.includes("minute")?s.errorRateLimitMinute:s.errorRateLimitHour;case"ATTACHMENT_QUOTA_EXCEEDED":return s.errorAttachmentQuota;case"ATTACHMENTS_DISABLED":case"ATTACHMENT_INVALID":case"ATTACHMENT_TOO_LARGE":return s.errorAttachmentRejected;case"VALIDATION_ERROR":case"CONFIG_ERROR":case"SERVICE_ERROR":case"UNKNOWN_ERROR":default:return f??s.errorGeneric}},[s]),G=l.useCallback(g=>!(g instanceof _)||g.code==="TIMEOUT"||g.code==="NETWORK_ERROR"||g.code==="RATE_LIMITED"||g.code==="SERVICE_ERROR"||g.code==="UNKNOWN_ERROR"||g.status>=500||g.status===0,[]),V=l.useCallback(async g=>{var q,H;E(!0),z.current=!0,A(null),y(!1);const f=i&&typeof c.streamMessage=="function";let h=null;const L=x=>{if(h===null){h=B(),T(h);const N=[...j.current,{id:h,role:"assistant",content:"",...x}];j.current=N,b(N)}else{const N=h,R=j.current.map(U=>U.id===N?{...U,...x}:U);j.current=R,b(R)}},Y=()=>{if(h===null)return;const x=h,N=j.current.filter(R=>R.id!==x);j.current=N,b(N)};try{let x,N,R,U,W=!1;if(f){const $=new AbortController;F.current=$,m(!0);const I=await c.streamMessage(g,{signal:$.signal,onChunk:(ae,re)=>L({content:re}),onToolUse:(ae,re)=>L({toolUses:[...re]})});x=I.reply,N=I.sources,R=I.toolUses,U=I.attachments,W=I.aborted??!1}else{const $=await c.sendMessage(g);x=$.reply,N=$.sources,R=$.toolUses,U=$.attachments}if(W&&!x){Y();return}let K={id:h??B(),role:"assistant",content:x,sources:N,toolUses:R};M.current.length>0&&!W&&(K=await Fe(M.current,K,{messages:g,apiUrl:e}));const ce=h!==null?j.current.map($=>$.id===K.id?K:$):[...g,K],Q=Ze(ce,U);j.current=Q,b(Q),O(Q)}catch(x){if(x instanceof ie)return;if(x instanceof _&&((q=x.code)!=null&&q.startsWith("ATTACHMENT"))&&g.length>0){const N=g[g.length-1];if(N.role==="user"&&((H=N.attachments)!=null&&H.length)){const R=g.slice(0,-1);j.current=R,b(R),O(R)}}if(h!==null){O(j.current),x instanceof _?A(w(x.code,x.message)):A((s==null?void 0:s.errorConnection)??"Failed to connect. Please try again."),y(!1);return}if(M.current.length>0){const N=x instanceof Error?x:new Error(String(x)),R=await Ue(M.current,N,{messages:g,apiUrl:e});if(R){const U={id:B(),role:"assistant",content:R.content,sources:R.sources},W=[...g,U];j.current=W,b(W),O(W),A(null),y(!1);return}}x instanceof _?A(w(x.code,x.message)):A((s==null?void 0:s.errorConnection)??"Failed to connect. Please try again."),y(G(x))}finally{E(!1),z.current=!1,m(!1),T(null),F.current=null}},[e,c,w,G,O,i,s]),X=l.useCallback(()=>{var g;(g=F.current)==null||g.abort()},[]),Z=l.useCallback(async(g,f)=>{const h=g.trim(),L=(f==null?void 0:f.filter(x=>x&&x.id))??[];if(!h&&L.length===0||z.current)return;const Y={id:B(),role:"user",content:h,...L.length>0?{attachments:L}:{}};let q=Y;if(M.current.length>0){const x=await ze(M.current,Y,{messages:j.current,apiUrl:e});if(x.type==="abort")return;if(x.type==="respond"){const N={id:B(),role:"assistant",content:x.reply.content,sources:x.reply.sources},R=[...j.current,x.message,N];j.current=R,b(R),O(R),A(null),y(!1);return}q=x.message}const H=[...j.current,q];j.current=H,b(H),O(H),await V(H)},[e,O,V]),ee=l.useCallback(async()=>{if(z.current)return;const g=j.current[j.current.length-1];!g||g.role!=="user"||await V(j.current)},[V]),te=l.useCallback(()=>{if(j.current=[],b([]),A(null),y(!1),t){const g=fe();if(!g)return;try{g.removeItem(u)}catch{}}},[t,u]);return{messages:p,isLoading:D,isStreaming:C,streamingMessageId:k,error:S,canRetry:v,sendMessage:Z,stop:X,retry:ee,clearMessages:te}}function at(e){const[t,r]=l.useState(()=>typeof window>"u"?!1:window.matchMedia(e).matches);return l.useEffect(()=>{const n=window.matchMedia(e);r(n.matches);const s=o=>r(o.matches);return n.addEventListener("change",s),()=>n.removeEventListener("change",s)},[e]),t}function oe(e,t){return e instanceof RegExp?e.test(t):t.toLowerCase().includes(e.toLowerCase())}function ot(){const e=document.documentElement,t=document.body,r=e.scrollTop||t.scrollTop||0,n=Math.max(e.scrollHeight,t.scrollHeight),s=e.clientHeight||window.innerHeight,o=n-s;return o<=0?100:r/o*100}function it({triggers:e,enabled:t,onOpen:r,onGreeting:n}){l.useEffect(()=>{if(!t||!e||e.length===0)return;const s=new Set,o=[],i=typeof window<"u"?window.location.href:"",c=(u,d)=>{s.has(u)||(s.add(u),d==="open"?r():n(d.greeting))};return e.forEach((u,d)=>{switch(u.on){case"url":{oe(u.pattern,i)&&c(d,u.action);break}case"time":{if(u.matchUrl&&!oe(u.matchUrl,i))return;const p=window.setTimeout(()=>c(d,u.action),Math.max(0,u.seconds*1e3));o.push(()=>window.clearTimeout(p));break}case"scroll":{if(u.matchUrl&&!oe(u.matchUrl,i))return;const p=()=>{ot()>=u.percent&&c(d,u.action)};p(),window.addEventListener("scroll",p,{passive:!0}),o.push(()=>window.removeEventListener("scroll",p));break}case"exit-intent":{if(u.matchUrl&&!oe(u.matchUrl,i))return;const p=b=>{b.clientY<=0&&c(d,u.action)};document.addEventListener("mouseleave",p),o.push(()=>document.removeEventListener("mouseleave",p));break}}}),()=>{o.forEach(u=>u())}},[e,t,r,n])}const ct={"bottom-right":"bottom-6 right-6","bottom-left":"bottom-6 left-6","top-right":"top-6 right-6","top-left":"top-6 left-6"},lt=l.forwardRef(function({isOpen:t,onClick:r,position:n="bottom-right",translations:s},o){const i=t?(s==null?void 0:s.closeChat)??"Close chat":(s==null?void 0:s.openChat)??"Open chat";return a.jsx("button",{ref:o,onClick:r,"aria-label":i,className:`fixed ${ct[n]} 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"})})})}),ut=l.memo(function({count:t,isActive:r,onClick:n}){return a.jsxs("button",{onClick:n,"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})]})}),dt=["http:","https:"];function me(e){if(!e||typeof e!="string")return null;const t=e.trim();if(!t)return null;try{const r=new URL(t);return dt.includes(r.protocol)?t:null}catch{return null}}function ft(){return 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"})]})}function ye({label:e,onClick:t}){return a.jsx("button",{type:"button",onClick:t,"aria-label":e,className:"absolute -right-1.5 -top-1.5 flex h-5 w-5 items-center justify-center rounded-claudius-full bg-claudius-text text-claudius-surface shadow-claudius-floating hover:opacity-90 focus:outline-none focus-visible:ring-2 focus-visible:ring-claudius-accent",children:a.jsxs("svg",{width:"10",height:"10",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"3",strokeLinecap:"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"})]})})}const Me=l.memo(function({attachment:t,variant:r,onRemove:n,removeLabel:s}){const o=Ye(t),i=r==="composer",c=`${t.name} (${de(t.size)})`,u=t.url?me(t.url):null;if(o){const p=a.jsx("img",{src:o,alt:t.name,title:c,loading:"lazy",className:i?"h-12 w-12 rounded-claudius-sm border border-claudius-border object-cover":"max-h-48 max-w-full rounded-claudius-sm object-contain"});return a.jsxs("div",{className:"relative inline-block",children:[!i&&u?a.jsxs("a",{href:u,target:"_blank",rel:"noopener noreferrer",children:[p,a.jsxs("span",{className:"sr-only",children:[c," (opens in a new tab)"]})]}):p,n&&s&&a.jsx(ye,{label:s,onClick:n})]})}const d=a.jsxs("span",{title:c,className:`inline-flex max-w-[220px] items-center gap-1.5 rounded-claudius-sm border px-2 py-1 text-xs ${i?"border-claudius-border bg-claudius-field text-claudius-text":"border-current/30 bg-transparent"}`,children:[a.jsx(ft,{}),a.jsx("span",{className:"truncate",children:t.name}),a.jsx("span",{className:"shrink-0 opacity-70",children:de(t.size)})]});return a.jsxs("div",{className:"relative inline-block",children:[!i&&u?a.jsxs("a",{href:u,target:"_blank",rel:"noopener noreferrer",className:"underline-offset-2 hover:underline",children:[d,a.jsx("span",{className:"sr-only",children:" (opens in a new tab)"})]}):d,n&&s&&a.jsx(ye,{label:s,onClick:n})]})});function ht(e){const t=e.lastIndexOf(`
6
+ `),r=t===-1?"":e.slice(0,t+1);let n=t===-1?e:e.slice(t+1);return n=pt(n),n=xt(n),r+n}function mt(e){const t=[];for(let r=0;r<e.length-1;r++)e[r]==="*"&&e[r+1]==="*"&&(t.push(r),r++);return t}function gt(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 pt(e){const t=mt(e);if(t.length%2===0)return e;const r=t[t.length-1],n=e.slice(r+2);return n.trim()===""?e.slice(0,r)+n:e+"**"}function xt(e){const t=gt(e);if(t.length%2===0)return e;const r=t[t.length-1],n=e.slice(r+1);return n.trim()===""?e.slice(0,r)+n:e+"*"}function bt({toolUse:e,usedLabel:t,detailsLabel:r}){const[n,s]=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:()=>s(i=>!i),"aria-expanded":o?n: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:n?"rotate-180":void 0,children:a.jsx("polyline",{points:"6 9 12 15 18 9"})})]})]}),n&&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 we=/(https?:\/\/[^\s)]+)/,ve=/(\*\*[^*]+\*\*)/,je=/(\*[^*]+\*)/;function yt(e,t){const r=e.match(/[.,;:!?'"]+$/),n=r?e.slice(0,-r[0].length):e,s=r?r[0]:"",o=me(n);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),s]}):e}function wt(e,t){const r=e.split(ve),n=[];return r.forEach((s,o)=>{if(ve.test(s)){const i=s.slice(2,-2);n.push(a.jsx("strong",{children:i},`${t}-b${o}`))}else s.split(je).forEach((c,u)=>{if(je.test(c)){const d=c.slice(1,-1);n.push(a.jsx("em",{children:d},`${t}-b${o}-i${u}`))}else c.split(we).forEach((p,b)=>{we.test(p)?n.push(yt(p,`${t}-b${o}-i${u}-u${b}`)):p&&n.push(p)})})}),n}function vt(e){const t=e.split(`
7
+ `);return t.map((r,n)=>a.jsxs("span",{children:[wt(r,`l${n}`),n<t.length-1&&a.jsx("br",{})]},n))}const jt=l.memo(function({role:t,content:r,isStreaming:n=!1,sources:s,attachments:o,toolUses:i,toolUsedLabel:c="Used tool:",toolDetailsLabel:u="Tool details",onSourceClick:d,isSourceActive:p}){const b=t==="user",D=!!o&&o.length>0,E=n?ht(r):r,C=b||r!==""||!(i!=null&&i.length);return a.jsxs("div",{className:`${b?"ml-auto":"mr-auto"} max-w-[85%]`,children:[C&&a.jsxs("div",{className:`rounded-claudius-bubble px-4 py-2.5 text-sm leading-relaxed font-body ${b?"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:[D&&a.jsx("ul",{className:`flex flex-wrap gap-2 ${r?"mb-2":""}`,"aria-label":"Attachments",children:o.map(m=>a.jsx("li",{children:a.jsx(Me,{attachment:m,variant:"message"})},m.id))}),(r!==""||!D)&&vt(E)]}),!b&&i&&i.length>0&&a.jsx("div",{className:"mt-1 space-y-1",children:i.map((m,k)=>a.jsx(bt,{toolUse:m,usedLabel:c,detailsLabel:u},`${m.name}-${k}`))}),!b&&s&&s.length>0&&d&&a.jsx("div",{className:"mt-1",children:a.jsx(ut,{count:s.length,isActive:p??!1,onClick:d})})]})}),ke={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",attachFile:"Attach a file",removeAttachment:"Remove attachment",attachmentsLabel:"Attachments",dropFilesHint:"Drop files to attach",attachmentTooLarge:"{name} is too large. The maximum size is {max}.",attachmentTypeNotAllowed:"{name} is not a supported file type.",attachmentTooMany:"You can attach up to {max} files per message.",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.",errorAttachmentRejected:"An attachment was rejected. Please remove it and try again.",errorAttachmentQuota:"Upload limit reached. Please try again later.",errorRetry:"Retry"},ge=ke;function Tt(e){return{...ge,...e}}function le(e,t){return e.replace(/\{(\w+)\}/g,(r,n)=>n in t?String(t[n]):r)}const ue=2e3,Rt=1800;function Te(e){var r;const t=(r=e.dataTransfer)==null?void 0:r.types;return!!t&&Array.from(t).includes("Files")}function Et({onSend:e,isLoading:t,isStreaming:r=!1,onStop:n,placeholder:s,translations:o,attachments:i=null}){const c=o??ge,[u,d]=l.useState(""),[p,b]=l.useState([]),[D,E]=l.useState(null),[C,m]=l.useState(!1),k=l.useRef(null),T=l.useRef(null),S=l.useRef([]),A=l.useRef(0),v=u.length,y=v>=Rt,P=v>=ue,z=s??c.placeholder,j=!!i&&p.length<i.maxCount,F=r&&!!n;l.useEffect(()=>{var f;t||(f=k.current)==null||f.focus()},[t]);const M=l.useCallback((f,h)=>{if(!i)return"";switch(h){case"size":return le(c.attachmentTooLarge,{name:f,max:de(i.maxSizeBytes)});case"type":return le(c.attachmentTypeNotAllowed,{name:f});case"count":return le(c.attachmentTooMany,{max:i.maxCount})}},[i,c]),O=l.useCallback(async f=>{if(!i||f.length===0)return;const{accepted:h,rejected:L}=qe(f,S.current.length,i);if(E(L.length>0?M(L[0].file.name,L[0].reason):null),h.length===0)return;const Y=await Promise.all(h.map(Je));S.current=[...S.current,...Y],b(S.current)},[i,M]),B=l.useCallback(f=>{S.current=S.current.filter(h=>h.id!==f),b(S.current),E(null)},[]),w=f=>{f.preventDefault();const h=u.trim(),L=S.current;!h&&L.length===0||P||(L.length>0?e(h,L):e(h),d(""),S.current=[],b([]),E(null))},G=f=>{const h=f.target.value;h.length<=ue&&d(h)},V=f=>{const h=Array.from(f.target.files??[]);f.target.value="",O(h)},X=f=>{var L;if(!i)return;const h=Array.from(((L=f.clipboardData)==null?void 0:L.files)??[]);h.length!==0&&(f.preventDefault(),O(h))},Z=f=>{!i||!Te(f)||(f.preventDefault(),A.current+=1,m(!0))},ee=f=>{!i||!Te(f)||f.preventDefault()},te=()=>{i&&(A.current=Math.max(0,A.current-1),A.current===0&&m(!1))},g=f=>{var h;i&&(f.preventDefault(),A.current=0,m(!1),O(Array.from(((h=f.dataTransfer)==null?void 0:h.files)??[])))};return a.jsxs("form",{onSubmit:w,onDragEnter:Z,onDragOver:ee,onDragLeave:te,onDrop:g,"data-drag-over":C||void 0,className:`relative border-t border-claudius-border bg-claudius-surface p-3 ${C?"ring-2 ring-inset ring-claudius-accent":""}`,children:[C&&a.jsx("div",{"aria-hidden":"true",className:"pointer-events-none absolute inset-0 z-10 flex items-center justify-center bg-claudius-surface text-sm font-medium text-claudius-accent",children:c.dropFilesHint}),i&&p.length>0&&a.jsx("ul",{"aria-label":c.attachmentsLabel,className:"mb-2 flex flex-wrap gap-3 pt-1",children:p.map(f=>a.jsx("li",{children:a.jsx(Me,{attachment:f,variant:"composer",onRemove:()=>B(f.id),removeLabel:`${c.removeAttachment}: ${f.name}`})},f.id))}),a.jsxs("div",{className:"flex gap-2",children:[i&&a.jsxs(a.Fragment,{children:[a.jsx("input",{ref:T,type:"file",multiple:!0,hidden:!0,tabIndex:-1,accept:i.allowedTypes.join(","),onChange:V,"aria-label":c.attachFile}),a.jsx("button",{type:"button",onClick:()=>{var f;return(f=T.current)==null?void 0:f.click()},disabled:t||!j,"aria-label":c.attachFile,title:c.attachFile,className:"flex h-11 w-11 shrink-0 items-center justify-center rounded-claudius-sm border border-claudius-border bg-claudius-field text-claudius-text-muted transition-colors hover:text-claudius-text focus:border-claudius-accent focus:outline-none focus:ring-1 focus:ring-claudius-accent disabled:opacity-50",children:a.jsx("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("path",{d:"m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48"})})})]}),a.jsx("input",{ref:k,type:"text",value:u,onChange:G,onPaste:X,placeholder:z,disabled:t,"aria-label":c.typeYourMessage,"aria-describedby":y?"char-count":void 0,className:"min-w-0 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"}),F?a.jsx("button",{type:"button",onClick:n,"aria-label":c.stopGenerating,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||P,"aria-label":c.sendMessage,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"})]})})]}),D&&a.jsx("div",{role:"alert",className:"mt-1 text-xs text-claudius-error",children:D}),y&&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:[v,"/",ue]})]})}const Ct=["blog","page","external"],At={blog:"Blog",page:"Page",external:"External"};function St(e){try{return new URL(e).hostname}catch{return e}}const Mt=l.memo(function({sources:t,onClose:r}){const n=Ct.map(o=>({type:o,label:At[o],items:t.filter(i=>i.type===o)})).filter(o=>o.items.length>0),s=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:s})]}),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:n.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 c=me(i.url);return c?a.jsxs("a",{href:c,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:St(c)})]},c):null})})]},o.type))})]})});function kt({title:e,subtitle:t,titleId:r,closeLabel:n,onClose:s}){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:s,"aria-label":n,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 Nt({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 Dt(e,t,r){const[n,s]=l.useState(0),o=l.useRef(0),i=l.useRef(0),c=l.useRef(0),u=l.useRef(!1);return l.useEffect(()=>{const d=e.current;if(!r||!d)return;const p=E=>{if(d.scrollTop>0){u.current=!1;return}u.current=!0,i.current=E.touches[0].clientY,c.current=Date.now()},b=E=>{if(!u.current)return;let C=E.touches[0].clientY-i.current;C<0&&(C=C*.3),o.current=C,s(C)},D=()=>{if(!u.current)return;u.current=!1;const E=o.current,C=(Date.now()-c.current)/1e3,m=d.getBoundingClientRect().height,k=C>.05&&E>0&&E/C>500,T=E>m*.3;k||T?t():(o.current=0,s(0))};return d.addEventListener("touchstart",p,{passive:!0}),d.addEventListener("touchmove",b,{passive:!0}),d.addEventListener("touchend",D),()=>{d.removeEventListener("touchstart",p),d.removeEventListener("touchmove",b),d.removeEventListener("touchend",D)}},[e,t,r]),{offsetY:n}}const Ot='a[href], button:not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';function It(e,t){l.useEffect(()=>{const r=e.current;if(!r)return;const n=s=>{if(s.key!=="Tab")return;const o=Array.from(r.querySelectorAll(Ot)).filter(d=>!d.hasAttribute("aria-hidden"));if(o.length===0)return;const i=o[0],c=o[o.length-1],u=document.activeElement;s.shiftKey&&u===i?(s.preventDefault(),c.focus()):!s.shiftKey&&u===c&&(s.preventDefault(),i.focus())};return r.addEventListener("keydown",n),()=>r.removeEventListener("keydown",n)},[e,t])}const _t=/\*\*([^*]+)\*\*/g,Bt=/\*([^*]+)\*/g,Pt=/https?:\/\/[^\s)]+/g;function Ht(e){return e.replace(_t,"$1").replace(Bt,"$1").replace(Pt,t=>{try{return new URL(t).hostname}catch{return t}})}const $t={"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 zt({messages:e,isLoading:t,isStreaming:r=!1,streamingMessageId:n=null,error:s,canRetry:o=!1,onSend:i,onStop:c,onRetry:u,onClose:d,title:p="Chat",subtitle:b="Ask me anything",welcomeMessage:D="Hi! How can I help you today?",placeholder:E,position:C="bottom-right",translations:m,isMobile:k=!1,attachments:T=null}){const S=l.useId(),A=l.useRef(null),v=l.useRef(null),[y,P]=l.useState(null);It(A,!0);const{offsetY:z}=Dt(v,d,k),j=z!==0,F=typeof window<"u"&&typeof window.matchMedia=="function"?window.matchMedia("(prefers-reduced-motion: reduce)").matches:!1;l.useEffect(()=>{const w=v.current;w&&(w.scrollTop=w.scrollHeight)},[e,t]),l.useEffect(()=>{const w=G=>{G.key==="Escape"&&!G.isComposing&&d()};return document.addEventListener("keydown",w),()=>document.removeEventListener("keydown",w)},[d]);const M=(m==null?void 0:m.closeChat)??"Close chat",O=(m==null?void 0:m.chatMessages)??"Chat messages",B=[...e].reverse().find(w=>w.role==="assistant");return a.jsxs("div",{ref:A,role:"dialog","aria-modal":k?"true":void 0,"aria-labelledby":S,className:k?"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 ${$t[C]} 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:k&&!F?{transform:`translateY(${Math.max(0,z)}px)`}:void 0,"data-dragging":j||void 0,children:[k&&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(kt,{title:p,subtitle:b,titleId:S,closeLabel:M,onClose:d}),a.jsxs("div",{className:"relative flex-1 overflow-hidden",children:[y&&a.jsx(Mt,{sources:y.sources,onClose:()=>P(null)}),a.jsxs("div",{ref:v,role:"log","aria-label":O,className:"h-full space-y-3 overflow-y-auto px-4 py-4",children:[e.length===0&&!s&&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:D})}),e.map(w=>a.jsx(jt,{role:w.role,content:w.content,isStreaming:w.id===n,sources:w.sources,attachments:w.attachments,toolUses:w.toolUses,toolUsedLabel:m==null?void 0:m.toolUsed,toolDetailsLabel:m==null?void 0:m.toolDetails,isSourceActive:(y==null?void 0:y.messageId)===w.id,onSourceClick:()=>{(y==null?void 0:y.messageId)===w.id?P(null):w.sources&&w.sources.length>0&&P({messageId:w.id,sources:w.sources})}},w.id)),t&&!(n!==null&&e.some(w=>w.id===n&&w.content.length>0))&&a.jsx(Lt,{label:(m==null?void 0:m.typingIndicator)??"Assistant is typing"}),s&&a.jsx(Nt,{message:s,retryLabel:(m==null?void 0:m.errorRetry)??"Retry",onRetry:o&&u&&!t?u:void 0})]})]}),a.jsx("div",{"data-claudius-live":"assistant","aria-live":"polite","aria-atomic":"true",className:"sr-only",children:B&&B.id!==n?Ht(B.content):""}),a.jsx(Et,{onSend:i,isLoading:t,isStreaming:r,onStop:c,placeholder:E,translations:m,attachments:T})]})}function Ft({message:e,position:t,onOpen:r,onDismiss:n,dismissLabel:s}){const o=t.startsWith("bottom"),i=t.endsWith("right"),c=["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:c,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:u=>{u.stopPropagation(),n()},"aria-label":s,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 Ut={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",attachFile:"Adjuntar un archivo",removeAttachment:"Quitar adjunto",attachmentsLabel:"Adjuntos",dropFilesHint:"Suelta los archivos para adjuntarlos",attachmentTooLarge:"{name} es demasiado grande. El tamaño máximo es {max}.",attachmentTypeNotAllowed:"{name} no es un tipo de archivo compatible.",attachmentTooMany:"Puedes adjuntar hasta {max} archivos por mensaje.",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.",errorAttachmentRejected:"Se rechazó un adjunto. Quítalo e inténtalo de nuevo.",errorAttachmentQuota:"Límite de subida alcanzado. Inténtalo más tarde.",errorRetry:"Reintentar"},Gt={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",attachFile:"Joindre un fichier",removeAttachment:"Retirer la pièce jointe",attachmentsLabel:"Pièces jointes",dropFilesHint:"Déposez les fichiers pour les joindre",attachmentTooLarge:"{name} est trop volumineux. La taille maximale est de {max}.",attachmentTypeNotAllowed:"{name} n'est pas un type de fichier pris en charge.",attachmentTooMany:"Vous pouvez joindre jusqu'à {max} fichiers par message.",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.",errorAttachmentRejected:"Une pièce jointe a été refusée. Retirez-la et réessayez.",errorAttachmentQuota:"Limite d'envoi atteinte. Veuillez réessayer plus tard.",errorRetry:"Réessayer"},Wt={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",attachFile:"Datei anhängen",removeAttachment:"Anhang entfernen",attachmentsLabel:"Anhänge",dropFilesHint:"Dateien hier ablegen, um sie anzuhängen",attachmentTooLarge:"{name} ist zu groß. Die maximale Größe beträgt {max}.",attachmentTypeNotAllowed:"{name} ist kein unterstützter Dateityp.",attachmentTooMany:"Sie können bis zu {max} Dateien pro Nachricht anhängen.",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.",errorAttachmentRejected:"Ein Anhang wurde abgelehnt. Bitte entfernen Sie ihn und versuchen Sie es erneut.",errorAttachmentQuota:"Upload-Limit erreicht. Bitte versuchen Sie es später erneut.",errorRetry:"Erneut versuchen"},pe={en:ke,es:Ut,fr:Gt,de:Wt};function Re(e){if(!e)return;const t=e.toLowerCase().split("-")[0];return Object.prototype.hasOwnProperty.call(pe,t)?t:void 0}function Ne(){const e=typeof document<"u"?Re(document.documentElement.lang):void 0;if(e)return e;const t=typeof navigator<"u"?Re(navigator.language):void 0;return t||"en"}function Le(e={}){const{locale:t,translations:r}=e,n=pe[t??Ne()];return r?{...n,...r}:{...n}}const Ee=["accent","accentText","accentSoft","accentTextMuted","surface","surfaceMuted","text","textMuted","border","userBubble","userBubbleText","assistantBubble","assistantBubbleText","field","error","errorSurface","errorText","link","scrim"],Vt=["sm","md","lg","full","tail"],Yt=["elevated","floating","floatingHover"],qt=["heading","body"],xe={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 Kt(e){return Object.prototype.hasOwnProperty.call(xe,e)}const Qt=new Set(["light","dark","auto"]);function Jt(e){if(e===void 0)return{mode:"light"};if(typeof e=="string"){if(Qt.has(e))return{mode:e};if(Kt(e)){const t=xe[e];return{mode:t.colorScheme??"light",theme:t}}return{mode:"light",url:e}}return{mode:e.colorScheme??"light",theme:e}}function Xt(e){return e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function Zt(e,t){console.warn(`[Claudius] Ignoring unknown theme token "${t}" in "${e}"`)}function ne(e,t,r,n,s,o=""){if(s)for(const[i,c]of Object.entries(s)){if(!n.includes(i)){Zt(t,i);continue}typeof c=="string"&&(e[`${r}${Xt(i)}${o}`]=c)}}function er(e){const t={};ne(t,"colors","--cl-color-",Ee,e.colors);for(const[r,n]of Object.entries({...t}))t[`${r}-dark`]=n;return ne(t,"colorsDark","--cl-color-",Ee,e.colorsDark,"-dark"),ne(t,"radii","--cl-radius-",Vt,e.radii),ne(t,"shadows","--cl-shadow-",Yt,e.shadows),ne(t,"fonts","--cl-font-",qt,e.fonts),t}function tr(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function rr(e){const t=l.useMemo(()=>Jt(e),[e]),[r,n]=l.useState(null),s=t.url;l.useEffect(()=>{if(n(null),!s)return;const u=new AbortController;return fetch(s,{signal:u.signal}).then(d=>{if(!d.ok)throw new Error(`HTTP ${d.status}`);return d.json()}).then(d=>{if(!tr(d))throw new Error("theme JSON must be an object");n(d)}).catch(d=>{u.signal.aborted||console.error(`[Claudius] Failed to load theme from ${s}:`,d)}),()=>u.abort()},[s]);const o=t.theme??r??null,i=(r==null?void 0:r.colorScheme)??t.mode,c=l.useMemo(()=>o?er(o):{},[o]);return{mode:i,cssVars:c}}const De="claudius:triggers:dismissed";function nr(){if(typeof window>"u")return!1;try{return window.sessionStorage.getItem(De)==="1"}catch{return!1}}function sr(){if(!(typeof window>"u"))try{window.sessionStorage.setItem(De,"1")}catch{}}function ar({apiUrl:e,title:t,subtitle:r,welcomeMessage:n,placeholder:s,persistMessages:o,storageKeyPrefix:i,requestTimeoutMs:c,theme:u="light",accentColor:d,position:p="bottom-right",locale:b,translations:D,triggers:E,plugins:C,streaming:m=!0,attachments:k=!1}){const[T,S]=l.useState(!1),A=l.useMemo(()=>Ge(k),[k]),[v,y]=l.useState(null),[P,z]=l.useState(nr),j=l.useRef(!1),F=at("(max-width: 639px)"),M=l.useMemo(()=>Le({locale:b,translations:D}),[b,D]),{messages:O,isLoading:B,isStreaming:w,streamingMessageId:G,error:V,canRetry:X,sendMessage:Z,stop:ee,retry:te}=st({apiUrl:e,persistMessages:o,storageKeyPrefix:i,timeoutMs:c,translations:M,plugins:C,streaming:m}),g=l.useRef(null),f=l.useRef(T),{mode:h,cssVars:L}=rr(u),[Y,q]=l.useState(!1);l.useEffect(()=>{if(h!=="auto")return;const I=window.matchMedia("(prefers-color-scheme: dark)");q(I.matches);const ae=re=>q(re.matches);return I.addEventListener("change",ae),()=>I.removeEventListener("change",ae)},[h]),l.useEffect(()=>{var I;f.current&&!T&&((I=g.current)==null||I.focus()),f.current=T},[T]);const H=l.useCallback(()=>{z(!0),sr()},[]),x=l.useCallback(()=>{S(!1),j.current&&(j.current=!1,H())},[H]),N=l.useCallback(()=>{S(I=>!I)},[]),R=l.useCallback(()=>{j.current=!0,y(null),S(!0)},[]),U=l.useCallback(I=>{y(I)},[]),W=l.useCallback(()=>{y(null),R()},[R]),K=l.useCallback(()=>{y(null),H()},[H]);it({triggers:E,enabled:!P&&!T,onOpen:R,onGreeting:U});const ce=h==="dark"||h==="auto"&&Y,Q={...L,...d?{"--cl-color-accent":d,"--cl-color-accent-dark":d}:{}},$=Object.keys(Q).length>0?Q:void 0;return a.jsx("div",{className:"claudius-root",style:$,children:a.jsxs("div",{"data-claudius-dark":ce?"true":"false",children:[T&&F&&a.jsx("div",{className:"claudius-scrim fixed inset-0 z-40 bg-claudius-scrim",onClick:x,"aria-hidden":"true"}),T&&a.jsx(zt,{messages:O,isLoading:B,isStreaming:w,streamingMessageId:G,error:V,canRetry:X,onSend:Z,onStop:ee,onRetry:te,onClose:x,title:t??M.title,subtitle:r??M.subtitle,welcomeMessage:n??M.welcomeMessage,placeholder:s??M.placeholder,position:p,translations:M,isMobile:F,attachments:A}),!(T&&F)&&a.jsx(lt,{ref:g,isOpen:T,onClick:N,position:p,translations:M}),!T&&v&&a.jsx(Ft,{message:v,position:p,onOpen:W,onDismiss:K,dismissLabel:M.dismissGreeting})]})})}function or(e){const{onEvent:t,includeContent:r=!0}=e,n=s=>r?s:"";return{name:"analytics",onBeforeSend(s){t({type:"message_sent",role:"user",content:n(s.content),chars:s.content.length})},onAfterReceive(s){t({type:"message_received",role:"assistant",content:n(s.content),chars:s.content.length})},onError(s){t({type:"chat_error",message:s.message,code:s.code})}}}const Oe=[/\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 Ie(e,t,r){return t.reduce((n,s)=>(s.lastIndex=0,n.replace(s,r)),e)}function ir(e={}){const{patterns:t=Oe,replacement:r="[redacted]",redactReplies:n=!1}=e,s=o=>{const i=Ie(o.content,t,r);if(i!==o.content)return{...o,content:i}};return{name:"redact-pii",onBeforeSend:s,onAfterReceive:n?s:void 0}}function cr(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 lr(e){const{rules:t,caseSensitive:r=!1}=e;return{name:"canned-responses",onBeforeSend(n,s){for(const o of t)if(cr(o.match,n.content,r)){s.respondWith(o.reply);return}}}}exports.ChatApiClient=Ce;exports.ChatApiError=_;exports.ChatWidget=ar;exports.DEFAULT_ATTACHMENT_OPTIONS=se;exports.DEFAULT_PII_PATTERNS=Oe;exports.DebounceError=ie;exports.builtinThemes=xe;exports.createTranslations=Tt;exports.defaultTranslations=ge;exports.detectLocale=Ne;exports.locales=pe;exports.pluginAnalytics=or;exports.pluginCannedResponses=lr;exports.pluginRedactPII=ir;exports.redactText=Ie;exports.resolveTranslations=Le;
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}.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}}
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}.pointer-events-none{pointer-events:none}.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}.-right-1\.5{right:-.375rem}.-top-1{top:-.25rem}.-top-1\.5{top:-.375rem}.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-block{display:inline-block}.inline{display:inline}.flex{display:flex}.inline-flex{display:inline-flex}.hidden{display:none}.h-1{height:.25rem}.h-10{height:2.5rem}.h-11{height:2.75rem}.h-12{height:3rem}.h-14{height:3.5rem}.h-2{height:.5rem}.h-4{height:1rem}.h-5{height:1.25rem}.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%}.max-h-48{max-height:12rem}.w-10{width:2.5rem}.w-11{width:2.75rem}.w-12{width:3rem}.w-14{width:3.5rem}.w-2{width:.5rem}.w-5{width:1.25rem}.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-0{min-width:0px}.min-w-4{min-width:1rem}.max-w-\[220px\]{max-width:220px}.max-w-\[380px\]{max-width:380px}.max-w-\[85\%\]{max-width:85%}.max-w-\[90\%\]{max-width:90%}.max-w-full{max-width:100%}.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}.flex-wrap{flex-wrap:wrap}.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{background-color:var(--claudius-dark, var(--cl-color-text, #1e293b))}.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)))}.bg-transparent{background-color:transparent}.object-contain{-o-object-fit:contain;object-fit:contain}.object-cover{-o-object-fit:cover;object-fit:cover}.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{color:var(--claudius-primary, var(--cl-color-accent, #2563eb))}.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-surface{color:var(--cl-color-surface, #ffffff)}.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}.underline-offset-2{text-underline-offset:2px}.opacity-70{opacity:.7}.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-2{--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)}.ring-inset{--tw-ring-inset: inset}.ring-claudius-accent{--tw-ring-color: var(--claudius-primary, var(--cl-color-accent, #2563eb))}.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\:underline:hover{text-decoration-line:underline}.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-accent:focus-visible{--tw-ring-color: var(--claudius-primary, var(--cl-color-accent, #2563eb))}.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}}