@isardsat/editorial-admin 6.10.0 → 6.11.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.
- package/build/client/assets/FilePicker-BoyljzKd.js +1 -0
- package/build/client/assets/{Loading-BhRjqdjg.js → Loading-DkkTJbsn.js} +1 -1
- package/build/client/assets/URLInput-DZIiMxgx.js +1 -0
- package/build/client/assets/arrow-up-LKnZ72Ym.js +11 -0
- package/build/client/assets/{authSlice-d1KLksEc.js → authSlice-DFHOkK9j.js} +1 -1
- package/build/client/assets/{button-CLU225WL.js → button-Dxr-3uFz.js} +1 -1
- package/build/client/assets/{clear-button-CwpymKyn.js → clear-button-wZQNsrkz.js} +1 -1
- package/build/client/assets/{dashboard-BwSPRYBU.js → dashboard-eVXdEFvy.js} +1 -1
- package/build/client/assets/dashboard._collection-C25Nlh67.js +26 -0
- package/build/client/assets/dashboard._collection._document-Clg8DIhx.js +1 -0
- package/build/client/assets/dashboard._collection.new-CBIwONjS.js +1 -0
- package/build/client/assets/{dashboard._layout-Bes144Yl.js → dashboard._layout-BT5UJmod.js} +8 -18
- package/build/client/assets/{dashboard.files-Bhpq4xHl.js → dashboard.files-D1Oj8glB.js} +1 -1
- package/build/client/assets/{date-picker-Bf3MUdjK.js → date-picker-CYFCrG85.js} +1 -1
- package/build/client/assets/datetime-picker-RVcJa-hA.js +1 -0
- package/build/client/assets/{files-etseKA58.js → files-DwkfV9QP.js} +1 -1
- package/build/client/assets/home-BsxAOkSU.js +1 -0
- package/build/client/assets/{index-NRYqpySi.js → index-46piFQ87.js} +1 -1
- package/build/client/assets/{index-BuTy8eAk.js → index-Be3bqnxd.js} +1 -1
- package/build/client/assets/{index-8UmwgoSB.js → index-BxJwj7VX.js} +1 -1
- package/build/client/assets/{index-4XG4HPxE.js → index-CEA_25hA.js} +1 -1
- package/build/client/assets/{index-BeLOjj93.js → index-CQnetejS.js} +1 -1
- package/build/client/assets/index-CttGRTCZ.js +22 -0
- package/build/client/assets/{index-DWHslogn.js → index-PuNjdK9F.js} +1 -1
- package/build/client/assets/input-xJI2b5Sp.js +1 -0
- package/build/client/assets/{itemForm-BAe4tE4w.js → itemForm-CFpASfjf.js} +5 -5
- package/build/client/assets/manifest-6d3a9622.js +1 -0
- package/build/client/assets/{markdownEditor-B3_ygKXr.js → markdownEditor-BmmlxrMb.js} +1 -1
- package/build/client/assets/root-1Wb14VaX.css +1 -0
- package/build/client/assets/{root-CL9mhJVP.js → root-BeK-V6m1.js} +2 -2
- package/build/client/assets/{schemas-DZfv8pS7.js → schemas-Cg4zf3bl.js} +5 -5
- package/build/client/assets/{utils-CZqhhZtB.js → utils-fIb4EhUB.js} +2 -2
- package/build/client/favicon.ico +0 -0
- package/build/client/index.html +2 -2
- package/package.json +2 -2
- package/build/client/assets/FilePicker-CH7xRnml.js +0 -1
- package/build/client/assets/URLInput-DY9DAWXz.js +0 -1
- package/build/client/assets/dashboard._collection-ECb0L7dZ.js +0 -21
- package/build/client/assets/dashboard._collection._document-C5QNRGhd.js +0 -1
- package/build/client/assets/dashboard._collection.new-wj-L1Zs-.js +0 -1
- package/build/client/assets/datetime-picker-xfRCBls_.js +0 -1
- package/build/client/assets/home-Df-x8RAj.js +0 -1
- package/build/client/assets/index-B21y1sd-.js +0 -22
- package/build/client/assets/manifest-713d5bf8.js +0 -1
- package/build/client/assets/root-BdZpxusE.css +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as d,p as e,x}from"./chunk-EF7DTUVF-CaKisB5m.js";import{r as p}from"./utils-fIb4EhUB.js";import{F as f}from"./files-DwkfV9QP.js";import{B as a}from"./button-Dxr-3uFz.js";import{I as u}from"./input-xJI2b5Sp.js";import{E as h}from"./external-link-LWykkN17.js";import{X as j}from"./x-BI8YVnoZ.js";import"./index-CQnetejS.js";import"./upload-C84AIRF5.js";import"./createLucideIcon-BweVylaW.js";import"./trash-BPu8wmdf.js";import"./chevron-down-CtNmiOMb.js";function B({id:o,value:r,name:n,register:m,onChange:s}){const{isLoading:t}=p(),[c,i]=d.useState(!1);return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("div",{className:"relative flex items-center flex-1",children:[e.jsx(u,{id:o,...m(n),type:"text",value:t?"Loading...":r,readOnly:!0,onClick:()=>{i(!0)},onChange:l=>s(l.target.value),className:"border p-2 rounded",disabled:t}),e.jsx(x,{to:`/${r}`,className:"absolute right-2",target:"_blank",children:e.jsx(h,{className:"h-4"})})]}),e.jsx(a,{type:"button",onClick:()=>s(""),className:"text-white px-4 py-2 rounded",disabled:t,children:"Clear"})]}),c&&e.jsx("div",{className:"fixed inset-0 bg-black/40 flex items-center justify-center z-50",children:e.jsxs("div",{className:"bg-white p-4 rounded-lg shadow-lg max-w-2xl w-full max-h-[80vh] overflow-y-auto",children:[e.jsxs("div",{className:"flex justify-between items-center mb-4",children:[e.jsx("h2",{className:"text-xl font-bold",children:"Select File"}),e.jsx(a,{onClick:()=>i(!1),children:e.jsx(j,{})})]}),e.jsx(f,{onChange:l=>{i(!1),s(l)}})]})})]})}export{B as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as i,p as a}from"./chunk-EF7DTUVF-CaKisB5m.js";import{a as o}from"./utils-
|
|
1
|
+
import{a as i,p as a}from"./chunk-EF7DTUVF-CaKisB5m.js";import{a as o}from"./utils-fIb4EhUB.js";import{L as d}from"./tslib.es6-Dilv5nzk.js";import{c as p}from"./createLucideIcon-BweVylaW.js";/**
|
|
2
2
|
* @license lucide-react v0.487.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{p as e,x as r}from"./chunk-EF7DTUVF-CaKisB5m.js";import{I as s}from"./input-xJI2b5Sp.js";import{E as i}from"./external-link-LWykkN17.js";import"./utils-fIb4EhUB.js";import"./createLucideIcon-BweVylaW.js";function x({...t}){return e.jsxs("div",{className:"relative flex justify-center items-center",children:[e.jsx(s,{...t}),t.value&&e.jsx(r,{to:t.value,className:"flex items-center absolute right-0 mr-3",children:e.jsx(i,{className:"h-4 bg-white hover:text-blue-500"})})]})}export{x as default};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import{c as o}from"./createLucideIcon-BweVylaW.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 r=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],t=o("arrow-down",r);/**
|
|
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 a=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],c=o("arrow-up",a);export{t as A,c as a};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as mi}from"./tslib.es6-Dilv5nzk.js";import{y as Ba,z as Ha,A as Va,B as $a,e as Ga,C as ja}from"./utils-
|
|
1
|
+
import{a as mi}from"./tslib.es6-Dilv5nzk.js";import{y as Ba,z as Ha,A as Va,B as $a,e as Ga,C as ja}from"./utils-fIb4EhUB.js";/**
|
|
2
2
|
* @license
|
|
3
3
|
* Copyright 2025 Google LLC
|
|
4
4
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as a}from"./chunk-EF7DTUVF-CaKisB5m.js";import{S as o,c as d}from"./index-
|
|
1
|
+
import{p as a}from"./chunk-EF7DTUVF-CaKisB5m.js";import{S as o,c as d}from"./index-CQnetejS.js";import{a as u}from"./utils-fIb4EhUB.js";const c=d("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-xs hover:bg-primary/90",destructive:"bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60",outline:"border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-9 px-4 py-2 has-[>svg]:px-3",sm:"h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5",lg:"h-10 rounded-md px-6 has-[>svg]:px-4",icon:"size-9"}},defaultVariants:{variant:"default",size:"default"}});function b({className:e,variant:r,size:t,asChild:i=!1,...s}){const n=i?o:"button";return a.jsx(n,{"data-slot":"button",className:u(c({variant:r,size:t,className:e})),...s})}export{b as B,c as b};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{R as f,a as _,p as z}from"./chunk-EF7DTUVF-CaKisB5m.js";import{b as Qe,B as sn}from"./button-
|
|
1
|
+
import{R as f,a as _,p as z}from"./chunk-EF7DTUVF-CaKisB5m.js";import{b as Qe,B as sn}from"./button-Dxr-3uFz.js";import{a as W}from"./utils-fIb4EhUB.js";import{c as cn}from"./createLucideIcon-BweVylaW.js";import{C as un}from"./chevron-right-haBQNeuE.js";import{C as dn}from"./chevron-down-CtNmiOMb.js";import{R as ln,T as fn,P as hn,C as mn}from"./index-PuNjdK9F.js";import{X as yn}from"./x-BI8YVnoZ.js";/**
|
|
2
2
|
* @license lucide-react v0.487.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e,a as w,x as C,w as V}from"./chunk-EF7DTUVF-CaKisB5m.js";import{a as x,i,d as N,b as v,j as H,k as L}from"./utils-
|
|
1
|
+
import{p as e,a as w,x as C,w as V}from"./chunk-EF7DTUVF-CaKisB5m.js";import{a as x,i,d as N,b as v,j as H,k as L}from"./utils-fIb4EhUB.js";import{c as D,u as y,T as R,a as T,b as m,d as $,f as u,e as A,g as k,h as I}from"./index-CttGRTCZ.js";function M({className:t,...l}){return e.jsx("div",{"data-slot":"skeleton",className:x("bg-accent animate-pulse rounded-md",t),...l})}function b({className:t,title:l,value:o,isLoading:n,...a}){return e.jsxs("div",{className:x("border border-border rounded-xl p-6",t),...a,children:[e.jsx("h3",{className:"text-xs text-muted-foreground",children:l}),n?e.jsx(M,{className:"h-[2.25rem] w-16"}):e.jsx("p",{className:"text-lg sm:text-3xl font-bold leading-none",children:o})]})}const h=D(),g=[h.accessor("id",{header(){return e.jsx("span",{className:"block w-48 max-w-48",children:"ID"})},cell(t){const l=t.getValue();return e.jsx("span",{title:l,className:"block overflow-hidden text-ellipsis w-48 max-w-48 whitespace-nowrap",children:l})}}),h.accessor("createdAt",{header:"Created",cell(t){return i(new Date(t.getValue()))}}),h.accessor("updatedAt",{header:"Updated",cell(t){return i(new Date(t.getValue()))}})];function S(){const{data:t}=N(),{data:l}=v(),o=w.useMemo(()=>!t||!l?[]:Object.entries(t).reduce((r,[d,p])=>r.concat(Object.values(p).filter(c=>c.isDraft).map(c=>({...c,type:d}))),[]).toSorted((r,d)=>r.updatedAt>d.updatedAt?-1:1).slice(0,6),[t,l]),n=y({data:o,columns:g,getCoreRowModel:I()});return n.getRowCount()===0?null:e.jsxs("div",{className:"flex flex-col gap-4 last:mb-20",children:[e.jsx("h2",{className:"scroll-mt-[4.5rem] text-xl font-semibold leading-none capitalize",children:"Drafts"}),e.jsx("div",{className:"rounded-sm border overflow-auto",children:e.jsxs(R,{children:[e.jsx(T,{children:n.getHeaderGroups().map(a=>e.jsx(m,{className:"grid",style:{gridTemplateColumns:`repeat(${g.length}, minmax(200px, 1fr))`},children:a.headers.map(s=>e.jsx($,{children:s.isPlaceholder?null:u(s.column.columnDef.header,s.getContext())},s.id))},a.id))}),e.jsx(A,{children:n.getRowModel().rows.map(a=>e.jsx(C,{to:`/admin/dashboard/${a.original.type}/${a.original.id}`,children:e.jsx(m,{className:"grid",style:{gridTemplateColumns:`repeat(${g.length}, minmax(200px, 1fr))`},children:a.getVisibleCells().map(s=>e.jsx(k,{className:x("p-2"),children:u(s.column.columnDef.cell,s.getContext())},s.id))},a.id)},a.original.id))})]})})]})}const f=D(),j=[f.accessor("id",{header(){return e.jsx("span",{className:"block w-48 max-w-48",children:"ID"})},cell(t){const l=t.getValue();return e.jsx("span",{title:l,className:"block overflow-hidden text-ellipsis w-48 max-w-48 whitespace-nowrap",children:l})}}),f.accessor("createdAt",{header:"Created",cell(t){return i(new Date(t.getValue()))}}),f.accessor("updatedAt",{header:"Updated",cell(t){return i(new Date(t.getValue()))}})];function G(){const{data:t}=N(),{data:l}=v(),o=w.useMemo(()=>!t||!l?[]:Object.entries(t).filter(([r])=>r in l).reduce((r,[d,p])=>r.concat(Object.values(p).map(c=>({...c,type:d}))),[]).toSorted((r,d)=>r.updatedAt>d.updatedAt?-1:1).slice(0,6),[t,l]),n=y({data:o,columns:j,getCoreRowModel:I()});return n.getRowCount()===0?null:e.jsxs("div",{className:"flex flex-col gap-4 last:mb-20",children:[e.jsx("h2",{className:"scroll-mt-[4.5rem] text-xl font-semibold leading-none capitalize",children:"Recently Updated"}),e.jsx("div",{className:"rounded-sm border overflow-auto",children:e.jsxs(R,{children:[e.jsx(T,{children:n.getHeaderGroups().map(a=>e.jsx(m,{className:"grid",style:{gridTemplateColumns:`repeat(${j.length}, minmax(200px, 1fr))`},children:a.headers.map(s=>e.jsx($,{children:s.isPlaceholder?null:u(s.column.columnDef.header,s.getContext())},s.id))},a.id))}),e.jsx(A,{children:n.getRowModel().rows.map(a=>e.jsx(C,{to:`/admin/dashboard/${a.original.type}/${a.original.id}`,children:e.jsx(m,{className:"grid",style:{gridTemplateColumns:`repeat(${j.length}, minmax(200px, 1fr))`},children:a.getVisibleCells().map(s=>e.jsx(k,{className:x("p-2"),children:u(s.column.columnDef.cell,s.getContext())},s.id))},a.id)},a.original.id))})]})})]})}const U=V(function(){const{data:l,isLoading:o}=H(),{data:n,isLoading:a}=L();return e.jsx("div",{className:"flex flex-1 h-full p-4 gap-4",children:e.jsxs("div",{className:"flex flex-col overflow-hidden flex-1 gap-4",children:[e.jsxs("div",{className:"flex flex-row gap-2 grid-cols-12",children:[e.jsx(b,{className:"w-full sm:w-44",title:"Items",value:l,isLoading:o}),e.jsx(b,{className:"w-full sm:w-44",title:"Files",value:n,isLoading:a})]}),e.jsx(G,{}),e.jsx(S,{})]})})});export{U as default};
|
|
@@ -0,0 +1,26 @@
|
|
|
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};
|
|
@@ -0,0 +1 @@
|
|
|
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};
|
|
@@ -0,0 +1 @@
|
|
|
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,46 +1,36 @@
|
|
|
1
|
-
import{p as e,a as r,x as
|
|
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
2
|
* @license lucide-react v0.487.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
5
5
|
* See the LICENSE file in the root directory of this source tree.
|
|
6
|
-
*/const
|
|
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
7
|
* @license lucide-react v0.487.0 - ISC
|
|
8
8
|
*
|
|
9
9
|
* This source code is licensed under the ISC license.
|
|
10
10
|
* See the LICENSE file in the root directory of this source tree.
|
|
11
|
-
*/const qe=[["path",{d:"
|
|
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
12
|
* @license lucide-react v0.487.0 - ISC
|
|
13
13
|
*
|
|
14
14
|
* This source code is licensed under the ISC license.
|
|
15
15
|
* See the LICENSE file in the root directory of this source tree.
|
|
16
|
-
*/const
|
|
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
17
|
* @license lucide-react v0.487.0 - ISC
|
|
18
18
|
*
|
|
19
19
|
* This source code is licensed under the ISC license.
|
|
20
20
|
* See the LICENSE file in the root directory of this source tree.
|
|
21
|
-
*/const
|
|
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
22
|
* @license lucide-react v0.487.0 - ISC
|
|
23
23
|
*
|
|
24
24
|
* This source code is licensed under the ISC license.
|
|
25
25
|
* See the LICENSE file in the root directory of this source tree.
|
|
26
|
-
*/const
|
|
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
27
|
* @license lucide-react v0.487.0 - ISC
|
|
28
28
|
*
|
|
29
29
|
* This source code is licensed under the ISC license.
|
|
30
30
|
* See the LICENSE file in the root directory of this source tree.
|
|
31
|
-
*/const
|
|
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
32
|
* @license lucide-react v0.487.0 - ISC
|
|
33
33
|
*
|
|
34
34
|
* This source code is licensed under the ISC license.
|
|
35
35
|
* See the LICENSE file in the root directory of this source tree.
|
|
36
|
-
*/const et=[["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"}]],tt=w("log-out",et);/**
|
|
37
|
-
* @license lucide-react v0.487.0 - ISC
|
|
38
|
-
*
|
|
39
|
-
* This source code is licensed under the ISC license.
|
|
40
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
41
|
-
*/const at=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],st=w("panel-left",at);/**
|
|
42
|
-
* @license lucide-react v0.487.0 - ISC
|
|
43
|
-
*
|
|
44
|
-
* This source code is licensed under the ISC license.
|
|
45
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
46
|
-
*/const nt=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],ot=w("square",nt);function it({...t}){return e.jsx(X,{"data-slot":"dialog",...t})}function rt({...t}){return e.jsx(te,{"data-slot":"dialog-portal",...t})}function lt({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 dt({className:t,children:a,...n}){return e.jsxs(rt,{"data-slot":"dialog-portal",children:[e.jsx(lt,{}),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 ct({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 ut({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 ht({className:t,...a}){return e.jsx(J,{"data-slot":"dialog-title",className:l("text-lg leading-none font-semibold",t),...a})}function pt({className:t,...a}){return e.jsx(ee,{"data-slot":"dialog-description",className:l("text-muted-foreground text-sm",t),...a})}const xt="#181717",ft=r.forwardRef(function({title:a="GitHub",color:n="currentColor",size:s=24,...o},i){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:i,...o,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"})]})}),bt="#85EA2D",G=r.forwardRef(function({title:a="Swagger",color:n="currentColor",size:s=24,...o},i){return n==="default"&&(n=bt),e.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:s,height:s,fill:n,viewBox:"0 0 24 24",ref:i,...o,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 mt({isOpen:t,setOpen:a}){return e.jsx(it,{open:t,onOpenChange:n=>a(n),children:e.jsxs(dt,{children:[e.jsxs(ct,{children:[e.jsx(ht,{children:"Editorial"}),e.jsx(pt,{children:"A simple CMS for static websites"})]}),e.jsxs("div",{className:"flex gap-1",children:[e.jsx(_,{asChild:!0,variant:"ghost",children:e.jsxs(N,{to:"https://lobelia-earth.github.io/editorial/",children:[e.jsx(G,{size:14}),"Documentation"]})}),e.jsx(_,{asChild:!0,variant:"ghost",children:e.jsxs(N,{to:"/doc/ui",children:[e.jsx(G,{size:14}),"Swagger API UI"]})}),e.jsx(_,{asChild:!0,variant:"ghost",children:e.jsxs(N,{to:"https://github.com/Lobelia-Earth/editorial",children:[e.jsx(ft,{size:14}),"GitHub repository"]})})]}),e.jsx(ut,{children:e.jsxs("p",{className:"flex items-center gap-1",children:["Created with",e.jsx(Je,{size:14,className:"stroke-red-500 fill-red-500"})," by"," ",e.jsx(N,{to:"https://lobelia.earth",className:"underline hover:text-blue-500",children:"Lobelia.earth"})]})})]})})}function gt({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 jt({...t}){return e.jsx(X,{"data-slot":"sheet",...t})}function vt({...t}){return e.jsx(te,{"data-slot":"sheet-portal",...t})}function wt({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 yt({className:t,children:a,side:n="right",...s}){return e.jsxs(vt,{children:[e.jsx(wt,{}),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 Nt({className:t,...a}){return e.jsx("div",{"data-slot":"sheet-header",className:l("flex flex-col gap-1.5 p-4",t),...a})}function Ct({className:t,...a}){return e.jsx(J,{"data-slot":"sheet-title",className:l("text-foreground font-semibold",t),...a})}function St({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 kt({...t}){return e.jsx(ne,{children:e.jsx(_e,{"data-slot":"tooltip",...t})})}function _t({...t}){return e.jsx(Me,{"data-slot":"tooltip-trigger",...t})}function Mt({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(Oe,{className:"bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}const P=768;function zt(){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 Pt="sidebar_state",Ot=3600*24*7,Rt="16rem",Dt="18rem",Et="3rem",At="b",oe=r.createContext(null);function A(){const t=r.useContext(oe);if(!t)throw new Error("useSidebar must be used within a SidebarProvider.");return t}function It({defaultOpen:t=!0,open:a,onOpenChange:n,className:s,style:o,children:i,...d}){const u=zt(),[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=`${Pt}=${h}; path=/; max-age=${Ot}`},[n,b]),p=r.useCallback(()=>u?c(x=>!x):j(x=>!x),[u,j,c]);r.useEffect(()=>{const x=h=>{h.key===At&&(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(oe.Provider,{value:S,children:e.jsx(ne,{delayDuration:0,children:e.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":Rt,"--sidebar-width-icon":Et,...o},className:l("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",s),...d,children:i})})})}function Lt({side:t="left",variant:a="sidebar",collapsible:n="offcanvas",className:s,children:o,...i}){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),...i,children:o}):d?e.jsx(jt,{open:f,onOpenChange:c,...i,children:e.jsxs(yt,{"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":Dt},side:t,children:[e.jsxs(Nt,{className:"sr-only",children:[e.jsx(Ct,{children:"Sidebar"}),e.jsx(St,{children:"Displays the mobile sidebar."})]}),e.jsx("div",{className:"flex h-full w-full flex-col",children:o})]})}):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),...i,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:o})})]})}function Tt({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:o=>{a?.(o),s()},...n,children:[e.jsx(st,{}),e.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function $t({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 Bt({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 Gt({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?D:"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 q({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 y({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 Ht=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:o,className:i,...d}){const u=t?D:"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(Ht({variant:n,size:s}),i),...d});return o?(typeof o=="string"&&(o={children:o}),e.jsxs(kt,{children:[e.jsx(_t,{asChild:!0,children:m}),e.jsx(Mt,{side:"right",align:"center",hidden:c!=="collapsed"||f,...o})]})):m}function Ft({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 qt({asChild:t=!1,size:a="md",isActive:n=!1,className:s,...o}){const i=t?D:"a";return e.jsx(i,{"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),...o})}function V({singleton:t}){const{data:a}=R(),{data:n}=me();if(!a)return null;const s=r.useMemo(()=>Object.entries(a).filter(([,o])=>t?o.singleton:!o.singleton).toSorted(([o],[i])=>o.localeCompare(i)),[a,t]);return e.jsx(e.Fragment,{children:s.map(([o,i])=>e.jsx(Ft,{children:e.jsx(Q,{to:t?`/admin/dashboard/${o}/default`:`/admin/dashboard/${o}`,className:({isActive:d,isPending:u})=>u?"pending":d?"active":"",children:({isActive:d})=>e.jsx(qt,{isActive:d,asChild:!0,children:e.jsxs("div",{children:[e.jsx("span",{className:"inline-block overflow-hidden whitespace-nowrap text-ellipsis text-nowrap",children:i.displayName}),!t&&n?.[o]&&e.jsx("span",{className:"text-xs text-gray-500 ml-auto pr-1 min-w-[25px] text-right",children:Object.keys(n[o]).length})]})})})},i.displayName))})}var M="Collapsible",[Vt,ma]=De(M),[Kt,I]=Vt(M),ie=r.forwardRef((t,a)=>{const{__scopeCollapsible:n,open:s,defaultOpen:o,disabled:i,onOpenChange:d,...u}=t,[f,c]=Re({prop:s,defaultProp:o??!1,onChange:d,caller:M});return e.jsx(Kt,{scope:n,disabled:i,contentId:ye(),open:f,onOpenToggle:r.useCallback(()=>c(m=>!m),[c]),children:e.jsx(E.div,{"data-state":T(f),"data-disabled":i?"":void 0,...u,ref:a})})});ie.displayName=M;var re="CollapsibleTrigger",le=r.forwardRef((t,a)=>{const{__scopeCollapsible:n,...s}=t,o=I(re,n);return e.jsx(E.button,{type:"button","aria-controls":o.contentId,"aria-expanded":o.open||!1,"data-state":T(o.open),"data-disabled":o.disabled?"":void 0,disabled:o.disabled,...s,ref:a,onClick:Ee(t.onClick,o.onOpenToggle)})});le.displayName=re;var L="CollapsibleContent",de=r.forwardRef((t,a)=>{const{forceMount:n,...s}=t,o=I(L,t.__scopeCollapsible);return e.jsx(Ae,{present:n||o.open,children:({present:i})=>e.jsx(Ut,{...s,ref:a,present:i})})});de.displayName=L;var Ut=r.forwardRef((t,a)=>{const{__scopeCollapsible:n,present:s,children:o,...i}=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(E.div,{"data-state":T(d.open),"data-disabled":d.disabled?"":void 0,id:d.contentId,hidden:!v,...i,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&&o})});function T(t){return t?"open":"closed"}var Wt=ie;function K({...t}){return e.jsx(Wt,{"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 Qt(){const t=fe(),[a,n]=r.useState(!1),[s]=ge(),[o]=je(),[i]=ve(),[d,u]=r.useState(!1),{data:f}=we(),{data:c}=R(),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=O(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(Lt,{className:"z-50",children:[e.jsx(mt,{isOpen:a,setOpen:n}),e.jsx($t,{className:"h-14 justify-center",children:e.jsx(k,{children:e.jsx(N,{to:"/admin/dashboard",className:"text-3xl font-semibold tracking-tight transition-colors",children:f?.name})})}),e.jsxs(Gt,{children:[e.jsxs(k,{children:[e.jsx(H,{children:"Content"}),e.jsx(F,{children:e.jsxs(q,{children:[e.jsx(K,{className:"group/collapsible",disabled:!m,children:e.jsxs(y,{children:[e.jsx(U,{asChild:!0,children:e.jsxs(g,{className:"group",children:[e.jsx(Ze,{}),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(K,{className:"group/collapsible",disabled:!C,children:e.jsxs(y,{children:[e.jsx(U,{asChild:!0,children:e.jsxs(g,{className:"group",children:[e.jsx(ot,{}),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(y,{children:e.jsx(g,{asChild:!0,children:e.jsxs(N,{to:"/admin/dashboard/files",children:[e.jsx(Qe,{}),e.jsx("span",{children:"Files"})]})})}),e.jsx(y,{children:e.jsxs(g,{disabled:!0,children:[e.jsx(Ue,{}),e.jsx("span",{children:"Components"})]})})]})})]}),e.jsxs(k,{children:[e.jsx(H,{children:"Actions"}),e.jsx(F,{children:e.jsxs(q,{children:[b?.role==="developer"&&e.jsxs(e.Fragment,{children:[e.jsx(y,{children:e.jsxs(g,{className:"cursor-pointer",onClick:()=>o(),children:[e.jsx(Fe,{}),e.jsx("span",{children:"Pull from repo"})]})}),e.jsx(y,{children:e.jsxs(g,{className:"cursor-pointer",onClick:()=>i({author:b.email}),children:[e.jsx(Ve,{}),e.jsx("span",{children:"Push to repo"})]})})]}),b&&e.jsx(y,{children:e.jsxs(g,{className:"cursor-pointer",onClick:()=>{j(b.email)},children:[d?e.jsx(Le,{className:"animate-spin"}):e.jsx(Te,{}),e.jsx("span",{children:"Publish"})]})})]})})]}),e.jsx(k,{})]}),e.jsxs(Bt,{children:[e.jsx(g,{asChild:!0,children:e.jsxs(N,{to:f?.previewUrl,children:["Preview",e.jsx($e,{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(tt,{}),"Log out"]})]})]})}function Xt({children:t}){const a=ce(),n=O(o=>o.auth.user),s=O(o=>o.auth.isLoading);return r.useEffect(()=>{!s&&!n&&a("/admin")},[s,a,n]),s||!n?e.jsx(Be,{}):t}function Zt(){const{pathname:t}=ue(),{data:a}=R(),n=t.split("/").filter(s=>!["admin","dashboard"].includes(s)&&s!=="");return a?e.jsx(e.Fragment,{children:n.map((s,o,i)=>e.jsxs(he.Fragment,{children:[i.length>1&&o>=1&&e.jsx(Ge,{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:[o<i.length-1&&a[s]&&a[s].singleton&&(a[s]?a[s].displayName:s),o<i.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}),o===i.length-1&&(a[s]?a[s].displayName:s)]},s)]},o))}):null}const ga=pe(function(){return e.jsx(Xt,{children:e.jsxs(It,{className:"flex h-full",children:[e.jsx(Qt,{}),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(Tt,{}),e.jsx(gt,{orientation:"vertical",className:"h-4"}),e.jsx(Zt,{})]})}),e.jsx(xe,{})]})]})})});export{ga as default};
|
|
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 +1 @@
|
|
|
1
|
-
import{w as e,p as o}from"./chunk-EF7DTUVF-CaKisB5m.js";import{F as r}from"./files-
|
|
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 +1 @@
|
|
|
1
|
-
import{p as r}from"./chunk-EF7DTUVF-CaKisB5m.js";import{B as l}from"./button-
|
|
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};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a,p as t}from"./chunk-EF7DTUVF-CaKisB5m.js";import{B as N}from"./button-Dxr-3uFz.js";import{f as c,P as b,a as H,C as S,b as g,c as k}from"./clear-button-wZQNsrkz.js";import{I as B}from"./input-xJI2b5Sp.js";import{a as E}from"./utils-fIb4EhUB.js";import{C as w}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 W({id:d,date:s,onDateTimeChange:r,placeholder:x="Pick a date and time",disabled:u=!1,className:j,allowClear:v=!1}){const[e,i]=a.useState(s),[l,p]=a.useState(s?c(s,"HH:mm"):"12:00");a.useEffect(()=>{i(s),s&&p(c(s,"HH:mm"))},[s]);const h=a.useCallback(o=>{const m=o.target.value;if(p(m),!e)return;const[n,C]=m.split(":").map(Number),f=new Date(e);f.setHours(n,C,0,0),r?.(f)},[e,r]),P=a.useCallback(o=>{if(!o){i(void 0),r?.(void 0);return}const[m,n]=l.split(":").map(Number);o.setHours(m,n,0,0),i(o),r?.(o)},[l,r]);return t.jsxs("div",{className:"flex gap-2",children:[t.jsxs(b,{children:[t.jsx(H,{asChild:!0,children:t.jsx(N,{variant:"outline",className:E("flex-1 justify-start text-left font-normal relative",!e&&"text-muted-foreground",j),disabled:u,children:t.jsxs(t.Fragment,{children:[t.jsx(w,{className:"mr-2 h-4 w-4"}),e?c(e,"PPP"):t.jsx("span",{children:x}),t.jsx(S,{onClear:()=>{i(void 0),r?.(void 0)},visible:v&&!!s})]})})}),t.jsx(g,{className:"w-auto p-0",children:t.jsx(k,{id:d,mode:"single",selected:e,onSelect:P,initialFocus:!0})})]}),t.jsx(B,{type:"time",value:l,onChange:h,disabled:u||!e,className:"w-32"})]})}export{W as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{p as e,a as g,x as w}from"./chunk-EF7DTUVF-CaKisB5m.js";import{a as v,r as k,t as F,v as z,w as C,u as $,x as M,n as D}from"./utils-
|
|
1
|
+
import{p as e,a as g,x as w}from"./chunk-EF7DTUVF-CaKisB5m.js";import{a as v,r as k,t as F,v as z,w as C,u as $,x as M,n as D}from"./utils-fIb4EhUB.js";import{S as U,c as _}from"./index-CQnetejS.js";import{U as y}from"./upload-C84AIRF5.js";import{F as H,T as L}from"./trash-BPu8wmdf.js";import{c as m}from"./createLucideIcon-BweVylaW.js";import{C as S}from"./chevron-down-CtNmiOMb.js";/**
|
|
2
2
|
* @license lucide-react v0.487.0 - ISC
|
|
3
3
|
*
|
|
4
4
|
* This source code is licensed under the ISC license.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as p,p as e,w as f,v as g}from"./chunk-EF7DTUVF-CaKisB5m.js";import{S as b,L as N}from"./Loading-DkkTJbsn.js";import{B as w}from"./button-Dxr-3uFz.js";import{o as F,b as L,s as d,u as v,a as y,F as C,c as n,d as t,e as x,f as i,g as m,C as S}from"./schemas-Cg4zf3bl.js";import{I as u}from"./input-xJI2b5Sp.js";import{u as E,d as c,l as k}from"./authSlice-DFHOkK9j.js";import"./utils-fIb4EhUB.js";import"./tslib.es6-Dilv5nzk.js";import"./createLucideIcon-BweVylaW.js";import"./index-CQnetejS.js";import"./index-46piFQ87.js";import"./index-BJ-ODQ_I.js";const P=F({email:d().nonempty("Please enter your email").email(),password:d().nonempty("Please enter your password"),remember:L()});function A(){"use no memo";const o=E(),r=c(s=>s.auth.isLoading),a=v({resolver:y(P),disabled:r,defaultValues:{email:"",password:"",remember:!1}}),l=p.useCallback(({email:s,password:h,remember:j})=>{o(k({email:s,password:h,remember:j}))},[o]);return e.jsx("div",{className:"flex flex-col",children:e.jsx(C,{...a,children:e.jsxs("form",{onSubmit:a.handleSubmit(l),className:"space-y-4",children:[e.jsx(n,{control:a.control,name:"email",rules:{required:!0},render:({field:s})=>e.jsxs(t,{children:[e.jsx(x,{className:"flex gap-1 items-baseline",children:"Email"}),e.jsx(i,{children:e.jsx(u,{placeholder:"callasmaria@example.com",...s})}),e.jsx(m,{})]})}),e.jsx(n,{name:"password",control:a.control,rules:{required:!0},render:({field:s})=>e.jsxs(t,{children:[e.jsx(x,{className:"flex gap-1 items-baseline",children:"Password"}),e.jsx(i,{children:e.jsx(u,{type:"password",...s})}),e.jsx(m,{})]})}),e.jsx(n,{name:"remember",control:a.control,render:({field:s})=>e.jsxs(t,{children:[e.jsx(i,{children:e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(S,{id:"remember",checked:s.value,onCheckedChange:s.onChange}),e.jsx("label",{htmlFor:"remember",className:"text-sm leading-none",children:"Remember me"})]})}),e.jsx(m,{})]})}),e.jsx(w,{type:"submit",disabled:!a.formState.isValid||r,className:"w-full",children:r?e.jsx(b,{className:"absolute"}):"Login"})]})})})}const K=f(function(){const r=g(),a=c(s=>s.auth.user),l=c(s=>s.auth.isLoading);return p.useEffect(()=>{a&&r("/admin/dashboard")},[r,a]),l||a?e.jsx(N,{message:"Logging in..."}):e.jsx("div",{className:"flex w-full h-full",children:e.jsxs("div",{className:"self-center space-y-8 w-72 mx-auto",children:[e.jsxs("div",{className:"flex flex-col space-y-2 text-center",children:[e.jsx("h1",{className:"text-2xl font-semibold tracking-tight leading-none",children:"Editorial Admin"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Enter your details below to login"})]}),e.jsx(A,{})]})})});export{K as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as c,p as x,B as y}from"./chunk-EF7DTUVF-CaKisB5m.js";import{u as E,b}from"./index-
|
|
1
|
+
import{a as c,p as x,B as y}from"./chunk-EF7DTUVF-CaKisB5m.js";import{u as E,b}from"./index-CQnetejS.js";import{a as w}from"./index-BJ-ODQ_I.js";function D(e,t){const n=c.createContext(t),r=i=>{const{children:u,...s}=i,a=c.useMemo(()=>s,Object.values(s));return x.jsx(n.Provider,{value:a,children:u})};r.displayName=e+"Provider";function o(i){const u=c.useContext(n);if(u)return u;if(t!==void 0)return t;throw new Error(`\`${i}\` must be used within \`${e}\``)}return[r,o]}function j(e,t=[]){let n=[];function r(i,u){const s=c.createContext(u),a=n.length;n=[...n,u];const f=d=>{const{scope:p,children:m,...v}=d,S=p?.[e]?.[a]||s,g=c.useMemo(()=>v,Object.values(v));return x.jsx(S.Provider,{value:g,children:m})};f.displayName=i+"Provider";function l(d,p){const m=p?.[e]?.[a]||s,v=c.useContext(m);if(v)return v;if(u!==void 0)return u;throw new Error(`\`${d}\` must be used within \`${i}\``)}return[f,l]}const o=()=>{const i=n.map(u=>c.createContext(u));return function(s){const a=s?.[e]||i;return c.useMemo(()=>({[`__scope${e}`]:{...s,[e]:a}}),[s,a])}};return o.scopeName=e,[r,P(o,...t)]}function P(...e){const t=e[0];if(e.length===1)return t;const n=()=>{const r=e.map(o=>({useScope:o(),scopeName:o.scopeName}));return function(i){const u=r.reduce((s,{useScope:a,scopeName:f})=>{const d=a(i)[`__scope${f}`];return{...s,...d}},{});return c.useMemo(()=>({[`__scope${t.scopeName}`]:u}),[u])}};return n.scopeName=t.scopeName,n}function L(e,t,{checkForDefaultPrevented:n=!0}={}){return function(o){if(e?.(o),n===!1||!o.defaultPrevented)return t?.(o)}}var N=globalThis?.document?c.useLayoutEffect:()=>{},C=y[" useInsertionEffect ".trim().toString()]||N;function W({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,i,u]=A({defaultProp:t,onChange:n}),s=e!==void 0,a=s?e:o;{const l=c.useRef(e!==void 0);c.useEffect(()=>{const d=l.current;d!==s&&console.warn(`${r} is changing from ${d?"controlled":"uncontrolled"} to ${s?"controlled":"uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`),l.current=s},[s,r])}const f=c.useCallback(l=>{if(s){const d=R(l)?l(e):l;d!==e&&u.current?.(d)}else i(l)},[s,e,i,u]);return[a,f]}function A({defaultProp:e,onChange:t}){const[n,r]=c.useState(e),o=c.useRef(n),i=c.useRef(t);return C(()=>{i.current=t},[t]),c.useEffect(()=>{o.current!==n&&(i.current?.(n),o.current=n)},[n,o]),[n,r,i]}function R(e){return typeof e=="function"}function F(e){const[t,n]=c.useState(void 0);return N(()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const r=new ResizeObserver(o=>{if(!Array.isArray(o)||!o.length)return;const i=o[0];let u,s;if("borderBoxSize"in i){const a=i.borderBoxSize,f=Array.isArray(a)?a[0]:a;u=f.inlineSize,s=f.blockSize}else u=e.offsetWidth,s=e.offsetHeight;n({width:u,height:s})});return r.observe(e,{box:"border-box"}),()=>r.unobserve(e)}else n(void 0)},[e]),t}function M(e,t){return c.useReducer((n,r)=>t[n][r]??n,e)}var O=e=>{const{present:t,children:n}=e,r=T(t),o=typeof n=="function"?n({present:r.isPresent}):c.Children.only(n),i=E(r.ref,I(o));return typeof n=="function"||r.isPresent?c.cloneElement(o,{ref:i}):null};O.displayName="Presence";function T(e){const[t,n]=c.useState(),r=c.useRef(null),o=c.useRef(e),i=c.useRef("none"),u=e?"mounted":"unmounted",[s,a]=M(u,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return c.useEffect(()=>{const f=h(r.current);i.current=s==="mounted"?f:"none"},[s]),N(()=>{const f=r.current,l=o.current;if(l!==e){const p=i.current,m=h(f);e?a("MOUNT"):m==="none"||f?.display==="none"?a("UNMOUNT"):a(l&&p!==m?"ANIMATION_OUT":"UNMOUNT"),o.current=e}},[e,a]),N(()=>{if(t){let f;const l=t.ownerDocument.defaultView??window,d=m=>{const S=h(r.current).includes(m.animationName);if(m.target===t&&S&&(a("ANIMATION_END"),!o.current)){const g=t.style.animationFillMode;t.style.animationFillMode="forwards",f=l.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=g)})}},p=m=>{m.target===t&&(i.current=h(r.current))};return t.addEventListener("animationstart",p),t.addEventListener("animationcancel",d),t.addEventListener("animationend",d),()=>{l.clearTimeout(f),t.removeEventListener("animationstart",p),t.removeEventListener("animationcancel",d),t.removeEventListener("animationend",d)}}else a("ANIMATION_END")},[t,a]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:c.useCallback(f=>{r.current=f?getComputedStyle(f):null,n(f)},[])}}function h(e){return e?.animationName||"none"}function I(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var U=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"],k=U.reduce((e,t)=>{const n=b(`Primitive.${t}`),r=c.forwardRef((o,i)=>{const{asChild:u,...s}=o,a=u?n:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),x.jsx(a,{...s,ref:i})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function B(e,t){e&&w.flushSync(()=>e.dispatchEvent(t))}export{k as P,L as a,O as b,j as c,N as d,F as e,B as f,D as g,W as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a,p as u}from"./chunk-EF7DTUVF-CaKisB5m.js";import{P as j,c as Q,u as Z,a as m,b as H}from"./index-
|
|
1
|
+
import{a,p as u}from"./chunk-EF7DTUVF-CaKisB5m.js";import{P as j,c as Q,u as Z,a as m,b as H}from"./index-46piFQ87.js";import{u as G,a as ee}from"./index-CQnetejS.js";import{u as te,e as oe,i as re}from"./index-BxJwj7VX.js";import{c as V,R as ne,A as ae,a as se,C as ie}from"./index-CEA_25hA.js";var le="Separator",M="horizontal",ce=["horizontal","vertical"],F=a.forwardRef((e,o)=>{const{decorative:t,orientation:r=M,...n}=e,s=ue(r)?r:M,d=t?{role:"none"}:{"aria-orientation":s==="vertical"?s:void 0,role:"separator"};return u.jsx(j.div,{"data-orientation":s,...d,...n,ref:o})});F.displayName=le;function ue(e){return ce.includes(e)}var Ie=F,pe=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"}),de="VisuallyHidden",U=a.forwardRef((e,o)=>u.jsx(j.span,{...e,ref:o,style:{...pe,...e.style}}));U.displayName=de;var fe=U,[_,ke]=Q("Tooltip",[V]),A=V(),Y="TooltipProvider",ve=700,D="tooltip.open",[he,N]=_(Y),B=e=>{const{__scopeTooltip:o,delayDuration:t=ve,skipDelayDuration:r=300,disableHoverableContent:n=!1,children:s}=e,l=a.useRef(!0),d=a.useRef(!1),i=a.useRef(0);return a.useEffect(()=>{const f=i.current;return()=>window.clearTimeout(f)},[]),u.jsx(he,{scope:o,isOpenDelayedRef:l,delayDuration:t,onOpen:a.useCallback(()=>{window.clearTimeout(i.current),l.current=!1},[]),onClose:a.useCallback(()=>{window.clearTimeout(i.current),i.current=window.setTimeout(()=>l.current=!0,r)},[r]),isPointerInTransitRef:d,onPointerInTransitChange:a.useCallback(f=>{d.current=f},[]),disableHoverableContent:n,children:s})};B.displayName=Y;var R="Tooltip",[xe,O]=_(R),z=e=>{const{__scopeTooltip:o,children:t,open:r,defaultOpen:n,onOpenChange:s,disableHoverableContent:l,delayDuration:d}=e,i=N(R,e.__scopeTooltip),f=A(o),[c,v]=a.useState(null),h=te(),p=a.useRef(0),x=l??i.disableHoverableContent,y=d??i.delayDuration,T=a.useRef(!1),[C,g]=Z({prop:r,defaultProp:n??!1,onChange:S=>{S?(i.onOpen(),document.dispatchEvent(new CustomEvent(D))):i.onClose(),s?.(S)},caller:R}),w=a.useMemo(()=>C?T.current?"delayed-open":"instant-open":"closed",[C]),E=a.useCallback(()=>{window.clearTimeout(p.current),p.current=0,T.current=!1,g(!0)},[g]),P=a.useCallback(()=>{window.clearTimeout(p.current),p.current=0,g(!1)},[g]),k=a.useCallback(()=>{window.clearTimeout(p.current),p.current=window.setTimeout(()=>{T.current=!0,g(!0),p.current=0},y)},[y,g]);return a.useEffect(()=>()=>{p.current&&(window.clearTimeout(p.current),p.current=0)},[]),u.jsx(ne,{...f,children:u.jsx(xe,{scope:o,contentId:h,open:C,stateAttribute:w,trigger:c,onTriggerChange:v,onTriggerEnter:a.useCallback(()=>{i.isOpenDelayedRef.current?k():E()},[i.isOpenDelayedRef,k,E]),onTriggerLeave:a.useCallback(()=>{x?P():(window.clearTimeout(p.current),p.current=0)},[P,x]),onOpen:E,onClose:P,disableHoverableContent:x,children:t})})};z.displayName=R;var L="TooltipTrigger",$=a.forwardRef((e,o)=>{const{__scopeTooltip:t,...r}=e,n=O(L,t),s=N(L,t),l=A(t),d=a.useRef(null),i=G(o,d,n.onTriggerChange),f=a.useRef(!1),c=a.useRef(!1),v=a.useCallback(()=>f.current=!1,[]);return a.useEffect(()=>()=>document.removeEventListener("pointerup",v),[v]),u.jsx(ae,{asChild:!0,...l,children:u.jsx(j.button,{"aria-describedby":n.open?n.contentId:void 0,"data-state":n.stateAttribute,...r,ref:i,onPointerMove:m(e.onPointerMove,h=>{h.pointerType!=="touch"&&!c.current&&!s.isPointerInTransitRef.current&&(n.onTriggerEnter(),c.current=!0)}),onPointerLeave:m(e.onPointerLeave,()=>{n.onTriggerLeave(),c.current=!1}),onPointerDown:m(e.onPointerDown,()=>{n.open&&n.onClose(),f.current=!0,document.addEventListener("pointerup",v,{once:!0})}),onFocus:m(e.onFocus,()=>{f.current||n.onOpen()}),onBlur:m(e.onBlur,n.onClose),onClick:m(e.onClick,n.onClose)})})});$.displayName=L;var I="TooltipPortal",[Te,ye]=_(I,{forceMount:void 0}),q=e=>{const{__scopeTooltip:o,forceMount:t,children:r,container:n}=e,s=O(I,o);return u.jsx(Te,{scope:o,forceMount:t,children:u.jsx(H,{present:t||s.open,children:u.jsx(oe,{asChild:!0,container:n,children:r})})})};q.displayName=I;var b="TooltipContent",W=a.forwardRef((e,o)=>{const t=ye(b,e.__scopeTooltip),{forceMount:r=t.forceMount,side:n="top",...s}=e,l=O(b,e.__scopeTooltip);return u.jsx(H,{present:r||l.open,children:l.disableHoverableContent?u.jsx(X,{side:n,...s,ref:o}):u.jsx(ge,{side:n,...s,ref:o})})}),ge=a.forwardRef((e,o)=>{const t=O(b,e.__scopeTooltip),r=N(b,e.__scopeTooltip),n=a.useRef(null),s=G(o,n),[l,d]=a.useState(null),{trigger:i,onClose:f}=t,c=n.current,{onPointerInTransitChange:v}=r,h=a.useCallback(()=>{d(null),v(!1)},[v]),p=a.useCallback((x,y)=>{const T=x.currentTarget,C={x:x.clientX,y:x.clientY},g=we(C,T.getBoundingClientRect()),w=Ee(C,g),E=Pe(y.getBoundingClientRect()),P=Oe([...w,...E]);d(P),v(!0)},[v]);return a.useEffect(()=>()=>h(),[h]),a.useEffect(()=>{if(i&&c){const x=T=>p(T,c),y=T=>p(T,i);return i.addEventListener("pointerleave",x),c.addEventListener("pointerleave",y),()=>{i.removeEventListener("pointerleave",x),c.removeEventListener("pointerleave",y)}}},[i,c,p,h]),a.useEffect(()=>{if(l){const x=y=>{const T=y.target,C={x:y.clientX,y:y.clientY},g=i?.contains(T)||c?.contains(T),w=!Re(C,l);g?h():w&&(h(),f())};return document.addEventListener("pointermove",x),()=>document.removeEventListener("pointermove",x)}},[i,c,l,f,h]),u.jsx(X,{...e,ref:s})}),[Ce,me]=_(R,{isInside:!1}),be=ee("TooltipContent"),X=a.forwardRef((e,o)=>{const{__scopeTooltip:t,children:r,"aria-label":n,onEscapeKeyDown:s,onPointerDownOutside:l,...d}=e,i=O(b,t),f=A(t),{onClose:c}=i;return a.useEffect(()=>(document.addEventListener(D,c),()=>document.removeEventListener(D,c)),[c]),a.useEffect(()=>{if(i.trigger){const v=h=>{h.target?.contains(i.trigger)&&c()};return window.addEventListener("scroll",v,{capture:!0}),()=>window.removeEventListener("scroll",v,{capture:!0})}},[i.trigger,c]),u.jsx(re,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:s,onPointerDownOutside:l,onFocusOutside:v=>v.preventDefault(),onDismiss:c,children:u.jsxs(ie,{"data-state":i.stateAttribute,...f,...d,ref:o,style:{...d.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[u.jsx(be,{children:r}),u.jsx(Ce,{scope:t,isInside:!0,children:u.jsx(fe,{id:i.contentId,role:"tooltip",children:n||r})})]})})});W.displayName=b;var K="TooltipArrow",J=a.forwardRef((e,o)=>{const{__scopeTooltip:t,...r}=e,n=A(t);return me(K,t).isInside?null:u.jsx(se,{...n,...r,ref:o})});J.displayName=K;function we(e,o){const t=Math.abs(o.top-e.y),r=Math.abs(o.bottom-e.y),n=Math.abs(o.right-e.x),s=Math.abs(o.left-e.x);switch(Math.min(t,r,n,s)){case s:return"left";case n:return"right";case t:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function Ee(e,o,t=5){const r=[];switch(o){case"top":r.push({x:e.x-t,y:e.y+t},{x:e.x+t,y:e.y+t});break;case"bottom":r.push({x:e.x-t,y:e.y-t},{x:e.x+t,y:e.y-t});break;case"left":r.push({x:e.x+t,y:e.y-t},{x:e.x+t,y:e.y+t});break;case"right":r.push({x:e.x-t,y:e.y-t},{x:e.x-t,y:e.y+t});break}return r}function Pe(e){const{top:o,right:t,bottom:r,left:n}=e;return[{x:n,y:o},{x:t,y:o},{x:t,y:r},{x:n,y:r}]}function Re(e,o){const{x:t,y:r}=e;let n=!1;for(let s=0,l=o.length-1;s<o.length;l=s++){const d=o[s],i=o[l],f=d.x,c=d.y,v=i.x,h=i.y;c>r!=h>r&&t<(v-f)*(r-c)/(h-c)+f&&(n=!n)}return n}function Oe(e){const o=e.slice();return o.sort((t,r)=>t.x<r.x?-1:t.x>r.x?1:t.y<r.y?-1:t.y>r.y?1:0),_e(o)}function _e(e){if(e.length<=1)return e.slice();const o=[];for(let r=0;r<e.length;r++){const n=e[r];for(;o.length>=2;){const s=o[o.length-1],l=o[o.length-2];if((s.x-l.x)*(n.y-l.y)>=(s.y-l.y)*(n.x-l.x))o.pop();else break}o.push(n)}o.pop();const t=[];for(let r=e.length-1;r>=0;r--){const n=e[r];for(;t.length>=2;){const s=t[t.length-1],l=t[t.length-2];if((s.x-l.x)*(n.y-l.y)>=(s.y-l.y)*(n.x-l.x))t.pop();else break}t.push(n)}return t.pop(),o.length===1&&t.length===1&&o[0].x===t[0].x&&o[0].y===t[0].y?o:o.concat(t)}var Se=B,Me=z,He=$,Ge=q,Ve=W,Fe=J;export{Fe as A,Ve as C,Se as P,Ie as R,He as T,pe as V,Me as a,Ge as b};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a,B as et,p as g}from"./chunk-EF7DTUVF-CaKisB5m.js";import{d as Se,P as x,a as A,f as tt,u as nt,c as rt,b as ie,g as ot}from"./index-NRYqpySi.js";import{u as _,b as at}from"./index-BeLOjj93.js";import{R as it}from"./index-BJ-ODQ_I.js";import{_ as N,a as we,b as st}from"./tslib.es6-Dilv5nzk.js";var ct=et[" useId ".trim().toString()]||(()=>{}),ut=0;function Z(e){const[t,n]=a.useState(ct());return Se(()=>{n(r=>r??String(ut++))},[e]),e||(t?`radix-${t}`:"")}function B(e){const t=a.useRef(e);return a.useEffect(()=>{t.current=e}),a.useMemo(()=>(...n)=>t.current?.(...n),[])}function lt(e,t=globalThis?.document){const n=B(e);a.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var dt="DismissableLayer",oe="dismissableLayer.update",ft="dismissableLayer.pointerDownOutside",vt="dismissableLayer.focusOutside",le,De=a.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Re=a.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:u,onDismiss:s,...E}=e,l=a.useContext(De),[d,v]=a.useState(null),h=d?.ownerDocument??globalThis?.document,[,y]=a.useState({}),D=_(t,p=>v(p)),c=Array.from(l.layers),[f]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),m=c.indexOf(f),b=d?c.indexOf(d):-1,C=l.layersWithOutsidePointerEventsDisabled.size>0,S=b>=m,w=gt(p=>{const O=p.target,W=[...l.branches].some(z=>z.contains(O));!S||W||(o?.(p),u?.(p),p.defaultPrevented||s?.())},h),P=pt(p=>{const O=p.target;[...l.branches].some(z=>z.contains(O))||(i?.(p),u?.(p),p.defaultPrevented||s?.())},h);return lt(p=>{b===l.layers.size-1&&(r?.(p),!p.defaultPrevented&&s&&(p.preventDefault(),s()))},h),a.useEffect(()=>{if(d)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(le=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(d)),l.layers.add(d),de(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=le)}},[d,h,n,l]),a.useEffect(()=>()=>{d&&(l.layers.delete(d),l.layersWithOutsidePointerEventsDisabled.delete(d),de())},[d,l]),a.useEffect(()=>{const p=()=>y({});return document.addEventListener(oe,p),()=>document.removeEventListener(oe,p)},[]),g.jsx(x.div,{...E,ref:D,style:{pointerEvents:C?S?"auto":"none":void 0,...e.style},onFocusCapture:A(e.onFocusCapture,P.onFocusCapture),onBlurCapture:A(e.onBlurCapture,P.onBlurCapture),onPointerDownCapture:A(e.onPointerDownCapture,w.onPointerDownCapture)})});Re.displayName=dt;var ht="DismissableLayerBranch",mt=a.forwardRef((e,t)=>{const n=a.useContext(De),r=a.useRef(null),o=_(t,r);return a.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),g.jsx(x.div,{...e,ref:o})});mt.displayName=ht;function gt(e,t=globalThis?.document){const n=B(e),r=a.useRef(!1),o=a.useRef(()=>{});return a.useEffect(()=>{const i=s=>{if(s.target&&!r.current){let E=function(){Pe(ft,n,l,{discrete:!0})};const l={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=E,t.addEventListener("click",o.current,{once:!0})):E()}else t.removeEventListener("click",o.current);r.current=!1},u=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(u),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function pt(e,t=globalThis?.document){const n=B(e),r=a.useRef(!1);return a.useEffect(()=>{const o=i=>{i.target&&!r.current&&Pe(vt,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function de(){const e=new CustomEvent(oe);document.dispatchEvent(e)}function Pe(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?tt(o,i):o.dispatchEvent(i)}var q="focusScope.autoFocusOnMount",Q="focusScope.autoFocusOnUnmount",fe={bubbles:!1,cancelable:!0},Et="FocusScope",Oe=a.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...u}=e,[s,E]=a.useState(null),l=B(o),d=B(i),v=a.useRef(null),h=_(t,c=>E(c)),y=a.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;a.useEffect(()=>{if(r){let c=function(C){if(y.paused||!s)return;const S=C.target;s.contains(S)?v.current=S:T(v.current,{select:!0})},f=function(C){if(y.paused||!s)return;const S=C.relatedTarget;S!==null&&(s.contains(S)||T(v.current,{select:!0}))},m=function(C){if(document.activeElement===document.body)for(const w of C)w.removedNodes.length>0&&T(s)};document.addEventListener("focusin",c),document.addEventListener("focusout",f);const b=new MutationObserver(m);return s&&b.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",c),document.removeEventListener("focusout",f),b.disconnect()}}},[r,s,y.paused]),a.useEffect(()=>{if(s){he.add(y);const c=document.activeElement;if(!s.contains(c)){const m=new CustomEvent(q,fe);s.addEventListener(q,l),s.dispatchEvent(m),m.defaultPrevented||(yt(Dt(xe(s)),{select:!0}),document.activeElement===c&&T(s))}return()=>{s.removeEventListener(q,l),setTimeout(()=>{const m=new CustomEvent(Q,fe);s.addEventListener(Q,d),s.dispatchEvent(m),m.defaultPrevented||T(c??document.body,{select:!0}),s.removeEventListener(Q,d),he.remove(y)},0)}}},[s,l,d,y]);const D=a.useCallback(c=>{if(!n&&!r||y.paused)return;const f=c.key==="Tab"&&!c.altKey&&!c.ctrlKey&&!c.metaKey,m=document.activeElement;if(f&&m){const b=c.currentTarget,[C,S]=bt(b);C&&S?!c.shiftKey&&m===S?(c.preventDefault(),n&&T(C,{select:!0})):c.shiftKey&&m===C&&(c.preventDefault(),n&&T(S,{select:!0})):m===b&&c.preventDefault()}},[n,r,y.paused]);return g.jsx(x.div,{tabIndex:-1,...u,ref:h,onKeyDown:D})});Oe.displayName=Et;function yt(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(T(r,{select:t}),document.activeElement!==n)return}function bt(e){const t=xe(e),n=ve(t,e),r=ve(t.reverse(),e);return[n,r]}function xe(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function ve(e,t){for(const n of e)if(!Ct(n,{upTo:t}))return n}function Ct(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function St(e){return e instanceof HTMLInputElement&&"select"in e}function T(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&St(e)&&t&&e.select()}}var he=wt();function wt(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=me(e,t),e.unshift(t)},remove(t){e=me(e,t),e[0]?.resume()}}}function me(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Dt(e){return e.filter(t=>t.tagName!=="A")}var Rt="Portal",Te=a.forwardRef((e,t)=>{const{container:n,...r}=e,[o,i]=a.useState(!1);Se(()=>i(!0),[]);const u=n||o&&globalThis?.document?.body;return u?it.createPortal(g.jsx(x.div,{...r,ref:t}),u):null});Te.displayName=Rt;var J=0;function Pt(){a.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??ge()),document.body.insertAdjacentElement("beforeend",e[1]??ge()),J++,()=>{J===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),J--}},[])}function ge(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var G="right-scroll-bar-position",V="width-before-scroll-bar",Ot="with-scroll-bars-hidden",xt="--removed-body-scroll-bar-size";function ee(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Tt(e,t){var n=a.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var Nt=typeof window<"u"?a.useLayoutEffect:a.useEffect,pe=new WeakMap;function At(e,t){var n=Tt(null,function(r){return e.forEach(function(o){return ee(o,r)})});return Nt(function(){var r=pe.get(n);if(r){var o=new Set(r),i=new Set(e),u=n.current;o.forEach(function(s){i.has(s)||ee(s,null)}),i.forEach(function(s){o.has(s)||ee(s,u)})}pe.set(n,e)},[e]),n}function It(e){return e}function Lt(e,t){t===void 0&&(t=It);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(i){var u=t(i,r);return n.push(u),function(){n=n.filter(function(s){return s!==u})}},assignSyncMedium:function(i){for(r=!0;n.length;){var u=n;n=[],u.forEach(i)}n={push:function(s){return i(s)},filter:function(){return n}}},assignMedium:function(i){r=!0;var u=[];if(n.length){var s=n;n=[],s.forEach(i),u=n}var E=function(){var d=u;u=[],d.forEach(i)},l=function(){return Promise.resolve().then(E)};l(),n={push:function(d){u.push(d),l()},filter:function(d){return u=u.filter(d),n}}}};return o}function Mt(e){e===void 0&&(e={});var t=Lt(null);return t.options=N({async:!0,ssr:!1},e),t}var Ne=function(e){var t=e.sideCar,n=we(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return a.createElement(r,N({},n))};Ne.isSideCarExport=!0;function Ft(e,t){return e.useMedium(t),Ne}var Ae=Mt(),te=function(){},X=a.forwardRef(function(e,t){var n=a.useRef(null),r=a.useState({onScrollCapture:te,onWheelCapture:te,onTouchMoveCapture:te}),o=r[0],i=r[1],u=e.forwardProps,s=e.children,E=e.className,l=e.removeScrollBar,d=e.enabled,v=e.shards,h=e.sideCar,y=e.noRelative,D=e.noIsolation,c=e.inert,f=e.allowPinchZoom,m=e.as,b=m===void 0?"div":m,C=e.gapMode,S=we(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),w=h,P=At([n,t]),p=N(N({},S),o);return a.createElement(a.Fragment,null,d&&a.createElement(w,{sideCar:Ae,removeScrollBar:l,shards:v,noRelative:y,noIsolation:D,inert:c,setCallbacks:i,allowPinchZoom:!!f,lockRef:n,gapMode:C}),u?a.cloneElement(a.Children.only(s),N(N({},p),{ref:P})):a.createElement(b,N({},p,{className:E,ref:P}),s))});X.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};X.classNames={fullWidth:V,zeroRight:G};var kt=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function _t(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=kt();return t&&e.setAttribute("nonce",t),e}function Wt(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Bt(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var jt=function(){var e=0,t=null;return{add:function(n){e==0&&(t=_t())&&(Wt(t,n),Bt(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Ut=function(){var e=jt();return function(t,n){a.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Ie=function(){var e=Ut(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},Kt={left:0,top:0,right:0,gap:0},ne=function(e){return parseInt(e||"",10)||0},Ht=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[ne(n),ne(r),ne(o)]},Gt=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Kt;var t=Ht(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Vt=Ie(),k="data-scroll-locked",Yt=function(e,t,n,r){var o=e.left,i=e.top,u=e.right,s=e.gap;return n===void 0&&(n="margin"),`
|
|
1
|
+
import{a,B as et,p as g}from"./chunk-EF7DTUVF-CaKisB5m.js";import{d as Se,P as x,a as A,f as tt,u as nt,c as rt,b as ie,g as ot}from"./index-46piFQ87.js";import{u as _,b as at}from"./index-CQnetejS.js";import{R as it}from"./index-BJ-ODQ_I.js";import{_ as N,a as we,b as st}from"./tslib.es6-Dilv5nzk.js";var ct=et[" useId ".trim().toString()]||(()=>{}),ut=0;function Z(e){const[t,n]=a.useState(ct());return Se(()=>{n(r=>r??String(ut++))},[e]),e||(t?`radix-${t}`:"")}function B(e){const t=a.useRef(e);return a.useEffect(()=>{t.current=e}),a.useMemo(()=>(...n)=>t.current?.(...n),[])}function lt(e,t=globalThis?.document){const n=B(e);a.useEffect(()=>{const r=o=>{o.key==="Escape"&&n(o)};return t.addEventListener("keydown",r,{capture:!0}),()=>t.removeEventListener("keydown",r,{capture:!0})},[n,t])}var dt="DismissableLayer",oe="dismissableLayer.update",ft="dismissableLayer.pointerDownOutside",vt="dismissableLayer.focusOutside",le,De=a.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Re=a.forwardRef((e,t)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:o,onFocusOutside:i,onInteractOutside:u,onDismiss:s,...E}=e,l=a.useContext(De),[d,v]=a.useState(null),h=d?.ownerDocument??globalThis?.document,[,y]=a.useState({}),D=_(t,p=>v(p)),c=Array.from(l.layers),[f]=[...l.layersWithOutsidePointerEventsDisabled].slice(-1),m=c.indexOf(f),b=d?c.indexOf(d):-1,C=l.layersWithOutsidePointerEventsDisabled.size>0,S=b>=m,w=gt(p=>{const O=p.target,W=[...l.branches].some(z=>z.contains(O));!S||W||(o?.(p),u?.(p),p.defaultPrevented||s?.())},h),P=pt(p=>{const O=p.target;[...l.branches].some(z=>z.contains(O))||(i?.(p),u?.(p),p.defaultPrevented||s?.())},h);return lt(p=>{b===l.layers.size-1&&(r?.(p),!p.defaultPrevented&&s&&(p.preventDefault(),s()))},h),a.useEffect(()=>{if(d)return n&&(l.layersWithOutsidePointerEventsDisabled.size===0&&(le=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),l.layersWithOutsidePointerEventsDisabled.add(d)),l.layers.add(d),de(),()=>{n&&l.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=le)}},[d,h,n,l]),a.useEffect(()=>()=>{d&&(l.layers.delete(d),l.layersWithOutsidePointerEventsDisabled.delete(d),de())},[d,l]),a.useEffect(()=>{const p=()=>y({});return document.addEventListener(oe,p),()=>document.removeEventListener(oe,p)},[]),g.jsx(x.div,{...E,ref:D,style:{pointerEvents:C?S?"auto":"none":void 0,...e.style},onFocusCapture:A(e.onFocusCapture,P.onFocusCapture),onBlurCapture:A(e.onBlurCapture,P.onBlurCapture),onPointerDownCapture:A(e.onPointerDownCapture,w.onPointerDownCapture)})});Re.displayName=dt;var ht="DismissableLayerBranch",mt=a.forwardRef((e,t)=>{const n=a.useContext(De),r=a.useRef(null),o=_(t,r);return a.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),g.jsx(x.div,{...e,ref:o})});mt.displayName=ht;function gt(e,t=globalThis?.document){const n=B(e),r=a.useRef(!1),o=a.useRef(()=>{});return a.useEffect(()=>{const i=s=>{if(s.target&&!r.current){let E=function(){Pe(ft,n,l,{discrete:!0})};const l={originalEvent:s};s.pointerType==="touch"?(t.removeEventListener("click",o.current),o.current=E,t.addEventListener("click",o.current,{once:!0})):E()}else t.removeEventListener("click",o.current);r.current=!1},u=window.setTimeout(()=>{t.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(u),t.removeEventListener("pointerdown",i),t.removeEventListener("click",o.current)}},[t,n]),{onPointerDownCapture:()=>r.current=!0}}function pt(e,t=globalThis?.document){const n=B(e),r=a.useRef(!1);return a.useEffect(()=>{const o=i=>{i.target&&!r.current&&Pe(vt,n,{originalEvent:i},{discrete:!1})};return t.addEventListener("focusin",o),()=>t.removeEventListener("focusin",o)},[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function de(){const e=new CustomEvent(oe);document.dispatchEvent(e)}function Pe(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?tt(o,i):o.dispatchEvent(i)}var q="focusScope.autoFocusOnMount",Q="focusScope.autoFocusOnUnmount",fe={bubbles:!1,cancelable:!0},Et="FocusScope",Oe=a.forwardRef((e,t)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:o,onUnmountAutoFocus:i,...u}=e,[s,E]=a.useState(null),l=B(o),d=B(i),v=a.useRef(null),h=_(t,c=>E(c)),y=a.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;a.useEffect(()=>{if(r){let c=function(C){if(y.paused||!s)return;const S=C.target;s.contains(S)?v.current=S:T(v.current,{select:!0})},f=function(C){if(y.paused||!s)return;const S=C.relatedTarget;S!==null&&(s.contains(S)||T(v.current,{select:!0}))},m=function(C){if(document.activeElement===document.body)for(const w of C)w.removedNodes.length>0&&T(s)};document.addEventListener("focusin",c),document.addEventListener("focusout",f);const b=new MutationObserver(m);return s&&b.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",c),document.removeEventListener("focusout",f),b.disconnect()}}},[r,s,y.paused]),a.useEffect(()=>{if(s){he.add(y);const c=document.activeElement;if(!s.contains(c)){const m=new CustomEvent(q,fe);s.addEventListener(q,l),s.dispatchEvent(m),m.defaultPrevented||(yt(Dt(xe(s)),{select:!0}),document.activeElement===c&&T(s))}return()=>{s.removeEventListener(q,l),setTimeout(()=>{const m=new CustomEvent(Q,fe);s.addEventListener(Q,d),s.dispatchEvent(m),m.defaultPrevented||T(c??document.body,{select:!0}),s.removeEventListener(Q,d),he.remove(y)},0)}}},[s,l,d,y]);const D=a.useCallback(c=>{if(!n&&!r||y.paused)return;const f=c.key==="Tab"&&!c.altKey&&!c.ctrlKey&&!c.metaKey,m=document.activeElement;if(f&&m){const b=c.currentTarget,[C,S]=bt(b);C&&S?!c.shiftKey&&m===S?(c.preventDefault(),n&&T(C,{select:!0})):c.shiftKey&&m===C&&(c.preventDefault(),n&&T(S,{select:!0})):m===b&&c.preventDefault()}},[n,r,y.paused]);return g.jsx(x.div,{tabIndex:-1,...u,ref:h,onKeyDown:D})});Oe.displayName=Et;function yt(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(T(r,{select:t}),document.activeElement!==n)return}function bt(e){const t=xe(e),n=ve(t,e),r=ve(t.reverse(),e);return[n,r]}function xe(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const o=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||o?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)t.push(n.currentNode);return t}function ve(e,t){for(const n of e)if(!Ct(n,{upTo:t}))return n}function Ct(e,{upTo:t}){if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(t!==void 0&&e===t)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1}function St(e){return e instanceof HTMLInputElement&&"select"in e}function T(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&St(e)&&t&&e.select()}}var he=wt();function wt(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=me(e,t),e.unshift(t)},remove(t){e=me(e,t),e[0]?.resume()}}}function me(e,t){const n=[...e],r=n.indexOf(t);return r!==-1&&n.splice(r,1),n}function Dt(e){return e.filter(t=>t.tagName!=="A")}var Rt="Portal",Te=a.forwardRef((e,t)=>{const{container:n,...r}=e,[o,i]=a.useState(!1);Se(()=>i(!0),[]);const u=n||o&&globalThis?.document?.body;return u?it.createPortal(g.jsx(x.div,{...r,ref:t}),u):null});Te.displayName=Rt;var J=0;function Pt(){a.useEffect(()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??ge()),document.body.insertAdjacentElement("beforeend",e[1]??ge()),J++,()=>{J===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(t=>t.remove()),J--}},[])}function ge(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var G="right-scroll-bar-position",V="width-before-scroll-bar",Ot="with-scroll-bars-hidden",xt="--removed-body-scroll-bar-size";function ee(e,t){return typeof e=="function"?e(t):e&&(e.current=t),e}function Tt(e,t){var n=a.useState(function(){return{value:e,callback:t,facade:{get current(){return n.value},set current(r){var o=n.value;o!==r&&(n.value=r,n.callback(r,o))}}}})[0];return n.callback=t,n.facade}var Nt=typeof window<"u"?a.useLayoutEffect:a.useEffect,pe=new WeakMap;function At(e,t){var n=Tt(null,function(r){return e.forEach(function(o){return ee(o,r)})});return Nt(function(){var r=pe.get(n);if(r){var o=new Set(r),i=new Set(e),u=n.current;o.forEach(function(s){i.has(s)||ee(s,null)}),i.forEach(function(s){o.has(s)||ee(s,u)})}pe.set(n,e)},[e]),n}function It(e){return e}function Lt(e,t){t===void 0&&(t=It);var n=[],r=!1,o={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:e},useMedium:function(i){var u=t(i,r);return n.push(u),function(){n=n.filter(function(s){return s!==u})}},assignSyncMedium:function(i){for(r=!0;n.length;){var u=n;n=[],u.forEach(i)}n={push:function(s){return i(s)},filter:function(){return n}}},assignMedium:function(i){r=!0;var u=[];if(n.length){var s=n;n=[],s.forEach(i),u=n}var E=function(){var d=u;u=[],d.forEach(i)},l=function(){return Promise.resolve().then(E)};l(),n={push:function(d){u.push(d),l()},filter:function(d){return u=u.filter(d),n}}}};return o}function Mt(e){e===void 0&&(e={});var t=Lt(null);return t.options=N({async:!0,ssr:!1},e),t}var Ne=function(e){var t=e.sideCar,n=we(e,["sideCar"]);if(!t)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=t.read();if(!r)throw new Error("Sidecar medium not found");return a.createElement(r,N({},n))};Ne.isSideCarExport=!0;function Ft(e,t){return e.useMedium(t),Ne}var Ae=Mt(),te=function(){},X=a.forwardRef(function(e,t){var n=a.useRef(null),r=a.useState({onScrollCapture:te,onWheelCapture:te,onTouchMoveCapture:te}),o=r[0],i=r[1],u=e.forwardProps,s=e.children,E=e.className,l=e.removeScrollBar,d=e.enabled,v=e.shards,h=e.sideCar,y=e.noRelative,D=e.noIsolation,c=e.inert,f=e.allowPinchZoom,m=e.as,b=m===void 0?"div":m,C=e.gapMode,S=we(e,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noRelative","noIsolation","inert","allowPinchZoom","as","gapMode"]),w=h,P=At([n,t]),p=N(N({},S),o);return a.createElement(a.Fragment,null,d&&a.createElement(w,{sideCar:Ae,removeScrollBar:l,shards:v,noRelative:y,noIsolation:D,inert:c,setCallbacks:i,allowPinchZoom:!!f,lockRef:n,gapMode:C}),u?a.cloneElement(a.Children.only(s),N(N({},p),{ref:P})):a.createElement(b,N({},p,{className:E,ref:P}),s))});X.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};X.classNames={fullWidth:V,zeroRight:G};var kt=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function _t(){if(!document)return null;var e=document.createElement("style");e.type="text/css";var t=kt();return t&&e.setAttribute("nonce",t),e}function Wt(e,t){e.styleSheet?e.styleSheet.cssText=t:e.appendChild(document.createTextNode(t))}function Bt(e){var t=document.head||document.getElementsByTagName("head")[0];t.appendChild(e)}var jt=function(){var e=0,t=null;return{add:function(n){e==0&&(t=_t())&&(Wt(t,n),Bt(t)),e++},remove:function(){e--,!e&&t&&(t.parentNode&&t.parentNode.removeChild(t),t=null)}}},Ut=function(){var e=jt();return function(t,n){a.useEffect(function(){return e.add(t),function(){e.remove()}},[t&&n])}},Ie=function(){var e=Ut(),t=function(n){var r=n.styles,o=n.dynamic;return e(r,o),null};return t},Kt={left:0,top:0,right:0,gap:0},ne=function(e){return parseInt(e||"",10)||0},Ht=function(e){var t=window.getComputedStyle(document.body),n=t[e==="padding"?"paddingLeft":"marginLeft"],r=t[e==="padding"?"paddingTop":"marginTop"],o=t[e==="padding"?"paddingRight":"marginRight"];return[ne(n),ne(r),ne(o)]},Gt=function(e){if(e===void 0&&(e="margin"),typeof window>"u")return Kt;var t=Ht(e),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:t[0],top:t[1],right:t[2],gap:Math.max(0,r-n+t[2]-t[0])}},Vt=Ie(),k="data-scroll-locked",Yt=function(e,t,n,r){var o=e.left,i=e.top,u=e.right,s=e.gap;return n===void 0&&(n="margin"),`
|
|
2
2
|
.`.concat(Ot,` {
|
|
3
3
|
overflow: hidden `).concat(r,`;
|
|
4
4
|
padding-right: `).concat(s,"px ").concat(r,`;
|