most-box 0.1.2 → 0.1.4

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 (172) hide show
  1. package/README.md +18 -5
  2. package/electron/afterPack.cjs +87 -0
  3. package/electron/main.js +85 -1
  4. package/electron/updateChecker.js +97 -0
  5. package/electron/updateChecker.test.js +147 -0
  6. package/out/404/index.html +2 -2
  7. package/out/404.html +2 -2
  8. package/out/__next.__PAGE__.txt +5 -5
  9. package/out/__next._full.txt +13 -13
  10. package/out/__next._head.txt +3 -3
  11. package/out/__next._index.txt +6 -6
  12. package/out/__next._tree.txt +2 -2
  13. package/out/_next/static/chunks/02zzxfop_k6tl.css +1 -0
  14. package/out/_next/static/chunks/03gsbg0fr00ey.js +1 -0
  15. package/out/_next/static/chunks/06lttvu7563zo.css +1 -0
  16. package/out/_next/static/chunks/0fo9-h4knidcz.js +1 -0
  17. package/out/_next/static/chunks/0hyds~bp.auvh.js +1 -0
  18. package/out/_next/static/chunks/0i9sfdypwuw8~.js +1 -0
  19. package/out/_next/static/chunks/0olqjomda37-e.js +1 -0
  20. package/out/_next/static/chunks/{0aq.rc9woa2nz.js → 0puk.7e.tr2zy.js} +1 -1
  21. package/out/_next/static/chunks/0s1k6rlwy02c2.js +1 -0
  22. package/out/_next/static/chunks/0sgltmtk_9s8p.css +1 -0
  23. package/out/_next/static/chunks/0snehvtvu1n4q.js +1 -0
  24. package/out/_next/static/chunks/{16xls5tt_68lx.js → 0s~g.l~x049o2.js} +1 -1
  25. package/out/_next/static/chunks/{12nr19.nnn6s3.js → 0t_3xxx4zkerp.js} +2 -2
  26. package/out/_next/static/chunks/0u38kke9vhobe.js +1 -0
  27. package/out/_next/static/chunks/0vd4_a5x-wpdh.js +1 -0
  28. package/out/_next/static/chunks/0xx_10jns1.s7.css +1 -0
  29. package/out/_next/static/chunks/{0etes81d_cihn.js → 10f-t2n4y1zx8.js} +1 -1
  30. package/out/_next/static/chunks/{0l5_.uqb-uqb8.js → 13jdyag9a-~kk.js} +1 -1
  31. package/out/_next/static/chunks/{0q0ksgxg98xgd.js → 17cwkb2yn_akx.js} +1 -1
  32. package/out/_not-found/__next._full.txt +11 -11
  33. package/out/_not-found/__next._head.txt +3 -3
  34. package/out/_not-found/__next._index.txt +6 -6
  35. package/out/_not-found/__next._not-found.__PAGE__.txt +4 -4
  36. package/out/_not-found/__next._not-found.txt +3 -3
  37. package/out/_not-found/__next._tree.txt +1 -1
  38. package/out/_not-found/index.html +2 -2
  39. package/out/_not-found/index.txt +11 -11
  40. package/out/admin/__next._full.txt +12 -12
  41. package/out/admin/__next._head.txt +3 -3
  42. package/out/admin/__next._index.txt +6 -6
  43. package/out/admin/__next._tree.txt +1 -1
  44. package/out/admin/__next.admin.__PAGE__.txt +4 -4
  45. package/out/admin/__next.admin.txt +3 -3
  46. package/out/admin/index.html +2 -2
  47. package/out/admin/index.txt +12 -12
  48. package/out/app/__next._full.txt +12 -12
  49. package/out/app/__next._head.txt +3 -3
  50. package/out/app/__next._index.txt +6 -6
  51. package/out/app/__next._tree.txt +1 -1
  52. package/out/app/__next.app.__PAGE__.txt +4 -4
  53. package/out/app/__next.app.txt +3 -3
  54. package/out/app/index.html +2 -2
  55. package/out/app/index.txt +12 -12
  56. package/out/chat/__next._full.txt +12 -12
  57. package/out/chat/__next._head.txt +3 -3
  58. package/out/chat/__next._index.txt +6 -6
  59. package/out/chat/__next._tree.txt +1 -1
  60. package/out/chat/__next.chat.__PAGE__.txt +4 -4
  61. package/out/chat/__next.chat.txt +3 -3
  62. package/out/chat/index.html +2 -2
  63. package/out/chat/index.txt +12 -12
  64. package/out/chat/join/__next._full.txt +12 -12
  65. package/out/chat/join/__next._head.txt +3 -3
  66. package/out/chat/join/__next._index.txt +6 -6
  67. package/out/chat/join/__next._tree.txt +1 -1
  68. package/out/chat/join/__next.chat.join.__PAGE__.txt +4 -4
  69. package/out/chat/join/__next.chat.join.txt +3 -3
  70. package/out/chat/join/__next.chat.txt +3 -3
  71. package/out/chat/join/index.html +2 -2
  72. package/out/chat/join/index.txt +12 -12
  73. package/out/download/__next._full.txt +34 -30
  74. package/out/download/__next._head.txt +3 -3
  75. package/out/download/__next._index.txt +6 -6
  76. package/out/download/__next._tree.txt +2 -2
  77. package/out/download/__next.download.__PAGE__.txt +8 -13
  78. package/out/download/__next.download.txt +3 -3
  79. package/out/download/index.html +2 -2
  80. package/out/download/index.txt +34 -30
  81. package/out/favicon.ico +0 -0
  82. package/out/game/__next._full.txt +20 -0
  83. package/out/game/__next._head.txt +5 -0
  84. package/out/game/__next._index.txt +9 -0
  85. package/out/game/__next._tree.txt +5 -0
  86. package/out/game/__next.game.__PAGE__.txt +6 -0
  87. package/out/game/__next.game.txt +5 -0
  88. package/out/game/gandengyan/__next._full.txt +26 -0
  89. package/out/game/gandengyan/__next._head.txt +5 -0
  90. package/out/game/gandengyan/__next._index.txt +9 -0
  91. package/out/game/gandengyan/__next._tree.txt +6 -0
  92. package/out/game/gandengyan/__next.game.gandengyan.__PAGE__.txt +10 -0
  93. package/out/game/gandengyan/__next.game.gandengyan.txt +5 -0
  94. package/out/game/gandengyan/__next.game.txt +5 -0
  95. package/out/game/gandengyan/index.html +15 -0
  96. package/out/game/gandengyan/index.txt +26 -0
  97. package/out/game/index.html +1 -0
  98. package/out/game/index.txt +20 -0
  99. package/out/game/zhajinhua/__next._full.txt +25 -0
  100. package/out/game/zhajinhua/__next._head.txt +5 -0
  101. package/out/game/zhajinhua/__next._index.txt +9 -0
  102. package/out/game/zhajinhua/__next._tree.txt +5 -0
  103. package/out/game/zhajinhua/__next.game.txt +5 -0
  104. package/out/game/zhajinhua/__next.game.zhajinhua.__PAGE__.txt +9 -0
  105. package/out/game/zhajinhua/__next.game.zhajinhua.txt +5 -0
  106. package/out/game/zhajinhua/index.html +15 -0
  107. package/out/game/zhajinhua/index.txt +25 -0
  108. package/out/index.html +2 -2
  109. package/out/index.txt +13 -13
  110. package/out/note/__next._full.txt +12 -12
  111. package/out/note/__next._head.txt +3 -3
  112. package/out/note/__next._index.txt +6 -6
  113. package/out/note/__next._tree.txt +1 -1
  114. package/out/note/__next.note.__PAGE__.txt +4 -4
  115. package/out/note/__next.note.txt +3 -3
  116. package/out/note/index.html +2 -2
  117. package/out/note/index.txt +12 -12
  118. package/out/ping/__next._full.txt +12 -12
  119. package/out/ping/__next._head.txt +3 -3
  120. package/out/ping/__next._index.txt +6 -6
  121. package/out/ping/__next._tree.txt +1 -1
  122. package/out/ping/__next.ping.__PAGE__.txt +4 -4
  123. package/out/ping/__next.ping.txt +3 -3
  124. package/out/ping/index.html +2 -2
  125. package/out/ping/index.txt +12 -12
  126. package/out/web3/__next._full.txt +12 -12
  127. package/out/web3/__next._head.txt +3 -3
  128. package/out/web3/__next._index.txt +6 -6
  129. package/out/web3/__next._tree.txt +1 -1
  130. package/out/web3/__next.web3.__PAGE__.txt +4 -4
  131. package/out/web3/__next.web3.txt +3 -3
  132. package/out/web3/ed25519/__next._full.txt +10 -10
  133. package/out/web3/ed25519/__next._head.txt +3 -3
  134. package/out/web3/ed25519/__next._index.txt +6 -6
  135. package/out/web3/ed25519/__next._tree.txt +1 -1
  136. package/out/web3/ed25519/__next.web3.ed25519.__PAGE__.txt +2 -2
  137. package/out/web3/ed25519/__next.web3.ed25519.txt +3 -3
  138. package/out/web3/ed25519/__next.web3.txt +3 -3
  139. package/out/web3/ed25519/index.html +1 -1
  140. package/out/web3/ed25519/index.txt +10 -10
  141. package/out/web3/index.html +2 -2
  142. package/out/web3/index.txt +12 -12
  143. package/out/web3/tools/__next._full.txt +10 -10
  144. package/out/web3/tools/__next._head.txt +3 -3
  145. package/out/web3/tools/__next._index.txt +6 -6
  146. package/out/web3/tools/__next._tree.txt +1 -1
  147. package/out/web3/tools/__next.web3.tools.__PAGE__.txt +2 -2
  148. package/out/web3/tools/__next.web3.tools.txt +3 -3
  149. package/out/web3/tools/__next.web3.txt +3 -3
  150. package/out/web3/tools/index.html +1 -1
  151. package/out/web3/tools/index.txt +10 -10
  152. package/package.json +29 -29
  153. package/public/favicon.ico +0 -0
  154. package/server/src/config.js +1 -1
  155. package/server/src/core/gameRoom.js +222 -0
  156. package/server/src/core/zhajinhua.js +563 -0
  157. package/server/src/games/gandengyan.js +612 -0
  158. package/server/src/http/access.js +4 -0
  159. package/server/src/http/app.js +14 -1
  160. package/server/src/index.js +9 -1
  161. package/server/src/utils/api.js +19 -1
  162. package/out/_next/static/chunks/0.e2avjgna_b2.js +0 -1
  163. package/out/_next/static/chunks/03h~nhgj0hv3p.css +0 -1
  164. package/out/_next/static/chunks/07td.jq7xff84.css +0 -1
  165. package/out/_next/static/chunks/0gwian.hp3-92.js +0 -1
  166. package/out/_next/static/chunks/0mex8svsiv-2l.js +0 -1
  167. package/out/_next/static/chunks/0myq9gs8szydh.js +0 -1
  168. package/out/_next/static/chunks/0p0sv~fuddvgr.js +0 -1
  169. package/out/_next/static/chunks/0wtf0xsiicxx6.js +0 -1
  170. /package/out/_next/static/{t7ZIeQpVvjz4a7-5Tt-VK → sSvbBrwXZY-4lBmcHshga}/_buildManifest.js +0 -0
  171. /package/out/_next/static/{t7ZIeQpVvjz4a7-5Tt-VK → sSvbBrwXZY-4lBmcHshga}/_clientMiddlewareManifest.js +0 -0
  172. /package/out/_next/static/{t7ZIeQpVvjz4a7-5Tt-VK → sSvbBrwXZY-4lBmcHshga}/_ssgManifest.js +0 -0
@@ -83,6 +83,23 @@ function normalizePath(path) {
83
83
  return path.startsWith('/') ? path : `/${path}`
84
84
  }
85
85
 
