@softistx/pulsarix-widget 0.8.0 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/chunks/{panel.rzp4q8s3.js → panel.nm4pj2wm.js} +1 -1
- package/dist/index.js +21 -15
- package/docs/integration.md +3 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -185,7 +185,7 @@ works, and its limits: [docs/integration.md](docs/integration.md#9-inheriting-th
|
|
|
185
185
|
|
|
186
186
|
## The launcher
|
|
187
187
|
|
|
188
|
-
The launcher is an **edge tab**: a 44 x 44 px icon button (on phones, 600 px or less, with no peek) docked flush to the viewport edge, rounded on the
|
|
188
|
+
The launcher is an **edge tab**: a 44 x 44 px icon button (24 x 44 px on phones, 600 px or less, with no peek) docked flush to the viewport edge, rounded on the
|
|
189
189
|
content side only, with the pulsarix mark and the unread badge. At rest it peeks 6 px less; it slides fully
|
|
190
190
|
in on hover, focus and while it is dragged. Its label is a tooltip only (hover or keyboard focus, hidden
|
|
191
191
|
while dragging and on touch screens), and its accessible name carries the unread count ("Report a
|
|
@@ -4,4 +4,4 @@ import{d,l,H,i,o,T,r,a,J,qs,it,zt,je,_t,nn,zl,rr,ze,Ul,Vo,bt,Wl,Yl,Ql,Zl,Jl,ec,P
|
|
|
4
4
|
`);while(b!==-1){let R=Re(w.slice(0,b));if(w=w.slice(b+2),R){if(u(R),R.type==="expired")y=!0}b=w.indexOf(`
|
|
5
5
|
|
|
6
6
|
`)}if(y){await E.cancel();break}}}}catch{if(c.aborted)return}if(y||c.aborted)return;await m(h,c),h=Math.min(h*2,f)}}function be(e,t){return new Promise((n)=>{let u=setTimeout(n,e);t.addEventListener("abort",()=>{clearTimeout(u),n()},{once:!0})})}function Re(e){let t="message",n="";for(let c of e.split(`
|
|
7
|
-
`)){if(c.startsWith(":"))continue;if(c.startsWith("event:"))t=c.slice(6).trim();else if(c.startsWith("data:"))n+=c.slice(5).trim()}let u={};try{u=n?JSON.parse(n):{}}catch{return null}if(t==="unread"&&typeof u.count==="number")return{type:"unread",count:u.count};if(t==="request.updated"&&typeof u.id==="string")return{type:"updated",id:u.id,unread:typeof u.unread==="number"?u.unread:0};if(t==="expired")return{type:"expired"};return null}var ie=(e)=>e.filter((t)=>t.from==="team").length,Ee=(e)=>e.type==="expired"?"intake.errors.identity-expired":`http-${e.status}`;function ae({requestId:e,signal:t,heard:n,hear:u,read:c,end:p}){return(s)=>{if(t.aborted)return;if(s.type==="unread")return u.current.onUnread(s.count);if(s.type==="updated"){if(s.id===e)return c();let m=n.get(s.id)??0;if(n.set(s.id,s.unread),s.unread>m)u.current.onReply({requestId:s.id});return}let f=Ee(s);p(f,new He("identity",f))}}async function le({call:e,requestId:t,signal:n,current:u,seen:c,hear:p,onDetail:s}){let f=await cc({...e,id:t,signal:n});if(!u())return;s(f);let m=ie(f.thread);if(c.current!==null&&m>c.current)p.current.onReply({requestId:t});if(c.current=m,f.unread>0){let g=await hc({...e,id:t,signal:n});if(u())p.current.onUnread(g.count)}}function we(e){let t=i(!1),n=d((c)=>{if(t.current)return;t.current=!0,e.current.onError({code:c})},[e]),u=d(()=>{t.current=!1},[]);return{tell:n,rearm:u}}function de({locale:e,apiBase:t,projectKey:n,identity:u,requestId:c,onUnread:p,onReply:s,onError:f}){let[m,g]=o(null),[h,y]=o({status:"loading"}),v=i(new AbortController),E=i(null),w=i({onUnread:p,onReply:s,onError:f});w.current={onUnread:p,onReply:s,onError:f};let L=i(0),{tell:x,rearm:b}=we(w),R=i(new Map),C=d(async()=>{let k=++L.current,S=()=>!v.current.signal.aborted&&k===L.current;try{await le({call:{apiBase:t,publicKey:n,identity:u,locale:e},requestId:c,signal:v.current.signal,current:S,seen:E,hear:w,onDetail:(q)=>{g(q),y({status:"ready"})}})}catch(q){if(!S())return;let P=z(q);if(y({status:"error",error:P}),P.kind==="identity")x(P.code)}},[t,n,u,e,c,x]);return l(()=>{let k=new AbortController;return v.current=k,E.current=null,R.current.clear(),b(),C(),se({apiBase:t,publicKey:n,identity:u,signal:k.signal,onEvent:ae({requestId:c,signal:k.signal,heard:R.current,hear:w,read:()=>void C(),end:(S,q)=>{y({status:"error",error:q}),x(S)}})}),()=>k.abort()},[t,n,u,c,C,x,b]),{detail:m,load:h,read:C,aborted:v}}function ue({text:e,load:t,detail:n,problem:u,note:c,formatDate:p}){let s=e.thread,f=n?.publicState,m=f==="resolved";return a(T,{children:[t.status==="loading"?a("div",{role:"status","aria-busy":"true",children:[r("span",{className:"sr-only",children:s.loading}),r(Vo,{lines:4,labelled:!1})]}):null,t.status==="error"?r(ze,{variant:"error",title:e.errors.title,description:I(e,t.error)}):null,f==="declined"?r(ze,{variant:"warning",title:s.declinedTitle,description:n?.declineReason||s.declinedNoReason}):null,m?r(ze,{variant:"success",description:n?.resolvedAt?s.resolvedNote(p(n.resolvedAt)):e.states.resolved}):null,m&&n&&!n.canReopen?r(ze,{variant:"info",description:s.reopenExpired}):null,u?r(ze,{variant:"error",title:s.errors.title,description:u}):null,c?r(ze,{variant:"warning",description:c}):null]})}var W=null;function ce(){if(W!==null)return W;return W=document.querySelector("style[nonce], script[nonce]")?.nonce||void 0,W}function Te(e){l(()=>{let t=e.current,n=t?.querySelector('[role="log"]'),u=t?.querySelector('[data-slot="scroll-area-viewport"]')??n;if(!t||!n||!u)return;let c=!0,p=()=>{if(c)u.scrollTop=u.scrollHeight},s=()=>{c=!1};p(),u.addEventListener("wheel",s,{passive:!0}),u.addEventListener("touchstart",s,{passive:!0}),u.addEventListener("keydown",s);let f=typeof ResizeObserver>"u"?null:new ResizeObserver(p);f?.observe(n);for(let g of n.children)f?.observe(g);let m=setTimeout(s,4000);return()=>{clearTimeout(m),f?.disconnect(),u.removeEventListener("wheel",s),u.removeEventListener("touchstart",s),u.removeEventListener("keydown",s)}},[e])}function me({text:e,detail:t,composer:n,formatDate:u,formatTime:c}){let p=e.thread,s=i(null);Te(s);let f=[{id:"original",from:"reporter",body:t.description,at:t.createdAt,files:t.files},...t.thread];return r(Wl,{nonce:ce(),children:r("div",{ref:s,className:"contents",children:a(Jl,{surface:"card",className:t.canReply?"h-[min(460px,58dvh)] max-sm:h-[42dvh]":"h-auto max-h-[min(460px,58dvh)] max-sm:max-h-[42dvh]",messageListProps:{itemCount:f.length+1},composerProps:t.canReply?{value:n.value,onValueChange:n.onValueChange,attachments:n.files,onAttachmentsChange:n.onFilesChange,onSend:n.onSend,isLoading:n.sending,placeholder:p.placeholder,sendLabel:p.send,attachmentLabel:p.attach,accept:Pr.join(","),maxFiles:3,maxLength:4000}:void 0,footer:t.canReply?void 0:r("p",{className:"m-0 px-4 py-3 text-muted-foreground text-sm",children:p.readOnly}),children:[r(Zl,{label:u(t.createdAt)}),f.map((m)=>r(Ql,{variant:m.from==="reporter"?"user":"assistant",author:m.from==="reporter"?p.you:p.team,avatarFallback:p.team.charAt(0),timestamp:c(m.at),text:m.from==="reporter"?m.body:void 0,copyable:!1,footer:m.files.length?r("ul",{"aria-label":p.attachments,className:"m-0 flex list-none flex-wrap gap-1.5 p-0",children:m.files.map((g)=>r("li",{children:r(rr,{variant:"soft",children:g.name})},g.id))}):void 0,children:m.from==="reporter"?void 0:r(ec,{content:m.body,math:!1,mermaid:!1,flow:!1})},m.id))]})})})}function pe({text:e,detail:t,title:n,formatDate:u}){let c=t?.publicState;return a(it,{children:[r(je,{title:t?.title??n,className:"max-sm:line-clamp-2 max-sm:text-lg",children:t?.title??n}),a(_t,{className:"flex flex-wrap items-center gap-2",children:[c?r(rr,{variant:"soft",tone:Y[c],children:e.states[c]}):null,t?u(t.createdAt):null]})]})}function fe({text:e,detail:t,acting:n,onBack:u,onResolve:c,onReopen:p}){let s=e.thread,f=t?.publicState,m=f==="declined",g=f==="resolved";return a(zt,{children:[r(J,{type:"button",variant:"tonal",onClick:u,children:s.back}),t&&!m&&!g?r(J,{type:"button",variant:"tonal",loading:n,onClick:c,children:s.resolve}):null,g&&t?.canReopen?r(J,{type:"button",variant:"tonal",loading:n,onClick:p,children:s.reopen}):null]})}function j({locale:e,apiBase:t,projectKey:n,identity:u,requestId:c,title:p,onUnread:s,onReply:f,onError:m,onBack:g}){let h=D[e],y=h.thread,v={locale:e,apiBase:t,projectKey:n,identity:u,requestId:c},{detail:E,load:w,read:L,aborted:x}=de({...v,onUnread:s,onReply:f,onError:m}),b=oe({...v,text:h,read:L,aborted:x}),R=new Intl.DateTimeFormat(e,{dateStyle:"medium"}),C=new Intl.DateTimeFormat(e,{dateStyle:"medium",timeStyle:"short"}),k=(S)=>R.format(new Date(S));return a(T,{children:[r(pe,{text:h,detail:E,title:p,formatDate:k}),r(bt,{role:"region","aria-label":y.label,children:a("div",{className:"grid min-w-0 grid-cols-[minmax(0,1fr)] content-start gap-3",children:[r(ue,{text:h,load:w,detail:E,problem:b.problem,note:b.note,formatDate:k}),E?r(me,{text:h,detail:E,formatDate:k,formatTime:(S)=>C.format(new Date(S)),composer:{value:b.value,onValueChange:b.setValue,files:b.files,onFilesChange:b.setFiles,onSend:(S,q)=>void b.send(S,q),sending:b.sending}}):null]})}),r(fe,{text:h,detail:E,acting:b.acting,onBack:g,onResolve:()=>void b.change(dc),onReopen:()=>void b.change(fc)})]})}function Se(){return a("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",width:"20",height:"20",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[r("circle",{cx:"12",cy:"12",r:"3"}),r("path",{d:"M19.4 15a1.7 1.7 0 0 0 .3 1.9l.1.1a2 2 0 1 1-2.8 2.8l-.1-.1a1.7 1.7 0 0 0-1.9-.3 1.7 1.7 0 0 0-1 1.5V21a2 2 0 1 1-4 0v-.1a1.7 1.7 0 0 0-1.1-1.5 1.7 1.7 0 0 0-1.9.3l-.1.1a2 2 0 1 1-2.8-2.8l.1-.1a1.7 1.7 0 0 0 .3-1.9 1.7 1.7 0 0 0-1.5-1H3a2 2 0 1 1 0-4h.1a1.7 1.7 0 0 0 1.5-1.1 1.7 1.7 0 0 0-.3-1.9l-.1-.1a2 2 0 1 1 2.8-2.8l.1.1a1.7 1.7 0 0 0 1.9.3H9a1.7 1.7 0 0 0 1-1.5V3a2 2 0 1 1 4 0v.1a1.7 1.7 0 0 0 1 1.5 1.7 1.7 0 0 0 1.9-.3l.1-.1a2 2 0 1 1 2.8 2.8l-.1.1a1.7 1.7 0 0 0-.3 1.9V9a1.7 1.7 0 0 0 1.5 1H21a2 2 0 1 1 0 4h-.1a1.7 1.7 0 0 0-1.5 1Z"})]})}function Le({messages:e,locale:t,apiBase:n,projectKey:u,identity:c,onUnread:p,onReply:s,onError:f,onErase:m,onClose:g,onNewRequest:h}){let y=D[t],v=K({apiBase:n,projectKey:u,identity:c,locale:t,onUnread:p,onError:f}),[E,w]=o(null),[L,x]=o(!1);if(E&&n&&u)return r(j,{locale:t,apiBase:n,projectKey:u,identity:c,requestId:E.id,title:E.title,onUnread:p,onReply:(R)=>s?.(R),onError:(R)=>f?.(R),onBack:()=>{w(null),v.reload()}});if(L)return r(ee,{locale:t,apiBase:n,projectKey:u,identity:c,emailsOn:v.emailsOn,onBack:()=>x(!1),onErased:(R)=>{v.empty(R),m?.({requests:R}),x(!1)}});let b=Boolean(n&&u);return a(T,{children:[a(it,{children:[a("div",{className:"flex items-start justify-between gap-2",children:[r(je,{children:e.myRequests}),b?r(J,{type:"button",variant:"ghost",size:"icon-sm","aria-label":y.prefs.open,onClick:()=>x(!0),children:r(Se,{})}):null]}),r(_t,{children:y.description})]}),r(bt,{role:"region","aria-label":e.myRequests,children:r(X,{messages:e,locale:t,list:v,onOpen:w,onNewRequest:h})}),a(zt,{children:[r(J,{type:"button",variant:"tonal",onClick:g,children:e.close}),(v.counts?.all??0)>0?r(J,{type:"button",variant:"tonal",onClick:h,children:y.none.action}):null]})]})}export{Le as default};
|
|
7
|
+
`)){if(c.startsWith(":"))continue;if(c.startsWith("event:"))t=c.slice(6).trim();else if(c.startsWith("data:"))n+=c.slice(5).trim()}let u={};try{u=n?JSON.parse(n):{}}catch{return null}if(t==="unread"&&typeof u.count==="number")return{type:"unread",count:u.count};if(t==="request.updated"&&typeof u.id==="string")return{type:"updated",id:u.id,unread:typeof u.unread==="number"?u.unread:0};if(t==="expired")return{type:"expired"};return null}var ie=(e)=>e.filter((t)=>t.from==="team").length,Ee=(e)=>e.type==="expired"?"intake.errors.identity-expired":`http-${e.status}`;function ae({requestId:e,signal:t,heard:n,hear:u,read:c,end:p}){return(s)=>{if(t.aborted)return;if(s.type==="unread")return u.current.onUnread(s.count);if(s.type==="updated"){if(s.id===e)return c();let m=n.get(s.id)??0;if(n.set(s.id,s.unread),s.unread>m)u.current.onReply({requestId:s.id});return}let f=Ee(s);p(f,new He("identity",f))}}async function le({call:e,requestId:t,signal:n,current:u,seen:c,hear:p,onDetail:s}){let f=await cc({...e,id:t,signal:n});if(!u())return;s(f);let m=ie(f.thread);if(c.current!==null&&m>c.current)p.current.onReply({requestId:t});if(c.current=m,f.unread>0){let g=await hc({...e,id:t,signal:n});if(u())p.current.onUnread(g.count)}}function we(e){let t=i(!1),n=d((c)=>{if(t.current)return;t.current=!0,e.current.onError({code:c})},[e]),u=d(()=>{t.current=!1},[]);return{tell:n,rearm:u}}function de({locale:e,apiBase:t,projectKey:n,identity:u,requestId:c,onUnread:p,onReply:s,onError:f}){let[m,g]=o(null),[h,y]=o({status:"loading"}),v=i(new AbortController),E=i(null),w=i({onUnread:p,onReply:s,onError:f});w.current={onUnread:p,onReply:s,onError:f};let L=i(0),{tell:x,rearm:b}=we(w),R=i(new Map),C=d(async()=>{let k=++L.current,S=()=>!v.current.signal.aborted&&k===L.current;try{await le({call:{apiBase:t,publicKey:n,identity:u,locale:e},requestId:c,signal:v.current.signal,current:S,seen:E,hear:w,onDetail:(q)=>{g(q),y({status:"ready"})}})}catch(q){if(!S())return;let P=z(q);if(y({status:"error",error:P}),P.kind==="identity")x(P.code)}},[t,n,u,e,c,x]);return l(()=>{let k=new AbortController;return v.current=k,E.current=null,R.current.clear(),b(),C(),se({apiBase:t,publicKey:n,identity:u,signal:k.signal,onEvent:ae({requestId:c,signal:k.signal,heard:R.current,hear:w,read:()=>void C(),end:(S,q)=>{y({status:"error",error:q}),x(S)}})}),()=>k.abort()},[t,n,u,c,C,x,b]),{detail:m,load:h,read:C,aborted:v}}function ue({text:e,load:t,detail:n,problem:u,note:c,formatDate:p}){let s=e.thread,f=n?.publicState,m=f==="resolved";return a(T,{children:[t.status==="loading"?a("div",{role:"status","aria-busy":"true",children:[r("span",{className:"sr-only",children:s.loading}),r(Vo,{lines:4,labelled:!1})]}):null,t.status==="error"?r(ze,{variant:"error",title:e.errors.title,description:I(e,t.error)}):null,f==="declined"?r(ze,{variant:"warning",title:s.declinedTitle,description:n?.declineReason||s.declinedNoReason}):null,m?r(ze,{variant:"success",description:n?.resolvedAt?s.resolvedNote(p(n.resolvedAt)):e.states.resolved}):null,m&&n&&!n.canReopen?r(ze,{variant:"info",description:s.reopenExpired}):null,u?r(ze,{variant:"error",title:s.errors.title,description:u}):null,c?r(ze,{variant:"warning",description:c}):null]})}var W=null;function ce(){if(W!==null)return W;return W=document.querySelector("style[nonce], script[nonce]")?.nonce||void 0,W}function Te(e){l(()=>{let t=e.current,n=t?.querySelector('[role="log"]'),u=t?.querySelector('[data-slot="scroll-area-viewport"]')??n;if(!t||!n||!u)return;let c=!0,p=()=>{if(c)u.scrollTop=u.scrollHeight},s=()=>{c=!1};p(),u.addEventListener("wheel",s,{passive:!0}),u.addEventListener("touchstart",s,{passive:!0}),u.addEventListener("keydown",s);let f=typeof ResizeObserver>"u"?null:new ResizeObserver(p);f?.observe(n);for(let g of n.children)f?.observe(g);let m=setTimeout(s,4000);return()=>{clearTimeout(m),f?.disconnect(),u.removeEventListener("wheel",s),u.removeEventListener("touchstart",s),u.removeEventListener("keydown",s)}},[e])}function me({text:e,detail:t,composer:n,formatDate:u,formatTime:c}){let p=e.thread,s=i(null);Te(s);let f=[{id:"original",from:"reporter",body:t.description,at:t.createdAt,files:t.files},...t.thread];return r(Wl,{nonce:ce(),children:r("div",{ref:s,className:"contents",children:a(Jl,{surface:"card",className:t.canReply?"h-[min(460px,58dvh)] max-sm:h-[42dvh]":"h-auto max-h-[min(460px,58dvh)] max-sm:max-h-[42dvh]",messageListProps:{itemCount:f.length+1},composerProps:t.canReply?{value:n.value,onValueChange:n.onValueChange,attachments:n.files,onAttachmentsChange:n.onFilesChange,onSend:n.onSend,isLoading:n.sending,placeholder:p.placeholder,sendLabel:p.send,attachmentLabel:p.attach,accept:Pr.join(","),maxFiles:3,maxLength:4000}:void 0,footer:t.canReply?void 0:r("p",{className:"m-0 px-4 py-3 text-muted-foreground text-sm",children:p.readOnly}),children:[r(Zl,{label:u(t.createdAt)}),f.map((m)=>r(Ql,{variant:m.from==="reporter"?"user":"assistant",author:m.from==="reporter"?p.you:p.team,avatarFallback:p.team.charAt(0),timestamp:c(m.at),text:m.from==="reporter"?m.body:void 0,copyable:!1,footer:m.files.length?r("ul",{"aria-label":p.attachments,className:"m-0 flex list-none flex-wrap gap-1.5 p-0",children:m.files.map((g)=>r("li",{children:r(rr,{variant:"soft",children:g.name})},g.id))}):void 0,children:m.from==="reporter"?void 0:r(ec,{content:m.body,math:!1,mermaid:!1,flow:!1})},m.id))]})})})}function pe({text:e,detail:t,title:n,formatDate:u}){let c=t?.publicState;return a(it,{children:[r(je,{title:t?.title??n,className:"max-sm:line-clamp-2 max-sm:text-lg",children:t?.title??n}),a(_t,{className:"flex flex-wrap items-center gap-2",children:[c?r(rr,{variant:"soft",tone:Y[c],children:e.states[c]}):null,t?u(t.createdAt):null]})]})}function fe({text:e,detail:t,acting:n,onBack:u,onResolve:c,onReopen:p}){let s=e.thread,f=t?.publicState,m=f==="declined",g=f==="resolved";return a(zt,{children:[r(J,{type:"button",variant:"tonal",onClick:u,children:s.back}),t&&!m&&!g?r(J,{type:"button",variant:"tonal",loading:n,onClick:c,children:s.resolve}):null,g&&t?.canReopen?r(J,{type:"button",variant:"tonal",loading:n,onClick:p,children:s.reopen}):null]})}function j({locale:e,apiBase:t,projectKey:n,identity:u,requestId:c,title:p,onUnread:s,onReply:f,onError:m,onBack:g}){let h=D[e],y=h.thread,v={locale:e,apiBase:t,projectKey:n,identity:u,requestId:c},{detail:E,load:w,read:L,aborted:x}=de({...v,onUnread:s,onReply:f,onError:m}),b=oe({...v,text:h,read:L,aborted:x}),R=new Intl.DateTimeFormat(e,{dateStyle:"medium"}),C=new Intl.DateTimeFormat(e,{dateStyle:"medium",timeStyle:"short"}),k=(S)=>R.format(new Date(S));return a(T,{children:[r(pe,{text:h,detail:E,title:p,formatDate:k}),r(bt,{role:"region","aria-label":y.label,children:a("div",{className:"grid min-w-0 grid-cols-[minmax(0,1fr)] content-start gap-3",children:[r(ue,{text:h,load:w,detail:E,problem:b.problem,note:b.note,formatDate:k}),E?r(me,{text:h,detail:E,formatDate:k,formatTime:(S)=>C.format(new Date(S)),composer:{value:b.value,onValueChange:b.setValue,files:b.files,onFilesChange:b.setFiles,onSend:(S,q)=>void b.send(S,q),sending:b.sending}}):null]})}),r(fe,{text:h,detail:E,acting:b.acting,onBack:g,onResolve:()=>void b.change(dc),onReopen:()=>void b.change(fc)})]})}function Se(){return a("svg",{"aria-hidden":"true",viewBox:"0 0 24 24",width:"20",height:"20",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[r("circle",{cx:"12",cy:"12",r:"3"}),r("path",{d:"M19.4 15a1.7 1.7 0 0 0 .3 1.9l.1.1a2 2 0 1 1-2.8 2.8l-.1-.1a1.7 1.7 0 0 0-1.9-.3 1.7 1.7 0 0 0-1 1.5V21a2 2 0 1 1-4 0v-.1a1.7 1.7 0 0 0-1.1-1.5 1.7 1.7 0 0 0-1.9.3l-.1.1a2 2 0 1 1-2.8-2.8l.1-.1a1.7 1.7 0 0 0 .3-1.9 1.7 1.7 0 0 0-1.5-1H3a2 2 0 1 1 0-4h.1a1.7 1.7 0 0 0 1.5-1.1 1.7 1.7 0 0 0-.3-1.9l-.1-.1a2 2 0 1 1 2.8-2.8l.1.1a1.7 1.7 0 0 0 1.9.3H9a1.7 1.7 0 0 0 1-1.5V3a2 2 0 1 1 4 0v.1a1.7 1.7 0 0 0 1 1.5 1.7 1.7 0 0 0 1.9-.3l.1-.1a2 2 0 1 1 2.8 2.8l-.1.1a1.7 1.7 0 0 0-.3 1.9V9a1.7 1.7 0 0 0 1.5 1H21a2 2 0 1 1 0 4h-.1a1.7 1.7 0 0 0-1.5 1Z"})]})}function Le({messages:e,locale:t,apiBase:n,projectKey:u,identity:c,onUnread:p,onReply:s,onError:f,onErase:m,onClose:g,onNewRequest:h}){let y=D[t],v=K({apiBase:n,projectKey:u,identity:c,locale:t,onUnread:p,onError:f}),[E,w]=o(null),[L,x]=o(!1);if(E&&n&&u)return r(j,{locale:t,apiBase:n,projectKey:u,identity:c,requestId:E.id,title:E.title,onUnread:p,onReply:(R)=>s?.(R),onError:(R)=>f?.(R),onBack:()=>{w(null),v.reload()}});if(L)return r(ee,{locale:t,apiBase:n,projectKey:u,identity:c,emailsOn:v.emailsOn,onBack:()=>x(!1),onErased:(R)=>{v.empty(R),m?.({requests:R}),x(!1)}});let b=Boolean(n&&u);return a(T,{children:[a(it,{children:[a("div",{className:"flex items-start justify-between gap-2",children:[r(je,{children:e.myRequests}),b?r(J,{type:"button",variant:"ghost",size:"icon-sm",className:"size-11","aria-label":y.prefs.open,onClick:()=>x(!0),children:r(Se,{})}):null]}),r(_t,{children:y.description})]}),r(bt,{role:"region","aria-label":e.myRequests,children:r(X,{messages:e,locale:t,list:v,onOpen:w,onNewRequest:h})}),a(zt,{children:[r(J,{type:"button",variant:"tonal",onClick:g,children:e.close}),(v.counts?.all??0)>0?r(J,{type:"button",variant:"tonal",onClick:h,children:y.none.action}):null]})]})}export{Le as default};
|