@isardsat/editorial-admin 6.11.0 → 6.11.1

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 (90) hide show
  1. package/build/client/assets/{ColorPicker-IW3vBXSN.js → ColorPicker-cMAyYT0T.js} +1 -1
  2. package/build/client/assets/{FilePicker-BoyljzKd.js → FilePicker-Cl1xE7Nb.js} +1 -1
  3. package/build/client/assets/Loading-BkOvB9cm.js +1 -0
  4. package/build/client/assets/URLInput-Ck27J_vV.js +1 -0
  5. package/build/client/assets/arrow-up-C0I0e1Jt.js +1 -0
  6. package/build/client/assets/authSlice-DyBWbN7g.js +18 -0
  7. package/build/client/assets/{button-Dxr-3uFz.js → button-CAQsSeJv.js} +1 -1
  8. package/build/client/assets/calendar-Frbsxn98.js +1 -0
  9. package/build/client/assets/chevron-down-qxzqwz13.js +1 -0
  10. package/build/client/assets/chevron-right-BFlMu-RJ.js +1 -0
  11. package/build/client/assets/chunk-EPOLDU6W-CiSVlmCe.js +26 -0
  12. package/build/client/assets/circle-check-C6CxUIig.js +1 -0
  13. package/build/client/assets/clear-button-BT0-SaS2.js +1 -0
  14. package/build/client/assets/createLucideIcon-BvSqmaUO.js +1 -0
  15. package/build/client/assets/{dashboard-eVXdEFvy.js → dashboard-DADSOZ-_.js} +1 -1
  16. package/build/client/assets/dashboard._collection-CtVDeSsn.js +1 -0
  17. package/build/client/assets/dashboard._collection._document-D6oCwVGC.js +1 -0
  18. package/build/client/assets/dashboard._collection.new-CQfN_irk.js +1 -0
  19. package/build/client/assets/dashboard._layout-D1s9unut.js +1 -0
  20. package/build/client/assets/dashboard.files-xlUtjOxw.js +1 -0
  21. package/build/client/assets/date-picker-D1xkYBxv.js +1 -0
  22. package/build/client/assets/{datetime-picker-RVcJa-hA.js → datetime-picker-IFDqN0ae.js} +1 -1
  23. package/build/client/assets/entry.client-C94uvdU2.js +13 -0
  24. package/build/client/assets/external-link-ERgO2SVI.js +1 -0
  25. package/build/client/assets/files-BFmouRir.js +1 -0
  26. package/build/client/assets/home-CYNfeuaU.js +1 -0
  27. package/build/client/assets/index-B-2LEQwB.js +1 -0
  28. package/build/client/assets/index-B45LLRRA.js +1 -0
  29. package/build/client/assets/index-BuuBEQuS.js +1 -0
  30. package/build/client/assets/index-C0hImMcN.js +1 -0
  31. package/build/client/assets/{index-CttGRTCZ.js → index-CDZBGZah.js} +2 -20
  32. package/build/client/assets/{index-BTe_3Ala.js → index-CZSVchcX.js} +1 -1
  33. package/build/client/assets/index-Cxe-PO-X.js +1 -0
  34. package/build/client/assets/index-DLIEpuwL.js +1 -0
  35. package/build/client/assets/index-DgNySWwD.js +45 -0
  36. package/build/client/assets/{input-xJI2b5Sp.js → input-BuAmKgZ9.js} +1 -1
  37. package/build/client/assets/itemForm-D719CaIj.js +8 -0
  38. package/build/client/assets/manifest-37e8fc05.js +1 -0
  39. package/build/client/assets/markdownEditor-CrmMLADy.js +100 -0
  40. package/build/client/assets/markdownEditor-Dha_UaaS.css +1 -0
  41. package/build/client/assets/root--tn719HN.css +1 -0
  42. package/build/client/assets/root-CchL-zdR.js +1 -0
  43. package/build/client/assets/schemas-DSUGmKgQ.js +40 -0
  44. package/build/client/assets/trash-UKLAaALv.js +1 -0
  45. package/build/client/assets/tslib.es6-Dm3DwgL9.js +1 -0
  46. package/build/client/assets/upload-DhJ5wU_H.js +1 -0
  47. package/build/client/assets/utils-oJIM4U5n.js +1 -0
  48. package/build/client/assets/x-D6gZWaAR.js +1 -0
  49. package/build/client/index.html +3 -3
  50. package/package.json +2 -2
  51. package/build/client/assets/Loading-DkkTJbsn.js +0 -6
  52. package/build/client/assets/URLInput-DZIiMxgx.js +0 -1
  53. package/build/client/assets/arrow-up-LKnZ72Ym.js +0 -11
  54. package/build/client/assets/authSlice-DFHOkK9j.js +0 -2763
  55. package/build/client/assets/calendar-DVBBYeOW.js +0 -6
  56. package/build/client/assets/chevron-down-CtNmiOMb.js +0 -6
  57. package/build/client/assets/chevron-right-haBQNeuE.js +0 -6
  58. package/build/client/assets/chunk-EF7DTUVF-CaKisB5m.js +0 -51
  59. package/build/client/assets/circle-check-94P8iWMg.js +0 -6
  60. package/build/client/assets/clear-button-wZQNsrkz.js +0 -6
  61. package/build/client/assets/createLucideIcon-BweVylaW.js +0 -21
  62. package/build/client/assets/dashboard._collection-C25Nlh67.js +0 -26
  63. package/build/client/assets/dashboard._collection._document-Clg8DIhx.js +0 -1
  64. package/build/client/assets/dashboard._collection.new-CBIwONjS.js +0 -1
  65. package/build/client/assets/dashboard._layout-BT5UJmod.js +0 -36
  66. package/build/client/assets/dashboard.files-D1Oj8glB.js +0 -1
  67. package/build/client/assets/date-picker-CYFCrG85.js +0 -1
  68. package/build/client/assets/entry.client-Be049MAC.js +0 -29
  69. package/build/client/assets/external-link-LWykkN17.js +0 -6
  70. package/build/client/assets/files-DwkfV9QP.js +0 -26
  71. package/build/client/assets/home-BsxAOkSU.js +0 -1
  72. package/build/client/assets/index-46piFQ87.js +0 -1
  73. package/build/client/assets/index-BJ-ODQ_I.js +0 -9
  74. package/build/client/assets/index-Be3bqnxd.js +0 -1
  75. package/build/client/assets/index-BxJwj7VX.js +0 -45
  76. package/build/client/assets/index-CEA_25hA.js +0 -1
  77. package/build/client/assets/index-CQnetejS.js +0 -1
  78. package/build/client/assets/index-PuNjdK9F.js +0 -1
  79. package/build/client/assets/itemForm-CFpASfjf.js +0 -15
  80. package/build/client/assets/manifest-6d3a9622.js +0 -1
  81. package/build/client/assets/markdownEditor-BmmlxrMb.js +0 -128
  82. package/build/client/assets/markdownEditor-D2iPtBtk.css +0 -1
  83. package/build/client/assets/root-1Wb14VaX.css +0 -1
  84. package/build/client/assets/root-BeK-V6m1.js +0 -16
  85. package/build/client/assets/schemas-Cg4zf3bl.js +0 -26
  86. package/build/client/assets/trash-BPu8wmdf.js +0 -11
  87. package/build/client/assets/tslib.es6-Dilv5nzk.js +0 -6
  88. package/build/client/assets/upload-C84AIRF5.js +0 -6
  89. package/build/client/assets/utils-fIb4EhUB.js +0 -9
  90. package/build/client/assets/x-BI8YVnoZ.js +0 -6
