koishi-plugin-chat-patch 5.3.1 → 5.5.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 (65) hide show
  1. package/client/web/dist/assets/Chat-Clqxn7CB.js +28 -0
  2. package/client/web/dist/assets/{Chat-C-rmzMIw.css → Chat-DTEsebnY.css} +1 -1
  3. package/client/web/dist/assets/{MsgBody-h4C1nnBQ.js → MsgBody-C0TKsXhC.js} +1 -1
  4. package/client/web/dist/assets/{MsgBody.vue_vue_type_script_setup_true_lang-a902ps2r.js → MsgBody.vue_vue_type_script_setup_true_lang-CCdBwlN_.js} +1 -1
  5. package/client/web/dist/assets/{append_darwin-CqBNU62J.css → append_darwin-Cql-dV6d.css} +1 -1
  6. package/client/web/dist/assets/{append_full_vibrancy-j0D2LM9m.css → append_full_vibrancy-ih3loy1O.css} +1 -1
  7. package/client/web/dist/assets/{append_linux-uhxeBqeC.css → append_linux-B3LvR8KB.css} +1 -1
  8. package/client/web/dist/assets/{append_new-407Lo5_V.css → append_new-DfhN_NX9.css} +1 -1
  9. package/client/web/dist/assets/{append_vibrancy-6FHctkOY.css → append_vibrancy-D3pVsmAa.css} +1 -1
  10. package/client/web/dist/assets/{append_win32-srmD-78y.css → append_win32-Dh9JlmlE.css} +1 -1
  11. package/client/web/dist/assets/index-B71pPwae.css +1 -0
  12. package/client/web/dist/assets/{index-CdTmWcO4.js → index-BA37EQGa.js} +96 -75
  13. package/client/web/dist/index.html +2 -2
  14. package/client/web/src/App.vue +2 -2
  15. package/client/web/src/assets/css/append/append_darwin.css +2 -2
  16. package/client/web/src/assets/css/append/append_full_vibrancy.css +2 -2
  17. package/client/web/src/assets/css/append/append_linux.css +2 -2
  18. package/client/web/src/assets/css/append/append_new.css +2 -2
  19. package/client/web/src/assets/css/append/append_vibrancy.css +1 -1
  20. package/client/web/src/assets/css/append/append_win32.css +2 -2
  21. package/client/web/src/assets/css/append/mobile/append_mobile_horizontal.css +1 -1
  22. package/client/web/src/assets/css/chat.css +4 -3
  23. package/client/web/src/assets/css/msg.css +7 -3
  24. package/client/web/src/assets/css/options.css +2 -2
  25. package/client/web/src/assets/css/view.css +14 -3
  26. package/client/web/src/assets/l10n/zh-CN.po +21 -0
  27. package/client/web/src/components/AboutPan.vue +5 -3
  28. package/client/web/src/components/DepPan.vue +1 -1
  29. package/client/web/src/components/MsgBody.vue +0 -3
  30. package/client/web/src/components/ThemeColorPickerPan.vue +1 -1
  31. package/client/web/src/components/UmamiInfoPan.vue +1 -1
  32. package/client/web/src/components/WelPan.vue +1 -1
  33. package/client/web/src/function/connect.ts +232 -72
  34. package/client/web/src/function/elements/information.ts +1 -0
  35. package/client/web/src/function/msg.ts +42 -23
  36. package/client/web/src/function/satori-model.ts +27 -13
  37. package/client/web/src/function/satori.ts +2 -1
  38. package/client/web/src/function/utils/appUtil.ts +3 -11
  39. package/client/web/src/function/utils/localHistoryUtil.ts +36 -12
  40. package/client/web/src/function/utils/msgUtil.ts +32 -21
  41. package/client/web/src/function/utils/sessionUtil.ts +20 -18
  42. package/client/web/src/pages/Chat.vue +47 -43
  43. package/client/web/src/pages/Friends.vue +5 -7
  44. package/client/web/src/pages/Info.vue +2 -2
  45. package/client/web/src/pages/Messages.vue +37 -22
  46. package/client/web/src/pages/chat-view/ChatTerminal.vue +4 -1
  47. package/client/web/src/pages/options/OptDev.vue +45 -2
  48. package/lib/database.d.ts +58 -0
  49. package/lib/index.js +220 -68
  50. package/lib/media.d.ts +24 -0
  51. package/lib/recorder.d.ts +21 -0
  52. package/lib/self-message.d.ts +27 -0
  53. package/lib/types.d.ts +6 -0
  54. package/lib/web.d.ts +7 -0
  55. package/package.json +1 -1
  56. package/src/cache.ts +1 -5
  57. package/src/database.ts +52 -8
  58. package/src/index.ts +4 -4
  59. package/src/media.ts +97 -0
  60. package/src/recorder.ts +28 -19
  61. package/src/self-message.ts +68 -19
  62. package/src/types.ts +6 -0
  63. package/src/web.ts +49 -39
  64. package/client/web/dist/assets/Chat-Bo5JdcNg.js +0 -28
  65. package/client/web/dist/assets/index-wjp_A4n1.css +0 -1
package/src/web.ts CHANGED
@@ -9,9 +9,10 @@ import type { DefaultContext, DefaultState, ParameterizedContext } from 'koa'
9
9
  import FileType from 'file-type'
10
10
 
11
11
  import { Config } from './config'
12
- import { ContactCacheService } from './cache'
13
- import { ChatDatabase } from './database'
14
- import { PluginLogger } from './logger'
12
+ import { ContactCacheService } from './cache'
13
+ import { ChatDatabase } from './database'
14
+ import { MediaManager } from './media'
15
+ import { PluginLogger } from './logger'
15
16
  import { ContactCacheItem, SelfMessagePayload, SelfMessageRecord } from './types'
16
17
 
