@mrrocket/sdk 0.13.0 → 0.15.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/CHANGELOG.md +8 -1
  2. package/README.md +43 -3
  3. package/dist/api-client.d.ts +62 -1
  4. package/dist/api-client.js +28 -1
  5. package/dist/api-client.js.map +1 -1
  6. package/dist/browser/mrrocket-flows.js +11 -2
  7. package/dist/browser/mrrocket-messenger.js +304 -70
  8. package/dist/browser/mrrocket.js +1 -1
  9. package/dist/browser.d.ts +1 -1
  10. package/dist/browser.js +2 -1
  11. package/dist/browser.js.map +1 -1
  12. package/dist/client.d.ts +12 -0
  13. package/dist/client.js +22 -0
  14. package/dist/client.js.map +1 -1
  15. package/dist/context.d.ts +3 -0
  16. package/dist/context.js.map +1 -1
  17. package/dist/core.d.ts +4 -1
  18. package/dist/core.js +1 -1
  19. package/dist/core.js.map +1 -1
  20. package/dist/flows-ui.d.ts +6 -4
  21. package/dist/flows-ui.js +147 -5
  22. package/dist/flows-ui.js.map +1 -1
  23. package/dist/flows.d.ts +51 -1
  24. package/dist/flows.js +62 -21
  25. package/dist/flows.js.map +1 -1
  26. package/dist/index.d.ts +2 -1
  27. package/dist/index.js +4 -0
  28. package/dist/index.js.map +1 -1
  29. package/dist/messenger-ui.d.ts +37 -2
  30. package/dist/messenger-ui.js +597 -109
  31. package/dist/messenger-ui.js.map +1 -1
  32. package/dist/messenger.d.ts +11 -3
  33. package/dist/messenger.js +6 -3
  34. package/dist/messenger.js.map +1 -1
  35. package/dist/paywall.d.ts +123 -0
  36. package/dist/paywall.js +131 -0
  37. package/dist/paywall.js.map +1 -0
  38. package/dist/react-native/index.d.cts +235 -8
  39. package/dist/react-native/index.d.ts +235 -8
  40. package/dist/react-native/index.js +650 -184
  41. package/dist/react-native/index.js.map +1 -1
  42. package/dist/styles-css.d.ts +1 -1
  43. package/dist/styles-css.js +302 -68
  44. package/dist/styles-css.js.map +1 -1
  45. package/package.json +5 -1
