@lunora/studio 1.0.0-alpha.48 → 1.0.0-alpha.49
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/dist/index.d.ts +3 -3
- package/dist/index.js +2 -2
- package/dist/mount.d.ts +1 -1
- package/dist/mount.js +1 -1
- package/dist/packem_chunks/agents-panel.js +326 -0
- package/dist/packem_chunks/kv-browser.js +1 -1
- package/dist/packem_shared/{Studio-sfBFghzO.js → Studio-MB2VTLwI.js} +1 -1
- package/dist/packem_shared/{StudioApp-Ism1gXfJ.js → StudioApp-Ds6u0iY5.js} +1 -1
- package/dist/packem_shared/{app.d-CNLRTrWw.d.ts → app.d-Bly6zmWK.d.ts} +1 -1
- package/dist/packem_shared/{studio-CFC_pv0f.js → studio-Bv27fj7n.js} +602 -575
- package/dist/standalone/{chunk-JQ4WOPMF.js → chunk-2CCWLKQW.js} +1 -1
- package/dist/standalone/{chunk-EYSL7KEQ.js → chunk-2JUOJEKE.js} +1 -1
- package/dist/standalone/{chunk-FNQQ3B5G.js → chunk-2O4BHAHA.js} +1 -1
- package/dist/standalone/{chunk-7YXOPTWI.js → chunk-3GXGLNKW.js} +1 -1
- package/dist/standalone/{chunk-4KSX53SI.js → chunk-3JXKA6BH.js} +1 -1
- package/dist/standalone/chunk-4TV6S6AO.js +3 -0
- package/dist/standalone/{chunk-CTPCJNOP.js → chunk-5OZQHQ26.js} +1 -1
- package/dist/standalone/{chunk-ADP5UEHQ.js → chunk-5YPIP3G7.js} +1 -1
- package/dist/standalone/{chunk-Y2GJJVS5.js → chunk-6U45TJXA.js} +1 -1
- package/dist/standalone/{chunk-37HPVOYP.js → chunk-7LDYSHOU.js} +1 -1
- package/dist/standalone/{chunk-2CQ2YNER.js → chunk-A3ZJACVT.js} +1 -1
- package/dist/standalone/{chunk-CGGZAYGG.js → chunk-AHDVD4KF.js} +1 -1
- package/dist/standalone/{chunk-PL2KY6IG.js → chunk-ALTQC4S5.js} +1 -1
- package/dist/standalone/{chunk-QBAT52GB.js → chunk-APSSZB6Z.js} +1 -1
- package/dist/standalone/{chunk-HROXYAZT.js → chunk-BGG56IF5.js} +1 -1
- package/dist/standalone/{chunk-GSCV2N3F.js → chunk-BTODL6SI.js} +1 -1
- package/dist/standalone/{chunk-K2CB2CHL.js → chunk-CCRVGYTN.js} +1 -1
- package/dist/standalone/{chunk-CJTT4TBP.js → chunk-CDHEMVIY.js} +1 -1
- package/dist/standalone/{chunk-V4ECZI2R.js → chunk-CTOOUWO4.js} +1 -1
- package/dist/standalone/{chunk-DDE62TRL.js → chunk-ECJPFPHR.js} +1 -1
- package/dist/standalone/{chunk-YAECF5LW.js → chunk-EOE5NDMK.js} +1 -1
- package/dist/standalone/{chunk-SHK6RAFG.js → chunk-FFCUV3TZ.js} +1 -1
- package/dist/standalone/{chunk-SEQ43UW2.js → chunk-GA6K5WS5.js} +1 -1
- package/dist/standalone/{chunk-WD2LBHJZ.js → chunk-JUDPYSJZ.js} +1 -1
- package/dist/standalone/{chunk-CLMGPTAI.js → chunk-L4UCG6XZ.js} +1 -1
- package/dist/standalone/{chunk-DH4K2OLM.js → chunk-LUP4YTBS.js} +1 -1
- package/dist/standalone/{chunk-YSPZSTDI.js → chunk-N4TGVH2R.js} +1 -1
- package/dist/standalone/{chunk-YFA7NUCL.js → chunk-NH4FSHFO.js} +1 -1
- package/dist/standalone/{chunk-3HS3ZXFB.js → chunk-NS23QR4W.js} +1 -1
- package/dist/standalone/{chunk-3OZDR3RM.js → chunk-Q6356GAQ.js} +1 -1
- package/dist/standalone/{chunk-FKVCHCYV.js → chunk-Q7HPS6TW.js} +1 -1
- package/dist/standalone/{chunk-WOXVMXSQ.js → chunk-QCW4BAH5.js} +1 -1
- package/dist/standalone/{chunk-F4HDP4XW.js → chunk-R2HA2NVX.js} +1 -1
- package/dist/standalone/{chunk-F5I22A4W.js → chunk-R6H6DUPU.js} +1 -1
- package/dist/standalone/{chunk-XVR74IFC.js → chunk-RE4LLVPN.js} +1 -1
- package/dist/standalone/chunk-RYF5EUQA.js +1 -0
- package/dist/standalone/{chunk-VON7JUPG.js → chunk-S5NTGHCG.js} +1 -1
- package/dist/standalone/{chunk-LRYLU6EY.js → chunk-SDMZKBTD.js} +1 -1
- package/dist/standalone/{chunk-KSKXW5PX.js → chunk-SHERR7ZP.js} +1 -1
- package/dist/standalone/{chunk-BIBCC7EE.js → chunk-TO6D2PJC.js} +1 -1
- package/dist/standalone/{chunk-5UKRVDFD.js → chunk-UTHHHJYS.js} +1 -1
- package/dist/standalone/{chunk-KCMKEMUL.js → chunk-UWSLX56Q.js} +1 -1
- package/dist/standalone/{chunk-LNZIB2MD.js → chunk-V43BLH4J.js} +1 -1
- package/dist/standalone/{chunk-3CJW6NWG.js → chunk-VL23Y44O.js} +1 -1
- package/dist/standalone/{chunk-L7WR3C4Z.js → chunk-W5BAQMIE.js} +1 -1
- package/dist/standalone/{chunk-HVRDZZHL.js → chunk-W666BB6V.js} +1 -1
- package/dist/standalone/{chunk-S3Q6R7BA.js → chunk-W6JKUZKD.js} +1 -1
- package/dist/standalone/{chunk-WMWDJLRO.js → chunk-WK7VHQTQ.js} +1 -1
- package/dist/standalone/{chunk-IXDH4GL5.js → chunk-WVTPZ6CM.js} +1 -1
- package/dist/standalone/{chunk-TXTJPS5F.js → chunk-XGPFWZPJ.js} +1 -1
- package/dist/standalone/{chunk-H27CRIP3.js → chunk-XPLUSBKA.js} +1 -1
- package/dist/standalone/{chunk-KKD46QVN.js → chunk-ZANX3V5B.js} +1 -1
- package/dist/standalone/{chunk-AYANIT5P.js → chunk-ZVLQVBTM.js} +1 -1
- package/dist/standalone/studio.js +1 -1
- package/dist/styles.css +1 -1
- package/package.json +3 -3
- package/dist/standalone/chunk-IRSIK3HT.js +0 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as A}from"./chunk-
|
|
1
|
+
import{a as A}from"./chunk-W666BB6V.js";import{a as y,e as I}from"./chunk-SEU5V7I6.js";import{b as m}from"./chunk-ZPP2KOR4.js";import"./chunk-CKSHCYGC.js";import{f as k}from"./chunk-SDMZKBTD.js";import"./chunk-ZHVTQ37P.js";import"./chunk-3OA7PECS.js";import{d as C}from"./chunk-ITQKVEP7.js";import"./chunk-22C6COGE.js";import{a as u,e as w,g as S,h as P}from"./chunk-RRCPZMC2.js";var N=w(S(),1);var a=w(P(),1);var z=[{key:"accounts",label:"Accounts"},{key:"admin",label:"Admin"},{key:"organization",label:"Organizations"},{key:"passkey",label:"Passkeys"},{key:"twoFactor",label:"Two-factor"}],b=u(e=>{if(e===void 0)return"\u2014";let l=[[86400,"d"],[3600,"h"],[60,"m"]];for(let[t,o]of l)if(e>=t&&e%t===0)return`${String(e/t)}${o}`;return`${String(e)}s`},"formatDuration"),h=u(e=>{let l=(0,N.c)(8),{children:t,heading:o,testId:r}=e,i;l[0]!==o?(i=(0,a.jsxDEV)("header",{className:"border-b border-border px-4 py-3",children:(0,a.jsxDEV)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:o},void 0,!1)},void 0,!1),l[0]=o,l[1]=i):i=l[1];let s;l[2]!==t?(s=(0,a.jsxDEV)(I,{className:"p-3",children:t},void 0,!1),l[2]=t,l[3]=s):s=l[3];let c;return l[4]!==i||l[5]!==s||l[6]!==r?(c=(0,a.jsxDEV)(y,{className:"gap-0 py-0","data-testid":r,children:[i,s]},void 0,!0),l[4]=i,l[5]=s,l[6]=r,l[7]=c):c=l[7],c},"ConfigCard"),d=u(e=>{let l=(0,N.c)(7),{label:t,value:o}=e,r;l[0]!==t?(r=(0,a.jsxDEV)("span",{className:"text-sm",children:t},void 0,!1),l[0]=t,l[1]=r):r=l[1];let i;l[2]!==o?(i=(0,a.jsxDEV)("span",{className:"text-sm text-muted-foreground tabular-nums",children:o},void 0,!1),l[2]=o,l[3]=i):i=l[3];let s;return l[4]!==r||l[5]!==i?(s=(0,a.jsxDEV)("div",{className:"flex items-center justify-between gap-2 rounded-xl border border-border bg-card p-2 shadow-xs",children:[r,i]},void 0,!0),l[4]=r,l[5]=i,l[6]=s):s=l[6],s},"KeyValue"),O=u(()=>{let e=(0,N.c)(20),l=k(),t=C(),o;e[0]===Symbol.for("react.memo_cache_sentinel")?(o=["lunora-auth-config"],e[0]=o):o=e[0];let r;e[1]!==l?(r=u(()=>l.getAuthConfig(),"t1"),e[1]=l,e[2]=r):r=e[2];let{data:i,error:s}=A(o,r),c;e[3]!==t?(c=u(n=>(0,a.jsxDEV)(m,{variant:n?"success":"outline",children:t(n?"Enabled":"Disabled")},void 0,!1),"t2"),e[3]=t,e[4]=c):c=e[4];let f=c,g;e[5]!==s?(g=s!==null&&(0,a.jsxDEV)("p",{className:"px-4 py-8 text-center text-sm text-destructive","data-testid":"auth-config-error",role:"alert",children:s},void 0,!1),e[5]=s,e[6]=g):g=e[6];let p;e[7]!==i||e[8]!==s||e[9]!==t?(p=s===null&&i===void 0&&(0,a.jsxDEV)("p",{className:"px-4 py-8 text-center text-sm text-muted-foreground","data-testid":"auth-config-loading",children:t("Loading auth configuration\u2026")},void 0,!1),e[7]=i,e[8]=s,e[9]=t,e[10]=p):p=e[10];let v;e[11]!==i||e[12]!==s||e[13]!==f||e[14]!==t?(v=s===null&&i!==void 0&&(0,a.jsxDEV)(a.Fragment,{children:[(0,a.jsxDEV)(h,{heading:t("Enabled capabilities"),testId:"auth-config-capabilities",children:(0,a.jsxDEV)("ul",{className:"grid grid-cols-1 gap-2 sm:grid-cols-2",children:z.map(n=>{let $=i.capabilities[n.key];return(0,a.jsxDEV)("li",{className:"flex items-center justify-between gap-2 rounded-xl border border-border bg-card p-2 shadow-xs","data-testid":`auth-config-cap-${n.key}`,children:[(0,a.jsxDEV)("span",{className:"text-sm",children:t(n.label)},void 0,!1),f($)]},n.key,!0)})},void 0,!1)},void 0,!1),(0,a.jsxDEV)(h,{heading:t("Plugins"),testId:"auth-config-plugins",children:i.plugins.length===0?(0,a.jsxDEV)("p",{className:"text-sm text-muted-foreground",children:t("No plugins enabled.")},void 0,!1):(0,a.jsxDEV)("div",{className:"flex flex-wrap gap-2",children:i.plugins.map(L)},void 0,!1)},void 0,!1),(0,a.jsxDEV)(h,{heading:t("Sign-in methods"),testId:"auth-config-signin",children:(0,a.jsxDEV)("div",{className:"flex flex-col gap-2",children:[(0,a.jsxDEV)(d,{label:t("Email & password"),value:f(i.emailAndPassword)},void 0,!1),(0,a.jsxDEV)(d,{label:t("Social providers"),value:i.socialProviders.length===0?t("None"):(0,a.jsxDEV)("span",{className:"flex flex-wrap justify-end gap-1",children:i.socialProviders.map(j)},void 0,!1)},void 0,!1)]},void 0,!0)},void 0,!1),i.organization.enabled&&(0,a.jsxDEV)(h,{heading:t("Organizations"),testId:"auth-config-org",children:(0,a.jsxDEV)("div",{className:"flex flex-col gap-2",children:[(0,a.jsxDEV)(d,{label:t("Teams"),value:f(i.organization.teams)},void 0,!1),(0,a.jsxDEV)(d,{label:t("Custom roles"),value:f(i.organization.roles)},void 0,!1)]},void 0,!0)},void 0,!1),(0,a.jsxDEV)(h,{heading:t("Session policy"),testId:"auth-config-session",children:(0,a.jsxDEV)("div",{className:"flex flex-col gap-2",children:[(0,a.jsxDEV)(d,{label:t("Expires in"),value:b(i.session.expiresIn)},void 0,!1),(0,a.jsxDEV)(d,{label:t("Refresh after"),value:b(i.session.updateAge)},void 0,!1),(0,a.jsxDEV)(d,{label:t("Fresh window"),value:b(i.session.freshAge)},void 0,!1),(0,a.jsxDEV)(d,{label:t("Cookie cache"),value:f(i.session.cookieCache===!0)},void 0,!1)]},void 0,!0)},void 0,!1),(0,a.jsxDEV)(h,{heading:t("Rate limit"),testId:"auth-config-ratelimit",children:(0,a.jsxDEV)("div",{className:"flex flex-col gap-2",children:[(0,a.jsxDEV)(d,{label:t("Status"),value:f(i.rateLimit.enabled)},void 0,!1),i.rateLimit.enabled&&(0,a.jsxDEV)(a.Fragment,{children:[(0,a.jsxDEV)(d,{label:t("Max requests"),value:i.rateLimit.max??"\u2014"},void 0,!1),(0,a.jsxDEV)(d,{label:t("Window"),value:b(i.rateLimit.window)},void 0,!1)]},void 0,!0)]},void 0,!0)},void 0,!1),i.userFields.length>0&&(0,a.jsxDEV)(h,{heading:t("Plugin user fields"),testId:"auth-config-user-fields",children:(0,a.jsxDEV)("ul",{className:"flex flex-col gap-2",children:i.userFields.map(n=>(0,a.jsxDEV)("li",{className:"flex items-center justify-between gap-2 rounded-xl border border-border bg-card p-2 shadow-xs","data-testid":`auth-config-user-field-${n.name}`,children:[(0,a.jsxDEV)("span",{className:"flex flex-col",children:[(0,a.jsxDEV)("span",{className:"font-mono text-xs",children:n.name},void 0,!1),n.plugin!==void 0&&(0,a.jsxDEV)("span",{className:"text-[11px] text-muted-foreground",children:n.plugin},void 0,!1)]},void 0,!0),(0,a.jsxDEV)("span",{className:"flex items-center gap-1",children:[(0,a.jsxDEV)(m,{variant:"outline",children:n.type},void 0,!1),n.required&&(0,a.jsxDEV)(m,{variant:"secondary",children:t("required")},void 0,!1),n.unique&&(0,a.jsxDEV)(m,{variant:"secondary",children:t("unique")},void 0,!1)]},void 0,!0)]},n.name,!0))},void 0,!1)},void 0,!1),(0,a.jsxDEV)(y,{className:"gap-0 py-0",children:(0,a.jsxDEV)("p",{className:"px-4 py-3 text-xs text-muted-foreground","data-testid":"auth-config-note",children:t("OAuth providers, email templates, and rate limits are configured at deploy time in the better-auth setup and aren't editable here. See the Mail tab for email output.")},void 0,!1)},void 0,!1)]},void 0,!0),e[11]=i,e[12]=s,e[13]=f,e[14]=t,e[15]=v):v=e[15];let x;return e[16]!==g||e[17]!==p||e[18]!==v?(x=(0,a.jsxDEV)("div",{className:"flex flex-col gap-4","data-testid":"auth-config",children:[g,p,v]},void 0,!0),e[16]=g,e[17]=p,e[18]=v,e[19]=x):x=e[19],x},"AuthConfigPanel");function L(e){return(0,a.jsxDEV)(m,{"data-testid":`auth-config-plugin-${e}`,variant:"outline",children:e},e,!1)}u(L,"_temp");function j(e){return(0,a.jsxDEV)(m,{"data-testid":`auth-config-provider-${e}`,variant:"outline",children:e},e,!1)}u(j,"_temp2");export{O as AuthConfigPanel};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as C}from"./chunk-J6J54MBP.js";import{a as E}from"./chunk-WUFVFVHJ.js";import"./chunk-XNJNSCLM.js";import{a as x,b as I,c as N,d as u,e as l,f as o}from"./chunk-GTM65MVX.js";import{a as
|
|
1
|
+
import{a as C}from"./chunk-J6J54MBP.js";import{a as E}from"./chunk-WUFVFVHJ.js";import"./chunk-XNJNSCLM.js";import{b as y}from"./chunk-W666BB6V.js";import{a as x,b as I,c as N,d as u,e as l,f as o}from"./chunk-GTM65MVX.js";import{a as m,e as h}from"./chunk-SEU5V7I6.js";import{b as v}from"./chunk-ZPP2KOR4.js";import"./chunk-CKSHCYGC.js";import{a as g}from"./chunk-BOXSWNXZ.js";import"./chunk-SDMZKBTD.js";import"./chunk-ZHVTQ37P.js";import"./chunk-3OA7PECS.js";import{a as A}from"./chunk-TAD43CG5.js";import{d as S,p as b}from"./chunk-ITQKVEP7.js";import"./chunk-22C6COGE.js";import{a as c,e as Q,h as V}from"./chunk-RRCPZMC2.js";var e=Q(V(),1);var P=new Set(["active","trialing"]),D=new Set(["past_due","unpaid"]),a=c((t,s)=>{if(t[s]!==void 0)return t[s];let d=t.__doc__;if(typeof d=="string")try{let n=JSON.parse(d);if(n!==null&&typeof n=="object"&&!Array.isArray(n))return n[s]}catch{}},"readField"),i=c(t=>typeof t=="string"?t:typeof t=="number"||typeof t=="bigint"||typeof t=="boolean"?String(t):"","text"),F=c(t=>P.has(t)?"default":D.has(t)?"destructive":"outline","badgeVariant"),K=c(({limit:t=100})=>{let s=S(),d=y(g.readTablePage,{filters:[],limit:t,offset:0,orderBy:[],search:"",table:"subscriptions"}),n=y(g.readTablePage,{filters:[],limit:25,offset:0,orderBy:[],search:"",table:"events"});C(()=>{d.refetch(),n.refetch()},!0);let f=d.data?.rows??[],R=n.data?.rows??[],B=d.error??n.error,w=d.error===null?n.errorSource:d.errorSource,T=f.filter(r=>P.has(i(a(r,"state")))).length,j=R.toSorted((r,p)=>Number(a(p,"processedAt")??0)-Number(a(r,"processedAt")??0));return(0,e.jsxDEV)("div",{className:"flex flex-col gap-4","data-testid":"payments-panel",children:[(0,e.jsxDEV)("div",{className:"flex items-center gap-2","data-testid":"payments-summary",children:(0,e.jsxDEV)(m,{className:"justify-between gap-0 py-0",children:[(0,e.jsxDEV)("div",{className:"flex flex-col gap-2.5 p-4",children:[(0,e.jsxDEV)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:s("Subscriptions")},void 0,!1),(0,e.jsxDEV)("div",{className:"flex items-center gap-2",children:[(0,e.jsxDEV)("span",{className:"text-2xl font-semibold tabular-nums text-foreground",children:T},void 0,!1),(0,e.jsxDEV)(v,{variant:"default",children:s("{count} active",{count:T})},void 0,!1)]},void 0,!0)]},void 0,!0),(0,e.jsxDEV)("div",{className:"border-t border-border bg-muted/50 px-4 py-2.5 text-[11px] text-muted-foreground",children:s("{total} total",{total:f.length})},void 0,!1)]},void 0,!0)},void 0,!1),B===null?void 0:(0,e.jsxDEV)(E,{error:w},void 0,!1),f.length===0&&!d.isLoading?(0,e.jsxDEV)(A,{testId:"payments-empty",title:s("No subscriptions yet")},void 0,!1):(0,e.jsxDEV)(m,{className:"overflow-hidden py-0",children:(0,e.jsxDEV)(h,{className:"px-0",children:(0,e.jsxDEV)(x,{children:[(0,e.jsxDEV)(I,{children:(0,e.jsxDEV)(u,{children:[(0,e.jsxDEV)(l,{children:s("Provider")},void 0,!1),(0,e.jsxDEV)(l,{children:s("Reference")},void 0,!1),(0,e.jsxDEV)(l,{children:s("Plan")},void 0,!1),(0,e.jsxDEV)(l,{children:s("State")},void 0,!1),(0,e.jsxDEV)(l,{children:s("Renews")},void 0,!1)]},void 0,!0)},void 0,!1),(0,e.jsxDEV)(N,{children:f.map(r=>{let p=i(a(r,"state"));return(0,e.jsxDEV)(u,{"data-testid":"payment-subscription-row",children:[(0,e.jsxDEV)(o,{children:i(a(r,"provider"))},void 0,!1),(0,e.jsxDEV)(o,{children:i(a(r,"referenceId"))},void 0,!1),(0,e.jsxDEV)(o,{children:i(a(r,"priceId"))},void 0,!1),(0,e.jsxDEV)(o,{children:(0,e.jsxDEV)(v,{variant:F(p),children:p},void 0,!1)},void 0,!1),(0,e.jsxDEV)(o,{children:b(a(r,"currentPeriodEnd"))},void 0,!1)]},i(a(r,"providerSubscriptionId")),!0)})},void 0,!1)]},void 0,!0)},void 0,!1)},void 0,!1),(0,e.jsxDEV)(m,{className:"overflow-hidden py-0",children:[(0,e.jsxDEV)("header",{className:"border-b border-border px-4 py-3",children:(0,e.jsxDEV)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:s("Recent webhook events")},void 0,!1)},void 0,!1),(0,e.jsxDEV)(h,{className:"px-0",children:(0,e.jsxDEV)(x,{children:(0,e.jsxDEV)(N,{children:j.map(r=>(0,e.jsxDEV)(u,{"data-testid":"payment-event-row",children:[(0,e.jsxDEV)(o,{children:i(a(r,"provider"))},void 0,!1),(0,e.jsxDEV)(o,{className:"font-medium",children:i(a(r,"type"))},void 0,!1),(0,e.jsxDEV)(o,{className:"text-muted-foreground",children:i(a(r,"providerEventId"))},void 0,!1),(0,e.jsxDEV)(o,{children:b(a(r,"processedAt"))},void 0,!1)]},i(a(r,"providerEventId")),!0))},void 0,!1)},void 0,!1)},void 0,!1)]},void 0,!0)]},void 0,!0)},"PaymentsPanel");export{K as PaymentsPanel};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as $}from"./chunk-TQ36RWOP.js";import{a as M}from"./chunk-WUFVFVHJ.js";import"./chunk-XNJNSCLM.js";import{a as P,b as Q,c as W,d as V,e as C,f as E}from"./chunk-GTM65MVX.js";import{a as
|
|
1
|
+
import{b as $}from"./chunk-TQ36RWOP.js";import{a as M}from"./chunk-WUFVFVHJ.js";import"./chunk-XNJNSCLM.js";import{b as H}from"./chunk-W666BB6V.js";import{a as P,b as Q,c as W,d as V,e as C,f as E}from"./chunk-GTM65MVX.js";import{a as K,e as O}from"./chunk-SEU5V7I6.js";import{b as F}from"./chunk-ZPP2KOR4.js";import"./chunk-CKSHCYGC.js";import{a as j}from"./chunk-BOXSWNXZ.js";import"./chunk-SDMZKBTD.js";import"./chunk-ZHVTQ37P.js";import"./chunk-3OA7PECS.js";import{d as B}from"./chunk-ITQKVEP7.js";import"./chunk-22C6COGE.js";import{a as U,e as L,f as G,g as J,h as X}from"./chunk-RRCPZMC2.js";var q=L(J(),1),te=L(G(),1);var r=L(X(),1);var Y={binding:"outline",secret:"destructive",var:"secondary"},me=U(a=>{let e=(0,q.c)(68),{initialShardKey:z}=a,t=B(),N;e[0]===Symbol.for("react.memo_cache_sentinel")?(N={},e[0]=N):N=e[0];let R=z??"",T;e[1]!==R?(T={shardKey:R},e[1]=R,e[2]=T):T=e[2];let{data:k,error:d,errorSource:S,isLoading:A}=H(j.getSettings,N,T),D;e:{let s=k?.deploy;if(s===void 0){let l;e[3]===Symbol.for("react.memo_cache_sentinel")?(l=[],e[3]=l):l=e[3],D=l;break e}let o;if(e[4]!==s.deploymentId||e[5]!==s.environment||e[6]!==s.versionTag||e[7]!==s.workerUrl||e[8]!==t){if(o=[],s.workerUrl!==void 0){let l;e[10]!==t?(l=t("URL"),e[10]=t,e[11]=l):l=e[11];let i;e[12]!==s.workerUrl||e[13]!==l?(i={label:l,value:s.workerUrl},e[12]=s.workerUrl,e[13]=l,e[14]=i):i=e[14],o.push(i)}if(s.environment!==void 0){let l;e[15]!==t?(l=t("Environment"),e[15]=t,e[16]=l):l=e[16];let i;e[17]!==s.environment||e[18]!==l?(i={label:l,value:s.environment},e[17]=s.environment,e[18]=l,e[19]=i):i=e[19],o.push(i)}if(s.deploymentId!==void 0){let l;e[20]!==t?(l=t("Deployment"),e[20]=t,e[21]=l):l=e[21];let i;e[22]!==s.deploymentId||e[23]!==l?(i={label:l,value:s.deploymentId},e[22]=s.deploymentId,e[23]=l,e[24]=i):i=e[24],o.push(i)}if(s.versionTag!==void 0){let l;e[25]!==t?(l=t("Version"),e[25]=t,e[26]=l):l=e[26];let i;e[27]!==s.versionTag||e[28]!==l?(i={label:l,value:s.versionTag},e[27]=s.versionTag,e[28]=l,e[29]=i):i=e[29],o.push(i)}e[4]=s.deploymentId,e[5]=s.environment,e[6]=s.versionTag,e[7]=s.workerUrl,e[8]=t,e[9]=o}else o=e[9];D=o}let w=D,_;e[30]!==k?.settings?(_=k?.settings??[],e[30]=k?.settings,e[31]=_):_=e[31];let n=_,m;e[32]!==t?(m=t("Open in Cloudflare"),e[32]=t,e[33]=m):m=e[33];let f;e[34]!==m?(f=(0,r.jsxDEV)("div",{className:"flex flex-wrap items-center gap-3",children:(0,r.jsxDEV)("a",{className:"text-sm text-primary underline-offset-4 hover:underline","data-testid":"set-cf-link",href:$,rel:"noreferrer",target:"_blank",children:m},void 0,!1)},void 0,!1),e[34]=m,e[35]=f):f=e[35];let c;e[36]!==t?(c=t("View-only \u2014 values are masked. Edit vars, secrets, and bindings in wrangler or the Cloudflare dashboard."),e[36]=t,e[37]=c):c=e[37];let v;e[38]!==c?(v=(0,r.jsxDEV)("p",{className:"text-sm text-muted-foreground","data-testid":"set-readonly-note",children:c},void 0,!1),e[38]=c,e[39]=v):v=e[39];let p;e[40]!==d||e[41]!==S?(p=d!==null&&(0,r.jsxDEV)(M,{error:S,testId:"set-error"},void 0,!1),e[40]=d,e[41]=S,e[42]=p):p=e[42];let u;e[43]!==w||e[44]!==t?(u=w.length>0&&(0,r.jsxDEV)(K,{className:"py-0","data-testid":"set-deploy",children:[(0,r.jsxDEV)("header",{className:"border-b border-border px-4 py-3",children:(0,r.jsxDEV)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:t("Deployment")},void 0,!1)},void 0,!1),(0,r.jsxDEV)(O,{className:"py-3",children:(0,r.jsxDEV)("dl",{className:"grid grid-cols-[8rem_minmax(0,1fr)] gap-x-4 gap-y-1 text-sm",children:w.map(Z)},void 0,!1)},void 0,!1)]},void 0,!0),e[43]=w,e[44]=t,e[45]=u):u=e[45];let h;e[46]!==t?(h=t("Environment & bindings"),e[46]=t,e[47]=h):h=e[47];let g;e[48]!==h?(g=(0,r.jsxDEV)("header",{className:"border-b border-border px-4 py-3",children:(0,r.jsxDEV)("span",{className:"font-mono text-[11px] tracking-wide text-muted-foreground uppercase",children:h},void 0,!1)},void 0,!1),e[48]=h,e[49]=g):g=e[49];let x;e[50]!==d||e[51]!==A||e[52]!==n.length||e[53]!==t?(x=d===null&&!A&&n.length===0&&(0,r.jsxDEV)("p",{className:"px-4 py-8 text-center text-sm text-muted-foreground","data-testid":"set-empty",children:t("No environment variables or bindings.")},void 0,!1),e[50]=d,e[51]=A,e[52]=n.length,e[53]=t,e[54]=x):x=e[54];let b;e[55]!==n||e[56]!==t?(b=n.length>0&&(0,r.jsxDEV)(O,{className:"px-0 py-0",children:(0,r.jsxDEV)(P,{"data-testid":"set-table",children:[(0,r.jsxDEV)(Q,{children:(0,r.jsxDEV)(V,{children:[(0,r.jsxDEV)(C,{children:t("name")},void 0,!1),(0,r.jsxDEV)(C,{children:t("kind")},void 0,!1),(0,r.jsxDEV)(C,{children:t("value")},void 0,!1)]},void 0,!0)},void 0,!1),(0,r.jsxDEV)(W,{children:n.map(ee)},void 0,!1)]},void 0,!0)},void 0,!1),e[55]=n,e[56]=t,e[57]=b):b=e[57];let y;e[58]!==g||e[59]!==x||e[60]!==b?(y=(0,r.jsxDEV)(K,{className:"py-0",children:[g,x,b]},void 0,!0),e[58]=g,e[59]=x,e[60]=b,e[61]=y):y=e[61];let I;return e[62]!==p||e[63]!==u||e[64]!==y||e[65]!==f||e[66]!==v?(I=(0,r.jsxDEV)("div",{className:"flex flex-col gap-4","data-testid":"lunora-settings",children:[f,v,p,u,y]},void 0,!0),e[62]=p,e[63]=u,e[64]=y,e[65]=f,e[66]=v,e[67]=I):I=e[67],I},"SettingsPanel");function Z(a){return(0,r.jsxDEV)("div",{className:"contents","data-testid":"set-deploy-row",children:[(0,r.jsxDEV)("dt",{className:"text-muted-foreground",children:a.label},void 0,!1),(0,r.jsxDEV)("dd",{className:"truncate font-mono text-xs",title:a.value,children:a.value},void 0,!1)]},a.label,!0)}U(Z,"_temp");function ee(a){return(0,r.jsxDEV)(V,{"data-testid":"set-row",children:[(0,r.jsxDEV)(E,{className:"font-mono text-xs font-medium",children:a.name},void 0,!1),(0,r.jsxDEV)(E,{children:(0,r.jsxDEV)(F,{variant:Y[a.kind],children:a.bindingType??a.kind},void 0,!1)},void 0,!1),(0,r.jsxDEV)(E,{className:"max-w-[28ch] truncate font-mono text-xs text-muted-foreground",children:a.value??(0,r.jsxDEV)("span",{className:"text-muted-foreground",children:"\u2014"},void 0,!1)},void 0,!1)]},a.name,!0)}U(ee,"_temp2");export{me as SettingsPanel};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as we,b as Ke,c as je}from"./chunk-L7SK4ZZD.js";import{i as Ge,k as He}from"./chunk-4QHKBC77.js";import{D as Me,I as Se,K as Ve,L as De,M as Le,N as Oe,O as Te,P as Fe,Q as _e,a as $,b as Ie,c as Ne,e as F,f as Be}from"./chunk-
|
|
1
|
+
import{a as we,b as Ke,c as je}from"./chunk-L7SK4ZZD.js";import{i as Ge,k as He}from"./chunk-4QHKBC77.js";import{D as Me,I as Se,K as Ve,L as De,M as Le,N as Oe,O as Te,P as Fe,Q as _e,a as $,b as Ie,c as Ne,e as F,f as Be}from"./chunk-VL23Y44O.js";import{b as Ae}from"./chunk-UK64ZSUW.js";import{a as T,e as ce}from"./chunk-O3NAGRTR.js";import{a as ve,c as Re,d as Ee,g as de,i as Pe,j as W}from"./chunk-CKSHCYGC.js";import{a as vt}from"./chunk-3OA7PECS.js";import{a as i,d as Ct,e as k,f as O,g as yt,h as Rt,j as ye}from"./chunk-RRCPZMC2.js";var Je=k(yt(),1);var w={};Ct(w,{Indicator:()=>fe,Root:()=>ue});var u=k(O(),1);function Ue(t){if(!t)return null;for(let e of t.elements){let n=e.tagName;if(n==="BUTTON"||n==="INPUT"){let o=e;if(o.type==="submit")return o}}return null}i(Ue,"getDefaultFormSubmitter");var qe=k(O(),1);var le=(function(t){return t.checked="data-checked",t.unchecked="data-unchecked",t.indeterminate="data-indeterminate",t.disabled="data-disabled",t.readonly="data-readonly",t.required="data-required",t.valid="data-valid",t.invalid="data-invalid",t.touched="data-touched",t.dirty="data-dirty",t.filled="data-filled",t.focused="data-focused",t})({});function z(t){return qe.useMemo(()=>({checked(e){return t.indeterminate?{}:e?{[le.checked]:""}:{[le.unchecked]:""}},...$}),[t.indeterminate])}i(z,"useStateAttributesMapping");var We=k(O(),1);function $e(t,e,n,o=!0,a){let[f,p]=We.useState(),M=F(a?`${a}-label`:void 0),b=t??e??f;return T(()=>{let g=t||e||!o?void 0:Et(n.current,M);f!==g&&p(g)}),b}i($e,"useAriaLabelledBy");function Et(t,e){let n=Pt(t);if(n)return!n.id&&e&&(n.id=e),n.id||void 0}i(Et,"getAriaLabelledBy");function Pt(t){if(!t)return;let e=t.parentElement;if(e&&e.tagName==="LABEL")return e;let n=t.id;if(n){let a=t.nextElementSibling;if(a&&a.htmlFor===n)return a}let o=t.labels;return o&&o[0]}i(Pt,"findAssociatedLabel");var J=k(O(),1);var X=J.createContext(void 0);X.displayName="CheckboxRootContext";function ze(){let t=J.useContext(X);if(t===void 0)throw new Error("Base UI: CheckboxRootContext is missing. Checkbox parts must be placed within <Checkbox.Root>.");return t}i(ze,"useCheckboxRootContext");var _=k(vt(),1);var It="data-parent",ue=u.forwardRef(i(function(e,n){let{checked:o,className:a,defaultChecked:f=!1,"aria-labelledby":p,disabled:M=!1,form:b,id:g,indeterminate:S=!1,inputRef:Z,name:K,onCheckedChange:A,parent:m=!1,readOnly:R=!1,render:pe,required:E=!1,uncheckedValue:j,value:G,nativeButton:H=!1,style:Nt,...Xe}=e,{clearErrors:Ye}=Ne(),{disabled:Qe,name:Ze,setDirty:et,setFilled:ee,setFocused:me,setTouched:tt,state:he,validationMode:rt,validityData:nt,validation:ot}=Ie(),it=Me(),{labelId:at,controlId:st,registerControlId:P,getDescriptionProps:be}=Be(),s=_e(),V=s?.parent,D=V&&s.allValues,c=Qe||it.disabled||s?.disabled||M,I=Ze??K,d=G??I,ge=F(),dt=F(),x=st;D?x=m?dt:`${V.id}-${d}`:g&&(x=g);let te={};D&&(m?te=s.parent.getParentProps():d&&(te=s.parent.getChildProps(d)));let{checked:ke=o,indeterminate:ct=S,onCheckedChange:lt,...ut}=te,N=s?.value,xe=s?.setValue,Ce=s?.defaultValue,re=u.useRef(null),U=Re(()=>Symbol("checkbox-control")),ne=u.useRef(!1),{getButtonProps:ft,buttonRef:pt}=Ae({disabled:c,native:H}),B=s?.validation??ot,[l,mt]=Le({controlled:d&&N&&!m?N.includes(d):ke,default:d&&Ce&&!m?Ce.includes(d):f,name:"Checkbox",state:"checked"}),oe=D?!!ke:l,L=D&&ct||S;T(()=>{P!==de&&(ne.current=!0,P(U.current,x))},[x,P,U]),u.useEffect(()=>{let r=U.current;return()=>{!ne.current||P===de||(ne.current=!1,P(r,void 0))}},[P,U]),Oe(re,ge,l,void 0,!s&&!c,K);let C=u.useRef(null),ht=Ee(Z,C,B.inputRef,B.registerInput),bt=$e(p,at,C,!H,x??void 0);T(()=>{C.current&&(C.current.indeterminate=L,l&&ee(!0))},[l,L,ee]),je(l,()=>{s||(Ye(I),ee(l),et(l!==nt.initialValue),B.change(l))});let gt=ve({checked:l,disabled:c,form:b,name:m?void 0:I,id:H?void 0:x??void 0,required:E,ref:ht,style:I?Ke:we,tabIndex:-1,type:"checkbox","aria-hidden":!0,onChange(r){if(r.nativeEvent.defaultPrevented)return;if(R){r.preventDefault();return}let h=r.currentTarget.checked,y=Fe(Te.none,r.nativeEvent);if(A?.(h,y),!y.isCanceled&&(lt?.(h,y),!y.isCanceled&&(mt(h),d&&N&&xe&&!m&&!D))){let v=h?[...N,d]:N.filter(q=>q!==d);xe(v,y)}},onFocus(){re.current?.focus()}},G!==void 0?{value:(s?l&&G:G)||""}:Pe,be,r=>B.getValidationProps(c,r));u.useEffect(()=>{if(!V||!d)return;let r=V.disabledStatesRef.current;return r.set(d,c),()=>{r.delete(d)}},[V,c,d]);let ie=u.useMemo(()=>({...he,checked:oe,disabled:c,readOnly:R,required:E,indeterminate:L}),[he,oe,c,R,E,L]),kt=z(ie),xt=W("span",e,{state:ie,ref:[pt,re,n,s?.registerControlRef],props:[{id:H?x??void 0:ge,role:"checkbox","aria-checked":L?"mixed":oe,"aria-readonly":R||void 0,"aria-required":E||void 0,"aria-labelledby":bt,[It]:m?"":void 0,onFocus(){c||me(!0)},onBlur(){let r=C.current;r&&(tt(!0),me(!1),rt==="onBlur"&&B.commit(s?N:r.checked))},onKeyDown(r){if(r.key!=="Enter"||(r.preventBaseUIHandler(),r.defaultPrevented))return;let h=C.current?.form??null,y=r.currentTarget,v=r.nativeEvent,q=r.preventDefault,ae=v.preventDefault,se=!1;r.preventDefault=()=>{se=!0,q.call(r)},v.preventDefault=()=>{se=!0,ae.call(v)},ae.call(v),ce(y).queueMicrotask(()=>{r.preventDefault=q,v.preventDefault=ae,se||Ue(h)?.click()})},onClick(r){if(R||c)return;r.preventDefault();let h=C.current;h&&h.dispatchEvent(new(ce(h)).PointerEvent("click",{bubbles:!0,shiftKey:r.shiftKey,ctrlKey:r.ctrlKey,altKey:r.altKey,metaKey:r.metaKey}))}},Xe,ut,ft,be,r=>B.getValidationProps(c,r)],stateAttributesMapping:kt});return(0,_.jsxs)(X.Provider,{value:ie,children:[xt,!l&&!s&&I&&!m&&j!==void 0&&(0,_.jsx)("input",{type:"hidden",form:b,name:I,value:j,disabled:c}),(0,_.jsx)("input",{...gt,suppressHydrationWarning:!0})]})},"CheckboxRoot"));ue.displayName="CheckboxRoot";var Y=k(O(),1);var fe=Y.forwardRef(i(function(e,n){let{render:o,className:a,style:f,keepMounted:p=!1,...M}=e,b=ze(),g=b.checked||b.indeterminate,{mounted:S,transitionStatus:Z,setMounted:K}=De(g),A=Y.useRef(null),m={...b,transitionStatus:Z};Ve({open:g,ref:A,onComplete(){g||K(!1)}});let pe={...z(b),...Se,...$},E=p||S,j=W("span",e,{ref:[n,A],state:m,stateAttributesMapping:pe,props:M});return E?j:null},"CheckboxIndicator"));fe.displayName="CheckboxIndicator";var Q=k(Rt(),1);function Sr(t){let e=(0,Je.c)(9),n,o;e[0]!==t?({className:n,...o}=t,e[0]=t,e[1]=n,e[2]=o):(n=e[1],o=e[2]);let a;e[3]!==n?(a=ye("peer relative flex size-4 shrink-0 items-center justify-center rounded-md border border-input transition-colors outline-none group-has-disabled/field:opacity-50 after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-1 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary",n),e[3]=n,e[4]=a):a=e[4];let f;e[5]===Symbol.for("react.memo_cache_sentinel")?(f=(0,Q.jsxDEV)(w.Indicator,{"data-slot":"checkbox-indicator",className:"grid place-content-center text-current transition-none [&>svg]:size-3.5",children:(0,Q.jsxDEV)(He,{icon:Ge,strokeWidth:2},void 0,!1)},void 0,!1),e[5]=f):f=e[5];let p;return e[6]!==o||e[7]!==a?(p=(0,Q.jsxDEV)(w.Root,{"data-slot":"checkbox",className:a,...o,children:f},void 0,!1),e[6]=o,e[7]=a,e[8]=p):p=e[8],p}i(Sr,"Checkbox");export{Sr as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{b as Le}from"./chunk-
|
|
1
|
+
import{b as Le}from"./chunk-TO6D2PJC.js";import"./chunk-V43BLH4J.js";import"./chunk-APSSZB6Z.js";import{c as Be}from"./chunk-TQ36RWOP.js";import"./chunk-QAFAJBAW.js";import{a as ye}from"./chunk-3GXGLNKW.js";import"./chunk-AHILM3ZP.js";import{a as Ke}from"./chunk-J6J54MBP.js";import"./chunk-WVTPZ6CM.js";import"./chunk-SHERR7ZP.js";import"./chunk-5OIBXYZM.js";import"./chunk-L7SK4ZZD.js";import{a as ze}from"./chunk-EEWKIQUE.js";import"./chunk-KEGAWN6Y.js";import{a as Fe,b as De,c as Re,d as de,e as le,f as ee}from"./chunk-GTM65MVX.js";import{a as Te,e as _e}from"./chunk-SEU5V7I6.js";import"./chunk-4QHKBC77.js";import{a as $e}from"./chunk-LUP4YTBS.js";import"./chunk-4PC7IXNY.js";import"./chunk-2MLA6WFH.js";import{R as Ne}from"./chunk-VL23Y44O.js";import"./chunk-HV7G6DFP.js";import{c as se}from"./chunk-UK64ZSUW.js";import"./chunk-O3NAGRTR.js";import{b as ie}from"./chunk-ZPP2KOR4.js";import"./chunk-CKSHCYGC.js";import{a as be}from"./chunk-BOXSWNXZ.js";import{f as we}from"./chunk-SDMZKBTD.js";import"./chunk-ZHVTQ37P.js";import"./chunk-3OA7PECS.js";import{a as me}from"./chunk-TAD43CG5.js";import{d as Ce,f as ge,g as pe,h as Q,l as H,n as Ee,o as ve}from"./chunk-ITQKVEP7.js";import"./chunk-22C6COGE.js";import{a as g,e as he,f as gt,g as pt,h as vt}from"./chunk-RRCPZMC2.js";var j=he(pt(),1),_=he(gt(),1);var l=he(vt(),1);var je=g((c,e,s)=>{let t=(0,j.c)(21),{onCopy:n,onDelete:o,onDownload:u,onToggleSelect:a}=s,r;t[0]!==c.key||t[1]!==n?(r=g(()=>{n(c.key)},"t0"),t[0]=c.key,t[1]=n,t[2]=r):r=t[2];let d=r,h;t[3]!==c.key||t[4]!==u?(h=g(()=>{u(c.key)},"t1"),t[3]=c.key,t[4]=u,t[5]=h):h=t[5];let f=h,m;t[6]!==c.key||t[7]!==o?(m=g(()=>{o(c.key)},"t2"),t[6]=c.key,t[7]=o,t[8]=m):m=t[8];let S=m,i;t[9]!==c.key||t[10]!==a?(i=g(()=>{a(c.key)},"t3"),t[9]=c.key,t[10]=a,t[11]=i):i=t[11];let x=i,y;t[12]!==c.key||t[13]!==e.length?(y=c.key.slice(e.length),t[12]=c.key,t[13]=e.length,t[14]=y):y=t[14];let v;return t[15]!==d||t[16]!==f||t[17]!==S||t[18]!==y||t[19]!==x?(v={copy:d,download:f,name:y,remove:S,toggle:x},t[15]=d,t[16]=f,t[17]=S,t[18]=y,t[19]=x,t[20]=v):v=t[20],v},"useFileItem"),Ue=g(c=>{let e=(0,j.c)(31),{busy:s,buttonClassName:t,copied:n,objectKey:o,onCopy:u,onDelete:a,onDownload:r,t:d}=c,h=`storage-copy-${o}`,f;e[0]!==n||e[1]!==d?(f=d(n?"Copied":"Copy URL"),e[0]=n,e[1]=d,e[2]=f):f=e[2];let m;e[3]!==s||e[4]!==t||e[5]!==u||e[6]!==h||e[7]!==f?(m=(0,l.jsxDEV)(se,{className:t,"data-testid":h,disabled:s,onClick:u,size:"sm",type:"button",variant:"ghost",children:f},void 0,!1),e[3]=s,e[4]=t,e[5]=u,e[6]=h,e[7]=f,e[8]=m):m=e[8];let S=`storage-download-${o}`,i;e[9]!==d?(i=d("Download"),e[9]=d,e[10]=i):i=e[10];let x;e[11]!==s||e[12]!==t||e[13]!==r||e[14]!==S||e[15]!==i?(x=(0,l.jsxDEV)(se,{className:t,"data-testid":S,disabled:s,onClick:r,size:"sm",type:"button",variant:"ghost",children:i},void 0,!1),e[11]=s,e[12]=t,e[13]=r,e[14]=S,e[15]=i,e[16]=x):x=e[16];let y;e[17]!==d?(y=d("Delete object?"),e[17]=d,e[18]=y):y=e[18];let v=`storage-delete-${o}`,b;e[19]!==d?(b=d("Delete"),e[19]=d,e[20]=b):b=e[20];let k;e[21]!==s||e[22]!==a||e[23]!==y||e[24]!==v||e[25]!==b?(k=(0,l.jsxDEV)(ze,{confirmLabel:y,disabled:s,onConfirm:a,testId:v,children:b},void 0,!1),e[21]=s,e[22]=a,e[23]=y,e[24]=v,e[25]=b,e[26]=k):k=e[26];let w;return e[27]!==k||e[28]!==m||e[29]!==x?(w=(0,l.jsxDEV)(l.Fragment,{children:[m,x,k]},void 0,!0),e[27]=k,e[28]=m,e[29]=x,e[30]=w):w=e[30],w},"FileActions"),Me=g(c=>{let e=(0,j.c)(14),{objectKey:s,references:t,t:n}=c;if(t===void 0)return null;if(t.length===0){let h=`storage-orphan-${s}`,f;e[0]!==n?(f=n("Orphan"),e[0]=n,e[1]=f):f=e[1];let m;return e[2]!==h||e[3]!==f?(m=(0,l.jsxDEV)(ie,{"data-testid":h,variant:"warning",children:f},void 0,!1),e[2]=h,e[3]=f,e[4]=m):m=e[4],m}let o;e[5]!==t?(o=t.map(bt).join(`
|
|
2
2
|
`),e[5]=t,e[6]=o):o=e[6];let u=o,a=`storage-refs-${s}`,r;e[7]!==t.length||e[8]!==n?(r=t.length===1?n("1 record"):n("{count} records",{count:t.length}),e[7]=t.length,e[8]=n,e[9]=r):r=e[9];let d;return e[10]!==u||e[11]!==a||e[12]!==r?(d=(0,l.jsxDEV)(ie,{"data-testid":a,title:u,variant:"secondary",children:r},void 0,!1),e[10]=u,e[11]=a,e[12]=r,e[13]=d):d=e[13],d},"FileReferences"),Ge=g(c=>{let e=(0,j.c)(7),{objectKey:s,onToggle:t,selected:n,t:o}=c,u;e[0]!==o?(u=o("Select row"),e[0]=o,e[1]=u):u=e[1];let a=`storage-select-${s}`,r;return e[2]!==t||e[3]!==n||e[4]!==u||e[5]!==a?(r=(0,l.jsxDEV)(ye,{"aria-label":u,checked:n,"data-testid":a,onCheckedChange:t},void 0,!1),e[2]=t,e[3]=n,e[4]=u,e[5]=a,e[6]=r):r=e[6],r},"FileSelect");function bt(c){return`${c.table}\xB7${c.id}`}g(bt,"_temp$2");var yt=g(c=>{let e=(0,j.c)(10),{colSpan:s,name:t,onEnter:n}=c,o;e[0]!==t||e[1]!==n?(o=g(()=>{n(t)},"t1"),e[0]=t,e[1]=n,e[2]=o):o=e[2];let u=o,a;e[3]===Symbol.for("react.memo_cache_sentinel")?(a=(0,l.jsxDEV)("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,l.jsxDEV)("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"},void 0,!1)},void 0,!1),e[3]=a):a=e[3];let r;e[4]!==u||e[5]!==t?(r=(0,l.jsxDEV)("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:[a,t]},void 0,!0),e[4]=u,e[5]=t,e[6]=r):r=e[6];let d;return e[7]!==s||e[8]!==r?(d=(0,l.jsxDEV)(de,{children:(0,l.jsxDEV)(ee,{colSpan:s,children:r},void 0,!1)},void 0,!1),e[7]=s,e[8]=r,e[9]=d):d=e[9],d},"FolderRow"),xt=g(c=>{let e=(0,j.c)(33),{busy:s,copiedKey:t,handlers:n,object:o,prefix:u,references:a,selected:r,showReferences:d,t:h}=c,{copy:f,download:m,name:S,remove:i,toggle:x}=je(o,u,n),y;e[0]!==o.key||e[1]!==r||e[2]!==h||e[3]!==x?(y=(0,l.jsxDEV)(ee,{className:"w-8",children:(0,l.jsxDEV)(Ge,{objectKey:o.key,onToggle:x,selected:r,t:h},void 0,!1)},void 0,!1),e[0]=o.key,e[1]=r,e[2]=h,e[3]=x,e[4]=y):y=e[4];let v;e[5]!==S?(v=(0,l.jsxDEV)(ee,{className:"font-mono text-xs",children:S},void 0,!1),e[5]=S,e[6]=v):v=e[6];let b;e[7]!==o.size?(b=ve(o.size),e[7]=o.size,e[8]=b):b=e[8];let k;e[9]!==b?(k=(0,l.jsxDEV)(ee,{className:"tabular-nums text-muted-foreground",children:b},void 0,!1),e[9]=b,e[10]=k):k=e[10];let w=o.httpMetadata?.contentType??"",T;e[11]!==w?(T=(0,l.jsxDEV)(ee,{children:w},void 0,!1),e[11]=w,e[12]=T):T=e[12];let C;e[13]!==o.key||e[14]!==a||e[15]!==d||e[16]!==h?(C=d&&(0,l.jsxDEV)(ee,{children:(0,l.jsxDEV)(Me,{objectKey:o.key,references:a,t:h},void 0,!1)},void 0,!1),e[13]=o.key,e[14]=a,e[15]=d,e[16]=h,e[17]=C):C=e[17];let N=t===o.key,E;e[18]!==s||e[19]!==f||e[20]!==m||e[21]!==o.key||e[22]!==i||e[23]!==h||e[24]!==N?(E=(0,l.jsxDEV)(ee,{className:"text-right",children:(0,l.jsxDEV)("span",{className:"inline-flex items-center gap-1",children:(0,l.jsxDEV)(Ue,{busy:s,copied:N,objectKey:o.key,onCopy:f,onDelete:i,onDownload:m,t:h},void 0,!1)},void 0,!1)},void 0,!1),e[18]=s,e[19]=f,e[20]=m,e[21]=o.key,e[22]=i,e[23]=h,e[24]=N,e[25]=E):E=e[25];let F;return e[26]!==y||e[27]!==v||e[28]!==k||e[29]!==T||e[30]!==C||e[31]!==E?(F=(0,l.jsxDEV)(de,{"data-testid":"fb-row",children:[y,v,k,T,C,E]},void 0,!0),e[26]=y,e[27]=v,e[28]=k,e[29]=T,e[30]=C,e[31]=E,e[32]=F):F=e[32],F},"FileRow"),kt=g(c=>{let e=(0,j.c)(65),{allSelected:s,busy:t,copiedKey:n,files:o,folders:u,handlers:a,onEnterFolder:r,prefix:d,references:h,selected:f,showReferences:m,someSelected:S,t:i,toggleSelectAll:x}=c,y;e[0]!==i?(y=i("Select all rows"),e[0]=i,e[1]=y):y=e[1];let v;e[2]!==s||e[3]!==S||e[4]!==y||e[5]!==x?(v=(0,l.jsxDEV)(le,{className:"w-8",children:(0,l.jsxDEV)(ye,{"aria-label":y,checked:s,"data-testid":"storage-select-all",indeterminate:S,onCheckedChange:x},void 0,!1)},void 0,!1),e[2]=s,e[3]=S,e[4]=y,e[5]=x,e[6]=v):v=e[6];let b;e[7]!==i?(b=i("key"),e[7]=i,e[8]=b):b=e[8];let k;e[9]!==b?(k=(0,l.jsxDEV)(le,{children:b},void 0,!1),e[9]=b,e[10]=k):k=e[10];let w;e[11]!==i?(w=i("size"),e[11]=i,e[12]=w):w=e[12];let T;e[13]!==w?(T=(0,l.jsxDEV)(le,{children:w},void 0,!1),e[13]=w,e[14]=T):T=e[14];let C;e[15]!==i?(C=i("content-type"),e[15]=i,e[16]=C):C=e[16];let N;e[17]!==C?(N=(0,l.jsxDEV)(le,{children:C},void 0,!1),e[17]=C,e[18]=N):N=e[18];let E;e[19]!==m||e[20]!==i?(E=m&&(0,l.jsxDEV)(le,{children:i("used by")},void 0,!1),e[19]=m,e[20]=i,e[21]=E):E=e[21];let F;e[22]!==i?(F=i("Actions"),e[22]=i,e[23]=F):F=e[23];let R;e[24]!==F?(R=(0,l.jsxDEV)(le,{"aria-label":F},void 0,!1),e[24]=F,e[25]=R):R=e[25];let D;e[26]!==R||e[27]!==v||e[28]!==k||e[29]!==T||e[30]!==N||e[31]!==E?(D=(0,l.jsxDEV)(De,{children:(0,l.jsxDEV)(de,{children:[v,k,T,N,E,R]},void 0,!0)},void 0,!1),e[26]=R,e[27]=v,e[28]=k,e[29]=T,e[30]=N,e[31]=E,e[32]=D):D=e[32];let B;if(e[33]!==u||e[34]!==r||e[35]!==m){let z;e[37]!==r||e[38]!==m?(z=g(L=>(0,l.jsxDEV)(yt,{colSpan:m?6:5,name:L,onEnter:r},L,!1),"t142"),e[37]=r,e[38]=m,e[39]=z):z=e[39],B=u.map(z),e[33]=u,e[34]=r,e[35]=m,e[36]=B}else B=e[36];let I;if(e[40]!==t||e[41]!==n||e[42]!==o||e[43]!==a||e[44]!==d||e[45]!==h||e[46]!==f||e[47]!==m||e[48]!==i){let z;e[50]!==t||e[51]!==n||e[52]!==a||e[53]!==d||e[54]!==h||e[55]!==f||e[56]!==m||e[57]!==i?(z=g(L=>(0,l.jsxDEV)(xt,{busy:t,copiedKey:n,handlers:a,object:L,prefix:d,references:h[L.key],selected:f.has(L.key),showReferences:m,t:i},L.key,!1),"t152"),e[50]=t,e[51]=n,e[52]=a,e[53]=d,e[54]=h,e[55]=f,e[56]=m,e[57]=i,e[58]=z):z=e[58],I=o.map(z),e[40]=t,e[41]=n,e[42]=o,e[43]=a,e[44]=d,e[45]=h,e[46]=f,e[47]=m,e[48]=i,e[49]=I}else I=e[49];let K;e[59]!==B||e[60]!==I?(K=(0,l.jsxDEV)(Re,{children:[B,I]},void 0,!0),e[59]=B,e[60]=I,e[61]=K):K=e[61];let A;return e[62]!==D||e[63]!==K?(A=(0,l.jsxDEV)(Te,{className:"overflow-hidden py-0",children:(0,l.jsxDEV)(_e,{className:"px-0",children:(0,l.jsxDEV)(Fe,{"data-testid":"fb-table",children:[D,K]},void 0,!0)},void 0,!1)},void 0,!1),e[62]=D,e[63]=K,e[64]=A):A=e[64],A},"FileBrowserList"),St=[{label:"15m",seconds:900},{label:"1h",seconds:3600},{label:"24h",seconds:86400},{label:"7d",seconds:604800}],wt=3600,Ie=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 s=new Date(c.uploaded).getTime();return Number.isNaN(s)?0:s}return e.startsWith("tag:")?c.customMetadata?.[e.slice(4)]??"":c.key},"fileSortValue"),Ct=g((c,e,s)=>{let t=s==="desc"?-1:1;return c.toSorted((n,o)=>{let u=Ie(n,e),a=Ie(o,e);return(typeof u=="number"&&typeof a=="number"?u-a:String(u).localeCompare(String(a)))*t})},"sortFiles"),Nt=g((c,e)=>{let s=new Set,t=[];for(let n of c){let o=n.key.slice(e.length),u=o.indexOf("/");u===-1?t.push(n):s.add(o.slice(0,u+1))}return{files:t,folders:[...s].toSorted((n,o)=>n.localeCompare(o))}},"deriveEntries"),Tt=g(c=>{let e=(0,j.c)(59),{bucket:s,buckets:t,busy:n,draftPrefix:o,expiry:u,fileInputRef:a,onBucketChange:r,onExpiryChange:d,onFileChange:h,onList:f,onPrefixChange:m,onUploadClick:S,t:i}=c,x;e[0]!==m?(x=g(G=>{m(G.target.value)},"t1"),e[0]=m,e[1]=x):x=e[1];let y=x,v;e[2]!==r?(v=g(G=>{r(G.target.value)},"t2"),e[2]=r,e[3]=v):v=e[3];let b=v,k;e[4]!==d?(k=g(G=>{d(Number.parseInt(G.target.value,10))},"t3"),e[4]=d,e[5]=k):k=e[5];let w=k,T;e[6]!==s||e[7]!==t||e[8]!==b||e[9]!==i?(T=t.length>0&&(0,l.jsxDEV)("select",{"aria-label":i("Bucket"),className:"h-8 rounded-md border border-border bg-background px-1 outline-none focus-visible:border-ring","data-testid":"fb-bucket",onChange:b,value:s,children:t.map(Et)},void 0,!1),e[6]=s,e[7]=t,e[8]=b,e[9]=i,e[10]=T):T=e[10];let C;e[11]!==i?(C=i("Key prefix"),e[11]=i,e[12]=C):C=e[12];let N;e[13]!==i?(N=i("key prefix (optional)"),e[13]=i,e[14]=N):N=e[14];let E;e[15]!==o||e[16]!==y||e[17]!==C||e[18]!==N?(E=(0,l.jsxDEV)(Ne,{"aria-label":C,className:"h-8 w-64 max-w-full","data-testid":"fb-prefix-input",onChange:y,placeholder:N,value:o},void 0,!1),e[15]=o,e[16]=y,e[17]=C,e[18]=N,e[19]=E):E=e[19];let F;e[20]!==i?(F=i("List"),e[20]=i,e[21]=F):F=e[21];let R;e[22]!==n||e[23]!==f||e[24]!==F?(R=(0,l.jsxDEV)(se,{"data-testid":"fb-list",disabled:n,onClick:f,size:"sm",type:"button",children:F},void 0,!1),e[22]=n,e[23]=f,e[24]=F,e[25]=R):R=e[25];let D;e[26]!==n||e[27]!==i?(D=i(n?"Uploading\u2026":"Upload"),e[26]=n,e[27]=i,e[28]=D):D=e[28];let B;e[29]!==n||e[30]!==S||e[31]!==D?(B=(0,l.jsxDEV)(se,{"data-testid":"storage-upload",disabled:n,onClick:S,size:"sm",type:"button",variant:"outline",children:D},void 0,!1),e[29]=n,e[30]=S,e[31]=D,e[32]=B):B=e[32];let I;e[33]!==a||e[34]!==h?(I=(0,l.jsxDEV)("input",{className:"hidden","data-testid":"storage-file-input",onChange:h,ref:a,type:"file"},void 0,!1),e[33]=a,e[34]=h,e[35]=I):I=e[35];let K;e[36]!==i?(K=i("Link expiry"),e[36]=i,e[37]=K):K=e[37];let A;e[38]!==i?(A=St.map(G=>(0,l.jsxDEV)("option",{value:G.seconds,children:i(G.label)},G.seconds,!1)),e[38]=i,e[39]=A):A=e[39];let z;e[40]!==u||e[41]!==w||e[42]!==A?(z=(0,l.jsxDEV)("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:w,value:u,children:A},void 0,!1),e[40]=u,e[41]=w,e[42]=A,e[43]=z):z=e[43];let L;e[44]!==K||e[45]!==z?(L=(0,l.jsxDEV)("label",{className:"ml-auto flex items-center gap-1.5 text-xs text-muted-foreground",htmlFor:"storage-expiry",children:[K,z]},void 0,!0),e[44]=K,e[45]=z,e[46]=L):L=e[46];let U;e[47]!==i?(U=i("Open in Cloudflare"),e[47]=i,e[48]=U):U=e[48];let M;e[49]!==U?(M=(0,l.jsxDEV)("a",{className:"text-sm text-primary underline-offset-4 hover:underline","data-testid":"fb-cf-link",href:Be,rel:"noreferrer",target:"_blank",children:U},void 0,!1),e[49]=U,e[50]=M):M=e[50];let P;return e[51]!==B||e[52]!==I||e[53]!==L||e[54]!==M||e[55]!==T||e[56]!==E||e[57]!==R?(P=(0,l.jsxDEV)("div",{className:"flex flex-wrap items-center gap-2",children:[T,E,R,B,I,L,M]},void 0,!0),e[51]=B,e[52]=I,e[53]=L,e[54]=M,e[55]=T,e[56]=E,e[57]=R,e[58]=P):P=e[58],P},"FileBrowserToolbar"),_t=g(c=>{let e=(0,j.c)(66),{onSortKeyChange:s,onThumbSizeChange:t,showGrid:n,showList:o,sortDirection:u,sortKey:a,t:r,tagKeys:d,thumbSize:h,toggleSortDirection:f,view:m}=c,S;e[0]!==s?(S=g(W=>{s(W.target.value)},"t1"),e[0]=s,e[1]=S):S=e[1];let i=S,x;e[2]!==t?(x=g(W=>{t(Number.parseInt(W.target.value,10))},"t2"),e[2]=t,e[3]=x):x=e[3];let y=x,v=m==="list",b;e[4]!==r?(b=r("List"),e[4]=r,e[5]=b):b=e[5];let k;e[6]!==o||e[7]!==v||e[8]!==b?(k=(0,l.jsxDEV)("button",{"aria-pressed":v,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:b},void 0,!1),e[6]=o,e[7]=v,e[8]=b,e[9]=k):k=e[9];let w=m==="grid",T;e[10]!==r?(T=r("Grid"),e[10]=r,e[11]=T):T=e[11];let C;e[12]!==n||e[13]!==w||e[14]!==T?(C=(0,l.jsxDEV)("button",{"aria-pressed":w,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:n,type:"button",children:T},void 0,!1),e[12]=n,e[13]=w,e[14]=T,e[15]=C):C=e[15];let N;e[16]!==k||e[17]!==C?(N=(0,l.jsxDEV)("div",{className:"inline-flex overflow-hidden rounded-md border border-border",children:[k,C]},void 0,!0),e[16]=k,e[17]=C,e[18]=N):N=e[18];let E;e[19]!==r?(E=r("Sort"),e[19]=r,e[20]=E):E=e[20];let F;e[21]!==r?(F=r("Name"),e[21]=r,e[22]=F):F=e[22];let R;e[23]!==F?(R=(0,l.jsxDEV)("option",{value:"name",children:F},void 0,!1),e[23]=F,e[24]=R):R=e[24];let D;e[25]!==r?(D=r("size"),e[25]=r,e[26]=D):D=e[26];let B;e[27]!==D?(B=(0,l.jsxDEV)("option",{value:"size",children:D},void 0,!1),e[27]=D,e[28]=B):B=e[28];let I;e[29]!==r?(I=r("Type"),e[29]=r,e[30]=I):I=e[30];let K;e[31]!==I?(K=(0,l.jsxDEV)("option",{value:"type",children:I},void 0,!1),e[31]=I,e[32]=K):K=e[32];let A;e[33]!==r?(A=r("Modified"),e[33]=r,e[34]=A):A=e[34];let z;e[35]!==A?(z=(0,l.jsxDEV)("option",{value:"date",children:A},void 0,!1),e[35]=A,e[36]=z):z=e[36];let L;e[37]!==d?(L=d.map($t),e[37]=d,e[38]=L):L=e[38];let U;e[39]!==i||e[40]!==a||e[41]!==R||e[42]!==B||e[43]!==K||e[44]!==z||e[45]!==L?(U=(0,l.jsxDEV)("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:i,value:a,children:[R,B,K,z,L]},void 0,!0),e[39]=i,e[40]=a,e[41]=R,e[42]=B,e[43]=K,e[44]=z,e[45]=L,e[46]=U):U=e[46];let M;e[47]!==E||e[48]!==U?(M=(0,l.jsxDEV)("label",{className:"flex items-center gap-1.5 text-muted-foreground",htmlFor:"fb-sort",children:[E,U]},void 0,!0),e[47]=E,e[48]=U,e[49]=M):M=e[49];let P;e[50]!==r?(P=r("Toggle sort direction"),e[50]=r,e[51]=P):P=e[51];let G=u==="asc"?"\u2191":"\u2193",q;e[52]!==P||e[53]!==G||e[54]!==f?(q=(0,l.jsxDEV)("button",{"aria-label":P,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:f,type:"button",children:G},void 0,!1),e[52]=P,e[53]=G,e[54]=f,e[55]=q):q=e[55];let Y;e[56]!==y||e[57]!==r||e[58]!==h||e[59]!==m?(Y=m==="grid"&&(0,l.jsxDEV)("label",{className:"ml-auto flex items-center gap-1.5 text-muted-foreground",htmlFor:"fb-thumb-size",children:[r("Thumbnail size"),(0,l.jsxDEV)("input",{className:"accent-primary","data-testid":"fb-thumb-size",id:"fb-thumb-size",max:240,min:80,onChange:y,step:8,type:"range",value:h},void 0,!1)]},void 0,!0),e[56]=y,e[57]=r,e[58]=h,e[59]=m,e[60]=Y):Y=e[60];let oe;return e[61]!==M||e[62]!==q||e[63]!==Y||e[64]!==N?(oe=(0,l.jsxDEV)("div",{className:"flex flex-wrap items-center gap-2 text-xs","data-testid":"fb-controls",children:[N,M,q,Y]},void 0,!0),e[61]=M,e[62]=q,e[63]=Y,e[64]=N,e[65]=oe):oe=e[65],oe},"FileBrowserControls");function Et(c){return(0,l.jsxDEV)("option",{value:c,children:c},c,!1)}g(Et,"_temp$1");function $t(c){return(0,l.jsxDEV)("option",{value:`tag:${c}`,children:c},c,!1)}g($t,"_temp2");var Ft=/\.(?:avif|bmp|gif|ico|jpe?g|png|svg|webp)$/iu,Dt=g(c=>(c.httpMetadata?.contentType??"").startsWith("image/")||Ft.test(c.key),"isImage"),Rt=g(()=>{let c=(0,j.c)(1),e;return c[0]===Symbol.for("react.memo_cache_sentinel")?(e=(0,l.jsxDEV)("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,l.jsxDEV)("path",{d:"M7 3h7l5 5v13a1 1 0 0 1-1 1H7a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1Zm7 0v5h5"},void 0,!1)},void 0,!1),c[0]=e):e=c[0],e},"FileGlyph"),zt=g(c=>{let e=(0,j.c)(13),{object:s,resolveUrl:t}=c,[n,o]=(0,_.useState)(null),[u,a]=(0,_.useState)(!1),r;e[0]!==s?(r=Dt(s),e[0]=s,e[1]=r):r=e[1];let d=r,h,f;e[2]!==d||e[3]!==s.key||e[4]!==t?(h=g(()=>{if(!d)return;let x={cancelled:!1};return H((async()=>{try{let y=await t(s.key);x.cancelled||o(y)}catch{x.cancelled||a(!0)}})()),()=>{x.cancelled=!0}},"t2"),f=[d,s.key,t],e[2]=d,e[3]=s.key,e[4]=t,e[5]=h,e[6]=f):(h=e[5],f=e[6]),(0,_.useEffect)(h,f);let m;e[7]===Symbol.for("react.memo_cache_sentinel")?(m=g(()=>{a(!0)},"t4"),e[7]=m):m=e[7];let S=m,i;return e[8]!==u||e[9]!==d||e[10]!==s.key||e[11]!==n?(i=(0,l.jsxDEV)("div",{className:"flex aspect-square w-full items-center justify-center overflow-hidden rounded-md border border-border bg-muted/30",children:d&&n!==null&&!u?(0,l.jsxDEV)("img",{alt:s.key,className:"size-full object-cover",loading:"lazy",onError:S,src:n},void 0,!1):(0,l.jsxDEV)(Rt,{},void 0,!1)},void 0,!1),e[8]=u,e[9]=d,e[10]=s.key,e[11]=n,e[12]=i):i=e[12],i},"Thumbnail"),Kt=g(c=>{let e=(0,j.c)(38),{busy:s,copiedKey:t,handlers:n,object:o,prefix:u,references:a,resolveUrl:r,selected:d,showReferences:h,t:f}=c,{copy:m,download:S,name:i,remove:x,toggle:y}=je(o,u,n),v;e[0]!==o||e[1]!==r?(v=(0,l.jsxDEV)(zt,{object:o,resolveUrl:r},void 0,!1),e[0]=o,e[1]=r,e[2]=v):v=e[2];let b;e[3]!==o.key||e[4]!==d||e[5]!==f||e[6]!==y?(b=(0,l.jsxDEV)("span",{className:"absolute left-1.5 top-1.5 rounded bg-background/80 p-0.5",children:(0,l.jsxDEV)(Ge,{objectKey:o.key,onToggle:y,selected:d,t:f},void 0,!1)},void 0,!1),e[3]=o.key,e[4]=d,e[5]=f,e[6]=y,e[7]=b):b=e[7];let k;e[8]!==v||e[9]!==b?(k=(0,l.jsxDEV)("div",{className:"relative",children:[v,b]},void 0,!0),e[8]=v,e[9]=b,e[10]=k):k=e[10];let w;e[11]!==i?(w=(0,l.jsxDEV)("p",{className:"truncate font-mono text-xs",title:i,children:i},void 0,!1),e[11]=i,e[12]=w):w=e[12];let T;e[13]!==o.size?(T=ve(o.size),e[13]=o.size,e[14]=T):T=e[14];let C;e[15]!==T?(C=(0,l.jsxDEV)("p",{className:"text-[11px] tabular-nums text-muted-foreground",children:T},void 0,!1),e[15]=T,e[16]=C):C=e[16];let N;e[17]!==o.key||e[18]!==a||e[19]!==h||e[20]!==f?(N=h&&(0,l.jsxDEV)("div",{className:"mt-1",children:(0,l.jsxDEV)(Me,{objectKey:o.key,references:a,t:f},void 0,!1)},void 0,!1),e[17]=o.key,e[18]=a,e[19]=h,e[20]=f,e[21]=N):N=e[21];let E;e[22]!==w||e[23]!==C||e[24]!==N?(E=(0,l.jsxDEV)("div",{className:"min-w-0",children:[w,C,N]},void 0,!0),e[22]=w,e[23]=C,e[24]=N,e[25]=E):E=e[25];let F=t===o.key,R;e[26]!==s||e[27]!==m||e[28]!==S||e[29]!==o.key||e[30]!==x||e[31]!==f||e[32]!==F?(R=(0,l.jsxDEV)("div",{className:"flex items-center gap-1",children:(0,l.jsxDEV)(Ue,{busy:s,buttonClassName:"h-7 px-2 text-xs",copied:F,objectKey:o.key,onCopy:m,onDelete:x,onDownload:S,t:f},void 0,!1)},void 0,!1),e[26]=s,e[27]=m,e[28]=S,e[29]=o.key,e[30]=x,e[31]=f,e[32]=F,e[33]=R):R=e[33];let D;return e[34]!==R||e[35]!==k||e[36]!==E?(D=(0,l.jsxDEV)("div",{className:"flex flex-col gap-1.5","data-testid":"fb-tile",children:[k,E,R]},void 0,!0),e[34]=R,e[35]=k,e[36]=E,e[37]=D):D=e[37],D},"GalleryTile"),Lt=g(c=>{let e=(0,j.c)(9),{name:s,onEnter:t}=c,n;e[0]!==s||e[1]!==t?(n=g(()=>{t(s)},"t1"),e[0]=s,e[1]=t,e[2]=n):n=e[2];let o=n,u;e[3]===Symbol.for("react.memo_cache_sentinel")?(u=(0,l.jsxDEV)("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,l.jsxDEV)("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,l.jsxDEV)("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"},void 0,!1)},void 0,!1)},void 0,!1),e[3]=u):u=e[3];let a;e[4]!==s?(a=(0,l.jsxDEV)("span",{className:"truncate font-mono text-xs",title:s,children:s},void 0,!1),e[4]=s,e[5]=a):a=e[5];let r;return e[6]!==o||e[7]!==a?(r=(0,l.jsxDEV)("button",{className:"flex flex-col gap-1.5 text-left outline-none","data-testid":"fb-folder",onClick:o,type:"button",children:[u,a]},void 0,!0),e[6]=o,e[7]=a,e[8]=r):r=e[8],r},"FolderTile"),Bt=g(c=>{let e=(0,j.c)(34),{busy:s,copiedKey:t,files:n,folders:o,handlers:u,onEnterFolder:a,prefix:r,references:d,resolveUrl:h,selected:f,showReferences:m,size:S,t:i}=c,x;e[0]!==S?(x=S.toString(),e[0]=S,e[1]=x):x=e[1];let y=`repeat(auto-fill, minmax(${x}px, 1fr))`,v;e[2]!==y?(v={gridTemplateColumns:y},e[2]=y,e[3]=v):v=e[3];let b=v,k;if(e[4]!==o||e[5]!==a){let C;e[7]!==a?(C=g(N=>(0,l.jsxDEV)(Lt,{name:N,onEnter:a},N,!1),"t52"),e[7]=a,e[8]=C):C=e[8],k=o.map(C),e[4]=o,e[5]=a,e[6]=k}else k=e[6];let w;if(e[9]!==s||e[10]!==t||e[11]!==n||e[12]!==u||e[13]!==r||e[14]!==d||e[15]!==h||e[16]!==f||e[17]!==m||e[18]!==i){let C;e[20]!==s||e[21]!==t||e[22]!==u||e[23]!==r||e[24]!==d||e[25]!==h||e[26]!==f||e[27]!==m||e[28]!==i?(C=g(N=>(0,l.jsxDEV)(Kt,{busy:s,copiedKey:t,handlers:u,object:N,prefix:r,references:d[N.key],resolveUrl:h,selected:f.has(N.key),showReferences:m,t:i},N.key,!1),"t62"),e[20]=s,e[21]=t,e[22]=u,e[23]=r,e[24]=d,e[25]=h,e[26]=f,e[27]=m,e[28]=i,e[29]=C):C=e[29],w=n.map(C),e[9]=s,e[10]=t,e[11]=n,e[12]=u,e[13]=r,e[14]=d,e[15]=h,e[16]=f,e[17]=m,e[18]=i,e[19]=w}else w=e[19];let T;return e[30]!==b||e[31]!==k||e[32]!==w?(T=(0,l.jsxDEV)("div",{className:"grid gap-4","data-testid":"fb-gallery",style:b,children:[k,w]},void 0,!0),e[30]=b,e[31]=k,e[32]=w,e[33]=T):T=e[33],T},"FileGallery"),It=g(c=>{let e=(0,j.c)(23),{reference:s,t}=c,n=`fb-dangling-${s.table}-${s.id}-${s.column}`,o=`${s.table}\xB7${s.id}`,u;e[0]!==o?(u=(0,l.jsxDEV)(ie,{variant:"secondary",children:o},void 0,!1),e[0]=o,e[1]=u):u=e[1];let a;e[2]!==s.column?(a=(0,l.jsxDEV)("span",{className:"text-muted-foreground",children:s.column},void 0,!1),e[2]=s.column,e[3]=a):a=e[3];let r;e[4]!==t?(r=t("\u2192"),e[4]=t,e[5]=r):r=e[5];let d;e[6]!==r?(d=(0,l.jsxDEV)("span",{className:"text-muted-foreground/60",children:r},void 0,!1),e[6]=r,e[7]=d):d=e[7];let h;e[8]!==s.key?(h=(0,l.jsxDEV)("code",{className:"rounded bg-muted px-1 py-0.5 font-mono text-foreground",children:s.key},void 0,!1),e[8]=s.key,e[9]=h):h=e[9];let f;e[10]!==u||e[11]!==a||e[12]!==d||e[13]!==h?(f=(0,l.jsxDEV)("span",{className:"flex flex-wrap items-center gap-1.5",children:[u,a,d,h]},void 0,!0),e[10]=u,e[11]=a,e[12]=d,e[13]=h,e[14]=f):f=e[14];let m;e[15]!==t?(m=t("Missing object"),e[15]=t,e[16]=m):m=e[16];let S;e[17]!==m?(S=(0,l.jsxDEV)(ie,{className:"border-destructive/40 text-destructive",variant:"outline",children:m},void 0,!1),e[17]=m,e[18]=S):S=e[18];let i;return e[19]!==n||e[20]!==S||e[21]!==f?(i=(0,l.jsxDEV)("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":n,children:[f,S]},void 0,!0),e[19]=n,e[20]=S,e[21]=f,e[22]=i):i=e[22],i},"DanglingRow"),Ot=g(c=>{let e=(0,j.c)(37),{busy:s,onCheck:t,references:n,t:o,truncated:u}=c,a;e[0]!==o?(a=o("Integrity"),e[0]=o,e[1]=a):a=e[1];let r;e[2]!==a?(r=(0,l.jsxDEV)("span",{className:"font-mono text-[11px] uppercase tracking-wide text-muted-foreground",children:a},void 0,!1),e[2]=a,e[3]=r):r=e[3];let d;e[4]!==o?(d=o("Orphaned objects"),e[4]=o,e[5]=d):d=e[5];let h;e[6]!==d?(h=(0,l.jsxDEV)("span",{className:"text-sm font-medium text-foreground",children:d},void 0,!1),e[6]=d,e[7]=h):h=e[7];let f;e[8]!==o?(f=o("Find records whose file reference points at an object the bucket no longer has."),e[8]=o,e[9]=f):f=e[9];let m;e[10]!==f?(m=(0,l.jsxDEV)("span",{className:"text-xs text-muted-foreground",children:f},void 0,!1),e[10]=f,e[11]=m):m=e[11];let S;e[12]!==r||e[13]!==h||e[14]!==m?(S=(0,l.jsxDEV)("div",{className:"flex flex-col gap-1",children:[r,h,m]},void 0,!0),e[12]=r,e[13]=h,e[14]=m,e[15]=S):S=e[15];let i;e[16]!==s||e[17]!==o?(i=o(s?"Checking\u2026":"Check for orphans"),e[16]=s,e[17]=o,e[18]=i):i=e[18];let x;e[19]!==s||e[20]!==t||e[21]!==i?(x=(0,l.jsxDEV)(se,{"data-testid":"fb-orphans-check",disabled:s,onClick:t,size:"sm",type:"button",variant:"outline",children:i},void 0,!1),e[19]=s,e[20]=t,e[21]=i,e[22]=x):x=e[22];let y;e[23]!==S||e[24]!==x?(y=(0,l.jsxDEV)("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[S,x]},void 0,!0),e[23]=S,e[24]=x,e[25]=y):y=e[25];let v;e[26]!==n?.length||e[27]!==o?(v=n?.length===0&&(0,l.jsxDEV)(me,{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.")},void 0,!1),e[26]=n?.length,e[27]=o,e[28]=v):v=e[28];let b;e[29]!==n||e[30]!==o||e[31]!==u?(b=n!==void 0&&n.length>0&&(0,l.jsxDEV)(l.Fragment,{children:[u&&(0,l.jsxDEV)("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:n.length})},void 0,!1),(0,l.jsxDEV)("ul",{className:"flex flex-col gap-1.5","data-testid":"fb-orphans-list",children:n.map(w=>(0,l.jsxDEV)(It,{reference:w,t:o},`${w.table}\xB7${w.id}\xB7${w.column}`,!1))},void 0,!1)]},void 0,!0),e[29]=n,e[30]=o,e[31]=u,e[32]=b):b=e[32];let k;return e[33]!==y||e[34]!==v||e[35]!==b?(k=(0,l.jsxDEV)("section",{className:"flex flex-col gap-2 rounded-lg border border-border/60 p-3","data-testid":"fb-orphans",children:[y,v,b]},void 0,!0),e[33]=y,e[34]=v,e[35]=b,e[36]=k):k=e[36],k},"OrphanedObjectsSection"),At=g(function(c,e){let s=(0,j.c)(18),t;s[0]===Symbol.for("react.memo_cache_sentinel")?(t=new Set,s[0]=t):t=s[0];let[n,o]=(0,_.useState)(t),u;s[1]===Symbol.for("react.memo_cache_sentinel")?(u=g(v=>{o(b=>{let k=new Set(b);return k.has(v)?k.delete(v):k.add(v),k})},"t1"),s[1]=u):u=s[1];let a=u,r;s[2]===Symbol.for("react.memo_cache_sentinel")?(r=g(()=>{o(new Set)},"t2"),s[2]=r):r=s[2];let d=r,h,f,m;if(s[3]!==c||s[4]!==e||s[5]!==n){let v;s[9]!==e?(v=g(b=>e(b),"t42"),s[9]=e,s[10]=v):v=s[10],f=c.map(v),h=f.length>0&&f.every(b=>n.has(b)),m=!h&&f.some(b=>n.has(b)),s[3]=c,s[4]=e,s[5]=n,s[6]=h,s[7]=f,s[8]=m}else h=s[6],f=s[7],m=s[8];let S=m,i;s[11]!==f?(i=g(()=>{o(v=>f.every(b=>v.has(b))?new Set:new Set(f))},"t4"),s[11]=f,s[12]=i):i=s[12];let x=i,y;return s[13]!==h||s[14]!==n||s[15]!==S||s[16]!==x?(y={allSelected:h,clear:d,selected:n,someSelected:S,toggle:a,toggleAll:x},s[13]=h,s[14]=n,s[15]=S,s[16]=x,s[17]=y):y=s[17],y},"useKeySelection"),jt=ge(be.storageReferences),Ut=ge(be.storageOrphans),Oe=1e4,Mt=1e3,Gt=3600,Ht=g((c,e)=>{if(!("document"in globalThis))return;let s=globalThis.document.createElement("a");s.href=c,s.download=e,s.rel="noopener",globalThis.document.body.append(s),s.click(),s.remove()},"triggerDownload"),Pt=g(({initialPrefix:c,pageSize:e})=>{let s=we(),[t,n]=(0,_.useState)(c??""),[o,u]=(0,_.useState)(c??""),[a,r]=(0,_.useState)(wt),[d,h]=(0,_.useState)("list"),[f,m]=(0,_.useState)(128),[S,i]=(0,_.useState)("name"),[x,y]=(0,_.useState)("asc"),[v,b]=(0,_.useState)(void 0),[k,w]=(0,_.useState)(void 0),[T,C]=(0,_.useState)(!1),[N,E]=(0,_.useState)(void 0),[F,R]=(0,_.useState)(void 0),[D,B]=(0,_.useState)(""),[I,K]=(0,_.useState)({}),[A,z]=(0,_.useState)(!1),[L,U]=(0,_.useState)(void 0),[M,P]=(0,_.useState)(!1),[G,q]=(0,_.useState)(!1),[Y,oe]=(0,_.useState)([]),[W,xe]=(0,_.useState)(""),re=(0,_.useRef)(0),J=(0,_.useRef)(0);(0,_.useEffect)(()=>{let p={cancelled:!1};return H((async()=>{try{let $=await s.listStorageBuckets();if(!p.cancelled){oe($);let[O]=$;O!==void 0&&xe(te=>te===""?O:te)}}catch{}})()),()=>{p.cancelled=!0}},[s]);let Z=(0,_.useMemo)(()=>({list:g(p=>s.listStorageObjects({...p,bucket:W}),"list"),remove:g(p=>s.deleteStorageObject(p,{bucket:W}),"remove"),signedUrl:g((p,$)=>s.signedStorageUrl(p,{...$,bucket:W}),"signedUrl"),upload:g(p=>s.uploadStorageObject({...p,bucket:W}),"upload")}),[W,s]),X=(0,_.useCallback)(async(p,$,O)=>{re.current+=1;let te=re.current;w(void 0),C(!0);try{let V=await Z.list({cursor:$,limit:e,prefix:p});if(te!==re.current)return;b(ce=>O&&ce!==void 0?[...ce,...V.objects]:V.objects),R(V.cursor)}catch(V){if(te!==re.current)return;O||b(void 0),w(Q(V))}finally{te===re.current&&C(!1)}},[e,Z]);(0,_.useEffect)(()=>{H(X(c??"",void 0,!1))},[X,c]);let He=(v?.length??0)<=e;Ke(()=>{H(X(t,void 0,!1))},He);let{files:fe,folders:Pe}=Nt(v??[],t),qe=(0,_.useMemo)(()=>{let p=new Set;for(let $ of fe)for(let O of Object.keys($.customMetadata??{}))p.add(O);return[...p].toSorted(($,O)=>$.localeCompare(O))},[fe]),ae=Ct(fe,S,x),ue=(0,_.useMemo)(()=>[...new Set(ae.map(p=>p.key))].toSorted((p,$)=>p.localeCompare($)).join(`
|
|
3
3
|
`),[ae]);(0,_.useEffect)(()=>{let p=ue===""?[]:ue.split(`
|
|
4
4
|
`);if(p.length===0){K({});return}let $={current:!0};return H((async()=>{try{let O=await s.query(jt,{keys:p},pe(D));$.current&&(K(O.references??{}),z(Object.keys(O.storageColumns??{}).length>0))}catch{$.current&&(K({}),z(!1))}})()),()=>{$.current=!1}},[s,ue,D]);let Ve=g(p=>p.key,"keyOf"),{allSelected:We,clear:ne,selected:ke,someSelected:Ze,toggle:Xe,toggleAll:Ye}=At(ae,Ve),Je=g(()=>{n(o),ne(),H(X(o,void 0,!1))},"listFirst"),Qe=g(()=>{H(X(t,F,!0))},"loadMore"),Se=g(p=>{n(p),u(p),ne(),H(X(p,void 0,!1))},"navigate"),et=g(p=>{Se(`${t}${p}`)},"enterFolder"),tt=g(p=>Z.signedUrl(p,{expiresInSeconds:Gt}),"resolveUrl"),st=g(()=>{h("list")},"showList"),lt=g(()=>{h("grid")},"showGrid"),ot=g(p=>{i(p)},"onSortKeyChange"),rt=g(()=>{y(p=>p==="asc"?"desc":"asc")},"toggleSortDirection"),nt=g(p=>{m(p)},"onThumbSizeChange"),it=g(p=>{r(p)},"onExpiryChange"),at=g(()=>{w(void 0),C(!0),H((async()=>{try{for(let p of ke)await Z.remove(p);await X(t,void 0,!1),ne()}catch(p){w(Q(p))}finally{C(!1)}})())},"bulkDelete"),ct=g(p=>{w(void 0),H((async()=>{try{let $=await Z.signedUrl(p,{expiresInSeconds:a});Ee($)&&E(p)}catch($){w(Q($))}})())},"onCopy"),dt=g(p=>{w(void 0),H((async()=>{try{let $=await Z.signedUrl(p,{expiresInSeconds:a}),O=p.slice(p.lastIndexOf("/")+1)||p;Ht($,O)}catch($){w(Q($))}})())},"onDownload");(0,_.useEffect)(()=>{if(N===void 0)return;let p=globalThis.setTimeout(()=>{E(void 0)},2e3);return()=>{globalThis.clearTimeout(p)}},[N]);let ft=g(p=>{w(void 0),C(!0),H((async()=>{try{await Z.remove(p),await X(t,void 0,!1)}catch($){w(Q($))}finally{C(!1)}})())},"onDelete"),ut=g(p=>{let $=`${t}${p.name}`;w(void 0),C(!0),H((async()=>{try{let O=await p.arrayBuffer();await Z.upload({body:O,contentType:p.type===""?void 0:p.type,key:$}),await X(t,void 0,!1)}catch(O){w(Q(O))}finally{C(!1)}})())},"onFile");(0,_.useEffect)(()=>{J.current+=1,U(void 0),q(!1)},[D]);let ht=g(()=>{J.current+=1;let p=J.current;w(void 0),P(!0),H((async()=>{try{let $=[],O;do{let V=await Z.list({cursor:O,limit:Mt});for(let ce of V.objects)$.push(ce.key);O=$.length>=Oe?void 0:V.cursor}while(O!==void 0);if($.length>=Oe)p===J.current&&(U([]),q(!0));else{let V=await s.query(Ut,{liveKeys:$},pe(D));p===J.current&&(U(V.references??[]),q(V.truncated===!0))}}catch($){p===J.current&&(U([]),q(!1),w(Q($)))}finally{p===J.current&&P(!1)}})())},"checkOrphans"),mt=g(p=>{re.current+=1,J.current+=1,xe(p),n(c??""),u(c??""),b(void 0),U(void 0),q(!1),ne()},"selectBucket");return{allSelected:We,bucket:W,buckets:Y,bulkDelete:at,busy:T,checkOrphans:ht,clearSelection:ne,copiedKey:N,danglingBusy:M,danglingReferences:L,danglingTruncated:G,draftPrefix:o,enterFolder:et,error:k,expiry:a,files:ae,folders:Pe,hasObjects:v!==void 0&&v.length>0,hasStorageColumns:A,listFirst:Je,loaded:v!==void 0,loadMore:Qe,navigate:Se,nextCursor:F,onCopy:ct,onDelete:ft,onDownload:dt,onExpiryChange:it,onFile:ut,onSortKeyChange:ot,onThumbSizeChange:nt,prefix:t,referenceShard:D,references:I,resolveUrl:tt,selectBucket:mt,selected:ke,setDraftPrefix:u,setReferenceShard:B,showGrid:lt,showList:st,someSelected:Ze,sortDirection:x,sortKey:S,tagKeys:qe,thumbSize:f,toggleSelect:Xe,toggleSelectAll:Ye,toggleSortDirection:rt,view:d}},"useFileBrowser"),qt=100,Ae=g(c=>{let e=(0,j.c)(6),{label:s,onNavigate:t,target:n}=c,o;e[0]!==t||e[1]!==n?(o=g(()=>{t(n)},"t1"),e[0]=t,e[1]=n,e[2]=o):o=e[2];let u=o,a;return e[3]!==u||e[4]!==s?(a=(0,l.jsxDEV)("button",{className:"rounded px-1 text-muted-foreground outline-none hover:text-foreground focus-visible:text-foreground",onClick:u,type:"button",children:s},void 0,!1),e[3]=u,e[4]=s,e[5]=a):a=e[5],a},"Crumb"),Vt=g(c=>{let e=(0,j.c)(11),{onNavigate:s,prefix:t,t:n}=c,o;if(e[0]!==s||e[1]!==t||e[2]!==n){let u=t.split("/").filter(Wt),a;e[4]!==n?(a=n("Folder path"),e[4]=n,e[5]=a):a=e[5];let r;e[6]!==n?(r=n("root"),e[6]=n,e[7]=r):r=e[7];let d;e[8]!==s||e[9]!==r?(d=(0,l.jsxDEV)(Ae,{label:r,onNavigate:s,target:""},void 0,!1),e[8]=s,e[9]=r,e[10]=d):d=e[10],o=(0,l.jsxDEV)("nav",{"aria-label":a,className:"flex flex-wrap items-center gap-0.5 text-xs","data-testid":"fb-breadcrumbs",children:[d,u.map((h,f)=>(0,l.jsxDEV)("span",{className:"flex items-center gap-0.5",children:[(0,l.jsxDEV)("span",{className:"text-muted-foreground/50",children:"/"},void 0,!1),(0,l.jsxDEV)(Ae,{label:h,onNavigate:s,target:`${u.slice(0,f+1).join("/")}/`},void 0,!1)]},`${h}-${f.toString()}`,!0))]},void 0,!0),e[0]=s,e[1]=t,e[2]=n,e[3]=o}else o=e[3];return o},"Breadcrumbs"),fs=g(({initialPrefix:c,pageSize:e=qt})=>{let s=Ce(),t=Pt({initialPrefix:c,pageSize:e}),n=(0,_.useRef)(null),{onCopy:o,onDelete:u,onDownload:a,onFile:r,toggleSelect:d}=t,h={onCopy:o,onDelete:u,onDownload:a,onToggleSelect:d},f=g(()=>{n.current?.click()},"onUploadClick"),m=g(i=>{let x=i.target,y=x.files?.[0];x.value="",y&&r(y)},"onFileChange"),S=t.loaded&&!t.hasObjects;return(0,l.jsxDEV)("div",{className:"flex flex-col gap-3","data-testid":"lunora-file-browser",children:[(0,l.jsxDEV)(Tt,{bucket:t.bucket,buckets:t.buckets,busy:t.busy,draftPrefix:t.draftPrefix,expiry:t.expiry,fileInputRef:n,onBucketChange:t.selectBucket,onExpiryChange:t.onExpiryChange,onFileChange:m,onList:t.listFirst,onPrefixChange:t.setDraftPrefix,onUploadClick:f,t:s},void 0,!1),t.loaded&&(0,l.jsxDEV)(Vt,{onNavigate:t.navigate,prefix:t.prefix,t:s},void 0,!1),t.hasObjects&&(0,l.jsxDEV)(_t,{onSortKeyChange:t.onSortKeyChange,onThumbSizeChange:t.onThumbSizeChange,showGrid:t.showGrid,showList:t.showList,sortDirection:t.sortDirection,sortKey:t.sortKey,t:s,tagKeys:t.tagKeys,thumbSize:t.thumbSize,toggleSortDirection:t.toggleSortDirection,view:t.view},void 0,!1),t.hasStorageColumns&&(0,l.jsxDEV)("div",{className:"flex flex-wrap items-center gap-2","data-testid":"fb-references-shard",children:[(0,l.jsxDEV)("label",{className:"text-xs text-muted-foreground",htmlFor:"fb-reference-shard-input",children:s("References shard")},void 0,!1),(0,l.jsxDEV)($e,{id:"fb-reference-shard-input",onChange:t.setReferenceShard,testId:"fb-reference-shard-input",value:t.referenceShard},void 0,!1),(0,l.jsxDEV)("span",{className:"text-xs text-muted-foreground",children:s("Which shard's records are checked for references to these files. Empty = root shard.")},void 0,!1)]},void 0,!0),t.hasStorageColumns&&(0,l.jsxDEV)(Ot,{busy:t.danglingBusy,onCheck:t.checkOrphans,references:t.danglingReferences,t:s,truncated:t.danglingTruncated},void 0,!1),t.selected.size>0&&(0,l.jsxDEV)(Le,{count:t.selected.size,editable:!0,onClear:t.clearSelection,onDelete:t.bulkDelete},void 0,!1),t.error!==void 0&&(0,l.jsxDEV)("p",{className:"text-sm text-destructive","data-testid":"storage-error",role:"alert",children:t.error},void 0,!1),S&&(0,l.jsxDEV)(me,{description:s("Objects you upload to your R2 buckets will appear here."),icon:(0,l.jsxDEV)("svg",{"aria-hidden":"true",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:1.6,viewBox:"0 0 24 24",children:[(0,l.jsxDEV)("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"},void 0,!1),(0,l.jsxDEV)("path",{d:"M12 11v5m-2.5-2.5h5"},void 0,!1)]},void 0,!0),testId:"fb-empty",title:s("No objects.")},void 0,!1),t.hasObjects&&t.view==="list"&&(0,l.jsxDEV)(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:s,toggleSelectAll:t.toggleSelectAll},void 0,!1),t.hasObjects&&t.view==="grid"&&(0,l.jsxDEV)(Bt,{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:s},void 0,!1),t.nextCursor!==void 0&&(0,l.jsxDEV)("div",{children:(0,l.jsxDEV)(se,{"data-testid":"fb-next",disabled:t.busy,onClick:t.loadMore,size:"sm",type:"button",variant:"outline",children:s("Load more")},void 0,!1)},void 0,!1)]},void 0,!0)},"FileBrowser");function Wt(c){return c!==""}g(Wt,"_temp");export{fs as FileBrowser};
|