most-box 0.2.8 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/out/admin/index.html +0 -0
  2. package/out/app/index.html +0 -0
  3. package/out/assets/{FilePreviewOverlay-D8H61qbp.js → FilePreviewOverlay-CM5IqnZD.js} +1 -1
  4. package/out/assets/{MarketingHeader-CrYsQsQ5.js → MarketingHeader-B45AaM29.js} +1 -1
  5. package/out/assets/{MarketingLayout-CQurMOSD.js → MarketingLayout-A00pEOa2.js} +1 -1
  6. package/out/assets/{MilkdownEditor-DrsyaR4h.js → MilkdownEditor-BTq9bDAf.js} +1 -1
  7. package/out/assets/{OpenSidebarButton-DnEgqP0S.js → OpenSidebarButton-D8qfUGzU.js} +1 -1
  8. package/out/assets/{SidebarAccount-B4OAl0as.js → SidebarAccount-_RBE5K_o.js} +1 -1
  9. package/out/assets/{SidebarHomeLink-BdsUM4Kt.js → SidebarHomeLink-qMFEGjZt.js} +1 -1
  10. package/out/assets/{downloadValidation-DbVOwdmC.js → downloadValidation-CSXwoQKW.js} +1 -1
  11. package/out/assets/index-BHZhApbo.css +1 -0
  12. package/out/assets/index-BRhsWNj1.css +1 -0
  13. package/out/assets/{index-BZ-f0CZd.js → index-C-_ZwxuN.js} +2 -2
  14. package/out/assets/index-CYVRmppz.css +1 -0
  15. package/out/assets/index.lazy-0YYV0CR3.js +1 -0
  16. package/out/assets/index.lazy-BTYGr9Vb.js +1 -0
  17. package/out/assets/{index.lazy-B7AbDiMU.js → index.lazy-BVAtQtTa.js} +1 -1
  18. package/out/assets/{index.lazy-oFaoa4qT.js → index.lazy-BbdLA2L-.js} +1 -1
  19. package/out/assets/{index.lazy-DVeqmqaA.js → index.lazy-CbiLtziY.js} +1 -1
  20. package/out/assets/{index.lazy-CvKEcWlH.js → index.lazy-CcEdBg3i.js} +2 -2
  21. package/out/assets/index.lazy-CePHsLXG.js +1 -0
  22. package/out/assets/{index.lazy-rfgjFZNH.js → index.lazy-DG_3_VdF.js} +1 -1
  23. package/out/assets/{index.lazy-zpQXhgmn.js → index.lazy-DR0rWEWZ.js} +1 -1
  24. package/out/assets/{index.lazy-hF807bh0.js → index.lazy-DSyTSCJD.js} +1 -1
  25. package/out/assets/{index.lazy-DB9Ht9LJ.js → index.lazy-DUhsuPLv.js} +1 -1
  26. package/out/assets/{index.lazy-BsciBHf_.js → index.lazy-DVnhWbzH.js} +1 -1
  27. package/out/assets/{index.lazy-CgKPe02l.js → index.lazy-DZpkg1DJ.js} +1 -1
  28. package/out/assets/useChannelMessages-DOaWHdAP.js +4 -0
  29. package/out/assets/{useGameRoom-CRJL0kcm.js → useGameRoom-hHkV65ii.js} +1 -1
  30. package/out/assets/{userProfile-DBkH4s29.js → userProfile-DwZip0Dt.js} +1 -1
  31. package/out/chat/index.html +0 -0
  32. package/out/chat/join/index.html +0 -0
  33. package/out/download/index.html +2 -2
  34. package/out/game/gandengyan/index.html +0 -0
  35. package/out/game/index.html +0 -0
  36. package/out/game/zhajinhua/index.html +0 -0
  37. package/out/index.html +2 -2
  38. package/out/note/index.html +0 -0
  39. package/out/ping/index.html +2 -2
  40. package/out/profile/index.html +0 -0
  41. package/out/web3/index.html +0 -0
  42. package/package.json +1 -1
  43. package/server/index.js +59 -2
  44. package/server/src/http/app.js +7 -1
  45. package/server/src/http/nodeStatus.js +6 -0
  46. package/server/src/http/routes/channelRoutes.js +12 -0
  47. package/server/src/index.js +510 -5
  48. package/out/assets/index-3OD3Chi9.css +0 -1
  49. package/out/assets/index-BSOvFG3o.css +0 -1
  50. package/out/assets/index-Cde4g_dk.css +0 -1
  51. package/out/assets/index.lazy-BxoGfWEW.js +0 -1
  52. package/out/assets/index.lazy-CKbrHko5.js +0 -1
  53. package/out/assets/index.lazy-Citucq1G.js +0 -1
  54. package/out/assets/useChannelMessages-B6RMaNDH.js +0 -3
