@payloadcms/ui 3.55.0-internal.d44d1d3 → 3.55.0-internal.f8c92b5
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.
|
@@ -45,7 +45,7 @@ import{a as Sg,b as G,c as Ig,d as wt,e as g5,f as b5,g as _g,h as v5,i as C5}fr
|
|
|
45
45
|
.${o}${rs}--exit {
|
|
46
46
|
visibility: visible;
|
|
47
47
|
}
|
|
48
|
-
`};var Lw=(t,e)=>{let o=Object.assign({},t),{type:n,payload:r}=e;switch(n){case"UPDATE_MODAL":{let{slug:s}=r;s&&(o[s]=Object.assign(Object.assign({},o[s]),r));break}case"OPEN_MODAL":{let{slug:s}=r;s&&(s in o&&o[s].isOpen||(o[s]=Object.assign(Object.assign({},o[s]),{slug:s,openedOn:Date.now(),isOpen:!0})));break}case"TOGGLE_MODAL":{let{slug:s}=r;if(s){let i=s in o&&o[s].isOpen;o[s]=Object.assign(Object.assign({},o[s]),{slug:s,openedOn:i?void 0:Date.now(),isOpen:!i})}break}case"CLOSE_MODAL":{let{slug:s}=r;s&&(o[s]=Object.assign(Object.assign({},o[s]),{slug:s,openedOn:void 0,isOpen:!1}));break}case"REMOVE_MODAL":{let{slug:s}=r;s&&s in o&&delete o[s];break}case"CLOSE_LATEST_MODAL":{let s=Object.keys(o).reduce((i,l)=>{let a=o[l];return a.isOpen&&typeof a.openedOn=="number"&&(!i||typeof i.openedOn=="number"&&a.openedOn>i.openedOn)?a:i},void 0);s&&(o[s.slug]=Object.assign(Object.assign({},o[s.slug]),{isOpen:!1,openedOn:void 0}));break}case"CLOSE_ALL_MODALS":{o=Object.entries(o).reduce((s,[i,l])=>(s[i]=Object.assign(Object.assign({},l),{isOpen:!1,openedOn:void 0}),s),{});break}default:break}return o};var I9=()=>{if(typeof window<"u")return new URLSearchParams(window.location.search)},_9=()=>{let t=I9(),e=[];if(t){let o=t.get("modal");o&&(o.includes(",")?e=o.split(","):e=[o])}return e},Cb=t=>{let{classPrefix:e,minifyCSS:o=!0,generateCSS:n=!0,zIndex:r=9999,handleParamChange:s,children:i,transTime:l=250}=t,a=kw(null),[c,u]=S9(Lw,{},()=>_9().reduce(($,N)=>($[N]={slug:N,isOpen:!0,openedOn:Date.now()},$),{})),[d,m]=Ym(!1),[f,p]=Ym(!1),[h,g]=Ym(!1),[b,C]=Ym(""),v=kw(!1),y=Gs(_=>{_.keyCode===27&&u({type:"CLOSE_LATEST_MODAL"})},[]);Jm(()=>(v.current||(document.addEventListener("keydown",_=>y(_),!1),v.current=!0),()=>{v.current&&document.removeEventListener("keydown",_=>y(_),!1)}),[y]),Jm(()=>{if(n){let _="";_=Nw({classPrefix:e,zIndex:r}),o&&(_=_.replace(/\n/g,"").replace(/\s\s+/g," ")),C(_)}},[n,o,r,e]),Jm(()=>{if(typeof s=="function"&&s(c),typeof s=="boolean"&&s){let _=Object.keys(c).filter(k=>c[k].isOpen),A=new URLSearchParams;for(let k of _)A.append("modal",k);let $=A.toString()?`?${A}`:"",N=`${window.location.pathname}${$}`;window.history.pushState({},"",N)}},[c,s]),Jm(()=>{let _=Object.keys(c).some(A=>c[A].isOpen);m(_)},[c]);let w=Gs((_,A)=>{A&&(_?(Pw(A),g(!0)):(Ew(A),g(!1)))},[]),S=Gs(_=>{a.current=_},[]),x=Gs(_=>{u({type:"OPEN_MODAL",payload:{slug:_}})},[]),D=Gs(_=>{u({type:"CLOSE_MODAL",payload:{slug:_}})},[]),F=Gs(()=>{u({type:"CLOSE_ALL_MODALS"})},[]),T=Gs(_=>{u({type:"TOGGLE_MODAL",payload:{slug:_}})},[]),R=Gs(_=>c[_]&&c[_].isOpen,[c]),I=Object.assign({},t);return delete I.children,x9(w9,{children:[n&&$w("style",{dangerouslySetInnerHTML:{__html:b}}),$w(zm.Provider,{value:Object.assign(Object.assign({},I),{transTime:l,containerRef:a,modalState:c,oneModalIsOpen:d,isModalOpen:R,closeOnBlur:f,bodyScrollIsLocked:h,classPrefix:e,closeAllModals:F,setCloseOnBlur:p,openModal:x,closeModal:D,toggleModal:T,setBodyScrollLock:w,setContainerRef:S}),children:i})]})};import{usePathname as X9,useRouter as Z9}from"next/navigation.js";import{formatAdminURL as Y9}from"payload/shared";import*as Gw from"qs-esm";import Ow,{createContext as J9,use as q9,useCallback as Ei,useEffect as Km,useState as $c}from"react";import{c as k9}from"react/compiler-runtime";import{jsx as j9}from"react/jsx-runtime";import{useRouter as B9}from"next/navigation.js";import{formatAdminURL as M9}from"payload/shared";import"react";import{c as L9}from"react/compiler-runtime";import{jsx as Lc,jsxs as wb}from"react/jsx-runtime";import $9 from"react";import{c as yb}from"react/compiler-runtime";import{jsx as ss,jsxs as qm}from"react/jsx-runtime";import{createContext as R9,use as A9,useLayoutEffect as P9,useState as E9}from"react";import{jsx as F9}from"react/jsx-runtime";import"react";var Pc="gutter",Co=t=>{let{children:e,className:o,left:n=!0,negativeLeft:r=!1,negativeRight:s=!1,ref:i,right:l=!0}=t,a=n&&!r,c=l&&!s;return F9("div",{className:[Pc,a&&`${Pc}--left`,c&&`${Pc}--right`,r&&`${Pc}--negative-left`,s&&`${Pc}--negative-right`,o].filter(Boolean).join(" "),ref:i,children:e})};import{c as T9}from"react/compiler-runtime";import{useId as D9}from"react";var Ec=t=>{let e=T9(3),o=D9(),n=lt(),r=`${t}-${o}`,s;return e[0]!==n||e[1]!==r?(s=Nc({slug:r,depth:n}),e[0]=n,e[1]=r,e[2]=s):s=e[2],s};var on="drawer",xb=100,Nc=({slug:t,depth:e})=>`drawer_${e}_${t}`,is=t=>{let e=yb(4),{slug:o,children:n,className:r,disabled:s,onClick:i,...l}=t,{openModal:a}=ie(),c;return e[0]!==i||e[1]!==a||e[2]!==o?(c=d=>{a(o),typeof i=="function"&&i(d)},e[0]=i,e[1]=a,e[2]=o,e[3]=c):c=e[3],ss("button",{className:r,disabled:s,onClick:c,type:"button",...l,children:n})},Nt=t=>{let e=yb(22),{slug:o,children:n,className:r,gutter:s,Header:i,hoverTitle:l,title:a}=t,c=s===void 0?!0:s,{t:u}=P(),{closeModal:d,modalState:m}=ie(),f=Lr(),p=!!m[o]?.isOpen,[h,g]=E9(p),b,C;if(e[0]!==p?(b=()=>{g(p)},C=[p],e[0]=p,e[1]=b,e[2]=C):(b=e[1],C=e[2]),P9(b,C),p){let v=h&&`${on}--is-open`,y=f>1&&`${on}--nested`,w;e[3]!==r||e[4]!==v||e[5]!==y?(w=[r,on,v,y].filter(Boolean),e[3]=r,e[4]=v,e[5]=y,e[6]=w):w=e[6];let S=w.join(" "),x=xb+f,D;if(e[7]!==i||e[8]!==n||e[9]!==d||e[10]!==f||e[11]!==c||e[12]!==l||e[13]!==o||e[14]!==u||e[15]!==S||e[16]!==x||e[17]!==a){let F;e[19]!==d||e[20]!==o?(F=()=>d(o),e[19]=d,e[20]=o,e[21]=F):F=e[21],D=ss(N9,{children:qm(fr,{className:S,slug:o,style:{zIndex:x},children:[(!f||f===1)&&ss("div",{className:`${on}__blur-bg`}),ss("button",{"aria-label":u("general:close"),className:`${on}__close`,id:`close-drawer__${o}`,onClick:F,type:"button"}),qm("div",{className:`${on}__content`,style:{width:`calc(100% - (${f} * var(--gutter-h)))`},children:[ss("div",{className:`${on}__blur-bg-content`}),qm(Co,{className:`${on}__content-children`,left:c,right:c,children:[i,i===void 0&&qm("div",{className:`${on}__header`,children:[ss("h2",{className:`${on}__header__title`,title:l?a:null,children:a}),ss("button",{"aria-label":u("general:close"),className:`${on}__header__close`,id:`close-drawer__${o}`,onClick:()=>d(o),type:"button",children:ss(pt,{})})]}),n]})]})]})}),e[7]=i,e[8]=n,e[9]=d,e[10]=f,e[11]=c,e[12]=l,e[13]=o,e[14]=u,e[15]=S,e[16]=x,e[17]=a,e[18]=D}else D=e[18];return D}return null},jw=R9(1),N9=t=>{let e=yb(3),{children:o}=t,r=Lr()+1,s;return e[0]!==o||e[1]!==r?(s=ss(jw,{value:r,children:o}),e[0]=o,e[1]=r,e[2]=s):s=e[2],s},Lr=()=>A9(jw);var Qm="confirmation-modal";function Qe(t){let e=L9(25),{body:o,cancelLabel:n,className:r,confirmingLabel:s,confirmLabel:i,heading:l,modalSlug:a,onCancel:c,onConfirm:u}=t,d=Lr(),[m,f]=$9.useState(!1),{closeModal:p}=ie(),{t:h}=P(),g;e[0]!==p||e[1]!==m||e[2]!==a||e[3]!==u?(g=async()=>{m||(f(!0),typeof u=="function"&&await u(),f(!1),p(a))},e[0]=p,e[1]=m,e[2]=a,e[3]=u,e[4]=g):g=e[4];let b=g,C;e[5]!==p||e[6]!==m||e[7]!==a||e[8]!==c?(C=()=>{m||(p(a),typeof c=="function"&&c())},e[5]=p,e[6]=m,e[7]=a,e[8]=c,e[9]=C):C=e[9];let v=C,y;e[10]!==r?(y=[Qm,r].filter(Boolean),e[10]=r,e[11]=y):y=e[11];let w=y.join(" "),S=xb+d,x;return e[12]!==o||e[13]!==n||e[14]!==i||e[15]!==m||e[16]!==s||e[17]!==l||e[18]!==a||e[19]!==v||e[20]!==b||e[21]!==h||e[22]!==w||e[23]!==S?(x=Lc(fr,{className:w,slug:a,style:{zIndex:S},children:wb("div",{className:`${Qm}__wrapper`,children:[wb("div",{className:`${Qm}__content`,children:[typeof l=="string"?Lc("h1",{children:l}):l,typeof o=="string"?Lc("p",{children:o}):o]}),wb("div",{className:`${Qm}__controls`,children:[Lc(K,{buttonStyle:"secondary",disabled:m,id:"confirm-cancel",onClick:v,size:"large",type:"button",children:n||h("general:cancel")}),Lc(K,{id:"confirm-action",onClick:b,size:"large",children:m?s||`${h("general:loading")}...`:i||h("general:confirm")})]})]})}),e[12]=o,e[13]=n,e[14]=i,e[15]=m,e[16]=s,e[17]=l,e[18]=a,e[19]=v,e[20]=b,e[21]=h,e[22]=w,e[23]=S,e[24]=x):x=e[24],x}var Sb="stay-logged-in",Bw=()=>{let t=k9(11),{refreshCookie:e}=_e(),o=B9(),{config:n}=G(),{admin:r,routes:s}=n,{routes:i}=r,{logout:l}=i,{admin:a}=s,{t:c}=P(),{startRouteTransition:u}=Xe(),d;t[0]!==a||t[1]!==l||t[2]!==o||t[3]!==u?(d=()=>u(()=>o.push(M9({adminRoute:a,path:l}))),t[0]=a,t[1]=l,t[2]=o,t[3]=u,t[4]=d):d=t[4];let m=d,f;t[5]!==e?(f=()=>{e()},t[5]=e,t[6]=f):f=t[6];let p=f,h;return t[7]!==p||t[8]!==m||t[9]!==c?(h=j9(Qe,{body:c("authentication:youAreInactive"),cancelLabel:c("authentication:stayLoggedIn"),confirmLabel:c("authentication:logOut"),heading:c("authentication:stayLoggedIn"),modalSlug:Sb,onCancel:p,onConfirm:m}),t[7]=p,t[8]=m,t[9]=c,t[10]=h):h=t[10],h};import{c as O9}from"react/compiler-runtime";import{useEffect as V9,useState as G9}from"react";function pr(t,e){let o=O9(4),[n,r]=G9(t),s,i;return o[0]!==e||o[1]!==t?(s=()=>{let l=setTimeout(()=>{r(t)},e);return()=>{clearTimeout(l)}},i=[t,e],o[0]=e,o[1]=t,o[2]=s,o[3]=i):(s=o[2],i=o[3]),V9(s,i),n}import{c as z9}from"react/compiler-runtime";import{useInsertionEffect as W9,useRef as H9}from"react";function zt(t){let e=z9(4),o=H9(t),n,r;e[0]!==t?(n=()=>{o.current=t},r=[t],e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]),W9(n,r);let s;return e[3]===Symbol.for("react.memo_cache_sentinel")?(s=(...i)=>{let l=i,a=o.current;return a(...l)},e[3]=s):s=e[3],s}import*as Mw from"qs-esm";var Oe={delete:(t,e={headers:{}})=>{let o=e&&e.headers?{...e.headers}:{},n={...e,credentials:"include",headers:{...o},method:"delete"};return fetch(t,n)},get:(t,e={headers:{}})=>{let o="";return e.params&&(o=Mw.stringify(e.params,{addQueryPrefix:!0})),fetch(`${t}${o}`,{credentials:"include",...e})},patch:(t,e={headers:{}})=>{let o=e&&e.headers?{...e.headers}:{},n={...e,credentials:"include",headers:{...o},method:"PATCH"};return fetch(t,n)},post:(t,e={headers:{}})=>{let o=e&&e.headers?{...e.headers}:{},n={...e,credentials:"include",headers:{...o},method:"post"};return fetch(`${t}`,n)},put:(t,e={headers:{}})=>{let o=e&&e.headers?{...e.headers}:{},n={...e,credentials:"include",headers:{...o},method:"put"};return fetch(t,n)}};var zw=J9({}),Vw=2147483647;function Ib({children:t,permissions:e,user:o}){let[n,r]=$c(o),[s,i]=$c(),[l,a]=$c(),c=X9(),u=Z9(),{config:d}=G(),{admin:{routes:{inactivity:m},user:f},routes:{admin:p,api:h},serverURL:g}=d,[b,C]=$c(e),{i18n:v}=P(),{closeAllModals:y,openModal:w}=ie(),[S,x]=$c(0),D=pr(S,1e4),F=Ow.useRef(null),{startRouteTransition:T}=Xe(),R=n?.id,I=Ei(()=>{T(()=>u.replace(Y9({adminRoute:p,path:`${m}${window.location.pathname.startsWith(p)?`?redirect=${encodeURIComponent(window.location.pathname)}`:""}`}))),y()},[u,p,m,y,T]),_=Ei(()=>{i(void 0),a(void 0),clearTimeout(F.current)},[]),A=Ei(j=>{j?.user?(r(j.user),i(j.token),a(j.exp)):(r(null),_())},[_]),$=Ei(j=>{let O=Math.round(new Date().getTime()/1e3),z=(typeof l=="number"?l:0)-O;return(j||l&&z<120)&&(F.current=setTimeout(()=>{async function V(){try{let W=await Oe.post(`${g}${h}/${f}/refresh-token?refresh`,{headers:{"Accept-Language":v.language}});if(W.status===200){let X=await W.json();A(X)}else A(null),I()}catch(W){Q.error(W.message)}}V()},1e3)),()=>{clearTimeout(F.current)}},[h,v.language,I,g,A,l,f]),N=Ei(async j=>{try{let O=await Oe.post(`${g}${h}/${f}/refresh-token`,{headers:{"Accept-Language":v.language}});if(O.status===200){let z=await O.json();return j||A(z),z.user}return n&&(A(null),I()),null}catch(O){return Q.error(`Refreshing token failed: ${O.message}`),null}},[h,v.language,I,g,A,f,n]),k=Ei(async()=>{try{n&&n.collection&&(A(null),await Oe.post(`${g}${h}/${n.collection}/logout`))}catch{}return!0},[h,g,A,n]),B=Ei(async({locale:j}={})=>{let O=Gw.stringify({locale:j},{addQueryPrefix:!0});try{let z=await Oe.get(`${g}${h}/access${O}`,{headers:{"Accept-Language":v.language}});if(z.status===200){let V=await z.json();C(V)}else throw new Error(`Fetching permissions failed with status code ${z.status}`)}catch(z){Q.error(`Refreshing permissions failed: ${z.message}`)}},[g,h,v]),E=Ow.useCallback(async()=>{try{let j=await Oe.get(`${g}${h}/${f}/me`,{credentials:"include",headers:{"Accept-Language":v.language}});if(j.status===200){let O=await j.json(),z=null;return A(O),z}}catch(j){Q.error(`Fetching user failed: ${j.message}`)}return null},[g,h,f,v.language,A]),L=zt(E);Km(()=>{L()},[]);let M=zt(()=>{R&&$()});return Km(()=>{M()},[D]),Km(()=>{x(Date.now())},[c]),Km(()=>{let j,O,z=Math.round(new Date().getTime()/1e3),V=typeof l=="number"?l-z:0,W=Math.max(Math.min((V-60)*1e3,Vw),0),X=Math.max(Math.min(V*1e3,Vw),0);if(!n){clearTimeout(j),clearTimeout(O);return}return V>0&&(j=setTimeout(()=>{w(Sb)},W),O=setTimeout(()=>{A(null),I()},X)),()=>{j&&clearTimeout(j),O&&clearTimeout(O)}},[l,w,v,A,n,I]),U9(zw,{value:{fetchFullUser:E,logOut:k,permissions:b,refreshCookie:$,refreshCookieAsync:N,refreshPermissions:B,setPermissions:C,setUser:A,token:s,user:n},children:t})}var _e=()=>q9(zw);import{jsx as Q9}from"react/jsx-runtime";import{dequal as Ww}from"dequal/lite";import{createContext as K9,use as eL,useCallback as Hw,useEffect as tL,useRef as Fb}from"react";function _b(t,e){let o={...t};for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&(typeof e[n]=="object"&&!Array.isArray(e[n])&&t[n]?o[n]=_b(t[n],e[n]):o[n]=e[n]);return o}var Xw=K9({}),Uw=(t,e)=>({body:JSON.stringify({value:t}),headers:{"Accept-Language":e,"Content-Type":"application/json"}}),Tb=({children:t})=>{let e=Fb({}),o=Fb({}),n=Fb({}),{config:r}=G(),{user:s}=_e(),{i18n:i}=P(),{routes:{api:l},serverURL:a}=r;tL(()=>{s||(o.current={})},[s]);let c=Hw(async d=>{let m=o.current;if(typeof m[d]<"u")return m[d];let f=new Promise(p=>{(async()=>{let h=await Oe.get(`${a}${l}/payload-preferences/${d}`,{credentials:"include",headers:{"Accept-Language":i.language}}),g=null;h.status===200&&(g=(await h.json()).value),o.current[d]=g,p(g)})()});return m[d]=f,f},[i.language,l,o,a]),u=Hw(async(d,m,f=!1)=>{if(f===!1){o.current[d]=m,await Oe.post(`${a}${l}/payload-preferences/${d}`,Uw(m,i.language));return}let p=m,h=await c(d);if(typeof m=="object"&&typeof h=="object"&&typeof p=="object"){if(h&&(p=_b(h,p)),Ww(p,h))return;n.current[d]={...n.current[d],...p}}else{if(p===h)return;n.current[d]=p}let g=async()=>{Ww(n.current[d],o.current[d])||(o.current[d]=n.current[d],await Oe.post(`${a}${l}/payload-preferences/${d}`,Uw(o.current[d],i.language)),delete n.current[d])};setTimeout(()=>{g()})},[l,c,i.language,n,a]);return e.current.getPreference=c,e.current.setPreference=u,Q9(Xw,{value:e.current,children:t})},Qt=()=>eL(Xw);var Qw=Jw({}),Kw=Jw({localeIsLoading:!1,setLocaleIsLoading:t=>{}}),aL=async(t,e)=>await fetch(`${e}/payload-preferences/${t}`,{credentials:"include",headers:{"Content-Type":"application/json"},method:"GET"})?.then(o=>o.json()),Db=t=>{let e=oL(27),{children:o,locale:n}=t,{config:r}=G(),{localization:s,routes:i,serverURL:l}=r,a=s===void 0?!1:s,{api:c}=i,{user:u}=_e(),d=a?a.defaultLocale:"en",{getPreference:m}=Qt(),f=rL(),p;e[0]!==f?(p=f.get("locale"),e[0]=f,e[1]=p):p=e[1];let h=p,g;e[2]!==d||e[3]!==n||e[4]!==h||e[5]!==a?(g=()=>!a||a&&!a.locales.length?{}:Vs(a,h)||Vs(a,n)||Vs(a,d)||Vs(a,a.locales[0].code),e[2]=d,e[3]=n,e[4]=h,e[5]=a,e[6]=g):g=e[6];let[b,C]=nL.useState(g),[v,y]=iL(!1),w=sL(b),S,x;e[7]!==b?(S=()=>{b.code!==w.current.code&&y(!1),w.current=b},x=[b],e[7]=b,e[8]=S,e[9]=x):(S=e[8],x=e[9]),Yw(S,x);let D=`${l}${c}`,F;e[10]!==d||e[11]!==D||e[12]!==h||e[13]!==a||e[14]!==u?.id?(F=()=>{(async function(){if(a&&u?.id){let $=h||await aL("locale",D)?.then(lL),N=Vs(a,$)||Vs(a,d)||Vs(a,a?.locales?.[0]?.code);N&&C(N)}})()},e[10]=d,e[11]=D,e[12]=h,e[13]=a,e[14]=u?.id,e[15]=F):F=e[15];let T=u?.id,R;e[16]!==d||e[17]!==D||e[18]!==m||e[19]!==h||e[20]!==a||e[21]!==T?(R=[d,m,a,D,h,T],e[16]=d,e[17]=D,e[18]=m,e[19]=h,e[20]=a,e[21]=T,e[22]=R):R=e[22],Yw(F,R);let I;return e[23]!==o||e[24]!==v||e[25]!==b?(I=Zw(Qw,{value:b,children:Zw(Kw,{value:{localeIsLoading:v,setLocaleIsLoading:y},children:o})}),e[23]=o,e[24]=v,e[25]=b,e[26]=I):I=e[26],I},ef=()=>qw(Kw),Ce=()=>qw(Qw);function lL(t){return t.value}var tf=(t,e,o)=>{if(t)return`field-${t.replace(/\./g,"__")}${e>1?`-${e}`:""}${o?`-${o}`:""}`};var Se=t=>{let{as:e,hideLocale:o,htmlFor:n,label:r,localized:s,path:i,required:l,unstyled:a}=t,c=e===void 0?"label":e,u=o===void 0?!1:o,d=s===void 0?!1:s,m=l===void 0?!1:l,f=a===void 0?!1:a,{uuid:p}=Me(),h=lt(),g=n||tf(i,h,p),{i18n:b}=P(),{code:C,label:v}=Ce(),y=c==="label"?g?"label":"span":c||"span";return r?e2(y,{className:`field-label${f?" unstyled":""}`,htmlFor:g,children:[uL(r,b),m&&!f&&cL("span",{className:"required",children:"*"}),d&&!u&&e2("span",{className:"localized",children:["\u2014 ",typeof v=="string"?v:C]})]}):null};var of=({collapsed:t,rowID:e,rows:o})=>o.reduce((n,r)=>(e===r.id&&(r.collapsed=t),r.collapsed&&n.collapsedIDs.push(r.id),n.updatedRows.push(r),n),{collapsedIDs:[],updatedRows:[]}),rf=({collapsed:t,rows:e})=>e.reduce((o,n)=>(n.collapsed=t,t&&o.collapsedIDs.push(n.id),o.updatedRows.push(n),o),{collapsedIDs:[],updatedRows:[]});import{c as d$}from"react/compiler-runtime";import{jsx as Q2}from"react/jsx-runtime";import*as K2 from"react";import{jsx as Wc,jsxs as a$}from"react/jsx-runtime";import{rtlLanguages as l$}from"@payloadcms/translations";import{useCallback as q2,useMemo as c$}from"react";import{c as t$}from"react/compiler-runtime";import Mb,{useRef as U2}from"react";import{c as dL}from"react/compiler-runtime";import{useEffect as mL,useRef as fL}from"react";var Ni=(t,e,o)=>{let n=dL(9),r;n[0]!==o?(r=o===void 0?[]:o,n[0]=o,n[1]=r):r=n[1];let s=r,i;n[2]===Symbol.for("react.memo_cache_sentinel")?(i=Date.now(),n[2]=i):i=n[2];let l=fL(i),a;n[3]!==t||n[4]!==e?(a=()=>{let u=setTimeout(()=>{Date.now()-l.current>=e&&(t(),l.current=Date.now())},e-(Date.now()-l.current));return()=>{clearTimeout(u)}},n[3]=t,n[4]=e,n[5]=a):a=n[5];let c;n[6]!==e||n[7]!==s?(c=[e,...s],n[6]=e,n[7]=s,n[8]=c):c=n[8],mL(a,c)};import{jsx as df}from"react/jsx-runtime";import*as z2 from"qs-esm";import XL,{createContext as ZL,use as YL,useCallback as qa,useEffect as V2,useMemo as JL,useRef as G2,useState as Mc}from"react";import{useCallback as pL,useEffect as hL,useRef as gL,useState as bL}from"react";function rn(t,e){let[o,n]=bL(t??e),r=gL(!0);hL(()=>{if(r.current){r.current=!1;return}n(t)},[t]);let s=pL(i=>{n(i)},[]);return[o,s]}import{getTranslation as BL}from"@payloadcms/translations";var vL={},kc={};function Xa(t,e){try{let n=(vL[t]||=new Intl.DateTimeFormat("en-GB",{timeZone:t,hour:"numeric",timeZoneName:"longOffset"}).format)(e).split("GMT")[1]||"";return n in kc?kc[n]:t2(n,n.split(":"))}catch{if(t in kc)return kc[t];let o=t?.match(CL);return o?t2(t,o.slice(1)):NaN}}var CL=/([+-]\d\d):?(\d\d)?/;function t2(t,e){let o=+e[0],n=+(e[1]||0);return kc[t]=o>0?o*60+n:o*60-n}var Kt=class t extends Date{constructor(...e){super(),e.length>1&&typeof e[e.length-1]=="string"&&(this.timeZone=e.pop()),this.internal=new Date,isNaN(Xa(this.timeZone,this))?this.setTime(NaN):e.length?typeof e[0]=="number"&&(e.length===1||e.length===2&&typeof e[1]!="number")?this.setTime(e[0]):typeof e[0]=="string"?this.setTime(+new Date(e[0])):e[0]instanceof Date?this.setTime(+e[0]):(this.setTime(+new Date(...e)),r2(this,NaN),Rb(this)):this.setTime(Date.now())}static tz(e,...o){return o.length?new t(...o,e):new t(Date.now(),e)}withTimeZone(e){return new t(+this,e)}getTimezoneOffset(){return-Xa(this.timeZone,this)}setTime(e){return Date.prototype.setTime.apply(this,arguments),Rb(this),+this}[Symbol.for("constructDateFrom")](e){return new t(+new Date(e),this.timeZone)}},o2=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(t=>{if(!o2.test(t))return;let e=t.replace(o2,"$1UTC");Kt.prototype[e]&&(t.startsWith("get")?Kt.prototype[t]=function(){return this.internal[e]()}:(Kt.prototype[t]=function(){return Date.prototype[e].apply(this.internal,arguments),yL(this),+this},Kt.prototype[e]=function(){return Date.prototype[e].apply(this,arguments),Rb(this),+this}))});function Rb(t){t.internal.setTime(+t),t.internal.setUTCMinutes(t.internal.getUTCMinutes()-t.getTimezoneOffset())}function yL(t){Date.prototype.setFullYear.call(t,t.internal.getUTCFullYear(),t.internal.getUTCMonth(),t.internal.getUTCDate()),Date.prototype.setHours.call(t,t.internal.getUTCHours(),t.internal.getUTCMinutes(),t.internal.getUTCSeconds(),t.internal.getUTCMilliseconds()),r2(t)}function r2(t){let e=Xa(t.timeZone,t),o=new Date(+t);o.setUTCHours(o.getUTCHours()-1);let n=-new Date(+t).getTimezoneOffset(),r=-new Date(+o).getTimezoneOffset(),s=n-r,i=Date.prototype.getHours.apply(t)!==t.internal.getUTCHours();s&&i&&t.internal.setUTCMinutes(t.internal.getUTCMinutes()+s);let l=n-e;l&&Date.prototype.setUTCMinutes.call(t,Date.prototype.getUTCMinutes.call(t)+l);let a=Xa(t.timeZone,t),u=-new Date(+t).getTimezoneOffset()-a,d=a!==e,m=u-l;if(d&&m){Date.prototype.setUTCMinutes.call(t,Date.prototype.getUTCMinutes.call(t)+m);let f=Xa(t.timeZone,t),p=a-f;p&&(t.internal.setUTCMinutes(t.internal.getUTCMinutes()+p),Date.prototype.setUTCMinutes.call(t,Date.prototype.getUTCMinutes.call(t)+p))}}var xL=Math.pow(10,8)*24*60*60*1e3,Xie=-xL,nf=6048e5,n2=864e5;var jc=43200,Ab=1440;var wL=3600;var s2=wL*24,Zie=s2*7,SL=s2*365.2425,IL=SL/12,Yie=IL*3,Pb=Symbol.for("constructDateFrom");function io(t,e){return typeof t=="function"?t(e):t&&typeof t=="object"&&Pb in t?t[Pb](e):t instanceof Date?new t.constructor(e):new Date(e)}function ot(t,e){return io(e||t,t)}var _L={};function Rn(){return _L}function as(t,e){let o=Rn(),n=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??o.weekStartsOn??o.locale?.options?.weekStartsOn??0,r=ot(t,e?.in),s=r.getDay(),i=(s<n?7:0)+s-n;return r.setDate(r.getDate()-i),r.setHours(0,0,0,0),r}function Li(t,e){return as(t,{...e,weekStartsOn:1})}function sf(t,e){let o=ot(t,e?.in),n=o.getFullYear(),r=io(o,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);let s=Li(r),i=io(o,0);i.setFullYear(n,0,4),i.setHours(0,0,0,0);let l=Li(i);return o.getTime()>=s.getTime()?n+1:o.getTime()>=l.getTime()?n:n-1}function Za(t){let e=ot(t),o=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return o.setUTCFullYear(e.getFullYear()),+t-+o}function An(t,...e){let o=io.bind(null,t||e.find(n=>typeof n=="object"));return e.map(o)}function zs(t,e){let o=ot(t,e?.in);return o.setHours(0,0,0,0),o}function i2(t,e,o){let[n,r]=An(o?.in,t,e),s=zs(n),i=zs(r),l=+s-Za(s),a=+i-Za(i);return Math.round((l-a)/n2)}function a2(t,e){let o=sf(t,e),n=io(e?.in||t,0);return n.setFullYear(o,0,4),n.setHours(0,0,0,0),Li(n)}function Ya(t,e){let o=+ot(t)-+ot(e);return o<0?-1:o>0?1:o}function af(t){return io(t,Date.now())}function l2(t,e,o){let[n,r]=An(o?.in,t,e);return+zs(n)==+zs(r)}function c2(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function u2(t){return!(!c2(t)&&typeof t!="number"||isNaN(+ot(t)))}function d2(t,e,o){let[n,r]=An(o?.in,t,e),s=n.getFullYear()-r.getFullYear(),i=n.getMonth()-r.getMonth();return s*12+i}function m2(t){return e=>{let n=(t?Math[t]:Math.trunc)(e);return n===0?0:n}}function f2(t,e){return+ot(t)-+ot(e)}function lf(t,e){let o=ot(t,e?.in);return o.setHours(23,59,59,999),o}function p2(t,e){let o=ot(t,e?.in),n=o.getMonth();return o.setFullYear(o.getFullYear(),n+1,0),o.setHours(23,59,59,999),o}function h2(t,e){let o=ot(t,e?.in);return+lf(o,e)==+p2(o,e)}function g2(t,e,o){let[n,r,s]=An(o?.in,t,t,e),i=Ya(r,s),l=Math.abs(d2(r,s));if(l<1)return 0;r.getMonth()===1&&r.getDate()>27&&r.setDate(30),r.setMonth(r.getMonth()-i*l);let a=Ya(r,s)===-i;h2(n)&&l===1&&Ya(n,s)===1&&(a=!1);let c=i*(l-+a);return c===0?0:c}function b2(t,e,o){let n=f2(t,e)/1e3;return m2(o?.roundingMethod)(n)}function v2(t,e){let o=ot(t,e?.in);return o.setFullYear(o.getFullYear(),0,1),o.setHours(0,0,0,0),o}function C2(t){return lf(Date.now(),t)}function y2(t,e){let o=ot(t,e?.in);return i2(o,v2(o))+1}function x2(t,e){let o=ot(t,e?.in),n=+Li(o)-+a2(o);return Math.round(n/nf)+1}function cf(t,e){let o=ot(t,e?.in),n=o.getFullYear(),r=Rn(),s=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,i=io(e?.in||t,0);i.setFullYear(n+1,0,s),i.setHours(0,0,0,0);let l=as(i,e),a=io(e?.in||t,0);a.setFullYear(n,0,s),a.setHours(0,0,0,0);let c=as(a,e);return+o>=+l?n+1:+o>=+c?n:n-1}function w2(t,e){let o=Rn(),n=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,r=cf(t,e),s=io(e?.in||t,0);return s.setFullYear(r,0,n),s.setHours(0,0,0,0),as(s,e)}function S2(t,e){let o=ot(t,e?.in),n=+as(o,e)-+w2(o,e);return Math.round(n/nf)+1}function dt(t,e){let o=t<0?"-":"",n=Math.abs(t).toString().padStart(e,"0");return o+n}var ls={y(t,e){let o=t.getFullYear(),n=o>0?o:1-o;return dt(e==="yy"?n%100:n,e.length)},M(t,e){let o=t.getMonth();return e==="M"?String(o+1):dt(o+1,2)},d(t,e){return dt(t.getDate(),e.length)},a(t,e){let o=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return o.toUpperCase();case"aaa":return o;case"aaaaa":return o[0];case"aaaa":default:return o==="am"?"a.m.":"p.m."}},h(t,e){return dt(t.getHours()%12||12,e.length)},H(t,e){return dt(t.getHours(),e.length)},m(t,e){return dt(t.getMinutes(),e.length)},s(t,e){return dt(t.getSeconds(),e.length)},S(t,e){let o=e.length,n=t.getMilliseconds(),r=Math.trunc(n*Math.pow(10,o-3));return dt(r,e.length)}};var Ja={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Eb={G:function(t,e,o){let n=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return o.era(n,{width:"abbreviated"});case"GGGGG":return o.era(n,{width:"narrow"});case"GGGG":default:return o.era(n,{width:"wide"})}},y:function(t,e,o){if(e==="yo"){let n=t.getFullYear(),r=n>0?n:1-n;return o.ordinalNumber(r,{unit:"year"})}return ls.y(t,e)},Y:function(t,e,o,n){let r=cf(t,n),s=r>0?r:1-r;if(e==="YY"){let i=s%100;return dt(i,2)}return e==="Yo"?o.ordinalNumber(s,{unit:"year"}):dt(s,e.length)},R:function(t,e){let o=sf(t);return dt(o,e.length)},u:function(t,e){let o=t.getFullYear();return dt(o,e.length)},Q:function(t,e,o){let n=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(n);case"QQ":return dt(n,2);case"Qo":return o.ordinalNumber(n,{unit:"quarter"});case"QQQ":return o.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return o.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return o.quarter(n,{width:"wide",context:"formatting"})}},q:function(t,e,o){let n=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(n);case"qq":return dt(n,2);case"qo":return o.ordinalNumber(n,{unit:"quarter"});case"qqq":return o.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return o.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return o.quarter(n,{width:"wide",context:"standalone"})}},M:function(t,e,o){let n=t.getMonth();switch(e){case"M":case"MM":return ls.M(t,e);case"Mo":return o.ordinalNumber(n+1,{unit:"month"});case"MMM":return o.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return o.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return o.month(n,{width:"wide",context:"formatting"})}},L:function(t,e,o){let n=t.getMonth();switch(e){case"L":return String(n+1);case"LL":return dt(n+1,2);case"Lo":return o.ordinalNumber(n+1,{unit:"month"});case"LLL":return o.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return o.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return o.month(n,{width:"wide",context:"standalone"})}},w:function(t,e,o,n){let r=S2(t,n);return e==="wo"?o.ordinalNumber(r,{unit:"week"}):dt(r,e.length)},I:function(t,e,o){let n=x2(t);return e==="Io"?o.ordinalNumber(n,{unit:"week"}):dt(n,e.length)},d:function(t,e,o){return e==="do"?o.ordinalNumber(t.getDate(),{unit:"date"}):ls.d(t,e)},D:function(t,e,o){let n=y2(t);return e==="Do"?o.ordinalNumber(n,{unit:"dayOfYear"}):dt(n,e.length)},E:function(t,e,o){let n=t.getDay();switch(e){case"E":case"EE":case"EEE":return o.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return o.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return o.day(n,{width:"short",context:"formatting"});case"EEEE":default:return o.day(n,{width:"wide",context:"formatting"})}},e:function(t,e,o,n){let r=t.getDay(),s=(r-n.weekStartsOn+8)%7||7;switch(e){case"e":return String(s);case"ee":return dt(s,2);case"eo":return o.ordinalNumber(s,{unit:"day"});case"eee":return o.day(r,{width:"abbreviated",context:"formatting"});case"eeeee":return o.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return o.day(r,{width:"short",context:"formatting"});case"eeee":default:return o.day(r,{width:"wide",context:"formatting"})}},c:function(t,e,o,n){let r=t.getDay(),s=(r-n.weekStartsOn+8)%7||7;switch(e){case"c":return String(s);case"cc":return dt(s,e.length);case"co":return o.ordinalNumber(s,{unit:"day"});case"ccc":return o.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return o.day(r,{width:"narrow",context:"standalone"});case"cccccc":return o.day(r,{width:"short",context:"standalone"});case"cccc":default:return o.day(r,{width:"wide",context:"standalone"})}},i:function(t,e,o){let n=t.getDay(),r=n===0?7:n;switch(e){case"i":return String(r);case"ii":return dt(r,e.length);case"io":return o.ordinalNumber(r,{unit:"day"});case"iii":return o.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return o.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return o.day(n,{width:"short",context:"formatting"});case"iiii":default:return o.day(n,{width:"wide",context:"formatting"})}},a:function(t,e,o){let r=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return o.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return o.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return o.dayPeriod(r,{width:"narrow",context:"formatting"});case"aaaa":default:return o.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(t,e,o){let n=t.getHours(),r;switch(n===12?r=Ja.noon:n===0?r=Ja.midnight:r=n/12>=1?"pm":"am",e){case"b":case"bb":return o.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return o.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return o.dayPeriod(r,{width:"narrow",context:"formatting"});case"bbbb":default:return o.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(t,e,o){let n=t.getHours(),r;switch(n>=17?r=Ja.evening:n>=12?r=Ja.afternoon:n>=4?r=Ja.morning:r=Ja.night,e){case"B":case"BB":case"BBB":return o.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return o.dayPeriod(r,{width:"narrow",context:"formatting"});case"BBBB":default:return o.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(t,e,o){if(e==="ho"){let n=t.getHours()%12;return n===0&&(n=12),o.ordinalNumber(n,{unit:"hour"})}return ls.h(t,e)},H:function(t,e,o){return e==="Ho"?o.ordinalNumber(t.getHours(),{unit:"hour"}):ls.H(t,e)},K:function(t,e,o){let n=t.getHours()%12;return e==="Ko"?o.ordinalNumber(n,{unit:"hour"}):dt(n,e.length)},k:function(t,e,o){let n=t.getHours();return n===0&&(n=24),e==="ko"?o.ordinalNumber(n,{unit:"hour"}):dt(n,e.length)},m:function(t,e,o){return e==="mo"?o.ordinalNumber(t.getMinutes(),{unit:"minute"}):ls.m(t,e)},s:function(t,e,o){return e==="so"?o.ordinalNumber(t.getSeconds(),{unit:"second"}):ls.s(t,e)},S:function(t,e){return ls.S(t,e)},X:function(t,e,o){let n=t.getTimezoneOffset();if(n===0)return"Z";switch(e){case"X":return _2(n);case"XXXX":case"XX":return $i(n);case"XXXXX":case"XXX":default:return $i(n,":")}},x:function(t,e,o){let n=t.getTimezoneOffset();switch(e){case"x":return _2(n);case"xxxx":case"xx":return $i(n);case"xxxxx":case"xxx":default:return $i(n,":")}},O:function(t,e,o){let n=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+I2(n,":");case"OOOO":default:return"GMT"+$i(n,":")}},z:function(t,e,o){let n=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+I2(n,":");case"zzzz":default:return"GMT"+$i(n,":")}},t:function(t,e,o){let n=Math.trunc(+t/1e3);return dt(n,e.length)},T:function(t,e,o){return dt(+t,e.length)}};function I2(t,e=""){let o=t>0?"-":"+",n=Math.abs(t),r=Math.trunc(n/60),s=n%60;return s===0?o+String(r):o+String(r)+e+dt(s,2)}function _2(t,e){return t%60===0?(t>0?"-":"+")+dt(Math.abs(t)/60,2):$i(t,e)}function $i(t,e=""){let o=t>0?"-":"+",n=Math.abs(t),r=dt(Math.trunc(n/60),2),s=dt(n%60,2);return o+r+e+s}var F2=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},T2=(t,e)=>{switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},FL=(t,e)=>{let o=t.match(/(P+)(p+)?/)||[],n=o[1],r=o[2];if(!r)return F2(t,e);let s;switch(n){case"P":s=e.dateTime({width:"short"});break;case"PP":s=e.dateTime({width:"medium"});break;case"PPP":s=e.dateTime({width:"long"});break;case"PPPP":default:s=e.dateTime({width:"full"});break}return s.replace("{{date}}",F2(n,e)).replace("{{time}}",T2(r,e))},D2={p:T2,P:FL};var TL=/^D+$/,DL=/^Y+$/,RL=["D","DD","YY","YYYY"];function R2(t){return TL.test(t)}function A2(t){return DL.test(t)}function P2(t,e,o){let n=AL(t,e,o);if(console.warn(n),RL.includes(t))throw new RangeError(n)}function AL(t,e,o){let n=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${n} to the input \`${o}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}var PL=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,EL=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,NL=/^'([^]*?)'?$/,LL=/''/g,$L=/[a-zA-Z]/;function Nb(t,e,o){let n=Rn(),r=o?.locale??n.locale??gc,s=o?.firstWeekContainsDate??o?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,i=o?.weekStartsOn??o?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,l=ot(t,o?.in);if(!u2(l))throw new RangeError("Invalid time value");let a=e.match(EL).map(u=>{let d=u[0];if(d==="p"||d==="P"){let m=D2[d];return m(u,r.formatLong)}return u}).join("").match(PL).map(u=>{if(u==="''")return{isToken:!1,value:"'"};let d=u[0];if(d==="'")return{isToken:!1,value:kL(u)};if(Eb[d])return{isToken:!0,value:u};if(d.match($L))throw new RangeError("Format string contains an unescaped latin alphabet character `"+d+"`");return{isToken:!1,value:u}});r.localize.preprocessor&&(a=r.localize.preprocessor(l,a));let c={firstWeekContainsDate:s,weekStartsOn:i,locale:r};return a.map(u=>{if(!u.isToken)return u.value;let d=u.value;(!o?.useAdditionalWeekYearTokens&&A2(d)||!o?.useAdditionalDayOfYearTokens&&R2(d))&&P2(d,e,String(t));let m=Eb[d[0]];return m(l,d,r.localize,c)}).join("")}function kL(t){let e=t.match(NL);return e?e[1].replace(LL,"'"):t}function E2(t,e,o){let n=Rn(),r=o?.locale??n.locale??gc,s=2520,i=Ya(t,e);if(isNaN(i))throw new RangeError("Invalid time value");let l=Object.assign({},o,{addSuffix:o?.addSuffix,comparison:i}),[a,c]=An(o?.in,...i>0?[e,t]:[t,e]),u=b2(c,a),d=(Za(c)-Za(a))/1e3,m=Math.round((u-d)/60),f;if(m<2)return o?.includeSeconds?u<5?r.formatDistance("lessThanXSeconds",5,l):u<10?r.formatDistance("lessThanXSeconds",10,l):u<20?r.formatDistance("lessThanXSeconds",20,l):u<40?r.formatDistance("halfAMinute",0,l):u<60?r.formatDistance("lessThanXMinutes",1,l):r.formatDistance("xMinutes",1,l):m===0?r.formatDistance("lessThanXMinutes",1,l):r.formatDistance("xMinutes",m,l);if(m<45)return r.formatDistance("xMinutes",m,l);if(m<90)return r.formatDistance("aboutXHours",1,l);if(m<Ab){let p=Math.round(m/60);return r.formatDistance("aboutXHours",p,l)}else{if(m<s)return r.formatDistance("xDays",1,l);if(m<jc){let p=Math.round(m/Ab);return r.formatDistance("xDays",p,l)}else if(m<jc*2)return f=Math.round(m/jc),r.formatDistance("aboutXMonths",f,l)}if(f=g2(c,a),f<12){let p=Math.round(m/jc);return r.formatDistance("xMonths",p,l)}else{let p=f%12,h=Math.trunc(f/12);return p<3?r.formatDistance("aboutXYears",h,l):p<9?r.formatDistance("overXYears",h,l):r.formatDistance("almostXYears",h+1,l)}}function N2(t,e){return E2(t,af(t),e)}function nn(t,e){let o=jL(e)?new e(0):io(e,0);return o.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),o.setHours(t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()),o}function jL(t){return typeof t=="function"&&t.prototype?.constructor===t}function L2(t,e){return l2(io(e?.in||t,t),af(e?.in||t))}var $r=({date:t,i18n:e,pattern:o,timezone:n})=>{let r=new Kt(new Date(t));if(n){let s=Kt.tz(n),i=r.withTimeZone(n),l=nn(i,s);return e.dateFNS?Nb(l,o,{locale:e.dateFNS}):`${e.t("general:loading")}...`}return e.dateFNS?Nb(r,o,{locale:e.dateFNS}):`${e.t("general:loading")}...`},Lb=({date:t,i18n:e})=>{let o=typeof t=="string"?new Date(t):t;return e?.dateFNS?N2(o,{locale:e.dateFNS}):`${e.t("general:loading")}...`};function $b(t){return typeof t=="object"&&"root"in t}function uf(t,e){for(let o of t)"text"in o&&o.text?e+=o.text:"children"in o||(e+=`[${o.type}]`),"children"in o&&o.children&&(e+=uf(o.children,e));return e}var $2=t=>Array.isArray(t)?t.map(e=>typeof e=="object"&&e!==null?e.id:String(e)).filter(Boolean).join(", "):typeof t=="object"&&t!==null?t.id||"":String(t);var Go=({collectionConfig:t,data:e,dateFormat:o,fallback:n,globalConfig:r,i18n:s})=>{let i;if(t){let l=t?.admin?.useAsTitle;if(l&&(i=e?.[l],i)){let a=t.fields.find(d=>"name"in d&&d.name===l),c=a?.type==="date",u=a?.type==="relationship";if(c){let d="date"in a.admin&&a?.admin?.date?.displayFormat||o;i=$r({date:i,i18n:s,pattern:d})||i}u&&(i=$2(e[l]))}}return r&&(i=BL(r?.label,s)||r?.slug),i&&$b(i)&&(i=uf(i.root.children?.[0]?.children||[],"")),!i&&$b(n)&&(i=uf(n.root.children?.[0]?.children||[],"")),i||(i=typeof n=="string"?n:`[${s.t("general:untitled")}]`),i};import{jsx as ML}from"react/jsx-runtime";import{createContext as OL,use as VL,useEffect as GL,useState as zL}from"react";var k2=OL({}),To=()=>VL(k2),j2=({children:t})=>{let{id:e,collectionSlug:o,data:n,docConfig:r,globalSlug:s,initialData:i}=Te(),{config:{admin:{dateFormat:l}}}=G(),{i18n:a}=P(),[c,u]=zL(()=>Go({collectionConfig:o?r:void 0,data:{...i||{},id:e},dateFormat:l,fallback:e?.toString(),globalConfig:s?r:void 0,i18n:a}));return GL(()=>{u(Go({collectionConfig:o?r:void 0,data:{...n,id:e},dateFormat:l,fallback:e?.toString(),globalConfig:s?r:void 0,i18n:a}))},[n,l,a,e,o,r,s]),ML(k2,{value:{setDocumentTitle:u,title:c},children:t})};import{c as WL}from"react/compiler-runtime";import{jsx as HL}from"react/jsx-runtime";import kb from"react";var B2=kb.createContext({getUploadEdits:()=>{},resetUploadEdits:void 0,updateUploadEdits:void 0,uploadEdits:void 0}),jb=t=>{let e=WL(10),{children:o,initialUploadEdits:n}=t,r;e[0]!==n?(r=n||{},e[0]=n,e[1]=r):r=e[1];let[s,i]=kb.useState(r),l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=()=>{i({})},e[2]=l):l=e[2];let a=l,c;e[3]===Symbol.for("react.memo_cache_sentinel")?(c=p=>{i(h=>({...h||{},...p||{}}))},e[3]=c):c=e[3];let u=c,d;e[4]!==s?(d=()=>s,e[4]=s,e[5]=d):d=e[5];let m=d,f;return e[6]!==o||e[7]!==m||e[8]!==s?(f=HL(B2,{value:{getUploadEdits:m,resetUploadEdits:a,updateUploadEdits:u,uploadEdits:s},children:o}),e[6]=o,e[7]=m,e[8]=s,e[9]=f):f=e[9],f},ki=()=>kb.use(B2);import*as Bb from"qs-esm";import UL from"react";var Bc=t=>{let{collectionSlug:e,docPermissions:o,globalSlug:n,isEditing:r}=t;return e?!!(r&&o?.update||!r&&o?.create):n?!!o?.update:!1};var M2=({id:t,collectionSlug:e,globalSlug:o})=>!!(o||e&&t);var O2=({id:t,api:e,collectionSlug:o,globalSlug:n,i18n:r,locale:s,permissions:i,serverURL:l,setDocPermissions:a,setHasPublishPermission:c,setHasSavePermission:u})=>UL.useCallback(async d=>{let m={locale:s||void 0},f=d?.id||t,p=M2({id:f,collectionSlug:o,globalSlug:n});if(p){let h=o?`/${o}/access/${f}`:n?`/globals/${n}/access`:null;if(h){let b=await(await fetch(`${l}${e}${h}?${Bb.stringify(m)}`,{body:JSON.stringify({...d||{},_status:"draft"}),credentials:"include",headers:{"Accept-Language":r.language,"Content-Type":"application/json"},method:"post"})).json(),C=await fetch(`${l}${e}${h}?${Bb.stringify(m)}`,{body:JSON.stringify({...d||{},_status:"published"}),credentials:"include",headers:{"Accept-Language":r.language,"Content-Type":"application/json"},method:"POST"}).then(v=>v.json());a(b),u(Bc({collectionSlug:o,docPermissions:b,globalSlug:n,isEditing:p})),c(C?.update)}}else{let h=o?i?.collections?.[o]:i?.globals?.[n];a(h),u(Bc({collectionSlug:o,docPermissions:h,globalSlug:n,isEditing:p}))}},[s,t,o,n,l,e,r.language,a,u,c,i?.collections,i?.globals]);var W2=ZL({}),Te=()=>YL(W2),qL=({children:t,...e})=>{let{id:o,collectionSlug:n,currentEditor:r,docPermissions:s,globalSlug:i,hasPublishedDoc:l,hasPublishPermission:a,hasSavePermission:c,initialData:u,initialState:d,isLocked:m,lastUpdateTime:f,mostRecentVersionIsAutosaved:p,unpublishedVersionCount:h,versionCount:g}=e,[b,C]=rn(s),[v,y]=rn(c),[w,S]=rn(a),{permissions:x}=_e(),{config:{admin:{dateFormat:D},routes:{api:F},serverURL:T},getEntityConfig:R}=G(),I=R({collectionSlug:n}),_=R({globalSlug:i}),A=G2(new AbortController),$=I||_,{i18n:N}=P(),{uploadEdits:k}=ki(),[B,E]=Mc(()=>Go({collectionConfig:I,data:{...u||{},id:o},dateFormat:D,fallback:o?.toString(),globalConfig:_,i18n:N})),[L,M]=Mc(p),[j,O]=Mc(g),[z,V]=Mc(l),[W,X]=Mc(h),[U,Z]=rn(m),[ee,ce]=rn(r),[q,te]=rn(f),[le,pe]=rn(u),[fe,ue]=rn("idle"),Fe=G2({hasShownLockedModal:!1,isLocked:!1,user:null}),Ie=qa(Ge=>{ue(Ge)},[ue]),{getPreference:Le,setPreference:Y}=Qt(),{code:ae}=Ce(),{localeIsLoading:H}=ef(),J=JL(()=>d===void 0||u===void 0||H,[u,d,H]),re=`${T}${F}`,ne,he,oe;i&&(ne=i,he="globals",oe=`global-${ne}`),n&&(ne=n,he="collections",o&&(oe=`collection-${ne}-${o}`));let ge=qa(async(Ge,ft)=>{try{let et=ft===i,qt=await Oe.get(`${T}${F}/payload-locked-documents`,{credentials:"include",params:et?{"where[globalSlug][equals]":ft}:{"where[document.relationTo][equals]":ft,"where[document.value][equals]":Ge}}),{docs:Io}=await qt.json();if(Io?.length>0){let _o=Io[0].id;await Oe.delete(`${T}${F}/payload-locked-documents/${_o}`,{credentials:"include",headers:{"Content-Type":"application/json"}}),Z(!1)}}catch(et){console.error("Failed to unlock the document",et)}},[T,F,i,Z]),De=qa(async(Ge,ft,et)=>{try{let qt=ft===i,Io=await Oe.get(`${T}${F}/payload-locked-documents`,{credentials:"include",params:qt?{"where[globalSlug][equals]":ft}:{"where[document.relationTo][equals]":ft,"where[document.value][equals]":Ge}}),{docs:_o}=await Io.json();if(_o?.length>0){let vt=_o[0].id,Zr=typeof et=="object"?{relationTo:et.collection,value:et.id}:{relationTo:"users",value:et};await Oe.patch(`${T}${F}/payload-locked-documents/${vt}`,{body:JSON.stringify({user:Zr}),credentials:"include",headers:{"Content-Type":"application/json"}})}}catch(qt){console.error("Failed to update the document editor",qt)}},[T,F,i]),Be=O2({id:o,api:F,collectionSlug:n,globalSlug:i,i18n:N,locale:ae,permissions:x,serverURL:T,setDocPermissions:C,setHasPublishPermission:S,setHasSavePermission:y}),be=qa(()=>Le(oe),[Le,oe]),ve=qa(async(Ge,ft)=>{let et=await be();if(oe)try{await Y(oe,{...et,fields:{...et?.fields||{},[Ge]:{...et?.fields?.[Ge],...ft}}})}catch(qt){console.error(qt)}},[Y,oe,be]),ye=qa(()=>{let Ge=j+1;I&&I.versions?I.versions.maxPerDoc>0?O(Math.min(Ge,I.versions.maxPerDoc)):O(Ge):_&&_.versions&&(_.versions.max>0?O(Math.min(Ge,_.versions.max)):O(Ge))},[I,_,j]);V2(()=>{E(Go({collectionConfig:I,data:{...le,id:o},dateFormat:D,fallback:o?.toString(),globalConfig:_,i18n:N}))},[I,_,le,D,N,o]),V2(()=>{let Ge=A.current;return()=>{if(Ge)try{Ge.abort()}catch{}}},[]);let Je=XL.useMemo(()=>`${`${re}${he==="globals"?"/globals":""}/${ne}${o?`/${o}`:""}`}${z2.stringify({depth:0,"fallback-locale":"null",locale:ae,uploadEdits:k||void 0},{addQueryPrefix:!0})}`,[re,ae,he,o,ne,k]),it={...e,action:Je,currentEditor:ee,data:le,docConfig:$,docPermissions:b,documentIsLocked:U,documentLockState:Fe,getDocPermissions:Be,getDocPreferences:be,hasPublishedDoc:z,hasPublishPermission:w,hasSavePermission:v,incrementVersionCount:ye,initialData:u,initialState:d,isInitializing:J,lastUpdateTime:q,mostRecentVersionIsAutosaved:L,preferencesKey:oe,savedDocumentData:le,setCurrentEditor:ce,setData:pe,setDocFieldPreferences:ve,setDocumentIsLocked:Z,setDocumentTitle:E,setHasPublishedDoc:V,setLastUpdateTime:te,setMostRecentVersionIsAutosaved:M,setUnpublishedVersionCount:X,setUploadStatus:Ie,title:B,unlockDocument:ge,unpublishedVersionCount:W,updateDocumentEditor:De,updateSavedDocumentData:pe,uploadStatus:fe,versionCount:j};return df(W2,{value:it,children:df(j2,{children:t})})},Oc=t=>df(jb,{children:df(qL,{...t})});import{jsx as QL}from"react/jsx-runtime";import{createContext as KL,use as e$}from"react";var mf=KL(""),Vc=({children:t,operation:e})=>QL(mf,{value:e,children:t}),hr=()=>e$(mf);import H2 from"react";var Qa=H2.createContext(void 0),ff=()=>{let t=H2.useContext(Qa);if(t)return t};var o$=t=>{let e=t$(64),o;e[0]!==t?(o=t||{},e[0]=t,e[1]=o):o=e[1];let{disableFormData:n,hasRows:r,path:s,potentiallyStalePath:i,validate:l}=o,a=n===void 0?!1:n,c=ff(),u=s||c||i,d=so(),m=Er(),f=Si(),{user:p}=_e(),{id:h,collectionSlug:g}=Te(),b=hr(),C=Rt(r$),v;e[2]!==u?(v=pe=>{let[fe]=pe;return fe&&fe?.[u]||null},e[2]=u,e[3]=v):v=e[3];let y=Rt(v),{t:w}=P(),{config:S}=G(),{getData:x,getDataByPath:D,getSiblingData:F,setModified:T}=Me(),R=Na(),I=y?.filterOptions,_=y?.value,A=y?.initialValue,$=typeof y?.valid=="boolean"?y.valid:!0,N=$===!1&&d,k=U2($),B=U2(y?.errorMessage),E;e[4]!==u?(E=u?u.split("."):[],e[4]=u,e[5]=E):E=e[5];let L=E,M;e[6]!==a||e[7]!==C||e[8]!==r||e[9]!==u||e[10]!==T?(M=(pe,fe)=>{let ue=fe===void 0?!1:fe,Ie=pe&&typeof pe=="object"&&typeof pe.preventDefault=="function"&&typeof pe.stopPropagation=="function"?pe.target.value:pe;C({type:"UPDATE",disableFormData:a||r&&Ie>0,path:u,value:Ie}),ue||T(!0)},e[6]=a,e[7]=C,e[8]=r,e[9]=u,e[10]=T,e[11]=M):M=e[11];let j=M,O=y?.customComponents,z=m||f,V=y?.errorMessage,W;e[12]!==y?.errorPaths?(W=y?.errorPaths||[],e[12]=y?.errorPaths,e[13]=W):W=e[13];let X=y?.rows,U=y?.selectFilterOptions,Z=y?.valid,ee;e[14]!==I||e[15]!==A||e[16]!==f||e[17]!==u||e[18]!==m||e[19]!==j||e[20]!==N||e[21]!==d||e[22]!==U||e[23]!==Z||e[24]!==O||e[25]!==z||e[26]!==V||e[27]!==W||e[28]!==X||e[29]!==_?(ee={customComponents:O,disabled:z,errorMessage:V,errorPaths:W,filterOptions:I,formInitializing:f,formProcessing:m,formSubmitted:d,initialValue:A,path:u,rows:X,selectFilterOptions:U,setValue:j,showError:N,valid:Z,value:_},e[14]=I,e[15]=A,e[16]=f,e[17]=u,e[18]=m,e[19]=j,e[20]=N,e[21]=d,e[22]=U,e[23]=Z,e[24]=O,e[25]=z,e[26]=V,e[27]=W,e[28]=X,e[29]=_,e[30]=ee):ee=e[30];let ce=ee,q;e[31]!==g||e[32]!==S||e[33]!==a||e[34]!==C||e[35]!==R||e[36]!==y||e[37]!==x||e[38]!==D||e[39]!==F||e[40]!==r||e[41]!==h||e[42]!==b||e[43]!==u||e[44]!==L||e[45]!==w||e[46]!==p||e[47]!==l||e[48]!==_?(q=()=>{(async()=>{let fe=_;y?.rows&&Array.isArray(y.rows)&&(fe=D(u));let ue=B.current,Fe=k.current,Ie=x(),Le=typeof l=="function"?await l(fe,{id:h,blockData:void 0,collectionSlug:g,data:R?.getData?R.getData():Ie,event:"onChange",operation:b,path:L,preferences:{},req:{payload:{config:S},t:w,user:p},siblingData:F(u)}):typeof B.current=="string"?B.current:k.current;if(typeof Le=="string"?(Fe=!1,ue=Le):typeof Le=="boolean"&&(Fe=Le,ue=void 0),Fe!==k.current||ue!==B.current){k.current=Fe,B.current=ue;let Y={type:"UPDATE",errorMessage:ue,path:u,rows:y?.rows,valid:Fe,validate:l,value:_};(a||r&&typeof _=="number"&&_>0)&&(Y.disableFormData=!0),typeof C=="function"&&C(Y)}})()},e[31]=g,e[32]=S,e[33]=a,e[34]=C,e[35]=R,e[36]=y,e[37]=x,e[38]=D,e[39]=F,e[40]=r,e[41]=h,e[42]=b,e[43]=u,e[44]=L,e[45]=w,e[46]=p,e[47]=l,e[48]=_,e[49]=q):q=e[49];let te=y?.rows,le;return e[50]!==g||e[51]!==a||e[52]!==C||e[53]!==x||e[54]!==D||e[55]!==F||e[56]!==h||e[57]!==b||e[58]!==u||e[59]!==te||e[60]!==p||e[61]!==l||e[62]!==_?(le=[_,a,C,x,F,D,h,b,u,p,l,te,g],e[50]=g,e[51]=a,e[52]=C,e[53]=x,e[54]=D,e[55]=F,e[56]=h,e[57]=b,e[58]=u,e[59]=te,e[60]=p,e[61]=l,e[62]=_,e[63]=le):le=e[63],Ni(q,150,le),ce},X2=Mb.createContext(void 0),$e=t=>{let e=ff(),o=Mb.use(X2),n=Mb.useRef(null);if(n.current===null){let r=t.path||e||t.potentiallyStalePath;n.current=o&&r&&o.path===r?"context":"impl"}if(n.current==="context"){if(!o)throw new Error("FieldContext was removed after mount. This breaks hook ordering.");return o}return o$(t)};function r$(t){let[,e]=t;return e}import{jsx as Z2}from"react/jsx-runtime";import"react";import{c as n$}from"react/compiler-runtime";var Ob=t=>{let e=n$(2),{children:o,path:n}=t,r;e[0]!==n?(r=l=>{let[a]=l;return a&&a?.[n]||null},e[0]=n,e[1]=r):r=e[1];let s=Rt(r),{passesCondition:i}=s||{};return i===!1?null:o};var Ve=t=>o=>{let{path:n}=o;return Z2(Ob,{path:n,children:Z2(t,{...o})})};var Ke=t=>({...t?.admin?.style||{},...t?.admin?.width?{"--field-width":t.admin.width}:{flex:"1 1 auto"},...t?.admin?.style?.flex?{flex:t.admin.style.flex}:{}});var Ae="field-type";function Ka({fieldLocalized:t,fieldRTL:e,locale:o,localizationConfig:n}){let r=o&&n&&n.locales&&n.locales.length>1,s=o?.code===n?.defaultLocale;return e!==!1&&o?.rtl===!0&&(t||!t&&!r||!t&&s)||e===!0}import{c as s$}from"react/compiler-runtime";import{jsx as Gc,jsxs as zb}from"react/jsx-runtime";import{useId as i$}from"react";import{jsx as Y2}from"react/jsx-runtime";import"react";var Vb=()=>Y2("svg",{className:"icon icon--check",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:Y2("path",{className:"stroke",d:"M15.3333 6.00001L8.00001 13.3333L4.66667 10",strokeLinecap:"square"})});import{jsx as J2}from"react/jsx-runtime";import"react";var Gb=()=>J2("svg",{className:"icon icon--line",fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:J2("path",{className:"stroke",d:"M5.33333 10H14.6667",strokeLinecap:"square"})});var zc="checkbox-input",Do=t=>{let e=s$(22),{id:o,name:n,AfterInput:r,BeforeInput:s,checked:i,className:l,inputRef:a,Label:c,label:u,localized:d,onToggle:m,partialChecked:f,readOnly:p,required:h}=t,g=i$(),b=o||g,C=i&&`${zc}--checked`,v=p&&`${zc}--read-only`,y;e[0]!==l||e[1]!==C||e[2]!==v?(y=[l,zc,C,v].filter(Boolean),e[0]=l,e[1]=C,e[2]=v,e[3]=y):y=e[3];let w=y.join(" "),S=!!i,x;if(e[4]!==r||e[5]!==s||e[6]!==c||e[7]!==i||e[8]!==b||e[9]!==a||e[10]!==u||e[11]!==d||e[12]!==n||e[13]!==m||e[14]!==f||e[15]!==p||e[16]!==h||e[17]!==w||e[18]!==S){let D=Gc("input",{"aria-label":"","aria-labelledby":n,defaultChecked:S,disabled:p,id:b,name:n,onInput:m,ref:a,required:h,title:n,type:"checkbox"}),F=!i&&f?"partial":"check",T;e[20]!==F?(T=[`${zc}__icon`,F].filter(Boolean),e[20]=F,e[21]=T):T=e[21],x=zb("div",{className:w,children:[zb("div",{className:`${zc}__input`,children:[s,D,zb("span",{className:T.join(" "),children:[i&&Gc(Vb,{}),!i&&f&&Gc(Gb,{})]}),r]}),Gc(de,{CustomComponent:c,Fallback:Gc(Se,{htmlFor:b,label:u,localized:d,required:h})})]}),e[4]=r,e[5]=s,e[6]=c,e[7]=i,e[8]=b,e[9]=a,e[10]=u,e[11]=d,e[12]=n,e[13]=m,e[14]=f,e[15]=p,e[16]=h,e[17]=w,e[18]=S,e[19]=x}else x=e[19];return x};var Wb="checkbox";var u$=t=>{let{id:e,checked:o,disableFormData:n,field:r,field:{admin:{className:s,description:i}={},label:l,required:a}={},onChange:c,partialChecked:u,path:d,readOnly:m,validate:f}=t,{uuid:p}=Me(),h=lt(),{i18n:{language:g}}=P(),b=l$.includes(g),C=q2((k,B)=>{if(typeof f=="function")return f(k,{...B,required:a})},[f,a]),{customComponents:{AfterInput:v,BeforeInput:y,Description:w,Error:S,Label:x}={},disabled:D,path:F,setValue:T,showError:R,value:I}=$e({disableFormData:n,potentiallyStalePath:d,validate:C}),_=q2(()=>{m||(T(!I),typeof c=="function"&&c(!I))},[c,m,T,I]),A=o||!!I,$=e||tf(F,h,p),N=c$(()=>Ke(r),[r]);return a$("div",{className:[Ae,Wb,R&&"error",s,I&&`${Wb}--checked`,(m||D)&&`${Wb}--read-only`].filter(Boolean).join(" "),style:N,children:[Wc(de,{CustomComponent:S,Fallback:Wc(Ze,{alignCaret:b?"right":"left",path:F,showError:R})}),Wc(Do,{AfterInput:v,BeforeInput:y,checked:A,id:$,inputRef:null,Label:x,label:l,name:F,onToggle:_,partialChecked:u,readOnly:m||D,required:a}),Wc(de,{CustomComponent:w,Fallback:Wc(Ue,{description:i,path:F})})]})},kr=Ve(u$);var m$="nullify-locale-field",Hc=t=>{let e=d$(13),{fieldValue:o,localized:n,path:r,readOnly:s}=t,i=s===void 0?!1:s,{code:l}=Ce(),{config:a}=G(),{localization:c}=a,[u,d]=K2.useState(typeof o!="number"),{t:m}=P(),{dispatchFields:f,setModified:p}=Me();if(!n||!c||c.defaultLocale===l||!c.fallback)return null;let h;e[0]!==u||e[1]!==f||e[2]!==o||e[3]!==r||e[4]!==p?(h=()=>{let C=!u;f({type:"UPDATE",path:r,value:C?null:o||0}),p(!0),d(C)},e[0]=u,e[1]=f,e[2]=o,e[3]=r,e[4]=p,e[5]=h):h=e[5];let g=h;if(o){let C=!1;if(typeof o=="number"&&o>0&&(C=!0),Array.isArray(o)&&o.length>0&&(C=!0),C)return u&&d(!1),null}let b;return e[6]!==u||e[7]!==o||e[8]!==g||e[9]!==r||e[10]!==i||e[11]!==m?(b=Q2(tn,{className:m$,children:!o&&i?m("general:fallbackToDefaultLocale"):Q2(kr,{checked:u,field:{name:"",label:m("general:fallbackToDefaultLocale")},id:`field-${r.replace(/\./g,"__")}`,onChange:g,path:r,schemaPath:""})}),e[6]=u,e[7]=o,e[8]=g,e[9]=r,e[10]=i,e[11]=m,e[12]=b):b=e[12],b};var el=t=>{let e=document.getElementById(t);if(e){let o=e.getBoundingClientRect();window.scrollBy({behavior:"smooth",top:o.top-100})}};import{c as fW}from"react/compiler-runtime";import{jsx as di,jsxs as pW}from"react/jsx-runtime";import{getTranslation as hW}from"@payloadcms/translations";import"react";import{c as f$}from"react/compiler-runtime";import{jsx as gr,jsxs as ji}from"react/jsx-runtime";import p$ from"react";var Ro="array-actions",pf=t=>{let e=f$(12),{addRow:o,copyRow:n,duplicateRow:r,hasMaxRows:s,index:i,isSortable:l,moveRow:a,pasteRow:c,removeRow:u,rowCount:d}=t,{t:m}=P(),f;return e[0]!==o||e[1]!==n||e[2]!==r||e[3]!==s||e[4]!==i||e[5]!==l||e[6]!==a||e[7]!==c||e[8]!==u||e[9]!==d||e[10]!==m?(f=gr(at,{button:gr(Sc,{}),buttonClassName:`${Ro}__button`,className:Ro,horizontalAlign:"center",render:p=>{let{close:h}=p;return ji(xe.ButtonGroup,{buttonSize:"small",children:[l&&i!==0&&ji(xe.Button,{className:`${Ro}__action ${Ro}__move-up`,onClick:()=>{a(i,i-1),h()},children:[gr("div",{className:`${Ro}__action-chevron`,children:gr(ze,{direction:"up"})}),m("general:moveUp")]}),l&&i<d-1&&ji(xe.Button,{className:`${Ro}__action`,onClick:()=>{a(i,i+1),h()},children:[gr("div",{className:`${Ro}__action-chevron`,children:gr(ze,{})}),m("general:moveDown")]}),!s&&ji(p$.Fragment,{children:[ji(xe.Button,{className:`${Ro}__action ${Ro}__add`,onClick:()=>{o(i+1),h()},children:[gr(er,{}),m("general:addBelow")]}),ji(xe.Button,{className:`${Ro}__action ${Ro}__duplicate`,onClick:()=>{r(i),h()},children:[gr(Fi,{}),m("general:duplicate")]})]}),gr(xe.Button,{className:`${Ro}__action ${Ro}__copy`,onClick:()=>{n(i),h()},children:gr(Ba,{isRow:!0})}),gr(xe.Button,{className:`${Ro}__action ${Ro}__paste`,onClick:()=>{c(i),h()},children:gr(Ba,{isPaste:!0,isRow:!0})}),ji(xe.Button,{className:`${Ro}__action ${Ro}__remove`,onClick:()=>{u(i),h()},children:[gr(pt,{}),m("general:remove")]})]})},size:"medium"}),e[0]=o,e[1]=n,e[2]=r,e[3]=s,e[4]=i,e[5]=l,e[6]=a,e[7]=c,e[8]=u,e[9]=d,e[10]=m,e[11]=f):f=e[11],f};import{c as I$}from"react/compiler-runtime";import{jsx as an,jsxs as Xb}from"react/jsx-runtime";import{useState as n3}from"react";import{jsx as tl,jsxs as h$}from"react/jsx-runtime";import"react";var sn=({className:t})=>h$("svg",{className:["icon icon--drag-handle",t].filter(Boolean).join(" "),viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:[tl("path",{className:"fill",d:"M7.99999 10.6667C8.36818 10.6667 8.66666 10.3682 8.66666 9.99999C8.66666 9.6318 8.36818 9.33332 7.99999 9.33332C7.63181 9.33332 7.33333 9.6318 7.33333 9.99999C7.33333 10.3682 7.63181 10.6667 7.99999 10.6667Z",strokeLinecap:"square"}),tl("path",{className:"fill",d:"M7.99999 5.99999C8.36818 5.99999 8.66666 5.70151 8.66666 5.33332C8.66666 4.96513 8.36818 4.66666 7.99999 4.66666C7.63181 4.66666 7.33333 4.96513 7.33333 5.33332C7.33333 5.70151 7.63181 5.99999 7.99999 5.99999Z",strokeLinecap:"square"}),tl("path",{className:"fill",d:"M7.99999 15.3333C8.36818 15.3333 8.66666 15.0348 8.66666 14.6667C8.66666 14.2985 8.36818 14 7.99999 14C7.63181 14 7.33333 14.2985 7.33333 14.6667C7.33333 15.0348 7.63181 15.3333 7.99999 15.3333Z",strokeLinecap:"square"}),tl("path",{className:"fill",d:"M12 10.6667C12.3682 10.6667 12.6667 10.3682 12.6667 9.99999C12.6667 9.6318 12.3682 9.33332 12 9.33332C11.6318 9.33332 11.3333 9.6318 11.3333 9.99999C11.3333 10.3682 11.6318 10.6667 12 10.6667Z",strokeLinecap:"square"}),tl("path",{className:"fill",d:"M12 5.99999C12.3682 5.99999 12.6667 5.70151 12.6667 5.33332C12.6667 4.96513 12.3682 4.66666 12 4.66666C11.6318 4.66666 11.3333 4.96513 11.3333 5.33332C11.3333 5.70151 11.6318 5.99999 12 5.99999Z",strokeLinecap:"square"}),tl("path",{className:"fill",d:"M12 15.3333C12.3682 15.3333 12.6667 15.0348 12.6667 14.6667C12.6667 14.2985 12.3682 14 12 14C11.6318 14 11.3333 14.2985 11.3333 14.6667C11.3333 15.0348 11.6318 15.3333 12 15.3333Z",strokeLinecap:"square"})]});import{jsx as t3}from"react/jsx-runtime";import hf,{useEffect as C$,useRef as Ub}from"react";import{useEffect as g$,useMemo as b$,useRef as Hb,useState as v$}from"react";var e3=({containerRef:t,contentRef:e,duration:o,open:n})=>{let r=b$(()=>typeof CSS<"u"&&CSS&&CSS.supports?CSS.supports("interpolate-size","allow-keywords"):!1,[]),s=Hb(!1),i=Hb(n),[l,a]=v$(!1),c=Hb(null);return g$(()=>{let u=t.current,d=e.current;if(!u||!d||r)return;let m=h=>{u.style.height=h},f=()=>{u&&(u.style.transition="",u.style.height=n?"auto":"0px",a(!1))};return(()=>{if(!s.current&&n){m("auto"),a(!1);return}s.current=!0,i.current!==n&&m(n?"0px":`${d.scrollHeight}px`),u.offsetHeight,a(!0),u.style.transition=`height ${o}ms ease`,m(n?`${d.scrollHeight}px`:"0px");let h=()=>{f(),u.removeEventListener("transitionend",h)};u.addEventListener("transitionend",h)})(),i.current=n,c.current=new ResizeObserver(()=>{l&&(u.style.height=n?`${d.scrollHeight}px`:"0px")}),c.current.observe(d),()=>{u&&(u.style.transition="",u.style.height=""),c.current?.disconnect()}},[n,o,t,e,r]),{browserSupportsKeywordAnimation:r}};var br=({id:t,children:e,className:o,duration:n=300,height:r})=>{let[s,i]=hf.useState(()=>!!r),l=Ub(s),[a,c]=hf.useState(()=>s?"":"none"),[u,d]=hf.useState(()=>s?"":"hidden"),[m,f]=hf.useState(!1),p=Ub(null),h=Ub(null);return C$(()=>{let g,b,C=!!r,v=l.current!==C;return l.current=C,v&&(f(!0),d("hidden"),C?c(""):g=window.setTimeout(()=>{c("none")},n),i(C),b=window.setTimeout(()=>{d(""),f(!1)},n)),()=>{g&&clearTimeout(g),b&&clearTimeout(b)}},[r,n]),e3({containerRef:p,contentRef:h,duration:n,open:s}),t3("div",{"aria-hidden":!s,className:[o,"rah-static",s&&r==="auto"&&"rah-static--height-auto",m&&`rah-animating--${s?"down":"up"}`,m&&r==="auto"&&"rah-animating--to-height-auto"].filter(Boolean).join(" "),id:t,ref:p,style:{overflow:u,transition:`height ${n}ms ease`},children:t3("div",{ref:h,...a?{style:{display:a}}:{},children:e})})};import{jsx as y$}from"react/jsx-runtime";import x$,{createContext as w$,use as S$}from"react";var o3=w$({isCollapsed:void 0,isVisible:void 0,isWithinCollapsible:void 0,toggle:()=>{}}),r3=({children:t,isCollapsed:e,isWithinCollapsible:o=!0,toggle:n})=>{let{isCollapsed:r,isVisible:s}=Ws(),i=x$.useMemo(()=>({isCollapsed:e,isVisible:s&&!r,isWithinCollapsible:o,toggle:n}),[e,o,n,r,s]);return y$(o3,{value:i,children:t})},Ws=()=>S$(o3);var jo="collapsible";var Bi=t=>{let e=I$(24),{actions:o,children:n,className:r,collapsibleStyle:s,dragHandleProps:i,header:l,initCollapsed:a,isCollapsed:c,onToggle:u}=t,d=s===void 0?"default":s,[m,f]=n3(!!a),[p,h]=n3(!1),{isWithinCollapsible:g}=Ws(),{t:b}=P(),C=typeof c=="boolean"?c:m,v;e[0]!==C||e[1]!==u?(v=()=>{typeof u=="function"&&u(!C),f(!C)},e[0]=C,e[1]=u,e[2]=v):v=e[2];let y=v,w=i&&`${jo}--has-drag-handle`,S=C&&`${jo}--collapsed`,x=g&&`${jo}--nested`,D=p&&`${jo}--hovered`,F=`${jo}--style-${d}`,T;e[3]!==r||e[4]!==w||e[5]!==S||e[6]!==x||e[7]!==D||e[8]!==F?(T=[jo,r,w,S,x,D,F].filter(Boolean),e[3]=r,e[4]=w,e[5]=S,e[6]=x,e[7]=D,e[8]=F,e[9]=T):T=e[9];let R=T.join(" "),I,_;e[10]===Symbol.for("react.memo_cache_sentinel")?(I=()=>h(!0),_=()=>h(!1),e[10]=I,e[11]=_):(I=e[10],_=e[11]);let A=`${jo}__toggle--${C?"collapsed":"open"}`,$;e[12]!==A?($=[`${jo}__toggle`,A].filter(Boolean),e[12]=A,e[13]=$):$=e[13];let N=$.join(" "),k;return e[14]!==o||e[15]!==n||e[16]!==i||e[17]!==l||e[18]!==C||e[19]!==b||e[20]!==N||e[21]!==R||e[22]!==y?(k=an("div",{className:R,children:Xb(r3,{isCollapsed:C,toggle:y,children:[Xb("div",{className:`${jo}__toggle-wrap`,onMouseEnter:I,onMouseLeave:_,children:[an("button",{className:N,onClick:y,type:"button",children:an("span",{children:b("fields:toggleBlock")})}),i&&an("div",{className:`${jo}__drag`,...i.attributes,...i.listeners,children:an(sn,{})}),l?an("div",{className:[`${jo}__header-wrap`,i&&`${jo}__header-wrap--has-drag-handle`].filter(Boolean).join(" "),children:l}):null,Xb("div",{className:`${jo}__actions-wrap`,children:[o?an("div",{className:`${jo}__actions`,children:o}):null,an("div",{className:`${jo}__indicator`,children:an(ze,{direction:C?void 0:"up"})})]})]}),an(br,{height:C?0:"auto",children:an("div",{className:`${jo}__content`,children:n})})]})}),e[14]=o,e[15]=n,e[16]=i,e[17]=l,e[18]=C,e[19]=b,e[20]=N,e[21]=R,e[22]=y,e[23]=k):k=e[23],k};import{c as cW}from"react/compiler-runtime";import{jsx as v0}from"react/jsx-runtime";import{fieldIsHiddenOrDisabled as uW,getFieldPaths as dW,getFieldPermissions as mW}from"payload/shared";import"react";import{c as _$}from"react/compiler-runtime";import{jsx as F$}from"react/jsx-runtime";import s3 from"react";var i3=t=>{let e=_$(9),{children:o,className:n,forceRender:r}=t,[s,i]=s3.useState(!!r),l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l={rootMargin:"1000px"},e[0]=l):l=e[0];let[a,c]=es(l,!!r),u=!!c?.isIntersecting,d=c?.boundingClientRect?.top<0,m=r||u||d,f,p;e[1]!==s||e[2]!==m?(f=()=>{m&&!s&&i(!0)},p=[m,s],e[1]=s,e[2]=m,e[3]=f,e[4]=p):(f=e[3],p=e[4]),s3.useEffect(f,p);let h=s?o:null,g;return e[5]!==n||e[6]!==a||e[7]!==h?(g=F$("div",{className:n,ref:a,children:h}),e[5]=n,e[6]=a,e[7]=h,e[8]=g):g=e[8],g};import{c as lW}from"react/compiler-runtime";import{jsx as Mt}from"react/jsx-runtime";import"react";import{jsx as Wt,jsxs as us}from"react/jsx-runtime";import{getTranslation as Qb}from"@payloadcms/translations";import Z$,{Fragment as F3,useCallback as En,useMemo as T3}from"react";import{c as H$}from"react/compiler-runtime";import{jsx as cn,jsxs as I3,Fragment as U$}from"react/jsx-runtime";import{getTranslation as X$}from"@payloadcms/translations";import"react";import{c as T$}from"react/compiler-runtime";import{jsx as Uc,jsxs as D$}from"react/jsx-runtime";import"react";var jr="pill",R$=t=>{let e=T$(12),{id:o,className:n}=t,r;e[0]!==o?(r={id:o},e[0]=o,e[1]=r):r=e[1];let{attributes:s,isDragging:i,listeners:l,setNodeRef:a,transform:c}=Ga(r),u=i&&`${jr}--is-dragging`,d;e[2]!==n||e[3]!==u?(d=[u,n].filter(Boolean),e[2]=n,e[3]=u,e[4]=d):d=e[4];let m=d.join(" "),f;return e[5]!==s||e[6]!==l||e[7]!==t||e[8]!==a||e[9]!==m||e[10]!==c?(f=Uc(a3,{...t,className:m,elementProps:{...l,...s,ref:a,style:{transform:c}}}),e[5]=s,e[6]=l,e[7]=t,e[8]=a,e[9]=m,e[10]=c,e[11]=f):f=e[11],f},a3=t=>{let{id:e,alignIcon:o="right","aria-checked":n,"aria-controls":r,"aria-expanded":s,"aria-label":i,children:l,className:a,draggable:c,elementProps:u,icon:d,onClick:m,pillStyle:f="light",rounded:p,size:h="medium",to:g}=t,b=[jr,`${jr}--style-${f}`,`${jr}--size-${h}`,a&&a,g&&`${jr}--has-link`,(g||m)&&`${jr}--has-action`,d&&`${jr}--has-icon`,d&&`${jr}--align-icon-${o}`,c&&`${jr}--draggable`,p&&`${jr}--rounded`].filter(Boolean).join(" "),C="div";return m&&!g&&(C="button"),g&&(C=Gt),D$(C,{...u,"aria-checked":n,"aria-controls":r,"aria-expanded":s,"aria-label":i,className:b,href:g||null,id:e,onClick:m,type:C==="button"?"button":void 0,children:[Uc("span",{className:`${jr}__label`,children:l}),!!d&&Uc("span",{className:`${jr}__icon`,children:d})]})},ct=t=>{let{draggable:e}=t;return e?Uc(R$,{...t}):Uc(a3,{...t})};import{useEffect as A$,useState as P$}from"react";function gf(t,e){let[o,n]=P$(t);return A$(()=>{let r=setTimeout(()=>{n(t)},e);return()=>{clearTimeout(r)}},[t,e]),o}import{c as G$}from"react/compiler-runtime";import{jsx as C3,jsxs as z$}from"react/jsx-runtime";import y3 from"react";import{jsx as Pn,jsxs as g3}from"react/jsx-runtime";import{getTranslation as Cf}from"@payloadcms/translations";import{useEffect as b3,useMemo as O$,useState as v3}from"react";import{c as E$}from"react/compiler-runtime";import{jsx as l3,jsxs as N$}from"react/jsx-runtime";import"react";var Xc="thumbnail-card",c3=t=>{let e=E$(13),{alignLabel:o,className:n,collection:r,doc:s,label:i,onClick:l,thumbnail:a}=t,{config:c}=G(),{i18n:u}=P(),d=typeof l=="function"&&`${Xc}--has-on-click`,m=o&&`${Xc}--align-label-${o}`,f;e[0]!==n||e[1]!==d||e[2]!==m?(f=[Xc,n,d,m].filter(Boolean),e[0]=n,e[1]=d,e[2]=m,e[3]=f):f=e[3];let p=f.join(" "),h;if(e[4]!==p||e[5]!==r||e[6]!==c||e[7]!==s||e[8]!==u||e[9]!==i||e[10]!==l||e[11]!==a){let g=i;g||(g=Go({collectionConfig:r,data:s,dateFormat:c.admin.dateFormat,fallback:s?.filename,i18n:u})),h=N$("button",{className:p,onClick:l,title:g,type:"button",children:[l3("div",{className:`${Xc}__thumbnail`,children:a}),l3("div",{className:`${Xc}__label`,children:g})]}),e[4]=p,e[5]=r,e[6]=c,e[7]=s,e[8]=u,e[9]=i,e[10]=l,e[11]=a,e[12]=h}else h=e[12];return h};import{jsx as cs,jsxs as d3}from"react/jsx-runtime";import{useState as j$}from"react";var Ao=[];for(bf=0;bf<256;++bf)Ao.push((bf+256).toString(16).slice(1));var bf;function u3(t,e=0){return(Ao[t[e+0]]+Ao[t[e+1]]+Ao[t[e+2]]+Ao[t[e+3]]+"-"+Ao[t[e+4]]+Ao[t[e+5]]+"-"+Ao[t[e+6]]+Ao[t[e+7]]+"-"+Ao[t[e+8]]+Ao[t[e+9]]+"-"+Ao[t[e+10]]+Ao[t[e+11]]+Ao[t[e+12]]+Ao[t[e+13]]+Ao[t[e+14]]+Ao[t[e+15]]).toLowerCase()}var vf,L$=new Uint8Array(16);function Zb(){if(!vf&&(vf=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!vf))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return vf(L$)}var $$=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Yb={randomUUID:$$};function k$(t,e,o){if(Yb.randomUUID&&!e&&!t)return Yb.randomUUID();t=t||{};var n=t.random||(t.rng||Zb)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,e){o=o||0;for(var r=0;r<16;++r)e[o+r]=n[r];return e}return u3(n)}var ln=k$;var Jb=()=>{let[t]=j$(()=>`pattern${ln()}`);return d3("svg",{fill:"none",height:"151",preserveAspectRatio:"xMidYMid slice",viewBox:"0 0 231 151",width:"231",xmlns:"http://www.w3.org/2000/svg",children:[d3("g",{clipPath:`url(#${t})`,children:[cs("rect",{fill:"#D9D9D9",height:"100%",rx:"2",width:"100%"}),cs("rect",{fill:"#BCBCBC",height:"116.063",transform:"rotate(52.0687 33.7051 79.3051)",width:"85.8593",x:"33.7051",y:"79.3051"}),cs("rect",{fill:"#BCBCBC",height:"116.063",transform:"rotate(52.0687 86.1219 92.6272)",width:"85.8593",x:"86.1219",y:"92.6272"}),cs("circle",{cx:"189",cy:"45",fill:"#BCBCBC",r:"19"}),cs("rect",{fill:"#B8B8B8",height:"5",rx:"2.5",width:"98",x:"66",y:"70"}),cs("rect",{fill:"#B8B8B8",height:"5",rx:"2.5",width:"76",x:"77",y:"82"})]}),cs("defs",{children:cs("clipPath",{id:`${t}`,children:cs("rect",{fill:"white",height:"151",width:"231"})})})]})};import{c as B$}from"react/compiler-runtime";import{jsx as f3,jsxs as M$}from"react/jsx-runtime";import"react";import{jsx as m3}from"react/jsx-runtime";import"react";var Mi=()=>m3("svg",{className:"icon icon--search",fill:"none",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:m3("path",{className:"stroke",d:"M16 16L13.1333 13.1333M14.6667 9.33333C14.6667 12.2789 12.2789 14.6667 9.33333 14.6667C6.38781 14.6667 4 12.2789 4 9.33333C4 6.38781 6.38781 4 9.33333 4C12.2789 4 14.6667 6.38781 14.6667 9.33333Z",strokeLinecap:"square"})});var p3="block-search",h3=t=>{let e=B$(5),{setSearchTerm:o}=t,{t:n}=P(),r;e[0]!==o?(r=l=>{o(l.target.value)},e[0]=o,e[1]=r):r=e[1];let s=r,i;return e[2]!==s||e[3]!==n?(i=M$("div",{className:p3,children:[f3("input",{className:`${p3}__input`,onChange:s,placeholder:n("fields:searchForBlock")}),f3(Mi,{})]}),e[2]=s,e[3]=n,e[4]=i):i=e[4],i};var Hs="blocks-drawer",V$=(t,e)=>typeof t.labels.singular=="string"?t.labels.singular.toLowerCase():typeof t.labels.singular=="object"?Cf(t.labels.singular,e).toLowerCase():"",Zc=t=>{let{addRow:e,addRowIndex:o,blocks:n,drawerSlug:r,labels:s}=t,[i,l]=v3(""),[a,c]=v3(n),{closeModal:u,isModalOpen:d}=ie(),{i18n:m,t:f}=P(),{config:p}=G(),h=O$(()=>{let g={_none:[]};return a.forEach(b=>{if(typeof b=="object"&&b.admin?.group){let C=b.admin.group,v=typeof C=="string"?C:Cf(C,m);Object.hasOwn(g,v)?g[v].push(b):g[v]=[b]}else g._none.push(b)}),g},[a,m]);return b3(()=>{d(r)||l("")},[d,r]),b3(()=>{let g=i.toLowerCase(),b=n?.reduce((C,v)=>{let y=typeof v=="string"?p.blocksMap[v]:v;return V$(y,m).includes(g)&&C.push(y),C},[]);c(b)},[i,n,m,p.blocksMap]),g3(Nt,{slug:r,title:f("fields:addLabel",{label:Cf(s.singular,m)}),children:[Pn(h3,{setSearchTerm:l}),Pn("div",{className:`${Hs}__blocks-wrapper`,children:Pn("ul",{className:`${Hs}__block-groups`,children:Object.entries(h).map(([g,b])=>b.length?g3("li",{className:[`${Hs}__block-group`,g==="_none"&&`${Hs}__block-group-none`].filter(Boolean).join(" "),children:[g!=="_none"&&Pn("h3",{className:`${Hs}__block-group-label`,children:g}),Pn("ul",{className:`${Hs}__blocks`,children:b.map((C,v)=>{let y=typeof C=="string"?p.blocksMap[C]:C,{slug:w,imageAltText:S,imageURL:x,labels:D}=y;return Pn("li",{className:`${Hs}__block`,children:Pn(c3,{alignLabel:"center",label:Cf(D?.singular,m),onClick:()=>{e(o,w),u(r)},thumbnail:Pn("div",{className:`${Hs}__default-image`,children:x?Pn("img",{alt:S,src:x}):Pn(Jb,{})})})},v)})})]},g):null)})})]})};var x3=t=>{let e=G$(28),{addRow:o,blocks:n,blockType:r,copyRow:s,duplicateRow:i,hasMaxRows:l,isSortable:a,labels:c,moveRow:u,pasteRow:d,removeRow:m,rowCount:f,rowIndex:p}=t,{closeModal:h,openModal:g}=ie(),b=Ec("blocks-drawer"),[C,v]=y3.useState(null),y;e[0]!==o||e[1]!==h||e[2]!==b||e[3]!==C?(y=(S,x)=>{typeof o=="function"&&o(C,x),h(b)},e[0]=o,e[1]=h,e[2]=b,e[3]=C,e[4]=y):y=e[4];let w;if(e[5]!==r||e[6]!==n||e[7]!==s||e[8]!==b||e[9]!==i||e[10]!==l||e[11]!==a||e[12]!==c||e[13]!==u||e[14]!==g||e[15]!==d||e[16]!==m||e[17]!==f||e[18]!==p||e[19]!==y){let S;e[21]!==b||e[22]!==g?(S=D=>{v(D),g(b)},e[21]=b,e[22]=g,e[23]=S):S=e[23];let x;e[24]!==r||e[25]!==i||e[26]!==p?(x=()=>i(p,r),e[24]=r,e[25]=i,e[26]=p,e[27]=x):x=e[27],w=z$(y3.Fragment,{children:[C3(Zc,{addRow:y,addRowIndex:p,blocks:n,drawerSlug:b,labels:c}),C3(pf,{addRow:S,copyRow:s,duplicateRow:x,hasMaxRows:l,index:p,isSortable:a,moveRow:u,pasteRow:d,removeRow:m,rowCount:f})]}),e[5]=r,e[6]=n,e[7]=s,e[8]=b,e[9]=i,e[10]=l,e[11]=a,e[12]=c,e[13]=u,e[14]=g,e[15]=d,e[16]=m,e[17]=f,e[18]=p,e[19]=y,e[20]=w}else w=e[20];return w};import{c as W$}from"react/compiler-runtime";import{jsx as w3}from"react/jsx-runtime";import"react";var S3="section-title",qb=t=>{let e=W$(14),{customOnChange:o,customValue:n,path:r,readOnly:s}=t,i;e[0]!==r?(i={path:r},e[0]=r,e[1]=i):i=e[1];let{setValue:l,value:a}=$e(i),{t:c}=P(),u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=[S3].filter(Boolean),e[2]=u):u=e[2];let d=u.join(" "),m;e[3]!==o||e[4]!==l?(m=o||(g=>{g.stopPropagation(),g.preventDefault(),l(g.target.value)}),e[3]=o,e[4]=l,e[5]=m):m=e[5];let f=m,p=n||a,h;return e[6]!==n||e[7]!==f||e[8]!==r||e[9]!==s||e[10]!==c||e[11]!==p||e[12]!==a?(h=w3("div",{className:d,"data-value":p,children:w3("input",{className:`${S3}__input`,id:r,name:r,onChange:f,placeholder:c("general:untitled"),readOnly:s,type:"text",value:n||a||""})}),e[6]=n,e[7]=f,e[8]=r,e[9]=s,e[10]=c,e[11]=p,e[12]=a,e[13]=h):h=e[13],h};var Us="blocks-field",_3=t=>{let e=H$(42),{addRow:o,attributes:n,block:r,blocks:s,copyRow:i,duplicateRow:l,errorCount:a,fields:c,hasMaxRows:u,isLoading:d,isSortable:m,Label:f,labels:p,listeners:h,moveRow:g,parentPath:b,pasteRow:C,path:v,permissions:y,readOnly:w,removeRow:S,row:x,rowCount:D,rowIndex:F,schemaPath:T,setCollapse:R,setNodeRef:I,transform:_}=t,A=gf(d,500),{i18n:$}=P(),k=so()&&a>0,B=!r.admin?.disableBlockName,E=k?`${Us}__row--has-errors`:`${Us}__row--no-errors`,L;e[0]!==E?(L=[`${Us}__row`,E].filter(Boolean),e[0]=E,e[1]=L):L=e[1];let M=L.join(" "),j;if(y===!0)j=!0;else{let V=y?.blocks?.[r.slug];V===!0?j=!0:j=V?.fields}let O=`${b?.split(".").join("-")}-row-${F}`,z;if(e[2]!==f||e[3]!==o||e[4]!==n||e[5]!==r.fields||e[6]!==r.labels||e[7]!==j||e[8]!==s||e[9]!==M||e[10]!==i||e[11]!==l||e[12]!==a||e[13]!==k||e[14]!==c||e[15]!==u||e[16]!==$||e[17]!==A||e[18]!==m||e[19]!==p||e[20]!==h||e[21]!==g||e[22]!==b||e[23]!==C||e[24]!==v||e[25]!==w||e[26]!==S||e[27]!==x.blockType||e[28]!==x.collapsed||e[29]!==x.id||e[30]!==D||e[31]!==F||e[32]!==T||e[33]!==R||e[34]!==I||e[35]!==B||e[36]!==O||e[37]!==_){let V;e[39]!==x.id||e[40]!==R?(V=W=>R(x.id,W),e[39]=x.id,e[40]=R,e[41]=V):V=e[41],z=cn("div",{id:O,ref:I,style:{transform:_},children:cn(Bi,{actions:w?void 0:cn(x3,{addRow:o,blocks:s,blockType:x.blockType,copyRow:i,duplicateRow:l,fields:r.fields,hasMaxRows:u,isSortable:m,labels:p,moveRow:g,pasteRow:C,removeRow:S,rowCount:D,rowIndex:F}),className:M,collapsibleStyle:k?"error":"default",dragHandleProps:m?{id:x.id,attributes:n,listeners:h}:void 0,header:A?cn(wt,{height:"1rem",width:"8rem"}):I3("div",{className:`${Us}__block-header`,children:[cn(Kn,{CustomComponent:f,label:I3(U$,{children:[cn("span",{className:`${Us}__block-number`,children:String(F+1).padStart(2,"0")}),cn(ct,{className:`${Us}__block-pill ${Us}__block-pill-${x.blockType}`,pillStyle:"white",size:"small",children:X$(r.labels.singular,$)}),B&&cn(qb,{path:`${v}.blockName`,readOnly:w})]}),path:v,rowNumber:F}),k&&cn(vo,{count:a,i18n:$,withMessage:!0})]}),isCollapsed:x.collapsed,onToggle:V,children:A?cn(wt,{}):cn(Po,{className:`${Us}__fields`,fields:c,margins:"small",parentIndexPath:"",parentPath:v,parentSchemaPath:T,permissions:j,readOnly:w})},x.id)},`${b}-row-${F}`),e[2]=f,e[3]=o,e[4]=n,e[5]=r.fields,e[6]=r.labels,e[7]=j,e[8]=s,e[9]=M,e[10]=i,e[11]=l,e[12]=a,e[13]=k,e[14]=c,e[15]=u,e[16]=$,e[17]=A,e[18]=m,e[19]=p,e[20]=h,e[21]=g,e[22]=b,e[23]=C,e[24]=v,e[25]=w,e[26]=S,e[27]=x.blockType,e[28]=x.collapsed,e[29]=x.id,e[30]=D,e[31]=F,e[32]=T,e[33]=R,e[34]=I,e[35]=B,e[36]=O,e[37]=_,e[38]=z}else z=e[38];return z};var Br="blocks-field",Y$=t=>{let{i18n:e,t:o}=P(),{field:n,field:{name:r,type:s,admin:{className:i,description:l,isSortable:a=!0}={},blockReferences:c,blocks:u,label:d,labels:m,localized:f,maxRows:p,minRows:h,required:g},path:b,permissions:C,readOnly:v,schemaPath:y,validate:w}=t,S=y??r,x=h??g?1:0,{setDocFieldPreferences:D}=Te(),{addFieldRow:F,dispatchFields:T,getFields:R,moveFieldRow:I,removeFieldRow:_,replaceState:A,setModified:$}=Me(),{code:N}=Ce(),{config:{localization:k},config:B}=G(),E=Ec("blocks-drawer"),L=so(),M={plural:o("fields:blocks"),singular:o("fields:block"),...m},j=(()=>{if(k&&k.fallback){let be=k.defaultLocale;return N===be}return!0})(),O=T3(()=>{if(!c)return u;let be=[];for(let ve of c){let ye=typeof ve=="string"?B.blocksMap[ve]:ve;ye&&be.push(ye)}return be},[c,u,B.blocksMap]),z=En((be,ve)=>{if(!j&&be===null)return!0;if(typeof w=="function")return w(be,{...ve,maxRows:p,minRows:x,required:g})},[p,x,g,w,j]),{customComponents:{AfterInput:V,BeforeInput:W,Description:X,Error:U,Label:Z}={},disabled:ee,errorPaths:ce,path:q,rows:te=[],showError:le,valid:pe,value:fe}=$e({hasRows:!0,potentiallyStalePath:b,validate:z}),ue=En((be,ve)=>{F({blockType:ve,path:q,rowIndex:be,schemaPath:S}),setTimeout(()=>{el(`${q}-row-${be+1}`)},0)},[F,q,S]),Fe=En(be=>{T({type:"DUPLICATE_ROW",path:q,rowIndex:be}),$(!0),setTimeout(()=>{el(`${q}-row-${be+1}`)},0)},[T,q,$]),Ie=En(be=>{_({path:q,rowIndex:be})},[q,_]),Le=En((be,ve)=>{I({moveFromIndex:be,moveToIndex:ve,path:q})},[I,q]),Y=En(be=>{let{collapsedIDs:ve,updatedRows:ye}=rf({collapsed:be,rows:te});T({type:"SET_ALL_ROWS_COLLAPSED",path:q,updatedRows:ye}),D(q,{collapsed:ve})},[T,q,te,D]),ae=En((be,ve)=>{let{collapsedIDs:ye,updatedRows:Je}=of({collapsed:ve,rowID:be,rows:te});T({type:"SET_ROW_COLLAPSED",path:q,updatedRows:Je}),D(q,{collapsed:ye})},[T,q,te,D]),H=En(be=>{let ve=ka({type:s,blocks:O,getDataToCopy:()=>Oa({formState:{...R()},path:q,rowIndex:be}),path:q,rowIndex:be,t:o});typeof ve=="string"?Q.error(ve):Q.success(o("general:copied"))},[O,q,o,s,R]),J=En(be=>{let ye=ja({onPaste:Je=>{let it={...R()},Ge=Va({dataFromClipboard:Je,formState:it,path:q,rowIndex:be});A(Ge),$(!0)},path:q,schemaBlocks:O,t:o});typeof ye=="string"&&Q.error(ye)},[O,R,q,A,$,o]),re=En(be=>{let ve={...R()},ye=Va({dataFromClipboard:be,formState:ve,path:q});A(ye),$(!0)},[R,q,A,$]),ne=p&&te.length>=p,he=ce.length,oe=L&&he+(pe?0:1)>0,ge=te.length<x||g&&te.length===0,De=v&&te.length===0,Be=T3(()=>Ke(n),[n]);return us("div",{className:[Ae,Br,i,oe?`${Br}--has-error`:`${Br}--has-no-error`].filter(Boolean).join(" "),id:`field-${q?.replace(/\./g,"__")}`,style:Be,children:[le&&Wt(de,{CustomComponent:U,Fallback:Wt(Ze,{path:q,showError:le})}),us("header",{className:`${Br}__header`,children:[us("div",{className:`${Br}__header-wrap`,children:[us("div",{className:`${Br}__heading-with-error`,children:[Wt("h3",{children:Wt(de,{CustomComponent:Z,Fallback:Wt(Se,{as:"span",label:d,localized:f,path:q,required:g})})}),oe&&he>0&&Wt(vo,{count:he,i18n:e,withMessage:!0})]}),us("ul",{className:`${Br}__header-actions`,children:[te.length>0&&us(F3,{children:[Wt("li",{children:Wt("button",{className:`${Br}__header-action`,onClick:()=>Y(!0),type:"button",children:o("fields:collapseAll")})}),Wt("li",{children:Wt("button",{className:`${Br}__header-action`,onClick:()=>Y(!1),type:"button",children:o("fields:showAll")})})]}),Wt("li",{children:Wt(Em,{allowCopy:te?.length>0,allowPaste:!v,blocks:O,className:`${Br}__header-action`,disabled:ee,getDataToCopy:()=>Oa({formState:{...R()},path:q}),onPaste:re,path:q,type:s})})]})]}),Wt(de,{CustomComponent:X,Fallback:Wt(Ue,{description:l,path:q})})]}),W,Wt(Hc,{fieldValue:fe,localized:f,path:q,readOnly:v}),(te.length>0||!pe&&(De||ge))&&us(Nr,{className:`${Br}__rows`,ids:te.map(be=>be.id),onDragEnd:({moveFromIndex:be,moveToIndex:ve})=>Le(be,ve),children:[te.map((be,ve)=>{let{blockType:ye,isLoading:Je}=be,it=B.blocksMap[ye]??(c??u).find(Ge=>typeof Ge!="string"&&Ge.slug===ye);if(it){let Ge=`${q}.${ve}`,ft=ce.filter(et=>et.startsWith(Ge+".")).length;return Wt(Dn,{disabled:v||ee||!a,id:be.id,children:et=>Wt(_3,{...et,addRow:ue,block:it,blocks:c??u,copyRow:H,duplicateRow:Fe,errorCount:ft,fields:it.fields,hasMaxRows:ne,isLoading:Je,isSortable:a,Label:te?.[ve]?.customComponents?.RowLabel,labels:M,moveRow:Le,parentPath:q,pasteRow:J,path:Ge,permissions:C,readOnly:v||ee,removeRow:Ie,row:be,rowCount:te.length,rowIndex:ve,schemaPath:S+it.slug,setCollapse:ae})},be.id)}return null}),!j&&us(Z$.Fragment,{children:[ge&&Wt(tn,{type:"error",children:o("validation:requiresAtLeast",{count:x,label:Qb(x>1?M.plural:M.singular,e)||o(x>1?"general:row":"general:rows")})}),De&&Wt(tn,{children:o("validation:fieldHasNo",{label:Qb(M.plural,e)})})]})]}),!ne&&us(F3,{children:[Wt(is,{className:`${Br}__drawer-toggler`,disabled:v||ee,slug:E,children:Wt(K,{buttonStyle:"icon-label",disabled:v||ee,el:"span",icon:"plus",iconPosition:"left",iconStyle:"with-border",children:o("fields:addLabel",{label:Qb(M.singular,e)})})}),Wt(Zc,{addRow:ue,addRowIndex:te?.length||0,blocks:c??u,drawerSlug:E,labels:M})]}),V]})},Yc=Ve(Y$);import{jsx as Oi,jsxs as D3}from"react/jsx-runtime";import K$,{useCallback as R3,useEffect as ek,useMemo as tk,useState as A3}from"react";import{jsx as Kb}from"react/jsx-runtime";import{lazy as J$,Suspense as q$}from"react";var Q$=J$(()=>import("./CodeEditor-O6BWJHD2.js")),Jc=t=>Kb(q$,{fallback:Kb(wt,{}),children:Kb(Q$,{...t})});var ok={js:"javascript",ts:"typescript"},rk="code-field",nk=t=>{let{field:e,field:{admin:{className:o,description:n,editorOptions:r={},language:s="javascript"}={},label:i,localized:l,required:a},onMount:c,path:u,readOnly:d,validate:m}=t,f=K$.useRef("system"),[p,h]=A3(""),g=R3((N,k)=>{if(typeof m=="function")return m(N,{...k,required:a})},[m,a]),{customComponents:{AfterInput:b,BeforeInput:C,Description:v,Error:y,Label:w}={},disabled:S,initialValue:x,path:D,setValue:F,showError:T,value:R}=$e({potentiallyStalePath:u,validate:g}),[I,_]=A3(()=>(R||x)!==void 0?R??x:void 0),A=R3(N=>{if(!(d||S)){f.current="user";try{F(N||null)}catch{F(N||null)}}},[d,S,F]);ek(()=>{f.current==="system"&&(_((R||x)!==void 0?R??x:void 0),h(`${D}-${new Date().toString()}`)),f.current="system"},[x,D,R]);let $=tk(()=>Ke(e),[e]);return D3("div",{className:[Ae,rk,o,T&&"error",(d||S)&&"read-only"].filter(Boolean).join(" "),style:$,children:[Oi(de,{CustomComponent:w,Fallback:Oi(Se,{label:i,localized:l,path:D,required:a})}),D3("div",{className:`${Ae}__wrap`,children:[Oi(de,{CustomComponent:y,Fallback:Oi(Ze,{path:D,showError:T})}),C,Oi(Jc,{defaultLanguage:ok[s]||s,onChange:A,onMount:c,options:r,readOnly:d||S,value:I,wrapperProps:{id:`field-${D?.replace(/\./g,"__")}`}},p),b]}),Oi(de,{CustomComponent:v,Fallback:Oi(Ue,{description:n,path:D})})]})},qc=Ve(nk);import{jsx as Gi,jsxs as e1}from"react/jsx-runtime";import{getTranslation as ik}from"@payloadcms/translations";import{Fragment as ak,useCallback as lk,useEffect as ck,useMemo as uk,useState as E3}from"react";import{c as sk}from"react/compiler-runtime";import{fieldAffectsData as P3}from"payload/shared";var yf=t=>t.reduce((e,o)=>{let n="fields"in o?o.fields:void 0;return n?P3(o)?e.push(`${o.name}.`):e.push(...yf(n)):o.type==="tabs"?"tabs"in o&&o.tabs?.forEach(r=>{"name"in r?e.push(`${r.name}.`):e.push(...yf(r.fields))}):P3(o)&&e.push(o.name),e},[]);var Vi=t=>{let e=sk(12),{fields:o,path:n,setErrorCount:r}=t,[s]=Bs(),i=so(),l;e[0]!==o?(l=yf(o),e[0]=o,e[1]=l):l=e[1];let a=l,c;e[2]!==s||e[3]!==i||e[4]!==n||e[5]!==a||e[6]!==r?(c=()=>{if(i){let d=0;Object.entries(s).forEach(m=>{let[f]=m;if(a?.some(h=>{let g=[...n,h].join(".");return g.endsWith(".")?f.startsWith(g):f===g})){let h=s[f];"valid"in h&&!h.valid&&(d=d+1)}}),r(d)}},e[2]=s,e[3]=i,e[4]=n,e[5]=a,e[6]=r,e[7]=c):c=e[7];let u;return e[8]!==o||e[9]!==s||e[10]!==i?(u=[s,i,o],e[8]=o,e[9]=s,e[10]=i,e[11]=u):u=e[11],Ni(c,250,u),null};var Qc="collapsible-field",dk=t=>{let{field:e,field:{admin:{className:o,description:n,initCollapsed:r=!1}={},fields:s,label:i}={},indexPath:l,parentPath:a,parentSchemaPath:c,path:u,permissions:d,readOnly:m}=t,{i18n:f}=P(),{getPreference:p,setPreference:h}=Qt(),{preferencesKey:g}=Te(),[b,C]=E3(),v=`collapsible-${u?.replace(/\./g,"__")}`,[y,w]=E3(0),S=y>0,{customComponents:{AfterInput:x,BeforeInput:D,Description:F,Label:T}={},disabled:R}=$e({path:u}),I=lk(async A=>{let $=await p(g);g&&h(g,{...$,...u?{fields:{...$?.fields||{},[u]:{...$?.fields?.[u],collapsed:A}}}:{fields:{...$?.fields||{},[v]:{...$?.fields?.[v],collapsed:A}}}})},[g,v,p,h,u]);ck(()=>{(async()=>{if(g){let $=await p(g),N=u?$?.fields?.[u]?.collapsed:$?.fields?.[v]?.collapsed;C(N!==void 0?!!N:typeof r=="boolean"?r:!1)}else C(typeof r=="boolean"?r:!1)})()},[p,g,v,r,u]);let _=uk(()=>Ke(e),[e]);return typeof b!="boolean"?null:e1(ak,{children:[Gi(Vi,{fields:s,path:u.split(".").slice(0,-1),setErrorCount:w}),e1("div",{className:[Ae,Qc,o,S?`${Qc}--has-error`:`${Qc}--has-no-error`].filter(Boolean).join(" "),id:`field-${v}`,style:_,children:[D,Gi(Bi,{className:`${Qc}__collapsible`,collapsibleStyle:S?"error":"default",header:e1("div",{className:`${Qc}__row-label-wrap`,children:[Gi(Kn,{CustomComponent:T,label:ik(i,f),path:u}),S&&Gi(vo,{count:y,i18n:f,withMessage:!0})]}),initCollapsed:b,onToggle:I,children:Gi(Po,{fields:s,margins:"small",parentIndexPath:l,parentPath:a,parentSchemaPath:c,permissions:d,readOnly:m||R})}),x,Gi(de,{CustomComponent:F,Fallback:Gi(Ue,{description:n,path:u})})]})]})},Kc=Ve(dk);import{jsx as Js,jsxs as S_}from"react/jsx-runtime";import{getTranslation as cM}from"@payloadcms/translations";import{useCallback as z1,useMemo as I_}from"react";import{jsx as t1}from"react/jsx-runtime";import{lazy as mk,Suspense as fk}from"react";var pk=mk(()=>import("./DatePicker-F432AIH3.js")),ol=t=>t1(fk,{fallback:t1(wt,{height:50}),children:t1(pk,{...t})});import{jsx as w_,jsxs as aM}from"react/jsx-runtime";import{useMemo as lM}from"react";import{jsx as Xi}from"react/jsx-runtime";import{getTranslation as C_}from"@payloadcms/translations";import y_,{useEffect as rM,useId as nM}from"react";function un(t){"@babel/helpers - typeof";return un=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},un(t)}function N3(t,e){if(un(t)!="object"||!t)return t;var o=t[Symbol.toPrimitive];if(o!==void 0){var n=o.call(t,e||"default");if(un(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function xf(t){var e=N3(t,"string");return un(e)=="symbol"?e:e+""}function zi(t,e,o){return(e=xf(e))in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t}function L3(t,e){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),o.push.apply(o,n)}return o}function Ne(t){for(var e=1;e<arguments.length;e++){var o=arguments[e]!=null?arguments[e]:{};e%2?L3(Object(o),!0).forEach(function(n){zi(t,n,o[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):L3(Object(o)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(o,n))})}return t}function $3(t){if(Array.isArray(t))return t}function k3(t,e){var o=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(o!=null){var n,r,s,i,l=[],a=!0,c=!1;try{if(s=(o=o.call(t)).next,e===0){if(Object(o)!==o)return;a=!1}else for(;!(a=(n=s.call(o)).done)&&(l.push(n.value),l.length!==e);a=!0);}catch(u){c=!0,r=u}finally{try{if(!a&&o.return!=null&&(i=o.return(),Object(i)!==i))return}finally{if(c)throw r}}return l}}function eu(t,e){(e==null||e>t.length)&&(e=t.length);for(var o=0,n=Array(e);o<e;o++)n[o]=t[o];return n}function wf(t,e){if(t){if(typeof t=="string")return eu(t,e);var o={}.toString.call(t).slice(8,-1);return o==="Object"&&t.constructor&&(o=t.constructor.name),o==="Map"||o==="Set"?Array.from(t):o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?eu(t,e):void 0}}function j3(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
48
|
+
`};var Lw=(t,e)=>{let o=Object.assign({},t),{type:n,payload:r}=e;switch(n){case"UPDATE_MODAL":{let{slug:s}=r;s&&(o[s]=Object.assign(Object.assign({},o[s]),r));break}case"OPEN_MODAL":{let{slug:s}=r;s&&(s in o&&o[s].isOpen||(o[s]=Object.assign(Object.assign({},o[s]),{slug:s,openedOn:Date.now(),isOpen:!0})));break}case"TOGGLE_MODAL":{let{slug:s}=r;if(s){let i=s in o&&o[s].isOpen;o[s]=Object.assign(Object.assign({},o[s]),{slug:s,openedOn:i?void 0:Date.now(),isOpen:!i})}break}case"CLOSE_MODAL":{let{slug:s}=r;s&&(o[s]=Object.assign(Object.assign({},o[s]),{slug:s,openedOn:void 0,isOpen:!1}));break}case"REMOVE_MODAL":{let{slug:s}=r;s&&s in o&&delete o[s];break}case"CLOSE_LATEST_MODAL":{let s=Object.keys(o).reduce((i,l)=>{let a=o[l];return a.isOpen&&typeof a.openedOn=="number"&&(!i||typeof i.openedOn=="number"&&a.openedOn>i.openedOn)?a:i},void 0);s&&(o[s.slug]=Object.assign(Object.assign({},o[s.slug]),{isOpen:!1,openedOn:void 0}));break}case"CLOSE_ALL_MODALS":{o=Object.entries(o).reduce((s,[i,l])=>(s[i]=Object.assign(Object.assign({},l),{isOpen:!1,openedOn:void 0}),s),{});break}default:break}return o};var I9=()=>{if(typeof window<"u")return new URLSearchParams(window.location.search)},_9=()=>{let t=I9(),e=[];if(t){let o=t.get("modal");o&&(o.includes(",")?e=o.split(","):e=[o])}return e},Cb=t=>{let{classPrefix:e,minifyCSS:o=!0,generateCSS:n=!0,zIndex:r=9999,handleParamChange:s,children:i,transTime:l=250}=t,a=kw(null),[c,u]=S9(Lw,{},()=>_9().reduce(($,N)=>($[N]={slug:N,isOpen:!0,openedOn:Date.now()},$),{})),[d,m]=Ym(!1),[f,p]=Ym(!1),[h,g]=Ym(!1),[b,C]=Ym(""),v=kw(!1),y=Gs(_=>{_.keyCode===27&&u({type:"CLOSE_LATEST_MODAL"})},[]);Jm(()=>(v.current||(document.addEventListener("keydown",_=>y(_),!1),v.current=!0),()=>{v.current&&document.removeEventListener("keydown",_=>y(_),!1)}),[y]),Jm(()=>{if(n){let _="";_=Nw({classPrefix:e,zIndex:r}),o&&(_=_.replace(/\n/g,"").replace(/\s\s+/g," ")),C(_)}},[n,o,r,e]),Jm(()=>{if(typeof s=="function"&&s(c),typeof s=="boolean"&&s){let _=Object.keys(c).filter(k=>c[k].isOpen),A=new URLSearchParams;for(let k of _)A.append("modal",k);let $=A.toString()?`?${A}`:"",N=`${window.location.pathname}${$}`;window.history.pushState({},"",N)}},[c,s]),Jm(()=>{let _=Object.keys(c).some(A=>c[A].isOpen);m(_)},[c]);let w=Gs((_,A)=>{A&&(_?(Pw(A),g(!0)):(Ew(A),g(!1)))},[]),S=Gs(_=>{a.current=_},[]),x=Gs(_=>{u({type:"OPEN_MODAL",payload:{slug:_}})},[]),D=Gs(_=>{u({type:"CLOSE_MODAL",payload:{slug:_}})},[]),F=Gs(()=>{u({type:"CLOSE_ALL_MODALS"})},[]),T=Gs(_=>{u({type:"TOGGLE_MODAL",payload:{slug:_}})},[]),R=Gs(_=>c[_]&&c[_].isOpen,[c]),I=Object.assign({},t);return delete I.children,x9(w9,{children:[n&&$w("style",{dangerouslySetInnerHTML:{__html:b}}),$w(zm.Provider,{value:Object.assign(Object.assign({},I),{transTime:l,containerRef:a,modalState:c,oneModalIsOpen:d,isModalOpen:R,closeOnBlur:f,bodyScrollIsLocked:h,classPrefix:e,closeAllModals:F,setCloseOnBlur:p,openModal:x,closeModal:D,toggleModal:T,setBodyScrollLock:w,setContainerRef:S}),children:i})]})};import{usePathname as X9,useRouter as Z9}from"next/navigation.js";import{formatAdminURL as Y9}from"payload/shared";import*as Gw from"qs-esm";import Ow,{createContext as J9,use as q9,useCallback as Ei,useEffect as Km,useState as $c}from"react";import{c as k9}from"react/compiler-runtime";import{jsx as j9}from"react/jsx-runtime";import{useRouter as B9}from"next/navigation.js";import{formatAdminURL as M9}from"payload/shared";import"react";import{c as L9}from"react/compiler-runtime";import{jsx as Lc,jsxs as wb}from"react/jsx-runtime";import $9 from"react";import{c as yb}from"react/compiler-runtime";import{jsx as ss,jsxs as qm}from"react/jsx-runtime";import{createContext as R9,use as A9,useLayoutEffect as P9,useState as E9}from"react";import{jsx as F9}from"react/jsx-runtime";import"react";var Pc="gutter",Co=t=>{let{children:e,className:o,left:n=!0,negativeLeft:r=!1,negativeRight:s=!1,ref:i,right:l=!0}=t,a=n&&!r,c=l&&!s;return F9("div",{className:[Pc,a&&`${Pc}--left`,c&&`${Pc}--right`,r&&`${Pc}--negative-left`,s&&`${Pc}--negative-right`,o].filter(Boolean).join(" "),ref:i,children:e})};import{c as T9}from"react/compiler-runtime";import{useId as D9}from"react";var Ec=t=>{let e=T9(3),o=D9(),n=lt(),r=`${t}-${o}`,s;return e[0]!==n||e[1]!==r?(s=Nc({slug:r,depth:n}),e[0]=n,e[1]=r,e[2]=s):s=e[2],s};var on="drawer",xb=100,Nc=({slug:t,depth:e})=>`drawer_${e}_${t}`,is=t=>{let e=yb(4),{slug:o,children:n,className:r,disabled:s,onClick:i,...l}=t,{openModal:a}=ie(),c;return e[0]!==i||e[1]!==a||e[2]!==o?(c=d=>{a(o),typeof i=="function"&&i(d)},e[0]=i,e[1]=a,e[2]=o,e[3]=c):c=e[3],ss("button",{className:r,disabled:s,onClick:c,type:"button",...l,children:n})},Nt=t=>{let e=yb(22),{slug:o,children:n,className:r,gutter:s,Header:i,hoverTitle:l,title:a}=t,c=s===void 0?!0:s,{t:u}=P(),{closeModal:d,modalState:m}=ie(),f=Lr(),p=!!m[o]?.isOpen,[h,g]=E9(p),b,C;if(e[0]!==p?(b=()=>{g(p)},C=[p],e[0]=p,e[1]=b,e[2]=C):(b=e[1],C=e[2]),P9(b,C),p){let v=h&&`${on}--is-open`,y=f>1&&`${on}--nested`,w;e[3]!==r||e[4]!==v||e[5]!==y?(w=[r,on,v,y].filter(Boolean),e[3]=r,e[4]=v,e[5]=y,e[6]=w):w=e[6];let S=w.join(" "),x=xb+f,D;if(e[7]!==i||e[8]!==n||e[9]!==d||e[10]!==f||e[11]!==c||e[12]!==l||e[13]!==o||e[14]!==u||e[15]!==S||e[16]!==x||e[17]!==a){let F;e[19]!==d||e[20]!==o?(F=()=>d(o),e[19]=d,e[20]=o,e[21]=F):F=e[21],D=ss(N9,{children:qm(fr,{className:S,slug:o,style:{zIndex:x},children:[(!f||f===1)&&ss("div",{className:`${on}__blur-bg`}),ss("button",{"aria-label":u("general:close"),className:`${on}__close`,id:`close-drawer__${o}`,onClick:F,type:"button"}),qm("div",{className:`${on}__content`,style:{width:`calc(100% - (${f} * var(--gutter-h)))`},children:[ss("div",{className:`${on}__blur-bg-content`}),qm(Co,{className:`${on}__content-children`,left:c,right:c,children:[i,i===void 0&&qm("div",{className:`${on}__header`,children:[ss("h2",{className:`${on}__header__title`,title:l?a:null,children:a}),ss("button",{"aria-label":u("general:close"),className:`${on}__header__close`,id:`close-drawer__${o}`,onClick:()=>d(o),type:"button",children:ss(pt,{})})]}),n]})]})]})}),e[7]=i,e[8]=n,e[9]=d,e[10]=f,e[11]=c,e[12]=l,e[13]=o,e[14]=u,e[15]=S,e[16]=x,e[17]=a,e[18]=D}else D=e[18];return D}return null},jw=R9(1),N9=t=>{let e=yb(3),{children:o}=t,r=Lr()+1,s;return e[0]!==o||e[1]!==r?(s=ss(jw,{value:r,children:o}),e[0]=o,e[1]=r,e[2]=s):s=e[2],s},Lr=()=>A9(jw);var Qm="confirmation-modal";function Qe(t){let e=L9(25),{body:o,cancelLabel:n,className:r,confirmingLabel:s,confirmLabel:i,heading:l,modalSlug:a,onCancel:c,onConfirm:u}=t,d=Lr(),[m,f]=$9.useState(!1),{closeModal:p}=ie(),{t:h}=P(),g;e[0]!==p||e[1]!==m||e[2]!==a||e[3]!==u?(g=async()=>{m||(f(!0),typeof u=="function"&&await u(),f(!1),p(a))},e[0]=p,e[1]=m,e[2]=a,e[3]=u,e[4]=g):g=e[4];let b=g,C;e[5]!==p||e[6]!==m||e[7]!==a||e[8]!==c?(C=()=>{m||(p(a),typeof c=="function"&&c())},e[5]=p,e[6]=m,e[7]=a,e[8]=c,e[9]=C):C=e[9];let v=C,y;e[10]!==r?(y=[Qm,r].filter(Boolean),e[10]=r,e[11]=y):y=e[11];let w=y.join(" "),S=xb+d,x;return e[12]!==o||e[13]!==n||e[14]!==i||e[15]!==m||e[16]!==s||e[17]!==l||e[18]!==a||e[19]!==v||e[20]!==b||e[21]!==h||e[22]!==w||e[23]!==S?(x=Lc(fr,{className:w,slug:a,style:{zIndex:S},children:wb("div",{className:`${Qm}__wrapper`,children:[wb("div",{className:`${Qm}__content`,children:[typeof l=="string"?Lc("h1",{children:l}):l,typeof o=="string"?Lc("p",{children:o}):o]}),wb("div",{className:`${Qm}__controls`,children:[Lc(K,{buttonStyle:"secondary",disabled:m,id:"confirm-cancel",onClick:v,size:"large",type:"button",children:n||h("general:cancel")}),Lc(K,{id:"confirm-action",onClick:b,size:"large",children:m?s||`${h("general:loading")}...`:i||h("general:confirm")})]})]})}),e[12]=o,e[13]=n,e[14]=i,e[15]=m,e[16]=s,e[17]=l,e[18]=a,e[19]=v,e[20]=b,e[21]=h,e[22]=w,e[23]=S,e[24]=x):x=e[24],x}var Sb="stay-logged-in",Bw=()=>{let t=k9(11),{refreshCookie:e}=_e(),o=B9(),{config:n}=G(),{admin:r,routes:s}=n,{routes:i}=r,{logout:l}=i,{admin:a}=s,{t:c}=P(),{startRouteTransition:u}=Xe(),d;t[0]!==a||t[1]!==l||t[2]!==o||t[3]!==u?(d=()=>u(()=>o.push(M9({adminRoute:a,path:l}))),t[0]=a,t[1]=l,t[2]=o,t[3]=u,t[4]=d):d=t[4];let m=d,f;t[5]!==e?(f=()=>{e()},t[5]=e,t[6]=f):f=t[6];let p=f,h;return t[7]!==p||t[8]!==m||t[9]!==c?(h=j9(Qe,{body:c("authentication:youAreInactive"),cancelLabel:c("authentication:stayLoggedIn"),confirmLabel:c("authentication:logOut"),heading:c("authentication:stayLoggedIn"),modalSlug:Sb,onCancel:p,onConfirm:m}),t[7]=p,t[8]=m,t[9]=c,t[10]=h):h=t[10],h};import{c as O9}from"react/compiler-runtime";import{useEffect as V9,useState as G9}from"react";function pr(t,e){let o=O9(4),[n,r]=G9(t),s,i;return o[0]!==e||o[1]!==t?(s=()=>{let l=setTimeout(()=>{r(t)},e);return()=>{clearTimeout(l)}},i=[t,e],o[0]=e,o[1]=t,o[2]=s,o[3]=i):(s=o[2],i=o[3]),V9(s,i),n}import{c as z9}from"react/compiler-runtime";import{useInsertionEffect as W9,useRef as H9}from"react";function zt(t){let e=z9(4),o=H9(t),n,r;e[0]!==t?(n=()=>{o.current=t},r=[t],e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]),W9(n,r);let s;return e[3]===Symbol.for("react.memo_cache_sentinel")?(s=(...i)=>{let l=i,a=o.current;return a(...l)},e[3]=s):s=e[3],s}import*as Mw from"qs-esm";var Oe={delete:(t,e={headers:{}})=>{let o=e&&e.headers?{...e.headers}:{},n={...e,credentials:"include",headers:{...o},method:"delete"};return fetch(t,n)},get:(t,e={headers:{}})=>{let o="";return e.params&&(o=Mw.stringify(e.params,{addQueryPrefix:!0})),fetch(`${t}${o}`,{credentials:"include",...e})},patch:(t,e={headers:{}})=>{let o=e&&e.headers?{...e.headers}:{},n={...e,credentials:"include",headers:{...o},method:"PATCH"};return fetch(t,n)},post:(t,e={headers:{}})=>{let o=e&&e.headers?{...e.headers}:{},n={...e,credentials:"include",headers:{...o},method:"post"};return fetch(`${t}`,n)},put:(t,e={headers:{}})=>{let o=e&&e.headers?{...e.headers}:{},n={...e,credentials:"include",headers:{...o},method:"put"};return fetch(t,n)}};var zw=J9({}),Vw=2147483647;function Ib({children:t,permissions:e,user:o}){let[n,r]=$c(o),[s,i]=$c(),[l,a]=$c(),c=X9(),u=Z9(),{config:d}=G(),{admin:{routes:{inactivity:m},user:f},routes:{admin:p,api:h},serverURL:g}=d,[b,C]=$c(e),{i18n:v}=P(),{closeAllModals:y,openModal:w}=ie(),[S,x]=$c(0),D=pr(S,1e4),F=Ow.useRef(null),{startRouteTransition:T}=Xe(),R=n?.id,I=Ei(()=>{T(()=>u.replace(Y9({adminRoute:p,path:`${m}${window.location.pathname.startsWith(p)?`?redirect=${encodeURIComponent(window.location.pathname)}`:""}`}))),y()},[u,p,m,y,T]),_=Ei(()=>{i(void 0),a(void 0),clearTimeout(F.current)},[]),A=Ei(j=>{j?.user?(r(j.user),i(j.token),a(j.exp)):(r(null),_())},[_]),$=Ei(j=>{let O=Math.round(new Date().getTime()/1e3),z=(typeof l=="number"?l:0)-O;return(j||l&&z<120)&&(F.current=setTimeout(()=>{async function V(){try{let W=await Oe.post(`${g}${h}/${f}/refresh-token?refresh`,{headers:{"Accept-Language":v.language}});if(W.status===200){let X=await W.json();A(X)}else A(null),I()}catch(W){Q.error(W.message)}}V()},1e3)),()=>{clearTimeout(F.current)}},[h,v.language,I,g,A,l,f]),N=Ei(async j=>{try{let O=await Oe.post(`${g}${h}/${f}/refresh-token`,{headers:{"Accept-Language":v.language}});if(O.status===200){let z=await O.json();return j||A(z),z.user}return n&&(A(null),I()),null}catch(O){return Q.error(`Refreshing token failed: ${O.message}`),null}},[h,v.language,I,g,A,f,n]),k=Ei(async()=>{try{n&&n.collection&&(A(null),await Oe.post(`${g}${h}/${n.collection}/logout`))}catch{}return!0},[h,g,A,n]),B=Ei(async({locale:j}={})=>{let O=Gw.stringify({locale:j},{addQueryPrefix:!0});try{let z=await Oe.get(`${g}${h}/access${O}`,{headers:{"Accept-Language":v.language}});if(z.status===200){let V=await z.json();C(V)}else throw new Error(`Fetching permissions failed with status code ${z.status}`)}catch(z){Q.error(`Refreshing permissions failed: ${z.message}`)}},[g,h,v]),E=Ow.useCallback(async()=>{try{let j=await Oe.get(`${g}${h}/${f}/me`,{credentials:"include",headers:{"Accept-Language":v.language}});if(j.status===200){let O=await j.json(),z=null;return A(O),z}}catch(j){Q.error(`Fetching user failed: ${j.message}`)}return null},[g,h,f,v.language,A]),L=zt(E);Km(()=>{L()},[]);let M=zt(()=>{R&&$()});return Km(()=>{M()},[D]),Km(()=>{x(Date.now())},[c]),Km(()=>{let j,O,z=Math.round(new Date().getTime()/1e3),V=typeof l=="number"?l-z:0,W=Math.max(Math.min((V-60)*1e3,Vw),0),X=Math.max(Math.min(V*1e3,Vw),0);if(!n){clearTimeout(j),clearTimeout(O);return}return V>0&&(j=setTimeout(()=>{w(Sb)},W),O=setTimeout(()=>{A(null),I()},X)),()=>{j&&clearTimeout(j),O&&clearTimeout(O)}},[l,w,v,A,n,I]),U9(zw,{value:{fetchFullUser:E,logOut:k,permissions:b,refreshCookie:$,refreshCookieAsync:N,refreshPermissions:B,setPermissions:C,setUser:A,token:s,user:n},children:t})}var _e=()=>q9(zw);import{jsx as Q9}from"react/jsx-runtime";import{dequal as Ww}from"dequal/lite";import{createContext as K9,use as eL,useCallback as Hw,useEffect as tL,useRef as Fb}from"react";function _b(t,e){let o={...t};for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&(typeof e[n]=="object"&&!Array.isArray(e[n])&&t[n]?o[n]=_b(t[n],e[n]):o[n]=e[n]);return o}var Xw=K9({}),Uw=(t,e)=>({body:JSON.stringify({value:t}),headers:{"Accept-Language":e,"Content-Type":"application/json"}}),Tb=({children:t})=>{let e=Fb({}),o=Fb({}),n=Fb({}),{config:r}=G(),{user:s}=_e(),{i18n:i}=P(),{routes:{api:l},serverURL:a}=r;tL(()=>{s||(o.current={})},[s]);let c=Hw(async d=>{let m=o.current;if(typeof m[d]<"u")return m[d];let f=new Promise(p=>{(async()=>{let h=await Oe.get(`${a}${l}/payload-preferences/${d}`,{credentials:"include",headers:{"Accept-Language":i.language}}),g=null;h.status===200&&(g=(await h.json()).value),o.current[d]=g,p(g)})()});return m[d]=f,f},[i.language,l,o,a]),u=Hw(async(d,m,f=!1)=>{if(f===!1){o.current[d]=m,await Oe.post(`${a}${l}/payload-preferences/${d}`,Uw(m,i.language));return}let p=m,h=await c(d);if(typeof m=="object"&&typeof h=="object"&&typeof p=="object"){if(h&&(p=_b(h,p)),Ww(p,h))return;n.current[d]={...n.current[d],...p}}else{if(p===h)return;n.current[d]=p}let g=async()=>{Ww(n.current[d],o.current[d])||(o.current[d]=n.current[d],await Oe.post(`${a}${l}/payload-preferences/${d}`,Uw(o.current[d],i.language)),delete n.current[d])};setTimeout(()=>{g()})},[l,c,i.language,n,a]);return e.current.getPreference=c,e.current.setPreference=u,Q9(Xw,{value:e.current,children:t})},Qt=()=>eL(Xw);var Qw=Jw({}),Kw=Jw({localeIsLoading:!1,setLocaleIsLoading:t=>{}}),aL=async(t,e)=>await fetch(`${e}/payload-preferences/${t}`,{credentials:"include",headers:{"Content-Type":"application/json"},method:"GET"})?.then(o=>o.json()),Db=t=>{let e=oL(27),{children:o,locale:n}=t,{config:r}=G(),{localization:s,routes:i,serverURL:l}=r,a=s===void 0?!1:s,{api:c}=i,{user:u}=_e(),d=a?a.defaultLocale:"en",{getPreference:m}=Qt(),f=rL(),p;e[0]!==f?(p=f.get("locale"),e[0]=f,e[1]=p):p=e[1];let h=p,g;e[2]!==d||e[3]!==n||e[4]!==h||e[5]!==a?(g=()=>!a||a&&!a.locales.length?{}:Vs(a,h)||Vs(a,n)||Vs(a,d)||Vs(a,a.locales[0].code),e[2]=d,e[3]=n,e[4]=h,e[5]=a,e[6]=g):g=e[6];let[b,C]=nL.useState(g),[v,y]=iL(!1),w=sL(b),S,x;e[7]!==b?(S=()=>{b.code!==w.current.code&&y(!1),w.current=b},x=[b],e[7]=b,e[8]=S,e[9]=x):(S=e[8],x=e[9]),Yw(S,x);let D=`${l}${c}`,F;e[10]!==d||e[11]!==D||e[12]!==h||e[13]!==a||e[14]!==u?.id?(F=()=>{(async function(){if(a&&u?.id){let $=h||await aL("locale",D)?.then(lL),N=Vs(a,$)||Vs(a,d)||Vs(a,a?.locales?.[0]?.code);N&&C(N)}})()},e[10]=d,e[11]=D,e[12]=h,e[13]=a,e[14]=u?.id,e[15]=F):F=e[15];let T=u?.id,R;e[16]!==d||e[17]!==D||e[18]!==m||e[19]!==h||e[20]!==a||e[21]!==T?(R=[d,m,a,D,h,T],e[16]=d,e[17]=D,e[18]=m,e[19]=h,e[20]=a,e[21]=T,e[22]=R):R=e[22],Yw(F,R);let I;return e[23]!==o||e[24]!==v||e[25]!==b?(I=Zw(Qw,{value:b,children:Zw(Kw,{value:{localeIsLoading:v,setLocaleIsLoading:y},children:o})}),e[23]=o,e[24]=v,e[25]=b,e[26]=I):I=e[26],I},ef=()=>qw(Kw),Ce=()=>qw(Qw);function lL(t){return t.value}var tf=(t,e,o)=>{if(t)return`field-${t.replace(/\./g,"__")}${e>1?`-${e}`:""}${o?`-${o}`:""}`};var Se=t=>{let{as:e,hideLocale:o,htmlFor:n,label:r,localized:s,path:i,required:l,unstyled:a}=t,c=e===void 0?"label":e,u=o===void 0?!1:o,d=s===void 0?!1:s,m=l===void 0?!1:l,f=a===void 0?!1:a,{uuid:p}=Me(),h=lt(),g=n||tf(i,h,p),{i18n:b}=P(),{code:C,label:v}=Ce(),y=c==="label"?g?"label":"span":c||"span";return r?e2(y,{className:`field-label${f?" unstyled":""}`,htmlFor:g,children:[uL(r,b),m&&!f&&cL("span",{className:"required",children:"*"}),d&&!u&&e2("span",{className:"localized",children:["\u2014 ",typeof v=="string"?v:C]})]}):null};var of=({collapsed:t,rowID:e,rows:o})=>o.reduce((n,r)=>(e===r.id&&(r.collapsed=t),r.collapsed&&n.collapsedIDs.push(r.id),n.updatedRows.push(r),n),{collapsedIDs:[],updatedRows:[]}),rf=({collapsed:t,rows:e})=>e.reduce((o,n)=>(n.collapsed=t,t&&o.collapsedIDs.push(n.id),o.updatedRows.push(n),o),{collapsedIDs:[],updatedRows:[]});import{c as d$}from"react/compiler-runtime";import{jsx as Q2}from"react/jsx-runtime";import*as K2 from"react";import{jsx as Wc,jsxs as a$}from"react/jsx-runtime";import{rtlLanguages as l$}from"@payloadcms/translations";import{useCallback as q2,useMemo as c$}from"react";import{c as t$}from"react/compiler-runtime";import Mb,{useRef as U2}from"react";import{c as dL}from"react/compiler-runtime";import{useEffect as mL,useRef as fL}from"react";var Ni=(t,e,o)=>{let n=dL(9),r;n[0]!==o?(r=o===void 0?[]:o,n[0]=o,n[1]=r):r=n[1];let s=r,i;n[2]===Symbol.for("react.memo_cache_sentinel")?(i=Date.now(),n[2]=i):i=n[2];let l=fL(i),a;n[3]!==t||n[4]!==e?(a=()=>{let u=setTimeout(()=>{Date.now()-l.current>=e&&(t(),l.current=Date.now())},e-(Date.now()-l.current));return()=>{clearTimeout(u)}},n[3]=t,n[4]=e,n[5]=a):a=n[5];let c;n[6]!==e||n[7]!==s?(c=[e,...s],n[6]=e,n[7]=s,n[8]=c):c=n[8],mL(a,c)};import{jsx as df}from"react/jsx-runtime";import*as z2 from"qs-esm";import XL,{createContext as ZL,use as YL,useCallback as qa,useEffect as V2,useMemo as JL,useRef as G2,useState as Mc}from"react";import{useCallback as pL,useEffect as hL,useRef as gL,useState as bL}from"react";function rn(t,e){let[o,n]=bL(t??e),r=gL(!0);hL(()=>{if(r.current){r.current=!1;return}n(t)},[t]);let s=pL(i=>{n(i)},[]);return[o,s]}import{getTranslation as BL}from"@payloadcms/translations";var vL={},kc={};function Xa(t,e){try{let n=(vL[t]||=new Intl.DateTimeFormat("en-GB",{timeZone:t,hour:"numeric",timeZoneName:"longOffset"}).format)(e).split("GMT")[1]||"";return n in kc?kc[n]:t2(n,n.split(":"))}catch{if(t in kc)return kc[t];let o=t?.match(CL);return o?t2(t,o.slice(1)):NaN}}var CL=/([+-]\d\d):?(\d\d)?/;function t2(t,e){let o=+e[0],n=+(e[1]||0);return kc[t]=o>0?o*60+n:o*60-n}var Kt=class t extends Date{constructor(...e){super(),e.length>1&&typeof e[e.length-1]=="string"&&(this.timeZone=e.pop()),this.internal=new Date,isNaN(Xa(this.timeZone,this))?this.setTime(NaN):e.length?typeof e[0]=="number"&&(e.length===1||e.length===2&&typeof e[1]!="number")?this.setTime(e[0]):typeof e[0]=="string"?this.setTime(+new Date(e[0])):e[0]instanceof Date?this.setTime(+e[0]):(this.setTime(+new Date(...e)),r2(this,NaN),Rb(this)):this.setTime(Date.now())}static tz(e,...o){return o.length?new t(...o,e):new t(Date.now(),e)}withTimeZone(e){return new t(+this,e)}getTimezoneOffset(){return-Xa(this.timeZone,this)}setTime(e){return Date.prototype.setTime.apply(this,arguments),Rb(this),+this}[Symbol.for("constructDateFrom")](e){return new t(+new Date(e),this.timeZone)}},o2=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(t=>{if(!o2.test(t))return;let e=t.replace(o2,"$1UTC");Kt.prototype[e]&&(t.startsWith("get")?Kt.prototype[t]=function(){return this.internal[e]()}:(Kt.prototype[t]=function(){return Date.prototype[e].apply(this.internal,arguments),yL(this),+this},Kt.prototype[e]=function(){return Date.prototype[e].apply(this,arguments),Rb(this),+this}))});function Rb(t){t.internal.setTime(+t),t.internal.setUTCMinutes(t.internal.getUTCMinutes()-t.getTimezoneOffset())}function yL(t){Date.prototype.setFullYear.call(t,t.internal.getUTCFullYear(),t.internal.getUTCMonth(),t.internal.getUTCDate()),Date.prototype.setHours.call(t,t.internal.getUTCHours(),t.internal.getUTCMinutes(),t.internal.getUTCSeconds(),t.internal.getUTCMilliseconds()),r2(t)}function r2(t){let e=Xa(t.timeZone,t),o=new Date(+t);o.setUTCHours(o.getUTCHours()-1);let n=-new Date(+t).getTimezoneOffset(),r=-new Date(+o).getTimezoneOffset(),s=n-r,i=Date.prototype.getHours.apply(t)!==t.internal.getUTCHours();s&&i&&t.internal.setUTCMinutes(t.internal.getUTCMinutes()+s);let l=n-e;l&&Date.prototype.setUTCMinutes.call(t,Date.prototype.getUTCMinutes.call(t)+l);let a=Xa(t.timeZone,t),u=-new Date(+t).getTimezoneOffset()-a,d=a!==e,m=u-l;if(d&&m){Date.prototype.setUTCMinutes.call(t,Date.prototype.getUTCMinutes.call(t)+m);let f=Xa(t.timeZone,t),p=a-f;p&&(t.internal.setUTCMinutes(t.internal.getUTCMinutes()+p),Date.prototype.setUTCMinutes.call(t,Date.prototype.getUTCMinutes.call(t)+p))}}var xL=Math.pow(10,8)*24*60*60*1e3,Xie=-xL,nf=6048e5,n2=864e5;var jc=43200,Ab=1440;var wL=3600;var s2=wL*24,Zie=s2*7,SL=s2*365.2425,IL=SL/12,Yie=IL*3,Pb=Symbol.for("constructDateFrom");function io(t,e){return typeof t=="function"?t(e):t&&typeof t=="object"&&Pb in t?t[Pb](e):t instanceof Date?new t.constructor(e):new Date(e)}function ot(t,e){return io(e||t,t)}var _L={};function Rn(){return _L}function as(t,e){let o=Rn(),n=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??o.weekStartsOn??o.locale?.options?.weekStartsOn??0,r=ot(t,e?.in),s=r.getDay(),i=(s<n?7:0)+s-n;return r.setDate(r.getDate()-i),r.setHours(0,0,0,0),r}function Li(t,e){return as(t,{...e,weekStartsOn:1})}function sf(t,e){let o=ot(t,e?.in),n=o.getFullYear(),r=io(o,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);let s=Li(r),i=io(o,0);i.setFullYear(n,0,4),i.setHours(0,0,0,0);let l=Li(i);return o.getTime()>=s.getTime()?n+1:o.getTime()>=l.getTime()?n:n-1}function Za(t){let e=ot(t),o=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return o.setUTCFullYear(e.getFullYear()),+t-+o}function An(t,...e){let o=io.bind(null,t||e.find(n=>typeof n=="object"));return e.map(o)}function zs(t,e){let o=ot(t,e?.in);return o.setHours(0,0,0,0),o}function i2(t,e,o){let[n,r]=An(o?.in,t,e),s=zs(n),i=zs(r),l=+s-Za(s),a=+i-Za(i);return Math.round((l-a)/n2)}function a2(t,e){let o=sf(t,e),n=io(e?.in||t,0);return n.setFullYear(o,0,4),n.setHours(0,0,0,0),Li(n)}function Ya(t,e){let o=+ot(t)-+ot(e);return o<0?-1:o>0?1:o}function af(t){return io(t,Date.now())}function l2(t,e,o){let[n,r]=An(o?.in,t,e);return+zs(n)==+zs(r)}function c2(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function u2(t){return!(!c2(t)&&typeof t!="number"||isNaN(+ot(t)))}function d2(t,e,o){let[n,r]=An(o?.in,t,e),s=n.getFullYear()-r.getFullYear(),i=n.getMonth()-r.getMonth();return s*12+i}function m2(t){return e=>{let n=(t?Math[t]:Math.trunc)(e);return n===0?0:n}}function f2(t,e){return+ot(t)-+ot(e)}function lf(t,e){let o=ot(t,e?.in);return o.setHours(23,59,59,999),o}function p2(t,e){let o=ot(t,e?.in),n=o.getMonth();return o.setFullYear(o.getFullYear(),n+1,0),o.setHours(23,59,59,999),o}function h2(t,e){let o=ot(t,e?.in);return+lf(o,e)==+p2(o,e)}function g2(t,e,o){let[n,r,s]=An(o?.in,t,t,e),i=Ya(r,s),l=Math.abs(d2(r,s));if(l<1)return 0;r.getMonth()===1&&r.getDate()>27&&r.setDate(30),r.setMonth(r.getMonth()-i*l);let a=Ya(r,s)===-i;h2(n)&&l===1&&Ya(n,s)===1&&(a=!1);let c=i*(l-+a);return c===0?0:c}function b2(t,e,o){let n=f2(t,e)/1e3;return m2(o?.roundingMethod)(n)}function v2(t,e){let o=ot(t,e?.in);return o.setFullYear(o.getFullYear(),0,1),o.setHours(0,0,0,0),o}function C2(t){return lf(Date.now(),t)}function y2(t,e){let o=ot(t,e?.in);return i2(o,v2(o))+1}function x2(t,e){let o=ot(t,e?.in),n=+Li(o)-+a2(o);return Math.round(n/nf)+1}function cf(t,e){let o=ot(t,e?.in),n=o.getFullYear(),r=Rn(),s=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,i=io(e?.in||t,0);i.setFullYear(n+1,0,s),i.setHours(0,0,0,0);let l=as(i,e),a=io(e?.in||t,0);a.setFullYear(n,0,s),a.setHours(0,0,0,0);let c=as(a,e);return+o>=+l?n+1:+o>=+c?n:n-1}function w2(t,e){let o=Rn(),n=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,r=cf(t,e),s=io(e?.in||t,0);return s.setFullYear(r,0,n),s.setHours(0,0,0,0),as(s,e)}function S2(t,e){let o=ot(t,e?.in),n=+as(o,e)-+w2(o,e);return Math.round(n/nf)+1}function dt(t,e){let o=t<0?"-":"",n=Math.abs(t).toString().padStart(e,"0");return o+n}var ls={y(t,e){let o=t.getFullYear(),n=o>0?o:1-o;return dt(e==="yy"?n%100:n,e.length)},M(t,e){let o=t.getMonth();return e==="M"?String(o+1):dt(o+1,2)},d(t,e){return dt(t.getDate(),e.length)},a(t,e){let o=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return o.toUpperCase();case"aaa":return o;case"aaaaa":return o[0];case"aaaa":default:return o==="am"?"a.m.":"p.m."}},h(t,e){return dt(t.getHours()%12||12,e.length)},H(t,e){return dt(t.getHours(),e.length)},m(t,e){return dt(t.getMinutes(),e.length)},s(t,e){return dt(t.getSeconds(),e.length)},S(t,e){let o=e.length,n=t.getMilliseconds(),r=Math.trunc(n*Math.pow(10,o-3));return dt(r,e.length)}};var Ja={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Eb={G:function(t,e,o){let n=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return o.era(n,{width:"abbreviated"});case"GGGGG":return o.era(n,{width:"narrow"});case"GGGG":default:return o.era(n,{width:"wide"})}},y:function(t,e,o){if(e==="yo"){let n=t.getFullYear(),r=n>0?n:1-n;return o.ordinalNumber(r,{unit:"year"})}return ls.y(t,e)},Y:function(t,e,o,n){let r=cf(t,n),s=r>0?r:1-r;if(e==="YY"){let i=s%100;return dt(i,2)}return e==="Yo"?o.ordinalNumber(s,{unit:"year"}):dt(s,e.length)},R:function(t,e){let o=sf(t);return dt(o,e.length)},u:function(t,e){let o=t.getFullYear();return dt(o,e.length)},Q:function(t,e,o){let n=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(n);case"QQ":return dt(n,2);case"Qo":return o.ordinalNumber(n,{unit:"quarter"});case"QQQ":return o.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return o.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return o.quarter(n,{width:"wide",context:"formatting"})}},q:function(t,e,o){let n=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(n);case"qq":return dt(n,2);case"qo":return o.ordinalNumber(n,{unit:"quarter"});case"qqq":return o.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return o.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return o.quarter(n,{width:"wide",context:"standalone"})}},M:function(t,e,o){let n=t.getMonth();switch(e){case"M":case"MM":return ls.M(t,e);case"Mo":return o.ordinalNumber(n+1,{unit:"month"});case"MMM":return o.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return o.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return o.month(n,{width:"wide",context:"formatting"})}},L:function(t,e,o){let n=t.getMonth();switch(e){case"L":return String(n+1);case"LL":return dt(n+1,2);case"Lo":return o.ordinalNumber(n+1,{unit:"month"});case"LLL":return o.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return o.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return o.month(n,{width:"wide",context:"standalone"})}},w:function(t,e,o,n){let r=S2(t,n);return e==="wo"?o.ordinalNumber(r,{unit:"week"}):dt(r,e.length)},I:function(t,e,o){let n=x2(t);return e==="Io"?o.ordinalNumber(n,{unit:"week"}):dt(n,e.length)},d:function(t,e,o){return e==="do"?o.ordinalNumber(t.getDate(),{unit:"date"}):ls.d(t,e)},D:function(t,e,o){let n=y2(t);return e==="Do"?o.ordinalNumber(n,{unit:"dayOfYear"}):dt(n,e.length)},E:function(t,e,o){let n=t.getDay();switch(e){case"E":case"EE":case"EEE":return o.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return o.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return o.day(n,{width:"short",context:"formatting"});case"EEEE":default:return o.day(n,{width:"wide",context:"formatting"})}},e:function(t,e,o,n){let r=t.getDay(),s=(r-n.weekStartsOn+8)%7||7;switch(e){case"e":return String(s);case"ee":return dt(s,2);case"eo":return o.ordinalNumber(s,{unit:"day"});case"eee":return o.day(r,{width:"abbreviated",context:"formatting"});case"eeeee":return o.day(r,{width:"narrow",context:"formatting"});case"eeeeee":return o.day(r,{width:"short",context:"formatting"});case"eeee":default:return o.day(r,{width:"wide",context:"formatting"})}},c:function(t,e,o,n){let r=t.getDay(),s=(r-n.weekStartsOn+8)%7||7;switch(e){case"c":return String(s);case"cc":return dt(s,e.length);case"co":return o.ordinalNumber(s,{unit:"day"});case"ccc":return o.day(r,{width:"abbreviated",context:"standalone"});case"ccccc":return o.day(r,{width:"narrow",context:"standalone"});case"cccccc":return o.day(r,{width:"short",context:"standalone"});case"cccc":default:return o.day(r,{width:"wide",context:"standalone"})}},i:function(t,e,o){let n=t.getDay(),r=n===0?7:n;switch(e){case"i":return String(r);case"ii":return dt(r,e.length);case"io":return o.ordinalNumber(r,{unit:"day"});case"iii":return o.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return o.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return o.day(n,{width:"short",context:"formatting"});case"iiii":default:return o.day(n,{width:"wide",context:"formatting"})}},a:function(t,e,o){let r=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return o.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return o.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return o.dayPeriod(r,{width:"narrow",context:"formatting"});case"aaaa":default:return o.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(t,e,o){let n=t.getHours(),r;switch(n===12?r=Ja.noon:n===0?r=Ja.midnight:r=n/12>=1?"pm":"am",e){case"b":case"bb":return o.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return o.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return o.dayPeriod(r,{width:"narrow",context:"formatting"});case"bbbb":default:return o.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(t,e,o){let n=t.getHours(),r;switch(n>=17?r=Ja.evening:n>=12?r=Ja.afternoon:n>=4?r=Ja.morning:r=Ja.night,e){case"B":case"BB":case"BBB":return o.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return o.dayPeriod(r,{width:"narrow",context:"formatting"});case"BBBB":default:return o.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(t,e,o){if(e==="ho"){let n=t.getHours()%12;return n===0&&(n=12),o.ordinalNumber(n,{unit:"hour"})}return ls.h(t,e)},H:function(t,e,o){return e==="Ho"?o.ordinalNumber(t.getHours(),{unit:"hour"}):ls.H(t,e)},K:function(t,e,o){let n=t.getHours()%12;return e==="Ko"?o.ordinalNumber(n,{unit:"hour"}):dt(n,e.length)},k:function(t,e,o){let n=t.getHours();return n===0&&(n=24),e==="ko"?o.ordinalNumber(n,{unit:"hour"}):dt(n,e.length)},m:function(t,e,o){return e==="mo"?o.ordinalNumber(t.getMinutes(),{unit:"minute"}):ls.m(t,e)},s:function(t,e,o){return e==="so"?o.ordinalNumber(t.getSeconds(),{unit:"second"}):ls.s(t,e)},S:function(t,e){return ls.S(t,e)},X:function(t,e,o){let n=t.getTimezoneOffset();if(n===0)return"Z";switch(e){case"X":return _2(n);case"XXXX":case"XX":return $i(n);case"XXXXX":case"XXX":default:return $i(n,":")}},x:function(t,e,o){let n=t.getTimezoneOffset();switch(e){case"x":return _2(n);case"xxxx":case"xx":return $i(n);case"xxxxx":case"xxx":default:return $i(n,":")}},O:function(t,e,o){let n=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+I2(n,":");case"OOOO":default:return"GMT"+$i(n,":")}},z:function(t,e,o){let n=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+I2(n,":");case"zzzz":default:return"GMT"+$i(n,":")}},t:function(t,e,o){let n=Math.trunc(+t/1e3);return dt(n,e.length)},T:function(t,e,o){return dt(+t,e.length)}};function I2(t,e=""){let o=t>0?"-":"+",n=Math.abs(t),r=Math.trunc(n/60),s=n%60;return s===0?o+String(r):o+String(r)+e+dt(s,2)}function _2(t,e){return t%60===0?(t>0?"-":"+")+dt(Math.abs(t)/60,2):$i(t,e)}function $i(t,e=""){let o=t>0?"-":"+",n=Math.abs(t),r=dt(Math.trunc(n/60),2),s=dt(n%60,2);return o+r+e+s}var F2=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},T2=(t,e)=>{switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},FL=(t,e)=>{let o=t.match(/(P+)(p+)?/)||[],n=o[1],r=o[2];if(!r)return F2(t,e);let s;switch(n){case"P":s=e.dateTime({width:"short"});break;case"PP":s=e.dateTime({width:"medium"});break;case"PPP":s=e.dateTime({width:"long"});break;case"PPPP":default:s=e.dateTime({width:"full"});break}return s.replace("{{date}}",F2(n,e)).replace("{{time}}",T2(r,e))},D2={p:T2,P:FL};var TL=/^D+$/,DL=/^Y+$/,RL=["D","DD","YY","YYYY"];function R2(t){return TL.test(t)}function A2(t){return DL.test(t)}function P2(t,e,o){let n=AL(t,e,o);if(console.warn(n),RL.includes(t))throw new RangeError(n)}function AL(t,e,o){let n=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${n} to the input \`${o}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}var PL=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,EL=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,NL=/^'([^]*?)'?$/,LL=/''/g,$L=/[a-zA-Z]/;function Nb(t,e,o){let n=Rn(),r=o?.locale??n.locale??gc,s=o?.firstWeekContainsDate??o?.locale?.options?.firstWeekContainsDate??n.firstWeekContainsDate??n.locale?.options?.firstWeekContainsDate??1,i=o?.weekStartsOn??o?.locale?.options?.weekStartsOn??n.weekStartsOn??n.locale?.options?.weekStartsOn??0,l=ot(t,o?.in);if(!u2(l))throw new RangeError("Invalid time value");let a=e.match(EL).map(u=>{let d=u[0];if(d==="p"||d==="P"){let m=D2[d];return m(u,r.formatLong)}return u}).join("").match(PL).map(u=>{if(u==="''")return{isToken:!1,value:"'"};let d=u[0];if(d==="'")return{isToken:!1,value:kL(u)};if(Eb[d])return{isToken:!0,value:u};if(d.match($L))throw new RangeError("Format string contains an unescaped latin alphabet character `"+d+"`");return{isToken:!1,value:u}});r.localize.preprocessor&&(a=r.localize.preprocessor(l,a));let c={firstWeekContainsDate:s,weekStartsOn:i,locale:r};return a.map(u=>{if(!u.isToken)return u.value;let d=u.value;(!o?.useAdditionalWeekYearTokens&&A2(d)||!o?.useAdditionalDayOfYearTokens&&R2(d))&&P2(d,e,String(t));let m=Eb[d[0]];return m(l,d,r.localize,c)}).join("")}function kL(t){let e=t.match(NL);return e?e[1].replace(LL,"'"):t}function E2(t,e,o){let n=Rn(),r=o?.locale??n.locale??gc,s=2520,i=Ya(t,e);if(isNaN(i))throw new RangeError("Invalid time value");let l=Object.assign({},o,{addSuffix:o?.addSuffix,comparison:i}),[a,c]=An(o?.in,...i>0?[e,t]:[t,e]),u=b2(c,a),d=(Za(c)-Za(a))/1e3,m=Math.round((u-d)/60),f;if(m<2)return o?.includeSeconds?u<5?r.formatDistance("lessThanXSeconds",5,l):u<10?r.formatDistance("lessThanXSeconds",10,l):u<20?r.formatDistance("lessThanXSeconds",20,l):u<40?r.formatDistance("halfAMinute",0,l):u<60?r.formatDistance("lessThanXMinutes",1,l):r.formatDistance("xMinutes",1,l):m===0?r.formatDistance("lessThanXMinutes",1,l):r.formatDistance("xMinutes",m,l);if(m<45)return r.formatDistance("xMinutes",m,l);if(m<90)return r.formatDistance("aboutXHours",1,l);if(m<Ab){let p=Math.round(m/60);return r.formatDistance("aboutXHours",p,l)}else{if(m<s)return r.formatDistance("xDays",1,l);if(m<jc){let p=Math.round(m/Ab);return r.formatDistance("xDays",p,l)}else if(m<jc*2)return f=Math.round(m/jc),r.formatDistance("aboutXMonths",f,l)}if(f=g2(c,a),f<12){let p=Math.round(m/jc);return r.formatDistance("xMonths",p,l)}else{let p=f%12,h=Math.trunc(f/12);return p<3?r.formatDistance("aboutXYears",h,l):p<9?r.formatDistance("overXYears",h,l):r.formatDistance("almostXYears",h+1,l)}}function N2(t,e){return E2(t,af(t),e)}function nn(t,e){let o=jL(e)?new e(0):io(e,0);return o.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),o.setHours(t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()),o}function jL(t){return typeof t=="function"&&t.prototype?.constructor===t}function L2(t,e){return l2(io(e?.in||t,t),af(e?.in||t))}var $r=({date:t,i18n:e,pattern:o,timezone:n})=>{let r=new Kt(new Date(t));if(n){let s=Kt.tz(n),i=r.withTimeZone(n),l=nn(i,s);return e.dateFNS?Nb(l,o,{locale:e.dateFNS}):`${e.t("general:loading")}...`}return e.dateFNS?Nb(r,o,{locale:e.dateFNS}):`${e.t("general:loading")}...`},Lb=({date:t,i18n:e})=>{let o=typeof t=="string"?new Date(t):t;return e?.dateFNS?N2(o,{locale:e.dateFNS}):`${e.t("general:loading")}...`};function $b(t){return typeof t=="object"&&"root"in t}function uf(t,e){for(let o of t)"text"in o&&o.text?e+=o.text:"children"in o||(e+=`[${o.type}]`),"children"in o&&o.children&&(e+=uf(o.children,e));return e}var $2=t=>Array.isArray(t)?t.map(e=>typeof e=="object"&&e!==null?e.id:String(e)).filter(Boolean).join(", "):typeof t=="object"&&t!==null?t.id||"":String(t);var Go=({collectionConfig:t,data:e,dateFormat:o,fallback:n,globalConfig:r,i18n:s})=>{let i;if(t){let l=t?.admin?.useAsTitle;if(l&&(i=e?.[l],i)){let a=t.fields.find(d=>"name"in d&&d.name===l),c=a?.type==="date",u=a?.type==="relationship";if(c){let d="date"in a.admin&&a?.admin?.date?.displayFormat||o;i=$r({date:i,i18n:s,pattern:d})||i}u&&(i=$2(e[l]))}}return r&&(i=BL(r?.label,s)||r?.slug),i&&$b(i)&&(i=uf(i.root.children?.[0]?.children||[],"")),!i&&$b(n)&&(i=uf(n.root.children?.[0]?.children||[],"")),i||(i=typeof n=="string"?n:`[${s.t("general:untitled")}]`),i};import{jsx as ML}from"react/jsx-runtime";import{createContext as OL,use as VL,useEffect as GL,useState as zL}from"react";var k2=OL({}),To=()=>VL(k2),j2=({children:t})=>{let{id:e,collectionSlug:o,data:n,docConfig:r,globalSlug:s,initialData:i}=Te(),{config:{admin:{dateFormat:l}}}=G(),{i18n:a}=P(),[c,u]=zL(()=>Go({collectionConfig:o?r:void 0,data:{...i||{},id:e},dateFormat:l,fallback:e?.toString(),globalConfig:s?r:void 0,i18n:a}));return GL(()=>{u(Go({collectionConfig:o?r:void 0,data:{...n,id:e},dateFormat:l,fallback:e?.toString(),globalConfig:s?r:void 0,i18n:a}))},[n,l,a,e,o,r,s]),ML(k2,{value:{setDocumentTitle:u,title:c},children:t})};import{c as WL}from"react/compiler-runtime";import{jsx as HL}from"react/jsx-runtime";import kb from"react";var B2=kb.createContext({getUploadEdits:()=>{},resetUploadEdits:void 0,updateUploadEdits:void 0,uploadEdits:void 0}),jb=t=>{let e=WL(10),{children:o,initialUploadEdits:n}=t,r;e[0]!==n?(r=n||{},e[0]=n,e[1]=r):r=e[1];let[s,i]=kb.useState(r),l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=()=>{i({})},e[2]=l):l=e[2];let a=l,c;e[3]===Symbol.for("react.memo_cache_sentinel")?(c=p=>{i(h=>({...h||{},...p||{}}))},e[3]=c):c=e[3];let u=c,d;e[4]!==s?(d=()=>s,e[4]=s,e[5]=d):d=e[5];let m=d,f;return e[6]!==o||e[7]!==m||e[8]!==s?(f=HL(B2,{value:{getUploadEdits:m,resetUploadEdits:a,updateUploadEdits:u,uploadEdits:s},children:o}),e[6]=o,e[7]=m,e[8]=s,e[9]=f):f=e[9],f},ki=()=>kb.use(B2);import*as Bb from"qs-esm";import UL from"react";var Bc=t=>{let{collectionSlug:e,docPermissions:o,globalSlug:n,isEditing:r}=t;return e?!!(r&&o?.update||!r&&o?.create):n?!!o?.update:!1};var M2=({id:t,collectionSlug:e,globalSlug:o})=>!!(o||e&&t);var O2=({id:t,api:e,collectionSlug:o,globalSlug:n,i18n:r,locale:s,permissions:i,serverURL:l,setDocPermissions:a,setHasPublishPermission:c,setHasSavePermission:u})=>UL.useCallback(async d=>{let m={locale:s||void 0},f=d?.id||t,p=M2({id:f,collectionSlug:o,globalSlug:n});if(p){let h=o?`/${o}/access/${f}`:n?`/globals/${n}/access`:null;if(h){let b=await(await fetch(`${l}${e}${h}?${Bb.stringify(m)}`,{body:JSON.stringify({...d||{},_status:"draft"}),credentials:"include",headers:{"Accept-Language":r.language,"Content-Type":"application/json"},method:"post"})).json(),C=await fetch(`${l}${e}${h}?${Bb.stringify(m)}`,{body:JSON.stringify({...d||{},_status:"published"}),credentials:"include",headers:{"Accept-Language":r.language,"Content-Type":"application/json"},method:"POST"}).then(v=>v.json());a(b),u(Bc({collectionSlug:o,docPermissions:b,globalSlug:n,isEditing:p})),c(C?.update)}}else{let h=o?i?.collections?.[o]:i?.globals?.[n];a(h),u(Bc({collectionSlug:o,docPermissions:h,globalSlug:n,isEditing:p}))}},[s,t,o,n,l,e,r.language,a,u,c,i?.collections,i?.globals]);var W2=ZL({}),Te=()=>YL(W2),qL=({children:t,...e})=>{let{id:o,collectionSlug:n,currentEditor:r,docPermissions:s,globalSlug:i,hasPublishedDoc:l,hasPublishPermission:a,hasSavePermission:c,initialData:u,initialState:d,isLocked:m,lastUpdateTime:f,mostRecentVersionIsAutosaved:p,unpublishedVersionCount:h,versionCount:g}=e,[b,C]=rn(s),[v,y]=rn(c),[w,S]=rn(a),{permissions:x}=_e(),{config:{admin:{dateFormat:D},routes:{api:F},serverURL:T},getEntityConfig:R}=G(),I=R({collectionSlug:n}),_=R({globalSlug:i}),A=G2(new AbortController),$=I||_,{i18n:N}=P(),{uploadEdits:k}=ki(),[B,E]=Mc(()=>Go({collectionConfig:I,data:{...u||{},id:o},dateFormat:D,fallback:o?.toString(),globalConfig:_,i18n:N})),[L,M]=Mc(p),[j,O]=Mc(g),[z,V]=Mc(l),[W,X]=Mc(h),[U,Z]=rn(m),[ee,ce]=rn(r),[q,te]=rn(f),[le,pe]=rn(u),[fe,ue]=rn("idle"),Fe=G2({hasShownLockedModal:!1,isLocked:!1,user:null}),Ie=qa(Ge=>{ue(Ge)},[ue]),{getPreference:Le,setPreference:Y}=Qt(),{code:ae}=Ce(),{localeIsLoading:H}=ef(),J=JL(()=>d===void 0||u===void 0||H,[u,d,H]),re=`${T}${F}`,ne,he,oe;i&&(ne=i,he="globals",oe=`global-${ne}`),n&&(ne=n,he="collections",o&&(oe=`collection-${ne}-${o}`));let ge=qa(async(Ge,ft)=>{try{let et=ft===i,qt=await Oe.get(`${T}${F}/payload-locked-documents`,{credentials:"include",params:et?{"where[globalSlug][equals]":ft}:{"where[document.relationTo][equals]":ft,"where[document.value][equals]":Ge}}),{docs:Io}=await qt.json();if(Io?.length>0){let _o=Io[0].id;await Oe.delete(`${T}${F}/payload-locked-documents/${_o}`,{credentials:"include",headers:{"Content-Type":"application/json"}}),Z(!1)}}catch(et){console.error("Failed to unlock the document",et)}},[T,F,i,Z]),De=qa(async(Ge,ft,et)=>{try{let qt=ft===i,Io=await Oe.get(`${T}${F}/payload-locked-documents`,{credentials:"include",params:qt?{"where[globalSlug][equals]":ft}:{"where[document.relationTo][equals]":ft,"where[document.value][equals]":Ge}}),{docs:_o}=await Io.json();if(_o?.length>0){let vt=_o[0].id,Zr=typeof et=="object"?{relationTo:et.collection,value:et.id}:{relationTo:"users",value:et};await Oe.patch(`${T}${F}/payload-locked-documents/${vt}`,{body:JSON.stringify({user:Zr}),credentials:"include",headers:{"Content-Type":"application/json"}})}}catch(qt){console.error("Failed to update the document editor",qt)}},[T,F,i]),Be=O2({id:o,api:F,collectionSlug:n,globalSlug:i,i18n:N,locale:ae,permissions:x,serverURL:T,setDocPermissions:C,setHasPublishPermission:S,setHasSavePermission:y}),be=qa(()=>Le(oe),[Le,oe]),ve=qa(async(Ge,ft)=>{let et=await be();if(oe)try{await Y(oe,{...et,fields:{...et?.fields||{},[Ge]:{...et?.fields?.[Ge],...ft}}})}catch(qt){console.error(qt)}},[Y,oe,be]),ye=qa(()=>{let Ge=j+1;I&&I.versions?I.versions.maxPerDoc>0?O(Math.min(Ge,I.versions.maxPerDoc)):O(Ge):_&&_.versions&&(_.versions.max>0?O(Math.min(Ge,_.versions.max)):O(Ge))},[I,_,j]);V2(()=>{E(Go({collectionConfig:I,data:{...le,id:o},dateFormat:D,fallback:o?.toString(),globalConfig:_,i18n:N}))},[I,_,le,D,N,o]),V2(()=>{let Ge=A.current;return()=>{if(Ge)try{Ge.abort()}catch{}}},[]);let Je=XL.useMemo(()=>`${`${re}${he==="globals"?"/globals":""}/${ne}${o?`/${o}`:""}`}${z2.stringify({depth:0,"fallback-locale":"null",locale:ae,uploadEdits:k||void 0},{addQueryPrefix:!0})}`,[re,ae,he,o,ne,k]),it={...e,action:Je,currentEditor:ee,data:le,docConfig:$,docPermissions:b,documentIsLocked:U,documentLockState:Fe,getDocPermissions:Be,getDocPreferences:be,hasPublishedDoc:z,hasPublishPermission:w,hasSavePermission:v,incrementVersionCount:ye,initialData:u,initialState:d,isInitializing:J,lastUpdateTime:q,mostRecentVersionIsAutosaved:L,preferencesKey:oe,savedDocumentData:le,setCurrentEditor:ce,setData:pe,setDocFieldPreferences:ve,setDocumentIsLocked:Z,setDocumentTitle:E,setHasPublishedDoc:V,setLastUpdateTime:te,setMostRecentVersionIsAutosaved:M,setUnpublishedVersionCount:X,setUploadStatus:Ie,title:B,unlockDocument:ge,unpublishedVersionCount:W,updateDocumentEditor:De,updateSavedDocumentData:pe,uploadStatus:fe,versionCount:j};return df(W2,{value:it,children:df(j2,{children:t})})},Oc=t=>df(jb,{children:df(qL,{...t})});import{jsx as QL}from"react/jsx-runtime";import{createContext as KL,use as e$}from"react";var mf=KL(""),Vc=({children:t,operation:e})=>QL(mf,{value:e,children:t}),hr=()=>e$(mf);import H2 from"react";var Qa=H2.createContext(void 0),ff=()=>{let t=H2.useContext(Qa);if(t)return t};var o$=t=>{let e=t$(64),o;e[0]!==t?(o=t||{},e[0]=t,e[1]=o):o=e[1];let{disableFormData:n,hasRows:r,path:s,potentiallyStalePath:i,validate:l}=o,a=n===void 0?!1:n,c=ff(),u=s||c||i,d=so(),m=Er(),f=Si(),{user:p}=_e(),{id:h,collectionSlug:g}=Te(),b=hr(),C=Rt(r$),v;e[2]!==u?(v=pe=>{let[fe]=pe;return fe&&fe?.[u]||null},e[2]=u,e[3]=v):v=e[3];let y=Rt(v),{t:w}=P(),{config:S}=G(),{getData:x,getDataByPath:D,getSiblingData:F,setModified:T}=Me(),R=Na(),I=y?.filterOptions,_=y?.value,A=y?.initialValue,$=typeof y?.valid=="boolean"?y.valid:!0,N=$===!1&&d,k=U2($),B=U2(y?.errorMessage),E;e[4]!==u?(E=u?u.split("."):[],e[4]=u,e[5]=E):E=e[5];let L=E,M;e[6]!==a||e[7]!==C||e[8]!==r||e[9]!==u||e[10]!==T?(M=(pe,fe)=>{let ue=fe===void 0?!1:fe,Ie=pe&&typeof pe=="object"&&typeof pe.preventDefault=="function"&&typeof pe.stopPropagation=="function"?pe.target.value:pe;C({type:"UPDATE",disableFormData:a||r&&Ie>0,path:u,value:Ie}),ue||T(!0)},e[6]=a,e[7]=C,e[8]=r,e[9]=u,e[10]=T,e[11]=M):M=e[11];let j=M,O=y?.customComponents,z=m||f,V=y?.errorMessage,W;e[12]!==y?.errorPaths?(W=y?.errorPaths||[],e[12]=y?.errorPaths,e[13]=W):W=e[13];let X=y?.rows,U=y?.selectFilterOptions,Z=y?.valid,ee;e[14]!==I||e[15]!==A||e[16]!==f||e[17]!==u||e[18]!==m||e[19]!==j||e[20]!==N||e[21]!==d||e[22]!==U||e[23]!==Z||e[24]!==O||e[25]!==z||e[26]!==V||e[27]!==W||e[28]!==X||e[29]!==_?(ee={customComponents:O,disabled:z,errorMessage:V,errorPaths:W,filterOptions:I,formInitializing:f,formProcessing:m,formSubmitted:d,initialValue:A,path:u,rows:X,selectFilterOptions:U,setValue:j,showError:N,valid:Z,value:_},e[14]=I,e[15]=A,e[16]=f,e[17]=u,e[18]=m,e[19]=j,e[20]=N,e[21]=d,e[22]=U,e[23]=Z,e[24]=O,e[25]=z,e[26]=V,e[27]=W,e[28]=X,e[29]=_,e[30]=ee):ee=e[30];let ce=ee,q;e[31]!==g||e[32]!==S||e[33]!==a||e[34]!==C||e[35]!==R||e[36]!==y||e[37]!==x||e[38]!==D||e[39]!==F||e[40]!==r||e[41]!==h||e[42]!==b||e[43]!==u||e[44]!==L||e[45]!==w||e[46]!==p||e[47]!==l||e[48]!==_?(q=()=>{(async()=>{let fe=_;y?.rows&&Array.isArray(y.rows)&&(fe=D(u));let ue=B.current,Fe=k.current,Ie=x(),Le=typeof l=="function"?await l(fe,{id:h,blockData:void 0,collectionSlug:g,data:R?.getData?R.getData():Ie,event:"onChange",operation:b,path:L,preferences:{},req:{payload:{config:S},t:w,user:p},siblingData:F(u)}):typeof B.current=="string"?B.current:k.current;if(typeof Le=="string"?(Fe=!1,ue=Le):typeof Le=="boolean"&&(Fe=Le,ue=void 0),Fe!==k.current||ue!==B.current){k.current=Fe,B.current=ue;let Y={type:"UPDATE",errorMessage:ue,path:u,rows:y?.rows,valid:Fe,validate:l,value:_};(a||r&&typeof _=="number"&&_>0)&&(Y.disableFormData=!0),typeof C=="function"&&C(Y)}})()},e[31]=g,e[32]=S,e[33]=a,e[34]=C,e[35]=R,e[36]=y,e[37]=x,e[38]=D,e[39]=F,e[40]=r,e[41]=h,e[42]=b,e[43]=u,e[44]=L,e[45]=w,e[46]=p,e[47]=l,e[48]=_,e[49]=q):q=e[49];let te=y?.rows,le;return e[50]!==g||e[51]!==a||e[52]!==C||e[53]!==x||e[54]!==D||e[55]!==F||e[56]!==h||e[57]!==b||e[58]!==u||e[59]!==te||e[60]!==p||e[61]!==l||e[62]!==_?(le=[_,a,C,x,F,D,h,b,u,p,l,te,g],e[50]=g,e[51]=a,e[52]=C,e[53]=x,e[54]=D,e[55]=F,e[56]=h,e[57]=b,e[58]=u,e[59]=te,e[60]=p,e[61]=l,e[62]=_,e[63]=le):le=e[63],Ni(q,150,le),ce},X2=Mb.createContext(void 0),$e=t=>{let e=ff(),o=Mb.use(X2),n=Mb.useRef(null);if(n.current===null){let r=t?.path||e||t.potentiallyStalePath;n.current=o&&r&&o.path===r?"context":"impl"}if(n.current==="context"){if(!o)throw new Error("FieldContext was removed after mount. This breaks hook ordering.");return o}return o$(t)};function r$(t){let[,e]=t;return e}import{jsx as Z2}from"react/jsx-runtime";import"react";import{c as n$}from"react/compiler-runtime";var Ob=t=>{let e=n$(2),{children:o,path:n}=t,r;e[0]!==n?(r=l=>{let[a]=l;return a&&a?.[n]||null},e[0]=n,e[1]=r):r=e[1];let s=Rt(r),{passesCondition:i}=s||{};return i===!1?null:o};var Ve=t=>o=>{let{path:n}=o;return Z2(Ob,{path:n,children:Z2(t,{...o})})};var Ke=t=>({...t?.admin?.style||{},...t?.admin?.width?{"--field-width":t.admin.width}:{flex:"1 1 auto"},...t?.admin?.style?.flex?{flex:t.admin.style.flex}:{}});var Ae="field-type";function Ka({fieldLocalized:t,fieldRTL:e,locale:o,localizationConfig:n}){let r=o&&n&&n.locales&&n.locales.length>1,s=o?.code===n?.defaultLocale;return e!==!1&&o?.rtl===!0&&(t||!t&&!r||!t&&s)||e===!0}import{c as s$}from"react/compiler-runtime";import{jsx as Gc,jsxs as zb}from"react/jsx-runtime";import{useId as i$}from"react";import{jsx as Y2}from"react/jsx-runtime";import"react";var Vb=()=>Y2("svg",{className:"icon icon--check",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:Y2("path",{className:"stroke",d:"M15.3333 6.00001L8.00001 13.3333L4.66667 10",strokeLinecap:"square"})});import{jsx as J2}from"react/jsx-runtime";import"react";var Gb=()=>J2("svg",{className:"icon icon--line",fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:J2("path",{className:"stroke",d:"M5.33333 10H14.6667",strokeLinecap:"square"})});var zc="checkbox-input",Do=t=>{let e=s$(22),{id:o,name:n,AfterInput:r,BeforeInput:s,checked:i,className:l,inputRef:a,Label:c,label:u,localized:d,onToggle:m,partialChecked:f,readOnly:p,required:h}=t,g=i$(),b=o||g,C=i&&`${zc}--checked`,v=p&&`${zc}--read-only`,y;e[0]!==l||e[1]!==C||e[2]!==v?(y=[l,zc,C,v].filter(Boolean),e[0]=l,e[1]=C,e[2]=v,e[3]=y):y=e[3];let w=y.join(" "),S=!!i,x;if(e[4]!==r||e[5]!==s||e[6]!==c||e[7]!==i||e[8]!==b||e[9]!==a||e[10]!==u||e[11]!==d||e[12]!==n||e[13]!==m||e[14]!==f||e[15]!==p||e[16]!==h||e[17]!==w||e[18]!==S){let D=Gc("input",{"aria-label":"","aria-labelledby":n,defaultChecked:S,disabled:p,id:b,name:n,onInput:m,ref:a,required:h,title:n,type:"checkbox"}),F=!i&&f?"partial":"check",T;e[20]!==F?(T=[`${zc}__icon`,F].filter(Boolean),e[20]=F,e[21]=T):T=e[21],x=zb("div",{className:w,children:[zb("div",{className:`${zc}__input`,children:[s,D,zb("span",{className:T.join(" "),children:[i&&Gc(Vb,{}),!i&&f&&Gc(Gb,{})]}),r]}),Gc(de,{CustomComponent:c,Fallback:Gc(Se,{htmlFor:b,label:u,localized:d,required:h})})]}),e[4]=r,e[5]=s,e[6]=c,e[7]=i,e[8]=b,e[9]=a,e[10]=u,e[11]=d,e[12]=n,e[13]=m,e[14]=f,e[15]=p,e[16]=h,e[17]=w,e[18]=S,e[19]=x}else x=e[19];return x};var Wb="checkbox";var u$=t=>{let{id:e,checked:o,disableFormData:n,field:r,field:{admin:{className:s,description:i}={},label:l,required:a}={},onChange:c,partialChecked:u,path:d,readOnly:m,validate:f}=t,{uuid:p}=Me(),h=lt(),{i18n:{language:g}}=P(),b=l$.includes(g),C=q2((k,B)=>{if(typeof f=="function")return f(k,{...B,required:a})},[f,a]),{customComponents:{AfterInput:v,BeforeInput:y,Description:w,Error:S,Label:x}={},disabled:D,path:F,setValue:T,showError:R,value:I}=$e({disableFormData:n,potentiallyStalePath:d,validate:C}),_=q2(()=>{m||(T(!I),typeof c=="function"&&c(!I))},[c,m,T,I]),A=o||!!I,$=e||tf(F,h,p),N=c$(()=>Ke(r),[r]);return a$("div",{className:[Ae,Wb,R&&"error",s,I&&`${Wb}--checked`,(m||D)&&`${Wb}--read-only`].filter(Boolean).join(" "),style:N,children:[Wc(de,{CustomComponent:S,Fallback:Wc(Ze,{alignCaret:b?"right":"left",path:F,showError:R})}),Wc(Do,{AfterInput:v,BeforeInput:y,checked:A,id:$,inputRef:null,Label:x,label:l,name:F,onToggle:_,partialChecked:u,readOnly:m||D,required:a}),Wc(de,{CustomComponent:w,Fallback:Wc(Ue,{description:i,path:F})})]})},kr=Ve(u$);var m$="nullify-locale-field",Hc=t=>{let e=d$(13),{fieldValue:o,localized:n,path:r,readOnly:s}=t,i=s===void 0?!1:s,{code:l}=Ce(),{config:a}=G(),{localization:c}=a,[u,d]=K2.useState(typeof o!="number"),{t:m}=P(),{dispatchFields:f,setModified:p}=Me();if(!n||!c||c.defaultLocale===l||!c.fallback)return null;let h;e[0]!==u||e[1]!==f||e[2]!==o||e[3]!==r||e[4]!==p?(h=()=>{let C=!u;f({type:"UPDATE",path:r,value:C?null:o||0}),p(!0),d(C)},e[0]=u,e[1]=f,e[2]=o,e[3]=r,e[4]=p,e[5]=h):h=e[5];let g=h;if(o){let C=!1;if(typeof o=="number"&&o>0&&(C=!0),Array.isArray(o)&&o.length>0&&(C=!0),C)return u&&d(!1),null}let b;return e[6]!==u||e[7]!==o||e[8]!==g||e[9]!==r||e[10]!==i||e[11]!==m?(b=Q2(tn,{className:m$,children:!o&&i?m("general:fallbackToDefaultLocale"):Q2(kr,{checked:u,field:{name:"",label:m("general:fallbackToDefaultLocale")},id:`field-${r.replace(/\./g,"__")}`,onChange:g,path:r,schemaPath:""})}),e[6]=u,e[7]=o,e[8]=g,e[9]=r,e[10]=i,e[11]=m,e[12]=b):b=e[12],b};var el=t=>{let e=document.getElementById(t);if(e){let o=e.getBoundingClientRect();window.scrollBy({behavior:"smooth",top:o.top-100})}};import{c as fW}from"react/compiler-runtime";import{jsx as di,jsxs as pW}from"react/jsx-runtime";import{getTranslation as hW}from"@payloadcms/translations";import"react";import{c as f$}from"react/compiler-runtime";import{jsx as gr,jsxs as ji}from"react/jsx-runtime";import p$ from"react";var Ro="array-actions",pf=t=>{let e=f$(12),{addRow:o,copyRow:n,duplicateRow:r,hasMaxRows:s,index:i,isSortable:l,moveRow:a,pasteRow:c,removeRow:u,rowCount:d}=t,{t:m}=P(),f;return e[0]!==o||e[1]!==n||e[2]!==r||e[3]!==s||e[4]!==i||e[5]!==l||e[6]!==a||e[7]!==c||e[8]!==u||e[9]!==d||e[10]!==m?(f=gr(at,{button:gr(Sc,{}),buttonClassName:`${Ro}__button`,className:Ro,horizontalAlign:"center",render:p=>{let{close:h}=p;return ji(xe.ButtonGroup,{buttonSize:"small",children:[l&&i!==0&&ji(xe.Button,{className:`${Ro}__action ${Ro}__move-up`,onClick:()=>{a(i,i-1),h()},children:[gr("div",{className:`${Ro}__action-chevron`,children:gr(ze,{direction:"up"})}),m("general:moveUp")]}),l&&i<d-1&&ji(xe.Button,{className:`${Ro}__action`,onClick:()=>{a(i,i+1),h()},children:[gr("div",{className:`${Ro}__action-chevron`,children:gr(ze,{})}),m("general:moveDown")]}),!s&&ji(p$.Fragment,{children:[ji(xe.Button,{className:`${Ro}__action ${Ro}__add`,onClick:()=>{o(i+1),h()},children:[gr(er,{}),m("general:addBelow")]}),ji(xe.Button,{className:`${Ro}__action ${Ro}__duplicate`,onClick:()=>{r(i),h()},children:[gr(Fi,{}),m("general:duplicate")]})]}),gr(xe.Button,{className:`${Ro}__action ${Ro}__copy`,onClick:()=>{n(i),h()},children:gr(Ba,{isRow:!0})}),gr(xe.Button,{className:`${Ro}__action ${Ro}__paste`,onClick:()=>{c(i),h()},children:gr(Ba,{isPaste:!0,isRow:!0})}),ji(xe.Button,{className:`${Ro}__action ${Ro}__remove`,onClick:()=>{u(i),h()},children:[gr(pt,{}),m("general:remove")]})]})},size:"medium"}),e[0]=o,e[1]=n,e[2]=r,e[3]=s,e[4]=i,e[5]=l,e[6]=a,e[7]=c,e[8]=u,e[9]=d,e[10]=m,e[11]=f):f=e[11],f};import{c as I$}from"react/compiler-runtime";import{jsx as an,jsxs as Xb}from"react/jsx-runtime";import{useState as n3}from"react";import{jsx as tl,jsxs as h$}from"react/jsx-runtime";import"react";var sn=({className:t})=>h$("svg",{className:["icon icon--drag-handle",t].filter(Boolean).join(" "),viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:[tl("path",{className:"fill",d:"M7.99999 10.6667C8.36818 10.6667 8.66666 10.3682 8.66666 9.99999C8.66666 9.6318 8.36818 9.33332 7.99999 9.33332C7.63181 9.33332 7.33333 9.6318 7.33333 9.99999C7.33333 10.3682 7.63181 10.6667 7.99999 10.6667Z",strokeLinecap:"square"}),tl("path",{className:"fill",d:"M7.99999 5.99999C8.36818 5.99999 8.66666 5.70151 8.66666 5.33332C8.66666 4.96513 8.36818 4.66666 7.99999 4.66666C7.63181 4.66666 7.33333 4.96513 7.33333 5.33332C7.33333 5.70151 7.63181 5.99999 7.99999 5.99999Z",strokeLinecap:"square"}),tl("path",{className:"fill",d:"M7.99999 15.3333C8.36818 15.3333 8.66666 15.0348 8.66666 14.6667C8.66666 14.2985 8.36818 14 7.99999 14C7.63181 14 7.33333 14.2985 7.33333 14.6667C7.33333 15.0348 7.63181 15.3333 7.99999 15.3333Z",strokeLinecap:"square"}),tl("path",{className:"fill",d:"M12 10.6667C12.3682 10.6667 12.6667 10.3682 12.6667 9.99999C12.6667 9.6318 12.3682 9.33332 12 9.33332C11.6318 9.33332 11.3333 9.6318 11.3333 9.99999C11.3333 10.3682 11.6318 10.6667 12 10.6667Z",strokeLinecap:"square"}),tl("path",{className:"fill",d:"M12 5.99999C12.3682 5.99999 12.6667 5.70151 12.6667 5.33332C12.6667 4.96513 12.3682 4.66666 12 4.66666C11.6318 4.66666 11.3333 4.96513 11.3333 5.33332C11.3333 5.70151 11.6318 5.99999 12 5.99999Z",strokeLinecap:"square"}),tl("path",{className:"fill",d:"M12 15.3333C12.3682 15.3333 12.6667 15.0348 12.6667 14.6667C12.6667 14.2985 12.3682 14 12 14C11.6318 14 11.3333 14.2985 11.3333 14.6667C11.3333 15.0348 11.6318 15.3333 12 15.3333Z",strokeLinecap:"square"})]});import{jsx as t3}from"react/jsx-runtime";import hf,{useEffect as C$,useRef as Ub}from"react";import{useEffect as g$,useMemo as b$,useRef as Hb,useState as v$}from"react";var e3=({containerRef:t,contentRef:e,duration:o,open:n})=>{let r=b$(()=>typeof CSS<"u"&&CSS&&CSS.supports?CSS.supports("interpolate-size","allow-keywords"):!1,[]),s=Hb(!1),i=Hb(n),[l,a]=v$(!1),c=Hb(null);return g$(()=>{let u=t.current,d=e.current;if(!u||!d||r)return;let m=h=>{u.style.height=h},f=()=>{u&&(u.style.transition="",u.style.height=n?"auto":"0px",a(!1))};return(()=>{if(!s.current&&n){m("auto"),a(!1);return}s.current=!0,i.current!==n&&m(n?"0px":`${d.scrollHeight}px`),u.offsetHeight,a(!0),u.style.transition=`height ${o}ms ease`,m(n?`${d.scrollHeight}px`:"0px");let h=()=>{f(),u.removeEventListener("transitionend",h)};u.addEventListener("transitionend",h)})(),i.current=n,c.current=new ResizeObserver(()=>{l&&(u.style.height=n?`${d.scrollHeight}px`:"0px")}),c.current.observe(d),()=>{u&&(u.style.transition="",u.style.height=""),c.current?.disconnect()}},[n,o,t,e,r]),{browserSupportsKeywordAnimation:r}};var br=({id:t,children:e,className:o,duration:n=300,height:r})=>{let[s,i]=hf.useState(()=>!!r),l=Ub(s),[a,c]=hf.useState(()=>s?"":"none"),[u,d]=hf.useState(()=>s?"":"hidden"),[m,f]=hf.useState(!1),p=Ub(null),h=Ub(null);return C$(()=>{let g,b,C=!!r,v=l.current!==C;return l.current=C,v&&(f(!0),d("hidden"),C?c(""):g=window.setTimeout(()=>{c("none")},n),i(C),b=window.setTimeout(()=>{d(""),f(!1)},n)),()=>{g&&clearTimeout(g),b&&clearTimeout(b)}},[r,n]),e3({containerRef:p,contentRef:h,duration:n,open:s}),t3("div",{"aria-hidden":!s,className:[o,"rah-static",s&&r==="auto"&&"rah-static--height-auto",m&&`rah-animating--${s?"down":"up"}`,m&&r==="auto"&&"rah-animating--to-height-auto"].filter(Boolean).join(" "),id:t,ref:p,style:{overflow:u,transition:`height ${n}ms ease`},children:t3("div",{ref:h,...a?{style:{display:a}}:{},children:e})})};import{jsx as y$}from"react/jsx-runtime";import x$,{createContext as w$,use as S$}from"react";var o3=w$({isCollapsed:void 0,isVisible:void 0,isWithinCollapsible:void 0,toggle:()=>{}}),r3=({children:t,isCollapsed:e,isWithinCollapsible:o=!0,toggle:n})=>{let{isCollapsed:r,isVisible:s}=Ws(),i=x$.useMemo(()=>({isCollapsed:e,isVisible:s&&!r,isWithinCollapsible:o,toggle:n}),[e,o,n,r,s]);return y$(o3,{value:i,children:t})},Ws=()=>S$(o3);var jo="collapsible";var Bi=t=>{let e=I$(24),{actions:o,children:n,className:r,collapsibleStyle:s,dragHandleProps:i,header:l,initCollapsed:a,isCollapsed:c,onToggle:u}=t,d=s===void 0?"default":s,[m,f]=n3(!!a),[p,h]=n3(!1),{isWithinCollapsible:g}=Ws(),{t:b}=P(),C=typeof c=="boolean"?c:m,v;e[0]!==C||e[1]!==u?(v=()=>{typeof u=="function"&&u(!C),f(!C)},e[0]=C,e[1]=u,e[2]=v):v=e[2];let y=v,w=i&&`${jo}--has-drag-handle`,S=C&&`${jo}--collapsed`,x=g&&`${jo}--nested`,D=p&&`${jo}--hovered`,F=`${jo}--style-${d}`,T;e[3]!==r||e[4]!==w||e[5]!==S||e[6]!==x||e[7]!==D||e[8]!==F?(T=[jo,r,w,S,x,D,F].filter(Boolean),e[3]=r,e[4]=w,e[5]=S,e[6]=x,e[7]=D,e[8]=F,e[9]=T):T=e[9];let R=T.join(" "),I,_;e[10]===Symbol.for("react.memo_cache_sentinel")?(I=()=>h(!0),_=()=>h(!1),e[10]=I,e[11]=_):(I=e[10],_=e[11]);let A=`${jo}__toggle--${C?"collapsed":"open"}`,$;e[12]!==A?($=[`${jo}__toggle`,A].filter(Boolean),e[12]=A,e[13]=$):$=e[13];let N=$.join(" "),k;return e[14]!==o||e[15]!==n||e[16]!==i||e[17]!==l||e[18]!==C||e[19]!==b||e[20]!==N||e[21]!==R||e[22]!==y?(k=an("div",{className:R,children:Xb(r3,{isCollapsed:C,toggle:y,children:[Xb("div",{className:`${jo}__toggle-wrap`,onMouseEnter:I,onMouseLeave:_,children:[an("button",{className:N,onClick:y,type:"button",children:an("span",{children:b("fields:toggleBlock")})}),i&&an("div",{className:`${jo}__drag`,...i.attributes,...i.listeners,children:an(sn,{})}),l?an("div",{className:[`${jo}__header-wrap`,i&&`${jo}__header-wrap--has-drag-handle`].filter(Boolean).join(" "),children:l}):null,Xb("div",{className:`${jo}__actions-wrap`,children:[o?an("div",{className:`${jo}__actions`,children:o}):null,an("div",{className:`${jo}__indicator`,children:an(ze,{direction:C?void 0:"up"})})]})]}),an(br,{height:C?0:"auto",children:an("div",{className:`${jo}__content`,children:n})})]})}),e[14]=o,e[15]=n,e[16]=i,e[17]=l,e[18]=C,e[19]=b,e[20]=N,e[21]=R,e[22]=y,e[23]=k):k=e[23],k};import{c as cW}from"react/compiler-runtime";import{jsx as v0}from"react/jsx-runtime";import{fieldIsHiddenOrDisabled as uW,getFieldPaths as dW,getFieldPermissions as mW}from"payload/shared";import"react";import{c as _$}from"react/compiler-runtime";import{jsx as F$}from"react/jsx-runtime";import s3 from"react";var i3=t=>{let e=_$(9),{children:o,className:n,forceRender:r}=t,[s,i]=s3.useState(!!r),l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l={rootMargin:"1000px"},e[0]=l):l=e[0];let[a,c]=es(l,!!r),u=!!c?.isIntersecting,d=c?.boundingClientRect?.top<0,m=r||u||d,f,p;e[1]!==s||e[2]!==m?(f=()=>{m&&!s&&i(!0)},p=[m,s],e[1]=s,e[2]=m,e[3]=f,e[4]=p):(f=e[3],p=e[4]),s3.useEffect(f,p);let h=s?o:null,g;return e[5]!==n||e[6]!==a||e[7]!==h?(g=F$("div",{className:n,ref:a,children:h}),e[5]=n,e[6]=a,e[7]=h,e[8]=g):g=e[8],g};import{c as lW}from"react/compiler-runtime";import{jsx as Mt}from"react/jsx-runtime";import"react";import{jsx as Wt,jsxs as us}from"react/jsx-runtime";import{getTranslation as Qb}from"@payloadcms/translations";import Z$,{Fragment as F3,useCallback as En,useMemo as T3}from"react";import{c as H$}from"react/compiler-runtime";import{jsx as cn,jsxs as I3,Fragment as U$}from"react/jsx-runtime";import{getTranslation as X$}from"@payloadcms/translations";import"react";import{c as T$}from"react/compiler-runtime";import{jsx as Uc,jsxs as D$}from"react/jsx-runtime";import"react";var jr="pill",R$=t=>{let e=T$(12),{id:o,className:n}=t,r;e[0]!==o?(r={id:o},e[0]=o,e[1]=r):r=e[1];let{attributes:s,isDragging:i,listeners:l,setNodeRef:a,transform:c}=Ga(r),u=i&&`${jr}--is-dragging`,d;e[2]!==n||e[3]!==u?(d=[u,n].filter(Boolean),e[2]=n,e[3]=u,e[4]=d):d=e[4];let m=d.join(" "),f;return e[5]!==s||e[6]!==l||e[7]!==t||e[8]!==a||e[9]!==m||e[10]!==c?(f=Uc(a3,{...t,className:m,elementProps:{...l,...s,ref:a,style:{transform:c}}}),e[5]=s,e[6]=l,e[7]=t,e[8]=a,e[9]=m,e[10]=c,e[11]=f):f=e[11],f},a3=t=>{let{id:e,alignIcon:o="right","aria-checked":n,"aria-controls":r,"aria-expanded":s,"aria-label":i,children:l,className:a,draggable:c,elementProps:u,icon:d,onClick:m,pillStyle:f="light",rounded:p,size:h="medium",to:g}=t,b=[jr,`${jr}--style-${f}`,`${jr}--size-${h}`,a&&a,g&&`${jr}--has-link`,(g||m)&&`${jr}--has-action`,d&&`${jr}--has-icon`,d&&`${jr}--align-icon-${o}`,c&&`${jr}--draggable`,p&&`${jr}--rounded`].filter(Boolean).join(" "),C="div";return m&&!g&&(C="button"),g&&(C=Gt),D$(C,{...u,"aria-checked":n,"aria-controls":r,"aria-expanded":s,"aria-label":i,className:b,href:g||null,id:e,onClick:m,type:C==="button"?"button":void 0,children:[Uc("span",{className:`${jr}__label`,children:l}),!!d&&Uc("span",{className:`${jr}__icon`,children:d})]})},ct=t=>{let{draggable:e}=t;return e?Uc(R$,{...t}):Uc(a3,{...t})};import{useEffect as A$,useState as P$}from"react";function gf(t,e){let[o,n]=P$(t);return A$(()=>{let r=setTimeout(()=>{n(t)},e);return()=>{clearTimeout(r)}},[t,e]),o}import{c as G$}from"react/compiler-runtime";import{jsx as C3,jsxs as z$}from"react/jsx-runtime";import y3 from"react";import{jsx as Pn,jsxs as g3}from"react/jsx-runtime";import{getTranslation as Cf}from"@payloadcms/translations";import{useEffect as b3,useMemo as O$,useState as v3}from"react";import{c as E$}from"react/compiler-runtime";import{jsx as l3,jsxs as N$}from"react/jsx-runtime";import"react";var Xc="thumbnail-card",c3=t=>{let e=E$(13),{alignLabel:o,className:n,collection:r,doc:s,label:i,onClick:l,thumbnail:a}=t,{config:c}=G(),{i18n:u}=P(),d=typeof l=="function"&&`${Xc}--has-on-click`,m=o&&`${Xc}--align-label-${o}`,f;e[0]!==n||e[1]!==d||e[2]!==m?(f=[Xc,n,d,m].filter(Boolean),e[0]=n,e[1]=d,e[2]=m,e[3]=f):f=e[3];let p=f.join(" "),h;if(e[4]!==p||e[5]!==r||e[6]!==c||e[7]!==s||e[8]!==u||e[9]!==i||e[10]!==l||e[11]!==a){let g=i;g||(g=Go({collectionConfig:r,data:s,dateFormat:c.admin.dateFormat,fallback:s?.filename,i18n:u})),h=N$("button",{className:p,onClick:l,title:g,type:"button",children:[l3("div",{className:`${Xc}__thumbnail`,children:a}),l3("div",{className:`${Xc}__label`,children:g})]}),e[4]=p,e[5]=r,e[6]=c,e[7]=s,e[8]=u,e[9]=i,e[10]=l,e[11]=a,e[12]=h}else h=e[12];return h};import{jsx as cs,jsxs as d3}from"react/jsx-runtime";import{useState as j$}from"react";var Ao=[];for(bf=0;bf<256;++bf)Ao.push((bf+256).toString(16).slice(1));var bf;function u3(t,e=0){return(Ao[t[e+0]]+Ao[t[e+1]]+Ao[t[e+2]]+Ao[t[e+3]]+"-"+Ao[t[e+4]]+Ao[t[e+5]]+"-"+Ao[t[e+6]]+Ao[t[e+7]]+"-"+Ao[t[e+8]]+Ao[t[e+9]]+"-"+Ao[t[e+10]]+Ao[t[e+11]]+Ao[t[e+12]]+Ao[t[e+13]]+Ao[t[e+14]]+Ao[t[e+15]]).toLowerCase()}var vf,L$=new Uint8Array(16);function Zb(){if(!vf&&(vf=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!vf))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return vf(L$)}var $$=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Yb={randomUUID:$$};function k$(t,e,o){if(Yb.randomUUID&&!e&&!t)return Yb.randomUUID();t=t||{};var n=t.random||(t.rng||Zb)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,e){o=o||0;for(var r=0;r<16;++r)e[o+r]=n[r];return e}return u3(n)}var ln=k$;var Jb=()=>{let[t]=j$(()=>`pattern${ln()}`);return d3("svg",{fill:"none",height:"151",preserveAspectRatio:"xMidYMid slice",viewBox:"0 0 231 151",width:"231",xmlns:"http://www.w3.org/2000/svg",children:[d3("g",{clipPath:`url(#${t})`,children:[cs("rect",{fill:"#D9D9D9",height:"100%",rx:"2",width:"100%"}),cs("rect",{fill:"#BCBCBC",height:"116.063",transform:"rotate(52.0687 33.7051 79.3051)",width:"85.8593",x:"33.7051",y:"79.3051"}),cs("rect",{fill:"#BCBCBC",height:"116.063",transform:"rotate(52.0687 86.1219 92.6272)",width:"85.8593",x:"86.1219",y:"92.6272"}),cs("circle",{cx:"189",cy:"45",fill:"#BCBCBC",r:"19"}),cs("rect",{fill:"#B8B8B8",height:"5",rx:"2.5",width:"98",x:"66",y:"70"}),cs("rect",{fill:"#B8B8B8",height:"5",rx:"2.5",width:"76",x:"77",y:"82"})]}),cs("defs",{children:cs("clipPath",{id:`${t}`,children:cs("rect",{fill:"white",height:"151",width:"231"})})})]})};import{c as B$}from"react/compiler-runtime";import{jsx as f3,jsxs as M$}from"react/jsx-runtime";import"react";import{jsx as m3}from"react/jsx-runtime";import"react";var Mi=()=>m3("svg",{className:"icon icon--search",fill:"none",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:m3("path",{className:"stroke",d:"M16 16L13.1333 13.1333M14.6667 9.33333C14.6667 12.2789 12.2789 14.6667 9.33333 14.6667C6.38781 14.6667 4 12.2789 4 9.33333C4 6.38781 6.38781 4 9.33333 4C12.2789 4 14.6667 6.38781 14.6667 9.33333Z",strokeLinecap:"square"})});var p3="block-search",h3=t=>{let e=B$(5),{setSearchTerm:o}=t,{t:n}=P(),r;e[0]!==o?(r=l=>{o(l.target.value)},e[0]=o,e[1]=r):r=e[1];let s=r,i;return e[2]!==s||e[3]!==n?(i=M$("div",{className:p3,children:[f3("input",{className:`${p3}__input`,onChange:s,placeholder:n("fields:searchForBlock")}),f3(Mi,{})]}),e[2]=s,e[3]=n,e[4]=i):i=e[4],i};var Hs="blocks-drawer",V$=(t,e)=>typeof t.labels.singular=="string"?t.labels.singular.toLowerCase():typeof t.labels.singular=="object"?Cf(t.labels.singular,e).toLowerCase():"",Zc=t=>{let{addRow:e,addRowIndex:o,blocks:n,drawerSlug:r,labels:s}=t,[i,l]=v3(""),[a,c]=v3(n),{closeModal:u,isModalOpen:d}=ie(),{i18n:m,t:f}=P(),{config:p}=G(),h=O$(()=>{let g={_none:[]};return a.forEach(b=>{if(typeof b=="object"&&b.admin?.group){let C=b.admin.group,v=typeof C=="string"?C:Cf(C,m);Object.hasOwn(g,v)?g[v].push(b):g[v]=[b]}else g._none.push(b)}),g},[a,m]);return b3(()=>{d(r)||l("")},[d,r]),b3(()=>{let g=i.toLowerCase(),b=n?.reduce((C,v)=>{let y=typeof v=="string"?p.blocksMap[v]:v;return V$(y,m).includes(g)&&C.push(y),C},[]);c(b)},[i,n,m,p.blocksMap]),g3(Nt,{slug:r,title:f("fields:addLabel",{label:Cf(s.singular,m)}),children:[Pn(h3,{setSearchTerm:l}),Pn("div",{className:`${Hs}__blocks-wrapper`,children:Pn("ul",{className:`${Hs}__block-groups`,children:Object.entries(h).map(([g,b])=>b.length?g3("li",{className:[`${Hs}__block-group`,g==="_none"&&`${Hs}__block-group-none`].filter(Boolean).join(" "),children:[g!=="_none"&&Pn("h3",{className:`${Hs}__block-group-label`,children:g}),Pn("ul",{className:`${Hs}__blocks`,children:b.map((C,v)=>{let y=typeof C=="string"?p.blocksMap[C]:C,{slug:w,imageAltText:S,imageURL:x,labels:D}=y;return Pn("li",{className:`${Hs}__block`,children:Pn(c3,{alignLabel:"center",label:Cf(D?.singular,m),onClick:()=>{e(o,w),u(r)},thumbnail:Pn("div",{className:`${Hs}__default-image`,children:x?Pn("img",{alt:S,src:x}):Pn(Jb,{})})})},v)})})]},g):null)})})]})};var x3=t=>{let e=G$(28),{addRow:o,blocks:n,blockType:r,copyRow:s,duplicateRow:i,hasMaxRows:l,isSortable:a,labels:c,moveRow:u,pasteRow:d,removeRow:m,rowCount:f,rowIndex:p}=t,{closeModal:h,openModal:g}=ie(),b=Ec("blocks-drawer"),[C,v]=y3.useState(null),y;e[0]!==o||e[1]!==h||e[2]!==b||e[3]!==C?(y=(S,x)=>{typeof o=="function"&&o(C,x),h(b)},e[0]=o,e[1]=h,e[2]=b,e[3]=C,e[4]=y):y=e[4];let w;if(e[5]!==r||e[6]!==n||e[7]!==s||e[8]!==b||e[9]!==i||e[10]!==l||e[11]!==a||e[12]!==c||e[13]!==u||e[14]!==g||e[15]!==d||e[16]!==m||e[17]!==f||e[18]!==p||e[19]!==y){let S;e[21]!==b||e[22]!==g?(S=D=>{v(D),g(b)},e[21]=b,e[22]=g,e[23]=S):S=e[23];let x;e[24]!==r||e[25]!==i||e[26]!==p?(x=()=>i(p,r),e[24]=r,e[25]=i,e[26]=p,e[27]=x):x=e[27],w=z$(y3.Fragment,{children:[C3(Zc,{addRow:y,addRowIndex:p,blocks:n,drawerSlug:b,labels:c}),C3(pf,{addRow:S,copyRow:s,duplicateRow:x,hasMaxRows:l,index:p,isSortable:a,moveRow:u,pasteRow:d,removeRow:m,rowCount:f})]}),e[5]=r,e[6]=n,e[7]=s,e[8]=b,e[9]=i,e[10]=l,e[11]=a,e[12]=c,e[13]=u,e[14]=g,e[15]=d,e[16]=m,e[17]=f,e[18]=p,e[19]=y,e[20]=w}else w=e[20];return w};import{c as W$}from"react/compiler-runtime";import{jsx as w3}from"react/jsx-runtime";import"react";var S3="section-title",qb=t=>{let e=W$(14),{customOnChange:o,customValue:n,path:r,readOnly:s}=t,i;e[0]!==r?(i={path:r},e[0]=r,e[1]=i):i=e[1];let{setValue:l,value:a}=$e(i),{t:c}=P(),u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=[S3].filter(Boolean),e[2]=u):u=e[2];let d=u.join(" "),m;e[3]!==o||e[4]!==l?(m=o||(g=>{g.stopPropagation(),g.preventDefault(),l(g.target.value)}),e[3]=o,e[4]=l,e[5]=m):m=e[5];let f=m,p=n||a,h;return e[6]!==n||e[7]!==f||e[8]!==r||e[9]!==s||e[10]!==c||e[11]!==p||e[12]!==a?(h=w3("div",{className:d,"data-value":p,children:w3("input",{className:`${S3}__input`,id:r,name:r,onChange:f,placeholder:c("general:untitled"),readOnly:s,type:"text",value:n||a||""})}),e[6]=n,e[7]=f,e[8]=r,e[9]=s,e[10]=c,e[11]=p,e[12]=a,e[13]=h):h=e[13],h};var Us="blocks-field",_3=t=>{let e=H$(42),{addRow:o,attributes:n,block:r,blocks:s,copyRow:i,duplicateRow:l,errorCount:a,fields:c,hasMaxRows:u,isLoading:d,isSortable:m,Label:f,labels:p,listeners:h,moveRow:g,parentPath:b,pasteRow:C,path:v,permissions:y,readOnly:w,removeRow:S,row:x,rowCount:D,rowIndex:F,schemaPath:T,setCollapse:R,setNodeRef:I,transform:_}=t,A=gf(d,500),{i18n:$}=P(),k=so()&&a>0,B=!r.admin?.disableBlockName,E=k?`${Us}__row--has-errors`:`${Us}__row--no-errors`,L;e[0]!==E?(L=[`${Us}__row`,E].filter(Boolean),e[0]=E,e[1]=L):L=e[1];let M=L.join(" "),j;if(y===!0)j=!0;else{let V=y?.blocks?.[r.slug];V===!0?j=!0:j=V?.fields}let O=`${b?.split(".").join("-")}-row-${F}`,z;if(e[2]!==f||e[3]!==o||e[4]!==n||e[5]!==r.fields||e[6]!==r.labels||e[7]!==j||e[8]!==s||e[9]!==M||e[10]!==i||e[11]!==l||e[12]!==a||e[13]!==k||e[14]!==c||e[15]!==u||e[16]!==$||e[17]!==A||e[18]!==m||e[19]!==p||e[20]!==h||e[21]!==g||e[22]!==b||e[23]!==C||e[24]!==v||e[25]!==w||e[26]!==S||e[27]!==x.blockType||e[28]!==x.collapsed||e[29]!==x.id||e[30]!==D||e[31]!==F||e[32]!==T||e[33]!==R||e[34]!==I||e[35]!==B||e[36]!==O||e[37]!==_){let V;e[39]!==x.id||e[40]!==R?(V=W=>R(x.id,W),e[39]=x.id,e[40]=R,e[41]=V):V=e[41],z=cn("div",{id:O,ref:I,style:{transform:_},children:cn(Bi,{actions:w?void 0:cn(x3,{addRow:o,blocks:s,blockType:x.blockType,copyRow:i,duplicateRow:l,fields:r.fields,hasMaxRows:u,isSortable:m,labels:p,moveRow:g,pasteRow:C,removeRow:S,rowCount:D,rowIndex:F}),className:M,collapsibleStyle:k?"error":"default",dragHandleProps:m?{id:x.id,attributes:n,listeners:h}:void 0,header:A?cn(wt,{height:"1rem",width:"8rem"}):I3("div",{className:`${Us}__block-header`,children:[cn(Kn,{CustomComponent:f,label:I3(U$,{children:[cn("span",{className:`${Us}__block-number`,children:String(F+1).padStart(2,"0")}),cn(ct,{className:`${Us}__block-pill ${Us}__block-pill-${x.blockType}`,pillStyle:"white",size:"small",children:X$(r.labels.singular,$)}),B&&cn(qb,{path:`${v}.blockName`,readOnly:w})]}),path:v,rowNumber:F}),k&&cn(vo,{count:a,i18n:$,withMessage:!0})]}),isCollapsed:x.collapsed,onToggle:V,children:A?cn(wt,{}):cn(Po,{className:`${Us}__fields`,fields:c,margins:"small",parentIndexPath:"",parentPath:v,parentSchemaPath:T,permissions:j,readOnly:w})},x.id)},`${b}-row-${F}`),e[2]=f,e[3]=o,e[4]=n,e[5]=r.fields,e[6]=r.labels,e[7]=j,e[8]=s,e[9]=M,e[10]=i,e[11]=l,e[12]=a,e[13]=k,e[14]=c,e[15]=u,e[16]=$,e[17]=A,e[18]=m,e[19]=p,e[20]=h,e[21]=g,e[22]=b,e[23]=C,e[24]=v,e[25]=w,e[26]=S,e[27]=x.blockType,e[28]=x.collapsed,e[29]=x.id,e[30]=D,e[31]=F,e[32]=T,e[33]=R,e[34]=I,e[35]=B,e[36]=O,e[37]=_,e[38]=z}else z=e[38];return z};var Br="blocks-field",Y$=t=>{let{i18n:e,t:o}=P(),{field:n,field:{name:r,type:s,admin:{className:i,description:l,isSortable:a=!0}={},blockReferences:c,blocks:u,label:d,labels:m,localized:f,maxRows:p,minRows:h,required:g},path:b,permissions:C,readOnly:v,schemaPath:y,validate:w}=t,S=y??r,x=h??g?1:0,{setDocFieldPreferences:D}=Te(),{addFieldRow:F,dispatchFields:T,getFields:R,moveFieldRow:I,removeFieldRow:_,replaceState:A,setModified:$}=Me(),{code:N}=Ce(),{config:{localization:k},config:B}=G(),E=Ec("blocks-drawer"),L=so(),M={plural:o("fields:blocks"),singular:o("fields:block"),...m},j=(()=>{if(k&&k.fallback){let be=k.defaultLocale;return N===be}return!0})(),O=T3(()=>{if(!c)return u;let be=[];for(let ve of c){let ye=typeof ve=="string"?B.blocksMap[ve]:ve;ye&&be.push(ye)}return be},[c,u,B.blocksMap]),z=En((be,ve)=>{if(!j&&be===null)return!0;if(typeof w=="function")return w(be,{...ve,maxRows:p,minRows:x,required:g})},[p,x,g,w,j]),{customComponents:{AfterInput:V,BeforeInput:W,Description:X,Error:U,Label:Z}={},disabled:ee,errorPaths:ce,path:q,rows:te=[],showError:le,valid:pe,value:fe}=$e({hasRows:!0,potentiallyStalePath:b,validate:z}),ue=En((be,ve)=>{F({blockType:ve,path:q,rowIndex:be,schemaPath:S}),setTimeout(()=>{el(`${q}-row-${be+1}`)},0)},[F,q,S]),Fe=En(be=>{T({type:"DUPLICATE_ROW",path:q,rowIndex:be}),$(!0),setTimeout(()=>{el(`${q}-row-${be+1}`)},0)},[T,q,$]),Ie=En(be=>{_({path:q,rowIndex:be})},[q,_]),Le=En((be,ve)=>{I({moveFromIndex:be,moveToIndex:ve,path:q})},[I,q]),Y=En(be=>{let{collapsedIDs:ve,updatedRows:ye}=rf({collapsed:be,rows:te});T({type:"SET_ALL_ROWS_COLLAPSED",path:q,updatedRows:ye}),D(q,{collapsed:ve})},[T,q,te,D]),ae=En((be,ve)=>{let{collapsedIDs:ye,updatedRows:Je}=of({collapsed:ve,rowID:be,rows:te});T({type:"SET_ROW_COLLAPSED",path:q,updatedRows:Je}),D(q,{collapsed:ye})},[T,q,te,D]),H=En(be=>{let ve=ka({type:s,blocks:O,getDataToCopy:()=>Oa({formState:{...R()},path:q,rowIndex:be}),path:q,rowIndex:be,t:o});typeof ve=="string"?Q.error(ve):Q.success(o("general:copied"))},[O,q,o,s,R]),J=En(be=>{let ye=ja({onPaste:Je=>{let it={...R()},Ge=Va({dataFromClipboard:Je,formState:it,path:q,rowIndex:be});A(Ge),$(!0)},path:q,schemaBlocks:O,t:o});typeof ye=="string"&&Q.error(ye)},[O,R,q,A,$,o]),re=En(be=>{let ve={...R()},ye=Va({dataFromClipboard:be,formState:ve,path:q});A(ye),$(!0)},[R,q,A,$]),ne=p&&te.length>=p,he=ce.length,oe=L&&he+(pe?0:1)>0,ge=te.length<x||g&&te.length===0,De=v&&te.length===0,Be=T3(()=>Ke(n),[n]);return us("div",{className:[Ae,Br,i,oe?`${Br}--has-error`:`${Br}--has-no-error`].filter(Boolean).join(" "),id:`field-${q?.replace(/\./g,"__")}`,style:Be,children:[le&&Wt(de,{CustomComponent:U,Fallback:Wt(Ze,{path:q,showError:le})}),us("header",{className:`${Br}__header`,children:[us("div",{className:`${Br}__header-wrap`,children:[us("div",{className:`${Br}__heading-with-error`,children:[Wt("h3",{children:Wt(de,{CustomComponent:Z,Fallback:Wt(Se,{as:"span",label:d,localized:f,path:q,required:g})})}),oe&&he>0&&Wt(vo,{count:he,i18n:e,withMessage:!0})]}),us("ul",{className:`${Br}__header-actions`,children:[te.length>0&&us(F3,{children:[Wt("li",{children:Wt("button",{className:`${Br}__header-action`,onClick:()=>Y(!0),type:"button",children:o("fields:collapseAll")})}),Wt("li",{children:Wt("button",{className:`${Br}__header-action`,onClick:()=>Y(!1),type:"button",children:o("fields:showAll")})})]}),Wt("li",{children:Wt(Em,{allowCopy:te?.length>0,allowPaste:!v,blocks:O,className:`${Br}__header-action`,disabled:ee,getDataToCopy:()=>Oa({formState:{...R()},path:q}),onPaste:re,path:q,type:s})})]})]}),Wt(de,{CustomComponent:X,Fallback:Wt(Ue,{description:l,path:q})})]}),W,Wt(Hc,{fieldValue:fe,localized:f,path:q,readOnly:v}),(te.length>0||!pe&&(De||ge))&&us(Nr,{className:`${Br}__rows`,ids:te.map(be=>be.id),onDragEnd:({moveFromIndex:be,moveToIndex:ve})=>Le(be,ve),children:[te.map((be,ve)=>{let{blockType:ye,isLoading:Je}=be,it=B.blocksMap[ye]??(c??u).find(Ge=>typeof Ge!="string"&&Ge.slug===ye);if(it){let Ge=`${q}.${ve}`,ft=ce.filter(et=>et.startsWith(Ge+".")).length;return Wt(Dn,{disabled:v||ee||!a,id:be.id,children:et=>Wt(_3,{...et,addRow:ue,block:it,blocks:c??u,copyRow:H,duplicateRow:Fe,errorCount:ft,fields:it.fields,hasMaxRows:ne,isLoading:Je,isSortable:a,Label:te?.[ve]?.customComponents?.RowLabel,labels:M,moveRow:Le,parentPath:q,pasteRow:J,path:Ge,permissions:C,readOnly:v||ee,removeRow:Ie,row:be,rowCount:te.length,rowIndex:ve,schemaPath:S+it.slug,setCollapse:ae})},be.id)}return null}),!j&&us(Z$.Fragment,{children:[ge&&Wt(tn,{type:"error",children:o("validation:requiresAtLeast",{count:x,label:Qb(x>1?M.plural:M.singular,e)||o(x>1?"general:row":"general:rows")})}),De&&Wt(tn,{children:o("validation:fieldHasNo",{label:Qb(M.plural,e)})})]})]}),!ne&&us(F3,{children:[Wt(is,{className:`${Br}__drawer-toggler`,disabled:v||ee,slug:E,children:Wt(K,{buttonStyle:"icon-label",disabled:v||ee,el:"span",icon:"plus",iconPosition:"left",iconStyle:"with-border",children:o("fields:addLabel",{label:Qb(M.singular,e)})})}),Wt(Zc,{addRow:ue,addRowIndex:te?.length||0,blocks:c??u,drawerSlug:E,labels:M})]}),V]})},Yc=Ve(Y$);import{jsx as Oi,jsxs as D3}from"react/jsx-runtime";import K$,{useCallback as R3,useEffect as ek,useMemo as tk,useState as A3}from"react";import{jsx as Kb}from"react/jsx-runtime";import{lazy as J$,Suspense as q$}from"react";var Q$=J$(()=>import("./CodeEditor-O6BWJHD2.js")),Jc=t=>Kb(q$,{fallback:Kb(wt,{}),children:Kb(Q$,{...t})});var ok={js:"javascript",ts:"typescript"},rk="code-field",nk=t=>{let{field:e,field:{admin:{className:o,description:n,editorOptions:r={},language:s="javascript"}={},label:i,localized:l,required:a},onMount:c,path:u,readOnly:d,validate:m}=t,f=K$.useRef("system"),[p,h]=A3(""),g=R3((N,k)=>{if(typeof m=="function")return m(N,{...k,required:a})},[m,a]),{customComponents:{AfterInput:b,BeforeInput:C,Description:v,Error:y,Label:w}={},disabled:S,initialValue:x,path:D,setValue:F,showError:T,value:R}=$e({potentiallyStalePath:u,validate:g}),[I,_]=A3(()=>(R||x)!==void 0?R??x:void 0),A=R3(N=>{if(!(d||S)){f.current="user";try{F(N||null)}catch{F(N||null)}}},[d,S,F]);ek(()=>{f.current==="system"&&(_((R||x)!==void 0?R??x:void 0),h(`${D}-${new Date().toString()}`)),f.current="system"},[x,D,R]);let $=tk(()=>Ke(e),[e]);return D3("div",{className:[Ae,rk,o,T&&"error",(d||S)&&"read-only"].filter(Boolean).join(" "),style:$,children:[Oi(de,{CustomComponent:w,Fallback:Oi(Se,{label:i,localized:l,path:D,required:a})}),D3("div",{className:`${Ae}__wrap`,children:[Oi(de,{CustomComponent:y,Fallback:Oi(Ze,{path:D,showError:T})}),C,Oi(Jc,{defaultLanguage:ok[s]||s,onChange:A,onMount:c,options:r,readOnly:d||S,value:I,wrapperProps:{id:`field-${D?.replace(/\./g,"__")}`}},p),b]}),Oi(de,{CustomComponent:v,Fallback:Oi(Ue,{description:n,path:D})})]})},qc=Ve(nk);import{jsx as Gi,jsxs as e1}from"react/jsx-runtime";import{getTranslation as ik}from"@payloadcms/translations";import{Fragment as ak,useCallback as lk,useEffect as ck,useMemo as uk,useState as E3}from"react";import{c as sk}from"react/compiler-runtime";import{fieldAffectsData as P3}from"payload/shared";var yf=t=>t.reduce((e,o)=>{let n="fields"in o?o.fields:void 0;return n?P3(o)?e.push(`${o.name}.`):e.push(...yf(n)):o.type==="tabs"?"tabs"in o&&o.tabs?.forEach(r=>{"name"in r?e.push(`${r.name}.`):e.push(...yf(r.fields))}):P3(o)&&e.push(o.name),e},[]);var Vi=t=>{let e=sk(12),{fields:o,path:n,setErrorCount:r}=t,[s]=Bs(),i=so(),l;e[0]!==o?(l=yf(o),e[0]=o,e[1]=l):l=e[1];let a=l,c;e[2]!==s||e[3]!==i||e[4]!==n||e[5]!==a||e[6]!==r?(c=()=>{if(i){let d=0;Object.entries(s).forEach(m=>{let[f]=m;if(a?.some(h=>{let g=[...n,h].join(".");return g.endsWith(".")?f.startsWith(g):f===g})){let h=s[f];"valid"in h&&!h.valid&&(d=d+1)}}),r(d)}},e[2]=s,e[3]=i,e[4]=n,e[5]=a,e[6]=r,e[7]=c):c=e[7];let u;return e[8]!==o||e[9]!==s||e[10]!==i?(u=[s,i,o],e[8]=o,e[9]=s,e[10]=i,e[11]=u):u=e[11],Ni(c,250,u),null};var Qc="collapsible-field",dk=t=>{let{field:e,field:{admin:{className:o,description:n,initCollapsed:r=!1}={},fields:s,label:i}={},indexPath:l,parentPath:a,parentSchemaPath:c,path:u,permissions:d,readOnly:m}=t,{i18n:f}=P(),{getPreference:p,setPreference:h}=Qt(),{preferencesKey:g}=Te(),[b,C]=E3(),v=`collapsible-${u?.replace(/\./g,"__")}`,[y,w]=E3(0),S=y>0,{customComponents:{AfterInput:x,BeforeInput:D,Description:F,Label:T}={},disabled:R}=$e({path:u}),I=lk(async A=>{let $=await p(g);g&&h(g,{...$,...u?{fields:{...$?.fields||{},[u]:{...$?.fields?.[u],collapsed:A}}}:{fields:{...$?.fields||{},[v]:{...$?.fields?.[v],collapsed:A}}}})},[g,v,p,h,u]);ck(()=>{(async()=>{if(g){let $=await p(g),N=u?$?.fields?.[u]?.collapsed:$?.fields?.[v]?.collapsed;C(N!==void 0?!!N:typeof r=="boolean"?r:!1)}else C(typeof r=="boolean"?r:!1)})()},[p,g,v,r,u]);let _=uk(()=>Ke(e),[e]);return typeof b!="boolean"?null:e1(ak,{children:[Gi(Vi,{fields:s,path:u.split(".").slice(0,-1),setErrorCount:w}),e1("div",{className:[Ae,Qc,o,S?`${Qc}--has-error`:`${Qc}--has-no-error`].filter(Boolean).join(" "),id:`field-${v}`,style:_,children:[D,Gi(Bi,{className:`${Qc}__collapsible`,collapsibleStyle:S?"error":"default",header:e1("div",{className:`${Qc}__row-label-wrap`,children:[Gi(Kn,{CustomComponent:T,label:ik(i,f),path:u}),S&&Gi(vo,{count:y,i18n:f,withMessage:!0})]}),initCollapsed:b,onToggle:I,children:Gi(Po,{fields:s,margins:"small",parentIndexPath:l,parentPath:a,parentSchemaPath:c,permissions:d,readOnly:m||R})}),x,Gi(de,{CustomComponent:F,Fallback:Gi(Ue,{description:n,path:u})})]})]})},Kc=Ve(dk);import{jsx as Js,jsxs as S_}from"react/jsx-runtime";import{getTranslation as cM}from"@payloadcms/translations";import{useCallback as z1,useMemo as I_}from"react";import{jsx as t1}from"react/jsx-runtime";import{lazy as mk,Suspense as fk}from"react";var pk=mk(()=>import("./DatePicker-F432AIH3.js")),ol=t=>t1(fk,{fallback:t1(wt,{height:50}),children:t1(pk,{...t})});import{jsx as w_,jsxs as aM}from"react/jsx-runtime";import{useMemo as lM}from"react";import{jsx as Xi}from"react/jsx-runtime";import{getTranslation as C_}from"@payloadcms/translations";import y_,{useEffect as rM,useId as nM}from"react";function un(t){"@babel/helpers - typeof";return un=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},un(t)}function N3(t,e){if(un(t)!="object"||!t)return t;var o=t[Symbol.toPrimitive];if(o!==void 0){var n=o.call(t,e||"default");if(un(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function xf(t){var e=N3(t,"string");return un(e)=="symbol"?e:e+""}function zi(t,e,o){return(e=xf(e))in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t}function L3(t,e){var o=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(t,r).enumerable})),o.push.apply(o,n)}return o}function Ne(t){for(var e=1;e<arguments.length;e++){var o=arguments[e]!=null?arguments[e]:{};e%2?L3(Object(o),!0).forEach(function(n){zi(t,n,o[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):L3(Object(o)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(o,n))})}return t}function $3(t){if(Array.isArray(t))return t}function k3(t,e){var o=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(o!=null){var n,r,s,i,l=[],a=!0,c=!1;try{if(s=(o=o.call(t)).next,e===0){if(Object(o)!==o)return;a=!1}else for(;!(a=(n=s.call(o)).done)&&(l.push(n.value),l.length!==e);a=!0);}catch(u){c=!0,r=u}finally{try{if(!a&&o.return!=null&&(i=o.return(),Object(i)!==i))return}finally{if(c)throw r}}return l}}function eu(t,e){(e==null||e>t.length)&&(e=t.length);for(var o=0,n=Array(e);o<e;o++)n[o]=t[o];return n}function wf(t,e){if(t){if(typeof t=="string")return eu(t,e);var o={}.toString.call(t).slice(8,-1);return o==="Object"&&t.constructor&&(o=t.constructor.name),o==="Map"||o==="Set"?Array.from(t):o==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?eu(t,e):void 0}}function j3(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
49
49
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function dn(t,e){return $3(t)||k3(t,e)||wf(t,e)||j3()}function or(t,e){if(t==null)return{};var o,n,r=za(t,e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(n=0;n<s.length;n++)o=s[n],e.includes(o)||{}.propertyIsEnumerable.call(t,o)&&(r[o]=t[o])}return r}import{useState as o1,useCallback as Sf}from"react";var hk=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function If(t){var e=t.defaultInputValue,o=e===void 0?"":e,n=t.defaultMenuIsOpen,r=n===void 0?!1:n,s=t.defaultValue,i=s===void 0?null:s,l=t.inputValue,a=t.menuIsOpen,c=t.onChange,u=t.onInputChange,d=t.onMenuClose,m=t.onMenuOpen,f=t.value,p=or(t,hk),h=o1(l!==void 0?l:o),g=dn(h,2),b=g[0],C=g[1],v=o1(a!==void 0?a:r),y=dn(v,2),w=y[0],S=y[1],x=o1(f!==void 0?f:i),D=dn(x,2),F=D[0],T=D[1],R=Sf(function(B,E){typeof c=="function"&&c(B,E),T(B)},[c]),I=Sf(function(B,E){var L;typeof u=="function"&&(L=u(B,E)),C(L!==void 0?L:B)},[u]),_=Sf(function(){typeof m=="function"&&m(),S(!0)},[m]),A=Sf(function(){typeof d=="function"&&d(),S(!1)},[d]),$=l!==void 0?l:b,N=a!==void 0?a:w,k=f!==void 0?f:F;return Ne(Ne({},p),{},{inputValue:$,menuIsOpen:N,onChange:R,onInputChange:I,onMenuClose:A,onMenuOpen:_,value:k})}import*as QI from"react";import{forwardRef as MB,useMemo as Ube}from"react";function B3(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function M3(t,e){for(var o=0;o<e.length;o++){var n=e[o];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,xf(n.key),n)}}function O3(t,e,o){return e&&M3(t.prototype,e),o&&M3(t,o),Object.defineProperty(t,"prototype",{writable:!1}),t}function V3(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Wa(t,e)}function tu(t){return tu=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},tu(t)}function r1(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(r1=function(){return!!t})()}function G3(t,e){if(e&&(un(e)=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return bw(t)}function z3(t){var e=r1();return function(){var o,n=tu(t);if(e){var r=tu(this).constructor;o=Reflect.construct(n,arguments,r)}else o=n.apply(this,arguments);return G3(this,o)}}function W3(t){if(Array.isArray(t))return eu(t)}function H3(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function U3(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
50
50
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Xs(t){return W3(t)||H3(t)||wf(t)||U3()}import*as ht from"react";import{useMemo as uu,Fragment as F1,useRef as gl,useCallback as Ys,useEffect as VI,Component as tB}from"react";import*as Or from"react";import{useContext as Xk,forwardRef as Zk}from"react";var gk=!1;function bk(t){if(t.sheet)return t.sheet;for(var e=0;e<document.styleSheets.length;e++)if(document.styleSheets[e].ownerNode===t)return document.styleSheets[e]}function vk(t){var e=document.createElement("style");return e.setAttribute("data-emotion",t.key),t.nonce!==void 0&&e.setAttribute("nonce",t.nonce),e.appendChild(document.createTextNode("")),e.setAttribute("data-s",""),e}var X3=function(){function t(o){var n=this;this._insertTag=function(r){var s;n.tags.length===0?n.insertionPoint?s=n.insertionPoint.nextSibling:n.prepend?s=n.container.firstChild:s=n.before:s=n.tags[n.tags.length-1].nextSibling,n.container.insertBefore(r,s),n.tags.push(r)},this.isSpeedy=o.speedy===void 0?!gk:o.speedy,this.tags=[],this.ctr=0,this.nonce=o.nonce,this.key=o.key,this.container=o.container,this.prepend=o.prepend,this.insertionPoint=o.insertionPoint,this.before=null}var e=t.prototype;return e.hydrate=function(n){n.forEach(this._insertTag)},e.insert=function(n){this.ctr%(this.isSpeedy?65e3:1)===0&&this._insertTag(vk(this));var r=this.tags[this.tags.length-1];if(this.isSpeedy){var s=bk(r);try{s.insertRule(n,s.cssRules.length)}catch{}}else r.appendChild(document.createTextNode(n));this.ctr++},e.flush=function(){this.tags.forEach(function(n){var r;return(r=n.parentNode)==null?void 0:r.removeChild(n)}),this.tags=[],this.ctr=0},t}();var Eo="-ms-",ou="-moz-",ut="-webkit-",_f="comm",rl="rule",nl="decl";var Z3="@import";var Ff="@keyframes";var Y3="@layer";var J3=Math.abs,Wi=String.fromCharCode,q3=Object.assign;function Q3(t,e){return eo(t,0)^45?(((e<<2^eo(t,0))<<2^eo(t,1))<<2^eo(t,2))<<2^eo(t,3):0}function Tf(t){return t.trim()}function n1(t,e){return(t=e.exec(t))?t[0]:t}function rt(t,e,o){return t.replace(e,o)}function ru(t,e){return t.indexOf(e)}function eo(t,e){return t.charCodeAt(e)|0}function Zs(t,e,o){return t.slice(e,o)}function zo(t){return t.length}function sl(t){return t.length}function il(t,e){return e.push(t),t}function s1(t,e){return t.map(e).join("")}var Df=1,al=1,K3=0,Wo=0,ao=0,cl="";function nu(t,e,o,n,r,s,i){return{value:t,root:e,parent:o,type:n,props:r,children:s,line:Df,column:al,length:i,return:""}}function ul(t,e){return q3(nu("",null,null,"",null,null,0),t,{length:-t.length},e)}function eS(){return ao}function tS(){return ao=Wo>0?eo(cl,--Wo):0,al--,ao===10&&(al=1,Df--),ao}function Ho(){return ao=Wo<K3?eo(cl,Wo++):0,al++,ao===10&&(al=1,Df++),ao}function Mr(){return eo(cl,Wo)}function su(){return Wo}function dl(t,e){return Zs(cl,t,e)}function ll(t){switch(t){case 0:case 9:case 10:case 13:case 32:return 5;case 33:case 43:case 44:case 47:case 62:case 64:case 126:case 59:case 123:case 125:return 4;case 58:return 3;case 34:case 39:case 40:case 91:return 2;case 41:case 93:return 1}return 0}function Rf(t){return Df=al=1,K3=zo(cl=t),Wo=0,[]}function Af(t){return cl="",t}function ml(t){return Tf(dl(Wo-1,i1(t===91?t+2:t===40?t+1:t)))}function oS(t){for(;(ao=Mr())&&ao<33;)Ho();return ll(t)>2||ll(ao)>3?"":" "}function rS(t,e){for(;--e&&Ho()&&!(ao<48||ao>102||ao>57&&ao<65||ao>70&&ao<97););return dl(t,su()+(e<6&&Mr()==32&&Ho()==32))}function i1(t){for(;Ho();)switch(ao){case t:return Wo;case 34:case 39:t!==34&&t!==39&&i1(ao);break;case 40:t===41&&i1(t);break;case 92:Ho();break}return Wo}function nS(t,e){for(;Ho()&&t+ao!==57;)if(t+ao===84&&Mr()===47)break;return"/*"+dl(e,Wo-1)+"*"+Wi(t===47?t:Ho())}function sS(t){for(;!ll(Mr());)Ho();return dl(t,Wo)}function lS(t){return Af(Pf("",null,null,null,[""],t=Rf(t),0,[0],t))}function Pf(t,e,o,n,r,s,i,l,a){for(var c=0,u=0,d=i,m=0,f=0,p=0,h=1,g=1,b=1,C=0,v="",y=r,w=s,S=n,x=v;g;)switch(p=C,C=Ho()){case 40:if(p!=108&&eo(x,d-1)==58){ru(x+=rt(ml(C),"&","&\f"),"&\f")!=-1&&(b=-1);break}case 34:case 39:case 91:x+=ml(C);break;case 9:case 10:case 13:case 32:x+=oS(p);break;case 92:x+=rS(su()-1,7);continue;case 47:switch(Mr()){case 42:case 47:il(Ck(nS(Ho(),su()),e,o),a);break;default:x+="/"}break;case 123*h:l[c++]=zo(x)*b;case 125*h:case 59:case 0:switch(C){case 0:case 125:g=0;case 59+u:b==-1&&(x=rt(x,/\f/g,"")),f>0&&zo(x)-d&&il(f>32?aS(x+";",n,o,d-1):aS(rt(x," ","")+";",n,o,d-2),a);break;case 59:x+=";";default:if(il(S=iS(x,e,o,c,u,r,l,v,y=[],w=[],d),s),C===123)if(u===0)Pf(x,e,S,S,y,s,d,l,w);else switch(m===99&&eo(x,3)===110?100:m){case 100:case 108:case 109:case 115:Pf(t,S,S,n&&il(iS(t,S,S,0,0,r,l,v,r,y=[],d),w),r,w,d,l,n?y:w);break;default:Pf(x,S,S,S,[""],w,0,l,w)}}c=u=f=0,h=b=1,v=x="",d=i;break;case 58:d=1+zo(x),f=p;default:if(h<1){if(C==123)--h;else if(C==125&&h++==0&&tS()==125)continue}switch(x+=Wi(C),C*h){case 38:b=u>0?1:(x+="\f",-1);break;case 44:l[c++]=(zo(x)-1)*b,b=1;break;case 64:Mr()===45&&(x+=ml(Ho())),m=Mr(),u=d=zo(v=x+=sS(su())),C++;break;case 45:p===45&&zo(x)==2&&(h=0)}}return s}function iS(t,e,o,n,r,s,i,l,a,c,u){for(var d=r-1,m=r===0?s:[""],f=sl(m),p=0,h=0,g=0;p<n;++p)for(var b=0,C=Zs(t,d+1,d=J3(h=i[p])),v=t;b<f;++b)(v=Tf(h>0?m[b]+" "+C:rt(C,/&\f/g,m[b])))&&(a[g++]=v);return nu(t,e,o,r===0?rl:l,a,c,u)}function Ck(t,e,o){return nu(t,e,o,_f,Wi(eS()),Zs(t,2,-2),0)}function aS(t,e,o,n){return nu(t,e,o,nl,Zs(t,0,n),Zs(t,n+1,-1),n)}function Hi(t,e){for(var o="",n=sl(t),r=0;r<n;r++)o+=e(t[r],r,t,e)||"";return o}function cS(t,e,o,n){switch(t.type){case Y3:if(t.children.length)break;case Z3:case nl:return t.return=t.return||t.value;case _f:return"";case Ff:return t.return=t.value+"{"+Hi(t.children,n)+"}";case rl:t.value=t.props.join(",")}return zo(o=Hi(t.children,n))?t.return=t.value+"{"+o+"}":""}function uS(t){var e=sl(t);return function(o,n,r,s){for(var i="",l=0;l<e;l++)i+=t[l](o,n,r,s)||"";return i}}function dS(t){return function(e){e.root||(e=e.return)&&t(e)}}function mS(t){var e=Object.create(null);return function(o){return e[o]===void 0&&(e[o]=t(o)),e[o]}}var yk=function(e,o,n){for(var r=0,s=0;r=s,s=Mr(),r===38&&s===12&&(o[n]=1),!ll(s);)Ho();return dl(e,Wo)},xk=function(e,o){var n=-1,r=44;do switch(ll(r)){case 0:r===38&&Mr()===12&&(o[n]=1),e[n]+=yk(Wo-1,o,n);break;case 2:e[n]+=ml(r);break;case 4:if(r===44){e[++n]=Mr()===58?"&\f":"",o[n]=e[n].length;break}default:e[n]+=Wi(r)}while(r=Ho());return e},wk=function(e,o){return Af(xk(Rf(e),o))},fS=new WeakMap,Sk=function(e){if(!(e.type!=="rule"||!e.parent||e.length<1)){for(var o=e.value,n=e.parent,r=e.column===n.column&&e.line===n.line;n.type!=="rule";)if(n=n.parent,!n)return;if(!(e.props.length===1&&o.charCodeAt(0)!==58&&!fS.get(n))&&!r){fS.set(e,!0);for(var s=[],i=wk(o,s),l=n.props,a=0,c=0;a<i.length;a++)for(var u=0;u<l.length;u++,c++)e.props[c]=s[a]?i[a].replace(/&\f/g,l[u]):l[u]+" "+i[a]}}},Ik=function(e){if(e.type==="decl"){var o=e.value;o.charCodeAt(0)===108&&o.charCodeAt(2)===98&&(e.return="",e.value="")}};function pS(t,e){switch(Q3(t,e)){case 5103:return ut+"print-"+t+t;case 5737:case 4201:case 3177:case 3433:case 1641:case 4457:case 2921:case 5572:case 6356:case 5844:case 3191:case 6645:case 3005:case 6391:case 5879:case 5623:case 6135:case 4599:case 4855:case 4215:case 6389:case 5109:case 5365:case 5621:case 3829:return ut+t+t;case 5349:case 4246:case 4810:case 6968:case 2756:return ut+t+ou+t+Eo+t+t;case 6828:case 4268:return ut+t+Eo+t+t;case 6165:return ut+t+Eo+"flex-"+t+t;case 5187:return ut+t+rt(t,/(\w+).+(:[^]+)/,ut+"box-$1$2"+Eo+"flex-$1$2")+t;case 5443:return ut+t+Eo+"flex-item-"+rt(t,/flex-|-self/,"")+t;case 4675:return ut+t+Eo+"flex-line-pack"+rt(t,/align-content|flex-|-self/,"")+t;case 5548:return ut+t+Eo+rt(t,"shrink","negative")+t;case 5292:return ut+t+Eo+rt(t,"basis","preferred-size")+t;case 6060:return ut+"box-"+rt(t,"-grow","")+ut+t+Eo+rt(t,"grow","positive")+t;case 4554:return ut+rt(t,/([^-])(transform)/g,"$1"+ut+"$2")+t;case 6187:return rt(rt(rt(t,/(zoom-|grab)/,ut+"$1"),/(image-set)/,ut+"$1"),t,"")+t;case 5495:case 3959:return rt(t,/(image-set\([^]*)/,ut+"$1$`$1");case 4968:return rt(rt(t,/(.+:)(flex-)?(.*)/,ut+"box-pack:$3"+Eo+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+ut+t+t;case 4095:case 3583:case 4068:case 2532:return rt(t,/(.+)-inline(.+)/,ut+"$1$2")+t;case 8116:case 7059:case 5753:case 5535:case 5445:case 5701:case 4933:case 4677:case 5533:case 5789:case 5021:case 4765:if(zo(t)-1-e>6)switch(eo(t,e+1)){case 109:if(eo(t,e+4)!==45)break;case 102:return rt(t,/(.+:)(.+)-([^]+)/,"$1"+ut+"$2-$3$1"+ou+(eo(t,e+3)==108?"$3":"$2-$3"))+t;case 115:return~ru(t,"stretch")?pS(rt(t,"stretch","fill-available"),e)+t:t}break;case 4949:if(eo(t,e+1)!==115)break;case 6444:switch(eo(t,zo(t)-3-(~ru(t,"!important")&&10))){case 107:return rt(t,":",":"+ut)+t;case 101:return rt(t,/(.+:)([^;!]+)(;|!.+)?/,"$1"+ut+(eo(t,14)===45?"inline-":"")+"box$3$1"+ut+"$2$3$1"+Eo+"$2box$3")+t}break;case 5936:switch(eo(t,e+11)){case 114:return ut+t+Eo+rt(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return ut+t+Eo+rt(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return ut+t+Eo+rt(t,/[svh]\w+-[tblr]{2}/,"lr")+t}return ut+t+Eo+t+t}return t}var _k=function(e,o,n,r){if(e.length>-1&&!e.return)switch(e.type){case nl:e.return=pS(e.value,e.length);break;case Ff:return Hi([ul(e,{value:rt(e.value,"@","@"+ut)})],r);case rl:if(e.length)return s1(e.props,function(s){switch(n1(s,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Hi([ul(e,{props:[rt(s,/:(read-\w+)/,":"+ou+"$1")]})],r);case"::placeholder":return Hi([ul(e,{props:[rt(s,/:(plac\w+)/,":"+ut+"input-$1")]}),ul(e,{props:[rt(s,/:(plac\w+)/,":"+ou+"$1")]}),ul(e,{props:[rt(s,/:(plac\w+)/,Eo+"input-$1")]})],r)}return""})}},Fk=[_k],a1=function(e){var o=e.key;if(o==="css"){var n=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(n,function(h){var g=h.getAttribute("data-emotion");g.indexOf(" ")!==-1&&(document.head.appendChild(h),h.setAttribute("data-s",""))})}var r=e.stylisPlugins||Fk,s={},i,l=[];i=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+o+' "]'),function(h){for(var g=h.getAttribute("data-emotion").split(" "),b=1;b<g.length;b++)s[g[b]]=!0;l.push(h)});var a,c=[Sk,Ik];{var u,d=[cS,dS(function(h){u.insert(h)})],m=uS(c.concat(r,d)),f=function(g){return Hi(lS(g),m)};a=function(g,b,C,v){u=C,f(g?g+"{"+b.styles+"}":b.styles),v&&(p.inserted[b.name]=!0)}}var p={key:o,sheet:new X3({key:o,container:i,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:s,registered:{},insert:a};return p.sheet.hydrate(l),p};var Mk=!0;function f1(t,e,o){var n="";return o.split(" ").forEach(function(r){t[r]!==void 0?e.push(t[r]+";"):r&&(n+=r+" ")}),n}var Gf=function(e,o,n){var r=e.key+"-"+o.name;(n===!1||Mk===!1)&&e.registered[r]===void 0&&(e.registered[r]=o.styles)},p1=function(e,o,n){Gf(e,o,n);var r=e.key+"-"+o.name;if(e.inserted[o.name]===void 0){var s=o;do e.insert(o===s?"."+r:"",s,e.sheet,!0),s=s.next;while(s!==void 0)}};function FS(t){for(var e=0,o,n=0,r=t.length;r>=4;++n,r-=4)o=t.charCodeAt(n)&255|(t.charCodeAt(++n)&255)<<8|(t.charCodeAt(++n)&255)<<16|(t.charCodeAt(++n)&255)<<24,o=(o&65535)*1540483477+((o>>>16)*59797<<16),o^=o>>>24,e=(o&65535)*1540483477+((o>>>16)*59797<<16)^(e&65535)*1540483477+((e>>>16)*59797<<16);switch(r){case 3:e^=(t.charCodeAt(n+2)&255)<<16;case 2:e^=(t.charCodeAt(n+1)&255)<<8;case 1:e^=t.charCodeAt(n)&255,e=(e&65535)*1540483477+((e>>>16)*59797<<16)}return e^=e>>>13,e=(e&65535)*1540483477+((e>>>16)*59797<<16),((e^e>>>15)>>>0).toString(36)}var TS={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1};var Ok=!1,Vk=/[A-Z]|^ms/g,Gk=/_EMO_([^_]+?)_([^]*?)_EMO_/g,PS=function(e){return e.charCodeAt(1)===45},DS=function(e){return e!=null&&typeof e!="boolean"},h1=mS(function(t){return PS(t)?t:t.replace(Vk,"-$&").toLowerCase()}),RS=function(e,o){switch(e){case"animation":case"animationName":if(typeof o=="string")return o.replace(Gk,function(n,r,s){return Nn={name:r,styles:s,next:Nn},r})}return TS[e]!==1&&!PS(e)&&typeof o=="number"&&o!==0?o+"px":o},zk="Component selectors can only be used in conjunction with @emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware compiler transform.";function iu(t,e,o){if(o==null)return"";var n=o;if(n.__emotion_styles!==void 0)return n;switch(typeof o){case"boolean":return"";case"object":{var r=o;if(r.anim===1)return Nn={name:r.name,styles:r.styles,next:Nn},r.name;var s=o;if(s.styles!==void 0){var i=s.next;if(i!==void 0)for(;i!==void 0;)Nn={name:i.name,styles:i.styles,next:Nn},i=i.next;var l=s.styles+";";return l}return Wk(t,e,o)}case"function":{if(t!==void 0){var a=Nn,c=o(t);return Nn=a,iu(t,e,c)}break}}var u=o;if(e==null)return u;var d=e[u];return d!==void 0?d:u}function Wk(t,e,o){var n="";if(Array.isArray(o))for(var r=0;r<o.length;r++)n+=iu(t,e,o[r])+";";else for(var s in o){var i=o[s];if(typeof i!="object"){var l=i;e!=null&&e[l]!==void 0?n+=s+"{"+e[l]+"}":DS(l)&&(n+=h1(s)+":"+RS(s,l)+";")}else{if(s==="NO_COMPONENT_SELECTOR"&&Ok)throw new Error(zk);if(Array.isArray(i)&&typeof i[0]=="string"&&(e==null||e[i[0]]===void 0))for(var a=0;a<i.length;a++)DS(i[a])&&(n+=h1(s)+":"+RS(s,i[a])+";");else{var c=iu(t,e,i);switch(s){case"animation":case"animationName":{n+=h1(s)+":"+c+";";break}default:n+=s+"{"+c+"}"}}}}return n}var AS=/label:\s*([^\s;{]+)\s*(;|$)/g,Nn;function zf(t,e,o){if(t.length===1&&typeof t[0]=="object"&&t[0]!==null&&t[0].styles!==void 0)return t[0];var n=!0,r="";Nn=void 0;var s=t[0];if(s==null||s.raw===void 0)n=!1,r+=iu(o,e,s);else{var i=s;r+=i[0]}for(var l=1;l<t.length;l++)if(r+=iu(o,e,t[l]),n){var a=s;r+=a[l]}AS.lastIndex=0;for(var c="",u;(u=AS.exec(r))!==null;)c+="-"+u[1];var d=FS(r)+c;return{name:d,styles:r,next:Nn}}import*as Wf from"react";var Hk=function(e){return e()},Uk=Wf.useInsertionEffect?Wf.useInsertionEffect:!1,g1=Uk||Hk;var ES=!1,NS=Or.createContext(typeof HTMLElement<"u"?a1({key:"css"}):null),Kge=NS.Provider;var LS=function(e){return Zk(function(o,n){var r=Xk(NS);return e(o,r,n)})},$S=Or.createContext({});var Hf={}.hasOwnProperty,b1="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",kS=function(e,o){var n={};for(var r in o)Hf.call(o,r)&&(n[r]=o[r]);return n[b1]=e,n},Yk=function(e){var o=e.cache,n=e.serialized,r=e.isStringTag;return Gf(o,n,r),g1(function(){return p1(o,n,r)}),null},Jk=LS(function(t,e,o){var n=t.css;typeof n=="string"&&e.registered[n]!==void 0&&(n=e.registered[n]);var r=t[b1],s=[n],i="";typeof t.className=="string"?i=f1(e.registered,s,t.className):t.className!=null&&(i=t.className+" ");var l=zf(s,void 0,Or.useContext($S));i+=e.key+"-"+l.name;var a={};for(var c in t)Hf.call(t,c)&&c!=="css"&&c!==b1&&!ES&&(a[c]=t[c]);return a.className=i,o&&(a.ref=o),Or.createElement(Or.Fragment,null,Or.createElement(Yk,{cache:e,serialized:l,isStringTag:typeof r=="string"}),Or.createElement(r,a))}),jS=Jk;import*as fl from"react";var cbe=yi(_S()),ke=function(e,o){var n=arguments;if(o==null||!Hf.call(o,"css"))return fl.createElement.apply(void 0,n);var r=n.length,s=new Array(r);s[0]=jS,s[1]=kS(e,o);for(var i=2;i<r;i++)s[i]=n[i];return fl.createElement.apply(null,s)};(function(t){var e;e||(e=t.JSX||(t.JSX={}))})(ke||(ke={}));function au(){for(var t=arguments.length,e=new Array(t),o=0;o<t;o++)e[o]=arguments[o];return zf(e)}function BS(){var t=au.apply(void 0,arguments),e="animation-"+t.name;return{name:e,styles:"@keyframes "+e+"{"+t.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}}function MS(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}y5();import{useContext as Qk,useRef as y1,useState as Yf,useMemo as Kk,useCallback as v1,createContext as ej}from"react";import{createPortal as tj}from"react-dom";import{useLayoutEffect as qk}from"react";var Uf=qk;var oj=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],lu=function(){};function rj(t,e){return e?e[0]==="-"?t+e:t+"__"+e:t}function VS(t,e){for(var o=arguments.length,n=new Array(o>2?o-2:0),r=2;r<o;r++)n[r-2]=arguments[r];var s=[].concat(n);if(e&&t)for(var i in e)e.hasOwnProperty(i)&&e[i]&&s.push("".concat(rj(t,i)));return s.filter(function(l){return l}).map(function(l){return String(l).trim()}).join(" ")}var pl=function(e){return cj(e)?e.filter(Boolean):un(e)==="object"&&e!==null?[e]:[]},GS=function(e){e.className,e.clearValue,e.cx,e.getStyles,e.getClassNames,e.getValue,e.hasValue,e.isMulti,e.isRtl,e.options,e.selectOption,e.selectProps,e.setValue,e.theme;var o=or(e,oj);return Ne({},o)},Ht=function(e,o,n){var r=e.cx,s=e.getStyles,i=e.getClassNames,l=e.className;return{css:s(o,e),className:r(n??{},i(o,e),l)}};function cu(t){return[document.documentElement,document.body,window].indexOf(t)>-1}function nj(t){return cu(t)?window.innerHeight:t.clientHeight}function zS(t){return cu(t)?window.pageYOffset:t.scrollTop}function Jf(t,e){if(cu(t)){window.scrollTo(0,e);return}t.scrollTop=e}function sj(t){var e=getComputedStyle(t),o=e.position==="absolute",n=/(auto|scroll)/;if(e.position==="fixed")return document.documentElement;for(var r=t;r=r.parentElement;)if(e=getComputedStyle(r),!(o&&e.position==="static")&&n.test(e.overflow+e.overflowY+e.overflowX))return r;return document.documentElement}function ij(t,e,o,n){return o*((t=t/n-1)*t*t+1)+e}function Xf(t,e){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:200,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:lu,r=zS(t),s=e-r,i=10,l=0;function a(){l+=i;var c=ij(l,r,s,o);Jf(t,c),l<o?window.requestAnimationFrame(a):n(t)}a()}function x1(t,e){var o=t.getBoundingClientRect(),n=e.getBoundingClientRect(),r=e.offsetHeight/3;n.bottom+r>o.bottom?Jf(t,Math.min(e.offsetTop+e.clientHeight-t.offsetHeight+r,t.scrollHeight)):n.top-r<o.top&&Jf(t,Math.max(e.offsetTop-r,0))}function aj(t){var e=t.getBoundingClientRect();return{bottom:e.bottom,height:e.height,left:e.left,right:e.right,top:e.top,width:e.width}}function w1(){try{return document.createEvent("TouchEvent"),!0}catch{return!1}}function WS(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch{return!1}}var HS=!1,lj={get passive(){return HS=!0}},Zf=typeof window<"u"?window:{};Zf.addEventListener&&Zf.removeEventListener&&(Zf.addEventListener("p",lu,lj),Zf.removeEventListener("p",lu,!1));var US=HS;function XS(t){return t!=null}function cj(t){return Array.isArray(t)}function Ui(t,e,o){return t?e:o}var ZS=function(e){for(var o=arguments.length,n=new Array(o>1?o-1:0),r=1;r<o;r++)n[r-1]=arguments[r];var s=Object.entries(e).filter(function(i){var l=dn(i,1),a=l[0];return!n.includes(a)});return s.reduce(function(i,l){var a=dn(l,2),c=a[0],u=a[1];return i[c]=u,i},{})},uj=["children","innerProps"],dj=["children","innerProps"];function mj(t){var e=t.maxHeight,o=t.menuEl,n=t.minHeight,r=t.placement,s=t.shouldScroll,i=t.isFixedPosition,l=t.controlHeight,a=sj(o),c={placement:"bottom",maxHeight:e};if(!o||!o.offsetParent)return c;var u=a.getBoundingClientRect(),d=u.height,m=o.getBoundingClientRect(),f=m.bottom,p=m.height,h=m.top,g=o.offsetParent.getBoundingClientRect(),b=g.top,C=i?window.innerHeight:nj(a),v=zS(a),y=parseInt(getComputedStyle(o).marginBottom,10),w=parseInt(getComputedStyle(o).marginTop,10),S=b-w,x=C-h,D=S+v,F=d-v-h,T=f-C+v+y,R=v+h-w,I=160;switch(r){case"auto":case"bottom":if(x>=p)return{placement:"bottom",maxHeight:e};if(F>=p&&!i)return s&&Xf(a,T,I),{placement:"bottom",maxHeight:e};if(!i&&F>=n||i&&x>=n){s&&Xf(a,T,I);var _=i?x-y:F-y;return{placement:"bottom",maxHeight:_}}if(r==="auto"||i){var A=e,$=i?S:D;return $>=n&&(A=Math.min($-y-l,e)),{placement:"top",maxHeight:A}}if(r==="bottom")return s&&Jf(a,T),{placement:"bottom",maxHeight:e};break;case"top":if(S>=p)return{placement:"top",maxHeight:e};if(D>=p&&!i)return s&&Xf(a,R,I),{placement:"top",maxHeight:e};if(!i&&D>=n||i&&S>=n){var N=e;return(!i&&D>=n||i&&S>=n)&&(N=i?S-w:D-w),s&&Xf(a,R,I),{placement:"top",maxHeight:N}}return{placement:"bottom",maxHeight:e};default:throw new Error('Invalid placement provided "'.concat(r,'".'))}return c}function fj(t){var e={bottom:"top",top:"bottom"};return t?e[t]:"bottom"}var YS=function(e){return e==="auto"?"bottom":e},JS=function(e,o){var n,r=e.placement,s=e.theme,i=s.borderRadius,l=s.spacing,a=s.colors;return Ne((n={label:"menu"},zi(n,fj(r),"100%"),zi(n,"position","absolute"),zi(n,"width","100%"),zi(n,"zIndex",1),n),o?{}:{backgroundColor:a.neutral0,borderRadius:i,boxShadow:"0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)",marginBottom:l.menuGutter,marginTop:l.menuGutter})},qS=ej(null),QS=function(e){var o=e.children,n=e.minMenuHeight,r=e.maxMenuHeight,s=e.menuPlacement,i=e.menuPosition,l=e.menuShouldScrollIntoView,a=e.theme,c=Qk(qS)||{},u=c.setPortalPlacement,d=y1(null),m=Yf(r),f=dn(m,2),p=f[0],h=f[1],g=Yf(null),b=dn(g,2),C=b[0],v=b[1],y=a.spacing.controlHeight;return Uf(function(){var w=d.current;if(w){var S=i==="fixed",x=l&&!S,D=mj({maxHeight:r,menuEl:w,minHeight:n,placement:s,shouldScroll:x,isFixedPosition:S,controlHeight:y});h(D.maxHeight),v(D.placement),u?.(D.placement)}},[r,s,i,l,n,u,y]),o({ref:d,placerProps:Ne(Ne({},e),{},{placement:C||YS(s),maxHeight:p})})},pj=function(e){var o=e.children,n=e.innerRef,r=e.innerProps;return ke("div",Ee({},Ht(e,"menu",{menu:!0}),{ref:n},r),o)},hj=pj,KS=function(e,o){var n=e.maxHeight,r=e.theme.spacing.baseUnit;return Ne({maxHeight:n,overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},o?{}:{paddingBottom:r,paddingTop:r})},gj=function(e){var o=e.children,n=e.innerProps,r=e.innerRef,s=e.isMulti;return ke("div",Ee({},Ht(e,"menuList",{"menu-list":!0,"menu-list--is-multi":s}),{ref:r},n),o)},eI=function(e,o){var n=e.theme,r=n.spacing.baseUnit,s=n.colors;return Ne({textAlign:"center"},o?{}:{color:s.neutral40,padding:"".concat(r*2,"px ").concat(r*3,"px")})},tI=eI,oI=eI,bj=function(e){var o=e.children,n=o===void 0?"No options":o,r=e.innerProps,s=or(e,uj);return ke("div",Ee({},Ht(Ne(Ne({},s),{},{children:n,innerProps:r}),"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),r),n)},vj=function(e){var o=e.children,n=o===void 0?"Loading...":o,r=e.innerProps,s=or(e,dj);return ke("div",Ee({},Ht(Ne(Ne({},s),{},{children:n,innerProps:r}),"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),r),n)},rI=function(e){var o=e.rect,n=e.offset,r=e.position;return{left:o.left,position:r,top:n,width:o.width,zIndex:1}},Cj=function(e){var o=e.appendTo,n=e.children,r=e.controlElement,s=e.innerProps,i=e.menuPlacement,l=e.menuPosition,a=y1(null),c=y1(null),u=Yf(YS(i)),d=dn(u,2),m=d[0],f=d[1],p=Kk(function(){return{setPortalPlacement:f}},[]),h=Yf(null),g=dn(h,2),b=g[0],C=g[1],v=v1(function(){if(r){var x=aj(r),D=l==="fixed"?0:window.pageYOffset,F=x[m]+D;(F!==b?.offset||x.left!==b?.rect.left||x.width!==b?.rect.width)&&C({offset:F,rect:x})}},[r,l,m,b?.offset,b?.rect.left,b?.rect.width]);Uf(function(){v()},[v]);var y=v1(function(){typeof c.current=="function"&&(c.current(),c.current=null),r&&a.current&&(c.current=Yy(r,a.current,v,{elementResize:"ResizeObserver"in window}))},[r,v]);Uf(function(){y()},[y]);var w=v1(function(x){a.current=x,y()},[y]);if(!o&&l!=="fixed"||!b)return null;var S=ke("div",Ee({ref:w},Ht(Ne(Ne({},e),{},{offset:b.offset,position:l,rect:b.rect}),"menuPortal",{"menu-portal":!0}),s),n);return ke(qS.Provider,{value:p},o?tj(S,o):S)},nI=function(e){var o=e.isDisabled,n=e.isRtl;return{label:"container",direction:n?"rtl":void 0,pointerEvents:o?"none":void 0,position:"relative"}},yj=function(e){var o=e.children,n=e.innerProps,r=e.isDisabled,s=e.isRtl;return ke("div",Ee({},Ht(e,"container",{"--is-disabled":r,"--is-rtl":s}),n),o)},sI=function(e,o){var n=e.theme.spacing,r=e.isMulti,s=e.hasValue,i=e.selectProps.controlShouldRenderValue;return Ne({alignItems:"center",display:r&&s&&i?"flex":"grid",flex:1,flexWrap:"wrap",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"},o?{}:{padding:"".concat(n.baseUnit/2,"px ").concat(n.baseUnit*2,"px")})},xj=function(e){var o=e.children,n=e.innerProps,r=e.isMulti,s=e.hasValue;return ke("div",Ee({},Ht(e,"valueContainer",{"value-container":!0,"value-container--is-multi":r,"value-container--has-value":s}),n),o)},iI=function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},wj=function(e){var o=e.children,n=e.innerProps;return ke("div",Ee({},Ht(e,"indicatorsContainer",{indicators:!0}),n),o)},OS,Sj=["size"],Ij=["innerProps","isRtl","size"];var _j={name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"},aI=function(e){var o=e.size,n=or(e,Sj);return ke("svg",Ee({height:o,width:o,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:_j},n))},S1=function(e){return ke(aI,Ee({size:20},e),ke("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"}))},lI=function(e){return ke(aI,Ee({size:20},e),ke("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"}))},cI=function(e,o){var n=e.isFocused,r=e.theme,s=r.spacing.baseUnit,i=r.colors;return Ne({label:"indicatorContainer",display:"flex",transition:"color 150ms"},o?{}:{color:n?i.neutral60:i.neutral20,padding:s*2,":hover":{color:n?i.neutral80:i.neutral40}})},uI=cI,Fj=function(e){var o=e.children,n=e.innerProps;return ke("div",Ee({},Ht(e,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),n),o||ke(lI,null))},dI=cI,Tj=function(e){var o=e.children,n=e.innerProps;return ke("div",Ee({},Ht(e,"clearIndicator",{indicator:!0,"clear-indicator":!0}),n),o||ke(S1,null))},mI=function(e,o){var n=e.isDisabled,r=e.theme,s=r.spacing.baseUnit,i=r.colors;return Ne({label:"indicatorSeparator",alignSelf:"stretch",width:1},o?{}:{backgroundColor:n?i.neutral10:i.neutral20,marginBottom:s*2,marginTop:s*2})},Dj=function(e){var o=e.innerProps;return ke("span",Ee({},o,Ht(e,"indicatorSeparator",{"indicator-separator":!0})))},Rj=BS(OS||(OS=MS([`
|
|
51
51
|
0%, 80%, 100% { opacity: 0; }
|