@@ -1,9 +1,13 @@
1
- (function(){'use strict';var pt=Object.defineProperty;var lt=(r,a,n)=>a in r?pt(r,a,{enumerable:true,configurable:true,writable:true,value:n}):r[a]=n;var Qe=(r,a,n)=>lt(r,a+"",n);var Je=r=>r==="minutes"?"We usually reply in a few minutes":r==="day"?"We usually reply within a day":"We usually reply in a few hours",Xe=r=>{let a=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(r);if(!a)return "#ffffff";let[n,p,i]=[a[1],a[2],a[3]].map(s=>{let x=parseInt(s,16)/255;return x<=.03928?x/12.92:((x+.055)/1.055)**2.4});return .2126*n+.7152*p+.0722*i>.45?"#111214":"#ffffff"},oe=class extends Error{constructor(n,p){super(n);Qe(this,"status");this.status=p;}},L=r=>Object.entries(r).filter(a=>!!a[1]).map(([a,n])=>`${encodeURIComponent(a)}=${encodeURIComponent(n)}`).join("&"),S=async(r,a,n)=>{var i;let p;try{p=await fetch(r,{...a,signal:n,headers:a!=null&&a.body?{"content-type":"application/json"}:void 0});}catch(s){throw s.name==="AbortError"?s:new oe("Could not reach the server. Check your connection and try again.",0)}if(!p.ok){let s="";try{s=(i=(await p.json()).error)!=null?i:"";}catch(x){}throw new oe(s||(p.status===429?"Too many requests. Try again in a minute.":"Something went wrong. Please try again."),p.status)}return await p.json()},ve=r=>{let a=`${r.host}/api/sdk`,n={key:r.apiKey,distinctId:r.distinctId,user:r.user},p=(i,s,x)=>S(`${a}${i}`,{method:"POST",body:JSON.stringify({...n,...s})},x);return {list:(i,s)=>S(`${a}/feedback?${L({key:r.apiKey,distinctId:r.distinctId,board:i.board,sort:i.sort,q:i.q})}`,void 0,s),post:(i,s)=>S(`${a}/feedback/${encodeURIComponent(i)}?${L({key:r.apiKey,distinctId:r.distinctId})}`,void 0,s),roadmap:i=>S(`${a}/feedback/roadmap?${L({key:r.apiKey,distinctId:r.distinctId})}`,void 0,i),changelog:i=>S(`${a}/feedback/changelog?${L({key:r.apiKey})}`,void 0,i),submit:i=>p("/feedback",i),vote:i=>p(`/feedback/${encodeURIComponent(i)}/vote`,{}),comments:(i,s)=>S(`${a}/feedback/${encodeURIComponent(i)}/comments?${L({key:r.apiKey})}`,void 0,s),comment:(i,s)=>p(`/feedback/${encodeURIComponent(i)}/comments`,{body:s}),survey:(i,s)=>S(`${a}/surveys?${L({key:r.apiKey,distinctId:r.distinctId,url:i})}`,void 0,s),seen:i=>p(`/surveys/${encodeURIComponent(i)}/seen`,{user:void 0}),respond:(i,s)=>p(`/surveys/${encodeURIComponent(i)}/respond`,s),chat:i=>S(`${a}/messages?${L({key:r.apiKey,distinctId:r.distinctId})}`,void 0,i),sendChat:i=>p("/messages",i),articles:(i,s)=>S(`${a}/articles?${L({key:r.apiKey,q:i})}`,void 0,s),article:(i,s)=>S(`${a}/articles/${encodeURIComponent(i)}?${L({key:r.apiKey,distinctId:r.distinctId})}`,void 0,s),messengerLook:i=>S(`${a}/messenger?${L({key:r.apiKey})}`,void 0,i),rateArticle:(i,s)=>p(`/articles/${encodeURIComponent(i)}/rate`,{helpful:s})}};var Ze="ckw-styles",dt=`
2
- .ckw-root{--ckw-accent:#3f76ff;--ckw-accent-ink:#fff;--ckw-bg:#fff;--ckw-bg2:#f7f7f8;--ckw-bg3:#eeeff1;--ckw-fg:#1c1d20;--ckw-fg2:#5d6068;--ckw-fg3:#8b8e96;--ckw-line:#e4e5e8;--ckw-danger:#d92d20;--ckw-shadow:0 8px 30px rgba(16,18,24,.16);--ckw-card:#fff;--ckw-col:#f5f6f7;--ckw-lift:0 1px 2px rgba(16,18,24,.06),0 0 0 1px rgba(16,18,24,.07);--ckw-raise:0 0 0 1px rgba(16,18,24,.05),0 1px 2px rgba(16,18,24,.05),0 6px 18px rgba(16,18,24,.06);--ckw-float:0 0 0 1px rgba(16,18,24,.06),0 18px 50px rgba(16,18,24,.2);
1
+ (function(){'use strict';var hr=Object.defineProperty;var xr=(a,n,c)=>n in a?hr(a,n,{enumerable:true,configurable:true,writable:true,value:c}):a[n]=c;var Wt=(a,n,c)=>xr(a,n+"",c);var ct=["image/png","image/jpeg","image/webp","image/gif","application/pdf"],Gt=10*1024*1024,lt=4;var Qt="https://mrrocket.dev/?utm_source=messenger&utm_medium=powered-by",Xt=a=>a==="minutes"?"We usually reply in a few minutes":a==="day"?"We usually reply within a day":"We usually reply in a few hours",Jt=a=>{let n=/^#([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(a);if(!n)return "#ffffff";let[c,g,s]=[n[1],n[2],n[3]].map(d=>{let b=parseInt(d,16)/255;return b<=.03928?b/12.92:((b+.055)/1.055)**2.4});return .2126*c+.7152*g+.0722*s>.45?"#111214":"#ffffff"},je=class extends Error{constructor(c,g){super(c);Wt(this,"status");this.status=g;}},q=a=>Object.entries(a).filter(n=>!!n[1]).map(([n,c])=>`${encodeURIComponent(n)}=${encodeURIComponent(c)}`).join("&"),F=async(a,n,c)=>{var s;let g;try{g=await fetch(a,{...n,signal:c,headers:typeof(n==null?void 0:n.body)=="string"?{"content-type":"application/json"}:void 0});}catch(d){throw d.name==="AbortError"?d:new je("Could not reach the server. Check your connection and try again.",0)}if(!g.ok){let d="";try{d=(s=(await g.json()).error)!=null?s:"";}catch(b){}throw new je(d||(g.status===429?"Too many requests. Try again in a minute.":"Something went wrong. Please try again."),g.status)}return await g.json()},dt=a=>{let n=`${a.host}/api/sdk`,c={key:a.apiKey,distinctId:a.distinctId,user:a.user},g=(s,d,b)=>F(`${n}${s}`,{method:"POST",body:JSON.stringify({...c,...d})},b);return {list:(s,d)=>F(`${n}/feedback?${q({key:a.apiKey,distinctId:a.distinctId,board:s.board,sort:s.sort,q:s.q})}`,void 0,d),post:(s,d)=>F(`${n}/feedback/${encodeURIComponent(s)}?${q({key:a.apiKey,distinctId:a.distinctId})}`,void 0,d),roadmap:s=>F(`${n}/feedback/roadmap?${q({key:a.apiKey,distinctId:a.distinctId})}`,void 0,s),changelog:s=>F(`${n}/feedback/changelog?${q({key:a.apiKey})}`,void 0,s),submit:s=>g("/feedback",s),vote:s=>g(`/feedback/${encodeURIComponent(s)}/vote`,{}),comments:(s,d)=>F(`${n}/feedback/${encodeURIComponent(s)}/comments?${q({key:a.apiKey})}`,void 0,d),comment:(s,d)=>g(`/feedback/${encodeURIComponent(s)}/comments`,{body:d}),survey:(s,d)=>F(`${n}/surveys?${q({key:a.apiKey,distinctId:a.distinctId,url:s})}`,void 0,d),seen:s=>g(`/surveys/${encodeURIComponent(s)}/seen`,{user:void 0}),respond:(s,d)=>g(`/surveys/${encodeURIComponent(s)}/respond`,d),chat:s=>F(`${n}/messages?${q({key:a.apiKey,distinctId:a.distinctId})}`,void 0,s),sendChat:s=>g("/messages",s),uploadChatFile:(s,d)=>{let b=new FormData;return b.append("key",a.apiKey),b.append("distinctId",a.distinctId),"uri"in s?b.append("file",s):b.append("file",s,s.name||"file"),F(`${n}/messages/attachments`,{method:"POST",body:b},d)},attachmentUrl:s=>`${n}/messages/attachments/${encodeURIComponent(s)}?${q({key:a.apiKey,distinctId:a.distinctId})}`,articles:(s,d)=>F(`${n}/articles?${q({key:a.apiKey,q:s})}`,void 0,d),article:(s,d)=>F(`${n}/articles/${encodeURIComponent(s)}?${q({key:a.apiKey,distinctId:a.distinctId})}`,void 0,d),messengerLook:s=>F(`${n}/messenger?${q({key:a.apiKey})}`,void 0,s),rateArticle:(s,d)=>g(`/articles/${encodeURIComponent(s)}/rate`,{helpful:d})}};var Zt="ckw-styles",vr=`
2
+ .ckw-root{--ckw-accent:#3f76ff;--ckw-accent-ink:#fff;--ckw-bg:#fff;--ckw-bg2:#f7f7f8;--ckw-bg3:#eeeff1;--ckw-fg:#1c1d20;--ckw-fg2:#5d6068;--ckw-fg3:#8b8e96;--ckw-line:#e4e5e8;--ckw-danger:#d92d20;--ckw-shadow:0 8px 30px rgba(16,18,24,.16);--ckw-card:#fff;--ckw-col:#f5f6f7;--ckw-lift:0 1px 2px rgba(16,18,24,.06),0 0 0 1px rgba(16,18,24,.07);--ckw-raise:0 0 0 1px rgba(16,18,24,.05),0 1px 2px rgba(16,18,24,.05),0 6px 18px rgba(16,18,24,.06);--ckw-float:0 0 0 1px rgba(16,18,24,.06),0 18px 50px rgba(16,18,24,.2);--ckw-soft:0 2px 8px rgba(16,18,24,.05),0 18px 48px rgba(16,18,24,.15);
3
3
  font-size:14px;line-height:1.45;font-family:inherit;color:var(--ckw-fg);box-sizing:border-box;-webkit-font-smoothing:antialiased}
4
- .ckw-root[data-theme=dark]{--ckw-bg:#111214;--ckw-bg2:#1a1b1f;--ckw-bg3:#26272c;--ckw-fg:#f1f2f4;--ckw-fg2:#a9acb3;--ckw-fg3:#7a7d86;--ckw-line:#2a2b31;--ckw-shadow:0 8px 30px rgba(0,0,0,.5);--ckw-card:#1b1c20;--ckw-col:#16171a;--ckw-lift:0 0 0 1px rgba(255,255,255,.07);--ckw-raise:0 0 0 1px rgba(255,255,255,.07);--ckw-float:0 0 0 1px rgba(255,255,255,.09),0 18px 50px rgba(0,0,0,.55)}
5
- @media (prefers-color-scheme:dark){.ckw-root[data-theme=auto]{--ckw-bg:#111214;--ckw-bg2:#1a1b1f;--ckw-bg3:#26272c;--ckw-fg:#f1f2f4;--ckw-fg2:#a9acb3;--ckw-fg3:#7a7d86;--ckw-line:#2a2b31;--ckw-shadow:0 8px 30px rgba(0,0,0,.5);--ckw-card:#1b1c20;--ckw-col:#16171a;--ckw-lift:0 0 0 1px rgba(255,255,255,.07);--ckw-raise:0 0 0 1px rgba(255,255,255,.07);--ckw-float:0 0 0 1px rgba(255,255,255,.09),0 18px 50px rgba(0,0,0,.55)}}
4
+ .ckw-root[data-theme=dark]{--ckw-bg:#111214;--ckw-bg2:#1a1b1f;--ckw-bg3:#26272c;--ckw-fg:#f1f2f4;--ckw-fg2:#a9acb3;--ckw-fg3:#7a7d86;--ckw-line:#2a2b31;--ckw-shadow:0 8px 30px rgba(0,0,0,.5);--ckw-card:#1b1c20;--ckw-col:#16171a;--ckw-lift:0 0 0 1px rgba(255,255,255,.07);--ckw-raise:0 0 0 1px rgba(255,255,255,.07);--ckw-float:0 0 0 1px rgba(255,255,255,.09),0 18px 50px rgba(0,0,0,.55);--ckw-soft:0 0 0 1px rgba(255,255,255,.07),0 18px 50px rgba(0,0,0,.55)}
5
+ @media (prefers-color-scheme:dark){.ckw-root[data-theme=auto]{--ckw-bg:#111214;--ckw-bg2:#1a1b1f;--ckw-bg3:#26272c;--ckw-fg:#f1f2f4;--ckw-fg2:#a9acb3;--ckw-fg3:#7a7d86;--ckw-line:#2a2b31;--ckw-shadow:0 8px 30px rgba(0,0,0,.5);--ckw-card:#1b1c20;--ckw-col:#16171a;--ckw-lift:0 0 0 1px rgba(255,255,255,.07);--ckw-raise:0 0 0 1px rgba(255,255,255,.07);--ckw-float:0 0 0 1px rgba(255,255,255,.09),0 18px 50px rgba(0,0,0,.55);--ckw-soft:0 0 0 1px rgba(255,255,255,.07),0 18px 50px rgba(0,0,0,.55)}}
6
6
  .ckw-root *,.ckw-root *::before,.ckw-root *::after{box-sizing:border-box}
7
+ .ckw-root{--ckw-r-panel:22px;--ckw-r-bubble:18px;--ckw-r-tail:6px;--ckw-r-card:16px;--ckw-r-field:20px;--ckw-r-pill:999px;--ckw-r-fab:999px}
8
+ .ckw-root[data-corners=soft]{--ckw-r-panel:14px;--ckw-r-bubble:12px;--ckw-r-tail:4px;--ckw-r-card:10px;--ckw-r-field:10px;--ckw-r-pill:10px;--ckw-r-fab:18px}
9
+ .ckw-root[data-corners=square]{--ckw-r-panel:6px;--ckw-r-bubble:6px;--ckw-r-tail:2px;--ckw-r-card:4px;--ckw-r-field:4px;--ckw-r-pill:4px;--ckw-r-fab:8px}
10
+ .ckw-root[data-font=system]{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif}
7
11
  :where(.ckw-root) :where(button,input,select,textarea){font:inherit;color:inherit;margin:0}
8
12
  .ckw-root button{cursor:pointer}
9
13
  .ckw-root :focus-visible{outline:2px solid var(--ckw-accent);outline-offset:2px}
@@ -203,47 +207,91 @@ font-size:14px;line-height:1.45;font-family:inherit;color:var(--ckw-fg);box-sizi
203
207
  .ckw-pop .ckw-row{padding:8px 0}
204
208
  .ckw-pop .ckw-form{border:0;padding:0;margin:12px 0 0}
205
209
  @media (max-width:520px){.ckw-pop{left:0!important;right:0!important;bottom:0;width:100%;max-width:100%;border-radius:12px 12px 0 0;max-height:85vh}.ckw-fab{bottom:14px}.ckw-fab[data-pos=bottom-right]{right:14px}.ckw-fab[data-pos=bottom-left]{left:14px}}
206
- /* Messenger (messenger-ui.ts) */
207
- .ckw-msgr-fab{position:fixed;bottom:20px;height:48px;padding:0 18px;gap:8px;font-size:15px;box-shadow:0 2px 4px rgba(16,18,24,.12),0 8px 24px color-mix(in srgb,var(--ckw-accent) 34%,transparent);transition:transform .16s cubic-bezier(.2,.8,.2,1)}
208
- .ckw-msgr-fab:hover{transform:scale(1.05)}
209
- .ckw-msgr-fab:active{transform:scale(.96)}
210
+ /* Messenger (messenger-ui.ts). Motion: one soft ease (.32,.72,0,1) for things that arrive, a quick ease-in for things that leave. */
211
+ .ckw-msgr-fab{position:fixed;bottom:20px;height:52px;padding:0 20px 0 16px;gap:8px;font-size:15px;box-shadow:0 1px 2px rgba(16,18,24,.1),0 6px 20px rgba(16,18,24,.16);transition:transform .3s cubic-bezier(.32,.72,0,1),box-shadow .2s linear}
212
+ .ckw-msgr-fab:hover{transform:scale(1.05);box-shadow:0 1px 2px rgba(16,18,24,.1),0 10px 28px rgba(16,18,24,.2)}
213
+ .ckw-msgr-fab:active{transform:scale(.94);transition-duration:.1s}
210
214
  .ckw-msgr-round{width:56px;height:56px;padding:0;justify-content:center}
211
- .ckw-msgr-fab .ckw-turn{animation:ckw-turn .22s cubic-bezier(.2,.8,.2,1)}
212
- @keyframes ckw-turn{from{opacity:0;transform:rotate(-70deg) scale(.6)}}
213
- .ckw-msgr-count{position:absolute;top:-2px;right:-2px;min-width:20px;height:20px;padding:0 5px;border-radius:10px;background:var(--ckw-danger);color:#fff;font-size:11px;font-weight:700;line-height:20px;text-align:center;box-shadow:0 0 0 2px var(--ckw-bg);font-variant-numeric:tabular-nums}
215
+ .ckw-msgr-fab{border-radius:var(--ckw-r-fab)}
216
+ .ckw-msgr-fab-ic{position:relative;display:block;width:20px;height:20px;flex:none}
217
+ .ckw-msgr-round .ckw-msgr-fab-ic{width:27px;height:27px}
218
+ .ckw-msgr-fab .ckw-cut{stroke:var(--ckw-accent)}
219
+ .ckw-msgr-fab-i{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;transition:transform .38s cubic-bezier(.32,.72,0,1),opacity .2s linear}
220
+ .ckw-msgr-fab-i .ckw-icon{width:auto;height:auto}
221
+ .ckw-msgr-fab-i[data-i=x],.ckw-msgr-fab[data-open] .ckw-msgr-fab-i[data-i=chat]{opacity:0;transform:rotate(-90deg) scale(.4)}
222
+ .ckw-msgr-fab[data-open] .ckw-msgr-fab-i[data-i=chat]{transform:rotate(90deg) scale(.4)}
223
+ .ckw-msgr-fab[data-open] .ckw-msgr-fab-i[data-i=x]{opacity:1;transform:none}
224
+ .ckw-msgr-fab-i[data-i=x] .ckw-icon{stroke-width:2.2}
225
+ .ckw-msgr-count{position:absolute;top:-2px;right:-2px;min-width:18px;height:18px;padding:0 5px;border-radius:9px;background:#ef4444;color:#fff;font-size:10.5px;font-weight:700;line-height:18px;text-align:center;box-shadow:0 0 0 2px var(--ckw-bg);font-variant-numeric:tabular-nums;animation:ckw-badge .4s cubic-bezier(.34,1.56,.64,1)}
226
+ @keyframes ckw-badge{from{transform:scale(0)}}
214
227
  .ckw-msgr-av{width:36px;height:36px;border-radius:50%;flex:none;display:inline-flex;align-items:center;justify-content:center;background:var(--ckw-accent);color:var(--ckw-accent-ink);font-size:15px;font-weight:700;line-height:1}
215
228
  .ckw-msgr-av-sm{width:26px;height:26px;font-size:12px}
216
- .ckw-msgr-preview{position:fixed;z-index:2147483000;bottom:88px;width:320px;max-width:calc(100vw - 32px);animation:ckw-in .22s cubic-bezier(.2,.8,.2,1)}
217
- .ckw-msgr-preview[data-pos=bottom-right]{right:20px}
218
- .ckw-msgr-preview[data-pos=bottom-left]{left:20px}
219
- .ckw-msgr-preview-card{display:flex;align-items:flex-start;gap:12px;width:100%;text-align:left;padding:14px 16px;border:0;border-radius:18px;background:var(--ckw-bg);box-shadow:var(--ckw-float)}
229
+ .ckw-msgr-online{display:inline-flex;align-items:center;gap:6px;font-size:12.5px;color:var(--ckw-fg2)}
230
+ .ckw-msgr-online::before{content:"";width:7px;height:7px;border-radius:50%;background:#22c55e;box-shadow:0 0 0 3px color-mix(in srgb,#22c55e 22%,transparent);flex:none}
231
+ /* Floating cards over the closed launcher: a new answer, the hover teaser */
232
+ .ckw-msgr-preview,.ckw-msgr-teaser{position:fixed;z-index:2147483000;bottom:92px;width:320px;max-width:calc(100vw - 32px);transform-origin:bottom right;animation:ckw-rise .34s cubic-bezier(.32,.72,0,1)}
233
+ .ckw-msgr-preview[data-pos=bottom-right],.ckw-msgr-teaser[data-pos=bottom-right]{right:20px}
234
+ .ckw-msgr-preview[data-pos=bottom-left],.ckw-msgr-teaser[data-pos=bottom-left]{left:20px;transform-origin:bottom left}
235
+ .ckw-msgr-preview[data-out],.ckw-msgr-teaser[data-out]{animation:ckw-sink .16s cubic-bezier(.4,0,1,1) forwards;pointer-events:none}
236
+ @keyframes ckw-rise{from{opacity:0;transform:translateY(10px) scale(.94)}}
237
+ @keyframes ckw-sink{to{opacity:0;transform:translateY(6px) scale(.97)}}
238
+ .ckw-msgr-preview-card{display:flex;align-items:flex-start;gap:12px;width:100%;text-align:left;padding:14px 40px 14px 16px;border:0;border-radius:calc(var(--ckw-r-card) + 2px);background:var(--ckw-bg);box-shadow:var(--ckw-soft);transition:transform .2s cubic-bezier(.32,.72,0,1)}
239
+ .ckw-msgr-preview-card:hover{transform:translateY(-2px)}
220
240
  .ckw-msgr-preview-main{display:flex;flex-direction:column;gap:2px;min-width:0}
221
241
  .ckw-msgr-preview-who{font-size:12px;font-weight:600;color:var(--ckw-fg3)}
222
242
  .ckw-msgr-preview-text{display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;white-space:pre-wrap;overflow-wrap:anywhere}
223
- .ckw-msgr-preview-x{position:absolute;top:-8px;right:-8px;width:24px;height:24px;border-radius:50%;border:0;background:var(--ckw-bg);color:var(--ckw-fg2);display:flex;align-items:center;justify-content:center;padding:0;box-shadow:var(--ckw-lift)}
224
- .ckw-msgr{bottom:88px;width:400px;height:min(660px,calc(100vh - 108px));max-height:none;border:0;border-radius:20px;box-shadow:var(--ckw-float);animation:ckw-pop .24s cubic-bezier(.2,.8,.2,1);transform-origin:bottom right}
243
+ .ckw-msgr-preview-x{position:absolute;top:8px;right:8px;width:26px;height:26px;border-radius:50%;border:0;background:transparent;color:var(--ckw-fg3);display:flex;align-items:center;justify-content:center;padding:0;transition:background-color .12s linear,color .12s linear}
244
+ .ckw-msgr-preview-x:hover{background:var(--ckw-bg2);color:var(--ckw-fg)}
245
+ .ckw-msgr-teaser{width:340px;padding:16px;border-radius:calc(var(--ckw-r-card) + 4px);background:var(--ckw-bg);box-shadow:var(--ckw-soft);display:flex;flex-direction:column;gap:14px}
246
+ .ckw-msgr-teaser-top{display:flex;align-items:center;gap:12px}
247
+ .ckw-msgr-teaser-t{display:flex;flex-direction:column;gap:3px;flex:1;min-width:0}
248
+ .ckw-msgr-teaser-t b{font-size:15px;font-weight:700;letter-spacing:-.01em;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
249
+ .ckw-msgr-teaser-row{display:flex;gap:8px}
250
+ .ckw-msgr-teaser-b{flex:1;display:inline-flex;align-items:center;justify-content:center;gap:7px;height:40px;padding:0 14px;border:0;border-radius:var(--ckw-r-pill);background:var(--ckw-bg3);color:var(--ckw-fg);font-size:14px;font-weight:600;white-space:nowrap;transition:transform .2s cubic-bezier(.32,.72,0,1),filter .1s linear}
251
+ .ckw-msgr-teaser-b[data-main]{flex:1.4;background:var(--ckw-accent);color:var(--ckw-accent-ink)}
252
+ .ckw-msgr-teaser-b:hover{filter:brightness(1.06)}
253
+ .ckw-msgr-teaser-b:active{transform:scale(.96)}
254
+ /* The panel */
255
+ .ckw-msgr{bottom:92px;width:400px;height:min(680px,calc(100vh - 112px));max-height:none;border:0;border-radius:var(--ckw-r-panel);box-shadow:var(--ckw-soft);transform-origin:bottom right;animation:ckw-msgr-in .42s cubic-bezier(.32,.72,0,1);transition:width .36s cubic-bezier(.32,.72,0,1),height .36s cubic-bezier(.32,.72,0,1)}
225
256
  .ckw-msgr[data-pos=bottom-left]{transform-origin:bottom left}
226
- @keyframes ckw-pop{from{opacity:0;transform:translateY(12px) scale(.96)}}
227
- .ckw-msgr-head{gap:10px;min-height:60px;padding:12px 12px 12px 16px;border-bottom:1px solid var(--ckw-line)}
228
- .ckw-msgr[data-view=home] .ckw-msgr-head{background:var(--ckw-accent);color:var(--ckw-accent-ink);border-bottom-color:transparent}
229
- .ckw-msgr[data-view=home] .ckw-msgr-av{background:var(--ckw-accent-ink);color:var(--ckw-accent)}
230
- .ckw-msgr[data-view=home] .ckw-msgr-x{color:inherit}
231
- .ckw-msgr[data-view=home] .ckw-msgr-x:hover{background:color-mix(in srgb,var(--ckw-accent-ink) 16%,transparent)}
232
- .ckw-msgr-head-t{flex:1}
233
- .ckw-msgr-x{width:32px;height:32px;padding:0;border-radius:10px}
234
- .ckw-msgr-brand{display:inline-flex;align-items:center;gap:10px;font-size:15px;font-weight:650;min-width:0}
257
+ .ckw-msgr[data-wide]{width:680px;height:calc(100vh - 112px);max-height:860px}
258
+ .ckw-msgr[data-still]{animation:none}
259
+ .ckw-msgr[data-out]{animation:ckw-msgr-out .2s cubic-bezier(.4,0,1,1) forwards;pointer-events:none}
260
+ @keyframes ckw-msgr-in{from{opacity:0;transform:translateY(20px) scale(.9)}}
261
+ @keyframes ckw-msgr-out{to{opacity:0;transform:translateY(14px) scale(.94)}}
262
+ .ckw-msgr-bar{position:relative;z-index:2;display:flex;align-items:center;gap:8px;padding:12px 12px 10px;background:var(--ckw-bg);flex:none;transition:background-color .25s linear,color .25s linear}
263
+ .ckw-msgr-lead,.ckw-msgr-trail{display:flex;align-items:center;gap:2px;flex:1;min-width:0}
264
+ .ckw-msgr-trail{justify-content:flex-end}
265
+ .ckw-msgr-ib{width:34px;height:34px;padding:0;flex:none;display:flex;align-items:center;justify-content:center;border:0;border-radius:50%;background:transparent;color:var(--ckw-fg2);transition:background-color .12s linear,transform .2s cubic-bezier(.32,.72,0,1)}
266
+ .ckw-msgr-ib:hover,.ckw-msgr-ib[aria-expanded=true]{background:var(--ckw-bg3);color:var(--ckw-fg)}
267
+ .ckw-msgr-ib:active{transform:scale(.9)}
268
+ .ckw-msgr-ib[aria-current=page]{color:var(--ckw-fg)}
269
+ .ckw-msgr-x{display:none}
270
+ .ckw-msgr-count-tab{top:-1px;right:-3px;min-width:0;width:8px;height:8px;padding:0;font-size:0;line-height:0;box-shadow:0 0 0 2px var(--ckw-bg)}
271
+ .ckw-msgr-menu{position:absolute;z-index:3;top:52px;right:12px;min-width:200px;padding:6px;border-radius:14px;background:var(--ckw-bg);box-shadow:var(--ckw-float);display:flex;flex-direction:column;transform-origin:top right;animation:ckw-menu-in .2s cubic-bezier(.32,.72,0,1)}
272
+ .ckw-msgr-menu[data-out]{animation:ckw-menu-out .12s cubic-bezier(.4,0,1,1) forwards}
273
+ @keyframes ckw-menu-in{from{opacity:0;transform:translateY(-4px) scale(.94)}}
274
+ @keyframes ckw-menu-out{to{opacity:0;transform:scale(.96)}}
275
+ .ckw-msgr-menu-h{padding:6px 10px 4px;font-size:12px;font-weight:600;color:var(--ckw-fg3)}
276
+ .ckw-msgr-menu-i{display:flex;align-items:center;gap:10px;height:36px;padding:0 10px;border:0;border-radius:9px;background:none;font-size:14px;text-align:left;color:var(--ckw-fg)}
277
+ .ckw-msgr-menu-i:hover,.ckw-msgr-menu-i:focus-visible{background:var(--ckw-bg2)}
278
+ .ckw-msgr-menu-i .ckw-icon{color:var(--ckw-fg2)}
279
+ .ckw-msgr-body{display:flex;flex-direction:column;gap:12px;background:var(--ckw-bg);padding:4px 16px 16px;overscroll-behavior:contain;scrollbar-width:thin}
280
+ .ckw-msgr-enter>*{animation:ckw-view .3s cubic-bezier(.32,.72,0,1) backwards}
281
+ .ckw-msgr-enter>:nth-child(2){animation-delay:.03s}
282
+ .ckw-msgr-enter>:nth-child(3){animation-delay:.06s}
283
+ .ckw-msgr-enter>:nth-child(n+4){animation-delay:.09s}
284
+ @keyframes ckw-view{from{opacity:0;transform:translateY(8px)}}
285
+ /* Home */
286
+ .ckw-msgr-hero{display:flex;flex-direction:column;gap:6px;padding:10px 4px 8px}
287
+ .ckw-msgr-brand{display:inline-flex;align-items:center;gap:8px;font-size:13px;font-weight:600;color:var(--ckw-fg2);min-width:0}
235
288
  .ckw-msgr-brand span:last-child{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
236
- .ckw-msgr-who{display:flex;align-items:center;gap:10px;min-width:0;flex:1}
237
- .ckw-msgr-who-t{display:flex;flex-direction:column;min-width:0;font-weight:400}
238
- .ckw-msgr-who-t b{font-size:15px;font-weight:650;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
239
- .ckw-msgr-who-t span{font-size:12px;color:var(--ckw-fg3)}
240
- .ckw-msgr-body{display:flex;flex-direction:column;gap:12px;background:var(--ckw-bg2);padding:16px}
241
- .ckw-msgr[data-view=article] .ckw-msgr-body,.ckw-msgr[data-view=messages] .ckw-msgr-body{background:var(--ckw-bg)}
242
- .ckw-msgr-hero{margin:-16px -16px 0;padding:10px 22px 64px;background:var(--ckw-accent);color:var(--ckw-accent-ink)}
243
- .ckw-msgr-hero+*{margin-top:-52px}
244
- .ckw-msgr-hello{margin:0;font-size:26px;font-weight:700;letter-spacing:-.02em;line-height:1.2;text-wrap:balance;overflow-wrap:anywhere}
245
- .ckw-msgr-card{position:relative;display:flex;align-items:center;gap:12px;width:100%;text-align:left;padding:14px 16px;border:0;border-radius:16px;background:var(--ckw-card);box-shadow:var(--ckw-raise);transition:box-shadow .12s linear}
246
- button.ckw-msgr-card:hover{box-shadow:var(--ckw-raise),0 0 0 1px color-mix(in srgb,var(--ckw-accent) 30%,transparent)}
289
+ .ckw-msgr-hello{margin:14px 0 0;font-size:28px;font-weight:650;letter-spacing:-.03em;line-height:1.12;text-wrap:balance;overflow-wrap:anywhere}
290
+ .ckw-msgr-card{position:relative;display:flex;align-items:center;gap:12px;width:100%;text-align:left;padding:14px 16px;border:0;border-radius:var(--ckw-r-card);background:var(--ckw-bg2);transition:background-color .15s linear,box-shadow .15s linear,transform .25s cubic-bezier(.32,.72,0,1)}
291
+ button.ckw-msgr-card:hover{background:var(--ckw-bg3)}
292
+ .ckw-msgr-card-col .ckw-msgr-search{background:var(--ckw-bg)}
293
+ .ckw-msgr-card .ckw-msgr-art:hover{background:var(--ckw-bg3)}
294
+ button.ckw-msgr-card:active{transform:scale(.985)}
247
295
  .ckw-msgr-card-col{flex-direction:column;align-items:stretch;gap:2px;padding:8px}
248
296
  .ckw-msgr-card-main{display:flex;flex-direction:column;gap:2px;min-width:0;flex:1}
249
297
  .ckw-msgr-card-main b{font-size:15px;font-weight:650}
@@ -254,26 +302,40 @@ button.ckw-msgr-card:hover{box-shadow:var(--ckw-raise),0 0 0 1px color-mix(in sr
254
302
  .ckw-msgr-recent-row{display:flex;align-items:center;gap:12px;min-width:0}
255
303
  .ckw-msgr-recent-text{color:var(--ckw-fg);font-size:14px}
256
304
  .ckw-msgr-card .ckw-icon{color:var(--ckw-fg3)}
257
- .ckw-msgr-go{width:34px;height:34px;border-radius:50%;flex:none;display:flex;align-items:center;justify-content:center;background:color-mix(in srgb,var(--ckw-accent) 12%,transparent)}
305
+ .ckw-msgr-go{width:34px;height:34px;border-radius:50%;flex:none;display:flex;align-items:center;justify-content:center;background:color-mix(in srgb,var(--ckw-accent) 12%,transparent);transition:transform .25s cubic-bezier(.32,.72,0,1)}
306
+ button.ckw-msgr-card:hover .ckw-msgr-go{transform:translateX(2px)}
258
307
  .ckw-msgr-card .ckw-msgr-go .ckw-icon{color:var(--ckw-accent)}
259
- .ckw-msgr-badge{min-width:20px;height:20px;padding:0 6px;border-radius:10px;background:var(--ckw-danger);color:#fff;font-size:12px;font-weight:700;line-height:20px;text-align:center}
260
- .ckw-msgr-search{display:flex;align-items:center;gap:8px;height:42px;padding:0 14px;border:0;border-radius:12px;background:var(--ckw-bg2);color:var(--ckw-accent);cursor:text}
261
- .ckw-msgr[data-view=help] .ckw-msgr-search{background:var(--ckw-card);box-shadow:var(--ckw-raise)}
262
- .ckw-msgr-card-col .ckw-msgr-search{margin-bottom:4px}
263
- .ckw-msgr-search-in{flex:1;min-width:0;border:0;background:transparent;outline:none;font-size:14px;font-weight:500;color:var(--ckw-fg)}
308
+ .ckw-msgr-badge{width:8px;height:8px;flex:none;border-radius:50%;background:var(--ckw-danger);font-size:0}
309
+ /* Search */
310
+ .ckw-msgr-search{display:flex;align-items:center;gap:10px;height:46px;padding:0 14px;border:1px solid transparent;border-radius:var(--ckw-r-field);background:var(--ckw-bg2);color:var(--ckw-fg3);cursor:text;transition:border-color .15s linear,box-shadow .15s linear,background-color .15s linear}
311
+ .ckw-msgr-card-col .ckw-msgr-search{margin-bottom:4px;height:42px}
312
+ .ckw-msgr-search:focus-within{border-color:var(--ckw-accent);background:var(--ckw-bg);box-shadow:0 0 0 4px color-mix(in srgb,var(--ckw-accent) 16%,transparent);color:var(--ckw-accent)}
313
+ .ckw-msgr-search-in{flex:1;min-width:0;border:0;background:transparent;outline:none;font-size:14.5px;color:var(--ckw-fg)}
264
314
  .ckw-root .ckw-msgr-search-in:focus-visible{outline:none}
265
- .ckw-msgr-search-in::placeholder{color:var(--ckw-fg2)}
266
- .ckw-msgr-search:focus-within{box-shadow:0 0 0 2px color-mix(in srgb,var(--ckw-accent) 45%,transparent)}
267
- .ckw-msgr-art{display:flex;align-items:center;gap:8px;width:100%;text-align:left;padding:10px 8px;border:0;border-radius:10px;background:transparent;font-size:14px}
315
+ .ckw-msgr-search-in::placeholder{color:var(--ckw-fg3)}
316
+ .ckw-msgr-search-in::-webkit-search-cancel-button{display:none}
317
+ .ckw-msgr-art{display:flex;align-items:center;gap:8px;width:100%;text-align:left;padding:10px 8px;border:0;border-radius:10px;background:transparent;font-size:14px;transition:background-color .12s linear}
268
318
  .ckw-msgr-art:hover{background:var(--ckw-bg2)}
269
319
  .ckw-msgr-art-t{flex:1;min-width:0}
270
- .ckw-msgr-art .ckw-icon{color:var(--ckw-accent)}
320
+ .ckw-msgr-art .ckw-icon{color:var(--ckw-accent);transition:transform .25s cubic-bezier(.32,.72,0,1)}
321
+ .ckw-msgr-art:hover .ckw-icon{transform:translateX(2px)}
271
322
  .ckw-msgr-skel{height:40px;margin:4px 0 0}
272
- .ckw-msgr-group{display:flex;flex-direction:column;gap:6px}
273
- .ckw-msgr-group-h{margin:4px 2px 0;font-size:12px;font-weight:600;color:var(--ckw-fg3)}
323
+ /* Help */
324
+ .ckw-msgr-help-h{margin:6px 0 2px;text-align:center;font-size:16px;font-weight:700;letter-spacing:-.01em}
325
+ .ckw-msgr-hlist{display:flex;flex-direction:column;margin:0 -8px}
326
+ .ckw-msgr-hrow{display:flex;align-items:center;gap:12px;width:100%;padding:12px;border:0;border-radius:14px;background:transparent;text-align:left;transition:background-color .12s linear}
327
+ .ckw-msgr-hrow+.ckw-msgr-hrow{box-shadow:0 -1px 0 var(--ckw-line)}
328
+ .ckw-msgr-hrow:hover,.ckw-msgr-hrow:hover+.ckw-msgr-hrow{box-shadow:none}
329
+ .ckw-msgr-hrow:hover{background:var(--ckw-bg2)}
330
+ .ckw-msgr-hrow-main{display:flex;flex-direction:column;gap:3px;flex:1;min-width:0}
331
+ .ckw-msgr-hrow-main b{font-size:14.5px;font-weight:650}
332
+ .ckw-msgr-hrow-sub{font-size:13px;color:var(--ckw-fg2);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;line-height:1.4}
333
+ .ckw-msgr-hrow-meta{font-size:12px;color:var(--ckw-fg3)}
334
+ .ckw-msgr-hrow .ckw-icon{color:var(--ckw-fg3);transition:transform .25s cubic-bezier(.32,.72,0,1),color .12s linear}
335
+ .ckw-msgr-hrow:hover .ckw-icon{color:var(--ckw-fg);transform:translateX(2px)}
274
336
  .ckw-msgr-empty{display:flex;flex-direction:column;align-items:center;gap:10px;padding:28px 8px;text-align:center;color:var(--ckw-fg2)}
275
337
  .ckw-msgr-empty p{margin:0}
276
- .ckw-msgr-doc{display:flex;flex-direction:column;gap:6px}
338
+ .ckw-msgr-doc{display:flex;flex-direction:column;gap:6px;padding-top:4px}
277
339
  .ckw-msgr-doc-t{margin:0;font-size:20px;font-weight:700;letter-spacing:-.015em;line-height:1.3}
278
340
  .ckw-msgr-doc-c{margin:0;font-size:12px;color:var(--ckw-fg3)}
279
341
  .ckw-msgr-doc-b{margin-top:8px;font-size:14px;line-height:1.6;overflow-wrap:anywhere}
@@ -289,35 +351,207 @@ button.ckw-msgr-card:hover{box-shadow:var(--ckw-raise),0 0 0 1px color-mix(in sr
289
351
  .ckw-msgr-rate{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap;margin-top:8px;padding:12px;border-radius:12px;background:var(--ckw-bg2);font-size:13px;color:var(--ckw-fg2)}
290
352
  .ckw-msgr-rate-b{display:flex;gap:6px}
291
353
  .ckw-msgr-ask{margin-top:6px;width:100%;height:40px;border-radius:12px}
354
+ /* Chat */
292
355
  .ckw-msgr-cite{display:inline-flex;align-items:center;gap:6px;max-width:100%;padding:7px 10px;border:1px solid var(--ckw-line);border-radius:12px;background:var(--ckw-bg);font-size:13px;text-align:left}
293
356
  .ckw-msgr-cite .ckw-icon{color:var(--ckw-accent)}
294
357
  .ckw-msgr-cite span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
295
- .ckw-msgr-tabs{display:flex;border-top:1px solid var(--ckw-line);background:var(--ckw-bg);padding:2px 8px}
296
- .ckw-msgr-tab{position:relative;flex:1;display:flex;flex-direction:column;align-items:center;gap:3px;padding:8px 0 10px;border:0;background:none;color:var(--ckw-fg3);font-size:12px;font-weight:600;transition:color .1s linear}
297
- .ckw-msgr-tab:hover{color:var(--ckw-fg2)}
298
- .ckw-msgr-tab[aria-current=page]{color:var(--ckw-accent)}
299
- .ckw-msgr-tab .ckw-icon{width:20px;height:20px}
300
- .ckw-msgr-count-tab{top:4px;right:calc(50% - 24px)}
301
- .ckw-msgs{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:12px}
302
- .ckw-msg{display:flex;flex-direction:column;align-items:flex-start;gap:4px;max-width:82%}
303
- .ckw-msg[data-from=me]{align-self:flex-end;align-items:flex-end}
304
- .ckw-bubble{padding:9px 14px;border-radius:18px 18px 18px 6px;background:var(--ckw-bg3);white-space:pre-wrap;overflow-wrap:anywhere;font-size:14px;line-height:1.45;text-wrap:pretty}
305
- .ckw-msg[data-from=me] .ckw-bubble{background:var(--ckw-accent);color:var(--ckw-accent-ink);border-radius:18px 18px 6px 18px}
358
+ .ckw-msgs{list-style:none;margin:8px 0 0;padding:0;display:flex;flex-direction:column;gap:12px}
359
+ .ckw-msg{display:flex;flex-direction:column;align-items:flex-start;gap:4px;max-width:82%;transform-origin:bottom left}
360
+ .ckw-msg[data-from=me]{align-self:flex-end;align-items:flex-end;transform-origin:bottom right}
361
+ .ckw-msg[data-new]{animation:ckw-bub .4s cubic-bezier(.32,.72,0,1)}
362
+ @keyframes ckw-bub{from{opacity:0;transform:translateY(10px) scale(.92)}}
363
+ .ckw-bubble{padding:10px 14px;border-radius:var(--ckw-r-bubble) var(--ckw-r-bubble) var(--ckw-r-bubble) var(--ckw-r-tail);background:var(--ckw-bg3);white-space:pre-wrap;overflow-wrap:anywhere;font-size:14px;line-height:1.45;text-wrap:pretty}
364
+ .ckw-msg[data-from=me] .ckw-bubble{background:var(--ckw-accent);color:var(--ckw-accent-ink);border-radius:var(--ckw-r-bubble) var(--ckw-r-bubble) var(--ckw-r-tail) var(--ckw-r-bubble)}
306
365
  .ckw-msg[aria-busy=true] .ckw-bubble{opacity:.7}
307
366
  .ckw-msg-meta{font-size:11px;color:var(--ckw-fg3);font-variant-numeric:tabular-nums;padding:0 6px}
367
+ .ckw-msgr-sugg{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:8px;margin-top:auto;padding-top:12px}
368
+ .ckw-msgr-sugg-b{max-width:100%;padding:9px 14px;border:0;border-radius:var(--ckw-r-card);background:var(--ckw-bg2);font-size:13.5px;text-align:left;color:var(--ckw-fg);transition:background-color .12s linear,color .12s linear,transform .2s cubic-bezier(.32,.72,0,1)}
369
+ .ckw-msgr-sugg-b:hover{background:var(--ckw-bg3);color:var(--ckw-accent)}
370
+ .ckw-msgr-sugg-b:active{transform:scale(.96)}
371
+ .ckw-msgr-enter .ckw-msgr-sugg-b{animation:ckw-view .34s cubic-bezier(.32,.72,0,1) backwards}
372
+ .ckw-msgr-enter .ckw-msgr-sugg-b:nth-child(2){animation-delay:.12s}
373
+ .ckw-msgr-enter .ckw-msgr-sugg-b:nth-child(3){animation-delay:.18s}
308
374
  .ckw-msgr-note{margin:4px 0 0;text-align:center}
309
- .ckw-msgr-compose{display:flex;flex-direction:column;gap:8px;padding:10px 12px 12px;background:var(--ckw-bg)}
310
- .ckw-msgr-compose .ckw-input{border:0;border-radius:12px;background:var(--ckw-bg2);min-height:38px;padding:8px 14px}
311
- .ckw-msgr-row{display:flex;gap:6px;align-items:flex-end;padding:5px 5px 5px 16px;border:1px solid var(--ckw-line);border-radius:22px;background:var(--ckw-bg);transition:border-color .1s linear}
312
- .ckw-msgr-row:focus-within{border-color:var(--ckw-accent)}
313
- .ckw-msgr-input{flex:1;min-height:32px;max-height:120px;padding:6px 0;border:0;border-radius:0;background:transparent;resize:none;field-sizing:content}
375
+ .ckw-msgr-compose{display:flex;flex-direction:column;gap:8px;padding:4px 14px 14px;background:var(--ckw-bg);flex:none}
376
+ .ckw-msgr-compose .ckw-input{border:0;border-radius:var(--ckw-r-field);background:var(--ckw-bg2);min-height:40px;padding:8px 16px}
377
+ .ckw-root .ckw-msgr-compose .ckw-input:focus-visible{outline:none;background:var(--ckw-bg3)}
378
+ .ckw-msgr-box{display:flex;flex-direction:column;align-items:stretch;gap:4px;padding:12px 8px 8px 16px;border:0;border-radius:calc(var(--ckw-r-card) + 4px);background:var(--ckw-bg2);box-shadow:0 0 0 1px color-mix(in srgb,var(--ckw-line) 70%,transparent);cursor:text;transition:background-color .15s linear,box-shadow .15s linear}
379
+ .ckw-msgr-box:focus-within{background:var(--ckw-bg);box-shadow:0 0 0 1px var(--ckw-line),0 6px 18px rgba(16,18,24,.07)}
380
+ .ckw-msgr-tools{display:flex;align-items:center;gap:2px;margin-left:-8px}
381
+ .ckw-msgr-sp{flex:1}
382
+ .ckw-msgr-input{flex:1;min-width:0;min-height:24px;max-height:140px;padding:2px 8px 2px 0;border:0;border-radius:0;background:transparent;resize:none;field-sizing:content;font-size:14.5px}
314
383
  .ckw-root .ckw-msgr-input:focus-visible{outline:none}
315
- .ckw-msgr-send{width:32px;height:32px;padding:0;flex:none;display:flex;align-items:center;justify-content:center;border:0;border-radius:50%;background:var(--ckw-accent);color:var(--ckw-accent-ink);transition:opacity .1s linear}
384
+ .ckw-msgr-send{width:32px;height:32px;padding:0;flex:none;display:flex;align-items:center;justify-content:center;border:0;border-radius:50%;background:var(--ckw-accent);color:var(--ckw-accent-ink);transition:background-color .15s linear,color .15s linear,transform .25s cubic-bezier(.34,1.56,.64,1)}
385
+ .ckw-msgr-send:not(:disabled):hover{transform:scale(1.08)}
386
+ .ckw-msgr-send:not(:disabled):active{transform:scale(.9)}
316
387
  .ckw-msgr-send:disabled{background:var(--ckw-bg3);color:var(--ckw-fg3);cursor:default}
388
+ /* Files: the paperclip in the field, picked files above it, sent ones in the bubbles, dropping onto the panel */
389
+ .ckw-msgr-compose{position:relative}
390
+ .ckw-msgr-clip{width:32px;height:32px;padding:0;flex:none;display:flex;align-items:center;justify-content:center;border:0;border-radius:calc(var(--ckw-r-field) - 4px);background:transparent;color:var(--ckw-fg3);transition:color .12s linear,background-color .12s linear,transform .2s cubic-bezier(.32,.72,0,1)}
391
+ .ckw-msgr-clip:hover,.ckw-msgr-clip[aria-expanded=true]{color:var(--ckw-fg);background:color-mix(in srgb,var(--ckw-fg) 7%,transparent)}
392
+ .ckw-msgr-clip:active{transform:scale(.9)}
393
+
394
+ .ckw-msgr-amenu{top:auto;bottom:calc(100% - 4px);right:14px;transform-origin:bottom right}
395
+ .ckw-msgr-files{display:flex;flex-wrap:wrap;gap:10px;padding:6px 2px 0}
396
+ .ckw-msgr-file{position:relative;width:56px;height:56px;border-radius:calc(var(--ckw-r-card) - 4px);background:var(--ckw-bg2);box-shadow:0 0 0 1px var(--ckw-line)}
397
+ .ckw-msgr-file img{display:block;width:100%;height:100%;object-fit:cover;border-radius:inherit}
398
+ .ckw-msgr-file[aria-busy=true] img,.ckw-msgr-file[aria-busy=true] .ckw-msgr-file-doc{opacity:.45}
399
+ .ckw-msgr-file[aria-busy=true]::after{content:"";position:absolute;left:50%;top:50%;width:18px;height:18px;margin:-9px 0 0 -9px;border:2px solid var(--ckw-fg2);border-right-color:transparent;border-radius:50%;animation:ckw-spin .8s linear infinite}
400
+ @keyframes ckw-spin{to{transform:rotate(360deg)}}
401
+ .ckw-msgr-file-doc{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;width:100%;height:100%;padding:4px;color:var(--ckw-fg2);font-size:10px;line-height:1.2}
402
+ .ckw-msgr-file-doc span{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
403
+ .ckw-msgr-file-x{position:absolute;top:-7px;right:-7px;width:20px;height:20px;padding:0;display:flex;align-items:center;justify-content:center;border:2px solid var(--ckw-bg);border-radius:50%;background:var(--ckw-fg);color:var(--ckw-bg)}
404
+ .ckw-msgr-file-x .ckw-icon{width:10px;height:10px}
405
+ .ckw-msg-files{display:flex;flex-wrap:wrap;gap:6px;max-width:100%}
406
+ .ckw-msg[data-from=me] .ckw-msg-files{justify-content:flex-end}
407
+ .ckw-msg-img{display:block;overflow:hidden;border-radius:var(--ckw-r-bubble);background:var(--ckw-bg3);box-shadow:0 0 0 1px var(--ckw-line)}
408
+ .ckw-msg-img img{display:block;max-width:220px;max-height:200px;min-width:48px;min-height:48px;object-fit:cover}
409
+ .ckw-msg-files a.ckw-msgr-cite{color:var(--ckw-fg);text-decoration:none}
410
+ .ckw-msgr[data-drop]::after{content:"Drop to attach";position:absolute;inset:8px;z-index:5;display:flex;align-items:center;justify-content:center;border:2px dashed var(--ckw-accent);border-radius:calc(var(--ckw-r-panel) - 6px);background:color-mix(in srgb,var(--ckw-bg) 90%,transparent);color:var(--ckw-fg);font-size:15px;font-weight:600;pointer-events:none}
411
+ /* Powered by */
412
+ .ckw-msgr-powered{flex:none;display:block;padding:2px 0 10px;text-align:center;font-size:11.5px;color:var(--ckw-fg3);text-decoration:none;background:var(--ckw-bg)}
413
+ .ckw-msgr-powered b{font-weight:650;color:var(--ckw-fg2)}
414
+ .ckw-msgr-powered:hover b{color:var(--ckw-fg)}
415
+ .ckw-msgr-compose:has(+.ckw-msgr-powered){padding-bottom:8px}
317
416
  .ckw-msgr-error{margin:0;font-size:12px;color:var(--ckw-danger)}
318
417
  .ckw-msgr .ckw-input[aria-invalid=true]{box-shadow:0 0 0 1px var(--ckw-danger)}
319
- @media (max-width:520px){.ckw-msgr{height:100dvh;bottom:0;border-radius:0}.ckw-msgr-preview{bottom:80px}}
320
- @media (prefers-reduced-motion:reduce){.ckw-msgr,.ckw-msgr-preview,.ckw-msgr-fab .ckw-turn{animation:none}.ckw-msgr-fab{transition:none}}
418
+ /* Bar middle, tab bar, Home's glow and "Ask a question" (Featurebase-like) */
419
+ .ckw-msgr-mid{display:flex;align-items:center;justify-content:center;gap:10px;min-width:0;max-width:62%;flex:none}
420
+ .ckw-msgr-mid b{font-size:15px;font-weight:650;letter-spacing:-.01em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
421
+ .ckw-msgr-mid-t{display:flex;flex-direction:column;gap:1px;min-width:0;line-height:1.25}
422
+ .ckw-msgr-mid-t .ckw-msgr-online{font-size:11.5px;white-space:nowrap}
423
+ .ckw-msgr-mid-t .ckw-msgr-online::before{width:6px;height:6px;box-shadow:none}
424
+ .ckw-msgr-tabs{flex:none;display:flex;padding:6px 10px 4px;background:var(--ckw-bg);box-shadow:0 -1px 0 color-mix(in srgb,var(--ckw-line) 60%,transparent)}
425
+ .ckw-msgr-tab{flex:1;display:flex;flex-direction:column;align-items:center;gap:3px;padding:6px 0 4px;border:0;border-radius:12px;background:none;color:var(--ckw-fg3);font-size:12px;font-weight:550;transition:color .15s linear}
426
+ .ckw-msgr-tab:hover{color:var(--ckw-fg2)}
427
+ .ckw-msgr-tab[aria-current=page]{color:var(--ckw-fg)}
428
+ .ckw-msgr-tab-ic{position:relative;display:block;width:22px;height:22px;transition:transform .25s cubic-bezier(.34,1.56,.64,1)}
429
+ .ckw-msgr-tab:active .ckw-msgr-tab-ic{transform:scale(.88)}
430
+ .ckw-msgr-tab-ic>.ckw-icon{position:absolute;inset:0;transition:opacity .15s linear,transform .3s cubic-bezier(.34,1.56,.64,1)}
431
+ .ckw-msgr-tab-ic>.ckw-icon+.ckw-icon{opacity:0;transform:scale(.75)}
432
+ .ckw-msgr-tab[aria-current=page] .ckw-msgr-tab-ic>.ckw-icon:first-child{opacity:0}
433
+ .ckw-msgr-tab[aria-current=page] .ckw-msgr-tab-ic>.ckw-icon+.ckw-icon{opacity:1;transform:none}
434
+ .ckw-cut{stroke:var(--ckw-bg)}
435
+ .ckw-root:not([data-header=color]) .ckw-msgr[data-view=home] :is(.ckw-msgr-bar,.ckw-msgr-body){background:transparent}
436
+ .ckw-msgr-askq{display:flex;align-items:center;gap:8px;height:52px;margin:6px 0 4px;padding:0 7px 0 18px;border-radius:var(--ckw-r-field);background:var(--ckw-bg2);box-shadow:0 0 0 1px color-mix(in srgb,var(--ckw-line) 70%,transparent);transition:background-color .15s linear,box-shadow .15s linear}
437
+ .ckw-msgr-askq:focus-within{background:var(--ckw-bg);box-shadow:0 0 0 1px var(--ckw-line),0 6px 18px rgba(16,18,24,.07)}
438
+ .ckw-msgr-askq-in{flex:1;min-width:0;border:0;background:transparent;outline:none;font-size:15px;color:var(--ckw-fg)}
439
+ .ckw-msgr-askq-in::placeholder{color:var(--ckw-fg3)}
440
+ .ckw-root .ckw-msgr-askq-in:focus-visible{outline:none}
441
+ .ckw-msgr-askq .ckw-msgr-send{width:38px;height:38px}
442
+ .ckw-root[data-header=color] .ckw-msgr-askq{background:var(--ckw-card);box-shadow:var(--ckw-raise)}
443
+ /* Home in the accent color (look: header "color"): the bar and the top in the accent, raised cards over its edge */
444
+ .ckw-root[data-header=color] .ckw-msgr[data-view=home] .ckw-msgr-bar{background:var(--ckw-accent);color:var(--ckw-accent-ink)}
445
+ .ckw-root[data-header=color] .ckw-msgr[data-view=home] .ckw-msgr-ib{color:color-mix(in srgb,var(--ckw-accent-ink) 80%,transparent)}
446
+ .ckw-root[data-header=color] .ckw-msgr[data-view=home] .ckw-msgr-ib:hover,.ckw-root[data-header=color] .ckw-msgr[data-view=home] .ckw-msgr-ib[aria-expanded=true]{background:color-mix(in srgb,var(--ckw-accent-ink) 14%,transparent);color:var(--ckw-accent-ink)}
447
+ .ckw-root[data-header=color] .ckw-msgr[data-view=home] .ckw-msgr-body,.ckw-root[data-header=color] .ckw-msgr[data-view=home] .ckw-msgr-powered{background:var(--ckw-bg2)}
448
+ .ckw-root[data-header=color] .ckw-msgr[data-view=home] .ckw-msgr-body{scrollbar-width:none}
449
+ .ckw-root[data-header=color] .ckw-msgr-hero{margin:-4px -16px 0;padding:14px 20px 64px;background:var(--ckw-accent);color:var(--ckw-accent-ink)}
450
+ .ckw-root[data-header=color] .ckw-msgr-hero .ckw-msgr-brand,.ckw-root[data-header=color] .ckw-msgr-hero .ckw-msgr-online{color:color-mix(in srgb,var(--ckw-accent-ink) 82%,transparent)}
451
+ .ckw-root[data-header=color] .ckw-msgr-hero .ckw-msgr-av{background:var(--ckw-accent-ink);color:var(--ckw-accent)}
452
+ .ckw-root[data-header=color] .ckw-msgr-hero+*{margin-top:-58px}
453
+ .ckw-root[data-header=color] .ckw-msgr-card{background:var(--ckw-card);box-shadow:var(--ckw-raise)}
454
+ .ckw-root[data-header=color] button.ckw-msgr-card:hover{background:var(--ckw-card);transform:translateY(-1px)}
455
+ .ckw-root[data-header=color] .ckw-msgr-card-col .ckw-msgr-search{background:var(--ckw-bg2)}
456
+ .ckw-root[data-header=color] .ckw-msgr-card .ckw-msgr-art:hover{background:var(--ckw-bg2)}
457
+ /* Where it sits: a corner, the middle of the top or bottom edge, or the middle of a side; panel and cards open from the launcher */
458
+ .ckw-msgr-fab[data-pos$=left],.ckw-msgr[data-pos$=left],.ckw-msgr-preview[data-pos$=left],.ckw-msgr-teaser[data-pos$=left]{left:20px;right:auto}
459
+ .ckw-msgr-fab[data-pos$=right],.ckw-msgr[data-pos$=right],.ckw-msgr-preview[data-pos$=right],.ckw-msgr-teaser[data-pos$=right]{right:20px;left:auto}
460
+ .ckw-msgr-fab[data-pos$=center],.ckw-msgr[data-pos$=center],.ckw-msgr-preview[data-pos$=center],.ckw-msgr-teaser[data-pos$=center]{left:50%;right:auto;translate:-50% 0}
461
+ .ckw-msgr-fab[data-pos^=top]{top:20px;bottom:auto}
462
+ .ckw-msgr[data-pos^=top],.ckw-msgr-preview[data-pos^=top],.ckw-msgr-teaser[data-pos^=top]{top:92px;bottom:auto}
463
+ .ckw-msgr-fab[data-pos^=middle],.ckw-msgr[data-pos^=middle],.ckw-msgr-preview[data-pos^=middle],.ckw-msgr-teaser[data-pos^=middle]{top:50%;bottom:auto;translate:0 -50%}
464
+ .ckw-msgr[data-pos=middle-left],.ckw-msgr-preview[data-pos=middle-left],.ckw-msgr-teaser[data-pos=middle-left]{left:92px}
465
+ .ckw-msgr[data-pos=middle-right],.ckw-msgr-preview[data-pos=middle-right],.ckw-msgr-teaser[data-pos=middle-right]{right:92px}
466
+ .ckw-msgr[data-pos^=middle]{height:min(680px,calc(100vh - 40px))}
467
+ .ckw-msgr[data-pos=top-right],.ckw-msgr-preview[data-pos=top-right],.ckw-msgr-teaser[data-pos=top-right]{transform-origin:top right}
468
+ .ckw-msgr[data-pos=top-left],.ckw-msgr-preview[data-pos=top-left],.ckw-msgr-teaser[data-pos=top-left]{transform-origin:top left}
469
+ .ckw-msgr[data-pos=top-center],.ckw-msgr-preview[data-pos=top-center],.ckw-msgr-teaser[data-pos=top-center]{transform-origin:top center}
470
+ .ckw-msgr[data-pos=bottom-center],.ckw-msgr-preview[data-pos=bottom-center],.ckw-msgr-teaser[data-pos=bottom-center]{transform-origin:bottom center}
471
+ .ckw-msgr[data-pos=middle-left],.ckw-msgr-preview[data-pos=middle-left],.ckw-msgr-teaser[data-pos=middle-left]{transform-origin:center left}
472
+ .ckw-msgr[data-pos=middle-right],.ckw-msgr-preview[data-pos=middle-right],.ckw-msgr-teaser[data-pos=middle-right]{transform-origin:center right}
473
+ @media (max-width:520px){.ckw-root:not([data-contained]) .ckw-msgr{top:0;translate:none}.ckw-msgr-fab[data-pos$=left]{left:14px}.ckw-msgr-fab[data-pos$=right]{right:14px}.ckw-msgr-fab[data-pos^=top]{top:14px}.ckw-msgr-preview[data-pos^=top],.ckw-msgr-teaser[data-pos^=top]{top:84px}.ckw-msgr-preview[data-pos^=middle],.ckw-msgr-teaser[data-pos^=middle]{top:auto;bottom:20px;left:16px;right:16px;width:auto;translate:none}}
474
+ /* Inside MRRocket's preview: placed in its frame, not the page */
475
+ .ckw-root[data-contained]{position:absolute;inset:0;pointer-events:none;overflow:hidden}
476
+ .ckw-root[data-contained]>*{position:absolute;pointer-events:auto}
477
+ .ckw-root[data-contained] .ckw-msgr{height:min(680px,calc(100% - 112px));max-width:calc(100% - 40px)}
478
+ .ckw-root[data-contained] .ckw-msgr[data-wide]{height:calc(100% - 112px)}
479
+ .ckw-root[data-contained] .ckw-msgr[data-pos^=middle]{height:min(680px,calc(100% - 40px));max-width:calc(100% - 112px)}
480
+ .ckw-root[data-contained] .ckw-msgr-preview[data-pos^=middle],.ckw-root[data-contained] .ckw-msgr-teaser[data-pos^=middle]{max-width:calc(100% - 112px)}
481
+ @media (max-width:520px){.ckw-root:not([data-contained]) .ckw-msgr{width:100%;height:100dvh;bottom:0;border-radius:0;transform-origin:bottom center}.ckw-root:not([data-contained]) .ckw-msgr-x{display:flex}.ckw-msgr-preview,.ckw-msgr-teaser{bottom:84px}}
482
+ @media (prefers-reduced-motion:reduce){.ckw-msgr,.ckw-msgr[data-out],.ckw-msgr-preview,.ckw-msgr-teaser,.ckw-msgr-menu,.ckw-msgr-count,.ckw-msg[data-new],.ckw-msgr-enter>*,.ckw-msgr-enter .ckw-msgr-sugg-b{animation:none}.ckw-msgr-fab,.ckw-msgr-fab-i,.ckw-msgr-tab-ic,.ckw-msgr-tab-ic>.ckw-icon,.ckw-msgr{transition:none}}
483
+ /* The messenger in HeroUI v3's look (heroui.com, its free components): a soft gray ground, white surfaces with a hairline
484
+ shadow, white fields, pill buttons and a pill tab switch, a 2px ring in the accent on focus. Its tokens (--hu-*) map onto
485
+ the widget's own, inside the messenger only, so the other widgets keep theirs. */
486
+ .ckw-root{--hu-bg:#fff;--hu-surface:#f4f4f5;--hu-default:#ececee;--hu-default-hover:#e4e4e7;--hu-segment:#fff;--hu-muted:#71717a;--hu-fg:#18181b;--hu-border:#e4e4e7;--hu-shadow:0 0 0 0 transparent;--hu-lift:0 1px 2px rgba(0,0,0,.08),0 0 1px rgba(0,0,0,.1);--hu-overlay:0 0 0 1px rgba(0,0,0,.05),0 2px 8px rgba(0,0,0,.05),0 18px 40px rgba(0,0,0,.1)}
487
+ .ckw-root[data-theme=dark]{--hu-bg:#111113;--hu-surface:#1c1c1f;--hu-default:#26262a;--hu-default-hover:#2e2e33;--hu-segment:#3a3a40;--hu-muted:#a1a1aa;--hu-fg:#fafafa;--hu-border:#27272a;--hu-shadow:0 0 0 0 transparent;--hu-lift:0 0 0 1px rgba(255,255,255,.06);--hu-overlay:0 0 0 1px rgba(255,255,255,.08),0 18px 40px rgba(0,0,0,.55)}
488
+ @media (prefers-color-scheme:dark){.ckw-root[data-theme=auto]{--hu-bg:#111113;--hu-surface:#1c1c1f;--hu-default:#26262a;--hu-default-hover:#2e2e33;--hu-segment:#3a3a40;--hu-muted:#a1a1aa;--hu-fg:#fafafa;--hu-border:#27272a;--hu-shadow:0 0 0 0 transparent;--hu-lift:0 0 0 1px rgba(255,255,255,.06);--hu-overlay:0 0 0 1px rgba(255,255,255,.08),0 18px 40px rgba(0,0,0,.55)}}
489
+ .ckw-msgr,.ckw-msgr-preview,.ckw-msgr-teaser{--ckw-bg:var(--hu-bg);--ckw-bg2:var(--hu-surface);--ckw-bg3:var(--hu-default);--ckw-card:var(--hu-surface);--ckw-fg:var(--hu-fg);--ckw-fg2:var(--hu-muted);--ckw-fg3:var(--hu-muted);--ckw-line:var(--hu-border);--ckw-soft:var(--hu-overlay);--ckw-raise:var(--hu-shadow)}
490
+ .ckw-root .ckw-msgr-preview-card,.ckw-root .ckw-msgr-teaser{background:var(--hu-surface)}
491
+ .ckw-root .ckw-msgr-card,.ckw-root .ckw-msgr-sugg-b,.ckw-root .ckw-msgr-rate,.ckw-root .ckw-msgr-cite{background:var(--hu-surface);box-shadow:var(--hu-shadow);border:0}
492
+ .ckw-root button.ckw-msgr-card:hover{background:var(--hu-default)}
493
+ .ckw-root .ckw-msgr-card-col{padding:6px}
494
+ .ckw-root .ckw-msgr-card .ckw-msgr-art:hover,.ckw-root .ckw-msgr-hrow:hover{background:var(--hu-default)}
495
+ .ckw-root .ckw-msgr-hrow+.ckw-msgr-hrow{box-shadow:0 -1px 0 var(--hu-border)}
496
+ .ckw-root .ckw-msgr-search,.ckw-root .ckw-msgr-askq,.ckw-root .ckw-msgr-box,.ckw-root .ckw-msgr-compose .ckw-input{background:var(--hu-surface);border:0;box-shadow:var(--hu-shadow)}
497
+ .ckw-root .ckw-msgr-search:focus-within,.ckw-root .ckw-msgr-askq:focus-within,.ckw-root .ckw-msgr-box:focus-within,.ckw-root .ckw-msgr-compose .ckw-input:focus-visible{background:var(--hu-surface);box-shadow:0 0 0 1.5px color-mix(in srgb,var(--ckw-accent) 55%,transparent),0 0 0 5px color-mix(in srgb,var(--ckw-accent) 12%,transparent);color:var(--ckw-fg3)}
498
+ .ckw-root .ckw-msgr-askq{height:48px;border-radius:24px}
499
+ .ckw-root .ckw-msgr-box{border-radius:20px}
500
+ .ckw-root .ckw-msgr-send{border-radius:999px}
501
+ .ckw-root .ckw-msgr-send:disabled{background:var(--hu-default);color:var(--hu-muted)}
502
+ .ckw-root .ckw-msgr-send:not(:disabled):hover{transform:none;filter:brightness(1.08)}
503
+ .ckw-root .ckw-msgr-send:not(:disabled):active{transform:scale(.97)}
504
+ .ckw-root .ckw-bubble{background:var(--hu-surface);box-shadow:var(--hu-shadow)}
505
+ .ckw-root .ckw-msg[data-from=me] .ckw-bubble{box-shadow:none}
506
+ .ckw-root .ckw-msgr-av{background:color-mix(in srgb,var(--ckw-accent) 16%,var(--hu-surface));color:var(--ckw-accent);font-weight:600}
507
+ .ckw-root .ckw-msgr-ib:hover,.ckw-root .ckw-msgr-ib[aria-expanded=true]{background:var(--hu-default)}
508
+ .ckw-root .ckw-msgr-menu{background:var(--hu-surface);box-shadow:var(--hu-overlay);border-radius:16px}
509
+ .ckw-root .ckw-msgr-menu-i{border-radius:10px}
510
+ .ckw-root .ckw-msgr-menu-i:hover,.ckw-root .ckw-msgr-menu-i:focus-visible{background:var(--hu-default)}
511
+ .ckw-root .ckw-msgr .ckw-btn,.ckw-root .ckw-msgr-teaser-b{height:36px;padding:0 16px;border:0;border-radius:999px;background:var(--hu-default);color:var(--hu-fg);font-size:14px;font-weight:500;box-shadow:none;transition:transform .25s cubic-bezier(.32,.72,0,1),background-color .1s linear}
512
+ .ckw-root .ckw-msgr .ckw-btn:hover,.ckw-root .ckw-msgr-teaser-b:hover{background:var(--hu-default-hover);filter:none}
513
+ .ckw-root .ckw-msgr .ckw-btn:active,.ckw-root .ckw-msgr-teaser-b:active{transform:scale(.97)}
514
+ .ckw-root .ckw-msgr .ckw-btn-primary,.ckw-root .ckw-msgr-teaser-b[data-main]{background:var(--ckw-accent);color:var(--ckw-accent-ink)}
515
+ .ckw-root .ckw-msgr .ckw-btn-primary:hover,.ckw-root .ckw-msgr-teaser-b[data-main]:hover{background:var(--ckw-accent);filter:brightness(1.08)}
516
+ .ckw-root .ckw-msgr-sugg-b{border-radius:999px}
517
+ .ckw-root .ckw-msgr-ask{height:40px;border-radius:999px}
518
+ /* Home like Featurebase: the product's icon top left, "Hi, Lukas \u{1F44B}" over the greeting in gray, a silk of the accent
519
+ with drifting dots behind the top right (.ckw-msgr-sky, also drawn by MRRocket's phone preview) */
520
+ .ckw-msgr-logo{display:flex;align-items:center;justify-content:center;width:32px;height:32px;flex:none;margin-left:6px}
521
+ .ckw-msgr-logo img{width:28px;height:28px;border-radius:8px;object-fit:contain}
522
+ .ckw-root .ckw-msgr[data-view=home] .ckw-msgr-bar{padding-top:16px}
523
+ .ckw-root .ckw-msgr[data-view=home] .ckw-msgr-body{position:relative;z-index:1;gap:10px;padding-top:0}
524
+ .ckw-root .ckw-msgr-hero.ckw-msgr-hello{display:flex;flex-direction:column;gap:1px;margin:22px 0 10px;padding:0 4px;font-size:25px;font-weight:600;letter-spacing:-.028em;line-height:1.2;color:var(--hu-fg)}
525
+ .ckw-msgr-hello-sub{color:var(--hu-muted);font-weight:500}
526
+ .ckw-msgr-wave{display:inline-block;transform-origin:70% 75%;animation:ckw-wave 2.4s ease-in-out .6s 1 both}
527
+ @keyframes ckw-wave{0%,60%,100%{transform:none}10%,30%{transform:rotate(14deg)}20%{transform:rotate(-8deg)}40%{transform:rotate(-4deg)}50%{transform:rotate(10deg)}}
528
+ .ckw-root .ckw-msgr[data-view=home] .ckw-msgr-askq{margin:0 0 6px}
529
+ .ckw-msgr-sky{position:absolute;z-index:0;top:0;left:0;right:0;height:250px;pointer-events:none;overflow:hidden;border-radius:inherit;-webkit-mask-image:linear-gradient(to bottom,#000 25%,transparent 92%);mask-image:linear-gradient(to bottom,#000 25%,transparent 92%)}
530
+ .ckw-msgr-sky::before{content:"";position:absolute;top:-45%;right:-25%;width:115%;height:135%;background:radial-gradient(36% 40% at 62% 46%,color-mix(in srgb,var(--ckw-accent) 92%,#fff) 0%,transparent 70%),radial-gradient(32% 36% at 86% 24%,color-mix(in srgb,var(--ckw-glow2,var(--ckw-accent)) 70%,#fff) 0%,transparent 72%),radial-gradient(46% 30% at 36% 64%,color-mix(in srgb,var(--ckw-glow3,var(--ckw-glow2,var(--ckw-accent))) 50%,#fff) 0%,transparent 70%);filter:blur(20px);opacity:.75;animation:ckw-silk 16s cubic-bezier(.45,0,.55,1) infinite alternate}
531
+ @keyframes ckw-silk{to{transform:translate(-7%,5%) rotate(8deg) scale(1.08)}}
532
+ .ckw-msgr-sky::after{content:"";position:absolute;inset:0;background-image:radial-gradient(circle,color-mix(in srgb,var(--ckw-accent) 85%,#fff) .9px,transparent 1.4px);background-size:5px 5px;-webkit-mask-image:linear-gradient(110deg,transparent 0%,#000 18%,transparent 34%,#000 52%,transparent 70%),radial-gradient(70% 85% at 88% 12%,#000 15%,transparent 75%);-webkit-mask-size:220% 100%,100% 100%;-webkit-mask-repeat:repeat-x,no-repeat;-webkit-mask-composite:source-in;mask-image:linear-gradient(110deg,transparent 0%,#000 18%,transparent 34%,#000 52%,transparent 70%),radial-gradient(70% 85% at 88% 12%,#000 15%,transparent 75%);mask-size:220% 100%,100% 100%;mask-repeat:repeat-x,no-repeat;mask-composite:intersect;opacity:.6;animation:ckw-dots 11s linear infinite}
533
+ @keyframes ckw-dots{from{-webkit-mask-position:0 0,0 0;mask-position:0 0,0 0}to{-webkit-mask-position:-220% 0,0 0;mask-position:-220% 0,0 0}}
534
+ .ckw-root[data-theme=dark] .ckw-msgr-sky::before{opacity:.4}
535
+ .ckw-root[data-theme=dark] .ckw-msgr-sky::after{opacity:.4}
536
+ @media (prefers-color-scheme:dark){.ckw-root[data-theme=auto] .ckw-msgr-sky::before{opacity:.4}.ckw-root[data-theme=auto] .ckw-msgr-sky::after{opacity:.4}}
537
+ .ckw-root[data-header=color] .ckw-msgr-sky{display:none}
538
+ @media (prefers-reduced-motion:reduce){.ckw-msgr-sky::before,.ckw-msgr-sky::after,.ckw-msgr-wave{animation:none}}
539
+ /* Home's latest message: one quiet row, the small mark, the words, who and when */
540
+ .ckw-root .ckw-msgr-recent{padding:10px 12px;gap:0}
541
+ .ckw-root .ckw-msgr-recent .ckw-msgr-recent-row{gap:10px}
542
+ .ckw-root .ckw-msgr-recent .ckw-msgr-card-main{gap:1px}
543
+ .ckw-root .ckw-msgr-recent-text{font-size:13.5px;font-weight:500}
544
+ .ckw-root .ckw-msgr-recent .ckw-msgr-card-meta{font-size:11.5px}
545
+ /* The tab switch: HeroUI's Tabs, a gray pill with the current tab on a raised white one */
546
+ .ckw-root .ckw-msgr-tabs{position:relative;z-index:1;margin:2px 12px 8px;padding:4px;gap:0;border-radius:999px;background:var(--hu-surface);box-shadow:none}
547
+ .ckw-root .ckw-msgr-tab{flex-direction:row;justify-content:center;gap:7px;height:36px;padding:0 10px;border-radius:999px;color:var(--hu-muted);font-size:13.5px;font-weight:500;transition:color .15s ease,background-color .15s ease,box-shadow .15s ease,opacity .15s ease}
548
+ .ckw-root .ckw-msgr-tab:not([aria-current=page]):hover{color:var(--hu-muted);opacity:.7}
549
+ .ckw-root .ckw-msgr-tab[aria-current=page]{background:var(--hu-segment);color:var(--hu-fg);box-shadow:var(--hu-lift)}
550
+ .ckw-root .ckw-msgr-tab-ic{width:18px;height:18px}
551
+ .ckw-root .ckw-msgr-tab .ckw-cut{stroke:var(--hu-segment)}
552
+ .ckw-root .ckw-msgr-count-tab{box-shadow:0 0 0 2px var(--hu-default)}
553
+ .ckw-root .ckw-msgr-tab[aria-current=page] .ckw-msgr-count-tab{box-shadow:0 0 0 2px var(--hu-segment)}
554
+ .ckw-root .ckw-msgr-powered{background:var(--hu-bg);padding-top:0}
321
555
  /* Survey */
322
556
  .ckw-survey{position:fixed;z-index:2147483000;left:20px;bottom:20px;width:360px;max-width:calc(100vw - 24px);background:var(--ckw-bg);border:1px solid var(--ckw-line);border-radius:12px;box-shadow:var(--ckw-shadow);padding:14px;animation:ckw-in .2s ease-out}
323
557
  @keyframes ckw-in{from{opacity:0;transform:translateY(8px)}}
@@ -344,5 +578,5 @@ button.ckw-msgr-card:hover{box-shadow:var(--ckw-raise),0 0 0 1px color-mix(in sr
344
578
  .ckw-sv-foot{display:flex;justify-content:space-between;align-items:center;gap:8px;margin-top:12px}
345
579
  .ckw-thanks{text-align:center;padding:14px 0;display:flex;flex-direction:column;align-items:center;gap:8px}
346
580
  .ckw-tick{width:32px;height:32px;border-radius:50%;background:var(--ckw-accent);color:var(--ckw-accent-ink);display:flex;align-items:center;justify-content:center}
347
- `,et=()=>{if(typeof document=="undefined"||document.getElementById(Ze))return;let r=document.createElement("style");r.id=Ze,r.textContent=dt,document.head.appendChild(r);};var gt=4e3,wt=8e3,kt=3e4,xt=10*6e4,mt=/^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/,rt="ckw_msgr_seen",ye={visitor:"You",team:"Team",ai:"AI agent",auto:"Team"},ft=()=>{var r;try{return (r=window.localStorage.getItem(rt))!=null?r:""}catch(a){return ""}},bt=r=>{try{window.localStorage.setItem(rt,r);}catch(a){}},ze=r=>{let a=new Date(r).getTime();if(Number.isNaN(a))return "";let n=Math.max(0,Date.now()-a)/1e3;return n<60?"just now":n<3600?`${Math.floor(n/60)}m ago`:n<86400?`${Math.floor(n/3600)}h ago`:n<86400*30?`${Math.floor(n/86400)}d ago`:new Date(r).toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})},t=(r,a={},...n)=>{let p=document.createElement(r);for(let[i,s]of Object.entries(a))p.setAttribute(i,s);for(let i of n)i!==null&&i!==false&&i!==void 0&&p.append(i);return p},tt="http://www.w3.org/2000/svg",z=(r,a=16)=>{let n=document.createElementNS(tt,"svg");for(let[i,s]of Object.entries({class:"ckw-icon",width:String(a),height:String(a),viewBox:"0 0 16 16",fill:"none",stroke:"currentColor","stroke-width":"1.7","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"}))n.setAttribute(i,s);let p=document.createElementNS(tt,"path");return p.setAttribute("d",r),n.appendChild(p),n},h={cross:"m4 4 8 8M12 4l-8 8",chat:"M2.5 4.5a2 2 0 0 1 2-2h7a2 2 0 0 1 2 2v4.5a2 2 0 0 1-2 2H7l-3 2.5V11a2 2 0 0 1-1.5-2z",send:"M2.5 8h10M8.5 3.5 13 8l-4.5 4.5",up:"M8 13V3M3.5 7.5 8 3l4.5 4.5",home:"M2.5 7 8 2.5 13.5 7v6a1 1 0 0 1-1 1h-3v-4h-3v4h-3a1 1 0 0 1-1-1z",help:"M8 14.5A6.5 6.5 0 1 0 8 1.5a6.5 6.5 0 0 0 0 13zM6.2 6.2a1.9 1.9 0 1 1 2.6 1.8c-.5.2-.8.6-.8 1.1v.4M8 11.6v.1",back:"M10 3.5 5.5 8l4.5 4.5",next:"M6 3.5 10.5 8 6 12.5",search:"M7 11.5a4.5 4.5 0 1 0 0-9 4.5 4.5 0 0 0 0 9zM10.5 10.5l3 3",doc:"M4 1.5h5.5l3 3V14a.5.5 0 0 1-.5.5H4a.5.5 0 0 1-.5-.5V2a.5.5 0 0 1 .5-.5zM9.5 1.5v3h3M6 8.5h4M6 11h4"},ie=(()=>{let r=null,a=()=>{var p;let n=(p=window.AudioContext)!=null?p:window.webkitAudioContext;return n?(r!=null||(r=new n),r):null};return {unlock:()=>{try{let n=a();(n==null?void 0:n.state)==="suspended"&&n.resume();}catch(n){}},play:()=>{try{let n=a();if(!n||n.state!=="running")return;let p=n.currentTime;[880,1318.5].forEach((i,s)=>{let x=n.createOscillator(),M=n.createGain(),g=p+s*.11;x.type="sine",x.frequency.value=i,M.gain.setValueAtTime(1e-4,g),M.gain.exponentialRampToValueAtTime(.12,g+.012),M.gain.exponentialRampToValueAtTime(1e-4,g+.32),x.connect(M),M.connect(n.destination),x.start(g),x.stop(g+.34);});}catch(n){}}}})(),ce=r=>r.map(a=>{let n=a.href?t("a",{href:a.href,target:"_blank",rel:"noopener noreferrer"},a.text):t("span",{},a.text);return a.code&&(n=t("code",{},n)),a.italic&&(n=t("em",{},n)),a.bold&&(n=t("strong",{},n)),n}),ut=r=>{switch(r.type){case "h2":case "h3":return t(r.type,{},...ce(r.spans));case "quote":return t("blockquote",{},...ce(r.spans));case "ul":case "ol":return t(r.type,{},...r.items.map(a=>t("li",{},...ce(a))));case "code":return t("pre",{},t("code",{},r.text));case "hr":return t("hr");default:return t("p",{},...ce(r.spans))}},ht=2500,at=r=>{let a=null,n=false,p=[],i=g=>a?g(a):p.push(g),s=new AbortController,x=g=>{var Y,G;if(a||n)return;let $=Object.fromEntries(Object.entries(r).filter(([,I])=>I!==void 0));a=vt({...g!=null?g:{},...$,accent:(Y=r.accent)!=null?Y:g==null?void 0:g.accent,theme:(G=r.theme)!=null?G:g==null?void 0:g.theme});for(let I of p.splice(0))I(a);},M=setTimeout(()=>x(null),ht);return ve({host:r.host,apiKey:r.apiKey,distinctId:r.distinctId(),user:r.user()}).messengerLook(s.signal).then(g=>x(g)).catch(()=>x(null)).finally(()=>clearTimeout(M)),{open:g=>i($=>$.open(g)),close:()=>a==null?void 0:a.close(),toggle:()=>i(g=>g.toggle()),destroy:()=>{n=true,s.abort(),clearTimeout(M),a==null||a.destroy();}}},vt=r=>{var Fe,_e,qe,Ne,De,Ue,Be,Ve,We;et();let a=(Fe=r.position)!=null?Fe:"bottom-right",n=r.title||"Chat with us",p=r.greeting||"Hi! How can we help?",i=(_e=r.askEmail)!=null?_e:true,s=(qe=r.label)!=null?qe:"",x=Je(r.replyTime),M=((Ne=n.trim()[0])!=null?Ne:"?").toUpperCase(),g=(De=r.launcher)!=null?De:true,$=(Ue=r.help)!=null?Ue:true,Y=(Be=r.sound)!=null?Be:true,G=(Ve=r.preview)!=null?Ve:true,I=()=>ve({host:r.host,apiKey:r.apiKey,distinctId:r.distinctId(),user:r.user()}),P=t("div",{class:"ckw-root","data-theme":(We=r.theme)!=null?We:"auto"});r.accent&&(P.style.setProperty("--ckw-accent",r.accent),P.style.setProperty("--ckw-accent-ink",Xe(r.accent))),document.body.appendChild(P);let b=false,m="home",w=null,Ce=false,H="",A=null,se=null,u=[],Q=false,J,O=null,v=null,E="",pe=new Set,le=null,Se=e=>{var o;return ((o=e==null?void 0:e.messages)!=null?o:[]).filter(c=>c.from!=="visitor")},Me=e=>{var o,c;return (c=(o=Se(e).at(-1))==null?void 0:o.id)!=null?c:""},de=()=>b&&m==="messages"&&document.visibilityState!=="hidden",Ae=e=>{let o=Se(e);if(se===null){let c=ft(),l=o.findIndex(d=>d.id===c);u=e.messages.some(d=>d.from==="visitor")?o.slice(l+1).filter(d=>d.from!=="auto"):[];}else {let c=o.findIndex(d=>d.id===se),l=o.slice(c+1).filter(d=>d.from!=="auto");l.length&&(Y&&ie.play(),de()||(u=[...u,...l],Q=false));}se=Me(e),w=e,de()&&ge();},ge=()=>{u=[];let e=Me(w);e&&bt(e);},X=e=>t("span",{class:`ckw-msgr-av${e?" ckw-msgr-av-sm":""}`,"aria-hidden":"true"},M),R=t("button",{type:"button",class:`ckw-fab ckw-msgr-fab${s?"":" ckw-msgr-round"}`,"data-pos":a,"aria-haspopup":"dialog"}),Z=t("div",{class:"ckw-msgr-preview","data-pos":a,role:"status"}),we=null,U=()=>{let e=z(b?h.cross:h.chat,s?18:24);we!==null&&we!==b&&e.classList.add("ckw-turn"),we=b,R.replaceChildren(e),s&&R.append(t("span",{},s)),u.length&&!b&&R.append(t("span",{class:"ckw-msgr-count","aria-hidden":"true"},String(Math.min(u.length,9)))),R.setAttribute("aria-expanded",String(b)),R.setAttribute("aria-label",b?"Close chat":u.length?`Open chat, ${u.length} new ${u.length===1?"reply":"replies"}`:"Open chat"),Ee();},Ee=()=>{let e=u.at(-1);if(!G||b||Q||!e||!g)return Z.remove();let o=t("button",{type:"button",class:"ckw-msgr-preview-x","aria-label":"Dismiss"},z(h.cross,12));o.addEventListener("click",l=>{l.stopPropagation(),Q=true,Ee();});let c=t("button",{type:"button",class:"ckw-msgr-preview-card"},X(),t("span",{class:"ckw-msgr-preview-main"},t("span",{class:"ckw-msgr-preview-who"},`${ye[e.from]}${u.length>1?` \xB7 ${u.length} new`:""}`),t("span",{class:"ckw-msgr-preview-text"},e.body)));c.addEventListener("click",()=>ne("messages")),Z.replaceChildren(c,o),Z.isConnected||P.appendChild(Z);};R.addEventListener("click",()=>{ie.unlock(),b?W():ne(u.length?"messages":"home");}),g&&P.appendChild(R);let K=t("div",{class:"ckw-pop ckw-msgr","data-pos":a,role:"dialog","aria-label":n}),B=t("div",{class:"ckw-pop-head ckw-msgr-head"}),y=t("div",{class:"ckw-pop-body ckw-msgr-body"}),Te=t("nav",{class:"ckw-msgr-tabs","aria-label":"Messenger"});K.addEventListener("click",()=>ie.unlock());let V=t("form",{class:"ckw-msgr-compose"}),ee=t("p",{class:"ckw-msgr-error",role:"alert"}),T=t("input",{class:"ckw-input",type:"email",inputmode:"email",autocomplete:"email",placeholder:"Your email (optional), so we can follow up","aria-label":"Your email (optional)",maxlength:"200"}),ke=t("div",{class:"ckw-msgr-row"}),j=t("textarea",{class:"ckw-textarea ckw-msgr-input",rows:"1",placeholder:"Write a message\u2026","aria-label":"Message",maxlength:"4000"}),xe=t("button",{type:"submit",class:"ckw-msgr-send","aria-label":"Send"},z(h.up));ke.append(j,xe),V.append(ke);let Le=t("ol",{class:"ckw-msgs","aria-live":"polite","aria-label":"Messages"}),$e=()=>{var e;return i&&!((e=r.user())!=null&&e.email)&&!(w!=null&&w.hasEmail)},me=()=>!T.value.trim()||mt.test(T.value.trim()),Ie=()=>!!j.value.trim()&&!A&&me(),te=()=>{let e=t("button",{type:"button",class:"ckw-btn ckw-btn-ghost ckw-msgr-x","aria-label":"Close messenger"},z(h.cross));return e.addEventListener("click",()=>W()),e},C=e=>{m=e,ae=-1,F(),e==="messages"?(ge(),U(),j.focus()):e==="help"&&be.focus(),N(0);},je=(e,o=false)=>{var l;let c=t("li",{class:"ckw-msg","data-from":e.from==="visitor"?"me":"them"},t("div",{class:"ckw-bubble"},e.body));o&&c.setAttribute("aria-busy","true");for(let d of (l=e.articles)!=null?l:[]){let k=t("button",{type:"button",class:"ckw-msgr-cite"},z(h.doc,14),t("span",{},d.title));k.addEventListener("click",()=>C({article:d.id})),c.append(k);}return c.append(t("span",{class:"ckw-msg-meta"},`${e.from!=="visitor"?`${ye[e.from]} \xB7 `:""}${o?"Sending\u2026":ze(e.at)}`)),c},fe=e=>{let o=t("button",{type:"button",class:"ckw-msgr-art"},t("span",{class:"ckw-msgr-art-t"},e.title),z(h.next,14));return o.addEventListener("click",()=>C({article:e.id})),o},Oe=()=>{let e=t("label",{class:"ckw-msgr-search"}),o=t("input",{class:"ckw-msgr-search-in",type:"search",placeholder:"Search for help","aria-label":"Search for help",maxlength:"200"});o.value=E;let c;return o.addEventListener("input",()=>{E=o.value,clearTimeout(c),c=setTimeout(()=>{if(m!=="help")return C("help");he(true);},250);}),o.addEventListener("keydown",l=>{l.key==="Enter"&&(l.preventDefault(),m!=="help"&&C("help"));}),e.append(o,z(h.search,16)),e},re=Oe(),be=re.querySelector("input"),ue=false,he=async(e=false)=>{if(!$||ue&&!e)return;ue=true;let o=E.trim();try{let c=await I().articles(o||void 0);if(o!==E.trim())return;v=c.articles,o||(le=c.articles.length>0);}catch(c){v=v!=null?v:[];}finally{ue=false;}F();},nt=()=>{var d;B.replaceChildren(t("span",{class:"ckw-msgr-brand"},X("sm"),t("span",{},n)),te());let e=t("div",{class:"ckw-msgr-hero"},t("p",{class:"ckw-msgr-hello"},p)),o=((d=w==null?void 0:w.messages)!=null?d:[]).at(-1),c=[e];if(o){let k=t("button",{type:"button",class:"ckw-msgr-card ckw-msgr-recent"},t("span",{class:"ckw-msgr-card-label"},"Recent message"),t("span",{class:"ckw-msgr-recent-row"},X(),t("span",{class:"ckw-msgr-card-main"},t("span",{class:"ckw-msgr-card-sub ckw-msgr-recent-text"},o.body),t("span",{class:"ckw-msgr-card-meta"},`${o.from==="visitor"?"You":ye[o.from]} \xB7 ${ze(o.at)}`)),u.length?t("span",{class:"ckw-msgr-badge"},String(u.length)):z(h.next,14)));k.addEventListener("click",()=>C("messages")),c.push(k);}let l=t("button",{type:"button",class:"ckw-msgr-card"},t("span",{class:"ckw-msgr-card-main"},t("b",{},"Send us a message"),t("span",{class:"ckw-msgr-card-sub"},x)),t("span",{class:"ckw-msgr-go"},z(h.send)));if(l.addEventListener("click",()=>C("messages")),c.push(l),$&&le!==false){let k=t("div",{class:"ckw-msgr-card ckw-msgr-card-col"},Oe()),f=(v!=null?v:[]).slice(0,4);f.length?k.append(...f.map(fe)):v===null&&k.append(t("div",{class:"ckw-skel ckw-msgr-skel"})),c.push(k);}y.replaceChildren(...c);},ot=()=>{var o;B.replaceChildren(t("span",{},"Help"),te()),be.value!==E&&(be.value=E);let e=[re];if(v===null)e.push(t("div",{class:"ckw-skel"}));else if(v.length)if(E.trim())e.push(t("div",{class:"ckw-msgr-card ckw-msgr-card-col"},...v.map(fe)));else {let c=new Map;for(let l of v)c.set(l.collection,[...(o=c.get(l.collection))!=null?o:[],l]);for(let[l,d]of c)e.push(t("section",{class:"ckw-msgr-group"},t("h3",{class:"ckw-msgr-group-h"},`${l} \xB7 ${d.length}`),t("div",{class:"ckw-msgr-card ckw-msgr-card-col"},...d.map(fe))));}else {let c=t("button",{type:"button",class:"ckw-btn ckw-btn-primary"},"Send us a message");c.addEventListener("click",()=>C("messages")),e.push(t("div",{class:"ckw-msgr-empty"},t("p",{},E.trim()?`Nothing found for \u201C${E.trim()}\u201D.`:"No help articles yet."),c));}for(y.firstChild!==re&&y.replaceChildren(re);y.childNodes.length>1;)y.lastChild.remove();y.append(...e.slice(1));},q=null,it=e=>{let o=t("button",{type:"button",class:"ckw-btn ckw-btn-ghost ckw-msgr-x","aria-label":"Back to help"},z(h.back));if(o.addEventListener("click",()=>C("help")),B.replaceChildren(o,t("span",{class:"ckw-msgr-head-t"},"Help"),te()),(q==null?void 0:q.id)===e)return y.replaceChildren(q.node);let c=t("article",{class:"ckw-msgr-doc"},t("div",{class:"ckw-skel"}));q={id:e,node:c},y.replaceChildren(c),I().article(e).then(l=>{let d=t("div",{class:"ckw-msgr-rate"}),k=()=>{if(pe.has(e))return d.replaceChildren(t("span",{},"Thanks for letting us know."));let _=t("button",{type:"button",class:"ckw-btn"},"Yes"),D=t("button",{type:"button",class:"ckw-btn"},"No"),Ye=Ge=>{pe=new Set(pe).add(e),k(),I().rateArticle(e,Ge).catch(()=>{}),Ge||C("messages");};_.addEventListener("click",()=>Ye(true)),D.addEventListener("click",()=>Ye(false)),d.replaceChildren(t("span",{},"Did this answer your question?"),t("span",{class:"ckw-msgr-rate-b"},_,D));};k();let f=t("button",{type:"button",class:"ckw-btn ckw-msgr-ask"},z(h.chat),"Still need help? Send us a message");f.addEventListener("click",()=>C("messages")),c.replaceChildren(t("p",{class:"ckw-msgr-doc-c"},l.collection),t("h2",{class:"ckw-msgr-doc-t"},l.title),t("p",{class:"ckw-msgr-doc-c"},`Updated ${ze(l.updatedAt)}`),t("div",{class:"ckw-msgr-doc-b"},...l.blocks.map(ut)),d,f);}).catch(l=>{q=null,c.replaceChildren(t("p",{class:"ckw-msgr-error"},l.message));});},ae=-1,Re="",ct=()=>{var l,d;B.replaceChildren(t("span",{class:"ckw-msgr-who"},X(),t("span",{class:"ckw-msgr-who-t"},t("b",{},n),t("span",{},x))),te());let e=(l=w==null?void 0:w.messages)!=null?l:[],o=[];if(!Ce)o.push(t("div",{class:"ckw-skel"}));else {let k=`${e.map(f=>f.id).join(",")}|${A?A.body:""}|${Math.floor(Date.now()/6e4)}`;if(k!==Re){Re=k;let f=t("li",{class:"ckw-msg","data-from":"them"},t("div",{class:"ckw-bubble"},p));Le.replaceChildren(f,...e.map(_=>je(_)),...A?[je(A,true)]:[]);}o.push(Le);}((d=w==null?void 0:w.conversation)==null?void 0:d.status)==="solved"&&!A&&o.push(t("p",{class:"ckw-fine ckw-msgr-note"},"This conversation is closed. Write to start a new one.")),(y.childNodes.length!==o.length||o.some((k,f)=>y.childNodes[f]!==k))&&y.replaceChildren(...o);let c=e.length+(A?1:0);c!==ae&&(ae=c,y.scrollTop=y.scrollHeight),ee.textContent=H,H&&!ee.isConnected?V.prepend(ee):H||ee.remove(),$e()?(me()?T.removeAttribute("aria-invalid"):T.setAttribute("aria-invalid","true"),T.isConnected||V.insertBefore(T,ke)):T.remove(),xe.disabled=!Ie();},st=()=>{let e=typeof m=="string"?m:"help",o=(c,l,d,k=0)=>{let f=t("button",{type:"button",class:"ckw-msgr-tab","aria-current":e===c?"page":"false"},z(d,18),t("span",{},l));return k&&f.append(t("span",{class:"ckw-msgr-count ckw-msgr-count-tab"},String(Math.min(k,9)))),f.addEventListener("click",()=>C(c)),f};Te.replaceChildren(o("home","Home",h.home),o("messages","Messages",h.chat,m==="messages"?0:u.length),...$&&le!==false?[o("help","Help",h.help)]:[]);},F=()=>{if(!b)return;K.dataset.view=typeof m=="string"?m:"article",m==="home"?nt():m==="messages"?ct():m==="help"?ot():it(m.article);let e=[B,y];m==="messages"&&e.push(V),e.push(Te),st(),(K.childNodes.length!==e.length||e.some((o,c)=>K.childNodes[c]!==o))&&K.replaceChildren(...e);},Ke=async()=>{O==null||O.abort(),O=new AbortController;try{Ae(await I().chat(O.signal)),H="";}catch(e){if(e.name==="AbortError")return;b&&m==="messages"&&(H=e.message);}Ce=true,F(),U(),N();};function N(e){var k,f,_;clearTimeout(J);let o=!!(w!=null&&w.messages.some(D=>D.from==="visitor"))&&((k=w==null?void 0:w.conversation)==null?void 0:k.status)!=="solved",c=(_=((f=w==null?void 0:w.messages)!=null?f:[]).filter(D=>D.from==="visitor").at(-1))==null?void 0:_.at,l=!!c&&Date.now()-new Date(c).getTime()<xt,d=e!=null?e:de()?gt:o&&l?wt:b||o?kt:0;(d||e===0)&&(J=setTimeout(()=>{Ke();},d));}document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"?N(0):clearTimeout(J);});let Pe=async()=>{let e=j.value.trim();if(!(!e||A||!me())){ie.unlock(),A={id:"pending",from:"visitor",body:e,at:new Date().toISOString()},j.value="",H="",F();try{Ae(await I().sendChat({body:e,email:$e()&&T.value.trim()?T.value.trim():void 0,url:window.location.href.slice(0,500)}));}catch(o){j.value=e,H=o.message;}A=null,F(),N();}};V.addEventListener("submit",e=>{e.preventDefault(),Pe();}),j.addEventListener("keydown",e=>{e.key==="Enter"&&!e.shiftKey&&!e.isComposing&&(e.preventDefault(),Pe());}),j.addEventListener("input",()=>xe.disabled=!Ie()),T.addEventListener("input",()=>F());function ne(e="home"){b=true,m=e==="help"&&!$?"home":e,ae=-1,Q=true,K.isConnected||P.appendChild(K),(v===null||m==="help"&&E)&&he(),F(),U(),m==="messages"&&(ge(),j.focus()),N(0);}function W(){b&&(b=false,K.remove(),U(),N(),g&&R.focus());}let He=e=>{e.key==="Escape"&&b&&W();};return document.addEventListener("keydown",He),Ke(),$&&he(),U(),{open:e=>ne(e!=null?e:"home"),close:W,toggle:()=>b?W():ne(),destroy:()=>{clearTimeout(J),O==null||O.abort(),document.removeEventListener("keydown",He),P.remove();}}};window.__mrrocketMessenger={mountMessenger:at};
581
+ `,er=()=>{if(typeof document=="undefined"||document.getElementById(Zt))return;let a=document.createElement("style");a.id=Zt,a.textContent=vr,document.head.appendChild(a);};var yr=4e3,zr=8e3,Mr=3e4,Cr=10*6e4,Er=/^[^\s@]+@[^\s@]+\.[^\s@]{2,}$/,or="ckw_msgr_seen",pt={visitor:"You",team:"Team",ai:"AI agent",auto:"Team"},Ar=()=>{var a;try{return (a=window.localStorage.getItem(or))!=null?a:""}catch(n){return ""}},Sr=a=>{try{window.localStorage.setItem(or,a);}catch(n){}},gt=a=>{let n=new Date(a).getTime();if(Number.isNaN(n))return "";let c=Math.max(0,Date.now()-n)/1e3;return c<60?"just now":c<3600?`${Math.floor(c/60)}m ago`:c<86400?`${Math.floor(c/3600)}h ago`:c<86400*30?`${Math.floor(c/86400)}d ago`:new Date(a).toLocaleDateString(void 0,{month:"short",day:"numeric",year:"numeric"})},t=(a,n={},...c)=>{let g=document.createElement(a);for(let[s,d]of Object.entries(n))g.setAttribute(s,d);for(let s of c)s!==null&&s!==false&&s!==void 0&&g.append(s);return g},he="http://www.w3.org/2000/svg",z=(a,n=16)=>{let c=document.createElementNS(he,"svg");for(let[s,d]of Object.entries({class:"ckw-icon",width:String(n),height:String(n),viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"1.75","stroke-linecap":"round","stroke-linejoin":"round","aria-hidden":"true"}))c.setAttribute(s,d);let g=document.createElementNS(he,"path");return g.setAttribute("d",a),c.appendChild(g),c},u={cross:"M18 6 6 18M6 6l12 12",chat:"M7.9 20A9 9 0 1 0 4 16.1L2 22z",up:"M12 19V5M5 12l7-7 7 7",home:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",back:"m15 18-6-6 6-6",next:"m9 18 6-6-6-6",search:"M19 11a8 8 0 1 1-16 0 8 8 0 0 1 16 0zM21 21l-4.3-4.3",doc:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7zM14 2v4a2 2 0 0 0 2 2h4M10 9H8M16 13H8M16 17H8",dots:"M13 12a1 1 0 1 1-2 0 1 1 0 0 1 2 0zM13 5a1 1 0 1 1-2 0 1 1 0 0 1 2 0zM13 19a1 1 0 1 1-2 0 1 1 0 0 1 2 0z",expand:"M15 3h6v6M21 3l-7 7M3 21l7-7M9 21H3v-6",collapse:"m14 10 7-7M20 10h-6V4M3 21l7-7M4 14h6v6",minus:"M5 12h14",down:"m6 9 6 6 6-6",help:"M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20zM9.1 9a3 3 0 0 1 5.8 1c0 2-3 3-3 3M12 17h.01",clip:"m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l8.57-8.57A4 4 0 1 1 18 8.84l-8.59 8.57a2 2 0 0 1-2.83-2.83l8.49-8.48",image:"M19 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2zM9 11a2 2 0 1 0 0-4 2 2 0 0 0 0 4zM21 15l-3.09-3.09a2 2 0 0 0-2.82 0L6 21",screen:"M20 3H4a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2zM8 21h8M12 17v4"},wt=a=>{var n,c;return a.body||(((n=a.attachments)==null?void 0:n.length)===1?`Sent ${a.attachments[0].name}`:(c=a.attachments)!=null&&c.length?`Sent ${a.attachments.length} files`:"")},Tr=()=>{var a;return typeof navigator!="undefined"&&typeof((a=navigator.mediaDevices)==null?void 0:a.getDisplayMedia)=="function"},tr="M7.9 20A9 9 0 1 0 4 16.1L2 22z",Lr=(a,n)=>{let c=document.createElementNS(he,"svg");for(let[s,d]of Object.entries({class:"ckw-icon",width:String(n),height:String(n),viewBox:"0 0 24 24",fill:"currentColor",stroke:"currentColor","stroke-width":"1.5","stroke-linejoin":"round","aria-hidden":"true"}))c.setAttribute(s,d);let g=document.createElementNS(he,"path");return g.setAttribute("d",a),c.appendChild(g),c},rr=(a,n,c,g=2)=>{let s=Lr(a,c),d=document.createElementNS(he,"path");for(let[b,H]of Object.entries({d:n,class:"ckw-cut",fill:"none","stroke-width":String(g),"stroke-linecap":"round","stroke-linejoin":"round"}))d.setAttribute(b,H);return s.appendChild(d),s},ar="M8 12h.01M12 12h.01M16 12h.01",$r="M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",Ir="M9.5 15.5c1.4 1 3.6 1 5 0",jr="M12 22a10 10 0 1 0 0-20 10 10 0 0 0 0 20z",Hr="M9.4 9.2a2.7 2.7 0 0 1 5.2 1c0 1.8-2.6 2.5-2.6 2.5M12 16.8h.01",ue=(()=>{let a=null,n=()=>{var g;let c=(g=window.AudioContext)!=null?g:window.webkitAudioContext;return c?(a!=null||(a=new c),a):null};return {unlock:()=>{try{let c=n();(c==null?void 0:c.state)==="suspended"&&c.resume();}catch(c){}},play:()=>{try{let c=n();if(!c||c.state!=="running")return;let g=c.currentTime;[880,1318.5].forEach((s,d)=>{let b=c.createOscillator(),H=c.createGain(),$=g+d*.11;b.type="sine",b.frequency.value=s,H.gain.setValueAtTime(1e-4,$),H.gain.exponentialRampToValueAtTime(.12,$+.012),H.gain.exponentialRampToValueAtTime(1e-4,$+.32),b.connect(H),H.connect(c.destination),b.start($),b.stop($+.34);});}catch(c){}}}})(),He=a=>a.map(n=>{let c=n.href?t("a",{href:n.href,target:"_blank",rel:"noopener noreferrer"},n.text):t("span",{},n.text);return n.code&&(c=t("code",{},c)),n.italic&&(c=t("em",{},c)),n.bold&&(c=t("strong",{},c)),c}),Pr=a=>{switch(a.type){case "h2":case "h3":return t(a.type,{},...He(a.spans));case "quote":return t("blockquote",{},...He(a.spans));case "ul":case "ol":return t(a.type,{},...a.items.map(n=>t("li",{},...He(n))));case "code":return t("pre",{},t("code",{},a.text));case "hr":return t("hr");default:return t("p",{},...He(a.spans))}},Rr=2500,nr=a=>{var $;let n=null,c=false,g=[],s=f=>n?f(n):g.push(f),d=new AbortController,b=f=>{var xe,_,I;if(n||c)return;let ie=Object.fromEntries(Object.entries(a).filter(([,v])=>v!==void 0));n=Or({...f!=null?f:{},...ie,accent:(xe=a.accent)!=null?xe:f==null?void 0:f.accent,theme:(_=a.theme)!=null?_:f==null?void 0:f.theme,branding:(I=f==null?void 0:f.branding)!=null?I:true});for(let v of g.splice(0))v(n);},H=setTimeout(()=>b(null),Rr);return (($=a.client)!=null?$:dt({host:a.host,apiKey:a.apiKey,distinctId:a.distinctId(),user:a.user()})).messengerLook(d.signal).then(f=>b(f)).catch(()=>b(null)).finally(()=>clearTimeout(H)),{open:f=>s(ie=>ie.open(f)),close:()=>n==null?void 0:n.close(),toggle:()=>s(f=>f.toggle()),destroy:()=>{c=true,d.abort(),clearTimeout(H),n==null||n.destroy();}}},Fr=["top-left","top-center","top-right","middle-left","middle-right","bottom-left","bottom-center","bottom-right"],Or=a=>{var Ft,Ot,qt,_t,Ut,Bt,Dt,Nt,Kt,Vt,Yt;er();let n=(Ft=Fr.find(e=>e===a.position))!=null?Ft:"bottom-right",c=a.title||"Support",g=a.greeting||"Hi! How can we help?",s=(Ot=a.askEmail)!=null?Ot:true,d=(qt=a.label)!=null?qt:"",b=Xt(a.replyTime),H=((_t=c.trim()[0])!=null?_t:"?").toUpperCase(),$=(Ut=a.launcher)!=null?Ut:true,f=(Bt=a.help)!=null?Bt:true,ie=(Dt=a.sound)!=null?Dt:true,xe=(Nt=a.preview)!=null?Nt:true,_=()=>{var e;return (e=a.client)!=null?e:dt({host:a.host,apiKey:a.apiKey,distinctId:a.distinctId(),user:a.user()})},I=t("div",{class:"ckw-root","data-theme":(Kt=a.theme)!=null?Kt:"auto","data-corners":a.corners==="soft"||a.corners==="square"?a.corners:"round","data-font":a.font==="system"?"system":"site","data-header":a.header==="color"?"color":"plain"});a.container&&I.setAttribute("data-contained",""),a.accent&&(I.style.setProperty("--ckw-accent",a.accent),I.style.setProperty("--ckw-accent-ink",Jt(a.accent))),(Vt=a.glow)==null||Vt.slice(0,2).forEach((e,r)=>/^#[0-9a-f]{6}$/i.test(e)&&I.style.setProperty(`--ckw-glow${r+2}`,e)),((Yt=a.container)!=null?Yt:document.body).appendChild(I);let v=false,m="home",x=null,kt=false,T="",P=null,Pe=null,E=[],ve=false,ye,V=null,S=null,D="",Re=new Set,ze=null,N=null,se=false,mt=e=>{var r;return ((r=e==null?void 0:e.messages)!=null?r:[]).filter(o=>o.from!=="visitor")},ft=e=>{var r,o;return (o=(r=mt(e).at(-1))==null?void 0:r.id)!=null?o:""},Fe=()=>v&&m==="messages"&&document.visibilityState!=="hidden",bt=e=>{let r=mt(e);if(Pe===null){let o=Ar(),l=r.findIndex(i=>i.id===o);E=e.messages.some(i=>i.from==="visitor")?r.slice(l+1).filter(i=>i.from!=="auto"):[];}else {let o=r.findIndex(i=>i.id===Pe),l=r.slice(o+1).filter(i=>i.from!=="auto");l.length&&(ie&&ue.play(),Fe()||(E=[...E,...l],ve=false));}Pe=ft(e),x=e,Fe()&&Oe();},Oe=()=>{E=[];let e=ft(x);e&&Sr(e);},ce=e=>t("span",{class:`ckw-msgr-av${e?" ckw-msgr-av-sm":""}`,"aria-hidden":"true"},H),Me=t("span",{class:"ckw-msgr-logo","aria-hidden":"true"});if(a.logo){let e=t("img",{src:a.logo,alt:""});e.addEventListener("error",()=>Me.replaceChildren(ce("sm"))),Me.append(e);}else Me.append(ce("sm"));let ir=t("div",{class:"ckw-msgr-sky","aria-hidden":"true"}),G=new Map,le=(e,r=I)=>{clearTimeout(G.get(e)),G.delete(e),e.removeAttribute("data-out"),e.isConnected||r.appendChild(e);},Q=(e,r=180)=>{!e.isConnected||G.has(e)||(e.setAttribute("data-out",""),G.set(e,setTimeout(()=>{G.delete(e),e.removeAttribute("data-out"),e.remove();},r)));},qe=(e,r)=>{e.classList.remove(r),e.offsetWidth,e.classList.add(r);},O=t("button",{type:"button",class:`ckw-fab ckw-msgr-fab${d?"":" ckw-msgr-round"}`,"data-pos":n,"aria-haspopup":"dialog"}),sr=t("span",{class:"ckw-msgr-fab-ic","aria-hidden":"true"},t("span",{class:"ckw-msgr-fab-i","data-i":"chat"},rr(tr,ar,d?20:27,2.6)),t("span",{class:"ckw-msgr-fab-i","data-i":"x"},z(u.down,d?18:24))),de=t("span",{class:"ckw-msgr-count","aria-hidden":"true"});O.append(sr),d&&O.append(t("span",{},d));let _e=t("div",{class:"ckw-msgr-preview","data-pos":n,role:"status"}),pe=()=>{if(O.toggleAttribute("data-open",v),E.length&&!v){let e=String(Math.min(E.length,9));de.textContent!==e&&(de.textContent=e),de.isConnected||O.append(de);}else de.remove();O.setAttribute("aria-expanded",String(v)),O.setAttribute("aria-label",v?"Close chat":E.length?`Open chat, ${E.length} new ${E.length===1?"reply":"replies"}`:"Open chat"),ht();},ut=()=>xe&&!v&&!ve&&!!E.length&&$,ht=()=>{let e=E.at(-1);if(!ut()||!e)return Q(_e);Ce(true);let r=t("button",{type:"button",class:"ckw-msgr-preview-x","aria-label":"Dismiss"},z(u.cross,14));r.addEventListener("click",l=>{l.stopPropagation(),ve=true,ht();});let o=t("button",{type:"button",class:"ckw-msgr-preview-card"},t("span",{class:"ckw-msgr-preview-main"},t("span",{class:"ckw-msgr-preview-who"},`${pt[e.from]}${E.length>1?` \xB7 ${E.length} new`:""}`),t("span",{class:"ckw-msgr-preview-text"},wt(e))));o.addEventListener("click",()=>W("messages")),_e.replaceChildren(o,r),le(_e);},ge=t("div",{class:"ckw-msgr-teaser","data-pos":n}),we,cr=()=>{if(clearTimeout(we),v||ut()||!$)return;let e=t("button",{type:"button",class:"ckw-msgr-teaser-b","data-main":""},z(u.chat),t("span",{},"Chat"));e.addEventListener("click",()=>W("messages"));let r=[e];if(f&&ze){let o=t("button",{type:"button",class:"ckw-msgr-teaser-b"},z(u.search),t("span",{},"Search"));o.addEventListener("click",()=>W("help")),r.push(o);}ge.replaceChildren(t("div",{class:"ckw-msgr-teaser-top"},t("span",{class:"ckw-msgr-teaser-t"},t("b",{},g),t("span",{class:"ckw-msgr-online"},b)),ce()),t("div",{class:"ckw-msgr-teaser-row"},...r)),le(ge);};function Ce(e=false){if(clearTimeout(we),e)return Q(ge,140);we=setTimeout(()=>Q(ge,140),260);}let xt=e=>e.pointerType==="mouse";for(let e of [O,ge])e.addEventListener("pointerenter",r=>xt(r)&&(e===O?cr():clearTimeout(we))),e.addEventListener("pointerleave",r=>xt(r)&&Ce());O.addEventListener("click",()=>{ue.unlock(),Ce(true),v?ne():W(E.length?"messages":"home");}),$&&I.appendChild(O);let M=t("div",{class:"ckw-pop ckw-msgr","data-pos":n,role:"dialog","aria-label":c}),Ue=t("div",{class:"ckw-msgr-bar"}),h=t("div",{class:"ckw-pop-body ckw-msgr-body"});M.addEventListener("click",()=>ue.unlock());let X=t("span",{class:"ckw-msgr-lead"}),Ee=t("span",{class:"ckw-msgr-mid"}),Be=t("nav",{class:"ckw-msgr-tabs","aria-label":"Messenger"}),De=(e,r,o,l,i)=>{let w=t("button",{type:"button",class:"ckw-msgr-tab"},t("span",{class:"ckw-msgr-tab-ic"},z(o,22),rr(l,i,22)),t("span",{},r));return w.addEventListener("click",()=>{N=null,A(e);}),w},Ne=De("home","Home",u.home,$r,Ir),Ae=De("messages","Messages",u.chat,tr,ar),vt=De("help","Help",u.help,jr,Hr),Se=t("span",{class:"ckw-msgr-count ckw-msgr-count-tab","aria-hidden":"true"}),ke=t("button",{type:"button",class:"ckw-msgr-ib","aria-label":"More","aria-haspopup":"menu","aria-expanded":"false"},z(u.dots,18)),yt=t("button",{type:"button",class:"ckw-msgr-ib ckw-msgr-x","aria-label":"Close messenger"},z(u.cross));yt.addEventListener("click",()=>ne()),Ue.append(X,Ee,t("span",{class:"ckw-msgr-trail"},ke,yt));let K=t("div",{class:"ckw-msgr-menu",role:"menu"}),Ke=()=>K.isConnected&&!K.hasAttribute("data-out"),me=()=>{ke.setAttribute("aria-expanded","false"),Q(K,120);},zt=(e,r,o)=>{let l=t("button",{type:"button",class:"ckw-msgr-menu-i",role:"menuitem"},z(e,15),t("span",{},r));return l.addEventListener("click",i=>{i.stopPropagation(),me(),o();}),l};ke.addEventListener("click",e=>{var r;if(e.stopPropagation(),Ke())return me();K.replaceChildren(t("span",{class:"ckw-msgr-menu-h"},"Quick actions"),zt(u.minus,"Minimize chat",()=>ne()),zt(se?u.collapse:u.expand,se?"Collapse view":"Expand view",()=>{se=!se,M.toggleAttribute("data-wide",se);})),ke.setAttribute("aria-expanded","true"),le(K,M),(r=K.querySelector("button"))==null||r.focus();}),M.addEventListener("click",()=>Ke()&&me());let lr=()=>{let e=(o,l)=>{let i=t("button",{type:"button",class:"ckw-msgr-ib","aria-label":l},z(u.back,18));return i.addEventListener("click",o),i};typeof m!="string"?X.replaceChildren(e(()=>A("help"),"Back to help")):m==="help"&&N&&!D.trim()?X.replaceChildren(e(()=>{N=null,A("help");},"All collections")):m==="messages"?X.replaceChildren(e(()=>A("home"),"Back to home")):m==="home"?X.replaceChildren(Me):X.replaceChildren(),m==="messages"?Ee.replaceChildren(ce("sm"),t("span",{class:"ckw-msgr-mid-t"},t("b",{},c),t("span",{class:"ckw-msgr-online"},b))):m==="help"?Ee.replaceChildren(t("b",{},"Help")):Ee.replaceChildren();let r=f&&ze!==false?[Ne,Ae,vt]:[Ne,Ae];Be.childNodes.length!==r.length&&Be.replaceChildren(...r),Ne.setAttribute("aria-current",m==="home"?"page":"false"),Ae.setAttribute("aria-current",m==="messages"?"page":"false"),vt.setAttribute("aria-current",m!=="home"&&m!=="messages"?"page":"false"),E.length&&m!=="messages"?(Se.textContent=String(Math.min(E.length,9)),Se.isConnected||Ae.firstChild.appendChild(Se)):Se.remove();},Y=t("form",{class:"ckw-msgr-compose"}),Te=t("p",{class:"ckw-msgr-error",role:"alert"}),U=t("input",{class:"ckw-input",type:"email",inputmode:"email",autocomplete:"email",placeholder:"Your email (optional), so we can follow up","aria-label":"Your email (optional)",maxlength:"200"}),J=t("div",{class:"ckw-msgr-box"}),L=t("textarea",{class:"ckw-textarea ckw-msgr-input",rows:"1",placeholder:"Write your message\u2026","aria-label":"Message",maxlength:"4000"}),Ve=t("button",{type:"submit",class:"ckw-msgr-send","aria-label":"Send"},z(u.up)),Ye=Tr(),fe=t("button",{type:"button",class:"ckw-msgr-clip","aria-label":Ye?"Attach a file or a screenshot":"Attach a file",...Ye?{"aria-haspopup":"menu","aria-expanded":"false"}:{}},z(u.clip,18));J.append(L,t("div",{class:"ckw-msgr-tools"},fe,t("span",{class:"ckw-msgr-sp"}),Ve)),J.addEventListener("click",e=>e.target===J&&L.focus()),Y.append(J);let Z=t("input",{type:"file",accept:ct.join(","),multiple:"",hidden:"",tabindex:"-1","aria-hidden":"true"});Y.append(Z);let ee=t("div",{class:"ckw-msgr-files",role:"list","aria-label":"Files to send"}),R=[],be=new Map,We=e=>{var r;return (r=be.get(e))!=null?r:_().attachmentUrl(e)},Mt=e=>{e.ctrl.abort(),[...be.values()].includes(e.local)||URL.revokeObjectURL(e.local);},Ct=e=>{R=R.filter(r=>r!==e),Mt(e);},Le=e=>{T="";for(let r of e){let o=r.name||"screenshot.png";if(R.length>=lt){T=`Up to ${lt} files per message.`;break}if(!ct.includes(r.type)){T="Only pictures (PNG, JPEG, WebP, GIF) and PDFs can be sent.";continue}if(r.size>Gt){T=`${o} is larger than 10 MB.`;continue}let l={key:`local-${Date.now().toString(36)}${Math.random().toString(36).slice(2,7)}`,name:o,type:r.type,size:r.size,local:URL.createObjectURL(r),up:Promise.resolve(),ctrl:new AbortController};l.up=_().uploadChatFile(r,l.ctrl.signal).then(i=>{l.id=i.id,j();},i=>{i.name!=="AbortError"&&(Ct(l),T=`${l.name}: ${i.message}`,j());}),R.push(l);}v&&m!=="messages"?A("messages"):j(),L.focus();},Et="",dr=()=>{let e=R.map(r=>`${r.key}:${r.id?1:0}`).join(",");e!==Et&&(Et=e,ee.replaceChildren(...R.map(r=>{let o=t("button",{type:"button",class:"ckw-msgr-file-x","aria-label":`Remove ${r.name}`},z(u.cross,12));o.addEventListener("click",()=>{Ct(r),j(),L.focus();});let l=r.type.startsWith("image/")?t("img",{src:r.local,alt:""}):t("span",{class:"ckw-msgr-file-doc"},z(u.doc,18),t("span",{},r.name));return t("div",{class:"ckw-msgr-file",role:"listitem",title:r.name,"aria-label":r.id?r.name:`${r.name}, uploading`,...r.id?{}:{"aria-busy":"true"}},l,o)}))),R.length?ee.isConnected||Y.insertBefore(ee,J):ee.remove();},pr=async()=>{var l;let e;try{e=await navigator.mediaDevices.getDisplayMedia({video:{displaySurface:"browser"},audio:!1,preferCurrentTab:!0,selfBrowserSurface:"include"});}catch(i){i.name!=="NotAllowedError"&&i.name!=="AbortError"&&(T="The screenshot did not work here. Attach a picture instead.",j());return}I.style.visibility="hidden";let r=null;try{let i=document.createElement("video");i.muted=!0,i.playsInline=!0,i.srcObject=e,await i.play(),await new Promise(p=>setTimeout(p,300));let w=i;await new Promise(p=>w.requestVideoFrameCallback?w.requestVideoFrameCallback(()=>p()):requestAnimationFrame(()=>p()));let k=document.createElement("canvas");k.width=i.videoWidth,k.height=i.videoHeight,(l=k.getContext("2d"))==null||l.drawImage(i,0,0);let y=(p,C)=>new Promise(B=>k.toBlob(B,p,C));r=await y("image/png"),r&&r.size>4.5*1024*1024&&(r=await y("image/jpeg",.9));}catch(i){r=null;}finally{for(let i of e.getTracks())i.stop();I.style.visibility="";}if(!r||!r.size)return T="The screenshot did not work here. Attach a picture instead.",j();let o=new Date().toISOString().slice(0,16).replace(/[:T]/g,"-");Le([Object.assign(r,{name:`screenshot-${o}.${r.type==="image/png"?"png":"jpg"}`})]);},te=t("div",{class:"ckw-msgr-menu ckw-msgr-amenu",role:"menu"}),Ge=()=>te.isConnected&&!te.hasAttribute("data-out"),$e=()=>{fe.setAttribute("aria-expanded","false"),Q(te,120);},At=(e,r,o)=>{let l=t("button",{type:"button",class:"ckw-msgr-menu-i",role:"menuitem"},z(e,15),t("span",{},r));return l.addEventListener("click",i=>{i.stopPropagation(),$e(),o();}),l};fe.addEventListener("click",e=>{var r;if(e.stopPropagation(),ue.unlock(),!Ye)return Z.click();if(Ge())return $e();te.replaceChildren(At(u.image,"Photo or file",()=>Z.click()),At(u.screen,"Screenshot of this page",()=>{pr();})),fe.setAttribute("aria-expanded","true"),le(te,Y),(r=te.querySelector("button"))==null||r.focus();}),Z.addEventListener("change",()=>{var e;Le([...(e=Z.files)!=null?e:[]]),Z.value="";});let gr=t("a",{class:"ckw-msgr-powered",href:Qt,target:"_blank",rel:"noopener"},"Powered by ",t("b",{},"MRRocket")),St=t("ol",{class:"ckw-msgs","aria-live":"polite","aria-label":"Messages"}),Tt=()=>{var e;return s&&!((e=a.user())!=null&&e.email)&&!(x!=null&&x.hasEmail)},Qe=()=>!U.value.trim()||Er.test(U.value.trim()),Xe=()=>(!!L.value.trim()||R.length>0)&&!P&&Qe(),A=e=>{let r=JSON.stringify(e)!==JSON.stringify(m);m=e,Ie=-1,j(),r&&qe(h,"ckw-msgr-enter"),e==="messages"?(Oe(),pe(),L.focus()):e==="help"&&Ze.focus(),oe(0);},wr=(e,r)=>{let o=t("img",{src:e,alt:r,loading:"lazy"});return o.addEventListener("load",()=>{h.scrollHeight-h.scrollTop-h.clientHeight<o.clientHeight+120&&(h.scrollTop=h.scrollHeight);}),o},Lt=(e,r=false)=>{var l,i,w;let o=t("li",{class:"ckw-msg","data-from":e.from==="visitor"?"me":"them"},e.body||!((l=e.attachments)!=null&&l.length)?t("div",{class:"ckw-bubble"},e.body):null);r&&o.setAttribute("aria-busy","true"),(i=e.attachments)!=null&&i.length&&o.append(t("div",{class:"ckw-msg-files"},...e.attachments.map(k=>k.type.startsWith("image/")?t("a",{class:"ckw-msg-img",href:We(k.id),target:"_blank",rel:"noopener",title:k.name},wr(We(k.id),k.name)):t("a",{class:"ckw-msgr-cite",href:We(k.id),target:"_blank",rel:"noopener"},z(u.doc,14),t("span",{},k.name)))));for(let k of (w=e.articles)!=null?w:[]){let y=t("button",{type:"button",class:"ckw-msgr-cite"},z(u.doc,14),t("span",{},k.title));y.addEventListener("click",()=>A({article:k.id})),o.append(y);}return o.append(t("span",{class:"ckw-msg-meta"},`${e.from!=="visitor"?`${pt[e.from]} \xB7 `:""}${r?"Sending\u2026":gt(e.at)}`)),o},kr=e=>{let r=t("button",{type:"button",class:"ckw-msgr-art"},t("span",{class:"ckw-msgr-art-t"},e.title),z(u.next,14));return r.addEventListener("click",()=>A({article:e.id})),r},$t=(e,r,o,l)=>{let i=t("button",{type:"button",class:"ckw-msgr-hrow"},t("span",{class:"ckw-msgr-hrow-main"},t("b",{},e),r?t("span",{class:"ckw-msgr-hrow-sub"},r):null,o?t("span",{class:"ckw-msgr-hrow-meta"},o):null),z(u.next,16));return i.addEventListener("click",l),i},Je=((e="Search for help")=>{let r=t("label",{class:"ckw-msgr-search"}),o=t("input",{class:"ckw-msgr-search-in",type:"search",placeholder:e,"aria-label":"Search for help",maxlength:"200"});o.value=D;let l;return o.addEventListener("input",()=>{D=o.value,clearTimeout(l),l=setTimeout(()=>{if(m!=="help")return A("help");tt(true);},250);}),o.addEventListener("keydown",i=>{i.key==="Enter"&&(i.preventDefault(),m!=="help"&&A("help"));}),r.append(z(u.search,16),o),r})("Search our help center\u2026"),Ze=Je.querySelector("input"),et=false,tt=async(e=false)=>{if(!f||et&&!e)return;et=true;let r=D.trim();try{let o=await _().articles(r||void 0);if(r!==D.trim())return;S=o.articles,r||(ze=o.articles.length>0);}catch(o){S=S!=null?S:[];}finally{et=false;}j();},rt=t("form",{class:"ckw-msgr-askq"}),re=t("input",{class:"ckw-msgr-askq-in",placeholder:"Ask a question","aria-label":"Ask a question",maxlength:"4000",autocomplete:"off"}),at=t("button",{type:"submit",class:"ckw-msgr-send","aria-label":"Send",disabled:""},z(u.up));rt.append(re,at),re.addEventListener("input",()=>at.disabled=!re.value.trim()),rt.addEventListener("submit",e=>{if(e.preventDefault(),!re.value.trim())return A("messages");L.value=re.value,re.value="",at.disabled=true,A("messages"),Xe()&&it();});let mr=()=>{var w,k,y;let e=(k=(w=a.user())==null?void 0:w.name)==null?void 0:k.trim().split(/\s+/)[0],r=g.replace(/^(hi|hello|hey|hallo)( there)?\s*[!,.]*\s*/i,"").trim()||"How can we help you today?",o=t("h2",{class:"ckw-msgr-hero ckw-msgr-hello"},t("span",{},e?`Hi, ${e} `:"Hi there ",t("span",{class:"ckw-msgr-wave","aria-hidden":"true"},"\u{1F44B}")),t("span",{class:"ckw-msgr-hello-sub"},r)),l=((y=x==null?void 0:x.messages)!=null?y:[]).at(-1),i=[o,rt];if(l){let p=t("button",{type:"button",class:"ckw-msgr-card ckw-msgr-recent","aria-label":`Recent message: ${wt(l)}`},t("span",{class:"ckw-msgr-recent-row"},ce("sm"),t("span",{class:"ckw-msgr-card-main"},t("span",{class:"ckw-msgr-card-sub ckw-msgr-recent-text"},wt(l)),t("span",{class:"ckw-msgr-card-meta"},`${l.from==="visitor"?"You":pt[l.from]} \xB7 ${gt(l.at)}`)),E.length?t("span",{class:"ckw-msgr-badge"},String(E.length)):z(u.next,14)));p.addEventListener("click",()=>A("messages")),i.push(p);}if(f&&ze!==false){let p=t("div",{class:"ckw-msgr-card ckw-msgr-card-col"}),C=(S!=null?S:[]).slice(0,3);C.length?p.append(...C.map(kr)):S===null&&p.append(t("div",{class:"ckw-skel ckw-msgr-skel"})),i.push(p);}h.replaceChildren(...i);},fr=()=>{var k,y;Ze.value!==D&&(Ze.value=D);let e=D.trim(),r=S!=null?S:[],o=new Map;for(let p of r)o.set(p.collection,[...(k=o.get(p.collection))!=null?k:[],p]);let l=!e&&N!==null?(y=o.get(N))!=null?y:[]:null,i=e?"Search results":l?N!=null?N:"":"Most read articles",w=[t("h2",{class:"ckw-msgr-help-h"},i),Je];if(S===null)w.push(t("div",{class:"ckw-skel"}));else if(r.length)e||l?w.push(t("div",{class:"ckw-msgr-hlist"},...(l!=null?l:r).map(p=>$t(p.title,p.excerpt.startsWith(p.title)?p.excerpt.slice(p.title.length).trim():p.excerpt,e?p.collection:"",()=>A({article:p.id}))))):w.push(t("div",{class:"ckw-msgr-hlist"},...[...o].map(([p,C])=>$t(p,C.map(B=>B.title).join(", "),`${C.length} ${C.length===1?"article":"articles"}`,()=>{N=p,A("help"),qe(h,"ckw-msgr-enter");}))));else {let p=t("button",{type:"button",class:"ckw-btn ckw-btn-primary"},"Send us a message");p.addEventListener("click",()=>A("messages")),w.push(t("div",{class:"ckw-msgr-empty"},t("p",{},e?`Nothing found for \u201C${e}\u201D.`:"No help articles yet."),p));}if(h.childNodes[1]!==Je)h.replaceChildren(...w);else {for(h.firstChild.replaceWith(w[0]);h.childNodes.length>2;)h.lastChild.remove();h.append(...w.slice(2));}},ae=null,br=e=>{if((ae==null?void 0:ae.id)===e)return h.replaceChildren(ae.node);let r=t("article",{class:"ckw-msgr-doc"},t("div",{class:"ckw-skel"}));ae={id:e,node:r},h.replaceChildren(r),_().article(e).then(o=>{let l=t("div",{class:"ckw-msgr-rate"}),i=()=>{if(Re.has(e))return l.replaceChildren(t("span",{},"Thanks for letting us know."));let k=t("button",{type:"button",class:"ckw-btn"},"Yes"),y=t("button",{type:"button",class:"ckw-btn"},"No"),p=C=>{Re=new Set(Re).add(e),i(),_().rateArticle(e,C).catch(()=>{}),C||A("messages");};k.addEventListener("click",()=>p(true)),y.addEventListener("click",()=>p(false)),l.replaceChildren(t("span",{},"Did this answer your question?"),t("span",{class:"ckw-msgr-rate-b"},k,y));};i();let w=t("button",{type:"button",class:"ckw-btn ckw-msgr-ask"},z(u.chat),"Still need help? Send us a message");w.addEventListener("click",()=>A("messages")),r.replaceChildren(t("p",{class:"ckw-msgr-doc-c"},o.collection),t("h2",{class:"ckw-msgr-doc-t"},o.title),t("p",{class:"ckw-msgr-doc-c"},`Updated ${gt(o.updatedAt)}`),t("div",{class:"ckw-msgr-doc-b"},...o.blocks.map(Pr)),l,w);}).catch(o=>{ae=null,r.replaceChildren(t("p",{class:"ckw-msgr-error"},o.message));});},Ie=-1,It="",ot=-1,nt=t("div",{class:"ckw-msgr-sugg"}),ur=()=>{var l,i,w,k;let e=(l=x==null?void 0:x.messages)!=null?l:[],r=[];if(!kt)r.push(t("div",{class:"ckw-skel"}));else {let y=`${e.map(C=>C.id).join(",")}|${P?`${P.body}+${(w=(i=P.attachments)==null?void 0:i.length)!=null?w:0}`:""}|${Math.floor(Date.now()/6e4)}`;if(y!==It){It=y;let B=[t("li",{class:"ckw-msg","data-from":"them"},t("div",{class:"ckw-bubble"},g)),...e.map(st=>Lt(st)),...P?[Lt(P,true)]:[]];ot>=0&&B.slice(ot).forEach(st=>st.setAttribute("data-new","")),ot=B.length,St.replaceChildren(...B);}r.push(St);let p=!e.some(C=>C.from==="visitor")&&!P?(S!=null?S:[]).slice(0,3):[];p.length&&(nt.childNodes.length!==p.length&&nt.replaceChildren(...p.map(C=>{let B=t("button",{type:"button",class:"ckw-msgr-sugg-b"},C.title);return B.addEventListener("click",()=>A({article:C.id})),B})),r.push(nt));}((k=x==null?void 0:x.conversation)==null?void 0:k.status)==="solved"&&!P&&r.push(t("p",{class:"ckw-fine ckw-msgr-note"},"This conversation is closed. Write to start a new one.")),(h.childNodes.length!==r.length||r.some((y,p)=>h.childNodes[p]!==y))&&h.replaceChildren(...r);let o=e.length+(P?1:0);o!==Ie&&(Ie=o,h.scrollTop=h.scrollHeight),Te.textContent=T,T&&!Te.isConnected?Y.prepend(Te):T||Te.remove(),Tt()?(Qe()?U.removeAttribute("aria-invalid"):U.setAttribute("aria-invalid","true"),U.isConnected||Y.insertBefore(U,ee.isConnected?ee:J)):U.remove(),dr(),Ve.disabled=!Xe();},j=()=>{if(!v)return;M.dataset.view=typeof m=="string"?m:"article",lr(),m==="home"?mr():m==="messages"?ur():m==="help"?fr():br(m.article);let e=m==="home"?[ir,Ue,h]:[Ue,h];e.push(m==="messages"?Y:Be),a.branding!==false&&e.push(gr),K.isConnected&&e.push(K),(M.childNodes.length!==e.length||e.some((r,o)=>M.childNodes[o]!==r))&&M.replaceChildren(...e);},jt=async()=>{V==null||V.abort(),V=new AbortController;try{bt(await _().chat(V.signal)),T="";}catch(e){if(e.name==="AbortError")return;v&&m==="messages"&&(T=e.message);}kt=true,j(),pe(),oe();};function oe(e){var w,k,y;clearTimeout(ye);let r=!!(x!=null&&x.messages.some(p=>p.from==="visitor"))&&((w=x==null?void 0:x.conversation)==null?void 0:w.status)!=="solved",o=(y=((k=x==null?void 0:x.messages)!=null?k:[]).filter(p=>p.from==="visitor").at(-1))==null?void 0:y.at,l=!!o&&Date.now()-new Date(o).getTime()<Cr,i=e!=null?e:Fe()?yr:r&&l?zr:v||r?Mr:0;(i||e===0)&&(ye=setTimeout(()=>{jt();},i));}let Ht=()=>{document.visibilityState==="visible"?oe(0):clearTimeout(ye);};document.addEventListener("visibilitychange",Ht);let it=async()=>{let e=L.value.trim(),r=R;if(!e&&!r.length||P||!Qe())return;ue.unlock();for(let i of r)be.set(i.key,i.local);P={id:"pending",from:"visitor",body:e,at:new Date().toISOString(),...r.length?{attachments:r.map(i=>({id:i.key,name:i.name,type:i.type,size:i.size}))}:{}},L.value="",R=[],T="",j(),await Promise.all(r.map(i=>i.up));let o=r.filter(i=>i.id).map(i=>i.id),l=false;try{if(!e&&!o.length)throw new Error(T||"The file could not be sent.");bt(await _().sendChat({body:e,email:Tt()&&U.value.trim()?U.value.trim():void 0,url:window.location.href.slice(0,500),...o.length?{attachments:o}:{},context:{viewport:`${window.innerWidth}\xD7${window.innerHeight}`}})),l=!0;}catch(i){L.value=e,R=r.filter(w=>w.id),T=i.message;}P=null;for(let i of r)be.delete(i.key);if(j(),l)for(let i of r)URL.revokeObjectURL(i.local);oe();};Y.addEventListener("submit",e=>{e.preventDefault(),it();}),L.addEventListener("keydown",e=>{e.key==="Enter"&&!e.shiftKey&&!e.isComposing&&(e.preventDefault(),it());}),L.addEventListener("input",()=>Ve.disabled=!Xe()),L.addEventListener("paste",e=>{var o,l;let r=[...(l=(o=e.clipboardData)==null?void 0:o.files)!=null?l:[]];r.length&&(e.preventDefault(),Le(r));});let Pt=e=>!!e.dataTransfer&&[...e.dataTransfer.types].includes("Files");M.addEventListener("dragover",e=>{Pt(e)&&(e.preventDefault(),M.setAttribute("data-drop",""));}),M.addEventListener("dragleave",e=>{(!e.relatedTarget||!M.contains(e.relatedTarget))&&M.removeAttribute("data-drop");}),M.addEventListener("drop",e=>{var r,o;Pt(e)&&(e.preventDefault(),M.removeAttribute("data-drop"),Le([...(o=(r=e.dataTransfer)==null?void 0:r.files)!=null?o:[]]));}),U.addEventListener("input",()=>j());function W(e="home",r=false){let o=v;v=true,m=e==="help"&&!f?"home":e,Ie=-1,ve=true,Ce(true),M.toggleAttribute("data-still",r),le(M),o&&qe(h,"ckw-msgr-enter"),(S===null||m==="help"&&D)&&tt(),j(),pe(),m==="messages"&&(Oe(),L.focus()),oe(0);}function ne(){v&&(v=false,K.isConnected&&me(),Q(M,200),pe(),oe(),$&&O.focus());}M.addEventListener("click",()=>Ge()&&$e());let Rt=e=>{e.key!=="Escape"||!v||(Ge()?($e(),fe.focus()):Ke()?(me(),ke.focus()):ne());};return document.addEventListener("keydown",Rt),jt(),f&&tt(),pe(),a.opened&&W(a.opened,true),{open:e=>W(e!=null?e:"home"),close:ne,toggle:()=>v?ne():W(),destroy:()=>{clearTimeout(ye),clearTimeout(we);for(let e of G.values())clearTimeout(e);V==null||V.abort();for(let e of R)Mt(e);for(let e of be.values())URL.revokeObjectURL(e);document.removeEventListener("keydown",Rt),document.removeEventListener("visibilitychange",Ht),I.remove();}}};window.__mrrocketMessenger={mountMessenger:nr};
348
582
  })();