@@ -1 +1 @@
1
- import{n as e,o as t,t as n}from"./jsx-runtime-Bt-cYkS5.js";import{C as r,D as i,T as a}from"./ui-BpDGD3IR.js";import{a as o}from"./i18n-NjvOSuV6.js";import{n as s,t as c}from"./smartphone-tRRFFO0a.js";import{t as l}from"./download-jEPn2njL.js";import{F as u}from"./index-BZ-f0CZd.js";import{t as d}from"./MarketingHeader-CrYsQsQ5.js";import{n as f}from"./format-CR8oUWq6.js";var p=r(`apple`,[[`path`,{d:`M12 6.528V3a1 1 0 0 1 1-1h0`,key:`11qiee`}],[`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`,key:`110c12`}]]),m=r(`code`,[[`path`,{d:`m16 18 6-6-6-6`,key:`eg8j8`}],[`path`,{d:`m8 6-6 6 6 6`,key:`ppft3o`}]]),h=r(`laptop`,[[`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`,key:`1pdavp`}],[`path`,{d:`M20.054 15.987H3.946`,key:`14rxg9`}]]),g=r(`monitor`,[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`,key:`1svkeh`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`,key:`vw1qmm`}]]),_=r(`tablet-smartphone`,[[`rect`,{width:`10`,height:`14`,x:`3`,y:`8`,rx:`2`,key:`1vrsiq`}],[`path`,{d:`M5 4a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v16a2 2 0 0 1-2 2h-2.4`,key:`1j4zmg`}],[`path`,{d:`M8 18h.01`,key:`lrp35t`}]]),v=t(e(),1),y=[`windows`,`macos`,`linux`],b=[`x64`,`arm64`],x=[`installer`];Object.freeze([{platform:`windows`,arch:`x64`},{platform:`windows`,arch:`arm64`},{platform:`macos`,arch:`x64`},{platform:`macos`,arch:`arm64`},{platform:`linux`,arch:`x64`},{platform:`linux`,arch:`arm64`}]);var S=new Set(y),C=new Set(b),w=new Set(x);function T(e){return typeof e==`object`&&!!e}function E(e){return typeof e==`string`&&e.trim().length>0}function D(e){return Number.isFinite(e)&&e>0}function O(e){return e===void 0||E(e)}function k(e){return T(e)?S.has(e.platform)&&C.has(e.arch)&&w.has(e.kind)&&E(e.filename)&&D(e.size)&&E(e.cid)&&E(e.githubUrl)&&O(e.r2Url):!1}function A(e){return!T(e)||!E(e.version)||!E(e.publishedAt)||!Array.isArray(e.assets)?!1:e.assets.every(k)}function j(e){return`${e.platform}:${e.arch}`}function M(e){return A(e)?e.assets.filter(e=>e.kind===`installer`):[]}function N(e){return Array.isArray(e)?e.some(e=>T(e)&&E(e.r2Url)):!1}function P(e,t=`r2`){return t===`r2`&&T(e)&&E(e.r2Url)?{source:`r2`,url:e.r2Url}:{source:`github`,url:T(e)&&E(e.githubUrl)?e.githubUrl:``}}var F=`https://github.com/most-people/most/releases/latest`,I=[{platform:`windows`,arch:`x64`,kind:`installer`,filename:`GitHub Releases`,githubUrl:F},{platform:`windows`,arch:`arm64`,kind:`installer`,filename:`GitHub Releases`,githubUrl:F},{platform:`macos`,arch:`x64`,kind:`installer`,filename:`GitHub Releases`,githubUrl:F},{platform:`macos`,arch:`arm64`,kind:`installer`,filename:`GitHub Releases`,githubUrl:F},{platform:`linux`,arch:`x64`,kind:`installer`,filename:`GitHub Releases`,githubUrl:F},{platform:`linux`,arch:`arm64`,kind:`installer`,filename:`GitHub Releases`,githubUrl:F}];function L(e){return e.VITE_RELEASE_MANIFEST_URL||`${(e.VITE_R2_PUBLIC_BASE_URL||`https://download.most.box`).replace(/\/+$/,``)}/releases/latest.json`}function R({manifest:e,currentKey:t,requestedSource:n}){let r=e?M(e):[],i=r.length?r:I,a=N(i),o=n===`r2`&&a?`r2`:`github`,s=i.find(e=>j(e)===t)||null;return{assets:i,currentAsset:s,otherAssets:s?i.filter(e=>j(e)!==t):i,hasR2Assets:a,activeSource:o,currentDownload:s?P(s,o):null}}function z(e,t){return P(e,t)}var B=n(),V=L({VITE_RELEASE_MANIFEST_URL:void 0,VITE_R2_PUBLIC_BASE_URL:void 0}),H={windows:{name:`Windows`,ext:`.exe`,descKey:`download.platform.windows.desc`,icon:g},macos:{name:`macOS`,ext:`.dmg`,descKey:`download.platform.macos.desc`,icon:p},linux:{name:`Linux`,ext:`.AppImage`,descKey:`download.platform.linux.desc`,icon:h}},U=[{key:`ios`,nameKey:`download.platform.ios.name`,descKey:`download.platform.ios.desc`,icon:c},{key:`android`,nameKey:`download.platform.android.name`,descKey:`download.platform.android.desc`,icon:_}];function W(){return[navigator.userAgentData?.platform,navigator.platform,navigator.userAgent].filter(Boolean).join(` `).toLowerCase()}function G(){if(typeof navigator>`u`)return`windows:x64`;let e=W(),t=/arm|aarch64/.test(e)?`arm64`:`x64`;return/mac|darwin/.test(e)?`macos:${t}`:/linux/.test(e)?`linux:${t}`:`windows:${t}`}function K(){let{t:e}=o(),[t,n]=(0,v.useState)(null),[r,i]=(0,v.useState)(V?`loading`:`fallback`),[a,c]=(0,v.useState)(`windows:x64`),[d,p]=(0,v.useState)(`r2`);(0,v.useEffect)(()=>{c(G())},[]),(0,v.useEffect)(()=>{if(!V)return;let e=new AbortController;return fetch(V,{cache:`no-store`,signal:e.signal}).then(e=>{if(!e.ok)throw Error(`Manifest request failed: ${e.status}`);return e.json()}).then(e=>{if(!A(e))throw Error(`Invalid download manifest`);n(e),i(`ready`)}).catch(e=>{e instanceof DOMException&&e.name===`AbortError`||(n(null),i(`fallback`))}),()=>e.abort()},[]),(0,v.useEffect)(()=>{r===`fallback`&&p(`github`)},[r]);let{currentAsset:h,otherAssets:g,hasR2Assets:_,activeSource:y}=R({manifest:t,currentKey:a,requestedSource:d}),b=t=>z(t,y).source===`r2`?e(`download.source.r2Mirror`):`GitHub Releases`,x=e=>z(e,y).url,S=t=>{let n=H[t.platform],r=n.icon;return(0,B.jsxs)(`article`,{className:`download-current-card`,children:[(0,B.jsxs)(`div`,{className:`download-current-main`,children:[(0,B.jsx)(`div`,{className:`download-current-icon`,children:(0,B.jsx)(r,{size:34})}),(0,B.jsxs)(`div`,{className:`download-current-copy`,children:[(0,B.jsxs)(`div`,{className:`download-current-labels`,children:[(0,B.jsxs)(`span`,{className:`download-current-kicker`,children:[(0,B.jsx)(u,{size:14}),e(`download.platform.currentSystem`)]}),(0,B.jsx)(`span`,{className:`download-current-recommended`,children:e(`download.platform.recommended`)})]}),(0,B.jsxs)(`div`,{className:`download-current-heading`,children:[(0,B.jsx)(`h3`,{children:n.name}),(0,B.jsx)(`span`,{children:t.arch})]}),(0,B.jsx)(`p`,{children:e(n.descKey)}),(0,B.jsxs)(`dl`,{className:`download-current-meta`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:e(`download.platform.source`)}),(0,B.jsx)(`dd`,{children:b(t)})]}),t.size?(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:e(`download.platform.size`)}),(0,B.jsx)(`dd`,{children:f(t.size)})]}):null,t.cid?(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`CID`}),(0,B.jsx)(`dd`,{children:t.cid.slice(0,12)})]}):null]})]})]}),(0,B.jsxs)(`div`,{className:`download-current-actions`,children:[(0,B.jsx)(`span`,{children:e(`download.platform.matchedSystem`)}),(0,B.jsxs)(`a`,{href:x(t),className:`btn btn-primary`,children:[(0,B.jsx)(l,{size:17}),e(`download.platform.action`,{ext:n.ext})]}),(0,B.jsx)(`p`,{children:b(t)})]})]})},C=t=>{let n=H[t.platform],r=n.icon,i=j(t),o=i===a;return(0,B.jsxs)(`article`,{className:[`download-platform-card`,o?`is-recommended`:``].filter(Boolean).join(` `),children:[(0,B.jsx)(`div`,{className:`download-platform-icon`,children:(0,B.jsx)(r,{size:32})}),(0,B.jsxs)(`div`,{className:`download-platform-content`,children:[(0,B.jsxs)(`div`,{className:`download-platform-heading`,children:[(0,B.jsx)(`h3`,{children:n.name}),(0,B.jsx)(`span`,{children:t.arch})]}),(0,B.jsx)(`p`,{children:e(n.descKey)}),(0,B.jsxs)(`dl`,{className:`download-platform-meta`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:e(`download.platform.source`)}),(0,B.jsx)(`dd`,{children:b(t)})]}),t.size?(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:e(`download.platform.size`)}),(0,B.jsx)(`dd`,{children:f(t.size)})]}):null,t.cid?(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`CID`}),(0,B.jsx)(`dd`,{children:t.cid.slice(0,12)})]}):null]}),(0,B.jsx)(`div`,{className:`download-platform-actions`,children:(0,B.jsxs)(`a`,{href:x(t),className:`btn btn-primary`,children:[(0,B.jsx)(l,{size:16}),e(`download.platform.action`,{ext:n.ext})]})})]}),o?(0,B.jsx)(`span`,{className:`download-recommended-badge`,children:e(`download.platform.current`)}):null]},i)},w=t=>{let n=t.icon;return(0,B.jsxs)(`article`,{className:`download-coming-soon-card`,children:[(0,B.jsx)(`div`,{className:`download-platform-icon download-coming-soon-icon`,children:(0,B.jsx)(n,{size:32})}),(0,B.jsxs)(`div`,{className:`download-platform-content`,children:[(0,B.jsxs)(`div`,{className:`download-platform-heading`,children:[(0,B.jsx)(`h3`,{children:e(t.nameKey)}),(0,B.jsx)(`span`,{children:e(`download.platform.comingSoon`)})]}),(0,B.jsx)(`p`,{children:e(t.descKey)})]})]},t.key)};return(0,B.jsxs)(`div`,{className:`download-options`,children:[(0,B.jsxs)(`div`,{className:`ui-segmented-control download-source-tabs`,role:`tablist`,"aria-label":e(`download.source.label`),children:[(0,B.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":y===`r2`,disabled:!_,className:y===`r2`?`ui-segmented-option download-source-tab is-active`:`ui-segmented-option download-source-tab`,onClick:()=>p(`r2`),children:[(0,B.jsx)(s,{size:15}),`Cloudflare R2`]}),(0,B.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":y===`github`,className:y===`github`?`ui-segmented-option download-source-tab is-active`:`ui-segmented-option download-source-tab`,onClick:()=>p(`github`),children:[(0,B.jsx)(m,{size:15}),`GitHub Releases`]})]}),(0,B.jsx)(`p`,{className:`download-source-note`,children:r===`loading`?e(`download.source.loading`):r===`ready`&&t?e(`download.source.ready`,{version:t.version}):e(`download.source.fallback`)}),h?(0,B.jsx)(`div`,{className:`download-current-platform`,"aria-label":e(`download.platform.currentSystem`),children:S(h)}):null,g.length?(0,B.jsxs)(`div`,{className:`download-other-platforms`,children:[(0,B.jsx)(`p`,{className:`download-other-platforms-title`,children:e(`download.platform.otherPlatforms`)}),(0,B.jsx)(`div`,{className:`download-platform-grid`,children:g.map(e=>C(e))}),(0,B.jsxs)(`div`,{className:`download-coming-soon`,children:[(0,B.jsx)(`p`,{className:`download-coming-soon-title`,children:e(`download.platform.mobilePlatforms`)}),(0,B.jsx)(`div`,{className:`download-coming-soon-grid`,children:U.map(e=>w(e))})]})]}):null]})}var q=[{featureKey:`download.comparison.node`,webKey:`download.comparison.webConnectsNode`,desktopKey:`download.comparison.desktopBuiltinNode`},{featureKey:`download.comparison.fileSharing`,webKey:`download.comparison.webDependsNode`,desktopKey:`download.comparison.desktopFull`},{featureKey:`download.comparison.verification`,webKey:`download.comparison.webDependsNode`,desktopKey:`download.comparison.desktopFull`},{featureKey:`download.comparison.seeding`,webKey:`download.comparison.webDependsNode`,desktopKey:`download.comparison.desktopDefaultOn`},{featureKey:`download.comparison.largeFiles`,webKey:`download.comparison.webDependsNode`,desktopKey:`download.comparison.desktop10gb`}];function J(){let{t:e}=o();return(0,v.useEffect)(()=>{document.title=e(`download.meta.title`)},[e]),(0,B.jsxs)(`div`,{className:`download-page`,children:[(0,B.jsx)(d,{}),(0,B.jsx)(`section`,{className:`download-hero`,children:(0,B.jsxs)(`div`,{className:`mkt-container`,children:[(0,B.jsx)(`div`,{className:`download-hero-icon`,children:(0,B.jsx)(l,{size:40})}),(0,B.jsx)(`h1`,{className:`download-hero-title`,children:e(`download.hero.title`)}),(0,B.jsx)(`p`,{className:`download-hero-desc`,children:e(`download.hero.desc`)})]})}),(0,B.jsx)(`section`,{className:`download-platforms`,children:(0,B.jsxs)(`div`,{className:`mkt-container`,children:[(0,B.jsx)(`h2`,{className:`download-section-title`,children:e(`download.platforms.title`)}),(0,B.jsx)(K,{})]})}),(0,B.jsx)(`section`,{className:`download-comparison`,children:(0,B.jsxs)(`div`,{className:`mkt-container`,children:[(0,B.jsx)(`h2`,{className:`download-section-title`,children:e(`download.comparison.title`)}),(0,B.jsx)(`div`,{className:`download-table-wrap`,children:(0,B.jsxs)(`table`,{className:`download-table`,children:[(0,B.jsx)(`thead`,{children:(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(`th`,{children:e(`download.comparison.feature`)}),(0,B.jsx)(`th`,{children:e(`download.comparison.web`)}),(0,B.jsx)(`th`,{children:e(`download.comparison.desktop`)})]})}),(0,B.jsx)(`tbody`,{children:q.map(t=>(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(`td`,{children:e(t.featureKey)}),(0,B.jsx)(`td`,{className:`col-web`,children:e(t.webKey)}),(0,B.jsx)(`td`,{className:`col-desktop`,children:e(t.desktopKey)})]},t.featureKey))})]})})]})}),(0,B.jsx)(`section`,{className:`download-cta`,children:(0,B.jsx)(`div`,{className:`mkt-container`,children:(0,B.jsx)(`p`,{className:`download-hero-desc`,children:e(`download.npmNote`)})})}),(0,B.jsx)(`section`,{className:`download-cta`,children:(0,B.jsx)(`div`,{className:`mkt-container`,children:(0,B.jsx)(i,{to:`/`,className:`btn btn-primary`,children:e(`common.backHome`)})})}),(0,B.jsx)(`footer`,{className:`mkt-footer`,children:(0,B.jsx)(`div`,{className:`mkt-container`,children:(0,B.jsx)(`div`,{className:`mkt-footer-inner`,children:(0,B.jsx)(`p`,{className:`mkt-footer-copy`,children:`MostBox`})})})})]})}var Y=a(`/download/`)({component:J});export{Y as Route};
1
+ import{n as e,o as t,t as n}from"./jsx-runtime-Bt-cYkS5.js";import{C as r,D as i,T as a}from"./ui-BpDGD3IR.js";import{a as o}from"./i18n-NjvOSuV6.js";import{n as s,t as c}from"./smartphone-tRRFFO0a.js";import{t as l}from"./download-jEPn2njL.js";import{F as u}from"./index-C-_ZwxuN.js";import{t as d}from"./MarketingHeader-B45AaM29.js";import{n as f}from"./format-CR8oUWq6.js";var p=r(`apple`,[[`path`,{d:`M12 6.528V3a1 1 0 0 1 1-1h0`,key:`11qiee`}],[`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`,key:`110c12`}]]),m=r(`code`,[[`path`,{d:`m16 18 6-6-6-6`,key:`eg8j8`}],[`path`,{d:`m8 6-6 6 6 6`,key:`ppft3o`}]]),h=r(`laptop`,[[`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`,key:`1pdavp`}],[`path`,{d:`M20.054 15.987H3.946`,key:`14rxg9`}]]),g=r(`monitor`,[[`rect`,{width:`20`,height:`14`,x:`2`,y:`3`,rx:`2`,key:`48i651`}],[`line`,{x1:`8`,x2:`16`,y1:`21`,y2:`21`,key:`1svkeh`}],[`line`,{x1:`12`,x2:`12`,y1:`17`,y2:`21`,key:`vw1qmm`}]]),_=r(`tablet-smartphone`,[[`rect`,{width:`10`,height:`14`,x:`3`,y:`8`,rx:`2`,key:`1vrsiq`}],[`path`,{d:`M5 4a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v16a2 2 0 0 1-2 2h-2.4`,key:`1j4zmg`}],[`path`,{d:`M8 18h.01`,key:`lrp35t`}]]),v=t(e(),1),y=[`windows`,`macos`,`linux`],b=[`x64`,`arm64`],x=[`installer`];Object.freeze([{platform:`windows`,arch:`x64`},{platform:`windows`,arch:`arm64`},{platform:`macos`,arch:`x64`},{platform:`macos`,arch:`arm64`},{platform:`linux`,arch:`x64`},{platform:`linux`,arch:`arm64`}]);var S=new Set(y),C=new Set(b),w=new Set(x);function T(e){return typeof e==`object`&&!!e}function E(e){return typeof e==`string`&&e.trim().length>0}function D(e){return Number.isFinite(e)&&e>0}function O(e){return e===void 0||E(e)}function k(e){return T(e)?S.has(e.platform)&&C.has(e.arch)&&w.has(e.kind)&&E(e.filename)&&D(e.size)&&E(e.cid)&&E(e.githubUrl)&&O(e.r2Url):!1}function A(e){return!T(e)||!E(e.version)||!E(e.publishedAt)||!Array.isArray(e.assets)?!1:e.assets.every(k)}function j(e){return`${e.platform}:${e.arch}`}function M(e){return A(e)?e.assets.filter(e=>e.kind===`installer`):[]}function N(e){return Array.isArray(e)?e.some(e=>T(e)&&E(e.r2Url)):!1}function P(e,t=`r2`){return t===`r2`&&T(e)&&E(e.r2Url)?{source:`r2`,url:e.r2Url}:{source:`github`,url:T(e)&&E(e.githubUrl)?e.githubUrl:``}}var F=`https://github.com/most-people/most/releases/latest`,I=[{platform:`windows`,arch:`x64`,kind:`installer`,filename:`GitHub Releases`,githubUrl:F},{platform:`windows`,arch:`arm64`,kind:`installer`,filename:`GitHub Releases`,githubUrl:F},{platform:`macos`,arch:`x64`,kind:`installer`,filename:`GitHub Releases`,githubUrl:F},{platform:`macos`,arch:`arm64`,kind:`installer`,filename:`GitHub Releases`,githubUrl:F},{platform:`linux`,arch:`x64`,kind:`installer`,filename:`GitHub Releases`,githubUrl:F},{platform:`linux`,arch:`arm64`,kind:`installer`,filename:`GitHub Releases`,githubUrl:F}];function L(e){return e.VITE_RELEASE_MANIFEST_URL||`${(e.VITE_R2_PUBLIC_BASE_URL||`https://download.most.box`).replace(/\/+$/,``)}/releases/latest.json`}function R({manifest:e,currentKey:t,requestedSource:n}){let r=e?M(e):[],i=r.length?r:I,a=N(i),o=n===`r2`&&a?`r2`:`github`,s=i.find(e=>j(e)===t)||null;return{assets:i,currentAsset:s,otherAssets:s?i.filter(e=>j(e)!==t):i,hasR2Assets:a,activeSource:o,currentDownload:s?P(s,o):null}}function z(e,t){return P(e,t)}var B=n(),V=L({VITE_RELEASE_MANIFEST_URL:void 0,VITE_R2_PUBLIC_BASE_URL:void 0}),H={windows:{name:`Windows`,ext:`.exe`,descKey:`download.platform.windows.desc`,icon:g},macos:{name:`macOS`,ext:`.dmg`,descKey:`download.platform.macos.desc`,icon:p},linux:{name:`Linux`,ext:`.AppImage`,descKey:`download.platform.linux.desc`,icon:h}},U=[{key:`ios`,nameKey:`download.platform.ios.name`,descKey:`download.platform.ios.desc`,icon:c},{key:`android`,nameKey:`download.platform.android.name`,descKey:`download.platform.android.desc`,icon:_}];function W(){return[navigator.userAgentData?.platform,navigator.platform,navigator.userAgent].filter(Boolean).join(` `).toLowerCase()}function G(){if(typeof navigator>`u`)return`windows:x64`;let e=W(),t=/arm|aarch64/.test(e)?`arm64`:`x64`;return/mac|darwin/.test(e)?`macos:${t}`:/linux/.test(e)?`linux:${t}`:`windows:${t}`}function K(){let{t:e}=o(),[t,n]=(0,v.useState)(null),[r,i]=(0,v.useState)(V?`loading`:`fallback`),[a,c]=(0,v.useState)(`windows:x64`),[d,p]=(0,v.useState)(`r2`);(0,v.useEffect)(()=>{c(G())},[]),(0,v.useEffect)(()=>{if(!V)return;let e=new AbortController;return fetch(V,{cache:`no-store`,signal:e.signal}).then(e=>{if(!e.ok)throw Error(`Manifest request failed: ${e.status}`);return e.json()}).then(e=>{if(!A(e))throw Error(`Invalid download manifest`);n(e),i(`ready`)}).catch(e=>{e instanceof DOMException&&e.name===`AbortError`||(n(null),i(`fallback`))}),()=>e.abort()},[]),(0,v.useEffect)(()=>{r===`fallback`&&p(`github`)},[r]);let{currentAsset:h,otherAssets:g,hasR2Assets:_,activeSource:y}=R({manifest:t,currentKey:a,requestedSource:d}),b=t=>z(t,y).source===`r2`?e(`download.source.r2Mirror`):`GitHub Releases`,x=e=>z(e,y).url,S=t=>{let n=H[t.platform],r=n.icon;return(0,B.jsxs)(`article`,{className:`download-current-card`,children:[(0,B.jsxs)(`div`,{className:`download-current-main`,children:[(0,B.jsx)(`div`,{className:`download-current-icon`,children:(0,B.jsx)(r,{size:34})}),(0,B.jsxs)(`div`,{className:`download-current-copy`,children:[(0,B.jsxs)(`div`,{className:`download-current-labels`,children:[(0,B.jsxs)(`span`,{className:`download-current-kicker`,children:[(0,B.jsx)(u,{size:14}),e(`download.platform.currentSystem`)]}),(0,B.jsx)(`span`,{className:`download-current-recommended`,children:e(`download.platform.recommended`)})]}),(0,B.jsxs)(`div`,{className:`download-current-heading`,children:[(0,B.jsx)(`h3`,{children:n.name}),(0,B.jsx)(`span`,{children:t.arch})]}),(0,B.jsx)(`p`,{children:e(n.descKey)}),(0,B.jsxs)(`dl`,{className:`download-current-meta`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:e(`download.platform.source`)}),(0,B.jsx)(`dd`,{children:b(t)})]}),t.size?(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:e(`download.platform.size`)}),(0,B.jsx)(`dd`,{children:f(t.size)})]}):null,t.cid?(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`CID`}),(0,B.jsx)(`dd`,{children:t.cid.slice(0,12)})]}):null]})]})]}),(0,B.jsxs)(`div`,{className:`download-current-actions`,children:[(0,B.jsx)(`span`,{children:e(`download.platform.matchedSystem`)}),(0,B.jsxs)(`a`,{href:x(t),className:`btn btn-primary`,children:[(0,B.jsx)(l,{size:17}),e(`download.platform.action`,{ext:n.ext})]}),(0,B.jsx)(`p`,{children:b(t)})]})]})},C=t=>{let n=H[t.platform],r=n.icon,i=j(t),o=i===a;return(0,B.jsxs)(`article`,{className:[`download-platform-card`,o?`is-recommended`:``].filter(Boolean).join(` `),children:[(0,B.jsx)(`div`,{className:`download-platform-icon`,children:(0,B.jsx)(r,{size:32})}),(0,B.jsxs)(`div`,{className:`download-platform-content`,children:[(0,B.jsxs)(`div`,{className:`download-platform-heading`,children:[(0,B.jsx)(`h3`,{children:n.name}),(0,B.jsx)(`span`,{children:t.arch})]}),(0,B.jsx)(`p`,{children:e(n.descKey)}),(0,B.jsxs)(`dl`,{className:`download-platform-meta`,children:[(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:e(`download.platform.source`)}),(0,B.jsx)(`dd`,{children:b(t)})]}),t.size?(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:e(`download.platform.size`)}),(0,B.jsx)(`dd`,{children:f(t.size)})]}):null,t.cid?(0,B.jsxs)(`div`,{children:[(0,B.jsx)(`dt`,{children:`CID`}),(0,B.jsx)(`dd`,{children:t.cid.slice(0,12)})]}):null]}),(0,B.jsx)(`div`,{className:`download-platform-actions`,children:(0,B.jsxs)(`a`,{href:x(t),className:`btn btn-primary`,children:[(0,B.jsx)(l,{size:16}),e(`download.platform.action`,{ext:n.ext})]})})]}),o?(0,B.jsx)(`span`,{className:`download-recommended-badge`,children:e(`download.platform.current`)}):null]},i)},w=t=>{let n=t.icon;return(0,B.jsxs)(`article`,{className:`download-coming-soon-card`,children:[(0,B.jsx)(`div`,{className:`download-platform-icon download-coming-soon-icon`,children:(0,B.jsx)(n,{size:32})}),(0,B.jsxs)(`div`,{className:`download-platform-content`,children:[(0,B.jsxs)(`div`,{className:`download-platform-heading`,children:[(0,B.jsx)(`h3`,{children:e(t.nameKey)}),(0,B.jsx)(`span`,{children:e(`download.platform.comingSoon`)})]}),(0,B.jsx)(`p`,{children:e(t.descKey)})]})]},t.key)};return(0,B.jsxs)(`div`,{className:`download-options`,children:[(0,B.jsxs)(`div`,{className:`ui-segmented-control download-source-tabs`,role:`tablist`,"aria-label":e(`download.source.label`),children:[(0,B.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":y===`r2`,disabled:!_,className:y===`r2`?`ui-segmented-option download-source-tab is-active`:`ui-segmented-option download-source-tab`,onClick:()=>p(`r2`),children:[(0,B.jsx)(s,{size:15}),`Cloudflare R2`]}),(0,B.jsxs)(`button`,{type:`button`,role:`tab`,"aria-selected":y===`github`,className:y===`github`?`ui-segmented-option download-source-tab is-active`:`ui-segmented-option download-source-tab`,onClick:()=>p(`github`),children:[(0,B.jsx)(m,{size:15}),`GitHub Releases`]})]}),(0,B.jsx)(`p`,{className:`download-source-note`,children:r===`loading`?e(`download.source.loading`):r===`ready`&&t?e(`download.source.ready`,{version:t.version}):e(`download.source.fallback`)}),h?(0,B.jsx)(`div`,{className:`download-current-platform`,"aria-label":e(`download.platform.currentSystem`),children:S(h)}):null,g.length?(0,B.jsxs)(`div`,{className:`download-other-platforms`,children:[(0,B.jsx)(`p`,{className:`download-other-platforms-title`,children:e(`download.platform.otherPlatforms`)}),(0,B.jsx)(`div`,{className:`download-platform-grid`,children:g.map(e=>C(e))}),(0,B.jsxs)(`div`,{className:`download-coming-soon`,children:[(0,B.jsx)(`p`,{className:`download-coming-soon-title`,children:e(`download.platform.mobilePlatforms`)}),(0,B.jsx)(`div`,{className:`download-coming-soon-grid`,children:U.map(e=>w(e))})]})]}):null]})}var q=[{featureKey:`download.comparison.node`,webKey:`download.comparison.webConnectsNode`,desktopKey:`download.comparison.desktopBuiltinNode`},{featureKey:`download.comparison.fileSharing`,webKey:`download.comparison.webDependsNode`,desktopKey:`download.comparison.desktopFull`},{featureKey:`download.comparison.verification`,webKey:`download.comparison.webDependsNode`,desktopKey:`download.comparison.desktopFull`},{featureKey:`download.comparison.seeding`,webKey:`download.comparison.webDependsNode`,desktopKey:`download.comparison.desktopDefaultOn`},{featureKey:`download.comparison.largeFiles`,webKey:`download.comparison.webDependsNode`,desktopKey:`download.comparison.desktop10gb`}];function J(){let{t:e}=o();return(0,v.useEffect)(()=>{document.title=e(`download.meta.title`)},[e]),(0,B.jsxs)(`div`,{className:`download-page`,children:[(0,B.jsx)(d,{}),(0,B.jsx)(`section`,{className:`download-hero`,children:(0,B.jsxs)(`div`,{className:`mkt-container`,children:[(0,B.jsx)(`div`,{className:`download-hero-icon`,children:(0,B.jsx)(l,{size:40})}),(0,B.jsx)(`h1`,{className:`download-hero-title`,children:e(`download.hero.title`)}),(0,B.jsx)(`p`,{className:`download-hero-desc`,children:e(`download.hero.desc`)})]})}),(0,B.jsx)(`section`,{className:`download-platforms`,children:(0,B.jsxs)(`div`,{className:`mkt-container`,children:[(0,B.jsx)(`h2`,{className:`download-section-title`,children:e(`download.platforms.title`)}),(0,B.jsx)(K,{})]})}),(0,B.jsx)(`section`,{className:`download-comparison`,children:(0,B.jsxs)(`div`,{className:`mkt-container`,children:[(0,B.jsx)(`h2`,{className:`download-section-title`,children:e(`download.comparison.title`)}),(0,B.jsx)(`div`,{className:`download-table-wrap`,children:(0,B.jsxs)(`table`,{className:`download-table`,children:[(0,B.jsx)(`thead`,{children:(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(`th`,{children:e(`download.comparison.feature`)}),(0,B.jsx)(`th`,{children:e(`download.comparison.web`)}),(0,B.jsx)(`th`,{children:e(`download.comparison.desktop`)})]})}),(0,B.jsx)(`tbody`,{children:q.map(t=>(0,B.jsxs)(`tr`,{children:[(0,B.jsx)(`td`,{children:e(t.featureKey)}),(0,B.jsx)(`td`,{className:`col-web`,children:e(t.webKey)}),(0,B.jsx)(`td`,{className:`col-desktop`,children:e(t.desktopKey)})]},t.featureKey))})]})})]})}),(0,B.jsx)(`section`,{className:`download-cta`,children:(0,B.jsx)(`div`,{className:`mkt-container`,children:(0,B.jsx)(`p`,{className:`download-hero-desc`,children:e(`download.npmNote`)})})}),(0,B.jsx)(`section`,{className:`download-cta`,children:(0,B.jsx)(`div`,{className:`mkt-container`,children:(0,B.jsx)(i,{to:`/`,className:`btn btn-primary`,children:e(`common.backHome`)})})}),(0,B.jsx)(`footer`,{className:`mkt-footer`,children:(0,B.jsx)(`div`,{className:`mkt-container`,children:(0,B.jsx)(`div`,{className:`mkt-footer-inner`,children:(0,B.jsx)(`p`,{className:`mkt-footer-copy`,children:`MostBox`})})})})]})}var Y=a(`/download/`)({component:J});export{Y as Route};
@@ -1,2 +1,2 @@
1
- const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/MilkdownEditor-DrsyaR4h.js","assets/jsx-runtime-Bt-cYkS5.js","assets/index-BZ-f0CZd.js","assets/ui-BpDGD3IR.js","assets/useNavigate-DWlBD_-b.js","assets/i18n-NjvOSuV6.js","assets/index-Cde4g_dk.css","assets/dist-zyJb88Zz.js","assets/dist-CbTzBiwL.js"])))=>i.map(i=>d[i]);
2
- import{n as e,o as t,t as n}from"./jsx-runtime-Bt-cYkS5.js";import{C as r,S as i,T as a,a as o,f as s,n as c,p as l,r as u,s as d}from"./ui-BpDGD3IR.js";import{n as f}from"./useNavigate-DWlBD_-b.js";import{a as p}from"./i18n-NjvOSuV6.js";import{n as m,r as h}from"./LanguageToggle-CSQtRZ3A.js";import{n as g,t as _}from"./lock-CLIE8cct.js";import{n as v,t as y}from"./folder-Cfgc70_F.js";import{t as ee}from"./file-text-DPA1riJ_.js";import{n as b,t as x}from"./SidebarHomeLink-BdsUM4Kt.js";import{t as S}from"./notebook-pen-C8TlK5sB.js";import{t as te}from"./OpenSidebarButton-DnEgqP0S.js";import{t as ne}from"./plus-4hygj-1Z.js";import{t as C}from"./save-BjrbPwhJ.js";import{t as re}from"./search-DSkiWdvX.js";import{t as ie}from"./trash-2-V12tJ8lI.js";import{D as ae,L as oe,N as se,O as ce,c as w,k as T,t as le}from"./index-BZ-f0CZd.js";import{t as E}from"./SidebarAccount-B4OAl0as.js";var ue=r(`move`,[[`path`,{d:`M12 2v20`,key:`t6zp3m`}],[`path`,{d:`m15 19-3 3-3-3`,key:`11eu04`}],[`path`,{d:`m19 9 3 3-3 3`,key:`1mg7y2`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}],[`path`,{d:`m5 9-3 3 3 3`,key:`j64kie`}],[`path`,{d:`m9 5 3-3 3 3`,key:`l8vdw6`}]]),de=r(`pencil-ruler`,[[`path`,{d:`M13 7 8.7 2.7a2.41 2.41 0 0 0-3.4 0L2.7 5.3a2.41 2.41 0 0 0 0 3.4L7 13`,key:`orapub`}],[`path`,{d:`m8 6 2-2`,key:`115y1s`}],[`path`,{d:`m18 16 2-2`,key:`ee94s4`}],[`path`,{d:`m17 11 4.3 4.3c.94.94.94 2.46 0 3.4l-2.6 2.6c-.94.94-2.46.94-3.4 0L11 17`,key:`cfq27r`}],[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),D=t(e(),1),O=n();function fe(e){return e.type===`directory`?T(e.path?`${e.path}/${e.name}`:e.name):ce(e)}function pe({target:e,directories:t,onMove:n,onClose:r}){let{t:a}=p(),s=T(e.path||``),c=fe(e),l=t.filter(t=>e.type===`directory`?t.path!==c&&!t.path.startsWith(`${c}/`):!0),[u,d]=(0,D.useState)(s),[f,m]=(0,D.useState)(``),[h,_]=(0,D.useState)(new Set),ee=T(f),b=f.trim()?ee:u,x=T(b)===s,S=new Map;for(let e of l){let t=S.get(e.parentPath)||[];t.push(e),S.set(e.parentPath,t)}let te=l.filter(e=>{if(!e.parentPath)return!0;let t=e.parentPath.split(`/`).filter(Boolean);return t.every((e,n)=>h.has(t.slice(0,n+1).join(`/`)))}),ne=[{label:a(`note.root`),path:``},...u.split(`/`).filter(Boolean).map((e,t,n)=>({label:e,path:n.slice(0,t+1).join(`/`)}))];function C(e){d(T(e)),m(``)}function re(e){C(e),S.has(e)&&_(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}function ie(){x||n(b)}return(0,O.jsx)(o,{onClose:r,children:(0,O.jsxs)(`div`,{className:`note-move-modal`,onClick:e=>e.stopPropagation(),children:[(0,O.jsxs)(`div`,{className:`modal-header`,children:[(0,O.jsx)(`h3`,{children:a(`note.move.title`)}),(0,O.jsx)(`button`,{className:`btn btn-icon`,onClick:r,children:(0,O.jsx)(i,{size:18})})]}),(0,O.jsxs)(`div`,{className:`note-move-target`,children:[(0,O.jsx)(`span`,{children:a(`note.move.moving`)}),(0,O.jsx)(`strong`,{translate:`no`,children:e.name})]}),(0,O.jsx)(`div`,{className:`note-move-path`,children:ne.map((e,t)=>(0,O.jsxs)(D.Fragment,{children:[t>0&&(0,O.jsx)(`span`,{children:`/`}),(0,O.jsx)(`button`,{type:`button`,onClick:()=>C(e.path),children:(0,O.jsx)(`span`,{translate:e.path?`no`:`yes`,children:e.label})})]},e.path||`root`))}),(0,O.jsxs)(`div`,{className:`note-move-folder-list`,children:[(0,O.jsxs)(`button`,{type:`button`,className:`note-move-folder-item ${u===``?`selected`:``}`,onClick:()=>C(``),children:[(0,O.jsx)(`span`,{className:`note-move-folder-spacer`}),(0,O.jsx)(y,{className:`note-move-folder-icon`,size:16}),(0,O.jsx)(`span`,{children:a(`note.root`)})]}),l.length===0?(0,O.jsx)(`p`,{className:`note-move-empty`,children:a(`note.move.noFolders`)}):te.map(e=>{let t=S.has(e.path),n=h.has(e.path);return(0,O.jsxs)(`button`,{type:`button`,className:`note-move-folder-item note-move-depth-${Math.min(e.depth,4)} ${u===e.path?`selected`:``}`,onClick:()=>re(e.path),children:[t?n?(0,O.jsx)(g,{className:`note-move-expander`,size:14}):(0,O.jsx)(v,{className:`note-move-expander`,size:14}):(0,O.jsx)(`span`,{className:`note-move-folder-spacer`}),(0,O.jsx)(y,{className:`note-move-folder-icon`,size:16}),(0,O.jsx)(`span`,{translate:`no`,children:e.name}),e.parentPath&&(0,O.jsx)(`small`,{translate:`no`,children:e.parentPath})]},e.path)})]}),(0,O.jsx)(`input`,{className:`input input-compact`,value:f,onChange:e=>m(e.target.value),placeholder:a(`note.move.pathPlaceholder`),translate:`no`}),(0,O.jsxs)(`div`,{className:`note-move-destination`,children:[(0,O.jsx)(`span`,{children:a(`note.move.destinationLabel`)}),(0,O.jsx)(`span`,{translate:b?`no`:`yes`,children:b||a(`note.root`)})]}),(0,O.jsxs)(`div`,{className:`modal-actions`,children:[(0,O.jsx)(`button`,{className:`btn btn-secondary`,onClick:r,children:a(`common.cancel`)}),(0,O.jsx)(`button`,{className:`btn btn-primary`,onClick:ie,disabled:x,children:a(`note.action.move`)})]})]})})}function me({children:e}){return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(x,{}),e,(0,O.jsx)(E,{})]})}var he=(0,D.lazy)(async()=>({default:(await le(()=>import(`./MilkdownEditor-DrsyaR4h.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8]))).MilkdownEditor}));function ge(e){let t=new URLSearchParams(e),n=t.get(`mode`);return{cid:t.get(`cid`)||void 0,mode:n===`edit`?`edit`:void 0}}function _e(e={}){let t=new URLSearchParams;e.cid&&t.set(`cid`,e.cid),e.mode&&t.set(`mode`,e.mode);let n=t.toString();return n?`/note/?${n}`:`/note/`}function ve(e,t){return e.isSecret||e.content.startsWith(`mp://1`)?t(`note.preview.encrypted`):String(e.content||``).replace(/```[\s\S]*?```/g,` `).replace(/!\[[^\]]*]\([^)]*\)/g,` `).replace(/\[([^\]]+)]\([^)]*\)/g,`$1`).replace(/[#>*_`~|-]/g,` `).replace(/\s+/g,` `).trim()||t(`note.preview.empty`)}var k={"note.error.nameRequired":`note.error.nameRequired`,"note.error.nameNoSlash":`note.error.nameNoSlash`,"note.error.nameNoBackslash":`note.error.nameNoBackslash`,"note.error.nameInvalid":`note.error.nameInvalid`,"note.error.nameConflict":`note.error.nameConflict`,"note.error.moveIntoSelf":`note.error.moveIntoSelf`};function A(e,t,n){let r=e instanceof Error?e.message:``,i=k[r];return i?n(i):r||t}function ye(e){return e.type===`directory`?T(e.path?`${e.path}/${e.name}`:e.name):ce(e)}function be(e,t){let n=new Set;for(let t of e){let e=T(t.path).split(`/`).filter(Boolean);for(let t=0;t<e.length;t+=1)n.add(e.slice(0,t+1).join(`/`))}return Array.from(n).sort(t).map(e=>{let t=e.split(`/`);return{path:e,name:t[t.length-1]||e,parentPath:t.slice(0,-1).join(`/`),depth:Math.max(t.length-1,0)}})}function j(){let{t:e,formatDate:t,compareStrings:n}=p(),r=f(),a=oe({select:e=>e.searchStr}),o=(0,D.useMemo)(()=>ge(a),[a]),g=(0,D.useRef)(null),v=w(e=>e.addToast),x=w(e=>e.isDarkMode),le=w(e=>e.setIsDarkMode),E=d(e=>e.wallet),fe=d(e=>e.openLoginModal),k=w(e=>e.notes),j=w(e=>e.notesPath),M=w(e=>e.setNotesPath),N=w(e=>e.saveNote),xe=w(e=>e.deleteNote),Se=w(e=>e.renameNote),P=w(e=>e.localDataReady),F=o.cid||``,I=k.find(e=>e.cid===F),L=!!F,R=L&&o.mode===`edit`,[z,Ce]=(0,D.useState)(``),[B,V]=(0,D.useState)(null),[H,U]=(0,D.useState)(null),[W,G]=(0,D.useState)(null),[we,K]=(0,D.useState)(``),[Te,q]=(0,D.useState)(``),[Ee,J]=(0,D.useState)(``),[De,Oe]=(0,D.useState)(``),[ke,Ae]=(0,D.useState)(``),[je,Y]=(0,D.useState)(``),[X,Me]=(0,D.useState)(!1),[Ne,Z]=(0,D.useState)(``),[Pe,Fe]=(0,D.useState)(!1);(0,D.useEffect)(()=>{if(!F){K(``),q(``);return}if(!I){K(``),q(P?e(`note.error.notFound`):``);return}if(I.content.startsWith(`mp://1`)){if(!E){K(``),q(e(`note.error.loginToDecrypt`));return}let t=s(I.content,E.danger);if(!t){K(``),q(e(`note.error.decryptFailed`));return}K(t),q(``);return}K(I.content||``),q(``)},[F,P,I,e,E]),(0,D.useEffect)(()=>{if(!R){Fe(!1);return}if(!F||!I){Oe(``),Ae(``),Y(``),Me(!1),Z(P?e(`note.error.notFound`):``);return}if(Oe(I.name),Ae(I.path||``),Me(I.isSecret===!0||I.content.startsWith(`mp://1`)),I.content.startsWith(`mp://1`)){if(!E){Y(``),Z(e(`note.error.loginToDecrypt`));return}let t=s(I.content,E.danger);if(!t){Y(``),Z(e(`note.error.decryptFailed`));return}Y(t),Z(``);return}Y(I.content||``),Z(``)},[F,R,P,I,e,E]),(0,D.useEffect)(()=>{J(I?.name||``)},[I?.cid,I?.name]);let Ie=(0,D.useMemo)(()=>ae(k,j,z),[k,j,z]),Le=Ie.filter(e=>e.type===`file`).length,Re=I?.isSecret===!0||I?.content.startsWith(`mp://1`)===!0,ze=e(R?X?`note.privacy.secret`:`note.privacy.public`:Re?`note.privacy.secret`:`note.privacy.public`),Be=(0,D.useMemo)(()=>{let t=j.split(`/`).filter(Boolean);return[{label:e(`note.root`),path:``},...t.map((e,n)=>({label:e,path:t.slice(0,n+1).join(`/`)}))]},[j,e]),Ve=(0,D.useMemo)(()=>be(k,n),[n,k]);function Q(e={},t=!1){r({href:_e(e),replace:t})}function He(e){Q({cid:e.cid})}function Ue(e){Q({cid:e.cid,mode:`edit`})}function $(){return E?!0:(fe(),!1)}function We(){Q(I?{cid:I.cid}:{})}async function Ge(){if($()){if(!I){v(e(`note.toast.notFound`),`error`);return}if(!De.trim()){v(e(`note.toast.nameRequired`),`warning`);return}Fe(!0);try{let t=g.current?.getMarkdown()??je,n=X?l(t,E.danger):t,r=await N({cid:I.cid,name:De,path:ke,content:n,isSecret:X});Y(t),Q({cid:r},!0),v(e(`note.toast.saved`),`success`)}catch(t){v(A(t,e(`note.toast.saveFailed`),e),`error`)}finally{Fe(!1)}}}function Ke(){$()&&V({title:e(`note.create.title`),placeholder:e(`note.namePlaceholder`),confirmText:e(`note.create.action`),onConfirm:async t=>{if($())try{let n=await N({name:t,path:j,content:``,isSecret:!1});V(null),v(e(`note.toast.created`),`success`),Q({cid:n,mode:`edit`})}catch(t){v(A(t,e(`note.toast.createFailed`),e),`error`)}}})}async function qe(){if(!$()||!I)return;let t=Ee.trim();if(!t){J(I.name),v(e(`note.toast.nameRequired`),`warning`);return}if(t!==I.name)try{Se(ce(I),I.path,t),v(e(`note.toast.renamed`),`success`)}catch(t){J(I.name),v(A(t,e(`note.toast.renameFailed`),e),`error`)}}function Je(e){$()&&G(e)}async function Ye(t){if(W)try{Se(ye(W),t,W.name),G(null),v(e(`note.toast.moved`),`success`)}catch(t){v(A(t,e(`note.toast.moveFailed`),e),`error`)}}function Xe(t){if(!$())return;let n=t.type===`directory`;U({title:e(n?`note.delete.folderTitle`:`note.delete.noteTitle`),message:e(`note.delete.message`,{name:t.name}),confirmText:e(`note.action.delete`),onConfirm:async()=>{xe(n?void 0:t.cid,t.path,t.name),U(null),v(e(`note.toast.deleted`),`success`),t.type===`file`&&t.cid===F&&Q()}})}let Ze=(0,O.jsxs)(`div`,{className:`note-header-title`,children:[(0,O.jsx)(`h2`,{className:`header-title`,children:e(`note.title`)}),(0,O.jsx)(`span`,{children:e(`note.count`,{count:k.length})})]}),Qe=(0,O.jsx)(`div`,{className:`note-theme-wrap`,children:(0,O.jsx)(`button`,{className:`btn btn-icon`,onClick:()=>le(!x),title:e(`common.theme.toggle`),"aria-label":e(`common.theme.toggle`),children:x?(0,O.jsx)(m,{size:16}):(0,O.jsx)(h,{size:16})})}),$e=(0,O.jsxs)(`section`,{className:`note-list-panel note-sidebar-list`,"aria-label":e(`note.listLabel`),children:[(0,O.jsxs)(`div`,{className:`note-list-header`,children:[(0,O.jsx)(`div`,{className:`note-current-location`,children:(0,O.jsx)(`div`,{className:`note-breadcrumbs`,children:Be.map((e,t)=>(0,O.jsxs)(D.Fragment,{children:[t>0&&(0,O.jsx)(`span`,{children:`/`}),(0,O.jsx)(`button`,{onClick:()=>M(e.path),children:(0,O.jsx)(`span`,{translate:e.path?`no`:`yes`,children:e.label})})]},e.path||`root`))})}),(0,O.jsx)(`span`,{className:`note-count`,children:e(`note.count`,{count:Le})})]}),(0,O.jsxs)(`div`,{className:`note-search`,children:[(0,O.jsx)(re,{size:16}),(0,O.jsx)(`input`,{className:`input input-flex`,value:z,onChange:e=>Ce(e.target.value),placeholder:e(`note.search.placeholder`)})]}),Ie.length===0?(0,O.jsxs)(`div`,{className:`ui-empty-state note-empty-state`,children:[(0,O.jsx)(S,{size:32}),(0,O.jsx)(`p`,{children:e(z?`note.empty.noMatches`:`note.empty.noNotes`)})]}):(0,O.jsx)(`div`,{className:`note-list`,children:Ie.map(n=>(0,O.jsx)(`article`,{className:`ui-list-item note-list-item ${n.type===`file`&&n.cid===F?`active`:``}`,children:(0,O.jsxs)(`button`,{className:`ui-list-item-main note-list-item-main ${n.type===`directory`?`folder`:``}`,onClick:()=>{n.type===`directory`?M(T(n.path?`${n.path}/${n.name}`:n.name)):He(n)},children:[(0,O.jsx)(`span`,{className:`ui-list-icon note-list-icon ${n.type===`directory`?`warning`:``}`,children:n.type===`directory`?(0,O.jsx)(y,{size:18}):n.isSecret?(0,O.jsx)(_,{size:18}):(0,O.jsx)(ee,{size:18})}),(0,O.jsxs)(`span`,{className:`ui-list-copy note-list-copy`,children:[(0,O.jsx)(`span`,{className:`ui-list-title note-list-name`,translate:`no`,children:n.name}),n.type===`file`?(0,O.jsx)(`span`,{className:`ui-list-desc note-list-preview`,translate:`no`,children:ve(n,e)}):(0,O.jsx)(`span`,{className:`ui-list-desc note-list-preview`,children:e(`note.folder`)})]}),n.type===`file`&&(0,O.jsx)(`span`,{className:`ui-list-meta note-list-date`,children:t(n.updated_at)})]})},`${n.cid}:${n.path}:${n.name}`))}),(0,O.jsx)(`div`,{className:`note-create-btn`,children:(0,O.jsxs)(`button`,{className:`btn`,onClick:Ke,children:[(0,O.jsx)(ne,{size:16}),e(`note.newNote`)]})})]});return(0,O.jsxs)(b,{sidebar:()=>(0,O.jsx)(me,{children:$e}),headerTitle:Ze,headerRight:Qe,children:[(0,O.jsx)(`main`,{className:`note-page note-browser-page ${L?`has-editor`:``}`,children:(0,O.jsx)(`section`,{className:`note-workspace`,children:(0,O.jsx)(`section`,{className:`note-editor-panel`,"aria-label":e(R?`note.editorLabel.edit`:`note.editorLabel.read`),children:L?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(`div`,{className:`note-editor-panel-header`,children:[(0,O.jsxs)(`div`,{className:`note-editor-title-area`,children:[R?(0,O.jsx)(`input`,{className:`note-title-input`,value:De,onChange:e=>Oe(e.target.value),placeholder:e(`note.namePlaceholder`),translate:`no`,disabled:!I}):I?(0,O.jsx)(`input`,{className:`note-title-input`,value:Ee,onBlur:qe,onChange:e=>J(e.target.value),onKeyDown:e=>{e.key===`Enter`&&e.currentTarget.blur(),e.key===`Escape`&&(J(I.name),e.currentTarget.blur())},placeholder:e(`note.namePlaceholder`),title:e(`app.rename`),translate:`no`}):(0,O.jsx)(`h3`,{children:e(`note.untitled`)}),I&&(0,O.jsxs)(`div`,{className:`note-editor-info`,children:[(0,O.jsx)(`span`,{children:e(R?`note.mode.edit`:`note.mode.read`)}),(0,O.jsx)(`span`,{children:ze}),(0,O.jsx)(`span`,{children:t(I.updated_at)})]})]}),(0,O.jsxs)(`div`,{className:`note-editor-actions`,children:[(0,O.jsx)(`button`,{type:`button`,className:`btn btn-icon`,onClick:R?We:()=>Q(),title:e(R?`common.cancel`:`common.close`),"aria-label":e(R?`common.cancel`:`common.close`),children:(0,O.jsx)(i,{size:16})}),R?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(`button`,{className:`btn btn-sm ${X?`btn-warning`:`btn-secondary`}`,onClick:()=>Me(!X),disabled:!I,children:[X?(0,O.jsx)(_,{size:16}):(0,O.jsx)(se,{size:16}),e(X?`note.privacy.secret`:`note.privacy.public`)]}),(0,O.jsxs)(`button`,{className:`btn btn-sm btn-primary`,onClick:Ge,disabled:Pe||!!Ne||!I,children:[(0,O.jsx)(C,{size:16}),e(Pe?`note.action.saving`:`note.action.save`)]})]}):I&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`button`,{type:`button`,className:`btn btn-icon`,onClick:()=>Je(I),title:e(`note.action.move`),"aria-label":e(`note.action.move`),children:(0,O.jsx)(ue,{size:16})}),(0,O.jsx)(`button`,{type:`button`,className:`btn btn-icon note-editor-action-danger`,onClick:()=>Xe(I),title:e(`note.action.delete`),"aria-label":e(`note.action.delete`),children:(0,O.jsx)(ie,{size:16})}),(0,O.jsxs)(`button`,{type:`button`,className:`btn btn-sm btn-primary`,onClick:()=>Ue(I),disabled:!!Te,title:e(`note.action.edit`),"aria-label":e(`note.action.edit`),children:[(0,O.jsx)(de,{size:16}),e(`note.action.edit`)]})]})]})]}),R?Ne?(0,O.jsxs)(`div`,{className:`note-empty-state editor-error`,children:[(0,O.jsx)(_,{size:36}),(0,O.jsx)(`p`,{children:Ne})]}):I?(0,O.jsx)(`div`,{className:`note-editor-frame editing`,children:(0,O.jsx)(he,{ref:g,content:je,onChange:Y,className:`milkdown-editor`})}):(0,O.jsxs)(`div`,{className:`note-empty-state editor-error`,children:[(0,O.jsx)(S,{size:36}),(0,O.jsx)(`p`,{children:e(P?`note.error.notFound`:`note.loading`)})]}):Te?(0,O.jsxs)(`div`,{className:`ui-empty-state note-empty-state editor-error`,children:[(0,O.jsx)(_,{size:36}),(0,O.jsx)(`p`,{children:Te})]}):I?(0,O.jsx)(`div`,{className:`note-editor-frame reading`,children:(0,O.jsx)(he,{content:we,readOnly:!0,className:`milkdown-editor`})}):(0,O.jsxs)(`div`,{className:`ui-empty-state note-empty-state editor-error`,children:[(0,O.jsx)(S,{size:36}),(0,O.jsx)(`p`,{children:e(P?`note.error.notFound`:`note.loading`)})]})]}):(0,O.jsxs)(`div`,{className:`ui-empty-state note-editor-empty`,children:[(0,O.jsx)(`div`,{className:`ui-empty-icon note-editor-empty-icon`,children:(0,O.jsx)(S,{size:32})}),(0,O.jsx)(`h3`,{className:`ui-empty-title`,children:e(`note.noOpen.title`)}),(0,O.jsx)(`p`,{className:`ui-empty-desc`,children:k.length>0?e(`note.noOpen.select`):e(`note.noOpen.createFirst`)}),(0,O.jsx)(te,{label:e(`note.openList`),variant:`default`})]})})})}),B&&(0,O.jsx)(c,{title:B.title,placeholder:B.placeholder,defaultValue:B.defaultValue,confirmText:B.confirmText,onConfirm:B.onConfirm,onClose:()=>V(null)}),H&&(0,O.jsx)(u,{title:H.title,message:H.message,confirmText:H.confirmText,danger:!0,onConfirm:H.onConfirm,onClose:()=>U(null)}),W&&(0,O.jsx)(pe,{target:W,directories:Ve,onMove:Ye,onClose:()=>G(null)})]})}function M(){let{t:e}=p();return(0,O.jsx)(D.Suspense,{fallback:(0,O.jsx)(`div`,{className:`note-editor-loading`,children:e(`note.loading`)}),children:(0,O.jsx)(j,{})})}var N=a(`/note/`)({component:M});export{N as Route};
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/MilkdownEditor-BTq9bDAf.js","assets/jsx-runtime-Bt-cYkS5.js","assets/index-C-_ZwxuN.js","assets/ui-BpDGD3IR.js","assets/useNavigate-DWlBD_-b.js","assets/i18n-NjvOSuV6.js","assets/index-BHZhApbo.css","assets/dist-zyJb88Zz.js","assets/dist-CbTzBiwL.js"])))=>i.map(i=>d[i]);
2
+ import{n as e,o as t,t as n}from"./jsx-runtime-Bt-cYkS5.js";import{C as r,S as i,T as a,a as o,f as s,n as c,p as l,r as u,s as d}from"./ui-BpDGD3IR.js";import{n as f}from"./useNavigate-DWlBD_-b.js";import{a as p}from"./i18n-NjvOSuV6.js";import{n as m,r as h}from"./LanguageToggle-CSQtRZ3A.js";import{n as g,t as _}from"./lock-CLIE8cct.js";import{n as v,t as y}from"./folder-Cfgc70_F.js";import{t as ee}from"./file-text-DPA1riJ_.js";import{n as b,t as x}from"./SidebarHomeLink-qMFEGjZt.js";import{t as S}from"./notebook-pen-C8TlK5sB.js";import{t as te}from"./OpenSidebarButton-D8qfUGzU.js";import{t as ne}from"./plus-4hygj-1Z.js";import{t as C}from"./save-BjrbPwhJ.js";import{t as re}from"./search-DSkiWdvX.js";import{t as ie}from"./trash-2-V12tJ8lI.js";import{D as ae,L as oe,N as se,O as ce,c as w,k as T,t as le}from"./index-C-_ZwxuN.js";import{t as E}from"./SidebarAccount-_RBE5K_o.js";var ue=r(`move`,[[`path`,{d:`M12 2v20`,key:`t6zp3m`}],[`path`,{d:`m15 19-3 3-3-3`,key:`11eu04`}],[`path`,{d:`m19 9 3 3-3 3`,key:`1mg7y2`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}],[`path`,{d:`m5 9-3 3 3 3`,key:`j64kie`}],[`path`,{d:`m9 5 3-3 3 3`,key:`l8vdw6`}]]),de=r(`pencil-ruler`,[[`path`,{d:`M13 7 8.7 2.7a2.41 2.41 0 0 0-3.4 0L2.7 5.3a2.41 2.41 0 0 0 0 3.4L7 13`,key:`orapub`}],[`path`,{d:`m8 6 2-2`,key:`115y1s`}],[`path`,{d:`m18 16 2-2`,key:`ee94s4`}],[`path`,{d:`m17 11 4.3 4.3c.94.94.94 2.46 0 3.4l-2.6 2.6c-.94.94-2.46.94-3.4 0L11 17`,key:`cfq27r`}],[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]),D=t(e(),1),O=n();function fe(e){return e.type===`directory`?T(e.path?`${e.path}/${e.name}`:e.name):ce(e)}function pe({target:e,directories:t,onMove:n,onClose:r}){let{t:a}=p(),s=T(e.path||``),c=fe(e),l=t.filter(t=>e.type===`directory`?t.path!==c&&!t.path.startsWith(`${c}/`):!0),[u,d]=(0,D.useState)(s),[f,m]=(0,D.useState)(``),[h,_]=(0,D.useState)(new Set),ee=T(f),b=f.trim()?ee:u,x=T(b)===s,S=new Map;for(let e of l){let t=S.get(e.parentPath)||[];t.push(e),S.set(e.parentPath,t)}let te=l.filter(e=>{if(!e.parentPath)return!0;let t=e.parentPath.split(`/`).filter(Boolean);return t.every((e,n)=>h.has(t.slice(0,n+1).join(`/`)))}),ne=[{label:a(`note.root`),path:``},...u.split(`/`).filter(Boolean).map((e,t,n)=>({label:e,path:n.slice(0,t+1).join(`/`)}))];function C(e){d(T(e)),m(``)}function re(e){C(e),S.has(e)&&_(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}function ie(){x||n(b)}return(0,O.jsx)(o,{onClose:r,children:(0,O.jsxs)(`div`,{className:`note-move-modal`,onClick:e=>e.stopPropagation(),children:[(0,O.jsxs)(`div`,{className:`modal-header`,children:[(0,O.jsx)(`h3`,{children:a(`note.move.title`)}),(0,O.jsx)(`button`,{className:`btn btn-icon`,onClick:r,children:(0,O.jsx)(i,{size:18})})]}),(0,O.jsxs)(`div`,{className:`note-move-target`,children:[(0,O.jsx)(`span`,{children:a(`note.move.moving`)}),(0,O.jsx)(`strong`,{translate:`no`,children:e.name})]}),(0,O.jsx)(`div`,{className:`note-move-path`,children:ne.map((e,t)=>(0,O.jsxs)(D.Fragment,{children:[t>0&&(0,O.jsx)(`span`,{children:`/`}),(0,O.jsx)(`button`,{type:`button`,onClick:()=>C(e.path),children:(0,O.jsx)(`span`,{translate:e.path?`no`:`yes`,children:e.label})})]},e.path||`root`))}),(0,O.jsxs)(`div`,{className:`note-move-folder-list`,children:[(0,O.jsxs)(`button`,{type:`button`,className:`note-move-folder-item ${u===``?`selected`:``}`,onClick:()=>C(``),children:[(0,O.jsx)(`span`,{className:`note-move-folder-spacer`}),(0,O.jsx)(y,{className:`note-move-folder-icon`,size:16}),(0,O.jsx)(`span`,{children:a(`note.root`)})]}),l.length===0?(0,O.jsx)(`p`,{className:`note-move-empty`,children:a(`note.move.noFolders`)}):te.map(e=>{let t=S.has(e.path),n=h.has(e.path);return(0,O.jsxs)(`button`,{type:`button`,className:`note-move-folder-item note-move-depth-${Math.min(e.depth,4)} ${u===e.path?`selected`:``}`,onClick:()=>re(e.path),children:[t?n?(0,O.jsx)(g,{className:`note-move-expander`,size:14}):(0,O.jsx)(v,{className:`note-move-expander`,size:14}):(0,O.jsx)(`span`,{className:`note-move-folder-spacer`}),(0,O.jsx)(y,{className:`note-move-folder-icon`,size:16}),(0,O.jsx)(`span`,{translate:`no`,children:e.name}),e.parentPath&&(0,O.jsx)(`small`,{translate:`no`,children:e.parentPath})]},e.path)})]}),(0,O.jsx)(`input`,{className:`input input-compact`,value:f,onChange:e=>m(e.target.value),placeholder:a(`note.move.pathPlaceholder`),translate:`no`}),(0,O.jsxs)(`div`,{className:`note-move-destination`,children:[(0,O.jsx)(`span`,{children:a(`note.move.destinationLabel`)}),(0,O.jsx)(`span`,{translate:b?`no`:`yes`,children:b||a(`note.root`)})]}),(0,O.jsxs)(`div`,{className:`modal-actions`,children:[(0,O.jsx)(`button`,{className:`btn btn-secondary`,onClick:r,children:a(`common.cancel`)}),(0,O.jsx)(`button`,{className:`btn btn-primary`,onClick:ie,disabled:x,children:a(`note.action.move`)})]})]})})}function me({children:e}){return(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(x,{}),e,(0,O.jsx)(E,{})]})}var he=(0,D.lazy)(async()=>({default:(await le(()=>import(`./MilkdownEditor-BTq9bDAf.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8]))).MilkdownEditor}));function ge(e){let t=new URLSearchParams(e),n=t.get(`mode`);return{cid:t.get(`cid`)||void 0,mode:n===`edit`?`edit`:void 0}}function _e(e={}){let t=new URLSearchParams;e.cid&&t.set(`cid`,e.cid),e.mode&&t.set(`mode`,e.mode);let n=t.toString();return n?`/note/?${n}`:`/note/`}function ve(e,t){return e.isSecret||e.content.startsWith(`mp://1`)?t(`note.preview.encrypted`):String(e.content||``).replace(/```[\s\S]*?```/g,` `).replace(/!\[[^\]]*]\([^)]*\)/g,` `).replace(/\[([^\]]+)]\([^)]*\)/g,`$1`).replace(/[#>*_`~|-]/g,` `).replace(/\s+/g,` `).trim()||t(`note.preview.empty`)}var k={"note.error.nameRequired":`note.error.nameRequired`,"note.error.nameNoSlash":`note.error.nameNoSlash`,"note.error.nameNoBackslash":`note.error.nameNoBackslash`,"note.error.nameInvalid":`note.error.nameInvalid`,"note.error.nameConflict":`note.error.nameConflict`,"note.error.moveIntoSelf":`note.error.moveIntoSelf`};function A(e,t,n){let r=e instanceof Error?e.message:``,i=k[r];return i?n(i):r||t}function ye(e){return e.type===`directory`?T(e.path?`${e.path}/${e.name}`:e.name):ce(e)}function be(e,t){let n=new Set;for(let t of e){let e=T(t.path).split(`/`).filter(Boolean);for(let t=0;t<e.length;t+=1)n.add(e.slice(0,t+1).join(`/`))}return Array.from(n).sort(t).map(e=>{let t=e.split(`/`);return{path:e,name:t[t.length-1]||e,parentPath:t.slice(0,-1).join(`/`),depth:Math.max(t.length-1,0)}})}function j(){let{t:e,formatDate:t,compareStrings:n}=p(),r=f(),a=oe({select:e=>e.searchStr}),o=(0,D.useMemo)(()=>ge(a),[a]),g=(0,D.useRef)(null),v=w(e=>e.addToast),x=w(e=>e.isDarkMode),le=w(e=>e.setIsDarkMode),E=d(e=>e.wallet),fe=d(e=>e.openLoginModal),k=w(e=>e.notes),j=w(e=>e.notesPath),M=w(e=>e.setNotesPath),N=w(e=>e.saveNote),xe=w(e=>e.deleteNote),Se=w(e=>e.renameNote),P=w(e=>e.localDataReady),F=o.cid||``,I=k.find(e=>e.cid===F),L=!!F,R=L&&o.mode===`edit`,[z,Ce]=(0,D.useState)(``),[B,V]=(0,D.useState)(null),[H,U]=(0,D.useState)(null),[W,G]=(0,D.useState)(null),[we,K]=(0,D.useState)(``),[Te,q]=(0,D.useState)(``),[Ee,J]=(0,D.useState)(``),[De,Oe]=(0,D.useState)(``),[ke,Ae]=(0,D.useState)(``),[je,Y]=(0,D.useState)(``),[X,Me]=(0,D.useState)(!1),[Ne,Z]=(0,D.useState)(``),[Pe,Fe]=(0,D.useState)(!1);(0,D.useEffect)(()=>{if(!F){K(``),q(``);return}if(!I){K(``),q(P?e(`note.error.notFound`):``);return}if(I.content.startsWith(`mp://1`)){if(!E){K(``),q(e(`note.error.loginToDecrypt`));return}let t=s(I.content,E.danger);if(!t){K(``),q(e(`note.error.decryptFailed`));return}K(t),q(``);return}K(I.content||``),q(``)},[F,P,I,e,E]),(0,D.useEffect)(()=>{if(!R){Fe(!1);return}if(!F||!I){Oe(``),Ae(``),Y(``),Me(!1),Z(P?e(`note.error.notFound`):``);return}if(Oe(I.name),Ae(I.path||``),Me(I.isSecret===!0||I.content.startsWith(`mp://1`)),I.content.startsWith(`mp://1`)){if(!E){Y(``),Z(e(`note.error.loginToDecrypt`));return}let t=s(I.content,E.danger);if(!t){Y(``),Z(e(`note.error.decryptFailed`));return}Y(t),Z(``);return}Y(I.content||``),Z(``)},[F,R,P,I,e,E]),(0,D.useEffect)(()=>{J(I?.name||``)},[I?.cid,I?.name]);let Ie=(0,D.useMemo)(()=>ae(k,j,z),[k,j,z]),Le=Ie.filter(e=>e.type===`file`).length,Re=I?.isSecret===!0||I?.content.startsWith(`mp://1`)===!0,ze=e(R?X?`note.privacy.secret`:`note.privacy.public`:Re?`note.privacy.secret`:`note.privacy.public`),Be=(0,D.useMemo)(()=>{let t=j.split(`/`).filter(Boolean);return[{label:e(`note.root`),path:``},...t.map((e,n)=>({label:e,path:t.slice(0,n+1).join(`/`)}))]},[j,e]),Ve=(0,D.useMemo)(()=>be(k,n),[n,k]);function Q(e={},t=!1){r({href:_e(e),replace:t})}function He(e){Q({cid:e.cid})}function Ue(e){Q({cid:e.cid,mode:`edit`})}function $(){return E?!0:(fe(),!1)}function We(){Q(I?{cid:I.cid}:{})}async function Ge(){if($()){if(!I){v(e(`note.toast.notFound`),`error`);return}if(!De.trim()){v(e(`note.toast.nameRequired`),`warning`);return}Fe(!0);try{let t=g.current?.getMarkdown()??je,n=X?l(t,E.danger):t,r=await N({cid:I.cid,name:De,path:ke,content:n,isSecret:X});Y(t),Q({cid:r},!0),v(e(`note.toast.saved`),`success`)}catch(t){v(A(t,e(`note.toast.saveFailed`),e),`error`)}finally{Fe(!1)}}}function Ke(){$()&&V({title:e(`note.create.title`),placeholder:e(`note.namePlaceholder`),confirmText:e(`note.create.action`),onConfirm:async t=>{if($())try{let n=await N({name:t,path:j,content:``,isSecret:!1});V(null),v(e(`note.toast.created`),`success`),Q({cid:n,mode:`edit`})}catch(t){v(A(t,e(`note.toast.createFailed`),e),`error`)}}})}async function qe(){if(!$()||!I)return;let t=Ee.trim();if(!t){J(I.name),v(e(`note.toast.nameRequired`),`warning`);return}if(t!==I.name)try{Se(ce(I),I.path,t),v(e(`note.toast.renamed`),`success`)}catch(t){J(I.name),v(A(t,e(`note.toast.renameFailed`),e),`error`)}}function Je(e){$()&&G(e)}async function Ye(t){if(W)try{Se(ye(W),t,W.name),G(null),v(e(`note.toast.moved`),`success`)}catch(t){v(A(t,e(`note.toast.moveFailed`),e),`error`)}}function Xe(t){if(!$())return;let n=t.type===`directory`;U({title:e(n?`note.delete.folderTitle`:`note.delete.noteTitle`),message:e(`note.delete.message`,{name:t.name}),confirmText:e(`note.action.delete`),onConfirm:async()=>{xe(n?void 0:t.cid,t.path,t.name),U(null),v(e(`note.toast.deleted`),`success`),t.type===`file`&&t.cid===F&&Q()}})}let Ze=(0,O.jsxs)(`div`,{className:`note-header-title`,children:[(0,O.jsx)(`h2`,{className:`header-title`,children:e(`note.title`)}),(0,O.jsx)(`span`,{children:e(`note.count`,{count:k.length})})]}),Qe=(0,O.jsx)(`div`,{className:`note-theme-wrap`,children:(0,O.jsx)(`button`,{className:`btn btn-icon`,onClick:()=>le(!x),title:e(`common.theme.toggle`),"aria-label":e(`common.theme.toggle`),children:x?(0,O.jsx)(m,{size:16}):(0,O.jsx)(h,{size:16})})}),$e=(0,O.jsxs)(`section`,{className:`note-list-panel note-sidebar-list`,"aria-label":e(`note.listLabel`),children:[(0,O.jsxs)(`div`,{className:`note-list-header`,children:[(0,O.jsx)(`div`,{className:`note-current-location`,children:(0,O.jsx)(`div`,{className:`note-breadcrumbs`,children:Be.map((e,t)=>(0,O.jsxs)(D.Fragment,{children:[t>0&&(0,O.jsx)(`span`,{children:`/`}),(0,O.jsx)(`button`,{onClick:()=>M(e.path),children:(0,O.jsx)(`span`,{translate:e.path?`no`:`yes`,children:e.label})})]},e.path||`root`))})}),(0,O.jsx)(`span`,{className:`note-count`,children:e(`note.count`,{count:Le})})]}),(0,O.jsxs)(`div`,{className:`note-search`,children:[(0,O.jsx)(re,{size:16}),(0,O.jsx)(`input`,{className:`input input-flex`,value:z,onChange:e=>Ce(e.target.value),placeholder:e(`note.search.placeholder`)})]}),Ie.length===0?(0,O.jsxs)(`div`,{className:`ui-empty-state note-empty-state`,children:[(0,O.jsx)(S,{size:32}),(0,O.jsx)(`p`,{children:e(z?`note.empty.noMatches`:`note.empty.noNotes`)})]}):(0,O.jsx)(`div`,{className:`note-list`,children:Ie.map(n=>(0,O.jsx)(`article`,{className:`ui-list-item note-list-item ${n.type===`file`&&n.cid===F?`active`:``}`,children:(0,O.jsxs)(`button`,{className:`ui-list-item-main note-list-item-main ${n.type===`directory`?`folder`:``}`,onClick:()=>{n.type===`directory`?M(T(n.path?`${n.path}/${n.name}`:n.name)):He(n)},children:[(0,O.jsx)(`span`,{className:`ui-list-icon note-list-icon ${n.type===`directory`?`warning`:``}`,children:n.type===`directory`?(0,O.jsx)(y,{size:18}):n.isSecret?(0,O.jsx)(_,{size:18}):(0,O.jsx)(ee,{size:18})}),(0,O.jsxs)(`span`,{className:`ui-list-copy note-list-copy`,children:[(0,O.jsx)(`span`,{className:`ui-list-title note-list-name`,translate:`no`,children:n.name}),n.type===`file`?(0,O.jsx)(`span`,{className:`ui-list-desc note-list-preview`,translate:`no`,children:ve(n,e)}):(0,O.jsx)(`span`,{className:`ui-list-desc note-list-preview`,children:e(`note.folder`)})]}),n.type===`file`&&(0,O.jsx)(`span`,{className:`ui-list-meta note-list-date`,children:t(n.updated_at)})]})},`${n.cid}:${n.path}:${n.name}`))}),(0,O.jsx)(`div`,{className:`note-create-btn`,children:(0,O.jsxs)(`button`,{className:`btn`,onClick:Ke,children:[(0,O.jsx)(ne,{size:16}),e(`note.newNote`)]})})]});return(0,O.jsxs)(b,{sidebar:()=>(0,O.jsx)(me,{children:$e}),headerTitle:Ze,headerRight:Qe,children:[(0,O.jsx)(`main`,{className:`note-page note-browser-page ${L?`has-editor`:``}`,children:(0,O.jsx)(`section`,{className:`note-workspace`,children:(0,O.jsx)(`section`,{className:`note-editor-panel`,"aria-label":e(R?`note.editorLabel.edit`:`note.editorLabel.read`),children:L?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(`div`,{className:`note-editor-panel-header`,children:[(0,O.jsxs)(`div`,{className:`note-editor-title-area`,children:[R?(0,O.jsx)(`input`,{className:`note-title-input`,value:De,onChange:e=>Oe(e.target.value),placeholder:e(`note.namePlaceholder`),translate:`no`,disabled:!I}):I?(0,O.jsx)(`input`,{className:`note-title-input`,value:Ee,onBlur:qe,onChange:e=>J(e.target.value),onKeyDown:e=>{e.key===`Enter`&&e.currentTarget.blur(),e.key===`Escape`&&(J(I.name),e.currentTarget.blur())},placeholder:e(`note.namePlaceholder`),title:e(`app.rename`),translate:`no`}):(0,O.jsx)(`h3`,{children:e(`note.untitled`)}),I&&(0,O.jsxs)(`div`,{className:`note-editor-info`,children:[(0,O.jsx)(`span`,{children:e(R?`note.mode.edit`:`note.mode.read`)}),(0,O.jsx)(`span`,{children:ze}),(0,O.jsx)(`span`,{children:t(I.updated_at)})]})]}),(0,O.jsxs)(`div`,{className:`note-editor-actions`,children:[(0,O.jsx)(`button`,{type:`button`,className:`btn btn-icon`,onClick:R?We:()=>Q(),title:e(R?`common.cancel`:`common.close`),"aria-label":e(R?`common.cancel`:`common.close`),children:(0,O.jsx)(i,{size:16})}),R?(0,O.jsxs)(O.Fragment,{children:[(0,O.jsxs)(`button`,{className:`btn btn-sm ${X?`btn-warning`:`btn-secondary`}`,onClick:()=>Me(!X),disabled:!I,children:[X?(0,O.jsx)(_,{size:16}):(0,O.jsx)(se,{size:16}),e(X?`note.privacy.secret`:`note.privacy.public`)]}),(0,O.jsxs)(`button`,{className:`btn btn-sm btn-primary`,onClick:Ge,disabled:Pe||!!Ne||!I,children:[(0,O.jsx)(C,{size:16}),e(Pe?`note.action.saving`:`note.action.save`)]})]}):I&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(`button`,{type:`button`,className:`btn btn-icon`,onClick:()=>Je(I),title:e(`note.action.move`),"aria-label":e(`note.action.move`),children:(0,O.jsx)(ue,{size:16})}),(0,O.jsx)(`button`,{type:`button`,className:`btn btn-icon note-editor-action-danger`,onClick:()=>Xe(I),title:e(`note.action.delete`),"aria-label":e(`note.action.delete`),children:(0,O.jsx)(ie,{size:16})}),(0,O.jsxs)(`button`,{type:`button`,className:`btn btn-sm btn-primary`,onClick:()=>Ue(I),disabled:!!Te,title:e(`note.action.edit`),"aria-label":e(`note.action.edit`),children:[(0,O.jsx)(de,{size:16}),e(`note.action.edit`)]})]})]})]}),R?Ne?(0,O.jsxs)(`div`,{className:`note-empty-state editor-error`,children:[(0,O.jsx)(_,{size:36}),(0,O.jsx)(`p`,{children:Ne})]}):I?(0,O.jsx)(`div`,{className:`note-editor-frame editing`,children:(0,O.jsx)(he,{ref:g,content:je,onChange:Y,className:`milkdown-editor`})}):(0,O.jsxs)(`div`,{className:`note-empty-state editor-error`,children:[(0,O.jsx)(S,{size:36}),(0,O.jsx)(`p`,{children:e(P?`note.error.notFound`:`note.loading`)})]}):Te?(0,O.jsxs)(`div`,{className:`ui-empty-state note-empty-state editor-error`,children:[(0,O.jsx)(_,{size:36}),(0,O.jsx)(`p`,{children:Te})]}):I?(0,O.jsx)(`div`,{className:`note-editor-frame reading`,children:(0,O.jsx)(he,{content:we,readOnly:!0,className:`milkdown-editor`})}):(0,O.jsxs)(`div`,{className:`ui-empty-state note-empty-state editor-error`,children:[(0,O.jsx)(S,{size:36}),(0,O.jsx)(`p`,{children:e(P?`note.error.notFound`:`note.loading`)})]})]}):(0,O.jsxs)(`div`,{className:`ui-empty-state note-editor-empty`,children:[(0,O.jsx)(`div`,{className:`ui-empty-icon note-editor-empty-icon`,children:(0,O.jsx)(S,{size:32})}),(0,O.jsx)(`h3`,{className:`ui-empty-title`,children:e(`note.noOpen.title`)}),(0,O.jsx)(`p`,{className:`ui-empty-desc`,children:k.length>0?e(`note.noOpen.select`):e(`note.noOpen.createFirst`)}),(0,O.jsx)(te,{label:e(`note.openList`),variant:`default`})]})})})}),B&&(0,O.jsx)(c,{title:B.title,placeholder:B.placeholder,defaultValue:B.defaultValue,confirmText:B.confirmText,onConfirm:B.onConfirm,onClose:()=>V(null)}),H&&(0,O.jsx)(u,{title:H.title,message:H.message,confirmText:H.confirmText,danger:!0,onConfirm:H.onConfirm,onClose:()=>U(null)}),W&&(0,O.jsx)(pe,{target:W,directories:Ve,onMove:Ye,onClose:()=>G(null)})]})}function M(){let{t:e}=p();return(0,O.jsx)(D.Suspense,{fallback:(0,O.jsx)(`div`,{className:`note-editor-loading`,children:e(`note.loading`)}),children:(0,O.jsx)(j,{})})}var N=a(`/note/`)({component:M});export{N as Route};
@@ -0,0 +1 @@
1
+ import{n as e,o as t,t as n}from"./jsx-runtime-Bt-cYkS5.js";import{C as r,T as i,s as a}from"./ui-BpDGD3IR.js";import{a as o}from"./i18n-NjvOSuV6.js";import{n as s,r as c}from"./LanguageToggle-CSQtRZ3A.js";import{t as ee}from"./copy-DEzFUzeX.js";import{n as te}from"./SidebarHomeLink-qMFEGjZt.js";import{t as ne}from"./play-B-BjsTZz.js";import{t as re}from"./send-BL4d5iOt.js";import{i as ie,n as ae,r as oe,t as se}from"./useGameRoom-hHkV65ii.js";import{S as l,c as u,i as d,x as f}from"./index-C-_ZwxuN.js";var ce=r(`rotate-ccw`,[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]),p=t(e(),1),m=[`S`,`H`,`C`,`D`],h=[`3`,`4`,`5`,`6`,`7`,`8`,`9`,`10`,`J`,`Q`,`K`,`A`,`2`],g=h.filter(e=>e!==`2`),_=new Map(h.map((e,t)=>[e,t+3])),v=5,y=20,b=1e3;function le({roomCode:e,ownerAddress:t,ownerName:n,players:r=[],random:i=Math.random}){let a=O(r);return a.some(e=>e.address===f(t))||a.unshift({address:f(t),name:K(n),avatar:``}),x({id:String(e||``).toUpperCase(),ownerAddress:f(t),status:`lobby`,seq:1,players:a.slice(0,6).map((e,t)=>({address:e.address,name:K(e.name),avatar:l(e.avatar),seat:t,hand:[],handCount:0,score:b,playedCards:0})),deck:[],discard:[],table:null,currentSeat:0,lastWinnerSeat:null,previousWinnerSeat:null,passSeats:[],baseScore:1,bombCount:0,diceRolls:[],roundResult:null,log:[`房间已创建`],winnerSeat:null,random:i})}function ue(e,t=[]){let n=S(e);if(!n||n.status!==`lobby`)return n;let r=new Map(n.players.map(e=>[e.address,e.score]));return n.players=O(t).slice(0,6).map((e,t)=>({address:e.address,name:K(e.name),avatar:l(e.avatar),seat:t,hand:[],handCount:0,score:r.get(e.address)??b,playedCards:0})),n.seq+=1,x(n)}function de(e,t=Math.random){let n=S(e);if(!n||n.players.length<2)throw Error(`至少需要 2 名玩家`);n.deck=_e(ge(),t),n.discard=[],n.table=null,n.passSeats=[],n.winnerSeat=null,n.roundResult=null,n.baseScore=1,n.bombCount=0,n.status=`playing`;for(let e of R(n))e.hand=P(n,v),e.handCount=e.hand.length,e.playedCards=0,F(e.hand);let r=j(n,t);return n.currentSeat=r.seat,n.lastWinnerSeat=null,n.log=[`新一局开始,${r.name} 先出牌`],n.diceRolls.length>0&&n.log.unshift(`骰子结果:${n.diceRolls.map(e=>`${e.name} ${e.value}`).join(`,`)}`),n.seq+=1,x(n)}function fe(e,t,n){let r=S(e),i=I(r),a=f(t);if(!i||i.address!==a)return{ok:!1,error:`还没轮到你`,state:x(r)};let o=n.map(e=>i.hand.find(t=>t.id===e));if(o.length===0||o.some(e=>!e))return{ok:!1,error:`手牌不存在`,state:x(r)};let s=he(o);return s?D(s,r.table?.combo)?(o.sort(V),i.hand=i.hand.filter(e=>!n.includes(e.id)),i.handCount=i.hand.length,i.playedCards+=o.length,r.discard.push(...o),r.table={seat:i.seat,playerName:i.name,cards:o,combo:s},r.passSeats=[],r.lastWinnerSeat=i.seat,s.type===`bomb`&&(r.bombCount+=1,r.baseScore*=2),r.log.unshift(`${i.name} 出 ${s.label} ${o.map(G).join(` `)}${s.type===`bomb`?`,底分 ${r.baseScore}`:``}`),i.hand.length===0?M(r,i):z(r),r.seq+=1,{ok:!0,state:x(r)}):{ok:!1,error:`出的牌压不过上一手`,state:x(r)}:{ok:!1,error:`这个牌型不合法`,state:x(r)}}function pe(e,t){let n=S(e),r=I(n),i=f(t);return!r||r.address!==i?{ok:!1,error:`还没轮到你`,state:x(n)}:n.table?(n.passSeats.includes(r.seat)||n.passSeats.push(r.seat),n.log.unshift(`${r.name} 不要`),L(n).map(e=>e.seat).filter(e=>e!==n.lastWinnerSeat).every(e=>n.passSeats.includes(e))?(N(n),n.currentSeat=n.lastWinnerSeat,n.table=null,n.passSeats=[],n.log.unshift(`本轮结束,所有玩家各补 1 张,重新领出`)):z(n),n.seq+=1,{ok:!0,state:x(n)}):{ok:!1,error:`领出时不能不要`,state:x(n)}}function me(e,t){let n=S(e);if(!n)return null;let r=f(t),i=n.players.findIndex(e=>e.address===r);if(i===-1)return x(n);let a=n.players[i],o=n.currentSeat===a.seat,s=n.lastWinnerSeat===a.seat;n.players.splice(i,1),n.passSeats=n.passSeats.filter(e=>e!==a.seat),n.log.unshift(`${a.name} 已退出房间`);let c=R(n);if(n.status===`playing`)if(c.length<=1)c.length===1?M(n,c[0]):(n.status=`finished`,n.log.unshift(`玩家不足,本局结束`));else{if(o){let e=L(n);if(e.length>0){let t=e.findIndex(e=>e.seat>a.seat);n.currentSeat=e[t>=0?t:0].seat}}s&&n.table&&(n.table=null,n.passSeats=[])}return n.seq+=1,x(n)}function x(e){return e?{id:e.id,ownerAddress:e.ownerAddress,status:e.status,seq:Number(e.seq||1),deck:Array.isArray(e.deck)?e.deck.map(W):[],deckCount:e.deck?.length||Number(e.deckCount||0),discard:Array.isArray(e.discard)?e.discard.map(W):[],discardCount:e.discard?.length||Number(e.discardCount||0),currentSeat:Number(e.currentSeat||0),lastWinnerSeat:e.lastWinnerSeat===null||e.lastWinnerSeat===void 0?null:Number(e.lastWinnerSeat),previousWinnerSeat:e.previousWinnerSeat===null||e.previousWinnerSeat===void 0?null:Number(e.previousWinnerSeat),baseScore:Number(e.baseScore||1),bombCount:Number(e.bombCount||0),diceRolls:Array.isArray(e.diceRolls)?e.diceRolls:[],roundResult:e.roundResult||null,table:e.table?{...e.table,cards:e.table.cards.map(W)}:null,passSeats:Array.isArray(e.passSeats)?e.passSeats:[],winnerSeat:e.winnerSeat===null||e.winnerSeat===void 0?null:Number(e.winnerSeat),log:Array.isArray(e.log)?e.log.slice(0,18):[],players:R(e).map(e=>({address:e.address,name:e.name,avatar:l(e.avatar),seat:e.seat,handCount:e.hand?.length??e.handCount??0,score:Number(e.score??b),playedCards:Number(e.playedCards||0),hand:Array.isArray(e.hand)?e.hand.map(W):[]}))}:null}function S(e){return!e||typeof e!=`object`?null:{id:String(e.id||``).toUpperCase(),ownerAddress:f(e.ownerAddress),status:e.status===`playing`||e.status===`finished`?e.status:`lobby`,seq:Number(e.seq||1),players:Array.isArray(e.players)?e.players.map(k).filter(Boolean):[],deck:Array.isArray(e.deck)?e.deck.map(be).filter(Boolean):[],discard:Array.isArray(e.discard)?e.discard.map(A).filter(Boolean):[],table:e.table&&typeof e.table==`object`?{...e.table,cards:Array.isArray(e.table.cards)?e.table.cards.map(A).filter(Boolean):[]}:null,currentSeat:Number(e.currentSeat||0),lastWinnerSeat:e.lastWinnerSeat===null||e.lastWinnerSeat===void 0?null:Number(e.lastWinnerSeat),previousWinnerSeat:e.previousWinnerSeat===null||e.previousWinnerSeat===void 0?null:Number(e.previousWinnerSeat),passSeats:Array.isArray(e.passSeats)?e.passSeats.map(Number):[],baseScore:Number(e.baseScore||1),bombCount:Number(e.bombCount||0),diceRolls:Array.isArray(e.diceRolls)?e.diceRolls:[],roundResult:e.roundResult||null,log:Array.isArray(e.log)?e.log.map(String):[],winnerSeat:e.winnerSeat===null||e.winnerSeat===void 0?null:Number(e.winnerSeat)}}function he(e){if(!e?.length)return null;e=[...e].sort(V);let t=e.filter(U).length,n=e.filter(e=>!U(e));if(n.length===0)return null;let r=C(e,n,t);if(r)return r;if(e.length===1&&t===0)return E(`single`,H(e[0]),1,[H(e[0])]);if(e.length===2&&B(n,t)){let e=ve(n);return E(`pair`,e,2,[e,e])}return w(e)||T(e)}function C(e,t,n){if(e.length<3||!B(t,n))return null;let r=ve(t);return E(`bomb`,r,e.length,Array(e.length).fill(r),n===0)}function w(e){if(e.length<3)return null;let t=e.filter(U).length,n=e.filter(e=>!U(e));for(let r=0;r<=g.length-e.length;r+=1){let i=g.slice(r,r+e.length).map(e=>_.get(e)),a=[...i],o=0;for(let e of n){let t=a.indexOf(H(e));t!==-1&&(a.splice(t,1),o+=1)}if(o+t===e.length&&a.length===t)return E(`straight`,i.at(-1),e.length,i)}return null}function T(e){if(e.length<4||e.length%2!=0)return null;let t=e.length/2,n=e.filter(U).length,r=e.filter(e=>!U(e));for(let i=0;i<=g.length-t;i+=1){let a=g.slice(i,i+t).map(e=>_.get(e)),o=a.flatMap(e=>[e,e]),s=0;for(let e of r){let t=o.indexOf(H(e));t!==-1&&(o.splice(t,1),s+=1)}if(s+n===e.length&&o.length===n){let t=a.flatMap(e=>[e,e]);return E(`pairStraight`,a.at(-1),e.length,t)}}return null}function E(e,t,n,r,i=!0){return{type:e,value:t,length:n,resolvedValues:r,pure:i,label:Ce({type:e,value:t,length:n,resolvedValues:r,pure:i})}}function D(e,t){return e?!t||e.type===`bomb`&&t.type!==`bomb`?!0:e.type===t.type?e.type===`bomb`?e.length===t.length?e.value===t.value?e.pure&&!t.pure:e.value>t.value:e.length>t.length:e.length===t.length?e.type===`single`||e.type===`pair`?e.value===Te(t.value)||e.value===_.get(`2`)&&t.value!==_.get(`2`):e.value===Te(t.value):!1:!1:!1}function O(e){let t=new Set;return e.map(e=>({address:f(e.address),name:K(e.name),avatar:l(e.avatar),publicKey:String(e.publicKey||``)})).filter(e=>!e.address||t.has(e.address)?!1:(t.add(e.address),!0))}function k(e){let t=f(e.address);return t?{address:t,name:K(e.name),avatar:l(e.avatar),seat:Number(e.seat||0),hand:Array.isArray(e.hand)?e.hand.map(A).filter(Boolean):[],handCount:Number(e.handCount||0),score:Number(e.score??b),playedCards:Number(e.playedCards||0)}:null}function A(e){if(!e||typeof e!=`object`)return null;let t=String(e.rank||``),n=String(e.suit||``);return!_.has(t)&&t!==`SJ`&&t!==`BJ`||!m.includes(n)&&n!==`Joker`?null:{id:String(e.id||`${n}-${t}`),suit:n,rank:t,label:e.label||G({suit:n,rank:t}),color:e.color||Se({suit:n,rank:t})}}function j(e,t){if(e.previousWinnerSeat!==null)return e.diceRolls=[],R(e).find(t=>t.seat===e.previousWinnerSeat)||R(e)[0];let n=R(e),r=[];for(;n.length>1;){r=n.map(e=>({seat:e.seat,name:e.name,value:Ee(t)}));let i=Math.max(...r.map(e=>e.value)),a=r.filter(e=>e.value===i);if(a.length===1)return e.diceRolls=r,n.find(e=>e.seat===a[0].seat);n=n.filter(e=>a.some(t=>t.seat===e.seat))}return e.diceRolls=r,n[0]}function M(e,t){e.status=`finished`,e.winnerSeat=t.seat,e.previousWinnerSeat=t.seat;let n=[],r=0;for(let i of R(e)){if(i.seat===t.seat)continue;let a=i.playedCards===0,o=a?y:i.hand.length*e.baseScore*.5;i.score-=o,r+=o,n.push({seat:i.seat,name:i.name,loss:o,sealed:a,cardsLeft:i.hand.length})}t.score+=r,e.roundResult={winnerSeat:t.seat,winnerName:t.name,winnerGain:r,baseScore:e.baseScore,bombCount:e.bombCount,losers:n},e.log.unshift(`${t.name} 获胜,赢 ${r} 分`)}function N(e){for(let t of L(e)){if(e.deck.length===0)break;t.hand.push(...P(e,1)),t.handCount=t.hand.length,F(t.hand)}}function ge(){let e=[];for(let t of m)for(let n of h)e.push({id:`${t}-${n}`,suit:t,rank:n});return e.push({id:`SJ`,suit:`Joker`,rank:`SJ`}),e.push({id:`BJ`,suit:`Joker`,rank:`BJ`}),e.map(W)}function _e(e,t){let n=[...e];for(let e=n.length-1;e>0;--e){let r=Math.floor(t()*(e+1));[n[e],n[r]]=[n[r],n[e]]}return n}function P(e,t){return e.deck.splice(0,t)}function F(e){e.sort(V)}function I(e){return e.players.find(t=>t.seat===e.currentSeat)}function L(e){return R(e).filter(e=>e.hand.length>0)}function R(e){return[...e?.players||[]].sort((e,t)=>e.seat-t.seat)}function z(e){let t=L(e).map(e=>e.seat);e.currentSeat=t[(t.indexOf(e.currentSeat)+1)%t.length]}function B(e,t=0){if(e.length===0)return!1;let n=e[0].rank;return e.every(e=>e.rank===n)&&e.length+t>=2}function ve(e){return H(e[0])}function V(e,t){return H(e)-H(t)||ye(e.suit)-ye(t.suit)}function H(e){return _.get(e.rank)||99}function U(e){return e.rank===`SJ`||e.rank===`BJ`}function ye(e){return{D:0,C:1,H:2,S:3,Joker:4}[e]||0}function be(e){if(typeof e==`string`){let[t,n]=e.split(`-`);return A({id:e,suit:t,rank:n})}return A(e)}function W(e){return{id:e.id,suit:e.suit,rank:e.rank,label:G(e),color:Se(e)}}function G(e){return e.rank===`SJ`?`小王`:e.rank===`BJ`?`大王`:`${xe(e.suit)}${e.rank}`}function xe(e){return{S:`♠`,H:`♥`,C:`♣`,D:`♦`}[e]||``}function Se(e){return e.suit===`H`||e.suit===`D`||e.rank===`BJ`?`red`:`black`}function Ce(e){let t=e.resolvedValues?.length?`(${e.resolvedValues.map(we).join(` `)})`:``;return`${{single:`单张`,pair:`对子`,straight:`顺子`,pairStraight:`连对`,bomb:e.pure?`纯炸弹`:`带王炸弹`}[e.type]}${t}`}function we(e){return h.find(t=>_.get(t)===e)||String(e)}function Te(e){let t=h.findIndex(t=>_.get(t)===e);return t===-1||t>=h.length-1?null:_.get(h[t+1])}function Ee(e){return Math.floor(e()*6)+1}function K(e){return String(e||`玩家`).trim().slice(0,16)||`玩家`}var q={page:`_page_1c8jk_1`,headerActions:`_headerActions_1c8jk_7`,entry:`_entry_1c8jk_13`,entryBrand:`_entryBrand_1c8jk_23`,cardMark:`_cardMark_1c8jk_29`,entryPanel:`_entryPanel_1c8jk_59`,panel:`_panel_1c8jk_60`,handPanel:`_handPanel_1c8jk_61`,accountLine:`_accountLine_1c8jk_74`,scoreMeta:`_scoreMeta_1c8jk_75`,roomBar:`_roomBar_1c8jk_76`,badges:`_badges_1c8jk_77`,actions:`_actions_1c8jk_78`,joinForm:`_joinForm_1c8jk_98`,status:`_status_1c8jk_119`,gameGrid:`_gameGrid_1c8jk_125`,tablePanel:`_tablePanel_1c8jk_136`,seats:`_seats_1c8jk_170`,player:`_player_1c8jk_176`,active:`_active_1c8jk_193`,winner:`_winner_1c8jk_197`,avatar:`_avatar_1c8jk_201`,avatarOffline:`_avatarOffline_1c8jk_222`,onlineDot:`_onlineDot_1c8jk_227`,centerTable:`_centerTable_1c8jk_253`,deckBox:`_deckBox_1c8jk_260`,playedBox:`_playedBox_1c8jk_261`,playedCards:`_playedCards_1c8jk_289`,notice:`_notice_1c8jk_297`,resultDetail:`_resultDetail_1c8jk_305`,sidePanel:`_sidePanel_1c8jk_316`,scoreRow:`_scoreRow_1c8jk_341`,logPanel:`_logPanel_1c8jk_349`,hand:`_hand_1c8jk_61`,cardButton:`_cardButton_1c8jk_376`,picked:`_picked_1c8jk_386`,card:`_card_1c8jk_29`,red:`_red_1c8jk_417`,black:`_black_1c8jk_421`,small:`_small_1c8jk_425`,preview:`_preview_1c8jk_443`,valid:`_valid_1c8jk_466`},J=n(),Y=`gandengyan`;function X(...e){return e.filter(Boolean).join(` `)}function De(e,t){return String(e||``).toLowerCase()===String(t||``).toLowerCase()}function Oe(e,t){if(typeof window>`u`||!(`speechSynthesis`in window)||!e)return;window.speechSynthesis.cancel();let n=new SpeechSynthesisUtterance(e);n.lang=t,n.rate=1.1,window.speechSynthesis.speak(n)}function ke(){let{t:e,locale:t}=o(),n=u(e=>e.isDarkMode),r=u(e=>e.setIsDarkMode),i=u(e=>e.addToast),l=a(e=>e.initializeUser),[d,f]=(0,p.useState)(``),[m,h]=(0,p.useState)([]),[g,_]=(0,p.useState)(!1),v=(0,p.useRef)(``),y=(0,p.useRef)(!1),b=se({gameId:Y,onError:e=>i(e,`error`)});(0,p.useEffect)(()=>{l()},[l]),(0,p.useEffect)(()=>{let e=new URLSearchParams(window.location.search).get(`room`)?.toUpperCase();e&&(f(e),v.current=e)},[]),(0,p.useEffect)(()=>{let t=v.current;!t||y.current||!b.isBackendReady||!b.userIdentity||(y.current=!0,v.current=``,b.joinRoom(t).then(t=>{t&&i(e(`game.toast.joinedRoom`),`success`)}))},[b.isBackendReady,b.userIdentity,b.joinRoom,i,e]),(0,p.useEffect)(()=>{if(!b.roomCode)return;let e=`/game/gandengyan?room=${b.roomCode}`;`${window.location.pathname}${window.location.search}`!==e&&window.history.replaceState(null,``,e)},[b.roomCode]);let x=(0,p.useMemo)(()=>ae(b.messages,b.roomCode?{gameId:Y,roomCode:b.roomCode}:{gameId:Y}),[b.messages,b.roomCode]),S=(0,p.useMemo)(()=>oe(b.messages,{gameId:Y,roomCode:b.roomCode}),[b.messages,b.roomCode]),C=S?.payload?.state,w=C?.players.find(e=>De(e.address,b.userIdentity?.address)),T=De(C?.ownerAddress||x.hostAddress,b.userIdentity?.address),E=C?.status===`playing`&&C.currentSeat===w?.seat,D=(0,p.useMemo)(()=>m.map(e=>w?.hand.find(t=>t.id===e)).filter(Boolean),[m,w]),O=(0,p.useMemo)(()=>he(D),[D]),k=b.roomCode&&typeof window<`u`?`${window.location.origin}/game/gandengyan?room=${b.roomCode}`:``,A=(0,p.useRef)(-1),j=(0,p.useRef)(!1);(0,p.useEffect)(()=>{h([])},[C?.seq]),(0,p.useEffect)(()=>{if(!C)return;let n=C.seq;if(A.current<0){A.current=n;return}if(n!==A.current&&(A.current=n,C.status!==`finished`&&(j.current=!1),C.status===`finished`&&C.winnerSeat!==null)){j.current||(j.current=!0,Oe(e(`game.gandengyan.speech.gameOver`),t));return}},[t,C?.seq,e]),(0,p.useEffect)(()=>{if(!T||!b.roomCode||!b.userIdentity||S||x.players.length===0)return;let e=le({roomCode:b.roomCode,ownerAddress:b.userIdentity.address,ownerName:b.userIdentity.displayName||b.userIdentity.username,players:x.players});b.sendRoomEvent(`room:state`,{state:e,seq:e.seq})},[b,T,S,x.players]),(0,p.useEffect)(()=>{if(!C||!T||C.status!==`lobby`)return;let e=ue(C,x.players);e&&Ae(C.players,e.players)&&b.sendRoomEvent(`room:state`,{state:e,seq:e.seq})},[b,T,x.players,C]);let M=(0,p.useRef)(0),N=(0,p.useMemo)(()=>b.roomEvents.filter(e=>e.event?.event===`player:leave`),[b.roomEvents]);(0,p.useEffect)(()=>{if(N.length<=M.current)return;let t=N.slice(M.current);M.current=N.length;for(let n of t)i(e(`game.toast.playerLeft`,{player:n.event?.payload?.player?.name||e(`game.player`)}),`info`)},[N,i,e]),(0,p.useEffect)(()=>{if(!C||!T||C.status!==`playing`)return;let e=new Set(x.players.map(e=>e.address.toLowerCase())),t=C.players.find(t=>!e.has(t.address.toLowerCase()));if(!t)return;let n=me(C,t.address);n&&F(n)},[b,T,x.players,C]);async function ge(){await b.createRoom()&&i(e(`game.toast.roomCreated`),`success`)}async function _e(t){t.preventDefault(),await b.joinRoom(d)&&i(e(`game.toast.joinedRoom`),`success`)}async function P(){k&&(await navigator.clipboard.writeText(k),_(!0),setTimeout(()=>_(!1),1400))}async function F(e){await b.sendRoomEvent(`room:state`,{state:e,seq:e.seq})}async function I(){if(!(!C||!T))try{await F(de(C))}catch(t){i(t instanceof Error?t.message:e(`game.zhajinhua.error.startFailed`),`error`)}}async function L(){await I()}async function R(){if(!C||!b.userIdentity)return;let t=fe(C,b.userIdentity.address,m);if(!t.ok){i(t.error||e(`game.gandengyan.error.playFailed`),`error`);return}await F(t.state)}async function z(){if(!C||!b.userIdentity)return;let t=pe(C,b.userIdentity.address);if(!t.ok){i(t.error||e(`game.gandengyan.error.actionFailed`),`error`);return}await F(t.state)}function B(e){h(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])}return(0,J.jsx)(te,{sidebar:({closeSidebar:e})=>(0,J.jsx)(ie,{activeGame:`gandengyan`,closeSidebar:e}),headerTitle:(0,J.jsx)(`h2`,{className:`header-title`,children:e(`game.gandengyan.title`)}),headerRight:(0,J.jsxs)(`div`,{className:q.headerActions,children:[C&&(0,J.jsxs)(`button`,{className:`btn btn-sm`,onClick:P,children:[(0,J.jsx)(ee,{size:14}),e(g?`common.copied`:`game.action.shareRoom`)]}),(0,J.jsx)(`button`,{className:`btn btn-icon`,onClick:()=>r(!n),title:e(`common.theme.toggle`),children:n?(0,J.jsx)(s,{size:16}):(0,J.jsx)(c,{size:16})})]}),children:(0,J.jsx)(`main`,{className:q.page,children:C?(0,J.jsxs)(`section`,{className:q.gameGrid,children:[(0,J.jsxs)(`div`,{className:q.tablePanel,children:[(0,J.jsxs)(`div`,{className:q.roomBar,children:[(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`strong`,{translate:`no`,children:e(`game.roomLabel`,{room:C.id})}),(0,J.jsx)(`span`,{children:C.status===`lobby`?e(`game.status.waitingStart`):C.status===`finished`?e(`game.status.finished`):e(`game.status.playing`)})]}),(0,J.jsx)(`div`,{className:q.badges,children:(0,J.jsx)(`span`,{children:b.connected?e(`game.status.online`):e(`game.status.offline`)})})]}),(0,J.jsx)(`div`,{className:q.seats,children:C.players.map(t=>(0,J.jsx)(Z,{player:t,active:C.currentSeat===t.seat,winner:C.winnerSeat===t.seat,relation:Pe(w,t,C.players.length,e),presenceByAddress:b.presenceByAddress,onlineAddresses:b.onlineAddresses},t.seat))}),(0,J.jsxs)(`div`,{className:q.centerTable,children:[(0,J.jsxs)(`div`,{className:q.deckBox,children:[(0,J.jsx)(`span`,{children:e(`game.gandengyan.deck`)}),(0,J.jsx)(`strong`,{children:C.deckCount})]}),(0,J.jsx)(`div`,{className:q.playedBox,children:C.table?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(`strong`,{children:e(`game.gandengyan.tablePlay`,{player:$(C.players.find(e=>e.seat===C.table?.seat),b.presenceByAddress)||C.table.playerName,combo:C.table.combo?.label||e(`game.card`)})}),(0,J.jsx)(`div`,{className:q.playedCards,children:C.table.cards.map(e=>(0,J.jsx)(Ne,{card:e,small:!0},e.id))})]}):(0,J.jsx)(`span`,{children:e(`game.gandengyan.waitingLead`)})}),(0,J.jsxs)(`div`,{className:q.deckBox,children:[(0,J.jsx)(`span`,{children:e(`game.gandengyan.baseScore`)}),(0,J.jsx)(`strong`,{children:C.baseScore})]})]}),(0,J.jsx)(`div`,{className:q.notice,children:C.status===`finished`?C.roundResult?(0,J.jsxs)(`div`,{className:q.resultDetail,children:[(0,J.jsxs)(`p`,{children:[e(`game.gandengyan.result.winnerGain`,{player:C.roundResult.winnerName,score:C.roundResult.winnerGain}),C.roundResult.bombCount>0&&e(`game.gandengyan.result.bombCount`,{count:C.roundResult.bombCount})]}),C.roundResult.losers.map(t=>(0,J.jsx)(`p`,{children:t.sealed?e(`game.gandengyan.result.sealedLoss`,{player:t.name,loss:20}):e(`game.gandengyan.result.cardsLeftLoss`,{player:t.name,cards:t.cardsLeft,loss:t.loss})},t.seat))]}):e(`game.gandengyan.result.winner`,{player:$(C.players.find(e=>e.seat===C.winnerSeat),b.presenceByAddress)||e(`game.player`)}):E?e(`game.gandengyan.status.yourTurn`):e(`game.zhajinhua.status.waitingPlayer`,{player:$(C.players.find(e=>e.seat===C.currentSeat),b.presenceByAddress)||e(`game.player`)})})]}),(0,J.jsxs)(`aside`,{className:q.sidePanel,children:[(0,J.jsxs)(`section`,{className:q.panel,children:[(0,J.jsx)(`h3`,{children:e(`game.gandengyan.roundPanel`)}),T&&C.status===`lobby`&&(0,J.jsxs)(`button`,{className:`btn btn-primary`,disabled:C.players.length<2,onClick:I,children:[(0,J.jsx)(ne,{size:16}),e(`game.action.startRound`)]}),T&&C.status===`finished`&&(0,J.jsxs)(`button`,{className:`btn btn-primary`,onClick:L,children:[(0,J.jsx)(ce,{size:16}),e(`game.action.nextRound`)]}),!T&&(0,J.jsx)(`p`,{className:q.status,children:e(`game.waitingHost`)})]}),(0,J.jsxs)(`section`,{className:q.panel,children:[(0,J.jsx)(`h3`,{children:e(`game.gandengyan.score`)}),(0,J.jsxs)(`div`,{className:q.scoreMeta,children:[(0,J.jsx)(`span`,{children:e(`game.gandengyan.bombCount`,{count:C.bombCount})}),(0,J.jsx)(`span`,{children:e(`game.gandengyan.discardCount`,{count:C.discardCount})})]}),C.players.map(e=>(0,J.jsxs)(`div`,{className:q.scoreRow,children:[(0,J.jsx)(`span`,{translate:`no`,children:$(e,b.presenceByAddress)}),(0,J.jsx)(`strong`,{children:e.score})]},e.seat))]}),(0,J.jsxs)(`section`,{className:X(q.panel,q.logPanel),children:[(0,J.jsx)(`h3`,{children:e(`game.gandengyan.log`)}),C.log.map((e,t)=>(0,J.jsx)(`p`,{translate:`no`,children:e},`${e}-${t}`))]})]}),(0,J.jsxs)(`div`,{className:q.handPanel,children:[(0,J.jsx)(Z,{player:w,active:E,winner:C.winnerSeat===w?.seat,presenceByAddress:b.presenceByAddress,onlineAddresses:b.onlineAddresses}),(0,J.jsx)(`div`,{className:q.hand,children:w?.hand.map(e=>(0,J.jsx)(`button`,{className:X(q.cardButton,m.includes(e.id)&&q.picked),onClick:()=>B(e.id),children:(0,J.jsx)(Ne,{card:e})},e.id))}),(0,J.jsxs)(`div`,{className:q.actions,children:[(0,J.jsxs)(`div`,{className:X(q.preview,O&&q.valid),children:[(0,J.jsx)(`strong`,{children:O?O.label:m.length?e(`game.gandengyan.invalidCombo`):e(`game.gandengyan.selectCards`)}),(0,J.jsx)(`span`,{children:D.map(e=>e.label).join(` `)||e(`game.gandengyan.jokerOrderHint`)})]}),(0,J.jsxs)(`button`,{className:`btn btn-primary`,disabled:!E||m.length===0||!O,onClick:R,children:[(0,J.jsx)(re,{size:16}),e(`game.gandengyan.action.play`)]}),(0,J.jsx)(`button`,{className:`btn`,disabled:!E||!C.table,onClick:z,children:e(`game.gandengyan.action.pass`)})]})]})]}):(0,J.jsxs)(`section`,{className:q.entry,children:[(0,J.jsxs)(`div`,{className:q.entryBrand,children:[(0,J.jsx)(`div`,{className:q.cardMark,children:e(`game.gandengyan.mark`)}),(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`h1`,{children:e(`game.gandengyan.hero.title`)}),(0,J.jsx)(`p`,{children:e(`game.hero.desc`)})]})]}),(0,J.jsxs)(`div`,{className:q.entryPanel,children:[(0,J.jsxs)(`div`,{className:q.accountLine,children:[(0,J.jsx)(`span`,{children:e(`game.currentAccount`)}),(0,J.jsx)(`strong`,{translate:`no`,children:b.userIdentity?.displayName||e(`web3.notSignedIn`)})]}),(0,J.jsxs)(`button`,{className:`btn btn-primary`,disabled:b.joining,onClick:ge,children:[(0,J.jsx)(ne,{size:16}),e(`game.action.createRoom`)]}),(0,J.jsxs)(`form`,{onSubmit:_e,className:q.joinForm,children:[(0,J.jsxs)(`label`,{children:[e(`game.roomCode`),(0,J.jsx)(`input`,{value:d,maxLength:8,onChange:e=>f(e.target.value.toUpperCase()),placeholder:e(`game.roomCode.placeholder`)})]}),(0,J.jsx)(`button`,{className:`btn`,disabled:b.joining||!d,children:e(`game.action.joinRoom`)})]}),(0,J.jsx)(`p`,{className:q.status,children:b.isBackendReady?e(`game.status.nodeConnected`):e(`game.status.nodeConnecting`)})]})]})})})}function Z({player:e,active:t,winner:n,relation:r=``,presenceByAddress:i,onlineAddresses:a}){let{t:s}=o();if(!e)return null;let c=Me(e,i,a);return(0,J.jsxs)(`div`,{className:X(q.player,t&&q.active,n&&q.winner),children:[(0,J.jsxs)(`div`,{className:X(q.avatar,!c.online&&q.avatarOffline),translate:`no`,children:[(0,J.jsx)(`img`,{src:d(e.address,c.avatar),alt:``}),c.online&&(0,J.jsx)(`span`,{className:q.onlineDot})]}),(0,J.jsxs)(`div`,{children:[(0,J.jsx)(`strong`,{translate:`no`,children:c.name}),(0,J.jsxs)(`span`,{children:[r,r?` · `:``,s(`game.gandengyan.handCount`,{count:e.handCount})]})]})]})}function Ae(e,t){return e.length===t.length?t.some((t,n)=>{let r=e[n];return Q(r?.address)!==Q(t.address)||r?.name!==t.name||(r?.avatar||``)!==(t.avatar||``)}):!0}function Q(e=``){return String(e||``).trim().toLowerCase()}function je(e=``){return e?`${e.slice(0,6)}...${e.slice(-4)}`:``}function $(e,t){if(!e)return``;let n=Q(e.address),r=t.get(n)?.displayName||e.name;return String(r||je(e.address)).trim()}function Me(e,t,n){let r=Q(e.address),i=t.get(r);return{name:$(e,t),avatar:i?.avatar||e.avatar||``,online:r?n.has(r):!1}}function Ne({card:e,small:t=!1}){return(0,J.jsxs)(`div`,{className:X(q.card,q[e.color],t&&q.small),children:[(0,J.jsx)(`span`,{children:e.label}),(0,J.jsx)(`i`,{children:e.suit===`Joker`?`*`:e.label.slice(0,1)})]})}function Pe(e,t,n,r){if(!e)return r(`game.gandengyan.position.seat`,{seat:t.seat+1});let i=(t.seat-e.seat+n)%n;return i===0?r(`game.gandengyan.position.me`):n===2?r(`game.gandengyan.position.opponent`):n===3?r(i===1?`game.gandengyan.position.nextOpponent`:`game.gandengyan.position.prevOpponent`):n===4?r(i===1?`game.gandengyan.position.nextOpponent`:i===2?`game.gandengyan.position.partner`:`game.gandengyan.position.prevOpponent`):i%2==0?r(`game.gandengyan.position.seatPartner`,{seat:t.seat+1}):r(`game.gandengyan.position.seatOpponent`,{seat:t.seat+1})}var Fe=i(`/game/gandengyan/`)({component:ke});export{Fe as Route};
@@ -1 +1 @@
1
- import{n as e,o as t,t as n}from"./jsx-runtime-Bt-cYkS5.js";import{C as r,T as i}from"./ui-BpDGD3IR.js";import{a}from"./i18n-NjvOSuV6.js";import{n as o,t as s}from"./smartphone-tRRFFO0a.js";import{t as c}from"./message-square-Dp09WY1I.js";import{t as l}from"./music-B19Tg557.js";import{t as u}from"./play-B-BjsTZz.js";import{t as d}from"./search-DSkiWdvX.js";import{t as f}from"./send-BL4d5iOt.js";import{t as p}from"./wifi-Bgo8eHY0.js";import{t as m}from"./MarketingLayout-CQurMOSD.js";var h=r(`at-sign`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8`,key:`7n84p3`}]]),g=r(`book-open`,[[`path`,{d:`M12 7v14`,key:`1akyts`}],[`path`,{d:`M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z`,key:`ruj8y`}]]),_=r(`bot`,[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]),v=r(`camera`,[[`path`,{d:`M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z`,key:`18u6gg`}],[`circle`,{cx:`12`,cy:`13`,r:`3`,key:`1vg3eu`}]]),y=r(`messages-square`,[[`path`,{d:`M16 10a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 14.286V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z`,key:`1n2ejm`}],[`path`,{d:`M20 9a2 2 0 0 1 2 2v10.286a.71.71 0 0 1-1.212.502l-2.202-2.202A2 2 0 0 0 17.172 19H10a2 2 0 0 1-2-2v-1`,key:`1qfcsi`}]]),b=r(`package`,[[`path`,{d:`M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z`,key:`1a0edw`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}],[`polyline`,{points:`3.29 7 12 12 20.71 7`,key:`ousv84`}],[`path`,{d:`m7.5 4.27 9 5.15`,key:`1c824w`}]]),x=r(`rotate-cw`,[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`,key:`1p45f6`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}]]),ee=r(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),te=r(`triangle`,[[`path`,{d:`M13.73 4a2 2 0 0 0-3.46 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z`,key:`14u9p9`}]]),S=t(e(),1);function ne(e,t){let n=e.icons,r=e.aliases||Object.create(null),i=Object.create(null);function a(e){if(n[e])return i[e]=[];if(!(e in i)){i[e]=null;let t=r[e]&&r[e].parent,n=t&&a(t);n&&(i[e]=[t].concat(n))}return i[e]}return Object.keys(n).concat(Object.keys(r)).forEach(a),i}var re=Object.freeze({left:0,top:0,width:16,height:16}),C=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),w=Object.freeze({...re,...C}),T=Object.freeze({...w,body:``,hidden:!1});function ie(e,t){let n={};!e.hFlip!=!t.hFlip&&(n.hFlip=!0),!e.vFlip!=!t.vFlip&&(n.vFlip=!0);let r=((e.rotate||0)+(t.rotate||0))%4;return r&&(n.rotate=r),n}function E(e,t){let n=ie(e,t);for(let r in T)r in C?r in e&&!(r in n)&&(n[r]=C[r]):r in t?n[r]=t[r]:r in e&&(n[r]=e[r]);return n}function ae(e,t,n){let r=e.icons,i=e.aliases||Object.create(null),a={};function o(e){a=E(r[e]||i[e],a)}return o(t),n.forEach(o),E(e,a)}function oe(e,t){let n=[];if(typeof e!=`object`||typeof e.icons!=`object`)return n;e.not_found instanceof Array&&e.not_found.forEach(e=>{t(e,null),n.push(e)});let r=ne(e);for(let i in r){let a=r[i];a&&(t(i,ae(e,i,a)),n.push(i))}return n}var se={provider:``,aliases:{},not_found:{},...re};function D(e,t){for(let n in t)if(n in e&&typeof e[n]!=typeof t[n])return!1;return!0}function O(e){if(typeof e!=`object`||!e)return null;let t=e;if(typeof t.prefix!=`string`||!e.icons||typeof e.icons!=`object`||!D(e,se))return null;let n=t.icons;for(let e in n){let t=n[e];if(!e||typeof t.body!=`string`||!D(t,T))return null}let r=t.aliases||Object.create(null);for(let e in r){let t=r[e],i=t.parent;if(!e||typeof i!=`string`||!n[i]&&!r[i]||!D(t,T))return null}return t}var k=Object.create(null);function ce(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}function A(e,t){let n=k[e]||(k[e]=Object.create(null));return n[t]||(n[t]=ce(e,t))}function le(e,t){return O(t)?oe(t,(t,n)=>{n?e.icons[t]=n:e.missing.add(t)}):[]}function ue(e,t,n){try{if(typeof n.body==`string`)return e.icons[t]={...n},!0}catch{}return!1}var de=/^[a-z0-9]+(-[a-z0-9]+)*$/,j=(e,t,n,r=``)=>{let i=e.split(`:`);if(e.slice(0,1)===`@`){if(i.length<2||i.length>3)return null;r=i.shift().slice(1)}if(i.length>3||!i.length)return null;if(i.length>1){let e=i.pop(),n=i.pop(),a={provider:i.length>0?i[0]:r,prefix:n,name:e};return t&&!M(a)?null:a}let a=i[0],o=a.split(`-`);if(o.length>1){let e={provider:r,prefix:o.shift(),name:o.join(`-`)};return t&&!M(e)?null:e}if(n&&r===``){let e={provider:r,prefix:``,name:a};return t&&!M(e,n)?null:e}return null},M=(e,t)=>e?!!((t&&e.prefix===``||e.prefix)&&e.name):!1,N=!1;function P(e){return typeof e==`boolean`&&(N=e),N}function F(e){let t=typeof e==`string`?j(e,!0,N):e;if(t){let e=A(t.provider,t.prefix),n=t.name;return e.icons[n]||(e.missing.has(n)?null:void 0)}}function fe(e,t){let n=j(e,!0,N);if(!n)return!1;let r=A(n.provider,n.prefix);return t?ue(r,n.name,t):(r.missing.add(n.name),!0)}function pe(e,t){if(typeof e!=`object`)return!1;if(typeof t!=`string`&&(t=e.provider||``),N&&!t&&!e.prefix){let t=!1;return O(e)&&(e.prefix=``,oe(e,(e,n)=>{fe(e,n)&&(t=!0)})),t}let n=e.prefix;return M({prefix:n,name:`a`})?!!le(A(t,n),e):!1}var I=Object.freeze({width:null,height:null}),L=Object.freeze({...I,...C}),me=/(-?[0-9.]*[0-9]+[0-9.]*)/g,he=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function R(e,t,n){if(t===1)return e;if(n||=100,typeof e==`number`)return Math.ceil(e*t*n)/n;if(typeof e!=`string`)return e;let r=e.split(me);if(r===null||!r.length)return e;let i=[],a=r.shift(),o=he.test(a);for(;;){if(o){let e=parseFloat(a);isNaN(e)?i.push(a):i.push(Math.ceil(e*t*n)/n)}else i.push(a);if(a=r.shift(),a===void 0)return i.join(``);o=!o}}function ge(e,t=`defs`){let n=``,r=e.indexOf(`<`+t);for(;r>=0;){let i=e.indexOf(`>`,r),a=e.indexOf(`</`+t);if(i===-1||a===-1)break;let o=e.indexOf(`>`,a);if(o===-1)break;n+=e.slice(i+1,a).trim(),e=e.slice(0,r).trim()+e.slice(o+1)}return{defs:n,content:e}}function _e(e,t){return e?`<defs>`+e+`</defs>`+t:t}function ve(e,t,n){let r=ge(e);return _e(r.defs,t+r.content+n)}var ye=e=>e===`unset`||e===`undefined`||e===`none`;function be(e,t){let n={...w,...e},r={...L,...t},i={left:n.left,top:n.top,width:n.width,height:n.height},a=n.body;[n,r].forEach(e=>{let t=[],n=e.hFlip,r=e.vFlip,o=e.rotate;n?r?o+=2:(t.push(`translate(`+(i.width+i.left).toString()+` `+(0-i.top).toString()+`)`),t.push(`scale(-1 1)`),i.top=i.left=0):r&&(t.push(`translate(`+(0-i.left).toString()+` `+(i.height+i.top).toString()+`)`),t.push(`scale(1 -1)`),i.top=i.left=0);let s;switch(o<0&&(o-=Math.floor(o/4)*4),o%=4,o){case 1:s=i.height/2+i.top,t.unshift(`rotate(90 `+s.toString()+` `+s.toString()+`)`);break;case 2:t.unshift(`rotate(180 `+(i.width/2+i.left).toString()+` `+(i.height/2+i.top).toString()+`)`);break;case 3:s=i.width/2+i.left,t.unshift(`rotate(-90 `+s.toString()+` `+s.toString()+`)`);break}o%2==1&&(i.left!==i.top&&(s=i.left,i.left=i.top,i.top=s),i.width!==i.height&&(s=i.width,i.width=i.height,i.height=s)),t.length&&(a=ve(a,`<g transform="`+t.join(` `)+`">`,`</g>`))});let o=r.width,s=r.height,c=i.width,l=i.height,u,d;o===null?(d=s===null?`1em`:s===`auto`?l:s,u=R(d,c/l)):(u=o===`auto`?c:o,d=s===null?R(u,l/c):s===`auto`?l:s);let f={},p=(e,t)=>{ye(t)||(f[e]=t.toString())};p(`width`,u),p(`height`,d);let m=[i.left,i.top,c,l];return f.viewBox=m.join(` `),{attributes:f,viewBox:m,body:a}}var xe=/\sid="(\S+)"/g,Se=`IconifyId`+Date.now().toString(16)+(Math.random()*16777216|0).toString(16),Ce=0;function we(e,t=Se){let n=[],r;for(;r=xe.exec(e);)n.push(r[1]);if(!n.length)return e;let i=`suffix`+(Math.random()*16777216|Date.now()).toString(16);return n.forEach(n=>{let r=typeof t==`function`?t(n):t+(Ce++).toString(),a=n.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);e=e.replace(RegExp(`([#;"])(`+a+`)([")]|\\.[a-z])`,`g`),`$1`+r+i+`$3`)}),e=e.replace(new RegExp(i,`g`),``),e}var z=Object.create(null);function Te(e,t){z[e]=t}function B(e){return z[e]||z[``]}function V(e){let t;if(typeof e.resources==`string`)t=[e.resources];else if(t=e.resources,!(t instanceof Array)||!t.length)return null;return{resources:t,path:e.path||`/`,maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5e3,random:e.random===!0,index:e.index||0,dataAfterTimeout:e.dataAfterTimeout!==!1}}for(var H=Object.create(null),U=[`https://api.simplesvg.com`,`https://api.unisvg.com`],W=[];U.length>0;)U.length===1||Math.random()>.5?W.push(U.shift()):W.push(U.pop());H[``]=V({resources:[`https://api.iconify.design`].concat(W)});function Ee(e,t){let n=V(t);return n===null?!1:(H[e]=n,!0)}function G(e){return H[e]}var K=(()=>{let e;try{if(e=fetch,typeof e==`function`)return e}catch{}})();function De(e,t){let n=G(e);if(!n)return 0;let r;if(!n.maxURL)r=0;else{let e=0;n.resources.forEach(t=>{e=Math.max(e,t.length)});let i=t+`.json?icons=`;r=n.maxURL-e-n.path.length-i.length}return r}function Oe(e){return e===404}var ke=(e,t,n)=>{let r=[],i=De(e,t),a=`icons`,o={type:a,provider:e,prefix:t,icons:[]},s=0;return n.forEach((n,c)=>{s+=n.length+1,s>=i&&c>0&&(r.push(o),o={type:a,provider:e,prefix:t,icons:[]},s=n.length),o.icons.push(n)}),r.push(o),r};function Ae(e){if(typeof e==`string`){let t=G(e);if(t)return t.path}return`/`}var je={prepare:ke,send:(e,t,n)=>{if(!K){n(`abort`,424);return}let r=Ae(t.provider);switch(t.type){case`icons`:{let e=t.prefix,n=t.icons.join(`,`),i=new URLSearchParams({icons:n});r+=e+`.json?`+i.toString();break}case`custom`:{let e=t.uri;r+=e.slice(0,1)===`/`?e.slice(1):e;break}default:n(`abort`,400);return}let i=503;K(e+r).then(e=>{let t=e.status;if(t!==200){setTimeout(()=>{n(Oe(t)?`abort`:`next`,t)});return}return i=501,e.json()}).then(e=>{if(typeof e!=`object`||!e){setTimeout(()=>{e===404?n(`abort`,e):n(`next`,i)});return}setTimeout(()=>{n(`success`,e)})}).catch(()=>{n(`next`,i)})}};function q(e,t){e.forEach(e=>{let n=e.loaderCallbacks;n&&(e.loaderCallbacks=n.filter(e=>e.id!==t))})}function Me(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;let t=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!t.length)return;let n=!1,r=e.provider,i=e.prefix;t.forEach(t=>{let a=t.icons,o=a.pending.length;a.pending=a.pending.filter(t=>{if(t.prefix!==i)return!0;let o=t.name;if(e.icons[o])a.loaded.push({provider:r,prefix:i,name:o});else if(e.missing.has(o))a.missing.push({provider:r,prefix:i,name:o});else return n=!0,!0;return!1}),a.pending.length!==o&&(n||q([e],t.id),t.callback(a.loaded.slice(0),a.missing.slice(0),a.pending.slice(0),t.abort))})}))}var Ne=0;function Pe(e,t,n){let r=Ne++,i=q.bind(null,n,r);if(!t.pending.length)return i;let a={id:r,icons:t,callback:e,abort:i};return n.forEach(e=>{(e.loaderCallbacks||=[]).push(a)}),i}function Fe(e){let t={loaded:[],missing:[],pending:[]},n=Object.create(null);e.sort((e,t)=>e.provider===t.provider?e.prefix===t.prefix?e.name.localeCompare(t.name):e.prefix.localeCompare(t.prefix):e.provider.localeCompare(t.provider));let r={provider:``,prefix:``,name:``};return e.forEach(e=>{if(r.name===e.name&&r.prefix===e.prefix&&r.provider===e.provider)return;r=e;let i=e.provider,a=e.prefix,o=e.name,s=n[i]||(n[i]=Object.create(null)),c=s[a]||(s[a]=A(i,a)),l;l=o in c.icons?t.loaded:a===``||c.missing.has(o)?t.missing:t.pending;let u={provider:i,prefix:a,name:o};l.push(u)}),t}function Ie(e,t=!0,n=!1){let r=[];return e.forEach(e=>{let i=typeof e==`string`?j(e,t,n):e;i&&r.push(i)}),r}var Le={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function Re(e,t,n,r){let i=e.resources.length,a=e.random?Math.floor(Math.random()*i):e.index,o;if(e.random){let t=e.resources.slice(0);for(o=[];t.length>1;){let e=Math.floor(Math.random()*t.length);o.push(t[e]),t=t.slice(0,e).concat(t.slice(e+1))}o=o.concat(t)}else o=e.resources.slice(a).concat(e.resources.slice(0,a));let s=Date.now(),c=`pending`,l=0,u,d=null,f=[],p=[];typeof r==`function`&&p.push(r);function m(){d&&=(clearTimeout(d),null)}function h(){c===`pending`&&(c=`aborted`),m(),f.forEach(e=>{e.status===`pending`&&(e.status=`aborted`)}),f=[]}function g(e,t){t&&(p=[]),typeof e==`function`&&p.push(e)}function _(){return{startTime:s,payload:t,status:c,queriesSent:l,queriesPending:f.length,subscribe:g,abort:h}}function v(){c=`failed`,p.forEach(e=>{e(void 0,u)})}function y(){f.forEach(e=>{e.status===`pending`&&(e.status=`aborted`)}),f=[]}function b(t,n,r){let i=n!==`success`;switch(f=f.filter(e=>e!==t),c){case`pending`:break;case`failed`:if(i||!e.dataAfterTimeout)return;break;default:return}if(n===`abort`){u=r,v();return}if(i){u=r,f.length||(o.length?x():v());return}if(m(),y(),!e.random){let n=e.resources.indexOf(t.resource);n!==-1&&n!==e.index&&(e.index=n)}c=`completed`,p.forEach(e=>{e(r)})}function x(){if(c!==`pending`)return;m();let r=o.shift();if(r===void 0){if(f.length){d=setTimeout(()=>{m(),c===`pending`&&(y(),v())},e.timeout);return}v();return}let i={status:`pending`,resource:r,callback:(e,t)=>{b(i,e,t)}};f.push(i),l++,d=setTimeout(x,e.rotate),n(r,t,i.callback)}return setTimeout(x),_}function ze(e){let t={...Le,...e},n=[];function r(){n=n.filter(e=>e().status===`pending`)}function i(e,i,a){let o=Re(t,e,i,(e,t)=>{r(),a&&a(e,t)});return n.push(o),o}function a(e){return n.find(t=>e(t))||null}return{query:i,find:a,setIndex:e=>{t.index=e},getIndex:()=>t.index,cleanup:r}}function Be(){}var J=Object.create(null);function Ve(e){if(!J[e]){let t=G(e);if(!t)return;J[e]={config:t,redundancy:ze(t)}}return J[e]}function He(e,t,n){let r,i;if(typeof e==`string`){let t=B(e);if(!t)return n(void 0,424),Be;i=t.send;let a=Ve(e);a&&(r=a.redundancy)}else{let t=V(e);if(t){r=ze(t);let n=B(e.resources?e.resources[0]:``);n&&(i=n.send)}}return!r||!i?(n(void 0,424),Be):r.query(t,i,n)().abort}function Ue(){}function We(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,Me(e)}))}function Ge(e){let t=[],n=[];return e.forEach(e=>{(e.match(de)?t:n).push(e)}),{valid:t,invalid:n}}function Y(e,t,n){function r(){let n=e.pendingIcons;t.forEach(t=>{n&&n.delete(t),e.icons[t]||e.missing.add(t)})}if(n&&typeof n==`object`)try{if(!le(e,n).length){r();return}}catch(e){console.error(e)}r(),We(e)}function Ke(e,t){e instanceof Promise?e.then(e=>{t(e)}).catch(()=>{t(null)}):t(e)}function qe(e,t){e.iconsToLoad?e.iconsToLoad=e.iconsToLoad.concat(t).sort():e.iconsToLoad=t,e.iconsQueueFlag||(e.iconsQueueFlag=!0,setTimeout(()=>{e.iconsQueueFlag=!1;let{provider:t,prefix:n}=e,r=e.iconsToLoad;if(delete e.iconsToLoad,!r||!r.length)return;let i=e.loadIcon;if(e.loadIcons&&(r.length>1||!i)){Ke(e.loadIcons(r,n,t),t=>{Y(e,r,t)});return}if(i){r.forEach(r=>{Ke(i(r,n,t),t=>{Y(e,[r],t?{prefix:n,icons:{[r]:t}}:null)})});return}let{valid:a,invalid:o}=Ge(r);if(o.length&&Y(e,o,null),!a.length)return;let s=n.match(de)?B(t):null;if(!s){Y(e,a,null);return}s.prepare(t,n,a).forEach(n=>{He(t,n,t=>{Y(e,n.icons,t)})})}))}var Je=(e,t)=>{let n=Fe(Ie(e,!0,P()));if(!n.pending.length){let e=!0;return t&&setTimeout(()=>{e&&t(n.loaded,n.missing,n.pending,Ue)}),()=>{e=!1}}let r=Object.create(null),i=[],a,o;return n.pending.forEach(e=>{let{provider:t,prefix:n}=e;if(n===o&&t===a)return;a=t,o=n,i.push(A(t,n));let s=r[t]||(r[t]=Object.create(null));s[n]||(s[n]=[])}),n.pending.forEach(e=>{let{provider:t,prefix:n,name:i}=e,a=A(t,n),o=a.pendingIcons||=new Set;o.has(i)||(o.add(i),r[t][n].push(i))}),i.forEach(e=>{let t=r[e.provider][e.prefix];t.length&&qe(e,t)}),t?Pe(t,n,i):Ue};function Ye(e,t){let n={...e};for(let e in t){let r=t[e],i=typeof r;e in I?(r===null||r&&(i===`string`||i===`number`))&&(n[e]=r):i===typeof n[e]&&(n[e]=e===`rotate`?r%4:r)}return n}var Xe=/[\s,]+/;function Ze(e,t){t.split(Xe).forEach(t=>{switch(t.trim()){case`horizontal`:e.hFlip=!0;break;case`vertical`:e.vFlip=!0;break}})}function Qe(e,t=0){let n=e.replace(/^-?[0-9.]*/,``);function r(e){for(;e<0;)e+=4;return e%4}if(n===``){let t=parseInt(e);return isNaN(t)?0:r(t)}else if(n!==e){let t=0;switch(n){case`%`:t=25;break;case`deg`:t=90}if(t){let i=parseFloat(e.slice(0,e.length-n.length));return isNaN(i)?0:(i/=t,i%1==0?r(i):0)}}return t}function $e(e,t){let n=e.indexOf(`xlink:`)===-1?``:` xmlns:xlink="http://www.w3.org/1999/xlink"`;for(let e in t)n+=` `+e+`="`+t[e]+`"`;return`<svg xmlns="http://www.w3.org/2000/svg"`+n+`>`+e+`</svg>`}function et(e){return e.replace(/"/g,`'`).replace(/%/g,`%25`).replace(/#/g,`%23`).replace(/</g,`%3C`).replace(/>/g,`%3E`).replace(/\s+/g,` `)}function tt(e){return`data:image/svg+xml,`+et(e)}function nt(e){return`url("`+tt(e)+`")`}var X;function rt(){try{X=window.trustedTypes.createPolicy(`iconify`,{createHTML:e=>e})}catch{X=null}}function it(e){return X===void 0&&rt(),X?X.createHTML(e):e}var at={...L,inline:!1},ot={xmlns:`http://www.w3.org/2000/svg`,xmlnsXlink:`http://www.w3.org/1999/xlink`,"aria-hidden":!0,role:`img`},st={display:`inline-block`},Z={backgroundColor:`currentColor`},ct={backgroundColor:`transparent`},lt={Image:`var(--svg)`,Repeat:`no-repeat`,Size:`100% 100%`},ut={WebkitMask:Z,mask:Z,background:ct};for(let e in ut){let t=ut[e];for(let n in lt)t[e+n]=lt[n]}var dt={...at,inline:!0};function ft(e){return e+(e.match(/^[-0-9.]+$/)?`px`:``)}var pt=(e,t,n)=>{let r=t.inline?dt:at,i=Ye(r,t),a=t.mode||`svg`,o={},s=t.style||{},c={...a===`svg`?ot:{}};if(n){let e=j(n,!1,!0);if(e){let t=[`iconify`];for(let n of[`provider`,`prefix`])e[n]&&t.push(`iconify--`+e[n]);c.className=t.join(` `)}}for(let e in t){let n=t[e];if(n!==void 0)switch(e){case`icon`:case`style`:case`children`:case`onLoad`:case`mode`:case`ssr`:case`fallback`:break;case`_ref`:c.ref=n;break;case`className`:c[e]=(c[e]?c[e]+` `:``)+n;break;case`inline`:case`hFlip`:case`vFlip`:i[e]=n===!0||n===`true`||n===1;break;case`flip`:typeof n==`string`&&Ze(i,n);break;case`color`:o.color=n;break;case`rotate`:typeof n==`string`?i[e]=Qe(n):typeof n==`number`&&(i[e]=n);break;case`ariaHidden`:case`aria-hidden`:n!==!0&&n!==`true`&&delete c[`aria-hidden`];break;default:r[e]===void 0&&(c[e]=n)}}let l=be(e,i),u=l.attributes;if(i.inline&&(o.verticalAlign=`-0.125em`),a===`svg`){c.style={...o,...s},Object.assign(c,u);let e=0,n=t.id;return typeof n==`string`&&(n=n.replace(/-/g,`_`)),c.dangerouslySetInnerHTML={__html:it(we(l.body,n?()=>n+`ID`+ e++:`iconifyReact`))},(0,S.createElement)(`svg`,c)}let{body:d,width:f,height:p}=e,m=a===`mask`||(a===`bg`?!1:d.indexOf(`currentColor`)!==-1),h=$e(d,{...u,width:f+``,height:p+``});return c.style={...o,"--svg":nt(h),width:ft(u.width),height:ft(u.height),...st,...m?Z:ct,...s},(0,S.createElement)(`span`,c)};if(P(!0),Te(``,je),typeof document<`u`&&typeof window<`u`){let e=window;if(e.IconifyPreload!==void 0){let t=e.IconifyPreload,n=`Invalid IconifyPreload syntax.`;typeof t==`object`&&t&&(t instanceof Array?t:[t]).forEach(e=>{try{(typeof e!=`object`||!e||e instanceof Array||typeof e.icons!=`object`||typeof e.prefix!=`string`||!pe(e))&&console.error(n)}catch{console.error(n)}})}if(e.IconifyProviders!==void 0){let t=e.IconifyProviders;if(typeof t==`object`&&t)for(let e in t){let n=`IconifyProviders[`+e+`] is invalid.`;try{let r=t[e];if(typeof r!=`object`||!r||r.resources===void 0)continue;Ee(e,r)||console.error(n)}catch{console.error(n)}}}}function mt(e){let[t,n]=(0,S.useState)(!!e.ssr),[r,i]=(0,S.useState)({});function a(t){if(t){let t=e.icon;if(typeof t==`object`)return{name:``,data:t};let n=F(t);if(n)return{name:t,data:n}}return{name:``}}let[o,s]=(0,S.useState)(a(!!e.ssr));function c(){let e=r.callback;e&&(e(),i({}))}function l(e){if(JSON.stringify(o)!==JSON.stringify(e))return c(),s(e),!0}function u(){var t;let n=e.icon;if(typeof n==`object`){l({name:``,data:n});return}let r=F(n);l({name:n,data:r})&&(r===void 0?i({callback:Je([n],u)}):r&&((t=e.onLoad)==null||t.call(e,n)))}(0,S.useEffect)(()=>(n(!0),c),[]),(0,S.useEffect)(()=>{t&&u()},[e.icon,t]);let{name:d,data:f}=o;return f?pt({...w,...f},e,d):e.children?e.children:e.fallback?e.fallback:(0,S.createElement)(`span`,{})}var ht=(0,S.forwardRef)((e,t)=>mt({...e,_ref:t}));(0,S.forwardRef)((e,t)=>mt({inline:!0,...e,_ref:t}));var Q=n(),$=[{name:`Google`,host:`google.com`,icon:`simple-icons:google`,fallback:(0,Q.jsx)(d,{size:20})},{name:`Cloudflare`,host:`cloudflare.com`,icon:`simple-icons:cloudflare`,fallback:(0,Q.jsx)(o,{size:20})},{name:`YouTube`,host:`youtube.com`,icon:`simple-icons:youtube`,fallback:(0,Q.jsx)(u,{size:20})},{name:`GitHub`,host:`github.com`,icon:`simple-icons:github`,fallback:(0,Q.jsx)(ee,{size:20})},{name:`ChatGPT`,host:`chatgpt.com`,icon:`simple-icons:openai`,fallback:(0,Q.jsx)(_,{size:20})},{name:`X`,host:`x.com`,icon:`simple-icons:x`,fallback:(0,Q.jsx)(h,{size:20})},{name:`Instagram`,host:`instagram.com`,icon:`simple-icons:instagram`,fallback:(0,Q.jsx)(v,{size:20})},{name:`Reddit`,host:`reddit.com`,icon:`simple-icons:reddit`,fallback:(0,Q.jsx)(c,{size:20})},{name:`Wikipedia`,host:`wikipedia.org`,icon:`simple-icons:wikipedia`,fallback:(0,Q.jsx)(g,{size:20})},{name:`Apple`,host:`apple.com`,icon:`simple-icons:apple`,fallback:(0,Q.jsx)(s,{size:20})},{name:`Telegram`,host:`telegram.org`,icon:`simple-icons:telegram`,fallback:(0,Q.jsx)(f,{size:20})},{name:`Discord`,host:`discord.com`,icon:`simple-icons:discord`,fallback:(0,Q.jsx)(y,{size:20})},{name:`TikTok`,host:`tiktok.com`,icon:`simple-icons:tiktok`,fallback:(0,Q.jsx)(l,{size:20})},{name:`npm`,host:`npmjs.com`,icon:`simple-icons:npm`,fallback:(0,Q.jsx)(b,{size:20})},{name:`Vercel`,host:`vercel.com`,icon:`simple-icons:vercel`,fallback:(0,Q.jsx)(te,{size:20})}],gt=5e3;function _t({icon:e,fallback:t}){let[n,r]=(0,S.useState)(!1);return(0,S.useEffect)(()=>{let t=new Image;t.onload=()=>r(!0),t.onerror=()=>r(!1),t.src=`https://api.iconify.design/${e.replace(`:`,`/`)}.svg`},[e]),(0,Q.jsxs)(`span`,{className:`brand-icon-wrap`,children:[(0,Q.jsx)(`span`,{className:`brand-icon-fallback ${n?`hidden`:``}`,children:t}),(0,Q.jsx)(`span`,{className:`brand-icon-real ${n?`visible`:``}`,children:(0,Q.jsx)(ht,{icon:e,width:20,height:20})})]})}function vt(){let{t:e,formatNumber:t}=a(),[n,r]=(0,S.useState)(new Map),[i,o]=(0,S.useState)(!1),s=(0,S.useRef)(new Map);(0,S.useEffect)(()=>{document.title=e(`ping.meta.title`)},[e]);let c=(0,S.useCallback)(e=>{r(t=>{let n=new Map(t);return n.set(e,{status:`pending`,latency:0}),n});let t=new AbortController;s.current.set(e,t);let n=performance.now(),i=(t,n)=>{r(r=>{let i=new Map(r);return i.set(e,{status:t,latency:n}),i})},a=setTimeout(()=>{t.abort()},gt);fetch(`https://${e}/`,{method:`HEAD`,mode:`no-cors`,cache:`no-store`,signal:t.signal}).then(()=>{clearTimeout(a),i(`ok`,Math.round(performance.now()-n))}).catch(()=>{clearTimeout(a),i(`timeout`,0)})},[]),l=(0,S.useCallback)(()=>{o(!0);let e=new Map;$.forEach(t=>{e.set(t.host,{status:`pending`,latency:0})}),r(e);let t=new Set($.map(e=>e.host));$.forEach(e=>{let n=new AbortController;s.current.set(e.host,n);let i=performance.now(),a=(n,i)=>{t.has(e.host)&&(t.delete(e.host),r(t=>{let r=new Map(t);return r.set(e.host,{status:n,latency:i}),r}),t.size===0&&o(!1))},c=setTimeout(()=>{n.abort()},gt);fetch(`https://${e.host}/`,{method:`HEAD`,mode:`no-cors`,cache:`no-store`,signal:n.signal}).then(()=>{clearTimeout(c),a(`ok`,Math.round(performance.now()-i))}).catch(()=>{clearTimeout(c),a(`timeout`,0)})})},[]);return(0,S.useEffect)(()=>(l(),()=>{s.current.forEach(e=>e.abort()),s.current.clear()}),[l]),(0,Q.jsxs)(`div`,{className:`ping-page`,children:[(0,Q.jsxs)(`div`,{className:`ping-header`,children:[(0,Q.jsxs)(`div`,{className:`ping-title-wrap`,children:[(0,Q.jsx)(p,{size:28,className:`ping-title-icon`}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h1`,{className:`ping-title`,children:e(`ping.title`)}),(0,Q.jsx)(`p`,{className:`ping-subtitle`,children:e(`ping.subtitle`)})]})]}),(0,Q.jsx)(`button`,{className:`btn btn-icon`,onClick:l,disabled:i,"aria-label":e(`ping.retryAll`),title:e(`ping.retryAll`),children:(0,Q.jsx)(x,{size:18,className:i?`ping-spin`:``})})]}),(0,Q.jsx)(`div`,{className:`ping-grid`,children:$.map(r=>{let i=n.get(r.host),a=!i||i.status===`pending`,o=i?.status===`timeout`;return(0,Q.jsxs)(`div`,{className:`ping-card ${a?`pending`:``}`,children:[(0,Q.jsxs)(`div`,{className:`ping-card-top`,children:[(0,Q.jsx)(`span`,{className:`ping-card-icon`,children:(0,Q.jsx)(_t,{icon:r.icon,fallback:r.fallback})}),(0,Q.jsx)(`a`,{href:`https://${r.host}`,target:`_blank`,rel:`noreferrer`,className:`ping-card-name`,children:r.name}),(0,Q.jsx)(`button`,{className:`ping-card-refresh`,onClick:()=>c(r.host),disabled:a,"aria-label":e(`ping.retryOne`,{name:r.name}),title:e(`ping.retry`),children:(0,Q.jsx)(x,{size:13,className:a?`ping-spin`:``})})]}),(0,Q.jsxs)(`div`,{className:`ping-card-bottom`,children:[a?(0,Q.jsx)(`span`,{className:`ping-pulse-dot`}):(0,Q.jsx)(`span`,{className:`ping-status-label ${o?`is-error`:`is-success`}`,children:e(o?`ping.unavailable`:`ping.available`)}),(0,Q.jsx)(`span`,{className:`ping-latency ${a?`is-muted`:o?`is-error`:`is-success`}`,children:a?`--`:o?e(`ping.timeout`):`${t(i.latency)} ms`})]})]},r.host)})})]})}function yt(){return(0,Q.jsx)(m,{children:(0,Q.jsx)(vt,{})})}var bt=i(`/ping/`)({component:yt});export{bt as Route};
1
+ import{n as e,o as t,t as n}from"./jsx-runtime-Bt-cYkS5.js";import{C as r,T as i}from"./ui-BpDGD3IR.js";import{a}from"./i18n-NjvOSuV6.js";import{n as o,t as s}from"./smartphone-tRRFFO0a.js";import{t as c}from"./message-square-Dp09WY1I.js";import{t as l}from"./music-B19Tg557.js";import{t as u}from"./play-B-BjsTZz.js";import{t as d}from"./search-DSkiWdvX.js";import{t as f}from"./send-BL4d5iOt.js";import{t as p}from"./wifi-Bgo8eHY0.js";import{t as m}from"./MarketingLayout-A00pEOa2.js";var h=r(`at-sign`,[[`circle`,{cx:`12`,cy:`12`,r:`4`,key:`4exip2`}],[`path`,{d:`M16 8v5a3 3 0 0 0 6 0v-1a10 10 0 1 0-4 8`,key:`7n84p3`}]]),g=r(`book-open`,[[`path`,{d:`M12 7v14`,key:`1akyts`}],[`path`,{d:`M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z`,key:`ruj8y`}]]),_=r(`bot`,[[`path`,{d:`M12 8V4H8`,key:`hb8ula`}],[`rect`,{width:`16`,height:`12`,x:`4`,y:`8`,rx:`2`,key:`enze0r`}],[`path`,{d:`M2 14h2`,key:`vft8re`}],[`path`,{d:`M20 14h2`,key:`4cs60a`}],[`path`,{d:`M15 13v2`,key:`1xurst`}],[`path`,{d:`M9 13v2`,key:`rq6x2g`}]]),v=r(`camera`,[[`path`,{d:`M13.997 4a2 2 0 0 1 1.76 1.05l.486.9A2 2 0 0 0 18.003 7H20a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V9a2 2 0 0 1 2-2h1.997a2 2 0 0 0 1.759-1.048l.489-.904A2 2 0 0 1 10.004 4z`,key:`18u6gg`}],[`circle`,{cx:`12`,cy:`13`,r:`3`,key:`1vg3eu`}]]),y=r(`messages-square`,[[`path`,{d:`M16 10a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 14.286V4a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z`,key:`1n2ejm`}],[`path`,{d:`M20 9a2 2 0 0 1 2 2v10.286a.71.71 0 0 1-1.212.502l-2.202-2.202A2 2 0 0 0 17.172 19H10a2 2 0 0 1-2-2v-1`,key:`1qfcsi`}]]),b=r(`package`,[[`path`,{d:`M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z`,key:`1a0edw`}],[`path`,{d:`M12 22V12`,key:`d0xqtd`}],[`polyline`,{points:`3.29 7 12 12 20.71 7`,key:`ousv84`}],[`path`,{d:`m7.5 4.27 9 5.15`,key:`1c824w`}]]),x=r(`rotate-cw`,[[`path`,{d:`M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8`,key:`1p45f6`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}]]),ee=r(`terminal`,[[`path`,{d:`M12 19h8`,key:`baeox8`}],[`path`,{d:`m4 17 6-6-6-6`,key:`1yngyt`}]]),te=r(`triangle`,[[`path`,{d:`M13.73 4a2 2 0 0 0-3.46 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z`,key:`14u9p9`}]]),S=t(e(),1);function ne(e,t){let n=e.icons,r=e.aliases||Object.create(null),i=Object.create(null);function a(e){if(n[e])return i[e]=[];if(!(e in i)){i[e]=null;let t=r[e]&&r[e].parent,n=t&&a(t);n&&(i[e]=[t].concat(n))}return i[e]}return Object.keys(n).concat(Object.keys(r)).forEach(a),i}var re=Object.freeze({left:0,top:0,width:16,height:16}),C=Object.freeze({rotate:0,vFlip:!1,hFlip:!1}),w=Object.freeze({...re,...C}),T=Object.freeze({...w,body:``,hidden:!1});function ie(e,t){let n={};!e.hFlip!=!t.hFlip&&(n.hFlip=!0),!e.vFlip!=!t.vFlip&&(n.vFlip=!0);let r=((e.rotate||0)+(t.rotate||0))%4;return r&&(n.rotate=r),n}function E(e,t){let n=ie(e,t);for(let r in T)r in C?r in e&&!(r in n)&&(n[r]=C[r]):r in t?n[r]=t[r]:r in e&&(n[r]=e[r]);return n}function ae(e,t,n){let r=e.icons,i=e.aliases||Object.create(null),a={};function o(e){a=E(r[e]||i[e],a)}return o(t),n.forEach(o),E(e,a)}function oe(e,t){let n=[];if(typeof e!=`object`||typeof e.icons!=`object`)return n;e.not_found instanceof Array&&e.not_found.forEach(e=>{t(e,null),n.push(e)});let r=ne(e);for(let i in r){let a=r[i];a&&(t(i,ae(e,i,a)),n.push(i))}return n}var se={provider:``,aliases:{},not_found:{},...re};function D(e,t){for(let n in t)if(n in e&&typeof e[n]!=typeof t[n])return!1;return!0}function O(e){if(typeof e!=`object`||!e)return null;let t=e;if(typeof t.prefix!=`string`||!e.icons||typeof e.icons!=`object`||!D(e,se))return null;let n=t.icons;for(let e in n){let t=n[e];if(!e||typeof t.body!=`string`||!D(t,T))return null}let r=t.aliases||Object.create(null);for(let e in r){let t=r[e],i=t.parent;if(!e||typeof i!=`string`||!n[i]&&!r[i]||!D(t,T))return null}return t}var k=Object.create(null);function ce(e,t){return{provider:e,prefix:t,icons:Object.create(null),missing:new Set}}function A(e,t){let n=k[e]||(k[e]=Object.create(null));return n[t]||(n[t]=ce(e,t))}function le(e,t){return O(t)?oe(t,(t,n)=>{n?e.icons[t]=n:e.missing.add(t)}):[]}function ue(e,t,n){try{if(typeof n.body==`string`)return e.icons[t]={...n},!0}catch{}return!1}var de=/^[a-z0-9]+(-[a-z0-9]+)*$/,j=(e,t,n,r=``)=>{let i=e.split(`:`);if(e.slice(0,1)===`@`){if(i.length<2||i.length>3)return null;r=i.shift().slice(1)}if(i.length>3||!i.length)return null;if(i.length>1){let e=i.pop(),n=i.pop(),a={provider:i.length>0?i[0]:r,prefix:n,name:e};return t&&!M(a)?null:a}let a=i[0],o=a.split(`-`);if(o.length>1){let e={provider:r,prefix:o.shift(),name:o.join(`-`)};return t&&!M(e)?null:e}if(n&&r===``){let e={provider:r,prefix:``,name:a};return t&&!M(e,n)?null:e}return null},M=(e,t)=>e?!!((t&&e.prefix===``||e.prefix)&&e.name):!1,N=!1;function P(e){return typeof e==`boolean`&&(N=e),N}function F(e){let t=typeof e==`string`?j(e,!0,N):e;if(t){let e=A(t.provider,t.prefix),n=t.name;return e.icons[n]||(e.missing.has(n)?null:void 0)}}function fe(e,t){let n=j(e,!0,N);if(!n)return!1;let r=A(n.provider,n.prefix);return t?ue(r,n.name,t):(r.missing.add(n.name),!0)}function pe(e,t){if(typeof e!=`object`)return!1;if(typeof t!=`string`&&(t=e.provider||``),N&&!t&&!e.prefix){let t=!1;return O(e)&&(e.prefix=``,oe(e,(e,n)=>{fe(e,n)&&(t=!0)})),t}let n=e.prefix;return M({prefix:n,name:`a`})?!!le(A(t,n),e):!1}var I=Object.freeze({width:null,height:null}),L=Object.freeze({...I,...C}),me=/(-?[0-9.]*[0-9]+[0-9.]*)/g,he=/^-?[0-9.]*[0-9]+[0-9.]*$/g;function R(e,t,n){if(t===1)return e;if(n||=100,typeof e==`number`)return Math.ceil(e*t*n)/n;if(typeof e!=`string`)return e;let r=e.split(me);if(r===null||!r.length)return e;let i=[],a=r.shift(),o=he.test(a);for(;;){if(o){let e=parseFloat(a);isNaN(e)?i.push(a):i.push(Math.ceil(e*t*n)/n)}else i.push(a);if(a=r.shift(),a===void 0)return i.join(``);o=!o}}function ge(e,t=`defs`){let n=``,r=e.indexOf(`<`+t);for(;r>=0;){let i=e.indexOf(`>`,r),a=e.indexOf(`</`+t);if(i===-1||a===-1)break;let o=e.indexOf(`>`,a);if(o===-1)break;n+=e.slice(i+1,a).trim(),e=e.slice(0,r).trim()+e.slice(o+1)}return{defs:n,content:e}}function _e(e,t){return e?`<defs>`+e+`</defs>`+t:t}function ve(e,t,n){let r=ge(e);return _e(r.defs,t+r.content+n)}var ye=e=>e===`unset`||e===`undefined`||e===`none`;function be(e,t){let n={...w,...e},r={...L,...t},i={left:n.left,top:n.top,width:n.width,height:n.height},a=n.body;[n,r].forEach(e=>{let t=[],n=e.hFlip,r=e.vFlip,o=e.rotate;n?r?o+=2:(t.push(`translate(`+(i.width+i.left).toString()+` `+(0-i.top).toString()+`)`),t.push(`scale(-1 1)`),i.top=i.left=0):r&&(t.push(`translate(`+(0-i.left).toString()+` `+(i.height+i.top).toString()+`)`),t.push(`scale(1 -1)`),i.top=i.left=0);let s;switch(o<0&&(o-=Math.floor(o/4)*4),o%=4,o){case 1:s=i.height/2+i.top,t.unshift(`rotate(90 `+s.toString()+` `+s.toString()+`)`);break;case 2:t.unshift(`rotate(180 `+(i.width/2+i.left).toString()+` `+(i.height/2+i.top).toString()+`)`);break;case 3:s=i.width/2+i.left,t.unshift(`rotate(-90 `+s.toString()+` `+s.toString()+`)`);break}o%2==1&&(i.left!==i.top&&(s=i.left,i.left=i.top,i.top=s),i.width!==i.height&&(s=i.width,i.width=i.height,i.height=s)),t.length&&(a=ve(a,`<g transform="`+t.join(` `)+`">`,`</g>`))});let o=r.width,s=r.height,c=i.width,l=i.height,u,d;o===null?(d=s===null?`1em`:s===`auto`?l:s,u=R(d,c/l)):(u=o===`auto`?c:o,d=s===null?R(u,l/c):s===`auto`?l:s);let f={},p=(e,t)=>{ye(t)||(f[e]=t.toString())};p(`width`,u),p(`height`,d);let m=[i.left,i.top,c,l];return f.viewBox=m.join(` `),{attributes:f,viewBox:m,body:a}}var xe=/\sid="(\S+)"/g,Se=`IconifyId`+Date.now().toString(16)+(Math.random()*16777216|0).toString(16),Ce=0;function we(e,t=Se){let n=[],r;for(;r=xe.exec(e);)n.push(r[1]);if(!n.length)return e;let i=`suffix`+(Math.random()*16777216|Date.now()).toString(16);return n.forEach(n=>{let r=typeof t==`function`?t(n):t+(Ce++).toString(),a=n.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`);e=e.replace(RegExp(`([#;"])(`+a+`)([")]|\\.[a-z])`,`g`),`$1`+r+i+`$3`)}),e=e.replace(new RegExp(i,`g`),``),e}var z=Object.create(null);function Te(e,t){z[e]=t}function B(e){return z[e]||z[``]}function V(e){let t;if(typeof e.resources==`string`)t=[e.resources];else if(t=e.resources,!(t instanceof Array)||!t.length)return null;return{resources:t,path:e.path||`/`,maxURL:e.maxURL||500,rotate:e.rotate||750,timeout:e.timeout||5e3,random:e.random===!0,index:e.index||0,dataAfterTimeout:e.dataAfterTimeout!==!1}}for(var H=Object.create(null),U=[`https://api.simplesvg.com`,`https://api.unisvg.com`],W=[];U.length>0;)U.length===1||Math.random()>.5?W.push(U.shift()):W.push(U.pop());H[``]=V({resources:[`https://api.iconify.design`].concat(W)});function Ee(e,t){let n=V(t);return n===null?!1:(H[e]=n,!0)}function G(e){return H[e]}var K=(()=>{let e;try{if(e=fetch,typeof e==`function`)return e}catch{}})();function De(e,t){let n=G(e);if(!n)return 0;let r;if(!n.maxURL)r=0;else{let e=0;n.resources.forEach(t=>{e=Math.max(e,t.length)});let i=t+`.json?icons=`;r=n.maxURL-e-n.path.length-i.length}return r}function Oe(e){return e===404}var ke=(e,t,n)=>{let r=[],i=De(e,t),a=`icons`,o={type:a,provider:e,prefix:t,icons:[]},s=0;return n.forEach((n,c)=>{s+=n.length+1,s>=i&&c>0&&(r.push(o),o={type:a,provider:e,prefix:t,icons:[]},s=n.length),o.icons.push(n)}),r.push(o),r};function Ae(e){if(typeof e==`string`){let t=G(e);if(t)return t.path}return`/`}var je={prepare:ke,send:(e,t,n)=>{if(!K){n(`abort`,424);return}let r=Ae(t.provider);switch(t.type){case`icons`:{let e=t.prefix,n=t.icons.join(`,`),i=new URLSearchParams({icons:n});r+=e+`.json?`+i.toString();break}case`custom`:{let e=t.uri;r+=e.slice(0,1)===`/`?e.slice(1):e;break}default:n(`abort`,400);return}let i=503;K(e+r).then(e=>{let t=e.status;if(t!==200){setTimeout(()=>{n(Oe(t)?`abort`:`next`,t)});return}return i=501,e.json()}).then(e=>{if(typeof e!=`object`||!e){setTimeout(()=>{e===404?n(`abort`,e):n(`next`,i)});return}setTimeout(()=>{n(`success`,e)})}).catch(()=>{n(`next`,i)})}};function q(e,t){e.forEach(e=>{let n=e.loaderCallbacks;n&&(e.loaderCallbacks=n.filter(e=>e.id!==t))})}function Me(e){e.pendingCallbacksFlag||(e.pendingCallbacksFlag=!0,setTimeout(()=>{e.pendingCallbacksFlag=!1;let t=e.loaderCallbacks?e.loaderCallbacks.slice(0):[];if(!t.length)return;let n=!1,r=e.provider,i=e.prefix;t.forEach(t=>{let a=t.icons,o=a.pending.length;a.pending=a.pending.filter(t=>{if(t.prefix!==i)return!0;let o=t.name;if(e.icons[o])a.loaded.push({provider:r,prefix:i,name:o});else if(e.missing.has(o))a.missing.push({provider:r,prefix:i,name:o});else return n=!0,!0;return!1}),a.pending.length!==o&&(n||q([e],t.id),t.callback(a.loaded.slice(0),a.missing.slice(0),a.pending.slice(0),t.abort))})}))}var Ne=0;function Pe(e,t,n){let r=Ne++,i=q.bind(null,n,r);if(!t.pending.length)return i;let a={id:r,icons:t,callback:e,abort:i};return n.forEach(e=>{(e.loaderCallbacks||=[]).push(a)}),i}function Fe(e){let t={loaded:[],missing:[],pending:[]},n=Object.create(null);e.sort((e,t)=>e.provider===t.provider?e.prefix===t.prefix?e.name.localeCompare(t.name):e.prefix.localeCompare(t.prefix):e.provider.localeCompare(t.provider));let r={provider:``,prefix:``,name:``};return e.forEach(e=>{if(r.name===e.name&&r.prefix===e.prefix&&r.provider===e.provider)return;r=e;let i=e.provider,a=e.prefix,o=e.name,s=n[i]||(n[i]=Object.create(null)),c=s[a]||(s[a]=A(i,a)),l;l=o in c.icons?t.loaded:a===``||c.missing.has(o)?t.missing:t.pending;let u={provider:i,prefix:a,name:o};l.push(u)}),t}function Ie(e,t=!0,n=!1){let r=[];return e.forEach(e=>{let i=typeof e==`string`?j(e,t,n):e;i&&r.push(i)}),r}var Le={resources:[],index:0,timeout:2e3,rotate:750,random:!1,dataAfterTimeout:!1};function Re(e,t,n,r){let i=e.resources.length,a=e.random?Math.floor(Math.random()*i):e.index,o;if(e.random){let t=e.resources.slice(0);for(o=[];t.length>1;){let e=Math.floor(Math.random()*t.length);o.push(t[e]),t=t.slice(0,e).concat(t.slice(e+1))}o=o.concat(t)}else o=e.resources.slice(a).concat(e.resources.slice(0,a));let s=Date.now(),c=`pending`,l=0,u,d=null,f=[],p=[];typeof r==`function`&&p.push(r);function m(){d&&=(clearTimeout(d),null)}function h(){c===`pending`&&(c=`aborted`),m(),f.forEach(e=>{e.status===`pending`&&(e.status=`aborted`)}),f=[]}function g(e,t){t&&(p=[]),typeof e==`function`&&p.push(e)}function _(){return{startTime:s,payload:t,status:c,queriesSent:l,queriesPending:f.length,subscribe:g,abort:h}}function v(){c=`failed`,p.forEach(e=>{e(void 0,u)})}function y(){f.forEach(e=>{e.status===`pending`&&(e.status=`aborted`)}),f=[]}function b(t,n,r){let i=n!==`success`;switch(f=f.filter(e=>e!==t),c){case`pending`:break;case`failed`:if(i||!e.dataAfterTimeout)return;break;default:return}if(n===`abort`){u=r,v();return}if(i){u=r,f.length||(o.length?x():v());return}if(m(),y(),!e.random){let n=e.resources.indexOf(t.resource);n!==-1&&n!==e.index&&(e.index=n)}c=`completed`,p.forEach(e=>{e(r)})}function x(){if(c!==`pending`)return;m();let r=o.shift();if(r===void 0){if(f.length){d=setTimeout(()=>{m(),c===`pending`&&(y(),v())},e.timeout);return}v();return}let i={status:`pending`,resource:r,callback:(e,t)=>{b(i,e,t)}};f.push(i),l++,d=setTimeout(x,e.rotate),n(r,t,i.callback)}return setTimeout(x),_}function ze(e){let t={...Le,...e},n=[];function r(){n=n.filter(e=>e().status===`pending`)}function i(e,i,a){let o=Re(t,e,i,(e,t)=>{r(),a&&a(e,t)});return n.push(o),o}function a(e){return n.find(t=>e(t))||null}return{query:i,find:a,setIndex:e=>{t.index=e},getIndex:()=>t.index,cleanup:r}}function Be(){}var J=Object.create(null);function Ve(e){if(!J[e]){let t=G(e);if(!t)return;J[e]={config:t,redundancy:ze(t)}}return J[e]}function He(e,t,n){let r,i;if(typeof e==`string`){let t=B(e);if(!t)return n(void 0,424),Be;i=t.send;let a=Ve(e);a&&(r=a.redundancy)}else{let t=V(e);if(t){r=ze(t);let n=B(e.resources?e.resources[0]:``);n&&(i=n.send)}}return!r||!i?(n(void 0,424),Be):r.query(t,i,n)().abort}function Ue(){}function We(e){e.iconsLoaderFlag||(e.iconsLoaderFlag=!0,setTimeout(()=>{e.iconsLoaderFlag=!1,Me(e)}))}function Ge(e){let t=[],n=[];return e.forEach(e=>{(e.match(de)?t:n).push(e)}),{valid:t,invalid:n}}function Y(e,t,n){function r(){let n=e.pendingIcons;t.forEach(t=>{n&&n.delete(t),e.icons[t]||e.missing.add(t)})}if(n&&typeof n==`object`)try{if(!le(e,n).length){r();return}}catch(e){console.error(e)}r(),We(e)}function Ke(e,t){e instanceof Promise?e.then(e=>{t(e)}).catch(()=>{t(null)}):t(e)}function qe(e,t){e.iconsToLoad?e.iconsToLoad=e.iconsToLoad.concat(t).sort():e.iconsToLoad=t,e.iconsQueueFlag||(e.iconsQueueFlag=!0,setTimeout(()=>{e.iconsQueueFlag=!1;let{provider:t,prefix:n}=e,r=e.iconsToLoad;if(delete e.iconsToLoad,!r||!r.length)return;let i=e.loadIcon;if(e.loadIcons&&(r.length>1||!i)){Ke(e.loadIcons(r,n,t),t=>{Y(e,r,t)});return}if(i){r.forEach(r=>{Ke(i(r,n,t),t=>{Y(e,[r],t?{prefix:n,icons:{[r]:t}}:null)})});return}let{valid:a,invalid:o}=Ge(r);if(o.length&&Y(e,o,null),!a.length)return;let s=n.match(de)?B(t):null;if(!s){Y(e,a,null);return}s.prepare(t,n,a).forEach(n=>{He(t,n,t=>{Y(e,n.icons,t)})})}))}var Je=(e,t)=>{let n=Fe(Ie(e,!0,P()));if(!n.pending.length){let e=!0;return t&&setTimeout(()=>{e&&t(n.loaded,n.missing,n.pending,Ue)}),()=>{e=!1}}let r=Object.create(null),i=[],a,o;return n.pending.forEach(e=>{let{provider:t,prefix:n}=e;if(n===o&&t===a)return;a=t,o=n,i.push(A(t,n));let s=r[t]||(r[t]=Object.create(null));s[n]||(s[n]=[])}),n.pending.forEach(e=>{let{provider:t,prefix:n,name:i}=e,a=A(t,n),o=a.pendingIcons||=new Set;o.has(i)||(o.add(i),r[t][n].push(i))}),i.forEach(e=>{let t=r[e.provider][e.prefix];t.length&&qe(e,t)}),t?Pe(t,n,i):Ue};function Ye(e,t){let n={...e};for(let e in t){let r=t[e],i=typeof r;e in I?(r===null||r&&(i===`string`||i===`number`))&&(n[e]=r):i===typeof n[e]&&(n[e]=e===`rotate`?r%4:r)}return n}var Xe=/[\s,]+/;function Ze(e,t){t.split(Xe).forEach(t=>{switch(t.trim()){case`horizontal`:e.hFlip=!0;break;case`vertical`:e.vFlip=!0;break}})}function Qe(e,t=0){let n=e.replace(/^-?[0-9.]*/,``);function r(e){for(;e<0;)e+=4;return e%4}if(n===``){let t=parseInt(e);return isNaN(t)?0:r(t)}else if(n!==e){let t=0;switch(n){case`%`:t=25;break;case`deg`:t=90}if(t){let i=parseFloat(e.slice(0,e.length-n.length));return isNaN(i)?0:(i/=t,i%1==0?r(i):0)}}return t}function $e(e,t){let n=e.indexOf(`xlink:`)===-1?``:` xmlns:xlink="http://www.w3.org/1999/xlink"`;for(let e in t)n+=` `+e+`="`+t[e]+`"`;return`<svg xmlns="http://www.w3.org/2000/svg"`+n+`>`+e+`</svg>`}function et(e){return e.replace(/"/g,`'`).replace(/%/g,`%25`).replace(/#/g,`%23`).replace(/</g,`%3C`).replace(/>/g,`%3E`).replace(/\s+/g,` `)}function tt(e){return`data:image/svg+xml,`+et(e)}function nt(e){return`url("`+tt(e)+`")`}var X;function rt(){try{X=window.trustedTypes.createPolicy(`iconify`,{createHTML:e=>e})}catch{X=null}}function it(e){return X===void 0&&rt(),X?X.createHTML(e):e}var at={...L,inline:!1},ot={xmlns:`http://www.w3.org/2000/svg`,xmlnsXlink:`http://www.w3.org/1999/xlink`,"aria-hidden":!0,role:`img`},st={display:`inline-block`},Z={backgroundColor:`currentColor`},ct={backgroundColor:`transparent`},lt={Image:`var(--svg)`,Repeat:`no-repeat`,Size:`100% 100%`},ut={WebkitMask:Z,mask:Z,background:ct};for(let e in ut){let t=ut[e];for(let n in lt)t[e+n]=lt[n]}var dt={...at,inline:!0};function ft(e){return e+(e.match(/^[-0-9.]+$/)?`px`:``)}var pt=(e,t,n)=>{let r=t.inline?dt:at,i=Ye(r,t),a=t.mode||`svg`,o={},s=t.style||{},c={...a===`svg`?ot:{}};if(n){let e=j(n,!1,!0);if(e){let t=[`iconify`];for(let n of[`provider`,`prefix`])e[n]&&t.push(`iconify--`+e[n]);c.className=t.join(` `)}}for(let e in t){let n=t[e];if(n!==void 0)switch(e){case`icon`:case`style`:case`children`:case`onLoad`:case`mode`:case`ssr`:case`fallback`:break;case`_ref`:c.ref=n;break;case`className`:c[e]=(c[e]?c[e]+` `:``)+n;break;case`inline`:case`hFlip`:case`vFlip`:i[e]=n===!0||n===`true`||n===1;break;case`flip`:typeof n==`string`&&Ze(i,n);break;case`color`:o.color=n;break;case`rotate`:typeof n==`string`?i[e]=Qe(n):typeof n==`number`&&(i[e]=n);break;case`ariaHidden`:case`aria-hidden`:n!==!0&&n!==`true`&&delete c[`aria-hidden`];break;default:r[e]===void 0&&(c[e]=n)}}let l=be(e,i),u=l.attributes;if(i.inline&&(o.verticalAlign=`-0.125em`),a===`svg`){c.style={...o,...s},Object.assign(c,u);let e=0,n=t.id;return typeof n==`string`&&(n=n.replace(/-/g,`_`)),c.dangerouslySetInnerHTML={__html:it(we(l.body,n?()=>n+`ID`+ e++:`iconifyReact`))},(0,S.createElement)(`svg`,c)}let{body:d,width:f,height:p}=e,m=a===`mask`||(a===`bg`?!1:d.indexOf(`currentColor`)!==-1),h=$e(d,{...u,width:f+``,height:p+``});return c.style={...o,"--svg":nt(h),width:ft(u.width),height:ft(u.height),...st,...m?Z:ct,...s},(0,S.createElement)(`span`,c)};if(P(!0),Te(``,je),typeof document<`u`&&typeof window<`u`){let e=window;if(e.IconifyPreload!==void 0){let t=e.IconifyPreload,n=`Invalid IconifyPreload syntax.`;typeof t==`object`&&t&&(t instanceof Array?t:[t]).forEach(e=>{try{(typeof e!=`object`||!e||e instanceof Array||typeof e.icons!=`object`||typeof e.prefix!=`string`||!pe(e))&&console.error(n)}catch{console.error(n)}})}if(e.IconifyProviders!==void 0){let t=e.IconifyProviders;if(typeof t==`object`&&t)for(let e in t){let n=`IconifyProviders[`+e+`] is invalid.`;try{let r=t[e];if(typeof r!=`object`||!r||r.resources===void 0)continue;Ee(e,r)||console.error(n)}catch{console.error(n)}}}}function mt(e){let[t,n]=(0,S.useState)(!!e.ssr),[r,i]=(0,S.useState)({});function a(t){if(t){let t=e.icon;if(typeof t==`object`)return{name:``,data:t};let n=F(t);if(n)return{name:t,data:n}}return{name:``}}let[o,s]=(0,S.useState)(a(!!e.ssr));function c(){let e=r.callback;e&&(e(),i({}))}function l(e){if(JSON.stringify(o)!==JSON.stringify(e))return c(),s(e),!0}function u(){var t;let n=e.icon;if(typeof n==`object`){l({name:``,data:n});return}let r=F(n);l({name:n,data:r})&&(r===void 0?i({callback:Je([n],u)}):r&&((t=e.onLoad)==null||t.call(e,n)))}(0,S.useEffect)(()=>(n(!0),c),[]),(0,S.useEffect)(()=>{t&&u()},[e.icon,t]);let{name:d,data:f}=o;return f?pt({...w,...f},e,d):e.children?e.children:e.fallback?e.fallback:(0,S.createElement)(`span`,{})}var ht=(0,S.forwardRef)((e,t)=>mt({...e,_ref:t}));(0,S.forwardRef)((e,t)=>mt({inline:!0,...e,_ref:t}));var Q=n(),$=[{name:`Google`,host:`google.com`,icon:`simple-icons:google`,fallback:(0,Q.jsx)(d,{size:20})},{name:`Cloudflare`,host:`cloudflare.com`,icon:`simple-icons:cloudflare`,fallback:(0,Q.jsx)(o,{size:20})},{name:`YouTube`,host:`youtube.com`,icon:`simple-icons:youtube`,fallback:(0,Q.jsx)(u,{size:20})},{name:`GitHub`,host:`github.com`,icon:`simple-icons:github`,fallback:(0,Q.jsx)(ee,{size:20})},{name:`ChatGPT`,host:`chatgpt.com`,icon:`simple-icons:openai`,fallback:(0,Q.jsx)(_,{size:20})},{name:`X`,host:`x.com`,icon:`simple-icons:x`,fallback:(0,Q.jsx)(h,{size:20})},{name:`Instagram`,host:`instagram.com`,icon:`simple-icons:instagram`,fallback:(0,Q.jsx)(v,{size:20})},{name:`Reddit`,host:`reddit.com`,icon:`simple-icons:reddit`,fallback:(0,Q.jsx)(c,{size:20})},{name:`Wikipedia`,host:`wikipedia.org`,icon:`simple-icons:wikipedia`,fallback:(0,Q.jsx)(g,{size:20})},{name:`Apple`,host:`apple.com`,icon:`simple-icons:apple`,fallback:(0,Q.jsx)(s,{size:20})},{name:`Telegram`,host:`telegram.org`,icon:`simple-icons:telegram`,fallback:(0,Q.jsx)(f,{size:20})},{name:`Discord`,host:`discord.com`,icon:`simple-icons:discord`,fallback:(0,Q.jsx)(y,{size:20})},{name:`TikTok`,host:`tiktok.com`,icon:`simple-icons:tiktok`,fallback:(0,Q.jsx)(l,{size:20})},{name:`npm`,host:`npmjs.com`,icon:`simple-icons:npm`,fallback:(0,Q.jsx)(b,{size:20})},{name:`Vercel`,host:`vercel.com`,icon:`simple-icons:vercel`,fallback:(0,Q.jsx)(te,{size:20})}],gt=5e3;function _t({icon:e,fallback:t}){let[n,r]=(0,S.useState)(!1);return(0,S.useEffect)(()=>{let t=new Image;t.onload=()=>r(!0),t.onerror=()=>r(!1),t.src=`https://api.iconify.design/${e.replace(`:`,`/`)}.svg`},[e]),(0,Q.jsxs)(`span`,{className:`brand-icon-wrap`,children:[(0,Q.jsx)(`span`,{className:`brand-icon-fallback ${n?`hidden`:``}`,children:t}),(0,Q.jsx)(`span`,{className:`brand-icon-real ${n?`visible`:``}`,children:(0,Q.jsx)(ht,{icon:e,width:20,height:20})})]})}function vt(){let{t:e,formatNumber:t}=a(),[n,r]=(0,S.useState)(new Map),[i,o]=(0,S.useState)(!1),s=(0,S.useRef)(new Map);(0,S.useEffect)(()=>{document.title=e(`ping.meta.title`)},[e]);let c=(0,S.useCallback)(e=>{r(t=>{let n=new Map(t);return n.set(e,{status:`pending`,latency:0}),n});let t=new AbortController;s.current.set(e,t);let n=performance.now(),i=(t,n)=>{r(r=>{let i=new Map(r);return i.set(e,{status:t,latency:n}),i})},a=setTimeout(()=>{t.abort()},gt);fetch(`https://${e}/`,{method:`HEAD`,mode:`no-cors`,cache:`no-store`,signal:t.signal}).then(()=>{clearTimeout(a),i(`ok`,Math.round(performance.now()-n))}).catch(()=>{clearTimeout(a),i(`timeout`,0)})},[]),l=(0,S.useCallback)(()=>{o(!0);let e=new Map;$.forEach(t=>{e.set(t.host,{status:`pending`,latency:0})}),r(e);let t=new Set($.map(e=>e.host));$.forEach(e=>{let n=new AbortController;s.current.set(e.host,n);let i=performance.now(),a=(n,i)=>{t.has(e.host)&&(t.delete(e.host),r(t=>{let r=new Map(t);return r.set(e.host,{status:n,latency:i}),r}),t.size===0&&o(!1))},c=setTimeout(()=>{n.abort()},gt);fetch(`https://${e.host}/`,{method:`HEAD`,mode:`no-cors`,cache:`no-store`,signal:n.signal}).then(()=>{clearTimeout(c),a(`ok`,Math.round(performance.now()-i))}).catch(()=>{clearTimeout(c),a(`timeout`,0)})})},[]);return(0,S.useEffect)(()=>(l(),()=>{s.current.forEach(e=>e.abort()),s.current.clear()}),[l]),(0,Q.jsxs)(`div`,{className:`ping-page`,children:[(0,Q.jsxs)(`div`,{className:`ping-header`,children:[(0,Q.jsxs)(`div`,{className:`ping-title-wrap`,children:[(0,Q.jsx)(p,{size:28,className:`ping-title-icon`}),(0,Q.jsxs)(`div`,{children:[(0,Q.jsx)(`h1`,{className:`ping-title`,children:e(`ping.title`)}),(0,Q.jsx)(`p`,{className:`ping-subtitle`,children:e(`ping.subtitle`)})]})]}),(0,Q.jsx)(`button`,{className:`btn btn-icon`,onClick:l,disabled:i,"aria-label":e(`ping.retryAll`),title:e(`ping.retryAll`),children:(0,Q.jsx)(x,{size:18,className:i?`ping-spin`:``})})]}),(0,Q.jsx)(`div`,{className:`ping-grid`,children:$.map(r=>{let i=n.get(r.host),a=!i||i.status===`pending`,o=i?.status===`timeout`;return(0,Q.jsxs)(`div`,{className:`ping-card ${a?`pending`:``}`,children:[(0,Q.jsxs)(`div`,{className:`ping-card-top`,children:[(0,Q.jsx)(`span`,{className:`ping-card-icon`,children:(0,Q.jsx)(_t,{icon:r.icon,fallback:r.fallback})}),(0,Q.jsx)(`a`,{href:`https://${r.host}`,target:`_blank`,rel:`noreferrer`,className:`ping-card-name`,children:r.name}),(0,Q.jsx)(`button`,{className:`ping-card-refresh`,onClick:()=>c(r.host),disabled:a,"aria-label":e(`ping.retryOne`,{name:r.name}),title:e(`ping.retry`),children:(0,Q.jsx)(x,{size:13,className:a?`ping-spin`:``})})]}),(0,Q.jsxs)(`div`,{className:`ping-card-bottom`,children:[a?(0,Q.jsx)(`span`,{className:`ping-pulse-dot`}):(0,Q.jsx)(`span`,{className:`ping-status-label ${o?`is-error`:`is-success`}`,children:e(o?`ping.unavailable`:`ping.available`)}),(0,Q.jsx)(`span`,{className:`ping-latency ${a?`is-muted`:o?`is-error`:`is-success`}`,children:a?`--`:o?e(`ping.timeout`):`${t(i.latency)} ms`})]})]},r.host)})})]})}function yt(){return(0,Q.jsx)(m,{children:(0,Q.jsx)(vt,{})})}var bt=i(`/ping/`)({component:yt});export{bt as Route};
@@ -1,2 +1,2 @@
1
- import{n as e,o as t,r as n,t as r}from"./jsx-runtime-Bt-cYkS5.js";import{C as i,T as a}from"./ui-BpDGD3IR.js";import{a as o}from"./i18n-NjvOSuV6.js";import{t as s}from"./download-jEPn2njL.js";import{t as c}from"./file-text-DPA1riJ_.js";import{t as l}from"./hard-drive-Dar_AZEq.js";import{n as u,t as d}from"./triangle-alert-DGWc8ZHu.js";import{t as f}from"./save-BjrbPwhJ.js";import{t as ee}from"./shield-check-DzDuWO8r.js";import{t as p}from"./trash-2-V12tJ8lI.js";import{t as m}from"./wifi-Bgo8eHY0.js";import{F as h,M as g,_,c as v,f as y,g as te,l as b}from"./index-BZ-f0CZd.js";import{t as x}from"./dayjs.min-Dcc0B6Je.js";import{t as ne}from"./MarketingHeader-CrYsQsQ5.js";import{t as S}from"./format-CR8oUWq6.js";var re=i(`activity`,[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]),ie=i(`clipboard`,[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`,key:`116196`}]]),C=i(`database`,[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`,key:`msslwz`}],[`path`,{d:`M3 5V19A9 3 0 0 0 21 19V5`,key:`1wlel7`}],[`path`,{d:`M3 12A9 3 0 0 0 21 12`,key:`mv7ke4`}]]),w=n(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_relativeTime=r()})(e,(function(){return function(e,t,n){e||={};var r=t.prototype,i={future:`in %s`,past:`%s ago`,s:`a few seconds`,m:`a minute`,mm:`%d minutes`,h:`an hour`,hh:`%d hours`,d:`a day`,dd:`%d days`,M:`a month`,MM:`%d months`,y:`a year`,yy:`%d years`};function a(e,t,n,i){return r.fromToBase(e,t,n,i)}n.en.relativeTime=i,r.fromToBase=function(t,r,a,o,s){for(var c,l,u,d=a.$locale().relativeTime||i,f=e.thresholds||[{l:`s`,r:44,d:`second`},{l:`m`,r:89},{l:`mm`,r:44,d:`minute`},{l:`h`,r:89},{l:`hh`,r:21,d:`hour`},{l:`d`,r:35},{l:`dd`,r:25,d:`day`},{l:`M`,r:45},{l:`MM`,r:10,d:`month`},{l:`y`,r:17},{l:`yy`,d:`year`}],ee=f.length,p=0;p<ee;p+=1){var m=f[p];m.d&&(c=o?n(t).diff(a,m.d,!0):a.diff(t,m.d,!0));var h=(e.rounding||Math.round)(Math.abs(c));if(u=c>0,h<=m.r||!m.r){h<=1&&p>0&&(m=f[p-1]);var g=d[m.l];s&&(h=s(``+h)),l=typeof g==`string`?g.replace(`%d`,h):g(h,r,m.l,u);break}}if(r)return l;var _=u?d.future:d.past;return typeof _==`function`?_(l):_.replace(`%s`,l)},r.to=function(e,t){return a(e,t,this,!0)},r.from=function(e,t){return a(e,t,this)};var o=function(e){return e.$u?n.utc():n()};r.toNow=function(e){return this.to(o(this),e)},r.fromNow=function(e){return this.from(o(this),e)}}}))})),T=n(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r(x()):typeof define==`function`&&define.amd?define([`dayjs`],r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_locale_zh_cn=r(n.dayjs)})(e,(function(e){function t(e){return e&&typeof e==`object`&&`default`in e?e:{default:e}}var n=t(e),r={name:`zh-cn`,weekdays:`星期日_星期一_星期二_星期三_星期四_星期五_星期六`.split(`_`),weekdaysShort:`周日_周一_周二_周三_周四_周五_周六`.split(`_`),weekdaysMin:`日_一_二_三_四_五_六`.split(`_`),months:`一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月`.split(`_`),monthsShort:`1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月`.split(`_`),ordinal:function(e,t){return t===`W`?e+`周`:e+`日`},weekStart:1,yearStart:4,formats:{LT:`HH:mm`,LTS:`HH:mm:ss`,L:`YYYY/MM/DD`,LL:`YYYY年M月D日`,LLL:`YYYY年M月D日Ah点mm分`,LLLL:`YYYY年M月D日ddddAh点mm分`,l:`YYYY/M/D`,ll:`YYYY年M月D日`,lll:`YYYY年M月D日 HH:mm`,llll:`YYYY年M月D日dddd HH:mm`},relativeTime:{future:`%s内`,past:`%s前`,s:`几秒`,m:`1 分钟`,mm:`%d 分钟`,h:`1 小时`,hh:`%d 小时`,d:`1 天`,dd:`%d 天`,M:`1 个月`,MM:`%d 个月`,y:`1 年`,yy:`%d 年`},meridiem:function(e,t){var n=100*e+t;return n<600?`凌晨`:n<900?`早上`:n<1100?`上午`:n<1300?`中午`:n<1800?`下午`:`晚上`}};return n.default.locale(r,null,!0),r}))})),E=n(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r(x()):typeof define==`function`&&define.amd?define([`dayjs`],r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_locale_zh_tw=r(n.dayjs)})(e,(function(e){function t(e){return e&&typeof e==`object`&&`default`in e?e:{default:e}}var n=t(e),r={name:`zh-tw`,weekdays:`星期日_星期一_星期二_星期三_星期四_星期五_星期六`.split(`_`),weekdaysShort:`週日_週一_週二_週三_週四_週五_週六`.split(`_`),weekdaysMin:`日_一_二_三_四_五_六`.split(`_`),months:`一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月`.split(`_`),monthsShort:`1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月`.split(`_`),ordinal:function(e,t){return t===`W`?e+`週`:e+`日`},formats:{LT:`HH:mm`,LTS:`HH:mm:ss`,L:`YYYY/MM/DD`,LL:`YYYY年M月D日`,LLL:`YYYY年M月D日 HH:mm`,LLLL:`YYYY年M月D日dddd HH:mm`,l:`YYYY/M/D`,ll:`YYYY年M月D日`,lll:`YYYY年M月D日 HH:mm`,llll:`YYYY年M月D日dddd HH:mm`},relativeTime:{future:`%s內`,past:`%s前`,s:`幾秒`,m:`1 分鐘`,mm:`%d 分鐘`,h:`1 小時`,hh:`%d 小時`,d:`1 天`,dd:`%d 天`,M:`1 個月`,MM:`%d 個月`,y:`1 年`,yy:`%d 年`},meridiem:function(e,t){var n=100*e+t;return n<600?`凌晨`:n<900?`早上`:n<1100?`上午`:n<1300?`中午`:n<1800?`下午`:`晚上`}};return n.default.locale(r,null,!0),r}))})),D=t(e(),1),O=t(x(),1),k=t(w(),1);T(),E();var A=r();O.default.extend(k.default);var ae=null;function oe(e,t){let n=Math.max(0,Number(e)||0),r=Math.floor(n/86400),i=Math.floor(n%86400/3600),a=Math.floor(n%3600/60);return r>0?t(`admin.uptime.daysHours`,{days:r,hours:i}):i>0?t(`admin.uptime.hoursMinutes`,{hours:i,minutes:a}):t(`admin.uptime.minutes`,{minutes:a})}function j(e){return Number.isFinite(e)?String(Math.round(e/(1024*1024*1024)*100)/100):`0`}function M(e){let t=Number(e);return!Number.isFinite(t)||t<0?0:Math.round(t*1024*1024*1024)}function se(e){return Array.from(new Set(String(e||``).split(/[\n,]/).map(e=>e.trim()).filter(Boolean)))}function N(e,t=12,n=8){return e?e.length<=t+n+3?e:`${e.slice(0,t)}...${e.slice(-n)}`:`-`}function ce(e,t){switch(e.seedStatus){case`queued`:return t(`admin.seedStatus.queued`);case`joining`:return t(`admin.seedStatus.joining`);case`active`:return t(`admin.seedStatus.active`);case`paused`:return t(`admin.seedStatus.paused`);case`error`:return e.seedError?t(`admin.seedStatus.errorWithMessage`,{message:e.seedError}):t(`admin.seedStatus.error`);default:return e.joined?t(`admin.seedStatus.active`):t(`admin.seedStatus.notJoined`)}}function P(e){return{"zh-CN":`zh-cn`,"zh-TW":`zh-tw`,en:`en`}[e]}function le(e,t,n){if(!e)return t(`admin.time.never`);let r=(0,O.default)(e);if(!r.isValid())return t(`admin.time.never`);if(r.isAfter((0,O.default)()))return t(`admin.time.justNow`);let i=P(n);return r.locale(i).from((0,O.default)().locale(i))}var ue=[{labelKey:`admin.seedHelp.active.label`,tone:`active`,descKey:`admin.seedHelp.active.desc`},{labelKey:`admin.seedHelp.pending.label`,tone:`pending`,descKey:`admin.seedHelp.pending.desc`},{labelKey:`admin.seedHelp.paused.label`,tone:`muted`,descKey:`admin.seedHelp.paused.desc`},{labelKey:`admin.seedHelp.error.label`,tone:`error`,descKey:`admin.seedHelp.error.desc`}],de=[{value:`all`,labelKey:`admin.logFilter.all`},{value:`join`,labelKey:`admin.logFilter.join`},{value:`pull`,labelKey:`admin.logFilter.pull`},{value:`verify`,labelKey:`admin.logFilter.verify`},{value:`serve`,labelKey:`admin.logFilter.serve`},{value:`error`,labelKey:`admin.logFilter.error`}],F={join:[`join`,`joined`,`topic`],pull:[`pull`,`p2p`],verify:[`verify`,`verified`,`integrity`,`download:success`],serve:[`seed`,`seeding`,`holding`,`publish:success`,`topic:joined`],error:[`error`,`failed`,`fail`]};function I(e){let t=``;try{t=JSON.stringify(e.data||{})}catch{}return[e.level,e.event,e.message,t].map(e=>String(e||``).toLowerCase()).join(` `)}function fe(e,t){let n=String(t||`all`).trim().toLowerCase();if(!n||n===`all`)return!0;let r=I(e);return n===`error`?e.level===`error`||F.error.some(e=>r.includes(e)):(F[n]||[n]).some(e=>r.includes(e))}function L(){let{t:e,locale:t,formatNumber:n,formatTime:r}=o(),i=v(e=>e.hasBackend),a=v(e=>e.addToast),[x,w]=(0,D.useState)(ae),[T,E]=(0,D.useState)([]),[O,k]=(0,D.useState)(``),[P,F]=(0,D.useState)(!1),[I,L]=(0,D.useState)(!1),[R,z]=(0,D.useState)(!1),[B,pe]=(0,D.useState)(`all`),[V,me]=(0,D.useState)([]),[he,H]=(0,D.useState)(``),[U,W]=(0,D.useState)({dataPath:``,capacityGiB:`100`,maxFileSizeGiB:`10`,remoteInvites:``}),G=i===!0;function K(){return G?!0:(a(e(i===null?`admin.toast.backendChecking`:`admin.toast.backendDisconnected`),`warning`),!1)}let q=(0,D.useMemo)(()=>!x||x.capacity.configuredBytes<=0?0:Math.min(100,Math.round(x.capacity.usedBytes/x.capacity.configuredBytes*100)),[x]),ge=(0,D.useMemo)(()=>(x?.holdings||[]).slice(0,100),[x]),J=Math.max(0,(x?.holdings.length||0)-100),Y=_(),X=!!Y&&!Y.includes(`localhost`)&&!Y.includes(`127.0.0.1`),Z=async()=>{if(!G)return!1;try{let e=await b.get(`/api/node/status`).json(),t=await b.get(`/api/node/config`).json();return w(e),W({dataPath:t.dataPath||e.dataPath||``,capacityGiB:j(t.capacityBytes),maxFileSizeGiB:j(t.maxFileSizeBytes),remoteInvites:(t.remoteInvites||[]).join(`
1
+ import{n as e,o as t,r as n,t as r}from"./jsx-runtime-Bt-cYkS5.js";import{C as i,T as a}from"./ui-BpDGD3IR.js";import{a as o}from"./i18n-NjvOSuV6.js";import{t as s}from"./download-jEPn2njL.js";import{t as c}from"./file-text-DPA1riJ_.js";import{t as l}from"./hard-drive-Dar_AZEq.js";import{n as u,t as d}from"./triangle-alert-DGWc8ZHu.js";import{t as f}from"./save-BjrbPwhJ.js";import{t as ee}from"./shield-check-DzDuWO8r.js";import{t as p}from"./trash-2-V12tJ8lI.js";import{t as m}from"./wifi-Bgo8eHY0.js";import{F as h,M as g,_,c as v,f as y,g as te,l as b}from"./index-C-_ZwxuN.js";import{t as x}from"./dayjs.min-Dcc0B6Je.js";import{t as ne}from"./MarketingHeader-B45AaM29.js";import{t as S}from"./format-CR8oUWq6.js";var re=i(`activity`,[[`path`,{d:`M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2`,key:`169zse`}]]),ie=i(`clipboard`,[[`rect`,{width:`8`,height:`4`,x:`8`,y:`2`,rx:`1`,ry:`1`,key:`tgr4d6`}],[`path`,{d:`M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2`,key:`116196`}]]),C=i(`database`,[[`ellipse`,{cx:`12`,cy:`5`,rx:`9`,ry:`3`,key:`msslwz`}],[`path`,{d:`M3 5V19A9 3 0 0 0 21 19V5`,key:`1wlel7`}],[`path`,{d:`M3 12A9 3 0 0 0 21 12`,key:`mv7ke4`}]]),w=n(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_plugin_relativeTime=r()})(e,(function(){return function(e,t,n){e||={};var r=t.prototype,i={future:`in %s`,past:`%s ago`,s:`a few seconds`,m:`a minute`,mm:`%d minutes`,h:`an hour`,hh:`%d hours`,d:`a day`,dd:`%d days`,M:`a month`,MM:`%d months`,y:`a year`,yy:`%d years`};function a(e,t,n,i){return r.fromToBase(e,t,n,i)}n.en.relativeTime=i,r.fromToBase=function(t,r,a,o,s){for(var c,l,u,d=a.$locale().relativeTime||i,f=e.thresholds||[{l:`s`,r:44,d:`second`},{l:`m`,r:89},{l:`mm`,r:44,d:`minute`},{l:`h`,r:89},{l:`hh`,r:21,d:`hour`},{l:`d`,r:35},{l:`dd`,r:25,d:`day`},{l:`M`,r:45},{l:`MM`,r:10,d:`month`},{l:`y`,r:17},{l:`yy`,d:`year`}],ee=f.length,p=0;p<ee;p+=1){var m=f[p];m.d&&(c=o?n(t).diff(a,m.d,!0):a.diff(t,m.d,!0));var h=(e.rounding||Math.round)(Math.abs(c));if(u=c>0,h<=m.r||!m.r){h<=1&&p>0&&(m=f[p-1]);var g=d[m.l];s&&(h=s(``+h)),l=typeof g==`string`?g.replace(`%d`,h):g(h,r,m.l,u);break}}if(r)return l;var _=u?d.future:d.past;return typeof _==`function`?_(l):_.replace(`%s`,l)},r.to=function(e,t){return a(e,t,this,!0)},r.from=function(e,t){return a(e,t,this)};var o=function(e){return e.$u?n.utc():n()};r.toNow=function(e){return this.to(o(this),e)},r.fromNow=function(e){return this.from(o(this),e)}}}))})),T=n(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r(x()):typeof define==`function`&&define.amd?define([`dayjs`],r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_locale_zh_cn=r(n.dayjs)})(e,(function(e){function t(e){return e&&typeof e==`object`&&`default`in e?e:{default:e}}var n=t(e),r={name:`zh-cn`,weekdays:`星期日_星期一_星期二_星期三_星期四_星期五_星期六`.split(`_`),weekdaysShort:`周日_周一_周二_周三_周四_周五_周六`.split(`_`),weekdaysMin:`日_一_二_三_四_五_六`.split(`_`),months:`一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月`.split(`_`),monthsShort:`1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月`.split(`_`),ordinal:function(e,t){return t===`W`?e+`周`:e+`日`},weekStart:1,yearStart:4,formats:{LT:`HH:mm`,LTS:`HH:mm:ss`,L:`YYYY/MM/DD`,LL:`YYYY年M月D日`,LLL:`YYYY年M月D日Ah点mm分`,LLLL:`YYYY年M月D日ddddAh点mm分`,l:`YYYY/M/D`,ll:`YYYY年M月D日`,lll:`YYYY年M月D日 HH:mm`,llll:`YYYY年M月D日dddd HH:mm`},relativeTime:{future:`%s内`,past:`%s前`,s:`几秒`,m:`1 分钟`,mm:`%d 分钟`,h:`1 小时`,hh:`%d 小时`,d:`1 天`,dd:`%d 天`,M:`1 个月`,MM:`%d 个月`,y:`1 年`,yy:`%d 年`},meridiem:function(e,t){var n=100*e+t;return n<600?`凌晨`:n<900?`早上`:n<1100?`上午`:n<1300?`中午`:n<1800?`下午`:`晚上`}};return n.default.locale(r,null,!0),r}))})),E=n(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r(x()):typeof define==`function`&&define.amd?define([`dayjs`],r):(n=typeof globalThis<`u`?globalThis:n||self).dayjs_locale_zh_tw=r(n.dayjs)})(e,(function(e){function t(e){return e&&typeof e==`object`&&`default`in e?e:{default:e}}var n=t(e),r={name:`zh-tw`,weekdays:`星期日_星期一_星期二_星期三_星期四_星期五_星期六`.split(`_`),weekdaysShort:`週日_週一_週二_週三_週四_週五_週六`.split(`_`),weekdaysMin:`日_一_二_三_四_五_六`.split(`_`),months:`一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月`.split(`_`),monthsShort:`1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月`.split(`_`),ordinal:function(e,t){return t===`W`?e+`週`:e+`日`},formats:{LT:`HH:mm`,LTS:`HH:mm:ss`,L:`YYYY/MM/DD`,LL:`YYYY年M月D日`,LLL:`YYYY年M月D日 HH:mm`,LLLL:`YYYY年M月D日dddd HH:mm`,l:`YYYY/M/D`,ll:`YYYY年M月D日`,lll:`YYYY年M月D日 HH:mm`,llll:`YYYY年M月D日dddd HH:mm`},relativeTime:{future:`%s內`,past:`%s前`,s:`幾秒`,m:`1 分鐘`,mm:`%d 分鐘`,h:`1 小時`,hh:`%d 小時`,d:`1 天`,dd:`%d 天`,M:`1 個月`,MM:`%d 個月`,y:`1 年`,yy:`%d 年`},meridiem:function(e,t){var n=100*e+t;return n<600?`凌晨`:n<900?`早上`:n<1100?`上午`:n<1300?`中午`:n<1800?`下午`:`晚上`}};return n.default.locale(r,null,!0),r}))})),D=t(e(),1),O=t(x(),1),k=t(w(),1);T(),E();var A=r();O.default.extend(k.default);var ae=null;function oe(e,t){let n=Math.max(0,Number(e)||0),r=Math.floor(n/86400),i=Math.floor(n%86400/3600),a=Math.floor(n%3600/60);return r>0?t(`admin.uptime.daysHours`,{days:r,hours:i}):i>0?t(`admin.uptime.hoursMinutes`,{hours:i,minutes:a}):t(`admin.uptime.minutes`,{minutes:a})}function j(e){return Number.isFinite(e)?String(Math.round(e/(1024*1024*1024)*100)/100):`0`}function M(e){let t=Number(e);return!Number.isFinite(t)||t<0?0:Math.round(t*1024*1024*1024)}function se(e){return Array.from(new Set(String(e||``).split(/[\n,]/).map(e=>e.trim()).filter(Boolean)))}function N(e,t=12,n=8){return e?e.length<=t+n+3?e:`${e.slice(0,t)}...${e.slice(-n)}`:`-`}function ce(e,t){switch(e.seedStatus){case`queued`:return t(`admin.seedStatus.queued`);case`joining`:return t(`admin.seedStatus.joining`);case`active`:return t(`admin.seedStatus.active`);case`paused`:return t(`admin.seedStatus.paused`);case`error`:return e.seedError?t(`admin.seedStatus.errorWithMessage`,{message:e.seedError}):t(`admin.seedStatus.error`);default:return e.joined?t(`admin.seedStatus.active`):t(`admin.seedStatus.notJoined`)}}function P(e){return{"zh-CN":`zh-cn`,"zh-TW":`zh-tw`,en:`en`}[e]}function le(e,t,n){if(!e)return t(`admin.time.never`);let r=(0,O.default)(e);if(!r.isValid())return t(`admin.time.never`);if(r.isAfter((0,O.default)()))return t(`admin.time.justNow`);let i=P(n);return r.locale(i).from((0,O.default)().locale(i))}var ue=[{labelKey:`admin.seedHelp.active.label`,tone:`active`,descKey:`admin.seedHelp.active.desc`},{labelKey:`admin.seedHelp.pending.label`,tone:`pending`,descKey:`admin.seedHelp.pending.desc`},{labelKey:`admin.seedHelp.paused.label`,tone:`muted`,descKey:`admin.seedHelp.paused.desc`},{labelKey:`admin.seedHelp.error.label`,tone:`error`,descKey:`admin.seedHelp.error.desc`}],de=[{value:`all`,labelKey:`admin.logFilter.all`},{value:`join`,labelKey:`admin.logFilter.join`},{value:`pull`,labelKey:`admin.logFilter.pull`},{value:`verify`,labelKey:`admin.logFilter.verify`},{value:`serve`,labelKey:`admin.logFilter.serve`},{value:`error`,labelKey:`admin.logFilter.error`}],F={join:[`join`,`joined`,`topic`],pull:[`pull`,`p2p`],verify:[`verify`,`verified`,`integrity`,`download:success`],serve:[`seed`,`seeding`,`holding`,`publish:success`,`topic:joined`],error:[`error`,`failed`,`fail`]};function I(e){let t=``;try{t=JSON.stringify(e.data||{})}catch{}return[e.level,e.event,e.message,t].map(e=>String(e||``).toLowerCase()).join(` `)}function fe(e,t){let n=String(t||`all`).trim().toLowerCase();if(!n||n===`all`)return!0;let r=I(e);return n===`error`?e.level===`error`||F.error.some(e=>r.includes(e)):(F[n]||[n]).some(e=>r.includes(e))}function L(){let{t:e,locale:t,formatNumber:n,formatTime:r}=o(),i=v(e=>e.hasBackend),a=v(e=>e.addToast),[x,w]=(0,D.useState)(ae),[T,E]=(0,D.useState)([]),[O,k]=(0,D.useState)(``),[P,F]=(0,D.useState)(!1),[I,L]=(0,D.useState)(!1),[R,z]=(0,D.useState)(!1),[B,pe]=(0,D.useState)(`all`),[V,me]=(0,D.useState)([]),[he,H]=(0,D.useState)(``),[U,W]=(0,D.useState)({dataPath:``,capacityGiB:`100`,maxFileSizeGiB:`10`,remoteInvites:``}),G=i===!0;function K(){return G?!0:(a(e(i===null?`admin.toast.backendChecking`:`admin.toast.backendDisconnected`),`warning`),!1)}let q=(0,D.useMemo)(()=>!x||x.capacity.configuredBytes<=0?0:Math.min(100,Math.round(x.capacity.usedBytes/x.capacity.configuredBytes*100)),[x]),ge=(0,D.useMemo)(()=>(x?.holdings||[]).slice(0,100),[x]),J=Math.max(0,(x?.holdings.length||0)-100),Y=_(),X=!!Y&&!Y.includes(`localhost`)&&!Y.includes(`127.0.0.1`),Z=async()=>{if(!G)return!1;try{let e=await b.get(`/api/node/status`).json(),t=await b.get(`/api/node/config`).json();return w(e),W({dataPath:t.dataPath||e.dataPath||``,capacityGiB:j(t.capacityBytes),maxFileSizeGiB:j(t.maxFileSizeBytes),remoteInvites:(t.remoteInvites||[]).join(`
2
2
  `)}),k(``),!0}catch(t){let n=await y(t,e(`admin.error.readStatus`));return k(n),a(n,`error`),!1}},_e=async()=>{K()&&await Z()&&a(e(`admin.toast.statusRefreshed`),`success`)},Q=async(e=B)=>{if(G)try{let t=new URLSearchParams({limit:`80`,filter:e});E((await b.get(`/api/node/logs?${t.toString()}`).json()).logs||[])}catch{}},$=async()=>{if(G)try{me((await b.get(`/api/admin/users`).json()).users||[])}catch{}},ve=async()=>{if(K()){F(!0);try{await b.post(`/api/node/config`,{json:{dataPath:U.dataPath,capacityBytes:M(U.capacityGiB),maxFileSizeBytes:M(U.maxFileSizeGiB),remoteInvites:se(U.remoteInvites)}}).json(),a(U.dataPath===(x?.dataPath||``)?e(`admin.toast.configSaved`):e(`admin.toast.configSavedRestart`),`success`),await Z(),await Q()}catch(t){let n=await y(t,e(`admin.error.saveConfig`));a(n,`error`),k(n)}finally{F(!1)}}},ye=async()=>{x?.nodeId&&(await navigator.clipboard.writeText(x.nodeId),a(e(`admin.toast.nodeIdCopied`),`success`))},be=async()=>{if(K()){L(!0);try{await b.delete(`/api/node/logs`).json(),E([]),a(e(`admin.toast.logsCleared`),`success`)}catch(t){let n=await y(t,e(`admin.error.clearLogs`));a(n,`error`),k(n)}finally{L(!1)}}},xe=async()=>{if(K()){z(!0);try{let t=await b.get(`/api/node/diagnostics`).json(),n=new Blob([JSON.stringify(t,null,2)],{type:`application/json`}),r=URL.createObjectURL(n),i=document.createElement(`a`),o=new Date().toISOString().replace(/[:.]/g,`-`);i.href=r,i.download=`mostbox-diagnostics-${o}.json`,document.body.appendChild(i),i.click(),i.remove(),URL.revokeObjectURL(r),a(e(`admin.toast.diagnosticsExported`),`success`)}catch(t){let n=await y(t,e(`admin.error.exportDiagnostics`));a(n,`error`),k(n)}finally{z(!1)}}},Se=async t=>{if(K()&&window.confirm(e(`admin.confirm.clearUserData`,{address:`${t.slice(0,6)}...${t.slice(-4)}`}))){H(t);try{await b.delete(`/api/admin/users/${t}/data`).json(),a(e(`admin.toast.userDataCleared`),`success`),await $(),await Z()}catch(t){let n=await y(t,e(`admin.error.clearUserData`));a(n,`error`),k(n)}finally{H(``)}}};return(0,D.useEffect)(()=>{if(!G||X)return;Z(),Q(),$();let e=null,t=!1;return(async()=>{if(e=new WebSocket(await te(`/ws`)),t){e.close();return}e.onmessage=e=>{try{let t=JSON.parse(e.data);t.event===`node:status`&&w(t.data),t.event===`node:log`&&fe(t.data,B)&&E(e=>[t.data,...e].slice(0,80)),t.event===`node:logs:cleared`&&E([]),(t.event===`publish:success`||t.event===`download:success`||t.event===`network:status`)&&Z()}catch{}}})(),()=>{t=!0,e?.close()}},[G,X,B]),(0,A.jsxs)(A.Fragment,{children:[(0,A.jsx)(ne,{}),(0,A.jsxs)(`main`,{className:`admin-page`,children:[(0,A.jsxs)(`header`,{className:`admin-topbar`,children:[(0,A.jsx)(`div`,{className:`admin-title-group`,children:(0,A.jsx)(`h1`,{children:e(`admin.title`)})}),(0,A.jsxs)(`div`,{className:`admin-topbar-actions`,children:[(0,A.jsxs)(`span`,{className:`admin-status-pill ${x?.status===`online`?`online`:``}`,children:[(0,A.jsx)(re,{size:14}),x?.status===`online`?e(`admin.status.online`):e(`admin.status.waiting`)]}),(0,A.jsxs)(`button`,{className:`btn btn-secondary`,onClick:_e,children:[(0,A.jsx)(u,{size:16}),e(`admin.action.refresh`)]})]})]}),i===!1&&(0,A.jsxs)(`section`,{className:`admin-panel admin-error`,children:[(0,A.jsx)(g,{size:20}),(0,A.jsx)(`span`,{children:e(`admin.error.localDaemonDisconnected`)})]}),X&&(0,A.jsxs)(`section`,{className:`admin-panel admin-error`,children:[(0,A.jsx)(d,{size:18}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`h2`,{children:e(`admin.remoteUnavailable.title`)}),(0,A.jsx)(`p`,{children:e(`admin.remoteUnavailable.desc`)})]})]}),!X&&O&&(0,A.jsxs)(`section`,{className:`admin-panel admin-error`,children:[(0,A.jsx)(c,{size:20}),(0,A.jsx)(`span`,{children:O})]}),!X&&(0,A.jsxs)(A.Fragment,{children:[(0,A.jsxs)(`section`,{className:`admin-overview`,children:[(0,A.jsxs)(`div`,{className:`admin-metric`,children:[(0,A.jsx)(`div`,{className:`admin-metric-icon`,children:(0,A.jsx)(ee,{size:18})}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`span`,{children:e(`admin.metric.nodeId`)}),(0,A.jsx)(`strong`,{translate:`no`,children:N(x?.nodeId||``)})]}),(0,A.jsx)(`button`,{className:`btn btn-icon admin-metric-action`,onClick:ye,"aria-label":e(`admin.action.copyNodeId`),children:(0,A.jsx)(ie,{size:15})})]}),(0,A.jsxs)(`div`,{className:`admin-metric`,children:[(0,A.jsx)(`div`,{className:`admin-metric-icon`,children:(0,A.jsx)(m,{size:18})}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`span`,{children:e(`admin.metric.connections`)}),(0,A.jsx)(`strong`,{children:x?e(`admin.metric.peers`,{count:x.network.peers}):`-`})]})]}),(0,A.jsxs)(`div`,{className:`admin-metric`,children:[(0,A.jsx)(`div`,{className:`admin-metric-icon`,children:(0,A.jsx)(l,{size:18})}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`span`,{children:e(`admin.metric.capacity`)}),(0,A.jsxs)(`strong`,{children:[q,`%`]})]})]}),(0,A.jsxs)(`div`,{className:`admin-metric`,children:[(0,A.jsx)(`div`,{className:`admin-metric-icon`,children:(0,A.jsx)(g,{size:18})}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`span`,{children:e(`admin.metric.uptime`)}),(0,A.jsx)(`strong`,{children:x?oe(x.uptimeSeconds,e):`-`})]})]})]}),(0,A.jsxs)(`section`,{className:`admin-grid`,children:[(0,A.jsxs)(`div`,{className:`admin-panel admin-span-2`,children:[(0,A.jsxs)(`div`,{className:`admin-panel-header`,children:[(0,A.jsx)(`div`,{children:(0,A.jsx)(`h2`,{children:e(`admin.nodeStatus.title`)})}),(0,A.jsx)(h,{size:18})]}),(0,A.jsxs)(`div`,{className:`admin-status-grid`,children:[(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`span`,{children:e(`admin.nodeStatus.version`)}),(0,A.jsx)(`strong`,{translate:`no`,children:x?.version||`-`})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`span`,{children:e(`admin.nodeStatus.listen`)}),(0,A.jsx)(`strong`,{translate:`no`,children:x?`${x.host}:${x.port}`:`-`})]}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`span`,{children:e(`admin.nodeStatus.dataPath`)}),(0,A.jsx)(`strong`,{translate:`no`,children:x?.dataPath||`-`})]})]}),(0,A.jsx)(`div`,{className:`admin-address-list`,children:(x?.listen.addresses||[]).map(e=>(0,A.jsxs)(`span`,{translate:`no`,children:[e.label,`: `,e.ip,`:`,x?.port]},`${e.type}-${e.ip}`))})]}),(0,A.jsxs)(`div`,{className:`admin-panel admin-span-2`,children:[(0,A.jsxs)(`div`,{className:`admin-panel-header`,children:[(0,A.jsx)(`div`,{children:(0,A.jsx)(`h2`,{children:e(`admin.userData.title`)})}),(0,A.jsx)(C,{size:18})]}),(0,A.jsxs)(`div`,{className:`admin-table`,children:[(0,A.jsxs)(`div`,{className:`admin-table-row admin-table-head`,children:[(0,A.jsx)(`span`,{children:e(`admin.userData.user`)}),(0,A.jsx)(`span`,{children:e(`admin.userData.files`)}),(0,A.jsx)(`span`,{children:e(`admin.userData.trash`)}),(0,A.jsx)(`span`,{children:e(`admin.userData.actions`)})]}),V.map(t=>(0,A.jsxs)(`div`,{className:`admin-table-row`,children:[(0,A.jsx)(`span`,{title:t.address,translate:`no`,children:N(t.address)}),(0,A.jsx)(`span`,{children:n(t.fileCount)}),(0,A.jsx)(`span`,{children:n(t.trashCount)}),(0,A.jsx)(`span`,{children:(0,A.jsxs)(`button`,{className:`btn btn-ghost`,onClick:()=>Se(t.address),disabled:he===t.address,children:[(0,A.jsx)(p,{size:16}),e(`admin.action.clear`)]})})]},t.address)),V.length===0&&(0,A.jsx)(`div`,{className:`admin-empty-row`,children:e(`admin.userData.empty`)})]})]}),(0,A.jsxs)(`div`,{className:`admin-panel admin-span-2`,children:[(0,A.jsxs)(`div`,{className:`admin-panel-header`,children:[(0,A.jsx)(`div`,{children:(0,A.jsx)(`h2`,{children:e(`admin.settings.title`)})}),(0,A.jsx)(C,{size:18})]}),(0,A.jsxs)(`div`,{className:`admin-settings-fields`,children:[(0,A.jsxs)(`label`,{className:`admin-field admin-field-wide`,children:[(0,A.jsx)(`span`,{children:e(`admin.settings.dataPath`)}),(0,A.jsx)(`input`,{className:`input`,value:U.dataPath,onChange:e=>W(t=>({...t,dataPath:e.target.value}))})]}),(0,A.jsxs)(`label`,{className:`admin-field`,children:[(0,A.jsx)(`span`,{children:e(`admin.settings.capacityGiB`)}),(0,A.jsx)(`input`,{className:`input`,type:`number`,min:`0`,step:`1`,value:U.capacityGiB,onChange:e=>W(t=>({...t,capacityGiB:e.target.value}))})]}),(0,A.jsxs)(`label`,{className:`admin-field`,children:[(0,A.jsx)(`span`,{children:e(`admin.settings.maxFileSizeGiB`)}),(0,A.jsx)(`input`,{className:`input`,type:`number`,min:`0`,step:`1`,value:U.maxFileSizeGiB,onChange:e=>W(t=>({...t,maxFileSizeGiB:e.target.value}))})]}),(0,A.jsxs)(`label`,{className:`admin-field admin-field-wide`,children:[(0,A.jsx)(`span`,{children:e(`admin.settings.remoteInvites`)}),(0,A.jsx)(`textarea`,{className:`input admin-textarea`,value:U.remoteInvites,placeholder:e(`admin.settings.remoteInvitesPlaceholder`),onChange:e=>W(t=>({...t,remoteInvites:e.target.value}))})]})]}),(0,A.jsx)(`p`,{className:`admin-field-hint`,children:e(`admin.settings.hint`)}),(0,A.jsxs)(`button`,{className:`btn btn-primary btn-full`,onClick:ve,disabled:P,children:[(0,A.jsx)(f,{size:16}),e(`admin.action.saveConfig`)]})]}),(0,A.jsxs)(`div`,{className:`admin-panel admin-span-2`,children:[(0,A.jsxs)(`div`,{className:`admin-panel-header`,children:[(0,A.jsx)(`div`,{children:(0,A.jsx)(`h2`,{children:e(`admin.holdings.title`)})}),(0,A.jsx)(l,{size:18})]}),(0,A.jsxs)(`div`,{className:`admin-capacity-row`,children:[(0,A.jsx)(`progress`,{value:q,max:`100`}),(0,A.jsxs)(`span`,{children:[S(x?.capacity.usedBytes||0),` /`,` `,S(x?.capacity.configuredBytes||0)]})]}),(0,A.jsx)(`div`,{className:`admin-seed-help`,"aria-label":e(`admin.seedHelp.label`),children:ue.map(t=>(0,A.jsxs)(`div`,{className:`admin-seed-help-item`,children:[(0,A.jsx)(`span`,{className:`admin-seed-dot ${t.tone}`}),(0,A.jsxs)(`div`,{children:[(0,A.jsx)(`strong`,{children:e(t.labelKey)}),(0,A.jsx)(`span`,{children:e(t.descKey)})]})]},t.labelKey))}),J>0&&(0,A.jsx)(`p`,{className:`admin-table-note`,children:e(`admin.holdings.hiddenCount`,{count:n(J)})}),(0,A.jsxs)(`div`,{className:`admin-table`,children:[(0,A.jsxs)(`div`,{className:`admin-table-row admin-table-head admin-holdings-row`,children:[(0,A.jsx)(`span`,{children:e(`admin.holdings.file`)}),(0,A.jsx)(`span`,{children:`CID`}),(0,A.jsx)(`span`,{children:e(`admin.holdings.size`)}),(0,A.jsx)(`span`,{children:e(`admin.holdings.peers`)}),(0,A.jsx)(`span`,{children:e(`admin.holdings.topicJoined`)}),(0,A.jsx)(`span`,{children:e(`admin.holdings.lastServed`)}),(0,A.jsx)(`span`,{children:e(`admin.holdings.totalServed`)}),(0,A.jsx)(`span`,{children:e(`admin.holdings.status`)})]}),ge.map(r=>(0,A.jsxs)(`div`,{className:`admin-table-row admin-holdings-row`,children:[(0,A.jsx)(`span`,{translate:`no`,children:r.fileName||`-`}),(0,A.jsx)(`span`,{title:r.cid,translate:`no`,children:N(r.cid)}),(0,A.jsx)(`span`,{children:S(r.size)}),(0,A.jsx)(`span`,{children:n(r.peerCount??0)}),(0,A.jsx)(`span`,{className:`admin-seed-pill ${r.joined?`active`:``}`,children:r.joined?e(`admin.holdings.joinedYes`):e(`admin.holdings.joinedNo`)}),(0,A.jsx)(`span`,{title:r.lastServedAt||``,children:le(r.lastServedAt,e,t)}),(0,A.jsx)(`span`,{children:S(r.totalServedBytes||0)}),(0,A.jsx)(`span`,{className:`admin-seed-pill ${r.seedStatus===`error`?`error`:r.seedStatus===`active`||r.joined?`active`:``}`,children:ce(r,e)})]},r.cid)),(!x||x.holdings.length===0)&&(0,A.jsx)(`div`,{className:`admin-empty-row`,children:e(`admin.holdings.empty`)})]})]}),(0,A.jsxs)(`div`,{className:`admin-panel admin-span-2`,children:[(0,A.jsxs)(`div`,{className:`admin-panel-header`,children:[(0,A.jsx)(`div`,{children:(0,A.jsx)(`h2`,{children:e(`admin.logs.title`)})}),(0,A.jsxs)(`div`,{className:`admin-panel-actions`,children:[(0,A.jsxs)(`button`,{className:`btn btn-secondary`,onClick:xe,disabled:R,children:[(0,A.jsx)(s,{size:16}),e(`admin.action.exportDiagnostics`)]}),(0,A.jsxs)(`button`,{className:`btn btn-ghost`,onClick:be,disabled:I||T.length===0,children:[(0,A.jsx)(p,{size:16}),e(`admin.action.clearLogs`)]}),(0,A.jsx)(c,{size:18})]})]}),(0,A.jsx)(`div`,{className:`admin-log-filter`,"aria-label":e(`admin.logs.filterLabel`),children:de.map(t=>(0,A.jsx)(`button`,{type:`button`,className:B===t.value?`active`:``,onClick:()=>{pe(t.value),Q(t.value)},children:e(t.labelKey)},t.value))}),(0,A.jsxs)(`div`,{className:`admin-log-list`,children:[T.map(e=>(0,A.jsxs)(`div`,{className:`admin-log-row`,children:[(0,A.jsx)(`time`,{children:r(e.ts)}),(0,A.jsx)(`span`,{className:`admin-log-level ${e.level}`,translate:`no`,children:e.level}),(0,A.jsx)(`strong`,{translate:`no`,children:e.event}),(0,A.jsx)(`span`,{translate:`no`,children:e.message})]},e.id)),T.length===0&&(0,A.jsx)(`div`,{className:`admin-empty-row`,children:e(`admin.logs.empty`)})]})]})]})]})]})]})}var R=a(`/admin/`)({component:L});export{R as Route};
@@ -1 +1 @@
1
- import{n as e,o as t,t as n}from"./jsx-runtime-Bt-cYkS5.js";import{C as r,D as i,T as a,o}from"./ui-BpDGD3IR.js";import{a as s}from"./i18n-NjvOSuV6.js";import{t as c}from"./arrow-right-BU9c_SL4.js";import{i as l}from"./LanguageToggle-CSQtRZ3A.js";import{t as u}from"./download-jEPn2njL.js";import{t as d}from"./external-link-BFaoZeK0.js";import{t as f}from"./hard-drive-Dar_AZEq.js";import{t as p}from"./message-square-Dp09WY1I.js";import{t as m}from"./notebook-pen-C8TlK5sB.js";import{t as h}from"./wallet-T7ONZ3Kg.js";import{M as g,c as _}from"./index-BZ-f0CZd.js";import{t as v}from"./MarketingLayout-CQurMOSD.js";var y=r(`arrow-up-right`,[[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]),b=r(`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`}]]),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)(b,{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)(p,{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)(m,{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`}]}];function T(){let e=_(e=>e.hasBackend),t=_(e=>e.openConnectModal),[n,r]=(0,S.useState)(`app`),{t:a}=s(),p=o(),m=w.find(e=>e.id===n)||w[0],h=a(m.titleKey),v=m.steps.filter(e=>!(p&&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:a(`common.brand`)}),(0,C.jsx)(`p`,{className:`portal-hero-subtitle`,children:a(`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:w.map(t=>{let o=n===t.id,s=t.requiresBackend,c=s?e===!0?`connected`:e===!1?`disconnected`:`checking`:`none`,l=a(t.titleKey);return(0,C.jsxs)(`button`,{className:`portal-card ${o?`active`:``}`,onClick:()=>r(t.id),children:[(0,C.jsx)(i,{to:t.path,className:`btn btn-icon portal-card-open-btn`,onClick:e=>e.stopPropagation(),title:a(`portal.openFeature`,{title:l}),children:(0,C.jsx)(y,{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:a(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`}),a(`common.status.checking`)]}),c===`connected`&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(`span`,{className:`status-dot connected`}),a(`common.status.connected`)]}),c===`disconnected`&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(`span`,{className:`status-dot disconnected`}),a(`common.status.needsConnection`)]})]}):(0,C.jsxs)(`div`,{className:`ui-badge portal-card-status ready`,children:[(0,C.jsx)(`span`,{className:`status-dot ready`}),a(`common.status.ready`)]})]},t.id)})}),(0,C.jsxs)(`div`,{className:`portal-node-actions`,"aria-label":a(`portal.nodeEntry`),children:[(0,C.jsxs)(`button`,{onClick:t,className:`btn btn-secondary`,children:[(0,C.jsx)(g,{size:16}),a(`portal.webConnectNode`)]}),(0,C.jsxs)(i,{to:`/admin/`,className:`btn btn-secondary`,children:[(0,C.jsx)(f,{size:16}),a(`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:a(m.heroKey)}),(0,C.jsx)(`p`,{children:a(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)(l,{size:14,strokeWidth:3})}),(0,C.jsx)(`span`,{children:a(e)})]},e))}),(0,C.jsx)(`div`,{className:`portal-marketing-steps`,children:v.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:a(e.titleKey)}),(0,C.jsx)(`p`,{children:a(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)(i,{to:e.link,children:[a(e.linkTextKey),` `,(0,C.jsx)(d,{size:12})]})})]})]},e.num))}),(0,C.jsxs)(`div`,{className:`portal-actions`,children:[(0,C.jsxs)(i,{to:m.path,className:`btn btn-primary`,children:[a(`portal.enterFeature`,{title:h}),(0,C.jsx)(c,{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)(g,{size:16}),a(`portal.webConnectNode`)]}),!p&&(0,C.jsxs)(i,{to:`/download/`,className:`btn btn-secondary`,children:[(0,C.jsx)(u,{size:16}),a(`nav.downloadClient`)]})]})]})]})})})]})}function E(){return(0,C.jsx)(v,{children:(0,C.jsx)(T,{})})}var D=a(`/`)({component:E});export{D as Route};
1
+ import{n as e,o as t,t as n}from"./jsx-runtime-Bt-cYkS5.js";import{C as r,D as i,T as a,o}from"./ui-BpDGD3IR.js";import{a as s}from"./i18n-NjvOSuV6.js";import{t as c}from"./arrow-right-BU9c_SL4.js";import{i as l}from"./LanguageToggle-CSQtRZ3A.js";import{t as u}from"./download-jEPn2njL.js";import{t as d}from"./external-link-BFaoZeK0.js";import{t as f}from"./hard-drive-Dar_AZEq.js";import{t as p}from"./message-square-Dp09WY1I.js";import{t as m}from"./notebook-pen-C8TlK5sB.js";import{t as h}from"./wallet-T7ONZ3Kg.js";import{M as g,c as _}from"./index-C-_ZwxuN.js";import{t as v}from"./MarketingLayout-A00pEOa2.js";var y=r(`arrow-up-right`,[[`path`,{d:`M7 7h10v10`,key:`1tivn9`}],[`path`,{d:`M7 17 17 7`,key:`1vkiza`}]]),b=r(`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`}]]),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)(b,{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)(p,{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)(m,{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`}]}];function T(){let e=_(e=>e.hasBackend),t=_(e=>e.openConnectModal),[n,r]=(0,S.useState)(`app`),{t:a}=s(),p=o(),m=w.find(e=>e.id===n)||w[0],h=a(m.titleKey),v=m.steps.filter(e=>!(p&&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:a(`common.brand`)}),(0,C.jsx)(`p`,{className:`portal-hero-subtitle`,children:a(`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:w.map(t=>{let o=n===t.id,s=t.requiresBackend,c=s?e===!0?`connected`:e===!1?`disconnected`:`checking`:`none`,l=a(t.titleKey);return(0,C.jsxs)(`button`,{className:`portal-card ${o?`active`:``}`,onClick:()=>r(t.id),children:[(0,C.jsx)(i,{to:t.path,className:`btn btn-icon portal-card-open-btn`,onClick:e=>e.stopPropagation(),title:a(`portal.openFeature`,{title:l}),children:(0,C.jsx)(y,{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:a(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`}),a(`common.status.checking`)]}),c===`connected`&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(`span`,{className:`status-dot connected`}),a(`common.status.connected`)]}),c===`disconnected`&&(0,C.jsxs)(C.Fragment,{children:[(0,C.jsx)(`span`,{className:`status-dot disconnected`}),a(`common.status.needsConnection`)]})]}):(0,C.jsxs)(`div`,{className:`ui-badge portal-card-status ready`,children:[(0,C.jsx)(`span`,{className:`status-dot ready`}),a(`common.status.ready`)]})]},t.id)})}),(0,C.jsxs)(`div`,{className:`portal-node-actions`,"aria-label":a(`portal.nodeEntry`),children:[(0,C.jsxs)(`button`,{onClick:t,className:`btn btn-secondary`,children:[(0,C.jsx)(g,{size:16}),a(`portal.webConnectNode`)]}),(0,C.jsxs)(i,{to:`/admin/`,className:`btn btn-secondary`,children:[(0,C.jsx)(f,{size:16}),a(`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:a(m.heroKey)}),(0,C.jsx)(`p`,{children:a(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)(l,{size:14,strokeWidth:3})}),(0,C.jsx)(`span`,{children:a(e)})]},e))}),(0,C.jsx)(`div`,{className:`portal-marketing-steps`,children:v.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:a(e.titleKey)}),(0,C.jsx)(`p`,{children:a(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)(i,{to:e.link,children:[a(e.linkTextKey),` `,(0,C.jsx)(d,{size:12})]})})]})]},e.num))}),(0,C.jsxs)(`div`,{className:`portal-actions`,children:[(0,C.jsxs)(i,{to:m.path,className:`btn btn-primary`,children:[a(`portal.enterFeature`,{title:h}),(0,C.jsx)(c,{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)(g,{size:16}),a(`portal.webConnectNode`)]}),!p&&(0,C.jsxs)(i,{to:`/download/`,className:`btn btn-secondary`,children:[(0,C.jsx)(u,{size:16}),a(`nav.downloadClient`)]})]})]})]})})})]})}function E(){return(0,C.jsx)(v,{children:(0,C.jsx)(T,{})})}var D=a(`/`)({component:E});export{D as Route};
@@ -1 +1 @@
1
- import{n as e,o as t,t as n}from"./jsx-runtime-Bt-cYkS5.js";import{C as r,D as i,T as a,l as o,r as s,s as c}from"./ui-BpDGD3IR.js";import{a as l}from"./i18n-NjvOSuV6.js";import{i as u}from"./LanguageToggle-CSQtRZ3A.js";import{t as ee}from"./download-jEPn2njL.js";import{t as d}from"./external-link-BFaoZeK0.js";import{a as f,i as p,n as m,r as h}from"./mp-B6kdA94c.js";import{t as g}from"./key-round-DNcpSuMw.js";import{t as _}from"./loader-BXQtdens.js";import{t as v}from"./save-BjrbPwhJ.js";import{t as te}from"./shield-check-DzDuWO8r.js";import{t as ne}from"./upload-CoCptKya.js";import{a as y,c as b,f as x,i as S,l as C,n as w,o as T,r as E,s as D}from"./index-BZ-f0CZd.js";import{t as O}from"./MarketingHeader-CrYsQsQ5.js";import{t as k}from"./MarketingLayout-CQurMOSD.js";var re=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`}]]),ie=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`}]]),ae=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`}]]),oe=r(`wallet-cards`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 9a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2`,key:`4125el`}],[`path`,{d:`M3 11h3c.8 0 1.6.3 2.1.9l1.1.9c1.6 1.6 4.1 1.6 5.7 0l1.1-.9c.5-.5 1.3-.9 2.1-.9H21`,key:`1dpki6`}]]),A=t(e(),1),j=n(),se=[{value:``,labelKey:`profile.avatar.address`},...E.map(e=>({value:y(e),labelKey:`profile.avatar.${e}`}))];function ce(e){if(T(e))return!0;try{let t=new URL(e);return t.protocol===`http:`||t.protocol===`https:`}catch{return!1}}function M(){let{t:e}=l(),t=b(e=>e.addToast),n=b(e=>e.hasBackend),r=c(e=>e.identity),a=c(e=>e.openLoginModal),y=c(e=>e.setUserIdentity),T=c(e=>e.logoutUser),E=w(),[M,F]=(0,A.useState)(``),[I,L]=(0,A.useState)(``),[R,z]=(0,A.useState)(``),[B,V]=(0,A.useState)(null),[H,U]=(0,A.useState)(!1),W=(0,j.jsx)(O,{});(0,A.useEffect)(()=>{if(!r){F(``),L(``),z(``);return}F(r.displayName||r.username),L(D(r.avatar)||r.avatar||``),z(``)},[r]);let G=(0,A.useMemo)(()=>r?o(r.danger):null,[r]),le=(0,A.useMemo)(()=>G?m(G.private_key,G.ed_public_key):``,[G]);if(!r)return(0,j.jsx)(k,{header:W,children:(0,j.jsx)(`section`,{className:`profile-page`,children:(0,j.jsx)(`div`,{className:`profile-container narrow`,children:(0,j.jsxs)(`div`,{className:`profile-empty glass`,children:[(0,j.jsx)(`div`,{className:`profile-empty-icon`,children:(0,j.jsx)(p,{size:34})}),(0,j.jsx)(`h1`,{children:e(`profile.signedOut.title`)}),(0,j.jsx)(`p`,{children:e(`profile.signedOut.desc`)}),(0,j.jsxs)(`button`,{type:`button`,className:`btn btn-primary`,onClick:a,children:[(0,j.jsx)(p,{size:16}),e(`account.signIn`)]})]})})})});let ue=D(r.avatar)||r.avatar||``,de=S(r.address,r.avatar),K=r.address.toLowerCase(),fe=I.trim().length>0;async function q(r){if(n===!0)try{await C.put(`/api/user/profile`,{json:{displayName:r.displayName||r.username,avatar:r.avatar||``,updatedAt:r.profileUpdatedAt||Date.now()}}).json()}catch(n){t(await x(n,e(`profile.backup.error.profileSaveFailed`)),`error`)}}function J(n){if(!r)return;let i={...r,avatar:n||void 0,profileUpdatedAt:Date.now()};y(i),q(i),z(``),t(e(`profile.toast.avatarUpdated`),`success`)}function pe(){if(!r)return;let n=M.trim()||r.username,i={...r,displayName:n,profileUpdatedAt:Date.now()};y(i),q(i),F(n),t(e(`profile.toast.saved`),`success`)}function me(){let t=I.trim();if(!t){J(void 0);return}if(!ce(t)){z(e(`nav.avatarUrlInvalid`));return}J(t)}function he(){T(),U(!1)}function ge(){V({title:e(`profile.backup.confirm.backupTitle`),message:e(`profile.backup.confirm.backupMessage`),confirmText:e(`profile.backup.action.cloudBackup`),onConfirm:async()=>{V(null),await E.backupToCloud()}})}function _e(){V({title:e(`profile.backup.confirm.restoreTitle`),message:e(`profile.backup.confirm.restoreMessage`),confirmText:e(`profile.backup.action.cloudRestore`),onConfirm:async()=>{V(null),await E.restoreFromCloud({confirm:!1})}})}function Y(){return new Promise(t=>{let n=e=>{V(null),t(e)};V({title:e(`profile.backup.confirm.importTitle`),message:e(`profile.backup.confirm.restore`),confirmText:e(`profile.backup.action.importLocal`),onConfirm:()=>n(!0),onClose:()=>n(!1)})})}function ve(){E.importLocalBackup({requestConfirm:Y})}let X=E.action===`backup`,Z=E.action===`restore`,Q=E.action===`export`,$=E.action===`import`;return(0,j.jsxs)(k,{header:W,children:[(0,j.jsx)(`section`,{className:`profile-page`,children:(0,j.jsxs)(`div`,{className:`profile-container`,children:[(0,j.jsxs)(`section`,{className:`profile-panel profile-backup-panel`,children:[(0,j.jsx)(`div`,{className:`profile-panel-header`,children:(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`h2`,{children:e(`profile.section.backup`)}),(0,j.jsx)(`p`,{children:e(`profile.section.backup.desc`)})]})}),(0,j.jsxs)(`div`,{className:`profile-backup-actions`,children:[(0,j.jsxs)(`button`,{type:`button`,className:`btn btn-secondary ${Q?`btn-loading`:``}`,onClick:E.exportLocalBackup,disabled:E.busy,children:[Q?(0,j.jsx)(_,{size:16,className:`ui-spinner`}):(0,j.jsx)(ee,{size:16}),e(Q?`profile.backup.status.exporting`:`profile.backup.action.exportLocal`)]}),(0,j.jsxs)(`button`,{type:`button`,className:`btn btn-secondary ${$?`btn-loading`:``}`,onClick:ve,disabled:E.busy,children:[$?(0,j.jsx)(_,{size:16,className:`ui-spinner`}):(0,j.jsx)(ne,{size:16}),e($?`profile.backup.status.importing`:`profile.backup.action.importLocal`)]}),(0,j.jsxs)(`button`,{type:`button`,className:`btn btn-primary ${X?`btn-loading`:``}`,onClick:ge,disabled:E.busy,children:[X?(0,j.jsx)(_,{size:16,className:`ui-spinner`}):(0,j.jsx)(ie,{size:16}),e(X?`profile.backup.status.backingUp`:`profile.backup.action.cloudBackup`)]}),(0,j.jsxs)(`button`,{type:`button`,className:`btn btn-secondary ${Z?`btn-loading`:``}`,onClick:_e,disabled:E.busy,children:[Z?(0,j.jsx)(_,{size:16,className:`ui-spinner`}):(0,j.jsx)(re,{size:16}),e(Z?`profile.backup.status.restoring`:`profile.backup.action.cloudRestore`)]})]})]}),(0,j.jsxs)(`header`,{className:`profile-header`,children:[(0,j.jsx)(`img`,{className:`profile-avatar-large`,src:de,alt:``}),(0,j.jsxs)(`div`,{className:`profile-heading`,children:[(0,j.jsx)(`p`,{className:`profile-kicker`,children:e(`profile.kicker`)}),(0,j.jsx)(`h1`,{children:r.displayName||r.username}),(0,j.jsxs)(`div`,{className:`profile-address-line`,children:[(0,j.jsx)(`code`,{translate:`no`,children:K}),(0,j.jsx)(h,{text:K}),(0,j.jsxs)(`a`,{href:`https://debank.com/profile/${r.address}`,target:`_blank`,rel:`noopener noreferrer`,className:`btn btn-secondary btn-sm`,children:[(0,j.jsx)(d,{size:14}),e(`web3.action.view`)]})]})]}),(0,j.jsxs)(`button`,{type:`button`,className:`btn btn-secondary profile-logout-btn`,onClick:()=>U(!0),children:[(0,j.jsx)(ae,{size:16}),e(`account.logout`)]})]}),(0,j.jsxs)(`div`,{className:`profile-grid`,children:[(0,j.jsxs)(`section`,{className:`profile-panel`,children:[(0,j.jsx)(`div`,{className:`profile-panel-header`,children:(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`h2`,{children:e(`profile.section.account`)}),(0,j.jsx)(`p`,{children:e(`profile.section.account.desc`)})]})}),(0,j.jsxs)(`label`,{className:`profile-field`,children:[(0,j.jsx)(`span`,{children:e(`profile.label.displayName`)}),(0,j.jsxs)(`div`,{className:`profile-field-row`,children:[(0,j.jsx)(`input`,{className:`input`,value:M,onChange:e=>F(e.target.value),placeholder:e(`nav.displayNamePlaceholder`)}),(0,j.jsxs)(`button`,{type:`button`,className:`btn btn-primary`,onClick:pe,children:[(0,j.jsx)(v,{size:16}),e(`profile.action.save`)]})]})]}),(0,j.jsxs)(`div`,{className:`profile-facts`,children:[(0,j.jsx)(N,{label:e(`profile.label.username`),value:r.username}),(0,j.jsx)(N,{label:e(`web3.label.address`),value:r.address,copy:!0})]})]}),(0,j.jsxs)(`section`,{className:`profile-panel`,children:[(0,j.jsx)(`div`,{className:`profile-panel-header`,children:(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`h2`,{children:e(`profile.section.avatar`)}),(0,j.jsx)(`p`,{children:e(`profile.section.avatar.desc`)})]})}),(0,j.jsx)(`div`,{className:`profile-avatar-grid`,role:`list`,children:se.map(t=>{let n=ue===t.value;return(0,j.jsxs)(`button`,{type:`button`,className:[`profile-avatar-option`,n?`selected`:``].filter(Boolean).join(` `),onClick:()=>J(t.value),"aria-pressed":n,title:e(t.labelKey),children:[(0,j.jsx)(`img`,{src:S(r.address,t.value),alt:``,"aria-hidden":`true`}),(0,j.jsx)(`span`,{children:e(t.labelKey)}),n&&(0,j.jsx)(`span`,{className:`profile-avatar-check`,children:(0,j.jsx)(u,{size:14})})]},t.value||`address`)})}),(0,j.jsxs)(`div`,{className:`profile-avatar-url`,children:[(0,j.jsxs)(`label`,{className:`profile-field`,htmlFor:`profile-avatar-url`,children:[(0,j.jsx)(`span`,{children:e(`profile.label.customAvatar`)}),(0,j.jsxs)(`div`,{className:`profile-field-row`,children:[(0,j.jsx)(`input`,{id:`profile-avatar-url`,className:`input`,value:I,onChange:e=>{L(e.target.value),z(``)},placeholder:e(`nav.avatarUrlPlaceholder`)}),(0,j.jsxs)(`button`,{type:`button`,className:`btn btn-secondary`,onClick:me,disabled:!fe,children:[(0,j.jsx)(v,{size:16}),e(`profile.action.save`)]})]})]}),R&&(0,j.jsx)(`p`,{className:`profile-error`,children:R})]})]})]}),(0,j.jsxs)(`section`,{className:`profile-panel profile-identity-panel`,children:[(0,j.jsxs)(`div`,{className:`profile-panel-header`,children:[(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`h2`,{children:e(`profile.section.identity`)}),(0,j.jsx)(`p`,{children:e(`profile.section.identity.desc`)})]}),(0,j.jsxs)(i,{to:`/web3/`,hash:`wallet`,className:`btn btn-secondary`,children:[(0,j.jsx)(oe,{size:16}),e(`profile.action.openWallet`)]})]}),(0,j.jsxs)(`div`,{className:`profile-key-grid`,children:[G&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(P,{title:e(`web3.label.ed25519Public`),icon:(0,j.jsx)(f,{size:18}),value:G.ed_public_key}),(0,j.jsx)(P,{title:e(`web3.label.x25519Public`),icon:(0,j.jsx)(g,{size:18}),value:G.public_key})]}),(0,j.jsx)(P,{title:`IPNS ID`,icon:(0,j.jsx)(te,{size:18}),value:le||`-`})]})]})]})}),H&&(0,j.jsx)(s,{title:e(`account.logoutTitle`),message:e(`account.logoutConfirm`),confirmText:e(`account.logout`),danger:!0,onConfirm:he,onClose:()=>U(!1)}),B&&(0,j.jsx)(s,{title:B.title,message:B.message,confirmText:B.confirmText,danger:B.danger,onConfirm:B.onConfirm,onClose:B.onClose||(()=>V(null))})]})}function N({label:e,value:t,copy:n=!1}){return(0,j.jsxs)(`div`,{className:`profile-fact`,children:[(0,j.jsx)(`span`,{children:e}),(0,j.jsxs)(`div`,{className:`profile-fact-value`,children:[(0,j.jsx)(`code`,{translate:`no`,children:t}),n&&(0,j.jsx)(h,{text:t})]})]})}function P({title:e,icon:t,value:n}){return(0,j.jsxs)(`div`,{className:`profile-key-card`,children:[(0,j.jsxs)(`div`,{className:`profile-key-card-header`,children:[(0,j.jsx)(`span`,{className:`profile-key-card-icon`,children:t}),(0,j.jsx)(`span`,{children:e})]}),(0,j.jsxs)(`div`,{className:`mono-row`,children:[(0,j.jsx)(`code`,{className:`mono`,translate:`no`,children:n}),(0,j.jsx)(h,{text:n})]})]})}var F=a(`/profile/`)({component:M});export{F as Route};
1
+ import{n as e,o as t,t as n}from"./jsx-runtime-Bt-cYkS5.js";import{C as r,D as i,T as a,l as o,r as s,s as c}from"./ui-BpDGD3IR.js";import{a as l}from"./i18n-NjvOSuV6.js";import{i as u}from"./LanguageToggle-CSQtRZ3A.js";import{t as ee}from"./download-jEPn2njL.js";import{t as d}from"./external-link-BFaoZeK0.js";import{a as f,i as p,n as m,r as h}from"./mp-B6kdA94c.js";import{t as g}from"./key-round-DNcpSuMw.js";import{t as _}from"./loader-BXQtdens.js";import{t as v}from"./save-BjrbPwhJ.js";import{t as te}from"./shield-check-DzDuWO8r.js";import{t as ne}from"./upload-CoCptKya.js";import{a as y,c as b,f as x,i as S,l as C,n as w,o as T,r as E,s as D}from"./index-C-_ZwxuN.js";import{t as O}from"./MarketingHeader-B45AaM29.js";import{t as k}from"./MarketingLayout-A00pEOa2.js";var re=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`}]]),ie=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`}]]),ae=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`}]]),oe=r(`wallet-cards`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M3 9a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2`,key:`4125el`}],[`path`,{d:`M3 11h3c.8 0 1.6.3 2.1.9l1.1.9c1.6 1.6 4.1 1.6 5.7 0l1.1-.9c.5-.5 1.3-.9 2.1-.9H21`,key:`1dpki6`}]]),A=t(e(),1),j=n(),se=[{value:``,labelKey:`profile.avatar.address`},...E.map(e=>({value:y(e),labelKey:`profile.avatar.${e}`}))];function ce(e){if(T(e))return!0;try{let t=new URL(e);return t.protocol===`http:`||t.protocol===`https:`}catch{return!1}}function M(){let{t:e}=l(),t=b(e=>e.addToast),n=b(e=>e.hasBackend),r=c(e=>e.identity),a=c(e=>e.openLoginModal),y=c(e=>e.setUserIdentity),T=c(e=>e.logoutUser),E=w(),[M,F]=(0,A.useState)(``),[I,L]=(0,A.useState)(``),[R,z]=(0,A.useState)(``),[B,V]=(0,A.useState)(null),[H,U]=(0,A.useState)(!1),W=(0,j.jsx)(O,{});(0,A.useEffect)(()=>{if(!r){F(``),L(``),z(``);return}F(r.displayName||r.username),L(D(r.avatar)||r.avatar||``),z(``)},[r]);let G=(0,A.useMemo)(()=>r?o(r.danger):null,[r]),le=(0,A.useMemo)(()=>G?m(G.private_key,G.ed_public_key):``,[G]);if(!r)return(0,j.jsx)(k,{header:W,children:(0,j.jsx)(`section`,{className:`profile-page`,children:(0,j.jsx)(`div`,{className:`profile-container narrow`,children:(0,j.jsxs)(`div`,{className:`profile-empty glass`,children:[(0,j.jsx)(`div`,{className:`profile-empty-icon`,children:(0,j.jsx)(p,{size:34})}),(0,j.jsx)(`h1`,{children:e(`profile.signedOut.title`)}),(0,j.jsx)(`p`,{children:e(`profile.signedOut.desc`)}),(0,j.jsxs)(`button`,{type:`button`,className:`btn btn-primary`,onClick:a,children:[(0,j.jsx)(p,{size:16}),e(`account.signIn`)]})]})})})});let ue=D(r.avatar)||r.avatar||``,de=S(r.address,r.avatar),K=r.address.toLowerCase(),fe=I.trim().length>0;async function q(r){if(n===!0)try{await C.put(`/api/user/profile`,{json:{displayName:r.displayName||r.username,avatar:r.avatar||``,updatedAt:r.profileUpdatedAt||Date.now()}}).json()}catch(n){t(await x(n,e(`profile.backup.error.profileSaveFailed`)),`error`)}}function J(n){if(!r)return;let i={...r,avatar:n||void 0,profileUpdatedAt:Date.now()};y(i),q(i),z(``),t(e(`profile.toast.avatarUpdated`),`success`)}function pe(){if(!r)return;let n=M.trim()||r.username,i={...r,displayName:n,profileUpdatedAt:Date.now()};y(i),q(i),F(n),t(e(`profile.toast.saved`),`success`)}function me(){let t=I.trim();if(!t){J(void 0);return}if(!ce(t)){z(e(`nav.avatarUrlInvalid`));return}J(t)}function he(){T(),U(!1)}function ge(){V({title:e(`profile.backup.confirm.backupTitle`),message:e(`profile.backup.confirm.backupMessage`),confirmText:e(`profile.backup.action.cloudBackup`),onConfirm:async()=>{V(null),await E.backupToCloud()}})}function _e(){V({title:e(`profile.backup.confirm.restoreTitle`),message:e(`profile.backup.confirm.restoreMessage`),confirmText:e(`profile.backup.action.cloudRestore`),onConfirm:async()=>{V(null),await E.restoreFromCloud({confirm:!1})}})}function Y(){return new Promise(t=>{let n=e=>{V(null),t(e)};V({title:e(`profile.backup.confirm.importTitle`),message:e(`profile.backup.confirm.restore`),confirmText:e(`profile.backup.action.importLocal`),onConfirm:()=>n(!0),onClose:()=>n(!1)})})}function ve(){E.importLocalBackup({requestConfirm:Y})}let X=E.action===`backup`,Z=E.action===`restore`,Q=E.action===`export`,$=E.action===`import`;return(0,j.jsxs)(k,{header:W,children:[(0,j.jsx)(`section`,{className:`profile-page`,children:(0,j.jsxs)(`div`,{className:`profile-container`,children:[(0,j.jsxs)(`section`,{className:`profile-panel profile-backup-panel`,children:[(0,j.jsx)(`div`,{className:`profile-panel-header`,children:(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`h2`,{children:e(`profile.section.backup`)}),(0,j.jsx)(`p`,{children:e(`profile.section.backup.desc`)})]})}),(0,j.jsxs)(`div`,{className:`profile-backup-actions`,children:[(0,j.jsxs)(`button`,{type:`button`,className:`btn btn-secondary ${Q?`btn-loading`:``}`,onClick:E.exportLocalBackup,disabled:E.busy,children:[Q?(0,j.jsx)(_,{size:16,className:`ui-spinner`}):(0,j.jsx)(ee,{size:16}),e(Q?`profile.backup.status.exporting`:`profile.backup.action.exportLocal`)]}),(0,j.jsxs)(`button`,{type:`button`,className:`btn btn-secondary ${$?`btn-loading`:``}`,onClick:ve,disabled:E.busy,children:[$?(0,j.jsx)(_,{size:16,className:`ui-spinner`}):(0,j.jsx)(ne,{size:16}),e($?`profile.backup.status.importing`:`profile.backup.action.importLocal`)]}),(0,j.jsxs)(`button`,{type:`button`,className:`btn btn-primary ${X?`btn-loading`:``}`,onClick:ge,disabled:E.busy,children:[X?(0,j.jsx)(_,{size:16,className:`ui-spinner`}):(0,j.jsx)(ie,{size:16}),e(X?`profile.backup.status.backingUp`:`profile.backup.action.cloudBackup`)]}),(0,j.jsxs)(`button`,{type:`button`,className:`btn btn-secondary ${Z?`btn-loading`:``}`,onClick:_e,disabled:E.busy,children:[Z?(0,j.jsx)(_,{size:16,className:`ui-spinner`}):(0,j.jsx)(re,{size:16}),e(Z?`profile.backup.status.restoring`:`profile.backup.action.cloudRestore`)]})]})]}),(0,j.jsxs)(`header`,{className:`profile-header`,children:[(0,j.jsx)(`img`,{className:`profile-avatar-large`,src:de,alt:``}),(0,j.jsxs)(`div`,{className:`profile-heading`,children:[(0,j.jsx)(`p`,{className:`profile-kicker`,children:e(`profile.kicker`)}),(0,j.jsx)(`h1`,{children:r.displayName||r.username}),(0,j.jsxs)(`div`,{className:`profile-address-line`,children:[(0,j.jsx)(`code`,{translate:`no`,children:K}),(0,j.jsx)(h,{text:K}),(0,j.jsxs)(`a`,{href:`https://debank.com/profile/${r.address}`,target:`_blank`,rel:`noopener noreferrer`,className:`btn btn-secondary btn-sm`,children:[(0,j.jsx)(d,{size:14}),e(`web3.action.view`)]})]})]}),(0,j.jsxs)(`button`,{type:`button`,className:`btn btn-secondary profile-logout-btn`,onClick:()=>U(!0),children:[(0,j.jsx)(ae,{size:16}),e(`account.logout`)]})]}),(0,j.jsxs)(`div`,{className:`profile-grid`,children:[(0,j.jsxs)(`section`,{className:`profile-panel`,children:[(0,j.jsx)(`div`,{className:`profile-panel-header`,children:(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`h2`,{children:e(`profile.section.account`)}),(0,j.jsx)(`p`,{children:e(`profile.section.account.desc`)})]})}),(0,j.jsxs)(`label`,{className:`profile-field`,children:[(0,j.jsx)(`span`,{children:e(`profile.label.displayName`)}),(0,j.jsxs)(`div`,{className:`profile-field-row`,children:[(0,j.jsx)(`input`,{className:`input`,value:M,onChange:e=>F(e.target.value),placeholder:e(`nav.displayNamePlaceholder`)}),(0,j.jsxs)(`button`,{type:`button`,className:`btn btn-primary`,onClick:pe,children:[(0,j.jsx)(v,{size:16}),e(`profile.action.save`)]})]})]}),(0,j.jsxs)(`div`,{className:`profile-facts`,children:[(0,j.jsx)(N,{label:e(`profile.label.username`),value:r.username}),(0,j.jsx)(N,{label:e(`web3.label.address`),value:r.address,copy:!0})]})]}),(0,j.jsxs)(`section`,{className:`profile-panel`,children:[(0,j.jsx)(`div`,{className:`profile-panel-header`,children:(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`h2`,{children:e(`profile.section.avatar`)}),(0,j.jsx)(`p`,{children:e(`profile.section.avatar.desc`)})]})}),(0,j.jsx)(`div`,{className:`profile-avatar-grid`,role:`list`,children:se.map(t=>{let n=ue===t.value;return(0,j.jsxs)(`button`,{type:`button`,className:[`profile-avatar-option`,n?`selected`:``].filter(Boolean).join(` `),onClick:()=>J(t.value),"aria-pressed":n,title:e(t.labelKey),children:[(0,j.jsx)(`img`,{src:S(r.address,t.value),alt:``,"aria-hidden":`true`}),(0,j.jsx)(`span`,{children:e(t.labelKey)}),n&&(0,j.jsx)(`span`,{className:`profile-avatar-check`,children:(0,j.jsx)(u,{size:14})})]},t.value||`address`)})}),(0,j.jsxs)(`div`,{className:`profile-avatar-url`,children:[(0,j.jsxs)(`label`,{className:`profile-field`,htmlFor:`profile-avatar-url`,children:[(0,j.jsx)(`span`,{children:e(`profile.label.customAvatar`)}),(0,j.jsxs)(`div`,{className:`profile-field-row`,children:[(0,j.jsx)(`input`,{id:`profile-avatar-url`,className:`input`,value:I,onChange:e=>{L(e.target.value),z(``)},placeholder:e(`nav.avatarUrlPlaceholder`)}),(0,j.jsxs)(`button`,{type:`button`,className:`btn btn-secondary`,onClick:me,disabled:!fe,children:[(0,j.jsx)(v,{size:16}),e(`profile.action.save`)]})]})]}),R&&(0,j.jsx)(`p`,{className:`profile-error`,children:R})]})]})]}),(0,j.jsxs)(`section`,{className:`profile-panel profile-identity-panel`,children:[(0,j.jsxs)(`div`,{className:`profile-panel-header`,children:[(0,j.jsxs)(`div`,{children:[(0,j.jsx)(`h2`,{children:e(`profile.section.identity`)}),(0,j.jsx)(`p`,{children:e(`profile.section.identity.desc`)})]}),(0,j.jsxs)(i,{to:`/web3/`,hash:`wallet`,className:`btn btn-secondary`,children:[(0,j.jsx)(oe,{size:16}),e(`profile.action.openWallet`)]})]}),(0,j.jsxs)(`div`,{className:`profile-key-grid`,children:[G&&(0,j.jsxs)(j.Fragment,{children:[(0,j.jsx)(P,{title:e(`web3.label.ed25519Public`),icon:(0,j.jsx)(f,{size:18}),value:G.ed_public_key}),(0,j.jsx)(P,{title:e(`web3.label.x25519Public`),icon:(0,j.jsx)(g,{size:18}),value:G.public_key})]}),(0,j.jsx)(P,{title:`IPNS ID`,icon:(0,j.jsx)(te,{size:18}),value:le||`-`})]})]})]})}),H&&(0,j.jsx)(s,{title:e(`account.logoutTitle`),message:e(`account.logoutConfirm`),confirmText:e(`account.logout`),danger:!0,onConfirm:he,onClose:()=>U(!1)}),B&&(0,j.jsx)(s,{title:B.title,message:B.message,confirmText:B.confirmText,danger:B.danger,onConfirm:B.onConfirm,onClose:B.onClose||(()=>V(null))})]})}function N({label:e,value:t,copy:n=!1}){return(0,j.jsxs)(`div`,{className:`profile-fact`,children:[(0,j.jsx)(`span`,{children:e}),(0,j.jsxs)(`div`,{className:`profile-fact-value`,children:[(0,j.jsx)(`code`,{translate:`no`,children:t}),n&&(0,j.jsx)(h,{text:t})]})]})}function P({title:e,icon:t,value:n}){return(0,j.jsxs)(`div`,{className:`profile-key-card`,children:[(0,j.jsxs)(`div`,{className:`profile-key-card-header`,children:[(0,j.jsx)(`span`,{className:`profile-key-card-icon`,children:t}),(0,j.jsx)(`span`,{children:e})]}),(0,j.jsxs)(`div`,{className:`mono-row`,children:[(0,j.jsx)(`code`,{className:`mono`,translate:`no`,children:n}),(0,j.jsx)(h,{text:n})]})]})}var F=a(`/profile/`)({component:M});export{F as Route};
@@ -1 +1 @@
1
- import{n as e,o as t,t as n}from"./jsx-runtime-Bt-cYkS5.js";import{T as r,c as i,s as a}from"./ui-BpDGD3IR.js";import{a as o,i as s,n as c}from"./i18n-NjvOSuV6.js";import{i as l,n as u,r as d}from"./LanguageToggle-CSQtRZ3A.js";import{t as f}from"./circle-alert-iuHzciph.js";import{t as p}from"./key-round-DNcpSuMw.js";import{n as m,t as h}from"./SidebarHomeLink-BdsUM4Kt.js";import{L as g,_,c as v,d as y,u as b,v as x,y as S}from"./index-BZ-f0CZd.js";import{i as C,t as w}from"./userProfile-DBkH4s29.js";var T=t(e(),1),E=[{name:`node_url`,required:!1,descriptionKey:`chatJoin.field.nodeUrl`},{name:`node_invite`,required:!1,descriptionKey:`chatJoin.field.nodeInvite`},{name:`uid`,required:!0,descriptionKey:`chatJoin.field.uid`},{name:`identity`,required:!1,descriptionKey:`chatJoin.field.identity`},{name:`logo`,required:!1,descriptionKey:`chatJoin.field.logo`},{name:`avatar`,required:!1,descriptionKey:`chatJoin.field.avatar`},{name:`name`,required:!1,descriptionKey:`chatJoin.field.name`},{name:`locale`,required:!1,descriptionKey:`chatJoin.field.locale`},{name:`channels[].id`,required:!0,descriptionKey:`chatJoin.field.channelId`},{name:`channels[].name`,required:!1,descriptionKey:`chatJoin.field.channelName`}];function D(e){let t=typeof e==`string`?e.trim():e;return c(t)?t:void 0}function O(e){return String(e||``).trim().replace(/\/+$/,``)}function k(e){return String(e||``).trim()}function A({inviteNodeUrl:e,inviteNodeInvite:t,hasBackend:n,activeBackendUrl:r,activeRemoteUrl:i,activeRemoteInvite:a}){let o=O(e),s=O(i),c=O(r);return!!o&&!!s&&n===!0&&c===s&&s===o&&k(a)===k(t)}function j(e){return!!O(e.inviteNodeUrl)&&!A(e)}var M=`data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"%3E%3Crect width="64" height="64" rx="16" fill="%232f7dd1"/%3E%3Ccircle cx="32" cy="25" r="11" fill="%23f8fbff"/%3E%3Cpath d="M14 56c3-12 12-18 18-18s15 6 18 18" fill="%23f8fbff"/%3E%3C/svg%3E`,N=`data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"%3E%3Crect width="64" height="64" rx="16" fill="%230f9f7a"/%3E%3Cpath d="M18 20h28v22H18z" rx="6" fill="%23f7fff9"/%3E%3Ccircle cx="27" cy="31" r="3" fill="%230f9f7a"/%3E%3Ccircle cx="37" cy="31" r="3" fill="%230f9f7a"/%3E%3Cpath d="M29 39h6" stroke="%230f9f7a" stroke-width="4" stroke-linecap="round"/%3E%3Cpath d="M32 12v8" stroke="%23f7fff9" stroke-width="5" stroke-linecap="round"/%3E%3C/svg%3E`,P=Object.freeze({id:`chatjoin_support`,name:`User / Service 测试频道`}),F=Object.freeze([Object.freeze({uid:`user`,identity:`user`,name:`测试用户`,avatar:M}),Object.freeze({uid:`service`,identity:`service`,name:`测试客服`,avatar:N})]),I=Object.freeze(F.map(e=>Object.freeze({locale:`zh-CN`,uid:e.uid,identity:e.identity,avatar:e.avatar,name:e.name,channels:[P]})));function L(e){let t=String(e||``).trim();return I.find(e=>e.uid===t)||null}function R(e){return JSON.stringify(e,null,2)}var z=n(),B=`0x955fe80bdb8312165471fcacd6a8f83df88a770dda6f38657ca4e62ec28d5b54`,V=50,H=`https://api.most.box`;function U(e){try{return JSON.parse(e)}catch{return null}}function W(e){return typeof e==`string`?U(e):e}function G(e,t){return t===null?e:JSON.stringify(t,null,2)}function K(e,t,n){if(t&&typeof t==`object`&&`error`in t){let e=t.error;if(typeof e==`string`)return e}return e||n}function q(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function J(e){return typeof e==`string`?e.trim():``}function Y(e){let t=J(e);return t===`user`||t===`service`||t===`service_ai`?t:void 0}function X(e){let t=W(e);if(!q(t))return null;let n=J(t.uid),r=(Array.isArray(t.channels)?t.channels:[]).filter(q).map(e=>({id:J(e.id),name:J(e.name)||void 0})).filter(e=>e.id);return!n||r.length===0?null:{node_url:J(t.node_url)||void 0,node_invite:J(t.node_invite)||void 0,locale:D(t.locale),uid:n,identity:Y(t.identity),logo:J(t.logo)||void 0,avatar:J(t.avatar)||void 0,name:J(t.name)||void 0,channels:r}}function Z(e){return`/chat?channel=${encodeURIComponent(e)}`}function Q(e){return String(e||``).trim().slice(0,V)}function $(){let{t:e,setLocale:t}=o(),n=g({select:e=>e.searchStr}),{token:r,pub:c,fixture:D}=(0,T.useMemo)(()=>{let e=new URLSearchParams(n);return{token:e.get(`token`)||``,pub:e.get(`pub`)||``,fixture:e.get(`fixture`)||``}},[n]),O=v(e=>e.isDarkMode),k=v(e=>e.setIsDarkMode),A=v(e=>e.hasBackend),M=a(e=>e.setUserIdentity),[N,P]=(0,T.useState)(``),[F,I]=(0,T.useState)(``),[V,W]=(0,T.useState)(!0),[q,J]=(0,T.useState)(``),Y=(0,T.useRef)(``);return(0,T.useEffect)(()=>{let n=L(D);if(D&&!n){I(e(`chatJoin.error.unknownFixture`,{fixture:D})),W(!1);return}if(!n&&!r){I(e(`chatJoin.error.missingToken`)),W(!1);return}if(!n&&!c){I(e(`chatJoin.error.missingPub`)),W(!1);return}if(A===null){J(e(`chatJoin.status.checkingBackend`));return}let a=n?`fixture:${D}`:`${r}:${c}`;if(Y.current===a)return;Y.current=a;async function o(n){let r=(t,r)=>n.locale?s(t,n.locale,r):e(t,r);n.locale&&t(n.locale);let a=S(),o=x(),c=_();if(j({inviteNodeUrl:n.node_url,inviteNodeInvite:n.node_invite,hasBackend:A,activeBackendUrl:c,activeRemoteUrl:a,activeRemoteInvite:o})){if(J(r(`chatJoin.status.connectingRemote`)),!(await b({url:n.node_url,invite:n.node_invite||``})).ok)throw Error(r(`chatJoin.error.remoteConnectFailed`));y({url:n.node_url,invite:n.node_invite||``}),v.setState({hasBackend:!0})}else if(!A)throw Error(r(`chatJoin.error.noBackend`));J(r(`chatJoin.status.signingIn`));let l=i(n.uid,``),u={...l,identity:n.identity,displayName:n.name||l.displayName,logo:n.logo,avatar:n.avatar};M(u),J(r(`chatJoin.status.joiningChannel`));let d=``;for(let e of n.channels){let t=await C.createChannel(e.id,`public`,w(u)),n=t.channelKey||t.key||e.id;d||=n;let r=Q(e.name);r&&await C.setChannelRemark(n,r)}let f=n.channels[0];J(r(`chatJoin.status.openingChannel`)),window.location.href=Z(d||f.id)}async function l(){try{if(n){J(e(`chatJoin.status.loadingFixture`,{name:n.name||D})),P(R(n)),await o(n);return}J(e(`chatJoin.status.decryptingInvite`));let t=await fetch(`${H}/api/chat.join.decrypt`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({token:r,pub:c})}),i=await t.text(),a=U(i);if(!t.ok)I(K(i,a,e(`chatJoin.error.decrypt`)));else{P(G(i,a));let t=X(a);if(!t){I(e(`chatJoin.error.invalidInvite`));return}await o(t)}}catch(t){I(e(`chatJoin.error.request`,{message:t instanceof Error?t.message:String(t)}))}finally{W(!1)}}l()},[D,A,c,t,M,e,r]),(0,z.jsx)(m,{sidebar:()=>(0,z.jsx)(h,{}),headerTitle:(0,z.jsx)(`h2`,{className:`header-title`,children:e(`chatJoin.title`)}),headerRight:(0,z.jsx)(`button`,{className:`btn btn-icon`,onClick:()=>k(!O),title:e(`common.theme.toggle`),children:O?(0,z.jsx)(u,{size:16}):(0,z.jsx)(d,{size:16})}),children:(0,z.jsx)(`div`,{className:`chat-join-container`,children:(0,z.jsxs)(`div`,{className:`chat-join-panel`,children:[V?(0,z.jsxs)(`div`,{className:`chat-join-loading`,children:[(0,z.jsx)(p,{size:32}),(0,z.jsx)(`p`,{children:q||e(`chatJoin.status.decrypting`)})]}):F?(0,z.jsxs)(`div`,{className:`chat-join-error`,children:[(0,z.jsx)(f,{size:32}),(0,z.jsx)(`p`,{children:F}),q&&(0,z.jsx)(`p`,{className:`chat-join-status`,children:q}),N&&(0,z.jsx)(`pre`,{className:`chat-join-result`,translate:`no`,children:N})]}):(0,z.jsxs)(`div`,{className:`chat-join-success`,children:[(0,z.jsx)(l,{size:32}),(0,z.jsx)(`p`,{children:q||e(`chatJoin.status.decryptSuccess`)}),(0,z.jsx)(`pre`,{className:`chat-join-result`,translate:`no`,children:N})]}),(0,z.jsxs)(`section`,{className:`chat-join-spec`,"aria-labelledby":`chat-join-spec-title`,children:[(0,z.jsxs)(`div`,{className:`chat-join-helper-title`,children:[(0,z.jsx)(p,{size:18}),(0,z.jsx)(`h3`,{id:`chat-join-spec-title`,children:e(`chatJoin.specTitle`)})]}),(0,z.jsx)(`div`,{className:`chat-join-field-list`,children:E.map(t=>(0,z.jsxs)(`div`,{className:`chat-join-field`,children:[(0,z.jsxs)(`div`,{className:`chat-join-field-meta`,children:[(0,z.jsx)(`code`,{className:`chat-join-field-name`,children:t.name}),(0,z.jsx)(`span`,{children:t.required?e(`chatJoin.field.required`):e(`chatJoin.field.optional`)})]}),(0,z.jsx)(`p`,{children:e(t.descriptionKey)})]},t.name))})]}),(0,z.jsxs)(`section`,{className:`chat-join-helper`,"aria-labelledby":`ea-test-title`,children:[(0,z.jsxs)(`div`,{className:`chat-join-helper-title`,children:[(0,z.jsx)(p,{size:18}),(0,z.jsx)(`h3`,{id:`ea-test-title`,children:e(`chatJoin.testPublicKey`)})]}),(0,z.jsx)(`code`,{className:`ui-code-box chat-join-public-key`,translate:`no`,children:B}),(0,z.jsx)(`a`,{className:`btn`,href:`/web3/#EA`,target:`_blank`,children:e(`chatJoin.openWeb3`)})]})]})})})}function ee(){return(0,z.jsx)(T.Suspense,{children:(0,z.jsx)($,{})})}var te=r(`/chat/join/`)({component:ee});export{te as Route};
1
+ import{n as e,o as t,t as n}from"./jsx-runtime-Bt-cYkS5.js";import{T as r,c as i,s as a}from"./ui-BpDGD3IR.js";import{a as o,i as s,n as c}from"./i18n-NjvOSuV6.js";import{i as l,n as u,r as d}from"./LanguageToggle-CSQtRZ3A.js";import{t as f}from"./circle-alert-iuHzciph.js";import{t as p}from"./key-round-DNcpSuMw.js";import{n as m,t as h}from"./SidebarHomeLink-qMFEGjZt.js";import{L as g,_,c as v,d as y,u as b,v as x,y as S}from"./index-C-_ZwxuN.js";import{i as C,t as w}from"./userProfile-DwZip0Dt.js";var T=t(e(),1),E=[{name:`node_url`,required:!1,descriptionKey:`chatJoin.field.nodeUrl`},{name:`node_invite`,required:!1,descriptionKey:`chatJoin.field.nodeInvite`},{name:`uid`,required:!0,descriptionKey:`chatJoin.field.uid`},{name:`identity`,required:!1,descriptionKey:`chatJoin.field.identity`},{name:`logo`,required:!1,descriptionKey:`chatJoin.field.logo`},{name:`avatar`,required:!1,descriptionKey:`chatJoin.field.avatar`},{name:`name`,required:!1,descriptionKey:`chatJoin.field.name`},{name:`locale`,required:!1,descriptionKey:`chatJoin.field.locale`},{name:`channels[].id`,required:!0,descriptionKey:`chatJoin.field.channelId`},{name:`channels[].name`,required:!1,descriptionKey:`chatJoin.field.channelName`}];function D(e){let t=typeof e==`string`?e.trim():e;return c(t)?t:void 0}function O(e){return String(e||``).trim().replace(/\/+$/,``)}function k(e){return String(e||``).trim()}function A({inviteNodeUrl:e,inviteNodeInvite:t,hasBackend:n,activeBackendUrl:r,activeRemoteUrl:i,activeRemoteInvite:a}){let o=O(e),s=O(i),c=O(r);return!!o&&!!s&&n===!0&&c===s&&s===o&&k(a)===k(t)}function j(e){return!!O(e.inviteNodeUrl)&&!A(e)}var M=`data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"%3E%3Crect width="64" height="64" rx="16" fill="%232f7dd1"/%3E%3Ccircle cx="32" cy="25" r="11" fill="%23f8fbff"/%3E%3Cpath d="M14 56c3-12 12-18 18-18s15 6 18 18" fill="%23f8fbff"/%3E%3C/svg%3E`,N=`data:image/svg+xml,%3Csvg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 64 64"%3E%3Crect width="64" height="64" rx="16" fill="%230f9f7a"/%3E%3Cpath d="M18 20h28v22H18z" rx="6" fill="%23f7fff9"/%3E%3Ccircle cx="27" cy="31" r="3" fill="%230f9f7a"/%3E%3Ccircle cx="37" cy="31" r="3" fill="%230f9f7a"/%3E%3Cpath d="M29 39h6" stroke="%230f9f7a" stroke-width="4" stroke-linecap="round"/%3E%3Cpath d="M32 12v8" stroke="%23f7fff9" stroke-width="5" stroke-linecap="round"/%3E%3C/svg%3E`,P=Object.freeze({id:`chatjoin_support`,name:`User / Service 测试频道`}),F=Object.freeze([Object.freeze({uid:`user`,identity:`user`,name:`测试用户`,avatar:M}),Object.freeze({uid:`service`,identity:`service`,name:`测试客服`,avatar:N})]),I=Object.freeze(F.map(e=>Object.freeze({locale:`zh-CN`,uid:e.uid,identity:e.identity,avatar:e.avatar,name:e.name,channels:[P]})));function L(e){let t=String(e||``).trim();return I.find(e=>e.uid===t)||null}function R(e){return JSON.stringify(e,null,2)}var z=n(),B=`0x955fe80bdb8312165471fcacd6a8f83df88a770dda6f38657ca4e62ec28d5b54`,V=50,H=`https://api.most.box`;function U(e){try{return JSON.parse(e)}catch{return null}}function W(e){return typeof e==`string`?U(e):e}function G(e,t){return t===null?e:JSON.stringify(t,null,2)}function K(e,t,n){if(t&&typeof t==`object`&&`error`in t){let e=t.error;if(typeof e==`string`)return e}return e||n}function q(e){return!!e&&typeof e==`object`&&!Array.isArray(e)}function J(e){return typeof e==`string`?e.trim():``}function Y(e){let t=J(e);return t===`user`||t===`service`||t===`service_ai`?t:void 0}function X(e){let t=W(e);if(!q(t))return null;let n=J(t.uid),r=(Array.isArray(t.channels)?t.channels:[]).filter(q).map(e=>({id:J(e.id),name:J(e.name)||void 0})).filter(e=>e.id);return!n||r.length===0?null:{node_url:J(t.node_url)||void 0,node_invite:J(t.node_invite)||void 0,locale:D(t.locale),uid:n,identity:Y(t.identity),logo:J(t.logo)||void 0,avatar:J(t.avatar)||void 0,name:J(t.name)||void 0,channels:r}}function Z(e){return`/chat?channel=${encodeURIComponent(e)}`}function Q(e){return String(e||``).trim().slice(0,V)}function $(){let{t:e,setLocale:t}=o(),n=g({select:e=>e.searchStr}),{token:r,pub:c,fixture:D}=(0,T.useMemo)(()=>{let e=new URLSearchParams(n);return{token:e.get(`token`)||``,pub:e.get(`pub`)||``,fixture:e.get(`fixture`)||``}},[n]),O=v(e=>e.isDarkMode),k=v(e=>e.setIsDarkMode),A=v(e=>e.hasBackend),M=a(e=>e.setUserIdentity),[N,P]=(0,T.useState)(``),[F,I]=(0,T.useState)(``),[V,W]=(0,T.useState)(!0),[q,J]=(0,T.useState)(``),Y=(0,T.useRef)(``);return(0,T.useEffect)(()=>{let n=L(D);if(D&&!n){I(e(`chatJoin.error.unknownFixture`,{fixture:D})),W(!1);return}if(!n&&!r){I(e(`chatJoin.error.missingToken`)),W(!1);return}if(!n&&!c){I(e(`chatJoin.error.missingPub`)),W(!1);return}if(A===null){J(e(`chatJoin.status.checkingBackend`));return}let a=n?`fixture:${D}`:`${r}:${c}`;if(Y.current===a)return;Y.current=a;async function o(n){let r=(t,r)=>n.locale?s(t,n.locale,r):e(t,r);n.locale&&t(n.locale);let a=S(),o=x(),c=_();if(j({inviteNodeUrl:n.node_url,inviteNodeInvite:n.node_invite,hasBackend:A,activeBackendUrl:c,activeRemoteUrl:a,activeRemoteInvite:o})){if(J(r(`chatJoin.status.connectingRemote`)),!(await b({url:n.node_url,invite:n.node_invite||``})).ok)throw Error(r(`chatJoin.error.remoteConnectFailed`));y({url:n.node_url,invite:n.node_invite||``}),v.setState({hasBackend:!0})}else if(!A)throw Error(r(`chatJoin.error.noBackend`));J(r(`chatJoin.status.signingIn`));let l=i(n.uid,``),u={...l,identity:n.identity,displayName:n.name||l.displayName,logo:n.logo,avatar:n.avatar};M(u),J(r(`chatJoin.status.joiningChannel`));let d=``;for(let e of n.channels){let t=await C.createChannel(e.id,`public`,w(u)),n=t.channelKey||t.key||e.id;d||=n;let r=Q(e.name);r&&await C.setChannelRemark(n,r)}let f=n.channels[0];J(r(`chatJoin.status.openingChannel`)),window.location.href=Z(d||f.id)}async function l(){try{if(n){J(e(`chatJoin.status.loadingFixture`,{name:n.name||D})),P(R(n)),await o(n);return}J(e(`chatJoin.status.decryptingInvite`));let t=await fetch(`${H}/api/chat.join.decrypt`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({token:r,pub:c})}),i=await t.text(),a=U(i);if(!t.ok)I(K(i,a,e(`chatJoin.error.decrypt`)));else{P(G(i,a));let t=X(a);if(!t){I(e(`chatJoin.error.invalidInvite`));return}await o(t)}}catch(t){I(e(`chatJoin.error.request`,{message:t instanceof Error?t.message:String(t)}))}finally{W(!1)}}l()},[D,A,c,t,M,e,r]),(0,z.jsx)(m,{sidebar:()=>(0,z.jsx)(h,{}),headerTitle:(0,z.jsx)(`h2`,{className:`header-title`,children:e(`chatJoin.title`)}),headerRight:(0,z.jsx)(`button`,{className:`btn btn-icon`,onClick:()=>k(!O),title:e(`common.theme.toggle`),children:O?(0,z.jsx)(u,{size:16}):(0,z.jsx)(d,{size:16})}),children:(0,z.jsx)(`div`,{className:`chat-join-container`,children:(0,z.jsxs)(`div`,{className:`chat-join-panel`,children:[V?(0,z.jsxs)(`div`,{className:`chat-join-loading`,children:[(0,z.jsx)(p,{size:32}),(0,z.jsx)(`p`,{children:q||e(`chatJoin.status.decrypting`)})]}):F?(0,z.jsxs)(`div`,{className:`chat-join-error`,children:[(0,z.jsx)(f,{size:32}),(0,z.jsx)(`p`,{children:F}),q&&(0,z.jsx)(`p`,{className:`chat-join-status`,children:q}),N&&(0,z.jsx)(`pre`,{className:`chat-join-result`,translate:`no`,children:N})]}):(0,z.jsxs)(`div`,{className:`chat-join-success`,children:[(0,z.jsx)(l,{size:32}),(0,z.jsx)(`p`,{children:q||e(`chatJoin.status.decryptSuccess`)}),(0,z.jsx)(`pre`,{className:`chat-join-result`,translate:`no`,children:N})]}),(0,z.jsxs)(`section`,{className:`chat-join-spec`,"aria-labelledby":`chat-join-spec-title`,children:[(0,z.jsxs)(`div`,{className:`chat-join-helper-title`,children:[(0,z.jsx)(p,{size:18}),(0,z.jsx)(`h3`,{id:`chat-join-spec-title`,children:e(`chatJoin.specTitle`)})]}),(0,z.jsx)(`div`,{className:`chat-join-field-list`,children:E.map(t=>(0,z.jsxs)(`div`,{className:`chat-join-field`,children:[(0,z.jsxs)(`div`,{className:`chat-join-field-meta`,children:[(0,z.jsx)(`code`,{className:`chat-join-field-name`,children:t.name}),(0,z.jsx)(`span`,{children:t.required?e(`chatJoin.field.required`):e(`chatJoin.field.optional`)})]}),(0,z.jsx)(`p`,{children:e(t.descriptionKey)})]},t.name))})]}),(0,z.jsxs)(`section`,{className:`chat-join-helper`,"aria-labelledby":`ea-test-title`,children:[(0,z.jsxs)(`div`,{className:`chat-join-helper-title`,children:[(0,z.jsx)(p,{size:18}),(0,z.jsx)(`h3`,{id:`ea-test-title`,children:e(`chatJoin.testPublicKey`)})]}),(0,z.jsx)(`code`,{className:`ui-code-box chat-join-public-key`,translate:`no`,children:B}),(0,z.jsx)(`a`,{className:`btn`,href:`/web3/#EA`,target:`_blank`,children:e(`chatJoin.openWeb3`)})]})]})})})}function ee(){return(0,z.jsx)(T.Suspense,{children:(0,z.jsx)($,{})})}var te=r(`/chat/join/`)({component:ee});export{te as Route};