@@ -1,26 +0,0 @@
1
- import{p as e,a as m,x as g,R as L,w as V}from"./chunk-EF7DTUVF-CaKisB5m.js";import{B}from"./button-Dxr-3uFz.js";import{i as M,l as S,d as A,m as E,n as y,a as N}from"./utils-fIb4EhUB.js";import{I as H}from"./input-xJI2b5Sp.js";import{c as O,u as P,T as U,a as q,b,d as G,f as k,e as Q,g as J,i as K,j as W,h as X}from"./index-CttGRTCZ.js";import{c as u}from"./createLucideIcon-BweVylaW.js";import{C as f}from"./calendar-DVBBYeOW.js";import{T as Y,F as Z}from"./trash-BPu8wmdf.js";import{E as F}from"./external-link-LWykkN17.js";import{C as D}from"./circle-check-94P8iWMg.js";import{a as ee,A as te}from"./arrow-up-LKnZ72Ym.js";import"./index-CQnetejS.js";/**
2
- * @license lucide-react v0.487.0 - ISC
3
- *
4
- * This source code is licensed under the ISC license.
5
- * See the LICENSE file in the root directory of this source tree.
6
- */const se=[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]],ae=u("arrow-up-down",se);/**
7
- * @license lucide-react v0.487.0 - ISC
8
- *
9
- * This source code is licensed under the ISC license.
10
- * See the LICENSE file in the root directory of this source tree.
11
- */const le=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],T=u("circle",le);/**
12
- * @license lucide-react v0.487.0 - ISC
13
- *
14
- * This source code is licensed under the ISC license.
15
- * See the LICENSE file in the root directory of this source tree.
16
- */const re=[["path",{d:"M15 12h6",key:"upa0zy"}],["path",{d:"M15 6h6",key:"1jlkvy"}],["path",{d:"m3 13 3.553-7.724a.5.5 0 0 1 .894 0L11 13",key:"blevx4"}],["path",{d:"M3 18h18",key:"1h113x"}],["path",{d:"M4 11h6",key:"olkgv1"}]],C=u("letter-text",re);/**
17
- * @license lucide-react v0.487.0 - ISC
18
- *
19
- * This source code is licensed under the ISC license.
20
- * See the LICENSE file in the root directory of this source tree.
21
- */const ne=[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]],oe=u("list",ne);/**
22
- * @license lucide-react v0.487.0 - ISC
23
- *
24
- * This source code is licensed under the ISC license.
25
- * See the LICENSE file in the root directory of this source tree.
26
- */const ie=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],ce=u("plus",ie),de={boolean:D,date:f,datetime:f,markdown:C,select:oe,string:C,url:F},p=O(),R=(r,s,n)=>{const o=r.getValue(n),i=s.getValue(n);return!o&&!i?0:o?i?new Date(o).getTime()-new Date(i).getTime():-1:1},v=[p.accessor("id",{header(){return e.jsxs("span",{className:"flex items-center max-w-48",children:[e.jsx(T,{className:"text-gray-500 h-4"})," ID"]})},cell(r){const s=r.getValue();return e.jsx("span",{title:s,className:"block overflow-hidden text-ellipsis w-48 max-w-48 whitespace-nowrap",children:s})}})],me=[p.accessor("updatedAt",{header(){return e.jsxs("div",{className:"flex items-center max-w-48",children:[e.jsx(f,{className:"text-gray-500 h-4"})," Last updated"]})},sortingFn:R,cell(r){return M(new Date(r.getValue()))}})];function ue({itemType:r}){const{data:s}=S(r),{data:n}=A(),[o,i]=m.useState([]),[I,_]=m.useState([{id:"updatedAt",desc:!0}]),[w]=E(),j=m.useMemo(()=>p.display({id:"actions",header:()=>e.jsx("span",{className:"flex justify-end ml-auto"}),cell(l){return e.jsx("div",{className:"flex gap-2 justify-end",children:e.jsxs("button",{className:"hover:text-red-500 p-1 hover:bg-muted rounded-sm",onClick:t=>{t.stopPropagation(),w({type:r,id:l.row.original.id})},children:[e.jsx(Y,{size:16,className:"group-hover:text-red-400"}),e.jsx("span",{className:"sr-only",children:"Delete entry"})]})})},enableSorting:!1}),[r,w]),x=m.useMemo(()=>{if(!s)return v;const l=Object.entries(s.fields);return[...v,...l.filter(([,t])=>t.showInSummary).map(([t,c])=>p.accessor(d=>d[t],{id:t,sortingFn:c.type==="date"||c.type==="datetime"?R:"alphanumeric",header(){const d=c.isUploadedFile?Z:de[c.type]??L.Fragment;return e.jsxs("div",{className:"flex items-center ",children:[e.jsx(d,{className:"text-gray-500 h-4 flex-shrink-0"}),c.displayName]})},cell(d){const a=d.getValue();switch(c.type){case"boolean":const z=a?D:T;return e.jsx("span",{className:"flex justify-center items-center h-full text-nowrap",children:e.jsx(z,{className:y("mx-auto",a?"text-green-600":"text-gray-300"),size:14})});case"url":return a?e.jsx(g,{to:a,className:"flex items-center w-48 hover:text-blue-500 overflow-hidden text-ellipsis whitespace-nowrap",title:a,children:a}):"--";case"datetime":return a?e.jsx("span",{className:" text-nowrap",title:a,children:new Date(a).toLocaleString(void 0,{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:void 0})}):"--";case"date":return a?e.jsx("span",{className:"text-nowrap",title:a,children:M(new Date(a))}):"--";case"markdown":case"string":return c.isUploadedFile?e.jsxs("span",{title:a,className:"flex items-center w-48 overflow-hidden text-ellipsis whitespace-nowrap",children:[e.jsx(F,{className:"h-4 shrink-0"})," ",a]}):e.jsx("span",{title:a,className:"block w-48 overflow-hidden text-ellipsis whitespace-nowrap",children:a});default:return a}}})),...me,j]},[j,s]),$=m.useMemo(()=>n?.[r]?Object.values(n[r]):[],[r,n]),h=P({data:$,columns:x,getCoreRowModel:X(),onColumnFiltersChange:i,getFilteredRowModel:W(),onSortingChange:_,getSortedRowModel:K(),state:{sorting:I,columnFilters:o}});return!s||!n?null:e.jsxs("div",{className:"rounded-sm border overflow-auto",children:[s.filterBy&&Object.entries(s.fields).find(([l])=>l===s.filterBy)&&e.jsx("div",{className:"flex items-center py-2 pl-2 ",children:e.jsx(H,{placeholder:`Filter ${s.filterBy}...`,value:h.getColumn(s.filterBy)?.getFilterValue()??"",onChange:l=>h.getColumn(s.filterBy||"")?.setFilterValue(l.target.value),className:"max-w-sm rounded-sm"})}),e.jsxs(U,{children:[e.jsx(q,{className:"sticky top-0 z-50",children:h.getHeaderGroups().map(l=>e.jsx(b,{className:"grid",style:{gridTemplateColumns:`repeat(${x.length}, minmax(200px, 1fr))`},children:l.headers.map(t=>e.jsx(G,{className:y("bg-background transition-colors",t.column.getCanSort()&&"hover:bg-gray-100 cursor-default"),onClick:()=>{console.log("sorting",t.column.getIsSorted()),t.column.toggleSorting(t.column.getIsSorted()==="asc")},children:e.jsxs("div",{className:"flex items-center w-full overflow-hidden",children:[e.jsx("span",{className:"block overflow-hidden text-ellipsis whitespace-nowrap",title:t.column.columnDef.header?.toString?.()??"",children:t.isPlaceholder?null:k(t.column.columnDef.header,t.getContext())}),t.column.getCanSort()&&(t.column.getIsSorted()==="asc"?e.jsx(ee,{className:"ml-2 h-4 w-4 text-foreground"}):t.column.getIsSorted()==="desc"?e.jsx(te,{className:"ml-2 h-4 w-4 text-foreground"}):e.jsx(ae,{className:"ml-2 h-4 w-4 text-gray-400"}))]})},t.id))},l.id))}),e.jsx(Q,{children:h.getRowModel().rows.map(l=>e.jsx(g,{to:`/admin/dashboard/${r}/${l.original.id}`,children:e.jsx(b,{className:N("grid",l.original.isDraft&&"bg-orange-50 hover:bg-orange-100"),style:{gridTemplateColumns:`repeat(${x.length}, minmax(200px, 1fr))`},children:l.getVisibleCells().map(t=>e.jsx(J,{className:N("h-10"),children:k(t.column.columnDef.cell,t.getContext())},t.id))})},l.id))})]})]})}const ve=V(function({params:s}){const{collectionId:n}=s,{data:o,isFetching:i}=S(n);return i||!o?null:e.jsx("div",{className:"overflow-hidden flex flex-1 p-4 gap-4",children:e.jsx("div",{className:"flex flex-col overflow-hidden flex-1 gap-8",children:e.jsxs("div",{className:"flex flex-col h-full gap-4 last:mb-20",children:[e.jsxs("div",{className:"flex items-center",children:[e.jsx("h2",{className:"scroll-mt-[4.5rem] text-xl font-semibold leading-none capitalize",id:o.displayName,children:o.displayName}),e.jsx(B,{asChild:!0,variant:"default",size:"sm",className:"ml-auto",children:e.jsxs(g,{to:`/admin/dashboard/${n}/new`,children:[e.jsx(ce,{}),"Create"]})})]}),e.jsx(ue,{itemType:n},n)]})})})});export{ve as default};
@@ -1 +0,0 @@
1
- import{w as c,p as e}from"./chunk-EF7DTUVF-CaKisB5m.js";import{I as n}from"./itemForm-CFpASfjf.js";import{l as p,o as l}from"./utils-fIb4EhUB.js";import"./button-Dxr-3uFz.js";import"./index-CQnetejS.js";import"./schemas-Cg4zf3bl.js";import"./index-46piFQ87.js";import"./index-BJ-ODQ_I.js";import"./createLucideIcon-BweVylaW.js";import"./input-xJI2b5Sp.js";import"./index-BxJwj7VX.js";import"./tslib.es6-Dilv5nzk.js";const T=c(function({params:s}){const{collectionId:t,documentId:i}=s,{data:o,isFetching:a}=p(t),{data:r,isFetching:m}=l({itemType:t,id:i});return!o||(a||m)?null:e.jsx("div",{className:"overflow-auto scrollbar-stable",children:e.jsx("div",{className:"flex p-4 gap-4",children:e.jsx(n,{itemType:t,fields:o.fields,data:r??void 0},`${t}-${i}`)})})});export{T as default};
@@ -1 +0,0 @@
1
- import{w as i,p as o}from"./chunk-EF7DTUVF-CaKisB5m.js";import{I as m}from"./itemForm-CFpASfjf.js";import{l as s}from"./utils-fIb4EhUB.js";import"./button-Dxr-3uFz.js";import"./index-CQnetejS.js";import"./schemas-Cg4zf3bl.js";import"./index-46piFQ87.js";import"./index-BJ-ODQ_I.js";import"./createLucideIcon-BweVylaW.js";import"./input-xJI2b5Sp.js";import"./index-BxJwj7VX.js";import"./tslib.es6-Dilv5nzk.js";const y=i(function({params:r}){const{collectionId:t}=r,{data:e}=s(t);return e?o.jsx("div",{className:"overflow-auto",children:o.jsx("div",{className:"flex p-4 gap-4",children:o.jsx(m,{itemType:t,fields:e.fields,isNew:!0})})}):null});export{y as default};
@@ -1,36 +0,0 @@
1
- import{p as e,a as r,x as y,y as Q,v as ce,z as ue,R as he,w as pe,O as xe}from"./chunk-EF7DTUVF-CaKisB5m.js";import{u as fe,d as E,e as be}from"./authSlice-DFHOkK9j.js";import{a as l,b as O,d as me,f as ge,g as je,h as ve,u as we}from"./utils-fIb4EhUB.js";import{t as z}from"./index-BTe_3Ala.js";import{R as X,C as Z,a as Y,T as J,D as ee,P as te,O as ae,u as ye}from"./index-BxJwj7VX.js";import{X as se}from"./x-BI8YVnoZ.js";import{B as _}from"./button-Dxr-3uFz.js";import{c as N}from"./createLucideIcon-BweVylaW.js";import{S as R,c as Ne,u as Ce}from"./index-CQnetejS.js";import{R as Se,P as ke,a as _e,T as Me,b as ze,C as Pe,A as Ee}from"./index-Be3bqnxd.js";import{u as Oe,c as Re,P as D,a as De,b as Ae,d as Ie}from"./index-46piFQ87.js";import{C as B}from"./chevron-down-CtNmiOMb.js";import{A as Le,a as Te}from"./arrow-up-LKnZ72Ym.js";import{L as $e}from"./tslib.es6-Dilv5nzk.js";import{U as Be}from"./upload-C84AIRF5.js";import{E as Ge}from"./external-link-LWykkN17.js";import{L as He}from"./Loading-DkkTJbsn.js";import{C as Fe}from"./chevron-right-haBQNeuE.js";import"./index-BJ-ODQ_I.js";import"./index-CEA_25hA.js";/**
2
- * @license lucide-react v0.487.0 - ISC
3
- *
4
- * This source code is licensed under the ISC license.
5
- * See the LICENSE file in the root directory of this source tree.
6
- */const Ke=[["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["path",{d:"M10 21V8a1 1 0 0 0-1-1H4a1 1 0 0 0-1 1v12a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-5a1 1 0 0 0-1-1H3",key:"1fpvtg"}]],Ve=N("blocks",Ke);/**
7
- * @license lucide-react v0.487.0 - ISC
8
- *
9
- * This source code is licensed under the ISC license.
10
- * See the LICENSE file in the root directory of this source tree.
11
- */const qe=[["path",{d:"M20 7h-3a2 2 0 0 1-2-2V2",key:"x099mo"}],["path",{d:"M9 18a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h7l4 4v10a2 2 0 0 1-2 2Z",key:"18t6ie"}],["path",{d:"M3 7.6v12.8A1.6 1.6 0 0 0 4.6 22h9.8",key:"1nja0z"}]],Ue=N("files",qe);/**
12
- * @license lucide-react v0.487.0 - ISC
13
- *
14
- * This source code is licensed under the ISC license.
15
- * See the LICENSE file in the root directory of this source tree.
16
- */const We=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M3 9h18",key:"1pudct"}],["path",{d:"M3 15h18",key:"5xshup"}],["path",{d:"M9 3v18",key:"fh3hqa"}],["path",{d:"M15 3v18",key:"14nvp0"}]],Qe=N("grid-3x3",We);/**
17
- * @license lucide-react v0.487.0 - ISC
18
- *
19
- * This source code is licensed under the ISC license.
20
- * See the LICENSE file in the root directory of this source tree.
21
- */const Xe=[["path",{d:"M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z",key:"c3ymky"}]],Ze=N("heart",Xe);/**
22
- * @license lucide-react v0.487.0 - ISC
23
- *
24
- * This source code is licensed under the ISC license.
25
- * See the LICENSE file in the root directory of this source tree.
26
- */const Ye=[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]],Je=N("log-out",Ye);/**
27
- * @license lucide-react v0.487.0 - ISC
28
- *
29
- * This source code is licensed under the ISC license.
30
- * See the LICENSE file in the root directory of this source tree.
31
- */const et=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],tt=N("panel-left",et);/**
32
- * @license lucide-react v0.487.0 - ISC
33
- *
34
- * This source code is licensed under the ISC license.
35
- * See the LICENSE file in the root directory of this source tree.
36
- */const at=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],st=N("square",at);function nt({...t}){return e.jsx(X,{"data-slot":"dialog",...t})}function it({...t}){return e.jsx(te,{"data-slot":"dialog-portal",...t})}function ot({className:t,...a}){return e.jsx(ae,{"data-slot":"dialog-overlay",className:l("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...a})}function rt({className:t,children:a,...n}){return e.jsxs(it,{"data-slot":"dialog-portal",children:[e.jsx(ot,{}),e.jsxs(Z,{"data-slot":"dialog-content",className:l("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg",t),...n,children:[a,e.jsxs(Y,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",children:[e.jsx(se,{}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function lt({className:t,...a}){return e.jsx("div",{"data-slot":"dialog-header",className:l("flex flex-col gap-2 text-center sm:text-left",t),...a})}function dt({className:t,...a}){return e.jsx("div",{"data-slot":"dialog-footer",className:l("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),...a})}function ct({className:t,...a}){return e.jsx(J,{"data-slot":"dialog-title",className:l("text-lg leading-none font-semibold",t),...a})}function ut({className:t,...a}){return e.jsx(ee,{"data-slot":"dialog-description",className:l("text-muted-foreground text-sm",t),...a})}const ht="#181717",pt=r.forwardRef(function({title:a="GitHub",color:n="currentColor",size:s=24,...i},o){return n==="default"&&(n=ht),e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:s,height:s,fill:n,viewBox:"0 0 24 24",ref:o,...i,children:[e.jsx("title",{children:a}),e.jsx("path",{d:"M12 .297c-6.63 0-12 5.373-12 12 0 5.303 3.438 9.8 8.205 11.385.6.113.82-.258.82-.577 0-.285-.01-1.04-.015-2.04-3.338.724-4.042-1.61-4.042-1.61C4.422 18.07 3.633 17.7 3.633 17.7c-1.087-.744.084-.729.084-.729 1.205.084 1.838 1.236 1.838 1.236 1.07 1.835 2.809 1.305 3.495.998.108-.776.417-1.305.76-1.605-2.665-.3-5.466-1.332-5.466-5.93 0-1.31.465-2.38 1.235-3.22-.135-.303-.54-1.523.105-3.176 0 0 1.005-.322 3.3 1.23.96-.267 1.98-.399 3-.405 1.02.006 2.04.138 3 .405 2.28-1.552 3.285-1.23 3.285-1.23.645 1.653.24 2.873.12 3.176.765.84 1.23 1.91 1.23 3.22 0 4.61-2.805 5.625-5.475 5.92.42.36.81 1.096.81 2.22 0 1.606-.015 2.896-.015 3.286 0 .315.21.69.825.57C20.565 22.092 24 17.592 24 12.297c0-6.627-5.373-12-12-12"})]})}),xt="#85EA2D",G=r.forwardRef(function({title:a="Swagger",color:n="currentColor",size:s=24,...i},o){return n==="default"&&(n=xt),e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:s,height:s,fill:n,viewBox:"0 0 24 24",ref:o,...i,children:[e.jsx("title",{children:a}),e.jsx("path",{d:"M12 0C5.383 0 0 5.383 0 12s5.383 12 12 12c6.616 0 12-5.383 12-12S18.616 0 12 0zm0 1.144c5.995 0 10.856 4.86 10.856 10.856 0 5.995-4.86 10.856-10.856 10.856-5.996 0-10.856-4.86-10.856-10.856C1.144 6.004 6.004 1.144 12 1.144zM8.37 5.868a6.707 6.707 0 0 0-.423.005c-.983.056-1.573.517-1.735 1.472-.115.665-.096 1.348-.143 2.017-.013.35-.05.697-.115 1.038-.134.609-.397.798-1.016.83a2.65 2.65 0 0 0-.244.042v1.463c1.126.055 1.278.452 1.37 1.629.033.429-.013.858.015 1.287.018.406.073.808.156 1.2.259 1.075 1.307 1.435 2.575 1.218v-1.283c-.203 0-.383.005-.558 0-.43-.013-.591-.12-.632-.535-.056-.535-.042-1.08-.075-1.62-.064-1.001-.175-1.988-1.153-2.625.503-.37.868-.812.983-1.398.083-.41.134-.821.166-1.237.028-.415-.023-.84.014-1.25.06-.665.102-.937.9-.91.12 0 .235-.017.369-.027v-1.31c-.16 0-.31-.004-.454-.006zm7.593.009a4.247 4.247 0 0 0-.813.06v1.274c.245 0 .434 0 .623.005.328.004.577.13.61.494.032.332.031.669.064 1.006.065.669.101 1.347.217 2.007.102.544.475.95.941 1.283-.817.549-1.057 1.333-1.098 2.215-.023.604-.037 1.213-.069 1.822-.028.554-.222.734-.78.748-.157.004-.31.018-.484.028v1.305c.327 0 .627.019.927 0 .932-.055 1.495-.507 1.68-1.412.078-.498.124-1 .138-1.504.032-.461.028-.927.074-1.384.069-.715.397-1.01 1.112-1.057a.972.972 0 0 0 .199-.046v-1.463c-.12-.014-.204-.027-.291-.032-.536-.023-.804-.203-.937-.71a5.146 5.146 0 0 1-.152-.993c-.037-.618-.033-1.241-.074-1.86-.08-1.192-.794-1.753-1.887-1.786zm-6.89 5.28a.844.844 0 0 0-.083 1.684h.055a.83.83 0 0 0 .877-.78v-.046a.845.845 0 0 0-.83-.858zm2.911 0a.808.808 0 0 0-.834.78c0 .027 0 .05.004.078 0 .503.342.826.859.826.507 0 .826-.332.826-.853-.005-.503-.342-.836-.855-.831zm2.963 0a.861.861 0 0 0-.876.835c0 .47.378.849.849.849h.009c.425.074.853-.337.881-.83.023-.457-.392-.854-.863-.854z"})]})});function ft({isOpen:t,setOpen:a}){return e.jsx(nt,{open:t,onOpenChange:n=>a(n),children:e.jsxs(rt,{children:[e.jsxs(lt,{children:[e.jsx(ct,{children:"Editorial"}),e.jsx(ut,{children:"A simple CMS for static websites"})]}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx(_,{asChild:!0,variant:"ghost",children:e.jsxs(y,{to:"https://lobelia-earth.github.io/editorial/",children:[e.jsx(G,{size:14}),"Documentation"]})}),e.jsx(_,{asChild:!0,variant:"ghost",children:e.jsxs(y,{to:"/doc/ui",children:[e.jsx(G,{size:14}),"Swagger API UI"]})}),e.jsx(_,{asChild:!0,variant:"ghost",children:e.jsxs(y,{to:"https://github.com/Lobelia-Earth/editorial",children:[e.jsx(pt,{size:14}),"GitHub repository"]})})]}),e.jsx(dt,{children:e.jsxs("p",{className:"flex items-center gap-1",children:["Created with",e.jsx(Ze,{size:14,className:"stroke-red-500 fill-red-500"})," by"," ",e.jsx(y,{to:"https://lobelia.earth",className:"underline hover:text-blue-500",children:"Lobelia.earth"})]})})]})})}function bt({className:t,orientation:a="horizontal",decorative:n=!0,...s}){return e.jsx(Se,{"data-slot":"separator-root",decorative:n,orientation:a,className:l("bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px",t),...s})}function mt({...t}){return e.jsx(X,{"data-slot":"sheet",...t})}function gt({...t}){return e.jsx(te,{"data-slot":"sheet-portal",...t})}function jt({className:t,...a}){return e.jsx(ae,{"data-slot":"sheet-overlay",className:l("data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",t),...a})}function vt({className:t,children:a,side:n="right",...s}){return e.jsxs(gt,{children:[e.jsx(jt,{}),e.jsxs(Z,{"data-slot":"sheet-content",className:l("bg-background data-[state=open]:animate-in data-[state=closed]:animate-out fixed z-50 flex flex-col gap-4 shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500",n==="right"&&"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",n==="left"&&"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",n==="top"&&"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",n==="bottom"&&"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",t),...s,children:[a,e.jsxs(Y,{className:"ring-offset-background focus:ring-ring data-[state=open]:bg-secondary absolute top-4 right-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none",children:[e.jsx(se,{className:"size-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function wt({className:t,...a}){return e.jsx("div",{"data-slot":"sheet-header",className:l("flex flex-col gap-1.5 p-4",t),...a})}function yt({className:t,...a}){return e.jsx(J,{"data-slot":"sheet-title",className:l("text-foreground font-semibold",t),...a})}function Nt({className:t,...a}){return e.jsx(ee,{"data-slot":"sheet-description",className:l("text-muted-foreground text-sm",t),...a})}function ne({delayDuration:t=0,...a}){return e.jsx(ke,{"data-slot":"tooltip-provider",delayDuration:t,...a})}function Ct({...t}){return e.jsx(ne,{children:e.jsx(_e,{"data-slot":"tooltip",...t})})}function St({...t}){return e.jsx(Me,{"data-slot":"tooltip-trigger",...t})}function kt({className:t,sideOffset:a=0,children:n,...s}){return e.jsx(ze,{children:e.jsxs(Pe,{"data-slot":"tooltip-content",sideOffset:a,className:l("bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",t),...s,children:[n,e.jsx(Ee,{className:"bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}const P=768;function _t(){const[t,a]=r.useState(void 0);return r.useEffect(()=>{const n=window.matchMedia(`(max-width: ${P-1}px)`),s=()=>{a(window.innerWidth<P)};return n.addEventListener("change",s),a(window.innerWidth<P),()=>n.removeEventListener("change",s)},[]),!!t}const Mt="sidebar_state",zt=3600*24*7,Pt="16rem",Et="18rem",Ot="3rem",Rt="b",ie=r.createContext(null);function A(){const t=r.useContext(ie);if(!t)throw new Error("useSidebar must be used within a SidebarProvider.");return t}function Dt({defaultOpen:t=!0,open:a,onOpenChange:n,className:s,style:i,children:o,...d}){const u=_t(),[f,c]=r.useState(!1),[m,C]=r.useState(t),b=a??m,j=r.useCallback(x=>{const h=typeof x=="function"?x(b):x;n?n(h):C(h),document.cookie=`${Mt}=${h}; path=/; max-age=${zt}`},[n,b]),p=r.useCallback(()=>u?c(x=>!x):j(x=>!x),[u,j,c]);r.useEffect(()=>{const x=h=>{h.key===Rt&&(h.metaKey||h.ctrlKey)&&(h.preventDefault(),p())};return window.addEventListener("keydown",x),()=>window.removeEventListener("keydown",x)},[p]);const v=b?"expanded":"collapsed",S=r.useMemo(()=>({state:v,open:b,setOpen:j,isMobile:u,openMobile:f,setOpenMobile:c,toggleSidebar:p}),[v,b,j,u,f,c,p]);return e.jsx(ie.Provider,{value:S,children:e.jsx(ne,{delayDuration:0,children:e.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":Pt,"--sidebar-width-icon":Ot,...i},className:l("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",s),...d,children:o})})})}function At({side:t="left",variant:a="sidebar",collapsible:n="offcanvas",className:s,children:i,...o}){const{isMobile:d,state:u,openMobile:f,setOpenMobile:c}=A();return n==="none"?e.jsx("div",{"data-slot":"sidebar",className:l("bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col",s),...o,children:i}):d?e.jsx(mt,{open:f,onOpenChange:c,...o,children:e.jsxs(vt,{"data-sidebar":"sidebar","data-slot":"sidebar","data-mobile":"true",className:"bg-sidebar text-sidebar-foreground w-(--sidebar-width) p-0 [&>button]:hidden",style:{"--sidebar-width":Et},side:t,children:[e.jsxs(wt,{className:"sr-only",children:[e.jsx(yt,{children:"Sidebar"}),e.jsx(Nt,{children:"Displays the mobile sidebar."})]}),e.jsx("div",{className:"flex h-full w-full flex-col",children:i})]})}):e.jsxs("div",{className:"group peer text-sidebar-foreground hidden md:block","data-state":u,"data-collapsible":u==="collapsed"?n:"","data-variant":a,"data-side":t,"data-slot":"sidebar",children:[e.jsx("div",{"data-slot":"sidebar-gap",className:l("relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear","group-data-[collapsible=offcanvas]:w-0","group-data-[side=right]:rotate-180",a==="floating"||a==="inset"?"group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon)")}),e.jsx("div",{"data-slot":"sidebar-container",className:l("fixed inset-y-0 z-10 hidden h-svh w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex",t==="left"?"left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]":"right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]",a==="floating"||a==="inset"?"p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]":"group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l",s),...o,children:e.jsx("div",{"data-sidebar":"sidebar","data-slot":"sidebar-inner",className:"bg-sidebar group-data-[variant=floating]:border-sidebar-border flex h-full w-full flex-col group-data-[variant=floating]:rounded-lg group-data-[variant=floating]:border group-data-[variant=floating]:shadow-sm",children:i})})]})}function It({className:t,onClick:a,...n}){const{toggleSidebar:s}=A();return e.jsxs(_,{"data-sidebar":"trigger","data-slot":"sidebar-trigger",variant:"ghost",size:"icon",className:l("size-7",t),onClick:i=>{a?.(i),s()},...n,children:[e.jsx(tt,{}),e.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function Lt({className:t,...a}){return e.jsx("div",{"data-slot":"sidebar-header","data-sidebar":"header",className:l("flex flex-col gap-2 p-2",t),...a})}function Tt({className:t,...a}){return e.jsx("div",{"data-slot":"sidebar-footer","data-sidebar":"footer",className:l("flex flex-col gap-2 p-2",t),...a})}function $t({className:t,...a}){return e.jsx("div",{"data-slot":"sidebar-content","data-sidebar":"content",className:l("flex min-h-0 flex-1 flex-col gap-2 overflow-auto group-data-[collapsible=icon]:overflow-hidden",t),...a})}function k({className:t,...a}){return e.jsx("div",{"data-slot":"sidebar-group","data-sidebar":"group",className:l("relative flex w-full min-w-0 flex-col p-2",t),...a})}function H({className:t,asChild:a=!1,...n}){const s=a?R:"div";return e.jsx(s,{"data-slot":"sidebar-group-label","data-sidebar":"group-label",className:l("text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0","group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",t),...n})}function F({className:t,...a}){return e.jsx("div",{"data-slot":"sidebar-group-content","data-sidebar":"group-content",className:l("w-full text-sm",t),...a})}function K({className:t,...a}){return e.jsx("ul",{"data-slot":"sidebar-menu","data-sidebar":"menu",className:l("flex w-full min-w-0 flex-col gap-1",t),...a})}function w({className:t,...a}){return e.jsx("li",{"data-slot":"sidebar-menu-item","data-sidebar":"menu-item",className:l("group/menu-item relative",t),...a})}const Bt=Ne("peer/menu-button flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0",{variants:{variant:{default:"hover:bg-sidebar-accent hover:text-sidebar-accent-foreground",outline:"bg-background shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]"},size:{default:"h-8 text-sm",sm:"h-7 text-xs",lg:"h-12 text-sm group-data-[collapsible=icon]:p-0!"}},defaultVariants:{variant:"default",size:"default"}});function g({asChild:t=!1,isActive:a=!1,variant:n="default",size:s="default",tooltip:i,className:o,...d}){const u=t?R:"button",{isMobile:f,state:c}=A(),m=e.jsx(u,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":s,"data-active":a,className:l(Bt({variant:n,size:s}),o),...d});return i?(typeof i=="string"&&(i={children:i}),e.jsxs(Ct,{children:[e.jsx(St,{asChild:!0,children:m}),e.jsx(kt,{side:"right",align:"center",hidden:c!=="collapsed"||f,...i})]})):m}function Gt({className:t,...a}){return e.jsx("ul",{"data-slot":"sidebar-menu-sub","data-sidebar":"menu-sub",className:l("border-sidebar-border mx-3.5 flex min-w-0 translate-x-px flex-col gap-1 border-l px-2.5 py-0.5","group-data-[collapsible=icon]:hidden",t),...a})}function Ht({asChild:t=!1,size:a="md",isActive:n=!1,className:s,...i}){const o=t?R:"a";return e.jsx(o,{"data-slot":"sidebar-menu-sub-button","data-sidebar":"menu-sub-button","data-size":a,"data-active":n,className:l("text-sidebar-foreground ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground active:bg-sidebar-accent active:text-sidebar-accent-foreground [&>svg]:text-sidebar-accent-foreground flex h-7 min-w-0 -translate-x-px items-center gap-2 overflow-hidden rounded-md px-2 outline-hidden focus-visible:ring-2 disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0","data-[active=true]:bg-sidebar-accent data-[active=true]:text-sidebar-accent-foreground",a==="sm"&&"text-xs",a==="md"&&"text-sm","group-data-[collapsible=icon]:hidden",s),...i})}function V({singleton:t}){const{data:a}=O(),{data:n}=me();if(!a)return null;const s=r.useMemo(()=>Object.entries(a).filter(([,i])=>t?i.singleton:!i.singleton).toSorted(([i],[o])=>i.localeCompare(o)),[a,t]);return e.jsx(e.Fragment,{children:s.map(([i,o])=>e.jsx(Gt,{children:e.jsx(Q,{to:t?`/admin/dashboard/${i}/default`:`/admin/dashboard/${i}`,className:({isActive:d,isPending:u})=>u?"pending":d?"active":"",children:({isActive:d})=>e.jsx(Ht,{isActive:d,asChild:!0,children:e.jsxs("div",{children:[e.jsx("span",{className:"inline-block overflow-hidden whitespace-nowrap text-ellipsis text-nowrap",children:o.displayName}),!t&&n?.[i]&&e.jsx("span",{className:"text-xs text-gray-500 ml-auto pr-1 min-w-[25px] text-right",children:Object.keys(n[i]).length})]})})})},o.displayName))})}var M="Collapsible",[Ft,ba]=Re(M),[Kt,I]=Ft(M),oe=r.forwardRef((t,a)=>{const{__scopeCollapsible:n,open:s,defaultOpen:i,disabled:o,onOpenChange:d,...u}=t,[f,c]=Oe({prop:s,defaultProp:i??!1,onChange:d,caller:M});return e.jsx(Kt,{scope:n,disabled:o,contentId:ye(),open:f,onOpenToggle:r.useCallback(()=>c(m=>!m),[c]),children:e.jsx(D.div,{"data-state":T(f),"data-disabled":o?"":void 0,...u,ref:a})})});oe.displayName=M;var re="CollapsibleTrigger",le=r.forwardRef((t,a)=>{const{__scopeCollapsible:n,...s}=t,i=I(re,n);return e.jsx(D.button,{type:"button","aria-controls":i.contentId,"aria-expanded":i.open||!1,"data-state":T(i.open),"data-disabled":i.disabled?"":void 0,disabled:i.disabled,...s,ref:a,onClick:De(t.onClick,i.onOpenToggle)})});le.displayName=re;var L="CollapsibleContent",de=r.forwardRef((t,a)=>{const{forceMount:n,...s}=t,i=I(L,t.__scopeCollapsible);return e.jsx(Ae,{present:n||i.open,children:({present:o})=>e.jsx(Vt,{...s,ref:a,present:o})})});de.displayName=L;var Vt=r.forwardRef((t,a)=>{const{__scopeCollapsible:n,present:s,children:i,...o}=t,d=I(L,n),[u,f]=r.useState(s),c=r.useRef(null),m=Ce(a,c),C=r.useRef(0),b=C.current,j=r.useRef(0),p=j.current,v=d.open||u,S=r.useRef(v),x=r.useRef(void 0);return r.useEffect(()=>{const h=requestAnimationFrame(()=>S.current=!1);return()=>cancelAnimationFrame(h)},[]),Ie(()=>{const h=c.current;if(h){x.current=x.current||{transitionDuration:h.style.transitionDuration,animationName:h.style.animationName},h.style.transitionDuration="0s",h.style.animationName="none";const $=h.getBoundingClientRect();C.current=$.height,j.current=$.width,S.current||(h.style.transitionDuration=x.current.transitionDuration,h.style.animationName=x.current.animationName),f(s)}},[d.open,s]),e.jsx(D.div,{"data-state":T(d.open),"data-disabled":d.disabled?"":void 0,id:d.contentId,hidden:!v,...o,ref:m,style:{"--radix-collapsible-content-height":b?`${b}px`:void 0,"--radix-collapsible-content-width":p?`${p}px`:void 0,...t.style},children:v&&i})});function T(t){return t?"open":"closed"}var qt=oe;function q({...t}){return e.jsx(qt,{"data-slot":"collapsible",...t})}function U({...t}){return e.jsx(le,{"data-slot":"collapsible-trigger",...t})}function W({...t}){return e.jsx(de,{"data-slot":"collapsible-content",...t})}function Ut(){const t=fe(),[a,n]=r.useState(!1),[s]=ge(),[i]=je(),[o]=ve(),[d,u]=r.useState(!1),{data:f}=we(),{data:c}=O(),m=r.useMemo(()=>c&&!!Object.values(c).find(p=>!p.singleton),[c]),C=r.useMemo(()=>c&&!!Object.values(c).find(p=>p.singleton),[c]),b=E(p=>p.auth.user),j=async p=>{u(!0);try{await s({author:p}).unwrap()?z.success("Content published successfully."):z.error("Publishing failed.")}catch(v){z.error("Publishing failed."),console.error(v)}finally{u(!1)}};return e.jsxs(At,{className:"z-50",children:[e.jsx(ft,{isOpen:a,setOpen:n}),e.jsx(Lt,{className:"h-14 justify-center",children:e.jsx(k,{children:e.jsx(y,{to:"/admin/dashboard",className:"text-3xl font-semibold tracking-tight transition-colors",children:f?.name})})}),e.jsxs($t,{children:[e.jsxs(k,{children:[e.jsx(H,{children:"Content"}),e.jsx(F,{children:e.jsxs(K,{children:[e.jsx(q,{className:"group/collapsible",disabled:!m,children:e.jsxs(w,{children:[e.jsx(U,{asChild:!0,children:e.jsxs(g,{className:"group",children:[e.jsx(Qe,{}),e.jsx("span",{children:"Collections"}),e.jsx(B,{className:"transition-transform ml-auto -mr-[2px] group-data-[state=open]:rotate-180"})]})}),e.jsx(W,{children:e.jsx(V,{})})]})}),e.jsx(q,{className:"group/collapsible",disabled:!C,children:e.jsxs(w,{children:[e.jsx(U,{asChild:!0,children:e.jsxs(g,{className:"group",children:[e.jsx(st,{}),e.jsx("span",{children:"Singles"}),e.jsx(B,{className:"transition-transform ml-auto -mr-[2px] group-data-[state=open]:rotate-180"})]})}),e.jsx(W,{children:e.jsx(V,{singleton:!0})})]})}),e.jsx(w,{children:e.jsx(g,{asChild:!0,children:e.jsxs(y,{to:"/admin/dashboard/files",children:[e.jsx(Ue,{}),e.jsx("span",{children:"Files"})]})})}),e.jsx(w,{children:e.jsxs(g,{disabled:!0,children:[e.jsx(Ve,{}),e.jsx("span",{children:"Components"})]})})]})})]}),e.jsxs(k,{children:[e.jsx(H,{children:"Actions"}),e.jsx(F,{children:e.jsxs(K,{children:[b?.role==="developer"&&e.jsxs(e.Fragment,{children:[e.jsx(w,{children:e.jsxs(g,{className:"cursor-pointer",onClick:()=>i(),children:[e.jsx(Le,{}),e.jsx("span",{children:"Pull from repo"})]})}),e.jsx(w,{children:e.jsxs(g,{className:"cursor-pointer",onClick:()=>o({author:b.email}),children:[e.jsx(Te,{}),e.jsx("span",{children:"Push to repo"})]})})]}),b&&e.jsx(w,{children:e.jsxs(g,{className:"cursor-pointer",onClick:()=>{j(b.email)},children:[d?e.jsx($e,{className:"animate-spin"}):e.jsx(Be,{}),e.jsx("span",{children:"Publish"})]})})]})})]}),e.jsx(k,{})]}),e.jsxs(Tt,{children:[e.jsx(g,{asChild:!0,children:e.jsxs(y,{to:f?.previewUrl,children:["Preview",e.jsx(Ge,{className:"ml-auto"})]})}),e.jsx(g,{className:"cursor-pointer",onClick:()=>n(!0),children:"About"}),e.jsxs(g,{className:"cursor-pointer",onClick:()=>t(be()),children:[e.jsx(Je,{}),"Log out"]}),e.jsxs("div",{"data-slot":"sidebar-group-label","data-sidebar":"group-label",className:"text-sidebar-foreground/70 ring-sidebar-ring flex h-8 shrink-0 items-center rounded-md px-2 text-xs font-medium outline-hidden transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-4 [&>svg]:shrink-0 group-data-[collapsible=icon]:-mt-8 group-data-[collapsible=icon]:opacity-0",children:["Editorial v","6.11.0"]})]})]})}function Wt({children:t}){const a=ce(),n=E(i=>i.auth.user),s=E(i=>i.auth.isLoading);return r.useEffect(()=>{!s&&!n&&a("/admin")},[s,a,n]),s||!n?e.jsx(He,{}):t}function Qt(){const{pathname:t}=ue(),{data:a}=O(),n=t.split("/").filter(s=>!["admin","dashboard"].includes(s)&&s!=="");return a?e.jsx(e.Fragment,{children:n.map((s,i,o)=>e.jsxs(he.Fragment,{children:[o.length>1&&i>=1&&e.jsx(Fe,{size:12,className:"text-gray-500 pt-[1px]"}),e.jsxs("p",{className:"text-sm leading-none tracking-tight capitalize text-gray-500 last:text-foreground",children:[i<o.length-1&&a[s]&&a[s].singleton&&(a[s]?a[s].displayName:s),i<o.length-1&&a[s]&&!a[s].singleton&&e.jsx(Q,{to:`/admin/dashboard/${s}`,className:({isActive:d,isPending:u})=>u?"pending":d?"active":"",children:a[s]?a[s].displayName:s}),i===o.length-1&&(a[s]?a[s].displayName:s)]},s)]},i))}):null}const ma=pe(function(){return e.jsx(Wt,{children:e.jsxs(Dt,{className:"flex h-full",children:[e.jsx(Ut,{}),e.jsxs("main",{className:"flex flex-col flex-1 h-full w-0",children:[e.jsx("header",{className:"flex sticky bg-sidebar dark:bg-sidebar z-40 top-0 h-14 shrink-0 items-center gap-2 border-b",children:e.jsxs("div",{className:"flex items-center gap-2 px-3",children:[e.jsx(It,{}),e.jsx(bt,{orientation:"vertical",className:"h-4"}),e.jsx(Qt,{})]})}),e.jsx(xe,{})]})]})})});export{ma as default};
@@ -1 +0,0 @@
1
- import{w as e,p as o}from"./chunk-EF7DTUVF-CaKisB5m.js";import{F as r}from"./files-DwkfV9QP.js";import"./utils-fIb4EhUB.js";import"./index-CQnetejS.js";import"./upload-C84AIRF5.js";import"./createLucideIcon-BweVylaW.js";import"./trash-BPu8wmdf.js";import"./chevron-down-CtNmiOMb.js";const n=e(function(){return o.jsx("div",{className:"overflow-auto flex flex-1 p-4 gap-4",children:o.jsx("div",{className:"flex flex-col flex-1 gap-8",children:o.jsx(r,{})})})});export{n as default};
@@ -1 +0,0 @@
1
- import{p as r}from"./chunk-EF7DTUVF-CaKisB5m.js";import{B as l}from"./button-Dxr-3uFz.js";import{P as n,a as p,f as c,C as f,b as u,c as x}from"./clear-button-wZQNsrkz.js";import{a as d}from"./utils-fIb4EhUB.js";import{C as j}from"./calendar-DVBBYeOW.js";import"./index-CQnetejS.js";import"./createLucideIcon-BweVylaW.js";import"./chevron-right-haBQNeuE.js";import"./chevron-down-CtNmiOMb.js";import"./index-PuNjdK9F.js";import"./index-46piFQ87.js";import"./index-BJ-ODQ_I.js";import"./index-BxJwj7VX.js";import"./tslib.es6-Dilv5nzk.js";import"./index-CEA_25hA.js";import"./x-BI8YVnoZ.js";function $({id:e,date:t,onDateChange:o,placeholder:s="Pick a date",disabled:i=!1,className:a,allowClear:m=!1}){return r.jsxs(n,{children:[r.jsx(p,{asChild:!0,children:r.jsx(l,{variant:"outline",className:d("w-full justify-start text-left font-normal relative",!t&&"text-muted-foreground",a),disabled:i,children:r.jsxs(r.Fragment,{children:[r.jsx(j,{className:"mr-2 h-4 w-4"}),t?c(t,"PPP"):r.jsx("span",{children:s}),r.jsx(f,{onClear:()=>{o?.(void 0)},visible:m&&!!t})]})})}),r.jsx(u,{className:"w-auto p-0",children:r.jsx(x,{id:e,mode:"single",selected:t,onSelect:o,initialFocus:!0})})]})}export{$ as default};