astronaut-cms 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. package/dist/admin/THIRD_PARTY_LICENSES.md +88 -40
  2. package/dist/admin/assets/assistant-DTlSNidc.js +235 -0
  3. package/dist/admin/assets/badge-BfN73-be.js +1 -0
  4. package/dist/admin/assets/changes-h1lmD7AA.js +1 -0
  5. package/dist/admin/assets/client-B4PWCmC4.js +5 -0
  6. package/dist/admin/assets/{collapsible-item-UaoJaaPw.js → collapsible-item-zlnNAUdM.js} +1 -1
  7. package/dist/admin/assets/{collapsible-B6P_J0Bg.js → collapsible-mcJ6G3X4.js} +1 -1
  8. package/dist/admin/assets/{collections._collection-BE1enDCq.js → collections._collection-D-rC9E9v.js} +1 -1
  9. package/dist/admin/assets/{collections._collection._entry-D3UksnCo.js → collections._collection._entry-UD8hLmC1.js} +33 -33
  10. package/dist/admin/assets/collections._collection.index-Cgc93hCD.js +1 -0
  11. package/dist/admin/assets/component-lookup-8lVQh8pl.js +4 -0
  12. package/dist/admin/assets/{copy-DezZzPMV.js → copy-DxuErr3x.js} +1 -1
  13. package/dist/admin/assets/{dist-UbA1s2kM.js → dist-DVv3ALC7.js} +1 -1
  14. package/dist/admin/assets/{dist-DzkcSBZl.js → dist-Dpyc1riS.js} +1 -1
  15. package/dist/admin/assets/editor-BauN0yXd.js +2 -0
  16. package/dist/admin/assets/{empty-DSBYiI_7.js → empty-DAOUBpWb.js} +1 -1
  17. package/dist/admin/assets/{entry-link-CQLN2Zpf.js → entry-link-DhcL6M5c.js} +19 -19
  18. package/dist/admin/assets/{error-banner-yskeRXe8.js → error-banner-CNWZU5u_.js} +93 -91
  19. package/dist/admin/assets/{field-BDK5tt3J.js → field-CbbZZGxO.js} +2 -2
  20. package/dist/admin/assets/{file-text-BzBif8ui.js → file-text-Ciz5Mr4S.js} +1 -1
  21. package/dist/admin/assets/{highlighted-body-JLMTFACH-CIQujGv2.js → highlighted-body-JLMTFACH-D1bycIV3.js} +1 -1
  22. package/dist/admin/assets/{lib-CMURo-7A.js → lib-CC_S4yjQ.js} +9 -9
  23. package/dist/admin/assets/{library-Cr3f75Es.js → library-Da82FNwp.js} +1 -1
  24. package/dist/admin/assets/{list-skeleton-BdTNfVXs.js → list-skeleton-BXLP4Fak.js} +1 -1
  25. package/dist/admin/assets/matchContext-BjW1F-Cq.js +2 -0
  26. package/dist/admin/assets/media-browser-DeKpWCUD.js +1 -0
  27. package/dist/admin/assets/media._library-DGnXJc0I.js +1 -0
  28. package/dist/admin/assets/mermaid-WFAXDIZX-CqFnahFh.js +1 -0
  29. package/dist/admin/assets/page-header-C2Uwa_yv.js +1 -0
  30. package/dist/admin/assets/pdf-BSEX-sd8.js +106 -0
  31. package/dist/admin/assets/{react-kbcsfQYH.js → react-CXnqG51l.js} +1 -1
  32. package/dist/admin/assets/{routes-CBt04sNR.js → routes-Bx9rPcHA.js} +1 -1
  33. package/dist/admin/assets/save-actions-DrVgh3KH.js +32 -0
  34. package/dist/admin/assets/{select-Bv2EoLhN.js → select-CMV39q80.js} +1 -1
  35. package/dist/admin/assets/separator-C9bNKNSU.js +3 -0
  36. package/dist/admin/assets/{skeleton-CKiqTaRh.js → skeleton-DTwTUSqm.js} +1 -1
  37. package/dist/admin/assets/syntax-DDPd1mQn.js +8 -0
  38. package/dist/admin/assets/{toggle-Y2UpJZyU.js → toggle-B6ASf-kL.js} +1 -1
  39. package/dist/admin/assets/{ui.module.css-WaO_77ml.js → ui.module.css-BdAmwQeM.js} +29 -29
  40. package/dist/admin/assets/{use-entries-B2lsaiK9.js → use-entries-CrNqaMfa.js} +1 -1
  41. package/dist/admin/assets/useSelector-Cs39W18m.js +1 -0
  42. package/dist/admin/bootstrap.js +1 -1
  43. package/dist/admin/editor.d.ts +1009 -1
  44. package/dist/admin/editor.js +1 -1
  45. package/dist/server/THIRD_PARTY_LICENSES.md +49 -0
  46. package/dist/server/assets.d.ts +28 -0
  47. package/dist/server/chunks/config-BsOYly9a.d.ts +1210 -0
  48. package/dist/server/chunks/{digest-BYzWNJea.js → digest-tkKu_Wj5.js} +3 -3
  49. package/dist/server/chunks/{entry-checks-CKMag1G4.js → entry-checks-3SxhoHwH.js} +1 -1
  50. package/dist/server/chunks/{types-DOR5XaJO.js → types-DkkewFTT.js} +32 -11
  51. package/dist/server/chunks/{types-DwA-C6Br.d.ts → types-Jew_-Qpp.d.ts} +8 -1
  52. package/dist/server/chunks/{user-config-DoypbpQf.js → user-config-CqNK-Ebs.js} +13 -4
  53. package/dist/server/config.d.ts +3 -3
  54. package/dist/server/config.js +5 -1
  55. package/dist/server/content.d.ts +10 -0
  56. package/dist/server/content.js +2 -8
  57. package/dist/server/endpoint.d.ts +5 -0
  58. package/dist/server/endpoint.js +28 -14
  59. package/dist/server/integration.d.ts +2 -2
  60. package/dist/server/integration.js +29 -16
  61. package/dist/server/internal.d.ts +39 -4
  62. package/dist/server/internal.js +2 -2
  63. package/dist/server/server-local.d.ts +1 -1
  64. package/dist/server/server-local.js +2 -2
  65. package/dist/styles/THIRD_PARTY_LICENSES.md +2 -2
  66. package/dist/styles/styles.css +2 -2
  67. package/package.json +4 -4
  68. package/dist/admin/assets/assistant-DkS355co.js +0 -201
  69. package/dist/admin/assets/badge-BXsOvOPX.js +0 -1
  70. package/dist/admin/assets/changes-Ba0G_GN1.js +0 -1
  71. package/dist/admin/assets/client-VKp75fDU.js +0 -5
  72. package/dist/admin/assets/collections._collection.index-BN5d8UIY.js +0 -1
  73. package/dist/admin/assets/component-lookup-CUCiK8Xh.js +0 -4
  74. package/dist/admin/assets/editor-FGqMznBK.js +0 -2
  75. package/dist/admin/assets/matchContext-Bq5Es9aD.js +0 -2
  76. package/dist/admin/assets/media-browser-9-CPTCks.js +0 -1
  77. package/dist/admin/assets/media._library-BfFaEZLR.js +0 -1
  78. package/dist/admin/assets/mermaid-WFAXDIZX-CJ3hhA0i.js +0 -1
  79. package/dist/admin/assets/page-header-B4nvAsVA.js +0 -1
  80. package/dist/admin/assets/pdf-DgessaF0.js +0 -106
  81. package/dist/admin/assets/save-actions-Cz0TkpcP.js +0 -32
  82. package/dist/admin/assets/separator-DlYj_PoQ.js +0 -3
  83. package/dist/admin/assets/syntax-BAXqRKRO.js +0 -8
  84. package/dist/admin/assets/useSelector-CWr3iU9K.js +0 -1
  85. package/dist/server/chunks/config-WQqG4mNH.d.ts +0 -193
