@lunora/studio 1.0.0-alpha.7 → 1.0.0-alpha.71
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/LICENSE.md +6 -0
- package/dist/index.d.ts +762 -779
- package/dist/index.js +1 -41
- package/dist/mount.d.ts +10 -10
- package/dist/mount.js +1 -26
- package/dist/packem_chunks/ApiTab.js +1 -0
- package/dist/packem_chunks/AuditPanel.js +1 -0
- package/dist/packem_chunks/DeploymentHealthPanel.js +1 -0
- package/dist/packem_chunks/ExportImportPanel.js +3 -0
- package/dist/packem_chunks/FileBrowser.js +4 -0
- package/dist/packem_chunks/FunctionRunner.js +1 -0
- package/dist/packem_chunks/FunctionStatsPanel.js +1 -0
- package/dist/packem_chunks/HealthPanel.js +1 -0
- package/dist/packem_chunks/InsightsPanel.js +1 -0
- package/dist/packem_chunks/LogsPanel.js +1 -0
- package/dist/packem_chunks/MailPanel.js +2 -0
- package/dist/packem_chunks/MetricsPanel.js +1 -0
- package/dist/packem_chunks/MigrationsPanel.js +1 -0
- package/dist/packem_chunks/NotificationsPanel.js +1 -0
- package/dist/packem_chunks/PitrPanel.js +1 -0
- package/dist/packem_chunks/SchemaViewer.js +2 -0
- package/dist/packem_chunks/SecurityAdvisorPanel.js +1 -0
- package/dist/packem_chunks/SettingsPanel.js +1 -0
- package/dist/packem_chunks/SqlEditorPanel.js +4 -0
- package/dist/packem_chunks/TableEditor.js +1 -0
- package/dist/packem_chunks/agents-panel.js +1 -0
- package/dist/packem_chunks/analytics-panel.js +1 -0
- package/dist/packem_chunks/auth-audit-panel.js +1 -0
- package/dist/packem_chunks/auth-config-panel.js +1 -0
- package/dist/packem_chunks/auth-sessions-panel.js +1 -0
- package/dist/packem_chunks/containers-panel.js +1 -0
- package/dist/packem_chunks/dashboards-panel.js +1 -0
- package/dist/packem_chunks/fanout-panel.js +1 -0
- package/dist/packem_chunks/flags-panel.js +1 -0
- package/dist/packem_chunks/issues-panel.js +1 -0
- package/dist/packem_chunks/kv-browser.js +1 -0
- package/dist/packem_chunks/log-drains-panel.js +4 -0
- package/dist/packem_chunks/organizations-panel.js +1 -0
- package/dist/packem_chunks/payments-panel.js +1 -0
- package/dist/packem_chunks/permissions-panel.js +1 -0
- package/dist/packem_chunks/queues-panel.js +1 -0
- package/dist/packem_chunks/rls-panel.js +1 -0
- package/dist/packem_chunks/schedule-panel.js +1 -0
- package/dist/packem_chunks/sparkline.js +1 -0
- package/dist/packem_chunks/storage-rules-panel.js +1 -0
- package/dist/packem_chunks/subscriptions-panel.js +1 -0
- package/dist/packem_chunks/sync-client-panel.js +1 -0
- package/dist/packem_chunks/traces-panel.js +1 -0
- package/dist/packem_chunks/users-panel.js +1 -0
- package/dist/packem_chunks/vector-browser.js +1 -0
- package/dist/packem_chunks/workflows-panel.js +1 -0
- package/dist/packem_shared/ADMIN_FUNCTIONS-BYNSbBVE.js +1 -0
- package/dist/packem_shared/ApiDocsPanel-eJYZlylw.js +2 -0
- package/dist/packem_shared/ApiReferencePanel-C42v1jr6.js +1 -0
- package/dist/packem_shared/CommandPalette-CVIaY3j8.js +1 -0
- package/dist/packem_shared/ConfirmButton-CTL3f3kr.js +1 -0
- package/dist/packem_shared/ConnectionBadge-DOk0CQWo.js +1 -0
- package/dist/packem_shared/DEFAULT_AUTO_REFRESH_MS-BCC8_4BQ.js +1 -0
- package/dist/packem_shared/DEFAULT_INSIGHT_THRESHOLDS-B-hcFVoi.js +1 -0
- package/dist/packem_shared/DEFAULT_LOCALE-BZ4NojpD.js +1 -0
- package/dist/packem_shared/DataBrowser-B8J5lHjP.js +1 -0
- package/dist/packem_shared/DataFilters-Csb30F0C.js +1 -0
- package/dist/packem_shared/ErrorBoundary-DvzYskH7.js +1 -0
- package/dist/packem_shared/GlobalDataBrowser-RLJ6NvOs.js +1 -0
- package/dist/packem_shared/HomePanel-DL1HupAN.js +1 -0
- package/dist/packem_shared/OpenRpcReferencePanel-sGsIgYWj.js +1 -0
- package/dist/packem_shared/STUDIO_ROOT_CLASS-C6MccdVk.js +1 -0
- package/dist/packem_shared/ScheduledJobs-DUbo6epc.js +1 -0
- package/dist/packem_shared/ShardInput-BVn2iCU0.js +1 -0
- package/dist/packem_shared/Studio-BWBclm_C.js +1 -0
- package/dist/packem_shared/StudioApp-BFm73yVr.js +1 -0
- package/dist/packem_shared/StudioI18nProvider-CZ5h4nrV.js +1 -0
- package/dist/packem_shared/advisor-view-DaCX9Jy5.js +1 -0
- package/dist/packem_shared/aggregateMetrics-BNfajLa2.js +1 -0
- package/dist/packem_shared/alert-CVcOFuDR.js +1 -0
- package/dist/packem_shared/app.d-bRPJhby-.d.ts +254 -0
- package/dist/packem_shared/badge-BbuuAio7.js +1 -0
- package/dist/packem_shared/bar-chart-AryFCeoa.js +9 -0
- package/dist/packem_shared/browser-storage-xjTyMKY0.js +1 -0
- package/dist/packem_shared/button-BkCrNcAs.js +1 -0
- package/dist/packem_shared/card-CIDGUN6K.js +1 -0
- package/dist/packem_shared/cf-links-gbDy51nR.js +1 -0
- package/dist/packem_shared/checkbox-StT4Gob6.js +1 -0
- package/dist/packem_shared/data-grid-BMBKzMEJ.js +1 -0
- package/dist/packem_shared/data-view-params-C8T3bW1z.js +1 -0
- package/dist/packem_shared/dropdown-menu-C3RQ_HlW.js +2 -0
- package/dist/packem_shared/empty-state-Cg7t_8qu.js +1 -0
- package/dist/packem_shared/error-alert-B59DnrDI.js +1 -0
- package/dist/packem_shared/grid-features-uZCUj955.js +6 -0
- package/dist/packem_shared/home-panel-B-8BCffw.js +3 -0
- package/dist/packem_shared/input-JHu63lTv.js +1 -0
- package/dist/packem_shared/internal-AtZ4bTal.js +2 -0
- package/dist/packem_shared/label-6uP1obNF.js +1 -0
- package/dist/packem_shared/live-status-CGW2JHf_.js +1 -0
- package/dist/packem_shared/log-fields-CoL3hsIQ.js +1 -0
- package/dist/packem_shared/modal-shell-CUwwWC2o.js +1 -0
- package/dist/packem_shared/reference-view-KvhektwF.js +12 -0
- package/dist/packem_shared/result-chart-CwKhhKM0.js +1 -0
- package/dist/packem_shared/scroll-area-DTEq6Jec.js +2 -0
- package/dist/packem_shared/select-Bul-DeII.js +2 -0
- package/dist/packem_shared/shard-history-DMEW5VBE.js +1 -0
- package/dist/packem_shared/skeleton-C1wQ9M5t.js +1 -0
- package/dist/packem_shared/sparkline-DtcZoU48.js +1 -0
- package/dist/packem_shared/storage-tier-DznqOf-q.js +1 -0
- package/dist/packem_shared/studio-BHA7hnI3.js +2 -0
- package/dist/packem_shared/table-DdJBrClo.js +2 -0
- package/dist/packem_shared/table-list-sidebar-CMCcNALK.js +1 -0
- package/dist/packem_shared/textarea-Bu2-jKAs.js +1 -0
- package/dist/packem_shared/trace-handoff-Dw7mwjxu.js +1 -0
- package/dist/packem_shared/use-admin-query-Di3fLE8H.js +1 -0
- package/dist/packem_shared/use-async-submit-H68GHPz8.js +1 -0
- package/dist/packem_shared/useDebounced-Ihdiid_k.js +1 -0
- package/dist/packem_shared/utils-bhneXptQ.js +1 -0
- package/dist/packem_shared/virtual-rect-1o1veP7R.js +1 -0
- package/dist/standalone/chunk-2F7G7IWQ.js +1 -0
- package/dist/standalone/chunk-2OUPA2WJ.js +1 -0
- package/dist/standalone/chunk-2PJNAWB3.js +1 -0
- package/dist/standalone/chunk-2Y36BVVM.js +4 -0
- package/dist/standalone/chunk-34UVAASH.js +1 -0
- package/dist/standalone/chunk-35II7U25.js +11 -0
- package/dist/standalone/chunk-3FUFEZ65.js +1 -0
- package/dist/standalone/chunk-3QRTYSSX.js +1 -0
- package/dist/standalone/chunk-3RTTXLMU.js +1 -0
- package/dist/standalone/chunk-3XIESWL4.js +1 -0
- package/dist/standalone/chunk-4CGALXS3.js +19 -0
- package/dist/standalone/chunk-4UOFSGUS.js +1 -0
- package/dist/standalone/chunk-4WLYA3XE.js +1 -0
- package/dist/standalone/chunk-54MMVNPT.js +1 -0
- package/dist/standalone/chunk-5L2MD6F6.js +1 -0
- package/dist/standalone/chunk-5OWIOACV.js +13 -0
- package/dist/standalone/chunk-5RF4QDDA.js +6 -0
- package/dist/standalone/chunk-5U2THBI7.js +1 -0
- package/dist/standalone/chunk-5Y3QLNWX.js +1 -0
- package/dist/standalone/chunk-65OTWFS3.js +1 -0
- package/dist/standalone/chunk-6DWCIIHE.js +1 -0
- package/dist/standalone/chunk-6ST5ECQA.js +1 -0
- package/dist/standalone/chunk-7J5N6DGQ.js +1 -0
- package/dist/standalone/chunk-7LQWFOEU.js +1 -0
- package/dist/standalone/chunk-7QIFDWQV.js +1 -0
- package/dist/standalone/chunk-7RXOPYR5.js +1 -0
- package/dist/standalone/chunk-7T7UOTYK.js +1 -0
- package/dist/standalone/chunk-7YEFOSPH.js +1 -0
- package/dist/standalone/chunk-AVAC26HJ.js +1 -0
- package/dist/standalone/chunk-B43FTQJ7.js +1 -0
- package/dist/standalone/chunk-BEH5N5ZA.js +1 -0
- package/dist/standalone/chunk-BGBLQ563.js +1 -0
- package/dist/standalone/chunk-BNUJ7QMG.js +3 -0
- package/dist/standalone/chunk-C43X4M5U.js +1 -0
- package/dist/standalone/chunk-CFPZYHPY.js +2 -0
- package/dist/standalone/chunk-D7XXWV4E.js +1 -0
- package/dist/standalone/chunk-DVOBKIUX.js +1 -0
- package/dist/standalone/chunk-EKRN4ZQM.js +1 -0
- package/dist/standalone/chunk-ESVP44Y3.js +1 -0
- package/dist/standalone/chunk-EVN46TVV.js +1 -0
- package/dist/standalone/chunk-EXFBIISG.js +2 -0
- package/dist/standalone/chunk-F5QWLENA.js +1 -0
- package/dist/standalone/chunk-F6GOKFMU.js +3 -0
- package/dist/standalone/chunk-FGTK44LR.js +1 -0
- package/dist/standalone/chunk-FXCBF4XT.js +1 -0
- package/dist/standalone/chunk-GMR677FL.js +1 -0
- package/dist/standalone/chunk-GRL5MG3Z.js +1 -0
- package/dist/standalone/chunk-GSPTEMYN.js +1 -0
- package/dist/standalone/chunk-GXZAXNZI.js +1 -0
- package/dist/standalone/chunk-H7NIIBHH.js +1 -0
- package/dist/standalone/chunk-HP2UCWND.js +1 -0
- package/dist/standalone/chunk-HPFLBYRI.js +1 -0
- package/dist/standalone/chunk-IC4L6G56.js +1 -0
- package/dist/standalone/chunk-IDNNI63H.js +1 -0
- package/dist/standalone/chunk-ILNELDFC.js +1 -0
- package/dist/standalone/chunk-IVFHIQOT.js +1 -0
- package/dist/standalone/chunk-JN2Y24PY.js +1 -0
- package/dist/standalone/chunk-KDOC2DP5.js +1 -0
- package/dist/standalone/chunk-KUVMORDQ.js +1 -0
- package/dist/standalone/chunk-KYF2E5CJ.js +1 -0
- package/dist/standalone/chunk-L7N7F3DA.js +1 -0
- package/dist/standalone/chunk-LE56LPNH.js +13 -0
- package/dist/standalone/chunk-LEDWUPXM.js +1 -0
- package/dist/standalone/chunk-LFKCLLPT.js +1 -0
- package/dist/standalone/chunk-LFXFP4IF.js +1 -0
- package/dist/standalone/chunk-LJDP7NRB.js +1 -0
- package/dist/standalone/chunk-LLXFYRGQ.js +1 -0
- package/dist/standalone/chunk-M536Y2KX.js +1 -0
- package/dist/standalone/chunk-MIQTKZAR.js +1 -0
- package/dist/standalone/chunk-OHKRN65U.js +1 -0
- package/dist/standalone/chunk-P24JBHEZ.js +4 -0
- package/dist/standalone/chunk-PF7V3G2Z.js +62 -0
- package/dist/standalone/chunk-PWWHP76O.js +1 -0
- package/dist/standalone/chunk-QBWRC5YX.js +1 -0
- package/dist/standalone/chunk-QGKAJTQQ.js +1 -0
- package/dist/standalone/chunk-QLJJ5YYZ.js +1 -0
- package/dist/standalone/chunk-QVEHPYA5.js +1 -0
- package/dist/standalone/chunk-QWGT25SE.js +1 -0
- package/dist/standalone/chunk-QWJ3NPE3.js +1 -0
- package/dist/standalone/chunk-RAA2RGG6.js +1 -0
- package/dist/standalone/chunk-RBU52M5T.js +1 -0
- package/dist/standalone/chunk-SA3MDZC3.js +1 -0
- package/dist/standalone/chunk-SD4BERSA.js +1 -0
- package/dist/standalone/chunk-SFDOII3B.js +1 -0
- package/dist/standalone/chunk-SKHEGARW.js +1 -0
- package/dist/standalone/chunk-SMIESS7P.js +1 -0
- package/dist/standalone/chunk-T2JIUFOD.js +4 -0
- package/dist/standalone/chunk-T6VMSOBB.js +1 -0
- package/dist/standalone/chunk-THIXMMZD.js +1 -0
- package/dist/standalone/chunk-TJ2WZ5OP.js +1 -0
- package/dist/standalone/chunk-TLHJRWNK.js +1 -0
- package/dist/standalone/chunk-UIS34ZPB.js +8 -0
- package/dist/standalone/chunk-UNUU7CJJ.js +1 -0
- package/dist/standalone/chunk-UZERI5YC.js +1 -0
- package/dist/standalone/chunk-V53KNYRN.js +1 -0
- package/dist/standalone/chunk-VPAXCQ2Y.js +4 -0
- package/dist/standalone/chunk-X2FQ6B5V.js +1 -0
- package/dist/standalone/chunk-XBDKZZ67.js +1 -0
- package/dist/standalone/chunk-XEDU5FO4.js +1 -0
- package/dist/standalone/chunk-XQBTNJUQ.js +1 -0
- package/dist/standalone/chunk-XQCVZAGU.js +1 -0
- package/dist/standalone/chunk-XQGANNLS.js +1 -0
- package/dist/standalone/chunk-XSD4Y6SQ.js +1 -0
- package/dist/standalone/chunk-XXQUMVWH.js +1 -0
- package/dist/standalone/chunk-YD5NF6UT.js +1 -0
- package/dist/standalone/chunk-YI3WYUXK.js +1 -0
- package/dist/standalone/chunk-ZJGP6EKR.js +1 -0
- package/dist/standalone/chunk-ZNNAGR6N.js +1 -0
- package/dist/standalone/studio.js +9 -356
- package/dist/styles.css +2 -2
- package/package.json +17 -15
- package/dist/packem_shared/ADMIN_FUNCTIONS-DmBqMZ-z.js +0 -45
- package/dist/packem_shared/ApiDocsPanel-C5-yJ1p7.js +0 -842
- package/dist/packem_shared/ApiReferencePanel-1vubqG5s.js +0 -229
- package/dist/packem_shared/ApiTab-W3no0KOj.js +0 -251
- package/dist/packem_shared/AuditPanel-Bq4o_IqT.js +0 -212
- package/dist/packem_shared/CommandPalette-BtgkBzZI.js +0 -373
- package/dist/packem_shared/ConfirmButton-C2eVi2Qv.js +0 -59
- package/dist/packem_shared/ConnectionBadge-B2DDM2Tn.js +0 -111
- package/dist/packem_shared/DEFAULT_AUTO_REFRESH_MS-Vxwaxx51.js +0 -50
- package/dist/packem_shared/DEFAULT_INSIGHT_THRESHOLDS-DjF0h-gA.js +0 -89
- package/dist/packem_shared/DEFAULT_LOCALE-CiX4W7Kr.js +0 -27
- package/dist/packem_shared/DataBrowser-CtBe1So9.js +0 -4542
- package/dist/packem_shared/DataFilters-FNquMaiu.js +0 -249
- package/dist/packem_shared/ErrorBoundary-BzAApI7J.js +0 -66
- package/dist/packem_shared/ExportImportPanel-dxY56TDF.js +0 -193
- package/dist/packem_shared/FileBrowser-Dhy4zES8.js +0 -2932
- package/dist/packem_shared/FunctionRunner--fQJRPAD.js +0 -343
- package/dist/packem_shared/FunctionStatsPanel-BjRUA_G3.js +0 -432
- package/dist/packem_shared/GlobalDataBrowser-BTEmGrph.js +0 -318
- package/dist/packem_shared/HealthPanel-PxclMWmA.js +0 -640
- package/dist/packem_shared/HomePanel-Cw16stjq.js +0 -1273
- package/dist/packem_shared/InsightsPanel-CWS_C-xW.js +0 -423
- package/dist/packem_shared/LogsPanel-CTW8CFcM.js +0 -839
- package/dist/packem_shared/MailPanel-BwkvfIHF.js +0 -447
- package/dist/packem_shared/MetricsPanel-BLuOhZQ4.js +0 -1625
- package/dist/packem_shared/MigrationsPanel-DT3lnwHF.js +0 -246
- package/dist/packem_shared/OpenRpcReferencePanel-vbcYbv3V.js +0 -191
- package/dist/packem_shared/PitrPanel-CdErL7EJ.js +0 -252
- package/dist/packem_shared/STUDIO_ROOT_CLASS-D12gX2dV.js +0 -3
- package/dist/packem_shared/ScheduledJobs-CabfKbyM.js +0 -159
- package/dist/packem_shared/SchemaViewer-LJDcmNIO.js +0 -2512
- package/dist/packem_shared/SecurityAdvisorPanel-C_ETsPih.js +0 -79
- package/dist/packem_shared/SettingsPanel-C0uLRf5P.js +0 -176
- package/dist/packem_shared/ShardInput-gx_DZXXn.js +0 -107
- package/dist/packem_shared/SqlEditorPanel-CguV7otm.js +0 -13
- package/dist/packem_shared/Studio-BmSGSIuY.js +0 -33
- package/dist/packem_shared/StudioApp-D4azxYBu.js +0 -657
- package/dist/packem_shared/StudioI18nProvider-B-tDCZIi.js +0 -48
- package/dist/packem_shared/TableEditor-ChfUOZec.js +0 -371
- package/dist/packem_shared/advisor-view-CGcfMiPq.js +0 -159
- package/dist/packem_shared/aggregateMetrics-D4nUHEKU.js +0 -108
- package/dist/packem_shared/app.d-CCmwDEVs.d.ts +0 -300
- package/dist/packem_shared/badge-B2PKA1-5.js +0 -49
- package/dist/packem_shared/bar-chart-CzJAgqkp.js +0 -3245
- package/dist/packem_shared/button-BhsN2uZH.js +0 -49
- package/dist/packem_shared/card-DURq3ElK.js +0 -175
- package/dist/packem_shared/cf-links-2cktDedA.js +0 -8
- package/dist/packem_shared/checkbox-UNkzAxl-.js +0 -63
- package/dist/packem_shared/data-grid-B5CaV3wS.js +0 -183
- package/dist/packem_shared/dropdown-menu-WY4B_eJO.js +0 -280
- package/dist/packem_shared/empty-state-DY_oe0k6.js +0 -98
- package/dist/packem_shared/grid-features-CzUfqgsM.js +0 -840
- package/dist/packem_shared/input-XH4r1Pt1.js +0 -53
- package/dist/packem_shared/internal-rXJEAhXS.js +0 -68
- package/dist/packem_shared/label-D8ykjn5J.js +0 -46
- package/dist/packem_shared/live-status-FZ0psC1z.js +0 -44
- package/dist/packem_shared/reference-view-B4E49Lip.js +0 -2180
- package/dist/packem_shared/shard-history-DyebH1R5.js +0 -38
- package/dist/packem_shared/sparkline-10dG-_f0.js +0 -93
- package/dist/packem_shared/sql-editor-panel-BFRpzj6r.js +0 -2562
- package/dist/packem_shared/storage-tier-CL98eOvn.js +0 -85
- package/dist/packem_shared/studio-H9fuQgSj.js +0 -10303
- package/dist/packem_shared/table-_RzNvy3R.js +0 -246
- package/dist/packem_shared/table-list-sidebar-Bg7uzbvC.js +0 -832
- package/dist/packem_shared/textarea-D3gaCU_-.js +0 -46
- package/dist/packem_shared/use-live-admin-Dq6g3daN.js +0 -73
- package/dist/packem_shared/use-live-shard-seed-Cuk3dnH0.js +0 -76
- package/dist/packem_shared/useDebounced-Dxncpg6z.js +0 -32
- package/dist/packem_shared/utils-B05Dmz_H.js +0 -8
- package/dist/packem_shared/virtual-rect-CVMUskSm.js +0 -10
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as d,e as m,f as b,g as i,h as u,j as c}from"./chunk-3XIESWL4.js";var n=m(i(),1),p=m(b(),1);var s=m(u(),1);function h(o){let e=(0,n.c)(8),t,a;e[0]!==o?({className:t,...a}=o,e[0]=o,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let l;e[3]!==t?(l=c("w-full caption-bottom text-xs",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==a||e[6]!==l?(r=(0,s.jsx)("div",{"data-slot":"table-container",className:"relative w-full overflow-x-auto overflow-y-clip",children:(0,s.jsx)("table",{"data-slot":"table",className:l,...a})}),e[5]=a,e[6]=l,e[7]=r):r=e[7],r}d(h,"u");function x(o){let e=(0,n.c)(8),t,a;e[0]!==o?({className:t,...a}=o,e[0]=o,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let l;e[3]!==t?(l=c("bg-muted/50 [&_tr]:border-b",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==a||e[6]!==l?(r=(0,s.jsx)("thead",{"data-slot":"table-header",className:l,...a}),e[5]=a,e[6]=l,e[7]=r):r=e[7],r}d(x,"p");function N(o){let e=(0,n.c)(8),t,a;e[0]!==o?({className:t,...a}=o,e[0]=o,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let l;e[3]!==t?(l=c("[&_tr:last-child]:border-0",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==a||e[6]!==l?(r=(0,s.jsx)("tbody",{"data-slot":"table-body",className:l,...a}),e[5]=a,e[6]=l,e[7]=r):r=e[7],r}d(N,"f");function w(o){let e=(0,n.c)(8),t,a;e[0]!==o?({className:t,...a}=o,e[0]=o,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let l;e[3]!==t?(l=c("border-b transition-colors hover:bg-muted/50 has-aria-expanded:bg-muted/50 data-[state=selected]:bg-muted",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==a||e[6]!==l?(r=(0,s.jsx)("tr",{"data-slot":"table-row",className:l,...a}),e[5]=a,e[6]=l,e[7]=r):r=e[7],r}d(w,"h");function g(o){let e=(0,n.c)(8),t,a;e[0]!==o?({className:t,...a}=o,e[0]=o,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let l;e[3]!==t?(l=c("h-9 border-e border-border px-3 text-start align-middle font-mono text-[11px] font-medium tracking-wide whitespace-nowrap text-muted-foreground uppercase last:border-e-0 [&:has([role=checkbox])]:pe-0",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==a||e[6]!==l?(r=(0,s.jsx)("th",{"data-slot":"table-head",className:l,...a}),e[5]=a,e[6]=l,e[7]=r):r=e[7],r}d(g,"x");function v(o){let e=(0,n.c)(8),t,a;e[0]!==o?({className:t,...a}=o,e[0]=o,e[1]=t,e[2]=a):(t=e[1],a=e[2]);let l;e[3]!==t?(l=c("border-e border-border px-3 py-1.5 align-middle whitespace-nowrap last:border-e-0 [&:has([role=checkbox])]:pe-0",t),e[3]=t,e[4]=l):l=e[4];let r;return e[5]!==a||e[6]!==l?(r=(0,s.jsx)("td",{"data-slot":"table-cell",className:l,...a}),e[5]=a,e[6]=l,e[7]=r):r=e[7],r}d(v,"N");export{h as a,x as b,N as c,w as d,g as e,v as f};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as T}from"./chunk-X2FQ6B5V.js";import{b as k}from"./chunk-XSD4Y6SQ.js";import{a as D,b as E,c as O,d as C,e as i,f as o}from"./chunk-MIQTKZAR.js";import{a as I,e as $}from"./chunk-UZERI5YC.js";import{b}from"./chunk-THIXMMZD.js";import"./chunk-6ST5ECQA.js";import{a as A}from"./chunk-GXZAXNZI.js";import"./chunk-35II7U25.js";import"./chunk-XBDKZZ67.js";import{a as L}from"./chunk-XQCVZAGU.js";import{d as S}from"./chunk-4CGALXS3.js";import"./chunk-LE56LPNH.js";import{a as v,e as w,f as K,g as M,h as P}from"./chunk-3XIESWL4.js";var j=w(M(),1),q=w(K(),1);var t=w(P(),1);var _="container:",W={error:"error",sleep:"sleeping",start:"running",stop:"stopped"},B=v(e=>{let n=e.indexOf(":");if(n===-1)return{event:e.trim()};let r=e.slice(n+1).trim(),a=e.slice(0,n).trim();return r===""?{event:a}:{detail:r,event:a}},"j"),F=v(e=>{let n=new Map;for(let r of e){let a=r.functionPath??"";if(!a.startsWith(_))continue;let s=a.slice(_.length);if(s==="")continue;let c=JSON.stringify([s,r.instance??""]),m=n.get(c);if(m!==void 0&&m.timestamp>=r.timestamp)continue;let{detail:g,event:l}=B(r.message);n.set(c,{detail:g,event:l,exitCode:r.exitCode,instance:r.instance,level:r.level,name:s,state:W[l]??"unknown",timestamp:r.timestamp})}return[...n.values()].toSorted((r,a)=>r.name.localeCompare(a.name)||(r.instance??"").localeCompare(a.instance??""))},"K"),J={error:"destructive",running:"success",sleeping:"info",stopped:"outline",unknown:"secondary"},U=v(e=>{let{entries:n}=e??{};return Array.isArray(n)?n:[]},"W"),ee=v(()=>{let e=(0,j.c)(23),n=S(),r,a;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={},a={live:!0,shardKey:""},e[0]=r,e[1]=a):(r=e[0],a=e[1]);let{data:s,error:c,liveError:m}=k(A.getLogs,r,a),g=s!==void 0,l;e[2]!==s?(l=F(U(s)),e[2]=s,e[3]=l):l=e[3];let N=l,d;e[4]!==c?(d=c!==null&&(0,t.jsx)("p",{className:"text-sm text-destructive","data-testid":"containers-error",role:"alert",children:c}),e[4]=c,e[5]=d):d=e[5];let h;e[6]!==n?(h=n("Cloudflare Containers are observed from their lifecycle log stream. This shows the current state per instance \u2014 ports and health checks aren't carried in that stream."),e[6]=n,e[7]=h):h=e[7];let p;e[8]!==h?(p=(0,t.jsx)("p",{className:"text-sm text-muted-foreground",children:h}),e[8]=h,e[9]=p):p=e[9];let u;e[10]!==m?(u=(0,t.jsx)(T,{message:m,prefix:"containers"}),e[10]=m,e[11]=u):u=e[11];let f;e[12]!==p||e[13]!==u?(f=(0,t.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[p,u]}),e[12]=p,e[13]=u,e[14]=f):f=e[14];let x;e[15]!==g||e[16]!==N||e[17]!==n?(x=g&&N.length===0?(0,t.jsx)(L,{description:n("No container lifecycle activity yet. Instances declared with defineContainer show up here once they start, sleep, stop, or error."),testId:"containers-empty",title:n("No container activity")}):(0,t.jsx)(I,{className:"overflow-hidden py-0",children:(0,t.jsx)($,{className:"px-0",children:(0,t.jsxs)(D,{"data-testid":"containers-table",children:[(0,t.jsx)(E,{children:(0,t.jsxs)(C,{children:[(0,t.jsx)(i,{children:n("Container")}),(0,t.jsx)(i,{children:n("Instance")}),(0,t.jsx)(i,{children:n("State")}),(0,t.jsx)(i,{children:n("Last event")}),(0,t.jsx)(i,{children:n("Detail")}),(0,t.jsx)(i,{children:n("Exit")}),(0,t.jsx)(i,{children:n("When")})]})}),(0,t.jsx)(O,{children:N.map(Y)})]})})}),e[15]=g,e[16]=N,e[17]=n,e[18]=x):x=e[18];let y;return e[19]!==d||e[20]!==f||e[21]!==x?(y=(0,t.jsxs)("div",{className:"flex flex-col gap-6","data-testid":"lunora-containers-panel",children:[d,f,x]}),e[19]=d,e[20]=f,e[21]=x,e[22]=y):y=e[22],y},"Y");function Y(e){return(0,t.jsxs)(C,{"data-testid":`containers-row-${e.name}${e.instance===void 0?"":`-${e.instance}`}`,children:[(0,t.jsx)(o,{className:"font-mono text-xs",children:e.name}),(0,t.jsx)(o,{className:"max-w-40 truncate font-mono text-xs text-muted-foreground",title:e.instance,children:e.instance??"\u2014"}),(0,t.jsx)(o,{children:(0,t.jsx)(b,{variant:J[e.state],children:e.state})}),(0,t.jsx)(o,{className:"font-mono text-xs text-muted-foreground",children:e.event}),(0,t.jsx)(o,{className:"max-w-64 truncate text-xs text-muted-foreground",title:e.detail,children:e.detail??"\u2014"}),(0,t.jsx)(o,{className:"font-mono text-xs tabular-nums text-muted-foreground",children:e.exitCode??"\u2014"}),(0,t.jsx)(o,{className:"text-xs tabular-nums text-muted-foreground",children:new Date(e.timestamp).toLocaleString()})]},`${e.name}/${e.instance??""}`)}v(Y,"B");export{ee as ContainersPanel};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{b as Ee}from"./chunk-5RF4QDDA.js";import"./chunk-XQGANNLS.js";import{c as _e}from"./chunk-SKHEGARW.js";import"./chunk-SD4BERSA.js";import"./chunk-IC4L6G56.js";import{a as ye}from"./chunk-JN2Y24PY.js";import"./chunk-ESVP44Y3.js";import{a as Ue}from"./chunk-54MMVNPT.js";import"./chunk-KYF2E5CJ.js";import"./chunk-7YEFOSPH.js";import"./chunk-BGBLQ563.js";import"./chunk-IVFHIQOT.js";import{a as Re}from"./chunk-7LQWFOEU.js";import"./chunk-T6VMSOBB.js";import{a as $e,b as Te,c as Fe,d as ce,e as ne,f as ee}from"./chunk-MIQTKZAR.js";import{a as je,e as ze}from"./chunk-UZERI5YC.js";import"./chunk-QBWRC5YX.js";import{a as De}from"./chunk-LFXFP4IF.js";import"./chunk-GRL5MG3Z.js";import"./chunk-7T7UOTYK.js";import{R as Ne}from"./chunk-CFPZYHPY.js";import"./chunk-7QIFDWQV.js";import{c as re}from"./chunk-FXCBF4XT.js";import"./chunk-2OUPA2WJ.js";import{b as ae}from"./chunk-THIXMMZD.js";import"./chunk-6ST5ECQA.js";import{a as be}from"./chunk-GXZAXNZI.js";import{f as Se}from"./chunk-35II7U25.js";import"./chunk-XBDKZZ67.js";import{a as he}from"./chunk-XQCVZAGU.js";import{d as Ce,f as me,g as ge,h as Y,m as W,o as Ke,p as pe}from"./chunk-4CGALXS3.js";import"./chunk-LE56LPNH.js";import{a as g,e as fe,f as gt,g as pt,h as bt}from"./chunk-3XIESWL4.js";var M=fe(pt(),1),z=fe(gt(),1);var n=fe(bt(),1);var Me=g((c,e,r)=>{let t=(0,M.c)(21),{onCopy:s,onDelete:o,onDownload:u,onToggleSelect:i}=r,l;t[0]!==c.key||t[1]!==s?(l=g(()=>{s(c.key)},"l"),t[0]=c.key,t[1]=s,t[2]=l):l=t[2];let f=l,h;t[3]!==c.key||t[4]!==u?(h=g(()=>{u(c.key)},"h"),t[3]=c.key,t[4]=u,t[5]=h):h=t[5];let d=h,m;t[6]!==c.key||t[7]!==o?(m=g(()=>{o(c.key)},"m"),t[6]=c.key,t[7]=o,t[8]=m):m=t[8];let w=m,a;t[9]!==c.key||t[10]!==i?(a=g(()=>{i(c.key)},"s"),t[9]=c.key,t[10]=i,t[11]=a):a=t[11];let v=a,x;t[12]!==c.key||t[13]!==e.length?(x=c.key.slice(e.length),t[12]=c.key,t[13]=e.length,t[14]=x):x=t[14];let b;return t[15]!==f||t[16]!==d||t[17]!==w||t[18]!==x||t[19]!==v?(b={copy:f,download:d,name:x,remove:w,toggle:v},t[15]=f,t[16]=d,t[17]=w,t[18]=x,t[19]=v,t[20]=b):b=t[20],b},"Ke"),Be=g(c=>{let e=(0,M.c)(31),{busy:r,buttonClassName:t,copied:s,objectKey:o,onCopy:u,onDelete:i,onDownload:l,t:f}=c,h=`storage-copy-${o}`,d;e[0]!==s||e[1]!==f?(d=f(s?"Copied":"Copy URL"),e[0]=s,e[1]=f,e[2]=d):d=e[2];let m;e[3]!==r||e[4]!==t||e[5]!==u||e[6]!==h||e[7]!==d?(m=(0,n.jsx)(re,{className:t,"data-testid":h,disabled:r,onClick:u,size:"sm",type:"button",variant:"ghost",children:d}),e[3]=r,e[4]=t,e[5]=u,e[6]=h,e[7]=d,e[8]=m):m=e[8];let w=`storage-download-${o}`,a;e[9]!==f?(a=f("Download"),e[9]=f,e[10]=a):a=e[10];let v;e[11]!==r||e[12]!==t||e[13]!==l||e[14]!==w||e[15]!==a?(v=(0,n.jsx)(re,{className:t,"data-testid":w,disabled:r,onClick:l,size:"sm",type:"button",variant:"ghost",children:a}),e[11]=r,e[12]=t,e[13]=l,e[14]=w,e[15]=a,e[16]=v):v=e[16];let x;e[17]!==f?(x=f("Delete object?"),e[17]=f,e[18]=x):x=e[18];let b=`storage-delete-${o}`,y;e[19]!==f?(y=f("Delete"),e[19]=f,e[20]=y):y=e[20];let k;e[21]!==r||e[22]!==i||e[23]!==x||e[24]!==b||e[25]!==y?(k=(0,n.jsx)(Re,{confirmLabel:x,disabled:r,onConfirm:i,testId:b,children:y}),e[21]=r,e[22]=i,e[23]=x,e[24]=b,e[25]=y,e[26]=k):k=e[26];let S;return e[27]!==k||e[28]!==m||e[29]!==v?(S=(0,n.jsxs)(n.Fragment,{children:[m,v,k]}),e[27]=k,e[28]=m,e[29]=v,e[30]=S):S=e[30],S},"De"),Ae=g(c=>{let e=(0,M.c)(14),{objectKey:r,references:t,t:s}=c;if(t===void 0)return null;if(t.length===0){let h=`storage-orphan-${r}`,d;e[0]!==s?(d=s("Orphan"),e[0]=s,e[1]=d):d=e[1];let m;return e[2]!==h||e[3]!==d?(m=(0,n.jsx)(ae,{"data-testid":h,variant:"warning",children:d}),e[2]=h,e[3]=d,e[4]=m):m=e[4],m}let o;e[5]!==t?(o=t.map(yt).join(`
|
|
2
|
+
`),e[5]=t,e[6]=o):o=e[6];let u=o,i=`storage-refs-${r}`,l;e[7]!==t.length||e[8]!==s?(l=t.length===1?s("1 record"):s("{count} records",{count:t.length}),e[7]=t.length,e[8]=s,e[9]=l):l=e[9];let f;return e[10]!==u||e[11]!==i||e[12]!==l?(f=(0,n.jsx)(ae,{"data-testid":i,title:u,variant:"secondary",children:l}),e[10]=u,e[11]=i,e[12]=l,e[13]=f):f=e[13],f},"Te"),Pe=g(c=>{let e=(0,M.c)(7),{objectKey:r,onToggle:t,selected:s,t:o}=c,u;e[0]!==o?(u=o("Select row"),e[0]=o,e[1]=u):u=e[1];let i=`storage-select-${r}`,l;return e[2]!==t||e[3]!==s||e[4]!==u||e[5]!==i?(l=(0,n.jsx)(ye,{"aria-label":u,checked:s,"data-testid":i,onCheckedChange:t}),e[2]=t,e[3]=s,e[4]=u,e[5]=i,e[6]=l):l=e[6],l},"Fe");function yt(c){return`${c.table}\xB7${c.id}`}g(yt,"xt");var xt=g(c=>{let e=(0,M.c)(10),{colSpan:r,name:t,onEnter:s}=c,o;e[0]!==t||e[1]!==s?(o=g(()=>{s(t)},"n"),e[0]=t,e[1]=s,e[2]=o):o=e[2];let u=o,i;e[3]===Symbol.for("react.memo_cache_sentinel")?(i=(0,n.jsx)("svg",{"aria-hidden":"true",className:"size-4 text-muted-foreground",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:(0,n.jsx)("path",{d:"M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V7Z"})}),e[3]=i):i=e[3];let l;e[4]!==u||e[5]!==t?(l=(0,n.jsxs)("button",{className:"inline-flex items-center gap-2 font-mono text-xs outline-none hover:text-foreground focus-visible:text-foreground","data-testid":"fb-folder",onClick:u,type:"button",children:[i,t]}),e[4]=u,e[5]=t,e[6]=l):l=e[6];let f;return e[7]!==r||e[8]!==l?(f=(0,n.jsx)(ce,{children:(0,n.jsx)(ee,{colSpan:r,children:l})}),e[7]=r,e[8]=l,e[9]=f):f=e[9],f},"kt"),vt=g(c=>{let e=(0,M.c)(33),{busy:r,copiedKey:t,handlers:s,object:o,prefix:u,references:i,selected:l,showReferences:f,t:h}=c,{copy:d,download:m,name:w,remove:a,toggle:v}=Me(o,u,s),x;e[0]!==o.key||e[1]!==l||e[2]!==h||e[3]!==v?(x=(0,n.jsx)(ee,{className:"w-8",children:(0,n.jsx)(Pe,{objectKey:o.key,onToggle:v,selected:l,t:h})}),e[0]=o.key,e[1]=l,e[2]=h,e[3]=v,e[4]=x):x=e[4];let b;e[5]!==w?(b=(0,n.jsx)(ee,{className:"font-mono text-xs",children:w}),e[5]=w,e[6]=b):b=e[6];let y;e[7]!==o.size?(y=pe(o.size),e[7]=o.size,e[8]=y):y=e[8];let k;e[9]!==y?(k=(0,n.jsx)(ee,{className:"tabular-nums text-muted-foreground",children:y}),e[9]=y,e[10]=k):k=e[10];let S=o.httpMetadata?.contentType??"",j;e[11]!==S?(j=(0,n.jsx)(ee,{children:S}),e[11]=S,e[12]=j):j=e[12];let C;e[13]!==o.key||e[14]!==i||e[15]!==f||e[16]!==h?(C=f&&(0,n.jsx)(ee,{children:(0,n.jsx)(Ae,{objectKey:o.key,references:i,t:h})}),e[13]=o.key,e[14]=i,e[15]=f,e[16]=h,e[17]=C):C=e[17];let N=t===o.key,K;e[18]!==r||e[19]!==d||e[20]!==m||e[21]!==o.key||e[22]!==a||e[23]!==h||e[24]!==N?(K=(0,n.jsx)(ee,{className:"text-right",children:(0,n.jsx)("span",{className:"inline-flex items-center gap-1",children:(0,n.jsx)(Be,{busy:r,copied:N,objectKey:o.key,onCopy:d,onDelete:a,onDownload:m,t:h})})}),e[18]=r,e[19]=d,e[20]=m,e[21]=o.key,e[22]=a,e[23]=h,e[24]=N,e[25]=K):K=e[25];let $;return e[26]!==x||e[27]!==b||e[28]!==k||e[29]!==j||e[30]!==C||e[31]!==K?($=(0,n.jsxs)(ce,{"data-testid":"fb-row",children:[x,b,k,j,C,K]}),e[26]=x,e[27]=b,e[28]=k,e[29]=j,e[30]=C,e[31]=K,e[32]=$):$=e[32],$},"vt"),kt=g(c=>{let e=(0,M.c)(65),{allSelected:r,busy:t,copiedKey:s,files:o,folders:u,handlers:i,onEnterFolder:l,prefix:f,references:h,selected:d,showReferences:m,someSelected:w,t:a,toggleSelectAll:v}=c,x;e[0]!==a?(x=a("Select all rows"),e[0]=a,e[1]=x):x=e[1];let b;e[2]!==r||e[3]!==w||e[4]!==x||e[5]!==v?(b=(0,n.jsx)(ne,{className:"w-8",children:(0,n.jsx)(ye,{"aria-label":x,checked:r,"data-testid":"storage-select-all",indeterminate:w,onCheckedChange:v})}),e[2]=r,e[3]=w,e[4]=x,e[5]=v,e[6]=b):b=e[6];let y;e[7]!==a?(y=a("key"),e[7]=a,e[8]=y):y=e[8];let k;e[9]!==y?(k=(0,n.jsx)(ne,{children:y}),e[9]=y,e[10]=k):k=e[10];let S;e[11]!==a?(S=a("size"),e[11]=a,e[12]=S):S=e[12];let j;e[13]!==S?(j=(0,n.jsx)(ne,{children:S}),e[13]=S,e[14]=j):j=e[14];let C;e[15]!==a?(C=a("content-type"),e[15]=a,e[16]=C):C=e[16];let N;e[17]!==C?(N=(0,n.jsx)(ne,{children:C}),e[17]=C,e[18]=N):N=e[18];let K;e[19]!==m||e[20]!==a?(K=m&&(0,n.jsx)(ne,{children:a("used by")}),e[19]=m,e[20]=a,e[21]=K):K=e[21];let $;e[22]!==a?($=a("Actions"),e[22]=a,e[23]=$):$=e[23];let F;e[24]!==$?(F=(0,n.jsx)(ne,{"aria-label":$}),e[24]=$,e[25]=F):F=e[25];let T;e[26]!==F||e[27]!==b||e[28]!==k||e[29]!==j||e[30]!==N||e[31]!==K?(T=(0,n.jsx)(Te,{children:(0,n.jsxs)(ce,{children:[b,k,j,N,K,F]})}),e[26]=F,e[27]=b,e[28]=k,e[29]=j,e[30]=N,e[31]=K,e[32]=T):T=e[32];let _;if(e[33]!==u||e[34]!==l||e[35]!==m){let R;e[37]!==l||e[38]!==m?(R=g(E=>(0,n.jsx)(xt,{colSpan:m?6:5,name:E,onEnter:l},E),"F"),e[37]=l,e[38]=m,e[39]=R):R=e[39],_=u.map(R),e[33]=u,e[34]=l,e[35]=m,e[36]=_}else _=e[36];let O;if(e[40]!==t||e[41]!==s||e[42]!==o||e[43]!==i||e[44]!==f||e[45]!==h||e[46]!==d||e[47]!==m||e[48]!==a){let R;e[50]!==t||e[51]!==s||e[52]!==i||e[53]!==f||e[54]!==h||e[55]!==d||e[56]!==m||e[57]!==a?(R=g(E=>(0,n.jsx)(vt,{busy:t,copiedKey:s,handlers:i,object:E,prefix:f,references:h[E.key],selected:d.has(E.key),showReferences:m,t:a},E.key),"F"),e[50]=t,e[51]=s,e[52]=i,e[53]=f,e[54]=h,e[55]=d,e[56]=m,e[57]=a,e[58]=R):R=e[58],O=o.map(R),e[40]=t,e[41]=s,e[42]=o,e[43]=i,e[44]=f,e[45]=h,e[46]=d,e[47]=m,e[48]=a,e[49]=O}else O=e[49];let U;e[59]!==_||e[60]!==O?(U=(0,n.jsxs)(Fe,{children:[_,O]}),e[59]=_,e[60]=O,e[61]=U):U=e[61];let L;return e[62]!==T||e[63]!==U?(L=(0,n.jsx)(je,{className:"overflow-hidden py-0",children:(0,n.jsx)(ze,{className:"px-0",children:(0,n.jsxs)($e,{"data-testid":"fb-table",children:[T,U]})})}),e[62]=T,e[63]=U,e[64]=L):L=e[64],L},"wt"),wt=[{label:"15m",seconds:900},{label:"1h",seconds:3600},{label:"24h",seconds:86400},{label:"7d",seconds:604800}],St=3600,Oe=g((c,e)=>{if(e==="size")return c.size;if(e==="type")return c.httpMetadata?.contentType??"";if(e==="date"){if(c.uploaded===void 0)return 0;let r=new Date(c.uploaded).getTime();return Number.isNaN(r)?0:r}return e.startsWith("tag:")?c.customMetadata?.[e.slice(4)]??"":c.key},"ke"),Ct=g((c,e,r)=>{let t=r==="desc"?-1:1;return c.toSorted((s,o)=>{let u=Oe(s,e),i=Oe(o,e);return(typeof u=="number"&&typeof i=="number"?u-i:String(u).localeCompare(String(i)))*t})},"Ct"),Nt=g((c,e)=>{let r=new Set,t=[];for(let s of c){let o=s.key.slice(e.length),u=o.indexOf("/");u===-1?t.push(s):r.add(o.slice(0,u+1))}return{files:t,folders:[...r].toSorted((s,o)=>s.localeCompare(o))}},"$t"),jt=g(c=>{let e=(0,M.c)(59),{bucket:r,buckets:t,busy:s,draftPrefix:o,expiry:u,fileInputRef:i,onBucketChange:l,onExpiryChange:f,onFileChange:h,onList:d,onPrefixChange:m,onUploadClick:w,t:a}=c,v;e[0]!==m?(v=g(P=>{m(P.target.value)},"x"),e[0]=m,e[1]=v):v=e[1];let x=v,b;e[2]!==l?(b=g(P=>{l(P.target.value)},"g"),e[2]=l,e[3]=b):b=e[3];let y=b,k;e[4]!==f?(k=g(P=>{f(Number.parseInt(P.target.value,10))},"k"),e[4]=f,e[5]=k):k=e[5];let S=k,j;e[6]!==r||e[7]!==t||e[8]!==y||e[9]!==a?(j=t.length>0&&(0,n.jsx)("select",{"aria-label":a("Bucket"),className:"h-8 rounded-md border border-border bg-background px-1 outline-none focus-visible:border-ring","data-testid":"fb-bucket",onChange:y,value:r,children:t.map(Kt)}),e[6]=r,e[7]=t,e[8]=y,e[9]=a,e[10]=j):j=e[10];let C;e[11]!==a?(C=a("Key prefix"),e[11]=a,e[12]=C):C=e[12];let N;e[13]!==a?(N=a("key prefix (optional)"),e[13]=a,e[14]=N):N=e[14];let K;e[15]!==o||e[16]!==x||e[17]!==C||e[18]!==N?(K=(0,n.jsx)(Ne,{"aria-label":C,className:"h-8 w-64 max-w-full","data-testid":"fb-prefix-input",onChange:x,placeholder:N,value:o}),e[15]=o,e[16]=x,e[17]=C,e[18]=N,e[19]=K):K=e[19];let $;e[20]!==a?($=a("List"),e[20]=a,e[21]=$):$=e[21];let F;e[22]!==s||e[23]!==d||e[24]!==$?(F=(0,n.jsx)(re,{"data-testid":"fb-list",disabled:s,onClick:d,size:"sm",type:"button",children:$}),e[22]=s,e[23]=d,e[24]=$,e[25]=F):F=e[25];let T;e[26]!==s||e[27]!==a?(T=a(s?"Uploading\u2026":"Upload"),e[26]=s,e[27]=a,e[28]=T):T=e[28];let _;e[29]!==s||e[30]!==w||e[31]!==T?(_=(0,n.jsx)(re,{"data-testid":"storage-upload",disabled:s,onClick:w,size:"sm",type:"button",variant:"outline",children:T}),e[29]=s,e[30]=w,e[31]=T,e[32]=_):_=e[32];let O;e[33]!==i||e[34]!==h?(O=(0,n.jsx)("input",{className:"hidden","data-testid":"storage-file-input",onChange:h,ref:i,type:"file"}),e[33]=i,e[34]=h,e[35]=O):O=e[35];let U;e[36]!==a?(U=a("Link expiry"),e[36]=a,e[37]=U):U=e[37];let L;e[38]!==a?(L=wt.map(P=>(0,n.jsx)("option",{value:P.seconds,children:a(P.label)},P.seconds)),e[38]=a,e[39]=L):L=e[39];let R;e[40]!==u||e[41]!==S||e[42]!==L?(R=(0,n.jsx)("select",{className:"h-8 rounded-md border border-border bg-background px-1 tabular-nums outline-none focus-visible:border-ring","data-testid":"storage-expiry",id:"storage-expiry",onChange:S,value:u,children:L}),e[40]=u,e[41]=S,e[42]=L,e[43]=R):R=e[43];let E;e[44]!==U||e[45]!==R?(E=(0,n.jsxs)("label",{className:"ml-auto flex items-center gap-1.5 text-xs text-muted-foreground",htmlFor:"storage-expiry",children:[U,R]}),e[44]=U,e[45]=R,e[46]=E):E=e[46];let B;e[47]!==a?(B=a("Open in Cloudflare"),e[47]=a,e[48]=B):B=e[48];let A;e[49]!==B?(A=(0,n.jsx)("a",{className:"text-sm text-primary underline-offset-4 hover:underline","data-testid":"fb-cf-link",href:_e,rel:"noreferrer",target:"_blank",children:B}),e[49]=B,e[50]=A):A=e[50];let G;return e[51]!==_||e[52]!==O||e[53]!==E||e[54]!==A||e[55]!==j||e[56]!==K||e[57]!==F?(G=(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-2",children:[j,K,F,_,O,E,A]}),e[51]=_,e[52]=O,e[53]=E,e[54]=A,e[55]=j,e[56]=K,e[57]=F,e[58]=G):G=e[58],G},"jt"),zt=g(c=>{let e=(0,M.c)(66),{onSortKeyChange:r,onThumbSizeChange:t,showGrid:s,showList:o,sortDirection:u,sortKey:i,t:l,tagKeys:f,thumbSize:h,toggleSortDirection:d,view:m}=c,w;e[0]!==r?(w=g(q=>{r(q.target.value)},"v"),e[0]=r,e[1]=w):w=e[1];let a=w,v;e[2]!==t?(v=g(q=>{t(Number.parseInt(q.target.value,10))},"x"),e[2]=t,e[3]=v):v=e[3];let x=v,b=m==="list",y;e[4]!==l?(y=l("List"),e[4]=l,e[5]=y):y=e[5];let k;e[6]!==o||e[7]!==b||e[8]!==y?(k=(0,n.jsx)("button",{"aria-pressed":b,className:"px-2 py-1 outline-none transition-colors hover:bg-accent aria-pressed:bg-accent aria-pressed:text-accent-foreground","data-testid":"fb-view-list",onClick:o,type:"button",children:y}),e[6]=o,e[7]=b,e[8]=y,e[9]=k):k=e[9];let S=m==="grid",j;e[10]!==l?(j=l("Grid"),e[10]=l,e[11]=j):j=e[11];let C;e[12]!==s||e[13]!==S||e[14]!==j?(C=(0,n.jsx)("button",{"aria-pressed":S,className:"border-s border-border px-2 py-1 outline-none transition-colors hover:bg-accent aria-pressed:bg-accent aria-pressed:text-accent-foreground","data-testid":"fb-view-grid",onClick:s,type:"button",children:j}),e[12]=s,e[13]=S,e[14]=j,e[15]=C):C=e[15];let N;e[16]!==k||e[17]!==C?(N=(0,n.jsxs)("div",{className:"inline-flex overflow-hidden rounded-md border border-border",children:[k,C]}),e[16]=k,e[17]=C,e[18]=N):N=e[18];let K;e[19]!==l?(K=l("Sort"),e[19]=l,e[20]=K):K=e[20];let $;e[21]!==l?($=l("Name"),e[21]=l,e[22]=$):$=e[22];let F;e[23]!==$?(F=(0,n.jsx)("option",{value:"name",children:$}),e[23]=$,e[24]=F):F=e[24];let T;e[25]!==l?(T=l("size"),e[25]=l,e[26]=T):T=e[26];let _;e[27]!==T?(_=(0,n.jsx)("option",{value:"size",children:T}),e[27]=T,e[28]=_):_=e[28];let O;e[29]!==l?(O=l("Type"),e[29]=l,e[30]=O):O=e[30];let U;e[31]!==O?(U=(0,n.jsx)("option",{value:"type",children:O}),e[31]=O,e[32]=U):U=e[32];let L;e[33]!==l?(L=l("Modified"),e[33]=l,e[34]=L):L=e[34];let R;e[35]!==L?(R=(0,n.jsx)("option",{value:"date",children:L}),e[35]=L,e[36]=R):R=e[36];let E;e[37]!==f?(E=f.map(Dt),e[37]=f,e[38]=E):E=e[38];let B;e[39]!==a||e[40]!==i||e[41]!==F||e[42]!==_||e[43]!==U||e[44]!==R||e[45]!==E?(B=(0,n.jsxs)("select",{className:"h-8 rounded-md border border-border bg-background px-1 outline-none focus-visible:border-ring","data-testid":"fb-sort",id:"fb-sort",onChange:a,value:i,children:[F,_,U,R,E]}),e[39]=a,e[40]=i,e[41]=F,e[42]=_,e[43]=U,e[44]=R,e[45]=E,e[46]=B):B=e[46];let A;e[47]!==K||e[48]!==B?(A=(0,n.jsxs)("label",{className:"flex items-center gap-1.5 text-muted-foreground",htmlFor:"fb-sort",children:[K,B]}),e[47]=K,e[48]=B,e[49]=A):A=e[49];let G;e[50]!==l?(G=l("Toggle sort direction"),e[50]=l,e[51]=G):G=e[51];let P=u==="asc"?"\u2191":"\u2193",H;e[52]!==G||e[53]!==P||e[54]!==d?(H=(0,n.jsx)("button",{"aria-label":G,className:"flex size-8 items-center justify-center rounded-md border border-border tabular-nums outline-none transition-colors hover:bg-accent focus-visible:bg-accent","data-testid":"fb-sort-dir",onClick:d,type:"button",children:P}),e[52]=G,e[53]=P,e[54]=d,e[55]=H):H=e[55];let Q;e[56]!==x||e[57]!==l||e[58]!==h||e[59]!==m?(Q=m==="grid"&&(0,n.jsxs)("label",{className:"ml-auto flex items-center gap-1.5 text-muted-foreground",htmlFor:"fb-thumb-size",children:[l("Thumbnail size"),(0,n.jsx)("input",{className:"accent-primary","data-testid":"fb-thumb-size",id:"fb-thumb-size",max:240,min:80,onChange:x,step:8,type:"range",value:h})]}),e[56]=x,e[57]=l,e[58]=h,e[59]=m,e[60]=Q):Q=e[60];let oe;return e[61]!==A||e[62]!==H||e[63]!==Q||e[64]!==N?(oe=(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-2 text-xs","data-testid":"fb-controls",children:[N,A,H,Q]}),e[61]=A,e[62]=H,e[63]=Q,e[64]=N,e[65]=oe):oe=e[65],oe},"zt");function Kt(c){return(0,n.jsx)("option",{value:c,children:c},c)}g(Kt,"Kt");function Dt(c){return(0,n.jsx)("option",{value:`tag:${c}`,children:c},c)}g(Dt,"Dt");var $t=/\.(?:avif|bmp|gif|ico|jpe?g|png|svg|webp)$/iu,Tt=g(c=>(c.httpMetadata?.contentType??"").startsWith("image/")||$t.test(c.key),"Ft"),Ft=g(()=>{let c=(0,M.c)(1),e;return c[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,n.jsx)("svg",{"aria-hidden":"true",className:"size-8 text-muted-foreground/60",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.4,viewBox:"0 0 24 24",children:(0,n.jsx)("path",{d:"M7 3h7l5 5v13a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1Zm7 0v5h5"})}),c[0]=e):e=c[0],e},"Rt"),Rt=g(c=>{let e=(0,M.c)(13),{object:r,resolveUrl:t}=c,[s,o]=(0,z.useState)(null),[u,i]=(0,z.useState)(!1),l;e[0]!==r?(l=Tt(r),e[0]=r,e[1]=l):l=e[1];let f=l,h,d;e[2]!==f||e[3]!==r.key||e[4]!==t?(h=g(()=>{if(!f)return;let v={cancelled:!1};return W((async()=>{try{let x=await t(r.key);v.cancelled||o(x)}catch{v.cancelled||i(!0)}})()),()=>{v.cancelled=!0}},"h"),d=[f,r.key,t],e[2]=f,e[3]=r.key,e[4]=t,e[5]=h,e[6]=d):(h=e[5],d=e[6]),(0,z.useEffect)(h,d);let m;e[7]===Symbol.for("react.memo_cache_sentinel")?(m=g(()=>{i(!0)},"m"),e[7]=m):m=e[7];let w=m,a;return e[8]!==u||e[9]!==f||e[10]!==r.key||e[11]!==s?(a=(0,n.jsx)("div",{className:"flex aspect-square w-full items-center justify-center overflow-hidden rounded-md border border-border bg-muted/30",children:f&&s!==null&&!u?(0,n.jsx)("img",{alt:r.key,className:"size-full object-cover",loading:"lazy",onError:w,src:s}):(0,n.jsx)(Ft,{})}),e[8]=u,e[9]=f,e[10]=r.key,e[11]=s,e[12]=a):a=e[12],a},"Lt"),Ut=g(c=>{let e=(0,M.c)(38),{busy:r,copiedKey:t,handlers:s,object:o,prefix:u,references:i,resolveUrl:l,selected:f,showReferences:h,t:d}=c,{copy:m,download:w,name:a,remove:v,toggle:x}=Me(o,u,s),b;e[0]!==o||e[1]!==l?(b=(0,n.jsx)(Rt,{object:o,resolveUrl:l}),e[0]=o,e[1]=l,e[2]=b):b=e[2];let y;e[3]!==o.key||e[4]!==f||e[5]!==d||e[6]!==x?(y=(0,n.jsx)("span",{className:"absolute left-1.5 top-1.5 rounded bg-background/80 p-0.5",children:(0,n.jsx)(Pe,{objectKey:o.key,onToggle:x,selected:f,t:d})}),e[3]=o.key,e[4]=f,e[5]=d,e[6]=x,e[7]=y):y=e[7];let k;e[8]!==b||e[9]!==y?(k=(0,n.jsxs)("div",{className:"relative",children:[b,y]}),e[8]=b,e[9]=y,e[10]=k):k=e[10];let S;e[11]!==a?(S=(0,n.jsx)("p",{className:"truncate font-mono text-xs",title:a,children:a}),e[11]=a,e[12]=S):S=e[12];let j;e[13]!==o.size?(j=pe(o.size),e[13]=o.size,e[14]=j):j=e[14];let C;e[15]!==j?(C=(0,n.jsx)("p",{className:"text-[11px] tabular-nums text-muted-foreground",children:j}),e[15]=j,e[16]=C):C=e[16];let N;e[17]!==o.key||e[18]!==i||e[19]!==h||e[20]!==d?(N=h&&(0,n.jsx)("div",{className:"mt-1",children:(0,n.jsx)(Ae,{objectKey:o.key,references:i,t:d})}),e[17]=o.key,e[18]=i,e[19]=h,e[20]=d,e[21]=N):N=e[21];let K;e[22]!==S||e[23]!==C||e[24]!==N?(K=(0,n.jsxs)("div",{className:"min-w-0",children:[S,C,N]}),e[22]=S,e[23]=C,e[24]=N,e[25]=K):K=e[25];let $=t===o.key,F;e[26]!==r||e[27]!==m||e[28]!==w||e[29]!==o.key||e[30]!==v||e[31]!==d||e[32]!==$?(F=(0,n.jsx)("div",{className:"flex items-center gap-1",children:(0,n.jsx)(Be,{busy:r,buttonClassName:"h-7 px-2 text-xs",copied:$,objectKey:o.key,onCopy:m,onDelete:v,onDownload:w,t:d})}),e[26]=r,e[27]=m,e[28]=w,e[29]=o.key,e[30]=v,e[31]=d,e[32]=$,e[33]=F):F=e[33];let T;return e[34]!==F||e[35]!==k||e[36]!==K?(T=(0,n.jsxs)("div",{className:"flex flex-col gap-1.5","data-testid":"fb-tile",children:[k,K,F]}),e[34]=F,e[35]=k,e[36]=K,e[37]=T):T=e[37],T},"Ot"),Et=g(c=>{let e=(0,M.c)(9),{name:r,onEnter:t}=c,s;e[0]!==r||e[1]!==t?(s=g(()=>{t(r)},"o"),e[0]=r,e[1]=t,e[2]=s):s=e[2];let o=s,u;e[3]===Symbol.for("react.memo_cache_sentinel")?(u=(0,n.jsx)("span",{className:"flex aspect-square w-full items-center justify-center rounded-md border border-border bg-muted/30 transition-colors hover:bg-accent",children:(0,n.jsx)("svg",{"aria-hidden":"true",className:"size-10 text-muted-foreground",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.4,viewBox:"0 0 24 24",children:(0,n.jsx)("path",{d:"M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V7Z"})})}),e[3]=u):u=e[3];let i;e[4]!==r?(i=(0,n.jsx)("span",{className:"truncate font-mono text-xs",title:r,children:r}),e[4]=r,e[5]=i):i=e[5];let l;return e[6]!==o||e[7]!==i?(l=(0,n.jsxs)("button",{className:"flex flex-col gap-1.5 text-left outline-none","data-testid":"fb-folder",onClick:o,type:"button",children:[u,i]}),e[6]=o,e[7]=i,e[8]=l):l=e[8],l},"Et"),_t=g(c=>{let e=(0,M.c)(34),{busy:r,copiedKey:t,files:s,folders:o,handlers:u,onEnterFolder:i,prefix:l,references:f,resolveUrl:h,selected:d,showReferences:m,size:w,t:a}=c,v;e[0]!==w?(v=w.toString(),e[0]=w,e[1]=v):v=e[1];let x=`repeat(auto-fill, minmax(${v}px, 1fr))`,b;e[2]!==x?(b={gridTemplateColumns:x},e[2]=x,e[3]=b):b=e[3];let y=b,k;if(e[4]!==o||e[5]!==i){let C;e[7]!==i?(C=g(N=>(0,n.jsx)(Et,{name:N,onEnter:i},N),"S"),e[7]=i,e[8]=C):C=e[8],k=o.map(C),e[4]=o,e[5]=i,e[6]=k}else k=e[6];let S;if(e[9]!==r||e[10]!==t||e[11]!==s||e[12]!==u||e[13]!==l||e[14]!==f||e[15]!==h||e[16]!==d||e[17]!==m||e[18]!==a){let C;e[20]!==r||e[21]!==t||e[22]!==u||e[23]!==l||e[24]!==f||e[25]!==h||e[26]!==d||e[27]!==m||e[28]!==a?(C=g(N=>(0,n.jsx)(Ut,{busy:r,copiedKey:t,handlers:u,object:N,prefix:l,references:f[N.key],resolveUrl:h,selected:d.has(N.key),showReferences:m,t:a},N.key),"S"),e[20]=r,e[21]=t,e[22]=u,e[23]=l,e[24]=f,e[25]=h,e[26]=d,e[27]=m,e[28]=a,e[29]=C):C=e[29],S=s.map(C),e[9]=r,e[10]=t,e[11]=s,e[12]=u,e[13]=l,e[14]=f,e[15]=h,e[16]=d,e[17]=m,e[18]=a,e[19]=S}else S=e[19];let j;return e[30]!==y||e[31]!==k||e[32]!==S?(j=(0,n.jsxs)("div",{className:"grid gap-4","data-testid":"fb-gallery",style:y,children:[k,S]}),e[30]=y,e[31]=k,e[32]=S,e[33]=j):j=e[33],j},"Ut"),Ot=g(c=>{let e=(0,M.c)(23),{reference:r,t}=c,s=`fb-dangling-${r.table}-${r.id}-${r.column}`,o=`${r.table}\xB7${r.id}`,u;e[0]!==o?(u=(0,n.jsx)(ae,{variant:"secondary",children:o}),e[0]=o,e[1]=u):u=e[1];let i;e[2]!==r.column?(i=(0,n.jsx)("span",{className:"text-muted-foreground",children:r.column}),e[2]=r.column,e[3]=i):i=e[3];let l;e[4]!==t?(l=t("\u2192"),e[4]=t,e[5]=l):l=e[5];let f;e[6]!==l?(f=(0,n.jsx)("span",{className:"text-muted-foreground/60",children:l}),e[6]=l,e[7]=f):f=e[7];let h;e[8]!==r.key?(h=(0,n.jsx)("code",{className:"rounded bg-muted px-1 py-0.5 font-mono text-foreground",children:r.key}),e[8]=r.key,e[9]=h):h=e[9];let d;e[10]!==u||e[11]!==i||e[12]!==f||e[13]!==h?(d=(0,n.jsxs)("span",{className:"flex flex-wrap items-center gap-1.5",children:[u,i,f,h]}),e[10]=u,e[11]=i,e[12]=f,e[13]=h,e[14]=d):d=e[14];let m;e[15]!==t?(m=t("Missing object"),e[15]=t,e[16]=m):m=e[16];let w;e[17]!==m?(w=(0,n.jsx)(ae,{className:"border-destructive/40 text-destructive",variant:"outline",children:m}),e[17]=m,e[18]=w):w=e[18];let a;return e[19]!==s||e[20]!==w||e[21]!==d?(a=(0,n.jsxs)("li",{className:"flex flex-wrap items-center justify-between gap-2 rounded-md border border-border/60 px-3 py-2 text-xs","data-testid":s,children:[d,w]}),e[19]=s,e[20]=w,e[21]=d,e[22]=a):a=e[22],a},"_t"),It=g(c=>{let e=(0,M.c)(37),{busy:r,onCheck:t,references:s,t:o,truncated:u}=c,i;e[0]!==o?(i=o("Integrity"),e[0]=o,e[1]=i):i=e[1];let l;e[2]!==i?(l=(0,n.jsx)("span",{className:"font-mono text-[11px] uppercase tracking-wide text-muted-foreground",children:i}),e[2]=i,e[3]=l):l=e[3];let f;e[4]!==o?(f=o("Orphaned objects"),e[4]=o,e[5]=f):f=e[5];let h;e[6]!==f?(h=(0,n.jsx)("span",{className:"text-sm font-medium text-foreground",children:f}),e[6]=f,e[7]=h):h=e[7];let d;e[8]!==o?(d=o("Find records whose file reference points at an object the bucket no longer has."),e[8]=o,e[9]=d):d=e[9];let m;e[10]!==d?(m=(0,n.jsx)("span",{className:"text-xs text-muted-foreground",children:d}),e[10]=d,e[11]=m):m=e[11];let w;e[12]!==l||e[13]!==h||e[14]!==m?(w=(0,n.jsxs)("div",{className:"flex flex-col gap-1",children:[l,h,m]}),e[12]=l,e[13]=h,e[14]=m,e[15]=w):w=e[15];let a;e[16]!==r||e[17]!==o?(a=o(r?"Checking\u2026":"Check for orphans"),e[16]=r,e[17]=o,e[18]=a):a=e[18];let v;e[19]!==r||e[20]!==t||e[21]!==a?(v=(0,n.jsx)(re,{"data-testid":"fb-orphans-check",disabled:r,onClick:t,size:"sm",type:"button",variant:"outline",children:a}),e[19]=r,e[20]=t,e[21]=a,e[22]=v):v=e[22];let x;e[23]!==w||e[24]!==v?(x=(0,n.jsxs)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[w,v]}),e[23]=w,e[24]=v,e[25]=x):x=e[25];let b;e[26]!==s?.length||e[27]!==o?(b=s?.length===0&&(0,n.jsx)(he,{description:o("Every record's file reference points at an object that exists in the bucket."),testId:"fb-orphans-empty",title:o("No dangling references.")}),e[26]=s?.length,e[27]=o,e[28]=b):b=e[28];let y;e[29]!==s||e[30]!==o||e[31]!==u?(y=s!==void 0&&s.length>0&&(0,n.jsxs)(n.Fragment,{children:[u&&(0,n.jsx)("p",{className:"text-xs text-warning","data-testid":"fb-orphans-truncated",children:o("Showing the first {count} dangling references \u2014 the scan was truncated.",{count:s.length})}),(0,n.jsx)("ul",{className:"flex flex-col gap-1.5","data-testid":"fb-orphans-list",children:s.map(S=>(0,n.jsx)(Ot,{reference:S,t:o},`${S.table}\xB7${S.id}\xB7${S.column}`))})]}),e[29]=s,e[30]=o,e[31]=u,e[32]=y):y=e[32];let k;return e[33]!==x||e[34]!==b||e[35]!==y?(k=(0,n.jsxs)("section",{className:"flex flex-col gap-2 rounded-lg border border-border/60 p-3","data-testid":"fb-orphans",children:[x,b,y]}),e[33]=x,e[34]=b,e[35]=y,e[36]=k):k=e[36],k},"It"),Lt=g(function(c,e){let r=(0,M.c)(18),t;r[0]===Symbol.for("react.memo_cache_sentinel")?(t=new Set,r[0]=t):t=r[0];let[s,o]=(0,z.useState)(t),u;r[1]===Symbol.for("react.memo_cache_sentinel")?(u=g(b=>{o(y=>{let k=new Set(y);return k.has(b)?k.delete(b):k.add(b),k})},"u"),r[1]=u):u=r[1];let i=u,l;r[2]===Symbol.for("react.memo_cache_sentinel")?(l=g(()=>{o(new Set)},"l"),r[2]=l):l=r[2];let f=l,h,d,m;if(r[3]!==c||r[4]!==e||r[5]!==s){let b;r[9]!==e?(b=g(y=>e(y),"g"),r[9]=e,r[10]=b):b=r[10],d=c.map(b),h=d.length>0&&d.every(y=>s.has(y)),m=!h&&d.some(y=>s.has(y)),r[3]=c,r[4]=e,r[5]=s,r[6]=h,r[7]=d,r[8]=m}else h=r[6],d=r[7],m=r[8];let w=m,a;r[11]!==d?(a=g(()=>{o(b=>d.every(y=>b.has(y))?new Set:new Set(d))},"s"),r[11]=d,r[12]=a):a=r[12];let v=a,x;return r[13]!==h||r[14]!==s||r[15]!==w||r[16]!==v?(x={allSelected:h,clear:f,selected:s,someSelected:w,toggle:i,toggleAll:v},r[13]=h,r[14]=s,r[15]=w,r[16]=v,r[17]=x):x=r[17],x},"Mt"),Mt=me(be.storageReferences),Bt=me(be.storageOrphans),Ie=1e4,At=1e3,Pt=3600,Wt=g((c,e)=>{if(!("document"in globalThis))return;let r=globalThis.document.createElement("a");r.href=c,r.download=e,r.rel="noopener",globalThis.document.body.append(r),r.click(),r.remove()},"Gt"),Gt=g(({initialPrefix:c,pageSize:e})=>{let r=Se(),[t,s]=(0,z.useState)(c??""),[o,u]=(0,z.useState)(c??""),[i,l]=(0,z.useState)(St),[f,h]=(0,z.useState)("list"),[d,m]=(0,z.useState)(128),[w,a]=(0,z.useState)("name"),[v,x]=(0,z.useState)("asc"),[b,y]=(0,z.useState)(void 0),[k,S]=(0,z.useState)(void 0),[j,C]=(0,z.useState)(!1),[N,K]=(0,z.useState)(void 0),[$,F]=(0,z.useState)(void 0),[T,_]=(0,z.useState)(""),[O,U]=(0,z.useState)({}),[L,R]=(0,z.useState)(!1),[E,B]=(0,z.useState)(void 0),[A,G]=(0,z.useState)(!1),[P,H]=(0,z.useState)(!1),[Q,oe]=(0,z.useState)([]),[q,xe]=(0,z.useState)(""),le=(0,z.useRef)(0),X=(0,z.useRef)(0);(0,z.useEffect)(()=>{let p={cancelled:!1};return W((async()=>{try{let D=await r.listStorageBuckets();if(!p.cancelled){oe(D);let[I]=D;I!==void 0&&xe(Z=>Z===""?I:Z)}}catch{}})()),()=>{p.cancelled=!0}},[r]);let V=(0,z.useMemo)(()=>({list:g(p=>r.listStorageObjects({...p,bucket:q}),"list"),remove:g(p=>r.deleteStorageObject(p,{bucket:q}),"remove"),signedUrl:g((p,D)=>r.signedStorageUrl(p,{...D,bucket:q}),"signedUrl"),upload:g(p=>r.uploadStorageObject({...p,bucket:q}),"upload")}),[q,r]),J=(0,z.useCallback)(async(p,D,I)=>{le.current+=1;let Z=le.current;S(void 0),C(!0);try{let te=await V.list({cursor:D,limit:e,prefix:p});if(Z!==le.current)return;y(we=>I&&we!==void 0?[...we,...te.objects]:te.objects),F(te.cursor)}catch(te){if(Z!==le.current)return;I||y(void 0),S(Y(te))}finally{Z===le.current&&C(!1)}},[e,V]);(0,z.useEffect)(()=>{W(J(c??"",void 0,!1))},[J,c]);let We=(b?.length??0)<=e;Ue(()=>{W(J(t,void 0,!1))},We);let{files:de,folders:Ge}=Nt(b??[],t),He=(0,z.useMemo)(()=>{let p=new Set;for(let D of de)for(let I of Object.keys(D.customMetadata??{}))p.add(I);return[...p].toSorted((D,I)=>D.localeCompare(I))},[de]),ie=Ct(de,w,v),ue=(0,z.useMemo)(()=>[...new Set(ie.map(p=>p.key))].toSorted((p,D)=>p.localeCompare(D)).join(`
|
|
3
|
+
`),[ie]);(0,z.useEffect)(()=>{let p=ue===""?[]:ue.split(`
|
|
4
|
+
`);if(p.length===0){U({});return}let D={current:!0};return W((async()=>{try{let I=await r.query(Mt,{keys:p},ge(T));D.current&&(U(I.references??{}),R(Object.keys(I.storageColumns??{}).length>0))}catch{D.current&&(U({}),R(!1))}})()),()=>{D.current=!1}},[r,ue,T]);let Ze=g(p=>p.key,"Ee"),{allSelected:qe,clear:se,selected:ve,someSelected:Ve,toggle:Je,toggleAll:Qe}=Lt(ie,Ze),Xe=g(()=>{s(o),se(),W(J(o,void 0,!1))},"Be"),Ye=g(()=>{W(J(t,$,!0))},"Ae"),ke=g(p=>{s(p),u(p),se(),W(J(p,void 0,!1))},"be"),et=g(p=>{ke(`${t}${p}`)},"Pe"),tt=g(p=>V.signedUrl(p,{expiresInSeconds:Pt}),"We"),rt=g(()=>{h("list")},"Ge"),nt=g(()=>{h("grid")},"He"),ot=g(p=>{a(p)},"Ze"),lt=g(()=>{x(p=>p==="asc"?"desc":"asc")},"qe"),st=g(p=>{m(p)},"Ve"),at=g(p=>{l(p)},"Xe"),it=g(()=>{S(void 0),C(!0),W((async()=>{try{for(let p of ve)await V.remove(p);await J(t,void 0,!1),se()}catch(p){S(Y(p))}finally{C(!1)}})())},"Qe"),ct=g(p=>{S(void 0),W((async()=>{try{let D=await V.signedUrl(p,{expiresInSeconds:i});Ke(D)&&K(p)}catch(D){S(Y(D))}})())},"Ye"),dt=g(p=>{S(void 0),W((async()=>{try{let D=await V.signedUrl(p,{expiresInSeconds:i}),I=p.slice(p.lastIndexOf("/")+1)||p;Wt(D,I)}catch(D){S(Y(D))}})())},"Je");(0,z.useEffect)(()=>{if(N===void 0)return;let p=globalThis.setTimeout(()=>{K(void 0)},2e3);return()=>{globalThis.clearTimeout(p)}},[N]);let ut=g(p=>{S(void 0),C(!0),W((async()=>{try{await V.remove(p),await J(t,void 0,!1)}catch(D){S(Y(D))}finally{C(!1)}})())},"et"),ft=g(p=>{let D=`${t}${p.name}`;S(void 0),C(!0),W((async()=>{try{let I=await p.arrayBuffer();await V.upload({body:I,contentType:p.type===""?void 0:p.type,key:D}),await J(t,void 0,!1)}catch(I){S(Y(I))}finally{C(!1)}})())},"tt");(0,z.useEffect)(()=>{X.current+=1,B(void 0),H(!1)},[T]);let ht=g(()=>{X.current+=1;let p=X.current;S(void 0),G(!0),W((async()=>{try{let D=[],I;do{let Z=await V.list({cursor:I,limit:At});for(let te of Z.objects)D.push(te.key);I=D.length>=Ie?void 0:Z.cursor}while(I!==void 0);if(D.length>=Ie)p===X.current&&(B([]),H(!0));else{let Z=await r.query(Bt,{liveKeys:D},ge(T));p===X.current&&(B(Z.references??[]),H(Z.truncated===!0))}}catch(D){p===X.current&&(B([]),H(!1),S(Y(D)))}finally{p===X.current&&G(!1)}})())},"rt"),mt=g(p=>{le.current+=1,X.current+=1,xe(p),s(c??""),u(c??""),y(void 0),B(void 0),H(!1),se()},"nt");return{allSelected:qe,bucket:q,buckets:Q,bulkDelete:it,busy:j,checkOrphans:ht,clearSelection:se,copiedKey:N,danglingBusy:A,danglingReferences:E,danglingTruncated:P,draftPrefix:o,enterFolder:et,error:k,expiry:i,files:ie,folders:Ge,hasObjects:b!==void 0&&b.length>0,hasStorageColumns:L,listFirst:Xe,loaded:b!==void 0,loadMore:Ye,navigate:ke,nextCursor:$,onCopy:ct,onDelete:ut,onDownload:dt,onExpiryChange:at,onFile:ft,onSortKeyChange:ot,onThumbSizeChange:st,prefix:t,referenceShard:T,references:O,resolveUrl:tt,selectBucket:mt,selected:ve,setDraftPrefix:u,setReferenceShard:_,showGrid:nt,showList:rt,someSelected:Ve,sortDirection:v,sortKey:w,tagKeys:He,thumbSize:d,toggleSelect:Je,toggleSelectAll:Qe,toggleSortDirection:lt,view:f}},"Ht"),Ht=100,Le=g(c=>{let e=(0,M.c)(6),{label:r,onNavigate:t,target:s}=c,o;e[0]!==t||e[1]!==s?(o=g(()=>{t(s)},"n"),e[0]=t,e[1]=s,e[2]=o):o=e[2];let u=o,i;return e[3]!==u||e[4]!==r?(i=(0,n.jsx)("button",{className:"rounded px-1 text-muted-foreground outline-none hover:text-foreground focus-visible:text-foreground",onClick:u,type:"button",children:r}),e[3]=u,e[4]=r,e[5]=i):i=e[5],i},"we"),Zt=g(c=>{let e=(0,M.c)(11),{onNavigate:r,prefix:t,t:s}=c,o;if(e[0]!==r||e[1]!==t||e[2]!==s){let u=t.split("/").filter(qt),i;e[4]!==s?(i=s("Folder path"),e[4]=s,e[5]=i):i=e[5];let l;e[6]!==s?(l=s("root"),e[6]=s,e[7]=l):l=e[7];let f;e[8]!==r||e[9]!==l?(f=(0,n.jsx)(Le,{label:l,onNavigate:r,target:""}),e[8]=r,e[9]=l,e[10]=f):f=e[10],o=(0,n.jsxs)("nav",{"aria-label":i,className:"flex flex-wrap items-center gap-0.5 text-xs","data-testid":"fb-breadcrumbs",children:[f,u.map((h,d)=>(0,n.jsxs)("span",{className:"flex items-center gap-0.5",children:[(0,n.jsx)("span",{className:"text-muted-foreground/50",children:"/"}),(0,n.jsx)(Le,{label:h,onNavigate:r,target:`${u.slice(0,d+1).join("/")}/`})]},`${h}-${d.toString()}`))]}),e[0]=r,e[1]=t,e[2]=s,e[3]=o}else o=e[3];return o},"qt"),ur=g(({initialPrefix:c,pageSize:e=Ht})=>{let r=Ce(),t=Gt({initialPrefix:c,pageSize:e}),s=(0,z.useRef)(null),{onCopy:o,onDelete:u,onDownload:i,onFile:l,toggleSelect:f}=t,h={onCopy:o,onDelete:u,onDownload:i,onToggleSelect:f},d=g(()=>{s.current?.click()},"d"),m=g(a=>{let v=a.target,x=v.files?.[0];v.value="",x&&l(x)},"m"),w=t.loaded&&!t.hasObjects;return(0,n.jsxs)("div",{className:"flex flex-col gap-3","data-testid":"lunora-file-browser",children:[(0,n.jsx)(jt,{bucket:t.bucket,buckets:t.buckets,busy:t.busy,draftPrefix:t.draftPrefix,expiry:t.expiry,fileInputRef:s,onBucketChange:t.selectBucket,onExpiryChange:t.onExpiryChange,onFileChange:m,onList:t.listFirst,onPrefixChange:t.setDraftPrefix,onUploadClick:d,t:r}),t.loaded&&(0,n.jsx)(Zt,{onNavigate:t.navigate,prefix:t.prefix,t:r}),t.hasObjects&&(0,n.jsx)(zt,{onSortKeyChange:t.onSortKeyChange,onThumbSizeChange:t.onThumbSizeChange,showGrid:t.showGrid,showList:t.showList,sortDirection:t.sortDirection,sortKey:t.sortKey,t:r,tagKeys:t.tagKeys,thumbSize:t.thumbSize,toggleSortDirection:t.toggleSortDirection,view:t.view}),t.hasStorageColumns&&(0,n.jsxs)("div",{className:"flex flex-wrap items-center gap-2","data-testid":"fb-references-shard",children:[(0,n.jsx)("label",{className:"text-xs text-muted-foreground",htmlFor:"fb-reference-shard-input",children:r("References shard")}),(0,n.jsx)(De,{id:"fb-reference-shard-input",onChange:t.setReferenceShard,testId:"fb-reference-shard-input",value:t.referenceShard}),(0,n.jsx)("span",{className:"text-xs text-muted-foreground",children:r("Which shard's records are checked for references to these files. Empty = root shard.")})]}),t.hasStorageColumns&&(0,n.jsx)(It,{busy:t.danglingBusy,onCheck:t.checkOrphans,references:t.danglingReferences,t:r,truncated:t.danglingTruncated}),t.selected.size>0&&(0,n.jsx)(Ee,{count:t.selected.size,editable:!0,onClear:t.clearSelection,onDelete:t.bulkDelete}),t.error!==void 0&&(0,n.jsx)("p",{className:"text-sm text-destructive","data-testid":"storage-error",role:"alert",children:t.error}),w&&(0,n.jsx)(he,{description:r("Objects you upload to your R2 buckets will appear here."),icon:(0,n.jsxs)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:[(0,n.jsx)("path",{d:"M3 7a2 2 0 0 1 2-2h4l2 2h8a2 2 0 0 1 2 2v8a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V7Z"}),(0,n.jsx)("path",{d:"M12 11v5m-2.5-2.5h5"})]}),testId:"fb-empty",title:r("No objects.")}),t.hasObjects&&t.view==="list"&&(0,n.jsx)(kt,{allSelected:t.allSelected,busy:t.busy,copiedKey:t.copiedKey,files:t.files,folders:t.folders,handlers:h,onEnterFolder:t.enterFolder,prefix:t.prefix,references:t.references,selected:t.selected,showReferences:t.hasStorageColumns,someSelected:t.someSelected,t:r,toggleSelectAll:t.toggleSelectAll}),t.hasObjects&&t.view==="grid"&&(0,n.jsx)(_t,{busy:t.busy,copiedKey:t.copiedKey,files:t.files,folders:t.folders,handlers:h,onEnterFolder:t.enterFolder,prefix:t.prefix,references:t.references,resolveUrl:t.resolveUrl,selected:t.selected,showReferences:t.hasStorageColumns,size:t.thumbSize,t:r}),t.nextCursor!==void 0&&(0,n.jsx)("div",{children:(0,n.jsx)(re,{"data-testid":"fb-next",disabled:t.busy,onClick:t.loadMore,size:"sm",type:"button",variant:"outline",children:r("Load more")})})]})},"pr");function qt(c){return c!==""}g(qt,"Vt");export{ur as FileBrowser};
|