17
18
  interface ViteConsoleServer {
@@ -29,11 +30,12 @@ interface ViteConsoleLike {
29
30
 
30
31
  export function registerWeb(
31
32
  ctx: Context,
32
- config: Config,
33
- database: ChatDatabase,
34
- contactCache: ContactCacheService,
35
- logger: PluginLogger,
36
- ) {
33
+ config: Config,
34
+ database: ChatDatabase,
35
+ contactCache: ContactCacheService,
36
+ media: MediaManager,
37
+ logger: PluginLogger,
38
+ ) {
37
39
  const webRoot = path.resolve(__dirname, '..', 'client', 'web', 'dist')
38
40
  const webSource = path.resolve(__dirname, '..', 'client', 'web', 'src')
39
41
  const webPublic = path.resolve(__dirname, '..', 'client', 'web', 'public')
@@ -96,25 +98,13 @@ export function registerWeb(
96
98
  return ext.toLowerCase()
97
99
  }
98
100
 
99
- const normalizeGroupId = (value: string): string => {
100
- const raw = value.replace(/^(?:group|room|chat|channel|guild):/i, '').trim()
101
- const wrapped = raw.match(/^\[_?([\s\S]+?)_?\]$/)
102
- return wrapped ? wrapped[1] : raw || value
103
- }
101
+ const normalizeGroupId = (value: string): string => {
102
+ return String(value)
103
+ }
104
104
 
105
- const historyChannelCandidates = (channelId: string): string[] => {
106
- const raw = normalizeGroupId(channelId)
107
- const candidates = [channelId]
108
- if (raw && raw !== channelId) candidates.push(raw)
109
- const id = raw || channelId
110
- if (!/^(?:group|room|chat|channel|guild|private):/i.test(channelId)) {
111
- candidates.push(`group:${id}`, `private:${id}`)
112
- }
113
- if (id) {
114
- candidates.push(` [_${id}_] `, `_${id}_`, `[${id}]`, `group:${id}`)
115
- }
116
- return [...new Set(candidates)]
117
- }
105
+ const historyChannelCandidates = (channelId: string): string[] => {
106
+ return channelId ? [channelId] : []
107
+ }
118
108
 
119
109
  const mimeToExt: Record<string, string> = {
120
110
  'audio/mpeg': '.mp3',
@@ -379,7 +369,9 @@ export function registerWeb(
379
369
  channelId: String(body.channelId ?? ''),
380
370
  guildId: typeof body.guildId === 'string' ? body.guildId : undefined,
381
371
  channelType: body.channelType === 'user' ? 'user' : 'group',
382
- messageId: typeof body.messageId === 'string' ? body.messageId : undefined,
372
+ messageId: typeof body.messageId === 'string' || typeof body.messageId === 'number'
373
+ ? String(body.messageId)
374
+ : undefined,
383
375
  content: typeof body.content === 'string' ? body.content : undefined,
384
376
  elements: Array.isArray(body.elements) ? body.elements as unknown[] : undefined,
385
377
  message: Array.isArray(body.message) ? body.message as unknown[] : undefined,
@@ -391,8 +383,12 @@ export function registerWeb(
391
383
  sequence: typeof body.sequence === 'number' && Number.isFinite(body.sequence)
392
384
  ? body.sequence
393
385
  : 0,
394
- source: body.source === 'plugin' ? 'plugin' : 'webui',
395
- kind: typeof body.kind === 'string' ? body.kind : 'text',
386
+ source: body.source === 'plugin' ? 'plugin' : 'webui',
387
+ kind: typeof body.kind === 'string' ? body.kind : 'text',
388
+ revoked: body.revoked === true,
389
+ revokedAt: typeof body.revokedAt === 'number' && Number.isFinite(body.revokedAt)
390
+ ? body.revokedAt
391
+ : undefined,
396
392
  }
397
393
  if (!payload.platform || !payload.selfId || !payload.channelId) {
398
394
  koa.status = 400
@@ -414,9 +410,11 @@ export function registerWeb(
414
410
  forwardContent: payload.forwardContent,
415
411
  sentAt: payload.sentAt ?? Date.now(),
416
412
  sequence: payload.sequence ?? 0,
417
- source: payload.source ?? 'webui',
418
- kind: payload.kind ?? 'text',
419
- }
413
+ source: payload.source ?? 'webui',
414
+ kind: payload.kind ?? 'text',
415
+ revoked: payload.revoked,
416
+ revokedAt: payload.revokedAt,
417
+ }
420
418
  await database.upsertSelfMessage(record)
421
419
  koa.body = { ok: true, message: record }
422
420
  })
@@ -629,7 +627,7 @@ export function registerWeb(
629
627
  }
630
628
  })
631
629
 
632
- ctx.server.post(`${config.basePath}/api/cache`, async (koa) => {
630
+ ctx.server.post(`${config.basePath}/api/cache`, async (koa) => {
633
631
  const requestBody = (koa.request as unknown as { body?: unknown }).body
634
632
  const body = (requestBody ?? {}) as Record<string, unknown>
635
633
  const platform = String(body.platform ?? '')
@@ -669,12 +667,24 @@ export function registerWeb(
669
667
  await database.setContacts(platform, selfId, normalizedType, contacts)
670
668
  }
671
669
  }
672
- koa.body = {
673
- contacts: await database.getContacts(platform, selfId, normalizedType),
674
- }
675
- })
676
-
677
- const serveFile = async (koa: WebContext, fileName: string) => {
670
+ koa.body = {
671
+ contacts: await database.getContacts(platform, selfId, normalizedType),
672
+ }
673
+ })
674
+
675
+ ctx.server.post(`${config.basePath}/api/clear-all`, async (koa) => {
676
+ try {
677
+ await database.clearAll()
678
+ await media.clearAll()
679
+ koa.body = { ok: true }
680
+ } catch (error) {
681
+ logger.warn('清空全部缓存失败:', error)
682
+ koa.status = 500
683
+ koa.body = { ok: false, error: String(error) }
684
+ }
685
+ })
686
+
687
+ const serveFile = async (koa: WebContext, fileName: string) => {
678
688
  const fullPath = path.join(webRoot, fileName)
679
689
  if (existsSync(fullPath) && statSync(fullPath).isFile()) {
680
690
  await send(koa, path.relative(webRoot, fullPath), { root: webRoot })
@@ -1,28 +0,0 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./index-Cg_esKB0.js","./core-DhEqZVGG.js"])))=>i.map(i=>d[i]);
2
- import{d as Ut,w as _e,u as B,o as W,c as te,r as qt,a as fe,b as Ee,e as kt,F as ke,f as pt,m as fi,t as go,n as vt,g as kn,h as ki,i as ie,j as he,k as Nt,l as ye,p as un,q as yt,s as vo,v as Gn,x as It,y as an,z as po,A as Tn,B as Ii,C as En,D as _i,E as xn,G as Fn,H as g,I as G,J as _n,K as We,T as Si,L as ln,M as tt,N as di,O as hi,P as Xt,Q as dt,R as Oe,S as Ci,_ as $n,U as Mi,V as wt,W as yo,X as Ai,Y as wo,Z as Kn,$ as Ti,a0 as bo,a1 as mn,a2 as mi,a3 as Ei,a4 as jn,a5 as xi,a6 as Fi,a7 as qn,a8 as Vn,a9 as ko,aa as Io,ab as en,ac as gn,ad as gi,ae as _o,af as So,ag as Ot,ah as vn,ai as Co,aj as pn,ak as tn,al as nn,am as on,an as Un,ao as Mo,ap as Ao,aq as To,ar as Eo,as as xo,at as vi,au as pi,av as Fo,aw as Ht,ax as $o,ay as Lo,az as yn,aA as Ro,aB as Do,aC as Bo,aD as Oo,aE as Uo,aF as zo,aG as No,aH as Po,aI as Ho}from"./index-CdTmWcO4.js";import{_ as Wn,E as sn,a as rn}from"./MsgBody.vue_vue_type_script_setup_true_lang-a902ps2r.js";function Jn(n,f,D){if(!D)return f;const r=n==null?void 0:n[D];if(r==null)throw new Error(`Key is ${r} on item (keyField is '${D}')`);return r}function wn(n,f){return n.map((D,r)=>Jn(D,r,f))}function jo(n,f,D){const r=[],e=[];for(let t=0;t<n.length;t++){const l=n[t],u=Jn(l,t,f),w=D(l,t,u);r.push(u),e.push(typeof w=="number"&&w>0?w:null)}return{keys:r,sizes:e}}function qo(n,f,D){if(!n||n.keys.length!==f.length||n.sizes.length!==f.length)return!1;for(let r=0;r<f.length;r++)if(n.keys[r]!==Jn(f[r],r,D))return!1;return!0}function Vo(n,f,D){if(!qo(n,f,D))return{};const r={};for(let e=0;e<n.keys.length;e++){const t=n.sizes[e];typeof t=="number"&&t>0&&(r[n.keys[e]]=t)}return r}function Wo(n,f){if(!n.length||f.length<=n.length)return 0;const D=n[0],r=f.indexOf(D);if(r<=0||r+n.length<f.length&&n.length>f.length-r)return 0;for(let e=0;e<n.length;e++)if(f[r+e]!==n[e])return 0;return r}function yi(n,f,D,r,e,t=0){const l=e??"start";if(l==="nearest"){const u=D+r,w=n+f;return n>=D&&w<=u?null:n<D?n+t:w-r+t}return l==="end"?n+f-r+t:l==="center"?n+(f-r)/2+t:n+t}const Qo={itemsLimit:1e3};function $i(n){return typeof window<"u"&&n===window}const Go=(()=>{if(typeof document>"u")return"negative";const n=document.createElement("div"),f=document.createElement("div");n.style.width="4px",n.style.height="1px",n.style.overflow="auto",n.style.direction="rtl",f.style.width="8px",f.style.height="1px",n.appendChild(f),document.body.appendChild(n),n.scrollLeft=-1;const D=n.scrollLeft<0;return document.body.removeChild(n),D?"negative":"default"})();function Jt(n,f,D){return f!=="horizontal"||!D||$i(D)||getComputedStyle(D).direction!=="rtl"?n:Go==="negative"?-n:n}function Ko(n,f,D){return Jt(n,f,D)}function zn(n,f,D,r){const e=Ko(D,f,n),t=!!(r!=null&&r.smooth);if($i(n)){f==="vertical"?n.scrollTo({top:e,behavior:t?"smooth":"auto"}):n.scrollTo({left:e,behavior:t?"smooth":"auto"});return}if(typeof n.scrollTo=="function"){n.scrollTo(f==="vertical"?{top:e,behavior:t?"smooth":"auto"}:{left:e,behavior:t?"smooth":"auto"});return}f==="vertical"?n.scrollTop=e:n.scrollLeft=e}function Jo(n,f,D){return D?f==="vertical"?window.innerHeight:window.innerWidth:f==="vertical"?n.clientHeight:n.clientWidth}const Yo=/auto|scroll/;function Li(n,f){return n.parentNode===null?f:Li(n.parentNode,[...f,n])}function Nn(n,f){return getComputedStyle(n,null).getPropertyValue(f)}function Xo(n){return Nn(n,"overflow")+Nn(n,"overflow-y")+Nn(n,"overflow-x")}function Zo(n){return Yo.test(Xo(n))}function bn(n){if(!(n instanceof HTMLElement||n instanceof SVGElement))return;const f=Li(n.parentNode,[]);for(let D=0;D<f.length;D+=1)if(f[D]instanceof Element&&Zo(f[D]))return f[D];return document.scrollingElement||document.documentElement}let Qn=!1;function ea(){return Qn}if(typeof window<"u"){Qn=!1;try{const n=Object.defineProperty({},"passive",{get(){Qn=!0}});window.addEventListener("test",null,n)}catch{}}let ta=0;function Pn(n){const f=n;f._vs_styleStamp++}function na(n,f,D){const r=n==null?void 0:n[D];if(r==null)throw new Error(`Key is ${r} on item (keyField is '${D}')`);return r}function ia(n,f,D,r,e){const t=he([]),l=he(0),u=he(!1);let w=0,$=0;const i=new Map,a=new Map;let o=!1,d=0,v=0,R=!1,b=null,T=null,K=null,H=0,x=null,V=[],M=null,N=null,y=null,p=!1;const F=new Set,_=he({}),S=Nt(()=>{const P=ye(n);return P.items.length>0&&typeof P.items[0]!="object"}),A=Nt(()=>{const P=ye(n);if(P.itemSize===null){const q={[-1]:{accumulator:0}},ee=P.items,se=P.sizeField??"size",ae=P.minItemSize,le=_.value;let ce=1e4,xe=0,rt;for(let Pe=0,it=ee.length;Pe<it;Pe++){const Ue=S.value?Pe:na(ee[Pe],Pe,P.keyField);rt=le[Ue]||ee[Pe][se]||ae,rt<ce&&(ce=rt),xe+=rt,q[Pe]={accumulator:xe,size:rt}}return H=ce,q}return[]}),I=Nt(()=>t.value.filter(P=>P.nr.used).sort((P,q)=>P.nr.index-q.nr.index)),L=Nt(()=>{const P=ye(n),q=S.value?null:P.keyField;return jo(P.items,q,(ee,se,ae)=>P.itemSize!=null?P.itemSize:_.value[ae]||(ee==null?void 0:ee[P.sizeField??"size"])||void 0)});function m(P){const q=ye(n);return _.value=Vo(P,q.items,S.value?null:q.keyField),Object.keys(_.value).length>0}function h(P){let q=a.get(P);return q||(q=[],a.set(P,q)),q}function O(P,q,ee,se,ae){const le=an({id:ta++,index:q,used:!0,key:se,type:ae}),ce=po({item:ee,position:0,offset:0,nr:le,_vs_styleStamp:0});return P.push(ce),ce}function C(P){const q=h(P);if(q&&q.length){const ee=q.pop();return ee.nr.used=!0,Pn(ee),ee}}function z(P){const q=P.nr.type;h(q).push(P),P.nr.used=!1,P.position=-9999,Pn(P),i.delete(P.nr.key)}function Q(){i.clear(),a.clear();for(let P=0,q=t.value.length;P<q;P++){const ee=t.value[P];ee&&z(ee)}}function X(P){let q=-1;return q=requestAnimationFrame(()=>{F.delete(q),P()}),F.add(q),q}function ne(){for(const P of F)cancelAnimationFrame(P);F.clear()}function Y(){b&&(clearTimeout(b),b=null),T&&(clearTimeout(T),T=null),K&&(clearTimeout(K),K=null),N&&(clearTimeout(N),N=null),y&&(clearTimeout(y),y=null)}function j(){var P;(P=e==null?void 0:e.onResize)==null||P.call(e),u.value&&ue(!1)}function re(){M&&!p&&ge();const P=ye(n);if(!o){if(o=!0,b)return;const q=()=>X(()=>{o=!1;const{continuous:ee}=ue(!1,!0);ee||(T&&clearTimeout(T),T=setTimeout(re,P.updateInterval+100))});q(),P.updateInterval&&(b=setTimeout(()=>{b=null,o&&q()},P.updateInterval))}}function $e(P,q){var ee,se;u.value&&(P||q.boundingClientRect.width!==0||q.boundingClientRect.height!==0?((ee=e==null?void 0:e.onVisible)==null||ee.call(e),X(()=>{ue(!1)})):(se=e==null?void 0:e.onHidden)==null||se.call(e))}function Se(){const P=ye(f),q=P?bn(P):void 0;return window.document&&(q===window.document.documentElement||q===window.document.body)?window:q||window}function pe(){const P=ye(D);return P?ye(n).direction==="vertical"?P.scrollHeight:P.scrollWidth:0}function we(){const P=ye(f);if(!P)return{start:0,end:0};const q=ye(n),ee=q.direction==="vertical";let se;if(q.pageMode){const ae=P.getBoundingClientRect(),le=ee?ae.height:ae.width;let ce=-(ee?ae.top:ae.left),xe=ee?window.innerHeight:window.innerWidth;ce<0&&(xe+=ce,ce=0),ce+xe>le&&(xe=le-ce),se={start:ce,end:ce+xe}}else ee?se={start:P.scrollTop,end:P.scrollTop+P.clientHeight}:se={start:Jt(P.scrollLeft,q.direction,P),end:Jt(P.scrollLeft,q.direction,P)+P.clientWidth};return se}function Ne(){const P=ye(f);if(!P)return{start:0,end:0};if(ye(n).direction==="vertical"){const q=Jt(P.scrollLeft,"horizontal",P);return{start:q,end:q+P.clientWidth}}return{start:P.scrollTop,end:P.scrollTop+P.clientHeight}}function Fe(P){const q=ye(n);if(q.itemSize!=null)return q.itemSize;const ee=A.value[P];return(ee==null?void 0:ee.size)||Number(q.minItemSize)||0}function Je(P){var q;const ee=ye(n),se=ee.gridItems||1;return P<=0?0:ee.itemSize!=null?Math.floor(P/se)*ee.itemSize:((q=A.value[P-1])==null?void 0:q.accumulator)||0}function Ye(P){const q=ye(n),ee=q.items.length,se=q.gridItems||1;if(!ee)return 0;if(q.itemSize!=null){const xe=Math.floor(P/q.itemSize)*se;return Math.min(Math.max(xe,0),ee-1)}let ae=0,le=ee-1,ce=0;for(;ae<=le;){const xe=Math.floor((ae+le)/2);Je(xe)<=P?(ce=xe,ae=xe+1):le=xe-1}return ce}function ge(){N&&(clearTimeout(N),N=null),M=null}function De(){N&&clearTimeout(N),N=setTimeout(()=>{M=null,N=null},150)}function be(P,q){if(!P.length){ge();return}const ee=Math.max(we().start-pe(),0),se=Math.min(Ye(ee),P.length-1),ae=P[se],le=q?ae==null?void 0:ae[q]:se;if(le==null){ge();return}const ce=pe()+Je(se);M={key:le,offset:we().start-ce}}function Ce(P){if(!M)return!1;const q=ye(n),ee=P??q.items,se=S.value?null:q.keyField,ae=wn(ee,se).indexOf(M.key);if(ae===-1)return ge(),!1;const le=pe()+Je(ae)+M.offset,ce=we().start;return Math.abs(le-ce)<.5?!1:(p=!0,bt(le),X(()=>{p=!1}),!0)}function Le(){ye(n).pageMode?nt():Re()}function nt(){x=Se(),x.addEventListener("scroll",re,ea()?{passive:!0}:!1),x.addEventListener("resize",j)}function Re(){x&&(x.removeEventListener("scroll",re),x.removeEventListener("resize",j),x=null)}function ut(P,q,ee,se,ae,le){const ce=Math.ceil(P/q)*ee,xe=Math.max(0,Math.floor(ae.start/ee)),rt=Math.min(Math.ceil(ae.end/ee),Math.ceil(P/q)),Pe=Math.max(0,Math.floor(le.start/se)),it=Math.min(Math.ceil(le.end/se),q),Ue=[];for(let ot=xe;ot<rt;ot++){const Ct=ot*q;for(let Ze=Pe;Ze<it;Ze++){const at=Ct+Ze;if(at>=P)break;Ue.push(at)}}const Ie=Ue[0]??0,ze=Ue.at(-1)??-1;return{renderedIndices:Ue,startIndex:Ie,endIndex:ze+1,visibleStartIndex:Ie,visibleEndIndex:ze,totalSize:ce}}function je(){const P=ye(n);if(!P.gridItems||P.itemSize==null)return!1;const q=ye(f);if(!q)return!1;const ee=P.itemSecondarySize||P.itemSize,se=P.direction==="vertical"?q.clientWidth:q.clientHeight;return ee*P.gridItems>se}function ue(P,q=!1){var ee,se;const ae=ye(n),le=ae.itemSize,ce=ae.gridItems||1,xe=ae.itemSecondarySize||le,rt=H,Pe=ae.typeField,it=S.value?null:ae.keyField,Ue=ae.items,Ie=Ue.length,ze=A.value,ot=i,Ct=t.value;let Ze=null,at=null,Ve,He,zt,ft,ht;if(!Ie)Ve=He=ft=ht=zt=0;else if(R)Ve=ft=0,He=ht=Math.min(ae.prerender,Ue.length),zt=0;else{const ve=we(),st=Ne();if(q){let Qe=ve.start-d;Qe<0&&(Qe=-Qe);let Dt=st.start-v;Dt<0&&(Dt=-Dt);const Gt=le===null&&Qe>=rt||le!==null&&Qe>=le,mt=ce>1&&le!=null&&Dt>=xe;if(!Gt&&!mt)return{continuous:!0}}d=ve.start,v=st.start;const Mt=ae.buffer;ve.start-=Mt,ve.end+=Mt,st.start-=Mt,st.end+=Mt;let $t=0;const Qt=ye(D);Qt&&($t=Qt.scrollHeight,ve.start-=$t);const fn=ye(r);if(fn){const Qe=fn.scrollHeight;ve.end+=Qe}if(le===null){let Qe,Dt=0,Gt=Ie-1,mt=~~(Ie/2),et;do et=mt,Qe=ze[mt].accumulator,Qe<ve.start?Dt=mt:mt<Ie-1&&ze[mt+1].accumulator>ve.start&&(Gt=mt),mt=~~((Dt+Gt)/2);while(mt!==et);for(mt<0&&(mt=0),Ve=mt,zt=ze[Ie-1].accumulator,He=mt;He<Ie&&ze[He].accumulator<ve.end;He++);for(He===-1?He=Ue.length-1:(He++,He>Ie&&(He=Ie)),ft=Ve;ft<Ie&&$t+ze[ft].accumulator<ve.start;ft++);for(ht=ft;ht<Ie&&$t+ze[ht].accumulator<ve.end;ht++);}else if(ce>1){const Qe=ut(Ie,ce,le,xe,ve,st);Ze=Qe.renderedIndices,at=new Set(Ze),Ve=Qe.startIndex,He=Qe.endIndex,ft=Qe.visibleStartIndex,ht=Qe.visibleEndIndex,zt=Qe.totalSize}else{Ve=~~(ve.start/le*ce);const Qe=Ve%ce;Ve-=Qe,He=Math.ceil(ve.end/le*ce),ft=Math.max(0,Math.floor((ve.start-$t)/le*ce)),ht=Math.floor((ve.end-$t)/le*ce),Ve<0&&(Ve=0),He>Ie&&(He=Ie),ft<0&&(ft=0),ht>Ie&&(ht=Ie),zt=Math.ceil(Ie/ce)*le}}He-Ve>Qo.itemsLimit&&ct(),l.value=zt;let Me;const cn=Ve<=$&&He>=w;if(!cn||P)Q();else for(let ve=0,st=Ct.length;ve<st;ve++){const Mt=Ct[ve];if(Mt&&(Me=Mt,Me.nr.used)){const $t=at?at.has(Me.nr.index):Me.nr.index>=Ve&&Me.nr.index<He,Qt=le||ze[Me.nr.index]&&ze[Me.nr.index].size;(!$t||!Qt)&&z(Me)}}let Et,Wt;const Rn=Ze??Array.from({length:Math.max(0,He-Ve)},(ve,st)=>Ve+st);for(const ve of Rn){if(!(le||ze[ve]&&ze[ve].size))continue;Et=Ue[ve];const st=it?Et[it]:ve;if(st==null)throw new Error(`Key is ${st} on item (keyField is '${it}')`);if(Me=ot.get(st),Me)Me.item!==Et&&(Me.item=Et),Me.nr.used||console.warn(`Expected existing view's used flag to be true, got ${Me.nr.used}`);else{if(Wt=Et[Pe],Me=C(Wt),Me){const Mt=Me.nr.index!==ve||Me.nr.key!==st;Me.item=Et,Me.nr.index=ve,Me.nr.key=st,Me.nr.type!==Wt&&console.warn("Reused view's type does not match pool's type"),Mt&&Pn(Me)}else Me=O(Ct,ve,Et,st,Wt);ot.set(st,Me)}le===null?(Me.position=((ee=ze[ve-1])==null?void 0:ee.accumulator)||0,Me.offset=0):(Me.position=Math.floor(ve/ce)*le,Me.offset=ve%ce*xe)}return w=Ve,$=He,ae.emitUpdate&&((se=e==null?void 0:e.onUpdate)==null||se.call(e,Ve,He,ft,ht)),K&&clearTimeout(K),K=setTimeout(St,ae.updateInterval+300),{continuous:cn}}function ct(){throw y=setTimeout(()=>{y=null,console.warn("It seems the scroller element isn't scrolling, so it tries to render all the items at once.","Scroller:",ye(f)),console.warn("Make sure the scroller has a fixed height (or width) and 'overflow-y' (or 'overflow-x') set to 'auto' so it can scroll correctly and only render the items visible in the scroll viewport.")}),new Error("Rendered items limit reached")}function At(){if(je())return!1;const P=t.value.filter(({nr:q})=>q.used);for(let q=1;q<P.length;q++)if(P[q].nr.index!==P[q-1].nr.index+1)return!0;return!1}function St(){t.value.sort((P,q)=>P.nr.index-q.nr.index),At()&&(ue(!1),K&&clearTimeout(K))}function Xe(P,q){const ee=ye(n),se=ye(f);if(!se)return;const ae=Math.max(0,Math.min(P,ee.items.length-1)),le=we().start,ce=Jo(se,ee.direction,ee.pageMode),xe=Je(ae),rt=Fe(ae),Pe=yi(xe,rt,le,ce,q==null?void 0:q.align,(q==null?void 0:q.offset)??0);if(Pe!=null&&(bt(Pe,q),ee.gridItems&&ee.itemSize!=null)){const it=ye(f);if(!it)return;const Ue=ee.gridItems,Ie=ee.itemSecondarySize||ee.itemSize,ze=ae%Ue*Ie,ot=ee.direction==="vertical"?"horizontal":"vertical",Ct=ot==="horizontal"?Jt(it.scrollLeft,"horizontal",it):it.scrollTop,Ze=ot==="horizontal"?it.clientWidth:it.clientHeight,at=yi(ze,Ie,Ct,Ze,q==null?void 0:q.align,(q==null?void 0:q.offset)??0);at!=null&&zn(it,ot,at,q)}}function bt(P,q){const ee=ye(n),se=ye(f);if(se)if(ee.pageMode){const ae=bn(se),le=ae.getBoundingClientRect(),ce=se.getBoundingClientRect(),xe=ee.direction==="vertical"?"top":"left",rt=bn(se)===document.documentElement||bn(se)===document.body?ee.direction==="vertical"?window.scrollY:window.scrollX:Jt(ee.direction==="vertical"?ae.scrollTop:ae.scrollLeft,ee.direction,ae),Pe=ce[xe]-le[xe];zn(ae.tagName==="HTML"?window:ae,ee.direction,P+rt+Pe,q)}else zn(se,ee.direction,P,q)}const Be=ye(n);return V=wn(Be.items,Be.items.length>0&&typeof Be.items[0]!="object"?null:Be.keyField),Be.cache&&m(Be.cache),Be.prerender&&(R=!0,ue(!1)),Be.gridItems&&!Be.itemSize&&console.error("[vue-recycle-scroller] You must provide an itemSize when using gridItems"),un(()=>{Le(),yt(()=>{R=!1,ue(!0),u.value=!0})}),vo(()=>{const P=d;typeof P=="number"&&yt(()=>{bt(P)})}),Gn(()=>{Y(),ne(),Re()}),It(()=>ye(n).cache,P=>{m(P),ue(!0)}),It(()=>ye(n).items,(P,q)=>{const ee=ye(n),se=S.value?null:ee.keyField,ae=wn(P,se);if(ee.shift){const le=q?wn(q,se):V;Wo(le,ae)>0?be(q??[],se):ge()}else ge();V=ae,Ce(P),ue(!0)}),It(()=>ye(n).pageMode,()=>{Le(),ue(!1)}),It(A,()=>{Ce()&&De(),ue(!1)},{deep:!0}),It(()=>ye(n).gridItems,()=>{ue(!0)}),It(()=>ye(n).itemSecondarySize,()=>{ue(!0)}),{pool:t,visiblePool:I,totalSize:l,ready:u,sizes:A,simpleArray:S,scrollToItem:Xe,scrollToPosition:bt,getScroll:we,findItemIndex:Ye,getItemOffset:Je,getItemSize:Fe,cacheSnapshot:L,restoreCache:m,updateVisibleItems:ue,handleScroll:re,handleResize:j,handleVisibilityChange:$e,sortViews:St}}const Yn=new WeakMap;function oa(n){return typeof n=="function"?{callback:n,observer:null,intersection:void 0,visible:null}:{callback:n.callback,observer:null,intersection:n.intersection,visible:null}}function wi(n,f){Ri(n);const D=oa(f.value);if(Yn.set(n,D),typeof IntersectionObserver>"u"){const r=n.getBoundingClientRect();D.visible=!0,D.callback(!0,{boundingClientRect:r});return}D.observer=new IntersectionObserver(r=>{const e=r[0],t=!!(e!=null&&e.isIntersecting);D.visible!==null&&D.visible===t||(D.visible=t,D.callback(t,e))},D.intersection),D.observer.observe(n)}function Ri(n){const f=Yn.get(n);f!=null&&f.observer&&(f.observer.disconnect(),f.observer=null)}const aa={mounted(n,f){wi(n,f)},updated(n,f){f.value!==f.oldValue&&wi(n,f)},unmounted(n){Ri(n),Yn.delete(n)}},sa=Ut({__name:"ItemView",props:{view:{},itemTag:{}},setup(n){const f=n;return(D,r)=>(W(),Ee(ki(f.itemTag),{class:"vue-recycle-scroller__item-view"},{default:kt(()=>[qt(D.$slots,"default",{item:f.view.item,index:f.view.nr.index,active:f.view.nr.used})]),_:3}))}}),ra=Ut({__name:"ResizeObserver",emits:["notify"],setup(n,{emit:f}){const D=f,r=he();let e=null,t=null;function l(){D("notify")}return un(()=>{var u;const w=(u=r.value)==null?void 0:u.parentElement;if(w){if(typeof ResizeObserver<"u"){e=new ResizeObserver(()=>{l()}),e.observe(w);return}t=()=>l(),window.addEventListener("resize",t)}}),Gn(()=>{e&&(e.disconnect(),e=null),t&&(window.removeEventListener("resize",t),t=null)}),(u,w)=>(W(),te("div",{ref_key:"el",ref:r,class:"vue-recycle-scroller__resize-observer","aria-hidden":"true"},null,512))}}),la=(n,f)=>{const D=n.__vccOpts||n;for(const[r,e]of f)D[r]=e;return D},ua=la(ra,[["__scopeId","data-v-08cc04ab"]]),ca=Ut({__name:"RecycleScroller",props:{items:{},keyField:{default:"id"},direction:{default:"vertical"},listTag:{default:"div"},itemTag:{default:"div"},itemSize:{default:null},gridItems:{default:void 0},itemSecondarySize:{default:void 0},minItemSize:{default:null},sizeField:{default:"size"},typeField:{default:"type"},buffer:{default:200},pageMode:{type:Boolean,default:!1},shift:{type:Boolean,default:!1},cache:{default:void 0},prerender:{default:0},emitUpdate:{type:Boolean,default:!1},disableTransform:{type:Boolean,default:!1},updateInterval:{default:0},skipHover:{type:Boolean,default:!1},listClass:{default:""},itemClass:{default:""}},emits:["resize","visible","hidden","update","scrollStart","scrollEnd"],setup(n,{expose:f,emit:D}){const r=n,e=D,t=aa,l=he(),u=he(),w=he(),$=he(null),i=ia(r,l,u,w,{onResize:()=>e("resize"),onVisible:()=>e("visible"),onHidden:()=>e("hidden"),onUpdate:(I,L,m,h)=>{e("update",I,L,m,h),m<=0&&e("scrollStart"),h>=r.items.length-1&&e("scrollEnd")}}),{pool:a,visiblePool:o,totalSize:d,ready:v,scrollToItem:R,scrollToPosition:b,getScroll:T,findItemIndex:K,getItemOffset:H,getItemSize:x,cacheSnapshot:V,restoreCache:M,updateVisibleItems:N,handleScroll:y,handleResize:p,handleVisibilityChange:F}=i;function _(I){$.value=I}function S(){$.value=null}const A=Nt(()=>{const I={[r.direction==="vertical"?"minHeight":"minWidth"]:`${d.value}px`};if(r.gridItems&&r.itemSize!=null){const L=(r.itemSecondarySize||r.itemSize)*r.gridItems;I[r.direction==="vertical"?"minWidth":"minHeight"]=`${L}px`}return I});return f({el:l,visiblePool:o,scrollToItem:R,scrollToPosition:b,getScroll:T,findItemIndex:K,getItemOffset:H,getItemSize:x,cacheSnapshot:V,restoreCache:M,updateVisibleItems:N}),(I,L)=>_e((W(),te("div",{ref_key:"el",ref:l,class:vt(["vue-recycle-scroller",{"grid-mode":r.gridItems,ready:B(v),"page-mode":r.pageMode,[`direction-${r.direction}`]:!0}]),onScrollPassive:L[0]||(L[0]=(...m)=>B(y)&&B(y)(...m))},[I.$slots.before?(W(),te("div",{key:0,ref_key:"before",ref:u,class:"vue-recycle-scroller__slot"},[qt(I.$slots,"before")],512)):fe("",!0),(W(),Ee(ki(r.listTag),{style:kn(A.value),class:vt(["vue-recycle-scroller__item-wrapper",r.listClass])},{default:kt(()=>[(W(!0),te(ke,null,pt(B(a),m=>(W(),Ee(sa,fi({key:m.nr.id,view:m,"item-tag":r.itemTag,style:B(v)?[r.disableTransform?{[r.direction==="vertical"?"top":"left"]:`${m.position}px`,willChange:"unset"}:{transform:`translate${r.direction==="vertical"?"Y":"X"}(${m.position}px) translate${r.direction==="vertical"?"X":"Y"}(${m.offset}px)`},{width:r.gridItems?`${r.direction==="vertical"&&r.itemSecondarySize||r.itemSize}px`:void 0,height:r.gridItems?`${r.direction==="horizontal"&&r.itemSecondarySize||r.itemSize}px`:void 0,visibility:m.nr.used?"visible":"hidden"}]:null,class:["vue-recycle-scroller__item-view",[r.itemClass,{hover:!r.skipHover&&$.value===m.nr.key}]]},go(r.skipHover?{}:{mouseenter:()=>{_(m.nr.key)},mouseleave:()=>{S()}})),{default:kt(h=>[qt(I.$slots,"default",fi({ref_for:!0},h))]),_:2},1040,["view","item-tag","style","class"]))),128)),r.items.length===0?qt(I.$slots,"empty",{key:0}):fe("",!0)]),_:3},8,["style","class"])),I.$slots.after?(W(),te("div",{key:1,ref_key:"after",ref:w,class:"vue-recycle-scroller__slot"},[qt(I.$slots,"after")],512)):fe("",!0),ie(ua,{onNotify:B(p)},null,8,["onNotify"])],34)),[[B(t),B(F)]])}}),fa={key:0,class:"chat-info-pan"},da={class:"ss-card chat-info"},ha={key:0},ma={key:1},ga={class:"chat-info-base user"},va=["src"],pa={key:0},ya={class:"info-copy"},wa={class:"info-copy"},ba={class:"info-copy"},ka={style:{"word-break":"break-all"}},Ia={key:1},_a=["innerHTML"],Sa={class:"tags"},Ca={key:2},Ma={class:"info-copy"},Aa={class:"info-copy"},Ta={class:"info-copy"},Ea={style:{"word-break":"break-all"}},xa={class:"info-copy"},Fa=["name"],$a={class:"search-view"},La={for:"info-member-search",class:"sr-only"},Ra=["placeholder"],Da={class:"member-item edit"},Ba=["src"],Oa=["onClick"],Ua=["onClick"],za=["src"],Na={class:"opt-item"},Pa={for:"info-member-card"},Ha={key:0,class:"opt-item"},ja={for:"info-member-title"},qa={class:"opt-item"},Va={for:"info-member-ban-min"},Wa=Ut({name:"ViewInfo",__name:"Info",props:{tags:{},chat:{}},emits:["close"],setup(n,{emit:f}){const D=Tn(),r=Ii(),e=En(),t=_i(),l=n,u=f,{t:w}=xn.global;function $(O){const C=String(O??"");return!C||C==="/img/icons/icon.svg"||C.includes("/img/icons/icon.svg")}function i(){return String(l.chat.show.channel_id||l.chat.show.channelId||l.chat.info.user_info.channel_id||l.chat.info.user_info.channelId||`private:${l.chat.show.id}`)}function a(){return String(l.chat.show.channel_id||l.chat.show.channelId||l.chat.info.group_info.channel_id||l.chat.info.group_info.channelId||`group:${l.chat.show.id}`)}const o=he([]),d=he(""),v=he({}),R=he({});function b(O){return typeof O!="object"||O===null?{}:O}function T(O){return String(b(O).user_id??"")}function K(O){const C=b(O);return String(C.card||C.nickname||C.name||T(O))}function H(O){return String(b(O).avatar??"")}function x(O){return String(b(O).role??"")}const V=he({banMin:0});function M(O,C,z){const Q={title:w("提醒"),html:`<span>${w("真的要将 {user} 移出群聊吗",{user:O})}</span>`,button:[{text:w("确定"),fun:()=>{tt.send("set_group_kick",{group_id:C,user_id:z},"setGroupKick"),t.popBoxList.shift(),v.value={};const X={title:w("操作"),html:`<span>${w("正在确认操作……")}</span>`};t.popBoxList.push(X),di(1e3).then(()=>(hi(String(e.chatInfo.show.id)),di(1e3))).then(()=>{hi(String(e.chatInfo.show.id)),t.popBoxList.shift()})}},{text:w("取消"),master:!0,fun:()=>{t.popBoxList.shift()}}]};t.popBoxList.push(Q)}function N(O){const C=new dt;Xt.config.globalProperties.$copyText(String(O)).then(()=>{C.add(Oe.INFO,w("复制成功"),!0)},()=>{C.add(Oe.ERR,w("复制失败"),!0)})}function y(O,C){const z=O.target.value;if(z!==""){const Q=parseInt(z);if(Q>0){const X={title:w("操作"),html:`<span>${w("确认禁言?")}</span>`,button:[{text:w("确认"),fun:()=>{var Y;const ne=(Y=D.jsonMap.ban_mumber)==null?void 0:Y.name;ne&&tt.send(ne,{group_id:e.chatInfo.show.id,user_id:C.user_id,duration:Q*60},"banMumber"),t.popBoxList.shift(),A()}},{text:w("取消"),master:!0,fun:()=>{R.value=JSON.parse(JSON.stringify(C)),t.popBoxList.shift()}}]};t.popBoxList.push(X)}}}function p(O,C){const z=O.target.value;if(v.value.card!==z){const Q={title:w("操作"),html:`<span>${w("确认修改昵称?")}</span>`,button:[{text:w("确认"),fun:()=>{var ne;const X=(ne=D.jsonMap.set_group_nickname)==null?void 0:ne.name;X&&tt.send(X,{group_id:e.chatInfo.show.id,user_id:C.user_id,card:z},"updateGroupMemberInfo"),t.popBoxList.shift(),A()}},{text:w("取消"),master:!0,fun:()=>{R.value=JSON.parse(JSON.stringify(C)),t.popBoxList.shift()}}]};t.popBoxList.push(Q)}}function F(O,C){const z=O.target.value;if(v.value.card!==z){const Q={title:w("操作"),html:`<span>${w("确认修改头衔?")}</span>`,button:[{text:w("确认"),fun:()=>{var ne;const X=(ne=D.jsonMap.set_group_title)==null?void 0:ne.name;X&&tt.send(X,{group_id:e.chatInfo.show.id,user_id:C.user_id,special_title:z},"updateGroupMemberInfo"),t.popBoxList.shift(),A()}},{text:w("取消"),master:!0,fun:()=>{R.value=JSON.parse(JSON.stringify(C)),t.popBoxList.shift()}}]};t.popBoxList.push(Q)}}function _(O){O<1e10&&(O*=1e3);const C=new Date().getTime(),z=O-C;return z>0?Math.floor(z/1e3/60):0}function S(O){const C=O.target.value;if(C!==""){const z=parseInt(C);isNaN(z)?O.target.value="":z<0&&(O.target.value="0")}}function A(){v.value={},u("close")}function I(O){if(O.user_id!=D.loginInfo.uin){let C=r.userList.find(z=>z.user_id==O.user_id);C||(C={user_id:O.user_id,nickname:w("临时会话"),remark:O.user_id,group_id:O.group_id,group_name:""}),r.baseOnMsgList.set(String(O.user_id),C),yt(()=>{if(C){const z=document.getElementById("user-"+C.user_id);z&&z.click()}})}}function L(O){h(O.role)?(v.value=O,R.value=JSON.parse(JSON.stringify(O)),V.value.banMin=_(O.shut_up_timestamp)):N(O.user_id)}function m(O){O&&(d.value=O.target.value);const C=d.value.trim();if(!C){o.value=[];return}const z=C.toLowerCase(),Q=Array.isArray(l.chat.info.group_members)?l.chat.info.group_members:[];o.value=Ci(Q).filter(X=>{const ne=K(X).toLowerCase(),Y=T(X);return ne.includes(z)||Y.includes(C)||Y.toLowerCase().includes(z)})}It(()=>l.chat.info.group_members,()=>{d.value.trim()&&m()},{deep:!0});function h(O){return l.chat.info.me_info.role==="owner"||l.chat.info.me_info.role==="admin"&&O!=="owner"}return(O,C)=>{const z=Fn("font-awesome-icon");return n.tags.openChatInfo?(W(),te("div",fa,[g("div",da,[g("header",null,[n.chat.show.type==="group"?(W(),te("span",ha,G(B(w)("群资料")),1)):fe("",!0),n.chat.show.type==="user"?(W(),te("span",ma,G(B(w)("好友")),1)):fe("",!0),ie(z,{icon:["fas","xmark"],onClick:A})]),g("div",ga,[g("div",null,[g("img",{"data-avatar":"",src:n.chat.show.avatar||"/img/icons/icon.svg",onError:C[0]||(C[0]=(...Q)=>B(_n)&&B(_n)(...Q))},null,40,va),g("div",null,[g("a",null,G(n.chat.show.name),1),g("span",null,G(n.chat.show.id),1)]),g("div",{style:{display:"flex","align-items":"center","justify-content":"center",cursor:"pointer"},onClick:C[1]||(C[1]=Q=>N(n.chat.show.id))},[ie(z,{icon:["fas","copy"]})])]),n.chat.show.type==="group"?(W(),te("div",pa,[g("header",null,[g("span",null,G(B(w)("群组 ID")),1)]),g("div",ya,[g("span",null,G(n.chat.show.id),1),ie(z,{icon:["fas","copy"],onClick:C[2]||(C[2]=Q=>N(n.chat.show.id))})]),g("header",null,[g("span",null,G(B(w)("频道 ID")),1)]),g("div",wa,[g("span",null,G(a()),1),ie(z,{icon:["fas","copy"],onClick:C[3]||(C[3]=Q=>N(a()))})]),g("header",null,[g("span",null,G(B(w)("群头像")),1)]),g("div",ba,[g("span",ka,G($(n.chat.show.avatar)?B(w)("无"):n.chat.show.avatar),1),$(n.chat.show.avatar)?fe("",!0):(W(),Ee(z,{key:0,icon:["fas","copy"],onClick:C[4]||(C[4]=Q=>N(n.chat.show.avatar))}))])])):fe("",!0),n.chat.show.type==="group"?_e((W(),te("div",Ia,[g("header",null,[g("span",null,G(B(w)("介绍")),1)]),g("span",{innerHTML:n.chat.info.group_info.gIntro===void 0||n.chat.info.group_info.gIntro===""?B(w)("群主很懒,还没有群介绍哦~"):n.chat.info.group_info.gIntro},null,8,_a),g("div",Sa,[(W(!0),te(ke,null,pt(n.chat.info.group_info.tags,Q=>(W(),te("div",{key:Q.md},G(Q.tag),1))),128))])],512)),[[We,Object.keys(n.chat.info.group_info).length>0]]):n.chat.show.type==="user"?(W(),te("div",Ca,[g("header",null,[g("span",null,G(B(w)("用户 ID")),1)]),g("div",Ma,[g("span",null,G(n.chat.show.id),1),ie(z,{icon:["fas","copy"],onClick:C[5]||(C[5]=Q=>N(n.chat.show.id))})]),g("header",null,[g("span",null,G(B(w)("用户名称")),1)]),g("div",Aa,[g("span",null,G(n.chat.show.name),1),ie(z,{icon:["fas","copy"],onClick:C[6]||(C[6]=Q=>N(n.chat.show.name))})]),g("header",null,[g("span",null,G(B(w)("用户头像链接")),1)]),g("div",Ta,[g("span",Ea,G($(n.chat.show.avatar)?B(w)("无"):n.chat.show.avatar),1),$(n.chat.show.avatar)?fe("",!0):(W(),Ee(z,{key:0,icon:["fas","copy"],onClick:C[7]||(C[7]=Q=>N(n.chat.show.avatar))}))]),g("header",null,[g("span",null,G(B(w)("频道 ID")),1)]),g("div",xa,[g("span",null,G(i()),1),ie(z,{icon:["fas","copy"],onClick:C[8]||(C[8]=Q=>N(i()))})])])):fe("",!0)]),n.chat.show.type==="group"?(W(),Ee(B(Si),{key:0,class:"chat-info-tab"},{default:kt(()=>[g("div",{name:B(w)("成员")},[g("div",$a,[g("label",La,G(B(w)("搜索成员")),1),g("input",{id:"info-member-search",placeholder:B(w)("搜索 ……"),onInput:C[9]||(C[9]=Q=>m(Q))},null,40,Ra)]),ie(B(ca),{class:"member-scroller",items:d.value.trim()?o.value:n.chat.info.group_members,"item-size":60,"key-field":"user_id"},{default:kt(({item:Q})=>[g("div",Da,[g("img",{alt:"nk",loading:"lazy","data-avatar":"",src:H(Q)||"/img/icons/icon.svg"},null,8,Ba),g("div",null,[g("a",{onClick:X=>I(Q)},G(K(Q)),9,Oa),x(Q)==="owner"?(W(),Ee(z,{key:0,icon:["fas","crown"]})):fe("",!0),x(Q)==="admin"?(W(),Ee(z,{key:1,icon:["fas","star"]})):fe("",!0)]),g("span",{onClick:X=>L(Q)},G(T(Q)),9,Ua),h(x(Q))?(W(),Ee(z,{key:0,icon:["fas","wrench"],onClick:X=>L(Q)},null,8,["onClick"])):(W(),Ee(z,{key:1,icon:["fas","copy"],onClick:X=>N(T(Q))},null,8,["onClick"]))])]),_:1},8,["items"])],8,Fa)]),_:1})):fe("",!0),g("div",{class:vt("ss-card user-config"+(Object.keys(v.value).length>0?" show":""))},[g("div",null,[g("img",{alt:"nk","data-avatar":"",src:v.value.avatar||"/img/icons/icon.svg"},null,8,za),g("div",null,[g("a",null,G(v.value.card!=""?v.value.card:v.value.nickname),1),g("span",null,G(v.value.user_id),1)]),ie(z,{style:{"margin-right":"20px"},icon:["fas","copy"],onClick:C[10]||(C[10]=Q=>N(v.value.user_id))}),ie(z,{icon:["fas","angle-down"],onClick:C[11]||(C[11]=Q=>v.value={})})]),g("div",null,[g("header",null,G(B(w)("成员信息")),1),g("div",Na,[ie(z,{icon:["fas","clipboard-list"]}),g("div",null,[g("label",Pa,G(B(w)("成员昵称")),1),g("span",null,G(B(w)("啊吧啊吧……")),1)]),_e(g("input",{id:"info-member-card","onUpdate:modelValue":C[12]||(C[12]=Q=>R.value.card=Q),style:{width:"50%"},class:"ss-input",type:"text",onChange:C[13]||(C[13]=Q=>p(Q,v.value))},null,544),[[ln,R.value.card]])]),n.chat.info.me_info.role==="owner"?(W(),te("div",Ha,[ie(z,{icon:["fas","clipboard-list"]}),g("div",null,[g("label",ja,G(B(w)("成员头衔")),1),g("span",null,G(B(w)("猪咪猪咪")),1)]),_e(g("input",{id:"info-member-title","onUpdate:modelValue":C[14]||(C[14]=Q=>R.value.title=Q),style:{width:"50%"},class:"ss-input",type:"text",onChange:C[15]||(C[15]=Q=>F(Q,v.value))},null,544),[[ln,R.value.title]])])):fe("",!0),n.chat.info.me_info.role==="owner"&&v.value.role!="owner"||n.chat.info.me_info.role==="admin"&&v.value.role==="member"?(W(),te(ke,{key:1},[g("header",null,G(B(w)("操作")),1),g("div",qa,[ie(z,{icon:["fas","clipboard-list"]}),g("div",null,[g("label",Va,G(B(w)("禁言成员")),1),g("span",null,G(B(w)("要让小猫咪不许说话几分钟呢?")),1)]),_e(g("input",{id:"info-member-ban-min","onUpdate:modelValue":C[16]||(C[16]=Q=>V.value.banMin=Q),style:{width:"50%"},class:"ss-input",type:"text",onInput:S,onChange:C[17]||(C[17]=Q=>y(Q,v.value))},null,544),[[ln,V.value.banMin]])]),g("button",{class:"ss-button",onClick:C[18]||(C[18]=Q=>M(v.value.nickname,n.chat.show.id,v.value.user_id))},G(B(w)("移出群聊")),1)],64)):fe("",!0)])],2)])])):fe("",!0)}}}),Qa=$n(Wa,[["__scopeId","data-v-464b43c3"]]),Ga=["id"],Ka={key:0,class:"note-recall note-base"},Ja={key:1,class:"note-ban note-base"},Ya={key:1},Xa={key:2,class:"note-recall note-base"},Za=["innerHTML"],es={key:4,class:"note-time note-base"},jt=Ut({name:"NoticeBody",__name:"NoticeBody",props:["data","id"],emits:["reedit"],setup(n){const f=xn.global.t,D=Tn(),r=En(),e=n,t=Mi(),l=he(e.data);function u(i){return D.loginInfo.uin===i}function w(i){const a=r.chatInfo.info.group_members.filter(o=>o.user_id===i);return a.length===1?a[0].card===""||a[0].card==null?a[0].nickname:a[0].card:i}function $(i){const a=Math.floor(i/86400),o=Math.floor(i%86400/3600),d=Math.floor(i%3600/60),v=i%60;let R="";return a>0&&(R+=`${a} ${f("天")} `),o>0&&(R+=`${o} ${f("小时")} `),d>0&&(R+=`${d} ${f("分钟")} `),v>0&&(R+=`${v} ${f("秒")} `),R}return un(async()=>{var a;let i=null;if(i=await wt.call(void 0,"win:getWindowInfo",!0),l.value.notice_type&&l.value.notice_type.indexOf("recall")>=0)if(r.chatInfo.show.type==="group"){const o=l.value.operator_id;if(r.chatInfo.info.group_members!==void 0){const d=r.chatInfo.info.group_members.filter(v=>v.user_id===Number(o));d.length===1?l.value.name=d[0].card===""||d[0].card==null?d[0].nickname:d[0].card:l.value.name=o}else l.value.name=o}else l.value.name=r.chatInfo.show.name;if(l.value.sub_type==="poke"&&l.value.pokeMe&&l.value==r.messageList[r.messageList.length-1]){let o=document.getElementById("app");wt.isDesktop()&&(o=(a=document.getElementById("notice-"+e.id))==null?void 0:a.getElementsByClassName("space")[0]),yo(o,i)}}),(i,a)=>(W(),te("div",{id:"notice-"+n.id,class:"note"},[n.data.notice_type&&n.data.notice_type.indexOf("recall")>=0?(W(),te("div",Ka,[g("a",null,G(l.value.name),1),g("span",null,G(B(f)("撤回了一条消息")),1),a[1]||(a[1]=g("div",null,null,-1)),n.data.originMsg?(W(),te("a",{key:0,onClick:a[0]||(a[0]=o=>i.$emit("reedit",n.data.originMsg))},G(B(f)("重新编辑")),1)):fe("",!0)])):n.data.notice_type=="group_ban"?(W(),te("div",Ja,[n.data.sub_type==="ban"?(W(),te(ke,{key:0},[u(n.data.user_id)?(W(),te(ke,{key:0},[g("span",null,G(B(f)("成员类型_admin")),1),g("a",null," "+G(w(n.data.operator_id))+" ",1),g("span",null,G(B(f)("禁言了你")),1),g("span",null," "+G($(n.data.duration)),1)],64)):(W(),te(ke,{key:1},[g("span",null,G(B(f)("管理员禁言了")),1),g("a",null," "+G(w(n.data.user_id))+" ",1),g("span",null,G($(n.data.duration)),1)],64))],64)):(W(),te("span",Ya,G(B(f)("管理员解除了 {name} 的禁言",{name:u(n.data.user_id)?B(f)("你"):w(n.data.user_id)})),1))])):n.data.sub_type==="delete"?(W(),te("div",Xa,[g("span",null,G(B(f)("这条消息迷失在虚空里了")),1),a[2]||(a[2]=g("div",null,null,-1))])):n.data.sub_type==="poke"?(W(),te("div",{key:3,class:"note-notify note-base",innerHTML:n.data.str+"<div class='space'</div>"},null,8,Za)):n.data.sub_type==="time"&&n.data.time!=null?(W(),te("div",es,[g("a",null,G(Intl.DateTimeFormat(B(t),B(Ai)(new Date(n.data.time*1e3))).format(new Date(n.data.time*1e3))),1)])):fe("",!0)],8,Ga))}}),ts=["src","alt"],ns=Ut({__name:"CustomFaceTooltip",props:{url:{}},setup(n){return(f,D)=>(W(),te("img",{src:n.url,alt:f.$t("预览图片加载失败"),class:"custom-face-tooltip"},null,8,ts))}}),is=$n(ns,[["__scopeId","data-v-28512f0d"]]),os={class:"ss-card face-pan"},as={icon:"fa-solid fa-face-laugh-squint"},ss={class:"system-face-bar"},rs={class:"title"},ls={class:"face"},us={class:"title"},cs={class:"face"},fs={icon:"fa-solid fa-heart"},ds={class:"title"},hs={class:"face"},ms=["src","alt","onClick"],gs={class:"title"},vs={class:"face"},ps={key:0,class:"ss-card"},ys=["src","alt","onClick"],ws={key:0,icon:"fa-solid fa-folder-open"},bs={class:"system-face-bar custom-face-bar"},ks={class:"title"},Is={class:"face"},_s=["src","alt","onClick"],Ss={class:"title"},Cs={class:"face"},Ms={key:0,class:"ss-card"},As={key:1,class:"ss-card"},Ts=["src","alt","onClick"],Es=Ut({__name:"FacePan",emits:["addSpecialMsg","sendMsg"],setup(n,{emit:f}){const{recordList:D,showList:r}=y("recent-emojis-id"),{recordList:e,showList:t}=y("recent-custom-faces-id"),{recordList:l,showList:u}=y("recent-local-faces-id"),w=Nt(()=>{const _=[];for(const S of u.value){const A=v.value.find(I=>I.path===S);A&&_.push(A)}return _}),$=new dt,i=wo(),a=Kn(),o=Tn(),d=mi(1),v=mi([]),R=f;i.stickerCache&&i.stickerCache.length==0&&o.jsonMap.roaming_stamp&&K(),wt.isDesktop()&&a.sysConfig.local_emoji_folder&&M();function b(_,S){R("addSpecialMsg",{addText:S,msgObj:_})}function T(_){p(D,_),_<5e3?b({type:"face",id:_},!0):b({type:"text",text:sn.get(_).value},!0)}function K(){i.stickerCache=void 0,o.jsonMap.roaming_stamp.pagerType=="full"?tt.send(o.jsonMap.roaming_stamp.name,{count:48},"getRoamingStamp_48"):tt.send(o.jsonMap.roaming_stamp.name,{},"getRoamingStamp")}function H(_){const S=_.target;if(S.scrollHeight-S.scrollTop<S.clientHeight+.5&&i.stickerCache&&o.jsonMap.roaming_stamp.pagerType=="full"&&i.stickerCache[i.stickerCache.length-1]!="end"){const A=48+48*d.value;tt.send(o.jsonMap.roaming_stamp.name,{count:A},"getRoamingStamp_"+A),d.value++}}function x(_){p(e,_),b({type:"image",file:_,subType:1},!0),a.sysConfig.send_face==!0&&R("sendMsg")}async function V(){const{$t:_}=Xt.config.globalProperties;try{const S=await wt.call(void 0,"sys:selectFolder",!0);S&&(Ei.save("local_emoji_folder",S),$.add(Oe.INFO,_("已设置本地表情文件夹")),M())}catch{$.add(Oe.ERR,_("选择文件夹失败"))}}async function M(){try{const _=a.sysConfig.local_emoji_folder;if(!_){v.value=[];return}const S=await wt.call(void 0,"sys:getLocalEmojis",!0,_);if(S&&Array.isArray(S))if(wt.type==="tauri"){const{convertFileSrc:A}=await Ti(async()=>{const{convertFileSrc:I}=await import("./core-DhEqZVGG.js");return{convertFileSrc:I}},[],import.meta.url);v.value=S.map(I=>({name:I.name,path:I.path,url:A(I.path)}))}else v.value=S.map(A=>({name:A.name,path:A.path,url:A.url}));else v.value=[]}catch{v.value=[]}}async function N(_){try{const S=await wt.call(void 0,"sys:readFileAsBase64",!0,_.path);p(l,_.path),b({type:"image",file:"base64://"+S,subType:1},!0),a.sysConfig.send_face==!0&&R("sendMsg")}catch{const{$t:A}=Xt.config.globalProperties;$.add(Oe.ERR,A("添加本地表情失败"))}}function y(_){const S=bo(_,[]),A=Nt(()=>{if(a.sysConfig.record_recent_emoji==="none")return[];if(a.sysConfig.record_recent_emoji==="order")return S.value.slice(0,30);{const I=new Map;for(const L of S.value)I.set(L,(I.get(L)||0)+1);return Array.from(I.entries()).sort((L,m)=>m[1]-L[1]).map(L=>L[0]).slice(0,30)}});return{recordList:S,showList:A}}function p(_,S){if(a.sysConfig.record_recent_emoji==="none")return;let A;switch(a.sysConfig.record_recent_emoji){case"order":A=30;break;case"100times":A=100;break;case"500times":A=500;break;default:throw new Error("Invalid recent emoji record setting")}const I=_.value;if(a.sysConfig.record_recent_emoji==="order"){const L=I.indexOf(S);L!==-1&&I.splice(L,1)}I.unshift(S),I.length>A&&I.pop(),_.value=I}function F(_){return{comp:is,model:void 0,props:{url:_}}}return(_,S)=>{const A=Fn("font-awesome-icon");return W(),te("div",os,[ie(B(Si),null,{default:kt(()=>[g("div",as,[g("div",ss,[B(r).length>0?(W(),te(ke,{key:0},[g("div",rs,[g("span",null,G(_.$t("最近使用")),1)]),g("div",ls,[(W(!0),te(ke,null,pt(B(r),I=>(W(),te("div",{key:I},[ie(Wn,{emoji:B(sn).get(I),onClick:L=>T(I)},null,8,["emoji","onClick"])]))),128))])],64)):fe("",!0),g("div",us,[g("span",null,G(_.$t("emoji 表情")),1)]),g("div",cs,[(W(!0),te(ke,null,pt(B(sn).emojiList,I=>(W(),te("div",{key:I},[ie(Wn,{emoji:B(sn).get(I),onClick:L=>T(I)},null,8,["emoji","onClick"])]))),128))])])]),g("div",fs,[g("div",{class:"system-face-bar custom-face-bar",onScroll:H},[B(t).length>0?(W(),te(ke,{key:0},[g("div",ds,[g("span",null,G(_.$t("最近使用")),1)]),g("div",hs,[(W(!0),te(ke,null,pt(B(t),(I,L)=>_e((W(),te("span",{key:L},[g("img",{loading:"lazy",src:I,alt:"["+_.$t("动画表情")+"]",onClick:m=>x(I)},null,8,ms)])),[[B(mn),F(I)]])),128))])],64)):fe("",!0),g("div",gs,[g("span",null,G(_.$t("收藏的表情")),1),ie(A,{icon:["fas","fa-rotate-right"],onClick:K})]),g("div",vs,[B(i).stickerCache&&B(i).stickerCache.length<=0?(W(),te("div",ps,[ie(A,{icon:["fas","face-dizzy"]}),g("span",null,G(_.$t("一无所有")),1)])):B(i).stickerCache&&B(i).stickerCache.length>0?(W(!0),te(ke,{key:1},pt(B(i).stickerCache,(I,L)=>(W(),te("span",{key:"stickers-"+L},[_e(g("img",{loading:"lazy",src:I,alt:"["+_.$t("动画表情")+"]",onClick:m=>x(I)},null,8,ys),[[We,I!="end"],[B(mn),F(I)]])]))),128)):fe("",!0)])],32)]),B(wt).isDesktop()?(W(),te("div",ws,[g("div",bs,[w.value.length>0?(W(),te(ke,{key:0},[g("div",ks,[g("span",null,G(_.$t("最近使用")),1)]),g("div",Is,[(W(!0),te(ke,null,pt(w.value,(I,L)=>(W(),te("span",{key:L},[_e(g("img",{loading:"lazy",src:I.url,alt:"["+_.$t("动画表情")+"]",onClick:m=>N(I)},null,8,_s),[[B(mn),F(I.url)]])]))),128))])],64)):fe("",!0),g("div",Ss,[g("span",null,G(_.$t("本地表情")),1),ie(A,{icon:["fas","fa-folder-plus"],title:_.$t("选择文件夹"),onClick:V},null,8,["title"]),B(a).sysConfig.local_emoji_folder?(W(),Ee(A,{key:0,icon:["fas","fa-rotate-right"],title:_.$t("重新加载"),onClick:M},null,8,["title"])):fe("",!0)]),g("div",Cs,[B(a).sysConfig.local_emoji_folder?B(a).sysConfig.local_emoji_folder&&v.value.length<=0?(W(),te("div",As,[ie(A,{icon:["fas","face-dizzy"]}),g("span",null,G(_.$t("暂无图片")),1)])):B(a).sysConfig.local_emoji_folder&&v.value.length>0?(W(!0),te(ke,{key:2},pt(v.value,(I,L)=>(W(),te("span",{key:L},[_e(g("img",{loading:"lazy",src:I.url,alt:"["+_.$t("动画表情")+"]",onClick:m=>N(I)},null,8,Ts),[[B(mn),F(I.url)]])]))),128)):fe("",!0):(W(),te("div",Ms,[ie(A,{icon:["fas","folder-open"]}),g("span",null,G(_.$t("选择文件夹")),1)]))])])])):fe("",!0)]),_:1})])}}}),xs={class:"ss-card"},Fs={key:0},$s=Ut({name:"MergePan",__name:"MergePan",setup(n,{expose:f}){const D=xn.global.t,r=En(),e=Kn(),t=r.mergeMsgStack,l=he(),u=Nt(()=>{var a;return Vn.fromList((((a=l.value)==null?void 0:a.imageList)??[]).map(o=>o.img_url))});function w(){t.length--}function $(){t.length=0}function i(){return t.length>0}return f({closeMergeMsg:$,isMergeOpen:i}),un(()=>{It(()=>r.mergeMsgStack.length,()=>{t.length===0?r.mergeMessageImgList=void 0:l.value=t.at(-1)}),It(()=>{var a;return(a=l.value)==null?void 0:a.imageList},()=>{var a;r.mergeMsgStack.length===0||((a=l.value)==null?void 0:a.imageList)===void 0||(r.mergeMessageImgList=l.value.imageList)})}),(a,o)=>{const d=Fn("font-awesome-icon");return W(),te("div",{class:vt("merge-pan"+(B(r).mergeMsgStack.length>0?" show":""))},[g("div",{onClick:$}),g("div",xs,[g("div",null,[ie(d,{style:{"margin-top":"5px"},icon:["fas","message"]}),g("span",null,G(B(D)("合并消息")),1),B(t).length<=1?(W(),Ee(d,{key:0,icon:["fas","xmark"],onClick:w})):(W(),Ee(d,{key:1,icon:["fas","angles-left"],onClick:w}))]),l.value===void 0?(W(),te("div",Fs)):(W(),Ee(qn,{key:1,name:B(e).sysConfig.opt_fast_animation?"":"msglist",tag:"div"},{default:kt(()=>[(W(!0),te(ke,null,pt(l.value.messageList,(v,R)=>(W(),te(ke,{key:"merge-"+l.value.forwardMsg.message[0].id+"-"+R},[B(jn)(l.value.messageList[R-1]?l.value.messageList[R-1].time:void 0,v.time,R==0)?(W(),Ee(jt,{id:B(xi)(),key:"notice-time-"+R,data:{sub_type:"time",time:v.time}},null,8,["id","data"])):B(Fi)(v)?(W(),Ee(jt,{key:"delete-"+v.message_id,data:{sub_type:"delete"}})):fe("",!0),ie(rn,{data:v,type:"merge","image-list-header":u.value},null,8,["data","image-list-header"])],64))),128))]),_:1},8,["name"]))])],2)}}}),Ls=$n($s,[["__scopeId","data-v-5a030688"]]);function Rs(n,f){return f.forEach((function(D){D&&typeof D!="string"&&!Array.isArray(D)&&Object.keys(D).forEach((function(r){if(r!=="default"&&!(r in n)){var e=Object.getOwnPropertyDescriptor(D,r);Object.defineProperty(n,r,e.get?e:{enumerable:!0,get:function(){return D[r]}})}}))})),Object.freeze(n)}function Di(n,f){return new Promise((function(D,r){let e;return Ds(n).then((function(t){try{return e=t,D(new Blob([f.slice(0,2),e,f.slice(2)],{type:"image/jpeg"}))}catch(l){return r(l)}}),r)}))}const Ds=n=>new Promise(((f,D)=>{const r=new FileReader;r.addEventListener("load",(({target:{result:e}})=>{const t=new DataView(e);let l=0;if(t.getUint16(l)!==65496)return D("not a valid JPEG");for(l+=2;;){const u=t.getUint16(l);if(u===65498)break;const w=t.getUint16(l+2);if(u===65505&&t.getUint32(l+4)===1165519206){const $=l+10;let i;switch(t.getUint16($)){case 18761:i=!0;break;case 19789:i=!1;break;default:return D("TIFF header contains invalid endian")}if(t.getUint16($+2,i)!==42)return D("TIFF header contains invalid version");const a=t.getUint32($+4,i),o=$+a+2+12*t.getUint16($+a,i);for(let d=$+a+2;d<o;d+=12)if(t.getUint16(d,i)==274){if(t.getUint16(d+2,i)!==3)return D("Orientation data type is invalid");if(t.getUint32(d+4,i)!==1)return D("Orientation data count is invalid");t.setUint16(d+8,1,i);break}return f(e.slice(l,l+2+w))}l+=2+w}return f(new Blob)})),r.readAsArrayBuffer(n)}));var Sn={},Bs={get exports(){return Sn},set exports(n){Sn=n}};(function(n){var f,D,r={};Bs.exports=r,r.parse=function(e,t){for(var l=r.bin.readUshort,u=r.bin.readUint,w=0,$={},i=new Uint8Array(e),a=i.length-4;u(i,a)!=101010256;)a--;w=a,w+=4;var o=l(i,w+=4);l(i,w+=2);var d=u(i,w+=2),v=u(i,w+=4);w+=4,w=v;for(var R=0;R<o;R++){u(i,w),w+=4,w+=4,w+=4,u(i,w+=4),d=u(i,w+=4);var b=u(i,w+=4),T=l(i,w+=4),K=l(i,w+2),H=l(i,w+4);w+=6;var x=u(i,w+=8);w+=4,w+=T+K+H,r._readLocal(i,x,$,d,b,t)}return $},r._readLocal=function(e,t,l,u,w,$){var i=r.bin.readUshort,a=r.bin.readUint;a(e,t),i(e,t+=4),i(e,t+=2);var o=i(e,t+=2);a(e,t+=2),a(e,t+=4),t+=4;var d=i(e,t+=8),v=i(e,t+=2);t+=2;var R=r.bin.readUTF8(e,t,d);if(t+=d,t+=v,$)l[R]={size:w,csize:u};else{var b=new Uint8Array(e.buffer,t);if(o==0)l[R]=new Uint8Array(b.buffer.slice(t,t+u));else{if(o!=8)throw"unknown compression method: "+o;var T=new Uint8Array(w);r.inflateRaw(b,T),l[R]=T}}},r.inflateRaw=function(e,t){return r.F.inflate(e,t)},r.inflate=function(e,t){return e[0],e[1],r.inflateRaw(new Uint8Array(e.buffer,e.byteOffset+2,e.length-6),t)},r.deflate=function(e,t){t==null&&(t={level:6});var l=0,u=new Uint8Array(50+Math.floor(1.1*e.length));u[l]=120,u[l+1]=156,l+=2,l=r.F.deflateRaw(e,u,l,t.level);var w=r.adler(e,0,e.length);return u[l+0]=w>>>24&255,u[l+1]=w>>>16&255,u[l+2]=w>>>8&255,u[l+3]=w>>>0&255,new Uint8Array(u.buffer,0,l+4)},r.deflateRaw=function(e,t){t==null&&(t={level:6});var l=new Uint8Array(50+Math.floor(1.1*e.length)),u=r.F.deflateRaw(e,l,u,t.level);return new Uint8Array(l.buffer,0,u)},r.encode=function(e,t){t==null&&(t=!1);var l=0,u=r.bin.writeUint,w=r.bin.writeUshort,$={};for(var i in e){var a=!r._noNeed(i)&&!t,o=e[i],d=r.crc.crc(o,0,o.length);$[i]={cpr:a,usize:o.length,crc:d,file:a?r.deflateRaw(o):o}}for(var i in $)l+=$[i].file.length+30+46+2*r.bin.sizeUTF8(i);l+=22;var v=new Uint8Array(l),R=0,b=[];for(var i in $){var T=$[i];b.push(R),R=r._writeHeader(v,R,i,T,0)}var K=0,H=R;for(var i in $)T=$[i],b.push(R),R=r._writeHeader(v,R,i,T,1,b[K++]);var x=R-H;return u(v,R,101010256),R+=4,w(v,R+=4,K),w(v,R+=2,K),u(v,R+=2,x),u(v,R+=4,H),R+=4,R+=2,v.buffer},r._noNeed=function(e){var t=e.split(".").pop().toLowerCase();return"png,jpg,jpeg,zip".indexOf(t)!=-1},r._writeHeader=function(e,t,l,u,w,$){var i=r.bin.writeUint,a=r.bin.writeUshort,o=u.file;return i(e,t,w==0?67324752:33639248),t+=4,w==1&&(t+=2),a(e,t,20),a(e,t+=2,0),a(e,t+=2,u.cpr?8:0),i(e,t+=2,0),i(e,t+=4,u.crc),i(e,t+=4,o.length),i(e,t+=4,u.usize),a(e,t+=4,r.bin.sizeUTF8(l)),a(e,t+=2,0),t+=2,w==1&&(t+=2,t+=2,i(e,t+=6,$),t+=4),t+=r.bin.writeUTF8(e,t,l),w==0&&(e.set(o,t),t+=o.length),t},r.crc={table:(function(){for(var e=new Uint32Array(256),t=0;t<256;t++){for(var l=t,u=0;u<8;u++)1&l?l=3988292384^l>>>1:l>>>=1;e[t]=l}return e})(),update:function(e,t,l,u){for(var w=0;w<u;w++)e=r.crc.table[255&(e^t[l+w])]^e>>>8;return e},crc:function(e,t,l){return 4294967295^r.crc.update(4294967295,e,t,l)}},r.adler=function(e,t,l){for(var u=1,w=0,$=t,i=t+l;$<i;){for(var a=Math.min($+5552,i);$<a;)w+=u+=e[$++];u%=65521,w%=65521}return w<<16|u},r.bin={readUshort:function(e,t){return e[t]|e[t+1]<<8},writeUshort:function(e,t,l){e[t]=255&l,e[t+1]=l>>8&255},readUint:function(e,t){return 16777216*e[t+3]+(e[t+2]<<16|e[t+1]<<8|e[t])},writeUint:function(e,t,l){e[t]=255&l,e[t+1]=l>>8&255,e[t+2]=l>>16&255,e[t+3]=l>>24&255},readASCII:function(e,t,l){for(var u="",w=0;w<l;w++)u+=String.fromCharCode(e[t+w]);return u},writeASCII:function(e,t,l){for(var u=0;u<l.length;u++)e[t+u]=l.charCodeAt(u)},pad:function(e){return e.length<2?"0"+e:e},readUTF8:function(e,t,l){for(var u,w="",$=0;$<l;$++)w+="%"+r.bin.pad(e[t+$].toString(16));try{u=decodeURIComponent(w)}catch{return r.bin.readASCII(e,t,l)}return u},writeUTF8:function(e,t,l){for(var u=l.length,w=0,$=0;$<u;$++){var i=l.charCodeAt($);if((4294967168&i)==0)e[t+w]=i,w++;else if((4294965248&i)==0)e[t+w]=192|i>>6,e[t+w+1]=128|i>>0&63,w+=2;else if((4294901760&i)==0)e[t+w]=224|i>>12,e[t+w+1]=128|i>>6&63,e[t+w+2]=128|i>>0&63,w+=3;else{if((4292870144&i)!=0)throw"e";e[t+w]=240|i>>18,e[t+w+1]=128|i>>12&63,e[t+w+2]=128|i>>6&63,e[t+w+3]=128|i>>0&63,w+=4}}return w},sizeUTF8:function(e){for(var t=e.length,l=0,u=0;u<t;u++){var w=e.charCodeAt(u);if((4294967168&w)==0)l++;else if((4294965248&w)==0)l+=2;else if((4294901760&w)==0)l+=3;else{if((4292870144&w)!=0)throw"e";l+=4}}return l}},r.F={},r.F.deflateRaw=function(e,t,l,u){var w=[[0,0,0,0,0],[4,4,8,4,0],[4,5,16,8,0],[4,6,16,16,0],[4,10,16,32,0],[8,16,32,32,0],[8,16,128,128,0],[8,32,128,256,0],[32,128,258,1024,1],[32,258,258,4096,1]][u],$=r.F.U,i=r.F._goodIndex;r.F._hash;var a=r.F._putsE,o=0,d=l<<3,v=0,R=e.length;if(u==0){for(;o<R;)a(t,d,o+(_=Math.min(65535,R-o))==R?1:0),d=r.F._copyExact(e,o,_,t,d+8),o+=_;return d>>>3}var b=$.lits,T=$.strt,K=$.prev,H=0,x=0,V=0,M=0,N=0,y=0;for(R>2&&(T[y=r.F._hash(e,0)]=0),o=0;o<R;o++){if(N=y,o+1<R-2){y=r.F._hash(e,o+1);var p=o+1&32767;K[p]=T[y],T[y]=p}if(v<=o){(H>14e3||x>26697)&&R-o>100&&(v<o&&(b[H]=o-v,H+=2,v=o),d=r.F._writeBlock(o==R-1||v==R?1:0,b,H,M,e,V,o-V,t,d),H=x=M=0,V=o);var F=0;o<R-2&&(F=r.F._bestMatch(e,o,K,N,Math.min(w[2],R-o),w[3]));var _=F>>>16,S=65535&F;if(F!=0){S=65535&F;var A=i(_=F>>>16,$.of0);$.lhst[257+A]++;var I=i(S,$.df0);$.dhst[I]++,M+=$.exb[A]+$.dxb[I],b[H]=_<<23|o-v,b[H+1]=S<<16|A<<8|I,H+=2,v=o+_}else $.lhst[e[o]]++;x++}}for(V==o&&e.length!=0||(v<o&&(b[H]=o-v,H+=2,v=o),d=r.F._writeBlock(1,b,H,M,e,V,o-V,t,d),H=0,x=0,H=x=M=0,V=o);(7&d)!=0;)d++;return d>>>3},r.F._bestMatch=function(e,t,l,u,w,$){var i=32767&t,a=l[i],o=i-a+32768&32767;if(a==i||u!=r.F._hash(e,t-o))return 0;for(var d=0,v=0,R=Math.min(32767,t);o<=R&&--$!=0&&a!=i;){if(d==0||e[t+d]==e[t+d-o]){var b=r.F._howLong(e,t,o);if(b>d){if(v=o,(d=b)>=w)break;o+2<b&&(b=o+2);for(var T=0,K=0;K<b-2;K++){var H=t-o+K+32768&32767,x=H-l[H]+32768&32767;x>T&&(T=x,a=H)}}}o+=(i=a)-(a=l[i])+32768&32767}return d<<16|v},r.F._howLong=function(e,t,l){if(e[t]!=e[t-l]||e[t+1]!=e[t+1-l]||e[t+2]!=e[t+2-l])return 0;var u=t,w=Math.min(e.length,t+258);for(t+=3;t<w&&e[t]==e[t-l];)t++;return t-u},r.F._hash=function(e,t){return(e[t]<<8|e[t+1])+(e[t+2]<<4)&65535},r.saved=0,r.F._writeBlock=function(e,t,l,u,w,$,i,a,o){var d,v,R,b,T,K,H,x,V,M=r.F.U,N=r.F._putsF,y=r.F._putsE;M.lhst[256]++,v=(d=r.F.getTrees())[0],R=d[1],b=d[2],T=d[3],K=d[4],H=d[5],x=d[6],V=d[7];var p=32+((o+3&7)==0?0:8-(o+3&7))+(i<<3),F=u+r.F.contSize(M.fltree,M.lhst)+r.F.contSize(M.fdtree,M.dhst),_=u+r.F.contSize(M.ltree,M.lhst)+r.F.contSize(M.dtree,M.dhst);_+=14+3*H+r.F.contSize(M.itree,M.ihst)+(2*M.ihst[16]+3*M.ihst[17]+7*M.ihst[18]);for(var S=0;S<286;S++)M.lhst[S]=0;for(S=0;S<30;S++)M.dhst[S]=0;for(S=0;S<19;S++)M.ihst[S]=0;var A=p<F&&p<_?0:F<_?1:2;if(N(a,o,e),N(a,o+1,A),o+=3,A==0){for(;(7&o)!=0;)o++;o=r.F._copyExact(w,$,i,a,o)}else{var I,L;if(A==1&&(I=M.fltree,L=M.fdtree),A==2){r.F.makeCodes(M.ltree,v),r.F.revCodes(M.ltree,v),r.F.makeCodes(M.dtree,R),r.F.revCodes(M.dtree,R),r.F.makeCodes(M.itree,b),r.F.revCodes(M.itree,b),I=M.ltree,L=M.dtree,y(a,o,T-257),y(a,o+=5,K-1),y(a,o+=5,H-4),o+=4;for(var m=0;m<H;m++)y(a,o+3*m,M.itree[1+(M.ordr[m]<<1)]);o+=3*H,o=r.F._codeTiny(x,M.itree,a,o),o=r.F._codeTiny(V,M.itree,a,o)}for(var h=$,O=0;O<l;O+=2){for(var C=t[O],z=C>>>23,Q=h+(8388607&C);h<Q;)o=r.F._writeLit(w[h++],I,a,o);if(z!=0){var X=t[O+1],ne=X>>16,Y=X>>8&255,j=255&X;y(a,o=r.F._writeLit(257+Y,I,a,o),z-M.of0[Y]),o+=M.exb[Y],N(a,o=r.F._writeLit(j,L,a,o),ne-M.df0[j]),o+=M.dxb[j],h+=z}}o=r.F._writeLit(256,I,a,o)}return o},r.F._copyExact=function(e,t,l,u,w){var $=w>>>3;return u[$]=l,u[$+1]=l>>>8,u[$+2]=255-u[$],u[$+3]=255-u[$+1],$+=4,u.set(new Uint8Array(e.buffer,t,l),$),w+(l+4<<3)},r.F.getTrees=function(){for(var e=r.F.U,t=r.F._hufTree(e.lhst,e.ltree,15),l=r.F._hufTree(e.dhst,e.dtree,15),u=[],w=r.F._lenCodes(e.ltree,u),$=[],i=r.F._lenCodes(e.dtree,$),a=0;a<u.length;a+=2)e.ihst[u[a]]++;for(a=0;a<$.length;a+=2)e.ihst[$[a]]++;for(var o=r.F._hufTree(e.ihst,e.itree,7),d=19;d>4&&e.itree[1+(e.ordr[d-1]<<1)]==0;)d--;return[t,l,o,w,i,d,u,$]},r.F.getSecond=function(e){for(var t=[],l=0;l<e.length;l+=2)t.push(e[l+1]);return t},r.F.nonZero=function(e){for(var t="",l=0;l<e.length;l+=2)e[l+1]!=0&&(t+=(l>>1)+",");return t},r.F.contSize=function(e,t){for(var l=0,u=0;u<t.length;u++)l+=t[u]*e[1+(u<<1)];return l},r.F._codeTiny=function(e,t,l,u){for(var w=0;w<e.length;w+=2){var $=e[w],i=e[w+1];u=r.F._writeLit($,t,l,u);var a=$==16?2:$==17?3:7;$>15&&(r.F._putsE(l,u,i,a),u+=a)}return u},r.F._lenCodes=function(e,t){for(var l=e.length;l!=2&&e[l-1]==0;)l-=2;for(var u=0;u<l;u+=2){var w=e[u+1],$=u+3<l?e[u+3]:-1,i=u+5<l?e[u+5]:-1,a=u==0?-1:e[u-1];if(w==0&&$==w&&i==w){for(var o=u+5;o+2<l&&e[o+2]==w;)o+=2;(d=Math.min(o+1-u>>>1,138))<11?t.push(17,d-3):t.push(18,d-11),u+=2*d-2}else if(w==a&&$==w&&i==w){for(o=u+5;o+2<l&&e[o+2]==w;)o+=2;var d=Math.min(o+1-u>>>1,6);t.push(16,d-3),u+=2*d-2}else t.push(w,0)}return l>>>1},r.F._hufTree=function(e,t,l){var u=[],w=e.length,$=t.length,i=0;for(i=0;i<$;i+=2)t[i]=0,t[i+1]=0;for(i=0;i<w;i++)e[i]!=0&&u.push({lit:i,f:e[i]});var a=u.length,o=u.slice(0);if(a==0)return 0;if(a==1){var d=u[0].lit;return o=d==0?1:0,t[1+(d<<1)]=1,t[1+(o<<1)]=1,1}u.sort((function(x,V){return x.f-V.f}));var v=u[0],R=u[1],b=0,T=1,K=2;for(u[0]={lit:-1,f:v.f+R.f,l:v,r:R,d:0};T!=a-1;)v=b!=T&&(K==a||u[b].f<u[K].f)?u[b++]:u[K++],R=b!=T&&(K==a||u[b].f<u[K].f)?u[b++]:u[K++],u[T++]={lit:-1,f:v.f+R.f,l:v,r:R};var H=r.F.setDepth(u[T-1],0);for(H>l&&(r.F.restrictDepth(o,l,H),H=l),i=0;i<a;i++)t[1+(o[i].lit<<1)]=o[i].d;return H},r.F.setDepth=function(e,t){return e.lit!=-1?(e.d=t,t):Math.max(r.F.setDepth(e.l,t+1),r.F.setDepth(e.r,t+1))},r.F.restrictDepth=function(e,t,l){var u=0,w=1<<l-t,$=0;for(e.sort((function(a,o){return o.d==a.d?a.f-o.f:o.d-a.d})),u=0;u<e.length&&e[u].d>t;u++){var i=e[u].d;e[u].d=t,$+=w-(1<<l-i)}for($>>>=l-t;$>0;)(i=e[u].d)<t?(e[u].d++,$-=1<<t-i-1):u++;for(;u>=0;u--)e[u].d==t&&$<0&&(e[u].d--,$++);$!=0&&console.log("debt left")},r.F._goodIndex=function(e,t){var l=0;return t[16|l]<=e&&(l|=16),t[8|l]<=e&&(l|=8),t[4|l]<=e&&(l|=4),t[2|l]<=e&&(l|=2),t[1|l]<=e&&(l|=1),l},r.F._writeLit=function(e,t,l,u){return r.F._putsF(l,u,t[e<<1]),u+t[1+(e<<1)]},r.F.inflate=function(e,t){var l=Uint8Array;if(e[0]==3&&e[1]==0)return t||new l(0);var u=r.F,w=u._bitsF,$=u._bitsE,i=u._decodeTiny,a=u.makeCodes,o=u.codes2map,d=u._get17,v=u.U,R=t==null;R&&(t=new l(e.length>>>2<<3));for(var b,T,K=0,H=0,x=0,V=0,M=0,N=0,y=0,p=0,F=0;K==0;)if(K=w(e,F,1),H=w(e,F+1,2),F+=3,H!=0){if(R&&(t=r.F._check(t,p+(1<<17))),H==1&&(b=v.flmap,T=v.fdmap,N=511,y=31),H==2){x=$(e,F,5)+257,V=$(e,F+5,5)+1,M=$(e,F+10,4)+4,F+=14;for(var _=0;_<38;_+=2)v.itree[_]=0,v.itree[_+1]=0;var S=1;for(_=0;_<M;_++){var A=$(e,F+3*_,3);v.itree[1+(v.ordr[_]<<1)]=A,A>S&&(S=A)}F+=3*M,a(v.itree,S),o(v.itree,S,v.imap),b=v.lmap,T=v.dmap,F=i(v.imap,(1<<S)-1,x+V,e,F,v.ttree);var I=u._copyOut(v.ttree,0,x,v.ltree);N=(1<<I)-1;var L=u._copyOut(v.ttree,x,V,v.dtree);y=(1<<L)-1,a(v.ltree,I),o(v.ltree,I,b),a(v.dtree,L),o(v.dtree,L,T)}for(;;){var m=b[d(e,F)&N];F+=15&m;var h=m>>>4;if(!(h>>>8))t[p++]=h;else{if(h==256)break;var O=p+h-254;if(h>264){var C=v.ldef[h-257];O=p+(C>>>3)+$(e,F,7&C),F+=7&C}var z=T[d(e,F)&y];F+=15&z;var Q=z>>>4,X=v.ddef[Q],ne=(X>>>4)+w(e,F,15&X);for(F+=15&X,R&&(t=r.F._check(t,p+(1<<17)));p<O;)t[p]=t[p++-ne],t[p]=t[p++-ne],t[p]=t[p++-ne],t[p]=t[p++-ne];p=O}}}else{(7&F)!=0&&(F+=8-(7&F));var Y=4+(F>>>3),j=e[Y-4]|e[Y-3]<<8;R&&(t=r.F._check(t,p+j)),t.set(new l(e.buffer,e.byteOffset+Y,j),p),F=Y+j<<3,p+=j}return t.length==p?t:t.slice(0,p)},r.F._check=function(e,t){var l=e.length;if(t<=l)return e;var u=new Uint8Array(Math.max(l<<1,t));return u.set(e,0),u},r.F._decodeTiny=function(e,t,l,u,w,$){for(var i=r.F._bitsE,a=r.F._get17,o=0;o<l;){var d=e[a(u,w)&t];w+=15&d;var v=d>>>4;if(v<=15)$[o]=v,o++;else{var R=0,b=0;v==16?(b=3+i(u,w,2),w+=2,R=$[o-1]):v==17?(b=3+i(u,w,3),w+=3):v==18&&(b=11+i(u,w,7),w+=7);for(var T=o+b;o<T;)$[o]=R,o++}}return w},r.F._copyOut=function(e,t,l,u){for(var w=0,$=0,i=u.length>>>1;$<l;){var a=e[$+t];u[$<<1]=0,u[1+($<<1)]=a,a>w&&(w=a),$++}for(;$<i;)u[$<<1]=0,u[1+($<<1)]=0,$++;return w},r.F.makeCodes=function(e,t){for(var l,u,w,$,i=r.F.U,a=e.length,o=i.bl_count,d=0;d<=t;d++)o[d]=0;for(d=1;d<a;d+=2)o[e[d]]++;var v=i.next_code;for(l=0,o[0]=0,u=1;u<=t;u++)l=l+o[u-1]<<1,v[u]=l;for(w=0;w<a;w+=2)($=e[w+1])!=0&&(e[w]=v[$],v[$]++)},r.F.codes2map=function(e,t,l){for(var u=e.length,w=r.F.U.rev15,$=0;$<u;$+=2)if(e[$+1]!=0)for(var i=$>>1,a=e[$+1],o=i<<4|a,d=t-a,v=e[$]<<d,R=v+(1<<d);v!=R;)l[w[v]>>>15-t]=o,v++},r.F.revCodes=function(e,t){for(var l=r.F.U.rev15,u=15-t,w=0;w<e.length;w+=2){var $=e[w]<<t-e[w+1];e[w]=l[$]>>>u}},r.F._putsE=function(e,t,l){l<<=7&t;var u=t>>>3;e[u]|=l,e[u+1]|=l>>>8},r.F._putsF=function(e,t,l){l<<=7&t;var u=t>>>3;e[u]|=l,e[u+1]|=l>>>8,e[u+2]|=l>>>16},r.F._bitsE=function(e,t,l){return(e[t>>>3]|e[1+(t>>>3)]<<8)>>>(7&t)&(1<<l)-1},r.F._bitsF=function(e,t,l){return(e[t>>>3]|e[1+(t>>>3)]<<8|e[2+(t>>>3)]<<16)>>>(7&t)&(1<<l)-1},r.F._get17=function(e,t){return(e[t>>>3]|e[1+(t>>>3)]<<8|e[2+(t>>>3)]<<16)>>>(7&t)},r.F._get25=function(e,t){return(e[t>>>3]|e[1+(t>>>3)]<<8|e[2+(t>>>3)]<<16|e[3+(t>>>3)]<<24)>>>(7&t)},r.F.U=(f=Uint16Array,D=Uint32Array,{next_code:new f(16),bl_count:new f(16),ordr:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],of0:[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],exb:[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0],ldef:new f(32),df0:[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,65535,65535],dxb:[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0],ddef:new D(32),flmap:new f(512),fltree:[],fdmap:new f(32),fdtree:[],lmap:new f(32768),ltree:[],ttree:[],dmap:new f(32768),dtree:[],imap:new f(512),itree:[],rev15:new f(32768),lhst:new D(286),dhst:new D(30),ihst:new D(19),lits:new D(15e3),strt:new f(65536),prev:new f(32768)}),(function(){for(var e=r.F.U,t=0;t<32768;t++){var l=t;l=(4278255360&(l=(4042322160&(l=(3435973836&(l=(2863311530&l)>>>1|(1431655765&l)<<1))>>>2|(858993459&l)<<2))>>>4|(252645135&l)<<4))>>>8|(16711935&l)<<8,e.rev15[t]=(l>>>16|l<<16)>>>17}function u(w,$,i){for(;$--!=0;)w.push(0,i)}for(t=0;t<32;t++)e.ldef[t]=e.of0[t]<<3|e.exb[t],e.ddef[t]=e.df0[t]<<4|e.dxb[t];u(e.fltree,144,8),u(e.fltree,112,9),u(e.fltree,24,7),u(e.fltree,8,8),r.F.makeCodes(e.fltree,9),r.F.codes2map(e.fltree,9,e.flmap),r.F.revCodes(e.fltree,9),u(e.fdtree,32,5),r.F.makeCodes(e.fdtree,5),r.F.codes2map(e.fdtree,5,e.fdmap),r.F.revCodes(e.fdtree,5),u(e.itree,19,0),u(e.ltree,286,0),u(e.dtree,30,0),u(e.ttree,320,0)})()})();var Os=Rs({__proto__:null,default:Sn},[Sn]);const Ft=(function(){var n={nextZero(i,a){for(;i[a]!=0;)a++;return a},readUshort:(i,a)=>i[a]<<8|i[a+1],writeUshort(i,a,o){i[a]=o>>8&255,i[a+1]=255&o},readUint:(i,a)=>16777216*i[a]+(i[a+1]<<16|i[a+2]<<8|i[a+3]),writeUint(i,a,o){i[a]=o>>24&255,i[a+1]=o>>16&255,i[a+2]=o>>8&255,i[a+3]=255&o},readASCII(i,a,o){let d="";for(let v=0;v<o;v++)d+=String.fromCharCode(i[a+v]);return d},writeASCII(i,a,o){for(let d=0;d<o.length;d++)i[a+d]=o.charCodeAt(d)},readBytes(i,a,o){const d=[];for(let v=0;v<o;v++)d.push(i[a+v]);return d},pad:i=>i.length<2?`0${i}`:i,readUTF8(i,a,o){let d,v="";for(let R=0;R<o;R++)v+=`%${n.pad(i[a+R].toString(16))}`;try{d=decodeURIComponent(v)}catch{return n.readASCII(i,a,o)}return d}};function f(i,a,o,d){const v=a*o,R=t(d),b=Math.ceil(a*R/8),T=new Uint8Array(4*v),K=new Uint32Array(T.buffer),{ctype:H}=d,{depth:x}=d,V=n.readUshort;if(H==6){const C=v<<2;if(x==8)for(var M=0;M<C;M+=4)T[M]=i[M],T[M+1]=i[M+1],T[M+2]=i[M+2],T[M+3]=i[M+3];if(x==16)for(M=0;M<C;M++)T[M]=i[M<<1]}else if(H==2){const C=d.tabs.tRNS;if(C==null){if(x==8)for(M=0;M<v;M++){var N=3*M;K[M]=255<<24|i[N+2]<<16|i[N+1]<<8|i[N]}if(x==16)for(M=0;M<v;M++)N=6*M,K[M]=255<<24|i[N+4]<<16|i[N+2]<<8|i[N]}else{var y=C[0];const z=C[1],Q=C[2];if(x==8)for(M=0;M<v;M++){var p=M<<2;N=3*M,K[M]=255<<24|i[N+2]<<16|i[N+1]<<8|i[N],i[N]==y&&i[N+1]==z&&i[N+2]==Q&&(T[p+3]=0)}if(x==16)for(M=0;M<v;M++)p=M<<2,N=6*M,K[M]=255<<24|i[N+4]<<16|i[N+2]<<8|i[N],V(i,N)==y&&V(i,N+2)==z&&V(i,N+4)==Q&&(T[p+3]=0)}}else if(H==3){const C=d.tabs.PLTE,z=d.tabs.tRNS,Q=z?z.length:0;if(x==1)for(var F=0;F<o;F++){var _=F*b,S=F*a;for(M=0;M<a;M++){p=S+M<<2;var A=3*(I=i[_+(M>>3)]>>7-((7&M)<<0)&1);T[p]=C[A],T[p+1]=C[A+1],T[p+2]=C[A+2],T[p+3]=I<Q?z[I]:255}}if(x==2)for(F=0;F<o;F++)for(_=F*b,S=F*a,M=0;M<a;M++)p=S+M<<2,A=3*(I=i[_+(M>>2)]>>6-((3&M)<<1)&3),T[p]=C[A],T[p+1]=C[A+1],T[p+2]=C[A+2],T[p+3]=I<Q?z[I]:255;if(x==4)for(F=0;F<o;F++)for(_=F*b,S=F*a,M=0;M<a;M++)p=S+M<<2,A=3*(I=i[_+(M>>1)]>>4-((1&M)<<2)&15),T[p]=C[A],T[p+1]=C[A+1],T[p+2]=C[A+2],T[p+3]=I<Q?z[I]:255;if(x==8)for(M=0;M<v;M++){var I;p=M<<2,A=3*(I=i[M]),T[p]=C[A],T[p+1]=C[A+1],T[p+2]=C[A+2],T[p+3]=I<Q?z[I]:255}}else if(H==4){if(x==8)for(M=0;M<v;M++){p=M<<2;var L=i[m=M<<1];T[p]=L,T[p+1]=L,T[p+2]=L,T[p+3]=i[m+1]}if(x==16)for(M=0;M<v;M++){var m;p=M<<2,L=i[m=M<<2],T[p]=L,T[p+1]=L,T[p+2]=L,T[p+3]=i[m+2]}}else if(H==0)for(y=d.tabs.tRNS?d.tabs.tRNS:-1,F=0;F<o;F++){const C=F*b,z=F*a;if(x==1)for(var h=0;h<a;h++){var O=(L=255*(i[C+(h>>>3)]>>>7-(7&h)&1))==255*y?0:255;K[z+h]=O<<24|L<<16|L<<8|L}else if(x==2)for(h=0;h<a;h++)O=(L=85*(i[C+(h>>>2)]>>>6-((3&h)<<1)&3))==85*y?0:255,K[z+h]=O<<24|L<<16|L<<8|L;else if(x==4)for(h=0;h<a;h++)O=(L=17*(i[C+(h>>>1)]>>>4-((1&h)<<2)&15))==17*y?0:255,K[z+h]=O<<24|L<<16|L<<8|L;else if(x==8)for(h=0;h<a;h++)O=(L=i[C+h])==y?0:255,K[z+h]=O<<24|L<<16|L<<8|L;else if(x==16)for(h=0;h<a;h++)L=i[C+(h<<1)],O=V(i,C+(h<<1))==y?0:255,K[z+h]=O<<24|L<<16|L<<8|L}return T}function D(i,a,o,d){const v=t(i),R=Math.ceil(o*v/8),b=new Uint8Array((R+1+i.interlace)*d);return a=i.tabs.CgBI?e(a,b):r(a,b),i.interlace==0?a=l(a,i,0,o,d):i.interlace==1&&(a=(function(K,H){const x=H.width,V=H.height,M=t(H),N=M>>3,y=Math.ceil(x*M/8),p=new Uint8Array(V*y);let F=0;const _=[0,0,4,0,2,0,1],S=[0,4,0,2,0,1,0],A=[8,8,8,4,4,2,2],I=[8,8,4,4,2,2,1];let L=0;for(;L<7;){const h=A[L],O=I[L];let C=0,z=0,Q=_[L];for(;Q<V;)Q+=h,z++;let X=S[L];for(;X<x;)X+=O,C++;const ne=Math.ceil(C*M/8);l(K,H,F,C,z);let Y=0,j=_[L];for(;j<V;){let re=S[L],$e=F+Y*ne<<3;for(;re<x;){var m;if(M==1&&(m=(m=K[$e>>3])>>7-(7&$e)&1,p[j*y+(re>>3)]|=m<<7-((7&re)<<0)),M==2&&(m=(m=K[$e>>3])>>6-(7&$e)&3,p[j*y+(re>>2)]|=m<<6-((3&re)<<1)),M==4&&(m=(m=K[$e>>3])>>4-(7&$e)&15,p[j*y+(re>>1)]|=m<<4-((1&re)<<2)),M>=8){const Se=j*y+re*N;for(let pe=0;pe<N;pe++)p[Se+pe]=K[($e>>3)+pe]}$e+=M,re+=O}Y++,j+=h}C*z!=0&&(F+=z*(1+ne)),L+=1}return p})(a,i)),a}function r(i,a){return e(new Uint8Array(i.buffer,2,i.length-6),a)}var e=(function(){const i={H:{}};return i.H.N=function(a,o){const d=Uint8Array;let v,R,b=0,T=0,K=0,H=0,x=0,V=0,M=0,N=0,y=0;if(a[0]==3&&a[1]==0)return o||new d(0);const p=i.H,F=p.b,_=p.e,S=p.R,A=p.n,I=p.A,L=p.Z,m=p.m,h=o==null;for(h&&(o=new d(a.length>>>2<<5));b==0;)if(b=F(a,y,1),T=F(a,y+1,2),y+=3,T!=0){if(h&&(o=i.H.W(o,N+(1<<17))),T==1&&(v=m.J,R=m.h,V=511,M=31),T==2){K=_(a,y,5)+257,H=_(a,y+5,5)+1,x=_(a,y+10,4)+4,y+=14;let C=1;for(var O=0;O<38;O+=2)m.Q[O]=0,m.Q[O+1]=0;for(O=0;O<x;O++){const X=_(a,y+3*O,3);m.Q[1+(m.X[O]<<1)]=X,X>C&&(C=X)}y+=3*x,A(m.Q,C),I(m.Q,C,m.u),v=m.w,R=m.d,y=S(m.u,(1<<C)-1,K+H,a,y,m.v);const z=p.V(m.v,0,K,m.C);V=(1<<z)-1;const Q=p.V(m.v,K,H,m.D);M=(1<<Q)-1,A(m.C,z),I(m.C,z,v),A(m.D,Q),I(m.D,Q,R)}for(;;){const C=v[L(a,y)&V];y+=15&C;const z=C>>>4;if(!(z>>>8))o[N++]=z;else{if(z==256)break;{let Q=N+z-254;if(z>264){const re=m.q[z-257];Q=N+(re>>>3)+_(a,y,7&re),y+=7&re}const X=R[L(a,y)&M];y+=15&X;const ne=X>>>4,Y=m.c[ne],j=(Y>>>4)+F(a,y,15&Y);for(y+=15&Y;N<Q;)o[N]=o[N++-j],o[N]=o[N++-j],o[N]=o[N++-j],o[N]=o[N++-j];N=Q}}}}else{(7&y)!=0&&(y+=8-(7&y));const C=4+(y>>>3),z=a[C-4]|a[C-3]<<8;h&&(o=i.H.W(o,N+z)),o.set(new d(a.buffer,a.byteOffset+C,z),N),y=C+z<<3,N+=z}return o.length==N?o:o.slice(0,N)},i.H.W=function(a,o){const d=a.length;if(o<=d)return a;const v=new Uint8Array(d<<1);return v.set(a,0),v},i.H.R=function(a,o,d,v,R,b){const T=i.H.e,K=i.H.Z;let H=0;for(;H<d;){const x=a[K(v,R)&o];R+=15&x;const V=x>>>4;if(V<=15)b[H]=V,H++;else{let M=0,N=0;V==16?(N=3+T(v,R,2),R+=2,M=b[H-1]):V==17?(N=3+T(v,R,3),R+=3):V==18&&(N=11+T(v,R,7),R+=7);const y=H+N;for(;H<y;)b[H]=M,H++}}return R},i.H.V=function(a,o,d,v){let R=0,b=0;const T=v.length>>>1;for(;b<d;){const K=a[b+o];v[b<<1]=0,v[1+(b<<1)]=K,K>R&&(R=K),b++}for(;b<T;)v[b<<1]=0,v[1+(b<<1)]=0,b++;return R},i.H.n=function(a,o){const d=i.H.m,v=a.length;let R,b,T,K;const H=d.j;for(var x=0;x<=o;x++)H[x]=0;for(x=1;x<v;x+=2)H[a[x]]++;const V=d.K;for(R=0,H[0]=0,b=1;b<=o;b++)R=R+H[b-1]<<1,V[b]=R;for(T=0;T<v;T+=2)K=a[T+1],K!=0&&(a[T]=V[K],V[K]++)},i.H.A=function(a,o,d){const v=a.length,R=i.H.m.r;for(let b=0;b<v;b+=2)if(a[b+1]!=0){const T=b>>1,K=a[b+1],H=T<<4|K,x=o-K;let V=a[b]<<x;const M=V+(1<<x);for(;V!=M;)d[R[V]>>>15-o]=H,V++}},i.H.l=function(a,o){const d=i.H.m.r,v=15-o;for(let R=0;R<a.length;R+=2){const b=a[R]<<o-a[R+1];a[R]=d[b]>>>v}},i.H.M=function(a,o,d){d<<=7&o;const v=o>>>3;a[v]|=d,a[v+1]|=d>>>8},i.H.I=function(a,o,d){d<<=7&o;const v=o>>>3;a[v]|=d,a[v+1]|=d>>>8,a[v+2]|=d>>>16},i.H.e=function(a,o,d){return(a[o>>>3]|a[1+(o>>>3)]<<8)>>>(7&o)&(1<<d)-1},i.H.b=function(a,o,d){return(a[o>>>3]|a[1+(o>>>3)]<<8|a[2+(o>>>3)]<<16)>>>(7&o)&(1<<d)-1},i.H.Z=function(a,o){return(a[o>>>3]|a[1+(o>>>3)]<<8|a[2+(o>>>3)]<<16)>>>(7&o)},i.H.i=function(a,o){return(a[o>>>3]|a[1+(o>>>3)]<<8|a[2+(o>>>3)]<<16|a[3+(o>>>3)]<<24)>>>(7&o)},i.H.m=(function(){const a=Uint16Array,o=Uint32Array;return{K:new a(16),j:new a(16),X:[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],S:[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,999,999,999],T:[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0],q:new a(32),p:[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,65535,65535],z:[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0],c:new o(32),J:new a(512),_:[],h:new a(32),$:[],w:new a(32768),C:[],v:[],d:new a(32768),D:[],u:new a(512),Q:[],r:new a(32768),s:new o(286),Y:new o(30),a:new o(19),t:new o(15e3),k:new a(65536),g:new a(32768)}})(),(function(){const a=i.H.m;for(var o=0;o<32768;o++){let v=o;v=(2863311530&v)>>>1|(1431655765&v)<<1,v=(3435973836&v)>>>2|(858993459&v)<<2,v=(4042322160&v)>>>4|(252645135&v)<<4,v=(4278255360&v)>>>8|(16711935&v)<<8,a.r[o]=(v>>>16|v<<16)>>>17}function d(v,R,b){for(;R--!=0;)v.push(0,b)}for(o=0;o<32;o++)a.q[o]=a.S[o]<<3|a.T[o],a.c[o]=a.p[o]<<4|a.z[o];d(a._,144,8),d(a._,112,9),d(a._,24,7),d(a._,8,8),i.H.n(a._,9),i.H.A(a._,9,a.J),i.H.l(a._,9),d(a.$,32,5),i.H.n(a.$,5),i.H.A(a.$,5,a.h),i.H.l(a.$,5),d(a.Q,19,0),d(a.C,286,0),d(a.D,30,0),d(a.v,320,0)})(),i.H.N})();function t(i){return[1,null,3,1,2,null,4][i.ctype]*i.depth}function l(i,a,o,d,v){let R=t(a);const b=Math.ceil(d*R/8);let T,K;R=Math.ceil(R/8);let H=i[o],x=0;if(H>1&&(i[o]=[0,0,1][H-2]),H==3)for(x=R;x<b;x++)i[x+1]=i[x+1]+(i[x+1-R]>>>1)&255;for(let V=0;V<v;V++)if(T=o+V*b,K=T+V+1,H=i[K-1],x=0,H==0)for(;x<b;x++)i[T+x]=i[K+x];else if(H==1){for(;x<R;x++)i[T+x]=i[K+x];for(;x<b;x++)i[T+x]=i[K+x]+i[T+x-R]}else if(H==2)for(;x<b;x++)i[T+x]=i[K+x]+i[T+x-b];else if(H==3){for(;x<R;x++)i[T+x]=i[K+x]+(i[T+x-b]>>>1);for(;x<b;x++)i[T+x]=i[K+x]+(i[T+x-b]+i[T+x-R]>>>1)}else{for(;x<R;x++)i[T+x]=i[K+x]+u(0,i[T+x-b],0);for(;x<b;x++)i[T+x]=i[K+x]+u(i[T+x-R],i[T+x-b],i[T+x-R-b])}return i}function u(i,a,o){const d=i+a-o,v=d-i,R=d-a,b=d-o;return v*v<=R*R&&v*v<=b*b?i:R*R<=b*b?a:o}function w(i,a,o){o.width=n.readUint(i,a),a+=4,o.height=n.readUint(i,a),a+=4,o.depth=i[a],a++,o.ctype=i[a],a++,o.compress=i[a],a++,o.filter=i[a],a++,o.interlace=i[a],a++}function $(i,a,o,d,v,R,b,T,K){const H=Math.min(a,v),x=Math.min(o,R);let V=0,M=0;for(let L=0;L<x;L++)for(let m=0;m<H;m++)if(b>=0&&T>=0?(V=L*a+m<<2,M=(T+L)*v+b+m<<2):(V=(-T+L)*a-b+m<<2,M=L*v+m<<2),K==0)d[M]=i[V],d[M+1]=i[V+1],d[M+2]=i[V+2],d[M+3]=i[V+3];else if(K==1){var N=i[V+3]*.00392156862745098,y=i[V]*N,p=i[V+1]*N,F=i[V+2]*N,_=d[M+3]*(1/255),S=d[M]*_,A=d[M+1]*_,I=d[M+2]*_;const h=1-N,O=N+_*h,C=O==0?0:1/O;d[M+3]=255*O,d[M+0]=(y+S*h)*C,d[M+1]=(p+A*h)*C,d[M+2]=(F+I*h)*C}else if(K==2)N=i[V+3],y=i[V],p=i[V+1],F=i[V+2],_=d[M+3],S=d[M],A=d[M+1],I=d[M+2],N==_&&y==S&&p==A&&F==I?(d[M]=0,d[M+1]=0,d[M+2]=0,d[M+3]=0):(d[M]=y,d[M+1]=p,d[M+2]=F,d[M+3]=N);else if(K==3){if(N=i[V+3],y=i[V],p=i[V+1],F=i[V+2],_=d[M+3],S=d[M],A=d[M+1],I=d[M+2],N==_&&y==S&&p==A&&F==I)continue;if(N<220&&_>20)return!1}return!0}return{decode:function(a){const o=new Uint8Array(a);let d=8;const v=n,R=v.readUshort,b=v.readUint,T={tabs:{},frames:[]},K=new Uint8Array(o.length);let H,x=0,V=0;const M=[137,80,78,71,13,10,26,10];for(var N=0;N<8;N++)if(o[N]!=M[N])throw"The input is not a PNG file!";for(;d<o.length;){const L=v.readUint(o,d);d+=4;const m=v.readASCII(o,d,4);if(d+=4,m=="IHDR")w(o,d,T);else if(m=="iCCP"){for(var y=d;o[y]!=0;)y++;v.readASCII(o,d,y-d),o[y+1];const h=o.slice(y+2,d+L);let O=null;try{O=r(h)}catch{O=e(h)}T.tabs[m]=O}else if(m=="CgBI")T.tabs[m]=o.slice(d,d+4);else if(m=="IDAT"){for(N=0;N<L;N++)K[x+N]=o[d+N];x+=L}else if(m=="acTL")T.tabs[m]={num_frames:b(o,d),num_plays:b(o,d+4)},H=new Uint8Array(o.length);else if(m=="fcTL"){V!=0&&((I=T.frames[T.frames.length-1]).data=D(T,H.slice(0,V),I.rect.width,I.rect.height),V=0);const h={x:b(o,d+12),y:b(o,d+16),width:b(o,d+4),height:b(o,d+8)};let O=R(o,d+22);O=R(o,d+20)/(O==0?100:O);const C={rect:h,delay:Math.round(1e3*O),dispose:o[d+24],blend:o[d+25]};T.frames.push(C)}else if(m=="fdAT"){for(N=0;N<L-4;N++)H[V+N]=o[d+N+4];V+=L-4}else if(m=="pHYs")T.tabs[m]=[v.readUint(o,d),v.readUint(o,d+4),o[d+8]];else if(m=="cHRM")for(T.tabs[m]=[],N=0;N<8;N++)T.tabs[m].push(v.readUint(o,d+4*N));else if(m=="tEXt"||m=="zTXt"){T.tabs[m]==null&&(T.tabs[m]={});var p=v.nextZero(o,d),F=v.readASCII(o,d,p-d),_=d+L-p-1;if(m=="tEXt")A=v.readASCII(o,p+1,_);else{var S=r(o.slice(p+2,p+2+_));A=v.readUTF8(S,0,S.length)}T.tabs[m][F]=A}else if(m=="iTXt"){T.tabs[m]==null&&(T.tabs[m]={}),p=0,y=d,p=v.nextZero(o,y),F=v.readASCII(o,y,p-y);const h=o[y=p+1];var A;o[y+1],y+=2,p=v.nextZero(o,y),v.readASCII(o,y,p-y),y=p+1,p=v.nextZero(o,y),v.readUTF8(o,y,p-y),_=L-((y=p+1)-d),h==0?A=v.readUTF8(o,y,_):(S=r(o.slice(y,y+_)),A=v.readUTF8(S,0,S.length)),T.tabs[m][F]=A}else if(m=="PLTE")T.tabs[m]=v.readBytes(o,d,L);else if(m=="hIST"){const h=T.tabs.PLTE.length/3;for(T.tabs[m]=[],N=0;N<h;N++)T.tabs[m].push(R(o,d+2*N))}else if(m=="tRNS")T.ctype==3?T.tabs[m]=v.readBytes(o,d,L):T.ctype==0?T.tabs[m]=R(o,d):T.ctype==2&&(T.tabs[m]=[R(o,d),R(o,d+2),R(o,d+4)]);else if(m=="gAMA")T.tabs[m]=v.readUint(o,d)/1e5;else if(m=="sRGB")T.tabs[m]=o[d];else if(m=="bKGD")T.ctype==0||T.ctype==4?T.tabs[m]=[R(o,d)]:T.ctype==2||T.ctype==6?T.tabs[m]=[R(o,d),R(o,d+2),R(o,d+4)]:T.ctype==3&&(T.tabs[m]=o[d]);else if(m=="IEND")break;d+=L,v.readUint(o,d),d+=4}var I;return V!=0&&((I=T.frames[T.frames.length-1]).data=D(T,H.slice(0,V),I.rect.width,I.rect.height)),T.data=D(T,K,T.width,T.height),delete T.compress,delete T.interlace,delete T.filter,T},toRGBA8:function(a){const o=a.width,d=a.height;if(a.tabs.acTL==null)return[f(a.data,o,d,a).buffer];const v=[];a.frames[0].data==null&&(a.frames[0].data=a.data);const R=o*d*4,b=new Uint8Array(R),T=new Uint8Array(R),K=new Uint8Array(R);for(let x=0;x<a.frames.length;x++){const V=a.frames[x],M=V.rect.x,N=V.rect.y,y=V.rect.width,p=V.rect.height,F=f(V.data,y,p,a);if(x!=0)for(var H=0;H<R;H++)K[H]=b[H];if(V.blend==0?$(F,y,p,b,o,d,M,N,0):V.blend==1&&$(F,y,p,b,o,d,M,N,1),v.push(b.buffer.slice(0)),V.dispose!=0){if(V.dispose==1)$(T,y,p,b,o,d,M,N,0);else if(V.dispose==2)for(H=0;H<R;H++)b[H]=K[H]}}return v},_paeth:u,_copyTile:$,_bin:n}})();(function(){const{_copyTile:n}=Ft,{_bin:f}=Ft,D=Ft._paeth;var r={table:(function(){const y=new Uint32Array(256);for(let p=0;p<256;p++){let F=p;for(let _=0;_<8;_++)1&F?F=3988292384^F>>>1:F>>>=1;y[p]=F}return y})(),update(y,p,F,_){for(let S=0;S<_;S++)y=r.table[255&(y^p[F+S])]^y>>>8;return y},crc:(y,p,F)=>4294967295^r.update(4294967295,y,p,F)};function e(y,p,F,_){p[F]+=y[0]*_>>4,p[F+1]+=y[1]*_>>4,p[F+2]+=y[2]*_>>4,p[F+3]+=y[3]*_>>4}function t(y){return Math.max(0,Math.min(255,y))}function l(y,p){const F=y[0]-p[0],_=y[1]-p[1],S=y[2]-p[2],A=y[3]-p[3];return F*F+_*_+S*S+A*A}function u(y,p,F,_,S,A,I){I==null&&(I=1);const L=_.length,m=[];for(var h=0;h<L;h++){const j=_[h];m.push([j>>>0&255,j>>>8&255,j>>>16&255,j>>>24&255])}for(h=0;h<L;h++){let j=4294967295;for(var O=0,C=0;C<L;C++){var z=l(m[h],m[C]);C!=h&&z<j&&(j=z,O=C)}}const Q=new Uint32Array(S.buffer),X=new Int16Array(p*F*4),ne=[0,8,2,10,12,4,14,6,3,11,1,9,15,7,13,5];for(h=0;h<ne.length;h++)ne[h]=255*((ne[h]+.5)/16-.5);for(let j=0;j<F;j++)for(let re=0;re<p;re++){var Y;h=4*(j*p+re),I!=2?Y=[t(y[h]+X[h]),t(y[h+1]+X[h+1]),t(y[h+2]+X[h+2]),t(y[h+3]+X[h+3])]:(z=ne[4*(3&j)+(3&re)],Y=[t(y[h]+z),t(y[h+1]+z),t(y[h+2]+z),t(y[h+3]+z)]),O=0;let $e=16777215;for(C=0;C<L;C++){const we=l(Y,m[C]);we<$e&&($e=we,O=C)}const Se=m[O],pe=[Y[0]-Se[0],Y[1]-Se[1],Y[2]-Se[2],Y[3]-Se[3]];I==1&&(re!=p-1&&e(pe,X,h+4,7),j!=F-1&&(re!=0&&e(pe,X,h+4*p-4,3),e(pe,X,h+4*p,5),re!=p-1&&e(pe,X,h+4*p+4,1))),A[h>>2]=O,Q[h>>2]=_[O]}}function w(y,p,F,_,S){S==null&&(S={});const{crc:A}=r,I=f.writeUint,L=f.writeUshort,m=f.writeASCII;let h=8;const O=y.frames.length>1;let C,z=!1,Q=33+(O?20:0);if(S.sRGB!=null&&(Q+=13),S.pHYs!=null&&(Q+=21),S.iCCP!=null&&(C=pako.deflate(S.iCCP),Q+=21+C.length+4),y.ctype==3){for(var X=y.plte.length,ne=0;ne<X;ne++)y.plte[ne]>>>24!=255&&(z=!0);Q+=8+3*X+4+(z?8+1*X+4:0)}for(var Y=0;Y<y.frames.length;Y++)O&&(Q+=38),Q+=(Se=y.frames[Y]).cimg.length+12,Y!=0&&(Q+=4);Q+=12;const j=new Uint8Array(Q),re=[137,80,78,71,13,10,26,10];for(ne=0;ne<8;ne++)j[ne]=re[ne];if(I(j,h,13),h+=4,m(j,h,"IHDR"),h+=4,I(j,h,p),h+=4,I(j,h,F),h+=4,j[h]=y.depth,h++,j[h]=y.ctype,h++,j[h]=0,h++,j[h]=0,h++,j[h]=0,h++,I(j,h,A(j,h-17,17)),h+=4,S.sRGB!=null&&(I(j,h,1),h+=4,m(j,h,"sRGB"),h+=4,j[h]=S.sRGB,h++,I(j,h,A(j,h-5,5)),h+=4),S.iCCP!=null){const pe=13+C.length;I(j,h,pe),h+=4,m(j,h,"iCCP"),h+=4,m(j,h,"ICC profile"),h+=11,h+=2,j.set(C,h),h+=C.length,I(j,h,A(j,h-(pe+4),pe+4)),h+=4}if(S.pHYs!=null&&(I(j,h,9),h+=4,m(j,h,"pHYs"),h+=4,I(j,h,S.pHYs[0]),h+=4,I(j,h,S.pHYs[1]),h+=4,j[h]=S.pHYs[2],h++,I(j,h,A(j,h-13,13)),h+=4),O&&(I(j,h,8),h+=4,m(j,h,"acTL"),h+=4,I(j,h,y.frames.length),h+=4,I(j,h,S.loop!=null?S.loop:0),h+=4,I(j,h,A(j,h-12,12)),h+=4),y.ctype==3){for(I(j,h,3*(X=y.plte.length)),h+=4,m(j,h,"PLTE"),h+=4,ne=0;ne<X;ne++){const pe=3*ne,we=y.plte[ne],Ne=255&we,Fe=we>>>8&255,Je=we>>>16&255;j[h+pe+0]=Ne,j[h+pe+1]=Fe,j[h+pe+2]=Je}if(h+=3*X,I(j,h,A(j,h-3*X-4,3*X+4)),h+=4,z){for(I(j,h,X),h+=4,m(j,h,"tRNS"),h+=4,ne=0;ne<X;ne++)j[h+ne]=y.plte[ne]>>>24&255;h+=X,I(j,h,A(j,h-X-4,X+4)),h+=4}}let $e=0;for(Y=0;Y<y.frames.length;Y++){var Se=y.frames[Y];O&&(I(j,h,26),h+=4,m(j,h,"fcTL"),h+=4,I(j,h,$e++),h+=4,I(j,h,Se.rect.width),h+=4,I(j,h,Se.rect.height),h+=4,I(j,h,Se.rect.x),h+=4,I(j,h,Se.rect.y),h+=4,L(j,h,_[Y]),h+=2,L(j,h,1e3),h+=2,j[h]=Se.dispose,h++,j[h]=Se.blend,h++,I(j,h,A(j,h-30,30)),h+=4);const pe=Se.cimg;I(j,h,(X=pe.length)+(Y==0?0:4)),h+=4;const we=h;m(j,h,Y==0?"IDAT":"fdAT"),h+=4,Y!=0&&(I(j,h,$e++),h+=4),j.set(pe,h),h+=X,I(j,h,A(j,we,h-we)),h+=4}return I(j,h,0),h+=4,m(j,h,"IEND"),h+=4,I(j,h,A(j,h-4,4)),h+=4,j.buffer}function $(y,p,F){for(let _=0;_<y.frames.length;_++){const S=y.frames[_];S.rect.width;const A=S.rect.height,I=new Uint8Array(A*S.bpl+A);S.cimg=d(S.img,A,S.bpp,S.bpl,I,p,F)}}function i(y,p,F,_,S){const A=S[0],I=S[1],L=S[2],m=S[3],h=S[4],O=S[5];let C=6,z=8,Q=255;for(var X=0;X<y.length;X++){const De=new Uint8Array(y[X]);for(var ne=De.length,Y=0;Y<ne;Y+=4)Q&=De[Y+3]}const j=Q!=255,re=(function(be,Ce,Le,nt,Re,ut){const je=[];for(var ue=0;ue<be.length;ue++){const Be=new Uint8Array(be[ue]),P=new Uint32Array(Be.buffer);var ct;let q=0,ee=0,se=Ce,ae=Le,le=nt?1:0;if(ue!=0){const ce=ut||nt||ue==1||je[ue-2].dispose!=0?1:2;let xe=0,rt=1e9;for(let Pe=0;Pe<ce;Pe++){var At=new Uint8Array(be[ue-1-Pe]);const it=new Uint32Array(be[ue-1-Pe]);let Ue=Ce,Ie=Le,ze=-1,ot=-1;for(let Ze=0;Ze<Le;Ze++)for(let at=0;at<Ce;at++)P[Xe=Ze*Ce+at]!=it[Xe]&&(at<Ue&&(Ue=at),at>ze&&(ze=at),Ze<Ie&&(Ie=Ze),Ze>ot&&(ot=Ze));ze==-1&&(Ue=Ie=ze=ot=0),Re&&((1&Ue)==1&&Ue--,(1&Ie)==1&&Ie--);const Ct=(ze-Ue+1)*(ot-Ie+1);Ct<rt&&(rt=Ct,xe=Pe,q=Ue,ee=Ie,se=ze-Ue+1,ae=ot-Ie+1)}At=new Uint8Array(be[ue-1-xe]),xe==1&&(je[ue-1].dispose=2),ct=new Uint8Array(se*ae*4),n(At,Ce,Le,ct,se,ae,-q,-ee,0),le=n(Be,Ce,Le,ct,se,ae,-q,-ee,3)?1:0,le==1?o(Be,Ce,Le,ct,{x:q,y:ee,width:se,height:ae}):n(Be,Ce,Le,ct,se,ae,-q,-ee,0)}else ct=Be.slice(0);je.push({rect:{x:q,y:ee,width:se,height:ae},img:ct,blend:le,dispose:0})}if(nt)for(ue=0;ue<je.length;ue++){if((bt=je[ue]).blend==1)continue;const Be=bt.rect,P=je[ue-1].rect,q=Math.min(Be.x,P.x),ee=Math.min(Be.y,P.y),se={x:q,y:ee,width:Math.max(Be.x+Be.width,P.x+P.width)-q,height:Math.max(Be.y+Be.height,P.y+P.height)-ee};je[ue-1].dispose=1,ue-1!=0&&a(be,Ce,Le,je,ue-1,se,Re),a(be,Ce,Le,je,ue,se,Re)}let St=0;if(be.length!=1)for(var Xe=0;Xe<je.length;Xe++){var bt;St+=(bt=je[Xe]).rect.width*bt.rect.height}return je})(y,p,F,A,I,L),$e={},Se=[],pe=[];if(_!=0){const De=[];for(Y=0;Y<re.length;Y++)De.push(re[Y].img.buffer);const be=(function(Re){let ut=0;for(var je=0;je<Re.length;je++)ut+=Re[je].byteLength;const ue=new Uint8Array(ut);let ct=0;for(je=0;je<Re.length;je++){const At=new Uint8Array(Re[je]),St=At.length;for(let Xe=0;Xe<St;Xe+=4){let bt=At[Xe],Be=At[Xe+1],P=At[Xe+2];const q=At[Xe+3];q==0&&(bt=Be=P=0),ue[ct+Xe]=bt,ue[ct+Xe+1]=Be,ue[ct+Xe+2]=P,ue[ct+Xe+3]=q}ct+=St}return ue.buffer})(De),Ce=R(be,_);for(Y=0;Y<Ce.plte.length;Y++)Se.push(Ce.plte[Y].est.rgba);let Le=0;for(Y=0;Y<re.length;Y++){const nt=(Ne=re[Y]).img.length;var we=new Uint8Array(Ce.inds.buffer,Le>>2,nt>>2);pe.push(we);const Re=new Uint8Array(Ce.abuf,Le,nt);O&&u(Ne.img,Ne.rect.width,Ne.rect.height,Se,Re,we),Ne.img.set(Re),Le+=nt}}else for(X=0;X<re.length;X++){var Ne=re[X];const De=new Uint32Array(Ne.img.buffer);var Fe=Ne.rect.width;for(ne=De.length,we=new Uint8Array(ne),pe.push(we),Y=0;Y<ne;Y++){const be=De[Y];if(Y!=0&&be==De[Y-1])we[Y]=we[Y-1];else if(Y>Fe&&be==De[Y-Fe])we[Y]=we[Y-Fe];else{let Ce=$e[be];if(Ce==null&&($e[be]=Ce=Se.length,Se.push(be),Se.length>=300))break;we[Y]=Ce}}}const Je=Se.length;for(Je<=256&&h==0&&(z=Je<=2?1:Je<=4?2:Je<=16?4:8,z=Math.max(z,m)),X=0;X<re.length;X++){(Ne=re[X]).rect.x,Ne.rect.y,Fe=Ne.rect.width;const De=Ne.rect.height;let be=Ne.img;new Uint32Array(be.buffer);let Ce=4*Fe,Le=4;if(Je<=256&&h==0){Ce=Math.ceil(z*Fe/8);var Ye=new Uint8Array(Ce*De);const nt=pe[X];for(let Re=0;Re<De;Re++){Y=Re*Ce;const ut=Re*Fe;if(z==8)for(var ge=0;ge<Fe;ge++)Ye[Y+ge]=nt[ut+ge];else if(z==4)for(ge=0;ge<Fe;ge++)Ye[Y+(ge>>1)]|=nt[ut+ge]<<4-4*(1&ge);else if(z==2)for(ge=0;ge<Fe;ge++)Ye[Y+(ge>>2)]|=nt[ut+ge]<<6-2*(3&ge);else if(z==1)for(ge=0;ge<Fe;ge++)Ye[Y+(ge>>3)]|=nt[ut+ge]<<7-1*(7&ge)}be=Ye,C=3,Le=1}else if(j==0&&re.length==1){Ye=new Uint8Array(Fe*De*3);const nt=Fe*De;for(Y=0;Y<nt;Y++){const Re=3*Y,ut=4*Y;Ye[Re]=be[ut],Ye[Re+1]=be[ut+1],Ye[Re+2]=be[ut+2]}be=Ye,C=2,Le=3,Ce=3*Fe}Ne.img=be,Ne.bpl=Ce,Ne.bpp=Le}return{ctype:C,depth:z,plte:Se,frames:re}}function a(y,p,F,_,S,A,I){const L=Uint8Array,m=Uint32Array,h=new L(y[S-1]),O=new m(y[S-1]),C=S+1<y.length?new L(y[S+1]):null,z=new L(y[S]),Q=new m(z.buffer);let X=p,ne=F,Y=-1,j=-1;for(let $e=0;$e<A.height;$e++)for(let Se=0;Se<A.width;Se++){const pe=A.x+Se,we=A.y+$e,Ne=we*p+pe,Fe=Q[Ne];Fe==0||_[S-1].dispose==0&&O[Ne]==Fe&&(C==null||C[4*Ne+3]!=0)||(pe<X&&(X=pe),pe>Y&&(Y=pe),we<ne&&(ne=we),we>j&&(j=we))}Y==-1&&(X=ne=Y=j=0),I&&((1&X)==1&&X--,(1&ne)==1&&ne--),A={x:X,y:ne,width:Y-X+1,height:j-ne+1};const re=_[S];re.rect=A,re.blend=1,re.img=new Uint8Array(A.width*A.height*4),_[S-1].dispose==0?(n(h,p,F,re.img,A.width,A.height,-A.x,-A.y,0),o(z,p,F,re.img,A)):n(z,p,F,re.img,A.width,A.height,-A.x,-A.y,0)}function o(y,p,F,_,S){n(y,p,F,_,S.width,S.height,-S.x,-S.y,2)}function d(y,p,F,_,S,A,I){const L=[];let m,h=[0,1,2,3,4];A!=-1?h=[A]:(p*_>5e5||F==1)&&(h=[0]),I&&(m={level:0});const O=Os;for(var C=0;C<h.length;C++){for(let X=0;X<p;X++)v(S,y,X,_,F,h[C]);L.push(O.deflate(S,m))}let z,Q=1e9;for(C=0;C<L.length;C++)L[C].length<Q&&(z=C,Q=L[C].length);return L[z]}function v(y,p,F,_,S,A){const I=F*_;let L=I+F;if(y[L]=A,L++,A==0)if(_<500)for(var m=0;m<_;m++)y[L+m]=p[I+m];else y.set(new Uint8Array(p.buffer,I,_),L);else if(A==1){for(m=0;m<S;m++)y[L+m]=p[I+m];for(m=S;m<_;m++)y[L+m]=p[I+m]-p[I+m-S]+256&255}else if(F==0){for(m=0;m<S;m++)y[L+m]=p[I+m];if(A==2)for(m=S;m<_;m++)y[L+m]=p[I+m];if(A==3)for(m=S;m<_;m++)y[L+m]=p[I+m]-(p[I+m-S]>>1)+256&255;if(A==4)for(m=S;m<_;m++)y[L+m]=p[I+m]-D(p[I+m-S],0,0)+256&255}else{if(A==2)for(m=0;m<_;m++)y[L+m]=p[I+m]+256-p[I+m-_]&255;if(A==3){for(m=0;m<S;m++)y[L+m]=p[I+m]+256-(p[I+m-_]>>1)&255;for(m=S;m<_;m++)y[L+m]=p[I+m]+256-(p[I+m-_]+p[I+m-S]>>1)&255}if(A==4){for(m=0;m<S;m++)y[L+m]=p[I+m]+256-D(0,p[I+m-_],0)&255;for(m=S;m<_;m++)y[L+m]=p[I+m]+256-D(p[I+m-S],p[I+m-_],p[I+m-S-_])&255}}}function R(y,p){const F=new Uint8Array(y),_=F.slice(0),S=new Uint32Array(_.buffer),A=b(_,p),I=A[0],L=A[1],m=F.length,h=new Uint8Array(m>>2);let O;if(F.length<2e7)for(var C=0;C<m;C+=4)O=T(I,z=F[C]*(1/255),Q=F[C+1]*(1/255),X=F[C+2]*(1/255),ne=F[C+3]*(1/255)),h[C>>2]=O.ind,S[C>>2]=O.est.rgba;else for(C=0;C<m;C+=4){var z=F[C]*.00392156862745098,Q=F[C+1]*(1/255),X=F[C+2]*(1/255),ne=F[C+3]*(1/255);for(O=I;O.left;)O=K(O.est,z,Q,X,ne)<=0?O.left:O.right;h[C>>2]=O.ind,S[C>>2]=O.est.rgba}return{abuf:_.buffer,inds:h,plte:L}}function b(y,p,F){F==null&&(F=1e-4);const _=new Uint32Array(y.buffer),S={i0:0,i1:y.length,bst:null,est:null,tdst:0,left:null,right:null};S.bst=V(y,S.i0,S.i1),S.est=M(S.bst);const A=[S];for(;A.length<p;){let L=0,m=0;for(var I=0;I<A.length;I++)A[I].est.L>L&&(L=A[I].est.L,m=I);if(L<F)break;const h=A[m],O=H(y,_,h.i0,h.i1,h.est.e,h.est.eMq255);if(h.i0>=O||h.i1<=O){h.est.L=0;continue}const C={i0:h.i0,i1:O,bst:null,est:null,tdst:0,left:null,right:null};C.bst=V(y,C.i0,C.i1),C.est=M(C.bst);const z={i0:O,i1:h.i1,bst:null,est:null,tdst:0,left:null,right:null};for(z.bst={R:[],m:[],N:h.bst.N-C.bst.N},I=0;I<16;I++)z.bst.R[I]=h.bst.R[I]-C.bst.R[I];for(I=0;I<4;I++)z.bst.m[I]=h.bst.m[I]-C.bst.m[I];z.est=M(z.bst),h.left=C,h.right=z,A[m]=C,A.push(z)}for(A.sort(((L,m)=>m.bst.N-L.bst.N)),I=0;I<A.length;I++)A[I].ind=I;return[S,A]}function T(y,p,F,_,S){if(y.left==null)return y.tdst=(function(C,z,Q,X,ne){const Y=z-C[0],j=Q-C[1],re=X-C[2],$e=ne-C[3];return Y*Y+j*j+re*re+$e*$e})(y.est.q,p,F,_,S),y;const A=K(y.est,p,F,_,S);let I=y.left,L=y.right;A>0&&(I=y.right,L=y.left);const m=T(I,p,F,_,S);if(m.tdst<=A*A)return m;const h=T(L,p,F,_,S);return h.tdst<m.tdst?h:m}function K(y,p,F,_,S){const{e:A}=y;return A[0]*p+A[1]*F+A[2]*_+A[3]*S-y.eMq}function H(y,p,F,_,S,A){for(_-=4;F<_;){for(;x(y,F,S)<=A;)F+=4;for(;x(y,_,S)>A;)_-=4;if(F>=_)break;const I=p[F>>2];p[F>>2]=p[_>>2],p[_>>2]=I,F+=4,_-=4}for(;x(y,F,S)>A;)F-=4;return F+4}function x(y,p,F){return y[p]*F[0]+y[p+1]*F[1]+y[p+2]*F[2]+y[p+3]*F[3]}function V(y,p,F){const _=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],S=[0,0,0,0],A=F-p>>2;for(let I=p;I<F;I+=4){const L=y[I]*.00392156862745098,m=y[I+1]*(1/255),h=y[I+2]*(1/255),O=y[I+3]*(1/255);S[0]+=L,S[1]+=m,S[2]+=h,S[3]+=O,_[0]+=L*L,_[1]+=L*m,_[2]+=L*h,_[3]+=L*O,_[5]+=m*m,_[6]+=m*h,_[7]+=m*O,_[10]+=h*h,_[11]+=h*O,_[15]+=O*O}return _[4]=_[1],_[8]=_[2],_[9]=_[6],_[12]=_[3],_[13]=_[7],_[14]=_[11],{R:_,m:S,N:A}}function M(y){const{R:p}=y,{m:F}=y,{N:_}=y,S=F[0],A=F[1],I=F[2],L=F[3],m=_==0?0:1/_,h=[p[0]-S*S*m,p[1]-S*A*m,p[2]-S*I*m,p[3]-S*L*m,p[4]-A*S*m,p[5]-A*A*m,p[6]-A*I*m,p[7]-A*L*m,p[8]-I*S*m,p[9]-I*A*m,p[10]-I*I*m,p[11]-I*L*m,p[12]-L*S*m,p[13]-L*A*m,p[14]-L*I*m,p[15]-L*L*m],O=h,C=N;let z=[Math.random(),Math.random(),Math.random(),Math.random()],Q=0,X=0;if(_!=0)for(let Y=0;Y<16&&(z=C.multVec(O,z),X=Math.sqrt(C.dot(z,z)),z=C.sml(1/X,z),!(Y!=0&&Math.abs(X-Q)<1e-9));Y++)Q=X;const ne=[S*m,A*m,I*m,L*m];return{Cov:h,q:ne,e:z,L:Q,eMq255:C.dot(C.sml(255,ne),z),eMq:C.dot(z,ne),rgba:(Math.round(255*ne[3])<<24|Math.round(255*ne[2])<<16|Math.round(255*ne[1])<<8|Math.round(255*ne[0])<<0)>>>0}}var N={multVec:(y,p)=>[y[0]*p[0]+y[1]*p[1]+y[2]*p[2]+y[3]*p[3],y[4]*p[0]+y[5]*p[1]+y[6]*p[2]+y[7]*p[3],y[8]*p[0]+y[9]*p[1]+y[10]*p[2]+y[11]*p[3],y[12]*p[0]+y[13]*p[1]+y[14]*p[2]+y[15]*p[3]],dot:(y,p)=>y[0]*p[0]+y[1]*p[1]+y[2]*p[2]+y[3]*p[3],sml:(y,p)=>[y*p[0],y*p[1],y*p[2],y*p[3]]};Ft.encode=function(p,F,_,S,A,I,L){S==null&&(S=0),L==null&&(L=!1);const m=i(p,F,_,S,[!1,!1,!1,0,L,!1]);return $(m,-1),w(m,F,_,A,I)},Ft.encodeLL=function(p,F,_,S,A,I,L,m){const h={ctype:0+(S==1?0:2)+(A==0?0:4),depth:I,frames:[]},O=(S+A)*I,C=O*F;for(let z=0;z<p.length;z++)h.frames.push({rect:{x:0,y:0,width:F,height:_},img:new Uint8Array(p[z]),blend:0,dispose:1,bpp:Math.ceil(O/8),bpl:Math.ceil(C/8)});return $(h,0,!0),w(h,F,_,L,m)},Ft.encode.compress=i,Ft.encode.dither=u,Ft.quantize=R,Ft.quantize.getKDtree=b,Ft.quantize.getNearest=T})();const Bi={toArrayBuffer(n,f){const D=n.width,r=n.height,e=D<<2,t=n.getContext("2d").getImageData(0,0,D,r),l=new Uint32Array(t.data.buffer),u=(32*D+31)/32<<2,w=u*r,$=122+w,i=new ArrayBuffer($),a=new DataView(i),o=1<<20;let d,v,R,b,T=o,K=0,H=0,x=0;function V(y){a.setUint16(H,y,!0),H+=2}function M(y){a.setUint32(H,y,!0),H+=4}function N(y){H+=y}V(19778),M($),N(4),M(122),M(108),M(D),M(-r>>>0),V(1),V(32),M(3),M(w),M(2835),M(2835),N(8),M(16711680),M(65280),M(255),M(4278190080),M(1466527264),(function y(){for(;K<r&&T>0;){for(b=122+K*u,d=0;d<e;)T--,v=l[x++],R=v>>>24,a.setUint32(b+d,v<<8|R),d+=4;K++}x<l.length?(T=o,setTimeout(y,Bi._dly)):f(i)})()},toBlob(n,f){this.toArrayBuffer(n,(D=>{f(new Blob([D],{type:"image/bmp"}))}))},_dly:9};var _t={CHROME:"CHROME",FIREFOX:"FIREFOX",DESKTOP_SAFARI:"DESKTOP_SAFARI",IE:"IE",IOS:"IOS",ETC:"ETC"},Us={[_t.CHROME]:16384,[_t.FIREFOX]:11180,[_t.DESKTOP_SAFARI]:16384,[_t.IE]:8192,[_t.IOS]:4096,[_t.ETC]:8192};const Xn=typeof window<"u",Oi=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope,Cn=Xn&&window.cordova&&window.cordova.require&&window.cordova.require("cordova/modulemapper"),zs=(Xn||Oi)&&(Cn&&Cn.getOriginalSymbol(window,"File")||typeof File<"u"&&File),Ui=(Xn||Oi)&&(Cn&&Cn.getOriginalSymbol(window,"FileReader")||typeof FileReader<"u"&&FileReader);function Zn(n,f,D=Date.now()){return new Promise((r=>{const e=n.split(","),t=e[0].match(/:(.*?);/)[1],l=globalThis.atob(e[1]);let u=l.length;const w=new Uint8Array(u);for(;u--;)w[u]=l.charCodeAt(u);const $=new Blob([w],{type:t});$.name=f,$.lastModified=D,r($)}))}function zi(n){return new Promise(((f,D)=>{const r=new Ui;r.onload=()=>f(r.result),r.onerror=e=>D(e),r.readAsDataURL(n)}))}function Ni(n){return new Promise(((f,D)=>{const r=new Image;r.onload=()=>f(r),r.onerror=e=>D(e),r.src=n}))}function Vt(){if(Vt.cachedResult!==void 0)return Vt.cachedResult;let n=_t.ETC;const{userAgent:f}=navigator;return/Chrom(e|ium)/i.test(f)?n=_t.CHROME:/iP(ad|od|hone)/i.test(f)&&/WebKit/i.test(f)?n=_t.IOS:/Safari/i.test(f)?n=_t.DESKTOP_SAFARI:/Firefox/i.test(f)?n=_t.FIREFOX:(/MSIE/i.test(f)||document.documentMode)&&(n=_t.IE),Vt.cachedResult=n,Vt.cachedResult}function Pi(n,f){const D=Vt(),r=Us[D];let e=n,t=f,l=e*t;const u=e>t?t/e:e/t;for(;l>r*r;){const w=(r+e)/2,$=(r+t)/2;w<$?(t=$,e=$*u):(t=w*u,e=w),l=e*t}return{width:e,height:t}}function Ln(n,f){let D,r;try{if(D=new OffscreenCanvas(n,f),r=D.getContext("2d"),r===null)throw new Error("getContext of OffscreenCanvas returns null")}catch{D=document.createElement("canvas"),r=D.getContext("2d")}return D.width=n,D.height=f,[D,r]}function Hi(n,f){const{width:D,height:r}=Pi(n.width,n.height),[e,t]=Ln(D,r);return f&&/jpe?g/.test(f)&&(t.fillStyle="white",t.fillRect(0,0,e.width,e.height)),t.drawImage(n,0,0,e.width,e.height),e}function In(){return In.cachedResult!==void 0||(In.cachedResult=["iPad Simulator","iPhone Simulator","iPod Simulator","iPad","iPhone","iPod"].includes(navigator.platform)||navigator.userAgent.includes("Mac")&&typeof document<"u"&&"ontouchend"in document),In.cachedResult}function Mn(n,f={}){return new Promise((function(D,r){let e,t;var l=function(){try{return t=Hi(e,f.fileType||n.type),D([e,t])}catch(w){return r(w)}},u=function(w){try{var $=function(i){try{throw i}catch(a){return r(a)}};try{let i;return zi(n).then((function(a){try{return i=a,Ni(i).then((function(o){try{return e=o,(function(){try{return l()}catch(d){return r(d)}})()}catch(d){return $(d)}}),$)}catch(o){return $(o)}}),$)}catch(i){$(i)}}catch(i){return r(i)}};try{if(In()||[_t.DESKTOP_SAFARI,_t.MOBILE_SAFARI].includes(Vt()))throw new Error("Skip createImageBitmap on IOS and Safari");return createImageBitmap(n).then((function(w){try{return e=w,l()}catch{return u()}}),u)}catch{u()}}))}function An(n,f,D,r,e=1){return new Promise((function(t,l){let u;if(f==="image/png"){let $,i,a;return $=n.getContext("2d"),{data:i}=$.getImageData(0,0,n.width,n.height),a=Ft.encode([i.buffer],n.width,n.height,4096*e),u=new Blob([a],{type:f}),u.name=D,u.lastModified=r,w.call(this)}{let $=function(){return w.call(this)};if(f==="image/bmp")return new Promise((i=>Bi.toBlob(n,i))).then((function(i){try{return u=i,u.name=D,u.lastModified=r,$.call(this)}catch(a){return l(a)}}).bind(this),l);{let i=function(){return $.call(this)};if(typeof OffscreenCanvas=="function"&&n instanceof OffscreenCanvas)return n.convertToBlob({type:f,quality:e}).then((function(a){try{return u=a,u.name=D,u.lastModified=r,i.call(this)}catch(o){return l(o)}}).bind(this),l);{let a;return a=n.toDataURL(f,e),Zn(a,D,r).then((function(o){try{return u=o,i.call(this)}catch(d){return l(d)}}).bind(this),l)}}}function w(){return t(u)}}))}function Rt(n){n.width=0,n.height=0}function Yt(){return new Promise((function(n,f){let D,r,e,t;return Yt.cachedResult!==void 0?n(Yt.cachedResult):Zn("data:image/jpeg;base64,/9j/4QAiRXhpZgAATU0AKgAAAAgAAQESAAMAAAABAAYAAAAAAAD/2wCEAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAf/AABEIAAEAAgMBEQACEQEDEQH/xABKAAEAAAAAAAAAAAAAAAAAAAALEAEAAAAAAAAAAAAAAAAAAAAAAQEAAAAAAAAAAAAAAAAAAAAAEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwA/8H//2Q==","test.jpg",Date.now()).then((function(l){try{return D=l,Mn(D).then((function(u){try{return r=u[1],An(r,D.type,D.name,D.lastModified).then((function(w){try{return e=w,Rt(r),Mn(e).then((function($){try{return t=$[0],Yt.cachedResult=t.width===1&&t.height===2,n(Yt.cachedResult)}catch(i){return f(i)}}),f)}catch($){return f($)}}),f)}catch(w){return f(w)}}),f)}catch(u){return f(u)}}),f)}))}function ji(n){return new Promise(((f,D)=>{const r=new Ui;r.onload=e=>{const t=new DataView(e.target.result);if(t.getUint16(0,!1)!=65496)return f(-2);const l=t.byteLength;let u=2;for(;u<l;){if(t.getUint16(u+2,!1)<=8)return f(-1);const w=t.getUint16(u,!1);if(u+=2,w==65505){if(t.getUint32(u+=2,!1)!=1165519206)return f(-1);const $=t.getUint16(u+=6,!1)==18761;u+=t.getUint32(u+4,$);const i=t.getUint16(u,$);u+=2;for(let a=0;a<i;a++)if(t.getUint16(u+12*a,$)==274)return f(t.getUint16(u+12*a+8,$))}else{if((65280&w)!=65280)break;u+=t.getUint16(u,!1)}}return f(-1)},r.onerror=e=>D(e),r.readAsArrayBuffer(n)}))}function qi(n,f){const{width:D}=n,{height:r}=n,{maxWidthOrHeight:e}=f;let t,l=n;return isFinite(e)&&(D>e||r>e)&&([l,t]=Ln(D,r),D>r?(l.width=e,l.height=r/D*e):(l.width=D/r*e,l.height=e),t.drawImage(n,0,0,l.width,l.height),Rt(n)),l}function Vi(n,f){const{width:D}=n,{height:r}=n,[e,t]=Ln(D,r);switch(f>4&&f<9?(e.width=r,e.height=D):(e.width=D,e.height=r),f){case 2:t.transform(-1,0,0,1,D,0);break;case 3:t.transform(-1,0,0,-1,D,r);break;case 4:t.transform(1,0,0,-1,0,r);break;case 5:t.transform(0,1,1,0,0,0);break;case 6:t.transform(0,1,-1,0,r,0);break;case 7:t.transform(0,-1,-1,0,r,D);break;case 8:t.transform(0,-1,1,0,0,D)}return t.drawImage(n,0,0,D,r),Rt(n),e}function bi(n,f,D=0){return new Promise((function(r,e){let t,l,u,w,$,i,a,o,d,v,R,b,T,K,H,x,V,M,N,y;function p(_=5){if(f.signal&&f.signal.aborted)throw f.signal.reason;t+=_,f.onProgress(Math.min(t,100))}function F(_){if(f.signal&&f.signal.aborted)throw f.signal.reason;t=Math.min(Math.max(_,t),100),f.onProgress(t)}return t=D,l=f.maxIteration||10,u=1024*f.maxSizeMB*1024,p(),Mn(n,f).then((function(_){try{return[,w]=_,p(),$=qi(w,f),p(),new Promise((function(S,A){var I;if(!(I=f.exifOrientation))return ji(n).then((function(m){try{return I=m,L.call(this)}catch(h){return A(h)}}).bind(this),A);function L(){return S(I)}return L.call(this)})).then((function(S){try{return i=S,p(),Yt().then((function(A){try{return a=A?$:Vi($,i),p(),o=f.initialQuality||1,d=f.fileType||n.type,An(a,d,n.name,n.lastModified,o).then((function(I){try{{let m=function(){if(l--&&(H>u||H>T)){let O,C;return O=y?.95*N.width:N.width,C=y?.95*N.height:N.height,[V,M]=Ln(O,C),M.drawImage(N,0,0,O,C),o*=d==="image/png"?.85:.95,An(V,d,n.name,n.lastModified,o).then((function(z){try{return x=z,Rt(N),N=V,H=x.size,F(Math.min(99,Math.floor((K-H)/(K-u)*100))),m}catch(Q){return e(Q)}}),e)}return[1]},h=function(){return Rt(N),Rt(V),Rt($),Rt(a),Rt(w),F(100),r(x)};if(v=I,p(),R=v.size>u,b=v.size>n.size,!R&&!b)return F(100),r(v);var L;return T=n.size,K=v.size,H=K,N=a,y=!f.alwaysKeepResolution&&R,(L=(function(O){for(;O;){if(O.then)return void O.then(L,e);try{if(O.pop){if(O.length)return O.pop()?h.call(this):O;O=m}else O=O.call(this)}catch(C){return e(C)}}}).bind(this))(m)}}catch(m){return e(m)}}).bind(this),e)}catch(I){return e(I)}}).bind(this),e)}catch(A){return e(A)}}).bind(this),e)}catch(S){return e(S)}}).bind(this),e)}))}const Ns=`
3
- let scriptImported = false
4
- self.addEventListener('message', async (e) => {
5
- const { file, id, imageCompressionLibUrl, options } = e.data
6
- options.onProgress = (progress) => self.postMessage({ progress, id })
7
- try {
8
- if (!scriptImported) {
9
- // console.log('[worker] importScripts', imageCompressionLibUrl)
10
- self.importScripts(imageCompressionLibUrl)
11
- scriptImported = true
12
- }
13
- // console.log('[worker] self', self)
14
- const compressedFile = await imageCompression(file, options)
15
- self.postMessage({ file: compressedFile, id })
16
- } catch (e) {
17
- // console.error('[worker] error', e)
18
- self.postMessage({ error: e.message + '\\n' + e.stack, id })
19
- }
20
- })
21
- `;let Hn;function Ps(n,f){return new Promise(((D,r)=>{Hn||(Hn=(function(l){const u=[];return u.push(l),URL.createObjectURL(new Blob(u))})(Ns));const e=new Worker(Hn);e.addEventListener("message",(function(l){if(f.signal&&f.signal.aborted)e.terminate();else if(l.data.progress===void 0){if(l.data.error)return r(new Error(l.data.error)),void e.terminate();D(l.data.file),e.terminate()}else f.onProgress(l.data.progress)})),e.addEventListener("error",r),f.signal&&f.signal.addEventListener("abort",(()=>{r(f.signal.reason),e.terminate()})),e.postMessage({file:n,imageCompressionLibUrl:f.libURL,options:{...f,onProgress:void 0,signal:void 0}})}))}function gt(n,f){return new Promise((function(D,r){let e,t,l,u,w,$;if(e={...f},l=0,{onProgress:u}=e,e.maxSizeMB=e.maxSizeMB||Number.POSITIVE_INFINITY,w=typeof e.useWebWorker!="boolean"||e.useWebWorker,delete e.useWebWorker,e.onProgress=d=>{l=d,typeof u=="function"&&u(l)},!(n instanceof Blob||n instanceof zs))return r(new Error("The file given is not an instance of Blob or File"));if(!/^image/.test(n.type))return r(new Error("The file given is not an image"));if($=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope,!w||typeof Worker!="function"||$)return bi(n,e).then((function(d){try{return t=d,o.call(this)}catch(v){return r(v)}}).bind(this),r);var i=(function(){try{return o.call(this)}catch(d){return r(d)}}).bind(this),a=function(d){try{return bi(n,e).then((function(v){try{return t=v,i()}catch(R){return r(R)}}),r)}catch(v){return r(v)}};try{return e.libURL=e.libURL||"https://cdn.jsdelivr.net/npm/browser-image-compression@2.0.2/dist/browser-image-compression.js",Ps(n,e).then((function(d){try{return t=d,i()}catch{return a()}}),a)}catch{a()}function o(){try{t.name=n.name,t.lastModified=n.lastModified}catch{}try{e.preserveExif&&n.type==="image/jpeg"&&(!e.fileType||e.fileType&&e.fileType===n.type)&&(t=Di(n,t))}catch{}return D(t)}}))}gt.getDataUrlFromFile=zi,gt.getFilefromDataUrl=Zn,gt.loadImage=Ni,gt.drawImageInCanvas=Hi,gt.drawFileInCanvas=Mn,gt.canvasToFile=An,gt.getExifOrientation=ji,gt.handleMaxWidthOrHeight=qi,gt.followExifOrientation=Vi,gt.cleanupCanvasMemory=Rt,gt.isAutoOrientationInBrowser=Yt,gt.approximateBelowMaximumCanvasSizeOfBrowser=Pi,gt.copyExifWithoutOrientation=Di,gt.getBrowserName=Vt,gt.version="2.0.2";const Hs={class:"info"},js=["src"],qs={class:"info"},Vs={key:0},Ws={key:1},Qs={class:"more"},Gs={key:0,class:"note note-nomsg"},Ks={key:1,class:"note note-nomsg"},Js={class:"ss-card"},Ys={key:0},Xs={class:"ss-card jin-pan"},Zs=["src"],er={class:"context"},tr={key:0},nr=["src","onClick"],ir={class:"jin-pan-load"},or={class:"imgs"},ar={class:"img-btns"},sr=["onClick"],rr=["onClick"],lr={class:"img"},ur=["src"],cr=["onClick"],fr={key:0,class:"emp"},dr=["title"],hr={for:"choice-pic",class:"sr-only"},mr=["title"],gr={for:"choice-file",class:"sr-only"},vr=["title"],pr={for:"choice-video",class:"sr-only"},yr={class:"voice-menu-wrap"},wr=["title"],br=["title"],kr={for:"main-input",class:"sr-only"},Ir=["disabled","placeholder"],_r={for:"main-input-ex",class:"sr-only"},Sr=["disabled"],Cr={key:0,class:"forward-pan"},Mr={class:"ss-card card"},Ar={for:"chat-forward-search",class:"sr-only"},Tr=["placeholder"],Er=["onClick"],xr=["title","src"],Fr=4,$r=Ut({name:"ViewChat",__name:"Chat",props:{chat:{},list:{},imgView:{}},setup(n){const f=xn.global.t,{viewer:D}=ko("viewer",{viewer:null}),r=Io(),e=_i(),t=Kn(),l=Tn(),u=En(),w=Ii(),$=en("mergePan"),i=en("msgPan"),a=en("chatPadding"),o=en("sendMore"),d=en("mainInput"),v=he([]),R=he("single-message"),b=he({sendTag:"REFUSE",showBottomButton:!1,showMoreDetail:!1,showMsgMenu:!1,showForwardPan:!1,openChatInfo:!1,isReply:!1,isJinLoading:!1,onAtFind:!1,menuDisplay:{menuSelectedMsgId:null,jumpToMsg:!1,add:!0,relpy:!0,forward:!0,select:!0,copy:!0,copySelect:!1,copyImg:!1,downloadImg:!1,revoke:!1,reedit:!1,at:!0,poke:!1,remove:!1,respond:!1,showRespond:!0,config:!1},search:{userId:-1,list:gn(n.list)},msgTouch:{x:-1,y:-1,msgOnTouchDown:!1,onMove:"no"},checkNewLineFlag:!1}),T=he([{open:!1},{open:!1},{open:!1},{open:!1}]),K=he([]),H=he(0),x=he(""),V=he(""),M=he(new Map),N=he(!1),y=he(null),p=he(!1),F=he(null);let _=[];const S=he([]),A=he(null),I=he(""),L=he(null),m=he(0),h=he(null),O=he(null),C=he(null),z=he(0),Q=he(w.userList),X=he(void 0),ne=Mi();let Y=null;function j(s,c){return/^(?:group|room|chat|channel|guild|private):/i.test(s)?s:`${c}:${s}`}function re(s){const c=Number((s==null?void 0:s.local_time)??(s==null?void 0:s.timestamp_ms)??(s==null?void 0:s.time_ms)??0);if(c)return c;const k=Number((s==null?void 0:s.time)??0);return Number.isFinite(k)&&k>0?k*1e3:0}async function $e(){const s=n.chat.show.id;if(!s||s===0||T.value[3].open||b.value.showForwardPan)return;const c=n.chat.show.type==="group"?j(String(n.chat.show.channel_id??s),"group"):j(String(n.chat.show.channel_id??s),"private");let k=[];try{k=await vi({platform:String(l.loginInfo.platform??""),selfId:String(l.loginInfo.uin??""),channelId:c,limit:30})}catch{return}if(!k.length||String(n.chat.show.id)!==String(s))return;const U=new Set,E=oe=>{const de=String((oe==null?void 0:oe.message_id)??""),Ae=String((oe==null?void 0:oe.fake_message_id)??"");de&&U.add(de),Ae&&U.add(Ae)},J=[...u.messageList];for(const oe of J)E(oe);let Z=!1;for(const oe of k){const de=String(oe.message_id??""),Ae=String(oe.fake_message_id??"");de&&U.has(de)||Ae&&U.has(Ae)||!de&&!Ae||(E(oe),J.push(oe),Z=!0)}Z&&(J.sort((oe,de)=>re(oe)-re(de)),u.messageList.splice(0,u.messageList.length,...J))}function Se(){Y!==null&&(window.clearInterval(Y),Y=null),n.chat.show.id&&($e(),Y=window.setInterval(()=>{$e()},2500))}function pe(){Y!==null&&(window.clearInterval(Y),Y=null)}const we={beforeHook:s=>{const c=On();if(!c)return;c.style.transition="all 0s";const k=document.getElementById("chat-pan");if(!k)return;const U=k.getElementsByClassName("chat")[0];U&&(U.style.overflowY="hidden")},moveHook:(s,c)=>{const k=On();k&&(k.style.transform="translateX("+c+"px)")},endHook:s=>{const c=document.getElementById("chat-pan"),k=c==null?void 0:c.getElementsByClassName("chat")[0];k&&(k.style.overflowY="scroll");const U=On();U&&(U.style.transition="transform 0.3s",U.style.transform="")},rightLimit:{value:100,type:"%"},speedCondition:{minMove:{value:.5*e.inch,type:"px"},minSpeed:5*e.inch},moveCondition:{minMove:{value:33,type:"%"}}};function Ne(){H.value=0,b.value={sendTag:"REFUSE",showBottomButton:!1,showMoreDetail:!1,showMsgMenu:!1,showForwardPan:!1,openChatInfo:!1,isReply:!1,isJinLoading:!1,onAtFind:!1,menuDisplay:{menuSelectedMsgId:null,jumpToMsg:!1,add:!0,relpy:!0,forward:!0,select:!0,copy:!0,copySelect:!1,copyImg:!1,downloadImg:!1,revoke:!1,reedit:!1,at:!0,poke:!1,remove:!1,respond:!1,showRespond:!0,config:!1},search:{userId:-1,list:gn(n.list)},msgTouch:{x:-1,y:-1,msgOnTouchDown:!1,onMove:"no"},checkNewLineFlag:!1},K.value=[],be=!0}It(()=>n.chat,()=>{Ne(),S.value=[],M.value.clear(),v.value=[],Ze(),yt(()=>{Le(),ue(),St()}),Se();const s=gi(),c=n.chat.show.id,k=[...w.userList].find(U=>(U.user_id??U.group_id)===c);k&&s.add(k)}),It(()=>x.value,(s,c)=>{V.value=c,Le()}),un(()=>{Se();const s=gi(),c=n.chat.show.id,k=[...w.userList].find(U=>(U.user_id??U.group_id)===c);k&&s.add(k),si(n.list.length,0),It(()=>n.list.map(U=>U.message_id+"_"+U.fake_msg),(U,E=[])=>{si(U.length,E.length),U.length>0&&E.length===0&&yt(ee)}),It(()=>n.chat.info.jin_info.list.length,()=>{b.value.isJinLoading=!1}),wt.type=="capacitor"&&wt.platform==="android"&&wt.addListener("App","backButton",()=>{hn()}),It(()=>r.backTimes,()=>{hn()}),yt(()=>{ut(),je(),Le(),ue(),St()})}),Gn(()=>{if(pe(),Fe!==null&&(cancelAnimationFrame(Fe),Fe=null),Je!==null&&(cancelAnimationFrame(Je),Je=null),Ye!==null&&(Ye.disconnect(),Ye=null),ge!==null&&(ge.disconnect(),ge=null),De!==null){const s=i.value;s==null||s.removeEventListener("load",De,!0),s==null||s.removeEventListener("error",De,!0),s==null||s.removeEventListener("loadedmetadata",De,!0),s==null||s.removeEventListener("loadeddata",De,!0),De=null}});let Fe=null,Je=null,Ye=null,ge=null,De=null,be=!0,Ce=[];function Le(s,c=!1){yt(()=>{Fe!==null&&cancelAnimationFrame(Fe),Fe=requestAnimationFrame(()=>{Fe=null,ct(s??d.value),Re(c?()=>ee():void 0)})})}function nt(){const s=o.value,c=a.value,k=i.value;if(!s||!c||!k)return;const U=Array.from(s.children).flatMap(Z=>Array.from(Z.children)).filter(Z=>Z instanceof HTMLElement&&Z.offsetHeight>0),E=U.length>0?U.reduce((Z,oe)=>Math.min(Z,oe.getBoundingClientRect().top),Number.POSITIVE_INFINITY):s.getBoundingClientRect().top,J=k.getBoundingClientRect().bottom;c.style.height=Math.max(0,J-E)+"px"}function Re(s){s&&Ce.push(s),Je===null&&(Je=requestAnimationFrame(()=>{Je=null,nt();const c=Ce;Ce=[],c.forEach(k=>k())}))}function ut(){if(Ye!==null)return;const s=o.value;if(!s||typeof ResizeObserver>"u"){Re();return}Ye=new ResizeObserver(()=>{Re()}),Ye.observe(s),Re()}function je(){const s=i.value;if(!s||ge!==null||De!==null)return;const c=()=>{St(),ue()};De=c,s.addEventListener("load",c,!0),s.addEventListener("error",c,!0),s.addEventListener("loadedmetadata",c,!0),s.addEventListener("loadeddata",c,!0),!(typeof ResizeObserver>"u")&&(ge=new ResizeObserver(()=>{c()}),ge.observe(s),s.firstElementChild&&ge.observe(s.firstElementChild))}function ue(){!be||!i.value||(ee(!1),requestAnimationFrame(()=>{!be||!i.value||(ee(!1),requestAnimationFrame(()=>{be&&i.value&&ee(!1)}))}))}function ct(s){const c=s??d.value;if(!c)return;if(t.sysConfig.send_key==="none"){c.style.height="";return}if(!(c instanceof HTMLTextAreaElement)){c.style.height="";return}const k=getComputedStyle(c),U=Number.parseFloat(k.lineHeight),E=Number.parseFloat(k.fontSize),J=Number.isFinite(U)?U:E,Z=Number.parseFloat(k.paddingTop)||0,oe=Number.parseFloat(k.paddingBottom)||0,de=Number.parseFloat(k.borderTopWidth)||0,Ae=Number.parseFloat(k.borderBottomWidth)||0;let me=(Number.isFinite(J)?J:0)+Z+oe+de+Ae;if(me<=0){const Ge=c.offsetHeight||Number.parseFloat(k.height)||E;Ge&&Number.isFinite(Ge)&&(me=Ge)}c.dataset.baseHeight||(c.dataset.baseHeight=String(me));const lt=c.style.transition;c.style.transition="none";const qe=c.style.overflow,Te=Number.parseFloat(c.dataset.baseHeight)||me;if(c.value==="")c.style.height=Te+"px";else{c.style.overflow="hidden",c.style.height="0px";const Ge=Math.max(c.scrollHeight-Fr,Te);c.style.height=Ge+"px",c.style.overflow=qe}c.getBoundingClientRect(),c.style.transition=lt}function At(){li(),yt(()=>{var s;A.value&&(tn("chat-"+((s=A.value)==null?void 0:s.message_id),!0),et())})}function St(){const s=i.value;if(!s)return;const c=s.scrollHeight>s.clientHeight+1,k=s.scrollTop+s.clientHeight+10>=s.scrollHeight;b.value.showBottomButton=c&&!k}function Xe(s,c){if(c)return;const k=s.target;k.scrollTop===0&&n.list.length>0&&bt(),k.scrollTop+k.clientHeight+10>=k.scrollHeight?(be=!0,H.value=0,b.value.showBottomButton=!1):(be&&(be=!1),St())}async function bt(){if(!e.nowGetHistory&&e.canLoadHistory!==!1){const s=n.list[0],c=s.message_id,k=Number(s==null?void 0:s.time),U=Number((s==null?void 0:s.local_time)??(s==null?void 0:s.timestamp_ms)??(s==null?void 0:s.time_ms)??0)||(Number.isFinite(k)?k*1e3:0),E=t.sysConfig.enable_local_history&&t.sysConfig.mixed_load_messages!==!1;if(e.nowGetHistory=!0,E&&Number.isFinite(k)?e.historyBeforeTime=k:e.historyBeforeTime=void 0,e.loadHistoryFail=!1,E){let qe=[];if(Number.isFinite(k)?qe=await Eo(l.loginInfo.uin,u.chatInfo.show.id,k,20):qe=await xo(l.loginInfo.uin,u.chatInfo.show.id,c,20),qe.length>0){const Te=new Set(u.messageList.map(Lt=>String(Lt.message_id??""))),Ge=qe.filter(Lt=>{const Tt=String((Lt==null?void 0:Lt.message_id)??"");return Tt.length===0||!Te.has(Tt)});Ge.length>0&&u.messageList.splice(0,0,...Ge);const Ke=n.list[Ge.length]??n.list[Ge.length-1],xt=Be([...Ge,Ke]);xt.length>0&&P(xt)}}const J=u.chatInfo.show.type,Z=u.chatInfo.show.id,oe=String(u.chatInfo.show.channel_id??""),de=J==="group"?j(oe||String(Z),"group"):j(oe||String(Z),"private"),Ae=await vi({platform:String(l.loginInfo.platform??""),selfId:String(l.loginInfo.uin??""),channelId:de,limit:20,beforeTimeMs:U>0?U:void 0}),me=new Set(u.messageList.map(qe=>String(qe.message_id??""))),lt=Ae.filter(qe=>{const Te=String(qe.message_id??"");return Te.length===0||!me.has(Te)});lt.length>0&&u.messageList.splice(0,0,...lt),Ae.length<20&&(e.canLoadHistory=!1),e.nowGetHistory=!1}}function Be(s){const c=[];for(let k=0;k<s.length-1;k++){const U=s[k].message_seq??s[k].seq??null,E=s[k+1].message_seq??s[k+1].seq??null;if(U==null||E==null)return[];E-U>1&&c.push(s[k+1].message_id)}return c}function P(s){var Z;const c=u.chatInfo.show.type,k=u.chatInfo.show.id,U=String(u.chatInfo.show.channel_id??k),E=String(u.chatInfo.show.guild_id??k);let J;l.jsonMap.message_list&&c!="group"?J=l.jsonMap.message_list.private_name:J=(Z=l.jsonMap.message_list)==null?void 0:Z.name;for(const oe of s)tt.send(J??"get_chat_history",{group_id:c=="group"?E||k:void 0,guild_id:c=="group"?E||k:void 0,channel_id:U,user_id:c!="group"?k:void 0,message_id:oe,count:20},"getChatHistoryGapFill_"+oe)}function q(s,c=!0){const k=document.getElementById("msgPan");k!==null&&s&&(c===!1?k.style.scrollBehavior="unset":k.style.scrollBehavior="smooth",k.scrollTop=s,k.style.scrollBehavior="smooth")}function ee(s=!1){const c=document.getElementById("msgPan");c!==null&&q(c.scrollHeight,s)}function se(s){tn(s,!0)||new dt().add(Oe.INFO,f("无法定位上下文"))}function ae(s){const c=document.getElementById("msgPan");c&&(n.list.length<=20&&!b.value.showBottomButton?ee():q(c.scrollTop+s,!1))}function le(s){if(ce(s)||b.value.onAtFind||s.key!=="Enter")return;let c=!1;switch(t.sysConfig.send_key){case"none":if(s.shiftKey||s.ctrlKey||s.altKey||s.metaKey)break;c=!0;break;case"shift":if(!s.shiftKey)break;c=!0;break;case"ctrl":if(!s.ctrlKey)break;c=!0;break;case"alt":if(!s.altKey)break;c=!0;break;case"meta":if(!s.metaKey)break;c=!0;break}c&&b.value.sendTag!="PASS"&&(b.value.sendTag="READY"),b.value.sendTag=="READY"&&x.value!==""?(s.preventDefault(),Zt()):s.key==="Enter"&&(s.ctrlKey||s.metaKey||s.altKey)&&(x.value+=`
22
- `),b.value.sendTag="REFUSE"}function ce(s){var c;if(!b.value.onAtFind)return!1;if(s.keyCode===38||s.keyCode===40){s.preventDefault();const k=s.keyCode===38?-1:1;return ze(k),h.value!==null||(h.value=setTimeout(()=>{O.value=setInterval(()=>{ze(k)},50)},300)),!0}if(s.keyCode===13){s.preventDefault();const k=(c=L.value)==null?void 0:c[m.value];return k&&Ue(k.user_id),!0}return s.keyCode===27?(s.preventDefault(),b.value.onAtFind=!1,L.value=null,m.value=0,!0):!1}function xe(){b.value.sendTag="REFUSE"}function rt(){b.value.sendTag="PASS",setTimeout(()=>{b.value.sendTag="REFUSE"},50)}function Pe(s){const c=new Ot;if(s.keyCode!==27&&((s.keyCode===38||s.keyCode===40)&&(h.value!==null&&(clearTimeout(h.value),h.value=null),O.value!==null&&(clearInterval(O.value),O.value=null)),b.value.checkNewLineFlag&&(b.value.checkNewLineFlag=!1,x.value==`
23
- `&&(x.value="",Le())),!(b.value.onAtFind&&L.value&&L.value.length>0&&(s.keyCode===38||s.keyCode===40||s.keyCode===13||s.keyCode===27))&&s.keyCode!=13)){const k=x.value.substring(x.value.length-1);if(!b.value.onAtFind&&k=="@"&&u.chatInfo.info.group_members.length>0&&u.chatInfo.show.type=="group"&&(c.add(vn.UI,"开始匹配群成员列表 ……"),b.value.onAtFind=!0,m.value=0),b.value.onAtFind)if(x.value.lastIndexOf("@")<0)c.add(vn.UI,"匹配群成员列表被打断 ……"),b.value.onAtFind=!1,L.value=null,m.value=0;else{const U=x.value.substring(x.value.lastIndexOf("@")+1).toLowerCase();L.value=u.chatInfo.info.group_members.filter(E=>E.card!=""&&E.card!=null&&E.card.toLowerCase().indexOf(U)>=0||E.nickname.toLowerCase().indexOf(U)>=0||U==E.user_id.toString()),L.value.length==0&&(L.value=u.chatInfo.info.group_members),m.value=0}}}function it(s){s.preventDefault(),x.value!=""&&Zt()}function Ue(s){s!=null&&(x.value=x.value.substring(0,x.value.lastIndexOf("@")),Pt({msgObj:{type:"at",qq:String(s)},addText:!0})),Kt(),b.value.onAtFind=!1,L.value=null,m.value=0}function Ie(){yt(()=>{const s=document.querySelector(".at-tag.show"),c=document.querySelector(".at-tag.show > div.selected");if(s&&c){const k=s.getBoundingClientRect(),U=c.getBoundingClientRect();U.top<k.top?c.scrollIntoView({block:"nearest",behavior:"smooth"}):U.bottom>k.bottom&&c.scrollIntoView({block:"nearest",behavior:"smooth"})}})}function ze(s){!L.value||L.value.length===0||(s===-1?m.value=m.value>0?m.value-1:L.value.length-1:m.value=m.value<L.value.length-1?m.value+1:0,Ie())}function ot(){const s=document.getElementById("main-input")??document.getElementById("main-input-ex");if(s!==null&&s.selectionStart===s.selectionEnd){let c=-1;typeof s.selectionStart=="number"&&(c=s.selectionStart);const k=pi.getSQList(x.value);k!=null&&k.forEach(U=>{const E=x.value.indexOf(U),J=E+U.length;E!==-1&&c>E&&c<J&&yt(()=>{s.selectionStart=E,s.selectionEnd=J})})}}function Ct(s,c){var J;if(A.value=c,b.value.menuDisplay.menuSelectedMsgId=c.message_id,Ei.get("log_level")==="debug"&&new Ot().debug("右击消息:"+c),v.value.length>0)return;const k=document.getElementById("msgMenu"),U=s.target;let E="member";if(u.chatInfo.show.type=="group"&&u.chatInfo.info.group_members&&u.chatInfo.info.group_members.forEach(Z=>{Z.user_id==c.sender.user_id&&(E=Z.role)}),k!==null&&c!==null){if(Fo("close_respond")==!0&&(b.value.menuDisplay.showRespond=!1),U.nodeName=="IMG"&&U.name=="avatar")Object.keys(b.value.menuDisplay).forEach(me=>{b.value.menuDisplay[me]=!1}),b.value.menuDisplay.showRespond=!1,b.value.menuDisplay.at=!0,b.value.menuDisplay.poke=!0,b.value.menuDisplay.remove=!0,(u.chatInfo.show.type!="group"||c.sender.user_id===l.loginInfo.uin||u.chatInfo.info.me_info.role==="member"||E=="owner"||E=="admin"&&u.chatInfo.info.me_info.role!="owner")&&(b.value.menuDisplay.remove=!1),c.sender.user_id===l.loginInfo.uin&&(b.value.menuDisplay.at=!1),u.chatInfo.show.type=="group"&&u.chatInfo.info.me_info.role!="member"&&(b.value.menuDisplay.config=!0);else{(c.sender.user_id===l.loginInfo.uin||u.chatInfo.info.me_info.role==="admin"||u.chatInfo.info.me_info.role==="owner")&&(b.value.menuDisplay.revoke=!0),b.value.menuDisplay.reedit=b.value.menuDisplay.revoke&&c.sender.user_id===l.loginInfo.uin,c.revoke===!0&&(b.value.menuDisplay.relpy=!1,b.value.menuDisplay.forward=!1,b.value.menuDisplay.revoke=!1,b.value.menuDisplay.select=!1),T.value[3].open&&(Object.keys(b.value.menuDisplay).forEach(Ke=>{b.value.menuDisplay[Ke]=!1}),b.value.menuDisplay.jumpToMsg=!0);const me=document.getSelection(),lt=(J=me==null?void 0:me.anchorNode)==null?void 0:J.parentElement;let qe=null,Te=lt;if(Te)for(;Te.className!="chat";){if(Te.className.startsWith("message")&&Te.className.indexOf("-")<0){qe=Te;break}if(Te=Te.parentElement,!Te)break}lt&&lt.className.indexOf("msg-text")>-1&&me.focusNode==me.anchorNode&&qe&&qe.id==c.message_id&&(I.value=me.toString(),I.value.length>0&&(b.value.menuDisplay.copySelect=!0));const Ge=["xml","json"];c.message.forEach(Ke=>{Ge.indexOf(Ke.type)>0&&(b.value.menuDisplay.forward=!1,b.value.menuDisplay.add=!1)}),U.nodeName=="IMG"&&U.src.length>0&&(b.value.menuDisplay.downloadImg=U.src,wt.isDesktop()&&(b.value.menuDisplay.copyImg=!0))}const Z=s.x,oe=s.y;k.style.marginLeft=Z+"px",k.style.marginTop=oe+"px";let de=k.clientWidth;b.value.menuDisplay.showRespond&&(de=k.children[0].clientWidth);const Ae=window.innerWidth;Z+de>Ae+27&&(k.style.marginLeft=Ae+7-de+"px"),b.value.showMsgMenu=!0,yt(()=>{const me=k.clientHeight,lt=document.body.clientHeight;oe+me>lt-20&&(k.classList.add("topOut"),k.style.marginTop=lt-me-10+"px")})}}function Ze(){b.value.menuDisplay={menuSelectedMsgId:null,jumpToMsg:!1,add:!0,relpy:!0,forward:!0,select:!0,copy:!0,copySelect:!1,downloadImg:!1,copyImg:!1,revoke:!1,reedit:!1,at:!1,poke:!1,remove:!1,respond:!1,showRespond:!0,config:!1}}function at(s=!0){const c=A.value;c&&(Ve(c),s&&et())}function Ve(s){const c=s.message_id;A.value=s,Pt({msgObj:{type:"reply",id:String(c)},addText:!1,addTop:!0}),b.value.isReply=!0,Kt()}function He(){S.value=S.value.filter(s=>s.type!=="reply"),b.value.isReply=!1}function zt(){var c;if(!A.value)return;const s=((c=A.value)==null?void 0:c._rawSatori)??A.value;try{console.log(JSON.stringify(s,null,2))}catch{console.dir(s,{depth:null})}et()}function ft(){Q.value=w.userList,b.value.showForwardPan=!1,R.value="single-message",et()}function ht(s,...c){const k=s;for(const U of c){const E=k[U],J=typeof E=="string"||typeof E=="number"?String(E):"";if(J&&J!=="undefined")return J}return""}function Me(s){if(s.group_id)return ht(s,"group_name","name")||String(s.group_id);const c=ht(s,"nickname","name","nick","username","remark")||String(s.user_id??""),k=String(s.user_id??"");return k?`${c}(${k})`:c}function cn(s){const c=s.target.value;Q.value=w.userList.filter(k=>{const U=k.user_id?ht(k,"nickname","name","nick","remark")||String(k.user_id):ht(k,"group_name","name")||String(k.group_id||""),E=String(k.user_id??k.group_id??"");return U.toLowerCase().indexOf(c.toLowerCase())!==-1||E.length>0&&E===c})}function Et(s="single-message"){R.value=s,b.value.showForwardPan=!0,[...w.onMsgList].reverse().forEach(k=>{const U=Q.value.indexOf(k);U>-1&&(Q.value.splice(U,1),Q.value.unshift(k))}),et()}function Wt(){if(A.value){const s=JSON.parse(JSON.stringify(A.value));Ht(n.chat.show.id,n.chat.show.type,s.message,!0)}et()}function Rn(){A.value&&v.value.push(A.value.message_id),et()}function ve(s){const c=Ci(s);if(typeof structuredClone=="function")try{return structuredClone(c)}catch{return JSON.parse(JSON.stringify(c))}return JSON.parse(JSON.stringify(c))}function st(s){const c=R.value,k=A.value?ve(A.value):null,U=s.group_id?s.group_id:s.user_id,E=String(U),J=s.group_id?"group":"user",Z=String(s.channel_id??s.channelId??""),oe=String(s.guild_id??s.guildId??""),de=u.messageList.filter(me=>v.value.includes(me.message_id)),Ae=()=>String(n.chat.show.id)===E&&n.chat.show.type===J;if(c!=="single-message"&&de.length===0){ft();return}if(c==="individual-messages"){const me={title:f("逐条转发"),html:f("将按顺序逐条转发 {count} 条消息,是否继续?",{count:de.length}),button:[{text:f("取消"),fun:()=>{e.popBoxList.shift()}},{text:f("确定"),master:!0,fun:()=>{de.forEach(lt=>{Ht(E,J,ve(lt.message),Ae(),"sendMsgBack",Z||void 0,oe||void 0)}),v.value=[],e.popBoxList.shift(),Mt(s,U)}}]};e.popBoxList.push(me)}else if(c==="merged-messages"){const me={app:"com.tencent.multimsg",meta:{detail:{source:f("合并转发消息"),news:[...de.slice(0,3).map(Te=>({text:(Te.sender.card&&Te.sender.card!=""?Te.sender.card:Te.sender.nickname)+": "+on(Te)}))],summary:f("查看 {count} 条转发消息",{count:de.length}),resid:""}}},lt={message:[{type:"json",data:JSON.stringify(me),id:""}],sender:{user_id:l.loginInfo.uin,nickname:l.loginInfo.nickname,avatar:l.loginInfo.avatar}},qe={title:f("合并转发消息"),template:an(rn),templateValue:an({data:lt,type:"forward"}),button:[{text:f("取消"),fun:()=>{e.popBoxList.shift()}},{text:f("确定"),master:!0,fun:async()=>{const Te=de.map(Ke=>{var xt,Lt,Tt;return{type:"node",id:Ke.message_id,user_id:String(((xt=Ke.sender)==null?void 0:xt.user_id)??""),nickname:String(((Lt=Ke.sender)==null?void 0:Lt.card)||((Tt=Ke.sender)==null?void 0:Tt.nickname)||""),time:Ke.time,content:ve(Ke.message)}}),Ge=await $o(String(l.loginInfo.platform??""),String(l.loginInfo.uin??""),J,E,Te);if(!Ge.ok)new dt().add(Oe.ERR,f("合并转发发送失败"));else{const Ke=Date.now(),xt={fake_msg:"pending",message_id:"forward-"+Ke,fake_message_id:"forward-"+Ke,message_type:J,channel_type:J==="group"?0:1,time:Math.floor(Ke/1e3),local_time:Ke,timestamp_ms:Ke,post_type:"message",sender:{user_id:String(l.loginInfo.uin??""),nickname:String(l.loginInfo.nickname??""),avatar:String(l.loginInfo.avatar??"")},message:[{type:"forward",id:"",content:Te.map(Bt=>({message_id:String(Bt.id??""),time:Number(Bt.time??Math.floor(Ke/1e3)),sender:{user_id:String(Bt.user_id??""),nickname:String(Bt.nickname??"")},message:Bt.content??[]}))}],raw_message:`[${f("聊天记录")}]`};Ae()&&(u.messageList.push(xt),yt(()=>{tn("chat-"+xt.message_id,!0)}));const Lt=J==="group"?Z||E:/^(?:private|direct):/i.test(Z||"")?Z:`private:${E}`;Ge.native&&!Ge.messageId||await Lo({id:String(xt.fake_message_id??""),platform:String(l.loginInfo.platform??""),selfId:String(l.loginInfo.uin??""),channelId:Lt,guildId:oe||void 0,channelType:J,messageId:Ge.messageId,content:String(xt.raw_message??""),message:xt.message,forwardContent:Te,source:"webui",sentAt:Ke,kind:"forward"});const Tt=w.baseOnMsgList.get(yn(E));if(Tt){const Bt=`[${f("聊天记录")}]`;Tt.raw_msg_base=Bt,Tt.raw_msg=Tt.group_id?`${String(l.loginInfo.nickname??"")}: ${Bt}`:Bt,Tt.time=Math.floor(Ke/1e3),w.baseOnMsgList.set(yn(E),Tt),Ro()}}v.value=[],e.popBoxList.shift(),Mt(s,U)}}]};e.popBoxList.push(qe)}else if(A.value&&k){const me={title:f("转发消息"),template:an(rn),templateValue:an({data:k,type:"forward"}),button:[{text:f("取消"),fun:()=>{e.popBoxList.shift()}},{text:f("确定"),master:!0,fun:()=>{Ht(E,J,ve(k.message),Ae(),"sendMsgBack",Z||void 0,oe||void 0),e.popBoxList.shift(),Mt(s,U)}}]};e.popBoxList.push(me)}}function Mt(s,c){ft(),w.baseOnMsgList.get(yn(c))==null&&w.baseOnMsgList.set(yn(c),s),yt(()=>{const k=document.getElementById("user-"+c);k&&k.click()})}function $t(){const s=A.value;if(s!==null){s.raw_message||(s.raw_message=on(s));const c=new dt;Xt.config.globalProperties.$copyText(s.raw_message).then(()=>{c.add(Oe.INFO,f("复制成功"),!0)},()=>{c.add(Oe.ERR,f("复制失败"),!0)})}et()}function Qt(){if(I.value!=""){const s=new dt;Xt.config.globalProperties.$copyText(I.value).then(()=>{s.add(Oe.INFO,f("复制成功"),!0)},()=>{s.add(Oe.ERR,f("复制失败"),!0)})}et()}async function fn(){const s=b.value.menuDisplay.downloadImg;if(!s)return;et();const{blob:c,buffer:k}=await Do(s),U=new dt;if(wt.type==="tauri")try{await(await Ti(()=>import("./index-Cg_esKB0.js"),__vite__mapDeps([0,1]),import.meta.url)).writeImage(k),U.add(Oe.INFO,f("复制成功"))}catch(E){U.add(Oe.ERR,f("复制失败")),new Ot().error(E,"复制图片失败")}else{const E=new ClipboardItem({[c.type]:c});try{await Bo([E]),U.add(Oe.INFO,f("复制成功"))}catch(J){U.add(Oe.ERR,f("复制失败")),new Ot().error(J,"复制图片失败")}}}function Qe(){const s=b.value.menuDisplay.downloadImg;s!=!1&&Oo(s,`img_${new Date().getTime()}.png`,()=>{},()=>{}),et()}async function Dt(){const s=A.value;if(et(),!s){new dt().add(Oe.ERR,f("获取选中消息失败"));return}const c=s.message_id,k=String(s.channel_id??s.channelId??u.chatInfo.show.channel_id??n.chat.show.id);await tt.callApi("delete_msg",{channel_id:k,message_id:c})}async function Gt(){const s=A.value;if(et(),!s){new dt().add(Oe.ERR,f("获取选中消息失败"));return}const c=s.message_id,k=String(s.channel_id??s.channelId??u.chatInfo.show.channel_id??n.chat.show.id);await tt.callApi("delete_msg",{channel_id:k,message_id:c}),fo(s)}function mt(){const s=A.value;if(s!==null){const c={title:f("提醒"),html:`<span>${f("真的要将 {user} 移出群聊吗",{user:s.sender.nickname})}</span>`,button:[{text:f("确定"),fun:()=>{s&&(tt.send("set_group_kick",{group_id:u.chatInfo.show.id,user_id:s.sender.user_id},"setGroupKick"),et(),e.popBoxList.shift())}},{text:f("取消"),master:!0,fun:()=>{e.popBoxList.shift()}}]};e.popBoxList.push(c)}}function et(){b.value.showMsgMenu=!1,b.value.menuDisplay.menuSelectedMsgId=null,setTimeout(()=>{Ze()},300)}function dn(){var s,c,k,U,E,J,Z;if(b.value.openChatInfo=!b.value.openChatInfo,b.value.openChatInfo){if(n.chat.show.type==="group"&&((s=n.chat.info.group_info)==null?void 0:s.gc)!==n.chat.show.id){const de=`https://qinfo.clt.qq.com/cgi-bin/qun_info/get_group_info_all?gc=${n.chat.show.id}&bkn=${l.loginInfo.bkn}`;tt.send("http_proxy",{url:de},"getMoreGroupInfo")}else if(n.chat.show.type==="user"&&((c=n.chat.info.user_info)==null?void 0:c.uin)!==n.chat.show.id){const de=(U=(k=l.jsonMap)==null?void 0:k.friend_info)==null?void 0:U.name;de!=null&&tt.send(de,{user_id:n.chat.show.id},"getMoreUserInfo")}const oe=(J=(E=l.jsonMap)==null?void 0:E.group_notices)==null?void 0:J.name;if(n.chat.show.type==="group"&&(n.chat.info.group_notices===void 0||Object.keys(n.chat.info.group_notices??{}).length===0)&&oe&&tt.send(oe,{group_id:n.chat.show.id},"getGroupNotices"),n.chat.show.type==="group"&&Object.keys(n.chat.info.group_files??{}).length===0){const de=(Z=l.jsonMap.group_files)==null?void 0:Z.name;de&&tt.send(de,{group_id:n.chat.show.id},"getGroupFiles")}}}function Wi(s,c,k){let U=-1;for(let E=0;E<k;E++)if(U=s.indexOf(c,U+1),U<0)return s;return U<0?s:s.slice(0,U)+s.slice(U+c.length)}function ei(s){const c=S.value[s];if((c==null?void 0:c.type)==="image")return"[图片]";if((c==null?void 0:c.type)==="at"){const k=String(c.qq??c.id??""),U=u.chatInfo.info.group_members.find(J=>String(J.user_id)===k);return"[@"+String(c.text||(U==null?void 0:U.card)||(U==null?void 0:U.nickname)||k)+"]"}return"[SQ:"+s+"]"}function Dn(s){var k;M.value.delete(s);const c=S.value[s];if((c==null?void 0:c.type)==="image"){let U=0;for(let E=0;E<=s;E++)((k=S.value[E])==null?void 0:k.type)==="image"&&U++;x.value=Wi(x.value,"[图片]",U)}else x.value=x.value.replace("[SQ:"+s+"]",""),x.value=x.value.replace("[SQ:"+s,"")}async function Qi(s){const c=M.value.get(s);if(!c||!(D!=null&&D.value))return;const k=await D.value.edit(c);M.value.set(s,k)}function Pt(s){const c=document.getElementById("main-input")??document.getElementById("main-input-ex");if(s!==void 0){if(s.msgObj.type==="at"){const J=String(s.msgObj.qq??s.msgObj.id??""),Z=u.chatInfo.info.group_members.find(oe=>String(oe.user_id)===J);s.msgObj={...s.msgObj,qq:J,text:String((Z==null?void 0:Z.card)||(Z==null?void 0:Z.nickname)||J)}}const k=S.value.length;if(S.value.push(s.msgObj),!s.addText)return k;const U=ei(k),E=s.msgObj.type==="at"?" ":"";if(s.addTop===!0)x.value=U+E+x.value;else{const J=c==null?void 0:c.selectionStart,Z=(c==null?void 0:c.selectionEnd)??J;if(J!=null){const oe=x.value.substring(0,J),de=x.value.substring(Z,x.value.length);x.value=oe+U+E+de,yt(()=>{const Ae=J+U.length+E.length;c.selectionStart=Ae,c.selectionEnd=Ae})}else x.value+=U+E}return k}return-1}function ti(s){if(s.clipboardData&&s.clipboardData.items)for(let c=0,k=s.clipboardData.items.length;c<k;c++){const U=s.clipboardData.items[c];U.kind==="file"&&(Bn(U.getAsFile()),s.preventDefault())}}function ni(){const s=document.getElementById("choice-pic");s&&s.click()}function Gi(s){b.value.showMoreDetail=!1;const c=s.target;c&&c.files&&Bn(c.files[0])}function ii(){const s=document.getElementById("choice-file");s&&s.click()}function Ki(){const s=document.getElementById("choice-video");s&&s.click()}function Ji(s){b.value.showMoreDetail=!1;const c=s.target;if(c.files!=null){const k=c.files[0],U=k.name;if(k.size>500*1024*1024){const J={title:f("提醒"),html:`<span>${f("文件大于 500MB。发送速度可能会非常缓慢;确认要发送吗?")}</span>`,button:[{text:f("发送"),fun:()=>{e.popBoxList.shift()}},{text:f("取消"),master:!0,fun:()=>{e.popBoxList.shift()}}]};e.popBoxList.push(J)}else Xi(k,U);c.value=""}}function Yi(s){b.value.showMoreDetail=!1;const c=s.target;if(c.files!=null){const k=c.files[0],U=k.name;k.size>500*1024*1024?new dt().add(Oe.ERR,f("视频文件不能超过 500MB")):Zi(k,U),c.value=""}}function oi(s,c,k){const U=c??s.name??f("未知文件"),E=Po({fileName:U,fileSize:s.size,execute:J=>{const Z=new FileReader;Z.onprogress=oe=>{oe.lengthComputable&&J(oe.loaded,oe.total)},Z.readAsDataURL(s),Z.onloadend=()=>{let oe=Z.result;oe=oe.substring(oe.indexOf("base64,")+7,oe.length),S.value=[],M.value.clear(),x.value="",Pt({addText:!0,msgObj:{type:k,file:"base64://"+oe,name:U}}),Zt("sendFileBack_"+E)},Z.onerror=()=>{Ho(E,"文件读取失败")}}})}function Xi(s,c){oi(s,c,"file")}function Zi(s,c){oi(s,c,"video")}async function Bn(s){const c=new dt;if(!s||!s.type.includes("image/")||s.size===0)return;if(s.size>3145728){const J={maxSizeMB:3,useWebWorker:!0};try{c.add(Oe.INFO,f("正在压缩图片 ……"));const Z=await gt(s,J);new Ot().add(vn.INFO,"图片压缩成功,原大小:"+s.size/1024/1024+" MB,压缩后大小:"+Z.size/1024/1024+" MB"),Bn(Z)}catch(Z){new Ot().error(Z,"图片压缩失败"),c.add(Oe.INFO,f("压缩图片失败"))}return}const k=await ai(s),U=S.value.length,E={type:"image",text:`[${f("图片")}]`};M.value.set(U,k),Pt({addText:!0,msgObj:E})}async function ai(s){return new Promise((c,k)=>{const U=new FileReader;U.onload=function(E){E.target?c(E.target.result):k(new Error("读取文件失败"))},U.onerror=function(E){k(E)},U.readAsDataURL(s)})}function eo(s){return new Promise((c,k)=>{const U=new FileReader;U.onload=function(E){var oe;const J=String(((oe=E.target)==null?void 0:oe.result)??""),Z=J.indexOf("base64,");c(Z>=0?J.slice(Z+7):J)},U.onerror=function(E){k(E)},U.readAsDataURL(s)})}function to(){var s;if(N.value){(s=F.value)==null||s.stop(),p.value=!1;return}p.value=!p.value}async function no(){var s,c;if(p.value=!1,!N.value){if(!((s=navigator.mediaDevices)!=null&&s.getUserMedia)||typeof MediaRecorder>"u"){new dt().add(Oe.ERR,f("当前浏览器不支持录音"));return}try{if((c=navigator.permissions)!=null&&c.query)try{if((await navigator.permissions.query({name:"microphone"})).state==="denied"){new dt().add(Oe.ERR,f("麦克风权限被拒绝,请在浏览器设置中允许访问麦克风"));return}}catch{}const k=await navigator.mediaDevices.getUserMedia({audio:!0});_=[];const U=new MediaRecorder(k);F.value=U,N.value=!0,U.ondataavailable=E=>{E.data.size>0&&_.push(E.data)},U.onstop=async()=>{N.value=!1,F.value=null,k.getTracks().forEach(de=>de.stop());const E=new Blob(_,{type:U.mimeType||"audio/webm"}),J=await eo(E),Z=U.mimeType.includes("mp4")?"voice.m4a":"voice.webm",oe=U.mimeType.includes("mp4")?"audio/mp4":"audio/webm";_.length>0&&(y.value={type:"record",file:"base64://"+J,url:`data:${oe};base64,${J}`,fileName:Z,name:f("语音")},x.value="",S.value=[],M.value.clear()),_=[]},U.start()}catch(k){N.value=!1,F.value=null,k instanceof DOMException&&k.name==="NotAllowedError"&&new dt().add(Oe.ERR,f("麦克风权限被拒绝,请在浏览器设置中允许访问麦克风")),new Ot().error(k,f("录音失败"))}}}function io(){y.value=null,p.value=!1,_=[],x.value="",Kt()}function oo(){p.value=!1;const s=document.getElementById("choice-audio");s==null||s.click()}async function ao(s){var E;const c=s.target,k=(E=c.files)==null?void 0:E[0];if(c.value="",!k)return;if(!k.type.startsWith("audio/")&&!/\.(mp3|wav|m4a|aac|ogg|webm|flac)$/i.test(k.name)){new dt().add(Oe.ERR,f("请选择音频文件"));return}const U=await ai(k);y.value={type:"record",file:U,url:U,fileName:k.name,name:f("语音")},x.value="",S.value=[],M.value.clear(),_=[]}function Kt(){const s=document.getElementById("main-input")??document.getElementById("main-input-ex");s!==null&&s.focus()}function Zt(s="sendMsgBack"){if(T.value[3].open)return;if(T.value.forEach(k=>{k.open=!1}),y.value){const k=y.value;y.value=null,p.value=!1,_=[],n.chat.show.temp?Ht(n.chat.show.id+"/"+n.chat.show.temp,n.chat.show.type,[k],!0,s):Ht(n.chat.show.id,n.chat.show.type,[k],!0,s),x.value="",S.value=[],M.value.clear();return}for(const[k,U]of M.value)S.value[k]={type:"image",file:"base64://"+U.substring(U.indexOf("base64,")+7,U.length)};const c=pi.parseMsg(x.value,S.value,[]);n.chat.show.temp?Ht(n.chat.show.id+"/"+n.chat.show.temp,n.chat.show.type,c,!0,s):Ht(n.chat.show.id,n.chat.show.type,c,!0,s),b.value.checkNewLineFlag=!0,x.value="",S.value=[],M.value.clear(),ee(),He(),Le(void 0,!0)}function si(s,c){var U,E;if(c==0&&s>0){const J=((U=l.jsonMap.set_message_read)==null?void 0:U.name)??void 0;if(!J)return;let Z=((E=l.jsonMap.set_message_read)==null?void 0:E.private_name)??J;Z||(Z=J),u.chatInfo.show.type=="group"?tt.send(J,{group_id:n.chat.show.id,message_id:n.list[n.list.length-1].message_id},"setMessageRead"):tt.send(Z,{user_id:n.chat.show.id,message_id:n.list[n.list.length-1].message_id},"setMessageRead"),_o()&&Kt()}if(b.value.showBottomButton&&!e.nowGetHistory&&c>0&&(H.value!==0?H.value=H.value+Math.abs(s-c):H.value=Math.abs(s-c)),n.list.length>200&&!e.nowGetHistory&&!b.value.showBottomButton){u.messageList=[];const J={type:n.chat.show.type,id:n.chat.show.id,name:n.chat.show.name,avatar:n.chat.show.avatar,jump:n.chat.show.jump};So(J),e.nowGetHistory=!0}const k=document.getElementById("msgPan");if(k!==null){const J=k.scrollHeight;yt(()=>{const Z=document.getElementById("msgPan");Z!==null&&(e.nowGetHistory&&q(Z.scrollHeight-J,!1),e.nowGetHistory||(b.value.showBottomButton||q(Z.scrollHeight),c<=0&&(q(Z.scrollHeight,!1),ue()),St()));const oe=()=>{const de=[];for(const Ae of n.list)if(Ae.message!==void 0)for(const me of Ae.message)me.type==="image"&&me.file!="marketface"&&de.push(me.url);return de};X.value=Vn.fromList(oe()),u.chatInfo.show&&u.chatInfo.show.jump&&(new Ot().debug("进入跳转至消息:"+u.chatInfo.show.jump),se("chat-"+u.chatInfo.show.jump),u.chatInfo.show.jump=void 0)})}}function so(s,c){const k=c.message_id;v.value.length>0&&(v.value.indexOf(k)>-1?v.value=v.value.filter(U=>U!=k):v.value.push(k))}function ro(){new dt().add(Oe.INFO,f("欸嘿,这个按钮只是用来占位置的"))}function lo(){const s=n.list.filter(E=>v.value.indexOf(E.message_id)>-1);let c="",k="";s.forEach(E=>{const J=new Date(Uo(E.time)),Z=J.getFullYear()+"-"+(J.getMonth()+1)+"-"+J.getDate();Z!=k&&(c+=`
24
- —— `+Z+` ——
25
- `,k=Z),c+=E.sender.nickname+" "+J.getHours()+":"+J.getMinutes()+":"+J.getSeconds()+`
26
- `+on(E)+`
27
-
28
- `});const U=new dt;Xt.config.globalProperties.$copyText(c).then(()=>{U.add(Oe.INFO,f("复制成功"),!0),v.value=[]},()=>{U.add(Oe.ERR,f("复制失败"),!0)})}async function uo(){const s=n.list.filter(k=>v.value.includes(k.message_id)),c=[];for(const k of s){const U=k.message_id,E=String(k.channel_id??k.channelId??u.chatInfo.show.channel_id??n.chat.show.id);c.push(tt.callApi("delete_msg",{channel_id:E,message_id:U}))}v.value=[],await Promise.all(c)}async function ri(s){const c=s.target;Le(c);const k=zo(x.value,V.value);let{end:U,str:E}={end:0,str:""};if(k.length>0&&({end:U,str:E}=k[0]),E.indexOf("]")>=0){const J=V.value.substring(0,U),Z=J.lastIndexOf("[图片]");if(Z>=0&&Z<U){let Ae=0,me=-1;for(;(me=J.indexOf("[图片]",me+1))>=0;)Ae++;const qe=S.value.map((Te,Ge)=>(Te==null?void 0:Te.type)==="image"?Ge:-1).filter(Te=>Te>=0)[Ae-1];qe!==void 0&&M.value.has(qe)&&Dn(qe)}const oe=V.value.substring(0,U).lastIndexOf("[SQ:");if(oe>=0&&oe<U){const Ae=V.value.substring(oe),lt=V.value.slice(oe,Ae.indexOf("]")+oe+1).replace("[SQ:","").replace("]",""),qe=Number(lt);!isNaN(qe)&&M.value.has(qe)&&Dn(qe)}if(V.value.substring(0,U).match(/\[@[^\]]+\]$/)){const Ae=S.value.findIndex(me=>(me==null?void 0:me.type)==="at");Ae>=0&&S.value.splice(Ae,1)}}if(T.value[3].open){C.value&&(clearTimeout(C.value),C.value=null);const J=c.value;if(J.length==0)z.value++,b.value.search.list=gn(n.list);else if(t.sysConfig.enable_local_history){const Z=++z.value;C.value=setTimeout(async()=>{const oe=await No(l.loginInfo.uin,u.chatInfo.show.id,J);Z!==z.value||!T.value[3].open||(b.value.search.list=oe)},180)}else z.value++,b.value.search.list=n.list.filter(Z=>on(Z).indexOf(J)!==-1)}}function co(){T.value[3].open=!T.value[3].open,b.value.showMoreDetail=!b.value.showMoreDetail}function li(){C.value&&(clearTimeout(C.value),C.value=null),z.value++,T.value[3].open=!T.value[3].open,x.value="",b.value.search.list=gn(n.list),Le()}function ui(s){var c;if(l.jsonMap.poke){let k=(c=l.jsonMap.poke)==null?void 0:c.name;n.chat.show.type=="user"&&l.jsonMap.poke.private_name&&(k=l.jsonMap.poke.private_name),tt.send(k,{user_id:s,group_id:n.chat.show.id},"sendPoke")}b.value.showMoreDetail=!1,b.value.menuDisplay.poke=!1}function fo(s){x.value="",S.value=[],M.value.clear(),He();for(const c of s.message)if(c.type==="text")x.value+=c.text;else if(c.type==="reply"){const k=n.list.find(U=>U.message_id==c.id);if(!k)continue;Ve(k)}else c.type==="record"||c.type==="audio"?(y.value={...c,name:c.name||f("语音")},x.value="",S.value=[],M.value.clear()):(Pt({addText:!1,msgObj:c}),x.value+=ei(S.value.length-1));Kt()}function ho(s){var k,U;const c=s.target;if(c.scrollTop+c.clientHeight===c.scrollHeight&&!b.value.isJinLoading&&n.chat.info.jin_info.is_end==!1){b.value.isJinLoading=!0;const E=((U=(k=l.jsonMap)==null?void 0:k.group_essence)==null?void 0:U.name)??"get_essence_msg_list";tt.send(E,{group_id:n.chat.show.id,pages:n.chat.info.jin_info.pages+1},"getJin")}}function mo(s){D!=null&&D.value&&D.value.open(new Vn(s))}function ci(s="default"){let c=!1;if(T.value.forEach(k=>{k.open&&(c=!0),k.open=!1}),!c){if(b.value.showMoreDetail){b.value.showMoreDetail=!1;return}switch(s){case"default":b.value.showMoreDetail=!0;break;case"img":ni();break;case"file":ii();break;case"face":T.value[1].open=!T.value[1].open;break}}}function On(){var c;const s=document.getElementById("chat-pan");if(s)return b.value.openChatInfo?s.getElementsByClassName("chat-info-pan")[0]:(c=$.value)!=null&&c.isMergeOpen()?s.getElementsByClassName("merge-pan")[0]:s}function hn(){var s,c;b.value.openChatInfo?dn():(s=$.value)!=null&&s.isMergeOpen()?((c=$.value)==null||c.closeMergeMsg(),setTimeout(()=>{const U=document.getElementById("chat-pan").getElementsByClassName("merge-pan")[0];U&&(U.style.transform="")},500)):(u.chatInfo.show.id=0,e.openSideBar=!0,new Ot().add(vn.UI,"右滑打开侧边栏触发完成"))}return(s,c)=>{var U;const k=Fn("font-awesome-icon");return _e((W(),te("div",{id:"chat-pan",class:vt("chat-pan"+(B(e).openSideBar?" open":"")+(["linux","win32"].includes(B(wt).platform??"")?" withBar":"")),style:kn({"background-image":B(To)(B(t).sysConfig.chat_more_blur?"":B(t).sysConfig.chat_background),"background-position":B(t).sysConfig.chat_background_align??"center","background-size":B(t).sysConfig.chat_background_fit??"cover"}),onVMoveRight:c[22]||(c[22]=Un(E=>hn(),["prevent"]))},[qt(s.$slots,"chat-extra",{},void 0,!0),g("div",Hs,[ie(k,{class:"back",icon:["fas","angle-left"],onClick:hn}),g("img",{"data-avatar":"",src:n.chat.show.avatar||"/img/icons/icon.svg",onError:c[0]||(c[0]=(...E)=>B(_n)&&B(_n)(...E))},null,40,js),g("div",qs,[g("p",null,[pn(G(n.chat.show.name)+" ",1),n.chat.show.type=="group"?(W(),te(ke,{key:0},[pn(" ("+G(n.chat.info.group_members.length)+") ",1)],64)):fe("",!0)]),n.chat.show.temp?(W(),te("span",Vs,G(B(f)("来自群聊:{group}",{group:n.chat.show.temp})),1)):(W(),te("span",Ws,[n.chat.show.appendInfo?(W(),te(ke,{key:0},[pn(G(n.chat.show.appendInfo),1)],64)):(W(),te(ke,{key:1},[pn(G(n.list[n.list.length-1]?B(f)("上次消息 - {time}",{time:Intl.DateTimeFormat(B(ne),{hour:"numeric",minute:"numeric",second:"numeric"}).format(new Date(n.list[n.list.length-1].time*1e3))}):B(f)("暂无消息")),1)],64))]))]),c[23]||(c[23]=g("div",{class:"space"},null,-1)),g("div",Qs,[ie(k,{icon:["fas","ellipsis-vertical"],onClick:dn})])]),g("div",{class:vt("loading"+(B(e).nowGetHistory&&B(e).canLoadHistory?" show":""))},[ie(k,{icon:["fas","spinner"]}),g("span",null,G(B(f)("加载中")),1)],2),g("div",{id:"msgPan",ref_key:"msgPan",ref:i,class:"chat",style:{"scroll-behavior":"smooth"},onScroll:c[1]||(c[1]=E=>Xe(E,T.value[3].open))},[T.value[3].open?(W(),Ee(qn,{key:1,name:B(t).sysConfig.opt_fast_animation?"":"msglist",tag:"div"},{default:kt(()=>[(W(!0),te(ke,null,pt(b.value.search.list,(E,J)=>(W(),te(ke,null,[B(jn)(n.list[Number(J)-1]?n.list[Number(J)-1].time:void 0,E.time)?(W(),Ee(jt,{key:"notice-time-"+J,data:{sub_type:"time",time:E.time}},null,8,["data"])):fe("",!0),(E.post_type==="message"||E.post_type==="message_sent")&&E.message.length>0?(W(),Ee(rn,{key:E.fake_message_id??E.message_id,selected:v.value.includes(E.message_id)||b.value.menuDisplay.menuSelectedMsgId==E.message_id,selecting:v.value.length>0,data:E,onScrollToMsg:B(tn),onShowMenu:Ct,onImageLoaded:ae,onLeftMove:Ve,onContentRendered:ue},null,8,["selected","selecting","data","onScrollToMsg"])):fe("",!0)],64))),256))]),_:1},8,["name"])):(W(),te(ke,{key:0},[B(e).canLoadHistory?fe("",!0):(W(),te("div",Gs,[c[24]||(c[24]=g("hr",null,null,-1)),g("a",null,G(B(f)("没有更多消息了")),1)])),B(e).loadHistoryFail?(W(),te("div",Ks,[c[25]||(c[25]=g("hr",null,null,-1)),g("a",null,G(B(f)("获取历史记录失败")),1)])):fe("",!0),B(e).nowGetHistory&&n.list.length>0?(W(),Ee(jt,{key:2,data:{sub_type:"time",time:n.list[0].time}},null,8,["data"])):fe("",!0),ie(qn,{name:B(t).sysConfig.opt_fast_animation?"":"msglist",tag:"div"},{default:kt(()=>[(W(!0),te(ke,null,pt(n.list,(E,J)=>(W(),te(ke,null,[B(jn)(n.list[Number(J)-1]?n.list[Number(J)-1].time:void 0,E.time)?(W(),Ee(jt,{key:"notice-time-"+(E.time/240).toFixed(0),data:{sub_type:"time",time:E.time}},null,8,["data"])):fe("",!0),B(Fi)(E)?(W(),Ee(jt,{key:"delete-"+E.message_id,data:{sub_type:"delete"}})):(E.post_type==="message"||E.post_type==="message_sent")&&E.message.length>0?(W(),Ee(rn,{key:E.fake_message_id??E.message_id,selected:v.value.includes(E.message_id)||b.value.menuDisplay.menuSelectedMsgId==E.message_id,selecting:v.value.length>0,data:E,"image-list-header":X.value,onClick:Z=>so(Z,E),onShowMenu:Ct,onScrollToMsg:B(tn),onImageLoaded:ae,onLeftMove:Ve,onSendPoke:ui,onContentRendered:ue},null,8,["selected","selecting","data","image-list-header","onClick","onScrollToMsg"])):E.post_type==="notice"?(W(),Ee(jt,{id:B(xi)(),key:"notice-"+J,data:E},null,8,["id","data"])):fe("",!0)],64))),256))]),_:1},8,["name"])],64)),g("span",{ref_key:"chatPadding",ref:a,class:"chat-padding"}," ",512)],544),g("div",{class:"new-msg",style:kn({opacity:b.value.showBottomButton?1:0}),onClick:c[2]||(c[2]=E=>ee(!0))},[g("div",Js,[ie(k,{icon:["fas","angle-down"]}),H.value>0?(W(),te("span",Ys,G(H.value),1)):fe("",!0)])],4),g("div",{id:"send-more",ref_key:"sendMore",ref:o,class:"more"},[g("div",null,[g("div",null,[ie(nn,{name:"pan"},{default:kt(()=>[_e(ie(Es,{onAddSpecialMsg:Pt,onSendMsg:Zt},null,512),[[We,T.value[1].open]])]),_:1}),ie(nn,{name:"pan"},{default:kt(()=>[_e(g("div",Xs,[g("div",null,[ie(k,{icon:["fas","message"]}),g("span",null,G(B(f)("精华消息")),1),ie(k,{icon:["fas","xmark"],onClick:c[3]||(c[3]=E=>T.value[2].open=!T.value[2].open)})]),g("div",{class:"jin-pan-body",onScroll:ho},[(W(!0),te(ke,null,pt(n.chat.info.jin_info.list,(E,J)=>(W(),te("div",{key:"jin-"+J},[g("div",null,[g("img",{"data-avatar":"",src:E.sender_avatar||"/img/icons/icon.svg"},null,8,Zs),g("div",null,[g("a",null,G(E.sender_nick),1),g("span",null,G(E.sender_time?Intl.DateTimeFormat(B(ne),{hour:"numeric",minute:"numeric"}).format(new Date(E.sender_time*1e3)):"")+" "+G(B(f)("发送")),1)]),g("span",null,G(B(f)("{time},由 {name} 设置",{time:E.sender_time?Intl.DateTimeFormat(B(ne),{hour:"numeric",minute:"numeric"}).format(new Date(E.sender_time*1e3)):"",name:E.add_digest_nick})),1)]),g("div",er,[(W(!0),te(ke,null,pt(E.msg_content,(Z,oe)=>(W(),te(ke,{key:"jinc-"+J+"-"+oe},[Z.type==="text"?(W(),te("span",tr,G(Z.data.text),1)):fe("",!0),Z.type==="face"?(W(),Ee(Wn,{key:1,emoji:B(sn).get(Number(Z.data.id))},null,8,["emoji"])):fe("",!0),Z.type==="image"?(W(),te("img",{key:2,src:Z.data.url,onClick:de=>mo(Z.data.url)},null,8,nr)):fe("",!0)],64))),128))])]))),128)),_e(g("div",ir,[ie(k,{icon:["fas","spinner"]})],512),[[We,b.value.isJinLoading]])],32)],512),[[We,T.value[2].open&&n.chat.info.jin_info.list.length>0]])]),_:1})]),g("div",{class:vt(v.value.length>0?"select-tag show":"select-tag")},[g("div",null,[ie(k,{icon:["fas","share-from-square"],onClick:c[4]||(c[4]=E=>Et("individual-messages"))}),g("span",null,G(B(f)("逐条转发")),1)]),g("div",null,[ie(k,{icon:["fas","share"],onClick:c[5]||(c[5]=E=>Et("merged-messages"))}),g("span",null,G(B(f)("合并转发")),1)]),g("div",null,[ie(k,{icon:["fas","scissors"]}),g("span",null,G(B(f)("截图")),1)]),g("div",null,[ie(k,{icon:["fas","trash-can"],onClick:ro}),g("span",null,G(B(f)("删除")),1)]),g("div",null,[ie(k,{icon:["fas","copy"],onClick:lo}),g("span",null,G(B(f)("复制")),1)]),g("div",null,[ie(k,{icon:["fas","xmark"],onClick:uo}),g("span",null,G(B(f)("撤回")),1)]),g("div",null,[g("span",{onClick:c[6]||(c[6]=E=>v.value=[])},G(v.value.length),1),g("span",null,G(B(f)("取消")),1)])],2),ie(nn,{name:"img-pan"},{default:kt(()=>[_e(g("div",{class:vt({"img-pan":!0,"ss-card":!0}),onWheel:c[7]||(c[7]=E=>E.currentTarget.scrollLeft+=E.deltaY)},[g("div",or,[(W(!0),te(ke,null,pt(M.value,([E,J])=>(W(),te("div",{key:"imgCache-"+E},[g("div",ar,[g("div",{onClick:Z=>Qi(E)},[ie(k,{icon:["fas","pencil"]})],8,sr),c[26]||(c[26]=g("hr",null,null,-1)),g("div",{onClick:Z=>Dn(E)},[ie(k,{style:{color:"var(--color-red)"},icon:["fas","xmark"]})],8,rr)]),g("div",lr,[g("img",{src:J,alt:"[图片]"},null,8,ur)]),g("span",null,"#"+G(E),1)]))),128))])],544),[[We,M.value.size>0]])]),_:1}),g("div",{class:vt(T.value[3].open?"search-tag show":"search-tag")},[ie(k,{icon:["fas","search"]}),g("span",null,G(B(t).sysConfig.enable_local_history?B(f)("搜索已保存的消息"):B(f)("搜索已加载的消息")),1),g("div",{onClick:li},[ie(k,{icon:["fas","xmark"]})])],2),g("div",{class:vt(b.value.isReply?"replay-tag show":"replay-tag")},[ie(k,{icon:["fas","reply"]}),g("span",null,G(A.value===null?"":A.value.sender.nickname+": "+B(on)(A.value)),1),g("div",{onClick:He},[ie(k,{icon:["fas","xmark"]})])],2),g("div",{class:vt(L.value!=null?"at-tag show":"at-tag"),contenteditable:"true",onBlur:c[8]||(c[8]=E=>Ue(void 0))},[(W(!0),te(ke,null,pt(L.value!=null?L.value:[],(E,J)=>(W(),te("div",{key:"atFind-"+E.user_id,class:vt({selected:J===m.value}),onClick:Z=>Ue(E.user_id)},[c[27]||(c[27]=g("img",{src:"/img/icons/icon.svg"},null,-1)),g("span",null,G(E.card!=""&&E.card!=null?E.card:E.nickname),1),g("a",null,G(E.user_id),1)],10,cr))),128)),((U=L.value)==null?void 0:U.length)==0?(W(),te("div",fr,[g("span",null,G(B(f)("没有找到匹配的群成员")),1)])):fe("",!0)],34),g("div",{class:vt((b.value.showMoreDetail?"more-detail show":"more-detail")+(p.value?" voice-menu-open":"")),onClick:c[10]||(c[10]=E=>p.value=!1)},[g("div",{title:B(f)("图片"),onClick:ni},[ie(k,{icon:["fas","image"]}),g("input",{id:"choice-pic",type:"file",accept:"image/*",style:{display:"none"},onChange:Gi},null,32),g("label",hr,G(B(f)("选择图片")),1)],8,dr),g("div",{title:B(f)("文件"),onClick:ii},[ie(k,{icon:["fas","folder"]}),g("input",{id:"choice-file",type:"file",style:{display:"none"},onChange:Ji},null,32),g("label",gr,G(B(f)("选择文件")),1)],8,mr),g("div",{title:B(f)("视频"),onClick:Ki},[ie(k,{icon:["fas","video"]}),g("input",{id:"choice-video",type:"file",accept:"video/*",style:{display:"none"},onChange:Yi},null,32),g("label",pr,G(B(f)("选择视频")),1)],8,vr),g("div",yr,[g("div",{title:N.value?B(f)("停止录音"):B(f)("发送语音"),class:vt({active:N.value}),onClick:Un(to,["stop"])},[ie(k,{icon:["fas",N.value?"stop":"microphone"]},null,8,["icon"])],10,wr),p.value?(W(),te("div",{key:0,class:"voice-menu",onClick:c[9]||(c[9]=Un(()=>{},["stop"]))},[g("div",{onClick:no},G(B(f)("浏览器录音")),1),g("div",{onClick:oo},G(B(f)("音频文件")),1)])):fe("",!0),g("input",{id:"choice-audio",type:"file",accept:"audio/*",style:{display:"none"},onChange:ao},null,32)]),c[28]||(c[28]=g("div",{class:"space"},null,-1)),g("div",{title:B(f)("搜索消息"),onClick:co},[ie(k,{icon:["fas","search"]})],8,br)],2)]),g("div",null,[_e((W(),te("div",{onClick:c[11]||(c[11]=E=>ci(B(t).sysConfig.quick_send))},[b.value.showMoreDetail||T.value.find(E=>E.open)?(W(),Ee(k,{key:0,icon:["fas","minus"]})):B(t).sysConfig.quick_send=="default"?(W(),Ee(k,{key:1,icon:["fas","plus"]})):B(t).sysConfig.quick_send=="img"?(W(),Ee(k,{key:2,icon:["fas","image"]})):B(t).sysConfig.quick_send=="file"?(W(),Ee(k,{key:3,icon:["fas","folder"]})):fe("",!0)])),[[B(Mo),E=>ci(),void 0,{prevent:!0}]]),g("div",null,[g("form",{onSubmit:it},[y.value?(W(),te("div",{key:0,id:"voice-pending-input",class:"voice-pending",role:"button",onClick:io},[g("span",null,"["+G(B(f)("语音"))+"]",1),ie(k,{icon:["fas","xmark"]})])):(W(),te(ke,{key:1},[B(t).sysConfig.send_key==="none"?(W(),te(ke,{key:0},[g("label",kr,G(B(f)("消息输入框")),1),_e(g("input",{id:"main-input",ref_key:"mainInput",ref:d,"onUpdate:modelValue":c[12]||(c[12]=E=>x.value=E),type:"text",autocomplete:"off",disabled:B(e).openSideBar||n.chat.info.me_info.shut_up_timestamp>0,placeholder:n.chat.info.me_info.shut_up_timestamp>0?B(f)("已被禁言至:{time}",{time:Intl.DateTimeFormat(B(ne),B(Ai)(new Date(n.chat.info.me_info.shut_up_timestamp*1e3))).format(new Date(n.chat.info.me_info.shut_up_timestamp*1e3))}):"",onPaste:ti,onKeydown:ce,onKeyup:Pe,onClick:ot,onInput:ri},null,40,Ir),[[ln,x.value]])],64)):(W(),te(ke,{key:1},[g("label",_r,G(B(f)("消息输入框")),1),_e(g("textarea",{id:"main-input-ex",ref_key:"mainInput",ref:d,"onUpdate:modelValue":c[13]||(c[13]=E=>x.value=E),type:"text",disabled:B(e).openSideBar,onPaste:ti,onKeydown:le,onKeyup:Pe,onClick:ot,onInput:ri,onCompositionstart:xe,onCompositionend:rt},null,40,Sr),[[ln,x.value]])],64))],64))],32),qt(s.$slots,"main-input-button",{},void 0,!0),g("div",{onClick:c[14]||(c[14]=E=>Zt("sendMsgBack"))},[T.value[3].open?(W(),Ee(k,{key:0,icon:["fas","search"]})):(W(),Ee(k,{key:1,icon:["fas","angle-right"]}))])])]),c[29]||(c[29]=g("div",null,null,-1))],512),ie(Ls,{ref_key:"mergePan",ref:$},null,512),(W(),Ee(Ao,{to:"body"},[g("div",{class:vt("msg-menu"+(["linux","win32"].includes(B(wt).platform??"")?" withBar":""))},[_e(g("div",{class:"msg-menu-bg",onClick:et},null,512),[[We,b.value.showMsgMenu]]),g("div",{id:"msgMenu",class:vt(b.value.showMsgMenu?"ss-card msg-menu-body show":"ss-card msg-menu-body")},[_e(g("div",{onClick:c[15]||(c[15]=E=>Wt())},[g("div",null,[ie(k,{icon:["fas","plus"]})]),g("a",null,G(B(f)("+ 1")),1)],512),[[We,b.value.menuDisplay.add]]),_e(g("div",{onClick:c[16]||(c[16]=E=>at(!0))},[g("div",null,[ie(k,{icon:["fas","message"]})]),g("a",null,G(B(f)("回复")),1)],512),[[We,b.value.menuDisplay.relpy]]),_e(g("div",{onClick:c[17]||(c[17]=E=>Et())},[g("div",null,[ie(k,{icon:["fas","share"]})]),g("a",null,G(B(f)("转发")),1)],512),[[We,b.value.menuDisplay.forward]]),_e(g("div",{onClick:c[18]||(c[18]=E=>Rn())},[g("div",null,[ie(k,{icon:["fas","circle-check"]})]),g("a",null,G(B(f)("多选")),1)],512),[[We,b.value.menuDisplay.select]]),_e(g("div",{onClick:$t},[g("div",null,[ie(k,{icon:["fas","clipboard"]})]),g("a",null,G(B(f)("复制")),1)],512),[[We,b.value.menuDisplay.copy]]),_e(g("div",{onClick:Qt},[g("div",null,[ie(k,{icon:["fas","code"]})]),g("a",null,G(B(f)("复制选中文本")),1)],512),[[We,b.value.menuDisplay.copySelect]]),_e(g("div",{onClick:fn},[g("div",null,[ie(k,{icon:["fas","object-ungroup"]})]),g("a",null,G(B(f)("复制图片")),1)],512),[[We,b.value.menuDisplay.copyImg]]),_e(g("div",{onClick:Qe},[g("div",null,[ie(k,{icon:["fas","floppy-disk"]})]),g("a",null,G(B(f)("下载图片")),1)],512),[[We,b.value.menuDisplay.downloadImg!=!1]]),_e(g("div",{onClick:Dt},[g("div",null,[ie(k,{icon:["fas","xmark"]})]),g("a",null,G(B(f)("撤回")),1)],512),[[We,b.value.menuDisplay.revoke]]),_e(g("div",{onClick:Gt},[g("div",null,[ie(k,{icon:["fas","pencil"]})]),g("a",null,G(B(f)("重新编辑")),1)],512),[[We,b.value.menuDisplay.reedit]]),_e(g("div",{onClick:c[19]||(c[19]=E=>{A.value&&Pt({msgObj:{type:"at",qq:Number(A.value.sender.user_id)},addText:!0}),Kt(),et()})},[g("div",null,[ie(k,{icon:["fas","at"]})]),g("a",null,G(B(f)("提及")),1)],512),[[We,b.value.menuDisplay.at]]),_e(g("div",{onClick:c[20]||(c[20]=E=>ui(A.value?A.value.sender.user_id:void 0))},[g("div",null,[ie(k,{icon:["fas","fa-hand-point-up"]})]),g("a",null,G(B(f)("戳一戳")),1)],512),[[We,b.value.menuDisplay.poke]]),_e(g("div",{onClick:mt},[g("div",null,[ie(k,{icon:["fas","trash-can"]})]),g("a",null,G(B(f)("移出群聊")),1)],512),[[We,b.value.menuDisplay.remove]]),_e(g("div",{onClick:c[21]||(c[21]=E=>{var J;dn(),s.$refs.infoRef.openMoreConfig((J=A.value)==null?void 0:J.sender.user_id),et()})},[g("div",null,[ie(k,{icon:["fas","cog"]})]),g("a",null,G(B(f)("成员设置")),1)],512),[[We,b.value.menuDisplay.config]]),_e(g("div",{onClick:At},[g("div",null,[ie(k,{icon:["fas","arrow-up-right-from-square"]})]),g("a",null,G(B(f)("跳转到消息")),1)],512),[[We,b.value.menuDisplay.jumpToMsg]]),g("div",{onClick:zt},[g("div",null,[ie(k,{icon:["fas","screwdriver-wrench"]})]),g("a",null,G(B(f)("调试信息")),1)])],2)],2)])),ie(nn,{name:"chat-info-float",duration:{enter:300,leave:200}},{default:kt(()=>[ie(Qa,{ref:"infoRef",chat:n.chat,tags:b.value,onClose:dn},null,8,["chat","tags"])]),_:1}),ie(nn,null,{default:kt(()=>[b.value.showForwardPan?(W(),te("div",Cr,[g("div",Mr,[g("header",null,[g("span",null,G(B(f)("转发消息")),1),ie(k,{icon:["fas","xmark"],onClick:ft})]),g("label",Ar,G(B(f)("搜索转发对象")),1),g("input",{id:"chat-forward-search",placeholder:B(f)("搜索 ……"),onInput:cn},null,40,Tr),g("div",null,[(W(!0),te(ke,null,pt(Q.value,E=>(W(),te("div",{key:"forwardList-"+(E.user_id??E.group_id),onClick:J=>st(E)},[g("img",{loading:"lazy",title:Me(E),src:E.avatar||"/img/icons/icon.svg"},null,8,xr),g("div",null,[g("p",null,G(Me(E)),1),g("span",null,G(E.group_id?B(f)("群组"):B(f)("好友")),1)])],8,Er))),128))])]),g("div",{class:"bg",onClick:ft})])):fe("",!0)]),_:1}),g("div",{class:"bg",style:kn({"backdrop-filter":`blur(${B(t).sysConfig.chat_more_blur?0:B(t).sysConfig.chat_background_blur}px)`})},null,4)],38)),[[B(Co),we]])}}}),Dr=$n($r,[["__scopeId","data-v-861d73c5"]]);export{Dr as default};