most-box 0.3.3 → 0.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -6
- package/out/about/index.html +20 -0
- package/out/admin/index.html +0 -0
- package/out/app/index.html +0 -0
- package/out/assets/AccountMenu-D-wa5tux.js +1 -0
- package/out/assets/AppShell-BdRKZIZ9.js +1 -0
- package/out/assets/AppTop-BE5kKBYH.js +1 -0
- package/out/assets/CopyButton-DnFqfCN9.js +1 -0
- package/out/assets/MarketingHeader-8gNzHawY.js +1 -0
- package/out/assets/MarketingLayout-BPdjpEfc.js +1 -0
- package/out/assets/{MilkdownEditor-DXVbZsH_.js → MilkdownEditor-C388llV6.js} +1 -1
- package/out/assets/OpenSidebarButton-OP8zl7ad.js +1 -0
- package/out/assets/arrow-right-BsHzC0ZL.js +1 -0
- package/out/assets/{arrow-up-down-B-677ip8.js → arrow-up-down-DvLSz6Ma.js} +1 -1
- package/out/assets/{userProfile-BZvkCuet.js → channelApi-C5eHetoJ.js} +1 -1
- package/out/assets/chatJoinInvite-CeC6H6t8.js +1 -0
- package/out/assets/{chatNoteDraft-CYbvcEvC.js → chatNoteDraft-DTy6In5R.js} +1 -1
- package/out/assets/{circle-alert-dfN4T6Nq.js → circle-alert-DXVkx8p8.js} +1 -1
- package/out/assets/{copy-B7pPZ2MP.js → copy-OwXDsstV.js} +1 -1
- package/out/assets/{download-COQOcPqI.js → download-Cy2BlfKM.js} +1 -1
- package/out/assets/downloadValidation-Dd43i9_9.js +1 -0
- package/out/assets/{external-link-D6tHlYgS.js → external-link-D_AQSgxW.js} +1 -1
- package/out/assets/{file-text-DiyIGL1I.js → file-text-zvTER2mN.js} +1 -1
- package/out/assets/fingerprint-pattern-BT73ASEB.js +1 -0
- package/out/assets/{folder-BS_GbpPQ.js → folder-6pYYnS2-.js} +1 -1
- package/out/assets/folder-open-DOJ4bB58.js +1 -0
- package/out/assets/format-CAKfypjK.js +1 -0
- package/out/assets/gamepad-2-BYqNgCQr.js +1 -0
- package/out/assets/{hard-drive-Cqa7Rstj.js → hard-drive-DL1KJHmG.js} +1 -1
- package/out/assets/i18n-C6yaqRst.js +1 -0
- package/out/assets/index-C6IjeTBh.css +1 -0
- package/out/assets/index-D1mozno-.js +31 -0
- package/out/assets/index.lazy-59kmyNMW.js +1 -0
- package/out/assets/index.lazy-B1iJsXQ8.js +3 -0
- package/out/assets/index.lazy-Bz77Jlzu.js +1 -0
- package/out/assets/index.lazy-CVFcovqX.js +1 -0
- package/out/assets/index.lazy-CX2l1_Gi.js +1 -0
- package/out/assets/index.lazy-C_J9afOY.js +1 -0
- package/out/assets/index.lazy-CazlK1-Y.js +3 -0
- package/out/assets/index.lazy-CflWbocP.js +1 -0
- package/out/assets/index.lazy-ClrSkRx5.js +1 -0
- package/out/assets/index.lazy-CsTaY5WS.js +1 -0
- package/out/assets/index.lazy-D7E1pb1S.js +5 -0
- package/out/assets/index.lazy-DzaN9qwA.js +2 -0
- package/out/assets/index.lazy-FvXAYdEO.js +1 -0
- package/out/assets/index.lazy-JwrS2vDI.js +1 -0
- package/out/assets/index.lazy-m9XAzMt1.js +1 -0
- package/out/assets/{loader-CwyHYZdX.js → loader-C4pED_QP.js} +1 -1
- package/out/assets/lock-yG7M7GkB.js +1 -0
- package/out/assets/{message-square-BgsNXPft.js → message-square-CfApq8Ou.js} +1 -1
- package/out/assets/mp-cEQteKUC.js +1 -0
- package/out/assets/{music-Dn9nm9Qb.js → music-Br2x8TKX.js} +1 -1
- package/out/assets/notebook-pen-Bcd3MrtD.js +1 -0
- package/out/assets/play-DSHtNcOe.js +1 -0
- package/out/assets/{refresh-cw-D4BsHvhi.js → refresh-cw-CfkUlTK9.js} +1 -1
- package/out/assets/{save-B02sbO9Y.js → save-CfYzXcxH.js} +1 -1
- package/out/assets/saveLocalFile-2CNt4X0T.js +1 -0
- package/out/assets/search-DLBOUfny.js +1 -0
- package/out/assets/{send-4dhnJGuS.js → send-Bie9hgHI.js} +1 -1
- package/out/assets/{shield-check-Boae7Nc6.js → shield-check-2-h_eEXp.js} +1 -1
- package/out/assets/{smartphone-JXH-zQXB.js → smartphone-CrsocYJo.js} +1 -1
- package/out/assets/trash-2-B9gno5q6.js +1 -0
- package/out/assets/{triangle-alert-B9sMiA9l.js → triangle-alert-BhNtjKm2.js} +1 -1
- package/out/assets/{upload-DVuXJt_o.js → upload-BmufnMFu.js} +1 -1
- package/out/assets/{useAppStore-DOnk608w.js → useAppStore-DNhyhD20.js} +1 -1
- package/out/assets/useChannelMessages-DDBqKBXU.js +4 -0
- package/out/assets/useGameRoom-asr2gyY6.js +1 -0
- package/out/assets/{wallet-D9Iw4YWE.js → wallet-D6HZocla.js} +1 -1
- package/out/assets/{wifi-ljEI_ySA.js → wifi-CILQyKk0.js} +1 -1
- package/out/chat/index.html +0 -0
- package/out/chat/join/demo/index.html +0 -0
- package/out/chat/join/index.html +0 -0
- package/out/download/index.html +2 -2
- package/out/game/gandengyan/index.html +0 -0
- package/out/game/index.html +0 -0
- package/out/game/zhajinhua/index.html +0 -0
- package/out/index.html +2 -2
- package/out/note/index.html +0 -0
- package/out/ping/index.html +2 -2
- package/out/profile/index.html +0 -0
- package/out/web3/index.html +0 -0
- package/package.json +1 -1
- package/server/index.js +18 -1
- package/server/src/core/channelVoice.js +164 -0
- package/server/src/core/mostLink.js +30 -13
- package/server/src/core/releaseManifest.js +10 -3
- package/server/src/http/nodeStatus.js +2 -2
- package/server/src/http/routes/fileRoutes.js +10 -8
- package/server/src/http/uploads.js +53 -15
- package/server/src/index.js +126 -57
- package/server/src/node/config.js +4 -4
- package/server/src/utils/api.js +9 -1
- package/server/src/utils/avatar.js +1 -10
- package/server/src/utils/downloadMessages.js +7 -7
- package/server/src/utils/errors.js +11 -1
- package/server/src/utils/userIdentity.js +0 -1
- package/out/assets/AccountMenu-D36x3rKH.js +0 -1
- package/out/assets/AppTop-qtp-3wqv.js +0 -1
- package/out/assets/CopyButton-C00LHzxo.js +0 -1
- package/out/assets/FilePreviewOverlay-BvOCftIV.js +0 -1
- package/out/assets/MarketingHeader-D7AjEmWU.js +0 -1
- package/out/assets/MarketingLayout-BVw4vr-u.js +0 -1
- package/out/assets/OpenSidebarButton-DI6Ld8um.js +0 -1
- package/out/assets/arrow-right-CXzRt0Fp.js +0 -1
- package/out/assets/chatJoinInvite-aCHhLrlm.js +0 -1
- package/out/assets/check-iBCQl0yr.js +0 -1
- package/out/assets/chevron-right-D75NRNNs.js +0 -1
- package/out/assets/downloadValidation-UPgpJbKz.js +0 -1
- package/out/assets/format-CR8oUWq6.js +0 -1
- package/out/assets/index-CUzbruyP.js +0 -31
- package/out/assets/index-FV6RZlVI.css +0 -1
- package/out/assets/index.lazy-08bEbzIk.js +0 -1
- package/out/assets/index.lazy-6b-8jxXI.js +0 -1
- package/out/assets/index.lazy-B4pxVFWK.js +0 -2
- package/out/assets/index.lazy-Bi5KZylP.js +0 -5
- package/out/assets/index.lazy-CJnFeoy4.js +0 -1
- package/out/assets/index.lazy-CRV2-Y6z.js +0 -3
- package/out/assets/index.lazy-CzCHV559.js +0 -1
- package/out/assets/index.lazy-DrfZ9XTR.js +0 -1
- package/out/assets/index.lazy-DuvCRtpm.js +0 -1
- package/out/assets/index.lazy-DxOIgf3c.js +0 -1
- package/out/assets/index.lazy-FNVWBYth.js +0 -1
- package/out/assets/index.lazy-Itk05ouU.js +0 -1
- package/out/assets/index.lazy-_CazgyO7.js +0 -1
- package/out/assets/index.lazy-odd8ydDw.js +0 -3
- package/out/assets/key-round-JR8M3aHl.js +0 -1
- package/out/assets/lock-CuwwlXlx.js +0 -1
- package/out/assets/mp-Dv12gDTx.js +0 -1
- package/out/assets/notebook-pen-BzrCXQJE.js +0 -1
- package/out/assets/play-CvWKSMwY.js +0 -1
- package/out/assets/search-HW4oPOBP.js +0 -1
- package/out/assets/trash-2-BLwoM0ME.js +0 -1
- package/out/assets/useChannelMessages-CDvw-f_x.js +0 -4
- package/out/assets/useGameRoom-CATo4XWU.js +0 -1
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{n as e,o as t,r as n,t as r}from"./jsx-runtime-Bt-cYkS5.js";import{B as i,H as a,d as o,n as s,o as c,t as l,u}from"./useAppStore-DNhyhD20.js";import{a as d}from"./i18n-C6yaqRst.js";import{t as f}from"./triangle-alert-BhNtjKm2.js";import{t as p}from"./arrow-up-down-DvLSz6Ma.js";import{n as m,t as h}from"./trash-2-B9gno5q6.js";import{t as g}from"./download-Cy2BlfKM.js";import{t as _}from"./file-text-zvTER2mN.js";import{t as v}from"./hard-drive-DL1KJHmG.js";import{t as ee}from"./refresh-cw-CfkUlTK9.js";import{t as te}from"./save-CfYzXcxH.js";import{t as ne}from"./shield-check-2-h_eEXp.js";import{t as re}from"./wifi-CILQyKk0.js";import{I as ie,b as ae,k as oe,x as se}from"./index-D1mozno-.js";import{t as y}from"./dayjs.min-Dcc0B6Je.js";import{t as ce}from"./MarketingHeader-8gNzHawY.js";import{t as b}from"./format-CAKfypjK.js";var le=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`}]]),ue=i(`arrow-down`,[[`path`,{d:`M12 5v14`,key:`s699le`}],[`path`,{d:`m19 12-7 7-7-7`,key:`1idqje`}]]),x=i(`arrow-up`,[[`path`,{d:`m5 12 7-7 7 7`,key:`hav0vg`}],[`path`,{d:`M12 19V5`,key:`x0mq9r`}]]),de=i(`chevron-left`,[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]),S=i(`chevrons-left`,[[`path`,{d:`m11 17-5-5 5-5`,key:`13zhaf`}],[`path`,{d:`m18 17-5-5 5-5`,key:`h8a8et`}]]),fe=i(`chevrons-right`,[[`path`,{d:`m6 17 5-5-5-5`,key:`xnjwq`}],[`path`,{d:`m13 17 5-5-5-5`,key:`17xmmf`}]]),pe=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`}]]),me=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`}]]),C=t(e(),1);function w(e,t){return typeof e==`function`?e(t):e}function T(e,t){return n=>{t.setState(t=>({...t,[e]:w(n,t[e])}))}}function E(e){return e instanceof Function}function D(e){return Array.isArray(e)&&e.every(e=>typeof e==`number`)}function he(e,t){let n=[],r=e=>{e.forEach(e=>{n.push(e);let i=t(e);i!=null&&i.length&&r(i)})};return r(e),n}function O(e,t,n){let r=[],i;return a=>{let o;n.key&&n.debug&&(o=Date.now());let s=e(a);if(!(s.length!==r.length||s.some((e,t)=>r[t]!==e)))return i;r=s;let c;if(n.key&&n.debug&&(c=Date.now()),i=t(...s),n==null||n.onChange==null||n.onChange(i),n.key&&n.debug&&n!=null&&n.debug()){let e=Math.round((Date.now()-o)*100)/100,t=Math.round((Date.now()-c)*100)/100,r=t/16,i=(e,t)=>{for(e=String(e);e.length<t;)e=` `+e;return e};console.info(`%c⏱ ${i(t,5)} /${i(e,5)} ms`,`
|
|
2
|
+
font-size: .6rem;
|
|
3
|
+
font-weight: bold;
|
|
4
|
+
color: hsl(${Math.max(0,Math.min(120-120*r,120))}deg 100% 31%);`,n?.key)}return i}}function k(e,t,n,r){return{debug:()=>e?.debugAll??e[t],key:!1,onChange:r}}function ge(e,t,n,r){let i={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(r),renderValue:()=>i.getValue()??e.options.renderFallbackValue,getContext:O(()=>[e,n,t,i],(e,t,n,r)=>({table:e,column:t,row:n,cell:r,getValue:r.getValue,renderValue:r.renderValue}),k(e.options,`debugCells`,`cell.getContext`))};return e._features.forEach(r=>{r.createCell==null||r.createCell(i,n,t,e)},{}),i}function _e(e,t,n,r){let i={...e._getDefaultColumnDef(),...t},a=i.accessorKey,o=i.id??(a?typeof String.prototype.replaceAll==`function`?a.replaceAll(`.`,`_`):a.replace(/\./g,`_`):void 0)??(typeof i.header==`string`?i.header:void 0),s;if(i.accessorFn?s=i.accessorFn:a&&(s=a.includes(`.`)?e=>{let t=e;for(let e of a.split(`.`))t=t?.[e];return t}:e=>e[i.accessorKey]),!o)throw Error();let c={id:`${String(o)}`,accessorFn:s,parent:r,depth:n,columnDef:i,columns:[],getFlatColumns:O(()=>[!0],()=>[c,...c.columns?.flatMap(e=>e.getFlatColumns())],k(e.options,`debugColumns`,`column.getFlatColumns`)),getLeafColumns:O(()=>[e._getOrderColumnsFn()],e=>{var t;return(t=c.columns)!=null&&t.length?e(c.columns.flatMap(e=>e.getLeafColumns())):[c]},k(e.options,`debugColumns`,`column.getLeafColumns`))};for(let t of e._features)t.createColumn==null||t.createColumn(c,e);return c}var A=`debugHeaders`;function ve(e,t,n){let r={id:n.id??t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{let e=[],t=n=>{n.subHeaders&&n.subHeaders.length&&n.subHeaders.map(t),e.push(n)};return t(r),e},getContext:()=>({table:e,header:r,column:t})};return e._features.forEach(t=>{t.createHeader==null||t.createHeader(r,e)}),r}var ye={createTable:e=>{e.getHeaderGroups=O(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,i)=>{let a=r?.map(e=>n.find(t=>t.id===e)).filter(Boolean)??[],o=i?.map(e=>n.find(t=>t.id===e)).filter(Boolean)??[],s=n.filter(e=>!(r!=null&&r.includes(e.id))&&!(i!=null&&i.includes(e.id)));return j(t,[...a,...s,...o],e)},k(e.options,A,`getHeaderGroups`)),e.getCenterHeaderGroups=O(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,i)=>(n=n.filter(e=>!(r!=null&&r.includes(e.id))&&!(i!=null&&i.includes(e.id))),j(t,n,e,`center`)),k(e.options,A,`getCenterHeaderGroups`)),e.getLeftHeaderGroups=O(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,r)=>j(t,r?.map(e=>n.find(t=>t.id===e)).filter(Boolean)??[],e,`left`),k(e.options,A,`getLeftHeaderGroups`)),e.getRightHeaderGroups=O(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,r)=>j(t,r?.map(e=>n.find(t=>t.id===e)).filter(Boolean)??[],e,`right`),k(e.options,A,`getRightHeaderGroups`)),e.getFooterGroups=O(()=>[e.getHeaderGroups()],e=>[...e].reverse(),k(e.options,A,`getFooterGroups`)),e.getLeftFooterGroups=O(()=>[e.getLeftHeaderGroups()],e=>[...e].reverse(),k(e.options,A,`getLeftFooterGroups`)),e.getCenterFooterGroups=O(()=>[e.getCenterHeaderGroups()],e=>[...e].reverse(),k(e.options,A,`getCenterFooterGroups`)),e.getRightFooterGroups=O(()=>[e.getRightHeaderGroups()],e=>[...e].reverse(),k(e.options,A,`getRightFooterGroups`)),e.getFlatHeaders=O(()=>[e.getHeaderGroups()],e=>e.map(e=>e.headers).flat(),k(e.options,A,`getFlatHeaders`)),e.getLeftFlatHeaders=O(()=>[e.getLeftHeaderGroups()],e=>e.map(e=>e.headers).flat(),k(e.options,A,`getLeftFlatHeaders`)),e.getCenterFlatHeaders=O(()=>[e.getCenterHeaderGroups()],e=>e.map(e=>e.headers).flat(),k(e.options,A,`getCenterFlatHeaders`)),e.getRightFlatHeaders=O(()=>[e.getRightHeaderGroups()],e=>e.map(e=>e.headers).flat(),k(e.options,A,`getRightFlatHeaders`)),e.getCenterLeafHeaders=O(()=>[e.getCenterFlatHeaders()],e=>e.filter(e=>{var t;return!((t=e.subHeaders)!=null&&t.length)}),k(e.options,A,`getCenterLeafHeaders`)),e.getLeftLeafHeaders=O(()=>[e.getLeftFlatHeaders()],e=>e.filter(e=>{var t;return!((t=e.subHeaders)!=null&&t.length)}),k(e.options,A,`getLeftLeafHeaders`)),e.getRightLeafHeaders=O(()=>[e.getRightFlatHeaders()],e=>e.filter(e=>{var t;return!((t=e.subHeaders)!=null&&t.length)}),k(e.options,A,`getRightLeafHeaders`)),e.getLeafHeaders=O(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(e,t,n)=>[...e[0]?.headers??[],...t[0]?.headers??[],...n[0]?.headers??[]].map(e=>e.getLeafHeaders()).flat(),k(e.options,A,`getLeafHeaders`))}};function j(e,t,n,r){let i=0,a=function(e,t){t===void 0&&(t=1),i=Math.max(i,t),e.filter(e=>e.getIsVisible()).forEach(e=>{var n;(n=e.columns)!=null&&n.length&&a(e.columns,t+1)},0)};a(e);let o=[],s=(e,t)=>{let i={depth:t,id:[r,`${t}`].filter(Boolean).join(`_`),headers:[]},a=[];e.forEach(e=>{let o=[...a].reverse()[0],s=e.column.depth===i.depth,c,l=!1;if(s&&e.column.parent?c=e.column.parent:(c=e.column,l=!0),o&&o?.column===c)o.subHeaders.push(e);else{let i=ve(n,c,{id:[r,t,c.id,e?.id].filter(Boolean).join(`_`),isPlaceholder:l,placeholderId:l?`${a.filter(e=>e.column===c).length}`:void 0,depth:t,index:a.length});i.subHeaders.push(e),a.push(i)}i.headers.push(e),e.headerGroup=i}),o.push(i),t>0&&s(a,t-1)};s(t.map((e,t)=>ve(n,e,{depth:i,index:t})),i-1),o.reverse();let c=e=>e.filter(e=>e.column.getIsVisible()).map(e=>{let t=0,n=0,r=[0];e.subHeaders&&e.subHeaders.length?(r=[],c(e.subHeaders).forEach(e=>{let{colSpan:n,rowSpan:i}=e;t+=n,r.push(i)})):t=1;let i=Math.min(...r);return n+=i,e.colSpan=t,e.rowSpan=n,{colSpan:t,rowSpan:n}});return c(o[0]?.headers??[]),o}var be=(e,t,n,r,i,a,o)=>{let s={id:t,index:r,original:n,depth:i,parentId:o,_valuesCache:{},_uniqueValuesCache:{},getValue:t=>{if(s._valuesCache.hasOwnProperty(t))return s._valuesCache[t];let n=e.getColumn(t);if(n!=null&&n.accessorFn)return s._valuesCache[t]=n.accessorFn(s.original,r),s._valuesCache[t]},getUniqueValues:t=>{if(s._uniqueValuesCache.hasOwnProperty(t))return s._uniqueValuesCache[t];let n=e.getColumn(t);if(n!=null&&n.accessorFn)return n.columnDef.getUniqueValues?(s._uniqueValuesCache[t]=n.columnDef.getUniqueValues(s.original,r),s._uniqueValuesCache[t]):(s._uniqueValuesCache[t]=[s.getValue(t)],s._uniqueValuesCache[t])},renderValue:t=>s.getValue(t)??e.options.renderFallbackValue,subRows:a??[],getLeafRows:()=>he(s.subRows,e=>e.subRows),getParentRow:()=>s.parentId?e.getRow(s.parentId,!0):void 0,getParentRows:()=>{let e=[],t=s;for(;;){let n=t.getParentRow();if(!n)break;e.push(n),t=n}return e.reverse()},getAllCells:O(()=>[e.getAllLeafColumns()],t=>t.map(t=>ge(e,s,t,t.id)),k(e.options,`debugRows`,`getAllCells`)),_getAllCellsByColumnId:O(()=>[s.getAllCells()],e=>e.reduce((e,t)=>(e[t.column.id]=t,e),{}),k(e.options,`debugRows`,`getAllCellsByColumnId`))};for(let t=0;t<e._features.length;t++){let n=e._features[t];n==null||n.createRow==null||n.createRow(s,e)}return s},xe={createColumn:(e,t)=>{e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},M=(e,t,n)=>{var r,i;let a=n==null||(r=n.toString())==null?void 0:r.toLowerCase();return!!(!((i=e.getValue(t))==null||(i=i.toString())==null||(i=i.toLowerCase())==null)&&i.includes(a))};M.autoRemove=e=>B(e);var N=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};N.autoRemove=e=>B(e);var Se=(e,t,n)=>{var r;return((r=e.getValue(t))==null||(r=r.toString())==null?void 0:r.toLowerCase())===n?.toLowerCase()};Se.autoRemove=e=>B(e);var Ce=(e,t,n)=>e.getValue(t)?.includes(n);Ce.autoRemove=e=>B(e);var P=(e,t,n)=>!n.some(n=>{var r;return!((r=e.getValue(t))!=null&&r.includes(n))});P.autoRemove=e=>B(e)||!(e!=null&&e.length);var F=(e,t,n)=>n.some(n=>e.getValue(t)?.includes(n));F.autoRemove=e=>B(e)||!(e!=null&&e.length);var I=(e,t,n)=>e.getValue(t)===n;I.autoRemove=e=>B(e);var L=(e,t,n)=>e.getValue(t)==n;L.autoRemove=e=>B(e);var R=(e,t,n)=>{let[r,i]=n,a=e.getValue(t);return a>=r&&a<=i};R.resolveFilterValue=e=>{let[t,n]=e,r=typeof t==`number`?t:parseFloat(t),i=typeof n==`number`?n:parseFloat(n),a=t===null||Number.isNaN(r)?-1/0:r,o=n===null||Number.isNaN(i)?1/0:i;if(a>o){let e=a;a=o,o=e}return[a,o]},R.autoRemove=e=>B(e)||B(e[0])&&B(e[1]);var z={includesString:M,includesStringSensitive:N,equalsString:Se,arrIncludes:Ce,arrIncludesAll:P,arrIncludesSome:F,equals:I,weakEquals:L,inNumberRange:R};function B(e){return e==null||e===``}var we={getDefaultColumnDef:()=>({filterFn:`auto`}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:T(`columnFilters`,e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{let n=t.getCoreRowModel().flatRows[0]?.getValue(e.id);return typeof n==`string`?z.includesString:typeof n==`number`?z.inNumberRange:typeof n==`boolean`||typeof n==`object`&&n?z.equals:Array.isArray(n)?z.arrIncludes:z.weakEquals},e.getFilterFn=()=>E(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn===`auto`?e.getAutoFilterFn():t.options.filterFns?.[e.columnDef.filterFn]??z[e.columnDef.filterFn],e.getCanFilter=()=>(e.columnDef.enableColumnFilter??!0)&&(t.options.enableColumnFilters??!0)&&(t.options.enableFilters??!0)&&!!e.accessorFn,e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return(n=t.getState().columnFilters)==null||(n=n.find(t=>t.id===e.id))==null?void 0:n.value},e.getFilterIndex=()=>t.getState().columnFilters?.findIndex(t=>t.id===e.id)??-1,e.setFilterValue=n=>{t.setColumnFilters(t=>{let r=e.getFilterFn(),i=t?.find(t=>t.id===e.id),a=w(n,i?i.value:void 0);if(V(r,a,e))return t?.filter(t=>t.id!==e.id)??[];let o={id:e.id,value:a};return i?t?.map(t=>t.id===e.id?o:t)??[]:t!=null&&t.length?[...t,o]:[o]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{let n=e.getAllLeafColumns();e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(e=>w(t,e)?.filter(e=>{let t=n.find(t=>t.id===e.id);return!(t&&V(t.getFilterFn(),e.value,t))}))},e.resetColumnFilters=t=>{e.setColumnFilters(t?[]:e.initialState?.columnFilters??[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}};function V(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||t===void 0||typeof t==`string`&&!t}var H={sum:(e,t,n)=>n.reduce((t,n)=>{let r=n.getValue(e);return t+(typeof r==`number`?r:0)},0),min:(e,t,n)=>{let r;return n.forEach(t=>{let n=t.getValue(e);n!=null&&(r>n||r===void 0&&n>=n)&&(r=n)}),r},max:(e,t,n)=>{let r;return n.forEach(t=>{let n=t.getValue(e);n!=null&&(r<n||r===void 0&&n>=n)&&(r=n)}),r},extent:(e,t,n)=>{let r,i;return n.forEach(t=>{let n=t.getValue(e);n!=null&&(r===void 0?n>=n&&(r=i=n):(r>n&&(r=n),i<n&&(i=n)))}),[r,i]},mean:(e,t)=>{let n=0,r=0;if(t.forEach(t=>{let i=t.getValue(e);i!=null&&(i=+i)>=i&&(++n,r+=i)}),n)return r/n},median:(e,t)=>{if(!t.length)return;let n=t.map(t=>t.getValue(e));if(!D(n))return;if(n.length===1)return n[0];let r=Math.floor(n.length/2),i=n.sort((e,t)=>e-t);return n.length%2==0?(i[r-1]+i[r])/2:i[r]},unique:(e,t)=>Array.from(new Set(t.map(t=>t.getValue(e))).values()),uniqueCount:(e,t)=>new Set(t.map(t=>t.getValue(e))).size,count:(e,t)=>t.length},Te={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t;return((t=e.getValue())==null||t.toString==null?void 0:t.toString())??null},aggregationFn:`auto`}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:T(`grouping`,e),groupedColumnMode:`reorder`}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(t=>t!=null&&t.includes(e.id)?t.filter(t=>t!==e.id):[...t??[],e.id])},e.getCanGroup=()=>(e.columnDef.enableGrouping??!0)&&(t.options.enableGrouping??!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue),e.getIsGrouped=()=>t.getState().grouping?.includes(e.id),e.getGroupedIndex=()=>t.getState().grouping?.indexOf(e.id),e.getToggleGroupingHandler=()=>{let t=e.getCanGroup();return()=>{t&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{let n=t.getCoreRowModel().flatRows[0]?.getValue(e.id);if(typeof n==`number`)return H.sum;if(Object.prototype.toString.call(n)===`[object Date]`)return H.extent},e.getAggregationFn=()=>{if(!e)throw Error();return E(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn===`auto`?e.getAutoAggregationFn():t.options.aggregationFns?.[e.columnDef.aggregationFn]??H[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{e.setGrouping(t?[]:e.initialState?.grouping??[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];let r=t.getColumn(n);return r!=null&&r.columnDef.getGroupingValue?(e._groupingValuesCache[n]=r.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,r)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===n.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var t;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((t=n.subRows)!=null&&t.length)}}};function Ee(e,t,n){if(!(t!=null&&t.length)||!n)return e;let r=e.filter(e=>!t.includes(e.id));return n===`remove`?r:[...t.map(t=>e.find(e=>e.id===t)).filter(Boolean),...r]}var De={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:T(`columnOrder`,e)}),createColumn:(e,t)=>{e.getIndex=O(e=>[Y(t,e)],t=>t.findIndex(t=>t.id===e.id),k(t.options,`debugColumns`,`getIndex`)),e.getIsFirstColumn=n=>Y(t,n)[0]?.id===e.id,e.getIsLastColumn=n=>{let r=Y(t,n);return r[r.length-1]?.id===e.id}},createTable:e=>{e.setColumnOrder=t=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{e.setColumnOrder(t?[]:e.initialState.columnOrder??[])},e._getOrderColumnsFn=O(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(e,t,n)=>r=>{let i=[];if(!(e!=null&&e.length))i=r;else{let t=[...e],n=[...r];for(;n.length&&t.length;){let e=t.shift(),r=n.findIndex(t=>t.id===e);r>-1&&i.push(n.splice(r,1)[0])}i=[...i,...n]}return Ee(i,t,n)},k(e.options,`debugTable`,`_getOrderColumnsFn`))}},U=()=>({left:[],right:[]}),Oe={getInitialState:e=>({columnPinning:U(),...e}),getDefaultOptions:e=>({onColumnPinningChange:T(`columnPinning`,e)}),createColumn:(e,t)=>{e.pin=n=>{let r=e.getLeafColumns().map(e=>e.id).filter(Boolean);t.setColumnPinning(e=>n===`right`?{left:(e?.left??[]).filter(e=>!(r!=null&&r.includes(e))),right:[...(e?.right??[]).filter(e=>!(r!=null&&r.includes(e))),...r]}:n===`left`?{left:[...(e?.left??[]).filter(e=>!(r!=null&&r.includes(e))),...r],right:(e?.right??[]).filter(e=>!(r!=null&&r.includes(e)))}:{left:(e?.left??[]).filter(e=>!(r!=null&&r.includes(e))),right:(e?.right??[]).filter(e=>!(r!=null&&r.includes(e)))})},e.getCanPin=()=>e.getLeafColumns().some(e=>(e.columnDef.enablePinning??!0)&&(t.options.enableColumnPinning??t.options.enablePinning??!0)),e.getIsPinned=()=>{let n=e.getLeafColumns().map(e=>e.id),{left:r,right:i}=t.getState().columnPinning,a=n.some(e=>r?.includes(e)),o=n.some(e=>i?.includes(e));return a?`left`:o?`right`:!1},e.getPinnedIndex=()=>{var n;let r=e.getIsPinned();return r?((n=t.getState().columnPinning)==null||(n=n[r])==null?void 0:n.indexOf(e.id))??-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=O(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(e,t,n)=>{let r=[...t??[],...n??[]];return e.filter(e=>!r.includes(e.column.id))},k(t.options,`debugRows`,`getCenterVisibleCells`)),e.getLeftVisibleCells=O(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(e,t)=>(t??[]).map(t=>e.find(e=>e.column.id===t)).filter(Boolean).map(e=>({...e,position:`left`})),k(t.options,`debugRows`,`getLeftVisibleCells`)),e.getRightVisibleCells=O(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(e,t)=>(t??[]).map(t=>e.find(e=>e.column.id===t)).filter(Boolean).map(e=>({...e,position:`right`})),k(t.options,`debugRows`,`getRightVisibleCells`))},createTable:e=>{e.setColumnPinning=t=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>e.setColumnPinning(t?U():e.initialState?.columnPinning??U()),e.getIsSomeColumnsPinned=t=>{let n=e.getState().columnPinning;return t?!!n[t]?.length:!!(n.left?.length||n.right?.length)},e.getLeftLeafColumns=O(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(e,t)=>(t??[]).map(t=>e.find(e=>e.id===t)).filter(Boolean),k(e.options,`debugColumns`,`getLeftLeafColumns`)),e.getRightLeafColumns=O(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(e,t)=>(t??[]).map(t=>e.find(e=>e.id===t)).filter(Boolean),k(e.options,`debugColumns`,`getRightLeafColumns`)),e.getCenterLeafColumns=O(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(e,t,n)=>{let r=[...t??[],...n??[]];return e.filter(e=>!r.includes(e.id))},k(e.options,`debugColumns`,`getCenterLeafColumns`))}};function ke(e){return e||(typeof document<`u`?document:null)}var W={size:150,minSize:20,maxSize:2**53-1},G=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),K={getDefaultColumnDef:()=>W,getInitialState:e=>({columnSizing:{},columnSizingInfo:G(),...e}),getDefaultOptions:e=>({columnResizeMode:`onEnd`,columnResizeDirection:`ltr`,onColumnSizingChange:T(`columnSizing`,e),onColumnSizingInfoChange:T(`columnSizingInfo`,e)}),createColumn:(e,t)=>{e.getSize=()=>{let n=t.getState().columnSizing[e.id];return Math.min(Math.max(e.columnDef.minSize??W.minSize,n??e.columnDef.size??W.size),e.columnDef.maxSize??W.maxSize)},e.getStart=O(e=>[e,Y(t,e),t.getState().columnSizing],(t,n)=>n.slice(0,e.getIndex(t)).reduce((e,t)=>e+t.getSize(),0),k(t.options,`debugColumns`,`getStart`)),e.getAfter=O(e=>[e,Y(t,e),t.getState().columnSizing],(t,n)=>n.slice(e.getIndex(t)+1).reduce((e,t)=>e+t.getSize(),0),k(t.options,`debugColumns`,`getAfter`)),e.resetSize=()=>{t.setColumnSizing(t=>{let{[e.id]:n,...r}=t;return r})},e.getCanResize=()=>(e.columnDef.enableResizing??!0)&&(t.options.enableColumnResizing??!0),e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let t=0,n=e=>{e.subHeaders.length?e.subHeaders.forEach(n):t+=e.column.getSize()??0};return n(e),t},e.getStart=()=>{if(e.index>0){let t=e.headerGroup.headers[e.index-1];return t.getStart()+t.getSize()}return 0},e.getResizeHandler=n=>{let r=t.getColumn(e.column.id),i=r?.getCanResize();return a=>{if(!r||!i||(a.persist==null||a.persist(),J(a)&&a.touches&&a.touches.length>1))return;let o=e.getSize(),s=e?e.getLeafHeaders().map(e=>[e.column.id,e.column.getSize()]):[[r.id,r.getSize()]],c=J(a)?Math.round(a.touches[0].clientX):a.clientX,l={},u=(e,n)=>{typeof n==`number`&&(t.setColumnSizingInfo(e=>{let r=t.options.columnResizeDirection===`rtl`?-1:1,i=(n-(e?.startOffset??0))*r,a=Math.max(i/(e?.startSize??0),-.999999);return e.columnSizingStart.forEach(e=>{let[t,n]=e;l[t]=Math.round(Math.max(n+n*a,0)*100)/100}),{...e,deltaOffset:i,deltaPercentage:a}}),(t.options.columnResizeMode===`onChange`||e===`end`)&&t.setColumnSizing(e=>({...e,...l})))},d=e=>u(`move`,e),f=e=>{u(`end`,e),t.setColumnSizingInfo(e=>({...e,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},p=ke(n),m={moveHandler:e=>d(e.clientX),upHandler:e=>{p?.removeEventListener(`mousemove`,m.moveHandler),p?.removeEventListener(`mouseup`,m.upHandler),f(e.clientX)}},h={moveHandler:e=>(e.cancelable&&(e.preventDefault(),e.stopPropagation()),d(e.touches[0].clientX),!1),upHandler:e=>{p?.removeEventListener(`touchmove`,h.moveHandler),p?.removeEventListener(`touchend`,h.upHandler),e.cancelable&&(e.preventDefault(),e.stopPropagation()),f(e.touches[0]?.clientX)}},g=Ae()?{passive:!1}:!1;J(a)?(p?.addEventListener(`touchmove`,h.moveHandler,g),p?.addEventListener(`touchend`,h.upHandler,g)):(p?.addEventListener(`mousemove`,m.moveHandler,g),p?.addEventListener(`mouseup`,m.upHandler,g)),t.setColumnSizingInfo(e=>({...e,startOffset:c,startSize:o,deltaOffset:0,deltaPercentage:0,columnSizingStart:s,isResizingColumn:r.id}))}}},createTable:e=>{e.setColumnSizing=t=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{e.setColumnSizing(t?{}:e.initialState.columnSizing??{})},e.resetHeaderSizeInfo=t=>{e.setColumnSizingInfo(t?G():e.initialState.columnSizingInfo??G())},e.getTotalSize=()=>e.getHeaderGroups()[0]?.headers.reduce((e,t)=>e+t.getSize(),0)??0,e.getLeftTotalSize=()=>e.getLeftHeaderGroups()[0]?.headers.reduce((e,t)=>e+t.getSize(),0)??0,e.getCenterTotalSize=()=>e.getCenterHeaderGroups()[0]?.headers.reduce((e,t)=>e+t.getSize(),0)??0,e.getRightTotalSize=()=>e.getRightHeaderGroups()[0]?.headers.reduce((e,t)=>e+t.getSize(),0)??0}},q=null;function Ae(){if(typeof q==`boolean`)return q;let e=!1;try{let t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener(`test`,n,t),window.removeEventListener(`test`,n)}catch{e=!1}return q=e,q}function J(e){return e.type===`touchstart`}var je={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:T(`columnVisibility`,e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility(t=>({...t,[e.id]:n??!e.getIsVisible()}))},e.getIsVisible=()=>{let n=e.columns;return(n.length?n.some(e=>e.getIsVisible()):t.getState().columnVisibility?.[e.id])??!0},e.getCanHide=()=>(e.columnDef.enableHiding??!0)&&(t.options.enableHiding??!0),e.getToggleVisibilityHandler=()=>t=>{e.toggleVisibility==null||e.toggleVisibility(t.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=O(()=>[e.getAllCells(),t.getState().columnVisibility],e=>e.filter(e=>e.column.getIsVisible()),k(t.options,`debugRows`,`_getAllVisibleCells`)),e.getVisibleCells=O(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(e,t,n)=>[...e,...t,...n],k(t.options,`debugRows`,`getVisibleCells`))},createTable:e=>{let t=(t,n)=>O(()=>[n(),n().filter(e=>e.getIsVisible()).map(e=>e.id).join(`_`)],e=>e.filter(e=>e.getIsVisible==null?void 0:e.getIsVisible()),k(e.options,`debugColumns`,t));e.getVisibleFlatColumns=t(`getVisibleFlatColumns`,()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t(`getVisibleLeafColumns`,()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t(`getLeftVisibleLeafColumns`,()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t(`getRightVisibleLeafColumns`,()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t(`getCenterVisibleLeafColumns`,()=>e.getCenterLeafColumns()),e.setColumnVisibility=t=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(t),e.resetColumnVisibility=t=>{e.setColumnVisibility(t?{}:e.initialState.columnVisibility??{})},e.toggleAllColumnsVisible=t=>{t??=!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((e,n)=>({...e,[n.id]:t||!(n.getCanHide!=null&&n.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(e=>!(e.getIsVisible!=null&&e.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(e=>e.getIsVisible==null?void 0:e.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>t=>{e.toggleAllColumnsVisible(t.target?.checked)}}};function Y(e,t){return t?t===`center`?e.getCenterVisibleLeafColumns():t===`left`?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}var Me={createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,`__global__`),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,`__global__`),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,`__global__`),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},Ne={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:T(`globalFilter`,e),globalFilterFn:`auto`,getColumnCanGlobalFilter:t=>{var n;let r=(n=e.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[t.id])==null?void 0:n.getValue();return typeof r==`string`||typeof r==`number`}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>(e.columnDef.enableGlobalFilter??!0)&&(t.options.enableGlobalFilter??!0)&&(t.options.enableFilters??!0)&&((t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))??!0)&&!!e.accessorFn},createTable:e=>{e.getGlobalAutoFilterFn=()=>z.includesString,e.getGlobalFilterFn=()=>{let{globalFilterFn:t}=e.options;return E(t)?t:t===`auto`?e.getGlobalAutoFilterFn():e.options.filterFns?.[t]??z[t]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},Pe={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:T(`expanded`,e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{if(!t){e._queue(()=>{t=!0});return}if(e.options.autoResetAll??e.options.autoResetExpanded??!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}},e.setExpanded=t=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(t),e.toggleAllRowsExpanded=t=>{t??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=t=>{e.setExpanded(t?{}:e.initialState?.expanded??{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(e=>e.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>t=>{t.persist==null||t.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{let t=e.getState().expanded;return t===!0||Object.values(t).some(Boolean)},e.getIsAllRowsExpanded=()=>{let t=e.getState().expanded;return typeof t==`boolean`?t===!0:!(!Object.keys(t).length||e.getRowModel().flatRows.some(e=>!e.getIsExpanded()))},e.getExpandedDepth=()=>{let t=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(e=>{let n=e.split(`.`);t=Math.max(t,n.length)}),t},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,t)=>{e.toggleExpanded=n=>{t.setExpanded(r=>{let i=r===!0?!0:!!(r!=null&&r[e.id]),a={};if(r===!0?Object.keys(t.getRowModel().rowsById).forEach(e=>{a[e]=!0}):a=r,n??=!i,!i&&n)return{...a,[e.id]:!0};if(i&&!n){let{[e.id]:t,...n}=a;return n}return r})},e.getIsExpanded=()=>{let n=t.getState().expanded;return!!((t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))??(n===!0||n?.[e.id]))},e.getCanExpand=()=>{var n;return(t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))??((t.options.enableExpanding??!0)&&!!((n=e.subRows)!=null&&n.length))},e.getIsAllParentsExpanded=()=>{let n=!0,r=e;for(;n&&r.parentId;)r=t.getRow(r.parentId,!0),n=r.getIsExpanded();return n},e.getToggleExpandedHandler=()=>{let t=e.getCanExpand();return()=>{t&&e.toggleExpanded()}}}},Fe=0,Ie=10,Le=()=>({pageIndex:Fe,pageSize:Ie}),Re={getInitialState:e=>({...e,pagination:{...Le(),...e?.pagination}}),getDefaultOptions:e=>({onPaginationChange:T(`pagination`,e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{if(!t){e._queue(()=>{t=!0});return}if(e.options.autoResetAll??e.options.autoResetPageIndex??!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},e.setPagination=t=>e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(e=>w(t,e)),e.resetPagination=t=>{e.setPagination(t?Le():e.initialState.pagination??Le())},e.setPageIndex=t=>{e.setPagination(n=>{let r=w(t,n.pageIndex),i=e.options.pageCount===void 0||e.options.pageCount===-1?2**53-1:e.options.pageCount-1;return r=Math.max(0,Math.min(r,i)),{...n,pageIndex:r}})},e.resetPageIndex=t=>{var n;e.setPageIndex(t?Fe:((n=e.initialState)==null||(n=n.pagination)==null?void 0:n.pageIndex)??Fe)},e.resetPageSize=t=>{var n;e.setPageSize(t?Ie:((n=e.initialState)==null||(n=n.pagination)==null?void 0:n.pageSize)??Ie)},e.setPageSize=t=>{e.setPagination(e=>{let n=Math.max(1,w(t,e.pageSize)),r=e.pageSize*e.pageIndex,i=Math.floor(r/n);return{...e,pageIndex:i,pageSize:n}})},e.setPageCount=t=>e.setPagination(n=>{let r=w(t,e.options.pageCount??-1);return typeof r==`number`&&(r=Math.max(-1,r)),{...n,pageCount:r}}),e.getPageOptions=O(()=>[e.getPageCount()],e=>{let t=[];return e&&e>0&&(t=[...Array(e)].fill(null).map((e,t)=>t)),t},k(e.options,`debugTable`,`getPageOptions`)),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{let{pageIndex:t}=e.getState().pagination,n=e.getPageCount();return n===-1?!0:n===0?!1:t<n-1},e.previousPage=()=>e.setPageIndex(e=>e-1),e.nextPage=()=>e.setPageIndex(e=>e+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>e.options.pageCount??Math.ceil(e.getRowCount()/e.getState().pagination.pageSize),e.getRowCount=()=>e.options.rowCount??e.getPrePaginationRowModel().rows.length}},ze=()=>({top:[],bottom:[]}),Be={getInitialState:e=>({rowPinning:ze(),...e}),getDefaultOptions:e=>({onRowPinningChange:T(`rowPinning`,e)}),createRow:(e,t)=>{e.pin=(n,r,i)=>{let a=r?e.getLeafRows().map(e=>{let{id:t}=e;return t}):[],o=i?e.getParentRows().map(e=>{let{id:t}=e;return t}):[],s=new Set([...o,e.id,...a]);t.setRowPinning(e=>n===`bottom`?{top:(e?.top??[]).filter(e=>!(s!=null&&s.has(e))),bottom:[...(e?.bottom??[]).filter(e=>!(s!=null&&s.has(e))),...Array.from(s)]}:n===`top`?{top:[...(e?.top??[]).filter(e=>!(s!=null&&s.has(e))),...Array.from(s)],bottom:(e?.bottom??[]).filter(e=>!(s!=null&&s.has(e)))}:{top:(e?.top??[]).filter(e=>!(s!=null&&s.has(e))),bottom:(e?.bottom??[]).filter(e=>!(s!=null&&s.has(e)))})},e.getCanPin=()=>{let{enableRowPinning:n,enablePinning:r}=t.options;return typeof n==`function`?n(e):n??r??!0},e.getIsPinned=()=>{let n=[e.id],{top:r,bottom:i}=t.getState().rowPinning,a=n.some(e=>r?.includes(e)),o=n.some(e=>i?.includes(e));return a?`top`:o?`bottom`:!1},e.getPinnedIndex=()=>{let n=e.getIsPinned();return n?((n===`top`?t.getTopRows():t.getBottomRows())?.map(e=>{let{id:t}=e;return t}))?.indexOf(e.id)??-1:-1}},createTable:e=>{e.setRowPinning=t=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>e.setRowPinning(t?ze():e.initialState?.rowPinning??ze()),e.getIsSomeRowsPinned=t=>{let n=e.getState().rowPinning;return t?!!n[t]?.length:!!(n.top?.length||n.bottom?.length)},e._getPinnedRows=(t,n,r)=>(e.options.keepPinnedRows??!0?(n??[]).map(t=>{let n=e.getRow(t,!0);return n.getIsAllParentsExpanded()?n:null}):(n??[]).map(e=>t.find(t=>t.id===e))).filter(Boolean).map(e=>({...e,position:r})),e.getTopRows=O(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,`top`),k(e.options,`debugRows`,`getTopRows`)),e.getBottomRows=O(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,`bottom`),k(e.options,`debugRows`,`getBottomRows`)),e.getCenterRows=O(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(e,t,n)=>{let r=new Set([...t??[],...n??[]]);return e.filter(e=>!r.has(e.id))},k(e.options,`debugRows`,`getCenterRows`))}},Ve={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:T(`rowSelection`,e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>e.setRowSelection(t?{}:e.initialState.rowSelection??{}),e.toggleAllRowsSelected=t=>{e.setRowSelection(n=>{t=t===void 0?!e.getIsAllRowsSelected():t;let r={...n},i=e.getPreGroupedRowModel().flatRows;return t?i.forEach(e=>{e.getCanSelect()&&(r[e.id]=!0)}):i.forEach(e=>{delete r[e.id]}),r})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{let r=t===void 0?!e.getIsAllPageRowsSelected():t,i={...n};return e.getRowModel().rows.forEach(t=>{He(i,t.id,r,!0,e)}),i}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=O(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?Ue(e,n):{rows:[],flatRows:[],rowsById:{}},k(e.options,`debugTable`,`getSelectedRowModel`)),e.getFilteredSelectedRowModel=O(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?Ue(e,n):{rows:[],flatRows:[],rowsById:{}},k(e.options,`debugTable`,`getFilteredSelectedRowModel`)),e.getGroupedSelectedRowModel=O(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?Ue(e,n):{rows:[],flatRows:[],rowsById:{}},k(e.options,`debugTable`,`getGroupedSelectedRowModel`)),e.getIsAllRowsSelected=()=>{let t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState(),r=!!(t.length&&Object.keys(n).length);return r&&t.some(e=>e.getCanSelect()&&!n[e.id])&&(r=!1),r},e.getIsAllPageRowsSelected=()=>{let t=e.getPaginationRowModel().flatRows.filter(e=>e.getCanSelect()),{rowSelection:n}=e.getState(),r=!!t.length;return r&&t.some(e=>!n[e.id])&&(r=!1),r},e.getIsSomeRowsSelected=()=>{let t=Object.keys(e.getState().rowSelection??{}).length;return t>0&&t<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{let t=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:t.filter(e=>e.getCanSelect()).some(e=>e.getIsSelected()||e.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,r)=>{let i=e.getIsSelected();t.setRowSelection(a=>{if(n=n===void 0?!i:n,e.getCanSelect()&&i===n)return a;let o={...a};return He(o,e.id,n,r?.selectChildren??!0,t),o})},e.getIsSelected=()=>{let{rowSelection:n}=t.getState();return We(e,n)},e.getIsSomeSelected=()=>{let{rowSelection:n}=t.getState();return Ge(e,n)===`some`},e.getIsAllSubRowsSelected=()=>{let{rowSelection:n}=t.getState();return Ge(e,n)===`all`},e.getCanSelect=()=>typeof t.options.enableRowSelection==`function`?t.options.enableRowSelection(e):t.options.enableRowSelection??!0,e.getCanSelectSubRows=()=>typeof t.options.enableSubRowSelection==`function`?t.options.enableSubRowSelection(e):t.options.enableSubRowSelection??!0,e.getCanMultiSelect=()=>typeof t.options.enableMultiRowSelection==`function`?t.options.enableMultiRowSelection(e):t.options.enableMultiRowSelection??!0,e.getToggleSelectedHandler=()=>{let t=e.getCanSelect();return n=>{t&&e.toggleSelected(n.target?.checked)}}}},He=(e,t,n,r,i)=>{var a;let o=i.getRow(t,!0);n?(o.getCanMultiSelect()||Object.keys(e).forEach(t=>delete e[t]),o.getCanSelect()&&(e[t]=!0)):delete e[t],r&&(a=o.subRows)!=null&&a.length&&o.getCanSelectSubRows()&&o.subRows.forEach(t=>He(e,t.id,n,r,i))};function Ue(e,t){let n=e.getState().rowSelection,r=[],i={},a=function(e,t){return e.map(e=>{var t;let o=We(e,n);if(o&&(r.push(e),i[e.id]=e),(t=e.subRows)!=null&&t.length&&(e={...e,subRows:a(e.subRows)}),o)return e}).filter(Boolean)};return{rows:a(t.rows),flatRows:r,rowsById:i}}function We(e,t){return t[e.id]??!1}function Ge(e,t,n){var r;if(!((r=e.subRows)!=null&&r.length))return!1;let i=!0,a=!1;return e.subRows.forEach(e=>{if(!(a&&!i)&&(e.getCanSelect()&&(We(e,t)?a=!0:i=!1),e.subRows&&e.subRows.length)){let n=Ge(e,t);n===`all`?a=!0:(n===`some`&&(a=!0),i=!1)}}),i?`all`:a?`some`:!1}var Ke=/([0-9]+)/gm,qe=(e,t,n)=>et(X(e.getValue(n)).toLowerCase(),X(t.getValue(n)).toLowerCase()),Je=(e,t,n)=>et(X(e.getValue(n)),X(t.getValue(n))),Ye=(e,t,n)=>$e(X(e.getValue(n)).toLowerCase(),X(t.getValue(n)).toLowerCase()),Xe=(e,t,n)=>$e(X(e.getValue(n)),X(t.getValue(n))),Ze=(e,t,n)=>{let r=e.getValue(n),i=t.getValue(n);return r>i?1:r<i?-1:0},Qe=(e,t,n)=>$e(e.getValue(n),t.getValue(n));function $e(e,t){return e===t?0:e>t?1:-1}function X(e){return typeof e==`number`?isNaN(e)||e===1/0||e===-1/0?``:String(e):typeof e==`string`?e:``}function et(e,t){let n=e.split(Ke).filter(Boolean),r=t.split(Ke).filter(Boolean);for(;n.length&&r.length;){let e=n.shift(),t=r.shift(),i=parseInt(e,10),a=parseInt(t,10),o=[i,a].sort();if(isNaN(o[0])){if(e>t)return 1;if(t>e)return-1;continue}if(isNaN(o[1]))return isNaN(i)?-1:1;if(i>a)return 1;if(a>i)return-1}return n.length-r.length}var Z={alphanumeric:qe,alphanumericCaseSensitive:Je,text:Ye,textCaseSensitive:Xe,datetime:Ze,basic:Qe},tt=[ye,je,De,Oe,xe,we,Me,Ne,{getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:`auto`,sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:T(`sorting`,e),isMultiSortEvent:e=>e.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{let n=t.getFilteredRowModel().flatRows.slice(10),r=!1;for(let t of n){let n=t?.getValue(e.id);if(Object.prototype.toString.call(n)===`[object Date]`)return Z.datetime;if(typeof n==`string`&&(r=!0,n.split(Ke).length>1))return Z.alphanumeric}return r?Z.text:Z.basic},e.getAutoSortDir=()=>typeof t.getFilteredRowModel().flatRows[0]?.getValue(e.id)==`string`?`asc`:`desc`,e.getSortingFn=()=>{if(!e)throw Error();return E(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn===`auto`?e.getAutoSortingFn():t.options.sortingFns?.[e.columnDef.sortingFn]??Z[e.columnDef.sortingFn]},e.toggleSorting=(n,r)=>{let i=e.getNextSortingOrder(),a=n!=null;t.setSorting(o=>{let s=o?.find(t=>t.id===e.id),c=o?.findIndex(t=>t.id===e.id),l=[],u,d=a?n:i===`desc`;return u=o!=null&&o.length&&e.getCanMultiSort()&&r?s?`toggle`:`add`:o!=null&&o.length&&c!==o.length-1?`replace`:s?`toggle`:`replace`,u===`toggle`&&(a||i||(u=`remove`)),u===`add`?(l=[...o,{id:e.id,desc:d}],l.splice(0,l.length-(t.options.maxMultiSortColCount??2**53-1))):l=u===`toggle`?o.map(t=>t.id===e.id?{...t,desc:d}:t):u===`remove`?o.filter(t=>t.id!==e.id):[{id:e.id,desc:d}],l})},e.getFirstSortDir=()=>e.columnDef.sortDescFirst??t.options.sortDescFirst??e.getAutoSortDir()===`desc`?`desc`:`asc`,e.getNextSortingOrder=n=>{let r=e.getFirstSortDir(),i=e.getIsSorted();return i?i!==r&&(t.options.enableSortingRemoval??!0)&&(!n||(t.options.enableMultiRemove??!0))?!1:i===`desc`?`asc`:`desc`:r},e.getCanSort=()=>(e.columnDef.enableSorting??!0)&&(t.options.enableSorting??!0)&&!!e.accessorFn,e.getCanMultiSort=()=>e.columnDef.enableMultiSort??t.options.enableMultiSort??!!e.accessorFn,e.getIsSorted=()=>{let n=t.getState().sorting?.find(t=>t.id===e.id);return n?n.desc?`desc`:`asc`:!1},e.getSortIndex=()=>t.getState().sorting?.findIndex(t=>t.id===e.id)??-1,e.clearSorting=()=>{t.setSorting(t=>t!=null&&t.length?t.filter(t=>t.id!==e.id):[])},e.getToggleSortingHandler=()=>{let n=e.getCanSort();return r=>{n&&(r.persist==null||r.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(r):!1))}}},createTable:e=>{e.setSorting=t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{e.setSorting(t?[]:e.initialState?.sorting??[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},Te,Pe,Re,Be,Ve,K];function nt(e){let t=[...tt,...e._features??[]],n={_features:t},r=n._features.reduce((e,t)=>Object.assign(e,t.getDefaultOptions==null?void 0:t.getDefaultOptions(n)),{}),i=e=>n.options.mergeOptions?n.options.mergeOptions(r,e):{...r,...e},a={...e.initialState??{}};n._features.forEach(e=>{a=(e.getInitialState==null?void 0:e.getInitialState(a))??a});let o=[],s=!1,c={_features:t,options:{...r,...e},initialState:a,_queue:e=>{o.push(e),s||(s=!0,Promise.resolve().then(()=>{for(;o.length;)o.shift()();s=!1}).catch(e=>setTimeout(()=>{throw e})))},reset:()=>{n.setState(n.initialState)},setOptions:e=>{n.options=i(w(e,n.options))},getState:()=>n.options.state,setState:e=>{n.options.onStateChange==null||n.options.onStateChange(e)},_getRowId:(e,t,r)=>(n.options.getRowId==null?void 0:n.options.getRowId(e,t,r))??`${r?[r.id,t].join(`.`):t}`,getCoreRowModel:()=>(n._getCoreRowModel||=n.options.getCoreRowModel(n),n._getCoreRowModel()),getRowModel:()=>n.getPaginationRowModel(),getRow:(e,t)=>{let r=(t?n.getPrePaginationRowModel():n.getRowModel()).rowsById[e];if(!r&&(r=n.getCoreRowModel().rowsById[e],!r))throw Error();return r},_getDefaultColumnDef:O(()=>[n.options.defaultColumn],e=>(e??={},{header:e=>{let t=e.header.column.columnDef;return t.accessorKey?t.accessorKey:t.accessorFn?t.id:null},cell:e=>{var t;return((t=e.renderValue())==null||t.toString==null?void 0:t.toString())??null},...n._features.reduce((e,t)=>Object.assign(e,t.getDefaultColumnDef==null?void 0:t.getDefaultColumnDef()),{}),...e}),k(e,`debugColumns`,`_getDefaultColumnDef`)),_getColumnDefs:()=>n.options.columns,getAllColumns:O(()=>[n._getColumnDefs()],e=>{let t=function(e,r,i){return i===void 0&&(i=0),e.map(e=>{let a=_e(n,e,i,r),o=e;return a.columns=o.columns?t(o.columns,a,i+1):[],a})};return t(e)},k(e,`debugColumns`,`getAllColumns`)),getAllFlatColumns:O(()=>[n.getAllColumns()],e=>e.flatMap(e=>e.getFlatColumns()),k(e,`debugColumns`,`getAllFlatColumns`)),_getAllFlatColumnsById:O(()=>[n.getAllFlatColumns()],e=>e.reduce((e,t)=>(e[t.id]=t,e),{}),k(e,`debugColumns`,`getAllFlatColumnsById`)),getAllLeafColumns:O(()=>[n.getAllColumns(),n._getOrderColumnsFn()],(e,t)=>t(e.flatMap(e=>e.getLeafColumns())),k(e,`debugColumns`,`getAllLeafColumns`)),getColumn:e=>n._getAllFlatColumnsById()[e]};Object.assign(n,c);for(let e=0;e<n._features.length;e++){let t=n._features[e];t==null||t.createTable==null||t.createTable(n)}return n}function rt(){return e=>O(()=>[e.options.data],t=>{let n={rows:[],flatRows:[],rowsById:{}},r=function(t,i,a){i===void 0&&(i=0);let o=[];for(let c=0;c<t.length;c++){let l=be(e,e._getRowId(t[c],c,a),t[c],c,i,void 0,a?.id);if(n.flatRows.push(l),n.rowsById[l.id]=l,o.push(l),e.options.getSubRows){var s;l.originalSubRows=e.options.getSubRows(t[c],c),(s=l.originalSubRows)!=null&&s.length&&(l.subRows=r(l.originalSubRows,i+1,l))}}return o};return n.rows=r(t),n},k(e.options,`debugTable`,`getRowModel`,()=>e._autoResetPageIndex()))}function it(e){let t=[],n=e=>{var r;t.push(e),(r=e.subRows)!=null&&r.length&&e.getIsExpanded()&&e.subRows.forEach(n)};return e.rows.forEach(n),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}function at(e){return e=>O(()=>[e.getState().pagination,e.getPrePaginationRowModel(),e.options.paginateExpandedRows?void 0:e.getState().expanded],(t,n)=>{if(!n.rows.length)return n;let{pageSize:r,pageIndex:i}=t,{rows:a,flatRows:o,rowsById:s}=n,c=r*i,l=c+r;a=a.slice(c,l);let u;u=e.options.paginateExpandedRows?{rows:a,flatRows:o,rowsById:s}:it({rows:a,flatRows:o,rowsById:s}),u.flatRows=[];let d=e=>{u.flatRows.push(e),e.subRows.length&&e.subRows.forEach(d)};return u.rows.forEach(d),u},k(e.options,`debugTable`,`getPaginationRowModel`))}function ot(){return e=>O(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||!(t!=null&&t.length))return n;let r=e.getState().sorting,i=[],a=r.filter(t=>e.getColumn(t.id)?.getCanSort()),o={};a.forEach(t=>{let n=e.getColumn(t.id);n&&(o[t.id]={sortUndefined:n.columnDef.sortUndefined,invertSorting:n.columnDef.invertSorting,sortingFn:n.getSortingFn()})});let s=e=>{let t=e.map(e=>({...e}));return t.sort((e,t)=>{for(let n=0;n<a.length;n+=1){let r=a[n],i=o[r.id],s=i.sortUndefined,c=r?.desc??!1,l=0;if(s){let n=e.getValue(r.id),i=t.getValue(r.id),a=n===void 0,o=i===void 0;if(a||o){if(s===`first`)return a?-1:1;if(s===`last`)return a?1:-1;l=a&&o?0:a?s:-s}}if(l===0&&(l=i.sortingFn(e,t,r.id)),l!==0)return c&&(l*=-1),i.invertSorting&&(l*=-1),l}return e.index-t.index}),t.forEach(e=>{var t;i.push(e),(t=e.subRows)!=null&&t.length&&(e.subRows=s(e.subRows))}),t};return{rows:s(n.rows),flatRows:i,rowsById:n.rowsById}},k(e.options,`debugTable`,`getSortedRowModel`,()=>e._autoResetPageIndex()))}function st(e,t){return e?ct(e)?C.createElement(e,t):e:null}function ct(e){return lt(e)||typeof e==`function`||ut(e)}function lt(e){return typeof e==`function`&&(()=>{let t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function ut(e){return typeof e==`object`&&typeof e.$$typeof==`symbol`&&[`react.memo`,`react.forward_ref`].includes(e.$$typeof.description)}function dt(e){let t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=C.useState(()=>({current:nt(t)})),[r,i]=C.useState(()=>n.current.initialState);return n.current.setOptions(t=>({...t,...e,state:{...r,...e.state},onStateChange:t=>{i(t),e.onStateChange==null||e.onStateChange(t)}})),n.current}var ft=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`}],p=f.length,m=0;m<p;m+=1){var h=f[m];h.d&&(c=o?n(t).diff(a,h.d,!0):a.diff(t,h.d,!0));var g=(e.rounding||Math.round)(Math.abs(c));if(u=c>0,g<=h.r||!h.r){g<=1&&m>0&&(h=f[m-1]);var _=d[h.l];s&&(g=s(``+g)),l=typeof _==`string`?_.replace(`%d`,g):_(g,r,h.l,u);break}}if(r)return l;var v=u?d.future:d.past;return typeof v==`function`?v(l):v.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)}}}))})),pt=n(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r(y()):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}))})),mt=n(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r(y()):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}))})),Q=t(y(),1),ht=t(ft(),1);pt(),mt();var gt=1024*1024,_t=1024*1024*1024;function vt(e){if(!Number.isFinite(e)||e<=0)return`0`;let t=Number(e.toFixed(2));return Math.abs(e-t)<1e-6?String(t):String(Number(e.toPrecision(15)))}function yt(e,t){let n=Number(e);return!Number.isFinite(n)||n<0?0:Math.round(n*(t===`MB`?gt:_t))}function bt(e){let t=Number(e);return!Number.isFinite(t)||t<=0?{value:`0`,unit:`MB`}:t<_t?{value:vt(t/gt),unit:`MB`}:{value:vt(t/_t),unit:`GiB`}}function xt(e,t,n){if(t===n)return e;let r=Number(e);return!Number.isFinite(r)||r<=0?`0`:vt(n===`MB`?r*1024:r/1024)}var $=r();Q.default.extend(ht.default);var St=null,Ct=[],wt=300,Tt=10,Et=[10,20,50,100],Dt=[{value:`MB`,label:`MB`},{value:`GiB`,label:`GiB`}];function Ot(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 kt(e){return Number.isFinite(e)?String(Math.round(e/(1024*1024*1024)*100)/100):`0`}function At(e){let t=Number(e);return!Number.isFinite(t)||t<0?0:Math.round(t*1024*1024*1024)}function jt(e){return Array.from(new Set(String(e||``).split(/[\n,]/).map(e=>e.trim()).filter(Boolean)))}function Mt(e,t=12,n=8){return e?e.length<=t+n+3?e:`${e.slice(0,t)}...${e.slice(-n)}`:`-`}function Nt(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 Pt(e){return{"zh-CN":`zh-cn`,"zh-TW":`zh-tw`,en:`en`}[e]}function Ft(e,t,n){if(!e)return t(`admin.time.never`);let r=(0,Q.default)(e);if(!r.isValid())return t(`admin.time.never`);if(r.isAfter((0,Q.default)()))return t(`admin.time.justNow`);let i=Pt(n);return r.locale(i).from((0,Q.default)().locale(i))}var It=[{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`}],Lt=[{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`}],Rt={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 zt(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 Bt(e,t){let n=String(t||`all`).trim().toLowerCase();if(!n||n===`all`)return!0;let r=zt(e);return n===`error`?e.level===`error`||Rt.error.some(e=>r.includes(e)):(Rt[n]||[n]).some(e=>r.includes(e))}function Vt(e,t){return t(e===`asc`?`admin.table.sortDesc`:e===`desc`?`admin.table.sortClear`:`admin.table.sortAsc`)}function Ht({sort:e}){return e===`asc`?(0,$.jsx)(x,{size:13}):e===`desc`?(0,$.jsx)(ue,{size:13}):(0,$.jsx)(p,{size:13})}function Ut({table:e,t}){let{pageIndex:n,pageSize:r}=e.getState().pagination,i=Math.max(1,e.getPageCount()),a=e.getPrePaginationRowModel().rows.length;return(0,$.jsxs)(`div`,{className:`admin-table-pagination`,"aria-label":t(`admin.table.pagination`),children:[(0,$.jsx)(`span`,{className:`admin-table-pagination-status`,children:t(`admin.table.totalRows`,{count:a})}),(0,$.jsxs)(`div`,{className:`admin-table-page-size`,children:[(0,$.jsx)(`span`,{children:t(`admin.table.pageSize`)}),(0,$.jsx)(ae,{ariaLabel:t(`admin.table.pageSize`),size:`compact`,value:r,options:Et.map(e=>({value:e,label:String(e)})),onChange:t=>e.setPageSize(t)})]}),(0,$.jsx)(`span`,{className:`admin-table-pagination-status`,children:t(`admin.table.pageIndicator`,{page:n+1,total:i})}),(0,$.jsxs)(`div`,{className:`admin-table-page-actions`,children:[(0,$.jsx)(`button`,{className:`btn btn-icon`,type:`button`,onClick:()=>e.setPageIndex(0),disabled:!e.getCanPreviousPage(),"aria-label":t(`admin.table.firstPage`),title:t(`admin.table.firstPage`),children:(0,$.jsx)(S,{size:15})}),(0,$.jsx)(`button`,{className:`btn btn-icon`,type:`button`,onClick:()=>e.previousPage(),disabled:!e.getCanPreviousPage(),"aria-label":t(`admin.table.previousPage`),title:t(`admin.table.previousPage`),children:(0,$.jsx)(de,{size:15})}),(0,$.jsx)(`button`,{className:`btn btn-icon`,type:`button`,onClick:()=>e.nextPage(),disabled:!e.getCanNextPage(),"aria-label":t(`admin.table.nextPage`),title:t(`admin.table.nextPage`),children:(0,$.jsx)(m,{size:15})}),(0,$.jsx)(`button`,{className:`btn btn-icon`,type:`button`,onClick:()=>e.setPageIndex(Math.max(0,i-1)),disabled:!e.getCanNextPage(),"aria-label":t(`admin.table.lastPage`),title:t(`admin.table.lastPage`),children:(0,$.jsx)(fe,{size:15})})]})]})}function Wt({table:e,className:t,emptyText:n,t:r}){let i=e.getRowModel().rows,a=e.getPrePaginationRowModel().rows.length>e.getState().pagination.pageSize;return(0,$.jsxs)(`div`,{className:`admin-table ${t}`,children:[(0,$.jsxs)(`table`,{className:`admin-data-table`,children:[(0,$.jsx)(`thead`,{children:e.getHeaderGroups().map(e=>(0,$.jsx)(`tr`,{children:e.headers.map(e=>{let t=e.column.getIsSorted(),n=Vt(t,r);return(0,$.jsx)(`th`,{className:`admin-col-${e.column.id}`,"aria-sort":t===`asc`?`ascending`:t===`desc`?`descending`:void 0,children:e.isPlaceholder?null:e.column.getCanSort()?(0,$.jsxs)(`button`,{className:`admin-table-sort`,type:`button`,onClick:e.column.getToggleSortingHandler(),"aria-label":n,title:n,children:[(0,$.jsx)(`span`,{children:st(e.column.columnDef.header,e.getContext())}),(0,$.jsx)(Ht,{sort:t})]}):(0,$.jsx)(`span`,{children:st(e.column.columnDef.header,e.getContext())})},e.id)})},e.id))}),(0,$.jsxs)(`tbody`,{children:[i.map(e=>(0,$.jsx)(`tr`,{children:e.getVisibleCells().map(e=>(0,$.jsx)(`td`,{className:`admin-col-${e.column.id}`,children:st(e.column.columnDef.cell,e.getContext())},e.id))},e.id)),i.length===0&&(0,$.jsx)(`tr`,{children:(0,$.jsx)(`td`,{className:`admin-empty-row`,colSpan:e.getAllLeafColumns().length,children:n})})]})]}),a&&(0,$.jsx)(Ut,{table:e,t:r})]})}function Gt(){let{t:e,locale:t,formatNumber:n,formatTime:r}=d(),i=l(e=>e.hasBackend),a=l(e=>e.addToast),[p,m]=(0,C.useState)(St),[ae,y]=(0,C.useState)([]),[ue,x]=(0,C.useState)(``),[de,S]=(0,C.useState)(!1),[fe,w]=(0,C.useState)(!1),[T,E]=(0,C.useState)(!1),[D,he]=(0,C.useState)(`all`),[O,k]=(0,C.useState)([]),[ge,_e]=(0,C.useState)({pageIndex:0,pageSize:Tt}),[A,ve]=(0,C.useState)([]),[ye,j]=(0,C.useState)({pageIndex:0,pageSize:Tt}),[be,xe]=(0,C.useState)([{id:`log-time`,desc:!0}]),[M,N]=(0,C.useState)({pageIndex:0,pageSize:Tt}),[Se,Ce]=(0,C.useState)([]),[P,F]=(0,C.useState)(``),[I,L]=(0,C.useState)({dataPath:``,capacityGiB:`100`,maxFileSizeValue:`10`,maxFileSizeUnit:`GiB`,remoteInvites:``}),R=i===!0;function z(){return R?!0:(a(e(i===null?`admin.toast.backendChecking`:`admin.toast.backendDisconnected`),`warning`),!1)}let B=(0,C.useMemo)(()=>!p||p.capacity.configuredBytes<=0?0:Math.min(100,Math.round(p.capacity.usedBytes/p.capacity.configuredBytes*100)),[p]),we=p?.holdings||Ct,V=o(),H=!!V&&!V.includes(`localhost`)&&!V.includes(`127.0.0.1`),Te=(0,C.useMemo)(()=>[{id:`user`,accessorKey:`address`,header:e(`admin.userData.user`),cell:e=>{let t=e.getValue();return(0,$.jsx)(`span`,{title:t,translate:`no`,children:Mt(t)})}},{id:`user-files`,accessorKey:`fileCount`,header:e(`admin.userData.files`),cell:e=>n(e.getValue())},{id:`user-trash`,accessorKey:`trashCount`,header:e(`admin.userData.trash`),cell:e=>n(e.getValue())},{id:`user-actions`,header:e(`admin.userData.actions`),enableSorting:!1,cell:t=>{let n=t.row.original.address;return(0,$.jsxs)(`button`,{className:`btn btn-ghost`,onClick:()=>Me(n),disabled:P===n,children:[(0,$.jsx)(h,{size:16}),e(`admin.action.clear`)]})}}],[n,P,e]),Ee=(0,C.useMemo)(()=>[{id:`file`,accessorKey:`fileName`,header:e(`admin.holdings.file`),cell:e=>(0,$.jsx)(`span`,{translate:`no`,children:e.getValue()||`-`})},{id:`cid`,accessorKey:`cid`,header:`CID`,cell:e=>{let t=e.row.original;return(0,$.jsx)(`span`,{title:t.cid,translate:`no`,children:Mt(t.cid)})}},{id:`size`,accessorKey:`size`,header:e(`admin.holdings.size`),cell:e=>b(e.getValue())},{id:`peers`,accessorFn:e=>e.peerCount??0,header:e(`admin.holdings.peers`),cell:e=>n(e.getValue())},{id:`topic`,accessorFn:e=>Number(e.joined),header:e(`admin.holdings.topicJoined`),cell:t=>{let n=t.row.original;return(0,$.jsx)(`span`,{className:`admin-seed-pill ${n.joined?`active`:``}`,children:n.joined?e(`admin.holdings.joinedYes`):e(`admin.holdings.joinedNo`)})}},{id:`last-served`,accessorFn:e=>e.lastServedAt&&new Date(e.lastServedAt).getTime()||0,header:e(`admin.holdings.lastServed`),cell:n=>{let r=n.row.original.lastServedAt;return(0,$.jsx)(`span`,{title:r||``,children:Ft(r,e,t)})}},{id:`total-served`,accessorFn:e=>e.totalServedBytes||0,header:e(`admin.holdings.totalServed`),cell:e=>b(e.getValue())},{id:`status`,accessorFn:e=>e.seedStatus||(e.joined?`active`:`not-joined`),header:e(`admin.holdings.status`),cell:t=>{let n=t.row.original;return(0,$.jsx)(`span`,{className:`admin-seed-pill ${n.seedStatus===`error`?`error`:n.seedStatus===`active`||n.joined?`active`:``}`,children:Nt(n,e)})}}],[n,t,e]),De=(0,C.useMemo)(()=>[{id:`log-time`,accessorFn:e=>new Date(e.ts).getTime()||0,header:e(`admin.logs.time`),cell:e=>(0,$.jsx)(`time`,{children:r(e.row.original.ts)})},{id:`log-level`,accessorKey:`level`,header:e(`admin.logs.level`),cell:e=>(0,$.jsx)(`span`,{className:`admin-log-level ${e.getValue()}`,translate:`no`,children:e.getValue()})},{id:`log-event`,accessorKey:`event`,header:e(`admin.logs.event`),cell:e=>(0,$.jsx)(`strong`,{translate:`no`,children:e.getValue()})},{id:`log-message`,accessorKey:`message`,header:e(`admin.logs.message`),cell:e=>(0,$.jsx)(`span`,{translate:`no`,children:e.getValue()})}],[r,e]),U=dt({data:Se,columns:Te,state:{sorting:O,pagination:ge},onSortingChange:k,onPaginationChange:_e,getCoreRowModel:rt(),getSortedRowModel:ot(),getPaginationRowModel:at(),getRowId:e=>e.address}),Oe=dt({data:we,columns:Ee,state:{sorting:A,pagination:ye},onSortingChange:ve,onPaginationChange:j,getCoreRowModel:rt(),getSortedRowModel:ot(),getPaginationRowModel:at(),getRowId:e=>e.cid}),ke=dt({data:ae,columns:De,state:{sorting:be,pagination:M},onSortingChange:xe,onPaginationChange:N,getCoreRowModel:rt(),getSortedRowModel:ot(),getPaginationRowModel:at(),getRowId:e=>e.id}),W=async()=>{if(!R)return!1;try{let e=await s.get(`/api/node/status`).json(),t=await s.get(`/api/node/config`).json(),n=bt(t.maxFileSizeBytes);return m(e),L({dataPath:t.dataPath||e.dataPath||``,capacityGiB:kt(t.capacityBytes),maxFileSizeValue:n.value,maxFileSizeUnit:n.unit,remoteInvites:(t.remoteInvites||[]).join(`
|
|
5
|
+
`)}),x(``),!0}catch(t){let n=await c(t,e(`admin.error.readStatus`));return x(n),a(n,`error`),!1}},G=async()=>{z()&&await W()&&a(e(`admin.toast.statusRefreshed`),`success`)},K=async(e=D)=>{if(R)try{let t=new URLSearchParams({limit:String(wt),filter:e});y((await s.get(`/api/node/logs?${t.toString()}`).json()).logs||[])}catch{}},q=async()=>{if(R)try{Ce((await s.get(`/api/admin/users`).json()).users||[])}catch{}},Ae=async()=>{if(z()){S(!0);try{await s.post(`/api/node/config`,{json:{dataPath:I.dataPath,capacityBytes:At(I.capacityGiB),maxFileSizeBytes:yt(I.maxFileSizeValue,I.maxFileSizeUnit),remoteInvites:jt(I.remoteInvites)}}).json(),a(I.dataPath===(p?.dataPath||``)?e(`admin.toast.configSaved`):e(`admin.toast.configSavedRestart`),`success`),await W(),await K()}catch(t){let n=await c(t,e(`admin.error.saveConfig`));a(n,`error`),x(n)}finally{S(!1)}}},J=async()=>{p?.nodeId&&(await navigator.clipboard.writeText(p.nodeId),a(e(`admin.toast.nodeIdCopied`),`success`))},je=async()=>{if(z()){w(!0);try{await s.delete(`/api/node/logs`).json(),y([]),a(e(`admin.toast.logsCleared`),`success`)}catch(t){let n=await c(t,e(`admin.error.clearLogs`));a(n,`error`),x(n)}finally{w(!1)}}},Y=async()=>{if(z()){E(!0);try{let t=await s.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 c(t,e(`admin.error.exportDiagnostics`));a(n,`error`),x(n)}finally{E(!1)}}};async function Me(t){if(z()&&window.confirm(e(`admin.confirm.clearUserData`,{address:`${t.slice(0,6)}...${t.slice(-4)}`}))){F(t);try{await s.delete(`/api/admin/users/${t}/data`).json(),a(e(`admin.toast.userDataCleared`),`success`),await q(),await W()}catch(t){let n=await c(t,e(`admin.error.clearUserData`));a(n,`error`),x(n)}finally{F(``)}}}return(0,C.useEffect)(()=>{if(!R||H)return;W(),K(),q();let e=null,t=!1;return(async()=>{if(e=new WebSocket(await u(`/ws`)),t){e.close();return}e.onmessage=e=>{try{let t=JSON.parse(e.data);t.event===`node:status`&&m(t.data),t.event===`node:log`&&Bt(t.data,D)&&y(e=>[t.data,...e].slice(0,wt)),t.event===`node:logs:cleared`&&y([]),(t.event===`publish:success`||t.event===`download:success`||t.event===`network:status`)&&W()}catch{}}})(),()=>{t=!0,e?.close()}},[R,H,D]),(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(ce,{}),(0,$.jsxs)(`main`,{className:`admin-page`,children:[(0,$.jsxs)(`header`,{className:`admin-topbar`,children:[(0,$.jsx)(`div`,{className:`admin-title-group`,children:(0,$.jsx)(`h1`,{children:e(`admin.title`)})}),(0,$.jsxs)(`div`,{className:`admin-topbar-actions`,children:[(0,$.jsxs)(`span`,{className:`admin-status-pill ${p?.status===`online`?`online`:``}`,children:[(0,$.jsx)(le,{size:14}),p?.status===`online`?e(`admin.status.online`):e(`admin.status.waiting`)]}),(0,$.jsxs)(`button`,{className:`btn btn-secondary`,onClick:G,children:[(0,$.jsx)(ee,{size:16}),e(`admin.action.refresh`)]})]})]}),i===!1&&(0,$.jsxs)(`section`,{className:`admin-panel admin-error`,children:[(0,$.jsx)(oe,{size:20}),(0,$.jsx)(`span`,{children:e(`admin.error.localDaemonDisconnected`)})]}),H&&(0,$.jsxs)(`section`,{className:`admin-panel admin-error`,children:[(0,$.jsx)(f,{size:18}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`h2`,{children:e(`admin.remoteUnavailable.title`)}),(0,$.jsx)(`p`,{children:e(`admin.remoteUnavailable.desc`)})]})]}),!H&&ue&&(0,$.jsxs)(`section`,{className:`admin-panel admin-error`,children:[(0,$.jsx)(_,{size:20}),(0,$.jsx)(`span`,{children:ue})]}),!H&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(`section`,{className:`admin-overview`,children:[(0,$.jsxs)(`div`,{className:`admin-metric`,children:[(0,$.jsx)(`div`,{className:`admin-metric-icon`,children:(0,$.jsx)(ne,{size:18})}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`span`,{children:e(`admin.metric.nodeId`)}),(0,$.jsx)(`strong`,{translate:`no`,children:Mt(p?.nodeId||``)})]}),(0,$.jsx)(`button`,{className:`btn btn-icon admin-metric-action`,onClick:J,"aria-label":e(`admin.action.copyNodeId`),children:(0,$.jsx)(pe,{size:15})})]}),(0,$.jsxs)(`div`,{className:`admin-metric`,children:[(0,$.jsx)(`div`,{className:`admin-metric-icon`,children:(0,$.jsx)(re,{size:18})}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`span`,{children:e(`admin.metric.connections`)}),(0,$.jsx)(`strong`,{children:p?e(`admin.metric.peers`,{count:p.network.peers}):`-`})]})]}),(0,$.jsxs)(`div`,{className:`admin-metric`,children:[(0,$.jsx)(`div`,{className:`admin-metric-icon`,children:(0,$.jsx)(v,{size:18})}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`span`,{children:e(`admin.metric.capacity`)}),(0,$.jsxs)(`strong`,{children:[B,`%`]})]})]}),(0,$.jsxs)(`div`,{className:`admin-metric`,children:[(0,$.jsx)(`div`,{className:`admin-metric-icon`,children:(0,$.jsx)(oe,{size:18})}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`span`,{children:e(`admin.metric.uptime`)}),(0,$.jsx)(`strong`,{children:p?Ot(p.uptimeSeconds,e):`-`})]})]})]}),(0,$.jsxs)(`section`,{className:`admin-grid`,children:[(0,$.jsxs)(`div`,{className:`admin-panel admin-span-2`,children:[(0,$.jsxs)(`div`,{className:`admin-panel-header`,children:[(0,$.jsx)(`div`,{children:(0,$.jsx)(`h2`,{children:e(`admin.nodeStatus.title`)})}),(0,$.jsx)(ie,{size:18})]}),(0,$.jsxs)(`div`,{className:`admin-status-grid`,children:[(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`span`,{children:e(`admin.nodeStatus.version`)}),(0,$.jsx)(`strong`,{translate:`no`,children:p?.version||`-`})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`span`,{children:e(`admin.nodeStatus.listen`)}),(0,$.jsx)(`strong`,{translate:`no`,children:p?`${p.host}:${p.port}`:`-`})]}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`span`,{children:e(`admin.nodeStatus.dataPath`)}),(0,$.jsx)(`strong`,{translate:`no`,children:p?.dataPath||`-`})]})]}),(0,$.jsx)(`div`,{className:`admin-address-list`,children:(p?.listen.addresses||[]).map(e=>(0,$.jsxs)(`span`,{translate:`no`,children:[e.label,`: `,e.ip,`:`,p?.port]},`${e.type}-${e.ip}`))})]}),(0,$.jsxs)(`div`,{className:`admin-panel admin-span-2`,children:[(0,$.jsxs)(`div`,{className:`admin-panel-header`,children:[(0,$.jsx)(`div`,{children:(0,$.jsx)(`h2`,{children:e(`admin.userData.title`)})}),(0,$.jsx)(me,{size:18})]}),(0,$.jsx)(Wt,{table:U,className:`admin-table-users`,emptyText:e(`admin.userData.empty`),t:e})]}),(0,$.jsxs)(`div`,{className:`admin-panel admin-span-2`,children:[(0,$.jsxs)(`div`,{className:`admin-panel-header`,children:[(0,$.jsx)(`div`,{children:(0,$.jsx)(`h2`,{children:e(`admin.settings.title`)})}),(0,$.jsx)(me,{size:18})]}),(0,$.jsxs)(`div`,{className:`admin-settings-fields`,children:[(0,$.jsxs)(`label`,{className:`admin-field admin-field-wide`,children:[(0,$.jsx)(`span`,{children:e(`admin.settings.dataPath`)}),(0,$.jsx)(`input`,{className:`input`,value:I.dataPath,onChange:e=>L(t=>({...t,dataPath:e.target.value}))})]}),(0,$.jsxs)(`label`,{className:`admin-field`,children:[(0,$.jsx)(`span`,{children:e(`admin.settings.capacityGiB`)}),(0,$.jsx)(`input`,{className:`input`,type:`number`,min:`0`,step:`1`,value:I.capacityGiB,onChange:e=>L(t=>({...t,capacityGiB:e.target.value}))})]}),(0,$.jsxs)(`label`,{className:`admin-field`,children:[(0,$.jsx)(`span`,{children:e(`admin.settings.maxFileSize`)}),(0,$.jsxs)(`div`,{className:`admin-unit-field`,children:[(0,$.jsx)(`input`,{className:`input`,type:`number`,min:`0`,step:`any`,inputMode:`decimal`,placeholder:e(`admin.settings.maxFileSizePlaceholder`),value:I.maxFileSizeValue,onChange:e=>L(t=>({...t,maxFileSizeValue:e.target.value}))}),(0,$.jsx)(se,{ariaLabel:e(`admin.settings.maxFileSizeUnit`),options:Dt,value:I.maxFileSizeUnit,onChange:e=>L(t=>({...t,maxFileSizeValue:xt(t.maxFileSizeValue,t.maxFileSizeUnit,e),maxFileSizeUnit:e}))})]})]}),(0,$.jsxs)(`label`,{className:`admin-field admin-field-wide`,children:[(0,$.jsx)(`span`,{children:e(`admin.settings.remoteInvites`)}),(0,$.jsx)(`textarea`,{className:`input admin-textarea`,value:I.remoteInvites,placeholder:e(`admin.settings.remoteInvitesPlaceholder`),onChange:e=>L(t=>({...t,remoteInvites:e.target.value}))})]})]}),(0,$.jsx)(`p`,{className:`admin-field-hint`,children:e(`admin.settings.hint`)}),(0,$.jsxs)(`button`,{className:`btn btn-primary btn-full`,onClick:Ae,disabled:de,children:[(0,$.jsx)(te,{size:16}),e(`admin.action.saveConfig`)]})]}),(0,$.jsxs)(`div`,{className:`admin-panel admin-span-2`,children:[(0,$.jsxs)(`div`,{className:`admin-panel-header`,children:[(0,$.jsx)(`div`,{children:(0,$.jsx)(`h2`,{children:e(`admin.holdings.title`)})}),(0,$.jsx)(v,{size:18})]}),(0,$.jsxs)(`div`,{className:`admin-capacity-row`,children:[(0,$.jsx)(`progress`,{value:B,max:`100`}),(0,$.jsxs)(`span`,{children:[b(p?.capacity.usedBytes||0),` /`,` `,b(p?.capacity.configuredBytes||0)]})]}),(0,$.jsx)(`div`,{className:`admin-seed-help`,"aria-label":e(`admin.seedHelp.label`),children:It.map(t=>(0,$.jsxs)(`div`,{className:`admin-seed-help-item`,children:[(0,$.jsx)(`span`,{className:`admin-seed-dot ${t.tone}`}),(0,$.jsxs)(`div`,{children:[(0,$.jsx)(`strong`,{children:e(t.labelKey)}),(0,$.jsx)(`span`,{children:e(t.descKey)})]})]},t.labelKey))}),(0,$.jsx)(Wt,{table:Oe,className:`admin-table-holdings`,emptyText:e(`admin.holdings.empty`),t:e})]}),(0,$.jsxs)(`div`,{className:`admin-panel admin-span-2`,children:[(0,$.jsxs)(`div`,{className:`admin-panel-header`,children:[(0,$.jsx)(`div`,{children:(0,$.jsx)(`h2`,{children:e(`admin.logs.title`)})}),(0,$.jsxs)(`div`,{className:`admin-panel-actions`,children:[(0,$.jsxs)(`button`,{className:`btn btn-secondary`,onClick:Y,disabled:T,children:[(0,$.jsx)(g,{size:16}),e(`admin.action.exportDiagnostics`)]}),(0,$.jsxs)(`button`,{className:`btn btn-ghost`,onClick:je,disabled:fe||ae.length===0,children:[(0,$.jsx)(h,{size:16}),e(`admin.action.clearLogs`)]}),(0,$.jsx)(_,{size:18})]})]}),(0,$.jsx)(`div`,{className:`admin-log-filter`,"aria-label":e(`admin.logs.filterLabel`),children:Lt.map(t=>(0,$.jsx)(`button`,{type:`button`,className:D===t.value?`active`:``,onClick:()=>{he(t.value),N(e=>({...e,pageIndex:0})),K(t.value)},children:e(t.labelKey)},t.value))}),(0,$.jsx)(Wt,{table:ke,className:`admin-table-logs`,emptyText:e(`admin.logs.empty`),t:e})]})]})]})]})]})}var Kt=a(`/admin/`)({component:Gt});export{Kt as Route};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/MilkdownEditor-C388llV6.js","assets/jsx-runtime-Bt-cYkS5.js","assets/i18n-C6yaqRst.js","assets/index-D1mozno-.js","assets/useAppStore-DNhyhD20.js","assets/useNavigate-DWlBD_-b.js","assets/index-C6IjeTBh.css","assets/dist-CSyRxrry.js","assets/dist-RU_cpjXQ.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{n as e,o as t,t as n}from"./jsx-runtime-Bt-cYkS5.js";import{B as r,C as i,E as a,H as o,M as s,d as c,j as l,o as u,t as d,w as f}from"./useAppStore-DNhyhD20.js";import{n as ee}from"./useNavigate-DWlBD_-b.js";import{a as te}from"./i18n-C6yaqRst.js";import{a as ne,i as re,n as ie,o as p}from"./chatNoteDraft-DTy6In5R.js";import{t as ae}from"./OpenSidebarButton-OP8zl7ad.js";import{n as m,t as oe}from"./trash-2-B9gno5q6.js";import{t as h}from"./folder-open-DOJ4bB58.js";import{t as g}from"./folder-6pYYnS2-.js";import{t as _}from"./lock-yG7M7GkB.js";import{t as se}from"./AppShell-BdRKZIZ9.js";import{t as v}from"./notebook-pen-Bcd3MrtD.js";import{t as ce}from"./save-CfYzXcxH.js";import{t as le}from"./search-DLBOUfny.js";import{C as ue,E as y,L as de,M as b,O as fe,P as x,S as pe,T as me,c as S,d as C,f as w,l as he,m as T,p as ge,s as _e,t as E,u as ve,w as ye}from"./index-D1mozno-.js";import{t as D}from"./AppTop-BE5kKBYH.js";var be=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`}]]),xe=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`}]]),O=t(e(),1),k=n();function A(e){return e.type===`directory`?f(e.path?`${e.path}/${e.name}`:e.name):i(e)}function Se({target:e,targetLabel:t,directories:n,onMove:r,onClose:i}){let{t:a}=te(),o=f(e.path||``),s=A(e),c=n.filter(t=>e.type===`directory`?t.path!==s&&!t.path.startsWith(`${s}/`):!0),[l,u]=(0,O.useState)(o),[d,ee]=(0,O.useState)(``),[ne,re]=(0,O.useState)(new Set),ie=f(d),p=d.trim()?ie:l,ae=f(p)===o,oe=a(`note.move.rootDirectory`),h=new Map;for(let e of c){let t=h.get(e.parentPath)||[];t.push(e),h.set(e.parentPath,t)}let _=c.filter(e=>{if(!e.parentPath)return!0;let t=e.parentPath.split(`/`).filter(Boolean);return t.every((e,n)=>ne.has(t.slice(0,n+1).join(`/`)))}),se=[{label:oe,path:``},...l.split(`/`).filter(Boolean).map((e,t,n)=>({label:e,path:n.slice(0,t+1).join(`/`)}))];function v(e){u(f(e)),ee(``)}function ce(e){v(e),h.has(e)&&re(t=>{let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n})}function le(){ae||r(p)}return(0,k.jsx)(me,{onClose:i,children:(0,k.jsxs)(`div`,{className:`note-move-modal`,onClick:e=>e.stopPropagation(),children:[(0,k.jsxs)(`div`,{className:`modal-header`,children:[(0,k.jsx)(`h3`,{children:a(`note.move.title`)}),(0,k.jsx)(`button`,{className:`btn btn-icon`,onClick:i,children:(0,k.jsx)(fe,{size:18})})]}),(0,k.jsxs)(`div`,{className:`note-move-target`,children:[(0,k.jsx)(`span`,{children:a(`note.move.moving`)}),(0,k.jsx)(`strong`,{translate:`no`,children:t||e.name})]}),(0,k.jsx)(`div`,{className:`note-move-path`,children:se.map((e,t)=>(0,k.jsxs)(O.Fragment,{children:[t>0&&(0,k.jsx)(`span`,{children:`/`}),(0,k.jsx)(`button`,{type:`button`,onClick:()=>v(e.path),children:(0,k.jsx)(`span`,{translate:e.path?`no`:`yes`,children:e.label})})]},e.path||`root`))}),(0,k.jsxs)(`div`,{className:`note-move-folder-list`,children:[(0,k.jsxs)(`button`,{type:`button`,className:`note-move-folder-item ${l===``?`selected`:``}`,onClick:()=>v(``),children:[(0,k.jsx)(`span`,{className:`note-move-folder-spacer`}),(0,k.jsx)(g,{className:`note-move-folder-icon`,size:16}),(0,k.jsx)(`span`,{children:oe})]}),c.length===0?(0,k.jsx)(`p`,{className:`note-move-empty`,children:a(`note.move.noFolders`)}):_.map(e=>{let t=h.has(e.path),n=ne.has(e.path);return(0,k.jsxs)(`button`,{type:`button`,className:`note-move-folder-item note-move-depth-${Math.min(e.depth,4)} ${l===e.path?`selected`:``}`,onClick:()=>ce(e.path),children:[t?n?(0,k.jsx)(x,{className:`note-move-expander`,size:14}):(0,k.jsx)(m,{className:`note-move-expander`,size:14}):(0,k.jsx)(`span`,{className:`note-move-folder-spacer`}),(0,k.jsx)(g,{className:`note-move-folder-icon`,size:16}),(0,k.jsx)(`span`,{translate:`no`,children:e.name}),e.parentPath&&(0,k.jsx)(`small`,{translate:`no`,children:e.parentPath})]},e.path)})]}),(0,k.jsx)(`input`,{className:`input input-compact`,value:d,onChange:e=>ee(e.target.value),placeholder:a(`note.move.pathPlaceholder`),translate:`no`}),(0,k.jsxs)(`div`,{className:`note-move-destination`,children:[(0,k.jsx)(`span`,{children:a(`note.move.destinationLabel`)}),(0,k.jsx)(`span`,{translate:p?`no`:`yes`,children:p||oe})]}),(0,k.jsxs)(`div`,{className:`modal-actions`,children:[(0,k.jsx)(`button`,{className:`btn btn-secondary`,onClick:i,children:a(`common.cancel`)}),(0,k.jsx)(`button`,{className:`btn btn-primary`,onClick:le,disabled:ae,children:a(`note.action.move`)})]})]})})}function Ce({children:e}){return(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(D,{}),e]})}var we=(0,O.lazy)(async()=>({default:(await E(()=>import(`./MilkdownEditor-C388llV6.js`),__vite__mapDeps([0,1,2,3,4,5,6,7,8]))).MilkdownEditor})),j=/\[\[([^\]\n]+?)\]\]/g,M=/(```[\s\S]*?```)/g;function Te(e){let t=new URLSearchParams(e),n=t.get(`mode`);return{cid:t.get(`cid`)||void 0,file:t.get(`file`)||void 0,path:t.get(`path`)||void 0,chatDraft:t.get(`chatDraft`)||void 0,mode:n===`edit`?`edit`:void 0}}function N(e={}){let t=new URLSearchParams;e.cid&&t.set(`cid`,e.cid),e.file&&t.set(`file`,e.file),e.path&&t.set(`path`,e.path),e.chatDraft&&t.set(`chatDraft`,e.chatDraft),e.mode&&t.set(`mode`,e.mode);let n=t.toString();return n?`/note/?${n}`:`/note/`}function Ee(e){let t=e.indexOf(`?`),n=t>=0?e.slice(t):``;if(typeof window>`u`)return Te(n);try{return Te(new URL(e,window.location.origin).search)}catch{return Te(n)}}var P={"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 De(e,t,n){let r=e instanceof Error?e.message:``,i=P[r];return i?n(i):r||t}function Oe(e){return e.type===`directory`?f(e.path?`${e.path}/${e.name}`:e.name):i(e)}function F(e=``){return String(e).trim().replace(/\.md$/i,``)}function I(e){let t=F(e);return t?`${t}.md`:``}function ke(e,t,n){let r=F(e)||t;for(let e=0;e<1e3;e+=1){let t=I(e===0?r:`${r} ${e+1}`);if(t&&!n(t))return t}return I(`${r} ${Date.now()}`)}function Ae(e=``){let t=f(e).split(`/`).filter(Boolean);if(t.length===0)return``;let n=t.length-1;return t[n]=I(t[n]),t.join(`/`)}function je(e=``){let t=f(e).split(`/`).filter(Boolean);if(t.length===0)return``;let n=t.length-1;return t[n]=F(t[n]),t.join(`/`)}function Me(e){return je(i(e))}function L(e){let t=e.trim().replace(/^\/+/,``),n=t.search(/[#^]/);return je(n>=0?t.slice(0,n):t)}function Ne(e,t){let n=t?.trim();if(n)return n;let r=e.split(`/`).filter(Boolean);return r[r.length-1]||e}function R(e){return e.replace(/\\/g,`\\\\`).replace(/\[/g,`\\[`).replace(/\]/g,`\\]`)}function Pe(e,t){return`[${R(e)}](<${t.replace(/>/g,`%3E`)}>)`}function Fe(e,t,n=``){let r=L(t);if(!r)return null;let i=r.toLowerCase(),a=e=>Me(e).toLowerCase();if(r.includes(`/`))return e.find(e=>a(e)===i)||null;let o=f(n);if(o){let t=f(`${o}/${r}`).toLowerCase(),n=e.find(e=>a(e)===t);if(n)return n}return e.find(e=>F(e.name).toLowerCase()===i)||null}function Ie(e,t,n,r=``,i){let a=e.indexOf(`|`),o=a>=0?e.slice(0,a):e,s=a>=0?e.slice(a+1):void 0,c=L(o);if(!c)return null;let l=Fe(t,o,r),u=l?n(l):i?.(c);return u?{label:Ne(c,s),href:u}:null}function Le(e,t,n,r=``,i){return e.includes(`[[`)?e.split(M).map(e=>e.startsWith("```")?e:e.replace(j,(e,a)=>{let o=Ie(a,t,n,r,i);return o?Pe(o.label,o.href):e})).join(``):e}function z(e){return e.type===`file`?F(e.name):e.name}function B(e){return e.type===`file`?je(e.fullPath):e.fullPath}function Re(e){return e.type===`file`?F(e.name):e.name}function ze(e=``){let t=f(e).split(`/`).filter(Boolean);return t.map((e,n)=>t.slice(0,n+1).join(`/`))}function Be(e,t){let n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n}function Ve(e,t){if(t.length===0)return e;let n=!1,r=new Set(e);for(let e of t)r.has(e)||(r.add(e),n=!0);return n?r:e}function He(e){return{name:e.name,cid:`__dir__${e.fullPath}`,path:e.path,type:`directory`,size:0,created_at:e.updatedAt,updated_at:e.updatedAt}}function Ue(e,t){let n=[],r=new Map;function a(e){return e&&r.get(e)?.children||n}function o(e,t,n){let i=f(t?`${t}/${e}`:e),o=r.get(i);if(o)return o.updatedAt=Math.max(o.updatedAt,n),o;let s={id:`directory:${i}`,type:`directory`,name:e,path:t,fullPath:i,updatedAt:n,children:[]};return r.set(i,s),a(t).push(s),s}for(let t of e){let e=f(t.path||``),n=e.split(`/`).filter(Boolean),r=t.updated_at||t.created_at||0,s=``;for(let e of n)s=o(e,s,r).fullPath;a(s).push({id:`file:${t.cid}:${i(t)}`,type:`file`,name:t.name,path:e,fullPath:i(t),updatedAt:r,note:t,children:[]})}function s(e){e.sort((e,n)=>{if(e.type!==n.type)return e.type===`directory`?-1:1;let r=t(z(e),z(n));return r===0?t(B(e),B(n)):r});for(let t of e)t.type===`directory`&&s(t.children)}return s(n),n}function We(e,t){let n=t.trim().toLowerCase();return n?e.flatMap(e=>{let t=z(e).toLowerCase(),r=B(e).toLowerCase(),i=t.includes(n)||r.includes(n);if(e.type===`file`)return i?[e]:[];let a=i?e.children:We(e.children,n);return!i&&a.length===0?[]:[{...e,children:a}]}):e}function Ge({nodes:e,searchQuery:t,expandedPaths:n,activeFileId:r,activeFolderPath:i,onToggleDirectory:a,onOpenFile:o,renderActions:s}){let c=t.trim().length>0;return(0,k.jsx)(`div`,{className:`note-tree`,role:`tree`,children:e.map(e=>(0,k.jsx)(V,{node:e,forceExpanded:c,expandedPaths:n,activeFileId:r,activeFolderPath:i,onToggleDirectory:a,onOpenFile:o,renderActions:s},e.id))})}function V({node:e,forceExpanded:t,expandedPaths:n,activeFileId:r,activeFolderPath:i,onToggleDirectory:a,onOpenFile:o,renderActions:s}){let c=e.type===`directory`,l=c&&(t||n.has(e.fullPath)),u=e.type===`file`&&e.note?.cid===r,d=c&&f(i)===e.fullPath,ee=c?He(e):e.note||null,te=ee&&s?s(ee):null;return(0,k.jsxs)(`div`,{className:`note-tree-node`,role:`none`,children:[(0,k.jsxs)(`div`,{className:`note-tree-row ${c?`is-directory`:`is-file`} ${u?`is-active`:``} ${d?`is-folder-active`:``} ${te?`has-actions`:``}`,children:[(0,k.jsxs)(`button`,{type:`button`,className:`note-tree-item`,role:`treeitem`,"aria-expanded":c?l:void 0,onClick:()=>{if(c){a(e);return}e.note&&o(e.note)},children:[(0,k.jsx)(`span`,{className:`note-tree-toggle`,"aria-hidden":`true`,children:c?l?(0,k.jsx)(x,{size:16}):(0,k.jsx)(m,{size:16}):(0,k.jsx)(`span`,{className:`note-tree-toggle-placeholder`})}),(0,k.jsx)(`span`,{className:`note-tree-label`,translate:`no`,children:z(e)}),e.note?.isSecret&&(0,k.jsx)(_,{className:`note-tree-lock`,size:14,"aria-hidden":`true`})]}),te]}),c&&l&&e.children.length>0&&(0,k.jsx)(`div`,{className:`note-tree-children`,role:`group`,children:e.children.map(e=>(0,k.jsx)(V,{node:e,forceExpanded:t,expandedPaths:n,activeFileId:r,activeFolderPath:i,onToggleDirectory:a,onOpenFile:o,renderActions:s},e.id))})]})}function Ke(e,t){let n=new Set;for(let t of e){let e=f(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 H(e){return e.map(e=>({name:e.name,cid:e.path,path:f(e.directory),content:``,size:e.size,type:`file`,created_at:Number(e.mtimeMs)||Date.now(),updated_at:Number(e.mtimeMs)||Date.now(),isSecret:!1}))}function U(e,t){let n=I(t);return f(e?`${e}/${n}`:n)}function qe(e){let t=e||typeof window<`u`&&window.location.origin||``;if(!t)return!1;try{let e=new URL(t).hostname.toLowerCase();return e===`localhost`||e===`127.0.0.1`||e===`::1`||e===`[::1]`||e.startsWith(`127.`)}catch{return!1}}function W(e,t=``){let[n,r]=(0,O.useState)(!1);return(0,O.useEffect)(()=>{let n=!1;return!e||!t?(r(!1),()=>{n=!0}):(ve().then(e=>{n||r(e.configured===!0)}).catch(()=>{n||r(!1)}),()=>{n=!0})},[e,t]),n}function G(){let{t:e,formatDate:t,compareStrings:n}=te(),r=ee(),i=de({select:e=>e.searchStr}),o=(0,O.useMemo)(()=>Te(i),[i]),c=(0,O.useRef)(null),u=d(e=>e.addToast),p=a(e=>e.wallet),m=a(e=>e.openLoginModal),h=d(e=>e.notes),g=d(e=>e.notesPath),y=d(e=>e.setNotesPath),x=d(e=>e.saveNote),pe=d(e=>e.deleteNote),me=d(e=>e.renameNote),S=d(e=>e.localDataReady),C=o.cid||``,w=h.find(e=>e.cid===C),he=!!C,T=he&&o.mode===`edit`,[ge,_e]=(0,O.useState)(``),[E,ve]=(0,O.useState)(null),[D,A]=(0,O.useState)(null),[j,M]=(0,O.useState)(null),P=(0,O.useRef)(``),je=(0,O.useRef)(``),[Me,L]=(0,O.useState)(``),[Ne,R]=(0,O.useState)(``),[Pe,z]=(0,O.useState)(``),[B,He]=(0,O.useState)(``),[V,H]=(0,O.useState)(``),[U,qe]=(0,O.useState)(!1),[W,G]=(0,O.useState)(``),[K,q]=(0,O.useState)(!1),[Je,Ye]=(0,O.useState)(()=>new Set(ze(g)));(0,O.useEffect)(()=>{if(!C){L(``),R(``);return}if(!w){L(``),R(S?e(`note.error.notFound`):``);return}if(w.content.startsWith(`mp://1`)){if(!p){L(``),R(e(`note.error.loginToDecrypt`));return}let t=l(w.content,p.danger);if(!t){L(``),R(e(`note.error.decryptFailed`));return}L(t),R(``);return}L(w.content||``),R(``)},[C,S,w,e,p]),(0,O.useEffect)(()=>{if(!T){q(!1);return}if(!C||!w){z(``),He(``),H(``),qe(!1),G(S?e(`note.error.notFound`):``);return}if(z(F(w.name)),He(w.path||``),qe(w.isSecret===!0||w.content.startsWith(`mp://1`)),w.content.startsWith(`mp://1`)){if(!p){H(``),G(e(`note.error.loginToDecrypt`));return}let t=l(w.content,p.danger);if(!t){H(``),G(e(`note.error.decryptFailed`));return}H(t),G(``);return}H(w.content||``),G(``)},[C,T,S,w,e,p]);let Xe=(0,O.useMemo)(()=>Ue(h,n),[n,h]),Ze=(0,O.useMemo)(()=>We(Xe,ge),[Xe,ge]),Qe=w?.isSecret===!0||w?.content.startsWith(`mp://1`)===!0,J=e(T?U?`note.privacy.secret`:`note.privacy.public`:Qe?`note.privacy.secret`:`note.privacy.public`),$e=(0,O.useMemo)(()=>Ke(h,n),[n,h]),et=(0,O.useMemo)(()=>Le(Me,h,e=>N({cid:e.cid}),w?.path||``,e=>N({path:Ae(e)})),[h,Me,w?.path]),tt=(0,O.useCallback)(e=>Ie(e,h,e=>N({cid:e.cid}),w?.path||``,e=>N({path:Ae(e)})),[h,w?.path]);(0,O.useEffect)(()=>{w?.path&&Ye(e=>Ve(e,ze(w.path)))},[w?.path]),(0,O.useEffect)(()=>{if(!o.path||C||h.length===0)return;let e=Fe(h,o.path);e&&(y(f(e.path||``)),r({href:N({cid:e.cid}),replace:!0}))},[C,r,h,o.path,y]),(0,O.useEffect)(()=>{let t=o.chatDraft||``;if(!t||P.current===t||!S)return;if(!p){let e=`${t}:auth`;je.current!==e&&(je.current=e,m());return}let n=re(t);if(!n){P.current=t,u(e(`note.chatDraft.missing`),`warning`),Y({},!0);return}P.current=t,at(n)},[u,S,o.chatDraft,e,p]);function Y(e={},t=!1){r({href:N(e),replace:t})}function nt(e){Y(Ee(e))}function rt(e){y(f(e.path||``)),Y({cid:e.cid})}function it(e){y(e.fullPath),Ye(t=>Be(t,e.fullPath))}function X(e){Y({cid:e.cid,mode:`edit`})}function Z(){return p?!0:(m(),!1)}async function at(t){if(p)try{let n=await x({name:ke(t.title,e(`note.chatDraft.defaultTitle`),e=>h.some(t=>f(t.path||``)===f(g)&&t.name===e)),path:g,content:t.content,isSecret:!1});ie(t.id),u(e(`note.chatDraft.created`),`success`),Y({cid:n,mode:`edit`},!0)}catch(t){P.current=``,u(De(t,e(`note.toast.createFailed`),e),`error`)}}function ot(){Y(w?{cid:w.cid}:{})}async function st(){if(!Z())return;if(!w){u(e(`note.toast.notFound`),`error`);return}let t=I(Pe);if(!t){u(e(`note.toast.nameRequired`),`warning`);return}q(!0);try{let n=c.current?.getMarkdown()??V,r=U?s(n,p.danger):n,i=await x({cid:w.cid,name:t,path:B,content:r,isSecret:U});H(n),Y({cid:i},!0),u(e(`note.toast.saved`),`success`)}catch(t){u(De(t,e(`note.toast.saveFailed`),e),`error`)}finally{q(!1)}}function ct(){Z()&&ve({title:e(`note.create.title`),placeholder:e(`note.namePlaceholder`),confirmText:e(`note.create.action`),onConfirm:async t=>{if(Z())try{let n=await x({name:I(t),path:g,content:``,isSecret:!1});ve(null),u(e(`note.toast.created`),`success`),Y({cid:n,mode:`edit`})}catch(t){u(De(t,e(`note.toast.createFailed`),e),`error`)}}})}function lt(e){Z()&&M(e)}async function Q(t){if(j)try{me(Oe(j),t,j.name),M(null),u(e(`note.toast.moved`),`success`)}catch(t){u(De(t,e(`note.toast.moveFailed`),e),`error`)}}function $(t){if(!Z())return;let n=t.type===`directory`;A({title:e(n?`note.delete.folderTitle`:`note.delete.noteTitle`),message:e(`note.delete.message`,{name:Re(t)}),confirmText:e(`note.action.delete`),onConfirm:async()=>{pe(n?void 0:t.cid,t.path,t.name),A(null),u(e(`note.toast.deleted`),`success`),t.type===`file`&&t.cid===C&&Y()}})}let ut=(0,k.jsxs)(`div`,{className:`note-header-title`,children:[(0,k.jsx)(`h2`,{className:`header-title`,children:e(`note.title`)}),(0,k.jsx)(`span`,{children:e(`note.count`,{count:h.length})})]}),dt=(0,k.jsx)(`div`,{className:`note-theme-wrap`}),ft=(0,k.jsxs)(`section`,{className:`note-list-panel note-sidebar-list`,"aria-label":e(`note.listLabel`),children:[(0,k.jsxs)(`div`,{className:`note-search`,children:[(0,k.jsx)(le,{size:16}),(0,k.jsx)(`input`,{className:`input input-flex`,value:ge,onChange:e=>_e(e.target.value),placeholder:e(`note.search.placeholder`)})]}),Ze.length===0?(0,k.jsxs)(`div`,{className:`ui-empty-state note-empty-state`,children:[(0,k.jsx)(v,{size:32}),(0,k.jsx)(`p`,{children:e(ge?`note.empty.noMatches`:`note.empty.noNotes`)})]}):(0,k.jsx)(Ge,{nodes:Ze,searchQuery:ge,expandedPaths:Je,activeFileId:C,activeFolderPath:C?``:g,onToggleDirectory:it,onOpenFile:rt}),(0,k.jsx)(`div`,{className:`note-create-btn`,children:(0,k.jsxs)(`button`,{className:`btn`,onClick:ct,children:[(0,k.jsx)(ne,{size:16}),e(`note.newNote`)]})})]});return(0,k.jsxs)(se,{sidebar:()=>(0,k.jsx)(Ce,{children:ft}),headerTitle:ut,headerRight:dt,children:[(0,k.jsx)(`main`,{className:`note-page note-browser-page ${he?`has-editor`:``}`,children:(0,k.jsx)(`section`,{className:`note-workspace`,children:(0,k.jsx)(`section`,{className:`note-editor-panel`,"aria-label":e(T?`note.editorLabel.edit`:`note.editorLabel.read`),children:he?(0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)(`div`,{className:`note-editor-panel-header`,children:[(0,k.jsxs)(`div`,{className:`note-editor-title-area`,children:[T?(0,k.jsx)(`input`,{className:`note-title-input`,value:Pe,onChange:e=>z(e.target.value),placeholder:e(`note.namePlaceholder`),translate:`no`,disabled:!w}):w?(0,k.jsx)(`h3`,{translate:`no`,children:F(w.name)}):(0,k.jsx)(`h3`,{children:e(`note.untitled`)}),w&&(0,k.jsxs)(`div`,{className:`note-editor-info`,children:[(0,k.jsx)(`span`,{children:e(T?`note.mode.edit`:`note.mode.read`)}),(0,k.jsx)(`span`,{children:J}),(0,k.jsx)(`span`,{children:t(w.updated_at)})]})]}),(0,k.jsxs)(`div`,{className:`note-editor-actions`,children:[(0,k.jsx)(`button`,{type:`button`,className:`btn btn-icon`,onClick:T?ot:()=>Y(),title:e(T?`common.cancel`:`common.close`),"aria-label":e(T?`common.cancel`:`common.close`),children:(0,k.jsx)(fe,{size:16})}),T?(0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)(`button`,{className:`btn btn-sm ${U?`btn-warning`:`btn-secondary`}`,onClick:()=>qe(!U),disabled:!w,children:[U?(0,k.jsx)(_,{size:16}):(0,k.jsx)(b,{size:16}),e(U?`note.privacy.secret`:`note.privacy.public`)]}),(0,k.jsxs)(`button`,{className:`btn btn-sm btn-primary`,onClick:st,disabled:K||!!W||!w,children:[(0,k.jsx)(ce,{size:16}),e(K?`note.action.saving`:`note.action.save`)]})]}):w&&(0,k.jsxs)(k.Fragment,{children:[(0,k.jsx)(`button`,{type:`button`,className:`btn btn-icon`,onClick:()=>lt(w),title:e(`note.action.move`),"aria-label":e(`note.action.move`),children:(0,k.jsx)(be,{size:16})}),(0,k.jsx)(`button`,{type:`button`,className:`btn btn-icon note-editor-action-danger`,onClick:()=>$(w),title:e(`note.action.delete`),"aria-label":e(`note.action.delete`),children:(0,k.jsx)(oe,{size:16})}),(0,k.jsxs)(`button`,{type:`button`,className:`btn btn-sm btn-primary`,onClick:()=>X(w),disabled:!!Ne,title:e(`note.action.edit`),"aria-label":e(`note.action.edit`),children:[(0,k.jsx)(xe,{size:16}),e(`note.action.edit`)]})]})]})]}),T?W?(0,k.jsxs)(`div`,{className:`note-empty-state editor-error`,children:[(0,k.jsx)(_,{size:36}),(0,k.jsx)(`p`,{children:W})]}):w?(0,k.jsx)(`div`,{className:`note-editor-frame editing`,children:(0,k.jsx)(we,{ref:c,content:V,onChange:H,className:`milkdown-editor`})}):(0,k.jsxs)(`div`,{className:`note-empty-state editor-error`,children:[(0,k.jsx)(v,{size:36}),(0,k.jsx)(`p`,{children:e(S?`note.error.notFound`:`note.loading`)})]}):Ne?(0,k.jsxs)(`div`,{className:`ui-empty-state note-empty-state editor-error`,children:[(0,k.jsx)(_,{size:36}),(0,k.jsx)(`p`,{children:Ne})]}):w?(0,k.jsx)(`div`,{className:`note-editor-frame reading`,children:(0,k.jsx)(we,{content:et,readOnly:!0,onInternalNoteLinkOpen:nt,resolveWikiNoteLink:tt,className:`milkdown-editor`})}):(0,k.jsxs)(`div`,{className:`ui-empty-state note-empty-state editor-error`,children:[(0,k.jsx)(v,{size:36}),(0,k.jsx)(`p`,{children:e(S?`note.error.notFound`:`note.loading`)})]})]}):(0,k.jsxs)(`div`,{className:`ui-empty-state note-editor-empty`,children:[(0,k.jsx)(`div`,{className:`ui-empty-icon note-editor-empty-icon`,children:(0,k.jsx)(v,{size:32})}),(0,k.jsx)(`h3`,{className:`ui-empty-title`,children:e(`note.noOpen.title`)}),(0,k.jsx)(`p`,{className:`ui-empty-desc`,children:h.length>0?e(`note.noOpen.select`):e(`note.noOpen.createFirst`)}),(0,k.jsx)(ae,{label:e(`note.openList`),variant:`default`})]})})})}),E&&(0,k.jsx)(ue,{title:E.title,placeholder:E.placeholder,defaultValue:E.defaultValue,confirmText:E.confirmText,onConfirm:E.onConfirm,onClose:()=>ve(null)}),D&&(0,k.jsx)(ye,{title:D.title,message:D.message,confirmText:D.confirmText,danger:!0,onConfirm:D.onConfirm,onClose:()=>A(null)}),j&&(0,k.jsx)(Se,{target:j,targetLabel:Re(j),directories:$e,onMove:Q,onClose:()=>M(null)})]})}function K(){let{t:e,formatDate:t,compareStrings:n}=te(),r=ee(),i=de({select:e=>e.searchStr}),o=(0,O.useMemo)(()=>Te(i),[i]),s=(0,O.useRef)(null),c=d(e=>e.addToast),l=a(e=>e.wallet),m=a(e=>e.openLoginModal),g=o.file||``,y=!!g,b=y&&o.mode===`edit`,[x,me]=(0,O.useState)(null),[E,D]=(0,O.useState)([]),[A,j]=(0,O.useState)(``),[M,P]=(0,O.useState)(!0),[De,Me]=(0,O.useState)(``),[L,Ne]=(0,O.useState)(``),[R,Pe]=(0,O.useState)(!1),[z,B]=(0,O.useState)(null),[He,V]=(0,O.useState)(``),[qe,W]=(0,O.useState)(``),[G,K]=(0,O.useState)(!1),[q,Je]=(0,O.useState)(``),[Ye,Xe]=(0,O.useState)(!1),[Ze,Qe]=(0,O.useState)(()=>new Set(ze(A))),[J,$e]=(0,O.useState)(null),[et,tt]=(0,O.useState)(null),[Y,nt]=(0,O.useState)(null),rt=(0,O.useRef)(``),it=(0,O.useRef)(``),X=(0,O.useMemo)(()=>H(E),[E]),Z=X.find(e=>e.cid===g),at=(0,O.useMemo)(()=>Ke(X,n),[n,X]),ot=(0,O.useMemo)(()=>Ue(X,n),[n,X]),st=(0,O.useMemo)(()=>We(ot,L),[ot,L]),ct=(0,O.useMemo)(()=>Le(z?.content||``,X,e=>N({file:e.cid}),Z?.path||z?.directory||``,e=>N({path:Ae(e)})),[z?.content,z?.directory,Z?.path,X]),lt=(0,O.useCallback)(e=>Ie(e,X,e=>N({file:e.cid}),Z?.path||z?.directory||``,e=>N({path:Ae(e)})),[z?.directory,Z?.path,X]);(0,O.useEffect)(()=>{Z?.path&&Qe(e=>Ve(e,ze(Z.path)))},[Z?.path]),(0,O.useEffect)(()=>{if(!o.path||g||X.length===0)return;let e=Fe(X,o.path);e&&(j(f(e.path||``)),r({href:N({file:e.cid}),replace:!0}))},[g,r,o.path,X]),(0,O.useEffect)(()=>{let t=o.chatDraft||``;if(!t||rt.current===t||M)return;if(!l){let e=`${t}:auth`;it.current!==e&&(it.current=e,m());return}if(x?.configured!==!0){let n=`${t}:vault`;it.current!==n&&(it.current=n,c(e(`note.chatDraft.openVaultFirst`),`warning`));return}let n=re(t);if(!n){rt.current=t,c(e(`note.chatDraft.missing`),`warning`),$({},!0);return}rt.current=t,_t(n)},[c,o.chatDraft,e,M,x?.configured,l]);let Q=(0,O.useCallback)(async()=>{if(!l){me(null),D([]),Me(e(`note.vault.loginRequired`)),P(!1);return}P(!0),Me(``);try{let e=await ve();me(e),e.configured?D(await C()):D([])}catch(t){me(null),D([]),Me(await u(t,e(`note.vault.loadFailed`)))}finally{P(!1)}},[e,l]);(0,O.useEffect)(()=>{Q()},[Q]),(0,O.useEffect)(()=>{V(F(z?.name||Z?.name||``))},[z?.name,Z?.name]),(0,O.useEffect)(()=>{let t=!1;async function n(){if(!g){B(null),W(``),Je(``),K(!1);return}if(!l){B(null),W(``),Je(e(`note.vault.loginRequired`)),K(!1);return}if(x?.configured!==!0){B(null),W(``),Je(``),K(!1);return}K(!0),Je(``);try{let e=await ge(g);if(t)return;B(e),W(e.content)}catch(n){if(t)return;B(null),W(``),Je(await u(n,e(`note.error.notFound`)))}finally{t||K(!1)}}return n(),()=>{t=!0}},[g,e,x?.configured,l]);function $(e={},t=!1){r({href:N(e),replace:t})}function ut(e){$(Ee(e))}function dt(e){j(f(e.path||``)),$({file:e.cid})}function ft(e){j(e.fullPath),Qe(t=>Be(t,e.fullPath))}function pt(){g&&$({file:g,mode:`edit`})}function mt(){V(F(z?.name||Z?.name||``)),$(g?{file:g}:{})}async function ht(){if(!l){m();return}let t=window.electronAPI?.selectNoteVaultDirectory;if(!t){c(e(`note.vault.selectFailed`),`error`);return}Pe(!0);try{let n=await t();if(!n)return;await _e(n),await Q(),$({},!0),c(e(`note.vault.opened`),`success`)}catch(t){c(await u(t,e(`note.vault.selectFailed`)),`error`)}finally{Pe(!1)}}function gt(){return l?x?.configured===!0?!0:(c(e(`note.vault.emptyPrompt`),`warning`),!1):(m(),!1)}async function _t(t){if(gt())try{let n=ke(t.title,e(`note.chatDraft.defaultTitle`),e=>E.some(t=>f(t.directory)===f(A)&&t.name===e)),r=await S(f(A?`${A}/${n}`:n),t.content);ie(t.id),await Q(),c(e(`note.chatDraft.created`),`success`),$({file:r.path,mode:`edit`},!0)}catch(t){rt.current=``,c(await u(t,e(`note.toast.createFailed`)),`error`)}}function vt(){gt()&&$e({title:e(`note.create.title`),placeholder:e(`note.namePlaceholder`),confirmText:e(`note.create.action`),onConfirm:async t=>{if(!gt())return;let n=U(A,t);if(!n){c(e(`note.toast.nameRequired`),`warning`);return}try{let t=await S(n,``);$e(null),await Q(),$({file:t.path,mode:`edit`}),c(e(`note.toast.created`),`success`)}catch(t){c(await u(t,e(`note.toast.createFailed`)),`error`)}}})}function yt(e){gt()&&nt(e)}async function bt(t){if(!(!Y||!gt()))try{let n=g;if(Y.type===`directory`){let e=Oe(Y),r=f(t?`${t}/${Y.name}`:Y.name),i=E.filter(t=>t.path.startsWith(`${e}/`));for(let t of i){let i=f(`${r}/${t.path.slice(e.length+1)}`);await w(t.path,i),g===t.path&&(n=i)}}else{let e=f(t?`${t}/${Y.name}`:Y.name),r=await w(Y.cid,e);g===Y.cid&&(n=r.path)}nt(null),await Q(),$(n?{file:n}:{},!0),c(e(`note.toast.moved`),`success`)}catch(t){c(await u(t,e(`note.toast.moveFailed`)),`error`)}}function xt(t){gt()&&tt({title:t.type===`directory`?e(`note.delete.folderTitle`):e(`note.delete.noteTitle`),message:e(`note.delete.message`,{name:Re(t)}),confirmText:e(`note.action.delete`),onConfirm:async()=>{try{if(t.type===`directory`){let e=Oe(t),n=E.filter(t=>t.path.startsWith(`${e}/`));for(let e of n)await he(e.path);g.startsWith(`${e}/`)&&$({},!0)}else await he(t.cid),g===t.cid&&$({},!0);tt(null),await Q(),c(e(`note.toast.deleted`),`success`)}catch(t){c(await u(t,e(`note.toast.deleteFailed`)),`error`)}}})}async function St(){if(!l){m();return}if(!g||!z){c(e(`note.toast.notFound`),`error`);return}let t=I(He);if(!t){c(e(`note.toast.nameRequired`),`warning`);return}Xe(!0);try{let n=s.current?.getMarkdown()??qe,r=z.path;if(t!==z.name){r=f(z.directory?`${z.directory}/${t}`:t);let e=await w(z.path,r);B(e),V(F(e.name)),r=e.path}let i=await T(r,n);B(i),V(F(i.name)),W(i.content),await Q(),$({file:i.path},!0),c(e(`note.toast.saved`),`success`)}catch(t){c(await u(t,e(`note.toast.saveFailed`)),`error`)}finally{Xe(!1)}}let Ct=(0,k.jsxs)(`div`,{className:`note-header-title`,children:[(0,k.jsx)(`h2`,{className:`header-title`,children:e(`note.title`)}),(0,k.jsx)(`span`,{children:e(`note.count`,{count:E.length})})]}),wt=(0,k.jsx)(`div`,{className:`note-theme-wrap`,children:(0,k.jsxs)(`button`,{className:`btn btn-sm`,onClick:ht,disabled:R,title:e(`note.vault.open`),"aria-label":e(`note.vault.open`),children:[(0,k.jsx)(h,{size:16}),e(R?`note.vault.opening`:`note.vault.open`)]})}),Tt=(0,k.jsxs)(`section`,{className:`note-list-panel note-sidebar-list`,"aria-label":e(`note.listLabel`),children:[(0,k.jsxs)(`div`,{className:`note-search`,children:[(0,k.jsx)(le,{size:16}),(0,k.jsx)(`input`,{className:`input input-flex`,value:L,onChange:e=>Ne(e.target.value),placeholder:e(`note.search.placeholder`)})]}),M?(0,k.jsxs)(`div`,{className:`ui-empty-state note-empty-state`,children:[(0,k.jsx)(v,{size:32}),(0,k.jsx)(`p`,{children:e(`note.loading`)})]}):De?(0,k.jsxs)(`div`,{className:`ui-empty-state note-empty-state`,children:[(0,k.jsx)(_,{size:32}),(0,k.jsx)(`p`,{children:De})]}):x?.configured===!0?st.length===0?(0,k.jsxs)(`div`,{className:`ui-empty-state note-empty-state`,children:[(0,k.jsx)(v,{size:32}),(0,k.jsx)(`p`,{children:e(L?`note.empty.noMatches`:`note.vault.noFiles`)})]}):(0,k.jsx)(Ge,{nodes:st,searchQuery:L,expandedPaths:Ze,activeFileId:g,activeFolderPath:g?``:A,onToggleDirectory:ft,onOpenFile:dt,renderActions:t=>(0,k.jsx)(pe,{ariaLabel:e(`common.moreActions`),className:`note-list-actions-anchor`,placement:`bottom-end`,items:[{key:`move`,label:e(`note.action.move`),icon:(0,k.jsx)(be,{size:16}),onSelect:()=>yt(t)},{key:`delete`,label:e(`note.action.delete`),icon:(0,k.jsx)(oe,{size:16}),danger:!0,onSelect:()=>xt(t)}],renderTrigger:t=>(0,k.jsx)(`button`,{...t,className:`note-list-actions-trigger`,title:e(`common.moreActions`),"aria-label":e(`common.moreActions`),children:(0,k.jsx)(p,{size:16})})})}):(0,k.jsxs)(`div`,{className:`ui-empty-state note-empty-state`,children:[(0,k.jsx)(h,{size:32}),(0,k.jsxs)(`button`,{className:`btn btn-primary`,onClick:ht,disabled:R,children:[(0,k.jsx)(h,{size:16}),e(R?`note.vault.opening`:`note.vault.open`)]})]}),x?.configured===!0&&(0,k.jsx)(`div`,{className:`note-create-btn`,children:(0,k.jsxs)(`button`,{className:`btn`,onClick:vt,children:[(0,k.jsx)(ne,{size:16}),e(`note.newNote`)]})})]}),Et=z?.mtimeMs||Z?.updated_at||Date.now(),Dt=F(z?.name||Z?.name||``)||e(`note.untitled`);return(0,k.jsxs)(se,{sidebar:()=>(0,k.jsx)(Ce,{children:Tt}),headerTitle:Ct,headerRight:wt,children:[(0,k.jsx)(`main`,{className:`note-page note-browser-page ${y?`has-editor`:``}`,children:(0,k.jsx)(`section`,{className:`note-workspace`,children:(0,k.jsx)(`section`,{className:`note-editor-panel`,"aria-label":e(b?`note.editorLabel.edit`:`note.editorLabel.read`),children:y?(0,k.jsxs)(k.Fragment,{children:[(0,k.jsxs)(`div`,{className:`note-editor-panel-header`,children:[(0,k.jsxs)(`div`,{className:`note-editor-title-area`,children:[b&&z?(0,k.jsx)(`input`,{className:`note-title-input`,value:He,onChange:e=>V(e.target.value),onKeyDown:e=>{if(e.key===`Enter`){e.currentTarget.blur();return}e.key===`Escape`&&(V(F(z.name)),e.currentTarget.blur())},placeholder:e(`note.namePlaceholder`),translate:`no`}):(0,k.jsx)(`h3`,{translate:`no`,children:Dt}),(0,k.jsxs)(`div`,{className:`note-editor-info`,children:[(0,k.jsx)(`span`,{children:e(b?`note.mode.edit`:`note.mode.read`)}),(0,k.jsx)(`span`,{translate:`no`,children:je(g)}),(0,k.jsx)(`span`,{children:t(Et)})]})]}),(0,k.jsxs)(`div`,{className:`note-editor-actions`,children:[(0,k.jsx)(`button`,{type:`button`,className:`btn btn-icon`,onClick:b?mt:()=>$(),title:e(b?`common.cancel`:`common.close`),"aria-label":e(b?`common.cancel`:`common.close`),children:(0,k.jsx)(fe,{size:16})}),b?(0,k.jsxs)(`button`,{className:`btn btn-sm btn-primary`,onClick:St,disabled:Ye||!!q||!z,children:[(0,k.jsx)(ce,{size:16}),e(Ye?`note.action.saving`:`note.action.save`)]}):Z&&(0,k.jsxs)(`button`,{type:`button`,className:`btn btn-sm btn-primary`,onClick:pt,disabled:!!q||!z,title:e(`note.action.edit`),"aria-label":e(`note.action.edit`),children:[(0,k.jsx)(xe,{size:16}),e(`note.action.edit`)]})]})]}),G?(0,k.jsxs)(`div`,{className:`ui-empty-state note-empty-state editor-error`,children:[(0,k.jsx)(v,{size:36}),(0,k.jsx)(`p`,{children:e(`note.loading`)})]}):q?(0,k.jsxs)(`div`,{className:`ui-empty-state note-empty-state editor-error`,children:[(0,k.jsx)(_,{size:36}),(0,k.jsx)(`p`,{children:q})]}):b?(0,k.jsx)(`div`,{className:`note-editor-frame editing`,children:(0,k.jsx)(we,{ref:s,content:qe,onChange:W,className:`milkdown-editor`})}):z?(0,k.jsx)(`div`,{className:`note-editor-frame reading`,children:(0,k.jsx)(we,{content:ct,readOnly:!0,onInternalNoteLinkOpen:ut,resolveWikiNoteLink:lt,className:`milkdown-editor`})}):(0,k.jsxs)(`div`,{className:`ui-empty-state note-empty-state editor-error`,children:[(0,k.jsx)(v,{size:36}),(0,k.jsx)(`p`,{children:e(`note.error.notFound`)})]})]}):(0,k.jsxs)(`div`,{className:`ui-empty-state note-editor-empty`,children:[(0,k.jsx)(`div`,{className:`ui-empty-icon note-editor-empty-icon`,children:(0,k.jsx)(v,{size:32})}),(0,k.jsx)(`h3`,{className:`ui-empty-title`,children:x?.configured?e(`note.noOpen.title`):e(`note.vault.open`)}),(0,k.jsx)(`p`,{className:`ui-empty-desc`,children:x?.configured?e(`note.noOpen.select`):e(`note.vault.emptyPrompt`)}),x?.configured?(0,k.jsx)(ae,{label:e(`note.openList`),variant:`default`}):(0,k.jsxs)(`button`,{className:`btn btn-primary`,onClick:ht,disabled:R,children:[(0,k.jsx)(h,{size:16}),e(R?`note.vault.opening`:`note.vault.open`)]})]})})})}),J&&(0,k.jsx)(ue,{title:J.title,placeholder:J.placeholder,defaultValue:J.defaultValue,confirmText:J.confirmText,onConfirm:J.onConfirm,onClose:()=>$e(null)}),et&&(0,k.jsx)(ye,{title:et.title,message:et.message,confirmText:et.confirmText,danger:!0,onConfirm:et.onConfirm,onClose:()=>tt(null)}),Y&&(0,k.jsx)(Se,{target:Y,targetLabel:Re(Y),directories:at,onMove:bt,onClose:()=>nt(null)})]})}function q(){let{t:e}=te(),t=d(e=>e.hasBackend),n=a(e=>e.wallet),r=y(),i=t===!0&&qe(c()),o=W(i,n?.address||``),s=i&&(r||o);return(0,k.jsx)(O.Suspense,{fallback:(0,k.jsx)(`div`,{className:`note-editor-loading`,children:e(`note.loading`)}),children:s?(0,k.jsx)(K,{}):(0,k.jsx)(G,{})})}var Je=o(`/note/`)({component:q});export{Je as Route};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,o as t,t as n}from"./jsx-runtime-Bt-cYkS5.js";import{B as r,E as i,H as a,O as ee,W as o,n as te,o as ne,t as s}from"./useAppStore-DNhyhD20.js";import{a as c}from"./i18n-C6yaqRst.js";import{t as l}from"./fingerprint-pattern-BT73ASEB.js";import{t as u}from"./circle-alert-DXVkx8p8.js";import{a as d,i as f}from"./AccountMenu-D-wa5tux.js";import{t as re}from"./download-Cy2BlfKM.js";import{t as ie}from"./external-link-D_AQSgxW.js";import{n as ae,t as p}from"./CopyButton-DnFqfCN9.js";import{t as m}from"./loader-C4pED_QP.js";import{t as h}from"./save-CfYzXcxH.js";import{t as g}from"./shield-check-2-h_eEXp.js";import{t as _}from"./upload-BmufnMFu.js";import{I as v,O as y,T as b,_ as x,g as S,h as C,o as oe,v as w,w as se,y as T}from"./index-D1mozno-.js";import{t as E}from"./MarketingLayout-BPdjpEfc.js";import{t as ce}from"./MarketingHeader-8gNzHawY.js";import{n as le}from"./mp-cEQteKUC.js";var ue=r(`cloud-download`,[[`path`,{d:`M12 13v8l-4-4`,key:`1f5nwf`}],[`path`,{d:`m12 21 4-4`,key:`1lfcce`}],[`path`,{d:`M4.393 15.269A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.436 8.284`,key:`ui1hmy`}]]),de=r(`cloud-upload`,[[`path`,{d:`M12 13v8`,key:`1l5pq0`}],[`path`,{d:`M4 14.899A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 2.5 8.242`,key:`1pljnt`}],[`path`,{d:`m8 17 4-4 4 4`,key:`1quai1`}]]),fe=r(`log-out`,[[`path`,{d:`m16 17 5-5-5-5`,key:`1bji2h`}],[`path`,{d:`M21 12H9`,key:`dn1m92`}],[`path`,{d:`M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4`,key:`1uf3rs`}]]),pe=r(`wallet-cards`,[[`path`,{d:`M3 11h3.75a2 2 0 0 1 1.6.8l.45.6a4 4 0 0 0 6.4 0l.45-.6a2 2 0 0 1 1.6-.8H21`,key:`1vwh6y`}],[`path`,{d:`M3 7h18`,key:`1uiuf2`}],[`rect`,{x:`3`,y:`3`,width:`18`,height:`18`,rx:`2`,key:`h1oib`}]]),D=t(e(),1),O=n(),k=[{value:``,labelKey:`profile.avatar.address`},...C.map(e=>({value:x(e),labelKey:`profile.avatar.${e}`}))];function A(e){if(w(e))return!0;try{let t=new URL(e);return t.protocol===`http:`||t.protocol===`https:`}catch{return!1}}function j(e){return e===`disabled`?`is-disabled`:e===`working`?`is-working`:e===`synced`?`is-synced`:e===`error`?`is-error`:`is-idle`}function M({status:e,busy:t}){return t||e===`working`?(0,O.jsx)(m,{size:16,className:`ui-spinner`}):e===`synced`?(0,O.jsx)(v,{size:16}):e===`error`?(0,O.jsx)(u,{size:16}):(0,O.jsx)(g,{size:16})}function N(){let{formatNumber:e,t}=c(),n=s(e=>e.addToast),r=s(e=>e.hasBackend),a=i(e=>e.identity),u=i(e=>e.openLoginModal),v=i(e=>e.setUserIdentity),x=i(e=>e.logoutUser),C=oe(),[w,N]=(0,D.useState)(``),[I,L]=(0,D.useState)(``),[R,z]=(0,D.useState)(``),[B,V]=(0,D.useState)(!1),[H,U]=(0,D.useState)(null),W=(0,O.jsx)(ce,{});(0,D.useEffect)(()=>{if(!a){N(``),L(``),z(``);return}N(a.displayName||a.username),L(T(a.avatar)||a.avatar||``),z(``)},[a]),(0,D.useEffect)(()=>{a&&C.refreshBackupSummary()},[C.refreshBackupSummary,r,a]);let G=(0,D.useMemo)(()=>a?ee(a.danger):null,[a]),me=(0,D.useMemo)(()=>G?le(G.private_key,G.ed_public_key):``,[G]);if(!a)return(0,O.jsx)(E,{header:W,children:(0,O.jsx)(`section`,{className:`profile-page`,children:(0,O.jsx)(`div`,{className:`profile-container narrow`,children:(0,O.jsxs)(`div`,{className:`profile-empty glass`,children:[(0,O.jsx)(`div`,{className:`profile-empty-icon`,children:(0,O.jsx)(f,{size:34})}),(0,O.jsx)(`h1`,{children:t(`profile.signedOut.title`)}),(0,O.jsx)(`p`,{children:t(`profile.signedOut.desc`)}),(0,O.jsxs)(`button`,{type:`button`,className:`btn btn-primary`,onClick:u,children:[(0,O.jsx)(f,{size:16}),t(`account.signIn`)]})]})})})});let he=T(a.avatar)||a.avatar||``,ge=S(a.address,a.avatar),K=a.address.toLowerCase(),_e=I.trim().length>0,ve=j(C.status),q=C.action===`backup`,J=C.action===`restore`,Y=C.action===`export`,X=C.action===`import`,ye=[{key:`notes`,label:t(`profile.backup.summary.notes`),value:C.notesCount},{key:`files`,label:t(`profile.backup.summary.files`),value:C.backupSummary.filesCount},{key:`trash`,label:t(`profile.backup.summary.trash`),value:C.backupSummary.trashFilesCount},{key:`channels`,label:t(`profile.backup.summary.channels`),value:C.backupSummary.channelsCount}];function be(){U({title:t(`profile.backup.confirm.backupTitle`),message:t(`profile.backup.confirm.backupMessage`),confirmText:t(`profile.backup.action.cloudBackup`),onConfirm:async()=>{U(null),await C.backupToCloud()}})}function xe(){U({title:t(`profile.backup.confirm.restoreTitle`),message:t(`profile.backup.confirm.restoreMessage`),confirmText:t(`profile.backup.action.cloudRestore`),onConfirm:async()=>{U(null),await C.restoreFromCloud({confirm:!1})}})}function Se(){return new Promise(e=>{let n=t=>{U(null),e(t)};U({title:t(`profile.backup.confirm.importTitle`),message:t(`profile.backup.confirm.restore`),confirmText:t(`profile.backup.action.importLocal`),onConfirm:()=>n(!0),onClose:()=>n(!1)})})}function Z(){C.importLocalBackup({requestConfirm:Se})}let Ce=[{key:`cloud-backup`,tone:`cloud-backup`,label:t(q?`profile.backup.status.backingUp`:`profile.backup.action.cloudBackup`),icon:q?(0,O.jsx)(m,{size:16,className:`ui-spinner`}):(0,O.jsx)(de,{size:16}),onClick:be},{key:`cloud-restore`,tone:`cloud-restore`,label:t(J?`profile.backup.status.restoring`:`profile.backup.action.cloudRestore`),icon:J?(0,O.jsx)(m,{size:16,className:`ui-spinner`}):(0,O.jsx)(ue,{size:16}),onClick:xe},{key:`export-local`,tone:`export-local`,label:t(Y?`profile.backup.status.exporting`:`profile.backup.action.exportLocal`),icon:Y?(0,O.jsx)(m,{size:16,className:`ui-spinner`}):(0,O.jsx)(re,{size:16}),onClick:C.exportLocalBackup},{key:`import-local`,tone:`import-local`,label:t(X?`profile.backup.status.importing`:`profile.backup.action.importLocal`),icon:X?(0,O.jsx)(m,{size:16,className:`ui-spinner`}):(0,O.jsx)(_,{size:16}),onClick:Z}];async function Q(e){if(r===!0)try{await te.put(`/api/user/profile`,{json:{displayName:e.displayName||e.username,avatar:e.avatar||``,updatedAt:e.profileUpdatedAt||Date.now()}}).json()}catch(e){n(await ne(e,t(`profile.backup.error.profileSaveFailed`)),`error`)}}function $(e){if(!a)return;let r={...a,avatar:e||void 0,profileUpdatedAt:Date.now()};v(r),Q(r),z(``),n(t(`profile.toast.avatarUpdated`),`success`)}function we(){if(!a)return;let e=w.trim()||a.username,r={...a,displayName:e,profileUpdatedAt:Date.now()};v(r),Q(r),N(e),n(t(`profile.toast.saved`),`success`)}function Te(){let e=I.trim();if(!e){$(void 0);return}if(!A(e)){z(t(`nav.avatarUrlInvalid`));return}$(e)}function Ee(){x(),V(!1)}return(0,O.jsxs)(E,{header:W,children:[(0,O.jsx)(`section`,{className:`profile-page`,children:(0,O.jsxs)(`div`,{className:`profile-container`,children:[(0,O.jsxs)(`section`,{className:`profile-panel profile-backup-card`,children:[(0,O.jsxs)(`div`,{className:`profile-panel-header profile-backup-header`,children:[(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`h2`,{children:t(`profile.section.backup`)}),(0,O.jsx)(`p`,{children:t(`profile.section.backup.desc`)})]}),(0,O.jsxs)(`span`,{className:`profile-backup-status ${ve}`,children:[(0,O.jsx)(M,{status:C.status,busy:C.busy}),C.statusLabel]})]}),(0,O.jsx)(`div`,{className:`profile-backup-summary`,"aria-label":t(`profile.backup.summary.label`),children:ye.map(t=>(0,O.jsxs)(`div`,{className:`profile-backup-stat`,children:[(0,O.jsx)(`span`,{className:`profile-backup-stat-value`,children:t.value===null?C.backupSummary.loading?`...`:`-`:e(t.value)}),(0,O.jsx)(`span`,{className:`profile-backup-stat-label`,children:t.label})]},t.key))}),(0,O.jsx)(`div`,{className:`profile-backup-actions`,children:Ce.map(e=>(0,O.jsxs)(`button`,{type:`button`,className:[`btn`,`profile-backup-action`,`is-${e.tone}`].join(` `),disabled:C.busy,onClick:e.onClick,children:[e.icon,e.label]},e.key))})]}),(0,O.jsxs)(`header`,{className:`profile-header`,children:[(0,O.jsx)(`img`,{className:`profile-avatar-large`,src:ge,alt:``}),(0,O.jsxs)(`div`,{className:`profile-heading`,children:[(0,O.jsx)(`p`,{className:`profile-kicker`,children:t(`profile.kicker`)}),(0,O.jsx)(`h1`,{children:a.displayName||a.username}),(0,O.jsxs)(`div`,{className:`profile-address-line`,children:[(0,O.jsx)(`code`,{translate:`no`,children:K}),(0,O.jsx)(p,{text:K}),(0,O.jsxs)(`a`,{href:`https://debank.com/profile/${a.address}`,target:`_blank`,rel:`noopener noreferrer`,className:`btn btn-secondary btn-sm`,children:[(0,O.jsx)(ie,{size:14}),t(`web3.action.view`)]})]})]}),(0,O.jsxs)(`button`,{type:`button`,className:`btn btn-secondary profile-logout-btn`,onClick:()=>V(!0),children:[(0,O.jsx)(fe,{size:16}),t(`account.logout`)]})]}),(0,O.jsxs)(`div`,{className:`profile-grid`,children:[(0,O.jsxs)(`section`,{className:`profile-panel`,children:[(0,O.jsx)(`div`,{className:`profile-panel-header`,children:(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`h2`,{children:t(`profile.section.account`)}),(0,O.jsx)(`p`,{children:t(`profile.section.account.desc`)})]})}),(0,O.jsxs)(`label`,{className:`profile-field`,children:[(0,O.jsx)(`span`,{children:t(`profile.label.displayName`)}),(0,O.jsxs)(`div`,{className:`profile-field-row`,children:[(0,O.jsx)(`input`,{className:`input`,value:w,onChange:e=>N(e.target.value),placeholder:t(`nav.displayNamePlaceholder`)}),(0,O.jsxs)(`button`,{type:`button`,className:`btn btn-primary`,onClick:we,children:[(0,O.jsx)(h,{size:16}),t(`profile.action.save`)]})]})]}),(0,O.jsx)(`div`,{className:`profile-facts`,children:(0,O.jsx)(P,{label:t(`profile.label.username`),value:a.username})})]}),(0,O.jsxs)(`section`,{className:`profile-panel`,children:[(0,O.jsx)(`div`,{className:`profile-panel-header`,children:(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`h2`,{children:t(`profile.section.avatar`)}),(0,O.jsx)(`p`,{children:t(`profile.section.avatar.desc`)})]})}),(0,O.jsx)(`div`,{className:`profile-avatar-grid`,role:`list`,children:k.map(e=>{let n=he===e.value;return(0,O.jsxs)(`button`,{type:`button`,className:[`profile-avatar-option`,n?`selected`:``].filter(Boolean).join(` `),onClick:()=>$(e.value),"aria-pressed":n,title:t(e.labelKey),children:[(0,O.jsx)(`img`,{src:S(a.address,e.value),alt:``,"aria-hidden":`true`}),(0,O.jsx)(`span`,{children:t(e.labelKey)}),n&&(0,O.jsx)(`span`,{className:`profile-avatar-check`,children:(0,O.jsx)(d,{size:14})})]},e.value||`address`)})}),(0,O.jsxs)(`div`,{className:`profile-avatar-url`,children:[(0,O.jsxs)(`label`,{className:`profile-field`,htmlFor:`profile-avatar-url`,children:[(0,O.jsx)(`span`,{children:t(`profile.label.customAvatar`)}),(0,O.jsxs)(`div`,{className:`profile-field-row`,children:[(0,O.jsx)(`input`,{id:`profile-avatar-url`,className:`input`,value:I,onChange:e=>{L(e.target.value),z(``)},placeholder:t(`nav.avatarUrlPlaceholder`)}),(0,O.jsxs)(`button`,{type:`button`,className:`btn btn-secondary`,onClick:Te,disabled:!_e,children:[(0,O.jsx)(h,{size:16}),t(`profile.action.save`)]})]})]}),R&&(0,O.jsx)(`p`,{className:`profile-error`,children:R})]})]})]}),(0,O.jsxs)(`section`,{className:`profile-panel profile-identity-panel`,children:[(0,O.jsxs)(`div`,{className:`profile-panel-header`,children:[(0,O.jsxs)(`div`,{children:[(0,O.jsx)(`h2`,{children:t(`profile.section.identity`)}),(0,O.jsx)(`p`,{children:t(`profile.section.identity.desc`)})]}),(0,O.jsxs)(o,{to:`/web3/`,hash:`wallet`,className:`btn btn-secondary`,children:[(0,O.jsx)(pe,{size:16}),t(`profile.action.openWallet`)]})]}),(0,O.jsxs)(`div`,{className:`profile-key-grid`,children:[G&&(0,O.jsxs)(O.Fragment,{children:[(0,O.jsx)(F,{title:t(`web3.label.ed25519Public`),icon:(0,O.jsx)(l,{size:18}),value:G.ed_public_key}),(0,O.jsx)(F,{title:t(`web3.label.x25519Public`),icon:(0,O.jsx)(ae,{size:18}),value:G.public_key})]}),(0,O.jsx)(F,{title:`IPNS ID`,icon:(0,O.jsx)(g,{size:18}),value:me||`-`})]})]})]})}),H&&(0,O.jsx)(se,{title:H.title,message:H.message,confirmText:H.confirmText,danger:H.danger,onConfirm:H.onConfirm,onClose:H.onClose||(()=>U(null))}),B&&(0,O.jsx)(b,{className:`profile-logout-overlay`,onClose:()=>V(!1),children:(0,O.jsxs)(`div`,{className:`confirm-modal profile-logout-modal`,onClick:e=>e.stopPropagation(),children:[(0,O.jsxs)(`div`,{className:`modal-header`,children:[(0,O.jsx)(`h3`,{children:t(`account.logoutTitle`)}),(0,O.jsx)(`button`,{type:`button`,className:`btn btn-icon`,onClick:()=>V(!1),"aria-label":t(`common.close`),children:(0,O.jsx)(y,{size:18})})]}),(0,O.jsx)(`p`,{className:`profile-logout-reminder`,children:t(`profile.logout.backupReminder`)}),(0,O.jsxs)(`div`,{className:`profile-logout-backup-actions`,children:[(0,O.jsx)(`button`,{type:`button`,className:`btn btn-secondary`,disabled:C.busy,onClick:()=>void C.backupToCloud(),children:t(`profile.backup.action.cloudBackup`)}),(0,O.jsx)(`button`,{type:`button`,className:`btn btn-secondary`,disabled:C.busy,onClick:()=>void C.exportLocalBackup(),children:t(`profile.backup.action.exportLocal`)})]}),(0,O.jsxs)(`div`,{className:`modal-actions`,children:[(0,O.jsx)(`button`,{type:`button`,className:`btn btn-secondary`,onClick:()=>V(!1),children:t(`common.cancel`)}),(0,O.jsx)(`button`,{type:`button`,className:`btn btn-danger`,onClick:Ee,children:t(`account.logout`)})]})]})})]})}function P({label:e,value:t,copy:n=!1}){return(0,O.jsxs)(`div`,{className:`profile-fact`,children:[(0,O.jsx)(`span`,{children:e}),(0,O.jsxs)(`div`,{className:`profile-fact-value`,children:[(0,O.jsx)(`code`,{translate:`no`,children:t}),n&&(0,O.jsx)(p,{text:t})]})]})}function F({title:e,icon:t,value:n}){return(0,O.jsxs)(`div`,{className:`profile-key-card`,children:[(0,O.jsxs)(`div`,{className:`profile-key-card-header`,children:[(0,O.jsx)(`span`,{className:`profile-key-card-icon`,children:t}),(0,O.jsx)(`span`,{children:e})]}),(0,O.jsxs)(`div`,{className:`mono-row`,children:[(0,O.jsx)(`code`,{className:`mono`,translate:`no`,children:n}),(0,O.jsx)(p,{text:n})]})]})}var I=a(`/profile/`)({component:N});export{I as Route};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,o as t,t as n}from"./jsx-runtime-Bt-cYkS5.js";import{D as r,E as i,H as a,a as o,d as s,m as c,p as l,r as u,t as d}from"./useAppStore-DNhyhD20.js";import{a as f,i as p}from"./i18n-C6yaqRst.js";import{t as m}from"./circle-alert-DXVkx8p8.js";import{t as h}from"./refresh-cw-CfkUlTK9.js";import{L as g,r as _}from"./index-D1mozno-.js";import{t as v}from"./channelApi-C5eHetoJ.js";import{r as y,t as b}from"./chatJoinInvite-CeC6H6t8.js";var x=t(e(),1),S=n();function C({children:e,className:t=``}){return(0,S.jsx)(`main`,{className:t,children:e})}function w(e){return String(e||``).trim().replace(/\/+$/,``)}function T(e){return String(e||``).trim()}function E({inviteNodeUrl:e,inviteNodeInvite:t,hasBackend:n,activeBackendUrl:r,activeRemoteUrl:i,activeRemoteInvite:a}){let o=w(e),s=w(i),c=w(r);return!!o&&!!s&&n===!0&&c===s&&s===o&&T(a)===T(t)}function D(e){return!!w(e.inviteNodeUrl)&&!E(e)}var O=`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`,k=`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`,A=Object.freeze({id:`chatjoin_support`,name:`User / Service 测试频道`}),j=Object.freeze([Object.freeze({uid:`user`,theme:`sparkbit`,name:`测试用户`,avatar:O}),Object.freeze({uid:`service`,name:`测试客服`,avatar:k})]),M=Object.freeze(j.map(e=>Object.freeze({locale:`zh-CN`,uid:e.uid,theme:e.theme,avatar:e.avatar,name:e.name,channels:[A]})));function N(e){let t=String(e||``).trim();return M.find(e=>e.uid===t)||null}var P=50,F=b;function I(e){try{return JSON.parse(e)}catch{return null}}function L(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 R(e){return`/chat?channel=${encodeURIComponent(e)}`}function z(e){return String(e||``).trim().slice(0,P)}function B(){let{t:e,setLocale:t}=f(),n=g({select:e=>e.searchStr}),{token:a,pub:b,fixture:w}=(0,x.useMemo)(()=>{let e=new URLSearchParams(n);return{token:e.get(`token`)||``,pub:e.get(`pub`)||``,fixture:e.get(`fixture`)||``}},[n]),T=d(e=>e.hasBackend),E=d(e=>e.setIsDarkMode),O=i(e=>e.setUserIdentity),[k,A]=(0,x.useState)(``),[j,M]=(0,x.useState)(!0),[P,B]=(0,x.useState)(0),V=(0,x.useRef)(``);function H(){V.current=``,A(``),M(!0),B(e=>e+1)}return(0,x.useEffect)(()=>{let n=N(w);if(w&&!n){A(e(`chatJoin.error.unknownFixture`,{fixture:w})),M(!1);return}if(!n&&!a){A(e(`chatJoin.error.missingToken`)),M(!1);return}if(!n&&!b){A(e(`chatJoin.error.missingPub`)),M(!1);return}if(T===null)return;let i=n?`fixture:${w}`:`${a}:${b}`;if(V.current===i)return;V.current=i;async function f(n){let i=(t,r)=>n.locale?p(t,n.locale,r):e(t,r);n.locale&&t(n.locale),n.appearance===`dark`&&E(!0),n.appearance===`light`&&E(!1);let a=c(),f=l(),m=s();if(D({inviteNodeUrl:n.node_url,inviteNodeInvite:n.node_invite,hasBackend:T,activeBackendUrl:m,activeRemoteUrl:a,activeRemoteInvite:f})){if(!(await u({url:n.node_url,invite:n.node_invite||``})).ok)throw Error(i(`chatJoin.error.remoteConnectFailed`));o({url:n.node_url,invite:n.node_invite||``}),d.setState({hasBackend:!0})}else if(!T)throw Error(i(`chatJoin.error.noBackend`));let h=r(n.uid,``),g={...h,theme:n.theme,displayName:n.name||h.displayName,logo:n.logo,logo_dark:n.logo_dark,data:n.data,avatar:n.avatar};O(g);let y=``;for(let e of n.channels){let t=await v.createChannel(e.id,`public`,_(g)),n=t.channelKey||t.key||e.id;y||=n;let r=z(e.name);r&&await v.setChannelRemark(n,r)}let b=n.channels[0];window.location.href=R(y||b.id)}async function m(){try{if(n){await f(n);return}let t=await fetch(`${F}/api/chat.join.decrypt`,{method:`POST`,headers:{"Content-Type":`application/json`},body:JSON.stringify({token:a,pub:b})}),r=await t.text(),i=I(r);if(!t.ok)A(L(r,i,e(`chatJoin.error.decrypt`)));else{let t=y(i);if(!t){A(e(`chatJoin.error.invalidInvite`));return}await f(t)}}catch(t){A(e(`chatJoin.error.request`,{message:t instanceof Error?t.message:String(t)}))}finally{M(!1)}}m()},[w,T,b,P,E,t,O,e,a]),(0,S.jsx)(C,{className:`chat-join-loading-page`,children:(0,S.jsx)(`div`,{className:`chat-join-loading-panel`,children:j?(0,S.jsx)(`div`,{className:`chat-join-loading`,children:(0,S.jsx)(`span`,{className:`chat-join-status-spinner`,"aria-hidden":`true`})}):k?(0,S.jsxs)(`div`,{className:`chat-join-error`,children:[(0,S.jsx)(m,{size:32}),(0,S.jsx)(`p`,{children:k}),(0,S.jsx)(`div`,{className:`chat-join-actions`,children:(0,S.jsxs)(`button`,{type:`button`,className:`btn btn-primary`,onClick:H,children:[(0,S.jsx)(h,{size:16}),e(`chatJoin.action.retry`)]})})]}):(0,S.jsx)(`div`,{className:`chat-join-success`,children:(0,S.jsx)(`span`,{className:`chat-join-status-spinner`,"aria-hidden":`true`})})})})}function V(){return(0,S.jsx)(x.Suspense,{children:(0,S.jsx)(B,{})})}var H=a(`/chat/join/`)({component:V});export{H as Route};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,o as t,t as n}from"./jsx-runtime-Bt-cYkS5.js";import{B as r,E as i,G as a,H as o,W as s,o as ee,t as c,u as te}from"./useAppStore-DNhyhD20.js";import{a as l}from"./i18n-C6yaqRst.js";import{t as u}from"./triangle-alert-BhNtjKm2.js";import{t as d}from"./download-Cy2BlfKM.js";import{t as ne}from"./external-link-D_AQSgxW.js";import{t as re}from"./file-text-zvTER2mN.js";import{t as f}from"./hard-drive-DL1KJHmG.js";import{t as p}from"./refresh-cw-CfkUlTK9.js";import{I as m,L as h}from"./index-D1mozno-.js";import{t as ie}from"./MarketingHeader-8gNzHawY.js";import{t as g}from"./format-CAKfypjK.js";import{n as _,r as ae,s as oe,t as v}from"./downloadValidation-Dd43i9_9.js";var se=r(`circle-x`,[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`m15 9-6 6`,key:`1uzhvr`}],[`path`,{d:`m9 9 6 6`,key:`z0biqf`}]]),y=r(`loader-circle`,[[`path`,{d:`M21 12a9 9 0 1 1-6.219-8.56`,key:`13zald`}]]),b=r(`log-in`,[[`path`,{d:`m10 17 5-5-5-5`,key:`1bsop3`}],[`path`,{d:`M15 12H3`,key:`6jk70r`}],[`path`,{d:`M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4`,key:`u53s6r`}]]),x=r(`wifi-off`,[[`path`,{d:`M12 20h.01`,key:`zekei9`}],[`path`,{d:`M8.5 16.429a5 5 0 0 1 7 0`,key:`1bycff`}],[`path`,{d:`M5 12.859a10 10 0 0 1 5.17-2.69`,key:`1dl1wf`}],[`path`,{d:`M19 12.859a10 10 0 0 0-2.007-1.523`,key:`4k23kn`}],[`path`,{d:`M2 8.82a15 15 0 0 1 4.177-2.643`,key:`1grhjp`}],[`path`,{d:`M22 8.82a15 15 0 0 0-11.288-3.764`,key:`z3jwby`}],[`path`,{d:`m2 2 20 20`,key:`1ooewy`}]]),S=t(e(),1),C=n(),ce=1800;function w(e,t){return`most://${e}${t||``}`}function le(e,t){let n=e.trim().replace(/[\\/]+$/,``);return n?`${n}${n.includes(`\\`)?`\\`:`/`}downloads`:t}function T(e,t){let n=e[t];return typeof n==`string`?n:void 0}function E(e,t){let n=e[t];return typeof n==`number`&&Number.isFinite(n)?n:void 0}function D(e){let t;try{t=JSON.parse(e)}catch{return null}if(!t||typeof t!=`object`)return null;let n=t,r=T(n,`event`),i=n.data;if(!r||!i||typeof i!=`object`)return null;let a=i;return{event:r,payload:{taskId:T(a,`taskId`),percent:E(a,`percent`),loaded:E(a,`loaded`),total:E(a,`total`),file:T(a,`file`),fileName:T(a,`fileName`),error:T(a,`error`)}}}function O(){let{t:e}=l(),{cid:t}=a({from:`/cid/$cid/`}),n=h({select:e=>e.searchStr}),r=c(e=>e.hasBackend),o=c(e=>e.addToast),m=c(e=>e.openConnectModal),T=i(e=>e.identity),E=i(e=>e.openLoginModal),O=(0,S.useMemo)(()=>w(t,n),[t,n]),k=(0,S.useMemo)(()=>oe(O),[O]),A=(0,S.useMemo)(()=>v(O,e),[O,e]),fe=k.fileName||t,[j,M]=(0,S.useState)({status:`idle`,message:``}),[N,P]=(0,S.useState)(null),[F,I]=(0,S.useState)({status:`idle`,message:``}),[L,R]=(0,S.useState)(``),[z,B]=(0,S.useState)(0),[V,H]=(0,S.useState)(null),[U,W]=(0,S.useState)(null),[pe,G]=(0,S.useState)(``),[me,K]=(0,S.useState)(!1),q=(0,S.useRef)(0),J=(0,S.useRef)(null),Y=N?.fileName||fe,X=N?.size??U,Z=j.status===`available`||j.status===`already-local`,Q=F.status===`starting`||F.status===`downloading`,he=le(pe,e(`cid.saveToFallback`)),$=(0,S.useCallback)(async()=>{let t=q.current+1;if(q.current=t,R(``),B(0),H(null),W(null),I({status:`idle`,message:``}),A){P(null),M({status:`error`,message:A});return}if(r===null){P(null),M({status:`waiting-backend`,message:e(`cid.status.waitingBackend`)});return}if(r!==!0){P(null),M({status:`backend-missing`,message:e(`cid.status.backendMissing`)});return}if(!T){P(null),M({status:`login-required`,message:e(`cid.status.loginRequired`)});return}M({status:`checking`,message:e(`cid.status.checking`)}),P(null);try{let n=await _.checkDownload(O);if(q.current!==t)return;P(n),M({status:n.alreadyExists?`already-local`:`available`,message:n.alreadyExists?e(`cid.status.alreadyLocal`,{fileName:n.fileName}):e(`cid.status.available`,{fileName:n.fileName})})}catch(e){if(q.current!==t)return;M({status:`error`,message:await ae(e)}),P(null)}},[r,O,e,T,A]);(0,S.useEffect)(()=>{document.title=e(`cid.meta.title`)},[e]),(0,S.useEffect)(()=>{let e=()=>{J.current!==null&&(window.clearTimeout(J.current),J.current=null)},t=()=>{document.visibilityState===`hidden`&&(e(),K(!1))};return document.addEventListener(`visibilitychange`,t),window.addEventListener(`pagehide`,t),()=>{e(),document.removeEventListener(`visibilitychange`,t),window.removeEventListener(`pagehide`,t)}},[]),(0,S.useEffect)(()=>{$()},[$]),(0,S.useEffect)(()=>{if(r!==!0)return;let e=!1;return _.getDataPath().then(t=>{e||G(t.dataPath)}).catch(()=>{e||G(``)}),()=>{e=!0}},[r]),(0,S.useEffect)(()=>{if(!L||!T)return;let t=null,n=!1;return(async()=>{if(t=new WebSocket(await te(`/ws`)),n){t.close();return}t.onmessage=t=>{let n=D(t.data);!n||n.payload.taskId!==L||(n.event===`download:progress`&&(B(n.payload.percent||0),H(n.payload.loaded??null),W(n.payload.total??null)),n.event===`download:status`&&I({status:`downloading`,message:n.payload.file?e(`cid.status.downloadingFile`,{fileName:n.payload.file}):e(`cid.status.downloading`)}),n.event===`download:success`&&(B(100),I({status:`completed`,message:e(`cid.status.downloadComplete`,{fileName:n.payload.fileName||Y})}),o(e(`cid.toast.downloadComplete`),`success`)),n.event===`download:error`&&(I({status:`error`,message:n.payload.error||e(`cid.status.downloadFailed`,{error:``})}),o(e(`cid.toast.downloadFailed`,{error:n.payload.error||e(`cid.errorFallback`)}),`error`)),n.event===`download:cancelled`&&(I({status:`cancelled`,message:e(`cid.status.cancelled`)}),o(e(`cid.toast.cancelled`),`warning`)))}})(),()=>{n=!0,t?.close()}},[o,Y,e,L,T]);let ge=async()=>{if(!T){E();return}if(r!==!0){m();return}if(!(!Z||Q)){I({status:`starting`,message:e(`cid.status.startingDownload`)}),B(0);try{let t=await _.downloadFile(O);if(t.alreadyExists){I({status:`completed`,message:e(`cid.status.alreadyLocal`,{fileName:t.fileName||Y})}),o(e(`cid.toast.alreadyLocal`),`warning`);return}t.taskId&&(R(t.taskId),I({status:`downloading`,message:e(`cid.status.downloading`)}),o(e(`cid.toast.downloadStarted`),`info`))}catch(t){let n=await ee(t,e(`cid.status.downloadFailed`,{error:e(`cid.errorFallback`)}));I({status:`error`,message:n}),o(n,`error`)}}},_e=()=>{K(!1),J.current!==null&&window.clearTimeout(J.current),J.current=window.setTimeout(()=>{J.current=null,document.visibilityState!==`hidden`&&K(!0)},ce)},ve=async()=>{L&&await _.cancelDownload(L).catch(()=>{})},ye=ue(j.status,F.status);return(0,C.jsxs)(`div`,{className:`cid-layout`,children:[(0,C.jsx)(ie,{}),(0,C.jsx)(`main`,{className:`cid-page`,children:(0,C.jsxs)(`section`,{className:`cid-shell`,children:[(0,C.jsxs)(`div`,{className:`cid-heading`,children:[(0,C.jsx)(`span`,{className:`cid-kicker`,children:e(`cid.kicker`)}),(0,C.jsx)(`h1`,{children:e(`cid.title`)}),(0,C.jsx)(`p`,{children:e(`cid.subtitle`)})]}),(0,C.jsxs)(`div`,{className:`cid-panel`,children:[(0,C.jsxs)(`div`,{className:`cid-handoff`,"aria-label":e(`cid.handoff.title`),children:[(0,C.jsxs)(`div`,{className:`cid-handoff-copy`,children:[(0,C.jsx)(`p`,{className:`cid-handoff-title`,children:e(`cid.handoff.title`)}),(0,C.jsx)(`p`,{children:e(`cid.handoff.desc`)})]}),(0,C.jsxs)(`a`,{className:`btn btn-primary`,href:O,onClick:_e,children:[(0,C.jsx)(ne,{size:16}),e(`cid.handoff.action`)]})]}),me&&(0,C.jsxs)(`div`,{className:`cid-handoff-fallback`,role:`status`,children:[(0,C.jsx)(u,{size:18}),(0,C.jsx)(`p`,{children:e(`cid.handoff.fallback`)}),(0,C.jsxs)(s,{to:`/download/`,className:`btn btn-secondary`,children:[(0,C.jsx)(d,{size:16}),e(`cid.handoff.downloadAction`)]})]}),(0,C.jsxs)(`div`,{className:`cid-status`,children:[(0,C.jsx)(`span`,{className:`cid-status-icon ${j.status}`,children:ye}),(0,C.jsxs)(`div`,{children:[(0,C.jsx)(`p`,{className:`cid-status-label`,children:de(j.status,e)}),(0,C.jsx)(`p`,{className:`cid-status-message`,children:j.message})]})]}),(0,C.jsxs)(`dl`,{className:`cid-details`,children:[(0,C.jsxs)(`div`,{children:[(0,C.jsxs)(`dt`,{children:[(0,C.jsx)(re,{size:16}),e(`cid.fileNameLabel`)]}),(0,C.jsx)(`dd`,{children:Y})]}),(0,C.jsxs)(`div`,{children:[(0,C.jsx)(`dt`,{children:e(`cid.cidLabel`)}),(0,C.jsx)(`dd`,{className:`cid-mono`,children:t})]}),(0,C.jsxs)(`div`,{children:[(0,C.jsx)(`dt`,{children:e(`cid.sizeLabel`)}),(0,C.jsx)(`dd`,{children:X?g(X):e(`cid.unknownSize`)})]}),(0,C.jsxs)(`div`,{children:[(0,C.jsxs)(`dt`,{children:[(0,C.jsx)(f,{size:16}),e(`cid.saveToLabel`)]}),(0,C.jsx)(`dd`,{children:he})]})]}),F.status!==`idle`&&(0,C.jsxs)(`div`,{className:`cid-download-state ${F.status}`,children:[(0,C.jsx)(`p`,{children:F.message}),(F.status===`starting`||F.status===`downloading`)&&(0,C.jsxs)(`div`,{className:`cid-progress`,children:[(0,C.jsx)(`progress`,{className:`cid-progress-bar`,value:z,max:100}),(0,C.jsx)(`span`,{children:V!==null&&U!==null?`${g(V)} / ${g(U)}`:`${z}%`})]})]}),(0,C.jsxs)(`div`,{className:`cid-actions`,children:[j.status===`login-required`&&(0,C.jsxs)(`button`,{className:`btn btn-primary`,onClick:E,children:[(0,C.jsx)(b,{size:16}),e(`cid.loginAction`)]}),j.status===`backend-missing`&&(0,C.jsxs)(`button`,{className:`btn btn-primary`,onClick:m,children:[(0,C.jsx)(x,{size:16}),e(`cid.connectAction`)]}),(0,C.jsxs)(`button`,{className:`btn btn-primary`,disabled:!Z||Q,onClick:ge,children:[Q?(0,C.jsx)(y,{className:`cid-spin-icon`,size:16}):(0,C.jsx)(d,{size:16}),e(Q?`cid.downloadingAction`:`cid.startAction`)]}),L&&F.status===`downloading`&&(0,C.jsxs)(`button`,{className:`btn btn-secondary`,onClick:ve,children:[(0,C.jsx)(se,{size:16}),e(`cid.cancelAction`)]}),(0,C.jsxs)(`button`,{className:`btn btn-secondary`,disabled:j.status===`checking`,onClick:$,children:[(0,C.jsx)(p,{size:16}),e(`cid.retryAction`)]}),(0,C.jsx)(s,{to:`/app/`,className:`btn btn-secondary`,children:e(`cid.openAppAction`)})]})]})]})})]})}function ue(e,t){return t===`completed`?(0,C.jsx)(m,{size:28}):t===`error`||e===`error`?(0,C.jsx)(u,{size:28}):e===`checking`||e===`waiting-backend`||t===`starting`||t===`downloading`?(0,C.jsx)(y,{size:28}):e===`backend-missing`?(0,C.jsx)(x,{size:28}):e===`login-required`?(0,C.jsx)(b,{size:28}):(0,C.jsx)(m,{size:28})}function de(e,t){switch(e){case`checking`:return t(`cid.label.checking`);case`available`:return t(`cid.label.available`);case`already-local`:return t(`cid.label.alreadyLocal`);case`login-required`:return t(`cid.label.loginRequired`);case`backend-missing`:return t(`cid.label.backendMissing`);case`waiting-backend`:return t(`cid.label.waitingBackend`);case`error`:return t(`cid.label.error`);default:return t(`cid.label.idle`)}}var k=o(`/cid/$cid/`)({component:O});export{k as Route};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{B as e}from"./useAppStore-
|
|
1
|
+
import{B as e}from"./useAppStore-DNhyhD20.js";var t=e(`loader`,[[`path`,{d:`M12 2v4`,key:`3427ic`}],[`path`,{d:`m16.2 7.8 2.9-2.9`,key:`r700ao`}],[`path`,{d:`M18 12h4`,key:`wj9ykh`}],[`path`,{d:`m16.2 16.2 2.9 2.9`,key:`1bxg5t`}],[`path`,{d:`M12 18v4`,key:`jadmvz`}],[`path`,{d:`m4.9 19.1 2.9-2.9`,key:`bwix9q`}],[`path`,{d:`M2 12h4`,key:`j09sii`}],[`path`,{d:`m4.9 4.9 2.9 2.9`,key:`giyufr`}]]);export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{B as e}from"./useAppStore-DNhyhD20.js";var t=e(`lock`,[[`rect`,{width:`18`,height:`11`,x:`3`,y:`11`,rx:`2`,ry:`2`,key:`1w4ew1`}],[`path`,{d:`M7 11V7a5 5 0 0 1 10 0v4`,key:`fwvmzm`}]]);export{t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{B as e}from"./useAppStore-
|
|
1
|
+
import{B as e}from"./useAppStore-DNhyhD20.js";var t=e(`message-square`,[[`path`,{d:`M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z`,key:`18887p`}]]);export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{o as e}from"./jsx-runtime-Bt-cYkS5.js";import{L as t,z as n}from"./useAppStore-DNhyhD20.js";import{t as r}from"./dayjs.min-Dcc0B6Je.js";var i=e(t(),1);r();var a=`0123456789abcdefghijklmnopqrstuvwxyz`,o=e=>{let t=[];for(;e>=128;)t.push(e&127|128),e>>=7;return t.push(e),t},s=e=>{let t=new Uint8Array([8,1,18,...o(e.length)]),n=new Uint8Array(t.length+e.length);return n.set(t,0),n.set(e,t.length),n},c=(e,t)=>{if(e.length===0)return``;let n=t.length,r=0;for(;r<e.length&&e[r]===0;)r++;let i=[0];for(let t=r;t<e.length;t++){let r=e[t];for(let e=0;e<i.length;e++){let t=i[e]*256+r;i[e]=t%n,r=Math.floor(t/n)}for(;r>0;)i.push(r%n),r=Math.floor(r/n)}let a=``;for(let e=0;e<r;e++)a+=t[0];for(let e=i.length-1;e>=0;e--)a+=t[i[e]];return a},l=(e,t)=>{let r=t.slice(2),a=new Uint8Array(n(e+r));return i.default.sign.keyPair.fromSecretKey(a)},u=(e,t)=>{let n=s(l(e,t).publicKey),r=new Uint8Array(2+n.length);r[0]=0,r[1]=36,r.set(n,2);let i=new Uint8Array([1,114]),o=new Uint8Array(i.length+r.length);return o.set(i,0),o.set(r,i.length),`k`+c(o,a)};export{u as n,l as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{B as e}from"./useAppStore-
|
|
1
|
+
import{B as e}from"./useAppStore-DNhyhD20.js";var t=e(`music`,[[`path`,{d:`M9 18V5l12-2v13`,key:`1jmyc2`}],[`circle`,{cx:`6`,cy:`18`,r:`3`,key:`fqmcym`}],[`circle`,{cx:`18`,cy:`16`,r:`3`,key:`1hluhg`}]]);export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{B as e}from"./useAppStore-DNhyhD20.js";var t=e(`notebook-pen`,[[`path`,{d:`M13.4 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-7.4`,key:`re6nr2`}],[`path`,{d:`M2 6h4`,key:`aawbzj`}],[`path`,{d:`M2 10h4`,key:`l0bgd4`}],[`path`,{d:`M2 14h4`,key:`1gsvsf`}],[`path`,{d:`M2 18h4`,key:`1bu2t1`}],[`path`,{d:`M21.378 5.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z`,key:`pqwjuv`}]]);export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{B as e}from"./useAppStore-DNhyhD20.js";var t=e(`play`,[[`path`,{d:`M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z`,key:`10ikf1`}]]);export{t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{B as e}from"./useAppStore-
|
|
1
|
+
import{B as e}from"./useAppStore-DNhyhD20.js";var t=e(`refresh-cw`,[[`path`,{d:`M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8`,key:`v9h5vc`}],[`path`,{d:`M21 3v5h-5`,key:`1q7to0`}],[`path`,{d:`M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16`,key:`3uifl3`}],[`path`,{d:`M8 16H3v5`,key:`1cv678`}]]);export{t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{B as e}from"./useAppStore-
|
|
1
|
+
import{B as e}from"./useAppStore-DNhyhD20.js";var t=e(`save`,[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]);export{t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,o as t,t as n}from"./jsx-runtime-Bt-cYkS5.js";import{B as r,c as i}from"./useAppStore-DNhyhD20.js";import{a}from"./i18n-C6yaqRst.js";import{t as o}from"./download-Cy2BlfKM.js";import{t as s}from"./file-text-zvTER2mN.js";import{t as c}from"./loader-C4pED_QP.js";import{t as l}from"./music-Br2x8TKX.js";import{O as u}from"./index-D1mozno-.js";var d=r(`pen`,[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}]]),f=r(`film`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,key:`afitv7`}],[`path`,{d:`M7 3v18`,key:`bbkbws`}],[`path`,{d:`M3 7.5h4`,key:`zfgn84`}],[`path`,{d:`M3 12h18`,key:`1i2n21`}],[`path`,{d:`M3 16.5h4`,key:`1230mu`}],[`path`,{d:`M17 3v18`,key:`in4fa5`}],[`path`,{d:`M17 7.5h4`,key:`myr1c1`}],[`path`,{d:`M17 16.5h4`,key:`go4c1d`}]]),p=r(`image`,[[`rect`,{width:`18`,height:`18`,x:`3`,y:`3`,rx:`2`,ry:`2`,key:`1m3agn`}],[`circle`,{cx:`9`,cy:`9`,r:`2`,key:`af1f0g`}],[`path`,{d:`m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21`,key:`1xmnt7`}]]);function m(e){let t=String(e||``).split(`.`).pop()?.toLowerCase()||``,n=[`jpg`,`jpeg`,`png`,`gif`,`webp`,`svg`,`bmp`,`ico`,`tiff`,`heic`,`heif`],r=[`mp4`,`webm`,`mov`,`avi`,`mkv`,`flv`,`wmv`,`m4v`,`mpeg`,`3gp`],i=[`mp3`,`wav`,`ogg`,`flac`,`aac`,`m4a`,`wma`,`opus`],a=`txt.md.js.ts.jsx.tsx.css.scss.less.json.xml.html.htm.yaml.yml.toml.ini.cfg.conf.log.sh.bash.py.rb.go.rs.java.c.cpp.h.hpp.cs.php.sql.graphql.env.gitignore.dockerfile.readme`.split(`.`);return n.includes(t)?`image`:r.includes(t)?`video`:i.includes(t)?`audio`:a.includes(t)?`text`:`file`}var h=t(e(),1),g=n();function _(e){return e===`image`||e===`video`||e===`audio`}function v({item:e,isBackendReady:t,getFileDownloadUrl:n,onClose:r,onSaveAs:d}){let{t:f}=a(),[p,m]=(0,h.useState)(``),[v,y]=(0,h.useState)(!1),[b,x]=(0,h.useState)(``),[S,C]=(0,h.useState)(``),[w,T]=(0,h.useState)(!1);(0,h.useEffect)(()=>{if(e.subtype!==`text`)return;let r=!1;if(m(``),C(``),!t){m(f(`preview.loadFailed`));return}return y(!0),(async()=>{try{let t=await fetch(n(e.cid),{headers:{...await i(`GET`,`/api/files/${e.cid}/download`),Range:`bytes=0-9999`}});if(!t.ok)throw Error(f(`preview.loadFailed`));let a=await t.text();r||m(a||f(`preview.emptyFile`))}catch{r||m(f(`preview.loadFailed`))}finally{r||y(!1)}})(),()=>{r=!0}},[n,t,e.cid,e.subtype]),(0,h.useEffect)(()=>{if(!_(e.subtype)){x(``);return}if(x(``),C(``),!t){C(f(`preview.loadFailed`));return}let r=``,a=!1;return(async()=>{try{let t=await fetch(n(e.cid),{headers:await i(`GET`,`/api/files/${e.cid}/download`)});if(!t.ok)throw Error(f(`preview.loadFailed`));let o=URL.createObjectURL(await t.blob());r=o,a||x(o)}catch{a||C(f(`preview.loadFailed`))}})(),()=>{a=!0,r&&URL.revokeObjectURL(r)}},[n,t,e.cid,e.subtype]);async function E(t){if(t.stopPropagation(),!(!d||w)){T(!0);try{await d(e)}finally{T(!1)}}}return(0,g.jsxs)(`div`,{className:`preview-overlay`,onClick:r,children:[(0,g.jsxs)(`div`,{className:`preview-actions`,children:[d&&(0,g.jsxs)(`button`,{type:`button`,className:`preview-save`,onClick:E,disabled:!t||w,"aria-label":f(`app.saveAs`),title:f(`app.saveAs`),children:[w?(0,g.jsx)(c,{size:17,className:`preview-text-spinner`}):(0,g.jsx)(o,{size:17}),(0,g.jsx)(`span`,{children:f(`app.saveAs`)})]}),(0,g.jsx)(`button`,{type:`button`,className:`preview-close`,onClick:r,"aria-label":f(`preview.close`),children:(0,g.jsx)(u,{size:20})})]}),(0,g.jsxs)(`div`,{onClick:e=>e.stopPropagation(),children:[e.subtype===`image`&&(0,g.jsx)(`div`,{className:`preview-media-wrapper`,children:b?(0,g.jsx)(`img`,{src:b,alt:e.fileName,translate:`no`}):S?(0,g.jsxs)(`div`,{className:`preview-unsupported`,children:[(0,g.jsx)(s,{size:48,className:`preview-file-icon`}),(0,g.jsx)(`p`,{translate:`no`,children:e.fileName}),(0,g.jsx)(`p`,{className:`preview-unsupported-hint`,children:S})]}):(0,g.jsx)(`div`,{className:`preview-loading`,children:(0,g.jsx)(`div`,{className:`preview-loading-spinner`})})}),e.subtype===`video`&&(0,g.jsx)(`div`,{className:`preview-media-wrapper`,children:b?(0,g.jsx)(`video`,{src:b,controls:!0}):S?(0,g.jsxs)(`div`,{className:`preview-unsupported`,children:[(0,g.jsx)(s,{size:48,className:`preview-file-icon`}),(0,g.jsx)(`p`,{translate:`no`,children:e.fileName}),(0,g.jsx)(`p`,{className:`preview-unsupported-hint`,children:S})]}):(0,g.jsx)(`div`,{className:`preview-loading`,children:(0,g.jsx)(`div`,{className:`preview-loading-spinner`})})}),e.subtype===`audio`&&(0,g.jsxs)(`div`,{className:`preview-audio`,children:[(0,g.jsx)(`div`,{className:`preview-audio-icon`,children:(0,g.jsx)(l,{size:36,color:`var(--accent)`})}),(0,g.jsx)(`p`,{className:`preview-audio-filename`,translate:`no`,children:e.fileName}),b?(0,g.jsx)(`audio`,{className:`preview-audio-player`,src:b,controls:!0}):(0,g.jsx)(`div`,{className:`preview-text-loading`,children:S?(0,g.jsx)(`p`,{children:S}):(0,g.jsxs)(g.Fragment,{children:[(0,g.jsx)(c,{size:24,className:`preview-text-spinner`}),(0,g.jsx)(`p`,{children:f(`preview.audioLoading`)})]})})]}),e.subtype===`file`&&(0,g.jsxs)(`div`,{className:`preview-unsupported`,children:[(0,g.jsx)(s,{size:48,className:`preview-file-icon`}),(0,g.jsx)(`p`,{translate:`no`,children:e.fileName}),(0,g.jsx)(`p`,{className:`preview-unsupported-hint`,children:f(`preview.unsupported`)})]}),e.subtype===`text`&&(0,g.jsxs)(`div`,{className:`preview-text-container`,children:[(0,g.jsx)(`div`,{className:`preview-text-header`,children:(0,g.jsx)(`span`,{translate:`no`,children:e.fileName})}),v?(0,g.jsxs)(`div`,{className:`preview-text-loading`,children:[(0,g.jsx)(c,{size:24,className:`preview-text-spinner`}),(0,g.jsx)(`p`,{children:f(`preview.textLoading`)}),(0,g.jsx)(`p`,{className:`preview-text-loading-hint`,children:f(`preview.firstSyncHint`)})]}):(0,g.jsx)(`pre`,{className:`preview-text`,translate:`no`,children:p||f(`preview.emptyFile`)})]})]})]})}function y(){if(typeof fetch!=`function`)throw Error(`Browser fetch unavailable`);return fetch.bind(globalThis)}function b(){let e=globalThis.showSaveFilePicker;return typeof e==`function`?e.bind(globalThis):null}function x(){let e=globalThis.document;if(!e?.body||typeof e.createElement!=`function`)throw Error(`Browser download unavailable`);return e}function S(e){return String(e||``).replace(/\\/g,`/`).split(`/`).filter(Boolean).pop()||`download`}async function C({cid:e,getFileDownloadUrl:t,loadFailedMessage:n,getRequestHeaders:r,fetchFile:i}){let a=`/api/files/${e}/download`,o=r?await r(`GET`,a):{},s=await(i||y())(t(e),{headers:o});if(!s.ok)throw Error(n||`Failed to get file`);return s.blob()}async function w(e,t,n){let r=await(await e({suggestedName:t})).createWritable();await r.write(n),await r.close()}function T(e,t,n,r){let i=t.createObjectURL(r),a=null,o=!1;try{a=e.createElement(`a`),a.href=i,a.download=n,e.body.appendChild(a),o=!0,a.click()}finally{a&&o&&e.body.removeChild(a),t.revokeObjectURL(i)}}async function E(e){let t=await C(e),n=S(e.fileName),r=e.showSaveFilePicker===void 0?b():e.showSaveFilePicker;return r?(await w(r,n,t),{method:`picker`}):(T(e.documentRef||x(),e.urlApi||URL,n,t),{method:`download`})}export{f as a,p as i,v as n,d as o,m as r,E as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{B as e}from"./useAppStore-DNhyhD20.js";var t=e(`search`,[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]);export{t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{B as e}from"./useAppStore-
|
|
1
|
+
import{B as e}from"./useAppStore-DNhyhD20.js";var t=e(`send`,[[`path`,{d:`M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z`,key:`1ffxy3`}],[`path`,{d:`m21.854 2.147-10.94 10.939`,key:`12cjpa`}]]);export{t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{B as e}from"./useAppStore-
|
|
1
|
+
import{B as e}from"./useAppStore-DNhyhD20.js";var t=e(`shield-check`,[[`path`,{d:`M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z`,key:`oel41y`}],[`path`,{d:`m9 12 2 2 4-4`,key:`dzmm74`}]]);export{t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{B as e}from"./useAppStore-
|
|
1
|
+
import{B as e}from"./useAppStore-DNhyhD20.js";var t=e(`cloud`,[[`path`,{d:`M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z`,key:`p7xjir`}]]),n=e(`smartphone`,[[`rect`,{width:`14`,height:`20`,x:`5`,y:`2`,rx:`2`,ry:`2`,key:`1yt0o3`}],[`path`,{d:`M12 18h.01`,key:`mhygvu`}]]);export{t as n,n as t};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{B as e}from"./useAppStore-DNhyhD20.js";var t=e(`chevron-right`,[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]),n=e(`trash-2`,[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]]);export{t as n,n as t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{B as e}from"./useAppStore-
|
|
1
|
+
import{B as e}from"./useAppStore-DNhyhD20.js";var t=e(`triangle-alert`,[[`path`,{d:`m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3`,key:`wmoenq`}],[`path`,{d:`M12 9v4`,key:`juzpu7`}],[`path`,{d:`M12 17h.01`,key:`p32p05`}]]);export{t};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{B as e}from"./useAppStore-
|
|
1
|
+
import{B as e}from"./useAppStore-DNhyhD20.js";var t=e(`upload`,[[`path`,{d:`M12 3v12`,key:`1x0j5s`}],[`path`,{d:`m17 8-5-5-5 5`,key:`7q97r8`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}]]);export{t};
|