@isardsat/editorial-admin 6.21.0 → 6.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/client/assets/clear-button-C666rKTW.js +1 -0
- package/build/client/assets/{dashboard-CXsgx-dc.js → dashboard-Crt5fSJe.js} +1 -1
- package/build/client/assets/{dashboard._collection._document-BiIWfKiL.js → dashboard._collection._document-D3XXkcBD.js} +1 -1
- package/build/client/assets/{dashboard._collection.new-PercY47A.js → dashboard._collection.new-rMBf1ZGC.js} +1 -1
- package/build/client/assets/{dashboard._layout-BLI8ZXFq.js → dashboard._layout-DOj1cBNu.js} +1 -1
- package/build/client/assets/date-picker-CqVT8lwM.js +1 -0
- package/build/client/assets/datetime-picker-DemhHfWW.js +1 -0
- package/build/client/assets/{index-DutSppa2.js → index-CW4Lhoah.js} +1 -1
- package/build/client/assets/{index-CU6_POhE.js → index-DRumOFGs.js} +1 -1
- package/build/client/assets/itemForm-DcKqLtr7.js +8 -0
- package/build/client/assets/{manifest-9cecc256.js → manifest-63bbd580.js} +1 -1
- package/build/client/assets/{markdownEditor-CZVz5-rL.js → markdownEditor-D3QMBKBF.js} +4 -4
- package/build/client/assets/root-CvQSRYkS.css +1 -0
- package/build/client/assets/{schemas-D-U8dKAF.js → schemas-BabmyWH6.js} +1 -1
- package/build/client/index.html +2 -2
- package/package.json +2 -2
- package/build/client/assets/clear-button-DehdxgmB.js +0 -1
- package/build/client/assets/date-picker-6Pg8PIj8.js +0 -1
- package/build/client/assets/datetime-picker-XkOBOVOZ.js +0 -1
- package/build/client/assets/index-nnJosT4e.js +0 -1
- package/build/client/assets/itemForm-BLyILW73.js +0 -8
- package/build/client/assets/root-DZYAU5bq.css +0 -1
- /package/build/client/assets/{root-dzmn7V-J.js → root-CqtjpfTE.js} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as s,p}from"./chunk-EPOLDU6W-CiSVlmCe.js";import{c as W,u as $,a as z,b as m,d as H,f as J}from"./index-B5ynPIRP.js";import{u as N}from"./index-CbaefyjV.js";import{d as S,u as Q,e as Z,A as ee,f as te,
|
|
1
|
+
import{a as s,p}from"./chunk-EPOLDU6W-CiSVlmCe.js";import{c as W,u as $,a as z,b as m,d as H,f as J}from"./index-B5ynPIRP.js";import{u as N}from"./index-CbaefyjV.js";import{d as S,u as Q,e as Z,A as ee,f as te,i as oe,k as re,l as ne,n as se}from"./index-CW4Lhoah.js";var[O]=W("Tooltip",[S]),A=S(),G="TooltipProvider",ae=700,D="tooltip.open",[ie,j]=O(G),F=t=>{const{__scopeTooltip:o,delayDuration:e=ae,skipDelayDuration:r=300,disableHoverableContent:n=!1,children:c}=t,i=s.useRef(!0),v=s.useRef(!1),a=s.useRef(0);return s.useEffect(()=>{const d=a.current;return()=>window.clearTimeout(d)},[]),p.jsx(ie,{scope:o,isOpenDelayedRef:i,delayDuration:e,onOpen:s.useCallback(()=>{window.clearTimeout(a.current),i.current=!1},[]),onClose:s.useCallback(()=>{window.clearTimeout(a.current),a.current=window.setTimeout(()=>i.current=!0,r)},[r]),isPointerInTransitRef:v,onPointerInTransitChange:s.useCallback(d=>{v.current=d},[]),disableHoverableContent:n,children:c})};F.displayName=G;var R="Tooltip",[ce,_]=O(R),B=t=>{const{__scopeTooltip:o,children:e,open:r,defaultOpen:n,onOpenChange:c,disableHoverableContent:i,delayDuration:v}=t,a=j(R,t.__scopeTooltip),d=A(o),[l,f]=s.useState(null),h=Q(),u=s.useRef(0),x=i??a.disableHoverableContent,C=v??a.delayDuration,T=s.useRef(!1),[g,y]=$({prop:r,defaultProp:n??!1,onChange:I=>{I?(a.onOpen(),document.dispatchEvent(new CustomEvent(D))):a.onClose(),c?.(I)},caller:R}),w=s.useMemo(()=>g?T.current?"delayed-open":"instant-open":"closed",[g]),P=s.useCallback(()=>{window.clearTimeout(u.current),u.current=0,T.current=!1,y(!0)},[y]),E=s.useCallback(()=>{window.clearTimeout(u.current),u.current=0,y(!1)},[y]),M=s.useCallback(()=>{window.clearTimeout(u.current),u.current=window.setTimeout(()=>{T.current=!0,y(!0),u.current=0},C)},[C,y]);return s.useEffect(()=>()=>{u.current&&(window.clearTimeout(u.current),u.current=0)},[]),p.jsx(Z,{...d,children:p.jsx(ce,{scope:o,contentId:h,open:g,stateAttribute:w,trigger:l,onTriggerChange:f,onTriggerEnter:s.useCallback(()=>{a.isOpenDelayedRef.current?M():P()},[a.isOpenDelayedRef,M,P]),onTriggerLeave:s.useCallback(()=>{x?E():(window.clearTimeout(u.current),u.current=0)},[E,x]),onOpen:P,onClose:E,disableHoverableContent:x,children:e})})};B.displayName=R;var L="TooltipTrigger",U=s.forwardRef((t,o)=>{const{__scopeTooltip:e,...r}=t,n=_(L,e),c=j(L,e),i=A(e),v=s.useRef(null),a=N(o,v,n.onTriggerChange),d=s.useRef(!1),l=s.useRef(!1),f=s.useCallback(()=>d.current=!1,[]);return s.useEffect(()=>()=>document.removeEventListener("pointerup",f),[f]),p.jsx(ee,{asChild:!0,...i,children:p.jsx(z.button,{"aria-describedby":n.open?n.contentId:void 0,"data-state":n.stateAttribute,...r,ref:a,onPointerMove:m(t.onPointerMove,h=>{h.pointerType!=="touch"&&!l.current&&!c.isPointerInTransitRef.current&&(n.onTriggerEnter(),l.current=!0)}),onPointerLeave:m(t.onPointerLeave,()=>{n.onTriggerLeave(),l.current=!1}),onPointerDown:m(t.onPointerDown,()=>{n.open&&n.onClose(),d.current=!0,document.addEventListener("pointerup",f,{once:!0})}),onFocus:m(t.onFocus,()=>{d.current||n.onOpen()}),onBlur:m(t.onBlur,n.onClose),onClick:m(t.onClick,n.onClose)})})});U.displayName=L;var k="TooltipPortal",[le,ue]=O(k,{forceMount:void 0}),V=t=>{const{__scopeTooltip:o,forceMount:e,children:r,container:n}=t,c=_(k,o);return p.jsx(le,{scope:o,forceMount:e,children:p.jsx(H,{present:e||c.open,children:p.jsx(te,{asChild:!0,container:n,children:r})})})};V.displayName=k;var b="TooltipContent",Y=s.forwardRef((t,o)=>{const e=ue(b,t.__scopeTooltip),{forceMount:r=e.forceMount,side:n="top",...c}=t,i=_(b,t.__scopeTooltip);return p.jsx(H,{present:r||i.open,children:i.disableHoverableContent?p.jsx(q,{side:n,...c,ref:o}):p.jsx(pe,{side:n,...c,ref:o})})}),pe=s.forwardRef((t,o)=>{const e=_(b,t.__scopeTooltip),r=j(b,t.__scopeTooltip),n=s.useRef(null),c=N(o,n),[i,v]=s.useState(null),{trigger:a,onClose:d}=e,l=n.current,{onPointerInTransitChange:f}=r,h=s.useCallback(()=>{v(null),f(!1)},[f]),u=s.useCallback((x,C)=>{const T=x.currentTarget,g={x:x.clientX,y:x.clientY},y=he(g,T.getBoundingClientRect()),w=xe(g,y),P=Te(C.getBoundingClientRect()),E=ye([...w,...P]);v(E),f(!0)},[f]);return s.useEffect(()=>()=>h(),[h]),s.useEffect(()=>{if(a&&l){const x=T=>u(T,l),C=T=>u(T,a);return a.addEventListener("pointerleave",x),l.addEventListener("pointerleave",C),()=>{a.removeEventListener("pointerleave",x),l.removeEventListener("pointerleave",C)}}},[a,l,u,h]),s.useEffect(()=>{if(i){const x=C=>{const T=C.target,g={x:C.clientX,y:C.clientY},y=a?.contains(T)||l?.contains(T),w=!Ce(g,i);y?h():w&&(h(),d())};return document.addEventListener("pointermove",x),()=>document.removeEventListener("pointermove",x)}},[a,l,i,d,h]),p.jsx(q,{...t,ref:c})}),[de,fe]=O(R,{isInside:!1}),ve=J("TooltipContent"),q=s.forwardRef((t,o)=>{const{__scopeTooltip:e,children:r,"aria-label":n,onEscapeKeyDown:c,onPointerDownOutside:i,...v}=t,a=_(b,e),d=A(e),{onClose:l}=a;return s.useEffect(()=>(document.addEventListener(D,l),()=>document.removeEventListener(D,l)),[l]),s.useEffect(()=>{if(a.trigger){const f=h=>{h.target?.contains(a.trigger)&&l()};return window.addEventListener("scroll",f,{capture:!0}),()=>window.removeEventListener("scroll",f,{capture:!0})}},[a.trigger,l]),p.jsx(re,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:c,onPointerDownOutside:i,onFocusOutside:f=>f.preventDefault(),onDismiss:l,children:p.jsxs(ne,{"data-state":a.stateAttribute,...d,...v,ref:o,style:{...v.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[p.jsx(ve,{children:r}),p.jsx(de,{scope:e,isInside:!0,children:p.jsx(se,{id:a.contentId,role:"tooltip",children:n||r})})]})})});Y.displayName=b;var X="TooltipArrow",K=s.forwardRef((t,o)=>{const{__scopeTooltip:e,...r}=t,n=A(e);return fe(X,e).isInside?null:p.jsx(oe,{...n,...r,ref:o})});K.displayName=X;function he(t,o){const e=Math.abs(o.top-t.y),r=Math.abs(o.bottom-t.y),n=Math.abs(o.right-t.x),c=Math.abs(o.left-t.x);switch(Math.min(e,r,n,c)){case c:return"left";case n:return"right";case e:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function xe(t,o,e=5){const r=[];switch(o){case"top":r.push({x:t.x-e,y:t.y+e},{x:t.x+e,y:t.y+e});break;case"bottom":r.push({x:t.x-e,y:t.y-e},{x:t.x+e,y:t.y-e});break;case"left":r.push({x:t.x+e,y:t.y-e},{x:t.x+e,y:t.y+e});break;case"right":r.push({x:t.x-e,y:t.y-e},{x:t.x-e,y:t.y+e});break}return r}function Te(t){const{top:o,right:e,bottom:r,left:n}=t;return[{x:n,y:o},{x:e,y:o},{x:e,y:r},{x:n,y:r}]}function Ce(t,o){const{x:e,y:r}=t;let n=!1;for(let c=0,i=o.length-1;c<o.length;i=c++){const v=o[c],a=o[i],d=v.x,l=v.y,f=a.x,h=a.y;l>r!=h>r&&e<(f-d)*(r-l)/(h-l)+d&&(n=!n)}return n}function ye(t){const o=t.slice();return o.sort((e,r)=>e.x<r.x?-1:e.x>r.x?1:e.y<r.y?-1:e.y>r.y?1:0),ge(o)}function ge(t){if(t.length<=1)return t.slice();const o=[];for(let r=0;r<t.length;r++){const n=t[r];for(;o.length>=2;){const c=o[o.length-1],i=o[o.length-2];if((c.x-i.x)*(n.y-i.y)>=(c.y-i.y)*(n.x-i.x))o.pop();else break}o.push(n)}o.pop();const e=[];for(let r=t.length-1;r>=0;r--){const n=t[r];for(;e.length>=2;){const c=e[e.length-1],i=e[e.length-2];if((c.x-i.x)*(n.y-i.y)>=(c.y-i.y)*(n.x-i.x))e.pop();else break}e.push(n)}return e.pop(),o.length===1&&e.length===1&&o[0].x===e[0].x&&o[0].y===e[0].y?o:o.concat(e)}var Ee=F,Re=B,_e=U,Oe=V,Ae=Y,De=K;export{De as A,Ae as C,Ee as P,Re as R,_e as T,Oe as a};
|
|
@@ -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-D3QMBKBF.js","assets/authSlice-DWtXmmFR.js","assets/index-CW4Lhoah.js","assets/index-B5ynPIRP.js","assets/zod-DU3Qlmru.js","assets/schemas-CPJfa6mm.js","assets/index-DRumOFGs.js","assets/schemas-BabmyWH6.js","assets/loader-circle-BDUbeTTe.js","assets/markdownEditor-Dha_UaaS.css","assets/date-picker-CqVT8lwM.js","assets/clear-button-C666rKTW.js","assets/chevron-right-BFlMu-RJ.js","assets/calendar-Frbsxn98.js","assets/datetime-picker-DemhHfWW.js","assets/URLInput-ATIRZflA.js","assets/ColorPicker-kqchGTe4.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{a as n,p as t,R as B,A as br,v as yr,z as jr}from"./chunk-EPOLDU6W-CiSVlmCe.js";import{c as Ge,b as z,f as Nr,P as he,u as at,a as J,d as Ht,g as We,e as me}from"./index-B5ynPIRP.js";import{u as X,a as Fe}from"./index-CbaefyjV.js";import{c as Ut,R as Kt,W as Ir,C as Wt,T as Er,D as Pr,a as qt,P as Gt,O as Yt,b as Rr,u as ue,d as Ye,e as Xt,A as St,f as Zt,h as Jt,g as Qt,i as eo,j as to,F as oo,k as ro,l as no,V as Ar,m as _r}from"./index-CW4Lhoah.js";import{b as so,B as Ne}from"./button-BEFuP7Ru.js";import{b as L,z as Dr,A as Tr,h as Mr,n as Or}from"./utils-B48p8Qal.js";import{B as kr}from"./badge-DTudhbGs.js";import{g as Fr,u as $r,a as Lr,F as Vr,b as ze,c as He,d as Te,e as Ue,f as Ke,C as Nt,h as tt}from"./zod-DU3Qlmru.js";import{c as $e}from"./createLucideIcon-BvSqmaUO.js";import{I as Me}from"./input-C3iFdiD8.js";import{a as ao}from"./index-DLIEpuwL.js";import{C as lo}from"./chevron-down-qxzqwz13.js";import{C as Br}from"./check-DF0ucE8d.js";import{R as zr}from"./schemas-BabmyWH6.js";import{t as we}from"./index-CZSVchcX.js";import{X as lt}from"./x-D6gZWaAR.js";import{L as Hr}from"./loader-circle-BDUbeTTe.js";import{s as ne,_ as It,u as Ur,n as Kr,l as Wr,o as qr,a as Gr}from"./schemas-CPJfa6mm.js";const Yr=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],Xr=$e("chevron-up",Yr);const Zr=[["path",{d:"m7 15 5 5 5-5",key:"1hf1tw"}],["path",{d:"m7 9 5-5 5 5",key:"sgt6xg"}]],Et=$e("chevrons-up-down",Zr);const Jr=[["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"}]],Pt=$e("rotate-ccw",Jr);const Qr=[["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"}]],en=$e("save",Qr);const tn=[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]],on=$e("search",tn);function ot(e){if(!e||e.length!==1)return null;const o=e[0].match(/^\$(.+)$/);return o?o[1]:null}const rn="modulepreload",nn=function(e){return"/"+e},Rt={},Ae=function(o,r,l){let s=Promise.resolve();if(r&&r.length>0){let m=function(p){return Promise.all(p.map(x=>Promise.resolve(x).then(C=>({status:"fulfilled",value:C}),C=>({status:"rejected",reason:C}))))};document.getElementsByTagName("link");const a=document.querySelector("meta[property=csp-nonce]"),d=a?.nonce||a?.getAttribute("nonce");s=m(r.map(p=>{if(p=nn(p),p in Rt)return;Rt[p]=!0;const x=p.endsWith(".css"),C=x?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${p}"]${C}`))return;const N=document.createElement("link");if(N.rel=x?"stylesheet":rn,x||(N.as="script"),N.crossOrigin="",N.href=p,d&&N.setAttribute("nonce",d),document.head.appendChild(N),x)return new Promise((P,D)=>{N.addEventListener("load",P),N.addEventListener("error",()=>D(new Error(`Unable to preload CSS for ${p}`)))})}))}function c(a){const d=new Event("vite:preloadError",{cancelable:!0});if(d.payload=a,window.dispatchEvent(d),!d.defaultPrevented)throw a}return s.then(a=>{for(const d of a||[])d.status==="rejected"&&c(d.reason);return o().catch(c)})};var io="AlertDialog",[sn]=Ge(io,[Ut]),pe=Ut(),co=e=>{const{__scopeAlertDialog:o,...r}=e,l=pe(o);return t.jsx(Kt,{...l,...r,modal:!0})};co.displayName=io;var an="AlertDialogTrigger",ln=n.forwardRef((e,o)=>{const{__scopeAlertDialog:r,...l}=e,s=pe(r);return t.jsx(Rr,{...s,...l,ref:o})});ln.displayName=an;var cn="AlertDialogPortal",uo=e=>{const{__scopeAlertDialog:o,...r}=e,l=pe(o);return t.jsx(Gt,{...l,...r})};uo.displayName=cn;var dn="AlertDialogOverlay",po=n.forwardRef((e,o)=>{const{__scopeAlertDialog:r,...l}=e,s=pe(r);return t.jsx(Yt,{...s,...l,ref:o})});po.displayName=dn;var Pe="AlertDialogContent",[un,pn]=sn(Pe),mn=Nr("AlertDialogContent"),mo=n.forwardRef((e,o)=>{const{__scopeAlertDialog:r,children:l,...s}=e,c=pe(r),a=n.useRef(null),d=X(o,a),m=n.useRef(null);return t.jsx(Ir,{contentName:Pe,titleName:fo,docsSlug:"alert-dialog",children:t.jsx(un,{scope:r,cancelRef:m,children:t.jsxs(Wt,{role:"alertdialog",...c,...s,ref:d,onOpenAutoFocus:z(s.onOpenAutoFocus,p=>{p.preventDefault(),m.current?.focus({preventScroll:!0})}),onPointerDownOutside:p=>p.preventDefault(),onInteractOutside:p=>p.preventDefault(),children:[t.jsx(mn,{children:l}),t.jsx(hn,{contentRef:a})]})})})});mo.displayName=Pe;var fo="AlertDialogTitle",ho=n.forwardRef((e,o)=>{const{__scopeAlertDialog:r,...l}=e,s=pe(r);return t.jsx(Er,{...s,...l,ref:o})});ho.displayName=fo;var go="AlertDialogDescription",xo=n.forwardRef((e,o)=>{const{__scopeAlertDialog:r,...l}=e,s=pe(r);return t.jsx(Pr,{...s,...l,ref:o})});xo.displayName=go;var fn="AlertDialogAction",vo=n.forwardRef((e,o)=>{const{__scopeAlertDialog:r,...l}=e,s=pe(r);return t.jsx(qt,{...s,...l,ref:o})});vo.displayName=fn;var Co="AlertDialogCancel",So=n.forwardRef((e,o)=>{const{__scopeAlertDialog:r,...l}=e,{cancelRef:s}=pn(Co,r),c=pe(r),a=X(o,s);return t.jsx(qt,{...c,...l,ref:a})});So.displayName=Co;var hn=({contentRef:e})=>{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 \`${go}\` 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 n.useEffect(()=>{document.getElementById(e.current?.getAttribute("aria-describedby"))||console.warn(o)},[o,e]),null},gn=co,xn=uo,vn=po,Cn=mo,Sn=vo,wn=So,bn=ho,yn=xo;function wo({...e}){return t.jsx(gn,{"data-slot":"alert-dialog",...e})}function jn({...e}){return t.jsx(xn,{"data-slot":"alert-dialog-portal",...e})}function Nn({className:e,...o}){return t.jsx(vn,{"data-slot":"alert-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",e),...o})}function bo({className:e,...o}){return t.jsxs(jn,{children:[t.jsx(Nn,{}),t.jsx(Cn,{"data-slot":"alert-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",e),...o})]})}function yo({className:e,...o}){return t.jsx("div",{"data-slot":"alert-dialog-header",className:L("flex flex-col gap-2 text-center sm:text-left",e),...o})}function jo({className:e,...o}){return t.jsx("div",{"data-slot":"alert-dialog-footer",className:L("flex flex-col-reverse gap-2 sm:flex-row sm:justify-end",e),...o})}function No({className:e,...o}){return t.jsx(bn,{"data-slot":"alert-dialog-title",className:L("text-lg font-semibold",e),...o})}function Io({className:e,...o}){return t.jsx(yn,{"data-slot":"alert-dialog-description",className:L("text-muted-foreground text-sm",e),...o})}function Eo({className:e,...o}){return t.jsx(Sn,{className:L(so(),e),...o})}function Po({className:e,...o}){return t.jsx(wn,{className:L(so({variant:"outline"}),e),...o})}var At=1,In=.9,En=.8,Pn=.17,rt=.1,nt=.999,Rn=.9999,An=.99,_n=/[\\\/_+.#"@\[\(\{&]/,Dn=/[\\\/_+.#"@\[\(\{&]/g,Tn=/[\s-]/,Ro=/[\s-]/g;function it(e,o,r,l,s,c,a){if(c===o.length)return s===e.length?At:An;var d=`${s},${c}`;if(a[d]!==void 0)return a[d];for(var m=l.charAt(c),p=r.indexOf(m,s),x=0,C,N,P,D;p>=0;)C=it(e,o,r,l,p+1,c+1,a),C>x&&(p===s?C*=At:_n.test(e.charAt(p-1))?(C*=En,P=e.slice(s,p-1).match(Dn),P&&s>0&&(C*=Math.pow(nt,P.length))):Tn.test(e.charAt(p-1))?(C*=In,D=e.slice(s,p-1).match(Ro),D&&s>0&&(C*=Math.pow(nt,D.length))):(C*=Pn,s>0&&(C*=Math.pow(nt,p-s))),e.charAt(p)!==o.charAt(c)&&(C*=Rn)),(C<rt&&r.charAt(p-1)===l.charAt(c+1)||l.charAt(c+1)===l.charAt(c)&&r.charAt(p-1)!==l.charAt(c))&&(N=it(e,o,r,l,p+1,c+2,a),N*rt>C&&(C=N*rt)),C>x&&(x=C),p=r.indexOf(m,p+1);return a[d]=x,x}function _t(e){return e.toLowerCase().replace(Ro," ")}function Mn(e,o,r){return e=r&&r.length>0?`${e+" "+r.join(" ")}`:e,it(e,o,_t(e),_t(o),0,0,{})}var Oe='[cmdk-group=""]',st='[cmdk-group-items=""]',On='[cmdk-group-heading=""]',Ao='[cmdk-item=""]',Dt=`${Ao}:not([aria-disabled="true"])`,ct="cmdk-item-select",Ie="data-value",kn=(e,o,r)=>Mn(e,o,r),_o=n.createContext(void 0),Le=()=>n.useContext(_o),Do=n.createContext(void 0),wt=()=>n.useContext(Do),To=n.createContext(void 0),Mo=n.forwardRef((e,o)=>{let r=Ee(()=>{var h,E;return{search:"",value:(E=(h=e.value)!=null?h:e.defaultValue)!=null?E:"",selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}}}),l=Ee(()=>new Set),s=Ee(()=>new Map),c=Ee(()=>new Map),a=Ee(()=>new Set),d=Oo(e),{label:m,children:p,value:x,onValueChange:C,filter:N,shouldFilter:P,loop:D,disablePointerSelection:S=!1,vimBindings:j=!0,..._}=e,b=ue(),A=ue(),H=ue(),V=n.useRef(null),F=qn();be(()=>{if(x!==void 0){let h=x.trim();r.current.value=h,O.emit()}},[x]),be(()=>{F(6,oe)},[]);let O=n.useMemo(()=>({subscribe:h=>(a.current.add(h),()=>a.current.delete(h)),snapshot:()=>r.current,setState:(h,E,R)=>{var w,M,v,T;if(!Object.is(r.current[h],E)){if(r.current[h]=E,h==="search")q(),te(),F(1,U);else if(h==="value"){if(document.activeElement.hasAttribute("cmdk-input")||document.activeElement.hasAttribute("cmdk-root")){let k=document.getElementById(H);k?k.focus():(w=document.getElementById(b))==null||w.focus()}if(F(7,()=>{var k;r.current.selectedItemId=(k=y())==null?void 0:k.id,O.emit()}),R||F(5,oe),((M=d.current)==null?void 0:M.value)!==void 0){let k=E??"";(T=(v=d.current).onValueChange)==null||T.call(v,k);return}}O.emit()}},emit:()=>{a.current.forEach(h=>h())}}),[]),G=n.useMemo(()=>({value:(h,E,R)=>{var w;E!==((w=c.current.get(h))==null?void 0:w.value)&&(c.current.set(h,{value:E,keywords:R}),r.current.filtered.items.set(h,ee(E,R)),F(2,()=>{te(),O.emit()}))},item:(h,E)=>(l.current.add(h),E&&(s.current.has(E)?s.current.get(E).add(h):s.current.set(E,new Set([h]))),F(3,()=>{q(),te(),r.current.value||U(),O.emit()}),()=>{c.current.delete(h),l.current.delete(h),r.current.filtered.items.delete(h);let R=y();F(4,()=>{q(),R?.getAttribute("id")===h&&U(),O.emit()})}),group:h=>(s.current.has(h)||s.current.set(h,new Set),()=>{c.current.delete(h),s.current.delete(h)}),filter:()=>d.current.shouldFilter,label:m||e["aria-label"],getDisablePointerSelection:()=>d.current.disablePointerSelection,listId:b,inputId:H,labelId:A,listInnerRef:V}),[]);function ee(h,E){var R,w;let M=(w=(R=d.current)==null?void 0:R.filter)!=null?w:kn;return h?M(h,r.current.search,E):0}function te(){if(!r.current.search||d.current.shouldFilter===!1)return;let h=r.current.filtered.items,E=[];r.current.filtered.groups.forEach(w=>{let M=s.current.get(w),v=0;M.forEach(T=>{let k=h.get(T);v=Math.max(k,v)}),E.push([w,v])});let R=V.current;W().sort((w,M)=>{var v,T;let k=w.getAttribute("id"),i=M.getAttribute("id");return((v=h.get(i))!=null?v:0)-((T=h.get(k))!=null?T:0)}).forEach(w=>{let M=w.closest(st);M?M.appendChild(w.parentElement===M?w:w.closest(`${st} > *`)):R.appendChild(w.parentElement===R?w:w.closest(`${st} > *`))}),E.sort((w,M)=>M[1]-w[1]).forEach(w=>{var M;let v=(M=V.current)==null?void 0:M.querySelector(`${Oe}[${Ie}="${encodeURIComponent(w[0])}"]`);v?.parentElement.appendChild(v)})}function U(){let h=W().find(R=>R.getAttribute("aria-disabled")!=="true"),E=h?.getAttribute(Ie);O.setState("value",E||void 0)}function q(){var h,E,R,w;if(!r.current.search||d.current.shouldFilter===!1){r.current.filtered.count=l.current.size;return}r.current.filtered.groups=new Set;let M=0;for(let v of l.current){let T=(E=(h=c.current.get(v))==null?void 0:h.value)!=null?E:"",k=(w=(R=c.current.get(v))==null?void 0:R.keywords)!=null?w:[],i=ee(T,k);r.current.filtered.items.set(v,i),i>0&&M++}for(let[v,T]of s.current)for(let k of T)if(r.current.filtered.items.get(k)>0){r.current.filtered.groups.add(v);break}r.current.filtered.count=M}function oe(){var h,E,R;let w=y();w&&(((h=w.parentElement)==null?void 0:h.firstChild)===w&&((R=(E=w.closest(Oe))==null?void 0:E.querySelector(On))==null||R.scrollIntoView({block:"nearest"})),w.scrollIntoView({block:"nearest"}))}function y(){var h;return(h=V.current)==null?void 0:h.querySelector(`${Ao}[aria-selected="true"]`)}function W(){var h;return Array.from(((h=V.current)==null?void 0:h.querySelectorAll(Dt))||[])}function K(h){let E=W()[h];E&&O.setState("value",E.getAttribute(Ie))}function Y(h){var E;let R=y(),w=W(),M=w.findIndex(T=>T===R),v=w[M+h];(E=d.current)!=null&&E.loop&&(v=M+h<0?w[w.length-1]:M+h===w.length?w[0]:w[M+h]),v&&O.setState("value",v.getAttribute(Ie))}function Q(h){let E=y(),R=E?.closest(Oe),w;for(;R&&!w;)R=h>0?Kn(R,Oe):Wn(R,Oe),w=R?.querySelector(Dt);w?O.setState("value",w.getAttribute(Ie)):Y(h)}let re=()=>K(W().length-1),le=h=>{h.preventDefault(),h.metaKey?re():h.altKey?Q(1):Y(1)},ce=h=>{h.preventDefault(),h.metaKey?K(0):h.altKey?Q(-1):Y(-1)};return n.createElement(he.div,{ref:o,tabIndex:-1,..._,"cmdk-root":"",onKeyDown:h=>{var E;(E=_.onKeyDown)==null||E.call(_,h);let R=h.nativeEvent.isComposing||h.keyCode===229;if(!(h.defaultPrevented||R))switch(h.key){case"n":case"j":{j&&h.ctrlKey&&le(h);break}case"ArrowDown":{le(h);break}case"p":case"k":{j&&h.ctrlKey&&ce(h);break}case"ArrowUp":{ce(h);break}case"Home":{h.preventDefault(),K(0);break}case"End":{h.preventDefault(),re();break}case"Enter":{h.preventDefault();let w=y();if(w){let M=new Event(ct);w.dispatchEvent(M)}}}}},n.createElement("label",{"cmdk-label":"",htmlFor:G.inputId,id:G.labelId,style:Yn},m),Xe(e,h=>n.createElement(Do.Provider,{value:O},n.createElement(_o.Provider,{value:G},h))))}),Fn=n.forwardRef((e,o)=>{var r,l;let s=ue(),c=n.useRef(null),a=n.useContext(To),d=Le(),m=Oo(e),p=(l=(r=m.current)==null?void 0:r.forceMount)!=null?l:a?.forceMount;be(()=>{if(!p)return d.item(s,a?.id)},[p]);let x=ko(s,c,[e.value,e.children,c],e.keywords),C=wt(),N=fe(F=>F.value&&F.value===x.current),P=fe(F=>p||d.filter()===!1?!0:F.search?F.filtered.items.get(s)>0:!0);n.useEffect(()=>{let F=c.current;if(!(!F||e.disabled))return F.addEventListener(ct,D),()=>F.removeEventListener(ct,D)},[P,e.onSelect,e.disabled]);function D(){var F,O;S(),(O=(F=m.current).onSelect)==null||O.call(F,x.current)}function S(){C.setState("value",x.current,!0)}if(!P)return null;let{disabled:j,value:_,onSelect:b,forceMount:A,keywords:H,...V}=e;return n.createElement(he.div,{ref:Fe(c,o),...V,id:s,"cmdk-item":"",role:"option","aria-disabled":!!j,"aria-selected":!!N,"data-disabled":!!j,"data-selected":!!N,onPointerMove:j||d.getDisablePointerSelection()?void 0:S,onClick:j?void 0:D},e.children)}),$n=n.forwardRef((e,o)=>{let{heading:r,children:l,forceMount:s,...c}=e,a=ue(),d=n.useRef(null),m=n.useRef(null),p=ue(),x=Le(),C=fe(P=>s||x.filter()===!1?!0:P.search?P.filtered.groups.has(a):!0);be(()=>x.group(a),[]),ko(a,d,[e.value,e.heading,m]);let N=n.useMemo(()=>({id:a,forceMount:s}),[s]);return n.createElement(he.div,{ref:Fe(d,o),...c,"cmdk-group":"",role:"presentation",hidden:C?void 0:!0},r&&n.createElement("div",{ref:m,"cmdk-group-heading":"","aria-hidden":!0,id:p},r),Xe(e,P=>n.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":r?p:void 0},n.createElement(To.Provider,{value:N},P))))}),Ln=n.forwardRef((e,o)=>{let{alwaysRender:r,...l}=e,s=n.useRef(null),c=fe(a=>!a.search);return!r&&!c?null:n.createElement(he.div,{ref:Fe(s,o),...l,"cmdk-separator":"",role:"separator"})}),Vn=n.forwardRef((e,o)=>{let{onValueChange:r,...l}=e,s=e.value!=null,c=wt(),a=fe(p=>p.search),d=fe(p=>p.selectedItemId),m=Le();return n.useEffect(()=>{e.value!=null&&c.setState("search",e.value)},[e.value]),n.createElement(he.input,{ref:o,...l,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":m.listId,"aria-labelledby":m.labelId,"aria-activedescendant":d,id:m.inputId,type:"text",value:s?e.value:a,onChange:p=>{s||c.setState("search",p.target.value),r?.(p.target.value)}})}),Bn=n.forwardRef((e,o)=>{let{children:r,label:l="Suggestions",...s}=e,c=n.useRef(null),a=n.useRef(null),d=fe(p=>p.selectedItemId),m=Le();return n.useEffect(()=>{if(a.current&&c.current){let p=a.current,x=c.current,C,N=new ResizeObserver(()=>{C=requestAnimationFrame(()=>{let P=p.offsetHeight;x.style.setProperty("--cmdk-list-height",P.toFixed(1)+"px")})});return N.observe(p),()=>{cancelAnimationFrame(C),N.unobserve(p)}}},[]),n.createElement(he.div,{ref:Fe(c,o),...s,"cmdk-list":"",role:"listbox",tabIndex:-1,"aria-activedescendant":d,"aria-label":l,id:m.listId},Xe(e,p=>n.createElement("div",{ref:Fe(a,m.listInnerRef),"cmdk-list-sizer":""},p)))}),zn=n.forwardRef((e,o)=>{let{open:r,onOpenChange:l,overlayClassName:s,contentClassName:c,container:a,...d}=e;return n.createElement(Kt,{open:r,onOpenChange:l},n.createElement(Gt,{container:a},n.createElement(Yt,{"cmdk-overlay":"",className:s}),n.createElement(Wt,{"aria-label":e.label,"cmdk-dialog":"",className:c},n.createElement(Mo,{ref:o,...d}))))}),Hn=n.forwardRef((e,o)=>fe(r=>r.filtered.count===0)?n.createElement(he.div,{ref:o,...e,"cmdk-empty":"",role:"presentation"}):null),Un=n.forwardRef((e,o)=>{let{progress:r,children:l,label:s="Loading...",...c}=e;return n.createElement(he.div,{ref:o,...c,"cmdk-loading":"",role:"progressbar","aria-valuenow":r,"aria-valuemin":0,"aria-valuemax":100,"aria-label":s},Xe(e,a=>n.createElement("div",{"aria-hidden":!0},a)))}),_e=Object.assign(Mo,{List:Bn,Item:Fn,Input:Vn,Group:$n,Separator:Ln,Dialog:zn,Empty:Hn,Loading:Un});function Kn(e,o){let r=e.nextElementSibling;for(;r;){if(r.matches(o))return r;r=r.nextElementSibling}}function Wn(e,o){let r=e.previousElementSibling;for(;r;){if(r.matches(o))return r;r=r.previousElementSibling}}function Oo(e){let o=n.useRef(e);return be(()=>{o.current=e}),o}var be=typeof window>"u"?n.useEffect:n.useLayoutEffect;function Ee(e){let o=n.useRef();return o.current===void 0&&(o.current=e()),o}function fe(e){let o=wt(),r=()=>e(o.snapshot());return n.useSyncExternalStore(o.subscribe,r,r)}function ko(e,o,r,l=[]){let s=n.useRef(),c=Le();return be(()=>{var a;let d=(()=>{var p;for(let x of r){if(typeof x=="string")return x.trim();if(typeof x=="object"&&"current"in x)return x.current?(p=x.current.textContent)==null?void 0:p.trim():s.current}})(),m=l.map(p=>p.trim());c.value(e,d,m),(a=o.current)==null||a.setAttribute(Ie,d),s.current=d}),s}var qn=()=>{let[e,o]=n.useState(),r=Ee(()=>new Map);return be(()=>{r.current.forEach(l=>l()),r.current=new Map},[e]),(l,s)=>{r.current.set(l,s),o({})}};function Gn(e){let o=e.type;return typeof o=="function"?o(e.props):"render"in o?o.render(e.props):e}function Xe({asChild:e,children:o},r){return e&&n.isValidElement(o)?n.cloneElement(Gn(o),{ref:o.ref},r(o.props.children)):r(o)}var Yn={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};function Tt({className:e,...o}){return t.jsx(_e,{"data-slot":"command",className:L("bg-popover text-popover-foreground flex h-full w-full flex-col overflow-hidden rounded-md",e),...o})}function Mt({className:e,...o}){return t.jsxs("div",{"data-slot":"command-input-wrapper",className:"flex h-9 items-center gap-2 border-b px-3",children:[t.jsx(on,{className:"size-4 shrink-0 opacity-50"}),t.jsx(_e.Input,{"data-slot":"command-input",className:L("placeholder:text-muted-foreground flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden disabled:cursor-not-allowed disabled:opacity-50",e),...o})]})}function Ot({className:e,...o}){return t.jsx(_e.List,{"data-slot":"command-list",className:L("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto",e),...o})}function kt({...e}){return t.jsx(_e.Empty,{"data-slot":"command-empty",className:"py-6 text-center text-sm",...e})}function Ft({className:e,...o}){return t.jsx(_e.Group,{"data-slot":"command-group",className:L("text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",e),...o})}function $t({className:e,...o}){return t.jsx(_e.Item,{"data-slot":"command-item",className:L("data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",e),...o})}var Ze="Popover",[Fo]=Ge(Ze,[Ye]),Ve=Ye(),[Xn,ge]=Fo(Ze),$o=e=>{const{__scopePopover:o,children:r,open:l,defaultOpen:s,onOpenChange:c,modal:a=!1}=e,d=Ve(o),m=n.useRef(null),[p,x]=n.useState(!1),[C,N]=at({prop:l,defaultProp:s??!1,onChange:c,caller:Ze});return t.jsx(Xt,{...d,children:t.jsx(Xn,{scope:o,contentId:ue(),triggerRef:m,open:C,onOpenChange:N,onOpenToggle:n.useCallback(()=>N(P=>!P),[N]),hasCustomAnchor:p,onCustomAnchorAdd:n.useCallback(()=>x(!0),[]),onCustomAnchorRemove:n.useCallback(()=>x(!1),[]),modal:a,children:r})})};$o.displayName=Ze;var Lo="PopoverAnchor",Vo=n.forwardRef((e,o)=>{const{__scopePopover:r,...l}=e,s=ge(Lo,r),c=Ve(r),{onCustomAnchorAdd:a,onCustomAnchorRemove:d}=s;return n.useEffect(()=>(a(),()=>d()),[a,d]),t.jsx(St,{...c,...l,ref:o})});Vo.displayName=Lo;var Bo="PopoverTrigger",zo=n.forwardRef((e,o)=>{const{__scopePopover:r,...l}=e,s=ge(Bo,r),c=Ve(r),a=X(o,s.triggerRef),d=t.jsx(J.button,{type:"button","aria-haspopup":"dialog","aria-expanded":s.open,"aria-controls":s.contentId,"data-state":Go(s.open),...l,ref:a,onClick:z(e.onClick,s.onOpenToggle)});return s.hasCustomAnchor?d:t.jsx(St,{asChild:!0,...c,children:d})});zo.displayName=Bo;var bt="PopoverPortal",[Zn,Jn]=Fo(bt,{forceMount:void 0}),Ho=e=>{const{__scopePopover:o,forceMount:r,children:l,container:s}=e,c=ge(bt,o);return t.jsx(Zn,{scope:o,forceMount:r,children:t.jsx(Ht,{present:r||c.open,children:t.jsx(Zt,{asChild:!0,container:s,children:l})})})};Ho.displayName=bt;var Re="PopoverContent",Uo=n.forwardRef((e,o)=>{const r=Jn(Re,e.__scopePopover),{forceMount:l=r.forceMount,...s}=e,c=ge(Re,e.__scopePopover);return t.jsx(Ht,{present:l||c.open,children:c.modal?t.jsx(es,{...s,ref:o}):t.jsx(ts,{...s,ref:o})})});Uo.displayName=Re;var Qn=We("PopoverContent.RemoveScroll"),es=n.forwardRef((e,o)=>{const r=ge(Re,e.__scopePopover),l=n.useRef(null),s=X(o,l),c=n.useRef(!1);return n.useEffect(()=>{const a=l.current;if(a)return Jt(a)},[]),t.jsx(Qt,{as:Qn,allowPinchZoom:!0,children:t.jsx(Ko,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:z(e.onCloseAutoFocus,a=>{a.preventDefault(),c.current||r.triggerRef.current?.focus()}),onPointerDownOutside:z(e.onPointerDownOutside,a=>{const d=a.detail.originalEvent,m=d.button===0&&d.ctrlKey===!0,p=d.button===2||m;c.current=p},{checkForDefaultPrevented:!1}),onFocusOutside:z(e.onFocusOutside,a=>a.preventDefault(),{checkForDefaultPrevented:!1})})})}),ts=n.forwardRef((e,o)=>{const r=ge(Re,e.__scopePopover),l=n.useRef(!1),s=n.useRef(!1);return t.jsx(Ko,{...e,ref:o,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:c=>{e.onCloseAutoFocus?.(c),c.defaultPrevented||(l.current||r.triggerRef.current?.focus(),c.preventDefault()),l.current=!1,s.current=!1},onInteractOutside:c=>{e.onInteractOutside?.(c),c.defaultPrevented||(l.current=!0,c.detail.originalEvent.type==="pointerdown"&&(s.current=!0));const a=c.target;r.triggerRef.current?.contains(a)&&c.preventDefault(),c.detail.originalEvent.type==="focusin"&&s.current&&c.preventDefault()}})}),Ko=n.forwardRef((e,o)=>{const{__scopePopover:r,trapFocus:l,onOpenAutoFocus:s,onCloseAutoFocus:c,disableOutsidePointerEvents:a,onEscapeKeyDown:d,onPointerDownOutside:m,onFocusOutside:p,onInteractOutside:x,...C}=e,N=ge(Re,r),P=Ve(r);return to(),t.jsx(oo,{asChild:!0,loop:!0,trapped:l,onMountAutoFocus:s,onUnmountAutoFocus:c,children:t.jsx(ro,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:x,onEscapeKeyDown:d,onPointerDownOutside:m,onFocusOutside:p,onDismiss:()=>N.onOpenChange(!1),children:t.jsx(no,{"data-state":Go(N.open),role:"dialog",id:N.contentId,...P,...C,ref:o,style:{...C.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})}),Wo="PopoverClose",os=n.forwardRef((e,o)=>{const{__scopePopover:r,...l}=e,s=ge(Wo,r);return t.jsx(J.button,{type:"button",...l,ref:o,onClick:z(e.onClick,()=>s.onOpenChange(!1))})});os.displayName=Wo;var rs="PopoverArrow",qo=n.forwardRef((e,o)=>{const{__scopePopover:r,...l}=e,s=Ve(r);return t.jsx(eo,{...s,...l,ref:o})});qo.displayName=rs;function Go(e){return e?"open":"closed"}var ns=$o,ba=Vo,ss=zo,as=Ho,ls=Uo,ya=qo;function Lt({...e}){return t.jsx(ns,{"data-slot":"popover",...e})}function Vt({...e}){return t.jsx(ss,{"data-slot":"popover-trigger",...e})}function Bt({className:e,align:o="center",sideOffset:r=4,...l}){return t.jsx(as,{children:t.jsx(ls,{"data-slot":"popover-content",align:o,sideOffset:r,className:L("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 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",e),...l})})}function zt(e,[o,r]){return Math.min(r,Math.max(o,e))}function is(e){const o=e+"CollectionProvider",[r,l]=Ge(o),[s,c]=r(o,{collectionRef:{current:null},itemMap:new Map}),a=S=>{const{scope:j,children:_}=S,b=B.useRef(null),A=B.useRef(new Map).current;return t.jsx(s,{scope:j,itemMap:A,collectionRef:b,children:_})};a.displayName=o;const d=e+"CollectionSlot",m=We(d),p=B.forwardRef((S,j)=>{const{scope:_,children:b}=S,A=c(d,_),H=X(j,A.collectionRef);return t.jsx(m,{ref:H,children:b})});p.displayName=d;const x=e+"CollectionItemSlot",C="data-radix-collection-item",N=We(x),P=B.forwardRef((S,j)=>{const{scope:_,children:b,...A}=S,H=B.useRef(null),V=X(j,H),F=c(x,_);return B.useEffect(()=>(F.itemMap.set(H,{ref:H,...A}),()=>{F.itemMap.delete(H)})),t.jsx(N,{[C]:"",ref:V,children:b})});P.displayName=x;function D(S){const j=c(e+"CollectionConsumer",S);return B.useCallback(()=>{const b=j.collectionRef.current;if(!b)return[];const A=Array.from(b.querySelectorAll(`[${C}]`));return Array.from(j.itemMap.values()).sort((F,O)=>A.indexOf(F.ref.current)-A.indexOf(O.ref.current))},[j.collectionRef,j.itemMap])}return[{Provider:a,Slot:p,ItemSlot:P},D,l]}var cs=n.createContext(void 0);function ds(e){const o=n.useContext(cs);return e||o||"ltr"}var us=[" ","Enter","ArrowUp","ArrowDown"],ps=[" ","Enter"],ye="Select",[Je,Qe,ms]=is(ye),[De]=Ge(ye,[ms,Ye]),et=Ye(),[fs,xe]=De(ye),[hs,gs]=De(ye),Yo=e=>{const{__scopeSelect:o,children:r,open:l,defaultOpen:s,onOpenChange:c,value:a,defaultValue:d,onValueChange:m,dir:p,name:x,autoComplete:C,disabled:N,required:P,form:D}=e,S=et(o),[j,_]=n.useState(null),[b,A]=n.useState(null),[H,V]=n.useState(!1),F=ds(p),[O,G]=at({prop:l,defaultProp:s??!1,onChange:c,caller:ye}),[ee,te]=at({prop:a,defaultProp:d,onChange:m,caller:ye}),U=n.useRef(null),q=j?D||!!j.closest("form"):!0,[oe,y]=n.useState(new Set),W=Array.from(oe).map(K=>K.props.value).join(";");return t.jsx(Xt,{...S,children:t.jsxs(fs,{required:P,scope:o,trigger:j,onTriggerChange:_,valueNode:b,onValueNodeChange:A,valueNodeHasChildren:H,onValueNodeHasChildrenChange:V,contentId:ue(),value:ee,onValueChange:te,open:O,onOpenChange:G,dir:F,triggerPointerDownPosRef:U,disabled:N,children:[t.jsx(Je.Provider,{scope:o,children:t.jsx(hs,{scope:e.__scopeSelect,onNativeOptionAdd:n.useCallback(K=>{y(Y=>new Set(Y).add(K))},[]),onNativeOptionRemove:n.useCallback(K=>{y(Y=>{const Q=new Set(Y);return Q.delete(K),Q})},[]),children:r})}),q?t.jsxs(vr,{"aria-hidden":!0,required:P,tabIndex:-1,name:x,autoComplete:C,value:ee,onChange:K=>te(K.target.value),disabled:N,form:D,children:[ee===void 0?t.jsx("option",{value:""}):null,Array.from(oe)]},W):null]})})};Yo.displayName=ye;var Xo="SelectTrigger",Zo=n.forwardRef((e,o)=>{const{__scopeSelect:r,disabled:l=!1,...s}=e,c=et(r),a=xe(Xo,r),d=a.disabled||l,m=X(o,a.onTriggerChange),p=Qe(r),x=n.useRef("touch"),[C,N,P]=Sr(S=>{const j=p().filter(A=>!A.disabled),_=j.find(A=>A.value===a.value),b=wr(j,S,_);b!==void 0&&a.onValueChange(b.value)}),D=S=>{d||(a.onOpenChange(!0),P()),S&&(a.triggerPointerDownPosRef.current={x:Math.round(S.pageX),y:Math.round(S.pageY)})};return t.jsx(St,{asChild:!0,...c,children:t.jsx(J.button,{type:"button",role:"combobox","aria-controls":a.contentId,"aria-expanded":a.open,"aria-required":a.required,"aria-autocomplete":"none",dir:a.dir,"data-state":a.open?"open":"closed",disabled:d,"data-disabled":d?"":void 0,"data-placeholder":Cr(a.value)?"":void 0,...s,ref:m,onClick:z(s.onClick,S=>{S.currentTarget.focus(),x.current!=="mouse"&&D(S)}),onPointerDown:z(s.onPointerDown,S=>{x.current=S.pointerType;const j=S.target;j.hasPointerCapture(S.pointerId)&&j.releasePointerCapture(S.pointerId),S.button===0&&S.ctrlKey===!1&&S.pointerType==="mouse"&&(D(S),S.preventDefault())}),onKeyDown:z(s.onKeyDown,S=>{const j=C.current!=="";!(S.ctrlKey||S.altKey||S.metaKey)&&S.key.length===1&&N(S.key),!(j&&S.key===" ")&&us.includes(S.key)&&(D(),S.preventDefault())})})})});Zo.displayName=Xo;var Jo="SelectValue",Qo=n.forwardRef((e,o)=>{const{__scopeSelect:r,className:l,style:s,children:c,placeholder:a="",...d}=e,m=xe(Jo,r),{onValueNodeHasChildrenChange:p}=m,x=c!==void 0,C=X(o,m.onValueNodeChange);return me(()=>{p(x)},[p,x]),t.jsx(J.span,{...d,ref:C,style:{pointerEvents:"none"},children:Cr(m.value)?t.jsx(t.Fragment,{children:a}):c})});Qo.displayName=Jo;var xs="SelectIcon",er=n.forwardRef((e,o)=>{const{__scopeSelect:r,children:l,...s}=e;return t.jsx(J.span,{"aria-hidden":!0,...s,ref:o,children:l||"▼"})});er.displayName=xs;var vs="SelectPortal",tr=e=>t.jsx(Zt,{asChild:!0,...e});tr.displayName=vs;var je="SelectContent",or=n.forwardRef((e,o)=>{const r=xe(je,e.__scopeSelect),[l,s]=n.useState();if(me(()=>{s(new DocumentFragment)},[]),!r.open){const c=l;return c?ao.createPortal(t.jsx(rr,{scope:e.__scopeSelect,children:t.jsx(Je.Slot,{scope:e.__scopeSelect,children:t.jsx("div",{children:e.children})})}),c):null}return t.jsx(nr,{...e,ref:o})});or.displayName=je;var ie=10,[rr,ve]=De(je),Cs="SelectContentImpl",Ss=We("SelectContent.RemoveScroll"),nr=n.forwardRef((e,o)=>{const{__scopeSelect:r,position:l="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:c,onPointerDownOutside:a,side:d,sideOffset:m,align:p,alignOffset:x,arrowPadding:C,collisionBoundary:N,collisionPadding:P,sticky:D,hideWhenDetached:S,avoidCollisions:j,..._}=e,b=xe(je,r),[A,H]=n.useState(null),[V,F]=n.useState(null),O=X(o,v=>H(v)),[G,ee]=n.useState(null),[te,U]=n.useState(null),q=Qe(r),[oe,y]=n.useState(!1),W=n.useRef(!1);n.useEffect(()=>{if(A)return Jt(A)},[A]),to();const K=n.useCallback(v=>{const[T,...k]=q().map(f=>f.ref.current),[i]=k.slice(-1),u=document.activeElement;for(const f of v)if(f===u||(f?.scrollIntoView({block:"nearest"}),f===T&&V&&(V.scrollTop=0),f===i&&V&&(V.scrollTop=V.scrollHeight),f?.focus(),document.activeElement!==u))return},[q,V]),Y=n.useCallback(()=>K([G,A]),[K,G,A]);n.useEffect(()=>{oe&&Y()},[oe,Y]);const{onOpenChange:Q,triggerPointerDownPosRef:re}=b;n.useEffect(()=>{if(A){let v={x:0,y:0};const T=i=>{v={x:Math.abs(Math.round(i.pageX)-(re.current?.x??0)),y:Math.abs(Math.round(i.pageY)-(re.current?.y??0))}},k=i=>{v.x<=10&&v.y<=10?i.preventDefault():A.contains(i.target)||Q(!1),document.removeEventListener("pointermove",T),re.current=null};return re.current!==null&&(document.addEventListener("pointermove",T),document.addEventListener("pointerup",k,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",T),document.removeEventListener("pointerup",k,{capture:!0})}}},[A,Q,re]),n.useEffect(()=>{const v=()=>Q(!1);return window.addEventListener("blur",v),window.addEventListener("resize",v),()=>{window.removeEventListener("blur",v),window.removeEventListener("resize",v)}},[Q]);const[le,ce]=Sr(v=>{const T=q().filter(u=>!u.disabled),k=T.find(u=>u.ref.current===document.activeElement),i=wr(T,v,k);i&&setTimeout(()=>i.ref.current.focus())}),h=n.useCallback((v,T,k)=>{const i=!W.current&&!k;(b.value!==void 0&&b.value===T||i)&&(ee(v),i&&(W.current=!0))},[b.value]),E=n.useCallback(()=>A?.focus(),[A]),R=n.useCallback((v,T,k)=>{const i=!W.current&&!k;(b.value!==void 0&&b.value===T||i)&&U(v)},[b.value]),w=l==="popper"?dt:sr,M=w===dt?{side:d,sideOffset:m,align:p,alignOffset:x,arrowPadding:C,collisionBoundary:N,collisionPadding:P,sticky:D,hideWhenDetached:S,avoidCollisions:j}:{};return t.jsx(rr,{scope:r,content:A,viewport:V,onViewportChange:F,itemRefCallback:h,selectedItem:G,onItemLeave:E,itemTextRefCallback:R,focusSelectedItem:Y,selectedItemText:te,position:l,isPositioned:oe,searchRef:le,children:t.jsx(Qt,{as:Ss,allowPinchZoom:!0,children:t.jsx(oo,{asChild:!0,trapped:b.open,onMountAutoFocus:v=>{v.preventDefault()},onUnmountAutoFocus:z(s,v=>{b.trigger?.focus({preventScroll:!0}),v.preventDefault()}),children:t.jsx(ro,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:c,onPointerDownOutside:a,onFocusOutside:v=>v.preventDefault(),onDismiss:()=>b.onOpenChange(!1),children:t.jsx(w,{role:"listbox",id:b.contentId,"data-state":b.open?"open":"closed",dir:b.dir,onContextMenu:v=>v.preventDefault(),..._,...M,onPlaced:()=>y(!0),ref:O,style:{display:"flex",flexDirection:"column",outline:"none",..._.style},onKeyDown:z(_.onKeyDown,v=>{const T=v.ctrlKey||v.altKey||v.metaKey;if(v.key==="Tab"&&v.preventDefault(),!T&&v.key.length===1&&ce(v.key),["ArrowUp","ArrowDown","Home","End"].includes(v.key)){let i=q().filter(u=>!u.disabled).map(u=>u.ref.current);if(["ArrowUp","End"].includes(v.key)&&(i=i.slice().reverse()),["ArrowUp","ArrowDown"].includes(v.key)){const u=v.target,f=i.indexOf(u);i=i.slice(f+1)}setTimeout(()=>K(i)),v.preventDefault()}})})})})})})});nr.displayName=Cs;var ws="SelectItemAlignedPosition",sr=n.forwardRef((e,o)=>{const{__scopeSelect:r,onPlaced:l,...s}=e,c=xe(je,r),a=ve(je,r),[d,m]=n.useState(null),[p,x]=n.useState(null),C=X(o,O=>x(O)),N=Qe(r),P=n.useRef(!1),D=n.useRef(!0),{viewport:S,selectedItem:j,selectedItemText:_,focusSelectedItem:b}=a,A=n.useCallback(()=>{if(c.trigger&&c.valueNode&&d&&p&&S&&j&&_){const O=c.trigger.getBoundingClientRect(),G=p.getBoundingClientRect(),ee=c.valueNode.getBoundingClientRect(),te=_.getBoundingClientRect();if(c.dir!=="rtl"){const u=te.left-G.left,f=ee.left-u,g=O.left-f,$=O.width+g,se=Math.max($,G.width),de=window.innerWidth-ie,ae=zt(f,[ie,Math.max(ie,de-se)]);d.style.minWidth=$+"px",d.style.left=ae+"px"}else{const u=G.right-te.right,f=window.innerWidth-ee.right-u,g=window.innerWidth-O.right-f,$=O.width+g,se=Math.max($,G.width),de=window.innerWidth-ie,ae=zt(f,[ie,Math.max(ie,de-se)]);d.style.minWidth=$+"px",d.style.right=ae+"px"}const U=N(),q=window.innerHeight-ie*2,oe=S.scrollHeight,y=window.getComputedStyle(p),W=parseInt(y.borderTopWidth,10),K=parseInt(y.paddingTop,10),Y=parseInt(y.borderBottomWidth,10),Q=parseInt(y.paddingBottom,10),re=W+K+oe+Q+Y,le=Math.min(j.offsetHeight*5,re),ce=window.getComputedStyle(S),h=parseInt(ce.paddingTop,10),E=parseInt(ce.paddingBottom,10),R=O.top+O.height/2-ie,w=q-R,M=j.offsetHeight/2,v=j.offsetTop+M,T=W+K+v,k=re-T;if(T<=R){const u=U.length>0&&j===U[U.length-1].ref.current;d.style.bottom="0px";const f=p.clientHeight-S.offsetTop-S.offsetHeight,g=Math.max(w,M+(u?E:0)+f+Y),$=T+g;d.style.height=$+"px"}else{const u=U.length>0&&j===U[0].ref.current;d.style.top="0px";const g=Math.max(R,W+S.offsetTop+(u?h:0)+M)+k;d.style.height=g+"px",S.scrollTop=T-R+S.offsetTop}d.style.margin=`${ie}px 0`,d.style.minHeight=le+"px",d.style.maxHeight=q+"px",l?.(),requestAnimationFrame(()=>P.current=!0)}},[N,c.trigger,c.valueNode,d,p,S,j,_,c.dir,l]);me(()=>A(),[A]);const[H,V]=n.useState();me(()=>{p&&V(window.getComputedStyle(p).zIndex)},[p]);const F=n.useCallback(O=>{O&&D.current===!0&&(A(),b?.(),D.current=!1)},[A,b]);return t.jsx(ys,{scope:r,contentWrapper:d,shouldExpandOnScrollRef:P,onScrollButtonChange:F,children:t.jsx("div",{ref:m,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:H},children:t.jsx(J.div,{...s,ref:C,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})});sr.displayName=ws;var bs="SelectPopperPosition",dt=n.forwardRef((e,o)=>{const{__scopeSelect:r,align:l="start",collisionPadding:s=ie,...c}=e,a=et(r);return t.jsx(no,{...a,...c,ref:o,align:l,collisionPadding:s,style:{boxSizing:"border-box",...c.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)"}})});dt.displayName=bs;var[ys,yt]=De(je,{}),ut="SelectViewport",ar=n.forwardRef((e,o)=>{const{__scopeSelect:r,nonce:l,...s}=e,c=ve(ut,r),a=yt(ut,r),d=X(o,c.onViewportChange),m=n.useRef(0);return t.jsxs(t.Fragment,{children:[t.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:l}),t.jsx(Je.Slot,{scope:r,children:t.jsx(J.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:d,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:z(s.onScroll,p=>{const x=p.currentTarget,{contentWrapper:C,shouldExpandOnScrollRef:N}=a;if(N?.current&&C){const P=Math.abs(m.current-x.scrollTop);if(P>0){const D=window.innerHeight-ie*2,S=parseFloat(C.style.minHeight),j=parseFloat(C.style.height),_=Math.max(S,j);if(_<D){const b=_+P,A=Math.min(D,b),H=b-A;C.style.height=A+"px",C.style.bottom==="0px"&&(x.scrollTop=H>0?H:0,C.style.justifyContent="flex-end")}}}m.current=x.scrollTop})})})]})});ar.displayName=ut;var lr="SelectGroup",[js,Ns]=De(lr),Is=n.forwardRef((e,o)=>{const{__scopeSelect:r,...l}=e,s=ue();return t.jsx(js,{scope:r,id:s,children:t.jsx(J.div,{role:"group","aria-labelledby":s,...l,ref:o})})});Is.displayName=lr;var ir="SelectLabel",Es=n.forwardRef((e,o)=>{const{__scopeSelect:r,...l}=e,s=Ns(ir,r);return t.jsx(J.div,{id:s.id,...l,ref:o})});Es.displayName=ir;var qe="SelectItem",[Ps,cr]=De(qe),dr=n.forwardRef((e,o)=>{const{__scopeSelect:r,value:l,disabled:s=!1,textValue:c,...a}=e,d=xe(qe,r),m=ve(qe,r),p=d.value===l,[x,C]=n.useState(c??""),[N,P]=n.useState(!1),D=X(o,b=>m.itemRefCallback?.(b,l,s)),S=ue(),j=n.useRef("touch"),_=()=>{s||(d.onValueChange(l),d.onOpenChange(!1))};if(l==="")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 t.jsx(Ps,{scope:r,value:l,disabled:s,textId:S,isSelected:p,onItemTextChange:n.useCallback(b=>{C(A=>A||(b?.textContent??"").trim())},[]),children:t.jsx(Je.ItemSlot,{scope:r,value:l,disabled:s,textValue:x,children:t.jsx(J.div,{role:"option","aria-labelledby":S,"data-highlighted":N?"":void 0,"aria-selected":p&&N,"data-state":p?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...a,ref:D,onFocus:z(a.onFocus,()=>P(!0)),onBlur:z(a.onBlur,()=>P(!1)),onClick:z(a.onClick,()=>{j.current!=="mouse"&&_()}),onPointerUp:z(a.onPointerUp,()=>{j.current==="mouse"&&_()}),onPointerDown:z(a.onPointerDown,b=>{j.current=b.pointerType}),onPointerMove:z(a.onPointerMove,b=>{j.current=b.pointerType,s?m.onItemLeave?.():j.current==="mouse"&&b.currentTarget.focus({preventScroll:!0})}),onPointerLeave:z(a.onPointerLeave,b=>{b.currentTarget===document.activeElement&&m.onItemLeave?.()}),onKeyDown:z(a.onKeyDown,b=>{m.searchRef?.current!==""&&b.key===" "||(ps.includes(b.key)&&_(),b.key===" "&&b.preventDefault())})})})})});dr.displayName=qe;var ke="SelectItemText",ur=n.forwardRef((e,o)=>{const{__scopeSelect:r,className:l,style:s,...c}=e,a=xe(ke,r),d=ve(ke,r),m=cr(ke,r),p=gs(ke,r),[x,C]=n.useState(null),N=X(o,_=>C(_),m.onItemTextChange,_=>d.itemTextRefCallback?.(_,m.value,m.disabled)),P=x?.textContent,D=n.useMemo(()=>t.jsx("option",{value:m.value,disabled:m.disabled,children:P},m.value),[m.disabled,m.value,P]),{onNativeOptionAdd:S,onNativeOptionRemove:j}=p;return me(()=>(S(D),()=>j(D)),[S,j,D]),t.jsxs(t.Fragment,{children:[t.jsx(J.span,{id:m.textId,...c,ref:N}),m.isSelected&&a.valueNode&&!a.valueNodeHasChildren?ao.createPortal(c.children,a.valueNode):null]})});ur.displayName=ke;var pr="SelectItemIndicator",mr=n.forwardRef((e,o)=>{const{__scopeSelect:r,...l}=e;return cr(pr,r).isSelected?t.jsx(J.span,{"aria-hidden":!0,...l,ref:o}):null});mr.displayName=pr;var pt="SelectScrollUpButton",fr=n.forwardRef((e,o)=>{const r=ve(pt,e.__scopeSelect),l=yt(pt,e.__scopeSelect),[s,c]=n.useState(!1),a=X(o,l.onScrollButtonChange);return me(()=>{if(r.viewport&&r.isPositioned){let d=function(){const p=m.scrollTop>0;c(p)};const m=r.viewport;return d(),m.addEventListener("scroll",d),()=>m.removeEventListener("scroll",d)}},[r.viewport,r.isPositioned]),s?t.jsx(gr,{...e,ref:a,onAutoScroll:()=>{const{viewport:d,selectedItem:m}=r;d&&m&&(d.scrollTop=d.scrollTop-m.offsetHeight)}}):null});fr.displayName=pt;var mt="SelectScrollDownButton",hr=n.forwardRef((e,o)=>{const r=ve(mt,e.__scopeSelect),l=yt(mt,e.__scopeSelect),[s,c]=n.useState(!1),a=X(o,l.onScrollButtonChange);return me(()=>{if(r.viewport&&r.isPositioned){let d=function(){const p=m.scrollHeight-m.clientHeight,x=Math.ceil(m.scrollTop)<p;c(x)};const m=r.viewport;return d(),m.addEventListener("scroll",d),()=>m.removeEventListener("scroll",d)}},[r.viewport,r.isPositioned]),s?t.jsx(gr,{...e,ref:a,onAutoScroll:()=>{const{viewport:d,selectedItem:m}=r;d&&m&&(d.scrollTop=d.scrollTop+m.offsetHeight)}}):null});hr.displayName=mt;var gr=n.forwardRef((e,o)=>{const{__scopeSelect:r,onAutoScroll:l,...s}=e,c=ve("SelectScrollButton",r),a=n.useRef(null),d=Qe(r),m=n.useCallback(()=>{a.current!==null&&(window.clearInterval(a.current),a.current=null)},[]);return n.useEffect(()=>()=>m(),[m]),me(()=>{d().find(x=>x.ref.current===document.activeElement)?.ref.current?.scrollIntoView({block:"nearest"})},[d]),t.jsx(J.div,{"aria-hidden":!0,...s,ref:o,style:{flexShrink:0,...s.style},onPointerDown:z(s.onPointerDown,()=>{a.current===null&&(a.current=window.setInterval(l,50))}),onPointerMove:z(s.onPointerMove,()=>{c.onItemLeave?.(),a.current===null&&(a.current=window.setInterval(l,50))}),onPointerLeave:z(s.onPointerLeave,()=>{m()})})}),Rs="SelectSeparator",xr=n.forwardRef((e,o)=>{const{__scopeSelect:r,...l}=e;return t.jsx(J.div,{"aria-hidden":!0,...l,ref:o})});xr.displayName=Rs;var ft="SelectArrow",As=n.forwardRef((e,o)=>{const{__scopeSelect:r,...l}=e,s=et(r),c=xe(ft,r),a=ve(ft,r);return c.open&&a.position==="popper"?t.jsx(eo,{...s,...l,ref:o}):null});As.displayName=ft;var _s="SelectBubbleInput",vr=n.forwardRef(({__scopeSelect:e,value:o,...r},l)=>{const s=n.useRef(null),c=X(l,s),a=Fr(o);return n.useEffect(()=>{const d=s.current;if(!d)return;const m=window.HTMLSelectElement.prototype,x=Object.getOwnPropertyDescriptor(m,"value").set;if(a!==o&&x){const C=new Event("change",{bubbles:!0});x.call(d,o),d.dispatchEvent(C)}},[a,o]),t.jsx(J.select,{...r,style:{...Ar,...r.style},ref:c,defaultValue:o})});vr.displayName=_s;function Cr(e){return e===""||e===void 0}function Sr(e){const o=_r(e),r=n.useRef(""),l=n.useRef(0),s=n.useCallback(a=>{const d=r.current+a;o(d),(function m(p){r.current=p,window.clearTimeout(l.current),p!==""&&(l.current=window.setTimeout(()=>m(""),1e3))})(d)},[o]),c=n.useCallback(()=>{r.current="",window.clearTimeout(l.current)},[]);return n.useEffect(()=>()=>window.clearTimeout(l.current),[]),[r,s,c]}function wr(e,o,r){const s=o.length>1&&Array.from(o).every(p=>p===o[0])?o[0]:o,c=r?e.indexOf(r):-1;let a=Ds(e,Math.max(c,0));s.length===1&&(a=a.filter(p=>p!==r));const m=a.find(p=>p.textValue.toLowerCase().startsWith(s.toLowerCase()));return m!==r?m:void 0}function Ds(e,o){return e.map((r,l)=>e[(o+l)%e.length])}var Ts=Yo,Ms=Zo,Os=Qo,ks=er,Fs=tr,$s=or,Ls=ar,Vs=dr,Bs=ur,zs=mr,Hs=fr,Us=hr,ja=xr;function ht({...e}){return t.jsx(Ts,{"data-slot":"select",...e})}function gt({...e}){return t.jsx(Os,{"data-slot":"select-value",...e})}function xt({className:e,size:o="default",children:r,...l}){return t.jsxs(Ms,{"data-slot":"select-trigger","data-size":o,className:L("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",e),...l,children:[r,t.jsx(ks,{asChild:!0,children:t.jsx(lo,{className:"size-4 opacity-50"})})]})}function vt({className:e,children:o,position:r="popper",...l}){return t.jsx(Fs,{children:t.jsxs($s,{"data-slot":"select-content",className:L("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",r==="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",e),position:r,...l,children:[t.jsx(Ks,{}),t.jsx(Ls,{className:L("p-1",r==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:o}),t.jsx(Ws,{})]})})}function Ct({className:e,children:o,...r}){return t.jsxs(Vs,{"data-slot":"select-item",className:L("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",e),...r,children:[t.jsx("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:t.jsx(zs,{children:t.jsx(Br,{className:"size-4"})})}),t.jsx(Bs,{children:o})]})}function Ks({className:e,...o}){return t.jsx(Hs,{"data-slot":"select-scroll-up-button",className:L("flex cursor-default items-center justify-center py-1",e),...o,children:t.jsx(Xr,{className:"size-4"})})}function Ws({className:e,...o}){return t.jsx(Us,{"data-slot":"select-scroll-down-button",className:L("flex cursor-default items-center justify-center py-1",e),...o,children:t.jsx(lo,{className:"size-4"})})}function qs({hasUnsavedChanges:e,title:o="Unsaved Changes",description:r="You have unsaved changes. Are you sure you want to leave this page? Your changes will be lost.",stayButtonText:l="Stay on Page",leaveButtonText:s="Leave Page"}){const c=br(({currentLocation:x,nextLocation:C})=>e&&x.pathname!==C.pathname),[a,d]=n.useState(!1),m=()=>{c.state==="blocked"&&c.proceed()},p=()=>{c.state==="blocked"&&c.reset()};return n.useEffect(()=>{d(c.state==="blocked")},[c.state,a]),n.useEffect(()=>{const x=C=>{e&&(C.preventDefault(),C.returnValue="")};return e&&window.addEventListener("beforeunload",x),()=>{window.removeEventListener("beforeunload",x)}},[e]),t.jsx(wo,{open:a,onOpenChange:d,children:t.jsxs(bo,{children:[t.jsxs(yo,{children:[t.jsx(No,{children:o}),t.jsx(Io,{children:r})]}),t.jsxs(jo,{children:[t.jsx(Po,{onClick:p,children:l}),t.jsx(Eo,{onClick:m,children:s})]})]})})}const Gs=({field:e,value:o,resolvedChoices:r,key:l,hasMinMax:s})=>{const c=e.value?String(e.value).split(",").map(a=>a.trim()).filter(Boolean):[];return t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("div",{className:"flex flex-wrap gap-2 min-h-[38px] p-2 border rounded-md bg-background",children:c.length>0?c.map(a=>t.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:[a,t.jsxs("button",{type:"button",onClick:()=>{const d=c.filter(m=>m!==a);e.onChange(d.join(","))},className:"hover:bg-gray-200 rounded-sm p-0.5",children:[t.jsx(lt,{size:14}),t.jsxs("span",{className:"sr-only",children:["Remove ",a]})]})]},a)):t.jsx("span",{className:"text-muted-foreground text-sm",children:o.placeholder??"Select items..."})}),(!o.maxSelectedChoices||c.length<o.maxSelectedChoices)&&t.jsxs(ht,{value:"",onValueChange:a=>{const d=c;d.includes(a)||e.onChange([...d,a].join(","))},children:[t.jsx(xt,{id:l,className:"w-full",children:t.jsx(gt,{placeholder:"Add item..."})}),t.jsx(vt,{children:r.filter(a=>!c.includes(a)).map(a=>t.jsx(Ct,{value:a,children:a},a))})]}),s&&t.jsxs("span",{className:L("text-xs",o.minSelectedChoices&&c.length<o.minSelectedChoices?"text-destructive":"text-muted-foreground"),children:[c.length,o.minSelectedChoices&&o.maxSelectedChoices?`/${o.maxSelectedChoices} (min ${o.minSelectedChoices})`:o.minSelectedChoices?` selected (min ${o.minSelectedChoices})`:`/${o.maxSelectedChoices} selected`]})]})},Ys=B.lazy(()=>Ae(()=>import("./FilePicker-DGseBDOZ.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]))),Xs=B.lazy(()=>Ae(()=>import("./markdownEditor-D3QMBKBF.js"),__vite__mapDeps([17,1,18,2,5,19,20,7,21,12,9,22,23,14,6,15,11,24,4,13,25,26]))),Zs=B.lazy(()=>Ae(()=>import("./date-picker-CqVT8lwM.js"),__vite__mapDeps([27,1,14,7,2,28,9,29,11,13,30,20,5,19,6,21,12,22,15,24,4,25]))),Js=B.lazy(()=>Ae(()=>import("./datetime-picker-DemhHfWW.js"),__vite__mapDeps([31,1,14,7,2,28,9,29,11,13,15,30,20,5,19,6,21,12,22,24,4,25]))),Qs=B.lazy(()=>Ae(()=>import("./URLInput-ATIRZflA.js"),__vite__mapDeps([32,1,15,2,16,9]))),ea=B.lazy(()=>Ae(()=>import("./ColorPicker-kqchGTe4.js"),__vite__mapDeps([33,1]))),ta=(e,o,r)=>{const l=e.type==="select"&&e.allowFreeInput===!0,s=e.type==="select"&&Array.isArray(e.choicesFixed)&&e.choicesFixed.length>0;return{shouldOnlyDropdown:e.type==="select"&&!l,shouldMixedDropdown:e.type==="select"&&l&&s,shouldOnlyTyping:e.type==="select"&&l&&!s,filteredChoices:o.filter(c=>c.toLowerCase().includes(r.toLowerCase())),canCreateFromInput:r.trim().length>0}},oa=(e,o,r,l)=>{const s=e.type==="multiselect"&&e.allowFreeInput===!0,c=e.type==="multiselect"&&Array.isArray(e.choicesFixed)&&e.choicesFixed.length>0,a=o.filter(d=>!r.includes(d));return{shouldOnlyDropdown:e.type==="multiselect"&&!s,shouldMixedDropdown:e.type==="multiselect"&&s&&c,shouldOnlyTyping:e.type==="multiselect"&&s&&!c,availableChoices:a,filteredChoices:a.filter(d=>d.toLowerCase().includes(l.toLowerCase())),canCreateFromInput:l.trim().length>0&&!r.includes(l.trim())&&(!e.maxSelectedChoices||r.length<e.maxSelectedChoices)}},ra=e=>(e.type==="multiselect"||e.type==="string"&&e.isMultiple&&e.choicesFixed)&&(e.minSelectedChoices||e.maxSelectedChoices);function Na({itemType:e,fields:o,isSingleton:r,data:l,productionData:s,isNew:c,changedFields:a=[],itemStatus:d}){const m=yr(),{hash:p}=jr(),[x]=Dr(),[C]=Tr(),{data:N}=Mr(),[P,D]=n.useState(!1),[S,j]=n.useState(null),[_,b]=n.useState(null),[A,H]=n.useState({}),[V,F]=n.useState({}),[O,G]=n.useState({}),[ee,te]=n.useState({}),U=i=>a.includes(i);n.useEffect(()=>{if(!p)return;const i=p.slice(1),u=document.getElementById(i);u&&(window.scrollTo({top:window.scrollY,behavior:"smooth"}),u.focus())},[p]);const q=n.useMemo(()=>({id:r?"default":l?.id??"",isDraft:String(l?.isDraft??!1),...Object.fromEntries(Object.keys(o).map(i=>{const u=o[i].type,f=l?.[i];return f!=null?u==="boolean"?[i,String(f)]:u==="multiselect"?[i,Array.isArray(f)?f:[f]]:[i,String(f)]:u==="boolean"?[i,"false"]:u==="multiselect"?[i,[]]:[i,""]}))}),[l,o,r]),oe=n.useMemo(()=>{const i={id:ne().min(1,"ID is required").regex(/^[a-z0-9-]+$/,"ID can only include lowercase letters and numbers"),isDraft:ne()};return Object.entries(o).forEach(([u,f])=>{let g;switch(f.type){case"boolean":g=It(["true","false"]);break;case"number":g=Kr();break;case"url":g=Ur("Must be a valid URL");break;case"date":g=ne();break;case"datetime":g=ne();break;case"color":g=zr;break;case"select":f.allowFreeInput?g=ne():ot(f.choicesFixed)?g=ne():f.choicesFixed&&f.choicesFixed.length>0?g=It(f.choicesFixed):g=ne();break;case"multiselect":g=Gr(ne()),f.minSelectedChoices&&(g=g.min(f.minSelectedChoices,`${f.displayName} requires at least ${f.minSelectedChoices} selection${f.minSelectedChoices>1?"s":""}`)),f.maxSelectedChoices&&(g=g.max(f.maxSelectedChoices,`${f.displayName} allows maximum ${f.maxSelectedChoices} selection${f.maxSelectedChoices>1?"s":""}`));break;case"string":f.isMultiple?ot(f.choicesFixed)?g=ne():f.choicesFixed&&f.choicesFixed.length>0?g=ne():g=ne():g=ne();break;default:g=ne()}f.optional?f.type==="multiselect"?f.minSelectedChoices||(g=g.optional()):g=g.optional().or(Wr("")):f.type==="multiselect"&&!f.minSelectedChoices?g=g.min(1,`${f.displayName} requires at least one selection`):f.type!=="boolean"&&f.type!=="select"&&!(f.type==="string"&&f.isMultiple&&f.choicesFixed)&&(g=g.min(1,`${f.displayName} is required`)),i[u]=g}),qr(i)},[o]),y=$r({resolver:Lr(oe),defaultValues:q});n.useEffect(()=>{y.reset(q)},[q,y]),n.useEffect(()=>{if(!y)return;const i=window.location.hash;i&&y.setFocus(i.substring(1))},[y]);const W=B.useCallback(i=>{if(!s){we.error("Production values are not available.");return}const u=s[i];y.setValue(i,u,{shouldDirty:!0,shouldTouch:!0,shouldValidate:!0}),y.trigger(i),we.success(`Restored "${o[i]?.displayName??i}" to published value.`)},[s,y,o]),K=B.useCallback(()=>{if(!s){we.error("Production values are not available.");return}a.length&&(a.forEach(i=>{const u=s[i];y.setValue(i,u,{shouldDirty:!0,shouldTouch:!0,shouldValidate:!0})}),we.success("Restored modified fields to published values."))},[s,a,y]),Y=B.useCallback(i=>{b(i),j("single"),D(!0)},[]),Q=B.useCallback(()=>{b(null),j("all"),D(!0)},[]),re=B.useCallback(()=>{S==="single"&&_?W(_):S==="all"&&K(),D(!1),j(null),b(null),le(y.getValues(),!1)},[S,_,W,K]);async function le(i,u=!0){const f={...i,isDraft:i.isDraft==="true",type:e};Object.entries(o).forEach(([g,$])=>{$.type==="boolean"&&(f[g]=i[g]==="true")});try{if(c||r&&!l){const ae=await x(f).unwrap();u&&we.success("Item created successfully."),m(`/admin/dashboard/${e}/${ae.id}`);return}const g=l?.id,$=f.id,se=g!==$;if(!g)return;const de=await C({...f,id:g,type:e,newId:se?$:void 0}).unwrap();if(u&&we.success("Item updated successfully."),se){m(`/admin/dashboard/${e}/${de.id}`);return}y.reset(i)}catch(g){g.status===409&&y.setError("id",{type:"manual",message:"An item with this ID already exists."}),we.error(c?"Failed to create item.":"Failed to update item."),console.error(g)}}n.useEffect(()=>{const i=u=>{(u.ctrlKey||u.metaKey)&&u.key==="s"&&(u.preventDefault(),(y.formState.isDirty||c)&&y.handleSubmit(f=>le(f))())};return document.addEventListener("keydown",i),()=>document.removeEventListener("keydown",i)},[y,c,le]);const ce=n.useMemo(()=>Object.entries(o).filter(([,i])=>i.type==="boolean"),[o]),h=n.useMemo(()=>{const i={};return Object.entries(o).forEach(([u,f])=>{if(f.type==="select"||f.type==="multiselect"||f.type==="string"&&f.isMultiple&&f.choicesFixed){const g=ot(f.choicesFixed);if(g&&N){const $=N[g];$?i[u]=Object.values($).map(se=>se.id):i[u]=[]}else i[u]=f.choicesFixed||[]}}),i},[o,N]),E="outline outline-1 outline-yellow-400 outline-offset-4 rounded-sm",R=B.useCallback((i,u,f)=>{const g=u.trim();return!g||i.includes(g)||f&&i.length>=f?i:[...i,g]},[]),w=B.useCallback((i,u)=>{F(f=>({...f,[i]:u}))},[]),M=B.useCallback((i,u)=>{H(f=>({...f,[i]:u}))},[]),v=B.useCallback((i,u)=>{te(f=>({...f,[i]:u}))},[]),T=B.useCallback((i,u)=>{G(f=>({...f,[i]:u}))},[]),k=({fieldKey:i})=>t.jsxs("span",{className:"inline-flex items-center gap-1 text-yellow-800 text-xs",children:["(modified)",t.jsxs(Ne,{type:"button",variant:"ghost",size:"icon",className:"h-4 w-4",onClick:()=>Y(i),title:"Restore published value",children:[t.jsx(Pt,{size:12,className:"text-black"}),t.jsxs("span",{className:"sr-only",children:["Restore ",i," to production"]})]})]});return t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"flex items-center gap-4 mb-4",children:[l&&l.updatedAt&&t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx("p",{className:"text-sm text-muted-foreground",children:"Last updated:"}),t.jsx("p",{className:"text-sm",children:new Date(l.updatedAt).toLocaleString()})]}),d&&t.jsxs("div",{className:"flex items-center gap-1",children:[t.jsx("p",{className:"text-sm text-muted-foreground",children:"Unpublished status:"}),t.jsx(kr,{className:L("capitalize",Or[d]),children:d}),a.length>0&&t.jsxs(Ne,{type:"button",variant:"ghost",size:"icon",className:"h-6 w-6",onClick:Q,title:"Restore all fields to published values",children:[t.jsx(Pt,{size:14}),t.jsx("span",{className:"sr-only",children:"Restore all modified fields to published values"})]})]})]}),t.jsxs(Vr,{...y,children:[t.jsxs("form",{onSubmit:y.handleSubmit(i=>le(i)),className:"space-y-4 max-w-[800px] w-[800px]",children:[t.jsx(ze,{name:"id",control:y.control,rules:{required:!0},render:({field:i})=>t.jsxs(He,{id:"id",className:L((l?.id==="default"||r)&&"hidden",U("id")&&E),children:[t.jsxs(Te,{className:"flex gap-1 items-baseline",children:["ID",U("id")&&t.jsx(k,{fieldKey:"id"})]}),t.jsx(Ue,{children:t.jsx(Me,{placeholder:"item-id",...y.register("id"),...i,value:i.value,onChange:u=>{const f=u.target.value.toLowerCase().replace(/\s+/g,"-").replace(/-+/g,"-").replace(/[^a-z0-9-]/g,"");i.onChange(f)},onBlur:u=>{const f=u.target.value.trim().replace(/^-+|-+$/g,"");i.onChange(f)}})}),t.jsx(Ke,{})]})}),t.jsx(ze,{name:"isDraft",control:y.control,render:({field:i})=>t.jsxs(He,{id:"isDraft",className:L("flex flex-col items-start",(l?.id==="default"||r)&&"hidden",U("isDraft")&&E),children:[t.jsxs("div",{className:"flex flex-row space-x-2",children:[t.jsx(Ue,{children:t.jsx(Nt,{id:"isDraft",...y.register("isDraft"),checked:i.value==="true",onCheckedChange:u=>{i.onChange(u===!0?"true":"false")}})}),t.jsxs(Te,{className:"flex gap-1 items-baseline",children:["Draft",U("isDraft")&&t.jsx("span",{className:"text-yellow-600 text-xs",children:t.jsx(k,{fieldKey:"isDraft"})})]})]}),t.jsx(tt,{children:"Draft items are not visible on the published site"}),t.jsx(Ke,{})]})}),ce.length>0&&t.jsxs("div",{className:"flex flex-col gap-3",children:[t.jsx(Te,{children:"Flags"}),t.jsx("div",{className:"flex flex-row flex-wrap gap-4",children:ce.map(([i,u])=>t.jsx(ze,{name:i,control:y.control,render:({field:f})=>t.jsxs(He,{className:L("flex flex-col items-start",U(i)&&E),children:[t.jsxs("div",{className:"flex flex-row space-x-2",children:[t.jsx(Ue,{children:t.jsx(Nt,{id:i,...y.register(i),checked:f.value==="true",onCheckedChange:g=>{f.onChange(g===!0?"true":"false")}})}),t.jsxs(Te,{className:"flex gap-1 items-baseline",children:[u.displayName,U(i)&&t.jsx("span",{className:"text-yellow-800 text-xs",children:t.jsx(k,{fieldKey:i})})]})]}),u.displayExtra&&t.jsx(tt,{children:u.displayExtra}),t.jsx(Ke,{})]})},i))})]}),Object.entries(o).filter(([,i])=>i.type!=="boolean").map(([i,u])=>{const f=h[i]??[];return t.jsx(ze,{name:i,control:y.control,rules:{required:!u.optional},render:({field:g})=>{const $=g.value??[],se=$.length,de=ee[i]??"",ae=ta(u,f,de),Be=V[i]??"",Ce=oa(u,f,$,Be),jt=ra(u);return t.jsxs(He,{id:i,className:L(U(i)&&E),children:[t.jsxs(Te,{className:"flex gap-1 items-baseline",children:[u.displayName,u.optional&&t.jsx("span",{className:"text-gray-400",children:"(optional)"}),U(i)&&t.jsx("span",{className:"text-yellow-600 text-xs",children:t.jsx(k,{fieldKey:i})})]}),t.jsx(Ue,{children:u.type==="markdown"?t.jsx(Xs,{id:i,name:i,register:y.register,className:"h-52",markdown:g.value,onChange:(I,Z)=>{Z||g.onChange(I)},placeholder:u.placeholder,fieldDisplayName:u.displayName}):u.type==="url"?t.jsx(Qs,{id:i,...y.register(i),placeholder:u.placeholder??"https://example.website/",...g,value:g.value}):u.type==="string"&&u.isUploadedFile?t.jsx(Ys,{id:i,name:i,register:y.register,value:g.value,onChange:g.onChange}):u.type==="date"?t.jsx(Zs,{id:i,...y.register(i),date:g.value?new Date(g.value):void 0,onDateChange:I=>{g.onChange(I?I.toISOString():"")},placeholder:u.placeholder??"Select date",allowClear:u.optional}):u.type==="datetime"?t.jsx("div",{className:"relative",children:t.jsx(Js,{id:i,...y.register(i),date:g.value?new Date(g.value):void 0,onDateTimeChange:I=>{g.onChange(I?I.toISOString():"")},placeholder:u.placeholder??"Select date and time",allowClear:u.optional})}):u.type==="color"?t.jsx(ea,{id:i,value:g.value,onChange:g.onChange,placeholder:u.placeholder}):u.type==="number"?t.jsx(Me,{id:i,...y.register(i,{valueAsNumber:!0}),type:"number",value:g.value,onChange:g.onChange,placeholder:u.placeholder}):u.type==="select"?t.jsxs("div",{className:"flex gap-2",children:[ae.shouldOnlyDropdown&&t.jsxs(ht,{value:g.value,onValueChange:g.onChange,children:[t.jsx(xt,{id:i,className:"w-full",children:t.jsx(gt,{placeholder:u.placeholder??"Select an item..."})}),t.jsx(vt,{children:f.map(I=>t.jsx(Ct,{value:I,children:I},I))})]}),ae.shouldMixedDropdown&&t.jsxs(Lt,{open:O[i]??!1,onOpenChange:I=>T(i,I),children:[t.jsx(Vt,{asChild:!0,children:t.jsxs(Ne,{id:i,type:"button",variant:"outline",role:"combobox","aria-expanded":O[i]??!1,className:"w-full justify-between",children:[g.value||u.placeholder||"Select or type...",t.jsx(Et,{className:"opacity-50"})]})}),t.jsx(Bt,{className:"w-(--radix-popover-trigger-width) p-0",children:t.jsxs(Tt,{children:[t.jsx(Mt,{value:de,onValueChange:I=>v(i,I),onKeyDown:I=>{I.key==="Enter"&&(I.preventDefault(),ae.canCreateFromInput&&(g.onChange(de.trim()),v(i,""),T(i,!1)))},placeholder:"Select or type to add..."}),t.jsxs(Ot,{children:[t.jsx(kt,{children:ae.canCreateFromInput?`Press Enter to use "${de.trim()}"`:"No available items"}),t.jsx(Ft,{children:ae.filteredChoices.map(I=>t.jsx($t,{value:I,onSelect:()=>{g.onChange(I),v(i,""),T(i,!1)},children:I},I))})]})]})})]}),ae.shouldOnlyTyping&&t.jsx(Me,{id:i,placeholder:u.placeholder??"Type a value...",...g,value:g.value}),u.optional&&g.value&&t.jsxs(Ne,{type:"button",variant:"outline",size:"icon",onClick:()=>g.onChange(""),className:"shrink-0",children:[t.jsx(lt,{size:16}),t.jsx("span",{className:"sr-only",children:"Clear selection"})]})]}):u.type==="multiselect"?t.jsxs("div",{className:"flex flex-col gap-2",children:[t.jsx("div",{className:"flex flex-wrap gap-2 min-h-[38px] p-2 border rounded-md bg-background",children:$.length>0?$.map(I=>t.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,t.jsxs("button",{type:"button",onClick:()=>{const Z=$.filter(Se=>Se!==I);g.onChange(Z)},className:"hover:bg-gray-200 rounded-sm p-0.5",children:[t.jsx(lt,{size:14}),t.jsxs("span",{className:"sr-only",children:["Remove ",I]})]})]},I)):t.jsx("span",{className:"text-muted-foreground text-sm",children:u.placeholder??"Add items..."})}),(!u.maxSelectedChoices||se<u.maxSelectedChoices)&&t.jsxs(t.Fragment,{children:[Ce.shouldOnlyDropdown&&t.jsxs(ht,{value:"",onValueChange:I=>{const Z=$,Se=R(Z,I,u.maxSelectedChoices);Se!==Z&&g.onChange(Se)},children:[t.jsx(xt,{id:i,className:"w-full",children:t.jsx(gt,{placeholder:u.placeholder??"Select item..."})}),t.jsx(vt,{children:Ce.availableChoices.map(I=>t.jsx(Ct,{value:I,children:I},I))})]}),Ce.shouldMixedDropdown&&t.jsxs(Lt,{open:A[i]??!1,onOpenChange:I=>M(i,I),children:[t.jsx(Vt,{asChild:!0,children:t.jsxs(Ne,{type:"button",variant:"outline",role:"combobox","aria-expanded":A[i]??!1,className:"w-full justify-between",children:[u.placeholder??"Add item...",t.jsx(Et,{className:"opacity-50"})]})}),t.jsx(Bt,{className:"w-(--radix-popover-trigger-width) p-0",children:t.jsxs(Tt,{children:[t.jsx(Mt,{value:Be,onValueChange:I=>w(i,I),onKeyDown:I=>{if(I.key!=="Enter"||(I.preventDefault(),!Ce.canCreateFromInput))return;const Z=R($,Be,u.maxSelectedChoices);Z!==$&&(g.onChange(Z),w(i,""))},placeholder:"Select or type to add..."}),t.jsxs(Ot,{children:[t.jsx(kt,{children:Ce.canCreateFromInput?`Press Enter to add "${Be.trim()}"`:"No available items"}),t.jsx(Ft,{children:Ce.filteredChoices.map(I=>t.jsx($t,{value:I,onSelect:()=>{const Z=R($,I,u.maxSelectedChoices);Z!==$&&g.onChange(Z),w(i,"")},children:I},I))})]})]})})]}),Ce.shouldOnlyTyping&&t.jsx(Me,{id:`${i}-custom-item`,placeholder:u.placeholder??"Type an item and press Enter",onKeyDown:I=>{if(I.key!=="Enter")return;I.preventDefault();const Z=$,Se=R(Z,I.currentTarget.value,u.maxSelectedChoices);Se!==Z&&(g.onChange(Se),I.currentTarget.value="")}})]}),jt&&t.jsxs("span",{className:L("text-xs",u.minSelectedChoices&&se<u.minSelectedChoices?"text-destructive":"text-muted-foreground"),children:[se,u.minSelectedChoices&&u.maxSelectedChoices?`/${u.maxSelectedChoices} (min ${u.minSelectedChoices})`:u.minSelectedChoices?` selected (min ${u.minSelectedChoices})`:`/${u.maxSelectedChoices} selected`]})]}):u.type==="string"&&u.isMultiple&&u.choicesFixed?t.jsx(Gs,{field:g,resolvedChoices:f,value:u,hasMinMax:jt},i):t.jsx(Me,{id:i,...y.register(i),placeholder:u.placeholder,...g,value:g.value})}),u.displayExtra&&t.jsx(tt,{children:u.displayExtra}),t.jsx(Ke,{})]})}},i)}),t.jsxs(Ne,{disabled:!y.formState.isDirty&&!c||y.formState.isSubmitting,type:"submit",children:[y.formState.isSubmitting?t.jsx(Hr,{className:"animate-spin"}):t.jsx(en,{}),y.formState.isSubmitting?"Saving":y.watch("isDraft")==="true"?"Save Draft":"Save"]})]}),t.jsx(qs,{hasUnsavedChanges:!y.formState.isSubmitting&&y.formState.isDirty})]}),t.jsx(wo,{open:P,onOpenChange:D,children:t.jsxs(bo,{children:[t.jsxs(yo,{children:[t.jsx(No,{children:S==="all"?"Restore all modified fields?":"Restore this field?"}),t.jsx(Io,{children:S==="all"?`This will restore ${a.length} modified ${a.length===1?"field":"fields"} to published values.`:`This will restore "${_?o[_]?.displayName??_:"field"}" to its published value.`})]}),t.jsxs(jo,{children:[t.jsx(Po,{children:"Cancel"}),t.jsx(Eo,{onClick:re,children:"Restore"})]})]})})]})}export{ba as A,$s as C,Na as I,Fs as P,Ts as R,ja as S,Ms as T,Os as V,ks as a,Ls as b,is as c,Vs as d,Bs as e,ns as f,as as g,ls as h,ya as i,Lt as j,Vt as k,Bt as l,ds 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-
|
|
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-CqtjpfTE.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-CvQSRYkS.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-DOj1cBNu.js","imports":["/assets/chunk-EPOLDU6W-CiSVlmCe.js","/assets/authSlice-DWtXmmFR.js","/assets/utils-B48p8Qal.js","/assets/index-CZSVchcX.js","/assets/index-CW4Lhoah.js","/assets/x-D6gZWaAR.js","/assets/button-BEFuP7Ru.js","/assets/createLucideIcon-BvSqmaUO.js","/assets/index-CbaefyjV.js","/assets/index-B5ynPIRP.js","/assets/index-DRumOFGs.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-Crt5fSJe.js","imports":["/assets/chunk-EPOLDU6W-CiSVlmCe.js","/assets/utils-B48p8Qal.js","/assets/index-Cgk-ojIv.js","/assets/badge-DTudhbGs.js","/assets/schemas-BabmyWH6.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-rMBf1ZGC.js","imports":["/assets/chunk-EPOLDU6W-CiSVlmCe.js","/assets/itemForm-DcKqLtr7.js","/assets/utils-B48p8Qal.js","/assets/index-B5ynPIRP.js","/assets/index-CbaefyjV.js","/assets/index-DLIEpuwL.js","/assets/index-CW4Lhoah.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-BabmyWH6.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-D3XXkcBD.js","imports":["/assets/chunk-EPOLDU6W-CiSVlmCe.js","/assets/itemForm-DcKqLtr7.js","/assets/utils-B48p8Qal.js","/assets/index-B5ynPIRP.js","/assets/index-CbaefyjV.js","/assets/index-DLIEpuwL.js","/assets/index-CW4Lhoah.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-BabmyWH6.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-63bbd580.js","version":"63bbd580"};
|