@espejo/browser 0.1.0 → 0.3.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/agent.cjs +3 -3
- package/dist/agent.d.cts +1 -1
- package/dist/agent.d.ts +1 -1
- package/dist/agent.js +1 -1
- package/dist/chat.cjs +540 -357
- package/dist/chat.d.cts +98 -25
- package/dist/chat.d.ts +98 -25
- package/dist/chat.js +537 -354
- package/dist/chunk-5KPTJYDE.js +49 -0
- package/dist/{chunk-54OEDPVD.js → chunk-HP3BBKZO.js} +1 -1
- package/dist/{index-Djj7dbiY.d.cts → index-DsYc9zWf.d.cts} +1 -1
- package/dist/{index-Djj7dbiY.d.ts → index-DsYc9zWf.d.ts} +1 -1
- package/dist/index.cjs +7 -7
- package/dist/index.d.cts +10 -5
- package/dist/index.d.ts +10 -5
- package/dist/index.js +8 -8
- package/dist/{shadow-scaffold-DUJmxf_n.d.cts → shadow-scaffold-BsadRTCW.d.cts} +1 -1
- package/dist/{shadow-scaffold-DUJmxf_n.d.ts → shadow-scaffold-BsadRTCW.d.ts} +1 -1
- package/package.json +2 -2
- package/dist/chunk-MJUVVQNB.js +0 -49
package/dist/chat.js
CHANGED
|
@@ -1,23 +1,24 @@
|
|
|
1
|
-
import{b as et,e as
|
|
2
|
-
${
|
|
3
|
-
`))
|
|
4
|
-
`))}catch{return}if(
|
|
5
|
-
`)+(
|
|
1
|
+
import{b as et,e as xi,f as yi}from"./chunk-HP3BBKZO.js";import{B as bn,C as ht,D as Wn,E as hi,F as Kn,I as vi,J as xn,K as bi,b as pi,r as ui,s as Ee,t as fi,u as gi,v as mi,x as Ht}from"./chunk-5KPTJYDE.js";var Kt="https://app.espejo.dev",$r=["home","support","tickets","guides"],zr=25,Br=1500,Fr=5,wi=/^[\x21-\x7e]+$/;function Ut(e,o){let n=typeof e=="string"?e.trim():"",r=typeof o=="string"?o.trim():"";return wi.test(n)&&wi.test(r)?{email:n,hash:r}:null}var wn=e=>e?{[Wn.email]:e.email,[Wn.hash]:e.hash}:{},te=class extends Error{constructor(n,r,s){super(r);this.code=n;this.retryAfter=s}};function Qn(e){let o=(e.baseUrl||Kt).replace(/\/+$/,""),n=`espejo:chat:${e.key}`,r=e.storage===void 0?Qr():e.storage,s=e.fetch??((u,v)=>globalThis.fetch(u,v)),a=e.agent??Yn(e.allow,e.espejo),c=u=>{try{e.onEvent?.(u)}catch{}},l=e.identity?Ut(e.identity.email,e.identity.hash):null,d=`${n}:who`,m=u=>l?Wr(`${u}
|
|
2
|
+
${l.hash.toLowerCase()}`):null,h=Yr(r,n)??"";try{let u=r?.getItem(d);h&&u&&u!==m(h)&&(h="")}catch{}e.conversationId&&yn.test(e.conversationId)&&(h=e.conversationId.toLowerCase()),h=h?L(h):G();let x=null,w=[],A=!1,P=0,S=0;function G(){return L(Ci())}function L(u){try{r?.setItem(n,u);let v=m(u);v?r?.setItem(d,v):r?.removeItem(d)}catch{}return u}let $=new WeakMap,q=a.on("action",u=>$.set(u.action,u)),j=e.onConfirm?a.on("action_confirm",e.onConfirm):()=>{},V="",I=()=>{try{let u=a.getContext();return V=u.page,{page:u.page.slice(0,Ee.page),url:u.url.slice(0,Ee.url),recent:u.recent.slice(-Ee.recentItems).map(v=>v.slice(0,Ee.itemChars)),errors:u.errors.slice(-Ee.errorItems).map(v=>v.slice(0,Ee.itemChars))}}catch{return{page:"",url:typeof location<"u"?pi(location.href).slice(0,Ee.url):"",recent:[],errors:[]}}},R=async(u,v)=>{let k=Ur(e.espejo),H=await s(`${o}${ui}`,{method:"POST",headers:{"content-type":"application/json","x-espejo-key":e.key,accept:"text/event-stream",...wn(l)},credentials:"omit",body:JSON.stringify(k?{...u,session_id:k}:u),signal:v});if(H.ok)return H;throw await ki(H)},re=async(u,v)=>{let k={...u.input??{},type:u.name};v({type:"tool_start",call:u,...Vr(k,V)});let H;try{H=await a.act(k)}catch{H={ok:!1,error:"action_failed"}}let D=$.get(k);v({type:"tool",call:u,label:D?.label??u.name,...D?.target!==void 0?{target:D.target}:{},...D?.value!==void 0?{value:D.value}:{},...D?.destination!==void 0?{destination:D.destination}:{},result:H});let O={id:u.id,ok:H.ok};return H.error&&(O.error=H.error.slice(0,Ee.toolError)),H.snapshot&&(V=H.snapshot,O.snapshot=H.snapshot.slice(0,Ee.toolSnapshot)),O},ve=async(u,v)=>{let k=we=>{v.aborted||c(we)},H=()=>({conversation_id:h,...u,context:I()}),D=H(),O=!1,B=!1;for(let we=0;we<zr;we++){let Ie;try{Ie=await R(D,v)}catch(U){if(U instanceof te&&(U.code==="conversation_expired"||U.code==="identity_changed")&&!O){O=!0,h=G(),D=H(),we--;continue}if(U instanceof te&&U.code==="conversation_busy"&&!B){if(B=!0,await Kr(Br,v),v.aborted)return!1;we--;continue}throw U}let{calls:se,awaiting:J}=await jr(Ie,k);if(v.aborted)return!1;if(!J||!se.length)return c({type:"done",conversationId:h}),!0;let fe=[];for(let U of se)if(fe.push(await re(U,k)),v.aborted)return!1;D={conversation_id:h,tool_results:fe,context:I()}}return c({type:"error",code:"iteration_limit",message:"Too many actions in a row."}),!1},Te=async(u,v)=>{try{return await ve(u,v)?"done":""}catch(k){return v.aborted?"":k instanceof te&&(k.code==="greeting_disabled"||k.code==="greeting_not_allowed")?k.code:(k instanceof te?c({type:"error",code:k.code,message:k.message,...k.retryAfter?{retryAfter:k.retryAfter}:{}}):k instanceof Wt?c({type:"error",code:k.code,message:k.message}):c({type:"error",code:"network",message:"Could not reach the support agent."}),"error")}},K=u=>typeof u=="string"?u.trim().slice(0,Ee.message):"",ne=()=>{w.length||(A=!1),c({type:"queue",queue:w.map(u=>({...u})),paused:A})},Se=()=>{!w.length||A||(A=!0,ne())},de=async(u,v)=>{let k=new AbortController;x=k;try{for(;;){if(v!==void 0&&c({type:"dequeued",id:v,message:u}),await Te({message:u},k.signal)!=="done"){k.signal.aborted||Se();return}if(k.signal.aborted)return;let H=A?void 0:w.shift();if(!H)return;let D=S;if(ne(),S!==D)return;if(k.signal.aborted){w.unshift(H),ne();return}({id:v,text:u}=H)}}finally{x===k&&(x=null)}},be=()=>{x?.abort(),x=null},ze=u=>{let v=w.find(k=>k.id===u);return v&&(w=w.filter(k=>k!==v)),v},Ne=u=>{be(),S++,w.length&&(w=[],ne()),h=L(u)},pe=()=>Ne(Ci()),Z=async u=>{let v;try{v=await s(`${o}${fi}${u}`,{headers:{"x-espejo-key":e.key,...wn(l)},credentials:"omit"})}catch{throw new te("network","Could not reach the support agent.")}if(!v.ok)throw await ki(v);let k;try{k=await v.json()}catch{}if(!k||typeof k!="object")throw new te("bad_response","The server sent an unexpected response.");return k},ue=async u=>{if(!yn.test(u))throw new te("bad_request","The conversation id must be a UUID.");let v=await Z(`/${u.toLowerCase()}`);if(typeof v.id!="string")throw new te("bad_response","The server sent an unexpected response.");return{id:v.id,created_at:String(v.created_at??""),updated_at:String(v.updated_at??""),messages:(Array.isArray(v.messages)?v.messages:[]).filter(k=>(k?.role==="user"||k?.role==="assistant")&&typeof k.text=="string")}};return{async send(u){let v=K(u);v&&(be(),Se(),await de(v))},enqueue(u){let v=K(u);if(!v||w.length>=Fr)return!1;let k=++P;return x||A?(w.push({id:k,text:v}),ne()):de(v,k),!0},removeQueued(u){ze(u)&&ne()},editQueued(u,v){let k=w.find(D=>D.id===u);if(!k)return;let H=K(v);H?k.text=H:ze(u),ne()},async sendQueuedNow(u){let v=ze(u);v&&(be(),A=!1,ne(),await de(v.text,v.id))},clearQueue(){S++,w.length&&(w=[],ne())},async resumeQueue(){if(!A)return;A=!1;let u=x?void 0:w.shift();ne(),u&&await de(u.text,u.id)},reset:pe,async listConversations(){if(!l)throw new te("identity_required","The conversation history needs a verified visitor identity.");let u=await Z("");return(Array.isArray(u.conversations)?u.conversations:[]).filter(v=>typeof v?.id=="string"&&typeof v.title=="string")},loadConversation:ue,async openConversation(u){if(!yn.test(u))throw new te("bad_request","The conversation id must be a UUID.");return Ne(u.toLowerCase()),ue(u)},async greet(u={}){if(x)return"greeting_not_allowed";let v=new AbortController;x=v;let k=u.lang??e.lang,H=(u.title??(typeof document<"u"?document.title:"")).slice(0,Ee.greetTitle),D;try{D=await Te({greet:!0,...k&&Jr.test(k)?{lang:k}:{},...H?{title:H}:{}},v.signal)}finally{x===v&&(x=null)}let O=x||A?void 0:w.shift();return O&&(ne(),await de(O.text,O.id)),D==="done"||D==="greeting_disabled"||D==="greeting_not_allowed"?D:"failed"},abort(){be(),Se()},identify(u){let v=u?Ut(u.email,u.hash):null;v?.email===l?.email&&v?.hash===l?.hash||(l=v,pe())},async getConfig(){try{let u=await s(`${o}${gi}?key=${encodeURIComponent(e.key)}`,{headers:{"x-espejo-key":e.key},credentials:"omit"});if(u.status===404)return{enabled:!1,allowed_actions:[],theme:"auto",name:null,icon:null,accent_color:null,greeting_mode:"default",greeting_text:null,history_enabled:!1,sections:[]};if(!u.ok)return null;let v=await u.json(),k=v.enabled===!0,H=v.greeting_mode==="custom"||v.greeting_mode==="agent"?v.greeting_mode:"default",D=Array.isArray(v.sections)?$r.filter(O=>v.sections.includes(O)&&(O!=="support"||k)).sort((O,B)=>v.sections.indexOf(O)-v.sections.indexOf(B)):k?["support"]:[];return{enabled:k,allowed_actions:Array.isArray(v.allowed_actions)?Ht.filter(O=>v.allowed_actions.includes(O)):[],theme:v.theme==="light"||v.theme==="dark"?v.theme:"auto",name:typeof v.name=="string"&&v.name?v.name:null,icon:typeof v.icon=="string"&&v.icon?v.icon:null,sticky_container_id:v.sticky_container_id??null,accent_color:typeof v.accent_color=="string"&&mi.test(v.accent_color)?v.accent_color.toLowerCase():null,greeting_mode:H,greeting_text:H==="custom"&&typeof v.greeting_text=="string"&&v.greeting_text?v.greeting_text:null,history_enabled:v.history_enabled===!0,sections:D}}catch{return null}},destroy(){be(),S++,w=[],A=!1,j(),q()},get conversationId(){return h},get busy(){return x!==null},get queue(){return w.map(u=>({...u}))},get paused(){return A}}}var Wt=class extends Error{constructor(n,r){super(r);this.code=n}};async function jr(e,o){let n=[],r=null,s=m=>{let h="message",x=[];for(let A of m.split(`
|
|
3
|
+
`))A.startsWith("event:")?h=A.slice(6).trim():A.startsWith("data:")&&x.push(A.slice(5).replace(/^ /,""));if(!x.length)return;let w;try{w=JSON.parse(x.join(`
|
|
4
|
+
`))}catch{return}if(h==="text"&&typeof w.delta=="string")o({type:"text",delta:w.delta});else if(h==="tool_call"&&typeof w.id=="string"&&typeof w.name=="string"){let A=w.input&&typeof w.input=="object"?w.input:{};n.push({id:w.id,name:w.name,input:A})}else if(h==="done")r={awaiting:w.awaiting_tools===!0};else if(h==="error"){let A=typeof w.code=="string"?w.code:"internal";throw new Wt(A,typeof w.message=="string"?w.message:A)}},a="",c=m=>{a+=m;let h=a.endsWith("\r");a=(h?a.slice(0,-1):a).replace(/\r\n?/g,`
|
|
5
|
+
`)+(h?"\r":"");let x;for(;(x=a.indexOf(`
|
|
6
6
|
|
|
7
|
-
`))>=0;){let
|
|
8
|
-
`),
|
|
7
|
+
`))>=0;){let w=a.slice(0,x);a=a.slice(x+2),s(w)}},l=e.body?.getReader();if(l){let m=new TextDecoder;for(;;){let{done:h,value:x}=await l.read();if(h)break;c(m.decode(x,{stream:!0}))}c(m.decode())}else c(await e.text());a=a.replace(/\r/g,`
|
|
8
|
+
`),a.trim()&&s(a);let d=r;if(!d)throw new Wt("network","The connection closed before the answer finished.");return{calls:n,awaiting:d.awaiting}}async function ki(e){let o={};try{o=await e.json()}catch{}let n=typeof o.message=="string"?o.message:`HTTP ${e.status}`,r=o.code;if(e.status===404)return new te(r==="history_disabled"||r==="conversation_not_found"?r:"no_agent",n);if(e.status===401&&r==="identity_required")return new te(r,n);if(e.status===403||e.status===401)return new te("forbidden",n);if(e.status===409){let s=r==="conversation_limit"||r==="conversation_expired"||r==="conversation_busy"||r==="identity_changed"||r==="greeting_disabled"||r==="greeting_not_allowed";return new te(s?r:"conflict",n)}if(e.status===429){if(r==="daily_cap")return new te("daily_cap",n);let s=Number(o.retry_after??e.headers.get("retry-after"));return new te("rate_limited",n,Number.isFinite(s)&&s>0?s:void 0)}return e.status>=500?new te("unavailable",n):new te("bad_request",n)}function Vr(e,o){let n=String(e.type);if(n==="navigate"){let d=typeof e.url=="string"?e.url:"",m=d;try{m=new URL(d,location.href).href}catch{}return{label:`navigate to ${m||"?"}`,...m?{destination:m}:{}}}let r=typeof e.ref=="string"?e.ref:"",s=/^e\d+$/.test(r)?new RegExp(`"([^"\\n]*)" ref=${r}(?!\\d)`).exec(o):null,a=s?.[1]||void 0,c=n==="fill"&&typeof e.value=="string"?e.value:void 0,l=`${n} ${s?.[1]?`"${s[1]}"`:r||"?"}`;return c!==void 0&&(l+=` with "${c}"`),{label:l,...a?{target:a}:{},...c!==void 0?{value:c}:{}}}function Yn(e,o){let r=yi({snapshot:()=>{let s=o??globalThis.espejo;return s&&typeof s.snapshot=="function"?s.snapshot():null}});return r.policy({allow:e??[...Ht]}),r}function Ur(e){let n=(e??globalThis.espejo)?.lastReportId;return typeof n=="string"&&/^[0-9a-f]{32}$/.test(n)?n:null}function Wr(e){let o=3735928559,n=1103547991;for(let r=0;r<e.length;r++){let s=e.charCodeAt(r);o=Math.imul(o^s,2654435761),n=Math.imul(n^s,1597334677)}return o=Math.imul(o^o>>>16,2246822507)^Math.imul(n^n>>>13,3266489909),n=Math.imul(n^n>>>16,2246822507)^Math.imul(o^o>>>13,3266489909),(4294967296*(2097151&n)+(o>>>0)).toString(36)}function Kr(e,o){return new Promise(n=>{let r=setTimeout(n,e);o.addEventListener("abort",()=>{clearTimeout(r),n()},{once:!0})})}function Qr(){try{return typeof sessionStorage<"u"?sessionStorage:null}catch{return null}}function Yr(e,o){try{let n=e?.getItem(o);return n&&yn.test(n)?n:null}catch{return null}}var yn=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i,Jr=/^[A-Za-z0-9-]{2,10}$/;function Ci(){let e=globalThis.crypto;if(e&&typeof e.randomUUID=="function")return e.randomUUID();let o=new Uint8Array(16);if(e&&typeof e.getRandomValues=="function")e.getRandomValues(o);else for(let r=0;r<16;r++)o[r]=Math.floor(Math.random()*256);o[6]=o[6]&15|64,o[8]=o[8]&63|128;let n=Array.from(o,r=>r.toString(16).padStart(2,"0")).join("");return`${n.slice(0,8)}-${n.slice(8,12)}-${n.slice(12,16)}-${n.slice(16,20)}-${n.slice(20)}`}var Xn=[255,255,255],Zr=[0,0,0],Xr=Xn,ea=[24,26,30],Ei="#14161c",Ai=4.5,Ti="ec-accent";function Mi(e){return/^#[0-9a-f]{6}$/i.test(e)?[1,3,5].map(o=>parseInt(e.slice(o,o+2),16)):null}var Jn=e=>`#${e.map(o=>Math.round(o).toString(16).padStart(2,"0")).join("")}`,Zn=(e,o,n)=>e.map((r,s)=>Math.round(r*n+o[s]*(1-n)));function Si(e){let[o,n,r]=e.map(s=>{let a=s/255;return a<=.03928?a/12.92:((a+.055)/1.055)**2.4});return .2126*o+.7152*n+.0722*r}function kn(e,o){let[n,r]=[Si(e),Si(o)].sort((s,a)=>a-s);return(n+.05)/(r+.05)}var ta=e=>kn(e,Xn)>=kn(e,Mi(Ei))?"#ffffff":Ei;function Li(e,o,n,r,s){let a=d=>Zn(d,o,r),c=d=>kn(d,o)>=Ai&&kn(d,a(d))>=Ai,l=e;for(let d=.05;!c(l)&&d<=1;d+=.05)l=Zn(n,e,d);return{accent:Jn(l),onAccent:ta(l),tint:Jn(a(l)),line:Jn(Zn(l,o,s))}}function na(e){let o=Mi(e);return o?{light:Li(o,Xr,Zr,.1,.24),dark:Li(o,ea,Xn,.12,.25)}:null}function eo(e,o,n){let r=o?na(o):null,s=e.getElementById(Ti);if(!r){s?.remove();return}s||(s=e.ownerDocument.createElement("style"),s.id=Ti,e.appendChild(s)),s.textContent=`:host{${n(r.light)}}:host([data-theme="dark"]){${n(r.dark)}}`}var oa=e=>`--c-accent:${e.accent};--c-on-accent:${e.onAccent};--c-accent-tint:${e.tint};--c-accent-line:${e.line};--c-trigger:${e.accent};--c-on-trigger:${e.onAccent};`;function Ri(e,o){eo(e,o,oa)}function vt(e){if(typeof e!="string"||!/^https:\/\//i.test(e.trim()))return null;try{let o=new URL(e.trim());return o.protocol==="https:"?o.href:null}catch{return null}}var _t=e=>typeof e=="string"&&e?e:null;function to(e){let o=e,n=_t(o?.id),r=_t(o?.title);return!n||!r?null:{id:n,title:r,description:_t(o.description),url:vt(o.url)}}function no(e){let o=e;return{slug:_t(o?.slug)??"",title:_t(o?.title)??""}}function Hi(e){let o=(e.baseUrl||Kt).replace(/\/+$/,""),n=e.fetch??((d,m)=>globalThis.fetch(d,m)),r=null,s=null,a=new Map,c=async(d,m)=>{try{let h=await n(`${o}${d}`,{headers:{"x-espejo-key":e.key},credentials:"omit",signal:m});if(h.status===404)return 404;if(!h.ok)return null;let x=await h.json();return x&&typeof x=="object"?x:null}catch{return null}},l=async()=>{let d=await c(bn.list);if(d===404)return{status:"hidden"};if(!d||!Array.isArray(d.collections))return r=null,{status:"error"};let m=d.collections.flatMap(x=>{let w=no(x),A=x.articles,P=Array.isArray(A)?A.map(to).filter(S=>!!S):[];return w.title&&P.length?[{...w,articles:P}]:[]}),h=Array.isArray(d.popular)?d.popular.filter(x=>typeof x=="string").slice(0,ht.popular):[];return s={render:d.render==="link"?"link":"native",collections:m,popular:h},{status:"ready",data:s}};return{list(){return r??=l()},peek:()=>s,async search(d,m){let h=await c(`${bn.search}?q=${encodeURIComponent(d.slice(0,ht.query))}`,m);return!h||h===404||!Array.isArray(h.results)||m.aborted?null:h.results.slice(0,ht.results).flatMap(x=>{let w=to(x),A=x;return w?[{...w,collection:no(A.collection),snippet:_t(A.snippet)??""}]:[]})},async article(d){let m=a.get(d);if(m)return{status:"ready",data:m};let h=await c(bn.article(d)),x=h===404?null:h,w=to(x);if(!w||typeof x.markdown!="string")return{status:"error"};let A={...w,collection:no(x.collection),markdown:x.markdown};return a.set(d,A),{status:"ready",data:A}}}}var Ii=/^\s{0,3}(`{3,}|~{3,})/,qi=/^\s{0,3}(#{1,6})\s+(.*?)(?:\s+#+)?\s*$/,Di=/^\s{0,3}([-*_])(?:\s*\1){2,}\s*$/,oo=/^\s{0,3}>\s?(.*)$/,Qt=/^(\s*)(?:([-*+])|(\d{1,9})[.)])\s+(.*)$/,ia=/^\s*\|?\s*:?-{3,}:?\s*(?:\|\s*:?-{3,}:?\s*)*\|?\s*$/,ra=4,Gi=e=>Ii.test(e)||qi.test(e)||Di.test(e)||oo.test(e)||Qt.test(e),_i=e=>e.trim().replace(/^\|/,"").replace(/\|$/,"").split("|").map(o=>o.trim());function aa(e){let o=[],n=e.replace(/\r\n?/g,`
|
|
9
9
|
`).split(`
|
|
10
|
-
`),
|
|
11
|
-
`)});continue}let
|
|
12
|
-
`)});continue}if(a.includes("|")&&fo.test(t[o+1]??"")){let l=si(a),g=[];for(o+=2;o<t.length&&t[o].includes("|")&&t[o].trim();o++)g.push(si(t[o]));i.push({kind:"table",head:l,rows:g});continue}if(ht.test(a)){let l=mo(t,o);o=l.next,i.push({kind:"list",list:l.list});continue}let d=[];for(;o<t.length&&t[o].trim()&&!(d.length&&fi(t[o]));)d.push(t[o++]);i.push({kind:"p",lines:d})}return i}function mo(e,i){let t=ht.exec(e[i]),o={ordered:!t[2],start:t[3]?Number(t[3]):1,items:[]},a=i,r=null;for(;a<e.length;){let s=e[a],d=ht.exec(s);if(d&&d[1].length<2&&!d[2]!==o.ordered)break;if(d){let l=o.items[o.items.length-1];d[1].length>=2&&l?(l.sub??={ordered:!d[2],start:d[3]?Number(d[3]):1,items:[]},l.sub.items.push(r={text:d[4],sub:null})):o.items.push(r={text:d[4],sub:null}),a++}else if(s.trim())if(!fi(s)&&r)r.text+=` ${s.trim()}`,a++;else break;else{let l=a;for(;l<e.length&&!e[l].trim();)l++;if(l<e.length&&ht.test(e[l]))a=l;else break}}return{list:o,next:a}}var vo=/\\([\\`*_[\]()#+\-.!|>])|`([^`\n]+)`|\[!\[([^[\]\n]*)\]\(([^()\s]*)(?:\s+"[^"\n]*")?\)\]\(([^()\s]*)(?:\s+"[^"\n]*")?\)|!\[([^[\]\n]*)\]\(([^()\s]*)(?:\s+"[^"\n]*")?\)|\[([^[\]\n]+)\]\(([^()\s]*)(?:\s+"[^"\n]*")?\)|\*\*(?=\S)((?:[^*]|\*(?!\*))*?\S)\*\*|__(?=\S)((?:[^_]|_(?!_))*?\S)__|\*(?=[^\s*])([^*\n]*?[^\s*])\*|_(?=[^\s_])([^_\n]*?[^\s_])_/;function ci(e,i,t,o){let a=Ve(o);if(!a){(t||o)&&i.appendChild(e.createTextNode(t||o));return}let r=e.createElement("img");r.alt=t,r.referrerPolicy="no-referrer",r.loading="lazy",r.decoding="async",r.src=a,i.appendChild(r)}function li(e,i,t){let o=e.createElement("a");return o.href=t,o.target="_blank",o.rel="noopener noreferrer",i.appendChild(o)}function He(e,i,t){let o=r=>{r&&i.appendChild(e.createTextNode(r))},a=t;for(let r;r=vo.exec(a);){let s=r.index,d=a[s+r[0].length]??"";if(r[0][0]==="_"&&(/\w/.test(a[s-1]??"")||/\w/.test(d))){o(a.slice(0,s+1)),a=a.slice(s+1);continue}if(o(a.slice(0,s)),r[1]!==void 0)o(r[1]);else if(r[2]!==void 0)i.appendChild(e.createElement("code")).textContent=r[2];else if(r[5]!==void 0){let l=Ve(r[5]);ci(e,l?li(e,i,l):i,r[3],r[4])}else if(r[7]!==void 0)ci(e,i,r[6],r[7]);else if(r[8]!==void 0){let l=Ve(r[9]);l?He(e,li(e,i,l),r[8]):(He(e,i,r[8]),r[9]&&r[9]!==r[8]&&o(` (${r[9]})`))}else r[10]!==void 0||r[11]!==void 0?He(e,i.appendChild(e.createElement("strong")),r[10]??r[11]):He(e,i.appendChild(e.createElement("em")),r[12]??r[13]);a=a.slice(s+r[0].length)}o(a)}function hi(e,i){let t=e.createElement(i.ordered?"ol":"ul");i.ordered&&i.start!==1&&t.setAttribute("start",String(i.start));for(let o of i.items){let a=t.appendChild(e.createElement("li"));He(e,a,o.text),o.sub&&a.appendChild(hi(e,o.sub))}return t}function gi(e,i,t){let o=e.createDocumentFragment();for(let a of go(i))if(a.kind==="code")o.appendChild(e.createElement("pre")).appendChild(e.createElement("code")).textContent=a.text;else if(a.kind==="h")He(e,o.appendChild(e.createElement(`h${a.level}`)),a.text);else if(a.kind==="hr")o.appendChild(e.createElement("hr"));else if(a.kind==="quote"){let r=o.appendChild(e.createElement("blockquote"));t<ho?r.appendChild(gi(e,a.src,t+1)):r.textContent=a.src}else if(a.kind==="list")o.appendChild(hi(e,a.list));else if(a.kind==="table"){let r=o.appendChild(e.createElement("div"));r.className="ec-table";let s=r.appendChild(e.createElement("table")),d=s.appendChild(e.createElement("thead")).appendChild(e.createElement("tr"));for(let g of a.head)He(e,d.appendChild(e.createElement("th")),g);let l=s.appendChild(e.createElement("tbody"));for(let g of a.rows){let f=l.appendChild(e.createElement("tr"));a.head.forEach((x,v)=>He(e,f.appendChild(e.createElement("td")),g[v]??""))}}else{let r=o.appendChild(e.createElement("p"));a.lines.forEach((s,d)=>{d&&r.appendChild(/( {2,}|\\)$/.test(a.lines[d-1])?e.createElement("br"):e.createTextNode(" ")),He(e,r,s.trim().replace(/\\$/,""))})}return o}function mi(e,i,t){i.replaceChildren(gi(e,t,0))}var bo={chat:"M21 12a8 8 0 0 1-11.6 7.1L4 20l1-4.6A8 8 0 1 1 21 12z",sparkles:"M11 3l1.9 5.1L18 10l-5.1 1.9L11 17l-1.9-5.1L4 10l5.1-1.9zM19 15l.9 2.1L22 18l-2.1.9L19 21l-.9-2.1L16 18l2.1-.9z",headset:"M4 15v-3a8 8 0 0 1 16 0v3M4 14h3v6H5a1 1 0 0 1-1-1zM20 14h-3v6h2a1 1 0 0 0 1-1z",bot:"M6 9h12a2 2 0 0 1 2 2v7a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2zM12 9V5M12 4h.01M9.5 14h.01M14.5 14h.01",help:"M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18zM9.6 9.2a2.5 2.5 0 1 1 3.4 2.3c-.6.3-1 .8-1 1.5v.5M12 17h.01",close:"M6 6l12 12M18 6L6 18",restart:"M4 12a8 8 0 1 0 2.4-5.7L4 8.6M4 4v4.6h4.6",sliders:"M4 7h9M17 7h3M4 17h3M11 17h9M15 5v4M9 15v4",up:"M12 19V5M6 11l6-6 6 6",check:"M5 12.5l4.5 4.5L19 7.5",chevron:"M9 6l6 6-6 6",minus:"M7 12h10",highlight:"M12 20a8 8 0 1 0 0-16 8 8 0 0 0 0 16zM12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6z",scroll_to:"M12 4v16M8 8l4-4 4 4M8 16l4 4 4-4",click:"M6 3l13 7-5.5 1.8L11.7 17z",fill:"M4 20h4L19 9l-4-4L4 16zM13 7l4 4",navigate:"M5 12h14M13 6l6 6-6 6",home:"M4 10.5L12 4l8 6.5V19a1 1 0 0 1-1 1h-4.5v-5.5h-5V20H5a1 1 0 0 1-1-1z",book:"M5 19.5V5.5A2.5 2.5 0 0 1 7.5 3H19v14H7.5A2.5 2.5 0 0 0 5 19.5zM5 19.5A2.5 2.5 0 0 0 7.5 22H19v-5",search:"M11 18a7 7 0 1 0 0-14 7 7 0 0 0 0 14zM20 20l-4-4",back:"M15 6l-6 6 6 6",ticket:"M3 9a3 3 0 0 1 0 6v2a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-2a3 3 0 0 1 0-6V7a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2zM14 5v2M14 11v2M14 17v2",video:"M4 6h10a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2zM16 10.5l6-3.5v10l-6-3.5"};function te(e,i,t=16){let o="http://www.w3.org/2000/svg",a=e.createElementNS(o,"svg");for(let[r,s]of Object.entries({width:t,height:t,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"}))a.setAttribute(r,String(s));return a.appendChild(e.createElementNS(o,"path")).setAttribute("d",bo[i]),a}function vi(e){return e==="chat"||e==="sparkles"||e==="headset"||e==="bot"||e==="help"}function w(e,i,t="",o){let a=e.createElement(i);return t&&(a.className=t),o!==void 0&&(a.textContent=o),a}function ne(e,i,t){let o=w(e,"button",i,t);return o.type="button",o}function Ce(e,i,t,o){let a=te(e,i,t);return o&&a.setAttribute("class",o),a}function Mt(e,i,t,o){let a=ne(e,"ec-row"),r=a.appendChild(w(e,"span","ec-row-main"));return o&&r.appendChild(w(e,"span","ec-row-aside",o)),r.appendChild(w(e,"span","ec-row-title",i)),t&&r.appendChild(w(e,"span","ec-row-sub",t)),a.appendChild(Ce(e,"chevron",14,"ec-chev")),a}function ie(e,i,t){let o=w(e,"div","ec-note");return o.appendChild(w(e,"p","",i)),t&&o.appendChild(ne(e,"ec-btn",t.label)).addEventListener("click",t.run),o}function bi(e){let{doc:i,TEXT:t,root:o}=e,a=new Map,r="",s=ne(i,"ec-back");s.append(Ce(i,"back",14),i.createTextNode(t.tabGuides)),s.setAttribute("aria-label",t.backToGuides),s.addEventListener("click",e.back);let d=w(i,"p","ec-kicker"),l=w(i,"h2","ec-h"),g=w(i,"div","ec-doc"),f=w(i,"div","ec-vote");f.setAttribute("aria-live","polite"),o.append(s,d,l,g,f);let x=(m,A)=>{let C=a.get(m);if(C===void 0){let O=ne(i,"ec-btn",t.voteYes),B=ne(i,"ec-btn",t.voteNo),H=I=>()=>{a.set(m,I),x(m,!0)};O.addEventListener("click",H(!0)),B.addEventListener("click",H(!1));let N=w(i,"div","ec-actions");N.append(O,B),f.replaceChildren(w(i,"p","",t.voteQuestion),N);return}let W=!C&&e.hasSupport(),P=w(i,"p","",C?t.voteThanks:W?t.voteSorryAssist:t.voteSorry);P.tabIndex=-1,f.replaceChildren(P);let z=P;W&&(z=f.appendChild(ne(i,"ec-btn",t.askTitle)),z.setAttribute("data-primary",""),z.addEventListener("click",e.openSupport)),A&&z.focus()},v=m=>{f.replaceChildren(),g.replaceChildren(ie(i,t.articleLoading)),e.source.article(m).then(A=>{if(r!==m)return;if(A.status!=="ready"){g.replaceChildren(ie(i,t.articleError,{label:t.retry,run:()=>v(m)}));return}let{data:C}=A;C.collection.title&&(d.textContent=C.collection.title),d.hidden=!d.textContent,l.textContent=C.title,mi(i,g,C.markdown);let W=Ve(C.url);if(W){let P=g.appendChild(w(i,"p")).appendChild(w(i,"a","",t.openFullPage));P.href=W,P.target="_blank",P.rel="noopener noreferrer",P.appendChild(w(i,"span","ec-sr",` ${t.newTab}`))}x(m,!1)})};return{show(m,A){r=m.id,d.textContent=A,d.hidden=!A,l.textContent=m.title,o.scrollTop=0,v(m.id),s.focus()}}}var xo=300,yo=2;function tn(e,i,t,o,a,r,s){let d=Mt(e,o.title,a,s);return d.setAttribute("data-guide",o.id),t.peek()?.render==="link"&&o.url&&d.appendChild(w(e,"span","ec-sr",i.newTab)),d.addEventListener("click",r),d}var xi=e=>e.normalize("NFD").replace(/[̀-ͯ]/g,"").toLowerCase();function yi(e){let{doc:i,TEXT:t,root:o}=e,a=w(i,"label","ec-search");a.appendChild(Ce(i,"search",16));let r=a.appendChild(w(i,"input"));r.type="search",r.placeholder=t.searchGuides,r.setAttribute("aria-label",t.searchGuides),r.maxLength=je.query,r.autocomplete="off";let s=w(i,"div","ec-stack");o.append(w(i,"h2","ec-h",t.tabGuides),a,s);let d=null,l="",g=null,f,x=null,v=(P,z,O,B)=>tn(i,t,e.source,P,O,()=>e.openGuide(P,z),B),m=()=>{if(!d)return;if(d.status!=="ready"){d.status==="error"&&s.replaceChildren(ie(i,t.guidesError,{label:t.retry,run:A}));return}let{collections:P}=d.data;if(!l){s.replaceChildren(...P.length?P.map(N=>{let I=w(i,"section","ec-box"),K=I.appendChild(w(i,"div","ec-box-head")),oe=N.articles.length;K.append(w(i,"h3","ec-box-title",N.title),w(i,"span","ec-muted",oe===1?t.guidesCountOne:t.guidesCount.replace("{n}",String(oe))));let Ee=I.appendChild(w(i,"div","ec-list"));for(let de of N.articles)Ee.appendChild(v(de,N.title,de.description));return I}):[ie(i,t.guidesEmpty)]);return}let z=xi(l).split(/\s+/).filter(Boolean),O=new Map((g??[]).map(N=>[N.id,N])),B=P.flatMap(N=>N.articles.filter(I=>{let K=xi(`${I.title} ${I.description??""}`);return z.every(oe=>K.includes(oe))}).map(I=>{let K=O.get(I.id);return O.delete(I.id),v(I,N.title,K?K.snippet||K.description:I.description,N.title)}));for(let N of O.values())B.push(v(N,N.collection.title,N.snippet||N.description,N.collection.title));if(B.length){let N=w(i,"div","ec-list");N.append(...B),s.replaceChildren(N);return}let H=ie(i,t.guidesNoMatch);e.hasSupport()&&H.appendChild(ne(i,"ec-btn",t.askInstead)).addEventListener("click",e.openSupport),s.replaceChildren(H)};function A(){if(d?.status==="ready")return m();s.replaceChildren(ie(i,t.guidesLoading)),e.source.list().then(P=>{d=P,P.status==="hidden"?e.onHidden():m()})}let C=async P=>{x?.abort();let z=x=new AbortController,O=await e.source.search(P,z.signal);z.signal.aborted||P!==l||!O||(g=O,m())},W=()=>{if(l=r.value.trim().slice(0,je.query),g=null,x?.abort(),clearTimeout(f),m(),l.length>=yo){let P=l;f=setTimeout(()=>{C(P)},xo)}};return r.addEventListener("input",W),{show(P){A(),P&&r.focus()},focusGuide(P){let z=Array.from(s.querySelectorAll("[data-guide]")).find(O=>O.getAttribute("data-guide")===P);return z?.focus(),!!z},destroy(){clearTimeout(f),x?.abort()}}}var ki=["all","open","resolved"];function ko(e,i,t){let[o,a]=t.status==="you"?[i.statusYou,"accent"]:t.status==="resolved"?[i.statusResolved,"good"]:[i.statusTeam,"warn"],r=w(e,"span","ec-pill",o);return r.setAttribute("data-tone",a),r}function nn(e,i,t,o){let a=w(e,o,"ec-ticket");o==="button"&&(a.type="button");let r=a.appendChild(w(e,"span","ec-tmeta"));r.append(w(e,"span","ec-mono",t.key),ko(e,i,t));let s=Date.parse(t.updated_at);return s&&r.append(w(e,"span","ec-muted",on(i,s))),a.append(w(e,"span","ec-row-title",t.title)),t.last_message&&a.append(w(e,"span","ec-row-sub",t.last_message.excerpt)),t.has_recording&&a.appendChild(w(e,"span","ec-tfoot")).append(Ce(e,"video",14),w(e,"span","",i.recordingAttached)),a}function wi(e){let{doc:i,TEXT:t,root:o}=e,a=w(i,"div","ec-box-head"),r=ne(i,"ec-btn",t.reportProblem);r.addEventListener("click",e.report),a.append(w(i,"h2","ec-h",t.tabTickets),r);let s=w(i,"div","ec-filters");s.setAttribute("role","group"),s.setAttribute("aria-label",t.ticketsFilter);let d=w(i,"div","ec-stack");o.append(a,s,d);let l="all",g=0,f={all:t.filterAll,open:t.filterOpen,resolved:t.filterResolved},x=ki.map(A=>{let C=s.appendChild(ne(i,"ec-filter",f[A]));return C.addEventListener("click",()=>{l=A,m()}),C}),v=A=>{if(A.status==="hidden"||A.status==="denied")return e.onGone(A.status);if(A.status==="error"){d.replaceChildren(ie(i,t.ticketsError,{label:t.retry,run:m}));return}let{tickets:C}=A.data;d.replaceChildren(...C.length?C.map(W=>nn(i,t,W,"article")):[ie(i,t.ticketsEmpty)])};function m(){ki.forEach((C,W)=>x[W].setAttribute("aria-pressed",String(C===l)));let A=++g;d.replaceChildren(ie(i,t.ticketsLoading)),e.source.list(l).then(C=>{A===g&&v(C)})}return{show(A){r.hidden=!e.canReport(),m(),A&&(r.hidden?x[0]:r).focus()},reset(){g++,d.replaceChildren()}}}function on(e,i){let t=Math.floor((Date.now()-i)/6e4);if(t<1)return e.agoNow;if(t<60)return e.agoMinutes.replace("{n}",String(t));let o=Math.floor(t/60);return o<24?e.agoHours.replace("{n}",String(o)):e.agoDays.replace("{n}",String(Math.floor(o/24)))}function Ci(e){let{doc:i,TEXT:t}=e,o=w(i,"h2","ec-hello");o.append(w(i,"span","",t.hello),w(i,"span","",t.helpPrompt));let a=[o];if(e.support){let r=w(i,"section","ec-box"),s=ne(i,"ec-fake");if(s.append(w(i,"span","",t.placeholder),Ce(i,"up",14,"ec-fake-go")),s.setAttribute("aria-label",t.askTitle),s.addEventListener("click",e.openSupport),r.append(w(i,"h3","ec-box-title",t.askTitle),w(i,"p","ec-box-sub",t.askHint),s),a.push(r),e.last){let d=w(i,"section","ec-box"),l=Mt(i,e.last.text,on(t,e.last.at));l.addEventListener("click",e.openSupport),d.append(w(i,"h3","ec-box-title",t.continueTitle),l),a.push(d)}}if(e.tickets){let r=w(i,"div","ec-stack");a.push(r),e.tickets.list("all").then(s=>{if(!r.isConnected)return;if(s.status==="hidden"||s.status==="denied")return e.onTicketsGone(s.status);let d=s.status==="ready"&&s.data.tickets.find(g=>g.status!=="resolved");if(!d)return r.remove();let l=nn(i,t,d,"button");l.addEventListener("click",e.openTickets),r.className="ec-box",r.append(w(i,"h3","ec-box-title",t.openTicket),l)})}if(e.guides){let r=w(i,"section","ec-box"),s=ne(i,"ec-fake");s.append(Ce(i,"search",16),w(i,"span","",t.searchGuides)),s.addEventListener("click",e.searchGuides);let d=w(i,"div","ec-stack");r.append(s,d),a.push(r);let l=()=>{d.replaceChildren(ie(i,t.guidesLoading)),e.source.list().then(g=>{if(!d.isConnected)return;if(g.status==="hidden")return e.onHidden();if(g.status==="error"){d.replaceChildren(ie(i,t.guidesError,{label:t.retry,run:l}));return}let f=g.data.popular.flatMap(v=>{for(let m of g.data.collections){let A=m.articles.find(C=>C.id===v);if(A)return[tn(i,t,e.source,A,A.description,()=>e.openGuide(A,m.title))]}return[]});if(d.replaceChildren(),!f.length)return;let x=w(i,"div","ec-list");x.append(...f),d.append(w(i,"h3","ec-box-title",t.popularGuides),x)})};e.root.replaceChildren(...a),l()}else e.root.replaceChildren(...a)}var wo=/^\s*(`{3,})/,Co=/^\s*(`{3,})\s*$/,Eo=/^\s*[-*+]\s+(.*)$/,To=/^\s*(\d{1,9})[.)]\s+(.*)$/,Ao=/^\s*#{1,6}\s+(.*)$/;function So(e){let i=[],t=e.replace(/\r\n?/g,`
|
|
10
|
+
`),r=0;for(;r<n.length;){let s=n[r];if(!s.trim()){r++;continue}let a=Ii.exec(s);if(a){let d=a[1],m=[];for(;++r<n.length&&!new RegExp(`^\\s{0,3}${d[0]==="`"?"`":"~"}{${d.length},}\\s*$`).test(n[r]);)m.push(n[r]);r++,o.push({kind:"code",text:m.join(`
|
|
11
|
+
`)});continue}let c=qi.exec(s);if(c){o.push({kind:"h",level:Math.min(c[1].length,4),text:c[2]}),r++;continue}if(Di.test(s)){o.push({kind:"hr"}),r++;continue}if(oo.test(s)){let d=[];for(let m;r<n.length&&(m=oo.exec(n[r]));r++)d.push(m[1]);o.push({kind:"quote",src:d.join(`
|
|
12
|
+
`)});continue}if(s.includes("|")&&ia.test(n[r+1]??"")){let d=_i(s),m=[];for(r+=2;r<n.length&&n[r].includes("|")&&n[r].trim();r++)m.push(_i(n[r]));o.push({kind:"table",head:d,rows:m});continue}if(Qt.test(s)){let d=sa(n,r);r=d.next,o.push({kind:"list",list:d.list});continue}let l=[];for(;r<n.length&&n[r].trim()&&!(l.length&&Gi(n[r]));)l.push(n[r++]);o.push({kind:"p",lines:l})}return o}function sa(e,o){let n=Qt.exec(e[o]),r={ordered:!n[2],start:n[3]?Number(n[3]):1,items:[]},s=o,a=null;for(;s<e.length;){let c=e[s],l=Qt.exec(c);if(l&&l[1].length<2&&!l[2]!==r.ordered)break;if(l){let d=r.items[r.items.length-1];l[1].length>=2&&d?(d.sub??={ordered:!l[2],start:l[3]?Number(l[3]):1,items:[]},d.sub.items.push(a={text:l[4],sub:null})):r.items.push(a={text:l[4],sub:null}),s++}else if(c.trim())if(!Gi(c)&&a)a.text+=` ${c.trim()}`,s++;else break;else{let d=s;for(;d<e.length&&!e[d].trim();)d++;if(d<e.length&&Qt.test(e[d]))s=d;else break}}return{list:r,next:s}}var ca=/\\([\\`*_[\]()#+\-.!|>])|`([^`\n]+)`|\[!\[([^[\]\n]*)\]\(([^()\s]*)(?:\s+"[^"\n]*")?\)\]\(([^()\s]*)(?:\s+"[^"\n]*")?\)|!\[([^[\]\n]*)\]\(([^()\s]*)(?:\s+"[^"\n]*")?\)|\[([^[\]\n]+)\]\(([^()\s]*)(?:\s+"[^"\n]*")?\)|\*\*(?=\S)((?:[^*]|\*(?!\*))*?\S)\*\*|__(?=\S)((?:[^_]|_(?!_))*?\S)__|\*(?=[^\s*])([^*\n]*?[^\s*])\*|_(?=[^\s_])([^_\n]*?[^\s_])_/;function Pi(e,o,n,r){let s=vt(r);if(!s){(n||r)&&o.appendChild(e.createTextNode(n||r));return}let a=e.createElement("img");a.alt=n,a.referrerPolicy="no-referrer",a.loading="lazy",a.decoding="async",a.src=s,o.appendChild(a)}function Ni(e,o,n){let r=e.createElement("a");return r.href=n,r.target="_blank",r.rel="noopener noreferrer",o.appendChild(r)}function Ke(e,o,n){let r=a=>{a&&o.appendChild(e.createTextNode(a))},s=n;for(let a;a=ca.exec(s);){let c=a.index,l=s[c+a[0].length]??"";if(a[0][0]==="_"&&(/\w/.test(s[c-1]??"")||/\w/.test(l))){r(s.slice(0,c+1)),s=s.slice(c+1);continue}if(r(s.slice(0,c)),a[1]!==void 0)r(a[1]);else if(a[2]!==void 0)o.appendChild(e.createElement("code")).textContent=a[2];else if(a[5]!==void 0){let d=vt(a[5]);Pi(e,d?Ni(e,o,d):o,a[3],a[4])}else if(a[7]!==void 0)Pi(e,o,a[6],a[7]);else if(a[8]!==void 0){let d=vt(a[9]);d?Ke(e,Ni(e,o,d),a[8]):(Ke(e,o,a[8]),a[9]&&a[9]!==a[8]&&r(` (${a[9]})`))}else a[10]!==void 0||a[11]!==void 0?Ke(e,o.appendChild(e.createElement("strong")),a[10]??a[11]):Ke(e,o.appendChild(e.createElement("em")),a[12]??a[13]);s=s.slice(c+a[0].length)}r(s)}function Oi(e,o){let n=e.createElement(o.ordered?"ol":"ul");o.ordered&&o.start!==1&&n.setAttribute("start",String(o.start));for(let r of o.items){let s=n.appendChild(e.createElement("li"));Ke(e,s,r.text),r.sub&&s.appendChild(Oi(e,r.sub))}return n}function $i(e,o,n){let r=e.createDocumentFragment();for(let s of aa(o))if(s.kind==="code")r.appendChild(e.createElement("pre")).appendChild(e.createElement("code")).textContent=s.text;else if(s.kind==="h")Ke(e,r.appendChild(e.createElement(`h${s.level}`)),s.text);else if(s.kind==="hr")r.appendChild(e.createElement("hr"));else if(s.kind==="quote"){let a=r.appendChild(e.createElement("blockquote"));n<ra?a.appendChild($i(e,s.src,n+1)):a.textContent=s.src}else if(s.kind==="list")r.appendChild(Oi(e,s.list));else if(s.kind==="table"){let a=r.appendChild(e.createElement("div"));a.className="ec-table";let c=a.appendChild(e.createElement("table")),l=c.appendChild(e.createElement("thead")).appendChild(e.createElement("tr"));for(let m of s.head)Ke(e,l.appendChild(e.createElement("th")),m);let d=c.appendChild(e.createElement("tbody"));for(let m of s.rows){let h=d.appendChild(e.createElement("tr"));s.head.forEach((x,w)=>Ke(e,h.appendChild(e.createElement("td")),m[w]??""))}}else{let a=r.appendChild(e.createElement("p"));s.lines.forEach((c,l)=>{l&&a.appendChild(/( {2,}|\\)$/.test(s.lines[l-1])?e.createElement("br"):e.createTextNode(" ")),Ke(e,a,c.trim().replace(/\\$/,""))})}return r}function zi(e,o,n){o.replaceChildren($i(e,n,0))}var la={chat:"M21 12a8 8 0 0 1-11.6 7.1L4 20l1-4.6A8 8 0 1 1 21 12z",sparkles:"M11 3l1.9 5.1L18 10l-5.1 1.9L11 17l-1.9-5.1L4 10l5.1-1.9zM19 15l.9 2.1L22 18l-2.1.9L19 21l-.9-2.1L16 18l2.1-.9z",headset:"M4 15v-3a8 8 0 0 1 16 0v3M4 14h3v6H5a1 1 0 0 1-1-1zM20 14h-3v6h2a1 1 0 0 0 1-1z",bot:"M6 9h12a2 2 0 0 1 2 2v7a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2zM12 9V5M12 4h.01M9.5 14h.01M14.5 14h.01",help:"M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18zM9.6 9.2a2.5 2.5 0 1 1 3.4 2.3c-.6.3-1 .8-1 1.5v.5M12 17h.01",close:"M6 6l12 12M18 6L6 18",restart:"M4 12a8 8 0 1 0 2.4-5.7L4 8.6M4 4v4.6h4.6",sliders:"M4 7h9M17 7h3M4 17h3M11 17h9M15 5v4M9 15v4",up:"M12 19V5M6 11l6-6 6 6",check:"M5 12.5l4.5 4.5L19 7.5",chevron:"M9 6l6 6-6 6",minus:"M7 12h10",highlight:"M12 20a8 8 0 1 0 0-16 8 8 0 0 0 0 16zM12 15a3 3 0 1 0 0-6 3 3 0 0 0 0 6z",scroll_to:"M12 4v16M8 8l4-4 4 4M8 16l4 4 4-4",click:"M6 3l13 7-5.5 1.8L11.7 17z",fill:"M4 20h4L19 9l-4-4L4 16zM13 7l4 4",navigate:"M5 12h14M13 6l6 6-6 6",home:"M4 10.5L12 4l8 6.5V19a1 1 0 0 1-1 1h-4.5v-5.5h-5V20H5a1 1 0 0 1-1-1z",book:"M5 19.5V5.5A2.5 2.5 0 0 1 7.5 3H19v14H7.5A2.5 2.5 0 0 0 5 19.5zM5 19.5A2.5 2.5 0 0 0 7.5 22H19v-5",search:"M11 18a7 7 0 1 0 0-14 7 7 0 0 0 0 14zM20 20l-4-4",back:"M15 6l-6 6 6 6",ticket:"M3 9a3 3 0 0 1 0 6v2a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-2a3 3 0 0 1 0-6V7a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2zM14 5v2M14 11v2M14 17v2",video:"M4 6h10a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2zM16 10.5l6-3.5v10l-6-3.5",expand:"M14 4h6v6M20 4l-7 7M10 20H4v-6M4 20l7-7",collapse:"M4 14h6v6M10 14l-7 7M20 10h-6V4M14 10l7-7",dock:"M6 4.5h12A2.5 2.5 0 0 1 20.5 7v10a2.5 2.5 0 0 1-2.5 2.5H6A2.5 2.5 0 0 1 3.5 17V7A2.5 2.5 0 0 1 6 4.5zM14.5 4.5v15",more:"M5.5 12h.01M12 12h.01M18.5 12h.01",copy:"M11.5 9h6a2.5 2.5 0 0 1 2.5 2.5v6a2.5 2.5 0 0 1-2.5 2.5h-6A2.5 2.5 0 0 1 9 17.5v-6A2.5 2.5 0 0 1 11.5 9zM5 15V6a2 2 0 0 1 2-2h9",thumb:"M7 11v9H4.5a1 1 0 0 1-1-1v-7a1 1 0 0 1 1-1zM7 11l4-7.5a2 2 0 0 1 2.2 2.3L12.6 10h5.6a2 2 0 0 1 2 2.4l-1.3 6A2 2 0 0 1 16.9 20H7",alert:"M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18zM12 8v5M12 16.5v.01"};function oe(e,o,n=16){let r="http://www.w3.org/2000/svg",s=e.createElementNS(r,"svg");for(let[a,c]of Object.entries({width:n,height:n,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":2,"stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"}))s.setAttribute(a,String(c));return s.appendChild(e.createElementNS(r,"path")).setAttribute("d",la[o]),s}function Bi(e){return e==="chat"||e==="sparkles"||e==="headset"||e==="bot"||e==="help"}function T(e,o,n="",r){let s=e.createElement(o);return n&&(s.className=n),r!==void 0&&(s.textContent=r),s}function le(e,o,n){let r=T(e,"button",o,n);return r.type="button",r}function Ae(e,o,n,r){let s=oe(e,o,n);return r&&s.setAttribute("class",r),s}function Pt(e,o,n,r){let s=le(e,"ec-row"),a=s.appendChild(T(e,"span","ec-row-main"));return r&&a.appendChild(T(e,"span","ec-row-aside",r)),a.appendChild(T(e,"span","ec-row-title",o)),n&&a.appendChild(T(e,"span","ec-row-sub",n)),s.appendChild(Ae(e,"chevron",14,"ec-chev")),s}function tt(e,o){let n=T(e,"div","ec-skels");n.setAttribute("role","status"),n.setAttribute("aria-label",o),n.setAttribute("aria-busy","true");for(let r of[40,88,64])n.appendChild(T(e,"i","ec-skel")).style.width=`${r}%`;return n}function _e(e,o,n){let r=T(e,"div","ec-note");return r.appendChild(T(e,"p","",o)),n&&r.appendChild(le(e,"ec-btn",n.label)).addEventListener("click",n.run),r}function Fi(e){let{doc:o,TEXT:n,root:r}=e,s=new Map,a="",c=le(o,"ec-back");c.append(Ae(o,"back",14),o.createTextNode(n.tabGuides)),c.setAttribute("aria-label",n.backToGuides),c.addEventListener("click",e.back);let l=T(o,"p","ec-kicker"),d=T(o,"h2","ec-h"),m=T(o,"div","ec-doc"),h=T(o,"div","ec-vote");h.setAttribute("aria-live","polite"),r.append(c,l,d,m,h);let x=(A,P)=>{let S=s.get(A);if(S===void 0){let q=le(o,"ec-btn",n.voteYes),j=le(o,"ec-btn",n.voteNo),V=R=>()=>{s.set(A,R),x(A,!0)};q.addEventListener("click",V(!0)),j.addEventListener("click",V(!1));let I=T(o,"div","ec-actions");I.append(q,j),h.replaceChildren(T(o,"p","",n.voteQuestion),I);return}let G=!S&&e.hasSupport(),L=T(o,"p","",S?n.voteThanks:G?n.voteSorryAssist:n.voteSorry);L.tabIndex=-1,h.replaceChildren(L);let $=L;G&&($=h.appendChild(le(o,"ec-btn",n.askTitle)),$.setAttribute("data-primary",""),$.addEventListener("click",e.openSupport)),P&&$.focus()},w=A=>{h.replaceChildren(),m.replaceChildren(tt(o,n.articleLoading)),e.source.article(A).then(P=>{if(a!==A)return;if(P.status!=="ready"){m.replaceChildren(_e(o,n.articleError,{label:n.retry,run:()=>w(A)}));return}let{data:S}=P;S.collection.title&&(l.textContent=S.collection.title),l.hidden=!l.textContent,d.textContent=S.title,zi(o,m,S.markdown);let G=vt(S.url);if(G){let L=m.appendChild(T(o,"p")).appendChild(T(o,"a","",n.openFullPage));L.href=G,L.target="_blank",L.rel="noopener noreferrer",L.appendChild(T(o,"span","ec-sr",` ${n.newTab}`))}x(A,!1)})};return{show(A,P){a=A.id,l.textContent=P,l.hidden=!P,d.textContent=A.title,r.scrollTop=0,w(A.id),c.focus()}}}var da=300,pa=2;function io(e,o,n,r,s,a,c){let l=Pt(e,r.title,s,c);return l.setAttribute("data-guide",r.id),n.peek()?.render==="link"&&r.url&&l.appendChild(T(e,"span","ec-sr",o.newTab)),l.addEventListener("click",a),l}var ji=e=>e.normalize("NFD").replace(/[̀-ͯ]/g,"").toLowerCase();function Vi(e){let{doc:o,TEXT:n,root:r}=e,s=T(o,"label","ec-search");s.appendChild(Ae(o,"search",16));let a=s.appendChild(T(o,"input"));a.type="search",a.placeholder=n.searchGuides,a.setAttribute("aria-label",n.searchGuides),a.maxLength=ht.query,a.autocomplete="off";let c=T(o,"div","ec-stack");r.append(T(o,"h2","ec-h",n.tabGuides),s,c);let l=null,d="",m=null,h,x=null,w=(L,$,q,j)=>io(o,n,e.source,L,q,()=>e.openGuide(L,$),j),A=()=>{if(!l)return;if(l.status!=="ready"){l.status==="error"&&c.replaceChildren(_e(o,n.guidesError,{label:n.retry,run:P}));return}let{collections:L}=l.data;if(!d){c.replaceChildren(...L.length?L.map(I=>{let R=T(o,"section","ec-box"),re=R.appendChild(T(o,"div","ec-box-head")),ve=I.articles.length;re.append(T(o,"h3","ec-box-title",I.title),T(o,"span","ec-muted",ve===1?n.guidesCountOne:n.guidesCount.replace("{n}",String(ve))));let Te=R.appendChild(T(o,"div","ec-list"));for(let K of I.articles)Te.appendChild(w(K,I.title,K.description));return R}):[_e(o,n.guidesEmpty)]);return}let $=ji(d).split(/\s+/).filter(Boolean),q=new Map((m??[]).map(I=>[I.id,I])),j=L.flatMap(I=>I.articles.filter(R=>{let re=ji(`${R.title} ${R.description??""}`);return $.every(ve=>re.includes(ve))}).map(R=>{let re=q.get(R.id);return q.delete(R.id),w(R,I.title,re?re.snippet||re.description:R.description,I.title)}));for(let I of q.values())j.push(w(I,I.collection.title,I.snippet||I.description,I.collection.title));if(j.length){let I=T(o,"div","ec-list");I.append(...j),c.replaceChildren(I);return}let V=_e(o,n.guidesNoMatch);e.hasSupport()&&V.appendChild(le(o,"ec-btn",n.askInstead)).addEventListener("click",e.openSupport),c.replaceChildren(V)};function P(){if(l?.status==="ready")return A();c.replaceChildren(tt(o,n.guidesLoading)),e.source.list().then(L=>{l=L,L.status==="hidden"?e.onHidden():A()})}let S=async L=>{x?.abort();let $=x=new AbortController,q=await e.source.search(L,$.signal);$.signal.aborted||L!==d||!q||(m=q,A())},G=()=>{if(d=a.value.trim().slice(0,ht.query),m=null,x?.abort(),clearTimeout(h),A(),d.length>=pa){let L=d;h=setTimeout(()=>{S(L)},da)}};return a.addEventListener("input",G),{show(L){P(),L&&a.focus()},focusGuide(L){let $=Array.from(c.querySelectorAll("[data-guide]")).find(q=>q.getAttribute("data-guide")===L);return $?.focus(),!!$},destroy(){clearTimeout(h),x?.abort()}}}var Ui=["all","open","resolved"];function ua(e,o,n){let[r,s]=n.status==="you"?[o.statusYou,"accent"]:n.status==="resolved"?[o.statusResolved,"good"]:[o.statusTeam,"warn"],a=T(e,"span","ec-pill",r);return a.setAttribute("data-tone",s),a}function ro(e,o,n,r){let s=T(e,r,"ec-ticket");r==="button"&&(s.type="button");let a=s.appendChild(T(e,"span","ec-tmeta"));a.append(T(e,"span","ec-mono",n.key),ua(e,o,n));let c=Date.parse(n.updated_at);return c&&a.append(T(e,"span","ec-muted",Cn(o,c))),s.append(T(e,"span","ec-row-title",n.title)),n.last_message&&s.append(T(e,"span","ec-row-sub",n.last_message.excerpt)),n.has_recording&&s.appendChild(T(e,"span","ec-tfoot")).append(Ae(e,"video",14),T(e,"span","",o.recordingAttached)),s}function Wi(e){let{doc:o,TEXT:n,root:r}=e,s=T(o,"div","ec-box-head"),a=le(o,"ec-btn",n.reportProblem);a.addEventListener("click",e.report),s.append(T(o,"h2","ec-h",n.tabTickets),a);let c=T(o,"div","ec-filters");c.setAttribute("role","group"),c.setAttribute("aria-label",n.ticketsFilter);let l=T(o,"div","ec-tbar"),d=l.appendChild(le(o,"ec-icon ec-reload"));d.setAttribute("aria-label",n.ticketsReload),d.title=n.ticketsReload,d.append(Ae(o,"restart",16)),d.addEventListener("click",()=>{w||$()}),l.prepend(c);let m=T(o,"div","ec-stack");r.append(s,l,m);let h="all",x=0,w=!1,A=!1,P=q=>{w=q,d.setAttribute("aria-disabled",String(q)),d.toggleAttribute("data-busy",q)},S={all:n.filterAll,open:n.filterOpen,resolved:n.filterResolved},G=Ui.map(q=>{let j=c.appendChild(le(o,"ec-filter",S[q]));return j.addEventListener("click",()=>{h=q,$()}),j}),L=q=>{if(q.status==="hidden"||q.status==="denied")return e.onGone(q.status);if(q.status==="error"){if(A){m.querySelector(":scope > .ec-tstale")?.remove();let V=T(o,"p","ec-tstale");V.setAttribute("role","status"),V.append(Ae(o,"alert",14),T(o,"span","",n.ticketsError)),m.prepend(V);return}m.replaceChildren(_e(o,n.ticketsError,{label:n.retry,run:()=>$()}));return}let{tickets:j}=q.data;m.replaceChildren(...j.length?j.map(V=>ro(o,n,V,"article")):[_e(o,n.ticketsEmpty)]),A=!0};function $(){Ui.forEach((V,I)=>G[I].setAttribute("aria-pressed",String(V===h)));let q=++x,j=e.source.cached(h);j?L(j):(A=!1,m.replaceChildren(tt(o,n.ticketsLoading))),P(!0),e.source.list(h,!0).then(V=>{q===x&&(P(!1),L(V))})}return{show(q){a.hidden=!e.canReport(),$(),q&&(a.hidden?G[0]:a).focus()},reset(){x++,m.replaceChildren(),A=!1,P(!1)},destroy(){x++}}}function Cn(e,o){let n=Math.floor((Date.now()-o)/6e4);if(n<1)return e.agoNow;if(n<60)return e.agoMinutes.replace("{n}",String(n));let r=Math.floor(n/60);return r<24?e.agoHours.replace("{n}",String(r)):e.agoDays.replace("{n}",String(Math.floor(r/24)))}function ao(e,o,n){let r=T(e,"section","ec-box"),s=T(e,"div","ec-list");r.append(T(e,"h3","ec-box-title",o.newChat));let a=Pt(e,o.newChat,o.startOver);return a.id="ec-home-new",a.addEventListener("click",n.restart),s.append(a),r.append(s),r}function Ki(e){let{doc:o,TEXT:n}=e,r=T(o,"h2","ec-hello");r.append(T(o,"span","",e.name?n.helloNamed.replace("{name}",()=>e.name):n.hello),T(o,"span","",n.helpPrompt));let s=[r];if(e.support){let a=T(o,"section","ec-box"),c=le(o,"ec-fake");c.append(T(o,"span","",n.placeholder),Ae(o,"up",14,"ec-fake-go")),c.setAttribute("aria-label",n.askTitle),c.addEventListener("click",e.openSupport),a.append(T(o,"h3","ec-box-title",n.askTitle),T(o,"p","ec-box-sub",n.askHint),c),s.push(a);let l=()=>{if(!e.last)return null;let d=T(o,"section","ec-box"),m=Pt(o,e.last.text,Cn(n,e.last.at));return m.addEventListener("click",e.openSupport),d.append(T(o,"h3","ec-box-title",n.continueTitle),m),d};if(e.history){let d=T(o,"div","ec-stack");s.push(d),e.history().then(m=>{if(!d.isConnected)return;if(!m.length)return void d.replaceWith(l()??"");let h=T(o,"div","ec-list");for(let x of m)h.appendChild(Pt(o,x.title,Cn(n,Date.parse(x.updated_at)||Date.now()))).addEventListener("click",()=>e.openConversation(x.id));d.className="ec-box",d.append(T(o,"h3","ec-box-title",n.historyTitle),h)})}else{let d=l();d&&s.push(d)}}if(e.tickets){let a=T(o,"div","ec-stack");s.push(a),e.tickets.list("all").then(c=>{if(!a.isConnected)return;if(c.status==="hidden"||c.status==="denied")return e.onTicketsGone(c.status);let l=c.status==="ready"&&c.data.tickets.find(m=>m.status!=="resolved");if(!l)return a.remove();let d=ro(o,n,l,"button");d.addEventListener("click",e.openTickets),a.className="ec-box",a.append(T(o,"h3","ec-box-title",n.openTicket),d)})}if(s.push(ao(o,n,e)),e.guides){let a=T(o,"section","ec-box"),c=le(o,"ec-fake");c.append(Ae(o,"search",16),T(o,"span","",n.searchGuides)),c.addEventListener("click",e.searchGuides);let l=T(o,"div","ec-stack");a.append(c,l),s.push(a);let d=()=>{l.replaceChildren(tt(o,n.guidesLoading)),e.source.list().then(m=>{if(!l.isConnected)return;if(m.status==="hidden")return e.onHidden();if(m.status==="error"){l.replaceChildren(_e(o,n.guidesError,{label:n.retry,run:d}));return}let h=m.data.popular.flatMap(w=>{for(let A of m.data.collections){let P=A.articles.find(S=>S.id===w);if(P)return[io(o,n,e.source,P,P.description,()=>e.openGuide(P,A.title))]}return[]});if(l.replaceChildren(),!h.length)return;let x=T(o,"div","ec-list");x.append(...h),l.append(T(o,"h3","ec-box-title",n.popularGuides),x)})};e.root.replaceChildren(...s),d()}else e.root.replaceChildren(...s)}var fa=/^\s*(`{3,})/,ga=/^\s*(`{3,})\s*$/,ma=/^\s*[-*+]\s+(.*)$/,ha=/^\s*(\d{1,9})[.)]\s+(.*)$/,va=/^\s*#{1,6}\s+(.*)$/;function ba(e){let o=[],n=e.replace(/\r\n?/g,`
|
|
13
13
|
`).split(`
|
|
14
|
-
`),
|
|
15
|
-
`),o.appendChild(r)}else if(a.kind==="h"){let r=e.createElement("p");nt(e,r.appendChild(e.createElement("strong")),a.text),o.appendChild(r)}else if(a.kind==="p"){let r=e.createElement("p");a.lines.forEach((s,d)=>{d&&r.appendChild(e.createElement("br")),nt(e,r,s)}),o.appendChild(r)}else{let r=e.createElement(a.kind);a.kind==="ol"&&a.start!==1&&r.setAttribute("start",String(a.start));for(let s of a.items)nt(e,r.appendChild(e.createElement("li")),s);o.appendChild(r)}i.replaceChildren(o)}var Ei={open:"Open support chat",title:"Support",close:"Close chat",newChat:"New conversation",greeting:"Hi! How can I help you?",inputLabel:"Your message",placeholder:"Type your question\u2026",send:"Send",thinking:"Thinking\u2026",confirmTitle:"The assistant wants to:",allow:"Allow once",allowAlways:"Always allow",decline:"Decline",allowed:"Allowed",declined:"Declined",confirmHighlight:"Highlight {target}",confirmScroll:"Scroll to {target}",confirmClick:"Click {target}",confirmClickLink:"Click {target}, which goes to {destination}",confirmFill:"Type into {target}:",confirmNavigate:"Go to {destination}",emptyValue:"(empty)",didHighlight:"Highlighted {target}",didScroll:"Scrolled to {target}",didClick:"Clicked {target}",didFill:"Filled in {target}",didNavigate:"Went to {destination}",actionFailed:"Could not complete the action on {target}",errorNoAgent:"Support chat is not available on this site.",errorDailyCap:"The assistant reached its message limit for today. Please try again tomorrow.",errorRateLimited:"Too many messages. Wait a moment and try again.",errorConversationLimit:"This conversation got too long.",errorBusy:"Another answer is still in progress. Wait a moment and try again.",startOver:"Start over",errorNetwork:"Could not reach the assistant. Check your connection and try again.",errorGeneric:"Something went wrong. Please try again.",stop:"Stop",presenceNotice:"The assistant is using this page",presenceNoticeNamed:"{name} is using this page",online:"Online",options:"What the assistant can do",optionsTitle:"What the assistant can do on this page",optionsHint:'Turning an action off lasts for this conversation. "Ask me first" is saved in this browser for this site.',optionsEmpty:"Here the assistant only answers questions.",optionsUnavailable:"We could not load these options right now. Try again later.",anElement:"an element on the page",askFirst:"Ask me first",suggestions:"Suggestions",running:"In progress",done:"Done",failed:"Failed",actionsCount:"{n} actions",detailTarget:"Element",detailDestination:"Goes to",detailValue:"Text",nameHighlight:"Point things out",descHighlight:"Outlines a button or field on the page.",nameScroll:"Scroll the page",descScroll:"Brings a part of the page into view.",nameClick:"Click",descClick:"Presses buttons, links and tabs.",nameFill:"Fill in fields",descFill:"Types into form fields. Never passwords.",nameNavigate:"Open pages",descNavigate:"Goes to another page of this site.",whyNotAllowed:"This action is turned off.",whyPrivate:"That part of the page is private.",whyDisabled:"It is disabled right now.",whyGone:"It is no longer on the page.",whyOtherSite:"It leads to another site.",whyDeclined:"You declined it.",whyNotFillable:"It does not accept text.",whyInvalidValue:"That option is not in the list.",whyGeneric:"The page did not respond as expected.",queueTitle:"{n} queued",queuePaused:"Paused",queueResume:"Resume",queueClear:"Clear",queueSendNow:"Send now",queueEdit:"Edit",queueRemove:"Remove",queueFull:"The queue is full. Wait for the assistant to finish.",tabs:"Sections",tabHome:"Home",tabSupport:"Support",tabGuides:"Guides",hello:"Hi.",helpPrompt:"How can we help?",askTitle:"Ask the assistant",askHint:"Answers in seconds \xB7 can point at things on this page",continueTitle:"Continue",agoNow:"just now",agoMinutes:"{n} min ago",agoHours:"{n} h ago",agoDays:"{n} d ago",searchGuides:"Search guides",popularGuides:"Popular guides",guidesCount:"{n} articles",guidesCountOne:"1 article",guidesLoading:"Loading guides\u2026",guidesError:"We could not load the guides.",guidesEmpty:"There are no guides yet.",guidesNoMatch:"No guide matches that yet.",askInstead:"Ask the assistant instead",retry:"Try again",backToGuides:"Back to guides",newTab:"(opens in a new tab)",openFullPage:"Open the full page",articleLoading:"Loading\u2026",articleError:"We could not load this guide.",voteQuestion:"Did this answer your question?",voteYes:"Yes",voteNo:"Not really",voteThanks:"Thanks for letting us know.",voteSorry:"Sorry about that.",voteSorryAssist:"Sorry about that. The assistant can take it from here.",tabTickets:"Tickets",reportProblem:"Report a problem",ticketsFilter:"Show tickets",filterAll:"All",filterOpen:"Open",filterResolved:"Resolved",statusTeam:"With our team",statusYou:"Waiting on you",statusResolved:"Resolved",recordingAttached:"Recording attached",ticketsLoading:"Loading tickets\u2026",ticketsError:"We could not load your tickets.",ticketsEmpty:"Nothing matches that filter.",openTicket:"Your open ticket",ticketsWaiting:"{n} waiting on you"},Mo={open:"Abrir el chat de soporte",title:"Soporte",close:"Cerrar el chat",newChat:"Nueva conversaci\xF3n",greeting:"\xA1Hola! \xBFEn qu\xE9 te puedo ayudar?",inputLabel:"Tu mensaje",placeholder:"Escribe tu pregunta\u2026",send:"Enviar",thinking:"Pensando\u2026",confirmTitle:"El asistente quiere:",allow:"Permitir una vez",allowAlways:"Permitir siempre",decline:"Rechazar",allowed:"Permitido",declined:"Rechazado",confirmHighlight:"Se\xF1alar {target}",confirmScroll:"Llevar la vista a {target}",confirmClick:"Hacer clic en {target}",confirmClickLink:"Hacer clic en {target}, que lleva a {destination}",confirmFill:"Escribir en {target}:",confirmNavigate:"Ir a {destination}",emptyValue:"(vac\xEDo)",didHighlight:"Se\xF1al\xF3 {target}",didScroll:"Llev\xF3 la vista a {target}",didClick:"Hizo clic en {target}",didFill:"Complet\xF3 {target}",didNavigate:"Fue a {destination}",actionFailed:"No se pudo completar la acci\xF3n en {target}",errorNoAgent:"El chat de soporte no est\xE1 disponible en este sitio.",errorDailyCap:"El asistente lleg\xF3 a su l\xEDmite de mensajes de hoy. Vuelve a intentarlo ma\xF1ana.",errorRateLimited:"Demasiados mensajes. Espera un momento y vuelve a intentarlo.",errorConversationLimit:"Esta conversaci\xF3n se hizo demasiado larga.",errorBusy:"Otra respuesta est\xE1 en curso. Espera un momento y vuelve a intentarlo.",startOver:"Empezar de nuevo",errorNetwork:"No se pudo contactar al asistente. Revisa tu conexi\xF3n y vuelve a intentarlo.",errorGeneric:"Algo sali\xF3 mal. Vuelve a intentarlo.",stop:"Detener",presenceNotice:"El asistente est\xE1 usando esta p\xE1gina",presenceNoticeNamed:"{name} est\xE1 usando esta p\xE1gina",online:"En l\xEDnea",options:"Lo que puede hacer el asistente",optionsTitle:"Lo que el asistente puede hacer en esta p\xE1gina",optionsHint:"Apagar una acci\xF3n vale para esta conversaci\xF3n. \xABPreguntarme antes\xBB se guarda en este navegador para este sitio.",optionsEmpty:"Aqu\xED el asistente s\xF3lo responde preguntas.",optionsUnavailable:"No pudimos cargar las opciones ahora. Vuelve a intentarlo m\xE1s tarde.",anElement:"un elemento de la p\xE1gina",askFirst:"Preguntarme antes",suggestions:"Sugerencias",running:"En curso",done:"Hecho",failed:"Error",actionsCount:"{n} acciones",detailTarget:"Elemento",detailDestination:"Lleva a",detailValue:"Texto",nameHighlight:"Se\xF1alar",descHighlight:"Marca un bot\xF3n o un campo de la p\xE1gina.",nameScroll:"Mover la vista",descScroll:"Lleva la vista a una parte de la p\xE1gina.",nameClick:"Hacer clic",descClick:"Presiona botones, enlaces y pesta\xF1as.",nameFill:"Completar campos",descFill:"Escribe en campos de formularios. Nunca contrase\xF1as.",nameNavigate:"Abrir p\xE1ginas",descNavigate:"Va a otra p\xE1gina de este sitio.",whyNotAllowed:"Esta acci\xF3n est\xE1 desactivada.",whyPrivate:"Esa parte de la p\xE1gina es privada.",whyDisabled:"Est\xE1 deshabilitado en este momento.",whyGone:"Ya no est\xE1 en la p\xE1gina.",whyOtherSite:"Lleva a otro sitio.",whyDeclined:"La rechazaste.",whyNotFillable:"No acepta texto.",whyInvalidValue:"Esa opci\xF3n no est\xE1 en la lista.",whyGeneric:"La p\xE1gina no respondi\xF3 como se esperaba.",queueTitle:"{n} en cola",queuePaused:"En pausa",queueResume:"Reanudar",queueClear:"Vaciar",queueSendNow:"Enviar ahora",queueEdit:"Editar",queueRemove:"Quitar",queueFull:"La cola est\xE1 llena. Espera a que el asistente termine.",tabs:"Secciones",tabHome:"Inicio",tabSupport:"Soporte",tabGuides:"Gu\xEDas",hello:"Hola.",helpPrompt:"\xBFEn qu\xE9 te podemos ayudar?",askTitle:"Preg\xFAntale al asistente",askHint:"Responde en segundos \xB7 puede se\xF1alar cosas en esta p\xE1gina",continueTitle:"Continuar",agoNow:"reci\xE9n",agoMinutes:"hace {n} min",agoHours:"hace {n} h",agoDays:"hace {n} d",searchGuides:"Buscar en las gu\xEDas",popularGuides:"Gu\xEDas populares",guidesCount:"{n} art\xEDculos",guidesCountOne:"1 art\xEDculo",guidesLoading:"Cargando las gu\xEDas\u2026",guidesError:"No pudimos cargar las gu\xEDas.",guidesEmpty:"Todav\xEDa no hay gu\xEDas.",guidesNoMatch:"Todav\xEDa ninguna gu\xEDa coincide con eso.",askInstead:"Mejor preg\xFAntale al asistente",retry:"Reintentar",backToGuides:"Volver a las gu\xEDas",newTab:"(se abre en una pesta\xF1a nueva)",openFullPage:"Abrir la p\xE1gina completa",articleLoading:"Cargando\u2026",articleError:"No pudimos cargar esta gu\xEDa.",voteQuestion:"\xBFEsto respondi\xF3 tu pregunta?",voteYes:"S\xED",voteNo:"No del todo",voteThanks:"Gracias por contarnos.",voteSorry:"Lo sentimos.",voteSorryAssist:"Lo sentimos. El asistente puede seguir desde aqu\xED.",tabTickets:"Tickets",reportProblem:"Reportar un problema",ticketsFilter:"Mostrar tickets",filterAll:"Todos",filterOpen:"Abiertos",filterResolved:"Resueltos",statusTeam:"Con nuestro equipo",statusYou:"Esperando tu respuesta",statusResolved:"Resuelto",recordingAttached:"Grabaci\xF3n adjunta",ticketsLoading:"Cargando tickets\u2026",ticketsError:"No pudimos cargar tus tickets.",ticketsEmpty:"Nada coincide con ese filtro.",openTicket:"Tu ticket abierto",ticketsWaiting:"{n} esperan tu respuesta"},Ho={open:"Abrir o chat de suporte",title:"Suporte",close:"Fechar o chat",newChat:"Nova conversa",greeting:"Ol\xE1! Como posso ajudar?",inputLabel:"Sua mensagem",placeholder:"Digite sua pergunta\u2026",send:"Enviar",thinking:"Pensando\u2026",confirmTitle:"O assistente quer:",allow:"Permitir uma vez",allowAlways:"Permitir sempre",decline:"Recusar",allowed:"Permitido",declined:"Recusado",confirmHighlight:"Destacar {target}",confirmScroll:"Rolar at\xE9 {target}",confirmClick:"Clicar em {target}",confirmClickLink:"Clicar em {target}, que leva para {destination}",confirmFill:"Digitar em {target}:",confirmNavigate:"Ir para {destination}",emptyValue:"(vazio)",didHighlight:"Destacou {target}",didScroll:"Rolou at\xE9 {target}",didClick:"Clicou em {target}",didFill:"Preencheu {target}",didNavigate:"Foi para {destination}",actionFailed:"N\xE3o foi poss\xEDvel concluir a a\xE7\xE3o em {target}",errorNoAgent:"O chat de suporte n\xE3o est\xE1 dispon\xEDvel neste site.",errorDailyCap:"O assistente atingiu o limite de mensagens de hoje. Tente novamente amanh\xE3.",errorRateLimited:"Mensagens demais. Aguarde um momento e tente novamente.",errorConversationLimit:"Esta conversa ficou longa demais.",errorBusy:"Outra resposta est\xE1 em andamento. Aguarde um momento e tente novamente.",startOver:"Come\xE7ar de novo",errorNetwork:"N\xE3o foi poss\xEDvel falar com o assistente. Verifique sua conex\xE3o e tente novamente.",errorGeneric:"Algo deu errado. Tente novamente.",stop:"Parar",presenceNotice:"O assistente est\xE1 usando esta p\xE1gina",presenceNoticeNamed:"{name} est\xE1 usando esta p\xE1gina",online:"Online",options:"O que o assistente pode fazer",optionsTitle:"O que o assistente pode fazer nesta p\xE1gina",optionsHint:"Desligar uma a\xE7\xE3o vale para esta conversa. \xABPerguntar antes\xBB fica salvo neste navegador para este site.",optionsEmpty:"Aqui o assistente s\xF3 responde perguntas.",optionsUnavailable:"N\xE3o conseguimos carregar as op\xE7\xF5es agora. Tente novamente mais tarde.",anElement:"um elemento da p\xE1gina",askFirst:"Perguntar antes",suggestions:"Sugest\xF5es",running:"Em andamento",done:"Feito",failed:"Erro",actionsCount:"{n} a\xE7\xF5es",detailTarget:"Elemento",detailDestination:"Leva para",detailValue:"Texto",nameHighlight:"Destacar",descHighlight:"Marca um bot\xE3o ou campo da p\xE1gina.",nameScroll:"Rolar a p\xE1gina",descScroll:"Leva a vista at\xE9 uma parte da p\xE1gina.",nameClick:"Clicar",descClick:"Aperta bot\xF5es, links e abas.",nameFill:"Preencher campos",descFill:"Digita em campos de formul\xE1rios. Nunca senhas.",nameNavigate:"Abrir p\xE1ginas",descNavigate:"Vai para outra p\xE1gina deste site.",whyNotAllowed:"Esta a\xE7\xE3o est\xE1 desativada.",whyPrivate:"Essa parte da p\xE1gina \xE9 privada.",whyDisabled:"Est\xE1 desabilitado no momento.",whyGone:"N\xE3o est\xE1 mais na p\xE1gina.",whyOtherSite:"Leva para outro site.",whyDeclined:"Voc\xEA recusou.",whyNotFillable:"N\xE3o aceita texto.",whyInvalidValue:"Essa op\xE7\xE3o n\xE3o est\xE1 na lista.",whyGeneric:"A p\xE1gina n\xE3o respondeu como esperado.",queueTitle:"{n} na fila",queuePaused:"Em pausa",queueResume:"Retomar",queueClear:"Limpar",queueSendNow:"Enviar agora",queueEdit:"Editar",queueRemove:"Remover",queueFull:"A fila est\xE1 cheia. Aguarde o assistente terminar.",tabs:"Se\xE7\xF5es",tabHome:"In\xEDcio",tabSupport:"Suporte",tabGuides:"Guias",hello:"Ol\xE1.",helpPrompt:"Como podemos ajudar?",askTitle:"Pergunte ao assistente",askHint:"Responde em segundos \xB7 pode apontar coisas nesta p\xE1gina",continueTitle:"Continuar",agoNow:"agora mesmo",agoMinutes:"h\xE1 {n} min",agoHours:"h\xE1 {n} h",agoDays:"h\xE1 {n} d",searchGuides:"Buscar nos guias",popularGuides:"Guias populares",guidesCount:"{n} artigos",guidesCountOne:"1 artigo",guidesLoading:"Carregando os guias\u2026",guidesError:"N\xE3o conseguimos carregar os guias.",guidesEmpty:"Ainda n\xE3o h\xE1 guias.",guidesNoMatch:"Nenhum guia corresponde a isso ainda.",askInstead:"Pergunte ao assistente",retry:"Tentar novamente",backToGuides:"Voltar aos guias",newTab:"(abre em uma nova aba)",openFullPage:"Abrir a p\xE1gina completa",articleLoading:"Carregando\u2026",articleError:"N\xE3o conseguimos carregar este guia.",voteQuestion:"Isso respondeu \xE0 sua pergunta?",voteYes:"Sim",voteNo:"N\xE3o muito",voteThanks:"Obrigado por nos contar.",voteSorry:"Sentimos muito.",voteSorryAssist:"Sentimos muito. O assistente pode continuar daqui.",tabTickets:"Tickets",reportProblem:"Relatar um problema",ticketsFilter:"Mostrar tickets",filterAll:"Todos",filterOpen:"Abertos",filterResolved:"Resolvidos",statusTeam:"Com nossa equipe",statusYou:"Aguardando voc\xEA",statusResolved:"Resolvido",recordingAttached:"Grava\xE7\xE3o anexada",ticketsLoading:"Carregando tickets\u2026",ticketsError:"N\xE3o conseguimos carregar seus tickets.",ticketsEmpty:"Nada corresponde a esse filtro.",openTicket:"Seu ticket aberto",ticketsWaiting:"{n} aguardando voc\xEA"};function gt(e){let i=(e??"").toLowerCase().slice(0,2);return i==="es"?Mo:i==="pt"?Ho:Ei}function Ht(e,i,t){let o=t.target?`\xAB${t.target}\xBB`:e.anElement,a=t.destination??"?",r;return i==="failed"?r=t.type==="navigate"?e.actionFailed.replace("{target}","{destination}"):e.actionFailed:i==="confirm"?r=t.type==="click"?t.destination?e.confirmClickLink:e.confirmClick:t.type==="fill"?e.confirmFill:t.type==="navigate"?e.confirmNavigate:t.type==="scroll_to"?e.confirmScroll:e.confirmHighlight:r=t.type==="click"?e.didClick:t.type==="fill"?e.didFill:t.type==="navigate"?e.didNavigate:t.type==="scroll_to"?e.didScroll:e.didHighlight,r.replace(/\{(target|destination)\}/g,(s,d)=>d==="target"?o:a)}function an(e,i){switch(i){case"not_allowed":case"unknown_action":return e.whyNotAllowed;case"forbidden":case"blocked":return e.whyPrivate;case"disabled":return e.whyDisabled;case"stale_ref":return e.whyGone;case"cross_origin":return e.whyOtherSite;case"declined":case"confirmation_required":return e.whyDeclined;case"not_fillable":case"readonly":return e.whyNotFillable;case"invalid_value":return e.whyInvalidValue;default:return e.whyGeneric}}function mt(e,i){return i===""?e.emptyValue:i.replace(/\r\n?|\n/g,`\u23CE
|
|
16
|
-
`)}var
|
|
14
|
+
`),r;for(let s=0;s<n.length;s++){let a=n[s],c=fa.exec(a);if(c){let h=[],x=w=>(ga.exec(w)?.[1]?.length??0)>=c[1].length;for(;++s<n.length&&!x(n[s]);)h.push(n[s]);o.push({kind:"code",lines:h}),r=void 0;continue}if(!a.trim()){r=void 0;continue}let l=ma.exec(a),d=l?null:ha.exec(a);if(l||d){let h=l?"ul":"ol",x=l?l[1]:d[2];r&&r.kind===h?r.items.push(x):o.push(r={kind:h,items:[x],start:d?Number(d[1]):1});continue}let m=va.exec(a);if(m){o.push({kind:"h",text:m[1]}),r=void 0;continue}r&&(r.kind==="ul"||r.kind==="ol")?r.items[r.items.length-1]+=` ${a.trim()}`:r&&r.kind==="p"?r.lines.push(a):o.push(r={kind:"p",lines:[a]})}return o}var xa=/`([^`\n]+)`|\*\*(?=\S)([\s\S]*?\S)\*\*|\*(?=[^\s*])([^*\n]*?[^\s*])\*|\[([^\]\n]+)\]\(([^()\s]+)\)/;function Nt(e,o,n){let r=n;for(;;){let s=xa.exec(r);if(!s)break;if(s.index>0&&o.appendChild(e.createTextNode(r.slice(0,s.index))),s[1]!==void 0){let a=e.createElement("code");a.textContent=s[1],o.appendChild(a)}else if(s[2]!==void 0)Nt(e,o.appendChild(e.createElement("strong")),s[2]);else if(s[3]!==void 0)Nt(e,o.appendChild(e.createElement("em")),s[3]);else{let a=s[4],c=s[5];Nt(e,o,a),c!==a&&o.appendChild(e.createTextNode(` (${c})`))}r=r.slice(s.index+s[0].length)}r&&o.appendChild(e.createTextNode(r))}function so(e,o,n){let r=e.createDocumentFragment();for(let s of ba(n))if(s.kind==="code"){let a=e.createElement("pre");a.appendChild(e.createElement("code")).textContent=s.lines.join(`
|
|
15
|
+
`),r.appendChild(a)}else if(s.kind==="h"){let a=e.createElement("p");Nt(e,a.appendChild(e.createElement("strong")),s.text),r.appendChild(a)}else if(s.kind==="p"){let a=e.createElement("p");s.lines.forEach((c,l)=>{l&&a.appendChild(e.createElement("br")),Nt(e,a,c)}),r.appendChild(a)}else{let a=e.createElement(s.kind);s.kind==="ol"&&s.start!==1&&a.setAttribute("start",String(s.start));for(let c of s.items)Nt(e,a.appendChild(e.createElement("li")),c);r.appendChild(a)}o.replaceChildren(r)}var Qi={open:"Open support chat",title:"Support",close:"Close chat",newChat:"New conversation",greeting:"Hi! How can I help you?",inputLabel:"Your message",placeholder:"Type your question\u2026",send:"Send",thinking:"Thinking\u2026",confirmTitle:"The assistant wants to:",allow:"Allow once",allowAlways:"Always allow",decline:"Decline",allowed:"Allowed",declined:"Declined",confirmHighlight:"Highlight {target}",confirmScroll:"Scroll to {target}",confirmClick:"Click {target}",confirmClickLink:"Click {target}, which goes to {destination}",confirmFill:"Type into {target}:",confirmNavigate:"Go to {destination}",emptyValue:"(empty)",didHighlight:"Highlighted {target}",didScroll:"Scrolled to {target}",didClick:"Clicked {target}",didFill:"Filled in {target}",didNavigate:"Went to {destination}",actionFailed:"Could not complete the action on {target}",errorNoAgent:"Support chat is not available on this site.",errorDailyCap:"The assistant reached its message limit for today. Please try again tomorrow.",errorRateLimited:"Too many messages. Wait a moment and try again.",errorConversationLimit:"This conversation got too long.",errorBusy:"Another answer is still in progress. Wait a moment and try again.",startOver:"Start over",errorNetwork:"Could not reach the assistant. Check your connection and try again.",errorGeneric:"Something went wrong. Please try again.",stop:"Stop",presenceNotice:"The assistant is using this page",presenceNoticeNamed:"{name} is using this page",online:"Online",options:"What the assistant can do",optionsTitle:"What the assistant can do on this page",optionsHint:'Turning an action off lasts for this conversation. "Ask me first" is saved in this browser for this site.',optionsEmpty:"Here the assistant only answers questions.",optionsUnavailable:"We could not load these options right now. Try again later.",anElement:"an element on the page",askFirst:"Ask me first",suggestions:"Suggestions",running:"In progress",done:"Done",failed:"Failed",actionsCount:"{n} actions",detailTarget:"Element",detailDestination:"Goes to",detailValue:"Text",nameHighlight:"Point things out",descHighlight:"Outlines a button or field on the page.",nameScroll:"Scroll the page",descScroll:"Brings a part of the page into view.",nameClick:"Click",descClick:"Presses buttons, links and tabs.",nameFill:"Fill in fields",descFill:"Types into form fields. Never passwords.",nameNavigate:"Open pages",descNavigate:"Goes to another page of this site.",whyNotAllowed:"This action is turned off.",whyPrivate:"That part of the page is private.",whyDisabled:"It is disabled right now.",whyGone:"It is no longer on the page.",whyOtherSite:"It leads to another site.",whyDeclined:"You declined it.",whyNotFillable:"It does not accept text.",whyInvalidValue:"That option is not in the list.",whyGeneric:"The page did not respond as expected.",queueTitle:"{n} queued",queuePaused:"Paused",queueResume:"Resume",queueClear:"Clear",queueSendNow:"Send now",queueEdit:"Edit",queueRemove:"Remove",queueFull:"The queue is full. Wait for the assistant to finish.",tabs:"Sections",tabHome:"Home",tabSupport:"Support",tabGuides:"Guides",hello:"Hi.",helpPrompt:"How can we help?",askTitle:"Ask the assistant",askHint:"Answers in seconds \xB7 can point at things on this page",continueTitle:"Continue",historyTitle:"Your conversations",errorHistory:"We could not open that conversation.",agoNow:"just now",agoMinutes:"{n} min ago",agoHours:"{n} h ago",agoDays:"{n} d ago",searchGuides:"Search guides",popularGuides:"Popular guides",guidesCount:"{n} articles",guidesCountOne:"1 article",guidesLoading:"Loading guides\u2026",guidesError:"We could not load the guides.",guidesEmpty:"There are no guides yet.",guidesNoMatch:"No guide matches that yet.",askInstead:"Ask the assistant instead",retry:"Try again",backToGuides:"Back to guides",newTab:"(opens in a new tab)",openFullPage:"Open the full page",articleLoading:"Loading\u2026",articleError:"We could not load this guide.",voteQuestion:"Did this answer your question?",voteYes:"Yes",voteNo:"Not really",voteThanks:"Thanks for letting us know.",voteSorry:"Sorry about that.",voteSorryAssist:"Sorry about that. The assistant can take it from here.",tabTickets:"Tickets",reportProblem:"Report a problem",ticketsFilter:"Show tickets",filterAll:"All",filterOpen:"Open",filterResolved:"Resolved",statusTeam:"With our team",statusYou:"Waiting on you",statusResolved:"Resolved",recordingAttached:"Recording attached",ticketsLoading:"Loading tickets\u2026",ticketsError:"We could not load your tickets.",ticketsEmpty:"Nothing matches that filter.",openTicket:"Your open ticket",ticketsWaiting:"{n} waiting on you",ticketsReload:"Reload",minimize:"Minimize",expand:"Expand",collapse:"Collapse",dock:"Pin to the side",undock:"Float the panel",more:"More",copy:"Copy",copied:"Copied",copyCode:"Copy code",regenerate:"Regenerate response",regenerateShort:"Regenerate",goodResponse:"Good response",badResponse:"Bad response",notSent:"Not sent",resend:"Retry",stopped:"Stopped",jumpLatest:"Jump to latest",hintSend:"Enter to send",hintQueue:"Enter adds it to the queue",hintNewline:"Shift+Enter for a new line",helloNamed:"Hi {name}.",errorUnavailable:"The assistant is unavailable right now. Try again in a few minutes."},ya={open:"Abrir el chat de soporte",title:"Soporte",close:"Cerrar el chat",newChat:"Nueva conversaci\xF3n",greeting:"\xA1Hola! \xBFEn qu\xE9 te puedo ayudar?",inputLabel:"Tu mensaje",placeholder:"Escribe tu pregunta\u2026",send:"Enviar",thinking:"Pensando\u2026",confirmTitle:"El asistente quiere:",allow:"Permitir una vez",allowAlways:"Permitir siempre",decline:"Rechazar",allowed:"Permitido",declined:"Rechazado",confirmHighlight:"Se\xF1alar {target}",confirmScroll:"Llevar la vista a {target}",confirmClick:"Hacer clic en {target}",confirmClickLink:"Hacer clic en {target}, que lleva a {destination}",confirmFill:"Escribir en {target}:",confirmNavigate:"Ir a {destination}",emptyValue:"(vac\xEDo)",didHighlight:"Se\xF1al\xF3 {target}",didScroll:"Llev\xF3 la vista a {target}",didClick:"Hizo clic en {target}",didFill:"Complet\xF3 {target}",didNavigate:"Fue a {destination}",actionFailed:"No se pudo completar la acci\xF3n en {target}",errorNoAgent:"El chat de soporte no est\xE1 disponible en este sitio.",errorDailyCap:"El asistente lleg\xF3 a su l\xEDmite de mensajes de hoy. Vuelve a intentarlo ma\xF1ana.",errorRateLimited:"Demasiados mensajes. Espera un momento y vuelve a intentarlo.",errorConversationLimit:"Esta conversaci\xF3n se hizo demasiado larga.",errorBusy:"Otra respuesta est\xE1 en curso. Espera un momento y vuelve a intentarlo.",startOver:"Empezar de nuevo",errorNetwork:"No se pudo contactar al asistente. Revisa tu conexi\xF3n y vuelve a intentarlo.",errorGeneric:"Algo sali\xF3 mal. Vuelve a intentarlo.",stop:"Detener",presenceNotice:"El asistente est\xE1 usando esta p\xE1gina",presenceNoticeNamed:"{name} est\xE1 usando esta p\xE1gina",online:"En l\xEDnea",options:"Lo que puede hacer el asistente",optionsTitle:"Lo que el asistente puede hacer en esta p\xE1gina",optionsHint:"Apagar una acci\xF3n vale para esta conversaci\xF3n. \xABPreguntarme antes\xBB se guarda en este navegador para este sitio.",optionsEmpty:"Aqu\xED el asistente s\xF3lo responde preguntas.",optionsUnavailable:"No pudimos cargar las opciones ahora. Vuelve a intentarlo m\xE1s tarde.",anElement:"un elemento de la p\xE1gina",askFirst:"Preguntarme antes",suggestions:"Sugerencias",running:"En curso",done:"Hecho",failed:"Error",actionsCount:"{n} acciones",detailTarget:"Elemento",detailDestination:"Lleva a",detailValue:"Texto",nameHighlight:"Se\xF1alar",descHighlight:"Marca un bot\xF3n o un campo de la p\xE1gina.",nameScroll:"Mover la vista",descScroll:"Lleva la vista a una parte de la p\xE1gina.",nameClick:"Hacer clic",descClick:"Presiona botones, enlaces y pesta\xF1as.",nameFill:"Completar campos",descFill:"Escribe en campos de formularios. Nunca contrase\xF1as.",nameNavigate:"Abrir p\xE1ginas",descNavigate:"Va a otra p\xE1gina de este sitio.",whyNotAllowed:"Esta acci\xF3n est\xE1 desactivada.",whyPrivate:"Esa parte de la p\xE1gina es privada.",whyDisabled:"Est\xE1 deshabilitado en este momento.",whyGone:"Ya no est\xE1 en la p\xE1gina.",whyOtherSite:"Lleva a otro sitio.",whyDeclined:"La rechazaste.",whyNotFillable:"No acepta texto.",whyInvalidValue:"Esa opci\xF3n no est\xE1 en la lista.",whyGeneric:"La p\xE1gina no respondi\xF3 como se esperaba.",queueTitle:"{n} en cola",queuePaused:"En pausa",queueResume:"Reanudar",queueClear:"Vaciar",queueSendNow:"Enviar ahora",queueEdit:"Editar",queueRemove:"Quitar",queueFull:"La cola est\xE1 llena. Espera a que el asistente termine.",tabs:"Secciones",tabHome:"Inicio",tabSupport:"Soporte",tabGuides:"Gu\xEDas",hello:"Hola.",helpPrompt:"\xBFEn qu\xE9 te podemos ayudar?",askTitle:"Preg\xFAntale al asistente",askHint:"Responde en segundos \xB7 puede se\xF1alar cosas en esta p\xE1gina",continueTitle:"Continuar",historyTitle:"Tus conversaciones",errorHistory:"No pudimos abrir esa conversaci\xF3n.",agoNow:"reci\xE9n",agoMinutes:"hace {n} min",agoHours:"hace {n} h",agoDays:"hace {n} d",searchGuides:"Buscar en las gu\xEDas",popularGuides:"Gu\xEDas populares",guidesCount:"{n} art\xEDculos",guidesCountOne:"1 art\xEDculo",guidesLoading:"Cargando las gu\xEDas\u2026",guidesError:"No pudimos cargar las gu\xEDas.",guidesEmpty:"Todav\xEDa no hay gu\xEDas.",guidesNoMatch:"Todav\xEDa ninguna gu\xEDa coincide con eso.",askInstead:"Mejor preg\xFAntale al asistente",retry:"Reintentar",backToGuides:"Volver a las gu\xEDas",newTab:"(se abre en una pesta\xF1a nueva)",openFullPage:"Abrir la p\xE1gina completa",articleLoading:"Cargando\u2026",articleError:"No pudimos cargar esta gu\xEDa.",voteQuestion:"\xBFEsto respondi\xF3 tu pregunta?",voteYes:"S\xED",voteNo:"No del todo",voteThanks:"Gracias por contarnos.",voteSorry:"Lo sentimos.",voteSorryAssist:"Lo sentimos. El asistente puede seguir desde aqu\xED.",tabTickets:"Tickets",reportProblem:"Reportar un problema",ticketsFilter:"Mostrar tickets",filterAll:"Todos",filterOpen:"Abiertos",filterResolved:"Resueltos",statusTeam:"Con nuestro equipo",statusYou:"Esperando tu respuesta",statusResolved:"Resuelto",recordingAttached:"Grabaci\xF3n adjunta",ticketsLoading:"Cargando tickets\u2026",ticketsError:"No pudimos cargar tus tickets.",ticketsEmpty:"Nada coincide con ese filtro.",openTicket:"Tu ticket abierto",ticketsWaiting:"{n} esperan tu respuesta",ticketsReload:"Recargar",minimize:"Minimizar",expand:"Ampliar",collapse:"Reducir",dock:"Fijar al costado",undock:"Volver a flotante",more:"M\xE1s",copy:"Copiar",copied:"Copiado",copyCode:"Copiar c\xF3digo",regenerate:"Regenerar la respuesta",regenerateShort:"Regenerar",goodResponse:"Buena respuesta",badResponse:"Mala respuesta",notSent:"No se envi\xF3",resend:"Reintentar",stopped:"Detenido",jumpLatest:"Ir a lo \xFAltimo",hintSend:"Enter para enviar",hintQueue:"Enter lo agrega a la cola",hintNewline:"Shift+Enter para una l\xEDnea nueva",helloNamed:"Hola, {name}.",errorUnavailable:"El asistente no est\xE1 disponible en este momento. Vuelve a intentarlo en unos minutos."},wa={open:"Abrir o chat de suporte",title:"Suporte",close:"Fechar o chat",newChat:"Nova conversa",greeting:"Ol\xE1! Como posso ajudar?",inputLabel:"Sua mensagem",placeholder:"Digite sua pergunta\u2026",send:"Enviar",thinking:"Pensando\u2026",confirmTitle:"O assistente quer:",allow:"Permitir uma vez",allowAlways:"Permitir sempre",decline:"Recusar",allowed:"Permitido",declined:"Recusado",confirmHighlight:"Destacar {target}",confirmScroll:"Rolar at\xE9 {target}",confirmClick:"Clicar em {target}",confirmClickLink:"Clicar em {target}, que leva para {destination}",confirmFill:"Digitar em {target}:",confirmNavigate:"Ir para {destination}",emptyValue:"(vazio)",didHighlight:"Destacou {target}",didScroll:"Rolou at\xE9 {target}",didClick:"Clicou em {target}",didFill:"Preencheu {target}",didNavigate:"Foi para {destination}",actionFailed:"N\xE3o foi poss\xEDvel concluir a a\xE7\xE3o em {target}",errorNoAgent:"O chat de suporte n\xE3o est\xE1 dispon\xEDvel neste site.",errorDailyCap:"O assistente atingiu o limite de mensagens de hoje. Tente novamente amanh\xE3.",errorRateLimited:"Mensagens demais. Aguarde um momento e tente novamente.",errorConversationLimit:"Esta conversa ficou longa demais.",errorBusy:"Outra resposta est\xE1 em andamento. Aguarde um momento e tente novamente.",startOver:"Come\xE7ar de novo",errorNetwork:"N\xE3o foi poss\xEDvel falar com o assistente. Verifique sua conex\xE3o e tente novamente.",errorGeneric:"Algo deu errado. Tente novamente.",stop:"Parar",presenceNotice:"O assistente est\xE1 usando esta p\xE1gina",presenceNoticeNamed:"{name} est\xE1 usando esta p\xE1gina",online:"Online",options:"O que o assistente pode fazer",optionsTitle:"O que o assistente pode fazer nesta p\xE1gina",optionsHint:"Desligar uma a\xE7\xE3o vale para esta conversa. \xABPerguntar antes\xBB fica salvo neste navegador para este site.",optionsEmpty:"Aqui o assistente s\xF3 responde perguntas.",optionsUnavailable:"N\xE3o conseguimos carregar as op\xE7\xF5es agora. Tente novamente mais tarde.",anElement:"um elemento da p\xE1gina",askFirst:"Perguntar antes",suggestions:"Sugest\xF5es",running:"Em andamento",done:"Feito",failed:"Erro",actionsCount:"{n} a\xE7\xF5es",detailTarget:"Elemento",detailDestination:"Leva para",detailValue:"Texto",nameHighlight:"Destacar",descHighlight:"Marca um bot\xE3o ou campo da p\xE1gina.",nameScroll:"Rolar a p\xE1gina",descScroll:"Leva a vista at\xE9 uma parte da p\xE1gina.",nameClick:"Clicar",descClick:"Aperta bot\xF5es, links e abas.",nameFill:"Preencher campos",descFill:"Digita em campos de formul\xE1rios. Nunca senhas.",nameNavigate:"Abrir p\xE1ginas",descNavigate:"Vai para outra p\xE1gina deste site.",whyNotAllowed:"Esta a\xE7\xE3o est\xE1 desativada.",whyPrivate:"Essa parte da p\xE1gina \xE9 privada.",whyDisabled:"Est\xE1 desabilitado no momento.",whyGone:"N\xE3o est\xE1 mais na p\xE1gina.",whyOtherSite:"Leva para outro site.",whyDeclined:"Voc\xEA recusou.",whyNotFillable:"N\xE3o aceita texto.",whyInvalidValue:"Essa op\xE7\xE3o n\xE3o est\xE1 na lista.",whyGeneric:"A p\xE1gina n\xE3o respondeu como esperado.",queueTitle:"{n} na fila",queuePaused:"Em pausa",queueResume:"Retomar",queueClear:"Limpar",queueSendNow:"Enviar agora",queueEdit:"Editar",queueRemove:"Remover",queueFull:"A fila est\xE1 cheia. Aguarde o assistente terminar.",tabs:"Se\xE7\xF5es",tabHome:"In\xEDcio",tabSupport:"Suporte",tabGuides:"Guias",hello:"Ol\xE1.",helpPrompt:"Como podemos ajudar?",askTitle:"Pergunte ao assistente",askHint:"Responde em segundos \xB7 pode apontar coisas nesta p\xE1gina",continueTitle:"Continuar",historyTitle:"Suas conversas",errorHistory:"N\xE3o conseguimos abrir essa conversa.",agoNow:"agora mesmo",agoMinutes:"h\xE1 {n} min",agoHours:"h\xE1 {n} h",agoDays:"h\xE1 {n} d",searchGuides:"Buscar nos guias",popularGuides:"Guias populares",guidesCount:"{n} artigos",guidesCountOne:"1 artigo",guidesLoading:"Carregando os guias\u2026",guidesError:"N\xE3o conseguimos carregar os guias.",guidesEmpty:"Ainda n\xE3o h\xE1 guias.",guidesNoMatch:"Nenhum guia corresponde a isso ainda.",askInstead:"Pergunte ao assistente",retry:"Tentar novamente",backToGuides:"Voltar aos guias",newTab:"(abre em uma nova aba)",openFullPage:"Abrir a p\xE1gina completa",articleLoading:"Carregando\u2026",articleError:"N\xE3o conseguimos carregar este guia.",voteQuestion:"Isso respondeu \xE0 sua pergunta?",voteYes:"Sim",voteNo:"N\xE3o muito",voteThanks:"Obrigado por nos contar.",voteSorry:"Sentimos muito.",voteSorryAssist:"Sentimos muito. O assistente pode continuar daqui.",tabTickets:"Tickets",reportProblem:"Relatar um problema",ticketsFilter:"Mostrar tickets",filterAll:"Todos",filterOpen:"Abertos",filterResolved:"Resolvidos",statusTeam:"Com nossa equipe",statusYou:"Aguardando voc\xEA",statusResolved:"Resolvido",recordingAttached:"Grava\xE7\xE3o anexada",ticketsLoading:"Carregando tickets\u2026",ticketsError:"N\xE3o conseguimos carregar seus tickets.",ticketsEmpty:"Nada corresponde a esse filtro.",openTicket:"Seu ticket aberto",ticketsWaiting:"{n} aguardando voc\xEA",ticketsReload:"Recarregar",minimize:"Minimizar",expand:"Expandir",collapse:"Recolher",dock:"Fixar na lateral",undock:"Voltar a flutuar",more:"Mais",copy:"Copiar",copied:"Copiado",copyCode:"Copiar c\xF3digo",regenerate:"Gerar a resposta de novo",regenerateShort:"Gerar de novo",goodResponse:"Boa resposta",badResponse:"Resposta ruim",notSent:"N\xE3o enviada",resend:"Tentar de novo",stopped:"Interrompida",jumpLatest:"Ir para o fim",hintSend:"Enter para enviar",hintQueue:"Enter coloca na fila",hintNewline:"Shift+Enter para uma nova linha",helloNamed:"Ol\xE1, {name}.",errorUnavailable:"O assistente est\xE1 indispon\xEDvel no momento. Tente novamente em alguns minutos."};function Yt(e){let o=(e??"").toLowerCase().slice(0,2);return o==="es"?ya:o==="pt"?wa:Qi}function It(e,o,n){let r=n.target?`\xAB${n.target}\xBB`:e.anElement,s=n.destination??"?",a;return o==="failed"?a=n.type==="navigate"?e.actionFailed.replace("{target}","{destination}"):e.actionFailed:o==="confirm"?a=n.type==="click"?n.destination?e.confirmClickLink:e.confirmClick:n.type==="fill"?e.confirmFill:n.type==="navigate"?e.confirmNavigate:n.type==="scroll_to"?e.confirmScroll:e.confirmHighlight:a=n.type==="click"?e.didClick:n.type==="fill"?e.didFill:n.type==="navigate"?e.didNavigate:n.type==="scroll_to"?e.didScroll:e.didHighlight,a.replace(/\{(target|destination)\}/g,(c,l)=>l==="target"?r:s)}function co(e,o){switch(o){case"not_allowed":case"unknown_action":return e.whyNotAllowed;case"forbidden":case"blocked":return e.whyPrivate;case"disabled":return e.whyDisabled;case"stale_ref":return e.whyGone;case"cross_origin":return e.whyOtherSite;case"declined":case"confirmation_required":return e.whyDeclined;case"not_fillable":case"readonly":return e.whyNotFillable;case"invalid_value":return e.whyInvalidValue;default:return e.whyGeneric}}function qt(e,o){return o===""?e.emptyValue:o.replace(/\r\n?|\n/g,`\u23CE
|
|
16
|
+
`)}var Ji=["data-theme","data-mode","data-color-scheme"];function Yi(e){if(!e)return null;let o=e.classList.contains("dark");if(o!==e.classList.contains("light"))return o?"dark":"light";for(let n of Ji){let r=e.getAttribute(n)?.trim().toLowerCase();if(r==="dark"||r==="light")return r}return null}function ka(e){return e=e.toLowerCase(),{light:/\blight\b/.test(e),dark:/\bdark\b/.test(e)}}var Pe=(e,o)=>!e||e==="none"?0:e.endsWith("%")?parseFloat(e)*o/100:parseFloat(e),bt=e=>e<=.03928?e/12.92:((e+.055)/1.055)**2.4,En=(e,o,n)=>.2126*e+.7152*o+.0722*n;function Ca(e){let o=/^\s*(rgba?|hsla?|oklab|oklch|lab|lch|color)\(([^)]*)\)\s*$/i.exec(e);if(!o)return null;let n=o[1].toLowerCase(),[r,s]=o[2].split("/"),a=r.split(/[\s,]+/).filter(Boolean),c=s?.trim()??(n==="color"?void 0:a[3]),l=c===void 0?1:Pe(c,1),d;if(n.startsWith("rgb"))d=En(bt(Pe(a[0],255)/255),bt(Pe(a[1],255)/255),bt(Pe(a[2],255)/255));else if(n.startsWith("hsl")){let m=parseFloat(a[0])||0,h=Pe(a[1],100)/100,x=Pe(a[2],100)/100,w=h*Math.min(x,1-x),A=P=>{let S=(P+m/30)%12;return bt(x-w*Math.max(-1,Math.min(S-3,9-S,1)))};d=En(A(0),A(8),A(4))}else if(n.startsWith("ok"))d=Pe(a[0],1)**3;else if(n!=="color"){let m=Pe(a[0],100);d=m>8?((m+16)/116)**3:m/903.3}else{let m=a.shift(),[h,x,w]=[Pe(a[0],1),Pe(a[1],1),Pe(a[2],1)];m?.startsWith("xyz")?d=x:m==="srgb-linear"?d=En(h,x,w):d=En(bt(h),bt(x),bt(w))}return Number.isNaN(d)||Number.isNaN(l)?null:[d,l]}function Ea(e,o,n,r){let s=e.defaultView;if(!s)return null;let a=null;try{a=e.elementsFromPoint(n,r).find(l=>!o.contains(l))??null}catch{}let c=[];for(let l=a??e.body??e.documentElement;l;l=l.parentElement)c.push(l);c.push(e.body);for(let l of c){let d=l&&Ca(s.getComputedStyle(l).backgroundColor);if(d&&d[1]>.5)return d[0]}return null}function An(e,o,n,r){let s=e.documentElement,a=Yi(s)??Yi(e.body);if(a)return a;let c=e.defaultView,l=[];try{for(let h of[s,e.body])h&&c&&l.push(c.getComputedStyle(h).colorScheme??"")}catch{}l.push(e.querySelector('meta[name="color-scheme"]')?.getAttribute("content")??"");let d=!1;for(let h of l){let x=ka(h);if(x.dark!==x.light)return x.dark?"dark":"light";d||=x.dark}let m=Ea(e,o,n,r);return m!==null?m<.179?"dark":"light":d&&c?.matchMedia?.("(prefers-color-scheme: dark)").matches?"dark":"light"}function Zi(e,o){let n=e.defaultView,r=null,s=()=>{r===null&&(r=setTimeout(()=>{r=null,o()},60))};o();let a=typeof MutationObserver=="function"?new MutationObserver(s):null,c=["class","style",...Ji];a?.observe(e.documentElement,{attributes:!0,attributeFilter:c}),e.body&&a?.observe(e.body,{attributes:!0,attributeFilter:c});let l=n?.matchMedia?.("(prefers-color-scheme: dark)");return l?.addEventListener?.("change",s),()=>{a?.disconnect(),l?.removeEventListener?.("change",s),r!==null&&clearTimeout(r)}}var Tn="data-espejo-presence",Aa=/\b(hidden|clip|auto|scroll|overlay)\b/,Ta=600,Sa=160,La=.55,Ma=140,Ra=600,Ha=260,Dt=260,_a=4e3,Xi=["pointerdown","mousedown","pointerup","mouseup","click","touchstart","touchend","focusin"],er=["beforetoggle","toggle"],Pa=`
|
|
17
17
|
:host {
|
|
18
18
|
all: initial !important;
|
|
19
19
|
position: fixed !important;
|
|
20
20
|
inset: 0 !important;
|
|
21
|
+
margin: 0 !important;
|
|
21
22
|
z-index: 2147483647 !important;
|
|
22
23
|
pointer-events: none !important;
|
|
23
24
|
display: block !important;
|
|
@@ -26,8 +27,10 @@ ${d.hash.toLowerCase()}`):null,f=lo(o,t)??"";try{let p=o?.getItem(l);f&&p&&p!==g
|
|
|
26
27
|
--p-ink2: #62656b;
|
|
27
28
|
--p-line: #e0e2e5;
|
|
28
29
|
--p-accent: #0385ff;
|
|
30
|
+
--p-on-accent: #ffffff;
|
|
29
31
|
--p-red-tint: #fcecec;
|
|
30
32
|
--p-red-ink: #b3212e;
|
|
33
|
+
--p-tint: #f2f4f7;
|
|
31
34
|
--p-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06), 0 8px 24px rgba(0, 0, 0, 0.14);
|
|
32
35
|
--p-ease: cubic-bezier(0.23, 1, 0.32, 1);
|
|
33
36
|
--p-ring: conic-gradient(from 0deg, #0385ff, #7c5cff, #e0529c, #ff8a3d, #7c5cff, #0385ff);
|
|
@@ -44,13 +47,16 @@ ${d.hash.toLowerCase()}`):null,f=lo(o,t)??"";try{let p=o?.getItem(l);f&&p&&p!==g
|
|
|
44
47
|
--p-accent: #3b9aff;
|
|
45
48
|
--p-red-tint: rgba(241, 112, 109, 0.15);
|
|
46
49
|
--p-red-ink: #ff8480;
|
|
50
|
+
--p-tint: #2e3034;
|
|
47
51
|
--p-shadow: 0 0 0 1px rgba(255, 255, 255, 0.11), 0 8px 24px rgba(0, 0, 0, 0.5);
|
|
48
52
|
--c0: #40a0ffe6;
|
|
49
53
|
--c1: #9c80ffe6;
|
|
50
54
|
--c2: #ff6ebad9;
|
|
51
55
|
--c3: #ffa25cd9;
|
|
52
56
|
}
|
|
57
|
+
:host::backdrop { display: none !important; background: none !important; opacity: 0 !important; filter: none !important; backdrop-filter: none !important; }
|
|
53
58
|
* { box-sizing: border-box; }
|
|
59
|
+
.ep-root { position: absolute; inset: 0; contain: layout paint; }
|
|
54
60
|
@keyframes ep-wave { 0%, 100% { transform: translateX(-14%) scaleY(0.55); } 50% { transform: translateX(14%) scaleY(1); } }
|
|
55
61
|
@keyframes ep-breathe { 0%, 100% { opacity: 0.45; } 50% { opacity: 1; } }
|
|
56
62
|
@keyframes ep-ripple { from { opacity: 0.9; transform: translate(-50%, -50%) scale(0.3); } to { opacity: 0; transform: translate(-50%, -50%) scale(1.8); } }
|
|
@@ -62,7 +68,7 @@ ${d.hash.toLowerCase()}`):null,f=lo(o,t)??"";try{let p=o?.getItem(l);f&&p&&p!==g
|
|
|
62
68
|
inset: 0;
|
|
63
69
|
overflow: hidden;
|
|
64
70
|
opacity: 0;
|
|
65
|
-
transition: opacity ${
|
|
71
|
+
transition: opacity ${Dt}ms var(--p-ease);
|
|
66
72
|
box-shadow: inset 0 0 18px var(--c1);
|
|
67
73
|
--p-depth: 64px;
|
|
68
74
|
}
|
|
@@ -102,8 +108,52 @@ ${d.hash.toLowerCase()}`):null,f=lo(o,t)??"";try{let p=o?.getItem(l);f&&p&&p!==g
|
|
|
102
108
|
opacity: 0;
|
|
103
109
|
visibility: hidden;
|
|
104
110
|
transform: translate(-50%, -8px);
|
|
105
|
-
transition: opacity ${
|
|
111
|
+
transition: opacity ${Dt}ms var(--p-ease), transform ${Dt}ms var(--p-ease), visibility 0s ${Dt}ms;
|
|
112
|
+
}
|
|
113
|
+
/* Con un modal abierto, la confirmaci\xF3n se pide ac\xE1 y no en el panel: el aviso
|
|
114
|
+
crece hacia abajo con la acci\xF3n, el valor y las tres respuestas. El aviso se
|
|
115
|
+
puede tocar siempre que se ve, tambi\xE9n con el modal: lo que cae en \xE9l no le
|
|
116
|
+
llega a la p\xE1gina (ver 'onBlind'), as\xED que Detener no cierra el modal. */
|
|
117
|
+
.ep-ask { display: none; }
|
|
118
|
+
.ep-root[data-ask] .ep-bar {
|
|
119
|
+
flex-wrap: wrap;
|
|
120
|
+
width: min(460px, calc(100vw - 24px));
|
|
121
|
+
padding: 10px 10px 12px 14px;
|
|
122
|
+
border-radius: 18px;
|
|
123
|
+
}
|
|
124
|
+
.ep-root[data-ask] .ep-text { flex: 1; }
|
|
125
|
+
.ep-root[data-ask] .ep-ask { display: flex; flex-direction: column; gap: 8px; flex-basis: 100%; }
|
|
126
|
+
.ep-what { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
|
|
127
|
+
.ep-value {
|
|
128
|
+
margin: 0;
|
|
129
|
+
max-height: 4.6em;
|
|
130
|
+
overflow: auto;
|
|
131
|
+
padding: 6px 10px;
|
|
132
|
+
border-radius: 10px;
|
|
133
|
+
background: var(--p-tint);
|
|
134
|
+
font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
|
135
|
+
font-size: 12px;
|
|
136
|
+
font-weight: 400;
|
|
137
|
+
white-space: pre-wrap;
|
|
138
|
+
overflow-wrap: anywhere;
|
|
106
139
|
}
|
|
140
|
+
.ep-btns { display: flex; flex-wrap: wrap; gap: 6px; }
|
|
141
|
+
.ep-btn {
|
|
142
|
+
all: unset;
|
|
143
|
+
flex: 1 1 auto;
|
|
144
|
+
cursor: pointer;
|
|
145
|
+
text-align: center;
|
|
146
|
+
padding: 6px 12px;
|
|
147
|
+
border-radius: 999px;
|
|
148
|
+
background: var(--p-tint);
|
|
149
|
+
color: var(--p-ink);
|
|
150
|
+
font: inherit;
|
|
151
|
+
font-weight: 600;
|
|
152
|
+
transition: transform 160ms var(--p-ease);
|
|
153
|
+
}
|
|
154
|
+
.ep-btn[data-primary] { background: var(--p-accent); color: var(--p-on-accent); }
|
|
155
|
+
.ep-btn:active { transform: scale(0.97); }
|
|
156
|
+
.ep-btn:focus-visible { outline: 2px solid var(--p-accent); outline-offset: 2px; }
|
|
107
157
|
.ep-root[data-on] .ep-bar {
|
|
108
158
|
opacity: 1;
|
|
109
159
|
visibility: visible;
|
|
@@ -140,7 +190,7 @@ ${d.hash.toLowerCase()}`):null,f=lo(o,t)??"";try{let p=o?.getItem(l);f&&p&&p!==g
|
|
|
140
190
|
left: 0;
|
|
141
191
|
top: 0;
|
|
142
192
|
opacity: 0;
|
|
143
|
-
transition: opacity ${
|
|
193
|
+
transition: opacity ${Dt}ms var(--p-ease);
|
|
144
194
|
will-change: transform;
|
|
145
195
|
}
|
|
146
196
|
.ep-root[data-on] .ep-cursor[data-shown] { opacity: 1; }
|
|
@@ -177,6 +227,7 @@ ${d.hash.toLowerCase()}`):null,f=lo(o,t)??"";try{let p=o?.getItem(l);f&&p&&p!==g
|
|
|
177
227
|
border-radius: 50%;
|
|
178
228
|
border: 2.5px solid var(--p-accent);
|
|
179
229
|
background: rgba(3, 133, 255, 0.18);
|
|
230
|
+
background: color-mix(in srgb, var(--p-accent) 18%, transparent);
|
|
180
231
|
box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.85), 0 0 12px 2px rgba(124, 92, 255, 0.45);
|
|
181
232
|
animation: ep-ripple 520ms var(--p-ease) forwards;
|
|
182
233
|
}
|
|
@@ -201,107 +252,64 @@ ${d.hash.toLowerCase()}`):null,f=lo(o,t)??"";try{let p=o?.getItem(l);f&&p&&p!==g
|
|
|
201
252
|
@media (prefers-reduced-motion: reduce) {
|
|
202
253
|
*, *::before, *::after { animation: none !important; transition: none !important; }
|
|
203
254
|
}
|
|
204
|
-
`,
|
|
255
|
+
`,Na="M3 3l7.2 17.4 2.6-7.2 7.2-2.6z";function Ia(e,o={}){return lo(e,o)}function lo(e,o){let n=o.doc??(typeof document<"u"?document:null);if(!n||!e||typeof e.presence!="function")return null;try{return qa(n,e,o)}catch{return null}}function qa(e,o,n){let r={...Yt(n.lang),...n.text},s=e.defaultView,a="http://www.w3.org/2000/svg",c=e.createElement("div");c.setAttribute(Tn,""),c.setAttribute(et,""),c.setAttribute("style","position: fixed; inset: 0; z-index: 2147483647; pointer-events: none; display: block");let l=c.attachShadow({mode:"closed"}),d=(f,y,C)=>{let b=e.createElement(f);return b.className=y,C.appendChild(b),b},m=e.createElement("style");m.textContent=Pa,l.appendChild(m);let h=d("div","ep-root",l),x=n.cursor!==!1;if(n.glow!==!1){let f=d("div","ep-frame",h);f.setAttribute("aria-hidden","true");for(let y=0;y<4;y++){let C=d("b","",f);for(let b=0;b<3;b++)d("i","",C).style.cssText=`left:${b*35-5}%;--c:var(--c${(y+b)%4});--s:${7+(y*3+b*5)%7}s;--w:-${(y*5+b*3)%9}s`}}let w=d("div","ep-bar",h);w.setAttribute("role","status"),w.setAttribute("aria-live","polite"),d("span","ep-dot",w).setAttribute("aria-hidden","true");let A=d("span","ep-text",w),P=d("button","ep-stop",w);P.type="button",P.textContent=r.stop;let S=d("div","ep-ask",w),G=d("p","ep-what",S),L=d("p","ep-value",S),$=d("div","ep-btns",S),q=f=>{let y=d("button","ep-btn",$);return y.type="button",y.textContent=f,y},j=q(r.allow);j.setAttribute("data-primary","");let V=q(r.allowAlways),I=q(r.decline),R=d("div","ep-cursor",h);x||R.remove(),R.setAttribute("aria-hidden","true");let re=e.createElementNS(a,"svg");for(let[f,y]of Object.entries({class:"ep-arrow",width:24,height:24,viewBox:"0 0 24 24"}))re.setAttribute(f,String(y));let ve=re.appendChild(e.createElementNS(a,"path"));for(let[f,y]of Object.entries({d:Na,fill:"#1f2124",stroke:"#ffffff","stroke-width":1.6,"stroke-linejoin":"round"}))ve.setAttribute(f,String(y));R.appendChild(re);let Te=d("span","ep-name",R),K=!1,ne=!1,Se="",de=null,be=null,ze=null,Ne=!1,pe=null,Z=null,ue=null,u=0,v=0,k=new Map,H=new WeakMap,D=()=>{try{return s?.matchMedia?.("(prefers-reduced-motion: reduce)").matches===!0}catch{return!1}},O=()=>s?.innerWidth||e.documentElement.clientWidth||0,B=()=>s?.innerHeight||e.documentElement.clientHeight||0,we=()=>{let f=c.offsetWidth,y=f?c.getBoundingClientRect().width/f:1;return y>0&&Number.isFinite(y)?y:1},Ie=()=>{let f=c.getBoundingClientRect();return{x:f.left||0,y:f.top||0,z:we()}},se=()=>n.themeOf?n.themeOf():n.theme==="light"||n.theme==="dark"?n.theme:An(e,c,O()/2,24),J=new Error("stopped"),fe=f=>{if(ne||Ne||f.epoch!==v)throw J;return!f.dead&&f.seq===u},U=(f,y)=>new Promise((C,b)=>{let N=()=>{clearTimeout(z),k.delete(F)},F=()=>{N(),b(J)},z=setTimeout(()=>{N(),C()},f);k.set(F,{run:y,release:()=>(N(),C())})}),nt=f=>{for(let[y,C]of[...k])(!f||C.run===f)&&y()},X=f=>{for(let y of[...k.values()])y.run!==f&&y.release()},ie=f=>{!ue||f&&ue.run!==f||(ue.node.remove(),ue=null)},Le=(f,y,C)=>{let b=Ie();R.style.transition=C>0?`transform ${C}ms cubic-bezier(0.23, 1, 0.32, 1), opacity ${Dt}ms`:"none",R.style.transform=`translate3d(${Math.round((f-b.x)/b.z)}px, ${Math.round((y-b.y)/b.z)}px, 0)`,pe={x:f,y}},me=()=>{A.textContent=de&&!be?`${Se} \xB7 ${de}`:Se},ot=()=>{let f=e.body??e.documentElement;if(!K){c.isConnected&&c.parentNode!==f&&f.appendChild(c),qe(!1);return}let y=ze?.isConnected?ze:f;c.parentNode!==y&&y.appendChild(c),qe(y!==f),it()},ge=!1,xt=()=>{try{return c.matches(":popover-open")}catch{return null}},qe=f=>{let y=c;if(!f){ge=!1,c.hasAttribute("popover")&&c.removeAttribute("popover");return}if(!(ge||typeof y.showPopover!="function")){try{c.hasAttribute("popover")||c.setAttribute("popover","manual"),xt()||y.showPopover()}catch{}(xt()===!1||!c.hasAttribute("popover"))&&(ge=!0,c.removeAttribute("popover"))}},xe=null,De=()=>Array.from((e.body??e.documentElement).children).filter(f=>f!==c),it=()=>{if(!K)return;let f=c.hasAttribute("inert"),y=c.getAttribute("aria-hidden");if(!f&&y===null)return;let C=De();xe={inert:f?C.filter(b=>b.hasAttribute("inert")):xe?.inert??null,hidden:y!==null?{value:y,with:C.filter(b=>b.getAttribute("aria-hidden")===y)}:xe?.hidden??null},f&&c.removeAttribute("inert"),y!==null&&c.removeAttribute("aria-hidden")},rt=(f,y)=>{let C=f.filter(b=>b.isConnected);return C.length>0&&C.every(y)},yt=()=>{if(!xe)return;let{inert:f,hidden:y}=xe;f&&rt(f,C=>C.hasAttribute("inert"))&&c.setAttribute("inert",""),y&&rt(y.with,C=>C.getAttribute("aria-hidden")===y.value)&&c.setAttribute("aria-hidden",y.value),xe=null},ce=s?.MutationObserver?new s.MutationObserver(it):null;ce?.observe(c,{attributes:!0,attributeFilter:["inert","aria-hidden"]});let at=()=>{if(ne)return;if(Z!==null&&clearTimeout(Z),Z=null,K){ot();return}K=!0,c.setAttribute("data-theme",se());let f=((n.nameOf?n.nameOf():n.name)??"").trim().slice(0,60);Te.textContent=f,Te.hidden=!f,Se=f?r.presenceNoticeNamed.replace(/\{name\}/g,()=>f):r.presenceNotice,me(),h.setAttribute("data-on",""),ot()},st=()=>{be=null,h.removeAttribute("data-ask"),G.textContent="",L.textContent=""},Ge=()=>{Ne=!1,at()},Me=()=>{v++,nt(),Z!==null&&clearTimeout(Z),Z=null,ie(),K&&(K=!1,pe=null,A.textContent="",Se="",de=null,st(),h.removeAttribute("data-on"),h.removeAttribute("data-modal-suspended"),R.removeAttribute("data-shown"),R.removeAttribute("data-press"),e.activeElement===c&&l.activeElement?.blur(),yt(),ot())},ct=()=>{let f=K;if(Ne=!0,Me(),f)try{n.onStop?.()}catch{}},ke=f=>{let y=f.getBoundingClientRect(),C=Math.max(y.left,0),b=Math.max(y.top,0),N=Math.min(y.right,O()),F=Math.min(y.bottom,B());for(let z=f.parentElement;z&&z!==e.body&&z!==e.documentElement;z=z.parentElement){let W=s?.getComputedStyle(z);if(!W)break;if(Aa.test(`${W.overflowX} ${W.overflowY} ${W.overflow}`)){let Q=z.getBoundingClientRect();C=Math.max(C,Q.left),b=Math.max(b,Q.top),N=Math.min(N,Q.right),F=Math.min(F,Q.bottom)}if(W.position==="fixed")break}return N-C>=1&&F-b>=1?new DOMRect(C,b,N-C,F-b):null},wt=(f,y,C)=>{let b=[];try{b=e.elementsFromPoint(y,C)}catch{}let N=b.find(F=>!F.closest(`[${et}]`));return!b.length||!!N&&(N===f||f.contains(N))},ye=(f,y)=>{let C=ke(f);if(!C)return null;let b=y?[Math.min(16,C.width/2)/C.width,.5,.85]:[.5,.25,.75];for(let N of[.5,.25,.75])for(let F of b){let z=C.left+C.width*F,W=C.top+C.height*N;if(wt(f,z,W))return{x:z,y:W}}return null},Jt=async(f,y,C,b)=>{let N=ye(f,y);if(!N){if(f.scrollIntoView({block:"center",inline:"nearest",behavior:C?"auto":"smooth"}),!C){let F=f.getBoundingClientRect(),z=0;for(let W=0;W<Ra&&z<2&&fe(b);W+=50){await U(50,b);let Q=f.getBoundingClientRect();z=Q.top===F.top&&Q.left===F.left?z+1:0,F=Q}}if(!fe(b))return null;N=ye(f,y)}return N?{...N,r:f.getBoundingClientRect()}:null},Ot=(f,y)=>{let C=Ie(),b=d("span","ep-ripple",h);b.setAttribute("aria-hidden","true"),b.style.left=`${(f-C.x)/C.z}px`,b.style.top=`${(y-C.y)/C.z}px`,setTimeout(()=>b.remove(),600)},Sn=(f,y,C,b)=>{ie();let{x:N,y:F,z}=Ie(),W=Math.max(12,Math.min(20,f.height*.6)),Q=d("span","ep-caret",h);Q.setAttribute("aria-hidden","true"),Q.style.left=`${Math.round((y+2-N)/z)}px`,Q.style.top=`${Math.round((C-W/2-F)/z)}px`,Q.style.height=`${Math.round(W/z)}px`,ue={node:Q,run:b}},Zt=async(f,y)=>{if(ne)return;if(Ne)throw J;let C={seq:++u,epoch:v,dead:!1};if(H.set(f,C),X(C),at(),ie(),!y)return;let b=D(),N=f.type==="fill",F=await Jt(y,N,b,C);if(!fe(C)||!x)return;if(!F){R.removeAttribute("data-shown");return}let z=O(),W=B(),Q=(Et,rn)=>Math.max(4,Math.min(rn-4,Et)),Ct=Q(F.x,z),Ce=Q(F.y,W),Be=pe;Be||(Be=n.origin?.()??{x:z-40,y:W-40},Le(Be.x,Be.y,0),R.getBoundingClientRect()),R.setAttribute("data-shown","");let on=Math.hypot(Ct-Be.x,Ce-Be.y),pt=b||on<1?0:Math.round(Math.min(Ta,Math.max(Sa,on*La)));Le(Ct,Ce,pt),pt&&await U(pt,C),fe(C)&&(f.type==="click"?b||(R.setAttribute("data-press",""),Ot(Ct,Ce),await U(Ma,C).finally(()=>R.removeAttribute("data-press"))):N&&(Sn(F.r,Ct,Ce,C),await U(Ha,C),fe(C)||ie(C)),fe(C))},Xt=f=>{let y=H.get(f);y&&(y.dead=!0,nt(y),ie(y));let C=n.idleMs??_a;K&&C>0&&(Z!==null&&clearTimeout(Z),Z=setTimeout(Me,C))},Qe=f=>()=>{try{be?.[f]()}catch{}},en=Qe("allow"),$t=Qe("always"),tn=Qe("decline"),Ln=new Map([[P,ct],[j,en],[V,$t],[I,tn]]),kt=f=>{let y=f,C=null;return(f.type!=="click"||y.detail!==0)&&typeof l.elementFromPoint=="function"&&(C=l.elementFromPoint(y.clientX,y.clientY)),(!C||C.getRootNode()!==l)&&(C=f.type==="click"?l.activeElement:null),C?.closest("button")??null},lt=f=>{if(!(!f.isTrusted||!f.composedPath().includes(c))){if(f.stopPropagation(),f.type==="pointerdown"||f.type==="mousedown")kt(f)&&f.preventDefault();else if(f.type==="click"){let y=Ln.get(kt(f));y&&y()}}},dt=o.presence({before:Zt,after:Xt}),nn=xn(w);for(let f of Xi)s?.addEventListener(f,lt,{capture:!0,passive:f.startsWith("touch")});let Ye=f=>{f.target===c&&f.stopImmediatePropagation()};for(let f of er)s?.addEventListener(f,Ye,!0);return{start:Ge,end:Me,stop:ct,setStatus(f){de=f?.trim()||null,K&&me()},setModalSuspended(f){h.toggleAttribute("data-modal-suspended",f)},setAsk(f){if(f!==be){if(!f){st(),me();return}be=f,G.textContent=f.value===void 0?f.what.replace(/:\s*$/,""):f.what,L.textContent=f.value??"",L.hidden=f.value===void 0,h.setAttribute("data-ask",""),me()}},setLayer(f){ze=f,ot()},setAccent(f){eo(l,f,y=>`--p-accent:${y.accent};--p-on-accent:${y.onAccent};`)},destroy(){if(!ne){Me(),ne=!0,dt(),nn(),ce?.disconnect();for(let f of Xi)s?.removeEventListener(f,lt,{capture:!0});c.remove();for(let f of er)s?.removeEventListener(f,Ye,!0)}},get active(){return K}}}var tr=bi+`
|
|
205
256
|
:host {
|
|
206
257
|
all: initial !important;
|
|
207
258
|
position: fixed !important;
|
|
208
259
|
z-index: 2147483647 !important;
|
|
209
260
|
display: block !important;
|
|
210
|
-
--c-page: #
|
|
261
|
+
--c-page: #f6f6f4;
|
|
211
262
|
--c-surface: #ffffff;
|
|
212
|
-
--c-inset: #
|
|
213
|
-
--c-field: #
|
|
214
|
-
--c-
|
|
215
|
-
--c-
|
|
216
|
-
--c-
|
|
217
|
-
--c-
|
|
218
|
-
--c-
|
|
219
|
-
--c-
|
|
220
|
-
--c-accent: #
|
|
221
|
-
--c-accent-
|
|
222
|
-
--c-accent
|
|
223
|
-
--c-green: #
|
|
224
|
-
--c-green-tint: #
|
|
225
|
-
--c-
|
|
226
|
-
--c-red: #
|
|
227
|
-
--c-
|
|
228
|
-
--c-
|
|
229
|
-
--c-
|
|
230
|
-
--c-
|
|
231
|
-
--c-on-ink: #
|
|
232
|
-
--c-
|
|
233
|
-
--c-overlay: 0 0 0 1px var(--c-
|
|
263
|
+
--c-inset: #f7f7f5;
|
|
264
|
+
--c-field: #f3f3f0;
|
|
265
|
+
--c-ink: #1a1a19;
|
|
266
|
+
--c-ink2: #5e5d57;
|
|
267
|
+
--c-ink3: #8b8a83;
|
|
268
|
+
--c-line: #efeeeb;
|
|
269
|
+
--c-line2: #e6e5e1;
|
|
270
|
+
--c-accent: #4c5fd5;
|
|
271
|
+
--c-accent-tint: #eef0fe;
|
|
272
|
+
--c-accent-line: #d5dafb;
|
|
273
|
+
--c-on-accent: #ffffff;
|
|
274
|
+
--c-green: #2e7d5b;
|
|
275
|
+
--c-green-tint: #e8f4ee;
|
|
276
|
+
--c-red: #c0392b;
|
|
277
|
+
--c-red-tint: #fbeae7;
|
|
278
|
+
--c-warn: #b4661c;
|
|
279
|
+
--c-warn-tint: #fbf0e4;
|
|
280
|
+
--c-skel: #ecebe7;
|
|
281
|
+
--c-skel-hi: #f7f7f5;
|
|
282
|
+
--c-on-ink: #f6f6f4;
|
|
283
|
+
--c-shadow: 0 1px 2px rgba(24, 24, 22, 0.05), 0 8px 24px -12px rgba(24, 24, 22, 0.14);
|
|
284
|
+
--c-overlay: 0 0 0 1px var(--c-line2), 0 2px 6px rgba(24, 24, 22, 0.06), 0 24px 60px -18px rgba(24, 24, 22, 0.28);
|
|
234
285
|
--c-ease: cubic-bezier(0.23, 1, 0.32, 1);
|
|
235
286
|
--c-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
|
|
236
287
|
}
|
|
237
|
-
@supports (color: oklch(0 0 0)) {
|
|
238
|
-
:host {
|
|
239
|
-
--c-page: oklch(0.985 0.001 286);
|
|
240
|
-
--c-surface: oklch(1 0 0);
|
|
241
|
-
--c-inset: oklch(0.979 0.002 248);
|
|
242
|
-
--c-field: oklch(0.961 0.001 286);
|
|
243
|
-
--c-hover: oklch(0.97 0.002 248);
|
|
244
|
-
--c-ink: oklch(0.247 0.006 258);
|
|
245
|
-
--c-ink2: oklch(0.506 0.01 264);
|
|
246
|
-
--c-ink3: oklch(0.695 0.009 264);
|
|
247
|
-
--c-line: oklch(0.946 0.003 264);
|
|
248
|
-
--c-line2: oklch(0.912 0.005 258);
|
|
249
|
-
--c-accent: oklch(0.626 0.205 255);
|
|
250
|
-
--c-accent-tint: oklch(0.96 0.019 253);
|
|
251
|
-
--c-accent-ink: oklch(0.5 0.18 255);
|
|
252
|
-
--c-green: oklch(0.603 0.155 151);
|
|
253
|
-
--c-green-tint: oklch(0.958 0.017 159);
|
|
254
|
-
--c-green-ink: oklch(0.46 0.13 151);
|
|
255
|
-
--c-red: oklch(0.621 0.192 23);
|
|
256
|
-
--c-red-tint: oklch(0.956 0.017 17);
|
|
257
|
-
--c-red-ink: oklch(0.5 0.18 23);
|
|
258
|
-
--c-warn-tint: oklch(0.967 0.025 80);
|
|
259
|
-
--c-warn-ink: oklch(0.5 0.12 65);
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
288
|
:host([data-theme="dark"]) {
|
|
263
|
-
--c-page: #
|
|
264
|
-
--c-surface: #
|
|
265
|
-
--c-inset: #
|
|
266
|
-
--c-field: #
|
|
267
|
-
--c-
|
|
268
|
-
--c-
|
|
269
|
-
--c-
|
|
270
|
-
--c-
|
|
271
|
-
--c-
|
|
272
|
-
--c-
|
|
273
|
-
--c-accent: #
|
|
274
|
-
--c-accent-
|
|
275
|
-
--c-accent
|
|
276
|
-
--c-green: #
|
|
277
|
-
--c-green-tint:
|
|
278
|
-
--c-
|
|
279
|
-
--c-red: #
|
|
280
|
-
--c-
|
|
281
|
-
--c-
|
|
282
|
-
--c-
|
|
283
|
-
--c-
|
|
284
|
-
--c-on-ink: #
|
|
285
|
-
--c-
|
|
286
|
-
--c-overlay: 0 0 0 1px rgba(
|
|
287
|
-
}
|
|
288
|
-
@supports (color: oklch(0 0 0)) {
|
|
289
|
-
:host([data-theme="dark"]) {
|
|
290
|
-
--c-page: oklch(0.209 0.004 264);
|
|
291
|
-
--c-surface: oklch(0.26 0.006 271);
|
|
292
|
-
--c-inset: oklch(0.243 0.006 271);
|
|
293
|
-
--c-field: oklch(0.293 0.006 271);
|
|
294
|
-
--c-hover: oklch(0.289 0.006 271);
|
|
295
|
-
--c-ink: oklch(0.964 0.002 248);
|
|
296
|
-
--c-ink2: oklch(0.731 0.008 261);
|
|
297
|
-
--c-ink3: oklch(0.541 0.01 264);
|
|
298
|
-
--c-line: oklch(0.308 0.006 258);
|
|
299
|
-
--c-line2: oklch(0.356 0.007 264);
|
|
300
|
-
--c-accent: oklch(0.68 0.173 253);
|
|
301
|
-
--c-accent-tint: oklch(0.68 0.173 253 / 0.15);
|
|
302
|
-
--c-accent-ink: oklch(0.78 0.12 253);
|
|
303
|
-
--c-hair: oklch(1 0 0 / 0.11);
|
|
304
|
-
}
|
|
289
|
+
--c-page: #101114;
|
|
290
|
+
--c-surface: #181a1e;
|
|
291
|
+
--c-inset: #14161a;
|
|
292
|
+
--c-field: #1d2025;
|
|
293
|
+
--c-ink: #f1f1ef;
|
|
294
|
+
--c-ink2: #a9a9a4;
|
|
295
|
+
--c-ink3: #7c7c77;
|
|
296
|
+
--c-line: #23262c;
|
|
297
|
+
--c-line2: #2a2d34;
|
|
298
|
+
--c-accent: #8e9bff;
|
|
299
|
+
--c-accent-tint: #1e2334;
|
|
300
|
+
--c-accent-line: #2e3550;
|
|
301
|
+
--c-on-accent: #14161c;
|
|
302
|
+
--c-green: #6fd09e;
|
|
303
|
+
--c-green-tint: #16251e;
|
|
304
|
+
--c-red: #f08c7d;
|
|
305
|
+
--c-red-tint: #2a1917;
|
|
306
|
+
--c-warn: #e0a468;
|
|
307
|
+
--c-warn-tint: #2a2016;
|
|
308
|
+
--c-skel: #23262c;
|
|
309
|
+
--c-skel-hi: #2c3037;
|
|
310
|
+
--c-on-ink: #101114;
|
|
311
|
+
--c-shadow: 0 1px 2px rgba(0, 0, 0, 0.5), 0 10px 30px -14px rgba(0, 0, 0, 0.7);
|
|
312
|
+
--c-overlay: 0 0 0 1px var(--c-line2), 0 2px 8px rgba(0, 0, 0, 0.55), 0 30px 70px -20px rgba(0, 0, 0, 0.85);
|
|
305
313
|
}
|
|
306
314
|
|
|
307
315
|
@keyframes ec-shimmer { from { background-position: 150% 0; } to { background-position: -50% 0; } }
|
|
@@ -313,9 +321,9 @@ ${d.hash.toLowerCase()}`):null,f=lo(o,t)??"";try{let p=o?.getItem(l);f&&p&&p!==g
|
|
|
313
321
|
@keyframes ec-pulse { 0%, 100% { opacity: 0.35; transform: scale(0.8); } 50% { opacity: 1; transform: none; } }
|
|
314
322
|
|
|
315
323
|
.ec-root {
|
|
316
|
-
font-family:
|
|
317
|
-
font-size:
|
|
318
|
-
line-height: 1.
|
|
324
|
+
font-family: 'Instrument Sans', ui-sans-serif, system-ui, sans-serif;
|
|
325
|
+
font-size: 14px;
|
|
326
|
+
line-height: 1.45;
|
|
319
327
|
color: var(--c-ink);
|
|
320
328
|
position: relative;
|
|
321
329
|
-webkit-font-smoothing: antialiased;
|
|
@@ -328,14 +336,14 @@ textarea:focus-visible,
|
|
|
328
336
|
a:focus-visible { outline: 2px solid var(--c-accent); outline-offset: 2px; }
|
|
329
337
|
svg { display: block; flex: none; }
|
|
330
338
|
|
|
331
|
-
/* El bot\xF3n flotante */
|
|
339
|
+
/* El bot\xF3n flotante. Con un acento propio (accent.ts) lleva el acento. */
|
|
332
340
|
.ec-trigger {
|
|
333
341
|
position: relative;
|
|
334
342
|
width: 52px;
|
|
335
343
|
height: 52px;
|
|
336
344
|
border-radius: 999px;
|
|
337
|
-
background: var(--c-ink);
|
|
338
|
-
color: var(--c-on-ink);
|
|
345
|
+
background: var(--c-trigger, var(--c-ink));
|
|
346
|
+
color: var(--c-on-trigger, var(--c-on-ink));
|
|
339
347
|
box-shadow: var(--c-overlay);
|
|
340
348
|
display: grid;
|
|
341
349
|
place-items: center;
|
|
@@ -344,6 +352,61 @@ svg { display: block; flex: none; }
|
|
|
344
352
|
.ec-trigger:hover { transform: scale(1.04); }
|
|
345
353
|
.ec-trigger:active { transform: scale(0.96); }
|
|
346
354
|
.ec-trigger[data-pending] { opacity: 0; transform: scale(0.85); pointer-events: none; }
|
|
355
|
+
/* Con un di\xE1logo modal abierto el widget no desaparece: se achica a una tira
|
|
356
|
+
contra el borde derecho, flotante, ampliado o acoplado. Lo \xFAnico que se
|
|
357
|
+
toca es la tira, que abre el panel encima del modal sin que el clic le
|
|
358
|
+
llegue a la p\xE1gina. El resto del host (acoplado ocupa toda la columna) no
|
|
359
|
+
le cae encima al modal. Las posiciones van con important: tienen que
|
|
360
|
+
ganarle a las del tama\xF1o acoplado. */
|
|
361
|
+
:host([data-modal-collapsed]) { pointer-events: none !important; }
|
|
362
|
+
/* Una tira fina (24 \xD7 88), con el color de acento apenas transparente para
|
|
363
|
+
que no pese encima del modal, y el \xEDcono o el avatar encima. El bot\xF3n entero
|
|
364
|
+
es el \xE1rea de clic. Sin color-mix, el acento s\xF3lido. */
|
|
365
|
+
:host([data-modal-collapsed]) .ec-trigger {
|
|
366
|
+
--c-tab-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 6px 16px -6px rgba(0, 0, 0, 0.28);
|
|
367
|
+
--c-tab-ring: var(--c-accent);
|
|
368
|
+
pointer-events: auto;
|
|
369
|
+
position: fixed !important;
|
|
370
|
+
top: calc(50% - 44px) !important;
|
|
371
|
+
right: 0 !important;
|
|
372
|
+
bottom: auto !important;
|
|
373
|
+
left: auto !important;
|
|
374
|
+
width: 24px;
|
|
375
|
+
height: 88px;
|
|
376
|
+
border-radius: 10px 0 0 10px;
|
|
377
|
+
background: var(--c-accent);
|
|
378
|
+
color: var(--c-on-accent);
|
|
379
|
+
box-shadow: var(--c-tab-shadow);
|
|
380
|
+
}
|
|
381
|
+
@supports (background: color-mix(in srgb, red 90%, transparent)) {
|
|
382
|
+
:host([data-modal-collapsed]) .ec-trigger {
|
|
383
|
+
--c-tab-ring: color-mix(in srgb, var(--c-accent) 60%, transparent);
|
|
384
|
+
background: color-mix(in srgb, var(--c-accent) 90%, transparent);
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
:host([data-modal-collapsed]) .ec-trigger img,
|
|
388
|
+
:host([data-modal-collapsed]) .ec-trigger svg { display: block; width: 18px; height: 18px; }
|
|
389
|
+
:host([data-modal-collapsed]) .ec-trigger:hover { transform: none; background: var(--c-accent); }
|
|
390
|
+
/* El foco, adentro de la tira: un contorno de afuera se corta contra el borde
|
|
391
|
+
derecho de la ventana. */
|
|
392
|
+
:host([data-modal-collapsed]) .ec-trigger:focus-visible { outline: none; }
|
|
393
|
+
:host([data-modal-collapsed]) .ec-trigger:focus-visible::after {
|
|
394
|
+
content: '';
|
|
395
|
+
position: absolute;
|
|
396
|
+
inset: 1px;
|
|
397
|
+
border: 2px solid var(--c-on-accent);
|
|
398
|
+
border-right: 0;
|
|
399
|
+
border-radius: 9px 0 0 9px;
|
|
400
|
+
pointer-events: none;
|
|
401
|
+
}
|
|
402
|
+
/* Espera permiso y el panel est\xE1 colapsado: la tira late con un anillo del
|
|
403
|
+
acento, para que se note que algo espera aunque el widget est\xE9 reducido a un
|
|
404
|
+
borde. Late la sombra, no el tama\xF1o. */
|
|
405
|
+
:host([data-modal-collapsed]) .ec-trigger[data-ask] { animation: ec-ask 1.6s var(--c-ease) infinite; }
|
|
406
|
+
@keyframes ec-ask {
|
|
407
|
+
0%, 100% { box-shadow: 0 0 0 0 var(--c-tab-ring), var(--c-tab-shadow); }
|
|
408
|
+
70% { box-shadow: 0 0 0 10px transparent, var(--c-tab-shadow); }
|
|
409
|
+
}
|
|
347
410
|
.ec-trigger > * {
|
|
348
411
|
grid-area: 1 / 1;
|
|
349
412
|
transition: opacity 0.2s var(--c-ease), transform 0.3s var(--c-ease);
|
|
@@ -359,12 +422,12 @@ svg { display: block; flex: none; }
|
|
|
359
422
|
position: absolute;
|
|
360
423
|
width: 380px;
|
|
361
424
|
max-width: calc(100vw - 32px);
|
|
362
|
-
height:
|
|
425
|
+
height: 600px;
|
|
363
426
|
max-height: calc(100vh - 100px);
|
|
364
427
|
display: flex;
|
|
365
428
|
flex-direction: column;
|
|
366
429
|
background: var(--c-surface);
|
|
367
|
-
border-radius:
|
|
430
|
+
border-radius: 22px;
|
|
368
431
|
box-shadow: var(--c-overlay);
|
|
369
432
|
overflow: hidden;
|
|
370
433
|
transition: opacity 0.18s var(--c-ease), transform 0.26s var(--c-ease), display 0.26s allow-discrete;
|
|
@@ -379,57 +442,78 @@ svg { display: block; flex: none; }
|
|
|
379
442
|
:host([data-corner="bottom-left"]) .ec-panel { transform-origin: bottom left; }
|
|
380
443
|
:host([data-corner="top-right"]) .ec-panel { transform-origin: top right; }
|
|
381
444
|
:host([data-corner="top-left"]) .ec-panel { transform-origin: top left; }
|
|
445
|
+
.ec-root[data-size="expanded"] .ec-panel { position: fixed; top: 24px; bottom: 24px; left: auto; right: 0; margin: 0; width: 720px; height: auto; max-height: none; transform-origin: top right; }
|
|
446
|
+
:host([data-corner$="left"]) .ec-root[data-size="expanded"] .ec-panel { left: 0; right: auto; transform-origin: top left; }
|
|
447
|
+
:host([data-corner^="bottom"]) .ec-root[data-size="expanded"] .ec-panel { transform-origin: bottom right; }
|
|
448
|
+
:host([data-corner="bottom-left"]) .ec-root[data-size="expanded"] .ec-panel { transform-origin: bottom left; }
|
|
449
|
+
:host([data-sticky-docked]) { position: fixed !important; top: 0 !important; right: 0 !important; bottom: 0 !important; left: auto !important; width: 400px !important; height: 100vh !important; margin: 0 !important; }
|
|
450
|
+
.ec-root[data-size="docked"] { height: 100vh; }
|
|
451
|
+
.ec-root[data-size="docked"] .ec-panel { position: sticky; top: 0; bottom: auto; left: auto; right: auto; margin: 0; width: 100%; max-width: 100%; height: 100vh; max-height: 100vh; border-radius: 0; transform-origin: right center; }
|
|
452
|
+
/* Acoplado y minimizado, el panel sale del flujo y el bot\xF3n se iba al principio
|
|
453
|
+
de la columna: quedaba flotando en el medio de la p\xE1gina. Va al pie de la
|
|
454
|
+
columna, que es donde estaba antes de acoplarse. */
|
|
455
|
+
.ec-root[data-size="docked"] .ec-trigger { position: absolute; bottom: 16px; }
|
|
456
|
+
:host([data-corner$="left"]) .ec-root[data-size="docked"] .ec-trigger { left: 16px; }
|
|
457
|
+
:host([data-corner$="right"]) .ec-root[data-size="docked"] .ec-trigger { right: 16px; }
|
|
458
|
+
.ec-root[data-size] .ec-trigger[aria-expanded="true"] { display: none; }
|
|
382
459
|
.ec-panel[data-dodge] { height: auto; }
|
|
460
|
+
.ec-root[data-size] .ec-panel[data-dodge] { top: auto; }
|
|
383
461
|
.ec-panel[data-dodge] .ec-log,
|
|
384
462
|
.ec-panel[data-dodge] .ec-queue,
|
|
385
463
|
.ec-panel[data-dodge] .ec-form,
|
|
386
464
|
.ec-panel[data-dodge] .ec-pop,
|
|
465
|
+
.ec-panel[data-dodge] .ec-manage,
|
|
387
466
|
.ec-panel[data-dodge] .ec-view,
|
|
388
467
|
.ec-panel[data-dodge] .ec-tabs { display: none; }
|
|
389
468
|
|
|
469
|
+
/* El bloque de "Nueva conversaci\xF3n", s\xF3lo cuando el proyecto no tiene Home: si
|
|
470
|
+
lo tiene, vive en Home y no se duplica. */
|
|
471
|
+
.ec-manage { flex: none; padding: 0 12px 10px; }
|
|
472
|
+
.ec-manage:empty { display: none; }
|
|
473
|
+
|
|
390
474
|
.ec-head {
|
|
391
475
|
display: flex;
|
|
392
476
|
align-items: center;
|
|
393
|
-
gap:
|
|
394
|
-
padding:
|
|
395
|
-
border-bottom: 1px solid var(--c-
|
|
477
|
+
gap: 2px;
|
|
478
|
+
padding: 12px 10px 12px 16px;
|
|
479
|
+
border-bottom: 1px solid var(--c-line);
|
|
396
480
|
}
|
|
397
481
|
.ec-avatar {
|
|
398
|
-
width:
|
|
399
|
-
height:
|
|
482
|
+
width: 34px;
|
|
483
|
+
height: 34px;
|
|
484
|
+
margin-right: 8px;
|
|
400
485
|
border-radius: 999px;
|
|
401
486
|
display: grid;
|
|
402
487
|
place-items: center;
|
|
403
488
|
flex: none;
|
|
404
489
|
overflow: hidden;
|
|
405
490
|
background: var(--c-accent-tint);
|
|
406
|
-
color: var(--c-accent
|
|
491
|
+
color: var(--c-accent);
|
|
407
492
|
}
|
|
408
|
-
.ec-avatar img { width:
|
|
493
|
+
.ec-avatar img { width: 34px; height: 34px; object-fit: cover; }
|
|
409
494
|
.ec-who { flex: 1; min-width: 0; }
|
|
410
495
|
.ec-title {
|
|
411
496
|
margin: 0;
|
|
412
|
-
font-size:
|
|
497
|
+
font-size: 14.5px;
|
|
413
498
|
font-weight: 600;
|
|
414
499
|
overflow: hidden;
|
|
415
500
|
text-overflow: ellipsis;
|
|
416
501
|
white-space: nowrap;
|
|
417
502
|
}
|
|
418
|
-
.ec-status { margin: 0; font-size: 12px; color: var(--c-ink2); display: flex; align-items: center; gap:
|
|
419
|
-
.ec-status::before { content: ''; width:
|
|
420
|
-
.ec-status[hidden] { display: none; }
|
|
503
|
+
.ec-status { margin: 0; font-size: 12px; color: var(--c-ink2); display: flex; align-items: center; gap: 6px; }
|
|
504
|
+
.ec-status::before { content: ''; width: 7px; height: 7px; border-radius: 999px; background: var(--c-green); }
|
|
421
505
|
.ec-icon {
|
|
422
|
-
width:
|
|
423
|
-
height:
|
|
424
|
-
border-radius:
|
|
506
|
+
width: 36px;
|
|
507
|
+
height: 36px;
|
|
508
|
+
border-radius: 12px;
|
|
425
509
|
display: grid;
|
|
426
510
|
place-items: center;
|
|
427
511
|
color: var(--c-ink2);
|
|
428
512
|
transition: background-color 0.15s, color 0.15s;
|
|
429
513
|
}
|
|
430
514
|
.ec-icon:hover,
|
|
431
|
-
.ec-icon[aria-expanded="true"] { background: var(--c-
|
|
432
|
-
.ec-
|
|
515
|
+
.ec-icon[aria-expanded="true"] { background: var(--c-field); color: var(--c-ink); }
|
|
516
|
+
.ec-min svg { transform: rotate(90deg); }
|
|
433
517
|
|
|
434
518
|
/* La conversaci\xF3n */
|
|
435
519
|
.ec-log {
|
|
@@ -441,81 +525,140 @@ svg { display: block; flex: none; }
|
|
|
441
525
|
gap: 14px;
|
|
442
526
|
scrollbar-width: thin;
|
|
443
527
|
}
|
|
528
|
+
.ec-log > * { width: 100%; max-width: 680px; margin-inline: auto; flex: none; }
|
|
444
529
|
.ec-msg { overflow-wrap: anywhere; }
|
|
530
|
+
.ec-u { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; animation: ec-fade-up 0.3s var(--c-ease) both; }
|
|
531
|
+
.ec-u-row { display: flex; align-items: center; justify-content: flex-end; gap: 4px; width: 100%; }
|
|
445
532
|
.ec-msg[data-role="user"] {
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
533
|
+
max-width: 78%;
|
|
534
|
+
padding: 9px 13px;
|
|
535
|
+
border-radius: 16px 16px 6px 16px;
|
|
536
|
+
background: var(--c-accent);
|
|
537
|
+
color: var(--c-on-accent);
|
|
451
538
|
white-space: pre-wrap;
|
|
452
|
-
animation: ec-fade-up 0.3s var(--c-ease) both;
|
|
453
539
|
}
|
|
454
|
-
.ec-
|
|
455
|
-
.ec-msg
|
|
540
|
+
.ec-u[data-failed] .ec-msg { opacity: 0.55; }
|
|
541
|
+
.ec-msg[data-role="assistant"] { line-height: 1.55; animation: ec-fade-up 0.4s var(--c-ease) both; }
|
|
542
|
+
.ec-msg p, .ec-msg ul, .ec-msg ol, .ec-msg pre, .ec-code { margin: 0 0 10px; }
|
|
456
543
|
.ec-msg > :last-child { margin-bottom: 0; }
|
|
457
544
|
.ec-msg ul, .ec-msg ol { padding-left: 20px; }
|
|
458
|
-
.ec-msg li + li { margin-top:
|
|
545
|
+
.ec-msg li + li { margin-top: 4px; }
|
|
459
546
|
.ec-msg strong { font-weight: 600; }
|
|
460
547
|
.ec-msg code,
|
|
461
548
|
.ec-doc code {
|
|
462
549
|
font-family: var(--c-mono);
|
|
463
|
-
font-size:
|
|
464
|
-
padding: 1px
|
|
465
|
-
border-radius:
|
|
466
|
-
background: var(--c-
|
|
467
|
-
box-shadow: 0 0 0 1px var(--c-
|
|
550
|
+
font-size: 12.5px;
|
|
551
|
+
padding: 1px 5px;
|
|
552
|
+
border-radius: 6px;
|
|
553
|
+
background: var(--c-field);
|
|
554
|
+
box-shadow: 0 0 0 1px var(--c-line);
|
|
468
555
|
}
|
|
469
556
|
.ec-msg pre,
|
|
470
557
|
.ec-doc pre {
|
|
471
|
-
padding:
|
|
472
|
-
border-radius:
|
|
558
|
+
padding: 12px;
|
|
559
|
+
border-radius: 12px;
|
|
473
560
|
background: var(--c-inset);
|
|
474
|
-
box-shadow: 0 0 0 1px var(--c-
|
|
561
|
+
box-shadow: 0 0 0 1px var(--c-line2);
|
|
475
562
|
overflow-x: auto;
|
|
476
|
-
line-height: 1.
|
|
563
|
+
line-height: 1.6;
|
|
477
564
|
}
|
|
478
565
|
.ec-msg pre code,
|
|
479
566
|
.ec-doc pre code { padding: 0; background: none; box-shadow: none; white-space: pre; }
|
|
567
|
+
.ec-code { border-radius: 12px; overflow: hidden; background: var(--c-inset); box-shadow: 0 0 0 1px var(--c-line2); }
|
|
568
|
+
.ec-code pre { margin: 0; border-radius: 0; box-shadow: none; }
|
|
569
|
+
.ec-code-head { display: flex; justify-content: flex-end; padding: 2px 4px; border-bottom: 1px solid var(--c-line); }
|
|
570
|
+
.ec-code-copy {
|
|
571
|
+
height: 32px;
|
|
572
|
+
padding: 0 10px;
|
|
573
|
+
border-radius: 9px;
|
|
574
|
+
font-size: 12.5px;
|
|
575
|
+
font-weight: 500;
|
|
576
|
+
color: var(--c-ink2);
|
|
577
|
+
display: flex;
|
|
578
|
+
align-items: center;
|
|
579
|
+
gap: 6px;
|
|
580
|
+
transition: background-color 0.15s, color 0.15s;
|
|
581
|
+
}
|
|
582
|
+
.ec-code-copy:hover { background: var(--c-field); color: var(--c-ink); }
|
|
583
|
+
[data-copied] svg { color: var(--c-green); }
|
|
480
584
|
.ec-caret {
|
|
481
585
|
display: inline-block;
|
|
482
|
-
width:
|
|
483
|
-
height:
|
|
586
|
+
width: 7px;
|
|
587
|
+
height: 15px;
|
|
484
588
|
margin-left: 2px;
|
|
485
|
-
vertical-align: -
|
|
486
|
-
border-radius:
|
|
487
|
-
background: var(--c-
|
|
589
|
+
vertical-align: -2px;
|
|
590
|
+
border-radius: 2px;
|
|
591
|
+
background: var(--c-accent);
|
|
488
592
|
}
|
|
489
593
|
.ec-caret[data-end] { animation: ec-fade-in 0.3s 1s reverse both, ec-caret 1s; }
|
|
490
594
|
|
|
595
|
+
/* Las acciones de cada mensaje: se ven al pasar; las del \xFAltimo, siempre */
|
|
596
|
+
.ec-acts, .ec-bar { display: flex; align-items: center; gap: 2px; flex: none; }
|
|
597
|
+
.ec-bar { margin: -8px 0 -6px -8px; }
|
|
598
|
+
.ec-acts .ec-icon, .ec-bar .ec-icon { width: auto; min-width: 32px; height: 32px; padding: 0 8px; border-radius: 10px; display: flex; gap: 5px; color: var(--c-ink3); font-size: 12px; font-weight: 600; }
|
|
599
|
+
.ec-acts .ec-icon:hover, .ec-bar .ec-icon:hover { color: var(--c-ink); }
|
|
600
|
+
.ec-bar [aria-pressed="true"] { background: var(--c-accent-tint); color: var(--c-accent); }
|
|
601
|
+
.ec-bar [data-down] svg { transform: rotate(180deg); }
|
|
602
|
+
.ec-acts, .ec-bar { opacity: 0; transition: opacity 0.14s ease; }
|
|
603
|
+
.ec-u:hover .ec-acts, .ec-acts:focus-within, .ec-bar:hover, .ec-bar:focus-within, .ec-bar[data-on], :hover + .ec-bar { opacity: 1; }
|
|
604
|
+
@media (hover: none) { .ec-acts, .ec-bar { opacity: 1; } }
|
|
605
|
+
.ec-fail { display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--c-red); }
|
|
606
|
+
.ec-fail span { font-weight: 600; }
|
|
607
|
+
.ec-fail .ec-btn { height: 32px; margin-left: 2px; padding: 0 10px; font-size: 12.5px; }
|
|
608
|
+
.ec-stopped { margin: -4px 0 0; display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--c-ink3); }
|
|
609
|
+
.ec-stopped i { width: 8px; height: 8px; border-radius: 2px; background: currentColor; }
|
|
610
|
+
.ec-regen { height: 32px; padding: 0 8px; margin-left: -4px; border-radius: 9px; color: var(--c-accent); font-weight: 600; }
|
|
611
|
+
.ec-regen::before { content: '\\00b7'; margin-right: 8px; color: var(--c-ink3); }
|
|
612
|
+
.ec-regen:hover { background: var(--c-accent-tint); }
|
|
613
|
+
.ec-bar .ec-regen { margin: 0; color: var(--c-ink3); }
|
|
614
|
+
.ec-bar .ec-regen::before { content: none; }
|
|
615
|
+
.ec-jump {
|
|
616
|
+
position: relative;
|
|
617
|
+
z-index: 1;
|
|
618
|
+
align-self: center;
|
|
619
|
+
margin: -46px 0 12px;
|
|
620
|
+
height: 34px;
|
|
621
|
+
padding: 0 13px 0 10px;
|
|
622
|
+
border-radius: 999px;
|
|
623
|
+
background: var(--c-surface);
|
|
624
|
+
box-shadow: 0 0 0 1px var(--c-line2), var(--c-shadow);
|
|
625
|
+
display: flex;
|
|
626
|
+
align-items: center;
|
|
627
|
+
gap: 6px;
|
|
628
|
+
font-size: 12.5px;
|
|
629
|
+
font-weight: 600;
|
|
630
|
+
animation: ec-fade-up 0.18s ease both;
|
|
631
|
+
}
|
|
632
|
+
.ec-jump svg { transform: rotate(180deg); }
|
|
633
|
+
|
|
491
634
|
.ec-suggest { display: flex; flex-wrap: wrap; gap: 6px; }
|
|
492
635
|
.ec-chip {
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
636
|
+
min-height: 32px;
|
|
637
|
+
padding: 7px 12px;
|
|
638
|
+
border-radius: 999px;
|
|
639
|
+
font-size: 13px;
|
|
496
640
|
text-align: left;
|
|
497
641
|
background: var(--c-surface);
|
|
498
642
|
box-shadow: 0 0 0 1px var(--c-line2);
|
|
499
643
|
animation: ec-fade-up 0.3s var(--c-ease) both;
|
|
500
644
|
transition: background-color 0.15s;
|
|
501
645
|
}
|
|
502
|
-
.ec-chip:hover { background: var(--c-
|
|
646
|
+
.ec-chip:hover { background: var(--c-field); }
|
|
503
647
|
|
|
504
648
|
.ec-thinking {
|
|
505
649
|
display: flex;
|
|
506
650
|
align-items: center;
|
|
507
651
|
gap: 8px;
|
|
652
|
+
font-size: 13.5px;
|
|
508
653
|
color: var(--c-ink2);
|
|
509
654
|
animation: ec-fade-in 0.2s 0.15s both;
|
|
510
655
|
}
|
|
511
|
-
.ec-thinking[hidden] { display: none; }
|
|
512
656
|
.ec-dots { display: flex; gap: 3px; }
|
|
513
657
|
.ec-dots i {
|
|
514
658
|
width: 5px;
|
|
515
659
|
height: 5px;
|
|
516
660
|
border-radius: 999px;
|
|
517
|
-
background: var(--c-
|
|
518
|
-
opacity: 0.6;
|
|
661
|
+
background: var(--c-accent);
|
|
519
662
|
animation: ec-pulse 1.1s ease-in-out infinite;
|
|
520
663
|
}
|
|
521
664
|
.ec-dots i:nth-child(2) { animation-delay: 0.15s; }
|
|
@@ -528,12 +671,12 @@ svg { display: block; flex: none; }
|
|
|
528
671
|
animation: ec-shimmer 1.4s linear infinite;
|
|
529
672
|
}
|
|
530
673
|
.ec-time, .ec-mono { font-family: var(--c-mono); font-size: 11.5px; font-variant-numeric: tabular-nums; }
|
|
674
|
+
.ec-time { color: var(--c-ink3); }
|
|
531
675
|
|
|
532
676
|
/* Las acciones */
|
|
533
677
|
.ec-tools {
|
|
534
|
-
border-radius:
|
|
535
|
-
|
|
536
|
-
background: var(--c-surface);
|
|
678
|
+
border-radius: 12px;
|
|
679
|
+
background: var(--c-field);
|
|
537
680
|
animation: ec-fade-up 0.3s var(--c-ease) both;
|
|
538
681
|
}
|
|
539
682
|
.ec-tools-head {
|
|
@@ -542,11 +685,10 @@ svg { display: block; flex: none; }
|
|
|
542
685
|
align-items: center;
|
|
543
686
|
gap: 6px;
|
|
544
687
|
padding: 8px 10px;
|
|
545
|
-
font-size:
|
|
688
|
+
font-size: 13px;
|
|
546
689
|
color: var(--c-ink2);
|
|
547
|
-
border-radius:
|
|
690
|
+
border-radius: 12px 12px 0 0;
|
|
548
691
|
}
|
|
549
|
-
.ec-tools-head[hidden] { display: none; }
|
|
550
692
|
.ec-tools-head:hover { color: var(--c-ink); }
|
|
551
693
|
.ec-chev { color: var(--c-ink2); transition: transform 0.2s var(--c-ease); }
|
|
552
694
|
[aria-expanded="true"] > .ec-chev { transform: rotate(90deg); }
|
|
@@ -555,48 +697,49 @@ svg { display: block; flex: none; }
|
|
|
555
697
|
.ec-fold > * { min-height: 0; overflow: hidden; }
|
|
556
698
|
.ec-tool { animation: ec-fade-up 0.3s var(--c-ease) both; }
|
|
557
699
|
.ec-tool + .ec-tool,
|
|
558
|
-
.ec-tools-head:not([hidden]) + .ec-fold .ec-tool:first-child { border-top: 1px solid var(--c-
|
|
700
|
+
.ec-tools-head:not([hidden]) + .ec-fold .ec-tool:first-child { border-top: 1px solid var(--c-line2); }
|
|
559
701
|
.ec-tool-row {
|
|
560
702
|
width: 100%;
|
|
703
|
+
min-height: 38px;
|
|
561
704
|
display: flex;
|
|
562
705
|
align-items: center;
|
|
563
706
|
gap: 8px;
|
|
564
|
-
padding: 8px 10px;
|
|
707
|
+
padding: 8px 10px 8px 11px;
|
|
708
|
+
font-size: 13px;
|
|
565
709
|
text-align: left;
|
|
566
|
-
transition: background-color 0.15s;
|
|
567
710
|
}
|
|
568
|
-
.ec-
|
|
569
|
-
.ec-tool:first-child .ec-tool-row { border-radius: 10px 10px 0 0; }
|
|
570
|
-
.ec-tool-row[hidden] { display: none; }
|
|
571
|
-
.ec-state { width: 16px; height: 16px; display: grid; place-items: center; flex: none; }
|
|
711
|
+
.ec-state { width: 18px; height: 18px; display: grid; place-items: center; flex: none; }
|
|
572
712
|
.ec-spin {
|
|
573
|
-
width:
|
|
574
|
-
height:
|
|
713
|
+
width: 18px;
|
|
714
|
+
height: 18px;
|
|
575
715
|
border-radius: 999px;
|
|
576
|
-
border: 2px solid var(--c-
|
|
577
|
-
border-top-color: var(--c-
|
|
716
|
+
border: 2px solid var(--c-accent-line);
|
|
717
|
+
border-top-color: var(--c-accent);
|
|
578
718
|
animation: ec-spin 0.8s linear infinite;
|
|
579
719
|
}
|
|
580
|
-
.ec-state svg { width:
|
|
581
|
-
.ec-tool[data-state="done"] .ec-state svg { background: var(--c-green); color:
|
|
582
|
-
.ec-tool[data-state="error"] .ec-state svg { background: var(--c-red); color:
|
|
583
|
-
.ec-tool[data-state="declined"] .ec-state svg { background: var(--c-
|
|
720
|
+
.ec-state svg { width: 18px; height: 18px; padding: 3px; border-radius: 999px; animation: ec-pop-in 0.25s var(--c-ease) both; }
|
|
721
|
+
.ec-tool[data-state="done"] .ec-state svg { background: var(--c-green); color: var(--c-on-ink); stroke-width: 3.5; }
|
|
722
|
+
.ec-tool[data-state="error"] .ec-state svg { background: var(--c-red); color: var(--c-on-ink); stroke-width: 3.5; }
|
|
723
|
+
.ec-tool[data-state="declined"] .ec-state svg { background: var(--c-ink3); color: var(--c-surface); stroke-width: 3.5; }
|
|
584
724
|
.ec-tool-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
|
|
585
725
|
.ec-pill {
|
|
586
726
|
flex: none;
|
|
587
|
-
font-size:
|
|
588
|
-
font-weight:
|
|
589
|
-
padding: 1px
|
|
590
|
-
border-radius:
|
|
591
|
-
background: var(--c-
|
|
727
|
+
font-size: 11.5px;
|
|
728
|
+
font-weight: 600;
|
|
729
|
+
padding: 1px 8px;
|
|
730
|
+
border-radius: 999px;
|
|
731
|
+
background: var(--c-line);
|
|
592
732
|
color: var(--c-ink2);
|
|
593
733
|
}
|
|
594
|
-
.ec-tool[data-state="
|
|
595
|
-
.ec-tool[data-state="
|
|
596
|
-
.ec-
|
|
597
|
-
.ec-
|
|
734
|
+
.ec-tool[data-state="running"] .ec-pill, .ec-pill[data-tone="accent"] { background: var(--c-accent-tint); color: var(--c-accent); }
|
|
735
|
+
.ec-tool[data-state="done"] .ec-pill, .ec-pill[data-tone="good"] { background: var(--c-green-tint); color: var(--c-green); }
|
|
736
|
+
.ec-tool[data-state="error"] .ec-pill { background: var(--c-red-tint); color: var(--c-red); }
|
|
737
|
+
.ec-pill[data-tone="warn"] { background: var(--c-warn-tint); color: var(--c-warn); }
|
|
738
|
+
.ec-detail { font-size: 12.5px; color: var(--c-ink3); }
|
|
739
|
+
.ec-detail > div > p { margin: 0; padding: 0 11px 4px 37px; overflow-wrap: anywhere; }
|
|
598
740
|
.ec-detail > div > p:last-child { padding-bottom: 10px; }
|
|
599
|
-
.ec-detail b { font-weight:
|
|
741
|
+
.ec-detail b { font-weight: 400; margin-right: 12px; }
|
|
742
|
+
.ec-detail span { color: var(--c-ink); }
|
|
600
743
|
|
|
601
744
|
/* La tarjeta de confirmaci\xF3n */
|
|
602
745
|
.ec-sr {
|
|
@@ -612,129 +755,144 @@ svg { display: block; flex: none; }
|
|
|
612
755
|
.ec-card:focus { outline: 2px solid var(--c-accent); outline-offset: 2px; }
|
|
613
756
|
.ec-card {
|
|
614
757
|
margin: 8px;
|
|
615
|
-
padding:
|
|
616
|
-
border-radius:
|
|
758
|
+
padding: 14px;
|
|
759
|
+
border-radius: 16px;
|
|
617
760
|
background: var(--c-surface);
|
|
618
|
-
box-shadow: 0 0 0 1px var(--c-
|
|
619
|
-
animation: ec-fade-up 0.
|
|
761
|
+
box-shadow: 0 0 0 1px var(--c-accent-line), var(--c-shadow);
|
|
762
|
+
animation: ec-fade-up 0.25s ease both;
|
|
620
763
|
}
|
|
621
764
|
.ec-card p { margin: 0 0 8px; overflow-wrap: anywhere; }
|
|
622
|
-
.ec-card-title { font-size:
|
|
623
|
-
.ec-card-what { font-weight:
|
|
765
|
+
.ec-card-title { font-size: 12.5px; color: var(--c-ink2); }
|
|
766
|
+
.ec-card-what { font-size: 14.5px; font-weight: 600; }
|
|
624
767
|
.ec-card-value {
|
|
625
768
|
white-space: pre-wrap;
|
|
626
769
|
font-family: var(--c-mono);
|
|
627
|
-
font-size:
|
|
770
|
+
font-size: 12.5px;
|
|
628
771
|
padding: 8px 10px;
|
|
629
|
-
border-radius:
|
|
772
|
+
border-radius: 10px;
|
|
630
773
|
background: var(--c-inset);
|
|
631
|
-
box-shadow: 0 0 0 1px var(--c-
|
|
774
|
+
box-shadow: 0 0 0 1px var(--c-line);
|
|
632
775
|
}
|
|
633
|
-
.ec-actions { display: flex; flex-wrap: wrap; gap:
|
|
634
|
-
.ec-actions .ec-btn { flex: 1 1 auto; }
|
|
776
|
+
.ec-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
|
|
635
777
|
.ec-btn {
|
|
636
|
-
height:
|
|
637
|
-
padding: 0
|
|
638
|
-
border-radius:
|
|
639
|
-
font-
|
|
778
|
+
height: 36px;
|
|
779
|
+
padding: 0 14px;
|
|
780
|
+
border-radius: 11px;
|
|
781
|
+
font-size: 13.5px;
|
|
782
|
+
font-weight: 600;
|
|
640
783
|
color: var(--c-ink);
|
|
784
|
+
background: var(--c-surface);
|
|
641
785
|
box-shadow: 0 0 0 1px var(--c-line2);
|
|
642
786
|
transition: background-color 0.15s, transform 0.1s;
|
|
643
787
|
}
|
|
644
|
-
.ec-btn:hover { background: var(--c-
|
|
788
|
+
.ec-btn:hover { background: var(--c-field); }
|
|
645
789
|
.ec-btn:active { transform: scale(0.96); }
|
|
646
|
-
.ec-btn[data-primary] { background: var(--c-
|
|
647
|
-
.ec-btn[data-primary]:hover {
|
|
790
|
+
.ec-btn[data-primary] { background: var(--c-accent); color: var(--c-on-accent); box-shadow: none; }
|
|
791
|
+
.ec-btn[data-primary]:hover { filter: brightness(1.06); }
|
|
648
792
|
|
|
649
|
-
.ec-
|
|
650
|
-
|
|
651
|
-
|
|
793
|
+
.ec-alert {
|
|
794
|
+
display: flex;
|
|
795
|
+
gap: 10px;
|
|
796
|
+
align-items: flex-start;
|
|
797
|
+
padding: 12px;
|
|
798
|
+
border-radius: 14px;
|
|
652
799
|
background: var(--c-red-tint);
|
|
653
|
-
color: var(--c-red
|
|
654
|
-
animation: ec-fade-up 0.
|
|
655
|
-
}
|
|
656
|
-
.ec-
|
|
657
|
-
.ec-
|
|
800
|
+
color: var(--c-red);
|
|
801
|
+
animation: ec-fade-up 0.25s ease both;
|
|
802
|
+
}
|
|
803
|
+
.ec-alert[data-tone="warn"] { background: var(--c-warn-tint); color: var(--c-warn); }
|
|
804
|
+
.ec-alert > svg { width: 28px; height: 28px; padding: 6px; border-radius: 999px; background: var(--c-surface); }
|
|
805
|
+
.ec-alert > div { flex: 1; min-width: 0; color: var(--c-ink2); font-size: 13px; }
|
|
806
|
+
.ec-alert .ec-btn { height: 32px; margin: 8px 8px 0 0; padding: 0 12px; font-size: 13px; }
|
|
807
|
+
.ec-error p { margin: 3px 0 0; overflow-wrap: anywhere; }
|
|
658
808
|
|
|
659
809
|
/* La cola: lo que la persona escribi\xF3 mientras el asistente trabajaba */
|
|
660
810
|
.ec-queue {
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
811
|
+
width: calc(100% - 24px);
|
|
812
|
+
max-width: 680px;
|
|
813
|
+
margin: 0 auto 8px;
|
|
814
|
+
border-radius: 14px;
|
|
815
|
+
background: var(--c-surface);
|
|
816
|
+
box-shadow: 0 0 0 1px var(--c-line2), var(--c-shadow);
|
|
817
|
+
overflow: hidden;
|
|
818
|
+
animation: ec-fade-up 0.2s ease both;
|
|
667
819
|
}
|
|
668
|
-
.ec-queue
|
|
669
|
-
.ec-queue-head { display: flex; align-items: center; gap: 6px; min-height: 26px; padding-left: 8px; font-size: 12px; color: var(--c-ink2); }
|
|
820
|
+
.ec-queue-head { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 4px 4px 4px 12px; font-size: 13px; font-weight: 600; }
|
|
670
821
|
.ec-queue-head p { flex: 1; margin: 0; }
|
|
671
|
-
.ec-queue-head .ec-btn { height:
|
|
672
|
-
.ec-
|
|
673
|
-
.ec-q
|
|
674
|
-
.ec-q-
|
|
822
|
+
.ec-queue-head .ec-btn { height: 32px; padding: 0 11px; font-size: 12.5px; box-shadow: none; background: var(--c-accent-tint); color: var(--c-accent); }
|
|
823
|
+
.ec-queue-head .ec-btn + .ec-btn { background: none; color: var(--c-ink2); }
|
|
824
|
+
.ec-q { display: flex; align-items: center; gap: 2px; padding: 2px 4px 2px 12px; border-top: 1px solid var(--c-line); }
|
|
825
|
+
.ec-q .ec-icon { width: 32px; height: 32px; border-radius: 10px; color: var(--c-ink3); }
|
|
826
|
+
.ec-q-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }
|
|
675
827
|
.ec-queue[data-paused] .ec-q-text { color: var(--c-ink2); }
|
|
676
828
|
|
|
677
829
|
/* El compositor */
|
|
678
|
-
.ec-form { padding:
|
|
830
|
+
.ec-form { padding: 10px 12px 12px; }
|
|
831
|
+
.ec-form > * { max-width: 680px; margin-inline: auto; }
|
|
679
832
|
.ec-field {
|
|
680
833
|
display: flex;
|
|
681
834
|
align-items: flex-end;
|
|
682
835
|
gap: 8px;
|
|
683
|
-
padding:
|
|
684
|
-
border-radius:
|
|
836
|
+
padding: 6px 6px 6px 14px;
|
|
837
|
+
border-radius: 14px;
|
|
685
838
|
background: var(--c-field);
|
|
686
|
-
box-shadow: 0 0 0 1px var(--c-
|
|
839
|
+
box-shadow: 0 0 0 1px var(--c-line2);
|
|
687
840
|
transition: box-shadow 0.15s;
|
|
688
841
|
}
|
|
689
|
-
.ec-field:focus-within { box-shadow: 0 0 0 1px var(--c-
|
|
842
|
+
.ec-field:focus-within { box-shadow: 0 0 0 1px var(--c-accent); }
|
|
690
843
|
.ec-input {
|
|
691
844
|
flex: 1;
|
|
845
|
+
min-width: 0;
|
|
692
846
|
resize: none;
|
|
693
847
|
border: 0;
|
|
694
848
|
outline: 0;
|
|
695
|
-
padding:
|
|
849
|
+
padding: 7px 0;
|
|
696
850
|
font: inherit;
|
|
697
|
-
line-height:
|
|
851
|
+
line-height: 20px;
|
|
698
852
|
color: var(--c-ink);
|
|
699
853
|
background: transparent;
|
|
700
|
-
min-height:
|
|
854
|
+
min-height: 34px;
|
|
701
855
|
max-height: 120px;
|
|
702
856
|
}
|
|
703
857
|
.ec-input:focus-visible { outline: 0; }
|
|
704
|
-
.ec-input::placeholder { color: var(--c-
|
|
858
|
+
.ec-input::placeholder { color: var(--c-ink3); }
|
|
705
859
|
.ec-send {
|
|
706
|
-
width:
|
|
707
|
-
height:
|
|
708
|
-
border-radius:
|
|
860
|
+
width: 34px;
|
|
861
|
+
height: 34px;
|
|
862
|
+
border-radius: 10px;
|
|
709
863
|
display: grid;
|
|
710
864
|
place-items: center;
|
|
711
|
-
background: var(--c-
|
|
712
|
-
color: var(--c-on-
|
|
865
|
+
background: var(--c-accent);
|
|
866
|
+
color: var(--c-on-accent);
|
|
713
867
|
transition: opacity 0.15s, transform 0.1s;
|
|
714
868
|
}
|
|
869
|
+
.ec-send[data-stop] { background: var(--c-ink); color: var(--c-on-ink); }
|
|
715
870
|
.ec-send:active { transform: scale(0.96); }
|
|
716
|
-
.ec-send:disabled { opacity: 0.
|
|
717
|
-
.ec-send i { width:
|
|
871
|
+
.ec-send:disabled { opacity: 0.45; cursor: default; transform: none; }
|
|
872
|
+
.ec-send i { width: 12px; height: 12px; border-radius: 3px; background: currentColor; }
|
|
873
|
+
.ec-hint { display: none; justify-content: space-between; gap: 10px; margin-block: 0; padding: 6px 4px 0; font-size: 11.5px; color: var(--c-ink3); }
|
|
874
|
+
.ec-form:focus-within .ec-hint, .ec-form[data-typed] .ec-hint { display: flex; }
|
|
718
875
|
|
|
719
876
|
/* Lo que el asistente puede hacer */
|
|
720
877
|
.ec-pop {
|
|
721
878
|
position: absolute;
|
|
722
|
-
top:
|
|
723
|
-
|
|
724
|
-
|
|
879
|
+
top: 58px;
|
|
880
|
+
right: 10px;
|
|
881
|
+
width: 320px;
|
|
882
|
+
max-width: calc(100% - 20px);
|
|
725
883
|
max-height: calc(100% - 70px);
|
|
726
884
|
overflow-y: auto;
|
|
727
885
|
z-index: 2;
|
|
728
|
-
padding:
|
|
729
|
-
border-radius:
|
|
886
|
+
padding: 8px;
|
|
887
|
+
border-radius: 16px;
|
|
730
888
|
background: var(--c-surface);
|
|
731
889
|
box-shadow: var(--c-overlay);
|
|
732
|
-
transform-origin: top
|
|
890
|
+
transform-origin: top right;
|
|
733
891
|
transition: opacity 0.18s var(--c-ease), transform 0.18s var(--c-ease), display 0.18s allow-discrete;
|
|
734
892
|
}
|
|
735
893
|
.ec-pop[hidden] { display: none; opacity: 0; transform: scale(0.96); }
|
|
736
894
|
@starting-style { .ec-pop { opacity: 0; transform: scale(0.95); } }
|
|
737
|
-
.ec-pop-title { margin: 0; padding: 6px 10px
|
|
895
|
+
.ec-pop-title { margin: 0; padding: 6px 10px; font-size: 14.5px; font-weight: 600; }
|
|
738
896
|
.ec-opts { position: relative; }
|
|
739
897
|
.ec-glide {
|
|
740
898
|
position: absolute;
|
|
@@ -742,8 +900,8 @@ svg { display: block; flex: none; }
|
|
|
742
900
|
right: 0;
|
|
743
901
|
top: 0;
|
|
744
902
|
height: 0;
|
|
745
|
-
border-radius:
|
|
746
|
-
background: var(--c-
|
|
903
|
+
border-radius: 10px;
|
|
904
|
+
background: var(--c-field);
|
|
747
905
|
opacity: 0;
|
|
748
906
|
transition: top 0.22s var(--c-ease), height 0.22s var(--c-ease), opacity 0.15s;
|
|
749
907
|
}
|
|
@@ -763,17 +921,17 @@ svg { display: block; flex: none; }
|
|
|
763
921
|
background: var(--c-field);
|
|
764
922
|
color: var(--c-ink2);
|
|
765
923
|
}
|
|
766
|
-
.ec-opt-name { margin: 0; font-weight:
|
|
924
|
+
.ec-opt-name { margin: 0; font-size: 13.5px; font-weight: 600; }
|
|
767
925
|
.ec-opt-desc { margin: 1px 0 0; font-size: 12px; color: var(--c-ink2); }
|
|
768
|
-
.ec-ask { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size:
|
|
926
|
+
.ec-ask { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 12.5px; color: var(--c-ink2); }
|
|
769
927
|
.ec-opt[data-off] .ec-ask { opacity: 0.45; }
|
|
770
|
-
.ec-pop-hint { margin: 4px 0 0; padding: 8px 10px 4px; border-top: 1px solid var(--c-
|
|
928
|
+
.ec-pop-hint { margin: 4px 0 0; padding: 8px 10px 4px; border-top: 1px solid var(--c-line); font-size: 12px; color: var(--c-ink2); }
|
|
771
929
|
.ec-switch {
|
|
772
930
|
position: relative;
|
|
773
|
-
width:
|
|
774
|
-
height:
|
|
931
|
+
width: 36px;
|
|
932
|
+
height: 20px;
|
|
775
933
|
border-radius: 999px;
|
|
776
|
-
background: var(--c-
|
|
934
|
+
background: var(--c-ink3);
|
|
777
935
|
flex: none;
|
|
778
936
|
transition: background-color 0.2s var(--c-ease);
|
|
779
937
|
}
|
|
@@ -782,195 +940,214 @@ svg { display: block; flex: none; }
|
|
|
782
940
|
position: absolute;
|
|
783
941
|
top: 2px;
|
|
784
942
|
left: 2px;
|
|
785
|
-
width:
|
|
786
|
-
height:
|
|
943
|
+
width: 16px;
|
|
944
|
+
height: 16px;
|
|
787
945
|
border-radius: 999px;
|
|
788
|
-
background:
|
|
789
|
-
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.
|
|
946
|
+
background: var(--c-surface);
|
|
947
|
+
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
|
|
790
948
|
transition: transform 0.2s var(--c-ease);
|
|
791
949
|
}
|
|
792
950
|
.ec-switch[aria-checked="true"] { background: var(--c-accent); }
|
|
793
|
-
.ec-switch[aria-checked="true"]::after { transform: translateX(
|
|
951
|
+
.ec-switch[aria-checked="true"]::after { transform: translateX(16px); }
|
|
794
952
|
.ec-switch:disabled { cursor: default; }
|
|
795
953
|
|
|
796
954
|
/* Las secciones: cada vista llena el panel y la barra va abajo */
|
|
797
955
|
.ec-view { flex: 1; min-height: 0; display: flex; flex-direction: column; }
|
|
798
|
-
.ec-
|
|
799
|
-
.ec-page { overflow-y: auto; padding: 16px; gap: 12px; scrollbar-width: thin; }
|
|
956
|
+
.ec-page { overflow-y: auto; padding: 14px; gap: 12px; background: var(--c-page); scrollbar-width: thin; }
|
|
800
957
|
.ec-page > * { flex: none; }
|
|
801
958
|
.ec-tabs {
|
|
802
959
|
display: grid;
|
|
803
960
|
grid-auto-flow: column;
|
|
804
961
|
grid-auto-columns: 1fr;
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
border-top: 1px solid var(--c-hair);
|
|
962
|
+
padding: 6px 6px 8px;
|
|
963
|
+
border-top: 1px solid var(--c-line);
|
|
808
964
|
}
|
|
809
|
-
.ec-tabs[hidden] { display: none; }
|
|
810
965
|
.ec-tab {
|
|
966
|
+
position: relative;
|
|
967
|
+
height: 54px;
|
|
811
968
|
display: flex;
|
|
812
969
|
flex-direction: column;
|
|
813
970
|
align-items: center;
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
border-radius:
|
|
971
|
+
justify-content: center;
|
|
972
|
+
gap: 3px;
|
|
973
|
+
border-radius: 13px;
|
|
817
974
|
font-size: 11.5px;
|
|
818
975
|
font-weight: 500;
|
|
819
976
|
color: var(--c-ink2);
|
|
820
|
-
transition:
|
|
977
|
+
transition: color 0.15s;
|
|
821
978
|
}
|
|
822
|
-
.ec-tab {
|
|
979
|
+
.ec-tab svg { width: 48px; height: 28px; padding: 5px 15px; border-radius: 999px; transition: background-color 0.15s; }
|
|
823
980
|
.ec-tab:hover { color: var(--c-ink); }
|
|
981
|
+
.ec-tab[aria-current="page"] { color: var(--c-accent); font-weight: 600; }
|
|
982
|
+
.ec-tab[aria-current="page"] svg { background: var(--c-accent-tint); }
|
|
824
983
|
.ec-count {
|
|
825
984
|
position: absolute;
|
|
826
|
-
top:
|
|
827
|
-
left: calc(50% +
|
|
985
|
+
top: 3px;
|
|
986
|
+
left: calc(50% + 6px);
|
|
828
987
|
min-width: 16px;
|
|
829
988
|
padding: 0 4px;
|
|
830
989
|
border-radius: 999px;
|
|
831
|
-
font-size:
|
|
832
|
-
line-height:
|
|
833
|
-
font-weight:
|
|
990
|
+
font-size: 10px;
|
|
991
|
+
line-height: 12px;
|
|
992
|
+
font-weight: 700;
|
|
834
993
|
background: var(--c-accent);
|
|
835
|
-
color:
|
|
994
|
+
color: var(--c-on-accent);
|
|
995
|
+
border: 2px solid var(--c-surface);
|
|
836
996
|
}
|
|
837
|
-
.ec-
|
|
838
|
-
.ec-hello { margin: 6px 2px 4px; font-size: 24px; font-weight: 600; line-height: 1.2; letter-spacing: -0.01em; }
|
|
997
|
+
.ec-hello { margin: 8px 2px 6px; font-size: 27px; font-weight: 600; line-height: 1.15; letter-spacing: -0.025em; }
|
|
839
998
|
.ec-hello span { display: block; }
|
|
840
|
-
.ec-hello span + span { color: var(--c-
|
|
841
|
-
.ec-h { margin: 0; font-size:
|
|
999
|
+
.ec-hello span + span { color: var(--c-ink3); }
|
|
1000
|
+
.ec-h { margin: 0; font-size: 21px; font-weight: 600; line-height: 1.3; letter-spacing: -0.02em; }
|
|
842
1001
|
.ec-box {
|
|
843
1002
|
display: flex;
|
|
844
1003
|
flex-direction: column;
|
|
845
|
-
gap:
|
|
846
|
-
padding:
|
|
847
|
-
border-radius:
|
|
1004
|
+
gap: 10px;
|
|
1005
|
+
padding: 14px;
|
|
1006
|
+
border-radius: 18px;
|
|
848
1007
|
background: var(--c-surface);
|
|
849
|
-
box-shadow: 0 0 0 1px var(--c-
|
|
1008
|
+
box-shadow: 0 0 0 1px var(--c-line2), var(--c-shadow);
|
|
850
1009
|
animation: ec-fade-up 0.3s var(--c-ease) both;
|
|
851
1010
|
}
|
|
852
1011
|
.ec-box-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
|
|
853
|
-
.ec-box-title { margin: 0; font-size:
|
|
854
|
-
.ec-box-sub { margin: -
|
|
855
|
-
.ec-muted { margin: 0; font-size: 12px; color: var(--c-
|
|
1012
|
+
.ec-box-title { margin: 0; font-size: 15px; font-weight: 600; }
|
|
1013
|
+
.ec-box-sub { margin: -8px 0 0; font-size: 13px; color: var(--c-ink2); }
|
|
1014
|
+
.ec-muted { margin: 0; font-size: 12px; color: var(--c-ink3); }
|
|
856
1015
|
.ec-fake {
|
|
857
1016
|
display: flex;
|
|
858
1017
|
align-items: center;
|
|
859
1018
|
gap: 8px;
|
|
860
|
-
height:
|
|
861
|
-
padding: 0 6px 0
|
|
862
|
-
border-radius:
|
|
1019
|
+
height: 42px;
|
|
1020
|
+
padding: 0 6px 0 14px;
|
|
1021
|
+
border-radius: 12px;
|
|
863
1022
|
text-align: left;
|
|
864
|
-
color: var(--c-
|
|
1023
|
+
color: var(--c-ink3);
|
|
865
1024
|
background: var(--c-field);
|
|
866
|
-
box-shadow: 0 0 0 1px var(--c-line);
|
|
867
1025
|
transition: box-shadow 0.15s;
|
|
868
1026
|
}
|
|
869
1027
|
.ec-fake > span { flex: 1; }
|
|
870
|
-
.ec-fake:hover { box-shadow: 0 0 0 1px var(--c-
|
|
871
|
-
.ec-fake-go { width:
|
|
1028
|
+
.ec-fake:hover { box-shadow: 0 0 0 1px var(--c-accent-line); }
|
|
1029
|
+
.ec-fake-go { width: 30px; height: 30px; padding: 8px; border-radius: 9px; background: var(--c-accent); color: var(--c-on-accent); }
|
|
872
1030
|
.ec-stack { display: flex; flex-direction: column; gap: 10px; }
|
|
873
1031
|
.ec-list { display: flex; flex-direction: column; margin: 0 -6px; }
|
|
874
1032
|
.ec-row {
|
|
875
1033
|
display: flex;
|
|
876
1034
|
align-items: center;
|
|
877
1035
|
gap: 10px;
|
|
878
|
-
padding:
|
|
879
|
-
border-radius:
|
|
1036
|
+
padding: 11px 12px;
|
|
1037
|
+
border-radius: 12px;
|
|
880
1038
|
text-align: left;
|
|
881
1039
|
transition: background-color 0.15s;
|
|
882
1040
|
}
|
|
883
|
-
.ec-row:hover { background: var(--c-
|
|
1041
|
+
.ec-row:hover { background: var(--c-field); }
|
|
884
1042
|
.ec-row-main { flex: 1; min-width: 0; }
|
|
885
1043
|
.ec-row-main > span { display: block; overflow: hidden; text-overflow: ellipsis; }
|
|
886
|
-
.ec-row-title {
|
|
887
|
-
.ec-row-sub { font-size:
|
|
888
|
-
.ec-row-aside, .ec-kicker { font-size:
|
|
889
|
-
.ec-kicker { margin: 4px 0 -
|
|
1044
|
+
.ec-row-title { white-space: nowrap; }
|
|
1045
|
+
.ec-row-sub { font-size: 12.5px; color: var(--c-ink2); display: -webkit-box !important; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
|
|
1046
|
+
.ec-row-aside, .ec-kicker { font-size: 12px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: var(--c-ink3); }
|
|
1047
|
+
.ec-kicker { margin: 4px 0 -6px; }
|
|
890
1048
|
.ec-search {
|
|
891
1049
|
display: flex;
|
|
892
1050
|
align-items: center;
|
|
893
|
-
gap:
|
|
894
|
-
height:
|
|
1051
|
+
gap: 10px;
|
|
1052
|
+
height: 44px;
|
|
895
1053
|
padding: 0 14px;
|
|
896
1054
|
border-radius: 999px;
|
|
897
|
-
color: var(--c-
|
|
1055
|
+
color: var(--c-ink3);
|
|
898
1056
|
background: var(--c-field);
|
|
899
|
-
box-shadow: 0 0 0 1px var(--c-
|
|
1057
|
+
box-shadow: 0 0 0 1px var(--c-line2);
|
|
900
1058
|
transition: box-shadow 0.15s;
|
|
901
1059
|
}
|
|
902
|
-
.ec-search:focus-within { box-shadow: 0 0 0 1px var(--c-
|
|
1060
|
+
.ec-search:focus-within { box-shadow: 0 0 0 1px var(--c-accent); }
|
|
903
1061
|
.ec-search input { flex: 1; min-width: 0; border: 0; outline: 0; padding: 0; font: inherit; color: var(--c-ink); background: transparent; }
|
|
904
|
-
.ec-search input::placeholder { color: var(--c-
|
|
1062
|
+
.ec-search input::placeholder { color: var(--c-ink3); }
|
|
1063
|
+
.ec-skels { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 18px; background: var(--c-surface); box-shadow: 0 0 0 1px var(--c-line2); }
|
|
1064
|
+
.ec-skel { display: block; height: 12px; border-radius: 8px; background: linear-gradient(90deg, var(--c-skel) 25%, var(--c-skel-hi) 50%, var(--c-skel) 75%) 0 0 / 200% 100%; animation: ec-shimmer 1.4s linear infinite; }
|
|
905
1065
|
/* Tickets */
|
|
906
1066
|
.ec-filters { display: flex; gap: 6px; }
|
|
907
1067
|
.ec-filter {
|
|
908
|
-
height:
|
|
909
|
-
padding: 0
|
|
1068
|
+
height: 34px;
|
|
1069
|
+
padding: 0 14px;
|
|
910
1070
|
border-radius: 999px;
|
|
911
|
-
font-size:
|
|
912
|
-
font-weight:
|
|
1071
|
+
font-size: 13px;
|
|
1072
|
+
font-weight: 600;
|
|
913
1073
|
color: var(--c-ink2);
|
|
1074
|
+
background: var(--c-surface);
|
|
914
1075
|
box-shadow: 0 0 0 1px var(--c-line2);
|
|
915
1076
|
transition: background-color 0.15s, color 0.15s;
|
|
916
1077
|
}
|
|
917
|
-
.ec-filter:hover { background: var(--c-
|
|
918
|
-
.ec-filter[aria-pressed="true"] { background: var(--c-accent); color:
|
|
919
|
-
.ec-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
1078
|
+
.ec-filter:hover { background: var(--c-field); }
|
|
1079
|
+
.ec-filter[aria-pressed="true"] { background: var(--c-accent); color: var(--c-on-accent); box-shadow: none; }
|
|
1080
|
+
.ec-tbar { display: flex; align-items: center; gap: 10px; }
|
|
1081
|
+
.ec-tbar .ec-filters { flex: 1; min-width: 0; }
|
|
1082
|
+
.ec-tstale { display: flex; align-items: center; gap: 6px; margin: 0; font-size: 12.5px; color: var(--c-ink2); }
|
|
1083
|
+
.ec-tstale svg { flex: none; color: var(--c-warn); }
|
|
1084
|
+
.ec-reload { width: 34px; height: 34px; color: var(--c-ink3); }
|
|
1085
|
+
.ec-reload:focus-visible { outline-offset: -2px; }
|
|
1086
|
+
.ec-reload[aria-disabled="true"] { cursor: default; }
|
|
1087
|
+
.ec-reload[aria-disabled="true"]:hover { background: none; color: var(--c-ink3); }
|
|
1088
|
+
.ec-reload[data-busy] svg { color: var(--c-accent); animation: ec-spin 0.8s linear infinite; }
|
|
1089
|
+
.ec-ticket { display: flex; flex-direction: column; gap: 8px; text-align: left; }
|
|
1090
|
+
article.ec-ticket { padding: 14px; border-radius: 18px; background: var(--c-surface); box-shadow: 0 0 0 1px var(--c-line2); animation: ec-fade-up 0.25s ease both; }
|
|
1091
|
+
button.ec-ticket { margin: 0 -6px; padding: 8px 6px; border-radius: 12px; transition: background-color 0.15s; }
|
|
1092
|
+
button.ec-ticket:hover { background: var(--c-field); }
|
|
923
1093
|
.ec-ticket > span { display: block; overflow: hidden; text-overflow: ellipsis; }
|
|
924
1094
|
.ec-ticket .ec-tmeta { display: flex; align-items: center; gap: 8px; }
|
|
925
1095
|
.ec-tmeta .ec-muted { margin-left: auto; }
|
|
926
|
-
.ec-
|
|
927
|
-
.ec-
|
|
928
|
-
.ec-pill[data-tone="good"] { background: var(--c-green-tint); color: var(--c-green-ink); }
|
|
929
|
-
.ec-ticket .ec-tfoot { display: flex; align-items: center; gap: 6px; margin-top: 4px; padding-top: 8px; border-top: 1px solid var(--c-hair); font-size: 12px; color: var(--c-ink2); }
|
|
930
|
-
.ec-note { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; color: var(--c-ink2); }
|
|
1096
|
+
.ec-ticket .ec-tfoot { display: flex; align-items: center; gap: 6px; padding-top: 8px; border-top: 1px solid var(--c-line); font-size: 12.5px; color: var(--c-ink2); }
|
|
1097
|
+
.ec-note { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 22px; border-radius: 18px; text-align: center; font-size: 13.5px; color: var(--c-ink2); box-shadow: inset 0 0 0 1px var(--c-line2); }
|
|
931
1098
|
.ec-note p { margin: 0; }
|
|
932
1099
|
.ec-back {
|
|
933
1100
|
align-self: flex-start;
|
|
934
1101
|
display: flex;
|
|
935
1102
|
align-items: center;
|
|
936
|
-
gap:
|
|
937
|
-
height:
|
|
938
|
-
margin: -
|
|
939
|
-
padding: 0
|
|
940
|
-
border-radius:
|
|
1103
|
+
gap: 4px;
|
|
1104
|
+
height: 36px;
|
|
1105
|
+
margin: -6px 0 0 -8px;
|
|
1106
|
+
padding: 0 10px 0 6px;
|
|
1107
|
+
border-radius: 12px;
|
|
1108
|
+
font-size: 13.5px;
|
|
941
1109
|
color: var(--c-ink2);
|
|
942
1110
|
transition: background-color 0.15s, color 0.15s;
|
|
943
1111
|
}
|
|
944
|
-
.ec-back:hover { background: var(--c-
|
|
945
|
-
.ec-doc { line-height: 1.
|
|
1112
|
+
.ec-back:hover { background: var(--c-field); color: var(--c-ink); }
|
|
1113
|
+
.ec-doc { line-height: 1.55; overflow-wrap: anywhere; }
|
|
946
1114
|
.ec-doc > * { margin: 0 0 10px; }
|
|
947
1115
|
.ec-doc > :first-child { margin-top: 0; }
|
|
948
1116
|
.ec-doc > :last-child { margin-bottom: 0; }
|
|
949
|
-
.ec-doc h1, .ec-doc h2, .ec-doc h3, .ec-doc h4 { margin: 16px 0 6px; line-height: 1.
|
|
950
|
-
.ec-doc h1 { font-size:
|
|
951
|
-
.ec-doc h2 { font-size:
|
|
952
|
-
.ec-doc h3 { font-size:
|
|
953
|
-
.ec-doc h4 { font-size:
|
|
1117
|
+
.ec-doc h1, .ec-doc h2, .ec-doc h3, .ec-doc h4 { margin: 16px 0 6px; line-height: 1.25; font-weight: 600; letter-spacing: -0.01em; }
|
|
1118
|
+
.ec-doc h1 { font-size: 22px; }
|
|
1119
|
+
.ec-doc h2 { font-size: 17px; }
|
|
1120
|
+
.ec-doc h3 { font-size: 15px; }
|
|
1121
|
+
.ec-doc h4 { font-size: 14px; }
|
|
954
1122
|
.ec-doc ul, .ec-doc ol { padding-left: 20px; }
|
|
955
1123
|
.ec-doc li > ul, .ec-doc li > ol { margin: 2px 0; }
|
|
956
1124
|
.ec-doc strong { font-weight: 600; }
|
|
957
|
-
.ec-doc a { color: var(--c-accent
|
|
958
|
-
.ec-doc img { max-width: 100%; height: auto; border-radius:
|
|
1125
|
+
.ec-doc a { color: var(--c-accent); text-decoration: underline; text-underline-offset: 2px; }
|
|
1126
|
+
.ec-doc img { max-width: 100%; height: auto; border-radius: 12px; }
|
|
959
1127
|
.ec-doc blockquote { padding-left: 12px; border-left: 3px solid var(--c-line2); color: var(--c-ink2); }
|
|
960
1128
|
.ec-doc hr { border: 0; border-top: 1px solid var(--c-line); }
|
|
961
1129
|
.ec-table { overflow-x: auto; }
|
|
962
|
-
.ec-doc table { border-collapse: collapse; font-size:
|
|
963
|
-
.ec-doc th, .ec-doc td { padding: 6px 8px; border: 1px solid var(--c-
|
|
1130
|
+
.ec-doc table { border-collapse: collapse; font-size: 12.5px; }
|
|
1131
|
+
.ec-doc th, .ec-doc td { padding: 6px 8px; border: 1px solid var(--c-line2); text-align: left; vertical-align: top; }
|
|
964
1132
|
.ec-doc th { font-weight: 600; background: var(--c-inset); }
|
|
965
|
-
.ec-vote { padding
|
|
1133
|
+
.ec-vote { padding: 14px; border-radius: 14px; background: var(--c-field); color: var(--c-ink2); }
|
|
966
1134
|
.ec-vote:empty { display: none; }
|
|
967
1135
|
.ec-vote p { margin: 0; }
|
|
968
|
-
.ec-vote > .ec-btn { margin
|
|
1136
|
+
.ec-vote > .ec-btn { height: 34px; margin: 10px 6px 0 0; border-radius: 999px; font-weight: 400; }
|
|
1137
|
+
|
|
1138
|
+
.ec-status[hidden], .ec-icon[hidden], .ec-view[hidden], .ec-tabs[hidden], .ec-thinking[hidden],
|
|
1139
|
+
.ec-tools-head[hidden], .ec-tool-row[hidden], .ec-jump[hidden] { display: none; }
|
|
1140
|
+
|
|
1141
|
+
@media (max-width: 768px) {
|
|
1142
|
+
#ec-dock { display: none !important; }
|
|
1143
|
+
}
|
|
969
1144
|
|
|
970
1145
|
@media (max-width: 520px) {
|
|
971
|
-
.ec-panel { width: calc(100vw - 16px); max-width: none; height: min(80vh,
|
|
1146
|
+
.ec-panel { width: calc(100vw - 16px); max-width: none; height: min(80vh, 600px); max-height: calc(100vh - 88px); }
|
|
972
1147
|
:host([data-corner$="right"]) .ec-panel { right: -8px; }
|
|
973
1148
|
:host([data-corner$="left"]) .ec-panel { left: -8px; }
|
|
1149
|
+
.ec-root[data-size] .ec-panel { top: 8px; bottom: 8px; left: 0; right: 0; width: calc(100vw - 16px); height: auto; max-height: none; }
|
|
1150
|
+
|
|
974
1151
|
}
|
|
975
1152
|
|
|
976
1153
|
@media (prefers-reduced-motion: reduce) {
|
|
@@ -978,7 +1155,7 @@ button.ec-ticket:hover { background: var(--c-hover); }
|
|
|
978
1155
|
.ec-shimmer { color: var(--c-ink2); background: none; }
|
|
979
1156
|
.ec-caret[data-end] { opacity: 0; }
|
|
980
1157
|
}
|
|
981
|
-
`;var
|
|
1158
|
+
`;var Da=["team","you","resolved"],Gt=e=>typeof e=="string"&&e?e:null;function Ga(e){let o=e,n=Gt(o?.key),r=Gt(o?.title),s=o?.status;if(!n||!r||!Da.includes(s))return null;let a=o.last_message,c=Gt(o.updated_at)??"";return{key:n,title:r,status:s,state_label:Gt(o.state_label)??"",created_at:Gt(o.created_at)??c,updated_at:c,last_message:a&&typeof a=="object"&&typeof a.excerpt=="string"?{at:Gt(a.at)??"",excerpt:a.excerpt.slice(0,Kn.excerpt),from_team:a.from_team===!0}:null,has_recording:o.has_recording===!0}}function nr(e){let o=(e.baseUrl||Kt).replace(/\/+$/,""),n=e.fetch??((m,h)=>globalThis.fetch(m,h)),r=e.identity,s=new Map,a=new Map,c=new Map,l=0,d=async m=>{let h=null;try{let P=await n(`${o}${hi.list}?status=${m}`,{headers:{"x-espejo-key":e.key,...wn(r)},credentials:"omit"});if(P.status===404)return{status:"hidden"};if(P.status===401)return{status:"denied"};P.ok&&(h=await P.json())}catch{}if(!h||!Array.isArray(h.tickets))return{status:"error"};let x=h.tickets.slice(0,Kn.list).map(Ga).filter(P=>!!P),w=h.waiting,A=typeof w=="number"&&w>=0?Math.floor(w):0;return{status:"ready",data:{tickets:x,waiting:A}}};return{list(m,h=!1){if(!r)return Promise.resolve({status:"denied"});let x=s,w=a,A=c,P=x.get(m);if(P&&!h)return P;let S=++l,G=d(m).then(L=>L.status==="error"?(x.get(m)===G&&x.delete(m),L):(S<(A.get(m)??0)||(A.set(m,S),x.set(m,G),L.status!=="ready")||(w.set(m,L),x===s&&m==="all"&&e.onWaiting(L.data.waiting)),L));return P||x.set(m,G),G},cached(m){return r&&a.get(m)||null},identify(m){r=m,s=new Map,a=new Map,c=new Map,e.onWaiting(null)}}}var po="data-espejo-chat",or=["click","fill","navigate"],Oa=1500,$a=4,za=80,Ba=500,ir=200,Fa=/^e\d+$/,uo=["pointerdown","mousedown","pointerup","mouseup","touchstart","touchend","focusin"],rr={capture:!0,passive:!0},ar=[...uo,"click","focusout"],ja=400,Va=80,Ua=["network","rate_limited","unavailable","conversation_busy"],Wa=1500,sr=e=>typeof e=="string"?e.trim().slice(0,40):"";function Ka(e){let o=e.doc??(typeof document<"u"?document:null);if(!o||!e.key)return null;try{return Qa(o,e)}catch{return null}}function Qa(e,o){let n={...Yt(o.lang),...o.text};o.greeting!==void 0&&(n.greeting=o.greeting);let r=o.greeting!==void 0||o.text?.greeting!==void 0,s=o.position??"bottom-right",{host:a,shadow:c}=vi(e,po,s,"light");a.setAttribute(et,""),c.innerHTML=`<style>${tr}</style>
|
|
982
1159
|
<div class="ec-root">
|
|
983
1160
|
<div class="ec-panel" id="ec-panel" role="dialog" aria-labelledby="ec-title" hidden>
|
|
984
1161
|
<div class="ec-head">
|
|
@@ -987,9 +1164,10 @@ button.ec-ticket:hover { background: var(--c-hover); }
|
|
|
987
1164
|
<p class="ec-title" id="ec-title"></p>
|
|
988
1165
|
<p class="ec-status" id="ec-status" hidden></p>
|
|
989
1166
|
</div>
|
|
990
|
-
<button type="button" class="ec-icon" id="ec-
|
|
991
|
-
<button type="button" class="ec-icon" id="ec-
|
|
992
|
-
<button type="button" class="ec-icon" id="ec-
|
|
1167
|
+
<button type="button" class="ec-icon" id="ec-dock"></button>
|
|
1168
|
+
<button type="button" class="ec-icon" id="ec-opts" aria-haspopup="dialog" aria-expanded="false" aria-controls="ec-pop"></button>
|
|
1169
|
+
<button type="button" class="ec-icon" id="ec-expand"></button>
|
|
1170
|
+
<button type="button" class="ec-icon ec-min" id="ec-close"></button>
|
|
993
1171
|
</div>
|
|
994
1172
|
<div class="ec-pop" id="ec-pop" role="dialog" aria-labelledby="ec-pop-title" hidden></div>
|
|
995
1173
|
<p class="ec-sr" id="ec-alert" aria-live="assertive"></p>
|
|
@@ -1001,6 +1179,7 @@ button.ec-ticket:hover { background: var(--c-hover); }
|
|
|
1001
1179
|
<span class="ec-time" id="ec-time" aria-hidden="true"></span>
|
|
1002
1180
|
</div>
|
|
1003
1181
|
</div>
|
|
1182
|
+
<button type="button" class="ec-jump" id="ec-jump" hidden></button>
|
|
1004
1183
|
<div class="ec-queue" id="ec-queue" hidden>
|
|
1005
1184
|
<div class="ec-queue-head" id="ec-queue-head"></div>
|
|
1006
1185
|
<div role="list" id="ec-queue-list" aria-labelledby="ec-queue-title"></div>
|
|
@@ -1011,7 +1190,9 @@ button.ec-ticket:hover { background: var(--c-hover); }
|
|
|
1011
1190
|
<textarea class="ec-input" id="ec-input" rows="1" maxlength="4000"></textarea>
|
|
1012
1191
|
<button type="button" class="ec-send" id="ec-send" disabled></button>
|
|
1013
1192
|
</div>
|
|
1193
|
+
<p class="ec-hint" aria-hidden="true"><span id="ec-hint"></span><span id="ec-hint2"></span></p>
|
|
1014
1194
|
</form>
|
|
1195
|
+
<div class="ec-manage" id="ec-manage"></div>
|
|
1015
1196
|
</div>
|
|
1016
1197
|
<div class="ec-view ec-page" id="ec-view-home" hidden></div>
|
|
1017
1198
|
<div class="ec-view ec-page" id="ec-view-tickets" hidden></div>
|
|
@@ -1023,8 +1204,10 @@ button.ec-ticket:hover { background: var(--c-hover); }
|
|
|
1023
1204
|
<span class="ec-glyph" id="ec-glyph"></span>
|
|
1024
1205
|
<span class="ec-x" id="ec-x"></span>
|
|
1025
1206
|
</button>
|
|
1026
|
-
</div>`;let s=n=>r.getElementById(n),d=r.querySelector(".ec-root"),l=s("ec-panel"),g=s("ec-log"),f=s("ec-thinking"),x=s("ec-time"),v=s("ec-form"),m=s("ec-input"),A=s("ec-send"),C=s("ec-trigger"),W=s("ec-glyph"),P=s("ec-avatar"),z=s("ec-title"),O=s("ec-status"),B=s("ec-opts"),H=s("ec-pop"),N=s("ec-new"),I=s("ec-close"),K=s("ec-alert"),oe=s("ec-queue"),Ee=s("ec-queue-head"),de=s("ec-queue-list"),X=s("ec-queue-live"),re={home:s("ec-view-home"),support:s("ec-view-support"),tickets:s("ec-view-tickets"),guides:s("ec-view-guides"),article:s("ec-view-article")},ee=s("ec-tabs");ee.setAttribute("aria-label",t.tabs);let ue=(n,c,u)=>{n.appendChild(te(e,c)),n.setAttribute("aria-label",u),n.title=u};ue(B,"sliders",t.options),ue(N,"restart",t.newChat),ue(I,"close",t.close),s("ec-x").appendChild(te(e,"close",22)),s("ec-thinking-label").textContent=t.thinking,O.textContent=t.online,m.setAttribute("aria-label",t.inputLabel),m.placeholder=t.placeholder;let V=e.defaultView,me=(()=>{if(i.storage!==void 0)return i.storage;try{return V?.sessionStorage??null}catch{return null}})(),p=!1,b=!1,E,_=0,$=0,j=null,U=null,ae=null,fe=null,Te=0,pe=new Set,Y=["support"],Ne=Y,Ae=i.identity?ut(i.identity.email,i.identity.hash):null,rt=!1,Ue=0,ve="support",We=null,Qe=null,ke=null,Re=i.agent??Jt(i.allow),y=Re.policy(),T=!1,k=`espejo:chat:prefs:${i.key}`,S={off:[]},G="",q=()=>{S={off:[]},G=F.conversationId;try{let n=JSON.parse(me?.getItem(k)??"null");n&&n.c===F.conversationId&&Array.isArray(n.off)&&(S={off:Xe.filter(c=>n.off.includes(c))})}catch{}},D=()=>{try{me?.setItem(k,JSON.stringify({c:F.conversationId,...S}))}catch{}},Z=`espejo:chat:allow:${i.key}`,se=(()=>{if(i.storage!==void 0)return i.storage;try{return V?.localStorage??null}catch{return null}})(),Se=()=>{try{let n=JSON.parse(se?.getItem(Z)??"null");return Array.isArray(n)?Hi.filter(c=>n.includes(c)):[]}catch{return[]}},Ge=(n,c)=>{try{let u=Se().filter(h=>h!==n);se?.setItem(Z,JSON.stringify(c?[...u,n]:u))}catch{}},Le=`espejo:chat:last:${i.key}`,at=()=>{try{let n=JSON.parse(me?.getItem(Le)??"null");return n&&n.c===F.conversationId&&typeof n.t=="string"&&typeof n.at=="number"?{text:n.t,at:n.at}:null}catch{return null}},st=n=>{try{me?.setItem(Le,JSON.stringify({c:F.conversationId,t:at()?.text??n.slice(0,Xo),at:Date.now()}))}catch{}},vt=()=>E?Xe.filter(n=>y.allow.includes(n)&&E.allowed_actions.includes(n)):[],qe=()=>{if(T)return;let n=E?vt():y.allow;Re.policy({allow:n.filter(c=>!S.off.includes(c))})},ln=()=>{if(G!==F.conversationId){try{me?.removeItem(k)}catch{}q(),qe(),H.hidden||Dt()}},ct=()=>{g.scrollTop=g.scrollHeight},lt=n=>(g.insertBefore(n,f),ct(),n),L=(n,c,u)=>{let h=e.createElement(n);return h.className=c,u!==void 0&&(h.textContent=u),h},he=(n,c)=>{let u=L("button",n,c);return u.type="button",u},dn=(n,c)=>{let u=L("div",`ec-fold ${n}`);u.id=`ec-f${++Te}`;let h=u.appendChild(L("div",""));return un(u,!c),{fold:u,inner:h}};function un(n,c){n.toggleAttribute("data-closed",!c),n.firstElementChild?.toggleAttribute("inert",!c)}let Ke=(n,c,u)=>{n.setAttribute("aria-expanded",String(u)),n.setAttribute("aria-controls",c.id),un(c,u)},pn=n=>{let c=L("div","ec-msg");return c.setAttribute("data-role","assistant"),rn(e,c,n),lt(c)},_i=n=>{let c=L("span","ec-caret");c.setAttribute("aria-hidden","true");let u=n,h=n.lastElementChild;return h&&(u=h.tagName==="UL"||h.tagName==="OL"||h.tagName==="PRE"?h.lastElementChild??h:h),u.appendChild(c),c},Ye=()=>{let n=!!m.value.trim(),c=F.busy&&!n;A.replaceChildren(c?L("i",""):te(e,"up",16)),A.toggleAttribute("data-stop",c),A.setAttribute("aria-label",c?t.stop:t.send),A.title=c?t.stop:t.send,A.disabled=!c&&!n},fn=()=>{let n=Math.floor((Date.now()-$)/1e3);return n<60?`${n}s`:`${Math.floor(n/60)}m${n%60}s`},Pe=n=>{f.hidden=!n,Qe!==null&&V?.clearInterval(Qe),Qe=null,n&&(g.appendChild(f),x.textContent=fn(),Qe=V?.setInterval(()=>x.textContent=fn(),100)??null,ct())},De=()=>{if(g.removeAttribute("aria-busy"),!j)return;let n=j.el.querySelector(".ec-caret");n&&(n.setAttribute("data-end",""),V?.setTimeout(()=>n.remove(),1400)),j=null},hn=()=>{t.greeting&&pn(t.greeting);let n=(i.suggestions??[]).map(c=>String(c).trim().slice(0,Yo)).filter(Boolean).slice(0,Ko);n.length&&(fe=L("div","ec-suggest"),fe.setAttribute("role","group"),fe.setAttribute("aria-label",t.suggestions),n.forEach((c,u)=>{let h=he("ec-chip",c);h.style.animationDelay=`${u*90}ms`,h.addEventListener("click",()=>{m.value=c,bt()}),fe.appendChild(h)}),lt(fe))},gn=()=>{for(let n of[...pe])n(!1)},Oe=()=>{We!==null&&V?.clearTimeout(We),We=null,l.removeAttribute("data-dodge")},Ii=()=>{let n=e.querySelector(`[${et}]:not([${cn}]):not([${Pt}])`);if(!n||l.hidden)return;let c=n.getBoundingClientRect(),u=l.getBoundingClientRect();c.width>0&&u.width>0&&c.left<u.right&&u.left<c.right&&c.top<u.bottom&&u.top<c.bottom&&(Oe(),l.setAttribute("data-dodge",""),We=V?.setTimeout(Oe,ii)??null)},mn=n=>n&&!Zo.test(n)?n:void 0,Gi=()=>{if(U)return U;let n=L("div","ec-tools"),c=he("ec-tools-head");c.hidden=!0;let{fold:u,inner:h}=dn("",!1);return Ke(c,u,!0),c.addEventListener("click",()=>Ke(c,u,c.getAttribute("aria-expanded")!=="true")),n.append(c,u),U={el:n,head:c,fold:u,list:h,rows:0},lt(n),U},_t=(n,c)=>{let u=Gi(),h=L("div","ec-tool");h.style.animationDelay=`${Math.min(u.rows,4)*50}ms`;let R=he("ec-tool-row"),M=L("span","ec-state"),J=L("span","ec-tool-text"),ce=L("span","ec-pill"),Q=te(e,"chevron",14);Q.setAttribute("class","ec-chev"),R.append(M,J,ce,Q);let{fold:be,inner:Me}=dn("ec-detail",!0);Ke(R,be,!1),R.addEventListener("click",()=>Ke(R,be,R.getAttribute("aria-expanded")!=="true")),h.append(R,be),u.list.appendChild(h),u.rows++,u.head.hidden=u.rows<2,u.head.replaceChildren(te(e,"chevron",12),e.createTextNode(t.actionsCount.replace("{n}",String(u.rows)))),u.head.firstChild.setAttribute("class","ec-chev"),ct();let le={el:h,btn:R,stateBox:M,text:J,pill:ce,fold:be,detail:Me,callId:c,parts:n};return It(le,"running"),le},It=(n,c,u)=>{n.parts.target=mn(n.parts.target),n.el.setAttribute("data-state",c);let{type:h}=n.parts;n.text.textContent=Ht(t,c==="done"?"done":"confirm",n.parts).replace(/:$/,""),n.pill.textContent=c==="done"?t.done:c==="error"?t.failed:c==="declined"?t.declined:t.running,n.stateBox.replaceChildren(c==="done"?te(e,"check"):c==="error"?te(e,"close"):c==="declined"?te(e,"minus"):L("span","ec-spin"));let R=[];n.parts.target&&h!=="navigate"&&R.push([t.detailTarget,`\xAB${n.parts.target}\xBB`]),n.parts.destination&&R.push([t.detailDestination,n.parts.destination,!0]),h==="fill"&&n.parts.value!==void 0&&R.push([t.detailValue,mt(t,n.parts.value),!0]),(c==="error"||c==="declined")&&R.push(["",an(t,u)]),n.detail.replaceChildren(...R.map(([M,J,ce])=>{let Q=L("p","");return M&&Q.appendChild(L("b","",M)),Q.appendChild(L("span",ce?"ec-mono":"",J)),Q})),c==="error"&&Ke(n.btn,n.fold,!0)},qi=n=>!!n&&(n.tagName==="INPUT"||n.tagName==="TEXTAREA"||n.tagName==="SELECT"||n.isContentEditable||!!n.closest('[contenteditable]:not([contenteditable="false"])')),Di=()=>{let n=e.activeElement;return n===a?!qi(r.activeElement):!n||n===e.body||n===e.documentElement},Oi=n=>{if(!p)return Promise.resolve(!1);ln();let c=n.action.type;if(Se().includes(c))return Promise.resolve(!0);Oe(),De(),Pe(!1);let u={type:c,target:mn(n.target),destination:n.destination,value:n.value},h=ae??_t(u,null);Object.assign(h.parts,u),U&&Ke(U.head,U.fold,!0),h.el.setAttribute("data-state","ask"),h.btn.hidden=!0;let R=`ec-c${++Te}`,M=L("div","ec-card");M.setAttribute("role","alertdialog"),M.setAttribute("aria-labelledby",`${R}t`),M.setAttribute("aria-describedby",`${R}w`);let J=M.appendChild(L("p","ec-card-title",t.confirmTitle));J.id=`${R}t`;let ce=M.appendChild(L("p","ec-card-what",Ht(t,"confirm",u)));ce.id=`${R}w`,c==="fill"&&M.append(L("p","ec-card-value",mt(t,n.value??"")));let Q=L("div","ec-actions"),be=he("ec-btn",t.allow),Me=he("ec-btn",t.allowAlways),le=he("ec-btn",t.decline);be.setAttribute("data-primary",""),Q.append(be,Me,le),M.append(Q),M.tabIndex=-1,h.el.appendChild(M),ct();let we=`${t.confirmTitle} ${ce.textContent}`;if(c==="fill"){let dt=mt(t,n.value??"");we+=` ${dt.length>Ni?`${dt.slice(0,Ni)}\u2026`:dt}`}K.textContent=we,Di()&&M.focus();let Ie=Date.now()+Jo;return new Promise(dt=>{let Ct=Et=>{if(!pe.delete(Ct))return;let Tt=M.contains(r.activeElement);p&&Tt&&m.focus(),M.remove(),K.textContent="",h.btn.hidden=!1,It(h,Et?"running":"declined","declined");let At=e.activeElement;p&&!Tt&&(!At||At===e.body)&&m.focus(),dt(Et)},Ut=(Et,Tt=!1)=>At=>{if(Date.now()<Ie){At.preventDefault();return}Tt&&pe.has(Ct)&&Ge(c,!0),Ct(Et)};pe.add(Ct),be.addEventListener("click",Ut(!0)),Me.addEventListener("click",Ut(!0,!0)),le.addEventListener("click",Ut(!1))})},$i=n=>{let c=n==="no_agent"||n==="forbidden"||n==="unavailable"?t.errorNoAgent:n==="daily_cap"?t.errorDailyCap:n==="rate_limited"?t.errorRateLimited:n==="conversation_limit"||n==="conversation_expired"?t.errorConversationLimit:n==="conversation_busy"?t.errorBusy:n==="network"?t.errorNetwork:t.errorGeneric,u=L("div","ec-error");if(u.setAttribute("data-code",n),u.append(L("p","",c)),n==="conversation_limit"||n==="conversation_expired"){let h=he("ec-btn",t.startOver);h.addEventListener("click",qt),u.append(h)}lt(u)},Fi=n=>{if(n.type==="queue")return Vi(n.queue,n.paused);if(F.busy)if(ln(),n.type==="dequeued")vn(n.message);else if(n.type==="text"){if(Pe(!1),U=null,!j){let c=pn("");g.setAttribute("aria-busy","true"),j={el:c,src:""}}j.src+=n.delta,rn(e,j.el,j.src),_i(j.el),ct()}else if(n.type==="tool_start")De(),Pe(!1),wt?.start(),ae=_t({type:n.call.name,target:n.target,destination:n.destination,value:n.value},n.call.id);else if(n.type==="tool"){De();let{result:c,call:u}=n,h=ae&&ae.callId===u.id?ae:_t({type:u.name},u.id);Object.assign(h.parts,{type:u.name,target:n.target??h.parts.target,destination:n.destination??h.parts.destination,value:n.value??h.parts.value}),It(h,c.ok?"done":c.error==="declined"||c.error==="confirmation_required"?"declined":"error",c.error),ae=null,c.ok&&u.name==="highlight"&&Ii(),Pe(!0)}else De(),Pe(!1),U=null,n.type==="error"&&$i(n.code)},F=Yt({key:i.key,baseUrl:i.baseUrl,agent:Re,fetch:i.fetch,storage:i.storage,identity:Ae,onConfirm:Oi,onEvent:Fi});function vn(n){De(),fe?.remove(),fe=null,U=null,ae=null;let c=L("div","ec-msg",n);c.setAttribute("data-role","user"),lt(c),st(n),$=Date.now(),Ye(),Pe(!0)}let Gt=async n=>{let c=++_;await n,c===_&&(wt?.end(),Pe(!1),De(),U=null,Ye())},bn=()=>{m.value="",m.style.height="",Ye()},bt=()=>{let n=m.value.trim();if(!n)return;if(F.busy||pe.size){F.enqueue(n)?bn():X.textContent=t.queueFull;return}bn();let c=F.send(n);vn(n),F.resumeQueue(),Gt(c)},Bi=n=>{let c=F.sendQueuedNow(n);gn(),Gt(c)},ji=()=>{F.busy?F.resumeQueue():Gt(F.resumeQueue())};function Vi(n,c){let u=oe.contains(r.activeElement);oe.hidden=!n.length,oe.toggleAttribute("data-paused",c);let h=L("p","",c?t.queuePaused:t.queueTitle.replace("{n}",String(n.length)));h.id="ec-queue-title";let R=[h];if(c){let M=he("ec-btn",t.queueResume);M.addEventListener("click",ji);let J=he("ec-btn",t.queueClear);J.addEventListener("click",()=>F.clearQueue()),R.push(M,J)}Ee.replaceChildren(...R),de.replaceChildren(...n.map(({id:M,text:J})=>{let ce=L("div","ec-q");ce.setAttribute("role","listitem");let Q=ce.appendChild(L("span","ec-q-text",J));Q.title=J;let be=[["up",t.queueSendNow,()=>Bi(M)],["fill",t.queueEdit,()=>{F.removeQueued(M),m.value=m.value.trim()?`${m.value}
|
|
1027
|
-
${J}`:J,m.focus(),Bt()}],["close",t.queueRemove,()=>F.removeQueued(M)]];for(let[Me,le,we]of be){let Ie=ce.appendChild(he("ec-icon"));ue(Ie,Me,le),Ie.addEventListener("click",we)}return ce})),X.textContent=n.length?h.textContent:"",u&&!oe.contains(r.activeElement)&&m.focus()}let Je=()=>{_++,F.abort(),gn(),wt?.end(),De(),Pe(!1),U=null,ae=null,Ye()};function xn(n){Je(),_e(!1),n();try{me?.removeItem(k)}catch{}q(),qe();for(let c of[...g.children])c!==f&&c.remove();hn()}function qt(){xn(()=>F.reset()),m.focus()}let zi={highlight:[t.nameHighlight,t.descHighlight],scroll_to:[t.nameScroll,t.descScroll],click:[t.nameClick,t.descClick],fill:[t.nameFill,t.descFill],navigate:[t.nameNavigate,t.descNavigate]},Ze=null,xt=n=>{if(!Ze)return;let c=n?.closest(".ec-opt");if(!c){Ze.style.opacity="0";return}Ze.style.top=`${c.offsetTop}px`,Ze.style.height=`${c.offsetHeight}px`,Ze.style.opacity="1"},yn=(n,c,u)=>{let h=he("ec-switch");return h.setAttribute("role","switch"),h.setAttribute("aria-checked",String(c)),h.setAttribute("aria-label",n),h.addEventListener("click",()=>{let R=h.getAttribute("aria-checked")!=="true";h.setAttribute("aria-checked",String(R)),u(R)}),h},Dt=()=>{let n=L("p","ec-pop-title",t.optionsTitle);n.id="ec-pop-title";let c=L("div","ec-opts");if(Ze=c.appendChild(L("span","ec-glide")),!E){H.replaceChildren(n,L("p","ec-pop-hint",t.optionsUnavailable));return}let u=vt(),h=Re.policy().confirm;for(let M of u){let[J,ce]=zi[M],Q=L("div","ec-opt");Q.toggleAttribute("data-off",S.off.includes(M)),Q.appendChild(L("span","ec-opt-icon")).appendChild(te(e,M));let Me=Q.appendChild(L("div",""));Me.append(L("p","ec-opt-name",J),L("p","ec-opt-desc",ce));let le=null;if(Hi.includes(M)&&h.includes(M)){let we=Me.appendChild(L("div","ec-ask"));le=yn(`${t.askFirst}: ${J}`,!Se().includes(M),Ie=>{Ge(M,!Ie),le.setAttribute("aria-checked",String(!Se().includes(M)))}),le.disabled=S.off.includes(M),we.append(le,L("span","",t.askFirst))}Q.appendChild(yn(J,!S.off.includes(M),we=>{S.off=we?S.off.filter(Ie=>Ie!==M):[...S.off,M],Q.toggleAttribute("data-off",!we),le&&(le.disabled=!we),D(),qe()})),Q.addEventListener("pointerenter",()=>xt(Q)),c.appendChild(Q)}c.addEventListener("pointerleave",()=>xt(r.activeElement));let R=[n];u.length?R.push(c,L("p","ec-pop-hint",t.optionsHint)):R.push(L("p","ec-pop-hint",t.optionsEmpty)),H.replaceChildren(...R)},kn=()=>Array.from(H.querySelectorAll("button")).filter(n=>!n.disabled),Ui=()=>{Dt(),H.hidden=!1,B.setAttribute("aria-expanded","true");let n=kn()[0];n?(n.focus(),xt(n)):(H.tabIndex=-1,H.focus())};function _e(n=!0){H.hidden||(H.hidden=!0,B.setAttribute("aria-expanded","false"),n&&B.focus())}let wn=n=>{let c=kn(),u=c.indexOf(r.activeElement),h=-1;n.key==="ArrowDown"?h=(u+1)%c.length:n.key==="ArrowUp"?h=(u-1+c.length)%c.length:n.key==="Home"?h=0:n.key==="End"&&(h=c.length-1),!(h<0||!c.length)&&(n.preventDefault(),c[h].focus())},$e=n=>Ne.includes(n),yt=ai({key:i.key,baseUrl:i.baseUrl,fetch:i.fetch}),Ot=()=>Fe("support",!0),Cn="",En=(n,c)=>{if(yt.peek()?.render==="link"&&n.url){V?.open(n.url,"_blank","noopener,noreferrer");return}Cn=n.id,Fe("article"),Wi.show(n,c)},Tn=()=>{Y=Y.filter(n=>n!=="guides"),kt()},$t=yi({doc:e,TEXT:t,source:yt,root:re.guides,hasSupport:()=>$e("support"),openSupport:Ot,openGuide:En,onHidden:Tn}),Ft=Mi({key:i.key,baseUrl:i.baseUrl,fetch:i.fetch,identity:Ae,onWaiting:n=>{Ue=n??0,Rn()}}),An=n=>{n==="hidden"?Y=Y.filter(c=>c!=="tickets"):rt=!0,kt()},Sn=()=>{let n=V?.espejo;return typeof n?.canOpenReport=="function"?n:null},Ln=wi({doc:e,TEXT:t,source:Ft,root:re.tickets,canReport:()=>!!Sn()?.canOpenReport(),report:()=>{Sn()?.openReport()&&Be(!1)},onGone:An}),Wi=bi({doc:e,TEXT:t,source:yt,root:re.article,hasSupport:()=>$e("support"),openSupport:Ot,back:()=>{Fe("guides"),$t.focusGuide(Cn)||Hn()}}),Mn=n=>{if(ve==="home")Ci({doc:e,TEXT:t,root:re.home,source:yt,support:$e("support"),guides:$e("guides"),last:at(),openSupport:Ot,searchGuides:()=>Fe("guides",!0),openGuide:En,onHidden:Tn,tickets:$e("tickets")?Ft:null,openTickets:()=>Fe("tickets",!0),onTicketsGone:An});else if(ve==="tickets"){Ln.show(n);return}else if(ve==="guides"){$t.show(n);return}n&&Hn()};function Hn(){ve==="support"?m.focus():_n(re[ve])[0]?.focus()}function Fe(n,c=!1){n!=="support"&&_e(!1),ve=n;for(let h of Object.keys(re))re[h].hidden=h!==n;B.hidden=N.hidden=n!=="support";let u=n==="article"?"guides":n;for(let h of ee.querySelectorAll("button"))h.getAttribute("data-view")===u?h.setAttribute("aria-current","page"):h.removeAttribute("aria-current");p&&Mn(c)}let Nn={home:["home",t.tabHome],support:["chat",t.tabSupport],tickets:["ticket",t.tabTickets],guides:["book",t.tabGuides]};function Rn(){let n=ee.querySelector('[data-view="tickets"]');if(n?.querySelector(".ec-count")?.remove(),!n||!Ue)return;let c=n.appendChild(L("span","ec-count"));c.append(L("span","",String(Ue)),L("span","ec-sr",t.ticketsWaiting.replace("{n}",String(Ue)))),c.firstElementChild.setAttribute("aria-hidden","true")}let Qi=()=>{Be(),b=!0,d.hidden=!0,ke?.(),ke=null};function kt(){if(Ne=Y.filter(c=>c!=="tickets"||Ae&&!rt),!Ne.some(c=>c!=="home"))return Qi();b&&(b=!1,d.hidden=!1,Vt()),$e("support")||Je(),ee.hidden=Ne.length<2,ee.replaceChildren(...Ne.map(c=>{let u=he("ec-tab");return u.setAttribute("data-view",c),u.append(te(e,Nn[c][0],18),L("span","",Nn[c][1])),u.addEventListener("click",()=>{Fe(c),u.focus()}),u})),Rn(),Fe(p&&$e(ve==="article"?"guides":ve)?ve:Ne[0])}let Pn=()=>{p||b||(p=!0,l.hidden=!1,Wn(),C.setAttribute("aria-expanded","true"),Mn(!0))},Be=(n=!0)=>{p&&(p=!1,Je(),_e(!1),Oe(),l.hidden=!0,C.setAttribute("aria-expanded","false"),n&&C.focus())},_n=n=>Array.from(n.querySelectorAll("button, textarea, input, a[href]")).filter(c=>!c.hasAttribute("disabled")&&!c.closest("[hidden], [inert]")),In=n=>{if(!p)return;if(n.key==="Escape"){n.preventDefault(),H.hidden?Be():_e();return}if(n.key!=="Tab")return;let c=_n(H.hidden?l:H);if(c.length===0)return;let u=c[0],h=c[c.length-1],R=r.activeElement;n.shiftKey&&(R===u||!c.includes(R))?(n.preventDefault(),h.focus()):!n.shiftKey&&(R===h||!c.includes(R))&&(n.preventDefault(),u.focus())},Gn=n=>{n.key!=="Enter"||n.shiftKey||n.isComposing||(n.preventDefault(),bt())},Bt=()=>{m.style.height="",m.style.height=`${Math.min(m.scrollHeight,120)}px`,Ye()},qn=n=>{n.preventDefault(),bt()},Dn=()=>{F.busy&&!m.value.trim()?Je():bt()},On=()=>{p?Be():Pn()},$n=()=>{H.hidden?Ui():_e()},Fn=n=>{if(H.hidden)return;let c=n.composedPath();!c.includes(H)&&!c.includes(B)&&_e(!1)},Bn=n=>{!H.hidden&&!n.composedPath().includes(a)&&_e(!1)},jn=n=>xt(n.target),jt=!1,Ki=n=>{if(n.type==="focusin")return jt||!!r.activeElement?.closest(".ec-card");let c="changedTouches"in n?n.changedTouches[0]:n;return!!(c&&typeof r.elementFromPoint=="function"?r.elementFromPoint(c.clientX,c.clientY):null)?.closest(".ec-card")},Vn=n=>{if(!n.composedPath().includes(a)||!pe.size)return;let c=Ki(n);n.type==="pointerdown"||n.type==="touchstart"||n.type==="mousedown"?jt=c:n.type==="mouseup"&&(jt=!1),c&&(n.stopPropagation(),n.type==="pointerdown"&&_e(!1))},zn=()=>i.theme??E?.theme??"auto",Un=()=>{let n=C.getBoundingClientRect(),c=V?.innerWidth??0,u=V?.innerHeight??0,h=n.width?n.left+n.width/2:o.endsWith("left")?40:c-40,R=n.height?n.top+n.height/2:o.startsWith("top")?40:u-40;a.setAttribute("data-theme",Rt(e,a,h,R))},Vt=()=>{let n=zn();n!=="auto"?(ke?.(),ke=null,a.setAttribute("data-theme",n)):Wn()};function Wn(){zn()==="auto"&&(ke?Un():ke=Si(e,Un))}let Qn=n=>{let c=u=>{if(n&&/^https:\/\//i.test(n)){let h=e.createElement("img");return h.alt="",h.referrerPolicy="no-referrer",h.decoding="async",h.width=h.height=u,h.addEventListener("error",()=>h.replaceWith(te(e,"chat",u===52?24:16)),{once:!0}),h.src=n,h}return te(e,vi(n)?n:"chat",u===52?24:16)};W.replaceChildren(c(52)),P.replaceChildren(c(30))},Kn=()=>{let n=i.title||E?.name||t.title;z.textContent=n,C.setAttribute("aria-label",i.title||E?.name?`${t.open} (${n})`:t.open),O.hidden=!E?.enabled,Vt()},zt=()=>{b||T||(C.removeAttribute("data-pending"),C.removeAttribute("inert"))},Yi=n=>{T||(E=n,Y=n?n.sections:["support"],n?.icon&&Qn(n.icon),Kn(),qe(),H.hidden||Dt(),kt(),zt())};q(),qe(),Qn(null),Kn(),Ye(),hn();let Ji=Lt(d);d.addEventListener("keydown",In),d.addEventListener("pointerdown",Fn),e.addEventListener("pointerdown",Bn,!0);for(let n of Ri)V?.addEventListener(n,Vn,Pi);H.addEventListener("keydown",wn),H.addEventListener("focusin",jn),m.addEventListener("keydown",Gn),m.addEventListener("input",Bt),v.addEventListener("submit",qn),A.addEventListener("click",Dn),C.addEventListener("click",On),B.addEventListener("click",$n),I.addEventListener("click",Be),N.addEventListener("click",qt),l.addEventListener("pointerenter",Oe),e.body.appendChild(a);let wt=i.presence===!1?null:sn(Re,{lang:i.lang,text:{presenceNotice:t.presenceNotice,presenceNoticeNamed:t.presenceNoticeNamed,stop:t.stop},idleMs:0,onStop:Je,doc:e,themeOf:()=>a.getAttribute("data-theme")==="dark"?"dark":"light",nameOf:()=>i.title||E?.name,origin:()=>{let n=(p?l:C).getBoundingClientRect(),c=ee.hidden?0:ee.offsetHeight;return n.width?{x:n.left+n.width/2,y:p?n.bottom-60-c:n.top+n.height/2}:null}});Vt();let Yn=V?.setTimeout(zt,Qo);return F.getConfig().then(Yi),{open:Pn,close:()=>Be(),identify(n,c){let u=ut(n,c);T||u?.email===Ae?.email&&u?.hash===Ae?.hash||(Ae=u,rt=!1,Ft.identify(u),Ln.reset(),re.home.replaceChildren(),xn(()=>F.identify(u)),kt(),E!==void 0&&zt())},destroy(){Je(),Oe(),ke?.(),ke=null,T=!0,$t.destroy(),wt?.destroy(),Re.policy({allow:y.allow,confirm:y.confirm}),Yn!==void 0&&V?.clearTimeout(Yn),F.destroy(),Ji(),d.removeEventListener("keydown",In),d.removeEventListener("pointerdown",Fn),e.removeEventListener("pointerdown",Bn,!0);for(let n of Ri)V?.removeEventListener(n,Vn,Pi);H.removeEventListener("keydown",wn),H.removeEventListener("focusin",jn),m.removeEventListener("keydown",Gn),m.removeEventListener("input",Bt),v.removeEventListener("submit",qn),A.removeEventListener("click",Dn),C.removeEventListener("click",On),B.removeEventListener("click",$n),I.removeEventListener("click",Be),N.removeEventListener("click",qt),l.removeEventListener("pointerenter",Oe),a.remove()},client:F}}export{cn as CHAT_HOST_ATTRIBUTE,Ei as DEFAULT_CHAT_TEXT,Pt as PRESENCE_HOST_ATTRIBUTE,gt as chatTextFor,Yt as createChatClient,Ht as describeAction,an as describeError,mt as describeValue,er as installChatWidget,Vo as installPresence};
|
|
1207
|
+
</div>`;let l=t=>c.getElementById(t),d=c.querySelector(".ec-root"),m=l("ec-panel"),h=l("ec-log"),x=l("ec-thinking"),w=l("ec-time"),A=l("ec-form"),P=l("ec-manage"),S=l("ec-input"),G=l("ec-send"),L=l("ec-trigger"),$=l("ec-glyph"),q=l("ec-avatar"),j=l("ec-title"),V=l("ec-status"),I=l("ec-opts"),R=l("ec-pop"),re=l("ec-close"),ve=l("ec-dock"),Te=l("ec-expand"),K=l("ec-jump"),ne=l("ec-hint"),Se=l("ec-alert"),de=l("ec-queue"),be=l("ec-queue-head"),ze=l("ec-queue-list"),Ne=l("ec-queue-live"),pe={home:l("ec-view-home"),support:l("ec-view-support"),tickets:l("ec-view-tickets"),guides:l("ec-view-guides"),article:l("ec-view-article")},Z=l("ec-tabs");Z.setAttribute("aria-label",n.tabs);let ue=(t,i,p)=>{t.replaceChildren(oe(e,i)),t.setAttribute("aria-label",p),t.title=p};ue(re,"chevron",n.minimize),ue(I,"sliders",n.options),l("ec-x").appendChild(oe(e,"close",22)),l("ec-hint2").textContent=n.hintNewline,K.append(oe(e,"up",15),n.jumpLatest),l("ec-thinking-label").textContent=n.thinking,V.textContent=n.online,S.setAttribute("aria-label",n.inputLabel),S.placeholder=n.placeholder;let u=e.defaultView,v=(()=>{if(o.storage!==void 0)return o.storage;try{return u?.sessionStorage??null}catch{return null}})(),k=!1,H=!1,D=null,O=!1,B,we=0,Ie=0,se=null,J=null,fe=!0,U="",nt=null,X=null,ie=null,Le=null,me=null,ot=0,ge=new Set,xt=new Map,qe=["support"],xe=qe,De=o.identity?Ut(o.identity.email,o.identity.hash):null,it=De?sr(o.identity?.name):"",rt=!1,yt=0,ce="support",at=null,st=null,Ge=null,Me=o.agent??Yn(o.allow,o.espejo),ct=Me.policy(),ke=!1,wt=`espejo:chat:prefs:${o.key}`,ye={off:[]},Jt="",Ot=()=>{ye={off:[]},Jt=_.conversationId;try{let t=JSON.parse(v?.getItem(wt)??"null");t&&t.c===_.conversationId&&Array.isArray(t.off)&&(ye={off:Ht.filter(i=>t.off.includes(i))})}catch{}},Sn=()=>{try{v?.setItem(wt,JSON.stringify({c:_.conversationId,...ye}))}catch{}},Zt=`espejo:chat:allow:${o.key}`,Xt=(()=>{if(o.storage!==void 0)return o.storage;try{return u?.localStorage??null}catch{return null}})(),Qe=()=>{try{let t=JSON.parse(Xt?.getItem(Zt)??"null");return Array.isArray(t)?or.filter(i=>t.includes(i)):[]}catch{return[]}},en=(t,i)=>{try{let p=Qe().filter(g=>g!==t);Xt?.setItem(Zt,JSON.stringify(i?[...p,t]:p))}catch{}},$t=`espejo:chat:last:${o.key}`,tn=()=>{try{let t=JSON.parse(v?.getItem($t)??"null");return t&&t.c===_.conversationId&&typeof t.t=="string"&&typeof t.at=="number"?{text:t.t,at:t.at}:null}catch{return null}},Ln=t=>{try{v?.setItem($t,JSON.stringify({c:_.conversationId,t:tn()?.text??t.slice(0,Va),at:Date.now()}))}catch{}},kt=`espejo:chat:used:${o.key}`,lt=()=>{try{v?.setItem(kt,_.conversationId)}catch{}},dt="";try{let t=v?.getItem(`espejo:chat:${o.key}`);t&&v?.getItem(kt)===t&&(dt=t)}catch{}let nn=()=>B?Ht.filter(t=>ct.allow.includes(t)&&B.allowed_actions.includes(t)):[],Ye=()=>{if(ke)return;let t=B?nn():ct.allow;Me.policy({allow:t.filter(i=>!ye.off.includes(i))})},f=()=>{if(Jt!==_.conversationId){try{v?.removeItem(wt)}catch{}Ot(),Ye(),R.hidden||qn()}},y=()=>{fe&&(h.scrollTop=h.scrollHeight)},C=t=>(h.insertBefore(t,x),J?.nodes.push(t),y(),t),b=(t,i,p)=>{let g=e.createElement(t);return g.className=i,p!==void 0&&(g.textContent=p),g},N=(t,i)=>{let p=b("button",t,i);return p.type="button",p},F=(t,i)=>{let p=b("div",`ec-fold ${t}`);p.id=`ec-f${++ot}`;let g=p.appendChild(b("div",""));return z(p,!i),{fold:p,inner:g}};function z(t,i){t.toggleAttribute("data-closed",!i),t.firstElementChild?.toggleAttribute("inert",!i)}let W=(t,i,p)=>{t.setAttribute("aria-expanded",String(p)),t.setAttribute("aria-controls",i.id),z(i,p)},Q=t=>{let i=b("div","ec-msg");return i.setAttribute("data-role","assistant"),so(e,i,t),C(i)},Ct=t=>{let i=b("span","ec-caret");i.setAttribute("aria-hidden","true");let p=t,g=t.lastElementChild;return g&&(p=g.tagName==="UL"||g.tagName==="OL"||g.tagName==="PRE"?g.lastElementChild??g:g),p.appendChild(i),i},Ce=()=>{let t=!!S.value.trim(),i=_.busy&&!t;G.replaceChildren(i?b("i",""):oe(e,"up",16)),G.toggleAttribute("data-stop",i),G.setAttribute("aria-label",i?n.stop:n.send),G.title=i?n.stop:n.send,G.disabled=!i&&!t,A.toggleAttribute("data-typed",t),ne.textContent=_.busy?n.hintQueue:n.hintSend,Be()};function Be(){let t=x.previousElementSibling,i=!_.busy&&!ge.size;for(let p of h.querySelectorAll(".ec-regen"))p.hidden=!i||p.parentElement!==t;for(let p of h.querySelectorAll("[data-again]"))p.hidden=!i||(p.closest(".ec-alert")??p.closest(".ec-u")?.nextElementSibling)!==t;for(let p of h.querySelectorAll(".ec-bar"))p.toggleAttribute("data-on",p===t)}let on=(t,i)=>{let p=()=>{let g=c.activeElement,E=d.appendChild(b("textarea","ec-sr"));E.value=t,E.select();let M=!1;try{M=e.execCommand("copy")}catch{}E.remove(),g?.focus(),M&&i()};try{let g=u?.navigator.clipboard?.writeText(t);g?g.then(i,p):p()}catch{p()}},pt=(t,i)=>{let p=N(i?"ec-code-copy":"ec-icon"),g,E=M=>{p.replaceChildren(oe(e,M?"check":"copy",15),...M?[b("span","",n.copied)]:i?[i]:[]),p.toggleAttribute("data-copied",M),!i&&(p.setAttribute("aria-label",M?n.copied:n.copy),p.title=n.copy)};return E(!1),p.addEventListener("click",()=>on(t(),()=>{E(!0),u?.clearTimeout(g),g=u?.setTimeout(()=>E(!1),Wa)})),p},Et=(t,i,p)=>{let g=N("ec-icon");return ue(g,t,i),g.addEventListener("click",p),g},rn=t=>{let i=b("div","ec-code");t.replaceWith(i),i.append(b("div","ec-code-head"),t),i.firstChild.appendChild(pt(()=>t.textContent??"",n.copyCode))},fo=()=>{let t=Math.floor((Date.now()-Ie)/1e3);return t<60?`${t}s`:`${Math.floor(t/60)}m${t%60}s`},Fe=t=>{x.hidden=!t,st!==null&&u?.clearInterval(st),st=null,t&&(h.appendChild(x),w.textContent=fo(),st=u?.setInterval(()=>w.textContent=fo(),100)??null,y())},ut=()=>{if(h.removeAttribute("aria-busy"),!se)return;let t=se.el.querySelector(".ec-caret");t&&(t.setAttribute("data-end",""),u?.setTimeout(()=>t.remove(),1400));for(let i of se.el.querySelectorAll("pre"))rn(i);se=null},go=()=>{let t=r?"default":B?.greeting_mode;return t==="agent"?"":t==="custom"&&B?.greeting_text||n.greeting},an="",je=!1,zt=0,cr=0,Mn=()=>{an=go(),an&&Q(an);let t=(o.suggestions??[]).map(i=>String(i).trim().slice(0,za)).filter(Boolean).slice(0,$a);t.length&&(me=b("div","ec-suggest"),me.setAttribute("role","group"),me.setAttribute("aria-label",n.suggestions),t.forEach((i,p)=>{let g=N("ec-chip",i);g.style.animationDelay=`${p*90}ms`,g.addEventListener("click",()=>{S.value=i,ln()}),me.appendChild(g)}),C(me))},mo=()=>{for(let t of[...ge])t(!1);Re()},Je=()=>{at!==null&&u?.clearTimeout(at),at=null,m.removeAttribute("data-dodge")},lr=()=>{let t=e.querySelector(`[${et}]:not([${po}]):not([${Tn}])`);if(!t||m.hidden)return;let i=t.getBoundingClientRect(),p=m.getBoundingClientRect();i.width>0&&p.width>0&&i.left<p.right&&p.left<i.right&&i.top<p.bottom&&p.top<i.bottom&&(Je(),m.setAttribute("data-dodge",""),at=u?.setTimeout(Je,xi)??null)},ho=t=>t&&!Fa.test(t)?t:void 0,dr=()=>{if(ie)return ie;let t=b("div","ec-tools"),i=N("ec-tools-head");i.hidden=!0;let{fold:p,inner:g}=F("",!1);return W(i,p,!0),i.addEventListener("click",()=>W(i,p,i.getAttribute("aria-expanded")!=="true")),t.append(i,p),ie={el:t,head:i,fold:p,list:g,rows:0},C(t),ie},Rn=(t,i)=>{let p=dr(),g=b("div","ec-tool");g.style.animationDelay=`${Math.min(p.rows,4)*50}ms`;let E=N("ec-tool-row"),M=b("span","ec-state"),Y=b("span","ec-tool-text"),ae=b("span","ec-pill"),ee=oe(e,"chevron",14);ee.setAttribute("class","ec-chev"),E.append(M,Y,ae,ee);let{fold:He,inner:We}=F("ec-detail",!0);W(E,He,!1),E.addEventListener("click",()=>W(E,He,E.getAttribute("aria-expanded")!=="true")),g.append(E,He),p.list.appendChild(g),p.rows++,p.head.hidden=p.rows<2,p.head.replaceChildren(oe(e,"chevron",12),e.createTextNode(n.actionsCount.replace("{n}",String(p.rows)))),p.head.firstChild.setAttribute("class","ec-chev"),y();let he={el:g,btn:E,stateBox:M,text:Y,pill:ae,fold:He,detail:We,callId:i,parts:t};return Hn(he,"running"),he},Hn=(t,i,p)=>{t.parts.target=ho(t.parts.target),t.el.setAttribute("data-state",i);let{type:g}=t.parts;t.text.textContent=It(n,i==="done"?"done":"confirm",t.parts).replace(/:$/,""),t.pill.textContent=i==="done"?n.done:i==="error"?n.failed:i==="declined"?n.declined:n.running,t.stateBox.replaceChildren(i==="done"?oe(e,"check"):i==="error"?oe(e,"close"):i==="declined"?oe(e,"minus"):b("span","ec-spin"));let E=[];t.parts.target&&g!=="navigate"&&E.push([n.detailTarget,`\xAB${t.parts.target}\xBB`]),t.parts.destination&&E.push([n.detailDestination,t.parts.destination,!0]),g==="fill"&&t.parts.value!==void 0&&E.push([n.detailValue,qt(n,t.parts.value),!0]),(i==="error"||i==="declined")&&E.push(["",co(n,p)]),t.detail.replaceChildren(...E.map(([M,Y,ae])=>{let ee=b("p","");return M&&ee.appendChild(b("b","",M)),ee.appendChild(b("span",ae?"ec-mono":"",Y)),ee})),i==="error"&&W(t.btn,t.fold,!0)},vo=t=>!!t&&(t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.tagName==="SELECT"||t.isContentEditable||!!t.closest('[contenteditable]:not([contenteditable="false"])')),pr=()=>{let t=e.activeElement;return t===a?!vo(c.activeElement):!t||t===e.body||t===e.documentElement},ur=t=>{if(ke)return Promise.resolve(!1);f();let i=t.action.type;if(Qe().includes(i))return Promise.resolve(!0);Je(),ut(),Fe(!1),X?.start(),X?.setModalSuspended(H);let p={type:i,target:ho(t.target),destination:t.destination,value:t.value},g=Le??Rn(p,null);Object.assign(g.parts,p),ie&&W(ie.head,ie.fold,!0),g.el.setAttribute("data-state","ask"),g.btn.hidden=!0;let E=`ec-c${++ot}`,M=b("div","ec-card");M.setAttribute("role","alertdialog"),M.setAttribute("aria-labelledby",`${E}t`),M.setAttribute("aria-describedby",`${E}w`);let Y=M.appendChild(b("p","ec-card-title",n.confirmTitle));Y.id=`${E}t`;let ae=M.appendChild(b("p","ec-card-what",It(n,"confirm",p)));ae.id=`${E}w`,i==="fill"&&M.append(b("p","ec-card-value",qt(n,t.value??"")));let ee=b("div","ec-actions"),He=N("ec-btn",n.allow),We=N("ec-btn",n.allowAlways),he=N("ec-btn",n.decline);He.setAttribute("data-primary",""),ee.append(He,We,he),M.append(ee),M.tabIndex=-1,g.el.appendChild(M),y();let $e=`${n.confirmTitle} ${ae.textContent}`;if(i==="fill"){let Vt=qt(n,t.value??"");$e+=` ${Vt.length>ir?`${Vt.slice(0,ir)}\u2026`:Vt}`}Se.textContent=$e,pr()&&M.focus();let Xe=Date.now()+Ba;return new Promise(Vt=>{let Lt=Mt=>{if(!ge.delete(Lt))return;xt.delete(Lt),Re();let Rt=M.contains(c.activeElement);k&&Rt&&S.focus(),M.remove(),Se.textContent="",g.btn.hidden=!1,Hn(g,Mt?"running":"declined","declined");let vn=e.activeElement;k&&!Rt&&(!vn||vn===e.body)&&S.focus(),Vt(Mt)},hn=(Mt,Rt=!1)=>Date.now()<Xe?!1:(Rt&&ge.has(Lt)&&en(i,!0),Lt(Mt),!0),Un=(Mt,Rt=!1)=>vn=>{hn(Mt,Rt)||vn.preventDefault()};ge.add(Lt),He.addEventListener("click",Un(!0)),We.addEventListener("click",Un(!0,!0)),he.addEventListener("click",Un(!1)),xt.set(Lt,{what:It(n,"confirm",p),value:i==="fill"?qt(n,t.value??""):void 0,allow:()=>hn(!0),always:()=>hn(!0,!0),decline:()=>hn(!1)}),H&&!X&&!k&&Tt(),Re()})},bo=(t,i)=>{let p=i??(t==="no_agent"||t==="forbidden"?n.errorNoAgent:t==="unavailable"?n.errorUnavailable:t==="daily_cap"?n.errorDailyCap:t==="rate_limited"?n.errorRateLimited:t==="conversation_limit"||t==="conversation_expired"?n.errorConversationLimit:t==="conversation_busy"?n.errorBusy:t==="network"?n.errorNetwork:n.errorGeneric),g=J,E=b("div","ec-alert");E.setAttribute("data-tone",t==="network"||t==="no_agent"||t==="forbidden"?"bad":"warn");let M=b("div","");E.append(oe(e,"alert"),M);let Y=M.appendChild(b("div","ec-error"));if(Y.setAttribute("data-code",t),Y.append(b("p","",p)),t==="conversation_limit"||t==="conversation_expired"){let ae=N("ec-btn",n.startOver);ae.addEventListener("click",In),Y.append(ae)}g&&t==="network"&&!g.got?fr(g):g&&Ua.includes(t)?xo(M.appendChild(N("ec-btn",n.retry)),g):t==="daily_cap"&&Ve("tickets")&&M.appendChild(N("ec-btn",n.reportProblem)).addEventListener("click",()=>Ze("tickets",!0)),C(E),J=null},fr=t=>{t.user.setAttribute("data-failed","");let i=t.user.appendChild(b("div","ec-fail"));i.append(oe(e,"alert",14),b("span","",n.notSent)),xo(i.appendChild(N("ec-btn",n.resend)),t)},xo=(t,i)=>{t.setAttribute("data-again",""),t.addEventListener("click",()=>Pn(i))},gr=()=>{let t=J;if(!t?.bubbles.length)return void(J=null);let i=b("div","ec-bar"),p=Et("thumb",n.goodResponse,()=>yo(p,g)),g=Et("thumb",n.badResponse,()=>yo(g,p));p.setAttribute("aria-pressed","false"),g.setAttribute("aria-pressed","false"),g.setAttribute("data-down","");let E=Et("restart",n.regenerate,()=>Pn(t));E.classList.add("ec-regen"),i.append(pt(()=>t.bubbles.map(M=>M.src).join(`
|
|
1208
|
+
|
|
1209
|
+
`)),E,p,g),C(i),J=null},yo=(t,i)=>{t.setAttribute("aria-pressed",String(t.getAttribute("aria-pressed")!=="true")),i.setAttribute("aria-pressed","false")},mr=t=>{if(t.type==="queue")return wr(t.queue,t.paused);if(_.busy)if(f(),t.type==="dequeued")zt=0,wo(t.message);else if(t.type==="text"){if(Fe(!1),ie=null,!se){let i=Q("");h.setAttribute("aria-busy","true"),se={el:i,src:""},J&&(J.bubbles.push(se),J.got=!0)}se.src+=t.delta,so(e,se.el,se.src),Ct(se.el),y()}else if(t.type==="tool_start")J&&(J.got=!0),ut(),Fe(!1),X?.start(),X?.setModalSuspended(H),X?.setStatus(It(n,"confirm",{type:t.call.name,target:t.target,destination:t.destination})),Le=Rn({type:t.call.name,target:t.target,destination:t.destination,value:t.value},t.call.id);else if(t.type==="tool"){X?.setStatus(),ut();let{result:i,call:p}=t,g=Le&&Le.callId===p.id?Le:Rn({type:p.name},p.id);Object.assign(g.parts,{type:p.name,target:t.target??g.parts.target,destination:t.destination??g.parts.destination,value:t.value??g.parts.value}),Hn(g,i.ok?"done":i.error==="declined"||i.error==="confirmation_required"?"declined":"error",i.error),Le=null,i.ok&&p.name==="highlight"&&lr(),Fe(!0)}else ut(),Fe(!1),ie=null,t.type==="error"?zt||bo(t.code):t.type==="done"&&(cn=null,lt(),gr())},_=Qn({key:o.key,baseUrl:o.baseUrl,agent:Me,espejo:o.espejo,fetch:o.fetch,storage:o.storage,identity:De,lang:o.lang,onConfirm:ur,onEvent:mr});dt!==_.conversationId&&(dt="");function wo(t){J=null;let i=ko(t);C(i.user),je=!0,Ln(t),lt(),Eo(i)}function ko(t){let i={prompt:t,user:b("div","ec-u"),nodes:[],bubbles:[],got:!1},p=i.user.appendChild(b("div","ec-u-row"));return p.appendChild(b("div","ec-acts")).append(pt(()=>t),Et("fill",n.queueEdit,()=>{if(i.user.hasAttribute("data-failed"))for(let E of[i.user,...i.nodes])E.remove();S.value=t,S.focus(),mn()})),p.appendChild(b("div","ec-msg",t)).setAttribute("data-role","user"),i}let Co=t=>{je=!0,me?.remove(),me=null;for(let i of t)if(i.role==="user")C(ko(i.text).user);else for(let p of Q(i.text).querySelectorAll("pre"))rn(p);Be()},hr=()=>{try{v?.removeItem($t),v?.removeItem(kt)}catch{}},sn="",_n=async()=>{let t=_.conversationId;if(!k||ce!=="support"||B===void 0||sn===t)return;if(sn=t,dt===t){dt="";let E=await _.loadConversation(t).catch(M=>(M.code==="conversation_not_found"&&hr(),null));if(ke||_.conversationId!==t||je)return;if(E?.messages.length)return Co(E.messages)}if(r||B?.greeting_mode!=="agent"||je||_.busy)return;je=!0;let i=zt=++cr,p=_.greet();Ie=Date.now(),Fe(!0),Bt(p);let g=await p;zt===i&&(zt=0),!(ke||_.conversationId!==t)&&(g==="done"?lt():h.querySelector(".ec-u")||h.prepend(Q(n.greeting)))},vr=t=>{if(t!==_.conversationId){let i;Nn(()=>{i=_.openConversation(t),sn=t}),i?.then(p=>{_.conversationId!==p.id||je||(Co(p.messages),lt())},()=>{_.conversationId!==t.toLowerCase()||je||(bo("conversation_not_found",n.errorHistory),sn="",_n())})}fn()},cn=null,br=()=>cn??=_.listConversations().catch(()=>(cn=null,[]));function Eo(t){ut(),me?.remove(),me=null,ie=null,Le=null,J=t,t.got=!1,fe=!0,Ie=Date.now(),Ce(),Fe(!0)}function Pn(t){if(_.busy||ge.size)return;for(let p of t.nodes)p.remove();t.nodes=[],t.bubbles=[],t.user.removeAttribute("data-failed"),t.user.querySelector(".ec-fail")?.remove();let i=_.send(t.prompt);Eo(t),_.resumeQueue(),Bt(i)}let Bt=async t=>{let i=++we;await t,i===we&&(X?.end(),Fe(!1),ut(),ie=null,Ce())},Ao=()=>{S.value="",S.style.height="",Ce()},ln=()=>{let t=S.value.trim();if(!t)return;if(_.busy||ge.size){_.enqueue(t)?Ao():Ne.textContent=n.queueFull;return}Ao();let i=_.send(t);wo(t),_.resumeQueue(),Bt(i)},xr=t=>{let i=_.sendQueuedNow(t);mo(),Bt(i)},yr=()=>{_.busy?_.resumeQueue():Bt(_.resumeQueue())};function wr(t,i){let p=de.contains(c.activeElement);de.hidden=!t.length,de.toggleAttribute("data-paused",i);let g=b("p","",i?n.queuePaused:n.queueTitle.replace("{n}",String(t.length)));g.id="ec-queue-title";let E=[g];if(i){let M=N("ec-btn",n.queueResume);M.addEventListener("click",yr);let Y=N("ec-btn",n.queueClear);Y.addEventListener("click",()=>_.clearQueue()),E.push(M,Y)}be.replaceChildren(...E),ze.replaceChildren(...t.map(({id:M,text:Y})=>{let ae=b("div","ec-q");ae.setAttribute("role","listitem");let ee=ae.appendChild(b("span","ec-q-text",Y));ee.title=Y;let He=[["up",n.queueSendNow,()=>xr(M)],["fill",n.queueEdit,()=>{_.removeQueued(M),S.value=S.value.trim()?`${S.value}
|
|
1210
|
+
${Y}`:Y,S.focus(),mn()}],["close",n.queueRemove,()=>_.removeQueued(M)]];for(let[We,he,$e]of He){let Xe=ae.appendChild(N("ec-icon"));ue(Xe,We,he),Xe.addEventListener("click",$e)}return ae})),Ne.textContent=t.length?g.textContent:"",p&&!de.contains(c.activeElement)&&S.focus()}let ft=()=>{let t=_.busy?J:null;if(we++,_.abort(),mo(),X?.end(),ut(),Fe(!1),ie=null,Le=null,J=null,t){let i=b("p","ec-stopped");i.append(b("i",""),n.stopped),i.appendChild(N("ec-regen",n.regenerateShort)).addEventListener("click",()=>Pn(t)),t.nodes.push(C(i))}Ce()};function Nn(t){ft(),Oe(!1),t();try{v?.removeItem(wt)}catch{}Ot(),Ye(),To(),je=!1,cn=null,Mn(),Ce(),_n()}function To(){for(let t of[...h.children])t!==x&&t.remove()}function In(){Nn(()=>_.reset()),S.focus()}let kr={highlight:[n.nameHighlight,n.descHighlight],scroll_to:[n.nameScroll,n.descScroll],click:[n.nameClick,n.descClick],fill:[n.nameFill,n.descFill],navigate:[n.nameNavigate,n.descNavigate]},At=null,dn=t=>{if(!At)return;let i=t?.closest(".ec-opt");if(!i){At.style.opacity="0";return}At.style.top=`${i.offsetTop}px`,At.style.height=`${i.offsetHeight}px`,At.style.opacity="1"},So=(t,i,p)=>{let g=N("ec-switch");return g.setAttribute("role","switch"),g.setAttribute("aria-checked",String(i)),g.setAttribute("aria-label",t),g.addEventListener("click",()=>{let E=g.getAttribute("aria-checked")!=="true";g.setAttribute("aria-checked",String(E)),p(E)}),g},qn=()=>{let t=b("p","ec-pop-title",n.optionsTitle);t.id="ec-pop-title";let i=b("div","ec-opts");if(At=i.appendChild(b("span","ec-glide")),!B){R.replaceChildren(t,b("p","ec-pop-hint",n.optionsUnavailable));return}let p=nn(),g=Me.policy().confirm;for(let M of p){let[Y,ae]=kr[M],ee=b("div","ec-opt");ee.toggleAttribute("data-off",ye.off.includes(M)),ee.appendChild(b("span","ec-opt-icon")).appendChild(oe(e,M));let We=ee.appendChild(b("div",""));We.append(b("p","ec-opt-name",Y),b("p","ec-opt-desc",ae));let he=null;if(or.includes(M)&&g.includes(M)){let $e=We.appendChild(b("div","ec-ask"));he=So(`${n.askFirst}: ${Y}`,!Qe().includes(M),Xe=>{en(M,!Xe),he.setAttribute("aria-checked",String(!Qe().includes(M)))}),he.disabled=ye.off.includes(M),$e.append(he,b("span","",n.askFirst))}ee.appendChild(So(Y,!ye.off.includes(M),$e=>{ye.off=$e?ye.off.filter(Xe=>Xe!==M):[...ye.off,M],ee.toggleAttribute("data-off",!$e),he&&(he.disabled=!$e),Sn(),Ye()})),ee.addEventListener("pointerenter",()=>dn(ee)),i.appendChild(ee)}i.addEventListener("pointerleave",()=>dn(c.activeElement));let E=[t];p.length?E.push(i,b("p","ec-pop-hint",n.optionsHint)):E.push(b("p","ec-pop-hint",n.optionsEmpty)),R.replaceChildren(...E)},Lo=()=>Array.from(R.querySelectorAll("button")).filter(t=>!t.disabled),Cr=()=>{qn(),R.hidden=!1,I.setAttribute("aria-expanded","true");let t=Lo()[0];t?(t.focus(),dn(t)):(R.tabIndex=-1,R.focus())};function Oe(t=!0){R.hidden||(R.hidden=!0,I.setAttribute("aria-expanded","false"),t&&I.focus())}let Er=()=>{let t=o.stickyContainerId!==void 0?o.stickyContainerId:B?.sticky_container_id;return typeof t=="string"?t.trim():""},Mo=()=>{let t=Er(),i=t?e.getElementById(t):null;if(i)return i;let p=e.querySelector("main, [role=main]");return p||(e.querySelector("#__next, #root, #app, [data-reactroot]")?.querySelector("main, [role=main]")??null)},Ar=()=>!!Mo(),Dn=()=>{ve.hidden=!Ar()},Tr=()=>{if(nt)return!0;if(!u||u.innerWidth<=768)return!1;let t=Mo(),i=t?.parentNode;if(!t||!i||t===a||a.contains(t)||t.contains(a)||t===e.body)return!1;let p=a.parentNode,g=a.nextSibling,E=t.getAttribute("style");return t.style.setProperty("min-width","0","important"),t.style.setProperty("width","calc(100% - 416px)","important"),t.style.setProperty("max-width","calc(100% - 416px)","important"),t.style.setProperty("box-sizing","border-box","important"),t.style.setProperty("margin-inline-start","0","important"),t.style.setProperty("margin-inline-end","auto","important"),i.insertBefore(a,t.nextSibling),a.setAttribute("data-sticky-docked",""),nt={target:t,targetStyle:E,hostParent:p,hostNext:g},!0},pn=()=>{let t=nt;if(t){if(t.hostParent?.isConnected){let i=t.hostNext?.parentNode===t.hostParent?t.hostNext:null;t.hostParent.insertBefore(a,i)}else e.body.append(a);t.targetStyle===null?t.target.removeAttribute("style"):t.target.setAttribute("style",t.targetStyle),a.removeAttribute("data-sticky-docked"),nt=null}},Ft=t=>{U=t,U?d.setAttribute("data-size",U):d.removeAttribute("data-size"),ue(Te,U==="expanded"?"collapse":"expand",U==="expanded"?n.collapse:n.expand),ue(ve,"dock",U==="docked"?n.undock:n.dock)},Ro=()=>{U==="docked"&&pn(),Ft(U==="expanded"?"":"expanded")},Ho=()=>{U==="docked"?(pn(),Ft("")):Tr()&&Ft("docked")},_o=()=>{U==="docked"&&u&&u.innerWidth<=768&&(pn(),Ft(""))},Po=(t=>i=>{let p=t(),g=p.indexOf(c.activeElement),E=-1;i.key==="ArrowDown"?E=(g+1)%p.length:i.key==="ArrowUp"?E=(g-1+p.length)%p.length:i.key==="Home"?E=0:i.key==="End"&&(E=p.length-1),!(E<0||!p.length)&&(i.preventDefault(),p[E].focus())})(Lo),Ve=t=>xe.includes(t),un=Hi({key:o.key,baseUrl:o.baseUrl,fetch:o.fetch}),fn=()=>Ze("support",!0),No="",Io=(t,i)=>{if(un.peek()?.render==="link"&&t.url){u?.open(t.url,"_blank","noopener,noreferrer");return}No=t.id,Ze("article"),Sr.show(t,i)},qo=()=>{qe=qe.filter(t=>t!=="guides"),gn()},Gn=Vi({doc:e,TEXT:n,source:un,root:pe.guides,hasSupport:()=>Ve("support"),openSupport:fn,openGuide:Io,onHidden:qo}),On=nr({key:o.key,baseUrl:o.baseUrl,fetch:o.fetch,identity:De,onWaiting:t=>{ke||(yt=t??0,zo())}}),Do=t=>{ke||(t==="hidden"?qe=qe.filter(i=>i!=="tickets"):(rt=!0,it=""),gn())},Go=()=>{let t=o.espejo??u?.espejo;return typeof t?.canOpenReport=="function"?t:null},$n=Wi({doc:e,TEXT:n,source:On,root:pe.tickets,canReport:()=>!!Go()?.canOpenReport(),report:()=>{Go()?.openReport()&&(ft(),gt(!1))},onGone:Do}),Sr=Fi({doc:e,TEXT:n,source:un,root:pe.article,hasSupport:()=>Ve("support"),openSupport:fn,back:()=>{Ze("guides"),Gn.focusGuide(No)||Oo()}}),zn=t=>{if(ce==="home")Ki({doc:e,TEXT:n,root:pe.home,name:it,source:un,support:Ve("support"),guides:Ve("guides"),last:tn(),history:B?.history_enabled&&De&&!rt?br:null,openConversation:vr,openSupport:fn,searchGuides:()=>Ze("guides",!0),openGuide:Io,onHidden:qo,restart:In,tickets:Ve("tickets")?On:null,openTickets:()=>Ze("tickets",!0),onTicketsGone:Do});else if(ce==="tickets"){$n.show(t);return}else if(ce==="guides"){Gn.show(t);return}else ce==="support"&&!Ve("home")&&P.replaceChildren(ao(e,n,{restart:In}));ce==="support"&&_n(),t&&Oo()};function Oo(){ce==="support"?S.focus():Bo(pe[ce])[0]?.focus()}function Ze(t,i=!1){t!=="support"&&Oe(!1),ce=t;for(let g of Object.keys(pe))pe[g].hidden=g!==t;Dn();let p=t==="article"?"guides":t;for(let g of Z.querySelectorAll("button"))g.getAttribute("data-view")===p?g.setAttribute("aria-current","page"):g.removeAttribute("aria-current");k&&zn(i)}let $o={home:["home",n.tabHome],support:["chat",n.tabSupport],tickets:["ticket",n.tabTickets],guides:["book",n.tabGuides]};function zo(){let t=Z.querySelector('[data-view="tickets"]');if(t?.querySelector(".ec-count")?.remove(),!t||!yt)return;let i=t.appendChild(b("span","ec-count"));i.append(b("span","",String(yt)),b("span","ec-sr",n.ticketsWaiting.replace("{n}",String(yt)))),i.firstElementChild.setAttribute("aria-hidden","true")}let Lr=()=>{ft(),gt(),O=!0,d.hidden=!0,Ge?.(),Ge=null};function gn(){if(xe=qe.filter(i=>i!=="tickets"||De&&!rt),!xe.some(i=>i!=="home"))return Lr();O&&(O=!1,d.hidden=!1,Fn()),Ve("support")||ft(),Z.hidden=xe.length<2,Z.replaceChildren(...xe.map(i=>{let p=N("ec-tab");return p.setAttribute("data-view",i),p.append(oe(e,$o[i][0],18),b("span","",$o[i][1])),p.addEventListener("click",()=>{Ze(i),p.focus()}),p})),zo(),Ze(k&&Ve(ce==="article"?"guides":ce)?ce:xe[0])}let Tt=()=>{k||O||(k=!0,ii(),zn(!H),Re())},gt=(t=!0)=>{if(!k)return;let i=D;if(D=null,i?.wasOpen&&H){Re();return}k=!1,Oe(!1),Je(),m.hidden=!0,L.setAttribute("aria-expanded","false"),t&&!H&&L.focus(),Re(),H&&!X&&ge.size>0&&Tt()},Bo=t=>Array.from(t.querySelectorAll("button, textarea, input, a[href]")).filter(i=>!i.hasAttribute("disabled")&&!i.closest("[hidden], [inert]")),Fo=t=>{if(!k)return;if(t.key==="Escape"){t.preventDefault(),R.hidden?gt():Oe();return}if(t.key!=="Tab")return;let i=Bo(R.hidden?m:R);if(i.length===0)return;let p=i[0],g=i[i.length-1],E=c.activeElement;t.shiftKey&&(E===p||!i.includes(E))?(t.preventDefault(),g.focus()):!t.shiftKey&&(E===g||!i.includes(E))&&(t.preventDefault(),p.focus())},jo=t=>{t.key!=="Enter"||t.shiftKey||t.isComposing||(t.preventDefault(),ln())},mn=()=>{S.style.height="",S.style.height=`${Math.min(S.scrollHeight,120)}px`,Ce()},Vo=t=>{t.preventDefault(),ln()},Uo=()=>{_.busy&&!S.value.trim()?ft():ln()},Wo=()=>{k?gt():Tt()},Ko=()=>{R.hidden?Cr():Oe()},Qo=t=>{let i=t.composedPath();R.hidden||i.includes(R)||i.includes(I)||Oe(!1)},Yo=t=>{t.composedPath().includes(a)||Oe(!1)},Jo=()=>{fe=h.scrollHeight-h.scrollTop-h.clientHeight<=60,K.hidden=fe},Zo=()=>{fe=!0,y(),K.hidden=!0,S.focus()},Xo=t=>dn(t.target),Bn=!1,Mr=t=>{if(t.type==="focusin")return Bn||!!c.activeElement?.closest(".ec-card");let i="changedTouches"in t?t.changedTouches[0]:t;return!!(i&&typeof c.elementFromPoint=="function"?c.elementFromPoint(i.clientX,i.clientY):null)?.closest(".ec-card")},ei=t=>{if(!t.composedPath().includes(a)||!ge.size)return;let i=Mr(t);t.type==="pointerdown"||t.type==="touchstart"||t.type==="mousedown"?Bn=i:t.type==="mouseup"&&(Bn=!1),i&&(t.stopPropagation(),t.type==="pointerdown"&&Oe(!1))},Rr=()=>{if(Re(),!H){Tt();return}D={wasOpen:k},k?Re():Tt()},ti=t=>{if(!H)return;if(t.type==="focusout"){t.relatedTarget===a&&t.stopPropagation();return}if(!t.composedPath().includes(a))return;let i=a.hasAttribute("data-modal-collapsed");if(t.type==="click"){if(!i)return;t.stopPropagation(),Rr();return}if(t.stopPropagation(),t.type!=="pointerdown"&&t.type!=="mousedown")return;let p=t,g=!i&&typeof c.elementFromPoint=="function"?c.elementFromPoint(p.clientX,p.clientY):null;t.type==="pointerdown"&&!R.hidden&&!(g&&(R.contains(g)||I.contains(g)))&&Oe(!1),vo(g)||t.preventDefault()},ni=()=>o.theme??B?.theme??"auto",oi=()=>{let t=L.getBoundingClientRect(),i=u?.innerWidth??0,p=u?.innerHeight??0,g=t.width?t.left+t.width/2:s.endsWith("left")?40:i-40,E=t.height?t.top+t.height/2:s.startsWith("top")?40:p-40;a.setAttribute("data-theme",An(e,a,g,E))},Fn=()=>{let t=ni();t!=="auto"?(Ge?.(),Ge=null,a.setAttribute("data-theme",t)):ii()};function ii(){ni()==="auto"&&(Ge?oi():Ge=Zi(e,oi))}let ri=t=>{let i=p=>{if(t&&/^https:\/\//i.test(t)){let g=e.createElement("img");return g.alt="",g.referrerPolicy="no-referrer",g.decoding="async",g.width=g.height=p,g.addEventListener("error",()=>g.replaceWith(oe(e,"chat",p===52?24:16)),{once:!0}),g.src=t,g}return oe(e,Bi(t)?t:"chat",p===52?24:16)};$.replaceChildren(i(52)),q.replaceChildren(i(30))},ai=()=>{let t=o.title||B?.name||n.title;j.textContent=t,L.setAttribute("aria-label",o.title||B?.name?`${n.open} (${t})`:n.open),V.hidden=!B?.enabled,Fn()},jn=()=>{O||ke||(L.removeAttribute("data-pending"),L.removeAttribute("inert"))},Hr=t=>{ke||(B=t,Dn(),qe=t?t.sections:["support"],t?.icon&&ri(t.icon),Ri(c,t?.accent_color),X?.setAccent(t?.accent_color??null),ai(),Ye(),R.hidden||qn(),!je&&!_.busy&&an!==go()&&(To(),Mn()),gn(),jn())};Ot(),Ye(),ri(null),ai(),Ft(""),Dn(),Ce(),Mn();let _r=xn(d);d.addEventListener("keydown",Fo),d.addEventListener("pointerdown",Qo),u?.addEventListener("resize",_o),e.addEventListener("pointerdown",Yo,!0);for(let t of uo)u?.addEventListener(t,ei,rr);for(let t of ar)u?.addEventListener(t,ti,{capture:!0,passive:t.startsWith("touch")});R.addEventListener("keydown",Po),R.addEventListener("focusin",Xo),S.addEventListener("keydown",jo),S.addEventListener("input",mn),A.addEventListener("submit",Vo),G.addEventListener("click",Uo),L.addEventListener("click",Wo),I.addEventListener("click",Ko),re.addEventListener("click",gt),m.addEventListener("pointerenter",Je),Te.addEventListener("click",Ro),ve.addEventListener("click",Ho),h.addEventListener("scroll",Jo),K.addEventListener("click",Zo),e.body.appendChild(a);let si=typeof o.presence=="object"&&o.presence?o.presence:{};X=o.presence===!1?null:lo(Me,{lang:o.lang,glow:si.glow,cursor:si.cursor,text:{presenceNotice:n.presenceNotice,presenceNoticeNamed:n.presenceNoticeNamed,stop:n.stop,allow:n.allow,allowAlways:n.allowAlways,decline:n.decline},idleMs:0,onStop:ft,doc:e,themeOf:()=>a.getAttribute("data-theme")==="dark"?"dark":"light",nameOf:()=>o.title||B?.name,origin:()=>{let t=(k?m:L).getBoundingClientRect(),i=Z.hidden?0:Z.offsetHeight;return t.width?{x:t.left+t.width/2,y:k?t.bottom-60-i:t.top+t.height/2}:null}});let Vn=!1,Pr=t=>{if(t.hidden||t.hasAttribute("inert")||t.getAttribute("aria-hidden")==="true")return!1;for(let i=t;i&&i!==e.body;i=i.parentElement){if(i.hidden)return!1;let p=u?.getComputedStyle?.(i);if(p){if(p.display==="none"||p.visibility==="hidden")return!1;if(p.opacity==="0")return Vn=!0,!1}}return!0},Nr=t=>{try{return t.matches(":modal")}catch{return!0}},Ir=t=>{let i=t.getBoundingClientRect();return i.width>=(u?.innerWidth??0)*.9&&i.height>=(u?.innerHeight??0)*.9&&i.width>0},qr=()=>{let t=Array.from(e.querySelectorAll('[aria-modal="true"], [role="dialog"][data-state="open"], [role="alertdialog"][data-state="open"], dialog[open]')).filter(i=>i.getAttribute("aria-modal")==="true"||!i.closest("[data-radix-popper-content-wrapper]"));try{t.push(...Array.from(e.querySelectorAll("[popover]:popover-open")).filter(Ir))}catch{}return t.filter(i=>i.contains(a)||i.hasAttribute(et)||!Pr(i)?!1:i.tagName!=="DIALOG"||Nr(i))},Dr=t=>{try{return t.matches(":popover-open")}catch{return!1}},Ue=[],ci=t=>{for(let i=t;i;i=i.parentElement)if(Ue.includes(i))return i;return null},Gr=()=>{if(!Ue.length)return null;let t=ci(e.activeElement);if(t)return t;if(u&&typeof e.elementFromPoint=="function"){let i=ci(e.elementFromPoint(u.innerWidth/2,u.innerHeight/2));if(i)return i}return Ue[Ue.length-1]},jt,Re=(t=!1)=>{Vn=!1;let i=qr();H=i.length>0,H||(D=null),a.toggleAttribute("data-modal-suspended",H),Vn&&!t&&jt===void 0&&u&&(jt=u.setTimeout(()=>{jt=void 0,Re(!0)},ja));let p=ge.size>0&&!X,g=H&&!p&&!D;a.toggleAttribute("data-modal-collapsed",g),L.toggleAttribute("data-ask",g&&ge.size>0),k&&(g&&(Oe(!1),Je()),m.hidden=g,L.setAttribute("aria-expanded",String(!g)));for(let E=Ue.length-1;E>=0;E--)i.includes(Ue[E])||Ue.splice(E,1);for(let E of i)(E.tagName==="DIALOG"||Dr(E))&&!Ue.includes(E)&&Ue.push(E);X&&(X.setModalSuspended(H),X.setLayer(Gr()),X.setAsk(g?[...xt.values()].pop()??null:null))};Re();let St=0,mt=()=>{St||!u||(St=u.requestAnimationFrame(()=>{St=0,Re()}))},Or=t=>t.type==="attributes"&&!!t.target.closest?.(`[${et}]`),li=u?.MutationObserver?new u.MutationObserver(t=>{t.every(Or)||mt()}):null;li?.observe(e.body,{subtree:!0,childList:!0,attributes:!0}),e.addEventListener("transitionend",mt,!0),e.addEventListener("animationend",mt,!0),e.addEventListener("toggle",mt,!0),Fn();let di=u?.setTimeout(jn,Oa);return _.getConfig().then(Hr),{open:Tt,close:()=>gt(),identify(t,i,p){let g=Ut(t,i);if(ke)return;let E=g?sr(p):"";E!==it&&(it=E,k&&ce==="home"&&zn(!1)),!(g?.email===De?.email&&g?.hash===De?.hash)&&(De=g,rt=!1,On.identify(g),$n.reset(),pe.home.replaceChildren(),Nn(()=>_.identify(g)),gn(),B!==void 0&&jn())},destroy(){ft(),Je(),Ge?.(),Ge=null,ke=!0,Gn.destroy(),$n.destroy(),li?.disconnect(),e.removeEventListener("transitionend",mt,!0),e.removeEventListener("animationend",mt,!0),e.removeEventListener("toggle",mt,!0),St&&(u?.cancelAnimationFrame(St),St=0),X?.destroy(),Me.policy({allow:ct.allow,confirm:ct.confirm}),di!==void 0&&u?.clearTimeout(di),_.destroy(),_r(),d.removeEventListener("keydown",Fo),d.removeEventListener("pointerdown",Qo),u?.removeEventListener("resize",_o),e.removeEventListener("pointerdown",Yo,!0);for(let t of uo)u?.removeEventListener(t,ei,rr);for(let t of ar)u?.removeEventListener(t,ti,{capture:!0});jt!==void 0&&u?.clearTimeout(jt),R.removeEventListener("keydown",Po),R.removeEventListener("focusin",Xo),S.removeEventListener("keydown",jo),S.removeEventListener("input",mn),A.removeEventListener("submit",Vo),G.removeEventListener("click",Uo),L.removeEventListener("click",Wo),I.removeEventListener("click",Ko),re.removeEventListener("click",gt),m.removeEventListener("pointerenter",Je),Te.removeEventListener("click",Ro),ve.removeEventListener("click",Ho),h.removeEventListener("scroll",Jo),K.removeEventListener("click",Zo),pn(),a.remove()},client:_}}export{po as CHAT_HOST_ATTRIBUTE,Qi as DEFAULT_CHAT_TEXT,Tn as PRESENCE_HOST_ATTRIBUTE,Yt as chatTextFor,Qn as createChatClient,It as describeAction,co as describeError,qt as describeValue,Ka as installChatWidget,Ia as installPresence};
|
|
1028
1211
|
/*! Chat styles adapted from Beautiful UI (https://github.com/slev12397/beautiful-ui)
|
|
1029
1212
|
*
|
|
1030
1213
|
* MIT License
|