86
+ function getBackendAuthPath(url) {
87
+ const requestPath = normalizeAuthPath(url)
88
+ const backendUrl = getBackendUrl()
89
+ if (!backendUrl) return requestPath
90
+
91
+ try {
92
+ const basePath = new URL(backendUrl).pathname.replace(/\/+$/, '')
93
+ if (!basePath || basePath === '/') return requestPath
94
+ if (requestPath === basePath) return '/'
95
+ if (requestPath.startsWith(`${basePath}/`)) {
96
+ return requestPath.slice(basePath.length)
97
+ }
98
+ } catch {}
99
+
100
+ return requestPath
101
+ }
102
+
86
103
  function buildWebSocketUrl(base, wsPath = '/ws') {
87
104
  const url = new URL(base)
88
105
  const wsProtocol = url.protocol === 'https:' ? 'wss:' : 'ws:'
@@ -107,7 +124,7 @@ function createApiInstance() {
107
124
  const authHeaders = await buildAuthHeaders(
108
125
  identity,
109
126
  request.method,
110
- normalizeAuthPath(request.url)
127
+ getBackendAuthPath(request.url)
111
128
  )
112
129
  for (const [key, value] of Object.entries(authHeaders)) {
113
130
  headers.set(key, value)
@@ -325,6 +342,7 @@ async function probeHttp(cleanedUrl, invite, identity) {
325
342
 
326
343
  async function probeWebSocket(cleanedUrl, invite, identity) {
327
344
  if (typeof WebSocket === 'undefined') return { ok: true }
345
+ if (!identity?.danger) return { ok: true }
328
346
 
329
347
  try {
330
348
  const wsUrl = new URL(buildWebSocketUrl(cleanedUrl))
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,96661,e=>{"use strict";e.s(["mergeClasses",0,(...e)=>e.filter((e,t,r)=>!!e&&""!==e.trim()&&r.indexOf(e)===t).join(" ").trim()])},71987,88973,e=>{"use strict";e.s(["default",0,{xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}],71987),e.s(["hasA11yProp",0,e=>{for(let t in e)if(t.startsWith("aria-")||"role"===t||"title"===t)return!0;return!1}],88973)},5014,e=>{"use strict";var t=e.i(71645),r=e.i(71987),l=e.i(88973),i=e.i(96661);let a=(0,t.createContext)({}),n=(0,t.forwardRef)(({color:e,size:n,strokeWidth:o,absoluteStrokeWidth:s,className:c="",children:d,iconNode:u,...h},f)=>{let{size:m=24,strokeWidth:g=2,absoluteStrokeWidth:p=!1,color:y="currentColor",className:w=""}=(0,t.useContext)(a)??{},v=s??p?24*Number(o??g)/Number(n??m):o??g;return(0,t.createElement)("svg",{ref:f,...r.default,width:n??m??r.default.width,height:n??m??r.default.height,stroke:e??y,strokeWidth:v,className:(0,i.mergeClasses)("lucide",w,c),...!d&&!(0,l.hasA11yProp)(h)&&{"aria-hidden":"true"},...h},[...u.map(([e,r])=>(0,t.createElement)(e,r)),...Array.isArray(d)?d:[d]])});e.s(["default",0,n],5014)},56420,e=>{"use strict";var t=e.i(71645),r=e.i(96661);let l=e=>{let t=e.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,r)=>r?r.toUpperCase():t.toLowerCase());return t.charAt(0).toUpperCase()+t.slice(1)};var i=e.i(5014);e.s(["default",0,(e,a)=>{let n=(0,t.forwardRef)(({className:n,...o},s)=>(0,t.createElement)(i.default,{ref:s,iconNode:a,className:(0,r.mergeClasses)(`lucide-${l(e).replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`,`lucide-${e}`,n),...o}));return n.displayName=l(e),n}],56420)},62368,e=>{"use strict";let t=(0,e.i(56420).default)("download",[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]]);e.s(["Download",0,t],62368)},71192,e=>{"use strict";var t=e.i(68834),r=e.i(128);function l(e,t){let{address:l,danger:i}=(0,r.mostWallet)(e,t);return{username:e,address:l,danger:i,displayName:`${e}#${l.slice(-4).toUpperCase()}`}}function i(e){"u">typeof localStorage&&localStorage.setItem("mostbox_identity",JSON.stringify(e))}function a(){"u">typeof localStorage&&(localStorage.removeItem("mostbox_identity"),localStorage.removeItem("mostbox_guest_identity"))}function n(e){return e&&"object"==typeof e&&e.username&&e.address&&e.danger&&"匿名"!==e.username?{username:e.username,address:e.address,danger:e.danger,displayName:e.displayName?e.displayName:`${e.username}#${e.address.slice(-4).toUpperCase()}`}:null}function o(){return{loginUsername:"",loginPassword:"",showPassword:!1,loginPreviewAddress:"",hasPreviewedAvatar:!1,loginLoading:!1,loginError:""}}let s=(0,t.create)((e,t)=>({identity:null,wallet:void 0,showLoginModal:!1,loginUsername:"",loginPassword:"",showPassword:!1,loginPreviewAddress:"",hasPreviewedAvatar:!1,loginLoading:!1,loginError:"",initializeUser:()=>{let t=n(function(){if("u"<typeof localStorage)return null;try{let e=localStorage.getItem("mostbox_identity");if(!e)return null;return JSON.parse(e)}catch{return null}}());t||a(),e({identity:t,wallet:t||void 0})},openLoginModal:()=>{e({showLoginModal:!0,loginError:""})},closeLoginModal:()=>{e({showLoginModal:!1,...o()})},setLoginUsername:t=>{e({loginUsername:t,loginPreviewAddress:"",hasPreviewedAvatar:!1,loginError:""})},setLoginPassword:t=>{e({loginPassword:t,loginPreviewAddress:"",hasPreviewedAvatar:!1,loginError:""})},togglePassword:()=>{e(e=>({showPassword:!e.showPassword}))},previewLoginIdentity:()=>{let{loginUsername:r,loginPassword:i}=t();if(!r.trim()||!i.trim())return e({loginError:"请输入用户名和密码"}),null;let a=l(r.trim(),i);return e({loginPreviewAddress:a.address,hasPreviewedAvatar:!0,loginError:""}),a},loginUser:()=>{let{loginUsername:r,loginPassword:a,hasPreviewedAvatar:n}=t();if(!r.trim()||!a.trim())return e({loginError:"请输入用户名和密码"}),null;if(!n)return e({loginError:"请先预览并确认头像"}),null;e({loginLoading:!0,loginError:""});try{let t=l(r.trim(),a);return i(t),e({identity:t,wallet:t,showLoginModal:!1,...o()}),t}catch(t){return e({loginLoading:!1,loginError:t instanceof Error?t.message:"登录失败"}),null}},setUserIdentity:t=>{let r=n(t);r&&(i(r),e({identity:r,wallet:r}))},logoutUser:()=>{a(),e({identity:null,wallet:void 0})}}));e.s(["useUserStore",0,s],71192)},67228,7881,49401,5142,40924,81317,8382,11239,e=>{"use strict";var t=e.i(71645);function r(e,r,l){let i=(0,t.useEffectEvent)(r);(0,t.useEffect)(()=>(window.addEventListener(e,i,l),()=>window.removeEventListener(e,i,l)),[e])}e.s(["useMediaQuery",0,function(e,r,{getInitialValueInEffect:l}={getInitialValueInEffect:!0}){let[i,a]=(0,t.useState)(l?r:!!("u">typeof window&&"matchMedia"in window)&&window.matchMedia(e).matches);return(0,t.useEffect)(()=>{try{if("matchMedia"in window){let t=window.matchMedia(e);a(t.matches);let r=e=>a(e.matches);return t.addEventListener("change",r),()=>{t.removeEventListener("change",r)}}}catch(e){return}},[e]),i||!1}],67228),e.s(["useWindowEvent",0,r],7881);let l={passive:!0};function i(e){try{return e&&JSON.parse(e)}catch{return e}}function a(e){return{getItem:t=>{try{return window[e].getItem(t)}catch(e){return console.warn("use-local-storage: Failed to get value from storage, localStorage is blocked"),null}},setItem:(t,r)=>{try{window[e].setItem(t,r)}catch(e){console.warn("use-local-storage: Failed to set value to storage, localStorage is blocked")}},removeItem:t=>{try{window[e].removeItem(t)}catch(e){console.warn("use-local-storage: Failed to remove value from storage, localStorage is blocked")}}}}e.s(["useViewportSize",0,function(){let[e,i]=(0,t.useState)({width:0,height:0}),a=(0,t.useCallback)(()=>{i({width:window.innerWidth||0,height:window.innerHeight||0})},[]);return r("resize",a,l),r("orientationchange",a,l),(0,t.useEffect)(a,[]),e}],49401),e.s(["useDisclosure",0,function(e=!1,r={}){let[l,i]=(0,t.useState)(e),a=(0,t.useCallback)(()=>{i(e=>e||(r.onOpen?.(),!0))},[r.onOpen]),n=(0,t.useCallback)(()=>{i(e=>e?(r.onClose?.(),!1):e)},[r.onClose]);return[l,{open:a,close:n,toggle:(0,t.useCallback)(()=>{l?n():a()},[n,a,l]),set:i}]}],5142),!function(e){let{getItem:t}=a(e)}("localStorage"),e.s(["useLocalStorage",0,function(e){return(function(e,l){let n="localStorage"===e?"mantine-local-storage":"mantine-session-storage",{getItem:o,setItem:s,removeItem:c}=a(e);return function({key:a,defaultValue:d,getInitialValueInEffect:u=!0,sync:h=!0,deserialize:f=i,serialize:m=e=>(function(e,t="use-local-storage"){try{return JSON.stringify(e)}catch(e){throw Error(`@mantine/hooks ${t}: Failed to serialize the value`)}})(e,l)}){let g=(0,t.useCallback)(t=>{let r;try{r="u"<typeof window||!(e in window)||null===window[e]||!!t}catch(e){r=!0}if(r)return d;let l=o(a);return null!==l?f(l):d},[a,d]),[p,y]=(0,t.useState)(g(u)),w=(0,t.useCallback)(e=>{e instanceof Function?y(t=>{let r=e(t);return s(a,m(r)),queueMicrotask(()=>{window.dispatchEvent(new CustomEvent(n,{detail:{key:a,value:r}}))}),r}):(s(a,m(e)),window.dispatchEvent(new CustomEvent(n,{detail:{key:a,value:e}})),y(e))},[a]),v=(0,t.useCallback)(()=>{c(a),y(d),window.dispatchEvent(new CustomEvent(n,{detail:{key:a,value:d}}))},[a,d]);return r("storage",t=>{h&&t.storageArea===window[e]&&t.key===a&&y(f(t.newValue??void 0))}),r(n,e=>{h&&e.detail.key===a&&y(e.detail.value)}),(0,t.useEffect)(()=>{void 0!==d&&void 0===p&&w(d)},[d,p,w]),(0,t.useEffect)(()=>{let e=g();void 0!==e&&w(e)},[a]),[void 0===p?d:p,w,v]}})("localStorage","use-local-storage")(e)}],40924),e.s(["useClipboard",0,function(e={}){let r=e.timeout??2e3,[l,i]=(0,t.useState)(null),[a,n]=(0,t.useState)(!1),o=(0,t.useRef)(null);return(0,t.useEffect)(()=>()=>{window.clearTimeout(o.current)},[]),{copy:e=>{"clipboard"in navigator?navigator.clipboard.writeText(e).then(()=>{i(null),window.clearTimeout(o.current),o.current=window.setTimeout(()=>n(!1),r),n(!0)}).catch(e=>i(e)):i(Error("useClipboard: navigator.clipboard is not supported"))},reset:()=>{n(!1),i(null),window.clearTimeout(o.current)},error:l,copied:a}}],81317);let n={" ":"space",ArrowLeft:"arrowleft",ArrowRight:"arrowright",ArrowUp:"arrowup",ArrowDown:"arrowdown",Escape:"escape",Esc:"escape",esc:"escape",Enter:"enter",Tab:"tab",Backspace:"backspace",Delete:"delete",Insert:"insert",Home:"home",End:"end",PageUp:"pageup",PageDown:"pagedown","+":"plus","-":"minus","*":"asterisk","/":"slash"};function o(e){let t=e.replace("Key","").toLowerCase();return n[e]||t}e.s(["useHotkeys",0,function(e,r=["INPUT","TEXTAREA","SELECT"],l=!1){let i=(0,t.useEffectEvent)(t=>{e.forEach(([e,i,a={preventDefault:!0,usePhysicalKeys:!1}])=>{var n;(n=a.usePhysicalKeys,t=>{let r,l,i,a;return function(e,t,r){let{alt:l,ctrl:i,meta:a,mod:n,shift:s,key:c}=e,{altKey:d,ctrlKey:u,metaKey:h,shiftKey:f,key:m,code:g}=t;if(l!==d)return!1;if(n){if(!u&&!h)return!1}else if(i!==u||a!==h)return!1;return s===f&&!!c&&(r?o(g)===o(c):o(m??g)===o(c))}((l={alt:(r=e.toLowerCase().split("+").map(e=>e.trim())).includes("alt"),ctrl:r.includes("ctrl"),meta:r.includes("meta"),mod:r.includes("mod"),shift:r.includes("shift")},i=["alt","ctrl","meta","shift","mod"],a=r.find(e=>!i.includes(e)),{...l,key:"[plus]"===a?"+":a}),t,n)})(t)&&function(e,t,r=!1){return!(e.target instanceof HTMLElement)||(r?!t.includes(e.target.tagName):!e.target.isContentEditable&&!t.includes(e.target.tagName))}(t,r,l)&&(a.preventDefault&&t.preventDefault(),i(t))})});(0,t.useEffect)(()=>(document.documentElement.addEventListener("keydown",i),()=>document.documentElement.removeEventListener("keydown",i)),[])}],8382),e.s(["useToggle",0,function(e=[!1,!0]){let[[r],l]=(0,t.useReducer)((e,t)=>{let r=t instanceof Function?t(e[0]):t,l=Math.abs(e.indexOf(r));return e.slice(l).concat(e.slice(0,l))},e);return[r,l]}],11239)},22183,e=>{"use strict";e.i(67228),e.i(49401),e.i(5142),e.i(40924),e.i(81317),e.i(8382),e.i(11239),e.i(7881),e.i(71645),e.i(3593),e.i(71192),e.s([],22183)},93957,e=>{"use strict";function t(e){return e.replace(/&/g,"&amp;").replace(/'/g,"&apos;").replace(/"/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function r(e){return e^=e<<13,e^=e>>17,e^=e<<5}function l(e=""){let t=function(e){let t=0;for(let l=0;l<e.length;l++)t=r(t=(t<<5)-t+e.charCodeAt(l)|0);return t}(e=e.toString().slice(0,1024))||1,i=()=>t=r(t),a=(e,t)=>Math.floor((i()- -0x80000000)/0xffffffff*(t+1-e)+e);return{seed:e,next:i,bool:(e=50)=>a(1,100)<=e,integer:(e,t)=>a(e,t),pick(e,t){var r;return 0===e.length?(i(),t):null!=(r=e[a(0,e.length-1)])?r:t},shuffle(e){let t=l(i().toString()),r=[...e];for(let e=r.length-1;e>0;e--){let l=t.integer(0,e);[r[e],r[l]]=[r[l],r[e]]}return r},string(e,t="abcdefghijklmnopqrstuvwxyz1234567890"){let r=l(i().toString()),a="";for(let l=0;l<e;l++)a+=t[r.integer(0,t.length-1)];return a}}}function i(e){let t=e.attributes.viewBox.split(" "),r=parseInt(t[0]),l=parseInt(t[1]);return{x:r,y:l,width:parseInt(t[2]),height:parseInt(t[3])}}let a={type:"object",$schema:"http://json-schema.org/draft-07/schema#",properties:{seed:{type:"string"},flip:{type:"boolean",default:!1},rotate:{type:"integer",minimum:0,maximum:360,default:0},scale:{type:"integer",minimum:0,maximum:200,default:100},radius:{type:"integer",minimum:0,maximum:50,default:0},size:{type:"integer",minimum:1},backgroundColor:{type:"array",items:{type:"string",pattern:"^(transparent|[a-fA-F0-9]{6})$"}},backgroundType:{type:"array",items:{type:"string",enum:["solid","gradientLinear"]},default:["solid"]},backgroundRotation:{type:"array",items:{type:"integer",minimum:-360,maximum:360},default:[0,360]},translateX:{type:"integer",minimum:-100,maximum:100,default:0},translateY:{type:"integer",minimum:-100,maximum:100,default:0},clip:{type:"boolean",default:!0},randomizeIds:{type:"boolean",default:!1}}};function n(e){var t;let r={},l=null!=(t=e.properties)?t:{};return Object.keys(l).forEach(e=>{let t=l[e];"object"==typeof t&&void 0!==t.default&&(Array.isArray(t.default)?r[e]=[...t.default]:"object"==typeof t.default?r[e]={...t.default}:r[e]=t.default)}),r}function o(e){return"transparent"===e?e:`#${e}`}e.s([],95706),e.i(95706),e.s(["eyes",0,{bulging:(e,t)=>'<circle cx="28" cy="24" r="18" fill="#000" fill-opacity=".2"/><circle cx="74" cy="24" r="18" fill="#000" fill-opacity=".2"/><circle cx="28" cy="24" r="15" fill="#F1EEDA"/><circle cx="74" cy="24" r="15" fill="#F1EEDA"/><rect x="26" y="15" width="10" height="10" rx="2" fill="#000" fill-opacity=".8"/><rect x="74" y="15" width="10" height="10" rx="2" fill="#000" fill-opacity=".8"/>',dizzy:(e,t)=>'<path d="m25 27.2 5.5 5.5c.5.4 1.2.4 1.6 0l1.6-1.6c.4-.5.4-1.2 0-1.6L28.2 24l5.5-5.5c.4-.5.4-1.2 0-1.6l-1.6-1.6c-.5-.4-1.2-.4-1.6 0L25 20.8l-5.5-5.5c-.5-.4-1.2-.4-1.6 0l-1.6 1.6c-.4.4-.4 1.1 0 1.6l5.5 5.5-5.5 5.5c-.4.5-.4 1.2 0 1.6l1.6 1.6c.5.4 1.2.4 1.6 0l5.5-5.5ZM79 27.2l5.5 5.5c.5.4 1.2.4 1.6 0l1.6-1.6c.4-.5.4-1.2 0-1.6L82.2 24l5.5-5.5c.4-.5.4-1.2 0-1.6l-1.6-1.6c-.5-.4-1.2-.4-1.6 0L79 20.8l-5.5-5.5c-.5-.4-1.2-.4-1.6 0l-1.6 1.6c-.4.4-.4 1.1 0 1.6l5.5 5.5-5.5 5.5c-.4.5-.4 1.2 0 1.6l1.6 1.6c.5.4 1.2.4 1.6 0l5.5-5.5Z" fill="#000" fill-opacity=".8"/>',eva:(e,t)=>'<g fill-rule="evenodd" clip-rule="evenodd"><path d="M53 0c34.75 0 49 17.47 49 31 0 13.53-19.59 17-49 17-29.05 0-51-3.47-51-17S17.11 0 53 0Z" fill="#000" fill-opacity=".8"/><path d="M28.82 34.65c-6.53-1.35-11.24-6.34-10.52-11.14.72-4.79 6.6-7.58 13.12-6.23 6.53 1.36 11.24 6.35 10.52 11.15-.72 4.8-6.6 7.59-13.12 6.23ZM75.42 34.65c-6.52 1.36-12.4-1.43-13.12-6.23-.72-4.8 4-9.8 10.52-11.15 6.52-1.35 12.4 1.44 13.12 6.24.72 4.81-4 9.8-10.52 11.15Z" fill="#25A6F5"/></g>',frame1:(e,t)=>'<rect y="4" width="104" height="42" rx="4" fill="#000" fill-opacity=".8"/><rect x="28" y="25" width="10" height="11" rx="2" fill="#8BDDFF"/><rect x="66" y="25" width="10" height="11" rx="2" fill="#8BDDFF"/><path fill-rule="evenodd" clip-rule="evenodd" d="M21 4h8L12 46H4L21 4Z" fill="#fff" fill-opacity=".4"/>',frame2:(e,t)=>'<rect x="8" y="10" width="88" height="36" rx="4" fill="#000" fill-opacity=".8"/><rect x="28" y="21" width="10" height="17" rx="2" fill="#5EF2B8"/><rect x="66" y="21" width="10" height="17" rx="2" fill="#5EF2B8"/><path fill-rule="evenodd" clip-rule="evenodd" d="M83 10h5L76 46h-5l12-36Z" fill="#fff" fill-opacity=".4"/>',glow:(e,t)=>'<g fill="#fff"><circle cx="21" cy="30" r="15" fill-opacity=".1"/><circle cx="83" cy="30" r="15" fill-opacity=".1"/><circle cx="21" cy="30" r="12" fill-opacity=".1"/><circle cx="83" cy="30" r="12" fill-opacity=".1"/><circle cx="21" cy="30" r="6" fill-opacity=".8"/><circle cx="83" cy="30" r="6" fill-opacity=".8"/><circle cx="21" cy="30" r="3" fill-opacity=".8"/><circle cx="83" cy="30" r="3" fill-opacity=".8"/></g>',happy:(e,t)=>'<path d="m18 19 12-2M20 31c0-3.31 2.9-6 7-6 3.1 0 6 2.69 6 6M86 20l-12-3M84 31c0-3.31-2.9-6-6-6-4.1 0-7 2.69-7 6" stroke="#000" stroke-width="4" stroke-linecap="round" stroke-linejoin="round"/>',hearts:(e,t)=>'<path d="M29.27 9.68c-2.55.13-4.96 2.24-6.25 4.15-1.48-1.76-4.1-3.6-6.65-3.47-5.48.28-8.85 3.8-8.63 8.1.3 5.72 4.88 8.89 9.7 12.24 1.71 1.15 5 4.15 5.42 4.82.42.67 2.14.6 2.58-.13a37.8 37.8 0 0 1 4.9-5.36c4.43-3.84 8.66-7.47 8.36-13.2-.23-4.3-3.95-7.44-9.43-7.15ZM87.63 10.36c-2.55-.14-5.17 1.7-6.65 3.47-1.3-1.9-3.7-4.02-6.25-4.15-5.48-.29-9.2 2.86-9.43 7.16-.3 5.72 3.93 9.35 8.36 13.19 1.6 1.32 4.55 4.64 4.9 5.36.35.7 2.06.82 2.58.13.51-.7 3.7-3.67 5.42-4.82 4.81-3.35 9.4-6.52 9.7-12.24.22-4.3-3.15-7.82-8.63-8.1Z" fill="#FF5353" fill-opacity=".8"/>',robocop:(e,t)=>'<rect x="7" y="16" width="91" height="16" rx="4" fill="#000" fill-opacity=".8"/><mask id="eyesRobocop-a" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="7" y="16" width="91" height="16"><rect x="7" y="16" width="91" height="16" rx="4" fill="#fff"/></mask><g mask="url(#eyesRobocop-a)" fill-rule="evenodd" clip-rule="evenodd" fill="#fff" fill-opacity=".8"><path d="M76 7h18L82 37H64L76 7ZM52 7h9L49 37h-9L52 7Z"/></g>',round:(e,t)=>'<g fill="#fff"><circle cx="24" cy="30" r="6"/><circle cx="80" cy="30" r="6"/></g>',roundFrame01:(e,t)=>'<rect y="12" width="104" height="32" rx="16" fill="#000" fill-opacity=".8"/><rect x="24" y="22" width="10" height="12" rx="2" fill="#F4F4F4"/><rect x="70" y="22" width="10" height="12" rx="2" fill="#F4F4F4"/>',roundFrame02:(e,t)=>'<rect y="11" width="104" height="34" rx="17" fill="#000" fill-opacity=".8"/><circle cx="29" cy="28" r="13" fill="#F1EEDA"/><circle cx="75" cy="28" r="13" fill="#F1EEDA"/><rect x="24" y="23" width="10" height="10" rx="2" fill="#000" fill-opacity=".8"/><rect x="70" y="23" width="10" height="10" rx="2" fill="#000" fill-opacity=".8"/>',sensor:(e,t)=>'<path d="M28 44a20 20 0 0 0 19.9-18h41.52a5 5 0 1 0 0-4H47.9A20 20 0 1 0 28 44Z" fill="#000" fill-opacity=".2"/><circle cx="94" cy="24" r="2" fill="#fff"/><circle cx="28" cy="24" r="16" fill="#000" fill-opacity=".6"/><circle cx="34" cy="16" r="3" fill="#fff"/>',shade01:(e,t)=>'<path d="M96 2H8c-4.5 0-8 3.5-8 8.03V28c0 4.5 3.5 8 8 8h13c8 0 11 8 18 8h27c7 0 9-8 17-8h13c4.5 0 8-3.5 8-8V10c0-4.5-3.5-8-8-8Z" fill="#000" fill-opacity=".8"/><path d="M87 14H17c-3.5 0-5 3-5 5v2c0 2 1.5 5 5 5h12c6 0 11.62 8 17 8h14c5.38 0 9-8 15-8h12c3.5 0 5-3 5-5v-2c0-2-1.5-5-5-5Z" fill="#FF3D3D"/><path d="M22.44 36.09 37.26 2h11L31.4 40.78l-.76-.58c-2.38-1.82-4.83-3.69-8.2-4.11ZM11.48 36 26.26 2h4L15.48 36h-4Z" fill="#fff" fill-opacity=".2"/>'},"mouth",0,{bite:(e,t)=>'<rect x="4" y="5" width="68" height="22" rx="5" fill="#000" fill-opacity=".2"/><rect x="8" y="9" width="60" height="14" rx="2" fill="#000" fill-opacity=".6"/><path fill-rule="evenodd" clip-rule="evenodd" d="m20 17 6-8H14l6 8ZM32 17l6-8H26l6 8ZM44 17l6-8H38l6 8ZM56 17l6-8H50l6 8Z" fill="#E1E6E8"/>',diagram:(e,t)=>'<rect x="4" y="4" width="68" height="24" rx="5" fill="#000" fill-opacity=".2"/><rect x="8" y="8" width="60" height="16" rx="2" fill="#000" fill-opacity=".8"/><path d="M9 17h11l2-4 3 7 4-8 2 9 3-11 3 10 3-3h15l3-4 2 7 3-3h4" stroke="#4EFAC9" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>',grill01:(e,t)=>'<g fill="#000" fill-opacity=".6"><rect x="12" y="12" width="4" height="8" rx="2"/><rect x="36" y="12" width="4" height="8" rx="2"/><rect x="24" y="12" width="4" height="8" rx="2"/><rect x="48" y="12" width="4" height="8" rx="2"/><rect x="60" y="12" width="4" height="8" rx="2"/></g>',grill02:(e,t)=>'<g fill="#000" fill-opacity=".6"><rect x="28" y="10" width="6" height="14" rx="2"/><rect x="14" y="10" width="6" height="14" rx="2"/><rect x="42" y="10" width="6" height="14" rx="2"/><rect x="56" y="10" width="6" height="14" rx="2"/></g>',grill03:(e,t)=>'<rect x="4" y="5" width="68" height="22" rx="5" fill="#000" fill-opacity=".2"/><rect x="8" y="9" width="60" height="14" rx="2" fill="#fff"/><path fill="#000" fill-opacity=".1" d="M18 9h4v14h-4zM42 9h4v14h-4zM30 9h4v14h-4zM54 9h4v14h-4z"/>',smile01:(e,t)=>'<path d="M27.05 8.44a2 2 0 1 1 3.9-.88C31.72 10.96 34.4 13 38 13c3.6 0 6.28-2.04 7.05-5.44a2 2 0 1 1 3.9.88C47.75 13.7 43.43 17 38 17s-9.76-3.3-10.95-8.56Z" fill="#000" fill-opacity=".6"/>',smile02:(e,t)=>'<path fill-rule="evenodd" clip-rule="evenodd" d="M18 10.22C18 21.78 24.47 28 38 28c13.52 0 20-6.34 20-17.78C58 9.5 57.17 8 55 8H21c-2.05 0-3 1.38-3 2.22Z" fill="#000" fill-opacity=".8"/><mask id="mouthSmile02-a" style="mask-type:luminance" maskUnits="userSpaceOnUse" x="18" y="8" width="40" height="20"><path fill-rule="evenodd" clip-rule="evenodd" d="M18 10.22C18 21.78 24.47 28 38 28c13.52 0 20-6.34 20-17.78C58 9.5 57.17 8 55 8H21c-2.05 0-3 1.38-3 2.22Z" fill="#fff"/></mask><g mask="url(#mouthSmile02-a)"><rect x="30" y="2" width="16" height="14" rx="2" fill="#fff"/></g>',square01:(e,t)=>'<rect x="24" y="6" width="27" height="8" rx="4" fill="#000" fill-opacity=".8"/>',square02:(e,t)=>'<rect x="16" y="8" width="44" height="4" rx="2" fill="#000" fill-opacity=".8"/>'}],23855);var s=e.i(23855);function c({prng:e,group:t,values:r=[]}){let l=e.pick(r);return l&&s[t][l]?{name:l,value:s[t][l]}:void 0}let d={title:"Bottts",creator:"Pablo Stanley",source:"https://bottts.com/",homepage:"https://twitter.com/pablostanley",license:{name:"Free for personal and commercial use",url:"https://bottts.com/"}},u=({prng:e,options:t})=>{var r,l,i,a;let n=function({prng:e,options:t}){return{mouth:c({prng:e,group:"mouth",values:t.mouth}),eyes:c({prng:e,group:"eyes",values:t.eyes})}}({prng:e,options:t}),o=function({prng:e,options:t}){return{}}({prng:e,options:t});return{attributes:{viewBox:"0 0 120 120",fill:"none","shape-rendering":"auto"},body:`<g transform="translate(22 68)">${null!=(l=null==(r=n.mouth)?void 0:r.value(n,o))?l:""}</g><g transform="translate(8 20)">${null!=(a=null==(i=n.eyes)?void 0:i.value(n,o))?a:""}</g>`,extra:()=>({...Object.entries(n).reduce((e,[t,r])=>(e[t]=null==r?void 0:r.name,e),{}),...Object.entries(o).reduce((e,[t,r])=>(e[`${t}Color`]=r,e),{})})}};e.s(["create",0,u,"meta",0,d],17022),e.i(17022),e.s(["create",0,u,"meta",0,d,"schema",0,{$schema:"http://json-schema.org/draft-07/schema#",properties:{backgroundColor:{type:"array",items:{type:"string",pattern:"^(transparent|[a-fA-F0-9]{6})$"},default:["ffb300","1e88e5","546e7a","6d4c41","00acc1","f4511e","5e35b1","43a047","757575","3949ab","039be5","7cb342","c0ca33","fb8c00","d81b60","8e24aa","e53935","00897b","fdd835"]},eyes:{type:"array",items:{type:"string",enum:["bulging","dizzy","eva","frame1","frame2","glow","happy","hearts","robocop","round","roundFrame01","roundFrame02","sensor","shade01"]},default:["bulging","dizzy","eva","frame1","frame2","glow","happy","hearts","robocop","round","roundFrame01","roundFrame02","sensor","shade01"]},mouth:{type:"array",items:{type:"string",enum:["bite","diagram","grill01","grill02","grill03","smile01","smile02","square01","square02"]},default:["bite","diagram","grill01","grill02","grill03","smile01","smile02","square01","square02"]}}}],13161);var h=e.i(13161),h=h;e.s(["generateAvatar",0,function(e){return e?(function(e,r={}){var s,c,d,u,h,f,m,g,p,y,w,v,x,b,k,E,$,M,C,L,S,j,F,A,N,P,z,U,D,I,T,Z,O,R;let H,B,q,W,X,_,J,V,K,Y,G,Q,ee,et,er,el,ei;f=r;let ea=l((r=JSON.parse(JSON.stringify({...n(a),...n(null!=(m=e.schema)?m:{}),...f}))).seed),en=e.create({prng:ea,options:r}),eo=ea.pick(null!=(s=r.backgroundType)?s:[],"solid"),{primary:es,secondary:ec}=(g=null!=(c=r.backgroundColor)?c:[],(H=ea.shuffle(g)).length<=1||2==g.length&&"gradientLinear"==eo?(H=g,ea.next()):H=ea.shuffle(g),0===H.length&&(H=["transparent"]),B=H[0],q=null!=(p=H[1])?p:H[0],{primary:o(B),secondary:o(q)}),ed=ea.integer((null==(d=r.backgroundRotation)?void 0:d.length)?Math.min(...r.backgroundRotation):0,(null==(u=r.backgroundRotation)?void 0:u.length)?Math.max(...r.backgroundRotation):0);r.size&&(en.attributes.width=r.size.toString(),en.attributes.height=r.size.toString()),void 0!==r.scale&&100!==r.scale&&(en.body=function(e,t){let{width:r,height:l,x:a,y:n}=i(e),o=t?(t-100)/100:0;return`<g transform="translate(${-((r/2+a)*o*1)} ${-((l/2+n)*o*1)}) scale(${t/100})">${e.body}</g>`}(en,r.scale)),r.flip&&(en.body=function(e){let{width:t,x:r}=i(e);return`<g transform="scale(-1 1) translate(${-1*t-2*r} 0)">${e.body}</g>`}(en)),r.rotate&&(en.body=function(e,t){let{width:r,height:l,x:a,y:n}=i(e);return`<g transform="rotate(${t}, ${r/2+a}, ${l/2+n})">${e.body}</g>`}(en,r.rotate)),(r.translateX||r.translateY)&&(y=r.translateX,w=r.translateY,X=((W=i(en)).width+2*W.x)*((null!=y?y:0)/100),_=(W.height+2*W.y)*((null!=w?w:0)/100),en.body=`<g transform="translate(${X} ${_})">${en.body}</g>`),"transparent"!==es&&"transparent"!==ec&&(en.body=function(e,r,l,a,n){let{width:o,height:s,x:c,y:d}=i(e),u=`<rect fill="${t(r)}" width="${o}" height="${s}" x="${c}" y="${d}" />`;switch(a){case"solid":return u+e.body;case"gradientLinear":return`<rect fill="url(#backgroundLinear)" width="${o}" height="${s}" x="${c}" y="${d}" /><defs><linearGradient id="backgroundLinear" gradientTransform="rotate(${n} 0.5 0.5)"><stop stop-color="${t(r)}"/><stop offset="1" stop-color="${t(l)}"/></linearGradient></defs>`+e.body}}(en,es,ec,eo,ed)),(r.radius||r.clip)&&(en.body=function(e,t){let{width:r,height:l,x:a,y:n}=i(e);return`<mask id="viewboxMask"><rect width="${r}" height="${l}" rx="${t?r*t/100:0}" ry="${t?l*t/100:0}" x="${a}" y="${n}" fill="#fff" /></mask><g mask="url(#viewboxMask)">${e.body}</g>`}(en,null!=(h=r.radius)?h:0)),r.randomizeIds&&(J=l(Math.random().toString()),V={},en.body=en.body.replace(/(id="|url\(#)([a-z0-9-_]+)([")])/gi,(e,t,r,l)=>(V[r]=V[r]||J.string(8),`${t}${V[r]}${l}`)));let eu=Object.keys(K={xmlns:"http://www.w3.org/2000/svg",...en.attributes}).map(e=>`${t(e)}="${t(K[e])}"`).join(" "),eh=(Y=null==(v=e.meta)?void 0:v.title,G=null==(x=e.meta)?void 0:x.creator,Q=null==(b=e.meta)?void 0:b.source,ee=null==(E=null==(k=e.meta)?void 0:k.license)?void 0:E.url,er=(null==(L=(C=e).meta)?void 0:L.title)?`„${null==(S=C.meta)?void 0:S.title}”`:"Design",el=`„${null!=(F=null==(j=C.meta)?void 0:j.creator)?F:"Unknown"}”`,(null==(A=C.meta)?void 0:A.source)&&(er+=` (${C.meta.source})`),ei="",(null==(P=null==(N=C.meta)?void 0:N.license)?void 0:P.name)!=="MIT"&&(null==(z=C.meta)?void 0:z.creator)!=="DiceBear"&&(null==(U=C.meta)?void 0:U.title)&&(ei+="Remix of "),ei+=`${er} by ${el}`,(null==(I=null==(D=C.meta)?void 0:D.license)?void 0:I.name)&&(ei+=`, licensed under „${null==(Z=null==(T=C.meta)?void 0:T.license)?void 0:Z.name}”`,(null==(R=null==(O=C.meta)?void 0:O.license)?void 0:R.url)&&(ei+=` (${C.meta.license.url})`)),et=ei,Y||G||Q||ee||et?'<metadata xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcterms="http://purl.org/dc/terms/"><rdf:RDF><rdf:Description>'+(Y?`<dc:title>${t(Y)}</dc:title>`:"")+(G?`<dc:creator>${t(G)}</dc:creator>`:"")+(Q?`<dc:source xsi:type="dcterms:URI">${t(null!=(M=null==($=e.meta)?void 0:$.source)?M:"")}</dc:source>`:"")+(ee?`<dcterms:license xsi:type="dcterms:URI">${t(ee)}</dcterms:license>`:"")+(et?`<dc:rights>${t(et)}</dc:rights>`:"")+"</rdf:Description></rdf:RDF></metadata>":""),ef=`<svg ${eu}>${eh}${en.body}</svg>`;return{toString:()=>ef,toJson:()=>{var e;return{svg:ef,extra:{primaryBackgroundColor:es,secondaryBackgroundColor:ec,backgroundType:eo,backgroundRotation:ed,...null==(e=en.extra)?void 0:e.call(en)}}},toDataUri:()=>`data:image/svg+xml;utf8,${encodeURIComponent(ef)}`}})(h,{seed:"most.box@"+e,flip:!0,backgroundType:["gradientLinear"]}).toDataUri():"/pwa-512x512.png"}],93957)},57667,80809,e=>{"use strict";var t=e.i(18050),r=e.i(71645);e.i(22183);var l=e.i(8382);e.s(["ModalOverlay",0,function({children:e,onClose:i,closeOnOverlayClick:a=!1}){return(0,l.useHotkeys)(i?[["Escape",i]]:[]),(0,r.useEffect)(()=>{let e=window.visualViewport;if(!e)return;let t=()=>{document.documentElement.style.setProperty("--modal-visual-height",`${e.height}px`),document.documentElement.style.setProperty("--modal-visual-top",`${e.offsetTop}px`)};return t(),e.addEventListener("resize",t),e.addEventListener("scroll",t),()=>{e.removeEventListener("resize",t),e.removeEventListener("scroll",t),document.documentElement.style.removeProperty("--modal-visual-height"),document.documentElement.style.removeProperty("--modal-visual-top")}},[]),(0,t.jsxs)("div",{className:"modal-overlay",onClick:e=>{a&&e.target===e.currentTarget&&i?.()},children:[(0,t.jsx)("div",{className:"modal-overlay-backdrop"}),(0,t.jsx)("div",{className:"modal-glass",children:e})]})}],57667),e.s(["Toast",0,function({message:e,type:l,onDone:i,index:a}){(0,r.useEffect)(()=>{let e=setTimeout(i,3e3);return()=>clearTimeout(e)},[]);let n=Math.min(Math.max(a,0),5);return(0,t.jsx)("div",{className:`toast ${l} toast-stack-${n}`,children:e})}],80809)},63676,e=>{"use strict";let t=(0,e.i(56420).default)("x",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);e.s(["X",0,t],63676)},4121,88361,47910,e=>{"use strict";var t=e.i(57667);e.i(80809);var r=e.i(18050),l=e.i(63676);e.s(["ConfirmModal",0,function({title:e,message:i,confirmText:a,onConfirm:n,onClose:o,danger:s,closeOnOverlayClick:c}){return(0,r.jsx)(t.ModalOverlay,{onClose:o,closeOnOverlayClick:c,children:(0,r.jsxs)("div",{className:"confirm-modal",onClick:e=>e.stopPropagation(),children:[(0,r.jsxs)("div",{className:"modal-header",children:[(0,r.jsx)("h3",{children:e}),(0,r.jsx)("button",{onClick:o,className:"btn btn-icon",children:(0,r.jsx)(l.X,{size:18})})]}),(0,r.jsx)("p",{children:i}),(0,r.jsxs)("div",{className:"modal-actions",children:[(0,r.jsx)("button",{onClick:o,className:"btn btn-secondary",children:"取消"}),(0,r.jsx)("button",{onClick:n,className:`btn ${s?"btn-danger":"btn-primary"}`,children:a})]})]})})}],88361);var i=e.i(71645);e.s(["InputModal",0,function({title:e,placeholder:a,defaultValue:n,confirmText:o,onConfirm:s,onClose:c,isLoading:d,loadingText:u,validate:h}){let[f,m]=(0,i.useState)(n||""),g=f.trim(),p=g&&h?h(g):"",y=!!g&&!p&&!d;function w(){y&&s(g)}return(0,r.jsx)(t.ModalOverlay,{onClose:c,children:(0,r.jsxs)("div",{className:"input-modal",onClick:e=>e.stopPropagation(),children:[(0,r.jsxs)("div",{className:"modal-header",children:[(0,r.jsx)("h3",{children:e}),(0,r.jsx)("button",{onClick:c,className:"btn btn-icon",children:(0,r.jsx)(l.X,{size:18})})]}),(0,r.jsx)("input",{type:"text",value:f,onChange:e=>m(e.target.value),placeholder:a,autoFocus:!0,onKeyDown:e=>{"Enter"===e.key&&w()},className:"input input-compact","aria-invalid":!!p,"aria-describedby":p?"input-modal-error":void 0}),p&&(0,r.jsx)("p",{className:"input-modal-error",id:"input-modal-error",children:p}),(0,r.jsxs)("div",{className:"modal-actions",children:[(0,r.jsx)("button",{onClick:c,disabled:d,className:"btn btn-secondary",children:"取消"}),(0,r.jsx)("button",{onClick:w,disabled:!y,className:`btn btn-primary ${d?"btn-loading":""}`,children:d?u||"处理中...":o})]})]})})}],47910),e.s([],4121)}]);
@@ -1 +0,0 @@
1
- .download-page{flex-direction:column;min-height:100dvh;display:flex}.download-hero{text-align:center;padding:64px 24px 48px}.download-hero-icon{border-radius:var(--radius-lg);background:var(--accent-soft);width:72px;height:72px;color:var(--accent);justify-content:center;align-items:center;margin-bottom:24px;display:inline-flex}.download-hero-title{letter-spacing:-.02px;background:linear-gradient(135deg, var(--text-primary), var(--accent));-webkit-text-fill-color:transparent;-webkit-background-clip:text;background-clip:text;margin-bottom:16px;font-size:40px;font-weight:700;line-height:1.1}.download-hero-desc{color:var(--text-secondary);max-width:48ch;margin:0 auto;font-size:16px;line-height:1.6}.download-platforms{padding:48px 24px}.download-section-title{text-align:center;color:var(--text-primary);margin-bottom:32px;font-size:24px;font-weight:600}.download-platform-grid{grid-template-columns:repeat(3,1fr);gap:20px;display:grid}.download-platform-card{text-align:center;background:var(--glass-bg);-webkit-backdrop-filter:var(--blur-md);border:1px solid var(--glass-border);border-radius:var(--radius-lg);color:var(--text-primary);transition:all var(--transition);flex-flow:column wrap;align-items:center;padding:32px 24px;text-decoration:none;display:flex}.download-platform-card:hover{background:var(--glass-bg-heavy);box-shadow:var(--glass-shadow);border-color:var(--accent);transform:translateY(-2px)}.download-platform-icon{color:var(--accent);margin-bottom:16px}.download-platform-card h3{margin-bottom:8px;font-size:18px;font-weight:600}.download-platform-card p{color:var(--text-secondary);margin-bottom:20px;font-size:13px}.download-platform-btn{background:var(--accent);color:#fff;border-radius:var(--radius-md);transition:all var(--transition-fast);align-items:center;gap:8px;padding:10px 20px;font-size:14px;font-weight:500;display:inline-flex}.download-platform-card:hover .download-platform-btn{background:var(--accent-hover)}.download-comparison{background:var(--glass-bg-subtle);border-top:1px solid var(--glass-border);border-bottom:1px solid var(--glass-border);padding:48px 24px}.download-table-wrap{overflow-x:auto}.download-table{border-collapse:collapse;width:100%;max-width:600px;margin:0 auto}.download-table th,.download-table td{text-align:left;border-bottom:1px solid var(--glass-border);padding:14px 20px}.download-table th{color:var(--text-primary);font-size:14px;font-weight:600}.download-table td{color:var(--text-secondary);font-size:14px}.download-table td.col-web{color:var(--warning)}.download-table td.col-desktop{color:var(--success);font-weight:500}.download-cta{text-align:center;padding:64px 24px}.download-cta-desc{color:var(--text-secondary);margin-bottom:24px;font-size:16px;line-height:1.6}@media (max-width:768px){.download-hero-title{font-size:32px}.download-platform-grid{grid-template-columns:1fr;gap:16px}.download-platform-card{text-align:left;flex-direction:row;gap:16px;padding:20px}.download-platform-icon{flex-shrink:0;margin-bottom:0}.download-platform-card p{margin-bottom:12px}.download-platform-btn{margin-top:auto}}
@@ -1 +0,0 @@
1
- .portal-page{min-height:calc(100dvh - 144px)}.portal-hero{text-align:center;padding:64px 24px 32px}.portal-hero-title{letter-spacing:-.03em;background:linear-gradient(135deg, var(--text-primary), var(--accent));-webkit-text-fill-color:transparent;-webkit-background-clip:text;background-clip:text;margin-bottom:8px;font-size:48px;font-weight:700;line-height:1.1}.portal-hero-subtitle{color:var(--text-secondary);font-size:18px}@media (max-width:768px){.portal-hero{padding:40px 24px 24px}.portal-hero-title{font-size:36px}.portal-hero-subtitle{font-size:16px}}.portal-cards-section{padding-bottom:32px}.portal-cards{grid-template-columns:repeat(3,1fr);gap:16px;display:grid}@media (max-width:768px){.portal-cards{grid-template-columns:1fr}}.portal-card{text-align:center;background:var(--glass-bg-subtle);-webkit-backdrop-filter:var(--blur-sm);border:1px solid var(--glass-border);border-radius:var(--radius-lg);cursor:pointer;transition:all var(--transition);border:2px solid #0000;flex-direction:column;align-items:center;gap:6px;padding:28px 20px;display:flex;position:relative}.portal-card:hover{background:var(--glass-bg);box-shadow:var(--glass-shadow);transform:translateY(-2px)}.portal-card.active{background:var(--glass-bg);border-color:var(--accent);box-shadow:0 4px 24px #5e6ad226}.portal-card-open-btn{opacity:.5;position:absolute;top:12px;right:12px}.portal-card:hover .portal-card-open-btn,.portal-card.active .portal-card-open-btn{opacity:1}.portal-card-icon{color:var(--accent);margin-bottom:4px}.portal-card-title{color:var(--text-primary);font-size:17px;font-weight:600}.portal-card-subtitle{color:var(--text-secondary);font-size:13px}.portal-node-actions{flex-wrap:wrap;justify-content:center;gap:12px;margin-top:18px;display:flex}.portal-node-actions .btn{min-width:128px}.portal-card-status{border-radius:var(--radius-full);background:var(--glass-bg-subtle);border:1px solid var(--glass-border);align-items:center;gap:5px;margin-top:6px;padding:3px 10px;font-size:11px;font-weight:500;display:inline-flex}.status-dot{border-radius:50%;width:7px;height:7px;display:inline-block}.status-dot.checking{background:var(--warning);animation:1.2s ease-in-out infinite pulse-dot}.status-dot.connected{background:var(--success)}.status-dot.disconnected{background:var(--danger)}.status-dot.ready{background:var(--info)}@keyframes pulse-dot{0%,to{opacity:.4;transform:scale(.9)}50%{opacity:1;transform:scale(1)}}.portal-marketing{padding-bottom:64px}.portal-marketing-inner{background:var(--glass-bg-subtle);-webkit-backdrop-filter:var(--blur-sm);border:1px solid var(--glass-border);border-radius:var(--radius-lg);padding:40px;animation:.3s ease-out fadeInUp}@media (max-width:768px){.portal-marketing-inner{padding:24px}}.portal-marketing-header h2{margin-bottom:12px;font-size:28px;font-weight:600}.portal-marketing-header p{color:var(--text-secondary);max-width:60ch;font-size:16px;line-height:1.7}@media (max-width:768px){.portal-marketing-header h2{font-size:22px}.portal-marketing-header p{font-size:14px}}.portal-marketing-features{grid-template-columns:repeat(2,1fr);gap:12px;margin-top:28px;display:grid}@media (max-width:768px){.portal-marketing-features{grid-template-columns:1fr}}.portal-feature-item{color:var(--text-secondary);align-items:flex-start;gap:10px;font-size:14px;line-height:1.5;display:flex}.portal-feature-icon{color:var(--accent);flex-shrink:0;margin-top:1px}.portal-marketing-steps{border-top:1px solid var(--glass-border);flex-direction:column;gap:16px;margin-top:32px;padding-top:32px;display:flex}.portal-step{align-items:flex-start;gap:14px;display:flex}.portal-step-num{background:var(--accent);color:#fff;border-radius:50%;flex-shrink:0;justify-content:center;align-items:center;width:32px;height:32px;font-size:13px;font-weight:700;display:flex}.portal-step-content strong{color:var(--text-primary);font-size:15px;font-weight:600}.portal-step-content p{color:var(--text-secondary);margin-top:2px;font-size:13px}.portal-step-code{background:var(--glass-bg-subtle);border:1px solid var(--glass-border);border-radius:var(--radius-sm);font-size:13px;font-family:var(--font-mono);color:var(--text-primary);margin-top:8px;padding:10px 14px;display:block}.portal-step-link{margin-top:6px}.portal-step-link a{color:var(--accent);align-items:center;gap:4px;font-size:13px;display:inline-flex}.portal-actions{border-top:1px solid var(--glass-border);flex-wrap:wrap;gap:12px;margin-top:32px;padding-top:32px;display:flex}.portal-actions .mkt-btn-primary,.portal-actions .mkt-btn-secondary{align-items:center;gap:6px;display:inline-flex}
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,68590,e=>{"use strict";let a=(0,e.i(56420).default)("message-square",[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]]);e.s(["MessageSquare",0,a],68590)},51921,e=>{"use strict";let a=(0,e.i(56420).default)("music",[["path",{d:"M9 18V5l12-2v13",key:"1jmyc2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["circle",{cx:"18",cy:"16",r:"3",key:"1hluhg"}]]);e.s(["Music",0,a],51921)},30274,e=>{"use strict";let a=(0,e.i(56420).default)("send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);e.s(["Send",0,a],30274)},35965,e=>{"use strict";let a=(0,e.i(56420).default)("sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);e.s(["Sun",0,a],35965)},96699,e=>{"use strict";let a=(0,e.i(56420).default)("moon",[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]]);e.s(["Moon",0,a],96699)},11241,e=>{"use strict";let a=(0,e.i(56420).default)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);e.s(["ArrowLeft",0,a],11241)},59665,e=>{"use strict";var a=e.i(18050),t=e.i(71645),s=e.i(67228);let i=(0,e.i(56420).default)("menu",[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]]);e.i(22183);var n=e.i(5142);let l=(0,t.createContext)(null);e.s(["default",0,function({sidebar:e,headerTitle:r,headerRight:c,children:d}){let[o,h]=(0,n.useDisclosure)(!1),[u,m]=(0,t.useState)(!1),p=(0,s.useMediaQuery)("(max-width: 768px)"),f=()=>{p?h.open():m(!1)};return(0,a.jsx)(l.Provider,{value:{closeSidebar:h.close,openSidebar:f,isSidebarVisible:p?o:!u},children:(0,a.jsxs)("div",{className:"app-layout",children:[(0,a.jsx)("div",{className:`sidebar-overlay ${o?"visible":""}`,onClick:()=>h.close()}),(0,a.jsx)("div",{className:`sidebar ${o?"open":""} ${u?"collapsed":""}`,children:e({closeSidebar:h.close,openSidebar:f})}),(0,a.jsxs)("div",{className:"main-content",children:[(0,a.jsxs)("header",{className:"app-header",children:[(0,a.jsxs)("div",{className:"header-left",children:[(0,a.jsx)("button",{onClick:()=>{p?h.toggle():m(!u)},className:"btn btn-icon sidebar-toggle-btn","aria-label":p?"打开菜单":u?"展开侧边栏":"收起侧边栏",children:(0,a.jsx)(i,{size:16})}),r]}),(0,a.jsx)("div",{className:"header-right",children:c})]}),d]})]})})},"useAppShell",0,function(){let e=(0,t.useContext)(l);if(!e)throw Error("useAppShell must be used within AppShell");return e}],59665)},26091,e=>{"use strict";let a=(0,e.i(56420).default)("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);e.s(["FileText",0,a],26091)},39626,27648,e=>{"use strict";var a=e.i(18050);let t=(0,e.i(56420).default)("panel-left-open",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m14 9 3 3-3 3",key:"8010ee"}]]);var s=e.i(59665);e.s(["default",0,function({label:e="打开侧边栏",className:i="",variant:n="primary"}){let{isSidebarVisible:l,openSidebar:r}=(0,s.useAppShell)();return l?null:(0,a.jsxs)("button",{type:"button",className:`btn ${"primary"===n?"btn-primary":""} sidebar-open-hint ${i}`.trim(),onClick:r,children:[(0,a.jsx)(t,{size:16}),e]})}],39626);var i=e.i(93957),n=e.i(71192);e.s(["default",0,function({className:e=""}){let t=(0,n.useUserStore)(e=>e.identity),s=(0,n.useUserStore)(e=>e.openLoginModal),l=(0,n.useUserStore)(e=>e.logoutUser);return(0,a.jsxs)("div",{className:`chat-sidebar-footer sidebar-account ${e}`,children:[(0,a.jsxs)("div",{className:"user-info",children:[(0,a.jsx)("img",{className:"user-avatar-img",src:(0,i.generateAvatar)(t?.address),alt:"avatar"}),(0,a.jsx)("span",{className:"user-name",title:t?.address,children:t?.displayName||"未登录"})]}),t?(0,a.jsx)("button",{className:"btn btn-ghost logout-btn",onClick:l,children:"退出"}):(0,a.jsx)("button",{className:"btn btn-primary login-btn",onClick:s,children:"登录"})]})}],27648)},77071,e=>{"use strict";let a=(0,e.i(56420).default)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);e.s(["Plus",0,a],77071)},79490,e=>{"use strict";let a=(0,e.i(56420).default)("pen",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]]);e.s(["Edit2",0,a],79490)},15170,80796,e=>{"use strict";var a=e.i(56420);let t=(0,a.default)("image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);e.s(["Image",0,t],15170);let s=(0,a.default)("film",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M7 3v18",key:"bbkbws"}],["path",{d:"M3 7.5h4",key:"zfgn84"}],["path",{d:"M3 12h18",key:"1i2n21"}],["path",{d:"M3 16.5h4",key:"1230mu"}],["path",{d:"M17 3v18",key:"in4fa5"}],["path",{d:"M17 7.5h4",key:"myr1c1"}],["path",{d:"M17 16.5h4",key:"go4c1d"}]]);e.s(["Film",0,s],80796)},12796,11028,6933,e=>{"use strict";let a=(0,e.i(56420).default)("loader",[["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m16.2 7.8 2.9-2.9",key:"r700ao"}],["path",{d:"M18 12h4",key:"wj9ykh"}],["path",{d:"m16.2 16.2 2.9 2.9",key:"1bxg5t"}],["path",{d:"M12 18v4",key:"jadmvz"}],["path",{d:"m4.9 19.1 2.9-2.9",key:"bwix9q"}],["path",{d:"M2 12h4",key:"j09sii"}],["path",{d:"m4.9 4.9 2.9 2.9",key:"giyufr"}]]);e.s(["Loader",0,a],12796);var t=e.i(18050),s=e.i(71645),i=e.i(26091),n=e.i(51921),l=e.i(63676),r=e.i(26913);e.s(["default",0,function({item:e,isBackendReady:c,getFileDownloadUrl:d,onClose:o}){let[h,u]=(0,s.useState)(""),[m,p]=(0,s.useState)(!1),[f,x]=(0,s.useState)(""),[g,j]=(0,s.useState)("");return(0,s.useEffect)(()=>{if("text"!==e.subtype)return;let a=!1;return(u(""),j(""),c)?(p(!0),(async()=>{try{let t=await fetch(d(e.cid),{headers:{...await (0,r.getApiRequestHeaders)("GET",`/api/files/${e.cid}/download`),Range:"bytes=0-9999"}});if(!t.ok)throw Error("加载失败");let s=await t.text();a||u(s||"(文件为空)")}catch{a||u("加载失败")}finally{a||p(!1)}})(),()=>{a=!0}):void u("加载失败")},[d,c,e.cid,e.subtype]),(0,s.useEffect)(()=>{var a;if("image"!==(a=e.subtype)&&"video"!==a&&"audio"!==a)return void x("");if(x(""),j(""),!c)return void j("加载失败");let t="",s=!1;return(async()=>{try{let a=await fetch(d(e.cid),{headers:await (0,r.getApiRequestHeaders)("GET",`/api/files/${e.cid}/download`)});if(!a.ok)throw Error("加载失败");let i=URL.createObjectURL(await a.blob());t=i,s||x(i)}catch{s||j("加载失败")}})(),()=>{s=!0,t&&URL.revokeObjectURL(t)}},[d,c,e.cid,e.subtype]),(0,t.jsxs)("div",{className:"preview-overlay",onClick:o,children:[(0,t.jsx)("button",{type:"button",className:"preview-close",onClick:o,"aria-label":"关闭预览",children:(0,t.jsx)(l.X,{size:20})}),(0,t.jsxs)("div",{onClick:e=>e.stopPropagation(),children:["image"===e.subtype&&(0,t.jsx)("div",{className:"preview-media-wrapper",children:f?(0,t.jsx)("img",{src:f,alt:e.fileName}):g?(0,t.jsxs)("div",{className:"preview-unsupported",children:[(0,t.jsx)(i.FileText,{size:48,className:"preview-file-icon"}),(0,t.jsx)("p",{children:e.fileName}),(0,t.jsx)("p",{className:"preview-unsupported-hint",children:g})]}):(0,t.jsx)("div",{className:"preview-loading",children:(0,t.jsx)("div",{className:"preview-loading-spinner"})})}),"video"===e.subtype&&(0,t.jsx)("div",{className:"preview-media-wrapper",children:f?(0,t.jsx)("video",{src:f,controls:!0}):g?(0,t.jsxs)("div",{className:"preview-unsupported",children:[(0,t.jsx)(i.FileText,{size:48,className:"preview-file-icon"}),(0,t.jsx)("p",{children:e.fileName}),(0,t.jsx)("p",{className:"preview-unsupported-hint",children:g})]}):(0,t.jsx)("div",{className:"preview-loading",children:(0,t.jsx)("div",{className:"preview-loading-spinner"})})}),"audio"===e.subtype&&(0,t.jsxs)("div",{className:"preview-audio",children:[(0,t.jsx)("div",{className:"preview-audio-icon",children:(0,t.jsx)(n.Music,{size:36,color:"var(--accent)"})}),(0,t.jsx)("p",{className:"preview-audio-filename",children:e.fileName}),f?(0,t.jsx)("audio",{className:"preview-audio-player",src:f,controls:!0}):(0,t.jsx)("div",{className:"preview-text-loading",children:g?(0,t.jsx)("p",{children:g}):(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(a,{size:24,className:"preview-text-spinner"}),(0,t.jsx)("p",{children:"正在加载音频预览..."})]})})]}),"file"===e.subtype&&(0,t.jsxs)("div",{className:"preview-unsupported",children:[(0,t.jsx)(i.FileText,{size:48,className:"preview-file-icon"}),(0,t.jsx)("p",{children:e.fileName}),(0,t.jsx)("p",{className:"preview-unsupported-hint",children:"无法预览"})]}),"text"===e.subtype&&(0,t.jsxs)("div",{className:"preview-text-container",children:[(0,t.jsx)("div",{className:"preview-text-header",children:(0,t.jsx)("span",{children:e.fileName})}),m?(0,t.jsxs)("div",{className:"preview-text-loading",children:[(0,t.jsx)(a,{size:24,className:"preview-text-spinner"}),(0,t.jsx)("p",{children:"正在加载文本预览..."}),(0,t.jsx)("p",{className:"preview-text-loading-hint",children:"如果是初次预览,可能需要等待 P2P 网络同步"})]}):(0,t.jsx)("pre",{className:"preview-text",children:h||"(文件为空)"})]})]})]})}],11028),e.s(["getFileSubtype",0,function(e){let a=String(e||"").split(".").pop()?.toLowerCase()||"";return["jpg","jpeg","png","gif","webp","svg","bmp","ico","tiff","heic","heif"].includes(a)?"image":["mp4","webm","mov","avi","mkv","flv","wmv","m4v","mpeg","3gp"].includes(a)?"video":["mp3","wav","ogg","flac","aac","m4a","wma","opus"].includes(a)?"audio":["txt","md","js","ts","jsx","tsx","css","scss","less","json","xml","html","htm","yaml","yml","toml","ini","cfg","conf","log","sh","bash","py","rb","go","rs","java","c","cpp","h","hpp","cs","php","sql","graphql","env","gitignore","dockerfile","readme"].includes(a)?"text":"file"}],6933)},41222,e=>{"use strict";var a=e.i(18050),t=e.i(71645),s=e.i(68590),i=e.i(30274),n=e.i(77071),l=e.i(35965),r=e.i(96699),c=e.i(63676),d=e.i(11241),o=e.i(79490),h=e.i(56420);let u=(0,h.default)("calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]),m=(0,h.default)("hash",[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]),p=(0,h.default)("settings",[["path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915",key:"1i5ecw"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);var f=e.i(15170),x=e.i(80796),g=e.i(26091),j=e.i(62368),y=e.i(12796),v=e.i(51921);let b=(0,h.default)("paperclip",[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]]);var k=e.i(59665),w=e.i(11028);e.i(4121);var N=e.i(47910),C=e.i(88361),S=e.i(39626),M=e.i(26913),z=e.i(93957),$=e.i(3593),R=e.i(71192);e.i(22183);var F=e.i(5142),E=e.i(27648),A=e.i(6933);let I=/^[a-zA-Z0-9_-]+$/,U={getChannels:()=>M.api.get("/api/channels").json(),createChannel:(e,a)=>M.api.post("/api/channels",{json:{name:e,type:a}}).json(),leaveChannel:e=>M.api.delete(`/api/channels/${encodeURIComponent(e)}`).json(),getChannelMessages:(e,a=100,t=0)=>M.api.get(`/api/channels/${encodeURIComponent(e)}/messages?limit=${a}&offset=${t}`).json(),sendChannelMessage:(e,a,t,s,i)=>M.api.post(`/api/channels/${encodeURIComponent(e)}/messages`,{json:i?{content:a,author:t,authorName:s,attachment:i}:{content:a,author:t,authorName:s}}).json(),async publishFile(e,a){let t=new FormData;t.append("file",e,a);let s=await M.api.post("/api/publish",{body:t});if(!s.ok)throw Error((await s.json().catch(()=>({error:s.statusText}))).error||"Request failed");return s.json()},listPublishedFiles:()=>M.api.get("/api/files").json(),downloadFile:e=>M.api.post("/api/download",{json:{link:e}}).json(),getFileDownloadUrl:e=>(0,M.getApiUrl)(`/api/files/${e}/download`),getChannelPeers:e=>M.api.get(`/api/channels/${encodeURIComponent(e)}/peers`).json(),setChannelRemark:(e,a)=>M.api.put(`/api/channels/${encodeURIComponent(e)}/remark`,{json:{remark:a}}).json()};function T(e){let a=String(e||"").split("/");return a[a.length-1]||e}e.s(["default",0,function(){let e=(0,$.useAppStore)(e=>e.isDarkMode),h=(0,$.useAppStore)(e=>e.setIsDarkMode),P=(0,$.useAppStore)(e=>e.hasBackend),D=(0,$.useAppStore)(e=>e.addToast),L=(0,$.useAppStore)(e=>e.openConnectModal),q=(0,R.useUserStore)(e=>e.identity),B=(0,R.useUserStore)(e=>e.openLoginModal),[O,W]=(0,t.useState)([]),[H,K]=(0,t.useState)(null),[V,G]=(0,t.useState)([]),[J,X]=(0,t.useState)(""),[_,Q]=(0,F.useDisclosure)(!1),[Z,Y]=(0,t.useState)(""),[ee,ea]=(0,t.useState)(!1),[et,es]=(0,t.useState)(!1),[ei,en]=(0,F.useDisclosure)(!1),[el,er]=(0,t.useState)(null),[ec,ed]=(0,t.useState)(!1),[eo,eh]=(0,t.useState)(""),[eu,em]=(0,t.useState)(null),[ep,ef]=(0,t.useState)(!1),[ex,eg]=(0,t.useState)({}),ej=(0,t.useRef)(null),ey=(0,t.useRef)(null),ev=(0,t.useRef)(null),eb=(0,t.useRef)(null),ek=(0,t.useRef)(0),ew=(0,t.useRef)(!1),eN=(0,t.useRef)(null),eC=(0,t.useRef)(null),eS=(0,t.useRef)(null),eM=(0,t.useRef)(new Map),ez=!0===P;function e$(){return!!ez||(L(),!1)}function eR(){return!!q||(B(),!1)}(0,t.useEffect)(()=>{ev.current=H},[H]),(0,t.useEffect)(()=>{ey.current?.scrollIntoView({behavior:"smooth"})},[V]),(0,t.useEffect)(()=>{ez?M.api.get("/api/node-id").json().then(e=>Y(e.id)).catch(e=>{console.warn("[Chat] Failed to fetch node ID:",e.message),eI(e,"无法读取节点 ID")}):Y("")},[ez]);let eF=(0,t.useRef)(null),eE=(0,t.useRef)(!0);async function eA(e){if(ez)try{let a=await U.getChannelMessages(e);G(e=>{let t=a.filter(a=>{let t=a.id||`${a.author}-${a.timestamp}`;return!e.some(e=>(e.id||`${e.author}-${e.timestamp}`)===t)});return 0===t.length?e:[...e,...t]}),await U.getChannelPeers(e)}catch{}}async function eI(e,a){D(await (0,M.getApiErrorMessage)(e,a),"error")}function eU(e){return e.length<3?"频道名至少 3 个字符":e.length>20?"频道名最多 20 个字符":I.test(e)?"":"频道名只能包含字母、数字、下划线和连字符"}async function eT(){if(ez)try{let e=await U.getChannels();W(e)}catch(e){W([]),await eI(e,"无法读取频道列表")}}function eP(e,a){ej.current&&ej.current.readyState===WebSocket.OPEN&&ej.current.send(JSON.stringify({event:e,data:a}))}function eD(e){if(!Z){eF.current=e;return}eP("channel:subscribe",{channel:e})}function eL(e){eP("channel:unsubscribe",{channel:e})}function eq(e,a=e.fileName){let t=(0,A.getFileSubtype)(a);em({cid:e.cid,fileName:a,subtype:"file"===t?e.kind:t})}function eB(e){eg(a=>{let t={...a};return delete t[e],t})}async function eO(e){!eR()||e$()&&(ev.current&&eL(ev.current.name),K(e),eD(e.name),window.history.pushState({},"",`?channel=${encodeURIComponent(e.name)}`))}async function eW(e,a){if((a&&a.stopPropagation(),eR()&&e$())&&!et){es(!0),eL(e);try{if(await U.leaveChannel(e),H?.name===e){K(null),G([]);let e=new URL(window.location.href);e.searchParams.delete("channel"),window.history.pushState({},"",e.pathname)}eT(),en.close(),er(null)}catch(e){await eI(e,"退出频道失败")}finally{es(!1)}}}async function eH(e){let a=e.trim();if(!a||ee)return;let t=eU(a);if(t)return void D(t,"error");if(eR()&&e$()){ea(!0);try{await U.createChannel(a,"public");let e=O.find(e=>e.name===a)||{name:a,type:"public"};W(t=>t.some(e=>e.name===a)?t:[...t,e]),Q.close(),await eO(e),eT()}catch(e){await eI(e,"加入频道失败")}finally{ea(!1)}}}async function eK(e,a){if(!e.trim()||!H||!eR()||!e$())return!1;let t=e.trim(),s=`${q.address}-${Date.now()}-${Math.random().toString(36).slice(2)}`,i={id:s,author:q.address,authorName:q.displayName,content:t,timestamp:Date.now(),pending:!0,attachment:a};G(e=>[...e,i]);try{let e=await U.sendChannelMessage(H.name,t,q.address,q.displayName,a);return G(a=>a.map(a=>a.id===s?{...e.message,id:e.message.id||e.message.timestamp}:a)),!0}catch(e){return G(e=>e.filter(e=>e.id!==s)),await eI(e,"发送失败"),!1}}async function eV(){if(!J.trim())return;let e=J.trim();X(""),await eK(e)}async function eG(e){if(e&&0!==e.length&&H&&eR()&&e$()&&!ep){ef(!0);try{for(let s of Array.from(e)){var a,t;let e=(a=H.name,t=s.name,`chat-file/${a}/${t}`),i=await U.publishFile(s,e),n=i.fileName||e,l=i.link||`most://${i.cid}?filename=${encodeURIComponent(n)}`,r={kind:s.type.startsWith("image/")?"image":s.type.startsWith("video/")?"video":s.type.startsWith("audio/")?"audio":s.type.startsWith("text/")?"text":(0,A.getFileSubtype)(n),cid:i.cid,fileName:n,link:l,mimeType:s.type||void 0,size:s.size};await eK(l,r)&&D(`${T(n)} 已发布`,"success")}}catch(e){await eI(e,"附件发送失败")}finally{ef(!1)}}}async function eJ(e){if(eR()&&e$()&&!ex[e.cid])try{let a=(await U.listPublishedFiles()).find(a=>a.cid===e.cid);if(a)return void eq({...e,fileName:a.fileName},a.fileName);eg(a=>({...a,[e.cid]:"downloading"}));let t=await U.downloadFile(e.link);if(t.alreadyExists||t.fileName){eB(e.cid),eq({...e,fileName:t.fileName||e.fileName},t.fileName||e.fileName);return}t.taskId&&(eM.current.set(t.taskId,e),D("开始下载附件","success"))}catch(a){eB(e.cid),await eI(a,"附件下载失败")}}async function eX(){if(H&&eR()&&e$())try{let e=await U.setChannelRemark(H.name,eo);W(a=>a.map(a=>a.name===H.name?{...a,remark:e.remark}:a)),K(a=>a?{...a,remark:e.remark}:null)}catch(e){await eI(e,"设置备注失败")}}(0,t.useEffect)(()=>(eE.current=!0,()=>{eE.current=!1}),[]),(0,t.useEffect)(()=>{if(Z&&eF.current){let e=eF.current;eF.current=null,eD(e)}},[Z]),(0,t.useEffect)(()=>{if(ez&&q)return ek.current=0,e(),()=>{eb.current&&clearTimeout(eb.current),ej.current&&ej.current.close()};async function e(){let a=new WebSocket(await (0,M.getAuthenticatedWebSocketUrl)("/ws"));a.onopen=()=>{ew.current=!0,ek.current=0,Z&&1===a.readyState&&a.send(JSON.stringify({event:"register",data:{peerId:Z}})),ev.current&&(eD(ev.current.name),eA(ev.current.name))},a.onmessage=e=>{try{let{event:s,data:i}=JSON.parse(e.data);var a=s,t=i;let n=ev.current;switch(a){case"channel:message":n&&t.channel===n.name&&(G(e=>{let a=t.message.id||`${t.message.author}-${t.message.timestamp}`,s=e.findIndex(e=>e.pending&&e.content===t.message.content&&e.author===t.message.author);if(-1!==s){let i=[...e];return i[s]={...t.message,id:a},i}return e.some(e=>e.id===a||e.timestamp===t.message.timestamp&&e.content===t.message.content&&e.author===t.message.author)?e:[...e,{...t.message,id:a}]}),ez&&U.getChannelPeers(n.name).catch(e=>{console.warn("[Chat] Failed to fetch peers:",e.message)}));break;case"channel:peer:online":case"channel:peer:offline":n&&ez&&U.getChannelPeers(n.name).catch(e=>{console.warn("[Chat] Failed to fetch peers on event:",e.message)});break;case"channel:joined":case"channel:left":eT();break;case"download:success":{let e=eM.current.get(t.taskId);e&&(eM.current.delete(t.taskId),eB(e.cid),D(`${t.fileName||T(e.fileName)} 下载完成`,"success"),eq(e,t.fileName||e.fileName));break}case"download:error":case"download:cancelled":{let e=eM.current.get(t.taskId);e&&(eM.current.delete(t.taskId),eB(e.cid),D("download:cancelled"===a?"附件下载已取消":t.error||"附件下载失败","error"))}}}catch(e){console.warn("[Chat WS] Failed to parse message:",e.message)}},a.onclose=()=>{if(ew.current=!1,!eE.current)return;let a=ek.current;if(a>=20)return;let t=Math.min(3e3*Math.pow(2,a),3e4);ek.current=a+1,eb.current=setTimeout(e,t)},a.onerror=()=>{a.close()},ej.current=a}},[ez,q?.address]),(0,t.useEffect)(()=>{Z&&eP("register",{peerId:Z})},[Z]),(0,t.useEffect)(()=>{ez&&q&&eT()},[P,ez,q?.address]),(0,t.useEffect)(()=>{H&&ez&&(U.getChannelMessages(H.name).then(G).catch(e=>{G([]),eI(e,"无法读取频道消息")}),U.getChannelPeers(H.name).catch(()=>{}))},[H,P,ez]),(0,t.useEffect)(()=>{let e=new URLSearchParams(window.location.search).get("channel");if(e&&O.length>0){let a=O.find(a=>a.name===e);a&&(!H||H.name!==a.name)&&eO(a)}},[O,H]),(0,t.useEffect)(()=>{q||(W([]),K(null),G([]),X(""),Y(""),ed(!1),em(null),eg({}),eM.current.clear())},[q?.address]);let e_=H?(0,a.jsx)("h2",{className:"header-title",children:H.remark||H.name}):(0,a.jsx)("h2",{className:"header-title",children:"聊天"});return(0,a.jsxs)(k.default,{sidebar:({closeSidebar:e})=>(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"sidebar-header sidebar-header-link",onClick:()=>window.location.href="/",children:[(0,a.jsx)(d.ArrowLeft,{size:18}),(0,a.jsx)("h1",{children:"MOST PEOPLE"})]}),(0,a.jsx)("nav",{className:"sidebar-nav",children:0===O.length?(0,a.jsx)("div",{className:"sidebar-empty-state",children:(0,a.jsx)("p",{children:"暂无频道"})}):O.map(t=>(0,a.jsxs)("div",{className:`sidebar-nav-btn ${H?.name===t.name?"active":""}`,onClick:()=>{eO(t),e()},role:"button",tabIndex:0,onKeyDown:a=>{"Enter"===a.key&&(eO(t),e())},children:[(0,a.jsx)(s.MessageSquare,{size:16}),(0,a.jsx)("span",{children:t.remark||t.name}),(0,a.jsx)("button",{className:"leave-channel-btn",onClick:e=>{e.stopPropagation(),er(t),en.open()},title:"退出频道",children:(0,a.jsx)(c.X,{size:14})})]},t.name))}),(0,a.jsxs)("button",{className:"create-channel-btn",onClick:()=>{eR()&&e$()&&Q.open()},children:[(0,a.jsx)(n.Plus,{size:16}),"加入频道"]}),(0,a.jsx)(E.default,{})]}),headerTitle:e_,headerRight:(0,a.jsxs)("div",{className:"header-right-actions",children:[(0,a.jsx)("button",{className:"btn btn-icon",onClick:()=>h(!e),title:"切换主题",children:e?(0,a.jsx)(l.Sun,{size:16}):(0,a.jsx)(r.Moon,{size:16})}),H&&(0,a.jsx)("button",{className:"btn btn-icon",onClick:()=>ed(!0),title:"频道设置",children:(0,a.jsx)(p,{size:16})})]}),children:[H?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"chat-messages",children:[0===V.length?(0,a.jsxs)("div",{className:"chat-messages-empty",children:[(0,a.jsx)("div",{className:"empty-icon",children:(0,a.jsx)(s.MessageSquare,{size:28})}),(0,a.jsx)("p",{children:"暂无消息,开始聊天吧!"})]}):V.map(e=>(0,a.jsxs)("div",{className:`chat-message ${e.author===q?.address?"self":"other"} ${e.pending?"pending":""}`,children:[(0,a.jsx)("img",{className:"msg-avatar",src:(0,z.generateAvatar)(e.author),alt:"avatar"}),(0,a.jsxs)("div",{className:"msg-content",children:[(0,a.jsx)("span",{className:"message-author",children:e.authorName||e.author?.slice(0,8)||"Unknown"}),function(e){var t,s;if(!e.attachment)return(0,a.jsx)("div",{className:"message-bubble",children:e.content});let i=e.attachment,n=ex[i.cid],l=((t=i.size)&&!(t<=0)?t<1024?`${t} B`:t<1048576?`${(t/1024).toFixed(1)} KB`:t<0x40000000?`${(t/1048576).toFixed(1)} MB`:`${(t/0x40000000).toFixed(2)} GB`:"")||"MostBox 文件";return(0,a.jsx)("div",{className:"message-bubble has-attachment",children:(0,a.jsxs)("button",{type:"button",className:"chat-attachment-card",onClick:()=>eJ(i),disabled:!!(e.pending||n),title:i.link,children:[(0,a.jsx)("span",{className:`chat-attachment-icon ${i.kind}`,children:n?(0,a.jsx)(y.Loader,{size:20,className:"chat-attachment-spinner"}):"image"===(s=i.kind)?(0,a.jsx)(f.Image,{size:20}):"video"===s?(0,a.jsx)(x.Film,{size:20}):"audio"===s?(0,a.jsx)(v.Music,{size:20}):(0,a.jsx)(g.FileText,{size:20})}),(0,a.jsxs)("span",{className:"chat-attachment-info",children:[(0,a.jsx)("span",{className:"chat-attachment-name",children:T(i.fileName)}),(0,a.jsx)("span",{className:"chat-attachment-meta",children:e.pending?"发送中...":l})]}),(0,a.jsx)("span",{className:"chat-attachment-action",children:n?"下载中":(0,a.jsx)(j.Download,{size:16})})]})})}(e),(0,a.jsx)("span",{className:"message-time",children:new Date(e.timestamp).toLocaleTimeString("zh-CN",{hour:"2-digit",minute:"2-digit"})})]})]},e.id||`${e.author}-${e.timestamp}`)),(0,a.jsx)("div",{ref:ey})]}),(0,a.jsxs)("div",{className:"chat-input-area",children:[(0,a.jsx)("input",{ref:eN,type:"file",accept:"image/*",className:"chat-file-input",onChange:e=>{eG(e.target.files),e.currentTarget.value=""}}),(0,a.jsx)("input",{ref:eC,type:"file",accept:"video/*",className:"chat-file-input",onChange:e=>{eG(e.target.files),e.currentTarget.value=""}}),(0,a.jsx)("input",{ref:eS,type:"file",className:"chat-file-input",onChange:e=>{eG(e.target.files),e.currentTarget.value=""}}),(0,a.jsx)("button",{type:"button",className:"chat-tool-btn",onClick:()=>eN.current?.click(),disabled:!q||ep,title:"发送图片",children:(0,a.jsx)(f.Image,{size:18})}),(0,a.jsx)("button",{type:"button",className:"chat-tool-btn",onClick:()=>eC.current?.click(),disabled:!q||ep,title:"发送视频",children:(0,a.jsx)(x.Film,{size:18})}),(0,a.jsx)("button",{type:"button",className:"chat-tool-btn",onClick:()=>eS.current?.click(),disabled:!q||ep,title:"发送文件",children:ep?(0,a.jsx)(y.Loader,{size:18,className:"chat-attachment-spinner"}):(0,a.jsx)(b,{size:18})}),(0,a.jsx)("input",{type:"text",className:"input input-pill",placeholder:q?"输入消息...":"请先登录后发言",value:J,disabled:!q,onChange:e=>X(e.target.value),onKeyDown:e=>{"Enter"===e.key&&J.trim()&&eV()}}),(0,a.jsx)("button",{className:"send-btn",onClick:eV,disabled:!q||!J.trim(),children:(0,a.jsx)(i.Send,{size:18})})]})]}):(0,a.jsx)(a.Fragment,{children:(0,a.jsxs)("div",{className:"chat-welcome",children:[(0,a.jsx)("div",{className:"welcome-icon",children:(0,a.jsx)(s.MessageSquare,{size:36})}),(0,a.jsx)("h2",{children:"选择频道"}),(0,a.jsx)("p",{children:"从左侧边栏选择一个频道开始聊天,或创建一个新频道"}),(0,a.jsx)(S.default,{label:"打开频道列表"})]})}),_&&(0,a.jsx)(N.InputModal,{title:"加入频道",placeholder:"频道ID:3-20 位字母、数字、_ 或 -",confirmText:"加入",validate:eU,onConfirm:eH,onClose:()=>Q.close(),isLoading:ee,loadingText:"加入中..."}),ei&&el&&(0,a.jsx)(C.ConfirmModal,{title:"退出频道",message:`确定要退出频道 "${el.name}" 吗?`,confirmText:et?"退出中...":"退出",onConfirm:()=>eW(el.name,void 0),onClose:()=>{en.close(),er(null)},danger:!0}),eu&&(0,a.jsx)(w.default,{item:eu,isBackendReady:ez,getFileDownloadUrl:U.getFileDownloadUrl,onClose:()=>em(null)}),ec&&H&&(0,a.jsx)("div",{className:"channel-detail-overlay",onClick:()=>ed(!1),children:(0,a.jsxs)("div",{className:"channel-detail-drawer",onClick:e=>e.stopPropagation(),children:[(0,a.jsxs)("div",{className:"channel-detail-header",children:[(0,a.jsx)("h3",{children:"频道详情"}),(0,a.jsx)("button",{className:"btn btn-icon",onClick:()=>ed(!1),children:(0,a.jsx)(c.X,{size:18})})]}),(0,a.jsxs)("div",{className:"channel-detail-body",children:[(0,a.jsxs)("div",{className:"channel-detail-section",children:[(0,a.jsxs)("div",{className:"channel-detail-label",children:[(0,a.jsx)(m,{size:14}),(0,a.jsx)("span",{children:"频道 ID"})]}),(0,a.jsx)("div",{className:"channel-detail-value channel-detail-mono",children:H.name})]}),(0,a.jsxs)("div",{className:"channel-detail-section",children:[(0,a.jsxs)("div",{className:"channel-detail-label",children:[(0,a.jsx)(o.Edit2,{size:14}),(0,a.jsx)("span",{children:"备注名称"})]}),(0,a.jsx)("input",{type:"text",className:"input input-compact",placeholder:"输入备注名称",value:eo,onChange:e=>eh(e.target.value),onFocus:()=>eh(H.remark||""),onBlur:()=>eX(),onKeyDown:e=>{"Enter"===e.key&&e.currentTarget.blur()},maxLength:50})]}),(0,a.jsxs)("div",{className:"channel-detail-section",children:[(0,a.jsxs)("div",{className:"channel-detail-label",children:[(0,a.jsx)(u,{size:14}),(0,a.jsx)("span",{children:"创建时间"})]}),(0,a.jsx)("div",{className:"channel-detail-value",children:H.createdAt?new Date(H.createdAt).toLocaleDateString("zh-CN"):"-"})]})]}),(0,a.jsx)("div",{className:"channel-detail-footer",children:(0,a.jsx)("button",{className:"btn btn-danger btn-block",onClick:()=>{ed(!1),er(H),en.open()},children:"退出频道"})})]})})]})}],41222)}]);
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,89664,e=>{"use strict";let a=(0,e.i(56420).default)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);e.s(["Check",0,a],89664)},8734,e=>{"use strict";let a=(0,e.i(56420).default)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);e.s(["Copy",0,a],8734)},51921,e=>{"use strict";let a=(0,e.i(56420).default)("music",[["path",{d:"M9 18V5l12-2v13",key:"1jmyc2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["circle",{cx:"18",cy:"16",r:"3",key:"1hluhg"}]]);e.s(["Music",0,a],51921)},15170,80796,e=>{"use strict";var a=e.i(56420);let s=(0,a.default)("image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);e.s(["Image",0,s],15170);let t=(0,a.default)("film",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M7 3v18",key:"bbkbws"}],["path",{d:"M3 7.5h4",key:"zfgn84"}],["path",{d:"M3 12h18",key:"1i2n21"}],["path",{d:"M3 16.5h4",key:"1230mu"}],["path",{d:"M17 3v18",key:"in4fa5"}],["path",{d:"M17 7.5h4",key:"myr1c1"}],["path",{d:"M17 16.5h4",key:"go4c1d"}]]);e.s(["Film",0,t],80796)},79490,e=>{"use strict";let a=(0,e.i(56420).default)("pen",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]]);e.s(["Edit2",0,a],79490)},12796,11028,6933,e=>{"use strict";let a=(0,e.i(56420).default)("loader",[["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m16.2 7.8 2.9-2.9",key:"r700ao"}],["path",{d:"M18 12h4",key:"wj9ykh"}],["path",{d:"m16.2 16.2 2.9 2.9",key:"1bxg5t"}],["path",{d:"M12 18v4",key:"jadmvz"}],["path",{d:"m4.9 19.1 2.9-2.9",key:"bwix9q"}],["path",{d:"M2 12h4",key:"j09sii"}],["path",{d:"m4.9 4.9 2.9 2.9",key:"giyufr"}]]);e.s(["Loader",0,a],12796);var s=e.i(18050),t=e.i(71645),i=e.i(26091),r=e.i(51921),l=e.i(63676),n=e.i(26913);e.s(["default",0,function({item:e,isBackendReady:c,getFileDownloadUrl:o,onClose:d}){let[u,m]=(0,t.useState)(""),[h,p]=(0,t.useState)(!1),[f,x]=(0,t.useState)(""),[j,g]=(0,t.useState)("");return(0,t.useEffect)(()=>{if("text"!==e.subtype)return;let a=!1;return(m(""),g(""),c)?(p(!0),(async()=>{try{let s=await fetch(o(e.cid),{headers:{...await (0,n.getApiRequestHeaders)("GET",`/api/files/${e.cid}/download`),Range:"bytes=0-9999"}});if(!s.ok)throw Error("加载失败");let t=await s.text();a||m(t||"(文件为空)")}catch{a||m("加载失败")}finally{a||p(!1)}})(),()=>{a=!0}):void m("加载失败")},[o,c,e.cid,e.subtype]),(0,t.useEffect)(()=>{var a;if("image"!==(a=e.subtype)&&"video"!==a&&"audio"!==a)return void x("");if(x(""),g(""),!c)return void g("加载失败");let s="",t=!1;return(async()=>{try{let a=await fetch(o(e.cid),{headers:await (0,n.getApiRequestHeaders)("GET",`/api/files/${e.cid}/download`)});if(!a.ok)throw Error("加载失败");let i=URL.createObjectURL(await a.blob());s=i,t||x(i)}catch{t||g("加载失败")}})(),()=>{t=!0,s&&URL.revokeObjectURL(s)}},[o,c,e.cid,e.subtype]),(0,s.jsxs)("div",{className:"preview-overlay",onClick:d,children:[(0,s.jsx)("button",{type:"button",className:"preview-close",onClick:d,"aria-label":"关闭预览",children:(0,s.jsx)(l.X,{size:20})}),(0,s.jsxs)("div",{onClick:e=>e.stopPropagation(),children:["image"===e.subtype&&(0,s.jsx)("div",{className:"preview-media-wrapper",children:f?(0,s.jsx)("img",{src:f,alt:e.fileName}):j?(0,s.jsxs)("div",{className:"preview-unsupported",children:[(0,s.jsx)(i.FileText,{size:48,className:"preview-file-icon"}),(0,s.jsx)("p",{children:e.fileName}),(0,s.jsx)("p",{className:"preview-unsupported-hint",children:j})]}):(0,s.jsx)("div",{className:"preview-loading",children:(0,s.jsx)("div",{className:"preview-loading-spinner"})})}),"video"===e.subtype&&(0,s.jsx)("div",{className:"preview-media-wrapper",children:f?(0,s.jsx)("video",{src:f,controls:!0}):j?(0,s.jsxs)("div",{className:"preview-unsupported",children:[(0,s.jsx)(i.FileText,{size:48,className:"preview-file-icon"}),(0,s.jsx)("p",{children:e.fileName}),(0,s.jsx)("p",{className:"preview-unsupported-hint",children:j})]}):(0,s.jsx)("div",{className:"preview-loading",children:(0,s.jsx)("div",{className:"preview-loading-spinner"})})}),"audio"===e.subtype&&(0,s.jsxs)("div",{className:"preview-audio",children:[(0,s.jsx)("div",{className:"preview-audio-icon",children:(0,s.jsx)(r.Music,{size:36,color:"var(--accent)"})}),(0,s.jsx)("p",{className:"preview-audio-filename",children:e.fileName}),f?(0,s.jsx)("audio",{className:"preview-audio-player",src:f,controls:!0}):(0,s.jsx)("div",{className:"preview-text-loading",children:j?(0,s.jsx)("p",{children:j}):(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(a,{size:24,className:"preview-text-spinner"}),(0,s.jsx)("p",{children:"正在加载音频预览..."})]})})]}),"file"===e.subtype&&(0,s.jsxs)("div",{className:"preview-unsupported",children:[(0,s.jsx)(i.FileText,{size:48,className:"preview-file-icon"}),(0,s.jsx)("p",{children:e.fileName}),(0,s.jsx)("p",{className:"preview-unsupported-hint",children:"无法预览"})]}),"text"===e.subtype&&(0,s.jsxs)("div",{className:"preview-text-container",children:[(0,s.jsx)("div",{className:"preview-text-header",children:(0,s.jsx)("span",{children:e.fileName})}),h?(0,s.jsxs)("div",{className:"preview-text-loading",children:[(0,s.jsx)(a,{size:24,className:"preview-text-spinner"}),(0,s.jsx)("p",{children:"正在加载文本预览..."}),(0,s.jsx)("p",{className:"preview-text-loading-hint",children:"如果是初次预览,可能需要等待 P2P 网络同步"})]}):(0,s.jsx)("pre",{className:"preview-text",children:u||"(文件为空)"})]})]})]})}],11028),e.s(["getFileSubtype",0,function(e){let a=String(e||"").split(".").pop()?.toLowerCase()||"";return["jpg","jpeg","png","gif","webp","svg","bmp","ico","tiff","heic","heif"].includes(a)?"image":["mp4","webm","mov","avi","mkv","flv","wmv","m4v","mpeg","3gp"].includes(a)?"video":["mp3","wav","ogg","flac","aac","m4a","wma","opus"].includes(a)?"audio":["txt","md","js","ts","jsx","tsx","css","scss","less","json","xml","html","htm","yaml","yml","toml","ini","cfg","conf","log","sh","bash","py","rb","go","rs","java","c","cpp","h","hpp","cs","php","sql","graphql","env","gitignore","dockerfile","readme"].includes(a)?"text":"file"}],6933)},35965,e=>{"use strict";let a=(0,e.i(56420).default)("sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);e.s(["Sun",0,a],35965)},96699,e=>{"use strict";let a=(0,e.i(56420).default)("moon",[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]]);e.s(["Moon",0,a],96699)},11241,e=>{"use strict";let a=(0,e.i(56420).default)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);e.s(["ArrowLeft",0,a],11241)},59665,e=>{"use strict";var a=e.i(18050),s=e.i(71645),t=e.i(67228);let i=(0,e.i(56420).default)("menu",[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]]);e.i(22183);var r=e.i(5142);let l=(0,s.createContext)(null);e.s(["default",0,function({sidebar:e,headerTitle:n,headerRight:c,children:o}){let[d,u]=(0,r.useDisclosure)(!1),[m,h]=(0,s.useState)(!1),p=(0,t.useMediaQuery)("(max-width: 768px)"),f=()=>{p?u.open():h(!1)};return(0,a.jsx)(l.Provider,{value:{closeSidebar:u.close,openSidebar:f,isSidebarVisible:p?d:!m},children:(0,a.jsxs)("div",{className:"app-layout",children:[(0,a.jsx)("div",{className:`sidebar-overlay ${d?"visible":""}`,onClick:()=>u.close()}),(0,a.jsx)("div",{className:`sidebar ${d?"open":""} ${m?"collapsed":""}`,children:e({closeSidebar:u.close,openSidebar:f})}),(0,a.jsxs)("div",{className:"main-content",children:[(0,a.jsxs)("header",{className:"app-header",children:[(0,a.jsxs)("div",{className:"header-left",children:[(0,a.jsx)("button",{onClick:()=>{p?u.toggle():h(!m)},className:"btn btn-icon sidebar-toggle-btn","aria-label":p?"打开菜单":m?"展开侧边栏":"收起侧边栏",children:(0,a.jsx)(i,{size:16})}),n]}),(0,a.jsx)("div",{className:"header-right",children:c})]}),o]})]})})},"useAppShell",0,function(){let e=(0,s.useContext)(l);if(!e)throw Error("useAppShell must be used within AppShell");return e}],59665)},39626,27648,e=>{"use strict";var a=e.i(18050);let s=(0,e.i(56420).default)("panel-left-open",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m14 9 3 3-3 3",key:"8010ee"}]]);var t=e.i(59665);e.s(["default",0,function({label:e="打开侧边栏",className:i="",variant:r="primary"}){let{isSidebarVisible:l,openSidebar:n}=(0,t.useAppShell)();return l?null:(0,a.jsxs)("button",{type:"button",className:`btn ${"primary"===r?"btn-primary":""} sidebar-open-hint ${i}`.trim(),onClick:n,children:[(0,a.jsx)(s,{size:16}),e]})}],39626);var i=e.i(93957),r=e.i(71192);e.s(["default",0,function({className:e=""}){let s=(0,r.useUserStore)(e=>e.identity),t=(0,r.useUserStore)(e=>e.openLoginModal),l=(0,r.useUserStore)(e=>e.logoutUser);return(0,a.jsxs)("div",{className:`chat-sidebar-footer sidebar-account ${e}`,children:[(0,a.jsxs)("div",{className:"user-info",children:[(0,a.jsx)("img",{className:"user-avatar-img",src:(0,i.generateAvatar)(s?.address),alt:"avatar"}),(0,a.jsx)("span",{className:"user-name",title:s?.address,children:s?.displayName||"未登录"})]}),s?(0,a.jsx)("button",{className:"btn btn-ghost logout-btn",onClick:l,children:"退出"}):(0,a.jsx)("button",{className:"btn btn-primary login-btn",onClick:t,children:"登录"})]})}],27648)},26091,e=>{"use strict";let a=(0,e.i(56420).default)("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);e.s(["FileText",0,a],26091)},73474,e=>{"use strict";let a=(0,e.i(56420).default)("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]);e.s(["Trash2",0,a],73474)},66595,e=>{"use strict";let a=(0,e.i(56420).default)("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);e.s(["Search",0,a],66595)},25981,e=>{"use strict";let a=(0,e.i(56420).default)("upload",[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]);e.s(["Upload",0,a],25981)},26067,e=>{"use strict";let a=(0,e.i(56420).default)("folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);e.s(["Folder",0,a],26067)},67927,e=>{"use strict";let a=(0,e.i(56420).default)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);e.s(["ChevronRight",0,a],67927)},27627,e=>{"use strict";var a=e.i(18050),s=e.i(71645),t=e.i(25981),i=e.i(35965),r=e.i(96699),l=e.i(15170),n=e.i(73474),c=e.i(26067),o=e.i(80796),d=e.i(51921),u=e.i(67927),m=e.i(26091),h=e.i(63676),p=e.i(89664),f=e.i(8734),x=e.i(62368),j=e.i(56420);let g=(0,j.default)("arrow-up-down",[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]]),v=(0,j.default)("star",[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]]),y=(0,j.default)("files",[["path",{d:"M15 2h-4a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 2-2V8",key:"14sh0y"}],["path",{d:"M16.706 2.706A2.4 2.4 0 0 0 15 2v5a1 1 0 0 0 1 1h5a2.4 2.4 0 0 0-.706-1.706z",key:"1970lx"}],["path",{d:"M5 7a2 2 0 0 0-2 2v11a2 2 0 0 0 2 2h8a2 2 0 0 0 1.732-1",key:"l4dndm"}]]);var b=e.i(66595),N=e.i(79490),w=e.i(12796),k=e.i(11241);let C=(0,j.default)("info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);var M=e.i(59665),S=e.i(39626),$=e.i(27648),z=e.i(11028);e.i(4121);var F=e.i(57667),D=e.i(88361),L=e.i(47910),E=e.i(26913),T=e.i(64621);let I="链接格式不正确,请粘贴完整的 most://<cid>?filename=... 分享链接。",A="暂时没有发现在线种子。请确认分享者或其他下载者仍在线做种,稍后再检测。",U={"Link must be a valid most:// URL":"链接无法解析,请粘贴完整的 most://<cid>?filename=... 分享链接。","Link must use most:// protocol":"链接协议不正确,应以 most:// 开头。","Link path is not supported":"链接里不应包含路径,请使用 most://<cid>?filename=... 格式。","Invalid CID format":"CID 无效,请确认 most:// 后面的内容没有缺失或被截断。","Invalid CID format: CID v1 required":"CID 格式不符合 MostBox 要求,请确认分享链接完整。","CID digest must be 32 bytes":"CID 格式不符合 MostBox 要求,请确认分享链接完整。","filename is required":"链接缺少 filename 参数,请复制完整分享链接后再检测。"};function R(e=""){let a=String(e||"").trim();if(!a)return"请先粘贴 most:// 分享链接。";let s=function(e){let a;if(!e||"string"!=typeof e)return{cid:"",error:"Link must be a non-empty string"};try{a=new URL(e)}catch{return{cid:"",error:"Link must be a valid most:// URL"}}if("most:"!==a.protocol)return{cid:"",error:"Link must use most:// protocol"};if(a.pathname&&"/"!==a.pathname)return{cid:"",error:"Link path is not supported"};let s=a.hostname,t=a.searchParams.get("filename"),i=[...a.searchParams.keys()].find(e=>"filename"!==e),r=function(e){let a;if(!e||"string"!=typeof e)return{valid:!1,error:"CID must be a non-empty string"};try{a=T.CID.parse(e)}catch{return{valid:!1,error:"Invalid CID format"}}return 1!==a.version?{valid:!1,error:"Invalid CID format: CID v1 required"}:32!==a.multihash.digest.length?{valid:!1,error:"CID digest must be 32 bytes"}:{valid:!0}}(s);return r.valid?t?i?{cid:"",error:`Unsupported query parameter: ${i}`}:{cid:s,fileName:t}:{cid:"",error:"filename is required"}:{cid:"",error:r.error}}(a);if(!s.error)return s.fileName?.trim()?null:U["filename is required"];if(s.error.startsWith("Unsupported query parameter: ")){let e=s.error.slice(29);return`链接包含暂不支持的参数 ${e},请只保留 filename。`}return U[s.error]||I}var O=e.i(3593),P=e.i(71192);e.i(22183);var q=e.i(5142),B=e.i(81317),V=e.i(6933);async function H(e){return function(e={},a=""){if("TimeoutError"===a)return"检测等待超时,暂时没有等到在线种子响应。请确认分享者或其他下载者仍在线做种,稍后再检测。";if(!e.status)return"无法连接本地节点,请确认 MostBox 后端正在运行后再检测。";if(404===e.status)return"当前后端还没有检测接口,请重启 MostBox 后端后再试。";switch(e.code){case"VALIDATION_ERROR":return I;case"CONFLICT":return e.error?`${e.error},请先处理同名文件后再下载。`:"下载目录已有同名文件,请先重命名或移走后再检测。";case"PEER_NOT_FOUND":return A;case"PERMISSION_ERROR":return e.error?`下载目录不可写:${e.error}`:"下载目录不可写,请检查目录权限后再检测。";case"ENGINE_NOT_INITIALIZED":return"本地节点还没有启动完成,请稍等几秒后重新检测。"}return 503===e.status?A:e.status>=500?"本地节点检测时出错,请稍后重试或查看节点日志。":e.error?`检测未通过:${e.error}`:"检测未通过,请确认链接完整、发布者在线且本机网络正常。"}(await (0,E.getApiErrorPayload)(e),e&&"object"==typeof e&&"name"in e?String(e.name):"")}let _={listPublishedFiles:()=>E.api.get("/api/files").json(),listTrashFiles:()=>E.api.get("/api/trash").json(),deletePublishedFile:e=>E.api.delete(`/api/files/${e}`).json(),restoreTrashFile:e=>E.api.post(`/api/trash/${e}/restore`).json(),permanentDeleteTrashFile:e=>E.api.delete(`/api/trash/${e}`).json(),emptyTrash:()=>E.api.delete("/api/trash").json(),toggleStar:e=>E.api.post(`/api/files/${e}/star`).json(),getConfig:()=>E.api.get("/api/config").json(),getDataPath:()=>E.api.get("/api/config/data-path").json(),getNetworkAddresses:()=>E.api.get("/api/network").json(),saveConfig:e=>E.api.post("/api/config",{json:e}).json(),async publishFile(e,a){let s=new FormData;s.append("file",e,a||e.name);let t=await E.api.post("/api/publish",{body:s});if(!t.ok)throw Error((await t.json().catch(()=>({error:t.statusText}))).error||"Request failed");return t.json()},checkDownload:e=>E.api.post("/api/download/check",{json:{link:e},timeout:15e3}).json(),downloadFile:e=>E.api.post("/api/download",{json:{link:e}}).json(),cancelDownload:e=>E.api.post("/api/download/cancel",{json:{taskId:e}}).json(),getFileDownloadUrl:e=>(0,E.getApiUrl)(`/api/files/${e}/download`),moveFile:(e,a)=>E.api.post("/api/move",{json:{cid:e,newFileName:a}}).json(),renameFolder:(e,a)=>E.api.post("/api/folder/rename",{json:{oldPath:e,newPath:a}}).json()};function W(e){return!e||e<=0?"0 B":e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:e<0x40000000?`${(e/1048576).toFixed(1)} MB`:`${(e/0x40000000).toFixed(2)} GB`}function X(e){let a=e.lastIndexOf("/");return -1===a?{folder:"",name:e}:{folder:e.substring(0,a),name:e.substring(a+1)}}function G(e){return e?[{path:"",name:"全部内容"},...e.split("/").filter(Boolean).map((e,a,s)=>({path:s.slice(0,a+1).join("/"),name:e}))]:[]}function K({file:e,isSelected:s,onSelect:t,onPreview:i}){let r=(0,V.getFileSubtype)(e.fileName),n=(0,a.jsx)(m.FileText,{size:24,color:"#fff"});return"image"===r?n=(0,a.jsx)(l.Image,{size:24,color:"#fff"}):"video"===r?n=(0,a.jsx)(o.Film,{size:24,color:"#fff"}):"audio"===r&&(n=(0,a.jsx)(d.Music,{size:24,color:"#fff"})),(0,a.jsxs)("div",{"data-id":e.cid,onClick:()=>t(e.cid),onDoubleClick:()=>i(e),className:`card ${s?"selected":""}`,children:[(0,a.jsx)("div",{className:`card-icon ${e.starred?"starred":"file"}`,children:n}),(0,a.jsx)("p",{className:"card-name",children:X(e.fileName).name})]})}function Z({folder:e,onClick:s}){return(0,a.jsxs)("div",{onClick:s,className:"card",children:[(0,a.jsx)("div",{className:"card-icon folder",children:(0,a.jsx)(c.Folder,{size:28,color:"#fff"})}),(0,a.jsx)("p",{className:"card-name",children:e.name})]})}function J({items:e,allFolders:t,currentPath:i,onMove:r,onClose:l}){let[n,o]=(0,s.useState)(""),[d,u]=(0,s.useState)(i),m=G(n);return(0,a.jsx)(F.ModalOverlay,{onClose:l,children:(0,a.jsxs)("div",{className:"move-modal",onClick:e=>e.stopPropagation(),children:[(0,a.jsxs)("div",{className:"modal-header",children:[(0,a.jsx)("h3",{children:"移动到"}),(0,a.jsx)("button",{onClick:l,className:"btn btn-icon",children:(0,a.jsx)(h.X,{size:18})})]}),(0,a.jsxs)("p",{className:"move-modal-desc",children:["已选 ",e.length," 个项目"]}),(0,a.jsx)("div",{className:"move-new-folder",children:(0,a.jsx)("input",{type:"text",className:"input",value:d,onChange:e=>u(e.target.value),placeholder:"输入路径创建嵌套文件夹"})}),(0,a.jsx)("p",{className:"move-modal-hint",children:"如 图片/壁纸"}),(0,a.jsx)("div",{className:"move-breadcrumb",children:m.map((e,t)=>(0,a.jsxs)(s.default.Fragment,{children:[t>0&&(0,a.jsx)("span",{className:"breadcrumb-separator",children:"/"}),(0,a.jsx)("button",{onClick:()=>{o(e.path),u(e.path)},className:`move-breadcrumb-btn ${n===e.path&&!d?"active":""}`,children:e.name},e.path)]},e.path))}),(0,a.jsxs)("div",{className:"move-folder-list",children:[0===t.filter(e=>{if(""===n)return!e.path.includes("/");let a=n+"/";return!!e.path.startsWith(a)&&!e.path.substring(a.length).includes("/")}).length&&(0,a.jsx)("p",{className:"move-modal-empty",children:"该目录下没有子文件夹"}),t.filter(e=>{if(""===n)return!e.path.includes("/");let a=n+"/";return!!e.path.startsWith(a)&&!e.path.substring(a.length).includes("/")}).map(e=>(0,a.jsxs)("button",{onClick:()=>o(e.path),className:`move-folder-item ${n===e.path&&!d?"selected":""}`,children:[(0,a.jsx)(c.Folder,{size:16}),(0,a.jsx)("span",{children:e.name})]},e.path))]}),(0,a.jsxs)("div",{className:"modal-actions",children:[(0,a.jsx)("button",{onClick:l,className:"btn btn-secondary",children:"取消"}),(0,a.jsx)("button",{onClick:()=>{r(n||d.trim())},className:"btn btn-primary",children:"移动"})]})]})})}e.s(["default",0,function(){let e,l,c,o=(0,O.useAppStore)(e=>e.isDarkMode),d=(0,O.useAppStore)(e=>e.setIsDarkMode),j=(0,O.useAppStore)(e=>e.addToast),T=(0,O.useAppStore)(e=>e.hasBackend),I=(0,O.useAppStore)(e=>e.openConnectModal),A=(0,P.useUserStore)(e=>e.identity),U=(0,P.useUserStore)(e=>e.openLoginModal),[Q,Y]=(0,s.useState)([]),[ee,ea]=(0,s.useState)([]),[es,et]=(0,s.useState)(null),[ei,er]=(0,s.useState)("all"),[el,en]=(0,s.useState)(!1),[ec,eo]=(0,s.useState)([]),[ed,eu]=(0,s.useState)(null),[em,eh]=(0,s.useState)(null),[ep,ef]=(0,q.useDisclosure)(!1),[ex,ej]=(0,s.useState)(""),[eg,ev]=(0,s.useState)(null),[ey,eb]=(0,s.useState)(!1),[eN,ew]=(0,s.useState)([]),[ek,eC]=(0,q.useDisclosure)(!1),[eM,eS]=(0,s.useState)(""),{copy:e$,copied:ez}=(0,B.useClipboard)({timeout:2e3}),[eF,eD]=(0,q.useDisclosure)(!1),[eL,eE]=(0,s.useState)(null),[eT,eI]=(0,s.useState)(null),[eA,eU]=(0,s.useState)(!1),eR=!0===T,eO=es||"",eP=(e=new Set,Q.forEach(a=>{let{folder:s}=X(a.fileName),t=s.split("/").filter(Boolean),i="";for(let a of t)i+=(i?"/":"")+a,e.add(i)}),[...e].sort()),{folders:eq,files:eB}={folders:(l=eO?eO+"/":"",eP.filter(e=>{let a=e.toLowerCase().startsWith(l.toLowerCase()),s=e.substring(l.length);return a&&!s.includes("/")}).map(e=>({name:e.substring(l.length),path:e}))),files:Q.filter(e=>X(e.fileName).folder===eO)};function eV(){return!!eR||(I(),!1)}function eH(){return!!A||(U(),!1)}let e_=eM?Q.filter(e=>X(e.fileName).name.toLowerCase().includes(eM.toLowerCase())):eB,eW=async()=>{if(!eR||!A)return void Y([]);try{let e=await _.listPublishedFiles();Y(e||[])}catch{Y([])}},eX=async()=>{if(!eR||!A)return void ea([]);try{let e=await _.listTrashFiles();ea(e||[])}catch{ea([])}},eG=e=>{eo(a=>a.includes(e)?a.filter(a=>a!==e):[...a,e])},eK=async e=>{if(eH()&&eV())try{await _.restoreTrashFile(e),j("已恢复","success"),eW(),eX()}catch(e){j(await (0,E.getApiErrorMessage)(e,"恢复失败"),"error")}},eZ=async()=>{!eH()||eV()&&eE({title:"清空回收站",message:"确定要清空回收站吗?此操作不可恢复!",confirmText:"清空",danger:!0,onConfirm:async()=>{eE(null);try{await _.emptyTrash(),j("回收站已清空","success"),eX()}catch(e){j(await (0,E.getApiErrorMessage)(e,"清空失败"),"error")}}})},eJ=async e=>{if(eH()&&eV())try{let a=await _.toggleStar(e);Y(s=>s.map(s=>s.cid===e?{...s,starred:a.starred}:s)),j(a.starred?"已收藏":"已取消收藏","success")}catch(e){j(await (0,E.getApiErrorMessage)(e,"操作失败"),"error")}},eQ=async()=>{if(!eH()||!eV())return;let e="trash"===ei;eE({title:e?"永久删除":"批量删除",message:e?`确定要永久删除选中的 ${ec.length} 个项目吗?此操作不可恢复!`:`确定要删除选中的 ${ec.length} 个项目吗?`,confirmText:e?"永久删除":"删除",danger:!0,onConfirm:async()=>{eE(null);try{for(let a of ec)e?await _.permanentDeleteTrashFile(a):a.startsWith("__")||await _.deletePublishedFile(a);eo([]),j(e?"已永久删除":"已删除","success"),eW(),eX()}catch(e){j(await (0,E.getApiErrorMessage)(e,"删除失败"),"error")}}})},eY=async e=>{if(eH()&&eV())try{for(let a of ec){let s=Q.find(e=>e.cid===a);if(!s)continue;let{name:t}=X(s.fileName),i=e?`${e}/${t}`:t;s.fileName!==i&&await _.moveFile(a,i)}eo([]),eD.close(),j("已移动","success"),eW()}catch(e){j(await (0,E.getApiErrorMessage)(e,"移动失败"),"error")}},e0=e=>{let a=!!e.path,s=a?e.name:X(e.fileName).name;eI({title:a?"重命名文件夹":"重命名文件",placeholder:"请输入新名称",defaultValue:s,confirmText:"重命名",onConfirm:async t=>{if(t!==s&&eH()&&eV()){eU(!0);try{if(a){let a=e.path.lastIndexOf("/"),s=-1!==a?e.path.substring(0,a):"",i=s?`${s}/${t}`:t;await _.renameFolder(e.path,i),j("已重命名","success"),eW(),aa(i)}else{let{folder:a}=X(e.fileName),s=a?`${a}/${t}`:t;await _.moveFile(e.cid,s),j("已重命名","success"),eW()}eI(null)}catch(e){j(await (0,E.getApiErrorMessage)(e,"重命名失败"),"error")}finally{eU(!1)}}}})},e1=async e=>{if(!A){U(),j("请先登录后发布文件","warning");return}if(!eV())return;let a=eO?eO+"/":"",s=[];for(let t of Array.from(e)){let e=a+t.name;if(Q.some(a=>a.fileName===e)){j(`${t.name} 已存在`,"warning");continue}let i=`upload_${Date.now()}_${Math.random().toString(36).slice(2,8)}`,r={id:i,fileName:t.name,progress:0,type:"upload",status:"uploading"};s.push(r),ew(e=>[...e,r]),s.length>0&&eC.open();try{(await _.publishFile(t,e)).alreadyExists?(ew(e=>e.map(e=>e.id===i?{...e,status:"completed"}:e)),j(`${t.name} 已存在`,"warning")):(ew(e=>e.map(e=>e.id===i?{...e,progress:100,status:"completed"}:e)),j(`${t.name} 已添加到本地`,"success"))}catch(e){ew(e=>e.map(e=>e.id===i?{...e,status:"error"}:e)),j(await (0,E.getApiErrorMessage)(e,`发布失败: ${t.name}`),"error")}}setTimeout(()=>{ew(e=>e.filter(e=>"completed"!==e.status&&"error"!==e.status&&"cancelled"!==e.status))},3e3),eW()},[e2,e6]=(0,s.useState)(!1),e4=ex.trim(),e9=eg?.status==="success"&&eg.link===e4,e5=()=>{ef.close(),ev(null)},e3=async()=>{let e=R(e4);if(e){ev({status:"error",link:e4,message:e}),j(e,"warning");return}if(!ey&&!e2&&eH()&&eV()){eb(!0),ev(null);try{let e=await _.checkDownload(e4),a=e.alreadyExists?`${e.fileName} 已在本机`:`${e.fileName} 可下载`;ev({status:"success",link:e4,message:a}),j(e.alreadyExists?`${e.fileName} 已存在`:"检测通过",e.alreadyExists?"warning":"success")}catch(a){let e=await H(a);ev({status:"error",link:e4,message:e}),j(e,"error")}finally{eb(!1)}}},e7=async()=>{if(!A){U(),j("请先登录后下载文件","warning");return}if(!eV())return;let e=R(e4);if(e)return void j(e,"warning");if(!e9)return void j("请先检测链接可用性","warning");if(!e2){e6(!0);try{let e=await _.downloadFile(e4);if(ej(""),ev(null),e5(),e.alreadyExists)j(`${e.fileName} 已存在`,"warning");else{let a={id:e.taskId,fileName:"下载文件",progress:0,type:"download",status:"downloading"};ew(e=>[...e,a]),eC.open(),j("下载已开始","info")}}catch(e){j(await (0,E.getApiErrorMessage)(e,"下载失败"),"error")}finally{e6(!1)}}},e8=async e=>{if(eH()&&eV()&&"download"===e.type&&"downloading"===e.status){ew(a=>a.map(a=>a.id===e.id?{...a,status:"cancelling"}:a));try{await _.cancelDownload(e.id)}catch(a){ew(a=>a.map(a=>a.id===e.id?{...a,status:"downloading"}:a)),j(await (0,E.getApiErrorMessage)(a,"取消失败"),"error")}}},ae=async e=>{if(eH()&&eV())try{let a=await fetch(_.getFileDownloadUrl(e.cid),{headers:await (0,E.getApiRequestHeaders)("GET",`/api/files/${e.cid}/download`)});if(!a.ok)throw Error("获取文件失败");let s=await a.blob(),t=window.showSaveFilePicker;if(t){let a=await t({suggestedName:e.fileName}),i=await a.createWritable();await i.write(s),await i.close(),j("文件已保存","success")}else{let a=URL.createObjectURL(s),t=document.createElement("a");t.href=a,t.download=e.fileName,document.body.appendChild(t),t.click(),document.body.removeChild(t),URL.revokeObjectURL(a),j("文件已下载","success")}}catch(e){"AbortError"!==e.name&&j("保存失败: "+e.message,"error")}},aa=e=>{et(e||null),eo([])};(0,s.useEffect)(()=>{if(!0!==T)return;let e=null,a=!1;return(async()=>{if(e=new WebSocket(await (0,E.getAuthenticatedWebSocketUrl)("/ws")),a)return e.close();e.onmessage=e=>{try{let{event:a,data:s}=JSON.parse(e.data);if("publish:success"===a||"download:success"===a){eW();let e=s.taskId||s.fileName;ew(a=>a.map(a=>a.id===e||a.fileName===s.fileName?{...a,progress:100,status:"completed"}:a)),"download:success"===a&&(s.alreadyExists?j(`${s.fileName} 已存在`,"warning"):j(`${s.fileName} 下载完成`,"success"),setTimeout(()=>{ew(a=>a.filter(a=>a.id!==e||"completed"!==a.status))},3e3))}"publish:progress"===a&&ew(e=>e.map(e=>{if(s.file&&e.fileName===s.file&&"upload"===e.type){let a=50;return"calculating-cid"===s.stage?a=25:"uploading"===s.stage?a=75:"complete"===s.stage&&(a=100),{...e,progress:a}}return e})),"download:progress"===a&&ew(e=>e.map(e=>e.id===s.taskId?{...e,progress:s.percent||0,loaded:s.loaded,total:s.total}:e)),"download:error"===a&&(ew(e=>e.map(e=>e.id===s.taskId?{...e,status:"error"}:e)),j(`下载失败: ${s.error}`,"error")),"download:status"===a&&ew(e=>e.map(e=>e.id===s.taskId?{...e,fileName:s.file||e.fileName}:e)),"download:cancelled"===a&&(ew(e=>e.map(e=>e.id===s.taskId?{...e,status:"cancelled"}:e)),j("下载已取消","warning"))}catch(e){console.warn("[App WS] Failed to parse message:",e.message)}}})(),()=>{a=!0,e?.close()}},[T,A?.address]),(0,s.useEffect)(()=>{if(!0===T&&A){eW(),eX();return}!1===T&&(Y([]),ea([]))},[T,A?.address]),(0,s.useEffect)(()=>{A||(eo([]),eu(null),eh(null),ej(""),ev(null),ew([]),eS(""),et(null),er("all"))},[A?.address]);let as="all"===ei?e_:"starred"===ei?Q.filter(e=>e.starred&&X(e.fileName).name.toLowerCase().includes(eM.toLowerCase())):ee.filter(e=>X(e.fileName).name.toLowerCase().includes(eM.toLowerCase())),at="starred"===ei?[]:eq.filter(e=>e.name.toLowerCase().includes(eM.toLowerCase())),ai=G(eO);return(0,a.jsxs)(M.default,{sidebar:({closeSidebar:e})=>(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"sidebar-header sidebar-header-link",onClick:()=>window.location.href="/",children:[(0,a.jsx)(k.ArrowLeft,{size:18}),(0,a.jsx)("h1",{children:"MOST PEOPLE"})]}),(0,a.jsx)("nav",{className:"sidebar-nav",children:[{id:"all",icon:(0,a.jsx)(y,{size:18}),label:"本地"},{id:"starred",icon:(0,a.jsx)(v,{size:18}),label:"收藏"},{id:"trash",icon:(0,a.jsx)(n.Trash2,{size:18}),label:"回收站"}].map(s=>(0,a.jsxs)("button",{onClick:()=>{er(s.id),et(null),eo([]),eS(""),e()},className:`sidebar-nav-btn ${ei===s.id?"active":""}`,children:[s.icon,(0,a.jsx)("span",{children:s.label})]},s.id))}),(0,a.jsx)($.default,{})]}),headerTitle:(0,a.jsx)("h2",{className:"header-title",children:"all"===ei?"本地":"starred"===ei?"收藏":"回收站"}),headerRight:(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"search-box",children:[(0,a.jsx)(b.Search,{size:14}),(0,a.jsx)("input",{type:"text",value:eM,onChange:e=>eS(e.target.value),placeholder:"搜索..."}),eM&&(0,a.jsx)("button",{onClick:()=>eS(""),children:(0,a.jsx)(h.X,{size:12})})]}),"trash"===ei&&ee.length>0&&(0,a.jsx)("button",{onClick:eZ,className:"btn btn-sm btn-empty-trash",children:"清空回收站"}),(0,a.jsx)("button",{onClick:()=>eC.open(),className:"btn btn-icon",children:(0,a.jsx)(g,{size:16})}),(0,a.jsx)("button",{onClick:()=>d(!o),className:"btn btn-icon",children:o?(0,a.jsx)(i.Sun,{size:16}):(0,a.jsx)(r.Moon,{size:16})})]}),children:["all"===ei&&(0,a.jsxs)("div",{className:"action-grid",children:[(0,a.jsxs)("div",{className:`action-card upload ${el?"drag-over":""}`,onDragOver:e=>{e.preventDefault(),en(!0)},onDragLeave:()=>en(!1),onDrop:e=>{e.preventDefault(),en(!1),eH()&&eV()&&e1(e.dataTransfer.files)},children:[(0,a.jsx)("input",{type:"file",multiple:!0,onClick:e=>{eH()&&eV()||e.preventDefault()},onChange:e=>e1(e.target.files),className:"action-card-input"}),(0,a.jsx)(t.Upload,{size:20,className:"action-grid-icon"}),(0,a.jsx)("p",{children:"发布文件"})]}),(0,a.jsxs)("div",{className:"action-card action-card-download",onClick:()=>{eH()&&eV()&&ef.open()},children:[(0,a.jsx)(x.Download,{size:20,className:"action-grid-icon"}),(0,a.jsx)("p",{children:"下载文件"})]})]}),"all"===ei&&(0,a.jsx)("div",{className:"breadcrumb",children:eO?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("button",{onClick:()=>aa(""),children:"全部内容"}),ai.slice(1).map((e,t)=>(0,a.jsxs)(s.default.Fragment,{children:[(0,a.jsx)(u.ChevronRight,{size:12}),(0,a.jsx)("button",{onClick:()=>aa(e.path),className:t===ai.length-2?"current":"",children:e.name}),t===ai.length-2&&(0,a.jsx)("button",{onClick:()=>e0(e),className:"breadcrumb-edit-btn",children:(0,a.jsx)(N.Edit2,{size:12})})]},e.path))]}):null}),(0,a.jsxs)("div",{className:"content-grid",children:["trash"===ei&&(0===as.length?(0,a.jsxs)("div",{className:"empty-state app-empty-state",children:[(0,a.jsx)("p",{children:eM?"未找到相关文件":"回收站是空的"}),(0,a.jsx)(S.default,{label:"打开文件导航"})]}):(0,a.jsx)("div",{className:"file-grid",children:as.map(e=>{var s;return(0,a.jsxs)("div",{onClick:()=>eo(a=>a.includes(e.cid)?a.filter(a=>a!==e.cid):[...a,e.cid]),onDoubleClick:()=>eK(e.cid),className:`card ${ec.includes(e.cid)?"selected":""}`,children:[(0,a.jsx)("div",{className:"card-icon trash",children:(0,a.jsx)(m.FileText,{size:24,color:"#fff"})}),(0,a.jsx)("p",{className:"card-name",children:X(e.fileName).name}),(0,a.jsxs)("p",{className:"card-date",children:["删除于 ",(s=e.deletedAt)?new Date(s).toLocaleDateString("zh-CN"):""]})]},e.cid)})})),"trash"!==ei&&(0===as.length&&0===at.length?(0,a.jsxs)("div",{className:"empty-state app-empty-state",children:[(0,a.jsx)("p",{children:eM?"未找到相关文件":"starred"===ei?"暂无的收藏":"暂无本地文件"}),(0,a.jsx)(S.default,{label:"打开文件导航"})]}):(0,a.jsxs)("div",{className:"file-grid",children:[at.map(e=>(0,a.jsx)(Z,{folder:e,onClick:()=>aa(e.path)},e.path)),as.map(e=>(0,a.jsx)(K,{file:e,isSelected:ec.includes(e.cid),onSelect:eG,onPreview:e=>eu({...e,subtype:(0,V.getFileSubtype)(e.fileName)})},e.cid))]}))]}),eL&&(0,a.jsx)(D.ConfirmModal,{title:eL.title,message:eL.message,confirmText:eL.confirmText,danger:eL.danger,closeOnOverlayClick:eL.danger,onConfirm:eL.onConfirm,onClose:()=>eE(null)}),eT&&(0,a.jsx)(L.InputModal,{title:eT.title,placeholder:eT.placeholder,defaultValue:eT.defaultValue,confirmText:eT.confirmText,isLoading:eA,onConfirm:eT.onConfirm,onClose:()=>eI(null)}),eF&&(0,a.jsx)(J,{items:ec.map(e=>Q.find(a=>a.cid===e)).filter(Boolean),allFolders:eP.map(e=>({path:e,name:e.split("/").pop()})),currentPath:eO,onMove:eY,onClose:()=>eD.close()}),em&&(0,a.jsx)(F.ModalOverlay,{onClose:()=>eh(null),children:(0,a.jsxs)("div",{className:"share-modal",onClick:e=>e.stopPropagation(),children:[(0,a.jsxs)("div",{className:"modal-header",children:[(0,a.jsx)("h3",{children:"分享链接"}),(0,a.jsx)("button",{onClick:()=>eh(null),className:"btn btn-icon",children:(0,a.jsx)(h.X,{size:18})})]}),(0,a.jsxs)("div",{className:"share-link-box",children:[(0,a.jsx)("div",{className:"share-link-text",children:`most://${em.cid}?filename=${encodeURIComponent(em.fileName)}`}),(0,a.jsx)("button",{onClick:()=>{e$(`most://${em.cid}?filename=${encodeURIComponent(em.fileName)}`)},className:`btn btn-circle btn-primary ${ez?"copied":""}`,children:ez?(0,a.jsx)(p.Check,{size:18}):(0,a.jsx)(f.Copy,{size:18})})]}),(0,a.jsx)("div",{className:"share-storage-note",children:(0,a.jsx)("span",{children:"本机在线时可下载;下载者完成后会默认继续做种。"})})]})}),ep&&(0,a.jsx)(F.ModalOverlay,{onClose:e5,children:(0,a.jsxs)("div",{className:"download-modal",onClick:e=>e.stopPropagation(),children:[(0,a.jsxs)("div",{className:"modal-header",children:[(0,a.jsx)("h3",{children:"下载文件"}),(0,a.jsx)("button",{onClick:e5,className:"btn btn-icon",children:(0,a.jsx)(h.X,{size:18})})]}),(0,a.jsxs)("div",{className:"download-link-row",children:[(0,a.jsx)("input",{type:"text",className:"input",value:ex,onChange:e=>{ej(e.target.value),ev(null)},placeholder:"输入 most:// 链接"}),(0,a.jsxs)("button",{type:"button",onClick:e3,disabled:!e4||ey||e2,className:"btn btn-secondary download-check-btn",children:[ey?(0,a.jsx)(w.Loader,{size:14,className:"spin"}):e9?(0,a.jsx)(p.Check,{size:14}):(0,a.jsx)(b.Search,{size:14}),ey?"检测中...":e9?"已通过":"检测"]})]}),eg&&(0,a.jsxs)("div",{className:`download-check-status ${eg.status}`,children:["success"===eg.status?(0,a.jsx)(p.Check,{size:14}):(0,a.jsx)(C,{size:14}),(0,a.jsx)("span",{children:eg.message})]}),(0,a.jsxs)("button",{onClick:e7,disabled:!e9||e2||ey,className:"btn btn-info btn-full",children:[e2?(0,a.jsx)(w.Loader,{size:14,className:"spin"}):(0,a.jsx)(x.Download,{size:14}),e2?"下载中...":"开始下载"]})]})}),ed&&(0,a.jsx)(z.default,{item:ed,isBackendReady:eR,getFileDownloadUrl:_.getFileDownloadUrl,onClose:()=>eu(null)}),ec.length>0&&(0,a.jsxs)("div",{className:"batch-bar",children:[(0,a.jsxs)("span",{className:"batch-info",children:["已选 ",ec.length," 项"]}),(0,a.jsx)("button",{onClick:()=>eo([]),className:"batch-dismiss",children:(0,a.jsx)(h.X,{size:16})}),(0,a.jsx)("div",{className:"batch-divider"}),"trash"===ei?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("button",{onClick:async()=>{!eH()||eV()&&(await Promise.all(ec.map(e=>_.restoreTrashFile(e))),eo([]),j("已恢复","success"),eW(),eX())},className:"btn btn-sm",children:"恢复"}),(0,a.jsx)("button",{onClick:eQ,className:"btn btn-sm btn-danger",children:"永久删除"})]}):(0,a.jsxs)(a.Fragment,{children:[1===ec.length&&(c=Q.find(e=>e.cid===ec[0]))&&"file"!==(0,V.getFileSubtype)(c.fileName)&&(0,a.jsx)("button",{onClick:()=>{let e=Q.find(e=>e.cid===ec[0]);if(e){let a=(0,V.getFileSubtype)(e.fileName);eu({...e,subtype:a})}},className:"btn btn-sm",children:"预览"}),(0,a.jsx)("button",{onClick:()=>{let e=ec.some(e=>{let a=Q.find(a=>a.cid===e);return a&&!a.starred});ec.forEach(a=>{let s=Q.find(e=>e.cid===a);s&&(e?!s.starred:s.starred)&&eJ(a)})},className:"btn btn-sm btn-star",children:"收藏"}),1===ec.length&&(0,a.jsx)("button",{onClick:()=>{let e=Q.find(e=>e.cid===ec[0]);e&&e0(e)},className:"btn btn-sm",children:"重命名"}),(0,a.jsx)("button",{onClick:()=>eD.open(),className:"btn btn-sm btn-move",children:"移动"}),(0,a.jsx)("button",{onClick:eQ,className:"btn btn-sm btn-danger",children:"删除"}),1===ec.length&&(0,a.jsx)("button",{onClick:()=>eh(Q.find(e=>e.cid===ec[0])),className:"btn btn-sm",children:"分享"}),1===ec.length&&(0,a.jsx)("button",{onClick:()=>{let e=Q.find(e=>e.cid===ec[0]);e&&ae(e)},className:"btn btn-sm",children:"另存为"})]})]}),ek&&(0,a.jsx)(F.ModalOverlay,{onClose:()=>eC.close(),closeOnOverlayClick:!0,children:(0,a.jsxs)("div",{className:"transfer-modal",onClick:e=>e.stopPropagation(),children:[(0,a.jsxs)("div",{className:"modal-header",children:[(0,a.jsx)("h3",{children:"传输"}),(0,a.jsx)("button",{onClick:()=>eC.close(),className:"btn btn-icon",children:(0,a.jsx)(h.X,{size:18})})]}),0===eN.length?(0,a.jsx)("div",{className:"empty-transfer",children:"暂无传输"}):eN.map(e=>(0,a.jsxs)("div",{className:"transfer-item",children:[(0,a.jsxs)("div",{className:"transfer-item-header",children:["upload"===e.type?(0,a.jsx)(t.Upload,{size:14}):(0,a.jsx)(x.Download,{size:14}),(0,a.jsx)("span",{className:"transfer-item-name",children:e.fileName}),"downloading"===e.status&&"download"===e.type&&(0,a.jsx)("button",{onClick:()=>e8(e),className:"transfer-item-cancel",children:(0,a.jsx)(h.X,{size:14})})]}),(0,a.jsxs)("div",{className:"transfer-progress-row",children:[(0,a.jsx)("progress",{className:`transfer-progress-meter ${"download"===e.type?"download":""} ${"error"===e.status?"error":""} ${"cancelled"===e.status?"cancelled":""}`,value:Math.max(0,Math.min(100,e.progress)),max:100,"aria-label":`${e.fileName} 传输进度`}),(0,a.jsx)("span",{className:"transfer-progress-text",children:"completed"===e.status?"完成":"error"===e.status?"失败":"cancelled"===e.status?"已取消":"cancelling"===e.status?"取消中":e.loaded&&e.total?`${W(e.loaded)}/${W(e.total)}`:`${e.progress}%`})]})]},e.id))]})})]})}],27627)}]);
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,18566,(t,e,r)=>{e.exports=t.r(76562)},10566,t=>{"use strict";let e=(0,t.i(56420).default)("notebook-pen",[["path",{d:"M13.4 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-7.4",key:"re6nr2"}],["path",{d:"M2 6h4",key:"aawbzj"}],["path",{d:"M2 10h4",key:"l0bgd4"}],["path",{d:"M2 14h4",key:"1gsvsf"}],["path",{d:"M2 18h4",key:"1bu2t1"}],["path",{d:"M21.378 5.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",key:"pqwjuv"}]]);t.s(["NotebookPen",0,e],10566)},66595,t=>{"use strict";let e=(0,t.i(56420).default)("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);t.s(["Search",0,e],66595)},31214,t=>{"use strict";let e=(0,t.i(56420).default)("cloud",[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]]);t.s(["Cloud",0,e],31214)},16327,6537,77816,t=>{"use strict";var e=t.i(56420);let r=(0,e.default)("chevron-down",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);t.s(["ChevronDown",0,r],16327);let a=(0,e.default)("lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);t.s(["Lock",0,a],6537);var s=t.i(22315);function n(t){let e;if(!t)return"";let r=(0,s.default)(Number(t)),a=r.hour();return e=a>=0&&a<3?"凌晨":a>=3&&a<6?"拂晓":a>=6&&a<9?"早晨":a>=9&&a<12?"上午":a>=12&&a<15?"下午":a>=15&&a<18?"傍晚":a>=18&&a<21?"晚上":"深夜",r.format(`YYYY年M月D日 ${e}h:m`)}t.s(["formatDate",0,n,"formatTime",0,n],77816)},26091,t=>{"use strict";let e=(0,t.i(56420).default)("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);t.s(["FileText",0,e],26091)},73474,t=>{"use strict";let e=(0,t.i(56420).default)("trash-2",[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]]);t.s(["Trash2",0,e],73474)},67927,t=>{"use strict";let e=(0,t.i(56420).default)("chevron-right",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);t.s(["ChevronRight",0,e],67927)},26067,t=>{"use strict";let e=(0,t.i(56420).default)("folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]]);t.s(["Folder",0,e],26067)},25981,t=>{"use strict";let e=(0,t.i(56420).default)("upload",[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]]);t.s(["Upload",0,e],25981)},96699,t=>{"use strict";let e=(0,t.i(56420).default)("moon",[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]]);t.s(["Moon",0,e],96699)},35965,t=>{"use strict";let e=(0,t.i(56420).default)("sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);t.s(["Sun",0,e],35965)},11241,t=>{"use strict";let e=(0,t.i(56420).default)("arrow-left",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);t.s(["ArrowLeft",0,e],11241)},59665,t=>{"use strict";var e=t.i(18050),r=t.i(71645),a=t.i(67228);let s=(0,t.i(56420).default)("menu",[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]]);t.i(22183);var n=t.i(5142);let i=(0,r.createContext)(null);t.s(["default",0,function({sidebar:t,headerTitle:u,headerRight:c,children:h}){let[o,l]=(0,n.useDisclosure)(!1),[d,f]=(0,r.useState)(!1),p=(0,a.useMediaQuery)("(max-width: 768px)"),y=()=>{p?l.open():f(!1)};return(0,e.jsx)(i.Provider,{value:{closeSidebar:l.close,openSidebar:y,isSidebarVisible:p?o:!d},children:(0,e.jsxs)("div",{className:"app-layout",children:[(0,e.jsx)("div",{className:`sidebar-overlay ${o?"visible":""}`,onClick:()=>l.close()}),(0,e.jsx)("div",{className:`sidebar ${o?"open":""} ${d?"collapsed":""}`,children:t({closeSidebar:l.close,openSidebar:y})}),(0,e.jsxs)("div",{className:"main-content",children:[(0,e.jsxs)("header",{className:"app-header",children:[(0,e.jsxs)("div",{className:"header-left",children:[(0,e.jsx)("button",{onClick:()=>{p?l.toggle():f(!d)},className:"btn btn-icon sidebar-toggle-btn","aria-label":p?"打开菜单":d?"展开侧边栏":"收起侧边栏",children:(0,e.jsx)(s,{size:16})}),u]}),(0,e.jsx)("div",{className:"header-right",children:c})]}),h]})]})})},"useAppShell",0,function(){let t=(0,r.useContext)(i);if(!t)throw Error("useAppShell must be used within AppShell");return t}],59665)},39626,27648,t=>{"use strict";var e=t.i(18050);let r=(0,t.i(56420).default)("panel-left-open",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"m14 9 3 3-3 3",key:"8010ee"}]]);var a=t.i(59665);t.s(["default",0,function({label:t="打开侧边栏",className:s="",variant:n="primary"}){let{isSidebarVisible:i,openSidebar:u}=(0,a.useAppShell)();return i?null:(0,e.jsxs)("button",{type:"button",className:`btn ${"primary"===n?"btn-primary":""} sidebar-open-hint ${s}`.trim(),onClick:u,children:[(0,e.jsx)(r,{size:16}),t]})}],39626);var s=t.i(93957),n=t.i(71192);t.s(["default",0,function({className:t=""}){let r=(0,n.useUserStore)(t=>t.identity),a=(0,n.useUserStore)(t=>t.openLoginModal),i=(0,n.useUserStore)(t=>t.logoutUser);return(0,e.jsxs)("div",{className:`chat-sidebar-footer sidebar-account ${t}`,children:[(0,e.jsxs)("div",{className:"user-info",children:[(0,e.jsx)("img",{className:"user-avatar-img",src:(0,s.generateAvatar)(r?.address),alt:"avatar"}),(0,e.jsx)("span",{className:"user-name",title:r?.address,children:r?.displayName||"未登录"})]}),r?(0,e.jsx)("button",{className:"btn btn-ghost logout-btn",onClick:i,children:"退出"}):(0,e.jsx)("button",{className:"btn btn-primary login-btn",onClick:a,children:"登录"})]})}],27648)},77071,t=>{"use strict";let e=(0,t.i(56420).default)("plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);t.s(["Plus",0,e],77071)},22315,(t,e,r)=>{t.e,e.exports=function(){"use strict";var t="millisecond",e="second",r="minute",a="hour",s="week",n="month",i="quarter",u="year",c="date",h="Invalid Date",o=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,l=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,d=function(t,e,r){var a=String(t);return!a||a.length>=e?t:""+Array(e+1-a.length).join(r)+t},f="en",p={};p[f]={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(t){var e=["th","st","nd","rd"],r=t%100;return"["+t+(e[(r-20)%10]||e[r]||e[0])+"]"}};var y="$isDayjsObject",m=function(t){return t instanceof M||!(!t||!t[y])},v=function t(e,r,a){var s;if(!e)return f;if("string"==typeof e){var n=e.toLowerCase();p[n]&&(s=n),r&&(p[n]=r,s=n);var i=e.split("-");if(!s&&i.length>1)return t(i[0])}else{var u=e.name;p[u]=e,s=u}return!a&&s&&(f=s),s||!a&&f},k=function(t,e){if(m(t))return t.clone();var r="object"==typeof e?e:{};return r.date=t,r.args=arguments,new M(r)},$={s:d,z:function(t){var e=-t.utcOffset(),r=Math.abs(e);return(e<=0?"+":"-")+d(Math.floor(r/60),2,"0")+":"+d(r%60,2,"0")},m:function t(e,r){if(e.date()<r.date())return-t(r,e);var a=12*(r.year()-e.year())+(r.month()-e.month()),s=e.clone().add(a,n),i=r-s<0,u=e.clone().add(a+(i?-1:1),n);return+(-(a+(r-s)/(i?s-u:u-s))||0)},a:function(t){return t<0?Math.ceil(t)||0:Math.floor(t)},p:function(h){return({M:n,y:u,w:s,d:"day",D:c,h:a,m:r,s:e,ms:t,Q:i})[h]||String(h||"").toLowerCase().replace(/s$/,"")},u:function(t){return void 0===t}};$.l=v,$.i=m,$.w=function(t,e){return k(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var M=function(){function d(t){this.$L=v(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[y]=!0}var f=d.prototype;return f.parse=function(t){this.$d=function(t){var e=t.date,r=t.utc;if(null===e)return new Date(NaN);if($.u(e))return new Date;if(e instanceof Date)return new Date(e);if("string"==typeof e&&!/Z$/i.test(e)){var a=e.match(o);if(a){var s=a[2]-1||0,n=(a[7]||"0").substring(0,3);return r?new Date(Date.UTC(a[1],s,a[3]||1,a[4]||0,a[5]||0,a[6]||0,n)):new Date(a[1],s,a[3]||1,a[4]||0,a[5]||0,a[6]||0,n)}}return new Date(e)}(t),this.init()},f.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},f.$utils=function(){return $},f.isValid=function(){return this.$d.toString()!==h},f.isSame=function(t,e){var r=k(t);return this.startOf(e)<=r&&r<=this.endOf(e)},f.isAfter=function(t,e){return k(t)<this.startOf(e)},f.isBefore=function(t,e){return this.endOf(e)<k(t)},f.$g=function(t,e,r){return $.u(t)?this[e]:this.set(r,t)},f.unix=function(){return Math.floor(this.valueOf()/1e3)},f.valueOf=function(){return this.$d.getTime()},f.startOf=function(t,i){var h=this,o=!!$.u(i)||i,l=$.p(t),d=function(t,e){var r=$.w(h.$u?Date.UTC(h.$y,e,t):new Date(h.$y,e,t),h);return o?r:r.endOf("day")},f=function(t,e){return $.w(h.toDate()[t].apply(h.toDate("s"),(o?[0,0,0,0]:[23,59,59,999]).slice(e)),h)},p=this.$W,y=this.$M,m=this.$D,v="set"+(this.$u?"UTC":"");switch(l){case u:return o?d(1,0):d(31,11);case n:return o?d(1,y):d(0,y+1);case s:var k=this.$locale().weekStart||0,M=(p<k?p+7:p)-k;return d(o?m-M:m+(6-M),y);case"day":case c:return f(v+"Hours",0);case a:return f(v+"Minutes",1);case r:return f(v+"Seconds",2);case e:return f(v+"Milliseconds",3);default:return this.clone()}},f.endOf=function(t){return this.startOf(t,!1)},f.$set=function(s,i){var h,o=$.p(s),l="set"+(this.$u?"UTC":""),d=((h={}).day=l+"Date",h[c]=l+"Date",h[n]=l+"Month",h[u]=l+"FullYear",h[a]=l+"Hours",h[r]=l+"Minutes",h[e]=l+"Seconds",h[t]=l+"Milliseconds",h)[o],f="day"===o?this.$D+(i-this.$W):i;if(o===n||o===u){var p=this.clone().set(c,1);p.$d[d](f),p.init(),this.$d=p.set(c,Math.min(this.$D,p.daysInMonth())).$d}else d&&this.$d[d](f);return this.init(),this},f.set=function(t,e){return this.clone().$set(t,e)},f.get=function(t){return this[$.p(t)]()},f.add=function(t,i){var c,h=this;t=Number(t);var o=$.p(i),l=function(e){var r=k(h);return $.w(r.date(r.date()+Math.round(e*t)),h)};if(o===n)return this.set(n,this.$M+t);if(o===u)return this.set(u,this.$y+t);if("day"===o)return l(1);if(o===s)return l(7);var d=((c={})[r]=6e4,c[a]=36e5,c[e]=1e3,c)[o]||1,f=this.$d.getTime()+t*d;return $.w(f,this)},f.subtract=function(t,e){return this.add(-1*t,e)},f.format=function(t){var e=this,r=this.$locale();if(!this.isValid())return r.invalidDate||h;var a=t||"YYYY-MM-DDTHH:mm:ssZ",s=$.z(this),n=this.$H,i=this.$m,u=this.$M,c=r.weekdays,o=r.months,d=r.meridiem,f=function(t,r,s,n){return t&&(t[r]||t(e,a))||s[r].slice(0,n)},p=function(t){return $.s(n%12||12,t,"0")},y=d||function(t,e,r){var a=t<12?"AM":"PM";return r?a.toLowerCase():a};return a.replace(l,function(t,a){return a||function(t){switch(t){case"YY":return String(e.$y).slice(-2);case"YYYY":return $.s(e.$y,4,"0");case"M":return u+1;case"MM":return $.s(u+1,2,"0");case"MMM":return f(r.monthsShort,u,o,3);case"MMMM":return f(o,u);case"D":return e.$D;case"DD":return $.s(e.$D,2,"0");case"d":return String(e.$W);case"dd":return f(r.weekdaysMin,e.$W,c,2);case"ddd":return f(r.weekdaysShort,e.$W,c,3);case"dddd":return c[e.$W];case"H":return String(n);case"HH":return $.s(n,2,"0");case"h":return p(1);case"hh":return p(2);case"a":return y(n,i,!0);case"A":return y(n,i,!1);case"m":return String(i);case"mm":return $.s(i,2,"0");case"s":return String(e.$s);case"ss":return $.s(e.$s,2,"0");case"SSS":return $.s(e.$ms,3,"0");case"Z":return s}return null}(t)||s.replace(":","")})},f.utcOffset=function(){return-(15*Math.round(this.$d.getTimezoneOffset()/15))},f.diff=function(t,c,h){var o,l=this,d=$.p(c),f=k(t),p=(f.utcOffset()-this.utcOffset())*6e4,y=this-f,m=function(){return $.m(l,f)};switch(d){case u:o=m()/12;break;case n:o=m();break;case i:o=m()/3;break;case s:o=(y-p)/6048e5;break;case"day":o=(y-p)/864e5;break;case a:o=y/36e5;break;case r:o=y/6e4;break;case e:o=y/1e3;break;default:o=y}return h?o:$.a(o)},f.daysInMonth=function(){return this.endOf(n).$D},f.$locale=function(){return p[this.$L]},f.locale=function(t,e){if(!t)return this.$L;var r=this.clone(),a=v(t,e,!0);return a&&(r.$L=a),r},f.clone=function(){return $.w(this.$d,this)},f.toDate=function(){return new Date(this.valueOf())},f.toJSON=function(){return this.isValid()?this.toISOString():null},f.toISOString=function(){return this.$d.toISOString()},f.toString=function(){return this.$d.toUTCString()},d}(),g=M.prototype;return k.prototype=g,[["$ms",t],["$s",e],["$m",r],["$H",a],["$W","day"],["$M",n],["$y",u],["$D",c]].forEach(function(t){g[t[1]]=function(e){return this.$g(e,t[0],t[1])}}),k.extend=function(t,e){return t.$i||(t(e,M,k),t.$i=!0),k},k.locale=v,k.isDayjs=m,k.unix=function(t){return k(1e3*t)},k.en=p[f],k.Ls=p,k.p={},k}()},56522,t=>{"use strict";let e=(0,t.i(56420).default)("save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);t.s(["Save",0,e],56522)},53138,51757,t=>{"use strict";var e=t.i(56420);let r=(0,e.default)("triangle-alert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);t.s(["AlertTriangle",0,r],53138);let a=(0,e.default)("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);t.s(["CheckCircle2",0,a],51757)},71504,t=>{t.v(e=>Promise.all(["static/chunks/0h4r.qtmpa6eh.js","static/chunks/07r9nn-pzlgg1.js","static/chunks/0o9ce4cyf76by.js","static/chunks/0.w4hkvap~bva.js"].map(e=>t.l(e))).then(()=>e(36975)))}]);
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,96699,e=>{"use strict";let t=(0,e.i(56420).default)("moon",[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]]);e.s(["Moon",0,t],96699)},35965,e=>{"use strict";let t=(0,e.i(56420).default)("sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);e.s(["Sun",0,t],35965)},66627,e=>{"use strict";let t=(0,e.i(56420).default)("wifi",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]]);e.s(["Wifi",0,t],66627)},66595,e=>{"use strict";let t=(0,e.i(56420).default)("search",[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]]);e.s(["Search",0,t],66595)},31214,e=>{"use strict";let t=(0,e.i(56420).default)("cloud",[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]]);e.s(["Cloud",0,t],31214)},68590,e=>{"use strict";let t=(0,e.i(56420).default)("message-square",[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]]);e.s(["MessageSquare",0,t],68590)},51921,e=>{"use strict";let t=(0,e.i(56420).default)("music",[["path",{d:"M9 18V5l12-2v13",key:"1jmyc2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["circle",{cx:"18",cy:"16",r:"3",key:"1hluhg"}]]);e.s(["Music",0,t],51921)},30274,e=>{"use strict";let t=(0,e.i(56420).default)("send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);e.s(["Send",0,t],30274)},40983,e=>{"use strict";var t=e.i(18050),n=e.i(71645),i=e.i(22016),r=e.i(96699),a=e.i(35965);function l({size:e=24}){return(0,t.jsxs)("svg",{width:e,height:e,viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[(0,t.jsx)("rect",{x:"2",y:"2",width:"8",height:"8",rx:"2",fill:"var(--accent)",opacity:"0.4"}),(0,t.jsx)("rect",{x:"14",y:"2",width:"8",height:"8",rx:"2",fill:"var(--accent)",opacity:"0.7"}),(0,t.jsx)("rect",{x:"2",y:"14",width:"8",height:"8",rx:"2",fill:"var(--accent)",opacity:"0.7"}),(0,t.jsx)("rect",{x:"14",y:"14",width:"8",height:"8",rx:"2",fill:"var(--accent)"})]})}function s(){let[e,s]=(0,n.useState)(!1);return(0,n.useEffect)(()=>{let e=localStorage.getItem("theme"),t=window.matchMedia("(prefers-color-scheme: dark)").matches;("dark"===e||!e&&t)&&s(!0)},[]),(0,n.useEffect)(()=>{document.documentElement.setAttribute("data-theme",e?"dark":"light"),localStorage.setItem("theme",e?"dark":"light")},[e]),(0,t.jsx)(t.Fragment,{children:(0,t.jsx)("nav",{className:"mkt-nav",children:(0,t.jsxs)("div",{className:"mkt-nav-inner",children:[(0,t.jsxs)(i.default,{href:"/",className:"mkt-nav-logo",children:[(0,t.jsx)(l,{}),"MOST PEOPLE"]}),(0,t.jsxs)("div",{className:"mkt-nav-cta",children:[(0,t.jsx)("button",{className:"mkt-theme-toggle",onClick:()=>s(!e),"aria-label":"切换主题",children:e?(0,t.jsx)(a.Sun,{size:16}):(0,t.jsx)(r.Moon,{size:16})}),(0,t.jsx)(i.default,{href:"/app/",className:"btn btn-primary",children:"开始使用"})]})]})})})}let o=[{href:"/",label:"关于"},{href:"/ping/",label:"网络"},{href:"https://github.com/most-people/most",label:"GitHub",external:!0}];function c(){return(0,t.jsx)("footer",{className:"mkt-footer",children:(0,t.jsx)("div",{className:"mkt-container",children:(0,t.jsxs)("div",{className:"mkt-footer-inner",children:[(0,t.jsx)("div",{className:"mkt-footer-links",children:o.map(e=>(0,t.jsx)(i.default,{href:e.href,...e.external?{target:"_blank",rel:"noopener noreferrer"}:{},children:e.label},e.href))}),(0,t.jsxs)("span",{className:"mkt-footer-copy",children:["© ",new Date().getFullYear()," MOST PEOPLE · MIT License"]})]})})})}e.s(["MarketingLayout",0,function({children:e}){return(0,t.jsxs)("div",{className:"mkt-layout",children:[(0,t.jsx)(s,{}),(0,t.jsx)("main",{className:"mkt-layout-main",children:e}),(0,t.jsx)(c,{})]})}],40983)},23449,e=>{"use strict";let t;var n,i=e.i(18050),r=e.i(71645);let a=Object.freeze({left:0,top:0,width:16,height:16}),l=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),s=Object.freeze({...a,...l}),o=Object.freeze({...s,body:"",hidden:!1});function c(e,t){let n,i,r=(n={},!e.hFlip!=!t.hFlip&&(n.hFlip=!0),!e.vFlip!=!t.vFlip&&(n.vFlip=!0),(i=((e.rotate||0)+(t.rotate||0))%4)&&(n.rotate=i),n);for(let n in o)n in l?n in e&&!(n in r)&&(r[n]=l[n]):n in t?r[n]=t[n]:n in e&&(r[n]=e[n]);return r}function u(e,t){let n,i,r,a=[];if("object"!=typeof e||"object"!=typeof e.icons)return a;e.not_found instanceof Array&&e.not_found.forEach(e=>{t(e,null),a.push(e)});let l=(n=e.icons,i=e.aliases||Object.create(null),r=Object.create(null),Object.keys(n).concat(Object.keys(i)).forEach(function e(t){if(n[t])return r[t]=[];if(!(t in r)){r[t]=null;let n=i[t]&&i[t].parent,a=n&&e(n);a&&(r[t]=[n].concat(a))}return r[t]}),r);for(let n in l){let i=l[n];i&&(t(n,function(e,t,n){let i=e.icons,r=e.aliases||Object.create(null),a={};function l(e){a=c(i[e]||r[e],a)}return l(t),n.forEach(l),c(e,a)}(e,n,i)),a.push(n))}return a}let f={provider:"",aliases:{},not_found:{},...a};function d(e,t){for(let n in t)if(n in e&&typeof e[n]!=typeof t[n])return!1;return!0}function h(e){if("object"!=typeof e||null===e||"string"!=typeof e.prefix||!e.icons||"object"!=typeof e.icons||!d(e,f))return null;let t=e.icons;for(let e in t){let n=t[e];if(!e||"string"!=typeof n.body||!d(n,o))return null}let n=e.aliases||Object.create(null);for(let e in n){let i=n[e],r=i.parent;if(!e||"string"!=typeof r||!t[r]&&!n[r]||!d(i,o))return null}return e}let p=Object.create(null);function g(e,t){let n=p[e]||(p[e]=Object.create(null));return n[t]||(n[t]={provider:e,prefix:t,icons:Object.create(null),missing:new Set})}function m(e,t){return h(t)?u(t,(t,n)=>{n?e.icons[t]=n:e.missing.add(t)}):[]}let y=/^[a-z0-9]+(-[a-z0-9]+)*$/,x=(e,t,n,i="")=>{let r=e.split(":");if("@"===e.slice(0,1)){if(r.length<2||r.length>3)return null;i=r.shift().slice(1)}if(r.length>3||!r.length)return null;if(r.length>1){let e=r.pop(),n=r.pop(),a={provider:r.length>0?r[0]:i,prefix:n,name:e};return t&&!b(a)?null:a}let a=r[0],l=a.split("-");if(l.length>1){let e={provider:i,prefix:l.shift(),name:l.join("-")};return t&&!b(e)?null:e}if(n&&""===i){let e={provider:i,prefix:"",name:a};return t&&!b(e,n)?null:e}return null},b=(e,t)=>!!e&&!!((t&&""===e.prefix||e.prefix)&&e.name),k=!1;function v(e){return"boolean"==typeof e&&(k=e),k}function j(e){let t="string"==typeof e?x(e,!0,k):e;if(t){let e=g(t.provider,t.prefix),n=t.name;return e.icons[n]||(e.missing.has(n)?null:void 0)}}let w=Object.freeze({width:null,height:null}),M=Object.freeze({...w,...l}),E=/(-?[0-9.]*[0-9]+[0-9.]*)/g,N=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function S(e,t,n){if(1===t)return e;if(n=n||100,"number"==typeof e)return Math.ceil(e*t*n)/n;if("string"!=typeof e)return e;let i=e.split(E);if(null===i||!i.length)return e;let r=[],a=i.shift(),l=N.test(a);for(;;){if(l){let e=parseFloat(a);isNaN(e)?r.push(a):r.push(Math.ceil(e*t*n)/n)}else r.push(a);if(void 0===(a=i.shift()))return r.join("");l=!l}}let z=/\sid="(\S+)"/g,T="IconifyId"+Date.now().toString(16)+(0x1000000*Math.random()|0).toString(16),O=0,C=Object.create(null);function F(e){return C[e]||C[""]}function A(e){let t;if("string"==typeof e.resources)t=[e.resources];else if(!((t=e.resources)instanceof Array)||!t.length)return null;return{resources:t,path:e.path||"/",maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5e3,random:!0===e.random,index:e.index||0,dataAfterTimeout:!1!==e.dataAfterTimeout}}let I=Object.create(null),L=["https://api.simplesvg.com","https://api.unisvg.com"],$=[];for(;L.length>0;)1===L.length||Math.random()>.5?$.push(L.shift()):$.push(L.pop());I[""]=A({resources:["https://api.iconify.design"].concat($)});let P=(()=>{let e;try{if(e=fetch,"function"==typeof e)return e}catch(e){}})();function H(e,t){e.forEach(e=>{let n=e.loaderCallbacks;n&&(e.loaderCallbacks=n.filter(e=>e.id!==t))})}let R=0,q={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function _(e){let t={...q,...e},n=[];function i(){n=n.filter(e=>"pending"===e().status)}return{query:function(e,r,a){let l=function(e,t,n,i){let r,a,l=e.resources.length,s=e.random?Math.floor(Math.random()*l):e.index;if(e.random){let t=e.resources.slice(0);for(r=[];t.length>1;){let e=Math.floor(Math.random()*t.length);r.push(t[e]),t=t.slice(0,e).concat(t.slice(e+1))}r=r.concat(t)}else r=e.resources.slice(s).concat(e.resources.slice(0,s));let o=Date.now(),c="pending",u=0,f=null,d=[],h=[];function p(){f&&(clearTimeout(f),f=null)}function g(){"pending"===c&&(c="aborted"),p(),d.forEach(e=>{"pending"===e.status&&(e.status="aborted")}),d=[]}function m(e,t){t&&(h=[]),"function"==typeof e&&h.push(e)}function y(){c="failed",h.forEach(e=>{e(void 0,a)})}function x(){d.forEach(e=>{"pending"===e.status&&(e.status="aborted")}),d=[]}return"function"==typeof i&&h.push(i),setTimeout(function i(){if("pending"!==c)return;p();let l=r.shift();if(void 0===l){if(d.length){f=setTimeout(()=>{p(),"pending"===c&&(x(),y())},e.timeout);return}y();return}let s={status:"pending",resource:l,callback:(t,n)=>{!function(t,n,l){let s="success"!==n;switch(d=d.filter(e=>e!==t),c){case"pending":break;case"failed":if(s||!e.dataAfterTimeout)return;break;default:return}if("abort"===n){a=l,y();return}if(s){a=l,d.length||(r.length?i():y());return}if(p(),x(),!e.random){let n=e.resources.indexOf(t.resource);-1!==n&&n!==e.index&&(e.index=n)}c="completed",h.forEach(e=>{e(l)})}(s,t,n)}};d.push(s),u++,f=setTimeout(i,e.rotate),n(l,t,s.callback)}),function(){return{startTime:o,payload:t,status:c,queriesSent:u,queriesPending:d.length,subscribe:m,abort:g}}}(t,e,r,(e,t)=>{i(),a&&a(e,t)});return n.push(l),l},find:function(e){return n.find(t=>e(t))||null},setIndex:e=>{t.index=e},getIndex:()=>t.index,cleanup:i}}let V=Object.create(null);function D(){}function U(e,t,n){function i(){let n=e.pendingIcons;t.forEach(t=>{n&&n.delete(t),e.icons[t]||e.missing.add(t)})}if(n&&"object"==typeof n)try{if(!m(e,n).length)return void i()}catch(e){console.error(e)}i(),e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;let t=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!t.length)return;let n=!1,i=e.provider,r=e.prefix;t.forEach(t=>{let a=t.icons,l=a.pending.length;a.pending=a.pending.filter(t=>{if(t.prefix!==r)return!0;let l=t.name;if(e.icons[l])a.loaded.push({provider:i,prefix:r,name:l});else{if(!e.missing.has(l))return n=!0,!0;a.missing.push({provider:i,prefix:r,name:l})}return!1}),a.pending.length!==l&&(n||H([e],t.id),t.callback(a.loaded.slice(0),a.missing.slice(0),a.pending.slice(0),t.abort))})}))}))}function B(e,t){e instanceof Promise?e.then(e=>{t(e)}).catch(()=>{t(null)}):t(e)}let G=/[\s,]+/,W={...M,inline:!1},Q={xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink","aria-hidden":!0,role:"img"},J={display:"inline-block"},K={backgroundColor:"currentColor"},X={backgroundColor:"transparent"},Y={Image:"var(--svg)",Repeat:"no-repeat",Size:"100% 100%"},Z={WebkitMask:K,mask:K,background:X};for(let e in Z){let t=Z[e];for(let n in Y)t[e+n]=Y[n]}let ee={...W,inline:!0};function et(e){return e+(e.match(/^[-0-9.]+$/)?"px":"")}if(v(!0),n={prepare:(e,t,n)=>{let i=[],r=function(e,t){let n,i=I[e];if(!i)return 0;if(i.maxURL){let e=0;i.resources.forEach(t=>{e=Math.max(e,t.length)}),n=i.maxURL-e-i.path.length-(t+".json?icons=").length}else n=0;return n}(e,t),a="icons",l={type:a,provider:e,prefix:t,icons:[]},s=0;return n.forEach((n,o)=>{(s+=n.length+1)>=r&&o>0&&(i.push(l),l={type:a,provider:e,prefix:t,icons:[]},s=n.length),l.icons.push(n)}),i.push(l),i},send:(e,t,n)=>{if(!P)return void n("abort",424);let i=function(e){if("string"==typeof e){let t=I[e];if(t)return t.path}return"/"}(t.provider);switch(t.type){case"icons":i+=t.prefix+".json?"+new URLSearchParams({icons:t.icons.join(",")}).toString();break;case"custom":{let e=t.uri;i+="/"===e.slice(0,1)?e.slice(1):e;break}default:n("abort",400);return}let r=503;P(e+i).then(e=>{let t=e.status;return 200!==t?void setTimeout(()=>{n(404===t?"abort":"next",t)}):(r=501,e.json())}).then(e=>{"object"!=typeof e||null===e?setTimeout(()=>{404===e?n("abort",e):n("next",r)}):setTimeout(()=>{n("success",e)})}).catch(()=>{n("next",r)})}},C[""]=n,"u">typeof document&&"u">typeof window){let e=window;if(void 0!==e.IconifyPreload){let t=e.IconifyPreload,n="Invalid IconifyPreload syntax.";"object"==typeof t&&null!==t&&(t instanceof Array?t:[t]).forEach(e=>{try{("object"!=typeof e||null===e||e instanceof Array||"object"!=typeof e.icons||"string"!=typeof e.prefix||!function(e,t){if("object"!=typeof e)return!1;if("string"!=typeof t&&(t=e.provider||""),k&&!t&&!e.prefix){let t=!1;return h(e)&&(e.prefix="",u(e,(e,n)=>{(function(e,t){let n=x(e,!0,k);if(!n)return!1;let i=g(n.provider,n.prefix);if(!t)return i.missing.add(n.name),!0;var r=n.name;try{if("string"==typeof t.body)return i.icons[r]={...t},!0}catch(e){}return!1})(e,n)&&(t=!0)})),t}let n=e.prefix;return!!b({prefix:n,name:"a"})&&!!m(g(t,n),e)}(e))&&console.error(n)}catch(e){console.error(n)}})}if(void 0!==e.IconifyProviders){let t=e.IconifyProviders;if("object"==typeof t&&null!==t)for(let e in t){let n="IconifyProviders["+e+"] is invalid.";try{let i=t[e];if("object"!=typeof i||!i||void 0===i.resources)continue;!function(e,t){let n=A(t);return null!==n&&(I[e]=n,!0)}(e,i)&&console.error(n)}catch(e){console.error(n)}}}}function en(e){let[n,i]=(0,r.useState)(!!e.ssr),[a,l]=(0,r.useState)({}),[o,c]=(0,r.useState)(function(t){if(t){let t=e.icon;if("object"==typeof t)return{name:"",data:t};let n=j(t);if(n)return{name:t,data:n}}return{name:""}}(!!e.ssr));function u(){let e=a.callback;e&&(e(),l({}))}function f(e){if(JSON.stringify(o)!==JSON.stringify(e))return u(),c(e),!0}(0,r.useEffect)(()=>(i(!0),u),[]),(0,r.useEffect)(()=>{n&&function t(){var n;let i=e.icon;if("object"==typeof i)return void f({name:"",data:i});let r=j(i);f({name:i,data:r})&&(void 0===r?l({callback:((e,t)=>{var n;let i,r,a,l,s,o=(n=function(e,t=!0,n=!1){let i=[];return e.forEach(e=>{let r="string"==typeof e?x(e,t,n):e;r&&i.push(r)}),i}(e,!0,v()),a={loaded:[],missing:[],pending:[]},l=Object.create(null),n.sort((e,t)=>e.provider!==t.provider?e.provider.localeCompare(t.provider):e.prefix!==t.prefix?e.prefix.localeCompare(t.prefix):e.name.localeCompare(t.name)),s={provider:"",prefix:"",name:""},n.forEach(e=>{if(s.name===e.name&&s.prefix===e.prefix&&s.provider===e.provider)return;s=e;let t=e.provider,n=e.prefix,i=e.name,r=l[t]||(l[t]=Object.create(null)),o=r[n]||(r[n]=g(t,n));(i in o.icons?a.loaded:""===n||o.missing.has(i)?a.missing:a.pending).push({provider:t,prefix:n,name:i})}),a);if(!o.pending.length){let e=!0;return t&&setTimeout(()=>{e&&t(o.loaded,o.missing,o.pending,D)}),()=>{e=!1}}let c=Object.create(null),u=[];return o.pending.forEach(e=>{let{provider:t,prefix:n}=e;if(n===r&&t===i)return;i=t,r=n,u.push(g(t,n));let a=c[t]||(c[t]=Object.create(null));a[n]||(a[n]=[])}),o.pending.forEach(e=>{let{provider:t,prefix:n,name:i}=e,r=g(t,n),a=r.pendingIcons||(r.pendingIcons=new Set);a.has(i)||(a.add(i),c[t][n].push(i))}),u.forEach(e=>{let t=c[e.provider][e.prefix];t.length&&(e.iconsToLoad?e.iconsToLoad=e.iconsToLoad.concat(t).sort():e.iconsToLoad=t,e.iconsQueueFlag||(e.iconsQueueFlag=!0,setTimeout(()=>{let t,n;e.iconsQueueFlag=!1;let{provider:i,prefix:r}=e,a=e.iconsToLoad;if(delete e.iconsToLoad,!a||!a.length)return;let l=e.loadIcon;if(e.loadIcons&&(a.length>1||!l))return void B(e.loadIcons(a,r,i),t=>{U(e,a,t)});if(l)return void a.forEach(t=>{B(l(t,r,i),n=>{let i=n?{prefix:r,icons:{[t]:n}}:null;U(e,[t],i)})});let{valid:s,invalid:o}=(t=[],n=[],a.forEach(e=>{(e.match(y)?t:n).push(e)}),{valid:t,invalid:n});if(o.length&&U(e,o,null),!s.length)return;let c=r.match(y)?F(i):null;c?c.prepare(i,r,s).forEach(t=>{!function(e,t,n){let i,r;if("string"==typeof e){let t=F(e);if(!t)return n(void 0,424);r=t.send;let a=function(e){if(!V[e]){let t=I[e];if(!t)return;let n=_(t);V[e]={config:t,redundancy:n}}return V[e]}(e);a&&(i=a.redundancy)}else{let t=A(e);if(t){i=_(t);let n=F(e.resources?e.resources[0]:"");n&&(r=n.send)}}i&&r?i.query(t,r,n)().abort:n(void 0,424)}(i,t,n=>{U(e,t.icons,n)})}):U(e,s,null)})))}),t?function(e,t,n){let i=R++,r=H.bind(null,n,i);if(!t.pending.length)return r;let a={id:i,icons:t,callback:e,abort:r};return n.forEach(e=>{(e.loaderCallbacks||(e.loaderCallbacks=[])).push(a)}),r}(t,o,u):D})([i],t)}):r&&(null==(n=e.onLoad)||n.call(e,i)))}()},[e.icon,n]);let{name:d,data:h}=o;return h?((e,n,i)=>{var a;let l,o,c,u,f,d,h,p,g,m,y,b,k,v=n.inline?ee:W,j=function(e,t){let n={...e};for(let e in t){let i=t[e],r=typeof i;e in w?(null===i||i&&("string"===r||"number"===r))&&(n[e]=i):r===typeof n[e]&&(n[e]="rotate"===e?i%4:i)}return n}(v,n),E=n.mode||"svg",N={},C=n.style||{},F={..."svg"===E?Q:{}};if(i){let e=x(i,!1,!0);if(e){let t=["iconify"];for(let n of["provider","prefix"])e[n]&&t.push("iconify--"+e[n]);F.className=t.join(" ")}}for(let e in n){let t=n[e];if(void 0!==t)switch(e){case"icon":case"style":case"children":case"onLoad":case"mode":case"ssr":case"fallback":break;case"_ref":F.ref=t;break;case"className":F[e]=(F[e]?F[e]+" ":"")+t;break;case"inline":case"hFlip":case"vFlip":j[e]=!0===t||"true"===t||1===t;break;case"flip":"string"==typeof t&&function(e,t){t.split(G).forEach(t=>{switch(t.trim()){case"horizontal":e.hFlip=!0;break;case"vertical":e.vFlip=!0}})}(j,t);break;case"color":N.color=t;break;case"rotate":"string"==typeof t?j[e]=function(e,t=0){let n=e.replace(/^-?[0-9.]*/,"");function i(e){for(;e<0;)e+=4;return e%4}if(""===n){let t=parseInt(e);return isNaN(t)?0:i(t)}if(n!==e){let t=0;switch(n){case"%":t=25;break;case"deg":t=90}if(t){let r=parseFloat(e.slice(0,e.length-n.length));return isNaN(r)?0:(r/=t)%1==0?i(r):0}}return t}(t):"number"==typeof t&&(j[e]=t);break;case"ariaHidden":case"aria-hidden":!0!==t&&"true"!==t&&delete F["aria-hidden"];break;default:void 0===v[e]&&(F[e]=t)}}let A=(c={...s,...e},u={...M,...j},f={left:c.left,top:c.top,width:c.width,height:c.height},d=c.body,[c,u].forEach(e=>{var t,n,i,r;let a,l,s=[],o=e.hFlip,c=e.vFlip,u=e.rotate;switch(o?c?u+=2:(s.push("translate("+(f.width+f.left).toString()+" "+(0-f.top).toString()+")"),s.push("scale(-1 1)"),f.top=f.left=0):c&&(s.push("translate("+(0-f.left).toString()+" "+(f.height+f.top).toString()+")"),s.push("scale(1 -1)"),f.top=f.left=0),u<0&&(u-=4*Math.floor(u/4)),u%=4){case 1:s.unshift("rotate(90 "+(a=f.height/2+f.top).toString()+" "+a.toString()+")");break;case 2:s.unshift("rotate(180 "+(f.width/2+f.left).toString()+" "+(f.height/2+f.top).toString()+")");break;case 3:s.unshift("rotate(-90 "+(a=f.width/2+f.left).toString()+" "+a.toString()+")")}u%2==1&&(f.left!==f.top&&(a=f.left,f.left=f.top,f.top=a),f.width!==f.height&&(a=f.width,f.width=f.height,f.height=a)),s.length&&(t=d,n='<g transform="'+s.join(" ")+'">',i=(l=function(e,t="defs"){let n="",i=e.indexOf("<"+t);for(;i>=0;){let r=e.indexOf(">",i),a=e.indexOf("</"+t);if(-1===r||-1===a)break;let l=e.indexOf(">",a);if(-1===l)break;n+=e.slice(r+1,a).trim(),e=e.slice(0,i).trim()+e.slice(l+1)}return{defs:n,content:e}}(t)).defs,r=n+l.content+"</g>",d=i?"<defs>"+i+"</defs>"+r:r)}),h=u.width,p=u.height,g=f.width,m=f.height,null===h?l=S(o=null===p?"1em":"auto"===p?m:p,g/m):(l="auto"===h?g:h,o=null===p?S(l,m/g):"auto"===p?m:p),y={},(b=(e,t)=>{"unset"!==t&&"undefined"!==t&&"none"!==t&&(y[e]=t.toString())})("width",l),b("height",o),y.viewBox=(k=[f.left,f.top,g,m]).join(" "),{attributes:y,viewBox:k,body:d}),I=A.attributes;if(j.inline&&(N.verticalAlign="-0.125em"),"svg"===E){F.style={...N,...C},Object.assign(F,I);let e=0,i=n.id;return"string"==typeof i&&(i=i.replace(/-/g,"_")),F.dangerouslySetInnerHTML={__html:(a=function(e,t=T){let n,i=[];for(;n=z.exec(e);)i.push(n[1]);if(!i.length)return e;let r="suffix"+(0x1000000*Math.random()|Date.now()).toString(16);return i.forEach(n=>{let i="function"==typeof t?t(n):t+(O++).toString(),a=n.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");e=e.replace(RegExp('([#;"])('+a+')([")]|\\.[a-z])',"g"),"$1"+i+r+"$3")}),e=e.replace(RegExp(r,"g"),"")}(A.body,i?()=>i+"ID"+e++:"iconifyReact"),void 0===t&&function(){try{t=window.trustedTypes.createPolicy("iconify",{createHTML:e=>e})}catch(e){t=null}}(),t?t.createHTML(a):a)},(0,r.createElement)("svg",F)}let{body:L,width:$,height:P}=e,H="mask"===E||"bg"!==E&&-1!==L.indexOf("currentColor"),R=function(e,t){let n=-1===e.indexOf("xlink:")?"":' xmlns:xlink="http://www.w3.org/1999/xlink"';for(let e in t)n+=" "+e+'="'+t[e]+'"';return'<svg xmlns="http://www.w3.org/2000/svg"'+n+">"+e+"</svg>"}(L,{...I,width:$+"",height:P+""});return F.style={...N,"--svg":'url("data:image/svg+xml,'+R.replace(/"/g,"'").replace(/%/g,"%25").replace(/#/g,"%23").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/\s+/g," ")+'")',width:et(I.width),height:et(I.height),...J,...H?K:X,...C},(0,r.createElement)("span",F)})({...s,...h},e,d):e.children?e.children:e.fallback?e.fallback:(0,r.createElement)("span",{})}let ei=(0,r.forwardRef)((e,t)=>en({...e,_ref:t}));(0,r.forwardRef)((e,t)=>en({inline:!0,...e,_ref:t}));var er=e.i(66595),ea=e.i(31214),el=e.i(56420);let es=(0,el.default)("play",[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]]),eo=(0,el.default)("terminal",[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]]),ec=(0,el.default)("bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]),eu=(0,el.default)("at-sign",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8",key:"7n84p3"}]]),ef=(0,el.default)("camera",[["path",{d:"M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z",key:"18u6gg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]]);var ed=e.i(68590);let eh=(0,el.default)("book-open",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]),ep=(0,el.default)("smartphone",[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]]);var eg=e.i(30274);let em=(0,el.default)("messages-square",[["path",{d:"M16 10a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 14.286V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z",key:"1n2ejm"}],["path",{d:"M20 9a2 2 0 0 1 2 2v10.286a.71.71 0 0 1-1.212.502l-2.202-2.202A2 2 0 0 0 17.172 19H10a2 2 0 0 1-2-2v-1",key:"1qfcsi"}]]);var ey=e.i(51921);let ex=(0,el.default)("package",[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]),eb=(0,el.default)("triangle",[["path",{d:"M13.73 4a2 2 0 0 0-3.46 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z",key:"14u9p9"}]]),ek=(0,el.default)("rotate-cw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]);var ev=e.i(66627);let ej=[{name:"Google",host:"google.com",icon:"simple-icons:google",fallback:(0,i.jsx)(er.Search,{size:20})},{name:"Cloudflare",host:"cloudflare.com",icon:"simple-icons:cloudflare",fallback:(0,i.jsx)(ea.Cloud,{size:20})},{name:"YouTube",host:"youtube.com",icon:"simple-icons:youtube",fallback:(0,i.jsx)(es,{size:20})},{name:"GitHub",host:"github.com",icon:"simple-icons:github",fallback:(0,i.jsx)(eo,{size:20})},{name:"ChatGPT",host:"chatgpt.com",icon:"simple-icons:openai",fallback:(0,i.jsx)(ec,{size:20})},{name:"X",host:"x.com",icon:"simple-icons:x",fallback:(0,i.jsx)(eu,{size:20})},{name:"Instagram",host:"instagram.com",icon:"simple-icons:instagram",fallback:(0,i.jsx)(ef,{size:20})},{name:"Reddit",host:"reddit.com",icon:"simple-icons:reddit",fallback:(0,i.jsx)(ed.MessageSquare,{size:20})},{name:"Wikipedia",host:"wikipedia.org",icon:"simple-icons:wikipedia",fallback:(0,i.jsx)(eh,{size:20})},{name:"Apple",host:"apple.com",icon:"simple-icons:apple",fallback:(0,i.jsx)(ep,{size:20})},{name:"Telegram",host:"telegram.org",icon:"simple-icons:telegram",fallback:(0,i.jsx)(eg.Send,{size:20})},{name:"Discord",host:"discord.com",icon:"simple-icons:discord",fallback:(0,i.jsx)(em,{size:20})},{name:"TikTok",host:"tiktok.com",icon:"simple-icons:tiktok",fallback:(0,i.jsx)(ey.Music,{size:20})},{name:"npm",host:"npmjs.com",icon:"simple-icons:npm",fallback:(0,i.jsx)(ex,{size:20})},{name:"Vercel",host:"vercel.com",icon:"simple-icons:vercel",fallback:(0,i.jsx)(eb,{size:20})}];function ew({icon:e,fallback:t}){let[n,a]=(0,r.useState)(!1);return(0,r.useEffect)(()=>{let t=new Image;t.onload=()=>a(!0),t.onerror=()=>a(!1),t.src=`https://api.iconify.design/${e.replace(":","/")}.svg`},[e]),(0,i.jsxs)("span",{className:"brand-icon-wrap",children:[(0,i.jsx)("span",{className:`brand-icon-fallback ${n?"hidden":""}`,children:t}),(0,i.jsx)("span",{className:`brand-icon-real ${n?"visible":""}`,children:(0,i.jsx)(ei,{icon:e,width:20,height:20})})]})}function eM(){let[e,t]=(0,r.useState)(new Map),[n,a]=(0,r.useState)(!1),l=(0,r.useRef)(new Map),s=(0,r.useCallback)(e=>{t(t=>{let n=new Map(t);return n.set(e,{status:"pending",latency:0}),n});let n=new AbortController;l.current.set(e,n);let i=performance.now(),r=(n,i)=>{t(t=>{let r=new Map(t);return r.set(e,{status:n,latency:i}),r})},a=setTimeout(()=>{n.abort()},5e3);fetch(`https://${e}/`,{method:"HEAD",mode:"no-cors",cache:"no-store",signal:n.signal}).then(()=>{clearTimeout(a),r("ok",Math.round(performance.now()-i))}).catch(()=>{clearTimeout(a),r("timeout",0)})},[]),o=(0,r.useCallback)(()=>{a(!0);let e=new Map;ej.forEach(t=>{e.set(t.host,{status:"pending",latency:0})}),t(e);let n=new Set(ej.map(e=>e.host));ej.forEach(e=>{let i=new AbortController;l.current.set(e.host,i);let r=performance.now(),s=(i,r)=>{n.has(e.host)&&(n.delete(e.host),t(t=>{let n=new Map(t);return n.set(e.host,{status:i,latency:r}),n}),0===n.size&&a(!1))},o=setTimeout(()=>{i.abort()},5e3);fetch(`https://${e.host}/`,{method:"HEAD",mode:"no-cors",cache:"no-store",signal:i.signal}).then(()=>{clearTimeout(o),s("ok",Math.round(performance.now()-r))}).catch(()=>{clearTimeout(o),s("timeout",0)})})},[]);return(0,r.useEffect)(()=>(o(),()=>{l.current.forEach(e=>e.abort()),l.current.clear()}),[o]),(0,i.jsxs)("div",{className:"ping-page",children:[(0,i.jsxs)("div",{className:"ping-header",children:[(0,i.jsxs)("div",{className:"ping-title-wrap",children:[(0,i.jsx)(ev.Wifi,{size:28,className:"ping-title-icon"}),(0,i.jsxs)("div",{children:[(0,i.jsx)("h1",{className:"ping-title",children:"网络连通性"}),(0,i.jsx)("p",{className:"ping-subtitle",children:"通过向对应网站发送请求进行测试,延迟值仅供参考。"})]})]}),(0,i.jsx)("button",{className:"btn btn-icon",onClick:o,disabled:n,"aria-label":"重新测试全部",title:"重新测试全部",children:(0,i.jsx)(ek,{size:18,className:n?"ping-spin":""})})]}),(0,i.jsx)("div",{className:"ping-grid",children:ej.map(t=>{let n=e.get(t.host),r=!n||"pending"===n.status,a=n?.status==="timeout";return(0,i.jsxs)("div",{className:`ping-card ${r?"pending":""}`,children:[(0,i.jsxs)("div",{className:"ping-card-top",children:[(0,i.jsx)("span",{className:"ping-card-icon",children:(0,i.jsx)(ew,{icon:t.icon,fallback:t.fallback})}),(0,i.jsx)("a",{href:`https://${t.host}`,target:"_blank",rel:"noreferrer",className:"ping-card-name",children:t.name}),(0,i.jsx)("button",{className:"ping-card-refresh",onClick:()=>s(t.host),disabled:r,"aria-label":`重新测试 ${t.name}`,title:"重新测试",children:(0,i.jsx)(ek,{size:13,className:r?"ping-spin":""})})]}),(0,i.jsxs)("div",{className:"ping-card-bottom",children:[r?(0,i.jsx)("span",{className:"ping-pulse-dot"}):(0,i.jsx)("span",{className:`ping-status-label ${a?"is-error":"is-success"}`,children:a?"不可用":"可用"}),(0,i.jsx)("span",{className:`ping-latency ${r?"is-muted":a?"is-error":"is-success"}`,children:r?"--":a?"超时":`${n.latency} ms`})]})]},t.host)})})]})}var eE=e.i(40983);e.s(["default",0,function(){return(0,i.jsx)(eE.MarketingLayout,{children:(0,i.jsx)(eM,{})})}],23449)}]);
@@ -1 +0,0 @@
1
- (globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,67585,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"BailoutToCSR",{enumerable:!0,get:function(){return a}});let s=e.r(32061);function a({reason:e,children:t}){if("u"<typeof window)throw Object.defineProperty(new s.BailoutToCSRError(e),"__NEXT_ERROR_CODE",{value:"E394",enumerable:!1,configurable:!0});return t}},9885,(e,t,n)=>{"use strict";function s(e){return e.split("/").map(e=>encodeURIComponent(e)).join("/")}Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"encodeURIPath",{enumerable:!0,get:function(){return s}})},52157,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"PreloadChunks",{enumerable:!0,get:function(){return o}});let s=e.r(18050),a=e.r(74080),r=e.r(63599),i=e.r(9885),l=e.r(43369);function o({moduleIds:e}){if("u">typeof window)return null;let t=r.workAsyncStorage.getStore();if(void 0===t)return null;let n=[];if(t.reactLoadableManifest&&e){let s=t.reactLoadableManifest;for(let t of e){if(!s[t])continue;let e=s[t].files;n.push(...e)}}if(0===n.length)return null;let c=(0,l.getAssetTokenQuery)();return(0,s.jsx)(s.Fragment,{children:n.map(e=>{let n=`${t.assetPrefix}/_next/${(0,i.encodeURIPath)(e)}${c}`;return e.endsWith(".css")?(0,s.jsx)("link",{precedence:"dynamic",href:n,rel:"stylesheet",as:"style",nonce:t.nonce},e):((0,a.preload)(n,{as:"script",fetchPriority:"low",nonce:t.nonce}),null)})})}},69093,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"default",{enumerable:!0,get:function(){return c}});let s=e.r(18050),a=e.r(71645),r=e.r(67585),i=e.r(52157);function l(e){return{default:e&&"default"in e?e.default:e}}let o={loader:()=>Promise.resolve(l(()=>null)),loading:null,ssr:!0},c=function(e){let t={...o,...e},n=(0,a.lazy)(()=>t.loader().then(l)),c=t.loading;function d(e){let l=c?(0,s.jsx)(c,{isLoading:!0,pastDelay:!0,error:null}):null,o=!t.ssr||!!t.loading,d=o?a.Suspense:a.Fragment,u=t.ssr?(0,s.jsxs)(s.Fragment,{children:["u"<typeof window?(0,s.jsx)(i.PreloadChunks,{moduleIds:t.modules}):null,(0,s.jsx)(n,{...e})]}):(0,s.jsx)(r.BailoutToCSR,{reason:"next/dynamic",children:(0,s.jsx)(n,{...e})});return(0,s.jsx)(d,{...o?{fallback:l}:{},children:u})}return d.displayName="LoadableComponent",d}},70703,(e,t,n)=>{"use strict";Object.defineProperty(n,"__esModule",{value:!0}),Object.defineProperty(n,"default",{enumerable:!0,get:function(){return a}});let s=e.r(55682)._(e.r(69093));function a(e,t){let n={};"function"==typeof e&&(n.loader=e);let a={...n,...t};return(0,s.default)({...a,modules:a.loadableGenerated?.modules})}("function"==typeof n.default||"object"==typeof n.default&&null!==n.default)&&void 0===n.default.__esModule&&(Object.defineProperty(n.default,"__esModule",{value:!0}),Object.assign(n.default,n),t.exports=n.default)},58559,e=>{"use strict";var t=e.i(18050),n=e.i(71645),s=e.i(70703),a=e.i(18566),r=e.i(16327),i=e.i(67927),l=e.i(56420);let o=(0,l.default)("pencil-ruler",[["path",{d:"M13 7 8.7 2.7a2.41 2.41 0 0 0-3.4 0L2.7 5.3a2.41 2.41 0 0 0 0 3.4L7 13",key:"orapub"}],["path",{d:"m8 6 2-2",key:"115y1s"}],["path",{d:"m18 16 2-2",key:"ee94s4"}],["path",{d:"m17 11 4.3 4.3c.94.94.94 2.46 0 3.4l-2.6 2.6c-.94.94-2.46.94-3.4 0L11 17",key:"cfq27r"}],["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);var c=e.i(72382),d=e.i(26091),u=e.i(26067);let h=(0,l.default)("move",[["path",{d:"M12 2v20",key:"t6zp3m"}],["path",{d:"m15 19-3 3-3-3",key:"11eu04"}],["path",{d:"m19 9 3 3-3 3",key:"1mg7y2"}],["path",{d:"M2 12h20",key:"9i4pu4"}],["path",{d:"m5 9-3 3 3 3",key:"j64kie"}],["path",{d:"m9 5 3-3 3 3",key:"l8vdw6"}]]);var p=e.i(6537),m=e.i(96699),f=e.i(10566),x=e.i(77071),j=e.i(56522),b=e.i(66595),y=e.i(35965),g=e.i(73474),N=e.i(63676),v=e.i(59665),w=e.i(39626);e.i(4121);var S=e.i(88361),k=e.i(47910),C=e.i(57667),P=e.i(3593),z=e.i(71192),M=e.i(128),$=e.i(77816),E=e.i(3789),T=e.i(53138),A=e.i(51757),R=e.i(31214),O=e.i(62368);let L=(0,l.default)("ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]);var U=e.i(25981);function _({sync:e}){let s=(0,n.useRef)(null),[a,r]=(0,n.useState)(!1),i=(0,z.useUserStore)(e=>e.wallet),l=null!==e.action;async function o(e){r(!1),await e()}return(0,n.useEffect)(()=>{if(a)return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e);function e(e){s.current?.contains(e.target)||r(!1)}},[a]),(0,t.jsxs)("div",{className:"note-more",ref:s,children:[(0,t.jsx)("button",{className:"btn btn-icon note-more-trigger",onClick:()=>r(e=>!e),title:"更多","aria-label":"更多",children:(0,t.jsx)(L,{size:16})}),a&&(0,t.jsxs)("div",{className:"note-more-menu",children:[(0,t.jsxs)("div",{className:`note-sync-status ${e.hasConflict?"conflict":""}`,children:[(0,t.jsx)("span",{className:"note-sync-status-icon",children:e.hasConflict?(0,t.jsx)(T.AlertTriangle,{size:16}):"synced"===e.status?(0,t.jsx)(A.CheckCircle2,{size:16}):(0,t.jsx)(R.Cloud,{size:16})}),(0,t.jsxs)("span",{children:[(0,t.jsx)("strong",{children:"云同步"}),(0,t.jsx)("small",{children:e.statusLabel})]})]}),(0,t.jsxs)("button",{className:"note-more-item",onClick:()=>o(e.exportLocalBackup),disabled:!i||l,children:[(0,t.jsx)(U.Upload,{size:16}),"本地导出"]}),(0,t.jsxs)("button",{className:"note-more-item",onClick:()=>o(e.importLocalBackup),disabled:!i||l,children:[(0,t.jsx)(O.Download,{size:16}),"本地导入"]})]})]})}var D=e.i(11241),F=e.i(27648);function B({children:e}){return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"sidebar-header sidebar-header-link",onClick:()=>{window.location.href="/"},children:[(0,t.jsx)(D.ArrowLeft,{size:18}),(0,t.jsx)("h1",{children:"MOST PEOPLE"})]}),e,(0,t.jsx)(F.default,{})]})}let W="https://api.most.box/auth/backup";async function I(e,t){let n=await e.clone().json().catch(()=>null);return n?.error||t}function G(e,t){return(0,M.mostEncode)(JSON.stringify({notes:e||[]}),t)}function J(e,t){if(!String(e||"").startsWith("mp://1"))throw Error("无效的备份数据格式");let n=(0,M.mostDecode)(e,t);if(!n)throw Error("解密失败,请确认当前 Web3 登录账号正确");let s=JSON.parse(n);if(!Array.isArray(s.notes))throw Error("备份数据缺少 notes");return s}async function K(e){return(0,E.calculateNoteCid)(JSON.stringify({notes:e||[]}))}async function X(e,t,n=W){let s=Date.now().toString(),a=new URL(n).pathname,r=`${s}:${String(t).toUpperCase()}:${a}`,{address:i,signature:l}=await (0,M.mostSignMessage)(e.danger,r);return{Authorization:`${i},${s},${l}`}}async function V(e,t){let n=JSON.stringify({notes:t||[]}),s=await (0,E.calculateNoteCid)(n);return{cid:s,body:G(t,e.danger),headers:{"Content-Type":"text/plain","x-backup-cid":s,...await X(e,"PUT",W)}}}async function q(e,t,n=W){let s=await V(e,t),a=await fetch(n,{method:"PUT",headers:s.headers,body:s.body});if(!a.ok)throw Error(await I(a,"云备份失败"));return{cid:s.cid}}async function Q(e,t=W){let n=await fetch(t,{method:"GET",headers:await X(e,"GET",t)});if(404===n.status)return{found:!1,cid:"",time:0,notes:[]};if(!n.ok)throw Error(await I(n,"云端恢复失败"));let s=await n.text();if(!s)throw Error("云端无备份数据");let a=J(s,e.danger);return{found:!0,cid:n.headers.get("x-backup-cid")||"",time:Number(n.headers.get("x-backup-time")||0),notes:a.notes}}let H=!1,Y="",Z="";function ee(e,t){return e instanceof Error?e.message:t}let et=(0,s.default)(()=>e.A(71504).then(e=>e.MilkdownEditor),{loadableGenerated:{modules:[36975]},ssr:!1,loading:()=>(0,t.jsx)("div",{className:"note-editor-loading",children:"加载编辑器..."})});function en(e,t){return e instanceof Error?e.message:t}function es(e){return"directory"===e.type?(0,E.normalizeNotePath)(e.path?`${e.path}/${e.name}`:e.name):(0,E.getNoteFullPath)(e)}function ea(){let e=(0,a.useRouter)(),s=(0,a.useSearchParams)(),r=(0,n.useRef)(null),i=function(){let e=(0,z.useUserStore)(e=>e.wallet),t=(0,z.useUserStore)(e=>e.openLoginModal),s=(0,P.useAppStore)(e=>e.addToast),a=(0,P.useAppStore)(e=>e.notes),r=(0,P.useAppStore)(e=>e.importNotes),i=(0,P.useAppStore)(e=>e.localDataReady),[l,o]=(0,n.useState)(null),[c,d]=(0,n.useState)(e?"idle":"disabled"),[u,h]=(0,n.useState)(H),[p,m]=(0,n.useState)(!1),f=(0,n.useRef)(0),x=(0,n.useCallback)(e=>{H=e,h(e)},[]),j=(0,n.useCallback)((e=!1)=>{let n=z.useUserStore.getState().wallet;return n||(e||t(),null)},[s,t]),b=(0,n.useCallback)(async(e={})=>{let{silent:t=!1,confirmConflict:n=!0}=e,a=j(t);if(!a)return d("disabled"),!1;if(H&&n&&!window.confirm("本地数据与云端不一致,本地修改将会覆盖云端数据,是否继续?"))return t||s("已取消同步","info"),d("conflict"),!1;o("save"),d("uploading");try{let e=P.useAppStore.getState().notes;return Y=(await q(a,e)).cid,Z=a.address,x(!1),d("synced"),t||s("云端备份已更新","success"),!0}catch(e){return d("error"),t?console.info(ee(e,"云备份失败")):s(ee(e,"云备份失败"),"error"),!1}finally{o(null)}},[s,j,x]),y=(0,n.useCallback)(async(e={})=>{let{manual:t=!1,uploadWhenMissing:n=!1}=e,a=j(!t);if(!a)return d("disabled"),!1;o(t?"restore":"sync"),d(t?"restoring":"checking");try{let e=await Q(a),i=P.useAppStore.getState().notes;if(!e.found){if(x(!1),Z=a.address,n&&i.length>0)return o(null),b({silent:!0,confirmConflict:!1});return d(i.length>0?"idle":"synced"),t&&s("云端暂无备份","info"),!1}let l=e.notes||[],c=await K(i),u=e.cid||await K(l);if(i.length>0&&c!==u&&!window.confirm("云端备份与本地笔记不一致。恢复会覆盖本地笔记,是否继续?"))return x(!0),d("conflict"),t&&s("已取消恢复","info"),!1;return c!==u&&r(l),Y=u,Z=a.address,x(!1),d("synced"),t&&s("已从云端恢复","success"),!0}catch(e){return d("error"),t?s(ee(e,"云端恢复失败"),"error"):console.info(ee(e,"云端恢复失败")),!1}finally{o(null)}},[s,r,j,x,b]),g=(0,n.useCallback)(()=>{let e=j(!1);if(e)try{let t=P.useAppStore.getState().notes,n=G(t,e.danger),a=new Blob([n],{type:"text/plain"}),r=URL.createObjectURL(a),i=document.createElement("a");i.href=r,i.download=`${e.address.slice(-4)}-most-notes-${new Date().toISOString().slice(0,10)}.txt`,i.click(),URL.revokeObjectURL(r),s("笔记已导出到本地","success")}catch(e){s(ee(e,"导出失败"),"error")}},[s,j]),N=(0,n.useCallback)(()=>{let e=j(!1);if(!e)return;let t=document.createElement("input");t.type="file",t.accept=".txt",t.onchange=t=>{let n=t.target.files?.[0];if(!n)return;let a=new FileReader;a.onload=async()=>{try{let t=a.result,n=J(t,e.danger);if(P.useAppStore.getState().notes.length>0&&!window.confirm("恢复将覆盖当前本地笔记,是否继续?"))return void s("已取消恢复","info");r(n.notes),s("已从本地恢复笔记","success"),await b({silent:!0})}catch(e){s(ee(e,"导入失败"),"error")}},a.readAsText(n)},t.click()},[s,r,j,b]);(0,n.useEffect)(()=>{if(!i)return;if(!e){Z="",Y="",m(!1),x(!1),d("disabled");return}if(Z===e.address){m(!0),d(H?"conflict":"synced");return}let t=!1;return m(!1),y({manual:!1,uploadWhenMissing:!0}).finally(()=>{t||m(!0)}),()=>{t=!0}},[i,y,x,e]),(0,n.useEffect)(()=>{if(!e||!i||!p||(f.current+=1,f.current<=1))return;let t=window.setTimeout(async()=>{let e=P.useAppStore.getState().notes;await K(e)!==Y&&await b({silent:!0})},900);return()=>window.clearTimeout(t)},[p,i,a,b,e]);let v=(0,n.useMemo)(()=>(function(e){switch(e){case"disabled":return"未登录";case"checking":return"检查中";case"uploading":return"同步中";case"restoring":return"恢复中";case"synced":return"已同步";case"conflict":return"有冲突";case"error":return"同步失败";default:return"待同步"}})(c),[c]);return{action:l,status:c,statusLabel:v,hasConflict:u,uploadNow:b,restoreFromCloud:y,exportLocalBackup:g,importLocalBackup:N}}(),l=(0,P.useAppStore)(e=>e.addToast),C=(0,P.useAppStore)(e=>e.isDarkMode),T=(0,P.useAppStore)(e=>e.setIsDarkMode),A=(0,z.useUserStore)(e=>e.wallet),R=(0,z.useUserStore)(e=>e.openLoginModal),O=(0,P.useAppStore)(e=>e.notes),L=(0,P.useAppStore)(e=>e.notesPath),U=(0,P.useAppStore)(e=>e.setNotesPath),D=(0,P.useAppStore)(e=>e.saveNote),F=(0,P.useAppStore)(e=>e.deleteNote),W=(0,P.useAppStore)(e=>e.renameNote),I=(0,P.useAppStore)(e=>e.localDataReady),X=s.get("cid")||"",V=O.find(e=>e.cid===X),ea=!!X,ei=ea&&"edit"===s.get("mode"),[el,eo]=(0,n.useState)(""),[ec,ed]=(0,n.useState)(null),[eu,eh]=(0,n.useState)(null),[ep,em]=(0,n.useState)(null),[ef,ex]=(0,n.useState)(""),[ej,eb]=(0,n.useState)(""),[ey,eg]=(0,n.useState)(""),[eN,ev]=(0,n.useState)(""),[ew,eS]=(0,n.useState)(""),[ek,eC]=(0,n.useState)(""),[eP,ez]=(0,n.useState)(!1),[eM,e$]=(0,n.useState)(""),[eE,eT]=(0,n.useState)(!1);(0,n.useEffect)(()=>{if(!X){ex(""),eb("");return}if(!V){ex(""),eb(I?"笔记不存在":"");return}if(V.content.startsWith("mp://1")){if(!A){ex(""),eb("请先登录 Web3 账号以解密此笔记");return}let e=(0,M.mostDecode)(V.content,A.danger);if(!e){ex(""),eb("无法解密,请确认当前 Web3 账号正确");return}ex(e),eb("");return}ex(V.content||""),eb("")},[X,I,V,A]),(0,n.useEffect)(()=>{if(!ei)return void eT(!1);if(!X||!V){ev(""),eS(""),eC(""),ez(!1),e$(I?"笔记不存在":"");return}if(ev(V.name),eS(V.path||""),ez(!0===V.isSecret||V.content.startsWith("mp://1")),V.content.startsWith("mp://1")){if(!A){eC(""),e$("请先登录 Web3 账号以解密此笔记");return}let e=(0,M.mostDecode)(V.content,A.danger);if(!e){eC(""),e$("无法解密,请确认当前 Web3 账号正确");return}eC(e),e$("");return}eC(V.content||""),e$("")},[X,ei,I,V,A]),(0,n.useEffect)(()=>{eg(V?.name||"")},[V?.cid,V?.name]);let eA=(0,n.useMemo)(()=>(0,E.filterNotesByPath)(O,L,el),[O,L,el]),eR=eA.filter(e=>"file"===e.type).length,eO=V?.isSecret===!0||V?.content.startsWith("mp://1")===!0,eL=(0,n.useMemo)(()=>{let e=L.split("/").filter(Boolean);return[{label:"全部笔记",path:""},...e.map((t,n)=>({label:t,path:e.slice(0,n+1).join("/")}))]},[L]),eU=(0,n.useMemo)(()=>(function(e){let t=new Set;for(let n of e){let e=(0,E.normalizeNotePath)(n.path).split("/").filter(Boolean);for(let n=0;n<e.length;n+=1)t.add(e.slice(0,n+1).join("/"))}return Array.from(t).sort((e,t)=>e.localeCompare(t,"zh-CN")).map(e=>{let t=e.split("/");return{path:e,name:t[t.length-1]||e,parentPath:t.slice(0,-1).join("/"),depth:Math.max(t.length-1,0)}})})(O),[O]);function e_(){return!!A||(R(),!1)}async function eD(){if(e_()){if(!V)return void l("笔记不存在","error");if(!eN.trim())return void l("请输入笔记名称","warning");eT(!0);try{let t=r.current?.getMarkdown()??ek,n=eP?(0,M.mostEncode)(t,A.danger):t,s=await D({cid:V.cid,name:eN,path:ew,content:n,isSecret:eP});eC(t),l("笔记已保存","success"),await i.uploadNow({silent:!0}),e.replace(`/note/?cid=${encodeURIComponent(s)}`)}catch(e){l(en(e,"保存失败"),"error")}finally{eT(!1)}}}async function eF(){if(!e_()||!V)return;let e=ey.trim();if(!e){eg(V.name),l("请输入笔记名称","warning");return}if(e!==V.name)try{W((0,E.getNoteFullPath)(V),V.path,e),l("已重命名","success"),await i.uploadNow({silent:!0})}catch(e){eg(V.name),l(en(e,"重命名失败"),"error")}}async function eB(e){if(ep)try{W(es(ep),e,ep.name),em(null),l("已移动","success"),await i.uploadNow({silent:!0})}catch(e){l(en(e,"移动失败"),"error")}}let eW=(0,t.jsxs)("div",{className:"note-header-title",children:[(0,t.jsx)("h2",{className:"header-title",children:"笔记"}),(0,t.jsxs)("span",{children:[O.length," 篇"]})]}),eI=(0,t.jsxs)("div",{className:"note-theme-wrap",children:[(0,t.jsx)("button",{className:"btn btn-icon",onClick:()=>T(!C),title:"切换主题","aria-label":"切换主题",children:C?(0,t.jsx)(y.Sun,{size:16}):(0,t.jsx)(m.Moon,{size:16})}),(0,t.jsx)(_,{sync:i})]}),eG=(0,t.jsxs)("section",{className:"note-list-panel note-sidebar-list","aria-label":"笔记列表",children:[(0,t.jsxs)("div",{className:"note-list-header",children:[(0,t.jsx)("div",{className:"note-current-location",children:(0,t.jsx)("div",{className:"note-breadcrumbs",children:eL.map((e,s)=>(0,t.jsxs)(n.default.Fragment,{children:[s>0&&(0,t.jsx)("span",{children:"/"}),(0,t.jsx)("button",{onClick:()=>U(e.path),children:e.label})]},e.path||"root"))})}),(0,t.jsxs)("span",{className:"note-count",children:[eR," 篇"]})]}),(0,t.jsxs)("div",{className:"note-search",children:[(0,t.jsx)(b.Search,{size:16}),(0,t.jsx)("input",{className:"input input-flex",value:el,onChange:e=>eo(e.target.value),placeholder:"搜索笔记"})]}),0===eA.length?(0,t.jsxs)("div",{className:"note-empty-state",children:[(0,t.jsx)(f.NotebookPen,{size:32}),(0,t.jsx)("p",{children:el?"未找到笔记":"还没有笔记"})]}):(0,t.jsx)("div",{className:"note-list",children:eA.map(n=>(0,t.jsx)("article",{className:`note-list-item ${"file"===n.type&&n.cid===X?"active":""}`,children:(0,t.jsxs)("button",{className:`note-list-item-main ${"directory"===n.type?"folder":""}`,onClick:()=>{if("directory"===n.type)U((0,E.normalizeNotePath)(n.path?`${n.path}/${n.name}`:n.name));else e.push(`/note/?cid=${encodeURIComponent(n.cid)}`)},children:[(0,t.jsx)("span",{className:"note-list-icon",children:"directory"===n.type?(0,t.jsx)(u.Folder,{size:18}):n.isSecret?(0,t.jsx)(p.Lock,{size:18}):(0,t.jsx)(d.FileText,{size:18})}),(0,t.jsxs)("span",{className:"note-list-copy",children:[(0,t.jsx)("span",{className:"note-list-name",children:n.name}),"file"===n.type?(0,t.jsx)("span",{className:"note-list-preview",children:n.isSecret||n.content.startsWith("mp://1")?"私密内容已加密":String(n.content||"").replace(/```[\s\S]*?```/g," ").replace(/!\[[^\]]*]\([^)]*\)/g," ").replace(/\[([^\]]+)]\([^)]*\)/g,"$1").replace(/[#>*_`~|-]/g," ").replace(/\s+/g," ").trim()||"空白笔记"}):(0,t.jsx)("span",{className:"note-list-preview",children:"文件夹"})]}),"file"===n.type&&(0,t.jsx)("span",{className:"note-list-date",children:(0,$.formatDate)(n.updated_at)})]})},`${n.cid}:${n.path}:${n.name}`))}),(0,t.jsx)("div",{className:"note-create-btn",children:(0,t.jsxs)("button",{className:"btn",onClick:function(){e_()&&ed({title:"新建笔记",placeholder:"笔记名称",confirmText:"创建",onConfirm:async t=>{if(e_())try{let n=await D({name:t,path:L,content:"",isSecret:!1});ed(null),l("笔记已创建","success"),await i.uploadNow({silent:!0}),e.push(`/note/?cid=${encodeURIComponent(n)}&mode=edit`)}catch(e){l(en(e,"创建失败"),"error")}}})},children:[(0,t.jsx)(x.Plus,{size:16}),"新笔记"]})})]});return(0,t.jsxs)(v.default,{sidebar:()=>(0,t.jsx)(B,{children:eG}),headerTitle:eW,headerRight:eI,children:[(0,t.jsx)("main",{className:`note-page note-browser-page ${ea?"has-editor":""}`,children:(0,t.jsx)("section",{className:"note-workspace",children:(0,t.jsx)("section",{className:"note-editor-panel","aria-label":ei?"笔记编辑器":"笔记阅读器",children:ea?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"note-editor-panel-header",children:[(0,t.jsxs)("div",{className:"note-editor-title-area",children:[ei?(0,t.jsx)("input",{className:"note-title-input",value:eN,onChange:e=>ev(e.target.value),placeholder:"笔记名称",disabled:!V}):V?(0,t.jsx)("input",{className:"note-title-input",value:ey,onBlur:eF,onChange:e=>eg(e.target.value),onKeyDown:e=>{"Enter"===e.key&&e.currentTarget.blur(),"Escape"===e.key&&(eg(V.name),e.currentTarget.blur())},placeholder:"笔记名称",title:"重命名"}):(0,t.jsx)("h3",{children:"未命名笔记"}),V&&(0,t.jsxs)("div",{className:"note-editor-info",children:[(0,t.jsx)("span",{children:ei?"编辑模式":"阅读模式"}),(0,t.jsx)("span",{children:ei?eP?"私密":"公开":eO?"私密":"公开"}),(0,t.jsx)("span",{children:(0,$.formatDate)(V.updated_at)})]})]}),(0,t.jsxs)("div",{className:"note-editor-actions",children:[(0,t.jsx)("button",{type:"button",className:"btn btn-icon",onClick:ei?function(){e.push(V?`/note/?cid=${encodeURIComponent(V.cid)}`:"/note/")}:()=>e.push("/note/"),title:ei?"取消":"关闭","aria-label":ei?"取消":"关闭",children:(0,t.jsx)(N.X,{size:16})}),ei?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("button",{className:`btn btn-sm ${eP?"btn-warning":"btn-secondary"}`,onClick:()=>ez(!eP),disabled:!V,children:[eP?(0,t.jsx)(p.Lock,{size:16}):(0,t.jsx)(c.Eye,{size:16}),eP?"私密":"公开"]}),(0,t.jsxs)("button",{className:"btn btn-sm btn-primary",onClick:eD,disabled:eE||!!eM||!V,children:[(0,t.jsx)(j.Save,{size:16}),eE?"保存中":"保存"]})]}):V&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("button",{type:"button",className:"btn btn-icon",onClick:()=>{e_()&&em(V)},title:"移动","aria-label":"移动",children:(0,t.jsx)(h,{size:16})}),(0,t.jsx)("button",{type:"button",className:"btn btn-icon note-editor-action-danger",onClick:()=>(function(t){if(!e_())return;let n="directory"===t.type;eh({title:n?"删除文件夹":"删除笔记",message:`确定要删除「${t.name}」吗?此操作不可撤销。`,confirmText:"删除",onConfirm:async()=>{F(n?void 0:t.cid,t.path,t.name),eh(null),l("已删除","success"),await i.uploadNow({silent:!0}),"file"===t.type&&t.cid===X&&e.push("/note/")}})})(V),title:"删除","aria-label":"删除",children:(0,t.jsx)(g.Trash2,{size:16})}),(0,t.jsxs)("button",{type:"button",className:"btn btn-sm btn-primary",onClick:()=>{e.push(`/note/?cid=${encodeURIComponent(V.cid)}&mode=edit`)},disabled:!!ej,title:"编辑","aria-label":"编辑",children:[(0,t.jsx)(o,{size:16}),"编辑"]})]})]})]}),ei?eM?(0,t.jsxs)("div",{className:"note-empty-state editor-error",children:[(0,t.jsx)(p.Lock,{size:36}),(0,t.jsx)("p",{children:eM})]}):V?(0,t.jsx)("div",{className:"note-editor-frame editing",children:(0,t.jsx)(et,{ref:r,content:ek,onChange:eC,className:"milkdown-editor"})}):(0,t.jsxs)("div",{className:"note-empty-state editor-error",children:[(0,t.jsx)(f.NotebookPen,{size:36}),(0,t.jsx)("p",{children:I?"笔记不存在":"加载中..."})]}):ej?(0,t.jsxs)("div",{className:"note-empty-state editor-error",children:[(0,t.jsx)(p.Lock,{size:36}),(0,t.jsx)("p",{children:ej})]}):V?(0,t.jsx)("div",{className:"note-editor-frame reading",children:(0,t.jsx)(et,{content:ef,readOnly:!0,className:"milkdown-editor"})}):(0,t.jsxs)("div",{className:"note-empty-state editor-error",children:[(0,t.jsx)(f.NotebookPen,{size:36}),(0,t.jsx)("p",{children:I?"笔记不存在":"加载中..."})]})]}):(0,t.jsxs)("div",{className:"note-editor-empty",children:[(0,t.jsx)("div",{className:"note-editor-empty-icon",children:(0,t.jsx)(f.NotebookPen,{size:32})}),(0,t.jsx)("h3",{children:"没有打开的笔记"}),(0,t.jsx)("p",{children:O.length>0?"选择一篇笔记继续":"创建第一篇笔记"}),(0,t.jsx)(w.default,{label:"打开笔记列表",variant:"default"})]})})})}),ec&&(0,t.jsx)(k.InputModal,{title:ec.title,placeholder:ec.placeholder,defaultValue:ec.defaultValue,confirmText:ec.confirmText,onConfirm:ec.onConfirm,onClose:()=>ed(null)}),eu&&(0,t.jsx)(S.ConfirmModal,{title:eu.title,message:eu.message,confirmText:eu.confirmText,danger:!0,onConfirm:eu.onConfirm,onClose:()=>eh(null)}),ep&&(0,t.jsx)(er,{target:ep,directories:eU,onMove:eB,onClose:()=>em(null)})]})}function er({target:e,directories:s,onMove:a,onClose:l}){let o=(0,E.normalizeNotePath)(e.path||""),c=es(e),d=s.filter(t=>"directory"!==e.type||t.path!==c&&!t.path.startsWith(`${c}/`)),[h,p]=(0,n.useState)(o),[m,f]=(0,n.useState)(""),[x,j]=(0,n.useState)(new Set),b=(0,E.normalizeNotePath)(m),y=m.trim()?b:h,g=(0,E.normalizeNotePath)(y)===o,v=new Map;for(let e of d){let t=v.get(e.parentPath)||[];t.push(e),v.set(e.parentPath,t)}let w=d.filter(e=>{if(!e.parentPath)return!0;let t=e.parentPath.split("/").filter(Boolean);return t.every((e,n)=>x.has(t.slice(0,n+1).join("/")))}),S=[{label:"全部笔记",path:""},...h.split("/").filter(Boolean).map((e,t,n)=>({label:e,path:n.slice(0,t+1).join("/")}))];function k(e){p((0,E.normalizeNotePath)(e)),f("")}return(0,t.jsx)(C.ModalOverlay,{onClose:l,children:(0,t.jsxs)("div",{className:"note-move-modal",onClick:e=>e.stopPropagation(),children:[(0,t.jsxs)("div",{className:"modal-header",children:[(0,t.jsx)("h3",{children:"移动笔记"}),(0,t.jsx)("button",{className:"btn btn-icon",onClick:l,children:(0,t.jsx)(N.X,{size:18})})]}),(0,t.jsxs)("div",{className:"note-move-target",children:[(0,t.jsx)("span",{children:"正在移动"}),(0,t.jsx)("strong",{children:e.name})]}),(0,t.jsx)("div",{className:"note-move-path",children:S.map((e,s)=>(0,t.jsxs)(n.default.Fragment,{children:[s>0&&(0,t.jsx)("span",{children:"/"}),(0,t.jsx)("button",{type:"button",onClick:()=>k(e.path),children:e.label})]},e.path||"root"))}),(0,t.jsxs)("div",{className:"note-move-folder-list",children:[(0,t.jsxs)("button",{type:"button",className:`note-move-folder-item ${""===h?"selected":""}`,onClick:()=>k(""),children:[(0,t.jsx)("span",{className:"note-move-folder-spacer"}),(0,t.jsx)(u.Folder,{className:"note-move-folder-icon",size:16}),(0,t.jsx)("span",{children:"全部笔记"})]}),0===d.length?(0,t.jsx)("p",{className:"note-move-empty",children:"还没有可选文件夹"}):w.map(e=>{let n=v.has(e.path),s=x.has(e.path);return(0,t.jsxs)("button",{type:"button",className:`note-move-folder-item note-move-depth-${Math.min(e.depth,4)} ${h===e.path?"selected":""}`,onClick:()=>{var t;k(t=e.path),v.has(t)&&j(e=>{let n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n})},children:[n?s?(0,t.jsx)(r.ChevronDown,{className:"note-move-expander",size:14}):(0,t.jsx)(i.ChevronRight,{className:"note-move-expander",size:14}):(0,t.jsx)("span",{className:"note-move-folder-spacer"}),(0,t.jsx)(u.Folder,{className:"note-move-folder-icon",size:16}),(0,t.jsx)("span",{children:e.name}),e.parentPath&&(0,t.jsx)("small",{children:e.parentPath})]},e.path)})]}),(0,t.jsx)("input",{className:"input input-compact",value:m,onChange:e=>f(e.target.value),placeholder:"或输入新目录路径,如 文章/摘录"}),(0,t.jsxs)("div",{className:"note-move-destination",children:["目标位置:",y||"全部笔记"]}),(0,t.jsxs)("div",{className:"modal-actions",children:[(0,t.jsx)("button",{className:"btn btn-secondary",onClick:l,children:"取消"}),(0,t.jsx)("button",{className:"btn btn-primary",onClick:function(){g||a(y)},disabled:g,children:"移动"})]})]})})}e.s(["default",0,function(){return(0,t.jsx)(n.Suspense,{fallback:(0,t.jsx)("div",{className:"note-editor-loading",children:"加载中..."}),children:(0,t.jsx)(ea,{})})}],58559)}]);