@@ -0,0 +1 @@
1
+ import{t as e}from"./config-Pm_BHLNT.js";import{t}from"./errors-DkJ5E_ak.js";import{A as n,An as r,Mn as i,N as a,Nn as o,Pn as s,U as c,V as l,W as u,_ as d,a as f,c as p,j as m,jn as h,kn as g,n as _,u as v,v as y}from"./error-banner-CNWZU5u_.js";import{_ as b,a as x,d as S,i as C,m as w,o as T,p as ee,r as E}from"./separator-C9bNKNSU.js";import{A as D,D as te,K as ne,L as re,R as ie,U as ae,V as oe,W as se,dt as ce,et as le,f as ue,g as de,gt as fe,ht as pe,i as me,l as he,mt as ge,nt as _e,o as ve,p as ye,pt as be,r as xe,rt as Se,t as Ce,u as we,ut as Te}from"./field-CbbZZGxO.js";import{E as Ee,T as De,_ as Oe,d as ke,f as O,h as Ae,i as k,n as je,r as Me,v as Ne,y as Pe}from"./matchContext-BjW1F-Cq.js";import{t as Fe}from"./useSelector-Cs39W18m.js";import{t as A}from"./skeleton-DTwTUSqm.js";import*as j from"react";import Ie,{Fragment as Le,useId as Re,useState as M}from"react";import{Fragment as ze,jsx as N,jsxs as P}from"react/jsx-runtime";var Be=Object.defineProperty,F=(e,t)=>Be(e,`name`,{value:t,configurable:!0}),I=`Dialog`,[Ve,He]=i(I),[Ue,L]=Ve(I),R=/* @__PURE__ */ F(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=j.useRef(null),c=j.useRef(null),{nodes:l,registry:u}=be(),[d,f]=g({prop:r,defaultProp:i??!1,onChange:a,caller:I}),[p,m]=j.useState(0),[_,v]=j.useState(0);return/* @__PURE__ */ N(Ue,{scope:t,triggerRef:s,contentRef:c,contentId:h(),titleId:h(),descriptionId:h(),titlePresent:p>0,descriptionPresent:_>0,setTitleCount:m,setDescriptionCount:v,open:d,onOpenChange:f,onOpenToggle:j.useCallback(()=>f(e=>!e),[f]),modal:o,branchNodes:l,branchRegistry:u,children:n})},`Dialog`),We=`DialogTrigger`,Ge=/* @__PURE__ */ j.forwardRef(/* @__PURE__ */ F(function(e,t){let{__scopeDialog:n,...r}=e,i=L(We,n),a=b(t,i.triggerRef);return/* @__PURE__ */ N(S.button,{type:`button`,"aria-haspopup":`dialog`,"aria-expanded":i.open,"aria-controls":i.open?i.contentId:void 0,"data-state":K(i.open),...r,ref:a,onClick:o(e.onClick,i.onOpenToggle)})},`DialogTrigger`)),Ke=`DialogPortal`,[qe,Je]=Ve(Ke,{forceMount:void 0}),z=/* @__PURE__ */ F(e=>{let{__scopeDialog:t,forceMount:n,children:i,container:a}=e,o=L(Ke,t);return/* @__PURE__ */ N(qe,{scope:t,forceMount:n,children:j.Children.map(i,e=>/* @__PURE__ */ N(r,{present:n||o.open,children:/* @__PURE__ */ N(Se,{asChild:!0,container:a,children:e})}))})},`DialogPortal`),Ye=`DialogOverlay`,B=/* @__PURE__ */ j.forwardRef(/* @__PURE__ */ F(function(e,t){let n=Je(Ye,e.__scopeDialog),{forceMount:i=n.forceMount,...a}=e,o=L(Ye,e.__scopeDialog);return o.modal?/* @__PURE__ */ N(r,{present:i||o.open,children:/* @__PURE__ */ N(Ze,{...a,ref:t})}):null},`DialogOverlay`)),Xe=w(`DialogOverlay.RemoveScroll`),Ze=/* @__PURE__ */ j.forwardRef(/* @__PURE__ */ F(function(e,t){let{__scopeDialog:n,...r}=e,i=L(Ye,n),a=fe(),o=b(t,a);return/* @__PURE__ */ N(le,{as:Xe,allowPinchZoom:!0,shards:j.useMemo(()=>[i.contentRef,...i.branchNodes.map(e=>({current:e}))],[i.contentRef,i.branchNodes]),children:/* @__PURE__ */ N(S.div,{"data-state":K(i.open),...r,ref:o,style:{pointerEvents:`auto`,...r.style}})})},`DialogOverlayImpl`)),V=`DialogContent`,H=/* @__PURE__ */ j.forwardRef(/* @__PURE__ */ F(function(e,t){let n=Je(V,e.__scopeDialog),{forceMount:i=n.forceMount,...a}=e,o=L(V,e.__scopeDialog);return/* @__PURE__ */ N(r,{present:i||o.open,children:o.modal?/* @__PURE__ */ N(Qe,{...a,ref:t}):/* @__PURE__ */ N($e,{...a,ref:t})})},`DialogContent`)),Qe=/* @__PURE__ */ j.forwardRef(/* @__PURE__ */ F(function(e,t){let n=L(V,e.__scopeDialog),r=j.useRef(null),i=b(t,n.contentRef,r);return j.useEffect(()=>{let e=r.current;if(e)return _e(e)},[]),/* @__PURE__ */ N(et,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:o(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:o(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:o(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),$e=/* @__PURE__ */ j.forwardRef(/* @__PURE__ */ F(function(e,t){let n=L(V,e.__scopeDialog),r=j.useRef(!1),i=j.useRef(!1);return/* @__PURE__ */ N(et,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`DialogContentNonModal`)),et=/* @__PURE__ */ j.forwardRef(/* @__PURE__ */ F(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,"aria-describedby":o,children:s,...c}=e,l=L(V,n);return ge(),/* @__PURE__ */ N(ce,{registry:l.branchRegistry,children:/* @__PURE__ */ N(Te,{asChild:!0,loop:!0,trapped:r,branches:l.branchNodes,onMountAutoFocus:i,onUnmountAutoFocus:a,children:/* @__PURE__ */ N(pe,{role:`dialog`,id:l.contentId,"aria-labelledby":l.titlePresent?l.titleId:void 0,"aria-describedby":l.descriptionPresent?nt(o,l.descriptionId):o,"data-state":K(l.open),...c,ref:t,deferPointerDownOutside:!0,onDismiss:()=>l.onOpenChange(!1),children:s})})})},`DialogContentImpl`)),U=/* @__PURE__ */ j.forwardRef(/* @__PURE__ */ F(function(e,t){let{__scopeDialog:n,...r}=e,i=L(`DialogTitle`,n),{setTitleCount:a}=i;return s(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),/* @__PURE__ */ N(S.h2,{id:i.titleId,...r,ref:t})},`DialogTitle`)),W=/* @__PURE__ */ j.forwardRef(/* @__PURE__ */ F(function(e,t){let{__scopeDialog:n,...r}=e,i=L(`DialogDescription`,n),{setDescriptionCount:a}=i;return s(()=>(a(e=>e+1),()=>a(e=>e-1)),[a]),/* @__PURE__ */ N(S.p,{id:i.descriptionId,...r,ref:t})},`DialogDescription`)),tt=`DialogClose`,G=/* @__PURE__ */ j.forwardRef(/* @__PURE__ */ F(function(e,t){let{__scopeDialog:n,...r}=e,i=L(tt,n);return/* @__PURE__ */ N(S.button,{type:`button`,...r,ref:t,onClick:o(e.onClick,()=>i.onOpenChange(!1))})},`DialogClose`));function nt(...e){let t=/* @__PURE__ */ new Set;for(let n of e)if(typeof n==`string`)for(let e of String(n).trim().split(/\s+/))e&&t.add(e);return t.size>0?Array.from(t).join(` `):void 0}F(nt,`concatAriaDescribedby`);function K(e){return e?`open`:`closed`}F(K,`getState`);var rt=j.use,it=j.useLayoutEffect,at=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=e=>{this.originalIndex=e,this._branch=void 0;let t=this.options,n=!t?.path&&!t?.id;if(this.parentRoute=this.options.getParentRoute?.(),n)this._path=O;else if(!this.parentRoute){if(process.env.NODE_ENV!==`production`)throw Error(`Invariant failed: Child Route instances must pass a 'getParentRoute: () => ParentRoute' option that returns a Route instance.`);Pe()}let r=n?O:t?.path;r&&r!==`/`&&(r=Oe(r));let i=t?.id||r,a=n?O:Ae((this.parentRoute.id===`__root__`?``:this.parentRoute.id)+`/`+(i??``));r===`__root__`&&(r=`/`);let o=a===`__root__`?`/`:r===void 0?this.parentRoute.fullPath:Ae(this.parentRoute.fullPath+`/`+r);this._path=r,this._id=a,this._fullPath=o,this._to=Ne(o)},this.addChildren=e=>this._addFileChildren(e),this._addFileChildren=e=>(Array.isArray(e)&&(this.children=e),typeof e==`object`&&e&&(this.children=Object.values(e)),this),this._addFileTypes=()=>this,this.updateLoader=e=>(Object.assign(this.options,e),this),this.update=e=>(Object.assign(this.options,e),this),this.lazy=e=>(this.lazyFn=e,this),this.redirect=e=>ke({from:this.fullPath,...e}),this.options=e||{},this.isRoot=!e?.getParentRoute,e?.id&&e?.path)throw Error(`Route cannot have both an 'id' and a 'path' option.`)}},ot=class extends at{constructor(e){super(e)}},st={};function ct(e,t){let n=j.useRef();return r=>{let i=e?.select?e.select(r):r;return e?.structuralSharing??t.options.defaultStructuralSharing?n.current=Ee(n.current,i):i}}function q(e){let t=k(),n=j.useContext(e.from?je:Me),r=e.from??n,i=t.stores.getMatchStore(r),a=ct(e,t),o=Fe(i,e=>e?a(e):st);if(o!==st)return o;if(e.shouldThrow??!0){if(process.env.NODE_ENV!==`production`)throw Error(`Invariant failed: Could not find ${e.from?`an active match from "${e.from}"`:`a nearest match!`}`);Pe()}}function lt(e){return q({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function ut(e){let{select:t,...n}=e;return q({...n,select:e=>t?t(e.loaderDeps):e.loaderDeps})}function J(e){return q({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{let n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function Y(e){return q({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function X(e){let t=k();return j.useCallback(n=>t.navigate({...n,from:n.from??e?.from}),[e?.from,t])}function dt(e){let t=k(),n=X(),r=j.useRef(null);return it(()=>{r.current!==e&&(n(e),r.current=e)},[t,e,n]),null}function ft(e){return q({...e,select:t=>e.select?e.select(t.context):t.context})}var pt=class extends at{constructor(e){super(e),this.useMatch=e=>q({...e,from:this.id}),this.useRouteContext=e=>ft({...e,from:this.id}),this.useSearch=e=>Y({...e,from:this.id}),this.useParams=e=>J({...e,from:this.id}),this.useLoaderDeps=e=>ut({...e,from:this.id}),this.useLoaderData=e=>lt({...e,from:this.id}),this.useNavigate=()=>X({from:this.fullPath}),this.Link=Ie.forwardRef((e,t)=>/* @__PURE__ */ N(x,{ref:t,from:this.fullPath,...e}))}};function mt(e){return new pt(e)}var ht=class extends ot{constructor(e){super(e),this.useMatch=e=>q({...e,from:this.id}),this.useRouteContext=e=>ft({...e,from:this.id}),this.useSearch=e=>Y({...e,from:this.id}),this.useParams=e=>J({...e,from:this.id}),this.useLoaderDeps=e=>ut({...e,from:this.id}),this.useLoaderData=e=>lt({...e,from:this.id}),this.useNavigate=()=>X({from:this.fullPath}),this.Link=Ie.forwardRef((e,t)=>/* @__PURE__ */ N(x,{ref:t,from:this.fullPath,...e}))}};function gt(e){return new ht(e)}function _t(e){return e=>{let t=mt(e);return t.isRoot=!1,t}}function vt(e,t){let n,r,i,a=()=>(n||=(i=void 0,e().then(e=>{n=void 0,o.preload=void 0,r=e[t??`default`]}).catch(e=>{n=void 0,i=e})),n),o=function(e){if(i){if(De(i)&&typeof sessionStorage<`u`){let e=`tanstack_router_reload:${i.message}`;if(!sessionStorage.getItem(e))throw sessionStorage.setItem(e,`1`),window.location.reload(),new Promise(()=>{})}throw i}if(!r){if(rt)rt(a());else throw a()}return j.createElement(r,e)};return o.preload=a,o}var yt=Object.defineProperty,Z=(e,t)=>yt(e,`name`,{value:t,configurable:!0}),[bt,xt]=i(`AlertDialog`,[He]),Q=He(),St=/* @__PURE__ */ Z(e=>{let{__scopeAlertDialog:t,...n}=e,r=Q(t);return/* @__PURE__ */ N(R,{...r,...n,modal:!0})},`AlertDialog`);j.forwardRef(/* @__PURE__ */ Z(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=Q(n);return/* @__PURE__ */ N(Ge,{...i,...r,ref:t})},`AlertDialogTrigger`));var Ct=/* @__PURE__ */ Z(e=>{let{__scopeAlertDialog:t,...n}=e,r=Q(t);return/* @__PURE__ */ N(z,{...r,...n})},`AlertDialogPortal`),wt=j.forwardRef(/* @__PURE__ */ Z(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=Q(n);return/* @__PURE__ */ N(B,{...i,...r,ref:t})},`AlertDialogOverlay`)),[Tt,Et]=bt(`AlertDialogContent`),Dt=j.forwardRef(/* @__PURE__ */ Z(function(e,t){let{__scopeAlertDialog:n,children:r,...i}=e,a=Q(n),s=j.useRef(null),c=b(t,s),l=j.useRef(null);return/* @__PURE__ */ N(Tt,{scope:n,cancelRef:l,children:/* @__PURE__ */ N(H,{role:`alertdialog`,...a,...i,ref:c,onOpenAutoFocus:o(i.onOpenAutoFocus,e=>{e.preventDefault(),l.current?.focus({preventScroll:!0})}),onPointerDownOutside:e=>e.preventDefault(),onInteractOutside:e=>e.preventDefault(),children:r})})},`AlertDialogContent`)),Ot=j.forwardRef(/* @__PURE__ */ Z(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=Q(n);return/* @__PURE__ */ N(U,{...i,...r,ref:t})},`AlertDialogTitle`)),kt=j.forwardRef(/* @__PURE__ */ Z(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=Q(n);return/* @__PURE__ */ N(W,{...i,...r,ref:t})},`AlertDialogDescription`)),At=j.forwardRef(/* @__PURE__ */ Z(function(e,t){let{__scopeAlertDialog:n,...r}=e,i=Q(n);return/* @__PURE__ */ N(G,{...i,...r,ref:t})},`AlertDialogAction`)),jt=`AlertDialogCancel`,Mt=j.forwardRef(/* @__PURE__ */ Z(function(e,t){let{__scopeAlertDialog:n,...r}=e,{cancelRef:i}=Et(jt,n),a=Q(n),o=b(t,i);return/* @__PURE__ */ N(G,{...a,...r,ref:o})},`AlertDialogCancel`)),Nt={name:`folder`,size:24,node:[[`path`,{d:`M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z`,key:`1kt360`}]]};Nt.node;var Pt=E(Nt);function Ft(e){let t=e.lastIndexOf(`/`);return t===-1?``:e.slice(0,t)}function It(e){if(!e)return[];let t=``;return e.split(`/`).map(e=>(t=t?`${t}/${e}`:e,{name:e,path:t}))}function Lt(e,t,n,r=v(p)){let i=t?`${t}/`:``,a=/* @__PURE__ */ new Set,o=[];for(let t of e){if(!n(t).startsWith(i))continue;let e=n(t).slice(i.length),r=e.indexOf(`/`);r===-1?o.push(t):a.add(e.slice(0,r))}return{folders:[...a].sort(r).map(e=>({name:e,path:`${i}${e}`})),files:o}}function Rt({className:e,...t}){return/* @__PURE__ */ N(`nav`,{"aria-label":`breadcrumb`,"data-slot":`breadcrumb`,className:C(e),...t})}function zt({className:e,...t}){return/* @__PURE__ */ N(`ol`,{"data-slot":`breadcrumb-list`,className:C(`flex flex-wrap items-center gap-1.5 text-sm wrap-break-word text-muted-foreground`,e),...t})}function $({className:e,...t}){return/* @__PURE__ */ N(`li`,{"data-slot":`breadcrumb-item`,className:C(`inline-flex items-center gap-1`,e),...t})}function Bt({asChild:e,className:t,...n}){return/* @__PURE__ */ N(e?ee:`a`,{"data-slot":`breadcrumb-link`,className:C(`transition-colors hover:text-foreground`,t),...n})}function Vt({className:e,...t}){return/* @__PURE__ */ N(`span`,{"data-slot":`breadcrumb-page`,role:`link`,"aria-disabled":`true`,"aria-current":`page`,className:C(`font-normal text-foreground`,e),...t})}function Ht({children:e,className:t,...n}){return/* @__PURE__ */ N(`li`,{"data-slot":`breadcrumb-separator`,role:`presentation`,"aria-hidden":`true`,className:C(`[&>svg]:size-3.5`,t),...n,children:e??/* @__PURE__ */ N(f,{})})}function Ut(){let{t:e}=T();return n=>d(n)?e(e=>e.publish.mergeConflict):y(n)?e(e=>e.entry.staleWrite):t(n)}function Wt(){let e=Ut();return(t,n,{success:r,onSuccess:i,describeError:a}={})=>{t.mutate(n,{onSuccess:e=>{i?.(e),r&&D(r,`success`)},onError:t=>D(a?.(t)??e(t),`error`)})}}function Gt({...e}){return/* @__PURE__ */ N(St,{"data-slot":`alert-dialog`,...e})}function Kt({...e}){return/* @__PURE__ */ N(Ct,{"data-slot":`alert-dialog-portal`,...e})}function qt({className:e,...t}){return/* @__PURE__ */ N(wt,{"data-slot":`alert-dialog-overlay`,className:C(`fixed inset-0 z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,e),...t})}function Jt({className:e,size:t=`default`,...n}){return/* @__PURE__ */ P(Kt,{children:[/* @__PURE__ */ N(qt,{}),/* @__PURE__ */ N(Dt,{"data-slot":`alert-dialog-content`,"data-size":t,className:C(`group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...n})]})}function Yt({className:e,...t}){return/* @__PURE__ */ N(`div`,{"data-slot":`alert-dialog-header`,className:C(`grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-4 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]`,e),...t})}function Xt({className:e,...t}){return/* @__PURE__ */ N(`div`,{"data-slot":`alert-dialog-footer`,className:C(`-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end`,e),...t})}function Zt({className:e,...t}){return/* @__PURE__ */ N(Ot,{"data-slot":`alert-dialog-title`,className:C(`font-heading text-base font-medium sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2`,e),...t})}function Qt({className:e,...t}){return/* @__PURE__ */ N(kt,{"data-slot":`alert-dialog-description`,className:C(`text-sm text-balance text-muted-foreground md:text-pretty *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground`,e),...t})}function $t({className:e,variant:t=`default`,size:n=`default`,...r}){return/* @__PURE__ */ N(_,{variant:t,size:n,asChild:!0,children:/* @__PURE__ */ N(At,{"data-slot":`alert-dialog-action`,className:C(e),...r})})}function en({className:e,variant:t=`outline`,size:n=`default`,...r}){return/* @__PURE__ */ N(_,{variant:t,size:n,asChild:!0,children:/* @__PURE__ */ N(Mt,{"data-slot":`alert-dialog-cancel`,className:C(e),...r})})}function tn({open:e,title:t,description:n,confirmLabel:r,pendingLabel:i,isPending:a=!1,variant:o=`default`,disabled:s=!1,onConfirm:c,onCancel:l}){let{t:u}=T();return/* @__PURE__ */ N(Gt,{open:e,onOpenChange:e=>{e||l()},children:/* @__PURE__ */ P(Jt,{children:[/* @__PURE__ */ P(Yt,{children:[/* @__PURE__ */ N(Zt,{children:t}),/* @__PURE__ */ N(Qt,{asChild:!0,children:/* @__PURE__ */ N(`div`,{children:n})})]}),/* @__PURE__ */ P(Xt,{children:[/* @__PURE__ */ N(en,{children:u(e=>e.common.cancel)}),/* @__PURE__ */ N($t,{onClick:e=>{e.preventDefault(),c()},disabled:s||a,variant:o,children:a&&i?i:r??u(e=>e.common.confirm)})]})]})})}var nn=/^[\p{L}\p{M}\p{N}_-]+$/u;function rn(e,t=!0){return e?(t?e.split(`/`):[e]).every(e=>nn.test(e))?null:t?`nestedCharacters`:`characters`:`empty`}function an(e){return e?e.startsWith(`/`)||/\\|\p{Cc}/u.test(e)?`absolute`:e.split(`/`).some(e=>e===``||e===`.`||e===`..`)?`segments`:null:`empty`}function on(){let{t:e}=T(),t=(t,n,r)=>{switch(t){case`empty`:return e(e=>e.validation.empty);case`characters`:return e(e=>e.validation.characters);case`nestedCharacters`:return e(e=>e.validation.nestedCharacters);case`absolute`:return e(e=>e.validation.absolute);case`segments`:return e(e=>e.validation.segments);case null:return r?.(n)?e(e=>e.validation.exists,{name:n}):null}};return{id:(e,n,r)=>t(rn(e,n),e,r),media:(e,n)=>t(an(e),e,n)}}function sn({className:e,size:t=`default`,...n}){return/* @__PURE__ */ N(`div`,{"data-slot":`card`,"data-size":t,className:C(`group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-xl bg-card py-(--card-spacing) text-sm text-card-foreground ring-1 ring-foreground/10 [--card-spacing:--spacing(4)] has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(3)] data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-t-xl *:[img:last-child]:rounded-b-xl`,e),...n})}function cn({className:e,...t}){return/* @__PURE__ */ N(`div`,{"data-slot":`card-content`,className:C(`px-(--card-spacing)`,e),...t})}function ln({library:e,file:t,className:n}){let{path:r}=t,i=m(r),a=ie({library:e,path:r},t.version),o=e=>{e.currentTarget.style.display=`none`};return i===`video`?/* @__PURE__ */ N(`video`,{src:a,className:n,preload:`metadata`,muted:!0,onError:o}):i===`image`?/* @__PURE__ */ N(`img`,{src:a,alt:``,className:n,onError:o}):/* @__PURE__ */ N(`span`,{className:`text-lg font-medium text-muted-foreground`,children:c(r).slice(1).toUpperCase()})}function un({...e}){return/* @__PURE__ */ N(R,{"data-slot":`dialog`,...e})}function dn({...e}){return/* @__PURE__ */ N(z,{"data-slot":`dialog-portal`,...e})}function fn({className:e,...t}){return/* @__PURE__ */ N(B,{"data-slot":`dialog-overlay`,className:C(`fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0`,e),...t})}function pn({className:e,children:t,showCloseButton:n=!0,...r}){return/* @__PURE__ */ P(dn,{children:[/* @__PURE__ */ N(fn,{}),/* @__PURE__ */ P(H,{"data-slot":`dialog-content`,className:C(`fixed top-1/2 left-1/2 z-50 grid w-full max-w-[calc(100%-2rem)] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-sm text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,e),...r,children:[t,n&&/* @__PURE__ */ N(G,{"data-slot":`dialog-close`,asChild:!0,children:/* @__PURE__ */ P(_,{variant:`ghost`,className:`absolute top-2 right-2`,size:`icon-sm`,children:[/* @__PURE__ */ N(oe,{}),/* @__PURE__ */ N(`span`,{className:`sr-only`,children:`Close`})]})})]})]})}function mn({className:e,...t}){return/* @__PURE__ */ N(`div`,{"data-slot":`dialog-header`,className:C(`flex flex-col gap-2`,e),...t})}function hn({className:e,showCloseButton:t=!1,children:n,...r}){return/* @__PURE__ */ P(`div`,{"data-slot":`dialog-footer`,className:C(`-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 sm:flex-row sm:justify-end`,e),...r,children:[n,t&&/* @__PURE__ */ N(G,{asChild:!0,children:/* @__PURE__ */ N(_,{variant:`outline`,children:`Close`})})]})}function gn({className:e,...t}){return/* @__PURE__ */ N(U,{"data-slot":`dialog-title`,className:C(`font-heading text-base leading-none font-medium`,e),...t})}function _n({className:e,...t}){return/* @__PURE__ */ N(W,{"data-slot":`dialog-description`,className:C(`text-sm text-muted-foreground *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground`,e),...t})}function vn({open:e,className:t,children:n,onCancel:r}){return/* @__PURE__ */ N(un,{open:e,onOpenChange:e=>{e||r()},children:/* @__PURE__ */ N(pn,{showCloseButton:!1,className:C(`sm:max-w-sm`,t),children:n})})}function yn({open:e,...t}){return/* @__PURE__ */ N(vn,{open:e,onCancel:t.onCancel,children:/* @__PURE__ */ N(bn,{...t})})}function bn({title:e,description:t,children:n,label:r,placeholder:i,hint:a,prefix:o,initialValue:s=``,confirmLabel:c,pendingLabel:l,isPending:u=!1,disabled:d=!1,requireChange:f=!1,validate:p,onSubmit:m,onCancel:h}){let{t:g}=T(),v=Re(),y=Re(),[b,x]=M(s),S=b.trim(),C=f&&S===s,w=S&&!C?p(S):null,ee=w??a,E=!!S&&!w&&!u&&!d&&!C;return/* @__PURE__ */ P(`form`,{className:`grid gap-4`,onSubmit:e=>{e.preventDefault(),E&&m(S)},children:[/* @__PURE__ */ P(mn,{children:[/* @__PURE__ */ N(gn,{children:e}),t&&/* @__PURE__ */ N(_n,{children:t})]}),n,/* @__PURE__ */ P(Ce,{"data-invalid":!!w,children:[r&&/* @__PURE__ */ N(ve,{htmlFor:v,children:r}),/* @__PURE__ */ P(he,{children:[o&&/* @__PURE__ */ N(we,{children:/* @__PURE__ */ P(ye,{children:[o,`/`]})}),/* @__PURE__ */ N(ue,{id:v,type:`text`,value:b,onChange:e=>x(e.target.value),placeholder:i,"aria-invalid":!!w,"aria-describedby":ee?y:void 0,autoFocus:!0,required:!0})]}),w?/* @__PURE__ */ N(me,{id:y,children:w}):a&&/* @__PURE__ */ N(xe,{id:y,children:a})]}),/* @__PURE__ */ P(hn,{children:[/* @__PURE__ */ N(_,{type:`button`,variant:`outline`,onClick:h,children:g(e=>e.common.cancel)}),/* @__PURE__ */ N(_,{type:`submit`,disabled:!E,children:u&&l?l:c})]})]})}function xn({library:e,dir:t,onNavigate:n}){let r=It(t);return r.length===0?null:/* @__PURE__ */ N(Rt,{children:/* @__PURE__ */ P(zt,{children:[/* @__PURE__ */ N($,{children:/* @__PURE__ */ N(Bt,{asChild:!0,children:/* @__PURE__ */ N(`button`,{type:`button`,onClick:()=>n(``),children:re(e)})})}),r.map(({name:e,path:t},i)=>/* @__PURE__ */ P(Le,{children:[/* @__PURE__ */ N(Ht,{}),/* @__PURE__ */ N($,{children:i===r.length-1?/* @__PURE__ */ N(Vt,{children:e}):/* @__PURE__ */ N(Bt,{asChild:!0,children:/* @__PURE__ */ N(`button`,{type:`button`,onClick:()=>n(t),children:e})})})]},t))]})})}function Sn({name:e,onOpen:t}){return/* @__PURE__ */ P(_,{type:`button`,variant:`outline`,onClick:t,className:`flex h-full flex-col items-center justify-center gap-2 hover:border-accent-foreground/30 hover:bg-accent`,children:[/* @__PURE__ */ N(Pt,{className:`size-8 text-muted-foreground`}),/* @__PURE__ */ N(`span`,{className:`truncate text-sm font-medium text-foreground`,children:e})]})}function Cn({path:e,label:t=e}){return/* @__PURE__ */ P(ae,{children:[/* @__PURE__ */ N(ne,{asChild:!0,children:/* @__PURE__ */ N(`p`,{className:`truncate font-medium`,children:t})}),/* @__PURE__ */ N(se,{children:e})]})}var wn=`flex h-28 items-center justify-center bg-muted`;function Tn({library:e,file:t,label:n=l(t.path),open:r,actions:i,className:a,children:o}){return/* @__PURE__ */ P(sn,{className:`group relative gap-0 py-0`,children:[r?/* @__PURE__ */ N(_,{type:`button`,variant:`ghost`,onClick:r.onClick,"aria-label":r.label,className:C(wn,`w-full cursor-pointer rounded-none`,a),children:/* @__PURE__ */ N(ln,{library:e,file:t,className:`h-full w-full object-contain`})}):/* @__PURE__ */ N(`div`,{className:C(wn,a),children:/* @__PURE__ */ N(ln,{library:e,file:t})}),i&&/* @__PURE__ */ N(`div`,{className:`absolute right-1 top-1 hidden gap-1 group-focus-within:flex group-hover:flex`,children:i}),/* @__PURE__ */ P(cn,{className:`border-t px-3 py-2 text-xs`,children:[/* @__PURE__ */ N(Cn,{path:t.path,label:n}),o]})]})}function En({className:e}){return/* @__PURE__ */ P(sn,{className:`gap-0 py-0`,children:[/* @__PURE__ */ N(A,{className:C(`h-28 rounded-none`,e)}),/* @__PURE__ */ P(cn,{className:`space-y-1 border-t px-3 py-2`,children:[/* @__PURE__ */ N(A,{className:`h-4 w-2/3`}),/* @__PURE__ */ N(A,{className:`h-4 w-1/3`})]})]})}function Dn(e,t){return!!e?.some(e=>e.path===t||e.path.startsWith(`${t}/`))}function On({dir:e,files:t,onCreate:n}){let{t:r}=T(),i=on(),[a,o]=M(!1);return/* @__PURE__ */ P(ze,{children:[/* @__PURE__ */ N(_,{type:`button`,variant:`outline`,onClick:()=>o(!0),children:r(e=>e.media.newFolder)}),/* @__PURE__ */ N(yn,{open:a,title:r(e=>e.media.newFolder),confirmLabel:r(e=>e.common.create),validate:n=>i.media(n,n=>Dn(t,u(e,n))),onSubmit:t=>{n(u(e,t)),o(!1)},onCancel:()=>o(!1)})]})}function kn(e){return new Promise(t=>{let n=document.createElement(`input`);n.type=`file`,e&&(n.accept=e),n.addEventListener(`change`,()=>t(n.files?.[0])),n.click()})}function An(t,r,i){let{t:o}=T(),s=Wt(),d=te(),[f,p]=M(!1),[m,h]=M(null),g=a(e.media,t).imageOptimization,_=async(e,t)=>{p(!0);try{return await de(e,g&&t?{...g,format:null}:g)}catch{return D(o(e=>e.media.optimizeFailed,{name:e.name}),`error`),null}finally{p(!1)}},v=(e,n)=>{s(d,{library:t,path:e.path,file:e.file,overwrite:n},{success:e.replacing?o(e=>e.media.replaced):o(e=>e.media.uploaded),onSuccess:()=>{h(null),i?.(e.path)}})};return{status:f?`optimizing`:d.isPending?`uploading`:`idle`,add:async(e,t)=>{let n=await _(e,!1);if(!n)return;let i={path:u(t,n.name),file:n,replacing:!1};r?.some(e=>e.path===i.path)?h(i):v(i,!1)},replace:async e=>{let t=await kn(c(e));if(!t)return;if(n(t.name)!==n(e)){D(o(e=>e.media.replaceType,{name:l(e)}),`error`);return}let r=await _(t,!0);r&&h({path:e,file:r,replacing:!0})},overwrite:{write:m,isPending:d.isPending,onConfirm:()=>{m&&v(m,!0)},onCancel:()=>h(null)}}}function jn({write:e,isPending:t,onConfirm:n,onCancel:r}){let{t:i}=T(),a=e?l(e.path):``;return/* @__PURE__ */ N(tn,{open:e!==null,title:e?.replacing?i(e=>e.media.replaceFile):i(e=>e.media.fileExists),description:e?.replacing?i(e=>e.media.replaceFileMessage,{name:a,file:e.file.name}):i(e=>e.media.fileExistsMessage,{name:a}),confirmLabel:e?.replacing?i(e=>e.common.replace):i(e=>e.common.overwrite),pendingLabel:i(e=>e.common.uploading),isPending:t,variant:`destructive`,onConfirm:n,onCancel:r})}function Mn(t,n){let r=a(e.media,t).extensions;return r?(n?r.filter(e=>m(e)===n):r).join(`,`)||void 0:n&&`${n}/*`}function Nn({accept:e,status:t,onPick:n}){let{t:r}=T();return/* @__PURE__ */ N(_,{type:`button`,disabled:t!==`idle`,onClick:()=>{kn(e).then(e=>{e&&n(e)})},children:r(t===`optimizing`?e=>e.common.optimizing:t===`uploading`?e=>e.common.uploading:e=>e.common.upload)})}export{Ht as A,Y as B,tn as C,Bt as D,$ as E,vt as F,G,ct as H,_t as I,B as J,H as K,gt as L,Lt as M,Ft as N,zt as O,Pt as P,dt as R,on as S,Rt as T,it as U,J as V,R as W,U as X,z as Y,_n as _,En as a,gn as b,Nn as c,An as d,yn as f,pn as g,un as h,Tn as i,It as j,Vt as k,Dn as l,vn as m,Sn as n,On as o,bn as p,W as q,xn as r,jn as s,Cn as t,Mn as u,hn as v,Wt as w,sn as x,mn as y,X as z};
@@ -0,0 +1 @@
1
+ import{o as e,r as t}from"./separator-C9bNKNSU.js";import{C as n,M as r,S as i,b as a,c as o,d as s,f as ee,g as c,h as l,i as u,l as te,n as ne,o as re,r as ie,s as ae,t as d,u as oe,w as f,x as p,z as se}from"./media-browser-DeKpWCUD.js";import{E as ce,H as m,V as h,W as le,_t as g,it as _,j as v,mt as y,n as b,t as x}from"./error-banner-CNWZU5u_.js";import{i as ue,r as de,t as fe}from"./toggle-B6ASf-kL.js";import{C as pe,E as S,I as C,L as me,M as w,R as T,S as E,T as D,b as he,w as ge,x as _e}from"./field-CbbZZGxO.js";import{t as O}from"./config-Pm_BHLNT.js";import{n as k,t as A}from"./badge-BfN73-be.js";import{a as j,i as M,n as N,r as P,s as F,t as ve}from"./page-header-C2Uwa_yv.js";import{n as I,r as L,t as R}from"./collapsible-mcJ6G3X4.js";import{a as ye,i as be,r as xe,t as Se}from"./empty-DAOUBpWb.js";import{i as z}from"./client-B4PWCmC4.js";import{useMemo as B,useState as V}from"react";import{Fragment as H,jsx as U,jsxs as W}from"react/jsx-runtime";var G={name:`pencil`,size:24,node:[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]};G.node;var Ce=t(G),K={name:`replace`,size:24,node:[[`path`,{d:`M14 4a1 1 0 0 1 1-1`,key:`dhj8ez`}],[`path`,{d:`M15 10a1 1 0 0 1-1-1`,key:`1mnyi5`}],[`path`,{d:`M21 4a1 1 0 0 0-1-1`,key:`sfs9ap`}],[`path`,{d:`M21 9a1 1 0 0 1-1 1`,key:`mp6qeo`}],[`path`,{d:`m3 7 3 3 3-3`,key:`x25e72`}],[`path`,{d:`M6 10V5a2 2 0 0 1 2-2h2`,key:`15xut4`}],[`rect`,{x:`3`,y:`14`,width:`7`,height:`7`,rx:`1`,key:`1bkyp8`}]]};K.node;var we=t(K);y({collection:g(),entryId:g(),where:g(),declared:_()});function Te(e,t,n){let r=new Set(n);return e.filter(e=>e.library===t&&!r.has(e.path)).flatMap(({path:e,references:t})=>t.flatMap(t=>t.declared?[{...t,path:e}]:[]))}function q(e){return`${e.collection} / ${e.entryId} (${e.where})`}function Ee(e,{library:t,path:n}){return e.find(e=>e.library===t&&e.path===n)?.references??[]}function De({library:t,file:n,onCancel:r}){let{t:i}=e();return/* @__PURE__ */ U(l,{open:n!==null,onOpenChange:e=>{e||r()},children:/* @__PURE__ */ U(c,{className:`w-fit border-none bg-transparent p-0 ring-0 shadow-none sm:max-w-[90vw]`,children:n&&/* @__PURE__ */ W(H,{children:[/* @__PURE__ */ U(a,{className:`sr-only`,children:i(e=>e.media.preview,{name:h(n.path)})}),/* @__PURE__ */ U(J,{library:t,file:n})]})})})}function J({library:e,file:t}){let n=T({library:e,path:t.path},t.version);switch(v(t.path)){case`video`:return/* @__PURE__ */ U(`video`,{src:n,controls:!0,autoPlay:!0,className:`max-h-[90vh] max-w-[90vw]`});case`audio`:return/* @__PURE__ */ U(`audio`,{src:n,controls:!0,autoPlay:!0,className:`w-[min(32rem,90vw)]`});default:return/* @__PURE__ */ U(`img`,{src:n,alt:``,className:`max-h-[90vh] max-w-[90vw] object-contain`})}}function Y(){let{library:e}=z.useParams();return/* @__PURE__ */ U(X,{library:e},e)}var Oe=()=>/* @__PURE__ */ U(`span`,{"aria-hidden":`true`,children:` · `});function X({library:t}){let{t:a}=e(),c=f(),l=i(),d=se({from:z.fullPath}),{dir:p=``}=z.useSearch(),{data:g,error:_}=_e(t),y=he(),S=ge(),T=s(t,g),[E,D]=V(null),[k,A]=V(null),[j,M]=V(null),[N,P]=V(!1),F=e=>{d({search:e?{dir:e}:{}})},{index:I,scanning:L,pending:R,error:G,scan:K}=pe(),J=!R&&!G&&!!I,Y=e=>e&&I?Ee(I,{library:t,path:e}):[],X=(e,t)=>{K(),e(t)},{used:Z,stale:Q,unusedCount:je}=B(()=>{let e=g?.map(e=>e.path)??[],n=I&&new Map(I.flatMap(e=>e.library===t?[[e.path,e.references.length]]:[]));return{used:n,stale:I?Te(I,t,e):[],unusedCount:n?e.filter(e=>!n.has(e)).length:0}},[t,g,I]),{folders:Me,files:$}=B(()=>r(g??[],p,e=>e.path),[g,p]),Ne=B(()=>N&&Z?$.filter(e=>!Z.has(e.path)):$,[$,N,Z]),Pe=(e=0)=>e===0?a(e=>e.media.unused):a(e=>e.media.uses,{count:e}),Fe=()=>{E&&J&&c(y,{library:t,path:E,acknowledgedReferences:Y(E)},{success:a(e=>e.media.deleted),onSuccess:()=>D(null)})},Ie=e=>{k&&J&&c(S,{library:t,from:k,to:le(m(k),e),acknowledgedReferences:Y(k)},{success:a(e=>e.media.renamed),onSuccess:()=>A(null)})},Le=e=>l.media(e,e=>!!k&&te(g,le(m(k),e)));return _?/* @__PURE__ */ U(x,{children:a(e=>e.media.failedLoad,{message:_.message})}):/* @__PURE__ */ W(`div`,{className:`min-h-0 flex-1 overflow-auto`,children:[/* @__PURE__ */ U(ve,{title:me(t),description:!ce(O.media,t)&&a(e=>e.media.immediate),actions:/* @__PURE__ */ W(H,{children:[Z&&g&&J?/* @__PURE__ */ W(H,{children:[/* @__PURE__ */ U(`span`,{className:`text-xs text-muted-foreground`,children:a(e=>e.media.unusedCount,{count:je,total:g.length})}),/* @__PURE__ */ U(fe,{variant:`outline`,size:`sm`,pressed:N,onPressedChange:P,children:a(e=>e.media.unusedOnly)})]}):/* @__PURE__ */ U(b,{type:`button`,variant:`outline`,size:`sm`,disabled:L,onClick:K,children:a(L?e=>e.media.scanningReferences:e=>e.media.checkUsage)}),/* @__PURE__ */ U(re,{dir:p,files:g,onCreate:F}),/* @__PURE__ */ U(o,{accept:oe(t),status:T.status,onPick:e=>void T.add(e,p)})]})}),/* @__PURE__ */ U(`div`,{className:`mb-3`,children:/* @__PURE__ */ U(ie,{library:t,dir:p,onNavigate:F})}),Q.length>0&&/* @__PURE__ */ U(`div`,{className:`mb-3`,children:/* @__PURE__ */ U(x,{title:a(e=>e.media.staleTitle,{count:Q.length}),children:/* @__PURE__ */ U(`ul`,{className:`list-disc pl-5 text-xs`,children:Q.map((e,t)=>/* @__PURE__ */ W(`li`,{children:[q(e),` → `,/* @__PURE__ */ U(`code`,{children:e.path})]},t))})})}),G&&/* @__PURE__ */ U(x,{children:a(e=>e.media.referencesUnavailable,{message:G.message})}),Me.length===0&&Ne.length===0&&!L&&/* @__PURE__ */ U(Se,{children:/* @__PURE__ */ W(xe,{children:[/* @__PURE__ */ U(be,{variant:`icon`,children:/* @__PURE__ */ U(ue,{})}),/* @__PURE__ */ U(ye,{children:a(N?e=>e.media.noUnused:e=>e.media.noFiles)})]})}),/* @__PURE__ */ W(`div`,{className:`grid auto-rows-fr gap-3 sm:grid-cols-2 lg:grid-cols-4`,children:[Me.map(({name:e,path:t})=>/* @__PURE__ */ U(ne,{name:e,onOpen:()=>F(t)},t)),Ne.map(e=>/* @__PURE__ */ U(u,{library:t,file:e,open:v(e.path)===`file`?void 0:{label:a(e=>e.media.preview,{name:h(e.path)}),onClick:()=>M(e)},actions:/* @__PURE__ */ W(H,{children:[/* @__PURE__ */ U(w,{variant:`secondary`,label:a(e=>e.common.rename),onClick:()=>X(A,e.path),children:/* @__PURE__ */ U(Ce,{})}),/* @__PURE__ */ U(w,{variant:`secondary`,label:a(e=>e.common.replace),disabled:T.status!==`idle`,onClick:()=>void T.replace(e.path),children:/* @__PURE__ */ U(we,{})}),/* @__PURE__ */ U(w,{variant:`secondary`,className:`text-destructive`,label:a(e=>e.common.delete),onClick:()=>X(D,e.path),children:/* @__PURE__ */ U(de,{})})]}),children:/* @__PURE__ */ W(`p`,{className:`text-muted-foreground`,children:[C(e.size),Z&&/* @__PURE__ */ W(H,{children:[/* @__PURE__ */ U(Oe,{}),Pe(Z.get(e.path))]})]})},e.path))]}),/* @__PURE__ */ U(ke,{library:t}),/* @__PURE__ */ U(ae,{...T.overwrite}),/* @__PURE__ */ U(n,{open:E!==null,title:a(e=>e.media.deleteFile),description:/* @__PURE__ */ W(`div`,{className:`grid gap-2`,children:[/* @__PURE__ */ U(`p`,{children:a(e=>e.media.deleteFileMessage,{name:h(E??``)})}),/* @__PURE__ */ U(Ae,{references:Y(E),pending:R,error:G,consequence:a(e=>e.media.deleteReferenced)})]}),confirmLabel:a(e=>e.common.delete),pendingLabel:a(e=>e.common.deleting),isPending:y.isPending,variant:`destructive`,disabled:!J,onConfirm:Fe,onCancel:()=>D(null)}),/* @__PURE__ */ U(ee,{open:k!==null,title:a(e=>e.media.renameFile),description:a(e=>e.media.current,{name:h(k??``)}),initialValue:h(k??``),confirmLabel:a(e=>e.common.rename),pendingLabel:a(e=>e.common.renaming),isPending:S.isPending,disabled:!J,requireChange:!0,validate:Le,onSubmit:Ie,onCancel:()=>A(null),children:/* @__PURE__ */ U(Ae,{references:Y(k),pending:R,error:G,consequence:a(e=>e.media.renameReferenced)})}),/* @__PURE__ */ U(De,{library:t,file:j,onCancel:()=>M(null)})]})}function ke({library:t}){let{t:r}=e(),i=f(),{data:a}=S(t),o=D(),s=E(),[ee,c]=V(null);if(!a?.length)return null;let l=a.find(e=>e.id===ee),u=o.isPending?o.variables.id:null;return/* @__PURE__ */ W(p,{className:`mt-6 gap-0 py-0`,children:[/* @__PURE__ */ W(R,{children:[/* @__PURE__ */ U(L,{asChild:!0,children:/* @__PURE__ */ W(b,{type:`button`,variant:`ghost`,className:`group/disclosure w-full justify-between`,children:[/* @__PURE__ */ W(`span`,{className:`flex items-center gap-2`,children:[r(e=>e.media.trash),/* @__PURE__ */ U(A,{variant:`secondary`,children:a.length})]}),/* @__PURE__ */ U(k,{})]})}),/* @__PURE__ */ W(I,{className:`border-t p-3`,children:[/* @__PURE__ */ U(`p`,{className:`mb-3 text-xs text-muted-foreground`,children:r(e=>e.media.trashHint)}),/* @__PURE__ */ U(F,{children:a.map(e=>/* @__PURE__ */ W(N,{variant:`outline`,size:`xs`,role:`listitem`,children:[/* @__PURE__ */ W(M,{className:`min-w-0`,children:[/* @__PURE__ */ U(d,{path:e.path}),/* @__PURE__ */ W(j,{children:[C(e.size),/* @__PURE__ */ U(Oe,{}),r(e=>e.media.deletedAt,{when:new Date(e.deletedAt).toLocaleString(O.locale)})]})]}),/* @__PURE__ */ W(P,{children:[/* @__PURE__ */ U(b,{type:`button`,variant:`outline`,size:`xs`,disabled:o.isPending,onClick:()=>i(o,{library:t,id:e.id},{success:r(e=>e.media.restored)}),children:u===e.id?r(e=>e.media.restoring):r(e=>e.media.restore)}),/* @__PURE__ */ U(w,{className:`text-destructive`,label:r(e=>e.media.purge),onClick:()=>c(e.id),children:/* @__PURE__ */ U(de,{})})]})]},e.id))})]})]}),/* @__PURE__ */ U(n,{open:l!==void 0,title:r(e=>e.media.purgeTitle),description:r(e=>e.media.purgeMessage,{name:l?.path??``}),confirmLabel:r(e=>e.media.purge),pendingLabel:r(e=>e.common.deleting),isPending:s.isPending,variant:`destructive`,onConfirm:()=>{l&&i(s,{library:t,id:l.id},{success:r(e=>e.media.purged),onSuccess:()=>c(null)})},onCancel:()=>c(null)})]})}function Ae({references:t,pending:n,error:r,consequence:i}){let{t:a}=e();return r?/* @__PURE__ */ U(`p`,{children:a(e=>e.media.referencesUnavailable,{message:r.message})}):n?/* @__PURE__ */ U(`p`,{children:a(e=>e.media.scanningReferences)}):t.length===0?null:/* @__PURE__ */ W(`div`,{children:[/* @__PURE__ */ W(`p`,{children:[a(e=>e.media.usedBy),` `,i]}),/* @__PURE__ */ U(`ul`,{className:`mt-2 max-h-40 list-disc overflow-auto pl-5 text-xs`,children:t.map((e,t)=>/* @__PURE__ */ U(`li`,{children:q(e)},t))})]})}export{Y as component};
@@ -0,0 +1 @@
1
+ export{a as Mermaid}from"./assistant-DTlSNidc.js";
@@ -0,0 +1 @@
1
+ import{i as e,n as t,p as n}from"./separator-C9bNKNSU.js";import"react";import{jsx as r,jsxs as i}from"react/jsx-runtime";function a({className:t,...n}){return/* @__PURE__ */ r(`div`,{role:`list`,"data-slot":`item-group`,className:e(`group/item-group flex w-full flex-col gap-4 has-data-[size=sm]:gap-2.5 has-data-[size=xs]:gap-2`,t),...n})}var o=t(`group/item flex w-full flex-wrap items-center rounded-lg border text-sm transition-colors duration-100 outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 [a]:transition-colors [a]:hover:bg-muted`,{variants:{variant:{default:`border-transparent`,outline:`border-border`,muted:`border-transparent bg-muted/50`},size:{default:`gap-2.5 px-3 py-2.5`,sm:`gap-2.5 px-3 py-2.5`,xs:`gap-2 px-2.5 py-2 in-data-[slot=dropdown-menu-content]:p-0`}},defaultVariants:{variant:`default`,size:`default`}});function s({className:t,variant:i=`default`,size:a=`default`,asChild:s=!1,...c}){return/* @__PURE__ */ r(s?n:`div`,{"data-slot":`item`,"data-variant":i,"data-size":a,className:e(o({variant:i,size:a,className:t})),...c})}var c=t(`flex shrink-0 items-center justify-center gap-2 group-has-data-[slot=item-description]/item:translate-y-0.5 group-has-data-[slot=item-description]/item:self-start [&_svg]:pointer-events-none`,{variants:{variant:{default:`bg-transparent`,icon:`[&_svg:not([class*='size-'])]:size-4`,image:`size-10 overflow-hidden rounded-sm group-data-[size=sm]/item:size-8 group-data-[size=xs]/item:size-6 [&_img]:size-full [&_img]:object-cover`}},defaultVariants:{variant:`default`}});function l({className:t,variant:n=`default`,...i}){return/* @__PURE__ */ r(`div`,{"data-slot":`item-media`,"data-variant":n,className:e(c({variant:n,className:t})),...i})}function u({className:t,...n}){return/* @__PURE__ */ r(`div`,{"data-slot":`item-content`,className:e(`flex flex-1 flex-col gap-1 group-data-[size=xs]/item:gap-0 [&+[data-slot=item-content]]:flex-none`,t),...n})}function d({className:t,...n}){return/* @__PURE__ */ r(`div`,{"data-slot":`item-title`,className:e(`line-clamp-1 flex w-fit items-center gap-2 text-sm leading-snug font-medium underline-offset-4`,t),...n})}function f({className:t,...n}){return/* @__PURE__ */ r(`p`,{"data-slot":`item-description`,className:e(`line-clamp-2 text-left text-sm leading-normal font-normal text-muted-foreground group-data-[size=xs]/item:text-xs [&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary`,t),...n})}function p({className:t,...n}){return/* @__PURE__ */ r(`div`,{"data-slot":`item-actions`,className:e(`flex items-center gap-2`,t),...n})}function m({className:t,...n}){return/* @__PURE__ */ r(`div`,{"data-slot":`item-footer`,className:e(`flex basis-full items-center justify-between gap-2`,t),...n})}function h({title:e,description:t,children:n,actions:a}){return/* @__PURE__ */ i(`div`,{className:`mb-4 flex shrink-0 flex-wrap items-start justify-between gap-4`,children:[/* @__PURE__ */ i(`div`,{className:`min-w-0`,children:[/* @__PURE__ */ r(`h1`,{className:`text-xl font-semibold`,children:e}),t&&/* @__PURE__ */ r(`p`,{className:`mt-0.5 text-sm text-muted-foreground`,children:t}),n&&/* @__PURE__ */ r(`div`,{className:`mt-1.5`,children:n})]}),a&&/* @__PURE__ */ r(`div`,{className:`flex items-center gap-2`,children:a})]})}export{f as a,l as c,u as i,d as l,s as n,m as o,p as r,a as s,h as t};