most-box 0.3.2 → 0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/out/admin/index.html +0 -0
- package/out/app/index.html +0 -0
- package/out/assets/{AccountMenu-BgbcUc0m.js → AccountMenu-D36x3rKH.js} +1 -1
- package/out/assets/{AppTop-DZFTO9-m.js → AppTop-qtp-3wqv.js} +1 -1
- package/out/assets/{CopyButton-B03fpFFc.js → CopyButton-C00LHzxo.js} +1 -1
- package/out/assets/{FilePreviewOverlay-CA04_Ved.js → FilePreviewOverlay-BvOCftIV.js} +1 -1
- package/out/assets/{MarketingHeader-BVJy8hXd.js → MarketingHeader-D7AjEmWU.js} +1 -1
- package/out/assets/MarketingLayout-BVw4vr-u.js +1 -0
- package/out/assets/{MilkdownEditor-Dw_ze7EE.js → MilkdownEditor-DXVbZsH_.js} +1 -1
- package/out/assets/{OpenSidebarButton-C2UJYXKh.js → OpenSidebarButton-DI6Ld8um.js} +1 -1
- package/out/assets/arrow-up-down-B-677ip8.js +1 -0
- package/out/assets/{chatJoinInvite-BcPz_IV5.js → chatJoinInvite-aCHhLrlm.js} +1 -1
- package/out/assets/chevron-right-D75NRNNs.js +1 -0
- package/out/assets/downloadValidation-UPgpJbKz.js +1 -0
- package/out/assets/folder-BS_GbpPQ.js +1 -0
- package/out/assets/{index-DjBN7bZV.js → index-CUzbruyP.js} +3 -3
- package/out/assets/index-FV6RZlVI.css +1 -0
- package/out/assets/{index.lazy-Bdh8QUOx.js → index.lazy-08bEbzIk.js} +1 -1
- package/out/assets/{index.lazy-DSsE3iyf.js → index.lazy-6b-8jxXI.js} +1 -1
- package/out/assets/index.lazy-B4pxVFWK.js +2 -0
- package/out/assets/index.lazy-Bi5KZylP.js +5 -0
- package/out/assets/{index.lazy-BfAHB94y.js → index.lazy-CJnFeoy4.js} +1 -1
- package/out/assets/{index.lazy-C9-w4fAF.js → index.lazy-CRV2-Y6z.js} +1 -1
- package/out/assets/{index.lazy-BUODxlbz.js → index.lazy-CzCHV559.js} +1 -1
- package/out/assets/index.lazy-DrfZ9XTR.js +1 -0
- package/out/assets/{index.lazy-CNQbNKyf.js → index.lazy-DuvCRtpm.js} +1 -1
- package/out/assets/{index.lazy-CtUrBLS0.js → index.lazy-DxOIgf3c.js} +1 -1
- package/out/assets/index.lazy-FNVWBYth.js +1 -0
- package/out/assets/index.lazy-Itk05ouU.js +1 -0
- package/out/assets/{index.lazy-Cd0znkpY.js → index.lazy-_CazgyO7.js} +1 -1
- package/out/assets/index.lazy-odd8ydDw.js +3 -0
- package/out/assets/notebook-pen-BzrCXQJE.js +1 -0
- package/out/assets/{useGameRoom-B1_r6bc7.js → useGameRoom-CATo4XWU.js} +1 -1
- package/out/chat/index.html +0 -0
- package/out/chat/join/demo/index.html +0 -0
- package/out/chat/join/index.html +0 -0
- package/out/download/index.html +2 -2
- package/out/game/gandengyan/index.html +0 -0
- package/out/game/index.html +0 -0
- package/out/game/zhajinhua/index.html +0 -0
- package/out/index.html +2 -2
- package/out/note/index.html +0 -0
- package/out/ping/index.html +2 -2
- package/out/profile/index.html +0 -0
- package/out/web3/index.html +0 -0
- package/package.json +4 -3
- package/server/src/core/channelAttachment.js +2 -2
- package/server/src/index.js +8 -8
- package/out/assets/MarketingLayout-Cltu-DRw.js +0 -1
- package/out/assets/downloadValidation-Zvllo2SZ.js +0 -1
- package/out/assets/folder-DAcox9xz.js +0 -1
- package/out/assets/folder-open-Di0oALaC.js +0 -1
- package/out/assets/index-B6acG3-t.css +0 -1
- package/out/assets/index.lazy-Ba2rqd32.js +0 -3
- package/out/assets/index.lazy-Bo0LfJNK.js +0 -2
- package/out/assets/index.lazy-CyNgk0ta.js +0 -1
- package/out/assets/index.lazy-D3HxQTg_.js +0 -1
- package/out/assets/index.lazy-DWXndrGa.js +0 -1
- package/out/assets/index.lazy-Dk7cmQ-j.js +0 -2
- package/out/assets/notebook-pen-SWT-zZ4v.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,o as t,t as n}from"./jsx-runtime-Bt-cYkS5.js";import{B as r,E as i,H as a,O as ee,W as o,n as te,o as ne,t as s}from"./useAppStore-DOnk608w.js";import{n as c,r as l}from"./mp-Dv12gDTx.js";import{t as u}from"./circle-alert-dfN4T6Nq.js";import{t as d}from"./check-iBCQl0yr.js";import{t as re}from"./download-COQOcPqI.js";import{t as ie}from"./external-link-D6tHlYgS.js";import{t as ae}from"./key-round-JR8M3aHl.js";import{i as f}from"./AccountMenu-D36x3rKH.js";import{t as p}from"./loader-CwyHYZdX.js";import{t as m}from"./save-B02sbO9Y.js";import{t as h}from"./shield-check-Boae7Nc6.js";import{t as g}from"./upload-DVuXJt_o.js";import{A as _,D as v,S as y,d as b,f as x,h as S,m as C,n as oe,p as w,v as se,y as ce}from"./index-CUzbruyP.js";import{t as le}from"./MarketingHeader-D7AjEmWU.js";import{t as T}from"./CopyButton-C00LHzxo.js";import{t as E}from"./MarketingLayout-BVw4vr-u.js";var ue=r(`cloud-download`,[[`path`,{d:`M12 13v8l-4-4`,key:`1f5nwf`}],[`path`,{d:`m12 21 4-4`,key:`1lfcce`}],[`path`,{d:`M4.393 15.269A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.436 8.284`,key:`ui1hmy`}]]),de=r(`cloud-upload`,[[`path`,{d:`M12 13v8`,key:`1l5pq0`}],[`path`,{d:`M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242`,key:`1pljnt`}],[`path`,{d:`m8 17 4-4 4 4`,key:`1quai1`}]]),fe=r(`log-out`,[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]),pe=r(`wallet-cards`,[[`path`,{d:`M3 11h3.75a2 2 0 0 1 1.6.8l.45.6a4 4 0 0 0 6.4 0l.45-.6a2 2 0 0 1 1.6-.8H21`,key:`1vwh6y`}],[`path`,{d:`M3 7h18`,key:`1uiuf2`}],[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}]]),D=t(e(),1),O=n(),k=[{value:``,labelKey:`profile.avatar.address`},...b.map(e=>({value:w(e),labelKey:`profile.avatar.${e}`}))];function A(e){if(C(e))return!0;try{let t=new URL(e);return t.protocol===`http:`||t.protocol===`https:`}catch{return!1}}function j(e){return e===`disabled`?`is-disabled`:e===`working`?`is-working`:e===`synced`?`is-synced`:e===`error`?`is-error`:`is-idle`}function M({status:e,busy:t}){return t||e===`working`?(0,O.jsx)(p,{size:16,className:`ui-spinner`}):e===`synced`?(0,O.jsx)(v,{size:16}):e===`error`?(0,O.jsx)(u,{size:16}):(0,O.jsx)(h,{size:16})}function N(){let{formatNumber:e,t}=_(),n=s(e=>e.addToast),r=s(e=>e.hasBackend),a=i(e=>e.identity),u=i(e=>e.openLoginModal),v=i(e=>e.setUserIdentity),b=i(e=>e.logoutUser),C=oe(),[w,N]=(0,D.useState)(``),[I,L]=(0,D.useState)(``),[R,z]=(0,D.useState)(``),[B,V]=(0,D.useState)(!1),[H,U]=(0,D.useState)(null),W=(0,O.jsx)(le,{});(0,D.useEffect)(()=>{if(!a){N(``),L(``),z(``);return}N(a.displayName||a.username),L(S(a.avatar)||a.avatar||``),z(``)},[a]),(0,D.useEffect)(()=>{a&&C.refreshBackupSummary()},[C.refreshBackupSummary,r,a]);let G=(0,D.useMemo)(()=>a?ee(a.danger):null,[a]),me=(0,D.useMemo)(()=>G?c(G.private_key,G.ed_public_key):``,[G]);if(!a)return(0,O.jsx)(E,{header:W,children:(0,O.jsx)(`section`,{className:`profile-page`,children:(0,O.jsx)(`div`,{className:`profile-container narrow`,children:(0,O.jsxs)(`div`,{className:`profile-empty glass`,children:[(0,O.jsx)(`div`,{className:`profile-empty-icon`,children:(0,O.jsx)(f,{size:34})}),(0,O.jsx)(`h1`,{children:t(`profile.signedOut.title`)}),(0,O.jsx)(`p`,{children:t(`profile.signedOut.desc`)}),(0,O.jsxs)(`button`,{type:`button`,className:`btn btn-primary`,onClick:u,children:[(0,O.jsx)(f,{size:16}),t(`account.signIn`)]})]})})})});let he=S(a.avatar)||a.avatar||``,ge=x(a.address,a.avatar),K=a.address.toLowerCase(),_e=I.trim().length>0,ve=j(C.status),q=C.action===`backup`,J=C.action===`restore`,Y=C.action===`export`,X=C.action===`import`,ye=[{key:`notes`,label:t(`profile.backup.summary.notes`),value:C.notesCount},{key:`files`,label:t(`profile.backup.summary.files`),value:C.backupSummary.filesCount},{key:`trash`,label:t(`profile.backup.summary.trash`),value:C.backupSummary.trashFilesCount},{key:`channels`,label:t(`profile.backup.summary.channels`),value:C.backupSummary.channelsCount}];function be(){U({title:t(`profile.backup.confirm.backupTitle`),message:t(`profile.backup.confirm.backupMessage`),confirmText:t(`profile.backup.action.cloudBackup`),onConfirm:async()=>{U(null),await C.backupToCloud()}})}function xe(){U({title:t(`profile.backup.confirm.restoreTitle`),message:t(`profile.backup.confirm.restoreMessage`),confirmText:t(`profile.backup.action.cloudRestore`),onConfirm:async()=>{U(null),await C.restoreFromCloud({confirm:!1})}})}function Se(){return new Promise(e=>{let n=t=>{U(null),e(t)};U({title:t(`profile.backup.confirm.importTitle`),message:t(`profile.backup.confirm.restore`),confirmText:t(`profile.backup.action.importLocal`),onConfirm:()=>n(!0),onClose:()=>n(!1)})})}function Z(){C.importLocalBackup({requestConfirm:Se})}let Ce=[{key:`cloud-backup`,tone:`cloud-backup`,label:t(q?`profile.backup.status.backingUp`:`profile.backup.action.cloudBackup`),icon:q?(0,O.jsx)(p,{size:16,className:`ui-spinner`}):(0,O.jsx)(de,{size:16}),onClick:be},{key:`cloud-restore`,tone:`cloud-restore`,label:t(J?`profile.backup.status.restoring`:`profile.backup.action.cloudRestore`),icon:J?(0,O.jsx)(p,{size:16,className:`ui-spinner`}):(0,O.jsx)(ue,{size:16}),onClick:xe},{key:`export-local`,tone:`export-local`,label:t(Y?`profile.backup.status.exporting`:`profile.backup.action.exportLocal`),icon:Y?(0,O.jsx)(p,{size:16,className:`ui-spinner`}):(0,O.jsx)(re,{size:16}),onClick:C.exportLocalBackup},{key:`import-local`,tone:`import-local`,label:t(X?`profile.backup.status.importing`:`profile.backup.action.importLocal`),icon:X?(0,O.jsx)(p,{size:16,className:`ui-spinner`}):(0,O.jsx)(g,{size:16}),onClick:Z}];async function Q(e){if(r===!0)try{await te.put(`/api/user/profile`,{json:{displayName:e.displayName||e.username,avatar:e.avatar||``,updatedAt:e.profileUpdatedAt||Date.now()}}).json()}catch(e){n(await ne(e,t(`profile.backup.error.profileSaveFailed`)),`error`)}}function $(e){if(!a)return;let r={...a,avatar:e||void 0,profileUpdatedAt:Date.now()};v(r),Q(r),z(``),n(t(`profile.toast.avatarUpdated`),`success`)}function we(){if(!a)return;let e=w.trim()||a.username,r={...a,displayName:e,profileUpdatedAt:Date.now()};v(r),Q(r),N(e),n(t(`profile.toast.saved`),`success`)}function Te(){let e=I.trim();if(!e){$(void 0);return}if(!A(e)){z(t(`nav.avatarUrlInvalid`));return}$(e)}function Ee(){b(),V(!1)}return(0,O.jsxs)(E,{header:W,children:[(0,O.jsx)(`section`,{className:`profile-page`,children:(0,O.jsxs)(`div`,{className:`profile-container`,children:[(0,O.jsxs)(`section`,{className:`profile-panel profile-backup-card`,children:[(0,O.jsxs)(`div`,{className:`profile-panel-header profile-backup-header`,children:[(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`h2`,{children:t(`profile.section.backup`)}),(0,O.jsx)(`p`,{children:t(`profile.section.backup.desc`)})]}),(0,O.jsxs)(`span`,{className:`profile-backup-status ${ve}`,children:[(0,O.jsx)(M,{status:C.status,busy:C.busy}),C.statusLabel]})]}),(0,O.jsx)(`div`,{className:`profile-backup-summary`,"aria-label":t(`profile.backup.summary.label`),children:ye.map(t=>(0,O.jsxs)(`div`,{className:`profile-backup-stat`,children:[(0,O.jsx)(`span`,{className:`profile-backup-stat-value`,children:t.value===null?C.backupSummary.loading?`...`:`-`:e(t.value)}),(0,O.jsx)(`span`,{className:`profile-backup-stat-label`,children:t.label})]},t.key))}),(0,O.jsx)(`div`,{className:`profile-backup-actions`,children:Ce.map(e=>(0,O.jsxs)(`button`,{type:`button`,className:[`btn`,`profile-backup-action`,`is-${e.tone}`].join(` `),disabled:C.busy,onClick:e.onClick,children:[e.icon,e.label]},e.key))})]}),(0,O.jsxs)(`header`,{className:`profile-header`,children:[(0,O.jsx)(`img`,{className:`profile-avatar-large`,src:ge,alt:``}),(0,O.jsxs)(`div`,{className:`profile-heading`,children:[(0,O.jsx)(`p`,{className:`profile-kicker`,children:t(`profile.kicker`)}),(0,O.jsx)(`h1`,{children:a.displayName||a.username}),(0,O.jsxs)(`div`,{className:`profile-address-line`,children:[(0,O.jsx)(`code`,{translate:`no`,children:K}),(0,O.jsx)(T,{text:K}),(0,O.jsxs)(`a`,{href:`https://debank.com/profile/${a.address}`,target:`_blank`,rel:`noopener noreferrer`,className:`btn btn-secondary btn-sm`,children:[(0,O.jsx)(ie,{size:14}),t(`web3.action.view`)]})]})]}),(0,O.jsxs)(`button`,{type:`button`,className:`btn btn-secondary profile-logout-btn`,onClick:()=>V(!0),children:[(0,O.jsx)(fe,{size:16}),t(`account.logout`)]})]}),(0,O.jsxs)(`div`,{className:`profile-grid`,children:[(0,O.jsxs)(`section`,{className:`profile-panel`,children:[(0,O.jsx)(`div`,{className:`profile-panel-header`,children:(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`h2`,{children:t(`profile.section.account`)}),(0,O.jsx)(`p`,{children:t(`profile.section.account.desc`)})]})}),(0,O.jsxs)(`label`,{className:`profile-field`,children:[(0,O.jsx)(`span`,{children:t(`profile.label.displayName`)}),(0,O.jsxs)(`div`,{className:`profile-field-row`,children:[(0,O.jsx)(`input`,{className:`input`,value:w,onChange:e=>N(e.target.value),placeholder:t(`nav.displayNamePlaceholder`)}),(0,O.jsxs)(`button`,{type:`button`,className:`btn btn-primary`,onClick:we,children:[(0,O.jsx)(m,{size:16}),t(`profile.action.save`)]})]})]}),(0,O.jsx)(`div`,{className:`profile-facts`,children:(0,O.jsx)(P,{label:t(`profile.label.username`),value:a.username})})]}),(0,O.jsxs)(`section`,{className:`profile-panel`,children:[(0,O.jsx)(`div`,{className:`profile-panel-header`,children:(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`h2`,{children:t(`profile.section.avatar`)}),(0,O.jsx)(`p`,{children:t(`profile.section.avatar.desc`)})]})}),(0,O.jsx)(`div`,{className:`profile-avatar-grid`,role:`list`,children:k.map(e=>{let n=he===e.value;return(0,O.jsxs)(`button`,{type:`button`,className:[`profile-avatar-option`,n?`selected`:``].filter(Boolean).join(` `),onClick:()=>$(e.value),"aria-pressed":n,title:t(e.labelKey),children:[(0,O.jsx)(`img`,{src:x(a.address,e.value),alt:``,"aria-hidden":`true`}),(0,O.jsx)(`span`,{children:t(e.labelKey)}),n&&(0,O.jsx)(`span`,{className:`profile-avatar-check`,children:(0,O.jsx)(d,{size:14})})]},e.value||`address`)})}),(0,O.jsxs)(`div`,{className:`profile-avatar-url`,children:[(0,O.jsxs)(`label`,{className:`profile-field`,htmlFor:`profile-avatar-url`,children:[(0,O.jsx)(`span`,{children:t(`profile.label.customAvatar`)}),(0,O.jsxs)(`div`,{className:`profile-field-row`,children:[(0,O.jsx)(`input`,{id:`profile-avatar-url`,className:`input`,value:I,onChange:e=>{L(e.target.value),z(``)},placeholder:t(`nav.avatarUrlPlaceholder`)}),(0,O.jsxs)(`button`,{type:`button`,className:`btn btn-secondary`,onClick:Te,disabled:!_e,children:[(0,O.jsx)(m,{size:16}),t(`profile.action.save`)]})]})]}),R&&(0,O.jsx)(`p`,{className:`profile-error`,children:R})]})]})]}),(0,O.jsxs)(`section`,{className:`profile-panel profile-identity-panel`,children:[(0,O.jsxs)(`div`,{className:`profile-panel-header`,children:[(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`h2`,{children:t(`profile.section.identity`)}),(0,O.jsx)(`p`,{children:t(`profile.section.identity.desc`)})]}),(0,O.jsxs)(o,{to:`/web3/`,hash:`wallet`,className:`btn btn-secondary`,children:[(0,O.jsx)(pe,{size:16}),t(`profile.action.openWallet`)]})]}),(0,O.jsxs)(`div`,{className:`profile-key-grid`,children:[G&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(F,{title:t(`web3.label.ed25519Public`),icon:(0,O.jsx)(l,{size:18}),value:G.ed_public_key}),(0,O.jsx)(F,{title:t(`web3.label.x25519Public`),icon:(0,O.jsx)(ae,{size:18}),value:G.public_key})]}),(0,O.jsx)(F,{title:`IPNS ID`,icon:(0,O.jsx)(h,{size:18}),value:me||`-`})]})]})]})}),H&&(0,O.jsx)(se,{title:H.title,message:H.message,confirmText:H.confirmText,danger:H.danger,onConfirm:H.onConfirm,onClose:H.onClose||(()=>U(null))}),B&&(0,O.jsx)(ce,{className:`profile-logout-overlay`,onClose:()=>V(!1),children:(0,O.jsxs)(`div`,{className:`confirm-modal profile-logout-modal`,onClick:e=>e.stopPropagation(),children:[(0,O.jsxs)(`div`,{className:`modal-header`,children:[(0,O.jsx)(`h3`,{children:t(`account.logoutTitle`)}),(0,O.jsx)(`button`,{type:`button`,className:`btn btn-icon`,onClick:()=>V(!1),"aria-label":t(`common.close`),children:(0,O.jsx)(y,{size:18})})]}),(0,O.jsx)(`p`,{className:`profile-logout-reminder`,children:t(`profile.logout.backupReminder`)}),(0,O.jsxs)(`div`,{className:`profile-logout-backup-actions`,children:[(0,O.jsx)(`button`,{type:`button`,className:`btn btn-secondary`,disabled:C.busy,onClick:()=>void C.backupToCloud(),children:t(`profile.backup.action.cloudBackup`)}),(0,O.jsx)(`button`,{type:`button`,className:`btn btn-secondary`,disabled:C.busy,onClick:()=>void C.exportLocalBackup(),children:t(`profile.backup.action.exportLocal`)})]}),(0,O.jsxs)(`div`,{className:`modal-actions`,children:[(0,O.jsx)(`button`,{type:`button`,className:`btn btn-secondary`,onClick:()=>V(!1),children:t(`common.cancel`)}),(0,O.jsx)(`button`,{type:`button`,className:`btn btn-danger`,onClick:Ee,children:t(`account.logout`)})]})]})})]})}function P({label:e,value:t,copy:n=!1}){return(0,O.jsxs)(`div`,{className:`profile-fact`,children:[(0,O.jsx)(`span`,{children:e}),(0,O.jsxs)(`div`,{className:`profile-fact-value`,children:[(0,O.jsx)(`code`,{translate:`no`,children:t}),n&&(0,O.jsx)(T,{text:t})]})]})}function F({title:e,icon:t,value:n}){return(0,O.jsxs)(`div`,{className:`profile-key-card`,children:[(0,O.jsxs)(`div`,{className:`profile-key-card-header`,children:[(0,O.jsx)(`span`,{className:`profile-key-card-icon`,children:t}),(0,O.jsx)(`span`,{children:e})]}),(0,O.jsxs)(`div`,{className:`mono-row`,children:[(0,O.jsx)(`code`,{className:`mono`,translate:`no`,children:n}),(0,O.jsx)(T,{text:n})]})]})}var I=a(`/profile/`)({component:N});export{I as Route};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,o as t,t as n}from"./jsx-runtime-Bt-cYkS5.js";import{B as r,H as i,W as a,t as o}from"./useAppStore-DOnk608w.js";import{t as s}from"./arrow-right-CXzRt0Fp.js";import{t as c}from"./check-iBCQl0yr.js";import{t as l}from"./download-COQOcPqI.js";import{t as u}from"./external-link-D6tHlYgS.js";import{n as d,t as f}from"./notebook-pen-BzrCXQJE.js";import{t as p}from"./hard-drive-Cqa7Rstj.js";import{t as m}from"./message-square-BgsNXPft.js";import{t as h}from"./wallet-D9Iw4YWE.js";import{A as g,C as _,b as v}from"./index-CUzbruyP.js";import{t as y}from"./MarketingLayout-BVw4vr-u.js";var b=r(`arrow-up-right`,[[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]),x=r(`gamepad-2`,[[`line`,{x1:`6`,x2:`10`,y1:`11`,y2:`11`,key:`1gktln`}],[`line`,{x1:`8`,x2:`8`,y1:`9`,y2:`13`,key:`qnk9ow`}],[`line`,{x1:`15`,x2:`15.01`,y1:`12`,y2:`12`,key:`krot7o`}],[`line`,{x1:`18`,x2:`18.01`,y1:`10`,y2:`10`,key:`1lcuu1`}],[`path`,{d:`M17.32 5H6.68a4 4 0 0 0-3.978 3.59c-.006.052-.01.101-.017.152C2.604 9.416 2 14.456 2 16a3 3 0 0 0 3 3c1 0 1.5-.5 2-1l1.414-1.414A2 2 0 0 1 9.828 16h4.344a2 2 0 0 1 1.414.586L17 18c.5.5 1 1 2 1a3 3 0 0 0 3-3c0-1.545-.604-6.584-.685-7.258-.007-.05-.011-.1-.017-.151A4 4 0 0 0 17.32 5z`,key:`mfqc10`}]]),S=t(e(),1),C=n(),w=[{id:`app`,titleKey:`portal.feature.app.title`,subtitleKey:`portal.feature.app.subtitle`,icon:(0,C.jsx)(d,{size:28}),path:`/app/`,requiresBackend:!0,heroKey:`portal.feature.app.hero`,descKey:`portal.feature.app.desc`,featureKeys:[`portal.feature.app.bullet.localIdentity`,`portal.feature.app.bullet.hyperswarm`,`portal.feature.app.bullet.largeFiles`,`portal.feature.app.bullet.cid`,`portal.feature.app.bullet.seedAfterDownload`,`portal.feature.app.bullet.noCloud`,`portal.feature.app.bullet.desktop`,`portal.feature.app.bullet.openSource`],steps:[{num:`1`,titleKey:`portal.feature.app.step.download.title`,descKey:`portal.feature.app.step.download.desc`,link:`/download/`,linkTextKey:`portal.feature.app.step.download.link`,hideInDesktopClient:!0},{num:`2`,titleKey:`portal.feature.app.step.install.title`,descKey:`portal.feature.app.step.install.desc`,hideInDesktopClient:!0},{num:`3`,titleKey:`portal.feature.app.step.share.title`,descKey:`portal.feature.app.step.share.desc`}]},{id:`chat`,titleKey:`portal.feature.chat.title`,subtitleKey:`portal.feature.chat.subtitle`,icon:(0,C.jsx)(m,{size:28}),path:`/chat/`,requiresBackend:!0,heroKey:`portal.feature.chat.hero`,descKey:`portal.feature.chat.desc`,featureKeys:[`portal.feature.chat.bullet.encrypted`,`portal.feature.chat.bullet.identity`,`portal.feature.chat.bullet.sync`,`portal.feature.chat.bullet.offline`,`portal.feature.chat.bullet.noAccount`],steps:[{num:`1`,titleKey:`portal.feature.chat.step.download.title`,descKey:`portal.feature.chat.step.download.desc`,link:`/download/`,linkTextKey:`portal.feature.chat.step.download.link`,hideInDesktopClient:!0},{num:`2`,titleKey:`portal.feature.chat.step.create.title`,descKey:`portal.feature.chat.step.create.desc`},{num:`3`,titleKey:`portal.feature.chat.step.send.title`,descKey:`portal.feature.chat.step.send.desc`}]},{id:`note`,titleKey:`portal.feature.note.title`,subtitleKey:`portal.feature.note.subtitle`,icon:(0,C.jsx)(f,{size:28}),path:`/note/`,requiresBackend:!1,heroKey:`portal.feature.note.hero`,descKey:`portal.feature.note.desc`,featureKeys:[`portal.feature.note.bullet.markdown`,`portal.feature.note.bullet.privacy`,`portal.feature.note.bullet.folders`,`portal.feature.note.bullet.web3`,`portal.feature.note.bullet.backup`,`portal.feature.note.bullet.independent`],steps:[{num:`1`,titleKey:`portal.feature.note.step.account.title`,descKey:`portal.feature.note.step.account.desc`},{num:`2`,titleKey:`portal.feature.note.step.create.title`,descKey:`portal.feature.note.step.create.desc`},{num:`3`,titleKey:`portal.feature.note.step.backup.title`,descKey:`portal.feature.note.step.backup.desc`}]},{id:`gandengyan`,titleKey:`portal.feature.game.title`,subtitleKey:`portal.feature.game.subtitle`,icon:(0,C.jsx)(x,{size:28}),path:`/game/gandengyan/`,requiresBackend:!0,heroKey:`portal.feature.game.hero`,descKey:`portal.feature.game.desc`,featureKeys:[`portal.feature.game.bullet.account`,`portal.feature.game.bullet.channel`,`portal.feature.game.bullet.link`,`portal.feature.game.bullet.rules`,`portal.feature.game.bullet.maintain`],steps:[{num:`1`,titleKey:`portal.feature.game.step.login.title`,descKey:`portal.feature.game.step.login.desc`},{num:`2`,titleKey:`portal.feature.game.step.create.title`,descKey:`portal.feature.game.step.create.desc`},{num:`3`,titleKey:`portal.feature.game.step.test.title`,descKey:`portal.feature.game.step.test.desc`}]},{id:`web3`,titleKey:`portal.feature.web3.title`,subtitleKey:`portal.feature.web3.subtitle`,icon:(0,C.jsx)(h,{size:28}),path:`/web3/`,requiresBackend:!1,heroKey:`portal.feature.web3.hero`,descKey:`portal.feature.web3.desc`,featureKeys:[`portal.feature.web3.bullet.frontend`,`portal.feature.web3.bullet.keys`,`portal.feature.web3.bullet.mnemonic`,`portal.feature.web3.bullet.eth`,`portal.feature.web3.bullet.pem`,`portal.feature.web3.bullet.qr`],steps:[{num:`1`,titleKey:`portal.feature.web3.step.username.title`,descKey:`portal.feature.web3.step.username.desc`},{num:`2`,titleKey:`portal.feature.web3.step.keys.title`,descKey:`portal.feature.web3.step.keys.desc`},{num:`3`,titleKey:`portal.feature.web3.step.export.title`,descKey:`portal.feature.web3.step.export.desc`}]}],T=[`chat`,`app`,`note`,`gandengyan`,`web3`];function E(){let e=o(e=>e.hasBackend),t=o(e=>e.openConnectModal),[n,r]=(0,S.useState)(`chat`),{t:i}=g(),d=v(),f=T.map(e=>w.find(t=>t.id===e)).filter(e=>!!e),m=f.find(e=>e.id===n)||f[0],h=i(m.titleKey),y=m.steps.filter(e=>!(d&&e.hideInDesktopClient));return(0,C.jsxs)(`div`,{className:`portal-page`,children:[(0,C.jsx)(`section`,{className:`portal-hero`,children:(0,C.jsxs)(`div`,{className:`mkt-container`,children:[(0,C.jsx)(`h1`,{className:`portal-hero-title`,children:i(`common.brand`)}),(0,C.jsx)(`p`,{className:`portal-hero-subtitle`,children:i(`portal.hero.subtitle`)})]})}),(0,C.jsx)(`section`,{className:`portal-cards-section`,children:(0,C.jsxs)(`div`,{className:`mkt-container`,children:[(0,C.jsx)(`div`,{className:`portal-cards`,children:f.map(t=>{let o=n===t.id,s=t.requiresBackend,c=s?e===!0?`connected`:e===!1?`disconnected`:`checking`:`none`,l=i(t.titleKey);return(0,C.jsxs)(`button`,{className:`portal-card ${o?`active`:``}`,onClick:()=>r(t.id),children:[(0,C.jsx)(a,{to:t.path,className:`btn btn-icon portal-card-open-btn`,onClick:e=>e.stopPropagation(),title:i(`portal.openFeature`,{title:l}),children:(0,C.jsx)(b,{size:16})}),(0,C.jsx)(`div`,{className:`portal-card-icon`,children:t.icon}),(0,C.jsx)(`div`,{className:`portal-card-title`,children:l}),(0,C.jsx)(`div`,{className:`portal-card-subtitle`,children:i(t.subtitleKey)}),s?(0,C.jsxs)(`div`,{className:`ui-badge portal-card-status ${c}`,children:[c===`checking`&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(`span`,{className:`status-dot checking`}),i(`common.status.checking`)]}),c===`connected`&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(`span`,{className:`status-dot connected`}),i(`common.status.connected`)]}),c===`disconnected`&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(`span`,{className:`status-dot disconnected`}),i(`common.status.needsConnection`)]})]}):(0,C.jsxs)(`div`,{className:`ui-badge portal-card-status ready`,children:[(0,C.jsx)(`span`,{className:`status-dot ready`}),i(`common.status.ready`)]})]},t.id)})}),(0,C.jsxs)(`div`,{className:`portal-node-actions`,"aria-label":i(`portal.nodeEntry`),children:[(0,C.jsxs)(`button`,{onClick:t,className:`btn btn-secondary`,children:[(0,C.jsx)(_,{size:16}),i(`portal.webConnectNode`)]}),(0,C.jsxs)(a,{to:`/admin/`,className:`btn btn-secondary`,children:[(0,C.jsx)(p,{size:16}),i(`portal.nodeAdmin`)]})]})]})}),(0,C.jsx)(`section`,{className:`portal-marketing`,children:(0,C.jsx)(`div`,{className:`mkt-container`,children:(0,C.jsxs)(`div`,{className:`portal-marketing-inner`,children:[(0,C.jsxs)(`div`,{className:`portal-marketing-header`,children:[(0,C.jsx)(`h2`,{children:i(m.heroKey)}),(0,C.jsx)(`p`,{children:i(m.descKey)})]}),(0,C.jsx)(`div`,{className:`portal-marketing-features`,children:m.featureKeys.map(e=>(0,C.jsxs)(`div`,{className:`portal-feature-item`,children:[(0,C.jsx)(`span`,{className:`portal-feature-icon`,children:(0,C.jsx)(c,{size:14,strokeWidth:3})}),(0,C.jsx)(`span`,{children:i(e)})]},e))}),(0,C.jsx)(`div`,{className:`portal-marketing-steps`,children:y.map((e,t)=>(0,C.jsxs)(`div`,{className:`portal-step`,children:[(0,C.jsx)(`span`,{className:`portal-step-num`,children:t+1}),(0,C.jsxs)(`div`,{className:`portal-step-content`,children:[(0,C.jsx)(`strong`,{children:i(e.titleKey)}),(0,C.jsx)(`p`,{children:i(e.descKey)}),e.code&&(0,C.jsx)(`code`,{className:`portal-step-code`,translate:`no`,children:e.code}),e.link&&e.linkTextKey&&(0,C.jsx)(`p`,{className:`portal-step-link`,children:(0,C.jsxs)(a,{to:e.link,children:[i(e.linkTextKey),` `,(0,C.jsx)(u,{size:12})]})})]})]},e.num))}),(0,C.jsxs)(`div`,{className:`portal-actions`,children:[(0,C.jsxs)(a,{to:m.path,className:`btn btn-primary`,children:[i(`portal.enterFeature`,{title:h}),(0,C.jsx)(s,{size:16})]}),m.requiresBackend&&e===!1&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsxs)(`button`,{onClick:t,className:`btn btn-secondary`,children:[(0,C.jsx)(_,{size:16}),i(`portal.webConnectNode`)]}),!d&&(0,C.jsxs)(a,{to:`/download/`,className:`btn btn-secondary`,children:[(0,C.jsx)(l,{size:16}),i(`nav.downloadClient`)]})]})]})]})})})]})}function D(){return(0,C.jsx)(y,{children:(0,C.jsx)(E,{})})}var O=i(`/`)({component:D});export{O as Route};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,o as t,t as n}from"./jsx-runtime-Bt-cYkS5.js";import{A as r,B as i,F as a,H as o,O as s}from"./useAppStore-DOnk608w.js";import{t as ee}from"./external-link-D6tHlYgS.js";import{t as te}from"./key-round-JR8M3aHl.js";import{n as ne,t as re}from"./AppTop-DZFTO9-m.js";import{t as ie}from"./refresh-cw-D4BsHvhi.js";import{A as ae}from"./index-DjBN7bZV.js";import{t as oe}from"./CopyButton-B03fpFFc.js";import{n as se,r as ce,t as c}from"./chatJoinInvite-BcPz_IV5.js";var l=i(`link`,[[`path`,{d:`M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71`,key:`1cjeqo`}],[`path`,{d:`M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71`,key:`19qd67`}]]),u=t(e(),1),d=n(),f=`chat-join-demo`,p=``,m=`chatjoin_support`,le=/^[a-zA-Z0-9_-]{3,30}$/,h=/^0x[a-fA-F0-9]{64}$/,ue=c;function g(){return typeof window>`u`?`https://most.box`:window.location.origin}function _(e){return(e.trim()||g()).replace(/\/+$/,``)}function v(e,t){let n=s(a(e.trim()||f,t).danger);return{publicKey:n.public_key,privateKey:n.private_key}}function y(e){return e.trim()||void 0}function de(e){try{return JSON.parse(e)}catch{return null}}function fe(e){let t=e.trim();if(!t)return null;let n,r;try{let e=new URL(t,g());n=e.searchParams,r=e.origin}catch{n=new URLSearchParams(t.replace(/^\?/,``))}let i=n.get(`token`)?.trim()||``,a=n.get(`pub`)?.trim()||``;return!i||!a?null:{token:i,pub:a,origin:r}}function b({label:e,children:t,wide:n=!1}){return(0,d.jsxs)(`label`,{className:`chat-join-demo-field ${n?`wide`:``}`,children:[(0,d.jsx)(`span`,{children:e}),t]})}function x(){let{t:e}=ae(),[t,n]=(0,u.useState)(g),[i,a]=(0,u.useState)(`demo-user`),[o,s]=(0,u.useState)(`Demo User`),[c,x]=(0,u.useState)(m),[S,pe]=(0,u.useState)(`Chat Join Demo`),[C,w]=(0,u.useState)(`zh-CN`),[T,E]=(0,u.useState)(!0),[D,O]=(0,u.useState)(``),[k,me]=(0,u.useState)(``),[A,j]=(0,u.useState)(``),[M,N]=(0,u.useState)(``),[P,F]=(0,u.useState)(``),[I,L]=(0,u.useState)(``),[R,he]=(0,u.useState)(se),[z,ge]=(0,u.useState)(f),[B,_e]=(0,u.useState)(p),[V,ve]=(0,u.useState)(()=>v(f,p)),[H,ye]=(0,u.useState)(``),[U,W]=(0,u.useState)(``),[G,K]=(0,u.useState)(``),[q,J]=(0,u.useState)(!1),[be,Y]=(0,u.useState)(``),[xe,X]=(0,u.useState)(``),[Z,Q]=(0,u.useState)(``),[Se,$]=(0,u.useState)(``),Ce=(0,u.useMemo)(()=>{let e={uid:i.trim(),locale:C,channels:[{id:c.trim(),name:y(S)}]};return T&&(e.theme=`sparkbit`),e.node_url=y(P),e.node_invite=y(I),e.logo=y(D),e.logo_dark=y(k),e.data=y(M),e.avatar=y(A),e.name=y(o),e},[A,c,S,M,o,C,D,k,I,P,i,T]),we=(0,u.useMemo)(()=>JSON.stringify(Ce,null,2),[Ce]);function Te(){ve(v(z,B)),Y(``),X(``),Q(``),$(``)}function Ee(e){let t=e.channels[0];a(e.uid),w(e.locale||`zh-CN`),E(e.theme===`sparkbit`),F(e.node_url||``),L(e.node_invite||``),O(e.logo||``),me(e.logo_dark||``),N(e.data||``),j(e.avatar||``),s(e.name||``),x(t?.id||m),pe(t?.name||``)}async function De(){let r=fe(H);if(!r){W(``),K(e(`chatJoin.demo.error.linkInvalid`));return}let i=r.origin||_(t),a=`${i}/chat/join?token=${encodeURIComponent(r.token)}&pub=${encodeURIComponent(r.pub)}`;n(i),Y(r.token),X(r.pub),Q(a),W(e(`chatJoin.demo.status.linkParsed`)),K(``),J(!0);try{let t=await fetch(`${ue}/api/chat.join.decrypt`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({token:r.token,pub:r.pub})}),n=await t.text(),i=de(n);if(!t.ok){let t=i&&typeof i==`object`&&`error`in i&&typeof i.error==`string`?i.error:n;throw Error(t||e(`chatJoin.error.decrypt`))}let a=ce(i);if(!a){K(e(`chatJoin.demo.error.parseInvalidPayload`)),W(e(`chatJoin.demo.status.linkParsed`));return}Ee(a),W(e(`chatJoin.demo.status.linkDecrypted`)),K(``)}catch(t){K(e(`chatJoin.demo.error.parseDecryptFailed`,{message:t instanceof Error?t.message:String(t)}))}finally{J(!1)}}function Oe(){let n=i.trim(),a=c.trim(),o=R.trim();if(!n){$(e(`chatJoin.demo.error.uidRequired`));return}if(!le.test(a)){$(e(`chatJoin.demo.error.channelInvalid`));return}if(!h.test(o)){$(e(`chatJoin.demo.error.recipientPublicInvalid`));return}if(!h.test(V.publicKey)||!h.test(V.privateKey)){$(e(`chatJoin.demo.error.senderKeysInvalid`));return}try{let e=r(we,{senderPrivateKey:V.privateKey,recipientPublicKey:o}),n=V.publicKey,i=`${_(t)}/chat/join?token=${encodeURIComponent(e)}&pub=${encodeURIComponent(n)}`;Y(e),X(n),Q(i),$(``)}catch{$(e(`chatJoin.demo.error.encryptFailed`))}}return(0,d.jsx)(ne,{sidebar:()=>(0,d.jsx)(re,{}),headerTitle:(0,d.jsx)(`h2`,{className:`header-title`,children:e(`chatJoin.demo.title`)}),children:(0,d.jsx)(`div`,{className:`chat-join-container`,children:(0,d.jsxs)(`div`,{className:`chat-join-demo-panel`,children:[(0,d.jsxs)(`section`,{className:`chat-join-demo-section`,children:[(0,d.jsxs)(`div`,{className:`chat-join-helper-title`,children:[(0,d.jsx)(l,{size:18}),(0,d.jsx)(`h3`,{children:e(`chatJoin.demo.parseSection`)})]}),(0,d.jsx)(b,{label:e(`chatJoin.demo.field.existingLink`),wide:!0,children:(0,d.jsx)(`textarea`,{className:`textarea mono`,value:H,onChange:e=>ye(e.target.value),rows:4,translate:`no`})}),(0,d.jsx)(`div`,{className:`chat-join-demo-actions`,children:(0,d.jsxs)(`button`,{className:`btn btn-secondary`,type:`button`,onClick:De,disabled:q,children:[(0,d.jsx)(l,{size:16}),e(q?`chatJoin.demo.action.parsing`:`chatJoin.demo.action.parseLink`)]})}),U&&(0,d.jsx)(`p`,{className:`chat-join-demo-success`,children:U}),G&&(0,d.jsx)(`p`,{className:`chat-join-demo-error`,children:G})]}),(0,d.jsxs)(`section`,{className:`chat-join-demo-section`,children:[(0,d.jsxs)(`div`,{className:`chat-join-helper-title`,children:[(0,d.jsx)(l,{size:18}),(0,d.jsx)(`h3`,{children:e(`chatJoin.demo.inviteSection`)})]}),(0,d.jsxs)(`div`,{className:`chat-join-demo-grid`,children:[(0,d.jsx)(b,{label:e(`chatJoin.demo.field.origin`),children:(0,d.jsx)(`input`,{className:`input input-compact`,value:t,onChange:e=>n(e.target.value),autoCapitalize:`off`,autoCorrect:`off`,spellCheck:`false`})}),(0,d.jsx)(b,{label:e(`chatJoin.demo.field.uid`),children:(0,d.jsx)(`input`,{className:`input input-compact`,value:i,onChange:e=>a(e.target.value),autoCapitalize:`off`,autoCorrect:`off`,spellCheck:`false`})}),(0,d.jsx)(b,{label:e(`chatJoin.demo.field.name`),children:(0,d.jsx)(`input`,{className:`input input-compact`,value:o,onChange:e=>s(e.target.value)})}),(0,d.jsx)(b,{label:e(`chatJoin.demo.field.locale`),children:(0,d.jsxs)(`select`,{className:`input input-compact`,value:C,onChange:e=>w(e.target.value),children:[(0,d.jsx)(`option`,{value:`zh-CN`,children:`zh-CN`}),(0,d.jsx)(`option`,{value:`zh-TW`,children:`zh-TW`}),(0,d.jsx)(`option`,{value:`en`,children:`en`})]})}),(0,d.jsx)(b,{label:e(`chatJoin.demo.field.channelId`),children:(0,d.jsx)(`input`,{className:`input input-compact`,value:c,onChange:e=>x(e.target.value),autoCapitalize:`off`,autoCorrect:`off`,spellCheck:`false`})}),(0,d.jsx)(b,{label:e(`chatJoin.demo.field.channelName`),children:(0,d.jsx)(`input`,{className:`input input-compact`,value:S,onChange:e=>pe(e.target.value)})}),(0,d.jsx)(b,{label:e(`chatJoin.demo.field.nodeUrl`),children:(0,d.jsx)(`input`,{className:`input input-compact`,value:P,onChange:e=>F(e.target.value),autoCapitalize:`off`,autoCorrect:`off`,spellCheck:`false`})}),(0,d.jsx)(b,{label:e(`chatJoin.demo.field.nodeInvite`),children:(0,d.jsx)(`input`,{className:`input input-compact`,value:I,onChange:e=>L(e.target.value),autoCapitalize:`off`,autoCorrect:`off`,spellCheck:`false`})}),(0,d.jsx)(b,{label:e(`chatJoin.demo.field.logo`),children:(0,d.jsx)(`input`,{className:`input input-compact`,value:D,onChange:e=>O(e.target.value),autoCapitalize:`off`,autoCorrect:`off`,spellCheck:`false`})}),(0,d.jsx)(b,{label:e(`chatJoin.demo.field.logoDark`),children:(0,d.jsx)(`input`,{className:`input input-compact`,value:k,onChange:e=>me(e.target.value),autoCapitalize:`off`,autoCorrect:`off`,spellCheck:`false`})}),(0,d.jsx)(b,{label:e(`chatJoin.demo.field.avatar`),children:(0,d.jsx)(`input`,{className:`input input-compact`,value:A,onChange:e=>j(e.target.value),autoCapitalize:`off`,autoCorrect:`off`,spellCheck:`false`})}),(0,d.jsxs)(`label`,{className:`chat-join-demo-toggle`,children:[(0,d.jsx)(`input`,{type:`checkbox`,checked:T,onChange:e=>E(e.target.checked)}),(0,d.jsx)(`span`,{children:e(`chatJoin.demo.field.sparkbitTheme`)})]}),(0,d.jsx)(b,{label:e(`chatJoin.demo.field.data`),wide:!0,children:(0,d.jsx)(`textarea`,{className:`textarea mono`,value:M,onChange:e=>N(e.target.value),rows:3,translate:`no`})})]})]}),(0,d.jsxs)(`section`,{className:`chat-join-demo-section`,children:[(0,d.jsxs)(`div`,{className:`chat-join-helper-title`,children:[(0,d.jsx)(te,{size:18}),(0,d.jsx)(`h3`,{children:e(`chatJoin.demo.cryptoSection`)})]}),(0,d.jsxs)(`div`,{className:`chat-join-demo-grid`,children:[(0,d.jsx)(b,{label:e(`chatJoin.demo.field.recipientPublicKey`),wide:!0,children:(0,d.jsx)(`input`,{className:`input input-compact`,value:R,onChange:e=>he(e.target.value),autoCapitalize:`off`,autoCorrect:`off`,spellCheck:`false`,translate:`no`})}),(0,d.jsx)(b,{label:e(`chatJoin.demo.field.senderUsername`),children:(0,d.jsx)(`input`,{className:`input input-compact`,value:z,onChange:e=>ge(e.target.value),autoCapitalize:`off`,autoCorrect:`off`,spellCheck:`false`})}),(0,d.jsx)(b,{label:e(`chatJoin.demo.field.senderPassword`),children:(0,d.jsx)(`input`,{className:`input input-compact`,value:B,onChange:e=>_e(e.target.value),type:`password`})}),(0,d.jsxs)(`div`,{className:`chat-join-demo-actions`,children:[(0,d.jsxs)(`button`,{className:`btn btn-secondary`,type:`button`,onClick:Te,children:[(0,d.jsx)(ie,{size:16}),e(`chatJoin.demo.action.deriveSender`)]}),(0,d.jsxs)(`button`,{className:`btn btn-primary`,type:`button`,onClick:Oe,children:[(0,d.jsx)(l,{size:16}),e(`chatJoin.demo.action.generate`)]})]}),(0,d.jsx)(b,{label:e(`chatJoin.demo.field.senderPublicKey`),wide:!0,children:(0,d.jsx)(`input`,{className:`input input-compact`,value:V.publicKey,readOnly:!0,translate:`no`})})]}),Se&&(0,d.jsx)(`p`,{className:`chat-join-demo-error`,children:Se})]}),(0,d.jsxs)(`section`,{className:`chat-join-demo-section`,children:[(0,d.jsxs)(`div`,{className:`chat-join-helper-title`,children:[(0,d.jsx)(l,{size:18}),(0,d.jsx)(`h3`,{children:e(`chatJoin.demo.outputSection`)})]}),(0,d.jsx)(b,{label:e(`chatJoin.demo.field.payload`),wide:!0,children:(0,d.jsx)(`textarea`,{className:`textarea mono`,value:we,readOnly:!0,rows:9,translate:`no`})}),(0,d.jsx)(b,{label:e(`chatJoin.demo.field.token`),wide:!0,children:(0,d.jsx)(`textarea`,{className:`textarea mono`,value:be,readOnly:!0,rows:4,translate:`no`})}),(0,d.jsx)(b,{label:e(`chatJoin.demo.field.pub`),wide:!0,children:(0,d.jsx)(`input`,{className:`input input-compact`,value:xe,readOnly:!0,translate:`no`})}),(0,d.jsx)(b,{label:e(`chatJoin.demo.field.link`),wide:!0,children:(0,d.jsx)(`textarea`,{className:`textarea mono`,value:Z,readOnly:!0,rows:4,translate:`no`})}),(0,d.jsxs)(`div`,{className:`chat-join-demo-actions`,children:[(0,d.jsx)(oe,{className:`btn btn-secondary`,text:Z,label:e(`common.copy`)}),(0,d.jsxs)(`a`,{className:`btn btn-primary`,href:Z||void 0,target:`_blank`,rel:`noreferrer`,"aria-disabled":!Z,children:[(0,d.jsx)(ee,{size:16}),e(`chatJoin.demo.action.openLink`)]})]})]})]})})})}var S=o(`/chat/join/demo/`)({component:x});export{S as Route};
|
|
1
|
+
import{n as e,o as t,t as n}from"./jsx-runtime-Bt-cYkS5.js";import{A as r,B as i,F as a,H as o,O as s}from"./useAppStore-DOnk608w.js";import{t as ee}from"./external-link-D6tHlYgS.js";import{t as te}from"./key-round-JR8M3aHl.js";import{n as ne,t as re}from"./AppTop-qtp-3wqv.js";import{t as ie}from"./refresh-cw-D4BsHvhi.js";import{A as ae}from"./index-CUzbruyP.js";import{t as oe}from"./CopyButton-C00LHzxo.js";import{n as se,r as ce,t as c}from"./chatJoinInvite-aCHhLrlm.js";var l=i(`link`,[[`path`,{d:`M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71`,key:`1cjeqo`}],[`path`,{d:`M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71`,key:`19qd67`}]]),u=t(e(),1),d=n(),f=`chat-join-demo`,p=``,m=`chatjoin_support`,le=/^[a-zA-Z0-9_-]{3,30}$/,h=/^0x[a-fA-F0-9]{64}$/,ue=c;function g(){return typeof window>`u`?`https://most.box`:window.location.origin}function _(e){return(e.trim()||g()).replace(/\/+$/,``)}function v(e,t){let n=s(a(e.trim()||f,t).danger);return{publicKey:n.public_key,privateKey:n.private_key}}function y(e){return e.trim()||void 0}function de(e){try{return JSON.parse(e)}catch{return null}}function fe(e){let t=e.trim();if(!t)return null;let n,r;try{let e=new URL(t,g());n=e.searchParams,r=e.origin}catch{n=new URLSearchParams(t.replace(/^\?/,``))}let i=n.get(`token`)?.trim()||``,a=n.get(`pub`)?.trim()||``;return!i||!a?null:{token:i,pub:a,origin:r}}function b({label:e,children:t,wide:n=!1}){return(0,d.jsxs)(`label`,{className:`chat-join-demo-field ${n?`wide`:``}`,children:[(0,d.jsx)(`span`,{children:e}),t]})}function x(){let{t:e}=ae(),[t,n]=(0,u.useState)(g),[i,a]=(0,u.useState)(`demo-user`),[o,s]=(0,u.useState)(`Demo User`),[c,x]=(0,u.useState)(m),[S,pe]=(0,u.useState)(`Chat Join Demo`),[C,w]=(0,u.useState)(`zh-CN`),[T,E]=(0,u.useState)(!0),[D,O]=(0,u.useState)(``),[k,me]=(0,u.useState)(``),[A,j]=(0,u.useState)(``),[M,N]=(0,u.useState)(``),[P,F]=(0,u.useState)(``),[I,L]=(0,u.useState)(``),[R,he]=(0,u.useState)(se),[z,ge]=(0,u.useState)(f),[B,_e]=(0,u.useState)(p),[V,ve]=(0,u.useState)(()=>v(f,p)),[H,ye]=(0,u.useState)(``),[U,W]=(0,u.useState)(``),[G,K]=(0,u.useState)(``),[q,J]=(0,u.useState)(!1),[be,Y]=(0,u.useState)(``),[xe,X]=(0,u.useState)(``),[Z,Q]=(0,u.useState)(``),[Se,$]=(0,u.useState)(``),Ce=(0,u.useMemo)(()=>{let e={uid:i.trim(),locale:C,channels:[{id:c.trim(),name:y(S)}]};return T&&(e.theme=`sparkbit`),e.node_url=y(P),e.node_invite=y(I),e.logo=y(D),e.logo_dark=y(k),e.data=y(M),e.avatar=y(A),e.name=y(o),e},[A,c,S,M,o,C,D,k,I,P,i,T]),we=(0,u.useMemo)(()=>JSON.stringify(Ce,null,2),[Ce]);function Te(){ve(v(z,B)),Y(``),X(``),Q(``),$(``)}function Ee(e){let t=e.channels[0];a(e.uid),w(e.locale||`zh-CN`),E(e.theme===`sparkbit`),F(e.node_url||``),L(e.node_invite||``),O(e.logo||``),me(e.logo_dark||``),N(e.data||``),j(e.avatar||``),s(e.name||``),x(t?.id||m),pe(t?.name||``)}async function De(){let r=fe(H);if(!r){W(``),K(e(`chatJoin.demo.error.linkInvalid`));return}let i=r.origin||_(t),a=`${i}/chat/join?token=${encodeURIComponent(r.token)}&pub=${encodeURIComponent(r.pub)}`;n(i),Y(r.token),X(r.pub),Q(a),W(e(`chatJoin.demo.status.linkParsed`)),K(``),J(!0);try{let t=await fetch(`${ue}/api/chat.join.decrypt`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({token:r.token,pub:r.pub})}),n=await t.text(),i=de(n);if(!t.ok){let t=i&&typeof i==`object`&&`error`in i&&typeof i.error==`string`?i.error:n;throw Error(t||e(`chatJoin.error.decrypt`))}let a=ce(i);if(!a){K(e(`chatJoin.demo.error.parseInvalidPayload`)),W(e(`chatJoin.demo.status.linkParsed`));return}Ee(a),W(e(`chatJoin.demo.status.linkDecrypted`)),K(``)}catch(t){K(e(`chatJoin.demo.error.parseDecryptFailed`,{message:t instanceof Error?t.message:String(t)}))}finally{J(!1)}}function Oe(){let n=i.trim(),a=c.trim(),o=R.trim();if(!n){$(e(`chatJoin.demo.error.uidRequired`));return}if(!le.test(a)){$(e(`chatJoin.demo.error.channelInvalid`));return}if(!h.test(o)){$(e(`chatJoin.demo.error.recipientPublicInvalid`));return}if(!h.test(V.publicKey)||!h.test(V.privateKey)){$(e(`chatJoin.demo.error.senderKeysInvalid`));return}try{let e=r(we,{senderPrivateKey:V.privateKey,recipientPublicKey:o}),n=V.publicKey,i=`${_(t)}/chat/join?token=${encodeURIComponent(e)}&pub=${encodeURIComponent(n)}`;Y(e),X(n),Q(i),$(``)}catch{$(e(`chatJoin.demo.error.encryptFailed`))}}return(0,d.jsx)(ne,{sidebar:()=>(0,d.jsx)(re,{}),headerTitle:(0,d.jsx)(`h2`,{className:`header-title`,children:e(`chatJoin.demo.title`)}),children:(0,d.jsx)(`div`,{className:`chat-join-container`,children:(0,d.jsxs)(`div`,{className:`chat-join-demo-panel`,children:[(0,d.jsxs)(`section`,{className:`chat-join-demo-section`,children:[(0,d.jsxs)(`div`,{className:`chat-join-helper-title`,children:[(0,d.jsx)(l,{size:18}),(0,d.jsx)(`h3`,{children:e(`chatJoin.demo.parseSection`)})]}),(0,d.jsx)(b,{label:e(`chatJoin.demo.field.existingLink`),wide:!0,children:(0,d.jsx)(`textarea`,{className:`textarea mono`,value:H,onChange:e=>ye(e.target.value),rows:4,translate:`no`})}),(0,d.jsx)(`div`,{className:`chat-join-demo-actions`,children:(0,d.jsxs)(`button`,{className:`btn btn-secondary`,type:`button`,onClick:De,disabled:q,children:[(0,d.jsx)(l,{size:16}),e(q?`chatJoin.demo.action.parsing`:`chatJoin.demo.action.parseLink`)]})}),U&&(0,d.jsx)(`p`,{className:`chat-join-demo-success`,children:U}),G&&(0,d.jsx)(`p`,{className:`chat-join-demo-error`,children:G})]}),(0,d.jsxs)(`section`,{className:`chat-join-demo-section`,children:[(0,d.jsxs)(`div`,{className:`chat-join-helper-title`,children:[(0,d.jsx)(l,{size:18}),(0,d.jsx)(`h3`,{children:e(`chatJoin.demo.inviteSection`)})]}),(0,d.jsxs)(`div`,{className:`chat-join-demo-grid`,children:[(0,d.jsx)(b,{label:e(`chatJoin.demo.field.origin`),children:(0,d.jsx)(`input`,{className:`input input-compact`,value:t,onChange:e=>n(e.target.value),autoCapitalize:`off`,autoCorrect:`off`,spellCheck:`false`})}),(0,d.jsx)(b,{label:e(`chatJoin.demo.field.uid`),children:(0,d.jsx)(`input`,{className:`input input-compact`,value:i,onChange:e=>a(e.target.value),autoCapitalize:`off`,autoCorrect:`off`,spellCheck:`false`})}),(0,d.jsx)(b,{label:e(`chatJoin.demo.field.name`),children:(0,d.jsx)(`input`,{className:`input input-compact`,value:o,onChange:e=>s(e.target.value)})}),(0,d.jsx)(b,{label:e(`chatJoin.demo.field.locale`),children:(0,d.jsxs)(`select`,{className:`input input-compact`,value:C,onChange:e=>w(e.target.value),children:[(0,d.jsx)(`option`,{value:`zh-CN`,children:`zh-CN`}),(0,d.jsx)(`option`,{value:`zh-TW`,children:`zh-TW`}),(0,d.jsx)(`option`,{value:`en`,children:`en`})]})}),(0,d.jsx)(b,{label:e(`chatJoin.demo.field.channelId`),children:(0,d.jsx)(`input`,{className:`input input-compact`,value:c,onChange:e=>x(e.target.value),autoCapitalize:`off`,autoCorrect:`off`,spellCheck:`false`})}),(0,d.jsx)(b,{label:e(`chatJoin.demo.field.channelName`),children:(0,d.jsx)(`input`,{className:`input input-compact`,value:S,onChange:e=>pe(e.target.value)})}),(0,d.jsx)(b,{label:e(`chatJoin.demo.field.nodeUrl`),children:(0,d.jsx)(`input`,{className:`input input-compact`,value:P,onChange:e=>F(e.target.value),autoCapitalize:`off`,autoCorrect:`off`,spellCheck:`false`})}),(0,d.jsx)(b,{label:e(`chatJoin.demo.field.nodeInvite`),children:(0,d.jsx)(`input`,{className:`input input-compact`,value:I,onChange:e=>L(e.target.value),autoCapitalize:`off`,autoCorrect:`off`,spellCheck:`false`})}),(0,d.jsx)(b,{label:e(`chatJoin.demo.field.logo`),children:(0,d.jsx)(`input`,{className:`input input-compact`,value:D,onChange:e=>O(e.target.value),autoCapitalize:`off`,autoCorrect:`off`,spellCheck:`false`})}),(0,d.jsx)(b,{label:e(`chatJoin.demo.field.logoDark`),children:(0,d.jsx)(`input`,{className:`input input-compact`,value:k,onChange:e=>me(e.target.value),autoCapitalize:`off`,autoCorrect:`off`,spellCheck:`false`})}),(0,d.jsx)(b,{label:e(`chatJoin.demo.field.avatar`),children:(0,d.jsx)(`input`,{className:`input input-compact`,value:A,onChange:e=>j(e.target.value),autoCapitalize:`off`,autoCorrect:`off`,spellCheck:`false`})}),(0,d.jsxs)(`label`,{className:`chat-join-demo-toggle`,children:[(0,d.jsx)(`input`,{type:`checkbox`,checked:T,onChange:e=>E(e.target.checked)}),(0,d.jsx)(`span`,{children:e(`chatJoin.demo.field.sparkbitTheme`)})]}),(0,d.jsx)(b,{label:e(`chatJoin.demo.field.data`),wide:!0,children:(0,d.jsx)(`textarea`,{className:`textarea mono`,value:M,onChange:e=>N(e.target.value),rows:3,translate:`no`})})]})]}),(0,d.jsxs)(`section`,{className:`chat-join-demo-section`,children:[(0,d.jsxs)(`div`,{className:`chat-join-helper-title`,children:[(0,d.jsx)(te,{size:18}),(0,d.jsx)(`h3`,{children:e(`chatJoin.demo.cryptoSection`)})]}),(0,d.jsxs)(`div`,{className:`chat-join-demo-grid`,children:[(0,d.jsx)(b,{label:e(`chatJoin.demo.field.recipientPublicKey`),wide:!0,children:(0,d.jsx)(`input`,{className:`input input-compact`,value:R,onChange:e=>he(e.target.value),autoCapitalize:`off`,autoCorrect:`off`,spellCheck:`false`,translate:`no`})}),(0,d.jsx)(b,{label:e(`chatJoin.demo.field.senderUsername`),children:(0,d.jsx)(`input`,{className:`input input-compact`,value:z,onChange:e=>ge(e.target.value),autoCapitalize:`off`,autoCorrect:`off`,spellCheck:`false`})}),(0,d.jsx)(b,{label:e(`chatJoin.demo.field.senderPassword`),children:(0,d.jsx)(`input`,{className:`input input-compact`,value:B,onChange:e=>_e(e.target.value),type:`password`})}),(0,d.jsxs)(`div`,{className:`chat-join-demo-actions`,children:[(0,d.jsxs)(`button`,{className:`btn btn-secondary`,type:`button`,onClick:Te,children:[(0,d.jsx)(ie,{size:16}),e(`chatJoin.demo.action.deriveSender`)]}),(0,d.jsxs)(`button`,{className:`btn btn-primary`,type:`button`,onClick:Oe,children:[(0,d.jsx)(l,{size:16}),e(`chatJoin.demo.action.generate`)]})]}),(0,d.jsx)(b,{label:e(`chatJoin.demo.field.senderPublicKey`),wide:!0,children:(0,d.jsx)(`input`,{className:`input input-compact`,value:V.publicKey,readOnly:!0,translate:`no`})})]}),Se&&(0,d.jsx)(`p`,{className:`chat-join-demo-error`,children:Se})]}),(0,d.jsxs)(`section`,{className:`chat-join-demo-section`,children:[(0,d.jsxs)(`div`,{className:`chat-join-helper-title`,children:[(0,d.jsx)(l,{size:18}),(0,d.jsx)(`h3`,{children:e(`chatJoin.demo.outputSection`)})]}),(0,d.jsx)(b,{label:e(`chatJoin.demo.field.payload`),wide:!0,children:(0,d.jsx)(`textarea`,{className:`textarea mono`,value:we,readOnly:!0,rows:9,translate:`no`})}),(0,d.jsx)(b,{label:e(`chatJoin.demo.field.token`),wide:!0,children:(0,d.jsx)(`textarea`,{className:`textarea mono`,value:be,readOnly:!0,rows:4,translate:`no`})}),(0,d.jsx)(b,{label:e(`chatJoin.demo.field.pub`),wide:!0,children:(0,d.jsx)(`input`,{className:`input input-compact`,value:xe,readOnly:!0,translate:`no`})}),(0,d.jsx)(b,{label:e(`chatJoin.demo.field.link`),wide:!0,children:(0,d.jsx)(`textarea`,{className:`textarea mono`,value:Z,readOnly:!0,rows:4,translate:`no`})}),(0,d.jsxs)(`div`,{className:`chat-join-demo-actions`,children:[(0,d.jsx)(oe,{className:`btn btn-secondary`,text:Z,label:e(`common.copy`)}),(0,d.jsxs)(`a`,{className:`btn btn-primary`,href:Z||void 0,target:`_blank`,rel:`noreferrer`,"aria-disabled":!Z,children:[(0,d.jsx)(ee,{size:16}),e(`chatJoin.demo.action.openLink`)]})]})]})]})})})}var S=o(`/chat/join/demo/`)({component:x});export{S as Route};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{n as e,o as t,t as n}from"./jsx-runtime-Bt-cYkS5.js";import{B as r,E as i,H as a,n as o,o as s,t as c}from"./useAppStore-DOnk608w.js";import{t as l}from"./circle-alert-dfN4T6Nq.js";import{a as u,o as d,r as ee,t as te}from"./chatNoteDraft-CYbvcEvC.js";import{t as ne}from"./OpenSidebarButton-DI6Ld8um.js";import{a as re,i as f,n as ie,r as p,t as ae}from"./FilePreviewOverlay-BvOCftIV.js";import{t as m}from"./arrow-right-CXzRt0Fp.js";import{t as h}from"./download-COQOcPqI.js";import{t as oe}from"./external-link-D6tHlYgS.js";import{t as g}from"./file-text-DiyIGL1I.js";import{t as se}from"./loader-CwyHYZdX.js";import{i as ce,n as le,t as ue}from"./AppTop-qtp-3wqv.js";import{t as de}from"./message-square-BgsNXPft.js";import{t as fe}from"./music-Dn9nm9Qb.js";import{t as pe}from"./search-HW4oPOBP.js";import{t as _}from"./trash-2-BLwoM0ME.js";import{A as v,S as me,_ as he,f as ge,g as _e,v as ve,w as ye,y as be}from"./index-CUzbruyP.js";import{t as xe}from"./format-CR8oUWq6.js";import{i as Se,n as Ce,r as we,t as Te}from"./downloadValidation-UPgpJbKz.js";import{t as Ee}from"./LogoIcon-B2fFe0l1.js";import{i as y,t as De}from"./userProfile-BZvkCuet.js";import{t as Oe}from"./useChannelMessages-CDvw-f_x.js";var ke=r(`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`}]]),Ae=r(`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`}]]),b=r(`pin-off`,[[`path`,{d:`M12 17v5`,key:`bb1du9`}],[`path`,{d:`M15 9.34V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H7.89`,key:`znwnzq`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}],[`path`,{d:`M9 9v1.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h11`,key:`c9qhm2`}]]),je=r(`pin`,[[`path`,{d:`M12 17v5`,key:`bb1du9`}],[`path`,{d:`M9 10.76a2 2 0 0 1-1.11 1.79l-1.78.9A2 2 0 0 0 5 15.24V16a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-.76a2 2 0 0 0-1.11-1.79l-1.78-.9A2 2 0 0 1 15 10.76V7a1 1 0 0 1 1-1 2 2 0 0 0 0-4H8a2 2 0 0 0 0 4 1 1 0 0 1 1 1z`,key:`1nkz8b`}]]),Me=r(`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`}]]),x=t(e(),1),S=n();function Ne(e){return String(e||``).split(`/`).pop()||e}function Pe(e){return e===`image`?(0,S.jsx)(p,{size:20}):e===`video`?(0,S.jsx)(f,{size:20}):e===`audio`?(0,S.jsx)(fe,{size:20}):(0,S.jsx)(g,{size:20})}function Fe({attachment:e,status:t=`idle`,message:n,pending:r=!1,onOpen:i}){let{t:a}=v(),o=t===`checking`,s=t===`downloading`,c=r||o||s,u=`ui-file-action chat-attachment-action ${t===`error`?`error`:t===`available`?`available`:``}`.trim(),d=Number.isFinite(e.size)&&e.size>0?xe(e.size):a(`chat.mostboxFile`),ee=r?a(`chat.sending`):n||d,te=a(r?`chat.sending`:o?`chat.checking`:s?`chat.attachment.downloading`:t===`available`?`chat.attachment.preview`:t===`error`?`chat.attachment.retry`:`chat.attachment.download`);return(0,S.jsxs)(`button`,{type:`button`,className:`ui-file-card chat-attachment-card`,onClick:()=>i?.(e),disabled:c,title:e.link,translate:`no`,children:[(0,S.jsx)(`span`,{className:`ui-file-icon chat-attachment-icon ${e.kind}`,children:c?(0,S.jsx)(se,{size:20,className:`ui-spinner chat-attachment-spinner`}):Pe(e.kind)}),(0,S.jsxs)(`span`,{className:`ui-file-info chat-attachment-info`,children:[(0,S.jsx)(`span`,{className:`ui-file-name chat-attachment-name`,translate:`no`,children:Ne(e.fileName)}),(0,S.jsx)(`span`,{className:`ui-file-meta chat-attachment-meta`,translate:`yes`,children:ee})]}),(0,S.jsxs)(`span`,{className:u,translate:`yes`,children:[c?(0,S.jsx)(se,{size:15,className:`ui-spinner chat-attachment-spinner`}):t===`available`?(0,S.jsx)(ye,{size:16}):t===`error`?(0,S.jsx)(l,{size:17}):(0,S.jsx)(h,{size:16}),(0,S.jsx)(`span`,{className:`chat-attachment-action-label`,children:te})]})]})}var Ie=[{key:`image`,labelKey:`chat.attachment.image`,accept:`image/*`,icon:p},{key:`video`,labelKey:`chat.attachment.video`,accept:`video/*`,icon:f},{key:`file`,labelKey:`chat.attachment.file`,accept:``,icon:g}],Le=Ie.map(e=>e.accept).join(`,`);function Re({children:e}){return(0,S.jsx)(`div`,{className:`message-bubble`,translate:`no`,children:e})}function ze({children:e}){return(0,S.jsx)(`div`,{className:`message-bubble has-attachment`,children:e})}function Be({variant:e,pending:t=!1,avatarSrc:n,isOnline:r=!1,author:i,time:a,children:o}){return(0,S.jsxs)(`div`,{className:[`chat-message`,e,t?`pending`:``].filter(Boolean).join(` `),children:[(0,S.jsxs)(`span`,{className:`chat-avatar-wrap`,children:[(0,S.jsx)(`img`,{className:`msg-avatar`,src:n,alt:`avatar`}),r&&(0,S.jsx)(`span`,{className:`chat-online-dot`,"aria-hidden":`true`})]}),(0,S.jsxs)(`div`,{className:`msg-content`,children:[(0,S.jsx)(`span`,{className:`message-header`,children:(0,S.jsx)(`span`,{className:`message-author`,translate:`no`,children:i})}),o,(0,S.jsx)(`span`,{className:`message-time`,children:a})]})]})}function Ve({active:e=!1,pinned:t=!1,unread:n=!1,title:r,menuClassName:i,onSelect:a,onTogglePin:o,onRename:s,onLeave:c}){let{t:l}=v(),u=!!(o||s||c);return(0,S.jsxs)(`div`,{className:[`sidebar-nav-btn`,e?`active`:``,t?`pinned`:``,n?`unread`:``].filter(Boolean).join(` `),onClick:a,role:`button`,tabIndex:0,onKeyDown:e=>{e.target===e.currentTarget&&e.key===`Enter`&&a?.()},children:[(0,S.jsxs)(`span`,{className:`chat-channel-icon-wrap`,children:[(0,S.jsx)(de,{size:16}),n&&(0,S.jsx)(`span`,{className:`chat-channel-unread-dot`,title:l(`chat.unread`),"aria-hidden":`true`})]}),(0,S.jsx)(`span`,{className:`chat-channel-title`,children:(0,S.jsx)(`span`,{className:`chat-channel-title-text`,translate:`no`,children:r})}),u&&(0,S.jsx)(_e,{ariaLabel:l(`chat.channelActions`),className:`channel-actions-anchor`,menuClassName:i,placement:`bottom-end`,items:[{key:`pin`,label:l(t?`chat.unpin`:`chat.pin`),icon:t?(0,S.jsx)(b,{size:16}):(0,S.jsx)(je,{size:16}),onSelect:()=>o?.()},{key:`rename`,label:l(`chat.rename`),icon:(0,S.jsx)(re,{size:16}),onSelect:()=>s?.()},{key:`delete`,label:l(`chat.delete`),icon:(0,S.jsx)(_,{size:16}),onSelect:()=>c?.()}],renderTrigger:e=>(0,S.jsx)(`button`,{...e,className:`leave-channel-btn channel-actions-trigger`,title:l(`common.moreActions`),"aria-label":l(`common.moreActions`),children:(0,S.jsx)(d,{size:16})})})]})}function He({members:e}){let{t}=v();return e.length===0?(0,S.jsx)(`div`,{className:`ui-empty-inline channel-members-empty`,children:t(`chat.noMembers`)}):(0,S.jsx)(`div`,{className:`channel-members-grid`,children:e.map(e=>(0,S.jsxs)(`div`,{className:`channel-member`,children:[(0,S.jsxs)(`span`,{className:`channel-member-avatar-wrap`,children:[(0,S.jsx)(`img`,{className:`channel-member-avatar`,src:e.avatarSrc,alt:`avatar`}),e.online&&(0,S.jsx)(`span`,{className:`chat-online-dot`,"aria-hidden":`true`})]}),(0,S.jsx)(`span`,{className:`channel-member-name`,translate:`no`,children:e.name})]},e.id))})}function Ue({message:e,placeholder:t,disabled:n=!1,isPublishingAttachment:r=!1,attachmentButtonTitle:i,attachmentInputRef:a,attachmentMenuClassName:o,onMessageChange:s,onSend:c,onSelectAttachmentFiles:l}){let{t:d}=v(),ee=n||r,te=n||!e.trim(),ne=i||d(`chat.attachment.add`);function re(e,t){t?.(e.currentTarget.files),e.currentTarget.value=``}function f(t){t.key===`Enter`&&(t.shiftKey||t.nativeEvent.isComposing||(t.preventDefault(),e.trim()&&c()))}function ie(e){if(ee)return;let t=a?.current;t&&(t.accept=e,t.click())}return(0,S.jsxs)(`div`,{className:`chat-input-area`,children:[(0,S.jsx)(`input`,{ref:a,type:`file`,accept:Le,className:`chat-file-input`,onChange:e=>re(e,l)}),(0,S.jsx)(_e,{ariaLabel:d(`chat.attachmentType`),placement:`top-start`,disabled:ee,menuClassName:o,items:Ie.map(e=>{let t=e.icon;return{key:e.key,label:d(e.labelKey),icon:(0,S.jsx)(t,{size:16}),onSelect:()=>ie(e.accept)}}),renderTrigger:e=>(0,S.jsx)(`button`,{...e,className:`btn btn-circle chat-tool-btn`,"aria-label":ne,children:r?(0,S.jsx)(se,{size:18,className:`ui-spinner chat-attachment-spinner`}):(0,S.jsx)(u,{size:18})})}),(0,S.jsx)(`textarea`,{className:`textarea chat-composer-input`,placeholder:t,value:e,disabled:n,rows:1,onChange:e=>s(e.target.value),onKeyDown:f}),(0,S.jsx)(`button`,{type:`button`,className:`btn btn-circle btn-primary send-btn`,onClick:c,disabled:te,title:d(`chat.sendMessage`),children:(0,S.jsx)(m,{size:18})})]})}var C=`mostbox.chat.lastReadAt`;function w(e){return Date.parse(e?.lastMessageAt||``)||Date.parse(e?.createdAt||``)||0}function We(e){let t=String(e||``).trim().toLowerCase();return t?`${C}:${t}`:``}function T(e,t=Date.now()){let n=Number(e);return Math.max(0,Math.floor(Number.isFinite(n)&&n>0?n:t))}function Ge(e,t=Ze()){if(!e||!t)return{};try{let n=t.getItem(e);if(!n)return{};let r=JSON.parse(n);return!r||typeof r!=`object`?{}:Object.entries(r).reduce((e,[t,n])=>{let r=Number(n);return t&&Number.isFinite(r)&&r>=0&&(e[t]=r),e},{})}catch{return{}}}function Ke(e,t,n=Ze()){if(!(!e||!n))try{n.setItem(e,JSON.stringify(t))}catch{}}function qe(e,t,n=Date.now(),r=Date.now()){if(!t)return{changed:!1,value:e};let i=T(n,r);return(e[t]||0)>=i?{changed:!1,value:e}:{changed:!0,value:{...e,[t]:i}}}function Je(e,t,n=Date.now()){let r=!1,i={...e};for(let e of t){let t=e?.channelKey||e?.name;!t||i[t]!==void 0||(i[t]=T(w(e),n),r=!0)}return{changed:r,value:r?i:e}}function Ye(e,{channelName:t,messageTime:n,activeChannelName:r=``,messageAuthor:i=``,userAddress:a=``,now:o=Date.now()}){if(!t)return{changed:!1,notify:!1,value:e};let s=T(n,o),c=t===r;if(String(i||``).toLowerCase()===String(a||``).toLowerCase())return{...qe(e,t,s,o),notify:!1};if(c)return{...qe(e,t,s,o),notify:!0};let l=e[t]||0;if(l<s)return{changed:!1,notify:!0,value:e};let u=Math.max(0,s-1);return l===u?{changed:!1,notify:!0,value:e}:{changed:!0,notify:!0,value:{...e,[t]:u}}}function Xe(e,t){let n=e?.channelKey||e?.name;return w(e)>(t[n]||0)}function Ze(){if(!(typeof window>`u`))return window.localStorage}var Qe=3,$e=30,et=/^[a-zA-Z0-9_-]+$/,tt=1e4,nt=12e3,rt=1200,it=800;function E(e){return e?.channelKey||e?.name||``}function D(e){return e?.channelId||e?.name||``}function at(e){return e&&typeof e==`object`?e:{}}function ot(e){let t=at(e),n=new Set,r=e=>{let t=String(e||``).trim();t&&n.add(t)};return r(t.channelKey),r(t.channel),Array.isArray(t.channels)&&t.channels.forEach(e=>{let t=at(e);r(t.channelKey),r(t.channel),r(t.name)}),[...n]}function O(e){return e?.remark||D(e)}function st(){return typeof window>`u`?``:(new URLSearchParams(window.location.search).get(`channel`)||``).trim()}function ct(e){let t=new Date(e||Date.now());return Number.isNaN(t.getTime())?String(Date.now()):t.toISOString().slice(0,16).replace(`T`,` `).replace(`:`,`-`)}function lt(e){return e.replace(/\\/g,`\\\\`).replace(/\[/g,`\\[`).replace(/\]/g,`\\]`)}function ut(e,t){return`[${lt(e)}](<${t.replace(/>/g,`%3E`)}>)`}function dt(e){let t=String(e||``).trim().split(/\r?\n/);return t.length>0?t.map(e=>`> ${e}`).join(`
|
|
2
|
+
`):`> `}var ft=`chat-file`;function pt(e,t){return e.type.startsWith(`image/`)?`image`:e.type.startsWith(`video/`)?`video`:e.type.startsWith(`audio/`)?`audio`:e.type.startsWith(`text/`)?`text`:ie(t)}function mt(e){return e?`${e.slice(0,6)}...${e.slice(-4)}`:`Unknown`}function ht(e){return/#[a-fA-F0-9]{4}$/.test(String(e||``).trim())}function k(e){return String(e||``).trim().toLowerCase()}function gt(){if(typeof window>`u`)return;let e=window;return e.AudioContext||e.webkitAudioContext}function A(){let e=c(e=>e.hasBackend),t=c(e=>e.isDarkMode),n=c(e=>e.addToast),r=c(e=>e.openConnectModal),a=i(e=>e.identity),l=i(e=>e.openLoginModal),[d,f]=(0,x.useState)([]),[p,m]=(0,x.useState)(null),[h,g]=(0,x.useState)(``),[fe,_]=(0,x.useState)(!1),[_e,ye]=(0,x.useState)(``),[xe,b]=(0,x.useState)(``),[je,Pe]=ce(!1),[Ie,Le]=(0,x.useState)(``),[C,T]=(0,x.useState)(!1),[Ze,at]=(0,x.useState)(!1),[lt,A]=ce(!1),[_t,vt]=(0,x.useState)(null),[j,yt]=(0,x.useState)(null),[bt,M]=(0,x.useState)(!1),[xt,St]=(0,x.useState)(``),[Ct,wt]=(0,x.useState)(!1),[Tt,Et]=(0,x.useState)(null),[Dt,Ot]=(0,x.useState)(!1),[N,P]=(0,x.useState)({}),[F,I]=(0,x.useState)(null),[kt,At]=(0,x.useState)(!1),[jt,Mt]=(0,x.useState)(!1),[Nt,Pt]=(0,x.useState)(!1),[Ft,L]=(0,x.useState)({}),[It,Lt]=(0,x.useState)([]),R=a?.theme===`sparkbit`,Rt=R&&a?.data?a.data:``,zt=R&&a?.logo||``,Bt=R&&t&&a?.logo_dark||``,Vt=Bt||zt,Ht=Bt&&zt&&Bt!==zt?zt:``,Ut=Vt&&!jt?Vt:Ht&&!Nt?Ht:``,Wt=(0,x.useRef)(null),Gt=(0,x.useRef)(null),z=(0,x.useRef)(``),Kt=(0,x.useRef)(new Set),qt=(0,x.useRef)(new Set),B=(0,x.useRef)(null),Jt=(0,x.useRef)(!1),Yt=(0,x.useRef)(0),Xt=(0,x.useRef)(async()=>[]),Zt=(0,x.useRef)(new Map),V=(0,x.useRef)(new Map),H=(0,x.useRef)(new Set),U=e===!0,{t:W,compareStrings:Qt,formatDate:$t,formatTime:en}=v(),G=(0,x.useCallback)(async(e,t)=>{n(await s(e,t),`error`)},[n]),K=(0,x.useMemo)(()=>We(a?.address),[a?.address]),tn=(0,x.useCallback)((e,t=Date.now())=>{e&&L(n=>{let r=qe(n,e,t);return r.changed?(Ke(K,r.value),r.value):n})},[K]),q=(0,x.useCallback)(()=>{if(Jt.current||typeof window>`u`)return;let e=gt();if(e)try{let t=B.current||new e;B.current=t,t.state===`suspended`&&t.resume().catch(()=>{}),Jt.current=!0}catch{}},[]),nn=(0,x.useCallback)(()=>{if(!Jt.current)return;let e=Date.now();if(e-Yt.current<rt)return;Yt.current=e;let t=gt();if(t)try{let e=B.current||new t;if(B.current=e,e.state===`suspended`){e.resume().catch(()=>{});return}let n=e.createGain();n.gain.setValueAtTime(1e-4,e.currentTime),n.gain.exponentialRampToValueAtTime(.08,e.currentTime+.015),n.gain.exponentialRampToValueAtTime(1e-4,e.currentTime+.18),n.connect(e.destination),[740,980].forEach((t,r)=>{let i=e.createOscillator();i.type=`sine`,i.frequency.setValueAtTime(t,e.currentTime),i.connect(n),i.start(e.currentTime+r*.035),i.stop(e.currentTime+.16+r*.035)})}catch{}},[]),J=(0,x.useCallback)(async(e=p)=>{let t=E(e);if(!t||!U){Lt([]);return}try{let e=await y.getChannelPresence(t);if(z.current!==t)return;Lt(e)}catch(e){console.warn(`[Chat] Failed to fetch channel presence:`,e instanceof Error?e.message:e)}},[p,U]),rn=(0,x.useCallback)((e=``)=>{let t=z.current;if(!e||e!==t||!U)return;let n=Zt.current,r=n.get(e);r&&window.clearTimeout(r);let i=window.setTimeout(()=>{n.delete(e),Xt.current(e)},it);n.set(e,i)},[U]);function an(e,t){switch(e){case`channel:message`:{let e=t?.channelKey||t?.channel,n=t?.message,r=Number(n?.timestamp)||Date.now();if(e){f(t=>t.map(t=>E(t)===e?{...t,lastMessageAt:new Date(r).toISOString()}:t));let t=e===z.current;L(i=>{let o=Ye(i,{channelName:e,messageTime:r,activeChannelName:t?e:``,messageAuthor:n?.author,userAddress:a?.address});return o.changed&&Ke(K,o.value),o.notify&&nn(),o.changed?o.value:i})}break}case`channel:peer:online`:case`channel:sync:available`:{let e=ot(t),n=z.current;$(),e.includes(n)&&(rn(n),p&&J(p));break}case`channel:presence`:{let e=t?.channelKey||t?.channel;p&&(!e||e===E(p))&&J(p);break}case`channel:joined`:case`channel:left`:$();break;case`user:metadata:updated`:t?.scope===`channels`&&$();break;case`download:success`:{let e=V.current.get(t.taskId);e&&(V.current.delete(t.taskId),H.current.delete(e.cid),P(t=>({...t,[e.cid]:{status:`available`,message:W(`chat.attachment.previewAvailable`)}})),n(W(`chat.attachment.downloadCompleted`,{fileName:t.fileName||Ne(e.fileName)}),`success`),gn(e,t.fileName||e.fileName));break}case`download:error`:case`download:cancelled`:{let r=V.current.get(t.taskId);r&&(V.current.delete(t.taskId),H.current.delete(r.cid),P(n=>({...n,[r.cid]:{status:`error`,message:e===`download:cancelled`?W(`chat.attachment.downloadCancelled`):t.error||W(`chat.attachment.downloadFailed`)}})),n(e===`download:cancelled`?W(`chat.attachment.downloadCancelled`):t.error||W(`chat.attachment.downloadFailed`),`error`));break}}}let on=(0,x.useMemo)(()=>d.map(e=>E(e)),[d]),sn=(0,x.useMemo)(()=>a?{...De(a),profileUpdatedAt:a.profileUpdatedAt}:{},[a?.avatar,a?.displayName,a?.profileUpdatedAt,a?.username]),{clearMessages:cn,messages:Y,sendMessage:ln,syncMessages:un}=Oe({isReady:U,enabled:!!a,channelName:E(p),extraSubscribedChannelNames:on,peerId:Ie,waitForPeerId:!0,onSyncError:e=>G(e,W(`chat.error.messages`)),onSocketEvent:an,onReconnect:()=>{$(),p&&J(p)},presenceEnabled:!!(p&&a),presenceProfile:sn});(0,x.useEffect)(()=>{Xt.current=un},[un]),(0,x.useEffect)(()=>{let e=Zt.current;return()=>{for(let t of e.values())window.clearTimeout(t);e.clear()}},[]);let dn=(0,x.useMemo)(()=>{let e=new Map;return Y.forEach((t,n)=>{let r=String(t.author||``).trim();if(!r)return;let i=r.toLowerCase(),a=Number(t.timestamp)||0,o=String(t.authorName||``).trim(),s=String(t.avatar||``).trim(),c=e.get(i);if(!c){e.set(i,{address:r,displayName:o,...s?{avatar:s}:{},firstSeenAt:a,lastSeenAt:a,index:n});return}a>=c.lastSeenAt&&(c.lastSeenAt=a,o&&(c.displayName=o),s&&(c.avatar=s))}),[...e.values()].sort((e,t)=>e.firstSeenAt-t.firstSeenAt||e.index-t.index)},[Y]),fn=(0,x.useMemo)(()=>new Map(dn.map(e=>[k(e.address),e])),[dn]),X=(0,x.useMemo)(()=>{let e=new Map;return It.forEach(t=>{let n=k(t.address);!n||!t.online||e.set(n,t)}),e},[It]),pn=(0,x.useMemo)(()=>{let e=new Map(fn);return It.forEach((t,n)=>{let r=k(t.address);!r||e.has(r)||e.set(r,{address:t.address,displayName:t.displayName||``,...t.avatar?{avatar:t.avatar}:{},firstSeenAt:t.lastSeen||Date.now(),lastSeenAt:t.lastSeen||Date.now(),index:dn.length+n})}),[...e.values()]},[dn,It,fn]),mn=(0,x.useMemo)(()=>new Set(X.keys()),[X]);function Z(){return U?!0:(r(),!1)}function Q(){return a?!0:(l(),!1)}(0,x.useEffect)(()=>{let e=()=>{g(st())};return e(),window.addEventListener(`popstate`,e),()=>window.removeEventListener(`popstate`,e)},[]),(0,x.useEffect)(()=>{a&&g(st())},[a?.address]),(0,x.useEffect)(()=>{Mt(!1),Pt(!1)},[Vt,Ht]),(0,x.useEffect)(()=>{z.current=E(p)},[p]),(0,x.useEffect)(()=>{L(Ge(K))},[K]),(0,x.useEffect)(()=>{!K||d.length===0||L(e=>{let t=Je(e,d);return t.changed&&Ke(K,t.value),t.changed?t.value:e})},[K,d]),(0,x.useEffect)(()=>(window.addEventListener(`pointerdown`,q,{passive:!0}),window.addEventListener(`keydown`,q),()=>{window.removeEventListener(`pointerdown`,q),window.removeEventListener(`keydown`,q)}),[q]),(0,x.useEffect)(()=>()=>{B.current?.close().catch(()=>{}),B.current=null,Jt.current=!1},[]),(0,x.useEffect)(()=>{Wt.current?.scrollIntoView({behavior:`smooth`})},[Y]),(0,x.useEffect)(()=>{if(!U){Le(``);return}o.get(`/api/node-id`).json().then(e=>Le(e.id)).catch(e=>{console.warn(`[Chat] Failed to fetch node ID:`,e.message),G(e,W(`chat.error.nodeId`))})},[U,G,W]),(0,x.useEffect)(()=>{U&&a?(_(!1),$()):_(!1)},[e,U,a?.address]),(0,x.useEffect)(()=>{if(p){if(U){let e=E(p);Lt([]),un(e,{replace:!0}),J(p)}}else Lt([])},[p,U,J,un]),(0,x.useEffect)(()=>{if(!h)return;if(!a){qt.current.has(h)||(qt.current.add(h),l());return}if(!U||!fe)return;let e=d.find(e=>E(e)===h)||d.find(e=>D(e)===h);if(e&&(!p||E(p)!==E(e))){bn(e);return}if(e&&p&&E(p)===E(e)&&(p.createdAt!==e.createdAt||p.coreKey!==e.coreKey||p.lastMessageAt!==e.lastMessageAt||p.pinned!==e.pinned||p.remark!==e.remark||p.type!==e.type)){m(e);return}if(e)return;let t=`${a.address}:${h}`;if(Kt.current.has(t)||C)return;let r=hn(h);if(Kt.current.add(t),r){n(r,`error`);return}Cn(h)},[d,p,h,fe,U,C,a?.address]),(0,x.useEffect)(()=>{a||(f([]),_(!1),m(null),g(st()),yt(null),cn(),b(``),Le(``),M(!1),Et(null),P({}),L({}),H.current.clear(),V.current.clear())},[cn,a?.address]);function hn(e){return e.length<Qe?W(`chat.validation.nameMin`,{count:Qe}):e.length>$e?W(`chat.validation.nameMax`,{count:$e}):e.includes(`.`)?W(`chat.validation.dotReserved`):et.test(e)?``:W(`chat.validation.allowedChars`)}async function $(){if(!U){_(!1);return}try{f(await y.getChannels()),_(!0)}catch(e){f([]),_(!1),await G(e,W(`chat.error.channelList`))}}function gn(e,t=e.fileName){let n=ie(t);Et({cid:e.cid,fileName:t,subtype:n===`file`?e.kind:n})}async function _n(e){let t=Te(e.link,W);if(t)return P(n=>({...n,[e.cid]:{status:`error`,message:t}})),!1;try{P(t=>({...t,[e.cid]:{status:`checking`}}));let t=await Ce.checkDownload(e.link,{timeout:tt,requestTimeout:nt});return P(n=>({...n,[e.cid]:{status:t.alreadyExists?`available`:`ready`,message:t.alreadyExists?W(`chat.attachment.localAvailable`):W(`chat.attachment.downloadAvailable`)}})),!0}catch(t){let n=await we(t);return P(t=>({...t,[e.cid]:{status:`error`,message:n}})),!1}}async function vn(e){I(null),await _n(e)&&await yn(e)}async function yn(e){if(!H.current.has(e.cid)){H.current.add(e.cid),P(t=>({...t,[e.cid]:{status:`downloading`,message:W(`chat.attachment.downloading`)}}));try{let t=await Ce.downloadFile(e.link);if(t.alreadyExists||t.fileName){H.current.delete(e.cid),P(t=>({...t,[e.cid]:{status:`available`,message:W(`chat.attachment.previewAvailable`)}})),gn({...e,fileName:t.fileName||e.fileName},t.fileName||e.fileName);return}t.taskId&&(V.current.set(t.taskId,e),n(W(`chat.attachment.downloadStarted`),`success`))}catch(t){let n=await we(t);H.current.delete(e.cid),P(t=>({...t,[e.cid]:{status:`error`,message:n}}))}}}async function bn(e){if(!Q()||!Z())return;let t=E(e);tn(t,Math.max(w(e),Date.now())),m(e),g(t),window.history.pushState({},``,`?channel=${encodeURIComponent(t)}`)}async function xn(e,t){if(t&&t.stopPropagation(),Q()&&Z()&&!Ze){at(!0);try{if(await y.leaveChannel(e),E(p)===e){m(null),g(``),cn();let e=new URL(window.location.href);e.searchParams.delete(`channel`),window.history.pushState({},``,e.pathname)}$(),A.close(),vt(null)}catch(e){await G(e,W(`chat.error.leave`))}finally{at(!1)}}}async function Sn(e){if(!Q()||!Z())return;let t=!e.pinned,n=E(e);try{let e=await y.setChannelPinned(n,t);f(t=>t.map(t=>E(t)===n?{...t,pinned:e.pinned}:t)),m(t=>t&&E(t)===n?{...t,pinned:e.pinned}:t)}catch(e){await G(e,W(t?`chat.error.pin`:`chat.error.unpin`))}}async function Cn(e){let t=e.trim();if(!t||C)return;let r=hn(t);if(r){n(r,`error`);return}if(Q()&&Z()){T(!0);try{let e=await y.createChannel(t,`public`,De(a)),n=e.channelKey||e.key||e.name||t,r=d.find(e=>E(e)===n),i={...r,name:e.name||t,channelId:e.channelId||e.name||t,channelKey:e.channelKey||e.key||r?.channelKey,type:e.type||r?.type||`public`,createdAt:e.createdAt||r?.createdAt,coreKey:e.coreKey||e.key||r?.coreKey,localWriterCoreKey:e.localWriterCoreKey||r?.localWriterCoreKey,writerCoreKeys:e.writerCoreKeys||r?.writerCoreKeys,remark:e.remark||r?.remark},o=E(i);f(e=>e.some(e=>E(e)===o)?e.map(e=>E(e)===o?{...e,...i}:e):[...e,i]),Pe.close(),await bn(i),$()}catch(e){await G(e,W(`chat.error.join`))}finally{T(!1)}}}async function wn(e,t){if(!e.trim()||!p||!Q()||!Z())return!1;let n=e.trim(),r=E(p);try{let e=await ln({channelName:r,content:n,attachment:t});return f(t=>t.map(t=>E(t)===r?{...t,lastMessageAt:new Date(Number(e?.timestamp)||Date.now()).toISOString()}:t)),e&&tn(r,Number(e.timestamp)||Date.now()),!0}catch(e){return await G(e,W(`chat.error.send`)),!1}}async function Tn(){if(!xe.trim())return;let e=xe.trim();b(``),await wn(e)}function En(e,t){return`${ft}/${e}/${t}`}async function Dn(e){if(!(!e||e.length===0||!p)&&Q()&&Z()&&!Dt){Ot(!0);try{for(let t of Array.from(e)){let e=En(D(p),t.name),r=await Ce.publishFile(t,e),i=r.fileName||e,a=r.link||Se(r.cid,i);await wn(a,{kind:pt(t,i),cid:r.cid,fileName:i,link:a,mimeType:t.type||void 0,size:t.size})&&n(W(`chat.attachment.published`,{fileName:Ne(i)}),`success`)}}catch(e){await G(e,W(`chat.error.attachmentSend`))}finally{Ot(!1)}}}async function On(e){if(!Q()||!Z())return;let t=N[e.cid];if(!(t?.status===`checking`||t?.status===`downloading`)){if(t?.status===`error`){I(e);return}if(t?.status===`ready`||t?.status===`available`){await yn(e);return}if(!t){await _n(e)&&await yn(e);return}}}function kn(e){let t=k(e.author),n=X.get(t),r=fn.get(t);return Rn(n?.displayName||r?.displayName||e.authorName,e.author)}function An(e){return!e.pending&&(!!e.attachment||!!e.content.trim())}function jn(e,t){let n=kn(t),r=`${$t(t.timestamp)} ${en(t.timestamp)}`,i=t.content.trim();e.push(`## ${r} ${n}`,``),i&&(!t.attachment||i!==t.attachment.link)&&e.push(dt(i),``),t.attachment&&e.push(`**${W(`chat.noteDraft.attachment`)}**`,``,`- ${W(`chat.noteDraft.file`)}: ${ut(Ne(t.attachment.fileName),t.attachment.link)}`,`- CID: \`${t.attachment.cid}\``,``)}function Mn(e){let t=p?O(p):``,n=`${$t(Date.now())} ${en(Date.now())}`,r=[`# ${W(`chat.noteDraft.heading`)}`,``,`- ${W(`chat.noteDraft.room`)}: ${t}`,`- ${W(`chat.noteDraft.exportedAt`)}: ${n}`,`- ${W(`chat.noteDraft.messageCount`)}: ${e.length}`,``];return e.forEach(e=>jn(r,e)),`${r.join(`
|
|
3
|
+
`).trimEnd()}\n`}function Nn(){let e=Y.filter(An);if(e.length===0){n(W(`chat.noteDraft.empty`),`warning`);return}let t=te({title:W(`chat.noteDraft.historyTitle`,{room:p?O(p):W(`chat.title`),time:ct()}),content:Mn(e)});if(!t){n(W(`chat.noteDraft.saveFailed`),`error`);return}M(!1),window.location.assign(ee(t.id))}async function Pn(e,t){if(!Q()||!Z())return;let n=E(e),r=await y.setChannelRemark(n,t);return f(e=>e.map(e=>E(e)===n?{...e,remark:r.remark}:e)),m(e=>e&&E(e)===n?{...e,remark:r.remark}:e),r.remark}async function Fn(){if(p)try{await Pn(p,xt)}catch(e){await G(e,W(`chat.error.remark`))}}async function In(e){if(!(!j||Ct)){wt(!0);try{await Pn(j,e),yt(null)}catch(e){await G(e,W(`chat.error.rename`))}finally{wt(!1)}}}function Ln(e){if(!e.attachment)return(0,S.jsx)(Re,{children:e.content});let t=e.attachment,n=N[t.cid],r=n?.status;return(0,S.jsx)(ze,{children:(0,S.jsx)(Fe,{attachment:t,status:r,message:n?.message,pending:e.pending,onOpen:On})})}function Rn(e,t){let n=String(e||``).trim();return n?kt?ht(n)?n:t?`${n}#${t.slice(-4).toUpperCase()}`:n:n.replace(/#[a-fA-F0-9]{4}$/,``):mt(t)}function zn(){return(0,S.jsx)(He,{members:pn.map(e=>{let t=X.get(k(e.address)),n=t?.displayName||e.displayName,r=t?.avatar||e.avatar;return{id:e.address,name:Rn(n,e.address),avatarSrc:ge(e.address,r),online:mn.has(k(e.address))}})})}let Bn=R&&!!h&&!p,Vn=[`chat-app-layout`,R?`sparkbit-chat-layout`:``].filter(Boolean).join(` `),Hn=R?`sparkbit-chat-action-menu`:void 0,Un=p?(0,S.jsx)(`h2`,{className:`header-title`,translate:`no`,children:O(p)}):(0,S.jsx)(`h2`,{className:`header-title`,children:W(`chat.title`)}),Wn=_e.trim().toLowerCase(),Gn=(0,x.useMemo)(()=>[...d].sort((e,t)=>{let n=Number(!!t.pinned)-Number(!!e.pinned);if(n!==0)return n;let r=w(t)-w(e);return r===0?Qt(O(e),O(t)):r}),[d,Qt]),Kn=Wn?Gn.filter(e=>[O(e),D(e),E(e)].some(e=>e.toLowerCase().includes(Wn))):Gn;return(0,S.jsxs)(le,{className:Vn,defaultHide:R,hideAccountMenu:R,sidebar:({closeSidebar:e})=>(0,S.jsxs)(S.Fragment,{children:[(0,S.jsx)(ue,{onNavigate:e}),(0,S.jsx)(`div`,{className:`chat-channel-search`,children:(0,S.jsxs)(`div`,{className:`ui-input-control`,children:[(0,S.jsx)(pe,{className:`ui-input-icon`,size:15}),(0,S.jsx)(`input`,{type:`search`,className:`input input-compact`,placeholder:W(`chat.search.placeholder`),value:_e,onChange:e=>ye(e.target.value),"aria-label":W(`chat.search.placeholder`)})]})}),(0,S.jsx)(`nav`,{className:`sidebar-nav`,children:d.length===0?(0,S.jsx)(`div`,{className:`sidebar-empty-state`,children:(0,S.jsx)(`p`,{children:W(`chat.empty.noChannels`)})}):Kn.length===0?(0,S.jsx)(`div`,{className:`sidebar-empty-state`,children:(0,S.jsx)(`p`,{children:W(`chat.empty.noMatches`)})}):Kn.map(t=>(0,S.jsx)(Ve,{active:E(p)===E(t),pinned:!!t.pinned,unread:Xe(t,Ft),title:O(t),menuClassName:Hn,onSelect:()=>{bn(t),e()},onTogglePin:()=>void Sn(t),onRename:()=>yt(t),onLeave:()=>{vt(t),A.open()}},E(t)))}),(0,S.jsxs)(`button`,{className:`ui-action-dashed create-channel-btn`,onClick:()=>{!Q()||!Z()||Pe.open()},children:[(0,S.jsx)(u,{size:16}),W(`chat.joinChannel`)]})]}),headerTitle:Un,sidebarToggleReplacement:R?(0,S.jsx)(`span`,{className:`sidebar-toggle-static-logo`,"aria-hidden":`true`,children:Ut?(0,S.jsx)(`img`,{className:`sidebar-toggle-static-logo-img`,src:Ut,alt:``,onError:()=>{if(Ut===Ht){Pt(!0);return}Mt(!0)}}):(0,S.jsx)(Ee,{size:18})}):void 0,headerRight:(0,S.jsx)(`div`,{className:`header-right-actions`,children:p&&(0,S.jsx)(`button`,{className:`btn btn-icon`,onClick:()=>M(!0),title:W(`chat.channelSettings`),children:(0,S.jsx)(Me,{size:16})})}),children:[p?(0,S.jsxs)(S.Fragment,{children:[(0,S.jsxs)(`div`,{className:`chat-messages`,children:[Y.length===0?(0,S.jsxs)(`div`,{className:`ui-empty-state chat-messages-empty`,children:[(0,S.jsx)(`div`,{className:`ui-empty-icon empty-icon`,children:(0,S.jsx)(de,{size:28})}),(0,S.jsx)(`p`,{children:W(`chat.empty.noMessages`)})]}):Y.map(e=>{let t=e.author?.toLowerCase()===a?.address.toLowerCase(),n=X.get(k(e.author)),r=fn.get(k(e.author)),i=mn.has(k(e.author)),o=n?.avatar||r?.avatar||e.avatar||(t?a.avatar:void 0),s=kn(e);return(0,S.jsx)(Be,{variant:t?`self`:`other`,pending:e.pending,isOnline:i,avatarSrc:ge(e.author,o),author:s,time:en(e.timestamp),children:Ln(e)},e.id||`${e.author}-${e.timestamp}`)}),(0,S.jsx)(`div`,{ref:Wt})]}),(0,S.jsx)(Ue,{message:xe,placeholder:W(a?`chat.composer.placeholder`:`chat.composer.signInPlaceholder`),disabled:!a,isPublishingAttachment:Dt,attachmentInputRef:Gt,attachmentMenuClassName:Hn,onMessageChange:b,onSend:Tn,onSelectAttachmentFiles:e=>{Dn(e)}})]}):Bn?(0,S.jsxs)(`div`,{className:`ui-empty-state chat-welcome`,children:[(0,S.jsx)(`div`,{className:`ui-empty-icon ui-empty-icon-lg welcome-icon`,children:(0,S.jsx)(se,{size:36,className:`ui-spinner`})}),(0,S.jsx)(`h2`,{className:`ui-empty-title`,children:W(`chat.restoring.title`)}),(0,S.jsx)(`p`,{className:`ui-empty-desc`,children:W(`chat.restoring.desc`)})]}):(0,S.jsx)(S.Fragment,{children:(0,S.jsxs)(`div`,{className:`ui-empty-state chat-welcome`,children:[(0,S.jsx)(`div`,{className:`ui-empty-icon ui-empty-icon-lg welcome-icon`,children:(0,S.jsx)(de,{size:36})}),(0,S.jsx)(`h2`,{className:`ui-empty-title`,children:W(`chat.select.title`)}),(0,S.jsx)(`p`,{className:`ui-empty-desc`,children:W(`chat.select.desc`)}),(0,S.jsx)(ne,{label:W(`chat.openChannelList`)})]})}),je&&(0,S.jsx)(he,{title:W(`chat.joinChannel`),placeholder:W(`chat.join.placeholder`),confirmText:W(`chat.join.confirm`),validate:hn,onConfirm:Cn,onClose:()=>Pe.close(),isLoading:C,loadingText:W(`chat.join.joining`)}),j&&(0,S.jsx)(he,{title:W(`chat.renameChannel`),placeholder:W(`chat.remark.placeholder`),defaultValue:j.remark||``,confirmText:W(`chat.remark.save`),onConfirm:In,onClose:()=>{Ct||yt(null)},isLoading:Ct,loadingText:W(`chat.remark.saving`),allowEmpty:!0,validate:e=>e.length>50?W(`chat.remark.tooLong`):``}),lt&&_t&&(0,S.jsx)(ve,{title:W(`chat.leaveChannel`),message:W(`chat.leaveConfirm`,{channel:O(_t)}),confirmText:W(Ze?`chat.leaving`:`chat.leaveChannel`),onConfirm:()=>xn(E(_t),void 0),danger:!0,onClose:()=>{A.close(),vt(null)}}),F&&(0,S.jsx)(be,{onClose:()=>I(null),children:(0,S.jsxs)(`div`,{className:`confirm-modal`,onClick:e=>e.stopPropagation(),children:[(0,S.jsxs)(`div`,{className:`modal-header`,children:[(0,S.jsx)(`h3`,{children:W(`chat.attachment.noSeedsTitle`)}),(0,S.jsx)(`button`,{type:`button`,className:`btn btn-icon`,onClick:()=>I(null),"aria-label":W(`common.close`),children:(0,S.jsx)(me,{size:18})})]}),(0,S.jsx)(`p`,{children:N[F.cid]?.message||W(`chat.attachment.noSeedsFallback`)}),(0,S.jsxs)(`div`,{className:`modal-actions`,children:[(0,S.jsx)(`button`,{type:`button`,className:`btn btn-secondary`,onClick:()=>I(null),children:W(`common.cancel`)}),(0,S.jsx)(`button`,{type:`button`,className:`btn btn-primary`,onClick:()=>vn(F),disabled:N[F.cid]?.status===`checking`,children:N[F.cid]?.status===`checking`?W(`app.checking`):W(`chat.attachment.retryCheck`)})]})]})}),Tt&&(0,S.jsx)(ae,{item:Tt,isBackendReady:U,getFileDownloadUrl:Ce.getFileDownloadUrl,onClose:()=>Et(null)}),bt&&p&&(0,S.jsx)(`div`,{className:`channel-detail-overlay`,onClick:()=>M(!1),children:(0,S.jsxs)(`div`,{className:`channel-detail-drawer`,onClick:e=>e.stopPropagation(),children:[(0,S.jsxs)(`div`,{className:`channel-detail-header`,children:[(0,S.jsx)(`h3`,{children:W(`chat.details.title`)}),(0,S.jsx)(`button`,{className:`btn btn-icon`,onClick:()=>M(!1),children:(0,S.jsx)(me,{size:18})})]}),(0,S.jsxs)(`div`,{className:`channel-detail-body`,children:[(0,S.jsxs)(`div`,{className:`channel-detail-section channel-members-section`,children:[(0,S.jsx)(`div`,{className:`channel-detail-label`,children:(0,S.jsx)(`span`,{children:W(`chat.details.members`,{count:pn.length})})}),zn()]}),Rt&&(0,S.jsx)(`div`,{className:`channel-detail-section`,children:(0,S.jsxs)(`a`,{className:`btn btn-primary btn-block`,href:Rt,target:`_blank`,rel:`noreferrer`,children:[(0,S.jsx)(oe,{size:16}),W(`chat.ticket.create`)]})}),!R&&(0,S.jsx)(`div`,{className:`channel-detail-section`,children:(0,S.jsxs)(`label`,{className:`setting-switch`,children:[(0,S.jsx)(`span`,{children:W(`chat.details.showAddressSuffix`)}),(0,S.jsx)(`input`,{type:`checkbox`,checked:kt,onChange:e=>At(e.target.checked)})]})}),!R&&(0,S.jsxs)(`div`,{className:`channel-detail-section`,children:[(0,S.jsxs)(`div`,{className:`channel-detail-label`,children:[(0,S.jsx)(Ae,{size:14}),(0,S.jsx)(`span`,{children:W(`chat.details.channelId`)})]}),(0,S.jsx)(`div`,{className:`ui-meta-box channel-detail-value channel-detail-mono`,translate:`no`,children:D(p)})]}),!R&&(0,S.jsxs)(`div`,{className:`channel-detail-section`,children:[(0,S.jsxs)(`div`,{className:`channel-detail-label`,children:[(0,S.jsx)(re,{size:14}),(0,S.jsx)(`span`,{children:W(`chat.remark.placeholder`)})]}),(0,S.jsx)(`input`,{type:`text`,className:`input input-compact`,placeholder:W(`chat.remark.placeholder`),value:xt,onChange:e=>St(e.target.value),onFocus:()=>St(p.remark||``),onBlur:()=>Fn(),onKeyDown:e=>{e.key===`Enter`&&e.currentTarget.blur()},maxLength:50})]}),(0,S.jsxs)(`div`,{className:`channel-detail-section`,children:[(0,S.jsxs)(`div`,{className:`channel-detail-label`,children:[(0,S.jsx)(ke,{size:14}),(0,S.jsx)(`span`,{children:W(`chat.channel.createdAt`)})]}),(0,S.jsx)(`div`,{className:`ui-meta-box channel-detail-value`,children:p.createdAt?$t(p.createdAt):`-`})]}),!R&&(0,S.jsxs)(`div`,{className:`channel-detail-section`,children:[(0,S.jsx)(`div`,{className:`channel-detail-label`,children:(0,S.jsx)(`span`,{children:W(`chat.noteDraft.settingsTitle`)})}),(0,S.jsx)(`p`,{className:`channel-detail-hint`,children:W(`chat.noteDraft.saveAllDesc`)}),(0,S.jsx)(`button`,{className:`btn btn-secondary btn-block`,onClick:Nn,children:W(`chat.noteDraft.saveAll`)})]})]}),!R&&(0,S.jsx)(`div`,{className:`channel-detail-footer`,children:(0,S.jsx)(`button`,{className:`btn btn-secondary btn-block`,onClick:()=>{M(!1),vt(p),A.open()},children:W(`chat.leaveChannel`)})})]})})]})}var _t=a(`/chat/`)({component:A});export{_t as Route};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{B as e}from"./useAppStore-DOnk608w.js";var t=e(`folder-open`,[[`path`,{d:`m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2`,key:`usdka0`}]]),n=e(`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`}]]);export{t as n,n as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as e,o as t,t as n}from"./jsx-runtime-Bt-cYkS5.js";import{B as r,E as i,W as a,_ as o,b as s,g as c,h as l,o as u,t as d,v as f,x as p,y as m}from"./useAppStore-DOnk608w.js";import{t as h}from"./AppTop-
|
|
1
|
+
import{n as e,o as t,t as n}from"./jsx-runtime-Bt-cYkS5.js";import{B as r,E as i,W as a,_ as o,b as s,g as c,h as l,o as u,t as d,v as f,x as p,y as m}from"./useAppStore-DOnk608w.js";import{t as h}from"./AppTop-qtp-3wqv.js";import{A as g}from"./index-CUzbruyP.js";import{i as _,n as v,r as y,t as b}from"./userProfile-BZvkCuet.js";import{t as x}from"./useChannelMessages-CDvw-f_x.js";var S=r(`spade`,[[`path`,{d:`M12 18v4`,key:`jadmvz`}],[`path`,{d:`M2 14.499a5.5 5.5 0 0 0 9.591 3.675.6.6 0 0 1 .818.001A5.5 5.5 0 0 0 22 14.5c0-2.29-1.5-4-3-5.5l-5.492-5.312a2 2 0 0 0-3-.02L5 8.999c-1.5 1.5-3 3.2-3 5.5`,key:`1aw2pz`}]]),C=r(`swords`,[[`polyline`,{points:`14.5 17.5 3 6 3 3 6 3 17.5 14.5`,key:`1hfsw2`}],[`line`,{x1:`13`,x2:`19`,y1:`19`,y2:`13`,key:`1vrmhu`}],[`line`,{x1:`16`,x2:`20`,y1:`16`,y2:`20`,key:`1bron3`}],[`line`,{x1:`19`,x2:`21`,y1:`21`,y2:`19`,key:`13pww6`}],[`polyline`,{points:`14.5 6.5 18 3 21 3 21 6 17.5 9.5`,key:`hbey2j`}],[`line`,{x1:`5`,x2:`9`,y1:`14`,y2:`18`,key:`1hf58s`}],[`line`,{x1:`7`,x2:`4`,y1:`17`,y2:`20`,key:`pidxm4`}],[`line`,{x1:`3`,x2:`5`,y1:`19`,y2:`21`,key:`1pehsh`}]]),w=n(),T=[{id:`gandengyan`,labelKey:`game.gandengyan.title`,href:`/game/gandengyan/`,icon:(0,w.jsx)(C,{size:16})},{id:`zhajinhua`,labelKey:`game.zhajinhua.title`,href:`/game/zhajinhua/`,icon:(0,w.jsx)(S,{size:16})}];function E({activeGame:e,closeSidebar:t}){let{t:n}=g();return(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(h,{onNavigate:t}),(0,w.jsx)(`nav`,{className:`sidebar-nav`,children:T.map(r=>(0,w.jsxs)(a,{to:r.href,className:`sidebar-nav-btn ${e===r.id?`active`:``}`,onClick:t,children:[r.icon,(0,w.jsx)(`span`,{children:n(r.labelKey)})]},r.id))})]})}var D=t(e(),1),O=`game`,k=`mostbox.game.event`,A=[`gandengyan`,`zhajinhua`],j=`ABCDEFGHJKLMNPQRSTUVWXYZ23456789`;function M(e){let t=String(e||``).trim().toLowerCase();return A.includes(t)?t:``}function N(e){return m(e)}function P(e){return/^[A-Z0-9]{4,8}$/.test(String(e||``))}function F(){let e=``;for(let t=0;t<6;t++)e+=j[s(32)];return e}function I(e,t){let n=M(e),r=N(t);return!n||!P(r)?``:`game.${n}.${r.toLowerCase()}`}function L({gameId:e,roomCode:t,event:n,payload:r}){let i=M(e);return{kind:k,version:1,gameId:i,roomCode:N(t),event:String(n||``),eventId:l(i||`game`),payload:r||{}}}function R(e,t={}){try{let n=JSON.parse(String(e||``));if(!n||n.kind!==`mostbox.game.event`||n.version!==1||typeof n.event!=`string`||typeof n.eventId!=`string`)return null;let r=M(n.gameId),i=N(n.roomCode);return!r||!P(i)||t.gameId&&r!==M(t.gameId)||t.roomCode&&i!==N(t.roomCode)?null:{...n,gameId:r,roomCode:i,payload:n.payload&&typeof n.payload==`object`?n.payload:{}}}catch{return null}}function z(e=[],t={}){let n=[],r=new Map,i=``;for(let a of U(e)){let e=R(a.content,t);if(e){if(e.event===`room:create`){let t=V(e.payload?.player,a);if(!t)continue;i||=t.address,H(n,r,t);continue}if(e.event===`player:join`){let t=V(e.payload?.player,a);t&&H(n,r,t);continue}if(e.event===`player:leave`){let t=c(e.payload?.player?.address||a.author);if(t){let e=n.findIndex(e=>e.address===t);e!==-1&&(n.splice(e,1),r.delete(t))}}}}return{gameId:M(t.gameId),roomCode:N(t.roomCode),hostAddress:i,players:n}}function B(e=[],t={}){let n=null;for(let r of U(e)){let e=R(r.content,t);if(!e||e.event!==`room:state`)continue;let i=Number(e.payload?.seq||0);(!n||i>=Number(n.payload?.seq||0))&&(n=e)}return n}function V(e,t){if(!e||typeof e!=`object`)return null;let n=t&&typeof t==`object`?t:{author:t},r=n.author,i=c(e.address||r);if(!i||c(r)!==i)return null;let a=f(n.authorName||e.name,p(i)),s=o(n.avatar||e.avatar),l={address:i,name:a,publicKey:String(e.publicKey||``).trim(),joinedAt:Number(e.joinedAt||Date.now())};return s&&(l.avatar=s),l}function H(e,t,n){let r=t.get(n.address);if(r){Object.assign(r,n);return}e.push(n),t.set(n.address,n)}function U(e){return[...e].sort((e,t)=>Number(e.timestamp||0)-Number(t.timestamp||0))}function W({gameId:e,onError:t,getPlayerPayload:n}){let{t:r}=g(),a=d(e=>e.hasBackend),o=d(e=>e.checkBackend),s=d(e=>e.openConnectModal),l=i(e=>e.identity),f=i(e=>e.openLoginModal),[p,m]=(0,D.useState)(``),[h,v]=(0,D.useState)(``),[y,S]=(0,D.useState)([]),[C,w]=(0,D.useState)(!1),T=(0,D.useRef)(h);T.current=h;let E=a===!0,k=(0,D.useMemo)(()=>l?{...b(l),profileUpdatedAt:l.profileUpdatedAt}:{},[l?.avatar,l?.displayName,l?.profileUpdatedAt,l?.username]),A=(0,D.useCallback)(async(e,n)=>{let r=await u(e,n);t&&t(r)},[t]),j=(0,D.useCallback)(async(e=T.current)=>{if(!e||!E)return S([]),[];try{let t=await _.getChannelPresence(e);return T.current===e?(S(t),t):[]}catch(e){return console.warn(`[Game] Failed to fetch channel presence:`,e instanceof Error?e.message:e),[]}},[E]),M=(0,D.useCallback)((e,t)=>{if(e!==`channel:presence`)return;let n=String(t?.channelKey||t?.channel||``).trim(),r=T.current;r&&(!n||n===r)&&j(r)},[j]),P=(0,D.useCallback)(t=>!!R(t.content,{gameId:e,roomCode:p}),[e,p]),z=(0,D.useCallback)(t=>{let n=R(t.content,{gameId:e,roomCode:p});return n?`${t.author}-${n.eventId}`:`${t.author}-${t.timestamp}-${t.content}`},[e,p]),{clearMessages:B,connected:V,messages:H,sendMessage:U,syncMessages:W}=x({isReady:E,enabled:!!l,channelName:h,limit:500,acceptMessage:P,getMessageKey:z,onSyncError:e=>A(e,r(`game.room.error.readLog`)),onSocketEvent:M,onReconnect:()=>{j()},presenceEnabled:!!(h&&l),presenceProfile:k});(0,D.useEffect)(()=>{if(!h||!E){S([]);return}j(h)},[h,E,j]);let K=(0,D.useMemo)(()=>H.map(t=>({message:t,event:R(t.content,{gameId:e,roomCode:p})})).filter(e=>e.event),[e,H,p]),J=(0,D.useMemo)(()=>{let e=new Map;return y.forEach(t=>{let n=c(t.address);!n||!t.online||e.set(n,t)}),e},[y]),Y=(0,D.useMemo)(()=>new Set(J.keys()),[J]),X=(0,D.useCallback)(()=>l?E?!0:(s(),!1):(f(),!1),[E,s,f,l]);(0,D.useEffect)(()=>{a===null&&o()},[o,a]);let Z=(0,D.useCallback)(async(i,a=!1)=>{if(!X()||!l)return!1;let o=a?F():N(i),s=I(e,o);if(!s)return t&&t(r(`game.room.error.invalidCode`)),!1;w(!0);try{let t=await _.createChannel(s,O,b(l)),r=t.channelKey||t.key||s;return await G(r,l,e,o,a?`room:create`:`player:join`,{player:q(l,n?.(l))}),m(o),v(r),B(),!0}catch(e){return await A(e,r(a?`game.room.error.createFailed`:`game.room.error.joinFailed`)),!1}finally{w(!1)}},[X,e,n,t,A,B,r,l]);return{channelName:h,channelPresence:y,connected:V,createRoom:(0,D.useCallback)(()=>Z(``,!0),[Z]),ensureReady:X,isBackendReady:E,joinRoom:(0,D.useCallback)(e=>Z(e),[Z]),joining:C,messages:H,onlineAddresses:Y,presenceByAddress:J,roomCode:p,roomEvents:K,sendRoomEvent:(0,D.useCallback)(async(t,n={})=>{if(!X()||!l||!h||!p)return!1;let i=L({gameId:e,roomCode:p,event:t,payload:n}),a=JSON.stringify(i);try{return await U({channelName:h,content:a,optimisticId:`${l.address}-${i.eventId}`}),!0}catch(e){return await A(e,r(`game.room.error.sendEventFailed`)),!1}},[h,X,e,A,p,U,r,l]),setRoomCode:m,syncMessages:W,userIdentity:l}}async function G(e,t,n,r,i,a){let o=L({gameId:n,roomCode:r,event:i,payload:a});await _.sendChannelMessage({channelName:e,content:JSON.stringify(o),...y(t)})}function K(e){return{address:e.address,name:v(e),avatar:e.avatar||``,publicKey:``,joinedAt:Date.now()}}function q(e,t={}){let n=K(e),r={...n,...t};return Object.prototype.hasOwnProperty.call(t,`avatar`)||(r.avatar=n.avatar),r}export{S as a,E as i,z as n,B as r,W as t};
|
package/out/chat/index.html
CHANGED
|
Binary file
|
|
Binary file
|
package/out/chat/join/index.html
CHANGED
|
Binary file
|
package/out/download/index.html
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!DOCTYPE html><html lang="zh-CN" data-scroll-behavior="smooth"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><link rel="stylesheet" href="/assets/index-
|
|
1
|
+
<!DOCTYPE html><html lang="zh-CN" data-scroll-behavior="smooth"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><link rel="stylesheet" href="/assets/index-FV6RZlVI.css" data-precedence="default"/><title>下载 MostBox 桌面客户端</title><meta name="theme-color" content="#5e6ad2"/><meta name="description" content="下载 MostBox 桌面客户端,获得完整的 P2P 文件分享、下载校验和持续做种能力"/><link rel="modulepreload" href="/assets/index-CUzbruyP.js"/><link rel="modulepreload" href="/assets/jsx-runtime-Bt-cYkS5.js"/><link rel="modulepreload" href="/assets/useAppStore-DOnk608w.js"/><link rel="modulepreload" href="/assets/useNavigate-DWlBD_-b.js"/><link rel="icon" href="/logo.svg" type="image/svg+xml"/><script>
|
|
2
2
|
(function() {
|
|
3
3
|
var theme = localStorage.getItem('theme');
|
|
4
4
|
if (theme === 'dark' || (!theme && window.matchMedia('(prefers-color-scheme: dark)').matches)) {
|
|
@@ -17,4 +17,4 @@
|
|
|
17
17
|
window.onunhandledrejection = function(event) {
|
|
18
18
|
console.error('[Unhandled Promise Rejection]', event.reason);
|
|
19
19
|
};
|
|
20
|
-
</script><!--$--><div class="download-page"><nav class="mkt-nav"><div class="mkt-nav-inner"><button type="button" class="mkt-nav-logo"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-arrow-left" aria-hidden="true"><path d="m12 19-7-7 7-7"></path><path d="M19 12H5"></path></svg><span>MOST PEOPLE</span></button><div class="mkt-nav-cta"><button type="button" class="header-tool-btn" title="切换主题" aria-label="切换主题" aria-pressed="false"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-moon" aria-hidden="true"><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"></path></svg></button><span class="ui-action-menu-anchor language-toggle"><button type="button" aria-haspopup="menu" aria-expanded="false" aria-controls="_R_a5r6_" class="header-tool-btn" title="选择语言" aria-label="选择语言"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-languages" aria-hidden="true"><path d="m5 8 6 6"></path><path d="m4 14 6-6 2-3"></path><path d="M2 5h12"></path><path d="M7 2h1"></path><path d="m22 22-5-10-5 10"></path><path d="M14 18h6"></path></svg></button></span><a title="个人资料" aria-label="个人资料" href="/profile/" class="account-profile-link"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-user" aria-hidden="true"><path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2"></path><circle cx="12" cy="7" r="4"></circle></svg></a></div></div></nav><section class="download-hero"><div class="mkt-container"><div class="download-hero-icon"><svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-download" aria-hidden="true"><path d="M12 15V3"></path><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path><path d="m7 10 5 5 5-5"></path></svg></div><h1 class="download-hero-title">下载客户端</h1><p class="download-hero-desc">桌面客户端是当前 MVP 的首选入口,内置本地 P2P 节点,提供发布、下载校验和持续做种的完整能力。Web 端只连接已有 MostBox 节点。</p></div></section><section class="download-platforms"><div class="mkt-container"><h2 class="download-section-title">选择你的平台</h2><div class="download-options"><div class="ui-segmented-control download-source-tabs" role="tablist" aria-label="下载来源"><button type="button" role="tab" aria-selected="false" disabled="" class="ui-segmented-option download-source-tab"><svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-cloud" aria-hidden="true"><path d="M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z"></path></svg>Cloudflare R2</button><button type="button" role="tab" aria-selected="true" class="ui-segmented-option download-source-tab is-active"><svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-code" aria-hidden="true"><path d="m16 18 6-6-6-6"></path><path d="m8 6-6 6 6 6"></path></svg>GitHub Releases</button></div><p class="download-source-note">正在获取 Cloudflare R2 高速镜像。</p><div class="download-current-platform" aria-label="当前系统"><article class="download-current-card"><div class="download-current-main"><div class="download-current-icon"><svg xmlns="http://www.w3.org/2000/svg" width="34" height="34" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-monitor" aria-hidden="true"><rect width="20" height="14" x="2" y="3" rx="2"></rect><line x1="8" x2="16" y1="21" y2="21"></line><line x1="12" x2="12" y1="17" y2="21"></line></svg></div><div class="download-current-copy"><div class="download-current-labels"><span class="download-current-kicker"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-circle-check" aria-hidden="true"><circle cx="12" cy="12" r="10"></circle><path d="m9 12 2 2 4-4"></path></svg>当前系统</span><span class="download-current-recommended">推荐下载</span></div><div class="download-current-heading"><h3>Windows</h3><span>x64</span></div><p>Windows 10 或更高版本</p><dl class="download-current-meta"><div><dt>来源</dt><dd>GitHub Releases</dd></div></dl></div></div><div class="download-current-actions"><span>已匹配你的设备</span><a href="https://github.com/most-people/most/releases/latest" class="btn btn-primary"><svg xmlns="http://www.w3.org/2000/svg" width="17" height="17" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-download" aria-hidden="true"><path d="M12 15V3"></path><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path><path d="m7 10 5 5 5-5"></path></svg>下载 .exe</a><p>GitHub Releases</p></div></article></div><div class="download-other-platforms"><p class="download-other-platforms-title">桌面端</p><div class="download-platform-grid"><article class="download-platform-card"><div class="download-platform-icon"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-monitor" aria-hidden="true"><rect width="20" height="14" x="2" y="3" rx="2"></rect><line x1="8" x2="16" y1="21" y2="21"></line><line x1="12" x2="12" y1="17" y2="21"></line></svg></div><div class="download-platform-content"><div class="download-platform-heading"><h3>Windows</h3><span>arm64</span></div><p>Windows 10 或更高版本</p><dl class="download-platform-meta"><div><dt>来源</dt><dd>GitHub Releases</dd></div></dl><div class="download-platform-actions"><a href="https://github.com/most-people/most/releases/latest" class="btn btn-primary"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-download" aria-hidden="true"><path d="M12 15V3"></path><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path><path d="m7 10 5 5 5-5"></path></svg>下载 .exe</a></div></div></article><article class="download-platform-card"><div class="download-platform-icon"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-apple" aria-hidden="true"><path d="M12 6.528V3a1 1 0 0 1 1-1h0"></path><path d="M18.237 21A15 15 0 0 0 22 11a6 6 0 0 0-10-4.472A6 6 0 0 0 2 11a15.1 15.1 0 0 0 3.763 10 3 3 0 0 0 3.648.648 5.5 5.5 0 0 1 5.178 0A3 3 0 0 0 18.237 21"></path></svg></div><div class="download-platform-content"><div class="download-platform-heading"><h3>macOS</h3><span>x64</span></div><p>macOS 12 Monterey 或更高版本</p><dl class="download-platform-meta"><div><dt>来源</dt><dd>GitHub Releases</dd></div></dl><div class="download-platform-actions"><a href="https://github.com/most-people/most/releases/latest" class="btn btn-primary"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-download" aria-hidden="true"><path d="M12 15V3"></path><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path><path d="m7 10 5 5 5-5"></path></svg>下载 .dmg</a></div></div></article><article class="download-platform-card"><div class="download-platform-icon"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-apple" aria-hidden="true"><path d="M12 6.528V3a1 1 0 0 1 1-1h0"></path><path d="M18.237 21A15 15 0 0 0 22 11a6 6 0 0 0-10-4.472A6 6 0 0 0 2 11a15.1 15.1 0 0 0 3.763 10 3 3 0 0 0 3.648.648 5.5 5.5 0 0 1 5.178 0A3 3 0 0 0 18.237 21"></path></svg></div><div class="download-platform-content"><div class="download-platform-heading"><h3>macOS</h3><span>arm64</span></div><p>macOS 12 Monterey 或更高版本</p><dl class="download-platform-meta"><div><dt>来源</dt><dd>GitHub Releases</dd></div></dl><div class="download-platform-actions"><a href="https://github.com/most-people/most/releases/latest" class="btn btn-primary"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-download" aria-hidden="true"><path d="M12 15V3"></path><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path><path d="m7 10 5 5 5-5"></path></svg>下载 .dmg</a></div></div></article><article class="download-platform-card"><div class="download-platform-icon"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-laptop" aria-hidden="true"><path d="M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z"></path><path d="M20.054 15.987H3.946"></path></svg></div><div class="download-platform-content"><div class="download-platform-heading"><h3>Linux</h3><span>x64</span></div><p>Ubuntu 20.04+ / Debian 11+ / 其他主流发行版</p><dl class="download-platform-meta"><div><dt>来源</dt><dd>GitHub Releases</dd></div></dl><div class="download-platform-actions"><a href="https://github.com/most-people/most/releases/latest" class="btn btn-primary"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-download" aria-hidden="true"><path d="M12 15V3"></path><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path><path d="m7 10 5 5 5-5"></path></svg>下载 .AppImage</a></div></div></article><article class="download-platform-card"><div class="download-platform-icon"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-laptop" aria-hidden="true"><path d="M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z"></path><path d="M20.054 15.987H3.946"></path></svg></div><div class="download-platform-content"><div class="download-platform-heading"><h3>Linux</h3><span>arm64</span></div><p>Ubuntu 20.04+ / Debian 11+ / 其他主流发行版</p><dl class="download-platform-meta"><div><dt>来源</dt><dd>GitHub Releases</dd></div></dl><div class="download-platform-actions"><a href="https://github.com/most-people/most/releases/latest" class="btn btn-primary"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-download" aria-hidden="true"><path d="M12 15V3"></path><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path><path d="m7 10 5 5 5-5"></path></svg>下载 .AppImage</a></div></div></article></div><div class="download-coming-soon"><p class="download-coming-soon-title">移动端</p><div class="download-coming-soon-grid"><article class="download-coming-soon-card"><div class="download-platform-icon download-coming-soon-icon"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-smartphone" aria-hidden="true"><rect width="14" height="20" x="5" y="2" rx="2" ry="2"></rect><path d="M12 18h.01"></path></svg></div><div class="download-platform-content"><div class="download-platform-heading"><h3>iOS</h3><span>敬请期待</span></div><p>iPhone / iPad 客户端规划中</p></div></article><article class="download-coming-soon-card"><div class="download-platform-icon download-coming-soon-icon"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-tablet-smartphone" aria-hidden="true"><rect width="10" height="14" x="3" y="8" rx="2"></rect><path d="M5 4a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v16a2 2 0 0 1-2 2h-2.4"></path><path d="M8 18h.01"></path></svg></div><div class="download-platform-content"><div class="download-platform-heading"><h3>安卓</h3><span>敬请期待</span></div><p>Android 手机和平板客户端规划中</p></div></article></div></div></div></div></div></section><section class="download-comparison"><div class="mkt-container"><h2 class="download-section-title">Web 端 vs 桌面端</h2><div class="download-table-wrap"><table class="download-table"><thead><tr><th>功能</th><th>Web 端</th><th>桌面端</th></tr></thead><tbody><tr><td>节点能力</td><td class="col-web">连接已有节点</td><td class="col-desktop">内置本地节点</td></tr><tr><td>P2P 文件分享</td><td class="col-web">依赖所连节点</td><td class="col-desktop">完整支持</td></tr><tr><td>下载校验</td><td class="col-web">依赖所连节点</td><td class="col-desktop">完整支持</td></tr><tr><td>持续做种</td><td class="col-web">依赖所连节点</td><td class="col-desktop">默认开启</td></tr><tr><td>大文件传输</td><td class="col-web">依赖所连节点</td><td class="col-desktop">10GB 上限内</td></tr></tbody></table></div></div></section><section class="download-cta"><div class="mkt-container"><p class="download-hero-desc">使用 npm 入口请先安装 Node.js >= 22.12,然后运行 npx most-box@latest 启动本机完整节点。</p></div></section><section class="download-cta"><div class="mkt-container"><a href="/" class="btn btn-primary">回首页</a></div></section><footer class="mkt-footer"><div class="mkt-container"><div class="mkt-footer-inner"><p class="mkt-footer-copy">MostBox</p></div></div></footer></div><script>(function(a,f){let l;try{l=JSON.parse(sessionStorage.getItem(a)||"{}")}catch{return}const n=l?.[f||history.state?.__TSR_key];let c=!1;for(const t in n){const e=n[t],o=e?.scrollX,s=e?.scrollY;if(Number.isFinite(o)&&Number.isFinite(s)){if(t==="window")scrollTo(o,s),c=!0;else if(t)try{const r=document.querySelector(t);r&&(r.scrollLeft=o,r.scrollTop=s)}catch{}}}if(c)return;const i=location.hash.slice(1);if(i){const t=history.state?.__hashScrollIntoViewOptions??!0;if(t){const e=document.getElementById(i);e&&e.scrollIntoView(t)}return}scrollTo(0,0)})("tsr-scroll-restoration-v1_3");document.currentScript.remove()</script><!--/$--><script class="$tsr" id="$tsr-stream-barrier">(self.$R=self.$R||{})["tsr"]=[];self.$_TSR={h(){this.hydrated=!0,this.c()},e(){this.streamEnded=!0,this.c()},c(){this.hydrated&&this.streamEnded&&(delete self.$_TSR,delete self.$R.tsr)},p(e){this.initialized?e():this.buffer.push(e)},buffer:[]};$_TSR.router=($R=>$R[0]={manifest:$R[1]={routes:$R[2]={__root__:$R[3]={preloads:$R[4]=["/assets/index-DjBN7bZV.js","/assets/jsx-runtime-Bt-cYkS5.js","/assets/useAppStore-DOnk608w.js","/assets/useNavigate-DWlBD_-b.js"],scripts:$R[5]=[$R[6]={attrs:$R[7]={type:"module",async:!0,src:"/assets/index-DjBN7bZV.js"}}],css:$R[8]=["/assets/index-B6acG3-t.css"]}}},matches:$R[9]=[$R[10]={i:"__root__",u:1782724170866,s:"success",ssr:!0},$R[11]={i:"downloaddownload",u:1782724170869,s:"success",ssr:!0}],lastMatchId:"downloaddownload"})($R["tsr"]);$_TSR.e();document.currentScript.remove()</script><script type="module" async="" src="/assets/index-DjBN7bZV.js"></script></body></html>
|
|
20
|
+
</script><!--$--><div class="download-page"><nav class="mkt-nav"><div class="mkt-nav-inner"><button type="button" class="mkt-nav-logo"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-arrow-left" aria-hidden="true"><path d="m12 19-7-7 7-7"></path><path d="M19 12H5"></path></svg><span>MOST PEOPLE</span></button><div class="mkt-nav-cta"><button type="button" class="header-tool-btn" title="切换主题" aria-label="切换主题" aria-pressed="false"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-moon" aria-hidden="true"><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"></path></svg></button><span class="ui-action-menu-anchor language-toggle"><button type="button" aria-haspopup="menu" aria-expanded="false" aria-controls="_R_a5r6_" class="header-tool-btn" title="选择语言" aria-label="选择语言"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-languages" aria-hidden="true"><path d="m5 8 6 6"></path><path d="m4 14 6-6 2-3"></path><path d="M2 5h12"></path><path d="M7 2h1"></path><path d="m22 22-5-10-5 10"></path><path d="M14 18h6"></path></svg></button></span><a title="个人资料" aria-label="个人资料" href="/profile/" class="account-profile-link"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-user" aria-hidden="true"><path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2"></path><circle cx="12" cy="7" r="4"></circle></svg></a></div></div></nav><section class="download-hero"><div class="mkt-container"><div class="download-hero-icon"><svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-download" aria-hidden="true"><path d="M12 15V3"></path><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path><path d="m7 10 5 5 5-5"></path></svg></div><h1 class="download-hero-title">下载客户端</h1><p class="download-hero-desc">桌面客户端是当前 MVP 的首选入口,内置本地 P2P 节点,提供发布、下载校验和持续做种的完整能力。Web 端只连接已有 MostBox 节点。</p></div></section><section class="download-platforms"><div class="mkt-container"><h2 class="download-section-title">选择你的平台</h2><div class="download-options"><div class="ui-segmented-control download-source-tabs" role="tablist" aria-label="下载来源"><button type="button" role="tab" aria-selected="false" disabled="" class="ui-segmented-option download-source-tab"><svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-cloud" aria-hidden="true"><path d="M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z"></path></svg>Cloudflare R2</button><button type="button" role="tab" aria-selected="true" class="ui-segmented-option download-source-tab is-active"><svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-code" aria-hidden="true"><path d="m16 18 6-6-6-6"></path><path d="m8 6-6 6 6 6"></path></svg>GitHub Releases</button></div><p class="download-source-note">正在获取 Cloudflare R2 高速镜像。</p><div class="download-current-platform" aria-label="当前系统"><article class="download-current-card"><div class="download-current-main"><div class="download-current-icon"><svg xmlns="http://www.w3.org/2000/svg" width="34" height="34" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-monitor" aria-hidden="true"><rect width="20" height="14" x="2" y="3" rx="2"></rect><line x1="8" x2="16" y1="21" y2="21"></line><line x1="12" x2="12" y1="17" y2="21"></line></svg></div><div class="download-current-copy"><div class="download-current-labels"><span class="download-current-kicker"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-circle-check" aria-hidden="true"><circle cx="12" cy="12" r="10"></circle><path d="m9 12 2 2 4-4"></path></svg>当前系统</span><span class="download-current-recommended">推荐下载</span></div><div class="download-current-heading"><h3>Windows</h3><span>x64</span></div><p>Windows 10 或更高版本</p><dl class="download-current-meta"><div><dt>来源</dt><dd>GitHub Releases</dd></div></dl></div></div><div class="download-current-actions"><span>已匹配你的设备</span><a href="https://github.com/most-people/most/releases/latest" class="btn btn-primary"><svg xmlns="http://www.w3.org/2000/svg" width="17" height="17" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-download" aria-hidden="true"><path d="M12 15V3"></path><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path><path d="m7 10 5 5 5-5"></path></svg>下载 .exe</a><p>GitHub Releases</p></div></article></div><div class="download-other-platforms"><p class="download-other-platforms-title">桌面端</p><div class="download-platform-grid"><article class="download-platform-card"><div class="download-platform-icon"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-monitor" aria-hidden="true"><rect width="20" height="14" x="2" y="3" rx="2"></rect><line x1="8" x2="16" y1="21" y2="21"></line><line x1="12" x2="12" y1="17" y2="21"></line></svg></div><div class="download-platform-content"><div class="download-platform-heading"><h3>Windows</h3><span>arm64</span></div><p>Windows 10 或更高版本</p><dl class="download-platform-meta"><div><dt>来源</dt><dd>GitHub Releases</dd></div></dl><div class="download-platform-actions"><a href="https://github.com/most-people/most/releases/latest" class="btn btn-primary"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-download" aria-hidden="true"><path d="M12 15V3"></path><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path><path d="m7 10 5 5 5-5"></path></svg>下载 .exe</a></div></div></article><article class="download-platform-card"><div class="download-platform-icon"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-apple" aria-hidden="true"><path d="M12 6.528V3a1 1 0 0 1 1-1h0"></path><path d="M18.237 21A15 15 0 0 0 22 11a6 6 0 0 0-10-4.472A6 6 0 0 0 2 11a15.1 15.1 0 0 0 3.763 10 3 3 0 0 0 3.648.648 5.5 5.5 0 0 1 5.178 0A3 3 0 0 0 18.237 21"></path></svg></div><div class="download-platform-content"><div class="download-platform-heading"><h3>macOS</h3><span>x64</span></div><p>macOS 12 Monterey 或更高版本</p><dl class="download-platform-meta"><div><dt>来源</dt><dd>GitHub Releases</dd></div></dl><div class="download-platform-actions"><a href="https://github.com/most-people/most/releases/latest" class="btn btn-primary"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-download" aria-hidden="true"><path d="M12 15V3"></path><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path><path d="m7 10 5 5 5-5"></path></svg>下载 .dmg</a></div></div></article><article class="download-platform-card"><div class="download-platform-icon"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-apple" aria-hidden="true"><path d="M12 6.528V3a1 1 0 0 1 1-1h0"></path><path d="M18.237 21A15 15 0 0 0 22 11a6 6 0 0 0-10-4.472A6 6 0 0 0 2 11a15.1 15.1 0 0 0 3.763 10 3 3 0 0 0 3.648.648 5.5 5.5 0 0 1 5.178 0A3 3 0 0 0 18.237 21"></path></svg></div><div class="download-platform-content"><div class="download-platform-heading"><h3>macOS</h3><span>arm64</span></div><p>macOS 12 Monterey 或更高版本</p><dl class="download-platform-meta"><div><dt>来源</dt><dd>GitHub Releases</dd></div></dl><div class="download-platform-actions"><a href="https://github.com/most-people/most/releases/latest" class="btn btn-primary"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-download" aria-hidden="true"><path d="M12 15V3"></path><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path><path d="m7 10 5 5 5-5"></path></svg>下载 .dmg</a></div></div></article><article class="download-platform-card"><div class="download-platform-icon"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-laptop" aria-hidden="true"><path d="M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z"></path><path d="M20.054 15.987H3.946"></path></svg></div><div class="download-platform-content"><div class="download-platform-heading"><h3>Linux</h3><span>x64</span></div><p>Ubuntu 20.04+ / Debian 11+ / 其他主流发行版</p><dl class="download-platform-meta"><div><dt>来源</dt><dd>GitHub Releases</dd></div></dl><div class="download-platform-actions"><a href="https://github.com/most-people/most/releases/latest" class="btn btn-primary"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-download" aria-hidden="true"><path d="M12 15V3"></path><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path><path d="m7 10 5 5 5-5"></path></svg>下载 .AppImage</a></div></div></article><article class="download-platform-card"><div class="download-platform-icon"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-laptop" aria-hidden="true"><path d="M18 5a2 2 0 0 1 2 2v8.526a2 2 0 0 0 .212.897l1.068 2.127a1 1 0 0 1-.9 1.45H3.62a1 1 0 0 1-.9-1.45l1.068-2.127A2 2 0 0 0 4 15.526V7a2 2 0 0 1 2-2z"></path><path d="M20.054 15.987H3.946"></path></svg></div><div class="download-platform-content"><div class="download-platform-heading"><h3>Linux</h3><span>arm64</span></div><p>Ubuntu 20.04+ / Debian 11+ / 其他主流发行版</p><dl class="download-platform-meta"><div><dt>来源</dt><dd>GitHub Releases</dd></div></dl><div class="download-platform-actions"><a href="https://github.com/most-people/most/releases/latest" class="btn btn-primary"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-download" aria-hidden="true"><path d="M12 15V3"></path><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path><path d="m7 10 5 5 5-5"></path></svg>下载 .AppImage</a></div></div></article></div><div class="download-coming-soon"><p class="download-coming-soon-title">移动端</p><div class="download-coming-soon-grid"><article class="download-coming-soon-card"><div class="download-platform-icon download-coming-soon-icon"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-smartphone" aria-hidden="true"><rect width="14" height="20" x="5" y="2" rx="2" ry="2"></rect><path d="M12 18h.01"></path></svg></div><div class="download-platform-content"><div class="download-platform-heading"><h3>iOS</h3><span>敬请期待</span></div><p>iPhone / iPad 客户端规划中</p></div></article><article class="download-coming-soon-card"><div class="download-platform-icon download-coming-soon-icon"><svg xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-tablet-smartphone" aria-hidden="true"><rect width="10" height="14" x="3" y="8" rx="2"></rect><path d="M5 4a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v16a2 2 0 0 1-2 2h-2.4"></path><path d="M8 18h.01"></path></svg></div><div class="download-platform-content"><div class="download-platform-heading"><h3>安卓</h3><span>敬请期待</span></div><p>Android 手机和平板客户端规划中</p></div></article></div></div></div></div></div></section><section class="download-comparison"><div class="mkt-container"><h2 class="download-section-title">Web 端 vs 桌面端</h2><div class="download-table-wrap"><table class="download-table"><thead><tr><th>功能</th><th>Web 端</th><th>桌面端</th></tr></thead><tbody><tr><td>节点能力</td><td class="col-web">连接已有节点</td><td class="col-desktop">内置本地节点</td></tr><tr><td>P2P 文件分享</td><td class="col-web">依赖所连节点</td><td class="col-desktop">完整支持</td></tr><tr><td>下载校验</td><td class="col-web">依赖所连节点</td><td class="col-desktop">完整支持</td></tr><tr><td>持续做种</td><td class="col-web">依赖所连节点</td><td class="col-desktop">默认开启</td></tr><tr><td>大文件传输</td><td class="col-web">依赖所连节点</td><td class="col-desktop">10GB 上限内</td></tr></tbody></table></div></div></section><section class="download-cta"><div class="mkt-container"><p class="download-hero-desc">使用 npm 入口请先安装 Node.js >= 22.12,然后运行 npx most-box@latest 启动本机完整节点。</p></div></section><section class="download-cta"><div class="mkt-container"><a href="/" class="btn btn-primary">回首页</a></div></section><footer class="mkt-footer"><div class="mkt-container"><div class="mkt-footer-inner"><p class="mkt-footer-copy">MostBox</p></div></div></footer></div><script>(function(a,f){let l;try{l=JSON.parse(sessionStorage.getItem(a)||"{}")}catch{return}const n=l?.[f||history.state?.__TSR_key];let c=!1;for(const t in n){const e=n[t],o=e?.scrollX,s=e?.scrollY;if(Number.isFinite(o)&&Number.isFinite(s)){if(t==="window")scrollTo(o,s),c=!0;else if(t)try{const r=document.querySelector(t);r&&(r.scrollLeft=o,r.scrollTop=s)}catch{}}}if(c)return;const i=location.hash.slice(1);if(i){const t=history.state?.__hashScrollIntoViewOptions??!0;if(t){const e=document.getElementById(i);e&&e.scrollIntoView(t)}return}scrollTo(0,0)})("tsr-scroll-restoration-v1_3");document.currentScript.remove()</script><!--/$--><script class="$tsr" id="$tsr-stream-barrier">(self.$R=self.$R||{})["tsr"]=[];self.$_TSR={h(){this.hydrated=!0,this.c()},e(){this.streamEnded=!0,this.c()},c(){this.hydrated&&this.streamEnded&&(delete self.$_TSR,delete self.$R.tsr)},p(e){this.initialized?e():this.buffer.push(e)},buffer:[]};$_TSR.router=($R=>$R[0]={manifest:$R[1]={routes:$R[2]={__root__:$R[3]={preloads:$R[4]=["/assets/index-CUzbruyP.js","/assets/jsx-runtime-Bt-cYkS5.js","/assets/useAppStore-DOnk608w.js","/assets/useNavigate-DWlBD_-b.js"],scripts:$R[5]=[$R[6]={attrs:$R[7]={type:"module",async:!0,src:"/assets/index-CUzbruyP.js"}}],css:$R[8]=["/assets/index-FV6RZlVI.css"]}}},matches:$R[9]=[$R[10]={i:"__root__",u:1782799692179,s:"success",ssr:!0},$R[11]={i:"downloaddownload",u:1782799692182,s:"success",ssr:!0}],lastMatchId:"downloaddownload"})($R["tsr"]);$_TSR.e();document.currentScript.remove()</script><script type="module" async="" src="/assets/index-CUzbruyP.js"></script></body></html>
|
|
Binary file
|
package/out/game/index.html
CHANGED
|
Binary file
|
|
Binary file
|
package/out/index.html
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!DOCTYPE html><html lang="zh-CN" data-scroll-behavior="smooth"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><link rel="stylesheet" href="/assets/index-
|
|
1
|
+
<!DOCTYPE html><html lang="zh-CN" data-scroll-behavior="smooth"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1.0"/><link rel="stylesheet" href="/assets/index-FV6RZlVI.css" data-precedence="default"/><title>MostBox</title><meta name="theme-color" content="#5e6ad2"/><meta name="description" content="MostBox 是用户之间直连的聊天优先 P2P 工具箱:从聊天开始,传文件、整理知识库。"/><link rel="modulepreload" href="/assets/index-CUzbruyP.js"/><link rel="modulepreload" href="/assets/jsx-runtime-Bt-cYkS5.js"/><link rel="modulepreload" href="/assets/useAppStore-DOnk608w.js"/><link rel="modulepreload" href="/assets/useNavigate-DWlBD_-b.js"/><link rel="icon" href="/logo.svg" type="image/svg+xml"/><script>
|
|
2
2
|
(function() {
|
|
3
3
|
var theme = localStorage.getItem('theme');
|
|
4
4
|
if (theme === 'dark' || (!theme && window.matchMedia('(prefers-color-scheme: dark)').matches)) {
|
|
@@ -17,4 +17,4 @@
|
|
|
17
17
|
window.onunhandledrejection = function(event) {
|
|
18
18
|
console.error('[Unhandled Promise Rejection]', event.reason);
|
|
19
19
|
};
|
|
20
|
-
</script><!--$--><div class="mkt-layout"><nav class="mkt-nav"><div class="mkt-nav-inner"><a class="mkt-nav-logo active" href="/" data-status="active" aria-current="page"><svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><rect x="2" y="2" width="8" height="8" rx="2" fill="var(--accent)" opacity="0.4"></rect><rect x="14" y="2" width="8" height="8" rx="2" fill="var(--accent)" opacity="0.7"></rect><rect x="2" y="14" width="8" height="8" rx="2" fill="var(--accent)" opacity="0.7"></rect><rect x="14" y="14" width="8" height="8" rx="2" fill="var(--accent)"></rect></svg>MOST PEOPLE</a><div class="mkt-nav-cta"><button type="button" class="header-tool-btn" title="切换主题" aria-label="切换主题" aria-pressed="false"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-moon" aria-hidden="true"><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"></path></svg></button><span class="ui-action-menu-anchor language-toggle"><button type="button" aria-haspopup="menu" aria-expanded="false" aria-controls="_R_55r6_" class="header-tool-btn" title="选择语言" aria-label="选择语言"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-languages" aria-hidden="true"><path d="m5 8 6 6"></path><path d="m4 14 6-6 2-3"></path><path d="M2 5h12"></path><path d="M7 2h1"></path><path d="m22 22-5-10-5 10"></path><path d="M14 18h6"></path></svg></button></span><a href="/download/" class="btn btn-primary mkt-nav-preview"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-download" aria-hidden="true"><path d="M12 15V3"></path><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path><path d="m7 10 5 5 5-5"></path></svg>下载客户端</a><a title="个人资料" aria-label="个人资料" href="/profile/" class="account-profile-link"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-user" aria-hidden="true"><path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2"></path><circle cx="12" cy="7" r="4"></circle></svg></a></div></div></nav><main class="mkt-layout-main"><div class="portal-page"><section class="portal-hero"><div class="mkt-container"><h1 class="portal-hero-title">MOST PEOPLE</h1><p class="portal-hero-subtitle">用户之间直接连接的 P2P 工具箱。从聊天开始,直连传文件,整理知识库。</p></div></section><section class="portal-cards-section"><div class="mkt-container"><div class="portal-cards"><button class="portal-card active"><a title="打开聊天" href="/chat/" class="btn btn-icon portal-card-open-btn"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-arrow-up-right" aria-hidden="true"><path d="M7 7h10v10"></path><path d="M7 17 17 7"></path></svg></a><div class="portal-card-icon"><svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-message-square" aria-hidden="true"><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"></path></svg></div><div class="portal-card-title">聊天</div><div class="portal-card-subtitle">用户之间直接连接</div><div class="ui-badge portal-card-status checking"><span class="status-dot checking"></span>检测中</div></button><button class="portal-card "><a title="打开文件" href="/app/" class="btn btn-icon portal-card-open-btn"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-arrow-up-right" aria-hidden="true"><path d="M7 7h10v10"></path><path d="M7 17 17 7"></path></svg></a><div class="portal-card-icon"><svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-folder-open" aria-hidden="true"><path d="m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2"></path></svg></div><div class="portal-card-title">文件</div><div class="portal-card-subtitle">聊天附件和传输管理</div><div class="ui-badge portal-card-status checking"><span class="status-dot checking"></span>检测中</div></button><button class="portal-card "><a title="打开知识库" href="/note/" class="btn btn-icon portal-card-open-btn"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-arrow-up-right" aria-hidden="true"><path d="M7 7h10v10"></path><path d="M7 17 17 7"></path></svg></a><div class="portal-card-icon"><svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-notebook-pen" aria-hidden="true"><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"></path><path d="M2 6h4"></path><path d="M2 10h4"></path><path d="M2 14h4"></path><path d="M2 18h4"></path><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"></path></svg></div><div class="portal-card-title">知识库</div><div class="portal-card-subtitle">Markdown 知识库</div><div class="ui-badge portal-card-status ready"><span class="status-dot ready"></span>已就绪</div></button><button class="portal-card "><a title="打开游戏" href="/game/gandengyan/" class="btn btn-icon portal-card-open-btn"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-arrow-up-right" aria-hidden="true"><path d="M7 7h10v10"></path><path d="M7 17 17 7"></path></svg></a><div class="portal-card-icon"><svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-gamepad2 lucide-gamepad-2" aria-hidden="true"><line x1="6" x2="10" y1="11" y2="11"></line><line x1="8" x2="8" y1="9" y2="13"></line><line x1="15" x2="15.01" y1="12" y2="12"></line><line x1="18" x2="18.01" y1="10" y2="10"></line><path d="M17.32 5H6.68a4 4 0 0 0-3.978 3.59c-.006.052-.01.101-.017.152C2.604 9.416 2 14.456 2 16a3 3 0 0 0 3 3c1 0 1.5-.5 2-1l1.414-1.414A2 2 0 0 1 9.828 16h4.344a2 2 0 0 1 1.414.586L17 18c.5.5 1 1 2 1a3 3 0 0 0 3-3c0-1.545-.604-6.584-.685-7.258-.007-.05-.011-.1-.017-.151A4 4 0 0 0 17.32 5z"></path></svg></div><div class="portal-card-title">游戏</div><div class="portal-card-subtitle">独立房间游戏</div><div class="ui-badge portal-card-status checking"><span class="status-dot checking"></span>检测中</div></button><button class="portal-card "><a title="打开Web3" href="/web3/" class="btn btn-icon portal-card-open-btn"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-arrow-up-right" aria-hidden="true"><path d="M7 7h10v10"></path><path d="M7 17 17 7"></path></svg></a><div class="portal-card-icon"><svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-wallet" aria-hidden="true"><path d="M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1"></path><path d="M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4"></path></svg></div><div class="portal-card-title">Web3</div><div class="portal-card-subtitle">独立账户工具箱</div><div class="ui-badge portal-card-status ready"><span class="status-dot ready"></span>已就绪</div></button></div><div class="portal-node-actions" aria-label="节点入口"><button class="btn btn-secondary"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-server" aria-hidden="true"><rect width="20" height="8" x="2" y="2" rx="2" ry="2"></rect><rect width="20" height="8" x="2" y="14" rx="2" ry="2"></rect><line x1="6" x2="6.01" y1="6" y2="6"></line><line x1="6" x2="6.01" y1="18" y2="18"></line></svg>Web 连接节点</button><a href="/admin/" class="btn btn-secondary"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-hard-drive" aria-hidden="true"><path d="M10 16h.01"></path><path d="M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z"></path><path d="M21.946 12.013H2.054"></path><path d="M6 16h.01"></path></svg>节点管理</a></div></div></section><section class="portal-marketing"><div class="mkt-container"><div class="portal-marketing-inner"><div class="portal-marketing-header"><h2>从聊天开始</h2><p>创建聊天或房间,把房间 ID 发给朋友;消息、文件和知识库整理都从这里开始。</p></div><div class="portal-marketing-features"><div class="portal-feature-item"><span class="portal-feature-icon"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-check" aria-hidden="true"><path d="M20 6 9 17l-5-5"></path></svg></span><span>私域聊天和房间消息</span></div><div class="portal-feature-item"><span class="portal-feature-icon"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-check" aria-hidden="true"><path d="M20 6 9 17l-5-5"></path></svg></span><span>本地登录身份保护消息署名</span></div><div class="portal-feature-item"><span class="portal-feature-icon"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-check" aria-hidden="true"><path d="M20 6 9 17l-5-5"></path></svg></span><span>消息通过 P2P Channel 同步</span></div><div class="portal-feature-item"><span class="portal-feature-icon"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-check" aria-hidden="true"><path d="M20 6 9 17l-5-5"></path></svg></span><span>文件和知识库自然接入聊天流程</span></div><div class="portal-feature-item"><span class="portal-feature-icon"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-check" aria-hidden="true"><path d="M20 6 9 17l-5-5"></path></svg></span><span>无需中心化账号注册</span></div></div><div class="portal-marketing-steps"><div class="portal-step"><span class="portal-step-num">1</span><div class="portal-step-content"><strong>下载客户端</strong><p>支持 Windows、macOS 和 Linux。</p><p class="portal-step-link"><a href="/download/">前往下载页<!-- --> <svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-external-link" aria-hidden="true"><path d="M15 3h6v6"></path><path d="M10 14 21 3"></path><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path></svg></a></p></div></div><div class="portal-step"><span class="portal-step-num">2</span><div class="portal-step-content"><strong>创建聊天</strong><p>输入房间名即可加入或创建,并把房间 ID 发给朋友。</p></div></div><div class="portal-step"><span class="portal-step-num">3</span><div class="portal-step-content"><strong>开始聊天</strong><p>先发消息,再发送附件或保存到知识库。</p></div></div></div><div class="portal-actions"><a href="/chat/" class="btn btn-primary">进入 聊天<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-arrow-right" aria-hidden="true"><path d="M5 12h14"></path><path d="m12 5 7 7-7 7"></path></svg></a></div></div></div></section></div></main><footer class="mkt-footer"><div class="mkt-container"><div class="mkt-footer-inner"><div class="mkt-footer-links"><a class="active" href="/" data-status="active" aria-current="page">关于</a><a href="/ping/">网络</a><a href="https://github.com/most-people/most" target="_blank" rel="noopener noreferrer">GitHub</a></div><span class="mkt-footer-copy">© <!-- -->2026<!-- --> MOST PEOPLE · MIT License</span><span class="mkt-footer-build" translate="no">v<!-- -->0.3.2</span></div></div></footer></div><script>(function(a,f){let l;try{l=JSON.parse(sessionStorage.getItem(a)||"{}")}catch{return}const n=l?.[f||history.state?.__TSR_key];let c=!1;for(const t in n){const e=n[t],o=e?.scrollX,s=e?.scrollY;if(Number.isFinite(o)&&Number.isFinite(s)){if(t==="window")scrollTo(o,s),c=!0;else if(t)try{const r=document.querySelector(t);r&&(r.scrollLeft=o,r.scrollTop=s)}catch{}}}if(c)return;const i=location.hash.slice(1);if(i){const t=history.state?.__hashScrollIntoViewOptions??!0;if(t){const e=document.getElementById(i);e&&e.scrollIntoView(t)}return}scrollTo(0,0)})("tsr-scroll-restoration-v1_3");document.currentScript.remove()</script><!--/$--><script class="$tsr" id="$tsr-stream-barrier">(self.$R=self.$R||{})["tsr"]=[];self.$_TSR={h(){this.hydrated=!0,this.c()},e(){this.streamEnded=!0,this.c()},c(){this.hydrated&&this.streamEnded&&(delete self.$_TSR,delete self.$R.tsr)},p(e){this.initialized?e():this.buffer.push(e)},buffer:[]};$_TSR.router=($R=>$R[0]={manifest:$R[1]={routes:$R[2]={__root__:$R[3]={preloads:$R[4]=["/assets/index-DjBN7bZV.js","/assets/jsx-runtime-Bt-cYkS5.js","/assets/useAppStore-DOnk608w.js","/assets/useNavigate-DWlBD_-b.js"],scripts:$R[5]=[$R[6]={attrs:$R[7]={type:"module",async:!0,src:"/assets/index-DjBN7bZV.js"}}],css:$R[8]=["/assets/index-B6acG3-t.css"]}}},matches:$R[9]=[$R[10]={i:"__root__",u:1782724170712,s:"success",ssr:!0},$R[11]={i:"",u:1782724170786,s:"success",ssr:!0}],lastMatchId:""})($R["tsr"]);$_TSR.e();document.currentScript.remove()</script><script type="module" async="" src="/assets/index-DjBN7bZV.js"></script></body></html>
|
|
20
|
+
</script><!--$--><div class="mkt-layout"><nav class="mkt-nav"><div class="mkt-nav-inner"><a class="mkt-nav-logo active" href="/" data-status="active" aria-current="page"><svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><rect x="2" y="2" width="8" height="8" rx="2" fill="var(--accent)" opacity="0.4"></rect><rect x="14" y="2" width="8" height="8" rx="2" fill="var(--accent)" opacity="0.7"></rect><rect x="2" y="14" width="8" height="8" rx="2" fill="var(--accent)" opacity="0.7"></rect><rect x="14" y="14" width="8" height="8" rx="2" fill="var(--accent)"></rect></svg>MOST PEOPLE</a><div class="mkt-nav-cta"><button type="button" class="header-tool-btn" title="切换主题" aria-label="切换主题" aria-pressed="false"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-moon" aria-hidden="true"><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"></path></svg></button><span class="ui-action-menu-anchor language-toggle"><button type="button" aria-haspopup="menu" aria-expanded="false" aria-controls="_R_55r6_" class="header-tool-btn" title="选择语言" aria-label="选择语言"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-languages" aria-hidden="true"><path d="m5 8 6 6"></path><path d="m4 14 6-6 2-3"></path><path d="M2 5h12"></path><path d="M7 2h1"></path><path d="m22 22-5-10-5 10"></path><path d="M14 18h6"></path></svg></button></span><a href="/download/" class="btn btn-primary mkt-nav-preview"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-download" aria-hidden="true"><path d="M12 15V3"></path><path d="M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"></path><path d="m7 10 5 5 5-5"></path></svg>下载客户端</a><a title="个人资料" aria-label="个人资料" href="/profile/" class="account-profile-link"><svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-user" aria-hidden="true"><path d="M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2"></path><circle cx="12" cy="7" r="4"></circle></svg></a></div></div></nav><main class="mkt-layout-main"><div class="portal-page"><section class="portal-hero"><div class="mkt-container"><h1 class="portal-hero-title">MOST PEOPLE</h1><p class="portal-hero-subtitle">用户之间直接连接的 P2P 工具箱。从聊天开始,直连传文件,整理知识库。</p></div></section><section class="portal-cards-section"><div class="mkt-container"><div class="portal-cards"><button class="portal-card active"><a title="打开聊天" href="/chat/" class="btn btn-icon portal-card-open-btn"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-arrow-up-right" aria-hidden="true"><path d="M7 7h10v10"></path><path d="M7 17 17 7"></path></svg></a><div class="portal-card-icon"><svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-message-square" aria-hidden="true"><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"></path></svg></div><div class="portal-card-title">聊天</div><div class="portal-card-subtitle">用户之间直接连接</div><div class="ui-badge portal-card-status checking"><span class="status-dot checking"></span>检测中</div></button><button class="portal-card "><a title="打开文件" href="/app/" class="btn btn-icon portal-card-open-btn"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-arrow-up-right" aria-hidden="true"><path d="M7 7h10v10"></path><path d="M7 17 17 7"></path></svg></a><div class="portal-card-icon"><svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-folder-open" aria-hidden="true"><path d="m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2"></path></svg></div><div class="portal-card-title">文件</div><div class="portal-card-subtitle">聊天附件和传输管理</div><div class="ui-badge portal-card-status checking"><span class="status-dot checking"></span>检测中</div></button><button class="portal-card "><a title="打开知识库" href="/note/" class="btn btn-icon portal-card-open-btn"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-arrow-up-right" aria-hidden="true"><path d="M7 7h10v10"></path><path d="M7 17 17 7"></path></svg></a><div class="portal-card-icon"><svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-notebook-pen" aria-hidden="true"><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"></path><path d="M2 6h4"></path><path d="M2 10h4"></path><path d="M2 14h4"></path><path d="M2 18h4"></path><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"></path></svg></div><div class="portal-card-title">知识库</div><div class="portal-card-subtitle">Markdown 知识库</div><div class="ui-badge portal-card-status ready"><span class="status-dot ready"></span>已就绪</div></button><button class="portal-card "><a title="打开游戏" href="/game/gandengyan/" class="btn btn-icon portal-card-open-btn"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-arrow-up-right" aria-hidden="true"><path d="M7 7h10v10"></path><path d="M7 17 17 7"></path></svg></a><div class="portal-card-icon"><svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-gamepad2 lucide-gamepad-2" aria-hidden="true"><line x1="6" x2="10" y1="11" y2="11"></line><line x1="8" x2="8" y1="9" y2="13"></line><line x1="15" x2="15.01" y1="12" y2="12"></line><line x1="18" x2="18.01" y1="10" y2="10"></line><path d="M17.32 5H6.68a4 4 0 0 0-3.978 3.59c-.006.052-.01.101-.017.152C2.604 9.416 2 14.456 2 16a3 3 0 0 0 3 3c1 0 1.5-.5 2-1l1.414-1.414A2 2 0 0 1 9.828 16h4.344a2 2 0 0 1 1.414.586L17 18c.5.5 1 1 2 1a3 3 0 0 0 3-3c0-1.545-.604-6.584-.685-7.258-.007-.05-.011-.1-.017-.151A4 4 0 0 0 17.32 5z"></path></svg></div><div class="portal-card-title">游戏</div><div class="portal-card-subtitle">独立房间游戏</div><div class="ui-badge portal-card-status checking"><span class="status-dot checking"></span>检测中</div></button><button class="portal-card "><a title="打开Web3" href="/web3/" class="btn btn-icon portal-card-open-btn"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-arrow-up-right" aria-hidden="true"><path d="M7 7h10v10"></path><path d="M7 17 17 7"></path></svg></a><div class="portal-card-icon"><svg xmlns="http://www.w3.org/2000/svg" width="28" height="28" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-wallet" aria-hidden="true"><path d="M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1"></path><path d="M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4"></path></svg></div><div class="portal-card-title">Web3</div><div class="portal-card-subtitle">独立账户工具箱</div><div class="ui-badge portal-card-status ready"><span class="status-dot ready"></span>已就绪</div></button></div><div class="portal-node-actions" aria-label="节点入口"><button class="btn btn-secondary"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-server" aria-hidden="true"><rect width="20" height="8" x="2" y="2" rx="2" ry="2"></rect><rect width="20" height="8" x="2" y="14" rx="2" ry="2"></rect><line x1="6" x2="6.01" y1="6" y2="6"></line><line x1="6" x2="6.01" y1="18" y2="18"></line></svg>Web 连接节点</button><a href="/admin/" class="btn btn-secondary"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-hard-drive" aria-hidden="true"><path d="M10 16h.01"></path><path d="M2.212 11.577a2 2 0 0 0-.212.896V18a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-5.527a2 2 0 0 0-.212-.896L18.55 5.11A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z"></path><path d="M21.946 12.013H2.054"></path><path d="M6 16h.01"></path></svg>节点管理</a></div></div></section><section class="portal-marketing"><div class="mkt-container"><div class="portal-marketing-inner"><div class="portal-marketing-header"><h2>从聊天开始</h2><p>创建聊天或房间,把房间 ID 发给朋友;消息、文件和知识库整理都从这里开始。</p></div><div class="portal-marketing-features"><div class="portal-feature-item"><span class="portal-feature-icon"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-check" aria-hidden="true"><path d="M20 6 9 17l-5-5"></path></svg></span><span>私域聊天和房间消息</span></div><div class="portal-feature-item"><span class="portal-feature-icon"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-check" aria-hidden="true"><path d="M20 6 9 17l-5-5"></path></svg></span><span>本地登录身份保护消息署名</span></div><div class="portal-feature-item"><span class="portal-feature-icon"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-check" aria-hidden="true"><path d="M20 6 9 17l-5-5"></path></svg></span><span>消息通过 P2P Channel 同步</span></div><div class="portal-feature-item"><span class="portal-feature-icon"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-check" aria-hidden="true"><path d="M20 6 9 17l-5-5"></path></svg></span><span>文件和知识库自然接入聊天流程</span></div><div class="portal-feature-item"><span class="portal-feature-icon"><svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="3" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-check" aria-hidden="true"><path d="M20 6 9 17l-5-5"></path></svg></span><span>无需中心化账号注册</span></div></div><div class="portal-marketing-steps"><div class="portal-step"><span class="portal-step-num">1</span><div class="portal-step-content"><strong>下载客户端</strong><p>支持 Windows、macOS 和 Linux。</p><p class="portal-step-link"><a href="/download/">前往下载页<!-- --> <svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-external-link" aria-hidden="true"><path d="M15 3h6v6"></path><path d="M10 14 21 3"></path><path d="M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6"></path></svg></a></p></div></div><div class="portal-step"><span class="portal-step-num">2</span><div class="portal-step-content"><strong>创建聊天</strong><p>输入房间名即可加入或创建,并把房间 ID 发给朋友。</p></div></div><div class="portal-step"><span class="portal-step-num">3</span><div class="portal-step-content"><strong>开始聊天</strong><p>先发消息,再发送附件或保存到知识库。</p></div></div></div><div class="portal-actions"><a href="/chat/" class="btn btn-primary">进入 聊天<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-arrow-right" aria-hidden="true"><path d="M5 12h14"></path><path d="m12 5 7 7-7 7"></path></svg></a></div></div></div></section></div></main><footer class="mkt-footer"><div class="mkt-container"><div class="mkt-footer-inner"><div class="mkt-footer-links"><a class="active" href="/" data-status="active" aria-current="page">关于</a><a href="/ping/">网络</a><a href="https://github.com/most-people/most" target="_blank" rel="noopener noreferrer">GitHub</a></div><span class="mkt-footer-copy">© <!-- -->2026<!-- --> MOST PEOPLE · MIT License</span><span class="mkt-footer-build" translate="no">v<!-- -->0.3.3</span></div></div></footer></div><script>(function(a,f){let l;try{l=JSON.parse(sessionStorage.getItem(a)||"{}")}catch{return}const n=l?.[f||history.state?.__TSR_key];let c=!1;for(const t in n){const e=n[t],o=e?.scrollX,s=e?.scrollY;if(Number.isFinite(o)&&Number.isFinite(s)){if(t==="window")scrollTo(o,s),c=!0;else if(t)try{const r=document.querySelector(t);r&&(r.scrollLeft=o,r.scrollTop=s)}catch{}}}if(c)return;const i=location.hash.slice(1);if(i){const t=history.state?.__hashScrollIntoViewOptions??!0;if(t){const e=document.getElementById(i);e&&e.scrollIntoView(t)}return}scrollTo(0,0)})("tsr-scroll-restoration-v1_3");document.currentScript.remove()</script><!--/$--><script class="$tsr" id="$tsr-stream-barrier">(self.$R=self.$R||{})["tsr"]=[];self.$_TSR={h(){this.hydrated=!0,this.c()},e(){this.streamEnded=!0,this.c()},c(){this.hydrated&&this.streamEnded&&(delete self.$_TSR,delete self.$R.tsr)},p(e){this.initialized?e():this.buffer.push(e)},buffer:[]};$_TSR.router=($R=>$R[0]={manifest:$R[1]={routes:$R[2]={__root__:$R[3]={preloads:$R[4]=["/assets/index-CUzbruyP.js","/assets/jsx-runtime-Bt-cYkS5.js","/assets/useAppStore-DOnk608w.js","/assets/useNavigate-DWlBD_-b.js"],scripts:$R[5]=[$R[6]={attrs:$R[7]={type:"module",async:!0,src:"/assets/index-CUzbruyP.js"}}],css:$R[8]=["/assets/index-FV6RZlVI.css"]}}},matches:$R[9]=[$R[10]={i:"__root__",u:1782799692027,s:"success",ssr:!0},$R[11]={i:"",u:1782799692100,s:"success",ssr:!0}],lastMatchId:""})($R["tsr"]);$_TSR.e();document.currentScript.remove()</script><script type="module" async="" src="/assets/index-CUzbruyP.js"></script></body></html>
|
package/out/note/index.html
CHANGED
|
Binary file
|