@isardsat/editorial-admin 6.21.0 → 6.21.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/client/assets/{dashboard._collection._document-BiIWfKiL.js → dashboard._collection._document-D7Z2p9AV.js} +1 -1
- package/build/client/assets/{dashboard._collection.new-PercY47A.js → dashboard._collection.new-DTz85TYy.js} +1 -1
- package/build/client/assets/{dashboard._layout-BLI8ZXFq.js → dashboard._layout-C2hFrHKC.js} +1 -1
- package/build/client/assets/itemForm-gnC2gvRO.js +8 -0
- package/build/client/assets/{manifest-9cecc256.js → manifest-239e9170.js} +1 -1
- package/build/client/assets/{markdownEditor-CZVz5-rL.js → markdownEditor-Bsc2Tnws.js} +1 -1
- package/build/client/index.html +1 -1
- package/package.json +2 -2
- package/build/client/assets/itemForm-BLyILW73.js +0 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
import{w as v,a,p as m}from"./chunk-EPOLDU6W-CiSVlmCe.js";import{I}from"./itemForm-
|
|
1
|
+
import{w as v,a,p as m}from"./chunk-EPOLDU6W-CiSVlmCe.js";import{I}from"./itemForm-gnC2gvRO.js";import{v as x,y,p as j}from"./utils-B48p8Qal.js";import"./index-B5ynPIRP.js";import"./index-CbaefyjV.js";import"./index-DLIEpuwL.js";import"./index-DutSppa2.js";import"./button-BEFuP7Ru.js";import"./badge-DTudhbGs.js";import"./zod-DU3Qlmru.js";import"./check-DF0ucE8d.js";import"./createLucideIcon-BvSqmaUO.js";import"./schemas-CPJfa6mm.js";import"./input-C3iFdiD8.js";import"./chevron-down-qxzqwz13.js";import"./schemas-D-U8dKAF.js";import"./index-CZSVchcX.js";import"./x-D6gZWaAR.js";import"./loader-circle-BDUbeTTe.js";const H=v(function({params:l}){const{collectionId:t,documentId:e}=l,[p,n]=a.useState(void 0),{data:c,isFetching:u}=x(t),{data:f,isFetching:g}=y({itemType:t,id:e}),{data:i}=j(),h=a.useMemo(()=>{if(!i)return n(void 0),[];const o=i.singles[t];if(o?.changedFields)return n(o.status),o.changedFields;const s=i.collections[t];if(!s)return n(void 0),[];const r=s.modified.find(d=>d.id===e);return r?(n("modified"),r.changedFields):(s.added.find(d=>d.id===e)&&n("added"),[])},[i,t,e]),F=a.useMemo(()=>{if(!i)return[];const o=i.singles[t];if(o?.production)return o.production;const s=i.collections[t];if(!s)return[];const r=s.modified.find(d=>d.id===e);return r?r.production:[]},[i,t,e]);return!c||(u||g)?null:m.jsx("div",{className:"overflow-auto scrollbar-stable",children:m.jsx("div",{className:"p-4 gap-4",children:m.jsx(I,{itemType:t,fields:c.fields,data:f??void 0,isSingleton:c.singleton,changedFields:h,productionData:F,itemStatus:p},`${t}-${e}`)})})});export{H as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{w as m,p as t}from"./chunk-EPOLDU6W-CiSVlmCe.js";import{I as e}from"./itemForm-
|
|
1
|
+
import{w as m,p as t}from"./chunk-EPOLDU6W-CiSVlmCe.js";import{I as e}from"./itemForm-gnC2gvRO.js";import{v as p}from"./utils-B48p8Qal.js";import"./index-B5ynPIRP.js";import"./index-CbaefyjV.js";import"./index-DLIEpuwL.js";import"./index-DutSppa2.js";import"./button-BEFuP7Ru.js";import"./badge-DTudhbGs.js";import"./zod-DU3Qlmru.js";import"./check-DF0ucE8d.js";import"./createLucideIcon-BvSqmaUO.js";import"./schemas-CPJfa6mm.js";import"./input-C3iFdiD8.js";import"./chevron-down-qxzqwz13.js";import"./schemas-D-U8dKAF.js";import"./index-CZSVchcX.js";import"./x-D6gZWaAR.js";import"./loader-circle-BDUbeTTe.js";const _=m(function({params:r}){const{collectionId:i}=r,{data:o}=p(i);return o?t.jsx("div",{className:"overflow-auto",children:t.jsx("div",{className:" p-4 gap-4",children:t.jsx(e,{itemType:i,fields:o.fields,isNew:!0,isSingleton:o.singleton})})}):null});export{_ as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{p as e,a as r,x as N,y as Z,v as xe,z as fe,R as be,w as me,O as ge}from"./chunk-EPOLDU6W-CiSVlmCe.js";import{u as je,c as z,d as ve}from"./authSlice-DWtXmmFR.js";import{b as l,d as E,h as we,j as ye,k as Ne,l as Ce,u as Se}from"./utils-B48p8Qal.js";import{t as v}from"./index-CZSVchcX.js";import{R as Y,C as J,a as ee,T as te,D as ae,P as se,O as ne,u as ke}from"./index-DutSppa2.js";import{X as oe}from"./x-D6gZWaAR.js";import{B as _}from"./button-BEFuP7Ru.js";import{c as C}from"./createLucideIcon-BvSqmaUO.js";import{S as R,c as _e,u as Me}from"./index-CbaefyjV.js";import{P as Pe,u as Oe,c as ze,a as A,b as Ee,d as Re,e as Ae}from"./index-B5ynPIRP.js";import{P as De,R as Ie,T as Le,a as Te,C as $e,A as Be}from"./index-CU6_POhE.js";import{C as B}from"./chevron-down-qxzqwz13.js";import{L as P}from"./loader-circle-BDUbeTTe.js";import{A as Ge,a as He}from"./arrow-up-C0I0e1Jt.js";import{U as Fe}from"./upload-DhJ5wU_H.js";import{E as Ve}from"./external-link-ERgO2SVI.js";import{L as Ke}from"./Loading-C1QGFwZC.js";import{C as Ue}from"./chevron-right-BFlMu-RJ.js";import"./index-DLIEpuwL.js";const qe=[["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"}]],We=C("blocks",qe);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"}]],Xe=C("files",Qe);const Ze=[["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"}]],Ye=C("grid-3x3",Ze);const Je=[["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"}]],et=C("heart",Je);const tt=[["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"}]],at=C("log-out",tt);const st=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],nt=C("panel-left",st);const ot=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],it=C("square",ot);function rt({...t}){return e.jsx(Y,{"data-slot":"dialog",...t})}function lt({...t}){return e.jsx(se,{"data-slot":"dialog-portal",...t})}function dt({className:t,...a}){return e.jsx(ne,{"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 ct({className:t,children:a,...n}){return e.jsxs(lt,{"data-slot":"dialog-portal",children:[e.jsx(dt,{}),e.jsxs(J,{"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(ee,{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(oe,{}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function ut({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 pt({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(te,{"data-slot":"dialog-title",className:l("text-lg leading-none font-semibold",t),...a})}function xt({className:t,...a}){return e.jsx(ae,{"data-slot":"dialog-description",className:l("text-muted-foreground text-sm",t),...a})}const ft="#181717",bt=r.forwardRef(function({title:a="GitHub",color:n="currentColor",size:s=24,...o},i){return n==="default"&&(n=ft),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"})]})}),mt="#85EA2D",G=r.forwardRef(function({title:a="Swagger",color:n="currentColor",size:s=24,...o},i){return n==="default"&&(n=mt),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 gt({isOpen:t,setOpen:a}){return e.jsx(rt,{open:t,onOpenChange:n=>a(n),children:e.jsxs(ct,{children:[e.jsxs(ut,{children:[e.jsx(ht,{children:"Editorial"}),e.jsx(xt,{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(bt,{size:14}),"GitHub repository"]})})]}),e.jsx(pt,{children:e.jsxs("p",{className:"flex items-center gap-1",children:["Created with",e.jsx(et,{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"})]})})]})})}var jt="Separator",H="horizontal",vt=["horizontal","vertical"],ie=r.forwardRef((t,a)=>{const{decorative:n,orientation:s=H,...o}=t,i=wt(s)?s:H,p=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return e.jsx(Pe.div,{"data-orientation":i,...p,...o,ref:a})});ie.displayName=jt;function wt(t){return vt.includes(t)}var yt=ie;function re({className:t,orientation:a="horizontal",decorative:n=!0,...s}){return e.jsx(yt,{"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 Nt({...t}){return e.jsx(Y,{"data-slot":"sheet",...t})}function Ct({...t}){return e.jsx(se,{"data-slot":"sheet-portal",...t})}function St({className:t,...a}){return e.jsx(ne,{"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 kt({className:t,children:a,side:n="right",...s}){return e.jsxs(Ct,{children:[e.jsx(St,{}),e.jsxs(J,{"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(ee,{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(oe,{className:"size-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function _t({className:t,...a}){return e.jsx("div",{"data-slot":"sheet-header",className:l("flex flex-col gap-1.5 p-4",t),...a})}function Mt({className:t,...a}){return e.jsx(te,{"data-slot":"sheet-title",className:l("text-foreground font-semibold",t),...a})}function Pt({className:t,...a}){return e.jsx(ae,{"data-slot":"sheet-description",className:l("text-muted-foreground text-sm",t),...a})}function le({delayDuration:t=0,...a}){return e.jsx(De,{"data-slot":"tooltip-provider",delayDuration:t,...a})}function Ot({...t}){return e.jsx(le,{children:e.jsx(Ie,{"data-slot":"tooltip",...t})})}function zt({...t}){return e.jsx(Le,{"data-slot":"tooltip-trigger",...t})}function Et({className:t,sideOffset:a=0,children:n,...s}){return e.jsx(Te,{children:e.jsxs($e,{"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(Be,{className:"bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}const O=768;function Rt(){const[t,a]=r.useState(void 0);return r.useEffect(()=>{const n=window.matchMedia(`(max-width: ${O-1}px)`),s=()=>{a(window.innerWidth<O)};return n.addEventListener("change",s),a(window.innerWidth<O),()=>n.removeEventListener("change",s)},[]),!!t}const At="sidebar_state",Dt=3600*24*7,It="16rem",Lt="18rem",Tt="3rem",$t="b",de=r.createContext(null);function D(){const t=r.useContext(de);if(!t)throw new Error("useSidebar must be used within a SidebarProvider.");return t}function Bt({defaultOpen:t=!0,open:a,onOpenChange:n,className:s,style:o,children:i,...u}){const p=Rt(),[f,h]=r.useState(!1),[x,S]=r.useState(t),m=a??x,b=r.useCallback(d=>{const c=typeof d=="function"?d(m):d;n?n(c):S(c),document.cookie=`${At}=${c}; path=/; max-age=${Dt}`},[n,m]),j=r.useCallback(()=>p?h(d=>!d):b(d=>!d),[p,b,h]);r.useEffect(()=>{const d=c=>{c.key===$t&&(c.metaKey||c.ctrlKey)&&(c.preventDefault(),j())};return window.addEventListener("keydown",d),()=>window.removeEventListener("keydown",d)},[j]);const w=m?"expanded":"collapsed",k=r.useMemo(()=>({state:w,open:m,setOpen:b,isMobile:p,openMobile:f,setOpenMobile:h,toggleSidebar:j}),[w,m,b,p,f,h,j]);return e.jsx(de.Provider,{value:k,children:e.jsx(le,{delayDuration:0,children:e.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":It,"--sidebar-width-icon":Tt,...o},className:l("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",s),...u,children:i})})})}function Gt({side:t="left",variant:a="sidebar",collapsible:n="offcanvas",className:s,children:o,...i}){const{isMobile:u,state:p,openMobile:f,setOpenMobile:h}=D();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}):u?e.jsx(Nt,{open:f,onOpenChange:h,...i,children:e.jsxs(kt,{"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":Lt},side:t,children:[e.jsxs(_t,{className:"sr-only",children:[e.jsx(Mt,{children:"Sidebar"}),e.jsx(Pt,{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":p,"data-collapsible":p==="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 Ht({className:t,onClick:a,...n}){const{toggleSidebar:s}=D();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(nt,{}),e.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function Ft({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 Vt({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 Kt({className:t,...a}){return e.jsx(re,{"data-slot":"sidebar-separator","data-sidebar":"separator",className:l("bg-sidebar-border mx-2 w-auto",t),...a})}function Ut({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 F({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 V({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 K({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 U({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 qt=_e("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,...u}){const p=t?R:"button",{isMobile:f,state:h}=D(),x=e.jsx(p,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":s,"data-active":a,className:l(qt({variant:n,size:s}),i),...u});return o?(typeof o=="string"&&(o={children:o}),e.jsxs(Ot,{children:[e.jsx(zt,{asChild:!0,children:x}),e.jsx(Et,{side:"right",align:"center",hidden:h!=="collapsed"||f,...o})]})):x}function Wt({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?R:"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 q({singleton:t}){const{data:a}=E(),{data:n}=we();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(Wt,{children:e.jsx(Z,{to:t?`/admin/dashboard/${o}/default`:`/admin/dashboard/${o}`,className:({isActive:u,isPending:p})=>p?"pending":u?"active":"",children:({isActive:u})=>e.jsx(Qt,{isActive:u,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",[Xt]=ze(M),[Zt,I]=Xt(M),ce=r.forwardRef((t,a)=>{const{__scopeCollapsible:n,open:s,defaultOpen:o,disabled:i,onOpenChange:u,...p}=t,[f,h]=Oe({prop:s,defaultProp:o??!1,onChange:u,caller:M});return e.jsx(Zt,{scope:n,disabled:i,contentId:ke(),open:f,onOpenToggle:r.useCallback(()=>h(x=>!x),[h]),children:e.jsx(A.div,{"data-state":T(f),"data-disabled":i?"":void 0,...p,ref:a})})});ce.displayName=M;var ue="CollapsibleTrigger",pe=r.forwardRef((t,a)=>{const{__scopeCollapsible:n,...s}=t,o=I(ue,n);return e.jsx(A.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)})});pe.displayName=ue;var L="CollapsibleContent",he=r.forwardRef((t,a)=>{const{forceMount:n,...s}=t,o=I(L,t.__scopeCollapsible);return e.jsx(Re,{present:n||o.open,children:({present:i})=>e.jsx(Yt,{...s,ref:a,present:i})})});he.displayName=L;var Yt=r.forwardRef((t,a)=>{const{__scopeCollapsible:n,present:s,children:o,...i}=t,u=I(L,n),[p,f]=r.useState(s),h=r.useRef(null),x=Me(a,h),S=r.useRef(0),m=S.current,b=r.useRef(0),j=b.current,w=u.open||p,k=r.useRef(w),d=r.useRef(void 0);return r.useEffect(()=>{const c=requestAnimationFrame(()=>k.current=!1);return()=>cancelAnimationFrame(c)},[]),Ae(()=>{const c=h.current;if(c){d.current=d.current||{transitionDuration:c.style.transitionDuration,animationName:c.style.animationName},c.style.transitionDuration="0s",c.style.animationName="none";const $=c.getBoundingClientRect();S.current=$.height,b.current=$.width,k.current||(c.style.transitionDuration=d.current.transitionDuration,c.style.animationName=d.current.animationName),f(s)}},[u.open,s]),e.jsx(A.div,{"data-state":T(u.open),"data-disabled":u.disabled?"":void 0,id:u.contentId,hidden:!w,...i,ref:x,style:{"--radix-collapsible-content-height":m?`${m}px`:void 0,"--radix-collapsible-content-width":j?`${j}px`:void 0,...t.style},children:w&&o})});function T(t){return t?"open":"closed"}var Jt=ce;function W({...t}){return e.jsx(Jt,{"data-slot":"collapsible",...t})}function Q({...t}){return e.jsx(pe,{"data-slot":"collapsible-trigger",...t})}function X({...t}){return e.jsx(he,{"data-slot":"collapsible-content",...t})}function ea(){const t=je(),[a,n]=r.useState(!1),[s,o]=ye(),[i,u]=Ne(),[p,f]=Ce(),{data:h}=Se(),{data:x}=E(),S=r.useMemo(()=>x&&!!Object.values(x).find(d=>!d.singleton),[x]),m=r.useMemo(()=>x&&!!Object.values(x).find(d=>d.singleton),[x]),b=z(d=>d.auth.user),j=async d=>{try{await s({author:d}).unwrap()?v.success("Content published successfully."):v.error("Publishing failed.")}catch(c){v.error("Publishing failed."),console.error(c)}},w=async()=>{try{await i().unwrap()?v.success("Content pulled successfully."):v.error("Pulling content failed.")}catch(d){v.error("Pulling content failed."),console.error(d)}},k=async d=>{try{await p(d).unwrap()?v.success("Content pushed successfully."):v.error("Pushing content failed.")}catch(c){v.error("Pushing content failed."),console.error(c)}};return e.jsxs(Gt,{className:"z-50",children:[e.jsx(gt,{isOpen:a,setOpen:n}),e.jsx(Ft,{className:"h-14 justify-center",children:e.jsx(F,{children:e.jsx(N,{to:"/admin/dashboard",className:"text-3xl font-semibold tracking-tight transition-colors",children:h?.name})})}),e.jsx(Ut,{children:e.jsxs(F,{children:[e.jsx(V,{children:"Content"}),e.jsx(K,{children:e.jsxs(U,{children:[e.jsx(W,{className:"group/collapsible",disabled:!S,children:e.jsxs(y,{children:[e.jsx(Q,{asChild:!0,children:e.jsxs(g,{className:"group",children:[e.jsx(Ye,{}),e.jsx("span",{children:"Collections"}),e.jsx(B,{className:"transition-transform ml-auto -mr-[2px] group-data-[state=open]:rotate-180"})]})}),e.jsx(X,{children:e.jsx(q,{})})]})}),e.jsx(W,{className:"group/collapsible",disabled:!m,children:e.jsxs(y,{children:[e.jsx(Q,{asChild:!0,children:e.jsxs(g,{className:"group",children:[e.jsx(it,{}),e.jsx("span",{children:"Singles"}),e.jsx(B,{className:"transition-transform ml-auto -mr-[2px] group-data-[state=open]:rotate-180"})]})}),e.jsx(X,{children:e.jsx(q,{singleton:!0})})]})}),e.jsx(y,{children:e.jsx(g,{asChild:!0,children:e.jsxs(N,{to:"/admin/dashboard/files",children:[e.jsx(Xe,{}),e.jsx("span",{children:"Files"})]})})}),e.jsx(y,{children:e.jsxs(g,{disabled:!0,children:[e.jsx(We,{}),e.jsx("span",{children:"Components"})]})})]})})]})}),e.jsxs(Vt,{children:[e.jsx(V,{children:"Actions"}),e.jsx(K,{children:e.jsxs(U,{children:[b?.role==="developer"&&e.jsxs(e.Fragment,{children:[e.jsx(y,{children:e.jsxs(g,{className:"cursor-pointer",onClick:()=>w(),children:[u.isLoading?e.jsx(P,{className:"animate-spin"}):e.jsx(Ge,{}),e.jsx("span",{children:"Pull from repo"})]})}),e.jsx(y,{children:e.jsxs(g,{className:"cursor-pointer",onClick:()=>k({author:b.email}),children:[f.isLoading?e.jsx(P,{className:"animate-spin"}):e.jsx(He,{}),e.jsx("span",{children:"Push to repo"})]})})]}),b&&e.jsx(y,{children:e.jsxs(g,{className:"cursor-pointer",onClick:()=>{j(b.email)},children:[o.isLoading?e.jsx(P,{className:"animate-spin"}):e.jsx(Fe,{}),e.jsx("span",{children:"Publish"})]})})]})}),e.jsx(Kt,{}),e.jsx(g,{asChild:!0,children:e.jsxs(N,{to:h?.previewUrl,children:["Preview",e.jsx(Ve,{className:"ml-auto"})]})}),e.jsx(g,{className:"cursor-pointer",onClick:()=>n(!0),children:"About"}),e.jsxs(g,{className:"cursor-pointer",onClick:()=>t(ve()),children:[e.jsx(at,{}),"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.21.0"]})]})]})}function ta({children:t}){const a=xe(),n=z(o=>o.auth.user),s=z(o=>o.auth.isLoading);return r.useEffect(()=>{!s&&!n&&a("/admin")},[s,a,n]),s||!n?e.jsx(Ke,{}):t}function aa(){const{pathname:t}=fe(),{data:a}=E(),n=t.split("/").filter(s=>!["admin","dashboard"].includes(s)&&s!=="");return a?e.jsx(e.Fragment,{children:n.map((s,o,i)=>e.jsxs(be.Fragment,{children:[i.length>1&&o>=1&&e.jsx(Ue,{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(Z,{to:`/admin/dashboard/${s}`,className:({isActive:u,isPending:p})=>p?"pending":u?"active":"",children:a[s]?a[s].displayName:s}),o===i.length-1&&(a[s]?a[s].displayName:s)]},s)]},o))}):null}const ya=me(function(){return e.jsx(ta,{children:e.jsxs(Bt,{className:"flex h-full",children:[e.jsx(ea,{}),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(Ht,{}),e.jsx(re,{orientation:"vertical",className:"h-4"}),e.jsx(aa,{})]})}),e.jsx(ge,{})]})]})})});export{ya as default};
|
|
1
|
+
import{p as e,a as r,x as N,y as Z,v as xe,z as fe,R as be,w as me,O as ge}from"./chunk-EPOLDU6W-CiSVlmCe.js";import{u as je,c as z,d as ve}from"./authSlice-DWtXmmFR.js";import{b as l,d as E,h as we,j as ye,k as Ne,l as Ce,u as Se}from"./utils-B48p8Qal.js";import{t as v}from"./index-CZSVchcX.js";import{R as Y,C as J,a as ee,T as te,D as ae,P as se,O as ne,u as ke}from"./index-DutSppa2.js";import{X as oe}from"./x-D6gZWaAR.js";import{B as _}from"./button-BEFuP7Ru.js";import{c as C}from"./createLucideIcon-BvSqmaUO.js";import{S as R,c as _e,u as Me}from"./index-CbaefyjV.js";import{P as Pe,u as Oe,c as ze,a as A,b as Ee,d as Re,e as Ae}from"./index-B5ynPIRP.js";import{P as De,R as Ie,T as Le,a as Te,C as $e,A as Be}from"./index-CU6_POhE.js";import{C as B}from"./chevron-down-qxzqwz13.js";import{L as P}from"./loader-circle-BDUbeTTe.js";import{A as Ge,a as He}from"./arrow-up-C0I0e1Jt.js";import{U as Fe}from"./upload-DhJ5wU_H.js";import{E as Ve}from"./external-link-ERgO2SVI.js";import{L as Ke}from"./Loading-C1QGFwZC.js";import{C as Ue}from"./chevron-right-BFlMu-RJ.js";import"./index-DLIEpuwL.js";const qe=[["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"}]],We=C("blocks",qe);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"}]],Xe=C("files",Qe);const Ze=[["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"}]],Ye=C("grid-3x3",Ze);const Je=[["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"}]],et=C("heart",Je);const tt=[["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"}]],at=C("log-out",tt);const st=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]],nt=C("panel-left",st);const ot=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],it=C("square",ot);function rt({...t}){return e.jsx(Y,{"data-slot":"dialog",...t})}function lt({...t}){return e.jsx(se,{"data-slot":"dialog-portal",...t})}function dt({className:t,...a}){return e.jsx(ne,{"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 ct({className:t,children:a,...n}){return e.jsxs(lt,{"data-slot":"dialog-portal",children:[e.jsx(dt,{}),e.jsxs(J,{"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(ee,{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(oe,{}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function ut({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 pt({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(te,{"data-slot":"dialog-title",className:l("text-lg leading-none font-semibold",t),...a})}function xt({className:t,...a}){return e.jsx(ae,{"data-slot":"dialog-description",className:l("text-muted-foreground text-sm",t),...a})}const ft="#181717",bt=r.forwardRef(function({title:a="GitHub",color:n="currentColor",size:s=24,...o},i){return n==="default"&&(n=ft),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"})]})}),mt="#85EA2D",G=r.forwardRef(function({title:a="Swagger",color:n="currentColor",size:s=24,...o},i){return n==="default"&&(n=mt),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 gt({isOpen:t,setOpen:a}){return e.jsx(rt,{open:t,onOpenChange:n=>a(n),children:e.jsxs(ct,{children:[e.jsxs(ut,{children:[e.jsx(ht,{children:"Editorial"}),e.jsx(xt,{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(bt,{size:14}),"GitHub repository"]})})]}),e.jsx(pt,{children:e.jsxs("p",{className:"flex items-center gap-1",children:["Created with",e.jsx(et,{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"})]})})]})})}var jt="Separator",H="horizontal",vt=["horizontal","vertical"],ie=r.forwardRef((t,a)=>{const{decorative:n,orientation:s=H,...o}=t,i=wt(s)?s:H,p=n?{role:"none"}:{"aria-orientation":i==="vertical"?i:void 0,role:"separator"};return e.jsx(Pe.div,{"data-orientation":i,...p,...o,ref:a})});ie.displayName=jt;function wt(t){return vt.includes(t)}var yt=ie;function re({className:t,orientation:a="horizontal",decorative:n=!0,...s}){return e.jsx(yt,{"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 Nt({...t}){return e.jsx(Y,{"data-slot":"sheet",...t})}function Ct({...t}){return e.jsx(se,{"data-slot":"sheet-portal",...t})}function St({className:t,...a}){return e.jsx(ne,{"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 kt({className:t,children:a,side:n="right",...s}){return e.jsxs(Ct,{children:[e.jsx(St,{}),e.jsxs(J,{"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(ee,{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(oe,{className:"size-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]})}function _t({className:t,...a}){return e.jsx("div",{"data-slot":"sheet-header",className:l("flex flex-col gap-1.5 p-4",t),...a})}function Mt({className:t,...a}){return e.jsx(te,{"data-slot":"sheet-title",className:l("text-foreground font-semibold",t),...a})}function Pt({className:t,...a}){return e.jsx(ae,{"data-slot":"sheet-description",className:l("text-muted-foreground text-sm",t),...a})}function le({delayDuration:t=0,...a}){return e.jsx(De,{"data-slot":"tooltip-provider",delayDuration:t,...a})}function Ot({...t}){return e.jsx(le,{children:e.jsx(Ie,{"data-slot":"tooltip",...t})})}function zt({...t}){return e.jsx(Le,{"data-slot":"tooltip-trigger",...t})}function Et({className:t,sideOffset:a=0,children:n,...s}){return e.jsx(Te,{children:e.jsxs($e,{"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(Be,{className:"bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}const O=768;function Rt(){const[t,a]=r.useState(void 0);return r.useEffect(()=>{const n=window.matchMedia(`(max-width: ${O-1}px)`),s=()=>{a(window.innerWidth<O)};return n.addEventListener("change",s),a(window.innerWidth<O),()=>n.removeEventListener("change",s)},[]),!!t}const At="sidebar_state",Dt=3600*24*7,It="16rem",Lt="18rem",Tt="3rem",$t="b",de=r.createContext(null);function D(){const t=r.useContext(de);if(!t)throw new Error("useSidebar must be used within a SidebarProvider.");return t}function Bt({defaultOpen:t=!0,open:a,onOpenChange:n,className:s,style:o,children:i,...u}){const p=Rt(),[f,h]=r.useState(!1),[x,S]=r.useState(t),m=a??x,b=r.useCallback(d=>{const c=typeof d=="function"?d(m):d;n?n(c):S(c),document.cookie=`${At}=${c}; path=/; max-age=${Dt}`},[n,m]),j=r.useCallback(()=>p?h(d=>!d):b(d=>!d),[p,b,h]);r.useEffect(()=>{const d=c=>{c.key===$t&&(c.metaKey||c.ctrlKey)&&(c.preventDefault(),j())};return window.addEventListener("keydown",d),()=>window.removeEventListener("keydown",d)},[j]);const w=m?"expanded":"collapsed",k=r.useMemo(()=>({state:w,open:m,setOpen:b,isMobile:p,openMobile:f,setOpenMobile:h,toggleSidebar:j}),[w,m,b,p,f,h,j]);return e.jsx(de.Provider,{value:k,children:e.jsx(le,{delayDuration:0,children:e.jsx("div",{"data-slot":"sidebar-wrapper",style:{"--sidebar-width":It,"--sidebar-width-icon":Tt,...o},className:l("group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full",s),...u,children:i})})})}function Gt({side:t="left",variant:a="sidebar",collapsible:n="offcanvas",className:s,children:o,...i}){const{isMobile:u,state:p,openMobile:f,setOpenMobile:h}=D();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}):u?e.jsx(Nt,{open:f,onOpenChange:h,...i,children:e.jsxs(kt,{"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":Lt},side:t,children:[e.jsxs(_t,{className:"sr-only",children:[e.jsx(Mt,{children:"Sidebar"}),e.jsx(Pt,{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":p,"data-collapsible":p==="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 Ht({className:t,onClick:a,...n}){const{toggleSidebar:s}=D();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(nt,{}),e.jsx("span",{className:"sr-only",children:"Toggle Sidebar"})]})}function Ft({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 Vt({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 Kt({className:t,...a}){return e.jsx(re,{"data-slot":"sidebar-separator","data-sidebar":"separator",className:l("bg-sidebar-border mx-2 w-auto",t),...a})}function Ut({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 F({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 V({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 K({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 U({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 qt=_e("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,...u}){const p=t?R:"button",{isMobile:f,state:h}=D(),x=e.jsx(p,{"data-slot":"sidebar-menu-button","data-sidebar":"menu-button","data-size":s,"data-active":a,className:l(qt({variant:n,size:s}),i),...u});return o?(typeof o=="string"&&(o={children:o}),e.jsxs(Ot,{children:[e.jsx(zt,{asChild:!0,children:x}),e.jsx(Et,{side:"right",align:"center",hidden:h!=="collapsed"||f,...o})]})):x}function Wt({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?R:"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 q({singleton:t}){const{data:a}=E(),{data:n}=we();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(Wt,{children:e.jsx(Z,{to:t?`/admin/dashboard/${o}/default`:`/admin/dashboard/${o}`,className:({isActive:u,isPending:p})=>p?"pending":u?"active":"",children:({isActive:u})=>e.jsx(Qt,{isActive:u,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",[Xt]=ze(M),[Zt,I]=Xt(M),ce=r.forwardRef((t,a)=>{const{__scopeCollapsible:n,open:s,defaultOpen:o,disabled:i,onOpenChange:u,...p}=t,[f,h]=Oe({prop:s,defaultProp:o??!1,onChange:u,caller:M});return e.jsx(Zt,{scope:n,disabled:i,contentId:ke(),open:f,onOpenToggle:r.useCallback(()=>h(x=>!x),[h]),children:e.jsx(A.div,{"data-state":T(f),"data-disabled":i?"":void 0,...p,ref:a})})});ce.displayName=M;var ue="CollapsibleTrigger",pe=r.forwardRef((t,a)=>{const{__scopeCollapsible:n,...s}=t,o=I(ue,n);return e.jsx(A.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)})});pe.displayName=ue;var L="CollapsibleContent",he=r.forwardRef((t,a)=>{const{forceMount:n,...s}=t,o=I(L,t.__scopeCollapsible);return e.jsx(Re,{present:n||o.open,children:({present:i})=>e.jsx(Yt,{...s,ref:a,present:i})})});he.displayName=L;var Yt=r.forwardRef((t,a)=>{const{__scopeCollapsible:n,present:s,children:o,...i}=t,u=I(L,n),[p,f]=r.useState(s),h=r.useRef(null),x=Me(a,h),S=r.useRef(0),m=S.current,b=r.useRef(0),j=b.current,w=u.open||p,k=r.useRef(w),d=r.useRef(void 0);return r.useEffect(()=>{const c=requestAnimationFrame(()=>k.current=!1);return()=>cancelAnimationFrame(c)},[]),Ae(()=>{const c=h.current;if(c){d.current=d.current||{transitionDuration:c.style.transitionDuration,animationName:c.style.animationName},c.style.transitionDuration="0s",c.style.animationName="none";const $=c.getBoundingClientRect();S.current=$.height,b.current=$.width,k.current||(c.style.transitionDuration=d.current.transitionDuration,c.style.animationName=d.current.animationName),f(s)}},[u.open,s]),e.jsx(A.div,{"data-state":T(u.open),"data-disabled":u.disabled?"":void 0,id:u.contentId,hidden:!w,...i,ref:x,style:{"--radix-collapsible-content-height":m?`${m}px`:void 0,"--radix-collapsible-content-width":j?`${j}px`:void 0,...t.style},children:w&&o})});function T(t){return t?"open":"closed"}var Jt=ce;function W({...t}){return e.jsx(Jt,{"data-slot":"collapsible",...t})}function Q({...t}){return e.jsx(pe,{"data-slot":"collapsible-trigger",...t})}function X({...t}){return e.jsx(he,{"data-slot":"collapsible-content",...t})}function ea(){const t=je(),[a,n]=r.useState(!1),[s,o]=ye(),[i,u]=Ne(),[p,f]=Ce(),{data:h}=Se(),{data:x}=E(),S=r.useMemo(()=>x&&!!Object.values(x).find(d=>!d.singleton),[x]),m=r.useMemo(()=>x&&!!Object.values(x).find(d=>d.singleton),[x]),b=z(d=>d.auth.user),j=async d=>{try{await s({author:d}).unwrap()?v.success("Content published successfully."):v.error("Publishing failed.")}catch(c){v.error("Publishing failed."),console.error(c)}},w=async()=>{try{await i().unwrap()?v.success("Content pulled successfully."):v.error("Pulling content failed.")}catch(d){v.error("Pulling content failed."),console.error(d)}},k=async d=>{try{await p(d).unwrap()?v.success("Content pushed successfully."):v.error("Pushing content failed.")}catch(c){v.error("Pushing content failed."),console.error(c)}};return e.jsxs(Gt,{className:"z-50",children:[e.jsx(gt,{isOpen:a,setOpen:n}),e.jsx(Ft,{className:"h-14 justify-center",children:e.jsx(F,{children:e.jsx(N,{to:"/admin/dashboard",className:"text-3xl font-semibold tracking-tight transition-colors",children:h?.name})})}),e.jsx(Ut,{children:e.jsxs(F,{children:[e.jsx(V,{children:"Content"}),e.jsx(K,{children:e.jsxs(U,{children:[e.jsx(W,{className:"group/collapsible",disabled:!S,children:e.jsxs(y,{children:[e.jsx(Q,{asChild:!0,children:e.jsxs(g,{className:"group",children:[e.jsx(Ye,{}),e.jsx("span",{children:"Collections"}),e.jsx(B,{className:"transition-transform ml-auto -mr-[2px] group-data-[state=open]:rotate-180"})]})}),e.jsx(X,{children:e.jsx(q,{})})]})}),e.jsx(W,{className:"group/collapsible",disabled:!m,children:e.jsxs(y,{children:[e.jsx(Q,{asChild:!0,children:e.jsxs(g,{className:"group",children:[e.jsx(it,{}),e.jsx("span",{children:"Singles"}),e.jsx(B,{className:"transition-transform ml-auto -mr-[2px] group-data-[state=open]:rotate-180"})]})}),e.jsx(X,{children:e.jsx(q,{singleton:!0})})]})}),e.jsx(y,{children:e.jsx(g,{asChild:!0,children:e.jsxs(N,{to:"/admin/dashboard/files",children:[e.jsx(Xe,{}),e.jsx("span",{children:"Files"})]})})}),e.jsx(y,{children:e.jsxs(g,{disabled:!0,children:[e.jsx(We,{}),e.jsx("span",{children:"Components"})]})})]})})]})}),e.jsxs(Vt,{children:[e.jsx(V,{children:"Actions"}),e.jsx(K,{children:e.jsxs(U,{children:[b?.role==="developer"&&e.jsxs(e.Fragment,{children:[e.jsx(y,{children:e.jsxs(g,{className:"cursor-pointer",onClick:()=>w(),children:[u.isLoading?e.jsx(P,{className:"animate-spin"}):e.jsx(Ge,{}),e.jsx("span",{children:"Pull from repo"})]})}),e.jsx(y,{children:e.jsxs(g,{className:"cursor-pointer",onClick:()=>k({author:b.email}),children:[f.isLoading?e.jsx(P,{className:"animate-spin"}):e.jsx(He,{}),e.jsx("span",{children:"Push to repo"})]})})]}),b&&e.jsx(y,{children:e.jsxs(g,{className:"cursor-pointer",onClick:()=>{j(b.email)},children:[o.isLoading?e.jsx(P,{className:"animate-spin"}):e.jsx(Fe,{}),e.jsx("span",{children:"Publish"})]})})]})}),e.jsx(Kt,{}),e.jsx(g,{asChild:!0,children:e.jsxs(N,{to:h?.previewUrl,children:["Preview",e.jsx(Ve,{className:"ml-auto"})]})}),e.jsx(g,{className:"cursor-pointer",onClick:()=>n(!0),children:"About"}),e.jsxs(g,{className:"cursor-pointer",onClick:()=>t(ve()),children:[e.jsx(at,{}),"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.21.1"]})]})]})}function ta({children:t}){const a=xe(),n=z(o=>o.auth.user),s=z(o=>o.auth.isLoading);return r.useEffect(()=>{!s&&!n&&a("/admin")},[s,a,n]),s||!n?e.jsx(Ke,{}):t}function aa(){const{pathname:t}=fe(),{data:a}=E(),n=t.split("/").filter(s=>!["admin","dashboard"].includes(s)&&s!=="");return a?e.jsx(e.Fragment,{children:n.map((s,o,i)=>e.jsxs(be.Fragment,{children:[i.length>1&&o>=1&&e.jsx(Ue,{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(Z,{to:`/admin/dashboard/${s}`,className:({isActive:u,isPending:p})=>p?"pending":u?"active":"",children:a[s]?a[s].displayName:s}),o===i.length-1&&(a[s]?a[s].displayName:s)]},s)]},o))}):null}const ya=me(function(){return e.jsx(ta,{children:e.jsxs(Bt,{className:"flex h-full",children:[e.jsx(ea,{}),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(Ht,{}),e.jsx(re,{orientation:"vertical",className:"h-4"}),e.jsx(aa,{})]})}),e.jsx(ge,{})]})]})})});export{ya as default};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/FilePicker-DGseBDOZ.js","assets/chunk-EPOLDU6W-CiSVlmCe.js","assets/utils-B48p8Qal.js","assets/files-BTW5qTjQ.js","assets/index-CZSVchcX.js","assets/index-DLIEpuwL.js","assets/badge-DTudhbGs.js","assets/index-CbaefyjV.js","assets/upload-DhJ5wU_H.js","assets/createLucideIcon-BvSqmaUO.js","assets/trash-UKLAaALv.js","assets/chevron-down-qxzqwz13.js","assets/check-DF0ucE8d.js","assets/x-D6gZWaAR.js","assets/button-BEFuP7Ru.js","assets/input-C3iFdiD8.js","assets/external-link-ERgO2SVI.js","assets/markdownEditor-Bsc2Tnws.js","assets/authSlice-DWtXmmFR.js","assets/index-DutSppa2.js","assets/index-B5ynPIRP.js","assets/zod-DU3Qlmru.js","assets/schemas-CPJfa6mm.js","assets/index-nnJosT4e.js","assets/index-CU6_POhE.js","assets/schemas-D-U8dKAF.js","assets/loader-circle-BDUbeTTe.js","assets/markdownEditor-Dha_UaaS.css","assets/date-picker-6Pg8PIj8.js","assets/clear-button-DehdxgmB.js","assets/chevron-right-BFlMu-RJ.js","assets/calendar-Frbsxn98.js","assets/datetime-picker-XkOBOVOZ.js","assets/URLInput-ATIRZflA.js","assets/ColorPicker-kqchGTe4.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{a as l,p as e,R as $,A as eo,v as to,z as oo}from"./chunk-EPOLDU6W-CiSVlmCe.js";import{c as We,b as k,f as so,g as Pe,u as Ye,a as q,e as se}from"./index-B5ynPIRP.js";import{u as U}from"./index-CbaefyjV.js";import{c as tt,R as no,W as ro,C as ao,T as lo,D as io,a as ot,P as co,O as uo,b as po,d as st,e as mo,u as Ke,V as ho,A as fo,f as xo,g as go,h as vo,i as So,j as Co,F as wo,k as yo,l as bo,m as jo}from"./index-DutSppa2.js";import{b as nt,B as ve}from"./button-BEFuP7Ru.js";import{b as T,z as No,A as Io,h as _o,n as Eo}from"./utils-B48p8Qal.js";import{B as Ro}from"./badge-DTudhbGs.js";import{g as Do,u as To,a as Ao,F as Po,b as Se,c as Ce,d as xe,e as we,f as ye,C as Xe,h as De}from"./zod-DU3Qlmru.js";import{I as Te}from"./input-C3iFdiD8.js";import{a as rt}from"./index-DLIEpuwL.js";import{C as at}from"./chevron-down-qxzqwz13.js";import{C as Mo}from"./check-DF0ucE8d.js";import{c as qe}from"./createLucideIcon-BvSqmaUO.js";import{R as Oo}from"./schemas-D-U8dKAF.js";import{t as ie}from"./index-CZSVchcX.js";import{X as Me}from"./x-D6gZWaAR.js";import{L as Lo}from"./loader-circle-BDUbeTTe.js";import{s as G,_ as Ze,u as ko,n as $o,l as Vo,o as Fo,a as Bo}from"./schemas-CPJfa6mm.js";const zo=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Ho=qe("chevron-up",zo);const Uo=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],Qe=qe("rotate-ccw",Uo);const Wo=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],Ko=qe("save",Wo);function Ae(t){if(!t||t.length!==1)return null;const o=t[0].match(/^\$(.+)$/);return o?o[1]:null}const qo="modulepreload",Go=function(t){return"/"+t},Je={},me=function(o,s,i){let c=Promise.resolve();if(s&&s.length>0){let h=function(f){return Promise.all(f.map(w=>Promise.resolve(w).then(b=>({status:"fulfilled",value:b}),b=>({status:"rejected",reason:b}))))};document.getElementsByTagName("link");const n=document.querySelector("meta[property=csp-nonce]"),d=n?.nonce||n?.getAttribute("nonce");c=h(s.map(f=>{if(f=Go(f),f in Je)return;Je[f]=!0;const w=f.endsWith(".css"),b=w?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${b}`))return;const N=document.createElement("link");if(N.rel=w?"stylesheet":qo,w||(N.as="script"),N.crossOrigin="",N.href=f,d&&N.setAttribute("nonce",d),document.head.appendChild(N),w)return new Promise((E,_)=>{N.addEventListener("load",E),N.addEventListener("error",()=>_(new Error(`Unable to preload CSS for ${f}`)))})}))}function p(n){const d=new Event("vite:preloadError",{cancelable:!0});if(d.payload=n,window.dispatchEvent(d),!d.defaultPrevented)throw n}return c.then(n=>{for(const d of n||[])d.status==="rejected"&&p(d.reason);return o().catch(p)})};var lt="AlertDialog",[Yo]=We(lt,[tt]),oe=tt(),it=t=>{const{__scopeAlertDialog:o,...s}=t,i=oe(o);return e.jsx(no,{...i,...s,modal:!0})};it.displayName=lt;var Xo="AlertDialogTrigger",Zo=l.forwardRef((t,o)=>{const{__scopeAlertDialog:s,...i}=t,c=oe(s);return e.jsx(po,{...c,...i,ref:o})});Zo.displayName=Xo;var Qo="AlertDialogPortal",ct=t=>{const{__scopeAlertDialog:o,...s}=t,i=oe(o);return e.jsx(co,{...i,...s})};ct.displayName=Qo;var Jo="AlertDialogOverlay",dt=l.forwardRef((t,o)=>{const{__scopeAlertDialog:s,...i}=t,c=oe(s);return e.jsx(uo,{...c,...i,ref:o})});dt.displayName=Jo;var pe="AlertDialogContent",[es,ts]=Yo(pe),os=so("AlertDialogContent"),ut=l.forwardRef((t,o)=>{const{__scopeAlertDialog:s,children:i,...c}=t,p=oe(s),n=l.useRef(null),d=U(o,n),h=l.useRef(null);return e.jsx(ro,{contentName:pe,titleName:pt,docsSlug:"alert-dialog",children:e.jsx(es,{scope:s,cancelRef:h,children:e.jsxs(ao,{role:"alertdialog",...p,...c,ref:d,onOpenAutoFocus:k(c.onOpenAutoFocus,f=>{f.preventDefault(),h.current?.focus({preventScroll:!0})}),onPointerDownOutside:f=>f.preventDefault(),onInteractOutside:f=>f.preventDefault(),children:[e.jsx(os,{children:i}),e.jsx(ns,{contentRef:n})]})})})});ut.displayName=pe;var pt="AlertDialogTitle",mt=l.forwardRef((t,o)=>{const{__scopeAlertDialog:s,...i}=t,c=oe(s);return e.jsx(lo,{...c,...i,ref:o})});mt.displayName=pt;var ht="AlertDialogDescription",ft=l.forwardRef((t,o)=>{const{__scopeAlertDialog:s,...i}=t,c=oe(s);return e.jsx(io,{...c,...i,ref:o})});ft.displayName=ht;var ss="AlertDialogAction",xt=l.forwardRef((t,o)=>{const{__scopeAlertDialog:s,...i}=t,c=oe(s);return e.jsx(ot,{...c,...i,ref:o})});xt.displayName=ss;var gt="AlertDialogCancel",vt=l.forwardRef((t,o)=>{const{__scopeAlertDialog:s,...i}=t,{cancelRef:c}=ts(gt,s),p=oe(s),n=U(o,c);return e.jsx(ot,{...p,...i,ref:n})});vt.displayName=gt;var ns=({contentRef:t})=>{const o=`\`${pe}\` requires a description for the component to be accessible for screen reader users.
|
|
3
|
+
|
|
4
|
+
You can add a description to the \`${pe}\` by passing a \`${ht}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
|
5
|
+
|
|
6
|
+
Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${pe}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
|
|
7
|
+
|
|
8
|
+
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return l.useEffect(()=>{document.getElementById(t.current?.getAttribute("aria-describedby"))||console.warn(o)},[o,t]),null},rs=it,as=ct,ls=dt,is=ut,cs=xt,ds=vt,us=mt,ps=ft;function St({...t}){return e.jsx(rs,{"data-slot":"alert-dialog",...t})}function ms({...t}){return e.jsx(as,{"data-slot":"alert-dialog-portal",...t})}function hs({className:t,...o}){return e.jsx(ls,{"data-slot":"alert-dialog-overlay",className:T("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),...o})}function Ct({className:t,...o}){return e.jsxs(ms,{children:[e.jsx(hs,{}),e.jsx(is,{"data-slot":"alert-dialog-content",className:T("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),...o})]})}function wt({className:t,...o}){return e.jsx("div",{"data-slot":"alert-dialog-header",className:T("flex flex-col gap-2 text-center sm:text-left",t),...o})}function yt({className:t,...o}){return e.jsx("div",{"data-slot":"alert-dialog-footer",className:T("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),...o})}function bt({className:t,...o}){return e.jsx(us,{"data-slot":"alert-dialog-title",className:T("text-lg font-semibold",t),...o})}function jt({className:t,...o}){return e.jsx(ps,{"data-slot":"alert-dialog-description",className:T("text-muted-foreground text-sm",t),...o})}function Nt({className:t,...o}){return e.jsx(cs,{className:T(nt(),t),...o})}function It({className:t,...o}){return e.jsx(ds,{className:T(nt({variant:"outline"}),t),...o})}function et(t,[o,s]){return Math.min(s,Math.max(o,t))}function fs(t){const o=t+"CollectionProvider",[s,i]=We(o),[c,p]=s(o,{collectionRef:{current:null},itemMap:new Map}),n=x=>{const{scope:S,children:j}=x,g=$.useRef(null),C=$.useRef(new Map).current;return e.jsx(c,{scope:S,itemMap:C,collectionRef:g,children:j})};n.displayName=o;const d=t+"CollectionSlot",h=Pe(d),f=$.forwardRef((x,S)=>{const{scope:j,children:g}=x,C=p(d,j),A=U(S,C.collectionRef);return e.jsx(h,{ref:A,children:g})});f.displayName=d;const w=t+"CollectionItemSlot",b="data-radix-collection-item",N=Pe(w),E=$.forwardRef((x,S)=>{const{scope:j,children:g,...C}=x,A=$.useRef(null),V=U(S,A),v=p(w,j);return $.useEffect(()=>(v.itemMap.set(A,{ref:A,...C}),()=>{v.itemMap.delete(A)})),e.jsx(N,{[b]:"",ref:V,children:g})});E.displayName=w;function _(x){const S=p(t+"CollectionConsumer",x);return $.useCallback(()=>{const g=S.collectionRef.current;if(!g)return[];const C=Array.from(g.querySelectorAll(`[${b}]`));return Array.from(S.itemMap.values()).sort((v,P)=>C.indexOf(v.ref.current)-C.indexOf(P.ref.current))},[S.collectionRef,S.itemMap])}return[{Provider:n,Slot:f,ItemSlot:E},_,i]}var xs=l.createContext(void 0);function gs(t){const o=l.useContext(xs);return t||o||"ltr"}var vs=[" ","Enter","ArrowUp","ArrowDown"],Ss=[" ","Enter"],ce="Select",[je,Ne,Cs]=fs(ce),[he]=We(ce,[Cs,st]),Ie=st(),[ws,ne]=he(ce),[ys,bs]=he(ce),_t=t=>{const{__scopeSelect:o,children:s,open:i,defaultOpen:c,onOpenChange:p,value:n,defaultValue:d,onValueChange:h,dir:f,name:w,autoComplete:b,disabled:N,required:E,form:_}=t,x=Ie(o),[S,j]=l.useState(null),[g,C]=l.useState(null),[A,V]=l.useState(!1),v=gs(f),[P,W]=Ye({prop:i,defaultProp:c??!1,onChange:p,caller:ce}),[ee,te]=Ye({prop:n,defaultProp:d,onChange:h,caller:ce}),Y=l.useRef(null),z=S?_||!!S.closest("form"):!0,[X,Z]=l.useState(new Set),H=Array.from(X).map(M=>M.props.value).join(";");return e.jsx(mo,{...x,children:e.jsxs(ws,{required:E,scope:o,trigger:S,onTriggerChange:j,valueNode:g,onValueNodeChange:C,valueNodeHasChildren:A,onValueNodeHasChildrenChange:V,contentId:Ke(),value:ee,onValueChange:te,open:P,onOpenChange:W,dir:v,triggerPointerDownPosRef:Y,disabled:N,children:[e.jsx(je.Provider,{scope:o,children:e.jsx(ys,{scope:t.__scopeSelect,onNativeOptionAdd:l.useCallback(M=>{Z(r=>new Set(r).add(M))},[]),onNativeOptionRemove:l.useCallback(M=>{Z(r=>{const a=new Set(r);return a.delete(M),a})},[]),children:s})}),z?e.jsxs(Xt,{"aria-hidden":!0,required:E,tabIndex:-1,name:w,autoComplete:b,value:ee,onChange:M=>te(M.target.value),disabled:N,form:_,children:[ee===void 0?e.jsx("option",{value:""}):null,Array.from(X)]},H):null]})})};_t.displayName=ce;var Et="SelectTrigger",Rt=l.forwardRef((t,o)=>{const{__scopeSelect:s,disabled:i=!1,...c}=t,p=Ie(s),n=ne(Et,s),d=n.disabled||i,h=U(o,n.onTriggerChange),f=Ne(s),w=l.useRef("touch"),[b,N,E]=Qt(x=>{const S=f().filter(C=>!C.disabled),j=S.find(C=>C.value===n.value),g=Jt(S,x,j);g!==void 0&&n.onValueChange(g.value)}),_=x=>{d||(n.onOpenChange(!0),E()),x&&(n.triggerPointerDownPosRef.current={x:Math.round(x.pageX),y:Math.round(x.pageY)})};return e.jsx(fo,{asChild:!0,...p,children:e.jsx(q.button,{type:"button",role:"combobox","aria-controls":n.contentId,"aria-expanded":n.open,"aria-required":n.required,"aria-autocomplete":"none",dir:n.dir,"data-state":n.open?"open":"closed",disabled:d,"data-disabled":d?"":void 0,"data-placeholder":Zt(n.value)?"":void 0,...c,ref:h,onClick:k(c.onClick,x=>{x.currentTarget.focus(),w.current!=="mouse"&&_(x)}),onPointerDown:k(c.onPointerDown,x=>{w.current=x.pointerType;const S=x.target;S.hasPointerCapture(x.pointerId)&&S.releasePointerCapture(x.pointerId),x.button===0&&x.ctrlKey===!1&&x.pointerType==="mouse"&&(_(x),x.preventDefault())}),onKeyDown:k(c.onKeyDown,x=>{const S=b.current!=="";!(x.ctrlKey||x.altKey||x.metaKey)&&x.key.length===1&&N(x.key),!(S&&x.key===" ")&&vs.includes(x.key)&&(_(),x.preventDefault())})})})});Rt.displayName=Et;var Dt="SelectValue",Tt=l.forwardRef((t,o)=>{const{__scopeSelect:s,className:i,style:c,children:p,placeholder:n="",...d}=t,h=ne(Dt,s),{onValueNodeHasChildrenChange:f}=h,w=p!==void 0,b=U(o,h.onValueNodeChange);return se(()=>{f(w)},[f,w]),e.jsx(q.span,{...d,ref:b,style:{pointerEvents:"none"},children:Zt(h.value)?e.jsx(e.Fragment,{children:n}):p})});Tt.displayName=Dt;var js="SelectIcon",At=l.forwardRef((t,o)=>{const{__scopeSelect:s,children:i,...c}=t;return e.jsx(q.span,{"aria-hidden":!0,...c,ref:o,children:i||"▼"})});At.displayName=js;var Ns="SelectPortal",Pt=t=>e.jsx(xo,{asChild:!0,...t});Pt.displayName=Ns;var de="SelectContent",Mt=l.forwardRef((t,o)=>{const s=ne(de,t.__scopeSelect),[i,c]=l.useState();if(se(()=>{c(new DocumentFragment)},[]),!s.open){const p=i;return p?rt.createPortal(e.jsx(Ot,{scope:t.__scopeSelect,children:e.jsx(je.Slot,{scope:t.__scopeSelect,children:e.jsx("div",{children:t.children})})}),p):null}return e.jsx(Lt,{...t,ref:o})});Mt.displayName=de;var J=10,[Ot,re]=he(de),Is="SelectContentImpl",_s=Pe("SelectContent.RemoveScroll"),Lt=l.forwardRef((t,o)=>{const{__scopeSelect:s,position:i="item-aligned",onCloseAutoFocus:c,onEscapeKeyDown:p,onPointerDownOutside:n,side:d,sideOffset:h,align:f,alignOffset:w,arrowPadding:b,collisionBoundary:N,collisionPadding:E,sticky:_,hideWhenDetached:x,avoidCollisions:S,...j}=t,g=ne(de,s),[C,A]=l.useState(null),[V,v]=l.useState(null),P=U(o,y=>A(y)),[W,ee]=l.useState(null),[te,Y]=l.useState(null),z=Ne(s),[X,Z]=l.useState(!1),H=l.useRef(!1);l.useEffect(()=>{if(C)return vo(C)},[C]),So();const M=l.useCallback(y=>{const[O,...K]=z().map(L=>L.ref.current),[R]=K.slice(-1),D=document.activeElement;for(const L of y)if(L===D||(L?.scrollIntoView({block:"nearest"}),L===O&&V&&(V.scrollTop=0),L===R&&V&&(V.scrollTop=V.scrollHeight),L?.focus(),document.activeElement!==D))return},[z,V]),r=l.useCallback(()=>M([W,C]),[M,W,C]);l.useEffect(()=>{X&&r()},[X,r]);const{onOpenChange:a,triggerPointerDownPosRef:m}=g;l.useEffect(()=>{if(C){let y={x:0,y:0};const O=R=>{y={x:Math.abs(Math.round(R.pageX)-(m.current?.x??0)),y:Math.abs(Math.round(R.pageY)-(m.current?.y??0))}},K=R=>{y.x<=10&&y.y<=10?R.preventDefault():C.contains(R.target)||a(!1),document.removeEventListener("pointermove",O),m.current=null};return m.current!==null&&(document.addEventListener("pointermove",O),document.addEventListener("pointerup",K,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",O),document.removeEventListener("pointerup",K,{capture:!0})}}},[C,a,m]),l.useEffect(()=>{const y=()=>a(!1);return window.addEventListener("blur",y),window.addEventListener("resize",y),()=>{window.removeEventListener("blur",y),window.removeEventListener("resize",y)}},[a]);const[u,F]=Qt(y=>{const O=z().filter(D=>!D.disabled),K=O.find(D=>D.ref.current===document.activeElement),R=Jt(O,y,K);R&&setTimeout(()=>R.ref.current.focus())}),Q=l.useCallback((y,O,K)=>{const R=!H.current&&!K;(g.value!==void 0&&g.value===O||R)&&(ee(y),R&&(H.current=!0))},[g.value]),I=l.useCallback(()=>C?.focus(),[C]),B=l.useCallback((y,O,K)=>{const R=!H.current&&!K;(g.value!==void 0&&g.value===O||R)&&Y(y)},[g.value]),ue=i==="popper"?Oe:kt,fe=ue===Oe?{side:d,sideOffset:h,align:f,alignOffset:w,arrowPadding:b,collisionBoundary:N,collisionPadding:E,sticky:_,hideWhenDetached:x,avoidCollisions:S}:{};return e.jsx(Ot,{scope:s,content:C,viewport:V,onViewportChange:v,itemRefCallback:Q,selectedItem:W,onItemLeave:I,itemTextRefCallback:B,focusSelectedItem:r,selectedItemText:te,position:i,isPositioned:X,searchRef:u,children:e.jsx(Co,{as:_s,allowPinchZoom:!0,children:e.jsx(wo,{asChild:!0,trapped:g.open,onMountAutoFocus:y=>{y.preventDefault()},onUnmountAutoFocus:k(c,y=>{g.trigger?.focus({preventScroll:!0}),y.preventDefault()}),children:e.jsx(yo,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:p,onPointerDownOutside:n,onFocusOutside:y=>y.preventDefault(),onDismiss:()=>g.onOpenChange(!1),children:e.jsx(ue,{role:"listbox",id:g.contentId,"data-state":g.open?"open":"closed",dir:g.dir,onContextMenu:y=>y.preventDefault(),...j,...fe,onPlaced:()=>Z(!0),ref:P,style:{display:"flex",flexDirection:"column",outline:"none",...j.style},onKeyDown:k(j.onKeyDown,y=>{const O=y.ctrlKey||y.altKey||y.metaKey;if(y.key==="Tab"&&y.preventDefault(),!O&&y.key.length===1&&F(y.key),["ArrowUp","ArrowDown","Home","End"].includes(y.key)){let R=z().filter(D=>!D.disabled).map(D=>D.ref.current);if(["ArrowUp","End"].includes(y.key)&&(R=R.slice().reverse()),["ArrowUp","ArrowDown"].includes(y.key)){const D=y.target,L=R.indexOf(D);R=R.slice(L+1)}setTimeout(()=>M(R)),y.preventDefault()}})})})})})})});Lt.displayName=Is;var Es="SelectItemAlignedPosition",kt=l.forwardRef((t,o)=>{const{__scopeSelect:s,onPlaced:i,...c}=t,p=ne(de,s),n=re(de,s),[d,h]=l.useState(null),[f,w]=l.useState(null),b=U(o,P=>w(P)),N=Ne(s),E=l.useRef(!1),_=l.useRef(!0),{viewport:x,selectedItem:S,selectedItemText:j,focusSelectedItem:g}=n,C=l.useCallback(()=>{if(p.trigger&&p.valueNode&&d&&f&&x&&S&&j){const P=p.trigger.getBoundingClientRect(),W=f.getBoundingClientRect(),ee=p.valueNode.getBoundingClientRect(),te=j.getBoundingClientRect();if(p.dir!=="rtl"){const D=te.left-W.left,L=ee.left-D,ae=P.left-L,le=P.width+ae,_e=Math.max(le,W.width),Ee=window.innerWidth-J,Re=et(L,[J,Math.max(J,Ee-_e)]);d.style.minWidth=le+"px",d.style.left=Re+"px"}else{const D=W.right-te.right,L=window.innerWidth-ee.right-D,ae=window.innerWidth-P.right-L,le=P.width+ae,_e=Math.max(le,W.width),Ee=window.innerWidth-J,Re=et(L,[J,Math.max(J,Ee-_e)]);d.style.minWidth=le+"px",d.style.right=Re+"px"}const Y=N(),z=window.innerHeight-J*2,X=x.scrollHeight,Z=window.getComputedStyle(f),H=parseInt(Z.borderTopWidth,10),M=parseInt(Z.paddingTop,10),r=parseInt(Z.borderBottomWidth,10),a=parseInt(Z.paddingBottom,10),m=H+M+X+a+r,u=Math.min(S.offsetHeight*5,m),F=window.getComputedStyle(x),Q=parseInt(F.paddingTop,10),I=parseInt(F.paddingBottom,10),B=P.top+P.height/2-J,ue=z-B,fe=S.offsetHeight/2,y=S.offsetTop+fe,O=H+M+y,K=m-O;if(O<=B){const D=Y.length>0&&S===Y[Y.length-1].ref.current;d.style.bottom="0px";const L=f.clientHeight-x.offsetTop-x.offsetHeight,ae=Math.max(ue,fe+(D?I:0)+L+r),le=O+ae;d.style.height=le+"px"}else{const D=Y.length>0&&S===Y[0].ref.current;d.style.top="0px";const ae=Math.max(B,H+x.offsetTop+(D?Q:0)+fe)+K;d.style.height=ae+"px",x.scrollTop=O-B+x.offsetTop}d.style.margin=`${J}px 0`,d.style.minHeight=u+"px",d.style.maxHeight=z+"px",i?.(),requestAnimationFrame(()=>E.current=!0)}},[N,p.trigger,p.valueNode,d,f,x,S,j,p.dir,i]);se(()=>C(),[C]);const[A,V]=l.useState();se(()=>{f&&V(window.getComputedStyle(f).zIndex)},[f]);const v=l.useCallback(P=>{P&&_.current===!0&&(C(),g?.(),_.current=!1)},[C,g]);return e.jsx(Ds,{scope:s,contentWrapper:d,shouldExpandOnScrollRef:E,onScrollButtonChange:v,children:e.jsx("div",{ref:h,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:A},children:e.jsx(q.div,{...c,ref:b,style:{boxSizing:"border-box",maxHeight:"100%",...c.style}})})})});kt.displayName=Es;var Rs="SelectPopperPosition",Oe=l.forwardRef((t,o)=>{const{__scopeSelect:s,align:i="start",collisionPadding:c=J,...p}=t,n=Ie(s);return e.jsx(bo,{...n,...p,ref:o,align:i,collisionPadding:c,style:{boxSizing:"border-box",...p.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Oe.displayName=Rs;var[Ds,Ge]=he(de,{}),Le="SelectViewport",$t=l.forwardRef((t,o)=>{const{__scopeSelect:s,nonce:i,...c}=t,p=re(Le,s),n=Ge(Le,s),d=U(o,p.onViewportChange),h=l.useRef(0);return e.jsxs(e.Fragment,{children:[e.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:i}),e.jsx(je.Slot,{scope:s,children:e.jsx(q.div,{"data-radix-select-viewport":"",role:"presentation",...c,ref:d,style:{position:"relative",flex:1,overflow:"hidden auto",...c.style},onScroll:k(c.onScroll,f=>{const w=f.currentTarget,{contentWrapper:b,shouldExpandOnScrollRef:N}=n;if(N?.current&&b){const E=Math.abs(h.current-w.scrollTop);if(E>0){const _=window.innerHeight-J*2,x=parseFloat(b.style.minHeight),S=parseFloat(b.style.height),j=Math.max(x,S);if(j<_){const g=j+E,C=Math.min(_,g),A=g-C;b.style.height=C+"px",b.style.bottom==="0px"&&(w.scrollTop=A>0?A:0,b.style.justifyContent="flex-end")}}}h.current=w.scrollTop})})})]})});$t.displayName=Le;var Vt="SelectGroup",[Ts,As]=he(Vt),Ps=l.forwardRef((t,o)=>{const{__scopeSelect:s,...i}=t,c=Ke();return e.jsx(Ts,{scope:s,id:c,children:e.jsx(q.div,{role:"group","aria-labelledby":c,...i,ref:o})})});Ps.displayName=Vt;var Ft="SelectLabel",Ms=l.forwardRef((t,o)=>{const{__scopeSelect:s,...i}=t,c=As(Ft,s);return e.jsx(q.div,{id:c.id,...i,ref:o})});Ms.displayName=Ft;var be="SelectItem",[Os,Bt]=he(be),zt=l.forwardRef((t,o)=>{const{__scopeSelect:s,value:i,disabled:c=!1,textValue:p,...n}=t,d=ne(be,s),h=re(be,s),f=d.value===i,[w,b]=l.useState(p??""),[N,E]=l.useState(!1),_=U(o,g=>h.itemRefCallback?.(g,i,c)),x=Ke(),S=l.useRef("touch"),j=()=>{c||(d.onValueChange(i),d.onOpenChange(!1))};if(i==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return e.jsx(Os,{scope:s,value:i,disabled:c,textId:x,isSelected:f,onItemTextChange:l.useCallback(g=>{b(C=>C||(g?.textContent??"").trim())},[]),children:e.jsx(je.ItemSlot,{scope:s,value:i,disabled:c,textValue:w,children:e.jsx(q.div,{role:"option","aria-labelledby":x,"data-highlighted":N?"":void 0,"aria-selected":f&&N,"data-state":f?"checked":"unchecked","aria-disabled":c||void 0,"data-disabled":c?"":void 0,tabIndex:c?void 0:-1,...n,ref:_,onFocus:k(n.onFocus,()=>E(!0)),onBlur:k(n.onBlur,()=>E(!1)),onClick:k(n.onClick,()=>{S.current!=="mouse"&&j()}),onPointerUp:k(n.onPointerUp,()=>{S.current==="mouse"&&j()}),onPointerDown:k(n.onPointerDown,g=>{S.current=g.pointerType}),onPointerMove:k(n.onPointerMove,g=>{S.current=g.pointerType,c?h.onItemLeave?.():S.current==="mouse"&&g.currentTarget.focus({preventScroll:!0})}),onPointerLeave:k(n.onPointerLeave,g=>{g.currentTarget===document.activeElement&&h.onItemLeave?.()}),onKeyDown:k(n.onKeyDown,g=>{h.searchRef?.current!==""&&g.key===" "||(Ss.includes(g.key)&&j(),g.key===" "&&g.preventDefault())})})})})});zt.displayName=be;var ge="SelectItemText",Ht=l.forwardRef((t,o)=>{const{__scopeSelect:s,className:i,style:c,...p}=t,n=ne(ge,s),d=re(ge,s),h=Bt(ge,s),f=bs(ge,s),[w,b]=l.useState(null),N=U(o,j=>b(j),h.onItemTextChange,j=>d.itemTextRefCallback?.(j,h.value,h.disabled)),E=w?.textContent,_=l.useMemo(()=>e.jsx("option",{value:h.value,disabled:h.disabled,children:E},h.value),[h.disabled,h.value,E]),{onNativeOptionAdd:x,onNativeOptionRemove:S}=f;return se(()=>(x(_),()=>S(_)),[x,S,_]),e.jsxs(e.Fragment,{children:[e.jsx(q.span,{id:h.textId,...p,ref:N}),h.isSelected&&n.valueNode&&!n.valueNodeHasChildren?rt.createPortal(p.children,n.valueNode):null]})});Ht.displayName=ge;var Ut="SelectItemIndicator",Wt=l.forwardRef((t,o)=>{const{__scopeSelect:s,...i}=t;return Bt(Ut,s).isSelected?e.jsx(q.span,{"aria-hidden":!0,...i,ref:o}):null});Wt.displayName=Ut;var ke="SelectScrollUpButton",Kt=l.forwardRef((t,o)=>{const s=re(ke,t.__scopeSelect),i=Ge(ke,t.__scopeSelect),[c,p]=l.useState(!1),n=U(o,i.onScrollButtonChange);return se(()=>{if(s.viewport&&s.isPositioned){let d=function(){const f=h.scrollTop>0;p(f)};const h=s.viewport;return d(),h.addEventListener("scroll",d),()=>h.removeEventListener("scroll",d)}},[s.viewport,s.isPositioned]),c?e.jsx(Gt,{...t,ref:n,onAutoScroll:()=>{const{viewport:d,selectedItem:h}=s;d&&h&&(d.scrollTop=d.scrollTop-h.offsetHeight)}}):null});Kt.displayName=ke;var $e="SelectScrollDownButton",qt=l.forwardRef((t,o)=>{const s=re($e,t.__scopeSelect),i=Ge($e,t.__scopeSelect),[c,p]=l.useState(!1),n=U(o,i.onScrollButtonChange);return se(()=>{if(s.viewport&&s.isPositioned){let d=function(){const f=h.scrollHeight-h.clientHeight,w=Math.ceil(h.scrollTop)<f;p(w)};const h=s.viewport;return d(),h.addEventListener("scroll",d),()=>h.removeEventListener("scroll",d)}},[s.viewport,s.isPositioned]),c?e.jsx(Gt,{...t,ref:n,onAutoScroll:()=>{const{viewport:d,selectedItem:h}=s;d&&h&&(d.scrollTop=d.scrollTop+h.offsetHeight)}}):null});qt.displayName=$e;var Gt=l.forwardRef((t,o)=>{const{__scopeSelect:s,onAutoScroll:i,...c}=t,p=re("SelectScrollButton",s),n=l.useRef(null),d=Ne(s),h=l.useCallback(()=>{n.current!==null&&(window.clearInterval(n.current),n.current=null)},[]);return l.useEffect(()=>()=>h(),[h]),se(()=>{d().find(w=>w.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[d]),e.jsx(q.div,{"aria-hidden":!0,...c,ref:o,style:{flexShrink:0,...c.style},onPointerDown:k(c.onPointerDown,()=>{n.current===null&&(n.current=window.setInterval(i,50))}),onPointerMove:k(c.onPointerMove,()=>{p.onItemLeave?.(),n.current===null&&(n.current=window.setInterval(i,50))}),onPointerLeave:k(c.onPointerLeave,()=>{h()})})}),Ls="SelectSeparator",Yt=l.forwardRef((t,o)=>{const{__scopeSelect:s,...i}=t;return e.jsx(q.div,{"aria-hidden":!0,...i,ref:o})});Yt.displayName=Ls;var Ve="SelectArrow",ks=l.forwardRef((t,o)=>{const{__scopeSelect:s,...i}=t,c=Ie(s),p=ne(Ve,s),n=re(Ve,s);return p.open&&n.position==="popper"?e.jsx(jo,{...c,...i,ref:o}):null});ks.displayName=Ve;var $s="SelectBubbleInput",Xt=l.forwardRef(({__scopeSelect:t,value:o,...s},i)=>{const c=l.useRef(null),p=U(i,c),n=Do(o);return l.useEffect(()=>{const d=c.current;if(!d)return;const h=window.HTMLSelectElement.prototype,w=Object.getOwnPropertyDescriptor(h,"value").set;if(n!==o&&w){const b=new Event("change",{bubbles:!0});w.call(d,o),d.dispatchEvent(b)}},[n,o]),e.jsx(q.select,{...s,style:{...ho,...s.style},ref:p,defaultValue:o})});Xt.displayName=$s;function Zt(t){return t===""||t===void 0}function Qt(t){const o=go(t),s=l.useRef(""),i=l.useRef(0),c=l.useCallback(n=>{const d=s.current+n;o(d),(function h(f){s.current=f,window.clearTimeout(i.current),f!==""&&(i.current=window.setTimeout(()=>h(""),1e3))})(d)},[o]),p=l.useCallback(()=>{s.current="",window.clearTimeout(i.current)},[]);return l.useEffect(()=>()=>window.clearTimeout(i.current),[]),[s,c,p]}function Jt(t,o,s){const c=o.length>1&&Array.from(o).every(f=>f===o[0])?o[0]:o,p=s?t.indexOf(s):-1;let n=Vs(t,Math.max(p,0));c.length===1&&(n=n.filter(f=>f!==s));const h=n.find(f=>f.textValue.toLowerCase().startsWith(c.toLowerCase()));return h!==s?h:void 0}function Vs(t,o){return t.map((s,i)=>t[(o+i)%t.length])}var Fs=_t,Bs=Rt,zs=Tt,Hs=At,Us=Pt,Ws=Mt,Ks=$t,qs=zt,Gs=Ht,Ys=Wt,Xs=Kt,Zs=qt,_n=Yt;function Fe({...t}){return e.jsx(Fs,{"data-slot":"select",...t})}function Be({...t}){return e.jsx(zs,{"data-slot":"select-value",...t})}function ze({className:t,size:o="default",children:s,...i}){return e.jsxs(Bs,{"data-slot":"select-trigger","data-size":o,className:T("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...i,children:[s,e.jsx(Hs,{asChild:!0,children:e.jsx(at,{className:"size-4 opacity-50"})})]})}function He({className:t,children:o,position:s="popper",...i}){return e.jsx(Us,{children:e.jsxs(Ws,{"data-slot":"select-content",className:T("bg-popover text-popover-foreground 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 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 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",s==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:s,...i,children:[e.jsx(Qs,{}),e.jsx(Ks,{className:T("p-1",s==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:o}),e.jsx(Js,{})]})})}function Ue({className:t,children:o,...s}){return e.jsxs(qs,{"data-slot":"select-item",className:T("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",t),...s,children:[e.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:e.jsx(Ys,{children:e.jsx(Mo,{className:"size-4"})})}),e.jsx(Gs,{children:o})]})}function Qs({className:t,...o}){return e.jsx(Xs,{"data-slot":"select-scroll-up-button",className:T("flex cursor-default items-center justify-center py-1",t),...o,children:e.jsx(Ho,{className:"size-4"})})}function Js({className:t,...o}){return e.jsx(Zs,{"data-slot":"select-scroll-down-button",className:T("flex cursor-default items-center justify-center py-1",t),...o,children:e.jsx(at,{className:"size-4"})})}function en({hasUnsavedChanges:t,title:o="Unsaved Changes",description:s="You have unsaved changes. Are you sure you want to leave this page? Your changes will be lost.",stayButtonText:i="Stay on Page",leaveButtonText:c="Leave Page"}){const p=eo(({currentLocation:w,nextLocation:b})=>t&&w.pathname!==b.pathname),[n,d]=l.useState(!1),h=()=>{p.state==="blocked"&&p.proceed()},f=()=>{p.state==="blocked"&&p.reset()};return l.useEffect(()=>{d(p.state==="blocked")},[p.state,n]),l.useEffect(()=>{const w=b=>{t&&(b.preventDefault(),b.returnValue="")};return t&&window.addEventListener("beforeunload",w),()=>{window.removeEventListener("beforeunload",w)}},[t]),e.jsx(St,{open:n,onOpenChange:d,children:e.jsxs(Ct,{children:[e.jsxs(wt,{children:[e.jsx(bt,{children:o}),e.jsx(jt,{children:s})]}),e.jsxs(yt,{children:[e.jsx(It,{onClick:f,children:i}),e.jsx(Nt,{onClick:h,children:c})]})]})})}const tn=({field:t,value:o,resolvedChoices:s,key:i,hasMinMax:c})=>{const p=t.value?String(t.value).split(",").map(n=>n.trim()).filter(Boolean):[];return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("div",{className:"flex flex-wrap gap-2 min-h-[38px] p-2 border rounded-md bg-background",children:p.length>0?p.map(n=>e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 rounded-md text-sm font-medium bg-gray-100 text-black-800",children:[n,e.jsxs("button",{type:"button",onClick:()=>{const d=p.filter(h=>h!==n);t.onChange(d.join(","))},className:"hover:bg-gray-200 rounded-sm p-0.5",children:[e.jsx(Me,{size:14}),e.jsxs("span",{className:"sr-only",children:["Remove ",n]})]})]},n)):e.jsx("span",{className:"text-muted-foreground text-sm",children:o.placeholder??"Select items..."})}),(!o.maxSelectedChoices||p.length<o.maxSelectedChoices)&&e.jsxs(Fe,{value:"",onValueChange:n=>{const d=p;d.includes(n)||t.onChange([...d,n].join(","))},children:[e.jsx(ze,{id:i,className:"w-full",children:e.jsx(Be,{placeholder:"Add item..."})}),e.jsx(He,{children:s.filter(n=>!p.includes(n)).map(n=>e.jsx(Ue,{value:n,children:n},n))})]}),c&&e.jsxs("span",{className:T("text-xs",o.minSelectedChoices&&p.length<o.minSelectedChoices?"text-destructive":"text-muted-foreground"),children:[p.length,o.minSelectedChoices&&o.maxSelectedChoices?`/${o.maxSelectedChoices} (min ${o.minSelectedChoices})`:o.minSelectedChoices?` selected (min ${o.minSelectedChoices})`:`/${o.maxSelectedChoices} selected`]})]})},on=$.lazy(()=>me(()=>import("./FilePicker-DGseBDOZ.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]))),sn=$.lazy(()=>me(()=>import("./markdownEditor-Bsc2Tnws.js"),__vite__mapDeps([17,1,18,2,5,19,20,7,21,12,9,22,23,24,14,6,15,11,25,4,13,26,27]))),nn=$.lazy(()=>me(()=>import("./date-picker-6Pg8PIj8.js"),__vite__mapDeps([28,1,14,7,2,29,9,30,11,23,20,5,19,13,31]))),rn=$.lazy(()=>me(()=>import("./datetime-picker-XkOBOVOZ.js"),__vite__mapDeps([32,1,14,7,2,29,9,30,11,23,20,5,19,13,15,31]))),an=$.lazy(()=>me(()=>import("./URLInput-ATIRZflA.js"),__vite__mapDeps([33,1,15,2,16,9]))),ln=$.lazy(()=>me(()=>import("./ColorPicker-kqchGTe4.js"),__vite__mapDeps([34,1])));function En({itemType:t,fields:o,isSingleton:s,data:i,productionData:c,isNew:p,changedFields:n=[],itemStatus:d}){const h=to(),{hash:f}=oo(),[w]=No(),[b]=Io(),{data:N}=_o(),[E,_]=l.useState(!1),[x,S]=l.useState(null),[j,g]=l.useState(null),C=r=>n.includes(r);l.useEffect(()=>{if(!f)return;const r=f.slice(1),a=document.getElementById(r);a&&(window.scrollTo({top:window.scrollY,behavior:"smooth"}),a.focus())},[f]);const A=l.useMemo(()=>({id:s?"default":i?.id??"",isDraft:String(i?.isDraft??!1),...Object.fromEntries(Object.keys(o).map(r=>{const a=o[r].type,m=i?.[r];return m!=null?a==="boolean"?[r,String(m)]:a==="multiselect"?[r,Array.isArray(m)?m:[m]]:[r,String(m)]:a==="boolean"?[r,"false"]:a==="multiselect"?[r,[]]:[r,""]}))}),[i,o,s]),V=l.useMemo(()=>{const r={id:G().min(1,"ID is required").regex(/^[a-z0-9-]+$/,"ID can only include lowercase letters and numbers"),isDraft:G()};return Object.entries(o).forEach(([a,m])=>{let u;switch(m.type){case"boolean":u=Ze(["true","false"]);break;case"number":u=$o();break;case"url":u=ko("Must be a valid URL");break;case"date":u=G();break;case"datetime":u=G();break;case"color":u=Oo;break;case"select":Ae(m.choicesFixed)?u=G():m.choicesFixed&&m.choicesFixed.length>0?u=Ze(m.choicesFixed):u=G();break;case"multiselect":u=Bo(G()),m.minSelectedChoices&&(u=u.min(m.minSelectedChoices,`${m.displayName} requires at least ${m.minSelectedChoices} selection${m.minSelectedChoices>1?"s":""}`)),m.maxSelectedChoices&&(u=u.max(m.maxSelectedChoices,`${m.displayName} allows maximum ${m.maxSelectedChoices} selection${m.maxSelectedChoices>1?"s":""}`));break;case"string":m.isMultiple?Ae(m.choicesFixed)?u=G():m.choicesFixed&&m.choicesFixed.length>0?u=G():u=G():u=G();break;default:u=G()}m.optional?m.type==="multiselect"?m.minSelectedChoices||(u=u.optional()):u=u.optional().or(Vo("")):m.type==="multiselect"&&!m.minSelectedChoices?u=u.min(1,`${m.displayName} requires at least one selection`):m.type!=="boolean"&&m.type!=="select"&&!(m.type==="string"&&m.isMultiple&&m.choicesFixed)&&(u=u.min(1,`${m.displayName} is required`)),r[a]=u}),Fo(r)},[o]),v=To({resolver:Ao(V),defaultValues:A});l.useEffect(()=>{v.reset(A)},[A,v]),l.useEffect(()=>{if(!v)return;const r=window.location.hash;r&&v.setFocus(r.substring(1))},[v]);const P=$.useCallback(r=>{if(!c){ie.error("Production values are not available.");return}const a=c[r];v.setValue(r,a,{shouldDirty:!0,shouldTouch:!0,shouldValidate:!0}),v.trigger(r),ie.success(`Restored "${o[r]?.displayName??r}" to published value.`)},[c,v,o]),W=$.useCallback(()=>{if(!c){ie.error("Production values are not available.");return}n.length&&(n.forEach(r=>{const a=c[r];v.setValue(r,a,{shouldDirty:!0,shouldTouch:!0,shouldValidate:!0})}),ie.success("Restored modified fields to published values."))},[c,n,v]),ee=$.useCallback(r=>{g(r),S("single"),_(!0)},[]),te=$.useCallback(()=>{g(null),S("all"),_(!0)},[]),Y=$.useCallback(()=>{x==="single"&&j?P(j):x==="all"&&W(),_(!1),S(null),g(null),z(v.getValues(),!1)},[x,j,P,W]);async function z(r,a=!0){const m={...r,isDraft:r.isDraft==="true",type:t};Object.entries(o).forEach(([u,F])=>{F.type==="boolean"&&(m[u]=r[u]==="true")});try{if(p||s&&!i){const B=await w(m).unwrap();a&&ie.success("Item created successfully."),h(`/admin/dashboard/${t}/${B.id}`);return}const u=i?.id,F=m.id,Q=u!==F;if(!u)return;const I=await b({...m,id:u,type:t,newId:Q?F:void 0}).unwrap();if(a&&ie.success("Item updated successfully."),Q){h(`/admin/dashboard/${t}/${I.id}`);return}v.reset(r)}catch(u){u.status===409&&v.setError("id",{type:"manual",message:"An item with this ID already exists."}),ie.error(p?"Failed to create item.":"Failed to update item."),console.error(u)}}l.useEffect(()=>{const r=a=>{(a.ctrlKey||a.metaKey)&&a.key==="s"&&(a.preventDefault(),(v.formState.isDirty||p)&&v.handleSubmit(m=>z(m))())};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[v,p,z]);const X=l.useMemo(()=>Object.entries(o).filter(([,r])=>r.type==="boolean"),[o]),Z=l.useMemo(()=>{const r={};return Object.entries(o).forEach(([a,m])=>{if(m.type==="select"||m.type==="multiselect"||m.type==="string"&&m.isMultiple&&m.choicesFixed){const u=Ae(m.choicesFixed);if(u&&N){const F=N[u];F?r[a]=Object.values(F).map(Q=>Q.id):r[a]=[]}else r[a]=m.choicesFixed||[]}}),r},[o,N]),H="outline outline-1 outline-yellow-400 outline-offset-4 rounded-sm",M=({fieldKey:r})=>e.jsxs("span",{className:"inline-flex items-center gap-1 text-yellow-800 text-xs",children:["(modified)",e.jsxs(ve,{type:"button",variant:"ghost",size:"icon",className:"h-4 w-4",onClick:()=>ee(r),title:"Restore published value",children:[e.jsx(Qe,{size:12,className:"text-black"}),e.jsxs("span",{className:"sr-only",children:["Restore ",r," to production"]})]})]});return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center gap-4 mb-4",children:[i&&i.updatedAt&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Last updated:"}),e.jsx("p",{className:"text-sm",children:new Date(i.updatedAt).toLocaleString()})]}),d&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Unpublished status:"}),e.jsx(Ro,{className:T("capitalize",Eo[d]),children:d}),n.length>0&&e.jsxs(ve,{type:"button",variant:"ghost",size:"icon",className:"h-6 w-6",onClick:te,title:"Restore all fields to published values",children:[e.jsx(Qe,{size:14}),e.jsx("span",{className:"sr-only",children:"Restore all modified fields to published values"})]})]})]}),e.jsxs(Po,{...v,children:[e.jsxs("form",{onSubmit:v.handleSubmit(r=>z(r)),className:"space-y-4 max-w-[800px] w-[800px]",children:[e.jsx(Se,{name:"id",control:v.control,rules:{required:!0},render:({field:r})=>e.jsxs(Ce,{id:"id",className:T((i?.id==="default"||s)&&"hidden",C("id")&&H),children:[e.jsxs(xe,{className:"flex gap-1 items-baseline",children:["ID",C("id")&&e.jsx(M,{fieldKey:"id"})]}),e.jsx(we,{children:e.jsx(Te,{placeholder:"item-id",...v.register("id"),...r,value:r.value,onChange:a=>{const m=a.target.value.toLowerCase().replace(/\s+/g,"-").replace(/-+/g,"-").replace(/[^a-z0-9-]/g,"");r.onChange(m)},onBlur:a=>{const m=a.target.value.trim().replace(/^-+|-+$/g,"");r.onChange(m)}})}),e.jsx(ye,{})]})}),e.jsx(Se,{name:"isDraft",control:v.control,render:({field:r})=>e.jsxs(Ce,{id:"isDraft",className:T("flex flex-col items-start",(i?.id==="default"||s)&&"hidden",C("isDraft")&&H),children:[e.jsxs("div",{className:"flex flex-row space-x-2",children:[e.jsx(we,{children:e.jsx(Xe,{id:"isDraft",...v.register("isDraft"),checked:r.value==="true",onCheckedChange:a=>{r.onChange(a===!0?"true":"false")}})}),e.jsxs(xe,{className:"flex gap-1 items-baseline",children:["Draft",C("isDraft")&&e.jsx("span",{className:"text-yellow-600 text-xs",children:e.jsx(M,{fieldKey:"isDraft"})})]})]}),e.jsx(De,{children:"Draft items are not visible on the published site"}),e.jsx(ye,{})]})}),X.length>0&&e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx(xe,{children:"Flags"}),e.jsx("div",{className:"flex flex-row flex-wrap gap-4",children:X.map(([r,a])=>e.jsx(Se,{name:r,control:v.control,render:({field:m})=>e.jsxs(Ce,{className:T("flex flex-col items-start",C(r)&&H),children:[e.jsxs("div",{className:"flex flex-row space-x-2",children:[e.jsx(we,{children:e.jsx(Xe,{id:r,...v.register(r),checked:m.value==="true",onCheckedChange:u=>{m.onChange(u===!0?"true":"false")}})}),e.jsxs(xe,{className:"flex gap-1 items-baseline",children:[a.displayName,C(r)&&e.jsx("span",{className:"text-yellow-800 text-xs",children:e.jsx(M,{fieldKey:r})})]})]}),a.displayExtra&&e.jsx(De,{children:a.displayExtra}),e.jsx(ye,{})]})},r))})]}),Object.entries(o).filter(([,r])=>r.type!=="boolean").map(([r,a])=>{const m=Z[r]??[];return e.jsx(Se,{name:r,control:v.control,rules:{required:!a.optional},render:({field:u})=>{const F=u.value?.length??0,Q=(a.type==="multiselect"||a.type==="string"&&a.isMultiple&&a.choicesFixed)&&(a.minSelectedChoices||a.maxSelectedChoices);return e.jsxs(Ce,{id:r,className:T(C(r)&&H),children:[e.jsxs(xe,{className:"flex gap-1 items-baseline",children:[a.displayName,a.optional&&e.jsx("span",{className:"text-gray-400",children:"(optional)"}),C(r)&&e.jsx("span",{className:"text-yellow-600 text-xs",children:e.jsx(M,{fieldKey:r})})]}),e.jsx(we,{children:a.type==="markdown"?e.jsx(sn,{id:r,name:r,register:v.register,className:"h-52",markdown:u.value,onChange:(I,B)=>{B||u.onChange(I)},placeholder:a.placeholder,fieldDisplayName:a.displayName}):a.type==="url"?e.jsx(an,{id:r,...v.register(r),placeholder:a.placeholder??"https://example.website/",...u,value:u.value}):a.type==="string"&&a.isUploadedFile?e.jsx(on,{id:r,name:r,register:v.register,value:u.value,onChange:u.onChange}):a.type==="date"?e.jsx(nn,{id:r,...v.register(r),date:u.value?new Date(u.value):void 0,onDateChange:I=>{u.onChange(I?I.toISOString():"")},placeholder:a.placeholder??"Select date",allowClear:a.optional}):a.type==="datetime"?e.jsx("div",{className:"relative",children:e.jsx(rn,{id:r,...v.register(r),date:u.value?new Date(u.value):void 0,onDateTimeChange:I=>{u.onChange(I?I.toISOString():"")},placeholder:a.placeholder??"Select date and time",allowClear:a.optional})}):a.type==="color"?e.jsx(ln,{id:r,value:u.value,onChange:u.onChange,placeholder:a.placeholder}):a.type==="number"?e.jsx(Te,{id:r,...v.register(r,{valueAsNumber:!0}),type:"number",value:u.value,onChange:u.onChange,placeholder:a.placeholder}):a.type==="select"?e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(Fe,{value:u.value,onValueChange:u.onChange,children:[e.jsx(ze,{id:r,className:"w-full",children:e.jsx(Be,{placeholder:a.placeholder??"Select an item..."})}),e.jsx(He,{children:m.map(I=>e.jsx(Ue,{value:I,children:I},I))})]}),a.optional&&u.value&&e.jsxs(ve,{type:"button",variant:"outline",size:"icon",onClick:()=>u.onChange(""),className:"shrink-0",children:[e.jsx(Me,{size:16}),e.jsx("span",{className:"sr-only",children:"Clear selection"})]})]}):a.type==="multiselect"?e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("div",{className:"flex flex-wrap gap-2 min-h-[38px] p-2 border rounded-md bg-background",children:u.value?.length>0?u.value.map(I=>e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 rounded-md text-sm font-medium bg-gray-100 text-black-800",children:[I,e.jsxs("button",{type:"button",onClick:()=>{const B=u.value.filter(ue=>ue!==I);u.onChange(B)},className:"hover:bg-gray-200 rounded-sm p-0.5",children:[e.jsx(Me,{size:14}),e.jsxs("span",{className:"sr-only",children:["Remove ",I]})]})]},I)):e.jsx("span",{className:"text-muted-foreground text-sm",children:a.placeholder??"Select items..."})}),(!a.maxSelectedChoices||F<a.maxSelectedChoices)&&e.jsxs(Fe,{value:"",onValueChange:I=>{const B=u.value||[];B.includes(I)||u.onChange([...B,I])},children:[e.jsx(ze,{id:r,className:"w-full",children:e.jsx(Be,{placeholder:"Add item..."})}),e.jsx(He,{children:m.filter(I=>!u.value?.includes(I)).map(I=>e.jsx(Ue,{value:I,children:I},I))})]}),Q&&e.jsxs("span",{className:T("text-xs",a.minSelectedChoices&&F<a.minSelectedChoices?"text-destructive":"text-muted-foreground"),children:[F,a.minSelectedChoices&&a.maxSelectedChoices?`/${a.maxSelectedChoices} (min ${a.minSelectedChoices})`:a.minSelectedChoices?` selected (min ${a.minSelectedChoices})`:`/${a.maxSelectedChoices} selected`]})]}):a.type==="string"&&a.isMultiple&&a.choicesFixed?e.jsx(tn,{field:u,resolvedChoices:m,value:a,hasMinMax:Q},r):e.jsx(Te,{id:r,...v.register(r),placeholder:a.placeholder,...u,value:u.value})}),a.displayExtra&&e.jsx(De,{children:a.displayExtra}),e.jsx(ye,{})]})}},r)}),e.jsxs(ve,{disabled:!v.formState.isDirty&&!p||v.formState.isSubmitting,type:"submit",children:[v.formState.isSubmitting?e.jsx(Lo,{className:"animate-spin"}):e.jsx(Ko,{}),v.formState.isSubmitting?"Saving":v.watch("isDraft")==="true"?"Save Draft":"Save"]})]}),e.jsx(en,{hasUnsavedChanges:!v.formState.isSubmitting&&v.formState.isDirty})]}),e.jsx(St,{open:E,onOpenChange:_,children:e.jsxs(Ct,{children:[e.jsxs(wt,{children:[e.jsx(bt,{children:x==="all"?"Restore all modified fields?":"Restore this field?"}),e.jsx(jt,{children:x==="all"?`This will restore ${n.length} modified ${n.length===1?"field":"fields"} to published values.`:`This will restore "${j?o[j]?.displayName??j:"field"}" to its published value.`})]}),e.jsxs(yt,{children:[e.jsx(It,{children:"Cancel"}),e.jsx(Nt,{onClick:Y,children:"Restore"})]})]})})]})}export{Ws as C,En as I,Us as P,Fs as R,_n as S,Bs as T,zs as V,Hs as a,Ks as b,fs as c,qs as d,Gs as e,gs as u};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
window.__reactRouterManifest={"entry":{"module":"/assets/entry.client-C94uvdU2.js","imports":["/assets/chunk-EPOLDU6W-CiSVlmCe.js","/assets/index-DLIEpuwL.js"],"css":[]},"routes":{"root":{"id":"root","path":"","hasAction":false,"hasLoader":false,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasErrorBoundary":true,"module":"/assets/root-dzmn7V-J.js","imports":["/assets/chunk-EPOLDU6W-CiSVlmCe.js","/assets/index-DLIEpuwL.js","/assets/index-CZSVchcX.js","/assets/loader-circle-BDUbeTTe.js","/assets/createLucideIcon-BvSqmaUO.js","/assets/circle-check-C6CxUIig.js","/assets/utils-B48p8Qal.js","/assets/authSlice-DWtXmmFR.js","/assets/Loading-C1QGFwZC.js"],"css":["/assets/root-DZYAU5bq.css"]},"routes/home":{"id":"routes/home","parentId":"root","path":"/admin","index":true,"hasAction":false,"hasLoader":false,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasErrorBoundary":false,"module":"/assets/home-BsBPywQn.js","imports":["/assets/chunk-EPOLDU6W-CiSVlmCe.js","/assets/Loading-C1QGFwZC.js","/assets/button-BEFuP7Ru.js","/assets/zod-DU3Qlmru.js","/assets/input-C3iFdiD8.js","/assets/authSlice-DWtXmmFR.js","/assets/schemas-CPJfa6mm.js","/assets/utils-B48p8Qal.js","/assets/loader-circle-BDUbeTTe.js","/assets/createLucideIcon-BvSqmaUO.js","/assets/index-CbaefyjV.js","/assets/index-B5ynPIRP.js","/assets/index-DLIEpuwL.js","/assets/check-DF0ucE8d.js"],"css":[]},"routes/dashboard._layout":{"id":"routes/dashboard._layout","parentId":"root","hasAction":false,"hasLoader":false,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasErrorBoundary":false,"module":"/assets/dashboard._layout-
|
|
1
|
+
window.__reactRouterManifest={"entry":{"module":"/assets/entry.client-C94uvdU2.js","imports":["/assets/chunk-EPOLDU6W-CiSVlmCe.js","/assets/index-DLIEpuwL.js"],"css":[]},"routes":{"root":{"id":"root","path":"","hasAction":false,"hasLoader":false,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasErrorBoundary":true,"module":"/assets/root-dzmn7V-J.js","imports":["/assets/chunk-EPOLDU6W-CiSVlmCe.js","/assets/index-DLIEpuwL.js","/assets/index-CZSVchcX.js","/assets/loader-circle-BDUbeTTe.js","/assets/createLucideIcon-BvSqmaUO.js","/assets/circle-check-C6CxUIig.js","/assets/utils-B48p8Qal.js","/assets/authSlice-DWtXmmFR.js","/assets/Loading-C1QGFwZC.js"],"css":["/assets/root-DZYAU5bq.css"]},"routes/home":{"id":"routes/home","parentId":"root","path":"/admin","index":true,"hasAction":false,"hasLoader":false,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasErrorBoundary":false,"module":"/assets/home-BsBPywQn.js","imports":["/assets/chunk-EPOLDU6W-CiSVlmCe.js","/assets/Loading-C1QGFwZC.js","/assets/button-BEFuP7Ru.js","/assets/zod-DU3Qlmru.js","/assets/input-C3iFdiD8.js","/assets/authSlice-DWtXmmFR.js","/assets/schemas-CPJfa6mm.js","/assets/utils-B48p8Qal.js","/assets/loader-circle-BDUbeTTe.js","/assets/createLucideIcon-BvSqmaUO.js","/assets/index-CbaefyjV.js","/assets/index-B5ynPIRP.js","/assets/index-DLIEpuwL.js","/assets/check-DF0ucE8d.js"],"css":[]},"routes/dashboard._layout":{"id":"routes/dashboard._layout","parentId":"root","hasAction":false,"hasLoader":false,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasErrorBoundary":false,"module":"/assets/dashboard._layout-C2hFrHKC.js","imports":["/assets/chunk-EPOLDU6W-CiSVlmCe.js","/assets/authSlice-DWtXmmFR.js","/assets/utils-B48p8Qal.js","/assets/index-CZSVchcX.js","/assets/index-DutSppa2.js","/assets/x-D6gZWaAR.js","/assets/button-BEFuP7Ru.js","/assets/createLucideIcon-BvSqmaUO.js","/assets/index-CbaefyjV.js","/assets/index-B5ynPIRP.js","/assets/index-CU6_POhE.js","/assets/chevron-down-qxzqwz13.js","/assets/loader-circle-BDUbeTTe.js","/assets/arrow-up-C0I0e1Jt.js","/assets/upload-DhJ5wU_H.js","/assets/external-link-ERgO2SVI.js","/assets/Loading-C1QGFwZC.js","/assets/chevron-right-BFlMu-RJ.js","/assets/index-DLIEpuwL.js"],"css":[]},"routes/dashboard":{"id":"routes/dashboard","parentId":"routes/dashboard._layout","path":"/admin/dashboard","hasAction":false,"hasLoader":false,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasErrorBoundary":false,"module":"/assets/dashboard-CXsgx-dc.js","imports":["/assets/chunk-EPOLDU6W-CiSVlmCe.js","/assets/utils-B48p8Qal.js","/assets/index-Cgk-ojIv.js","/assets/badge-DTudhbGs.js","/assets/schemas-D-U8dKAF.js","/assets/index-CbaefyjV.js","/assets/schemas-CPJfa6mm.js"],"css":[]},"routes/dashboard.$collection.new":{"id":"routes/dashboard.$collection.new","parentId":"routes/dashboard._layout","path":"/admin/dashboard/:collectionId/new","hasAction":false,"hasLoader":false,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasErrorBoundary":false,"module":"/assets/dashboard._collection.new-DTz85TYy.js","imports":["/assets/chunk-EPOLDU6W-CiSVlmCe.js","/assets/itemForm-gnC2gvRO.js","/assets/utils-B48p8Qal.js","/assets/index-B5ynPIRP.js","/assets/index-CbaefyjV.js","/assets/index-DLIEpuwL.js","/assets/index-DutSppa2.js","/assets/button-BEFuP7Ru.js","/assets/badge-DTudhbGs.js","/assets/zod-DU3Qlmru.js","/assets/check-DF0ucE8d.js","/assets/createLucideIcon-BvSqmaUO.js","/assets/schemas-CPJfa6mm.js","/assets/input-C3iFdiD8.js","/assets/chevron-down-qxzqwz13.js","/assets/schemas-D-U8dKAF.js","/assets/index-CZSVchcX.js","/assets/x-D6gZWaAR.js","/assets/loader-circle-BDUbeTTe.js"],"css":[]},"routes/dashboard.$collection":{"id":"routes/dashboard.$collection","parentId":"routes/dashboard._layout","path":"/admin/dashboard/:collectionId","hasAction":false,"hasLoader":false,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasErrorBoundary":false,"module":"/assets/dashboard._collection-BJjjgsuR.js","imports":["/assets/chunk-EPOLDU6W-CiSVlmCe.js","/assets/button-BEFuP7Ru.js","/assets/utils-B48p8Qal.js","/assets/input-C3iFdiD8.js","/assets/index-Cgk-ojIv.js","/assets/createLucideIcon-BvSqmaUO.js","/assets/calendar-Frbsxn98.js","/assets/trash-UKLAaALv.js","/assets/check-DF0ucE8d.js","/assets/x-D6gZWaAR.js","/assets/external-link-ERgO2SVI.js","/assets/circle-check-C6CxUIig.js","/assets/arrow-up-C0I0e1Jt.js","/assets/index-CbaefyjV.js"],"css":[]},"routes/dashboard.$collection.$document":{"id":"routes/dashboard.$collection.$document","parentId":"routes/dashboard._layout","path":"/admin/dashboard/:collectionId/:documentId","hasAction":false,"hasLoader":false,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasErrorBoundary":false,"module":"/assets/dashboard._collection._document-D7Z2p9AV.js","imports":["/assets/chunk-EPOLDU6W-CiSVlmCe.js","/assets/itemForm-gnC2gvRO.js","/assets/utils-B48p8Qal.js","/assets/index-B5ynPIRP.js","/assets/index-CbaefyjV.js","/assets/index-DLIEpuwL.js","/assets/index-DutSppa2.js","/assets/button-BEFuP7Ru.js","/assets/badge-DTudhbGs.js","/assets/zod-DU3Qlmru.js","/assets/check-DF0ucE8d.js","/assets/createLucideIcon-BvSqmaUO.js","/assets/schemas-CPJfa6mm.js","/assets/input-C3iFdiD8.js","/assets/chevron-down-qxzqwz13.js","/assets/schemas-D-U8dKAF.js","/assets/index-CZSVchcX.js","/assets/x-D6gZWaAR.js","/assets/loader-circle-BDUbeTTe.js"],"css":[]},"routes/dashboard.files":{"id":"routes/dashboard.files","parentId":"routes/dashboard._layout","path":"/admin/dashboard/files","hasAction":false,"hasLoader":false,"hasClientAction":false,"hasClientLoader":false,"hasClientMiddleware":false,"hasErrorBoundary":false,"module":"/assets/dashboard.files-wgFLZCcb.js","imports":["/assets/chunk-EPOLDU6W-CiSVlmCe.js","/assets/files-BTW5qTjQ.js","/assets/utils-B48p8Qal.js","/assets/index-CZSVchcX.js","/assets/index-DLIEpuwL.js","/assets/badge-DTudhbGs.js","/assets/index-CbaefyjV.js","/assets/upload-DhJ5wU_H.js","/assets/createLucideIcon-BvSqmaUO.js","/assets/trash-UKLAaALv.js","/assets/chevron-down-qxzqwz13.js","/assets/check-DF0ucE8d.js","/assets/x-D6gZWaAR.js"],"css":[]}},"url":"/assets/manifest-239e9170.js","version":"239e9170"};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as R,R as C,p as G,C as nw,D as u0}from"./chunk-EPOLDU6W-CiSVlmCe.js";import{c as a9,e as c9}from"./authSlice-DWtXmmFR.js";import{_ as h0,D as u9,b as uc}from"./utils-B48p8Qal.js";import{a as fp}from"./index-DLIEpuwL.js";import{u as h9,g as f9,R as d9,P as p9,O as g9,C as m9,T as O9,a as x9}from"./index-DutSppa2.js";import{i as b9,u as rw}from"./zod-DU3Qlmru.js";import{R as y9,A as k9,P as S9,C as w9,a as v9}from"./index-nnJosT4e.js";import{P as iw,R as sw,T as ow,a as lw,C as aw,A as C9}from"./index-CU6_POhE.js";import{c as Pm,a as ri,b as vi,u as Rh}from"./index-B5ynPIRP.js";import{c as T9,u as Qm,R as _9,S as P9,T as Q9,V as $9,a as E9,P as A9,C as M9,b as L9,d as I9,e as R9}from"./itemForm-BLyILW73.js";import{u as N9}from"./index-CbaefyjV.js";import{c as cw}from"./createLucideIcon-BvSqmaUO.js";import"./check-DF0ucE8d.js";import"./schemas-CPJfa6mm.js";import"./button-BEFuP7Ru.js";import"./badge-DTudhbGs.js";import"./input-C3iFdiD8.js";import"./chevron-down-qxzqwz13.js";import"./schemas-D-U8dKAF.js";import"./index-CZSVchcX.js";import"./x-D6gZWaAR.js";import"./loader-circle-BDUbeTTe.js";const D9=[["path",{d:"m15 15 6 6",key:"1s409w"}],["path",{d:"m15 9 6-6",key:"ko1vev"}],["path",{d:"M21 16.2V21h-4.8",key:"1hrera"}],["path",{d:"M21 7.8V3h-4.8",key:"ul1q53"}],["path",{d:"M3 16.2V21h4.8",key:"1x04uo"}],["path",{d:"m3 21 6-6",key:"wwnumi"}],["path",{d:"M3 7.8V3h4.8",key:"1ijppm"}],["path",{d:"M9 9 3 3",key:"v551iv"}]],Z9=cw("expand",D9);const B9=[["path",{d:"m15 15 6 6m-6-6v4.8m0-4.8h4.8",key:"17vawe"}],["path",{d:"M9 19.8V15m0 0H4.2M9 15l-6 6",key:"chjx8e"}],["path",{d:"M15 4.2V9m0 0h4.8M15 9l6-6",key:"lav6yq"}],["path",{d:"M9 4.2V9m0 0H4.2M9 9 3 3",key:"1pxi2q"}]],z9=cw("shrink",B9);var V9=Object.defineProperty,F9=(n,e,t)=>e in n?V9(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,qr=(n,e,t)=>F9(n,typeof e!="symbol"?e+"":e,t);let X9=class uw{constructor(e=new Map){this.map=e}clone(){return new uw(new Map(this.map))}increment(e){const t=this.map.get(e)??0;this.map.set(e,t+1)}decrement(e,t){let r=this.map.get(e);r!==void 0&&(r-=1,this.map.set(e,r),r===0&&t())}},hc=class{constructor(){qr(this,"map",new Map)}getOrCreate(e){let t=this.map.get(e);return t===void 0&&(t=new Set,this.map.set(e,t)),t}get(e){return this.map.get(e)}use(e,t){const r=this.get(e);r!==void 0&&t(r)}delete(e){return this.map.delete(e)}};function qs(n,e){return e(n),n}function $m(){}const hw="cell";function f0(n,e){return n===e}const Nh=new Map;let W9=class{constructor(e={}){qr(this,"subscriptions",new hc),qr(this,"singletonSubscriptions",new Map),qr(this,"graph",new hc),qr(this,"state",new Map),qr(this,"distinctNodes",new Map),qr(this,"executionMaps",new Map),qr(this,"definitionRegistry",new Set),qr(this,"combinedCells",[]);for(const t of Object.getOwnPropertySymbols(e))this.state.set(t,e[t])}cellInstance(e,t=!0,r=Symbol()){return this.state.has(r)||this.state.set(r,e),t!==!1&&!this.distinctNodes.has(r)&&this.distinctNodes.set(r,t===!0?f0:t),r}signalInstance(e=!0,t=Symbol()){return e!==!1&&this.distinctNodes.set(t,e===!0?f0:e),t}sub(e,t){this.register(e);const r=this.subscriptions.getOrCreate(e);return r.add(t),()=>r.delete(t)}singletonSub(e,t){return this.register(e),t===void 0?this.singletonSubscriptions.delete(e):this.singletonSubscriptions.set(e,t),()=>this.singletonSubscriptions.delete(e)}resetSingletonSubs(){this.singletonSubscriptions.clear()}subMultiple(e,t){const r=this.signalInstance();return this.connect({map:i=>(...s)=>{i(s)},sink:r,sources:e}),this.sub(r,t)}pubIn(e){var t;const r=Reflect.ownKeys(e),i=this.getExecutionMap(r),s=i.refCount.clone(),o=i.participatingNodes.slice(),l=new Map(this.state),a=c=>{this.graph.use(c,u=>{for(const{sources:h,sink:f}of u)h.has(c)&&s.decrement(f,()=>{o.splice(o.indexOf(f),1),a(f)})})};for(;;){const c=o.shift();if(c===void 0)break;const u=c;let h=!1;const f=d=>{const p=this.distinctNodes.get(u);if(p!=null&&p(l.get(u),d)){h=!1;return}h=!0,l.set(u,d),this.state.has(u)&&this.state.set(u,d)};if(Object.prototype.hasOwnProperty.call(e,u)?f(e[u]):i.projections.use(u,d=>{for(const p of d){const g=[...Array.from(p.sources),...Array.from(p.pulls)].map(m=>l.get(m));p.map(f)(...g)}}),h){const d=l.get(u);this.inContext(()=>{this.subscriptions.use(u,p=>{for(const g of p)g(d)})}),(t=this.singletonSubscriptions.get(u))==null||t(d)}else a(u)}}connect({sources:e,pulls:t=[],map:r,sink:i}){const s={map:r,pulls:new Set(t),sink:this.register(i),sources:new Set(e)};for(const o of[...e,...t])this.register(o),this.graph.getOrCreate(o).add(s);this.executionMaps.clear()}pub(e,t){this.pubIn({[e]:t})}pipe(e,...t){return this.combineOperators(...t)(e)}transformer(...e){return t=>qs(this.signalInstance(),r=>(this.link(this.pipe(r,...e),t),r))}link(e,t){this.connect({map:r=>i=>{r(i)},sink:t,sources:[e]})}combine(...e){return qs(this.signalInstance(),t=>{this.connect({map:r=>(...i)=>{r(i)},sink:t,sources:e})})}combineCells(...e){const t=this.combinedCells.find(i=>e.length===i.sources.length&&e.every((s,o)=>s===i.sources[o]));if(t)return t.cell;const r=this.cellInstance(e.map(i=>this.getValue(i)),!0);return this.connect({map:i=>(...s)=>{i(s)},sink:r,sources:e}),this.combinedCells.push({sources:e,cell:r}),r}getValue(e){return this.register(e),this.state.get(e)}getValues(e){return e.map(t=>this.getValue(t))}register(e){const t=Nh.get(e);return t===void 0||this.definitionRegistry.has(e)?e:(this.definitionRegistry.add(e),qs(t.type===hw?this.cellInstance(t.initial,t.distinct,e):this.signalInstance(t.distinct,e),r=>{this.inContext(()=>{t.init(this,r)})}))}inContext(e){return e()}changeWith(e,t,r){this.connect({sources:[t],pulls:[e],sink:e,map:i=>(s,o)=>{i(r(o,s))}})}calculateExecutionMap(e){const t=[],r=new Set,i=new hc,s=new X9,o=new hc,l=(a,c=0)=>{s.increment(a),!r.has(a)&&(this.register(a),i.use(a,u=>{c=Math.max(...Array.from(u).map(h=>t.indexOf(h)))+1}),this.graph.use(a,u=>{for(const h of u)h.sources.has(a)?(o.getOrCreate(h.sink).add(h),l(h.sink,c)):i.getOrCreate(h.sink).add(a)}),r.add(a),t.splice(c,0,a))};return e.forEach(l),{participatingNodes:t,pendingPulls:i,projections:o,refCount:s}}getExecutionMap(e){let t=e;if(e.length===1){t=e[0];const i=this.executionMaps.get(t);if(i!==void 0)return i}else for(const[i,s]of this.executionMaps.entries())if(Array.isArray(i)&&i.length===e.length&&i.every(o=>e.includes(o)))return s;const r=this.calculateExecutionMap(e);return this.executionMaps.set(t,r),r}combineOperators(...e){return t=>{for(const r of e)t=r(t,this);return t}}};function oe(n,e=$m,t=!0){return qs(Symbol(),r=>{Nh.set(r,{type:hw,distinct:t,initial:n,init:e})})}function bt(n=$m,e=!1){return qs(Symbol(),t=>{Nh.set(t,{type:"signal",distinct:e,init:n})})}function Ni(n=$m){return qs(Symbol(),e=>{Nh.set(e,{type:"signal",distinct:!1,init:n})})}const fw=R.createContext(null);function $a(){const n=R.useContext(fw);if(n===null)throw new Error("useRealm must be used within a RealmContextProvider");return n}function nn(n){const e=$a();e.register(n);const t=R.useCallback(r=>e.sub(n,r),[e,n]);return R.useSyncExternalStore(t,()=>e.getValue(n),()=>e.getValue(n))}function Wt(...n){const e=$a(),t=R.useMemo(()=>e.combineCells.apply(e,n),[e,...n]);return nn(t)}function ut(n){const e=$a();return e.register(n),R.useCallback(t=>{e.pub(n,t)},[e,n])}function js(n){return(e,t)=>{const r=t.signalInstance();return t.connect({map:i=>s=>{i(n(s))},sink:r,sources:[e]}),r}}function Je(...n){return(e,t)=>{const r=t.signalInstance();return t.connect({map:i=>(...s)=>{i(s)},pulls:n,sink:r,sources:[e]}),r}}function dw(n){return(e,t)=>{const r=t.signalInstance();return t.connect({map:i=>()=>{i(n)},sink:r,sources:[e]}),r}}function Ea(n){return(e,t)=>{const r=t.signalInstance();return t.connect({map:i=>s=>{n(s)&&i(s)},sink:r,sources:[e]}),r}}function pw(n,e){return(t,r)=>{const i=r.signalInstance();return r.connect({map:s=>o=>{s(e=n(e,o))},sink:i,sources:[t]}),i}}function q9(n,e){return e(n),n}function Ys(){}function Ln(n){return function(e){return{init:t=>{var r;return(r=n.init)==null?void 0:r.call(n,t,e)},postInit:t=>{var r;return(r=n.postInit)==null?void 0:r.call(n,t,e)},update:t=>{var r;return(r=n.update)==null?void 0:r.call(n,t,e)}}}}function j9({children:n,plugins:e}){const t=C.useMemo(()=>q9(new W9,r=>{var i,s;for(const o of e)(i=o.init)==null||i.call(o,r);for(const o of e)(s=o.postInit)==null||s.call(o,r)}),[]);return C.useEffect(()=>{var r;for(const i of e)(r=i.update)==null||r.call(i,t)}),C.createElement(fw.Provider,{value:t},n)}const gw=R.createContext(null);function Y9(n,e){return{getTheme:function(){return e??null}}}function Nt(){const n=R.useContext(gw);return n==null&&(function(e,...t){const r=new URL("https://lexical.dev/docs/error"),i=new URLSearchParams;i.append("code",e);for(const s of t)i.append("v",s);throw r.search=i.toString(),Error(`Minified Lexical error #${e}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)})(8),n}function F(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const i of e)r.append("v",i);throw t.search=r.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const tr=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,H9=tr&&"documentMode"in document?document.documentMode:null,Vn=tr&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),Ci=tr&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),_u=!(!tr||!("InputEvent"in window)||H9)&&"getTargetRanges"in new window.InputEvent("input"),jl=tr&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),co=tr&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,U9=tr&&/Android/.test(navigator.userAgent),mw=tr&&/^(?=.*Chrome).*/i.test(navigator.userAgent),d0=tr&&U9&&mw,Pu=tr&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!mw;function Qu(...n){const e=[];for(const t of n)if(t&&typeof t=="string")for(const[r]of t.matchAll(/\S+/g))e.push(r);return e}const G9=1,K9=3,J9=9,eQ=11,ds=0,Ow=1,uo=2,tQ=0,nQ=1,rQ=2,$u=4,Eu=8,Em=128,iQ=1792|(112|(3|$u|Eu)|Em),Am=1,Mm=2,Lm=3,Im=4,Rm=5,Nm=6,Dh=jl||co||Pu?" ":"",ii=`
|
|
1
|
+
import{a as R,R as C,p as G,C as nw,D as u0}from"./chunk-EPOLDU6W-CiSVlmCe.js";import{c as a9,e as c9}from"./authSlice-DWtXmmFR.js";import{_ as h0,D as u9,b as uc}from"./utils-B48p8Qal.js";import{a as fp}from"./index-DLIEpuwL.js";import{u as h9,g as f9,R as d9,P as p9,O as g9,C as m9,T as O9,a as x9}from"./index-DutSppa2.js";import{i as b9,u as rw}from"./zod-DU3Qlmru.js";import{R as y9,A as k9,P as S9,C as w9,a as v9}from"./index-nnJosT4e.js";import{P as iw,R as sw,T as ow,a as lw,C as aw,A as C9}from"./index-CU6_POhE.js";import{c as Pm,a as ri,b as vi,u as Rh}from"./index-B5ynPIRP.js";import{c as T9,u as Qm,R as _9,S as P9,T as Q9,V as $9,a as E9,P as A9,C as M9,b as L9,d as I9,e as R9}from"./itemForm-gnC2gvRO.js";import{u as N9}from"./index-CbaefyjV.js";import{c as cw}from"./createLucideIcon-BvSqmaUO.js";import"./check-DF0ucE8d.js";import"./schemas-CPJfa6mm.js";import"./button-BEFuP7Ru.js";import"./badge-DTudhbGs.js";import"./input-C3iFdiD8.js";import"./chevron-down-qxzqwz13.js";import"./schemas-D-U8dKAF.js";import"./index-CZSVchcX.js";import"./x-D6gZWaAR.js";import"./loader-circle-BDUbeTTe.js";const D9=[["path",{d:"m15 15 6 6",key:"1s409w"}],["path",{d:"m15 9 6-6",key:"ko1vev"}],["path",{d:"M21 16.2V21h-4.8",key:"1hrera"}],["path",{d:"M21 7.8V3h-4.8",key:"ul1q53"}],["path",{d:"M3 16.2V21h4.8",key:"1x04uo"}],["path",{d:"m3 21 6-6",key:"wwnumi"}],["path",{d:"M3 7.8V3h4.8",key:"1ijppm"}],["path",{d:"M9 9 3 3",key:"v551iv"}]],Z9=cw("expand",D9);const B9=[["path",{d:"m15 15 6 6m-6-6v4.8m0-4.8h4.8",key:"17vawe"}],["path",{d:"M9 19.8V15m0 0H4.2M9 15l-6 6",key:"chjx8e"}],["path",{d:"M15 4.2V9m0 0h4.8M15 9l6-6",key:"lav6yq"}],["path",{d:"M9 4.2V9m0 0H4.2M9 9 3 3",key:"1pxi2q"}]],z9=cw("shrink",B9);var V9=Object.defineProperty,F9=(n,e,t)=>e in n?V9(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,qr=(n,e,t)=>F9(n,typeof e!="symbol"?e+"":e,t);let X9=class uw{constructor(e=new Map){this.map=e}clone(){return new uw(new Map(this.map))}increment(e){const t=this.map.get(e)??0;this.map.set(e,t+1)}decrement(e,t){let r=this.map.get(e);r!==void 0&&(r-=1,this.map.set(e,r),r===0&&t())}},hc=class{constructor(){qr(this,"map",new Map)}getOrCreate(e){let t=this.map.get(e);return t===void 0&&(t=new Set,this.map.set(e,t)),t}get(e){return this.map.get(e)}use(e,t){const r=this.get(e);r!==void 0&&t(r)}delete(e){return this.map.delete(e)}};function qs(n,e){return e(n),n}function $m(){}const hw="cell";function f0(n,e){return n===e}const Nh=new Map;let W9=class{constructor(e={}){qr(this,"subscriptions",new hc),qr(this,"singletonSubscriptions",new Map),qr(this,"graph",new hc),qr(this,"state",new Map),qr(this,"distinctNodes",new Map),qr(this,"executionMaps",new Map),qr(this,"definitionRegistry",new Set),qr(this,"combinedCells",[]);for(const t of Object.getOwnPropertySymbols(e))this.state.set(t,e[t])}cellInstance(e,t=!0,r=Symbol()){return this.state.has(r)||this.state.set(r,e),t!==!1&&!this.distinctNodes.has(r)&&this.distinctNodes.set(r,t===!0?f0:t),r}signalInstance(e=!0,t=Symbol()){return e!==!1&&this.distinctNodes.set(t,e===!0?f0:e),t}sub(e,t){this.register(e);const r=this.subscriptions.getOrCreate(e);return r.add(t),()=>r.delete(t)}singletonSub(e,t){return this.register(e),t===void 0?this.singletonSubscriptions.delete(e):this.singletonSubscriptions.set(e,t),()=>this.singletonSubscriptions.delete(e)}resetSingletonSubs(){this.singletonSubscriptions.clear()}subMultiple(e,t){const r=this.signalInstance();return this.connect({map:i=>(...s)=>{i(s)},sink:r,sources:e}),this.sub(r,t)}pubIn(e){var t;const r=Reflect.ownKeys(e),i=this.getExecutionMap(r),s=i.refCount.clone(),o=i.participatingNodes.slice(),l=new Map(this.state),a=c=>{this.graph.use(c,u=>{for(const{sources:h,sink:f}of u)h.has(c)&&s.decrement(f,()=>{o.splice(o.indexOf(f),1),a(f)})})};for(;;){const c=o.shift();if(c===void 0)break;const u=c;let h=!1;const f=d=>{const p=this.distinctNodes.get(u);if(p!=null&&p(l.get(u),d)){h=!1;return}h=!0,l.set(u,d),this.state.has(u)&&this.state.set(u,d)};if(Object.prototype.hasOwnProperty.call(e,u)?f(e[u]):i.projections.use(u,d=>{for(const p of d){const g=[...Array.from(p.sources),...Array.from(p.pulls)].map(m=>l.get(m));p.map(f)(...g)}}),h){const d=l.get(u);this.inContext(()=>{this.subscriptions.use(u,p=>{for(const g of p)g(d)})}),(t=this.singletonSubscriptions.get(u))==null||t(d)}else a(u)}}connect({sources:e,pulls:t=[],map:r,sink:i}){const s={map:r,pulls:new Set(t),sink:this.register(i),sources:new Set(e)};for(const o of[...e,...t])this.register(o),this.graph.getOrCreate(o).add(s);this.executionMaps.clear()}pub(e,t){this.pubIn({[e]:t})}pipe(e,...t){return this.combineOperators(...t)(e)}transformer(...e){return t=>qs(this.signalInstance(),r=>(this.link(this.pipe(r,...e),t),r))}link(e,t){this.connect({map:r=>i=>{r(i)},sink:t,sources:[e]})}combine(...e){return qs(this.signalInstance(),t=>{this.connect({map:r=>(...i)=>{r(i)},sink:t,sources:e})})}combineCells(...e){const t=this.combinedCells.find(i=>e.length===i.sources.length&&e.every((s,o)=>s===i.sources[o]));if(t)return t.cell;const r=this.cellInstance(e.map(i=>this.getValue(i)),!0);return this.connect({map:i=>(...s)=>{i(s)},sink:r,sources:e}),this.combinedCells.push({sources:e,cell:r}),r}getValue(e){return this.register(e),this.state.get(e)}getValues(e){return e.map(t=>this.getValue(t))}register(e){const t=Nh.get(e);return t===void 0||this.definitionRegistry.has(e)?e:(this.definitionRegistry.add(e),qs(t.type===hw?this.cellInstance(t.initial,t.distinct,e):this.signalInstance(t.distinct,e),r=>{this.inContext(()=>{t.init(this,r)})}))}inContext(e){return e()}changeWith(e,t,r){this.connect({sources:[t],pulls:[e],sink:e,map:i=>(s,o)=>{i(r(o,s))}})}calculateExecutionMap(e){const t=[],r=new Set,i=new hc,s=new X9,o=new hc,l=(a,c=0)=>{s.increment(a),!r.has(a)&&(this.register(a),i.use(a,u=>{c=Math.max(...Array.from(u).map(h=>t.indexOf(h)))+1}),this.graph.use(a,u=>{for(const h of u)h.sources.has(a)?(o.getOrCreate(h.sink).add(h),l(h.sink,c)):i.getOrCreate(h.sink).add(a)}),r.add(a),t.splice(c,0,a))};return e.forEach(l),{participatingNodes:t,pendingPulls:i,projections:o,refCount:s}}getExecutionMap(e){let t=e;if(e.length===1){t=e[0];const i=this.executionMaps.get(t);if(i!==void 0)return i}else for(const[i,s]of this.executionMaps.entries())if(Array.isArray(i)&&i.length===e.length&&i.every(o=>e.includes(o)))return s;const r=this.calculateExecutionMap(e);return this.executionMaps.set(t,r),r}combineOperators(...e){return t=>{for(const r of e)t=r(t,this);return t}}};function oe(n,e=$m,t=!0){return qs(Symbol(),r=>{Nh.set(r,{type:hw,distinct:t,initial:n,init:e})})}function bt(n=$m,e=!1){return qs(Symbol(),t=>{Nh.set(t,{type:"signal",distinct:e,init:n})})}function Ni(n=$m){return qs(Symbol(),e=>{Nh.set(e,{type:"signal",distinct:!1,init:n})})}const fw=R.createContext(null);function $a(){const n=R.useContext(fw);if(n===null)throw new Error("useRealm must be used within a RealmContextProvider");return n}function nn(n){const e=$a();e.register(n);const t=R.useCallback(r=>e.sub(n,r),[e,n]);return R.useSyncExternalStore(t,()=>e.getValue(n),()=>e.getValue(n))}function Wt(...n){const e=$a(),t=R.useMemo(()=>e.combineCells.apply(e,n),[e,...n]);return nn(t)}function ut(n){const e=$a();return e.register(n),R.useCallback(t=>{e.pub(n,t)},[e,n])}function js(n){return(e,t)=>{const r=t.signalInstance();return t.connect({map:i=>s=>{i(n(s))},sink:r,sources:[e]}),r}}function Je(...n){return(e,t)=>{const r=t.signalInstance();return t.connect({map:i=>(...s)=>{i(s)},pulls:n,sink:r,sources:[e]}),r}}function dw(n){return(e,t)=>{const r=t.signalInstance();return t.connect({map:i=>()=>{i(n)},sink:r,sources:[e]}),r}}function Ea(n){return(e,t)=>{const r=t.signalInstance();return t.connect({map:i=>s=>{n(s)&&i(s)},sink:r,sources:[e]}),r}}function pw(n,e){return(t,r)=>{const i=r.signalInstance();return r.connect({map:s=>o=>{s(e=n(e,o))},sink:i,sources:[t]}),i}}function q9(n,e){return e(n),n}function Ys(){}function Ln(n){return function(e){return{init:t=>{var r;return(r=n.init)==null?void 0:r.call(n,t,e)},postInit:t=>{var r;return(r=n.postInit)==null?void 0:r.call(n,t,e)},update:t=>{var r;return(r=n.update)==null?void 0:r.call(n,t,e)}}}}function j9({children:n,plugins:e}){const t=C.useMemo(()=>q9(new W9,r=>{var i,s;for(const o of e)(i=o.init)==null||i.call(o,r);for(const o of e)(s=o.postInit)==null||s.call(o,r)}),[]);return C.useEffect(()=>{var r;for(const i of e)(r=i.update)==null||r.call(i,t)}),C.createElement(fw.Provider,{value:t},n)}const gw=R.createContext(null);function Y9(n,e){return{getTheme:function(){return e??null}}}function Nt(){const n=R.useContext(gw);return n==null&&(function(e,...t){const r=new URL("https://lexical.dev/docs/error"),i=new URLSearchParams;i.append("code",e);for(const s of t)i.append("v",s);throw r.search=i.toString(),Error(`Minified Lexical error #${e}; visit ${r.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)})(8),n}function F(n,...e){const t=new URL("https://lexical.dev/docs/error"),r=new URLSearchParams;r.append("code",n);for(const i of e)r.append("v",i);throw t.search=r.toString(),Error(`Minified Lexical error #${n}; visit ${t.toString()} for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`)}const tr=typeof window<"u"&&window.document!==void 0&&window.document.createElement!==void 0,H9=tr&&"documentMode"in document?document.documentMode:null,Vn=tr&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),Ci=tr&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),_u=!(!tr||!("InputEvent"in window)||H9)&&"getTargetRanges"in new window.InputEvent("input"),jl=tr&&/Version\/[\d.]+.*Safari/.test(navigator.userAgent),co=tr&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,U9=tr&&/Android/.test(navigator.userAgent),mw=tr&&/^(?=.*Chrome).*/i.test(navigator.userAgent),d0=tr&&U9&&mw,Pu=tr&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!mw;function Qu(...n){const e=[];for(const t of n)if(t&&typeof t=="string")for(const[r]of t.matchAll(/\S+/g))e.push(r);return e}const G9=1,K9=3,J9=9,eQ=11,ds=0,Ow=1,uo=2,tQ=0,nQ=1,rQ=2,$u=4,Eu=8,Em=128,iQ=1792|(112|(3|$u|Eu)|Em),Am=1,Mm=2,Lm=3,Im=4,Rm=5,Nm=6,Dh=jl||co||Pu?" ":"",ii=`
|
|
2
2
|
|
|
3
3
|
`,sQ=Ci?" ":Dh,xw="֑-߿יִ-﷽ﹰ-ﻼ",bw="A-Za-zÀ-ÖØ-öø-ʸ̀-ࠀ-Ⰰ-︀--",oQ=new RegExp("^[^"+bw+"]*["+xw+"]"),lQ=new RegExp("^[^"+xw+"]*["+bw+"]"),ps={bold:1,capitalize:1024,code:16,highlight:Em,italic:2,lowercase:256,strikethrough:$u,subscript:32,superscript:64,underline:Eu,uppercase:512},aQ={directionless:1,unmergeable:2},p0={center:Mm,end:Nm,justify:Im,left:Am,right:Lm,start:Rm},cQ={[Mm]:"center",[Nm]:"end",[Im]:"justify",[Am]:"left",[Lm]:"right",[Rm]:"start"},uQ={normal:0,segmented:2,token:1},hQ={[tQ]:"normal",[rQ]:"segmented",[nQ]:"token"},fQ="$";function yw(n,e,t,r,i,s){let o=n.getFirstChild();for(;o!==null;){const l=o.__key;o.__parent===e&&(I(o)&&yw(o,l,t,r,i,s),t.has(l)||s.delete(l),i.push(l)),o=o.getNextSibling()}}const dQ=100;let dp=!1,Dm=0;function pQ(n){Dm=n.timeStamp}function Ef(n,e,t){const r=n.nodeName==="BR",i=e.__lexicalLineBreak;return i&&(n===i||r&&n.previousSibling===i)||r&&Jh(n,t)!==void 0}function gQ(n,e,t){const r=Gn(An(t));let i=null,s=null;r!==null&&r.anchorNode===n&&(i=r.anchorOffset,s=r.focusOffset);const o=n.nodeValue;o!==null&&lO(e,o,i,s,!1)}function mQ(n,e,t){if(z(n)){const r=n.anchor.getNode();if(r.is(t)&&n.format!==r.getFormat())return!1}return ui(e)&&t.isAttached()}function OQ(n,e,t,r){for(let i=n;i&&!i$(i);i=za(i)){const s=Jh(i,e);if(s!==void 0){const o=Ke(s,t);if(o)return Qe(o)||!nt(i)?void 0:[i,o]}else if(i===r)return[r,l2(t)]}}function kw(n,e,t){dp=!0;const r=performance.now()-Dm>dQ;try{vn(n,(()=>{const i=X()||(function(f){return f.getEditorState().read((()=>{const d=X();return d!==null?d.clone():null}))})(n),s=new Map,o=n.getRootElement(),l=n._editorState,a=n._blockCursorElement;let c=!1,u="";for(let f=0;f<e.length;f++){const d=e[f],p=d.type,g=d.target,m=OQ(g,n,l,o);if(!m)continue;const[O,b]=m;if(p==="characterData")r&&q(b)&&ui(g)&&mQ(i,g,b)&&gQ(g,b,n);else if(p==="childList"){c=!0;const x=d.addedNodes;for(let k=0;k<x.length;k++){const S=x[k],v=s2(S),T=S.parentNode;if(T!=null&&S!==a&&v===null&&!Ef(S,T,n)){if(Ci){const A=(nt(S)?S.innerText:null)||S.nodeValue;A&&(u+=A)}T.removeChild(S)}}const y=d.removedNodes,w=y.length;if(w>0){let k=0;for(let S=0;S<w;S++){const v=y[S];(Ef(v,g,n)||a===v)&&(g.appendChild(v),k++)}w!==k&&s.set(O,b)}}}if(s.size>0)for(const[f,d]of s)d.reconcileObservedMutation(f,n);const h=t.takeRecords();if(h.length>0){for(let f=0;f<h.length;f++){const d=h[f],p=d.addedNodes,g=d.target;for(let m=0;m<p.length;m++){const O=p[m],b=O.parentNode;b==null||O.nodeName!=="BR"||Ef(O,g,n)||b.removeChild(O)}}t.takeRecords()}i!==null&&(c&&dt(i),Ci&&h2(n)&&i.insertRawText(u))}))}finally{dp=!1}}function Sw(n){const e=n._observer;e!==null&&kw(n,e.takeRecords(),e)}function ww(n){(function(e){Dm===0&&An(e).addEventListener("textInput",pQ,!0)})(n),n._observer=new MutationObserver(((e,t)=>{kw(n,e,t)}))}let xQ=class vw{constructor(e,t=new Map,r=void 0,i=new Map,s=void 0){this.node=e,this.sharedConfigMap=t,this.unknownState=r,this.knownState=i;const o=s!==void 0?s:(function(l,a,c){let u=c.size;if(a)for(const h in a){const f=l.get(h);f&&c.has(f)||u++}return u})(t,r,i);this.size=o}getValue(e){const t=this.knownState.get(e);if(t!==void 0)return t;this.sharedConfigMap.set(e.key,e);let r=e.defaultValue;if(this.unknownState&&e.key in this.unknownState){const i=this.unknownState[e.key];i!==void 0&&(r=e.parse(i)),this.updateFromKnown(e,r)}return r}getInternalState(){return[this.unknownState,this.knownState]}toJSON(){const e={...this.unknownState};for(const[t,r]of this.knownState)t.isEqual(r,t.defaultValue)?delete e[t.key]:e[t.key]=t.unparse(r);return fc(e)?{[fQ]:e}:{}}getWritable(e){if(this.node===e)return this;const t=new Map(this.knownState),r=fc(i=this.unknownState)&&{...i};var i;if(r)for(const s of t.keys())delete r[s.key];return new vw(e,this.sharedConfigMap,fc(r),t,this.size)}updateFromKnown(e,t){const r=e.key;this.sharedConfigMap.set(r,e);const{knownState:i,unknownState:s}=this;i.has(e)||s&&r in s||this.size++,i.set(e,t)}updateFromUnknown(e,t){const r=this.sharedConfigMap.get(e);r?this.updateFromKnown(r,r.parse(t)):(this.unknownState=this.unknownState||{},e in this.unknownState||this.size++,this.unknownState[e]=t)}updateFromJSON(e){const{knownState:t}=this;for(const r of t.keys())t.set(r,r.defaultValue);if(this.size=t.size,this.unknownState={},e)for(const[r,i]of Object.entries(e))this.updateFromUnknown(r,i);this.unknownState=fc(this.unknownState)}};function fc(n){if(n)for(const e in n)return n}function bQ(n){const e=n.getWritable(),t=e.__state?e.__state.getWritable(e):new xQ(e);return e.__state=t,t}function g0(n,e){const t=n.__mode,r=n.__format,i=n.__style,s=e.__mode,o=e.__format,l=e.__style,a=n.__state,c=e.__state;return(t===null||t===s)&&(r===null||r===o)&&(i===null||i===l)&&(n.__state===null||a===c||(function(u,h){if(u===h)return!0;if(u&&h&&u.size!==h.size)return!1;const f=new Set,d=(g,m)=>{for(const[O,b]of g.knownState){if(f.has(O.key))continue;f.add(O.key);const x=m?m.getValue(O):O.defaultValue;if(x!==b&&!O.isEqual(x,b))return!0}return!1},p=(g,m)=>{const{unknownState:O}=g,b=m?m.unknownState:void 0;if(O){for(const[x,y]of Object.entries(O))if(!f.has(x)&&(f.add(x),y!==(b?b[x]:void 0)))return!0}return!1};return!(u&&d(u,h)||h&&d(h,u)||u&&p(u,h)||h&&p(h,u))})(a,c))}function m0(n,e){const t=n.mergeWithSibling(e),r=tt()._normalizedNodes;return r.add(n.__key),r.add(e.__key),t}function O0(n){let e,t,r=n;if(r.__text!==""||!r.isSimpleText()||r.isUnmergeable()){for(;(e=r.getPreviousSibling())!==null&&q(e)&&e.isSimpleText()&&!e.isUnmergeable();){if(e.__text!==""){if(g0(e,r)){r=m0(e,r);break}break}e.remove()}for(;(t=r.getNextSibling())!==null&&q(t)&&t.isSimpleText()&&!t.isUnmergeable();){if(t.__text!==""){if(g0(r,t)){r=m0(r,t);break}break}t.remove()}}else r.remove()}function gs(n){return x0(n.anchor),x0(n.focus),n}function x0(n){for(;n.type==="element";){const e=n.getNode(),t=n.offset;let r,i;if(t===e.getChildrenSize()?(r=e.getChildAtIndex(t-1),i=!0):(r=e.getChildAtIndex(t),i=!1),q(r)){n.set(r.__key,i?r.getTextContentSize():0,"text",!0);break}if(!I(r))break;n.set(r.__key,i?r.getChildrenSize():0,"element",!0)}}let Pi,Ft,Yl,Zh,pp,gp,ms,Yn,mp,Hl,gt="",Vt="",dr=null,pr="",Yr="",Cw=!1,Ul=!1,su=null;function Au(n,e){const t=ms.get(n);if(e!==null){const r=bp(n);r.parentNode===e&&e.removeChild(r)}if(Yn.has(n)||Ft._keyToDOMMap.delete(n),I(t)){const r=Lu(t,ms);Op(r,0,r.length-1,null)}t!==void 0&&aO(Hl,Yl,Zh,t,"destroyed")}function Op(n,e,t,r){let i=e;for(;i<=t;++i){const s=n[i];s!==void 0&&Au(s,r)}}function ji(n,e){n.setProperty("text-align",e)}const yQ="40px";function Tw(n,e){const t=Pi.theme.indent;if(typeof t=="string"){const i=n.classList.contains(t);e>0&&!i?n.classList.add(t):e<1&&i&&n.classList.remove(t)}const r=getComputedStyle(n).getPropertyValue("--lexical-indent-base-value")||yQ;n.style.setProperty("padding-inline-start",e===0?"":`calc(${e} * ${r})`)}function _w(n,e){const t=n.style;e===0?ji(t,""):e===Am?ji(t,"left"):e===Mm?ji(t,"center"):e===Lm?ji(t,"right"):e===Im?ji(t,"justify"):e===Rm?ji(t,"start"):e===Nm&&ji(t,"end")}function Mu(n,e){const t=Yn.get(n);t===void 0&&F(60);const r=t.createDOM(Pi,Ft);if((function(i,s,o){const l=o._keyToDOMMap;(function(a,c,u){const h=`__lexicalKey_${c._key}`;a[h]=u})(s,o,i),l.set(i,s)})(n,r,Ft),q(t)?r.setAttribute("data-lexical-text","true"):Qe(t)&&r.setAttribute("data-lexical-decorator","true"),I(t)){const i=t.__indent,s=t.__size;if(i!==0&&Tw(r,i),s!==0){const l=s-1;(function(a,c,u,h){const f=Vt;Vt="",xp(a,u,0,c,u.getDOMSlot(h)),Qw(u,h),Vt=f})(Lu(t,Yn),l,t,r)}const o=t.__format;o!==0&&_w(r,o),t.isInline()||Pw(null,t,r),ef(t)&&(gt+=ii,Yr+=ii)}else{const i=t.getTextContent();if(Qe(t)){const s=t.decorate(Ft,Pi);s!==null&&$w(n,s),r.contentEditable="false"}else q(t)&&(t.isDirectionless()||(Vt+=i));gt+=i,Yr+=i}return e!==null&&e.insertChild(r),aO(Hl,Yl,Zh,t,"created"),r}function xp(n,e,t,r,i){const s=gt;gt="";let o=t;for(;o<=r;++o){Mu(n[o],i);const l=Yn.get(n[o]);l!==null&&q(l)&&(dr===null&&(dr=l.getFormat()),pr===""&&(pr=l.getStyle()))}ef(e)&&(gt+=ii),i.element.__lexicalTextContent=gt,gt=s+gt}function b0(n,e){if(n){const t=n.__last;if(t){const r=e.get(t);if(r)return Hn(r)?"line-break":Qe(r)&&r.isInline()?"decorator":null}return"empty"}return null}function Pw(n,e,t){const r=b0(n,ms),i=b0(e,Yn);r!==i&&e.getDOMSlot(t).setManagedLineBreak(i)}function Qw(n,e){const t=e.__lexicalDirTextContent||"",r=e.__lexicalDir||"";if(t!==Vt||r!==su){const i=Vt==="",s=i?su:(function(o){return oQ.test(o)?"rtl":lQ.test(o)?"ltr":null})(Vt);if(s!==r){const o=e.classList,l=Pi.theme;let a=r!==null?l[r]:void 0,c=s!==null?l[s]:void 0;if(a!==void 0){if(typeof a=="string"){const u=Qu(a);a=l[r]=u}o.remove(...a)}if(s===null||i&&s==="ltr")e.removeAttribute("dir");else{if(c!==void 0){if(typeof c=="string"){const u=Qu(c);c=l[s]=u}c!==void 0&&o.add(...c)}e.dir=s}Ul||(n.getWritable().__dir=s)}su=s,e.__lexicalDirTextContent=Vt,e.__lexicalDir=s}}function kQ(n,e,t){const r=Vt;var i;Vt="",dr=null,pr="",(function(s,o,l){const a=gt,c=s.__size,u=o.__size;gt="";const h=l.element;if(c===1&&u===1){const f=s.__first,d=o.__first;if(f===d)gl(f,h);else{const g=bp(f),m=Mu(d,null);try{h.replaceChild(m,g)}catch(O){if(typeof O=="object"&&O!=null){const b=`${O.toString()} Parent: ${h.tagName}, new child: {tag: ${m.tagName} key: ${d}}, old child: {tag: ${g.tagName}, key: ${f}}.`;throw new Error(b)}throw O}Au(f,null)}const p=Yn.get(d);q(p)&&(dr===null&&(dr=p.getFormat()),pr===""&&(pr=p.getStyle()))}else{const f=Lu(s,ms),d=Lu(o,Yn);if(f.length!==c&&F(227),d.length!==u&&F(228),c===0)u!==0&&xp(d,o,0,u-1,l);else if(u===0){if(c!==0){const p=l.after==null&&l.before==null&&l.element.__lexicalLineBreak==null;Op(f,0,c-1,p?null:h),p&&(h.textContent="")}}else(function(p,g,m,O,b,x){const y=O-1,w=b-1;let k,S,v=x.getFirstChild(),T=0,A=0;for(;T<=y&&A<=w;){const E=g[T],D=m[A];if(E===D)v=Af(gl(D,x.element)),T++,A++;else{k===void 0&&(k=new Set(g)),S===void 0&&(S=new Set(m));const J=S.has(E),U=k.has(D);if(J)if(U){const le=fo(Ft,D);le===v?v=Af(gl(D,x.element)):(x.withBefore(v).insertChild(le),gl(D,x.element)),T++,A++}else Mu(D,x.withBefore(v)),A++;else v=Af(bp(E)),Au(E,x.element),T++}const B=Yn.get(D);B!==null&&q(B)&&(dr===null&&(dr=B.getFormat()),pr===""&&(pr=B.getStyle()))}const M=T>y,L=A>w;if(M&&!L){const E=m[w+1],D=E===void 0?null:Ft.getElementByKey(E);xp(m,p,A,w,x.withBefore(D))}else L&&!M&&Op(g,T,y,x.element)})(o,f,d,c,u,l)}ef(o)&&(gt+=ii),h.__lexicalTextContent=gt,gt=a+gt})(n,e,e.getDOMSlot(t)),Qw(e,t),i=e,dr==null||dr===i.__textFormat||Ul||i.setTextFormat(dr),(function(s){pr===""||pr===s.__textStyle||Ul||s.setTextStyle(pr)})(e),Vt=r}function Lu(n,e){const t=[];let r=n.__first;for(;r!==null;){const i=e.get(r);i===void 0&&F(101),t.push(r),r=i.__next}return t}function gl(n,e){const t=ms.get(n);let r=Yn.get(n);t!==void 0&&r!==void 0||F(61);const i=Cw||gp.has(n)||pp.has(n),s=fo(Ft,n);if(t===r&&!i){if(I(t)){const o=s.__lexicalTextContent;o!==void 0&&(gt+=o,Yr+=o);const l=s.__lexicalDirTextContent;l!==void 0&&(Vt+=l)}else{const o=t.getTextContent();q(t)&&!t.isDirectionless()&&(Vt+=o),Yr+=o,gt+=o}return s}if(t!==r&&i&&aO(Hl,Yl,Zh,r,"updated"),r.updateDOM(t,s,Pi)){const o=Mu(n,null);return e===null&&F(62),e.replaceChild(o,s),Au(n,null),o}if(I(t)&&I(r)){const o=r.__indent;o!==t.__indent&&Tw(s,o);const l=r.__format;l!==t.__format&&_w(s,l),i&&(kQ(t,r,s),Qt(r)||r.isInline()||Pw(t,r,s)),ef(r)&&(gt+=ii,Yr+=ii)}else{const o=r.getTextContent();if(Qe(r)){const l=r.decorate(Ft,Pi);l!==null&&$w(n,l)}else q(r)&&!r.isDirectionless()&&(Vt+=o);gt+=o,Yr+=o}if(!Ul&&Qt(r)&&r.__cachedText!==Yr){const o=r.getWritable();o.__cachedText=Yr,r=o}return s}function $w(n,e){let t=Ft._pendingDecorators;const r=Ft._decorators;if(t===null){if(r[n]===e)return;t=o2(Ft)}t[n]=e}function Af(n){let e=n.nextSibling;return e!==null&&e===Ft._blockCursorElement&&(e=e.nextSibling),e}function SQ(n,e,t,r,i,s){gt="",Yr="",Vt="",Cw=r===uo,su=null,Ft=t,Pi=t._config,Yl=t._nodes,Zh=Ft._listeners.mutation,pp=i,gp=s,ms=n._nodeMap,Yn=e._nodeMap,Ul=e._readOnly,mp=new Map(t._keyToDOMMap);const o=new Map;return Hl=o,gl("root",null),Ft=void 0,Yl=void 0,pp=void 0,gp=void 0,ms=void 0,Yn=void 0,Pi=void 0,mp=void 0,Hl=void 0,o}function bp(n){const e=mp.get(n);return e===void 0&&F(75,n),e}function ci(n){return{}}const Bh={},wQ={},zh={},ls={},Hs={},Gl={},Us={},Aa={},yp={},Kl={},Jl={},Kr={},Vh={},Fh={},Ew={},Aw={},vQ={},Zm={},CQ={},Bm={},zm={},ea={},Vm={},Xh={},Ma={},Wh={},Fm={},Mw={},Iu={},kp={},Xm={},TQ={},qh={},Wm={},_Q={},jh={},qm={},Sp={},PQ={},QQ={},ml={},Ol={},Lw={},Iw={},Rw={},Vr=Object.freeze({}),wp=30,vp=[["keydown",function(n,e){if(Ql=n.timeStamp,Cp=n.key,e.isComposing())return;const{key:t,shiftKey:r,ctrlKey:i,metaKey:s,altKey:o}=n;if(!re(e,Ew,n)&&t!=null){if(Mf&&As(Cp))return vn(e,(()=>{dc(e,Lf)})),Mf=!1,void(Lf="");if((function(l,a,c,u){return q0(l)&&!a&&!u&&!c})(t,i,o,s))re(e,Aw,n);else if((function(l,a,c,u,h){return q0(l)&&!u&&!c&&(a||h)})(t,i,r,o,s))re(e,vQ,n);else if((function(l,a,c,u){return W0(l)&&!a&&!u&&!c})(t,i,o,s))re(e,Zm,n);else if((function(l,a,c,u,h){return W0(l)&&!u&&!c&&(a||h)})(t,i,r,o,s))re(e,CQ,n);else if((function(l,a,c){return(function(u){return u==="ArrowUp"})(l)&&!a&&!c})(t,i,s))re(e,Bm,n);else if((function(l,a,c){return(function(u){return u==="ArrowDown"})(l)&&!a&&!c})(t,i,s))re(e,zm,n);else if((function(l,a){return j0(l)&&a})(t,r))$l=!0,re(e,ea,n);else if((function(l){return l===" "})(t))re(e,Vm,n);else if((function(l,a){return Vn&&a&&l.toLowerCase()==="o"})(t,i))n.preventDefault(),$l=!0,re(e,Hs,!0);else if((function(l,a){return j0(l)&&!a})(t,r))$l=!1,re(e,ea,n);else if((function(l,a,c,u){return Vn?!a&&!c&&(As(l)||l.toLowerCase()==="h"&&u):u||a||c?!1:As(l)})(t,o,s,i))As(t)?re(e,Xh,n):(n.preventDefault(),re(e,ls,!0));else if((function(l){return l==="Escape"})(t))re(e,Ma,n);else if((function(l,a,c,u,h){return Vn?!(c||u||h)&&(nl(l)||l.toLowerCase()==="d"&&a):a||u||h?!1:nl(l)})(t,i,r,o,s))nl(t)?re(e,Wh,n):(n.preventDefault(),re(e,ls,!1));else if((function(l,a,c){return As(l)&&(Vn?a:c)})(t,o,i))n.preventDefault(),re(e,Kl,!0);else if((function(l,a,c){return nl(l)&&(Vn?a:c)})(t,o,i))n.preventDefault(),re(e,Kl,!1);else if((function(l,a){return Vn&&a&&As(l)})(t,s))n.preventDefault(),re(e,Jl,!0);else if((function(l,a){return Vn&&a&&nl(l)})(t,s))n.preventDefault(),re(e,Jl,!1);else if((function(l,a,c,u){return l.toLowerCase()==="b"&&!a&&xl(c,u)})(t,o,s,i))n.preventDefault(),re(e,Kr,"bold");else if((function(l,a,c,u){return l.toLowerCase()==="u"&&!a&&xl(c,u)})(t,o,s,i))n.preventDefault(),re(e,Kr,"underline");else if((function(l,a,c,u){return l.toLowerCase()==="i"&&!a&&xl(c,u)})(t,o,s,i))n.preventDefault(),re(e,Kr,"italic");else if((function(l,a,c,u){return l==="Tab"&&!a&&!c&&!u})(t,o,i,s))re(e,Fm,n);else if((function(l,a,c,u){return l.toLowerCase()==="z"&&!a&&xl(c,u)})(t,r,s,i))n.preventDefault(),re(e,Vh,void 0);else if((function(l,a,c,u){return Vn?l.toLowerCase()==="z"&&c&&a:l.toLowerCase()==="y"&&u||l.toLowerCase()==="z"&&u&&a})(t,r,s,i))n.preventDefault(),re(e,Fh,void 0);else{const l=e._editorState._selection;l===null||z(l)?!Ci&&Y0(t,s,i)&&(n.preventDefault(),re(e,Sp,n)):(function(a,c,u,h){return c?!1:a.toLowerCase()==="c"?Vn?u:h:!1})(t,r,s,i)?(n.preventDefault(),re(e,jh,n)):(function(a,c,u,h){return c?!1:a.toLowerCase()==="x"?Vn?u:h:!1})(t,r,s,i)?(n.preventDefault(),re(e,qm,n)):Y0(t,s,i)&&(n.preventDefault(),re(e,Sp,n))}(function(l,a,c,u){return l||a||c||u})(i,r,o,s)&&re(e,Rw,n)}}],["pointerdown",function(n,e){const t=n.target,r=n.pointerType;Bo(t)&&r!=="touch"&&n.button===0&&vn(e,(()=>{Qe(Ar(t))||(_p=!0)}))}],["compositionstart",function(n,e){vn(e,(()=>{const t=X();if(z(t)&&!e.isComposing()){const r=t.anchor,i=t.anchor.getNode();Tt(r.key),(n.timeStamp<Ql+wp||r.type==="element"||!t.isCollapsed()||i.getFormat()!==t.format||q(i)&&i.getStyle()!==t.style)&&re(e,Us,sQ)}}))}],["compositionend",function(n,e){Ci?tl=!0:co||!jl&&!Pu?vn(e,(()=>{dc(e,n.data)})):(Mf=!0,Lf=n.data)}],["input",function(n,e){n.stopPropagation(),vn(e,(()=>{const t=X(),r=n.data,i=zw(n);if(r!=null&&z(t)&&Zw(t,i,r,n.timeStamp,!1)){tl&&(dc(e,r),tl=!1);const s=t.anchor.getNode(),o=Gn(An(e));if(o===null)return;const l=t.isBackward(),a=l?t.anchor.offset:t.focus.offset,c=l?t.focus.offset:t.anchor.offset;_u&&!t.isCollapsed()&&q(s)&&o.anchorNode!==null&&s.getTextContent().slice(0,a)+r+s.getTextContent().slice(a+c)===u2(o.anchorNode)||re(e,Us,r);const u=r.length;Ci&&u>1&&n.inputType==="insertCompositionText"&&!e.isComposing()&&(t.anchor.offset-=u),jl||co||Pu||!e.isComposing()||(Ql=0,Tt(null))}else oO(!1,e,r!==null?r:void 0),tl&&(dc(e,r||void 0),tl=!1);(function(){At();const s=tt();Sw(s)})()}),{event:n}),Ns=null}],["click",function(n,e){vn(e,(()=>{const t=X(),r=Gn(An(e)),i=No();if(r){if(z(t)){const s=t.anchor,o=s.getNode();if(s.type==="element"&&s.offset===0&&t.isCollapsed()&&!Qt(o)&&Fe().getChildrenSize()===1&&o.getTopLevelElementOrThrow().isEmpty()&&i!==null&&t.is(i))r.removeAllRanges(),t.dirty=!0;else if(n.detail===3&&!t.isCollapsed()&&o!==t.focus.getNode()){const l=(function(a,c){let u=a;for(;u!==Fe()&&u!=null;){if(c(u))return u;u=u.getParent()}return null})(o,(a=>I(a)&&!a.isInline()));I(l)&&l.select(0)}}else if(n.pointerType==="touch"){const s=r.anchorNode;(nt(s)||ui(s))&&dt(Um(i,r,e,n))}}re(e,zh,n)}))}],["cut",Vr],["copy",Vr],["dragstart",Vr],["dragover",Vr],["dragend",Vr],["paste",Vr],["focus",Vr],["blur",Vr],["drop",Vr]];_u&&vp.push(["beforeinput",(n,e)=>(function(t,r){const i=t.inputType,s=zw(t);i==="deleteCompositionText"||Ci&&h2(r)||i!=="insertCompositionText"&&vn(r,(()=>{const o=X();if(i==="deleteContentBackward"){if(o===null){const d=No();if(!z(d))return;dt(d.clone())}if(z(o)){const d=o.anchor.key===o.focus.key;if(l=t.timeStamp,Cp==="MediaLast"&&l<Ql+wp&&r.isComposing()&&d){if(Tt(null),Ql=0,setTimeout((()=>{vn(r,(()=>{Tt(null)}))}),wp),z(o)){const p=o.anchor.getNode();p.markDirty(),q(p)||F(142),Bw(o,p)}}else{Tt(null),t.preventDefault();const p=o.anchor.getNode(),g=p.getTextContent(),m=p.canInsertTextAfter(),O=o.anchor.offset===0&&o.focus.offset===g.length;let b=d0&&d&&!O&&m;if(b&&o.isCollapsed()&&(b=!Qe(Ep(o.anchor,!0))),!b){re(r,ls,!0);const x=X();d0&&z(x)&&x.isCollapsed()&&(Ki=x,setTimeout((()=>Ki=null)))}}return}}var l;if(!z(o))return;const a=t.data;Ns!==null&&oO(!1,r,Ns),o.dirty&&Ns===null||!o.isCollapsed()||Qt(o.anchor.getNode())||s===null||o.applyDOMRange(s),Ns=null;const c=o.anchor,u=o.focus,h=c.getNode(),f=u.getNode();if(i!=="insertText"&&i!=="insertTranspose")switch(t.preventDefault(),i){case"insertFromYank":case"insertFromDrop":case"insertReplacementText":re(r,Us,t);break;case"insertFromComposition":Tt(null),re(r,Us,t);break;case"insertLineBreak":Tt(null),re(r,Hs,!1);break;case"insertParagraph":Tt(null),$l&&!co?($l=!1,re(r,Hs,!1)):re(r,Gl,void 0);break;case"insertFromPaste":case"insertFromPasteAsQuotation":re(r,Aa,t);break;case"deleteByComposition":(function(d,p){return d!==p||I(d)||I(p)||!d.isToken()||!p.isToken()})(h,f)&&re(r,yp,t);break;case"deleteByDrag":case"deleteByCut":re(r,yp,t);break;case"deleteContent":re(r,ls,!1);break;case"deleteWordBackward":re(r,Kl,!0);break;case"deleteWordForward":re(r,Kl,!1);break;case"deleteHardLineBackward":case"deleteSoftLineBackward":re(r,Jl,!0);break;case"deleteContentForward":case"deleteHardLineForward":case"deleteSoftLineForward":re(r,Jl,!1);break;case"formatStrikeThrough":re(r,Kr,"strikethrough");break;case"formatBold":re(r,Kr,"bold");break;case"formatItalic":re(r,Kr,"italic");break;case"formatUnderline":re(r,Kr,"underline");break;case"historyUndo":re(r,Vh,void 0);break;case"historyRedo":re(r,Fh,void 0)}else{if(a===`
|
|
4
4
|
`)t.preventDefault(),re(r,Hs,!1);else if(a===ii)t.preventDefault(),re(r,Gl,void 0);else if(a==null&&t.dataTransfer){const d=t.dataTransfer.getData("text/plain");t.preventDefault(),o.insertRawText(d)}else a!=null&&Zw(o,s,a,t.timeStamp,!0)?(t.preventDefault(),re(r,Us,a)):Ns=a;Nw=t.timeStamp}}))})(n,e)]);let Ql=0,Cp=null,Nw=0,Ns=null;const Ru=new WeakMap;let Tp=!1,_p=!1,$l=!1,tl=!1,Mf=!1,Lf="",Ki=null,Dw=[0,"",0,"root",0];function Zw(n,e,t,r,i){const s=n.anchor,o=n.focus,l=s.getNode(),a=tt(),c=Gn(An(a)),u=c!==null?c.anchorNode:null,h=s.key,f=a.getElementByKey(h),d=t.length;return h!==o.key||!q(l)||(!i&&(!_u||Nw<r+50)||l.isDirty()&&d<2||a2(t))&&s.offset!==o.offset&&!l.isComposing()||Ds(l)||l.isDirty()&&d>1||(i||!_u)&&f!==null&&!l.isComposing()&&u!==ho(f)||c!==null&&e!==null&&(!e.collapsed||e.startContainer!==c.anchorNode||e.startOffset!==c.anchorOffset)||l.getFormat()!==n.format||l.getStyle()!==n.style||(function(p,g){if(g.isSegmented())return!0;if(!p.isCollapsed())return!1;const m=p.anchor.offset,O=g.getParentOrThrow(),b=g.isToken();return m===0?!g.canInsertTextBefore()||!O.canInsertTextBefore()&&!g.isComposing()||b||(function(x){const y=x.getPreviousSibling();return(q(y)||I(y)&&y.isInline())&&!y.canInsertTextAfter()})(g):m===g.getTextContentSize()&&(!g.canInsertTextAfter()||!O.canInsertTextAfter()&&!g.isComposing()||b)})(n,l)}function y0(n,e){return ui(n)&&n.nodeValue!==null&&e!==0&&e!==n.nodeValue.length}function k0(n,e,t){const{anchorNode:r,anchorOffset:i,focusNode:s,focusOffset:o}=n;Tp&&(Tp=!1,y0(r,i)&&y0(s,o)&&!Ki)||vn(e,(()=>{if(!t)return void dt(null);if(!Ba(e,r,s))return;let l=X();if(Ki&&z(l)&&l.isCollapsed()){const a=l.anchor,c=Ki.anchor;(a.key===c.key&&a.offset===c.offset+1||a.offset===1&&c.getNode().is(a.getNode().getPreviousSibling()))&&(l=Ki.clone(),dt(l))}if(Ki=null,z(l)){const a=l.anchor,c=a.getNode();if(l.isCollapsed()){n.type==="Range"&&n.anchorNode===n.focusNode&&(l.dirty=!0);const u=An(e).event,h=u?u.timeStamp:performance.now(),[f,d,p,g,m]=Dw,O=Fe(),b=e.isComposing()===!1&&O.getTextContent()==="";if(h<m+200&&a.offset===p&&a.key===g)ou(l,f,d);else if(a.type==="text")q(c)||F(141),Bw(l,c);else if(a.type==="element"&&!b){I(c)||F(259);const x=a.getNode();x.isEmpty()?(function(y,w){const k=w.getTextFormat(),S=w.getTextStyle();ou(y,k,S)})(l,x):ou(l,0,"")}}else{const u=a.key,h=l.focus.key,f=l.getNodes(),d=f.length,p=l.isBackward(),g=p?o:i,m=p?i:o,O=p?h:u,b=p?u:h;let x=iQ,y=!1;for(let w=0;w<d;w++){const k=f[w],S=k.getTextContentSize();if(q(k)&&S!==0&&!(w===0&&k.__key===O&&g===S||w===d-1&&k.__key===b&&m===0)&&(y=!0,x&=k.getFormat(),x===0))break}l.format=y?x:0}}re(e,Bh,void 0)}))}function ou(n,e,t){n.format===e&&n.style===t||(n.format=e,n.style=t,n.dirty=!0)}function Bw(n,e){ou(n,e.getFormat(),e.getStyle())}function zw(n){if(!n.getTargetRanges)return null;const e=n.getTargetRanges();return e.length===0?null:e[0]}function dc(n,e){const t=n._compositionKey;if(Tt(null),t!==null&&e!=null){if(e===""){const r=Ke(t),i=ho(n.getElementByKey(t));return void(i!==null&&i.nodeValue!==null&&q(r)&&lO(r,i.nodeValue,null,null,!0))}if(e[e.length-1]===`
|
package/build/client/index.html
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<!DOCTYPE html><html lang="en" class="min-h-screen"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><title>Editorial Admin</title><meta name="robots" content="noindex"/><link rel="icon" type="image/ico" href="/admin/favicon.ico"/><link rel="modulepreload" href="/assets/manifest-
|
|
1
|
+
<!DOCTYPE html><html lang="en" class="min-h-screen"><head><meta charSet="utf-8"/><meta name="viewport" content="width=device-width, initial-scale=1"/><title>Editorial Admin</title><meta name="robots" content="noindex"/><link rel="icon" type="image/ico" href="/admin/favicon.ico"/><link rel="modulepreload" href="/assets/manifest-239e9170.js"/><link rel="modulepreload" href="/assets/entry.client-C94uvdU2.js"/><link rel="modulepreload" href="/assets/chunk-EPOLDU6W-CiSVlmCe.js"/><link rel="modulepreload" href="/assets/index-DLIEpuwL.js"/><link rel="modulepreload" href="/assets/root-dzmn7V-J.js"/><link rel="modulepreload" href="/assets/index-CZSVchcX.js"/><link rel="modulepreload" href="/assets/loader-circle-BDUbeTTe.js"/><link rel="modulepreload" href="/assets/createLucideIcon-BvSqmaUO.js"/><link rel="modulepreload" href="/assets/circle-check-C6CxUIig.js"/><link rel="modulepreload" href="/assets/utils-B48p8Qal.js"/><link rel="modulepreload" href="/assets/authSlice-DWtXmmFR.js"/><link rel="modulepreload" href="/assets/Loading-C1QGFwZC.js"/><link rel="stylesheet" href="/assets/root-DZYAU5bq.css"/></head><body class="h-full min-h-screen bg-background font-sans antialiased"><div class="flex gap-1 items-center justify-center min-h-screen"><svg xmlns="http://www.w3.org/2000/svg" width="28px" height="28px" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-loader-circle animate-spin"><path d="M21 12a9 9 0 1 1-6.219-8.56"></path></svg><p class="text-gray-600">Loading Editorial...</p></div><section aria-label="Notifications alt+T" tabindex="-1" aria-live="polite" aria-relevant="additions text" aria-atomic="false"></section><script>window.__reactRouterContext = {"basename":"/","future":{"unstable_optimizeDeps":false,"unstable_subResourceIntegrity":false,"unstable_trailingSlashAwareDataRequests":false,"v8_middleware":false,"v8_splitRouteModules":false,"v8_viteEnvironmentApi":false},"routeDiscovery":{"mode":"initial"},"ssr":false,"isSpaMode":true};window.__reactRouterContext.stream = new ReadableStream({start(controller){window.__reactRouterContext.streamController = controller;}}).pipeThrough(new TextEncoderStream());</script><script type="module" async="">import "/assets/manifest-239e9170.js";
|
|
2
2
|
import * as route0 from "/assets/root-dzmn7V-J.js";
|
|
3
3
|
|
|
4
4
|
window.__reactRouterRouteModules = {"root":route0};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@isardsat/editorial-admin",
|
|
3
|
-
"version": "6.21.
|
|
3
|
+
"version": "6.21.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
"tailwindcss-animate": "^1.0.7",
|
|
79
79
|
"vaul": "^1.1.2",
|
|
80
80
|
"zod": "^4.1.11",
|
|
81
|
-
"@isardsat/editorial-common": "^6.21.
|
|
81
|
+
"@isardsat/editorial-common": "^6.21.1"
|
|
82
82
|
},
|
|
83
83
|
"devDependencies": {
|
|
84
84
|
"@react-router/dev": "^7.7.0",
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/FilePicker-DGseBDOZ.js","assets/chunk-EPOLDU6W-CiSVlmCe.js","assets/utils-B48p8Qal.js","assets/files-BTW5qTjQ.js","assets/index-CZSVchcX.js","assets/index-DLIEpuwL.js","assets/badge-DTudhbGs.js","assets/index-CbaefyjV.js","assets/upload-DhJ5wU_H.js","assets/createLucideIcon-BvSqmaUO.js","assets/trash-UKLAaALv.js","assets/chevron-down-qxzqwz13.js","assets/check-DF0ucE8d.js","assets/x-D6gZWaAR.js","assets/button-BEFuP7Ru.js","assets/input-C3iFdiD8.js","assets/external-link-ERgO2SVI.js","assets/markdownEditor-CZVz5-rL.js","assets/authSlice-DWtXmmFR.js","assets/index-DutSppa2.js","assets/index-B5ynPIRP.js","assets/zod-DU3Qlmru.js","assets/schemas-CPJfa6mm.js","assets/index-nnJosT4e.js","assets/index-CU6_POhE.js","assets/schemas-D-U8dKAF.js","assets/loader-circle-BDUbeTTe.js","assets/markdownEditor-Dha_UaaS.css","assets/date-picker-6Pg8PIj8.js","assets/clear-button-DehdxgmB.js","assets/chevron-right-BFlMu-RJ.js","assets/calendar-Frbsxn98.js","assets/datetime-picker-XkOBOVOZ.js","assets/URLInput-ATIRZflA.js","assets/ColorPicker-kqchGTe4.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{a as l,p as e,R as $,A as eo,v as to,z as oo}from"./chunk-EPOLDU6W-CiSVlmCe.js";import{c as We,b as k,f as no,g as Pe,u as Ye,a as q,e as ne}from"./index-B5ynPIRP.js";import{u as U}from"./index-CbaefyjV.js";import{c as tt,R as so,W as ro,C as ao,T as lo,D as io,a as ot,P as co,O as uo,b as po,d as nt,e as mo,u as Ke,V as ho,A as fo,f as xo,g as go,h as vo,i as So,j as Co,F as wo,k as yo,l as bo,m as jo}from"./index-DutSppa2.js";import{b as st,B as ve}from"./button-BEFuP7Ru.js";import{b as T,z as No,A as Io,h as _o,n as Eo}from"./utils-B48p8Qal.js";import{B as Ro}from"./badge-DTudhbGs.js";import{g as Do,u as To,a as Ao,F as Po,b as Se,c as Ce,d as xe,e as we,f as ye,C as Xe,h as De}from"./zod-DU3Qlmru.js";import{I as Te}from"./input-C3iFdiD8.js";import{a as rt}from"./index-DLIEpuwL.js";import{C as at}from"./chevron-down-qxzqwz13.js";import{C as Mo}from"./check-DF0ucE8d.js";import{c as qe}from"./createLucideIcon-BvSqmaUO.js";import{R as Oo}from"./schemas-D-U8dKAF.js";import{t as ie}from"./index-CZSVchcX.js";import{X as Me}from"./x-D6gZWaAR.js";import{L as Lo}from"./loader-circle-BDUbeTTe.js";import{s as G,_ as Ze,u as ko,n as $o,l as Vo,o as Fo,a as Bo}from"./schemas-CPJfa6mm.js";const zo=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Ho=qe("chevron-up",zo);const Uo=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],Qe=qe("rotate-ccw",Uo);const Wo=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],Ko=qe("save",Wo);function Ae(t){if(!t||t.length!==1)return null;const o=t[0].match(/^\$(.+)$/);return o?o[1]:null}const qo="modulepreload",Go=function(t){return"/"+t},Je={},me=function(o,n,i){let c=Promise.resolve();if(n&&n.length>0){let h=function(f){return Promise.all(f.map(w=>Promise.resolve(w).then(b=>({status:"fulfilled",value:b}),b=>({status:"rejected",reason:b}))))};document.getElementsByTagName("link");const s=document.querySelector("meta[property=csp-nonce]"),d=s?.nonce||s?.getAttribute("nonce");c=h(n.map(f=>{if(f=Go(f),f in Je)return;Je[f]=!0;const w=f.endsWith(".css"),b=w?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${b}`))return;const N=document.createElement("link");if(N.rel=w?"stylesheet":qo,w||(N.as="script"),N.crossOrigin="",N.href=f,d&&N.setAttribute("nonce",d),document.head.appendChild(N),w)return new Promise((E,_)=>{N.addEventListener("load",E),N.addEventListener("error",()=>_(new Error(`Unable to preload CSS for ${f}`)))})}))}function p(s){const d=new Event("vite:preloadError",{cancelable:!0});if(d.payload=s,window.dispatchEvent(d),!d.defaultPrevented)throw s}return c.then(s=>{for(const d of s||[])d.status==="rejected"&&p(d.reason);return o().catch(p)})};var lt="AlertDialog",[Yo]=We(lt,[tt]),oe=tt(),it=t=>{const{__scopeAlertDialog:o,...n}=t,i=oe(o);return e.jsx(so,{...i,...n,modal:!0})};it.displayName=lt;var Xo="AlertDialogTrigger",Zo=l.forwardRef((t,o)=>{const{__scopeAlertDialog:n,...i}=t,c=oe(n);return e.jsx(po,{...c,...i,ref:o})});Zo.displayName=Xo;var Qo="AlertDialogPortal",ct=t=>{const{__scopeAlertDialog:o,...n}=t,i=oe(o);return e.jsx(co,{...i,...n})};ct.displayName=Qo;var Jo="AlertDialogOverlay",dt=l.forwardRef((t,o)=>{const{__scopeAlertDialog:n,...i}=t,c=oe(n);return e.jsx(uo,{...c,...i,ref:o})});dt.displayName=Jo;var pe="AlertDialogContent",[en,tn]=Yo(pe),on=no("AlertDialogContent"),ut=l.forwardRef((t,o)=>{const{__scopeAlertDialog:n,children:i,...c}=t,p=oe(n),s=l.useRef(null),d=U(o,s),h=l.useRef(null);return e.jsx(ro,{contentName:pe,titleName:pt,docsSlug:"alert-dialog",children:e.jsx(en,{scope:n,cancelRef:h,children:e.jsxs(ao,{role:"alertdialog",...p,...c,ref:d,onOpenAutoFocus:k(c.onOpenAutoFocus,f=>{f.preventDefault(),h.current?.focus({preventScroll:!0})}),onPointerDownOutside:f=>f.preventDefault(),onInteractOutside:f=>f.preventDefault(),children:[e.jsx(on,{children:i}),e.jsx(sn,{contentRef:s})]})})})});ut.displayName=pe;var pt="AlertDialogTitle",mt=l.forwardRef((t,o)=>{const{__scopeAlertDialog:n,...i}=t,c=oe(n);return e.jsx(lo,{...c,...i,ref:o})});mt.displayName=pt;var ht="AlertDialogDescription",ft=l.forwardRef((t,o)=>{const{__scopeAlertDialog:n,...i}=t,c=oe(n);return e.jsx(io,{...c,...i,ref:o})});ft.displayName=ht;var nn="AlertDialogAction",xt=l.forwardRef((t,o)=>{const{__scopeAlertDialog:n,...i}=t,c=oe(n);return e.jsx(ot,{...c,...i,ref:o})});xt.displayName=nn;var gt="AlertDialogCancel",vt=l.forwardRef((t,o)=>{const{__scopeAlertDialog:n,...i}=t,{cancelRef:c}=tn(gt,n),p=oe(n),s=U(o,c);return e.jsx(ot,{...p,...i,ref:s})});vt.displayName=gt;var sn=({contentRef:t})=>{const o=`\`${pe}\` requires a description for the component to be accessible for screen reader users.
|
|
3
|
-
|
|
4
|
-
You can add a description to the \`${pe}\` by passing a \`${ht}\` component as a child, which also benefits sighted users by adding visible context to the dialog.
|
|
5
|
-
|
|
6
|
-
Alternatively, you can use your own component as a description by assigning it an \`id\` and passing the same value to the \`aria-describedby\` prop in \`${pe}\`. If the description is confusing or duplicative for sighted users, you can use the \`@radix-ui/react-visually-hidden\` primitive as a wrapper around your description component.
|
|
7
|
-
|
|
8
|
-
For more information, see https://radix-ui.com/primitives/docs/components/alert-dialog`;return l.useEffect(()=>{document.getElementById(t.current?.getAttribute("aria-describedby"))||console.warn(o)},[o,t]),null},rn=it,an=ct,ln=dt,cn=ut,dn=xt,un=vt,pn=mt,mn=ft;function St({...t}){return e.jsx(rn,{"data-slot":"alert-dialog",...t})}function hn({...t}){return e.jsx(an,{"data-slot":"alert-dialog-portal",...t})}function fn({className:t,...o}){return e.jsx(ln,{"data-slot":"alert-dialog-overlay",className:T("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),...o})}function Ct({className:t,...o}){return e.jsxs(hn,{children:[e.jsx(fn,{}),e.jsx(cn,{"data-slot":"alert-dialog-content",className:T("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),...o})]})}function wt({className:t,...o}){return e.jsx("div",{"data-slot":"alert-dialog-header",className:T("flex flex-col gap-2 text-center sm:text-left",t),...o})}function yt({className:t,...o}){return e.jsx("div",{"data-slot":"alert-dialog-footer",className:T("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",t),...o})}function bt({className:t,...o}){return e.jsx(pn,{"data-slot":"alert-dialog-title",className:T("text-lg font-semibold",t),...o})}function jt({className:t,...o}){return e.jsx(mn,{"data-slot":"alert-dialog-description",className:T("text-muted-foreground text-sm",t),...o})}function Nt({className:t,...o}){return e.jsx(dn,{className:T(st(),t),...o})}function It({className:t,...o}){return e.jsx(un,{className:T(st({variant:"outline"}),t),...o})}function et(t,[o,n]){return Math.min(n,Math.max(o,t))}function xn(t){const o=t+"CollectionProvider",[n,i]=We(o),[c,p]=n(o,{collectionRef:{current:null},itemMap:new Map}),s=x=>{const{scope:S,children:j}=x,g=$.useRef(null),C=$.useRef(new Map).current;return e.jsx(c,{scope:S,itemMap:C,collectionRef:g,children:j})};s.displayName=o;const d=t+"CollectionSlot",h=Pe(d),f=$.forwardRef((x,S)=>{const{scope:j,children:g}=x,C=p(d,j),A=U(S,C.collectionRef);return e.jsx(h,{ref:A,children:g})});f.displayName=d;const w=t+"CollectionItemSlot",b="data-radix-collection-item",N=Pe(w),E=$.forwardRef((x,S)=>{const{scope:j,children:g,...C}=x,A=$.useRef(null),V=U(S,A),v=p(w,j);return $.useEffect(()=>(v.itemMap.set(A,{ref:A,...C}),()=>{v.itemMap.delete(A)})),e.jsx(N,{[b]:"",ref:V,children:g})});E.displayName=w;function _(x){const S=p(t+"CollectionConsumer",x);return $.useCallback(()=>{const g=S.collectionRef.current;if(!g)return[];const C=Array.from(g.querySelectorAll(`[${b}]`));return Array.from(S.itemMap.values()).sort((v,P)=>C.indexOf(v.ref.current)-C.indexOf(P.ref.current))},[S.collectionRef,S.itemMap])}return[{Provider:s,Slot:f,ItemSlot:E},_,i]}var gn=l.createContext(void 0);function vn(t){const o=l.useContext(gn);return t||o||"ltr"}var Sn=[" ","Enter","ArrowUp","ArrowDown"],Cn=[" ","Enter"],ce="Select",[je,Ne,wn]=xn(ce),[he]=We(ce,[wn,nt]),Ie=nt(),[yn,se]=he(ce),[bn,jn]=he(ce),_t=t=>{const{__scopeSelect:o,children:n,open:i,defaultOpen:c,onOpenChange:p,value:s,defaultValue:d,onValueChange:h,dir:f,name:w,autoComplete:b,disabled:N,required:E,form:_}=t,x=Ie(o),[S,j]=l.useState(null),[g,C]=l.useState(null),[A,V]=l.useState(!1),v=vn(f),[P,W]=Ye({prop:i,defaultProp:c??!1,onChange:p,caller:ce}),[ee,te]=Ye({prop:s,defaultProp:d,onChange:h,caller:ce}),Y=l.useRef(null),z=S?_||!!S.closest("form"):!0,[X,Z]=l.useState(new Set),H=Array.from(X).map(M=>M.props.value).join(";");return e.jsx(mo,{...x,children:e.jsxs(yn,{required:E,scope:o,trigger:S,onTriggerChange:j,valueNode:g,onValueNodeChange:C,valueNodeHasChildren:A,onValueNodeHasChildrenChange:V,contentId:Ke(),value:ee,onValueChange:te,open:P,onOpenChange:W,dir:v,triggerPointerDownPosRef:Y,disabled:N,children:[e.jsx(je.Provider,{scope:o,children:e.jsx(bn,{scope:t.__scopeSelect,onNativeOptionAdd:l.useCallback(M=>{Z(r=>new Set(r).add(M))},[]),onNativeOptionRemove:l.useCallback(M=>{Z(r=>{const a=new Set(r);return a.delete(M),a})},[]),children:n})}),z?e.jsxs(Xt,{"aria-hidden":!0,required:E,tabIndex:-1,name:w,autoComplete:b,value:ee,onChange:M=>te(M.target.value),disabled:N,form:_,children:[ee===void 0?e.jsx("option",{value:""}):null,Array.from(X)]},H):null]})})};_t.displayName=ce;var Et="SelectTrigger",Rt=l.forwardRef((t,o)=>{const{__scopeSelect:n,disabled:i=!1,...c}=t,p=Ie(n),s=se(Et,n),d=s.disabled||i,h=U(o,s.onTriggerChange),f=Ne(n),w=l.useRef("touch"),[b,N,E]=Qt(x=>{const S=f().filter(C=>!C.disabled),j=S.find(C=>C.value===s.value),g=Jt(S,x,j);g!==void 0&&s.onValueChange(g.value)}),_=x=>{d||(s.onOpenChange(!0),E()),x&&(s.triggerPointerDownPosRef.current={x:Math.round(x.pageX),y:Math.round(x.pageY)})};return e.jsx(fo,{asChild:!0,...p,children:e.jsx(q.button,{type:"button",role:"combobox","aria-controls":s.contentId,"aria-expanded":s.open,"aria-required":s.required,"aria-autocomplete":"none",dir:s.dir,"data-state":s.open?"open":"closed",disabled:d,"data-disabled":d?"":void 0,"data-placeholder":Zt(s.value)?"":void 0,...c,ref:h,onClick:k(c.onClick,x=>{x.currentTarget.focus(),w.current!=="mouse"&&_(x)}),onPointerDown:k(c.onPointerDown,x=>{w.current=x.pointerType;const S=x.target;S.hasPointerCapture(x.pointerId)&&S.releasePointerCapture(x.pointerId),x.button===0&&x.ctrlKey===!1&&x.pointerType==="mouse"&&(_(x),x.preventDefault())}),onKeyDown:k(c.onKeyDown,x=>{const S=b.current!=="";!(x.ctrlKey||x.altKey||x.metaKey)&&x.key.length===1&&N(x.key),!(S&&x.key===" ")&&Sn.includes(x.key)&&(_(),x.preventDefault())})})})});Rt.displayName=Et;var Dt="SelectValue",Tt=l.forwardRef((t,o)=>{const{__scopeSelect:n,className:i,style:c,children:p,placeholder:s="",...d}=t,h=se(Dt,n),{onValueNodeHasChildrenChange:f}=h,w=p!==void 0,b=U(o,h.onValueNodeChange);return ne(()=>{f(w)},[f,w]),e.jsx(q.span,{...d,ref:b,style:{pointerEvents:"none"},children:Zt(h.value)?e.jsx(e.Fragment,{children:s}):p})});Tt.displayName=Dt;var Nn="SelectIcon",At=l.forwardRef((t,o)=>{const{__scopeSelect:n,children:i,...c}=t;return e.jsx(q.span,{"aria-hidden":!0,...c,ref:o,children:i||"▼"})});At.displayName=Nn;var In="SelectPortal",Pt=t=>e.jsx(xo,{asChild:!0,...t});Pt.displayName=In;var de="SelectContent",Mt=l.forwardRef((t,o)=>{const n=se(de,t.__scopeSelect),[i,c]=l.useState();if(ne(()=>{c(new DocumentFragment)},[]),!n.open){const p=i;return p?rt.createPortal(e.jsx(Ot,{scope:t.__scopeSelect,children:e.jsx(je.Slot,{scope:t.__scopeSelect,children:e.jsx("div",{children:t.children})})}),p):null}return e.jsx(Lt,{...t,ref:o})});Mt.displayName=de;var J=10,[Ot,re]=he(de),_n="SelectContentImpl",En=Pe("SelectContent.RemoveScroll"),Lt=l.forwardRef((t,o)=>{const{__scopeSelect:n,position:i="item-aligned",onCloseAutoFocus:c,onEscapeKeyDown:p,onPointerDownOutside:s,side:d,sideOffset:h,align:f,alignOffset:w,arrowPadding:b,collisionBoundary:N,collisionPadding:E,sticky:_,hideWhenDetached:x,avoidCollisions:S,...j}=t,g=se(de,n),[C,A]=l.useState(null),[V,v]=l.useState(null),P=U(o,y=>A(y)),[W,ee]=l.useState(null),[te,Y]=l.useState(null),z=Ne(n),[X,Z]=l.useState(!1),H=l.useRef(!1);l.useEffect(()=>{if(C)return vo(C)},[C]),So();const M=l.useCallback(y=>{const[O,...K]=z().map(L=>L.ref.current),[R]=K.slice(-1),D=document.activeElement;for(const L of y)if(L===D||(L?.scrollIntoView({block:"nearest"}),L===O&&V&&(V.scrollTop=0),L===R&&V&&(V.scrollTop=V.scrollHeight),L?.focus(),document.activeElement!==D))return},[z,V]),r=l.useCallback(()=>M([W,C]),[M,W,C]);l.useEffect(()=>{X&&r()},[X,r]);const{onOpenChange:a,triggerPointerDownPosRef:m}=g;l.useEffect(()=>{if(C){let y={x:0,y:0};const O=R=>{y={x:Math.abs(Math.round(R.pageX)-(m.current?.x??0)),y:Math.abs(Math.round(R.pageY)-(m.current?.y??0))}},K=R=>{y.x<=10&&y.y<=10?R.preventDefault():C.contains(R.target)||a(!1),document.removeEventListener("pointermove",O),m.current=null};return m.current!==null&&(document.addEventListener("pointermove",O),document.addEventListener("pointerup",K,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",O),document.removeEventListener("pointerup",K,{capture:!0})}}},[C,a,m]),l.useEffect(()=>{const y=()=>a(!1);return window.addEventListener("blur",y),window.addEventListener("resize",y),()=>{window.removeEventListener("blur",y),window.removeEventListener("resize",y)}},[a]);const[u,F]=Qt(y=>{const O=z().filter(D=>!D.disabled),K=O.find(D=>D.ref.current===document.activeElement),R=Jt(O,y,K);R&&setTimeout(()=>R.ref.current.focus())}),Q=l.useCallback((y,O,K)=>{const R=!H.current&&!K;(g.value!==void 0&&g.value===O||R)&&(ee(y),R&&(H.current=!0))},[g.value]),I=l.useCallback(()=>C?.focus(),[C]),B=l.useCallback((y,O,K)=>{const R=!H.current&&!K;(g.value!==void 0&&g.value===O||R)&&Y(y)},[g.value]),ue=i==="popper"?Oe:kt,fe=ue===Oe?{side:d,sideOffset:h,align:f,alignOffset:w,arrowPadding:b,collisionBoundary:N,collisionPadding:E,sticky:_,hideWhenDetached:x,avoidCollisions:S}:{};return e.jsx(Ot,{scope:n,content:C,viewport:V,onViewportChange:v,itemRefCallback:Q,selectedItem:W,onItemLeave:I,itemTextRefCallback:B,focusSelectedItem:r,selectedItemText:te,position:i,isPositioned:X,searchRef:u,children:e.jsx(Co,{as:En,allowPinchZoom:!0,children:e.jsx(wo,{asChild:!0,trapped:g.open,onMountAutoFocus:y=>{y.preventDefault()},onUnmountAutoFocus:k(c,y=>{g.trigger?.focus({preventScroll:!0}),y.preventDefault()}),children:e.jsx(yo,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:p,onPointerDownOutside:s,onFocusOutside:y=>y.preventDefault(),onDismiss:()=>g.onOpenChange(!1),children:e.jsx(ue,{role:"listbox",id:g.contentId,"data-state":g.open?"open":"closed",dir:g.dir,onContextMenu:y=>y.preventDefault(),...j,...fe,onPlaced:()=>Z(!0),ref:P,style:{display:"flex",flexDirection:"column",outline:"none",...j.style},onKeyDown:k(j.onKeyDown,y=>{const O=y.ctrlKey||y.altKey||y.metaKey;if(y.key==="Tab"&&y.preventDefault(),!O&&y.key.length===1&&F(y.key),["ArrowUp","ArrowDown","Home","End"].includes(y.key)){let R=z().filter(D=>!D.disabled).map(D=>D.ref.current);if(["ArrowUp","End"].includes(y.key)&&(R=R.slice().reverse()),["ArrowUp","ArrowDown"].includes(y.key)){const D=y.target,L=R.indexOf(D);R=R.slice(L+1)}setTimeout(()=>M(R)),y.preventDefault()}})})})})})})});Lt.displayName=_n;var Rn="SelectItemAlignedPosition",kt=l.forwardRef((t,o)=>{const{__scopeSelect:n,onPlaced:i,...c}=t,p=se(de,n),s=re(de,n),[d,h]=l.useState(null),[f,w]=l.useState(null),b=U(o,P=>w(P)),N=Ne(n),E=l.useRef(!1),_=l.useRef(!0),{viewport:x,selectedItem:S,selectedItemText:j,focusSelectedItem:g}=s,C=l.useCallback(()=>{if(p.trigger&&p.valueNode&&d&&f&&x&&S&&j){const P=p.trigger.getBoundingClientRect(),W=f.getBoundingClientRect(),ee=p.valueNode.getBoundingClientRect(),te=j.getBoundingClientRect();if(p.dir!=="rtl"){const D=te.left-W.left,L=ee.left-D,ae=P.left-L,le=P.width+ae,_e=Math.max(le,W.width),Ee=window.innerWidth-J,Re=et(L,[J,Math.max(J,Ee-_e)]);d.style.minWidth=le+"px",d.style.left=Re+"px"}else{const D=W.right-te.right,L=window.innerWidth-ee.right-D,ae=window.innerWidth-P.right-L,le=P.width+ae,_e=Math.max(le,W.width),Ee=window.innerWidth-J,Re=et(L,[J,Math.max(J,Ee-_e)]);d.style.minWidth=le+"px",d.style.right=Re+"px"}const Y=N(),z=window.innerHeight-J*2,X=x.scrollHeight,Z=window.getComputedStyle(f),H=parseInt(Z.borderTopWidth,10),M=parseInt(Z.paddingTop,10),r=parseInt(Z.borderBottomWidth,10),a=parseInt(Z.paddingBottom,10),m=H+M+X+a+r,u=Math.min(S.offsetHeight*5,m),F=window.getComputedStyle(x),Q=parseInt(F.paddingTop,10),I=parseInt(F.paddingBottom,10),B=P.top+P.height/2-J,ue=z-B,fe=S.offsetHeight/2,y=S.offsetTop+fe,O=H+M+y,K=m-O;if(O<=B){const D=Y.length>0&&S===Y[Y.length-1].ref.current;d.style.bottom="0px";const L=f.clientHeight-x.offsetTop-x.offsetHeight,ae=Math.max(ue,fe+(D?I:0)+L+r),le=O+ae;d.style.height=le+"px"}else{const D=Y.length>0&&S===Y[0].ref.current;d.style.top="0px";const ae=Math.max(B,H+x.offsetTop+(D?Q:0)+fe)+K;d.style.height=ae+"px",x.scrollTop=O-B+x.offsetTop}d.style.margin=`${J}px 0`,d.style.minHeight=u+"px",d.style.maxHeight=z+"px",i?.(),requestAnimationFrame(()=>E.current=!0)}},[N,p.trigger,p.valueNode,d,f,x,S,j,p.dir,i]);ne(()=>C(),[C]);const[A,V]=l.useState();ne(()=>{f&&V(window.getComputedStyle(f).zIndex)},[f]);const v=l.useCallback(P=>{P&&_.current===!0&&(C(),g?.(),_.current=!1)},[C,g]);return e.jsx(Tn,{scope:n,contentWrapper:d,shouldExpandOnScrollRef:E,onScrollButtonChange:v,children:e.jsx("div",{ref:h,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:A},children:e.jsx(q.div,{...c,ref:b,style:{boxSizing:"border-box",maxHeight:"100%",...c.style}})})})});kt.displayName=Rn;var Dn="SelectPopperPosition",Oe=l.forwardRef((t,o)=>{const{__scopeSelect:n,align:i="start",collisionPadding:c=J,...p}=t,s=Ie(n);return e.jsx(bo,{...s,...p,ref:o,align:i,collisionPadding:c,style:{boxSizing:"border-box",...p.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});Oe.displayName=Dn;var[Tn,Ge]=he(de,{}),Le="SelectViewport",$t=l.forwardRef((t,o)=>{const{__scopeSelect:n,nonce:i,...c}=t,p=re(Le,n),s=Ge(Le,n),d=U(o,p.onViewportChange),h=l.useRef(0);return e.jsxs(e.Fragment,{children:[e.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:i}),e.jsx(je.Slot,{scope:n,children:e.jsx(q.div,{"data-radix-select-viewport":"",role:"presentation",...c,ref:d,style:{position:"relative",flex:1,overflow:"hidden auto",...c.style},onScroll:k(c.onScroll,f=>{const w=f.currentTarget,{contentWrapper:b,shouldExpandOnScrollRef:N}=s;if(N?.current&&b){const E=Math.abs(h.current-w.scrollTop);if(E>0){const _=window.innerHeight-J*2,x=parseFloat(b.style.minHeight),S=parseFloat(b.style.height),j=Math.max(x,S);if(j<_){const g=j+E,C=Math.min(_,g),A=g-C;b.style.height=C+"px",b.style.bottom==="0px"&&(w.scrollTop=A>0?A:0,b.style.justifyContent="flex-end")}}}h.current=w.scrollTop})})})]})});$t.displayName=Le;var Vt="SelectGroup",[An,Pn]=he(Vt),Mn=l.forwardRef((t,o)=>{const{__scopeSelect:n,...i}=t,c=Ke();return e.jsx(An,{scope:n,id:c,children:e.jsx(q.div,{role:"group","aria-labelledby":c,...i,ref:o})})});Mn.displayName=Vt;var Ft="SelectLabel",On=l.forwardRef((t,o)=>{const{__scopeSelect:n,...i}=t,c=Pn(Ft,n);return e.jsx(q.div,{id:c.id,...i,ref:o})});On.displayName=Ft;var be="SelectItem",[Ln,Bt]=he(be),zt=l.forwardRef((t,o)=>{const{__scopeSelect:n,value:i,disabled:c=!1,textValue:p,...s}=t,d=se(be,n),h=re(be,n),f=d.value===i,[w,b]=l.useState(p??""),[N,E]=l.useState(!1),_=U(o,g=>h.itemRefCallback?.(g,i,c)),x=Ke(),S=l.useRef("touch"),j=()=>{c||(d.onValueChange(i),d.onOpenChange(!1))};if(i==="")throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return e.jsx(Ln,{scope:n,value:i,disabled:c,textId:x,isSelected:f,onItemTextChange:l.useCallback(g=>{b(C=>C||(g?.textContent??"").trim())},[]),children:e.jsx(je.ItemSlot,{scope:n,value:i,disabled:c,textValue:w,children:e.jsx(q.div,{role:"option","aria-labelledby":x,"data-highlighted":N?"":void 0,"aria-selected":f&&N,"data-state":f?"checked":"unchecked","aria-disabled":c||void 0,"data-disabled":c?"":void 0,tabIndex:c?void 0:-1,...s,ref:_,onFocus:k(s.onFocus,()=>E(!0)),onBlur:k(s.onBlur,()=>E(!1)),onClick:k(s.onClick,()=>{S.current!=="mouse"&&j()}),onPointerUp:k(s.onPointerUp,()=>{S.current==="mouse"&&j()}),onPointerDown:k(s.onPointerDown,g=>{S.current=g.pointerType}),onPointerMove:k(s.onPointerMove,g=>{S.current=g.pointerType,c?h.onItemLeave?.():S.current==="mouse"&&g.currentTarget.focus({preventScroll:!0})}),onPointerLeave:k(s.onPointerLeave,g=>{g.currentTarget===document.activeElement&&h.onItemLeave?.()}),onKeyDown:k(s.onKeyDown,g=>{h.searchRef?.current!==""&&g.key===" "||(Cn.includes(g.key)&&j(),g.key===" "&&g.preventDefault())})})})})});zt.displayName=be;var ge="SelectItemText",Ht=l.forwardRef((t,o)=>{const{__scopeSelect:n,className:i,style:c,...p}=t,s=se(ge,n),d=re(ge,n),h=Bt(ge,n),f=jn(ge,n),[w,b]=l.useState(null),N=U(o,j=>b(j),h.onItemTextChange,j=>d.itemTextRefCallback?.(j,h.value,h.disabled)),E=w?.textContent,_=l.useMemo(()=>e.jsx("option",{value:h.value,disabled:h.disabled,children:E},h.value),[h.disabled,h.value,E]),{onNativeOptionAdd:x,onNativeOptionRemove:S}=f;return ne(()=>(x(_),()=>S(_)),[x,S,_]),e.jsxs(e.Fragment,{children:[e.jsx(q.span,{id:h.textId,...p,ref:N}),h.isSelected&&s.valueNode&&!s.valueNodeHasChildren?rt.createPortal(p.children,s.valueNode):null]})});Ht.displayName=ge;var Ut="SelectItemIndicator",Wt=l.forwardRef((t,o)=>{const{__scopeSelect:n,...i}=t;return Bt(Ut,n).isSelected?e.jsx(q.span,{"aria-hidden":!0,...i,ref:o}):null});Wt.displayName=Ut;var ke="SelectScrollUpButton",Kt=l.forwardRef((t,o)=>{const n=re(ke,t.__scopeSelect),i=Ge(ke,t.__scopeSelect),[c,p]=l.useState(!1),s=U(o,i.onScrollButtonChange);return ne(()=>{if(n.viewport&&n.isPositioned){let d=function(){const f=h.scrollTop>0;p(f)};const h=n.viewport;return d(),h.addEventListener("scroll",d),()=>h.removeEventListener("scroll",d)}},[n.viewport,n.isPositioned]),c?e.jsx(Gt,{...t,ref:s,onAutoScroll:()=>{const{viewport:d,selectedItem:h}=n;d&&h&&(d.scrollTop=d.scrollTop-h.offsetHeight)}}):null});Kt.displayName=ke;var $e="SelectScrollDownButton",qt=l.forwardRef((t,o)=>{const n=re($e,t.__scopeSelect),i=Ge($e,t.__scopeSelect),[c,p]=l.useState(!1),s=U(o,i.onScrollButtonChange);return ne(()=>{if(n.viewport&&n.isPositioned){let d=function(){const f=h.scrollHeight-h.clientHeight,w=Math.ceil(h.scrollTop)<f;p(w)};const h=n.viewport;return d(),h.addEventListener("scroll",d),()=>h.removeEventListener("scroll",d)}},[n.viewport,n.isPositioned]),c?e.jsx(Gt,{...t,ref:s,onAutoScroll:()=>{const{viewport:d,selectedItem:h}=n;d&&h&&(d.scrollTop=d.scrollTop+h.offsetHeight)}}):null});qt.displayName=$e;var Gt=l.forwardRef((t,o)=>{const{__scopeSelect:n,onAutoScroll:i,...c}=t,p=re("SelectScrollButton",n),s=l.useRef(null),d=Ne(n),h=l.useCallback(()=>{s.current!==null&&(window.clearInterval(s.current),s.current=null)},[]);return l.useEffect(()=>()=>h(),[h]),ne(()=>{d().find(w=>w.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[d]),e.jsx(q.div,{"aria-hidden":!0,...c,ref:o,style:{flexShrink:0,...c.style},onPointerDown:k(c.onPointerDown,()=>{s.current===null&&(s.current=window.setInterval(i,50))}),onPointerMove:k(c.onPointerMove,()=>{p.onItemLeave?.(),s.current===null&&(s.current=window.setInterval(i,50))}),onPointerLeave:k(c.onPointerLeave,()=>{h()})})}),kn="SelectSeparator",Yt=l.forwardRef((t,o)=>{const{__scopeSelect:n,...i}=t;return e.jsx(q.div,{"aria-hidden":!0,...i,ref:o})});Yt.displayName=kn;var Ve="SelectArrow",$n=l.forwardRef((t,o)=>{const{__scopeSelect:n,...i}=t,c=Ie(n),p=se(Ve,n),s=re(Ve,n);return p.open&&s.position==="popper"?e.jsx(jo,{...c,...i,ref:o}):null});$n.displayName=Ve;var Vn="SelectBubbleInput",Xt=l.forwardRef(({__scopeSelect:t,value:o,...n},i)=>{const c=l.useRef(null),p=U(i,c),s=Do(o);return l.useEffect(()=>{const d=c.current;if(!d)return;const h=window.HTMLSelectElement.prototype,w=Object.getOwnPropertyDescriptor(h,"value").set;if(s!==o&&w){const b=new Event("change",{bubbles:!0});w.call(d,o),d.dispatchEvent(b)}},[s,o]),e.jsx(q.select,{...n,style:{...ho,...n.style},ref:p,defaultValue:o})});Xt.displayName=Vn;function Zt(t){return t===""||t===void 0}function Qt(t){const o=go(t),n=l.useRef(""),i=l.useRef(0),c=l.useCallback(s=>{const d=n.current+s;o(d),(function h(f){n.current=f,window.clearTimeout(i.current),f!==""&&(i.current=window.setTimeout(()=>h(""),1e3))})(d)},[o]),p=l.useCallback(()=>{n.current="",window.clearTimeout(i.current)},[]);return l.useEffect(()=>()=>window.clearTimeout(i.current),[]),[n,c,p]}function Jt(t,o,n){const c=o.length>1&&Array.from(o).every(f=>f===o[0])?o[0]:o,p=n?t.indexOf(n):-1;let s=Fn(t,Math.max(p,0));c.length===1&&(s=s.filter(f=>f!==n));const h=s.find(f=>f.textValue.toLowerCase().startsWith(c.toLowerCase()));return h!==n?h:void 0}function Fn(t,o){return t.map((n,i)=>t[(o+i)%t.length])}var Bn=_t,zn=Rt,Hn=Tt,Un=At,Wn=Pt,Kn=Mt,qn=$t,Gn=zt,Yn=Ht,Xn=Wt,Zn=Kt,Qn=qt,_s=Yt;function Fe({...t}){return e.jsx(Bn,{"data-slot":"select",...t})}function Be({...t}){return e.jsx(Hn,{"data-slot":"select-value",...t})}function ze({className:t,size:o="default",children:n,...i}){return e.jsxs(zn,{"data-slot":"select-trigger","data-size":o,className:T("border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",t),...i,children:[n,e.jsx(Un,{asChild:!0,children:e.jsx(at,{className:"size-4 opacity-50"})})]})}function He({className:t,children:o,position:n="popper",...i}){return e.jsx(Wn,{children:e.jsxs(Kn,{"data-slot":"select-content",className:T("bg-popover text-popover-foreground 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 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 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md",n==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:n,...i,children:[e.jsx(Jn,{}),e.jsx(qn,{className:T("p-1",n==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:o}),e.jsx(es,{})]})})}function Ue({className:t,children:o,...n}){return e.jsxs(Gn,{"data-slot":"select-item",className:T("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",t),...n,children:[e.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:e.jsx(Xn,{children:e.jsx(Mo,{className:"size-4"})})}),e.jsx(Yn,{children:o})]})}function Jn({className:t,...o}){return e.jsx(Zn,{"data-slot":"select-scroll-up-button",className:T("flex cursor-default items-center justify-center py-1",t),...o,children:e.jsx(Ho,{className:"size-4"})})}function es({className:t,...o}){return e.jsx(Qn,{"data-slot":"select-scroll-down-button",className:T("flex cursor-default items-center justify-center py-1",t),...o,children:e.jsx(at,{className:"size-4"})})}function ts({hasUnsavedChanges:t,title:o="Unsaved Changes",description:n="You have unsaved changes. Are you sure you want to leave this page? Your changes will be lost.",stayButtonText:i="Stay on Page",leaveButtonText:c="Leave Page"}){const p=eo(({currentLocation:w,nextLocation:b})=>t&&w.pathname!==b.pathname),[s,d]=l.useState(!1),h=()=>{p.state==="blocked"&&p.proceed()},f=()=>{p.state==="blocked"&&p.reset()};return l.useEffect(()=>{d(p.state==="blocked")},[p.state,s]),l.useEffect(()=>{const w=b=>{t&&(b.preventDefault(),b.returnValue="")};return t&&window.addEventListener("beforeunload",w),()=>{window.removeEventListener("beforeunload",w)}},[t]),e.jsx(St,{open:s,onOpenChange:d,children:e.jsxs(Ct,{children:[e.jsxs(wt,{children:[e.jsx(bt,{children:o}),e.jsx(jt,{children:n})]}),e.jsxs(yt,{children:[e.jsx(It,{onClick:f,children:i}),e.jsx(Nt,{onClick:h,children:c})]})]})})}const os=({field:t,value:o,resolvedChoices:n,key:i,hasMinMax:c})=>{const p=t.value?String(t.value).split(",").map(s=>s.trim()).filter(Boolean):[];return e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("div",{className:"flex flex-wrap gap-2 min-h-[38px] p-2 border rounded-md bg-background",children:p.length>0?p.map(s=>e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 rounded-md text-sm font-medium bg-gray-100 text-black-800",children:[s,e.jsxs("button",{type:"button",onClick:()=>{const d=p.filter(h=>h!==s);t.onChange(d.join(","))},className:"hover:bg-gray-200 rounded-sm p-0.5",children:[e.jsx(Me,{size:14}),e.jsxs("span",{className:"sr-only",children:["Remove ",s]})]})]},s)):e.jsx("span",{className:"text-muted-foreground text-sm",children:o.placeholder??"Select items..."})}),(!o.maxSelectedChoices||p.length<o.maxSelectedChoices)&&e.jsxs(Fe,{value:"",onValueChange:s=>{const d=p;d.includes(s)||t.onChange([...d,s].join(","))},children:[e.jsx(ze,{id:i,className:"w-full",children:e.jsx(Be,{placeholder:"Add item..."})}),e.jsx(He,{children:n.filter(s=>!p.includes(s)).map(s=>e.jsx(Ue,{value:s,children:s},s))})]}),c&&e.jsxs("span",{className:T("text-xs",o.minSelectedChoices&&p.length<o.minSelectedChoices?"text-destructive":"text-muted-foreground"),children:[p.length,o.minSelectedChoices&&o.maxSelectedChoices?`/${o.maxSelectedChoices} (min ${o.minSelectedChoices})`:o.minSelectedChoices?` selected (min ${o.minSelectedChoices})`:`/${o.maxSelectedChoices} selected`]})]})},ns=$.lazy(()=>me(()=>import("./FilePicker-DGseBDOZ.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]))),ss=$.lazy(()=>me(()=>import("./markdownEditor-CZVz5-rL.js"),__vite__mapDeps([17,1,18,2,5,19,20,7,21,12,9,22,23,24,14,6,15,11,25,4,13,26,27]))),rs=$.lazy(()=>me(()=>import("./date-picker-6Pg8PIj8.js"),__vite__mapDeps([28,1,14,7,2,29,9,30,11,23,20,5,19,13,31]))),as=$.lazy(()=>me(()=>import("./datetime-picker-XkOBOVOZ.js"),__vite__mapDeps([32,1,14,7,2,29,9,30,11,23,20,5,19,13,15,31]))),ls=$.lazy(()=>me(()=>import("./URLInput-ATIRZflA.js"),__vite__mapDeps([33,1,15,2,16,9]))),is=$.lazy(()=>me(()=>import("./ColorPicker-kqchGTe4.js"),__vite__mapDeps([34,1])));function Es({itemType:t,fields:o,isSingleton:n,data:i,productionData:c,isNew:p,changedFields:s=[],itemStatus:d}){const h=to(),{hash:f}=oo(),[w]=No(),[b]=Io(),{data:N}=_o(),[E,_]=l.useState(!1),[x,S]=l.useState(null),[j,g]=l.useState(null),C=r=>s.includes(r);l.useEffect(()=>{if(!f)return;const r=f.slice(1),a=document.getElementById(r);a&&(window.scrollTo({top:window.scrollY,behavior:"smooth"}),a.focus())},[f]);const A=l.useMemo(()=>({id:n?"default":i?.id??"",isDraft:String(i?.isDraft??!1),...Object.fromEntries(Object.keys(o).map(r=>{const a=o[r].type,m=i?.[r];return m!=null?a==="boolean"?[r,String(m)]:a==="multiselect"?[r,Array.isArray(m)?m:[m]]:[r,String(m)]:a==="boolean"?[r,"false"]:a==="multiselect"?[r,[]]:[r,""]}))}),[i,o,n]),V=l.useMemo(()=>{const r={id:G().min(1,"ID is required").regex(/^[a-z0-9-]+$/,"ID can only include lowercase letters and numbers"),isDraft:G()};return Object.entries(o).forEach(([a,m])=>{let u;switch(m.type){case"boolean":u=Ze(["true","false"]);break;case"number":u=$o();break;case"url":u=ko("Must be a valid URL");break;case"date":u=G();break;case"datetime":u=G();break;case"color":u=Oo;break;case"select":Ae(m.choicesFixed)?u=G():m.choicesFixed&&m.choicesFixed.length>0?u=Ze(m.choicesFixed):u=G();break;case"multiselect":u=Bo(G()),m.minSelectedChoices&&(u=u.min(m.minSelectedChoices,`${m.displayName} requires at least ${m.minSelectedChoices} selection${m.minSelectedChoices>1?"s":""}`)),m.maxSelectedChoices&&(u=u.max(m.maxSelectedChoices,`${m.displayName} allows maximum ${m.maxSelectedChoices} selection${m.maxSelectedChoices>1?"s":""}`));break;case"string":m.isMultiple?Ae(m.choicesFixed)?u=G():m.choicesFixed&&m.choicesFixed.length>0?u=G():u=G():u=G();break;default:u=G()}m.optional?m.type==="multiselect"?m.minSelectedChoices||(u=u.optional()):u=u.optional().or(Vo("")):m.type==="multiselect"&&!m.minSelectedChoices?u=u.min(1,`${m.displayName} requires at least one selection`):m.type!=="boolean"&&m.type!=="select"&&!(m.type==="string"&&m.isMultiple&&m.choicesFixed)&&(u=u.min(1,`${m.displayName} is required`)),r[a]=u}),Fo(r)},[o]),v=To({resolver:Ao(V),defaultValues:A});l.useEffect(()=>{v.reset(A)},[A,v]),l.useEffect(()=>{if(!v)return;const r=window.location.hash;r&&v.setFocus(r.substring(1))},[v]);const P=$.useCallback(r=>{if(!c){ie.error("Production values are not available.");return}const a=c[r];v.setValue(r,a,{shouldDirty:!0,shouldTouch:!0,shouldValidate:!0}),v.trigger(r),ie.success(`Restored "${o[r]?.displayName??r}" to published value.`)},[c,v,o]),W=$.useCallback(()=>{if(!c){ie.error("Production values are not available.");return}s.length&&(s.forEach(r=>{const a=c[r];v.setValue(r,a,{shouldDirty:!0,shouldTouch:!0,shouldValidate:!0})}),ie.success("Restored modified fields to published values."))},[c,s,v]),ee=$.useCallback(r=>{g(r),S("single"),_(!0)},[]),te=$.useCallback(()=>{g(null),S("all"),_(!0)},[]),Y=$.useCallback(()=>{x==="single"&&j?P(j):x==="all"&&W(),_(!1),S(null),g(null),z(v.getValues(),!1)},[x,j,P,W]);async function z(r,a=!0){const m={...r,isDraft:r.isDraft==="true",type:t};Object.entries(o).forEach(([u,F])=>{F.type==="boolean"&&(m[u]=r[u]==="true")});try{if(p){const B=await w(m).unwrap();a&&ie.success("Item created successfully."),h(`/admin/dashboard/${t}/${B.id}`);return}const u=i?.id,F=m.id,Q=u!==F;if(!u)return;const I=await b({...m,id:u,type:t,newId:Q?F:void 0}).unwrap();if(a&&ie.success("Item updated successfully."),Q){h(`/admin/dashboard/${t}/${I.id}`);return}v.reset(r)}catch(u){u.status===409&&v.setError("id",{type:"manual",message:"An item with this ID already exists."}),ie.error(p?"Failed to create item.":"Failed to update item."),console.error(u)}}l.useEffect(()=>{const r=a=>{(a.ctrlKey||a.metaKey)&&a.key==="s"&&(a.preventDefault(),(v.formState.isDirty||p)&&v.handleSubmit(m=>z(m))())};return document.addEventListener("keydown",r),()=>document.removeEventListener("keydown",r)},[v,p,z]);const X=l.useMemo(()=>Object.entries(o).filter(([,r])=>r.type==="boolean"),[o]),Z=l.useMemo(()=>{const r={};return Object.entries(o).forEach(([a,m])=>{if(m.type==="select"||m.type==="multiselect"||m.type==="string"&&m.isMultiple&&m.choicesFixed){const u=Ae(m.choicesFixed);if(u&&N){const F=N[u];F?r[a]=Object.values(F).map(Q=>Q.id):r[a]=[]}else r[a]=m.choicesFixed||[]}}),r},[o,N]),H="outline outline-1 outline-yellow-400 outline-offset-4 rounded-sm",M=({fieldKey:r})=>e.jsxs("span",{className:"inline-flex items-center gap-1 text-yellow-800 text-xs",children:["(modified)",e.jsxs(ve,{type:"button",variant:"ghost",size:"icon",className:"h-4 w-4",onClick:()=>ee(r),title:"Restore published value",children:[e.jsx(Qe,{size:12,className:"text-black"}),e.jsxs("span",{className:"sr-only",children:["Restore ",r," to production"]})]})]});return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"flex items-center gap-4 mb-4",children:[i&&i.updatedAt&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Last updated:"}),e.jsx("p",{className:"text-sm",children:new Date(i.updatedAt).toLocaleString()})]}),d&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Unpublished status:"}),e.jsx(Ro,{className:T("capitalize",Eo[d]),children:d}),s.length>0&&e.jsxs(ve,{type:"button",variant:"ghost",size:"icon",className:"h-6 w-6",onClick:te,title:"Restore all fields to published values",children:[e.jsx(Qe,{size:14}),e.jsx("span",{className:"sr-only",children:"Restore all modified fields to published values"})]})]})]}),e.jsxs(Po,{...v,children:[e.jsxs("form",{onSubmit:v.handleSubmit(r=>z(r)),className:"space-y-4 max-w-[800px] w-[800px]",children:[e.jsx(Se,{name:"id",control:v.control,rules:{required:!0},render:({field:r})=>e.jsxs(Ce,{id:"id",className:T((i?.id==="default"||n)&&"hidden",C("id")&&H),children:[e.jsxs(xe,{className:"flex gap-1 items-baseline",children:["ID",C("id")&&e.jsx(M,{fieldKey:"id"})]}),e.jsx(we,{children:e.jsx(Te,{placeholder:"item-id",...v.register("id"),...r,value:r.value,onChange:a=>{const m=a.target.value.toLowerCase().replace(/\s+/g,"-").replace(/-+/g,"-").replace(/[^a-z0-9-]/g,"");r.onChange(m)},onBlur:a=>{const m=a.target.value.trim().replace(/^-+|-+$/g,"");r.onChange(m)}})}),e.jsx(ye,{})]})}),e.jsx(Se,{name:"isDraft",control:v.control,render:({field:r})=>e.jsxs(Ce,{id:"isDraft",className:T("flex flex-col items-start",(i?.id==="default"||n)&&"hidden",C("isDraft")&&H),children:[e.jsxs("div",{className:"flex flex-row space-x-2",children:[e.jsx(we,{children:e.jsx(Xe,{id:"isDraft",...v.register("isDraft"),checked:r.value==="true",onCheckedChange:a=>{r.onChange(a===!0?"true":"false")}})}),e.jsxs(xe,{className:"flex gap-1 items-baseline",children:["Draft",C("isDraft")&&e.jsx("span",{className:"text-yellow-600 text-xs",children:e.jsx(M,{fieldKey:"isDraft"})})]})]}),e.jsx(De,{children:"Draft items are not visible on the published site"}),e.jsx(ye,{})]})}),X.length>0&&e.jsxs("div",{className:"flex flex-col gap-3",children:[e.jsx(xe,{children:"Flags"}),e.jsx("div",{className:"flex flex-row flex-wrap gap-4",children:X.map(([r,a])=>e.jsx(Se,{name:r,control:v.control,render:({field:m})=>e.jsxs(Ce,{className:T("flex flex-col items-start",C(r)&&H),children:[e.jsxs("div",{className:"flex flex-row space-x-2",children:[e.jsx(we,{children:e.jsx(Xe,{id:r,...v.register(r),checked:m.value==="true",onCheckedChange:u=>{m.onChange(u===!0?"true":"false")}})}),e.jsxs(xe,{className:"flex gap-1 items-baseline",children:[a.displayName,C(r)&&e.jsx("span",{className:"text-yellow-800 text-xs",children:e.jsx(M,{fieldKey:r})})]})]}),a.displayExtra&&e.jsx(De,{children:a.displayExtra}),e.jsx(ye,{})]})},r))})]}),Object.entries(o).filter(([,r])=>r.type!=="boolean").map(([r,a])=>{const m=Z[r]??[];return e.jsx(Se,{name:r,control:v.control,rules:{required:!a.optional},render:({field:u})=>{const F=u.value?.length??0,Q=(a.type==="multiselect"||a.type==="string"&&a.isMultiple&&a.choicesFixed)&&(a.minSelectedChoices||a.maxSelectedChoices);return e.jsxs(Ce,{id:r,className:T(C(r)&&H),children:[e.jsxs(xe,{className:"flex gap-1 items-baseline",children:[a.displayName,a.optional&&e.jsx("span",{className:"text-gray-400",children:"(optional)"}),C(r)&&e.jsx("span",{className:"text-yellow-600 text-xs",children:e.jsx(M,{fieldKey:r})})]}),e.jsx(we,{children:a.type==="markdown"?e.jsx(ss,{id:r,name:r,register:v.register,className:"h-52",markdown:u.value,onChange:(I,B)=>{B||u.onChange(I)},placeholder:a.placeholder,fieldDisplayName:a.displayName}):a.type==="url"?e.jsx(ls,{id:r,...v.register(r),placeholder:a.placeholder??"https://example.website/",...u,value:u.value}):a.type==="string"&&a.isUploadedFile?e.jsx(ns,{id:r,name:r,register:v.register,value:u.value,onChange:u.onChange}):a.type==="date"?e.jsx(rs,{id:r,...v.register(r),date:u.value?new Date(u.value):void 0,onDateChange:I=>{u.onChange(I?I.toISOString():"")},placeholder:a.placeholder??"Select date",allowClear:a.optional}):a.type==="datetime"?e.jsx("div",{className:"relative",children:e.jsx(as,{id:r,...v.register(r),date:u.value?new Date(u.value):void 0,onDateTimeChange:I=>{u.onChange(I?I.toISOString():"")},placeholder:a.placeholder??"Select date and time",allowClear:a.optional})}):a.type==="color"?e.jsx(is,{id:r,value:u.value,onChange:u.onChange,placeholder:a.placeholder}):a.type==="number"?e.jsx(Te,{id:r,...v.register(r,{valueAsNumber:!0}),type:"number",value:u.value,onChange:u.onChange,placeholder:a.placeholder}):a.type==="select"?e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(Fe,{value:u.value,onValueChange:u.onChange,children:[e.jsx(ze,{id:r,className:"w-full",children:e.jsx(Be,{placeholder:a.placeholder??"Select an item..."})}),e.jsx(He,{children:m.map(I=>e.jsx(Ue,{value:I,children:I},I))})]}),a.optional&&u.value&&e.jsxs(ve,{type:"button",variant:"outline",size:"icon",onClick:()=>u.onChange(""),className:"shrink-0",children:[e.jsx(Me,{size:16}),e.jsx("span",{className:"sr-only",children:"Clear selection"})]})]}):a.type==="multiselect"?e.jsxs("div",{className:"flex flex-col gap-2",children:[e.jsx("div",{className:"flex flex-wrap gap-2 min-h-[38px] p-2 border rounded-md bg-background",children:u.value?.length>0?u.value.map(I=>e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 rounded-md text-sm font-medium bg-gray-100 text-black-800",children:[I,e.jsxs("button",{type:"button",onClick:()=>{const B=u.value.filter(ue=>ue!==I);u.onChange(B)},className:"hover:bg-gray-200 rounded-sm p-0.5",children:[e.jsx(Me,{size:14}),e.jsxs("span",{className:"sr-only",children:["Remove ",I]})]})]},I)):e.jsx("span",{className:"text-muted-foreground text-sm",children:a.placeholder??"Select items..."})}),(!a.maxSelectedChoices||F<a.maxSelectedChoices)&&e.jsxs(Fe,{value:"",onValueChange:I=>{const B=u.value||[];B.includes(I)||u.onChange([...B,I])},children:[e.jsx(ze,{id:r,className:"w-full",children:e.jsx(Be,{placeholder:"Add item..."})}),e.jsx(He,{children:m.filter(I=>!u.value?.includes(I)).map(I=>e.jsx(Ue,{value:I,children:I},I))})]}),Q&&e.jsxs("span",{className:T("text-xs",a.minSelectedChoices&&F<a.minSelectedChoices?"text-destructive":"text-muted-foreground"),children:[F,a.minSelectedChoices&&a.maxSelectedChoices?`/${a.maxSelectedChoices} (min ${a.minSelectedChoices})`:a.minSelectedChoices?` selected (min ${a.minSelectedChoices})`:`/${a.maxSelectedChoices} selected`]})]}):a.type==="string"&&a.isMultiple&&a.choicesFixed?e.jsx(os,{field:u,resolvedChoices:m,value:a,hasMinMax:Q},r):e.jsx(Te,{id:r,...v.register(r),placeholder:a.placeholder,...u,value:u.value})}),a.displayExtra&&e.jsx(De,{children:a.displayExtra}),e.jsx(ye,{})]})}},r)}),e.jsxs(ve,{disabled:!v.formState.isDirty&&!p||v.formState.isSubmitting,type:"submit",children:[v.formState.isSubmitting?e.jsx(Lo,{className:"animate-spin"}):e.jsx(Ko,{}),v.formState.isSubmitting?"Saving":v.watch("isDraft")==="true"?"Save Draft":"Save"]})]}),e.jsx(ts,{hasUnsavedChanges:!v.formState.isSubmitting&&v.formState.isDirty})]}),e.jsx(St,{open:E,onOpenChange:_,children:e.jsxs(Ct,{children:[e.jsxs(wt,{children:[e.jsx(bt,{children:x==="all"?"Restore all modified fields?":"Restore this field?"}),e.jsx(jt,{children:x==="all"?`This will restore ${s.length} modified ${s.length===1?"field":"fields"} to published values.`:`This will restore "${j?o[j]?.displayName??j:"field"}" to its published value.`})]}),e.jsxs(yt,{children:[e.jsx(It,{children:"Cancel"}),e.jsx(Nt,{onClick:Y,children:"Restore"})]})]})})]})}export{Kn as C,Es as I,Wn as P,Bn as R,_s as S,zn as T,Hn as V,Un as a,qn as b,xn as c,Gn as d,Yn as e,vn as u};
|