@payloadcms/ui 3.37.0-internal.f2e6c68 → 3.37.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (48) hide show
  1. package/dist/elements/IDLabel/index.d.ts.map +1 -1
  2. package/dist/elements/IDLabel/index.js +64 -10
  3. package/dist/elements/IDLabel/index.js.map +1 -1
  4. package/dist/elements/ReactSelect/index.js +2 -2
  5. package/dist/elements/ReactSelect/index.js.map +1 -1
  6. package/dist/elements/ReactSelect/types.d.ts +5 -4
  7. package/dist/elements/ReactSelect/types.d.ts.map +1 -1
  8. package/dist/elements/ReactSelect/types.js.map +1 -1
  9. package/dist/elements/WhereBuilder/Condition/Relationship/index.js +4 -3
  10. package/dist/elements/WhereBuilder/Condition/Relationship/index.js.map +1 -1
  11. package/dist/elements/WhereBuilder/Condition/Select/index.d.ts.map +1 -1
  12. package/dist/elements/WhereBuilder/Condition/Select/index.js +61 -53
  13. package/dist/elements/WhereBuilder/Condition/Select/index.js.map +1 -1
  14. package/dist/elements/WhereBuilder/Condition/Select/types.d.ts +2 -1
  15. package/dist/elements/WhereBuilder/Condition/Select/types.d.ts.map +1 -1
  16. package/dist/elements/WhereBuilder/Condition/Select/types.js.map +1 -1
  17. package/dist/elements/WhereBuilder/Condition/index.d.ts.map +1 -1
  18. package/dist/elements/WhereBuilder/Condition/index.js +1 -0
  19. package/dist/elements/WhereBuilder/Condition/index.js.map +1 -1
  20. package/dist/elements/WhereBuilder/reduceFields.d.ts.map +1 -1
  21. package/dist/elements/WhereBuilder/reduceFields.js +29 -1
  22. package/dist/elements/WhereBuilder/reduceFields.js.map +1 -1
  23. package/dist/elements/WhereBuilder/types.d.ts +1 -0
  24. package/dist/elements/WhereBuilder/types.d.ts.map +1 -1
  25. package/dist/elements/WhereBuilder/types.js.map +1 -1
  26. package/dist/exports/client/index.js +23 -23
  27. package/dist/exports/client/index.js.map +3 -3
  28. package/dist/fields/Relationship/index.d.ts +1 -2
  29. package/dist/fields/Relationship/index.d.ts.map +1 -1
  30. package/dist/fields/Relationship/index.js +25 -12
  31. package/dist/fields/Relationship/index.js.map +1 -1
  32. package/dist/fields/Relationship/select-components/MultiValueLabel/index.d.ts.map +1 -1
  33. package/dist/fields/Relationship/select-components/MultiValueLabel/index.js +9 -8
  34. package/dist/fields/Relationship/select-components/MultiValueLabel/index.js.map +1 -1
  35. package/dist/fields/Relationship/select-components/SingleValue/index.d.ts.map +1 -1
  36. package/dist/fields/Relationship/select-components/SingleValue/index.js +9 -8
  37. package/dist/fields/Relationship/select-components/SingleValue/index.js.map +1 -1
  38. package/dist/fields/Select/Input.d.ts +2 -1
  39. package/dist/fields/Select/Input.d.ts.map +1 -1
  40. package/dist/fields/Select/Input.js +39 -36
  41. package/dist/fields/Select/Input.js.map +1 -1
  42. package/dist/fields/Select/index.d.ts.map +1 -1
  43. package/dist/fields/Select/index.js +3 -1
  44. package/dist/fields/Select/index.js.map +1 -1
  45. package/dist/forms/fieldSchemasToFormState/addFieldStatePromise.d.ts.map +1 -1
  46. package/dist/forms/fieldSchemasToFormState/addFieldStatePromise.js +3 -0
  47. package/dist/forms/fieldSchemasToFormState/addFieldStatePromise.js.map +1 -1
  48. package/package.json +4 -4
@@ -10,8 +10,8 @@ function require(m) {
10
10
  }
11
11
  // Workaround end
12
12
 
13
- import{a as Wf,b as H,c as Hf,d as St,e as SD,f as ID,g as zf,h as RD,i as _D}from"./chunk-QPA2ZA5J.js";import{a as pt,b as ol,c as Gf,d as k,e as Li,f as dv,g as mv,h as Fs,i as Cu,j as wD,k as fv,l as DD,m as FD,n as AD}from"./chunk-OA4JPMVI.js";import{c as Sr,d as uv,e as Ds}from"./chunk-5LKBKI4T.js";var Sv=Sr(bt=>{"use strict";function Zf(t,e){var o=t.length;t.push(e);e:for(;0<o;){var n=o-1>>>1,r=t[n];if(0<wu(r,e))t[n]=e,t[o]=r,o=n;else break e}}function Ir(t){return t.length===0?null:t[0]}function Iu(t){if(t.length===0)return null;var e=t[0],o=t.pop();if(o!==e){t[0]=o;e:for(var n=0,r=t.length,s=r>>>1;n<s;){var i=2*(n+1)-1,a=t[i],l=i+1,c=t[l];if(0>wu(a,o))l<r&&0>wu(c,a)?(t[n]=c,t[l]=o,n=l):(t[n]=a,t[i]=o,n=i);else if(l<r&&0>wu(c,o))t[n]=c,t[l]=o,n=l;else break e}}return e}function wu(t,e){var o=t.sortIndex-e.sortIndex;return o!==0?o:t.id-e.id}bt.unstable_now=void 0;typeof performance=="object"&&typeof performance.now=="function"?(pv=performance,bt.unstable_now=function(){return pv.now()}):(Xf=Date,hv=Xf.now(),bt.unstable_now=function(){return Xf.now()-hv});var pv,Xf,hv,Zr=[],Wn=[],TD=1,ar=null,yo=3,Ru=!1,As=!1,nl=!1,vv=typeof setTimeout=="function"?setTimeout:null,xv=typeof clearTimeout=="function"?clearTimeout:null,gv=typeof setImmediate<"u"?setImmediate:null;function Su(t){for(var e=Ir(Wn);e!==null;){if(e.callback===null)Iu(Wn);else if(e.startTime<=t)Iu(Wn),e.sortIndex=e.expirationTime,Zf(Zr,e);else break;e=Ir(Wn)}}function Jf(t){if(nl=!1,Su(t),!As)if(Ir(Zr)!==null)As=!0,qf();else{var e=Ir(Wn);e!==null&&Qf(Jf,e.startTime-t)}}var _u=!1,sl=-1,yv=5,Cv=-1;function wv(){return!(bt.unstable_now()-Cv<yv)}function Uf(){if(_u){var t=bt.unstable_now();Cv=t;var e=!0;try{e:{As=!1,nl&&(nl=!1,xv(sl),sl=-1),Ru=!0;var o=yo;try{t:{for(Su(t),ar=Ir(Zr);ar!==null&&!(ar.expirationTime>t&&wv());){var n=ar.callback;if(typeof n=="function"){ar.callback=null,yo=ar.priorityLevel;var r=n(ar.expirationTime<=t);if(t=bt.unstable_now(),typeof r=="function"){ar.callback=r,Su(t),e=!0;break t}ar===Ir(Zr)&&Iu(Zr),Su(t)}else Iu(Zr);ar=Ir(Zr)}if(ar!==null)e=!0;else{var s=Ir(Wn);s!==null&&Qf(Jf,s.startTime-t),e=!1}}break e}finally{ar=null,yo=o,Ru=!1}e=void 0}}finally{e?rl():_u=!1}}}var rl;typeof gv=="function"?rl=function(){gv(Uf)}:typeof MessageChannel<"u"?(Yf=new MessageChannel,bv=Yf.port2,Yf.port1.onmessage=Uf,rl=function(){bv.postMessage(null)}):rl=function(){vv(Uf,0)};var Yf,bv;function qf(){_u||(_u=!0,rl())}function Qf(t,e){sl=vv(function(){t(bt.unstable_now())},e)}bt.unstable_IdlePriority=5;bt.unstable_ImmediatePriority=1;bt.unstable_LowPriority=4;bt.unstable_NormalPriority=3;bt.unstable_Profiling=null;bt.unstable_UserBlockingPriority=2;bt.unstable_cancelCallback=function(t){t.callback=null};bt.unstable_continueExecution=function(){As||Ru||(As=!0,qf())};bt.unstable_forceFrameRate=function(t){0>t||125<t?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):yv=0<t?Math.floor(1e3/t):5};bt.unstable_getCurrentPriorityLevel=function(){return yo};bt.unstable_getFirstCallbackNode=function(){return Ir(Zr)};bt.unstable_next=function(t){switch(yo){case 1:case 2:case 3:var e=3;break;default:e=yo}var o=yo;yo=e;try{return t()}finally{yo=o}};bt.unstable_pauseExecution=function(){};bt.unstable_requestPaint=function(){};bt.unstable_runWithPriority=function(t,e){switch(t){case 1:case 2:case 3:case 4:case 5:break;default:t=3}var o=yo;yo=t;try{return e()}finally{yo=o}};bt.unstable_scheduleCallback=function(t,e,o){var n=bt.unstable_now();switch(typeof o=="object"&&o!==null?(o=o.delay,o=typeof o=="number"&&0<o?n+o:n):o=n,t){case 1:var r=-1;break;case 2:r=250;break;case 5:r=1073741823;break;case 4:r=1e4;break;default:r=5e3}return r=o+r,t={id:TD++,callback:e,priorityLevel:t,startTime:o,expirationTime:r,sortIndex:-1},o>n?(t.sortIndex=o,Zf(Wn,t),Ir(Zr)===null&&t===Ir(Wn)&&(nl?(xv(sl),sl=-1):nl=!0,Qf(Jf,o-n))):(t.sortIndex=r,Zf(Zr,t),As||Ru||(As=!0,qf())),t};bt.unstable_shouldYield=wv;bt.unstable_wrapCallback=function(t){var e=yo;return function(){var o=yo;yo=e;try{return t.apply(this,arguments)}finally{yo=o}}}});var Rv=Sr((ZW,Iv)=>{"use strict";Iv.exports=Sv()});var yC=Sr(dt=>{"use strict";var lo=typeof Symbol=="function"&&Symbol.for,Ah=lo?Symbol.for("react.element"):60103,Th=lo?Symbol.for("react.portal"):60106,jd=lo?Symbol.for("react.fragment"):60107,Od=lo?Symbol.for("react.strict_mode"):60108,Md=lo?Symbol.for("react.profiler"):60114,Bd=lo?Symbol.for("react.provider"):60109,Vd=lo?Symbol.for("react.context"):60110,Eh=lo?Symbol.for("react.async_mode"):60111,Gd=lo?Symbol.for("react.concurrent_mode"):60111,Wd=lo?Symbol.for("react.forward_ref"):60112,Hd=lo?Symbol.for("react.suspense"):60113,d6=lo?Symbol.for("react.suspense_list"):60120,zd=lo?Symbol.for("react.memo"):60115,Xd=lo?Symbol.for("react.lazy"):60116,m6=lo?Symbol.for("react.block"):60121,f6=lo?Symbol.for("react.fundamental"):60117,p6=lo?Symbol.for("react.responder"):60118,h6=lo?Symbol.for("react.scope"):60119;function er(t){if(typeof t=="object"&&t!==null){var e=t.$$typeof;switch(e){case Ah:switch(t=t.type,t){case Eh:case Gd:case jd:case Md:case Od:case Hd:return t;default:switch(t=t&&t.$$typeof,t){case Vd:case Wd:case Xd:case zd:case Bd:return t;default:return e}}case Th:return e}}}function xC(t){return er(t)===Gd}dt.AsyncMode=Eh;dt.ConcurrentMode=Gd;dt.ContextConsumer=Vd;dt.ContextProvider=Bd;dt.Element=Ah;dt.ForwardRef=Wd;dt.Fragment=jd;dt.Lazy=Xd;dt.Memo=zd;dt.Portal=Th;dt.Profiler=Md;dt.StrictMode=Od;dt.Suspense=Hd;dt.isAsyncMode=function(t){return xC(t)||er(t)===Eh};dt.isConcurrentMode=xC;dt.isContextConsumer=function(t){return er(t)===Vd};dt.isContextProvider=function(t){return er(t)===Bd};dt.isElement=function(t){return typeof t=="object"&&t!==null&&t.$$typeof===Ah};dt.isForwardRef=function(t){return er(t)===Wd};dt.isFragment=function(t){return er(t)===jd};dt.isLazy=function(t){return er(t)===Xd};dt.isMemo=function(t){return er(t)===zd};dt.isPortal=function(t){return er(t)===Th};dt.isProfiler=function(t){return er(t)===Md};dt.isStrictMode=function(t){return er(t)===Od};dt.isSuspense=function(t){return er(t)===Hd};dt.isValidElementType=function(t){return typeof t=="string"||typeof t=="function"||t===jd||t===Gd||t===Md||t===Od||t===Hd||t===d6||typeof t=="object"&&t!==null&&(t.$$typeof===Xd||t.$$typeof===zd||t.$$typeof===Bd||t.$$typeof===Vd||t.$$typeof===Wd||t.$$typeof===f6||t.$$typeof===p6||t.$$typeof===h6||t.$$typeof===m6)};dt.typeOf=er});var wC=Sr((Mse,CC)=>{"use strict";CC.exports=yC()});var AC=Sr((Bse,FC)=>{"use strict";var Ph=wC(),g6={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},b6={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},v6={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},_C={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},Nh={};Nh[Ph.ForwardRef]=v6;Nh[Ph.Memo]=_C;function SC(t){return Ph.isMemo(t)?_C:Nh[t.$$typeof]||g6}var x6=Object.defineProperty,y6=Object.getOwnPropertyNames,IC=Object.getOwnPropertySymbols,C6=Object.getOwnPropertyDescriptor,w6=Object.getPrototypeOf,RC=Object.prototype;function DC(t,e,o){if(typeof e!="string"){if(RC){var n=w6(e);n&&n!==RC&&DC(t,n,o)}var r=y6(e);IC&&(r=r.concat(IC(e)));for(var s=SC(t),i=SC(e),a=0;a<r.length;++a){var l=r[a];if(!b6[l]&&!(o&&o[l])&&!(i&&i[l])&&!(s&&s[l])){var c=C6(e,l);try{x6(t,l,c)}catch{}}}}return t}FC.exports=DC});var fg=Sr((wue,W2)=>{var mg=Math.floor(Math.random()*16777215),O2=ht.index=parseInt(Math.random()*16777215,10),M2=(typeof process>"u"||typeof process.pid!="number"?Math.floor(Math.random()*1e5):process.pid)%65535,B2=(()=>{try{return _Buffer}catch{try{return Buffer}catch{return null}}})(),lm=function(t){return!!(t!=null&&t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t))},G2=[];for(Go=0;Go<256;Go++)G2[Go]=(Go<=15?"0":"")+Go.toString(16);var Go,V2=new RegExp("^[0-9a-fA-F]{24}$"),rc=[];Go=0;for(;Go<10;)rc[48+Go]=Go++;for(;Go<16;)rc[55+Go]=rc[87+Go]=Go++;function ht(t){if(!(this instanceof ht))return new ht(t);if(t&&(t instanceof ht||t._bsontype==="ObjectID"))return t;if(this._bsontype="ObjectID",t==null||typeof t=="number"){this.id=this.generate(t);return}var e=ht.isValid(t);if(!e&&t!=null)throw new Error("Argument passed in must be a single String of 12 bytes or a string of 24 hex characters");if(e&&typeof t=="string"&&t.length===24)return ht.createFromHexString(t);if(t!=null&&t.length===12)this.id=t;else{if(t!=null&&typeof t.toHexString=="function")return t;throw new Error("Argument passed in must be a single String of 12 bytes or a string of 24 hex characters")}}W2.exports=ht;ht.default=ht;ht.createFromTime=function(t){return t=parseInt(t,10)%4294967295,new ht(g9(8,t)+"0000000000000000")};ht.createFromHexString=function(t){if(typeof t>"u"||t!=null&&t.length!==24)throw new Error("Argument passed in must be a single String of 12 bytes or a string of 24 hex characters");for(var e="",o=0;o<24;)e+=String.fromCharCode(rc[t.charCodeAt(o++)]<<4|rc[t.charCodeAt(o++)]);return new ht(e)};ht.isValid=function(t){return t==null?!1:typeof t=="number"?!0:typeof t=="string"?t.length===12||t.length===24&&V2.test(t):t instanceof ht?!0:lm(t)?ht.isValid(t.toString("hex")):typeof t.toHexString=="function"&&B2&&(t.id instanceof B2||typeof t.id=="string")?t.id.length===12||t.id.length===24&&V2.test(t.id):!1};ht.prototype={constructor:ht,toHexString:function(){if(!this.id||!this.id.length)throw new Error("invalid ObjectId, ObjectId.id must be either a string or a Buffer, but is ["+JSON.stringify(this.id)+"]");if(this.id.length===24)return this.id;if(lm(this.id))return this.id.toString("hex");for(var t="",e=0;e<this.id.length;e++)t+=G2[this.id.charCodeAt(e)];return t},equals:function(t){return t instanceof ht?this.toString()===t.toString():typeof t=="string"&&ht.isValid(t)&&t.length===12&&lm(this.id)?t===this.id.toString("binary"):typeof t=="string"&&ht.isValid(t)&&t.length===24?t.toLowerCase()===this.toHexString():typeof t=="string"&&ht.isValid(t)&&t.length===12?t===this.id:t!=null&&(t instanceof ht||t.toHexString)?t.toHexString()===this.toHexString():!1},getTimestamp:function(){var t=new Date,e;return lm(this.id)?e=this.id[3]|this.id[2]<<8|this.id[1]<<16|this.id[0]<<24:e=this.id.charCodeAt(3)|this.id.charCodeAt(2)<<8|this.id.charCodeAt(1)<<16|this.id.charCodeAt(0)<<24,t.setTime(Math.floor(e)*1e3),t},generate:function(t){typeof t!="number"&&(t=~~(Date.now()/1e3)),t=parseInt(t,10)%4294967295;var e=h9();return String.fromCharCode(t>>24&255,t>>16&255,t>>8&255,t&255,mg>>16&255,mg>>8&255,mg&255,M2>>8&255,M2&255,e>>16&255,e>>8&255,e&255)}};function h9(){return O2=(O2+1)%16777215}function g9(t,e){return e=e.toString(16),e.length===t?e:"00000000".substring(e.length,t)+e}var b9=Symbol&&Symbol.for&&Symbol.for("nodejs.util.inspect.custom")||"inspect";ht.prototype[b9]=function(){return"ObjectID("+this+")"};ht.prototype.toJSON=ht.prototype.toHexString;ht.prototype.toString=ht.prototype.toHexString});var eb=Sr((kve,yS)=>{function Kg(t){return t===void 0}function pk(t){return t===null}function hk(t){return typeof t=="boolean"}function Pm(t){return t===Object(t)}function vS(t){return Array.isArray(t)}function gk(t){return t instanceof Date}function xS(t,e){return e?Pm(t)&&!Kg(t.uri):Pm(t)&&typeof t.size=="number"&&typeof t.type=="string"&&typeof t.slice=="function"}function bk(t,e){return xS(t,e)&&typeof t.name=="string"&&(Pm(t.lastModifiedDate)||typeof t.lastModified=="number")}function ci(t){return Kg(t)?!1:t}function Qg(t,e,o,n){e=e||{},o=o||new FormData,e.indices=ci(e.indices),e.nullsAsUndefineds=ci(e.nullsAsUndefineds),e.booleansAsIntegers=ci(e.booleansAsIntegers),e.allowEmptyArrays=ci(e.allowEmptyArrays),e.noAttributesWithArrayNotation=ci(e.noAttributesWithArrayNotation),e.noFilesWithArrayNotation=ci(e.noFilesWithArrayNotation),e.dotsForObjectNotation=ci(e.dotsForObjectNotation);let r=typeof o.getParts=="function";return Kg(t)||(pk(t)?e.nullsAsUndefineds||o.append(n,""):hk(t)?e.booleansAsIntegers?o.append(n,t?1:0):o.append(n,t):vS(t)?t.length?t.forEach((s,i)=>{let a=n+"["+(e.indices?i:"")+"]";(e.noAttributesWithArrayNotation||e.noFilesWithArrayNotation&&bk(s,r))&&(a=n),Qg(s,e,o,a)}):e.allowEmptyArrays&&o.append(e.noAttributesWithArrayNotation?n:n+"[]",""):gk(t)?o.append(n,t.toISOString()):Pm(t)&&!xS(t,r)?Object.keys(t).forEach(s=>{let i=t[s];if(vS(i))for(;s.length>2&&s.lastIndexOf("[]")===s.length-2;)s=s.substring(0,s.length-2);let a=n?e.dotsForObjectNotation?n+"."+s:n+"["+s+"]":s;Qg(i,e,o,a)}):o.append(n,t)),o}yS.exports={serialize:Qg}});var y4=Sr((BFe,x4)=>{(function(){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e={rotl:function(o,n){return o<<n|o>>>32-n},rotr:function(o,n){return o<<32-n|o>>>n},endian:function(o){if(o.constructor==Number)return e.rotl(o,8)&16711935|e.rotl(o,24)&4278255360;for(var n=0;n<o.length;n++)o[n]=e.endian(o[n]);return o},randomBytes:function(o){for(var n=[];o>0;o--)n.push(Math.floor(Math.random()*256));return n},bytesToWords:function(o){for(var n=[],r=0,s=0;r<o.length;r++,s+=8)n[s>>>5]|=o[r]<<24-s%32;return n},wordsToBytes:function(o){for(var n=[],r=0;r<o.length*32;r+=8)n.push(o[r>>>5]>>>24-r%32&255);return n},bytesToHex:function(o){for(var n=[],r=0;r<o.length;r++)n.push((o[r]>>>4).toString(16)),n.push((o[r]&15).toString(16));return n.join("")},hexToBytes:function(o){for(var n=[],r=0;r<o.length;r+=2)n.push(parseInt(o.substr(r,2),16));return n},bytesToBase64:function(o){for(var n=[],r=0;r<o.length;r+=3)for(var s=o[r]<<16|o[r+1]<<8|o[r+2],i=0;i<4;i++)r*8+i*6<=o.length*8?n.push(t.charAt(s>>>6*(3-i)&63)):n.push("=");return n.join("")},base64ToBytes:function(o){o=o.replace(/[^A-Z0-9+\/]/ig,"");for(var n=[],r=0,s=0;r<o.length;s=++r%4)s!=0&&n.push((t.indexOf(o.charAt(r-1))&Math.pow(2,-2*s+8)-1)<<s*2|t.indexOf(o.charAt(r))>>>6-s*2);return n}};x4.exports=e})()});var Wb=Sr((VFe,C4)=>{var Gb={utf8:{stringToBytes:function(t){return Gb.bin.stringToBytes(unescape(encodeURIComponent(t)))},bytesToString:function(t){return decodeURIComponent(escape(Gb.bin.bytesToString(t)))}},bin:{stringToBytes:function(t){for(var e=[],o=0;o<t.length;o++)e.push(t.charCodeAt(o)&255);return e},bytesToString:function(t){for(var e=[],o=0;o<t.length;o++)e.push(String.fromCharCode(t[o]));return e.join("")}}};C4.exports=Gb});var I4=Sr((GFe,S4)=>{S4.exports=function(t){return t!=null&&(w4(t)||FB(t)||!!t._isBuffer)};function w4(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function FB(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&w4(t.slice(0,0))}});var _4=Sr((WFe,R4)=>{(function(){var t=y4(),e=Wb().utf8,o=I4(),n=Wb().bin,r=function(s,i){s.constructor==String?i&&i.encoding==="binary"?s=n.stringToBytes(s):s=e.stringToBytes(s):o(s)?s=Array.prototype.slice.call(s,0):!Array.isArray(s)&&s.constructor!==Uint8Array&&(s=s.toString());for(var a=t.bytesToWords(s),l=s.length*8,c=1732584193,u=-271733879,d=-1732584194,f=271733878,m=0;m<a.length;m++)a[m]=(a[m]<<8|a[m]>>>24)&16711935|(a[m]<<24|a[m]>>>8)&4278255360;a[l>>>5]|=128<<l%32,a[(l+64>>>9<<4)+14]=l;for(var h=r._ff,p=r._gg,g=r._hh,b=r._ii,m=0;m<a.length;m+=16){var v=c,x=u,y=d,C=f;c=h(c,u,d,f,a[m+0],7,-680876936),f=h(f,c,u,d,a[m+1],12,-389564586),d=h(d,f,c,u,a[m+2],17,606105819),u=h(u,d,f,c,a[m+3],22,-1044525330),c=h(c,u,d,f,a[m+4],7,-176418897),f=h(f,c,u,d,a[m+5],12,1200080426),d=h(d,f,c,u,a[m+6],17,-1473231341),u=h(u,d,f,c,a[m+7],22,-45705983),c=h(c,u,d,f,a[m+8],7,1770035416),f=h(f,c,u,d,a[m+9],12,-1958414417),d=h(d,f,c,u,a[m+10],17,-42063),u=h(u,d,f,c,a[m+11],22,-1990404162),c=h(c,u,d,f,a[m+12],7,1804603682),f=h(f,c,u,d,a[m+13],12,-40341101),d=h(d,f,c,u,a[m+14],17,-1502002290),u=h(u,d,f,c,a[m+15],22,1236535329),c=p(c,u,d,f,a[m+1],5,-165796510),f=p(f,c,u,d,a[m+6],9,-1069501632),d=p(d,f,c,u,a[m+11],14,643717713),u=p(u,d,f,c,a[m+0],20,-373897302),c=p(c,u,d,f,a[m+5],5,-701558691),f=p(f,c,u,d,a[m+10],9,38016083),d=p(d,f,c,u,a[m+15],14,-660478335),u=p(u,d,f,c,a[m+4],20,-405537848),c=p(c,u,d,f,a[m+9],5,568446438),f=p(f,c,u,d,a[m+14],9,-1019803690),d=p(d,f,c,u,a[m+3],14,-187363961),u=p(u,d,f,c,a[m+8],20,1163531501),c=p(c,u,d,f,a[m+13],5,-1444681467),f=p(f,c,u,d,a[m+2],9,-51403784),d=p(d,f,c,u,a[m+7],14,1735328473),u=p(u,d,f,c,a[m+12],20,-1926607734),c=g(c,u,d,f,a[m+5],4,-378558),f=g(f,c,u,d,a[m+8],11,-2022574463),d=g(d,f,c,u,a[m+11],16,1839030562),u=g(u,d,f,c,a[m+14],23,-35309556),c=g(c,u,d,f,a[m+1],4,-1530992060),f=g(f,c,u,d,a[m+4],11,1272893353),d=g(d,f,c,u,a[m+7],16,-155497632),u=g(u,d,f,c,a[m+10],23,-1094730640),c=g(c,u,d,f,a[m+13],4,681279174),f=g(f,c,u,d,a[m+0],11,-358537222),d=g(d,f,c,u,a[m+3],16,-722521979),u=g(u,d,f,c,a[m+6],23,76029189),c=g(c,u,d,f,a[m+9],4,-640364487),f=g(f,c,u,d,a[m+12],11,-421815835),d=g(d,f,c,u,a[m+15],16,530742520),u=g(u,d,f,c,a[m+2],23,-995338651),c=b(c,u,d,f,a[m+0],6,-198630844),f=b(f,c,u,d,a[m+7],10,1126891415),d=b(d,f,c,u,a[m+14],15,-1416354905),u=b(u,d,f,c,a[m+5],21,-57434055),c=b(c,u,d,f,a[m+12],6,1700485571),f=b(f,c,u,d,a[m+3],10,-1894986606),d=b(d,f,c,u,a[m+10],15,-1051523),u=b(u,d,f,c,a[m+1],21,-2054922799),c=b(c,u,d,f,a[m+8],6,1873313359),f=b(f,c,u,d,a[m+15],10,-30611744),d=b(d,f,c,u,a[m+6],15,-1560198380),u=b(u,d,f,c,a[m+13],21,1309151649),c=b(c,u,d,f,a[m+4],6,-145523070),f=b(f,c,u,d,a[m+11],10,-1120210379),d=b(d,f,c,u,a[m+2],15,718787259),u=b(u,d,f,c,a[m+9],21,-343485551),c=c+v>>>0,u=u+x>>>0,d=d+y>>>0,f=f+C>>>0}return t.endian([c,u,d,f])};r._ff=function(s,i,a,l,c,u,d){var f=s+(i&a|~i&l)+(c>>>0)+d;return(f<<u|f>>>32-u)+i},r._gg=function(s,i,a,l,c,u,d){var f=s+(i&l|a&~l)+(c>>>0)+d;return(f<<u|f>>>32-u)+i},r._hh=function(s,i,a,l,c,u,d){var f=s+(i^a^l)+(c>>>0)+d;return(f<<u|f>>>32-u)+i},r._ii=function(s,i,a,l,c,u,d){var f=s+(a^(i|~l))+(c>>>0)+d;return(f<<u|f>>>32-u)+i},r._blocksize=16,r._digestsize=16,R4.exports=function(s,i){if(s==null)throw new Error("Illegal argument "+s);var a=t.wordsToBytes(r(s,i));return i&&i.asBytes?a:i&&i.asString?n.bytesToString(a):t.bytesToHex(a)}})()});import{jsx as sp}from"react/jsx-runtime";import"react";function oe({CustomComponent:t,Fallback:e}){return t!==void 0?t:e}import{jsx as WD}from"react/jsx-runtime";import Av from"react";import{createContext as Hn,use as zn}from"react";var il=Ds(Rv(),1);import{createElement as ED,createContext as PD,useContext as ND,useEffect as LD,useLayoutEffect as $D,useReducer as kD,useRef as Kf,useState as jD}from"react";var Du=Symbol(),OD=Symbol(),MD=typeof window>"u"||/ServerSideRendering/.test(window.navigator&&window.navigator.userAgent),_v=MD?LD:$D,BD=il.unstable_runWithPriority?t=>{try{(0,il.unstable_runWithPriority)(il.unstable_NormalPriority,t)}catch(e){if(e.message==="Not implemented.")t();else throw e}}:t=>t(),VD=t=>({value:o,children:n})=>{let r=Kf(o),s=Kf(0),[i,a]=jD(null);i&&(i(o),a(null));let l=Kf();if(!l.current){let c=new Set,u=(d,f)=>{s.current+=1;let m={n:s.current};f?.suspense&&(m.n*=-1,m.p=new Promise(h=>{a(()=>p=>{m.v=p,delete m.p,h(p)})})),c.forEach(h=>h(m)),d()};l.current={[Du]:{v:r,n:s,l:c,u}}}return _v(()=>{r.current=o,s.current+=1,BD(()=>{l.current[Du].l.forEach(c=>{c({n:s.current,v:o})})})},[o]),ED(t,{value:l.current},n)},GD=t=>t;function Dv(t){let e=PD({[Du]:{v:{current:t},n:{current:-1},l:new Set,u:o=>o()}});return e[OD]=e.Provider,e.Provider=VD(e.Provider),delete e.Consumer,e}function ep(t,e){let o=ND(t)[Du],{v:{current:n},n:{current:r},l:s}=o,i=e(n),[a,l]=kD((c,u)=>{if(!u)return[n,i];if("p"in u)throw u.p;if(u.n===r)return Object.is(c[1],i)?c:[n,i];try{if("v"in u){if(Object.is(c[0],u.v))return c;let d=e(u.v);return Object.is(c[1],d)?c:[u.v,d]}}catch{}return[...c]},[n,i]);return Object.is(a[1],i)||l(),_v(()=>(s.add(l),()=>{s.delete(l)}),[s]),a[1]}function Fv(t){return ep(t,GD)}var Fu=Hn({}),Au=Hn({}),Tu=Hn({}),Eu=Hn(!1),Pu=Hn(!1),tp=Hn(!1),Nu=Hn(!1),op=Hn(!1),al=Dv([{},()=>null]),Oe=()=>zn(Fu),$i=()=>zn(Au),Lu=()=>zn(Tu),Xt=()=>zn(Eu),lr=()=>zn(Pu),rp=()=>zn(tp),Ut=()=>zn(Nu),Ts=()=>zn(op),Et=t=>ep(al,t),ki=()=>Fv(al);var Tv=Av.createContext({data:{},path:"",rowNumber:void 0}),np=({children:t,path:e,rowNumber:o})=>{"use no memo";let{getDataByPath:n,getSiblingData:r}=Lu(),s=r(e),a=n(e)||s;return WD(Tv,{value:{data:a,path:e,rowNumber:o},children:t})},HD=()=>Av.use(Tv);var zD="row-label",dn=t=>{let{className:e,CustomComponent:o,label:n,path:r,rowNumber:s}=t;return sp(np,{path:r,rowNumber:s,children:sp(oe,{CustomComponent:o,Fallback:typeof n=="string"?sp("span",{className:[zD,e].filter(Boolean).join(" "),style:{pointerEvents:"none"},children:n}):n})})};import{c as iM}from"react/compiler-runtime";import{jsx as uo,jsxs as vi}from"react/jsx-runtime";import{getTranslation as Fb}from"@payloadcms/translations";import aM from"react";import{jsx as lp,jsxs as rF}from"react/jsx-runtime";import kv from"react";import{jsx as KD}from"react/jsx-runtime";import $v from"next/link.js";import{useRouter as eF}from"next/navigation.js";import"react";import{c as XD}from"react/compiler-runtime";import{jsx as UD}from"react/jsx-runtime";import ip,{startTransition as YD,useEffect as ZD,useOptimistic as JD,useRef as Ev}from"react";var ap=t=>{let e=XD(11),{children:o}=t,[n,r]=JD(!1),[s,i]=ip.useState(0),a=Ev(s),l=Ev(null),c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=()=>{l.current=setInterval(()=>{let g=a.current+(.93-a.current)*Math.random()*.2*Math.pow(Math.log(1+(1-a.current)*.75),.75);i(g),a.current=g},250)},e[0]=c):c=e[0];let u=c,d,f;e[1]!==n?(d=()=>{i(0),a.current=0,n?u():l.current&&clearInterval(l.current)},f=[n,u],e[1]=n,e[2]=d,e[3]=f):(d=e[2],f=e[3]),ZD(d,f);let m;e[4]!==r?(m=g=>{YD(()=>{r(!0),typeof g=="function"&&g()})},e[4]=r,e[5]=m):m=e[5];let h=m,p;return e[6]!==o||e[7]!==n||e[8]!==h||e[9]!==s?(p=UD(Pv,{value:{isTransitioning:n,startRouteTransition:h,transitionProgress:s},children:o}),e[6]=o,e[7]=n,e[8]=h,e[9]=s,e[10]=p):p=e[10],p},Pv=ip.createContext({isTransitioning:!1,startRouteTransition:()=>{},transitionProgress:0}),st=()=>ip.use(Pv);var qD=/https?|ftp|gopher|file/;function Nv(t){return typeof t=="string"||typeof t=="number"&&!isNaN(t)||typeof t=="boolean"?String(t):""}function QD(t){let e=new URLSearchParams;return Object.entries(t).forEach(([o,n])=>{Array.isArray(n)?n.forEach(r=>e.append(o,Nv(r))):e.set(o,Nv(n))}),e}function Lv(t){let{auth:e}=t,{hostname:o}=t,n=t.protocol||"",r=t.pathname||"",s=t.hash||"",i=t.query||"",a=!1;e=e?encodeURIComponent(e).replace(/%3A/i,":")+"@":"",t.host?a=e+t.host:o&&(a=e+(~o.indexOf(":")?`[${o}]`:o),t.port&&(a+=":"+t.port)),i&&typeof i=="object"&&(i=String(QD(i)));let l=t.search||i&&`?${i}`||"";return n&&!n.endsWith(":")&&(n+=":"),t.slashes||(!n||qD.test(n))&&a!==!1?(a="//"+(a||""),r&&r[0]!=="/"&&(r="/"+r)):a||(a=""),s&&s[0]!=="#"&&(s="#"+s),l&&l[0]!=="?"&&(l="?"+l),r=r.replace(/[?#]/g,encodeURIComponent),l=l.replace("#","%23"),`${n}${a}${r}${l}${s}`}var tF=$v.default||$v;function oF(t){let o=t.currentTarget.getAttribute("target");return o&&o!=="_self"||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.nativeEvent&&t.nativeEvent.which===2}var no=({children:t,href:e,onClick:o,preventDefault:n=!0,ref:r,replace:s,scroll:i,...a})=>{let l=eF(),{startRouteTransition:c}=st();return KD(tF,{href:e,onClick:u=>{oF(u)||(o&&o(u),n&&u.preventDefault(),c(()=>{let d=typeof e=="string"?e:Lv(e);s?l.replace(d,{scroll:i}):l.push(d,{scroll:i})}))},ref:r,...a,children:t})};var Es="banner",Rr=({type:t="default",alignIcon:e="right",children:o,className:n,icon:r,onClick:s,to:i})=>{let a=[Es,`${Es}--type-${t}`,n&&n,i&&`${Es}--has-link`,(i||s)&&`${Es}--has-action`,r&&`${Es}--has-icon`,r&&`${Es}--align-icon-${e}`].filter(Boolean).join(" "),l="div";return s&&!i&&(l="button"),i&&(l=no),rF(l,{className:a,href:i||null,onClick:s,children:[r&&e==="left"&&lp(kv.Fragment,{children:r}),lp("span",{className:`${Es}__content`,children:o}),r&&e==="right"&&lp(kv.Fragment,{children:r})]})};import{jsx as Uo,jsxs as Bu}from"react/jsx-runtime";import wF,{Fragment as SF,isValidElement as IF}from"react";import{jsx as jv}from"react/jsx-runtime";import"react";var Ze=({ariaLabel:t,className:e,direction:o,size:n})=>jv("svg",{"aria-label":t,className:["icon icon--chevron",e,n&&`icon--size-${n}`].filter(Boolean).join(" "),height:"100%",style:{transform:o==="left"?"rotate(90deg)":o==="right"?"rotate(-90deg)":o==="up"?"rotate(180deg)":void 0},viewBox:"0 0 20 20",width:"100%",xmlns:"http://www.w3.org/2000/svg",children:jv("path",{className:"stroke",d:"M14 8L10 12L6 8",strokeLinecap:"square"})});import{jsx as Ov}from"react/jsx-runtime";import"react";var _r=({className:t})=>Ov("svg",{className:[t,"icon icon--edit"].filter(Boolean).join(" "),viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:Ov("path",{className:"stroke",d:"M9.68531 4.62938H5.2634C4.92833 4.62938 4.60698 4.76248 4.37004 4.99942C4.13311 5.23635 4 5.5577 4 5.89278V14.7366C4 15.0717 4.13311 15.393 4.37004 15.63C4.60698 15.8669 4.92833 16 5.2634 16H14.1072C14.4423 16 14.7636 15.8669 15.0006 15.63C15.2375 15.393 15.3706 15.0717 15.3706 14.7366V10.3147M13.7124 4.39249C13.9637 4.14118 14.3046 4 14.66 4C15.0154 4 15.3562 4.14118 15.6075 4.39249C15.8588 4.6438 16 4.98464 16 5.34004C16 5.69544 15.8588 6.03629 15.6075 6.28759L9.91399 11.9817C9.76399 12.1316 9.57868 12.2413 9.37515 12.3008L7.56027 12.8314C7.50591 12.8472 7.44829 12.8482 7.39344 12.8341C7.33859 12.8201 7.28853 12.7915 7.24849 12.7515C7.20845 12.7115 7.17991 12.6614 7.16586 12.6066C7.15181 12.5517 7.15276 12.4941 7.16861 12.4397L7.69924 10.6249C7.75896 10.4215 7.86888 10.2364 8.01888 10.0866L13.7124 4.39249Z",strokeLinecap:"square"})});import{jsx as Mv}from"react/jsx-runtime";import"react";var cp=()=>Mv("svg",{"aria-hidden":"true",className:"graphic link icon icon--link",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:Mv("path",{className:"stroke",d:"M7.99999 13.3333H6.66666C5.78261 13.3333 4.93476 12.9821 4.30964 12.357C3.68452 11.7319 3.33333 10.884 3.33333 9.99999C3.33333 9.11593 3.68452 8.26809 4.30964 7.64297C4.93476 7.01785 5.78261 6.66666 6.66666 6.66666H7.99999M12 6.66666H13.3333C14.2174 6.66666 15.0652 7.01785 15.6904 7.64297C16.3155 8.26809 16.6667 9.11593 16.6667 9.99999C16.6667 10.884 16.3155 11.7319 15.6904 12.357C15.0652 12.9821 14.2174 13.3333 13.3333 13.3333H12M7.33333 9.99999H12.6667",strokeLinecap:"square"})});import{jsx as Bv}from"react/jsx-runtime";import"react";var jo=()=>Bv("svg",{className:"icon icon--plus",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:Bv("path",{className:"stroke",d:"M5.33333 9.99998H14.6667M9.99999 5.33331V14.6666",strokeLinecap:"square"})});import{jsx as Vv}from"react/jsx-runtime";import"react";var up=()=>Vv("svg",{className:"icon icon--swap",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:Vv("path",{className:"stroke",d:"M7.33334 4L4.66667 6.66667M4.66667 6.66667L7.33334 9.33333M4.66667 6.66667H15.3333M12.6667 16L15.3333 13.3333M15.3333 13.3333L12.6667 10.6667M15.3333 13.3333H4.66667",strokeLinecap:"square"})});import{jsx as Ps,jsxs as pp}from"react/jsx-runtime";var Me={};uv(Me,{Button:()=>mp,ButtonGroup:()=>dp,Divider:()=>Gv,GroupLabel:()=>$u});import{jsx as ku}from"react/jsx-runtime";import"react";import{jsx as nF}from"react/jsx-runtime";import"react";var sF="popup-divider",Gv=()=>nF("hr",{className:sF});import{jsx as iF}from"react/jsx-runtime";import"react";var aF="popup-list-group-label",$u=({label:t})=>iF("p",{className:aF,children:t});var ll="popup-button-list",dp=({buttonSize:t="default",children:e,className:o,textAlign:n="left"})=>{let r=[ll,o,`${ll}__text-align--${n}`,`${ll}__button-size--${t}`].filter(Boolean).join(" ");return ku("div",{className:r,children:e})},mp=({id:t,active:e,children:o,className:n,disabled:r,href:s,onClick:i})=>{let a=[`${ll}__button`,e&&`${ll}__button--selected`,n].filter(Boolean).join(" ");if(!r){if(s)return ku(no,{className:a,href:s,id:t,onClick:l=>{i&&i(l)},prefetch:!1,children:o});if(i)return ku("button",{className:a,id:t,onClick:l=>{i&&i(l)},type:"button",children:o})}return ku("div",{className:a,id:t,children:o})};var Xn={};uv(Xn,{WindowInfo:()=>zv,WindowInfoContext:()=>ji,WindowInfoProvider:()=>Yv,useWindowInfo:()=>Co,withWindowInfo:()=>Zv});import{useContext as cF}from"react";import{createContext as lF}from"react";var ji=lF({});var Co=()=>cF(ji);import Wv,{Fragment as Hv}from"react";var zv=t=>{let{children:e}=t,o=Co();return e?typeof e=="function"?Wv.createElement(Hv,null,e(o)):Wv.createElement(Hv,null,e):null};import uF,{useCallback as Xv,useEffect as Uv,useReducer as dF,useRef as mF}from"react";var fF=(t,e)=>{let{payload:{breakpoints:o,animationRef:n}}=e;n.current=null;let{eventsFired:r}=t,{documentElement:{style:s,clientWidth:i,clientHeight:a}}=document,{innerWidth:l,innerHeight:c}=window,u=`${i/100}px`,d=`${a/100}px`,f=o?Object.keys(o).reduce((h,p)=>Object.assign(Object.assign({},h),{[p]:window.matchMedia(o[p]).matches}),{}):{},m={width:l,height:c,"--vw":u,"--vh":d,breakpoints:f,eventsFired:r+1};return s.setProperty("--vw",u),s.setProperty("--vh",d),m},Yv=t=>{let{breakpoints:e,children:o}=t,n=mF(null),[r,s]=dF(fF,{width:void 0,height:void 0,"--vw":"","--vh":"",breakpoints:{},eventsFired:0}),i=Xv(()=>{n.current&&cancelAnimationFrame(n.current),n.current=requestAnimationFrame(()=>s({type:"UPDATE",payload:{breakpoints:e,animationRef:n}}))},[e]),a=Xv(()=>{setTimeout(()=>{i()},500)},[i]);return Uv(()=>(window.addEventListener("resize",i),window.addEventListener("orientationchange",a),()=>{window.removeEventListener("resize",i),window.removeEventListener("orientationchange",a)}),[i,a]),Uv(()=>{r.eventsFired===0&&s({type:"UPDATE",payload:{breakpoints:e,animationRef:n}})},[e,r]),uF.createElement(ji.Provider,{value:Object.assign({},r)},o&&o)};import pF from"react";var Zv=t=>o=>{let n=Co();return pF.createElement(t,Object.assign({},o,{windowInfo:n}))};import{useCallback as Qv,useEffect as ju,useRef as vF,useState as hp}from"react";import{c as hF}from"react/compiler-runtime";import{useEffect as gF,useRef as bF,useState as Jv}from"react";var mn=(t,e)=>{let o=hF(14),n;o[0]!==t?(n=t===void 0?{}:t,o[0]=t,o[1]=n):n=o[1];let{root:r,rootMargin:s,threshold:i}=n,a=r===void 0?null:r,l=s===void 0?"0px":s,c=i===void 0?0:i,[u,d]=Jv(),[f,m]=Jv(null),h;o[2]!==e||o[3]!==a||o[4]!==l||o[5]!==c?(h=typeof window<"u"&&"IntersectionObserver"in window&&!e?new window.IntersectionObserver(x=>{let[y]=x;return d(y)},{root:a,rootMargin:l,threshold:c}):null,o[2]=e,o[3]=a,o[4]=l,o[5]=c,o[6]=h):h=o[6];let p=bF(h),g,b;o[7]!==e||o[8]!==f?(g=()=>{if(e)return;let{current:x}=p;return x.disconnect(),f&&x.observe(f),()=>x.disconnect()},b=[f,e],o[7]=e,o[8]=f,o[9]=g,o[10]=b):(g=o[9],b=o[10]),gF(g,b);let v;return o[11]!==u||o[12]!==f?(v=[m,u,f],o[11]=u,o[12]=f,o[13]=v):v=o[13],v};import{jsx as qv}from"react/jsx-runtime";import"react";var cl="popup-button",fp=t=>{let{active:e,button:o,buttonType:n,className:r,disabled:s,noBackground:i,setActive:a,size:l}=t,c=[cl,r,`${cl}--${n}`,!i&&`${cl}--background`,l&&`${cl}--size-${l}`,s&&`${cl}--disabled`].filter(Boolean).join(" "),u=()=>{a(!e)};return n==="none"?null:n==="custom"?qv("div",{className:c,onClick:u,onKeyDown:d=>{d.key==="Enter"&&u()},role:"button",tabIndex:0,children:o}):qv("button",{className:c,disabled:s,onClick:u,onKeyDown:d=>{d.key==="Enter"&&u()},tabIndex:0,type:"button",children:o})};var Oo="popup",ho=t=>{let{id:e,boundingRef:o,button:n,buttonClassName:r,buttonSize:s,buttonType:i="default",caret:a=!0,children:l,className:c,disabled:u,forceOpen:d,horizontalAlign:f="left",initActive:m=!1,noBackground:h,onToggleOpen:p,render:g,showOnHover:b=!1,showScrollbar:v=!1,size:x="medium",verticalAlign:y="top"}=t,{height:C,width:S}=Co(),[w,D]=mn({root:o?.current||null,rootMargin:"-100px 0px 0px 0px",threshold:1}),_=vF(null),[A,F]=hp(m),[R,I]=hp(y),[E,T]=hp(f),$=Qv(({horizontal:P=!1,vertical:L=!1})=>{if(_.current){let V=_.current.getBoundingClientRect(),{bottom:M,left:O,right:B,top:G}=V,X=100,Z=document.documentElement.clientWidth,te=document.documentElement.clientHeight,U=0;o?.current&&({bottom:te,left:U,right:Z,top:X}=o.current.getBoundingClientRect()),P&&(B>Z&&O>U?T("right"):O<U&&B<Z&&T("left")),L&&(G<X&&M<te?I("bottom"):M>te&&G>X&&I("top"))}},[o]),j=Qv(P=>{_.current.contains(P.target)||F(!1)},[_]);ju(()=>{$({horizontal:!0})},[D,$,S]),ju(()=>{$({vertical:!0})},[D,$,C]),ju(()=>(typeof p=="function"&&p(A),A?document.addEventListener("mousedown",j):document.removeEventListener("mousedown",j),()=>{document.removeEventListener("mousedown",j)}),[A,j,p]),ju(()=>{F(d)},[d]);let N=[Oo,c,`${Oo}--size-${x}`,s&&`${Oo}--button-size-${s}`,`${Oo}--v-align-${R}`,`${Oo}--h-align-${E}`,A&&`${Oo}--active`,v&&`${Oo}--show-scrollbar`].filter(Boolean).join(" ");return pp("div",{className:N,id:e,children:[Ps("div",{className:`${Oo}__trigger-wrap`,children:b?Ps("div",{className:`${Oo}__on-hover-watch`,onMouseEnter:()=>F(!0),onMouseLeave:()=>F(!1),children:Ps(fp,{active:A,button:n,buttonType:i,className:r,disabled:u,noBackground:h,setActive:F,size:s})}):Ps(fp,{active:A,button:n,buttonType:i,className:r,disabled:u,noBackground:h,setActive:F,size:s})}),pp("div",{className:`${Oo}__content`,ref:_,children:[Ps("div",{className:`${Oo}__hide-scrollbar`,ref:w,children:Ps("div",{className:`${Oo}__scroll-container`,children:pp("div",{className:`${Oo}__scroll-content`,children:[g&&g({close:()=>F(!1)}),l]})})}),a&&Ps("div",{className:`${Oo}__caret`})]})]})};import{c as xF}from"react/compiler-runtime";import{jsx as Ou,jsxs as yF}from"react/jsx-runtime";import gp,{useEffect as Kv}from"react";var go=t=>{let e=xF(26),{alignCaret:o,boundingRef:n,children:r,className:s,delay:i,position:a,show:l,staticPositioning:c}=t,u=o===void 0?"center":o,d=i===void 0?350:i,f=l===void 0?!0:l,m=c===void 0?!1:c,[h,p]=gp.useState(f),[g,b]=gp.useState("top"),v=CF,x=n?.current||null,y;e[0]!==x?(y={root:x,rootMargin:"-145px 0px 0px 100px",threshold:0},e[0]=x,e[1]=y):y=e[1];let[C,S]=mn(y,m),w,D;e[2]!==d||e[3]!==f?(w=()=>{let R;return d&&f?R=setTimeout(()=>{p(f)},d):p(f),()=>{R&&clearTimeout(R)}},D=[f,d],e[2]=d,e[3]=f,e[4]=w,e[5]=D):(w=e[4],D=e[5]),Kv(w,D);let _;e[6]!==S?.isIntersecting||e[7]!==m?(_=()=>{m||b(S?.isIntersecting?"top":"bottom")},e[6]=S?.isIntersecting,e[7]=m,e[8]=_):_=e[8];let A;e[9]!==S||e[10]!==m?(A=[S,m],e[9]=S,e[10]=m,e[11]=A):A=e[11],Kv(_,A);let F;if(e[12]!==u||e[13]!==r||e[14]!==s||e[15]!==g||e[16]!==a||e[17]!==C||e[18]!==h||e[19]!==m){let R=h&&"tooltip--show",I=`tooltip--caret-${u}`,E=`tooltip--position-${a||g}`,T;e[21]!==s||e[22]!==R||e[23]!==I||e[24]!==E?(T=["tooltip",s,R,I,E].filter(Boolean),e[21]=s,e[22]=R,e[23]=I,e[24]=E,e[25]=T):T=e[25],F=yF(gp.Fragment,{children:[!m&&Ou("aside",{"aria-hidden":"true",className:["tooltip",s,`tooltip--caret-${u}`,"tooltip--position-top"].filter(Boolean).join(" "),ref:C,style:{opacity:"0"},children:Ou("div",{className:"tooltip-content",children:r})}),Ou("aside",{className:T.join(" "),title:v(r),children:Ou("div",{className:"tooltip-content",children:r})})]}),e[12]=u,e[13]=r,e[14]=s,e[15]=g,e[16]=a,e[17]=C,e[18]=h,e[19]=m,e[20]=F}else F=e[20];return F};function CF(t){return typeof t=="string"?t:""}var RF={chevron:Ze,edit:_r,link:cp,plus:jo,swap:up,x:pt},so="btn",Mu=({children:t,icon:e,showTooltip:o,tooltip:n})=>{let r=RF[e];return Bu(SF,{children:[n&&Uo(go,{className:`${so}__tooltip`,show:o,children:n}),Bu("span",{className:`${so}__content`,children:[t&&Uo("span",{className:`${so}__label`,children:t}),e&&Bu("span",{className:`${so}__icon`,children:[IF(e)&&e,r&&Uo(r,{})]})]})]})},ne=t=>{let{id:e,type:o="button","aria-label":n,buttonStyle:r="primary",children:s,className:i,disabled:a,el:l="button",enableSubMenu:c,icon:u,iconPosition:d="right",iconStyle:f="without-border",newTab:m,onClick:h,onMouseDown:p,ref:g,round:b,size:v="medium",SubMenuPopupContent:x,to:y,tooltip:C,url:S}=t,[w,D]=wF.useState(!1),_=[so,i&&i,u&&`${so}--icon`,f&&`${so}--icon-style-${f}`,u&&!s&&`${so}--icon-only`,v&&`${so}--size-${v}`,u&&d&&`${so}--icon-position-${d}`,C&&`${so}--has-tooltip`,!x&&`${so}--withoutPopup`].filter(Boolean).join(" ");function A(T){D(!1),o!=="submit"&&h&&T.preventDefault(),h&&h(T)}let F=[r&&`${so}--style-${r}`,a&&`${so}--disabled`,b&&`${so}--round`,x?`${so}--withPopup`:`${so}--withoutPopup`].filter(Boolean).join(" "),R={id:e,type:o,"aria-disabled":a,"aria-label":n,className:x?_:[_,F].join(" "),disabled:a,onClick:a?void 0:A,onMouseDown:a?void 0:p,onPointerEnter:C?()=>D(!0):void 0,onPointerLeave:C?()=>D(!1):void 0,rel:m?"noopener noreferrer":void 0,target:m?"_blank":void 0},I,E;switch(l){case"anchor":I=Uo("a",{...R,href:a?void 0:S,ref:g,children:Uo(Mu,{icon:u,showTooltip:w,tooltip:C,children:s})});break;case"link":a&&(I=Uo("div",{...R,children:Uo(Mu,{icon:u,showTooltip:w,tooltip:C,children:s})})),I=Uo(no,{...R,href:y||S,prefetch:E,children:Uo(Mu,{icon:u,showTooltip:w,tooltip:C,children:s})});break;default:I=Uo(l,{ref:g,type:"submit",...R,children:Uo(Mu,{icon:u,showTooltip:w,tooltip:C,children:s})});break}return x?Bu("div",{className:F,children:[I,Uo(ho,{button:Uo(Ze,{}),buttonSize:v,className:a&&!c?`${so}--popup-disabled`:"",disabled:a&&!c,horizontalAlign:"right",id:`${e}-popup`,noBackground:!0,render:({close:T})=>x({close:()=>T()}),size:"large",verticalAlign:"bottom"})]}):I};import{c as tA}from"react/compiler-runtime";import{jsx as oA}from"react/jsx-runtime";import{Fragment as rA}from"react";import{c as eA}from"react/compiler-runtime";import s0,{useMemo as Gu,useRef as xp,useEffect as Wu,useState as NF,useContext as LF}from"react";import{useDndContext as $F,getClientRect as kF,useDroppable as jF,useDraggable as OF,closestCorners as MF,getFirstCollision as BF,getScrollableAncestors as VF,KeyboardCode as Un}from"@dnd-kit/core";import{useMemo as e0,useLayoutEffect as _F,useEffect as DF,useRef as sX,useCallback as iX}from"react";function t0(){for(var t=arguments.length,e=new Array(t),o=0;o<t;o++)e[o]=arguments[o];return e0(()=>n=>{e.forEach(r=>r(n))},e)}var FF=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function AF(t){let e=Object.prototype.toString.call(t);return e==="[object Window]"||e==="[object global]"}function TF(t){return"nodeType"in t}function EF(t){var e,o;return t?AF(t)?t:TF(t)&&(e=(o=t.ownerDocument)==null?void 0:o.defaultView)!=null?e:window:window}var vp=FF?_F:DF;var bp={};function o0(t,e){return e0(()=>{if(e)return e;let o=bp[t]==null?0:bp[t]+1;return bp[t]=o,t+"-"+o},[t,e])}function PF(t){return 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];return n.reduce((s,i)=>{let a=Object.entries(i);for(let[l,c]of a){let u=s[l];u!=null&&(s[l]=u+t*c)}return s},{...e})}}var r0=PF(-1);function n0(t){if(!t)return!1;let{KeyboardEvent:e}=EF(t.target);return e&&t instanceof e}var ul=Object.freeze({Translate:{toString(t){if(!t)return;let{x:e,y:o}=t;return"translate3d("+(e?Math.round(e):0)+"px, "+(o?Math.round(o):0)+"px, 0)"}},Scale:{toString(t){if(!t)return;let{scaleX:e,scaleY:o}=t;return"scaleX("+e+") scaleY("+o+")"}},Transform:{toString(t){if(t)return[ul.Translate.toString(t),ul.Scale.toString(t)].join(" ")}},Transition:{toString(t){let{property:e,duration:o,easing:n}=t;return e+" "+o+"ms "+n}}});function zu(t,e,o){let n=t.slice();return n.splice(o<0?n.length+o:o,0,n.splice(e,1)[0]),n}function GF(t,e){return t.reduce((o,n,r)=>{let s=e.get(n);return s&&(o[r]=s),o},Array(t.length))}function Vu(t){return t!==null&&t>=0}function WF(t,e){if(t===e)return!0;if(t.length!==e.length)return!1;for(let o=0;o<t.length;o++)if(t[o]!==e[o])return!1;return!0}function HF(t){return typeof t=="boolean"?{draggable:t,droppable:t}:t}var i0=t=>{let{rects:e,activeIndex:o,overIndex:n,index:r}=t,s=zu(e,n,o),i=e[r],a=s[r];return!a||!i?null:{x:a.left-i.left,y:a.top-i.top,scaleX:a.width/i.width,scaleY:a.height/i.height}};var a0="Sortable",l0=s0.createContext({activeIndex:-1,containerId:a0,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:i0,disabled:{draggable:!1,droppable:!1}});function c0(t){let{children:e,id:o,items:n,strategy:r=i0,disabled:s=!1}=t,{active:i,dragOverlay:a,droppableRects:l,over:c,measureDroppableContainers:u}=$F(),d=o0(a0,o),f=a.rect!==null,m=Gu(()=>n.map(S=>typeof S=="object"&&"id"in S?S.id:S),[n]),h=i!=null,p=i?m.indexOf(i.id):-1,g=c?m.indexOf(c.id):-1,b=xp(m),v=!WF(m,b.current),x=g!==-1&&p===-1||v,y=HF(s);vp(()=>{v&&h&&u(m)},[v,m,h,u]),Wu(()=>{b.current=m},[m]);let C=Gu(()=>({activeIndex:p,containerId:d,disabled:y,disableTransforms:x,items:m,overIndex:g,useDragOverlay:f,sortedRects:GF(m,l),strategy:r}),[p,d,y.draggable,y.droppable,x,m,g,l,f,r]);return s0.createElement(l0.Provider,{value:C},e)}var zF=t=>{let{id:e,items:o,activeIndex:n,overIndex:r}=t;return zu(o,n,r).indexOf(e)},XF=t=>{let{containerId:e,isSorting:o,wasDragging:n,index:r,items:s,newIndex:i,previousItems:a,previousContainerId:l,transition:c}=t;return!c||!n||a!==s&&r===i?!1:o?!0:i!==r&&e===l},UF={duration:200,easing:"ease"},u0="transform",YF=ul.Transition.toString({property:u0,duration:0,easing:"linear"}),ZF={roleDescription:"sortable"};function JF(t){let{disabled:e,index:o,node:n,rect:r}=t,[s,i]=NF(null),a=xp(o);return vp(()=>{if(!e&&o!==a.current&&n.current){let l=r.current;if(l){let c=kF(n.current,{ignoreTransform:!0}),u={x:l.left-c.left,y:l.top-c.top,scaleX:l.width/c.width,scaleY:l.height/c.height};(u.x||u.y)&&i(u)}}o!==a.current&&(a.current=o)},[e,o,n,r]),Wu(()=>{s&&i(null)},[s]),s}function d0(t){let{animateLayoutChanges:e=XF,attributes:o,disabled:n,data:r,getNewIndex:s=zF,id:i,strategy:a,resizeObserverConfig:l,transition:c=UF}=t,{items:u,containerId:d,activeIndex:f,disabled:m,disableTransforms:h,sortedRects:p,overIndex:g,useDragOverlay:b,strategy:v}=LF(l0),x=qF(n,m),y=u.indexOf(i),C=Gu(()=>({sortable:{containerId:d,index:y,items:u},...r}),[d,r,y,u]),S=Gu(()=>u.slice(u.indexOf(i)),[u,i]),{rect:w,node:D,isOver:_,setNodeRef:A}=jF({id:i,data:C,disabled:x.droppable,resizeObserverConfig:{updateMeasurementsFor:S,...l}}),{active:F,activatorEvent:R,activeNodeRect:I,attributes:E,setNodeRef:T,listeners:$,isDragging:j,over:N,setActivatorNodeRef:P,transform:L}=OF({id:i,data:C,attributes:{...ZF,...o},disabled:x.draggable}),V=t0(A,T),M=!!F,O=M&&!h&&Vu(f)&&Vu(g),B=!b&&j,G=B&&O?L:null,Z=O?G??(a??v)({rects:p,activeNodeRect:I,activeIndex:f,overIndex:g,index:y}):null,te=Vu(f)&&Vu(g)?s({id:i,items:u,activeIndex:f,overIndex:g}):y,U=F?.id,z=xp({activeId:U,items:u,newIndex:te,containerId:d}),ce=u!==z.current.items,J=e({active:F,containerId:d,isDragging:j,isSorting:M,id:i,index:y,items:u,newIndex:z.current.newIndex,previousItems:z.current.items,previousContainerId:z.current.containerId,transition:c,wasDragging:z.current.activeId!=null}),ue=JF({disabled:!J,index:y,node:D,rect:w});return Wu(()=>{M&&z.current.newIndex!==te&&(z.current.newIndex=te),d!==z.current.containerId&&(z.current.containerId=d),u!==z.current.items&&(z.current.items=u)},[M,te,d,u]),Wu(()=>{if(U===z.current.activeId)return;if(U&&!z.current.activeId){z.current.activeId=U;return}let q=setTimeout(()=>{z.current.activeId=U},50);return()=>clearTimeout(q)},[U]),{active:F,activeIndex:f,attributes:E,data:C,rect:w,index:y,newIndex:te,items:u,isOver:_,isSorting:M,isDragging:j,listeners:$,node:D,overIndex:g,over:N,setNodeRef:V,setActivatorNodeRef:P,setDroppableNodeRef:A,setDraggableNodeRef:T,transform:ue??Z,transition:re()};function re(){if(ue||ce&&z.current.newIndex===y)return YF;if(!(B&&!n0(R)||!c)&&(M||J))return ul.Transition.toString({...c,property:u0})}}function qF(t,e){var o,n;return typeof t=="boolean"?{draggable:t,droppable:!1}:{draggable:(o=t?.draggable)!=null?o:e.draggable,droppable:(n=t?.droppable)!=null?n:e.droppable}}function Hu(t){if(!t)return!1;let e=t.data.current;return!!(e&&"sortable"in e&&typeof e.sortable=="object"&&"containerId"in e.sortable&&"items"in e.sortable&&"index"in e.sortable)}var QF=[Un.Down,Un.Right,Un.Up,Un.Left],m0=(t,e)=>{let{context:{active:o,collisionRect:n,droppableRects:r,droppableContainers:s,over:i,scrollableAncestors:a}}=e;if(QF.includes(t.code)){if(t.preventDefault(),!o||!n)return;let l=[];s.getEnabled().forEach(d=>{if(!d||d!=null&&d.disabled)return;let f=r.get(d.id);if(f)switch(t.code){case Un.Down:n.top<f.top&&l.push(d);break;case Un.Up:n.top>f.top&&l.push(d);break;case Un.Left:n.left>f.left&&l.push(d);break;case Un.Right:n.left<f.left&&l.push(d);break}});let c=MF({active:o,collisionRect:n,droppableRects:r,droppableContainers:l,pointerCoordinates:null}),u=BF(c,"id");if(u===i?.id&&c.length>1&&(u=c[1].id),u!=null){let d=s.get(o.id),f=s.get(u),m=f?r.get(f.id):null,h=f?.node.current;if(h&&m&&d&&f){let g=VF(h).some((S,w)=>a[w]!==S),b=f0(d,f),v=KF(d,f),x=g||!b?{x:0,y:0}:{x:v?n.width-m.width:0,y:v?n.height-m.height:0},y={x:m.left,y:m.top};return x.x&&x.y?y:r0(y,x)}}}};function f0(t,e){return!Hu(t)||!Hu(e)?!1:t.data.current.sortable.containerId===e.data.current.sortable.containerId}function KF(t,e){return!Hu(t)||!Hu(e)||!f0(t,e)?!1:t.data.current.sortable.index<e.data.current.sortable.index}var Oi=t=>{let e=eA(17),{id:o,disabled:n}=t,r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={duration:250,easing:"cubic-bezier(0, 0.2, 0.2, 1)"},e[0]=r):r=e[0];let s;e[1]!==n||e[2]!==o?(s={id:o,disabled:n,transition:r},e[1]=n,e[2]=o,e[3]=s):s=e[3];let{attributes:i,isDragging:a,listeners:l,setNodeRef:c,transform:u,transition:d}=d0(s),f=a?"grabbing":"grab",m;e[4]!==f||e[5]!==d?(m={cursor:f,transition:d},e[4]=f,e[5]=d,e[6]=m):m=e[6];let h;e[7]!==i||e[8]!==m?(h={...i,style:m},e[7]=i,e[8]=m,e[9]=h):h=e[9];let p=u&&`translate3d(${u.x}px, ${u.y}px, 0)`,g;return e[10]!==a||e[11]!==l||e[12]!==c||e[13]!==h||e[14]!==p||e[15]!==d?(g={attributes:h,isDragging:a,listeners:l,setNodeRef:c,transform:p,transition:d},e[10]=a,e[11]=l,e[12]=c,e[13]=h,e[14]=p,e[15]=d,e[16]=g):g=e[16],g};var Jr=t=>{let e=tA(12),{id:o,children:n,disabled:r}=t,s;e[0]!==r||e[1]!==o?(s={id:o,disabled:r},e[0]=r,e[1]=o,e[2]=s):s=e[2];let{attributes:i,isDragging:a,listeners:l,setNodeRef:c,transform:u,transition:d}=Oi(s),f=a?"grabbing":"grab",m;return e[3]!==i||e[4]!==n||e[5]!==a||e[6]!==l||e[7]!==c||e[8]!==f||e[9]!==u||e[10]!==d?(m=oA(rA,{children:n({attributes:{...i,style:{cursor:f}},isDragging:a,listeners:l,setNodeRef:c,transform:u,transition:d})}),e[3]=i,e[4]=n,e[5]=a,e[6]=l,e[7]=c,e[8]=f,e[9]=u,e[10]=d,e[11]=m):m=e[11],m};import{c as nA}from"react/compiler-runtime";import{jsx as yp}from"react/jsx-runtime";import{closestCenter as sA,DndContext as iA,KeyboardSensor as aA,PointerSensor as lA,useDroppable as cA,useSensor as p0,useSensors as uA}from"@dnd-kit/core";import{useId as dA}from"react";var cr=t=>{let e=nA(18),{children:o,className:n,ids:r,onDragEnd:s,onDragStart:i}=t,a=dA(),l;e[0]!==a?(l={id:a},e[0]=a,e[1]=l):l=e[1];let{setNodeRef:c}=cA(l),u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u={activationConstraint:{distance:5}},e[2]=u):u=e[2];let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d={coordinateGetter:m0},e[3]=d):d=e[3];let f=uA(p0(lA,u),p0(aA,d)),m;e[4]!==r||e[5]!==s?(m=v=>{let{active:x,over:y}=v;v.activatorEvent.stopPropagation(),!(!x||!y)&&typeof s=="function"&&s({event:v,moveFromIndex:r.findIndex(C=>C===x.id),moveToIndex:r.findIndex(C=>C===y.id)})},e[4]=r,e[5]=s,e[6]=m):m=e[6];let h=m,p;e[7]!==i?(p=v=>{let{active:x}=v;x&&typeof i=="function"&&i({id:x.id,event:v})},e[7]=i,e[8]=p):p=e[8];let g=p,b;return e[9]!==o||e[10]!==n||e[11]!==h||e[12]!==g||e[13]!==a||e[14]!==r||e[15]!==f||e[16]!==c?(b=yp(iA,{collisionDetection:sA,id:a,onDragEnd:h,onDragStart:g,sensors:f,children:yp(c0,{items:r,children:yp("div",{className:n,ref:c,children:o})})}),e[9]=o,e[10]=n,e[11]=h,e[12]=g,e[13]=a,e[14]=r,e[15]=f,e[16]=c,e[17]=b):b=e[17],b};import{jsx as h0,jsxs as mA}from"react/jsx-runtime";import"react";var Xu="error-pill",io=t=>{let{className:e,count:o,i18n:n,withMessage:r}=t,s=!r&&o<99,i=[Xu,s&&`${Xu}--fixed-width`,e&&e].filter(Boolean).join(" ");return o===0?null:h0("div",{className:i,children:mA("div",{className:`${Xu}__content`,children:[h0("span",{className:`${Xu}__count`,children:o}),r&&` ${o>1?n.t("general:errors"):n.t("general:error")}`]})})};import{c as fA}from"react/compiler-runtime";import{jsx as pA}from"react/jsx-runtime";import{getTranslation as hA}from"@payloadcms/translations";import"react";var g0="field-description",Be=t=>{let e=fA(8),{className:o,description:n,marginPlacement:r,path:s}=t,{i18n:i}=k();if(n){let a=`field-description-${s?.replace(/\./g,"__")}`,l=r&&`${g0}--margin-${r}`,c;e[0]!==o||e[1]!==a||e[2]!==l?(c=[g0,o,a,l].filter(Boolean),e[0]=o,e[1]=a,e[2]=l,e[3]=c):c=e[3];let u=c.join(" "),d;return e[4]!==n||e[5]!==i||e[6]!==u?(d=pA("div",{className:u,children:hA(n,i)}),e[4]=n,e[5]=i,e[6]=u,e[7]=d):d=e[7],d}return null};import{c as gA}from"react/compiler-runtime";import{jsx as bA}from"react/jsx-runtime";import"react";var vA="field-error",He=t=>{let e=gA(7),{alignCaret:o,message:n,path:r,showError:s}=t,i=o===void 0?"right":o,a=Xt(),l;e[0]!==r?(l=p=>{let[g]=p;return g&&g?.[r]||null},e[0]=r,e[1]=l):l=e[1];let c=Et(l),u;e[2]!==c?(u=c||{},e[2]=c,e[3]=u):u=e[3];let{errorMessage:d,valid:f}=u,m=n||d;if((s||a&&f===!1)&&m?.length){let p;return e[4]!==i||e[5]!==m?(p=bA(go,{alignCaret:i,className:vA,delay:0,staticPositioning:!0,children:m}),e[4]=i,e[5]=m,e[6]=p):p=e[6],p}return null};import{c as rE}from"react/compiler-runtime";import{jsx as nE,jsxs as ux}from"react/jsx-runtime";import{getTranslation as sE}from"@payloadcms/translations";import"react";import{c as xA}from"react/compiler-runtime";import{jsx as yA}from"react/jsx-runtime";import{createContext as CA,use as wA}from"react";var b0=CA(0),Ns=t=>{let e=xA(3),{children:o}=t,r=ct()+1,s;return e[0]!==o||e[1]!==r?(s=yA(b0,{value:r,children:o}),e[0]=o,e[1]=r,e[2]=s):s=e[2],s},ct=()=>wA(b0);import{c as JT}from"react/compiler-runtime";import{jsx as nx}from"react/jsx-runtime";import{useSearchParams as qT}from"next/navigation.js";import QT,{createContext as ix,use as ax,useEffect as sx,useRef as KT,useState as eE}from"react";var Yn=(t,e)=>!t?.locales||t.locales.length===0?null:t.locales.find(o=>o?.code===e);import{jsx as BT}from"react/jsx-runtime";import{jsx as Ap}from"react/jsx-runtime";import{useRef as F0,useEffect as ks,useState as Tp}from"react";import kA from"react-dom";function Ie(){return Ie=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var o=arguments[e];for(var n in o)({}).hasOwnProperty.call(o,n)&&(t[n]=o[n])}return t},Ie.apply(null,arguments)}function Mi(t,e){if(t==null)return{};var o={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(e.includes(n))continue;o[n]=t[n]}return o}function Bi(t,e){return Bi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(o,n){return o.__proto__=n,o},Bi(t,e)}function Uu(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,Bi(t,e)}function Cp(t,e){return t.classList?!!e&&t.classList.contains(e):(" "+(t.className.baseVal||t.className)+" ").indexOf(" "+e+" ")!==-1}function wp(t,e){t.classList?t.classList.add(e):Cp(t,e)||(typeof t.className=="string"?t.className=t.className+" "+e:t.setAttribute("class",(t.className&&t.className.baseVal||"")+" "+e))}function v0(t,e){return t.replace(new RegExp("(^|\\s)"+e+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function Sp(t,e){t.classList?t.classList.remove(e):typeof t.className=="string"?t.className=v0(t.className,e):t.setAttribute("class",v0(t.className&&t.className.baseVal||"",e))}import y0 from"react";import Zu from"react";import Ju from"react-dom";var Ip={disabled:!1};import SA from"react";var Rp=SA.createContext(null);var Yu=function(e){return e.scrollTop};var dl="unmounted",Ls="exited",$s="entering",Gi="entered",_p="exiting",fn=function(t){Uu(e,t);function e(n,r){var s;s=t.call(this,n,r)||this;var i=r,a=i&&!i.isMounting?n.enter:n.appear,l;return s.appearStatus=null,n.in?a?(l=Ls,s.appearStatus=$s):l=Gi:n.unmountOnExit||n.mountOnEnter?l=dl:l=Ls,s.state={status:l},s.nextCallback=null,s}e.getDerivedStateFromProps=function(r,s){var i=r.in;return i&&s.status===dl?{status:Ls}:null};var o=e.prototype;return o.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},o.componentDidUpdate=function(r){var s=null;if(r!==this.props){var i=this.state.status;this.props.in?i!==$s&&i!==Gi&&(s=$s):(i===$s||i===Gi)&&(s=_p)}this.updateStatus(!1,s)},o.componentWillUnmount=function(){this.cancelNextCallback()},o.getTimeouts=function(){var r=this.props.timeout,s,i,a;return s=i=a=r,r!=null&&typeof r!="number"&&(s=r.exit,i=r.enter,a=r.appear!==void 0?r.appear:i),{exit:s,enter:i,appear:a}},o.updateStatus=function(r,s){if(r===void 0&&(r=!1),s!==null)if(this.cancelNextCallback(),s===$s){if(this.props.unmountOnExit||this.props.mountOnEnter){var i=this.props.nodeRef?this.props.nodeRef.current:Ju.findDOMNode(this);i&&Yu(i)}this.performEnter(r)}else this.performExit();else this.props.unmountOnExit&&this.state.status===Ls&&this.setState({status:dl})},o.performEnter=function(r){var s=this,i=this.props.enter,a=this.context?this.context.isMounting:r,l=this.props.nodeRef?[a]:[Ju.findDOMNode(this),a],c=l[0],u=l[1],d=this.getTimeouts(),f=a?d.appear:d.enter;if(!r&&!i||Ip.disabled){this.safeSetState({status:Gi},function(){s.props.onEntered(c)});return}this.props.onEnter(c,u),this.safeSetState({status:$s},function(){s.props.onEntering(c,u),s.onTransitionEnd(f,function(){s.safeSetState({status:Gi},function(){s.props.onEntered(c,u)})})})},o.performExit=function(){var r=this,s=this.props.exit,i=this.getTimeouts(),a=this.props.nodeRef?void 0:Ju.findDOMNode(this);if(!s||Ip.disabled){this.safeSetState({status:Ls},function(){r.props.onExited(a)});return}this.props.onExit(a),this.safeSetState({status:_p},function(){r.props.onExiting(a),r.onTransitionEnd(i.exit,function(){r.safeSetState({status:Ls},function(){r.props.onExited(a)})})})},o.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},o.safeSetState=function(r,s){s=this.setNextCallback(s),this.setState(r,s)},o.setNextCallback=function(r){var s=this,i=!0;return this.nextCallback=function(a){i&&(i=!1,s.nextCallback=null,r(a))},this.nextCallback.cancel=function(){i=!1},this.nextCallback},o.onTransitionEnd=function(r,s){this.setNextCallback(s);var i=this.props.nodeRef?this.props.nodeRef.current:Ju.findDOMNode(this),a=r==null&&!this.props.addEndListener;if(!i||a){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var l=this.props.nodeRef?[this.nextCallback]:[i,this.nextCallback],c=l[0],u=l[1];this.props.addEndListener(c,u)}r!=null&&setTimeout(this.nextCallback,r)},o.render=function(){var r=this.state.status;if(r===dl)return null;var s=this.props,i=s.children,a=s.in,l=s.mountOnEnter,c=s.unmountOnExit,u=s.appear,d=s.enter,f=s.exit,m=s.timeout,h=s.addEndListener,p=s.onEnter,g=s.onEntering,b=s.onEntered,v=s.onExit,x=s.onExiting,y=s.onExited,C=s.nodeRef,S=Mi(s,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return Zu.createElement(Rp.Provider,{value:null},typeof i=="function"?i(r,S):Zu.cloneElement(Zu.Children.only(i),S))},e}(Zu.Component);fn.contextType=Rp;fn.propTypes={};function Vi(){}fn.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Vi,onEntering:Vi,onEntered:Vi,onExit:Vi,onExiting:Vi,onExited:Vi};fn.UNMOUNTED=dl;fn.EXITED=Ls;fn.ENTERING=$s;fn.ENTERED=Gi;fn.EXITING=_p;var x0=fn;var IA=function(e,o){return e&&o&&o.split(" ").forEach(function(n){return wp(e,n)})},Dp=function(e,o){return e&&o&&o.split(" ").forEach(function(n){return Sp(e,n)})},Fp=function(t){Uu(e,t);function e(){for(var n,r=arguments.length,s=new Array(r),i=0;i<r;i++)s[i]=arguments[i];return n=t.call.apply(t,[this].concat(s))||this,n.appliedClasses={appear:{},enter:{},exit:{}},n.onEnter=function(a,l){var c=n.resolveArguments(a,l),u=c[0],d=c[1];n.removeClasses(u,"exit"),n.addClass(u,d?"appear":"enter","base"),n.props.onEnter&&n.props.onEnter(a,l)},n.onEntering=function(a,l){var c=n.resolveArguments(a,l),u=c[0],d=c[1],f=d?"appear":"enter";n.addClass(u,f,"active"),n.props.onEntering&&n.props.onEntering(a,l)},n.onEntered=function(a,l){var c=n.resolveArguments(a,l),u=c[0],d=c[1],f=d?"appear":"enter";n.removeClasses(u,f),n.addClass(u,f,"done"),n.props.onEntered&&n.props.onEntered(a,l)},n.onExit=function(a){var l=n.resolveArguments(a),c=l[0];n.removeClasses(c,"appear"),n.removeClasses(c,"enter"),n.addClass(c,"exit","base"),n.props.onExit&&n.props.onExit(a)},n.onExiting=function(a){var l=n.resolveArguments(a),c=l[0];n.addClass(c,"exit","active"),n.props.onExiting&&n.props.onExiting(a)},n.onExited=function(a){var l=n.resolveArguments(a),c=l[0];n.removeClasses(c,"exit"),n.addClass(c,"exit","done"),n.props.onExited&&n.props.onExited(a)},n.resolveArguments=function(a,l){return n.props.nodeRef?[n.props.nodeRef.current,a]:[a,l]},n.getClassNames=function(a){var l=n.props.classNames,c=typeof l=="string",u=c&&l?l+"-":"",d=c?""+u+a:l[a],f=c?d+"-active":l[a+"Active"],m=c?d+"-done":l[a+"Done"];return{baseClassName:d,activeClassName:f,doneClassName:m}},n}var o=e.prototype;return o.addClass=function(r,s,i){var a=this.getClassNames(s)[i+"ClassName"],l=this.getClassNames("enter"),c=l.doneClassName;s==="appear"&&i==="done"&&c&&(a+=" "+c),i==="active"&&r&&Yu(r),a&&(this.appliedClasses[s][i]=a,IA(r,a))},o.removeClasses=function(r,s){var i=this.appliedClasses[s],a=i.base,l=i.active,c=i.done;this.appliedClasses[s]={},a&&Dp(r,a),l&&Dp(r,l),c&&Dp(r,c)},o.render=function(){var r=this.props,s=r.classNames,i=Mi(r,["classNames"]);return y0.createElement(x0,Ie({},i,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},e}(y0.Component);Fp.defaultProps={classNames:""};Fp.propTypes={};var ml=Fp;function C0(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}import{useContext as _A}from"react";import{createContext as RA}from"react";var qu=RA({});var de=()=>_A(qu);var Qu=t=>t?{appear:`${t}--appear`,appearActive:`${t}--appearActive`,appearDone:`${t}--appearDone`,enter:`${t}--enter`,enterActive:`${t}--enterActive`,enterDone:`${t}--enterDone`,exit:`${t}--exit`,exitActive:`${t}--exitActive`,exitDone:`${t}--exitDone`}:{};wD();function w0(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 S0(t){for(var e=1;e<arguments.length;e++){var o=arguments[e]!=null?arguments[e]:{};e%2?w0(Object(o),!0).forEach(function(n){DA(t,n,o[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):w0(Object(o)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(o,n))})}return t}function DA(t,e,o){return e=AA(e),e in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t}function FA(t,e){if(typeof t!="object"||t===null)return t;var o=t[Symbol.toPrimitive];if(o!==void 0){var n=o.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function AA(t){var e=FA(t,"string");return typeof e=="symbol"?e:String(e)}var I0={activateTrap:function(e,o){if(e.length>0){var n=e[e.length-1];n!==o&&n.pause()}var r=e.indexOf(o);r===-1||e.splice(r,1),e.push(o)},deactivateTrap:function(e,o){var n=e.indexOf(o);n!==-1&&e.splice(n,1),e.length>0&&e[e.length-1].unpause()}},TA=function(e){return e.tagName&&e.tagName.toLowerCase()==="input"&&typeof e.select=="function"},EA=function(e){return e?.key==="Escape"||e?.key==="Esc"||e?.keyCode===27},pl=function(e){return e?.key==="Tab"||e?.keyCode===9},PA=function(e){return pl(e)&&!e.shiftKey},NA=function(e){return pl(e)&&e.shiftKey},R0=function(e){return setTimeout(e,0)},_0=function(e,o){var n=-1;return e.every(function(r,s){return o(r)?(n=s,!1):!0}),n},fl=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];return typeof e=="function"?e.apply(void 0,n):e},Ku=function(e){return e.target.shadowRoot&&typeof e.composedPath=="function"?e.composedPath()[0]:e.target},LA=[],D0=function(e,o){var n=o?.document||document,r=o?.trapStack||LA,s=S0({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isKeyForward:PA,isKeyBackward:NA},o),i={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},a,l=function(R,I,E){return R&&R[I]!==void 0?R[I]:s[E||I]},c=function(R,I){var E=typeof I?.composedPath=="function"?I.composedPath():void 0;return i.containerGroups.findIndex(function(T){var $=T.container,j=T.tabbableNodes;return $.contains(R)||E?.includes($)||j.find(function(N){return N===R})})},u=function(R){var I=s[R];if(typeof I=="function"){for(var E=arguments.length,T=new Array(E>1?E-1:0),$=1;$<E;$++)T[$-1]=arguments[$];I=I.apply(void 0,T)}if(I===!0&&(I=void 0),!I){if(I===void 0||I===!1)return I;throw new Error("`".concat(R,"` was specified but was not a node, or did not return a node"))}var j=I;if(typeof I=="string"&&(j=n.querySelector(I),!j))throw new Error("`".concat(R,"` as selector refers to no known node"));return j},d=function(){var R=u("initialFocus");if(R===!1)return!1;if(R===void 0||!Cu(R,s.tabbableOptions))if(c(n.activeElement)>=0)R=n.activeElement;else{var I=i.tabbableGroups[0],E=I&&I.firstTabbableNode;R=E||u("fallbackFocus")}if(!R)throw new Error("Your focus-trap needs to have at least one focusable element");return R},f=function(){if(i.containerGroups=i.containers.map(function(R){var I=dv(R,s.tabbableOptions),E=mv(R,s.tabbableOptions),T=I.length>0?I[0]:void 0,$=I.length>0?I[I.length-1]:void 0,j=E.find(function(L){return Fs(L)}),N=E.slice().reverse().find(function(L){return Fs(L)}),P=!!I.find(function(L){return Li(L)>0});return{container:R,tabbableNodes:I,focusableNodes:E,posTabIndexesFound:P,firstTabbableNode:T,lastTabbableNode:$,firstDomTabbableNode:j,lastDomTabbableNode:N,nextTabbableNode:function(V){var M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,O=I.indexOf(V);return O<0?M?E.slice(E.indexOf(V)+1).find(function(B){return Fs(B)}):E.slice(0,E.indexOf(V)).reverse().find(function(B){return Fs(B)}):I[O+(M?1:-1)]}}}),i.tabbableGroups=i.containerGroups.filter(function(R){return R.tabbableNodes.length>0}),i.tabbableGroups.length<=0&&!u("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(i.containerGroups.find(function(R){return R.posTabIndexesFound})&&i.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")},m=function F(R){var I=R.activeElement;if(I)return I.shadowRoot&&I.shadowRoot.activeElement!==null?F(I.shadowRoot):I},h=function F(R){if(R!==!1&&R!==m(document)){if(!R||!R.focus){F(d());return}R.focus({preventScroll:!!s.preventScroll}),i.mostRecentlyFocusedNode=R,TA(R)&&R.select()}},p=function(R){var I=u("setReturnFocus",R);return I||(I===!1?!1:R)},g=function(R){var I=R.target,E=R.event,T=R.isBackward,$=T===void 0?!1:T;I=I||Ku(E),f();var j=null;if(i.tabbableGroups.length>0){var N=c(I,E),P=N>=0?i.containerGroups[N]:void 0;if(N<0)$?j=i.tabbableGroups[i.tabbableGroups.length-1].lastTabbableNode:j=i.tabbableGroups[0].firstTabbableNode;else if($){var L=_0(i.tabbableGroups,function(X){var Z=X.firstTabbableNode;return I===Z});if(L<0&&(P.container===I||Cu(I,s.tabbableOptions)&&!Fs(I,s.tabbableOptions)&&!P.nextTabbableNode(I,!1))&&(L=N),L>=0){var V=L===0?i.tabbableGroups.length-1:L-1,M=i.tabbableGroups[V];j=Li(I)>=0?M.lastTabbableNode:M.lastDomTabbableNode}else pl(E)||(j=P.nextTabbableNode(I,!1))}else{var O=_0(i.tabbableGroups,function(X){var Z=X.lastTabbableNode;return I===Z});if(O<0&&(P.container===I||Cu(I,s.tabbableOptions)&&!Fs(I,s.tabbableOptions)&&!P.nextTabbableNode(I))&&(O=N),O>=0){var B=O===i.tabbableGroups.length-1?0:O+1,G=i.tabbableGroups[B];j=Li(I)>=0?G.firstTabbableNode:G.firstDomTabbableNode}else pl(E)||(j=P.nextTabbableNode(I))}}else j=u("fallbackFocus");return j},b=function(R){var I=Ku(R);if(!(c(I,R)>=0)){if(fl(s.clickOutsideDeactivates,R)){a.deactivate({returnFocus:s.returnFocusOnDeactivate});return}fl(s.allowOutsideClick,R)||R.preventDefault()}},v=function(R){var I=Ku(R),E=c(I,R)>=0;if(E||I instanceof Document)E&&(i.mostRecentlyFocusedNode=I);else{R.stopImmediatePropagation();var T,$=!0;if(i.mostRecentlyFocusedNode)if(Li(i.mostRecentlyFocusedNode)>0){var j=c(i.mostRecentlyFocusedNode),N=i.containerGroups[j].tabbableNodes;if(N.length>0){var P=N.findIndex(function(L){return L===i.mostRecentlyFocusedNode});P>=0&&(s.isKeyForward(i.recentNavEvent)?P+1<N.length&&(T=N[P+1],$=!1):P-1>=0&&(T=N[P-1],$=!1))}}else i.containerGroups.some(function(L){return L.tabbableNodes.some(function(V){return Li(V)>0})})||($=!1);else $=!1;$&&(T=g({target:i.mostRecentlyFocusedNode,isBackward:s.isKeyBackward(i.recentNavEvent)})),h(T||i.mostRecentlyFocusedNode||d())}i.recentNavEvent=void 0},x=function(R){var I=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;i.recentNavEvent=R;var E=g({event:R,isBackward:I});E&&(pl(R)&&R.preventDefault(),h(E))},y=function(R){if(EA(R)&&fl(s.escapeDeactivates,R)!==!1){R.preventDefault(),a.deactivate();return}(s.isKeyForward(R)||s.isKeyBackward(R))&&x(R,s.isKeyBackward(R))},C=function(R){var I=Ku(R);c(I,R)>=0||fl(s.clickOutsideDeactivates,R)||fl(s.allowOutsideClick,R)||(R.preventDefault(),R.stopImmediatePropagation())},S=function(){if(i.active)return I0.activateTrap(r,a),i.delayInitialFocusTimer=s.delayInitialFocus?R0(function(){h(d())}):h(d()),n.addEventListener("focusin",v,!0),n.addEventListener("mousedown",b,{capture:!0,passive:!1}),n.addEventListener("touchstart",b,{capture:!0,passive:!1}),n.addEventListener("click",C,{capture:!0,passive:!1}),n.addEventListener("keydown",y,{capture:!0,passive:!1}),a},w=function(){if(i.active)return n.removeEventListener("focusin",v,!0),n.removeEventListener("mousedown",b,!0),n.removeEventListener("touchstart",b,!0),n.removeEventListener("click",C,!0),n.removeEventListener("keydown",y,!0),a},D=function(R){var I=R.some(function(E){var T=Array.from(E.removedNodes);return T.some(function($){return $===i.mostRecentlyFocusedNode})});I&&h(d())},_=typeof window<"u"&&"MutationObserver"in window?new MutationObserver(D):void 0,A=function(){_&&(_.disconnect(),i.active&&!i.paused&&i.containers.map(function(R){_.observe(R,{subtree:!0,childList:!0})}))};return a={get active(){return i.active},get paused(){return i.paused},activate:function(R){if(i.active)return this;var I=l(R,"onActivate"),E=l(R,"onPostActivate"),T=l(R,"checkCanFocusTrap");T||f(),i.active=!0,i.paused=!1,i.nodeFocusedBeforeActivation=n.activeElement,I?.();var $=function(){T&&f(),S(),A(),E?.()};return T?(T(i.containers.concat()).then($,$),this):($(),this)},deactivate:function(R){if(!i.active)return this;var I=S0({onDeactivate:s.onDeactivate,onPostDeactivate:s.onPostDeactivate,checkCanReturnFocus:s.checkCanReturnFocus},R);clearTimeout(i.delayInitialFocusTimer),i.delayInitialFocusTimer=void 0,w(),i.active=!1,i.paused=!1,A(),I0.deactivateTrap(r,a);var E=l(I,"onDeactivate"),T=l(I,"onPostDeactivate"),$=l(I,"checkCanReturnFocus"),j=l(I,"returnFocus","returnFocusOnDeactivate");E?.();var N=function(){R0(function(){j&&h(p(i.nodeFocusedBeforeActivation)),T?.()})};return j&&$?($(p(i.nodeFocusedBeforeActivation)).then(N,N),this):(N(),this)},pause:function(R){if(i.paused||!i.active)return this;var I=l(R,"onPause"),E=l(R,"onPostPause");return i.paused=!0,I?.(),w(),A(),E?.(),this},unpause:function(R){if(!i.paused||!i.active)return this;var I=l(R,"onUnpause"),E=l(R,"onPostUnpause");return i.paused=!1,I?.(),f(),S(),A(),E?.(),this},updateContainerElements:function(R){var I=[].concat(R).filter(Boolean);return i.containers=I.map(function(E){return typeof E=="string"?n.querySelector(E):E}),i.active&&f(),A(),this}},a.updateContainerElements(e),a};var $A=function(t,e){var o={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(o[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(t);r<n.length;r++)e.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(t,n[r])&&(o[n[r]]=t[n[r]]);return o},pn="modal-item",A0=(t,e)=>n=>{let r=de(),s=F0(null),[i,a]=Tp(!1),l=F0(!1),[c,u]=Tp(null),{modalState:d,classPrefix:f,containerRef:m,transTime:h,setCloseOnBlur:p,setBodyScrollLock:g,openModal:b}=r,{className:v,htmlElement:x="dialog",slug:y="",closeOnBlur:C=!0,lockBodyScroll:S=!0,classPrefix:w,onEnter:D,onEntering:_,onEntered:A,onExit:F,onExiting:R,onExited:I,openOnInit:E,trapFocus:T=!0,focusTrapOptions:$={}}=n,j=$A(n,["className","htmlElement","slug","closeOnBlur","lockBodyScroll","classPrefix","onEnter","onEntering","onEntered","onExit","onExiting","onExited","openOnInit","trapFocus","focusTrapOptions"]),N=w||f,P=e||y,L=d[P]&&d[P].isOpen;ks(()=>{if(T){let O=s.current;if(l.current===!1&&O){let B=D0(O,Object.assign(Object.assign({},$),{fallbackFocus:$?.fallbackFocus||O,allowOutsideClick:typeof $.allowOutsideClick<"u"?$.allowOutsideClick:!0}));u(B),l.current=!0}}},[T,i,$]),ks(()=>{a(!0)},[]),ks(()=>(c&&(L?c.activate():c.deactivate()),()=>{c&&c.deactivate()}),[L,c]),ks(()=>{L&&p(C)},[L,C,p]),ks(()=>{let O=s.current;return O&&g(!!(L&&S),O),()=>{O&&g(!1,O)}},[L,S,g]);let[V,M]=Tp(L);if(ks(()=>{L?M(L):setTimeout(()=>M(!1),h)},[L,h]),ks(()=>{E&&b(P)},[P,E,b]),m.current){let O=N?`${N}__${pn}`:pn,B=[O,`${O}--slug-${P}`,v].filter(Boolean).join(" "),G=Object.assign({role:x!=="dialog"?"dialog":void 0,open:x==="dialog"?V||L:void 0,"aria-modal":!0,"aria-label":j["aria-labelledby"]?void 0:P},j);return kA.createPortal(Ap(ml,{nodeRef:s,timeout:h,in:L,classNames:Qu(O),appear:!0,onEnter:D,onEntering:_,onEntered:A,onExit:F,onExiting:R,onExited:I,children:Ap(x,Object.assign({ref:s,id:j?.id||P,className:B},G,{children:Ap(t,Object.assign({},n,{isOpen:L,modal:r}))}))}),m.current)}return null};import{jsx as T0}from"react/jsx-runtime";import{Fragment as E0}from"react";var jA=t=>{let{children:e}=t;return e?typeof e=="function"?T0(E0,{children:e(t)}):T0(E0,{children:e}):null},Yo=A0(jA);import{jsx as P0}from"react/jsx-runtime";var OA=function(t,e){var o={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(o[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(t);r<n.length;r++)e.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(t,n[r])&&(o[n[r]]=t[n[r]]);return o},hn="modal-container",Ep=t=>{let{oneModalIsOpen:e,classPrefix:o,transTime:n,setContainerRef:r,containerRef:s,closeAllModals:i,closeOnBlur:a}=de(),{className:l,htmlElement:c="div",children:u,onClick:d}=t,f=OA(t,["className","htmlElement","children","onClick"]),m=o?`${o}__${hn}`:hn,h=[m,l].filter(Boolean).join(" "),p=Object.assign(Object.assign({},f),{onClick:g=>{a&&i(),typeof d=="function"&&d(g)}});return P0(ml,{nodeRef:s,in:e,timeout:n,classNames:Qu(m),appear:!0,children:P0(c,Object.assign({className:h,ref:r},p,{children:u&&u}))})};import{jsx as M0,jsxs as XA}from"react/jsx-runtime";import{Fragment as UA,useState as rd,useRef as B0,useEffect as nd,useCallback as Zn,useReducer as YA}from"react";function MA(t){if(Array.isArray(t)){for(var e=0,o=Array(t.length);e<t.length;e++)o[e]=t[e];return o}else return Array.from(t)}var Np=!1;typeof window<"u"&&(Pp={get passive(){Np=!0}},window.addEventListener("testPassive",null,Pp),window.removeEventListener("testPassive",null,Pp));var Pp,ed=typeof window<"u"&&window.navigator&&window.navigator.platform&&(/iP(ad|hone|od)/.test(window.navigator.platform)||window.navigator.platform==="MacIntel"&&window.navigator.maxTouchPoints>1),Os=[],td=!1,N0=-1,hl=void 0,js=void 0,gl=void 0,L0=function(e){return Os.some(function(o){return!!(o.options.allowTouchMove&&o.options.allowTouchMove(e))})},od=function(e){var o=e||window.event;return L0(o.target)||o.touches.length>1?!0:(o.preventDefault&&o.preventDefault(),!1)},BA=function(e){if(gl===void 0){var o=!!e&&e.reserveScrollBarGap===!0,n=window.innerWidth-document.documentElement.clientWidth;if(o&&n>0){var r=parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right"),10);gl=document.body.style.paddingRight,document.body.style.paddingRight=r+n+"px"}}hl===void 0&&(hl=document.body.style.overflow,document.body.style.overflow="hidden")},VA=function(){gl!==void 0&&(document.body.style.paddingRight=gl,gl=void 0),hl!==void 0&&(document.body.style.overflow=hl,hl=void 0)},GA=function(){return window.requestAnimationFrame(function(){if(js===void 0){js={position:document.body.style.position,top:document.body.style.top,left:document.body.style.left};var e=window,o=e.scrollY,n=e.scrollX,r=e.innerHeight;document.body.style.position="fixed",document.body.style.top=-o,document.body.style.left=-n,setTimeout(function(){return window.requestAnimationFrame(function(){var s=r-window.innerHeight;s&&o>=r&&(document.body.style.top=-(o+s))})},300)}})},WA=function(){if(js!==void 0){var e=-parseInt(document.body.style.top,10),o=-parseInt(document.body.style.left,10);document.body.style.position=js.position,document.body.style.top=js.top,document.body.style.left=js.left,window.scrollTo(o,e),js=void 0}},HA=function(e){return e?e.scrollHeight-e.scrollTop<=e.clientHeight:!1},zA=function(e,o){var n=e.targetTouches[0].clientY-N0;return L0(e.target)?!1:o&&o.scrollTop===0&&n>0||HA(o)&&n<0?od(e):(e.stopPropagation(),!0)},$0=function(e,o){if(!e){console.error("disableBodyScroll unsuccessful - targetElement must be provided when calling disableBodyScroll on IOS devices.");return}if(!Os.some(function(r){return r.targetElement===e})){var n={targetElement:e,options:o||{}};Os=[].concat(MA(Os),[n]),ed?GA():BA(o),ed&&(e.ontouchstart=function(r){r.targetTouches.length===1&&(N0=r.targetTouches[0].clientY)},e.ontouchmove=function(r){r.targetTouches.length===1&&zA(r,e)},td||(document.addEventListener("touchmove",od,Np?{passive:!1}:void 0),td=!0))}};var k0=function(e){if(!e){console.error("enableBodyScroll unsuccessful - targetElement must be provided when calling enableBodyScroll on IOS devices.");return}Os=Os.filter(function(o){return o.targetElement!==e}),ed&&(e.ontouchstart=null,e.ontouchmove=null,td&&Os.length===0&&(document.removeEventListener("touchmove",od,Np?{passive:!1}:void 0),td=!1)),ed?WA():VA()};var j0=({classPrefix:t,zIndex:e})=>{let o=t?`${t}__`:"";return`
14
- .${o}${hn} {
13
+ import{a as zf,b as W,c as Xf,d as It,e as SD,f as ID,g as Uf,h as RD,i as _D}from"./chunk-QPA2ZA5J.js";import{a as pt,b as ol,c as Hf,d as $,e as Ni,f as fv,g as pv,h as Ts,i as wu,j as wD,k as hv,l as DD,m as FD,n as AD}from"./chunk-OA4JPMVI.js";import{c as Sr,d as mv,e as As}from"./chunk-5LKBKI4T.js";var Rv=Sr(bt=>{"use strict";function qf(t,e){var o=t.length;t.push(e);e:for(;0<o;){var n=o-1>>>1,r=t[n];if(0<Su(r,e))t[n]=e,t[o]=r,o=n;else break e}}function Ir(t){return t.length===0?null:t[0]}function Ru(t){if(t.length===0)return null;var e=t[0],o=t.pop();if(o!==e){t[0]=o;e:for(var n=0,r=t.length,s=r>>>1;n<s;){var i=2*(n+1)-1,l=t[i],a=i+1,c=t[a];if(0>Su(l,o))a<r&&0>Su(c,l)?(t[n]=c,t[a]=o,n=a):(t[n]=l,t[i]=o,n=i);else if(a<r&&0>Su(c,o))t[n]=c,t[a]=o,n=a;else break e}}return e}function Su(t,e){var o=t.sortIndex-e.sortIndex;return o!==0?o:t.id-e.id}bt.unstable_now=void 0;typeof performance=="object"&&typeof performance.now=="function"?(gv=performance,bt.unstable_now=function(){return gv.now()}):(Yf=Date,bv=Yf.now(),bt.unstable_now=function(){return Yf.now()-bv});var gv,Yf,bv,Zr=[],Hn=[],TD=1,lr=null,yo=3,_u=!1,Es=!1,nl=!1,yv=typeof setTimeout=="function"?setTimeout:null,Cv=typeof clearTimeout=="function"?clearTimeout:null,vv=typeof setImmediate<"u"?setImmediate:null;function Iu(t){for(var e=Ir(Hn);e!==null;){if(e.callback===null)Ru(Hn);else if(e.startTime<=t)Ru(Hn),e.sortIndex=e.expirationTime,qf(Zr,e);else break;e=Ir(Hn)}}function Qf(t){if(nl=!1,Iu(t),!Es)if(Ir(Zr)!==null)Es=!0,Kf();else{var e=Ir(Hn);e!==null&&ep(Qf,e.startTime-t)}}var Du=!1,sl=-1,wv=5,Sv=-1;function Iv(){return!(bt.unstable_now()-Sv<wv)}function Zf(){if(Du){var t=bt.unstable_now();Sv=t;var e=!0;try{e:{Es=!1,nl&&(nl=!1,Cv(sl),sl=-1),_u=!0;var o=yo;try{t:{for(Iu(t),lr=Ir(Zr);lr!==null&&!(lr.expirationTime>t&&Iv());){var n=lr.callback;if(typeof n=="function"){lr.callback=null,yo=lr.priorityLevel;var r=n(lr.expirationTime<=t);if(t=bt.unstable_now(),typeof r=="function"){lr.callback=r,Iu(t),e=!0;break t}lr===Ir(Zr)&&Ru(Zr),Iu(t)}else Ru(Zr);lr=Ir(Zr)}if(lr!==null)e=!0;else{var s=Ir(Hn);s!==null&&ep(Qf,s.startTime-t),e=!1}}break e}finally{lr=null,yo=o,_u=!1}e=void 0}}finally{e?rl():Du=!1}}}var rl;typeof vv=="function"?rl=function(){vv(Zf)}:typeof MessageChannel<"u"?(Jf=new MessageChannel,xv=Jf.port2,Jf.port1.onmessage=Zf,rl=function(){xv.postMessage(null)}):rl=function(){yv(Zf,0)};var Jf,xv;function Kf(){Du||(Du=!0,rl())}function ep(t,e){sl=yv(function(){t(bt.unstable_now())},e)}bt.unstable_IdlePriority=5;bt.unstable_ImmediatePriority=1;bt.unstable_LowPriority=4;bt.unstable_NormalPriority=3;bt.unstable_Profiling=null;bt.unstable_UserBlockingPriority=2;bt.unstable_cancelCallback=function(t){t.callback=null};bt.unstable_continueExecution=function(){Es||_u||(Es=!0,Kf())};bt.unstable_forceFrameRate=function(t){0>t||125<t?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):wv=0<t?Math.floor(1e3/t):5};bt.unstable_getCurrentPriorityLevel=function(){return yo};bt.unstable_getFirstCallbackNode=function(){return Ir(Zr)};bt.unstable_next=function(t){switch(yo){case 1:case 2:case 3:var e=3;break;default:e=yo}var o=yo;yo=e;try{return t()}finally{yo=o}};bt.unstable_pauseExecution=function(){};bt.unstable_requestPaint=function(){};bt.unstable_runWithPriority=function(t,e){switch(t){case 1:case 2:case 3:case 4:case 5:break;default:t=3}var o=yo;yo=t;try{return e()}finally{yo=o}};bt.unstable_scheduleCallback=function(t,e,o){var n=bt.unstable_now();switch(typeof o=="object"&&o!==null?(o=o.delay,o=typeof o=="number"&&0<o?n+o:n):o=n,t){case 1:var r=-1;break;case 2:r=250;break;case 5:r=1073741823;break;case 4:r=1e4;break;default:r=5e3}return r=o+r,t={id:TD++,callback:e,priorityLevel:t,startTime:o,expirationTime:r,sortIndex:-1},o>n?(t.sortIndex=o,qf(Hn,t),Ir(Zr)===null&&t===Ir(Hn)&&(nl?(Cv(sl),sl=-1):nl=!0,ep(Qf,o-n))):(t.sortIndex=r,qf(Zr,t),Es||_u||(Es=!0,Kf())),t};bt.unstable_shouldYield=Iv;bt.unstable_wrapCallback=function(t){var e=yo;return function(){var o=yo;yo=e;try{return t.apply(this,arguments)}finally{yo=o}}}});var Dv=Sr((eH,_v)=>{"use strict";_v.exports=Rv()});var wC=Sr(mt=>{"use strict";var co=typeof Symbol=="function"&&Symbol.for,Eh=co?Symbol.for("react.element"):60103,Ph=co?Symbol.for("react.portal"):60106,Od=co?Symbol.for("react.fragment"):60107,Md=co?Symbol.for("react.strict_mode"):60108,Bd=co?Symbol.for("react.profiler"):60114,Vd=co?Symbol.for("react.provider"):60109,Gd=co?Symbol.for("react.context"):60110,Nh=co?Symbol.for("react.async_mode"):60111,Wd=co?Symbol.for("react.concurrent_mode"):60111,Hd=co?Symbol.for("react.forward_ref"):60112,zd=co?Symbol.for("react.suspense"):60113,d6=co?Symbol.for("react.suspense_list"):60120,Xd=co?Symbol.for("react.memo"):60115,Ud=co?Symbol.for("react.lazy"):60116,m6=co?Symbol.for("react.block"):60121,f6=co?Symbol.for("react.fundamental"):60117,p6=co?Symbol.for("react.responder"):60118,h6=co?Symbol.for("react.scope"):60119;function tr(t){if(typeof t=="object"&&t!==null){var e=t.$$typeof;switch(e){case Eh:switch(t=t.type,t){case Nh:case Wd:case Od:case Bd:case Md:case zd:return t;default:switch(t=t&&t.$$typeof,t){case Gd:case Hd:case Ud:case Xd:case Vd:return t;default:return e}}case Ph:return e}}}function CC(t){return tr(t)===Wd}mt.AsyncMode=Nh;mt.ConcurrentMode=Wd;mt.ContextConsumer=Gd;mt.ContextProvider=Vd;mt.Element=Eh;mt.ForwardRef=Hd;mt.Fragment=Od;mt.Lazy=Ud;mt.Memo=Xd;mt.Portal=Ph;mt.Profiler=Bd;mt.StrictMode=Md;mt.Suspense=zd;mt.isAsyncMode=function(t){return CC(t)||tr(t)===Nh};mt.isConcurrentMode=CC;mt.isContextConsumer=function(t){return tr(t)===Gd};mt.isContextProvider=function(t){return tr(t)===Vd};mt.isElement=function(t){return typeof t=="object"&&t!==null&&t.$$typeof===Eh};mt.isForwardRef=function(t){return tr(t)===Hd};mt.isFragment=function(t){return tr(t)===Od};mt.isLazy=function(t){return tr(t)===Ud};mt.isMemo=function(t){return tr(t)===Xd};mt.isPortal=function(t){return tr(t)===Ph};mt.isProfiler=function(t){return tr(t)===Bd};mt.isStrictMode=function(t){return tr(t)===Md};mt.isSuspense=function(t){return tr(t)===zd};mt.isValidElementType=function(t){return typeof t=="string"||typeof t=="function"||t===Od||t===Wd||t===Bd||t===Md||t===zd||t===d6||typeof t=="object"&&t!==null&&(t.$$typeof===Ud||t.$$typeof===Xd||t.$$typeof===Vd||t.$$typeof===Gd||t.$$typeof===Hd||t.$$typeof===f6||t.$$typeof===p6||t.$$typeof===h6||t.$$typeof===m6)};mt.typeOf=tr});var IC=Sr((Hse,SC)=>{"use strict";SC.exports=wC()});var EC=Sr((zse,TC)=>{"use strict";var Lh=IC(),g6={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},b6={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},v6={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},FC={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},$h={};$h[Lh.ForwardRef]=v6;$h[Lh.Memo]=FC;function RC(t){return Lh.isMemo(t)?FC:$h[t.$$typeof]||g6}var x6=Object.defineProperty,y6=Object.getOwnPropertyNames,_C=Object.getOwnPropertySymbols,C6=Object.getOwnPropertyDescriptor,w6=Object.getPrototypeOf,DC=Object.prototype;function AC(t,e,o){if(typeof e!="string"){if(DC){var n=w6(e);n&&n!==DC&&AC(t,n,o)}var r=y6(e);_C&&(r=r.concat(_C(e)));for(var s=RC(t),i=RC(e),l=0;l<r.length;++l){var a=r[l];if(!b6[a]&&!(o&&o[a])&&!(i&&i[a])&&!(s&&s[a])){var c=C6(e,a);try{x6(t,a,c)}catch{}}}}return t}TC.exports=AC});var hg=Sr((Due,z2)=>{var pg=Math.floor(Math.random()*16777215),B2=ht.index=parseInt(Math.random()*16777215,10),V2=(typeof process>"u"||typeof process.pid!="number"?Math.floor(Math.random()*1e5):process.pid)%65535,G2=(()=>{try{return _Buffer}catch{try{return Buffer}catch{return null}}})(),cm=function(t){return!!(t!=null&&t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t))},H2=[];for(Go=0;Go<256;Go++)H2[Go]=(Go<=15?"0":"")+Go.toString(16);var Go,W2=new RegExp("^[0-9a-fA-F]{24}$"),rc=[];Go=0;for(;Go<10;)rc[48+Go]=Go++;for(;Go<16;)rc[55+Go]=rc[87+Go]=Go++;function ht(t){if(!(this instanceof ht))return new ht(t);if(t&&(t instanceof ht||t._bsontype==="ObjectID"))return t;if(this._bsontype="ObjectID",t==null||typeof t=="number"){this.id=this.generate(t);return}var e=ht.isValid(t);if(!e&&t!=null)throw new Error("Argument passed in must be a single String of 12 bytes or a string of 24 hex characters");if(e&&typeof t=="string"&&t.length===24)return ht.createFromHexString(t);if(t!=null&&t.length===12)this.id=t;else{if(t!=null&&typeof t.toHexString=="function")return t;throw new Error("Argument passed in must be a single String of 12 bytes or a string of 24 hex characters")}}z2.exports=ht;ht.default=ht;ht.createFromTime=function(t){return t=parseInt(t,10)%4294967295,new ht(g9(8,t)+"0000000000000000")};ht.createFromHexString=function(t){if(typeof t>"u"||t!=null&&t.length!==24)throw new Error("Argument passed in must be a single String of 12 bytes or a string of 24 hex characters");for(var e="",o=0;o<24;)e+=String.fromCharCode(rc[t.charCodeAt(o++)]<<4|rc[t.charCodeAt(o++)]);return new ht(e)};ht.isValid=function(t){return t==null?!1:typeof t=="number"?!0:typeof t=="string"?t.length===12||t.length===24&&W2.test(t):t instanceof ht?!0:cm(t)?ht.isValid(t.toString("hex")):typeof t.toHexString=="function"&&G2&&(t.id instanceof G2||typeof t.id=="string")?t.id.length===12||t.id.length===24&&W2.test(t.id):!1};ht.prototype={constructor:ht,toHexString:function(){if(!this.id||!this.id.length)throw new Error("invalid ObjectId, ObjectId.id must be either a string or a Buffer, but is ["+JSON.stringify(this.id)+"]");if(this.id.length===24)return this.id;if(cm(this.id))return this.id.toString("hex");for(var t="",e=0;e<this.id.length;e++)t+=H2[this.id.charCodeAt(e)];return t},equals:function(t){return t instanceof ht?this.toString()===t.toString():typeof t=="string"&&ht.isValid(t)&&t.length===12&&cm(this.id)?t===this.id.toString("binary"):typeof t=="string"&&ht.isValid(t)&&t.length===24?t.toLowerCase()===this.toHexString():typeof t=="string"&&ht.isValid(t)&&t.length===12?t===this.id:t!=null&&(t instanceof ht||t.toHexString)?t.toHexString()===this.toHexString():!1},getTimestamp:function(){var t=new Date,e;return cm(this.id)?e=this.id[3]|this.id[2]<<8|this.id[1]<<16|this.id[0]<<24:e=this.id.charCodeAt(3)|this.id.charCodeAt(2)<<8|this.id.charCodeAt(1)<<16|this.id.charCodeAt(0)<<24,t.setTime(Math.floor(e)*1e3),t},generate:function(t){typeof t!="number"&&(t=~~(Date.now()/1e3)),t=parseInt(t,10)%4294967295;var e=h9();return String.fromCharCode(t>>24&255,t>>16&255,t>>8&255,t&255,pg>>16&255,pg>>8&255,pg&255,V2>>8&255,V2&255,e>>16&255,e>>8&255,e&255)}};function h9(){return B2=(B2+1)%16777215}function g9(t,e){return e=e.toString(16),e.length===t?e:"00000000".substring(e.length,t)+e}var b9=Symbol&&Symbol.for&&Symbol.for("nodejs.util.inspect.custom")||"inspect";ht.prototype[b9]=function(){return"ObjectID("+this+")"};ht.prototype.toJSON=ht.prototype.toHexString;ht.prototype.toString=ht.prototype.toHexString});var ob=Sr((Bve,CS)=>{function tb(t){return t===void 0}function hk(t){return t===null}function gk(t){return typeof t=="boolean"}function Lm(t){return t===Object(t)}function xS(t){return Array.isArray(t)}function bk(t){return t instanceof Date}function yS(t,e){return e?Lm(t)&&!tb(t.uri):Lm(t)&&typeof t.size=="number"&&typeof t.type=="string"&&typeof t.slice=="function"}function vk(t,e){return yS(t,e)&&typeof t.name=="string"&&(Lm(t.lastModifiedDate)||typeof t.lastModified=="number")}function di(t){return tb(t)?!1:t}function eb(t,e,o,n){e=e||{},o=o||new FormData,e.indices=di(e.indices),e.nullsAsUndefineds=di(e.nullsAsUndefineds),e.booleansAsIntegers=di(e.booleansAsIntegers),e.allowEmptyArrays=di(e.allowEmptyArrays),e.noAttributesWithArrayNotation=di(e.noAttributesWithArrayNotation),e.noFilesWithArrayNotation=di(e.noFilesWithArrayNotation),e.dotsForObjectNotation=di(e.dotsForObjectNotation);let r=typeof o.getParts=="function";return tb(t)||(hk(t)?e.nullsAsUndefineds||o.append(n,""):gk(t)?e.booleansAsIntegers?o.append(n,t?1:0):o.append(n,t):xS(t)?t.length?t.forEach((s,i)=>{let l=n+"["+(e.indices?i:"")+"]";(e.noAttributesWithArrayNotation||e.noFilesWithArrayNotation&&vk(s,r))&&(l=n),eb(s,e,o,l)}):e.allowEmptyArrays&&o.append(e.noAttributesWithArrayNotation?n:n+"[]",""):bk(t)?o.append(n,t.toISOString()):Lm(t)&&!yS(t,r)?Object.keys(t).forEach(s=>{let i=t[s];if(xS(i))for(;s.length>2&&s.lastIndexOf("[]")===s.length-2;)s=s.substring(0,s.length-2);let l=n?e.dotsForObjectNotation?n+"."+s:n+"["+s+"]":s;eb(i,e,o,l)}):o.append(n,t)),o}CS.exports={serialize:eb}});var C4=Sr((HFe,y4)=>{(function(){var t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",e={rotl:function(o,n){return o<<n|o>>>32-n},rotr:function(o,n){return o<<32-n|o>>>n},endian:function(o){if(o.constructor==Number)return e.rotl(o,8)&16711935|e.rotl(o,24)&4278255360;for(var n=0;n<o.length;n++)o[n]=e.endian(o[n]);return o},randomBytes:function(o){for(var n=[];o>0;o--)n.push(Math.floor(Math.random()*256));return n},bytesToWords:function(o){for(var n=[],r=0,s=0;r<o.length;r++,s+=8)n[s>>>5]|=o[r]<<24-s%32;return n},wordsToBytes:function(o){for(var n=[],r=0;r<o.length*32;r+=8)n.push(o[r>>>5]>>>24-r%32&255);return n},bytesToHex:function(o){for(var n=[],r=0;r<o.length;r++)n.push((o[r]>>>4).toString(16)),n.push((o[r]&15).toString(16));return n.join("")},hexToBytes:function(o){for(var n=[],r=0;r<o.length;r+=2)n.push(parseInt(o.substr(r,2),16));return n},bytesToBase64:function(o){for(var n=[],r=0;r<o.length;r+=3)for(var s=o[r]<<16|o[r+1]<<8|o[r+2],i=0;i<4;i++)r*8+i*6<=o.length*8?n.push(t.charAt(s>>>6*(3-i)&63)):n.push("=");return n.join("")},base64ToBytes:function(o){o=o.replace(/[^A-Z0-9+\/]/ig,"");for(var n=[],r=0,s=0;r<o.length;s=++r%4)s!=0&&n.push((t.indexOf(o.charAt(r-1))&Math.pow(2,-2*s+8)-1)<<s*2|t.indexOf(o.charAt(r))>>>6-s*2);return n}};y4.exports=e})()});var zb=Sr((zFe,w4)=>{var Hb={utf8:{stringToBytes:function(t){return Hb.bin.stringToBytes(unescape(encodeURIComponent(t)))},bytesToString:function(t){return decodeURIComponent(escape(Hb.bin.bytesToString(t)))}},bin:{stringToBytes:function(t){for(var e=[],o=0;o<t.length;o++)e.push(t.charCodeAt(o)&255);return e},bytesToString:function(t){for(var e=[],o=0;o<t.length;o++)e.push(String.fromCharCode(t[o]));return e.join("")}}};w4.exports=Hb});var R4=Sr((XFe,I4)=>{I4.exports=function(t){return t!=null&&(S4(t)||AB(t)||!!t._isBuffer)};function S4(t){return!!t.constructor&&typeof t.constructor.isBuffer=="function"&&t.constructor.isBuffer(t)}function AB(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&S4(t.slice(0,0))}});var D4=Sr((UFe,_4)=>{(function(){var t=C4(),e=zb().utf8,o=R4(),n=zb().bin,r=function(s,i){s.constructor==String?i&&i.encoding==="binary"?s=n.stringToBytes(s):s=e.stringToBytes(s):o(s)?s=Array.prototype.slice.call(s,0):!Array.isArray(s)&&s.constructor!==Uint8Array&&(s=s.toString());for(var l=t.bytesToWords(s),a=s.length*8,c=1732584193,u=-271733879,d=-1732584194,f=271733878,m=0;m<l.length;m++)l[m]=(l[m]<<8|l[m]>>>24)&16711935|(l[m]<<24|l[m]>>>8)&4278255360;l[a>>>5]|=128<<a%32,l[(a+64>>>9<<4)+14]=a;for(var h=r._ff,p=r._gg,g=r._hh,b=r._ii,m=0;m<l.length;m+=16){var v=c,x=u,y=d,C=f;c=h(c,u,d,f,l[m+0],7,-680876936),f=h(f,c,u,d,l[m+1],12,-389564586),d=h(d,f,c,u,l[m+2],17,606105819),u=h(u,d,f,c,l[m+3],22,-1044525330),c=h(c,u,d,f,l[m+4],7,-176418897),f=h(f,c,u,d,l[m+5],12,1200080426),d=h(d,f,c,u,l[m+6],17,-1473231341),u=h(u,d,f,c,l[m+7],22,-45705983),c=h(c,u,d,f,l[m+8],7,1770035416),f=h(f,c,u,d,l[m+9],12,-1958414417),d=h(d,f,c,u,l[m+10],17,-42063),u=h(u,d,f,c,l[m+11],22,-1990404162),c=h(c,u,d,f,l[m+12],7,1804603682),f=h(f,c,u,d,l[m+13],12,-40341101),d=h(d,f,c,u,l[m+14],17,-1502002290),u=h(u,d,f,c,l[m+15],22,1236535329),c=p(c,u,d,f,l[m+1],5,-165796510),f=p(f,c,u,d,l[m+6],9,-1069501632),d=p(d,f,c,u,l[m+11],14,643717713),u=p(u,d,f,c,l[m+0],20,-373897302),c=p(c,u,d,f,l[m+5],5,-701558691),f=p(f,c,u,d,l[m+10],9,38016083),d=p(d,f,c,u,l[m+15],14,-660478335),u=p(u,d,f,c,l[m+4],20,-405537848),c=p(c,u,d,f,l[m+9],5,568446438),f=p(f,c,u,d,l[m+14],9,-1019803690),d=p(d,f,c,u,l[m+3],14,-187363961),u=p(u,d,f,c,l[m+8],20,1163531501),c=p(c,u,d,f,l[m+13],5,-1444681467),f=p(f,c,u,d,l[m+2],9,-51403784),d=p(d,f,c,u,l[m+7],14,1735328473),u=p(u,d,f,c,l[m+12],20,-1926607734),c=g(c,u,d,f,l[m+5],4,-378558),f=g(f,c,u,d,l[m+8],11,-2022574463),d=g(d,f,c,u,l[m+11],16,1839030562),u=g(u,d,f,c,l[m+14],23,-35309556),c=g(c,u,d,f,l[m+1],4,-1530992060),f=g(f,c,u,d,l[m+4],11,1272893353),d=g(d,f,c,u,l[m+7],16,-155497632),u=g(u,d,f,c,l[m+10],23,-1094730640),c=g(c,u,d,f,l[m+13],4,681279174),f=g(f,c,u,d,l[m+0],11,-358537222),d=g(d,f,c,u,l[m+3],16,-722521979),u=g(u,d,f,c,l[m+6],23,76029189),c=g(c,u,d,f,l[m+9],4,-640364487),f=g(f,c,u,d,l[m+12],11,-421815835),d=g(d,f,c,u,l[m+15],16,530742520),u=g(u,d,f,c,l[m+2],23,-995338651),c=b(c,u,d,f,l[m+0],6,-198630844),f=b(f,c,u,d,l[m+7],10,1126891415),d=b(d,f,c,u,l[m+14],15,-1416354905),u=b(u,d,f,c,l[m+5],21,-57434055),c=b(c,u,d,f,l[m+12],6,1700485571),f=b(f,c,u,d,l[m+3],10,-1894986606),d=b(d,f,c,u,l[m+10],15,-1051523),u=b(u,d,f,c,l[m+1],21,-2054922799),c=b(c,u,d,f,l[m+8],6,1873313359),f=b(f,c,u,d,l[m+15],10,-30611744),d=b(d,f,c,u,l[m+6],15,-1560198380),u=b(u,d,f,c,l[m+13],21,1309151649),c=b(c,u,d,f,l[m+4],6,-145523070),f=b(f,c,u,d,l[m+11],10,-1120210379),d=b(d,f,c,u,l[m+2],15,718787259),u=b(u,d,f,c,l[m+9],21,-343485551),c=c+v>>>0,u=u+x>>>0,d=d+y>>>0,f=f+C>>>0}return t.endian([c,u,d,f])};r._ff=function(s,i,l,a,c,u,d){var f=s+(i&l|~i&a)+(c>>>0)+d;return(f<<u|f>>>32-u)+i},r._gg=function(s,i,l,a,c,u,d){var f=s+(i&a|l&~a)+(c>>>0)+d;return(f<<u|f>>>32-u)+i},r._hh=function(s,i,l,a,c,u,d){var f=s+(i^l^a)+(c>>>0)+d;return(f<<u|f>>>32-u)+i},r._ii=function(s,i,l,a,c,u,d){var f=s+(l^(i|~a))+(c>>>0)+d;return(f<<u|f>>>32-u)+i},r._blocksize=16,r._digestsize=16,_4.exports=function(s,i){if(s==null)throw new Error("Illegal argument "+s);var l=t.wordsToBytes(r(s,i));return i&&i.asBytes?l:i&&i.asString?n.bytesToString(l):t.bytesToHex(l)}})()});import{jsx as ap}from"react/jsx-runtime";import"react";function oe({CustomComponent:t,Fallback:e}){return t!==void 0?t:e}import{jsx as WD}from"react/jsx-runtime";import Ev from"react";import{createContext as zn,use as Xn}from"react";var il=As(Dv(),1);import{createElement as ED,createContext as PD,useContext as ND,useEffect as LD,useLayoutEffect as $D,useReducer as kD,useRef as tp,useState as jD}from"react";var Fu=Symbol(),OD=Symbol(),MD=typeof window>"u"||/ServerSideRendering/.test(window.navigator&&window.navigator.userAgent),Fv=MD?LD:$D,BD=il.unstable_runWithPriority?t=>{try{(0,il.unstable_runWithPriority)(il.unstable_NormalPriority,t)}catch(e){if(e.message==="Not implemented.")t();else throw e}}:t=>t(),VD=t=>({value:o,children:n})=>{let r=tp(o),s=tp(0),[i,l]=jD(null);i&&(i(o),l(null));let a=tp();if(!a.current){let c=new Set,u=(d,f)=>{s.current+=1;let m={n:s.current};f?.suspense&&(m.n*=-1,m.p=new Promise(h=>{l(()=>p=>{m.v=p,delete m.p,h(p)})})),c.forEach(h=>h(m)),d()};a.current={[Fu]:{v:r,n:s,l:c,u}}}return Fv(()=>{r.current=o,s.current+=1,BD(()=>{a.current[Fu].l.forEach(c=>{c({n:s.current,v:o})})})},[o]),ED(t,{value:a.current},n)},GD=t=>t;function Av(t){let e=PD({[Fu]:{v:{current:t},n:{current:-1},l:new Set,u:o=>o()}});return e[OD]=e.Provider,e.Provider=VD(e.Provider),delete e.Consumer,e}function op(t,e){let o=ND(t)[Fu],{v:{current:n},n:{current:r},l:s}=o,i=e(n),[l,a]=kD((c,u)=>{if(!u)return[n,i];if("p"in u)throw u.p;if(u.n===r)return Object.is(c[1],i)?c:[n,i];try{if("v"in u){if(Object.is(c[0],u.v))return c;let d=e(u.v);return Object.is(c[1],d)?c:[u.v,d]}}catch{}return[...c]},[n,i]);return Object.is(l[1],i)||a(),Fv(()=>(s.add(a),()=>{s.delete(a)}),[s]),l[1]}function Tv(t){return op(t,GD)}var Au=zn({}),Tu=zn({}),Eu=zn({}),Pu=zn(!1),Nu=zn(!1),rp=zn(!1),Lu=zn(!1),np=zn(!1),al=Av([{},()=>null]),Me=()=>Xn(Au),Li=()=>Xn(Tu),$u=()=>Xn(Eu),Xt=()=>Xn(Pu),cr=()=>Xn(Nu),sp=()=>Xn(rp),Ut=()=>Xn(Lu),Ps=()=>Xn(np),Nt=t=>op(al,t),$i=()=>Tv(al);var Pv=Ev.createContext({data:{},path:"",rowNumber:void 0}),ip=({children:t,path:e,rowNumber:o})=>{"use no memo";let{getDataByPath:n,getSiblingData:r}=$u(),s=r(e),l=n(e)||s;return WD(Pv,{value:{data:l,path:e,rowNumber:o},children:t})},HD=()=>Ev.use(Pv);var zD="row-label",mn=t=>{let{className:e,CustomComponent:o,label:n,path:r,rowNumber:s}=t;return ap(ip,{path:r,rowNumber:s,children:ap(oe,{CustomComponent:o,Fallback:typeof n=="string"?ap("span",{className:[zD,e].filter(Boolean).join(" "),style:{pointerEvents:"none"},children:n}):n})})};import{c as aM}from"react/compiler-runtime";import{jsx as mo,jsxs as yi}from"react/jsx-runtime";import{getTranslation as Tb}from"@payloadcms/translations";import lM from"react";import{jsx as up,jsxs as rF}from"react/jsx-runtime";import Ov from"react";import{jsx as KD}from"react/jsx-runtime";import jv from"next/link.js";import{useRouter as eF}from"next/navigation.js";import"react";import{c as XD}from"react/compiler-runtime";import{jsx as UD}from"react/jsx-runtime";import lp,{startTransition as YD,useEffect as ZD,useOptimistic as JD,useRef as Nv}from"react";var cp=t=>{let e=XD(11),{children:o}=t,[n,r]=JD(!1),[s,i]=lp.useState(0),l=Nv(s),a=Nv(null),c;e[0]===Symbol.for("react.memo_cache_sentinel")?(c=()=>{a.current=setInterval(()=>{let g=l.current+(.93-l.current)*Math.random()*.2*Math.pow(Math.log(1+(1-l.current)*.75),.75);i(g),l.current=g},250)},e[0]=c):c=e[0];let u=c,d,f;e[1]!==n?(d=()=>{i(0),l.current=0,n?u():a.current&&clearInterval(a.current)},f=[n,u],e[1]=n,e[2]=d,e[3]=f):(d=e[2],f=e[3]),ZD(d,f);let m;e[4]!==r?(m=g=>{YD(()=>{r(!0),typeof g=="function"&&g()})},e[4]=r,e[5]=m):m=e[5];let h=m,p;return e[6]!==o||e[7]!==n||e[8]!==h||e[9]!==s?(p=UD(Lv,{value:{isTransitioning:n,startRouteTransition:h,transitionProgress:s},children:o}),e[6]=o,e[7]=n,e[8]=h,e[9]=s,e[10]=p):p=e[10],p},Lv=lp.createContext({isTransitioning:!1,startRouteTransition:()=>{},transitionProgress:0}),st=()=>lp.use(Lv);var qD=/https?|ftp|gopher|file/;function $v(t){return typeof t=="string"||typeof t=="number"&&!isNaN(t)||typeof t=="boolean"?String(t):""}function QD(t){let e=new URLSearchParams;return Object.entries(t).forEach(([o,n])=>{Array.isArray(n)?n.forEach(r=>e.append(o,$v(r))):e.set(o,$v(n))}),e}function kv(t){let{auth:e}=t,{hostname:o}=t,n=t.protocol||"",r=t.pathname||"",s=t.hash||"",i=t.query||"",l=!1;e=e?encodeURIComponent(e).replace(/%3A/i,":")+"@":"",t.host?l=e+t.host:o&&(l=e+(~o.indexOf(":")?`[${o}]`:o),t.port&&(l+=":"+t.port)),i&&typeof i=="object"&&(i=String(QD(i)));let a=t.search||i&&`?${i}`||"";return n&&!n.endsWith(":")&&(n+=":"),t.slashes||(!n||qD.test(n))&&l!==!1?(l="//"+(l||""),r&&r[0]!=="/"&&(r="/"+r)):l||(l=""),s&&s[0]!=="#"&&(s="#"+s),a&&a[0]!=="?"&&(a="?"+a),r=r.replace(/[?#]/g,encodeURIComponent),a=a.replace("#","%23"),`${n}${l}${r}${a}${s}`}var tF=jv.default||jv;function oF(t){let o=t.currentTarget.getAttribute("target");return o&&o!=="_self"||t.metaKey||t.ctrlKey||t.shiftKey||t.altKey||t.nativeEvent&&t.nativeEvent.which===2}var Yt=({children:t,href:e,onClick:o,preventDefault:n=!0,ref:r,replace:s,scroll:i,...l})=>{let a=eF(),{startRouteTransition:c}=st();return KD(tF,{href:e,onClick:u=>{oF(u)||(o&&o(u),n&&u.preventDefault(),c(()=>{let d=typeof e=="string"?e:kv(e);s?a.replace(d,{scroll:i}):a.push(d,{scroll:i})}))},ref:r,...l,children:t})};var Ns="banner",Rr=({type:t="default",alignIcon:e="right",children:o,className:n,icon:r,onClick:s,to:i})=>{let l=[Ns,`${Ns}--type-${t}`,n&&n,i&&`${Ns}--has-link`,(i||s)&&`${Ns}--has-action`,r&&`${Ns}--has-icon`,r&&`${Ns}--align-icon-${e}`].filter(Boolean).join(" "),a="div";return s&&!i&&(a="button"),i&&(a=Yt),rF(a,{className:l,href:i||null,onClick:s,children:[r&&e==="left"&&up(Ov.Fragment,{children:r}),up("span",{className:`${Ns}__content`,children:o}),r&&e==="right"&&up(Ov.Fragment,{children:r})]})};import{jsx as Yo,jsxs as Vu}from"react/jsx-runtime";import wF,{Fragment as SF,isValidElement as IF}from"react";import{jsx as Mv}from"react/jsx-runtime";import"react";var Ze=({ariaLabel:t,className:e,direction:o,size:n})=>Mv("svg",{"aria-label":t,className:["icon icon--chevron",e,n&&`icon--size-${n}`].filter(Boolean).join(" "),height:"100%",style:{transform:o==="left"?"rotate(90deg)":o==="right"?"rotate(-90deg)":o==="up"?"rotate(180deg)":void 0},viewBox:"0 0 20 20",width:"100%",xmlns:"http://www.w3.org/2000/svg",children:Mv("path",{className:"stroke",d:"M14 8L10 12L6 8",strokeLinecap:"square"})});import{jsx as Bv}from"react/jsx-runtime";import"react";var _r=({className:t})=>Bv("svg",{className:[t,"icon icon--edit"].filter(Boolean).join(" "),viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:Bv("path",{className:"stroke",d:"M9.68531 4.62938H5.2634C4.92833 4.62938 4.60698 4.76248 4.37004 4.99942C4.13311 5.23635 4 5.5577 4 5.89278V14.7366C4 15.0717 4.13311 15.393 4.37004 15.63C4.60698 15.8669 4.92833 16 5.2634 16H14.1072C14.4423 16 14.7636 15.8669 15.0006 15.63C15.2375 15.393 15.3706 15.0717 15.3706 14.7366V10.3147M13.7124 4.39249C13.9637 4.14118 14.3046 4 14.66 4C15.0154 4 15.3562 4.14118 15.6075 4.39249C15.8588 4.6438 16 4.98464 16 5.34004C16 5.69544 15.8588 6.03629 15.6075 6.28759L9.91399 11.9817C9.76399 12.1316 9.57868 12.2413 9.37515 12.3008L7.56027 12.8314C7.50591 12.8472 7.44829 12.8482 7.39344 12.8341C7.33859 12.8201 7.28853 12.7915 7.24849 12.7515C7.20845 12.7115 7.17991 12.6614 7.16586 12.6066C7.15181 12.5517 7.15276 12.4941 7.16861 12.4397L7.69924 10.6249C7.75896 10.4215 7.86888 10.2364 8.01888 10.0866L13.7124 4.39249Z",strokeLinecap:"square"})});import{jsx as Vv}from"react/jsx-runtime";import"react";var dp=()=>Vv("svg",{"aria-hidden":"true",className:"graphic link icon icon--link",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:Vv("path",{className:"stroke",d:"M7.99999 13.3333H6.66666C5.78261 13.3333 4.93476 12.9821 4.30964 12.357C3.68452 11.7319 3.33333 10.884 3.33333 9.99999C3.33333 9.11593 3.68452 8.26809 4.30964 7.64297C4.93476 7.01785 5.78261 6.66666 6.66666 6.66666H7.99999M12 6.66666H13.3333C14.2174 6.66666 15.0652 7.01785 15.6904 7.64297C16.3155 8.26809 16.6667 9.11593 16.6667 9.99999C16.6667 10.884 16.3155 11.7319 15.6904 12.357C15.0652 12.9821 14.2174 13.3333 13.3333 13.3333H12M7.33333 9.99999H12.6667",strokeLinecap:"square"})});import{jsx as Gv}from"react/jsx-runtime";import"react";var jo=()=>Gv("svg",{className:"icon icon--plus",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:Gv("path",{className:"stroke",d:"M5.33333 9.99998H14.6667M9.99999 5.33331V14.6666",strokeLinecap:"square"})});import{jsx as Wv}from"react/jsx-runtime";import"react";var mp=()=>Wv("svg",{className:"icon icon--swap",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:Wv("path",{className:"stroke",d:"M7.33334 4L4.66667 6.66667M4.66667 6.66667L7.33334 9.33333M4.66667 6.66667H15.3333M12.6667 16L15.3333 13.3333M15.3333 13.3333L12.6667 10.6667M15.3333 13.3333H4.66667",strokeLinecap:"square"})});import{jsx as Ls,jsxs as gp}from"react/jsx-runtime";var Be={};mv(Be,{Button:()=>pp,ButtonGroup:()=>fp,Divider:()=>Hv,GroupLabel:()=>ku});import{jsx as ju}from"react/jsx-runtime";import"react";import{jsx as nF}from"react/jsx-runtime";import"react";var sF="popup-divider",Hv=()=>nF("hr",{className:sF});import{jsx as iF}from"react/jsx-runtime";import"react";var aF="popup-list-group-label",ku=({label:t})=>iF("p",{className:aF,children:t});var ll="popup-button-list",fp=({buttonSize:t="default",children:e,className:o,textAlign:n="left"})=>{let r=[ll,o,`${ll}__text-align--${n}`,`${ll}__button-size--${t}`].filter(Boolean).join(" ");return ju("div",{className:r,children:e})},pp=({id:t,active:e,children:o,className:n,disabled:r,href:s,onClick:i})=>{let l=[`${ll}__button`,e&&`${ll}__button--selected`,n].filter(Boolean).join(" ");if(!r){if(s)return ju(Yt,{className:l,href:s,id:t,onClick:a=>{i&&i(a)},prefetch:!1,children:o});if(i)return ju("button",{className:l,id:t,onClick:a=>{i&&i(a)},type:"button",children:o})}return ju("div",{className:l,id:t,children:o})};var Un={};mv(Un,{WindowInfo:()=>Uv,WindowInfoContext:()=>ki,WindowInfoProvider:()=>Jv,useWindowInfo:()=>Co,withWindowInfo:()=>qv});import{useContext as cF}from"react";import{createContext as lF}from"react";var ki=lF({});var Co=()=>cF(ki);import zv,{Fragment as Xv}from"react";var Uv=t=>{let{children:e}=t,o=Co();return e?typeof e=="function"?zv.createElement(Xv,null,e(o)):zv.createElement(Xv,null,e):null};import uF,{useCallback as Yv,useEffect as Zv,useReducer as dF,useRef as mF}from"react";var fF=(t,e)=>{let{payload:{breakpoints:o,animationRef:n}}=e;n.current=null;let{eventsFired:r}=t,{documentElement:{style:s,clientWidth:i,clientHeight:l}}=document,{innerWidth:a,innerHeight:c}=window,u=`${i/100}px`,d=`${l/100}px`,f=o?Object.keys(o).reduce((h,p)=>Object.assign(Object.assign({},h),{[p]:window.matchMedia(o[p]).matches}),{}):{},m={width:a,height:c,"--vw":u,"--vh":d,breakpoints:f,eventsFired:r+1};return s.setProperty("--vw",u),s.setProperty("--vh",d),m},Jv=t=>{let{breakpoints:e,children:o}=t,n=mF(null),[r,s]=dF(fF,{width:void 0,height:void 0,"--vw":"","--vh":"",breakpoints:{},eventsFired:0}),i=Yv(()=>{n.current&&cancelAnimationFrame(n.current),n.current=requestAnimationFrame(()=>s({type:"UPDATE",payload:{breakpoints:e,animationRef:n}}))},[e]),l=Yv(()=>{setTimeout(()=>{i()},500)},[i]);return Zv(()=>(window.addEventListener("resize",i),window.addEventListener("orientationchange",l),()=>{window.removeEventListener("resize",i),window.removeEventListener("orientationchange",l)}),[i,l]),Zv(()=>{r.eventsFired===0&&s({type:"UPDATE",payload:{breakpoints:e,animationRef:n}})},[e,r]),uF.createElement(ki.Provider,{value:Object.assign({},r)},o&&o)};import pF from"react";var qv=t=>o=>{let n=Co();return pF.createElement(t,Object.assign({},o,{windowInfo:n}))};import{useCallback as e0,useEffect as Ou,useRef as vF,useState as bp}from"react";import{c as hF}from"react/compiler-runtime";import{useEffect as gF,useRef as bF,useState as Qv}from"react";var fn=(t,e)=>{let o=hF(14),n;o[0]!==t?(n=t===void 0?{}:t,o[0]=t,o[1]=n):n=o[1];let{root:r,rootMargin:s,threshold:i}=n,l=r===void 0?null:r,a=s===void 0?"0px":s,c=i===void 0?0:i,[u,d]=Qv(),[f,m]=Qv(null),h;o[2]!==e||o[3]!==l||o[4]!==a||o[5]!==c?(h=typeof window<"u"&&"IntersectionObserver"in window&&!e?new window.IntersectionObserver(x=>{let[y]=x;return d(y)},{root:l,rootMargin:a,threshold:c}):null,o[2]=e,o[3]=l,o[4]=a,o[5]=c,o[6]=h):h=o[6];let p=bF(h),g,b;o[7]!==e||o[8]!==f?(g=()=>{if(e)return;let{current:x}=p;return x.disconnect(),f&&x.observe(f),()=>x.disconnect()},b=[f,e],o[7]=e,o[8]=f,o[9]=g,o[10]=b):(g=o[9],b=o[10]),gF(g,b);let v;return o[11]!==u||o[12]!==f?(v=[m,u,f],o[11]=u,o[12]=f,o[13]=v):v=o[13],v};import{jsx as Kv}from"react/jsx-runtime";import"react";var cl="popup-button",hp=t=>{let{active:e,button:o,buttonType:n,className:r,disabled:s,noBackground:i,setActive:l,size:a}=t,c=[cl,r,`${cl}--${n}`,!i&&`${cl}--background`,a&&`${cl}--size-${a}`,s&&`${cl}--disabled`].filter(Boolean).join(" "),u=()=>{l(!e)};return n==="none"?null:n==="custom"?Kv("div",{className:c,onClick:u,onKeyDown:d=>{d.key==="Enter"&&u()},role:"button",tabIndex:0,children:o}):Kv("button",{className:c,disabled:s,onClick:u,onKeyDown:d=>{d.key==="Enter"&&u()},tabIndex:0,type:"button",children:o})};var Oo="popup",ho=t=>{let{id:e,boundingRef:o,button:n,buttonClassName:r,buttonSize:s,buttonType:i="default",caret:l=!0,children:a,className:c,disabled:u,forceOpen:d,horizontalAlign:f="left",initActive:m=!1,noBackground:h,onToggleOpen:p,render:g,showOnHover:b=!1,showScrollbar:v=!1,size:x="medium",verticalAlign:y="top"}=t,{height:C,width:S}=Co(),[w,F]=fn({root:o?.current||null,rootMargin:"-100px 0px 0px 0px",threshold:1}),_=vF(null),[A,R]=bp(m),[I,D]=bp(y),[E,T]=bp(f),L=e0(({horizontal:P=!1,vertical:N=!1})=>{if(_.current){let B=_.current.getBoundingClientRect(),{bottom:M,left:O,right:V,top:G}=B,z=100,X=document.documentElement.clientWidth,te=document.documentElement.clientHeight,Y=0;o?.current&&({bottom:te,left:Y,right:X,top:z}=o.current.getBoundingClientRect()),P&&(V>X&&O>Y?T("right"):O<Y&&V<X&&T("left")),N&&(G<z&&M<te?D("bottom"):M>te&&G>z&&D("top"))}},[o]),k=e0(P=>{_.current.contains(P.target)||R(!1)},[_]);Ou(()=>{L({horizontal:!0})},[F,L,S]),Ou(()=>{L({vertical:!0})},[F,L,C]),Ou(()=>(typeof p=="function"&&p(A),A?document.addEventListener("mousedown",k):document.removeEventListener("mousedown",k),()=>{document.removeEventListener("mousedown",k)}),[A,k,p]),Ou(()=>{R(d)},[d]);let j=[Oo,c,`${Oo}--size-${x}`,s&&`${Oo}--button-size-${s}`,`${Oo}--v-align-${I}`,`${Oo}--h-align-${E}`,A&&`${Oo}--active`,v&&`${Oo}--show-scrollbar`].filter(Boolean).join(" ");return gp("div",{className:j,id:e,children:[Ls("div",{className:`${Oo}__trigger-wrap`,children:b?Ls("div",{className:`${Oo}__on-hover-watch`,onMouseEnter:()=>R(!0),onMouseLeave:()=>R(!1),children:Ls(hp,{active:A,button:n,buttonType:i,className:r,disabled:u,noBackground:h,setActive:R,size:s})}):Ls(hp,{active:A,button:n,buttonType:i,className:r,disabled:u,noBackground:h,setActive:R,size:s})}),gp("div",{className:`${Oo}__content`,ref:_,children:[Ls("div",{className:`${Oo}__hide-scrollbar`,ref:w,children:Ls("div",{className:`${Oo}__scroll-container`,children:gp("div",{className:`${Oo}__scroll-content`,children:[g&&g({close:()=>R(!1)}),a]})})}),l&&Ls("div",{className:`${Oo}__caret`})]})]})};import{c as xF}from"react/compiler-runtime";import{jsx as Mu,jsxs as yF}from"react/jsx-runtime";import vp,{useEffect as t0}from"react";var go=t=>{let e=xF(26),{alignCaret:o,boundingRef:n,children:r,className:s,delay:i,position:l,show:a,staticPositioning:c}=t,u=o===void 0?"center":o,d=i===void 0?350:i,f=a===void 0?!0:a,m=c===void 0?!1:c,[h,p]=vp.useState(f),[g,b]=vp.useState("top"),v=CF,x=n?.current||null,y;e[0]!==x?(y={root:x,rootMargin:"-145px 0px 0px 100px",threshold:0},e[0]=x,e[1]=y):y=e[1];let[C,S]=fn(y,m),w,F;e[2]!==d||e[3]!==f?(w=()=>{let I;return d&&f?I=setTimeout(()=>{p(f)},d):p(f),()=>{I&&clearTimeout(I)}},F=[f,d],e[2]=d,e[3]=f,e[4]=w,e[5]=F):(w=e[4],F=e[5]),t0(w,F);let _;e[6]!==S?.isIntersecting||e[7]!==m?(_=()=>{m||b(S?.isIntersecting?"top":"bottom")},e[6]=S?.isIntersecting,e[7]=m,e[8]=_):_=e[8];let A;e[9]!==S||e[10]!==m?(A=[S,m],e[9]=S,e[10]=m,e[11]=A):A=e[11],t0(_,A);let R;if(e[12]!==u||e[13]!==r||e[14]!==s||e[15]!==g||e[16]!==l||e[17]!==C||e[18]!==h||e[19]!==m){let I=h&&"tooltip--show",D=`tooltip--caret-${u}`,E=`tooltip--position-${l||g}`,T;e[21]!==s||e[22]!==I||e[23]!==D||e[24]!==E?(T=["tooltip",s,I,D,E].filter(Boolean),e[21]=s,e[22]=I,e[23]=D,e[24]=E,e[25]=T):T=e[25],R=yF(vp.Fragment,{children:[!m&&Mu("aside",{"aria-hidden":"true",className:["tooltip",s,`tooltip--caret-${u}`,"tooltip--position-top"].filter(Boolean).join(" "),ref:C,style:{opacity:"0"},children:Mu("div",{className:"tooltip-content",children:r})}),Mu("aside",{className:T.join(" "),title:v(r),children:Mu("div",{className:"tooltip-content",children:r})})]}),e[12]=u,e[13]=r,e[14]=s,e[15]=g,e[16]=l,e[17]=C,e[18]=h,e[19]=m,e[20]=R}else R=e[20];return R};function CF(t){return typeof t=="string"?t:""}var RF={chevron:Ze,edit:_r,link:dp,plus:jo,swap:mp,x:pt},io="btn",Bu=({children:t,icon:e,showTooltip:o,tooltip:n})=>{let r=RF[e];return Vu(SF,{children:[n&&Yo(go,{className:`${io}__tooltip`,show:o,children:n}),Vu("span",{className:`${io}__content`,children:[t&&Yo("span",{className:`${io}__label`,children:t}),e&&Vu("span",{className:`${io}__icon`,children:[IF(e)&&e,r&&Yo(r,{})]})]})]})},se=t=>{let{id:e,type:o="button","aria-label":n,buttonStyle:r="primary",children:s,className:i,disabled:l,el:a="button",enableSubMenu:c,icon:u,iconPosition:d="right",iconStyle:f="without-border",newTab:m,onClick:h,onMouseDown:p,ref:g,round:b,size:v="medium",SubMenuPopupContent:x,to:y,tooltip:C,url:S}=t,[w,F]=wF.useState(!1),_=[io,i&&i,u&&`${io}--icon`,f&&`${io}--icon-style-${f}`,u&&!s&&`${io}--icon-only`,v&&`${io}--size-${v}`,u&&d&&`${io}--icon-position-${d}`,C&&`${io}--has-tooltip`,!x&&`${io}--withoutPopup`].filter(Boolean).join(" ");function A(T){F(!1),o!=="submit"&&h&&T.preventDefault(),h&&h(T)}let R=[r&&`${io}--style-${r}`,l&&`${io}--disabled`,b&&`${io}--round`,x?`${io}--withPopup`:`${io}--withoutPopup`].filter(Boolean).join(" "),I={id:e,type:o,"aria-disabled":l,"aria-label":n,className:x?_:[_,R].join(" "),disabled:l,onClick:l?void 0:A,onMouseDown:l?void 0:p,onPointerEnter:C?()=>F(!0):void 0,onPointerLeave:C?()=>F(!1):void 0,rel:m?"noopener noreferrer":void 0,target:m?"_blank":void 0},D,E;switch(a){case"anchor":D=Yo("a",{...I,href:l?void 0:S,ref:g,children:Yo(Bu,{icon:u,showTooltip:w,tooltip:C,children:s})});break;case"link":l&&(D=Yo("div",{...I,children:Yo(Bu,{icon:u,showTooltip:w,tooltip:C,children:s})})),D=Yo(Yt,{...I,href:y||S,prefetch:E,children:Yo(Bu,{icon:u,showTooltip:w,tooltip:C,children:s})});break;default:D=Yo(a,{ref:g,type:"submit",...I,children:Yo(Bu,{icon:u,showTooltip:w,tooltip:C,children:s})});break}return x?Vu("div",{className:R,children:[D,Yo(ho,{button:Yo(Ze,{}),buttonSize:v,className:l&&!c?`${io}--popup-disabled`:"",disabled:l&&!c,horizontalAlign:"right",id:`${e}-popup`,noBackground:!0,render:({close:T})=>x({close:()=>T()}),size:"large",verticalAlign:"bottom"})]}):D};import{c as tA}from"react/compiler-runtime";import{jsx as oA}from"react/jsx-runtime";import{Fragment as rA}from"react";import{c as eA}from"react/compiler-runtime";import a0,{useMemo as Wu,useRef as Cp,useEffect as Hu,useState as NF,useContext as LF}from"react";import{useDndContext as $F,getClientRect as kF,useDroppable as jF,useDraggable as OF,closestCorners as MF,getFirstCollision as BF,getScrollableAncestors as VF,KeyboardCode as Yn}from"@dnd-kit/core";import{useMemo as o0,useLayoutEffect as _F,useEffect as DF,useRef as uX,useCallback as dX}from"react";function r0(){for(var t=arguments.length,e=new Array(t),o=0;o<t;o++)e[o]=arguments[o];return o0(()=>n=>{e.forEach(r=>r(n))},e)}var FF=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function AF(t){let e=Object.prototype.toString.call(t);return e==="[object Window]"||e==="[object global]"}function TF(t){return"nodeType"in t}function EF(t){var e,o;return t?AF(t)?t:TF(t)&&(e=(o=t.ownerDocument)==null?void 0:o.defaultView)!=null?e:window:window}var yp=FF?_F:DF;var xp={};function n0(t,e){return o0(()=>{if(e)return e;let o=xp[t]==null?0:xp[t]+1;return xp[t]=o,t+"-"+o},[t,e])}function PF(t){return 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];return n.reduce((s,i)=>{let l=Object.entries(i);for(let[a,c]of l){let u=s[a];u!=null&&(s[a]=u+t*c)}return s},{...e})}}var s0=PF(-1);function i0(t){if(!t)return!1;let{KeyboardEvent:e}=EF(t.target);return e&&t instanceof e}var ul=Object.freeze({Translate:{toString(t){if(!t)return;let{x:e,y:o}=t;return"translate3d("+(e?Math.round(e):0)+"px, "+(o?Math.round(o):0)+"px, 0)"}},Scale:{toString(t){if(!t)return;let{scaleX:e,scaleY:o}=t;return"scaleX("+e+") scaleY("+o+")"}},Transform:{toString(t){if(t)return[ul.Translate.toString(t),ul.Scale.toString(t)].join(" ")}},Transition:{toString(t){let{property:e,duration:o,easing:n}=t;return e+" "+o+"ms "+n}}});function Xu(t,e,o){let n=t.slice();return n.splice(o<0?n.length+o:o,0,n.splice(e,1)[0]),n}function GF(t,e){return t.reduce((o,n,r)=>{let s=e.get(n);return s&&(o[r]=s),o},Array(t.length))}function Gu(t){return t!==null&&t>=0}function WF(t,e){if(t===e)return!0;if(t.length!==e.length)return!1;for(let o=0;o<t.length;o++)if(t[o]!==e[o])return!1;return!0}function HF(t){return typeof t=="boolean"?{draggable:t,droppable:t}:t}var l0=t=>{let{rects:e,activeIndex:o,overIndex:n,index:r}=t,s=Xu(e,n,o),i=e[r],l=s[r];return!l||!i?null:{x:l.left-i.left,y:l.top-i.top,scaleX:l.width/i.width,scaleY:l.height/i.height}};var c0="Sortable",u0=a0.createContext({activeIndex:-1,containerId:c0,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:l0,disabled:{draggable:!1,droppable:!1}});function d0(t){let{children:e,id:o,items:n,strategy:r=l0,disabled:s=!1}=t,{active:i,dragOverlay:l,droppableRects:a,over:c,measureDroppableContainers:u}=$F(),d=n0(c0,o),f=l.rect!==null,m=Wu(()=>n.map(S=>typeof S=="object"&&"id"in S?S.id:S),[n]),h=i!=null,p=i?m.indexOf(i.id):-1,g=c?m.indexOf(c.id):-1,b=Cp(m),v=!WF(m,b.current),x=g!==-1&&p===-1||v,y=HF(s);yp(()=>{v&&h&&u(m)},[v,m,h,u]),Hu(()=>{b.current=m},[m]);let C=Wu(()=>({activeIndex:p,containerId:d,disabled:y,disableTransforms:x,items:m,overIndex:g,useDragOverlay:f,sortedRects:GF(m,a),strategy:r}),[p,d,y.draggable,y.droppable,x,m,g,a,f,r]);return a0.createElement(u0.Provider,{value:C},e)}var zF=t=>{let{id:e,items:o,activeIndex:n,overIndex:r}=t;return Xu(o,n,r).indexOf(e)},XF=t=>{let{containerId:e,isSorting:o,wasDragging:n,index:r,items:s,newIndex:i,previousItems:l,previousContainerId:a,transition:c}=t;return!c||!n||l!==s&&r===i?!1:o?!0:i!==r&&e===a},UF={duration:200,easing:"ease"},m0="transform",YF=ul.Transition.toString({property:m0,duration:0,easing:"linear"}),ZF={roleDescription:"sortable"};function JF(t){let{disabled:e,index:o,node:n,rect:r}=t,[s,i]=NF(null),l=Cp(o);return yp(()=>{if(!e&&o!==l.current&&n.current){let a=r.current;if(a){let c=kF(n.current,{ignoreTransform:!0}),u={x:a.left-c.left,y:a.top-c.top,scaleX:a.width/c.width,scaleY:a.height/c.height};(u.x||u.y)&&i(u)}}o!==l.current&&(l.current=o)},[e,o,n,r]),Hu(()=>{s&&i(null)},[s]),s}function f0(t){let{animateLayoutChanges:e=XF,attributes:o,disabled:n,data:r,getNewIndex:s=zF,id:i,strategy:l,resizeObserverConfig:a,transition:c=UF}=t,{items:u,containerId:d,activeIndex:f,disabled:m,disableTransforms:h,sortedRects:p,overIndex:g,useDragOverlay:b,strategy:v}=LF(u0),x=qF(n,m),y=u.indexOf(i),C=Wu(()=>({sortable:{containerId:d,index:y,items:u},...r}),[d,r,y,u]),S=Wu(()=>u.slice(u.indexOf(i)),[u,i]),{rect:w,node:F,isOver:_,setNodeRef:A}=jF({id:i,data:C,disabled:x.droppable,resizeObserverConfig:{updateMeasurementsFor:S,...a}}),{active:R,activatorEvent:I,activeNodeRect:D,attributes:E,setNodeRef:T,listeners:L,isDragging:k,over:j,setActivatorNodeRef:P,transform:N}=OF({id:i,data:C,attributes:{...ZF,...o},disabled:x.draggable}),B=r0(A,T),M=!!R,O=M&&!h&&Gu(f)&&Gu(g),V=!b&&k,G=V&&O?N:null,X=O?G??(l??v)({rects:p,activeNodeRect:D,activeIndex:f,overIndex:g,index:y}):null,te=Gu(f)&&Gu(g)?s({id:i,items:u,activeIndex:f,overIndex:g}):y,Y=R?.id,H=Cp({activeId:Y,items:u,newIndex:te,containerId:d}),le=u!==H.current.items,q=e({active:R,containerId:d,isDragging:k,isSorting:M,id:i,index:y,items:u,newIndex:H.current.newIndex,previousItems:H.current.items,previousContainerId:H.current.containerId,transition:c,wasDragging:H.current.activeId!=null}),fe=JF({disabled:!q,index:y,node:F,rect:w});return Hu(()=>{M&&H.current.newIndex!==te&&(H.current.newIndex=te),d!==H.current.containerId&&(H.current.containerId=d),u!==H.current.items&&(H.current.items=u)},[M,te,d,u]),Hu(()=>{if(Y===H.current.activeId)return;if(Y&&!H.current.activeId){H.current.activeId=Y;return}let J=setTimeout(()=>{H.current.activeId=Y},50);return()=>clearTimeout(J)},[Y]),{active:R,activeIndex:f,attributes:E,data:C,rect:w,index:y,newIndex:te,items:u,isOver:_,isSorting:M,isDragging:k,listeners:L,node:F,overIndex:g,over:j,setNodeRef:B,setActivatorNodeRef:P,setDroppableNodeRef:A,setDraggableNodeRef:T,transform:fe??X,transition:ae()};function ae(){if(fe||le&&H.current.newIndex===y)return YF;if(!(V&&!i0(I)||!c)&&(M||q))return ul.Transition.toString({...c,property:m0})}}function qF(t,e){var o,n;return typeof t=="boolean"?{draggable:t,droppable:!1}:{draggable:(o=t?.draggable)!=null?o:e.draggable,droppable:(n=t?.droppable)!=null?n:e.droppable}}function zu(t){if(!t)return!1;let e=t.data.current;return!!(e&&"sortable"in e&&typeof e.sortable=="object"&&"containerId"in e.sortable&&"items"in e.sortable&&"index"in e.sortable)}var QF=[Yn.Down,Yn.Right,Yn.Up,Yn.Left],p0=(t,e)=>{let{context:{active:o,collisionRect:n,droppableRects:r,droppableContainers:s,over:i,scrollableAncestors:l}}=e;if(QF.includes(t.code)){if(t.preventDefault(),!o||!n)return;let a=[];s.getEnabled().forEach(d=>{if(!d||d!=null&&d.disabled)return;let f=r.get(d.id);if(f)switch(t.code){case Yn.Down:n.top<f.top&&a.push(d);break;case Yn.Up:n.top>f.top&&a.push(d);break;case Yn.Left:n.left>f.left&&a.push(d);break;case Yn.Right:n.left<f.left&&a.push(d);break}});let c=MF({active:o,collisionRect:n,droppableRects:r,droppableContainers:a,pointerCoordinates:null}),u=BF(c,"id");if(u===i?.id&&c.length>1&&(u=c[1].id),u!=null){let d=s.get(o.id),f=s.get(u),m=f?r.get(f.id):null,h=f?.node.current;if(h&&m&&d&&f){let g=VF(h).some((S,w)=>l[w]!==S),b=h0(d,f),v=KF(d,f),x=g||!b?{x:0,y:0}:{x:v?n.width-m.width:0,y:v?n.height-m.height:0},y={x:m.left,y:m.top};return x.x&&x.y?y:s0(y,x)}}}};function h0(t,e){return!zu(t)||!zu(e)?!1:t.data.current.sortable.containerId===e.data.current.sortable.containerId}function KF(t,e){return!zu(t)||!zu(e)||!h0(t,e)?!1:t.data.current.sortable.index<e.data.current.sortable.index}var ji=t=>{let e=eA(17),{id:o,disabled:n}=t,r;e[0]===Symbol.for("react.memo_cache_sentinel")?(r={duration:250,easing:"cubic-bezier(0, 0.2, 0.2, 1)"},e[0]=r):r=e[0];let s;e[1]!==n||e[2]!==o?(s={id:o,disabled:n,transition:r},e[1]=n,e[2]=o,e[3]=s):s=e[3];let{attributes:i,isDragging:l,listeners:a,setNodeRef:c,transform:u,transition:d}=f0(s),f=l?"grabbing":"grab",m;e[4]!==f||e[5]!==d?(m={cursor:f,transition:d},e[4]=f,e[5]=d,e[6]=m):m=e[6];let h;e[7]!==i||e[8]!==m?(h={...i,style:m},e[7]=i,e[8]=m,e[9]=h):h=e[9];let p=u&&`translate3d(${u.x}px, ${u.y}px, 0)`,g;return e[10]!==l||e[11]!==a||e[12]!==c||e[13]!==h||e[14]!==p||e[15]!==d?(g={attributes:h,isDragging:l,listeners:a,setNodeRef:c,transform:p,transition:d},e[10]=l,e[11]=a,e[12]=c,e[13]=h,e[14]=p,e[15]=d,e[16]=g):g=e[16],g};var Jr=t=>{let e=tA(12),{id:o,children:n,disabled:r}=t,s;e[0]!==r||e[1]!==o?(s={id:o,disabled:r},e[0]=r,e[1]=o,e[2]=s):s=e[2];let{attributes:i,isDragging:l,listeners:a,setNodeRef:c,transform:u,transition:d}=ji(s),f=l?"grabbing":"grab",m;return e[3]!==i||e[4]!==n||e[5]!==l||e[6]!==a||e[7]!==c||e[8]!==f||e[9]!==u||e[10]!==d?(m=oA(rA,{children:n({attributes:{...i,style:{cursor:f}},isDragging:l,listeners:a,setNodeRef:c,transform:u,transition:d})}),e[3]=i,e[4]=n,e[5]=l,e[6]=a,e[7]=c,e[8]=f,e[9]=u,e[10]=d,e[11]=m):m=e[11],m};import{c as nA}from"react/compiler-runtime";import{jsx as wp}from"react/jsx-runtime";import{closestCenter as sA,DndContext as iA,KeyboardSensor as aA,PointerSensor as lA,useDroppable as cA,useSensor as g0,useSensors as uA}from"@dnd-kit/core";import{useId as dA}from"react";var ur=t=>{let e=nA(18),{children:o,className:n,ids:r,onDragEnd:s,onDragStart:i}=t,l=dA(),a;e[0]!==l?(a={id:l},e[0]=l,e[1]=a):a=e[1];let{setNodeRef:c}=cA(a),u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u={activationConstraint:{distance:5}},e[2]=u):u=e[2];let d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d={coordinateGetter:p0},e[3]=d):d=e[3];let f=uA(g0(lA,u),g0(aA,d)),m;e[4]!==r||e[5]!==s?(m=v=>{let{active:x,over:y}=v;v.activatorEvent.stopPropagation(),!(!x||!y)&&typeof s=="function"&&s({event:v,moveFromIndex:r.findIndex(C=>C===x.id),moveToIndex:r.findIndex(C=>C===y.id)})},e[4]=r,e[5]=s,e[6]=m):m=e[6];let h=m,p;e[7]!==i?(p=v=>{let{active:x}=v;x&&typeof i=="function"&&i({id:x.id,event:v})},e[7]=i,e[8]=p):p=e[8];let g=p,b;return e[9]!==o||e[10]!==n||e[11]!==h||e[12]!==g||e[13]!==l||e[14]!==r||e[15]!==f||e[16]!==c?(b=wp(iA,{collisionDetection:sA,id:l,onDragEnd:h,onDragStart:g,sensors:f,children:wp(d0,{items:r,children:wp("div",{className:n,ref:c,children:o})})}),e[9]=o,e[10]=n,e[11]=h,e[12]=g,e[13]=l,e[14]=r,e[15]=f,e[16]=c,e[17]=b):b=e[17],b};import{jsx as b0,jsxs as mA}from"react/jsx-runtime";import"react";var Uu="error-pill",ao=t=>{let{className:e,count:o,i18n:n,withMessage:r}=t,s=!r&&o<99,i=[Uu,s&&`${Uu}--fixed-width`,e&&e].filter(Boolean).join(" ");return o===0?null:b0("div",{className:i,children:mA("div",{className:`${Uu}__content`,children:[b0("span",{className:`${Uu}__count`,children:o}),r&&` ${o>1?n.t("general:errors"):n.t("general:error")}`]})})};import{c as fA}from"react/compiler-runtime";import{jsx as pA}from"react/jsx-runtime";import{getTranslation as hA}from"@payloadcms/translations";import"react";var v0="field-description",Ve=t=>{let e=fA(8),{className:o,description:n,marginPlacement:r,path:s}=t,{i18n:i}=$();if(n){let l=`field-description-${s?.replace(/\./g,"__")}`,a=r&&`${v0}--margin-${r}`,c;e[0]!==o||e[1]!==l||e[2]!==a?(c=[v0,o,l,a].filter(Boolean),e[0]=o,e[1]=l,e[2]=a,e[3]=c):c=e[3];let u=c.join(" "),d;return e[4]!==n||e[5]!==i||e[6]!==u?(d=pA("div",{className:u,children:hA(n,i)}),e[4]=n,e[5]=i,e[6]=u,e[7]=d):d=e[7],d}return null};import{c as gA}from"react/compiler-runtime";import{jsx as bA}from"react/jsx-runtime";import"react";var vA="field-error",We=t=>{let e=gA(7),{alignCaret:o,message:n,path:r,showError:s}=t,i=o===void 0?"right":o,l=Xt(),a;e[0]!==r?(a=p=>{let[g]=p;return g&&g?.[r]||null},e[0]=r,e[1]=a):a=e[1];let c=Nt(a),u;e[2]!==c?(u=c||{},e[2]=c,e[3]=u):u=e[3];let{errorMessage:d,valid:f}=u,m=n||d;if((s||l&&f===!1)&&m?.length){let p;return e[4]!==i||e[5]!==m?(p=bA(go,{alignCaret:i,className:vA,delay:0,staticPositioning:!0,children:m}),e[4]=i,e[5]=m,e[6]=p):p=e[6],p}return null};import{c as rE}from"react/compiler-runtime";import{jsx as nE,jsxs as mx}from"react/jsx-runtime";import{getTranslation as sE}from"@payloadcms/translations";import"react";import{c as xA}from"react/compiler-runtime";import{jsx as yA}from"react/jsx-runtime";import{createContext as CA,use as wA}from"react";var x0=CA(0),$s=t=>{let e=xA(3),{children:o}=t,r=ct()+1,s;return e[0]!==o||e[1]!==r?(s=yA(x0,{value:r,children:o}),e[0]=o,e[1]=r,e[2]=s):s=e[2],s},ct=()=>wA(x0);import{c as JT}from"react/compiler-runtime";import{jsx as ix}from"react/jsx-runtime";import{useSearchParams as qT}from"next/navigation.js";import QT,{createContext as lx,use as cx,useEffect as ax,useRef as KT,useState as eE}from"react";var Zn=(t,e)=>!t?.locales||t.locales.length===0?null:t.locales.find(o=>o?.code===e);import{jsx as BT}from"react/jsx-runtime";import{jsx as Ep}from"react/jsx-runtime";import{useRef as T0,useEffect as Os,useState as Pp}from"react";import kA from"react-dom";function Re(){return Re=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var o=arguments[e];for(var n in o)({}).hasOwnProperty.call(o,n)&&(t[n]=o[n])}return t},Re.apply(null,arguments)}function Oi(t,e){if(t==null)return{};var o={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(e.includes(n))continue;o[n]=t[n]}return o}function Mi(t,e){return Mi=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(o,n){return o.__proto__=n,o},Mi(t,e)}function Yu(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,Mi(t,e)}function Sp(t,e){return t.classList?!!e&&t.classList.contains(e):(" "+(t.className.baseVal||t.className)+" ").indexOf(" "+e+" ")!==-1}function Ip(t,e){t.classList?t.classList.add(e):Sp(t,e)||(typeof t.className=="string"?t.className=t.className+" "+e:t.setAttribute("class",(t.className&&t.className.baseVal||"")+" "+e))}function y0(t,e){return t.replace(new RegExp("(^|\\s)"+e+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}function Rp(t,e){t.classList?t.classList.remove(e):typeof t.className=="string"?t.className=y0(t.className,e):t.setAttribute("class",y0(t.className&&t.className.baseVal||"",e))}import w0 from"react";import Ju from"react";import qu from"react-dom";var _p={disabled:!1};import SA from"react";var Dp=SA.createContext(null);var Zu=function(e){return e.scrollTop};var dl="unmounted",ks="exited",js="entering",Vi="entered",Fp="exiting",pn=function(t){Yu(e,t);function e(n,r){var s;s=t.call(this,n,r)||this;var i=r,l=i&&!i.isMounting?n.enter:n.appear,a;return s.appearStatus=null,n.in?l?(a=ks,s.appearStatus=js):a=Vi:n.unmountOnExit||n.mountOnEnter?a=dl:a=ks,s.state={status:a},s.nextCallback=null,s}e.getDerivedStateFromProps=function(r,s){var i=r.in;return i&&s.status===dl?{status:ks}:null};var o=e.prototype;return o.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},o.componentDidUpdate=function(r){var s=null;if(r!==this.props){var i=this.state.status;this.props.in?i!==js&&i!==Vi&&(s=js):(i===js||i===Vi)&&(s=Fp)}this.updateStatus(!1,s)},o.componentWillUnmount=function(){this.cancelNextCallback()},o.getTimeouts=function(){var r=this.props.timeout,s,i,l;return s=i=l=r,r!=null&&typeof r!="number"&&(s=r.exit,i=r.enter,l=r.appear!==void 0?r.appear:i),{exit:s,enter:i,appear:l}},o.updateStatus=function(r,s){if(r===void 0&&(r=!1),s!==null)if(this.cancelNextCallback(),s===js){if(this.props.unmountOnExit||this.props.mountOnEnter){var i=this.props.nodeRef?this.props.nodeRef.current:qu.findDOMNode(this);i&&Zu(i)}this.performEnter(r)}else this.performExit();else this.props.unmountOnExit&&this.state.status===ks&&this.setState({status:dl})},o.performEnter=function(r){var s=this,i=this.props.enter,l=this.context?this.context.isMounting:r,a=this.props.nodeRef?[l]:[qu.findDOMNode(this),l],c=a[0],u=a[1],d=this.getTimeouts(),f=l?d.appear:d.enter;if(!r&&!i||_p.disabled){this.safeSetState({status:Vi},function(){s.props.onEntered(c)});return}this.props.onEnter(c,u),this.safeSetState({status:js},function(){s.props.onEntering(c,u),s.onTransitionEnd(f,function(){s.safeSetState({status:Vi},function(){s.props.onEntered(c,u)})})})},o.performExit=function(){var r=this,s=this.props.exit,i=this.getTimeouts(),l=this.props.nodeRef?void 0:qu.findDOMNode(this);if(!s||_p.disabled){this.safeSetState({status:ks},function(){r.props.onExited(l)});return}this.props.onExit(l),this.safeSetState({status:Fp},function(){r.props.onExiting(l),r.onTransitionEnd(i.exit,function(){r.safeSetState({status:ks},function(){r.props.onExited(l)})})})},o.cancelNextCallback=function(){this.nextCallback!==null&&(this.nextCallback.cancel(),this.nextCallback=null)},o.safeSetState=function(r,s){s=this.setNextCallback(s),this.setState(r,s)},o.setNextCallback=function(r){var s=this,i=!0;return this.nextCallback=function(l){i&&(i=!1,s.nextCallback=null,r(l))},this.nextCallback.cancel=function(){i=!1},this.nextCallback},o.onTransitionEnd=function(r,s){this.setNextCallback(s);var i=this.props.nodeRef?this.props.nodeRef.current:qu.findDOMNode(this),l=r==null&&!this.props.addEndListener;if(!i||l){setTimeout(this.nextCallback,0);return}if(this.props.addEndListener){var a=this.props.nodeRef?[this.nextCallback]:[i,this.nextCallback],c=a[0],u=a[1];this.props.addEndListener(c,u)}r!=null&&setTimeout(this.nextCallback,r)},o.render=function(){var r=this.state.status;if(r===dl)return null;var s=this.props,i=s.children,l=s.in,a=s.mountOnEnter,c=s.unmountOnExit,u=s.appear,d=s.enter,f=s.exit,m=s.timeout,h=s.addEndListener,p=s.onEnter,g=s.onEntering,b=s.onEntered,v=s.onExit,x=s.onExiting,y=s.onExited,C=s.nodeRef,S=Oi(s,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]);return Ju.createElement(Dp.Provider,{value:null},typeof i=="function"?i(r,S):Ju.cloneElement(Ju.Children.only(i),S))},e}(Ju.Component);pn.contextType=Dp;pn.propTypes={};function Bi(){}pn.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:Bi,onEntering:Bi,onEntered:Bi,onExit:Bi,onExiting:Bi,onExited:Bi};pn.UNMOUNTED=dl;pn.EXITED=ks;pn.ENTERING=js;pn.ENTERED=Vi;pn.EXITING=Fp;var C0=pn;var IA=function(e,o){return e&&o&&o.split(" ").forEach(function(n){return Ip(e,n)})},Ap=function(e,o){return e&&o&&o.split(" ").forEach(function(n){return Rp(e,n)})},Tp=function(t){Yu(e,t);function e(){for(var n,r=arguments.length,s=new Array(r),i=0;i<r;i++)s[i]=arguments[i];return n=t.call.apply(t,[this].concat(s))||this,n.appliedClasses={appear:{},enter:{},exit:{}},n.onEnter=function(l,a){var c=n.resolveArguments(l,a),u=c[0],d=c[1];n.removeClasses(u,"exit"),n.addClass(u,d?"appear":"enter","base"),n.props.onEnter&&n.props.onEnter(l,a)},n.onEntering=function(l,a){var c=n.resolveArguments(l,a),u=c[0],d=c[1],f=d?"appear":"enter";n.addClass(u,f,"active"),n.props.onEntering&&n.props.onEntering(l,a)},n.onEntered=function(l,a){var c=n.resolveArguments(l,a),u=c[0],d=c[1],f=d?"appear":"enter";n.removeClasses(u,f),n.addClass(u,f,"done"),n.props.onEntered&&n.props.onEntered(l,a)},n.onExit=function(l){var a=n.resolveArguments(l),c=a[0];n.removeClasses(c,"appear"),n.removeClasses(c,"enter"),n.addClass(c,"exit","base"),n.props.onExit&&n.props.onExit(l)},n.onExiting=function(l){var a=n.resolveArguments(l),c=a[0];n.addClass(c,"exit","active"),n.props.onExiting&&n.props.onExiting(l)},n.onExited=function(l){var a=n.resolveArguments(l),c=a[0];n.removeClasses(c,"exit"),n.addClass(c,"exit","done"),n.props.onExited&&n.props.onExited(l)},n.resolveArguments=function(l,a){return n.props.nodeRef?[n.props.nodeRef.current,l]:[l,a]},n.getClassNames=function(l){var a=n.props.classNames,c=typeof a=="string",u=c&&a?a+"-":"",d=c?""+u+l:a[l],f=c?d+"-active":a[l+"Active"],m=c?d+"-done":a[l+"Done"];return{baseClassName:d,activeClassName:f,doneClassName:m}},n}var o=e.prototype;return o.addClass=function(r,s,i){var l=this.getClassNames(s)[i+"ClassName"],a=this.getClassNames("enter"),c=a.doneClassName;s==="appear"&&i==="done"&&c&&(l+=" "+c),i==="active"&&r&&Zu(r),l&&(this.appliedClasses[s][i]=l,IA(r,l))},o.removeClasses=function(r,s){var i=this.appliedClasses[s],l=i.base,a=i.active,c=i.done;this.appliedClasses[s]={},l&&Ap(r,l),a&&Ap(r,a),c&&Ap(r,c)},o.render=function(){var r=this.props,s=r.classNames,i=Oi(r,["classNames"]);return w0.createElement(C0,Re({},i,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},e}(w0.Component);Tp.defaultProps={classNames:""};Tp.propTypes={};var ml=Tp;function S0(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}import{useContext as _A}from"react";import{createContext as RA}from"react";var Qu=RA({});var ue=()=>_A(Qu);var Ku=t=>t?{appear:`${t}--appear`,appearActive:`${t}--appearActive`,appearDone:`${t}--appearDone`,enter:`${t}--enter`,enterActive:`${t}--enterActive`,enterDone:`${t}--enterDone`,exit:`${t}--exit`,exitActive:`${t}--exitActive`,exitDone:`${t}--exitDone`}:{};wD();function I0(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 R0(t){for(var e=1;e<arguments.length;e++){var o=arguments[e]!=null?arguments[e]:{};e%2?I0(Object(o),!0).forEach(function(n){DA(t,n,o[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):I0(Object(o)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(o,n))})}return t}function DA(t,e,o){return e=AA(e),e in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t}function FA(t,e){if(typeof t!="object"||t===null)return t;var o=t[Symbol.toPrimitive];if(o!==void 0){var n=o.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function AA(t){var e=FA(t,"string");return typeof e=="symbol"?e:String(e)}var _0={activateTrap:function(e,o){if(e.length>0){var n=e[e.length-1];n!==o&&n.pause()}var r=e.indexOf(o);r===-1||e.splice(r,1),e.push(o)},deactivateTrap:function(e,o){var n=e.indexOf(o);n!==-1&&e.splice(n,1),e.length>0&&e[e.length-1].unpause()}},TA=function(e){return e.tagName&&e.tagName.toLowerCase()==="input"&&typeof e.select=="function"},EA=function(e){return e?.key==="Escape"||e?.key==="Esc"||e?.keyCode===27},pl=function(e){return e?.key==="Tab"||e?.keyCode===9},PA=function(e){return pl(e)&&!e.shiftKey},NA=function(e){return pl(e)&&e.shiftKey},D0=function(e){return setTimeout(e,0)},F0=function(e,o){var n=-1;return e.every(function(r,s){return o(r)?(n=s,!1):!0}),n},fl=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];return typeof e=="function"?e.apply(void 0,n):e},ed=function(e){return e.target.shadowRoot&&typeof e.composedPath=="function"?e.composedPath()[0]:e.target},LA=[],A0=function(e,o){var n=o?.document||document,r=o?.trapStack||LA,s=R0({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isKeyForward:PA,isKeyBackward:NA},o),i={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},l,a=function(I,D,E){return I&&I[D]!==void 0?I[D]:s[E||D]},c=function(I,D){var E=typeof D?.composedPath=="function"?D.composedPath():void 0;return i.containerGroups.findIndex(function(T){var L=T.container,k=T.tabbableNodes;return L.contains(I)||E?.includes(L)||k.find(function(j){return j===I})})},u=function(I){var D=s[I];if(typeof D=="function"){for(var E=arguments.length,T=new Array(E>1?E-1:0),L=1;L<E;L++)T[L-1]=arguments[L];D=D.apply(void 0,T)}if(D===!0&&(D=void 0),!D){if(D===void 0||D===!1)return D;throw new Error("`".concat(I,"` was specified but was not a node, or did not return a node"))}var k=D;if(typeof D=="string"&&(k=n.querySelector(D),!k))throw new Error("`".concat(I,"` as selector refers to no known node"));return k},d=function(){var I=u("initialFocus");if(I===!1)return!1;if(I===void 0||!wu(I,s.tabbableOptions))if(c(n.activeElement)>=0)I=n.activeElement;else{var D=i.tabbableGroups[0],E=D&&D.firstTabbableNode;I=E||u("fallbackFocus")}if(!I)throw new Error("Your focus-trap needs to have at least one focusable element");return I},f=function(){if(i.containerGroups=i.containers.map(function(I){var D=fv(I,s.tabbableOptions),E=pv(I,s.tabbableOptions),T=D.length>0?D[0]:void 0,L=D.length>0?D[D.length-1]:void 0,k=E.find(function(N){return Ts(N)}),j=E.slice().reverse().find(function(N){return Ts(N)}),P=!!D.find(function(N){return Ni(N)>0});return{container:I,tabbableNodes:D,focusableNodes:E,posTabIndexesFound:P,firstTabbableNode:T,lastTabbableNode:L,firstDomTabbableNode:k,lastDomTabbableNode:j,nextTabbableNode:function(B){var M=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,O=D.indexOf(B);return O<0?M?E.slice(E.indexOf(B)+1).find(function(V){return Ts(V)}):E.slice(0,E.indexOf(B)).reverse().find(function(V){return Ts(V)}):D[O+(M?1:-1)]}}}),i.tabbableGroups=i.containerGroups.filter(function(I){return I.tabbableNodes.length>0}),i.tabbableGroups.length<=0&&!u("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times");if(i.containerGroups.find(function(I){return I.posTabIndexesFound})&&i.containerGroups.length>1)throw new Error("At least one node with a positive tabindex was found in one of your focus-trap's multiple containers. Positive tabindexes are only supported in single-container focus-traps.")},m=function R(I){var D=I.activeElement;if(D)return D.shadowRoot&&D.shadowRoot.activeElement!==null?R(D.shadowRoot):D},h=function R(I){if(I!==!1&&I!==m(document)){if(!I||!I.focus){R(d());return}I.focus({preventScroll:!!s.preventScroll}),i.mostRecentlyFocusedNode=I,TA(I)&&I.select()}},p=function(I){var D=u("setReturnFocus",I);return D||(D===!1?!1:I)},g=function(I){var D=I.target,E=I.event,T=I.isBackward,L=T===void 0?!1:T;D=D||ed(E),f();var k=null;if(i.tabbableGroups.length>0){var j=c(D,E),P=j>=0?i.containerGroups[j]:void 0;if(j<0)L?k=i.tabbableGroups[i.tabbableGroups.length-1].lastTabbableNode:k=i.tabbableGroups[0].firstTabbableNode;else if(L){var N=F0(i.tabbableGroups,function(z){var X=z.firstTabbableNode;return D===X});if(N<0&&(P.container===D||wu(D,s.tabbableOptions)&&!Ts(D,s.tabbableOptions)&&!P.nextTabbableNode(D,!1))&&(N=j),N>=0){var B=N===0?i.tabbableGroups.length-1:N-1,M=i.tabbableGroups[B];k=Ni(D)>=0?M.lastTabbableNode:M.lastDomTabbableNode}else pl(E)||(k=P.nextTabbableNode(D,!1))}else{var O=F0(i.tabbableGroups,function(z){var X=z.lastTabbableNode;return D===X});if(O<0&&(P.container===D||wu(D,s.tabbableOptions)&&!Ts(D,s.tabbableOptions)&&!P.nextTabbableNode(D))&&(O=j),O>=0){var V=O===i.tabbableGroups.length-1?0:O+1,G=i.tabbableGroups[V];k=Ni(D)>=0?G.firstTabbableNode:G.firstDomTabbableNode}else pl(E)||(k=P.nextTabbableNode(D))}}else k=u("fallbackFocus");return k},b=function(I){var D=ed(I);if(!(c(D,I)>=0)){if(fl(s.clickOutsideDeactivates,I)){l.deactivate({returnFocus:s.returnFocusOnDeactivate});return}fl(s.allowOutsideClick,I)||I.preventDefault()}},v=function(I){var D=ed(I),E=c(D,I)>=0;if(E||D instanceof Document)E&&(i.mostRecentlyFocusedNode=D);else{I.stopImmediatePropagation();var T,L=!0;if(i.mostRecentlyFocusedNode)if(Ni(i.mostRecentlyFocusedNode)>0){var k=c(i.mostRecentlyFocusedNode),j=i.containerGroups[k].tabbableNodes;if(j.length>0){var P=j.findIndex(function(N){return N===i.mostRecentlyFocusedNode});P>=0&&(s.isKeyForward(i.recentNavEvent)?P+1<j.length&&(T=j[P+1],L=!1):P-1>=0&&(T=j[P-1],L=!1))}}else i.containerGroups.some(function(N){return N.tabbableNodes.some(function(B){return Ni(B)>0})})||(L=!1);else L=!1;L&&(T=g({target:i.mostRecentlyFocusedNode,isBackward:s.isKeyBackward(i.recentNavEvent)})),h(T||i.mostRecentlyFocusedNode||d())}i.recentNavEvent=void 0},x=function(I){var D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;i.recentNavEvent=I;var E=g({event:I,isBackward:D});E&&(pl(I)&&I.preventDefault(),h(E))},y=function(I){if(EA(I)&&fl(s.escapeDeactivates,I)!==!1){I.preventDefault(),l.deactivate();return}(s.isKeyForward(I)||s.isKeyBackward(I))&&x(I,s.isKeyBackward(I))},C=function(I){var D=ed(I);c(D,I)>=0||fl(s.clickOutsideDeactivates,I)||fl(s.allowOutsideClick,I)||(I.preventDefault(),I.stopImmediatePropagation())},S=function(){if(i.active)return _0.activateTrap(r,l),i.delayInitialFocusTimer=s.delayInitialFocus?D0(function(){h(d())}):h(d()),n.addEventListener("focusin",v,!0),n.addEventListener("mousedown",b,{capture:!0,passive:!1}),n.addEventListener("touchstart",b,{capture:!0,passive:!1}),n.addEventListener("click",C,{capture:!0,passive:!1}),n.addEventListener("keydown",y,{capture:!0,passive:!1}),l},w=function(){if(i.active)return n.removeEventListener("focusin",v,!0),n.removeEventListener("mousedown",b,!0),n.removeEventListener("touchstart",b,!0),n.removeEventListener("click",C,!0),n.removeEventListener("keydown",y,!0),l},F=function(I){var D=I.some(function(E){var T=Array.from(E.removedNodes);return T.some(function(L){return L===i.mostRecentlyFocusedNode})});D&&h(d())},_=typeof window<"u"&&"MutationObserver"in window?new MutationObserver(F):void 0,A=function(){_&&(_.disconnect(),i.active&&!i.paused&&i.containers.map(function(I){_.observe(I,{subtree:!0,childList:!0})}))};return l={get active(){return i.active},get paused(){return i.paused},activate:function(I){if(i.active)return this;var D=a(I,"onActivate"),E=a(I,"onPostActivate"),T=a(I,"checkCanFocusTrap");T||f(),i.active=!0,i.paused=!1,i.nodeFocusedBeforeActivation=n.activeElement,D?.();var L=function(){T&&f(),S(),A(),E?.()};return T?(T(i.containers.concat()).then(L,L),this):(L(),this)},deactivate:function(I){if(!i.active)return this;var D=R0({onDeactivate:s.onDeactivate,onPostDeactivate:s.onPostDeactivate,checkCanReturnFocus:s.checkCanReturnFocus},I);clearTimeout(i.delayInitialFocusTimer),i.delayInitialFocusTimer=void 0,w(),i.active=!1,i.paused=!1,A(),_0.deactivateTrap(r,l);var E=a(D,"onDeactivate"),T=a(D,"onPostDeactivate"),L=a(D,"checkCanReturnFocus"),k=a(D,"returnFocus","returnFocusOnDeactivate");E?.();var j=function(){D0(function(){k&&h(p(i.nodeFocusedBeforeActivation)),T?.()})};return k&&L?(L(p(i.nodeFocusedBeforeActivation)).then(j,j),this):(j(),this)},pause:function(I){if(i.paused||!i.active)return this;var D=a(I,"onPause"),E=a(I,"onPostPause");return i.paused=!0,D?.(),w(),A(),E?.(),this},unpause:function(I){if(!i.paused||!i.active)return this;var D=a(I,"onUnpause"),E=a(I,"onPostUnpause");return i.paused=!1,D?.(),f(),S(),A(),E?.(),this},updateContainerElements:function(I){var D=[].concat(I).filter(Boolean);return i.containers=D.map(function(E){return typeof E=="string"?n.querySelector(E):E}),i.active&&f(),A(),this}},l.updateContainerElements(e),l};var $A=function(t,e){var o={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(o[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(t);r<n.length;r++)e.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(t,n[r])&&(o[n[r]]=t[n[r]]);return o},hn="modal-item",E0=(t,e)=>n=>{let r=ue(),s=T0(null),[i,l]=Pp(!1),a=T0(!1),[c,u]=Pp(null),{modalState:d,classPrefix:f,containerRef:m,transTime:h,setCloseOnBlur:p,setBodyScrollLock:g,openModal:b}=r,{className:v,htmlElement:x="dialog",slug:y="",closeOnBlur:C=!0,lockBodyScroll:S=!0,classPrefix:w,onEnter:F,onEntering:_,onEntered:A,onExit:R,onExiting:I,onExited:D,openOnInit:E,trapFocus:T=!0,focusTrapOptions:L={}}=n,k=$A(n,["className","htmlElement","slug","closeOnBlur","lockBodyScroll","classPrefix","onEnter","onEntering","onEntered","onExit","onExiting","onExited","openOnInit","trapFocus","focusTrapOptions"]),j=w||f,P=e||y,N=d[P]&&d[P].isOpen;Os(()=>{if(T){let O=s.current;if(a.current===!1&&O){let V=A0(O,Object.assign(Object.assign({},L),{fallbackFocus:L?.fallbackFocus||O,allowOutsideClick:typeof L.allowOutsideClick<"u"?L.allowOutsideClick:!0}));u(V),a.current=!0}}},[T,i,L]),Os(()=>{l(!0)},[]),Os(()=>(c&&(N?c.activate():c.deactivate()),()=>{c&&c.deactivate()}),[N,c]),Os(()=>{N&&p(C)},[N,C,p]),Os(()=>{let O=s.current;return O&&g(!!(N&&S),O),()=>{O&&g(!1,O)}},[N,S,g]);let[B,M]=Pp(N);if(Os(()=>{N?M(N):setTimeout(()=>M(!1),h)},[N,h]),Os(()=>{E&&b(P)},[P,E,b]),m.current){let O=j?`${j}__${hn}`:hn,V=[O,`${O}--slug-${P}`,v].filter(Boolean).join(" "),G=Object.assign({role:x!=="dialog"?"dialog":void 0,open:x==="dialog"?B||N:void 0,"aria-modal":!0,"aria-label":k["aria-labelledby"]?void 0:P},k);return kA.createPortal(Ep(ml,{nodeRef:s,timeout:h,in:N,classNames:Ku(O),appear:!0,onEnter:F,onEntering:_,onEntered:A,onExit:R,onExiting:I,onExited:D,children:Ep(x,Object.assign({ref:s,id:k?.id||P,className:V},G,{children:Ep(t,Object.assign({},n,{isOpen:N,modal:r}))}))}),m.current)}return null};import{jsx as P0}from"react/jsx-runtime";import{Fragment as N0}from"react";var jA=t=>{let{children:e}=t;return e?typeof e=="function"?P0(N0,{children:e(t)}):P0(N0,{children:e}):null},Zo=E0(jA);import{jsx as L0}from"react/jsx-runtime";var OA=function(t,e){var o={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(o[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,n=Object.getOwnPropertySymbols(t);r<n.length;r++)e.indexOf(n[r])<0&&Object.prototype.propertyIsEnumerable.call(t,n[r])&&(o[n[r]]=t[n[r]]);return o},gn="modal-container",Np=t=>{let{oneModalIsOpen:e,classPrefix:o,transTime:n,setContainerRef:r,containerRef:s,closeAllModals:i,closeOnBlur:l}=ue(),{className:a,htmlElement:c="div",children:u,onClick:d}=t,f=OA(t,["className","htmlElement","children","onClick"]),m=o?`${o}__${gn}`:gn,h=[m,a].filter(Boolean).join(" "),p=Object.assign(Object.assign({},f),{onClick:g=>{l&&i(),typeof d=="function"&&d(g)}});return L0(ml,{nodeRef:s,in:e,timeout:n,classNames:Ku(m),appear:!0,children:L0(c,Object.assign({className:h,ref:r},p,{children:u&&u}))})};import{jsx as V0,jsxs as XA}from"react/jsx-runtime";import{Fragment as UA,useState as nd,useRef as G0,useEffect as sd,useCallback as Jn,useReducer as YA}from"react";function MA(t){if(Array.isArray(t)){for(var e=0,o=Array(t.length);e<t.length;e++)o[e]=t[e];return o}else return Array.from(t)}var $p=!1;typeof window<"u"&&(Lp={get passive(){$p=!0}},window.addEventListener("testPassive",null,Lp),window.removeEventListener("testPassive",null,Lp));var Lp,td=typeof window<"u"&&window.navigator&&window.navigator.platform&&(/iP(ad|hone|od)/.test(window.navigator.platform)||window.navigator.platform==="MacIntel"&&window.navigator.maxTouchPoints>1),Bs=[],od=!1,$0=-1,hl=void 0,Ms=void 0,gl=void 0,k0=function(e){return Bs.some(function(o){return!!(o.options.allowTouchMove&&o.options.allowTouchMove(e))})},rd=function(e){var o=e||window.event;return k0(o.target)||o.touches.length>1?!0:(o.preventDefault&&o.preventDefault(),!1)},BA=function(e){if(gl===void 0){var o=!!e&&e.reserveScrollBarGap===!0,n=window.innerWidth-document.documentElement.clientWidth;if(o&&n>0){var r=parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right"),10);gl=document.body.style.paddingRight,document.body.style.paddingRight=r+n+"px"}}hl===void 0&&(hl=document.body.style.overflow,document.body.style.overflow="hidden")},VA=function(){gl!==void 0&&(document.body.style.paddingRight=gl,gl=void 0),hl!==void 0&&(document.body.style.overflow=hl,hl=void 0)},GA=function(){return window.requestAnimationFrame(function(){if(Ms===void 0){Ms={position:document.body.style.position,top:document.body.style.top,left:document.body.style.left};var e=window,o=e.scrollY,n=e.scrollX,r=e.innerHeight;document.body.style.position="fixed",document.body.style.top=-o,document.body.style.left=-n,setTimeout(function(){return window.requestAnimationFrame(function(){var s=r-window.innerHeight;s&&o>=r&&(document.body.style.top=-(o+s))})},300)}})},WA=function(){if(Ms!==void 0){var e=-parseInt(document.body.style.top,10),o=-parseInt(document.body.style.left,10);document.body.style.position=Ms.position,document.body.style.top=Ms.top,document.body.style.left=Ms.left,window.scrollTo(o,e),Ms=void 0}},HA=function(e){return e?e.scrollHeight-e.scrollTop<=e.clientHeight:!1},zA=function(e,o){var n=e.targetTouches[0].clientY-$0;return k0(e.target)?!1:o&&o.scrollTop===0&&n>0||HA(o)&&n<0?rd(e):(e.stopPropagation(),!0)},j0=function(e,o){if(!e){console.error("disableBodyScroll unsuccessful - targetElement must be provided when calling disableBodyScroll on IOS devices.");return}if(!Bs.some(function(r){return r.targetElement===e})){var n={targetElement:e,options:o||{}};Bs=[].concat(MA(Bs),[n]),td?GA():BA(o),td&&(e.ontouchstart=function(r){r.targetTouches.length===1&&($0=r.targetTouches[0].clientY)},e.ontouchmove=function(r){r.targetTouches.length===1&&zA(r,e)},od||(document.addEventListener("touchmove",rd,$p?{passive:!1}:void 0),od=!0))}};var O0=function(e){if(!e){console.error("enableBodyScroll unsuccessful - targetElement must be provided when calling enableBodyScroll on IOS devices.");return}Bs=Bs.filter(function(o){return o.targetElement!==e}),td&&(e.ontouchstart=null,e.ontouchmove=null,od&&Bs.length===0&&(document.removeEventListener("touchmove",rd,$p?{passive:!1}:void 0),od=!1)),td?WA():VA()};var M0=({classPrefix:t,zIndex:e})=>{let o=t?`${t}__`:"";return`
14
+ .${o}${gn} {
15
15
  top: 0;
16
16
  right: 0;
17
17
  bottom: 0;
@@ -22,40 +22,40 @@ import{a as Wf,b as H,c as Hf,d as St,e as SD,f as ID,g as zf,h as RD,i as _D}fr
22
22
  z-index: -1;
23
23
  }
24
24
 
25
- .${o}${hn}--appear,
26
- .${o}${hn}--appearDone,
27
- .${o}${hn}--enter,
28
- .${o}${hn}--enterDone,
29
- .${o}${hn}--exit {
25
+ .${o}${gn}--appear,
26
+ .${o}${gn}--appearDone,
27
+ .${o}${gn}--enter,
28
+ .${o}${gn}--enterDone,
29
+ .${o}${gn}--exit {
30
30
  pointer-events: all;
31
31
  visibility: visible;
32
32
  z-index: ${e};
33
33
  }
34
34
 
35
- .${o}${pn} {
35
+ .${o}${hn} {
36
36
  position: absolute;
37
37
  visibility: hidden;
38
38
  }
39
39
 
40
- .${o}${pn}--appear,
41
- .${o}${pn}--appearDone,
42
- .${o}${pn}--enter,
43
- .${o}${pn}--enterDone,
44
- .${o}${pn}--exit {
40
+ .${o}${hn}--appear,
41
+ .${o}${hn}--appearDone,
42
+ .${o}${hn}--enter,
43
+ .${o}${hn}--enterDone,
44
+ .${o}${hn}--exit {
45
45
  visibility: visible;
46
46
  }
47
- `};var O0=(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,a)=>{let l=o[a];return l.isOpen&&typeof l.openedOn=="number"&&(!i||typeof i.openedOn=="number"&&l.openedOn>i.openedOn)?l: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,a])=>(s[i]=Object.assign(Object.assign({},a),{isOpen:!1,openedOn:void 0}),s),{});break}default:break}return o};var ZA=()=>{if(typeof window<"u")return new URLSearchParams(window.location.search)},JA=()=>{let t=ZA(),e=[];if(t){let o=t.get("modal");o&&(o.includes(",")?e=o.split(","):e=[o])}return e},Lp=t=>{let{classPrefix:e,minifyCSS:o=!0,generateCSS:n=!0,zIndex:r=9999,handleParamChange:s,children:i,transTime:a=250}=t,l=B0(null),[c,u]=YA(O0,{},()=>JA().reduce((T,$)=>(T[$]={slug:$,isOpen:!0,openedOn:Date.now()},T),{})),[d,f]=rd(!1),[m,h]=rd(!1),[p,g]=rd(!1),[b,v]=rd(""),x=B0(!1),y=Zn(I=>{I.keyCode===27&&u({type:"CLOSE_LATEST_MODAL"})},[]);nd(()=>(x.current||(document.addEventListener("keydown",I=>y(I),!1),x.current=!0),()=>{x.current&&document.removeEventListener("keydown",I=>y(I),!1)}),[y]),nd(()=>{if(n){let I="";I=j0({classPrefix:e,zIndex:r}),o&&(I=I.replace(/\n/g,"").replace(/\s\s+/g," ")),v(I)}},[n,o,r,e]),nd(()=>{if(typeof s=="function"&&s(c),typeof s=="boolean"&&s){let I=Object.keys(c).filter(j=>c[j].isOpen),E=new URLSearchParams;for(let j of I)E.append("modal",j);let T=E.toString()?`?${E}`:"",$=`${window.location.pathname}${T}`;window.history.pushState({},"",$)}},[c,s]),nd(()=>{let I=Object.keys(c).some(E=>c[E].isOpen);f(I)},[c]);let C=Zn((I,E)=>{E&&(I?($0(E),g(!0)):(k0(E),g(!1)))},[]),S=Zn(I=>{l.current=I},[]),w=Zn(I=>{u({type:"OPEN_MODAL",payload:{slug:I}})},[]),D=Zn(I=>{u({type:"CLOSE_MODAL",payload:{slug:I}})},[]),_=Zn(()=>{u({type:"CLOSE_ALL_MODALS"})},[]),A=Zn(I=>{u({type:"TOGGLE_MODAL",payload:{slug:I}})},[]),F=Zn(I=>c[I]&&c[I].isOpen,[c]),R=Object.assign({},t);return delete R.children,XA(UA,{children:[n&&M0("style",{dangerouslySetInnerHTML:{__html:b}}),M0(qu.Provider,{value:Object.assign(Object.assign({},R),{transTime:a,containerRef:l,modalState:c,oneModalIsOpen:d,isModalOpen:F,closeOnBlur:m,bodyScrollIsLocked:p,classPrefix:e,closeAllModals:_,setCloseOnBlur:h,openModal:w,closeModal:D,toggleModal:A,setBodyScrollLock:C,setContainerRef:S}),children:i})]})};import{usePathname as VT,useRouter as GT}from"next/navigation.js";import{formatAdminURL as WT}from"payload/shared";import*as Q0 from"qs-esm";import J0,{createContext as HT,use as zT,useCallback as Ms,useEffect as cd,useState as xl}from"react";import ye,{forwardRef as qA,isValidElement as $p}from"react";import QA from"react-dom";import Mo from"react";import V0 from"react";import lT from"react";var KA=t=>{switch(t){case"success":return oT;case"info":return nT;case"warning":return rT;case"error":return sT;default:return null}},eT=Array(12).fill(0),tT=({visible:t,className:e})=>Mo.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":t},Mo.createElement("div",{className:"sonner-spinner"},eT.map((o,n)=>Mo.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),oT=Mo.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Mo.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),rT=Mo.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},Mo.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),nT=Mo.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Mo.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),sT=Mo.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Mo.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),iT=Mo.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},Mo.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),Mo.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),aT=()=>{let[t,e]=V0.useState(document.hidden);return V0.useEffect(()=>{let o=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",o),()=>window.removeEventListener("visibilitychange",o)},[]),t},kp=1,cT=class{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{let e=this.subscribers.indexOf(t);this.subscribers.splice(e,1)}),this.publish=t=>{this.subscribers.forEach(e=>e(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var e;let{message:o,...n}=t,r=typeof t?.id=="number"||((e=t.id)==null?void 0:e.length)>0?t.id:kp++,s=this.toasts.find(a=>a.id===r),i=t.dismissible===void 0?!0:t.dismissible;return s?this.toasts=this.toasts.map(a=>a.id===r?(this.publish({...a,...t,id:r,title:o}),{...a,...t,id:r,dismissible:i,title:o}):a):this.addToast({title:o,...n,dismissible:i,id:r}),r},this.dismiss=t=>(t||this.toasts.forEach(e=>{this.subscribers.forEach(o=>o({id:e.id,dismiss:!0}))}),this.subscribers.forEach(e=>e({id:t,dismiss:!0})),t),this.message=(t,e)=>this.create({...e,message:t}),this.error=(t,e)=>this.create({...e,message:t,type:"error"}),this.success=(t,e)=>this.create({...e,type:"success",message:t}),this.info=(t,e)=>this.create({...e,type:"info",message:t}),this.warning=(t,e)=>this.create({...e,type:"warning",message:t}),this.loading=(t,e)=>this.create({...e,type:"loading",message:t}),this.promise=(t,e)=>{if(!e)return;let o;e.loading!==void 0&&(o=this.create({...e,promise:t,type:"loading",message:e.loading,description:typeof e.description!="function"?e.description:void 0}));let n=t instanceof Promise?t:t(),r=o!==void 0,s,i=n.then(async l=>{if(s=["resolve",l],lT.isValidElement(l))r=!1,this.create({id:o,type:"default",message:l});else if(dT(l)&&!l.ok){r=!1;let c=typeof e.error=="function"?await e.error(`HTTP error! status: ${l.status}`):e.error,u=typeof e.description=="function"?await e.description(`HTTP error! status: ${l.status}`):e.description;this.create({id:o,type:"error",message:c,description:u})}else if(e.success!==void 0){r=!1;let c=typeof e.success=="function"?await e.success(l):e.success,u=typeof e.description=="function"?await e.description(l):e.description;this.create({id:o,type:"success",message:c,description:u})}}).catch(async l=>{if(s=["reject",l],e.error!==void 0){r=!1;let c=typeof e.error=="function"?await e.error(l):e.error,u=typeof e.description=="function"?await e.description(l):e.description;this.create({id:o,type:"error",message:c,description:u})}}).finally(()=>{var l;r&&(this.dismiss(o),o=void 0),(l=e.finally)==null||l.call(e)}),a=()=>new Promise((l,c)=>i.then(()=>s[0]==="reject"?c(s[1]):l(s[1])).catch(c));return typeof o!="string"&&typeof o!="number"?{unwrap:a}:Object.assign(o,{unwrap:a})},this.custom=(t,e)=>{let o=e?.id||kp++;return this.create({jsx:t(o),id:o,...e}),o},this.subscribers=[],this.toasts=[]}},Zo=new cT,uT=(t,e)=>{let o=e?.id||kp++;return Zo.addToast({title:t,...e,id:o}),o},dT=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",mT=uT,fT=()=>Zo.toasts,fe=Object.assign(mT,{success:Zo.success,info:Zo.info,warning:Zo.warning,error:Zo.error,custom:Zo.custom,message:Zo.message,promise:Zo.promise,dismiss:Zo.dismiss,loading:Zo.loading},{getHistory:fT});function pT(t,{insertAt:e}={}){if(!t||typeof document>"u")return;let o=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",e==="top"&&o.firstChild?o.insertBefore(n,o.firstChild):o.appendChild(n),n.styleSheet?n.styleSheet.cssText=t:n.appendChild(document.createTextNode(t))}pT(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
48
- `);function sd(t){return t.label!==void 0}var hT=3,gT="32px",bT="16px",G0=4e3,vT=356,xT=14,yT=20,CT=200;function Dr(...t){return t.filter(Boolean).join(" ")}function wT(t){let[e,o]=t.split("-"),n=[];return e&&n.push(e),o&&n.push(o),n}var ST=t=>{var e,o,n,r,s,i,a,l,c,u,d;let{invert:f,toast:m,unstyled:h,interacting:p,setHeights:g,visibleToasts:b,heights:v,index:x,toasts:y,expanded:C,removeToast:S,defaultRichColors:w,closeButton:D,style:_,cancelButtonStyle:A,actionButtonStyle:F,className:R="",descriptionClassName:I="",duration:E,position:T,gap:$,loadingIcon:j,expandByDefault:N,classNames:P,icons:L,closeButtonAriaLabel:V="Close toast",pauseWhenPageIsHidden:M}=t,[O,B]=ye.useState(null),[G,X]=ye.useState(null),[Z,te]=ye.useState(!1),[U,z]=ye.useState(!1),[ce,J]=ye.useState(!1),[ue,re]=ye.useState(!1),[q,pe]=ye.useState(!1),[he,_e]=ye.useState(0),[ge,Ve]=ye.useState(0),Q=ye.useRef(m.duration||E||G0),Le=ye.useRef(null),De=ye.useRef(null),ae=x===0,se=x+1<=b,Y=m.type,ie=m.dismissible!==!1,me=m.className||"",we=m.descriptionClassName||"",ze=ye.useMemo(()=>v.findIndex(be=>be.toastId===m.id)||0,[v,m.id]),$e=ye.useMemo(()=>{var be;return(be=m.closeButton)!=null?be:D},[m.closeButton,D]),ot=ye.useMemo(()=>m.duration||E||G0,[m.duration,E]),Xe=ye.useRef(0),Ue=ye.useRef(0),ft=ye.useRef(0),Qt=ye.useRef(null),[Ge,Je]=T.split("-"),Ye=ye.useMemo(()=>v.reduce((be,K,W)=>W>=ze?be:be+K.height,0),[v,ze]),xt=aT(),jt=m.invert||f,gt=Y==="loading";Ue.current=ye.useMemo(()=>ze*$+Ye,[ze,Ye]),ye.useEffect(()=>{Q.current=ot},[ot]),ye.useEffect(()=>{te(!0)},[]),ye.useEffect(()=>{let be=De.current;if(be){let K=be.getBoundingClientRect().height;return Ve(K),g(W=>[{toastId:m.id,height:K,position:m.position},...W]),()=>g(W=>W.filter(ee=>ee.toastId!==m.id))}},[g,m.id]),ye.useLayoutEffect(()=>{if(!Z)return;let be=De.current,K=be.style.height;be.style.height="auto";let W=be.getBoundingClientRect().height;be.style.height=K,Ve(W),g(ee=>ee.find(le=>le.toastId===m.id)?ee.map(le=>le.toastId===m.id?{...le,height:W}:le):[{toastId:m.id,height:W,position:m.position},...ee])},[Z,m.title,m.description,g,m.id]);let qe=ye.useCallback(()=>{z(!0),_e(Ue.current),g(be=>be.filter(K=>K.toastId!==m.id)),setTimeout(()=>{S(m)},CT)},[m,S,g,Ue]);ye.useEffect(()=>{if(m.promise&&Y==="loading"||m.duration===1/0||m.type==="loading")return;let be;return C||p||M&&xt?(()=>{if(ft.current<Xe.current){let K=new Date().getTime()-Xe.current;Q.current=Q.current-K}ft.current=new Date().getTime()})():Q.current!==1/0&&(Xe.current=new Date().getTime(),be=setTimeout(()=>{var K;(K=m.onAutoClose)==null||K.call(m,m),qe()},Q.current)),()=>clearTimeout(be)},[C,p,m,Y,M,xt,qe]),ye.useEffect(()=>{m.delete&&qe()},[qe,m.delete]);function Tt(){var be,K,W;return L!=null&&L.loading?ye.createElement("div",{className:Dr(P?.loader,(be=m?.classNames)==null?void 0:be.loader,"sonner-loader"),"data-visible":Y==="loading"},L.loading):j?ye.createElement("div",{className:Dr(P?.loader,(K=m?.classNames)==null?void 0:K.loader,"sonner-loader"),"data-visible":Y==="loading"},j):ye.createElement(tT,{className:Dr(P?.loader,(W=m?.classNames)==null?void 0:W.loader),visible:Y==="loading"})}return ye.createElement("li",{tabIndex:0,ref:De,className:Dr(R,me,P?.toast,(e=m?.classNames)==null?void 0:e.toast,P?.default,P?.[Y],(o=m?.classNames)==null?void 0:o[Y]),"data-sonner-toast":"","data-rich-colors":(n=m.richColors)!=null?n:w,"data-styled":!(m.jsx||m.unstyled||h),"data-mounted":Z,"data-promise":!!m.promise,"data-swiped":q,"data-removed":U,"data-visible":se,"data-y-position":Ge,"data-x-position":Je,"data-index":x,"data-front":ae,"data-swiping":ce,"data-dismissible":ie,"data-type":Y,"data-invert":jt,"data-swipe-out":ue,"data-swipe-direction":G,"data-expanded":!!(C||N&&Z),style:{"--index":x,"--toasts-before":x,"--z-index":y.length-x,"--offset":`${U?he:Ue.current}px`,"--initial-height":N?"auto":`${ge}px`,..._,...m.style},onPointerDown:be=>{gt||!ie||(Le.current=new Date,_e(Ue.current),be.target.setPointerCapture(be.pointerId),be.target.tagName!=="BUTTON"&&(J(!0),Qt.current={x:be.clientX,y:be.clientY}))},onPointerUp:()=>{var be,K,W,ee;if(ue||!ie)return;Qt.current=null;let le=Number(((be=De.current)==null?void 0:be.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),ve=Number(((K=De.current)==null?void 0:K.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),Fe=new Date().getTime()-((W=Le.current)==null?void 0:W.getTime()),Se=O==="x"?le:ve,We=Math.abs(Se)/Fe;if(Math.abs(Se)>=yT||We>.11){_e(Ue.current),(ee=m.onDismiss)==null||ee.call(m,m),X(O==="x"?le>0?"right":"left":ve>0?"down":"up"),qe(),re(!0),pe(!1);return}J(!1),B(null)},onPointerMove:be=>{var K,W,ee,le;if(!Qt.current||!ie||((K=window.getSelection())==null?void 0:K.toString().length)>0)return;let ve=be.clientY-Qt.current.y,Fe=be.clientX-Qt.current.x,Se=(W=t.swipeDirections)!=null?W:wT(T);!O&&(Math.abs(Fe)>1||Math.abs(ve)>1)&&B(Math.abs(Fe)>Math.abs(ve)?"x":"y");let We={x:0,y:0};O==="y"?(Se.includes("top")||Se.includes("bottom"))&&(Se.includes("top")&&ve<0||Se.includes("bottom")&&ve>0)&&(We.y=ve):O==="x"&&(Se.includes("left")||Se.includes("right"))&&(Se.includes("left")&&Fe<0||Se.includes("right")&&Fe>0)&&(We.x=Fe),(Math.abs(We.x)>0||Math.abs(We.y)>0)&&pe(!0),(ee=De.current)==null||ee.style.setProperty("--swipe-amount-x",`${We.x}px`),(le=De.current)==null||le.style.setProperty("--swipe-amount-y",`${We.y}px`)}},$e&&!m.jsx?ye.createElement("button",{"aria-label":V,"data-disabled":gt,"data-close-button":!0,onClick:gt||!ie?()=>{}:()=>{var be;qe(),(be=m.onDismiss)==null||be.call(m,m)},className:Dr(P?.closeButton,(r=m?.classNames)==null?void 0:r.closeButton)},(s=L?.close)!=null?s:iT):null,m.jsx||$p(m.title)?m.jsx?m.jsx:typeof m.title=="function"?m.title():m.title:ye.createElement(ye.Fragment,null,Y||m.icon||m.promise?ye.createElement("div",{"data-icon":"",className:Dr(P?.icon,(i=m?.classNames)==null?void 0:i.icon)},m.promise||m.type==="loading"&&!m.icon?m.icon||Tt():null,m.type!=="loading"?m.icon||L?.[Y]||KA(Y):null):null,ye.createElement("div",{"data-content":"",className:Dr(P?.content,(a=m?.classNames)==null?void 0:a.content)},ye.createElement("div",{"data-title":"",className:Dr(P?.title,(l=m?.classNames)==null?void 0:l.title)},typeof m.title=="function"?m.title():m.title),m.description?ye.createElement("div",{"data-description":"",className:Dr(I,we,P?.description,(c=m?.classNames)==null?void 0:c.description)},typeof m.description=="function"?m.description():m.description):null),$p(m.cancel)?m.cancel:m.cancel&&sd(m.cancel)?ye.createElement("button",{"data-button":!0,"data-cancel":!0,style:m.cancelButtonStyle||A,onClick:be=>{var K,W;sd(m.cancel)&&ie&&((W=(K=m.cancel).onClick)==null||W.call(K,be),qe())},className:Dr(P?.cancelButton,(u=m?.classNames)==null?void 0:u.cancelButton)},m.cancel.label):null,$p(m.action)?m.action:m.action&&sd(m.action)?ye.createElement("button",{"data-button":!0,"data-action":!0,style:m.actionButtonStyle||F,onClick:be=>{var K,W;sd(m.action)&&((W=(K=m.action).onClick)==null||W.call(K,be),!be.defaultPrevented&&qe())},className:Dr(P?.actionButton,(d=m?.classNames)==null?void 0:d.actionButton)},m.action.label):null))};function W0(){if(typeof window>"u"||typeof document>"u")return"ltr";let t=document.documentElement.getAttribute("dir");return t==="auto"||!t?window.getComputedStyle(document.documentElement).direction:t}function IT(t,e){let o={};return[t,e].forEach((n,r)=>{let s=r===1,i=s?"--mobile-offset":"--offset",a=s?bT:gT;function l(c){["top","right","bottom","left"].forEach(u=>{o[`${i}-${u}`]=typeof c=="number"?`${c}px`:c})}typeof n=="number"||typeof n=="string"?l(n):typeof n=="object"?["top","right","bottom","left"].forEach(c=>{n[c]===void 0?o[`${i}-${c}`]=a:o[`${i}-${c}`]=typeof n[c]=="number"?`${n[c]}px`:n[c]}):l(a)}),o}var H0=qA(function(t,e){let{invert:o,position:n="bottom-right",hotkey:r=["altKey","KeyT"],expand:s,closeButton:i,className:a,offset:l,mobileOffset:c,theme:u="light",richColors:d,duration:f,style:m,visibleToasts:h=hT,toastOptions:p,dir:g=W0(),gap:b=xT,loadingIcon:v,icons:x,containerAriaLabel:y="Notifications",pauseWhenPageIsHidden:C}=t,[S,w]=ye.useState([]),D=ye.useMemo(()=>Array.from(new Set([n].concat(S.filter(M=>M.position).map(M=>M.position)))),[S,n]),[_,A]=ye.useState([]),[F,R]=ye.useState(!1),[I,E]=ye.useState(!1),[T,$]=ye.useState(u!=="system"?u:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),j=ye.useRef(null),N=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),P=ye.useRef(null),L=ye.useRef(!1),V=ye.useCallback(M=>{w(O=>{var B;return(B=O.find(G=>G.id===M.id))!=null&&B.delete||Zo.dismiss(M.id),O.filter(({id:G})=>G!==M.id)})},[]);return ye.useEffect(()=>Zo.subscribe(M=>{if(M.dismiss){w(O=>O.map(B=>B.id===M.id?{...B,delete:!0}:B));return}setTimeout(()=>{QA.flushSync(()=>{w(O=>{let B=O.findIndex(G=>G.id===M.id);return B!==-1?[...O.slice(0,B),{...O[B],...M},...O.slice(B+1)]:[M,...O]})})})}),[]),ye.useEffect(()=>{if(u!=="system"){$(u);return}if(u==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?$("dark"):$("light")),typeof window>"u")return;let M=window.matchMedia("(prefers-color-scheme: dark)");try{M.addEventListener("change",({matches:O})=>{$(O?"dark":"light")})}catch{M.addListener(({matches:B})=>{try{$(B?"dark":"light")}catch(G){console.error(G)}})}},[u]),ye.useEffect(()=>{S.length<=1&&R(!1)},[S]),ye.useEffect(()=>{let M=O=>{var B,G;r.every(X=>O[X]||O.code===X)&&(R(!0),(B=j.current)==null||B.focus()),O.code==="Escape"&&(document.activeElement===j.current||(G=j.current)!=null&&G.contains(document.activeElement))&&R(!1)};return document.addEventListener("keydown",M),()=>document.removeEventListener("keydown",M)},[r]),ye.useEffect(()=>{if(j.current)return()=>{P.current&&(P.current.focus({preventScroll:!0}),P.current=null,L.current=!1)}},[j.current]),ye.createElement("section",{ref:e,"aria-label":`${y} ${N}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},D.map((M,O)=>{var B;let[G,X]=M.split("-");return S.length?ye.createElement("ol",{key:M,dir:g==="auto"?W0():g,tabIndex:-1,ref:j,className:a,"data-sonner-toaster":!0,"data-theme":T,"data-y-position":G,"data-lifted":F&&S.length>1&&!s,"data-x-position":X,style:{"--front-toast-height":`${((B=_[0])==null?void 0:B.height)||0}px`,"--width":`${vT}px`,"--gap":`${b}px`,...m,...IT(l,c)},onBlur:Z=>{L.current&&!Z.currentTarget.contains(Z.relatedTarget)&&(L.current=!1,P.current&&(P.current.focus({preventScroll:!0}),P.current=null))},onFocus:Z=>{Z.target instanceof HTMLElement&&Z.target.dataset.dismissible==="false"||L.current||(L.current=!0,P.current=Z.relatedTarget)},onMouseEnter:()=>R(!0),onMouseMove:()=>R(!0),onMouseLeave:()=>{I||R(!1)},onPointerDown:Z=>{Z.target instanceof HTMLElement&&Z.target.dataset.dismissible==="false"||E(!0)},onPointerUp:()=>E(!1)},S.filter(Z=>!Z.position&&O===0||Z.position===M).map((Z,te)=>{var U,z;return ye.createElement(ST,{key:Z.id,icons:x,index:te,toast:Z,defaultRichColors:d,duration:(U=p?.duration)!=null?U:f,className:p?.className,descriptionClassName:p?.descriptionClassName,invert:o,visibleToasts:h,closeButton:(z=p?.closeButton)!=null?z:i,interacting:I,position:M,style:p?.style,unstyled:p?.unstyled,classNames:p?.classNames,cancelButtonStyle:p?.cancelButtonStyle,actionButtonStyle:p?.actionButtonStyle,removeToast:V,toasts:S.filter(ce=>ce.position==Z.position),heights:_.filter(ce=>ce.position==Z.position),setHeights:A,expandByDefault:s,gap:b,loadingIcon:v,expanded:F,pauseWhenPageIsHidden:C,swipeDirections:t.swipeDirections})})):null}))});import{c as NT}from"react/compiler-runtime";import{jsx as LT}from"react/jsx-runtime";import{useRouter as $T}from"next/navigation.js";import{formatAdminURL as kT}from"payload/shared";import"react";import{c as ET}from"react/compiler-runtime";import{jsx as vl,jsxs as Bp}from"react/jsx-runtime";import PT from"react";import{c as Op}from"react/compiler-runtime";import{jsx as gn,jsxs as ad}from"react/jsx-runtime";import{createContext as FT,use as AT,useEffect as z0,useState as X0}from"react";import{jsx as RT}from"react/jsx-runtime";import"react";var id="gutter",Bo=t=>{let{children:e,className:o,left:n=!0,negativeLeft:r=!1,negativeRight:s=!1,ref:i,right:a=!0}=t,l=n&&!r,c=a&&!s;return RT("div",{className:[l&&`${id}--left`,c&&`${id}--right`,r&&`${id}--negative-left`,s&&`${id}--negative-right`,o].filter(Boolean).join(" "),ref:i,children:e})};import{c as _T}from"react/compiler-runtime";import{useId as DT}from"react";var bl=t=>{let e=_T(3),o=DT(),n=ct(),r=`${t}-${o}`,s;return e[0]!==n||e[1]!==r?(s=jp({slug:r,depth:n}),e[0]=n,e[1]=r,e[2]=s):s=e[2],s};var Fr="drawer",Mp=100,jp=({slug:t,depth:e})=>`drawer_${e}_${t}`,ur=t=>{let e=Op(17),o,n,r,s,i,a;e[0]!==t?({slug:a,children:o,className:n,disabled:r,onClick:s,...i}=t,e[0]=t,e[1]=o,e[2]=n,e[3]=r,e[4]=s,e[5]=i,e[6]=a):(o=e[1],n=e[2],r=e[3],s=e[4],i=e[5],a=e[6]);let{openModal:l}=de(),c;e[7]!==s||e[8]!==l||e[9]!==a?(c=f=>{l(a),typeof s=="function"&&s(f)},e[7]=s,e[8]=l,e[9]=a,e[10]=c):c=e[10];let u=c,d;return e[11]!==o||e[12]!==n||e[13]!==r||e[14]!==u||e[15]!==i?(d=gn("button",{className:n,disabled:r,onClick:u,type:"button",...i,children:o}),e[11]=o,e[12]=n,e[13]=r,e[14]=u,e[15]=i,e[16]=d):d=e[16],d},Pt=t=>{let e=Op(26),{slug:o,children:n,className:r,gutter:s,Header:i,hoverTitle:a,title:l}=t,c=s===void 0?!0:s,{t:u}=k(),{closeModal:d,modalState:f}=de(),m=Wi(),[h,p]=X0(!1),[g,b]=X0(!1),v,x;e[0]!==f||e[1]!==o?(v=()=>{p(f[o]?.isOpen)},x=[o,f],e[0]=f,e[1]=o,e[2]=v,e[3]=x):(v=e[2],x=e[3]),z0(v,x);let y,C;if(e[4]!==h?(y=()=>{b(h)},C=[h],e[4]=h,e[5]=y,e[6]=C):(y=e[5],C=e[6]),z0(y,C),h){let S=g&&`${Fr}--is-open`,w=m>1&&`${Fr}--nested`,D;e[7]!==r||e[8]!==S||e[9]!==w?(D=[r,Fr,S,w].filter(Boolean),e[7]=r,e[8]=S,e[9]=w,e[10]=D):D=e[10];let _=D.join(" "),A=Mp+m,F;if(e[11]!==i||e[12]!==n||e[13]!==d||e[14]!==m||e[15]!==c||e[16]!==a||e[17]!==o||e[18]!==u||e[19]!==A||e[20]!==_||e[21]!==l){let R;e[23]!==d||e[24]!==o?(R=()=>d(o),e[23]=d,e[24]=o,e[25]=R):R=e[25],F=gn(TT,{children:ad(Yo,{className:_,slug:o,style:{zIndex:A},children:[(!m||m===1)&&gn("div",{className:`${Fr}__blur-bg`}),gn("button",{"aria-label":u("general:close"),className:`${Fr}__close`,id:`close-drawer__${o}`,onClick:R,type:"button"}),ad("div",{className:`${Fr}__content`,style:{width:`calc(100% - (${m} * var(--gutter-h)))`},children:[gn("div",{className:`${Fr}__blur-bg-content`}),ad(Bo,{className:`${Fr}__content-children`,left:c,right:c,children:[i,i===void 0&&ad("div",{className:`${Fr}__header`,children:[gn("h2",{className:`${Fr}__header__title`,title:a?l:null,children:l}),gn("button",{"aria-label":u("general:close"),className:`${Fr}__header__close`,id:`close-drawer__${o}`,onClick:()=>d(o),type:"button",children:gn(pt,{})})]}),n]})]})]})}),e[11]=i,e[12]=n,e[13]=d,e[14]=m,e[15]=c,e[16]=a,e[17]=o,e[18]=u,e[19]=A,e[20]=_,e[21]=l,e[22]=F}else F=e[22];return F}return null},U0=FT(1),TT=t=>{let e=Op(3),{children:o}=t,r=Wi()+1,s;return e[0]!==o||e[1]!==r?(s=gn(U0,{value:r,children:o}),e[0]=o,e[1]=r,e[2]=s):s=e[2],s},Wi=()=>AT(U0);var ld="confirmation-modal";function It(t){let e=ET(33),{body:o,cancelLabel:n,className:r,confirmingLabel:s,confirmLabel:i,heading:a,modalSlug:l,onCancel:c,onConfirm:u}=t,d=Wi(),[f,m]=PT.useState(!1),{closeModal:h}=de(),{t:p}=k(),g;e[0]!==h||e[1]!==f||e[2]!==l||e[3]!==u?(g=async()=>{f||(m(!0),typeof u=="function"&&await u(),m(!1),h(l))},e[0]=h,e[1]=f,e[2]=l,e[3]=u,e[4]=g):g=e[4];let b=g,v;e[5]!==h||e[6]!==f||e[7]!==l||e[8]!==c?(v=()=>{f||(h(l),typeof c=="function"&&c())},e[5]=h,e[6]=f,e[7]=l,e[8]=c,e[9]=v):v=e[9];let x=v,y;e[10]!==r?(y=[ld,r].filter(Boolean),e[10]=r,e[11]=y):y=e[11];let C=y.join(" "),S=Mp+d,w;if(e[12]!==o||e[13]!==n||e[14]!==i||e[15]!==f||e[16]!==s||e[17]!==a||e[18]!==l||e[19]!==x||e[20]!==b||e[21]!==p||e[22]!==C||e[23]!==S){let D;e[25]!==n||e[26]!==p?(D=n||p("general:cancel"),e[25]=n,e[26]=p,e[27]=D):D=e[27];let _;e[28]!==i||e[29]!==f||e[30]!==s||e[31]!==p?(_=f?s||`${p("general:loading")}...`:i||p("general:confirm"),e[28]=i,e[29]=f,e[30]=s,e[31]=p,e[32]=_):_=e[32],w=vl(Yo,{className:C,slug:l,style:{zIndex:S},children:Bp("div",{className:`${ld}__wrapper`,children:[Bp("div",{className:`${ld}__content`,children:[vl("h1",{children:a}),vl("p",{children:o})]}),Bp("div",{className:`${ld}__controls`,children:[vl(ne,{buttonStyle:"secondary",disabled:f,id:"confirm-cancel",onClick:x,size:"large",type:"button",children:D}),vl(ne,{id:"confirm-action",onClick:b,size:"large",children:_})]})]})}),e[12]=o,e[13]=n,e[14]=i,e[15]=f,e[16]=s,e[17]=a,e[18]=l,e[19]=x,e[20]=b,e[21]=p,e[22]=C,e[23]=S,e[24]=w}else w=e[24];return w}var Vp="stay-logged-in",Y0=()=>{let t=NT(11),{refreshCookie:e}=Ae(),o=$T(),{config:n}=H(),{admin:r,routes:s}=n,{routes:i}=r,{logout:a}=i,{admin:l}=s,{t:c}=k(),{startRouteTransition:u}=st(),d;t[0]!==l||t[1]!==a||t[2]!==o||t[3]!==u?(d=()=>u(()=>o.push(kT({adminRoute:l,path:a}))),t[0]=l,t[1]=a,t[2]=o,t[3]=u,t[4]=d):d=t[4];let f=d,m;t[5]!==e?(m=()=>{e()},t[5]=e,t[6]=m):m=t[6];let h=m,p;return t[7]!==h||t[8]!==f||t[9]!==c?(p=LT(It,{body:c("authentication:youAreInactive"),cancelLabel:c("authentication:stayLoggedIn"),confirmLabel:c("authentication:logOut"),heading:c("authentication:stayLoggedIn"),modalSlug:Vp,onCancel:h,onConfirm:f}),t[7]=h,t[8]=f,t[9]=c,t[10]=p):p=t[10],p};import{c as jT}from"react/compiler-runtime";import{useEffect as OT,useState as MT}from"react";function Jo(t,e){let o=jT(4),[n,r]=MT(t),s,i;return o[0]!==e||o[1]!==t?(s=()=>{let a=setTimeout(()=>{r(t)},e);return()=>{clearTimeout(a)}},i=[t,e],o[0]=e,o[1]=t,o[2]=s,o[3]=i):(s=o[2],i=o[3]),OT(s,i),n}import*as Z0 from"qs-esm";var Qe={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=Z0.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 K0=HT({}),q0=2147483647;function Gp({children:t,permissions:e,user:o}){let[n,r]=xl(o),[s,i]=xl(),[a,l]=xl(),c=VT(),u=GT(),{config:d}=H(),{admin:{routes:{inactivity:f},user:m},routes:{admin:h,api:p},serverURL:g}=d,[b,v]=xl(e),{i18n:x}=k(),{closeAllModals:y,openModal:C}=de(),[S,w]=xl(0),D=Jo(S,1e4),_=J0.useRef(null),{startRouteTransition:A}=st(),F=n?.id,R=Ms(()=>{A(()=>u.replace(WT({adminRoute:h,path:`${f}${window.location.pathname.startsWith(h)?`?redirect=${encodeURIComponent(window.location.pathname)}`:""}`}))),y()},[u,h,f,y,A]),I=Ms(()=>{i(void 0),l(void 0),clearTimeout(_.current)},[]),E=Ms(L=>{L?.user?(r(L.user),i(L.token),l(L.exp)):(r(null),I())},[I]),T=Ms(L=>{let V=Math.round(new Date().getTime()/1e3),M=(typeof a=="number"?a:0)-V;return(L||a&&M<120)&&(_.current=setTimeout(()=>{async function O(){try{let B=await Qe.post(`${g}${p}/${m}/refresh-token?refresh`,{headers:{"Accept-Language":x.language}});if(B.status===200){let G=await B.json();E(G)}else E(null),R()}catch(B){fe.error(B.message)}}O()},1e3)),()=>{clearTimeout(_.current)}},[p,x.language,R,g,E,a,m]),$=Ms(async L=>{try{let V=await Qe.post(`${g}${p}/${m}/refresh-token`,{headers:{"Accept-Language":x.language}});if(V.status===200){let M=await V.json();return L||E(M),M.user}return E(null),R(),null}catch(V){return fe.error(`Refreshing token failed: ${V.message}`),null}},[p,x.language,R,g,E,m]),j=Ms(async()=>{try{return await Qe.post(`${g}${p}/${n.collection}/logout`),E(null),I(),!0}catch(L){return fe.error(`Logging out failed: ${L.message}`),!1}},[p,I,g,E,n]),N=Ms(async({locale:L}={})=>{let V=Q0.stringify({locale:L},{addQueryPrefix:!0});try{let M=await Qe.get(`${g}${p}/access${V}`,{headers:{"Accept-Language":x.language}});if(M.status===200){let O=await M.json();v(O)}else throw new Error(`Fetching permissions failed with status code ${M.status}`)}catch(M){fe.error(`Refreshing permissions failed: ${M.message}`)}},[g,p,x]),P=J0.useCallback(async()=>{try{let L=await Qe.get(`${g}${p}/${m}/me`,{credentials:"include",headers:{"Accept-Language":x.language}});if(L.status===200){let V=await L.json(),M=null;return E(V),M}}catch(L){fe.error(`Fetching user failed: ${L.message}`)}return null},[g,p,m,x.language,E]);return cd(()=>{P()},[P]),cd(()=>{F&&T()},[D,T,F]),cd(()=>{w(Date.now())},[c]),cd(()=>{let L,V,M=Math.round(new Date().getTime()/1e3),O=typeof a=="number"?a-M:0,B=Math.max(Math.min((O-60)*1e3,q0),0),G=Math.max(Math.min(O*1e3,q0),0);if(!n){clearTimeout(L),clearTimeout(V);return}return O>0&&(L=setTimeout(()=>{C(Vp)},B),V=setTimeout(()=>{E(null),R()},G)),()=>{L&&clearTimeout(L),V&&clearTimeout(V)}},[a,C,x,E,n,R]),BT(K0,{value:{fetchFullUser:P,logOut:j,permissions:b,refreshCookie:T,refreshCookieAsync:$,refreshPermissions:N,setPermissions:v,setUser:E,token:s,user:n},children:t})}var Ae=()=>zT(K0);import{jsx as XT}from"react/jsx-runtime";import{dequal as ex}from"dequal/lite";import{createContext as UT,use as YT,useCallback as tx,useEffect as ZT,useRef as Hp}from"react";function Wp(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]=Wp(t[n],e[n]):o[n]=e[n]);return o}var rx=UT({}),ox=(t,e)=>({body:JSON.stringify({value:t}),headers:{"Accept-Language":e,"Content-Type":"application/json"}}),zp=({children:t})=>{let e=Hp({}),o=Hp({}),n=Hp({}),{config:r}=H(),{user:s}=Ae(),{i18n:i}=k(),{routes:{api:a},serverURL:l}=r;ZT(()=>{s||(o.current={})},[s]);let c=tx(async d=>{let f=o.current;if(typeof f[d]<"u")return f[d];let m=new Promise(h=>{(async()=>{let p=await Qe.get(`${l}${a}/payload-preferences/${d}`,{headers:{"Accept-Language":i.language}}),g=null;p.status===200&&(g=(await p.json()).value),o.current[d]=g,h(g)})()});return f[d]=m,m},[i.language,a,o,l]),u=tx(async(d,f,m=!1)=>{if(m===!1){o.current[d]=f,await Qe.post(`${l}${a}/payload-preferences/${d}`,ox(f,i.language));return}let h=f,p=await c(d);if(typeof f=="object"&&typeof p=="object"&&typeof h=="object"){if(p&&(h=Wp(p,h)),ex(h,p))return;n.current[d]={...n.current[d],...h}}else{if(h===p)return;n.current[d]=h}let g=async()=>{ex(n.current[d],o.current[d])||(o.current[d]=n.current[d],await Qe.post(`${l}${a}/payload-preferences/${d}`,ox(o.current[d],i.language)),delete n.current[d])};setTimeout(()=>{g()})},[a,c,i.language,n,l]);return e.current.getPreference=c,e.current.setPreference=u,XT(rx,{value:e.current,children:t})},Fo=()=>YT(rx);var lx=ix({}),cx=ix({localeIsLoading:!1,setLocaleIsLoading:t=>{}}),tE=async(t,e)=>await fetch(`${e}/payload-preferences/${t}`,{credentials:"include",headers:{"Content-Type":"application/json"},method:"GET"})?.then(o=>o.json()),Xp=t=>{let e=JT(27),{children:o,locale:n}=t,{config:r}=H(),{localization:s,routes:i,serverURL:a}=r,l=s===void 0?!1:s,{api:c}=i,{user:u}=Ae(),d=l?l.defaultLocale:"en",{getPreference:f}=Fo(),m=qT(),h;e[0]!==m?(h=m.get("locale"),e[0]=m,e[1]=h):h=e[1];let p=h,g;e[2]!==d||e[3]!==n||e[4]!==p||e[5]!==l?(g=()=>!l||l&&!l.locales.length?{}:Yn(l,p)||Yn(l,n)||Yn(l,d)||Yn(l,l.locales[0].code),e[2]=d,e[3]=n,e[4]=p,e[5]=l,e[6]=g):g=e[6];let[b,v]=QT.useState(g),[x,y]=eE(!1),C=KT(b),S,w;e[7]!==b?(S=()=>{b.code!==C.current.code&&y(!1),C.current=b},w=[b],e[7]=b,e[8]=S,e[9]=w):(S=e[8],w=e[9]),sx(S,w);let D=`${a}${c}`,_;e[10]!==d||e[11]!==D||e[12]!==p||e[13]!==l||e[14]!==u?.id?(_=()=>{(async function(){if(l&&u?.id){let T=p||await tE("locale",D)?.then(oE),$=Yn(l,T)||Yn(l,d)||Yn(l,l?.locales?.[0]?.code);$&&v($)}})()},e[10]=d,e[11]=D,e[12]=p,e[13]=l,e[14]=u?.id,e[15]=_):_=e[15];let A=u?.id,F;e[16]!==d||e[17]!==D||e[18]!==f||e[19]!==p||e[20]!==l||e[21]!==A?(F=[d,f,l,D,p,A],e[16]=d,e[17]=D,e[18]=f,e[19]=p,e[20]=l,e[21]=A,e[22]=F):F=e[22],sx(_,F);let R;return e[23]!==o||e[24]!==x||e[25]!==b?(R=nx(lx,{value:b,children:nx(cx,{value:{localeIsLoading:x,setLocaleIsLoading:y},children:o})}),e[23]=o,e[24]=x,e[25]=b,e[26]=R):R=e[26],R},ud=()=>ax(cx),Ne=()=>ax(lx);function oE(t){return t.value}var dd=(t,e,o)=>`field-${t?.replace(/\./g,"__")}${e>1?`-${e}`:""}${o?`-${o}`:""}`;var xe=t=>{let e=rE(25),{as:o,hideLocale:n,htmlFor:r,label:s,localized:i,path:a,required:l,unstyled:c}=t,u=o===void 0?"label":o,d=n===void 0?!1:n,f=i===void 0?!1:i,m=l===void 0?!1:l,h=c===void 0?!1:c,{uuid:p}=Oe(),g=ct(),b;e[0]!==g||e[1]!==r||e[2]!==a||e[3]!==p?(b=r||dd(a,g,p),e[0]=g,e[1]=r,e[2]=a,e[3]=p,e[4]=b):b=e[4];let v=b,{i18n:x}=k(),{code:y,label:C}=Ne();if(s){let S=`field-label ${h?"unstyled":""}`,w;if(e[5]!==u||e[6]!==y||e[7]!==d||e[8]!==v||e[9]!==x||e[10]!==s||e[11]!==C||e[12]!==f||e[13]!==m||e[14]!==S||e[15]!==h){let D;e[17]!==m||e[18]!==h?(D=m&&!h&&nE("span",{className:"required",children:"*"}),e[17]=m,e[18]=h,e[19]=D):D=e[19];let _;e[20]!==y||e[21]!==d||e[22]!==C||e[23]!==f?(_=f&&!d&&ux("span",{className:"localized",children:["\u2014 ",typeof C=="string"?C:y]}),e[20]=y,e[21]=d,e[22]=C,e[23]=f,e[24]=_):_=e[24],w=ux(u,{className:S,htmlFor:v,children:[sE(s,x),D,_]}),e[5]=u,e[6]=y,e[7]=d,e[8]=v,e[9]=x,e[10]=s,e[11]=C,e[12]=f,e[13]=m,e[14]=S,e[15]=h,e[16]=w}else w=e[16];return w}return null};var md=({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:[]}),fd=({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 UE}from"react/compiler-runtime";import{jsx as sy}from"react/jsx-runtime";import*as iy from"react";import{jsx as Dl,jsxs as HE}from"react/jsx-runtime";import{useCallback as ny,useMemo as zE}from"react";import{c as VE}from"react/compiler-runtime";import{useRef as ey}from"react";import{c as iE}from"react/compiler-runtime";import{useEffect as aE,useRef as lE}from"react";var Bs=(t,e,o)=>{let n=iE(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 a=lE(i),l;n[3]!==t||n[4]!==e?(l=()=>{let u=setTimeout(()=>{Date.now()-a.current>=e&&(t(),a.current=Date.now())},e-(Date.now()-a.current));return()=>{clearTimeout(u)}},n[3]=t,n[4]=e,n[5]=l):l=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],aE(l,c)};import{jsx as rh}from"react/jsx-runtime";import*as Jx from"qs-esm";import Yx,{createContext as NE,use as LE,useCallback as Yi,useEffect as Zx,useMemo as $E,useRef as kE,useState as qo}from"react";import{getTranslation as AE}from"@payloadcms/translations";var cE={},yl={};function Hi(t,e){try{let n=(cE[t]||=new Intl.DateTimeFormat("en-GB",{timeZone:t,hour:"numeric",timeZoneName:"longOffset"}).format)(e).split("GMT")[1]||"";return n in yl?yl[n]:dx(n,n.split(":"))}catch{if(t in yl)return yl[t];let o=t?.match(uE);return o?dx(t,o.slice(1)):NaN}}var uE=/([+-]\d\d):?(\d\d)?/;function dx(t,e){let o=+e[0],n=+(e[1]||0);return yl[t]=o>0?o*60+n:o*60-n}var Mt=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(Hi(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)),fx(this,NaN),Up(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-Hi(this.timeZone,this)}setTime(e){return Date.prototype.setTime.apply(this,arguments),Up(this),+this}[Symbol.for("constructDateFrom")](e){return new t(+new Date(e),this.timeZone)}},mx=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(t=>{if(!mx.test(t))return;let e=t.replace(mx,"$1UTC");Mt.prototype[e]&&(t.startsWith("get")?Mt.prototype[t]=function(){return this.internal[e]()}:(Mt.prototype[t]=function(){return Date.prototype[e].apply(this.internal,arguments),dE(this),+this},Mt.prototype[e]=function(){return Date.prototype[e].apply(this,arguments),Up(this),+this}))});function Up(t){t.internal.setTime(+t),t.internal.setUTCMinutes(t.internal.getUTCMinutes()-t.getTimezoneOffset())}function dE(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()),fx(t)}function fx(t){let e=Hi(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 a=n-e;a&&Date.prototype.setUTCMinutes.call(t,Date.prototype.getUTCMinutes.call(t)+a);let l=Hi(t.timeZone,t),u=-new Date(+t).getTimezoneOffset()-l,d=l!==e,f=u-a;if(d&&f){Date.prototype.setUTCMinutes.call(t,Date.prototype.getUTCMinutes.call(t)+f);let m=Hi(t.timeZone,t),h=l-m;h&&(t.internal.setUTCMinutes(t.internal.getUTCMinutes()+h),Date.prototype.setUTCMinutes.call(t,Date.prototype.getUTCMinutes.call(t)+h))}}var mE=Math.pow(10,8)*24*60*60*1e3,gJ=-mE,pd=6048e5,px=864e5;var Cl=43200,Yp=1440;var fE=3600;var hx=fE*24,bJ=hx*7,pE=hx*365.2425,hE=pE/12,vJ=hE*3,Zp=Symbol.for("constructDateFrom");function ao(t,e){return typeof t=="function"?t(e):t&&typeof t=="object"&&Zp in t?t[Zp](e):t instanceof Date?new t.constructor(e):new Date(e)}function Ke(t,e){return ao(e||t,t)}var gE={};function qr(){return gE}function bn(t,e){let o=qr(),n=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??o.weekStartsOn??o.locale?.options?.weekStartsOn??0,r=Ke(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 Vs(t,e){return bn(t,{...e,weekStartsOn:1})}function hd(t,e){let o=Ke(t,e?.in),n=o.getFullYear(),r=ao(o,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);let s=Vs(r),i=ao(o,0);i.setFullYear(n,0,4),i.setHours(0,0,0,0);let a=Vs(i);return o.getTime()>=s.getTime()?n+1:o.getTime()>=a.getTime()?n:n-1}function zi(t){let e=Ke(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 Jn(t,...e){let o=ao.bind(null,t||e.find(n=>typeof n=="object"));return e.map(o)}function Jp(t,e){let o=Ke(t,e?.in);return o.setHours(0,0,0,0),o}function gx(t,e,o){let[n,r]=Jn(o?.in,t,e),s=Jp(n),i=Jp(r),a=+s-zi(s),l=+i-zi(i);return Math.round((a-l)/px)}function bx(t,e){let o=hd(t,e),n=ao(e?.in||t,0);return n.setFullYear(o,0,4),n.setHours(0,0,0,0),Vs(n)}function Xi(t,e){let o=+Ke(t)-+Ke(e);return o<0?-1:o>0?1:o}function vx(t){return ao(t,Date.now())}function xx(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function yx(t){return!(!xx(t)&&typeof t!="number"||isNaN(+Ke(t)))}function Cx(t,e,o){let[n,r]=Jn(o?.in,t,e),s=n.getFullYear()-r.getFullYear(),i=n.getMonth()-r.getMonth();return s*12+i}function wx(t){return e=>{let n=(t?Math[t]:Math.trunc)(e);return n===0?0:n}}function Sx(t,e){return+Ke(t)-+Ke(e)}function Ix(t,e){let o=Ke(t,e?.in);return o.setHours(23,59,59,999),o}function Rx(t,e){let o=Ke(t,e?.in),n=o.getMonth();return o.setFullYear(o.getFullYear(),n+1,0),o.setHours(23,59,59,999),o}function _x(t,e){let o=Ke(t,e?.in);return+Ix(o,e)==+Rx(o,e)}function Dx(t,e,o){let[n,r,s]=Jn(o?.in,t,t,e),i=Xi(r,s),a=Math.abs(Cx(r,s));if(a<1)return 0;r.getMonth()===1&&r.getDate()>27&&r.setDate(30),r.setMonth(r.getMonth()-i*a);let l=Xi(r,s)===-i;_x(n)&&a===1&&Xi(n,s)===1&&(l=!1);let c=i*(a-+l);return c===0?0:c}function Fx(t,e,o){let n=Sx(t,e)/1e3;return wx(o?.roundingMethod)(n)}function Ax(t,e){let o=Ke(t,e?.in);return o.setFullYear(o.getFullYear(),0,1),o.setHours(0,0,0,0),o}function Tx(t,e){let o=Ke(t,e?.in);return gx(o,Ax(o))+1}function Ex(t,e){let o=Ke(t,e?.in),n=+Vs(o)-+bx(o);return Math.round(n/pd)+1}function gd(t,e){let o=Ke(t,e?.in),n=o.getFullYear(),r=qr(),s=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,i=ao(e?.in||t,0);i.setFullYear(n+1,0,s),i.setHours(0,0,0,0);let a=bn(i,e),l=ao(e?.in||t,0);l.setFullYear(n,0,s),l.setHours(0,0,0,0);let c=bn(l,e);return+o>=+a?n+1:+o>=+c?n:n-1}function Px(t,e){let o=qr(),n=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,r=gd(t,e),s=ao(e?.in||t,0);return s.setFullYear(r,0,n),s.setHours(0,0,0,0),bn(s,e)}function Nx(t,e){let o=Ke(t,e?.in),n=+bn(o,e)-+Px(o,e);return Math.round(n/pd)+1}function it(t,e){let o=t<0?"-":"",n=Math.abs(t).toString().padStart(e,"0");return o+n}var vn={y(t,e){let o=t.getFullYear(),n=o>0?o:1-o;return it(e==="yy"?n%100:n,e.length)},M(t,e){let o=t.getMonth();return e==="M"?String(o+1):it(o+1,2)},d(t,e){return it(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 it(t.getHours()%12||12,e.length)},H(t,e){return it(t.getHours(),e.length)},m(t,e){return it(t.getMinutes(),e.length)},s(t,e){return it(t.getSeconds(),e.length)},S(t,e){let o=e.length,n=t.getMilliseconds(),r=Math.trunc(n*Math.pow(10,o-3));return it(r,e.length)}};var Ui={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},qp={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 vn.y(t,e)},Y:function(t,e,o,n){let r=gd(t,n),s=r>0?r:1-r;if(e==="YY"){let i=s%100;return it(i,2)}return e==="Yo"?o.ordinalNumber(s,{unit:"year"}):it(s,e.length)},R:function(t,e){let o=hd(t);return it(o,e.length)},u:function(t,e){let o=t.getFullYear();return it(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 it(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 it(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 vn.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 it(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=Nx(t,n);return e==="wo"?o.ordinalNumber(r,{unit:"week"}):it(r,e.length)},I:function(t,e,o){let n=Ex(t);return e==="Io"?o.ordinalNumber(n,{unit:"week"}):it(n,e.length)},d:function(t,e,o){return e==="do"?o.ordinalNumber(t.getDate(),{unit:"date"}):vn.d(t,e)},D:function(t,e,o){let n=Tx(t);return e==="Do"?o.ordinalNumber(n,{unit:"dayOfYear"}):it(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 it(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 it(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 it(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=Ui.noon:n===0?r=Ui.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=Ui.evening:n>=12?r=Ui.afternoon:n>=4?r=Ui.morning:r=Ui.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 vn.h(t,e)},H:function(t,e,o){return e==="Ho"?o.ordinalNumber(t.getHours(),{unit:"hour"}):vn.H(t,e)},K:function(t,e,o){let n=t.getHours()%12;return e==="Ko"?o.ordinalNumber(n,{unit:"hour"}):it(n,e.length)},k:function(t,e,o){let n=t.getHours();return n===0&&(n=24),e==="ko"?o.ordinalNumber(n,{unit:"hour"}):it(n,e.length)},m:function(t,e,o){return e==="mo"?o.ordinalNumber(t.getMinutes(),{unit:"minute"}):vn.m(t,e)},s:function(t,e,o){return e==="so"?o.ordinalNumber(t.getSeconds(),{unit:"second"}):vn.s(t,e)},S:function(t,e){return vn.S(t,e)},X:function(t,e,o){let n=t.getTimezoneOffset();if(n===0)return"Z";switch(e){case"X":return $x(n);case"XXXX":case"XX":return Gs(n);case"XXXXX":case"XXX":default:return Gs(n,":")}},x:function(t,e,o){let n=t.getTimezoneOffset();switch(e){case"x":return $x(n);case"xxxx":case"xx":return Gs(n);case"xxxxx":case"xxx":default:return Gs(n,":")}},O:function(t,e,o){let n=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+Lx(n,":");case"OOOO":default:return"GMT"+Gs(n,":")}},z:function(t,e,o){let n=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+Lx(n,":");case"zzzz":default:return"GMT"+Gs(n,":")}},t:function(t,e,o){let n=Math.trunc(+t/1e3);return it(n,e.length)},T:function(t,e,o){return it(+t,e.length)}};function Lx(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+it(s,2)}function $x(t,e){return t%60===0?(t>0?"-":"+")+it(Math.abs(t)/60,2):Gs(t,e)}function Gs(t,e=""){let o=t>0?"-":"+",n=Math.abs(t),r=it(Math.trunc(n/60),2),s=it(n%60,2);return o+r+e+s}var kx=(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"})}},jx=(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"})}},bE=(t,e)=>{let o=t.match(/(P+)(p+)?/)||[],n=o[1],r=o[2];if(!r)return kx(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}}",kx(n,e)).replace("{{time}}",jx(r,e))},Ox={p:jx,P:bE};var vE=/^D+$/,xE=/^Y+$/,yE=["D","DD","YY","YYYY"];function Mx(t){return vE.test(t)}function Bx(t){return xE.test(t)}function Vx(t,e,o){let n=CE(t,e,o);if(console.warn(n),yE.includes(t))throw new RangeError(n)}function CE(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 wE=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,SE=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,IE=/^'([^]*?)'?$/,RE=/''/g,_E=/[a-zA-Z]/;function Qp(t,e,o){let n=qr(),r=o?.locale??n.locale??ol,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,a=Ke(t,o?.in);if(!yx(a))throw new RangeError("Invalid time value");let l=e.match(SE).map(u=>{let d=u[0];if(d==="p"||d==="P"){let f=Ox[d];return f(u,r.formatLong)}return u}).join("").match(wE).map(u=>{if(u==="''")return{isToken:!1,value:"'"};let d=u[0];if(d==="'")return{isToken:!1,value:DE(u)};if(qp[d])return{isToken:!0,value:u};if(d.match(_E))throw new RangeError("Format string contains an unescaped latin alphabet character `"+d+"`");return{isToken:!1,value:u}});r.localize.preprocessor&&(l=r.localize.preprocessor(a,l));let c={firstWeekContainsDate:s,weekStartsOn:i,locale:r};return l.map(u=>{if(!u.isToken)return u.value;let d=u.value;(!o?.useAdditionalWeekYearTokens&&Bx(d)||!o?.useAdditionalDayOfYearTokens&&Mx(d))&&Vx(d,e,String(t));let f=qp[d[0]];return f(a,d,r.localize,c)}).join("")}function DE(t){let e=t.match(IE);return e?e[1].replace(RE,"'"):t}function Gx(t,e,o){let n=qr(),r=o?.locale??n.locale??ol,s=2520,i=Xi(t,e);if(isNaN(i))throw new RangeError("Invalid time value");let a=Object.assign({},o,{addSuffix:o?.addSuffix,comparison:i}),[l,c]=Jn(o?.in,...i>0?[e,t]:[t,e]),u=Fx(c,l),d=(zi(c)-zi(l))/1e3,f=Math.round((u-d)/60),m;if(f<2)return o?.includeSeconds?u<5?r.formatDistance("lessThanXSeconds",5,a):u<10?r.formatDistance("lessThanXSeconds",10,a):u<20?r.formatDistance("lessThanXSeconds",20,a):u<40?r.formatDistance("halfAMinute",0,a):u<60?r.formatDistance("lessThanXMinutes",1,a):r.formatDistance("xMinutes",1,a):f===0?r.formatDistance("lessThanXMinutes",1,a):r.formatDistance("xMinutes",f,a);if(f<45)return r.formatDistance("xMinutes",f,a);if(f<90)return r.formatDistance("aboutXHours",1,a);if(f<Yp){let h=Math.round(f/60);return r.formatDistance("aboutXHours",h,a)}else{if(f<s)return r.formatDistance("xDays",1,a);if(f<Cl){let h=Math.round(f/Yp);return r.formatDistance("xDays",h,a)}else if(f<Cl*2)return m=Math.round(f/Cl),r.formatDistance("aboutXMonths",m,a)}if(m=Dx(c,l),m<12){let h=Math.round(f/Cl);return r.formatDistance("xMonths",h,a)}else{let h=m%12,p=Math.trunc(m/12);return h<3?r.formatDistance("aboutXYears",p,a):h<9?r.formatDistance("overXYears",p,a):r.formatDistance("almostXYears",p+1,a)}}function Wx(t,e){return Gx(t,vx(t),e)}function Ar(t,e){let o=FE(e)?new e(0):ao(e,0);return o.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),o.setHours(t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()),o}function FE(t){return typeof t=="function"&&t.prototype?.constructor===t}var xn=({date:t,i18n:e,pattern:o,timezone:n})=>{let r=new Mt(new Date(t));if(n){let s=Mt.tz(n),i=r.withTimeZone(n),a=Ar(i,s);return e.dateFNS?Qp(a,o,{locale:e.dateFNS}):`${e.t("general:loading")}...`}return e.dateFNS?Qp(r,o,{locale:e.dateFNS}):`${e.t("general:loading")}...`},Hx=({date:t,i18n:e})=>{let o=new Date(t);return e?.dateFNS?Wx(o,{locale:e.dateFNS}):`${e.t("general:loading")}...`};function Kp(t){return typeof t=="object"&&"root"in t}function bd(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+=bd(o.children,e));return e}var dr=({collectionConfig:t,data:e,dateFormat:o,fallback:n,globalConfig:r,i18n:s})=>{let i;if(t){let a=t?.admin?.useAsTitle;if(a&&(i=e?.[a]||i,i)){let l=t.fields.find(u=>"name"in u&&u.name===a);if(l?.type==="date"){let u="date"in l.admin&&l?.admin?.date?.displayFormat||o;i=xn({date:i,i18n:s,pattern:u})||i}}}return r&&(i=AE(r?.label,s)||r?.slug),Kp(i)&&(i=bd(i.root.children?.[0]?.children||[],"")),!i&&Kp(n)&&(i=bd(n.root.children?.[0]?.children||[],"")),i||(i=typeof n=="string"?n:`[${s.t("general:untitled")}]`),i};import{c as TE}from"react/compiler-runtime";import{jsx as EE}from"react/jsx-runtime";import eh from"react";var zx=eh.createContext({getUploadEdits:()=>{},resetUploadEdits:void 0,updateUploadEdits:void 0,uploadEdits:void 0}),th=t=>{let e=TE(10),{children:o,initialUploadEdits:n}=t,r;e[0]!==n?(r=n||{},e[0]=n,e[1]=r):r=e[1];let[s,i]=eh.useState(r),a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=()=>{i({})},e[2]=a):a=e[2];let l=a,c;e[3]===Symbol.for("react.memo_cache_sentinel")?(c=h=>{i(p=>({...p||{},...h||{}}))},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 f=d,m;return e[6]!==o||e[7]!==f||e[8]!==s?(m=EE(zx,{value:{getUploadEdits:f,resetUploadEdits:l,updateUploadEdits:u,uploadEdits:s},children:o}),e[6]=o,e[7]=f,e[8]=s,e[9]=m):m=e[9],m},Ws=()=>eh.use(zx);import*as oh from"qs-esm";import PE from"react";var wl=t=>{let{collectionSlug:e,docPermissions:o,globalSlug:n,isEditing:r}=t;return e?!!(r&&o?.update||!r&&o?.create):n?!!o?.update:!1};var Xx=({id:t,collectionSlug:e,globalSlug:o})=>!!(o||e&&t);var Ux=({id:t,api:e,collectionSlug:o,globalSlug:n,i18n:r,locale:s,permissions:i,serverURL:a,setDocPermissions:l,setHasPublishPermission:c,setHasSavePermission:u})=>PE.useCallback(async d=>{let f={locale:s||void 0},m=d?.id||t,h=Xx({id:m,collectionSlug:o,globalSlug:n});if(h){let p=o?`/${o}/access/${m}`:n?`/globals/${n}/access`:null;if(p){let b=await(await fetch(`${a}${e}${p}?${oh.stringify(f)}`,{body:JSON.stringify({...d||{},_status:"draft"}),credentials:"include",headers:{"Accept-Language":r.language,"Content-Type":"application/json"},method:"post"})).json(),v=await fetch(`${a}${e}${p}?${oh.stringify(f)}`,{body:JSON.stringify({...d||{},_status:"published"}),credentials:"include",headers:{"Accept-Language":r.language,"Content-Type":"application/json"},method:"POST"}).then(x=>x.json());l(b),u(wl({collectionSlug:o,docPermissions:b,globalSlug:n,isEditing:h})),c(v?.update)}}else{let p=o?i?.collections?.[o]:i?.globals?.[n];l(p),u(wl({collectionSlug:o,docPermissions:p,globalSlug:n,isEditing:h}))}},[a,e,t,i,r.language,s,o,n]);var qx=NE({}),Pe=()=>LE(qx),jE=({children:t,...e})=>{let{id:o,collectionSlug:n,currentEditor:r,docPermissions:s,globalSlug:i,hasPublishedDoc:a,hasPublishPermission:l,hasSavePermission:c,initialData:u,initialState:d,isLocked:f,lastUpdateTime:m,mostRecentVersionIsAutosaved:h,unpublishedVersionCount:p,versionCount:g}=e,[b,v]=qo(s),[x,y]=qo(c),[C,S]=qo(l),{permissions:w}=Ae(),{config:{admin:{dateFormat:D},routes:{api:_},serverURL:A},getEntityConfig:F}=H(),R=F({collectionSlug:n}),I=F({globalSlug:i}),E=kE(new AbortController),T=R||I,{i18n:$}=k(),{uploadEdits:j}=Ws(),[N,P]=qo(()=>dr({collectionConfig:R,data:{...u||{},id:o},dateFormat:D,fallback:o?.toString(),globalConfig:I,i18n:$})),[L,V]=qo(h),[M,O]=qo(g),[B,G]=qo(a),[X,Z]=qo(p),[te,U]=qo(f),[z,ce]=qo(r),[J,ue]=qo(m),[re,q]=qo(u),[pe,he]=qo("idle"),_e=Yi(Ge=>{he(Ge)},[]),{getPreference:ge,setPreference:Ve}=Fo(),{code:Q}=Ne(),{localeIsLoading:Le}=ud(),De=$E(()=>d===void 0||u===void 0||Le,[u,d,Le]),ae=`${A}${_}`,se,Y,ie;i&&(se=i,Y="globals",ie=`global-${se}`),n&&(se=n,Y="collections",o&&(ie=`collection-${se}-${o}`));let me=Yi(async(Ge,Je)=>{try{let xt=Je===i?`where[globalSlug][equals]=${Je}`:`where[document.value][equals]=${Ge}&where[document.relationTo][equals]=${Je}`,jt=await Qe.get(`${A}${_}/payload-locked-documents?${xt}`),{docs:gt}=await jt.json();if(gt.length>0){let qe=gt[0].id;await Qe.delete(`${A}${_}/payload-locked-documents/${qe}`,{headers:{"Content-Type":"application/json"}}),U(!1)}}catch(Ye){console.error("Failed to unlock the document",Ye)}},[A,_,i]),we=Yi(async(Ge,Je,Ye)=>{try{let jt=Je===i?`where[globalSlug][equals]=${Je}`:`where[document.value][equals]=${Ge}&where[document.relationTo][equals]=${Je}`,gt=await Qe.get(`${A}${_}/payload-locked-documents?${jt}`),{docs:qe}=await gt.json();if(qe.length>0){let Tt=qe[0].id,be=typeof Ye=="object"?{relationTo:Ye.collection,value:Ye.id}:{relationTo:"users",value:Ye};await Qe.patch(`${A}${_}/payload-locked-documents/${Tt}`,{body:JSON.stringify({user:be}),headers:{"Content-Type":"application/json"}})}}catch(xt){console.error("Failed to update the document editor",xt)}},[A,_,i]),ze=Ux({id:o,api:_,collectionSlug:n,globalSlug:i,i18n:$,locale:Q,permissions:w,serverURL:A,setDocPermissions:v,setHasPublishPermission:S,setHasSavePermission:y}),$e=Yi(()=>ge(ie),[ge,ie]),ot=Yi(async(Ge,Je)=>{let Ye=await $e();if(ie)try{await Ve(ie,{...Ye,fields:{...Ye?.fields||{},[Ge]:{...Ye?.fields?.[Ge],...Je}}})}catch(xt){console.error(xt)}},[Ve,ie,$e]),Xe=Yi(()=>{let Ge=M+1;R&&R.versions?R.versions.maxPerDoc>0?O(Math.min(Ge,R.versions.maxPerDoc)):O(Ge):I&&I.versions&&(I.versions.max>0?O(Math.min(Ge,I.versions.max)):O(Ge))},[R,I,M]),Ue=Yx.useCallback(Ge=>{q(Ge)},[]);Zx(()=>{P(dr({collectionConfig:R,data:{...re,id:o},dateFormat:D,fallback:o?.toString(),globalConfig:I,i18n:$}))},[R,I,re,D,$,o]),Zx(()=>{let Ge=E.current;return()=>{if(Ge)try{Ge.abort()}catch{}}},[]);let ft=Yx.useMemo(()=>`${`${ae}${Y==="globals"?"/globals":""}/${se}${o?`/${o}`:""}`}${Jx.stringify({depth:0,"fallback-locale":"null",locale:Q,uploadEdits:j||void 0},{addQueryPrefix:!0})}`,[ae,Q,Y,o,se,j]),Qt={...e,action:ft,currentEditor:z,docConfig:T,docPermissions:b,documentIsLocked:te,getDocPermissions:ze,getDocPreferences:$e,hasPublishedDoc:B,hasPublishPermission:C,hasSavePermission:x,incrementVersionCount:Xe,initialData:u,initialState:d,isInitializing:De,lastUpdateTime:J,mostRecentVersionIsAutosaved:L,preferencesKey:ie,savedDocumentData:re,setCurrentEditor:ce,setDocFieldPreferences:ot,setDocumentIsLocked:U,setDocumentTitle:P,setHasPublishedDoc:G,setLastUpdateTime:ue,setMostRecentVersionIsAutosaved:V,setUnpublishedVersionCount:Z,setUploadStatus:_e,title:N,unlockDocument:me,unpublishedVersionCount:X,updateDocumentEditor:we,updateSavedDocumentData:Ue,uploadStatus:pe,versionCount:M};return rh(qx,{value:Qt,children:t})},Sl=t=>rh(th,{children:rh(jE,{...t})});import{jsx as OE}from"react/jsx-runtime";import{createContext as ME,use as BE}from"react";var vd=ME(""),Il=({children:t,operation:e})=>OE(vd,{value:e,children:t}),Qo=()=>BE(vd);import Qx from"react";var nh=Qx.createContext(void 0),Kx=()=>{let t=Qx.useContext(nh);if(t)return t};var Ee=t=>{let e=VE(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:a}=o,l=n===void 0?!1:n,c=Kx(),u=s||c||i,d=Xt(),f=lr(),m=Ts(),{user:h}=Ae(),{id:p,collectionSlug:g}=Pe(),b=Qo(),v=Et(GE),x;e[2]!==u?(x=pe=>{let[he]=pe;return he&&he?.[u]||null},e[2]=u,e[3]=x):x=e[3];let y=Et(x),{t:C}=k(),{config:S}=H(),{getData:w,getDataByPath:D,getSiblingData:_,setModified:A}=Oe(),F=$i(),R=Ut(),I=y?.filterOptions,E=y?.value,T=y?.initialValue,$=typeof y?.valid=="boolean"?y.valid:!0,j=$===!1&&d,N=ey($),P=ey(y?.errorMessage),L;e[4]!==u?(L=u?u.split("."):[],e[4]=u,e[5]=L):L=e[5];let V=L,M;e[6]!==l||e[7]!==v||e[8]!==r||e[9]!==R||e[10]!==u||e[11]!==A?(M=(pe,he)=>{let _e=he===void 0?!1:he,ge=pe&&pe.target?pe.target.value:pe;v({type:"UPDATE",disableFormData:l||r&&ge>0,path:u,value:ge}),_e||typeof A=="function"&&R===!1&&setTimeout(()=>{A(!0)},10)},e[6]=l,e[7]=v,e[8]=r,e[9]=R,e[10]=u,e[11]=A,e[12]=M):M=e[12];let O=M,B,G=y?.customComponents,X=f||m,Z=y?.errorMessage,te;e[13]!==y?.errorPaths?(te=y?.errorPaths||[],e[13]=y?.errorPaths,e[14]=te):te=e[14];let U=y?.rows,z=y?.valid,ce;e[15]!==I||e[16]!==T||e[17]!==m||e[18]!==u||e[19]!==f||e[20]!==O||e[21]!==j||e[22]!==d||e[23]!==U||e[24]!==z||e[25]!==G||e[26]!==X||e[27]!==Z||e[28]!==te||e[29]!==E?(ce={customComponents:G,disabled:X,errorMessage:Z,errorPaths:te,filterOptions:I,formInitializing:m,formProcessing:f,formSubmitted:d,initialValue:T,path:u,rows:U,setValue:O,showError:j,valid:z,value:E},e[15]=I,e[16]=T,e[17]=m,e[18]=u,e[19]=f,e[20]=O,e[21]=j,e[22]=d,e[23]=U,e[24]=z,e[25]=G,e[26]=X,e[27]=Z,e[28]=te,e[29]=E,e[30]=ce):ce=e[30],B=ce;let J=B,ue;e[31]!==g||e[32]!==S||e[33]!==l||e[34]!==v||e[35]!==F||e[36]!==y||e[37]!==w||e[38]!==D||e[39]!==_||e[40]!==r||e[41]!==p||e[42]!==b||e[43]!==u||e[44]!==V||e[45]!==C||e[46]!==h||e[47]!==a||e[48]!==E?(ue=()=>{(async()=>{let he=E;y?.rows&&Array.isArray(y.rows)&&(he=D(u));let _e=P.current,ge=N.current,Ve=w(),Q=typeof a=="function"?await a(he,{id:p,blockData:void 0,collectionSlug:g,data:F?.getData?F.getData():Ve,event:"onChange",operation:b,path:V,preferences:{},req:{payload:{config:S},t:C,user:h},siblingData:_(u)}):typeof P.current=="string"?P.current:N.current;if(typeof Q=="string"?(ge=!1,_e=Q):typeof Q=="boolean"&&(ge=Q,_e=void 0),ge!==N.current||_e!==P.current){N.current=ge,P.current=_e;let Le={type:"UPDATE",errorMessage:_e,path:u,rows:y?.rows,valid:ge,validate:a,value:E};(l||r&&typeof E=="number"&&E>0)&&(Le.disableFormData=!0),typeof v=="function"&&v(Le)}})()},e[31]=g,e[32]=S,e[33]=l,e[34]=v,e[35]=F,e[36]=y,e[37]=w,e[38]=D,e[39]=_,e[40]=r,e[41]=p,e[42]=b,e[43]=u,e[44]=V,e[45]=C,e[46]=h,e[47]=a,e[48]=E,e[49]=ue):ue=e[49];let re=y?.rows,q;return e[50]!==g||e[51]!==l||e[52]!==v||e[53]!==w||e[54]!==D||e[55]!==_||e[56]!==p||e[57]!==b||e[58]!==u||e[59]!==re||e[60]!==h||e[61]!==a||e[62]!==E?(q=[E,l,v,w,_,D,p,b,u,h,a,re,g],e[50]=g,e[51]=l,e[52]=v,e[53]=w,e[54]=D,e[55]=_,e[56]=p,e[57]=b,e[58]=u,e[59]=re,e[60]=h,e[61]=a,e[62]=E,e[63]=q):q=e[63],Bs(ue,150,q),J};function GE(t){let[,e]=t;return e}import{jsx as ty}from"react/jsx-runtime";import"react";import{c as WE}from"react/compiler-runtime";var sh=t=>{let e=WE(2),{children:o,path:n}=t,r;e[0]!==n?(r=a=>{let[l]=a;return l&&l?.[n]||null},e[0]=n,e[1]=r):r=e[1];let s=Et(r),{passesCondition:i}=s||{};return i===!1?null:o};var je=t=>o=>{let{path:n}=o;return ty(sh,{path:n,children:ty(t,{...o})})};var rt=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 Ce="field-type";function Zi({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{jsx as Rl,jsxs as lh}from"react/jsx-runtime";import"react";import{jsx as oy}from"react/jsx-runtime";import"react";var ih=()=>oy("svg",{className:"icon icon--check",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:oy("path",{className:"stroke",d:"M15.3333 6.00001L8.00001 13.3333L4.66667 10",strokeLinecap:"square"})});import{jsx as ry}from"react/jsx-runtime";import"react";var ah=()=>ry("svg",{className:"icon icon--line",fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:ry("path",{className:"stroke",d:"M5.33333 10H14.6667",strokeLinecap:"square"})});var _l="checkbox-input",Hs=({id:t,name:e,AfterInput:o,BeforeInput:n,checked:r,className:s,inputRef:i,Label:a,label:l,localized:c,onToggle:u,partialChecked:d,readOnly:f,required:m})=>lh("div",{className:[s,_l,r&&`${_l}--checked`,f&&`${_l}--read-only`].filter(Boolean).join(" "),children:[lh("div",{className:`${_l}__input`,children:[n,Rl("input",{"aria-label":"",defaultChecked:!!r,disabled:f,id:t,name:e,onInput:u,ref:i,required:m,type:"checkbox"}),lh("span",{className:[`${_l}__icon`,!r&&d?"partial":"check"].filter(Boolean).join(" "),children:[r&&Rl(ih,{}),!r&&d&&Rl(ah,{})]}),o]}),Rl(oe,{CustomComponent:a,Fallback:Rl(xe,{htmlFor:t,label:l,localized:c,required:m})})]});var ch="checkbox";var XE=t=>{let{id:e,checked:o,disableFormData:n,field:r,field:{admin:{className:s,description:i}={},label:a,required:l}={},onChange:c,partialChecked:u,path:d,readOnly:f,validate:m}=t,{uuid:h}=Oe(),p=ct(),g=ny((T,$)=>{if(typeof m=="function")return m(T,{...$,required:l})},[m,l]),{customComponents:{AfterInput:b,BeforeInput:v,Description:x,Error:y,Label:C}={},disabled:S,path:w,setValue:D,showError:_,value:A}=Ee({disableFormData:n,potentiallyStalePath:d,validate:g}),F=ny(()=>{f||(D(!A),typeof c=="function"&&c(!A))},[c,f,D,A]),R=o||!!A,I=e||dd(w,p,h),E=zE(()=>rt(r),[r]);return HE("div",{className:[Ce,ch,_&&"error",s,A&&`${ch}--checked`,(f||S)&&`${ch}--read-only`].filter(Boolean).join(" "),style:E,children:[Dl(oe,{CustomComponent:y,Fallback:Dl(He,{path:w,showError:_})}),Dl(Hs,{AfterInput:b,BeforeInput:v,checked:R,id:I,inputRef:null,Label:C,label:a,name:w,onToggle:F,partialChecked:u,readOnly:f||S,required:l}),Dl(oe,{CustomComponent:x,Fallback:Dl(Be,{description:i,path:w})})]})},mr=je(XE);var Fl=t=>{let e=UE(4),{fieldValue:o,localized:n,path:r}=t,{code:s}=Ne(),{config:i}=H(),{localization:a}=i,[l,c]=iy.useState(typeof o!="number"),{t:u}=k();if(!n||!a||a.defaultLocale===s||!a.fallback)return null;if(o){let f=!1;if(typeof o=="number"&&o>0&&(f=!0),Array.isArray(o)&&o.length>0&&(f=!0),f)return l&&c(!1),null}let d;return e[0]!==l||e[1]!==r||e[2]!==u?(d=sy(Rr,{children:sy(mr,{checked:l,field:{name:"",label:u("general:fallbackToDefaultLocale")},id:`field-${r.replace(/\./g,"__")}`,path:r,schemaPath:""})}),e[0]=l,e[1]=r,e[2]=u,e[3]=d):d=e[3],d};var Ji=t=>{let e=document.getElementById(t);if(e){let o=e.getBoundingClientRect();window.scrollBy({behavior:"smooth",top:o.top-100})}};import{c as rM}from"react/compiler-runtime";import{jsx as ys,jsxs as nM}from"react/jsx-runtime";import{getTranslation as sM}from"@payloadcms/translations";import"react";import{c as ZE}from"react/compiler-runtime";import{jsx as yn,jsxs as zs}from"react/jsx-runtime";import JE from"react";import{jsx as ay}from"react/jsx-runtime";import"react";var Al=()=>ay("svg",{className:"icon icon--copy",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:ay("path",{className:"stroke",d:"M4.66666 12.6667C3.93333 12.6667 3.33333 12.0667 3.33333 11.3333V4.66668C3.33333 3.93334 3.93333 3.33334 4.66666 3.33334H11.3333C12.0667 3.33334 12.6667 3.93334 12.6667 4.66668M8.66666 7.33334H15.3333C16.0697 7.33334 16.6667 7.9303 16.6667 8.66668V15.3333C16.6667 16.0697 16.0697 16.6667 15.3333 16.6667H8.66666C7.93028 16.6667 7.33333 16.0697 7.33333 15.3333V8.66668C7.33333 7.9303 7.93028 7.33334 8.66666 7.33334Z",strokeLinecap:"square"})});import{jsx as uh,jsxs as YE}from"react/jsx-runtime";import"react";var dh=({className:t})=>YE("svg",{className:["icon icon--more",t].filter(Boolean).join(" "),viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:[uh("path",{className:"fill",d:"M10 10.6666C10.3682 10.6666 10.6667 10.3682 10.6667 9.99998C10.6667 9.63179 10.3682 9.33331 10 9.33331C9.63182 9.33331 9.33334 9.63179 9.33334 9.99998C9.33334 10.3682 9.63182 10.6666 10 10.6666Z",strokeLinecap:"square"}),uh("path",{className:"fill",d:"M14.6667 10.6666C15.0349 10.6666 15.3333 10.3682 15.3333 9.99998C15.3333 9.63179 15.0349 9.33331 14.6667 9.33331C14.2985 9.33331 14 9.63179 14 9.99998C14 10.3682 14.2985 10.6666 14.6667 10.6666Z",strokeLinecap:"square"}),uh("path",{className:"fill",d:"M5.33334 10.6666C5.70153 10.6666 6.00001 10.3682 6.00001 9.99998C6.00001 9.63179 5.70153 9.33331 5.33334 9.33331C4.96515 9.33331 4.66667 9.63179 4.66667 9.99998C4.66667 10.3682 4.96515 10.6666 5.33334 10.6666Z",strokeLinecap:"square"})]});var Ko="array-actions",xd=t=>{let e=ZE(10),{addRow:o,duplicateRow:n,hasMaxRows:r,index:s,isSortable:i,moveRow:a,removeRow:l,rowCount:c}=t,{t:u}=k(),d;return e[0]!==o||e[1]!==n||e[2]!==r||e[3]!==s||e[4]!==i||e[5]!==a||e[6]!==l||e[7]!==c||e[8]!==u?(d=yn(ho,{button:yn(dh,{}),buttonClassName:`${Ko}__button`,className:Ko,horizontalAlign:"center",render:f=>{let{close:m}=f;return zs(Me.ButtonGroup,{buttonSize:"small",children:[i&&s!==0&&zs(Me.Button,{className:`${Ko}__action ${Ko}__move-up`,onClick:()=>{a(s,s-1),m()},children:[yn("div",{className:`${Ko}__action-chevron`,children:yn(Ze,{direction:"up"})}),u("general:moveUp")]}),i&&s<c-1&&zs(Me.Button,{className:`${Ko}__action`,onClick:()=>{a(s,s+1),m()},children:[yn("div",{className:`${Ko}__action-chevron`,children:yn(Ze,{})}),u("general:moveDown")]}),!r&&zs(JE.Fragment,{children:[zs(Me.Button,{className:`${Ko}__action ${Ko}__add`,onClick:()=>{o(s+1),m()},children:[yn(jo,{}),u("general:addBelow")]}),zs(Me.Button,{className:`${Ko}__action ${Ko}__duplicate`,onClick:()=>{n(s),m()},children:[yn(Al,{}),u("general:duplicate")]})]}),zs(Me.Button,{className:`${Ko}__action ${Ko}__remove`,onClick:()=>{l(s),m()},children:[yn(pt,{}),u("general:remove")]})]})},size:"medium"}),e[0]=o,e[1]=n,e[2]=r,e[3]=s,e[4]=i,e[5]=a,e[6]=l,e[7]=c,e[8]=u,e[9]=d):d=e[9],d};import{c as iP}from"react/compiler-runtime";import{jsx as Er,jsxs as ph}from"react/jsx-runtime";import{useState as my}from"react";import{jsx as qi,jsxs as qE}from"react/jsx-runtime";import"react";var Cn=({className:t})=>qE("svg",{className:["icon icon--drag-handle",t].filter(Boolean).join(" "),viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:[qi("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"}),qi("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"}),qi("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"}),qi("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"}),qi("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"}),qi("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 cy}from"react/jsx-runtime";import yd,{useEffect as tP,useRef as fh}from"react";import{useEffect as QE,useMemo as KE,useRef as mh,useState as eP}from"react";var ly=({containerRef:t,contentRef:e,duration:o,open:n})=>{let r=KE(()=>typeof CSS<"u"&&CSS&&CSS.supports?CSS.supports("interpolate-size","allow-keywords"):!1,[]),s=mh(!1),i=mh(n),[a,l]=eP(!1),c=mh(null);return QE(()=>{let u=t.current,d=e.current;if(!u||!d||r)return;let f=p=>{u.style.height=p},m=()=>{u&&(u.style.transition="",u.style.height=n?"auto":"0px",l(!1))};return(()=>{if(!s.current&&n){f("auto"),l(!1);return}s.current=!0,i.current!==n&&f(n?"0px":`${d.scrollHeight}px`),u.offsetHeight,l(!0),u.style.transition=`height ${o}ms ease`,f(n?`${d.scrollHeight}px`:"0px");let p=()=>{m(),u.removeEventListener("transitionend",p)};u.addEventListener("transitionend",p)})(),i.current=n,c.current=new ResizeObserver(()=>{a&&(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 Tr=({id:t,children:e,className:o,duration:n=300,height:r})=>{let[s,i]=yd.useState(()=>!!r),a=fh(s),[l,c]=yd.useState(()=>s?"":"none"),[u,d]=yd.useState(()=>s?"":"hidden"),[f,m]=yd.useState(!1),h=fh(null),p=fh(null);return tP(()=>{let g,b,v=!!r,x=a.current!==v;return a.current=v,x&&(m(!0),d("hidden"),v?c(""):g=window.setTimeout(()=>{c("none")},n),i(v),b=window.setTimeout(()=>{d(""),m(!1)},n)),()=>{g&&clearTimeout(g),b&&clearTimeout(b)}},[r,n]),ly({containerRef:h,contentRef:p,duration:n,open:s}),cy("div",{"aria-hidden":!s,className:[o,"rah-static",s&&r==="auto"&&"rah-static--height-auto",f&&`rah-animating--${s?"down":"up"}`,f&&r==="auto"&&"rah-animating--to-height-auto"].filter(Boolean).join(" "),id:t,ref:h,style:{overflow:u,transition:`height ${n}ms ease`},children:cy("div",{ref:p,...l?{style:{display:l}}:{},children:e})})};import{jsx as oP}from"react/jsx-runtime";import rP,{createContext as nP,use as sP}from"react";var uy=nP({isCollapsed:void 0,isVisible:void 0,isWithinCollapsible:void 0,toggle:()=>{}}),dy=({children:t,isCollapsed:e,isWithinCollapsible:o=!0,toggle:n})=>{let{isCollapsed:r,isVisible:s}=qn(),i=rP.useMemo(()=>({isCollapsed:e,isVisible:s&&!r,isWithinCollapsible:o,toggle:n}),[e,o,n,r,s]);return oP(uy,{value:i,children:t})},qn=()=>sP(uy);var wo="collapsible";var Xs=t=>{let e=iP(26),{actions:o,children:n,className:r,collapsibleStyle:s,dragHandleProps:i,header:a,initCollapsed:l,isCollapsed:c,onToggle:u}=t,d=s===void 0?"default":s,[f,m]=my(!!l),[h,p]=my(!1),{isWithinCollapsible:g}=qn(),{t:b}=k(),v=typeof c=="boolean"?c:f,x;e[0]!==v||e[1]!==u?(x=()=>{typeof u=="function"&&u(!v),m(!v)},e[0]=v,e[1]=u,e[2]=x):x=e[2];let y=x,C=i&&`${wo}--has-drag-handle`,S=v&&`${wo}--collapsed`,w=g&&`${wo}--nested`,D=h&&`${wo}--hovered`,_=`${wo}--style-${d}`,A;e[3]!==r||e[4]!==C||e[5]!==S||e[6]!==w||e[7]!==D||e[8]!==_?(A=[wo,r,C,S,w,D,_].filter(Boolean),e[3]=r,e[4]=C,e[5]=S,e[6]=w,e[7]=D,e[8]=_,e[9]=A):A=e[9];let F=A.join(" "),R,I;e[10]===Symbol.for("react.memo_cache_sentinel")?(R=()=>p(!0),I=()=>p(!1),e[10]=R,e[11]=I):(R=e[10],I=e[11]);let E=`${wo}__toggle--${v?"collapsed":"open"}`,T;e[12]!==E?(T=[`${wo}__toggle`,E].filter(Boolean),e[12]=E,e[13]=T):T=e[13];let $=T.join(" "),j;if(e[14]!==o||e[15]!==n||e[16]!==i||e[17]!==a||e[18]!==v||e[19]!==b||e[20]!==$||e[21]!==F||e[22]!==y){let N;e[24]!==i?(N=i&&Er("div",{className:`${wo}__drag`,...i.attributes,...i.listeners,children:Er(Cn,{})}),e[24]=i,e[25]=N):N=e[25],j=Er("div",{className:F,children:ph(dy,{isCollapsed:v,toggle:y,children:[ph("div",{className:`${wo}__toggle-wrap`,onMouseEnter:R,onMouseLeave:I,children:[Er("button",{className:$,onClick:y,type:"button",children:Er("span",{children:b("fields:toggleBlock")})}),N,a?Er("div",{className:[`${wo}__header-wrap`,i&&`${wo}__header-wrap--has-drag-handle`].filter(Boolean).join(" "),children:a}):null,ph("div",{className:`${wo}__actions-wrap`,children:[o?Er("div",{className:`${wo}__actions`,children:o}):null,Er("div",{className:`${wo}__indicator`,children:Er(Ze,{direction:v?void 0:"up"})})]})]}),Er(Tr,{height:v?0:"auto",children:Er("div",{className:`${wo}__content`,children:n})})]})}),e[14]=o,e[15]=n,e[16]=i,e[17]=a,e[18]=v,e[19]=b,e[20]=$,e[21]=F,e[22]=y,e[23]=j}else j=e[23];return j};import{c as KO}from"react/compiler-runtime";import{jsx as _b}from"react/jsx-runtime";import{fieldIsHiddenOrDisabled as eM,getFieldPaths as tM,getFieldPermissions as oM}from"payload/shared";import"react";import{c as aP}from"react/compiler-runtime";import{jsx as lP}from"react/jsx-runtime";import fy from"react";var py=t=>{let e=aP(9),{children:o,className:n,forceRender:r}=t,[s,i]=fy.useState(!!r),a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={rootMargin:"1000px"},e[0]=a):a=e[0];let[l,c]=mn(a,!!r),u=!!c?.isIntersecting,d=c?.boundingClientRect?.top<0,f=r||u||d,m,h;e[1]!==s||e[2]!==f?(m=()=>{f&&!s&&i(!0)},h=[f,s],e[1]=s,e[2]=f,e[3]=m,e[4]=h):(m=e[3],h=e[4]),fy.useEffect(m,h);let p=s?o:null,g;return e[5]!==n||e[6]!==l||e[7]!==p?(g=lP("div",{className:n,ref:l,children:p}),e[5]=n,e[6]=l,e[7]=p,e[8]=g):g=e[8],g};import{c as QO}from"react/compiler-runtime";import{jsx as Ft}from"react/jsx-runtime";import"react";import{c as TP}from"react/compiler-runtime";import{jsx as Yt,jsxs as es}from"react/jsx-runtime";import{getTranslation as xh}from"@payloadcms/translations";import EP,{Fragment as PP}from"react";import{c as DP}from"react/compiler-runtime";import{jsx as Pr,jsxs as Py,Fragment as FP}from"react/jsx-runtime";import{getTranslation as AP}from"@payloadcms/translations";import"react";import{c as cP}from"react/compiler-runtime";import{jsx as Tl,jsxs as uP}from"react/jsx-runtime";import"react";var fr="pill",dP=t=>{let e=cP(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:a,setNodeRef:l,transform:c}=Oi(r),u=i&&`${fr}--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 f=d.join(" "),m;return e[5]!==s||e[6]!==a||e[7]!==t||e[8]!==l||e[9]!==f||e[10]!==c?(m=Tl(hy,{...t,className:f,elementProps:{...a,...s,ref:l,style:{transform:c}}}),e[5]=s,e[6]=a,e[7]=t,e[8]=l,e[9]=f,e[10]=c,e[11]=m):m=e[11],m},hy=t=>{let{id:e,alignIcon:o="right","aria-checked":n,"aria-controls":r,"aria-expanded":s,"aria-label":i,children:a,className:l,draggable:c,elementProps:u,icon:d,onClick:f,pillStyle:m="light",rounded:h,size:p="medium",to:g}=t,b=[fr,`${fr}--style-${m}`,`${fr}--size-${p}`,l&&l,g&&`${fr}--has-link`,(g||f)&&`${fr}--has-action`,d&&`${fr}--has-icon`,d&&`${fr}--align-icon-${o}`,c&&`${fr}--draggable`,h&&`${fr}--rounded`].filter(Boolean).join(" "),v="div";return f&&!g&&(v="button"),g&&(v=no),uP(v,{...u,"aria-checked":n,"aria-controls":r,"aria-expanded":s,"aria-label":i,className:b,href:g||null,id:e,onClick:f,type:v==="button"?"button":void 0,children:[Tl("span",{className:`${fr}__label`,children:a}),!!d&&Tl("span",{className:`${fr}__icon`,children:d})]})},vt=t=>{let{draggable:e}=t;return e?Tl(dP,{...t}):Tl(hy,{...t})};import{useEffect as mP,useState as fP}from"react";function Cd(t,e){let[o,n]=fP(t);return mP(()=>{let r=setTimeout(()=>{n(t)},e);return()=>{clearTimeout(r)}},[t,e]),o}import{c as IP}from"react/compiler-runtime";import{jsx as Dy,jsxs as RP}from"react/jsx-runtime";import Fy from"react";import{jsx as Qr,jsxs as Iy}from"react/jsx-runtime";import{getTranslation as Id}from"@payloadcms/translations";import{useEffect as Ry,useMemo as wP,useState as _y}from"react";import{c as pP}from"react/compiler-runtime";import{jsx as gy,jsxs as hP}from"react/jsx-runtime";import"react";var El="thumbnail-card",by=t=>{let e=pP(15),{alignLabel:o,className:n,collection:r,doc:s,label:i,onClick:a,thumbnail:l}=t,{config:c}=H(),{i18n:u}=k(),d=typeof a=="function"&&`${El}--has-on-click`,f=o&&`${El}--align-label-${o}`,m;e[0]!==n||e[1]!==d||e[2]!==f?(m=[El,n,d,f].filter(Boolean),e[0]=n,e[1]=d,e[2]=f,e[3]=m):m=e[3];let h=m.join(" "),p=i;if(!p){let b=s?.filename,v;e[4]!==r||e[5]!==c.admin.dateFormat||e[6]!==s||e[7]!==u||e[8]!==b?(v=dr({collectionConfig:r,data:s,dateFormat:c.admin.dateFormat,fallback:b,i18n:u}),e[4]=r,e[5]=c.admin.dateFormat,e[6]=s,e[7]=u,e[8]=b,e[9]=v):v=e[9],p=v}let g;return e[10]!==h||e[11]!==a||e[12]!==l||e[13]!==p?(g=hP("button",{className:h,onClick:a,title:p,type:"button",children:[gy("div",{className:`${El}__thumbnail`,children:l}),gy("div",{className:`${El}__label`,children:p})]}),e[10]=h,e[11]=a,e[12]=l,e[13]=p,e[14]=g):g=e[14],g};import{jsx as Sn,jsxs as xy}from"react/jsx-runtime";import{useState as xP}from"react";var bo=[];for(wd=0;wd<256;++wd)bo.push((wd+256).toString(16).slice(1));var wd;function vy(t,e=0){return(bo[t[e+0]]+bo[t[e+1]]+bo[t[e+2]]+bo[t[e+3]]+"-"+bo[t[e+4]]+bo[t[e+5]]+"-"+bo[t[e+6]]+bo[t[e+7]]+"-"+bo[t[e+8]]+bo[t[e+9]]+"-"+bo[t[e+10]]+bo[t[e+11]]+bo[t[e+12]]+bo[t[e+13]]+bo[t[e+14]]+bo[t[e+15]]).toLowerCase()}var Sd,gP=new Uint8Array(16);function hh(){if(!Sd&&(Sd=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Sd))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Sd(gP)}var bP=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),gh={randomUUID:bP};function vP(t,e,o){if(gh.randomUUID&&!e&&!t)return gh.randomUUID();t=t||{};var n=t.random||(t.rng||hh)();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 vy(n)}var wn=vP;var bh=()=>{let[t]=xP(()=>`pattern${wn()}`);return xy("svg",{fill:"none",height:"151",preserveAspectRatio:"xMidYMid slice",viewBox:"0 0 231 151",width:"231",xmlns:"http://www.w3.org/2000/svg",children:[xy("g",{clipPath:`url(#${t})`,children:[Sn("rect",{fill:"#D9D9D9",height:"100%",rx:"2",width:"100%"}),Sn("rect",{fill:"#BCBCBC",height:"116.063",transform:"rotate(52.0687 33.7051 79.3051)",width:"85.8593",x:"33.7051",y:"79.3051"}),Sn("rect",{fill:"#BCBCBC",height:"116.063",transform:"rotate(52.0687 86.1219 92.6272)",width:"85.8593",x:"86.1219",y:"92.6272"}),Sn("circle",{cx:"189",cy:"45",fill:"#BCBCBC",r:"19"}),Sn("rect",{fill:"#B8B8B8",height:"5",rx:"2.5",width:"98",x:"66",y:"70"}),Sn("rect",{fill:"#B8B8B8",height:"5",rx:"2.5",width:"76",x:"77",y:"82"})]}),Sn("defs",{children:Sn("clipPath",{id:`${t}`,children:Sn("rect",{fill:"white",height:"151",width:"231"})})})]})};import{c as yP}from"react/compiler-runtime";import{jsx as Cy,jsxs as CP}from"react/jsx-runtime";import"react";import{jsx as yy}from"react/jsx-runtime";import"react";var Pl=()=>yy("svg",{className:"icon icon--search",fill:"none",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:yy("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 wy="block-search",Sy=t=>{let e=yP(5),{setSearchTerm:o}=t,{t:n}=k(),r;e[0]!==o?(r=a=>{o(a.target.value)},e[0]=o,e[1]=r):r=e[1];let s=r,i;return e[2]!==s||e[3]!==n?(i=CP("div",{className:wy,children:[Cy("input",{className:`${wy}__input`,onChange:s,placeholder:n("fields:searchForBlock")}),Cy(Pl,{})]}),e[2]=s,e[3]=n,e[4]=i):i=e[4],i};var Qn="blocks-drawer",SP=(t,e)=>typeof t.labels.singular=="string"?t.labels.singular.toLowerCase():typeof t.labels.singular=="object"?Id(t.labels.singular,e).toLowerCase():"",Nl=t=>{let{addRow:e,addRowIndex:o,blocks:n,drawerSlug:r,labels:s}=t,[i,a]=_y(""),[l,c]=_y(n),{closeModal:u,isModalOpen:d}=de(),{i18n:f,t:m}=k(),{config:h}=H(),p=wP(()=>{let g={_none:[]};return l.forEach(b=>{if(typeof b=="object"&&b.admin?.group){let v=b.admin.group,x=typeof v=="string"?v:Id(v,f);Object.hasOwn(g,x)?g[x].push(b):g[x]=[b]}else g._none.push(b)}),g},[l,f]);return Ry(()=>{d(r)||a("")},[d,r]),Ry(()=>{let g=i.toLowerCase(),b=n?.reduce((v,x)=>{let y=typeof x=="string"?h.blocksMap[x]:x;return SP(y,f).includes(g)&&v.push(y),v},[]);c(b)},[i,n,f,h.blocksMap]),Iy(Pt,{slug:r,title:m("fields:addLabel",{label:Id(s.singular,f)}),children:[Qr(Sy,{setSearchTerm:a}),Qr("div",{className:`${Qn}__blocks-wrapper`,children:Qr("ul",{className:`${Qn}__block-groups`,children:Object.entries(p).map(([g,b])=>b.length?Iy("li",{className:[`${Qn}__block-group`,g==="_none"&&`${Qn}__block-group-none`].filter(Boolean).join(" "),children:[g!=="_none"&&Qr("h3",{className:`${Qn}__block-group-label`,children:g}),Qr("ul",{className:`${Qn}__blocks`,children:b.map((v,x)=>{let y=typeof v=="string"?h.blocksMap[v]:v,{slug:C,imageAltText:S,imageURL:w,labels:D}=y;return Qr("li",{className:`${Qn}__block`,children:Qr(by,{alignLabel:"center",label:Id(D?.singular,f),onClick:()=>{e(o,C),u(r)},thumbnail:Qr("div",{className:`${Qn}__default-image`,children:w?Qr("img",{alt:S,src:w}):Qr(bh,{})})})},x)})})]},g):null)})})]})};var Ay=t=>{let e=IP(26),{addRow:o,blocks:n,blockType:r,duplicateRow:s,hasMaxRows:i,isSortable:a,labels:l,moveRow:c,removeRow:u,rowCount:d,rowIndex:f}=t,{closeModal:m,openModal:h}=de(),p=bl("blocks-drawer"),[g,b]=Fy.useState(null),v;e[0]!==o||e[1]!==m||e[2]!==p||e[3]!==g?(v=(y,C)=>{typeof o=="function"&&o(g,C),m(p)},e[0]=o,e[1]=m,e[2]=p,e[3]=g,e[4]=v):v=e[4];let x;if(e[5]!==r||e[6]!==n||e[7]!==p||e[8]!==s||e[9]!==i||e[10]!==a||e[11]!==l||e[12]!==c||e[13]!==h||e[14]!==u||e[15]!==d||e[16]!==f||e[17]!==v){let y;e[19]!==p||e[20]!==h?(y=S=>{b(S),h(p)},e[19]=p,e[20]=h,e[21]=y):y=e[21];let C;e[22]!==r||e[23]!==s||e[24]!==f?(C=()=>s(f,r),e[22]=r,e[23]=s,e[24]=f,e[25]=C):C=e[25],x=RP(Fy.Fragment,{children:[Dy(Nl,{addRow:v,addRowIndex:f,blocks:n,drawerSlug:p,labels:l}),Dy(xd,{addRow:y,duplicateRow:C,hasMaxRows:i,index:f,isSortable:a,moveRow:c,removeRow:u,rowCount:d})]}),e[5]=r,e[6]=n,e[7]=p,e[8]=s,e[9]=i,e[10]=a,e[11]=l,e[12]=c,e[13]=h,e[14]=u,e[15]=d,e[16]=f,e[17]=v,e[18]=x}else x=e[18];return x};import{c as _P}from"react/compiler-runtime";import{jsx as Ty}from"react/jsx-runtime";import"react";var Ey="section-title",vh=t=>{let e=_P(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:a,value:l}=Ee(i),{t:c}=k(),u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=[Ey].filter(Boolean),e[2]=u):u=e[2];let d=u.join(" "),f;e[3]!==o||e[4]!==a?(f=o||(g=>{g.stopPropagation(),g.preventDefault(),a(g.target.value)}),e[3]=o,e[4]=a,e[5]=f):f=e[5];let m=f,h=n||l,p;return e[6]!==n||e[7]!==m||e[8]!==r||e[9]!==s||e[10]!==c||e[11]!==h||e[12]!==l?(p=Ty("div",{className:d,"data-value":h,children:Ty("input",{className:`${Ey}__input`,id:r,name:r,onChange:m,placeholder:c("general:untitled"),readOnly:s,type:"text",value:n||l||""})}),e[6]=n,e[7]=m,e[8]=r,e[9]=s,e[10]=c,e[11]=h,e[12]=l,e[13]=p):p=e[13],p};var Kn="blocks-field",Ny=t=>{let e=DP(40),{addRow:o,attributes:n,block:r,blocks:s,duplicateRow:i,errorCount:a,fields:l,hasMaxRows:c,isLoading:u,isSortable:d,Label:f,labels:m,listeners:h,moveRow:p,parentPath:g,path:b,permissions:v,readOnly:x,removeRow:y,row:C,rowCount:S,rowIndex:w,schemaPath:D,setCollapse:_,setNodeRef:A,transform:F}=t,R=Cd(u,500),{i18n:I}=k(),T=Xt()&&a>0,$=!r.admin?.disableBlockName,j=T?`${Kn}__row--has-errors`:`${Kn}__row--no-errors`,N;e[0]!==j?(N=[`${Kn}__row`,j].filter(Boolean),e[0]=j,e[1]=N):N=e[1];let P=N.join(" "),L;if(v===!0)L=!0;else{let O=v?.blocks?.[r.slug];O===!0?L=!0:L=O?.fields}let V=`${g?.split(".").join("-")}-row-${w}`,M;if(e[2]!==f||e[3]!==o||e[4]!==n||e[5]!==r.fields||e[6]!==r.labels||e[7]!==L||e[8]!==s||e[9]!==P||e[10]!==i||e[11]!==a||e[12]!==T||e[13]!==l||e[14]!==c||e[15]!==I||e[16]!==R||e[17]!==d||e[18]!==m||e[19]!==h||e[20]!==p||e[21]!==g||e[22]!==b||e[23]!==x||e[24]!==y||e[25]!==C.blockType||e[26]!==C.collapsed||e[27]!==C.id||e[28]!==S||e[29]!==w||e[30]!==D||e[31]!==_||e[32]!==A||e[33]!==$||e[34]!==V||e[35]!==F){let O;e[37]!==C.id||e[38]!==_?(O=B=>_(C.id,B),e[37]=C.id,e[38]=_,e[39]=O):O=e[39],M=Pr("div",{id:V,ref:A,style:{transform:F},children:Pr(Xs,{actions:x?void 0:Pr(Ay,{addRow:o,blocks:s,blockType:C.blockType,duplicateRow:i,fields:r.fields,hasMaxRows:c,isSortable:d,labels:m,moveRow:p,removeRow:y,rowCount:S,rowIndex:w}),className:P,collapsibleStyle:T?"error":"default",dragHandleProps:d?{id:C.id,attributes:n,listeners:h}:void 0,header:R?Pr(St,{height:"1rem",width:"8rem"}):Py("div",{className:`${Kn}__block-header`,children:[Pr(dn,{CustomComponent:f,label:Py(FP,{children:[Pr("span",{className:`${Kn}__block-number`,children:String(w+1).padStart(2,"0")}),Pr(vt,{className:`${Kn}__block-pill ${Kn}__block-pill-${C.blockType}`,pillStyle:"white",children:AP(r.labels.singular,I)}),$&&Pr(vh,{path:`${b}.blockName`,readOnly:x})]}),path:b,rowNumber:w}),T&&Pr(io,{count:a,i18n:I,withMessage:!0})]}),isCollapsed:C.collapsed,onToggle:O,children:R?Pr(St,{}):Pr(So,{className:`${Kn}__fields`,fields:l,margins:"small",parentIndexPath:"",parentPath:b,parentSchemaPath:D,permissions:L,readOnly:x})},C.id)},`${g}-row-${w}`),e[2]=f,e[3]=o,e[4]=n,e[5]=r.fields,e[6]=r.labels,e[7]=L,e[8]=s,e[9]=P,e[10]=i,e[11]=a,e[12]=T,e[13]=l,e[14]=c,e[15]=I,e[16]=R,e[17]=d,e[18]=m,e[19]=h,e[20]=p,e[21]=g,e[22]=b,e[23]=x,e[24]=y,e[25]=C.blockType,e[26]=C.collapsed,e[27]=C.id,e[28]=S,e[29]=w,e[30]=D,e[31]=_,e[32]=A,e[33]=$,e[34]=V,e[35]=F,e[36]=M}else M=e[36];return M};var Nr="blocks-field",NP=t=>{let e=TP(50),{i18n:o,t:n}=k(),{field:r,path:s,permissions:i,readOnly:a,schemaPath:l,validate:c}=t,{name:u,admin:d,blockReferences:f,blocks:m,label:h,labels:p,localized:g,maxRows:b,minRows:v,required:x}=r,y;e[0]!==d?(y=d===void 0?{}:d,e[0]=d,e[1]=y):y=e[1];let{className:C,description:S,isSortable:w}=y,D=w===void 0?!0:w,_=l??u,A=v??x?1:0,{setDocFieldPreferences:F}=Pe(),{addFieldRow:R,dispatchFields:I,moveFieldRow:E,removeFieldRow:T,setModified:$}=Oe(),{code:j}=Ne(),{config:N,config:P}=H(),{localization:L}=N,V=bl("blocks-drawer"),M=Xt(),O={plural:n("fields:blocks"),singular:n("fields:block"),...p},B;e:{if(L&&L.fallback){let K=L.defaultLocale;B=j===K;break e}B=!0}let G=B,X;e[2]!==G||e[3]!==b||e[4]!==A||e[5]!==x||e[6]!==c?(X=(K,W)=>{if(!G&&K===null)return!0;if(typeof c=="function")return c(K,{...W,maxRows:b,minRows:A,required:x})},e[2]=G,e[3]=b,e[4]=A,e[5]=x,e[6]=c,e[7]=X):X=e[7];let Z=X,te;e[8]!==Z||e[9]!==s?(te={hasRows:!0,potentiallyStalePath:s,validate:Z},e[8]=Z,e[9]=s,e[10]=te):te=e[10];let{customComponents:U,disabled:z,errorPaths:ce,path:J,rows:ue,showError:re,valid:q,value:pe}=Ee(te),he;e[11]!==U?(he=U===void 0?{}:U,e[11]=U,e[12]=he):he=e[12];let{AfterInput:_e,BeforeInput:ge,Description:Ve,Error:Q,Label:Le}=he,De;e[13]!==ue?(De=ue===void 0?[]:ue,e[13]=ue,e[14]=De):De=e[14];let ae=De,se;e[15]!==R||e[16]!==J||e[17]!==_?(se=(K,W)=>{R({blockType:W,path:J,rowIndex:K,schemaPath:_}),setTimeout(()=>{Ji(`${J}-row-${K+1}`)},0)},e[15]=R,e[16]=J,e[17]=_,e[18]=se):se=e[18];let Y=se,ie;e[19]!==I||e[20]!==J||e[21]!==$?(ie=K=>{I({type:"DUPLICATE_ROW",path:J,rowIndex:K}),$(!0),setTimeout(()=>{Ji(`${J}-row-${K+1}`)},0)},e[19]=I,e[20]=J,e[21]=$,e[22]=ie):ie=e[22];let me=ie,we;e[23]!==J||e[24]!==T?(we=K=>{T({path:J,rowIndex:K})},e[23]=J,e[24]=T,e[25]=we):we=e[25];let ze=we,$e;e[26]!==E||e[27]!==J?($e=(K,W)=>{E({moveFromIndex:K,moveToIndex:W,path:J})},e[26]=E,e[27]=J,e[28]=$e):$e=e[28];let ot=$e,Xe;e[29]!==I||e[30]!==J||e[31]!==ae||e[32]!==F?(Xe=K=>{let{collapsedIDs:W,updatedRows:ee}=fd({collapsed:K,rows:ae});I({type:"SET_ALL_ROWS_COLLAPSED",path:J,updatedRows:ee}),F(J,{collapsed:W})},e[29]=I,e[30]=J,e[31]=ae,e[32]=F,e[33]=Xe):Xe=e[33];let Ue=Xe,ft;e[34]!==I||e[35]!==J||e[36]!==ae||e[37]!==F?(ft=(K,W)=>{let{collapsedIDs:ee,updatedRows:le}=md({collapsed:W,rowID:K,rows:ae});I({type:"SET_ROW_COLLAPSED",path:J,updatedRows:le}),F(J,{collapsed:ee})},e[34]=I,e[35]=J,e[36]=ae,e[37]=F,e[38]=ft):ft=e[38];let Qt=ft,Ge=b&&ae.length>=b,Je=ce.length,Ye=M&&Je+(q?0:1)>0,xt=ae.length<A||x&&ae.length===0,jt=a&&ae.length===0,gt=Ye?`${Nr}--has-error`:`${Nr}--has-no-error`,qe;e[39]!==C||e[40]!==gt?(qe=[Ce,Nr,C,gt].filter(Boolean),e[39]=C,e[40]=gt,e[41]=qe):qe=e[41];let Tt;e[42]!==Q||e[43]!==J||e[44]!==re?(Tt=re&&Yt(oe,{CustomComponent:Q,Fallback:Yt(He,{path:J,showError:re})}),e[42]=Q,e[43]=J,e[44]=re,e[45]=Tt):Tt=e[45];let be;return e[46]!==Je||e[47]!==Ye||e[48]!==o?(be=Ye&&Je>0&&Yt(io,{count:Je,i18n:o,withMessage:!0}),e[46]=Je,e[47]=Ye,e[48]=o,e[49]=be):be=e[49],es("div",{className:qe.join(" "),id:`field-${J?.replace(/\./g,"__")}`,children:[Tt,es("header",{className:`${Nr}__header`,children:[es("div",{className:`${Nr}__header-wrap`,children:[es("div",{className:`${Nr}__heading-with-error`,children:[Yt("h3",{children:Yt(oe,{CustomComponent:Le,Fallback:Yt(xe,{label:h,localized:g,path:J,required:x})})}),be]}),ae.length>0&&es("ul",{className:`${Nr}__header-actions`,children:[Yt("li",{children:Yt("button",{className:`${Nr}__header-action`,onClick:()=>Ue(!0),type:"button",children:n("fields:collapseAll")})}),Yt("li",{children:Yt("button",{className:`${Nr}__header-action`,onClick:()=>Ue(!1),type:"button",children:n("fields:showAll")})})]})]}),Yt(oe,{CustomComponent:Ve,Fallback:Yt(Be,{description:S,path:J})})]}),ge,Yt(Fl,{fieldValue:pe,localized:g,path:J}),(ae.length>0||!q&&(jt||xt))&&es(cr,{className:`${Nr}__rows`,ids:ae.map(LP),onDragEnd:K=>{let{moveFromIndex:W,moveToIndex:ee}=K;return ot(W,ee)},children:[ae.map((K,W)=>{let{blockType:ee,isLoading:le}=K,ve=P.blocksMap[ee]??(f??m).find(Fe=>typeof Fe!="string"&&Fe.slug===ee);if(ve){let Fe=`${J}.${W}`,Se=ce.filter(We=>We.startsWith(Fe+".")).length;return Yt(Jr,{disabled:a||z||!D,id:K.id,children:We=>Yt(Ny,{...We,addRow:Y,block:ve,blocks:f??m,duplicateRow:me,errorCount:Se,fields:ve.fields,hasMaxRows:Ge,isLoading:le,isSortable:D,Label:ae?.[W]?.customComponents?.RowLabel,labels:O,moveRow:ot,parentPath:J,path:Fe,permissions:i,readOnly:a||z,removeRow:ze,row:K,rowCount:ae.length,rowIndex:W,schemaPath:_+ve.slug,setCollapse:Qt})},K.id)}return null}),!G&&es(EP.Fragment,{children:[xt&&Yt(Rr,{type:"error",children:n("validation:requiresAtLeast",{count:A,label:xh(A>1?O.plural:O.singular,o)||n(A>1?"general:row":"general:rows")})}),jt&&Yt(Rr,{children:n("validation:fieldHasNo",{label:xh(O.plural,o)})})]})]}),!Ge&&es(PP,{children:[Yt(ur,{className:`${Nr}__drawer-toggler`,disabled:a||z,slug:V,children:Yt(ne,{buttonStyle:"icon-label",disabled:a||z,el:"span",icon:"plus",iconPosition:"left",iconStyle:"with-border",children:n("fields:addLabel",{label:xh(O.singular,o)})})}),Yt(Nl,{addRow:Y,addRowIndex:ae?.length||0,blocks:f??m,drawerSlug:V,labels:O})]}),_e]})},Ll=je(NP);function LP(t){return t.id}import{jsx as Us,jsxs as Ly}from"react/jsx-runtime";import{useCallback as OP,useMemo as MP}from"react";import{jsx as yh}from"react/jsx-runtime";import{lazy as $P,Suspense as kP}from"react";var jP=$P(()=>import("./CodeEditor-7N7BMHRP.js")),$l=t=>yh(kP,{fallback:yh(St,{}),children:yh(jP,{...t})});var BP={js:"javascript",ts:"typescript"},VP="code-field",GP=t=>{let{field:e,field:{admin:{className:o,description:n,editorOptions:r={},language:s="javascript"}={},label:i,localized:a,required:l},onMount:c,path:u,readOnly:d,validate:f}=t,m=OP((_,A)=>{if(typeof f=="function")return f(_,{...A,required:l})},[f,l]),{customComponents:{AfterInput:h,BeforeInput:p,Description:g,Error:b,Label:v}={},disabled:x,path:y,setValue:C,showError:S,value:w}=Ee({potentiallyStalePath:u,validate:m}),D=MP(()=>rt(e),[e]);return Ly("div",{className:[Ce,VP,o,S&&"error",(d||x)&&"read-only"].filter(Boolean).join(" "),style:D,children:[Us(oe,{CustomComponent:v,Fallback:Us(xe,{label:i,localized:a,path:y,required:l})}),Ly("div",{className:`${Ce}__wrap`,children:[Us(oe,{CustomComponent:b,Fallback:Us(He,{path:y,showError:S})}),p,Us($l,{defaultLanguage:BP[s]||s,onChange:d||x?()=>null:_=>C(_),onMount:c,options:r,readOnly:d||x,value:w||""}),h]}),Us(oe,{CustomComponent:g,Fallback:Us(Be,{description:n,path:y})})]})},kl=je(GP);import{jsx as Zs,jsxs as Ch}from"react/jsx-runtime";import{getTranslation as HP}from"@payloadcms/translations";import{Fragment as zP,useCallback as XP,useEffect as UP,useMemo as YP,useState as ky}from"react";import{c as WP}from"react/compiler-runtime";import{fieldAffectsData as $y}from"payload/shared";var Rd=t=>t.reduce((e,o)=>{let n="fields"in o?o.fields:void 0;return n?$y(o)?e.push(`${o.name}.`):e.push(...Rd(n)):o.type==="tabs"?"tabs"in o&&o.tabs?.forEach(r=>{"name"in r?e.push(`${r.name}.`):e.push(...Rd(r.fields))}):$y(o)&&e.push(o.name),e},[]);var Ys=t=>{let e=WP(12),{fields:o,path:n,setErrorCount:r}=t,[s]=ki(),i=Xt(),a;e[0]!==o?(a=Rd(o),e[0]=o,e[1]=a):a=e[1];let l=a,c;e[2]!==s||e[3]!==i||e[4]!==n||e[5]!==l||e[6]!==r?(c=()=>{if(i){let d;d=0,Object.entries(s).forEach(f=>{let[m]=f;if(l?.some(p=>{let g=[...n,p].join(".");return g.endsWith(".")?m.startsWith(g):m===g})){let p=s[m];"valid"in p&&!p.valid&&(d=d+1)}}),r(d)}},e[2]=s,e[3]=i,e[4]=n,e[5]=l,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],Bs(c,250,u),null};var jl="collapsible-field",ZP=t=>{let{field:e,field:{admin:{className:o,description:n,initCollapsed:r=!1}={},fields:s,label:i}={},indexPath:a,parentPath:l,parentSchemaPath:c,path:u,permissions:d,readOnly:f}=t,{i18n:m}=k(),{getPreference:h,setPreference:p}=Fo(),{preferencesKey:g}=Pe(),[b,v]=ky(),x=`collapsible-${u?.replace(/\./g,"__")}`,[y,C]=ky(0),S=y>0,{customComponents:{AfterInput:w,BeforeInput:D,Description:_,Label:A}={},disabled:F}=Ee({path:u}),R=XP(async E=>{let T=await h(g);g&&p(g,{...T,...u?{fields:{...T?.fields||{},[u]:{...T?.fields?.[u],collapsed:E}}}:{fields:{...T?.fields||{},[x]:{...T?.fields?.[x],collapsed:E}}}})},[g,x,h,p,u]);UP(()=>{(async()=>{if(g){let T=await h(g),$=u?T?.fields?.[u]?.collapsed:T?.fields?.[x]?.collapsed;v($!==void 0?!!$:typeof r=="boolean"?r:!1)}else v(typeof r=="boolean"?r:!1)})()},[h,g,x,r,u]);let I=YP(()=>rt(e),[e]);return typeof b!="boolean"?null:Ch(zP,{children:[Zs(Ys,{fields:s,path:u.split(".").slice(0,-1),setErrorCount:C}),Ch("div",{className:[Ce,jl,o,S?`${jl}--has-error`:`${jl}--has-no-error`].filter(Boolean).join(" "),id:`field-${x}`,style:I,children:[D,Zs(Xs,{className:`${jl}__collapsible`,collapsibleStyle:S?"error":"default",header:Ch("div",{className:`${jl}__row-label-wrap`,children:[Zs(dn,{CustomComponent:A,label:HP(i,m),path:u}),S&&Zs(io,{count:y,i18n:m,withMessage:!0})]}),initCollapsed:b,onToggle:R,children:Zs(So,{fields:s,margins:"small",parentIndexPath:a,parentPath:l,parentSchemaPath:c,permissions:d,readOnly:f||F})}),w,Zs(oe,{CustomComponent:_,Fallback:Zs(Be,{description:n,path:u})})]})]})},Ol=je(ZP);import{jsx as ns,jsxs as _2}from"react/jsx-runtime";import{getTranslation as UN}from"@payloadcms/translations";import{useCallback as ug,useMemo as D2}from"react";import{jsx as wh}from"react/jsx-runtime";import{lazy as JP,Suspense as qP}from"react";var QP=JP(()=>import("./DatePicker-4DPXLCID.js")),Qi=t=>wh(qP,{fallback:wh(St,{height:50}),children:wh(QP,{...t})});import{jsx as R2,jsxs as zN}from"react/jsx-runtime";import{useMemo as XN}from"react";import{jsx as ei}from"react/jsx-runtime";import{getTranslation as w2}from"@payloadcms/translations";import S2,{useEffect as VN,useId as GN}from"react";function Lr(t){"@babel/helpers - typeof";return Lr=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},Lr(t)}function jy(t,e){if(Lr(t)!="object"||!t)return t;var o=t[Symbol.toPrimitive];if(o!==void 0){var n=o.call(t,e||"default");if(Lr(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function _d(t){var e=jy(t,"string");return Lr(e)=="symbol"?e:e+""}function Js(t,e,o){return(e=_d(e))in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t}function Oy(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 Re(t){for(var e=1;e<arguments.length;e++){var o=arguments[e]!=null?arguments[e]:{};e%2?Oy(Object(o),!0).forEach(function(n){Js(t,n,o[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):Oy(Object(o)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(o,n))})}return t}function My(t){if(Array.isArray(t))return t}function By(t,e){var o=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(o!=null){var n,r,s,i,a=[],l=!0,c=!1;try{if(s=(o=o.call(t)).next,e===0){if(Object(o)!==o)return;l=!1}else for(;!(l=(n=s.call(o)).done)&&(a.push(n.value),a.length!==e);l=!0);}catch(u){c=!0,r=u}finally{try{if(!l&&o.return!=null&&(i=o.return(),Object(i)!==i))return}finally{if(c)throw r}}return a}}function Ml(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 Dd(t,e){if(t){if(typeof t=="string")return Ml(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)?Ml(t,e):void 0}}function Vy(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
49
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $r(t,e){return My(t)||By(t,e)||Dd(t,e)||Vy()}function Vo(t,e){if(t==null)return{};var o,n,r=Mi(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 Sh,useCallback as Fd}from"react";var KP=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function Ad(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,a=t.inputValue,l=t.menuIsOpen,c=t.onChange,u=t.onInputChange,d=t.onMenuClose,f=t.onMenuOpen,m=t.value,h=Vo(t,KP),p=Sh(a!==void 0?a:o),g=$r(p,2),b=g[0],v=g[1],x=Sh(l!==void 0?l:r),y=$r(x,2),C=y[0],S=y[1],w=Sh(m!==void 0?m:i),D=$r(w,2),_=D[0],A=D[1],F=Fd(function(N,P){typeof c=="function"&&c(N,P),A(N)},[c]),R=Fd(function(N,P){var L;typeof u=="function"&&(L=u(N,P)),v(L!==void 0?L:N)},[u]),I=Fd(function(){typeof f=="function"&&f(),S(!0)},[f]),E=Fd(function(){typeof d=="function"&&d(),S(!1)},[d]),T=a!==void 0?a:b,$=l!==void 0?l:C,j=m!==void 0?m:_;return Re(Re({},h),{},{inputValue:T,menuIsOpen:$,onChange:F,onInputChange:R,onMenuClose:E,onMenuOpen:I,value:j})}import*as o2 from"react";import{forwardRef as SN,useMemo as Jie}from"react";function Gy(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Wy(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,_d(n.key),n)}}function Hy(t,e,o){return e&&Wy(t.prototype,e),o&&Wy(t,o),Object.defineProperty(t,"prototype",{writable:!1}),t}function zy(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&&Bi(t,e)}function Bl(t){return Bl=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Bl(t)}function Ih(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(Ih=function(){return!!t})()}function Xy(t,e){if(e&&(Lr(e)=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return C0(t)}function Uy(t){var e=Ih();return function(){var o,n=Bl(t);if(e){var r=Bl(this).constructor;o=Reflect.construct(n,arguments,r)}else o=n.apply(this,arguments);return Xy(this,o)}}function Yy(t){if(Array.isArray(t))return Ml(t)}function Zy(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function Jy(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
50
- In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ts(t){return Yy(t)||Zy(t)||Dd(t)||Jy()}import*as ut from"react";import{useMemo as Zl,Fragment as Uh,useRef as ma,useCallback as rs,useEffect as zw,Component as M5}from"react";import*as hr from"react";import{useContext as E6,forwardRef as P6}from"react";var e6=!1;function t6(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 o6(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 qy=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?!e6: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(o6(this));var r=this.tags[this.tags.length-1];if(this.isSpeedy){var s=t6(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 vo="-ms-",Vl="-moz-",nt="-webkit-",Td="comm",Ki="rule",ea="decl";var Qy="@import";var Ed="@keyframes";var Ky="@layer";var eC=Math.abs,qs=String.fromCharCode,tC=Object.assign;function oC(t,e){return Bt(t,0)^45?(((e<<2^Bt(t,0))<<2^Bt(t,1))<<2^Bt(t,2))<<2^Bt(t,3):0}function Pd(t){return t.trim()}function Rh(t,e){return(t=e.exec(t))?t[0]:t}function et(t,e,o){return t.replace(e,o)}function Gl(t,e){return t.indexOf(e)}function Bt(t,e){return t.charCodeAt(e)|0}function os(t,e,o){return t.slice(e,o)}function Ao(t){return t.length}function ta(t){return t.length}function oa(t,e){return e.push(t),t}function _h(t,e){return t.map(e).join("")}var Nd=1,ra=1,rC=0,To=0,Zt=0,sa="";function Wl(t,e,o,n,r,s,i){return{value:t,root:e,parent:o,type:n,props:r,children:s,line:Nd,column:ra,length:i,return:""}}function ia(t,e){return tC(Wl("",null,null,"",null,null,0),t,{length:-t.length},e)}function nC(){return Zt}function sC(){return Zt=To>0?Bt(sa,--To):0,ra--,Zt===10&&(ra=1,Nd--),Zt}function Eo(){return Zt=To<rC?Bt(sa,To++):0,ra++,Zt===10&&(ra=1,Nd++),Zt}function pr(){return Bt(sa,To)}function Hl(){return To}function aa(t,e){return os(sa,t,e)}function na(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 Ld(t){return Nd=ra=1,rC=Ao(sa=t),To=0,[]}function $d(t){return sa="",t}function la(t){return Pd(aa(To-1,Dh(t===91?t+2:t===40?t+1:t)))}function iC(t){for(;(Zt=pr())&&Zt<33;)Eo();return na(t)>2||na(Zt)>3?"":" "}function aC(t,e){for(;--e&&Eo()&&!(Zt<48||Zt>102||Zt>57&&Zt<65||Zt>70&&Zt<97););return aa(t,Hl()+(e<6&&pr()==32&&Eo()==32))}function Dh(t){for(;Eo();)switch(Zt){case t:return To;case 34:case 39:t!==34&&t!==39&&Dh(Zt);break;case 40:t===41&&Dh(t);break;case 92:Eo();break}return To}function lC(t,e){for(;Eo()&&t+Zt!==57;)if(t+Zt===84&&pr()===47)break;return"/*"+aa(e,To-1)+"*"+qs(t===47?t:Eo())}function cC(t){for(;!na(pr());)Eo();return aa(t,To)}function mC(t){return $d(kd("",null,null,null,[""],t=Ld(t),0,[0],t))}function kd(t,e,o,n,r,s,i,a,l){for(var c=0,u=0,d=i,f=0,m=0,h=0,p=1,g=1,b=1,v=0,x="",y=r,C=s,S=n,w=x;g;)switch(h=v,v=Eo()){case 40:if(h!=108&&Bt(w,d-1)==58){Gl(w+=et(la(v),"&","&\f"),"&\f")!=-1&&(b=-1);break}case 34:case 39:case 91:w+=la(v);break;case 9:case 10:case 13:case 32:w+=iC(h);break;case 92:w+=aC(Hl()-1,7);continue;case 47:switch(pr()){case 42:case 47:oa(r6(lC(Eo(),Hl()),e,o),l);break;default:w+="/"}break;case 123*p:a[c++]=Ao(w)*b;case 125*p:case 59:case 0:switch(v){case 0:case 125:g=0;case 59+u:b==-1&&(w=et(w,/\f/g,"")),m>0&&Ao(w)-d&&oa(m>32?dC(w+";",n,o,d-1):dC(et(w," ","")+";",n,o,d-2),l);break;case 59:w+=";";default:if(oa(S=uC(w,e,o,c,u,r,a,x,y=[],C=[],d),s),v===123)if(u===0)kd(w,e,S,S,y,s,d,a,C);else switch(f===99&&Bt(w,3)===110?100:f){case 100:case 108:case 109:case 115:kd(t,S,S,n&&oa(uC(t,S,S,0,0,r,a,x,r,y=[],d),C),r,C,d,a,n?y:C);break;default:kd(w,S,S,S,[""],C,0,a,C)}}c=u=m=0,p=b=1,x=w="",d=i;break;case 58:d=1+Ao(w),m=h;default:if(p<1){if(v==123)--p;else if(v==125&&p++==0&&sC()==125)continue}switch(w+=qs(v),v*p){case 38:b=u>0?1:(w+="\f",-1);break;case 44:a[c++]=(Ao(w)-1)*b,b=1;break;case 64:pr()===45&&(w+=la(Eo())),f=pr(),u=d=Ao(x=w+=cC(Hl())),v++;break;case 45:h===45&&Ao(w)==2&&(p=0)}}return s}function uC(t,e,o,n,r,s,i,a,l,c,u){for(var d=r-1,f=r===0?s:[""],m=ta(f),h=0,p=0,g=0;h<n;++h)for(var b=0,v=os(t,d+1,d=eC(p=i[h])),x=t;b<m;++b)(x=Pd(p>0?f[b]+" "+v:et(v,/&\f/g,f[b])))&&(l[g++]=x);return Wl(t,e,o,r===0?Ki:a,l,c,u)}function r6(t,e,o){return Wl(t,e,o,Td,qs(nC()),os(t,2,-2),0)}function dC(t,e,o,n){return Wl(t,e,o,ea,os(t,0,n),os(t,n+1,-1),n)}function Qs(t,e){for(var o="",n=ta(t),r=0;r<n;r++)o+=e(t[r],r,t,e)||"";return o}function fC(t,e,o,n){switch(t.type){case Ky:if(t.children.length)break;case Qy:case ea:return t.return=t.return||t.value;case Td:return"";case Ed:return t.return=t.value+"{"+Qs(t.children,n)+"}";case Ki:t.value=t.props.join(",")}return Ao(o=Qs(t.children,n))?t.return=t.value+"{"+o+"}":""}function pC(t){var e=ta(t);return function(o,n,r,s){for(var i="",a=0;a<e;a++)i+=t[a](o,n,r,s)||"";return i}}function hC(t){return function(e){e.root||(e=e.return)&&t(e)}}function gC(t){var e=Object.create(null);return function(o){return e[o]===void 0&&(e[o]=t(o)),e[o]}}var n6=function(e,o,n){for(var r=0,s=0;r=s,s=pr(),r===38&&s===12&&(o[n]=1),!na(s);)Eo();return aa(e,To)},s6=function(e,o){var n=-1,r=44;do switch(na(r)){case 0:r===38&&pr()===12&&(o[n]=1),e[n]+=n6(To-1,o,n);break;case 2:e[n]+=la(r);break;case 4:if(r===44){e[++n]=pr()===58?"&\f":"",o[n]=e[n].length;break}default:e[n]+=qs(r)}while(r=Eo());return e},i6=function(e,o){return $d(s6(Ld(e),o))},bC=new WeakMap,a6=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&&!bC.get(n))&&!r){bC.set(e,!0);for(var s=[],i=i6(o,s),a=n.props,l=0,c=0;l<i.length;l++)for(var u=0;u<a.length;u++,c++)e.props[c]=s[l]?i[l].replace(/&\f/g,a[u]):a[u]+" "+i[l]}}},l6=function(e){if(e.type==="decl"){var o=e.value;o.charCodeAt(0)===108&&o.charCodeAt(2)===98&&(e.return="",e.value="")}};function vC(t,e){switch(oC(t,e)){case 5103:return nt+"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 nt+t+t;case 5349:case 4246:case 4810:case 6968:case 2756:return nt+t+Vl+t+vo+t+t;case 6828:case 4268:return nt+t+vo+t+t;case 6165:return nt+t+vo+"flex-"+t+t;case 5187:return nt+t+et(t,/(\w+).+(:[^]+)/,nt+"box-$1$2"+vo+"flex-$1$2")+t;case 5443:return nt+t+vo+"flex-item-"+et(t,/flex-|-self/,"")+t;case 4675:return nt+t+vo+"flex-line-pack"+et(t,/align-content|flex-|-self/,"")+t;case 5548:return nt+t+vo+et(t,"shrink","negative")+t;case 5292:return nt+t+vo+et(t,"basis","preferred-size")+t;case 6060:return nt+"box-"+et(t,"-grow","")+nt+t+vo+et(t,"grow","positive")+t;case 4554:return nt+et(t,/([^-])(transform)/g,"$1"+nt+"$2")+t;case 6187:return et(et(et(t,/(zoom-|grab)/,nt+"$1"),/(image-set)/,nt+"$1"),t,"")+t;case 5495:case 3959:return et(t,/(image-set\([^]*)/,nt+"$1$`$1");case 4968:return et(et(t,/(.+:)(flex-)?(.*)/,nt+"box-pack:$3"+vo+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+nt+t+t;case 4095:case 3583:case 4068:case 2532:return et(t,/(.+)-inline(.+)/,nt+"$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(Ao(t)-1-e>6)switch(Bt(t,e+1)){case 109:if(Bt(t,e+4)!==45)break;case 102:return et(t,/(.+:)(.+)-([^]+)/,"$1"+nt+"$2-$3$1"+Vl+(Bt(t,e+3)==108?"$3":"$2-$3"))+t;case 115:return~Gl(t,"stretch")?vC(et(t,"stretch","fill-available"),e)+t:t}break;case 4949:if(Bt(t,e+1)!==115)break;case 6444:switch(Bt(t,Ao(t)-3-(~Gl(t,"!important")&&10))){case 107:return et(t,":",":"+nt)+t;case 101:return et(t,/(.+:)([^;!]+)(;|!.+)?/,"$1"+nt+(Bt(t,14)===45?"inline-":"")+"box$3$1"+nt+"$2$3$1"+vo+"$2box$3")+t}break;case 5936:switch(Bt(t,e+11)){case 114:return nt+t+vo+et(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return nt+t+vo+et(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return nt+t+vo+et(t,/[svh]\w+-[tblr]{2}/,"lr")+t}return nt+t+vo+t+t}return t}var c6=function(e,o,n,r){if(e.length>-1&&!e.return)switch(e.type){case ea:e.return=vC(e.value,e.length);break;case Ed:return Qs([ia(e,{value:et(e.value,"@","@"+nt)})],r);case Ki:if(e.length)return _h(e.props,function(s){switch(Rh(s,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return Qs([ia(e,{props:[et(s,/:(read-\w+)/,":"+Vl+"$1")]})],r);case"::placeholder":return Qs([ia(e,{props:[et(s,/:(plac\w+)/,":"+nt+"input-$1")]}),ia(e,{props:[et(s,/:(plac\w+)/,":"+Vl+"$1")]}),ia(e,{props:[et(s,/:(plac\w+)/,vo+"input-$1")]})],r)}return""})}},u6=[c6],Fh=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(p){var g=p.getAttribute("data-emotion");g.indexOf(" ")!==-1&&(document.head.appendChild(p),p.setAttribute("data-s",""))})}var r=e.stylisPlugins||u6,s={},i,a=[];i=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+o+' "]'),function(p){for(var g=p.getAttribute("data-emotion").split(" "),b=1;b<g.length;b++)s[g[b]]=!0;a.push(p)});var l,c=[a6,l6];{var u,d=[fC,hC(function(p){u.insert(p)})],f=pC(c.concat(r,d)),m=function(g){return Qs(mC(g),f)};l=function(g,b,v,x){u=v,m(g?g+"{"+b.styles+"}":b.styles),x&&(h.inserted[b.name]=!0)}}var h={key:o,sheet:new qy({key:o,container:i,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:s,registered:{},insert:l};return h.sheet.hydrate(a),h};var S6=!0;function Lh(t,e,o){var n="";return o.split(" ").forEach(function(r){t[r]!==void 0?e.push(t[r]+";"):r&&(n+=r+" ")}),n}var Ud=function(e,o,n){var r=e.key+"-"+o.name;(n===!1||S6===!1)&&e.registered[r]===void 0&&(e.registered[r]=o.styles)},$h=function(e,o,n){Ud(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 TC(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 EC={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 I6=!1,R6=/[A-Z]|^ms/g,_6=/_EMO_([^_]+?)_([^]*?)_EMO_/g,$C=function(e){return e.charCodeAt(1)===45},PC=function(e){return e!=null&&typeof e!="boolean"},kh=gC(function(t){return $C(t)?t:t.replace(R6,"-$&").toLowerCase()}),NC=function(e,o){switch(e){case"animation":case"animationName":if(typeof o=="string")return o.replace(_6,function(n,r,s){return Kr={name:r,styles:s,next:Kr},r})}return EC[e]!==1&&!$C(e)&&typeof o=="number"&&o!==0?o+"px":o},D6="Component selectors can only be used in conjunction with @emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware compiler transform.";function zl(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 Kr={name:r.name,styles:r.styles,next:Kr},r.name;var s=o;if(s.styles!==void 0){var i=s.next;if(i!==void 0)for(;i!==void 0;)Kr={name:i.name,styles:i.styles,next:Kr},i=i.next;var a=s.styles+";";return a}return F6(t,e,o)}case"function":{if(t!==void 0){var l=Kr,c=o(t);return Kr=l,zl(t,e,c)}break}}var u=o;if(e==null)return u;var d=e[u];return d!==void 0?d:u}function F6(t,e,o){var n="";if(Array.isArray(o))for(var r=0;r<o.length;r++)n+=zl(t,e,o[r])+";";else for(var s in o){var i=o[s];if(typeof i!="object"){var a=i;e!=null&&e[a]!==void 0?n+=s+"{"+e[a]+"}":PC(a)&&(n+=kh(s)+":"+NC(s,a)+";")}else{if(s==="NO_COMPONENT_SELECTOR"&&I6)throw new Error(D6);if(Array.isArray(i)&&typeof i[0]=="string"&&(e==null||e[i[0]]===void 0))for(var l=0;l<i.length;l++)PC(i[l])&&(n+=kh(s)+":"+NC(s,i[l])+";");else{var c=zl(t,e,i);switch(s){case"animation":case"animationName":{n+=kh(s)+":"+c+";";break}default:n+=s+"{"+c+"}"}}}}return n}var LC=/label:\s*([^\s;{]+)\s*(;|$)/g,Kr;function Yd(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="";Kr=void 0;var s=t[0];if(s==null||s.raw===void 0)n=!1,r+=zl(o,e,s);else{var i=s;r+=i[0]}for(var a=1;a<t.length;a++)if(r+=zl(o,e,t[a]),n){var l=s;r+=l[a]}LC.lastIndex=0;for(var c="",u;(u=LC.exec(r))!==null;)c+="-"+u[1];var d=TC(r)+c;return{name:d,styles:r,next:Kr}}import*as Zd from"react";var A6=function(e){return e()},T6=Zd.useInsertionEffect?Zd.useInsertionEffect:!1,jh=T6||A6;var kC=!1,jC=hr.createContext(typeof HTMLElement<"u"?Fh({key:"css"}):null),rie=jC.Provider;var OC=function(e){return P6(function(o,n){var r=E6(jC);return e(o,r,n)})},MC=hr.createContext({});var Jd={}.hasOwnProperty,Oh="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",BC=function(e,o){var n={};for(var r in o)Jd.call(o,r)&&(n[r]=o[r]);return n[Oh]=e,n},N6=function(e){var o=e.cache,n=e.serialized,r=e.isStringTag;return Ud(o,n,r),jh(function(){return $h(o,n,r)}),null},L6=OC(function(t,e,o){var n=t.css;typeof n=="string"&&e.registered[n]!==void 0&&(n=e.registered[n]);var r=t[Oh],s=[n],i="";typeof t.className=="string"?i=Lh(e.registered,s,t.className):t.className!=null&&(i=t.className+" ");var a=Yd(s,void 0,hr.useContext(MC));i+=e.key+"-"+a.name;var l={};for(var c in t)Jd.call(t,c)&&c!=="css"&&c!==Oh&&!kC&&(l[c]=t[c]);return l.className=i,o&&(l.ref=o),hr.createElement(hr.Fragment,null,hr.createElement(N6,{cache:e,serialized:a,isStringTag:typeof r=="string"}),hr.createElement(r,l))}),VC=L6;import*as ca from"react";var fie=Ds(AC()),Te=function(e,o){var n=arguments;if(o==null||!Jd.call(o,"css"))return ca.createElement.apply(void 0,n);var r=n.length,s=new Array(r);s[0]=VC,s[1]=BC(e,o);for(var i=2;i<r;i++)s[i]=n[i];return ca.createElement.apply(null,s)};(function(t){var e;e||(e=t.JSX||(t.JSX={}))})(Te||(Te={}));function Xl(){for(var t=arguments.length,e=new Array(t),o=0;o<t;o++)e[o]=arguments[o];return Yd(e)}function GC(){var t=Xl.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 WC(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}DD();import{useContext as k6,useRef as Vh,useState as em,useMemo as j6,useCallback as Mh,createContext as O6}from"react";import{createPortal as M6}from"react-dom";import{useLayoutEffect as $6}from"react";var qd=$6;var B6=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],Ul=function(){};function V6(t,e){return e?e[0]==="-"?t+e:t+"__"+e:t}function zC(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(V6(t,i)));return s.filter(function(a){return a}).map(function(a){return String(a).trim()}).join(" ")}var ua=function(e){return U6(e)?e.filter(Boolean):Lr(e)==="object"&&e!==null?[e]:[]},XC=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=Vo(e,B6);return Re({},o)},Nt=function(e,o,n){var r=e.cx,s=e.getStyles,i=e.getClassNames,a=e.className;return{css:s(o,e),className:r(n??{},i(o,e),a)}};function Yl(t){return[document.documentElement,document.body,window].indexOf(t)>-1}function G6(t){return Yl(t)?window.innerHeight:t.clientHeight}function UC(t){return Yl(t)?window.pageYOffset:t.scrollTop}function tm(t,e){if(Yl(t)){window.scrollTo(0,e);return}t.scrollTop=e}function W6(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 H6(t,e,o,n){return o*((t=t/n-1)*t*t+1)+e}function Qd(t,e){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:200,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:Ul,r=UC(t),s=e-r,i=10,a=0;function l(){a+=i;var c=H6(a,r,s,o);tm(t,c),a<o?window.requestAnimationFrame(l):n(t)}l()}function Gh(t,e){var o=t.getBoundingClientRect(),n=e.getBoundingClientRect(),r=e.offsetHeight/3;n.bottom+r>o.bottom?tm(t,Math.min(e.offsetTop+e.clientHeight-t.offsetHeight+r,t.scrollHeight)):n.top-r<o.top&&tm(t,Math.max(e.offsetTop-r,0))}function z6(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 Wh(){try{return document.createEvent("TouchEvent"),!0}catch{return!1}}function YC(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch{return!1}}var ZC=!1,X6={get passive(){return ZC=!0}},Kd=typeof window<"u"?window:{};Kd.addEventListener&&Kd.removeEventListener&&(Kd.addEventListener("p",Ul,X6),Kd.removeEventListener("p",Ul,!1));var JC=ZC;function qC(t){return t!=null}function U6(t){return Array.isArray(t)}function Ks(t,e,o){return t?e:o}var QC=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 a=$r(i,1),l=a[0];return!n.includes(l)});return s.reduce(function(i,a){var l=$r(a,2),c=l[0],u=l[1];return i[c]=u,i},{})},Y6=["children","innerProps"],Z6=["children","innerProps"];function J6(t){var e=t.maxHeight,o=t.menuEl,n=t.minHeight,r=t.placement,s=t.shouldScroll,i=t.isFixedPosition,a=t.controlHeight,l=W6(o),c={placement:"bottom",maxHeight:e};if(!o||!o.offsetParent)return c;var u=l.getBoundingClientRect(),d=u.height,f=o.getBoundingClientRect(),m=f.bottom,h=f.height,p=f.top,g=o.offsetParent.getBoundingClientRect(),b=g.top,v=i?window.innerHeight:G6(l),x=UC(l),y=parseInt(getComputedStyle(o).marginBottom,10),C=parseInt(getComputedStyle(o).marginTop,10),S=b-C,w=v-p,D=S+x,_=d-x-p,A=m-v+x+y,F=x+p-C,R=160;switch(r){case"auto":case"bottom":if(w>=h)return{placement:"bottom",maxHeight:e};if(_>=h&&!i)return s&&Qd(l,A,R),{placement:"bottom",maxHeight:e};if(!i&&_>=n||i&&w>=n){s&&Qd(l,A,R);var I=i?w-y:_-y;return{placement:"bottom",maxHeight:I}}if(r==="auto"||i){var E=e,T=i?S:D;return T>=n&&(E=Math.min(T-y-a,e)),{placement:"top",maxHeight:E}}if(r==="bottom")return s&&tm(l,A),{placement:"bottom",maxHeight:e};break;case"top":if(S>=h)return{placement:"top",maxHeight:e};if(D>=h&&!i)return s&&Qd(l,F,R),{placement:"top",maxHeight:e};if(!i&&D>=n||i&&S>=n){var $=e;return(!i&&D>=n||i&&S>=n)&&($=i?S-C:D-C),s&&Qd(l,F,R),{placement:"top",maxHeight:$}}return{placement:"bottom",maxHeight:e};default:throw new Error('Invalid placement provided "'.concat(r,'".'))}return c}function q6(t){var e={bottom:"top",top:"bottom"};return t?e[t]:"bottom"}var KC=function(e){return e==="auto"?"bottom":e},ew=function(e,o){var n,r=e.placement,s=e.theme,i=s.borderRadius,a=s.spacing,l=s.colors;return Re((n={label:"menu"},Js(n,q6(r),"100%"),Js(n,"position","absolute"),Js(n,"width","100%"),Js(n,"zIndex",1),n),o?{}:{backgroundColor:l.neutral0,borderRadius:i,boxShadow:"0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)",marginBottom:a.menuGutter,marginTop:a.menuGutter})},tw=O6(null),ow=function(e){var o=e.children,n=e.minMenuHeight,r=e.maxMenuHeight,s=e.menuPlacement,i=e.menuPosition,a=e.menuShouldScrollIntoView,l=e.theme,c=k6(tw)||{},u=c.setPortalPlacement,d=Vh(null),f=em(r),m=$r(f,2),h=m[0],p=m[1],g=em(null),b=$r(g,2),v=b[0],x=b[1],y=l.spacing.controlHeight;return qd(function(){var C=d.current;if(C){var S=i==="fixed",w=a&&!S,D=J6({maxHeight:r,menuEl:C,minHeight:n,placement:s,shouldScroll:w,isFixedPosition:S,controlHeight:y});p(D.maxHeight),x(D.placement),u?.(D.placement)}},[r,s,i,a,n,u,y]),o({ref:d,placerProps:Re(Re({},e),{},{placement:v||KC(s),maxHeight:h})})},Q6=function(e){var o=e.children,n=e.innerRef,r=e.innerProps;return Te("div",Ie({},Nt(e,"menu",{menu:!0}),{ref:n},r),o)},K6=Q6,rw=function(e,o){var n=e.maxHeight,r=e.theme.spacing.baseUnit;return Re({maxHeight:n,overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},o?{}:{paddingBottom:r,paddingTop:r})},e5=function(e){var o=e.children,n=e.innerProps,r=e.innerRef,s=e.isMulti;return Te("div",Ie({},Nt(e,"menuList",{"menu-list":!0,"menu-list--is-multi":s}),{ref:r},n),o)},nw=function(e,o){var n=e.theme,r=n.spacing.baseUnit,s=n.colors;return Re({textAlign:"center"},o?{}:{color:s.neutral40,padding:"".concat(r*2,"px ").concat(r*3,"px")})},sw=nw,iw=nw,t5=function(e){var o=e.children,n=o===void 0?"No options":o,r=e.innerProps,s=Vo(e,Y6);return Te("div",Ie({},Nt(Re(Re({},s),{},{children:n,innerProps:r}),"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),r),n)},o5=function(e){var o=e.children,n=o===void 0?"Loading...":o,r=e.innerProps,s=Vo(e,Z6);return Te("div",Ie({},Nt(Re(Re({},s),{},{children:n,innerProps:r}),"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),r),n)},aw=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}},r5=function(e){var o=e.appendTo,n=e.children,r=e.controlElement,s=e.innerProps,i=e.menuPlacement,a=e.menuPosition,l=Vh(null),c=Vh(null),u=em(KC(i)),d=$r(u,2),f=d[0],m=d[1],h=j6(function(){return{setPortalPlacement:m}},[]),p=em(null),g=$r(p,2),b=g[0],v=g[1],x=Mh(function(){if(r){var w=z6(r),D=a==="fixed"?0:window.pageYOffset,_=w[f]+D;(_!==b?.offset||w.left!==b?.rect.left||w.width!==b?.rect.width)&&v({offset:_,rect:w})}},[r,a,f,b?.offset,b?.rect.left,b?.rect.width]);qd(function(){x()},[x]);var y=Mh(function(){typeof c.current=="function"&&(c.current(),c.current=null),r&&l.current&&(c.current=fv(r,l.current,x,{elementResize:"ResizeObserver"in window}))},[r,x]);qd(function(){y()},[y]);var C=Mh(function(w){l.current=w,y()},[y]);if(!o&&a!=="fixed"||!b)return null;var S=Te("div",Ie({ref:C},Nt(Re(Re({},e),{},{offset:b.offset,position:a,rect:b.rect}),"menuPortal",{"menu-portal":!0}),s),n);return Te(tw.Provider,{value:h},o?M6(S,o):S)},lw=function(e){var o=e.isDisabled,n=e.isRtl;return{label:"container",direction:n?"rtl":void 0,pointerEvents:o?"none":void 0,position:"relative"}},n5=function(e){var o=e.children,n=e.innerProps,r=e.isDisabled,s=e.isRtl;return Te("div",Ie({},Nt(e,"container",{"--is-disabled":r,"--is-rtl":s}),n),o)},cw=function(e,o){var n=e.theme.spacing,r=e.isMulti,s=e.hasValue,i=e.selectProps.controlShouldRenderValue;return Re({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")})},s5=function(e){var o=e.children,n=e.innerProps,r=e.isMulti,s=e.hasValue;return Te("div",Ie({},Nt(e,"valueContainer",{"value-container":!0,"value-container--is-multi":r,"value-container--has-value":s}),n),o)},uw=function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},i5=function(e){var o=e.children,n=e.innerProps;return Te("div",Ie({},Nt(e,"indicatorsContainer",{indicators:!0}),n),o)},HC,a5=["size"],l5=["innerProps","isRtl","size"];var c5={name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"},dw=function(e){var o=e.size,n=Vo(e,a5);return Te("svg",Ie({height:o,width:o,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:c5},n))},Hh=function(e){return Te(dw,Ie({size:20},e),Te("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"}))},mw=function(e){return Te(dw,Ie({size:20},e),Te("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"}))},fw=function(e,o){var n=e.isFocused,r=e.theme,s=r.spacing.baseUnit,i=r.colors;return Re({label:"indicatorContainer",display:"flex",transition:"color 150ms"},o?{}:{color:n?i.neutral60:i.neutral20,padding:s*2,":hover":{color:n?i.neutral80:i.neutral40}})},pw=fw,u5=function(e){var o=e.children,n=e.innerProps;return Te("div",Ie({},Nt(e,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),n),o||Te(mw,null))},hw=fw,d5=function(e){var o=e.children,n=e.innerProps;return Te("div",Ie({},Nt(e,"clearIndicator",{indicator:!0,"clear-indicator":!0}),n),o||Te(Hh,null))},gw=function(e,o){var n=e.isDisabled,r=e.theme,s=r.spacing.baseUnit,i=r.colors;return Re({label:"indicatorSeparator",alignSelf:"stretch",width:1},o?{}:{backgroundColor:n?i.neutral10:i.neutral20,marginBottom:s*2,marginTop:s*2})},m5=function(e){var o=e.innerProps;return Te("span",Ie({},o,Nt(e,"indicatorSeparator",{"indicator-separator":!0})))},f5=GC(HC||(HC=WC([`
47
+ `};var B0=(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 ZA=()=>{if(typeof window<"u")return new URLSearchParams(window.location.search)},JA=()=>{let t=ZA(),e=[];if(t){let o=t.get("modal");o&&(o.includes(",")?e=o.split(","):e=[o])}return e},kp=t=>{let{classPrefix:e,minifyCSS:o=!0,generateCSS:n=!0,zIndex:r=9999,handleParamChange:s,children:i,transTime:l=250}=t,a=G0(null),[c,u]=YA(B0,{},()=>JA().reduce((T,L)=>(T[L]={slug:L,isOpen:!0,openedOn:Date.now()},T),{})),[d,f]=nd(!1),[m,h]=nd(!1),[p,g]=nd(!1),[b,v]=nd(""),x=G0(!1),y=Jn(D=>{D.keyCode===27&&u({type:"CLOSE_LATEST_MODAL"})},[]);sd(()=>(x.current||(document.addEventListener("keydown",D=>y(D),!1),x.current=!0),()=>{x.current&&document.removeEventListener("keydown",D=>y(D),!1)}),[y]),sd(()=>{if(n){let D="";D=M0({classPrefix:e,zIndex:r}),o&&(D=D.replace(/\n/g,"").replace(/\s\s+/g," ")),v(D)}},[n,o,r,e]),sd(()=>{if(typeof s=="function"&&s(c),typeof s=="boolean"&&s){let D=Object.keys(c).filter(k=>c[k].isOpen),E=new URLSearchParams;for(let k of D)E.append("modal",k);let T=E.toString()?`?${E}`:"",L=`${window.location.pathname}${T}`;window.history.pushState({},"",L)}},[c,s]),sd(()=>{let D=Object.keys(c).some(E=>c[E].isOpen);f(D)},[c]);let C=Jn((D,E)=>{E&&(D?(j0(E),g(!0)):(O0(E),g(!1)))},[]),S=Jn(D=>{a.current=D},[]),w=Jn(D=>{u({type:"OPEN_MODAL",payload:{slug:D}})},[]),F=Jn(D=>{u({type:"CLOSE_MODAL",payload:{slug:D}})},[]),_=Jn(()=>{u({type:"CLOSE_ALL_MODALS"})},[]),A=Jn(D=>{u({type:"TOGGLE_MODAL",payload:{slug:D}})},[]),R=Jn(D=>c[D]&&c[D].isOpen,[c]),I=Object.assign({},t);return delete I.children,XA(UA,{children:[n&&V0("style",{dangerouslySetInnerHTML:{__html:b}}),V0(Qu.Provider,{value:Object.assign(Object.assign({},I),{transTime:l,containerRef:a,modalState:c,oneModalIsOpen:d,isModalOpen:R,closeOnBlur:m,bodyScrollIsLocked:p,classPrefix:e,closeAllModals:_,setCloseOnBlur:h,openModal:w,closeModal:F,toggleModal:A,setBodyScrollLock:C,setContainerRef:S}),children:i})]})};import{usePathname as VT,useRouter as GT}from"next/navigation.js";import{formatAdminURL as WT}from"payload/shared";import*as ex from"qs-esm";import Q0,{createContext as HT,use as zT,useCallback as Vs,useEffect as ud,useState as xl}from"react";import Se,{forwardRef as qA,isValidElement as jp}from"react";import QA from"react-dom";import Mo from"react";import W0 from"react";import lT from"react";var KA=t=>{switch(t){case"success":return oT;case"info":return nT;case"warning":return rT;case"error":return sT;default:return null}},eT=Array(12).fill(0),tT=({visible:t,className:e})=>Mo.createElement("div",{className:["sonner-loading-wrapper",e].filter(Boolean).join(" "),"data-visible":t},Mo.createElement("div",{className:"sonner-spinner"},eT.map((o,n)=>Mo.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),oT=Mo.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Mo.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),rT=Mo.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},Mo.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),nT=Mo.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Mo.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),sT=Mo.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},Mo.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),iT=Mo.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},Mo.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),Mo.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),aT=()=>{let[t,e]=W0.useState(document.hidden);return W0.useEffect(()=>{let o=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",o),()=>window.removeEventListener("visibilitychange",o)},[]),t},Op=1,cT=class{constructor(){this.subscribe=t=>(this.subscribers.push(t),()=>{let e=this.subscribers.indexOf(t);this.subscribers.splice(e,1)}),this.publish=t=>{this.subscribers.forEach(e=>e(t))},this.addToast=t=>{this.publish(t),this.toasts=[...this.toasts,t]},this.create=t=>{var e;let{message:o,...n}=t,r=typeof t?.id=="number"||((e=t.id)==null?void 0:e.length)>0?t.id:Op++,s=this.toasts.find(l=>l.id===r),i=t.dismissible===void 0?!0:t.dismissible;return s?this.toasts=this.toasts.map(l=>l.id===r?(this.publish({...l,...t,id:r,title:o}),{...l,...t,id:r,dismissible:i,title:o}):l):this.addToast({title:o,...n,dismissible:i,id:r}),r},this.dismiss=t=>(t||this.toasts.forEach(e=>{this.subscribers.forEach(o=>o({id:e.id,dismiss:!0}))}),this.subscribers.forEach(e=>e({id:t,dismiss:!0})),t),this.message=(t,e)=>this.create({...e,message:t}),this.error=(t,e)=>this.create({...e,message:t,type:"error"}),this.success=(t,e)=>this.create({...e,type:"success",message:t}),this.info=(t,e)=>this.create({...e,type:"info",message:t}),this.warning=(t,e)=>this.create({...e,type:"warning",message:t}),this.loading=(t,e)=>this.create({...e,type:"loading",message:t}),this.promise=(t,e)=>{if(!e)return;let o;e.loading!==void 0&&(o=this.create({...e,promise:t,type:"loading",message:e.loading,description:typeof e.description!="function"?e.description:void 0}));let n=t instanceof Promise?t:t(),r=o!==void 0,s,i=n.then(async a=>{if(s=["resolve",a],lT.isValidElement(a))r=!1,this.create({id:o,type:"default",message:a});else if(dT(a)&&!a.ok){r=!1;let c=typeof e.error=="function"?await e.error(`HTTP error! status: ${a.status}`):e.error,u=typeof e.description=="function"?await e.description(`HTTP error! status: ${a.status}`):e.description;this.create({id:o,type:"error",message:c,description:u})}else if(e.success!==void 0){r=!1;let c=typeof e.success=="function"?await e.success(a):e.success,u=typeof e.description=="function"?await e.description(a):e.description;this.create({id:o,type:"success",message:c,description:u})}}).catch(async a=>{if(s=["reject",a],e.error!==void 0){r=!1;let c=typeof e.error=="function"?await e.error(a):e.error,u=typeof e.description=="function"?await e.description(a):e.description;this.create({id:o,type:"error",message:c,description:u})}}).finally(()=>{var a;r&&(this.dismiss(o),o=void 0),(a=e.finally)==null||a.call(e)}),l=()=>new Promise((a,c)=>i.then(()=>s[0]==="reject"?c(s[1]):a(s[1])).catch(c));return typeof o!="string"&&typeof o!="number"?{unwrap:l}:Object.assign(o,{unwrap:l})},this.custom=(t,e)=>{let o=e?.id||Op++;return this.create({jsx:t(o),id:o,...e}),o},this.subscribers=[],this.toasts=[]}},Jo=new cT,uT=(t,e)=>{let o=e?.id||Op++;return Jo.addToast({title:t,...e,id:o}),o},dT=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",mT=uT,fT=()=>Jo.toasts,me=Object.assign(mT,{success:Jo.success,info:Jo.info,warning:Jo.warning,error:Jo.error,custom:Jo.custom,message:Jo.message,promise:Jo.promise,dismiss:Jo.dismiss,loading:Jo.loading},{getHistory:fT});function pT(t,{insertAt:e}={}){if(!t||typeof document>"u")return;let o=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",e==="top"&&o.firstChild?o.insertBefore(n,o.firstChild):o.appendChild(n),n.styleSheet?n.styleSheet.cssText=t:n.appendChild(document.createTextNode(t))}pT(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999;transition:transform .4s ease}:where([data-sonner-toaster][data-lifted="true"]){transform:translateY(-10px)}@media (hover: none) and (pointer: coarse){:where([data-sonner-toaster][data-lifted="true"]){transform:none}}:where([data-sonner-toaster][data-x-position="right"]){right:var(--offset-right)}:where([data-sonner-toaster][data-x-position="left"]){left:var(--offset-left)}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:var(--offset-top)}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:var(--offset-bottom)}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}[data-sonner-toast] [data-close-button]{background:var(--gray1)}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:-50%;right:-50%;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount-y, 0px)) translate(var(--swipe-amount-x, 0px));transition:none}[data-sonner-toast][data-swiped=true]{user-select:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation-duration:.2s;animation-timing-function:ease-out;animation-fill-mode:forwards}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=left]{animation-name:swipe-out-left}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=right]{animation-name:swipe-out-right}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=up]{animation-name:swipe-out-up}[data-sonner-toast][data-swipe-out=true][data-swipe-direction=down]{animation-name:swipe-out-down}@keyframes swipe-out-left{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) - 100%));opacity:0}}@keyframes swipe-out-right{0%{transform:var(--y) translate(var(--swipe-amount-x));opacity:1}to{transform:var(--y) translate(calc(var(--swipe-amount-x) + 100%));opacity:0}}@keyframes swipe-out-up{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) - 100%));opacity:0}}@keyframes swipe-out-down{0%{transform:var(--y) translateY(var(--swipe-amount-y));opacity:1}to{transform:var(--y) translateY(calc(var(--swipe-amount-y) + 100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;right:var(--mobile-offset-right);left:var(--mobile-offset-left);width:100%}[data-sonner-toaster][dir=rtl]{left:calc(var(--mobile-offset-left) * -1)}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset-left) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset-left)}[data-sonner-toaster][data-y-position=bottom]{bottom:var(--mobile-offset-bottom)}[data-sonner-toaster][data-y-position=top]{top:var(--mobile-offset-top)}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset-left);right:var(--mobile-offset-right);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-bg-hover: hsl(0, 0%, 12%);--normal-border: hsl(0, 0%, 20%);--normal-border-hover: hsl(0, 0%, 25%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]{background:var(--normal-bg);border-color:var(--normal-border);color:var(--normal-text)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast] [data-close-button]:hover{background:var(--normal-bg-hover);border-color:var(--normal-border-hover)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)}
48
+ `);function id(t){return t.label!==void 0}var hT=3,gT="32px",bT="16px",H0=4e3,vT=356,xT=14,yT=20,CT=200;function Dr(...t){return t.filter(Boolean).join(" ")}function wT(t){let[e,o]=t.split("-"),n=[];return e&&n.push(e),o&&n.push(o),n}var ST=t=>{var e,o,n,r,s,i,l,a,c,u,d;let{invert:f,toast:m,unstyled:h,interacting:p,setHeights:g,visibleToasts:b,heights:v,index:x,toasts:y,expanded:C,removeToast:S,defaultRichColors:w,closeButton:F,style:_,cancelButtonStyle:A,actionButtonStyle:R,className:I="",descriptionClassName:D="",duration:E,position:T,gap:L,loadingIcon:k,expandByDefault:j,classNames:P,icons:N,closeButtonAriaLabel:B="Close toast",pauseWhenPageIsHidden:M}=t,[O,V]=Se.useState(null),[G,z]=Se.useState(null),[X,te]=Se.useState(!1),[Y,H]=Se.useState(!1),[le,q]=Se.useState(!1),[fe,ae]=Se.useState(!1),[J,ge]=Se.useState(!1),[Ce,he]=Se.useState(0),[Le,Ae]=Se.useState(0),Q=Se.useRef(m.duration||E||H0),ke=Se.useRef(null),xe=Se.useRef(null),ce=x===0,ne=x+1<=b,U=m.type,ie=m.dismissible!==!1,de=m.className||"",Te=m.descriptionClassName||"",Ge=Se.useMemo(()=>v.findIndex(be=>be.toastId===m.id)||0,[v,m.id]),je=Se.useMemo(()=>{var be;return(be=m.closeButton)!=null?be:F},[m.closeButton,F]),lt=Se.useMemo(()=>m.duration||E||H0,[m.duration,E]),Ue=Se.useRef(0),He=Se.useRef(0),dt=Se.useRef(0),Kt=Se.useRef(null),[ze,Je]=T.split("-"),Xe=Se.useMemo(()=>v.reduce((be,ee,K)=>K>=Ge?be:be+ee.height,0),[v,Ge]),Ct=aT(),Et=m.invert||f,gt=U==="loading";He.current=Se.useMemo(()=>Ge*L+Xe,[Ge,Xe]),Se.useEffect(()=>{Q.current=lt},[lt]),Se.useEffect(()=>{te(!0)},[]),Se.useEffect(()=>{let be=xe.current;if(be){let ee=be.getBoundingClientRect().height;return Ae(ee),g(K=>[{toastId:m.id,height:ee,position:m.position},...K]),()=>g(K=>K.filter(Z=>Z.toastId!==m.id))}},[g,m.id]),Se.useLayoutEffect(()=>{if(!X)return;let be=xe.current,ee=be.style.height;be.style.height="auto";let K=be.getBoundingClientRect().height;be.style.height=ee,Ae(K),g(Z=>Z.find(re=>re.toastId===m.id)?Z.map(re=>re.toastId===m.id?{...re,height:K}:re):[{toastId:m.id,height:K,position:m.position},...Z])},[X,m.title,m.description,g,m.id]);let qe=Se.useCallback(()=>{H(!0),he(He.current),g(be=>be.filter(ee=>ee.toastId!==m.id)),setTimeout(()=>{S(m)},CT)},[m,S,g,He]);Se.useEffect(()=>{if(m.promise&&U==="loading"||m.duration===1/0||m.type==="loading")return;let be;return C||p||M&&Ct?(()=>{if(dt.current<Ue.current){let ee=new Date().getTime()-Ue.current;Q.current=Q.current-ee}dt.current=new Date().getTime()})():Q.current!==1/0&&(Ue.current=new Date().getTime(),be=setTimeout(()=>{var ee;(ee=m.onAutoClose)==null||ee.call(m,m),qe()},Q.current)),()=>clearTimeout(be)},[C,p,m,U,M,Ct,qe]),Se.useEffect(()=>{m.delete&&qe()},[qe,m.delete]);function Pt(){var be,ee,K;return N!=null&&N.loading?Se.createElement("div",{className:Dr(P?.loader,(be=m?.classNames)==null?void 0:be.loader,"sonner-loader"),"data-visible":U==="loading"},N.loading):k?Se.createElement("div",{className:Dr(P?.loader,(ee=m?.classNames)==null?void 0:ee.loader,"sonner-loader"),"data-visible":U==="loading"},k):Se.createElement(tT,{className:Dr(P?.loader,(K=m?.classNames)==null?void 0:K.loader),visible:U==="loading"})}return Se.createElement("li",{tabIndex:0,ref:xe,className:Dr(I,de,P?.toast,(e=m?.classNames)==null?void 0:e.toast,P?.default,P?.[U],(o=m?.classNames)==null?void 0:o[U]),"data-sonner-toast":"","data-rich-colors":(n=m.richColors)!=null?n:w,"data-styled":!(m.jsx||m.unstyled||h),"data-mounted":X,"data-promise":!!m.promise,"data-swiped":J,"data-removed":Y,"data-visible":ne,"data-y-position":ze,"data-x-position":Je,"data-index":x,"data-front":ce,"data-swiping":le,"data-dismissible":ie,"data-type":U,"data-invert":Et,"data-swipe-out":fe,"data-swipe-direction":G,"data-expanded":!!(C||j&&X),style:{"--index":x,"--toasts-before":x,"--z-index":y.length-x,"--offset":`${Y?Ce:He.current}px`,"--initial-height":j?"auto":`${Le}px`,..._,...m.style},onPointerDown:be=>{gt||!ie||(ke.current=new Date,he(He.current),be.target.setPointerCapture(be.pointerId),be.target.tagName!=="BUTTON"&&(q(!0),Kt.current={x:be.clientX,y:be.clientY}))},onPointerUp:()=>{var be,ee,K,Z;if(fe||!ie)return;Kt.current=null;let re=Number(((be=xe.current)==null?void 0:be.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),pe=Number(((ee=xe.current)==null?void 0:ee.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),ve=new Date().getTime()-((K=ke.current)==null?void 0:K.getTime()),we=O==="x"?re:pe,Ee=Math.abs(we)/ve;if(Math.abs(we)>=yT||Ee>.11){he(He.current),(Z=m.onDismiss)==null||Z.call(m,m),z(O==="x"?re>0?"right":"left":pe>0?"down":"up"),qe(),ae(!0),ge(!1);return}q(!1),V(null)},onPointerMove:be=>{var ee,K,Z,re;if(!Kt.current||!ie||((ee=window.getSelection())==null?void 0:ee.toString().length)>0)return;let pe=be.clientY-Kt.current.y,ve=be.clientX-Kt.current.x,we=(K=t.swipeDirections)!=null?K:wT(T);!O&&(Math.abs(ve)>1||Math.abs(pe)>1)&&V(Math.abs(ve)>Math.abs(pe)?"x":"y");let Ee={x:0,y:0};O==="y"?(we.includes("top")||we.includes("bottom"))&&(we.includes("top")&&pe<0||we.includes("bottom")&&pe>0)&&(Ee.y=pe):O==="x"&&(we.includes("left")||we.includes("right"))&&(we.includes("left")&&ve<0||we.includes("right")&&ve>0)&&(Ee.x=ve),(Math.abs(Ee.x)>0||Math.abs(Ee.y)>0)&&ge(!0),(Z=xe.current)==null||Z.style.setProperty("--swipe-amount-x",`${Ee.x}px`),(re=xe.current)==null||re.style.setProperty("--swipe-amount-y",`${Ee.y}px`)}},je&&!m.jsx?Se.createElement("button",{"aria-label":B,"data-disabled":gt,"data-close-button":!0,onClick:gt||!ie?()=>{}:()=>{var be;qe(),(be=m.onDismiss)==null||be.call(m,m)},className:Dr(P?.closeButton,(r=m?.classNames)==null?void 0:r.closeButton)},(s=N?.close)!=null?s:iT):null,m.jsx||jp(m.title)?m.jsx?m.jsx:typeof m.title=="function"?m.title():m.title:Se.createElement(Se.Fragment,null,U||m.icon||m.promise?Se.createElement("div",{"data-icon":"",className:Dr(P?.icon,(i=m?.classNames)==null?void 0:i.icon)},m.promise||m.type==="loading"&&!m.icon?m.icon||Pt():null,m.type!=="loading"?m.icon||N?.[U]||KA(U):null):null,Se.createElement("div",{"data-content":"",className:Dr(P?.content,(l=m?.classNames)==null?void 0:l.content)},Se.createElement("div",{"data-title":"",className:Dr(P?.title,(a=m?.classNames)==null?void 0:a.title)},typeof m.title=="function"?m.title():m.title),m.description?Se.createElement("div",{"data-description":"",className:Dr(D,Te,P?.description,(c=m?.classNames)==null?void 0:c.description)},typeof m.description=="function"?m.description():m.description):null),jp(m.cancel)?m.cancel:m.cancel&&id(m.cancel)?Se.createElement("button",{"data-button":!0,"data-cancel":!0,style:m.cancelButtonStyle||A,onClick:be=>{var ee,K;id(m.cancel)&&ie&&((K=(ee=m.cancel).onClick)==null||K.call(ee,be),qe())},className:Dr(P?.cancelButton,(u=m?.classNames)==null?void 0:u.cancelButton)},m.cancel.label):null,jp(m.action)?m.action:m.action&&id(m.action)?Se.createElement("button",{"data-button":!0,"data-action":!0,style:m.actionButtonStyle||R,onClick:be=>{var ee,K;id(m.action)&&((K=(ee=m.action).onClick)==null||K.call(ee,be),!be.defaultPrevented&&qe())},className:Dr(P?.actionButton,(d=m?.classNames)==null?void 0:d.actionButton)},m.action.label):null))};function z0(){if(typeof window>"u"||typeof document>"u")return"ltr";let t=document.documentElement.getAttribute("dir");return t==="auto"||!t?window.getComputedStyle(document.documentElement).direction:t}function IT(t,e){let o={};return[t,e].forEach((n,r)=>{let s=r===1,i=s?"--mobile-offset":"--offset",l=s?bT:gT;function a(c){["top","right","bottom","left"].forEach(u=>{o[`${i}-${u}`]=typeof c=="number"?`${c}px`:c})}typeof n=="number"||typeof n=="string"?a(n):typeof n=="object"?["top","right","bottom","left"].forEach(c=>{n[c]===void 0?o[`${i}-${c}`]=l:o[`${i}-${c}`]=typeof n[c]=="number"?`${n[c]}px`:n[c]}):a(l)}),o}var X0=qA(function(t,e){let{invert:o,position:n="bottom-right",hotkey:r=["altKey","KeyT"],expand:s,closeButton:i,className:l,offset:a,mobileOffset:c,theme:u="light",richColors:d,duration:f,style:m,visibleToasts:h=hT,toastOptions:p,dir:g=z0(),gap:b=xT,loadingIcon:v,icons:x,containerAriaLabel:y="Notifications",pauseWhenPageIsHidden:C}=t,[S,w]=Se.useState([]),F=Se.useMemo(()=>Array.from(new Set([n].concat(S.filter(M=>M.position).map(M=>M.position)))),[S,n]),[_,A]=Se.useState([]),[R,I]=Se.useState(!1),[D,E]=Se.useState(!1),[T,L]=Se.useState(u!=="system"?u:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),k=Se.useRef(null),j=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),P=Se.useRef(null),N=Se.useRef(!1),B=Se.useCallback(M=>{w(O=>{var V;return(V=O.find(G=>G.id===M.id))!=null&&V.delete||Jo.dismiss(M.id),O.filter(({id:G})=>G!==M.id)})},[]);return Se.useEffect(()=>Jo.subscribe(M=>{if(M.dismiss){w(O=>O.map(V=>V.id===M.id?{...V,delete:!0}:V));return}setTimeout(()=>{QA.flushSync(()=>{w(O=>{let V=O.findIndex(G=>G.id===M.id);return V!==-1?[...O.slice(0,V),{...O[V],...M},...O.slice(V+1)]:[M,...O]})})})}),[]),Se.useEffect(()=>{if(u!=="system"){L(u);return}if(u==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?L("dark"):L("light")),typeof window>"u")return;let M=window.matchMedia("(prefers-color-scheme: dark)");try{M.addEventListener("change",({matches:O})=>{L(O?"dark":"light")})}catch{M.addListener(({matches:V})=>{try{L(V?"dark":"light")}catch(G){console.error(G)}})}},[u]),Se.useEffect(()=>{S.length<=1&&I(!1)},[S]),Se.useEffect(()=>{let M=O=>{var V,G;r.every(z=>O[z]||O.code===z)&&(I(!0),(V=k.current)==null||V.focus()),O.code==="Escape"&&(document.activeElement===k.current||(G=k.current)!=null&&G.contains(document.activeElement))&&I(!1)};return document.addEventListener("keydown",M),()=>document.removeEventListener("keydown",M)},[r]),Se.useEffect(()=>{if(k.current)return()=>{P.current&&(P.current.focus({preventScroll:!0}),P.current=null,N.current=!1)}},[k.current]),Se.createElement("section",{ref:e,"aria-label":`${y} ${j}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},F.map((M,O)=>{var V;let[G,z]=M.split("-");return S.length?Se.createElement("ol",{key:M,dir:g==="auto"?z0():g,tabIndex:-1,ref:k,className:l,"data-sonner-toaster":!0,"data-theme":T,"data-y-position":G,"data-lifted":R&&S.length>1&&!s,"data-x-position":z,style:{"--front-toast-height":`${((V=_[0])==null?void 0:V.height)||0}px`,"--width":`${vT}px`,"--gap":`${b}px`,...m,...IT(a,c)},onBlur:X=>{N.current&&!X.currentTarget.contains(X.relatedTarget)&&(N.current=!1,P.current&&(P.current.focus({preventScroll:!0}),P.current=null))},onFocus:X=>{X.target instanceof HTMLElement&&X.target.dataset.dismissible==="false"||N.current||(N.current=!0,P.current=X.relatedTarget)},onMouseEnter:()=>I(!0),onMouseMove:()=>I(!0),onMouseLeave:()=>{D||I(!1)},onPointerDown:X=>{X.target instanceof HTMLElement&&X.target.dataset.dismissible==="false"||E(!0)},onPointerUp:()=>E(!1)},S.filter(X=>!X.position&&O===0||X.position===M).map((X,te)=>{var Y,H;return Se.createElement(ST,{key:X.id,icons:x,index:te,toast:X,defaultRichColors:d,duration:(Y=p?.duration)!=null?Y:f,className:p?.className,descriptionClassName:p?.descriptionClassName,invert:o,visibleToasts:h,closeButton:(H=p?.closeButton)!=null?H:i,interacting:D,position:M,style:p?.style,unstyled:p?.unstyled,classNames:p?.classNames,cancelButtonStyle:p?.cancelButtonStyle,actionButtonStyle:p?.actionButtonStyle,removeToast:B,toasts:S.filter(le=>le.position==X.position),heights:_.filter(le=>le.position==X.position),setHeights:A,expandByDefault:s,gap:b,loadingIcon:v,expanded:R,pauseWhenPageIsHidden:C,swipeDirections:t.swipeDirections})})):null}))});import{c as NT}from"react/compiler-runtime";import{jsx as LT}from"react/jsx-runtime";import{useRouter as $T}from"next/navigation.js";import{formatAdminURL as kT}from"payload/shared";import"react";import{c as ET}from"react/compiler-runtime";import{jsx as vl,jsxs as Gp}from"react/jsx-runtime";import PT from"react";import{c as Bp}from"react/compiler-runtime";import{jsx as bn,jsxs as ld}from"react/jsx-runtime";import{createContext as FT,use as AT,useEffect as U0,useState as Y0}from"react";import{jsx as RT}from"react/jsx-runtime";import"react";var ad="gutter",Bo=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 RT("div",{className:[a&&`${ad}--left`,c&&`${ad}--right`,r&&`${ad}--negative-left`,s&&`${ad}--negative-right`,o].filter(Boolean).join(" "),ref:i,children:e})};import{c as _T}from"react/compiler-runtime";import{useId as DT}from"react";var bl=t=>{let e=_T(3),o=DT(),n=ct(),r=`${t}-${o}`,s;return e[0]!==n||e[1]!==r?(s=Mp({slug:r,depth:n}),e[0]=n,e[1]=r,e[2]=s):s=e[2],s};var Fr="drawer",Vp=100,Mp=({slug:t,depth:e})=>`drawer_${e}_${t}`,dr=t=>{let e=Bp(17),o,n,r,s,i,l;e[0]!==t?({slug:l,children:o,className:n,disabled:r,onClick:s,...i}=t,e[0]=t,e[1]=o,e[2]=n,e[3]=r,e[4]=s,e[5]=i,e[6]=l):(o=e[1],n=e[2],r=e[3],s=e[4],i=e[5],l=e[6]);let{openModal:a}=ue(),c;e[7]!==s||e[8]!==a||e[9]!==l?(c=f=>{a(l),typeof s=="function"&&s(f)},e[7]=s,e[8]=a,e[9]=l,e[10]=c):c=e[10];let u=c,d;return e[11]!==o||e[12]!==n||e[13]!==r||e[14]!==u||e[15]!==i?(d=bn("button",{className:n,disabled:r,onClick:u,type:"button",...i,children:o}),e[11]=o,e[12]=n,e[13]=r,e[14]=u,e[15]=i,e[16]=d):d=e[16],d},Lt=t=>{let e=Bp(26),{slug:o,children:n,className:r,gutter:s,Header:i,hoverTitle:l,title:a}=t,c=s===void 0?!0:s,{t:u}=$(),{closeModal:d,modalState:f}=ue(),m=qn(),[h,p]=Y0(!1),[g,b]=Y0(!1),v,x;e[0]!==f||e[1]!==o?(v=()=>{p(f[o]?.isOpen)},x=[o,f],e[0]=f,e[1]=o,e[2]=v,e[3]=x):(v=e[2],x=e[3]),U0(v,x);let y,C;if(e[4]!==h?(y=()=>{b(h)},C=[h],e[4]=h,e[5]=y,e[6]=C):(y=e[5],C=e[6]),U0(y,C),h){let S=g&&`${Fr}--is-open`,w=m>1&&`${Fr}--nested`,F;e[7]!==r||e[8]!==S||e[9]!==w?(F=[r,Fr,S,w].filter(Boolean),e[7]=r,e[8]=S,e[9]=w,e[10]=F):F=e[10];let _=F.join(" "),A=Vp+m,R;if(e[11]!==i||e[12]!==n||e[13]!==d||e[14]!==m||e[15]!==c||e[16]!==l||e[17]!==o||e[18]!==u||e[19]!==A||e[20]!==_||e[21]!==a){let I;e[23]!==d||e[24]!==o?(I=()=>d(o),e[23]=d,e[24]=o,e[25]=I):I=e[25],R=bn(TT,{children:ld(Zo,{className:_,slug:o,style:{zIndex:A},children:[(!m||m===1)&&bn("div",{className:`${Fr}__blur-bg`}),bn("button",{"aria-label":u("general:close"),className:`${Fr}__close`,id:`close-drawer__${o}`,onClick:I,type:"button"}),ld("div",{className:`${Fr}__content`,style:{width:`calc(100% - (${m} * var(--gutter-h)))`},children:[bn("div",{className:`${Fr}__blur-bg-content`}),ld(Bo,{className:`${Fr}__content-children`,left:c,right:c,children:[i,i===void 0&&ld("div",{className:`${Fr}__header`,children:[bn("h2",{className:`${Fr}__header__title`,title:l?a:null,children:a}),bn("button",{"aria-label":u("general:close"),className:`${Fr}__header__close`,id:`close-drawer__${o}`,onClick:()=>d(o),type:"button",children:bn(pt,{})})]}),n]})]})]})}),e[11]=i,e[12]=n,e[13]=d,e[14]=m,e[15]=c,e[16]=l,e[17]=o,e[18]=u,e[19]=A,e[20]=_,e[21]=a,e[22]=R}else R=e[22];return R}return null},Z0=FT(1),TT=t=>{let e=Bp(3),{children:o}=t,r=qn()+1,s;return e[0]!==o||e[1]!==r?(s=bn(Z0,{value:r,children:o}),e[0]=o,e[1]=r,e[2]=s):s=e[2],s},qn=()=>AT(Z0);var cd="confirmation-modal";function Rt(t){let e=ET(33),{body:o,cancelLabel:n,className:r,confirmingLabel:s,confirmLabel:i,heading:l,modalSlug:a,onCancel:c,onConfirm:u}=t,d=qn(),[f,m]=PT.useState(!1),{closeModal:h}=ue(),{t:p}=$(),g;e[0]!==h||e[1]!==f||e[2]!==a||e[3]!==u?(g=async()=>{f||(m(!0),typeof u=="function"&&await u(),m(!1),h(a))},e[0]=h,e[1]=f,e[2]=a,e[3]=u,e[4]=g):g=e[4];let b=g,v;e[5]!==h||e[6]!==f||e[7]!==a||e[8]!==c?(v=()=>{f||(h(a),typeof c=="function"&&c())},e[5]=h,e[6]=f,e[7]=a,e[8]=c,e[9]=v):v=e[9];let x=v,y;e[10]!==r?(y=[cd,r].filter(Boolean),e[10]=r,e[11]=y):y=e[11];let C=y.join(" "),S=Vp+d,w;if(e[12]!==o||e[13]!==n||e[14]!==i||e[15]!==f||e[16]!==s||e[17]!==l||e[18]!==a||e[19]!==x||e[20]!==b||e[21]!==p||e[22]!==C||e[23]!==S){let F;e[25]!==n||e[26]!==p?(F=n||p("general:cancel"),e[25]=n,e[26]=p,e[27]=F):F=e[27];let _;e[28]!==i||e[29]!==f||e[30]!==s||e[31]!==p?(_=f?s||`${p("general:loading")}...`:i||p("general:confirm"),e[28]=i,e[29]=f,e[30]=s,e[31]=p,e[32]=_):_=e[32],w=vl(Zo,{className:C,slug:a,style:{zIndex:S},children:Gp("div",{className:`${cd}__wrapper`,children:[Gp("div",{className:`${cd}__content`,children:[vl("h1",{children:l}),vl("p",{children:o})]}),Gp("div",{className:`${cd}__controls`,children:[vl(se,{buttonStyle:"secondary",disabled:f,id:"confirm-cancel",onClick:x,size:"large",type:"button",children:F}),vl(se,{id:"confirm-action",onClick:b,size:"large",children:_})]})]})}),e[12]=o,e[13]=n,e[14]=i,e[15]=f,e[16]=s,e[17]=l,e[18]=a,e[19]=x,e[20]=b,e[21]=p,e[22]=C,e[23]=S,e[24]=w}else w=e[24];return w}var Wp="stay-logged-in",J0=()=>{let t=NT(11),{refreshCookie:e}=De(),o=$T(),{config:n}=W(),{admin:r,routes:s}=n,{routes:i}=r,{logout:l}=i,{admin:a}=s,{t:c}=$(),{startRouteTransition:u}=st(),d;t[0]!==a||t[1]!==l||t[2]!==o||t[3]!==u?(d=()=>u(()=>o.push(kT({adminRoute:a,path:l}))),t[0]=a,t[1]=l,t[2]=o,t[3]=u,t[4]=d):d=t[4];let f=d,m;t[5]!==e?(m=()=>{e()},t[5]=e,t[6]=m):m=t[6];let h=m,p;return t[7]!==h||t[8]!==f||t[9]!==c?(p=LT(Rt,{body:c("authentication:youAreInactive"),cancelLabel:c("authentication:stayLoggedIn"),confirmLabel:c("authentication:logOut"),heading:c("authentication:stayLoggedIn"),modalSlug:Wp,onCancel:h,onConfirm:f}),t[7]=h,t[8]=f,t[9]=c,t[10]=p):p=t[10],p};import{c as jT}from"react/compiler-runtime";import{useEffect as OT,useState as MT}from"react";function qo(t,e){let o=jT(4),[n,r]=MT(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]),OT(s,i),n}import*as q0 from"qs-esm";var Ke={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=q0.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 tx=HT({}),K0=2147483647;function Hp({children:t,permissions:e,user:o}){let[n,r]=xl(o),[s,i]=xl(),[l,a]=xl(),c=VT(),u=GT(),{config:d}=W(),{admin:{routes:{inactivity:f},user:m},routes:{admin:h,api:p},serverURL:g}=d,[b,v]=xl(e),{i18n:x}=$(),{closeAllModals:y,openModal:C}=ue(),[S,w]=xl(0),F=qo(S,1e4),_=Q0.useRef(null),{startRouteTransition:A}=st(),R=n?.id,I=Vs(()=>{A(()=>u.replace(WT({adminRoute:h,path:`${f}${window.location.pathname.startsWith(h)?`?redirect=${encodeURIComponent(window.location.pathname)}`:""}`}))),y()},[u,h,f,y,A]),D=Vs(()=>{i(void 0),a(void 0),clearTimeout(_.current)},[]),E=Vs(N=>{N?.user?(r(N.user),i(N.token),a(N.exp)):(r(null),D())},[D]),T=Vs(N=>{let B=Math.round(new Date().getTime()/1e3),M=(typeof l=="number"?l:0)-B;return(N||l&&M<120)&&(_.current=setTimeout(()=>{async function O(){try{let V=await Ke.post(`${g}${p}/${m}/refresh-token?refresh`,{headers:{"Accept-Language":x.language}});if(V.status===200){let G=await V.json();E(G)}else E(null),I()}catch(V){me.error(V.message)}}O()},1e3)),()=>{clearTimeout(_.current)}},[p,x.language,I,g,E,l,m]),L=Vs(async N=>{try{let B=await Ke.post(`${g}${p}/${m}/refresh-token`,{headers:{"Accept-Language":x.language}});if(B.status===200){let M=await B.json();return N||E(M),M.user}return E(null),I(),null}catch(B){return me.error(`Refreshing token failed: ${B.message}`),null}},[p,x.language,I,g,E,m]),k=Vs(async()=>{try{return await Ke.post(`${g}${p}/${n.collection}/logout`),E(null),D(),!0}catch(N){return me.error(`Logging out failed: ${N.message}`),!1}},[p,D,g,E,n]),j=Vs(async({locale:N}={})=>{let B=ex.stringify({locale:N},{addQueryPrefix:!0});try{let M=await Ke.get(`${g}${p}/access${B}`,{headers:{"Accept-Language":x.language}});if(M.status===200){let O=await M.json();v(O)}else throw new Error(`Fetching permissions failed with status code ${M.status}`)}catch(M){me.error(`Refreshing permissions failed: ${M.message}`)}},[g,p,x]),P=Q0.useCallback(async()=>{try{let N=await Ke.get(`${g}${p}/${m}/me`,{credentials:"include",headers:{"Accept-Language":x.language}});if(N.status===200){let B=await N.json(),M=null;return E(B),M}}catch(N){me.error(`Fetching user failed: ${N.message}`)}return null},[g,p,m,x.language,E]);return ud(()=>{P()},[P]),ud(()=>{R&&T()},[F,T,R]),ud(()=>{w(Date.now())},[c]),ud(()=>{let N,B,M=Math.round(new Date().getTime()/1e3),O=typeof l=="number"?l-M:0,V=Math.max(Math.min((O-60)*1e3,K0),0),G=Math.max(Math.min(O*1e3,K0),0);if(!n){clearTimeout(N),clearTimeout(B);return}return O>0&&(N=setTimeout(()=>{C(Wp)},V),B=setTimeout(()=>{E(null),I()},G)),()=>{N&&clearTimeout(N),B&&clearTimeout(B)}},[l,C,x,E,n,I]),BT(tx,{value:{fetchFullUser:P,logOut:k,permissions:b,refreshCookie:T,refreshCookieAsync:L,refreshPermissions:j,setPermissions:v,setUser:E,token:s,user:n},children:t})}var De=()=>zT(tx);import{jsx as XT}from"react/jsx-runtime";import{dequal as ox}from"dequal/lite";import{createContext as UT,use as YT,useCallback as rx,useEffect as ZT,useRef as Xp}from"react";function zp(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]=zp(t[n],e[n]):o[n]=e[n]);return o}var sx=UT({}),nx=(t,e)=>({body:JSON.stringify({value:t}),headers:{"Accept-Language":e,"Content-Type":"application/json"}}),Up=({children:t})=>{let e=Xp({}),o=Xp({}),n=Xp({}),{config:r}=W(),{user:s}=De(),{i18n:i}=$(),{routes:{api:l},serverURL:a}=r;ZT(()=>{s||(o.current={})},[s]);let c=rx(async d=>{let f=o.current;if(typeof f[d]<"u")return f[d];let m=new Promise(h=>{(async()=>{let p=await Ke.get(`${a}${l}/payload-preferences/${d}`,{headers:{"Accept-Language":i.language}}),g=null;p.status===200&&(g=(await p.json()).value),o.current[d]=g,h(g)})()});return f[d]=m,m},[i.language,l,o,a]),u=rx(async(d,f,m=!1)=>{if(m===!1){o.current[d]=f,await Ke.post(`${a}${l}/payload-preferences/${d}`,nx(f,i.language));return}let h=f,p=await c(d);if(typeof f=="object"&&typeof p=="object"&&typeof h=="object"){if(p&&(h=zp(p,h)),ox(h,p))return;n.current[d]={...n.current[d],...h}}else{if(h===p)return;n.current[d]=h}let g=async()=>{ox(n.current[d],o.current[d])||(o.current[d]=n.current[d],await Ke.post(`${a}${l}/payload-preferences/${d}`,nx(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,XT(sx,{value:e.current,children:t})},Ao=()=>YT(sx);var ux=lx({}),dx=lx({localeIsLoading:!1,setLocaleIsLoading:t=>{}}),tE=async(t,e)=>await fetch(`${e}/payload-preferences/${t}`,{credentials:"include",headers:{"Content-Type":"application/json"},method:"GET"})?.then(o=>o.json()),Yp=t=>{let e=JT(27),{children:o,locale:n}=t,{config:r}=W(),{localization:s,routes:i,serverURL:l}=r,a=s===void 0?!1:s,{api:c}=i,{user:u}=De(),d=a?a.defaultLocale:"en",{getPreference:f}=Ao(),m=qT(),h;e[0]!==m?(h=m.get("locale"),e[0]=m,e[1]=h):h=e[1];let p=h,g;e[2]!==d||e[3]!==n||e[4]!==p||e[5]!==a?(g=()=>!a||a&&!a.locales.length?{}:Zn(a,p)||Zn(a,n)||Zn(a,d)||Zn(a,a.locales[0].code),e[2]=d,e[3]=n,e[4]=p,e[5]=a,e[6]=g):g=e[6];let[b,v]=QT.useState(g),[x,y]=eE(!1),C=KT(b),S,w;e[7]!==b?(S=()=>{b.code!==C.current.code&&y(!1),C.current=b},w=[b],e[7]=b,e[8]=S,e[9]=w):(S=e[8],w=e[9]),ax(S,w);let F=`${l}${c}`,_;e[10]!==d||e[11]!==F||e[12]!==p||e[13]!==a||e[14]!==u?.id?(_=()=>{(async function(){if(a&&u?.id){let T=p||await tE("locale",F)?.then(oE),L=Zn(a,T)||Zn(a,d)||Zn(a,a?.locales?.[0]?.code);L&&v(L)}})()},e[10]=d,e[11]=F,e[12]=p,e[13]=a,e[14]=u?.id,e[15]=_):_=e[15];let A=u?.id,R;e[16]!==d||e[17]!==F||e[18]!==f||e[19]!==p||e[20]!==a||e[21]!==A?(R=[d,f,a,F,p,A],e[16]=d,e[17]=F,e[18]=f,e[19]=p,e[20]=a,e[21]=A,e[22]=R):R=e[22],ax(_,R);let I;return e[23]!==o||e[24]!==x||e[25]!==b?(I=ix(ux,{value:b,children:ix(dx,{value:{localeIsLoading:x,setLocaleIsLoading:y},children:o})}),e[23]=o,e[24]=x,e[25]=b,e[26]=I):I=e[26],I},dd=()=>cx(dx),$e=()=>cx(ux);function oE(t){return t.value}var md=(t,e,o)=>`field-${t?.replace(/\./g,"__")}${e>1?`-${e}`:""}${o?`-${o}`:""}`;var ye=t=>{let e=rE(25),{as:o,hideLocale:n,htmlFor:r,label:s,localized:i,path:l,required:a,unstyled:c}=t,u=o===void 0?"label":o,d=n===void 0?!1:n,f=i===void 0?!1:i,m=a===void 0?!1:a,h=c===void 0?!1:c,{uuid:p}=Me(),g=ct(),b;e[0]!==g||e[1]!==r||e[2]!==l||e[3]!==p?(b=r||md(l,g,p),e[0]=g,e[1]=r,e[2]=l,e[3]=p,e[4]=b):b=e[4];let v=b,{i18n:x}=$(),{code:y,label:C}=$e();if(s){let S=`field-label ${h?"unstyled":""}`,w;if(e[5]!==u||e[6]!==y||e[7]!==d||e[8]!==v||e[9]!==x||e[10]!==s||e[11]!==C||e[12]!==f||e[13]!==m||e[14]!==S||e[15]!==h){let F;e[17]!==m||e[18]!==h?(F=m&&!h&&nE("span",{className:"required",children:"*"}),e[17]=m,e[18]=h,e[19]=F):F=e[19];let _;e[20]!==y||e[21]!==d||e[22]!==C||e[23]!==f?(_=f&&!d&&mx("span",{className:"localized",children:["\u2014 ",typeof C=="string"?C:y]}),e[20]=y,e[21]=d,e[22]=C,e[23]=f,e[24]=_):_=e[24],w=mx(u,{className:S,htmlFor:v,children:[sE(s,x),F,_]}),e[5]=u,e[6]=y,e[7]=d,e[8]=v,e[9]=x,e[10]=s,e[11]=C,e[12]=f,e[13]=m,e[14]=S,e[15]=h,e[16]=w}else w=e[16];return w}return null};var fd=({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:[]}),pd=({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 UE}from"react/compiler-runtime";import{jsx as ay}from"react/jsx-runtime";import*as ly from"react";import{jsx as Dl,jsxs as HE}from"react/jsx-runtime";import{useCallback as iy,useMemo as zE}from"react";import{c as VE}from"react/compiler-runtime";import{useRef as oy}from"react";import{c as iE}from"react/compiler-runtime";import{useEffect as aE,useRef as lE}from"react";var Gs=(t,e,o)=>{let n=iE(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=lE(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],aE(a,c)};import{jsx as sh}from"react/jsx-runtime";import*as Qx from"qs-esm";import Jx,{createContext as NE,use as LE,useCallback as Xi,useEffect as qx,useMemo as $E,useRef as kE,useState as Qo}from"react";import{getTranslation as AE}from"@payloadcms/translations";var cE={},yl={};function Gi(t,e){try{let n=(cE[t]||=new Intl.DateTimeFormat("en-GB",{timeZone:t,hour:"numeric",timeZoneName:"longOffset"}).format)(e).split("GMT")[1]||"";return n in yl?yl[n]:fx(n,n.split(":"))}catch{if(t in yl)return yl[t];let o=t?.match(uE);return o?fx(t,o.slice(1)):NaN}}var uE=/([+-]\d\d):?(\d\d)?/;function fx(t,e){let o=+e[0],n=+(e[1]||0);return yl[t]=o>0?o*60+n:o*60-n}var Mt=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(Gi(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)),hx(this,NaN),Zp(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-Gi(this.timeZone,this)}setTime(e){return Date.prototype.setTime.apply(this,arguments),Zp(this),+this}[Symbol.for("constructDateFrom")](e){return new t(+new Date(e),this.timeZone)}},px=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(t=>{if(!px.test(t))return;let e=t.replace(px,"$1UTC");Mt.prototype[e]&&(t.startsWith("get")?Mt.prototype[t]=function(){return this.internal[e]()}:(Mt.prototype[t]=function(){return Date.prototype[e].apply(this.internal,arguments),dE(this),+this},Mt.prototype[e]=function(){return Date.prototype[e].apply(this,arguments),Zp(this),+this}))});function Zp(t){t.internal.setTime(+t),t.internal.setUTCMinutes(t.internal.getUTCMinutes()-t.getTimezoneOffset())}function dE(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()),hx(t)}function hx(t){let e=Gi(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=Gi(t.timeZone,t),u=-new Date(+t).getTimezoneOffset()-a,d=a!==e,f=u-l;if(d&&f){Date.prototype.setUTCMinutes.call(t,Date.prototype.getUTCMinutes.call(t)+f);let m=Gi(t.timeZone,t),h=a-m;h&&(t.internal.setUTCMinutes(t.internal.getUTCMinutes()+h),Date.prototype.setUTCMinutes.call(t,Date.prototype.getUTCMinutes.call(t)+h))}}var mE=Math.pow(10,8)*24*60*60*1e3,CJ=-mE,hd=6048e5,gx=864e5;var Cl=43200,Jp=1440;var fE=3600;var bx=fE*24,wJ=bx*7,pE=bx*365.2425,hE=pE/12,SJ=hE*3,qp=Symbol.for("constructDateFrom");function lo(t,e){return typeof t=="function"?t(e):t&&typeof t=="object"&&qp in t?t[qp](e):t instanceof Date?new t.constructor(e):new Date(e)}function et(t,e){return lo(e||t,t)}var gE={};function qr(){return gE}function vn(t,e){let o=qr(),n=e?.weekStartsOn??e?.locale?.options?.weekStartsOn??o.weekStartsOn??o.locale?.options?.weekStartsOn??0,r=et(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 Ws(t,e){return vn(t,{...e,weekStartsOn:1})}function gd(t,e){let o=et(t,e?.in),n=o.getFullYear(),r=lo(o,0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);let s=Ws(r),i=lo(o,0);i.setFullYear(n,0,4),i.setHours(0,0,0,0);let l=Ws(i);return o.getTime()>=s.getTime()?n+1:o.getTime()>=l.getTime()?n:n-1}function Wi(t){let e=et(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 Qn(t,...e){let o=lo.bind(null,t||e.find(n=>typeof n=="object"));return e.map(o)}function Qp(t,e){let o=et(t,e?.in);return o.setHours(0,0,0,0),o}function vx(t,e,o){let[n,r]=Qn(o?.in,t,e),s=Qp(n),i=Qp(r),l=+s-Wi(s),a=+i-Wi(i);return Math.round((l-a)/gx)}function xx(t,e){let o=gd(t,e),n=lo(e?.in||t,0);return n.setFullYear(o,0,4),n.setHours(0,0,0,0),Ws(n)}function Hi(t,e){let o=+et(t)-+et(e);return o<0?-1:o>0?1:o}function yx(t){return lo(t,Date.now())}function Cx(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function wx(t){return!(!Cx(t)&&typeof t!="number"||isNaN(+et(t)))}function Sx(t,e,o){let[n,r]=Qn(o?.in,t,e),s=n.getFullYear()-r.getFullYear(),i=n.getMonth()-r.getMonth();return s*12+i}function Ix(t){return e=>{let n=(t?Math[t]:Math.trunc)(e);return n===0?0:n}}function Rx(t,e){return+et(t)-+et(e)}function _x(t,e){let o=et(t,e?.in);return o.setHours(23,59,59,999),o}function Dx(t,e){let o=et(t,e?.in),n=o.getMonth();return o.setFullYear(o.getFullYear(),n+1,0),o.setHours(23,59,59,999),o}function Fx(t,e){let o=et(t,e?.in);return+_x(o,e)==+Dx(o,e)}function Ax(t,e,o){let[n,r,s]=Qn(o?.in,t,t,e),i=Hi(r,s),l=Math.abs(Sx(r,s));if(l<1)return 0;r.getMonth()===1&&r.getDate()>27&&r.setDate(30),r.setMonth(r.getMonth()-i*l);let a=Hi(r,s)===-i;Fx(n)&&l===1&&Hi(n,s)===1&&(a=!1);let c=i*(l-+a);return c===0?0:c}function Tx(t,e,o){let n=Rx(t,e)/1e3;return Ix(o?.roundingMethod)(n)}function Ex(t,e){let o=et(t,e?.in);return o.setFullYear(o.getFullYear(),0,1),o.setHours(0,0,0,0),o}function Px(t,e){let o=et(t,e?.in);return vx(o,Ex(o))+1}function Nx(t,e){let o=et(t,e?.in),n=+Ws(o)-+xx(o);return Math.round(n/hd)+1}function bd(t,e){let o=et(t,e?.in),n=o.getFullYear(),r=qr(),s=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??r.firstWeekContainsDate??r.locale?.options?.firstWeekContainsDate??1,i=lo(e?.in||t,0);i.setFullYear(n+1,0,s),i.setHours(0,0,0,0);let l=vn(i,e),a=lo(e?.in||t,0);a.setFullYear(n,0,s),a.setHours(0,0,0,0);let c=vn(a,e);return+o>=+l?n+1:+o>=+c?n:n-1}function Lx(t,e){let o=qr(),n=e?.firstWeekContainsDate??e?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,r=bd(t,e),s=lo(e?.in||t,0);return s.setFullYear(r,0,n),s.setHours(0,0,0,0),vn(s,e)}function $x(t,e){let o=et(t,e?.in),n=+vn(o,e)-+Lx(o,e);return Math.round(n/hd)+1}function it(t,e){let o=t<0?"-":"",n=Math.abs(t).toString().padStart(e,"0");return o+n}var xn={y(t,e){let o=t.getFullYear(),n=o>0?o:1-o;return it(e==="yy"?n%100:n,e.length)},M(t,e){let o=t.getMonth();return e==="M"?String(o+1):it(o+1,2)},d(t,e){return it(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 it(t.getHours()%12||12,e.length)},H(t,e){return it(t.getHours(),e.length)},m(t,e){return it(t.getMinutes(),e.length)},s(t,e){return it(t.getSeconds(),e.length)},S(t,e){let o=e.length,n=t.getMilliseconds(),r=Math.trunc(n*Math.pow(10,o-3));return it(r,e.length)}};var zi={am:"am",pm:"pm",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},Kp={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 xn.y(t,e)},Y:function(t,e,o,n){let r=bd(t,n),s=r>0?r:1-r;if(e==="YY"){let i=s%100;return it(i,2)}return e==="Yo"?o.ordinalNumber(s,{unit:"year"}):it(s,e.length)},R:function(t,e){let o=gd(t);return it(o,e.length)},u:function(t,e){let o=t.getFullYear();return it(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 it(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 it(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 xn.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 it(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=$x(t,n);return e==="wo"?o.ordinalNumber(r,{unit:"week"}):it(r,e.length)},I:function(t,e,o){let n=Nx(t);return e==="Io"?o.ordinalNumber(n,{unit:"week"}):it(n,e.length)},d:function(t,e,o){return e==="do"?o.ordinalNumber(t.getDate(),{unit:"date"}):xn.d(t,e)},D:function(t,e,o){let n=Px(t);return e==="Do"?o.ordinalNumber(n,{unit:"dayOfYear"}):it(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 it(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 it(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 it(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=zi.noon:n===0?r=zi.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=zi.evening:n>=12?r=zi.afternoon:n>=4?r=zi.morning:r=zi.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 xn.h(t,e)},H:function(t,e,o){return e==="Ho"?o.ordinalNumber(t.getHours(),{unit:"hour"}):xn.H(t,e)},K:function(t,e,o){let n=t.getHours()%12;return e==="Ko"?o.ordinalNumber(n,{unit:"hour"}):it(n,e.length)},k:function(t,e,o){let n=t.getHours();return n===0&&(n=24),e==="ko"?o.ordinalNumber(n,{unit:"hour"}):it(n,e.length)},m:function(t,e,o){return e==="mo"?o.ordinalNumber(t.getMinutes(),{unit:"minute"}):xn.m(t,e)},s:function(t,e,o){return e==="so"?o.ordinalNumber(t.getSeconds(),{unit:"second"}):xn.s(t,e)},S:function(t,e){return xn.S(t,e)},X:function(t,e,o){let n=t.getTimezoneOffset();if(n===0)return"Z";switch(e){case"X":return jx(n);case"XXXX":case"XX":return Hs(n);case"XXXXX":case"XXX":default:return Hs(n,":")}},x:function(t,e,o){let n=t.getTimezoneOffset();switch(e){case"x":return jx(n);case"xxxx":case"xx":return Hs(n);case"xxxxx":case"xxx":default:return Hs(n,":")}},O:function(t,e,o){let n=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+kx(n,":");case"OOOO":default:return"GMT"+Hs(n,":")}},z:function(t,e,o){let n=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+kx(n,":");case"zzzz":default:return"GMT"+Hs(n,":")}},t:function(t,e,o){let n=Math.trunc(+t/1e3);return it(n,e.length)},T:function(t,e,o){return it(+t,e.length)}};function kx(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+it(s,2)}function jx(t,e){return t%60===0?(t>0?"-":"+")+it(Math.abs(t)/60,2):Hs(t,e)}function Hs(t,e=""){let o=t>0?"-":"+",n=Math.abs(t),r=it(Math.trunc(n/60),2),s=it(n%60,2);return o+r+e+s}var Ox=(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"})}},Mx=(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"})}},bE=(t,e)=>{let o=t.match(/(P+)(p+)?/)||[],n=o[1],r=o[2];if(!r)return Ox(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}}",Ox(n,e)).replace("{{time}}",Mx(r,e))},Bx={p:Mx,P:bE};var vE=/^D+$/,xE=/^Y+$/,yE=["D","DD","YY","YYYY"];function Vx(t){return vE.test(t)}function Gx(t){return xE.test(t)}function Wx(t,e,o){let n=CE(t,e,o);if(console.warn(n),yE.includes(t))throw new RangeError(n)}function CE(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 wE=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,SE=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,IE=/^'([^]*?)'?$/,RE=/''/g,_E=/[a-zA-Z]/;function eh(t,e,o){let n=qr(),r=o?.locale??n.locale??ol,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=et(t,o?.in);if(!wx(l))throw new RangeError("Invalid time value");let a=e.match(SE).map(u=>{let d=u[0];if(d==="p"||d==="P"){let f=Bx[d];return f(u,r.formatLong)}return u}).join("").match(wE).map(u=>{if(u==="''")return{isToken:!1,value:"'"};let d=u[0];if(d==="'")return{isToken:!1,value:DE(u)};if(Kp[d])return{isToken:!0,value:u};if(d.match(_E))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&&Gx(d)||!o?.useAdditionalDayOfYearTokens&&Vx(d))&&Wx(d,e,String(t));let f=Kp[d[0]];return f(l,d,r.localize,c)}).join("")}function DE(t){let e=t.match(IE);return e?e[1].replace(RE,"'"):t}function Hx(t,e,o){let n=qr(),r=o?.locale??n.locale??ol,s=2520,i=Hi(t,e);if(isNaN(i))throw new RangeError("Invalid time value");let l=Object.assign({},o,{addSuffix:o?.addSuffix,comparison:i}),[a,c]=Qn(o?.in,...i>0?[e,t]:[t,e]),u=Tx(c,a),d=(Wi(c)-Wi(a))/1e3,f=Math.round((u-d)/60),m;if(f<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):f===0?r.formatDistance("lessThanXMinutes",1,l):r.formatDistance("xMinutes",f,l);if(f<45)return r.formatDistance("xMinutes",f,l);if(f<90)return r.formatDistance("aboutXHours",1,l);if(f<Jp){let h=Math.round(f/60);return r.formatDistance("aboutXHours",h,l)}else{if(f<s)return r.formatDistance("xDays",1,l);if(f<Cl){let h=Math.round(f/Jp);return r.formatDistance("xDays",h,l)}else if(f<Cl*2)return m=Math.round(f/Cl),r.formatDistance("aboutXMonths",m,l)}if(m=Ax(c,a),m<12){let h=Math.round(f/Cl);return r.formatDistance("xMonths",h,l)}else{let h=m%12,p=Math.trunc(m/12);return h<3?r.formatDistance("aboutXYears",p,l):h<9?r.formatDistance("overXYears",p,l):r.formatDistance("almostXYears",p+1,l)}}function zx(t,e){return Hx(t,yx(t),e)}function Ar(t,e){let o=FE(e)?new e(0):lo(e,0);return o.setFullYear(t.getFullYear(),t.getMonth(),t.getDate()),o.setHours(t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()),o}function FE(t){return typeof t=="function"&&t.prototype?.constructor===t}var yn=({date:t,i18n:e,pattern:o,timezone:n})=>{let r=new Mt(new Date(t));if(n){let s=Mt.tz(n),i=r.withTimeZone(n),l=Ar(i,s);return e.dateFNS?eh(l,o,{locale:e.dateFNS}):`${e.t("general:loading")}...`}return e.dateFNS?eh(r,o,{locale:e.dateFNS}):`${e.t("general:loading")}...`},Xx=({date:t,i18n:e})=>{let o=new Date(t);return e?.dateFNS?zx(o,{locale:e.dateFNS}):`${e.t("general:loading")}...`};function th(t){return typeof t=="object"&&"root"in t}function vd(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+=vd(o.children,e));return e}var mr=({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,i)){let a=t.fields.find(u=>"name"in u&&u.name===l);if(a?.type==="date"){let u="date"in a.admin&&a?.admin?.date?.displayFormat||o;i=yn({date:i,i18n:s,pattern:u})||i}}}return r&&(i=AE(r?.label,s)||r?.slug),th(i)&&(i=vd(i.root.children?.[0]?.children||[],"")),!i&&th(n)&&(i=vd(n.root.children?.[0]?.children||[],"")),i||(i=typeof n=="string"?n:`[${s.t("general:untitled")}]`),i};import{c as TE}from"react/compiler-runtime";import{jsx as EE}from"react/jsx-runtime";import oh from"react";var Ux=oh.createContext({getUploadEdits:()=>{},resetUploadEdits:void 0,updateUploadEdits:void 0,uploadEdits:void 0}),rh=t=>{let e=TE(10),{children:o,initialUploadEdits:n}=t,r;e[0]!==n?(r=n||{},e[0]=n,e[1]=r):r=e[1];let[s,i]=oh.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=h=>{i(p=>({...p||{},...h||{}}))},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 f=d,m;return e[6]!==o||e[7]!==f||e[8]!==s?(m=EE(Ux,{value:{getUploadEdits:f,resetUploadEdits:a,updateUploadEdits:u,uploadEdits:s},children:o}),e[6]=o,e[7]=f,e[8]=s,e[9]=m):m=e[9],m},zs=()=>oh.use(Ux);import*as nh from"qs-esm";import PE from"react";var wl=t=>{let{collectionSlug:e,docPermissions:o,globalSlug:n,isEditing:r}=t;return e?!!(r&&o?.update||!r&&o?.create):n?!!o?.update:!1};var Yx=({id:t,collectionSlug:e,globalSlug:o})=>!!(o||e&&t);var Zx=({id:t,api:e,collectionSlug:o,globalSlug:n,i18n:r,locale:s,permissions:i,serverURL:l,setDocPermissions:a,setHasPublishPermission:c,setHasSavePermission:u})=>PE.useCallback(async d=>{let f={locale:s||void 0},m=d?.id||t,h=Yx({id:m,collectionSlug:o,globalSlug:n});if(h){let p=o?`/${o}/access/${m}`:n?`/globals/${n}/access`:null;if(p){let b=await(await fetch(`${l}${e}${p}?${nh.stringify(f)}`,{body:JSON.stringify({...d||{},_status:"draft"}),credentials:"include",headers:{"Accept-Language":r.language,"Content-Type":"application/json"},method:"post"})).json(),v=await fetch(`${l}${e}${p}?${nh.stringify(f)}`,{body:JSON.stringify({...d||{},_status:"published"}),credentials:"include",headers:{"Accept-Language":r.language,"Content-Type":"application/json"},method:"POST"}).then(x=>x.json());a(b),u(wl({collectionSlug:o,docPermissions:b,globalSlug:n,isEditing:h})),c(v?.update)}}else{let p=o?i?.collections?.[o]:i?.globals?.[n];a(p),u(wl({collectionSlug:o,docPermissions:p,globalSlug:n,isEditing:h}))}},[l,e,t,i,r.language,s,o,n]);var Kx=NE({}),Pe=()=>LE(Kx),jE=({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:f,lastUpdateTime:m,mostRecentVersionIsAutosaved:h,unpublishedVersionCount:p,versionCount:g}=e,[b,v]=Qo(s),[x,y]=Qo(c),[C,S]=Qo(a),{permissions:w}=De(),{config:{admin:{dateFormat:F},routes:{api:_},serverURL:A},getEntityConfig:R}=W(),I=R({collectionSlug:n}),D=R({globalSlug:i}),E=kE(new AbortController),T=I||D,{i18n:L}=$(),{uploadEdits:k}=zs(),[j,P]=Qo(()=>mr({collectionConfig:I,data:{...u||{},id:o},dateFormat:F,fallback:o?.toString(),globalConfig:D,i18n:L})),[N,B]=Qo(h),[M,O]=Qo(g),[V,G]=Qo(l),[z,X]=Qo(p),[te,Y]=Qo(f),[H,le]=Qo(r),[q,fe]=Qo(m),[ae,J]=Qo(u),[ge,Ce]=Qo("idle"),he=Xi(ze=>{Ce(ze)},[]),{getPreference:Le,setPreference:Ae}=Ao(),{code:Q}=$e(),{localeIsLoading:ke}=dd(),xe=$E(()=>d===void 0||u===void 0||ke,[u,d,ke]),ce=`${A}${_}`,ne,U,ie;i&&(ne=i,U="globals",ie=`global-${ne}`),n&&(ne=n,U="collections",o&&(ie=`collection-${ne}-${o}`));let de=Xi(async(ze,Je)=>{try{let Ct=Je===i?`where[globalSlug][equals]=${Je}`:`where[document.value][equals]=${ze}&where[document.relationTo][equals]=${Je}`,Et=await Ke.get(`${A}${_}/payload-locked-documents?${Ct}`),{docs:gt}=await Et.json();if(gt.length>0){let qe=gt[0].id;await Ke.delete(`${A}${_}/payload-locked-documents/${qe}`,{headers:{"Content-Type":"application/json"}}),Y(!1)}}catch(Xe){console.error("Failed to unlock the document",Xe)}},[A,_,i]),Te=Xi(async(ze,Je,Xe)=>{try{let Et=Je===i?`where[globalSlug][equals]=${Je}`:`where[document.value][equals]=${ze}&where[document.relationTo][equals]=${Je}`,gt=await Ke.get(`${A}${_}/payload-locked-documents?${Et}`),{docs:qe}=await gt.json();if(qe.length>0){let Pt=qe[0].id,be=typeof Xe=="object"?{relationTo:Xe.collection,value:Xe.id}:{relationTo:"users",value:Xe};await Ke.patch(`${A}${_}/payload-locked-documents/${Pt}`,{body:JSON.stringify({user:be}),headers:{"Content-Type":"application/json"}})}}catch(Ct){console.error("Failed to update the document editor",Ct)}},[A,_,i]),Ge=Zx({id:o,api:_,collectionSlug:n,globalSlug:i,i18n:L,locale:Q,permissions:w,serverURL:A,setDocPermissions:v,setHasPublishPermission:S,setHasSavePermission:y}),je=Xi(()=>Le(ie),[Le,ie]),lt=Xi(async(ze,Je)=>{let Xe=await je();if(ie)try{await Ae(ie,{...Xe,fields:{...Xe?.fields||{},[ze]:{...Xe?.fields?.[ze],...Je}}})}catch(Ct){console.error(Ct)}},[Ae,ie,je]),Ue=Xi(()=>{let ze=M+1;I&&I.versions?I.versions.maxPerDoc>0?O(Math.min(ze,I.versions.maxPerDoc)):O(ze):D&&D.versions&&(D.versions.max>0?O(Math.min(ze,D.versions.max)):O(ze))},[I,D,M]),He=Jx.useCallback(ze=>{J(ze)},[]);qx(()=>{P(mr({collectionConfig:I,data:{...ae,id:o},dateFormat:F,fallback:o?.toString(),globalConfig:D,i18n:L}))},[I,D,ae,F,L,o]),qx(()=>{let ze=E.current;return()=>{if(ze)try{ze.abort()}catch{}}},[]);let dt=Jx.useMemo(()=>`${`${ce}${U==="globals"?"/globals":""}/${ne}${o?`/${o}`:""}`}${Qx.stringify({depth:0,"fallback-locale":"null",locale:Q,uploadEdits:k||void 0},{addQueryPrefix:!0})}`,[ce,Q,U,o,ne,k]),Kt={...e,action:dt,currentEditor:H,docConfig:T,docPermissions:b,documentIsLocked:te,getDocPermissions:Ge,getDocPreferences:je,hasPublishedDoc:V,hasPublishPermission:C,hasSavePermission:x,incrementVersionCount:Ue,initialData:u,initialState:d,isInitializing:xe,lastUpdateTime:q,mostRecentVersionIsAutosaved:N,preferencesKey:ie,savedDocumentData:ae,setCurrentEditor:le,setDocFieldPreferences:lt,setDocumentIsLocked:Y,setDocumentTitle:P,setHasPublishedDoc:G,setLastUpdateTime:fe,setMostRecentVersionIsAutosaved:B,setUnpublishedVersionCount:X,setUploadStatus:he,title:j,unlockDocument:de,unpublishedVersionCount:z,updateDocumentEditor:Te,updateSavedDocumentData:He,uploadStatus:ge,versionCount:M};return sh(Kx,{value:Kt,children:t})},Sl=t=>sh(rh,{children:sh(jE,{...t})});import{jsx as OE}from"react/jsx-runtime";import{createContext as ME,use as BE}from"react";var xd=ME(""),Il=({children:t,operation:e})=>OE(xd,{value:e,children:t}),Ko=()=>BE(xd);import ey from"react";var ih=ey.createContext(void 0),ty=()=>{let t=ey.useContext(ih);if(t)return t};var Ne=t=>{let e=VE(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=ty(),u=s||c||i,d=Xt(),f=cr(),m=Ps(),{user:h}=De(),{id:p,collectionSlug:g}=Pe(),b=Ko(),v=Nt(GE),x;e[2]!==u?(x=ge=>{let[Ce]=ge;return Ce&&Ce?.[u]||null},e[2]=u,e[3]=x):x=e[3];let y=Nt(x),{t:C}=$(),{config:S}=W(),{getData:w,getDataByPath:F,getSiblingData:_,setModified:A}=Me(),R=Li(),I=Ut(),D=y?.filterOptions,E=y?.value,T=y?.initialValue,L=typeof y?.valid=="boolean"?y.valid:!0,k=L===!1&&d,j=oy(L),P=oy(y?.errorMessage),N;e[4]!==u?(N=u?u.split("."):[],e[4]=u,e[5]=N):N=e[5];let B=N,M;e[6]!==a||e[7]!==v||e[8]!==r||e[9]!==I||e[10]!==u||e[11]!==A?(M=(ge,Ce)=>{let he=Ce===void 0?!1:Ce,Le=ge&&ge.target?ge.target.value:ge;v({type:"UPDATE",disableFormData:a||r&&Le>0,path:u,value:Le}),he||typeof A=="function"&&I===!1&&setTimeout(()=>{A(!0)},10)},e[6]=a,e[7]=v,e[8]=r,e[9]=I,e[10]=u,e[11]=A,e[12]=M):M=e[12];let O=M,V,G=y?.customComponents,z=f||m,X=y?.errorMessage,te;e[13]!==y?.errorPaths?(te=y?.errorPaths||[],e[13]=y?.errorPaths,e[14]=te):te=e[14];let Y=y?.rows,H=y?.valid,le;e[15]!==D||e[16]!==T||e[17]!==m||e[18]!==u||e[19]!==f||e[20]!==O||e[21]!==k||e[22]!==d||e[23]!==Y||e[24]!==H||e[25]!==G||e[26]!==z||e[27]!==X||e[28]!==te||e[29]!==E?(le={customComponents:G,disabled:z,errorMessage:X,errorPaths:te,filterOptions:D,formInitializing:m,formProcessing:f,formSubmitted:d,initialValue:T,path:u,rows:Y,setValue:O,showError:k,valid:H,value:E},e[15]=D,e[16]=T,e[17]=m,e[18]=u,e[19]=f,e[20]=O,e[21]=k,e[22]=d,e[23]=Y,e[24]=H,e[25]=G,e[26]=z,e[27]=X,e[28]=te,e[29]=E,e[30]=le):le=e[30],V=le;let q=V,fe;e[31]!==g||e[32]!==S||e[33]!==a||e[34]!==v||e[35]!==R||e[36]!==y||e[37]!==w||e[38]!==F||e[39]!==_||e[40]!==r||e[41]!==p||e[42]!==b||e[43]!==u||e[44]!==B||e[45]!==C||e[46]!==h||e[47]!==l||e[48]!==E?(fe=()=>{(async()=>{let Ce=E;y?.rows&&Array.isArray(y.rows)&&(Ce=F(u));let he=P.current,Le=j.current,Ae=w(),Q=typeof l=="function"?await l(Ce,{id:p,blockData:void 0,collectionSlug:g,data:R?.getData?R.getData():Ae,event:"onChange",operation:b,path:B,preferences:{},req:{payload:{config:S},t:C,user:h},siblingData:_(u)}):typeof P.current=="string"?P.current:j.current;if(typeof Q=="string"?(Le=!1,he=Q):typeof Q=="boolean"&&(Le=Q,he=void 0),Le!==j.current||he!==P.current){j.current=Le,P.current=he;let ke={type:"UPDATE",errorMessage:he,path:u,rows:y?.rows,valid:Le,validate:l,value:E};(a||r&&typeof E=="number"&&E>0)&&(ke.disableFormData=!0),typeof v=="function"&&v(ke)}})()},e[31]=g,e[32]=S,e[33]=a,e[34]=v,e[35]=R,e[36]=y,e[37]=w,e[38]=F,e[39]=_,e[40]=r,e[41]=p,e[42]=b,e[43]=u,e[44]=B,e[45]=C,e[46]=h,e[47]=l,e[48]=E,e[49]=fe):fe=e[49];let ae=y?.rows,J;return e[50]!==g||e[51]!==a||e[52]!==v||e[53]!==w||e[54]!==F||e[55]!==_||e[56]!==p||e[57]!==b||e[58]!==u||e[59]!==ae||e[60]!==h||e[61]!==l||e[62]!==E?(J=[E,a,v,w,_,F,p,b,u,h,l,ae,g],e[50]=g,e[51]=a,e[52]=v,e[53]=w,e[54]=F,e[55]=_,e[56]=p,e[57]=b,e[58]=u,e[59]=ae,e[60]=h,e[61]=l,e[62]=E,e[63]=J):J=e[63],Gs(fe,150,J),q};function GE(t){let[,e]=t;return e}import{jsx as ry}from"react/jsx-runtime";import"react";import{c as WE}from"react/compiler-runtime";var ah=t=>{let e=WE(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=Nt(r),{passesCondition:i}=s||{};return i===!1?null:o};var Oe=t=>o=>{let{path:n}=o;return ry(ah,{path:n,children:ry(t,{...o})})};var rt=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 Ie="field-type";function Ui({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{jsx as Rl,jsxs as uh}from"react/jsx-runtime";import"react";import{jsx as ny}from"react/jsx-runtime";import"react";var lh=()=>ny("svg",{className:"icon icon--check",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:ny("path",{className:"stroke",d:"M15.3333 6.00001L8.00001 13.3333L4.66667 10",strokeLinecap:"square"})});import{jsx as sy}from"react/jsx-runtime";import"react";var ch=()=>sy("svg",{className:"icon icon--line",fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:sy("path",{className:"stroke",d:"M5.33333 10H14.6667",strokeLinecap:"square"})});var _l="checkbox-input",Xs=({id:t,name:e,AfterInput:o,BeforeInput:n,checked:r,className:s,inputRef:i,Label:l,label:a,localized:c,onToggle:u,partialChecked:d,readOnly:f,required:m})=>uh("div",{className:[s,_l,r&&`${_l}--checked`,f&&`${_l}--read-only`].filter(Boolean).join(" "),children:[uh("div",{className:`${_l}__input`,children:[n,Rl("input",{"aria-label":"",defaultChecked:!!r,disabled:f,id:t,name:e,onInput:u,ref:i,required:m,type:"checkbox"}),uh("span",{className:[`${_l}__icon`,!r&&d?"partial":"check"].filter(Boolean).join(" "),children:[r&&Rl(lh,{}),!r&&d&&Rl(ch,{})]}),o]}),Rl(oe,{CustomComponent:l,Fallback:Rl(ye,{htmlFor:t,label:a,localized:c,required:m})})]});var dh="checkbox";var XE=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:f,validate:m}=t,{uuid:h}=Me(),p=ct(),g=iy((T,L)=>{if(typeof m=="function")return m(T,{...L,required:a})},[m,a]),{customComponents:{AfterInput:b,BeforeInput:v,Description:x,Error:y,Label:C}={},disabled:S,path:w,setValue:F,showError:_,value:A}=Ne({disableFormData:n,potentiallyStalePath:d,validate:g}),R=iy(()=>{f||(F(!A),typeof c=="function"&&c(!A))},[c,f,F,A]),I=o||!!A,D=e||md(w,p,h),E=zE(()=>rt(r),[r]);return HE("div",{className:[Ie,dh,_&&"error",s,A&&`${dh}--checked`,(f||S)&&`${dh}--read-only`].filter(Boolean).join(" "),style:E,children:[Dl(oe,{CustomComponent:y,Fallback:Dl(We,{path:w,showError:_})}),Dl(Xs,{AfterInput:b,BeforeInput:v,checked:I,id:D,inputRef:null,Label:C,label:l,name:w,onToggle:R,partialChecked:u,readOnly:f||S,required:a}),Dl(oe,{CustomComponent:x,Fallback:Dl(Ve,{description:i,path:w})})]})},fr=Oe(XE);var Fl=t=>{let e=UE(4),{fieldValue:o,localized:n,path:r}=t,{code:s}=$e(),{config:i}=W(),{localization:l}=i,[a,c]=ly.useState(typeof o!="number"),{t:u}=$();if(!n||!l||l.defaultLocale===s||!l.fallback)return null;if(o){let f=!1;if(typeof o=="number"&&o>0&&(f=!0),Array.isArray(o)&&o.length>0&&(f=!0),f)return a&&c(!1),null}let d;return e[0]!==a||e[1]!==r||e[2]!==u?(d=ay(Rr,{children:ay(fr,{checked:a,field:{name:"",label:u("general:fallbackToDefaultLocale")},id:`field-${r.replace(/\./g,"__")}`,path:r,schemaPath:""})}),e[0]=a,e[1]=r,e[2]=u,e[3]=d):d=e[3],d};var Yi=t=>{let e=document.getElementById(t);if(e){let o=e.getBoundingClientRect();window.scrollBy({behavior:"smooth",top:o.top-100})}};import{c as nM}from"react/compiler-runtime";import{jsx as ws,jsxs as sM}from"react/jsx-runtime";import{getTranslation as iM}from"@payloadcms/translations";import"react";import{c as ZE}from"react/compiler-runtime";import{jsx as Cn,jsxs as Us}from"react/jsx-runtime";import JE from"react";import{jsx as cy}from"react/jsx-runtime";import"react";var Al=()=>cy("svg",{className:"icon icon--copy",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:cy("path",{className:"stroke",d:"M4.66666 12.6667C3.93333 12.6667 3.33333 12.0667 3.33333 11.3333V4.66668C3.33333 3.93334 3.93333 3.33334 4.66666 3.33334H11.3333C12.0667 3.33334 12.6667 3.93334 12.6667 4.66668M8.66666 7.33334H15.3333C16.0697 7.33334 16.6667 7.9303 16.6667 8.66668V15.3333C16.6667 16.0697 16.0697 16.6667 15.3333 16.6667H8.66666C7.93028 16.6667 7.33333 16.0697 7.33333 15.3333V8.66668C7.33333 7.9303 7.93028 7.33334 8.66666 7.33334Z",strokeLinecap:"square"})});import{jsx as mh,jsxs as YE}from"react/jsx-runtime";import"react";var fh=({className:t})=>YE("svg",{className:["icon icon--more",t].filter(Boolean).join(" "),viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:[mh("path",{className:"fill",d:"M10 10.6666C10.3682 10.6666 10.6667 10.3682 10.6667 9.99998C10.6667 9.63179 10.3682 9.33331 10 9.33331C9.63182 9.33331 9.33334 9.63179 9.33334 9.99998C9.33334 10.3682 9.63182 10.6666 10 10.6666Z",strokeLinecap:"square"}),mh("path",{className:"fill",d:"M14.6667 10.6666C15.0349 10.6666 15.3333 10.3682 15.3333 9.99998C15.3333 9.63179 15.0349 9.33331 14.6667 9.33331C14.2985 9.33331 14 9.63179 14 9.99998C14 10.3682 14.2985 10.6666 14.6667 10.6666Z",strokeLinecap:"square"}),mh("path",{className:"fill",d:"M5.33334 10.6666C5.70153 10.6666 6.00001 10.3682 6.00001 9.99998C6.00001 9.63179 5.70153 9.33331 5.33334 9.33331C4.96515 9.33331 4.66667 9.63179 4.66667 9.99998C4.66667 10.3682 4.96515 10.6666 5.33334 10.6666Z",strokeLinecap:"square"})]});var er="array-actions",yd=t=>{let e=ZE(10),{addRow:o,duplicateRow:n,hasMaxRows:r,index:s,isSortable:i,moveRow:l,removeRow:a,rowCount:c}=t,{t:u}=$(),d;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?(d=Cn(ho,{button:Cn(fh,{}),buttonClassName:`${er}__button`,className:er,horizontalAlign:"center",render:f=>{let{close:m}=f;return Us(Be.ButtonGroup,{buttonSize:"small",children:[i&&s!==0&&Us(Be.Button,{className:`${er}__action ${er}__move-up`,onClick:()=>{l(s,s-1),m()},children:[Cn("div",{className:`${er}__action-chevron`,children:Cn(Ze,{direction:"up"})}),u("general:moveUp")]}),i&&s<c-1&&Us(Be.Button,{className:`${er}__action`,onClick:()=>{l(s,s+1),m()},children:[Cn("div",{className:`${er}__action-chevron`,children:Cn(Ze,{})}),u("general:moveDown")]}),!r&&Us(JE.Fragment,{children:[Us(Be.Button,{className:`${er}__action ${er}__add`,onClick:()=>{o(s+1),m()},children:[Cn(jo,{}),u("general:addBelow")]}),Us(Be.Button,{className:`${er}__action ${er}__duplicate`,onClick:()=>{n(s),m()},children:[Cn(Al,{}),u("general:duplicate")]})]}),Us(Be.Button,{className:`${er}__action ${er}__remove`,onClick:()=>{a(s),m()},children:[Cn(pt,{}),u("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):d=e[9],d};import{c as iP}from"react/compiler-runtime";import{jsx as Er,jsxs as gh}from"react/jsx-runtime";import{useState as py}from"react";import{jsx as Zi,jsxs as qE}from"react/jsx-runtime";import"react";var wn=({className:t})=>qE("svg",{className:["icon icon--drag-handle",t].filter(Boolean).join(" "),viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:[Zi("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"}),Zi("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"}),Zi("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"}),Zi("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"}),Zi("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"}),Zi("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 dy}from"react/jsx-runtime";import Cd,{useEffect as tP,useRef as hh}from"react";import{useEffect as QE,useMemo as KE,useRef as ph,useState as eP}from"react";var uy=({containerRef:t,contentRef:e,duration:o,open:n})=>{let r=KE(()=>typeof CSS<"u"&&CSS&&CSS.supports?CSS.supports("interpolate-size","allow-keywords"):!1,[]),s=ph(!1),i=ph(n),[l,a]=eP(!1),c=ph(null);return QE(()=>{let u=t.current,d=e.current;if(!u||!d||r)return;let f=p=>{u.style.height=p},m=()=>{u&&(u.style.transition="",u.style.height=n?"auto":"0px",a(!1))};return(()=>{if(!s.current&&n){f("auto"),a(!1);return}s.current=!0,i.current!==n&&f(n?"0px":`${d.scrollHeight}px`),u.offsetHeight,a(!0),u.style.transition=`height ${o}ms ease`,f(n?`${d.scrollHeight}px`:"0px");let p=()=>{m(),u.removeEventListener("transitionend",p)};u.addEventListener("transitionend",p)})(),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 Tr=({id:t,children:e,className:o,duration:n=300,height:r})=>{let[s,i]=Cd.useState(()=>!!r),l=hh(s),[a,c]=Cd.useState(()=>s?"":"none"),[u,d]=Cd.useState(()=>s?"":"hidden"),[f,m]=Cd.useState(!1),h=hh(null),p=hh(null);return tP(()=>{let g,b,v=!!r,x=l.current!==v;return l.current=v,x&&(m(!0),d("hidden"),v?c(""):g=window.setTimeout(()=>{c("none")},n),i(v),b=window.setTimeout(()=>{d(""),m(!1)},n)),()=>{g&&clearTimeout(g),b&&clearTimeout(b)}},[r,n]),uy({containerRef:h,contentRef:p,duration:n,open:s}),dy("div",{"aria-hidden":!s,className:[o,"rah-static",s&&r==="auto"&&"rah-static--height-auto",f&&`rah-animating--${s?"down":"up"}`,f&&r==="auto"&&"rah-animating--to-height-auto"].filter(Boolean).join(" "),id:t,ref:h,style:{overflow:u,transition:`height ${n}ms ease`},children:dy("div",{ref:p,...a?{style:{display:a}}:{},children:e})})};import{jsx as oP}from"react/jsx-runtime";import rP,{createContext as nP,use as sP}from"react";var my=nP({isCollapsed:void 0,isVisible:void 0,isWithinCollapsible:void 0,toggle:()=>{}}),fy=({children:t,isCollapsed:e,isWithinCollapsible:o=!0,toggle:n})=>{let{isCollapsed:r,isVisible:s}=Kn(),i=rP.useMemo(()=>({isCollapsed:e,isVisible:s&&!r,isWithinCollapsible:o,toggle:n}),[e,o,n,r,s]);return oP(my,{value:i,children:t})},Kn=()=>sP(my);var wo="collapsible";var Ys=t=>{let e=iP(26),{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,[f,m]=py(!!a),[h,p]=py(!1),{isWithinCollapsible:g}=Kn(),{t:b}=$(),v=typeof c=="boolean"?c:f,x;e[0]!==v||e[1]!==u?(x=()=>{typeof u=="function"&&u(!v),m(!v)},e[0]=v,e[1]=u,e[2]=x):x=e[2];let y=x,C=i&&`${wo}--has-drag-handle`,S=v&&`${wo}--collapsed`,w=g&&`${wo}--nested`,F=h&&`${wo}--hovered`,_=`${wo}--style-${d}`,A;e[3]!==r||e[4]!==C||e[5]!==S||e[6]!==w||e[7]!==F||e[8]!==_?(A=[wo,r,C,S,w,F,_].filter(Boolean),e[3]=r,e[4]=C,e[5]=S,e[6]=w,e[7]=F,e[8]=_,e[9]=A):A=e[9];let R=A.join(" "),I,D;e[10]===Symbol.for("react.memo_cache_sentinel")?(I=()=>p(!0),D=()=>p(!1),e[10]=I,e[11]=D):(I=e[10],D=e[11]);let E=`${wo}__toggle--${v?"collapsed":"open"}`,T;e[12]!==E?(T=[`${wo}__toggle`,E].filter(Boolean),e[12]=E,e[13]=T):T=e[13];let L=T.join(" "),k;if(e[14]!==o||e[15]!==n||e[16]!==i||e[17]!==l||e[18]!==v||e[19]!==b||e[20]!==L||e[21]!==R||e[22]!==y){let j;e[24]!==i?(j=i&&Er("div",{className:`${wo}__drag`,...i.attributes,...i.listeners,children:Er(wn,{})}),e[24]=i,e[25]=j):j=e[25],k=Er("div",{className:R,children:gh(fy,{isCollapsed:v,toggle:y,children:[gh("div",{className:`${wo}__toggle-wrap`,onMouseEnter:I,onMouseLeave:D,children:[Er("button",{className:L,onClick:y,type:"button",children:Er("span",{children:b("fields:toggleBlock")})}),j,l?Er("div",{className:[`${wo}__header-wrap`,i&&`${wo}__header-wrap--has-drag-handle`].filter(Boolean).join(" "),children:l}):null,gh("div",{className:`${wo}__actions-wrap`,children:[o?Er("div",{className:`${wo}__actions`,children:o}):null,Er("div",{className:`${wo}__indicator`,children:Er(Ze,{direction:v?void 0:"up"})})]})]}),Er(Tr,{height:v?0:"auto",children:Er("div",{className:`${wo}__content`,children:n})})]})}),e[14]=o,e[15]=n,e[16]=i,e[17]=l,e[18]=v,e[19]=b,e[20]=L,e[21]=R,e[22]=y,e[23]=k}else k=e[23];return k};import{c as eM}from"react/compiler-runtime";import{jsx as Fb}from"react/jsx-runtime";import{fieldIsHiddenOrDisabled as tM,getFieldPaths as oM,getFieldPermissions as rM}from"payload/shared";import"react";import{c as aP}from"react/compiler-runtime";import{jsx as lP}from"react/jsx-runtime";import hy from"react";var gy=t=>{let e=aP(9),{children:o,className:n,forceRender:r}=t,[s,i]=hy.useState(!!r),l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l={rootMargin:"1000px"},e[0]=l):l=e[0];let[a,c]=fn(l,!!r),u=!!c?.isIntersecting,d=c?.boundingClientRect?.top<0,f=r||u||d,m,h;e[1]!==s||e[2]!==f?(m=()=>{f&&!s&&i(!0)},h=[f,s],e[1]=s,e[2]=f,e[3]=m,e[4]=h):(m=e[3],h=e[4]),hy.useEffect(m,h);let p=s?o:null,g;return e[5]!==n||e[6]!==a||e[7]!==p?(g=lP("div",{className:n,ref:a,children:p}),e[5]=n,e[6]=a,e[7]=p,e[8]=g):g=e[8],g};import{c as KO}from"react/compiler-runtime";import{jsx as At}from"react/jsx-runtime";import"react";import{c as TP}from"react/compiler-runtime";import{jsx as Zt,jsxs as os}from"react/jsx-runtime";import{getTranslation as Ch}from"@payloadcms/translations";import EP,{Fragment as PP}from"react";import{c as DP}from"react/compiler-runtime";import{jsx as Pr,jsxs as Ly,Fragment as FP}from"react/jsx-runtime";import{getTranslation as AP}from"@payloadcms/translations";import"react";import{c as cP}from"react/compiler-runtime";import{jsx as Tl,jsxs as uP}from"react/jsx-runtime";import"react";var pr="pill",dP=t=>{let e=cP(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}=ji(r),u=i&&`${pr}--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 f=d.join(" "),m;return e[5]!==s||e[6]!==l||e[7]!==t||e[8]!==a||e[9]!==f||e[10]!==c?(m=Tl(by,{...t,className:f,elementProps:{...l,...s,ref:a,style:{transform:c}}}),e[5]=s,e[6]=l,e[7]=t,e[8]=a,e[9]=f,e[10]=c,e[11]=m):m=e[11],m},by=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:f,pillStyle:m="light",rounded:h,size:p="medium",to:g}=t,b=[pr,`${pr}--style-${m}`,`${pr}--size-${p}`,a&&a,g&&`${pr}--has-link`,(g||f)&&`${pr}--has-action`,d&&`${pr}--has-icon`,d&&`${pr}--align-icon-${o}`,c&&`${pr}--draggable`,h&&`${pr}--rounded`].filter(Boolean).join(" "),v="div";return f&&!g&&(v="button"),g&&(v=Yt),uP(v,{...u,"aria-checked":n,"aria-controls":r,"aria-expanded":s,"aria-label":i,className:b,href:g||null,id:e,onClick:f,type:v==="button"?"button":void 0,children:[Tl("span",{className:`${pr}__label`,children:l}),!!d&&Tl("span",{className:`${pr}__icon`,children:d})]})},vt=t=>{let{draggable:e}=t;return e?Tl(dP,{...t}):Tl(by,{...t})};import{useEffect as mP,useState as fP}from"react";function wd(t,e){let[o,n]=fP(t);return mP(()=>{let r=setTimeout(()=>{n(t)},e);return()=>{clearTimeout(r)}},[t,e]),o}import{c as IP}from"react/compiler-runtime";import{jsx as Ay,jsxs as RP}from"react/jsx-runtime";import Ty from"react";import{jsx as Qr,jsxs as _y}from"react/jsx-runtime";import{getTranslation as Rd}from"@payloadcms/translations";import{useEffect as Dy,useMemo as wP,useState as Fy}from"react";import{c as pP}from"react/compiler-runtime";import{jsx as vy,jsxs as hP}from"react/jsx-runtime";import"react";var El="thumbnail-card",xy=t=>{let e=pP(15),{alignLabel:o,className:n,collection:r,doc:s,label:i,onClick:l,thumbnail:a}=t,{config:c}=W(),{i18n:u}=$(),d=typeof l=="function"&&`${El}--has-on-click`,f=o&&`${El}--align-label-${o}`,m;e[0]!==n||e[1]!==d||e[2]!==f?(m=[El,n,d,f].filter(Boolean),e[0]=n,e[1]=d,e[2]=f,e[3]=m):m=e[3];let h=m.join(" "),p=i;if(!p){let b=s?.filename,v;e[4]!==r||e[5]!==c.admin.dateFormat||e[6]!==s||e[7]!==u||e[8]!==b?(v=mr({collectionConfig:r,data:s,dateFormat:c.admin.dateFormat,fallback:b,i18n:u}),e[4]=r,e[5]=c.admin.dateFormat,e[6]=s,e[7]=u,e[8]=b,e[9]=v):v=e[9],p=v}let g;return e[10]!==h||e[11]!==l||e[12]!==a||e[13]!==p?(g=hP("button",{className:h,onClick:l,title:p,type:"button",children:[vy("div",{className:`${El}__thumbnail`,children:a}),vy("div",{className:`${El}__label`,children:p})]}),e[10]=h,e[11]=l,e[12]=a,e[13]=p,e[14]=g):g=e[14],g};import{jsx as In,jsxs as Cy}from"react/jsx-runtime";import{useState as xP}from"react";var bo=[];for(Sd=0;Sd<256;++Sd)bo.push((Sd+256).toString(16).slice(1));var Sd;function yy(t,e=0){return(bo[t[e+0]]+bo[t[e+1]]+bo[t[e+2]]+bo[t[e+3]]+"-"+bo[t[e+4]]+bo[t[e+5]]+"-"+bo[t[e+6]]+bo[t[e+7]]+"-"+bo[t[e+8]]+bo[t[e+9]]+"-"+bo[t[e+10]]+bo[t[e+11]]+bo[t[e+12]]+bo[t[e+13]]+bo[t[e+14]]+bo[t[e+15]]).toLowerCase()}var Id,gP=new Uint8Array(16);function bh(){if(!Id&&(Id=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Id))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Id(gP)}var bP=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),vh={randomUUID:bP};function vP(t,e,o){if(vh.randomUUID&&!e&&!t)return vh.randomUUID();t=t||{};var n=t.random||(t.rng||bh)();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 yy(n)}var Sn=vP;var xh=()=>{let[t]=xP(()=>`pattern${Sn()}`);return Cy("svg",{fill:"none",height:"151",preserveAspectRatio:"xMidYMid slice",viewBox:"0 0 231 151",width:"231",xmlns:"http://www.w3.org/2000/svg",children:[Cy("g",{clipPath:`url(#${t})`,children:[In("rect",{fill:"#D9D9D9",height:"100%",rx:"2",width:"100%"}),In("rect",{fill:"#BCBCBC",height:"116.063",transform:"rotate(52.0687 33.7051 79.3051)",width:"85.8593",x:"33.7051",y:"79.3051"}),In("rect",{fill:"#BCBCBC",height:"116.063",transform:"rotate(52.0687 86.1219 92.6272)",width:"85.8593",x:"86.1219",y:"92.6272"}),In("circle",{cx:"189",cy:"45",fill:"#BCBCBC",r:"19"}),In("rect",{fill:"#B8B8B8",height:"5",rx:"2.5",width:"98",x:"66",y:"70"}),In("rect",{fill:"#B8B8B8",height:"5",rx:"2.5",width:"76",x:"77",y:"82"})]}),In("defs",{children:In("clipPath",{id:`${t}`,children:In("rect",{fill:"white",height:"151",width:"231"})})})]})};import{c as yP}from"react/compiler-runtime";import{jsx as Sy,jsxs as CP}from"react/jsx-runtime";import"react";import{jsx as wy}from"react/jsx-runtime";import"react";var Pl=()=>wy("svg",{className:"icon icon--search",fill:"none",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:wy("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 Iy="block-search",Ry=t=>{let e=yP(5),{setSearchTerm:o}=t,{t:n}=$(),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=CP("div",{className:Iy,children:[Sy("input",{className:`${Iy}__input`,onChange:s,placeholder:n("fields:searchForBlock")}),Sy(Pl,{})]}),e[2]=s,e[3]=n,e[4]=i):i=e[4],i};var es="blocks-drawer",SP=(t,e)=>typeof t.labels.singular=="string"?t.labels.singular.toLowerCase():typeof t.labels.singular=="object"?Rd(t.labels.singular,e).toLowerCase():"",Nl=t=>{let{addRow:e,addRowIndex:o,blocks:n,drawerSlug:r,labels:s}=t,[i,l]=Fy(""),[a,c]=Fy(n),{closeModal:u,isModalOpen:d}=ue(),{i18n:f,t:m}=$(),{config:h}=W(),p=wP(()=>{let g={_none:[]};return a.forEach(b=>{if(typeof b=="object"&&b.admin?.group){let v=b.admin.group,x=typeof v=="string"?v:Rd(v,f);Object.hasOwn(g,x)?g[x].push(b):g[x]=[b]}else g._none.push(b)}),g},[a,f]);return Dy(()=>{d(r)||l("")},[d,r]),Dy(()=>{let g=i.toLowerCase(),b=n?.reduce((v,x)=>{let y=typeof x=="string"?h.blocksMap[x]:x;return SP(y,f).includes(g)&&v.push(y),v},[]);c(b)},[i,n,f,h.blocksMap]),_y(Lt,{slug:r,title:m("fields:addLabel",{label:Rd(s.singular,f)}),children:[Qr(Ry,{setSearchTerm:l}),Qr("div",{className:`${es}__blocks-wrapper`,children:Qr("ul",{className:`${es}__block-groups`,children:Object.entries(p).map(([g,b])=>b.length?_y("li",{className:[`${es}__block-group`,g==="_none"&&`${es}__block-group-none`].filter(Boolean).join(" "),children:[g!=="_none"&&Qr("h3",{className:`${es}__block-group-label`,children:g}),Qr("ul",{className:`${es}__blocks`,children:b.map((v,x)=>{let y=typeof v=="string"?h.blocksMap[v]:v,{slug:C,imageAltText:S,imageURL:w,labels:F}=y;return Qr("li",{className:`${es}__block`,children:Qr(xy,{alignLabel:"center",label:Rd(F?.singular,f),onClick:()=>{e(o,C),u(r)},thumbnail:Qr("div",{className:`${es}__default-image`,children:w?Qr("img",{alt:S,src:w}):Qr(xh,{})})})},x)})})]},g):null)})})]})};var Ey=t=>{let e=IP(26),{addRow:o,blocks:n,blockType:r,duplicateRow:s,hasMaxRows:i,isSortable:l,labels:a,moveRow:c,removeRow:u,rowCount:d,rowIndex:f}=t,{closeModal:m,openModal:h}=ue(),p=bl("blocks-drawer"),[g,b]=Ty.useState(null),v;e[0]!==o||e[1]!==m||e[2]!==p||e[3]!==g?(v=(y,C)=>{typeof o=="function"&&o(g,C),m(p)},e[0]=o,e[1]=m,e[2]=p,e[3]=g,e[4]=v):v=e[4];let x;if(e[5]!==r||e[6]!==n||e[7]!==p||e[8]!==s||e[9]!==i||e[10]!==l||e[11]!==a||e[12]!==c||e[13]!==h||e[14]!==u||e[15]!==d||e[16]!==f||e[17]!==v){let y;e[19]!==p||e[20]!==h?(y=S=>{b(S),h(p)},e[19]=p,e[20]=h,e[21]=y):y=e[21];let C;e[22]!==r||e[23]!==s||e[24]!==f?(C=()=>s(f,r),e[22]=r,e[23]=s,e[24]=f,e[25]=C):C=e[25],x=RP(Ty.Fragment,{children:[Ay(Nl,{addRow:v,addRowIndex:f,blocks:n,drawerSlug:p,labels:a}),Ay(yd,{addRow:y,duplicateRow:C,hasMaxRows:i,index:f,isSortable:l,moveRow:c,removeRow:u,rowCount:d})]}),e[5]=r,e[6]=n,e[7]=p,e[8]=s,e[9]=i,e[10]=l,e[11]=a,e[12]=c,e[13]=h,e[14]=u,e[15]=d,e[16]=f,e[17]=v,e[18]=x}else x=e[18];return x};import{c as _P}from"react/compiler-runtime";import{jsx as Py}from"react/jsx-runtime";import"react";var Ny="section-title",yh=t=>{let e=_P(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}=Ne(i),{t:c}=$(),u;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=[Ny].filter(Boolean),e[2]=u):u=e[2];let d=u.join(" "),f;e[3]!==o||e[4]!==l?(f=o||(g=>{g.stopPropagation(),g.preventDefault(),l(g.target.value)}),e[3]=o,e[4]=l,e[5]=f):f=e[5];let m=f,h=n||a,p;return e[6]!==n||e[7]!==m||e[8]!==r||e[9]!==s||e[10]!==c||e[11]!==h||e[12]!==a?(p=Py("div",{className:d,"data-value":h,children:Py("input",{className:`${Ny}__input`,id:r,name:r,onChange:m,placeholder:c("general:untitled"),readOnly:s,type:"text",value:n||a||""})}),e[6]=n,e[7]=m,e[8]=r,e[9]=s,e[10]=c,e[11]=h,e[12]=a,e[13]=p):p=e[13],p};var ts="blocks-field",$y=t=>{let e=DP(40),{addRow:o,attributes:n,block:r,blocks:s,duplicateRow:i,errorCount:l,fields:a,hasMaxRows:c,isLoading:u,isSortable:d,Label:f,labels:m,listeners:h,moveRow:p,parentPath:g,path:b,permissions:v,readOnly:x,removeRow:y,row:C,rowCount:S,rowIndex:w,schemaPath:F,setCollapse:_,setNodeRef:A,transform:R}=t,I=wd(u,500),{i18n:D}=$(),T=Xt()&&l>0,L=!r.admin?.disableBlockName,k=T?`${ts}__row--has-errors`:`${ts}__row--no-errors`,j;e[0]!==k?(j=[`${ts}__row`,k].filter(Boolean),e[0]=k,e[1]=j):j=e[1];let P=j.join(" "),N;if(v===!0)N=!0;else{let O=v?.blocks?.[r.slug];O===!0?N=!0:N=O?.fields}let B=`${g?.split(".").join("-")}-row-${w}`,M;if(e[2]!==f||e[3]!==o||e[4]!==n||e[5]!==r.fields||e[6]!==r.labels||e[7]!==N||e[8]!==s||e[9]!==P||e[10]!==i||e[11]!==l||e[12]!==T||e[13]!==a||e[14]!==c||e[15]!==D||e[16]!==I||e[17]!==d||e[18]!==m||e[19]!==h||e[20]!==p||e[21]!==g||e[22]!==b||e[23]!==x||e[24]!==y||e[25]!==C.blockType||e[26]!==C.collapsed||e[27]!==C.id||e[28]!==S||e[29]!==w||e[30]!==F||e[31]!==_||e[32]!==A||e[33]!==L||e[34]!==B||e[35]!==R){let O;e[37]!==C.id||e[38]!==_?(O=V=>_(C.id,V),e[37]=C.id,e[38]=_,e[39]=O):O=e[39],M=Pr("div",{id:B,ref:A,style:{transform:R},children:Pr(Ys,{actions:x?void 0:Pr(Ey,{addRow:o,blocks:s,blockType:C.blockType,duplicateRow:i,fields:r.fields,hasMaxRows:c,isSortable:d,labels:m,moveRow:p,removeRow:y,rowCount:S,rowIndex:w}),className:P,collapsibleStyle:T?"error":"default",dragHandleProps:d?{id:C.id,attributes:n,listeners:h}:void 0,header:I?Pr(It,{height:"1rem",width:"8rem"}):Ly("div",{className:`${ts}__block-header`,children:[Pr(mn,{CustomComponent:f,label:Ly(FP,{children:[Pr("span",{className:`${ts}__block-number`,children:String(w+1).padStart(2,"0")}),Pr(vt,{className:`${ts}__block-pill ${ts}__block-pill-${C.blockType}`,pillStyle:"white",children:AP(r.labels.singular,D)}),L&&Pr(yh,{path:`${b}.blockName`,readOnly:x})]}),path:b,rowNumber:w}),T&&Pr(ao,{count:l,i18n:D,withMessage:!0})]}),isCollapsed:C.collapsed,onToggle:O,children:I?Pr(It,{}):Pr(So,{className:`${ts}__fields`,fields:a,margins:"small",parentIndexPath:"",parentPath:b,parentSchemaPath:F,permissions:N,readOnly:x})},C.id)},`${g}-row-${w}`),e[2]=f,e[3]=o,e[4]=n,e[5]=r.fields,e[6]=r.labels,e[7]=N,e[8]=s,e[9]=P,e[10]=i,e[11]=l,e[12]=T,e[13]=a,e[14]=c,e[15]=D,e[16]=I,e[17]=d,e[18]=m,e[19]=h,e[20]=p,e[21]=g,e[22]=b,e[23]=x,e[24]=y,e[25]=C.blockType,e[26]=C.collapsed,e[27]=C.id,e[28]=S,e[29]=w,e[30]=F,e[31]=_,e[32]=A,e[33]=L,e[34]=B,e[35]=R,e[36]=M}else M=e[36];return M};var Nr="blocks-field",NP=t=>{let e=TP(50),{i18n:o,t:n}=$(),{field:r,path:s,permissions:i,readOnly:l,schemaPath:a,validate:c}=t,{name:u,admin:d,blockReferences:f,blocks:m,label:h,labels:p,localized:g,maxRows:b,minRows:v,required:x}=r,y;e[0]!==d?(y=d===void 0?{}:d,e[0]=d,e[1]=y):y=e[1];let{className:C,description:S,isSortable:w}=y,F=w===void 0?!0:w,_=a??u,A=v??x?1:0,{setDocFieldPreferences:R}=Pe(),{addFieldRow:I,dispatchFields:D,moveFieldRow:E,removeFieldRow:T,setModified:L}=Me(),{code:k}=$e(),{config:j,config:P}=W(),{localization:N}=j,B=bl("blocks-drawer"),M=Xt(),O={plural:n("fields:blocks"),singular:n("fields:block"),...p},V;e:{if(N&&N.fallback){let ee=N.defaultLocale;V=k===ee;break e}V=!0}let G=V,z;e[2]!==G||e[3]!==b||e[4]!==A||e[5]!==x||e[6]!==c?(z=(ee,K)=>{if(!G&&ee===null)return!0;if(typeof c=="function")return c(ee,{...K,maxRows:b,minRows:A,required:x})},e[2]=G,e[3]=b,e[4]=A,e[5]=x,e[6]=c,e[7]=z):z=e[7];let X=z,te;e[8]!==X||e[9]!==s?(te={hasRows:!0,potentiallyStalePath:s,validate:X},e[8]=X,e[9]=s,e[10]=te):te=e[10];let{customComponents:Y,disabled:H,errorPaths:le,path:q,rows:fe,showError:ae,valid:J,value:ge}=Ne(te),Ce;e[11]!==Y?(Ce=Y===void 0?{}:Y,e[11]=Y,e[12]=Ce):Ce=e[12];let{AfterInput:he,BeforeInput:Le,Description:Ae,Error:Q,Label:ke}=Ce,xe;e[13]!==fe?(xe=fe===void 0?[]:fe,e[13]=fe,e[14]=xe):xe=e[14];let ce=xe,ne;e[15]!==I||e[16]!==q||e[17]!==_?(ne=(ee,K)=>{I({blockType:K,path:q,rowIndex:ee,schemaPath:_}),setTimeout(()=>{Yi(`${q}-row-${ee+1}`)},0)},e[15]=I,e[16]=q,e[17]=_,e[18]=ne):ne=e[18];let U=ne,ie;e[19]!==D||e[20]!==q||e[21]!==L?(ie=ee=>{D({type:"DUPLICATE_ROW",path:q,rowIndex:ee}),L(!0),setTimeout(()=>{Yi(`${q}-row-${ee+1}`)},0)},e[19]=D,e[20]=q,e[21]=L,e[22]=ie):ie=e[22];let de=ie,Te;e[23]!==q||e[24]!==T?(Te=ee=>{T({path:q,rowIndex:ee})},e[23]=q,e[24]=T,e[25]=Te):Te=e[25];let Ge=Te,je;e[26]!==E||e[27]!==q?(je=(ee,K)=>{E({moveFromIndex:ee,moveToIndex:K,path:q})},e[26]=E,e[27]=q,e[28]=je):je=e[28];let lt=je,Ue;e[29]!==D||e[30]!==q||e[31]!==ce||e[32]!==R?(Ue=ee=>{let{collapsedIDs:K,updatedRows:Z}=pd({collapsed:ee,rows:ce});D({type:"SET_ALL_ROWS_COLLAPSED",path:q,updatedRows:Z}),R(q,{collapsed:K})},e[29]=D,e[30]=q,e[31]=ce,e[32]=R,e[33]=Ue):Ue=e[33];let He=Ue,dt;e[34]!==D||e[35]!==q||e[36]!==ce||e[37]!==R?(dt=(ee,K)=>{let{collapsedIDs:Z,updatedRows:re}=fd({collapsed:K,rowID:ee,rows:ce});D({type:"SET_ROW_COLLAPSED",path:q,updatedRows:re}),R(q,{collapsed:Z})},e[34]=D,e[35]=q,e[36]=ce,e[37]=R,e[38]=dt):dt=e[38];let Kt=dt,ze=b&&ce.length>=b,Je=le.length,Xe=M&&Je+(J?0:1)>0,Ct=ce.length<A||x&&ce.length===0,Et=l&&ce.length===0,gt=Xe?`${Nr}--has-error`:`${Nr}--has-no-error`,qe;e[39]!==C||e[40]!==gt?(qe=[Ie,Nr,C,gt].filter(Boolean),e[39]=C,e[40]=gt,e[41]=qe):qe=e[41];let Pt;e[42]!==Q||e[43]!==q||e[44]!==ae?(Pt=ae&&Zt(oe,{CustomComponent:Q,Fallback:Zt(We,{path:q,showError:ae})}),e[42]=Q,e[43]=q,e[44]=ae,e[45]=Pt):Pt=e[45];let be;return e[46]!==Je||e[47]!==Xe||e[48]!==o?(be=Xe&&Je>0&&Zt(ao,{count:Je,i18n:o,withMessage:!0}),e[46]=Je,e[47]=Xe,e[48]=o,e[49]=be):be=e[49],os("div",{className:qe.join(" "),id:`field-${q?.replace(/\./g,"__")}`,children:[Pt,os("header",{className:`${Nr}__header`,children:[os("div",{className:`${Nr}__header-wrap`,children:[os("div",{className:`${Nr}__heading-with-error`,children:[Zt("h3",{children:Zt(oe,{CustomComponent:ke,Fallback:Zt(ye,{label:h,localized:g,path:q,required:x})})}),be]}),ce.length>0&&os("ul",{className:`${Nr}__header-actions`,children:[Zt("li",{children:Zt("button",{className:`${Nr}__header-action`,onClick:()=>He(!0),type:"button",children:n("fields:collapseAll")})}),Zt("li",{children:Zt("button",{className:`${Nr}__header-action`,onClick:()=>He(!1),type:"button",children:n("fields:showAll")})})]})]}),Zt(oe,{CustomComponent:Ae,Fallback:Zt(Ve,{description:S,path:q})})]}),Le,Zt(Fl,{fieldValue:ge,localized:g,path:q}),(ce.length>0||!J&&(Et||Ct))&&os(ur,{className:`${Nr}__rows`,ids:ce.map(LP),onDragEnd:ee=>{let{moveFromIndex:K,moveToIndex:Z}=ee;return lt(K,Z)},children:[ce.map((ee,K)=>{let{blockType:Z,isLoading:re}=ee,pe=P.blocksMap[Z]??(f??m).find(ve=>typeof ve!="string"&&ve.slug===Z);if(pe){let ve=`${q}.${K}`,we=le.filter(Ee=>Ee.startsWith(ve+".")).length;return Zt(Jr,{disabled:l||H||!F,id:ee.id,children:Ee=>Zt($y,{...Ee,addRow:U,block:pe,blocks:f??m,duplicateRow:de,errorCount:we,fields:pe.fields,hasMaxRows:ze,isLoading:re,isSortable:F,Label:ce?.[K]?.customComponents?.RowLabel,labels:O,moveRow:lt,parentPath:q,path:ve,permissions:i,readOnly:l||H,removeRow:Ge,row:ee,rowCount:ce.length,rowIndex:K,schemaPath:_+pe.slug,setCollapse:Kt})},ee.id)}return null}),!G&&os(EP.Fragment,{children:[Ct&&Zt(Rr,{type:"error",children:n("validation:requiresAtLeast",{count:A,label:Ch(A>1?O.plural:O.singular,o)||n(A>1?"general:row":"general:rows")})}),Et&&Zt(Rr,{children:n("validation:fieldHasNo",{label:Ch(O.plural,o)})})]})]}),!ze&&os(PP,{children:[Zt(dr,{className:`${Nr}__drawer-toggler`,disabled:l||H,slug:B,children:Zt(se,{buttonStyle:"icon-label",disabled:l||H,el:"span",icon:"plus",iconPosition:"left",iconStyle:"with-border",children:n("fields:addLabel",{label:Ch(O.singular,o)})})}),Zt(Nl,{addRow:U,addRowIndex:ce?.length||0,blocks:f??m,drawerSlug:B,labels:O})]}),he]})},Ll=Oe(NP);function LP(t){return t.id}import{jsx as Zs,jsxs as ky}from"react/jsx-runtime";import{useCallback as OP,useMemo as MP}from"react";import{jsx as wh}from"react/jsx-runtime";import{lazy as $P,Suspense as kP}from"react";var jP=$P(()=>import("./CodeEditor-7N7BMHRP.js")),$l=t=>wh(kP,{fallback:wh(It,{}),children:wh(jP,{...t})});var BP={js:"javascript",ts:"typescript"},VP="code-field",GP=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:f}=t,m=OP((_,A)=>{if(typeof f=="function")return f(_,{...A,required:a})},[f,a]),{customComponents:{AfterInput:h,BeforeInput:p,Description:g,Error:b,Label:v}={},disabled:x,path:y,setValue:C,showError:S,value:w}=Ne({potentiallyStalePath:u,validate:m}),F=MP(()=>rt(e),[e]);return ky("div",{className:[Ie,VP,o,S&&"error",(d||x)&&"read-only"].filter(Boolean).join(" "),style:F,children:[Zs(oe,{CustomComponent:v,Fallback:Zs(ye,{label:i,localized:l,path:y,required:a})}),ky("div",{className:`${Ie}__wrap`,children:[Zs(oe,{CustomComponent:b,Fallback:Zs(We,{path:y,showError:S})}),p,Zs($l,{defaultLanguage:BP[s]||s,onChange:d||x?()=>null:_=>C(_),onMount:c,options:r,readOnly:d||x,value:w||""}),h]}),Zs(oe,{CustomComponent:g,Fallback:Zs(Ve,{description:n,path:y})})]})},kl=Oe(GP);import{jsx as qs,jsxs as Sh}from"react/jsx-runtime";import{getTranslation as HP}from"@payloadcms/translations";import{Fragment as zP,useCallback as XP,useEffect as UP,useMemo as YP,useState as Oy}from"react";import{c as WP}from"react/compiler-runtime";import{fieldAffectsData as jy}from"payload/shared";var _d=t=>t.reduce((e,o)=>{let n="fields"in o?o.fields:void 0;return n?jy(o)?e.push(`${o.name}.`):e.push(..._d(n)):o.type==="tabs"?"tabs"in o&&o.tabs?.forEach(r=>{"name"in r?e.push(`${r.name}.`):e.push(..._d(r.fields))}):jy(o)&&e.push(o.name),e},[]);var Js=t=>{let e=WP(12),{fields:o,path:n,setErrorCount:r}=t,[s]=$i(),i=Xt(),l;e[0]!==o?(l=_d(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;d=0,Object.entries(s).forEach(f=>{let[m]=f;if(a?.some(p=>{let g=[...n,p].join(".");return g.endsWith(".")?m.startsWith(g):m===g})){let p=s[m];"valid"in p&&!p.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],Gs(c,250,u),null};var jl="collapsible-field",ZP=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:f}=t,{i18n:m}=$(),{getPreference:h,setPreference:p}=Ao(),{preferencesKey:g}=Pe(),[b,v]=Oy(),x=`collapsible-${u?.replace(/\./g,"__")}`,[y,C]=Oy(0),S=y>0,{customComponents:{AfterInput:w,BeforeInput:F,Description:_,Label:A}={},disabled:R}=Ne({path:u}),I=XP(async E=>{let T=await h(g);g&&p(g,{...T,...u?{fields:{...T?.fields||{},[u]:{...T?.fields?.[u],collapsed:E}}}:{fields:{...T?.fields||{},[x]:{...T?.fields?.[x],collapsed:E}}}})},[g,x,h,p,u]);UP(()=>{(async()=>{if(g){let T=await h(g),L=u?T?.fields?.[u]?.collapsed:T?.fields?.[x]?.collapsed;v(L!==void 0?!!L:typeof r=="boolean"?r:!1)}else v(typeof r=="boolean"?r:!1)})()},[h,g,x,r,u]);let D=YP(()=>rt(e),[e]);return typeof b!="boolean"?null:Sh(zP,{children:[qs(Js,{fields:s,path:u.split(".").slice(0,-1),setErrorCount:C}),Sh("div",{className:[Ie,jl,o,S?`${jl}--has-error`:`${jl}--has-no-error`].filter(Boolean).join(" "),id:`field-${x}`,style:D,children:[F,qs(Ys,{className:`${jl}__collapsible`,collapsibleStyle:S?"error":"default",header:Sh("div",{className:`${jl}__row-label-wrap`,children:[qs(mn,{CustomComponent:A,label:HP(i,m),path:u}),S&&qs(ao,{count:y,i18n:m,withMessage:!0})]}),initCollapsed:b,onToggle:I,children:qs(So,{fields:s,margins:"small",parentIndexPath:l,parentPath:a,parentSchemaPath:c,permissions:d,readOnly:f||R})}),w,qs(oe,{CustomComponent:_,Fallback:qs(Ve,{description:n,path:u})})]})]})},Ol=Oe(ZP);import{jsx as is,jsxs as F2}from"react/jsx-runtime";import{getTranslation as UN}from"@payloadcms/translations";import{useCallback as mg,useMemo as A2}from"react";import{jsx as Ih}from"react/jsx-runtime";import{lazy as JP,Suspense as qP}from"react";var QP=JP(()=>import("./DatePicker-4DPXLCID.js")),Ji=t=>Ih(qP,{fallback:Ih(It,{height:50}),children:Ih(QP,{...t})});import{jsx as D2,jsxs as zN}from"react/jsx-runtime";import{useMemo as XN}from"react";import{jsx as oi}from"react/jsx-runtime";import{getTranslation as I2}from"@payloadcms/translations";import R2,{useEffect as VN,useId as GN}from"react";function Lr(t){"@babel/helpers - typeof";return Lr=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},Lr(t)}function My(t,e){if(Lr(t)!="object"||!t)return t;var o=t[Symbol.toPrimitive];if(o!==void 0){var n=o.call(t,e||"default");if(Lr(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Dd(t){var e=My(t,"string");return Lr(e)=="symbol"?e:e+""}function Qs(t,e,o){return(e=Dd(e))in t?Object.defineProperty(t,e,{value:o,enumerable:!0,configurable:!0,writable:!0}):t[e]=o,t}function By(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 _e(t){for(var e=1;e<arguments.length;e++){var o=arguments[e]!=null?arguments[e]:{};e%2?By(Object(o),!0).forEach(function(n){Qs(t,n,o[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(o)):By(Object(o)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(o,n))})}return t}function Vy(t){if(Array.isArray(t))return t}function Gy(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 Ml(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 Fd(t,e){if(t){if(typeof t=="string")return Ml(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)?Ml(t,e):void 0}}function Wy(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
49
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $r(t,e){return Vy(t)||Gy(t,e)||Fd(t,e)||Wy()}function Vo(t,e){if(t==null)return{};var o,n,r=Oi(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 Rh,useCallback as Ad}from"react";var KP=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function Td(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,f=t.onMenuOpen,m=t.value,h=Vo(t,KP),p=Rh(l!==void 0?l:o),g=$r(p,2),b=g[0],v=g[1],x=Rh(a!==void 0?a:r),y=$r(x,2),C=y[0],S=y[1],w=Rh(m!==void 0?m:i),F=$r(w,2),_=F[0],A=F[1],R=Ad(function(j,P){typeof c=="function"&&c(j,P),A(j)},[c]),I=Ad(function(j,P){var N;typeof u=="function"&&(N=u(j,P)),v(N!==void 0?N:j)},[u]),D=Ad(function(){typeof f=="function"&&f(),S(!0)},[f]),E=Ad(function(){typeof d=="function"&&d(),S(!1)},[d]),T=l!==void 0?l:b,L=a!==void 0?a:C,k=m!==void 0?m:_;return _e(_e({},h),{},{inputValue:T,menuIsOpen:L,onChange:R,onInputChange:I,onMenuClose:E,onMenuOpen:D,value:k})}import*as n2 from"react";import{forwardRef as SN,useMemo as tae}from"react";function Hy(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function zy(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,Dd(n.key),n)}}function Xy(t,e,o){return e&&zy(t.prototype,e),o&&zy(t,o),Object.defineProperty(t,"prototype",{writable:!1}),t}function Uy(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&&Mi(t,e)}function Bl(t){return Bl=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},Bl(t)}function _h(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(_h=function(){return!!t})()}function Yy(t,e){if(e&&(Lr(e)=="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return S0(t)}function Zy(t){var e=_h();return function(){var o,n=Bl(t);if(e){var r=Bl(this).constructor;o=Reflect.construct(n,arguments,r)}else o=n.apply(this,arguments);return Yy(this,o)}}function Jy(t){if(Array.isArray(t))return Ml(t)}function qy(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function Qy(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
50
+ In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function rs(t){return Jy(t)||qy(t)||Fd(t)||Qy()}import*as ut from"react";import{useMemo as Zl,Fragment as Zh,useRef as ua,useCallback as ss,useEffect as Uw,Component as M5}from"react";import*as gr from"react";import{useContext as E6,forwardRef as P6}from"react";var e6=!1;function t6(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 o6(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 Ky=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?!e6: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(o6(this));var r=this.tags[this.tags.length-1];if(this.isSpeedy){var s=t6(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 vo="-ms-",Vl="-moz-",nt="-webkit-",Ed="comm",qi="rule",Qi="decl";var eC="@import";var Pd="@keyframes";var tC="@layer";var oC=Math.abs,Ks=String.fromCharCode,rC=Object.assign;function nC(t,e){return Bt(t,0)^45?(((e<<2^Bt(t,0))<<2^Bt(t,1))<<2^Bt(t,2))<<2^Bt(t,3):0}function Nd(t){return t.trim()}function Dh(t,e){return(t=e.exec(t))?t[0]:t}function tt(t,e,o){return t.replace(e,o)}function Gl(t,e){return t.indexOf(e)}function Bt(t,e){return t.charCodeAt(e)|0}function ns(t,e,o){return t.slice(e,o)}function To(t){return t.length}function Ki(t){return t.length}function ea(t,e){return e.push(t),t}function Fh(t,e){return t.map(e).join("")}var Ld=1,ta=1,sC=0,Eo=0,Jt=0,ra="";function Wl(t,e,o,n,r,s,i){return{value:t,root:e,parent:o,type:n,props:r,children:s,line:Ld,column:ta,length:i,return:""}}function na(t,e){return rC(Wl("",null,null,"",null,null,0),t,{length:-t.length},e)}function iC(){return Jt}function aC(){return Jt=Eo>0?Bt(ra,--Eo):0,ta--,Jt===10&&(ta=1,Ld--),Jt}function Po(){return Jt=Eo<sC?Bt(ra,Eo++):0,ta++,Jt===10&&(ta=1,Ld++),Jt}function hr(){return Bt(ra,Eo)}function Hl(){return Eo}function sa(t,e){return ns(ra,t,e)}function oa(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 $d(t){return Ld=ta=1,sC=To(ra=t),Eo=0,[]}function kd(t){return ra="",t}function ia(t){return Nd(sa(Eo-1,Ah(t===91?t+2:t===40?t+1:t)))}function lC(t){for(;(Jt=hr())&&Jt<33;)Po();return oa(t)>2||oa(Jt)>3?"":" "}function cC(t,e){for(;--e&&Po()&&!(Jt<48||Jt>102||Jt>57&&Jt<65||Jt>70&&Jt<97););return sa(t,Hl()+(e<6&&hr()==32&&Po()==32))}function Ah(t){for(;Po();)switch(Jt){case t:return Eo;case 34:case 39:t!==34&&t!==39&&Ah(Jt);break;case 40:t===41&&Ah(t);break;case 92:Po();break}return Eo}function uC(t,e){for(;Po()&&t+Jt!==57;)if(t+Jt===84&&hr()===47)break;return"/*"+sa(e,Eo-1)+"*"+Ks(t===47?t:Po())}function dC(t){for(;!oa(hr());)Po();return sa(t,Eo)}function pC(t){return kd(jd("",null,null,null,[""],t=$d(t),0,[0],t))}function jd(t,e,o,n,r,s,i,l,a){for(var c=0,u=0,d=i,f=0,m=0,h=0,p=1,g=1,b=1,v=0,x="",y=r,C=s,S=n,w=x;g;)switch(h=v,v=Po()){case 40:if(h!=108&&Bt(w,d-1)==58){Gl(w+=tt(ia(v),"&","&\f"),"&\f")!=-1&&(b=-1);break}case 34:case 39:case 91:w+=ia(v);break;case 9:case 10:case 13:case 32:w+=lC(h);break;case 92:w+=cC(Hl()-1,7);continue;case 47:switch(hr()){case 42:case 47:ea(r6(uC(Po(),Hl()),e,o),a);break;default:w+="/"}break;case 123*p:l[c++]=To(w)*b;case 125*p:case 59:case 0:switch(v){case 0:case 125:g=0;case 59+u:b==-1&&(w=tt(w,/\f/g,"")),m>0&&To(w)-d&&ea(m>32?fC(w+";",n,o,d-1):fC(tt(w," ","")+";",n,o,d-2),a);break;case 59:w+=";";default:if(ea(S=mC(w,e,o,c,u,r,l,x,y=[],C=[],d),s),v===123)if(u===0)jd(w,e,S,S,y,s,d,l,C);else switch(f===99&&Bt(w,3)===110?100:f){case 100:case 108:case 109:case 115:jd(t,S,S,n&&ea(mC(t,S,S,0,0,r,l,x,r,y=[],d),C),r,C,d,l,n?y:C);break;default:jd(w,S,S,S,[""],C,0,l,C)}}c=u=m=0,p=b=1,x=w="",d=i;break;case 58:d=1+To(w),m=h;default:if(p<1){if(v==123)--p;else if(v==125&&p++==0&&aC()==125)continue}switch(w+=Ks(v),v*p){case 38:b=u>0?1:(w+="\f",-1);break;case 44:l[c++]=(To(w)-1)*b,b=1;break;case 64:hr()===45&&(w+=ia(Po())),f=hr(),u=d=To(x=w+=dC(Hl())),v++;break;case 45:h===45&&To(w)==2&&(p=0)}}return s}function mC(t,e,o,n,r,s,i,l,a,c,u){for(var d=r-1,f=r===0?s:[""],m=Ki(f),h=0,p=0,g=0;h<n;++h)for(var b=0,v=ns(t,d+1,d=oC(p=i[h])),x=t;b<m;++b)(x=Nd(p>0?f[b]+" "+v:tt(v,/&\f/g,f[b])))&&(a[g++]=x);return Wl(t,e,o,r===0?qi:l,a,c,u)}function r6(t,e,o){return Wl(t,e,o,Ed,Ks(iC()),ns(t,2,-2),0)}function fC(t,e,o,n){return Wl(t,e,o,Qi,ns(t,0,n),ns(t,n+1,-1),n)}function ei(t,e){for(var o="",n=Ki(t),r=0;r<n;r++)o+=e(t[r],r,t,e)||"";return o}function hC(t,e,o,n){switch(t.type){case tC:if(t.children.length)break;case eC:case Qi:return t.return=t.return||t.value;case Ed:return"";case Pd:return t.return=t.value+"{"+ei(t.children,n)+"}";case qi:t.value=t.props.join(",")}return To(o=ei(t.children,n))?t.return=t.value+"{"+o+"}":""}function gC(t){var e=Ki(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 bC(t){return function(e){e.root||(e=e.return)&&t(e)}}function vC(t){var e=Object.create(null);return function(o){return e[o]===void 0&&(e[o]=t(o)),e[o]}}var n6=function(e,o,n){for(var r=0,s=0;r=s,s=hr(),r===38&&s===12&&(o[n]=1),!oa(s);)Po();return sa(e,Eo)},s6=function(e,o){var n=-1,r=44;do switch(oa(r)){case 0:r===38&&hr()===12&&(o[n]=1),e[n]+=n6(Eo-1,o,n);break;case 2:e[n]+=ia(r);break;case 4:if(r===44){e[++n]=hr()===58?"&\f":"",o[n]=e[n].length;break}default:e[n]+=Ks(r)}while(r=Po());return e},i6=function(e,o){return kd(s6($d(e),o))},xC=new WeakMap,a6=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&&!xC.get(n))&&!r){xC.set(e,!0);for(var s=[],i=i6(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]}}},l6=function(e){if(e.type==="decl"){var o=e.value;o.charCodeAt(0)===108&&o.charCodeAt(2)===98&&(e.return="",e.value="")}};function yC(t,e){switch(nC(t,e)){case 5103:return nt+"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 nt+t+t;case 5349:case 4246:case 4810:case 6968:case 2756:return nt+t+Vl+t+vo+t+t;case 6828:case 4268:return nt+t+vo+t+t;case 6165:return nt+t+vo+"flex-"+t+t;case 5187:return nt+t+tt(t,/(\w+).+(:[^]+)/,nt+"box-$1$2"+vo+"flex-$1$2")+t;case 5443:return nt+t+vo+"flex-item-"+tt(t,/flex-|-self/,"")+t;case 4675:return nt+t+vo+"flex-line-pack"+tt(t,/align-content|flex-|-self/,"")+t;case 5548:return nt+t+vo+tt(t,"shrink","negative")+t;case 5292:return nt+t+vo+tt(t,"basis","preferred-size")+t;case 6060:return nt+"box-"+tt(t,"-grow","")+nt+t+vo+tt(t,"grow","positive")+t;case 4554:return nt+tt(t,/([^-])(transform)/g,"$1"+nt+"$2")+t;case 6187:return tt(tt(tt(t,/(zoom-|grab)/,nt+"$1"),/(image-set)/,nt+"$1"),t,"")+t;case 5495:case 3959:return tt(t,/(image-set\([^]*)/,nt+"$1$`$1");case 4968:return tt(tt(t,/(.+:)(flex-)?(.*)/,nt+"box-pack:$3"+vo+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+nt+t+t;case 4095:case 3583:case 4068:case 2532:return tt(t,/(.+)-inline(.+)/,nt+"$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(To(t)-1-e>6)switch(Bt(t,e+1)){case 109:if(Bt(t,e+4)!==45)break;case 102:return tt(t,/(.+:)(.+)-([^]+)/,"$1"+nt+"$2-$3$1"+Vl+(Bt(t,e+3)==108?"$3":"$2-$3"))+t;case 115:return~Gl(t,"stretch")?yC(tt(t,"stretch","fill-available"),e)+t:t}break;case 4949:if(Bt(t,e+1)!==115)break;case 6444:switch(Bt(t,To(t)-3-(~Gl(t,"!important")&&10))){case 107:return tt(t,":",":"+nt)+t;case 101:return tt(t,/(.+:)([^;!]+)(;|!.+)?/,"$1"+nt+(Bt(t,14)===45?"inline-":"")+"box$3$1"+nt+"$2$3$1"+vo+"$2box$3")+t}break;case 5936:switch(Bt(t,e+11)){case 114:return nt+t+vo+tt(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return nt+t+vo+tt(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return nt+t+vo+tt(t,/[svh]\w+-[tblr]{2}/,"lr")+t}return nt+t+vo+t+t}return t}var c6=function(e,o,n,r){if(e.length>-1&&!e.return)switch(e.type){case Qi:e.return=yC(e.value,e.length);break;case Pd:return ei([na(e,{value:tt(e.value,"@","@"+nt)})],r);case qi:if(e.length)return Fh(e.props,function(s){switch(Dh(s,/(::plac\w+|:read-\w+)/)){case":read-only":case":read-write":return ei([na(e,{props:[tt(s,/:(read-\w+)/,":"+Vl+"$1")]})],r);case"::placeholder":return ei([na(e,{props:[tt(s,/:(plac\w+)/,":"+nt+"input-$1")]}),na(e,{props:[tt(s,/:(plac\w+)/,":"+Vl+"$1")]}),na(e,{props:[tt(s,/:(plac\w+)/,vo+"input-$1")]})],r)}return""})}},u6=[c6],Th=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(p){var g=p.getAttribute("data-emotion");g.indexOf(" ")!==-1&&(document.head.appendChild(p),p.setAttribute("data-s",""))})}var r=e.stylisPlugins||u6,s={},i,l=[];i=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+o+' "]'),function(p){for(var g=p.getAttribute("data-emotion").split(" "),b=1;b<g.length;b++)s[g[b]]=!0;l.push(p)});var a,c=[a6,l6];{var u,d=[hC,bC(function(p){u.insert(p)})],f=gC(c.concat(r,d)),m=function(g){return ei(pC(g),f)};a=function(g,b,v,x){u=v,m(g?g+"{"+b.styles+"}":b.styles),x&&(h.inserted[b.name]=!0)}}var h={key:o,sheet:new Ky({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 h.sheet.hydrate(l),h};var S6=!0;function kh(t,e,o){var n="";return o.split(" ").forEach(function(r){t[r]!==void 0?e.push(t[r]+";"):r&&(n+=r+" ")}),n}var Yd=function(e,o,n){var r=e.key+"-"+o.name;(n===!1||S6===!1)&&e.registered[r]===void 0&&(e.registered[r]=o.styles)},jh=function(e,o,n){Yd(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 PC(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 NC={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 I6=!1,R6=/[A-Z]|^ms/g,_6=/_EMO_([^_]+?)_([^]*?)_EMO_/g,jC=function(e){return e.charCodeAt(1)===45},LC=function(e){return e!=null&&typeof e!="boolean"},Oh=vC(function(t){return jC(t)?t:t.replace(R6,"-$&").toLowerCase()}),$C=function(e,o){switch(e){case"animation":case"animationName":if(typeof o=="string")return o.replace(_6,function(n,r,s){return Kr={name:r,styles:s,next:Kr},r})}return NC[e]!==1&&!jC(e)&&typeof o=="number"&&o!==0?o+"px":o},D6="Component selectors can only be used in conjunction with @emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware compiler transform.";function zl(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 Kr={name:r.name,styles:r.styles,next:Kr},r.name;var s=o;if(s.styles!==void 0){var i=s.next;if(i!==void 0)for(;i!==void 0;)Kr={name:i.name,styles:i.styles,next:Kr},i=i.next;var l=s.styles+";";return l}return F6(t,e,o)}case"function":{if(t!==void 0){var a=Kr,c=o(t);return Kr=a,zl(t,e,c)}break}}var u=o;if(e==null)return u;var d=e[u];return d!==void 0?d:u}function F6(t,e,o){var n="";if(Array.isArray(o))for(var r=0;r<o.length;r++)n+=zl(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]+"}":LC(l)&&(n+=Oh(s)+":"+$C(s,l)+";")}else{if(s==="NO_COMPONENT_SELECTOR"&&I6)throw new Error(D6);if(Array.isArray(i)&&typeof i[0]=="string"&&(e==null||e[i[0]]===void 0))for(var a=0;a<i.length;a++)LC(i[a])&&(n+=Oh(s)+":"+$C(s,i[a])+";");else{var c=zl(t,e,i);switch(s){case"animation":case"animationName":{n+=Oh(s)+":"+c+";";break}default:n+=s+"{"+c+"}"}}}}return n}var kC=/label:\s*([^\s;{]+)\s*(;|$)/g,Kr;function Zd(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="";Kr=void 0;var s=t[0];if(s==null||s.raw===void 0)n=!1,r+=zl(o,e,s);else{var i=s;r+=i[0]}for(var l=1;l<t.length;l++)if(r+=zl(o,e,t[l]),n){var a=s;r+=a[l]}kC.lastIndex=0;for(var c="",u;(u=kC.exec(r))!==null;)c+="-"+u[1];var d=PC(r)+c;return{name:d,styles:r,next:Kr}}import*as Jd from"react";var A6=function(e){return e()},T6=Jd.useInsertionEffect?Jd.useInsertionEffect:!1,Mh=T6||A6;var OC=!1,MC=gr.createContext(typeof HTMLElement<"u"?Th({key:"css"}):null),lie=MC.Provider;var BC=function(e){return P6(function(o,n){var r=E6(MC);return e(o,r,n)})},VC=gr.createContext({});var qd={}.hasOwnProperty,Bh="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",GC=function(e,o){var n={};for(var r in o)qd.call(o,r)&&(n[r]=o[r]);return n[Bh]=e,n},N6=function(e){var o=e.cache,n=e.serialized,r=e.isStringTag;return Yd(o,n,r),Mh(function(){return jh(o,n,r)}),null},L6=BC(function(t,e,o){var n=t.css;typeof n=="string"&&e.registered[n]!==void 0&&(n=e.registered[n]);var r=t[Bh],s=[n],i="";typeof t.className=="string"?i=kh(e.registered,s,t.className):t.className!=null&&(i=t.className+" ");var l=Zd(s,void 0,gr.useContext(VC));i+=e.key+"-"+l.name;var a={};for(var c in t)qd.call(t,c)&&c!=="css"&&c!==Bh&&!OC&&(a[c]=t[c]);return a.className=i,o&&(a.ref=o),gr.createElement(gr.Fragment,null,gr.createElement(N6,{cache:e,serialized:l,isStringTag:typeof r=="string"}),gr.createElement(r,a))}),WC=L6;import*as aa from"react";var vie=As(EC()),Fe=function(e,o){var n=arguments;if(o==null||!qd.call(o,"css"))return aa.createElement.apply(void 0,n);var r=n.length,s=new Array(r);s[0]=WC,s[1]=GC(e,o);for(var i=2;i<r;i++)s[i]=n[i];return aa.createElement.apply(null,s)};(function(t){var e;e||(e=t.JSX||(t.JSX={}))})(Fe||(Fe={}));function Xl(){for(var t=arguments.length,e=new Array(t),o=0;o<t;o++)e[o]=arguments[o];return Zd(e)}function HC(){var t=Xl.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 zC(t,e){return e||(e=t.slice(0)),Object.freeze(Object.defineProperties(t,{raw:{value:Object.freeze(e)}}))}DD();import{useContext as k6,useRef as Wh,useState as tm,useMemo as j6,useCallback as Vh,createContext as O6}from"react";import{createPortal as M6}from"react-dom";import{useLayoutEffect as $6}from"react";var Qd=$6;var B6=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],Ul=function(){};function V6(t,e){return e?e[0]==="-"?t+e:t+"__"+e:t}function UC(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(V6(t,i)));return s.filter(function(l){return l}).map(function(l){return String(l).trim()}).join(" ")}var la=function(e){return U6(e)?e.filter(Boolean):Lr(e)==="object"&&e!==null?[e]:[]},YC=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=Vo(e,B6);return _e({},o)},$t=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 Yl(t){return[document.documentElement,document.body,window].indexOf(t)>-1}function G6(t){return Yl(t)?window.innerHeight:t.clientHeight}function ZC(t){return Yl(t)?window.pageYOffset:t.scrollTop}function om(t,e){if(Yl(t)){window.scrollTo(0,e);return}t.scrollTop=e}function W6(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 H6(t,e,o,n){return o*((t=t/n-1)*t*t+1)+e}function Kd(t,e){var o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:200,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:Ul,r=ZC(t),s=e-r,i=10,l=0;function a(){l+=i;var c=H6(l,r,s,o);om(t,c),l<o?window.requestAnimationFrame(a):n(t)}a()}function Hh(t,e){var o=t.getBoundingClientRect(),n=e.getBoundingClientRect(),r=e.offsetHeight/3;n.bottom+r>o.bottom?om(t,Math.min(e.offsetTop+e.clientHeight-t.offsetHeight+r,t.scrollHeight)):n.top-r<o.top&&om(t,Math.max(e.offsetTop-r,0))}function z6(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 zh(){try{return document.createEvent("TouchEvent"),!0}catch{return!1}}function JC(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch{return!1}}var qC=!1,X6={get passive(){return qC=!0}},em=typeof window<"u"?window:{};em.addEventListener&&em.removeEventListener&&(em.addEventListener("p",Ul,X6),em.removeEventListener("p",Ul,!1));var QC=qC;function KC(t){return t!=null}function U6(t){return Array.isArray(t)}function ti(t,e,o){return t?e:o}var ew=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=$r(i,1),a=l[0];return!n.includes(a)});return s.reduce(function(i,l){var a=$r(l,2),c=a[0],u=a[1];return i[c]=u,i},{})},Y6=["children","innerProps"],Z6=["children","innerProps"];function J6(t){var e=t.maxHeight,o=t.menuEl,n=t.minHeight,r=t.placement,s=t.shouldScroll,i=t.isFixedPosition,l=t.controlHeight,a=W6(o),c={placement:"bottom",maxHeight:e};if(!o||!o.offsetParent)return c;var u=a.getBoundingClientRect(),d=u.height,f=o.getBoundingClientRect(),m=f.bottom,h=f.height,p=f.top,g=o.offsetParent.getBoundingClientRect(),b=g.top,v=i?window.innerHeight:G6(a),x=ZC(a),y=parseInt(getComputedStyle(o).marginBottom,10),C=parseInt(getComputedStyle(o).marginTop,10),S=b-C,w=v-p,F=S+x,_=d-x-p,A=m-v+x+y,R=x+p-C,I=160;switch(r){case"auto":case"bottom":if(w>=h)return{placement:"bottom",maxHeight:e};if(_>=h&&!i)return s&&Kd(a,A,I),{placement:"bottom",maxHeight:e};if(!i&&_>=n||i&&w>=n){s&&Kd(a,A,I);var D=i?w-y:_-y;return{placement:"bottom",maxHeight:D}}if(r==="auto"||i){var E=e,T=i?S:F;return T>=n&&(E=Math.min(T-y-l,e)),{placement:"top",maxHeight:E}}if(r==="bottom")return s&&om(a,A),{placement:"bottom",maxHeight:e};break;case"top":if(S>=h)return{placement:"top",maxHeight:e};if(F>=h&&!i)return s&&Kd(a,R,I),{placement:"top",maxHeight:e};if(!i&&F>=n||i&&S>=n){var L=e;return(!i&&F>=n||i&&S>=n)&&(L=i?S-C:F-C),s&&Kd(a,R,I),{placement:"top",maxHeight:L}}return{placement:"bottom",maxHeight:e};default:throw new Error('Invalid placement provided "'.concat(r,'".'))}return c}function q6(t){var e={bottom:"top",top:"bottom"};return t?e[t]:"bottom"}var tw=function(e){return e==="auto"?"bottom":e},ow=function(e,o){var n,r=e.placement,s=e.theme,i=s.borderRadius,l=s.spacing,a=s.colors;return _e((n={label:"menu"},Qs(n,q6(r),"100%"),Qs(n,"position","absolute"),Qs(n,"width","100%"),Qs(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})},rw=O6(null),nw=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=k6(rw)||{},u=c.setPortalPlacement,d=Wh(null),f=tm(r),m=$r(f,2),h=m[0],p=m[1],g=tm(null),b=$r(g,2),v=b[0],x=b[1],y=a.spacing.controlHeight;return Qd(function(){var C=d.current;if(C){var S=i==="fixed",w=l&&!S,F=J6({maxHeight:r,menuEl:C,minHeight:n,placement:s,shouldScroll:w,isFixedPosition:S,controlHeight:y});p(F.maxHeight),x(F.placement),u?.(F.placement)}},[r,s,i,l,n,u,y]),o({ref:d,placerProps:_e(_e({},e),{},{placement:v||tw(s),maxHeight:h})})},Q6=function(e){var o=e.children,n=e.innerRef,r=e.innerProps;return Fe("div",Re({},$t(e,"menu",{menu:!0}),{ref:n},r),o)},K6=Q6,sw=function(e,o){var n=e.maxHeight,r=e.theme.spacing.baseUnit;return _e({maxHeight:n,overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},o?{}:{paddingBottom:r,paddingTop:r})},e5=function(e){var o=e.children,n=e.innerProps,r=e.innerRef,s=e.isMulti;return Fe("div",Re({},$t(e,"menuList",{"menu-list":!0,"menu-list--is-multi":s}),{ref:r},n),o)},iw=function(e,o){var n=e.theme,r=n.spacing.baseUnit,s=n.colors;return _e({textAlign:"center"},o?{}:{color:s.neutral40,padding:"".concat(r*2,"px ").concat(r*3,"px")})},aw=iw,lw=iw,t5=function(e){var o=e.children,n=o===void 0?"No options":o,r=e.innerProps,s=Vo(e,Y6);return Fe("div",Re({},$t(_e(_e({},s),{},{children:n,innerProps:r}),"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),r),n)},o5=function(e){var o=e.children,n=o===void 0?"Loading...":o,r=e.innerProps,s=Vo(e,Z6);return Fe("div",Re({},$t(_e(_e({},s),{},{children:n,innerProps:r}),"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),r),n)},cw=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}},r5=function(e){var o=e.appendTo,n=e.children,r=e.controlElement,s=e.innerProps,i=e.menuPlacement,l=e.menuPosition,a=Wh(null),c=Wh(null),u=tm(tw(i)),d=$r(u,2),f=d[0],m=d[1],h=j6(function(){return{setPortalPlacement:m}},[]),p=tm(null),g=$r(p,2),b=g[0],v=g[1],x=Vh(function(){if(r){var w=z6(r),F=l==="fixed"?0:window.pageYOffset,_=w[f]+F;(_!==b?.offset||w.left!==b?.rect.left||w.width!==b?.rect.width)&&v({offset:_,rect:w})}},[r,l,f,b?.offset,b?.rect.left,b?.rect.width]);Qd(function(){x()},[x]);var y=Vh(function(){typeof c.current=="function"&&(c.current(),c.current=null),r&&a.current&&(c.current=hv(r,a.current,x,{elementResize:"ResizeObserver"in window}))},[r,x]);Qd(function(){y()},[y]);var C=Vh(function(w){a.current=w,y()},[y]);if(!o&&l!=="fixed"||!b)return null;var S=Fe("div",Re({ref:C},$t(_e(_e({},e),{},{offset:b.offset,position:l,rect:b.rect}),"menuPortal",{"menu-portal":!0}),s),n);return Fe(rw.Provider,{value:h},o?M6(S,o):S)},uw=function(e){var o=e.isDisabled,n=e.isRtl;return{label:"container",direction:n?"rtl":void 0,pointerEvents:o?"none":void 0,position:"relative"}},n5=function(e){var o=e.children,n=e.innerProps,r=e.isDisabled,s=e.isRtl;return Fe("div",Re({},$t(e,"container",{"--is-disabled":r,"--is-rtl":s}),n),o)},dw=function(e,o){var n=e.theme.spacing,r=e.isMulti,s=e.hasValue,i=e.selectProps.controlShouldRenderValue;return _e({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")})},s5=function(e){var o=e.children,n=e.innerProps,r=e.isMulti,s=e.hasValue;return Fe("div",Re({},$t(e,"valueContainer",{"value-container":!0,"value-container--is-multi":r,"value-container--has-value":s}),n),o)},mw=function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},i5=function(e){var o=e.children,n=e.innerProps;return Fe("div",Re({},$t(e,"indicatorsContainer",{indicators:!0}),n),o)},XC,a5=["size"],l5=["innerProps","isRtl","size"];var c5={name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"},fw=function(e){var o=e.size,n=Vo(e,a5);return Fe("svg",Re({height:o,width:o,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:c5},n))},Xh=function(e){return Fe(fw,Re({size:20},e),Fe("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"}))},pw=function(e){return Fe(fw,Re({size:20},e),Fe("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"}))},hw=function(e,o){var n=e.isFocused,r=e.theme,s=r.spacing.baseUnit,i=r.colors;return _e({label:"indicatorContainer",display:"flex",transition:"color 150ms"},o?{}:{color:n?i.neutral60:i.neutral20,padding:s*2,":hover":{color:n?i.neutral80:i.neutral40}})},gw=hw,u5=function(e){var o=e.children,n=e.innerProps;return Fe("div",Re({},$t(e,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),n),o||Fe(pw,null))},bw=hw,d5=function(e){var o=e.children,n=e.innerProps;return Fe("div",Re({},$t(e,"clearIndicator",{indicator:!0,"clear-indicator":!0}),n),o||Fe(Xh,null))},vw=function(e,o){var n=e.isDisabled,r=e.theme,s=r.spacing.baseUnit,i=r.colors;return _e({label:"indicatorSeparator",alignSelf:"stretch",width:1},o?{}:{backgroundColor:n?i.neutral10:i.neutral20,marginBottom:s*2,marginTop:s*2})},m5=function(e){var o=e.innerProps;return Fe("span",Re({},o,$t(e,"indicatorSeparator",{"indicator-separator":!0})))},f5=HC(XC||(XC=zC([`
51
51
  0%, 80%, 100% { opacity: 0; }
52
52
  40% { opacity: 1; }
53
- `]))),bw=function(e,o){var n=e.isFocused,r=e.size,s=e.theme,i=s.colors,a=s.spacing.baseUnit;return Re({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:r,lineHeight:1,marginRight:r,textAlign:"center",verticalAlign:"middle"},o?{}:{color:n?i.neutral60:i.neutral20,padding:a*2})},Bh=function(e){var o=e.delay,n=e.offset;return Te("span",{css:Xl({animation:"".concat(f5," 1s ease-in-out ").concat(o,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:n?"1em":void 0,height:"1em",verticalAlign:"top",width:"1em"},"","")})},p5=function(e){var o=e.innerProps,n=e.isRtl,r=e.size,s=r===void 0?4:r,i=Vo(e,l5);return Te("div",Ie({},Nt(Re(Re({},i),{},{innerProps:o,isRtl:n,size:s}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),o),Te(Bh,{delay:0,offset:n}),Te(Bh,{delay:160,offset:!0}),Te(Bh,{delay:320,offset:!n}))},vw=function(e,o){var n=e.isDisabled,r=e.isFocused,s=e.theme,i=s.colors,a=s.borderRadius,l=s.spacing;return Re({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:l.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},o?{}:{backgroundColor:n?i.neutral5:i.neutral0,borderColor:n?i.neutral10:r?i.primary:i.neutral20,borderRadius:a,borderStyle:"solid",borderWidth:1,boxShadow:r?"0 0 0 1px ".concat(i.primary):void 0,"&:hover":{borderColor:r?i.primary:i.neutral30}})},h5=function(e){var o=e.children,n=e.isDisabled,r=e.isFocused,s=e.innerRef,i=e.innerProps,a=e.menuIsOpen;return Te("div",Ie({ref:s},Nt(e,"control",{control:!0,"control--is-disabled":n,"control--is-focused":r,"control--menu-is-open":a}),i,{"aria-disabled":n||void 0}),o)},g5=h5,b5=["data"],xw=function(e,o){var n=e.theme.spacing;return o?{}:{paddingBottom:n.baseUnit*2,paddingTop:n.baseUnit*2}},v5=function(e){var o=e.children,n=e.cx,r=e.getStyles,s=e.getClassNames,i=e.Heading,a=e.headingProps,l=e.innerProps,c=e.label,u=e.theme,d=e.selectProps;return Te("div",Ie({},Nt(e,"group",{group:!0}),l),Te(i,Ie({},a,{selectProps:d,theme:u,getStyles:r,getClassNames:s,cx:n}),c),Te("div",null,o))},yw=function(e,o){var n=e.theme,r=n.colors,s=n.spacing;return Re({label:"group",cursor:"default",display:"block"},o?{}:{color:r.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:s.baseUnit*3,paddingRight:s.baseUnit*3,textTransform:"uppercase"})},x5=function(e){var o=XC(e);o.data;var n=Vo(o,b5);return Te("div",Ie({},Nt(e,"groupHeading",{"group-heading":!0}),n))},y5=v5,C5=["innerRef","isDisabled","isHidden","inputClassName"],Cw=function(e,o){var n=e.isDisabled,r=e.value,s=e.theme,i=s.spacing,a=s.colors;return Re(Re({visibility:n?"hidden":"visible",transform:r?"translateZ(0)":""},w5),o?{}:{margin:i.baseUnit/2,paddingBottom:i.baseUnit/2,paddingTop:i.baseUnit/2,color:a.neutral80})},ww={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},w5={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":Re({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},ww)},S5=function(e){return Re({label:"input",color:"inherit",background:0,opacity:e?0:1,width:"100%"},ww)},I5=function(e){var o=e.cx,n=e.value,r=XC(e),s=r.innerRef,i=r.isDisabled,a=r.isHidden,l=r.inputClassName,c=Vo(r,C5);return Te("div",Ie({},Nt(e,"input",{"input-container":!0}),{"data-value":n||""}),Te("input",Ie({className:o({input:!0},l),ref:s,style:S5(a),disabled:i},c)))},R5=I5,Sw=function(e,o){var n=e.theme,r=n.spacing,s=n.borderRadius,i=n.colors;return Re({label:"multiValue",display:"flex",minWidth:0},o?{}:{backgroundColor:i.neutral10,borderRadius:s/2,margin:r.baseUnit/2})},Iw=function(e,o){var n=e.theme,r=n.borderRadius,s=n.colors,i=e.cropWithEllipsis;return Re({overflow:"hidden",textOverflow:i||i===void 0?"ellipsis":void 0,whiteSpace:"nowrap"},o?{}:{borderRadius:r/2,color:s.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},Rw=function(e,o){var n=e.theme,r=n.spacing,s=n.borderRadius,i=n.colors,a=e.isFocused;return Re({alignItems:"center",display:"flex"},o?{}:{borderRadius:s/2,backgroundColor:a?i.dangerLight:void 0,paddingLeft:r.baseUnit,paddingRight:r.baseUnit,":hover":{backgroundColor:i.dangerLight,color:i.danger}})},_w=function(e){var o=e.children,n=e.innerProps;return Te("div",n,o)},_5=_w,D5=_w;function F5(t){var e=t.children,o=t.innerProps;return Te("div",Ie({role:"button"},o),e||Te(Hh,{size:14}))}var A5=function(e){var o=e.children,n=e.components,r=e.data,s=e.innerProps,i=e.isDisabled,a=e.removeProps,l=e.selectProps,c=n.Container,u=n.Label,d=n.Remove;return Te(c,{data:r,innerProps:Re(Re({},Nt(e,"multiValue",{"multi-value":!0,"multi-value--is-disabled":i})),s),selectProps:l},Te(u,{data:r,innerProps:Re({},Nt(e,"multiValueLabel",{"multi-value__label":!0})),selectProps:l},o),Te(d,{data:r,innerProps:Re(Re({},Nt(e,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(o||"option")},a),selectProps:l}))},T5=A5,Dw=function(e,o){var n=e.isDisabled,r=e.isFocused,s=e.isSelected,i=e.theme,a=i.spacing,l=i.colors;return Re({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},o?{}:{backgroundColor:s?l.primary:r?l.primary25:"transparent",color:n?l.neutral20:s?l.neutral0:"inherit",padding:"".concat(a.baseUnit*2,"px ").concat(a.baseUnit*3,"px"),":active":{backgroundColor:n?void 0:s?l.primary:l.primary50}})},E5=function(e){var o=e.children,n=e.isDisabled,r=e.isFocused,s=e.isSelected,i=e.innerRef,a=e.innerProps;return Te("div",Ie({},Nt(e,"option",{option:!0,"option--is-disabled":n,"option--is-focused":r,"option--is-selected":s}),{ref:i,"aria-disabled":n},a),o)},P5=E5,Fw=function(e,o){var n=e.theme,r=n.spacing,s=n.colors;return Re({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},o?{}:{color:s.neutral50,marginLeft:r.baseUnit/2,marginRight:r.baseUnit/2})},N5=function(e){var o=e.children,n=e.innerProps;return Te("div",Ie({},Nt(e,"placeholder",{placeholder:!0}),n),o)},L5=N5,Aw=function(e,o){var n=e.isDisabled,r=e.theme,s=r.spacing,i=r.colors;return Re({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},o?{}:{color:n?i.neutral40:i.neutral80,marginLeft:s.baseUnit/2,marginRight:s.baseUnit/2})},$5=function(e){var o=e.children,n=e.isDisabled,r=e.innerProps;return Te("div",Ie({},Nt(e,"singleValue",{"single-value":!0,"single-value--is-disabled":n}),r),o)},k5=$5,co={ClearIndicator:d5,Control:g5,DropdownIndicator:u5,DownChevron:mw,CrossIcon:Hh,Group:y5,GroupHeading:x5,IndicatorsContainer:i5,IndicatorSeparator:m5,Input:R5,LoadingIndicator:p5,Menu:K6,MenuList:e5,MenuPortal:r5,LoadingMessage:o5,NoOptionsMessage:t5,MultiValue:T5,MultiValueContainer:_5,MultiValueLabel:D5,MultiValueRemove:F5,Option:P5,Placeholder:L5,SelectContainer:n5,SingleValue:k5,ValueContainer:s5},Tw=function(e){return Re(Re({},co),e.components)};var Ew=Number.isNaN||function(e){return typeof e=="number"&&e!==e};function j5(t,e){return!!(t===e||Ew(t)&&Ew(e))}function O5(t,e){if(t.length!==e.length)return!1;for(var o=0;o<t.length;o++)if(!j5(t[o],e[o]))return!1;return!0}function Pw(t,e){e===void 0&&(e=O5);var o=null;function n(){for(var r=[],s=0;s<arguments.length;s++)r[s]=arguments[s];if(o&&o.lastThis===this&&e(r,o.lastArgs))return o.lastResult;var i=t.apply(this,r);return o={lastResult:i,lastArgs:r,lastThis:this},i}return n.clear=function(){o=null},n}var B5={name:"7pg0cj-a11yText",styles:"label:a11yText;z-index:9999;border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;width:1px;position:absolute;overflow:hidden;padding:0;white-space:nowrap"},V5=function(e){return Te("span",Ie({css:B5},e))},Nw=V5,G5={guidance:function(e){var o=e.isSearchable,n=e.isMulti,r=e.tabSelectsValue,s=e.context,i=e.isInitialFocus;switch(s){case"menu":return"Use Up and Down to choose options, press Enter to select the currently focused option, press Escape to exit the menu".concat(r?", press Tab to select the option and exit the menu":"",".");case"input":return i?"".concat(e["aria-label"]||"Select"," is focused ").concat(o?",type to refine list":"",", press Down to open the menu, ").concat(n?" press left to focus selected values":""):"";case"value":return"Use left and right to toggle between focused values, press Backspace to remove the currently focused value";default:return""}},onChange:function(e){var o=e.action,n=e.label,r=n===void 0?"":n,s=e.labels,i=e.isDisabled;switch(o){case"deselect-option":case"pop-value":case"remove-value":return"option ".concat(r,", deselected.");case"clear":return"All selected options have been cleared.";case"initial-input-focus":return"option".concat(s.length>1?"s":""," ").concat(s.join(","),", selected.");case"select-option":return i?"option ".concat(r," is disabled. Select another option."):"option ".concat(r,", selected.");default:return""}},onFocus:function(e){var o=e.context,n=e.focused,r=e.options,s=e.label,i=s===void 0?"":s,a=e.selectValue,l=e.isDisabled,c=e.isSelected,u=e.isAppleDevice,d=function(p,g){return p&&p.length?"".concat(p.indexOf(g)+1," of ").concat(p.length):""};if(o==="value"&&a)return"value ".concat(i," focused, ").concat(d(a,n),".");if(o==="menu"&&u){var f=l?" disabled":"",m="".concat(c?" selected":"").concat(f);return"".concat(i).concat(m,", ").concat(d(r,n),".")}return""},onFilter:function(e){var o=e.inputValue,n=e.resultsMessage;return"".concat(n).concat(o?" for search term "+o:"",".")}},W5=function(e){var o=e.ariaSelection,n=e.focusedOption,r=e.focusedValue,s=e.focusableOptions,i=e.isFocused,a=e.selectValue,l=e.selectProps,c=e.id,u=e.isAppleDevice,d=l.ariaLiveMessages,f=l.getOptionLabel,m=l.inputValue,h=l.isMulti,p=l.isOptionDisabled,g=l.isSearchable,b=l.menuIsOpen,v=l.options,x=l.screenReaderStatus,y=l.tabSelectsValue,C=l.isLoading,S=l["aria-label"],w=l["aria-live"],D=Zl(function(){return Re(Re({},G5),d||{})},[d]),_=Zl(function(){var T="";if(o&&D.onChange){var $=o.option,j=o.options,N=o.removedValue,P=o.removedValues,L=o.value,V=function(te){return Array.isArray(te)?null:te},M=N||$||V(L),O=M?f(M):"",B=j||P||void 0,G=B?B.map(f):[],X=Re({isDisabled:M&&p(M,a),label:O,labels:G},o);T=D.onChange(X)}return T},[o,D,p,a,f]),A=Zl(function(){var T="",$=n||r,j=!!(n&&a&&a.includes(n));if($&&D.onFocus){var N={focused:$,label:f($),isDisabled:p($,a),isSelected:j,options:s,context:$===n?"menu":"value",selectValue:a,isAppleDevice:u};T=D.onFocus(N)}return T},[n,r,f,p,D,s,a,u]),F=Zl(function(){var T="";if(b&&v.length&&!C&&D.onFilter){var $=x({count:s.length});T=D.onFilter({inputValue:m,resultsMessage:$})}return T},[s,m,b,D,v,x,C]),R=o?.action==="initial-input-focus",I=Zl(function(){var T="";if(D.guidance){var $=r?"value":b?"menu":"input";T=D.guidance({"aria-label":S,context:$,isDisabled:n&&p(n,a),isMulti:h,isSearchable:g,tabSelectsValue:y,isInitialFocus:R})}return T},[S,n,r,h,p,g,b,D,a,y,R]),E=Te(Uh,null,Te("span",{id:"aria-selection"},_),Te("span",{id:"aria-focused"},A),Te("span",{id:"aria-results"},F),Te("span",{id:"aria-guidance"},I));return Te(Uh,null,Te(Nw,{id:c},R&&E),Te(Nw,{"aria-live":w,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},i&&!R&&E))},H5=W5,Yh=[{base:"A",letters:"A\u24B6\uFF21\xC0\xC1\xC2\u1EA6\u1EA4\u1EAA\u1EA8\xC3\u0100\u0102\u1EB0\u1EAE\u1EB4\u1EB2\u0226\u01E0\xC4\u01DE\u1EA2\xC5\u01FA\u01CD\u0200\u0202\u1EA0\u1EAC\u1EB6\u1E00\u0104\u023A\u2C6F"},{base:"AA",letters:"\uA732"},{base:"AE",letters:"\xC6\u01FC\u01E2"},{base:"AO",letters:"\uA734"},{base:"AU",letters:"\uA736"},{base:"AV",letters:"\uA738\uA73A"},{base:"AY",letters:"\uA73C"},{base:"B",letters:"B\u24B7\uFF22\u1E02\u1E04\u1E06\u0243\u0182\u0181"},{base:"C",letters:"C\u24B8\uFF23\u0106\u0108\u010A\u010C\xC7\u1E08\u0187\u023B\uA73E"},{base:"D",letters:"D\u24B9\uFF24\u1E0A\u010E\u1E0C\u1E10\u1E12\u1E0E\u0110\u018B\u018A\u0189\uA779"},{base:"DZ",letters:"\u01F1\u01C4"},{base:"Dz",letters:"\u01F2\u01C5"},{base:"E",letters:"E\u24BA\uFF25\xC8\xC9\xCA\u1EC0\u1EBE\u1EC4\u1EC2\u1EBC\u0112\u1E14\u1E16\u0114\u0116\xCB\u1EBA\u011A\u0204\u0206\u1EB8\u1EC6\u0228\u1E1C\u0118\u1E18\u1E1A\u0190\u018E"},{base:"F",letters:"F\u24BB\uFF26\u1E1E\u0191\uA77B"},{base:"G",letters:"G\u24BC\uFF27\u01F4\u011C\u1E20\u011E\u0120\u01E6\u0122\u01E4\u0193\uA7A0\uA77D\uA77E"},{base:"H",letters:"H\u24BD\uFF28\u0124\u1E22\u1E26\u021E\u1E24\u1E28\u1E2A\u0126\u2C67\u2C75\uA78D"},{base:"I",letters:"I\u24BE\uFF29\xCC\xCD\xCE\u0128\u012A\u012C\u0130\xCF\u1E2E\u1EC8\u01CF\u0208\u020A\u1ECA\u012E\u1E2C\u0197"},{base:"J",letters:"J\u24BF\uFF2A\u0134\u0248"},{base:"K",letters:"K\u24C0\uFF2B\u1E30\u01E8\u1E32\u0136\u1E34\u0198\u2C69\uA740\uA742\uA744\uA7A2"},{base:"L",letters:"L\u24C1\uFF2C\u013F\u0139\u013D\u1E36\u1E38\u013B\u1E3C\u1E3A\u0141\u023D\u2C62\u2C60\uA748\uA746\uA780"},{base:"LJ",letters:"\u01C7"},{base:"Lj",letters:"\u01C8"},{base:"M",letters:"M\u24C2\uFF2D\u1E3E\u1E40\u1E42\u2C6E\u019C"},{base:"N",letters:"N\u24C3\uFF2E\u01F8\u0143\xD1\u1E44\u0147\u1E46\u0145\u1E4A\u1E48\u0220\u019D\uA790\uA7A4"},{base:"NJ",letters:"\u01CA"},{base:"Nj",letters:"\u01CB"},{base:"O",letters:"O\u24C4\uFF2F\xD2\xD3\xD4\u1ED2\u1ED0\u1ED6\u1ED4\xD5\u1E4C\u022C\u1E4E\u014C\u1E50\u1E52\u014E\u022E\u0230\xD6\u022A\u1ECE\u0150\u01D1\u020C\u020E\u01A0\u1EDC\u1EDA\u1EE0\u1EDE\u1EE2\u1ECC\u1ED8\u01EA\u01EC\xD8\u01FE\u0186\u019F\uA74A\uA74C"},{base:"OI",letters:"\u01A2"},{base:"OO",letters:"\uA74E"},{base:"OU",letters:"\u0222"},{base:"P",letters:"P\u24C5\uFF30\u1E54\u1E56\u01A4\u2C63\uA750\uA752\uA754"},{base:"Q",letters:"Q\u24C6\uFF31\uA756\uA758\u024A"},{base:"R",letters:"R\u24C7\uFF32\u0154\u1E58\u0158\u0210\u0212\u1E5A\u1E5C\u0156\u1E5E\u024C\u2C64\uA75A\uA7A6\uA782"},{base:"S",letters:"S\u24C8\uFF33\u1E9E\u015A\u1E64\u015C\u1E60\u0160\u1E66\u1E62\u1E68\u0218\u015E\u2C7E\uA7A8\uA784"},{base:"T",letters:"T\u24C9\uFF34\u1E6A\u0164\u1E6C\u021A\u0162\u1E70\u1E6E\u0166\u01AC\u01AE\u023E\uA786"},{base:"TZ",letters:"\uA728"},{base:"U",letters:"U\u24CA\uFF35\xD9\xDA\xDB\u0168\u1E78\u016A\u1E7A\u016C\xDC\u01DB\u01D7\u01D5\u01D9\u1EE6\u016E\u0170\u01D3\u0214\u0216\u01AF\u1EEA\u1EE8\u1EEE\u1EEC\u1EF0\u1EE4\u1E72\u0172\u1E76\u1E74\u0244"},{base:"V",letters:"V\u24CB\uFF36\u1E7C\u1E7E\u01B2\uA75E\u0245"},{base:"VY",letters:"\uA760"},{base:"W",letters:"W\u24CC\uFF37\u1E80\u1E82\u0174\u1E86\u1E84\u1E88\u2C72"},{base:"X",letters:"X\u24CD\uFF38\u1E8A\u1E8C"},{base:"Y",letters:"Y\u24CE\uFF39\u1EF2\xDD\u0176\u1EF8\u0232\u1E8E\u0178\u1EF6\u1EF4\u01B3\u024E\u1EFE"},{base:"Z",letters:"Z\u24CF\uFF3A\u0179\u1E90\u017B\u017D\u1E92\u1E94\u01B5\u0224\u2C7F\u2C6B\uA762"},{base:"a",letters:"a\u24D0\uFF41\u1E9A\xE0\xE1\xE2\u1EA7\u1EA5\u1EAB\u1EA9\xE3\u0101\u0103\u1EB1\u1EAF\u1EB5\u1EB3\u0227\u01E1\xE4\u01DF\u1EA3\xE5\u01FB\u01CE\u0201\u0203\u1EA1\u1EAD\u1EB7\u1E01\u0105\u2C65\u0250"},{base:"aa",letters:"\uA733"},{base:"ae",letters:"\xE6\u01FD\u01E3"},{base:"ao",letters:"\uA735"},{base:"au",letters:"\uA737"},{base:"av",letters:"\uA739\uA73B"},{base:"ay",letters:"\uA73D"},{base:"b",letters:"b\u24D1\uFF42\u1E03\u1E05\u1E07\u0180\u0183\u0253"},{base:"c",letters:"c\u24D2\uFF43\u0107\u0109\u010B\u010D\xE7\u1E09\u0188\u023C\uA73F\u2184"},{base:"d",letters:"d\u24D3\uFF44\u1E0B\u010F\u1E0D\u1E11\u1E13\u1E0F\u0111\u018C\u0256\u0257\uA77A"},{base:"dz",letters:"\u01F3\u01C6"},{base:"e",letters:"e\u24D4\uFF45\xE8\xE9\xEA\u1EC1\u1EBF\u1EC5\u1EC3\u1EBD\u0113\u1E15\u1E17\u0115\u0117\xEB\u1EBB\u011B\u0205\u0207\u1EB9\u1EC7\u0229\u1E1D\u0119\u1E19\u1E1B\u0247\u025B\u01DD"},{base:"f",letters:"f\u24D5\uFF46\u1E1F\u0192\uA77C"},{base:"g",letters:"g\u24D6\uFF47\u01F5\u011D\u1E21\u011F\u0121\u01E7\u0123\u01E5\u0260\uA7A1\u1D79\uA77F"},{base:"h",letters:"h\u24D7\uFF48\u0125\u1E23\u1E27\u021F\u1E25\u1E29\u1E2B\u1E96\u0127\u2C68\u2C76\u0265"},{base:"hv",letters:"\u0195"},{base:"i",letters:"i\u24D8\uFF49\xEC\xED\xEE\u0129\u012B\u012D\xEF\u1E2F\u1EC9\u01D0\u0209\u020B\u1ECB\u012F\u1E2D\u0268\u0131"},{base:"j",letters:"j\u24D9\uFF4A\u0135\u01F0\u0249"},{base:"k",letters:"k\u24DA\uFF4B\u1E31\u01E9\u1E33\u0137\u1E35\u0199\u2C6A\uA741\uA743\uA745\uA7A3"},{base:"l",letters:"l\u24DB\uFF4C\u0140\u013A\u013E\u1E37\u1E39\u013C\u1E3D\u1E3B\u017F\u0142\u019A\u026B\u2C61\uA749\uA781\uA747"},{base:"lj",letters:"\u01C9"},{base:"m",letters:"m\u24DC\uFF4D\u1E3F\u1E41\u1E43\u0271\u026F"},{base:"n",letters:"n\u24DD\uFF4E\u01F9\u0144\xF1\u1E45\u0148\u1E47\u0146\u1E4B\u1E49\u019E\u0272\u0149\uA791\uA7A5"},{base:"nj",letters:"\u01CC"},{base:"o",letters:"o\u24DE\uFF4F\xF2\xF3\xF4\u1ED3\u1ED1\u1ED7\u1ED5\xF5\u1E4D\u022D\u1E4F\u014D\u1E51\u1E53\u014F\u022F\u0231\xF6\u022B\u1ECF\u0151\u01D2\u020D\u020F\u01A1\u1EDD\u1EDB\u1EE1\u1EDF\u1EE3\u1ECD\u1ED9\u01EB\u01ED\xF8\u01FF\u0254\uA74B\uA74D\u0275"},{base:"oi",letters:"\u01A3"},{base:"ou",letters:"\u0223"},{base:"oo",letters:"\uA74F"},{base:"p",letters:"p\u24DF\uFF50\u1E55\u1E57\u01A5\u1D7D\uA751\uA753\uA755"},{base:"q",letters:"q\u24E0\uFF51\u024B\uA757\uA759"},{base:"r",letters:"r\u24E1\uFF52\u0155\u1E59\u0159\u0211\u0213\u1E5B\u1E5D\u0157\u1E5F\u024D\u027D\uA75B\uA7A7\uA783"},{base:"s",letters:"s\u24E2\uFF53\xDF\u015B\u1E65\u015D\u1E61\u0161\u1E67\u1E63\u1E69\u0219\u015F\u023F\uA7A9\uA785\u1E9B"},{base:"t",letters:"t\u24E3\uFF54\u1E6B\u1E97\u0165\u1E6D\u021B\u0163\u1E71\u1E6F\u0167\u01AD\u0288\u2C66\uA787"},{base:"tz",letters:"\uA729"},{base:"u",letters:"u\u24E4\uFF55\xF9\xFA\xFB\u0169\u1E79\u016B\u1E7B\u016D\xFC\u01DC\u01D8\u01D6\u01DA\u1EE7\u016F\u0171\u01D4\u0215\u0217\u01B0\u1EEB\u1EE9\u1EEF\u1EED\u1EF1\u1EE5\u1E73\u0173\u1E77\u1E75\u0289"},{base:"v",letters:"v\u24E5\uFF56\u1E7D\u1E7F\u028B\uA75F\u028C"},{base:"vy",letters:"\uA761"},{base:"w",letters:"w\u24E6\uFF57\u1E81\u1E83\u0175\u1E87\u1E85\u1E98\u1E89\u2C73"},{base:"x",letters:"x\u24E7\uFF58\u1E8B\u1E8D"},{base:"y",letters:"y\u24E8\uFF59\u1EF3\xFD\u0177\u1EF9\u0233\u1E8F\xFF\u1EF7\u1E99\u1EF5\u01B4\u024F\u1EFF"},{base:"z",letters:"z\u24E9\uFF5A\u017A\u1E91\u017C\u017E\u1E93\u1E95\u01B6\u0225\u0240\u2C6C\uA763"}],z5=new RegExp("["+Yh.map(function(t){return t.letters}).join("")+"]","g"),Xw={};for(om=0;om<Yh.length;om++)for(rm=Yh[om],nm=0;nm<rm.letters.length;nm++)Xw[rm.letters[nm]]=rm.base;var rm,nm,om,Uw=function(e){return e.replace(z5,function(o){return Xw[o]})},X5=Pw(Uw),Lw=function(e){return e.replace(/^\s+|\s+$/g,"")},U5=function(e){return"".concat(e.label," ").concat(e.value)},Y5=function(e){return function(o,n){if(o.data.__isNew__)return!0;var r=Re({ignoreCase:!0,ignoreAccents:!0,stringify:U5,trim:!0,matchFrom:"any"},e),s=r.ignoreCase,i=r.ignoreAccents,a=r.stringify,l=r.trim,c=r.matchFrom,u=l?Lw(n):n,d=l?Lw(a(o)):a(o);return s&&(u=u.toLowerCase(),d=d.toLowerCase()),i&&(u=X5(u),d=Uw(d)),c==="start"?d.substr(0,u.length)===u:d.indexOf(u)>-1}},Z5=["innerRef"];function J5(t){var e=t.innerRef,o=Vo(t,Z5),n=QC(o,"onExited","in","enter","exit","appear");return Te("input",Ie({ref:e},n,{css:Xl({label:"dummyInput",background:0,border:0,caretColor:"transparent",fontSize:"inherit",gridArea:"1 / 1 / 2 / 3",outline:0,padding:0,width:1,color:"transparent",left:-100,opacity:0,position:"relative",transform:"scale(.01)"},"","")}))}var q5=function(e){e.cancelable&&e.preventDefault(),e.stopPropagation()};function Q5(t){var e=t.isEnabled,o=t.onBottomArrive,n=t.onBottomLeave,r=t.onTopArrive,s=t.onTopLeave,i=ma(!1),a=ma(!1),l=ma(0),c=ma(null),u=rs(function(g,b){if(c.current!==null){var v=c.current,x=v.scrollTop,y=v.scrollHeight,C=v.clientHeight,S=c.current,w=b>0,D=y-C-x,_=!1;D>b&&i.current&&(n&&n(g),i.current=!1),w&&a.current&&(s&&s(g),a.current=!1),w&&b>D?(o&&!i.current&&o(g),S.scrollTop=y,_=!0,i.current=!0):!w&&-b>x&&(r&&!a.current&&r(g),S.scrollTop=0,_=!0,a.current=!0),_&&q5(g)}},[o,n,r,s]),d=rs(function(g){u(g,g.deltaY)},[u]),f=rs(function(g){l.current=g.changedTouches[0].clientY},[]),m=rs(function(g){var b=l.current-g.changedTouches[0].clientY;u(g,b)},[u]),h=rs(function(g){if(g){var b=JC?{passive:!1}:!1;g.addEventListener("wheel",d,b),g.addEventListener("touchstart",f,b),g.addEventListener("touchmove",m,b)}},[m,f,d]),p=rs(function(g){g&&(g.removeEventListener("wheel",d,!1),g.removeEventListener("touchstart",f,!1),g.removeEventListener("touchmove",m,!1))},[m,f,d]);return zw(function(){if(e){var g=c.current;return h(g),function(){p(g)}}},[e,h,p]),function(g){c.current=g}}var $w=["boxSizing","height","overflow","paddingRight","position"],kw={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function jw(t){t.cancelable&&t.preventDefault()}function Ow(t){t.stopPropagation()}function Mw(){var t=this.scrollTop,e=this.scrollHeight,o=t+this.offsetHeight;t===0?this.scrollTop=1:o===e&&(this.scrollTop=t-1)}function Bw(){return"ontouchstart"in window||navigator.maxTouchPoints}var Vw=!!(typeof window<"u"&&window.document&&window.document.createElement),Jl=0,da={capture:!1,passive:!1};function K5(t){var e=t.isEnabled,o=t.accountForScrollbars,n=o===void 0?!0:o,r=ma({}),s=ma(null),i=rs(function(l){if(Vw){var c=document.body,u=c&&c.style;if(n&&$w.forEach(function(h){var p=u&&u[h];r.current[h]=p}),n&&Jl<1){var d=parseInt(r.current.paddingRight,10)||0,f=document.body?document.body.clientWidth:0,m=window.innerWidth-f+d||0;Object.keys(kw).forEach(function(h){var p=kw[h];u&&(u[h]=p)}),u&&(u.paddingRight="".concat(m,"px"))}c&&Bw()&&(c.addEventListener("touchmove",jw,da),l&&(l.addEventListener("touchstart",Mw,da),l.addEventListener("touchmove",Ow,da))),Jl+=1}},[n]),a=rs(function(l){if(Vw){var c=document.body,u=c&&c.style;Jl=Math.max(Jl-1,0),n&&Jl<1&&$w.forEach(function(d){var f=r.current[d];u&&(u[d]=f)}),c&&Bw()&&(c.removeEventListener("touchmove",jw,da),l&&(l.removeEventListener("touchstart",Mw,da),l.removeEventListener("touchmove",Ow,da)))}},[n]);return zw(function(){if(e){var l=s.current;return i(l),function(){a(l)}}},[e,i,a]),function(l){s.current=l}}var eN=function(e){var o=e.target;return o.ownerDocument.activeElement&&o.ownerDocument.activeElement.blur()},tN={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function oN(t){var e=t.children,o=t.lockEnabled,n=t.captureEnabled,r=n===void 0?!0:n,s=t.onBottomArrive,i=t.onBottomLeave,a=t.onTopArrive,l=t.onTopLeave,c=Q5({isEnabled:r,onBottomArrive:s,onBottomLeave:i,onTopArrive:a,onTopLeave:l}),u=K5({isEnabled:o}),d=function(m){c(m),u(m)};return Te(Uh,null,o&&Te("div",{onClick:eN,css:tN}),e(d))}var rN={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},nN=function(e){var o=e.name,n=e.onFocus;return Te("input",{required:!0,name:o,tabIndex:-1,"aria-hidden":"true",onFocus:n,css:rN,value:"",onChange:function(){}})},sN=nN;function Zh(t){var e;return typeof window<"u"&&window.navigator!=null?t.test(((e=window.navigator.userAgentData)===null||e===void 0?void 0:e.platform)||window.navigator.platform):!1}function iN(){return Zh(/^iPhone/i)}function Yw(){return Zh(/^Mac/i)}function aN(){return Zh(/^iPad/i)||Yw()&&navigator.maxTouchPoints>1}function lN(){return iN()||aN()}function cN(){return Yw()||lN()}var uN=function(e){return e.label},Jh=function(e){return e.label},qh=function(e){return e.value},dN=function(e){return!!e.isDisabled},mN={clearIndicator:hw,container:lw,control:vw,dropdownIndicator:pw,group:xw,groupHeading:yw,indicatorsContainer:uw,indicatorSeparator:gw,input:Cw,loadingIndicator:bw,loadingMessage:iw,menu:ew,menuList:rw,menuPortal:aw,multiValue:Sw,multiValueLabel:Iw,multiValueRemove:Rw,noOptionsMessage:sw,option:Dw,placeholder:Fw,singleValue:Aw,valueContainer:cw};var fN={primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},pN=4,Zw=4,hN=38,gN=Zw*2,bN={baseUnit:Zw,controlHeight:hN,menuGutter:gN},zh={borderRadius:pN,colors:fN,spacing:bN},vN={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:Wh(),captureMenuScroll:!Wh(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:Y5(),formatGroupLabel:uN,getOptionLabel:Jh,getOptionValue:qh,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:dN,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!YC(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(e){var o=e.count;return"".concat(o," result").concat(o!==1?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0,unstyled:!1};function Gw(t,e,o,n){var r=Qw(t,e,o),s=Kw(t,e,o),i=qw(t,e),a=im(t,e);return{type:"option",data:e,isDisabled:r,isSelected:s,label:i,value:a,index:n}}function sm(t,e){return t.options.map(function(o,n){if("options"in o){var r=o.options.map(function(i,a){return Gw(t,i,e,a)}).filter(function(i){return Hw(t,i)});return r.length>0?{type:"group",data:o,options:r,index:n}:void 0}var s=Gw(t,o,e,n);return Hw(t,s)?s:void 0}).filter(qC)}function Jw(t){return t.reduce(function(e,o){return o.type==="group"?e.push.apply(e,ts(o.options.map(function(n){return n.data}))):e.push(o.data),e},[])}function Ww(t,e){return t.reduce(function(o,n){return n.type==="group"?o.push.apply(o,ts(n.options.map(function(r){return{data:r.data,id:"".concat(e,"-").concat(n.index,"-").concat(r.index)}}))):o.push({data:n.data,id:"".concat(e,"-").concat(n.index)}),o},[])}function xN(t,e){return Jw(sm(t,e))}function Hw(t,e){var o=t.inputValue,n=o===void 0?"":o,r=e.data,s=e.isSelected,i=e.label,a=e.value;return(!t2(t)||!s)&&e2(t,{label:i,value:a,data:r},n)}function yN(t,e){var o=t.focusedValue,n=t.selectValue,r=n.indexOf(o);if(r>-1){var s=e.indexOf(o);if(s>-1)return o;if(r<e.length)return e[r]}return null}function CN(t,e){var o=t.focusedOption;return o&&e.indexOf(o)>-1?o:e[0]}var Xh=function(e,o){var n,r=(n=e.find(function(s){return s.data===o}))===null||n===void 0?void 0:n.id;return r||null},qw=function(e,o){return e.getOptionLabel(o)},im=function(e,o){return e.getOptionValue(o)};function Qw(t,e,o){return typeof t.isOptionDisabled=="function"?t.isOptionDisabled(e,o):!1}function Kw(t,e,o){if(o.indexOf(e)>-1)return!0;if(typeof t.isOptionSelected=="function")return t.isOptionSelected(e,o);var n=im(t,e);return o.some(function(r){return im(t,r)===n})}function e2(t,e,o){return t.filterOption?t.filterOption(e,o):!0}var t2=function(e){var o=e.hideSelectedOptions,n=e.isMulti;return o===void 0?n:o},wN=1,ql=function(t){zy(o,t);var e=Uy(o);function o(n){var r;if(Gy(this,o),r=e.call(this,n),r.state={ariaSelection:null,focusedOption:null,focusedOptionId:null,focusableOptionsWithIds:[],focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0,instancePrefix:""},r.blockOptionHover=!1,r.isComposing=!1,r.commonProps=void 0,r.initialTouchX=0,r.initialTouchY=0,r.openAfterFocus=!1,r.scrollToFocusedOptionOnUpdate=!1,r.userIsDragging=void 0,r.isAppleDevice=cN(),r.controlRef=null,r.getControlRef=function(l){r.controlRef=l},r.focusedOptionRef=null,r.getFocusedOptionRef=function(l){r.focusedOptionRef=l},r.menuListRef=null,r.getMenuListRef=function(l){r.menuListRef=l},r.inputRef=null,r.getInputRef=function(l){r.inputRef=l},r.focus=r.focusInput,r.blur=r.blurInput,r.onChange=function(l,c){var u=r.props,d=u.onChange,f=u.name;c.name=f,r.ariaOnChange(l,c),d(l,c)},r.setValue=function(l,c,u){var d=r.props,f=d.closeMenuOnSelect,m=d.isMulti,h=d.inputValue;r.onInputChange("",{action:"set-value",prevInputValue:h}),f&&(r.setState({inputIsHiddenAfterUpdate:!m}),r.onMenuClose()),r.setState({clearFocusValueOnUpdate:!0}),r.onChange(l,{action:c,option:u})},r.selectOption=function(l){var c=r.props,u=c.blurInputOnSelect,d=c.isMulti,f=c.name,m=r.state.selectValue,h=d&&r.isOptionSelected(l,m),p=r.isOptionDisabled(l,m);if(h){var g=r.getOptionValue(l);r.setValue(m.filter(function(b){return r.getOptionValue(b)!==g}),"deselect-option",l)}else if(!p)d?r.setValue([].concat(ts(m),[l]),"select-option",l):r.setValue(l,"select-option");else{r.ariaOnChange(l,{action:"select-option",option:l,name:f});return}u&&r.blurInput()},r.removeValue=function(l){var c=r.props.isMulti,u=r.state.selectValue,d=r.getOptionValue(l),f=u.filter(function(h){return r.getOptionValue(h)!==d}),m=Ks(c,f,f[0]||null);r.onChange(m,{action:"remove-value",removedValue:l}),r.focusInput()},r.clearValue=function(){var l=r.state.selectValue;r.onChange(Ks(r.props.isMulti,[],null),{action:"clear",removedValues:l})},r.popValue=function(){var l=r.props.isMulti,c=r.state.selectValue,u=c[c.length-1],d=c.slice(0,c.length-1),f=Ks(l,d,d[0]||null);u&&r.onChange(f,{action:"pop-value",removedValue:u})},r.getFocusedOptionId=function(l){return Xh(r.state.focusableOptionsWithIds,l)},r.getFocusableOptionsWithIds=function(){return Ww(sm(r.props,r.state.selectValue),r.getElementId("option"))},r.getValue=function(){return r.state.selectValue},r.cx=function(){for(var l=arguments.length,c=new Array(l),u=0;u<l;u++)c[u]=arguments[u];return zC.apply(void 0,[r.props.classNamePrefix].concat(c))},r.getOptionLabel=function(l){return qw(r.props,l)},r.getOptionValue=function(l){return im(r.props,l)},r.getStyles=function(l,c){var u=r.props.unstyled,d=mN[l](c,u);d.boxSizing="border-box";var f=r.props.styles[l];return f?f(d,c):d},r.getClassNames=function(l,c){var u,d;return(u=(d=r.props.classNames)[l])===null||u===void 0?void 0:u.call(d,c)},r.getElementId=function(l){return"".concat(r.state.instancePrefix,"-").concat(l)},r.getComponents=function(){return Tw(r.props)},r.buildCategorizedOptions=function(){return sm(r.props,r.state.selectValue)},r.getCategorizedOptions=function(){return r.props.menuIsOpen?r.buildCategorizedOptions():[]},r.buildFocusableOptions=function(){return Jw(r.buildCategorizedOptions())},r.getFocusableOptions=function(){return r.props.menuIsOpen?r.buildFocusableOptions():[]},r.ariaOnChange=function(l,c){r.setState({ariaSelection:Re({value:l},c)})},r.onMenuMouseDown=function(l){l.button===0&&(l.stopPropagation(),l.preventDefault(),r.focusInput())},r.onMenuMouseMove=function(l){r.blockOptionHover=!1},r.onControlMouseDown=function(l){if(!l.defaultPrevented){var c=r.props.openMenuOnClick;r.state.isFocused?r.props.menuIsOpen?l.target.tagName!=="INPUT"&&l.target.tagName!=="TEXTAREA"&&r.onMenuClose():c&&r.openMenu("first"):(c&&(r.openAfterFocus=!0),r.focusInput()),l.target.tagName!=="INPUT"&&l.target.tagName!=="TEXTAREA"&&l.preventDefault()}},r.onDropdownIndicatorMouseDown=function(l){if(!(l&&l.type==="mousedown"&&l.button!==0)&&!r.props.isDisabled){var c=r.props,u=c.isMulti,d=c.menuIsOpen;r.focusInput(),d?(r.setState({inputIsHiddenAfterUpdate:!u}),r.onMenuClose()):r.openMenu("first"),l.preventDefault()}},r.onClearIndicatorMouseDown=function(l){l&&l.type==="mousedown"&&l.button!==0||(r.clearValue(),l.preventDefault(),r.openAfterFocus=!1,l.type==="touchend"?r.focusInput():setTimeout(function(){return r.focusInput()}))},r.onScroll=function(l){typeof r.props.closeMenuOnScroll=="boolean"?l.target instanceof HTMLElement&&Yl(l.target)&&r.props.onMenuClose():typeof r.props.closeMenuOnScroll=="function"&&r.props.closeMenuOnScroll(l)&&r.props.onMenuClose()},r.onCompositionStart=function(){r.isComposing=!0},r.onCompositionEnd=function(){r.isComposing=!1},r.onTouchStart=function(l){var c=l.touches,u=c&&c.item(0);u&&(r.initialTouchX=u.clientX,r.initialTouchY=u.clientY,r.userIsDragging=!1)},r.onTouchMove=function(l){var c=l.touches,u=c&&c.item(0);if(u){var d=Math.abs(u.clientX-r.initialTouchX),f=Math.abs(u.clientY-r.initialTouchY),m=5;r.userIsDragging=d>m||f>m}},r.onTouchEnd=function(l){r.userIsDragging||(r.controlRef&&!r.controlRef.contains(l.target)&&r.menuListRef&&!r.menuListRef.contains(l.target)&&r.blurInput(),r.initialTouchX=0,r.initialTouchY=0)},r.onControlTouchEnd=function(l){r.userIsDragging||r.onControlMouseDown(l)},r.onClearIndicatorTouchEnd=function(l){r.userIsDragging||r.onClearIndicatorMouseDown(l)},r.onDropdownIndicatorTouchEnd=function(l){r.userIsDragging||r.onDropdownIndicatorMouseDown(l)},r.handleInputChange=function(l){var c=r.props.inputValue,u=l.currentTarget.value;r.setState({inputIsHiddenAfterUpdate:!1}),r.onInputChange(u,{action:"input-change",prevInputValue:c}),r.props.menuIsOpen||r.onMenuOpen()},r.onInputFocus=function(l){r.props.onFocus&&r.props.onFocus(l),r.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(r.openAfterFocus||r.props.openMenuOnFocus)&&r.openMenu("first"),r.openAfterFocus=!1},r.onInputBlur=function(l){var c=r.props.inputValue;if(r.menuListRef&&r.menuListRef.contains(document.activeElement)){r.inputRef.focus();return}r.props.onBlur&&r.props.onBlur(l),r.onInputChange("",{action:"input-blur",prevInputValue:c}),r.onMenuClose(),r.setState({focusedValue:null,isFocused:!1})},r.onOptionHover=function(l){if(!(r.blockOptionHover||r.state.focusedOption===l)){var c=r.getFocusableOptions(),u=c.indexOf(l);r.setState({focusedOption:l,focusedOptionId:u>-1?r.getFocusedOptionId(l):null})}},r.shouldHideSelectedOptions=function(){return t2(r.props)},r.onValueInputFocus=function(l){l.preventDefault(),l.stopPropagation(),r.focus()},r.onKeyDown=function(l){var c=r.props,u=c.isMulti,d=c.backspaceRemovesValue,f=c.escapeClearsValue,m=c.inputValue,h=c.isClearable,p=c.isDisabled,g=c.menuIsOpen,b=c.onKeyDown,v=c.tabSelectsValue,x=c.openMenuOnFocus,y=r.state,C=y.focusedOption,S=y.focusedValue,w=y.selectValue;if(!p&&!(typeof b=="function"&&(b(l),l.defaultPrevented))){switch(r.blockOptionHover=!0,l.key){case"ArrowLeft":if(!u||m)return;r.focusValue("previous");break;case"ArrowRight":if(!u||m)return;r.focusValue("next");break;case"Delete":case"Backspace":if(m)return;if(S)r.removeValue(S);else{if(!d)return;u?r.popValue():h&&r.clearValue()}break;case"Tab":if(r.isComposing||l.shiftKey||!g||!v||!C||x&&r.isOptionSelected(C,w))return;r.selectOption(C);break;case"Enter":if(l.keyCode===229)break;if(g){if(!C||r.isComposing)return;r.selectOption(C);break}return;case"Escape":g?(r.setState({inputIsHiddenAfterUpdate:!1}),r.onInputChange("",{action:"menu-close",prevInputValue:m}),r.onMenuClose()):h&&f&&r.clearValue();break;case" ":if(m)return;if(!g){r.openMenu("first");break}if(!C)return;r.selectOption(C);break;case"ArrowUp":g?r.focusOption("up"):r.openMenu("last");break;case"ArrowDown":g?r.focusOption("down"):r.openMenu("first");break;case"PageUp":if(!g)return;r.focusOption("pageup");break;case"PageDown":if(!g)return;r.focusOption("pagedown");break;case"Home":if(!g)return;r.focusOption("first");break;case"End":if(!g)return;r.focusOption("last");break;default:return}l.preventDefault()}},r.state.instancePrefix="react-select-"+(r.props.instanceId||++wN),r.state.selectValue=ua(n.value),n.menuIsOpen&&r.state.selectValue.length){var s=r.getFocusableOptionsWithIds(),i=r.buildFocusableOptions(),a=i.indexOf(r.state.selectValue[0]);r.state.focusableOptionsWithIds=s,r.state.focusedOption=i[a],r.state.focusedOptionId=Xh(s,i[a])}return r}return Hy(o,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput(),this.props.menuIsOpen&&this.state.focusedOption&&this.menuListRef&&this.focusedOptionRef&&Gh(this.menuListRef,this.focusedOptionRef)}},{key:"componentDidUpdate",value:function(r){var s=this.props,i=s.isDisabled,a=s.menuIsOpen,l=this.state.isFocused;(l&&!i&&r.isDisabled||l&&a&&!r.menuIsOpen)&&this.focusInput(),l&&i&&!r.isDisabled?this.setState({isFocused:!1},this.onMenuClose):!l&&!i&&r.isDisabled&&this.inputRef===document.activeElement&&this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(Gh(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){this.onInputChange("",{action:"menu-close",prevInputValue:this.props.inputValue}),this.props.onMenuClose()}},{key:"onInputChange",value:function(r,s){this.props.onInputChange(r,s)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(r){var s=this,i=this.state,a=i.selectValue,l=i.isFocused,c=this.buildFocusableOptions(),u=r==="first"?0:c.length-1;if(!this.props.isMulti){var d=c.indexOf(a[0]);d>-1&&(u=d)}this.scrollToFocusedOptionOnUpdate=!(l&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:c[u],focusedOptionId:this.getFocusedOptionId(c[u])},function(){return s.onMenuOpen()})}},{key:"focusValue",value:function(r){var s=this.state,i=s.selectValue,a=s.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var l=i.indexOf(a);a||(l=-1);var c=i.length-1,u=-1;if(i.length){switch(r){case"previous":l===0?u=0:l===-1?u=c:u=l-1;break;case"next":l>-1&&l<c&&(u=l+1);break}this.setState({inputIsHidden:u!==-1,focusedValue:i[u]})}}}},{key:"focusOption",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"first",s=this.props.pageSize,i=this.state.focusedOption,a=this.getFocusableOptions();if(a.length){var l=0,c=a.indexOf(i);i||(c=-1),r==="up"?l=c>0?c-1:a.length-1:r==="down"?l=(c+1)%a.length:r==="pageup"?(l=c-s,l<0&&(l=0)):r==="pagedown"?(l=c+s,l>a.length-1&&(l=a.length-1)):r==="last"&&(l=a.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:a[l],focusedValue:null,focusedOptionId:this.getFocusedOptionId(a[l])})}}},{key:"getTheme",value:function(){return this.props.theme?typeof this.props.theme=="function"?this.props.theme(zh):Re(Re({},zh),this.props.theme):zh}},{key:"getCommonProps",value:function(){var r=this.clearValue,s=this.cx,i=this.getStyles,a=this.getClassNames,l=this.getValue,c=this.selectOption,u=this.setValue,d=this.props,f=d.isMulti,m=d.isRtl,h=d.options,p=this.hasValue();return{clearValue:r,cx:s,getStyles:i,getClassNames:a,getValue:l,hasValue:p,isMulti:f,isRtl:m,options:h,selectOption:c,selectProps:d,setValue:u,theme:this.getTheme()}}},{key:"hasValue",value:function(){var r=this.state.selectValue;return r.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var r=this.props,s=r.isClearable,i=r.isMulti;return s===void 0?i:s}},{key:"isOptionDisabled",value:function(r,s){return Qw(this.props,r,s)}},{key:"isOptionSelected",value:function(r,s){return Kw(this.props,r,s)}},{key:"filterOption",value:function(r,s){return e2(this.props,r,s)}},{key:"formatOptionLabel",value:function(r,s){if(typeof this.props.formatOptionLabel=="function"){var i=this.props.inputValue,a=this.state.selectValue;return this.props.formatOptionLabel(r,{context:s,inputValue:i,selectValue:a})}else return this.getOptionLabel(r)}},{key:"formatGroupLabel",value:function(r){return this.props.formatGroupLabel(r)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:function(){var r=this.props,s=r.isDisabled,i=r.isSearchable,a=r.inputId,l=r.inputValue,c=r.tabIndex,u=r.form,d=r.menuIsOpen,f=r.required,m=this.getComponents(),h=m.Input,p=this.state,g=p.inputIsHidden,b=p.ariaSelection,v=this.commonProps,x=a||this.getElementId("input"),y=Re(Re(Re({"aria-autocomplete":"list","aria-expanded":d,"aria-haspopup":!0,"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props["aria-invalid"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-required":f,role:"combobox","aria-activedescendant":this.isAppleDevice?void 0:this.state.focusedOptionId||""},d&&{"aria-controls":this.getElementId("listbox")}),!i&&{"aria-readonly":!0}),this.hasValue()?b?.action==="initial-input-focus"&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return i?ut.createElement(h,Ie({},v,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:x,innerRef:this.getInputRef,isDisabled:s,isHidden:g,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:c,form:u,type:"text",value:l},y)):ut.createElement(J5,Ie({id:x,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:Ul,onFocus:this.onInputFocus,disabled:s,tabIndex:c,inputMode:"none",form:u,value:""},y))}},{key:"renderPlaceholderOrValue",value:function(){var r=this,s=this.getComponents(),i=s.MultiValue,a=s.MultiValueContainer,l=s.MultiValueLabel,c=s.MultiValueRemove,u=s.SingleValue,d=s.Placeholder,f=this.commonProps,m=this.props,h=m.controlShouldRenderValue,p=m.isDisabled,g=m.isMulti,b=m.inputValue,v=m.placeholder,x=this.state,y=x.selectValue,C=x.focusedValue,S=x.isFocused;if(!this.hasValue()||!h)return b?null:ut.createElement(d,Ie({},f,{key:"placeholder",isDisabled:p,isFocused:S,innerProps:{id:this.getElementId("placeholder")}}),v);if(g)return y.map(function(D,_){var A=D===C,F="".concat(r.getOptionLabel(D),"-").concat(r.getOptionValue(D));return ut.createElement(i,Ie({},f,{components:{Container:a,Label:l,Remove:c},isFocused:A,isDisabled:p,key:F,index:_,removeProps:{onClick:function(){return r.removeValue(D)},onTouchEnd:function(){return r.removeValue(D)},onMouseDown:function(I){I.preventDefault()}},data:D}),r.formatOptionLabel(D,"value"))});if(b)return null;var w=y[0];return ut.createElement(u,Ie({},f,{data:w,isDisabled:p}),this.formatOptionLabel(w,"value"))}},{key:"renderClearIndicator",value:function(){var r=this.getComponents(),s=r.ClearIndicator,i=this.commonProps,a=this.props,l=a.isDisabled,c=a.isLoading,u=this.state.isFocused;if(!this.isClearable()||!s||l||!this.hasValue()||c)return null;var d={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return ut.createElement(s,Ie({},i,{innerProps:d,isFocused:u}))}},{key:"renderLoadingIndicator",value:function(){var r=this.getComponents(),s=r.LoadingIndicator,i=this.commonProps,a=this.props,l=a.isDisabled,c=a.isLoading,u=this.state.isFocused;if(!s||!c)return null;var d={"aria-hidden":"true"};return ut.createElement(s,Ie({},i,{innerProps:d,isDisabled:l,isFocused:u}))}},{key:"renderIndicatorSeparator",value:function(){var r=this.getComponents(),s=r.DropdownIndicator,i=r.IndicatorSeparator;if(!s||!i)return null;var a=this.commonProps,l=this.props.isDisabled,c=this.state.isFocused;return ut.createElement(i,Ie({},a,{isDisabled:l,isFocused:c}))}},{key:"renderDropdownIndicator",value:function(){var r=this.getComponents(),s=r.DropdownIndicator;if(!s)return null;var i=this.commonProps,a=this.props.isDisabled,l=this.state.isFocused,c={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return ut.createElement(s,Ie({},i,{innerProps:c,isDisabled:a,isFocused:l}))}},{key:"renderMenu",value:function(){var r=this,s=this.getComponents(),i=s.Group,a=s.GroupHeading,l=s.Menu,c=s.MenuList,u=s.MenuPortal,d=s.LoadingMessage,f=s.NoOptionsMessage,m=s.Option,h=this.commonProps,p=this.state.focusedOption,g=this.props,b=g.captureMenuScroll,v=g.inputValue,x=g.isLoading,y=g.loadingMessage,C=g.minMenuHeight,S=g.maxMenuHeight,w=g.menuIsOpen,D=g.menuPlacement,_=g.menuPosition,A=g.menuPortalTarget,F=g.menuShouldBlockScroll,R=g.menuShouldScrollIntoView,I=g.noOptionsMessage,E=g.onMenuScrollToTop,T=g.onMenuScrollToBottom;if(!w)return null;var $=function(O,B){var G=O.type,X=O.data,Z=O.isDisabled,te=O.isSelected,U=O.label,z=O.value,ce=p===X,J=Z?void 0:function(){return r.onOptionHover(X)},ue=Z?void 0:function(){return r.selectOption(X)},re="".concat(r.getElementId("option"),"-").concat(B),q={id:re,onClick:ue,onMouseMove:J,onMouseOver:J,tabIndex:-1,role:"option","aria-selected":r.isAppleDevice?void 0:te};return ut.createElement(m,Ie({},h,{innerProps:q,data:X,isDisabled:Z,isSelected:te,key:re,label:U,type:G,value:z,isFocused:ce,innerRef:ce?r.getFocusedOptionRef:void 0}),r.formatOptionLabel(O.data,"menu"))},j;if(this.hasOptions())j=this.getCategorizedOptions().map(function(M){if(M.type==="group"){var O=M.data,B=M.options,G=M.index,X="".concat(r.getElementId("group"),"-").concat(G),Z="".concat(X,"-heading");return ut.createElement(i,Ie({},h,{key:X,data:O,options:B,Heading:a,headingProps:{id:Z,data:M.data},label:r.formatGroupLabel(M.data)}),M.options.map(function(te){return $(te,"".concat(G,"-").concat(te.index))}))}else if(M.type==="option")return $(M,"".concat(M.index))});else if(x){var N=y({inputValue:v});if(N===null)return null;j=ut.createElement(d,h,N)}else{var P=I({inputValue:v});if(P===null)return null;j=ut.createElement(f,h,P)}var L={minMenuHeight:C,maxMenuHeight:S,menuPlacement:D,menuPosition:_,menuShouldScrollIntoView:R},V=ut.createElement(ow,Ie({},h,L),function(M){var O=M.ref,B=M.placerProps,G=B.placement,X=B.maxHeight;return ut.createElement(l,Ie({},h,L,{innerRef:O,innerProps:{onMouseDown:r.onMenuMouseDown,onMouseMove:r.onMenuMouseMove},isLoading:x,placement:G}),ut.createElement(oN,{captureEnabled:b,onTopArrive:E,onBottomArrive:T,lockEnabled:F},function(Z){return ut.createElement(c,Ie({},h,{innerRef:function(U){r.getMenuListRef(U),Z(U)},innerProps:{role:"listbox","aria-multiselectable":h.isMulti,id:r.getElementId("listbox")},isLoading:x,maxHeight:X,focusedOption:p}),j)}))});return A||_==="fixed"?ut.createElement(u,Ie({},h,{appendTo:A,controlElement:this.controlRef,menuPlacement:D,menuPosition:_}),V):V}},{key:"renderFormField",value:function(){var r=this,s=this.props,i=s.delimiter,a=s.isDisabled,l=s.isMulti,c=s.name,u=s.required,d=this.state.selectValue;if(u&&!this.hasValue()&&!a)return ut.createElement(sN,{name:c,onFocus:this.onValueInputFocus});if(!(!c||a))if(l)if(i){var f=d.map(function(p){return r.getOptionValue(p)}).join(i);return ut.createElement("input",{name:c,type:"hidden",value:f})}else{var m=d.length>0?d.map(function(p,g){return ut.createElement("input",{key:"i-".concat(g),name:c,type:"hidden",value:r.getOptionValue(p)})}):ut.createElement("input",{name:c,type:"hidden",value:""});return ut.createElement("div",null,m)}else{var h=d[0]?this.getOptionValue(d[0]):"";return ut.createElement("input",{name:c,type:"hidden",value:h})}}},{key:"renderLiveRegion",value:function(){var r=this.commonProps,s=this.state,i=s.ariaSelection,a=s.focusedOption,l=s.focusedValue,c=s.isFocused,u=s.selectValue,d=this.getFocusableOptions();return ut.createElement(H5,Ie({},r,{id:this.getElementId("live-region"),ariaSelection:i,focusedOption:a,focusedValue:l,isFocused:c,selectValue:u,focusableOptions:d,isAppleDevice:this.isAppleDevice}))}},{key:"render",value:function(){var r=this.getComponents(),s=r.Control,i=r.IndicatorsContainer,a=r.SelectContainer,l=r.ValueContainer,c=this.props,u=c.className,d=c.id,f=c.isDisabled,m=c.menuIsOpen,h=this.state.isFocused,p=this.commonProps=this.getCommonProps();return ut.createElement(a,Ie({},p,{className:u,innerProps:{id:d,onKeyDown:this.onKeyDown},isDisabled:f,isFocused:h}),this.renderLiveRegion(),ut.createElement(s,Ie({},p,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:f,isFocused:h,menuIsOpen:m}),ut.createElement(l,Ie({},p,{isDisabled:f}),this.renderPlaceholderOrValue(),this.renderInput()),ut.createElement(i,Ie({},p,{isDisabled:f}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(r,s){var i=s.prevProps,a=s.clearFocusValueOnUpdate,l=s.inputIsHiddenAfterUpdate,c=s.ariaSelection,u=s.isFocused,d=s.prevWasFocused,f=s.instancePrefix,m=r.options,h=r.value,p=r.menuIsOpen,g=r.inputValue,b=r.isMulti,v=ua(h),x={};if(i&&(h!==i.value||m!==i.options||p!==i.menuIsOpen||g!==i.inputValue)){var y=p?xN(r,v):[],C=p?Ww(sm(r,v),"".concat(f,"-option")):[],S=a?yN(s,v):null,w=CN(s,y),D=Xh(C,w);x={selectValue:v,focusedOption:w,focusedOptionId:D,focusableOptionsWithIds:C,focusedValue:S,clearFocusValueOnUpdate:!1}}var _=l!=null&&r!==i?{inputIsHidden:l,inputIsHiddenAfterUpdate:void 0}:{},A=c,F=u&&d;return u&&!F&&(A={value:Ks(b,v,v[0]||null),options:v,action:"initial-input-focus"},F=!d),c?.action==="initial-input-focus"&&(A=null),Re(Re(Re({},x),_),{},{prevProps:r,ariaSelection:A,prevWasFocused:F})}}]),o}(M5);ql.defaultProps=vN;import"react-dom";var IN=SN(function(t,e){var o=Ad(t);return o2.createElement(ql,Ie({ref:e},o))}),r2=IN;import*as a2 from"react";import{forwardRef as DN}from"react";import{useMemo as n2,useCallback as RN}from"react";var _N=["allowCreateWhileLoading","createOptionPosition","formatCreateLabel","isValidNewOption","getNewOptionData","onCreateOption","options","onChange"],s2=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",o=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,r=String(e).toLowerCase(),s=String(n.getOptionValue(o)).toLowerCase(),i=String(n.getOptionLabel(o)).toLowerCase();return s===r||i===r},Qh={formatCreateLabel:function(e){return'Create "'.concat(e,'"')},isValidNewOption:function(e,o,n,r){return!(!e||o.some(function(s){return s2(e,s,r)})||n.some(function(s){return s2(e,s,r)}))},getNewOptionData:function(e,o){return{label:o,value:e,__isNew__:!0}}};function i2(t){var e=t.allowCreateWhileLoading,o=e===void 0?!1:e,n=t.createOptionPosition,r=n===void 0?"last":n,s=t.formatCreateLabel,i=s===void 0?Qh.formatCreateLabel:s,a=t.isValidNewOption,l=a===void 0?Qh.isValidNewOption:a,c=t.getNewOptionData,u=c===void 0?Qh.getNewOptionData:c,d=t.onCreateOption,f=t.options,m=f===void 0?[]:f,h=t.onChange,p=Vo(t,_N),g=p.getOptionValue,b=g===void 0?qh:g,v=p.getOptionLabel,x=v===void 0?Jh:v,y=p.inputValue,C=p.isLoading,S=p.isMulti,w=p.value,D=p.name,_=n2(function(){return l(y,ua(w),m,{getOptionValue:b,getOptionLabel:x})?u(y,i(y)):void 0},[i,u,x,b,y,l,m,w]),A=n2(function(){return(o||!C)&&_?r==="first"?[_].concat(ts(m)):[].concat(ts(m),[_]):m},[o,r,C,_,m]),F=RN(function(R,I){if(I.action!=="select-option")return h(R,I);var E=Array.isArray(R)?R:[R];if(E[E.length-1]===_){if(d)d(y);else{var T=u(y,y),$={action:"create-option",name:D,option:T};h(Ks(S,[].concat(ts(ua(w)),[T]),T),$)}return}h(R,I)},[u,y,S,D,_,d,h,w]);return Re(Re({},p),{},{options:A,onChange:F})}import"react-dom";var FN=DN(function(t,e){var o=Ad(t),n=i2(o);return a2.createElement(ql,Ie({ref:e},n))}),l2=FN;import{jsx as c2}from"react/jsx-runtime";import"react";var u2="clear-indicator",Kh=t=>{let{clearValue:e,innerProps:{ref:o,...n}}=t;return c2("div",{className:u2,ref:typeof o=="string"?null:o,...n,onKeyDown:r=>{r.key==="Enter"&&(e(),r.stopPropagation())},role:"button",tabIndex:0,children:c2(pt,{className:`${u2}__icon`})})};import{jsx as d2}from"react/jsx-runtime";import AN from"react";var eg=t=>{let{children:e,innerProps:o,selectProps:{customProps:{disableKeyDown:n,disableMouseDown:r}={}}={}}=t;return d2(AN.Fragment,{children:d2(co.Control,{...t,innerProps:{...o,onKeyDown:s=>{if(n){s.stopPropagation();let i=new CustomEvent("bypassKeyDown",{detail:s});document.dispatchEvent(i)}},onMouseDown:s=>{r||o.onMouseDown(s)}},children:e})})};import{jsx as m2}from"react/jsx-runtime";import"react";var f2="dropdown-indicator",tg=t=>{let{innerProps:{ref:e,...o}}=t;return m2("button",{className:f2,ref:e,...o,onKeyDown:n=>{n.key==="Enter"&&(n.key=" ")},type:"button",children:m2(Ze,{className:`${f2}__icon`})})};import{jsx as p2}from"react/jsx-runtime";import TN from"react";var og=t=>p2(TN.Fragment,{children:p2(co.Input,{...t,"aria-activedescendant":void 0})});import{c as EN}from"react/compiler-runtime";import{jsx as h2}from"react/jsx-runtime";import PN from"react";var g2="multi-value";function rg(t,e){return typeof e=="function"?e(t):t.value}var ng=t=>{let e=EN(26),{className:o,data:n,innerProps:r,isDisabled:s,selectProps:i}=t,a;e[0]!==i?(a=i===void 0?{}:i,e[0]=i,e[1]=a):a=e[1];let{customProps:l,getOptionValue:c,isSortable:u}=a,d;e[2]!==l?(d=l===void 0?{}:l,e[2]=l,e[3]=d):d=e[3];let{disableMouseDown:f}=d,m;e[4]!==n||e[5]!==c?(m=rg(n,c),e[4]=n,e[5]=c,e[6]=m):m=e[6];let h=!u,p;e[7]!==m||e[8]!==h?(p={id:m,disabled:h},e[7]=m,e[8]=h,e[9]=p):p=e[9];let{attributes:g,isDragging:b,listeners:v,setNodeRef:x,transform:y}=Oi(p),C=!s&&u&&"draggable",S=b&&`${g2}--is-dragging`,w;e[10]!==o||e[11]!==C||e[12]!==S?(w=[g2,o,C,S].filter(Boolean),e[10]=o,e[11]=C,e[12]=S,e[13]=w):w=e[13];let D=w.join(" "),_;if(e[14]!==g||e[15]!==D||e[16]!==f||e[17]!==r||e[18]!==u||e[19]!==v||e[20]!==t||e[21]!==x||e[22]!==y){let A;e[24]!==f?(A=F=>{f||F.stopPropagation()},e[24]=f,e[25]=A):A=e[25],_=h2(PN.Fragment,{children:h2(co.MultiValue,{...t,className:D,innerProps:{...u?{...g,...v}:{},...r,onMouseDown:A,ref:x,style:u?{transform:y,...g?.style}:{}}})}),e[14]=g,e[15]=D,e[16]=f,e[17]=r,e[18]=u,e[19]=v,e[20]=t,e[21]=x,e[22]=y,e[23]=_}else _=e[23];return _};import{jsx as b2}from"react/jsx-runtime";import"react";var v2="multi-value-label",sg=t=>{let{data:e,selectProps:{customProps:{draggableProps:o,editableProps:n}={}}={}}=t,r=`${v2}__text`;return b2("div",{className:v2,children:b2(co.MultiValueLabel,{...t,innerProps:{className:r,...n&&n(e,r,t.selectProps)||{},...o||{}}})})};import{c as NN}from"react/compiler-runtime";import{jsx as x2,jsxs as LN}from"react/jsx-runtime";import $N from"react";var ig="multi-value-remove",ag=t=>{let e=NN(12),{innerProps:o}=t,{className:n,onClick:r,onTouchEnd:s}=o,[i,a]=$N.useState(!1),{t:l}=k(),c;if(e[0]!==n||e[1]!==r||e[2]!==s||e[3]!==i||e[4]!==l){let u=l("general:remove"),d;e[6]!==n?(d=[ig,n].filter(Boolean),e[6]=n,e[7]=d):d=e[7];let f;e[8]!==r?(f=p=>{a(!1),r(p)},e[8]=r,e[9]=f):f=e[9];let m,h;e[10]===Symbol.for("react.memo_cache_sentinel")?(m=()=>a(!0),h=()=>a(!1),e[10]=m,e[11]=h):(m=e[10],h=e[11]),c=LN("button",{"aria-label":u,className:d.join(" "),onClick:f,onKeyDown:kN,onMouseDown:jN,onMouseEnter:m,onMouseLeave:h,onTouchEnd:s,type:"button",children:[x2(go,{className:`${ig}__tooltip`,show:i,children:l("general:remove")}),x2(pt,{className:`${ig}__icon`})]}),e[0]=n,e[1]=r,e[2]=s,e[3]=i,e[4]=l,e[5]=c}else c=e[5];return c};function kN(t){t.key==="Enter"&&t.stopPropagation()}function jN(t){return t.stopPropagation()}import{jsx as y2}from"react/jsx-runtime";import ON from"react";var MN="react-select--single-value",lg=t=>{let{children:e,className:o}=t;return y2(ON.Fragment,{children:y2(co.SingleValue,{...t,className:[MN,o].filter(Boolean).join(" "),children:e})})};import{jsx as C2}from"react/jsx-runtime";import"react";var BN="value-container",cg=t=>{let{selectProps:{customProps:e}={}}=t;return C2("div",{className:BN,ref:e?.droppableRef,children:C2(co.ValueContainer,{...t})})};var WN=t=>({label:t,value:t}),I2=t=>{let{i18n:e,t:o}=k(),[n,r]=S2.useState(""),s=GN(),[i,a]=S2.useState(!1);VN(()=>{a(!0)},[]);let{className:l,components:c,customProps:u,disabled:d=!1,filterOption:f=void 0,getOptionValue:m,isClearable:h=!0,isCreatable:p,isLoading:g,isSearchable:b=!0,noOptionsMessage:v=()=>o("general:noOptions"),numberOnly:x=!1,onChange:y,onMenuClose:C,onMenuOpen:S,options:w,placeholder:D=o("general:selectValue"),showError:_,value:A}=t,F=()=>o("general:loading")+"...",R=[l,"react-select",_&&"react-select--error"].filter(Boolean).join(" "),I={menu:T=>({...T,zIndex:void 0})};if(!i)return ei(St,{height:"calc(var(--base) * 2 + 2px)"});if(!p)return ei(r2,{captureMenuScroll:!0,customProps:u,isLoading:g,placeholder:w2(D,e),...t,className:R,classNamePrefix:"rs",components:{ClearIndicator:Kh,Control:eg,DropdownIndicator:tg,Input:og,MultiValue:ng,MultiValueLabel:sg,MultiValueRemove:ag,SingleValue:lg,ValueContainer:cg,...c},filterOption:f,getOptionValue:m,instanceId:s,isClearable:h,isDisabled:d,isSearchable:b,loadingMessage:F,menuPlacement:"auto",noOptionsMessage:v,onChange:y,onMenuClose:C,onMenuOpen:S,options:w,styles:I,unstyled:!0,value:A});let E=T=>{if(x===!0){let $=["Tab","Escape","Backspace","Enter","ArrowRight","ArrowLeft","ArrowUp","ArrowDown"],j=!/\D/.test(T.key),N=$.includes(T.key);if(!j&&!N){T.preventDefault();return}}if(!(!A||!n||n.trim()==="")&&!(f&&!f(null,n)))switch(T.key){case"Enter":case"Tab":y([...A,WN(n)]),r(""),T.preventDefault();break;default:break}};return ei(l2,{captureMenuScroll:!0,isLoading:g,placeholder:w2(D,e),...t,className:R,classNamePrefix:"rs",components:{ClearIndicator:Kh,Control:eg,DropdownIndicator:tg,Input:og,MultiValue:ng,MultiValueLabel:sg,MultiValueRemove:ag,SingleValue:lg,ValueContainer:cg,...c},filterOption:f,inputValue:n,instanceId:s,isClearable:h,isDisabled:d,isSearchable:b,loadingMessage:F,menuPlacement:"auto",noOptionsMessage:v,onChange:y,onInputChange:T=>r(T),onKeyDown:E,onMenuClose:C,onMenuOpen:S,options:w,styles:I,unstyled:!0,value:A})},HN=t=>{let{getOptionValue:e,onChange:o,value:n}=t,r=[];return n&&(r=(Array.isArray(n)?n:[n]).map(s=>rg(s,e))),ei(cr,{className:"react-select-container",ids:r,onDragEnd:({moveFromIndex:s,moveToIndex:i})=>{let a=n;n&&Array.isArray(n)&&(a=zu(n,s,i)),o(a)},children:ei(I2,{...t})})},mt=t=>{let{isMulti:e,isSortable:o}=t;return e&&o?ei(HN,{...t}):ei(I2,{...t})};var Ql=t=>t.map(e=>typeof e=="object"&&(e.value||e.value==="")?e:{label:e,value:e});var Kl=t=>{let{id:e,onChange:o,options:n,required:r,selectedTimezone:s}=t,{t:i}=k(),a=Ql(n),l=XN(()=>a.find(c=>(typeof c=="string"?c:c.value)===(s||"UTC")),[a,s]);return zN("div",{className:"timezone-picker-wrapper",children:[R2(xe,{htmlFor:e,label:`${i("general:timezone")} ${r?"*":""}`,required:r,unstyled:!0}),R2(mt,{className:"timezone-picker",inputId:e,isClearable:!0,isCreatable:!1,onChange:c=>{o&&o(c?.value||"")},options:a,value:l})]})};var F2="date-time-field",YN=t=>{let{field:e,field:{admin:{className:o,date:n,description:r,placeholder:s}={},label:i,localized:a,required:l,timezone:c},path:u,readOnly:d,validate:f}=t,m=n?.pickerAppearance||"default",h=Intl.DateTimeFormat().resolvedOptions().timeZone,{config:p}=H(),{i18n:g}=k(),{dispatchFields:b,setModified:v}=Oe(),x=ug((O,B)=>{if(typeof f=="function")return f(O,{...B,required:l})},[f,l]),{customComponents:{AfterInput:y,BeforeInput:C,Description:S,Error:w,Label:D}={},disabled:_,path:A,setValue:F,showError:R,value:I}=Ee({potentiallyStalePath:u,validate:x}),E=A+"_tz",T=Et(([O,B])=>O?.[E]),$=p.admin.timezones.supportedTimezones,j=["dayOnly","default","monthOnly"].includes(m),N=T?.value,P=D2(()=>{if(c&&N&&h&&I){let O=Mt.tz(N),B=Mt.tz(h),G=new Mt(I).withTimeZone(N),X=Ar(G,O);return Ar(X,B).toISOString()}return I},[c,N,I,h]),L=D2(()=>rt(e),[e]),V=ug(O=>{if(!(d||_))if(c&&N&&O){let B=Mt.tz(N);if(j){let G=O.getTimezoneOffset()/60,X=O.getHours()+G;O.setHours(X);let Z=Ar(O,B);F(Z.toISOString()||null)}else{let G=new Mt(O),X=Ar(G,B);F(X.toISOString()||null)}}else F(O?.toISOString()||null)},[d,_,c,N,j,F]),M=ug(O=>{E&&(b({type:"UPDATE",path:E,value:O}),v(!0))},[b,v,E]);return _2("div",{className:[Ce,F2,o,R&&`${F2}--has-error`,(d||_)&&"read-only"].filter(Boolean).join(" "),style:L,children:[ns(oe,{CustomComponent:D,Fallback:ns(xe,{label:i,localized:a,required:l})}),_2("div",{className:`${Ce}__wrap`,id:`field-${A.replace(/\./g,"__")}`,children:[ns(oe,{CustomComponent:w,Fallback:ns(He,{path:A,showError:R})}),C,ns(Qi,{...n,onChange:V,overrides:{...n?.overrides},placeholder:UN(s,g),readOnly:d||_,value:P}),c&&$.length>0&&ns(Kl,{id:`${A}-timezone-picker`,onChange:M,options:$,required:l,selectedTimezone:N}),y]}),ns(oe,{CustomComponent:S,Fallback:ns(Be,{description:r,path:A})})]})},ec=je(YN);import{jsx as ti,jsxs as A2}from"react/jsx-runtime";import{getTranslation as ZN}from"@payloadcms/translations";import{useCallback as JN,useMemo as qN}from"react";var QN=t=>{let{field:e,field:{admin:{autoComplete:o,className:n,description:r,placeholder:s}={},label:i,localized:a,required:l}={},path:c,readOnly:u,validate:d}=t,{i18n:f}=k(),m=JN((_,A)=>{if(typeof d=="function")return d(_,{...A,required:l})},[d,l]),{customComponents:{AfterInput:h,BeforeInput:p,Description:g,Error:b,Label:v}={},disabled:x,path:y,setValue:C,showError:S,value:w}=Ee({potentiallyStalePath:c,validate:m}),D=qN(()=>rt(e),[e]);return A2("div",{className:[Ce,"email",n,S&&"error",(u||x)&&"read-only"].filter(Boolean).join(" "),style:D,children:[ti(oe,{CustomComponent:v,Fallback:ti(xe,{label:i,localized:a,path:y,required:l})}),A2("div",{className:`${Ce}__wrap`,children:[ti(oe,{CustomComponent:b,Fallback:ti(He,{path:y,showError:S})}),p,ti("input",{autoComplete:o,disabled:u||x,id:`field-${y.replace(/\./g,"__")}`,name:y,onChange:C,placeholder:ZN(s,f),required:l,type:"email",value:w||""}),h]}),ti(oe,{CustomComponent:g,Fallback:ti(Be,{description:r,path:y})})]})},oi=je(QN);import{jsx as ss,jsxs as am}from"react/jsx-runtime";import{getTranslation as l9}from"@payloadcms/translations";import{useMemo as c9}from"react";import{jsx as KN}from"react/jsx-runtime";import{createContext as e9,use as t9}from"react";var T2=e9(!1),E2=({children:t,withinRow:e=!0})=>KN(T2,{value:e,children:t}),P2=()=>t9(T2);import{jsx as o9}from"react/jsx-runtime";import{createContext as r9,use as n9}from"react";var N2=r9(!1),dg=({children:t,withinTab:e=!0})=>o9(N2,{value:e,children:t}),L2=()=>n9(N2);import{jsx as s9}from"react/jsx-runtime";import{createContext as i9,use as a9}from"react";var $2=i9(!1),k2=({children:t,withinGroup:e=!0})=>s9($2,{value:e,children:t}),j2=()=>a9($2);var kr="group-field",u9=t=>{let{field:e,field:{name:o,admin:{className:n,description:r,hideGutter:s}={},fields:i,label:a},path:l,permissions:c,readOnly:u,schemaPath:d}=t,f=d??o,{i18n:m}=k(),{isWithinCollapsible:h}=qn(),p=j2(),g=P2(),b=L2(),{customComponents:{AfterInput:v,BeforeInput:x,Description:y,Label:C}={},errorPaths:S}=Ee({path:l}),w=Xt(),D=S.length,_=w&&D>0,A=!(h||p||g),F=c9(()=>rt(e),[e]);return am("div",{className:[Ce,kr,A&&`${kr}--top-level`,h&&`${kr}--within-collapsible`,p&&`${kr}--within-group`,g&&`${kr}--within-row`,b&&`${kr}--within-tab`,!s&&p&&`${kr}--gutter`,_&&`${kr}--has-error`,n].filter(Boolean).join(" "),id:`field-${l?.replace(/\./g,"__")}`,style:F,children:[ss(k2,{children:am("div",{className:`${kr}__wrap`,children:[!!(C||y||a||_)&&am("div",{className:`${kr}__header`,children:[!!(C||y||a)&&am("header",{children:[ss(oe,{CustomComponent:C,Fallback:ss("h3",{className:`${kr}__title`,children:ss(xe,{as:"span",label:l9(a,m),localized:!1,path:l,required:!1})})}),ss(oe,{CustomComponent:y,Fallback:ss(Be,{description:r,path:l})})]}),_&&ss(io,{count:D,i18n:m,withMessage:!0})]}),x,ss(So,{fields:i,margins:"small",parentIndexPath:"",parentPath:l,parentSchemaPath:f,permissions:c===!0?c:c?.fields,readOnly:u})]})}),v]})};var tc=je(u9);import{c as d9}from"react/compiler-runtime";import{jsx as m9}from"react/jsx-runtime";import{useEffect as f9}from"react";var p9=t=>{let e=d9(12),{disableModifyingForm:o,path:n,value:r}=t,s=o===void 0?!0:o,i;e[0]!==n?(i={potentiallyStalePath:n},e[0]=n,e[1]=i):i=e[1];let{path:a,setValue:l,value:c}=Ee(i),u,d;e[2]!==s||e[3]!==l||e[4]!==r?(u=()=>{r!==void 0&&l(r,s)},d=[r,l,s],e[2]=s,e[3]=l,e[4]=r,e[5]=u,e[6]=d):(u=e[5],d=e[6]),f9(u,d);let f=`field-${a?.replace(/\./g,"__")}`,m=c||"",h;return e[7]!==a||e[8]!==l||e[9]!==f||e[10]!==m?(h=m9("input",{id:f,name:a,onChange:l,type:"hidden",value:m}),e[7]=a,e[8]=l,e[9]=f,e[10]=m,e[11]=h):h=e[11],h},oc=je(p9);var Mg=Ds(fg(),1);import{jsx as si,jsxs as c$}from"react/jsx-runtime";import{flattenTopLevelFields as u$}from"payload/shared";import{useMemo as H3}from"react";import{jsx as to,jsxs as ni}from"react/jsx-runtime";import{getTranslation as kg}from"@payloadcms/translations";import{hoistQueryParamsToAnd as l$,transformColumnsToPreferences as G3}from"payload/shared";import{Fragment as W3,useCallback as Sm,useEffect as jg,useState as Rn}from"react";import{c as v9}from"react/compiler-runtime";import{useInsertionEffect as x9,useRef as y9}from"react";function eo(t){let e=v9(4),o=y9(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]),x9(n,r);let s;return e[3]===Symbol.for("react.memo_cache_sentinel")?(s=(...i)=>{let a=i,l=o.current;return l(...a)},e[3]=s):s=e[3],s}import{jsx as Y2}from"react/jsx-runtime";import{useRouter as R9,useSearchParams as _9}from"next/navigation.js";import{isNumber as D9,transformColumnsToSearchParams as F9}from"payload/shared";import*as gg from"qs-esm";import A9,{useCallback as nc,useEffect as T9,useMemo as E9,useRef as P9,useState as Z2}from"react";import{jsx as C9}from"react/jsx-runtime";import{createContext as w9,use as S9}from"react";var H2=w9({}),pg=({children:t,...e})=>C9(H2,{value:{isInDrawer:!!e.drawerSlug,...e},children:t}),en=()=>{let t=S9(H2);if(!t)throw new Error("useListDrawerContext must be used within a ListDrawerContextProvider");return t};import*as z2 from"qs-esm";function jr(t){let e=t.toString();return z2.parse(e,{depth:10,ignoreQueryPrefix:!0})}import{createContext as X2,use as I9}from"react";var hg=X2({}),Rt=()=>I9(hg),U2=X2(!1);var bg=({children:t,collectionSlug:e,columns:o,data:n,defaultLimit:r,defaultSort:s,listPreferences:i,modifySearchParams:a,onQueryChange:l,orderableFieldName:c})=>{"use no memo";let u=R9(),d=_9(),{startRouteTransition:f}=st(),[m,h]=Z2(!1),p=E9(()=>jr(d),[d]),g=P9({});g.current.modified=m;let{onQueryChange:b}=en(),[v,x]=Z2(()=>a?p:{limit:String(r),sort:s}),y=nc(async(F,R)=>{h(R!==void 0?R:!0);let I="page"in F?F.page:v?.page;("where"in F||"search"in F)&&(I="1");let E={columns:"columns"in F?F.columns:v.columns,limit:"limit"in F?F.limit:v?.limit??String(r),page:I,preset:"preset"in F?F.preset:v?.preset,search:"search"in F?F.search:v?.search,sort:"sort"in F?F.sort:v?.sort??s,where:"where"in F?F.where:v?.where};a?f(()=>u.replace(`${gg.stringify({...E,columns:JSON.stringify(E.columns)},{addQueryPrefix:!0})}`)):(typeof b=="function"||typeof l=="function")&&(b||l)(E),x(E)},[v?.columns,v?.limit,v?.page,v?.search,v?.sort,v?.where,v?.preset,f,r,s,a,b,l,u]),C=nc(async F=>{await y({page:String(F)})},[y]),S=A9.useCallback(async F=>{await y({limit:String(F),page:"1"})},[y]),w=nc(async F=>{await y({search:F===""?void 0:F})},[y]),D=nc(async F=>{await y({sort:F})},[y]),_=nc(async F=>{await y({where:F})},[y]),A=eo(()=>{let F=!1,R={...v||{}};D9(r)&&!("limit"in v)&&(R.limit=String(r),F=!0),s&&!("sort"in v)&&(R.sort=s,F=!0),o&&i?.columns&&!("columns"in v)&&(R.columns=F9(o),F=!0),F&&(x(R),window.history.replaceState(null,"",`?${gg.stringify({...R,columns:JSON.stringify(R.columns)})}`))});return T9(()=>{a&&A()},[s,r,a,o]),Y2(hg,{value:{collectionSlug:e,data:n,handlePageChange:C,handlePerPageChange:S,handleSearchChange:w,handleSortChange:D,handleWhereChange:_,orderableFieldName:c,query:v,refineListData:y,setModified:h,...g.current},children:Y2(U2,{value:m,children:t})})};import{jsx as N9}from"react/jsx-runtime";import L9,{createContext as $9,useCallback as fa}from"react";var J2=$9(void 0),Dt=()=>{let t=L9.use(J2);if(t===void 0)throw new Error("useServerFunctions must be used within a ServerFunctionsProvider");return t},vg=({children:t,serverFunction:e})=>{if(!e)throw new Error("ServerFunctionsProvider requires a serverFunction prop");let o=fa(async l=>await e({name:"render-document-slots",args:l}),[e]),n=fa(async l=>{let{signal:c,...u}=l;try{if(!c?.aborted){let f=await e({name:"schedule-publish",args:{...u}});if(!c?.aborted)return f}}catch(f){console.error(f)}let d=`Error scheduling ${u.type}`;return u.doc&&(d+=` for document with ID ${u.doc.value} in collection ${u.doc.relationTo}`),{error:""}},[e]),r=fa(async l=>{let{signal:c,...u}=l||{};try{if(!c?.aborted){let d=await e({name:"form-state",args:{fallbackLocale:!1,...u}});if(!c?.aborted)return d}}catch(d){console.error(d)}return{state:null}},[e]),s=fa(async l=>{let{signal:c,...u}=l||{};try{if(!c?.aborted){let d=await e({name:"table-state",args:{fallbackLocale:!1,...u}});if(!c?.aborted)return d}}catch(d){console.error(d)}},[e]),i=fa(async l=>{let{signal:c,...u}=l||{};try{return await e({name:"render-document",args:{fallbackLocale:!1,...u}})}catch(d){console.error(d)}},[e]),a=fa(async l=>{let{signal:c,...u}=l||{};try{let d=await e({name:"copy-data-from-locale",args:u});if(!c?.aborted)return d}catch(d){console.error(d)}},[e]);return N9(J2,{value:{copyDataFromLocale:a,getDocumentSlots:o,getFormState:r,getTableState:s,renderDocument:i,schedulePublish:n,serverFunction:e},children:t})};import{jsx as O9}from"react/jsx-runtime";import{transformColumnsToSearchParams as q2}from"payload/shared";import Q2,{startTransition as K2,useCallback as yg,useRef as M9}from"react";import{createContext as k9,use as j9}from"react";var xg=k9({}),pa=()=>j9(xg);var sc=({children:t,collectionSlug:e,columnState:o,LinkedCellOverride:n})=>{let{getEntityConfig:r}=H(),{query:s,refineListData:i}=Rt(),{admin:{defaultColumns:a}={}}=r({collectionSlug:e}),[l,c]=Q2.useOptimistic(o,(p,g)=>g),u=M9({}),d=yg(async p=>{let g=(l||[]).map(b=>b.accessor===p?{...b,active:!b.active}:b);K2(()=>{c(g)}),await i({columns:q2(g)})},[i,l,c]),f=yg(async p=>{let{fromIndex:g,toIndex:b}=p,v=[...l||[]],[x]=v.splice(g,1);v.splice(b,0,x),K2(()=>{c(v)}),await i({columns:q2(v)})},[l,i,c]),m=yg(async p=>{let g=s.columns;p.forEach(b=>{let v=g.findIndex(x=>b===x);v!==void 0&&g[v][0]==="-"&&(g[v]=b.slice(1))}),await i({columns:g})},[s,i]),h=Q2.useCallback(async()=>{await m(a)},[a,m]);return O9(xg,{value:{columns:l,LinkedCellOverride:n,moveColumn:f,resetColumnsState:h,setActiveColumns:m,toggleColumn:d,...u.current},children:t})};import{jsx as ic}from"react/jsx-runtime";import{fieldIsHiddenOrDisabled as B9,fieldIsID as V9}from"payload/shared";import{useId as G9,useMemo as W9}from"react";var Cg="column-selector",cm=({collectionSlug:t})=>{let{columns:e,moveColumn:o,toggleColumn:n}=pa(),r=G9(),s=ct(),i=W9(()=>e.filter(a=>!(B9(a.field)&&!V9(a.field))&&!a?.field?.admin?.disableListColumn),[e]);return e?ic(cr,{className:Cg,ids:i.map(a=>a?.accessor),onDragEnd:({moveFromIndex:a,moveToIndex:l})=>{o({fromIndex:a,toIndex:l})},children:i.map((a,l)=>{let{accessor:c,active:u,field:d}=a;return ic(vt,{alignIcon:"left","aria-checked":u,className:[`${Cg}__column`,u&&`${Cg}__column--active`].filter(Boolean).join(" "),draggable:!0,icon:u?ic(pt,{}):ic(jo,{}),id:c,onClick:()=>{n(c)},children:a.CustomLabel??ic(xe,{label:d&&"label"in d&&d.label,unstyled:!0})},`${t}-${d&&"name"in d?d?.name:l}${s?`-${s}-`:""}${r}`)})}):null};import{c as m3}from"react/compiler-runtime";import{jsx as mm}from"react/jsx-runtime";import{createElement as sL}from"react";import{useEffect as iL,useId as aL,useState as lL}from"react";import{c as H9}from"react/compiler-runtime";import{useState as z9}from"react";var um=t=>{let e=H9(3),{getEntityConfig:o}=H(),n;e[0]!==o||e[1]!==t?(n=()=>t?(typeof t=="string"?[t]:t).map(i=>o({collectionSlug:i})):[],e[0]=o,e[1]=t,e[2]=n):n=e[2];let[r]=z9(n);return r};import{jsx as c3}from"react/jsx-runtime";import rL,{useCallback as lc,useEffect as u3,useRef as nL,useState as Rg}from"react";import{c as Ig}from"react/compiler-runtime";import{jsx as ri,jsxs as s3}from"react/jsx-runtime";import{getTranslation as q9}from"@payloadcms/translations";import Q9 from"react";import{c as U9}from"react/compiler-runtime";import{jsx as Y9,jsxs as Z9}from"react/jsx-runtime";import o3,{createContext as J9}from"react";import{c as X9}from"react/compiler-runtime";import*as is from"react";var wg=t=>{let e=X9(13),{delayBeforeShow:o,inTimeout:n,minShowTime:r,outTimeout:s,show:i}=t,a=n+r+s,[l,c]=Hf(o),[u,d]=is.useState(!1),[f,m]=is.useState(!1),h=is.useRef(0),p=is.useRef(void 0),g;e[0]!==s?(g=()=>{m(!0),p.current=setTimeout(()=>{d(!1),m(!1)},s)},e[0]=s,e[1]=g):g=e[1];let b=g,v,x;e[2]!==l||e[3]!==u||e[4]!==i||e[5]!==a||e[6]!==b?(v=()=>{let C=l&&!u&&i,S=u&&!i;if(C)h.current=Date.now(),d(!0);else if(S){let w=Date.now()-h.current,D=a-w;clearTimeout(p.current),p.current=setTimeout(b,Math.max(0,D))}},x=[u,i,b,a,l],e[2]=l,e[3]=u,e[4]=i,e[5]=a,e[6]=b,e[7]=v,e[8]=x):(v=e[7],x=e[8]),is.useEffect(v,x);let y;return e[9]!==u||e[10]!==f||e[11]!==c?(y={isMounted:u,isUnmounting:f,triggerDelayedRender:c},e[9]=u,e[10]=f,e[11]=c,e[12]=y):y=e[12],y};var e3={isLoading:!1,loaders:[],loadingText:"",overlayType:null},t3=(t,e)=>{let o=[...t.loaders],{type:n="fullscreen",key:r="user",loadingText:s}=e.payload;if(e.type==="add")o.push({type:n,key:r,loadingText:s});else if(e.type==="remove"){let a=o.findIndex(l=>l.key===r&&l.type===n);o.splice(a,1)}let i=o?.length>0?o[o.length-1]:null;return{isLoading:!!i,loaders:o,loadingText:i?.loadingText||t?.loadingText,overlayType:i?.type||t?.overlayType}};var Sg=250,r3=J9({isOnScreen:!1,toggleLoadingOverlay:void 0}),n3=t=>{let e=U9(21),{children:o}=t,{t:n}=k(),r;e[0]!==n?(r=n("general:loading"),e[0]=n,e[1]=r):r=e[1];let s=r,[i,a]=o3.useReducer(t3,e3),l;e[2]!==i.isLoading?(l={delayBeforeShow:1e3,inTimeout:Sg,minShowTime:500,outTimeout:Sg,show:i.isLoading},e[2]=i.isLoading,e[3]=l):l=e[3];let{isMounted:c,isUnmounting:u,triggerDelayedRender:d}=wg(l),f;e[4]!==s||e[5]!==d?(f=p=>{let{type:g,isLoading:b,key:v,loadingText:x}=p,y=x===void 0?s:x;b?(d(),a({type:"add",payload:{type:g,key:v,loadingText:y}})):a({type:"remove",payload:{type:g,key:v}})},e[4]=s,e[5]=d,e[6]=f):f=e[6];let m=f,h;if(e[7]!==o||e[8]!==s||e[9]!==c||e[10]!==u||e[11]!==i.loadingText||e[12]!==i.overlayType||e[13]!==m){let p;e[15]!==s||e[16]!==c||e[17]!==u||e[18]!==i.loadingText||e[19]!==i.overlayType?(p=c&&Y9(In,{animationDuration:`${Sg}ms`,loadingText:i.loadingText||s,overlayType:i.overlayType,show:!u}),e[15]=s,e[16]=c,e[17]=u,e[18]=i.loadingText,e[19]=i.overlayType,e[20]=p):p=e[20],h=Z9(r3,{value:{isOnScreen:c,toggleLoadingOverlay:m},children:[p,o]}),e[7]=o,e[8]=s,e[9]=c,e[10]=u,e[11]=i.loadingText,e[12]=i.overlayType,e[13]=m,e[14]=h}else h=e[14];return h},dm=()=>{let t=o3.use(r3);if(t===void 0)throw new Error("useLoadingOverlay must be used within a LoadingOverlayProvider");return t};var Or="loading-overlay",In=t=>{let e=Ig(11),{animationDuration:o,loadingText:n,overlayType:r,show:s}=t,i=s===void 0?!0:s,{t:a}=k(),l=i?`${Or}--entering`:`${Or}--exiting`,c=r?`${Or}--${r}`:"",u;e[0]!==l||e[1]!==c?(u=[Or,l,c].filter(Boolean),e[0]=l,e[1]=c,e[2]=u):u=e[2];let d=u.join(" "),f=o||"500ms",m;if(e[3]!==n||e[4]!==a||e[5]!==d||e[6]!==f){let h;e[8]!==n||e[9]!==a?(h=n||a("general:loading"),e[8]=n,e[9]=a,e[10]=h):h=e[10],m=s3("div",{className:d,style:{animationDuration:f},children:[s3("div",{className:`${Or}__bars`,children:[ri("div",{className:`${Or}__bar`}),ri("div",{className:`${Or}__bar`}),ri("div",{className:`${Or}__bar`}),ri("div",{className:`${Or}__bar`}),ri("div",{className:`${Or}__bar`})]}),ri("span",{className:`${Or}__text`,children:h})]}),e[3]=n,e[4]=a,e[5]=d,e[6]=f,e[7]=m}else m=e[7];return m},i3=t=>{let e=Ig(7),{name:o,type:n,loadingText:r,show:s}=t,i=n===void 0?"fullscreen":n,{toggleLoadingOverlay:a}=dm(),l,c;return e[0]!==o||e[1]!==r||e[2]!==s||e[3]!==a||e[4]!==i?(l=()=>(a({type:i,isLoading:s,key:o,loadingText:r||void 0}),()=>{a({type:i,isLoading:!1,key:o})}),c=[s,a,o,i,r],e[0]=o,e[1]=r,e[2]=s,e[3]=a,e[4]=i,e[5]=l,e[6]=c):(l=e[5],c=e[6]),Q9.useEffect(l,c),null},K9=t=>{let e=Ig(6),{name:o,type:n,action:r,formIsLoading:s,loadingSuffix:i}=t,a=n===void 0?"fullscreen":n,l=s===void 0?!1:s,c=lr(),{i18n:u,t:d}=k(),m=`${{create:d("general:creating"),loading:d("general:loading"),update:d("general:updating")}[r]} ${i?q9(i,u):""}`,h;return e[0]!==l||e[1]!==c||e[2]!==o||e[3]!==m||e[4]!==a?(h=ri(i3,{loadingText:m.trim(),name:o,show:l||c,type:a}),e[0]=l,e[1]=c,e[2]=o,e[3]=m,e[4]=a,e[5]=h):h=e[5],h};function tr(t){if(t)try{t.abort()}catch{}}function or(t){let e=new AbortController;if(t.current)try{t.current.abort()}catch{}return t.current=e,e}import{jsx as eL}from"react/jsx-runtime";import{createContext as tL,use as oL}from"react";var a3=tL({}),l3=({children:t,...e})=>eL(a3,{value:e,children:t}),ac=()=>{let t=oL(a3);if(!t)throw new Error("useDocumentDrawerContext must be used within a DocumentDrawerProvider");return t};var d3=({id:t,AfterFields:e,collectionSlug:o,disableActions:n,drawerSlug:r,Header:s,initialData:i,onDelete:a,onDuplicate:l,onSave:c,overrideEntityVisibility:u=!0,redirectAfterCreate:d,redirectAfterDelete:f,redirectAfterDuplicate:m})=>{let{getEntityConfig:h}=H(),p=Ne(),[g]=Rg(()=>h({collectionSlug:o})),b=rL.useRef(null),{closeModal:v}=de(),{t:x}=k(),{renderDocument:y}=Dt(),[C,S]=Rg(void 0),[w,D]=Rg(!0),_=nL(!1),A=lc(T=>{let $=or(b);(async()=>{D(!0);try{let N=await y({collectionSlug:o,disableActions:n,docID:T,drawerSlug:r,initialData:i,locale:p,overrideEntityVisibility:u,redirectAfterCreate:d,redirectAfterDelete:f!==void 0?f:!1,redirectAfterDuplicate:m!==void 0?m:!1,signal:$.signal});N?.Document&&(S(N.Document),D(!1))}catch(N){fe.error(N?.message||x("error:unspecific")),v(r)}b.current=null})()},[o,n,r,i,f,m,y,v,u,x,p]),F=lc(T=>{A(T.doc.id),typeof c=="function"&&c({...T,collectionConfig:g})},[c,g,A]),R=lc(T=>{A(T.doc.id),typeof l=="function"&&l({...T,collectionConfig:g})},[l,g,A]),I=lc(T=>{typeof a=="function"&&a({...T,collectionConfig:g}),v(r)},[a,v,r,g]),E=lc(()=>{A()},[A]);return u3(()=>{!C&&!_.current&&(A(t),_.current=!0)},[C,A,t]),u3(()=>{let T=b.current;return()=>{tr(T)}},[]),w?c3(In,{}):c3(l3,{clearDoc:E,drawerSlug:r,onDelete:I,onDuplicate:R,onSave:F,children:C})};var as="doc-drawer",cL=({id:t,collectionSlug:e,depth:o,uuid:n})=>`doc-drawer_${e}_${o}${t?`_${t}`:""}_${n}`,uL=t=>{let e=m3(21),o,n,r,s,i,a,l,c;e[0]!==t?({id:a,children:o,className:n,collectionSlug:r,disabled:s,drawerSlug:i,onClick:l,...c}=t,e[0]=t,e[1]=o,e[2]=n,e[3]=r,e[4]=s,e[5]=i,e[6]=a,e[7]=l,e[8]=c):(o=e[1],n=e[2],r=e[3],s=e[4],i=e[5],a=e[6],l=e[7],c=e[8]);let{t:u}=k(),[d]=um(r),f=a?"general:editLabel":"fields:addNewLabel",m=d?.labels.singular,h;if(e[9]!==o||e[10]!==n||e[11]!==s||e[12]!==i||e[13]!==l||e[14]!==c||e[15]!==u||e[16]!==f||e[17]!==m){let p=u(f,{label:m}),g;e[19]!==n?(g=[n,`${as}__toggler`].filter(Boolean),e[19]=n,e[20]=g):g=e[20],h=mm(ur,{"aria-label":p,className:g.join(" "),disabled:s,onClick:l,slug:i,...c,children:o}),e[9]=o,e[10]=n,e[11]=s,e[12]=i,e[13]=l,e[14]=c,e[15]=u,e[16]=f,e[17]=m,e[18]=h}else h=e[18];return h},dL=t=>{let{drawerSlug:e}=t;return mm(Pt,{className:as,gutter:!1,Header:null,slug:e,children:mm(d3,{...t})})},Jt=t=>{let e=m3(38),{id:o,collectionSlug:n,overrideEntityVisibility:r}=t,s=ct(),i=aL(),{closeModal:a,modalState:l,openModal:c,toggleModal:u}=de(),[d,f]=lL(!1),m;e[0]!==n||e[1]!==s||e[2]!==o||e[3]!==i?(m=cL({id:o,collectionSlug:n,depth:s,uuid:i}),e[0]=n,e[1]=s,e[2]=o,e[3]=i,e[4]=m):m=e[4];let h=m,p,g;e[5]!==h||e[6]!==l?(p=()=>{f(!!l[h]?.isOpen)},g=[l,h],e[5]=h,e[6]=l,e[7]=p,e[8]=g):(p=e[7],g=e[8]),iL(p,g);let b;e[9]!==h||e[10]!==u?(b=()=>{u(h)},e[9]=h,e[10]=u,e[11]=b):b=e[11];let v=b,x;e[12]!==a||e[13]!==h?(x=()=>{a(h)},e[12]=a,e[13]=h,e[14]=x):x=e[14];let y=x,C;e[15]!==h||e[16]!==c?(C=()=>{c(h)},e[15]=h,e[16]=c,e[17]=C):C=e[17];let S=C,w,D;e[18]!==n||e[19]!==h||e[20]!==o||e[21]!==r?(D=j=>sL(dL,{...j,collectionSlug:n,drawerSlug:h,id:o,key:h,overrideEntityVisibility:r}),e[18]=n,e[19]=h,e[20]=o,e[21]=r,e[22]=D):D=e[22],w=D;let _=w,A,F;e[23]!==n||e[24]!==h||e[25]!==o?(F=j=>mm(uL,{...j,collectionSlug:n,drawerSlug:h,id:o}),e[23]=n,e[24]=h,e[25]=o,e[26]=F):F=e[26],A=F;let R=A,I,E;e[27]!==y||e[28]!==h||e[29]!==s||e[30]!==d||e[31]!==S||e[32]!==v?(E={closeDrawer:y,drawerDepth:s,drawerSlug:h,isDrawerOpen:d,openDrawer:S,toggleDrawer:v},e[27]=y,e[28]=h,e[29]=s,e[30]=d,e[31]=S,e[32]=v,e[33]=E):E=e[33],I=E;let T=I,$;return e[34]!==_||e[35]!==T||e[36]!==R?($=[_,R,T],e[34]=_,e[35]=T,e[36]=R,e[37]=$):$=e[37],$};import{c as mL}from"react/compiler-runtime";import{jsx as fL}from"react/jsx-runtime";import{createContext as pL,use as hL,useEffect as gL,useReducer as bL,useRef as vL}from"react";function f3(t,e){switch(e.type){case"ADD_LOADED":{let o={...t};typeof o[e.relationTo]!="object"&&(o[e.relationTo]={});let n=[...e.idsToLoad];return Array.isArray(e.docs)&&e.docs.forEach(r=>{n.splice(n.indexOf(r.id),1),o[e.relationTo][r.id]=r}),n.forEach(r=>{o[e.relationTo][r]=!1}),o}case"REQUEST":{let o={...t};return e.docs.forEach(({relationTo:n,value:r})=>{typeof o[n]!="object"&&(o[n]={}),o[n][r]=null}),o}default:return t}}var p3=pL({}),cc=t=>{let e=mL(15),{children:o}=t,n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={},e[0]=n):n=e[0];let[r,s]=bL(f3,n),i=Jo(r,100),{config:a}=H(),{routes:l,serverURL:c}=a,{api:u}=l,{i18n:d}=k(),{code:f}=Ne(),m=vL(f),h;e[1]!==u||e[2]!==i||e[3]!==d||e[4]!==f||e[5]!==c?(h=C=>{let S=C===void 0?!1:C;Object.entries(i).forEach(async w=>{let[D,_]=w,A=[];if(Object.entries(_).forEach(F=>{let[R,I]=F;(I===null||S)&&A.push(R)}),A.length>0){let F=`${c}${u}/${D}`,R=new URLSearchParams;if(R.append("depth","0"),R.append("limit","250"),f&&R.append("locale",f),A&&A.length>0){let T=A.map(xL);R.append("where[id][in]",T.join(","))}let I=`?${R.toString()}`,E=await fetch(`${F}${I}`,{credentials:"include",headers:{"Accept-Language":d.language}});if(E.ok){let T=await E.json();T.docs&&s({type:"ADD_LOADED",docs:T.docs,idsToLoad:A,relationTo:D})}else s({type:"ADD_LOADED",docs:[],idsToLoad:A,relationTo:D})}})},e[1]=u,e[2]=i,e[3]=d,e[4]=f,e[5]=c,e[6]=h):h=e[6];let p=h,g,b;e[7]!==p||e[8]!==f?(g=()=>{p(f&&m.current!==f),m.current=f},b=[f,p],e[7]=p,e[8]=f,e[9]=g,e[10]=b):(g=e[9],b=e[10]),gL(g,b);let v;e[11]===Symbol.for("react.memo_cache_sentinel")?(v=C=>{s({type:"REQUEST",docs:C})},e[11]=v):v=e[11];let x=v,y;return e[12]!==o||e[13]!==r?(y=fL(p3,{value:{documents:r,getRelationships:x},children:o}),e[12]=o,e[13]=r,e[14]=y):y=e[14],y},_g=()=>hL(p3);function xL(t){return String(t)}import{c as e$}from"react/compiler-runtime";import{jsx as Cm,jsxs as t$}from"react/jsx-runtime";import"react";import{c as qL}from"react/compiler-runtime";import{jsx as L3}from"react/jsx-runtime";import $3 from"react";import{c as HL}from"react/compiler-runtime";import{jsx as ba,jsxs as zL}from"react/jsx-runtime";import{getTranslation as XL}from"@payloadcms/translations";import{fieldAffectsData as UL,fieldIsID as YL}from"payload/shared";import ZL from"react";import{formatAdminURL as h3}from"payload/shared";import{getTranslation as yL}from"@payloadcms/translations";import CL from"react";var g3=(t,e,o)=>{if((e?.type==="select"||e?.type==="radio")&&Array.isArray(e.options)){let n=e.options.find(r=>typeof r=="object"?r.value===t:r===t);if(n)return typeof n=="object"&&"label"in n?CL.isValidElement(n.label)?n.label:yL(n.label,o)||n.value:n}return t};import{jsx as b3}from"react/jsx-runtime";import"react";var fm=({cellData:t,nowrap:e})=>{let o=t?.length>100?`${t.substring(0,100)}\u2026`:t;return b3("code",{className:"code-cell",style:e?{whiteSpace:"nowrap"}:{},children:b3("span",{children:o})})};import{c as wL}from"react/compiler-runtime";import{jsx as SL}from"react/jsx-runtime";import{getTranslation as v3}from"@payloadcms/translations";import"react";var x3=t=>{let e=wL(2),{cellData:o,field:n}=t,{labels:r}=n,{i18n:s}=k(),i=o??[],a=i.length===1?`${i.length} ${v3(r?.singular||s.t("general:rows"),s)}`:`${i.length} ${v3(r?.plural||s.t("general:rows"),s)}`,l;return e[0]!==a?(l=SL("span",{children:a}),e[0]=a,e[1]=l):l=e[1],l};import{c as IL}from"react/compiler-runtime";import{jsx as RL}from"react/jsx-runtime";import{getTranslation as pm}from"@payloadcms/translations";import"react";var y3=t=>{let e=IL(2),{cellData:o,field:n}=t,{blockReferences:r,blocks:s,labels:i}=n,{i18n:a}=k(),{config:l}=H(),c=Array.isArray(o)?o.map(_L):[],u=(r??s)?.map(h=>{let p=typeof h=="string"?l.blocksMap[h]:h;return{slug:p.slug,label:pm(p.labels.singular,a)}}),d=`0 ${pm(i?.plural,a)}`,f=h=>h.map(p=>u.filter(b=>b.slug===p)?.[0]?.label).join(", ");if(c.length>5){let h=c.length-5;d=`${c.length} ${pm(i?.plural,a)} - ${a.t("fields:itemsAndMore",{count:h,items:f(c.slice(0,5))})}`}else c.length>0&&(d=`${c.length} ${pm(c.length===1?i?.singular:i?.plural,a)} - ${f(c)}`);let m;return e[0]!==d?(m=RL("span",{children:d}),e[0]=d,e[1]=m):m=e[1],m};function _L(t){let{blockType:e}=t;return e}import{c as DL}from"react/compiler-runtime";import{jsx as C3}from"react/jsx-runtime";import"react";var w3=t=>{let e=DL(3),{cellData:o}=t,{t:n}=k(),r=`general:${o}`,s;return e[0]!==n||e[1]!==r?(s=C3("code",{className:"bool-cell",children:C3("span",{children:n(r).toLowerCase()})}),e[0]=n,e[1]=r,e[2]=s):s=e[2],s};import{c as FL}from"react/compiler-runtime";import{jsx as AL}from"react/jsx-runtime";import"react";var S3=t=>{let e=FL(8),{cellData:o,field:n}=t,{admin:r}=n,s;e[0]!==r?(s=r===void 0?{}:r,e[0]=r,e[1]=s):s=e[1];let{date:i}=s,{config:a}=H(),{admin:l}=a,{dateFormat:c}=l,u=i?.displayFormat||c,{i18n:d}=k(),f;e[2]!==o||e[3]!==u||e[4]!==d?(f=o&&xn({date:o,i18n:d,pattern:u}),e[2]=o,e[3]=u,e[4]=d,e[5]=f):f=e[5];let m;return e[6]!==f?(m=AL("span",{children:f}),e[6]=f,e[7]=m):m=e[7],m};import{jsx as Fg,jsxs as EL,Fragment as PL}from"react/jsx-runtime";import{isImage as NL}from"payload/shared";import"react";var ha=({sizes:t,targetSizeMax:e=180,targetSizeMin:o=40,thumbnailURL:n,url:r,width:s})=>n||t&&Object.values(t).reduce((a,l)=>!l.width||l.width<o?a:l.width>=o&&l.width<=e?!a.width||l.width<a.width||a.width<o||a.width>e?l:a:!a.width||!a.original&&a.width<o&&l.width>a.width||a.width>e&&l.width<a.width?l:a,{original:!0,url:r,width:s}).url||r;import{c as I3}from"react/compiler-runtime";import{jsx as ga,jsxs as R3}from"react/jsx-runtime";import gm from"react";import{jsx as Dg,jsxs as TL}from"react/jsx-runtime";import"react";var hm=()=>TL("svg",{height:"150",viewBox:"0 0 150 150",width:"150",xmlns:"http://www.w3.org/2000/svg",children:[Dg("rect",{fill:"#333333",height:"150",transform:"translate(0 0.5)",width:"150"}),Dg("path",{d:"M82.8876 50.5H55.5555V100.5H94.4444V61.9818H82.8876V50.5Z",fill:"white"}),Dg("path",{d:"M82.8876 61.9818H94.4444L82.8876 50.5V61.9818Z",fill:"#9A9A9A"})]});var bm="thumbnail",Mr=t=>{let e=I3(17),{className:o,doc:n,fileSrc:r,imageCacheTag:s,size:i}=t,a=o===void 0?"":o,l;e[0]!==n?(l=n===void 0?{}:n,e[0]=n,e[1]=l):l=e[1];let{filename:c}=l,[u,d]=gm.useState(void 0),f=`${bm}--size-${i||"medium"}`,m;e[2]!==a||e[3]!==f?(m=[bm,f,a],e[2]=a,e[3]=f,e[4]=m):m=e[4];let h=m.join(" "),p,g;e[5]!==r?(p=()=>{if(!r){d(!1);return}d(void 0);let x=new Image;x.src=r,x.onload=()=>{d(!0)},x.onerror=()=>{d(!1)}},g=[r],e[5]=r,e[6]=p,e[7]=g):(p=e[6],g=e[7]),gm.useEffect(p,g);let b=null;if(r){let x=r?.includes("?")?"&":"?";b=s?`${r}${x}${encodeURIComponent(s)}`:r}let v;if(e[8]!==h||e[9]!==u||e[10]!==c||e[11]!==b){let x;e[13]!==u||e[14]!==c||e[15]!==b?(x=u&&ga("img",{alt:c,src:b}),e[13]=u,e[14]=c,e[15]=b,e[16]=x):x=e[16],v=R3("div",{className:h,children:[u===void 0&&ga(St,{height:"100%"}),x,u===!1&&ga(hm,{})]}),e[8]=h,e[9]=u,e[10]=c,e[11]=b,e[12]=v}else v=e[12];return v};function _3(t){let e=I3(17),{alt:o,className:n,filename:r,fileSrc:s,imageCacheTag:i,size:a}=t,l=n===void 0?"":n,[c,u]=gm.useState(void 0),d=`${bm}--size-${a||"medium"}`,f;e[0]!==l||e[1]!==d?(f=[bm,d,l],e[0]=l,e[1]=d,e[2]=f):f=e[2];let m=f.join(" "),h,p;e[3]!==s?(h=()=>{if(!s){u(!1);return}u(void 0);let v=new Image;v.src=s,v.onload=()=>{u(!0)},v.onerror=()=>{u(!1)}},p=[s],e[3]=s,e[4]=h,e[5]=p):(h=e[4],p=e[5]),gm.useEffect(h,p);let g="";if(s){let v=s?.includes("?")?"&":"?";g=i?`${s}${v}${encodeURIComponent(i)}`:s}let b;if(e[6]!==o||e[7]!==m||e[8]!==c||e[9]!==r||e[10]!==g){let v;e[12]!==o||e[13]!==c||e[14]!==r||e[15]!==g?(v=c&&ga("img",{alt:o||r,src:g}),e[12]=o,e[13]=c,e[14]=r,e[15]=g,e[16]=v):v=e[16],b=R3("div",{className:m,children:[c===void 0&&ga(St,{height:"100%"}),v,c===!1&&ga(hm,{})]}),e[6]=o,e[7]=m,e[8]=c,e[9]=r,e[10]=g,e[11]=b}else b=e[11];return b}var Ag="file",vm=({cellData:t,collectionConfig:e,field:o,rowData:n})=>{if(("displayPreview"in o?o.displayPreview:void 0)??e.upload?.displayPreview??!0){let i=NL(n?.mimeType),a=i?n?.thumbnailURL||n?.url:n?.thumbnailURL;return i&&(a=ha({sizes:n?.sizes,thumbnailURL:n?.thumbnailURL,url:n?.url,width:n?.width})),EL("div",{className:Ag,children:[Fg(Mr,{className:`${Ag}__thumbnail`,collectionSlug:e?.slug,doc:{...n,filename:t},fileSrc:a,size:"small",uploadConfig:e?.upload}),Fg("span",{className:`${Ag}__filename`,children:String(t)})]})}else return Fg(PL,{children:String(t)})};import{jsx as D3}from"react/jsx-runtime";import"react";var F3=({cellData:t})=>{let e=t?.length>100?`${t.substring(0,100)}\u2026`:t;return D3("code",{className:"json-cell",children:D3("span",{children:JSON.stringify(e)})})};import{c as LL}from"react/compiler-runtime";import{jsx as $L,jsxs as T3}from"react/jsx-runtime";import{getTranslation as kL}from"@payloadcms/translations";import jL,{useEffect as E3,useState as P3}from"react";var A3=!!(typeof window<"u"&&window.document&&window.document.createElement);var OL="relationship-cell",xm=3,ym=t=>{let e=LL(40),{cellData:o,customCellProps:n,field:r,field:s}=t,{label:i}=s,a="relationTo"in r&&r.relationTo||"collection"in r&&r.collection,l;l="collection"in r?o?.docs:o;let c=l,{config:u,getEntityConfig:d}=H(),{collections:f,routes:m}=u,[h,p]=mn(),g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g=[],e[0]=g):g=e[0];let[b,v]=P3(g),{documents:x,getRelationships:y}=_g(),[C,S]=P3(!1),{i18n:w,t:D}=k(),_=A3?p?.boundingClientRect?.top<window.innerHeight:!1,A;e[1]!==c||e[2]!==y||e[3]!==C||e[4]!==_||e[5]!==a?(A=()=>{if((c||typeof c=="number")&&_&&!C){let T=[],$=Array.isArray(c)?c:[c];$.slice(0,$.length<xm?$.length:xm).forEach(j=>{typeof j=="object"&&"relationTo"in j&&"value"in j&&T.push(j),(typeof j=="number"||typeof j=="string")&&typeof a=="string"&&T.push({relationTo:a,value:j})}),y(T),S(!0),v(T)}},e[1]=c,e[2]=y,e[3]=C,e[4]=_,e[5]=a,e[6]=A):A=e[6];let F;e[7]!==c||e[8]!==f||e[9]!==y||e[10]!==C||e[11]!==_||e[12]!==a||e[13]!==m.api?(F=[c,a,f,_,m.api,C,y],e[7]=c,e[8]=f,e[9]=y,e[10]=C,e[11]=_,e[12]=a,e[13]=m.api,e[14]=F):F=e[14],E3(A,F);let R;e[15]!==C?(R=()=>{C&&S(!1)},e[15]=C,e[16]=R):R=e[16];let I;e[17]!==c?(I=[c],e[17]=c,e[18]=I):I=e[18],E3(R,I);let E;if(e[19]!==c||e[20]!==u.admin||e[21]!==n||e[22]!==x||e[23]!==r||e[24]!==d||e[25]!==w||e[26]!==h||e[27]!==i||e[28]!==D||e[29]!==b){let T;e[31]!==u.admin||e[32]!==n||e[33]!==x||e[34]!==r||e[35]!==d||e[36]!==w||e[37]!==D||e[38]!==b.length?(T=($,j)=>{let{relationTo:N,value:P}=$,L=x[N][P],V=d({collectionSlug:N}),M=dr({collectionConfig:V,data:L||null,dateFormat:u.admin.dateFormat,fallback:`${D("general:untitled")} - ID: ${P}`,i18n:w}),O=null;return r.type==="upload"&&(("displayPreview"in r?r.displayPreview:void 0)??V.upload?.displayPreview??!0)&&L&&(O=$L(vm,{cellData:M,collectionConfig:V,collectionSlug:V.slug,customCellProps:n,field:r,rowData:L})),T3(jL.Fragment,{children:[L===!1&&`${D("general:untitled")} - ID: ${P}`,L===null&&`${D("general:loading")}...`,L?O||M:null,b.length>j+1&&", "]},j)},e[31]=u.admin,e[32]=n,e[33]=x,e[34]=r,e[35]=d,e[36]=w,e[37]=D,e[38]=b.length,e[39]=T):T=e[39],E=T3("div",{className:OL,ref:h,children:[b.map(T),Array.isArray(c)&&c.length>xm&&D("fields:itemsAndMore",{count:c.length-xm,items:""}),b.length===0&&D("general:noLabel",{label:kL(i||"",w)})]}),e[19]=c,e[20]=u.admin,e[21]=n,e[22]=x,e[23]=r,e[24]=d,e[25]=w,e[26]=h,e[27]=i,e[28]=D,e[29]=b,e[30]=E}else E=e[30];return E};import{c as ML}from"react/compiler-runtime";import{jsx as BL}from"react/jsx-runtime";import{getTranslation as VL}from"@payloadcms/translations";import{optionsAreObjects as GL}from"payload/shared";import"react";var Tg=t=>{let e=ML(10),{cellData:o,field:n}=t,{options:r}=n,{i18n:s}=k(),i;e[0]!==s||e[1]!==r?(i=u=>u.map(d=>{let f=r.filter(m=>m.value===d)?.[0]?.label;return VL(f,s)}).join(", "),e[0]=s,e[1]=r,e[2]=i):i=e[2];let a=i,l;if(GL(r)){let u;e[3]!==o||e[4]!==a?(u=Array.isArray(o)?a(o):a([o]),e[3]=o,e[4]=a,e[5]=u):u=e[5],l=u}else{let u;e[6]!==o?(u=Array.isArray(o)?o.join(", "):o,e[6]=o,e[7]=u):u=e[7],l=u}let c;return e[8]!==l?(c=BL("span",{children:l}),e[8]=l,e[9]=c):c=e[9],c};import{jsx as WL}from"react/jsx-runtime";import"react";var N3=({cellData:t})=>{let e=t?.length>100?`${t.substring(0,100)}\u2026`:t;return WL("span",{children:e})};var Eg={array:x3,blocks:y3,checkbox:w3,code:fm,date:S3,File:vm,join:ym,json:F3,radio:Tg,relationship:ym,select:Tg,textarea:N3,upload:ym};var uc=t=>{let e=HL(14),{cellData:o,className:n,collectionSlug:r,field:s,field:i,link:a,onClick:l,rowData:c}=t,{admin:u}=i,{i18n:d}=k(),{config:f,getEntityConfig:m}=H(),{routes:h}=f,{admin:p}=h,g,b;if(e[0]!==u||e[1]!==p||e[2]!==o||e[3]!==n||e[4]!==r||e[5]!==s||e[6]!==m||e[7]!==d||e[8]!==a||e[9]!==l||e[10]!==t||e[11]!==c){b=Symbol.for("react.early_return_sentinel");e:{let v=m({collectionSlug:r}),x=u&&"className"in u?u.className:void 0,y=n||(s.admin&&"className"in s.admin?s.admin.className:null)||x,C=l,S="span",w={className:y};if(a&&(w.prefetch=!1,S=no,w.href=v?.slug?h3({adminRoute:p,path:`/collections/${v?.slug}/${encodeURIComponent(c.id)}`}):""),typeof C=="function"&&(S="button",w.type="button",w.onClick=()=>{C({cellData:o,collectionSlug:v?.slug,rowData:c})}),YL(s)){b=ba(S,{...w,children:ba(fm,{cellData:`ID: ${o}`,collectionConfig:v,collectionSlug:r,field:{...s,type:"code"},nowrap:!0,rowData:c})});break e}let D=g3(o,s,d),_=typeof o<"u"&&Eg[s.type],A=null;if(ZL.isValidElement(D))A=D;else if(_)A=ba(_,{cellData:o,rowData:c,...t});else if(!_)if(v?.upload&&UL(s)&&s.name==="filename"&&s.type==="text"){let F=Eg.File;A=ba(F,{cellData:o,rowData:c,...t,collectionConfig:v,field:s})}else{b=zL(S,{...w,children:[(D===""||typeof D>"u"||D===null)&&d.t("general:noLabel",{label:XL(("label"in s?s.label:null)||"data",d)}),typeof D=="string"&&D,typeof D=="number"&&D,typeof D=="object"&&D!==null&&JSON.stringify(D)]});break e}if((s.type==="select"||s.type==="radio")&&s.options.length&&o){let F=Array.isArray(o)?o.map(JL).join(" "):`selected--${o}`,R=[w.className,F].filter(Boolean).join(" ");b=ba(S,{...w,className:R,children:A});break e}g=ba(S,{...w,children:A})}e[0]=u,e[1]=p,e[2]=o,e[3]=n,e[4]=r,e[5]=s,e[6]=m,e[7]=d,e[8]=a,e[9]=l,e[10]=t,e[11]=c,e[12]=g,e[13]=b}else g=e[12],b=e[13];return b!==Symbol.for("react.early_return_sentinel")?b:g};function JL(t){return`selected--${t}`}var QL="default-cell",k3=$3.createContext(null),Pg=()=>$3.use(k3),KL=t=>{let e=qL(9),{clientProps:o,columnIndex:n,isLinkedColumn:r}=t,{drawerSlug:s,onSelect:i}=en(),{LinkedCellOverride:a}=pa(),l;if(e[0]!==a||e[1]!==o||e[2]!==n||e[3]!==s||e[4]!==r||e[5]!==i){let c={...o,columnIndex:n};if(r&&s){c.className=`${QL}__first-cell`,c.link=!1;let u;e[7]!==i?(u=d=>{let{collectionSlug:f,rowData:m}=d;typeof i=="function"&&i({collectionSlug:f,doc:m,docID:m.id})},e[7]=i,e[8]=u):u=e[8],c.onClick=u}l=L3(k3,{value:c,children:r&&a?a:L3(uc,{...c})}),e[0]=a,e[1]=o,e[2]=n,e[3]=s,e[4]=r,e[5]=i,e[6]=l}else l=e[6];return l};var j3=t=>{let e=e$(15),{onDrawerDelete:o,onDrawerSave:n}=t,r=Pg(),s=r?.rowData.id,i=r?.collectionSlug,a;e[0]!==s||e[1]!==i?(a={id:s,collectionSlug:i},e[0]=s,e[1]=i,e[2]=a):a=e[2];let[l,c,u]=Jt(a),{closeDrawer:d}=u,f;e[3]!==d||e[4]!==n?(f=b=>{d(),typeof n=="function"&&n(b)},e[3]=d,e[4]=n,e[5]=f):f=e[5];let m=f,h;e[6]!==d||e[7]!==o?(h=b=>{d(),typeof o=="function"&&o(b)},e[6]=d,e[7]=o,e[8]=h):h=e[8];let p=h,g;return e[9]!==l||e[10]!==c||e[11]!==r||e[12]!==p||e[13]!==m?(g=t$("div",{className:"drawer-link",children:[Cm(uc,{...r,className:"drawer-link__cell",link:!1,onClick:null}),Cm(c,{children:Cm(_r,{})}),Cm(l,{onDelete:p,onSave:m})]}),e[9]=l,e[10]=c,e[11]=r,e[12]=p,e[13]=m,e[14]=g):g=e[14],g};import{c as i$}from"react/compiler-runtime";import{jsx as a$}from"react/jsx-runtime";import"react";import{jsx as $g}from"react/jsx-runtime";import"react";import{jsx as O3}from"react/jsx-runtime";import"react";var Ng="clickable-arrow",M3=t=>{let{direction:e="right",isDisabled:o=!1,updatePage:n}=t,r=[Ng,o&&`${Ng}--is-disabled`,e&&`${Ng}--${e}`].filter(Boolean).join(" ");return O3("button",{className:r,disabled:o,onClick:o?void 0:n,type:"button",children:O3(Ze,{})})};import{jsx as o$}from"react/jsx-runtime";import"react";var wm="paginator__page",Lg=({isCurrent:t,isFirstPage:e=!1,isLastPage:o=!1,page:n=1,updatePage:r})=>{let s=[wm,t&&`${wm}--is-current`,e&&`${wm}--is-first-page`,o&&`${wm}--is-last-page`].filter(Boolean).join(" ");return o$("button",{className:s,onClick:()=>r(n),type:"button",children:n})};import{jsx as r$}from"react/jsx-runtime";import"react";var B3=()=>r$("span",{className:"paginator__separator",children:"\u2014"});var n$={ClickableArrow:M3,Page:Lg,Separator:B3},s$="paginator",dc=t=>{let{hasNextPage:e=!1,hasPrevPage:o=!1,nextPage:n=null,numberOfNeighbors:r=1,onChange:s,page:i,prevPage:a=null,totalPages:l=null}=t;if(!e&&!o)return null;let c=h=>{typeof s=="function"&&s(h)},u=Array.from({length:l},(h,p)=>p+1),d=i-1-r;d<=0&&(d=0);let f=i-1+r+1,m=u.slice(d,f);return i-r-1>=2&&m.unshift({type:"Separator"}),i>r+1&&m.unshift({type:"Page",props:{isFirstPage:!0,page:1,updatePage:c}}),i+r+1<l&&m.push({type:"Separator"}),f<l&&m.push({type:"Page",props:{isLastPage:!0,page:l,updatePage:c}}),m.unshift({type:"ClickableArrow",props:{direction:"right",isDisabled:!e,updatePage:()=>c(n)}}),m.unshift({type:"ClickableArrow",props:{direction:"left",isDisabled:!o,updatePage:()=>c(a)}}),$g("div",{className:s$,children:m.map((h,p)=>{if(typeof h=="number")return $g(Lg,{isCurrent:i===h,page:h,updatePage:c},p);let g=n$[h.type];return $g(g,{...h.props},p)})})};var V3=()=>{let t=i$(11),{data:e,handlePageChange:o}=Rt(),n=e.nextPage||2,r;t[0]!==o?(r=l=>{o(l)},t[0]=o,t[1]=r):r=t[1];let s=e.page||1,i=e.prevPage||void 0,a;return t[2]!==e.hasNextPage||t[3]!==e.hasPrevPage||t[4]!==e.limit||t[5]!==e.totalPages||t[6]!==n||t[7]!==r||t[8]!==s||t[9]!==i?(a=a$(dc,{hasNextPage:e.hasNextPage,hasPrevPage:e.hasPrevPage,limit:e.limit,nextPage:n,numberOfNeighbors:1,onChange:r,page:s,prevPage:i,totalPages:e.totalPages}),t[2]=e.hasNextPage,t[3]=e.hasPrevPage,t[4]=e.limit,t[5]=e.totalPages,t[6]=n,t[7]=r,t[8]=s,t[9]=i,t[10]=a):a=t[10],a};var rr="relationship-table",Og=t=>{let{AfterInput:e,allowCreate:o=!0,BeforeInput:n,disableTable:r=!1,field:s,filterOptions:i,initialData:a,initialDrawerData:l,Label:c,parent:u,relationTo:d}=t,[f,m]=Rn(null),{config:h,getEntityConfig:p}=H(),{permissions:g}=Ae(),[b]=Rn(()=>{if(a)return{...a,docs:Array.isArray(a.docs)?a.docs.reduce((U,z)=>typeof z=="string"?[...U,{id:z}]:[...U,z],[]):[]}}),{i18n:v,t:x}=k(),[y,C]=Rn(),[S,w]=Rn(!1),[D]=Rn(()=>p({collectionSlug:d})),[_,A]=Rn(Array.isArray(d)?void 0:d),[F,R]=Rn(!r),[I,E]=Rn(b),[T,$]=Rn(),{getTableState:j}=Dt(),N=Sm(async U=>{let z={limit:String(s?.defaultLimit||D?.admin?.pagination?.defaultLimit),sort:s.defaultSort||D?.defaultSort,...y||{},where:{...y?.where||{}}};i&&(z.where=l$(z.where,i));let ce=s.admin.defaultColumns?s.admin.defaultColumns.map(q=>({accessor:q,active:!0})):void 0,{data:J,state:ue,Table:re}=await j({collectionSlug:d,columns:G3(y?.columns)||ce,docs:U,enableRowSelections:!1,orderableFieldName:!s.orderable||Array.isArray(s.collection)?void 0:`_${s.collection}_${s.name}_order`,parent:u,query:z,renderRowTypes:!0,tableAppearance:"condensed"});E(J),m(re),$(ue),R(!1)},[s.defaultLimit,s.defaultSort,s.admin.defaultColumns,s.collection,s.name,s.orderable,D?.admin?.pagination?.defaultLimit,D?.defaultSort,y,i,j,d,u]),P=eo((U,z)=>{!z&&(!f||U)&&N()});jg(()=>{P(y,r)},[y,r]);let[L,V,{closeDrawer:M,isDrawerOpen:O,openDrawer:B}]=Jt({collectionSlug:_}),G=Sm(U=>{let z=I?.docs?.findIndex(J=>J.id===U.doc.id),ce;if(z!==-1){let J=[...I.docs];J[z]=U.doc,ce=J}else ce=[U.doc,...I.docs];N(ce)},[I?.docs,N]),X=Sm(U=>{M(),G(U)},[M,G]),Z=Sm(U=>{let z=I.docs.filter(ce=>ce.id!==U.id);N(z)},[I?.docs,N]),te=o!==!1&&g?.collections?.[Array.isArray(d)?d[0]:d]?.create;return jg(()=>{Array.isArray(d)&&_&&B()},[_,B,d]),jg(()=>{Array.isArray(d)&&!O&&_&&A(void 0)},[O]),ni("div",{className:rr,children:[ni("div",{className:`${rr}__header`,children:[c,ni("div",{className:`${rr}__actions`,children:[!Array.isArray(d)&&te&&to(V,{className:`${rr}__add-new`,children:v.t("fields:addNew")}),Array.isArray(d)&&to(W3,{children:to(ho,{button:ni(ne,{buttonStyle:"none",className:`${rr}__add-new-polymorphic`,children:[v.t("fields:addNew"),to(jo,{})]}),buttonType:"custom",horizontalAlign:"center",render:({close:U})=>to(Me.ButtonGroup,{children:d.map(z=>g.collections[z].create?to(Me.Button,{className:`${rr}__relation-button--${z}`,onClick:()=>{U(),A(z)},children:kg(h.collections.find(ce=>ce.slug===z).labels.singular,v)},z):null)}),size:"medium"})}),to(vt,{"aria-controls":`${rr}-columns`,"aria-expanded":S,className:`${rr}__toggle-columns ${S?`${rr}__buttons-active`:""}`,icon:to(Ze,{direction:S?"up":"down"}),onClick:()=>w(!S),pillStyle:"light",children:x("general:columns")})]})]}),n,F?to("p",{children:x("general:loading")}):ni(W3,{children:[I?.docs&&I.docs.length===0&&ni("div",{className:`${rr}__no-results`,children:[to("p",{children:v.t("general:noResults",{label:Array.isArray(d)?v.t("general:documents"):kg(D?.labels?.plural,v)})}),te&&to(ne,{onClick:B,children:v.t("general:createNewLabel",{label:kg(D?.labels?.singular,v)})})]}),I?.docs&&I.docs.length>0&&to(cc,{children:to(bg,{columns:G3(T),data:I,defaultLimit:s.defaultLimit??D?.admin?.pagination?.defaultLimit,defaultSort:s.defaultSort??D?.defaultSort,modifySearchParams:!1,onQueryChange:C,orderableFieldName:!s.orderable||Array.isArray(s.collection)?void 0:`_${s.collection}_${s.name}_order`,children:ni(sc,{collectionSlug:Array.isArray(d)?d[0]:d,columnState:T,LinkedCellOverride:to(j3,{onDrawerDelete:Z,onDrawerSave:G}),children:[to(Tr,{className:`${rr}__columns`,height:S?"auto":0,id:`${rr}-columns`,children:to("div",{className:`${rr}__columns-inner`,children:D&&to(cm,{collectionSlug:D.slug})})}),f,to(V3,{})]})})})]}),e,to(L,{initialData:l,onSave:X})]})};var z3=Mg.default.default||Mg.default,Im=({collectionSlug:t,config:e,docID:o,fields:n,segments:r})=>{let s=u$(n),i=r[0],a=s.find(c=>c.name===i);if(!a)return null;if(a.type==="relationship"||a.type==="upload"){let c=o;return Array.isArray(a.relationTo)&&(c={relationTo:t,value:o}),{[a.name]:a.hasMany?[c]:c}}let l=r.slice(1,r.length);if(a.type==="tab"||a.type==="group")return{[a.name]:Im({collectionSlug:t,config:e,docID:o,fields:a.fields,segments:l})};if(a.type==="array"){let c=Im({collectionSlug:t,config:e,docID:o,fields:a.fields,segments:l});return c.id=z3().toHexString(),{[a.name]:[c]}}if(a.type==="blocks")for(let c of a.blockReferences??a.blocks){let u=typeof c=="string"?e.blocksMap[c]:c,d=Im({collectionSlug:t,config:e,docID:o,fields:u.fields,segments:l});if(d)return d.id=z3().toHexString(),d.blockType=u.slug,{[a.name]:[d]}}},d$=t=>{let{field:e,field:{admin:{allowCreate:o,description:n},collection:r,label:s,localized:i,on:a,required:l},path:c}=t,{id:u,docConfig:d}=Pe(),{config:f,getEntityConfig:m}=H(),{customComponents:{AfterInput:h,BeforeInput:p,Description:g,Error:b,Label:v}={},path:x,showError:y,value:C}=Ee({potentiallyStalePath:c}),S=H3(()=>{if(!u)return null;let D=u;Array.isArray(e.targetField.relationTo)&&(D={relationTo:d.slug,value:D});let _=Array.isArray(r)?{}:{[a]:{equals:D}};return e.where?{and:[_,e.where]}:_},[u,r,e.targetField.relationTo,e.where,a,d?.slug]),w=H3(()=>{let D=m({collectionSlug:Array.isArray(e.collection)?e.collection[0]:e.collection});return Im({collectionSlug:d?.slug,config:f,docID:u,fields:D.fields,segments:e.on.split(".")})},[m,e.collection,e.on,d?.slug,u,f]);return d?c$("div",{className:[Ce,y&&"error","join"].filter(Boolean).join(" "),id:`field-${x?.replace(/\./g,"__")}`,children:[si(oe,{CustomComponent:b,Fallback:si(He,{path:x,showError:y})}),si(Og,{AfterInput:h,allowCreate:typeof u<"u"&&o,BeforeInput:p,disableTable:S===null,field:e,filterOptions:S,initialData:u&&C?C:{docs:[]},initialDrawerData:w,Label:si("h4",{style:{margin:0},children:v||si(xe,{label:s,localized:i,path:x,required:l})}),parent:Array.isArray(r)?{id:u,collectionSlug:d.slug,joinPath:x}:void 0,relationTo:r}),si(oe,{CustomComponent:g,Fallback:si(Be,{description:n,path:x})})]}):null},mc=je(d$);import{jsx as ii,jsxs as X3}from"react/jsx-runtime";import m$,{useCallback as Bg,useEffect as f$,useMemo as p$,useState as Vg}from"react";var h$="json-field",g$=t=>{let{field:e,field:{admin:{className:o,description:n,editorOptions:r,maxHeight:s}={},jsonSchema:i,label:a,localized:l,required:c},path:u,readOnly:d,validate:f}=t,[m,h]=Vg(),p=m$.useRef("system"),[g,b]=Vg(""),v=Bg((P,L)=>{if(typeof f=="function")return f(P,{...L,jsonError:m,required:c})},[f,c,m]),{customComponents:{AfterInput:x,BeforeInput:y,Description:C,Error:S,Label:w}={},disabled:D,initialValue:_,path:A,setValue:F,showError:R,value:I}=Ee({potentiallyStalePath:u,validate:v}),[E,T]=Vg(()=>(I||_)!==void 0?JSON.stringify(I??_,null,2):void 0),$=Bg((P,L)=>{if(!i)return;L.languages.json.jsonDefaults.setDiagnosticsOptions({enableSchemaRequest:!0,schemas:[...L.languages.json.jsonDefaults.diagnosticsOptions.schemas||[],i],validate:!0});let V=i.uri,M=V.includes("?")?`${V}&${crypto.randomUUID?crypto.randomUUID():wn()}`:`${V}?${crypto.randomUUID?crypto.randomUUID():wn()}`;P.setModel(L.editor.createModel(JSON.stringify(I,null,2),"json",L.Uri.parse(M)))},[i,I]),j=Bg(P=>{if(!(d||D)){p.current="user";try{F(P?JSON.parse(P):null),h(void 0)}catch(L){F(P||null),h(L)}}},[d,D,F]);f$(()=>{p.current==="system"&&(T((I||_)!==void 0?JSON.stringify(I??_,null,2):void 0),b(new Date().toString())),p.current="system"},[_,I]);let N=p$(()=>rt(e),[e]);return X3("div",{className:[Ce,h$,o,R&&"error",(d||D)&&"read-only"].filter(Boolean).join(" "),style:N,children:[ii(oe,{CustomComponent:w,Fallback:ii(xe,{label:a,localized:l,path:A,required:c})}),X3("div",{className:`${Ce}__wrap`,children:[ii(oe,{CustomComponent:S,Fallback:ii(He,{message:m,path:A,showError:R})}),y,ii($l,{defaultLanguage:"json",maxHeight:s,onChange:j,onMount:$,options:r,readOnly:d||D,value:E,wrapperProps:{id:`field-${A?.replace(/\./g,"__")}`}},g),x]}),ii(oe,{CustomComponent:C,Fallback:ii(Be,{description:n,path:A})})]})},fc=je(g$);import{jsx as _n,jsxs as U3}from"react/jsx-runtime";import{getTranslation as b$}from"@payloadcms/translations";import{isNumber as v$}from"payload/shared";import{useCallback as Gg,useEffect as x$,useMemo as y$,useState as C$}from"react";var w$=t=>{let{field:e,field:{admin:{className:o,description:n,placeholder:r,step:s=1}={},hasMany:i=!1,label:a,localized:l,max:c=1/0,maxRows:u=1/0,min:d=-1/0,required:f},onChange:m,path:h,readOnly:p,validate:g}=t,{i18n:b,t:v}=k(),x=Gg((P,L)=>{if(typeof g=="function")return g(P,{...L,max:c,min:d,required:f})},[g,d,c,f]),{customComponents:{AfterInput:y,BeforeInput:C,Description:S,Error:w,Label:D}={},disabled:_,path:A,setValue:F,showError:R,value:I}=Ee({potentiallyStalePath:h,validate:x}),E=Gg(P=>{let L=parseFloat(P.target.value),V=L;Number.isNaN(L)&&(V=null),typeof m=="function"&&m(V),F(V)},[m,F]),[T,$]=C$([]),j=Gg(P=>{if(!(p||_)){let L;P?Array.isArray(P)?L=P.map(V=>Number(V.value?.value||V.value)):L=[Number(P.value?.value||P.value)]:L=[],F(L)}},[p,_,F]);x$(()=>{i&&Array.isArray(I)&&$(I.map((P,L)=>({id:`${P}${L}`,label:`${P}`,value:{toString:()=>`${P}${L}`,value:P?.value||P}})))},[I,i]);let N=y$(()=>rt(e),[e]);return U3("div",{className:[Ce,"number",o,R&&"error",(p||_)&&"read-only",i&&"has-many"].filter(Boolean).join(" "),style:N,children:[_n(oe,{CustomComponent:D,Fallback:_n(xe,{label:a,localized:l,path:A,required:f})}),U3("div",{className:`${Ce}__wrap`,children:[_n(oe,{CustomComponent:w,Fallback:_n(He,{path:A,showError:R})}),C,i?_n(mt,{className:`field-${A.replace(/\./g,"__")}`,disabled:p||_,filterOption:(P,L)=>{let V=Array.isArray(I)&&I.length>=u;return v$(L)&&!V},isClearable:!0,isCreatable:!0,isMulti:!0,isSortable:!0,noOptionsMessage:()=>Array.isArray(I)&&I.length>=u?v("validation:limitReached",{max:u,value:I.length+1}):null,onChange:j,options:[],placeholder:v("general:enterAValue"),showError:R,value:T}):_n("div",{children:_n("input",{disabled:p||_,id:`field-${A.replace(/\./g,"__")}`,max:c,min:d,name:A,onChange:E,onWheel:P=>{P.target.blur()},placeholder:b$(r,b),step:s,type:"number",value:typeof I=="number"?I:""})}),y,_n(oe,{CustomComponent:S,Fallback:_n(Be,{description:n,path:A})})]})]})},pc=je(w$);import{jsx as tn,jsxs as va}from"react/jsx-runtime";import{getTranslation as Wg}from"@payloadcms/translations";import{useCallback as Y3,useMemo as S$}from"react";var Z3="point",I$=t=>{let{field:e,field:{admin:{className:o,description:n,placeholder:r,step:s}={},label:i,localized:a,required:l},path:c,readOnly:u,validate:d}=t,{i18n:f,t:m}=k(),h=Y3((R,I)=>{if(typeof d=="function")return d(R,{...I,required:l})},[d,l]),{customComponents:{AfterInput:p,BeforeInput:g,Description:b,Error:v,Label:x}={},disabled:y,path:C,setValue:S,showError:w,value:D=[null,null]}=Ee({potentiallyStalePath:c,validate:h}),_=Y3((R,I)=>{let E=parseFloat(R.target.value);Number.isNaN(E)&&(E=R.target.value);let T=[...D];T[I]=E,S(T)},[S,D]),A=R=>{let I=m(R==="longitude"?"fields:longitude":"fields:latitude"),E=i?Wg(i,f):"";return`${E}${E?" - ":""}${I}`},F=S$(()=>rt(e),[e]);return va("div",{className:[Ce,Z3,o,w&&"error",(u||y)&&"read-only"].filter(Boolean).join(" "),style:F,children:[va("ul",{className:`${Z3}__wrap`,children:[va("li",{children:[tn(oe,{CustomComponent:x,Fallback:tn(xe,{label:A("longitude"),localized:a,path:C,required:l})}),va("div",{className:"input-wrapper",children:[g,tn("input",{disabled:u||y,id:`field-longitude-${C?.replace(/\./g,"__")}`,name:`${C}.longitude`,onChange:R=>_(R,0),placeholder:Wg(r,f),step:s,type:"number",value:D&&typeof D[0]=="number"?D[0]:""}),p]})]}),va("li",{children:[tn(oe,{CustomComponent:x,Fallback:tn(xe,{label:A("latitude"),localized:a,path:C,required:l})}),va("div",{className:"input-wrapper",children:[tn(oe,{CustomComponent:v,Fallback:tn(He,{path:C,showError:w})}),g,tn("input",{disabled:u||y,id:`field-latitude-${C?.replace(/\./g,"__")}`,name:`${C}.latitude`,onChange:R=>_(R,1),placeholder:Wg(r,f),step:s,type:"number",value:D&&typeof D[1]=="number"?D[1]:""}),p]})]})]}),tn(oe,{CustomComponent:b,Fallback:tn(Be,{description:n,path:C})})]})},hc=je(I$);import{jsx as Dn,jsxs as J3}from"react/jsx-runtime";import{optionIsObject as q3}from"payload/shared";import{useCallback as F$,useMemo as A$}from"react";import{c as R$}from"react/compiler-runtime";import{jsx as Rm,jsxs as _$}from"react/jsx-runtime";import{getTranslation as D$}from"@payloadcms/translations";import"react";var gc="radio-input",bc=t=>{let e=R$(16),{isSelected:o,onChange:n,option:r,path:s,readOnly:i,uuid:a}=t,{i18n:l}=k(),c=ct(),u=`field-${s}-${r.value}${c>1?`-${c}`:""}${a?`-${a}`:""}`,d=o&&`${gc}--is-selected`,f;e[0]!==d?(f=[gc,d].filter(Boolean),e[0]=d,e[1]=f):f=e[1];let m=f.join(" "),h;e[2]!==n||e[3]!==r.value?(h=()=>typeof n=="function"?n(r.value):null,e[2]=n,e[3]=r.value,e[4]=h):h=e[4];let p;if(e[5]!==l||e[6]!==u||e[7]!==o||e[8]!==r.label||e[9]!==s||e[10]!==i||e[11]!==m||e[12]!==h){let g=Rm("input",{checked:o,disabled:i,id:u,name:s,onChange:h,type:"radio"}),b=i&&`${gc}__styled-radio--disabled`,v;e[14]!==b?(v=[`${gc}__styled-radio`,b].filter(Boolean),e[14]=b,e[15]=v):v=e[15],p=Rm("label",{htmlFor:u,children:_$("div",{className:m,children:[g,Rm("span",{className:v.join(" ")}),Rm("span",{className:`${gc}__label`,children:D$(r.label,l)})]})}),e[5]=l,e[6]=u,e[7]=o,e[8]=r.label,e[9]=s,e[10]=i,e[11]=m,e[12]=h,e[13]=p}else p=e[13];return p};var _m="radio-group",T$=t=>{let{disableModifyingForm:e,field:o,field:{admin:{className:n,description:r,layout:s="horizontal"}={},label:i,localized:a,options:l=[],required:c}={},onChange:u,path:d,readOnly:f,validate:m,value:h}=t,{uuid:p}=Oe(),g=F$((I,E)=>{if(typeof m=="function")return m(I,{...E,options:l,required:c})},[m,l,c]),{customComponents:{AfterInput:b,BeforeInput:v,Description:x,Error:y,Label:C}={},disabled:S,path:w,setValue:D,showError:_,value:A}=Ee({potentiallyStalePath:d,validate:g}),F=A||h,R=A$(()=>rt(o),[o]);return J3("div",{className:[Ce,_m,n,`${_m}--layout-${s}`,_&&"error",(f||S)&&`${_m}--read-only`].filter(Boolean).join(" "),style:R,children:[Dn(oe,{CustomComponent:y,Fallback:Dn(He,{path:w,showError:_})}),Dn(oe,{CustomComponent:C,Fallback:Dn(xe,{label:i,localized:a,path:w,required:c})}),J3("div",{className:`${Ce}__wrap`,children:[v,Dn("ul",{className:`${_m}--group`,id:`field-${w.replace(/\./g,"__")}`,children:l.map(I=>{let E="";q3(I)?E=I.value:E=I;let T=String(E)===String(F),$=`field-${w}-${E}${p?`-${p}`:""}`;return Dn("li",{children:Dn(bc,{id:$,isSelected:T,onChange:()=>{typeof u=="function"&&u(E),f||S||D(E,!!e)},option:q3(I)?I:{label:I,value:I},path:w,readOnly:f||S,uuid:p})},`${w} - ${E}`)})}),b,Dn(oe,{CustomComponent:x,Fallback:Dn(Be,{description:r,path:w})})]})]})},vc=je(T$);import{jsx as Br,jsxs as Yg}from"react/jsx-runtime";import{dequal as ok}from"dequal/lite";import{wordBoundariesRegex as rk}from"payload/shared";import*as Zg from"qs-esm";import{useCallback as Fn,useEffect as Em,useMemo as pS,useReducer as nk,useRef as Cc,useState as ls}from"react";import{c as E$}from"react/compiler-runtime";import{jsx as on,jsxs as Dm}from"react/jsx-runtime";import{getTranslation as Q3}from"@payloadcms/translations";import{Fragment as Hg,useEffect as Fm,useState as xc}from"react";var xa="relationship-add-new",K3=t=>{let e=E$(45),{Button:o,hasMany:n,path:r,relationTo:s,setValue:i,unstyled:a,value:l}=t,c=um(s),{permissions:u}=Ae(),[d,f]=xc(!1),[m,h]=xc(),p=c.length>1,g;e[0]!==c[0]||e[1]!==p?(g=()=>p?void 0:c[0],e[0]=c[0],e[1]=p,e[2]=g):g=e[2];let[b,v]=xc(g),[x,y]=xc(!1),{i18n:C,t:S}=k(),[w,D]=xc(!1),_=b?.slug,A;e[3]!==_?(A={collectionSlug:_},e[3]=_,e[4]=A):A=e[4];let[F,R,I]=Jt(A),{isDrawerOpen:E,toggleDrawer:T}=I,$;e[5]!==b?.slug||e[6]!==n||e[7]!==s||e[8]!==i||e[9]!==l?($=z=>{let{doc:ce,operation:J}=z;if(J==="create"){let ue=Array.isArray(s)?{relationTo:b?.slug,value:ce.id}:ce.id;(Array.isArray(s)&&Array.isArray(l)?!l.some(q=>q&&typeof q=="object"&&q.value===ce.id):l!==ce.id)&&i(n?[...Array.isArray(l)?l:[],ue]:ue),h(void 0)}},e[5]=b?.slug,e[6]=n,e[7]=s,e[8]=i,e[9]=l,e[10]=$):$=e[10];let j=$,N;e[11]===Symbol.for("react.memo_cache_sentinel")?(N=z=>{y(z)},e[11]=N):N=e[11];let P=N,L,V;e[12]!==u||e[13]!==c?(L=()=>{u&&(c.length===1?f(u.collections[c[0]?.slug]?.create):f(c.some(z=>u.collections[z?.slug]?.create)))},V=[u,c],e[12]=u,e[13]=c,e[14]=L,e[15]=V):(L=e[14],V=e[15]),Fm(L,V);let M,O;e[16]!==c||e[17]!==p||e[18]!==m?(O=()=>{p&&m&&v(c.find(z=>z?.slug===m))},M=[m,p,c],e[16]=c,e[17]=p,e[18]=m,e[19]=M,e[20]=O):(M=e[19],O=e[20]),Fm(O,M);let B,G;e[21]!==b||e[22]!==p||e[23]!==T?(B=()=>{p&&b&&(T(),h(void 0))},G=[T,p,b],e[21]=b,e[22]=p,e[23]=T,e[24]=B,e[25]=G):(B=e[24],G=e[25]),Fm(B,G);let X,Z;e[26]!==E||e[27]!==p?(X=()=>{p&&!E&&v(void 0)},Z=[E,p],e[26]=E,e[27]=p,e[28]=X,e[29]=Z):(X=e[28],Z=e[29]),Fm(X,Z);let te=c[0].labels.singular,U;if(e[30]!==o||e[31]!==F||e[32]!==R||e[33]!==b||e[34]!==C||e[35]!==j||e[36]!==r||e[37]!==u||e[38]!==x||e[39]!==c||e[40]!==d||e[41]!==w||e[42]!==S||e[43]!==a){U=Symbol.for("react.early_return_sentinel");e:{let z=S("fields:addNewLabel",{label:Q3(te,C)});if(d){U=Dm("div",{className:xa,id:`${r}-add-new`,children:[c.length===1&&Dm(Hg,{children:[on(R,{className:[`${xa}__add-button`,a&&`${xa}__add-button--unstyled`].filter(Boolean).join(" "),onClick:()=>D(!1),onMouseEnter:()=>D(!0),onMouseLeave:()=>D(!1),children:o||Dm(Hg,{children:[on(go,{className:`${xa}__tooltip`,show:w,children:z}),on(jo,{})]})}),on(F,{onSave:j})]}),c.length>1&&Dm(Hg,{children:[on(ho,{button:o||on(ne,{buttonStyle:"none",className:`${xa}__add-button`,tooltip:x?void 0:S("fields:addNew"),children:on(jo,{})}),buttonType:"custom",horizontalAlign:"center",onToggleOpen:P,render:ce=>{let{close:J}=ce;return on(dp,{children:c.map(ue=>u.collections[ue?.slug].create?on(mp,{className:`${xa}__relation-button--${ue?.slug}`,onClick:()=>{J(),h(ue?.slug)},children:Q3(ue?.labels?.singular,C)},ue?.slug):null)})},size:"medium"}),b&&u.collections[b?.slug]?.create&&on(F,{onSave:j})]})]});break e}}e[30]=o,e[31]=F,e[32]=R,e[33]=b,e[34]=C,e[35]=j,e[36]=r,e[37]=u,e[38]=x,e[39]=c,e[40]=d,e[41]=w,e[42]=S,e[43]=a,e[44]=U}else U=e[44];return U!==Symbol.for("react.early_return_sentinel")?U:null};import{c as L$}from"react/compiler-runtime";import{jsx as Tm}from"react/jsx-runtime";import{createElement as $$}from"react";import{useEffect as rS,useId as k$,useState as nS}from"react";import{jsx as eS,jsxs as P$}from"react/jsx-runtime";import{hoistQueryParamsToAnd as N$}from"payload/shared";import{useCallback as Am,useEffect as tS,useState as zg}from"react";var oS=({allowCreate:t=!0,collectionSlugs:e,disableQueryPresets:o,drawerSlug:n,enableRowSelections:r,filterOptions:s,onBulkSelect:i,onSelect:a,overrideEntityVisibility:l=!0,selectedCollection:c})=>{let{closeModal:u,isModalOpen:d}=de(),{serverFunction:f}=Dt(),[m,h]=zg(void 0),[p,g]=zg(!0),{config:{collections:b},getEntityConfig:v}=H(),x=d(n),y=b.filter(({slug:T})=>e.includes(T)),[C,S]=zg(()=>{let T=c||y[0]?.slug,$=v({collectionSlug:T});return $?{label:$.labels,value:$.slug}:void 0}),[w,D,{drawerSlug:_}]=Jt({collectionSlug:C.value}),A=eo(T=>{T&&T!==C?.value&&S({label:v({collectionSlug:T})?.labels,value:T})});tS(()=>{A(c)},[c]);let F=Am(async(T,$)=>{try{let j={...$||{},where:{...$?.where||{}}},N=s?.[T];s&&typeof N!="boolean"&&(j.where=N$(j.where,N));let{List:P}=await f({name:"render-list",args:{allowCreate:t,collectionSlug:T,disableBulkDelete:!0,disableBulkEdit:!0,disableQueryPresets:o,drawerSlug:n,enableRowSelections:r,overrideEntityVisibility:l,query:j}});h(P),g(!1)}catch(j){console.error("Error rendering List View: ",j),x&&u(n)}},[f,u,t,n,x,r,s,l,o]);tS(()=>{m||F(C.value)},[F,m,C.value]);let R=Am(({doc:T})=>{typeof a=="function"&&a({collectionSlug:C.value,doc:T,docID:T.id}),u(_),u(n)},[u,_,n,a,C.value]),I=Am(T=>{F(C.value,T)},[F,C.value]),E=Am(T=>{S(T),F(T.value)},[F]);return p?eS(In,{}):P$(pg,{allowCreate:t,createNewDrawerSlug:_,DocumentDrawerToggler:D,drawerSlug:n,enabledCollections:e,onBulkSelect:i,onQueryChange:I,onSelect:a,selectedOption:C,setSelectedOption:E,children:[m,eS(w,{onSave:R})]})};var sS="list-drawer",j$=({depth:t,uuid:e})=>`list-drawer_${t}_${e}`,O$=({children:t,className:e,disabled:o,drawerSlug:n,onClick:r,...s})=>Tm(ur,{className:[e,`${sS}__toggler`].filter(Boolean).join(" "),disabled:o,onClick:r,slug:n,...s,children:t}),M$=t=>{let{drawerSlug:e}=t;return Tm(Pt,{className:sS,gutter:!1,Header:null,slug:e,children:Tm(oS,{...t})})},ai=t=>{let e=L$(42),{collectionSlugs:o,filterOptions:n,selectedCollection:r,uploads:s}=t,{config:i}=H(),{collections:a}=i,l=ct(),c=k$(),{closeModal:u,modalState:d,openModal:f,toggleModal:m}=de(),[h,p]=nS(!1),[g,b]=nS(o),v;e[0]!==l||e[1]!==c?(v=j$({depth:l,uuid:c}),e[0]=l,e[1]=c,e[2]=v):v=e[2];let x=v,y,C;e[3]!==x||e[4]!==d?(y=()=>{p(!!d[x]?.isOpen)},C=[d,x],e[3]=x,e[4]=d,e[5]=y,e[6]=C):(y=e[5],C=e[6]),rS(y,C);let S,w;e[7]!==g||e[8]!==a||e[9]!==s?(S=()=>{if(!g||g.length===0){let B=a.filter(G=>{let{upload:X}=G;return s?!!X:!0});b(B.map(B$))}},w=[g,s,a],e[7]=g,e[8]=a,e[9]=s,e[10]=S,e[11]=w):(S=e[10],w=e[11]),rS(S,w);let D;e[12]!==x||e[13]!==m?(D=()=>{m(x)},e[12]=x,e[13]=m,e[14]=D):D=e[14];let _=D,A;e[15]!==u||e[16]!==x?(A=()=>{u(x)},e[15]=u,e[16]=x,e[17]=A):A=e[17];let F=A,R;e[18]!==x||e[19]!==f?(R=()=>{f(x)},e[18]=x,e[19]=f,e[20]=R):R=e[20];let I=R,E,T;e[21]!==F||e[22]!==g||e[23]!==x||e[24]!==n||e[25]!==r||e[26]!==s?(T=B=>$$(M$,{...B,closeDrawer:F,collectionSlugs:g,drawerSlug:x,filterOptions:n,key:x,selectedCollection:r,uploads:s}),e[21]=F,e[22]=g,e[23]=x,e[24]=n,e[25]=r,e[26]=s,e[27]=T):T=e[27],E=T;let $=E,j,N;e[28]!==x?(N=B=>Tm(O$,{...B,drawerSlug:x}),e[28]=x,e[29]=N):N=e[29],j=N;let P=j,L,V;e[30]!==F||e[31]!==g||e[32]!==l||e[33]!==x||e[34]!==h||e[35]!==I||e[36]!==_?(V={closeDrawer:F,collectionSlugs:g,drawerDepth:l,drawerSlug:x,isDrawerOpen:h,openDrawer:I,setCollectionSlugs:b,toggleDrawer:_},e[30]=F,e[31]=g,e[32]=l,e[33]=x,e[34]=h,e[35]=I,e[36]=_,e[37]=V):V=e[37],L=V;let M=L,O;return e[38]!==$||e[39]!==M||e[40]!==P?(O=[$,P,M],e[38]=$,e[39]=M,e[40]=P,e[41]=O):O=e[41],O};function B$(t){let{slug:e}=t;return e}import{c as V$}from"react/compiler-runtime";import{useRef as G$}from"react";var Xg=(t,e)=>{let o=V$(3),n=G$(void 0),r;return o[0]!==t||o[1]!==e?(r=(...s)=>{let i=s,a=()=>{clearTimeout(n.current),t(...i)};clearTimeout(n.current),n.current=setTimeout(a,e)},o[0]=t,o[1]=e,o[2]=r):r=o[2],r};var Ug=({hasMany:t,relationTo:e,value:o})=>{let n=Array.isArray(e),r;if(Array.isArray(e)?r=e.reduce((i,a)=>({...i,[a]:[]}),{}):r={[e]:[]},o===null)return r;let s=(i,a)=>{(typeof a=="string"||typeof a=="number")&&typeof i=="string"&&(r[i]?r[i].push(a):r[i]=[a])};return t&&Array.isArray(o)?o.forEach(i=>{n&&typeof i=="object"&&"relationTo"in i&&"value"in i&&s(i.relationTo,i.value),!n&&typeof e=="string"&&s(e,i)}):n&&Array.isArray(e)?typeof o=="object"&&"relationTo"in o&&"value"in o&&s(o.relationTo,o.value):s(e,o),r};var iS=({allowEdit:t,options:e,value:o})=>{if(o||typeof o=="number"){if(Array.isArray(o))return o.map(r=>{let s;return e.forEach(i=>{s||(s=i.options.find(a=>typeof r=="object"?a.value===r.value&&a.relationTo===r.relationTo:r===a.value))}),s?{allowEdit:t,...s}:void 0});let n;return e.forEach(r=>{n||(n=r.options.find(s=>typeof o=="object"?s.value===o.value&&s.relationTo===o.relationTo:o===s.value))}),n?{allowEdit:t,...n}:void 0}};import{getTranslation as W$}from"@payloadcms/translations";var lS=t=>t.reduce((e,o)=>o.options?[...e,...lS(o.options)]:[...e,{id:o.value,relationTo:o.relationTo}],[]),aS=t=>t.sort((e,o)=>typeof e?.label?.localeCompare=="function"&&typeof o?.label?.localeCompare=="function"?e.label.localeCompare(o.label):0),cS=(t,e)=>{switch(e.type){case"ADD":{let{collection:o,config:n,docs:r,i18n:s,ids:i=[],sort:a}=e,l=o.slug,c=lS(t),u=[...t],d=u.find(m=>m.label===o.labels.plural),f=r.reduce((m,h)=>{if(c.filter(p=>p.id===h.id&&p.relationTo===l).length===0){c.push({id:h.id,relationTo:l});let p=dr({collectionConfig:o,data:h,dateFormat:n.admin.dateFormat,fallback:`${s.t("general:untitled")} - ID: ${h.id}`,i18n:s});return[...m,{label:p,relationTo:l,value:h.id}]}return m},[]);if(i.forEach(m=>{c.filter(h=>h.id===m&&h.relationTo===l).length===0&&(c.push({id:m,relationTo:l}),f.push({allowEdit:!1,label:`${s.t("general:untitled")} - ID: ${m}`,relationTo:l,value:m}))}),d){let m=[...d.options,...f];d.options=a?aS(m):m}else u.push({label:W$(o.labels.plural,s),options:a?aS(f):f});return u}case"CLEAR":{let o=e.exemptValues?Array.isArray(e.exemptValues)?e.exemptValues:[e.exemptValues]:[];return t.filter(r=>{let s=r.options.filter(i=>o?o.some(a=>a&&i.value===(typeof a=="object"?a.value:a)):!1);return r.options=s,s.length>0})}case"REMOVE":{let{id:o,collection:n}=e,r=[...t],s=r.findIndex(i=>i.label===n.labels.plural);return s===-1||(r[s]={...r[s],options:r[s].options.filter(i=>i.value!==o)}),r}case"UPDATE":{let{collection:o,config:n,doc:r,i18n:s}=e,i=o.slug,a=[...t],l=dr({collectionConfig:o,data:r,dateFormat:n.admin.dateFormat,fallback:`${s.t("general:untitled")} - ID: ${r.id}`,i18n:s}),u=a.find(d=>d.label===o.labels.plural)?.options?.find(d=>d.value===r.id);return u&&(u.label=l,u.relationTo=i),a}default:return t}};import{c as H$}from"react/compiler-runtime";import{jsx as yc,jsxs as uS}from"react/jsx-runtime";import{Fragment as z$,useState as X$}from"react";var ya="relationship--multi-value-label",dS=t=>{let e=H$(26),{data:o,selectProps:n}=t,{allowEdit:r,label:s,relationTo:i,value:a}=o,l;e[0]!==n?(l=n===void 0?{}:n,e[0]=n,e[1]=l):l=e[1];let{customProps:c}=l,u;e[2]!==c?(u=c===void 0?{}:c,e[2]=c,e[3]=u):u=e[3];let{draggableProps:d,onDocumentDrawerOpen:f}=u,{permissions:m}=Ae(),[h,p]=X$(!1),{t:g}=k(),b=!!m?.collections?.[i]?.read,v;e[4]!==d?(v=d||{},e[4]=d,e[5]=v):v=e[5];let x;if(e[6]!==r||e[7]!==b||e[8]!==s||e[9]!==f||e[10]!==t||e[11]!==i||e[12]!==h||e[13]!==g||e[14]!==v||e[15]!==a){let y;e[17]!==r||e[18]!==b||e[19]!==s||e[20]!==f||e[21]!==i||e[22]!==h||e[23]!==g||e[24]!==a?(y=i&&b&&r!==!1&&yc(z$,{children:uS("button",{"aria-label":`Edit ${s}`,className:`${ya}__drawer-toggler`,onClick:()=>{p(!1),f({id:a,collectionSlug:i,hasReadPermission:b})},onKeyDown:U$,onMouseDown:Y$,onMouseEnter:()=>p(!0),onMouseLeave:()=>p(!1),onTouchEnd:Z$,type:"button",children:[yc(go,{className:`${ya}__tooltip`,show:h,children:g("general:editLabel",{label:""})}),yc(_r,{className:`${ya}__icon`})]})}),e[17]=r,e[18]=b,e[19]=s,e[20]=f,e[21]=i,e[22]=h,e[23]=g,e[24]=a,e[25]=y):y=e[25],x=uS("div",{className:ya,children:[yc("div",{className:`${ya}__content`,children:yc(co.MultiValueLabel,{...t,innerProps:{className:`${ya}__text`,...v}})}),y]}),e[6]=r,e[7]=b,e[8]=s,e[9]=f,e[10]=t,e[11]=i,e[12]=h,e[13]=g,e[14]=v,e[15]=a,e[16]=x}else x=e[16];return x};function U$(t){t.key==="Enter"&&t.stopPropagation()}function Y$(t){return t.stopPropagation()}function Z$(t){return t.stopPropagation()}import{c as J$}from"react/compiler-runtime";import{jsx as Ca,jsxs as mS}from"react/jsx-runtime";import{Fragment as q$,useState as Q$}from"react";var wa="relationship--single-value",fS=t=>{let e=J$(24),{children:o,data:n,selectProps:r}=t,{allowEdit:s,label:i,relationTo:a,value:l}=n,c;e[0]!==r?(c=r===void 0?{}:r,e[0]=r,e[1]=c):c=e[1];let{customProps:u}=c,d;e[2]!==u?(d=u===void 0?{}:u,e[2]=u,e[3]=d):d=e[3];let{onDocumentDrawerOpen:f}=d,[m,h]=Q$(!1),{t:p}=k(),{permissions:g}=Ae(),b=!!g?.collections?.[a]?.read,v;if(e[4]!==s||e[5]!==o||e[6]!==b||e[7]!==i||e[8]!==f||e[9]!==t||e[10]!==a||e[11]!==m||e[12]!==p||e[13]!==l){let x;e[15]!==s||e[16]!==b||e[17]!==i||e[18]!==f||e[19]!==a||e[20]!==m||e[21]!==p||e[22]!==l?(x=a&&b&&s!==!1&&Ca(q$,{children:mS("button",{"aria-label":p("general:editLabel",{label:i}),className:`${wa}__drawer-toggler`,onClick:()=>{h(!1),f({id:l,collectionSlug:a,hasReadPermission:b})},onKeyDown:K$,onMouseDown:ek,onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),onTouchEnd:tk,type:"button",children:[Ca(go,{className:`${wa}__tooltip`,show:m,children:p("general:edit")}),Ca(_r,{})]})}),e[15]=s,e[16]=b,e[17]=i,e[18]=f,e[19]=a,e[20]=m,e[21]=p,e[22]=l,e[23]=x):x=e[23],v=Ca(co.SingleValue,{...t,className:wa,children:Ca("div",{className:`${wa}__label`,children:mS("div",{className:`${wa}__label-text`,children:[Ca("div",{className:`${wa}__text`,children:o}),x]})})}),e[4]=s,e[5]=o,e[6]=b,e[7]=i,e[8]=f,e[9]=t,e[10]=a,e[11]=m,e[12]=p,e[13]=l,e[14]=v}else v=e[14];return v};function K$(t){t.key==="Enter"&&t.stopPropagation()}function ek(t){return t.stopPropagation()}function tk(t){return t.stopPropagation()}var sk=10,wc="relationship",ik=t=>{let{field:e,field:{admin:{allowCreate:o=!0,allowEdit:n=!0,appearance:r="select",className:s,description:i,isSortable:a=!0,sortOptions:l}={},hasMany:c,label:u,localized:d,relationTo:f,required:m},path:h,readOnly:p,validate:g}=t,{config:b,getEntityConfig:v}=H(),{routes:{api:x},serverURL:y}=b,{i18n:C,t:S}=k(),{permissions:w}=Ae(),{code:D}=Ne(),_=Array.isArray(f),[A,F]=ls({id:void 0,collectionSlug:void 0,hasReadPermission:!1}),[R,I]=ls(-1),[E,T]=ls({}),[$,j]=ls(""),[N,P]=ls(""),[L,V]=ls(!1),[M,O]=ls(!1),[B,G]=ls(!1),X=Cc(!1),Z=Fn((W,ee)=>{if(typeof g=="function")return g(W,{...ee,required:m})},[g,m]),{customComponents:{AfterInput:te,BeforeInput:U,Description:z,Error:ce,Label:J}={},disabled:ue,filterOptions:re,initialValue:q,path:pe,setValue:he,showError:_e,value:ge}=Ee({potentiallyStalePath:h,validate:Z}),[Ve,Q]=nk(cS,[]),Le=Cc(ge);Le.current=ge;let[De,,{isDrawerOpen:ae,openDrawer:se}]=Jt({id:A.id,collectionSlug:A.collectionSlug}),Y=pS(()=>{let W=re;if(ge){let ee=(Array.isArray(ge)?ge:[ge]).reduce((le,ve)=>{if(typeof ve=="object"&&ve.relationTo)le[ve.relationTo]||(le[ve.relationTo]=[]),le[ve.relationTo].push(ve.value);else if(ve){let Fe=Array.isArray(f)?void 0:f;Fe&&(le[Fe]||(le[Fe]=[]),le[Fe].push(ve))}return le},{});(Array.isArray(f)?f:[f]).forEach(le=>{W={...W||{},[le]:{...typeof re?.[le]=="object"?re[le]:{},...ee[le]?{id:{not_in:ee[le]}}:{}}}})}return W},[re,ge,f]),[ie,,{closeDrawer:me,isDrawerOpen:we,openDrawer:ze}]=ai({collectionSlugs:_?f:[f],filterOptions:Y}),$e=Fn(({collectionSlug:W,doc:ee})=>{let le=_?{relationTo:W,value:ee.id}:ee.id;if(c){let ve=Array.isArray(ge)?ge:[];he([...ve,le])}else he(le);me()},[c,_,he,me,ge]),ot=Cc(!1),Xe=Fn(async({filterOptions:W,lastFullyLoadedRelation:ee,lastLoadedPage:le,onSuccess:ve,search:Fe,sort:Se,value:We})=>{if(!w)return;let Kt=typeof ee<"u"?ee:-1,Ot=Array.isArray(f)?f:[f],lt=Kt===-1?Ot:Ot.slice(Kt+1),fo=0,ro=Ug({hasMany:c,relationTo:f,value:We});$||(await lt.reduce(async(ko,ke)=>{let po=W?.[ke],Xo;if(N!==Fe?Xo=1:Xo=le[ke]+1,await ko,po===!1)return I(Ot.indexOf(ke)),Promise.resolve();if(fo<10){let zt=v({collectionSlug:ke}),wr=zt?.admin?.useAsTitle||"id",Ei=zt?.defaultSort||"id";typeof l=="string"?Ei=l:l?.[ke]&&(Ei=l[ke]);let tl={depth:0,draft:!0,limit:sk,locale:D,page:Xo,select:{[wr]:!0},sort:Ei,where:{and:[{id:{not_in:ro[ke]}}]}};Fe&&tl.where.and.push({[wr]:{like:Fe}}),po&&typeof po!="boolean"&&tl.where.and.push(po);let _s=await fetch(`${y}${x}/${ke}`,{body:Zg.stringify(tl),credentials:"include",headers:{"Accept-Language":C.language,"Content-Type":"application/x-www-form-urlencoded","X-HTTP-Method-Override":"GET"},method:"POST"});if(_s.ok){let Pi=await _s.json();T(Ni=>({...Ni,[ke]:Xo})),Pi.nextPage||I(Ot.indexOf(ke)),Pi.docs.length>0&&(fo+=Pi.docs.length,Q({type:"ADD",collection:zt,config:b,docs:Pi.docs,i18n:C,sort:Se}))}else _s.status===403?(I(Ot.indexOf(ke)),Q({type:"ADD",collection:zt,config:b,docs:[],i18n:C,ids:ro[ke],sort:Se})):j(S("error:unspecific"))}},Promise.resolve()),typeof ve=="function"&&ve())},[w,f,c,$,N,v,D,y,l,x,C,b,S]),Ue=Xg((W,ee)=>{Xe({filterOptions:re,lastLoadedPage:{},search:W,sort:!0,value:ee}),P(W)},300),ft=Fn((W,ee)=>{N!==W&&(T({}),Ue(W,ee,W!==""))},[N,Ue]),Qt=eo(W=>{let ee=Ug({hasMany:c,relationTo:f,value:W});Object.entries(ee).reduce(async(le,[ve,Fe])=>{await le;let Se=Fe.filter(We=>!Ve.find(Kt=>Kt?.options?.find(Ot=>Ot.value===We&&Ot.relationTo===ve)));if(Se.length>0){let We={depth:0,draft:!0,limit:Se.length,locale:D,where:{id:{in:Se}}};if(!$){let Kt=await fetch(`${y}${x}/${ve}`,{body:Zg.stringify(We),credentials:"include",headers:{"Accept-Language":C.language,"Content-Type":"application/x-www-form-urlencoded","X-HTTP-Method-Override":"GET"},method:"POST"}),Ot=v({collectionSlug:ve}),lt=[];Kt.ok&&(lt=(await Kt.json()).docs),Q({type:"ADD",collection:Ot,config:b,docs:lt,i18n:C,ids:Se,sort:!0})}}},Promise.resolve())}),Ge=Cc(ge),Je=Cc(!0);Em(()=>{(Je.current||!ok(ge,Ge.current))&&Qt(ge),Je.current=!1,Ge.current=ge},[ge]),Em(()=>{let ee=(Array.isArray(f)?f:[f]).reduce((le,ve)=>(v({collectionSlug:ve})?.admin?.useAsTitle||"id")==="id"&&le,!0);O(!ee)},[f,v]);let Ye=eo(async W=>await Xe(W));Em(()=>{X.current&&B&&(V(!0),Ye({filterOptions:re,lastLoadedPage:{},onSuccess:()=>{X.current=!0,V(!1)},value:Le.current})),Q({type:"CLEAR",exemptValues:Le.current}),I(-1),T({})},[f,re,D,pe,B]);let xt=Fn(W=>{Q({type:"UPDATE",collection:W.collectionConfig,config:b,doc:W.doc,i18n:C});let ee=Le.current,le=W.doc.id;if(c){let ve=ee.some(Se=>typeof Se=="string"?Se===le:Se.value===le),Fe=ee.map(Se=>Se.value===le?{relationTo:W.collectionConfig.slug,value:le}:Se);he(Fe,ve)}else{let ve=ee===le;he({relationTo:W.collectionConfig.slug,value:le},ve)}},[C,b,c,he]),jt=Fn(W=>{Q({type:"ADD",collection:W.collectionConfig,config:b,docs:[W.doc],i18n:C,sort:!0}),he(c?Le.current?Le.current.concat({relationTo:W.collectionConfig.slug,value:W.doc.id}):null:{relationTo:W.collectionConfig.slug,value:W.doc.id})},[C,b,c,he]),gt=Fn(W=>{Q({id:W.id,type:"REMOVE",collection:W.collectionConfig,config:b,i18n:C}),he(c&&Le.current?Le.current.filter(ee=>ee.value!==W.id):null)},[C,b,c,he]),qe=Fn((W,ee)=>{if(!ee)return!0;let le=rk(ee||""),ve=250,Fe=String(W.label);for(;Fe.length>ve;){let Se=Fe.indexOf(" ",ee.length);if(le.test(Fe.slice(0,Se===-1?ee.length:Se+1)))return!0;Fe=Fe.slice(Se===-1?ee.length:Se+1)}return le.test(Fe.slice(-ve))},[]),Tt=Fn(({id:W,collectionSlug:ee,hasReadPermission:le})=>{ot.current=!0,F({id:W,collectionSlug:ee,hasReadPermission:le})},[]);Em(()=>{ot.current&&(se(),ot.current=!1)},[se,A]);let be=iS({allowEdit:n,options:Ve,value:ge});!Array.isArray(be)&&be?.value==="null"&&(be.value=null);let K=pS(()=>rt(e),[e]);return Yg("div",{className:[Ce,wc,s,_e&&"error",$&&"error-loading",(p||ue)&&`${wc}--read-only`,!(p||ue)&&o&&`${wc}--allow-create`].filter(Boolean).join(" "),id:`field-${pe.replace(/\./g,"__")}`,style:K,children:[Br(oe,{CustomComponent:J,Fallback:Br(xe,{label:u,localized:d,path:pe,required:m})}),Yg("div",{className:`${Ce}__wrap`,children:[Br(oe,{CustomComponent:ce,Fallback:Br(He,{path:pe,showError:_e})}),U,!$&&Yg("div",{className:`${wc}__wrap`,children:[Br(mt,{backspaceRemovesValue:!(ae||we),components:{MultiValueLabel:dS,SingleValue:fS,...r!=="select"&&{DropdownIndicator:null}},customProps:{disableKeyDown:ae||we,disableMouseDown:ae||we,onDocumentDrawerOpen:Tt,onSave:xt},disabled:p||ue||ae||we,filterOption:M?qe:void 0,getOptionValue:W=>{if(W)return c&&Array.isArray(f)?`${W.relationTo}_${W.value}`:W.value},isLoading:r==="select"&&L,isMulti:c,isSearchable:r==="select",isSortable:a,menuIsOpen:r==="select"?B:!1,onChange:p||ue?void 0:W=>{W===null?he(c?[]:null):c&&Array.isArray(W)?he(W?W.map(ee=>_?{relationTo:ee.relationTo,value:ee.value}:ee.value):null):_&&!Array.isArray(W)?he({relationTo:W.relationTo,value:W.value}):Array.isArray(W)||he(W.value)},onInputChange:W=>ft(W,ge),onMenuClose:()=>{G(!1)},onMenuOpen:()=>{r==="drawer"?ze():r==="select"&&(G(!0),X.current||(V(!0),Xe({filterOptions:re,lastLoadedPage:{},onSuccess:()=>{X.current=!0,V(!1)},value:q})))},onMenuScrollToBottom:()=>{Xe({filterOptions:re,lastFullyLoadedRelation:R,lastLoadedPage:E,search:N,sort:!1,value:q})},options:Ve,showError:_e,value:be??null}),!(p||ue)&&o&&Br(K3,{hasMany:c,path:pe,relationTo:f,setValue:he,value:ge})]}),$&&Br("div",{className:`${wc}__error-loading`,children:$}),te,Br(oe,{CustomComponent:z,Fallback:Br(Be,{description:i,path:pe})})]}),A.collectionSlug&&A.hasReadPermission&&Br(De,{onDelete:gt,onDuplicate:jt,onSave:xt}),r==="drawer"&&!p&&Br(ie,{allowCreate:o,enableRowSelections:!1,onSelect:$e})]})},Sc=je(ik);var Ic=()=>null;import{jsx as Jg}from"react/jsx-runtime";import"react";var hS="row",ak=t=>{let{field:{admin:{className:e,style:o}={},fields:n},forceRender:r=!1,indexPath:s="",parentPath:i="",parentSchemaPath:a="",permissions:l,readOnly:c}=t;return Jg(E2,{children:Jg("div",{className:[Ce,hS,e].filter(Boolean).join(" "),style:o||void 0,children:Jg(So,{className:`${hS}__fields`,fields:n,forceRender:r,margins:!1,parentIndexPath:s,parentPath:i,parentSchemaPath:a,permissions:l,readOnly:c})})})},Rc=je(ak);import{jsx as ck}from"react/jsx-runtime";import uk,{useCallback as bS,useMemo as dk}from"react";import{c as lk}from"react/compiler-runtime";import{jsx as li,jsxs as gS}from"react/jsx-runtime";import{getTranslation as qg}from"@payloadcms/translations";import"react";var Sa=t=>{let e=lk(39),{AfterInput:o,BeforeInput:n,className:r,Description:s,description:i,Error:a,hasMany:l,isClearable:c,isSortable:u,label:d,Label:f,localized:m,onChange:h,onInputChange:p,options:g,path:b,readOnly:v,required:x,showError:y,style:C,value:S}=t,w=l===void 0?!1:l,D=c===void 0?!0:c,_=u===void 0?!0:u,{i18n:A}=k(),F;if(e[0]!==o||e[1]!==n||e[2]!==s||e[3]!==a||e[4]!==f||e[5]!==r||e[6]!==i||e[7]!==w||e[8]!==A||e[9]!==D||e[10]!==_||e[11]!==d||e[12]!==m||e[13]!==h||e[14]!==p||e[15]!==g||e[16]!==b||e[17]!==v||e[18]!==x||e[19]!==y||e[20]!==C||e[21]!==S){let R;if(w&&Array.isArray(S)){let j;e[23]!==A||e[24]!==g?(j=N=>{let P=g.find(L=>L.value===N);return{label:P?qg(P.label,A):N,value:P?.value??N}},e[23]=A,e[24]=g,e[25]=j):j=e[25],R=S.map(j)}else if(S){let j,N;if(e[26]!==A||e[27]!==g||e[28]!==S){let P;e[31]!==S?(P=L=>L.value===S,e[31]=S,e[32]=P):P=e[32],j=g.find(P),N=j?qg(j.label,A):S,e[26]=A,e[27]=g,e[28]=S,e[29]=j,e[30]=N}else j=e[29],N=e[30];R={label:N,value:j?.value??S}}else R=null;let I=y&&"error",E=v&&"read-only",T;e[33]!==r||e[34]!==I||e[35]!==E?(T=[Ce,"select",r,I,E].filter(Boolean),e[33]=r,e[34]=I,e[35]=E,e[36]=T):T=e[36];let $;e[37]!==A?($=j=>({...j,label:qg(j.label,A)}),e[37]=A,e[38]=$):$=e[38],F=gS("div",{className:T.join(" "),id:`field-${b.replace(/\./g,"__")}`,style:C,children:[li(oe,{CustomComponent:f,Fallback:li(xe,{label:d,localized:m,path:b,required:x})}),gS("div",{className:`${Ce}__wrap`,children:[li(oe,{CustomComponent:a,Fallback:li(He,{path:b,showError:y})}),n,li(mt,{disabled:v,isClearable:D,isMulti:w,isSortable:_,onChange:h,onInputChange:p,options:g.map($),showError:y,value:R}),o]}),li(oe,{CustomComponent:s,Fallback:li(Be,{description:i,path:b})})]}),e[0]=o,e[1]=n,e[2]=s,e[3]=a,e[4]=f,e[5]=r,e[6]=i,e[7]=w,e[8]=A,e[9]=D,e[10]=_,e[11]=d,e[12]=m,e[13]=h,e[14]=p,e[15]=g,e[16]=b,e[17]=v,e[18]=x,e[19]=y,e[20]=C,e[21]=S,e[22]=F}else F=e[22];return F};var mk=t=>t.map(e=>typeof e=="object"&&(e.value||e.value==="")?e:{label:e,value:e}),fk=t=>{let{field:e,field:{name:o,admin:{className:n,description:r,isClearable:s=!0,isSortable:i=!0}={},hasMany:a=!1,label:l,localized:c,options:u=[],required:d},onChange:f,path:m,readOnly:h,validate:p}=t,g=uk.useMemo(()=>mk(u),[u]),b=bS((E,T)=>{if(typeof p=="function")return p(E,{...T,hasMany:a,options:g,required:d})},[p,d,a,g]),{customComponents:{AfterInput:v,BeforeInput:x,Description:y,Error:C,Label:S}={},disabled:w,path:D,setValue:_,showError:A,value:F}=Ee({potentiallyStalePath:m,validate:b}),R=bS(E=>{if(!h||w){let T=null;E&&a?Array.isArray(E)?T=E.map($=>$.value):T=[]:E&&!Array.isArray(E)&&(T=E.value),typeof f=="function"&&f(T),_(T)}},[h,w,a,_,f]),I=dk(()=>rt(e),[e]);return ck(Sa,{AfterInput:v,BeforeInput:x,className:n,Description:y,description:r,Error:C,hasMany:a,isClearable:s,isSortable:i,Label:S,label:l,localized:c,name:o,onChange:R,options:g,path:D,readOnly:h||w,required:d,showError:A,style:I,value:F})},_c=je(fk);import{c as kS}from"react/compiler-runtime";import{jsx as Tn,jsxs as jS}from"react/jsx-runtime";import{getTranslation as ej}from"@payloadcms/translations";import{tabHasName as km,toKebabCase as tj}from"payload/shared";import{useEffect as $S,useState as ab}from"react";var ES=Ds(eb(),1);import{jsx as Vr}from"react/jsx-runtime";import{dequal as TS}from"dequal/lite";import{useRouter as Wk}from"next/navigation.js";import{deepCopyObjectSimpleWithoutReactComponents as nb,getDataByPath as Hk,getSiblingData as zk,reduceFieldsToValues as sb,wait as Xk}from"payload/shared";import Uk,{useCallback as Wo,useEffect as ui,useReducer as Yk,useRef as Ac,useState as us}from"react";import{c as vk}from"react/compiler-runtime";import{jsx as CS,jsxs as xk}from"react/jsx-runtime";import yk from"react";function Ck(t){let e=[];for(let o of t)if(o){let n=o.split(" \u2192 "),r=!1;for(let s=0;s<e.length;s++)if(e[s].startsWith(n[0])){e.splice(s+1,0,o),r=!0;break}r||e.push(o)}return e}function wk(t){let[e,o]=t.split(":");if(!o)return{message:e};let n=o.split(",").map(r=>r.replaceAll(" > "," \u2192 ").trim());return n.length===1?{errors:n,message:`${e}:`}:{errors:Ck(n),message:`${e} (${n.length}):`}}function wS(t){let e=vk(5),{errorMessage:o}=t,n;e[0]!==o?(n=()=>wk(o),e[0]=o,e[1]=n):n=e[1];let[r]=yk.useState(n),{errors:s,message:i}=r,a;return e[2]!==s||e[3]!==i?(a=xk("div",{children:[i,Array.isArray(s)&&s.length>0?CS("ul",{"data-testid":"field-errors",children:s.map(Sk)}):null]}),e[2]=s,e[3]=i,e[4]=a):a=e[4],a}function Sk(t,e){return CS("li",{children:t},e)}import{c as Ik}from"react/compiler-runtime";import{useEffect as SS,useState as Rk}from"react";function tb(t,e,o){let n=Ik(11),r;n[0]!==t?(r=()=>t,n[0]=t,n[1]=r):r=n[1];let[s,i]=Rk(r),a;n[2]!==o||n[3]!==t?(a=()=>{let d=setTimeout(()=>{i(()=>t)},o);return()=>{clearTimeout(d)}},n[2]=o,n[3]=t,n[4]=a):a=n[4];let l;n[5]!==o||n[6]!==e?(l=[...e,o],n[5]=o,n[6]=e,n[7]=l):l=n[7],SS(a,l);let c,u;n[8]!==s?(c=()=>{s()},u=[s],n[8]=s,n[9]=c,n[10]=u):(c=n[9],u=n[10]),SS(c,u)}import{useCallback as _k,useRef as IS}from"react";function Nm(){let t=IS([]),e=IS(!1);return{queueTask:_k((n,r)=>{t.current.push(n);async function s(){if(!e.current&&!(typeof r?.beforeProcess=="function"&&r.beforeProcess()===!1))for(;t.current.length>0;){let i=t.current.pop();t.current=[],e.current=!0;try{await i()}catch(a){console.error("Error in queued function:",a)}finally{e.current=!1,typeof r?.afterProcess=="function"&&r.afterProcess()}}}s()},[])}}import{c as Dk}from"react/compiler-runtime";import{jsx as Fk}from"react/jsx-runtime";import RS,{useState as Ak}from"react";var _S=RS.createContext(null),ob=t=>{let e=Dk(6),{children:o}=t,[n,r]=Ak(Tk),s;e[0]!==n?(s=u=>{let{collectionSlug:d}=u;return n.get(d)},e[0]=n,e[1]=s):s=e[1];let i=s,a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=u=>{let{collectionSlug:d,handler:f}=u;r(m=>{let h=new Map(m);return h.set(d,f),h})},e[2]=a):a=e[2];let l=a,c;return e[3]!==o||e[4]!==i?(c=Fk(_S,{value:{getUploadHandler:i,setUploadHandler:l},children:o}),e[3]=o,e[4]=i,e[5]=c):c=e[5],c},Dc=()=>{let t=RS.use(_S);if(t===null)throw new Error("useUploadHandlers must be used within UploadHandlersProvider");return t};function Tk(){return new Map}var DS={413:"Your request was too large to submit successfully."};var rb=Ds(fg(),1);import{dequal as Pk}from"dequal/lite";import{deepCopyObjectSimpleWithoutReactComponents as AS}from"payload/shared";import{dequal as Ek}from"dequal/lite";var FS=({acceptValues:t,currentState:e={},incomingState:o})=>{let n={...e};for(let[r,s]of Object.entries(o||{}))!(r in e)&&!s.addedByServer||(!t&&!s.addedByServer&&(delete s.value,delete s.initialValue),n[r]={...e[r],...s},Array.isArray(s.rows)&&r in e&&(n[r].rows=[...e[r]?.rows||[]],s.rows.forEach(i=>{let a=e[r].rows.findIndex(l=>l.id===i.id);a>-1&&(n[r].rows[a]={...e[r].rows[a],...i})})),s.valid!==!1&&(n[r].valid=!0),s.passesCondition!==!1&&(n[r].passesCondition=!0),delete n[r].addedByServer);return Ek(n,e)?e:n};var Ia=(t,e)=>{let o={},n=Object.entries(e).reduce((r,[s,i])=>{let a=r;if(s.indexOf(`${t}.`)===0){let[l]=s.replace(`${t}.`,"").split(".");a[l]||(a[l]={}),a[l][s.replace(`${t}.${String(l)}.`,"")]={...i}}else o[s]=i;return a},[]);return{remainingFields:o,rows:n}},Ra=(t,e)=>e.reduce((o,n,r)=>({...o,...Object.entries(n).reduce((s,[i,a])=>({...s,[`${t}.${r}.${i}`]:{...a}}),{})}),{});var cs=rb.default.default||rb.default;function Fc(t,e){switch(e.type){case"ADD_ROW":{let{blockType:o,path:n,rowIndex:r,subFieldState:s={}}=e,i=typeof r=="number"?r:t[n]?.rows?.length||0,a=[...t[n]?.rows||[]],l={id:s?.id?.value||new cs().toHexString(),collapsed:!1,isLoading:!0};o&&(l.blockType=o),a.splice(i,0,l),o&&(s.blockType={initialValue:o,valid:!0,value:o});let{remainingFields:c,rows:u}=Ia(n,t);return u.splice(i,0,s),{...c,...Ra(n,u),[`${n}.${i}.id`]:{initialValue:l.id,passesCondition:!0,valid:!0,value:l.id},[n]:{...t[n],disableFormData:!0,rows:a,value:u.length}}}case"ADD_SERVER_ERRORS":{let o={...t},n=[];return e.errors.forEach(({message:r,path:s})=>{o[s]={...o[s]||{initialValue:null,value:null},errorMessage:r,valid:!1};let i=s.split(".");i.length>1&&n.push({fieldErrorPath:s,parentPath:i.slice(0,i.length-1).join(".")})}),o=Object.entries(o).reduce((r,[s,i])=>{let a=n.reduce((c,{fieldErrorPath:u,parentPath:d})=>(d.startsWith(s)&&c.push(u),c),[]),l=!1;if(a.length>0){let c=Array.isArray(i.errorPaths)?i.errorPaths:[];a.forEach(u=>{c.includes(u)||(c.push(u),l=!0)}),l&&(r[s]={...i,errorPaths:c})}return l||(r[s]=i),r},{}),o}case"DUPLICATE_ROW":{let{path:o,rowIndex:n}=e,{remainingFields:r,rows:s}=Ia(o,t),i=[...t[o].rows||[]],a=AS(i[n]);a.id&&(a.id=new cs().toHexString());let l=AS(s[n]);l.id&&(l.id.value=new cs().toHexString(),l.id.initialValue=new cs().toHexString());for(let u of Object.keys(l).filter(d=>d.endsWith(".id"))){let d=l[u];d&&typeof d.value=="string"&&cs.isValid(d.value)&&(l[u].value=new cs().toHexString(),l[u].initialValue=new cs().toHexString())}return Object.keys(l).length>0&&(s.splice(n+1,0,l),i.splice(n+1,0,a)),{...r,...Ra(o,s),[o]:{...t[o],disableFormData:!0,rows:i,value:s.length}}}case"MERGE_SERVER_STATE":{let{acceptValues:o,prevStateRef:n,serverState:r}=e,s=FS({acceptValues:o,currentState:t||{},incomingState:r});return n.current=s,s}case"MOVE_ROW":{let{moveFromIndex:o,moveToIndex:n,path:r}=e,{remainingFields:s,rows:i}=Ia(r,t),a=i[o];i.splice(o,1),i.splice(n,0,a);let l=[...t[r]?.rows||[]],c={...l[o]};return l.splice(o,1),l.splice(n,0,c),{...s,...Ra(r,i),[r]:{...t[r],rows:l}}}case"REMOVE":{let o={...t};return o[e.path]&&delete o[e.path],o}case"REMOVE_ROW":{let{path:o,rowIndex:n}=e,{remainingFields:r,rows:s}=Ia(o,t),i=[...t[o]?.rows||[]];return s.splice(n,1),i.splice(n,1),{...r,[o]:{...t[o],disableFormData:s.length>0,rows:i,value:s.length},...Ra(o,s)}}case"REPLACE_ROW":{let{blockType:o,path:n,rowIndex:r,subFieldState:s={}}=e,{remainingFields:i,rows:a}=Ia(n,t),l=Math.max(0,Math.min(r,a?.length-1||0)),c=[...t[n]?.rows||[]];return c[l]={id:new cs().toHexString(),blockType:o||void 0,collapsed:!1},o&&(s.blockType={initialValue:o,valid:!0,value:o}),a[l]=s,{...i,...Ra(n,a),[n]:{...t[n],disableFormData:!0,rows:c,value:a.length}}}case"REPLACE_STATE":{if(e.optimize!==!1){let o={};for(let[n,r]of Object.entries(e.state)){let s=t[n];r.valid!==!1&&(r.valid=!0),r.passesCondition!==!1&&(r.passesCondition=!0),Pk(s,r)?s&&(o[n]=s):o[n]=r}return o}if(e.sanitize)for(let o of Object.values(e.state))o.valid!==!1&&(o.valid=!0),o.passesCondition!==!1&&(o.passesCondition=!0);return e.state}case"SET_ALL_ROWS_COLLAPSED":{let{path:o,updatedRows:n}=e;return{...t,[o]:{...t[o],rows:n}}}case"SET_ROW_COLLAPSED":{let{path:o,updatedRows:n}=e;return{...t,[o]:{...t[o],rows:n}}}case"UPDATE":{let o=Object.entries(e).reduce((r,[s,i])=>["disableFormData","errorMessage","initialValue","rows","valid","validate","value"].includes(s)?{...r,[s]:i}:r,t?.[e.path]||{});return{...t,[e.path]:o}}case"UPDATE_MANY":{let o={...t};return Object.entries(e.formState).forEach(([n,r])=>{o[n]=r}),o}default:return t}}var Nk=()=>{},Lk=()=>{},$k=()=>{},kk=()=>{},jk=()=>{},Ok=()=>{},Mk=()=>{},Bk=()=>{},Vk=()=>{},Gk=()=>{},Lm={addFieldRow:()=>{},buildRowErrors:()=>{},createFormData:jk,disabled:!1,dispatchFields:$k,fields:{},formRef:null,getData:()=>{},getDataByPath:()=>{},getField:()=>{},getFields:()=>({}),getSiblingData:Lk,initializing:void 0,isValid:!0,moveFieldRow:()=>{},removeFieldRow:()=>{},replaceFieldRow:()=>{},replaceState:()=>{},reset:Gk,setBackgroundProcessing:Bk,setDisabled:()=>{},setIsValid:()=>{},setModified:Ok,setProcessing:Mk,setSubmitted:Vk,submit:Nk,validateForm:kk};var Zk="form",An=t=>{let{id:e,collectionSlug:o,docConfig:n,docPermissions:r,getDocPreferences:s,globalSlug:i}=Pe(),{action:a,beforeSubmit:l,children:c,className:u,disabled:d,disableSuccessStatus:f,disableValidationOnSubmit:m,el:h,handleResponse:p,initialState:g,isDocumentForm:b,isInitializing:v,onChange:x,onSubmit:y,onSuccess:C,redirect:S,submitted:w,uuid:D,waitForAutocomplete:_}=t,A="method"in t?t?.method:void 0,F=Wk(),R=$i(),{code:I}=Ne(),{i18n:E,t:T}=k(),{refreshCookie:$,user:j}=Ae(),N=Qo(),{queueTask:P}=Nm(),{getFormState:L}=Dt(),{startRouteTransition:V}=st(),{getUploadHandler:M}=Dc(),{config:O}=H(),[B,G]=us(d||!1),[X,Z]=us(!1),[te,U]=us(!1),[z,ce]=us(!0),[J,ue]=us(v),[re,q]=us(!1),[pe,he]=us(!1),[_e,ge]=us(!1),Ve=Ac(null),Q=Ac({}),Le=Ac(null),De=Ac(!0),ae=Yk(Fc,{},()=>g),[se,Y]=ae;Q.current.fields=se;let ie=Ac(se),me=Wo(async()=>{let W={},ee=!0,le=Q.current.getData(),ve=Object.entries(Q.current.fields).map(async([Fe,Se])=>{let We=Se,Kt=Fe?Fe.split("."):[];if(Se.passesCondition!==!1){let Ot=We.valid;if("validate"in Se&&typeof Se.validate=="function"){let lt=Se.value;Se?.rows&&Array.isArray(Se.rows)&&(lt=Q.current.getDataByPath(Fe)),Ot=await Se.validate(lt,{...Se,id:e,collectionSlug:o,blockData:void 0,data:R?.getData?R.getData():le,event:"submit",operation:N,path:Kt,preferences:{},req:{payload:{config:O},t:T,user:j},siblingData:Q.current.getSiblingData(Fe)}),typeof Ot=="string"?(We.errorMessage=Ot,We.valid=!1):(We.valid=!0,We.errorMessage=void 0)}We.valid===!1&&(ee=!1)}W[Fe]=We});return await Promise.all(ve),TS(Q.current.fields,W)||Y({type:"REPLACE_STATE",state:W}),ce(ee),ee},[o,O,Y,e,N,T,j,R]),we=Wo(async(W={},ee)=>{let{action:le=a,method:ve=A,overrides:Fe={},skipValidation:Se}=W;if(B){ee&&ee.preventDefault();return}let We,Kt,Ot=new Promise((ke,po)=>{Kt=ke,We=po}),lt=le||typeof a=="string"||typeof a=="function";if(S||f||!lt?(Kt=ke=>fe.success(ke),We=ke=>fe.error(ke)):fe.promise(Ot,{error:ke=>ke,loading:T("general:submitting"),success:ke=>ke}),ee&&(ee.stopPropagation(),ee.preventDefault()),q(!0),G(!0),_&&await Xk(100),Array.isArray(l)){let ke,po=nb(Q.current.fields);await l.reduce(async(zt,wr)=>{await zt,ke=await wr({formState:po})},Promise.resolve());let Xo=Object.entries(ke).every(([,zt])=>zt.valid!==!1);if(ce(Xo),!Xo)return q(!1),ge(!0),G(!1),Y({type:"REPLACE_STATE",state:ke})}let fo=Se||m?!0:await Q.current.validateForm();if(ce(fo),!fo){We(T("error:correctInvalidFields")),q(!1),ge(!0),G(!1);return}let ro={};if(typeof Fe=="function"?ro=Fe(Q.current.fields):typeof Fe=="object"&&(ro=Fe),y){let ke=nb(Q.current.fields),po=sb(ke,!0);for(let[Xo,zt]of Object.entries(ro))po[Xo]=zt;y(ke,po)}if(!lt){q(!1),ge(!0),G(!1);return}let ko=await Q.current.createFormData(ro,{mergeOverrideData:typeof Fe!="function"});try{let ke;if(typeof le=="string"?ke=await Qe[ve.toLowerCase()](le,{body:ko,headers:{"Accept-Language":E.language}}):typeof a=="function"&&(ke=await a(ko)),U(!1),G(!1),typeof p=="function"){p(ke,Kt,We);return}let po=ke.headers.get("content-type"),Xo=po&&po.indexOf("application/json")!==-1,zt={};if(Xo&&(zt=await ke.json()),ke.status<400){if(typeof C=="function"){let wr=await C(zt);wr&&Y({type:"MERGE_SERVER_STATE",acceptValues:!0,prevStateRef:ie,serverState:wr})}ge(!1),q(!1),S?V(()=>F.push(S)):f||Kt(zt.message||T("general:submissionSuccessful"))}else{if(q(!1),ge(!0),Q.current={...Q.current},zt.message){We(zt.message);return}if(Array.isArray(zt.errors)){let[Ei,tl]=zt.errors.reduce(([_s,Pi],Ni)=>{let cv=[],Bf=[];return Ni?.message&&Bf.push(Ni),Array.isArray(Ni?.data?.errors)&&Ni.data?.errors.forEach(Vf=>{Vf?.path?cv.push(Vf):Bf.push(Vf)}),[[..._s,...cv],[...Pi,...Bf]]},[[],[]]);ce(!1),Y({type:"ADD_SERVER_ERRORS",errors:Ei}),tl.forEach(_s=>{We(Vr(wS,{errorMessage:_s.message||T("error:unknown")}))});return}let wr=DS?.[ke.status]||ke?.statusText||T("error:unknown");We(wr)}}catch(ke){console.error("Error submitting form",ke),q(!1),ge(!0),G(!1),We(ke.message)}},[l,V,a,f,m,B,Y,p,A,y,C,S,F,T,E,_]),ze=Wo(()=>Q.current.fields,[]),$e=Wo(W=>Q.current.fields[W],[]),ot=Wo(()=>sb(Q.current.fields,!0),[]),Xe=Wo(W=>zk(Q.current.fields,W),[]),Ue=Wo(W=>Hk(Q.current.fields,W),[]),ft=Wo(async(W,{mergeOverrideData:ee=!0})=>{let le=sb(Q.current.fields,!0),ve=le?.file;if(n&&"upload"in n&&n.upload&&ve){delete le.file;let We=M({collectionSlug:o});if(typeof We=="function"){let Kt=ve.name,Ot=await We({file:ve,updateFilename:lt=>{Kt=lt}});ve=JSON.stringify({clientUploadContext:Ot,collectionSlug:o,filename:Kt,mimeType:ve.type,size:ve.size})}}ee?le={...le,...W}:le=W;let Fe={_payload:JSON.stringify(le)};return n&&"upload"in n&&n.upload&&ve&&(Fe.file=ve),(0,ES.serialize)(Fe,{indices:!0,nullsAsUndefineds:!1})},[o,n,M]),Qt=Wo(async W=>{let ee=or(Le),le=await s(),{state:ve}=await L({id:e,collectionSlug:o,data:W,docPermissions:r,docPreferences:le,globalSlug:i,locale:I,operation:N,renderAllFields:!0,schemaPath:o||i,signal:ee.signal,skipValidation:!0});Q.current={...Lm},U(!1),Y({type:"REPLACE_STATE",state:ve}),Le.current=null},[o,Y,i,e,N,L,r,s,I]),Ge=Wo(W=>{Q.current={...Lm},U(!1),Y({type:"REPLACE_STATE",state:W})},[Y]),Je=Wo(({blockType:W,path:ee,rowIndex:le,subFieldState:ve})=>{let Fe=Ue(ee)||[],Se=le===void 0?Fe.length:le;Y({type:"ADD_ROW",blockType:W,path:ee,rowIndex:Se,subFieldState:ve}),U(!0)},[Y,Ue]),Ye=Wo(({moveFromIndex:W,moveToIndex:ee,path:le})=>{Y({type:"MOVE_ROW",moveFromIndex:W,moveToIndex:ee,path:le}),U(!0)},[Y]),xt=Wo(({path:W,rowIndex:ee})=>{Y({type:"REMOVE_ROW",path:W,rowIndex:ee}),U(!0)},[Y]),jt=Wo(({blockType:W,path:ee,rowIndex:le,subFieldState:ve})=>{let Fe=Ue(ee),Se=le===void 0?Fe.length:le;Y({type:"REPLACE_ROW",blockType:W,path:ee,rowIndex:Se,subFieldState:ve}),U(!0)},[Y,Ue]);ui(()=>{let W=Le.current;return()=>{tr(W)}},[]),ui(()=>{v!==void 0&&ue(v)},[v]),Q.current.submit=we,Q.current.getFields=ze,Q.current.getField=$e,Q.current.getData=ot,Q.current.getSiblingData=Xe,Q.current.getDataByPath=Ue,Q.current.validateForm=me,Q.current.createFormData=ft,Q.current.setModified=U,Q.current.setProcessing=q,Q.current.setBackgroundProcessing=he,Q.current.setSubmitted=ge,Q.current.setIsValid=ce,Q.current.disabled=B,Q.current.setDisabled=G,Q.current.formRef=Ve,Q.current.reset=Qt,Q.current.replaceState=Ge,Q.current.dispatchFields=Y,Q.current.addFieldRow=Je,Q.current.removeFieldRow=xt,Q.current.moveFieldRow=Ye,Q.current.replaceFieldRow=jt,Q.current.uuid=D,Q.current.initializing=J,Q.current.isValid=z,ui(()=>{Z(!0)},[]),ui(()=>{typeof d=="boolean"&&G(d)},[d]),ui(()=>{typeof w=="boolean"&&ge(w)},[w]),ui(()=>{g&&(Q.current={...Lm},Y({type:"REPLACE_STATE",optimize:!1,sanitize:!0,state:g}))},[g,Y]),Bs(()=>{$()},15e3,[se]),ui(()=>{Q.current={...Q.current},U(!1)},[I]);let gt=[u,Zk].filter(Boolean).join(" "),qe=eo(W=>{P(async()=>{if(Array.isArray(x)){let ee;for(let le of x)ee=await le({formState:nb(se),submitted:W});Y({type:"MERGE_SERVER_STATE",prevStateRef:ie,serverState:ee})}})});tb(()=>{(De.current||!TS(se,ie.current))&&te&&qe(_e),ie.current=se,De.current=!1},[te,_e,se],250);let Tt=b?Au:Uk.Fragment,be=b?{value:Q.current}:{};return Vr(h||"form",{action:typeof a=="function"?void 0:a,className:gt,method:A,noValidate:!0,onSubmit:W=>void Q.current.submit({},W),ref:Ve,children:Vr(Tt,{...be,children:Vr(Fu,{value:Q.current,children:Vr(Tu,{value:{fields:se,...Q.current},children:Vr(Eu,{value:_e,children:Vr(op,{value:!X||X&&J,children:Vr(Pu,{value:re,children:Vr(tp,{value:pe,children:Vr(Nu,{value:te,children:Vr(al.Provider,{value:ae,children:c})})})})})})})})})})};import{c as Jk}from"react/compiler-runtime";import{jsx as PS,jsxs as NS}from"react/jsx-runtime";import{getTranslation as qk}from"@payloadcms/translations";import{tabHasName as LS}from"payload/shared";import Qk,{useState as Kk}from"react";var $m="tabs-field__tab-button",ib=t=>{let e=Jk(15),{hidden:o,isActive:n,parentPath:r,setIsActive:s,tab:i}=t,{i18n:a}=k(),[l,c]=Kk(void 0),u;if(e[0]!==l||e[1]!==o||e[2]!==a||e[3]!==n||e[4]!==r||e[5]!==s||e[6]!==i){let d=[...r?r.split(".").slice(0,-1):[],...LS(i)?[i.name]:[]],f=l>0,m=PS(Ys,{fields:i.fields,path:d,setErrorCount:c}),h=f&&`${$m}--has-error`,p=n&&`${$m}--active`,g=o&&`${$m}--hidden`,b;e[8]!==h||e[9]!==p||e[10]!==g?(b=[$m,h,p,g].filter(Boolean),e[8]=h,e[9]=p,e[10]=g,e[11]=b):b=e[11];let v;e[12]!==a||e[13]!==i?(v=i.label?qk(i.label,a):LS(i)?i.name:"",e[12]=a,e[13]=i,e[14]=v):v=e[14],u=NS(Qk.Fragment,{children:[m,NS("button",{className:b.join(" "),onClick:s,type:"button",children:[v,f&&PS(io,{count:l,i18n:a})]})]}),e[0]=l,e[1]=o,e[2]=a,e[3]=n,e[4]=r,e[5]=s,e[6]=i,e[7]=u}else u=e[7];return u};var En="tabs-field";function _a({activeTabConfig:t,path:e}){let o=e;return km(t)&&t.name&&(e?o=`${e}.${t.name}`:o=t.name),o}var oj=t=>{let e=kS(89),{field:o,forceRender:n,indexPath:r,parentPath:s,parentSchemaPath:i,path:a,permissions:l,readOnly:c}=t,{admin:u,tabs:d}=o,f;e[0]!==u?(f=u===void 0?{}:u,e[0]=u,e[1]=f):f=e[1];let{className:m}=f,h;e[2]!==d?(h=d===void 0?[]:d,e[2]=d,e[3]=h):h=e[3];let p=h,g=n===void 0?!1:n,b=r===void 0?"":r,v=s===void 0?"":s,x=i===void 0?"":i,y=a===void 0?"":a,{getPreference:C,setPreference:S}=Fo(),{preferencesKey:w}=Pe(),{i18n:D}=k(),{isWithinCollapsible:_}=qn(),A;e[4]!==p?(A=De=>{let[ae]=De;return p.map((se,Y)=>{let ie=se?.id;return{index:Y,passesCondition:ae?.[ie]?.passesCondition??!0,tab:se}})},e[4]=p,e[5]=A):A=e[5];let F=Et(A),R;e[6]!==F?(R=()=>F.filter(nj)?.[0]?.index??0,e[6]=F,e[7]=R):R=e[7];let[I,E]=ab(R),T=`tabs-${b}`,$;e[8]!==I||e[9]!==v||e[10]!==p?($=()=>_a({activeTabConfig:p[I],path:v}),e[8]=I,e[9]=v,e[10]=p,e[11]=$):$=e[11];let[j,N]=ab($),P;e[12]!==x||e[13]!==p[0]?(P=()=>_a({activeTabConfig:p[0],path:x}),e[12]=x,e[13]=p[0],e[14]=P):P=e[14];let[L,V]=ab(P),M;e[15]!==I||e[16]!==j||e[17]!==v||e[18]!==p?(M=km(p[I])?j:v,e[15]=I,e[16]=j,e[17]=v,e[18]=p,e[19]=M):M=e[19];let O=M,B=F[I],G=B?.tab,X;e[20]!==I||e[21]!==L||e[22]!==x||e[23]!==p?(X=km(p[I])?L:x,e[20]=I,e[21]=L,e[22]=x,e[23]=p,e[24]=X):X=e[24];let Z=X,te=G.admin?.description??G.description,U;e[25]!==te||e[26]!==D?(U=typeof te=="function"?te({i18n:D,t:D.t}):te,e[25]=te,e[26]=D,e[27]=U):U=e[27];let z=U,ce=F.some(sj),J;e[28]!==C||e[29]!==v||e[30]!==x||e[31]!==y||e[32]!==w||e[33]!==S||e[34]!==p||e[35]!==T?(J=async De=>{E(De),N(_a({activeTabConfig:p[De],path:v})),V(_a({activeTabConfig:p[De],path:x}));let ae=await C(w);w&&S(w,{...ae,...y?{fields:{...ae?.fields||{},[y]:{...ae?.fields?.[y],tabIndex:De}}}:{fields:{...ae?.fields,[T]:{...ae?.fields?.[T],tabIndex:De}}}})},e[28]=C,e[29]=v,e[30]=x,e[31]=y,e[32]=w,e[33]=S,e[34]=p,e[35]=T,e[36]=J):J=e[36];let ue=J,re,q;e[37]!==C||e[38]!==v||e[39]!==x||e[40]!==y||e[41]!==w||e[42]!==p||e[43]!==T?(re=()=>{w&&(async()=>{let ae=await C(w),Y=(y?ae?.fields?.[y]?.tabIndex:ae?.fields?.[T]?.tabIndex)||0;E(Y),N(_a({activeTabConfig:p[Y],path:v})),V(_a({activeTabConfig:p[Y],path:x}))})()},q=[y,C,w,T,p,v,x],e[37]=C,e[38]=v,e[39]=x,e[40]=y,e[41]=w,e[42]=p,e[43]=T,e[44]=re,e[45]=q):(re=e[44],q=e[45]),$S(re,q);let pe;e[46]!==B?.passesCondition||e[47]!==ue||e[48]!==F?(pe=()=>{if(B?.passesCondition===!1){let De=F.find(ij);De&&ue(De.index)}},e[46]=B?.passesCondition,e[47]=ue,e[48]=F,e[49]=pe):pe=e[49];let he;e[50]!==B||e[51]!==ue||e[52]!==F?(he=[B,F,ue],e[50]=B,e[51]=ue,e[52]=F,e[53]=he):he=e[53],$S(pe,he);let _e=_&&`${En}--within-collapsible`,ge=!ce&&`${En}--hidden`,Ve;e[54]!==m||e[55]!==_e||e[56]!==ge?(Ve=[Ce,m,En,_e,ge].filter(Boolean),e[54]=m,e[55]=_e,e[56]=ge,e[57]=Ve):Ve=e[57];let Q=Ve.join(" "),Le;if(e[58]!==O||e[59]!==Z||e[60]!==G||e[61]!==I||e[62]!==B||e[63]!==j||e[64]!==z||e[65]!==g||e[66]!==ue||e[67]!==b||e[68]!==y||e[69]!==l||e[70]!==c||e[71]!==Q||e[72]!==F){let De;e[74]!==I||e[75]!==ue||e[76]!==y?(De=se=>{let{index:Y,passesCondition:ie,tab:me}=se;return Tn(ib,{hidden:!ie,isActive:I===Y,parentPath:y,setIsActive:()=>{ue(Y)},tab:me},Y)},e[74]=I,e[75]=ue,e[76]=y,e[77]=De):De=e[77];let ae;e[78]!==O||e[79]!==Z||e[80]!==G||e[81]!==B||e[82]!==j||e[83]!==z||e[84]!==g||e[85]!==b||e[86]!==l||e[87]!==c?(ae=G&&Tn(rj,{description:z,fields:G.fields,forceRender:g,hidden:!1,parentIndexPath:km(G)?"":`${b?b+"-":""}`+String(B.index),parentPath:O,parentSchemaPath:Z,path:j,permissions:l&&typeof l=="object"&&"name"in G?l[G.name]&&typeof l[G.name]=="object"&&"fields"in l[G.name]?l[G.name].fields:l[G.name]:l,readOnly:c}),e[78]=O,e[79]=Z,e[80]=G,e[81]=B,e[82]=j,e[83]=z,e[84]=g,e[85]=b,e[86]=l,e[87]=c,e[88]=ae):ae=e[88],Le=Tn("div",{className:Q,children:jS(dg,{children:[Tn("div",{className:`${En}__tabs-wrap`,children:Tn("div",{className:`${En}__tabs`,children:F.map(De)})}),Tn("div",{className:`${En}__content-wrap`,children:ae})]})}),e[58]=O,e[59]=Z,e[60]=G,e[61]=I,e[62]=B,e[63]=j,e[64]=z,e[65]=g,e[66]=ue,e[67]=b,e[68]=y,e[69]=l,e[70]=c,e[71]=Q,e[72]=F,e[73]=Le}else Le=e[73];return Le},Tc=je(oj);function rj(t){let e=kS(19),{description:o,fields:n,forceRender:r,hidden:s,label:i,parentIndexPath:a,parentPath:l,parentSchemaPath:c,permissions:u,readOnly:d}=t,{i18n:f}=k(),{customComponents:m,path:h}=Ee(),p;e[0]!==m?(p=m===void 0?{}:m,e[0]=m,e[1]=p):p=e[1];let{AfterInput:g,BeforeInput:b,Description:v,Field:x}=p;if(x)return x;let y=s&&`${En}__tab--hidden`,C=i&&`${En}__tabConfigLabel-${tj(ej(i,f))}`,S;e[2]!==y||e[3]!==C?(S=[y,`${En}__tab`,C].filter(Boolean),e[2]=y,e[3]=C,e[4]=S):S=e[4];let w=S.join(" "),D;return e[5]!==g||e[6]!==b||e[7]!==v||e[8]!==o||e[9]!==n||e[10]!==r||e[11]!==a||e[12]!==l||e[13]!==c||e[14]!==h||e[15]!==u||e[16]!==d||e[17]!==w?(D=jS("div",{className:w,children:[Tn(oe,{CustomComponent:v,Fallback:Tn(Be,{description:o,marginPlacement:"bottom",path:h})}),b,Tn(So,{fields:n,forceRender:r,parentIndexPath:a,parentPath:l,parentSchemaPath:c,permissions:u,readOnly:d}),g]}),e[5]=g,e[6]=b,e[7]=v,e[8]=o,e[9]=n,e[10]=r,e[11]=a,e[12]=l,e[13]=c,e[14]=h,e[15]=u,e[16]=d,e[17]=w,e[18]=D):D=e[18],D}function nj(t){let{passesCondition:e}=t;return e}function sj(t){let{passesCondition:e}=t;return e}function ij(t){let{passesCondition:e}=t;return e}import{jsx as dj}from"react/jsx-runtime";import{useCallback as MS,useEffect as mj,useMemo as fj,useState as pj}from"react";import{c as aj}from"react/compiler-runtime";import{jsx as ds,jsxs as OS}from"react/jsx-runtime";import{getTranslation as lj}from"@payloadcms/translations";import"react";var lb=t=>{let e=aj(31),{AfterInput:o,BeforeInput:n,className:r,Description:s,description:i,Error:a,hasMany:l,inputRef:c,Label:u,label:d,localized:f,maxRows:m,onChange:h,onKeyDown:p,path:g,placeholder:b,readOnly:v,required:x,rtl:y,showError:C,style:S,value:w,valueToRender:D}=t,{i18n:_,t:A}=k(),F=uj,R=C&&"error",I=v&&"read-only",E=l&&"has-many",T;e[0]!==r||e[1]!==R||e[2]!==I||e[3]!==E?(T=[Ce,"text",r,R,I,E].filter(Boolean),e[0]=r,e[1]=R,e[2]=I,e[3]=E,e[4]=T):T=e[4];let $=T.join(" "),j;return e[5]!==o||e[6]!==n||e[7]!==s||e[8]!==a||e[9]!==u||e[10]!==i||e[11]!==l||e[12]!==_||e[13]!==c||e[14]!==d||e[15]!==f||e[16]!==m||e[17]!==h||e[18]!==p||e[19]!==g||e[20]!==b||e[21]!==v||e[22]!==x||e[23]!==y||e[24]!==C||e[25]!==S||e[26]!==A||e[27]!==$||e[28]!==w||e[29]!==D?(j=OS("div",{className:$,style:S,children:[ds(oe,{CustomComponent:u,Fallback:ds(xe,{label:d,localized:f,path:g,required:x})}),OS("div",{className:`${Ce}__wrap`,children:[ds(oe,{CustomComponent:a,Fallback:ds(He,{path:g,showError:C})}),n,l?ds(mt,{className:`field-${g.replace(/\./g,"__")}`,components:{DropdownIndicator:null},customProps:{editableProps:F},disabled:v,filterOption:()=>m?!(Array.isArray(w)&&m&&w.length>=m):!0,isClearable:!1,isCreatable:!0,isMulti:!0,isSortable:!0,menuIsOpen:!1,noOptionsMessage:()=>Array.isArray(w)&&w.length>=m?A("validation:limitReached",{max:m,value:w.length+1}):null,onChange:h,options:[],placeholder:A("general:enterAValue"),showError:C,value:D}):ds("input",{"data-rtl":y,disabled:v,id:`field-${g?.replace(/\./g,"__")}`,name:g,onChange:h,onKeyDown:p,placeholder:lj(b,_),ref:c,type:"text",value:w||""}),o,ds(oe,{CustomComponent:s,Fallback:ds(Be,{description:i,path:g})})]})]}),e[5]=o,e[6]=n,e[7]=s,e[8]=a,e[9]=u,e[10]=i,e[11]=l,e[12]=_,e[13]=c,e[14]=d,e[15]=f,e[16]=m,e[17]=h,e[18]=p,e[19]=g,e[20]=b,e[21]=v,e[22]=x,e[23]=y,e[24]=C,e[25]=S,e[26]=A,e[27]=$,e[28]=w,e[29]=D,e[30]=j):j=e[30],j};function cj(t){t.currentTarget.contentEditable="false"}function uj(t,e,o){let n=`${e}--editable`;return{onBlur:cj,onClick:r=>{r.currentTarget.contentEditable="true",r.currentTarget.classList.add(n),r.currentTarget.focus()},onKeyDown:r=>{if(r.key==="Enter"||r.key==="Tab"||r.key==="Escape"){if(r.currentTarget.contentEditable="false",r.currentTarget.classList.remove(n),t.value.value=r.currentTarget.innerText,t.label=r.currentTarget.innerText,t.value.value.replaceAll(`
54
- `,""))o.onChange(o.value,{action:"create-option",option:t});else if(Array.isArray(o.value)){let s=o.value.filter(i=>i.id!==t.id);o.onChange(s,{action:"pop-value",removedValue:t})}r.preventDefault()}r.stopPropagation()}}}var hj=t=>{let{field:e,field:{admin:{className:o,description:n,placeholder:r,rtl:s}={},hasMany:i,label:a,localized:l,maxLength:c,maxRows:u,minLength:d,minRows:f,required:m},inputRef:h,path:p,readOnly:g,validate:b}=t,v=Ne(),{config:{localization:x}}=H(),y=MS((L,V)=>{if(typeof b=="function")return b(L,{...V,maxLength:c,minLength:d,required:m})},[b,d,c,m]),{customComponents:{AfterInput:C,BeforeInput:S,Description:w,Error:D,Label:_}={},disabled:A,path:F,setValue:R,showError:I,value:E}=Ee({potentiallyStalePath:p,validate:y}),T=Zi({fieldLocalized:l,fieldRTL:s,locale:v,localizationConfig:x||void 0}),[$,j]=pj([]),N=MS(L=>{if(!(g||A)){let V;L?Array.isArray(L)?V=L.map(M=>M.value?.value||M.value):V=[L.value?.value||L.value]:V=[],R(V)}},[g,R,A]);mj(()=>{i&&Array.isArray(E)&&j(E.map((L,V)=>({id:`${L}${V}`,label:`${L}`,value:{toString:()=>`${L}${V}`,value:L?.value||L}})))},[E,i]);let P=fj(()=>rt(e),[e]);return dj(lb,{AfterInput:C,BeforeInput:S,className:o,Description:w,description:n,Error:D,hasMany:i,inputRef:h,Label:_,label:a,localized:l,maxRows:u,minRows:f,onChange:i?N:L=>{R(L.target.value)},path:F,placeholder:r,readOnly:g||A,required:m,rtl:T,showError:I,style:P,value:E||"",valueToRender:$})},di=je(hj);import{jsx as vj}from"react/jsx-runtime";import{getTranslation as xj}from"@payloadcms/translations";import{useCallback as yj,useMemo as Cj}from"react";import{c as gj}from"react/compiler-runtime";import{jsx as ms,jsxs as BS}from"react/jsx-runtime";import{getTranslation as bj}from"@payloadcms/translations";import"react";var cb=t=>{let e=gj(25),{AfterInput:o,BeforeInput:n,className:r,Description:s,description:i,Error:a,Label:l,label:c,localized:u,onChange:d,path:f,placeholder:m,readOnly:h,required:p,rows:g,rtl:b,showError:v,style:x,value:y}=t,{i18n:C}=k(),S=v&&"error",w=h&&"read-only",D;e[0]!==r||e[1]!==S||e[2]!==w?(D=[Ce,"textarea",r,S,w].filter(Boolean),e[0]=r,e[1]=S,e[2]=w,e[3]=D):D=e[3];let _=D.join(" "),A;return e[4]!==o||e[5]!==n||e[6]!==s||e[7]!==a||e[8]!==l||e[9]!==i||e[10]!==C||e[11]!==c||e[12]!==u||e[13]!==d||e[14]!==f||e[15]!==m||e[16]!==h||e[17]!==p||e[18]!==g||e[19]!==b||e[20]!==v||e[21]!==x||e[22]!==_||e[23]!==y?(A=BS("div",{className:_,style:x,children:[ms(oe,{CustomComponent:l,Fallback:ms(xe,{label:c,localized:u,path:f,required:p})}),BS("div",{className:`${Ce}__wrap`,children:[ms(oe,{CustomComponent:a,Fallback:ms(He,{path:f,showError:v})}),n,ms("label",{className:"textarea-outer",htmlFor:`field-${f.replace(/\./g,"__")}`,children:ms("textarea",{"data-rtl":b,disabled:h,id:`field-${f.replace(/\./g,"__")}`,name:f,onChange:d,placeholder:bj(m,C),rows:g,value:y||""})}),o,ms(oe,{CustomComponent:s,Fallback:ms(Be,{description:i,path:f})})]})]}),e[4]=o,e[5]=n,e[6]=s,e[7]=a,e[8]=l,e[9]=i,e[10]=C,e[11]=c,e[12]=u,e[13]=d,e[14]=f,e[15]=m,e[16]=h,e[17]=p,e[18]=g,e[19]=b,e[20]=v,e[21]=x,e[22]=_,e[23]=y,e[24]=A):A=e[24],A};var wj=t=>{let{field:e,field:{admin:{className:o,description:n,placeholder:r,rows:s,rtl:i}={},label:a,localized:l,maxLength:c,minLength:u,required:d},path:f,readOnly:m,validate:h}=t,{i18n:p}=k(),{config:{localization:g}}=H(),b=Ne(),v=Zi({fieldLocalized:l,fieldRTL:i,locale:b,localizationConfig:g||void 0}),x=yj((T,$)=>{if(typeof h=="function")return h(T,{...$,maxLength:c,minLength:u,required:d})},[h,d,c,u]),{customComponents:{AfterInput:y,BeforeInput:C,Description:S,Error:w,Label:D}={},disabled:_,path:A,setValue:F,showError:R,value:I}=Ee({potentiallyStalePath:f,validate:x}),E=Cj(()=>rt(e),[e]);return vj(cb,{AfterInput:y,BeforeInput:C,className:o,Description:S,description:n,Error:w,Label:D,label:a,localized:l,onChange:T=>{F(T.target.value)},path:A,placeholder:xj(r,p),readOnly:m||_,required:d,rows:s,rtl:v,showError:R,style:E,value:I})},Ec=je(wj);var Pc=()=>null;import{jsx as YO}from"react/jsx-runtime";import ZO,{useMemo as JO}from"react";import{jsx as $t,jsxs as bi,Fragment as Uc}from"react/jsx-runtime";import*as UI from"qs-esm";import Xr,{useCallback as HI,useEffect as zI,useMemo as XI}from"react";import{c as kI}from"react/compiler-runtime";import{jsx as pi,jsxs as $O}from"react/jsx-runtime";import{validateMimeType as kO}from"payload/shared";import nn from"react";import{jsx as Om,jsxs as ub}from"react/jsx-runtime";import Aj from"react";import{jsx as Sj}from"react/jsx-runtime";import fs from"react";var VS=t=>{t.preventDefault(),t.stopPropagation()},Ij="dropzone";function mi({children:t,className:e,disabled:o=!1,dropzoneStyle:n="default",multipleFiles:r,onChange:s}){let i=fs.useRef(null),[a,l]=fs.useState(!1),c=fs.useCallback(p=>{if(!r&&p.length>1){let g=new DataTransfer;g.items.add(p[0]),s(g.files)}else s(p)},[r,s]),u=fs.useCallback(p=>{p.preventDefault(),p.stopPropagation(),p.clipboardData.files&&p.clipboardData.files.length>0&&c(p.clipboardData.files)},[c]),d=fs.useCallback(p=>{p.preventDefault(),p.stopPropagation(),l(!0)},[]),f=fs.useCallback(p=>{p.preventDefault(),p.stopPropagation(),l(!1)},[]),m=fs.useCallback(p=>{p.preventDefault(),p.stopPropagation(),l(!1),p.dataTransfer.files&&p.dataTransfer.files.length>0&&(c(p.dataTransfer.files),l(!1),p.dataTransfer.clearData())},[c]);fs.useEffect(()=>{let p=i.current;return p&&!o?(p.addEventListener("dragenter",d),p.addEventListener("dragleave",f),p.addEventListener("dragover",VS),p.addEventListener("drop",m),p.addEventListener("paste",u),()=>{p.removeEventListener("dragenter",d),p.removeEventListener("dragleave",f),p.removeEventListener("dragover",VS),p.removeEventListener("drop",m),p.removeEventListener("paste",u)}):()=>null},[o,d,f,m,u]);let h=[Ij,e,a?"dragging":"",`dropzoneStyle--${n}`].filter(Boolean).join(" ");return Sj("div",{className:h,ref:i,children:t})}import{jsx as WS,jsxs as Dj}from"react/jsx-runtime";import"react";import{c as Rj}from"react/compiler-runtime";import{jsx as GS}from"react/jsx-runtime";import"react";var _j="drawer-close-button";function jm(t){let e=Rj(3),{onClick:o}=t,{t:n}=k(),r;return e[0]!==o||e[1]!==n?(r=GS("button",{"aria-label":n("general:close"),className:_j,onClick:o,type:"button",children:GS(pt,{})}),e[0]=o,e[1]=n,e[2]=r):r=e[2],r}var Fj="bulk-upload--drawer-header";function Da({onClose:t,title:e}){return Dj("div",{className:Fj,children:[WS("h2",{title:e,children:e}),WS(jm,{onClick:t})]})}var Mm="bulk-upload--add-files";function Bm({acceptMimeTypes:t,onCancel:e,onDrop:o}){let{t:n}=k(),r=Aj.useRef(null);return ub("div",{className:Mm,children:[Om(Da,{onClose:e,title:n("upload:addFiles")}),Om("div",{className:`${Mm}__dropArea`,children:ub(mi,{multipleFiles:!0,onChange:o,children:[Om(ne,{buttonStyle:"pill",iconPosition:"left",onClick:()=>{r.current&&r.current.click()},size:"small",children:n("upload:selectFile")}),Om("input",{accept:t,"aria-hidden":"true",className:`${Mm}__hidden-input`,hidden:!0,multiple:!0,onChange:s=>{s.target.files&&s.target.files.length>0&&o(s.target.files)},ref:r,type:"file"}),ub("p",{className:`${Mm}__dragAndDropText`,children:[n("general:or")," ",n("upload:dragAndDrop")]})]})})]})}import{c as PO}from"react/compiler-runtime";import{jsx as zc,jsxs as Rb}from"react/jsx-runtime";import{getTranslation as NO}from"@payloadcms/translations";import{reduceFieldsToValues as LO}from"payload/shared";import"react";import{c as sI}from"react/compiler-runtime";import{jsx as Wr,jsxs as Lc}from"react/jsx-runtime";import"react";import{c as Yj}from"react/compiler-runtime";import{jsx as zm,jsxs as Zj}from"react/jsx-runtime";import"react";import{jsx as Ej,jsxs as Pj}from"react/jsx-runtime";import{isImage as Nj}from"payload/shared";import*as Vm from"qs-esm";import tt from"react";var HS=t=>new Promise((e,o)=>{let n=new Image;n.src=URL.createObjectURL(t),n.onload=()=>{let s,i,a=n.width/n.height;a>1?(i=280,s=280/a):(i=280*a,s=280);let l=new OffscreenCanvas(i,s);l.getContext("2d").drawImage(n,0,0,i,s),l.convertToBlob({type:"image/jpeg",quality:.25}).then(u=>{URL.revokeObjectURL(n.src);let d=new FileReader;d.onload=()=>e(d.result),d.onerror=o,d.readAsDataURL(u)}).catch(o)},n.onerror=r=>{URL.revokeObjectURL(n.src),o(r)}});var zS=Ds(eb(),1);import{reduceFieldsToValues as Tj}from"payload/shared";async function XS(t={},e={},o,n){let r=Tj(t,!0),s=r?.file;if(s&&delete r.file,s&&typeof n=="function"){let l=s.name,c=await n({file:s,updateFilename:u=>{l=u}});s=JSON.stringify({clientUploadContext:c,collectionSlug:o,filename:l,mimeType:s.type,size:s.size})}let i={...r,...e},a={_payload:JSON.stringify(i),file:s};return(0,zS.serialize)(a,{indices:!0,nullsAsUndefineds:!1})}function US(t,e){switch(e.type){case"ADD_FORMS":{let o=[];for(let n=0;n<e.files.length;n++)o[n]={errorCount:0,formState:{...e.initialState||{},file:{initialValue:e.files[n],valid:!0,value:e.files[n]}},uploadEdits:{}};return{...t,activeIndex:0,forms:[...o,...t.forms]}}case"REMOVE_FORM":{let o=[...t.forms],[n]=o.splice(e.index,1),r=t.activeIndex>=e.index,s=t.activeIndex===e.index?e.index:r?t.activeIndex-1:t.activeIndex,i=Math.min(o.length-1,s);return{...t,activeIndex:r?i:t.activeIndex,forms:o,totalErrorCount:t.totalErrorCount-n.errorCount}}case"REPLACE":return{...t,...e.state};case"SET_ACTIVE_INDEX":return{...t,activeIndex:e.index};case"UPDATE_ERROR_COUNT":{let o=[...t.forms];return o[e.index].errorCount=e.count,{...t,forms:o,totalErrorCount:t.forms.reduce((n,r)=>n+r.errorCount,0)}}case"UPDATE_FORM":{let o=[...t.forms];return o[e.index].errorCount=e.errorCount,o[e.index]={...o[e.index],formState:{...o[e.index].formState,...e.formState},uploadEdits:{...o[e.index].uploadEdits,...e.uploadEdits}},{...t,forms:o,totalErrorCount:t.forms.reduce((n,r)=>n+r.errorCount,0)}}default:return t}}var YS=tt.createContext({activeIndex:0,addFiles:()=>Promise.resolve(),bulkUpdateForm:()=>null,collectionSlug:"",docPermissions:void 0,documentSlots:{},forms:[],getFormDataRef:{current:()=>({})},hasPublishPermission:!1,hasSavePermission:!1,hasSubmitted:!1,isInitializing:!1,removeFile:()=>{},saveAllDocs:()=>Promise.resolve(),setActiveIndex:()=>0,setFormTotalErrorCount:()=>{},thumbnailUrls:[],totalErrorCount:0,updateUploadEdits:()=>{}}),Lj={activeIndex:0,forms:[],totalErrorCount:0};function ZS({children:t}){let{config:e}=H(),{routes:{api:o},serverURL:n}=e,{code:r}=Ne(),{i18n:s,t:i}=k(),{getDocumentSlots:a,getFormState:l}=Dt(),{getUploadHandler:c}=Dc(),[u,d]=tt.useState({}),[f,m]=tt.useState(!1),[h,p]=tt.useState(),[g,b]=tt.useState(!1),[v,x]=tt.useState(!1),[y,C]=tt.useState(!1),[S,w]=tt.useState(!1),[D,_]=tt.useState(!1),[A,F]=tt.useReducer(US,Lj),{activeIndex:R,forms:I,totalErrorCount:E}=A,T=tt.useRef(I);T.current=I;let $=I.length,j=tt.useRef([]),N=tt.useRef(new Set),[P,L]=tt.useState([]);tt.useEffect(()=>{(async()=>{let Y=[...j.current];for(let ie=0;ie<$;ie++){let me=T.current[ie].formState.file.value;if(N.current.has(me)||!me||!Nj(me.type))continue;N.current.add(me);let we=await HS(me);Y[ie]=we,j.current=Y,L([...Y]),await new Promise(ze=>setTimeout(ze,100))}})()},[$]);let{toggleLoadingOverlay:V}=dm(),{closeModal:M}=de(),{collectionSlug:O,drawerSlug:B,initialFiles:G,onSuccess:X}=Ho(),[Z,te]=tt.useState(!1),[U,z]=tt.useState(""),ce=tt.useRef(!1),J=tt.useRef(null),ue=tt.useRef(()=>({})),re=`${o}/${O}`,q=tt.useCallback(async()=>{let Y={locale:r||void 0},ie=`/${O}/access`,we=await(await fetch(`${n}${o}${ie}?${Vm.stringify(Y)}`,{credentials:"include",headers:{"Accept-Language":s.language,"Content-Type":"application/json"},method:"post"})).json(),ze=await fetch(`${n}${o}${ie}?${Vm.stringify(Y)}`,{body:JSON.stringify({_status:"published"}),credentials:"include",headers:{"Accept-Language":s.language,"Content-Type":"application/json"},method:"POST"}).then($e=>$e.json());p(we),b(wl({collectionSlug:O,docPermissions:we,isEditing:!1})),x(ze?.update),w(!0)},[o,r,O,s.language,n]),pe=tt.useCallback(async Y=>{Y?.signal&&Y.abort("aborting previous fetch for initial form state without files");let ie=await a({collectionSlug:O});d(ie);try{let{state:me}=await l({collectionSlug:O,docPermissions:h,docPreferences:{fields:{}},locale:r,operation:"create",renderAllFields:!0,schemaPath:O,skipValidation:!0});J.current=me,C(!0)}catch{}},[a,O,l,h,r]),he=tt.useCallback(Y=>{let ie=ue.current();F({type:"REPLACE",state:{activeIndex:Y,forms:I.map((me,we)=>we===R?{errorCount:me.errorCount,formState:ie,uploadEdits:me.uploadEdits}:me)}})},[I,R]),_e=tt.useCallback(async Y=>{V({isLoading:!0,key:"addingDocs"}),y||await pe(),F({type:"ADD_FORMS",files:Y,initialState:J.current}),V({isLoading:!1,key:"addingDocs"})},[pe,y,V]),ge=tt.useCallback(Y=>{j.current=j.current.filter((ie,me)=>!Y.includes(me)),L([...j.current])},[]),Ve=tt.useCallback(Y=>{F({type:"REMOVE_FORM",index:Y}),ge([Y])},[ge]),Q=tt.useCallback(({errorCount:Y,index:ie})=>{F({type:"UPDATE_ERROR_COUNT",count:Y,index:ie})},[]),Le=tt.useCallback(async({overrides:Y}={})=>{let ie=ue.current(),me=[...I];me[R]={errorCount:me[R].errorCount,formState:ie,uploadEdits:me[R].uploadEdits};let we=[];te(!0);for(let Ue=0;Ue<me.length;Ue++)try{let ft=me[Ue];z(i("general:uploadingBulk",{current:Ue+1,total:me.length}));let Qt=`${re}${Vm.stringify({uploadEdits:ft?.uploadEdits||void 0},{addQueryPrefix:!0})}`,Ge=await fetch(Qt,{body:await XS(ft.formState,Y,O,c({collectionSlug:O})),method:"POST"}),Je=await Ge.json();Ge.status===201&&Je?.doc&&we.push(Je.doc);let[Ye,xt]=(Je?.errors||[]).reduce(([jt,gt],qe)=>{let Tt=[],be=[];return qe?.message&&be.push(qe),Array.isArray(qe?.data?.errors)&&qe.data?.errors.forEach(K=>{K?.path?Tt.push(K):be.push(K)}),[[...jt,...Tt],[...gt,...be]]},[[],[]]);me[Ue]={errorCount:Ye.length,formState:Fc(me[Ue].formState,{type:"ADD_SERVER_ERRORS",errors:Ye})},(Ge.status===413||Ge.status===400)&&(me[Ue]={...me[Ue],errorCount:me[Ue].errorCount+1},fe.error(xt[0]?.message))}catch{}m(!0),z(""),te(!1);let ze=[],$e=[];me.forEach(({errorCount:Ue},ft)=>{Ue?ze.push(me[ft]):$e.push(ft)});let ot=Math.max(0,me.length-ze.length),Xe=me.length-ot;ot&&(fe.success(`Successfully saved ${ot} files`),typeof X=="function"&&X(we,Xe),ze.length&&$e.length&&ge($e)),Xe?fe.error(`Failed to save ${Xe} files`):M(B),F({type:"REPLACE",state:{activeIndex:0,forms:ze,totalErrorCount:ze.reduce((Ue,{errorCount:ft})=>Ue+ft,0)}})},[re,R,I,ge,X,O,c,i,M,B]),De=tt.useCallback(async(Y,ie)=>{for(let me=0;me<I.length;me++)if(Object.entries(Y).forEach(([we,ze])=>{I[me].formState[we]&&(I[me].formState[we].value=ze,F({type:"UPDATE_FORM",errorCount:I[me].errorCount,formState:I[me].formState,index:me}))}),typeof ie=="function"&&ie(),f){let{state:we}=await l({collectionSlug:O,docPermissions:h,docPreferences:null,formState:I[me].formState,operation:"create",schemaPath:O}),ze=Object.values(we).reduce(($e,ot)=>ot?.valid===!1?$e+1:$e,0);F({type:"UPDATE_FORM",errorCount:ze,formState:we,index:me})}},[O,h,I,l,f]),ae=tt.useCallback(Y=>{F({type:"UPDATE_FORM",errorCount:I[R].errorCount,formState:I[R].formState,index:R,uploadEdits:Y})},[R,I]),se=tt.useCallback(()=>{F({type:"REPLACE",state:{forms:I.map(Y=>({...Y,uploadEdits:{}}))}})},[I]);return tt.useEffect(()=>{O&&(y||pe(),S||q(),G&&_(!y||!S),y&&G&&!ce.current&&(_e(G),ce.current=!0))},[_e,G,pe,q,O,y,S]),Pj(YS,{value:{activeIndex:A.activeIndex,addFiles:_e,bulkUpdateForm:De,collectionSlug:O,docPermissions:h,documentSlots:u,forms:I,getFormDataRef:ue,hasPublishPermission:v,hasSavePermission:g,hasSubmitted:f,isInitializing:D,removeFile:Ve,resetUploadEdits:se,saveAllDocs:Le,setActiveIndex:he,setFormTotalErrorCount:Q,thumbnailUrls:P,totalErrorCount:E,updateUploadEdits:ae},children:[Z&&Ej(In,{animationDuration:"250ms",loadingText:U,overlayType:"fullscreen",show:!0}),t]})}function Io(){return tt.use(YS)}import{jsx as Gr,jsxs as db}from"react/jsx-runtime";import{getTranslation as Hj}from"@payloadcms/translations";import{unflatten as tI}from"payload/shared";import zj,{useCallback as mb,useEffect as Xj,useMemo as Uj,useState as oI}from"react";import{c as Mj}from"react/compiler-runtime";import{jsx as eI,jsxs as Bj}from"react/jsx-runtime";import{useState as Vj}from"react";var JS=t=>{let e=["file","mimeType","thumbnailURL","width","height","filesize","filename","url","focalX","focalY","sizes"];return t.filter(o=>!e.includes("name"in o&&o.name))};import{fieldAffectsData as $j,fieldHasSubFields as kj,fieldIsHiddenOrDisabled as jj,getFieldPermissions as Oj}from"payload/shared";import{fieldAffectsData as qS}from"payload/shared";var Fa=(t,e)=>t?qS(e)?`${t}.${e.name}`:t:qS(e)?e.name:"";import{jsx as Gm,jsxs as QS}from"react/jsx-runtime";import{Fragment as KS}from"react";var Nc=({CustomLabel:t,field:e,prefix:o})=>QS(KS,{children:[o?QS(KS,{children:[Gm("span",{style:{display:"inline-block"},children:o})," > "]}):null,Gm("span",{style:{display:"inline-block"},children:Gm(oe,{CustomComponent:t,Fallback:Gm(xe,{label:"label"in e&&e.label})})})]});var Wm=({fields:t,formState:e,labelPrefix:o=null,parentPath:n="",path:r="",permissions:s})=>{if(!t)return[];let i=e?.[r]?.customComponents?.Label;return t?.reduce((a,l)=>{let{operation:c,permissions:u,read:d}=Oj({field:l,operation:"update",parentName:n?.includes(".")?n.split(".")[n.split(".").length-1]:n,permissions:s});if(($j(l)||l.type==="ui")&&(l.admin?.disableBulkEdit||l.unique||jj(l)||"readOnly"in l&&l.readOnly||!c||!d))return a;if(!(l.type==="array"||l.type==="blocks")&&kj(l))return[...a,...Wm({fields:l.fields,labelPrefix:Nc({CustomLabel:i,field:l,prefix:o}),parentPath:r,path:Fa(r,l),permissions:u})];if(l.type==="tabs"&&"tabs"in l)return[...a,...l.tabs.reduce((m,h)=>{if("fields"in h){let p="name"in h&&h.name;return[...m,...Wm({fields:h.fields,labelPrefix:o,parentPath:r,path:p?Fa(r,l):r,permissions:u})]}},[])];let f={label:Nc({CustomLabel:i,field:l,prefix:o}),value:{field:l,fieldPermissions:u,path:Fa(r,l)}};return[...a,f]},[])};var Gj="field-select",Hm=t=>{let e=Mj(14),{fields:o,onChange:n,permissions:r}=t,{t:s}=k(),{dispatchFields:i,getFields:a}=Oe(),l;e[0]!==o||e[1]!==a||e[2]!==r?(l=()=>Wm({fields:JS(o),formState:a(),permissions:r}),e[0]=o,e[1]=a,e[2]=r,e[3]=l):l=e[3];let[c]=Vj(l),u;if(e[4]!==i||e[5]!==a||e[6]!==n||e[7]!==c||e[8]!==s){let d;e[10]!==i||e[11]!==a||e[12]!==n?(d=f=>n({dispatchFields:i,formState:a(),selected:f}),e[10]=i,e[11]=a,e[12]=n,e[13]=d):d=e[13],u=Bj("div",{className:Gj,children:[eI(xe,{label:s("fields:selectFieldsToEdit")}),eI(mt,{getOptionValue:Wj,isMulti:!0,onChange:d,options:c})]}),e[4]=i,e[5]=a,e[6]=n,e[7]=c,e[8]=s,e[9]=u}else u=e[9];return u};function Wj(t){return typeof t.value=="object"&&"path"in t.value?String(t.value.path):String(t.value)}var rI=t=>{let{collection:{fields:e,labels:{plural:o,singular:n}}={},collection:r,drawerSlug:s,forms:i}=t,[a,l]=oI(!1),{permissions:c}=Ae(),{i18n:u,t:d}=k(),{closeModal:f}=de(),{bulkUpdateForm:m}=Io(),{getFormState:h}=Dt(),p=zj.useRef(null),[g,b]=oI([]),v=c?.collections?.[r.slug],x=Uj(()=>tI(g.reduce((w,D)=>(w[D.value.path]=!0,w),{})),[g]),y=mb(async({formState:w,submitted:D})=>{let _=or(p),{state:A}=await h({collectionSlug:r.slug,docPermissions:v,docPreferences:null,formState:w,operation:"update",schemaPath:r.slug,select:x,signal:_.signal,skipValidation:!D});return p.current=null,A},[h,r,v,x]);Xj(()=>{let w=p.current;return()=>{tr(w)}},[]);let C=mb(w=>{let D=g.reduce((_,A)=>(w[A.value.path]&&(_[A.value.path]=w[A.value.path].value),_),{});m(D,()=>f(s))},[f,s,m,g]),S=mb(async({dispatchFields:w,formState:D,selected:_})=>{l(!0),b(_||[]);let{state:A}=await h({collectionSlug:r.slug,docPermissions:v,docPreferences:null,formState:D,operation:"update",schemaPath:r.slug,select:tI(_.reduce((F,R)=>(F[R.value.path]=!0,F),{})),skipValidation:!0});w({type:"UPDATE_MANY",formState:A}),l(!1)},[h,r,v]);return db("div",{className:`${gr}__main`,children:[db("div",{className:`${gr}__header`,children:[Gr("h2",{className:`${gr}__header__title`,children:d("general:editingLabel",{count:i.length,label:Hj(i.length>1?o:n,u)})}),Gr("button",{"aria-label":d("general:close"),className:`${gr}__header__close`,id:`close-drawer__${s}`,onClick:()=>f(s),type:"button",children:Gr(pt,{})})]}),db(An,{className:`${gr}__form`,isInitializing:a,onChange:[y],onSubmit:C,children:[Gr(Hm,{fields:e,onChange:S,permissions:v.fields}),g.length===0?null:Gr("div",{className:"render-fields",children:g.map((w,D)=>{let{value:{field:_,fieldPermissions:A,path:F}}=w;return Gr(Aa,{clientFieldConfig:_,indexPath:"",parentPath:"",parentSchemaPath:"",path:F,permissions:A},`${F}-${D}`)})}),Gr("div",{className:`${gr}__sidebar-wrap`,children:Gr("div",{className:`${gr}__sidebar`,children:Gr("div",{className:`${gr}__sidebar-sticky-wrap`,children:Gr("div",{className:`${gr}__document-actions`,children:Gr(ne,{type:"submit",children:d("general:applyChanges")})})})})})]})]})};var gr="edit-many-bulk-uploads",nI=t=>{let e=Yj(5),{collection:o,collection:n}=t,{slug:r}=o===void 0?{}:o,{permissions:s}=Ae(),{t:i}=k(),{forms:a}=Io(),c=s?.collections?.[r]?.update,u=`edit-${r}-bulk-uploads`;if(!c)return null;let d;return e[0]!==n||e[1]!==u||e[2]!==a||e[3]!==i?(d=Zj("div",{className:gr,children:[zm(ur,{"aria-label":i("general:editAll"),className:`${gr}__toggle`,slug:u,children:i("general:editAll")}),zm(Ns,{children:zm(Pt,{Header:null,slug:u,children:zm(rI,{collection:n,drawerSlug:u,forms:a})})})]}),e[0]=n,e[1]=u,e[2]=a,e[3]=i,e[4]=d):d=e[4],d};var Ta="bulk-upload--actions-bar";function iI(t){let e=sI(15),{collectionConfig:o}=t,{activeIndex:n,forms:r,setActiveIndex:s}=Io(),{t:i}=k(),a=n+1,l;if(e[0]!==n||e[1]!==o||e[2]!==r.length||e[3]!==s||e[4]!==i||e[5]!==a){let c;e[7]!==n||e[8]!==r.length||e[9]!==s?(c=()=>{let d=n-1;d<0?s(r.length-1):s(d)},e[7]=n,e[8]=r.length,e[9]=s,e[10]=c):c=e[10];let u;e[11]!==n||e[12]!==r.length||e[13]!==s?(u=()=>{let d=n+1;d===r.length?s(0):s(d)},e[11]=n,e[12]=r.length,e[13]=s,e[14]=u):u=e[14],l=Lc("div",{className:Ta,children:[Lc("div",{className:`${Ta}__navigation`,children:[Lc("p",{className:`${Ta}__locationText`,children:[Wr("strong",{children:a})," of ",Wr("strong",{children:r.length})]}),Lc("div",{className:`${Ta}__controls`,children:[Wr(ne,{"aria-label":i("general:previous"),buttonStyle:"none",onClick:c,type:"button",children:Wr(Ze,{direction:"left"})}),Wr(ne,{"aria-label":i("general:next"),buttonStyle:"none",onClick:u,type:"button",children:Wr(Ze,{direction:"right"})})]}),Wr(nI,{collection:o})]}),Wr(fb,{className:`${Ta}__saveButtons`})]}),e[0]=n,e[1]=o,e[2]=r.length,e[3]=s,e[4]=i,e[5]=a,e[6]=l}else l=e[6];return l}function fb(t){let e=sI(12),{className:o}=t,{getEntityConfig:n}=H(),{t:r}=k(),{collectionSlug:s,hasPublishPermission:i,hasSavePermission:a,saveAllDocs:l}=Io(),c;e[0]!==s||e[1]!==n?(c=n({collectionSlug:s}),e[0]=s,e[1]=n,e[2]=c):c=e[2];let u=c,d;e[3]!==o?(d=[`${Ta}__buttons`,o].filter(Boolean),e[3]=o,e[4]=d):d=e[4];let f=d.join(" "),m;return e[5]!==u?.versions?.drafts||e[6]!==i||e[7]!==a||e[8]!==l||e[9]!==r||e[10]!==f?(m=Lc("div",{className:f,children:[u?.versions?.drafts&&a?Wr(ne,{buttonStyle:"secondary",onClick:()=>void l({overrides:{_status:"draft"}}),children:r("version:saveDraft")}):null,u?.versions?.drafts&&i?Wr(ne,{onClick:()=>void l({overrides:{_status:"published"}}),children:r("version:publish")}):null,!u?.versions?.drafts&&a?Wr(ne,{onClick:()=>void l(),children:r("general:save")}):null]}),e[5]=u?.versions?.drafts,e[6]=i,e[7]=a,e[8]=l,e[9]=r,e[10]=f,e[11]=m):m=e[11],m}import{c as Jj}from"react/compiler-runtime";import{jsx as qj}from"react/jsx-runtime";import"react";var $c="bulk-upload--discard-without-saving";function aI(){let t=Jj(9),{t:e}=k(),{closeModal:o}=de(),{drawerSlug:n}=Ho(),r;t[0]!==o?(r=()=>{o($c)},t[0]=o,t[1]=r):r=t[1];let s=r,i;t[2]!==o||t[3]!==n?(i=()=>{o(n),o($c)},t[2]=o,t[3]=n,t[4]=i):i=t[4];let a=i,l;return t[5]!==s||t[6]!==a||t[7]!==e?(l=qj(It,{body:e("general:changesNotSaved"),cancelLabel:e("general:stayOnThisPage"),confirmLabel:e("general:leaveAnyway"),heading:e("general:leaveWithoutSaving"),modalSlug:$c,onCancel:s,onConfirm:a}),t[5]=s,t[6]=a,t[7]=e,t[8]=l):l=t[8],l}import{jsx as xs,jsxs as xO}from"react/jsx-runtime";import{useRouter as yO,useSearchParams as CO}from"next/navigation.js";import{formatAdminURL as wO}from"payload/shared";import Hc,{useCallback as TI,useEffect as EI}from"react";import{c as Qj}from"react/compiler-runtime";import{jsx as Kj}from"react/jsx-runtime";import{createContext as eO,use as tO,useState as oO}from"react";var lI=eO({mostRecentUpdate:null,reportUpdate:t=>null}),pb=t=>{let e=Qj(3),{children:o}=t,[n,r]=oO(null),s;return e[0]!==o||e[1]!==n?(s=Kj(lI,{value:{mostRecentUpdate:n,reportUpdate:r},children:o}),e[0]=o,e[1]=n,e[2]=s):s=e[2],s},fi=()=>tO(lI);import{jsx as ps,jsxs as cI}from"react/jsx-runtime";import{fieldIsSidebar as rO}from"payload/shared";import{useMemo as nO}from"react";var br="document-fields",kc=({AfterFields:t,BeforeFields:e,Description:o,docPermissions:n,fields:r,forceSidebarWrap:s,readOnly:i,schemaPathSegments:a})=>{let{hasSidebarFields:l,mainFields:c,sidebarFields:u}=nO(()=>r.reduce((d,f)=>(rO(f)?(d.sidebarFields.push(f),d.mainFields.push(null),d.hasSidebarFields=!0):(d.mainFields.push(f),d.sidebarFields.push(null)),d),{hasSidebarFields:!1,mainFields:[],sidebarFields:[]}),[r]);return cI("div",{className:[br,l?`${br}--has-sidebar`:`${br}--no-sidebar`,s&&`${br}--force-sidebar-wrap`].filter(Boolean).join(" "),children:[ps("div",{className:`${br}__main`,children:cI(Bo,{className:`${br}__edit`,children:[o?ps("header",{className:`${br}__header`,children:ps("div",{className:`${br}__sub-header`,children:o})}):null,e,ps(So,{className:`${br}__fields`,fields:c,forceRender:!0,parentIndexPath:"",parentPath:"",parentSchemaPath:a.join("."),permissions:n?.fields,readOnly:i}),t]})}),l?ps("div",{className:`${br}__sidebar-wrap`,children:ps("div",{className:`${br}__sidebar`,children:ps("div",{className:`${br}__sidebar-fields`,children:ps(So,{fields:u,forceRender:!0,parentIndexPath:"",parentPath:"",parentSchemaPath:a.join("."),permissions:n?.fields,readOnly:i})})})}):null]})};import{c as DI}from"react/compiler-runtime";import{jsx as wt,jsxs as xr}from"react/jsx-runtime";import{isImage as FI}from"payload/shared";import Wc,{Fragment as gO,useCallback as Jm,useEffect as Cb,useRef as _I,useState as Gc}from"react";import{jsx as _t,jsxs as Po}from"react/jsx-runtime";import Ym,{useRef as La,useState as bs}from"react";import Vt,{PureComponent as sO,createRef as uI}from"react";var Xm={x:0,y:0,width:0,height:0,unit:"px"},Ea=(t,e,o)=>Math.min(Math.max(t,e),o),iO=(...t)=>t.filter(e=>e&&typeof e=="string").join(" "),dI=(t,e)=>t===e||t.width===e.width&&t.height===e.height&&t.x===e.x&&t.y===e.y&&t.unit===e.unit;function Pa(t,e,o){return t.unit==="%"?{...Xm,...t,unit:"%"}:{unit:"%",x:t.x?t.x/e*100:0,y:t.y?t.y/o*100:0,width:t.width?t.width/e*100:0,height:t.height?t.height/o*100:0}}function hs(t,e,o){return t.unit?t.unit==="px"?{...Xm,...t,unit:"px"}:{unit:"px",x:t.x?t.x*e/100:0,y:t.y?t.y*o/100:0,width:t.width?t.width*e/100:0,height:t.height?t.height*o/100:0}:{...Xm,...t,unit:"px"}}function mI(t,e,o,n,r,s=0,i=0,a=n,l=r){let c={...t},u=Math.min(s,n),d=Math.min(i,r),f=Math.min(a,n),m=Math.min(l,r);e&&(e>1?(u=i?i*e:u,d=u/e,f=a*e):(d=s?s/e:d,u=d*e,m=l/e)),c.y<0&&(c.height=Math.max(c.height+c.y,d),c.y=0),c.x<0&&(c.width=Math.max(c.width+c.x,u),c.x=0);let h=n-(c.x+c.width);h<0&&(c.x=Math.min(c.x,n-u),c.width+=h);let p=r-(c.y+c.height);if(p<0&&(c.y=Math.min(c.y,r-d),c.height+=p),c.width<u&&((o==="sw"||o=="nw")&&(c.x-=u-c.width),c.width=u),c.height<d&&((o==="nw"||o=="ne")&&(c.y-=d-c.height),c.height=d),c.width>f&&((o==="sw"||o=="nw")&&(c.x-=f-c.width),c.width=f),c.height>m&&((o==="nw"||o=="ne")&&(c.y-=m-c.height),c.height=m),e){let g=c.width/c.height;if(g<e){let b=Math.max(c.width/e,d);(o==="nw"||o=="ne")&&(c.y-=b-c.height),c.height=b}else if(g>e){let b=Math.max(c.height*e,u);(o==="sw"||o=="nw")&&(c.x-=b-c.width),c.width=b}}return c}function aO(t,e,o,n){let r={...t};return e==="ArrowLeft"?n==="nw"?(r.x-=o,r.y-=o,r.width+=o,r.height+=o):n==="w"?(r.x-=o,r.width+=o):n==="sw"?(r.x-=o,r.width+=o,r.height+=o):n==="ne"?(r.y+=o,r.width-=o,r.height-=o):n==="e"?r.width-=o:n==="se"&&(r.width-=o,r.height-=o):e==="ArrowRight"&&(n==="nw"?(r.x+=o,r.y+=o,r.width-=o,r.height-=o):n==="w"?(r.x+=o,r.width-=o):n==="sw"?(r.x+=o,r.width-=o,r.height-=o):n==="ne"?(r.y-=o,r.width+=o,r.height+=o):n==="e"?r.width+=o:n==="se"&&(r.width+=o,r.height+=o)),e==="ArrowUp"?n==="nw"?(r.x-=o,r.y-=o,r.width+=o,r.height+=o):n==="n"?(r.y-=o,r.height+=o):n==="ne"?(r.y-=o,r.width+=o,r.height+=o):n==="sw"?(r.x+=o,r.width-=o,r.height-=o):n==="s"?r.height-=o:n==="se"&&(r.width-=o,r.height-=o):e==="ArrowDown"&&(n==="nw"?(r.x+=o,r.y+=o,r.width-=o,r.height-=o):n==="n"?(r.y+=o,r.height-=o):n==="ne"?(r.y+=o,r.width-=o,r.height-=o):n==="sw"?(r.x-=o,r.width+=o,r.height+=o):n==="s"?r.height+=o:n==="se"&&(r.width+=o,r.height+=o)),r}var Na={capture:!0,passive:!1},gs=class Hr extends sO{constructor(){super(...arguments),this.docMoveBound=!1,this.mouseDownOnCrop=!1,this.dragStarted=!1,this.evData={startClientX:0,startClientY:0,startCropX:0,startCropY:0,clientX:0,clientY:0,isResize:!0},this.componentRef=uI(),this.mediaRef=uI(),this.initChangeCalled=!1,this.state={cropIsActive:!1,newCropIsBeingDrawn:!1},this.onCropPointerDown=e=>{let{crop:o,disabled:n}=this.props,r=this.getBox();if(!o)return;let s=hs(o,r.width,r.height);if(n)return;e.cancelable&&e.preventDefault(),this.bindDocMove(),this.componentRef.current.focus({preventScroll:!0});let i=e.target.dataset.ord,a=!!i,l=e.clientX,c=e.clientY,u=s.x,d=s.y;if(i){let f=e.clientX-r.x,m=e.clientY-r.y,h=0,p=0;i==="ne"||i=="e"?(h=f-(s.x+s.width),p=m-s.y,u=s.x,d=s.y+s.height):i==="se"||i==="s"?(h=f-(s.x+s.width),p=m-(s.y+s.height),u=s.x,d=s.y):i==="sw"||i=="w"?(h=f-s.x,p=m-(s.y+s.height),u=s.x+s.width,d=s.y):(i==="nw"||i=="n")&&(h=f-s.x,p=m-s.y,u=s.x+s.width,d=s.y+s.height),l=u+r.x+h,c=d+r.y+p}this.evData={startClientX:l,startClientY:c,startCropX:u,startCropY:d,clientX:e.clientX,clientY:e.clientY,isResize:a,ord:i},this.mouseDownOnCrop=!0,this.setState({cropIsActive:!0})},this.onComponentPointerDown=e=>{let{crop:o,disabled:n,locked:r,keepSelection:s,onChange:i}=this.props,a=this.getBox();if(n||r||s&&o)return;e.cancelable&&e.preventDefault(),this.bindDocMove(),this.componentRef.current.focus({preventScroll:!0});let l=e.clientX-a.x,c=e.clientY-a.y,u={unit:"px",x:l,y:c,width:0,height:0};this.evData={startClientX:e.clientX,startClientY:e.clientY,startCropX:l,startCropY:c,clientX:e.clientX,clientY:e.clientY,isResize:!0},this.mouseDownOnCrop=!0,i(hs(u,a.width,a.height),Pa(u,a.width,a.height)),this.setState({cropIsActive:!0,newCropIsBeingDrawn:!0})},this.onDocPointerMove=e=>{let{crop:o,disabled:n,onChange:r,onDragStart:s}=this.props,i=this.getBox();if(n||!o||!this.mouseDownOnCrop)return;e.cancelable&&e.preventDefault(),this.dragStarted||(this.dragStarted=!0,s&&s(e));let{evData:a}=this;a.clientX=e.clientX,a.clientY=e.clientY;let l;a.isResize?l=this.resizeCrop():l=this.dragCrop(),dI(o,l)||r(hs(l,i.width,i.height),Pa(l,i.width,i.height))},this.onComponentKeyDown=e=>{let{crop:o,disabled:n,onChange:r,onComplete:s}=this.props;if(n)return;let i=e.key,a=!1;if(!o)return;let l=this.getBox(),c=this.makePixelCrop(l),u=(navigator.platform.match("Mac")?e.metaKey:e.ctrlKey)?Hr.nudgeStepLarge:e.shiftKey?Hr.nudgeStepMedium:Hr.nudgeStep;if(i==="ArrowLeft"?(c.x-=u,a=!0):i==="ArrowRight"?(c.x+=u,a=!0):i==="ArrowUp"?(c.y-=u,a=!0):i==="ArrowDown"&&(c.y+=u,a=!0),a){e.cancelable&&e.preventDefault(),c.x=Ea(c.x,0,l.width-c.width),c.y=Ea(c.y,0,l.height-c.height);let d=hs(c,l.width,l.height),f=Pa(c,l.width,l.height);r(d,f),s&&s(d,f)}},this.onHandlerKeyDown=(e,o)=>{let{aspect:n=0,crop:r,disabled:s,minWidth:i=0,minHeight:a=0,maxWidth:l,maxHeight:c,onChange:u,onComplete:d}=this.props,f=this.getBox();if(s||!r)return;if(e.key==="ArrowUp"||e.key==="ArrowDown"||e.key==="ArrowLeft"||e.key==="ArrowRight")e.stopPropagation(),e.preventDefault();else return;let m=(navigator.platform.match("Mac")?e.metaKey:e.ctrlKey)?Hr.nudgeStepLarge:e.shiftKey?Hr.nudgeStepMedium:Hr.nudgeStep,h=hs(r,f.width,f.height),p=aO(h,e.key,m,o),g=mI(p,n,o,f.width,f.height,i,a,l,c);if(!dI(r,g)){let b=Pa(g,f.width,f.height);u(g,b),d&&d(g,b)}},this.onDocPointerDone=e=>{let{crop:o,disabled:n,onComplete:r,onDragEnd:s}=this.props,i=this.getBox();this.unbindDocMove(),!(n||!o)&&this.mouseDownOnCrop&&(this.mouseDownOnCrop=!1,this.dragStarted=!1,s&&s(e),r&&r(hs(o,i.width,i.height),Pa(o,i.width,i.height)),this.setState({cropIsActive:!1,newCropIsBeingDrawn:!1}))},this.onDragFocus=e=>{var o;(o=this.componentRef.current)==null||o.scrollTo(0,0)}}get document(){return document}getBox(){let e=this.mediaRef.current;if(!e)return{x:0,y:0,width:0,height:0};let{x:o,y:n,width:r,height:s}=e.getBoundingClientRect();return{x:o,y:n,width:r,height:s}}componentDidUpdate(e){let{crop:o,onComplete:n}=this.props;if(n&&!e.crop&&o){let{width:r,height:s}=this.getBox();r&&s&&n(hs(o,r,s),Pa(o,r,s))}}componentWillUnmount(){this.resizeObserver&&this.resizeObserver.disconnect()}bindDocMove(){this.docMoveBound||(this.document.addEventListener("pointermove",this.onDocPointerMove,Na),this.document.addEventListener("pointerup",this.onDocPointerDone,Na),this.document.addEventListener("pointercancel",this.onDocPointerDone,Na),this.docMoveBound=!0)}unbindDocMove(){this.docMoveBound&&(this.document.removeEventListener("pointermove",this.onDocPointerMove,Na),this.document.removeEventListener("pointerup",this.onDocPointerDone,Na),this.document.removeEventListener("pointercancel",this.onDocPointerDone,Na),this.docMoveBound=!1)}getCropStyle(){let{crop:e}=this.props;if(e)return{top:`${e.y}${e.unit}`,left:`${e.x}${e.unit}`,width:`${e.width}${e.unit}`,height:`${e.height}${e.unit}`}}dragCrop(){let{evData:e}=this,o=this.getBox(),n=this.makePixelCrop(o),r=e.clientX-e.startClientX,s=e.clientY-e.startClientY;return n.x=Ea(e.startCropX+r,0,o.width-n.width),n.y=Ea(e.startCropY+s,0,o.height-n.height),n}getPointRegion(e,o,n,r){let{evData:s}=this,i=s.clientX-e.x,a=s.clientY-e.y,l;r&&o?l=o==="nw"||o==="n"||o==="ne":l=a<s.startCropY;let c;return n&&o?c=o==="nw"||o==="w"||o==="sw":c=i<s.startCropX,c?l?"nw":"sw":l?"ne":"se"}resolveMinDimensions(e,o,n=0,r=0){let s=Math.min(n,e.width),i=Math.min(r,e.height);return!o||!s&&!i?[s,i]:o>1?s?[s,s/o]:[i*o,i]:i?[i*o,i]:[s,s/o]}resizeCrop(){let{evData:e}=this,{aspect:o=0,maxWidth:n,maxHeight:r}=this.props,s=this.getBox(),[i,a]=this.resolveMinDimensions(s,o,this.props.minWidth,this.props.minHeight),l=this.makePixelCrop(s),c=this.getPointRegion(s,e.ord,i,a),u=e.ord||c,d=e.clientX-e.startClientX,f=e.clientY-e.startClientY;(i&&u==="nw"||u==="w"||u==="sw")&&(d=Math.min(d,-i)),(a&&u==="nw"||u==="n"||u==="ne")&&(f=Math.min(f,-a));let m={unit:"px",x:0,y:0,width:0,height:0};c==="ne"?(m.x=e.startCropX,m.width=d,o?(m.height=m.width/o,m.y=e.startCropY-m.height):(m.height=Math.abs(f),m.y=e.startCropY-m.height)):c==="se"?(m.x=e.startCropX,m.y=e.startCropY,m.width=d,o?m.height=m.width/o:m.height=f):c==="sw"?(m.x=e.startCropX+d,m.y=e.startCropY,m.width=Math.abs(d),o?m.height=m.width/o:m.height=f):c==="nw"&&(m.x=e.startCropX+d,m.width=Math.abs(d),o?(m.height=m.width/o,m.y=e.startCropY-m.height):(m.height=Math.abs(f),m.y=e.startCropY+f));let h=mI(m,o,c,s.width,s.height,i,a,n,r);return o||Hr.xyOrds.indexOf(u)>-1?l=h:Hr.xOrds.indexOf(u)>-1?(l.x=h.x,l.width=h.width):Hr.yOrds.indexOf(u)>-1&&(l.y=h.y,l.height=h.height),l.x=Ea(l.x,0,s.width-l.width),l.y=Ea(l.y,0,s.height-l.height),l}createCropSelection(){let{ariaLabels:e=Hr.defaultProps.ariaLabels,disabled:o,locked:n,renderSelectionAddon:r,ruleOfThirds:s,crop:i}=this.props,a=this.getCropStyle();if(i)return Vt.createElement("div",{style:a,className:"ReactCrop__crop-selection",onPointerDown:this.onCropPointerDown,"aria-label":e.cropArea,tabIndex:0,onKeyDown:this.onComponentKeyDown,role:"group"},!o&&!n&&Vt.createElement("div",{className:"ReactCrop__drag-elements",onFocus:this.onDragFocus},Vt.createElement("div",{className:"ReactCrop__drag-bar ord-n","data-ord":"n"}),Vt.createElement("div",{className:"ReactCrop__drag-bar ord-e","data-ord":"e"}),Vt.createElement("div",{className:"ReactCrop__drag-bar ord-s","data-ord":"s"}),Vt.createElement("div",{className:"ReactCrop__drag-bar ord-w","data-ord":"w"}),Vt.createElement("div",{className:"ReactCrop__drag-handle ord-nw","data-ord":"nw",tabIndex:0,"aria-label":e.nwDragHandle,onKeyDown:l=>this.onHandlerKeyDown(l,"nw"),role:"button"}),Vt.createElement("div",{className:"ReactCrop__drag-handle ord-n","data-ord":"n",tabIndex:0,"aria-label":e.nDragHandle,onKeyDown:l=>this.onHandlerKeyDown(l,"n"),role:"button"}),Vt.createElement("div",{className:"ReactCrop__drag-handle ord-ne","data-ord":"ne",tabIndex:0,"aria-label":e.neDragHandle,onKeyDown:l=>this.onHandlerKeyDown(l,"ne"),role:"button"}),Vt.createElement("div",{className:"ReactCrop__drag-handle ord-e","data-ord":"e",tabIndex:0,"aria-label":e.eDragHandle,onKeyDown:l=>this.onHandlerKeyDown(l,"e"),role:"button"}),Vt.createElement("div",{className:"ReactCrop__drag-handle ord-se","data-ord":"se",tabIndex:0,"aria-label":e.seDragHandle,onKeyDown:l=>this.onHandlerKeyDown(l,"se"),role:"button"}),Vt.createElement("div",{className:"ReactCrop__drag-handle ord-s","data-ord":"s",tabIndex:0,"aria-label":e.sDragHandle,onKeyDown:l=>this.onHandlerKeyDown(l,"s"),role:"button"}),Vt.createElement("div",{className:"ReactCrop__drag-handle ord-sw","data-ord":"sw",tabIndex:0,"aria-label":e.swDragHandle,onKeyDown:l=>this.onHandlerKeyDown(l,"sw"),role:"button"}),Vt.createElement("div",{className:"ReactCrop__drag-handle ord-w","data-ord":"w",tabIndex:0,"aria-label":e.wDragHandle,onKeyDown:l=>this.onHandlerKeyDown(l,"w"),role:"button"})),r&&Vt.createElement("div",{className:"ReactCrop__selection-addon",onMouseDown:l=>l.stopPropagation()},r(this.state)),s&&Vt.createElement(Vt.Fragment,null,Vt.createElement("div",{className:"ReactCrop__rule-of-thirds-hz"}),Vt.createElement("div",{className:"ReactCrop__rule-of-thirds-vt"})))}makePixelCrop(e){let o={...Xm,...this.props.crop||{}};return hs(o,e.width,e.height)}render(){let{aspect:e,children:o,circularCrop:n,className:r,crop:s,disabled:i,locked:a,style:l,ruleOfThirds:c}=this.props,{cropIsActive:u,newCropIsBeingDrawn:d}=this.state,f=s?this.createCropSelection():null,m=iO("ReactCrop",r,u&&"ReactCrop--active",i&&"ReactCrop--disabled",a&&"ReactCrop--locked",d&&"ReactCrop--new-crop",s&&e&&"ReactCrop--fixed-aspect",s&&n&&"ReactCrop--circular-crop",s&&c&&"ReactCrop--rule-of-thirds",!this.dragStarted&&s&&!s.width&&!s.height&&"ReactCrop--invisible-crop",n&&"ReactCrop--no-animate");return Vt.createElement("div",{ref:this.componentRef,className:m,style:l},Vt.createElement("div",{ref:this.mediaRef,className:"ReactCrop__child-wrapper",onPointerDown:this.onComponentPointerDown},o),f)}};gs.xOrds=["e","w"];gs.yOrds=["n","s"];gs.xyOrds=["nw","ne","se","sw"];gs.nudgeStep=1;gs.nudgeStepMedium=10;gs.nudgeStepLarge=100;gs.defaultProps={ariaLabels:{cropArea:"Use the arrow keys to move the crop selection area",nwDragHandle:"Use the arrow keys to move the north west drag handle to change the crop selection area",nDragHandle:"Use the up and down arrow keys to move the north drag handle to change the crop selection area",neDragHandle:"Use the arrow keys to move the north east drag handle to change the crop selection area",eDragHandle:"Use the up and down arrow keys to move the east drag handle to change the crop selection area",seDragHandle:"Use the arrow keys to move the south east drag handle to change the crop selection area",sDragHandle:"Use the up and down arrow keys to move the south drag handle to change the crop selection area",swDragHandle:"Use the arrow keys to move the south west drag handle to change the crop selection area",wDragHandle:"Use the up and down arrow keys to move the west drag handle to change the crop selection area"}};var fI=gs;import"react-image-crop/dist/ReactCrop.css";var yt="edit-upload",Um=t=>{let{name:e,onChange:o,ref:n,value:r}=t;return Po("div",{className:`${yt}__input`,children:[e,_t("input",{name:e,onChange:s=>o(s.target.value),ref:n,type:"number",value:r})]})},lO={height:100,unit:"%",width:100,x:0,y:0},hb=({fileName:t,fileSrc:e,imageCacheTag:o,initialCrop:n,initialFocalPoint:r,onSave:s,showCrop:i,showFocalPoint:a})=>{let{closeModal:l}=de(),{t:c}=k(),[u,d]=bs(()=>({...lO,...n||{}})),f={x:50,y:50},[m,h]=bs(()=>({...f,...r})),[p,g]=bs(!1),[b,v]=bs(0),[x,y]=bs(0),C=La(void 0),S=La(void 0),w=La(void 0),D=La(null),_=La(null),[A,F]=bs(!1),R=P=>{v(P.currentTarget.naturalHeight),y(P.currentTarget.naturalWidth),F(!0)},I=({dimension:P,value:L})=>{let V=parseInt(L);if(P==="width"&&V>=x||P==="height"&&V>=b)return null;let M=100*(V/(P==="width"?x:b));if(M===100||M===0)return null;d({...u,[P]:M})},E=({coordinate:P,value:L})=>{let V=parseInt(L);V>=0&&V<=100&&h(M=>({...M,[P]:V}))},T=()=>{typeof s=="function"&&s({crop:u||void 0,focalPoint:m,heightInPixels:Number(D?.current?.value??b),widthInPixels:Number(_?.current?.value??x)}),l(jc)},$=Ym.useCallback(({x:P,y:L})=>{h({x:P,y:L}),g(!1)},[]),j=()=>{let P=C.current.getBoundingClientRect(),L=i?w.current.getBoundingClientRect():S.current.getBoundingClientRect(),V=(L.left-P.left+L.width/2)/P.width*100,M=(L.top-P.top+L.height/2)/P.height*100;h({x:V,y:M})},N=o?`${e}?${encodeURIComponent(o)}`:e;return Po("div",{className:yt,children:[Po("div",{className:`${yt}__header`,children:[Po("h2",{title:`${c("general:editing")} ${t}`,children:[c("general:editing")," ",t]}),Po("div",{className:`${yt}__actions`,children:[_t(ne,{"aria-label":c("general:cancel"),buttonStyle:"secondary",className:`${yt}__cancel`,onClick:()=>l(jc),children:c("general:cancel")}),_t(ne,{"aria-label":c("general:applyChanges"),buttonStyle:"primary",className:`${yt}__save`,disabled:!A,onClick:T,children:c("general:applyChanges")})]})]}),Po("div",{className:`${yt}__toolWrap`,children:[_t("div",{className:`${yt}__crop`,children:Po("div",{className:`${yt}__focal-wrapper`,ref:C,style:{aspectRatio:`${x/b}`},children:[i?_t(fI,{className:`${yt}__reactCrop`,crop:u,onChange:(P,L)=>d(L),onComplete:()=>g(!0),renderSelectionAddon:()=>_t("div",{className:`${yt}__crop-window`,ref:w}),children:_t("img",{alt:c("upload:setCropArea"),onLoad:R,ref:S,src:N})}):_t("img",{alt:c("upload:setFocalPoint"),onLoad:R,ref:S,src:N}),a&&_t(cO,{boundsRef:i?w:S,checkBounds:i?p:!1,className:`${yt}__focalPoint`,containerRef:C,initialPosition:m,onDragEnd:$,setCheckBounds:i?g:!1,children:_t(jo,{})})]})}),(i||a)&&Po("div",{className:`${yt}__sidebar`,children:[i&&Po("div",{className:`${yt}__groupWrap`,children:[_t("div",{children:Po("div",{className:`${yt}__titleWrap`,children:[_t("h3",{children:c("upload:crop")}),_t(ne,{buttonStyle:"none",className:`${yt}__reset`,onClick:()=>d({height:100,unit:"%",width:100,x:0,y:0}),children:c("general:reset")})]})}),_t("span",{className:`${yt}__description`,children:c("upload:cropToolDescription")}),Po("div",{className:`${yt}__inputsWrap`,children:[_t(Um,{name:`${c("upload:width")} (px)`,onChange:P=>I({dimension:"width",value:P}),ref:_,value:(u.width/100*x).toFixed(0)}),_t(Um,{name:`${c("upload:height")} (px)`,onChange:P=>I({dimension:"height",value:P}),ref:D,value:(u.height/100*b).toFixed(0)})]})]}),a&&Po("div",{className:`${yt}__groupWrap`,children:[_t("div",{children:Po("div",{className:`${yt}__titleWrap`,children:[_t("h3",{children:c("upload:focalPoint")}),_t(ne,{buttonStyle:"none",className:`${yt}__reset`,onClick:j,children:c("general:reset")})]})}),_t("span",{className:`${yt}__description`,children:c("upload:focalPointDescription")}),Po("div",{className:`${yt}__inputsWrap`,children:[_t(Um,{name:"X %",onChange:P=>E({coordinate:"x",value:P}),value:m.x.toFixed(0)}),_t(Um,{name:"Y %",onChange:P=>E({coordinate:"y",value:P}),value:m.y.toFixed(0)})]})]})]})]})]})},cO=({boundsRef:t,checkBounds:e,children:o,className:n,containerRef:r,initialPosition:s={x:50,y:50},onDragEnd:i,setCheckBounds:a})=>{let[l,c]=bs({x:s.x,y:s.y}),[u,d]=bs(!1),f=La(void 0),m=Ym.useCallback((b,v,x)=>{let y=r.current.getBoundingClientRect(),C=t.current.getBoundingClientRect(),S=b??C.left,w=v??C.top,D=S<C.left||S>C.right,_=w<C.top||w>C.bottom,A=(S-y.left)/y.width*100,F=(w-y.top)/y.height*100,R=(C.left-y.left+C.width/2)/y.width*100,I=(C.top-y.top+C.height/2)/y.height*100;return(D||_)&&(d(!1),S<C.left?A=(C.left-y.left)/y.width*100:S>C.right&&(A=(y.width-(y.right-C.right))/y.width*100),w<C.top?F=(C.top-y.top)/y.height*100:w>C.bottom&&(F=(y.height-(y.bottom-C.bottom))/y.height*100),x&&(A=D?R:A,F=_?I:F)),{x:A,y:F}},[t,r]),h=b=>{b.preventDefault(),d(!0)},p=b=>{if(!u)return null;let{x:v,y:x}=m(b.clientX,b.clientY);c({x:v,y:x})},g=()=>{d(!1),i(l)};return Ym.useEffect(()=>{if(!(u||!f.current)&&e){let{height:b,left:v,top:x,width:y}=f.current.getBoundingClientRect(),{x:C,y:S}=m(v+y/2,x+b/2,!0);i({x:C,y:S}),c({x:C,y:S}),a(!1);return}},[m,u,e,a,l.x,l.y,i]),Ym.useEffect(()=>{c({x:s.x,y:s.y})},[s.x,s.y]),Po("div",{className:[`${yt}__draggable-container`,u&&`${yt}__draggable-container--dragging`].filter(Boolean).join(" "),onMouseMove:p,children:[_t("button",{className:[`${yt}__draggable`,n].filter(Boolean).join(" "),onMouseDown:h,onMouseUp:g,ref:f,style:{left:`${l.x}%`,top:`${l.y}%`},type:"button",children:o}),_t("div",{})]})};import{jsx as wI}from"react/jsx-runtime";import"react";import{c as uO}from"react/compiler-runtime";import{jsx as Pn,jsxs as gb}from"react/jsx-runtime";import"react";var vs="file-details-draggable",pI=t=>{let e=uO(20),{collectionSlug:o,doc:n,hideRemoveFile:r,imageCacheTag:s,isSortable:i,removeItem:a,rowIndex:l,uploadConfig:c}=t,{id:u,filename:d,thumbnailURL:f,url:m}=n,h;e[0]!==o||e[1]!==u?(h={id:u,collectionSlug:o},e[0]=o,e[1]=u,e[2]=h):h=e[2];let[p,g]=Jt(h),b;e[3]!==p||e[4]!==g||e[5]!==o||e[6]!==n||e[7]!==d||e[8]!==r||e[9]!==s||e[10]!==i||e[11]!==a||e[12]!==l||e[13]!==f||e[14]!==c||e[15]!==m?(b=x=>gb("div",{className:[vs,x&&i&&`${vs}--has-drag-handle`].filter(Boolean).join(" "),ref:x.setNodeRef,style:{transform:x.transform,transition:x.transition,zIndex:x.isDragging?1:void 0},children:[gb("div",{className:`${vs}--drag-wrapper`,children:[i&&x&&Pn("div",{className:`${vs}__drag`,...x.attributes,...x.listeners,children:Pn(Cn,{})}),Pn(Mr,{className:`${vs}__thumbnail`,collectionSlug:o,doc:n,fileSrc:f||m,imageCacheTag:s,uploadConfig:c})]}),Pn("div",{className:`${vs}__main-detail`,children:d}),gb("div",{className:`${vs}__actions`,children:[Pn(p,{}),Pn(g,{children:Pn(_r,{})}),!r&&a&&Pn(ne,{buttonStyle:"icon-label",className:`${vs}__remove`,icon:"x",iconStyle:"none",onClick:()=>a(l),round:!0})]})]}),e[3]=p,e[4]=g,e[5]=o,e[6]=n,e[7]=d,e[8]=r,e[9]=s,e[10]=i,e[11]=a,e[12]=l,e[13]=f,e[14]=c,e[15]=m,e[16]=b):b=e[16];let v;return e[17]!==u||e[18]!==b?(v=Pn(Jr,{id:u,children:b},u),e[17]=u,e[18]=b,e[19]=v):v=e[19],v};import{jsx as Vc,jsxs as yI}from"react/jsx-runtime";import"react";import{jsx as vI,jsxs as Mc}from"react/jsx-runtime";import{formatFilesize as fO}from"payload/shared";import xI from"react";import{jsx as hI,jsxs as gI}from"react/jsx-runtime";import{useRef as dO,useState as bI}from"react";var mO="copy-to-clipboard",Oc=({defaultMessage:t,successMessage:e,value:o})=>{let n=dO(null),[r,s]=bI(!1),[i,a]=bI(!1),{t:l}=k();return o?gI("button",{className:mO,onClick:()=>{n&&n.current&&(n.current.select(),n.current.setSelectionRange(0,o.length+1),document.execCommand("copy"),s(!0))},onMouseEnter:()=>{a(!0),s(!1)},onMouseLeave:()=>{a(!1),s(!1)},type:"button",children:[hI(Al,{}),gI(go,{delay:r?0:void 0,show:i||r,children:[r&&(e??l("general:copied")),!r&&(t??l("general:copy"))]}),hI("textarea",{readOnly:!0,ref:n,tabIndex:-1,value:o})]}):null};var bb="file-meta",Bc=t=>{let{filename:e,filesize:o,height:n,mimeType:r,url:s,width:i}=t;return Mc("div",{className:bb,children:[Mc("div",{className:`${bb}__url`,children:[vI("a",{href:s,rel:"noopener noreferrer",target:"_blank",children:e}),vI(Oc,{defaultMessage:"Copy URL",value:s})]}),Mc("div",{className:`${bb}__size-type`,children:[fO(o),typeof i=="number"&&typeof n=="number"&&Mc(xI.Fragment,{children:["\xA0-\xA0",i,"x",n]}),r&&Mc(xI.Fragment,{children:["\xA0-\xA0",r]})]})]})};var Zm="file-details",CI=t=>{let{customUploadActions:e,doc:o,enableAdjustments:n,handleRemove:r,hasImageSizes:s,hideRemoveFile:i,imageCacheTag:a,uploadConfig:l}=t,{filename:c,filesize:u,height:d,mimeType:f,thumbnailURL:m,url:h,width:p}=o,g=l.displayPreview??!0;return Vc("div",{className:Zm,children:yI("header",{children:[g&&Vc(Mr,{className:`${Zm}__thumbnail`,doc:o,fileSrc:m||h,imageCacheTag:a,uploadConfig:l}),yI("div",{className:`${Zm}__main-detail`,children:[Vc(Bc,{filename:c,filesize:u,height:d,mimeType:f,url:h,width:p}),(n||e)&&Vc(vb,{customActions:e,enableAdjustments:!!n,enablePreviewSizes:s&&o.filename,mimeType:f})]}),!i&&r&&Vc(ne,{buttonStyle:"icon-label",className:`${Zm}__remove`,icon:"x",iconStyle:"with-border",onClick:r,round:!0})]})})};var xb=t=>{let{hasMany:e}=t;return e?wI(pI,{...t}):wI(CI,{...t})};import{jsx as rn,jsxs as $a}from"react/jsx-runtime";import{useEffect as pO,useMemo as hO,useState as SI}from"react";var vr="preview-sizes",II=(t,e)=>{if(!e||e.length===0)return t;let o={};return e.forEach(({name:n})=>{t[n]&&(o[n]=t[n])}),o},RI=({name:t,active:e,meta:o,onClick:n,previewSrc:r})=>$a("div",{className:[`${vr}__sizeOption`,e&&`${vr}--selected`].filter(Boolean).join(" "),onClick:typeof n=="function"?n:void 0,onKeyDown:s=>{typeof n=="function"&&s.key==="Enter"&&n()},role:"button",tabIndex:0,children:[rn("div",{className:`${vr}__image`,children:rn("img",{alt:o.filename,src:r})}),$a("div",{className:`${vr}__sizeMeta`,children:[rn("div",{className:`${vr}__sizeName`,children:t}),rn(Bc,{...o})]})]}),yb=({doc:t,imageCacheTag:e,uploadConfig:o})=>{let{imageSizes:n}=o,{sizes:r}=t,[s,i]=SI(()=>II(r,n)),[a,l]=SI(null),c=m=>{if(!m.filename)return null;if(m.url)return`${m.url}${e?`?${encodeURIComponent(e)}`:""}`};pO(()=>{i(II(r,n))},[r,n,e]);let u=c(a?t.sizes[a]:t),d=hO(()=>({filename:t.filename,filesize:t.filesize,height:t.height,mimeType:t.mimeType,url:t.url,width:t.width}),[t]),f="Original";return $a("div",{className:vr,children:[$a("div",{className:`${vr}__imageWrap`,children:[$a("div",{className:`${vr}__meta`,children:[rn("div",{className:`${vr}__sizeName`,children:a||f}),rn(Bc,{...a?s[a]:d})]}),rn("img",{alt:t.filename,className:`${vr}__preview`,src:u})]}),rn("div",{className:`${vr}__listWrap`,children:$a("div",{className:`${vr}__list`,children:[rn(RI,{active:!a,meta:d,name:f,onClick:()=>l(null),previewSrc:c(t)}),Object.entries(s).map(([m,h])=>{let p=a===m,g=c(h);return g?rn(RI,{active:p,meta:h,name:m,onClick:()=>l(m),previewSrc:g},m):null})]})})]})};var qt="file-field",jc="edit-upload",AI="preview-sizes",bO=t=>!t&&t!==void 0?"A file is required.":!0,vb=t=>{let e=DI(9),{customActions:o,enableAdjustments:n,enablePreviewSizes:r,mimeType:s}=t,{t:i}=k(),a,l;if(e[0]!==o||e[1]!==n||e[2]!==r||e[3]!==s||e[4]!==i){l=Symbol.for("react.early_return_sentinel");e:{let c=FI(s)&&s!=="image/svg+xml"&&s!=="image/jxl";if(!c&&(!o||o.length===0)){l=null;break e}let u;e[7]!==o?(u=o&&o.map(vO),e[7]=o,e[8]=u):u=e[8],a=xr("div",{className:`${qt}__upload-actions`,children:[c&&xr(Wc.Fragment,{children:[r&&wt(ur,{className:`${qt}__previewSizes`,slug:AI,children:i("upload:previewSizes")}),n&&wt(ur,{className:`${qt}__edit`,slug:jc,children:i("upload:editImage")})]}),u]})}e[0]=o,e[1]=n,e[2]=r,e[3]=s,e[4]=i,e[5]=a,e[6]=l}else a=e[5],l=e[6];return l!==Symbol.for("react.early_return_sentinel")?l:a},wb=t=>{let e=DI(5),{resetUploadEdits:o,updateUploadEdits:n,uploadEdits:r}=Ws(),s;return e[0]!==t||e[1]!==o||e[2]!==n||e[3]!==r?(s=wt(Sb,{...t,resetUploadEdits:o,updateUploadEdits:n,uploadEdits:r}),e[0]=t,e[1]=o,e[2]=n,e[3]=r,e[4]=s):s=e[4],s},Sb=t=>{let{collectionSlug:e,customActions:o,initialState:n,onChange:r,resetUploadEdits:s,updateUploadEdits:i,uploadConfig:a,uploadEdits:l}=t,{config:{routes:{api:c},serverURL:u}}=H(),{t:d}=k(),{setModified:f}=Oe(),{id:m,docPermissions:h,savedDocumentData:p,setUploadStatus:g}=Pe(),b=lr(),{errorMessage:v,setValue:x,showError:y,value:C}=Ee({path:"file",validate:bO}),[S,w]=Gc(null),[D,_]=Gc(!1),[A,F]=Gc(C?.name||""),[R,I]=Gc(!1),[E,T]=Gc(""),$=_I(null),j=_I(null),N=typeof a?.pasteURL=="object"&&a.pasteURL.allowList?.length>0,P=Jm(q=>{q instanceof File&&w(URL.createObjectURL(q)),x(q),I(!1),typeof r=="function"&&r(q)},[r,x]),L=(q,pe)=>new File([q],pe,{type:q.type,lastModified:q.lastModified}),V=Wc.useCallback(q=>{let pe=q.target.value;C&&(P(L(C,pe)),F(pe))},[P,C]),M=Jm(q=>{let pe=q?.[0];P(pe)},[P]),O=Jm(()=>{_(!0),P(null),w(""),T(""),s(),I(!1)},[P,s]),B=Jm(q=>{f(!0),i(q)},[f,i]),G=async()=>{if(!(!E||a?.pasteURL===!1)){g("uploading");try{let q=await fetch(E);if(!q.ok)throw new Error(`Fetch failed with status: ${q.status}`);let pe=await q.blob(),he=decodeURIComponent(E.split("/").pop()||""),_e=new File([pe],he,{type:pe.type});P(_e),g("idle");return}catch{if(!N){fe.error("Failed to fetch the file."),g("failed");return}}try{let q=`/${e}/paste-url${m?`/${m}?`:"?"}src=${encodeURIComponent(E)}`,pe=await fetch(`${u}${c}${q}`);if(!pe.ok)throw new Error(`Fetch failed with status: ${pe.status}`);let he=await pe.blob(),_e=decodeURIComponent(E.split("/").pop()||""),ge=new File([he],_e,{type:he.type});P(ge),g("idle")}catch{fe.error("The provided URL is not allowed."),g("failed")}}};Cb(()=>{n?.file?.value instanceof File&&(w(URL.createObjectURL(n.file.value)),_(!1))},[n]),Cb(()=>{R&&$.current},[R]),Cb(()=>{b&&_(!1)},[b]);let X=h?.update&&"delete"in h&&h?.delete,Z=a?.imageSizes?.length>0,te=!!a?.resizeOptions,U=a?.focalPoint===!0,{crop:z=!0,focalPoint:ce=!0}=a,J=ce&&(Z||te||U),ue=a.mimeTypes?.join(", "),re=a?.cacheTags&&p?.updatedAt;return a.hideFileInputOnCreate&&!p?.filename?null:xr("div",{className:[Ce,qt].filter(Boolean).join(" "),children:[wt(He,{message:v,showError:y}),p&&p.filename&&!D&&wt(xb,{collectionSlug:e,customUploadActions:o,doc:p,enableAdjustments:z||J,handleRemove:X?O:void 0,hasImageSizes:Z,hideRemoveFile:a.hideRemoveFile,imageCacheTag:re,uploadConfig:a}),(!a.hideFileInputOnCreate&&!p?.filename||D)&&xr("div",{className:`${qt}__upload`,children:[!C&&!R&&wt(mi,{onChange:M,children:xr("div",{className:`${qt}__dropzoneContent`,children:[xr("div",{className:`${qt}__dropzoneButtons`,children:[wt(ne,{buttonStyle:"pill",onClick:()=>{j.current&&j.current.click()},size:"small",children:d("upload:selectFile")}),wt("input",{accept:ue,"aria-hidden":"true",className:`${qt}__hidden-input`,hidden:!0,onChange:q=>{q.target.files&&q.target.files.length>0&&M(q.target.files)},ref:j,type:"file"}),a?.pasteURL!==!1&&xr(gO,{children:[wt("span",{className:`${qt}__orText`,children:d("general:or")}),wt(ne,{buttonStyle:"pill",onClick:()=>{I(!0)},size:"small",children:d("upload:pasteURL")})]})]}),xr("p",{className:`${qt}__dragAndDropText`,children:[d("general:or")," ",d("upload:dragAndDrop")]})]})}),R&&xr(Wc.Fragment,{children:[xr("div",{className:`${qt}__remote-file-wrap`,children:[wt("input",{className:`${qt}__remote-file`,onChange:q=>{T(q.target.value)},ref:$,type:"text",value:E}),wt("div",{className:`${qt}__add-file-wrap`,children:wt("button",{className:`${qt}__add-file`,onClick:()=>{G()},type:"button",children:d("upload:addFile")})})]}),wt(ne,{buttonStyle:"icon-label",className:`${qt}__remove`,icon:"x",iconStyle:"with-border",onClick:()=>{I(!1)},round:!0,tooltip:d("general:cancel")})]}),C&&S&&xr(Wc.Fragment,{children:[wt("div",{className:`${qt}__thumbnail-wrap`,children:wt(Mr,{collectionSlug:e,fileSrc:FI(C.type)?S:null})}),xr("div",{className:`${qt}__file-adjustments`,children:[wt("input",{className:`${qt}__filename`,onChange:V,type:"text",value:A||C.name}),wt(vb,{customActions:o,enableAdjustments:z||J,enablePreviewSizes:Z&&p?.filename&&!D,mimeType:C.type})]}),wt(ne,{buttonStyle:"icon-label",className:`${qt}__remove`,icon:"x",iconStyle:"with-border",onClick:O,round:!0,tooltip:d("general:cancel")})]})]}),(C||p?.filename)&&wt(Ns,{children:wt(Pt,{Header:null,slug:jc,children:wt(hb,{fileName:C?.name||p?.filename,fileSrc:p?.url||S,imageCacheTag:re,initialCrop:l?.crop??void 0,initialFocalPoint:{x:l?.focalPoint?.x||p?.focalX||50,y:l?.focalPoint?.y||p?.focalY||50},onSave:B,showCrop:z,showFocalPoint:J})})}),p&&Z&&wt(Pt,{className:`${qt}__previewDrawer`,hoverTitle:!0,slug:AI,title:d("upload:sizesFor",{label:p.filename}),children:wt(yb,{doc:p,imageCacheTag:re,uploadConfig:a})})]})};function vO(t,e){return wt(Wc.Fragment,{children:t},e)}var SO="collection-edit";function PI({resetUploadEdits:t,submitted:e,updateUploadEdits:o,uploadEdits:n}){let{action:r,collectionSlug:s,docPermissions:i,getDocPreferences:a,hasSavePermission:l,initialState:c,isEditing:u,isInitializing:d,Upload:f}=Pe(),{onSave:m}=ac(),{getFormState:h}=Dt(),{config:{routes:{admin:p}},getEntityConfig:g}=H(),b=Hc.useRef(null),v=g({collectionSlug:s}),x=yO(),y=ct(),C=CO(),{reportUpdate:S}=fi(),{startRouteTransition:w}=st(),D=C.get("locale"),_=v.slug,[A]=Hc.useState(_),F=TI(I=>{if(S({entitySlug:_,updatedAt:I?.result?.updatedAt||new Date().toISOString()}),typeof m=="function"&&m({...I,operation:"create"}),!u&&y<2){let E=wO({adminRoute:p,path:`/collections/${_}/${I?.doc?.id}${D?`?locale=${D}`:""}`});w(()=>x.push(E))}else t()},[p,_,y,u,D,m,S,t,x,w]),R=TI(async({formState:I,submitted:E})=>{let T=or(b),$=await a(),{state:j}=await h({collectionSlug:_,docPermissions:i,docPreferences:$,formState:I,operation:"create",schemaPath:A,signal:T.signal,skipValidation:!E});return b.current=null,j},[_,A,a,h,i]);return EI(()=>{let I=b.current;return()=>{tr(I)}},[]),xs(Il,{operation:"create",children:xs(Ib,{children:xO(An,{action:r,className:`${SO}__form`,disabled:d||!l,initialState:d?void 0:c,isInitializing:d,method:"POST",onChange:[R],onSuccess:F,submitted:e,children:[xs(kc,{BeforeFields:xs(Hc.Fragment,{children:f||xs(Sb,{collectionSlug:v.slug,initialState:c,resetUploadEdits:t,updateUploadEdits:o,uploadConfig:v.upload,uploadEdits:n})}),docPermissions:i,fields:v.fields,schemaPathSegments:[v.slug]}),xs(RO,{}),xs(IO,{})]})})})}function IO(){let{getFields:t}=Oe(),{getFormDataRef:e}=Io();return EI(()=>{e.current=t},[t,e]),null}function RO(){let{docConfig:t}=Pe(),{activeIndex:e,setFormTotalErrorCount:o}=Io(),n=Hc.useRef(0),r=Hc.useCallback(s=>{s!==n.current&&(o({errorCount:s,index:e}),n.current=s)},[e,o]);return t?xs(Ys,{fields:t.fields,path:[],setErrorCount:r}):null}import{c as _O}from"react/compiler-runtime";import{jsx as Lt,jsxs as zr}from"react/jsx-runtime";import{isImage as DO}from"payload/shared";import FO from"react";var qm="bulk-upload-drawer--add-more-files",Ct="file-selections";function NI(){let t=_O(36),{activeIndex:e,addFiles:o,forms:n,isInitializing:r,removeFile:s,setActiveIndex:i,thumbnailUrls:a,totalErrorCount:l}=Io(),{initialFiles:c,maxFiles:u}=Ho(),{i18n:d,t:f}=k(),{closeModal:m,openModal:h}=de(),[p,g]=FO.useState(!1),{breakpoints:b}=Co(),v;t[0]!==s?(v=R=>{s(R)},t[0]=s,t[1]=v):v=t[1];let x=v,y;t[2]!==o||t[3]!==m?(y=R=>{o(R),m(qm)},t[2]=o,t[3]=m,t[4]=y):y=t[4];let C=y,S=EO,w=r?c.length:n.length,D=p&&`${Ct}__showingFiles`,_;t[5]!==D?(_=[Ct,D].filter(Boolean),t[5]=D,t[6]=_):_=t[6];let A=_.join(" "),F;if(t[7]!==e||t[8]!==b.m||t[9]!==m||t[10]!==n||t[11]!==C||t[12]!==x||t[13]!==d||t[14]!==c||t[15]!==r||t[16]!==u||t[17]!==h||t[18]!==i||t[19]!==p||t[20]!==f||t[21]!==A||t[22]!==a||t[23]!==l||t[24]!==w){let R;t[26]===Symbol.for("react.memo_cache_sentinel")?(R=()=>g(TO),t[26]=R):R=t[26];let I;t[27]!==m?(I=()=>m(qm),t[27]=m,t[28]=I):I=t[28];let E;t[29]!==e||t[30]!==x||t[31]!==d||t[32]!==i||t[33]!==f||t[34]!==a?(E=(T,$)=>{let{errorCount:j,formState:N}=T,P=N?.file?.value||{};return zr("div",{className:[`${Ct}__fileRowContainer`,$===e&&`${Ct}__fileRowContainer--active`,j&&j>0&&`${Ct}__fileRowContainer--error`].filter(Boolean).join(" "),children:[zr("button",{className:`${Ct}__fileRow`,onClick:()=>i($),type:"button",children:[Lt(Mr,{className:`${Ct}__thumbnail`,fileSrc:DO(P.type)?a[$]:null}),Lt("div",{className:`${Ct}__fileDetails`,children:Lt("p",{className:`${Ct}__fileName`,title:P.name,children:P.name||f("upload:noFile")})}),P instanceof File?Lt("p",{className:`${Ct}__fileSize`,children:S(P)}):null,Lt("div",{className:`${Ct}__remove ${Ct}__remove--underlay`,children:Lt(pt,{})}),j?Lt(io,{className:`${Ct}__errorCount`,count:j,i18n:d}):null]}),Lt("button",{"aria-label":f("general:remove"),className:`${Ct}__remove ${Ct}__remove--overlay`,onClick:()=>x($),type:"button",children:Lt(pt,{})})]},$)},t[29]=e,t[30]=x,t[31]=d,t[32]=i,t[33]=f,t[34]=a,t[35]=E):E=t[35],F=zr("div",{className:A,children:[b.m&&p?Lt("div",{className:`${Ct}__mobileBlur`}):null,zr("div",{className:`${Ct}__header`,children:[zr("div",{className:`${Ct}__headerTopRow`,children:[zr("div",{className:`${Ct}__header__text`,children:[Lt(io,{count:l,i18n:d,withMessage:!0}),Lt("p",{children:zr("strong",{title:`${w} ${f(w>1?"upload:filesToUpload":"upload:fileToUpload")}`,children:[w," ",f(w>1?"upload:filesToUpload":"upload:fileToUpload")]})})]}),zr("div",{className:`${Ct}__header__actions`,children:[typeof u!="number"||w<u?Lt(vt,{className:`${Ct}__header__addFile`,onClick:()=>h(qm),children:f("upload:addFile")}):null,zr(ne,{buttonStyle:"transparent",className:`${Ct}__toggler`,onClick:R,children:[Lt("span",{className:`${Ct}__toggler__label`,children:zr("strong",{title:`${w} ${f(w>1?"upload:filesToUpload":"upload:fileToUpload")}`,children:[w," ",f(w>1?"upload:filesToUpload":"upload:fileToUpload")]})}),Lt(Ze,{direction:p?"down":"up"})]}),Lt(Pt,{gutter:!1,Header:null,slug:qm,children:Lt(Bm,{onCancel:I,onDrop:C})})]})]}),Lt("div",{className:`${Ct}__header__mobileDocActions`,children:Lt(fb,{})})]}),Lt("div",{className:`${Ct}__animateWrapper`,children:Lt(Tr,{height:!b.m||p?"auto":0,children:zr("div",{className:`${Ct}__filesContainer`,children:[r&&n.length===0&&c.length>0?Array.from(c).map(AO):null,n.map(E)]})})})]}),t[7]=e,t[8]=b.m,t[9]=m,t[10]=n,t[11]=C,t[12]=x,t[13]=d,t[14]=c,t[15]=r,t[16]=u,t[17]=h,t[18]=i,t[19]=p,t[20]=f,t[21]=A,t[22]=a,t[23]=l,t[24]=w,t[25]=F}else F=t[25];return F}function AO(t,e){return Lt(St,{animationDelay:`calc(${e} * 60ms)`,height:"35px"},e)}function TO(t){return!t}function EO(t){let e=t.size,o=e===0?0:Math.floor(Math.log(e)/Math.log(1024)),n=o>1?1:0;return(e/Math.pow(1024,o)).toFixed(n)+" "+["B","kB","MB","GB","TB"][o]}var LI="bulk-upload--file-manager";function $I(){let t=PO(18),{activeIndex:e,collectionSlug:o,docPermissions:n,documentSlots:r,forms:s,hasPublishPermission:i,hasSavePermission:a,hasSubmitted:l,resetUploadEdits:c,updateUploadEdits:u}=Io(),d=s[e],{getEntityConfig:f}=H(),{i18n:m}=k(),{user:h}=Ae(),{openModal:p}=de(),g;if(t[0]!==d||t[1]!==e||t[2]!==o||t[3]!==n||t[4]!==r||t[5]!==s.length||t[6]!==f||t[7]!==i||t[8]!==a||t[9]!==l||t[10]!==m||t[11]!==p||t[12]!==c||t[13]!==u||t[14]!==h){let b=f({collectionSlug:o}),v;t[16]!==p?(v=()=>p($c),t[16]=p,t[17]=v):v=t[17],g=Rb("div",{className:LI,children:[zc(NI,{}),Rb("div",{className:`${LI}__editView`,children:[zc(Da,{onClose:v,title:NO(b.labels.singular,m)}),d?Rb(Sl,{collectionSlug:o,currentEditor:h,docPermissions:n,hasPublishedDoc:!1,hasPublishPermission:i,hasSavePermission:a,id:null,initialData:LO(d.formState,!0),initialState:d.formState,isLocked:!1,lastUpdateTime:0,mostRecentVersionIsAutosaved:!1,unpublishedVersionCount:0,Upload:r.Upload,versionCount:0,children:[zc(iI,{collectionConfig:b}),zc(PI,{resetUploadEdits:c,submitted:l,updateUploadEdits:u,uploadEdits:d?.uploadEdits})]},`${e}-${s.length}`):null]}),zc(aI,{})]}),t[0]=d,t[1]=e,t[2]=o,t[3]=n,t[4]=r,t[5]=s.length,t[6]=f,t[7]=i,t[8]=a,t[9]=l,t[10]=m,t[11]=p,t[12]=c,t[13]=u,t[14]=h,t[15]=g}else g=t[15];return g}var jO="bulk-upload-drawer-slug";function OO(){let{addFiles:t,forms:e,isInitializing:o}=Io(),{closeModal:n}=de(),{collectionSlug:r,drawerSlug:s}=Ho(),{getEntityConfig:i}=H(),{t:a}=k(),u=i({collectionSlug:r})?.upload?.mimeTypes,d=nn.useCallback(f=>{let m=new DataTransfer;for(let h of f)(u===void 0||u.length===0||kO(h.type,u))&&m.items.add(h);m.files.length===0?fe.error(a("error:invalidFileType")):t(m.files)},[t,a,u]);return r?!e.length&&!o?pi(Bm,{acceptMimeTypes:u?.join(", "),onCancel:()=>n(s),onDrop:d}):pi($I,{}):null}function jI(){let t=kI(2),{drawerSlug:e}=Ho(),o;return t[0]!==e?(o=pi(Pt,{gutter:!1,Header:null,slug:e,children:pi(ZS,{children:pi(OO,{})})}),t[0]=e,t[1]=o):o=t[1],o}var OI=nn.createContext({collectionSlug:"",currentActivePath:void 0,drawerSlug:"",initialFiles:void 0,maxFiles:void 0,onCancel:()=>null,onSuccess:()=>null,setCollectionSlug:()=>null,setCurrentActivePath:()=>null,setInitialFiles:()=>null,setMaxFiles:()=>null,setOnCancel:()=>null,setOnSuccess:()=>null});function Ib(t){let e=kI(16),{children:o}=t,[n,r]=nn.useState(),[s,i]=nn.useState(),[a,l]=nn.useState(),[c,u]=nn.useState(void 0),[d,f]=nn.useState(void 0),[m,h]=nn.useState(void 0),p=MI(),g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g=w=>{r(w)},e[0]=g):g=e[0];let b=g,v;e[1]===Symbol.for("react.memo_cache_sentinel")?(v=(w,D)=>{i(_=>({..._,[w]:D}))},e[1]=v):v=e[1];let x=v,y;e[2]!==a?(y=()=>{typeof a=="function"&&a()},e[2]=a,e[3]=y):y=e[3];let C;e[4]!==m||e[5]!==s?(C=(w,D)=>{if(s&&Object.hasOwn(s,m)){let _=s[m];_(w,D)}},e[4]=m,e[5]=s,e[6]=C):C=e[6];let S;return e[7]!==o||e[8]!==n||e[9]!==m||e[10]!==p||e[11]!==c||e[12]!==d||e[13]!==y||e[14]!==C?(S=pi(OI,{value:{collectionSlug:n,currentActivePath:m,drawerSlug:p,initialFiles:c,maxFiles:d,onCancel:y,onSuccess:C,setCollectionSlug:b,setCurrentActivePath:h,setInitialFiles:u,setMaxFiles:f,setOnCancel:l,setOnSuccess:x},children:$O(nn.Fragment,{children:[o,pi(jI,{})]})}),e[7]=o,e[8]=n,e[9]=m,e[10]=p,e[11]=c,e[12]=d,e[13]=y,e[14]=C,e[15]=S):S=e[15],S}var Ho=()=>nn.use(OI);function MI(){let t=Wi();return`${jO}-${t||1}`}import{c as GO}from"react/compiler-runtime";import{jsx as gi,jsxs as WO}from"react/jsx-runtime";import"react";import{c as MO}from"react/compiler-runtime";import{jsx as hi,jsxs as Qm}from"react/jsx-runtime";import{formatFilesize as BO}from"payload/shared";import"react";var Nn="upload-relationship-details";function Km(t){let e=MO(34),{id:o,allowEdit:n,allowRemove:r,alt:s,byteSize:i,className:a,collectionSlug:l,displayPreview:c,filename:u,mimeType:d,onRemove:f,reloadDoc:m,src:h,thumbnailSrc:p,withMeta:g,x:b,y:v}=t,x=g===void 0?!0:g,{config:y}=H(),C;e[0]!==l||e[1]!==y?(C="collections"in y?y.collections.find(O=>O.slug===l):void 0,e[0]=l,e[1]=y,e[2]=C):C=e[2];let S=C,w=h?o:void 0,D;e[3]!==l||e[4]!==w?(D={id:w,collectionSlug:l},e[3]=l,e[4]=w,e[5]=D):D=e[5];let[_,,A]=Jt(D),{openDrawer:F}=A,R;e[6]!==l||e[7]!==m?(R=async O=>{let{doc:B}=O;return m(B.id,l)},e[6]=l,e[7]=m,e[8]=R):R=e[8];let I=R,E;e[9]!==b||e[10]!==v?(E=function(B,G){let X=[];return G&&X.push(BO(G)),b&&v&&X.push(`${b}x${v}`),B&&X.push(B),X.join(" \u2014 ")},e[9]=b,e[10]=v,e[11]=E):E=e[11];let $=x?E(d,i):"",j=c??S.upload?.displayPreview??!0,N;e[12]!==a?(N=[Nn,a].filter(Boolean),e[12]=a,e[13]=N):N=e[13];let P=N.join(" "),L;e[14]!==s||e[15]!==u||e[16]!==j||e[17]!==p?(L=j&&hi(_3,{alt:s,className:`${Nn}__thumbnail`,filename:u,fileSrc:p,size:"small"}),e[14]=s,e[15]=u,e[16]=j,e[17]=p,e[18]=L):L=e[18];let V;e[19]!==u||e[20]!==h?(V=h?hi("a",{href:h,target:"_blank",children:u}):u,e[19]=u,e[20]=h,e[21]=V):V=e[21];let M;return e[22]!==_||e[23]!==n||e[24]!==r||e[25]!==$||e[26]!==f||e[27]!==I||e[28]!==F||e[29]!==V||e[30]!==P||e[31]!==L||e[32]!==x?(M=Qm("div",{className:P,children:[Qm("div",{className:`${Nn}__imageAndDetails`,children:[L,Qm("div",{className:`${Nn}__details`,children:[hi("p",{className:`${Nn}__filename`,children:V}),x?hi("p",{className:`${Nn}__meta`,children:$}):null]})]}),n!==!1||r!==!1?Qm("div",{className:`${Nn}__actions`,children:[n!==!1?hi(ne,{buttonStyle:"icon-label",className:`${Nn}__edit`,icon:"edit",iconStyle:"none",onClick:F}):null,r!==!1?hi(ne,{buttonStyle:"icon-label",className:`${Nn}__remove`,icon:"x",iconStyle:"none",onClick:()=>f()}):null,hi(_,{onSave:I})]}):null]}),e[22]=_,e[23]=n,e[24]=r,e[25]=$,e[26]=f,e[27]=I,e[28]=F,e[29]=V,e[30]=P,e[31]=L,e[32]=x,e[33]=M):M=e[33],M}import{jsx as VO}from"react/jsx-runtime";import"react";var BI="upload-field-card";function ef({children:t,className:e,size:o="medium"}){return VO("div",{className:[BI,e,`${BI}--size-${o}`].filter(Boolean).join(" "),children:t})}import{isImage as HO}from"payload/shared";var Xc="upload upload--has-many";function VI(t){let e=GO(27),{className:o,displayPreview:n,fileDocs:r,isSortable:s,onRemove:i,onReorder:a,readonly:l,reloadDoc:c,serverURL:u}=t,d;e[0]!==r||e[1]!==a?(d=(v,x)=>{if(v===x)return;let y=[...r],[C]=y.splice(v,1);y.splice(x,0,C),a(y)},e[0]=r,e[1]=a,e[2]=d):d=e[2];let f=d,m;e[3]!==r||e[4]!==i?(m=v=>{let x=[...r||[]];x.splice(v,1),i(x.length===0?[]:x)},e[3]=r,e[4]=i,e[5]=m):m=e[5];let h=m,p;e[6]!==o?(p=[Xc,o].filter(Boolean),e[6]=o,e[7]=p):p=e[7];let g=p.join(" "),b;if(e[8]!==n||e[9]!==r||e[10]!==s||e[11]!==f||e[12]!==l||e[13]!==c||e[14]!==h||e[15]!==u||e[16]!==g){let v;e[18]!==f?(v=y=>{let{moveFromIndex:C,moveToIndex:S}=y;return f(C,S)},e[18]=f,e[19]=v):v=e[19];let x;e[20]!==n||e[21]!==s||e[22]!==l||e[23]!==c||e[24]!==h||e[25]!==u?(x=(y,C)=>{let{relationTo:S,value:w}=y,D=String(w.id),_,A;if(w.url)try{_=new URL(w.url,u).toString()}catch{_=`${u}${w.url}`}if(w.thumbnailURL)try{A=new URL(w.thumbnailURL,u).toString()}catch{A=`${u}${w.thumbnailURL}`}return HO(w.mimeType)&&(A=ha({sizes:w.sizes,thumbnailURL:A,url:_,width:w.width})),gi(Jr,{disabled:!s||l,id:D,children:F=>gi("div",{className:[`${Xc}__dragItem`,F&&s&&`${Xc}--has-drag-handle`].filter(Boolean).join(" "),ref:F.setNodeRef,style:{transform:F.transform,transition:F.transition,zIndex:F.isDragging?1:void 0},children:WO(ef,{size:"small",children:[F&&gi("div",{className:`${Xc}__drag`,...F.attributes,...F.listeners,children:gi(Cn,{})}),gi(Km,{allowEdit:!l,allowRemove:!l,alt:w?.alt||w?.filename,byteSize:w.filesize,collectionSlug:S,displayPreview:n,filename:w.filename,id:D,mimeType:w?.mimeType,onRemove:()=>h(C),reloadDoc:c,src:_,thumbnailSrc:A,withMeta:!1,x:w?.width,y:w?.height})]})})},D)},e[20]=n,e[21]=s,e[22]=l,e[23]=c,e[24]=h,e[25]=u,e[26]=x):x=e[26],b=gi("div",{className:g,children:gi(cr,{className:`${Xc}__draggable-rows`,ids:r?.map(zO),onDragEnd:v,children:r.map(x)})}),e[8]=n,e[9]=r,e[10]=s,e[11]=f,e[12]=l,e[13]=c,e[14]=h,e[15]=u,e[16]=g,e[17]=b}else b=e[17];return b}function zO(t){let{value:e}=t;return String(e.id)}import{jsx as GI}from"react/jsx-runtime";import{isImage as XO}from"payload/shared";import"react";var UO="upload upload--has-one";function WI(t){let{className:e,displayPreview:o,fileDoc:n,onRemove:r,readonly:s,reloadDoc:i,serverURL:a}=t,{relationTo:l,value:c}=n,u=String(c?.id),d,f;if(c.url)try{d=new URL(c.url,a).toString()}catch{d=`${a}${c.url}`}if(c.thumbnailURL)try{f=new URL(c.thumbnailURL,a).toString()}catch{f=`${a}${c.thumbnailURL}`}return XO(c.mimeType)&&(f=ha({sizes:c.sizes,thumbnailURL:f,url:d,width:c.width})),GI(ef,{className:[UO,e].filter(Boolean).join(" "),children:GI(Km,{allowEdit:!s,allowRemove:!s,alt:c?.alt||c?.filename,byteSize:c.filesize,collectionSlug:l,displayPreview:o,filename:c.filename,id:u,mimeType:c?.mimeType,onRemove:r,reloadDoc:i,src:d,thumbnailSrc:f,x:c?.width,y:c?.height})})}var sn="upload";function tf(t){let{AfterInput:e,allowCreate:o,api:n,BeforeInput:r,className:s,Description:i,description:a,displayPreview:l,Error:c,filterOptions:u,hasMany:d,isSortable:f,Label:m,label:h,localized:p,maxRows:g,onChange:b,path:v,readOnly:x,relationTo:y,required:C,serverURL:S,showError:w,style:D,value:_}=t,[A,F]=Xr.useState(),[R,I]=Xr.useState(Array.isArray(y)?y[0]:y),{openModal:E}=de(),{drawerSlug:T,setCollectionSlug:$,setCurrentActivePath:j,setInitialFiles:N,setMaxFiles:P,setOnSuccess:L}=Ho(),{permissions:V}=Ae(),{code:M}=Ne(),{i18n:O,t:B}=k(),G=XI(()=>({...u,[R]:{...u?.[R]||{},id:{...u?.[R]?.id||{},not_in:(u?.[R]?.id?.not_in||[]).concat(...Array.isArray(_)||_?[_]:[])}}}),[_,R,u]),[X,,{closeDrawer:Z,openDrawer:te}]=ai({collectionSlugs:typeof y=="string"?[y]:y,filterOptions:G}),[U,,{closeDrawer:z,openDrawer:ce}]=Jt({collectionSlug:R}),J=Xr.useRef(!1),ue=XI(()=>o?!!(typeof R=="string"&&V?.collections&&V.collections?.[R]?.create):!1,[R,V,o]),re=Xr.useCallback(se=>{typeof b=="function"&&b(se)},[b]),q=Xr.useCallback(async(se,Y)=>{if(!se.length)return;let ie={depth:0,draft:!0,limit:se.length,locale:M,where:{and:[{id:{in:se}}]}},me=await fetch(`${S}${n}/${Y}`,{body:UI.stringify(ie),credentials:"include",headers:{"Accept-Language":O.language,"Content-Type":"application/x-www-form-urlencoded","X-HTTP-Method-Override":"GET"},method:"POST"});if(me.ok){let we=await me.json(),ze=se.map($e=>we.docs.find(ot=>String(ot.id)===String($e)));return ze.includes(void 0)&&d&&(ze=ze.map(($e,ot)=>$e||{id:se[ot],filename:`${B("general:untitled")} - ID: ${se[ot]}`,isPlaceholder:!0})),{...we,docs:ze}}return null},[M,S,n,O.language,B,d]),pe=HI(se=>{if(d){let Y=[...Array.isArray(_)?_:[],...se.map(ie=>ie.id)];re(Y),F(ie=>[...ie||[],...se.map(me=>({relationTo:R,value:me}))])}else{let Y=se[0];re(Y.id),F([{relationTo:R,value:Y}])}},[_,re,R,d]),he=Xr.useCallback(se=>{let Y=se;if(!d&&se&&se.length>1){let ie=new DataTransfer;ie.items.add(se[0]),Y=ie.files}Y&&N(Y),$(y),typeof g=="number"&&P(g),j(v),E(T)},[T,d,E,y,$,N,g,P,v,j]),_e=Xr.useCallback(async se=>{let Y=[];for(let[me,we]of se)we&&Y.push(me);let ie=await q(Y,R);ie&&F(me=>[...me||[],...ie.docs.map(we=>({relationTo:R,value:we}))]),re([...Array.isArray(_)?_:[],...Y]),Z()},[R,Z,re,q,_]),ge=Xr.useCallback(se=>{se.doc&&(F(Y=>[...Y||[],{relationTo:R,value:se.doc}]),re(se.doc.id)),z()},[z,R,re]),Ve=HI(async({collectionSlug:se,doc:Y})=>{let ie=await q([Y.id],se),me=ie?ie.docs?.[0]:null;F(we=>me?d?[...we||[],{relationTo:R,value:me}]:[{relationTo:R,value:me}]:we),re(d?[...Array.isArray(_)?_:[],Y.id]:Y.id),Z()},[Z,d,q,re,_,R]),Q=Xr.useCallback(async(se,Y)=>{let{docs:ie}=await q([se],Y);if(ie[0]){let me=[];F(we=>{let ze=we?.findIndex($e=>($e.value?.id===ie[0].id||$e.value?.isPlaceholder)&&$e.relationTo===Y);if(ze>-1){let $e=[...we];return $e[ze]={relationTo:Y,value:ie[0]},me=$e,$e}}),me.length&&d&&re(me.map(we=>we.value?.id))}},[q,re,d]),Le=Xr.useCallback(se=>{let Y=se.map(({value:ie})=>ie.id);re(Y),F(se)},[re]),De=Xr.useCallback(se=>{let Y=se?se.map(({value:ie})=>ie.id):null;re(d?Y:Y?Y[0]:null),F(se||[])},[re,d]);zI(()=>{async function se(){if(_){J.current=!0;let Y=await q(Array.isArray(_)?_:[_],R);Y&&F(Y.docs.map(ie=>({relationTo:R,value:ie})))}}J.current||se()},[q,R,_]),zI(()=>{L(v,pe)},[_,v,pe,L]);let ae=!_||d&&Array.isArray(_)&&(typeof g!="number"||_.length<g)||!d&&A?.[0]&&typeof A[0].value>"u";return bi("div",{className:[Ce,sn,s,w&&"error",x&&"read-only"].filter(Boolean).join(" "),id:`field-${v?.replace(/\./g,"__")}`,style:D,children:[$t(oe,{CustomComponent:m,Fallback:$t(xe,{label:h,localized:p,path:v,required:C})}),$t("div",{className:`${sn}__wrap`,children:$t(oe,{CustomComponent:c,Fallback:$t(He,{path:v,showError:w})})}),r,bi("div",{className:`${sn}__dropzoneAndUpload`,children:[d&&Array.isArray(_)&&_.length>0?$t(Uc,{children:A&&A?.length>0?$t(VI,{displayPreview:l,fileDocs:A,isSortable:f&&!x,onRemove:De,onReorder:Le,readonly:x,reloadDoc:Q,serverURL:S}):$t("div",{className:`${sn}__loadingRows`,children:_.map(se=>$t(St,{height:"40px"},se))})}):null,!d&&_?$t(Uc,{children:A&&A?.length>0&&A[0].value?$t(WI,{displayPreview:l,fileDoc:A[0],onRemove:De,readonly:x,reloadDoc:Q,serverURL:S}):A&&_&&!A?.[0]?.value?bi(Uc,{children:[B("general:untitled")," - ID: ",_]}):$t(St,{height:"62px"})}):null,ae?$t(mi,{disabled:x||!ue,multipleFiles:d,onChange:he,children:bi("div",{className:`${sn}__dropzoneContent`,children:[bi("div",{className:`${sn}__dropzoneContent__buttons`,children:[ue&&bi(Uc,{children:[$t(ne,{buttonStyle:"pill",className:`${sn}__createNewToggler`,disabled:x||!ue,onClick:()=>{x||(d?he():ce())},size:"small",children:B("general:createNew")}),$t("span",{className:`${sn}__dropzoneContent__orText`,children:B("general:or")})]}),$t(ne,{buttonStyle:"pill",className:`${sn}__listToggler`,disabled:x,onClick:te,size:"small",children:B("fields:chooseFromExisting")}),$t(U,{onSave:ge}),$t(X,{allowCreate:ue,enableRowSelections:d,onBulkSelect:_e,onSelect:Ve})]}),ue&&!x&&bi("p",{className:`${sn}__dragAndDropText`,children:[B("general:or")," ",B("upload:dragAndDrop")]})]})}):$t(Uc,{children:!x&&!A&&(!_||typeof g!="number"||Array.isArray(_)&&_.length<g)?$t(St,{height:"40px"}):null})]}),e,$t(oe,{CustomComponent:i,Fallback:$t(Be,{description:a,path:v})})]})}function qO(t){let{field:e,field:{admin:{allowCreate:o,className:n,description:r,isSortable:s}={},hasMany:i,label:a,localized:l,maxRows:c,relationTo:u,required:d},path:f,readOnly:m,validate:h}=t,{config:p}=H(),g=e.displayPreview,b=ZO.useCallback((E,T)=>{if(typeof h=="function")return h(E,{...T,required:d})},[h,d]),{customComponents:{AfterInput:v,BeforeInput:x,Description:y,Error:C,Label:S}={},disabled:w,filterOptions:D,path:_,setValue:A,showError:F,value:R}=Ee({potentiallyStalePath:f,validate:b}),I=JO(()=>rt(e),[e]);return YO(tf,{AfterInput:v,allowCreate:o!==!1,api:p.routes.api,BeforeInput:x,className:n,Description:y,description:r,displayPreview:g,Error:C,filterOptions:D,hasMany:i,isSortable:s,label:a,Label:S,localized:l,maxRows:c,onChange:A,path:_,readOnly:m||w,relationTo:u,required:d,serverURL:p.serverURL,showError:F,style:I,value:R})}var Yc=je(qO);function Aa(t){let e=QO(13),{clientFieldConfig:o,forceRender:n,indexPath:r,parentPath:s,parentSchemaPath:i,path:a,permissions:l,readOnly:c,schemaPath:u}=t,d;e[0]!==a?(d=h=>{let[p]=h;return p&&p?.[a]?.customComponents?.Field},e[0]=a,e[1]=d):d=e[1];let f=Et(d);if(f!==void 0)return f||null;let m;if(e[2]!==o||e[3]!==n||e[4]!==r||e[5]!==s||e[6]!==i||e[7]!==a||e[8]!==l||e[9]!==c||e[10]!==u){m=Symbol.for("react.early_return_sentinel");e:{let h={forceRender:n,permissions:l,readOnly:c,schemaPath:u},p={...h,indexPath:r,parentPath:s,parentSchemaPath:i};if(o.admin?.hidden){m=Ft(oc,{...h,path:a});break e}switch(o.type){case"array":{m=Ft(Zc,{...p,field:o,path:a});break e}case"blocks":{m=Ft(Ll,{...p,field:o,path:a});break e}case"checkbox":{m=Ft(mr,{...h,field:o,path:a});break e}case"code":{m=Ft(kl,{...h,field:o,path:a});break e}case"collapsible":{m=Ft(Ol,{...p,field:o,path:a});break e}case"date":{m=Ft(ec,{...h,field:o,path:a});break e}case"email":{m=Ft(oi,{...h,field:o,path:a});break e}case"group":{m=Ft(tc,{...p,field:o,path:a});break e}case"join":{m=Ft(mc,{...h,field:o,path:a});break e}case"json":{m=Ft(fc,{...h,field:o,path:a});break e}case"number":{m=Ft(pc,{...h,field:o,path:a});break e}case"point":{m=Ft(hc,{...h,field:o,path:a});break e}case"radio":{m=Ft(vc,{...h,field:o,path:a});break e}case"relationship":{m=Ft(Sc,{...h,field:o,path:a});break e}case"richText":{m=Ft(Ic,{...h,field:o,path:a});break e}case"row":{m=Ft(Rc,{...p,field:o});break e}case"select":{m=Ft(_c,{...h,field:o,path:a});break e}case"tabs":{m=Ft(Tc,{...p,field:o,path:a});break e}case"text":{m=Ft(di,{...h,field:o,path:a});break e}case"textarea":{m=Ft(Ec,{...h,field:o,path:a});break e}case"ui":{let g;e[12]===Symbol.for("react.memo_cache_sentinel")?(g=Ft(Pc,{}),e[12]=g):g=e[12],m=g;break e}case"upload":{m=Ft(Yc,{...h,field:o,path:a});break e}}}e[2]=o,e[3]=n,e[4]=r,e[5]=s,e[6]=i,e[7]=a,e[8]=l,e[9]=c,e[10]=u,e[11]=m}else m=e[11];if(m!==Symbol.for("react.early_return_sentinel"))return m}var Db="render-fields",So=t=>{let e=KO(22),{className:o,fields:n,forceRender:r,margins:s,parentIndexPath:i,parentPath:a,parentSchemaPath:l,permissions:c,readOnly:u}=t,d=Qo();if(n&&n.length>0){let f=s&&`${Db}--margins-${s}`,m=s===!1&&`${Db}--margins-none`,h;e[0]!==o||e[1]!==f||e[2]!==m?(h=[Db,o,f,m].filter(Boolean),e[0]=o,e[1]=f,e[2]=m,e[3]=h):h=e[3];let p=h.join(" "),g;if(e[4]!==n||e[5]!==r||e[6]!==d||e[7]!==i||e[8]!==a||e[9]!==l||e[10]!==c||e[11]!==u||e[12]!==p){let b;e[14]!==r||e[15]!==d||e[16]!==i||e[17]!==a||e[18]!==l||e[19]!==c||e[20]!==u?(b=(v,x)=>{if(!v||eM(v))return null;let{operation:y,permissions:C,read:S}=oM({field:v,operation:d,parentName:a?.includes(".")?a.split(".")[a.split(".").length-1]:a,permissions:c});if("name"in v&&!S)return null;let w=u||v?.admin?.readOnly;w&&v.admin?.readOnly===!1&&(w=!1),"name"in v&&!y&&(w=!0);let{indexPath:D,path:_,schemaPath:A}=tM({field:v,index:x,parentIndexPath:i,parentPath:a,parentSchemaPath:l});return _b(nh,{value:_,children:_b(Aa,{clientFieldConfig:v,forceRender:r,indexPath:D,parentPath:a,parentSchemaPath:l,path:_,permissions:C,readOnly:w,schemaPath:A})},`${_}-${x}`)},e[14]=r,e[15]=d,e[16]=i,e[17]=a,e[18]=l,e[19]=c,e[20]=u,e[21]=b):b=e[21],g=_b(py,{className:p,forceRender:r,children:n.map(b)}),e[4]=n,e[5]=r,e[6]=d,e[7]=i,e[8]=a,e[9]=l,e[10]=c,e[11]=u,e[12]=p,e[13]=g}else g=e[13];return g}return null};var Jc="array-field",YI=t=>{let e=rM(42),{addRow:o,attributes:n,CustomRowLabel:r,duplicateRow:s,errorCount:i,fields:a,forceRender:l,hasMaxRows:c,isDragging:u,isLoading:d,isSortable:f,labels:m,listeners:h,moveRow:p,parentPath:g,path:b,permissions:v,readOnly:x,removeRow:y,row:C,rowCount:S,rowIndex:w,schemaPath:D,setCollapse:_,setNodeRef:A,transform:F,transition:R}=t,I=l===void 0?!1:l,E=Cd(d,500),{i18n:T}=k(),$=Xt(),j=`${sM(m.singular,T)} ${String(w+1).padStart(2,"0")}`,N=i>0&&$,P=N?`${Jc}__row--has-errors`:`${Jc}__row--no-errors`,L;e[0]!==P?(L=[`${Jc}__row`,P].filter(Boolean),e[0]=P,e[1]=L):L=e[1];let V=L.join(" "),M=`${g.split(".").join("-")}-row-${w}`,O=u?1:void 0,B;if(e[2]!==r||e[3]!==o||e[4]!==n||e[5]!==V||e[6]!==s||e[7]!==i||e[8]!==j||e[9]!==N||e[10]!==a||e[11]!==I||e[12]!==c||e[13]!==T||e[14]!==E||e[15]!==f||e[16]!==h||e[17]!==p||e[18]!==g||e[19]!==b||e[20]!==v||e[21]!==x||e[22]!==y||e[23]!==C.collapsed||e[24]!==C.id||e[25]!==S||e[26]!==w||e[27]!==D||e[28]!==_||e[29]!==A||e[30]!==M||e[31]!==O||e[32]!==F||e[33]!==R){let G;e[35]!==i||e[36]!==N||e[37]!==T?(G=N&&ys(io,{count:i,i18n:T,withMessage:!0}),e[35]=i,e[36]=N,e[37]=T,e[38]=G):G=e[38];let X;e[39]!==C.id||e[40]!==_?(X=Z=>_(C.id,Z),e[39]=C.id,e[40]=_,e[41]=X):X=e[41],B=ys("div",{id:M,ref:A,style:{transform:F,transition:R,zIndex:O},children:ys(Xs,{actions:x?void 0:ys(xd,{addRow:o,duplicateRow:s,hasMaxRows:c,index:w,isSortable:f,moveRow:p,removeRow:y,rowCount:S}),className:V,collapsibleStyle:N?"error":"default",dragHandleProps:f?{id:C.id,attributes:n,listeners:h}:void 0,header:nM("div",{className:`${Jc}__row-header`,children:[E?ys(St,{height:"1rem",width:"8rem"}):ys(dn,{CustomComponent:r,label:j,path:b,rowNumber:w}),G]}),isCollapsed:C.collapsed,onToggle:X,children:E?ys(St,{}):ys(So,{className:`${Jc}__fields`,fields:a,forceRender:I,margins:"small",parentIndexPath:"",parentPath:b,parentSchemaPath:D,permissions:v===!0?v:v?.fields,readOnly:x})})},`${g}-row-${C.id}`),e[2]=r,e[3]=o,e[4]=n,e[5]=V,e[6]=s,e[7]=i,e[8]=j,e[9]=N,e[10]=a,e[11]=I,e[12]=c,e[13]=T,e[14]=E,e[15]=f,e[16]=h,e[17]=p,e[18]=g,e[19]=b,e[20]=v,e[21]=x,e[22]=y,e[23]=C.collapsed,e[24]=C.id,e[25]=S,e[26]=w,e[27]=D,e[28]=_,e[29]=A,e[30]=M,e[31]=O,e[32]=F,e[33]=R,e[34]=B}else B=e[34];return B};var yr="array-field",lM=t=>{let e=iM(52),{field:o,forceRender:n,path:r,permissions:s,readOnly:i,schemaPath:a,validate:l}=t,{name:c,admin:u,fields:d,label:f,localized:m,maxRows:h,minRows:p,required:g}=o,b;e[0]!==u?(b=u===void 0?{}:u,e[0]=u,e[1]=b):b=e[1];let{className:v,description:x,isSortable:y}=b,C=y===void 0?!0:y,S=n===void 0?!1:n,w=a??c,D=p??g?1:0,{setDocFieldPreferences:_}=Pe(),{addFieldRow:A,dispatchFields:F,moveFieldRow:R,removeFieldRow:I,setModified:E}=Oe(),T=Xt(),{code:$}=Ne(),{i18n:j,t:N}=k(),{config:P}=H(),{localization:L}=P,V;e:{if(L&&L.fallback){let K=L.defaultLocale;V=$===K;break e}V=!0}let M=V,O;e[2]!==N?(O=K=>"labels"in K&&K?.labels?K.labels:"labels"in K.field&&K.field.labels?{plural:K.field.labels?.plural,singular:K.field.labels?.singular}:"label"in K.field&&K.field.label?{plural:void 0,singular:K.field.label}:{plural:N("general:rows"),singular:N("general:row")},e[2]=N,e[3]=O):O=e[3];let G=O(t),X;e[4]!==M||e[5]!==h||e[6]!==D||e[7]!==g||e[8]!==l?(X=(K,W)=>{if(!M&&K===null)return!0;if(typeof l=="function")return l(K,{...W,maxRows:h,minRows:D,required:g})},e[4]=M,e[5]=h,e[6]=D,e[7]=g,e[8]=l,e[9]=X):X=e[9];let Z=X,te;e[10]!==Z||e[11]!==r?(te={hasRows:!0,potentiallyStalePath:r,validate:Z},e[10]=Z,e[11]=r,e[12]=te):te=e[12];let{customComponents:U,disabled:z,errorPaths:ce,path:J,rows:ue,showError:re,valid:q,value:pe}=Ee(te),he;e[13]!==U?(he=U===void 0?{}:U,e[13]=U,e[14]=he):he=e[14];let{AfterInput:_e,BeforeInput:ge,Description:Ve,Error:Q,Label:Le}=he,De;e[15]!==ue?(De=ue===void 0?[]:ue,e[15]=ue,e[16]=De):De=e[16];let ae=De,se;e[17]!==A||e[18]!==J||e[19]!==w?(se=K=>{A({path:J,rowIndex:K,schemaPath:w}),setTimeout(()=>{Ji(`${J}-row-${K}`)},0)},e[17]=A,e[18]=J,e[19]=w,e[20]=se):se=e[20];let Y=se,ie;e[21]!==F||e[22]!==J||e[23]!==E?(ie=K=>{F({type:"DUPLICATE_ROW",path:J,rowIndex:K}),E(!0),setTimeout(()=>{Ji(`${J}-row-${K}`)},0)},e[21]=F,e[22]=J,e[23]=E,e[24]=ie):ie=e[24];let me=ie,we;e[25]!==J||e[26]!==I?(we=K=>{I({path:J,rowIndex:K})},e[25]=J,e[26]=I,e[27]=we):we=e[27];let ze=we,$e;e[28]!==R||e[29]!==J?($e=(K,W)=>{R({moveFromIndex:K,moveToIndex:W,path:J})},e[28]=R,e[29]=J,e[30]=$e):$e=e[30];let ot=$e,Xe;e[31]!==F||e[32]!==J||e[33]!==ae||e[34]!==_?(Xe=K=>{let{collapsedIDs:W,updatedRows:ee}=fd({collapsed:K,rows:ae});_(J,{collapsed:W}),F({type:"SET_ALL_ROWS_COLLAPSED",path:J,updatedRows:ee})},e[31]=F,e[32]=J,e[33]=ae,e[34]=_,e[35]=Xe):Xe=e[35];let Ue=Xe,ft;e[36]!==F||e[37]!==J||e[38]!==ae||e[39]!==_?(ft=(K,W)=>{let{collapsedIDs:ee,updatedRows:le}=md({collapsed:W,rowID:K,rows:ae});F({type:"SET_ROW_COLLAPSED",path:J,updatedRows:le}),_(J,{collapsed:ee})},e[36]=F,e[37]=J,e[38]=ae,e[39]=_,e[40]=ft):ft=e[40];let Qt=ft,Ge=h&&ae.length>=h,Je=ce.length,Ye=T&&ce.length>0,xt=(i||z)&&ae.length===0,jt=ae.length&&ae.length<D||g&&ae.length===0,gt=Ye?`${yr}--has-error`:`${yr}--has-no-error`,qe;e[41]!==v||e[42]!==gt?(qe=[Ce,yr,v,gt].filter(Boolean),e[41]=v,e[42]=gt,e[43]=qe):qe=e[43];let Tt;e[44]!==Q||e[45]!==J||e[46]!==re?(Tt=re&&uo(oe,{CustomComponent:Q,Fallback:uo(He,{path:J,showError:re})}),e[44]=Q,e[45]=J,e[46]=re,e[47]=Tt):Tt=e[47];let be;return e[48]!==Je||e[49]!==Ye||e[50]!==j?(be=Ye&&Je>0&&uo(io,{count:Je,i18n:j,withMessage:!0}),e[48]=Je,e[49]=Ye,e[50]=j,e[51]=be):be=e[51],vi("div",{className:qe.join(" "),id:`field-${J.replace(/\./g,"__")}`,children:[Tt,vi("header",{className:`${yr}__header`,children:[vi("div",{className:`${yr}__header-wrap`,children:[vi("div",{className:`${yr}__header-content`,children:[uo("h3",{className:`${yr}__title`,children:uo(oe,{CustomComponent:Le,Fallback:uo(xe,{as:"span",label:f,localized:m,path:J,required:g})})}),be]}),ae?.length>0&&vi("ul",{className:`${yr}__header-actions`,children:[uo("li",{children:uo("button",{className:`${yr}__header-action`,onClick:()=>Ue(!0),type:"button",children:N("fields:collapseAll")})}),uo("li",{children:uo("button",{className:`${yr}__header-action`,onClick:()=>Ue(!1),type:"button",children:N("fields:showAll")})})]})]}),uo(oe,{CustomComponent:Ve,Fallback:uo(Be,{description:x,path:J})})]}),uo(Fl,{fieldValue:pe,localized:m,path:J}),ge,(ae?.length>0||!q&&(xt||jt))&&vi(cr,{className:`${yr}__draggable-rows`,ids:ae.map(cM),onDragEnd:K=>{let{moveFromIndex:W,moveToIndex:ee}=K;return ot(W,ee)},children:[ae.map((K,W)=>{let{id:ee,isLoading:le}=K,ve=`${J}.${W}`,Fe=ce?.filter(Se=>Se.startsWith(ve+".")).length;return uo(Jr,{disabled:i||z||!C,id:ee,children:Se=>uo(YI,{...Se,addRow:Y,CustomRowLabel:ae?.[W]?.customComponents?.RowLabel,duplicateRow:me,errorCount:Fe,fields:d,forceRender:S,hasMaxRows:Ge,isLoading:le,isSortable:C,labels:G,moveRow:ot,parentPath:J,path:ve,permissions:s,readOnly:i||z,removeRow:ze,row:K,rowCount:ae?.length,rowIndex:W,schemaPath:w,setCollapse:Qt})},ee)}),!q&&vi(aM.Fragment,{children:[xt&&uo(Rr,{children:N("validation:fieldHasNo",{label:Fb(G.plural,j)})}),jt&&uo(Rr,{type:"error",children:N("validation:requiresAtLeast",{count:D,label:Fb(D>1?G.plural:G.singular,j)||N(D>1?"general:rows":"general:row")})})]})]}),!Ge&&!i&&uo(ne,{buttonStyle:"icon-label",className:`${yr}__add-row`,icon:"plus",iconPosition:"left",iconStyle:"with-border",onClick:()=>{Y(pe||0)},children:N("fields:addLabel",{label:Fb(G.singular,j)})}),_e]})},Zc=je(lM);function cM(t){return t.id}import{c as uM}from"react/compiler-runtime";import{jsx as Ab,jsxs as ZI}from"react/jsx-runtime";import{confirmPassword as dM}from"payload/shared";import"react";var qc=t=>{let e=uM(12),{disabled:o,path:n}=t,r=n===void 0?"confirm-password":n,{t:s}=k(),i;e[0]!==r?(i={path:r,validate:mM},e[0]=r,e[1]=i):i=e[1];let{disabled:a,setValue:l,showError:c,value:u}=Ee(i),d=c&&"error",f;e[2]!==d?(f=[Ce,"confirm-password",d].filter(Boolean),e[2]=d,e[3]=f):f=e[3];let m=f.join(" "),h;return e[4]!==a||e[5]!==o||e[6]!==r||e[7]!==l||e[8]!==s||e[9]!==m||e[10]!==u?(h=ZI("div",{className:m,children:[Ab(xe,{htmlFor:"field-confirm-password",label:s("authentication:confirmPassword"),required:!0}),ZI("div",{className:`${Ce}__wrap`,children:[Ab(He,{path:r}),Ab("input",{"aria-label":s("authentication:confirmPassword"),autoComplete:"off",disabled:!!(a||o),id:"field-confirm-password",name:"confirm-password",onChange:l,type:"password",value:u||""})]})]}),e[4]=a,e[5]=o,e[6]=r,e[7]=l,e[8]=s,e[9]=m,e[10]=u,e[11]=h):h=e[11],h};function mM(t,e){return dM(t,{name:"confirm-password",type:"text",required:!0,...e})}import{jsx as pM}from"react/jsx-runtime";import{password as hM}from"payload/shared";import{useCallback as gM,useMemo as bM}from"react";import{c as fM}from"react/compiler-runtime";import{jsx as xi,jsxs as Tb}from"react/jsx-runtime";import{getTranslation as JI}from"@payloadcms/translations";import"react";var qI=t=>{let e=fM(28),{AfterInput:o,autoComplete:n,BeforeInput:r,className:s,description:i,Description:a,Error:l,inputRef:c,Label:u,label:d,localized:f,onChange:m,onKeyDown:h,path:p,placeholder:g,readOnly:b,required:v,rtl:x,showError:y,style:C,value:S,width:w}=t,D=n===void 0?"off":n,{i18n:_}=k(),A=y&&"error",F=b&&"read-only",R;e[0]!==s||e[1]!==A||e[2]!==F?(R=[Ce,"password",s,A,F].filter(Boolean),e[0]=s,e[1]=A,e[2]=F,e[3]=R):R=e[3];let I=R.join(" "),E;return e[4]!==o||e[5]!==r||e[6]!==a||e[7]!==l||e[8]!==u||e[9]!==D||e[10]!==i||e[11]!==_||e[12]!==c||e[13]!==d||e[14]!==f||e[15]!==m||e[16]!==h||e[17]!==p||e[18]!==g||e[19]!==b||e[20]!==v||e[21]!==x||e[22]!==y||e[23]!==C||e[24]!==I||e[25]!==S||e[26]!==w?(E=Tb("div",{className:I,style:{...C,width:w},children:[xi(oe,{CustomComponent:u,Fallback:xi(xe,{label:d,localized:f,path:p,required:v})}),Tb("div",{className:`${Ce}__wrap`,children:[xi(oe,{CustomComponent:l,Fallback:xi(He,{path:p,showError:y})}),Tb("div",{children:[r,xi("input",{"aria-label":JI(d,_),autoComplete:D,"data-rtl":x,disabled:b,id:`field-${p.replace(/\./g,"__")}`,name:p,onChange:m,onKeyDown:h,placeholder:JI(g,_),ref:c,type:"password",value:S||""}),o]}),xi(oe,{CustomComponent:a,Fallback:xi(Be,{description:i,path:p})})]})]}),e[4]=o,e[5]=r,e[6]=a,e[7]=l,e[8]=u,e[9]=D,e[10]=i,e[11]=_,e[12]=c,e[13]=d,e[14]=f,e[15]=m,e[16]=h,e[17]=p,e[18]=g,e[19]=b,e[20]=v,e[21]=x,e[22]=y,e[23]=C,e[24]=I,e[25]=S,e[26]=w,e[27]=E):E=e[27],E};var vM=t=>{let{autoComplete:e,field:o,field:{admin:{className:n,disabled:r,placeholder:s,rtl:i}={},label:a,localized:l,required:c}={},inputRef:u,path:d,validate:f}=t,{t:m}=k(),h=Ne(),{config:p}=H(),g=gM((R,I)=>{let E=d?d.split("."):[];return typeof f=="function"?f(R,{...I,required:c}):hM(R,{name:"password",type:"text",blockData:{},data:{},event:"onChange",path:E,preferences:{fields:{}},req:{payload:{config:p},t:m},required:!0,siblingData:{}})},[f,p,m,c,d]),{customComponents:{AfterInput:b,BeforeInput:v,Description:x,Error:y,Label:C}={},disabled:S,setValue:w,showError:D,value:_}=Ee({path:d,validate:g}),A=Zi({fieldLocalized:!1,fieldRTL:i,locale:h,localizationConfig:p.localization||void 0}),F=bM(()=>rt(o),[o]);return pM(qI,{AfterInput:b,autoComplete:e,BeforeInput:v,className:n,Description:x,Error:y,inputRef:u,Label:C,label:a,localized:l,onChange:R=>{w(R.target.value)},path:d,placeholder:s,readOnly:S||r,required:c,rtl:A,showError:D,style:F,value:_||""})},Qc=je(vM);var QI={array:Zc,blocks:Ll,checkbox:mr,code:kl,collapsible:Ol,confirmPassword:qc,date:ec,email:oi,group:tc,hidden:oc,join:mc,json:fc,number:pc,password:Qc,point:hc,radio:vc,relationship:Sc,richText:Ic,row:Rc,select:_c,tabs:Tc,text:di,textarea:Ec,ui:Pc,upload:Yc},xM={...QI,Description:Be,Error:He,Label:xe,RowLabel:dn};import{c as yM}from"react/compiler-runtime";import{setsAreEqual as CM}from"payload/shared";import{useEffect as wM}from"react";var Ln=new Map([]),SM={altleft:"alt",altright:"alt",controlleft:"ctrl",controlright:"ctrl",ctrlleft:"ctrl",ctrlright:"ctrl",escape:"esc",metaleft:"meta",metaright:"meta",osleft:"meta",osright:"meta",shiftleft:"shift",shiftright:"shift"},KI=t=>(SM[t.toLowerCase()]||t).trim().toLowerCase().replace("key",""),IM=t=>{let e=KI(t);e==="meta"&&Ln.forEach((o,n)=>n!=="meta"&&Ln.delete(n)),Ln.set(e,Date.now())},RM=t=>{let e=KI(t);e==="meta"&&Ln.clear(),Ln.delete(e)},yi=(t,e)=>{let o=yM(9),{cmdCtrlKey:n,editDepth:r,keyCodes:s}=t,{modalState:i}=de(),a;o[0]!==n||o[1]!==r||o[2]!==e||o[3]!==s||o[4]!==i?(a=f=>{let m=f.detail?.key?f.detail:f;if(m.key===void 0)return;Ln.forEach(_M),m.code&&IM(m.code);let h=window.navigator.userAgent.includes("Mac OS X"),p=[...Ln.keys()].filter(DM);if(CM(new Set(p),new Set(s))&&(!n||h&&Ln.has("meta")||!h&&m.ctrlKey)){if((Object.keys(i).filter(b=>i[b]?.isOpen)?.length+1||1)!==r)return;e(m)}},o[0]=n,o[1]=r,o[2]=e,o[3]=s,o[4]=i,o[5]=a):a=o[5];let l=a,c=FM,u,d;o[6]!==l?(u=()=>(document.addEventListener("keydown",l,!1),document.addEventListener("bypassKeyDown",l,!1),document.addEventListener("keyup",c,!1),()=>{document.removeEventListener("keydown",l),document.removeEventListener("bypassKeyDown",l),document.removeEventListener("keyup",c)}),d=[l,c],o[6]=l,o[7]=u,o[8]=d):(u=o[7],d=o[8]),wM(u,d)};function _M(t,e){Date.now()-t>3e3&&Ln.delete(e)}function DM(t){return!["alt","ctrl","meta","shift"].includes(t)}function FM(t){t.code&&RM(t.code)}import{c as AM}from"react/compiler-runtime";import*as t4 from"qs-esm";import{useEffect as e4,useRef as TM,useState as of}from"react";var EM=(t,e)=>{let o=AM(32),n;o[0]!==e?(n=e===void 0?{}:e,o[0]=e,o[1]=n):n=o[1];let r=n,{initialData:s,initialParams:i}=r,a;o[2]!==i?(a=i===void 0?{}:i,o[2]=i,o[3]=a):a=o[3];let l=a,{i18n:c}=k(),u;o[4]!==s?(u=s||{},o[4]=s,o[5]=u):u=o[5];let[d,f]=of(u),[m,h]=of(l),[p,g]=of(!s),[b,v]=of(!1),{code:x}=Ne(),y=TM(!1),C;if(o[6]!==x||o[7]!==m){let E;o[9]!==m?(E=typeof m=="object"?m:{},o[9]=m,o[10]=E):E=o[10],C=t4.stringify({locale:x,...E},{addQueryPrefix:!0}),o[6]=x,o[7]=m,o[8]=C}else C=o[8];let S=C,w;o[11]!==c.language||o[12]!==s||o[13]!==S||o[14]!==t?(w=()=>{if(s&&!y.current){y.current=!0;return}let E=new AbortController;return t?(async()=>{v(!1),g(!0);try{let $=await Qe.get(`${t}${S}`,{headers:{"Accept-Language":c.language},signal:E.signal});$.status>201&&v(!0);let j=await $.json();f(j),g(!1)}catch{E.signal.aborted||(v(!0),g(!1))}})():(v(!1),g(!1)),()=>{try{E.abort()}catch($){let j=$}}},o[11]=c.language,o[12]=s,o[13]=S,o[14]=t,o[15]=w):w=o[15];let D;o[16]!==c.language||o[17]!==s||o[18]!==x||o[19]!==S||o[20]!==t?(D=[t,x,S,c.language,s],o[16]=c.language,o[17]=s,o[18]=x,o[19]=S,o[20]=t,o[21]=D):D=o[21],e4(w,D);let _,A;o[22]!==s?(_=()=>{s&&y.current&&f(s)},A=[s],o[22]=s,o[23]=_,o[24]=A):(_=o[23],A=o[24]),e4(_,A);let F;o[25]!==d||o[26]!==b||o[27]!==p?(F={data:d,isError:b,isLoading:p},o[25]=d,o[26]=b,o[27]=p,o[28]=F):F=o[28];let R;o[29]===Symbol.for("react.memo_cache_sentinel")?(R={setParams:h},o[29]=R):R=o[29];let I;return o[30]!==F?(I=[F,R],o[30]=F,o[31]=I):I=o[31],I};import{c as PM}from"react/compiler-runtime";import{useEffect as NM,useState as LM}from"react";var $M=t=>{let e=PM(5),[o,n]=LM(),r,s;e[0]!==t?(r=()=>{let a;return t&&(a=new ResizeObserver(l=>{l.forEach(c=>{let{contentBoxSize:u,contentRect:d}=c,f=0,m=0;if(u){let h=Array.isArray(u)?u[0]:u;if(h){let{blockSize:p,inlineSize:g}=h;f=g,m=p}}else if(d){let{height:h,width:p}=d;f=p,m=h}n({height:m,width:f})})}),a.observe(t)),()=>{a&&a.unobserve(t)}},s=[t],e[0]=t,e[1]=r,e[2]=s):(r=e[1],s=e[2]),NM(r,s);let i;return e[3]!==o?(i={size:o},e[3]=o,e[4]=i):i=e[4],i};import{flattenTopLevelFields as kM}from"payload/shared";var Eb=t=>{let{admin:{useAsTitle:e},fields:o}=t;return kM(o)?.find(r=>"name"in r&&r.name===e)};import{c as n4}from"react/compiler-runtime";import{jsx as ka}from"react/jsx-runtime";import{useEffect as jM,useRef as OM}from"react";import{jsx as rf}from"react/jsx-runtime";import"react";var o4=({className:t})=>rf("svg",{className:"icon icon--sort",fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:rf("path",{className:"fill",d:"M2.5 13.3333L5.83333 16.6667M5.83333 16.6667L9.16667 13.3333M5.83333 16.6667V3.33333M9.16667 7.08333H17.5M9.16667 10.4167H15M11.6667 13.75H12.5",stroke:"#2F2F2F",strokeLinecap:"round",strokeLinejoin:"round"})}),r4=({className:t})=>rf("svg",{className:"icon icon--sort",fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:rf("path",{className:"fill",d:"M2.5 6.66668L5.83333 3.33334M5.83333 3.33334L9.16667 6.66668M5.83333 3.33334V16.6667M11.6667 7.08354H17.5M9.16667 10.4169H15M9.16667 13.7502H12.5",stroke:"#2F2F2F",strokeLinecap:"round",strokeLinejoin:"round"})});var $n="sort-header";function MM(){let t=n4(12),{handleSortChange:e,orderableFieldName:o,query:n}=Rt(),r=Array.isArray(n.sort)?n.sort[0]:n.sort,s=OM(r===`-${o}`?"desc":"asc"),i=r===`-${o}`||r===o,a,l;t[0]!==i||t[1]!==o||t[2]!==r?(a=()=>{i&&(s.current=r===`-${o}`?"desc":"asc")},l=[o,r,i],t[0]=i,t[1]=o,t[2]=r,t[3]=a,t[4]=l):(a=t[3],l=t[4]),jM(a,l);let c;t[5]!==e||t[6]!==i||t[7]!==o?(c=()=>{if(i){e(s.current==="asc"?`-${o}`:o),s.current=s.current==="asc"?"desc":"asc";return}e(s.current==="asc"?o:`-${o}`)},t[5]=e,t[6]=i,t[7]=o,t[8]=c):c=t[8];let u=c,d;return t[9]!==u||t[10]!==i?(d={handleSortPress:u,isActive:i,sort:s},t[9]=u,t[10]=i,t[11]=d):d=t[11],d}var BM=t=>{let e=n4(8),{appearance:o}=t,{handleSortPress:n,isActive:r,sort:s}=MM(),{t:i}=k(),a=o&&`${$n}--appearance-${o}`,l;e[0]!==a?(l=[$n,a].filter(Boolean),e[0]=a,e[1]=l):l=e[1];let c=l.join(" "),u;return e[2]!==n||e[3]!==r||e[4]!==s.current||e[5]!==i||e[6]!==c?(u=ka("div",{className:c,children:ka("div",{className:`${$n}__buttons`,children:s.current==="desc"?ka("button",{"aria-label":i("general:sortByLabelDirection",{direction:i("general:ascending"),label:"Order"}),className:`${$n}__button ${$n}__${s.current} ${r?`${$n}--active`:""}`,onClick:n,type:"button",children:ka(o4,{})}):ka("button",{"aria-label":i("general:sortByLabelDirection",{direction:i("general:descending"),label:"Order"}),className:`${$n}__button ${$n}__${s.current} ${r?`${$n}--active`:""}`,onClick:n,type:"button",children:ka(r4,{})})})}),e[2]=n,e[3]=r,e[4]=s.current,e[5]=i,e[6]=c,e[7]=u):u=e[7],u};import{c as VM}from"react/compiler-runtime";import{jsx as s4}from"react/jsx-runtime";import"react";var i4="sort-row",GM=()=>{let t=VM(2),{orderableFieldName:e,query:o}=Rt(),n=o.sort===e||o.sort===`-${e}`,r=`${i4} ${n?"active":""}`,s;return t[0]!==r?(s=s4("div",{className:r,role:"button",tabIndex:0,children:s4(Cn,{className:`${i4}__icon`})}),t[0]=r,t[1]=s):s=t[1],s};import{jsx as Ur,jsxs as l4}from"react/jsx-runtime";import{DragOverlay as WM}from"@dnd-kit/core";import{useEffect as HM,useState as Lb}from"react";import{jsx as nf}from"react/jsx-runtime";var Pb=({cellMap:t,columns:e,dragAttributes:o={},dragListeners:n={},rowId:r,...s})=>nf("tr",{...s,children:e.map((i,a)=>{let{accessor:l}=i,c=i.renderedCells[t[r]];return l==="_dragHandle"?nf("td",{className:`cell-${l}`,children:nf("div",{...o,...n,children:c})},a):nf("td",{className:`cell-${l}`,children:c},a)})});import{jsx as Nb}from"react/jsx-runtime";var a4=({children:t,className:e,rowId:o})=>typeof o>"u"?null:Nb("div",{className:e,children:Nb("table",{cellPadding:0,cellSpacing:0,children:Nb("tbody",{children:t})})});var sf="table",zM=({appearance:t="default",collection:e,columns:o,data:n})=>{let{config:r}=H(),{data:s,orderableFieldName:i,query:a}=Rt(),l=s?.docs||n,[c,u]=Lb(l),[d,f]=Lb({}),[m,h]=Lb();HM(()=>{u(l),f(Object.fromEntries(l.map((x,y)=>[String(x.id??x._id),y])))},[l]);let p=o?.filter(x=>x?.active);if(!p||p.filter(x=>!["_dragHandle","_select"].includes(x.accessor)).length===0)return Ur("div",{children:"No columns selected"});let g=async({moveFromIndex:x,moveToIndex:y})=>{if(a.sort!==i&&a.sort!==`-${i}`){fe.warning('To reorder the rows you must first sort them by the "Order" column'),h(void 0);return}if(x===y){h(void 0);return}let C=c[x].id??c[x]._id,S=y>x?c[y]:c[y-1],w=y>x?c[y+1]:c[y],D=[...c];u(_=>{let A=[..._];return A[x][i]="pending",A.splice(y,0,A.splice(x,1)[0]),A});try{let _=S?{id:S.id??S._id,key:S[i]}:{id:w.id??w._id,key:w[i]},A=S&&a.sort===i||!S&&a.sort===`-${i}`?"greater":"less",F={collectionSlug:e.slug,docsToMove:[C],newKeyWillBe:A,orderableFieldName:i,target:_},R=await fetch(`${r.routes.api}/reorder`,{body:JSON.stringify(F),headers:{"Content-Type":"application/json"},method:"POST"});if(R.status===403)throw new Error("You do not have permission to reorder these rows");if(!R.ok)throw new Error("Failed to reorder. This can happen if you reorder several rows too quickly. Please try again.")}catch(_){let A=_ instanceof Error?_.message:String(_);u(D),fe.error(A)}finally{h(void 0)}},b=({id:x})=>{h(x)},v=c.map(x=>x.id??x._id);return Ur("div",{className:[sf,t&&`${sf}--appearance-${t}`].filter(Boolean).join(" "),children:l4(cr,{ids:v,onDragEnd:g,onDragStart:b,children:[l4("table",{cellPadding:"0",cellSpacing:"0",children:[Ur("thead",{children:Ur("tr",{children:p.map((x,y)=>Ur("th",{id:`heading-${x.accessor}`,children:x.Heading},y))})}),Ur("tbody",{children:c.map((x,y)=>Ur(Jr,{id:v[y],children:({attributes:C,isDragging:S,listeners:w,setNodeRef:D,transform:_,transition:A})=>Ur(Pb,{cellMap:d,className:`row-${y+1}`,columns:p,dragAttributes:C,dragListeners:w,ref:D,rowId:x.id??x._id,style:{opacity:S?0:1,transform:_,transition:A}})},v[y]))})]}),Ur(WM,{children:Ur(a4,{className:[sf,`${sf}--drag-preview`].join(" "),rowId:m,children:Ur(Pb,{cellMap:d,columns:p,rowId:m})})})]})})};import{jsx as c4}from"react/jsx-runtime";import{toWords as XM,transformColumnsToSearchParams as UM}from"payload/shared";import"react";var YM="query-preset-columns-cell",ZM=({cellData:t})=>c4("div",{className:YM,children:t?UM(t).map((e,o)=>{let n=!e.startsWith("-");return n?c4(vt,{pillStyle:n?"always-white":"light",children:XM(e)},o):null}):"No columns selected"});import{jsx as JM}from"react/jsx-runtime";import{toWords as u4}from"payload/shared";import"react";var qM=t=>{if(t.or&&t.or.length>0&&t.or[0].and&&t.or[0].and.length>0){let o=t.or[0]?.and?.[0];if(!o)return"No where query";let n=Object.keys(o)[0];if(!o[n])return"No where query";let r=Object.keys(o[n])[0],s=o[n][r];return`${u4(n)} ${r} ${u4(s)}`}return""},QM=({cellData:t})=>JM("div",{children:t?qM(t):"No where query"});import{jsx as d4,jsxs as m4}from"react/jsx-runtime";import{toWords as f4}from"payload/shared";import{Fragment as KM}from"react";var eB=({cellData:t})=>{let e=["read","update","delete"];return d4("p",{children:e.reduce((o,n,r)=>{let s=t?.[n];return s&&s.constraint&&o.push(m4(KM,{children:[m4("span",{children:[d4("strong",{children:f4(n)}),": ",f4(s.constraint)]}),r!==e.length-1&&", "]},n)),o},[])})};import{c as tB}from"react/compiler-runtime";import{jsx as $b,jsxs as oB}from"react/jsx-runtime";import{toWords as rB,transformColumnsToSearchParams as nB}from"payload/shared";import"react";var sB=t=>{let e=tB(5),{field:o}=t,{label:n,required:r}=o,{path:s,value:i}=Ee(),a;return e[0]!==n||e[1]!==s||e[2]!==r||e[3]!==i?(a=oB("div",{className:"field-type query-preset-columns-field",children:[$b(xe,{as:"h3",label:n,path:s,required:r}),$b("div",{className:"value-wrapper",children:i?nB(i).map(iB):"No columns selected"})]}),e[0]=n,e[1]=s,e[2]=r,e[3]=i,e[4]=a):a=e[4],a};function iB(t,e){let o=!t.startsWith("-");return $b(vt,{pillStyle:o?"always-white":"light-gray",children:rB(t)},e)}import{jsx as kn,jsxs as af}from"react/jsx-runtime";import{getTranslation as aB}from"@payloadcms/translations";import{toWords as p4}from"payload/shared";import h4 from"react";var lB=(t,e)=>{if(!t)return null;let o=r=>{let s=Object.keys(r)[0];if(!r[s])return"No where query";let i=Object.keys(r[s])[0],a=r[s][i];if(typeof a=="object")try{a=new Date(a).toLocaleDateString()}catch{a="Unknown error has occurred"}return af(vt,{pillStyle:"always-white",children:[kn("b",{children:p4(s)})," ",i," ",kn("b",{children:p4(a)})]})};return((r,s)=>r.or&&r.or.length>0?kn("div",{className:"or-condition",children:r.or.map((i,a)=>kn(h4.Fragment,{children:i.and&&i.and.length>0?af("div",{className:"and-condition",children:[a===0&&kn("span",{className:"label",children:`Filter ${s} where `}),a>0&&kn("span",{className:"label",children:" or "}),i.and.map((l,c)=>af(h4.Fragment,{children:[o(l),c<i.and.length-1&&kn("span",{className:"label",children:" and "})]},c))]}):o(i)},a))}):o(r))(t,e)},cB=t=>{let{field:e}=t,{label:o,required:n}=e,{path:r,value:s}=Ee(),{collectionSlug:i}=Rt(),{getEntityConfig:a}=H(),l=a({collectionSlug:i}),{i18n:c}=k();return af("div",{className:"field-type query-preset-where-field",children:[kn(xe,{as:"h3",label:o,path:r,required:n}),kn("div",{className:"value-wrapper",children:s?lB(s,aB(l.labels.plural,c)):"No where query"})]})};import{c as gB}from"react/compiler-runtime";import{jsx as bB}from"react/jsx-runtime";import vB from"react";import{c as uB}from"react/compiler-runtime";import{useRouter as dB}from"next/navigation.js";import{useEffect as kb,useRef as mB}from"react";function fB(t,...e){t&&t.addEventListener&&t.addEventListener(...e)}function pB(t,...e){t&&t.removeEventListener&&t.removeEventListener(...e)}var hB=(t,e)=>{let o=uB(7),n=t===void 0?!0:t,r;o[0]!==n||o[1]!==e?(r=l=>{if(typeof n!="function"||n())return l.preventDefault(),e&&(l.returnValue=e),e},o[0]=n,o[1]=e,o[2]=r):r=o[2];let s=r,i,a;o[3]!==n||o[4]!==s?(i=()=>{if(n)return fB(window,"beforeunload",s),()=>pB(window,"beforeunload",s)},a=[n,s],o[3]=n,o[4]=s,o[5]=i,o[6]=a):(i=o[5],a=o[6]),kb(i,a)},g4=({hasAccepted:t=!1,message:e="Are you sure want to leave this page?",onAccept:o,onPrevent:n,prevent:r=!0})=>{hB(r,e);let{startRouteTransition:s}=st(),i=dB(),a=mB("");kb(()=>{function l(d,f){let m=new URL(d),h=new URL(f);if(m.hostname===h.hostname&&m.pathname===h.pathname&&m.search===h.search){let p=m.hash,g=h.hash;return p!==g&&m.href.replace(p,"")===h.href.replace(g,"")}return!1}function c(d){for(;d&&d.tagName.toLowerCase()!=="a";)d=d.parentElement;return d}function u(d){try{let f=d.target,m=c(f);if(m){let h=window.location.href,p=m.href,g=l(h,p),b=m.download!=="",v=m.target==="_blank"||d.metaKey||d.ctrlKey;!(p===h||g||b||v)&&r&&(n||!window.confirm(e))&&(a.current=p,d.preventDefault(),d.stopPropagation(),typeof n=="function"&&n())}}catch(f){alert(f)}}return document.addEventListener("click",u,!0),()=>{document.removeEventListener("click",u,!0)}},[n,r,e]),kb(()=>{t&&a.current&&(o&&o(),s(()=>i.push(a.current)))},[t,o,i,s])};var lf="leave-without-saving",Kc=()=>{let t=gB(15),{closeModal:e,openModal:o}=de(),n=Ut(),{isValid:r}=Oe(),{user:s}=Ae(),[i,a]=vB.useState(!1),{t:l}=k(),c=!!((n||!r)&&s),u;t[0]!==o?(u=()=>{o(lf)},t[0]=o,t[1]=u):u=t[1];let d=u,f;t[2]!==e?(f=()=>{e(lf)},t[2]=e,t[3]=f):f=t[3];let m=f,h;t[4]!==m||t[5]!==i||t[6]!==d||t[7]!==c?(h={hasAccepted:i,onAccept:m,onPrevent:d,prevent:c},t[4]=m,t[5]=i,t[6]=d,t[7]=c,t[8]=h):h=t[8],g4(h);let p;t[9]!==e?(p=()=>{e(lf)},t[9]=e,t[10]=p):p=t[10];let g=p,b;t[11]===Symbol.for("react.memo_cache_sentinel")?(b=()=>{a(!0)},t[11]=b):b=t[11];let v=b,x;return t[12]!==g||t[13]!==l?(x=bB(It,{body:l("general:changesNotSaved"),cancelLabel:l("general:stayOnThisPage"),confirmLabel:l("general:leaveAnyway"),heading:l("general:leaveWithoutSaving"),modalSlug:lf,onCancel:g,onConfirm:v}),t[12]=g,t[13]=l,t[14]=x):x=t[14],x};import{c as xB}from"react/compiler-runtime";import{jsx as eu,jsxs as jb}from"react/jsx-runtime";import{useEffect as yB}from"react";var ja="document-take-over",cf="document-take-over",Ob=t=>{let e=xB(17),{handleBackToDashboard:o,isActive:n,onReadOnly:r}=t,{closeModal:s,openModal:i}=de(),{t:a}=k(),{startRouteTransition:l}=st(),c,u;e[0]!==s||e[1]!==n||e[2]!==i?(c=()=>{n?i(ja):s(ja)},u=[n,i,s],e[0]=s,e[1]=n,e[2]=i,e[3]=c,e[4]=u):(c=e[3],u=e[4]),yB(c,u);let d;if(e[5]!==s||e[6]!==o||e[7]!==r||e[8]!==l||e[9]!==a){let f;e[11]!==o||e[12]!==l?(f=()=>{l(()=>o())},e[11]=o,e[12]=l,e[13]=f):f=e[13];let m;e[14]!==s||e[15]!==r?(m=()=>{r(),s(ja)},e[14]=s,e[15]=r,e[16]=m):m=e[16],d=eu(Yo,{className:cf,slug:ja,children:jb("div",{className:`${cf}__wrapper`,children:[jb("div",{className:`${cf}__content`,children:[eu("h1",{children:a("general:editingTakenOver")}),eu("p",{children:a("general:anotherUserTakenOver")})]}),jb("div",{className:`${cf}__controls`,children:[eu(ne,{buttonStyle:"primary",id:`${ja}-back-to-dashboard`,onClick:f,size:"large",children:a("general:backToDashboard")}),eu(ne,{buttonStyle:"secondary",id:`${ja}-view-read-only`,onClick:m,size:"large",children:a("general:viewReadOnly")})]})]})}),e[5]=s,e[6]=o,e[7]=r,e[8]=l,e[9]=a,e[10]=d}else d=e[10];return d};import{c as CB}from"react/compiler-runtime";import{jsx as Ci,jsxs as tu}from"react/jsx-runtime";import{useEffect as wB}from"react";var uf=t=>t&&typeof t=="object";var Cs="document-locked",df="document-locked",SB=t=>t?new Intl.DateTimeFormat("en-US",{day:"numeric",hour:"numeric",hour12:!0,minute:"numeric",month:"short",year:"numeric"}).format(t):"",Mb=t=>{let e=CB(30),{handleGoBack:o,isActive:n,onReadOnly:r,onTakeOver:s,updatedAt:i,user:a}=t,{closeModal:l,openModal:c}=de(),{t:u}=k(),{startRouteTransition:d}=st(),f,m;e[0]!==l||e[1]!==n||e[2]!==c?(f=()=>{n?c(Cs):l(Cs)},m=[n,c,l],e[0]=l,e[1]=n,e[2]=c,e[3]=f,e[4]=m):(f=e[3],m=e[4]),wB(f,m);let h;e[5]!==o||e[6]!==d?(h=()=>{d(()=>o())},e[5]=o,e[6]=d,e[7]=h):h=e[7];let p;if(e[8]!==l||e[9]!==o||e[10]!==r||e[11]!==s||e[12]!==d||e[13]!==u||e[14]!==h||e[15]!==i||e[16]!==a){let g;e[18]!==u||e[19]!==a?(g=uf(a)?a.email??a.id:`${u("general:user")}: ${a}`,e[18]=u,e[19]=a,e[20]=g):g=e[20];let b;e[21]!==o||e[22]!==d?(b=()=>{d(()=>o())},e[21]=o,e[22]=d,e[23]=b):b=e[23];let v;e[24]!==l||e[25]!==r?(v=()=>{r(),l(Cs)},e[24]=l,e[25]=r,e[26]=v):v=e[26];let x;e[27]!==l||e[28]!==s?(x=()=>{s(),l(Cs)},e[27]=l,e[28]=s,e[29]=x):x=e[29],p=Ci(Yo,{className:df,onClose:h,slug:Cs,children:tu("div",{className:`${df}__wrapper`,children:[tu("div",{className:`${df}__content`,children:[Ci("h1",{children:u("general:documentLocked")}),tu("p",{children:[Ci("strong",{children:g})," ",u("general:currentlyEditing")]}),tu("p",{children:[u("general:editedSince")," ",Ci("strong",{children:SB(i)})]})]}),tu("div",{className:`${df}__controls`,children:[Ci(ne,{buttonStyle:"secondary",id:`${Cs}-go-back`,onClick:b,size:"large",children:u("general:goBack")}),Ci(ne,{buttonStyle:"secondary",id:`${Cs}-view-read-only`,onClick:v,size:"large",children:u("general:viewReadOnly")}),Ci(ne,{buttonStyle:"primary",id:`${Cs}-take-over`,onClick:x,size:"large",children:u("general:takeOver")})]})]})}),e[8]=l,e[9]=o,e[10]=r,e[11]=s,e[12]=d,e[13]=u,e[14]=h,e[15]=i,e[16]=a,e[17]=p}else p=e[17];return p};import{jsx as mf}from"react/jsx-runtime";import"react";var b4=({elements:t,translationString:e})=>{let o=/(<[^>]+>.*?<\/[^>]+>)/g,n=e.split(o);return mf("span",{children:n.map((r,s)=>{if(t&&r.startsWith("<")&&r.endsWith(">")){let i=r[1],a=t[i];if(a){let l=new RegExp(`<${i}>(.*?)</${i}>`,"g"),c=r.replace(l,(u,d)=>d);return mf(a,{children:mf(b4,{translationString:c})},s)}}return r})})},wi=({elements:t,i18nKey:e,t:o,variables:n})=>{let r=o(e,n||{});return t?mf(b4,{elements:t,translationString:r}):r};import{c as IB}from"react/compiler-runtime";import{jsx as RB}from"react/jsx-runtime";import{getTranslation as _B}from"@payloadcms/translations";import NFe from"react";function Bb(t){let e=IB(3),{i18n:o}=k(),{description:n}=t;if(n){let r;return e[0]!==n||e[1]!==o?(r=RB("div",{className:"custom-view-description",children:_B(n,o)}),e[0]=n,e[1]=o,e[2]=r):r=e[2],r}return null}import{jsx as zo,jsxs as bf}from"react/jsx-runtime";import{formatAdminURL as d7}from"payload/shared";import{useEffect as m7,useRef as f7,useState as p7}from"react";import{c as EB}from"react/compiler-runtime";import{jsx as A4}from"react/jsx-runtime";import{usePathname as PB}from"next/navigation.js";import{formatAdminURL as NB}from"payload/shared";import"react";import{jsx as Vb,jsxs as DB}from"react/jsx-runtime";import"react";var ou="graphic-account",v4=t=>DB("svg",{className:[ou,t?.active&&`${ou}--active`].filter(Boolean).join(" "),height:"25",viewBox:"0 0 25 25",width:"25",xmlns:"http://www.w3.org/2000/svg",children:[Vb("circle",{className:`${ou}__bg`,cx:"12.5",cy:"12.5",r:"11.5"}),Vb("circle",{className:`${ou}__head`,cx:"12.5",cy:"10.73",r:"3.98"}),Vb("path",{className:`${ou}__body`,d:"M12.5,24a11.44,11.44,0,0,0,7.66-2.94c-.5-2.71-3.73-4.8-7.66-4.8s-7.16,2.09-7.66,4.8A11.44,11.44,0,0,0,12.5,24Z"})]});var D4=Ds(_4(),1);import{c as AB}from"react/compiler-runtime";import{jsx as TB}from"react/jsx-runtime";import"react";var F4=()=>{let t=AB(2),{user:e}=Ae(),o=(0,D4.default)(e.email.trim().toLowerCase()),r=`?${new URLSearchParams({default:"mp",r:"g",s:"50"}).toString()}`,s=`https://www.gravatar.com/avatar/${o}?${r}`,i;return t[0]!==s?(i=TB("img",{alt:"yas",className:"gravatar-account",height:25,src:s,style:{borderRadius:"50%"},width:25}),t[0]=s,t[1]=i):i=t[1],i};var Hb=()=>{let t=EB(3),{config:e}=H(),{admin:o,routes:n}=e,{avatar:r,routes:s}=o,{account:i}=s,{admin:a}=n,{user:l}=Ae(),u=PB()===NB({adminRoute:a,path:i});if(!l?.email||r==="default"){let d;return t[0]!==u?(d=A4(v4,{active:u}),t[0]=u,t[1]=d):d=t[1],d}if(r==="gravatar"){let d;return t[2]===Symbol.for("react.memo_cache_sentinel")?(d=A4(F4,{}),t[2]=d):d=t[2],d}};import{c as LB}from"react/compiler-runtime";import{jsx as $B}from"react/jsx-runtime";import{createContext as kB,use as jB,useState as OB}from"react";var T4=kB({Actions:{},setViewActions:()=>{}}),zb=()=>jB(T4),MB=t=>{let e=LB(4),{Actions:o,children:n}=t,[r,s]=OB(o),i;return e[0]!==o||e[1]!==n||e[2]!==r?(i=$B(T4,{value:{Actions:{...r,...o},setViewActions:s},children:n}),e[0]=o,e[1]=n,e[2]=r,e[3]=i):i=e[3],i};import{c as BB}from"react/compiler-runtime";import{jsx as ff,jsxs as N4}from"react/jsx-runtime";import"react";import{jsx as E4}from"react/jsx-runtime";import"react";var Xb=()=>E4("svg",{className:"icon icon--close-menu",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:E4("path",{className:"stroke",d:"M14 6L6 14M6 6L14 14",strokeLinecap:"square"})});import{jsx as P4}from"react/jsx-runtime";import"react";var Ub=()=>P4("svg",{className:"icon icon--menu",fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:P4("path",{className:"stroke",d:"M4.66667 10H15.3333M4.66667 6H15.3333M4.66667 14H15.3333",strokeLinecap:"square"})});var Yb="hamburger",Zb=t=>{let e=BB(4),{t:o}=k(),{closeIcon:n,isActive:r}=t,s=n===void 0?"x":n,i=r===void 0?!1:r,a;return e[0]!==s||e[1]!==i||e[2]!==o?(a=N4("div",{className:Yb,children:[!i&&ff("div",{"aria-label":o("general:open"),className:`${Yb}__open-icon`,title:o("general:open"),children:ff(Ub,{})}),i&&N4("div",{"aria-label":o(s==="collapse"?"general:collapse":"general:close"),className:`${Yb}__close-icon`,title:o(s==="collapse"?"general:collapse":"general:close"),children:[s==="x"&&ff(Xb,{}),s==="collapse"&&ff(Ze,{direction:"left"})]})]}),e[0]=s,e[1]=i,e[2]=o,e[3]=a):a=e[3],a};import{c as WB}from"react/compiler-runtime";import{jsx as Si,jsxs as HB}from"react/jsx-runtime";import{getTranslation as zB}from"@payloadcms/translations";import{useRouter as XB}from"next/navigation.js";import*as hf from"qs-esm";import{Fragment as UB}from"react";import{c as VB}from"react/compiler-runtime";import{jsx as L4,jsxs as Jb}from"react/jsx-runtime";import{getTranslation as GB}from"@payloadcms/translations";import"react";var ru="localizer-button",pf=t=>{let e=VB(12),{ariaLabel:o,className:n}=t,r=Ne(),{i18n:s,t:i}=k(),a;e[0]!==o||e[1]!==i?(a=o||i("general:locale"),e[0]=o,e[1]=i,e[2]=a):a=e[2];let l;e[3]!==n?(l=[ru,n].filter(Boolean),e[3]=n,e[4]=l):l=e[4];let c=l.join(" "),u=r?r.code:void 0,d=`${i("general:locale")}:`,f;return e[5]!==s||e[6]!==r.label||e[7]!==a||e[8]!==c||e[9]!==u||e[10]!==d?(f=Jb("div",{"aria-label":a,className:c,"data-locale":u,children:[Jb("div",{className:`${ru}__label`,children:[d,"\xA0"]}),Jb("div",{className:`${ru}__current`,children:[L4("span",{className:`${ru}__current-label`,children:`${GB(r.label,s)}`}),L4(Ze,{className:`${ru}__chevron`})]})]}),e[5]=s,e[6]=r.label,e[7]=a,e[8]=c,e[9]=u,e[10]=d,e[11]=f):f=e[11],f};var qb="localizer",$4=t=>{let e=WB(17),{className:o}=t,{config:n}=H(),{localization:r}=n,s=XB(),{startRouteTransition:i}=st(),{setLocaleIsLoading:a}=ud(),{i18n:l}=k(),c=Ne();if(r){let{locales:u}=r,d;e[0]!==o?(d=[qb,o].filter(Boolean),e[0]=o,e[1]=d):d=e[1];let f=d.join(" "),m;if(e[2]!==l||e[3]!==c||e[4]!==u||e[5]!==s||e[6]!==a||e[7]!==i||e[8]!==f){let h;e[10]!==l||e[11]!==c||e[12]!==u||e[13]!==s||e[14]!==a||e[15]!==i?(h=p=>{let{close:g}=p;return Si(Me.ButtonGroup,{children:u.map(b=>{let v=zB(b.label,l);return Si(Me.Button,{active:c.code===b.code,disabled:c.code===b.code,onClick:()=>{a(!0),g();let x=new URLSearchParams(window.location.search),y=hf.stringify({...hf.parse(x.toString(),{depth:10,ignoreQueryPrefix:!0}),locale:b.code},{addQueryPrefix:!0});i(()=>{s.push(y)})},children:v!==b.code?HB(UB,{children:[v,"\xA0",Si("span",{className:`${qb}__locale-code`,"data-locale":b.code,children:`(${b.code})`})]}):Si("span",{className:`${qb}__locale-code`,"data-locale":b.code,children:v})},b.code)})})},e[10]=l,e[11]=c,e[12]=u,e[13]=s,e[14]=a,e[15]=i,e[16]=h):h=e[16],m=Si("div",{className:f,children:Si(ho,{button:Si(pf,{}),horizontalAlign:"right",render:h,showScrollbar:!0,size:"large"})}),e[2]=l,e[3]=c,e[4]=u,e[5]=s,e[6]=a,e[7]=i,e[8]=f,e[9]=m}else m=e[9];return m}return null};import{jsx as YB}from"react/jsx-runtime";import{usePathname as ZB}from"next/navigation.js";import su,{useEffect as nu,useRef as JB}from"react";var k4=su.createContext({hydrated:!1,navOpen:!0,navRef:null,setNavOpen:()=>{},shouldAnimate:!1}),Ii=()=>su.use(k4),qB=async t=>{let o=(await t("nav"))?.open;return typeof o=="boolean"?o:!0},j4=({children:t,initialIsOpen:e})=>{let{breakpoints:{l:o,m:n,s:r}}=Co(),s=ZB(),{getPreference:i}=Fo(),a=JB(null),[l,c]=su.useState(e),[u,d]=su.useState(!1),[f,m]=su.useState(!1);return nu(()=>{o===!1&&(async()=>{let p=await qB(i);c(p)})()},[o,i,c]),nu(()=>{r===!0&&c(!1)},[s]),nu(()=>{a.current&&(l&&n?a.current.style.overscrollBehavior="contain":a.current.style.overscrollBehavior="auto")},[l,n]),nu(()=>{(o===!0||n===!0||r===!0)&&c(!1),m(!0),setTimeout(()=>{d(!0)},100)},[o,n,r]),nu(()=>()=>{a.current&&(a.current.style.overscrollBehavior="auto")},[]),YB(k4,{value:{hydrated:f,navOpen:l,navRef:a,setNavOpen:c,shouldAnimate:u},children:t})};import{c as QB}from"react/compiler-runtime";import{jsx as KB}from"react/jsx-runtime";import"react";var O4="nav-toggler",Qb=t=>{let e=QB(15),{id:o,children:n,className:r,tabIndex:s}=t,i=s===void 0?0:s,{t:a}=k(),{setPreference:l}=Fo(),{navOpen:c,setNavOpen:u}=Ii(),{breakpoints:d}=Co(),{l:f}=d,m=`${a(c?"general:close":"general:open")} ${a("general:menu")}`,h=c&&`${O4}--is-open`,p;e[0]!==r||e[1]!==h?(p=[O4,h,r].filter(Boolean),e[0]=r,e[1]=h,e[2]=p):p=e[2];let g=p.join(" "),b;e[3]!==f||e[4]!==c||e[5]!==u||e[6]!==l?(b=async()=>{u(!c),f||await l("nav",{open:!c},!0)},e[3]=f,e[4]=c,e[5]=u,e[6]=l,e[7]=b):b=e[7];let v;return e[8]!==n||e[9]!==o||e[10]!==m||e[11]!==g||e[12]!==b||e[13]!==i?(v=KB("button",{"aria-label":m,className:g,id:o,onClick:b,tabIndex:i,type:"button",children:n}),e[8]=n,e[9]=o,e[10]=m,e[11]=g,e[12]=b,e[13]=i,e[14]=v):v=e[14],v};import{c as c7}from"react/compiler-runtime";import{jsx as Ro,jsxs as V4}from"react/jsx-runtime";import{getTranslation as u7}from"@payloadcms/translations";import{Fragment as G4}from"react";import{jsx as M4,jsxs as e7}from"react/jsx-runtime";import"react";var gf=({fill:t})=>{let e=t||"var(--theme-elevation-1000)";return e7("svg",{className:"graphic-icon",height:"100%",viewBox:"0 0 25 25",width:"100%",xmlns:"http://www.w3.org/2000/svg",children:[M4("path",{d:"M11.8673 21.2336L4.40922 16.9845C4.31871 16.9309 4.25837 16.8355 4.25837 16.7282V10.1609C4.25837 10.0477 4.38508 9.97616 4.48162 10.0298L13.1404 14.9642C13.2611 15.0358 13.412 14.9464 13.412 14.8093V11.6091C13.412 11.4839 13.3456 11.3647 13.2309 11.2992L2.81624 5.36353C2.72573 5.30989 2.60505 5.30989 2.51454 5.36353L1.15085 6.14422C1.06034 6.19786 1 6.29321 1 6.40048V18.5995C1 18.7068 1.06034 18.8021 1.15085 18.8558L11.8491 24.9583C11.9397 25.0119 12.0603 25.0119 12.1509 24.9583L21.1355 19.8331C21.2562 19.7616 21.2562 19.5948 21.1355 19.5232L18.3357 17.9261C18.2211 17.8605 18.0883 17.8605 17.9737 17.9261L12.175 21.2336C12.0845 21.2872 11.9638 21.2872 11.8733 21.2336H11.8673Z",fill:e}),M4("path",{d:"M22.8491 6.13827L12.1508 0.0417218C12.0603 -0.0119135 11.9397 -0.0119135 11.8491 0.0417218L6.19528 3.2658C6.0746 3.33731 6.0746 3.50418 6.19528 3.57569L8.97092 5.16091C9.08557 5.22647 9.21832 5.22647 9.33296 5.16091L11.8672 3.71872C11.9578 3.66508 12.0784 3.66508 12.1689 3.71872L19.627 7.96782C19.7175 8.02146 19.7778 8.11681 19.7778 8.22408V14.8212C19.7778 14.9464 19.8442 15.0656 19.9589 15.1311L22.7345 16.7104C22.8552 16.7819 23.006 16.6925 23.006 16.5554V6.40048C23.006 6.29321 22.9457 6.19786 22.8552 6.14423L22.8491 6.13827Z",fill:e})]})};import{c as t7}from"react/compiler-runtime";import{jsx as o7}from"react/jsx-runtime";import{createContext as r7,use as n7,useState as s7}from"react";var jn=()=>n7(B4),B4=r7({}),Kb=t=>{let e=t7(4),{children:o}=t,n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=[],e[0]=n):n=e[0];let[r,s]=s7(n),i;return e[1]!==o||e[2]!==r?(i=o7(B4,{value:{setStepNav:s,stepNav:r},children:o}),e[1]=o,e[2]=r,e[3]=i):i=e[3],i};import{c as i7}from"react/compiler-runtime";import{useEffect as a7}from"react";var l7=t=>{let e=i7(4),{nav:o}=t,{setStepNav:n}=jn(),r,s;return e[0]!==o||e[1]!==n?(r=()=>{n(o)},s=[n,o],e[0]=o,e[1]=n,e[2]=r,e[3]=s):(r=e[2],s=e[3]),a7(r,s),null};var iu="step-nav",W4=t=>{let e=c7(7),{className:o,CustomIcon:n}=t,{i18n:r}=k(),{stepNav:s}=jn(),{config:i}=H(),{routes:a}=i,{admin:l}=a,{t:c}=k(),u;return e[0]!==n||e[1]!==l||e[2]!==o||e[3]!==r||e[4]!==s||e[5]!==c?(u=Ro(G4,{children:s.length>0?V4("nav",{className:[iu,o].filter(Boolean).join(" "),children:[Ro(no,{className:`${iu}__home`,href:l,prefetch:!1,tabIndex:0,children:Ro("span",{title:c("general:dashboard"),children:Ro(oe,{CustomComponent:n,Fallback:Ro(gf,{})})})}),Ro("span",{children:"/"}),s.map((d,f)=>{let m=u7(d.label,r);return s.length===f+1?Ro("span",{className:`${iu}__last`,children:m},f):V4(G4,{children:[d.url?Ro(no,{href:d.url,prefetch:!1,children:Ro("span",{children:m},f)}):Ro("span",{children:m},f),Ro("span",{children:"/"})]},f)})]}):Ro("div",{className:[iu,o].filter(Boolean).join(" "),children:Ro("div",{className:`${iu}__home`,children:Ro("span",{title:c("general:dashboard"),children:Ro(oe,{CustomComponent:n,Fallback:Ro(gf,{})})})})})}),e[0]=n,e[1]=l,e[2]=o,e[3]=r,e[4]=s,e[5]=c,e[6]=u):u=e[6],u};var _o="app-header";function h7({CustomAvatar:t,CustomIcon:e}){let{t:o}=k(),{Actions:n}=zb(),{config:{admin:{routes:{account:r}},localization:s,routes:{admin:i}}}=H(),{navOpen:a}=Ii(),l=f7(null),[c,u]=p7(!1);m7(()=>{let f=()=>{let m=l.current;if(m){let h=m.scrollWidth>m.clientWidth;u(h)}};return f(),window.addEventListener("resize",f),()=>{window.removeEventListener("resize",f)}},[n]);let d=n?Object.values(n):[];return bf("header",{className:[_o,a&&`${_o}--nav-open`].filter(Boolean).join(" "),children:[zo("div",{className:`${_o}__bg`}),zo("div",{className:`${_o}__content`,children:bf("div",{className:`${_o}__wrapper`,children:[zo(Qb,{className:`${_o}__mobile-nav-toggler`,tabIndex:-1,children:zo(Zb,{})}),bf("div",{className:`${_o}__controls-wrapper`,children:[zo("div",{className:`${_o}__step-nav-wrapper`,children:zo(W4,{className:`${_o}__step-nav`,CustomIcon:e})}),bf("div",{className:`${_o}__actions-wrapper`,children:[zo("div",{className:`${_o}__actions`,ref:l,children:d.map((f,m)=>zo("div",{className:c&&m===d.length-1?`${_o}__last-action`:"",children:f},m))}),c&&zo("div",{className:`${_o}__gradient-placeholder`})]}),s&&zo(pf,{ariaLabel:"invisible",className:`${_o}__localizer-spacing`}),zo(no,{"aria-label":o("authentication:account"),className:`${_o}__account`,href:d7({adminRoute:i,path:r}),prefetch:!1,tabIndex:0,children:zo(oe,{CustomComponent:t,Fallback:zo(Hb,{})})})]})]})}),zo($4,{className:`${_o}__localizer`})]})}import{jsx as e1,jsxs as g7}from"react/jsx-runtime";import"react";var au="card",b7=t=>{let{id:e,actions:o,buttonAriaLabel:n,href:r,onClick:s,title:i,titleAs:a}=t,l=[au,e,(s||r)&&`${au}--has-onclick`].filter(Boolean).join(" ");return g7("div",{className:l,id:e,children:[e1(a??"div",{className:`${au}__title`,children:i}),o&&e1("div",{className:`${au}__actions`,children:o}),(s||r)&&e1(ne,{"aria-label":n,buttonStyle:"none",className:`${au}__click`,el:"link",onClick:s,to:r})]})};import{c as v7}from"react/compiler-runtime";import{jsx as ws,jsxs as vf}from"react/jsx-runtime";import{getTranslation as x7}from"@payloadcms/translations";import{useRouter as y7}from"next/navigation.js";import Oa from"react";var xf="copy-locale-data",yf="copy-locale",t1=()=>{let t=v7(38),{config:e}=H(),{localization:o,routes:n,serverURL:r}=e,{admin:s}=n,{code:i}=Ne(),{id:a,collectionSlug:l,globalSlug:c}=Pe(),{i18n:u,t:d}=k(),f=Ut(),{toggleModal:m}=de(),{copyDataFromLocale:h}=Dt(),p=y7(),{startRouteTransition:g}=st(),b;t[0]!==o?(b=o&&o.locales.map(C7)||[],t[0]=o,t[1]=b):b=t[1];let v=b,x;t[2]!==i?(x=G=>G.value!==i,t[2]=i,t[3]=x):x=t[3];let y=v.filter(x),C;t[4]!==u||t[5]!==o?(C=G=>{let X=o&&o.locales.find(Z=>Z.code===G);return X&&X.label?x7(X.label,u):G},t[4]=u,t[5]=o,t[6]=C):C=t[6];let S=C,[w,D]=Oa.useState(!1),[_,A]=Oa.useState(null),[F,R]=Oa.useState(i),[I,E]=Oa.useState(!1),T,$;t[7]!==i||t[8]!==F?(T=()=>{F!==i&&R(i)},$=[i,F],t[7]=i,t[8]=F,t[9]=T,t[10]=$):(T=t[9],$=t[10]),Oa.useEffect(T,$);let j;t[11]!==s||t[12]!==l||t[13]!==h||t[14]!==c||t[15]!==a||t[16]!==I||t[17]!==p||t[18]!==r||t[19]!==g||t[20]!==m?(j=async G=>{let{from:X,to:Z}=G;D(!0);try{await h({collectionSlug:l,docID:a,fromLocale:X,globalSlug:c,overrideData:I,toLocale:Z}),D(!1),g(()=>p.push(`${r}${s}/${l?`collections/${l}/${a}`:`globals/${c}`}?locale=${Z}`)),m(yf)}catch(te){let U=te;fe.error(U.message)}},t[11]=s,t[12]=l,t[13]=h,t[14]=c,t[15]=a,t[16]=I,t[17]=p,t[18]=r,t[19]=g,t[20]=m,t[21]=j):j=t[21];let N=j;if(!a&&!c)return null;let P;t[22]!==f||t[23]!==d||t[24]!==m?(P=()=>{f?fe.info(d("general:unsavedChanges")):m(yf)},t[22]=f,t[23]=d,t[24]=m,t[25]=P):P=t[25];let L;t[26]!==m?(L=()=>{m(yf)},t[26]=m,t[27]=L):L=t[27];let V;t[28]!==N||t[29]!==w||t[30]!==F||t[31]!==d||t[32]!==_?(V=async()=>{if(F===_){fe.error(d("localization:cannotCopySameLocale"));return}w||await N({from:F,to:_})},t[28]=N,t[29]=w,t[30]=F,t[31]=d,t[32]=_,t[33]=V):V=t[33];let M;t[34]===Symbol.for("react.memo_cache_sentinel")?(M=G=>{G?.value&&R(G.value)},t[34]=M):M=t[34];let O;t[35]===Symbol.for("react.memo_cache_sentinel")?(O=G=>{G?.value&&A(G.value)},t[35]=O):O=t[35];let B;return t[36]!==I?(B=()=>E(!I),t[36]=I,t[37]=B):B=t[37],vf(Oa.Fragment,{children:[ws(Me.Button,{id:`${xf}__button`,onClick:P,children:d("localization:copyToLocale")}),vf(Pt,{className:xf,gutter:!1,Header:ws(Da,{onClose:L,title:d("localization:copyToLocale")}),slug:yf,children:[vf("div",{className:`${xf}__sub-header`,children:[ws("span",{children:F&&_?ws("div",{children:d("localization:copyFromTo",{from:S(F),to:S(_)})}):d("localization:selectLocaleToCopy")}),ws(ne,{buttonStyle:"primary",disabled:!F||!_,iconPosition:"left",onClick:V,size:"medium",children:w?d("general:copying")+"...":d("general:copy")})]}),vf("div",{className:`${xf}__content`,children:[ws(Sa,{label:d("localization:copyFrom"),name:"fromLocale",onChange:M,options:v,path:"fromLocale",readOnly:!0,value:F}),ws(Sa,{label:d("localization:copyTo"),name:"toLocale",onChange:O,options:y,path:"toLocale",value:_}),ws(mr,{checked:I,field:{name:"overwriteExisting",label:d("general:overwriteExistingData")},onChange:B,path:"overwriteExisting"})]})]})]})};function C7(t){return{label:t.label,value:t.code}}import{jsx as Y4,jsxs as L7}from"react/jsx-runtime";import{getTranslation as Z4}from"@payloadcms/translations";import{useRouter as $7,useSearchParams as k7}from"next/navigation.js";import{mergeListSearchAndWhere as j7}from"payload/shared";import*as q4 from"qs-esm";import O7,{useCallback as J4}from"react";import{c as w7}from"react/compiler-runtime";import{jsx as S7}from"react/jsx-runtime";import{usePathname as I7,useRouter as R7}from"next/navigation.js";import{createContext as _7,use as D7,useEffect as F7}from"react";var H4=_7({clearRouteCache:()=>{}}),o1=t=>{let e=w7(10),{children:o}=t,n=I7(),r=R7(),s;e[0]!==r?(s=()=>{r.refresh()},e[0]=r,e[1]=s):s=e[1];let i=s,a;e[2]!==i?(a=()=>{i()},e[2]=i,e[3]=a):a=e[3];let l;e[4]!==i||e[5]!==n?(l=[n,i],e[4]=i,e[5]=n,e[6]=l):l=e[6],F7(a,l);let c;return e[7]!==o||e[8]!==i?(c=S7(H4,{value:{clearRouteCache:i},children:o}),e[7]=o,e[8]=i,e[9]=c):c=e[9],c},On=()=>D7(H4);import{jsx as A7}from"react/jsx-runtime";import{useSearchParams as T7}from"next/navigation.js";import*as X4 from"qs-esm";import{createContext as E7,use as P7,useCallback as r1,useEffect as z4,useRef as N7,useState as n1}from"react";var xo=function(t){return t.AllAvailable="allAvailable",t.AllInPage="allInPage",t.None="none",t.Some="some",t}({}),U4=E7({}),s1=({children:t,docs:e=[],totalDocs:o,user:n})=>{let r=N7({}),{code:s}=Ne(),[i,a]=n1(()=>{let g=new Map;return e.forEach(({id:b})=>{g.set(b,!1)}),g}),[l,c]=n1("none"),[u,d]=n1(0),f=T7(),m=r1((g=!1)=>{let b=new Map;g?(c("allAvailable"),e.forEach(({id:v,_isLocked:x,_userEditing:y})=>{(!x||y?.id===n?.id)&&b.set(v,!0)})):l==="allAvailable"||l==="allInPage"?c("none"):e.forEach(({id:v,_isLocked:x,_userEditing:y})=>{(!x||y?.id===n?.id)&&b.set(v,l!=="some")}),a(b)},[e,l,n?.id]),h=r1(g=>{let b=e.find(C=>C.id===g);if(b?._isLocked&&n?.id!==b?._userEditing.id)return;let v=i.get(g),x=typeof v=="boolean"?!v:!0,y=new Map(i.set(g,x));l==="allAvailable"&&!x&&c("some"),a(y)},[i,e,l,n?.id]),p=r1(g=>{let b;if(l==="allAvailable")b=jr(f)?.where||{id:{not_equals:""}};else{let v=[];for(let[x,y]of i)y&&v.push(x);b={id:{in:v}}}return g&&(b={and:[{...g},b]}),X4.stringify({locale:s,where:b},{addQueryPrefix:!0})},[l,i,s,f]);return z4(()=>{if(l==="allAvailable")return;let g=!1,b=!0;if(!i.size)b=!1,g=!1;else for(let[v,x]of i)b=b&&x,g=g||x;b&&i.size===e.length?c("allInPage"):c(g?"some":"none")},[l,i,o,e]),z4(()=>{let g=0;if(l==="allAvailable")g=o;else for(let[b,v]of i)v&&g++;d(g)},[l,i,o]),r.current={count:u,getQueryParams:p,selectAll:l,selected:i,setSelection:h,toggleAll:m,totalDocs:o},A7(U4,{value:r.current,children:t})},oo=()=>P7(U4);var M7="delete-documents",i1=t=>{let{collection:e,collection:{slug:o,labels:{plural:n,singular:r}}={}}=t,{permissions:s}=Ae(),{config:{routes:{api:i},serverURL:a}}=H(),{openModal:l}=de(),{count:c,getQueryParams:u,selectAll:d,toggleAll:f}=oo(),{i18n:m,t:h}=k(),p=$7(),g=k7(),{clearRouteCache:b}=On(),x=s?.collections?.[o]?.delete,y=`delete-${o}`,C=J4(()=>{fe.error(h("error:unknown"))},[h]),S=J4(async()=>{let w=j7({collectionConfig:e,search:g.get("search")}),D=u(w);await Qe.delete(`${a}${i}/${o}${D}`,{headers:{"Accept-Language":m.language,"Content-Type":"application/json"}}).then(async _=>{try{let A=await _.json(),F=A?.docs.length||0,R=F>1?n:r;if(_.status<400||F>0)return fe.success(h("general:deletedCountSuccessfully",{count:F,label:Z4(R,m)})),A?.errors.length>0&&fe.error(A.message,{description:A.errors.map(I=>I.message).join(`
55
- `)}),f(),p.replace(q4.stringify({page:d?"1":void 0},{addQueryPrefix:!0})),b(),null;if(A.errors)fe.error(A.message,{description:A.errors.map(I=>I.message).join(`
56
- `)});else return C();return!1}catch{return C()}})},[g,C,i,u,m,n,p,d,a,r,o,h,f,b,e]);return d===xo.None||!x?null:L7(O7.Fragment,{children:[Y4("button",{className:`${M7}__toggle`,onClick:()=>{l(y)},type:"button",children:h("general:delete")}),Y4(It,{body:h("general:aboutToDeleteCount",{count:c,label:Z4(c>1?n:r,m)}),confirmingLabel:h("general:deleting"),heading:h("general:confirmDeletion"),modalSlug:y,onConfirm:S})]})};import{c as I8}from"react/compiler-runtime";import{jsx as at,jsxs as Lo}from"react/jsx-runtime";import{getTranslation as R8}from"@payloadcms/translations";import{formatAdminURL as _8}from"payload/shared";import p1,{Fragment as cu,useEffect as D8}from"react";import{jsx as K4,jsxs as V7}from"react/jsx-runtime";import{dequal as G7}from"dequal/lite";import{reduceFieldsToValues as eR,versionDefaults as W7}from"payload/shared";import H7,{useDeferredValue as z7,useEffect as tR,useRef as Ri,useState as X7}from"react";import{unflatten as B7}from"payload/shared";var Q4=(t,e,o)=>{let n={data:{},valid:!0};return t&&(Object.keys(t).forEach(r=>{(o===!0||!t[r]?.disableFormData)&&(n.data[r]=t[r]?.value,t[r].valid||(n.valid=!1))}),e&&(n.data=B7(n.data))),n};var U7="autosave",oR=1e3,rR=({id:t,collection:e,global:o})=>{let{config:{routes:{api:n},serverURL:r}}=H(),{docConfig:s,incrementVersionCount:i,lastUpdateTime:a,mostRecentVersionIsAutosaved:l,setLastUpdateTime:c,setMostRecentVersionIsAutosaved:u,setUnpublishedVersionCount:d,updateSavedDocumentData:f}=Pe(),{reportUpdate:m}=fi(),{dispatchFields:h,isValid:p,setBackgroundProcessing:g,setIsValid:b,setSubmitted:v}=Oe(),[x]=ki(),y=Ut(),C=Xt(),{code:S}=Ne(),{i18n:w,t:D}=k(),_=s?.versions,A=W7.autosaveInterval;_.drafts&&_.drafts.autosave&&(A=_.drafts.autosave.interval);let F=!!(s?.versions?.drafts&&s?.versions?.drafts.validate),[R,I]=X7(!1),E=z7(R),T=Jo(x,A),$=Ri(x),j=Ri(y),N=Ri(S),P=Ri(p);$.current=x,j.current=y,N.current=S;let{queueTask:L}=Nm(),V=Ri(null),M=eo(()=>{V.current=void 0;let X,Z,te=()=>{Z-X<oR?V.current=setTimeout(()=>{I(!1)},oR-(Z-X)):G()};L(async()=>{if(y){X=new Date().getTime(),I(!0);let U,z,ce;if(e&&t&&(ce=e.slug,U=`${r}${n}/${ce}/${t}?draft=true&autosave=true&locale=${N.current}`,z="PATCH"),o&&(ce=o.slug,U=`${r}${n}/globals/${ce}?draft=true&autosave=true&locale=${N.current}`,z="POST"),U&&j.current){let{data:J,valid:ue}=Q4($.current,!0);if(J._status="draft",!(C&&!ue&&_?.drafts&&_?.drafts?.validate)&&P.current){let q;try{q=await fetch(U,{body:JSON.stringify(J),credentials:"include",headers:{"Accept-Language":w.language,"Content-Type":"application/json"},method:z})}catch{}let pe=new Date;Z=pe.getTime(),q.status===200&&(c(pe.getTime()),m({id:t,entitySlug:ce,updatedAt:pe.toISOString()}),l||(i(),u(!0),d(_e=>_e+1)));let he=await q.json();if(_?.drafts&&_?.drafts?.validate&&he?.errors){if(Array.isArray(he.errors)){let[_e,ge]=he.errors.reduce(([Ve,Q],Le)=>{let De=[],ae=[];return Le?.message&&ae.push(Le),Array.isArray(Le?.data)&&Le.data.forEach(se=>{se?.field?De.push(se):ae.push(se)}),[[...Ve,...De],[...Q,...ae]]},[[],[]]);h({type:"ADD_SERVER_ERRORS",errors:_e}),ge.forEach(Ve=>{fe.error(Ve.message||w.t("error:unknown"))}),P.current=!1,b(!1),v(!0),te();return}}else{let _e=he?.doc||he?.result;_e&&(b(!0),P.current=!0,f(_e))}te()}}}},{afterProcess:()=>{g(!1)},beforeProcess:()=>{if(!P.current)return P.current=!0,!1;g(!0)}})}),O=Ri(!1),B=Ri(eR(T));tR(()=>{if(!O.current){O.current=!0;return}let X=eR(T);G7(X,B)||(B.current=X,M())},[T]),tR(()=>()=>{G()},[]);let G=eo(()=>{V.current&&clearTimeout(V.current),I(!1)});return V7("div",{className:U7,children:[F&&!p&&K4(Kc,{}),E&&D("general:saving"),!E&&!!a&&K4(H7.Fragment,{children:D("version:lastSavedAgo",{distance:Hx({date:a,i18n:w})})})]})};import{jsx as Cf,jsxs as Y7}from"react/jsx-runtime";import{getTranslation as nR}from"@payloadcms/translations";import{useRouter as Z7}from"next/navigation.js";import{formatAdminURL as J7}from"payload/shared";import q7,{useCallback as sR}from"react";var iR=t=>{let{id:e,buttonId:o,collectionSlug:n,onDelete:r,redirectAfterDelete:s=!0,singularLabel:i,title:a}=t,{config:{routes:{admin:l,api:c},serverURL:u},getEntityConfig:d}=H(),f=d({collectionSlug:n}),{setModified:m}=Oe(),h=Z7(),{i18n:p,t:g}=k(),{title:b}=Pe(),{startRouteTransition:v}=st(),{openModal:x}=de(),y=`delete-${e}`,C=sR(()=>{fe.error(g("error:deletingTitle",{title:b}))},[g,b]),S=sR(async()=>{m(!1);try{await Qe.delete(`${u}${c}/${n}/${e}`,{headers:{"Accept-Language":p.language,"Content-Type":"application/json"}}).then(async w=>{try{let D=await w.json();if(w.status<400){if(fe.success(g("general:titleDeleted",{label:nR(i,p),title:b})||D.message),s)return v(()=>h.push(J7({adminRoute:l,path:`/collections/${n}`})));typeof r=="function"&&await r({id:e,collectionConfig:f});return}return D.errors?D.errors.forEach(_=>fe.error(_.message)):C(),!1}catch{return C()}})}catch{return C()}},[m,u,c,n,e,g,i,C,p,b,h,l,s,r,f,v]);return e?Y7(q7.Fragment,{children:[Cf(Me.Button,{id:o,onClick:()=>{x(y)},children:g("general:delete")}),Cf(It,{body:Cf(wi,{elements:{1:({children:w})=>Cf("strong",{children:w})},i18nKey:"general:aboutToDelete",t:g,variables:{label:nR(i,p),title:a||b||e}}),confirmingLabel:g("general:deleting"),heading:g("general:confirmDeletion"),modalSlug:y,onConfirm:S})]}):null};import{jsx as aR,jsxs as Q7}from"react/jsx-runtime";import{getTranslation as lR}from"@payloadcms/translations";import{useRouter as K7}from"next/navigation.js";import{formatAdminURL as e8}from"payload/shared";import cR,{useCallback as uR}from"react";var dR=({id:t,slug:e,onDuplicate:o,redirectAfterDuplicate:n=!0,singularLabel:r})=>{let s=K7(),i=Ut(),{openModal:a}=de(),l=Ne(),{setModified:c}=Oe(),{startRouteTransition:u}=st(),{config:{routes:{admin:d,api:f},serverURL:m},getEntityConfig:h}=H(),p=h({collectionSlug:e}),[g,b]=cR.useState(!1),{i18n:v,t:x}=k(),y=`duplicate-${t}`,C=uR(async()=>{b(!0),await Qe.post(`${m}${f}/${e}/${t}/duplicate${l?.code?`?locale=${l.code}`:""}`,{body:JSON.stringify({}),headers:{"Accept-Language":v.language,"Content-Type":"application/json",credentials:"include"}}).then(async w=>{let{doc:D,errors:_,message:A}=await w.json();if(w.status<400){if(fe.success(A||x("general:successfullyDuplicated",{label:lR(r,v)})),c(!1),n)return u(()=>s.push(e8({adminRoute:d,path:`/collections/${e}/${D.id}${l?.code?`?locale=${l.code}`:""}`})));typeof o=="function"&&o({collectionConfig:p,doc:D})}else fe.error(_?.[0].message||A||x("error:unspecific",{label:lR(r,v)}))})},[l,m,f,e,t,v,x,r,o,n,c,s,d,p,u]),S=uR(async()=>{b(!1),await C()},[C]);return Q7(cR.Fragment,{children:[aR(Me.Button,{id:"action-duplicate",onClick:()=>i?(b(!0),a(y)):C(),children:x("general:duplicate")}),g&&aR(It,{body:x("general:unsavedChangesDuplicate"),confirmLabel:x("general:duplicateWithoutSaving"),heading:x("general:unsavedChanges"),modalSlug:y,onConfirm:S})]})};import{c as o8}from"react/compiler-runtime";import{jsx as pR,jsxs as r8}from"react/jsx-runtime";import{useState as n8}from"react";import{jsx as mR,jsxs as t8}from"react/jsx-runtime";import"react";var fR=({className:t})=>t8("svg",{className:["icon icon--lock",t].filter(Boolean).join(" "),fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[mR("path",{className:"stroke",d:"M7.5 9.5V7.5C7.5 6.83696 7.76339 6.20107 8.23223 5.73223C8.70107 5.26339 9.33696 5 10 5C10.663 5 11.2989 5.26339 11.7678 5.73223C12.2366 6.20107 12.5 6.83696 12.5 7.5V9.5",strokeLinecap:"round",strokeLinejoin:"round",strokeOpacity:"1"}),mR("path",{className:"stroke",d:"M13.5 9.5H6.5C5.94772 9.5 5.5 9.94772 5.5 10.5V14C5.5 14.5523 5.94772 15 6.5 15H13.5C14.0523 15 14.5 14.5523 14.5 14V10.5C14.5 9.94772 14.0523 9.5 13.5 9.5Z",stopOpacity:"1",strokeLinecap:"round",strokeLinejoin:"round"})]});var hR="locked",lu=t=>{let e=o8(8),{className:o,user:n}=t,[r,s]=n8(!1),{t:i}=k(),a=uf(n)?n.email??n.id:i("general:anotherUser"),l;e[0]!==o?(l=[hR,o].filter(Boolean),e[0]=o,e[1]=l):l=e[1];let c=l.join(" "),u,d;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=()=>s(!0),d=()=>s(!1),e[2]=u,e[3]=d):(u=e[2],d=e[3]);let f=`${a} ${i("general:isEditing")}`,m;return e[4]!==r||e[5]!==c||e[6]!==f?(m=r8("div",{className:c,onMouseEnter:u,onMouseLeave:d,role:"button",tabIndex:0,children:[pR(go,{alignCaret:"left",className:`${hR}__tooltip`,position:"top",show:r,children:f}),pR(fR,{})]}),e[4]=r,e[5]=c,e[6]=f,e[7]=m):m=e[7],m};import{c as a8}from"react/compiler-runtime";import{jsx as l8}from"react/jsx-runtime";import"react";import*as bR from"qs-esm";import{useCallback as s8,useRef as i8,useState as gR}from"react";var vR=()=>{let{id:t,collectionSlug:e,globalSlug:o,versionCount:n}=Pe(),[r,s]=gR(!1),[i,a]=gR(""),{code:l}=Ne(),c=n>0,{config:{routes:{api:u},serverURL:d}}=H(),{t:f}=k(),m=i8(!1);return{generatePreviewURL:s8(async({openPreviewWindow:p=!1})=>{if(!m.current){m.current=!0;try{s(!0);let g=`${d}${u}`;e&&(g=`${g}/${e}/${t}/preview`),o&&(g=`${g}/globals/${o}/preview`);let v=await fetch(`${g}?${bR.stringify({draft:c?"true":"false",locale:l||void 0})}`);if(!v.ok)throw new Error;let x=await v.json();if(!x)throw new Error;a(x),s(!1),m.current=!1,p&&window.open(x,"_blank")}catch{s(!1),m.current=!1,fe.error(f("error:previewing"))}}},[d,u,e,o,c,l,t,f]),isLoading:r,label:f(r?"general:loading":"version:preview"),previewURL:i}};var c8="preview-btn";function a1(t){let e=a8(5),{generatePreviewURL:o,label:n}=vR(),r;e[0]!==o?(r=()=>o({openPreviewWindow:!0}),e[0]=o,e[1]=r):r=e[1];let s;return e[2]!==n||e[3]!==r?(s=l8(ne,{buttonStyle:"secondary",className:c8,icon:"link",iconPosition:"left",onClick:r,size:"medium",children:n}),e[2]=n,e[3]=r,e[4]=s):s=e[4],s}import{jsx as Ba,jsxs as RR}from"react/jsx-runtime";import*as _R from"qs-esm";import c1,{useCallback as u1}from"react";import{jsx as xR}from"react/jsx-runtime";import"react";var u8="form-submit",Yr=t=>{let{type:e="submit",buttonId:o,children:n,disabled:r,onClick:s,programmaticSubmit:i,ref:a}=t,l=lr(),c=rp(),u=Ts(),{disabled:d,submit:f}=Oe();return xR("div",{className:u8,children:xR(ne,{ref:a,...t,disabled:!(r||u||l||c||d)?void 0:!0,id:o,onClick:s??(i?()=>{f()}:void 0),type:e,children:n})})};import{jsx as Gt,jsxs as _i}from"react/jsx-runtime";import{getTranslation as p8}from"@payloadcms/translations";import*as SR from"qs-esm";import No,{useCallback as h8,useMemo as g8}from"react";import{jsx as Ss,jsxs as d8}from"react/jsx-runtime";import"react";var yR="table",l1=({appearance:t,columns:e,data:o})=>{let n=e?.filter(r=>r?.active);return!n||n.length===0?Ss("div",{children:"No columns selected"}):Ss("div",{className:[yR,t&&`${yR}--appearance-${t}`].filter(Boolean).join(" "),children:d8("table",{cellPadding:"0",cellSpacing:"0",children:[Ss("thead",{children:Ss("tr",{children:n.map((r,s)=>Ss("th",{id:`heading-${r.accessor}`,children:r.Heading},s))})}),Ss("tbody",{children:o&&o.map((r,s)=>Ss("tr",{className:`row-${s+1}`,children:n.map((i,a)=>{let{accessor:l}=i;return Ss("td",{className:`cell-${l}`,children:i.renderedCells[s]},a)})},typeof r.id=="string"||typeof r.id=="number"?String(r.id):s))})]})})};import{jsx as an,jsxs as m8}from"react/jsx-runtime";import{getTranslation as f8}from"@payloadcms/translations";import"react";var CR=({dateFormat:t,deleteHandler:e,docs:o,i18n:n,localization:r,supportedTimezones:s,t:i})=>{let a=[{accessor:"input.type",active:!0,field:{name:"",type:"text"},Heading:an("span",{children:i("version:type")}),renderedCells:o.map(l=>{let c=l.input?.type;return m8(vt,{pillStyle:c==="publish"?"success":"warning",children:[c==="publish"&&i("version:publish"),c==="unpublish"&&i("version:unpublish")]},l.id)})},{accessor:"waitUntil",active:!0,field:{name:"",type:"date"},Heading:an("span",{children:i("general:time")}),renderedCells:o.map(l=>an("span",{children:xn({date:l.waitUntil,i18n:n,pattern:t,timezone:l.input.timezone})},l.id))},{accessor:"input.timezone",active:!0,field:{name:"",type:"text"},Heading:an("span",{children:i("general:timezone")}),renderedCells:o.map(l=>{let u=s.find(d=>d.value===l.input.timezone)?.label||l.input.timezone;return an("span",{children:u||i("general:noValue")},l.id)})}];return r&&a.push({accessor:"input.locale",active:!0,field:{name:"",type:"text"},Heading:an("span",{children:i("general:locale")}),renderedCells:o.map(l=>{if(l.input.locale){let c=r.locales.find(u=>u.code===l.input.locale);if(c)return an("span",{children:f8(c.label,n)},l.id)}return an("span",{children:i("general:all")},l.id)})}),a.push({accessor:"delete",active:!0,field:{name:"delete",type:"text"},Heading:an("span",{children:i("general:delete")}),renderedCells:o.map(l=>an(ne,{buttonStyle:"icon-label",className:"schedule-publish__delete",icon:"x",onClick:c=>{c.preventDefault(),e(l.id)},tooltip:i("general:delete")},l.id))}),a};var Ma="schedule-publish",wR={label:"All",value:"all"},IR=({slug:t,defaultType:e,schedulePublishConfig:o})=>{let{toggleModal:n}=de(),{config:{admin:{dateFormat:r,timezones:{defaultTimezone:s,supportedTimezones:i}},localization:a,routes:{api:l},serverURL:c}}=H(),{id:u,collectionSlug:d,globalSlug:f,title:m}=Pe(),{i18n:h,t:p}=k(),{schedulePublish:g}=Dt(),[b,v]=No.useState(e||"publish"),[x,y]=No.useState(),[C,S]=No.useState(s),[w,D]=No.useState(wR),[_,A]=No.useState(!1),F=p("general:schedulePublishFor",{title:m}),[R,I]=No.useState(),[E,T]=No.useState(),$=No.useRef(()=>null),j=Intl.DateTimeFormat().resolvedOptions().timeZone,N=No.useMemo(()=>{if(a){let B=a.locales.map(({code:G,label:X})=>({label:p8(X,h),value:G}));return B.unshift(wR),B}return[]},[a,h]),P=No.useCallback(async()=>{let B={sort:"waitUntil",where:{and:[{taskSlug:{equals:"schedulePublish"}},{waitUntil:{greater_than:new Date}}]}};d&&(B.where.and.push({"input.doc.value":{equals:String(u)}}),B.where.and.push({"input.doc.relationTo":{equals:d}})),f&&B.where.and.push({"input.global":{equals:f}});let{docs:G}=await Qe.post(`${c}${l}/payload-jobs`,{body:SR.stringify(B),headers:{"Accept-Language":h.language,"Content-Type":"application/x-www-form-urlencoded","X-HTTP-Method-Override":"GET"}}).then(X=>X.json());T(CR({dateFormat:r,deleteHandler:$.current,docs:G,i18n:h,localization:a,supportedTimezones:i,t:p})),I(G)},[d,f,c,l,h,r,a,i,p,u]),L=No.useCallback(async B=>{try{await g({deleteID:B}),await P(),fe.success(p("general:deletedSuccessfully"))}catch(G){console.error(G),fe.error(G.message)}},[P,g,p]);No.useEffect(()=>{$.current=L},[L]);let V=No.useCallback(async()=>{if(!x)return fe.error(p("general:noDateSelected"));A(!0);let B;typeof w=="object"&&w.value!=="all"&&b==="publish"&&(B=w.value);try{await g({type:b,date:x,doc:d?{relationTo:d,value:String(u)}:void 0,global:f||void 0,locale:B,timezone:C}),y(void 0),fe.success(p("version:scheduledSuccessfully")),P()}catch(G){console.error(G),fe.error(G.message)}A(!1)},[x,w,b,p,g,d,u,f,C,P]),M=g8(()=>{if(C&&j&&x){let B=Mt.tz(C),G=Mt.tz(j),X=new Mt(x).withTimeZone(C),Z=Ar(X,B);return Ar(Z,G).toISOString()}return x},[C,x,j]),O=h8(B=>{if(C&&B){let G=Mt.tz(C),X=new Mt(B),Z=Ar(X,G);y(Z||null)}else y(B||null)},[y,C]);return No.useEffect(()=>{R||(async()=>await P())()},[R,P]),_i(Pt,{className:Ma,gutter:!1,Header:_i("div",{className:`${Ma}__drawer-header`,children:[Gt("h2",{title:F,children:F}),Gt(jm,{onClick:()=>n(t)})]}),slug:t,children:[_i(Bo,{className:`${Ma}__scheduler`,children:[Gt(xe,{label:p("version:type"),required:!0}),_i("ul",{className:`${Ma}__type`,children:[Gt("li",{children:Gt(bc,{id:`${t}-type`,isSelected:b==="publish",onChange:()=>v("publish"),option:{label:p("version:publish"),value:"publish"},path:`${t}-type`,readOnly:_})}),Gt("li",{children:Gt(bc,{id:`${t}-type`,isSelected:b==="unpublish",onChange:()=>v("unpublish"),option:{label:p("version:unpublish"),value:"unpublish"},path:`${t}-type`,readOnly:_})})]}),Gt("br",{}),Gt(xe,{label:p("general:time"),path:"time",required:!0}),Gt(Qi,{id:"time",minDate:new Date,onChange:B=>O(B),pickerAppearance:"dayAndTime",readOnly:_,timeFormat:o?.timeFormat,timeIntervals:o?.timeIntervals??5,value:M}),i.length>0&&Gt(Kl,{id:"timezone-picker",onChange:S,options:i,selectedTimezone:C}),Gt("br",{}),N.length>0&&b==="publish"&&_i(No.Fragment,{children:[Gt(xe,{label:p("localization:localeToPublish")}),Gt(mt,{onChange:B=>D(B),options:N,value:w}),Gt("br",{})]}),_i("div",{className:`${Ma}__actions`,children:[Gt(ne,{buttonStyle:"primary",disabled:_,id:"scheduled-publish-save",onClick:V,type:"button",children:p("general:save")}),_?Gt("span",{children:p("general:saving")}):null]})]}),_i(Bo,{className:`${Ma}__upcoming`,children:[Gt("h4",{children:p("general:upcomingEvents")}),!R&&Gt(St,{}),R?.length===0&&Gt(Rr,{type:"info",children:p("general:noUpcomingEventsScheduled")}),R?.length>0&&Gt(l1,{appearance:"condensed",columns:E,data:R})]})]})};function d1({label:t}){let{id:e,collectionSlug:o,docConfig:n,globalSlug:r,hasPublishedDoc:s,hasPublishPermission:i,setHasPublishedDoc:a,setMostRecentVersionIsAutosaved:l,setUnpublishedVersionCount:c,unpublishedVersionCount:u,uploadStatus:d}=Pe(),{config:f,getEntityConfig:m}=H(),{submit:h}=Oe(),p=Ut(),g=ct(),{code:b}=Ne(),{isModalOpen:v,toggleModal:x}=de(),y=`schedule-publish-${e}`,{localization:C,routes:{api:S},serverURL:w}=f,{t:D}=k(),_=t||D("version:publishChanges"),A=c1.useMemo(()=>{if(o)return m({collectionSlug:o});if(r)return m({globalSlug:r})},[o,r,m]),F=u>0,R=typeof A?.versions?.drafts=="object"&&A?.versions?.drafts.schedulePublish,I=i&&(p||F||!s)&&d!=="uploading",E=!!R,T=!!(typeof A?.versions?.drafts=="object"&&A?.versions?.drafts.autosave),$=!!(E&&i&&(r||o&&e)&&(T||!p)),N=Qo()==="update"&&!p,P=u1(async()=>{if(N)return;let U=`?locale=${b}&depth=0&fallback-locale=null&draft=true`,z,ce="POST";o&&(z=`${w}${S}/${o}${e?`/${e}`:""}${U}`,e&&(ce="PATCH")),r&&(z=`${w}${S}/globals/${r}${U}`),await h({action:z,method:ce,overrides:{_status:"draft"},skipValidation:!0})},[h,o,r,w,S,b,e,N]);yi({cmdCtrlKey:!0,editDepth:g,keyCodes:["s"]},U=>{U.preventDefault(),U.stopPropagation(),P&&n.versions?.drafts&&n.versions?.drafts?.autosave&&P()});let L=u1(()=>{d!=="uploading"&&(h({overrides:{_status:"published"}}),c(0),l(!1),a(!0))},[a,h,c,d,l]),V=u1(U=>{if(d==="uploading")return;let z=_R.stringify({publishSpecificLocale:U}),ce=`${w}${S}${r?`/globals/${r}`:`/${o}/${e?`${"/"+e}`:""}`}${z?"?"+z:""}`;h({action:ce,overrides:{_status:"published"}}),a(!0)},[S,o,r,e,w,a,h,d]),M=!C||C&&C.defaultLocalePublishOption!=="active",O=C&&C?.locales.find(U=>typeof U=="string"?U===b:U.code===b),B=O&&(typeof O.label=="string"?O.label:O.label?.[b]??void 0),G=M?L:()=>V(O.code),X=M?_:D("version:publishIn",{locale:B}),Z=M?()=>V(O.code):L,te=M?D("version:publishIn",{locale:B}):D("version:publishAllLocales");return i?RR(c1.Fragment,{children:[Ba(Yr,{buttonId:"action-save",disabled:!I,enableSubMenu:$,onClick:G,size:"medium",SubMenuPopupContent:C||$?({close:U})=>RR(c1.Fragment,{children:[$&&Ba(Me.ButtonGroup,{children:Ba(Me.Button,{id:"schedule-publish",onClick:()=>[x(y),U()],children:D("version:schedulePublish")})},"schedule-publish"),C&&I&&Ba(Me.ButtonGroup,{children:Ba(Me.Button,{id:"publish-locale",onClick:Z,children:te})})]}):void 0,type:"button",children:C?X:_}),$&&v(y)&&Ba(IR,{defaultType:F?"publish":"unpublish",schedulePublishConfig:typeof R=="object"&&R,slug:y})]}):null}import{jsx as b8}from"react/jsx-runtime";import{useRef as v8}from"react";function m1({label:t}){let{uploadStatus:e}=Pe(),{t:o}=k(),{submit:n}=Oe(),r=Ut(),s=t||o("general:save"),i=v8(null),a=ct(),c=Qo()==="update"&&!r||e==="uploading";return yi({cmdCtrlKey:!0,editDepth:a,keyCodes:["s"]},d=>{d.preventDefault(),d.stopPropagation(),i?.current&&i.current.click()}),b8(Yr,{buttonId:"action-save",disabled:c,onClick:()=>{if(e!=="uploading")return void n()},ref:i,size:"medium",type:"button",children:s})}import{jsx as x8}from"react/jsx-runtime";import{useCallback as y8,useRef as C8}from"react";var w8="save-draft";function f1(t){let{config:{routes:{api:e},serverURL:o}}=H(),{id:n,collectionSlug:r,globalSlug:s,setUnpublishedVersionCount:i,uploadStatus:a}=Pe(),l=Ut(),{code:c}=Ne(),u=C8(null),d=ct(),{t:f}=k(),{submit:m}=Oe(),p=Qo()==="update"&&!l||a==="uploading",g=y8(async()=>{if(p)return;let b=`?locale=${c}&depth=0&fallback-locale=null&draft=true`,v,x="POST";r&&(v=`${o}${e}/${r}${n?`/${n}`:""}${b}`,n&&(x="PATCH")),s&&(v=`${o}${e}/globals/${s}${b}`),await m({action:v,method:x,overrides:{_status:"draft"},skipValidation:!0}),i(y=>y+1)},[m,r,s,o,e,c,n,p,i]);return yi({cmdCtrlKey:!0,editDepth:d,keyCodes:["s"]},b=>{b.preventDefault(),b.stopPropagation(),u?.current&&u.current.click()}),x8(Yr,{buttonId:"action-save-draft",buttonStyle:"secondary",className:w8,disabled:p,onClick:()=>void g(),ref:u,size:"medium",type:"button",children:f("version:saveDraft")})}import{jsx as Va,jsxs as wf}from"react/jsx-runtime";import DR,{useCallback as S8}from"react";var Ga="status",FR=()=>{let{id:t,collectionSlug:e,docPermissions:o,globalSlug:n,hasPublishedDoc:r,incrementVersionCount:s,setHasPublishedDoc:i,setMostRecentVersionIsAutosaved:a,setUnpublishedVersionCount:l,unpublishedVersionCount:c}=Pe(),{toggleModal:u}=de(),{config:{routes:{api:d},serverURL:f}}=H(),{reset:m}=Oe(),{code:h}=Ne(),{i18n:p,t:g}=k(),b=`confirm-un-publish-${t}`,v=`confirm-revert-${t}`,x;c>0&&r?x="changed":r?r&&c<=0&&(x="published"):x="draft";let y=S8(async S=>{let w,D,_;S==="unpublish"&&(_={_status:"draft"}),e&&(w=`${f}${d}/${e}/${t}?locale=${h}&fallback-locale=null&depth=0`,D="patch"),n&&(w=`${f}${d}/globals/${n}?locale=${h}&fallback-locale=null&depth=0`,D="post"),S==="revert"&&(_=await Qe.get(w,{headers:{"Accept-Language":p.language,"Content-Type":"application/json"}}).then(R=>R.json()));let A=await Qe[D](w,{body:JSON.stringify(_),headers:{"Accept-Language":p.language,"Content-Type":"application/json"}});if(A.status===200){let F,R=await A.json();n?F=R.result:e&&(F=R.doc),m(F),fe.success(R.message),s(),a(!1),S==="unpublish"?i(!1):S==="revert"&&l(0)}else fe.error(g("error:unPublishingDocument"))},[d,e,n,t,p.language,s,h,m,f,l,a,g,i]),C=o?.update;return x?Va("div",{className:Ga,title:`${g("version:status")}: ${g(`version:${x}`)}`,children:wf("div",{className:`${Ga}__value-wrap`,children:[wf("span",{className:`${Ga}__label`,children:[g("version:status"),":\xA0"]}),Va("span",{className:`${Ga}__value`,children:g(`version:${x}`)}),C&&x==="published"&&wf(DR.Fragment,{children:["\xA0\u2014\xA0",Va(ne,{buttonStyle:"none",className:`${Ga}__action`,onClick:()=>u(b),children:g("version:unpublish")}),Va(It,{body:g("version:aboutToUnpublish"),confirmingLabel:g("version:unpublishing"),heading:g("version:confirmUnpublish"),modalSlug:b,onConfirm:()=>y("unpublish")})]}),C&&x==="changed"&&wf(DR.Fragment,{children:["\xA0\u2014\xA0",Va(ne,{buttonStyle:"none",className:`${Ga}__action`,id:"action-revert-to-published",onClick:()=>u(v),children:g("version:revertToPublished")}),Va(It,{body:g("version:aboutToRevertToPublished"),confirmingLabel:g("version:reverting"),heading:g("version:confirmRevertToSaved"),modalSlug:v,onConfirm:()=>y("revert")})]})]})}):null};var At="doc-controls",h1=t=>{let e=I8(15),{id:o,slug:n,BeforeDocumentControls:r,customComponents:s,data:i,disableActions:a,disableCreate:l,hasSavePermission:c,isAccountView:u,isEditing:d,onDelete:f,onDrawerCreateNew:m,onDuplicate:h,onTakeOver:p,permissions:g,readOnlyForIncomingUser:b,redirectAfterDelete:v,redirectAfterDuplicate:x,user:y}=t,C;e[0]!==s?(C=s===void 0?{}:s,e[0]=s,e[1]=C):C=e[1];let{PreviewButton:S,PublishButton:w,SaveButton:D,SaveDraftButton:_}=C,{i18n:A,t:F}=k(),R=ct(),{config:I,getEntityConfig:E}=H(),T=E({collectionSlug:n}),$=E({globalSlug:n}),{admin:j,localization:N,routes:P}=I,{dateFormat:L}=j,{admin:V}=P,[M,O]=p1.useState(""),[B,G]=p1.useState(""),X=lr(),Z=Ts(),te,U;e[2]!==i||e[3]!==L||e[4]!==A?(te=()=>{i?.updatedAt&&O(xn({date:i.updatedAt,i18n:A,pattern:L})),i?.createdAt&&G(xn({date:i.createdAt,i18n:A,pattern:L}))},U=[i,A,L],e[2]=i,e[3]=L,e[4]=A,e[5]=te,e[6]=U):(te=e[5],U=e[6]),D8(te,U);let z=g&&"create"in g&&g.create,ce=g&&"delete"in g&&g.delete,J=!!(T&&o&&!a&&(z||ce)),ue=!o&&T?.versions?.drafts&&T.versions?.drafts.validate,re=T?.versions?.drafts,q=$?.versions?.drafts,pe=re&&re?.autosave||q&&q?.autosave,he=re&&re?.autosave,_e=q&&q?.autosave,ge=he&&re.autosave!==!1&&re.autosave.showSaveDraftButton===!0||_e&&q.autosave!==!1&&q.autosave.showSaveDraftButton===!0,Ve=N&&!T?.admin?.disableCopyToLocale,Q;e[7]!==b||e[8]!==y?(Q=y&&b&&at(lu,{className:`${At}__locked-controls`,user:y}),e[7]=b,e[8]=y,e[9]=Q):Q=e[9];let Le;return e[10]!==p||e[11]!==b||e[12]!==F||e[13]!==y?(Le=y&&b&&at(ne,{buttonStyle:"secondary",id:"take-over",onClick:p,size:"medium",type:"button",children:F("general:takeOver")}),e[10]=p,e[11]=b,e[12]=F,e[13]=y,e[14]=Le):Le=e[14],Lo(Bo,{className:At,children:[Lo("div",{className:`${At}__wrapper`,children:[at("div",{className:`${At}__content`,children:Lo("ul",{className:`${At}__meta`,children:[T&&!d&&!u&&at("li",{className:`${At}__list-item`,children:at("p",{className:`${At}__value`,children:A.t("general:creatingNewLabel",{label:R8(T?.labels?.singular??A.t("general:document"),A)})})}),Q,(T?.versions?.drafts||$?.versions?.drafts)&&Lo(cu,{children:[($||T&&d)&&at("li",{className:[`${At}__status`,`${At}__list-item`].filter(Boolean).join(" "),children:at(FR,{})}),c&&pe&&!ue&&at("li",{className:`${At}__list-item`,children:at(rR,{collection:T,global:$,id:o,publishedDocUpdatedAt:i?.createdAt})})]}),T?.timestamps&&(d||u)&&Lo(cu,{children:[Lo("li",{className:[`${At}__list-item`,`${At}__value-wrap`].filter(Boolean).join(" "),title:i?.updatedAt?M:"",children:[Lo("p",{className:`${At}__label`,children:[A.t("general:lastModified"),":\xA0"]}),i?.updatedAt&&at("p",{className:`${At}__value`,children:M})]}),Lo("li",{className:[`${At}__list-item`,`${At}__value-wrap`].filter(Boolean).join(" "),title:i?.createdAt?B:"",children:[Lo("p",{className:`${At}__label`,children:[A.t("general:created"),":\xA0"]}),i?.createdAt&&at("p",{className:`${At}__value`,children:B})]})]})]})}),Lo("div",{className:`${At}__controls-wrapper`,children:[Lo("div",{className:`${At}__controls`,children:[r,(T?.admin.preview||$?.admin.preview)&&at(oe,{CustomComponent:S,Fallback:at(a1,{})}),c&&at(cu,{children:T?.versions?.drafts||$?.versions?.drafts?Lo(cu,{children:[(ue||!pe||pe&&ge)&&at(oe,{CustomComponent:_,Fallback:at(f1,{})}),at(oe,{CustomComponent:w,Fallback:at(d1,{})})]}):at(oe,{CustomComponent:D,Fallback:at(m1,{})})}),Le]}),J&&!b&&at(ho,{button:Lo("div",{className:`${At}__dots`,children:[at("div",{}),at("div",{}),at("div",{})]}),className:`${At}__popup`,disabled:Z||X,horizontalAlign:"right",size:"large",verticalAlign:"bottom",children:Lo(Me.ButtonGroup,{children:[Ve&&at(t1,{}),z&&Lo(p1.Fragment,{children:[!l&&at(cu,{children:R>1?at(Me.Button,{id:"action-create",onClick:m,children:A.t("general:createNew")}):at(Me.Button,{href:_8({adminRoute:V,path:`/collections/${T?.slug}/create`}),id:"action-create",children:A.t("general:createNew")})}),T.disableDuplicate!==!0&&d&&at(dR,{id:o.toString(),onDuplicate:h,redirectAfterDuplicate:x,singularLabel:T?.labels?.singular,slug:T?.slug})]}),ce&&at(iR,{buttonId:"action-delete",collectionSlug:T?.slug,id:o.toString(),onDelete:f,redirectAfterDelete:v,singularLabel:T?.labels?.singular,useAsTitle:T?.admin?.useAsTitle})]})})]})]}),at("div",{className:`${At}__divider`})]})};import{c as j8}from"react/compiler-runtime";import{jsx as If,jsxs as O8}from"react/jsx-runtime";import{useState as M8}from"react";import{c as g1}from"react/compiler-runtime";import{jsx as mo,jsxs as Sf}from"react/jsx-runtime";import{getTranslation as F8}from"@payloadcms/translations";import{useRouter as A8,useSearchParams as T8}from"next/navigation.js";import{mergeListSearchAndWhere as E8,unflatten as AR}from"payload/shared";import*as NR from"qs-esm";import TR,{useCallback as ER,useEffect as P8,useMemo as PR,useState as N8}from"react";var L8=t=>{let e=g1(7),{action:o,disabled:n}=t,{submit:r}=Oe(),{t:s}=k(),i;e[0]!==o||e[1]!==r?(i=()=>{r({action:o,method:"PATCH",skipValidation:!0})},e[0]=o,e[1]=r,e[2]=i):i=e[2];let a=i,l;return e[3]!==n||e[4]!==a||e[5]!==s?(l=mo(Yr,{className:`${$o}__save`,disabled:n,onClick:a,children:s("general:save")}),e[3]=n,e[4]=a,e[5]=s,e[6]=l):l=e[6],l},$8=t=>{let e=g1(7),{action:o,disabled:n}=t,{submit:r}=Oe(),{t:s}=k(),i;e[0]!==o||e[1]!==r?(i=()=>{r({action:o,method:"PATCH",overrides:{_status:"published"},skipValidation:!0})},e[0]=o,e[1]=r,e[2]=i):i=e[2];let a=i,l;return e[3]!==n||e[4]!==a||e[5]!==s?(l=mo(Yr,{className:`${$o}__publish`,disabled:n,onClick:a,children:s("version:publishChanges")}),e[3]=n,e[4]=a,e[5]=s,e[6]=l):l=e[6],l},k8=t=>{let e=g1(7),{action:o,disabled:n}=t,{submit:r}=Oe(),{t:s}=k(),i;e[0]!==o||e[1]!==r?(i=()=>{r({action:o,method:"PATCH",overrides:{_status:"draft"},skipValidation:!0})},e[0]=o,e[1]=r,e[2]=i):i=e[2];let a=i,l;return e[3]!==n||e[4]!==a||e[5]!==s?(l=mo(Yr,{buttonStyle:"secondary",className:`${$o}__draft`,disabled:n,onClick:a,children:s("version:saveDraft")}),e[3]=n,e[4]=a,e[5]=s,e[6]=l):l=e[6],l},LR=t=>{let{collection:{fields:e,labels:{plural:o,singular:n}}={},collection:r,drawerSlug:s,selectedFields:i,setSelectedFields:a}=t,{permissions:l,user:c}=Ae(),{closeModal:u}=de(),{config:{routes:{api:d},serverURL:f}}=H(),{getFormState:m}=Dt(),{count:h,getQueryParams:p,selectAll:g}=oo(),{i18n:b,t:v}=k(),[x,y]=N8(!1),C=A8(),S=TR.useRef(null),{clearRouteCache:w}=On(),D=l?.collections?.[r.slug],_=T8(),A=PR(()=>AR(i.reduce((T,$)=>(T[$.value.path]=!0,T),{})),[i]),F=ER(async({formState:T,submitted:$})=>{let j=or(S),{state:N}=await m({collectionSlug:r.slug,docPermissions:D,docPreferences:null,formState:T,operation:"update",schemaPath:r.slug,select:A,signal:j.signal,skipValidation:!$});return S.current=null,N},[m,r,D,A]);P8(()=>{let T=S.current;return()=>{tr(T)}},[]);let R=PR(()=>{let T=E8({collectionConfig:r,search:_.get("search")});return p(T)},[r,_,p]),I=()=>{C.replace(NR.stringify({...jr(_),page:g===xo.AllAvailable?"1":void 0},{addQueryPrefix:!0})),w(),u(s)},E=ER(async({dispatchFields:T,formState:$,selected:j})=>{y(!0),a(j||[]);let{state:N}=await m({collectionSlug:r.slug,docPermissions:D,docPreferences:null,formState:$,operation:"update",schemaPath:r.slug,select:AR(j.reduce((P,L)=>(P[L.value.path]=!0,P),{})),skipValidation:!0});T({type:"UPDATE_MANY",formState:N}),y(!1)},[m,r.slug,D,a]);return mo(Sl,{collectionSlug:r.slug,currentEditor:c,hasPublishedDoc:!1,id:null,initialData:{},isLocked:!1,lastUpdateTime:0,mostRecentVersionIsAutosaved:!1,unpublishedVersionCount:0,versionCount:0,children:mo(vd,{value:"update",children:Sf("div",{className:`${$o}__main`,children:[Sf("div",{className:`${$o}__header`,children:[mo("h2",{className:`${$o}__header__title`,children:v("general:editingLabel",{count:h,label:F8(h>1?o:n,b)})}),mo("button",{"aria-label":v("general:close"),className:`${$o}__header__close`,id:`close-drawer__${s}`,onClick:()=>u(s),type:"button",children:mo(pt,{})})]}),Sf(An,{className:`${$o}__form`,isInitializing:x,onChange:[F],onSuccess:I,children:[mo(Hm,{fields:e,onChange:E,permissions:D.fields}),i.length===0?null:mo("div",{className:"render-fields",children:i.map((T,$)=>{let{value:{field:j,fieldPermissions:N,path:P}}=T;return mo(Aa,{clientFieldConfig:j,indexPath:"",parentPath:"",parentSchemaPath:"",path:P,permissions:N},`${P}-${$}`)})}),mo("div",{className:`${$o}__sidebar-wrap`,children:mo("div",{className:`${$o}__sidebar`,children:mo("div",{className:`${$o}__sidebar-sticky-wrap`,children:mo("div",{className:`${$o}__document-actions`,children:r?.versions?.drafts?Sf(TR.Fragment,{children:[mo(k8,{action:`${f}${d}/${r.slug}${R}&draft=true`,disabled:i.length===0}),mo($8,{action:`${f}${d}/${r.slug}${R}&draft=true`,disabled:i.length===0})]}):mo(L8,{action:`${f}${d}/${r.slug}${R}`,disabled:i.length===0})})})})})]})]})})})};var $o="edit-many",b1=t=>{let e=j8(10),{collection:o}=t,{slug:n}=o,{permissions:r}=Ae(),{openModal:s}=de(),{selectAll:i}=oo(),{t:a}=k(),l;e[0]===Symbol.for("react.memo_cache_sentinel")?(l=[],e[0]=l):l=e[0];let[c,u]=M8(l),d=r?.collections?.[n],f=`edit-${n}`;if(i===xo.None||!d?.update)return null;let m;if(e[1]!==f||e[2]!==s||e[3]!==t.collection||e[4]!==c||e[5]!==a){let h;e[7]!==f||e[8]!==s?(h=()=>{s(f),u([])},e[7]=f,e[8]=s,e[9]=h):h=e[9],m=O8("div",{className:$o,children:[If("button",{"aria-label":a("general:edit"),className:`${$o}__toggle`,onClick:h,type:"button",children:a("general:edit")}),If(Ns,{children:If(Pt,{Header:null,slug:f,children:If(LR,{collection:t.collection,drawerSlug:f,selectedFields:c,setSelectedFields:u})})})]}),e[1]=f,e[2]=s,e[3]=t.collection,e[4]=c,e[5]=a,e[6]=m}else m=e[6];return m};import{c as B8}from"react/compiler-runtime";import{jsx as V8}from"react/jsx-runtime";import"react";function G8(t){let e=B8(6),o=ct(),n;e[0]!==t.style?(n=t.style||{},e[0]=t.style,e[1]=n):n=e[1];let r=`calc(100 + ${o||0} + 1)`,s;return e[2]!==t||e[3]!==n||e[4]!==r?(s=V8(Yo,{...t,style:{...n,zIndex:r}}),e[2]=t,e[3]=n,e[4]=r,e[5]=s):s=e[5],s}import{c as W8}from"react/compiler-runtime";import{jsx as Rf,jsxs as H8}from"react/jsx-runtime";import z8 from"react";function v1(t){let e=W8(12),{highlightField:o,setKey:n}=t,{id:r}=Pe(),{toggleModal:s}=de(),{t:i}=k(),a=`generate-confirmation-${r}`,l;e[0]!==o||e[1]!==n||e[2]!==i?(l=()=>{n(),fe.success(i("authentication:newAPIKeyGenerated")),o(!0)},e[0]=o,e[1]=n,e[2]=i,e[3]=l):l=e[3];let c=l,u;e[4]!==a||e[5]!==s?(u=()=>{s(a)},e[4]=a,e[5]=s,e[6]=u):u=e[6];let d;return e[7]!==c||e[8]!==a||e[9]!==i||e[10]!==u?(d=H8(z8.Fragment,{children:[Rf(ne,{buttonStyle:"secondary",onClick:u,size:"small",children:i("authentication:generateNewAPIKey")}),Rf(It,{body:Rf(wi,{elements:{1:X8},i18nKey:"authentication:generatingNewAPIKeyWillInvalidate",t:i}),confirmLabel:i("authentication:generate"),heading:i("authentication:confirmGeneration"),modalSlug:a,onConfirm:c})]}),e[7]=c,e[8]=a,e[9]=i,e[10]=u,e[11]=d):d=e[11],d}function X8(t){let{children:e}=t;return Rf("strong",{children:e})}import{c as U8}from"react/compiler-runtime";import{useEffect as Y8}from"react";function Z8(t){let e=U8(4),{permissions:o}=t,{setPermissions:n}=Ae(),r,s;return e[0]!==o||e[1]!==n?(r=()=>{n(o)},s=[o,n],e[0]=o,e[1]=n,e[2]=r,e[3]=s):(r=e[2],s=e[3]),Y8(r,s),null}import{jsx as Wt,jsxs as Ef}from"react/jsx-runtime";import{getTranslation as Xa}from"@payloadcms/translations";import{validateWhereQuery as EV}from"payload/shared";import PV,{Fragment as v_,useEffect as x_,useRef as y_,useState as NV}from"react";import{jsx as x1,jsxs as J8}from"react/jsx-runtime";import"react";var y1="dots",$R=({ariaLabel:t,className:e,noBackground:o,orientation:n="vertical"})=>J8("div",{"aria-label":t,className:[e,y1,o&&`${y1}--no-background`,n&&`${y1}--${n}`].filter(Boolean).join(" "),children:[x1("div",{}),x1("div",{}),x1("div",{})]});import{jsx as kR}from"react/jsx-runtime";import{useEffect as jR,useRef as OR,useState as q8}from"react";import{usePathname as Q8}from"next/navigation.js";var MR="search-filter",C1=t=>{let{handleChange:e,initialParams:o,label:n}=t,r=Q8(),[s,i]=q8(typeof o?.search=="string"?o?.search:void 0),a=OR(!0),l=OR(typeof o?.search=="string"?o?.search:void 0),c=Jo(s,300);return jR(()=>{o?.search!==l.current&&(a.current=!1,i(o?.search),l.current=o?.search)},[o?.search,r]),jR(()=>{c!==l.current&&a.current&&(e&&e(c),l.current=c)},[c,e]),kR("div",{className:MR,children:kR("input",{"aria-label":n,className:`${MR}__input`,id:"search-filter-input",onChange:u=>{a.current=!0,i(u.target.value)},placeholder:n,type:"text",value:s||""})})};import{jsx as Vn,jsxs as fu}from"react/jsx-runtime";import{getTranslation as wV}from"@payloadcms/translations";import{transformWhereQuery as SV,validateWhereQuery as i_}from"payload/shared";import Ff,{useMemo as a_}from"react";import{jsx as Mn,jsxs as T1}from"react/jsx-runtime";import{useCallback as t_,useEffect as hV,useState as gV}from"react";import{jsx as uu}from"react/jsx-runtime";import"react";import{jsx as BR}from"react/jsx-runtime";import"react";var K8="condition-value-date",w1=({disabled:t,field:{admin:e},onChange:o,value:n})=>{let{date:r}=e||{};return BR("div",{className:K8,children:BR(Qi,{...r,onChange:o,readOnly:t,value:n})})};import{c as eV}from"react/compiler-runtime";import{jsx as VR}from"react/jsx-runtime";import GR from"react";var tV="condition-value-number",S1=t=>{let e=eV(18),{disabled:o,field:n,onChange:r,operator:s,value:i}=t,{hasMany:a}=n,{t:l}=k(),c;e[0]!==a||e[1]!==s?(c=["in","not_in"].includes(s)||a,e[0]=a,e[1]=s,e[2]=c):c=e[2];let u=c,d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=[],e[3]=d):d=e[3];let[f,m]=GR.useState(d),h;e[4]!==u||e[5]!==r?(h=x=>{let y;x?u&&(Array.isArray(x)?y=x.map(oV):y=[Number(x.value?.value||x.value)]):y=[],r(y)},e[4]=u,e[5]=r,e[6]=h):h=e[6];let p=h,g,b;e[7]!==i?(g=()=>{Array.isArray(i)?m(i.map(rV)):m([])},b=[i],e[7]=i,e[8]=g,e[9]=b):(g=e[8],b=e[9]),GR.useEffect(g,b);let v;return e[10]!==o||e[11]!==u||e[12]!==r||e[13]!==p||e[14]!==l||e[15]!==i||e[16]!==f?(v=u?VR(mt,{disabled:o,isClearable:!0,isCreatable:!0,isMulti:u,isSortable:!0,numberOnly:!0,onChange:p,options:[],placeholder:l("general:enterAValue"),value:f||[]}):VR("input",{className:tV,disabled:o,onChange:x=>r(x.target.value),placeholder:l("general:enterAValue"),type:"number",value:i}),e[10]=o,e[11]=u,e[12]=r,e[13]=p,e[14]=l,e[15]=i,e[16]=f,e[17]=v):v=e[17],v};function oV(t){return Number(t.value?.value||t.value)}function rV(t,e){return{id:`${t}${e}`,label:`${t}`,value:{toString:()=>`${t}${e}`,value:t?.value||t}}}import{jsx as XR,jsxs as sV}from"react/jsx-runtime";import*as JR from"qs-esm";import UR,{useCallback as _f,useEffect as YR,useReducer as iV,useState as I1}from"react";import{getTranslation as WR}from"@payloadcms/translations";var HR=t=>t.reduce((e,o)=>o.options?[...e,...HR(o.options)]:[...e,o.id],[]),nV=(t,e)=>{switch(e.type){case"ADD":{let{collection:o,data:n,hasMultipleRelations:r,i18n:s,relation:i}=e,a=o.admin.useAsTitle||"id",l=HR(t);if(!r)return[...t,...n.docs.reduce((f,m)=>l.indexOf(m.id)===-1?(l.push(m.id),[...f,{label:m[a],value:m.id}]):f,[])];let c=[...t],u=c.find(f=>f.label===WR(o.labels.plural,s)),d=n.docs.reduce((f,m)=>l.indexOf(m.id)===-1?(l.push(m.id),[...f,{label:m[a],relationTo:i,value:m.id}]):f,[]);return u?u.options=[...u.options,...d]:c.push({label:WR(o.labels.plural,s),options:d,value:void 0}),c}case"CLEAR":return e.required?[]:[{label:e.i18n.t("general:none"),value:"null"}];default:return t}},zR=nV;var ZR="condition-value-relationship",aV=10,R1=t=>{let{disabled:e,field:{admin:{isSortable:o}={},hasMany:n,relationTo:r},filterOptions:s,onChange:i,value:a}=t,{config:{routes:{api:l},serverURL:c},getEntityConfig:u}=H(),d=Array.isArray(r),[f,m]=iV(zR,[]),[h,p]=I1(""),g=Jo(h,300),[b,v]=I1(""),[x,y]=I1(!1),{i18n:C,t:S}=k(),w=Ne(),D=d?r:[r],_=UR.useRef(new Map(D.map(N=>[N,{hasLoadedAll:!1,nextPage:1}]))),A=_f((N,P)=>{let L=u({collectionSlug:P});m({type:"ADD",collection:L,data:N,hasMultipleRelations:d,i18n:C,relation:P})},[d,C,u]),F=eo(async({abortController:N,relationSlug:P})=>{let L=_.current.get(P);if(P&&!L.hasLoadedAll){let M=u({collectionSlug:P})?.admin?.useAsTitle||"id",O={and:[]},B={depth:0,limit:aV,locale:w.code,page:L.nextPage,select:{[M]:!0},where:O};s&&s?.[P]&&B.where.and.push(s[P]),g&&B.where.and.push({[M]:{like:g}});try{let G=await fetch(`${c}${l}/${P}${JR.stringify(B,{addQueryPrefix:!0})}`,{credentials:"include",headers:{"Accept-Language":C.language},signal:N.signal});if(G.ok){let X=await G.json();X.docs.length>0&&(A(X,P),X.nextPage?_.current.set(P,{hasLoadedAll:!1,nextPage:X.nextPage}):_.current.set(P,{hasLoadedAll:!0,nextPage:null}))}else v(S("error:unspecific"))}catch(G){N.signal.aborted||console.error(G)}}y(!0)}),R=UR.useCallback(()=>{let N=_.current.entries().next().value;if(N[0]&&!N[1].hasLoadedAll){let P=new AbortController;F({abortController:P,relationSlug:N[0]})}},[]),I=_f(()=>{if(a){if(n)return Array.isArray(a)?a.map(N=>{if(d){let P;return f.forEach(L=>{L.options&&L.options.some(V=>V?.value==N.value?(P=V,!0):!1)}),P}return f.find(P=>P.value==N)}):void 0;if(d){let N,P=a;return f.forEach(L=>{L?.options&&L.options.some(V=>V?.value==P.value?(N=V,!0):!1)}),N}return f.find(N=>N.value==a)}},[n,d,a,f]),E=_f(N=>{if(N!==h){m({type:"CLEAR",i18n:C,required:!1});let P=Array.isArray(r)?r:[r];_.current=new Map(P.map(L=>[L,{hasLoadedAll:!1,nextPage:1}])),p(N)}},[C,r,h]),T=_f(async(N,P)=>{if(!b&&N!=="null"&&N&&P){let L=await fetch(`${c}${l}/${P}/${N}?depth=0`,{credentials:"include",headers:{"Accept-Language":C.language}});if(L.ok){let V=await L.json();A({docs:[V]},P)}else console.error(S("error:loadingDocument",{id:N}))}},[C,A,l,b,c,S]);YR(()=>{let N=Array.isArray(r)?r:[r];_.current=new Map(N.map(L=>[L,{hasLoadedAll:!1,nextPage:1}])),m({type:"CLEAR",i18n:C,required:!1}),y(!1);let P=[];return N.forEach(L=>{let V=new AbortController;F({abortController:V,relationSlug:L}),P.push(V)}),()=>{P.forEach(L=>{if(L.signal)try{L.abort()}catch{}})}},[C,r,g]),YR(()=>{if(a&&x){if(n)(I()||[]).forEach((P,L)=>{P||(d?T(a[L].value,a[L].relationTo):T(a[L],r))});else if(!I())if(d){let P=a;T(P.value,P.relationTo)}else T(a,r)}},[T,I,n,d,r,a,x]);let $=["field-type",ZR,b&&"error-loading"].filter(Boolean).join(" "),j=I()||a;return sV("div",{className:$,children:[!b&&XR(mt,{disabled:e,isMulti:n,isSortable:o,onChange:N=>{if(!N){i(null);return}n&&Array.isArray(N)?i(N?N.map(P=>d?{relationTo:P?.relationTo,value:P?.value}:P?.value):null):d&&!Array.isArray(N)?i({relationTo:N?.relationTo,value:N?.value}):Array.isArray(N)||i(N?.value)},onInputChange:E,onMenuScrollToBottom:R,options:f,placeholder:S("general:selectValue"),value:j}),b&&XR("div",{className:`${ZR}__error-loading`,children:b})]})};import{c as lV}from"react/compiler-runtime";import{jsx as cV}from"react/jsx-runtime";import{getTranslation as _1}from"@payloadcms/translations";import D1 from"react";var F1=t=>{let e=lV(26),{disabled:o,isClearable:n,onChange:r,operator:s,options:i,value:a}=t,{i18n:l}=k(),c;e[0]!==i?(c=Ql(i),e[0]=i,e[1]=c):c=e[1];let[u,d]=D1.useState(c),f;e[2]===Symbol.for("react.memo_cache_sentinel")?(f=["in","not_in"],e[2]=f):f=e[2];let m=f.includes(s),h;if(m&&Array.isArray(a)){let S;e[3]!==l||e[4]!==u?(S=w=>{let D=u.find(_=>_.value===w);return{label:D?_1(D.label,l):w,value:D?.value??w}},e[3]=l,e[4]=u,e[5]=S):S=e[5],h=a.map(S)}else if(a){let S,w;if(e[6]!==l||e[7]!==u||e[8]!==a){let D;e[11]!==a?(D=_=>_.value===a,e[11]=a,e[12]=D):D=e[12],S=u.find(D),w=S?_1(S.label,l):a,e[6]=l,e[7]=u,e[8]=a,e[9]=S,e[10]=w}else S=e[9],w=e[10];h={label:w,value:S?.value??a}}let p;e[13]!==m||e[14]!==r?(p=S=>{let w;S?m?Array.isArray(S)?w=S.map(uV):w=[]:w=S.value:w=null,r(w)},e[13]=m,e[14]=r,e[15]=p):p=e[15];let g=p,b,v;e[16]!==i?(b=()=>{d(Ql(i))},v=[i],e[16]=i,e[17]=b,e[18]=v):(b=e[17],v=e[18]),D1.useEffect(b,v);let x,y;e[19]!==m||e[20]!==r||e[21]!==a?(x=()=>{!m&&Array.isArray(a)&&r(a[0])},y=[m,r,a],e[19]=m,e[20]=r,e[21]=a,e[22]=x,e[23]=y):(x=e[22],y=e[23]),D1.useEffect(x,y);let C;return e[24]!==l?(C=S=>({...S,label:_1(S.label,l)}),e[24]=l,e[25]=C):C=e[25],cV(mt,{disabled:o,isClearable:n,isMulti:m,onChange:g,options:u.map(C),value:h})};function uV(t){return t.value}import{c as dV}from"react/compiler-runtime";import{jsx as qR}from"react/jsx-runtime";import QR from"react";var mV="condition-value-text",A1=t=>{let e=dV(18),{disabled:o,field:n,onChange:r,operator:s,value:i}=t,{hasMany:a}=n,{t:l}=k(),c;e[0]!==a||e[1]!==s?(c=["in","not_in"].includes(s)||a,e[0]=a,e[1]=s,e[2]=c):c=e[2];let u=c,d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=[],e[3]=d):d=e[3];let[f,m]=QR.useState(d),h;e[4]!==u||e[5]!==r?(h=x=>{let y;x?u&&(Array.isArray(x)?y=x.map(fV):y=[x.value?.value||x.value]):y=[],r(y)},e[4]=u,e[5]=r,e[6]=h):h=e[6];let p=h,g,b;e[7]!==i?(g=()=>{Array.isArray(i)?m(i.map(pV)):m([])},b=[i],e[7]=i,e[8]=g,e[9]=b):(g=e[8],b=e[9]),QR.useEffect(g,b);let v;return e[10]!==o||e[11]!==u||e[12]!==r||e[13]!==p||e[14]!==l||e[15]!==i||e[16]!==f?(v=u?qR(mt,{disabled:o,isClearable:!0,isCreatable:!0,isMulti:u,isSortable:!0,onChange:p,options:[],placeholder:l("general:enterAValue"),value:f||[]}):qR("input",{className:mV,disabled:o,onChange:x=>r(x.target.value),placeholder:l("general:enterAValue"),type:"text",value:i||""}),e[10]=o,e[11]=u,e[12]=r,e[13]=p,e[14]=l,e[15]=i,e[16]=f,e[17]=v):v=e[17],v};function fV(t){return t.value?.value||t.value}function pV(t,e){return{id:`${t}${e}`,label:`${t}`,value:{toString:()=>`${t}${e}`,value:t?.value||t}}}var KR=({booleanSelect:t,disabled:e,filterOptions:o,internalField:n,onChange:r,operator:s,options:i,value:a})=>{if(t||["radio","select"].includes(n?.field?.type))return uu(F1,{disabled:e,field:n.field,isClearable:!t,onChange:r,operator:s,options:i,value:a});switch(n?.field?.type){case"date":return uu(w1,{disabled:e,field:n.field,onChange:r,operator:s,value:a});case"number":return uu(S1,{disabled:e,field:n.field,onChange:r,operator:s,value:a});case"relationship":return uu(R1,{disabled:e,field:n.field,filterOptions:o,onChange:r,operator:s,value:a});default:return uu(A1,{disabled:e,field:n?.field,onChange:r,operator:s,value:a})}};var e_=t=>({all:"any",contains:"string",equals:"any",exists:"boolean",greater_than:t==="date"?"object":"string",greater_than_equal:t==="date"?"object":"string",in:"any",intersects:"any",less_than:t==="date"?"object":"string",less_than_equal:t==="date"?"object":"string",like:"string",near:"any",not_equals:"any",not_in:"any",not_like:"string",within:"any"});var Bn="condition",o_=t=>{let{addCondition:e,andIndex:o,fieldName:n,filterOptions:r,operator:s,orIndex:i,reducedFields:a,removeCondition:l,RenderedFilter:c,updateCondition:u,value:d}=t,{t:f}=k(),m=a.find(w=>w.value===n),[h,p]=gV(d),g=Jo(h,300),b=["exists"].includes(s)||m?.field?.type==="checkbox",v=[];b?v=[{label:f("general:true"),value:"true"},{label:f("general:false"),value:"false"}]:m?.field&&"options"in m.field&&(v=m.field.options);let x=eo(async w=>{s&&await u({andIndex:o,field:m,operator:s,orIndex:i,value:w===null?"":w})});hV(()=>{x(g)},[g]);let y=!m?.value&&typeof m?.value!="number"||m?.field?.admin?.disableListFilter,C=t_(async w=>{p(void 0),await u({andIndex:o,field:a.find(D=>D.value===w.value),operator:s,orIndex:i,value:void 0})},[o,s,i,a,u]),S=t_(async w=>{let _=e_(m.field.type)[w.value]||"any",A=_==="any"||typeof d===_||_==="boolean"&&(d==="true"||d==="false");A||p(void 0),await u({andIndex:o,field:m,operator:w.value,orIndex:i,value:A?d:void 0})},[o,m,i,u,d]);return Mn("div",{className:Bn,children:T1("div",{className:`${Bn}__wrap`,children:[T1("div",{className:`${Bn}__inputs`,children:[Mn("div",{className:`${Bn}__field`,children:Mn(mt,{disabled:y,isClearable:!1,onChange:C,options:a.filter(w=>!w.field.admin.disableListFilter),value:m||{value:m?.value}})}),Mn("div",{className:`${Bn}__operator`,children:Mn(mt,{disabled:y,isClearable:!1,onChange:S,options:m?.operators,value:m?.operators.find(w=>s===w.value)||null})}),Mn("div",{className:`${Bn}__value`,children:c||Mn(KR,{booleanSelect:b,disabled:!s||!m||m?.field?.admin?.disableListFilter,filterOptions:r,internalField:m,onChange:p,operator:s,options:v,value:h??""})})]}),T1("div",{className:`${Bn}__actions`,children:[Mn(ne,{buttonStyle:"icon-label",className:`${Bn}__actions-remove`,icon:"x",iconStyle:"with-border",onClick:()=>l({andIndex:o,orIndex:i}),round:!0}),Mn(ne,{buttonStyle:"icon-label",className:`${Bn}__actions-add`,icon:"plus",iconStyle:"with-border",onClick:()=>e({andIndex:o+1,field:a.find(w=>!w.field.admin?.disableListFilter),orIndex:i,relation:"and"}),round:!0})]})]})})};var E1=[{label:"equals",value:"equals"},{label:"isNotEqualTo",value:"not_equals"}],nr=[...E1,{label:"isIn",value:"in"},{label:"isNotIn",value:"not_in"},{label:"exists",value:"exists"}],r_=[...nr,{label:"isGreaterThan",value:"greater_than"},{label:"isLessThan",value:"less_than"},{label:"isLessThanOrEqualTo",value:"less_than_equal"},{label:"isGreaterThanOrEqualTo",value:"greater_than_equal"}],bV=[...E1,{label:"exists",value:"exists"},{label:"near",value:"near"}],n_={label:"within",value:"within"},s_={label:"intersects",value:"intersects"},du={label:"isLike",value:"like"},mu={label:"isNotLike",value:"not_like"},Wa={label:"contains",value:"contains"},vV={checkbox:{component:"Text",operators:E1},code:{component:"Text",operators:[...nr,du,mu,Wa]},date:{component:"Date",operators:[...nr,...r_]},email:{component:"Text",operators:[...nr,Wa]},json:{component:"Text",operators:[...nr,du,Wa,mu,n_,s_]},number:{component:"Number",operators:[...nr,...r_]},point:{component:"Point",operators:[...bV,n_,s_]},radio:{component:"Select",operators:[...nr]},relationship:{component:"Relationship",operators:[...nr]},richText:{component:"Text",operators:[...nr,du,mu,Wa]},select:{component:"Select",operators:[...nr]},text:{component:"Text",operators:[...nr,du,mu,Wa]},textarea:{component:"Text",operators:[...nr,du,mu,Wa]},upload:{component:"Text",operators:[...nr]}},Di=vV;import{getTranslation as Df}from"@payloadcms/translations";import{fieldIsHiddenOrDisabled as xV,fieldIsID as yV,tabHasName as CV}from"payload/shared";var Ha=({fields:t,i18n:e,labelPrefix:o,pathPrefix:n})=>t.reduce((r,s)=>{if(xV(s)&&!yV(s))return r;if(s.type==="tabs"&&"tabs"in s)return s.tabs.forEach(a=>{if(typeof a.label!="boolean"){let l=Df(a.label,e),c=o?o+" > "+l:l,u=CV(a)&&a.name?n?n+"."+a.name:a.name:n;typeof l=="string"&&r.push(...Ha({fields:a.fields,i18n:e,labelPrefix:c,pathPrefix:u}))}}),r;if(s.type==="row"&&"fields"in s)return r.push(...Ha({fields:s.fields,i18n:e,labelPrefix:o,pathPrefix:n})),r;if(s.type==="collapsible"&&"fields"in s){let i=Df(s.label||"",e),a=o?o+" > "+i:i;return r.push(...Ha({fields:s.fields,i18n:e,labelPrefix:a,pathPrefix:n})),r}if(s.type==="group"&&"fields"in s){let i=Df(s.label||"",e),a=o?i?o+" > "+i:o:i,l=s.name?n?n+"."+s.name:s.name:n;return r.push(...Ha({fields:s.fields,i18n:e,labelPrefix:a,pathPrefix:l})),r}if(typeof Di[s.type]=="object"){let i=new Set,a=Di[s.type].operators.reduce((f,m)=>{if(!i.has(m.value)){i.add(m.value);let h=`operators:${m.label}`;f.push({...m,label:e.t(h)})}return f},[]),l=Df(s.label||"",e),c=o?Nc({field:s,prefix:o}):l,u=n?Fa(n,s):s.name,d={label:c,value:u,...Di[s.type],field:s,operators:a};return r.push(d),r}return r},[]);var ln="where-builder",l_=t=>{let{collectionPluralLabel:e,fields:o,renderedFilters:n,resolvedFilterOptions:r}=t,{i18n:s,t:i}=k(),a=a_(()=>Ha({fields:o,i18n:s}),[o,s]),{handleWhereChange:l,query:c}=Rt(),u=a_(()=>{let h=c.where;if(h){if(i_(h))return h.or;let p=SV(h);if(i_(p))return p.or;console.warn(`Invalid where query in URL: ${JSON.stringify(h)}`)}return[]},[c.where]),d=Ff.useCallback(async({andIndex:h,field:p,orIndex:g,relation:b})=>{let v=[...u],x=Di[p.field.type].operators[0].value;b==="and"?v[g].and.splice(h,0,{[String(p.value)]:{[x]:void 0}}):v.push({and:[{[String(p.value)]:{[x]:void 0}}]}),await l({or:v})},[u,l]),f=Ff.useCallback(async({andIndex:h,field:p,operator:g,orIndex:b,value:v})=>{let x=u[b].and[h],y=Di[p.field.type],C=g||y.operators[0].value;if(typeof x=="object"&&p.value){let S=v??x?.[C],w=S!==x?.[String(p.value)]?.[String(C)],D=C!==Object.keys(x?.[String(p.value)]||{})?.[0];if(w||D){let _={[String(p.value)]:{[C]:S}},A=[...u];A[b].and[h]=_,await l({or:A})}}},[u,l]),m=Ff.useCallback(async({andIndex:h,orIndex:p})=>{let g=[...u];g[p].and.splice(h,1),g[p].and.length===0&&g.splice(p,1),await l({or:g})},[u,l]);return fu("div",{className:ln,children:[u.length>0&&fu(Ff.Fragment,{children:[Vn("div",{className:`${ln}__label`,children:i("general:filterWhere",{label:wV(e,s)})}),Vn("ul",{className:`${ln}__or-filters`,children:u.map((h,p)=>{let g=`${p}_${Array.isArray(h?.and)?h.and.length:""}`;return fu("li",{children:[p!==0&&Vn("div",{className:`${ln}__label`,children:i("general:or")}),Vn("ul",{className:`${ln}__and-filters`,children:Array.isArray(h?.and)&&h.and.map((b,v)=>{let x=u[p].and[v],y=Object.keys(x)[0],C=Object.keys(x?.[y]||{})?.[0]||void 0,S=x?.[y]?.[C]||void 0;return fu("li",{children:[v!==0&&Vn("div",{className:`${ln}__label`,children:i("general:and")}),Vn(o_,{addCondition:d,andIndex:v,fieldName:y,filterOptions:r?.get(y),operator:C,orIndex:p,reducedFields:a,removeCondition:m,RenderedFilter:n?.get(y),updateCondition:f,value:S})]},v)})})]},g)})}),Vn(ne,{buttonStyle:"icon-label",className:`${ln}__add-or`,icon:"plus",iconPosition:"left",iconStyle:"with-border",onClick:async()=>{await d({andIndex:0,field:a[0],orIndex:u.length,relation:"or"})},children:i("general:or")})]}),u.length===0&&fu("div",{className:`${ln}__no-filters`,children:[Vn("div",{className:`${ln}__label`,children:i("general:noFiltersSet")}),Vn(ne,{buttonStyle:"icon-label",className:`${ln}__add-first-filter`,icon:"plus",iconPosition:"left",iconStyle:"with-border",onClick:async()=>{a.length>0&&await d({andIndex:0,field:a.find(h=>!h.field.admin?.disableListFilter),orIndex:u.length,relation:"or"})},children:i("general:addFilter")})]})]})};import{c as IV}from"react/compiler-runtime";import{jsx as Af,jsxs as RV}from"react/jsx-runtime";import{getTranslation as _V}from"@payloadcms/translations";import{jsx as c_}from"react/jsx-runtime";import"react";var u_=({className:t})=>c_("svg",{className:["icon","icon--people",t].filter(Boolean).join(" "),height:"14",viewBox:"0 0 16 14",width:"16",xmlns:"http://www.w3.org/2000/svg",children:c_("path",{className:"stroke",d:"M12.0002 13C12.0002 11.5855 11.4383 10.229 10.4381 9.22876C9.43787 8.22857 8.08132 7.66667 6.66683 7.66667M6.66683 7.66667C5.25234 7.66667 3.89579 8.22857 2.89559 9.22876C1.8954 10.229 1.3335 11.5855 1.3335 13M6.66683 7.66667C8.50778 7.66667 10.0002 6.17428 10.0002 4.33333C10.0002 2.49238 8.50778 1 6.66683 1C4.82588 1 3.3335 2.49238 3.3335 4.33333C3.3335 6.17428 4.82588 7.66667 6.66683 7.66667ZM14.6668 12.3333C14.6668 10.0867 13.3335 8 12.0002 7C12.4384 6.67118 12.7889 6.23939 13.0205 5.74285C13.2522 5.2463 13.3578 4.70031 13.3282 4.1532C13.2985 3.60609 13.1344 3.07472 12.8505 2.60613C12.5665 2.13754 12.1714 1.74617 11.7002 1.46667",strokeLinecap:"square"})});var pu="active-query-preset";function d_(t){let e=IV(36),{activePreset:o,openPresetListDrawer:n,resetPreset:r}=t,{i18n:s,t:i}=k(),{getEntityConfig:a}=H(),l,c,u,d,f,m,h,p,g,b,v;if(e[0]!==o||e[1]!==a||e[2]!==s||e[3]!==n||e[4]!==i){let y=a({collectionSlug:"payload-query-presets"});c=RV,u=vt;let C=o&&`${pu}--active`,S;e[16]!==C?(S=[pu,C].filter(Boolean),e[16]=C,e[17]=S):S=e[17],p=S.join(" "),g="select-preset",e[18]!==n?(b=()=>{n()},e[18]=n,e[19]=b):b=e[19],v=o?"always-white":"light",e[20]!==o?.isShared?(h=o?.isShared&&Af(u_,{className:`${pu}__shared`}),e[20]=o?.isShared,e[21]=h):h=e[21],f=Af,m="div",l=`${pu}__label-text`,d=o?.title||i("general:selectLabel",{label:_V(y.labels.singular,s)}),e[0]=o,e[1]=a,e[2]=s,e[3]=n,e[4]=i,e[5]=l,e[6]=c,e[7]=u,e[8]=d,e[9]=f,e[10]=m,e[11]=h,e[12]=p,e[13]=g,e[14]=b,e[15]=v}else l=e[5],c=e[6],u=e[7],d=e[8],f=e[9],m=e[10],h=e[11],p=e[12],g=e[13],b=e[14],v=e[15];let x;return e[22]!==o||e[23]!==r||e[24]!==l||e[25]!==c||e[26]!==u||e[27]!==d||e[28]!==f||e[29]!==m||e[30]!==h||e[31]!==p||e[32]!==g||e[33]!==b||e[34]!==v?(x=c(u,{className:p,id:g,onClick:b,pillStyle:v,children:[h,f(m,{className:l,children:d}),o?Af("div",{className:`${pu}__clear`,id:"clear-preset",onClick:async y=>{y.stopPropagation(),await r()},onKeyDown:async y=>{y.stopPropagation(),await r()},role:"button",tabIndex:0,children:Af(pt,{})}):null]}),e[22]=o,e[23]=r,e[24]=l,e[25]=c,e[26]=u,e[27]=d,e[28]=f,e[29]=m,e[30]=h,e[31]=p,e[32]=g,e[33]=b,e[34]=v,e[35]=x):x=e[35],x}import{fieldAffectsData as DV,flattenTopLevelFields as FV}from"payload/shared";var m_=(t,e)=>t?FV(e).filter(n=>DV(n)&&t.includes(n.name)):null;import{jsx as Cr,jsxs as AV}from"react/jsx-runtime";import{getTranslation as P1}from"@payloadcms/translations";import{transformColumnsToPreferences as f_,transformColumnsToSearchParams as p_}from"payload/shared";import{Fragment as TV,useCallback as Tf,useMemo as h_}from"react";var g_="confirm-delete-preset",za="payload-query-presets",b_=({activePreset:t,collectionSlug:e,queryPresetPermissions:o})=>{let{modified:n,query:r,refineListData:s,setModified:i}=Rt(),{i18n:a,t:l}=k(),{openModal:c}=de(),{config:{routes:{api:u}},getEntityConfig:d}=H(),f=d({collectionSlug:za}),[m,,{openDrawer:h}]=Jt({id:t?.id,collectionSlug:za}),[p,,{closeDrawer:g,openDrawer:b}]=Jt({collectionSlug:za}),v=h_(()=>({"payload-query-presets":{relatedCollection:{equals:e}}}),[e]),[x,,{closeDrawer:y,openDrawer:C}]=ai({collectionSlugs:[za],filterOptions:v,selectedCollection:za}),S=Tf(async F=>{await s({columns:F.columns?p_(F.columns):void 0,preset:F.id,where:F.where},!1)},[s]),w=Tf(async()=>{await s({columns:void 0,preset:void 0,where:void 0},!1)},[s]),D=Tf(async()=>{try{await fetch(`${u}/${za}/${t.id}`,{method:"DELETE"}).then(async F=>{try{let R=await F.json();F.status<400?(fe.success(l("general:titleDeleted",{label:P1(f?.labels?.singular,a),title:t.title})),await w()):R.errors?R.errors.forEach(I=>fe.error(I.message)):fe.error(l("error:deletingTitle",{title:t.title}))}catch{fe.error(l("error:deletingTitle",{title:t.title}))}})}catch{fe.error(l("error:deletingTitle",{title:t.title}))}},[u,t?.id,t?.title,l,f,a,w]),_=Tf(async()=>{try{await fetch(`${u}/payload-query-presets/${t.id}`,{body:JSON.stringify({columns:f_(r.columns),where:r.where}),credentials:"include",headers:{"Content-Type":"application/json"},method:"PATCH"}).then(async F=>{try{let R=await F.json();F.status<400?(fe.success(l("general:updatedLabelSuccessfully",{label:P1(f?.labels?.singular,a)})),i(!1)):R.errors?R.errors.forEach(I=>fe.error(I.message)):fe.error(l("error:unknown"))}catch{fe.error(l("error:unknown"))}})}catch{fe.error(l("error:unknown"))}},[u,t?.id,r.columns,r.where,l,f?.labels?.singular,a,i]),A=h_(()=>{let F=[Cr($u,{label:P1(f?.labels?.plural,a)},"preset-group-label")];return t&&n&&(F.push(Cr(Me.Button,{onClick:async()=>{await s({columns:p_(t.columns),where:t.where},!1)},children:l("general:reset")})),o.update&&F.push(Cr(Me.Button,{onClick:async()=>{await _()},children:t.isShared?l("general:updateForEveryone"):l("general:save")}))),F.push(Cr(Me.Button,{onClick:()=>{b()},children:l("general:createNew")})),t&&o?.delete&&F.push(AV(TV,{children:[Cr(Me.Button,{onClick:()=>c(g_),children:l("general:delete")}),Cr(Me.Button,{onClick:()=>{h()},children:l("general:edit")})]})),F},[t,o?.delete,o?.update,b,h,c,_,l,s,n,f?.labels?.plural,a]);return{CreateNewPresetDrawer:Cr(p,{initialData:{columns:f_(r.columns),relatedCollection:e,where:r.where},onSave:async({doc:F})=>{g(),await S(F)},redirectAfterCreate:!1}),DeletePresetModal:Cr(It,{body:Cr(wi,{elements:{1:({children:F})=>Cr("strong",{children:F})},i18nKey:"general:aboutToDelete",t:l,variables:{label:f?.labels?.singular,title:t?.title}}),confirmingLabel:l("general:deleting"),heading:l("general:confirmDeletion"),modalSlug:g_,onConfirm:D}),EditPresetDrawer:Cr(m,{onDelete:()=>{},onDuplicate:async({doc:F})=>{await S(F)},onSave:async({doc:F})=>{await S(F)}}),hasModifiedPreset:n,openPresetListDrawer:C,PresetListDrawer:Cr(x,{allowCreate:!1,disableQueryPresets:!0,onSelect:async({doc:F})=>{y(),await S(F)}}),queryPresetMenuItems:A,resetPreset:w}};var Do="list-controls",N1=t=>{let{beforeActions:e,collectionConfig:o,collectionSlug:n,disableQueryPresets:r,enableColumns:s=!0,enableSort:i=!1,listMenuItems:a,queryPreset:l,queryPresetPermissions:c,renderedFilters:u,resolvedFilterOptions:d}=t,{handleSearchChange:f,query:m}=Rt(),{CreateNewPresetDrawer:h,DeletePresetModal:p,EditPresetDrawer:g,hasModifiedPreset:b,openPresetListDrawer:v,PresetListDrawer:x,queryPresetMenuItems:y,resetPreset:C}=b_({activePreset:l,collectionSlug:n,queryPresetPermissions:c}),S=Eb(o),{i18n:w,t:D}=k(),{breakpoints:{s:_}}=Co(),A=(S&&Xa("label"in S&&(typeof S.label=="string"||typeof S.label=="object")?S.label:"name"in S?S.name:null,w))??"ID",F=m_(o.admin.listSearchableFields,o.fields),R=y_(D("general:searchBy",{label:Xa(A,w)})),I=y_(!!m?.where),E=EV(m?.where),[T,$]=NV(E?"where":void 0);x_(()=>{I.current&&!m?.where?I.current=!1:m?.where&&(I.current=!0)},[$,m?.where]),x_(()=>{F?.length>0?R.current=F.reduce((N,P,L)=>{let V="label"in P&&P.label?P.label:"name"in P?P.name:null;return L===0?`${D("general:searchBy",{label:Xa(V,w)})}`:L===F.length-1?`${N} ${D("general:or")} ${Xa(V,w)}`:`${N}, ${Xa(V,w)}`},""):R.current=D("general:searchBy",{label:Xa(A,w)})},[D,F,w,A]);let j=a;return o?.enableQueryPresets&&!r&&y?.length>0&&(j=[...y,a?.length>0?Wt(Me.Divider,{},"divider"):null,...a||[]]),Ef(v_,{children:[Ef("div",{className:Do,children:[Ef("div",{className:`${Do}__wrap`,children:[Wt(Pl,{}),Wt(C1,{fieldName:S&&"name"in S?S?.name:null,handleChange:N=>void f(N),initialParams:m,label:R.current},n),l&&b?Wt("div",{className:`${Do}__modified`,children:"Modified"}):null,Wt("div",{className:`${Do}__buttons`,children:Ef("div",{className:`${Do}__buttons-wrap`,children:[!_&&Wt(PV.Fragment,{children:e&&e}),s&&Wt(vt,{"aria-controls":`${Do}-columns`,"aria-expanded":T==="columns",className:`${Do}__toggle-columns`,icon:Wt(Ze,{direction:T==="columns"?"up":"down"}),onClick:()=>$(T!=="columns"?"columns":void 0),pillStyle:"light",children:D("general:columns")}),Wt(vt,{"aria-controls":`${Do}-where`,"aria-expanded":T==="where",className:`${Do}__toggle-where`,icon:Wt(Ze,{direction:T==="where"?"up":"down"}),onClick:()=>$(T!=="where"?"where":void 0),pillStyle:"light",children:D("general:filters")}),i&&Wt(vt,{"aria-controls":`${Do}-sort`,"aria-expanded":T==="sort",className:`${Do}__toggle-sort`,icon:Wt(Ze,{}),onClick:()=>$(T!=="sort"?"sort":void 0),pillStyle:"light",children:D("general:sort")}),!r&&Wt(d_,{activePreset:l,openPresetListDrawer:v,resetPreset:C}),j&&Array.isArray(j)&&j.length>0&&Wt(ho,{button:Wt($R,{ariaLabel:D("general:moreOptions")}),className:`${Do}__popup`,horizontalAlign:"right",id:"list-menu",size:"large",verticalAlign:"bottom",children:Wt(Me.ButtonGroup,{children:j.map((N,P)=>Wt(v_,{children:N},`list-menu-item-${P}`))})})]})})]}),s&&Wt(Tr,{className:`${Do}__columns`,height:T==="columns"?"auto":0,id:`${Do}-columns`,children:Wt(cm,{collectionSlug:o.slug})}),Wt(Tr,{className:`${Do}__where`,height:T==="where"?"auto":0,id:`${Do}-where`,children:Wt(l_,{collectionPluralLabel:o?.labels?.plural,collectionSlug:o.slug,fields:o?.fields,renderedFilters:u,resolvedFilterOptions:d})})]}),x,g,h,p]})};import{c as HV}from"react/compiler-runtime";import{jsx as Fi,jsxs as A_}from"react/jsx-runtime";import{Fragment as zV}from"react";import{jsx as C_,jsxs as LV}from"react/jsx-runtime";import{getTranslation as w_}from"@payloadcms/translations";import{useRouter as $V,useSearchParams as kV}from"next/navigation.js";import*as I_ from"qs-esm";import jV,{useCallback as S_}from"react";var OV="publish-many",L1=t=>{let{clearRouteCache:e}=On(),{collection:{slug:o,labels:{plural:n,singular:r},versions:s}={}}=t,{config:{routes:{api:i},serverURL:a}}=H(),{permissions:l}=Ae(),{i18n:c,t:u}=k(),{getQueryParams:d,selectAll:f}=oo(),m=$V(),h=kV(),{openModal:p}=de(),b=l?.collections?.[o]?.update,v=`publish-${o}`,x=S_(()=>{fe.error(u("error:unknown"))},[u]),y=S_(async()=>{await Qe.patch(`${a}${i}/${o}${d({_status:{not_equals:"published"}})}&draft=true`,{body:JSON.stringify({_status:"published"}),headers:{"Accept-Language":c.language,"Content-Type":"application/json"}}).then(async C=>{try{let S=await C.json(),w=S?.docs.length||0,D=w>1?n:r;return C.status<400||w>0?(fe.success(u("general:updatedCountSuccessfully",{count:w,label:w_(D,c)})),S?.errors.length>0&&fe.error(S.message,{description:S.errors.map(_=>_.message).join(`
57
- `)}),m.replace(I_.stringify({...jr(h),page:f?"1":void 0},{addQueryPrefix:!0})),e(),null):(S.errors?S.errors.forEach(_=>fe.error(_.message)):x(),!1)}catch{return x()}})},[a,i,o,d,c,n,r,u,m,h,f,e,x]);return!s?.drafts||f===xo.None||!b?null:LV(jV.Fragment,{children:[C_("button",{className:`${OV}__toggle`,onClick:()=>{p(v)},type:"button",children:u("version:publish")}),C_(It,{body:u("version:aboutToPublishSelection",{label:w_(n,c)}),cancelLabel:u("general:cancel"),confirmingLabel:u("version:publishing"),confirmLabel:u("general:confirm"),heading:u("version:confirmPublish"),modalSlug:v,onConfirm:y})]})};import{jsx as R_,jsxs as MV}from"react/jsx-runtime";import{getTranslation as __}from"@payloadcms/translations";import{useRouter as BV,useSearchParams as VV}from"next/navigation.js";import*as F_ from"qs-esm";import GV,{useCallback as D_}from"react";var WV="unpublish-many",$1=t=>{let{collection:{slug:e,labels:{plural:o,singular:n},versions:r}={}}=t,{config:{routes:{api:s},serverURL:i}}=H(),{permissions:a}=Ae(),{toggleModal:l}=de(),{i18n:c,t:u}=k(),d=VV(),{getQueryParams:f,selectAll:m}=oo(),h=BV(),{clearRouteCache:p}=On(),b=a?.collections?.[e]?.update,v=`unpublish-${e}`,x=D_(()=>{fe.error(u("error:unknown"))},[u]),y=D_(async()=>{await Qe.patch(`${i}${s}/${e}${f({_status:{not_equals:"draft"}})}`,{body:JSON.stringify({_status:"draft"}),headers:{"Accept-Language":c.language,"Content-Type":"application/json"}}).then(async C=>{try{let S=await C.json(),w=S?.docs.length||0,D=w>1?o:n;return C.status<400||w>0?(fe.success(u("general:updatedCountSuccessfully",{count:w,label:__(D,c)})),S?.errors.length>0&&fe.error(S.message,{description:S.errors.map(_=>_.message).join(`
58
- `)}),h.replace(F_.stringify({...jr(d),page:m?"1":void 0},{addQueryPrefix:!0})),p(),null):(S.errors?S.errors.forEach(_=>fe.error(_.message)):x(),!1)}catch{return x()}})},[i,s,e,f,c,o,n,u,h,d,m,p,x]);return!r?.drafts||m===xo.None||!b?null:MV(GV.Fragment,{children:[R_("button",{className:`${WV}__toggle`,onClick:()=>{l(v)},type:"button",children:u("version:unpublish")}),R_(It,{body:u("version:aboutToUnpublishSelection",{label:__(o,c)}),confirmingLabel:u("version:unpublishing"),heading:u("version:confirmUnpublish"),modalSlug:v,onConfirm:y})]})};var T_="list-selection",hu=t=>{let e=HV(10),{collectionConfig:o,disableBulkDelete:n,disableBulkEdit:r,label:s}=t,{count:i,selectAll:a,toggleAll:l,totalDocs:c}=oo(),{t:u}=k();if(i===0)return null;let d;return e[0]!==o||e[1]!==i||e[2]!==n||e[3]!==r||e[4]!==s||e[5]!==a||e[6]!==u||e[7]!==l||e[8]!==c?(d=A_("div",{className:T_,children:[Fi("span",{children:u("general:selectedCount",{count:i,label:""})}),a!==xo.AllAvailable&&i<c&&Fi("button",{"aria-label":u("general:selectAll",{count:i,label:s}),className:`${T_}__button`,id:"select-all-across-pages",onClick:()=>l(!0),type:"button",children:u("general:selectAll",{count:c,label:""})}),!r&&!n&&Fi("span",{children:"\u2014"}),!r&&A_(zV,{children:[Fi(b1,{collection:o}),Fi(L1,{collection:o}),Fi($1,{collection:o})]}),!n&&Fi(i1,{collection:o})]}),e[0]=o,e[1]=i,e[2]=n,e[3]=r,e[4]=s,e[5]=a,e[6]=u,e[7]=l,e[8]=c,e[9]=d):d=e[9],d};import{jsx as sr,jsxs as Ua,Fragment as XV}from"react/jsx-runtime";import{getTranslation as Ya}from"@payloadcms/translations";import"react";var E_="list-header",Ai="list-drawer",UV=({className:t,collectionConfig:e,Description:o,disableBulkDelete:n,disableBulkEdit:r,hasCreatePermission:s,i18n:i,isBulkUploadEnabled:a,newDocumentURL:l,openBulkUpload:c,smallBreak:u,t:d})=>Ua("header",{className:[E_,t].filter(Boolean).join(" "),children:[sr("h1",{children:Ya(e?.labels?.plural,i)}),s&&Ua(XV,{children:[sr(ne,{"aria-label":i.t("general:createNewLabel",{label:Ya(e?.labels?.singular,i)}),buttonStyle:"pill",el:"link",size:"small",to:l,children:i.t("general:createNew")}),a&&sr(ne,{"aria-label":d("upload:bulkUpload"),buttonStyle:"pill",onClick:c,size:"small",children:d("upload:bulkUpload")})]}),!u&&sr(hu,{collectionConfig:e,disableBulkDelete:n,disableBulkEdit:r,label:Ya(e?.labels?.plural,i)}),o]}),YV=({Description:t,hasCreatePermission:e,i18n:o,t:n})=>{let{config:{collections:r},getEntityConfig:s}=H(),{closeModal:i}=de(),{DocumentDrawerToggler:a,drawerSlug:l,enabledCollections:c,selectedOption:u,setSelectedOption:d}=en(),f=s({collectionSlug:u.value}),m=r.filter(({slug:p})=>c.includes(p)),h=c.length>1;return Ua("header",{className:`${Ai}__header`,children:[Ua("div",{className:`${Ai}__header-wrap`,children:[Ua("div",{className:`${Ai}__header-content`,children:[sr("h2",{className:`${Ai}__header-text`,children:Ya(f?.labels?.plural,o)}),e&&sr(a,{className:`${Ai}__create-new-button`,children:sr(vt,{children:n("general:createNew")})})]}),sr("button",{"aria-label":n("general:close"),className:`${Ai}__header-close`,onClick:()=>{i(l)},type:"button",children:sr(pt,{})})]}),t,h&&Ua("div",{className:`${Ai}__select-collection-wrap`,children:[sr(xe,{label:n("upload:selectCollectionToBrowse")}),sr(mt,{className:`${E_}__select-collection`,onChange:d,options:m.map(p=>({label:Ya(p.labels.singular,o),value:p.slug})),value:{label:Ya(f?.labels.singular,o),value:f?.slug}})]})]})},k1=t=>{let{isInDrawer:e}=en();return e?sr(YV,{...t}):sr(UV,{...t})};import{c as ZV}from"react/compiler-runtime";import{jsx as N_}from"react/jsx-runtime";import{formatAdminURL as JV}from"payload/shared";import"react";import{jsx as P_}from"react/jsx-runtime";import"react";var j1=()=>P_("svg",{className:"icon icon--logout",fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:P_("path",{className:"stroke",d:"M12 16H14.6667C15.0203 16 15.3594 15.8595 15.6095 15.6095C15.8595 15.3594 16 15.0203 16 14.6667V5.33333C16 4.97971 15.8595 4.64057 15.6095 4.39052C15.3594 4.14048 15.0203 4 14.6667 4H12M7.33333 13.3333L4 10M4 10L7.33333 6.66667M4 10H12",strokeLinecap:"square"})});var qV="nav",QV=t=>{let e=ZV(5),{tabIndex:o}=t,n=o===void 0?0:o,{t:r}=k(),{config:s}=H(),{admin:i,routes:a}=s,{routes:l}=i,{logout:c}=l,{admin:u}=a,d;return e[0]!==u||e[1]!==c||e[2]!==r||e[3]!==n?(d=N_(no,{"aria-label":r("authentication:logOut"),className:`${qV}__log-out`,href:JV({adminRoute:u,path:c}),prefetch:!1,tabIndex:n,title:r("authentication:logOut"),children:N_(j1,{})}),e[0]=u,e[1]=c,e[2]=r,e[3]=n,e[4]=d):d=e[4],d};import{c as KV}from"react/compiler-runtime";import{jsx as Za,jsxs as L_}from"react/jsx-runtime";import eG,{useState as $_}from"react";var Is="nav-group",tG="nav",oG=t=>{let e=KV(21),{children:o,isOpen:n,label:r}=t,[s,i]=$_(typeof n<"u"?!n:!1),[a,l]=$_(!1),{setPreference:c}=Fo(),{navOpen:u}=Ii();if(r){let f;e[0]!==s||e[1]!==r||e[2]!==c?(f=()=>{l(!0);let D={};D?.[r]?D[r].open=!!s:D[r]={open:!!s},c(tG,{groups:D},!0),i(!s)},e[0]=s,e[1]=r,e[2]=c,e[3]=f):f=e[3];let m=f,h=`${r}`,p=s&&`${Is}--collapsed`,g;e[4]!==h||e[5]!==p?(g=[`${Is}`,h,p].filter(Boolean),e[4]=h,e[5]=p,e[6]=g):g=e[6];let b=g.join(" "),v=`nav-group-${r}`,x=`${Is}__toggle--${s?"collapsed":"open"}`,y;e[7]!==x?(y=[`${Is}__toggle`,x].filter(Boolean),e[7]=x,e[8]=y):y=e[8];let C=y.join(" "),S=u?0:-1,w;return e[9]!==a||e[10]!==o||e[11]!==s||e[12]!==r||e[13]!==S||e[14]!==b||e[15]!==v||e[16]!==C||e[17]!==m?(w=L_("div",{className:b,id:v,children:[L_("button",{className:C,onClick:m,tabIndex:S,type:"button",children:[Za("div",{className:`${Is}__label`,children:r}),Za("div",{className:`${Is}__indicator`,children:Za(Ze,{className:`${Is}__indicator`,direction:s?void 0:"up"})})]}),Za(Tr,{duration:a?200:0,height:s?0:"auto",children:Za("div",{className:`${Is}__content`,children:o})})]}),e[9]=a,e[10]=o,e[11]=s,e[12]=r,e[13]=S,e[14]=b,e[15]=v,e[16]=C,e[17]=m,e[18]=w):w=e[18],w}let d;return e[19]!==o?(d=Za(eG.Fragment,{children:o}),e[19]=o,e[20]=d):d=e[20],d};import{c as rG}from"react/compiler-runtime";import{jsx as Rs,jsxs as k_}from"react/jsx-runtime";import{collectionDefaults as nG,isNumber as sG}from"payload/shared";import"react";var Ja="per-page",iG=nG.admin.pagination.limits,O1=t=>{let e=rG(9),{defaultLimit:o,handleChange:n,limit:r,limits:s}=t,i=o===void 0?10:o,a=s===void 0?iG:s,{t:l}=k(),c=sG(r)?r:i,u;if(e[0]!==n||e[1]!==c||e[2]!==a||e[3]!==l){let d;e[5]!==n||e[6]!==c||e[7]!==a?(d=f=>{let{close:m}=f;return Rs(Me.ButtonGroup,{children:a.map((h,p)=>k_(Me.Button,{className:[`${Ja}__button`,h===c&&`${Ja}__button-active`].filter(Boolean).join(" "),onClick:()=>{m(),n&&n(h)},children:[h===c&&Rs("div",{className:`${Ja}__chevron`,children:Rs(Ze,{direction:"right",size:"small"})}),"\xA0",Rs("span",{children:h})]},p))})},e[5]=n,e[6]=c,e[7]=a,e[8]=d):d=e[8],u=Rs("div",{className:Ja,children:Rs(ho,{button:k_("div",{className:`${Ja}__base-button`,children:[Rs("span",{children:l("general:perPage",{limit:c})}),"\xA0",Rs(Ze,{className:`${Ja}__icon`})]}),horizontalAlign:"right",render:d,size:"small"})}),e[0]=n,e[1]=c,e[2]=a,e[3]=l,e[4]=u}else u=e[4];return u};import{c as cG}from"react/compiler-runtime";import{jsx as Nf}from"react/jsx-runtime";import{Fragment as O_}from"react";import{jsxs as aG}from"react/jsx-runtime";import"react";function j_(t){return t===void 0||typeof t=="number"?t:decodeURIComponent(t)}var lG="id-label",Pf=({id:t,className:e,prefix:o="ID:"})=>aG("div",{className:[lG,e].filter(Boolean).join(" "),title:t,children:[o,"\xA0",j_(t)]});var M1="render-title",B1=t=>{let e=cG(10),{className:o,element:n,fallback:r,title:s}=t,i=n===void 0?"h1":n,{id:a,isInitializing:l,title:c}=Pe(),u=s||c||r,d=u===a,f=i,m;if(e[0]!==f||e[1]!==o||e[2]!==a||e[3]!==d||e[4]!==l||e[5]!==u){let h=Nf(O_,{children:"\xA0"}),p=d&&`${M1}--has-id`,g;e[7]!==o||e[8]!==p?(g=[o,M1,p].filter(Boolean),e[7]=o,e[8]=p,e[9]=g):g=e[9],m=Nf(f,{className:g.join(" "),title:u,children:l?h:Nf(O_,{children:d?Nf(Pf,{className:`${M1}__id`,id:a}):u||h})}),e[0]=f,e[1]=o,e[2]=a,e[3]=d,e[4]=l,e[5]=u,e[6]=m}else m=e[6];return m};import{c as uG}from"react/compiler-runtime";import{jsx as qa,jsxs as M_}from"react/jsx-runtime";import"react";var cn="sort-column",dG=t=>{let e=uG(22),{name:o,appearance:n,disable:r,Label:s,label:i}=t,a=r===void 0?!1:r,{handleSortChange:l,query:c}=Rt(),{t:u}=k(),{sort:d}=c,f=`-${o}`,m=o,h;e[0]!==m||e[1]!==d?(h=[`${cn}__asc`],d===m&&h.push(`${cn}--active`),e[0]=m,e[1]=d,e[2]=h):h=e[2];let p;e[3]!==f||e[4]!==d?(p=[`${cn}__desc`],d===f&&p.push(`${cn}--active`),e[3]=f,e[4]=d,e[5]=p):p=e[5];let g=n&&`${cn}--appearance-${n}`,b;e[6]!==g?(b=[cn,g].filter(Boolean),e[6]=g,e[7]=b):b=e[7];let v=b.join(" "),x;e[8]!==s||e[9]!==i?(x=s??qa(xe,{hideLocale:!0,label:i,unstyled:!0}),e[8]=s,e[9]=i,e[10]=x):x=e[10];let y;return e[11]!==m||e[12]!==h||e[13]!==f||e[14]!==p||e[15]!==a||e[16]!==l||e[17]!==i||e[18]!==u||e[19]!==v||e[20]!==x?(y=M_("div",{className:v,children:[qa("span",{className:`${cn}__label`,children:x}),!a&&M_("div",{className:`${cn}__buttons`,children:[qa("button",{"aria-label":u("general:sortByLabelDirection",{direction:u("general:ascending"),label:i}),className:[...h,`${cn}__button`].filter(Boolean).join(" "),onClick:()=>void l(m),type:"button",children:qa(Ze,{direction:"up"})}),qa("button",{"aria-label":u("general:sortByLabelDirection",{direction:u("general:descending"),label:i}),className:[...p,`${cn}__button`].filter(Boolean).join(" "),onClick:()=>void l(f),type:"button",children:qa(Ze,{})})]})]}),e[11]=m,e[12]=h,e[13]=f,e[14]=p,e[15]=a,e[16]=l,e[17]=i,e[18]=u,e[19]=v,e[20]=x,e[21]=y):y=e[21],y};import{jsx as B_}from"react/jsx-runtime";import"react";var mG=t=>{let{className:e}=t;return B_("svg",{className:[e,"icon icon--externalLink"].filter(Boolean).join(" "),viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:B_("path",{className:"stroke",d:"M16 10.6667V14.6667C16 15.0203 15.8595 15.3594 15.6095 15.6095C15.3594 15.8595 15.0203 16 14.6667 16H5.33333C4.97971 16 4.64057 15.8595 4.39052 15.6095C4.14048 15.3594 4 15.0203 4 14.6667V5.33333C4 4.97971 4.14048 4.64057 4.39052 4.39052C4.64057 4.14048 4.97971 4 5.33333 4H9.33333M16 4L10 10M16 4H12M16 4V8",strokeLinecap:"square"})})};import{jsx as V_}from"react/jsx-runtime";import"react";var fG=()=>V_("svg",{"aria-hidden":"true",className:"graphic code-block-icon",focusable:"false",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:V_("path",{className:"stroke",d:"M14 12.6667L16.6667 9.99999L14 7.33332M5.99999 7.33332L3.33333 9.99999L5.99999 12.6667M11.6667 4.66666L8.33333 15.3333",strokeLinecap:"square"})});import{jsx as V1}from"react/jsx-runtime";import"react";var G1="minimize-maximize",pG=({className:t,isMinimized:e})=>{let o=[G1,e?`${G1}--minimized`:`${G1}--maximized`,t].filter(Boolean).join(" ");return V1("svg",{className:o,height:"20",stroke:"currentColor",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:e?V1("path",{d:"M7.33333 4H5.33333C4.97971 4 4.64057 4.14048 4.39052 4.39052C4.14048 4.64057 4 4.97971 4 5.33333V7.33333M16 7.33333V5.33333C16 4.97971 15.8595 4.64057 15.6095 4.39052C15.3594 4.14048 15.0203 4 14.6667 4H12.6667M4 12.6667V14.6667C4 15.0203 4.14048 15.3594 4.39052 15.6095C4.64057 15.8595 4.97971 16 5.33333 16H7.33333M12.6667 16H14.6667C15.0203 16 15.3594 15.8595 15.6095 15.6095C15.8595 15.3594 16 15.0203 16 14.6667V12.6667"}):V1("path",{d:"M7.33333 4V6C7.33333 6.35362 7.19286 6.69276 6.94281 6.94281C6.69276 7.19286 6.35362 7.33333 6 7.33333H4M16 7.33333H14C13.6464 7.33333 13.3072 7.19286 13.0572 6.94281C12.8071 6.69276 12.6667 6.35362 12.6667 6V4M4 12.6667H6C6.35362 12.6667 6.69276 12.8071 6.94281 13.0572C7.19286 13.3072 7.33333 13.6464 7.33333 14V16M12.6667 16V14C12.6667 13.6464 12.8071 13.3072 13.0572 13.0572C13.3072 12.8071 13.6464 12.6667 14 12.6667H16"})})};import{jsx as G_,jsxs as hG}from"react/jsx-runtime";import"react";var W1=()=>hG("svg",{fill:"none",height:"26",viewBox:"0 0 26 26",width:"26",xmlns:"http://www.w3.org/2000/svg",children:[G_("path",{d:"M13 21C17.4183 21 21 17.4183 21 13C21 8.58172 17.4183 5 13 5C8.58172 5 5 8.58172 5 13C5 17.4183 8.58172 21 13 21Z",fill:"var(--theme-error-500)"}),G_("path",{d:"M15.4001 10.5996L10.6001 15.3996M10.6001 10.5996L15.4001 15.3996",stroke:"var(--theme-error-50)",strokeLinecap:"round",strokeLinejoin:"round"})]});import{jsx as W_,jsxs as gG}from"react/jsx-runtime";import"react";var H1=()=>gG("svg",{fill:"none",height:"26",viewBox:"0 0 26 26",width:"26",xmlns:"http://www.w3.org/2000/svg",children:[W_("path",{d:"M13 21C17.4183 21 21 17.4183 21 13C21 8.58172 17.4183 5 13 5C8.58172 5 5 8.58172 5 13C5 17.4183 8.58172 21 13 21Z",fill:"var(--theme-elevation-500)"}),W_("path",{d:"M13 16.1998V12.9998M13 9.7998H13.0077",stroke:"var(--theme-elevation-50)",strokeLinecap:"round",strokeLinejoin:"round"})]});import{jsx as H_,jsxs as bG}from"react/jsx-runtime";import"react";var z1=()=>bG("svg",{fill:"none",height:"26",viewBox:"0 0 26 26",width:"26",xmlns:"http://www.w3.org/2000/svg",children:[H_("path",{d:"M13 21C17.4183 21 21 17.4183 21 13C21 8.58172 17.4183 5 13 5C8.58172 5 5 8.58172 5 13C5 17.4183 8.58172 21 13 21Z",fill:"var(--theme-success-500)"}),H_("path",{d:"M10.6001 13.0004L12.2001 14.6004L15.4001 11.4004",stroke:"var(--theme-success-50)",strokeLinecap:"round",strokeLinejoin:"round"})]});import{jsx as z_,jsxs as vG}from"react/jsx-runtime";import"react";var X1=()=>vG("svg",{fill:"none",height:"26",viewBox:"0 0 26 26",width:"26",xmlns:"http://www.w3.org/2000/svg",children:[z_("path",{d:"M13 21C17.4183 21 21 17.4183 21 13C21 8.58172 17.4183 5 13 5C8.58172 5 5 8.58172 5 13C5 17.4183 8.58172 21 13 21Z",fill:"var(--theme-warning-500)"}),z_("path",{d:"M13 10V13.2M13 16.4H13.008",stroke:"var(--theme-warning-50)",strokeLinecap:"round",strokeLinejoin:"round"})]});import{c as U_}from"react/compiler-runtime";import{jsx as X_}from"react/jsx-runtime";import Qa from"react";var Y_=Qa.createContext({addClientFunction:()=>null,removeClientFunction:()=>null}),Z_=Qa.createContext({}),U1=t=>{let e=U_(6),{children:o}=t,n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={},e[0]=n):n=e[0];let[r,s]=Qa.useState(n),i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i=d=>{s(f=>{let m={...f};return m[d.key]=d.func,m})},e[1]=i):i=e[1];let a=i,l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=d=>{s(f=>{let m={...f};return delete m[d.key],m})},e[2]=l):l=e[2];let c=l,u;return e[3]!==o||e[4]!==r?(u=X_(Y_,{value:{addClientFunction:a,removeClientFunction:c},children:X_(Z_,{value:r,children:o})}),e[3]=o,e[4]=r,e[5]=u):u=e[5],u},xG=(t,e)=>{let o=U_(6),{addClientFunction:n,removeClientFunction:r}=Qa.use(Y_),s,i;o[0]!==n||o[1]!==e||o[2]!==t||o[3]!==r?(s=()=>(n({func:e,key:t}),()=>{r({func:e,key:t})}),i=[e,t,n,r],o[0]=n,o[1]=e,o[2]=t,o[3]=r,o[4]=s,o[5]=i):(s=o[4],i=o[5]),Qa.useEffect(s,i)},yG=()=>Qa.use(Z_);import{c as CG}from"react/compiler-runtime";import{jsx as J_}from"react/jsx-runtime";import wG,{useEffect as SG,useRef as IG}from"react";var q_=200,Y1="progress-bar",RG=150,_G=()=>{let t=CG(9),{isTransitioning:e,transitionProgress:o}=st(),[n,r]=wG.useState(null),s=IG(!0),i,a;if(t[0]!==e||t[1]!==o?(i=()=>{let l,c;return e?s.current?c=setTimeout(()=>{r(o),s.current=!1},RG):r(o):(s.current=!0,r(1),l=setTimeout(()=>{r(null)},q_*2)),()=>{clearTimeout(l),clearTimeout(c)}},a=[e,o],t[0]=e,t[1]=o,t[2]=i,t[3]=a):(i=t[2],a=t[3]),SG(i,a),typeof n=="number"){let l=n===1&&`${Y1}--fade-out`,c;t[4]!==l?(c=[Y1,l].filter(Boolean),t[4]=l,t[5]=c):c=t[5];let u=c.join(" "),d;return t[6]!==n||t[7]!==u?(d=J_("div",{className:u,style:{"--transition-duration":`${q_}ms`},children:J_("div",{className:`${Y1}__progress`,style:{width:`${(n||0)*100}%`}})}),t[6]=n,t[7]=u,t[8]=d):d=t[8],d}return null};import{c as DG}from"react/compiler-runtime";import{jsx as FG}from"react/jsx-runtime";import{createContext as AG,use as TG}from"react";var Q_=AG({}),EG=t=>{let e=DG(6),{children:o,visibleEntities:n}=t,r;e[0]!==n?(r=a=>{let{collectionSlug:l,globalSlug:c}=a;return l?n.collections.includes(l):c?n.globals.includes(c):!1},e[0]=n,e[1]=r):r=e[1];let s=r,i;return e[2]!==o||e[3]!==s||e[4]!==n?(i=FG(Q_,{value:{isEntityVisible:s,visibleEntities:n},children:o}),e[2]=o,e[3]=s,e[4]=n,e[5]=i):i=e[5],i},Z1=()=>TG(Q_);import{c as PG}from"react/compiler-runtime";import{jsx as NG}from"react/jsx-runtime";import{useParams as LG}from"next/navigation.js";import{createContext as $G,use as kG}from"react";var K_=$G({}),J1=t=>{let e=PG(3),{children:o}=t,n=LG(),r;return e[0]!==o||e[1]!==n?(r=NG(K_,{value:n,children:o}),e[0]=o,e[1]=n,e[2]=r):r=e[2],r},jG=()=>kG(K_);import{jsx as kt,jsxs as rD}from"react/jsx-runtime";import IMe,{Fragment as RMe}from"react";import{useContext as MG}from"react";import{createContext as OG}from"react";var gu=OG({});var bu=()=>MG(gu);import BG,{useCallback as VG,useEffect as GG,useReducer as WG,useRef as HG}from"react";var zG=(t,e)=>{let{timestamp:o,animationRef:n}=e;n.current=null;let{x:r,y:s,xDirection:i,yDirection:a,eventsFired:l,hasScrolled:c}=t,u=c||!!o,d=u?window.pageXOffset:0,f=u?window.pageYOffset:0,m=u?l+1:l,h=d-r,p=f-s,g=d/(document.body.scrollWidth-window.innerWidth)*100,b=f/(document.body.scrollHeight-window.innerHeight)*100,v=(g+b)/2,x=h>0?"right":h<0?"left":i,y=p>0?"down":p<0?"up":a;return{x:d,y:f,xDifference:h,yDifference:p,xDirection:x,yDirection:y,xPercentage:g,yPercentage:b,totalPercentage:v,eventsFired:m,hasScrolled:u}},vu=t=>{let{children:e}=t,o=HG(null),[n,r]=WG(zG,{x:0,y:0,xDifference:0,yDifference:0,xDirection:void 0,yDirection:void 0,xPercentage:0,yPercentage:0,totalPercentage:0,eventsFired:0,hasScrolled:!1}),s=VG(i=>{o.current&&cancelAnimationFrame(o.current),o.current=requestAnimationFrame(a=>{r({e:i,timestamp:a,animationRef:o})})},[]);return GG(()=>(window.addEventListener("scroll",s),()=>{window.removeEventListener("scroll",s)}),[s]),BG.createElement(gu.Provider,{value:Object.assign({},n)},e&&e)};import PMe from"react";import{Fragment as nD}from"react";var{WindowInfoProvider:q1}=Xn&&"WindowInfoProvider"in Xn?Xn:{WindowInfoProvider:void 0},{useWindowInfo:Q1}=Xn&&"useWindowInfo"in Xn?Xn:{useWindowInfo:void 0};import{jsx as XG}from"react/jsx-runtime";import{useSearchParams as UG}from"next/navigation.js";import*as Lf from"qs-esm";import eD,{createContext as YG,use as ZG}from"react";var JG={searchParams:{},stringifyParams:()=>""},tD=YG(JG),K1=({children:t})=>{let o=UG().toString(),n=eD.useMemo(()=>Lf.parse(o,{depth:10,ignoreQueryPrefix:!0}),[o]),r=eD.useCallback(({params:s,replace:i=!1})=>Lf.stringify({...i?{}:n,...s},{addQueryPrefix:!0}),[n]);return XG(tD,{value:{searchParams:n,stringifyParams:r},children:t})},qG=()=>ZG(tD);import{jsx as xu}from"react/jsx-runtime";import"react";var oD=()=>xu(H0,{className:"payload-toast-container",closeButton:!0,dir:"undefined",gap:8,icons:{error:xu(W1,{}),info:xu(H1,{}),success:xu(z1,{}),warning:xu(X1,{})},offset:"calc(var(--gutter-h) / 2)",toastOptions:{classNames:{closeButton:"payload-toast-close-button",content:"toast-content",error:"toast-error",icon:"toast-icon",info:"toast-info",success:"toast-success",title:"toast-title",toast:"payload-toast-item",warning:"toast-warning"},unstyled:!0},visibleToasts:5});var QG=({children:t,config:e,dateFNSKey:o,fallbackLang:n,isNavOpen:r,languageCode:s,languageOptions:i,locale:a,permissions:l,serverFunction:c,switchLanguageServerAction:u,theme:d,translations:f,user:m})=>{let h=process.env.NEXT_PUBLIC_ENABLE_ROUTER_CACHE_REFRESH==="true"?o1:nD;return rD(nD,{children:[kt(vg,{serverFunction:c,children:kt(ap,{children:kt(h,{children:kt(Wf,{config:e,children:kt(U1,{children:kt(Gf,{dateFNSKey:o,fallbackLang:n,language:s,languageOptions:i,switchLanguageServerAction:u,translations:f,children:kt(q1,{breakpoints:{l:"(max-width: 1440px)",m:"(max-width: 1024px)",s:"(max-width: 768px)",xs:"(max-width: 400px)"},children:kt(vu,{children:kt(K1,{children:kt(Lp,{classPrefix:"payload",transTime:0,zIndex:"var(--z-modal)",children:rD(Gp,{permissions:l,user:m,children:[kt(zp,{children:kt(zf,{theme:d,children:kt(J1,{children:kt(Xp,{locale:a,children:kt(Kb,{children:kt(n3,{children:kt(pb,{children:kt(j4,{initialIsOpen:r,children:kt(ob,{children:t})})})})})})})})}),kt(Ep,{}),kt(Y0,{})]})})})})})})})})})})}),kt(oD,{})]})};import{jsx as sD,jsxs as KG}from"react/jsx-runtime";import{email as eW,username as tW}from"payload/shared";import"react";function ev(t){let{className:e,loginWithUsername:o,readOnly:n,t:r}=t,s=!o||o?.requireEmail||o?.allowEmailLogin,i=!!o;return KG("div",{className:e,children:[s?sD(oi,{field:{name:"email",admin:{autoComplete:"off"},label:r("general:email"),required:!o||o&&o.requireEmail},path:"email",readOnly:n,schemaPath:"email",validate:eW}):null,i&&sD(di,{field:{name:"username",label:r("authentication:username"),required:o&&o.requireUsername},path:"username",readOnly:n,schemaPath:"username",validate:tW})]})}import{c as oW}from"react/compiler-runtime";import{jsx as rW}from"react/jsx-runtime";import"react";var iD="select-all",nW=()=>{let t=oW(7),{selectAll:e,toggleAll:o}=oo(),{i18n:n}=k(),r;if(t[0]!==n||t[1]!==e||t[2]!==o){let s;t[4]===Symbol.for("react.memo_cache_sentinel")?(s=[iD,`${iD}__checkbox`],t[4]=s):s=t[4];let i;t[5]!==o?(i=()=>o(),t[5]=o,t[6]=i):i=t[6],r=rW(Hs,{"aria-label":e===xo.None?n.t("general:selectAllRows"):n.t("general:deselectAllRows"),checked:e===xo.AllInPage||e===xo.AllAvailable,className:s.join(" "),id:"select-all",name:"select-all",onToggle:i,partialChecked:e===xo.Some}),t[0]=n,t[1]=e,t[2]=o,t[3]=r}else r=t[3];return r};import{c as sW}from"react/compiler-runtime";import{jsx as aD}from"react/jsx-runtime";import"react";var lD="select-row",iW=t=>{let e=sW(14),{rowData:o}=t,{user:n}=Ae(),{selected:r,setSelection:s}=oo(),i;e[0]!==o?(i=o||{},e[0]=o,e[1]=i):i=e[1];let{_isLocked:a,_userEditing:l}=i;if(a&&l&&l.id!==n?.id){let p;return e[2]!==l?(p=aD(lu,{user:l}),e[2]=l,e[3]=p):p=e[3],p}let u;e[4]!==o.id||e[5]!==r?(u=r.get(o.id),e[4]=o.id,e[5]=r,e[6]=u):u=e[6];let d=!!u,f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=[lD,`${lD}__checkbox`],e[7]=f):f=e[7];let m;e[8]!==o.id||e[9]!==s?(m=()=>s(o.id),e[8]=o.id,e[9]=s,e[10]=m):m=e[10];let h;return e[11]!==d||e[12]!==m?(h=aD(Hs,{checked:d,className:f.join(" "),onToggle:m}),e[11]=d,e[12]=m,e[13]=h):h=e[13],h};import{jsx as aW}from"react/jsx-runtime";import"react";var Ka=t=>{let{onClick:e}=t,{count:o,selected:n}=oo();return!n||!o?null:aW(vt,{onClick:()=>{typeof e=="function"&&e(n)},pillStyle:"white",children:`Select ${o}`})};import{c as lW}from"react/compiler-runtime";import{jsx as Ht,jsxs as Ti}from"react/jsx-runtime";import{getTranslation as $f}from"@payloadcms/translations";import{useRouter as cW}from"next/navigation.js";import{formatFilesize as uW,isNumber as dW}from"payload/shared";import{Fragment as tv,useEffect as cD,useState as mW}from"react";var Gn="collection-list";function fW(t){let e=lW(17),{AfterList:o,AfterListTable:n,beforeActions:r,BeforeList:s,BeforeListTable:i,collectionSlug:a,columnState:l,Description:c,disableBulkDelete:u,disableBulkEdit:d,disableQueryPresets:f,enableRowSelections:m,hasCreatePermission:h,listMenuItems:p,newDocumentURL:g,queryPreset:b,queryPresetPermissions:v,renderedFilters:x,resolvedFilterOptions:y,Table:C}=t,[S,w]=mW(C),{allowCreate:D,createNewDrawerSlug:_,drawerSlug:A,onBulkSelect:F}=en(),R=D!==void 0?D&&h:h,I,E;e[0]!==C?(I=()=>{C&&w(C)},E=[C],e[0]=C,e[1]=I,e[2]=E):(I=e[1],E=e[2]),cD(I,E);let{user:T}=Ae(),{getEntityConfig:$}=H(),j=cW(),{data:N,defaultLimit:P,handlePageChange:L,handlePerPageChange:V,query:M}=Rt(),{openModal:O}=de(),{setCollectionSlug:B,setCurrentActivePath:G,setOnSuccess:X}=Ho(),{drawerSlug:Z}=Ho(),te=$({collectionSlug:a}),{labels:U,upload:z}=te,ce=!!z,J=ce&&te.upload.bulkUpload,ue=!!A,{i18n:re,t:q}=k(),{setStepNav:pe}=jn(),{breakpoints:he}=Q1(),{s:_e}=he,ge;if(ce){let ae;e[3]!==N.docs?(ae=N.docs.map(pW),e[3]=N.docs,e[4]=ae):ae=e[4],ge=ae}else ge=N.docs;let Ve=ge,Q;e[5]!==Z||e[6]!==a||e[7]!==O||e[8]!==j||e[9]!==B||e[10]!==G||e[11]!==X?(Q=()=>{B(a),G(a),O(Z),X(a,()=>j.refresh())},e[5]=Z,e[6]=a,e[7]=O,e[8]=j,e[9]=B,e[10]=G,e[11]=X,e[12]=Q):Q=e[12];let Le=Q;cD(()=>{ue||pe([{label:U?.plural}])},[pe,U,ue]);let De;return e[13]!==r||e[14]!==m||e[15]!==F?(De=m&&typeof F=="function"?r?[...r,Ht(Ka,{onClick:F},"select-many")]:[Ht(Ka,{onClick:F},"select-many")]:r,e[13]=r,e[14]=m,e[15]=F,e[16]=De):De=e[16],Ht(tv,{children:Ht(sc,{collectionSlug:a,columnState:l,children:Ht("div",{className:`${Gn} ${Gn}--${a}`,children:Ti(s1,{docs:Ve,totalDocs:N.totalDocs,user:T,children:[s,Ti(Bo,{className:`${Gn}__wrap`,children:[Ht(k1,{collectionConfig:te,Description:Ht("div",{className:`${Gn}__sub-header`,children:Ht(oe,{CustomComponent:c,Fallback:Ht(Bb,{collectionSlug:a,description:te?.admin?.description})})}),disableBulkDelete:u,disableBulkEdit:d,hasCreatePermission:R,i18n:re,isBulkUploadEnabled:J&&!z.hideFileInputOnCreate,newDocumentURL:g,openBulkUpload:Le,smallBreak:_e,t:q}),Ht(N1,{beforeActions:De,collectionConfig:te,collectionSlug:a,disableQueryPresets:te?.enableQueryPresets!==!0||f,listMenuItems:p,queryPreset:b,queryPresetPermissions:v,renderedFilters:x,resolvedFilterOptions:y}),i,Ve.length>0&&Ht(cc,{children:S}),Ve.length===0&&Ti("div",{className:`${Gn}__no-results`,children:[Ht("p",{children:re.t("general:noResults",{label:$f(U?.plural,re)})}),R&&g&&Ht(tv,{children:ue?Ht(ne,{el:"button",onClick:()=>O(_),children:re.t("general:createNewLabel",{label:$f(U?.singular,re)})}):Ht(ne,{el:"link",to:g,children:re.t("general:createNewLabel",{label:$f(U?.singular,re)})})})]}),n,Ve.length>0&&Ti("div",{className:`${Gn}__page-controls`,children:[Ht(dc,{hasNextPage:N.hasNextPage,hasPrevPage:N.hasPrevPage,limit:N.limit,nextPage:N.nextPage,numberOfNeighbors:1,onChange:ae=>void L(ae),page:N.page,prevPage:N.prevPage,totalPages:N.totalPages}),N.totalDocs>0&&Ti(tv,{children:[Ti("div",{className:`${Gn}__page-info`,children:[N.page*N.limit-(N.limit-1),"-",N.totalPages>1&&N.totalPages!==N.page?N.limit*N.page:N.totalDocs," ",re.t("general:of")," ",N.totalDocs]}),Ht(O1,{handleChange:ae=>void V(ae),limit:dW(M?.limit)?Number(M.limit):P,limits:te?.admin?.pagination?.limits,resetPage:N.totalDocs<=N.pagingCounter}),_e&&Ti("div",{className:`${Gn}__list-selection`,children:[Ht(hu,{collectionConfig:te,disableBulkDelete:u,disableBulkEdit:d,label:$f(te.labels.plural,re)}),Ht("div",{className:`${Gn}__list-selection-actions`,children:m&&typeof F=="function"?r?[...r,Ht(Ka,{onClick:F},"select-many")]:[Ht(Ka,{onClick:F},"select-many")]:r})]})]})]})]}),o]})})})})}function pW(t){return{...t,filesize:uW(t.filesize)}}import{jsx as ir,jsxs as yD}from"react/jsx-runtime";import{useRouter as jW,useSearchParams as OW}from"next/navigation.js";import{formatAdminURL as MW}from"payload/shared";import BW,{Fragment as VW,useCallback as av,useEffect as CD,useMemo as GW,useRef as lv,useState as Of}from"react";import{c as dD}from"react/compiler-runtime";import{jsx as el,jsxs as uD}from"react/jsx-runtime";var mD=t=>{let e=dD(7),{drawerSlug:o}=t,{closeModal:n}=de(),{t:r}=k(),s;if(e[0]!==n||e[1]!==o||e[2]!==r){let i;e[4]!==n||e[5]!==o?(i=()=>n(o),e[4]=n,e[5]=o,e[6]=i):i=e[6],s=uD(Bo,{className:`${as}__header`,children:[uD("div",{className:`${as}__header-content`,children:[el("h2",{className:`${as}__header-text`,children:el(B1,{element:"span"})}),el("button",{"aria-label":r("general:close"),className:`${as}__header-close`,onClick:i,type:"button",children:el(pt,{})})]}),el(hW,{})]}),e[0]=n,e[1]=o,e[2]=r,e[3]=s}else s=e[3];return s},hW=()=>{let t=dD(3),{id:e,title:o}=Pe(),n;return t[0]!==e||t[1]!==o?(n=e&&e!==o?el(Pf,{id:e.toString()}):null,t[0]=e,t[1]=o,t[2]=n):n=t[2],n};import{formatAdminURL as gW}from"payload/shared";var fD=({adminRoute:t,router:e})=>{let o=gW({adminRoute:t,path:"/"});e.push(o)};import{formatAdminURL as bW}from"payload/shared";var pD=({adminRoute:t,collectionSlug:e,router:o})=>{let n=bW({adminRoute:t,path:e?`/collections/${e}`:"/"});o.push(n)};var ov=(t,e,o,n,r,s,i,a,l,c)=>{if(l)try{s(t,e??o,n),r||(a.current.hasShownLockedModal=!0),a.current={hasShownLockedModal:a.current?.hasShownLockedModal,isLocked:!0,user:n},i(n),r&&c&&c(!1)}catch(u){console.error("Error during document takeover:",u)}};import{c as IW}from"react/compiler-runtime";import{jsx as un,jsxs as yu}from"react/jsx-runtime";import RW,{Fragment as _W,useEffect as DW,useState as FW}from"react";import{jsx as kf,jsxs as rv}from"react/jsx-runtime";import{getTranslation as vW}from"@payloadcms/translations";import{text as xW}from"payload/shared";import yW,{useEffect as hD,useMemo as gD,useState as bD}from"react";var CW="apiKey",wW="api-key",SW="field-type",vD=({enabled:t,readOnly:e})=>{let[o]=bD(wn()),[n,r]=bD(!1),{i18n:s,t:i}=k(),{config:a,getEntityConfig:l}=H(),{collectionSlug:c}=Pe(),u=Et(([y])=>y&&y[CW]||null),d=l({collectionSlug:c})?.fields?.find(y=>"name"in y&&y.name==="apiKey"),f=y=>xW(y,{name:"apiKey",type:"text",blockData:{},data:{},event:"onChange",maxLength:48,minLength:24,path:["apiKey"],preferences:{fields:{}},req:{payload:{config:a},t:i},siblingData:{}}),m=u?.value,h=gD(()=>{let y="API Key";return d?.label&&(y=d.label),vW(y,s)},[d,s]),p=gD(()=>rv("div",{className:`${wW}__label`,children:[kf("span",{children:h}),kf(Oc,{value:m})]}),[h,m]),g=Ee({path:"apiKey",validate:f}),b=()=>{n&&r(!1),setTimeout(()=>{r(!0)},1)},{setValue:v,value:x}=g;return hD(()=>{!m&&t&&v(o),!t&&m&&v(null)},[m,t,v,o]),hD(()=>{n&&setTimeout(()=>{r(!1)},1e4)},[n]),t?rv(yW.Fragment,{children:[rv("div",{className:[SW,"api-key","read-only"].filter(Boolean).join(" "),children:[p,kf("input",{"aria-label":h,className:n?"highlight":void 0,disabled:!0,id:"apiKey",name:"apiKey",type:"text",value:x||""})]}),!e&&kf(v1,{highlightField:b,setKey:()=>v(wn())})]}):null};var jf="auth-fields",xD=t=>{let e=IW(57),{className:o,collectionSlug:n,disableLocalStrategy:r,email:s,loginWithUsername:i,operation:a,readOnly:l,requirePassword:c,setValidateBeforeSubmit:u,useAPIKey:d,username:f,verify:m}=t,{permissions:h}=Ae(),[p,g]=FW(c),b=Et(AW),v=Et(TW),x=Ut(),{i18n:y,t:C}=k(),{docPermissions:S,isEditing:w,isInitializing:D}=Pe(),{config:_}=H(),{routes:A,serverURL:F}=_,{api:R}=A,I=!r||typeof r=="object"&&r.enableFields===!0,E=l||D,T=S?.fields===!0?!0:S?.fields?.enableAPIKey,$=l||T===!0||T&&typeof T=="object"&&!T?.update,j=l||T!==!0&&!T?.update,N=T===!0||T?.read,P;e:{let z=h?.collections?.[n];if(z){P=!!("unlock"in z&&z.unlock);break e}P=!1}let L=P,V;e[0]!==v||e[1]!==u||e[2]!==C?(V=z=>{z?(u(!0),v({type:"UPDATE",errorMessage:C("validation:required"),path:"password",valid:!1}),v({type:"UPDATE",errorMessage:C("validation:required"),path:"confirm-password",valid:!1})):(u(!1),v({type:"REMOVE",path:"password"}),v({type:"REMOVE",path:"confirm-password"})),g(z)},e[0]=v,e[1]=u,e[2]=C,e[3]=V):V=e[3];let M=V,O;e[4]!==R||e[5]!==n||e[6]!==s||e[7]!==y||e[8]!==i||e[9]!==F||e[10]!==C||e[11]!==f?(O=async()=>{let z=`${F}${R}/${n}/unlock`;(await fetch(z,{body:JSON.stringify(i&&f?{username:f}:{email:s}),credentials:"include",headers:{"Accept-Language":y.language,"Content-Type":"application/json"},method:"post"})).status===200?fe.success(C("authentication:successfullyUnlocked")):fe.error(C("authentication:failedToUnlock"))},e[4]=R,e[5]=n,e[6]=s,e[7]=y,e[8]=i,e[9]=F,e[10]=C,e[11]=f,e[12]=O):O=e[12];let B=O,G,X;if(e[13]!==x?(G=()=>{x||g(!1)},X=[x],e[13]=x,e[14]=G,e[15]=X):(G=e[14],X=e[15]),DW(G,X),r&&!I&&!d)return null;let Z;e[16]!==o?(Z=[jf,o].filter(Boolean),e[16]=o,e[17]=Z):Z=e[17];let te=Z.join(" "),U;if(e[18]!==$||e[19]!==N||e[20]!==p||e[21]!==n||e[22]!==r||e[23]!==E||e[24]!==S?.fields||e[25]!==b?.value||e[26]!==j||e[27]!==I||e[28]!==M||e[29]!==L||e[30]!==w||e[31]!==i||e[32]!==a||e[33]!==l||e[34]!==c||e[35]!==C||e[36]!==te||e[37]!==B||e[38]!==d||e[39]!==m){let z;e[41]!==$||e[42]!==N||e[43]!==n||e[44]!==E||e[45]!==b?.value||e[46]!==j||e[47]!==C||e[48]!==d?(z=d&&un("div",{className:`${jf}__api-key`,children:N&&yu(_W,{children:[un(mr,{field:{name:"enableAPIKey",admin:{disabled:E,readOnly:j},label:C("authentication:enableAPIKey")},path:"enableAPIKey",schemaPath:`${n}.enableAPIKey`}),un(vD,{enabled:!!b?.value,readOnly:$})]})}),e[41]=$,e[42]=N,e[43]=n,e[44]=E,e[45]=b?.value,e[46]=j,e[47]=C,e[48]=d,e[49]=z):z=e[49];let ce;e[50]!==n||e[51]!==E||e[52]!==w||e[53]!==l||e[54]!==C||e[55]!==m?(ce=m&&w&&un(mr,{field:{name:"_verified",admin:{disabled:E,readOnly:l},label:C("authentication:verified")},path:"_verified",schemaPath:`${n}._verified`}),e[50]=n,e[51]=E,e[52]=w,e[53]=l,e[54]=C,e[55]=m,e[56]=ce):ce=e[56],U=yu("div",{className:te,children:[I&&yu(RW.Fragment,{children:[un(ev,{loginWithUsername:i,operation:a,permissions:S?.fields,readOnly:l,t:C}),(p||c)&&(!r||!I)&&yu("div",{className:`${jf}__changing-password`,children:[un(Qc,{autoComplete:"new-password",field:{name:"password",label:C("authentication:newPassword"),required:!0},indexPath:"",parentPath:"",parentSchemaPath:"",path:"password",schemaPath:"password"}),un(qc,{disabled:l})]}),yu("div",{className:`${jf}__controls`,children:[p&&!c&&un(ne,{buttonStyle:"secondary",disabled:E,onClick:()=>M(!1),size:"medium",children:C("general:cancel")}),!p&&!c&&!r&&un(ne,{buttonStyle:"secondary",disabled:E,id:"change-password",onClick:()=>M(!0),size:"medium",children:C("authentication:changePassword")}),a==="update"&&L&&un(ne,{buttonStyle:"secondary",disabled:E,onClick:()=>void B(),size:"medium",children:C("authentication:forceUnlock")})]})]}),z,ce]}),e[18]=$,e[19]=N,e[20]=p,e[21]=n,e[22]=r,e[23]=E,e[24]=S?.fields,e[25]=b?.value,e[26]=j,e[27]=I,e[28]=M,e[29]=L,e[30]=w,e[31]=i,e[32]=a,e[33]=l,e[34]=c,e[35]=C,e[36]=te,e[37]=B,e[38]=d,e[39]=m,e[40]=U}else U=e[40];return U};function AW(t){let[e]=t;return e&&e?.enableAPIKey||null}function TW(t){return t[1]}import{c as EW}from"react/compiler-runtime";import{getTranslation as PW}from"@payloadcms/translations";import{formatAdminURL as nv}from"payload/shared";import{useEffect as NW}from"react";var sv=t=>{let e=EW(20),{id:o,collectionSlug:n,globalSlug:r,pluralLabel:s,useAsTitle:i}=t,a=t?.view||void 0,{isEditing:l,isInitializing:c,title:u}=Pe(),{isEntityVisible:d}=Z1(),f;e[0]!==n||e[1]!==r||e[2]!==d?(f=d({collectionSlug:n,globalSlug:r}),e[0]=n,e[1]=r,e[2]=d,e[3]=f):f=e[3];let m=f,{setStepNav:h}=jn(),{i18n:p,t:g}=k(),{config:b}=H(),{routes:v}=b,{admin:x}=v,y,C;return e[4]!==x||e[5]!==n||e[6]!==r||e[7]!==p||e[8]!==o||e[9]!==l||e[10]!==c||e[11]!==m||e[12]!==s||e[13]!==h||e[14]!==g||e[15]!==u||e[16]!==i||e[17]!==a?(y=()=>{let S=[];c||(n?(S.push({label:PW(s,p),url:m?nv({adminRoute:x,path:`/collections/${n}`}):void 0}),l?S.push({label:i&&i!=="id"&&u||`${o}`,url:m?nv({adminRoute:x,path:`/collections/${n}/${o}`}):void 0}):S.push({label:g("general:createNew")})):r&&S.push({label:u,url:m?nv({adminRoute:x,path:`/globals/${r}`}):void 0}),a&&S.push({label:a}),h(S))},C=[h,c,l,s,o,i,x,g,p,u,n,r,a,m],e[4]=x,e[5]=n,e[6]=r,e[7]=p,e[8]=o,e[9]=l,e[10]=c,e[11]=m,e[12]=s,e[13]=h,e[14]=g,e[15]=u,e[16]=i,e[17]=a,e[18]=y,e[19]=C):(y=e[18],C=e[19]),NW(y,C),null};import{c as LW}from"react/compiler-runtime";import{useEffect as $W,useRef as kW}from"react";var iv=t=>{let e=LW(13),{collectionConfig:o,config:n,fallback:r,globalConfig:s}=t,i=o?.admin?.useAsTitle,a;e[0]!==i?(a=b=>{let[v]=b;return i&&v&&v?.[i]||null},e[0]=i,e[1]=a):a=e[1];let l=Et(a),c=kW(!1),{i18n:u}=k(),{setDocumentTitle:d}=Pe(),f=n?.admin?.dateFormat,m;e[2]!==o||e[3]!==f||e[4]!==r||e[5]!==l||e[6]!==s||e[7]!==u?(m=dr({collectionConfig:o,data:{id:""},dateFormat:f,fallback:typeof l=="string"?l:typeof l=="number"?String(l):l?.value||r,globalConfig:s,i18n:u}),e[2]=o,e[3]=f,e[4]=r,e[5]=l,e[6]=s,e[7]=u,e[8]=m):m=e[8];let h=m,p,g;return e[9]!==d||e[10]!==h?(p=()=>{if(!c.current){c.current=!0;return}d(h)},g=[d,h],e[9]=d,e[10]=h,e[11]=p,e[12]=g):(p=e[11],g=e[12]),$W(p,g),null};var Mf="collection-edit";function WW({BeforeDocumentControls:t,Description:e,PreviewButton:o,PublishButton:n,SaveButton:r,SaveDraftButton:s,Upload:i}){let{id:a,action:l,AfterDocument:c,AfterFields:u,apiURL:d,BeforeFields:f,collectionSlug:m,currentEditor:h,disableActions:p,disableCreate:g,disableLeaveWithoutSaving:b,docPermissions:v,documentIsLocked:x,getDocPermissions:y,getDocPreferences:C,globalSlug:S,hasPublishPermission:w,hasSavePermission:D,incrementVersionCount:_,initialState:A,isEditing:F,isInitializing:R,lastUpdateTime:I,redirectAfterCreate:E,redirectAfterDelete:T,redirectAfterDuplicate:$,savedDocumentData:j,setCurrentEditor:N,setDocumentIsLocked:P,unlockDocument:L,updateDocumentEditor:V,updateSavedDocumentData:M}=Pe(),{clearDoc:O,drawerSlug:B,onDelete:G,onDuplicate:X,onSave:Z}=ac(),te=!!B,{refreshCookieAsync:U,user:z}=Ae(),{config:ce,config:{admin:{user:J},routes:{admin:ue}},getEntityConfig:re}=H(),q=re({collectionSlug:m}),pe=re({globalSlug:S}),he=ct(),_e=jW(),ge=OW(),{reportUpdate:Ve}=fi(),{resetUploadEdits:Q}=Ws(),{getFormState:Le}=Dt(),{startRouteTransition:De}=st(),ae=lv(null),se=lv(null),Y=ge.get("locale"),ie=q?.slug||pe?.slug,me=m&&!a?"create":"update",we=q?q.auth:void 0,ze=q?q.upload:void 0,$e=q||pe,ot=$e?.lockDocuments!==void 0?$e?.lockDocuments:!0,Xe=ot!==!1,Qt=(typeof ot=="object"?ot.duration:300)*1e3,Ge=!!(q?.versions?.drafts&&q?.versions?.drafts?.autosave||pe?.versions?.drafts&&pe?.versions?.drafts?.autosave),Je=typeof b<"u"?!b:!Ge,[Ye,xt]=Of(!1),[jt,gt]=Of(!1),[qe,Tt]=Of(Date.now()),be=I+Qt,K=Date.now()>be,W=lv({hasShownLockedModal:!1,isLocked:!1,user:null}),ee=[Mf,(a||S)&&`${Mf}--is-editing`];S&&ee.push(`global-edit--${S}`),m&&ee.push(`collection-edit--${m}`);let le=GW(()=>[ie],[ie]),[ve,Fe]=Of(()=>!!(me==="create"&&we&&!we.disableLocalStrategy)),Se=av(lt=>{P(!0);let fo=typeof W.current?.user=="object"?W.current?.user?.id:W.current?.user;if(lt){let ro=typeof lt.user=="string"||typeof lt.user=="number"?lt.user:lt.user.id;(!W.current||ro!==fo)&&(fo===z.id&&ro!==z.id&&(gt(!0),W.current.hasShownLockedModal=!0),W.current={hasShownLockedModal:W.current?.hasShownLockedModal||!1,isLocked:!0,user:lt.user},N(lt.user))}},[N,P,z?.id]),We=av(async lt=>{let fo=or(se),ro=lt?.doc||lt?.result;if(Ve({id:a,entitySlug:ie,updatedAt:ro?.updatedAt||new Date().toISOString()}),z&&m===J&&a===z.id&&U(),_(),typeof M=="function"&&M(ro||{}),typeof Z=="function"){let ko=a?"update":"create";Z({...lt,operation:ko,updatedAt:ko==="update"?new Date().toISOString():ro?.updatedAt||new Date().toISOString()})}if(!F&&he<2&&E!==!1){let ko=MW({adminRoute:ue,path:`/collections/${m}/${ro?.id}${Y?`?locale=${Y}`:""}`});De(()=>_e.push(ko))}else Q();if(await y(lt),(a||S)&&!Ge){let ko=await C(),{state:ke}=await Le({id:a,collectionSlug:m,data:ro,docPermissions:v,docPreferences:ko,globalSlug:S,operation:me,renderAllFields:!0,returnLockStatus:!1,schemaPath:le.join("."),signal:fo.signal,skipValidation:!0});return Xe&&P(!1),se.current=null,ke}},[Ve,a,ie,z,m,J,_,M,Z,F,he,y,S,Ge,U,ue,Y,_e,Q,C,Le,v,me,le,Xe,P,De,E]),Kt=av(async({formState:lt,submitted:fo})=>{let ro=or(ae),ko=Date.now(),ke=ko-qe,po=Xe&&ke>=1e4;po&&Tt(ko);let Xo=await C(),{lockedState:zt,state:wr}=await Le({id:a,collectionSlug:m,docPermissions:v,docPreferences:Xo,formState:lt,globalSlug:S,operation:me,skipValidation:!fo,renderAllFields:!1,returnLockStatus:Xe,schemaPath:le.join("."),signal:ro.signal,updateLastEdited:po});return Xe&&Se(zt),ae.current=null,wr},[a,m,C,Le,S,Se,Xe,me,le,v,qe]);CD(()=>()=>{Xe&&x&&(a||S)&&!["preview","api","versions"].some(fo=>window.location.pathname.includes(fo))&&(typeof W.current?.user=="object"?W.current?.user?.id===z?.id:W.current?.user===z?.id)&&(L(a,m??S),P(!1),N(null)),gt(!1)},[m,S,a,L,z,N,Xe,x,P]),CD(()=>{let lt=ae.current,fo=se.current;return()=>{tr(lt),tr(fo)}},[]);let Ot=x&&h&&(typeof h=="object"?h.id!==z?.id:h!==z?.id)&&!Ye&&!jt&&!W.current?.hasShownLockedModal&&!K;return ir("main",{className:ee.filter(Boolean).join(" "),children:ir(Il,{operation:me,children:yD(An,{action:l,className:`${Mf}__form`,disabled:Ye||R||!D,disableValidationOnSubmit:!ve,initialState:!R&&A,isDocumentForm:!0,isInitializing:R,method:a?"PATCH":"POST",onChange:[Kt],onSuccess:We,children:[te&&ir(mD,{drawerSlug:B}),Xe&&Ot&&!Ye&&ir(Mb,{handleGoBack:()=>pD({adminRoute:ue,collectionSlug:m,router:_e}),isActive:Ot,onReadOnly:()=>{xt(!0),gt(!1)},onTakeOver:()=>ov(a,m,S,z,!1,V,N,W,Xe),updatedAt:I,user:h}),Xe&&jt&&ir(Ob,{handleBackToDashboard:()=>fD({adminRoute:ue,router:_e}),isActive:jt,onReadOnly:()=>{xt(!0),gt(!1)}}),!Ye&&Je&&ir(Kc,{}),!te&&ir(sv,{collectionSlug:q?.slug,globalSlug:pe?.slug,id:a,pluralLabel:q?.labels?.plural,useAsTitle:q?.admin?.useAsTitle}),ir(iv,{collectionConfig:q,config:ce,fallback:he<=1?a?.toString():void 0,globalConfig:pe}),ir(h1,{apiURL:d,BeforeDocumentControls:t,customComponents:{PreviewButton:o,PublishButton:n,SaveButton:r,SaveDraftButton:s},data:j,disableActions:p,disableCreate:g,hasPublishPermission:w,hasSavePermission:D,id:a,isEditing:F,onDelete:G,onDrawerCreateNew:O,onDuplicate:X,onSave:We,onTakeOver:()=>ov(a,m,S,z,!0,V,N,W,Xe,xt),permissions:v,readOnlyForIncomingUser:Ye,redirectAfterDelete:T,redirectAfterDuplicate:$,slug:q?.slug||pe?.slug,user:h}),ir(kc,{AfterFields:u,BeforeFields:f||yD(VW,{children:[we&&ir(xD,{className:`${Mf}__auth`,collectionSlug:q.slug,disableLocalStrategy:q.auth?.disableLocalStrategy,email:j?.email,loginWithUsername:we?.loginWithUsername,operation:me,readOnly:!D,requirePassword:!a,setValidateBeforeSubmit:Fe,useAPIKey:we.useAPIKey,username:j?.username,verify:we.verify}),ze&&ir(BW.Fragment,{children:i||ir(wb,{collectionSlug:q.slug,initialState:A,uploadConfig:ze})})]}),Description:e,docPermissions:v,fields:$e.fields,readOnly:Ye||!D,schemaPathSegments:le}),c]})})})}import{jsx as HW}from"react/jsx-runtime";import"react";var zW="field-diff-label",XW=({children:t})=>HW("div",{className:zW,children:t});export{Hb as Account,MB as ActionsProvider,h7 as AppHeader,Zc as ArrayField,Gp as AuthProvider,Rr as Banner,Nl as BlocksDrawer,Ll as BlocksField,jI as BulkUploadDrawer,Ib as BulkUploadProvider,ne as Button,FD as CalendarIcon,b7 as Card,ih as CheckIcon,mr as CheckboxField,Hs as CheckboxInput,Ze as ChevronIcon,U1 as ClientFunctionProvider,Xb as CloseMenuIcon,fG as CodeBlockIcon,_D as CodeEdiftor,$l as CodeEditorLazy,kl as CodeField,Xs as Collapsible,Ol as CollapsibleField,Wf as ConfigProvider,qc as ConfirmPasswordField,It as ConfirmationModal,Al as CopyIcon,t1 as CopyLocaleData,Oc as CopyToClipboard,w1 as DateCondition,AD as DatePicker,ec as DateTimeField,bh as DefaultBlockImage,uc as DefaultCell,WW as DefaultEditView,fW as DefaultListView,i1 as DeleteMany,h1 as DocumentControls,pb as DocumentEventsProvider,kc as DocumentFields,Sl as DocumentInfoProvider,Mb as DocumentLocked,Ob as DocumentTakeOver,Cn as DragHandleIcon,Pt as Drawer,ur as DrawerToggler,mi as Dropzone,Ns as EditDepthProvider,_r as EditIcon,b1 as EditMany,hb as EditUpload,ev as EmailAndUsernameFields,oi as EmailField,EG as EntityVisibilityProvider,W1 as ErrorIcon,io as ErrorPill,mG as ExternalLinkIcon,Be as FieldDescription,XW as FieldDiffLabel,He as FieldError,xe as FieldLabel,hm as File,xb as FileDetails,An as Form,K9 as FormLoadingOverlayToggle,Yr as FormSubmit,G8 as FullscreenModal,v1 as GenerateConfirmation,tc as GroupField,Bo as Gutter,Zb as Hamburger,oc as HiddenField,Z8 as HydrateAuthProvider,H1 as InfoIcon,fc as JSONField,mc as JoinField,Kc as LeaveWithoutSaving,ah as LineIcon,no as Link,cp as LinkIcon,N1 as ListControls,pg as ListDrawerContextProvider,k1 as ListHeader,bg as ListQueryProvider,hu as ListSelection,In as LoadingOverlay,i3 as LoadingOverlayToggle,Xp as LocaleProvider,lu as Locked,j1 as LogOutIcon,QV as Logout,Ub as MenuIcon,pG as MinimizeMaximizeIcon,Yo as Modal,dh as MoreIcon,oG as NavGroup,Qb as NavToggler,Fl as NullifyLocaleField,S1 as NumberCondition,pc as NumberField,Il as OperationProvider,zM as OrderableTable,dc as Pagination,J1 as ParamsProvider,Qc as PasswordField,gf as PayloadIcon,O1 as PerPage,vt as Pill,jo as PlusIcon,hc as PointField,ho as Popup,Me as PopupList,zp as PreferencesProvider,a1 as PreviewButton,yb as PreviewSizes,_G as ProgressBar,d1 as PublishButton,L1 as PublishMany,eB as QueryPresetsAccessCell,sB as QueryPresetsColumnField,ZM as QueryPresetsColumnsCell,QM as QueryPresetsWhereCell,cB as QueryPresetsWhereField,vc as RadioGroupField,mt as ReactSelect,R1 as RelationshipCondition,Sc as RelationshipField,cc as RelationshipProvider,Og as RelationshipTable,oe as RenderCustomComponent,KL as RenderDefaultCell,So as RenderFields,B1 as RenderTitle,Ic as RichTextField,QG as RootProvider,o1 as RouteCacheProvider,ap as RouteTransitionProvider,Rc as RowField,dn as RowLabel,np as RowLabelProvider,m1 as SaveButton,f1 as SaveDraftButton,vu as ScrollInfoProvider,C1 as SearchFilter,Pl as SearchIcon,K1 as SearchParamsProvider,vh as SectionTitle,mt as Select,nW as SelectAll,F1 as SelectCondition,_c as SelectField,Sa as SelectInput,Ka as SelectMany,iW as SelectRow,s1 as SelectionProvider,vg as ServerFunctionsProvider,sv as SetDocumentStepNav,iv as SetDocumentTitle,l7 as SetStepNav,St as ShimmerEffect,dG as SortColumn,BM as SortHeader,GM as SortRow,SD as StaggeredShimmers,z1 as SuccessIcon,up as SwapIcon,ib as TabComponent,l1 as Table,sc as TableColumnsProvider,Tc as TabsField,dg as TabsProvider,A1 as TextCondition,di as TextField,lb as TextInput,Ec as TextareaField,cb as TextareaInput,zf as ThemeProvider,Mr as Thumbnail,Kl as TimezonePicker,go as Tooltip,wi as Translation,Gf as TranslationProvider,Pc as UIField,$1 as UnpublishMany,wb as Upload,th as UploadEditsProvider,Yc as UploadField,ob as UploadHandlersProvider,tf as UploadInput,Bb as ViewDescription,X1 as WarningIcon,Ys as WatchChildErrors,sh as WatchCondition,q1 as WindowInfoProvider,pt as XIcon,xM as allFieldComponents,ID as defaultTheme,as as documentDrawerBaseClass,Ce as fieldBaseClass,QI as fieldComponents,Fc as fieldReducer,jp as formatDrawerSlug,jr as parseSearchParams,fe as toast,zb as useActions,xG as useAddClientFunction,ki as useAllFormFields,Ae as useAuth,Ho as useBulkUpload,MI as useBulkUploadDrawerSlug,Pg as useCellProps,yG as useClientFunctions,qn as useCollapsible,H as useConfig,Jo as useDebounce,Xg as useDebouncedCallback,tb as useDebouncedEffect,Hf as useDelay,wg as useDelayedRender,Jt as useDocumentDrawer,ac as useDocumentDrawerContext,fi as useDocumentEvents,$i as useDocumentForm,Pe as useDocumentInfo,bl as useDrawerSlug,ct as useEditDepth,eo as useEffectEvent,Z1 as useEntityVisibility,Ee as useField,Oe as useForm,rp as useFormBackgroundProcessing,Et as useFormFields,Ts as useFormInitializing,Ut as useFormModified,lr as useFormProcessing,Xt as useFormSubmitted,yi as useHotkey,mn as useIntersect,ai as useListDrawer,en as useListDrawerContext,Rt as useListQuery,_g as useListRelationships,Ne as useLocale,de as useModal,Ii as useNav,Qo as useOperation,jG as useParams,EM as usePayloadAPI,Fo as usePreferences,$M as useResize,On as useRouteCache,st as useRouteTransition,HD as useRowLabel,bu as useScrollInfo,qG as useSearchParams,oo as useSelection,Dt as useServerFunctions,jn as useStepNav,pa as useTableColumns,RD as useTheme,Bs as useThrottledEffect,k as useTranslation,Ws as useUploadEdits,Dc as useUploadHandlers,Eb as useUseTitleField,Lu as useWatchForm,Q1 as useWindowInfo,je as withCondition};
53
+ `]))),xw=function(e,o){var n=e.isFocused,r=e.size,s=e.theme,i=s.colors,l=s.spacing.baseUnit;return _e({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:r,lineHeight:1,marginRight:r,textAlign:"center",verticalAlign:"middle"},o?{}:{color:n?i.neutral60:i.neutral20,padding:l*2})},Gh=function(e){var o=e.delay,n=e.offset;return Fe("span",{css:Xl({animation:"".concat(f5," 1s ease-in-out ").concat(o,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:n?"1em":void 0,height:"1em",verticalAlign:"top",width:"1em"},"","")})},p5=function(e){var o=e.innerProps,n=e.isRtl,r=e.size,s=r===void 0?4:r,i=Vo(e,l5);return Fe("div",Re({},$t(_e(_e({},i),{},{innerProps:o,isRtl:n,size:s}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),o),Fe(Gh,{delay:0,offset:n}),Fe(Gh,{delay:160,offset:!0}),Fe(Gh,{delay:320,offset:!n}))},yw=function(e,o){var n=e.isDisabled,r=e.isFocused,s=e.theme,i=s.colors,l=s.borderRadius,a=s.spacing;return _e({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:a.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},o?{}:{backgroundColor:n?i.neutral5:i.neutral0,borderColor:n?i.neutral10:r?i.primary:i.neutral20,borderRadius:l,borderStyle:"solid",borderWidth:1,boxShadow:r?"0 0 0 1px ".concat(i.primary):void 0,"&:hover":{borderColor:r?i.primary:i.neutral30}})},h5=function(e){var o=e.children,n=e.isDisabled,r=e.isFocused,s=e.innerRef,i=e.innerProps,l=e.menuIsOpen;return Fe("div",Re({ref:s},$t(e,"control",{control:!0,"control--is-disabled":n,"control--is-focused":r,"control--menu-is-open":l}),i,{"aria-disabled":n||void 0}),o)},g5=h5,b5=["data"],Cw=function(e,o){var n=e.theme.spacing;return o?{}:{paddingBottom:n.baseUnit*2,paddingTop:n.baseUnit*2}},v5=function(e){var o=e.children,n=e.cx,r=e.getStyles,s=e.getClassNames,i=e.Heading,l=e.headingProps,a=e.innerProps,c=e.label,u=e.theme,d=e.selectProps;return Fe("div",Re({},$t(e,"group",{group:!0}),a),Fe(i,Re({},l,{selectProps:d,theme:u,getStyles:r,getClassNames:s,cx:n}),c),Fe("div",null,o))},ww=function(e,o){var n=e.theme,r=n.colors,s=n.spacing;return _e({label:"group",cursor:"default",display:"block"},o?{}:{color:r.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:s.baseUnit*3,paddingRight:s.baseUnit*3,textTransform:"uppercase"})},x5=function(e){var o=YC(e);o.data;var n=Vo(o,b5);return Fe("div",Re({},$t(e,"groupHeading",{"group-heading":!0}),n))},y5=v5,C5=["innerRef","isDisabled","isHidden","inputClassName"],Sw=function(e,o){var n=e.isDisabled,r=e.value,s=e.theme,i=s.spacing,l=s.colors;return _e(_e({visibility:n?"hidden":"visible",transform:r?"translateZ(0)":""},w5),o?{}:{margin:i.baseUnit/2,paddingBottom:i.baseUnit/2,paddingTop:i.baseUnit/2,color:l.neutral80})},Iw={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},w5={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":_e({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},Iw)},S5=function(e){return _e({label:"input",color:"inherit",background:0,opacity:e?0:1,width:"100%"},Iw)},I5=function(e){var o=e.cx,n=e.value,r=YC(e),s=r.innerRef,i=r.isDisabled,l=r.isHidden,a=r.inputClassName,c=Vo(r,C5);return Fe("div",Re({},$t(e,"input",{"input-container":!0}),{"data-value":n||""}),Fe("input",Re({className:o({input:!0},a),ref:s,style:S5(l),disabled:i},c)))},R5=I5,Rw=function(e,o){var n=e.theme,r=n.spacing,s=n.borderRadius,i=n.colors;return _e({label:"multiValue",display:"flex",minWidth:0},o?{}:{backgroundColor:i.neutral10,borderRadius:s/2,margin:r.baseUnit/2})},_w=function(e,o){var n=e.theme,r=n.borderRadius,s=n.colors,i=e.cropWithEllipsis;return _e({overflow:"hidden",textOverflow:i||i===void 0?"ellipsis":void 0,whiteSpace:"nowrap"},o?{}:{borderRadius:r/2,color:s.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},Dw=function(e,o){var n=e.theme,r=n.spacing,s=n.borderRadius,i=n.colors,l=e.isFocused;return _e({alignItems:"center",display:"flex"},o?{}:{borderRadius:s/2,backgroundColor:l?i.dangerLight:void 0,paddingLeft:r.baseUnit,paddingRight:r.baseUnit,":hover":{backgroundColor:i.dangerLight,color:i.danger}})},Fw=function(e){var o=e.children,n=e.innerProps;return Fe("div",n,o)},_5=Fw,D5=Fw;function F5(t){var e=t.children,o=t.innerProps;return Fe("div",Re({role:"button"},o),e||Fe(Xh,{size:14}))}var A5=function(e){var o=e.children,n=e.components,r=e.data,s=e.innerProps,i=e.isDisabled,l=e.removeProps,a=e.selectProps,c=n.Container,u=n.Label,d=n.Remove;return Fe(c,{data:r,innerProps:_e(_e({},$t(e,"multiValue",{"multi-value":!0,"multi-value--is-disabled":i})),s),selectProps:a},Fe(u,{data:r,innerProps:_e({},$t(e,"multiValueLabel",{"multi-value__label":!0})),selectProps:a},o),Fe(d,{data:r,innerProps:_e(_e({},$t(e,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(o||"option")},l),selectProps:a}))},T5=A5,Aw=function(e,o){var n=e.isDisabled,r=e.isFocused,s=e.isSelected,i=e.theme,l=i.spacing,a=i.colors;return _e({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},o?{}:{backgroundColor:s?a.primary:r?a.primary25:"transparent",color:n?a.neutral20:s?a.neutral0:"inherit",padding:"".concat(l.baseUnit*2,"px ").concat(l.baseUnit*3,"px"),":active":{backgroundColor:n?void 0:s?a.primary:a.primary50}})},E5=function(e){var o=e.children,n=e.isDisabled,r=e.isFocused,s=e.isSelected,i=e.innerRef,l=e.innerProps;return Fe("div",Re({},$t(e,"option",{option:!0,"option--is-disabled":n,"option--is-focused":r,"option--is-selected":s}),{ref:i,"aria-disabled":n},l),o)},P5=E5,Tw=function(e,o){var n=e.theme,r=n.spacing,s=n.colors;return _e({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},o?{}:{color:s.neutral50,marginLeft:r.baseUnit/2,marginRight:r.baseUnit/2})},N5=function(e){var o=e.children,n=e.innerProps;return Fe("div",Re({},$t(e,"placeholder",{placeholder:!0}),n),o)},L5=N5,Ew=function(e,o){var n=e.isDisabled,r=e.theme,s=r.spacing,i=r.colors;return _e({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},o?{}:{color:n?i.neutral40:i.neutral80,marginLeft:s.baseUnit/2,marginRight:s.baseUnit/2})},$5=function(e){var o=e.children,n=e.isDisabled,r=e.innerProps;return Fe("div",Re({},$t(e,"singleValue",{"single-value":!0,"single-value--is-disabled":n}),r),o)},k5=$5,uo={ClearIndicator:d5,Control:g5,DropdownIndicator:u5,DownChevron:pw,CrossIcon:Xh,Group:y5,GroupHeading:x5,IndicatorsContainer:i5,IndicatorSeparator:m5,Input:R5,LoadingIndicator:p5,Menu:K6,MenuList:e5,MenuPortal:r5,LoadingMessage:o5,NoOptionsMessage:t5,MultiValue:T5,MultiValueContainer:_5,MultiValueLabel:D5,MultiValueRemove:F5,Option:P5,Placeholder:L5,SelectContainer:n5,SingleValue:k5,ValueContainer:s5},Pw=function(e){return _e(_e({},uo),e.components)};var Nw=Number.isNaN||function(e){return typeof e=="number"&&e!==e};function j5(t,e){return!!(t===e||Nw(t)&&Nw(e))}function O5(t,e){if(t.length!==e.length)return!1;for(var o=0;o<t.length;o++)if(!j5(t[o],e[o]))return!1;return!0}function Lw(t,e){e===void 0&&(e=O5);var o=null;function n(){for(var r=[],s=0;s<arguments.length;s++)r[s]=arguments[s];if(o&&o.lastThis===this&&e(r,o.lastArgs))return o.lastResult;var i=t.apply(this,r);return o={lastResult:i,lastArgs:r,lastThis:this},i}return n.clear=function(){o=null},n}var B5={name:"7pg0cj-a11yText",styles:"label:a11yText;z-index:9999;border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;width:1px;position:absolute;overflow:hidden;padding:0;white-space:nowrap"},V5=function(e){return Fe("span",Re({css:B5},e))},$w=V5,G5={guidance:function(e){var o=e.isSearchable,n=e.isMulti,r=e.tabSelectsValue,s=e.context,i=e.isInitialFocus;switch(s){case"menu":return"Use Up and Down to choose options, press Enter to select the currently focused option, press Escape to exit the menu".concat(r?", press Tab to select the option and exit the menu":"",".");case"input":return i?"".concat(e["aria-label"]||"Select"," is focused ").concat(o?",type to refine list":"",", press Down to open the menu, ").concat(n?" press left to focus selected values":""):"";case"value":return"Use left and right to toggle between focused values, press Backspace to remove the currently focused value";default:return""}},onChange:function(e){var o=e.action,n=e.label,r=n===void 0?"":n,s=e.labels,i=e.isDisabled;switch(o){case"deselect-option":case"pop-value":case"remove-value":return"option ".concat(r,", deselected.");case"clear":return"All selected options have been cleared.";case"initial-input-focus":return"option".concat(s.length>1?"s":""," ").concat(s.join(","),", selected.");case"select-option":return i?"option ".concat(r," is disabled. Select another option."):"option ".concat(r,", selected.");default:return""}},onFocus:function(e){var o=e.context,n=e.focused,r=e.options,s=e.label,i=s===void 0?"":s,l=e.selectValue,a=e.isDisabled,c=e.isSelected,u=e.isAppleDevice,d=function(p,g){return p&&p.length?"".concat(p.indexOf(g)+1," of ").concat(p.length):""};if(o==="value"&&l)return"value ".concat(i," focused, ").concat(d(l,n),".");if(o==="menu"&&u){var f=a?" disabled":"",m="".concat(c?" selected":"").concat(f);return"".concat(i).concat(m,", ").concat(d(r,n),".")}return""},onFilter:function(e){var o=e.inputValue,n=e.resultsMessage;return"".concat(n).concat(o?" for search term "+o:"",".")}},W5=function(e){var o=e.ariaSelection,n=e.focusedOption,r=e.focusedValue,s=e.focusableOptions,i=e.isFocused,l=e.selectValue,a=e.selectProps,c=e.id,u=e.isAppleDevice,d=a.ariaLiveMessages,f=a.getOptionLabel,m=a.inputValue,h=a.isMulti,p=a.isOptionDisabled,g=a.isSearchable,b=a.menuIsOpen,v=a.options,x=a.screenReaderStatus,y=a.tabSelectsValue,C=a.isLoading,S=a["aria-label"],w=a["aria-live"],F=Zl(function(){return _e(_e({},G5),d||{})},[d]),_=Zl(function(){var T="";if(o&&F.onChange){var L=o.option,k=o.options,j=o.removedValue,P=o.removedValues,N=o.value,B=function(te){return Array.isArray(te)?null:te},M=j||L||B(N),O=M?f(M):"",V=k||P||void 0,G=V?V.map(f):[],z=_e({isDisabled:M&&p(M,l),label:O,labels:G},o);T=F.onChange(z)}return T},[o,F,p,l,f]),A=Zl(function(){var T="",L=n||r,k=!!(n&&l&&l.includes(n));if(L&&F.onFocus){var j={focused:L,label:f(L),isDisabled:p(L,l),isSelected:k,options:s,context:L===n?"menu":"value",selectValue:l,isAppleDevice:u};T=F.onFocus(j)}return T},[n,r,f,p,F,s,l,u]),R=Zl(function(){var T="";if(b&&v.length&&!C&&F.onFilter){var L=x({count:s.length});T=F.onFilter({inputValue:m,resultsMessage:L})}return T},[s,m,b,F,v,x,C]),I=o?.action==="initial-input-focus",D=Zl(function(){var T="";if(F.guidance){var L=r?"value":b?"menu":"input";T=F.guidance({"aria-label":S,context:L,isDisabled:n&&p(n,l),isMulti:h,isSearchable:g,tabSelectsValue:y,isInitialFocus:I})}return T},[S,n,r,h,p,g,b,F,l,y,I]),E=Fe(Zh,null,Fe("span",{id:"aria-selection"},_),Fe("span",{id:"aria-focused"},A),Fe("span",{id:"aria-results"},R),Fe("span",{id:"aria-guidance"},D));return Fe(Zh,null,Fe($w,{id:c},I&&E),Fe($w,{"aria-live":w,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},i&&!I&&E))},H5=W5,Jh=[{base:"A",letters:"A\u24B6\uFF21\xC0\xC1\xC2\u1EA6\u1EA4\u1EAA\u1EA8\xC3\u0100\u0102\u1EB0\u1EAE\u1EB4\u1EB2\u0226\u01E0\xC4\u01DE\u1EA2\xC5\u01FA\u01CD\u0200\u0202\u1EA0\u1EAC\u1EB6\u1E00\u0104\u023A\u2C6F"},{base:"AA",letters:"\uA732"},{base:"AE",letters:"\xC6\u01FC\u01E2"},{base:"AO",letters:"\uA734"},{base:"AU",letters:"\uA736"},{base:"AV",letters:"\uA738\uA73A"},{base:"AY",letters:"\uA73C"},{base:"B",letters:"B\u24B7\uFF22\u1E02\u1E04\u1E06\u0243\u0182\u0181"},{base:"C",letters:"C\u24B8\uFF23\u0106\u0108\u010A\u010C\xC7\u1E08\u0187\u023B\uA73E"},{base:"D",letters:"D\u24B9\uFF24\u1E0A\u010E\u1E0C\u1E10\u1E12\u1E0E\u0110\u018B\u018A\u0189\uA779"},{base:"DZ",letters:"\u01F1\u01C4"},{base:"Dz",letters:"\u01F2\u01C5"},{base:"E",letters:"E\u24BA\uFF25\xC8\xC9\xCA\u1EC0\u1EBE\u1EC4\u1EC2\u1EBC\u0112\u1E14\u1E16\u0114\u0116\xCB\u1EBA\u011A\u0204\u0206\u1EB8\u1EC6\u0228\u1E1C\u0118\u1E18\u1E1A\u0190\u018E"},{base:"F",letters:"F\u24BB\uFF26\u1E1E\u0191\uA77B"},{base:"G",letters:"G\u24BC\uFF27\u01F4\u011C\u1E20\u011E\u0120\u01E6\u0122\u01E4\u0193\uA7A0\uA77D\uA77E"},{base:"H",letters:"H\u24BD\uFF28\u0124\u1E22\u1E26\u021E\u1E24\u1E28\u1E2A\u0126\u2C67\u2C75\uA78D"},{base:"I",letters:"I\u24BE\uFF29\xCC\xCD\xCE\u0128\u012A\u012C\u0130\xCF\u1E2E\u1EC8\u01CF\u0208\u020A\u1ECA\u012E\u1E2C\u0197"},{base:"J",letters:"J\u24BF\uFF2A\u0134\u0248"},{base:"K",letters:"K\u24C0\uFF2B\u1E30\u01E8\u1E32\u0136\u1E34\u0198\u2C69\uA740\uA742\uA744\uA7A2"},{base:"L",letters:"L\u24C1\uFF2C\u013F\u0139\u013D\u1E36\u1E38\u013B\u1E3C\u1E3A\u0141\u023D\u2C62\u2C60\uA748\uA746\uA780"},{base:"LJ",letters:"\u01C7"},{base:"Lj",letters:"\u01C8"},{base:"M",letters:"M\u24C2\uFF2D\u1E3E\u1E40\u1E42\u2C6E\u019C"},{base:"N",letters:"N\u24C3\uFF2E\u01F8\u0143\xD1\u1E44\u0147\u1E46\u0145\u1E4A\u1E48\u0220\u019D\uA790\uA7A4"},{base:"NJ",letters:"\u01CA"},{base:"Nj",letters:"\u01CB"},{base:"O",letters:"O\u24C4\uFF2F\xD2\xD3\xD4\u1ED2\u1ED0\u1ED6\u1ED4\xD5\u1E4C\u022C\u1E4E\u014C\u1E50\u1E52\u014E\u022E\u0230\xD6\u022A\u1ECE\u0150\u01D1\u020C\u020E\u01A0\u1EDC\u1EDA\u1EE0\u1EDE\u1EE2\u1ECC\u1ED8\u01EA\u01EC\xD8\u01FE\u0186\u019F\uA74A\uA74C"},{base:"OI",letters:"\u01A2"},{base:"OO",letters:"\uA74E"},{base:"OU",letters:"\u0222"},{base:"P",letters:"P\u24C5\uFF30\u1E54\u1E56\u01A4\u2C63\uA750\uA752\uA754"},{base:"Q",letters:"Q\u24C6\uFF31\uA756\uA758\u024A"},{base:"R",letters:"R\u24C7\uFF32\u0154\u1E58\u0158\u0210\u0212\u1E5A\u1E5C\u0156\u1E5E\u024C\u2C64\uA75A\uA7A6\uA782"},{base:"S",letters:"S\u24C8\uFF33\u1E9E\u015A\u1E64\u015C\u1E60\u0160\u1E66\u1E62\u1E68\u0218\u015E\u2C7E\uA7A8\uA784"},{base:"T",letters:"T\u24C9\uFF34\u1E6A\u0164\u1E6C\u021A\u0162\u1E70\u1E6E\u0166\u01AC\u01AE\u023E\uA786"},{base:"TZ",letters:"\uA728"},{base:"U",letters:"U\u24CA\uFF35\xD9\xDA\xDB\u0168\u1E78\u016A\u1E7A\u016C\xDC\u01DB\u01D7\u01D5\u01D9\u1EE6\u016E\u0170\u01D3\u0214\u0216\u01AF\u1EEA\u1EE8\u1EEE\u1EEC\u1EF0\u1EE4\u1E72\u0172\u1E76\u1E74\u0244"},{base:"V",letters:"V\u24CB\uFF36\u1E7C\u1E7E\u01B2\uA75E\u0245"},{base:"VY",letters:"\uA760"},{base:"W",letters:"W\u24CC\uFF37\u1E80\u1E82\u0174\u1E86\u1E84\u1E88\u2C72"},{base:"X",letters:"X\u24CD\uFF38\u1E8A\u1E8C"},{base:"Y",letters:"Y\u24CE\uFF39\u1EF2\xDD\u0176\u1EF8\u0232\u1E8E\u0178\u1EF6\u1EF4\u01B3\u024E\u1EFE"},{base:"Z",letters:"Z\u24CF\uFF3A\u0179\u1E90\u017B\u017D\u1E92\u1E94\u01B5\u0224\u2C7F\u2C6B\uA762"},{base:"a",letters:"a\u24D0\uFF41\u1E9A\xE0\xE1\xE2\u1EA7\u1EA5\u1EAB\u1EA9\xE3\u0101\u0103\u1EB1\u1EAF\u1EB5\u1EB3\u0227\u01E1\xE4\u01DF\u1EA3\xE5\u01FB\u01CE\u0201\u0203\u1EA1\u1EAD\u1EB7\u1E01\u0105\u2C65\u0250"},{base:"aa",letters:"\uA733"},{base:"ae",letters:"\xE6\u01FD\u01E3"},{base:"ao",letters:"\uA735"},{base:"au",letters:"\uA737"},{base:"av",letters:"\uA739\uA73B"},{base:"ay",letters:"\uA73D"},{base:"b",letters:"b\u24D1\uFF42\u1E03\u1E05\u1E07\u0180\u0183\u0253"},{base:"c",letters:"c\u24D2\uFF43\u0107\u0109\u010B\u010D\xE7\u1E09\u0188\u023C\uA73F\u2184"},{base:"d",letters:"d\u24D3\uFF44\u1E0B\u010F\u1E0D\u1E11\u1E13\u1E0F\u0111\u018C\u0256\u0257\uA77A"},{base:"dz",letters:"\u01F3\u01C6"},{base:"e",letters:"e\u24D4\uFF45\xE8\xE9\xEA\u1EC1\u1EBF\u1EC5\u1EC3\u1EBD\u0113\u1E15\u1E17\u0115\u0117\xEB\u1EBB\u011B\u0205\u0207\u1EB9\u1EC7\u0229\u1E1D\u0119\u1E19\u1E1B\u0247\u025B\u01DD"},{base:"f",letters:"f\u24D5\uFF46\u1E1F\u0192\uA77C"},{base:"g",letters:"g\u24D6\uFF47\u01F5\u011D\u1E21\u011F\u0121\u01E7\u0123\u01E5\u0260\uA7A1\u1D79\uA77F"},{base:"h",letters:"h\u24D7\uFF48\u0125\u1E23\u1E27\u021F\u1E25\u1E29\u1E2B\u1E96\u0127\u2C68\u2C76\u0265"},{base:"hv",letters:"\u0195"},{base:"i",letters:"i\u24D8\uFF49\xEC\xED\xEE\u0129\u012B\u012D\xEF\u1E2F\u1EC9\u01D0\u0209\u020B\u1ECB\u012F\u1E2D\u0268\u0131"},{base:"j",letters:"j\u24D9\uFF4A\u0135\u01F0\u0249"},{base:"k",letters:"k\u24DA\uFF4B\u1E31\u01E9\u1E33\u0137\u1E35\u0199\u2C6A\uA741\uA743\uA745\uA7A3"},{base:"l",letters:"l\u24DB\uFF4C\u0140\u013A\u013E\u1E37\u1E39\u013C\u1E3D\u1E3B\u017F\u0142\u019A\u026B\u2C61\uA749\uA781\uA747"},{base:"lj",letters:"\u01C9"},{base:"m",letters:"m\u24DC\uFF4D\u1E3F\u1E41\u1E43\u0271\u026F"},{base:"n",letters:"n\u24DD\uFF4E\u01F9\u0144\xF1\u1E45\u0148\u1E47\u0146\u1E4B\u1E49\u019E\u0272\u0149\uA791\uA7A5"},{base:"nj",letters:"\u01CC"},{base:"o",letters:"o\u24DE\uFF4F\xF2\xF3\xF4\u1ED3\u1ED1\u1ED7\u1ED5\xF5\u1E4D\u022D\u1E4F\u014D\u1E51\u1E53\u014F\u022F\u0231\xF6\u022B\u1ECF\u0151\u01D2\u020D\u020F\u01A1\u1EDD\u1EDB\u1EE1\u1EDF\u1EE3\u1ECD\u1ED9\u01EB\u01ED\xF8\u01FF\u0254\uA74B\uA74D\u0275"},{base:"oi",letters:"\u01A3"},{base:"ou",letters:"\u0223"},{base:"oo",letters:"\uA74F"},{base:"p",letters:"p\u24DF\uFF50\u1E55\u1E57\u01A5\u1D7D\uA751\uA753\uA755"},{base:"q",letters:"q\u24E0\uFF51\u024B\uA757\uA759"},{base:"r",letters:"r\u24E1\uFF52\u0155\u1E59\u0159\u0211\u0213\u1E5B\u1E5D\u0157\u1E5F\u024D\u027D\uA75B\uA7A7\uA783"},{base:"s",letters:"s\u24E2\uFF53\xDF\u015B\u1E65\u015D\u1E61\u0161\u1E67\u1E63\u1E69\u0219\u015F\u023F\uA7A9\uA785\u1E9B"},{base:"t",letters:"t\u24E3\uFF54\u1E6B\u1E97\u0165\u1E6D\u021B\u0163\u1E71\u1E6F\u0167\u01AD\u0288\u2C66\uA787"},{base:"tz",letters:"\uA729"},{base:"u",letters:"u\u24E4\uFF55\xF9\xFA\xFB\u0169\u1E79\u016B\u1E7B\u016D\xFC\u01DC\u01D8\u01D6\u01DA\u1EE7\u016F\u0171\u01D4\u0215\u0217\u01B0\u1EEB\u1EE9\u1EEF\u1EED\u1EF1\u1EE5\u1E73\u0173\u1E77\u1E75\u0289"},{base:"v",letters:"v\u24E5\uFF56\u1E7D\u1E7F\u028B\uA75F\u028C"},{base:"vy",letters:"\uA761"},{base:"w",letters:"w\u24E6\uFF57\u1E81\u1E83\u0175\u1E87\u1E85\u1E98\u1E89\u2C73"},{base:"x",letters:"x\u24E7\uFF58\u1E8B\u1E8D"},{base:"y",letters:"y\u24E8\uFF59\u1EF3\xFD\u0177\u1EF9\u0233\u1E8F\xFF\u1EF7\u1E99\u1EF5\u01B4\u024F\u1EFF"},{base:"z",letters:"z\u24E9\uFF5A\u017A\u1E91\u017C\u017E\u1E93\u1E95\u01B6\u0225\u0240\u2C6C\uA763"}],z5=new RegExp("["+Jh.map(function(t){return t.letters}).join("")+"]","g"),Yw={};for(rm=0;rm<Jh.length;rm++)for(nm=Jh[rm],sm=0;sm<nm.letters.length;sm++)Yw[nm.letters[sm]]=nm.base;var nm,sm,rm,Zw=function(e){return e.replace(z5,function(o){return Yw[o]})},X5=Lw(Zw),kw=function(e){return e.replace(/^\s+|\s+$/g,"")},U5=function(e){return"".concat(e.label," ").concat(e.value)},Y5=function(e){return function(o,n){if(o.data.__isNew__)return!0;var r=_e({ignoreCase:!0,ignoreAccents:!0,stringify:U5,trim:!0,matchFrom:"any"},e),s=r.ignoreCase,i=r.ignoreAccents,l=r.stringify,a=r.trim,c=r.matchFrom,u=a?kw(n):n,d=a?kw(l(o)):l(o);return s&&(u=u.toLowerCase(),d=d.toLowerCase()),i&&(u=X5(u),d=Zw(d)),c==="start"?d.substr(0,u.length)===u:d.indexOf(u)>-1}},Z5=["innerRef"];function J5(t){var e=t.innerRef,o=Vo(t,Z5),n=ew(o,"onExited","in","enter","exit","appear");return Fe("input",Re({ref:e},n,{css:Xl({label:"dummyInput",background:0,border:0,caretColor:"transparent",fontSize:"inherit",gridArea:"1 / 1 / 2 / 3",outline:0,padding:0,width:1,color:"transparent",left:-100,opacity:0,position:"relative",transform:"scale(.01)"},"","")}))}var q5=function(e){e.cancelable&&e.preventDefault(),e.stopPropagation()};function Q5(t){var e=t.isEnabled,o=t.onBottomArrive,n=t.onBottomLeave,r=t.onTopArrive,s=t.onTopLeave,i=ua(!1),l=ua(!1),a=ua(0),c=ua(null),u=ss(function(g,b){if(c.current!==null){var v=c.current,x=v.scrollTop,y=v.scrollHeight,C=v.clientHeight,S=c.current,w=b>0,F=y-C-x,_=!1;F>b&&i.current&&(n&&n(g),i.current=!1),w&&l.current&&(s&&s(g),l.current=!1),w&&b>F?(o&&!i.current&&o(g),S.scrollTop=y,_=!0,i.current=!0):!w&&-b>x&&(r&&!l.current&&r(g),S.scrollTop=0,_=!0,l.current=!0),_&&q5(g)}},[o,n,r,s]),d=ss(function(g){u(g,g.deltaY)},[u]),f=ss(function(g){a.current=g.changedTouches[0].clientY},[]),m=ss(function(g){var b=a.current-g.changedTouches[0].clientY;u(g,b)},[u]),h=ss(function(g){if(g){var b=QC?{passive:!1}:!1;g.addEventListener("wheel",d,b),g.addEventListener("touchstart",f,b),g.addEventListener("touchmove",m,b)}},[m,f,d]),p=ss(function(g){g&&(g.removeEventListener("wheel",d,!1),g.removeEventListener("touchstart",f,!1),g.removeEventListener("touchmove",m,!1))},[m,f,d]);return Uw(function(){if(e){var g=c.current;return h(g),function(){p(g)}}},[e,h,p]),function(g){c.current=g}}var jw=["boxSizing","height","overflow","paddingRight","position"],Ow={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function Mw(t){t.cancelable&&t.preventDefault()}function Bw(t){t.stopPropagation()}function Vw(){var t=this.scrollTop,e=this.scrollHeight,o=t+this.offsetHeight;t===0?this.scrollTop=1:o===e&&(this.scrollTop=t-1)}function Gw(){return"ontouchstart"in window||navigator.maxTouchPoints}var Ww=!!(typeof window<"u"&&window.document&&window.document.createElement),Jl=0,ca={capture:!1,passive:!1};function K5(t){var e=t.isEnabled,o=t.accountForScrollbars,n=o===void 0?!0:o,r=ua({}),s=ua(null),i=ss(function(a){if(Ww){var c=document.body,u=c&&c.style;if(n&&jw.forEach(function(h){var p=u&&u[h];r.current[h]=p}),n&&Jl<1){var d=parseInt(r.current.paddingRight,10)||0,f=document.body?document.body.clientWidth:0,m=window.innerWidth-f+d||0;Object.keys(Ow).forEach(function(h){var p=Ow[h];u&&(u[h]=p)}),u&&(u.paddingRight="".concat(m,"px"))}c&&Gw()&&(c.addEventListener("touchmove",Mw,ca),a&&(a.addEventListener("touchstart",Vw,ca),a.addEventListener("touchmove",Bw,ca))),Jl+=1}},[n]),l=ss(function(a){if(Ww){var c=document.body,u=c&&c.style;Jl=Math.max(Jl-1,0),n&&Jl<1&&jw.forEach(function(d){var f=r.current[d];u&&(u[d]=f)}),c&&Gw()&&(c.removeEventListener("touchmove",Mw,ca),a&&(a.removeEventListener("touchstart",Vw,ca),a.removeEventListener("touchmove",Bw,ca)))}},[n]);return Uw(function(){if(e){var a=s.current;return i(a),function(){l(a)}}},[e,i,l]),function(a){s.current=a}}var eN=function(e){var o=e.target;return o.ownerDocument.activeElement&&o.ownerDocument.activeElement.blur()},tN={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function oN(t){var e=t.children,o=t.lockEnabled,n=t.captureEnabled,r=n===void 0?!0:n,s=t.onBottomArrive,i=t.onBottomLeave,l=t.onTopArrive,a=t.onTopLeave,c=Q5({isEnabled:r,onBottomArrive:s,onBottomLeave:i,onTopArrive:l,onTopLeave:a}),u=K5({isEnabled:o}),d=function(m){c(m),u(m)};return Fe(Zh,null,o&&Fe("div",{onClick:eN,css:tN}),e(d))}var rN={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},nN=function(e){var o=e.name,n=e.onFocus;return Fe("input",{required:!0,name:o,tabIndex:-1,"aria-hidden":"true",onFocus:n,css:rN,value:"",onChange:function(){}})},sN=nN;function qh(t){var e;return typeof window<"u"&&window.navigator!=null?t.test(((e=window.navigator.userAgentData)===null||e===void 0?void 0:e.platform)||window.navigator.platform):!1}function iN(){return qh(/^iPhone/i)}function Jw(){return qh(/^Mac/i)}function aN(){return qh(/^iPad/i)||Jw()&&navigator.maxTouchPoints>1}function lN(){return iN()||aN()}function cN(){return Jw()||lN()}var uN=function(e){return e.label},Qh=function(e){return e.label},Kh=function(e){return e.value},dN=function(e){return!!e.isDisabled},mN={clearIndicator:bw,container:uw,control:yw,dropdownIndicator:gw,group:Cw,groupHeading:ww,indicatorsContainer:mw,indicatorSeparator:vw,input:Sw,loadingIndicator:xw,loadingMessage:lw,menu:ow,menuList:sw,menuPortal:cw,multiValue:Rw,multiValueLabel:_w,multiValueRemove:Dw,noOptionsMessage:aw,option:Aw,placeholder:Tw,singleValue:Ew,valueContainer:dw};var fN={primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},pN=4,qw=4,hN=38,gN=qw*2,bN={baseUnit:qw,controlHeight:hN,menuGutter:gN},Uh={borderRadius:pN,colors:fN,spacing:bN},vN={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:zh(),captureMenuScroll:!zh(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:Y5(),formatGroupLabel:uN,getOptionLabel:Qh,getOptionValue:Kh,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:dN,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!JC(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(e){var o=e.count;return"".concat(o," result").concat(o!==1?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0,unstyled:!1};function Hw(t,e,o,n){var r=e2(t,e,o),s=t2(t,e,o),i=Kw(t,e),l=am(t,e);return{type:"option",data:e,isDisabled:r,isSelected:s,label:i,value:l,index:n}}function im(t,e){return t.options.map(function(o,n){if("options"in o){var r=o.options.map(function(i,l){return Hw(t,i,e,l)}).filter(function(i){return Xw(t,i)});return r.length>0?{type:"group",data:o,options:r,index:n}:void 0}var s=Hw(t,o,e,n);return Xw(t,s)?s:void 0}).filter(KC)}function Qw(t){return t.reduce(function(e,o){return o.type==="group"?e.push.apply(e,rs(o.options.map(function(n){return n.data}))):e.push(o.data),e},[])}function zw(t,e){return t.reduce(function(o,n){return n.type==="group"?o.push.apply(o,rs(n.options.map(function(r){return{data:r.data,id:"".concat(e,"-").concat(n.index,"-").concat(r.index)}}))):o.push({data:n.data,id:"".concat(e,"-").concat(n.index)}),o},[])}function xN(t,e){return Qw(im(t,e))}function Xw(t,e){var o=t.inputValue,n=o===void 0?"":o,r=e.data,s=e.isSelected,i=e.label,l=e.value;return(!r2(t)||!s)&&o2(t,{label:i,value:l,data:r},n)}function yN(t,e){var o=t.focusedValue,n=t.selectValue,r=n.indexOf(o);if(r>-1){var s=e.indexOf(o);if(s>-1)return o;if(r<e.length)return e[r]}return null}function CN(t,e){var o=t.focusedOption;return o&&e.indexOf(o)>-1?o:e[0]}var Yh=function(e,o){var n,r=(n=e.find(function(s){return s.data===o}))===null||n===void 0?void 0:n.id;return r||null},Kw=function(e,o){return e.getOptionLabel(o)},am=function(e,o){return e.getOptionValue(o)};function e2(t,e,o){return typeof t.isOptionDisabled=="function"?t.isOptionDisabled(e,o):!1}function t2(t,e,o){if(o.indexOf(e)>-1)return!0;if(typeof t.isOptionSelected=="function")return t.isOptionSelected(e,o);var n=am(t,e);return o.some(function(r){return am(t,r)===n})}function o2(t,e,o){return t.filterOption?t.filterOption(e,o):!0}var r2=function(e){var o=e.hideSelectedOptions,n=e.isMulti;return o===void 0?n:o},wN=1,ql=function(t){Uy(o,t);var e=Zy(o);function o(n){var r;if(Hy(this,o),r=e.call(this,n),r.state={ariaSelection:null,focusedOption:null,focusedOptionId:null,focusableOptionsWithIds:[],focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0,instancePrefix:""},r.blockOptionHover=!1,r.isComposing=!1,r.commonProps=void 0,r.initialTouchX=0,r.initialTouchY=0,r.openAfterFocus=!1,r.scrollToFocusedOptionOnUpdate=!1,r.userIsDragging=void 0,r.isAppleDevice=cN(),r.controlRef=null,r.getControlRef=function(a){r.controlRef=a},r.focusedOptionRef=null,r.getFocusedOptionRef=function(a){r.focusedOptionRef=a},r.menuListRef=null,r.getMenuListRef=function(a){r.menuListRef=a},r.inputRef=null,r.getInputRef=function(a){r.inputRef=a},r.focus=r.focusInput,r.blur=r.blurInput,r.onChange=function(a,c){var u=r.props,d=u.onChange,f=u.name;c.name=f,r.ariaOnChange(a,c),d(a,c)},r.setValue=function(a,c,u){var d=r.props,f=d.closeMenuOnSelect,m=d.isMulti,h=d.inputValue;r.onInputChange("",{action:"set-value",prevInputValue:h}),f&&(r.setState({inputIsHiddenAfterUpdate:!m}),r.onMenuClose()),r.setState({clearFocusValueOnUpdate:!0}),r.onChange(a,{action:c,option:u})},r.selectOption=function(a){var c=r.props,u=c.blurInputOnSelect,d=c.isMulti,f=c.name,m=r.state.selectValue,h=d&&r.isOptionSelected(a,m),p=r.isOptionDisabled(a,m);if(h){var g=r.getOptionValue(a);r.setValue(m.filter(function(b){return r.getOptionValue(b)!==g}),"deselect-option",a)}else if(!p)d?r.setValue([].concat(rs(m),[a]),"select-option",a):r.setValue(a,"select-option");else{r.ariaOnChange(a,{action:"select-option",option:a,name:f});return}u&&r.blurInput()},r.removeValue=function(a){var c=r.props.isMulti,u=r.state.selectValue,d=r.getOptionValue(a),f=u.filter(function(h){return r.getOptionValue(h)!==d}),m=ti(c,f,f[0]||null);r.onChange(m,{action:"remove-value",removedValue:a}),r.focusInput()},r.clearValue=function(){var a=r.state.selectValue;r.onChange(ti(r.props.isMulti,[],null),{action:"clear",removedValues:a})},r.popValue=function(){var a=r.props.isMulti,c=r.state.selectValue,u=c[c.length-1],d=c.slice(0,c.length-1),f=ti(a,d,d[0]||null);u&&r.onChange(f,{action:"pop-value",removedValue:u})},r.getFocusedOptionId=function(a){return Yh(r.state.focusableOptionsWithIds,a)},r.getFocusableOptionsWithIds=function(){return zw(im(r.props,r.state.selectValue),r.getElementId("option"))},r.getValue=function(){return r.state.selectValue},r.cx=function(){for(var a=arguments.length,c=new Array(a),u=0;u<a;u++)c[u]=arguments[u];return UC.apply(void 0,[r.props.classNamePrefix].concat(c))},r.getOptionLabel=function(a){return Kw(r.props,a)},r.getOptionValue=function(a){return am(r.props,a)},r.getStyles=function(a,c){var u=r.props.unstyled,d=mN[a](c,u);d.boxSizing="border-box";var f=r.props.styles[a];return f?f(d,c):d},r.getClassNames=function(a,c){var u,d;return(u=(d=r.props.classNames)[a])===null||u===void 0?void 0:u.call(d,c)},r.getElementId=function(a){return"".concat(r.state.instancePrefix,"-").concat(a)},r.getComponents=function(){return Pw(r.props)},r.buildCategorizedOptions=function(){return im(r.props,r.state.selectValue)},r.getCategorizedOptions=function(){return r.props.menuIsOpen?r.buildCategorizedOptions():[]},r.buildFocusableOptions=function(){return Qw(r.buildCategorizedOptions())},r.getFocusableOptions=function(){return r.props.menuIsOpen?r.buildFocusableOptions():[]},r.ariaOnChange=function(a,c){r.setState({ariaSelection:_e({value:a},c)})},r.onMenuMouseDown=function(a){a.button===0&&(a.stopPropagation(),a.preventDefault(),r.focusInput())},r.onMenuMouseMove=function(a){r.blockOptionHover=!1},r.onControlMouseDown=function(a){if(!a.defaultPrevented){var c=r.props.openMenuOnClick;r.state.isFocused?r.props.menuIsOpen?a.target.tagName!=="INPUT"&&a.target.tagName!=="TEXTAREA"&&r.onMenuClose():c&&r.openMenu("first"):(c&&(r.openAfterFocus=!0),r.focusInput()),a.target.tagName!=="INPUT"&&a.target.tagName!=="TEXTAREA"&&a.preventDefault()}},r.onDropdownIndicatorMouseDown=function(a){if(!(a&&a.type==="mousedown"&&a.button!==0)&&!r.props.isDisabled){var c=r.props,u=c.isMulti,d=c.menuIsOpen;r.focusInput(),d?(r.setState({inputIsHiddenAfterUpdate:!u}),r.onMenuClose()):r.openMenu("first"),a.preventDefault()}},r.onClearIndicatorMouseDown=function(a){a&&a.type==="mousedown"&&a.button!==0||(r.clearValue(),a.preventDefault(),r.openAfterFocus=!1,a.type==="touchend"?r.focusInput():setTimeout(function(){return r.focusInput()}))},r.onScroll=function(a){typeof r.props.closeMenuOnScroll=="boolean"?a.target instanceof HTMLElement&&Yl(a.target)&&r.props.onMenuClose():typeof r.props.closeMenuOnScroll=="function"&&r.props.closeMenuOnScroll(a)&&r.props.onMenuClose()},r.onCompositionStart=function(){r.isComposing=!0},r.onCompositionEnd=function(){r.isComposing=!1},r.onTouchStart=function(a){var c=a.touches,u=c&&c.item(0);u&&(r.initialTouchX=u.clientX,r.initialTouchY=u.clientY,r.userIsDragging=!1)},r.onTouchMove=function(a){var c=a.touches,u=c&&c.item(0);if(u){var d=Math.abs(u.clientX-r.initialTouchX),f=Math.abs(u.clientY-r.initialTouchY),m=5;r.userIsDragging=d>m||f>m}},r.onTouchEnd=function(a){r.userIsDragging||(r.controlRef&&!r.controlRef.contains(a.target)&&r.menuListRef&&!r.menuListRef.contains(a.target)&&r.blurInput(),r.initialTouchX=0,r.initialTouchY=0)},r.onControlTouchEnd=function(a){r.userIsDragging||r.onControlMouseDown(a)},r.onClearIndicatorTouchEnd=function(a){r.userIsDragging||r.onClearIndicatorMouseDown(a)},r.onDropdownIndicatorTouchEnd=function(a){r.userIsDragging||r.onDropdownIndicatorMouseDown(a)},r.handleInputChange=function(a){var c=r.props.inputValue,u=a.currentTarget.value;r.setState({inputIsHiddenAfterUpdate:!1}),r.onInputChange(u,{action:"input-change",prevInputValue:c}),r.props.menuIsOpen||r.onMenuOpen()},r.onInputFocus=function(a){r.props.onFocus&&r.props.onFocus(a),r.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(r.openAfterFocus||r.props.openMenuOnFocus)&&r.openMenu("first"),r.openAfterFocus=!1},r.onInputBlur=function(a){var c=r.props.inputValue;if(r.menuListRef&&r.menuListRef.contains(document.activeElement)){r.inputRef.focus();return}r.props.onBlur&&r.props.onBlur(a),r.onInputChange("",{action:"input-blur",prevInputValue:c}),r.onMenuClose(),r.setState({focusedValue:null,isFocused:!1})},r.onOptionHover=function(a){if(!(r.blockOptionHover||r.state.focusedOption===a)){var c=r.getFocusableOptions(),u=c.indexOf(a);r.setState({focusedOption:a,focusedOptionId:u>-1?r.getFocusedOptionId(a):null})}},r.shouldHideSelectedOptions=function(){return r2(r.props)},r.onValueInputFocus=function(a){a.preventDefault(),a.stopPropagation(),r.focus()},r.onKeyDown=function(a){var c=r.props,u=c.isMulti,d=c.backspaceRemovesValue,f=c.escapeClearsValue,m=c.inputValue,h=c.isClearable,p=c.isDisabled,g=c.menuIsOpen,b=c.onKeyDown,v=c.tabSelectsValue,x=c.openMenuOnFocus,y=r.state,C=y.focusedOption,S=y.focusedValue,w=y.selectValue;if(!p&&!(typeof b=="function"&&(b(a),a.defaultPrevented))){switch(r.blockOptionHover=!0,a.key){case"ArrowLeft":if(!u||m)return;r.focusValue("previous");break;case"ArrowRight":if(!u||m)return;r.focusValue("next");break;case"Delete":case"Backspace":if(m)return;if(S)r.removeValue(S);else{if(!d)return;u?r.popValue():h&&r.clearValue()}break;case"Tab":if(r.isComposing||a.shiftKey||!g||!v||!C||x&&r.isOptionSelected(C,w))return;r.selectOption(C);break;case"Enter":if(a.keyCode===229)break;if(g){if(!C||r.isComposing)return;r.selectOption(C);break}return;case"Escape":g?(r.setState({inputIsHiddenAfterUpdate:!1}),r.onInputChange("",{action:"menu-close",prevInputValue:m}),r.onMenuClose()):h&&f&&r.clearValue();break;case" ":if(m)return;if(!g){r.openMenu("first");break}if(!C)return;r.selectOption(C);break;case"ArrowUp":g?r.focusOption("up"):r.openMenu("last");break;case"ArrowDown":g?r.focusOption("down"):r.openMenu("first");break;case"PageUp":if(!g)return;r.focusOption("pageup");break;case"PageDown":if(!g)return;r.focusOption("pagedown");break;case"Home":if(!g)return;r.focusOption("first");break;case"End":if(!g)return;r.focusOption("last");break;default:return}a.preventDefault()}},r.state.instancePrefix="react-select-"+(r.props.instanceId||++wN),r.state.selectValue=la(n.value),n.menuIsOpen&&r.state.selectValue.length){var s=r.getFocusableOptionsWithIds(),i=r.buildFocusableOptions(),l=i.indexOf(r.state.selectValue[0]);r.state.focusableOptionsWithIds=s,r.state.focusedOption=i[l],r.state.focusedOptionId=Yh(s,i[l])}return r}return Xy(o,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput(),this.props.menuIsOpen&&this.state.focusedOption&&this.menuListRef&&this.focusedOptionRef&&Hh(this.menuListRef,this.focusedOptionRef)}},{key:"componentDidUpdate",value:function(r){var s=this.props,i=s.isDisabled,l=s.menuIsOpen,a=this.state.isFocused;(a&&!i&&r.isDisabled||a&&l&&!r.menuIsOpen)&&this.focusInput(),a&&i&&!r.isDisabled?this.setState({isFocused:!1},this.onMenuClose):!a&&!i&&r.isDisabled&&this.inputRef===document.activeElement&&this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(Hh(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){this.onInputChange("",{action:"menu-close",prevInputValue:this.props.inputValue}),this.props.onMenuClose()}},{key:"onInputChange",value:function(r,s){this.props.onInputChange(r,s)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(r){var s=this,i=this.state,l=i.selectValue,a=i.isFocused,c=this.buildFocusableOptions(),u=r==="first"?0:c.length-1;if(!this.props.isMulti){var d=c.indexOf(l[0]);d>-1&&(u=d)}this.scrollToFocusedOptionOnUpdate=!(a&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:c[u],focusedOptionId:this.getFocusedOptionId(c[u])},function(){return s.onMenuOpen()})}},{key:"focusValue",value:function(r){var s=this.state,i=s.selectValue,l=s.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var a=i.indexOf(l);l||(a=-1);var c=i.length-1,u=-1;if(i.length){switch(r){case"previous":a===0?u=0:a===-1?u=c:u=a-1;break;case"next":a>-1&&a<c&&(u=a+1);break}this.setState({inputIsHidden:u!==-1,focusedValue:i[u]})}}}},{key:"focusOption",value:function(){var r=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"first",s=this.props.pageSize,i=this.state.focusedOption,l=this.getFocusableOptions();if(l.length){var a=0,c=l.indexOf(i);i||(c=-1),r==="up"?a=c>0?c-1:l.length-1:r==="down"?a=(c+1)%l.length:r==="pageup"?(a=c-s,a<0&&(a=0)):r==="pagedown"?(a=c+s,a>l.length-1&&(a=l.length-1)):r==="last"&&(a=l.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:l[a],focusedValue:null,focusedOptionId:this.getFocusedOptionId(l[a])})}}},{key:"getTheme",value:function(){return this.props.theme?typeof this.props.theme=="function"?this.props.theme(Uh):_e(_e({},Uh),this.props.theme):Uh}},{key:"getCommonProps",value:function(){var r=this.clearValue,s=this.cx,i=this.getStyles,l=this.getClassNames,a=this.getValue,c=this.selectOption,u=this.setValue,d=this.props,f=d.isMulti,m=d.isRtl,h=d.options,p=this.hasValue();return{clearValue:r,cx:s,getStyles:i,getClassNames:l,getValue:a,hasValue:p,isMulti:f,isRtl:m,options:h,selectOption:c,selectProps:d,setValue:u,theme:this.getTheme()}}},{key:"hasValue",value:function(){var r=this.state.selectValue;return r.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var r=this.props,s=r.isClearable,i=r.isMulti;return s===void 0?i:s}},{key:"isOptionDisabled",value:function(r,s){return e2(this.props,r,s)}},{key:"isOptionSelected",value:function(r,s){return t2(this.props,r,s)}},{key:"filterOption",value:function(r,s){return o2(this.props,r,s)}},{key:"formatOptionLabel",value:function(r,s){if(typeof this.props.formatOptionLabel=="function"){var i=this.props.inputValue,l=this.state.selectValue;return this.props.formatOptionLabel(r,{context:s,inputValue:i,selectValue:l})}else return this.getOptionLabel(r)}},{key:"formatGroupLabel",value:function(r){return this.props.formatGroupLabel(r)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:function(){var r=this.props,s=r.isDisabled,i=r.isSearchable,l=r.inputId,a=r.inputValue,c=r.tabIndex,u=r.form,d=r.menuIsOpen,f=r.required,m=this.getComponents(),h=m.Input,p=this.state,g=p.inputIsHidden,b=p.ariaSelection,v=this.commonProps,x=l||this.getElementId("input"),y=_e(_e(_e({"aria-autocomplete":"list","aria-expanded":d,"aria-haspopup":!0,"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props["aria-invalid"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-required":f,role:"combobox","aria-activedescendant":this.isAppleDevice?void 0:this.state.focusedOptionId||""},d&&{"aria-controls":this.getElementId("listbox")}),!i&&{"aria-readonly":!0}),this.hasValue()?b?.action==="initial-input-focus"&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return i?ut.createElement(h,Re({},v,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:x,innerRef:this.getInputRef,isDisabled:s,isHidden:g,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:c,form:u,type:"text",value:a},y)):ut.createElement(J5,Re({id:x,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:Ul,onFocus:this.onInputFocus,disabled:s,tabIndex:c,inputMode:"none",form:u,value:""},y))}},{key:"renderPlaceholderOrValue",value:function(){var r=this,s=this.getComponents(),i=s.MultiValue,l=s.MultiValueContainer,a=s.MultiValueLabel,c=s.MultiValueRemove,u=s.SingleValue,d=s.Placeholder,f=this.commonProps,m=this.props,h=m.controlShouldRenderValue,p=m.isDisabled,g=m.isMulti,b=m.inputValue,v=m.placeholder,x=this.state,y=x.selectValue,C=x.focusedValue,S=x.isFocused;if(!this.hasValue()||!h)return b?null:ut.createElement(d,Re({},f,{key:"placeholder",isDisabled:p,isFocused:S,innerProps:{id:this.getElementId("placeholder")}}),v);if(g)return y.map(function(F,_){var A=F===C,R="".concat(r.getOptionLabel(F),"-").concat(r.getOptionValue(F));return ut.createElement(i,Re({},f,{components:{Container:l,Label:a,Remove:c},isFocused:A,isDisabled:p,key:R,index:_,removeProps:{onClick:function(){return r.removeValue(F)},onTouchEnd:function(){return r.removeValue(F)},onMouseDown:function(D){D.preventDefault()}},data:F}),r.formatOptionLabel(F,"value"))});if(b)return null;var w=y[0];return ut.createElement(u,Re({},f,{data:w,isDisabled:p}),this.formatOptionLabel(w,"value"))}},{key:"renderClearIndicator",value:function(){var r=this.getComponents(),s=r.ClearIndicator,i=this.commonProps,l=this.props,a=l.isDisabled,c=l.isLoading,u=this.state.isFocused;if(!this.isClearable()||!s||a||!this.hasValue()||c)return null;var d={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return ut.createElement(s,Re({},i,{innerProps:d,isFocused:u}))}},{key:"renderLoadingIndicator",value:function(){var r=this.getComponents(),s=r.LoadingIndicator,i=this.commonProps,l=this.props,a=l.isDisabled,c=l.isLoading,u=this.state.isFocused;if(!s||!c)return null;var d={"aria-hidden":"true"};return ut.createElement(s,Re({},i,{innerProps:d,isDisabled:a,isFocused:u}))}},{key:"renderIndicatorSeparator",value:function(){var r=this.getComponents(),s=r.DropdownIndicator,i=r.IndicatorSeparator;if(!s||!i)return null;var l=this.commonProps,a=this.props.isDisabled,c=this.state.isFocused;return ut.createElement(i,Re({},l,{isDisabled:a,isFocused:c}))}},{key:"renderDropdownIndicator",value:function(){var r=this.getComponents(),s=r.DropdownIndicator;if(!s)return null;var i=this.commonProps,l=this.props.isDisabled,a=this.state.isFocused,c={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return ut.createElement(s,Re({},i,{innerProps:c,isDisabled:l,isFocused:a}))}},{key:"renderMenu",value:function(){var r=this,s=this.getComponents(),i=s.Group,l=s.GroupHeading,a=s.Menu,c=s.MenuList,u=s.MenuPortal,d=s.LoadingMessage,f=s.NoOptionsMessage,m=s.Option,h=this.commonProps,p=this.state.focusedOption,g=this.props,b=g.captureMenuScroll,v=g.inputValue,x=g.isLoading,y=g.loadingMessage,C=g.minMenuHeight,S=g.maxMenuHeight,w=g.menuIsOpen,F=g.menuPlacement,_=g.menuPosition,A=g.menuPortalTarget,R=g.menuShouldBlockScroll,I=g.menuShouldScrollIntoView,D=g.noOptionsMessage,E=g.onMenuScrollToTop,T=g.onMenuScrollToBottom;if(!w)return null;var L=function(O,V){var G=O.type,z=O.data,X=O.isDisabled,te=O.isSelected,Y=O.label,H=O.value,le=p===z,q=X?void 0:function(){return r.onOptionHover(z)},fe=X?void 0:function(){return r.selectOption(z)},ae="".concat(r.getElementId("option"),"-").concat(V),J={id:ae,onClick:fe,onMouseMove:q,onMouseOver:q,tabIndex:-1,role:"option","aria-selected":r.isAppleDevice?void 0:te};return ut.createElement(m,Re({},h,{innerProps:J,data:z,isDisabled:X,isSelected:te,key:ae,label:Y,type:G,value:H,isFocused:le,innerRef:le?r.getFocusedOptionRef:void 0}),r.formatOptionLabel(O.data,"menu"))},k;if(this.hasOptions())k=this.getCategorizedOptions().map(function(M){if(M.type==="group"){var O=M.data,V=M.options,G=M.index,z="".concat(r.getElementId("group"),"-").concat(G),X="".concat(z,"-heading");return ut.createElement(i,Re({},h,{key:z,data:O,options:V,Heading:l,headingProps:{id:X,data:M.data},label:r.formatGroupLabel(M.data)}),M.options.map(function(te){return L(te,"".concat(G,"-").concat(te.index))}))}else if(M.type==="option")return L(M,"".concat(M.index))});else if(x){var j=y({inputValue:v});if(j===null)return null;k=ut.createElement(d,h,j)}else{var P=D({inputValue:v});if(P===null)return null;k=ut.createElement(f,h,P)}var N={minMenuHeight:C,maxMenuHeight:S,menuPlacement:F,menuPosition:_,menuShouldScrollIntoView:I},B=ut.createElement(nw,Re({},h,N),function(M){var O=M.ref,V=M.placerProps,G=V.placement,z=V.maxHeight;return ut.createElement(a,Re({},h,N,{innerRef:O,innerProps:{onMouseDown:r.onMenuMouseDown,onMouseMove:r.onMenuMouseMove},isLoading:x,placement:G}),ut.createElement(oN,{captureEnabled:b,onTopArrive:E,onBottomArrive:T,lockEnabled:R},function(X){return ut.createElement(c,Re({},h,{innerRef:function(Y){r.getMenuListRef(Y),X(Y)},innerProps:{role:"listbox","aria-multiselectable":h.isMulti,id:r.getElementId("listbox")},isLoading:x,maxHeight:z,focusedOption:p}),k)}))});return A||_==="fixed"?ut.createElement(u,Re({},h,{appendTo:A,controlElement:this.controlRef,menuPlacement:F,menuPosition:_}),B):B}},{key:"renderFormField",value:function(){var r=this,s=this.props,i=s.delimiter,l=s.isDisabled,a=s.isMulti,c=s.name,u=s.required,d=this.state.selectValue;if(u&&!this.hasValue()&&!l)return ut.createElement(sN,{name:c,onFocus:this.onValueInputFocus});if(!(!c||l))if(a)if(i){var f=d.map(function(p){return r.getOptionValue(p)}).join(i);return ut.createElement("input",{name:c,type:"hidden",value:f})}else{var m=d.length>0?d.map(function(p,g){return ut.createElement("input",{key:"i-".concat(g),name:c,type:"hidden",value:r.getOptionValue(p)})}):ut.createElement("input",{name:c,type:"hidden",value:""});return ut.createElement("div",null,m)}else{var h=d[0]?this.getOptionValue(d[0]):"";return ut.createElement("input",{name:c,type:"hidden",value:h})}}},{key:"renderLiveRegion",value:function(){var r=this.commonProps,s=this.state,i=s.ariaSelection,l=s.focusedOption,a=s.focusedValue,c=s.isFocused,u=s.selectValue,d=this.getFocusableOptions();return ut.createElement(H5,Re({},r,{id:this.getElementId("live-region"),ariaSelection:i,focusedOption:l,focusedValue:a,isFocused:c,selectValue:u,focusableOptions:d,isAppleDevice:this.isAppleDevice}))}},{key:"render",value:function(){var r=this.getComponents(),s=r.Control,i=r.IndicatorsContainer,l=r.SelectContainer,a=r.ValueContainer,c=this.props,u=c.className,d=c.id,f=c.isDisabled,m=c.menuIsOpen,h=this.state.isFocused,p=this.commonProps=this.getCommonProps();return ut.createElement(l,Re({},p,{className:u,innerProps:{id:d,onKeyDown:this.onKeyDown},isDisabled:f,isFocused:h}),this.renderLiveRegion(),ut.createElement(s,Re({},p,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:f,isFocused:h,menuIsOpen:m}),ut.createElement(a,Re({},p,{isDisabled:f}),this.renderPlaceholderOrValue(),this.renderInput()),ut.createElement(i,Re({},p,{isDisabled:f}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(r,s){var i=s.prevProps,l=s.clearFocusValueOnUpdate,a=s.inputIsHiddenAfterUpdate,c=s.ariaSelection,u=s.isFocused,d=s.prevWasFocused,f=s.instancePrefix,m=r.options,h=r.value,p=r.menuIsOpen,g=r.inputValue,b=r.isMulti,v=la(h),x={};if(i&&(h!==i.value||m!==i.options||p!==i.menuIsOpen||g!==i.inputValue)){var y=p?xN(r,v):[],C=p?zw(im(r,v),"".concat(f,"-option")):[],S=l?yN(s,v):null,w=CN(s,y),F=Yh(C,w);x={selectValue:v,focusedOption:w,focusedOptionId:F,focusableOptionsWithIds:C,focusedValue:S,clearFocusValueOnUpdate:!1}}var _=a!=null&&r!==i?{inputIsHidden:a,inputIsHiddenAfterUpdate:void 0}:{},A=c,R=u&&d;return u&&!R&&(A={value:ti(b,v,v[0]||null),options:v,action:"initial-input-focus"},R=!d),c?.action==="initial-input-focus"&&(A=null),_e(_e(_e({},x),_),{},{prevProps:r,ariaSelection:A,prevWasFocused:R})}}]),o}(M5);ql.defaultProps=vN;import"react-dom";var IN=SN(function(t,e){var o=Td(t);return n2.createElement(ql,Re({ref:e},o))}),s2=IN;import*as c2 from"react";import{forwardRef as DN}from"react";import{useMemo as i2,useCallback as RN}from"react";var _N=["allowCreateWhileLoading","createOptionPosition","formatCreateLabel","isValidNewOption","getNewOptionData","onCreateOption","options","onChange"],a2=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",o=arguments.length>1?arguments[1]:void 0,n=arguments.length>2?arguments[2]:void 0,r=String(e).toLowerCase(),s=String(n.getOptionValue(o)).toLowerCase(),i=String(n.getOptionLabel(o)).toLowerCase();return s===r||i===r},eg={formatCreateLabel:function(e){return'Create "'.concat(e,'"')},isValidNewOption:function(e,o,n,r){return!(!e||o.some(function(s){return a2(e,s,r)})||n.some(function(s){return a2(e,s,r)}))},getNewOptionData:function(e,o){return{label:o,value:e,__isNew__:!0}}};function l2(t){var e=t.allowCreateWhileLoading,o=e===void 0?!1:e,n=t.createOptionPosition,r=n===void 0?"last":n,s=t.formatCreateLabel,i=s===void 0?eg.formatCreateLabel:s,l=t.isValidNewOption,a=l===void 0?eg.isValidNewOption:l,c=t.getNewOptionData,u=c===void 0?eg.getNewOptionData:c,d=t.onCreateOption,f=t.options,m=f===void 0?[]:f,h=t.onChange,p=Vo(t,_N),g=p.getOptionValue,b=g===void 0?Kh:g,v=p.getOptionLabel,x=v===void 0?Qh:v,y=p.inputValue,C=p.isLoading,S=p.isMulti,w=p.value,F=p.name,_=i2(function(){return a(y,la(w),m,{getOptionValue:b,getOptionLabel:x})?u(y,i(y)):void 0},[i,u,x,b,y,a,m,w]),A=i2(function(){return(o||!C)&&_?r==="first"?[_].concat(rs(m)):[].concat(rs(m),[_]):m},[o,r,C,_,m]),R=RN(function(I,D){if(D.action!=="select-option")return h(I,D);var E=Array.isArray(I)?I:[I];if(E[E.length-1]===_){if(d)d(y);else{var T=u(y,y),L={action:"create-option",name:F,option:T};h(ti(S,[].concat(rs(la(w)),[T]),T),L)}return}h(I,D)},[u,y,S,F,_,d,h,w]);return _e(_e({},p),{},{options:A,onChange:R})}import"react-dom";var FN=DN(function(t,e){var o=Td(t),n=l2(o);return c2.createElement(ql,Re({ref:e},n))}),u2=FN;import{jsx as d2}from"react/jsx-runtime";import"react";var m2="clear-indicator",tg=t=>{let{clearValue:e,innerProps:{ref:o,...n}}=t;return d2("div",{className:m2,ref:typeof o=="string"?null:o,...n,onKeyDown:r=>{r.key==="Enter"&&(e(),r.stopPropagation())},role:"button",tabIndex:0,children:d2(pt,{className:`${m2}__icon`})})};import{jsx as f2}from"react/jsx-runtime";import AN from"react";var og=t=>{let{children:e,innerProps:o,selectProps:{customProps:{disableKeyDown:n,disableMouseDown:r}={}}={}}=t;return f2(AN.Fragment,{children:f2(uo.Control,{...t,innerProps:{...o,onKeyDown:s=>{if(n){s.stopPropagation();let i=new CustomEvent("bypassKeyDown",{detail:s});document.dispatchEvent(i)}},onMouseDown:s=>{r||o.onMouseDown(s)}},children:e})})};import{jsx as p2}from"react/jsx-runtime";import"react";var h2="dropdown-indicator",rg=t=>{let{innerProps:{ref:e,...o}}=t;return p2("button",{className:h2,ref:e,...o,onKeyDown:n=>{n.key==="Enter"&&(n.key=" ")},type:"button",children:p2(Ze,{className:`${h2}__icon`})})};import{jsx as g2}from"react/jsx-runtime";import TN from"react";var ng=t=>g2(TN.Fragment,{children:g2(uo.Input,{...t,"aria-activedescendant":void 0})});import{c as EN}from"react/compiler-runtime";import{jsx as b2}from"react/jsx-runtime";import PN from"react";var v2="multi-value";function sg(t,e){return typeof e=="function"?e(t):t.value}var ig=t=>{let e=EN(26),{className:o,data:n,innerProps:r,isDisabled:s,selectProps:i}=t,l;e[0]!==i?(l=i===void 0?{}:i,e[0]=i,e[1]=l):l=e[1];let{customProps:a,getOptionValue:c,isSortable:u}=l,d;e[2]!==a?(d=a===void 0?{}:a,e[2]=a,e[3]=d):d=e[3];let{disableMouseDown:f}=d,m;e[4]!==n||e[5]!==c?(m=sg(n,c),e[4]=n,e[5]=c,e[6]=m):m=e[6];let h=!u,p;e[7]!==m||e[8]!==h?(p={id:m,disabled:h},e[7]=m,e[8]=h,e[9]=p):p=e[9];let{attributes:g,isDragging:b,listeners:v,setNodeRef:x,transform:y}=ji(p),C=!s&&u&&"draggable",S=b&&`${v2}--is-dragging`,w;e[10]!==o||e[11]!==C||e[12]!==S?(w=[v2,o,C,S].filter(Boolean),e[10]=o,e[11]=C,e[12]=S,e[13]=w):w=e[13];let F=w.join(" "),_;if(e[14]!==g||e[15]!==F||e[16]!==f||e[17]!==r||e[18]!==u||e[19]!==v||e[20]!==t||e[21]!==x||e[22]!==y){let A;e[24]!==f?(A=R=>{f||R.stopPropagation()},e[24]=f,e[25]=A):A=e[25],_=b2(PN.Fragment,{children:b2(uo.MultiValue,{...t,className:F,innerProps:{...u?{...g,...v}:{},...r,onMouseDown:A,ref:x,style:u?{transform:y,...g?.style}:{}}})}),e[14]=g,e[15]=F,e[16]=f,e[17]=r,e[18]=u,e[19]=v,e[20]=t,e[21]=x,e[22]=y,e[23]=_}else _=e[23];return _};import{jsx as x2}from"react/jsx-runtime";import"react";var y2="multi-value-label",ag=t=>{let{data:e,selectProps:{customProps:{draggableProps:o,editableProps:n}={}}={}}=t,r=`${y2}__text`;return x2("div",{className:y2,children:x2(uo.MultiValueLabel,{...t,innerProps:{className:r,...n&&n(e,r,t.selectProps)||{},...o||{}}})})};import{c as NN}from"react/compiler-runtime";import{jsx as C2,jsxs as LN}from"react/jsx-runtime";import $N from"react";var lg="multi-value-remove",cg=t=>{let e=NN(12),{innerProps:o}=t,{className:n,onClick:r,onTouchEnd:s}=o,[i,l]=$N.useState(!1),{t:a}=$(),c;if(e[0]!==n||e[1]!==r||e[2]!==s||e[3]!==i||e[4]!==a){let u=a("general:remove"),d;e[6]!==n?(d=[lg,n].filter(Boolean),e[6]=n,e[7]=d):d=e[7];let f;e[8]!==r?(f=p=>{l(!1),r(p)},e[8]=r,e[9]=f):f=e[9];let m,h;e[10]===Symbol.for("react.memo_cache_sentinel")?(m=()=>l(!0),h=()=>l(!1),e[10]=m,e[11]=h):(m=e[10],h=e[11]),c=LN("button",{"aria-label":u,className:d.join(" "),onClick:f,onKeyDown:kN,onMouseDown:jN,onMouseEnter:m,onMouseLeave:h,onTouchEnd:s,type:"button",children:[C2(go,{className:`${lg}__tooltip`,show:i,children:a("general:remove")}),C2(pt,{className:`${lg}__icon`})]}),e[0]=n,e[1]=r,e[2]=s,e[3]=i,e[4]=a,e[5]=c}else c=e[5];return c};function kN(t){t.key==="Enter"&&t.stopPropagation()}function jN(t){return t.stopPropagation()}import{jsx as w2}from"react/jsx-runtime";import ON from"react";var MN="react-select--single-value",ug=t=>{let{children:e,className:o}=t;return w2(ON.Fragment,{children:w2(uo.SingleValue,{...t,className:[MN,o].filter(Boolean).join(" "),children:e})})};import{jsx as S2}from"react/jsx-runtime";import"react";var BN="value-container",dg=t=>{let{selectProps:{customProps:e}={}}=t;return S2("div",{className:BN,ref:e?.droppableRef,children:S2(uo.ValueContainer,{...t})})};var WN=t=>({label:t,value:t}),_2=t=>{let{i18n:e,t:o}=$(),[n,r]=R2.useState(""),s=GN(),[i,l]=R2.useState(!1);VN(()=>{l(!0)},[]);let{className:a,components:c,customProps:u,disabled:d=!1,filterOption:f=void 0,getOptionValue:m,isClearable:h=!0,isCreatable:p,isLoading:g,isSearchable:b=!0,noOptionsMessage:v=()=>o("general:noOptions"),numberOnly:x=!1,onChange:y,onMenuClose:C,onMenuOpen:S,options:w,placeholder:F=o("general:selectValue"),showError:_,value:A}=t,R=()=>o("general:loading")+"...",I=[a,"react-select",_&&"react-select--error"].filter(Boolean).join(" "),D={menu:T=>({...T,zIndex:void 0})};if(!i)return oi(It,{height:"calc(var(--base) * 2 + 2px)"});if(!p)return oi(s2,{captureMenuScroll:!0,customProps:u,isLoading:g,...t,className:I,classNamePrefix:"rs",components:{ClearIndicator:tg,Control:og,DropdownIndicator:rg,Input:ng,MultiValue:ig,MultiValueLabel:ag,MultiValueRemove:cg,SingleValue:ug,ValueContainer:dg,...c},filterOption:f,getOptionValue:m,instanceId:s,isClearable:h,isDisabled:d,isSearchable:b,loadingMessage:R,menuPlacement:"auto",noOptionsMessage:v,onChange:y,onMenuClose:C,onMenuOpen:S,options:w,placeholder:I2(F,e),styles:D,unstyled:!0,value:A});let E=T=>{if(x===!0){let L=["Tab","Escape","Backspace","Enter","ArrowRight","ArrowLeft","ArrowUp","ArrowDown"],k=!/\D/.test(T.key),j=L.includes(T.key);if(!k&&!j){T.preventDefault();return}}if(!(!A||!n||n.trim()==="")&&!(f&&!f(null,n)))switch(T.key){case"Enter":case"Tab":y([...A,WN(n)]),r(""),T.preventDefault();break;default:break}};return oi(u2,{captureMenuScroll:!0,isLoading:g,...t,className:I,classNamePrefix:"rs",components:{ClearIndicator:tg,Control:og,DropdownIndicator:rg,Input:ng,MultiValue:ig,MultiValueLabel:ag,MultiValueRemove:cg,SingleValue:ug,ValueContainer:dg,...c},filterOption:f,inputValue:n,instanceId:s,isClearable:h,isDisabled:d,isSearchable:b,loadingMessage:R,menuPlacement:"auto",noOptionsMessage:v,onChange:y,onInputChange:T=>r(T),onKeyDown:E,onMenuClose:C,onMenuOpen:S,options:w,placeholder:I2(F,e),styles:D,unstyled:!0,value:A})},HN=t=>{let{getOptionValue:e,onChange:o,value:n}=t,r=[];return n&&(r=(Array.isArray(n)?n:[n]).map(s=>sg(s,e))),oi(ur,{className:"react-select-container",ids:r,onDragEnd:({moveFromIndex:s,moveToIndex:i})=>{let l=n;n&&Array.isArray(n)&&(l=Xu(n,s,i)),o(l)},children:oi(_2,{...t})})},ft=t=>{let{isMulti:e,isSortable:o}=t;return e&&o?oi(HN,{...t}):oi(_2,{...t})};var Ql=t=>t.map(e=>typeof e=="object"&&(e.value||e.value==="")?e:{label:e,value:e});var Kl=t=>{let{id:e,onChange:o,options:n,required:r,selectedTimezone:s}=t,{t:i}=$(),l=Ql(n),a=XN(()=>l.find(c=>(typeof c=="string"?c:c.value)===(s||"UTC")),[l,s]);return zN("div",{className:"timezone-picker-wrapper",children:[D2(ye,{htmlFor:e,label:`${i("general:timezone")} ${r?"*":""}`,required:r,unstyled:!0}),D2(ft,{className:"timezone-picker",inputId:e,isClearable:!0,isCreatable:!1,onChange:c=>{o&&o(c?.value||"")},options:l,value:a})]})};var T2="date-time-field",YN=t=>{let{field:e,field:{admin:{className:o,date:n,description:r,placeholder:s}={},label:i,localized:l,required:a,timezone:c},path:u,readOnly:d,validate:f}=t,m=n?.pickerAppearance||"default",h=Intl.DateTimeFormat().resolvedOptions().timeZone,{config:p}=W(),{i18n:g}=$(),{dispatchFields:b,setModified:v}=Me(),x=mg((O,V)=>{if(typeof f=="function")return f(O,{...V,required:a})},[f,a]),{customComponents:{AfterInput:y,BeforeInput:C,Description:S,Error:w,Label:F}={},disabled:_,path:A,setValue:R,showError:I,value:D}=Ne({potentiallyStalePath:u,validate:x}),E=A+"_tz",T=Nt(([O,V])=>O?.[E]),L=p.admin.timezones.supportedTimezones,k=["dayOnly","default","monthOnly"].includes(m),j=T?.value,P=A2(()=>{if(c&&j&&h&&D){let O=Mt.tz(j),V=Mt.tz(h),G=new Mt(D).withTimeZone(j),z=Ar(G,O);return Ar(z,V).toISOString()}return D},[c,j,D,h]),N=A2(()=>rt(e),[e]),B=mg(O=>{if(!(d||_))if(c&&j&&O){let V=Mt.tz(j);if(k){let G=O.getTimezoneOffset()/60,z=O.getHours()+G;O.setHours(z);let X=Ar(O,V);R(X.toISOString()||null)}else{let G=new Mt(O),z=Ar(G,V);R(z.toISOString()||null)}}else R(O?.toISOString()||null)},[d,_,c,j,k,R]),M=mg(O=>{E&&(b({type:"UPDATE",path:E,value:O}),v(!0))},[b,v,E]);return F2("div",{className:[Ie,T2,o,I&&`${T2}--has-error`,(d||_)&&"read-only"].filter(Boolean).join(" "),style:N,children:[is(oe,{CustomComponent:F,Fallback:is(ye,{label:i,localized:l,required:a})}),F2("div",{className:`${Ie}__wrap`,id:`field-${A.replace(/\./g,"__")}`,children:[is(oe,{CustomComponent:w,Fallback:is(We,{path:A,showError:I})}),C,is(Ji,{...n,onChange:B,overrides:{...n?.overrides},placeholder:UN(s,g),readOnly:d||_,value:P}),c&&L.length>0&&is(Kl,{id:`${A}-timezone-picker`,onChange:M,options:L,required:a,selectedTimezone:j}),y]}),is(oe,{CustomComponent:S,Fallback:is(Ve,{description:r,path:A})})]})},ec=Oe(YN);import{jsx as ri,jsxs as E2}from"react/jsx-runtime";import{getTranslation as ZN}from"@payloadcms/translations";import{useCallback as JN,useMemo as qN}from"react";var QN=t=>{let{field:e,field:{admin:{autoComplete:o,className:n,description:r,placeholder:s}={},label:i,localized:l,required:a}={},path:c,readOnly:u,validate:d}=t,{i18n:f}=$(),m=JN((_,A)=>{if(typeof d=="function")return d(_,{...A,required:a})},[d,a]),{customComponents:{AfterInput:h,BeforeInput:p,Description:g,Error:b,Label:v}={},disabled:x,path:y,setValue:C,showError:S,value:w}=Ne({potentiallyStalePath:c,validate:m}),F=qN(()=>rt(e),[e]);return E2("div",{className:[Ie,"email",n,S&&"error",(u||x)&&"read-only"].filter(Boolean).join(" "),style:F,children:[ri(oe,{CustomComponent:v,Fallback:ri(ye,{label:i,localized:l,path:y,required:a})}),E2("div",{className:`${Ie}__wrap`,children:[ri(oe,{CustomComponent:b,Fallback:ri(We,{path:y,showError:S})}),p,ri("input",{autoComplete:o,disabled:u||x,id:`field-${y.replace(/\./g,"__")}`,name:y,onChange:C,placeholder:ZN(s,f),required:a,type:"email",value:w||""}),h]}),ri(oe,{CustomComponent:g,Fallback:ri(Ve,{description:r,path:y})})]})},ni=Oe(QN);import{jsx as as,jsxs as lm}from"react/jsx-runtime";import{getTranslation as l9}from"@payloadcms/translations";import{useMemo as c9}from"react";import{jsx as KN}from"react/jsx-runtime";import{createContext as e9,use as t9}from"react";var P2=e9(!1),N2=({children:t,withinRow:e=!0})=>KN(P2,{value:e,children:t}),L2=()=>t9(P2);import{jsx as o9}from"react/jsx-runtime";import{createContext as r9,use as n9}from"react";var $2=r9(!1),fg=({children:t,withinTab:e=!0})=>o9($2,{value:e,children:t}),k2=()=>n9($2);import{jsx as s9}from"react/jsx-runtime";import{createContext as i9,use as a9}from"react";var j2=i9(!1),O2=({children:t,withinGroup:e=!0})=>s9(j2,{value:e,children:t}),M2=()=>a9(j2);var kr="group-field",u9=t=>{let{field:e,field:{name:o,admin:{className:n,description:r,hideGutter:s}={},fields:i,label:l},path:a,permissions:c,readOnly:u,schemaPath:d}=t,f=d??o,{i18n:m}=$(),{isWithinCollapsible:h}=Kn(),p=M2(),g=L2(),b=k2(),{customComponents:{AfterInput:v,BeforeInput:x,Description:y,Label:C}={},errorPaths:S}=Ne({path:a}),w=Xt(),F=S.length,_=w&&F>0,A=!(h||p||g),R=c9(()=>rt(e),[e]);return lm("div",{className:[Ie,kr,A&&`${kr}--top-level`,h&&`${kr}--within-collapsible`,p&&`${kr}--within-group`,g&&`${kr}--within-row`,b&&`${kr}--within-tab`,!s&&p&&`${kr}--gutter`,_&&`${kr}--has-error`,n].filter(Boolean).join(" "),id:`field-${a?.replace(/\./g,"__")}`,style:R,children:[as(O2,{children:lm("div",{className:`${kr}__wrap`,children:[!!(C||y||l||_)&&lm("div",{className:`${kr}__header`,children:[!!(C||y||l)&&lm("header",{children:[as(oe,{CustomComponent:C,Fallback:as("h3",{className:`${kr}__title`,children:as(ye,{as:"span",label:l9(l,m),localized:!1,path:a,required:!1})})}),as(oe,{CustomComponent:y,Fallback:as(Ve,{description:r,path:a})})]}),_&&as(ao,{count:F,i18n:m,withMessage:!0})]}),x,as(So,{fields:i,margins:"small",parentIndexPath:"",parentPath:a,parentSchemaPath:f,permissions:c===!0?c:c?.fields,readOnly:u})]})}),v]})};var tc=Oe(u9);import{c as d9}from"react/compiler-runtime";import{jsx as m9}from"react/jsx-runtime";import{useEffect as f9}from"react";var p9=t=>{let e=d9(12),{disableModifyingForm:o,path:n,value:r}=t,s=o===void 0?!0:o,i;e[0]!==n?(i={potentiallyStalePath:n},e[0]=n,e[1]=i):i=e[1];let{path:l,setValue:a,value:c}=Ne(i),u,d;e[2]!==s||e[3]!==a||e[4]!==r?(u=()=>{r!==void 0&&a(r,s)},d=[r,a,s],e[2]=s,e[3]=a,e[4]=r,e[5]=u,e[6]=d):(u=e[5],d=e[6]),f9(u,d);let f=`field-${l?.replace(/\./g,"__")}`,m=c||"",h;return e[7]!==l||e[8]!==a||e[9]!==f||e[10]!==m?(h=m9("input",{id:f,name:l,onChange:a,type:"hidden",value:m}),e[7]=l,e[8]=a,e[9]=f,e[10]=m,e[11]=h):h=e[11],h},oc=Oe(p9);var Vg=As(hg(),1);import{jsx as ai,jsxs as c$}from"react/jsx-runtime";import{flattenTopLevelFields as u$}from"payload/shared";import{useMemo as z3}from"react";import{jsx as oo,jsxs as ii}from"react/jsx-runtime";import{getTranslation as Og}from"@payloadcms/translations";import{hoistQueryParamsToAnd as l$,transformColumnsToPreferences as W3}from"payload/shared";import{Fragment as H3,useCallback as Rm,useEffect as Mg,useState as _n}from"react";import{c as v9}from"react/compiler-runtime";import{useInsertionEffect as x9,useRef as y9}from"react";function to(t){let e=v9(4),o=y9(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]),x9(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{jsx as J2}from"react/jsx-runtime";import{useRouter as R9,useSearchParams as _9}from"next/navigation.js";import{isNumber as D9,transformColumnsToSearchParams as F9}from"payload/shared";import*as vg from"qs-esm";import A9,{useCallback as nc,useEffect as T9,useMemo as E9,useRef as P9,useState as q2}from"react";import{jsx as C9}from"react/jsx-runtime";import{createContext as w9,use as S9}from"react";var X2=w9({}),gg=({children:t,...e})=>C9(X2,{value:{isInDrawer:!!e.drawerSlug,...e},children:t}),en=()=>{let t=S9(X2);if(!t)throw new Error("useListDrawerContext must be used within a ListDrawerContextProvider");return t};import*as U2 from"qs-esm";function jr(t){let e=t.toString();return U2.parse(e,{depth:10,ignoreQueryPrefix:!0})}import{createContext as Y2,use as I9}from"react";var bg=Y2({}),_t=()=>I9(bg),Z2=Y2(!1);var xg=({children:t,collectionSlug:e,columns:o,data:n,defaultLimit:r,defaultSort:s,listPreferences:i,modifySearchParams:l,onQueryChange:a,orderableFieldName:c})=>{"use no memo";let u=R9(),d=_9(),{startRouteTransition:f}=st(),[m,h]=q2(!1),p=E9(()=>jr(d),[d]),g=P9({});g.current.modified=m;let{onQueryChange:b}=en(),[v,x]=q2(()=>l?p:{limit:String(r),sort:s}),y=nc(async(R,I)=>{h(I!==void 0?I:!0);let D="page"in R?R.page:v?.page;("where"in R||"search"in R)&&(D="1");let E={columns:"columns"in R?R.columns:v.columns,limit:"limit"in R?R.limit:v?.limit??String(r),page:D,preset:"preset"in R?R.preset:v?.preset,search:"search"in R?R.search:v?.search,sort:"sort"in R?R.sort:v?.sort??s,where:"where"in R?R.where:v?.where};l?f(()=>u.replace(`${vg.stringify({...E,columns:JSON.stringify(E.columns)},{addQueryPrefix:!0})}`)):(typeof b=="function"||typeof a=="function")&&(b||a)(E),x(E)},[v?.columns,v?.limit,v?.page,v?.search,v?.sort,v?.where,v?.preset,f,r,s,l,b,a,u]),C=nc(async R=>{await y({page:String(R)})},[y]),S=A9.useCallback(async R=>{await y({limit:String(R),page:"1"})},[y]),w=nc(async R=>{await y({search:R===""?void 0:R})},[y]),F=nc(async R=>{await y({sort:R})},[y]),_=nc(async R=>{await y({where:R})},[y]),A=to(()=>{let R=!1,I={...v||{}};D9(r)&&!("limit"in v)&&(I.limit=String(r),R=!0),s&&!("sort"in v)&&(I.sort=s,R=!0),o&&i?.columns&&!("columns"in v)&&(I.columns=F9(o),R=!0),R&&(x(I),window.history.replaceState(null,"",`?${vg.stringify({...I,columns:JSON.stringify(I.columns)})}`))});return T9(()=>{l&&A()},[s,r,l,o]),J2(bg,{value:{collectionSlug:e,data:n,handlePageChange:C,handlePerPageChange:S,handleSearchChange:w,handleSortChange:F,handleWhereChange:_,orderableFieldName:c,query:v,refineListData:y,setModified:h,...g.current},children:J2(Z2,{value:m,children:t})})};import{jsx as N9}from"react/jsx-runtime";import L9,{createContext as $9,useCallback as da}from"react";var Q2=$9(void 0),Ft=()=>{let t=L9.use(Q2);if(t===void 0)throw new Error("useServerFunctions must be used within a ServerFunctionsProvider");return t},yg=({children:t,serverFunction:e})=>{if(!e)throw new Error("ServerFunctionsProvider requires a serverFunction prop");let o=da(async a=>await e({name:"render-document-slots",args:a}),[e]),n=da(async a=>{let{signal:c,...u}=a;try{if(!c?.aborted){let f=await e({name:"schedule-publish",args:{...u}});if(!c?.aborted)return f}}catch(f){console.error(f)}let d=`Error scheduling ${u.type}`;return u.doc&&(d+=` for document with ID ${u.doc.value} in collection ${u.doc.relationTo}`),{error:""}},[e]),r=da(async a=>{let{signal:c,...u}=a||{};try{if(!c?.aborted){let d=await e({name:"form-state",args:{fallbackLocale:!1,...u}});if(!c?.aborted)return d}}catch(d){console.error(d)}return{state:null}},[e]),s=da(async a=>{let{signal:c,...u}=a||{};try{if(!c?.aborted){let d=await e({name:"table-state",args:{fallbackLocale:!1,...u}});if(!c?.aborted)return d}}catch(d){console.error(d)}},[e]),i=da(async a=>{let{signal:c,...u}=a||{};try{return await e({name:"render-document",args:{fallbackLocale:!1,...u}})}catch(d){console.error(d)}},[e]),l=da(async a=>{let{signal:c,...u}=a||{};try{let d=await e({name:"copy-data-from-locale",args:u});if(!c?.aborted)return d}catch(d){console.error(d)}},[e]);return N9(Q2,{value:{copyDataFromLocale:l,getDocumentSlots:o,getFormState:r,getTableState:s,renderDocument:i,schedulePublish:n,serverFunction:e},children:t})};import{jsx as O9}from"react/jsx-runtime";import{transformColumnsToSearchParams as K2}from"payload/shared";import e3,{startTransition as t3,useCallback as wg,useRef as M9}from"react";import{createContext as k9,use as j9}from"react";var Cg=k9({}),ma=()=>j9(Cg);var sc=({children:t,collectionSlug:e,columnState:o,LinkedCellOverride:n})=>{let{getEntityConfig:r}=W(),{query:s,refineListData:i}=_t(),{admin:{defaultColumns:l}={}}=r({collectionSlug:e}),[a,c]=e3.useOptimistic(o,(p,g)=>g),u=M9({}),d=wg(async p=>{let g=(a||[]).map(b=>b.accessor===p?{...b,active:!b.active}:b);t3(()=>{c(g)}),await i({columns:K2(g)})},[i,a,c]),f=wg(async p=>{let{fromIndex:g,toIndex:b}=p,v=[...a||[]],[x]=v.splice(g,1);v.splice(b,0,x),t3(()=>{c(v)}),await i({columns:K2(v)})},[a,i,c]),m=wg(async p=>{let g=s.columns;p.forEach(b=>{let v=g.findIndex(x=>b===x);v!==void 0&&g[v][0]==="-"&&(g[v]=b.slice(1))}),await i({columns:g})},[s,i]),h=e3.useCallback(async()=>{await m(l)},[l,m]);return O9(Cg,{value:{columns:a,LinkedCellOverride:n,moveColumn:f,resetColumnsState:h,setActiveColumns:m,toggleColumn:d,...u.current},children:t})};import{jsx as ic}from"react/jsx-runtime";import{fieldIsHiddenOrDisabled as B9,fieldIsID as V9}from"payload/shared";import{useId as G9,useMemo as W9}from"react";var Sg="column-selector",um=({collectionSlug:t})=>{let{columns:e,moveColumn:o,toggleColumn:n}=ma(),r=G9(),s=ct(),i=W9(()=>e.filter(l=>!(B9(l.field)&&!V9(l.field))&&!l?.field?.admin?.disableListColumn),[e]);return e?ic(ur,{className:Sg,ids:i.map(l=>l?.accessor),onDragEnd:({moveFromIndex:l,moveToIndex:a})=>{o({fromIndex:l,toIndex:a})},children:i.map((l,a)=>{let{accessor:c,active:u,field:d}=l;return ic(vt,{alignIcon:"left","aria-checked":u,className:[`${Sg}__column`,u&&`${Sg}__column--active`].filter(Boolean).join(" "),draggable:!0,icon:u?ic(pt,{}):ic(jo,{}),id:c,onClick:()=>{n(c)},children:l.CustomLabel??ic(ye,{label:d&&"label"in d&&d.label,unstyled:!0})},`${t}-${d&&"name"in d?d?.name:a}${s?`-${s}-`:""}${r}`)})}):null};import{c as p3}from"react/compiler-runtime";import{jsx as fm}from"react/jsx-runtime";import{createElement as sL}from"react";import{useEffect as iL,useId as aL,useState as lL}from"react";import{c as H9}from"react/compiler-runtime";import{useState as z9}from"react";var dm=t=>{let e=H9(3),{getEntityConfig:o}=W(),n;e[0]!==o||e[1]!==t?(n=()=>t?(typeof t=="string"?[t]:t).map(i=>o({collectionSlug:i})):[],e[0]=o,e[1]=t,e[2]=n):n=e[2];let[r]=z9(n);return r};import{jsx as d3}from"react/jsx-runtime";import rL,{useCallback as lc,useEffect as m3,useRef as nL,useState as Dg}from"react";import{c as _g}from"react/compiler-runtime";import{jsx as si,jsxs as a3}from"react/jsx-runtime";import{getTranslation as q9}from"@payloadcms/translations";import Q9 from"react";import{c as U9}from"react/compiler-runtime";import{jsx as Y9,jsxs as Z9}from"react/jsx-runtime";import n3,{createContext as J9}from"react";import{c as X9}from"react/compiler-runtime";import*as ls from"react";var Ig=t=>{let e=X9(13),{delayBeforeShow:o,inTimeout:n,minShowTime:r,outTimeout:s,show:i}=t,l=n+r+s,[a,c]=Xf(o),[u,d]=ls.useState(!1),[f,m]=ls.useState(!1),h=ls.useRef(0),p=ls.useRef(void 0),g;e[0]!==s?(g=()=>{m(!0),p.current=setTimeout(()=>{d(!1),m(!1)},s)},e[0]=s,e[1]=g):g=e[1];let b=g,v,x;e[2]!==a||e[3]!==u||e[4]!==i||e[5]!==l||e[6]!==b?(v=()=>{let C=a&&!u&&i,S=u&&!i;if(C)h.current=Date.now(),d(!0);else if(S){let w=Date.now()-h.current,F=l-w;clearTimeout(p.current),p.current=setTimeout(b,Math.max(0,F))}},x=[u,i,b,l,a],e[2]=a,e[3]=u,e[4]=i,e[5]=l,e[6]=b,e[7]=v,e[8]=x):(v=e[7],x=e[8]),ls.useEffect(v,x);let y;return e[9]!==u||e[10]!==f||e[11]!==c?(y={isMounted:u,isUnmounting:f,triggerDelayedRender:c},e[9]=u,e[10]=f,e[11]=c,e[12]=y):y=e[12],y};var o3={isLoading:!1,loaders:[],loadingText:"",overlayType:null},r3=(t,e)=>{let o=[...t.loaders],{type:n="fullscreen",key:r="user",loadingText:s}=e.payload;if(e.type==="add")o.push({type:n,key:r,loadingText:s});else if(e.type==="remove"){let l=o.findIndex(a=>a.key===r&&a.type===n);o.splice(l,1)}let i=o?.length>0?o[o.length-1]:null;return{isLoading:!!i,loaders:o,loadingText:i?.loadingText||t?.loadingText,overlayType:i?.type||t?.overlayType}};var Rg=250,s3=J9({isOnScreen:!1,toggleLoadingOverlay:void 0}),i3=t=>{let e=U9(21),{children:o}=t,{t:n}=$(),r;e[0]!==n?(r=n("general:loading"),e[0]=n,e[1]=r):r=e[1];let s=r,[i,l]=n3.useReducer(r3,o3),a;e[2]!==i.isLoading?(a={delayBeforeShow:1e3,inTimeout:Rg,minShowTime:500,outTimeout:Rg,show:i.isLoading},e[2]=i.isLoading,e[3]=a):a=e[3];let{isMounted:c,isUnmounting:u,triggerDelayedRender:d}=Ig(a),f;e[4]!==s||e[5]!==d?(f=p=>{let{type:g,isLoading:b,key:v,loadingText:x}=p,y=x===void 0?s:x;b?(d(),l({type:"add",payload:{type:g,key:v,loadingText:y}})):l({type:"remove",payload:{type:g,key:v}})},e[4]=s,e[5]=d,e[6]=f):f=e[6];let m=f,h;if(e[7]!==o||e[8]!==s||e[9]!==c||e[10]!==u||e[11]!==i.loadingText||e[12]!==i.overlayType||e[13]!==m){let p;e[15]!==s||e[16]!==c||e[17]!==u||e[18]!==i.loadingText||e[19]!==i.overlayType?(p=c&&Y9(Rn,{animationDuration:`${Rg}ms`,loadingText:i.loadingText||s,overlayType:i.overlayType,show:!u}),e[15]=s,e[16]=c,e[17]=u,e[18]=i.loadingText,e[19]=i.overlayType,e[20]=p):p=e[20],h=Z9(s3,{value:{isOnScreen:c,toggleLoadingOverlay:m},children:[p,o]}),e[7]=o,e[8]=s,e[9]=c,e[10]=u,e[11]=i.loadingText,e[12]=i.overlayType,e[13]=m,e[14]=h}else h=e[14];return h},mm=()=>{let t=n3.use(s3);if(t===void 0)throw new Error("useLoadingOverlay must be used within a LoadingOverlayProvider");return t};var Or="loading-overlay",Rn=t=>{let e=_g(11),{animationDuration:o,loadingText:n,overlayType:r,show:s}=t,i=s===void 0?!0:s,{t:l}=$(),a=i?`${Or}--entering`:`${Or}--exiting`,c=r?`${Or}--${r}`:"",u;e[0]!==a||e[1]!==c?(u=[Or,a,c].filter(Boolean),e[0]=a,e[1]=c,e[2]=u):u=e[2];let d=u.join(" "),f=o||"500ms",m;if(e[3]!==n||e[4]!==l||e[5]!==d||e[6]!==f){let h;e[8]!==n||e[9]!==l?(h=n||l("general:loading"),e[8]=n,e[9]=l,e[10]=h):h=e[10],m=a3("div",{className:d,style:{animationDuration:f},children:[a3("div",{className:`${Or}__bars`,children:[si("div",{className:`${Or}__bar`}),si("div",{className:`${Or}__bar`}),si("div",{className:`${Or}__bar`}),si("div",{className:`${Or}__bar`}),si("div",{className:`${Or}__bar`})]}),si("span",{className:`${Or}__text`,children:h})]}),e[3]=n,e[4]=l,e[5]=d,e[6]=f,e[7]=m}else m=e[7];return m},l3=t=>{let e=_g(7),{name:o,type:n,loadingText:r,show:s}=t,i=n===void 0?"fullscreen":n,{toggleLoadingOverlay:l}=mm(),a,c;return e[0]!==o||e[1]!==r||e[2]!==s||e[3]!==l||e[4]!==i?(a=()=>(l({type:i,isLoading:s,key:o,loadingText:r||void 0}),()=>{l({type:i,isLoading:!1,key:o})}),c=[s,l,o,i,r],e[0]=o,e[1]=r,e[2]=s,e[3]=l,e[4]=i,e[5]=a,e[6]=c):(a=e[5],c=e[6]),Q9.useEffect(a,c),null},K9=t=>{let e=_g(6),{name:o,type:n,action:r,formIsLoading:s,loadingSuffix:i}=t,l=n===void 0?"fullscreen":n,a=s===void 0?!1:s,c=cr(),{i18n:u,t:d}=$(),m=`${{create:d("general:creating"),loading:d("general:loading"),update:d("general:updating")}[r]} ${i?q9(i,u):""}`,h;return e[0]!==a||e[1]!==c||e[2]!==o||e[3]!==m||e[4]!==l?(h=si(l3,{loadingText:m.trim(),name:o,show:a||c,type:l}),e[0]=a,e[1]=c,e[2]=o,e[3]=m,e[4]=l,e[5]=h):h=e[5],h};function or(t){if(t)try{t.abort()}catch{}}function rr(t){let e=new AbortController;if(t.current)try{t.current.abort()}catch{}return t.current=e,e}import{jsx as eL}from"react/jsx-runtime";import{createContext as tL,use as oL}from"react";var c3=tL({}),u3=({children:t,...e})=>eL(c3,{value:e,children:t}),ac=()=>{let t=oL(c3);if(!t)throw new Error("useDocumentDrawerContext must be used within a DocumentDrawerProvider");return t};var f3=({id:t,AfterFields:e,collectionSlug:o,disableActions:n,drawerSlug:r,Header:s,initialData:i,onDelete:l,onDuplicate:a,onSave:c,overrideEntityVisibility:u=!0,redirectAfterCreate:d,redirectAfterDelete:f,redirectAfterDuplicate:m})=>{let{getEntityConfig:h}=W(),p=$e(),[g]=Dg(()=>h({collectionSlug:o})),b=rL.useRef(null),{closeModal:v}=ue(),{t:x}=$(),{renderDocument:y}=Ft(),[C,S]=Dg(void 0),[w,F]=Dg(!0),_=nL(!1),A=lc(T=>{let L=rr(b);(async()=>{F(!0);try{let j=await y({collectionSlug:o,disableActions:n,docID:T,drawerSlug:r,initialData:i,locale:p,overrideEntityVisibility:u,redirectAfterCreate:d,redirectAfterDelete:f!==void 0?f:!1,redirectAfterDuplicate:m!==void 0?m:!1,signal:L.signal});j?.Document&&(S(j.Document),F(!1))}catch(j){me.error(j?.message||x("error:unspecific")),v(r)}b.current=null})()},[o,n,r,i,f,m,y,v,u,x,p]),R=lc(T=>{A(T.doc.id),typeof c=="function"&&c({...T,collectionConfig:g})},[c,g,A]),I=lc(T=>{A(T.doc.id),typeof a=="function"&&a({...T,collectionConfig:g})},[a,g,A]),D=lc(T=>{typeof l=="function"&&l({...T,collectionConfig:g}),v(r)},[l,v,r,g]),E=lc(()=>{A()},[A]);return m3(()=>{!C&&!_.current&&(A(t),_.current=!0)},[C,A,t]),m3(()=>{let T=b.current;return()=>{or(T)}},[]),w?d3(Rn,{}):d3(u3,{clearDoc:E,drawerSlug:r,onDelete:D,onDuplicate:I,onSave:R,children:C})};var cs="doc-drawer",cL=({id:t,collectionSlug:e,depth:o,uuid:n})=>`doc-drawer_${e}_${o}${t?`_${t}`:""}_${n}`,uL=t=>{let e=p3(21),o,n,r,s,i,l,a,c;e[0]!==t?({id:l,children:o,className:n,collectionSlug:r,disabled:s,drawerSlug:i,onClick:a,...c}=t,e[0]=t,e[1]=o,e[2]=n,e[3]=r,e[4]=s,e[5]=i,e[6]=l,e[7]=a,e[8]=c):(o=e[1],n=e[2],r=e[3],s=e[4],i=e[5],l=e[6],a=e[7],c=e[8]);let{t:u}=$(),[d]=dm(r),f=l?"general:editLabel":"fields:addNewLabel",m=d?.labels.singular,h;if(e[9]!==o||e[10]!==n||e[11]!==s||e[12]!==i||e[13]!==a||e[14]!==c||e[15]!==u||e[16]!==f||e[17]!==m){let p=u(f,{label:m}),g;e[19]!==n?(g=[n,`${cs}__toggler`].filter(Boolean),e[19]=n,e[20]=g):g=e[20],h=fm(dr,{"aria-label":p,className:g.join(" "),disabled:s,onClick:a,slug:i,...c,children:o}),e[9]=o,e[10]=n,e[11]=s,e[12]=i,e[13]=a,e[14]=c,e[15]=u,e[16]=f,e[17]=m,e[18]=h}else h=e[18];return h},dL=t=>{let{drawerSlug:e}=t;return fm(Lt,{className:cs,gutter:!1,Header:null,slug:e,children:fm(f3,{...t})})},qt=t=>{let e=p3(38),{id:o,collectionSlug:n,overrideEntityVisibility:r}=t,s=ct(),i=aL(),{closeModal:l,modalState:a,openModal:c,toggleModal:u}=ue(),[d,f]=lL(!1),m;e[0]!==n||e[1]!==s||e[2]!==o||e[3]!==i?(m=cL({id:o,collectionSlug:n,depth:s,uuid:i}),e[0]=n,e[1]=s,e[2]=o,e[3]=i,e[4]=m):m=e[4];let h=m,p,g;e[5]!==h||e[6]!==a?(p=()=>{f(!!a[h]?.isOpen)},g=[a,h],e[5]=h,e[6]=a,e[7]=p,e[8]=g):(p=e[7],g=e[8]),iL(p,g);let b;e[9]!==h||e[10]!==u?(b=()=>{u(h)},e[9]=h,e[10]=u,e[11]=b):b=e[11];let v=b,x;e[12]!==l||e[13]!==h?(x=()=>{l(h)},e[12]=l,e[13]=h,e[14]=x):x=e[14];let y=x,C;e[15]!==h||e[16]!==c?(C=()=>{c(h)},e[15]=h,e[16]=c,e[17]=C):C=e[17];let S=C,w,F;e[18]!==n||e[19]!==h||e[20]!==o||e[21]!==r?(F=k=>sL(dL,{...k,collectionSlug:n,drawerSlug:h,id:o,key:h,overrideEntityVisibility:r}),e[18]=n,e[19]=h,e[20]=o,e[21]=r,e[22]=F):F=e[22],w=F;let _=w,A,R;e[23]!==n||e[24]!==h||e[25]!==o?(R=k=>fm(uL,{...k,collectionSlug:n,drawerSlug:h,id:o}),e[23]=n,e[24]=h,e[25]=o,e[26]=R):R=e[26],A=R;let I=A,D,E;e[27]!==y||e[28]!==h||e[29]!==s||e[30]!==d||e[31]!==S||e[32]!==v?(E={closeDrawer:y,drawerDepth:s,drawerSlug:h,isDrawerOpen:d,openDrawer:S,toggleDrawer:v},e[27]=y,e[28]=h,e[29]=s,e[30]=d,e[31]=S,e[32]=v,e[33]=E):E=e[33],D=E;let T=D,L;return e[34]!==_||e[35]!==T||e[36]!==I?(L=[_,I,T],e[34]=_,e[35]=T,e[36]=I,e[37]=L):L=e[37],L};import{c as mL}from"react/compiler-runtime";import{jsx as fL}from"react/jsx-runtime";import{createContext as pL,use as hL,useEffect as gL,useReducer as bL,useRef as vL}from"react";function h3(t,e){switch(e.type){case"ADD_LOADED":{let o={...t};typeof o[e.relationTo]!="object"&&(o[e.relationTo]={});let n=[...e.idsToLoad];return Array.isArray(e.docs)&&e.docs.forEach(r=>{n.splice(n.indexOf(r.id),1),o[e.relationTo][r.id]=r}),n.forEach(r=>{o[e.relationTo][r]=!1}),o}case"REQUEST":{let o={...t};return e.docs.forEach(({relationTo:n,value:r})=>{typeof o[n]!="object"&&(o[n]={}),o[n][r]=null}),o}default:return t}}var g3=pL({}),cc=t=>{let e=mL(15),{children:o}=t,n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={},e[0]=n):n=e[0];let[r,s]=bL(h3,n),i=qo(r,100),{config:l}=W(),{routes:a,serverURL:c}=l,{api:u}=a,{i18n:d}=$(),{code:f}=$e(),m=vL(f),h;e[1]!==u||e[2]!==i||e[3]!==d||e[4]!==f||e[5]!==c?(h=C=>{let S=C===void 0?!1:C;Object.entries(i).forEach(async w=>{let[F,_]=w,A=[];if(Object.entries(_).forEach(R=>{let[I,D]=R;(D===null||S)&&A.push(I)}),A.length>0){let R=`${c}${u}/${F}`,I=new URLSearchParams;if(I.append("depth","0"),I.append("limit","250"),f&&I.append("locale",f),A&&A.length>0){let T=A.map(xL);I.append("where[id][in]",T.join(","))}let D=`?${I.toString()}`,E=await fetch(`${R}${D}`,{credentials:"include",headers:{"Accept-Language":d.language}});if(E.ok){let T=await E.json();T.docs&&s({type:"ADD_LOADED",docs:T.docs,idsToLoad:A,relationTo:F})}else s({type:"ADD_LOADED",docs:[],idsToLoad:A,relationTo:F})}})},e[1]=u,e[2]=i,e[3]=d,e[4]=f,e[5]=c,e[6]=h):h=e[6];let p=h,g,b;e[7]!==p||e[8]!==f?(g=()=>{p(f&&m.current!==f),m.current=f},b=[f,p],e[7]=p,e[8]=f,e[9]=g,e[10]=b):(g=e[9],b=e[10]),gL(g,b);let v;e[11]===Symbol.for("react.memo_cache_sentinel")?(v=C=>{s({type:"REQUEST",docs:C})},e[11]=v):v=e[11];let x=v,y;return e[12]!==o||e[13]!==r?(y=fL(g3,{value:{documents:r,getRelationships:x},children:o}),e[12]=o,e[13]=r,e[14]=y):y=e[14],y},Fg=()=>hL(g3);function xL(t){return String(t)}import{c as e$}from"react/compiler-runtime";import{jsx as Sm,jsxs as t$}from"react/jsx-runtime";import"react";import{c as qL}from"react/compiler-runtime";import{jsx as $3}from"react/jsx-runtime";import k3 from"react";import{c as HL}from"react/compiler-runtime";import{jsx as ha,jsxs as zL}from"react/jsx-runtime";import{getTranslation as XL}from"@payloadcms/translations";import{fieldAffectsData as UL,fieldIsID as YL}from"payload/shared";import ZL from"react";import{formatAdminURL as pm}from"payload/shared";import{getTranslation as yL}from"@payloadcms/translations";import CL from"react";var b3=(t,e,o)=>{if((e?.type==="select"||e?.type==="radio")&&Array.isArray(e.options)){let n=e.options.find(r=>typeof r=="object"?r.value===t:r===t);if(n)return typeof n=="object"&&"label"in n?CL.isValidElement(n.label)?n.label:yL(n.label,o)||n.value:n}return t};import{jsx as v3}from"react/jsx-runtime";import"react";var hm=({cellData:t,nowrap:e})=>{let o=t?.length>100?`${t.substring(0,100)}\u2026`:t;return v3("code",{className:"code-cell",style:e?{whiteSpace:"nowrap"}:{},children:v3("span",{children:o})})};import{c as wL}from"react/compiler-runtime";import{jsx as SL}from"react/jsx-runtime";import{getTranslation as x3}from"@payloadcms/translations";import"react";var y3=t=>{let e=wL(2),{cellData:o,field:n}=t,{labels:r}=n,{i18n:s}=$(),i=o??[],l=i.length===1?`${i.length} ${x3(r?.singular||s.t("general:rows"),s)}`:`${i.length} ${x3(r?.plural||s.t("general:rows"),s)}`,a;return e[0]!==l?(a=SL("span",{children:l}),e[0]=l,e[1]=a):a=e[1],a};import{c as IL}from"react/compiler-runtime";import{jsx as RL}from"react/jsx-runtime";import{getTranslation as gm}from"@payloadcms/translations";import"react";var C3=t=>{let e=IL(2),{cellData:o,field:n}=t,{blockReferences:r,blocks:s,labels:i}=n,{i18n:l}=$(),{config:a}=W(),c=Array.isArray(o)?o.map(_L):[],u=(r??s)?.map(h=>{let p=typeof h=="string"?a.blocksMap[h]:h;return{slug:p.slug,label:gm(p.labels.singular,l)}}),d=`0 ${gm(i?.plural,l)}`,f=h=>h.map(p=>u.filter(b=>b.slug===p)?.[0]?.label).join(", ");if(c.length>5){let h=c.length-5;d=`${c.length} ${gm(i?.plural,l)} - ${l.t("fields:itemsAndMore",{count:h,items:f(c.slice(0,5))})}`}else c.length>0&&(d=`${c.length} ${gm(c.length===1?i?.singular:i?.plural,l)} - ${f(c)}`);let m;return e[0]!==d?(m=RL("span",{children:d}),e[0]=d,e[1]=m):m=e[1],m};function _L(t){let{blockType:e}=t;return e}import{c as DL}from"react/compiler-runtime";import{jsx as w3}from"react/jsx-runtime";import"react";var S3=t=>{let e=DL(3),{cellData:o}=t,{t:n}=$(),r=`general:${o}`,s;return e[0]!==n||e[1]!==r?(s=w3("code",{className:"bool-cell",children:w3("span",{children:n(r).toLowerCase()})}),e[0]=n,e[1]=r,e[2]=s):s=e[2],s};import{c as FL}from"react/compiler-runtime";import{jsx as AL}from"react/jsx-runtime";import"react";var I3=t=>{let e=FL(8),{cellData:o,field:n}=t,{admin:r}=n,s;e[0]!==r?(s=r===void 0?{}:r,e[0]=r,e[1]=s):s=e[1];let{date:i}=s,{config:l}=W(),{admin:a}=l,{dateFormat:c}=a,u=i?.displayFormat||c,{i18n:d}=$(),f;e[2]!==o||e[3]!==u||e[4]!==d?(f=o&&yn({date:o,i18n:d,pattern:u}),e[2]=o,e[3]=u,e[4]=d,e[5]=f):f=e[5];let m;return e[6]!==f?(m=AL("span",{children:f}),e[6]=f,e[7]=m):m=e[7],m};import{jsx as Tg,jsxs as EL,Fragment as PL}from"react/jsx-runtime";import{isImage as NL}from"payload/shared";import"react";var fa=({sizes:t,targetSizeMax:e=180,targetSizeMin:o=40,thumbnailURL:n,url:r,width:s})=>n||t&&Object.values(t).reduce((l,a)=>!a.width||a.width<o?l:a.width>=o&&a.width<=e?!l.width||a.width<l.width||l.width<o||l.width>e?a:l:!l.width||!l.original&&l.width<o&&a.width>l.width||l.width>e&&a.width<l.width?a:l,{original:!0,url:r,width:s}).url||r;import{c as R3}from"react/compiler-runtime";import{jsx as pa,jsxs as _3}from"react/jsx-runtime";import vm from"react";import{jsx as Ag,jsxs as TL}from"react/jsx-runtime";import"react";var bm=()=>TL("svg",{height:"150",viewBox:"0 0 150 150",width:"150",xmlns:"http://www.w3.org/2000/svg",children:[Ag("rect",{fill:"#333333",height:"150",transform:"translate(0 0.5)",width:"150"}),Ag("path",{d:"M82.8876 50.5H55.5555V100.5H94.4444V61.9818H82.8876V50.5Z",fill:"white"}),Ag("path",{d:"M82.8876 61.9818H94.4444L82.8876 50.5V61.9818Z",fill:"#9A9A9A"})]});var xm="thumbnail",Mr=t=>{let e=R3(17),{className:o,doc:n,fileSrc:r,imageCacheTag:s,size:i}=t,l=o===void 0?"":o,a;e[0]!==n?(a=n===void 0?{}:n,e[0]=n,e[1]=a):a=e[1];let{filename:c}=a,[u,d]=vm.useState(void 0),f=`${xm}--size-${i||"medium"}`,m;e[2]!==l||e[3]!==f?(m=[xm,f,l],e[2]=l,e[3]=f,e[4]=m):m=e[4];let h=m.join(" "),p,g;e[5]!==r?(p=()=>{if(!r){d(!1);return}d(void 0);let x=new Image;x.src=r,x.onload=()=>{d(!0)},x.onerror=()=>{d(!1)}},g=[r],e[5]=r,e[6]=p,e[7]=g):(p=e[6],g=e[7]),vm.useEffect(p,g);let b=null;if(r){let x=r?.includes("?")?"&":"?";b=s?`${r}${x}${encodeURIComponent(s)}`:r}let v;if(e[8]!==h||e[9]!==u||e[10]!==c||e[11]!==b){let x;e[13]!==u||e[14]!==c||e[15]!==b?(x=u&&pa("img",{alt:c,src:b}),e[13]=u,e[14]=c,e[15]=b,e[16]=x):x=e[16],v=_3("div",{className:h,children:[u===void 0&&pa(It,{height:"100%"}),x,u===!1&&pa(bm,{})]}),e[8]=h,e[9]=u,e[10]=c,e[11]=b,e[12]=v}else v=e[12];return v};function D3(t){let e=R3(17),{alt:o,className:n,filename:r,fileSrc:s,imageCacheTag:i,size:l}=t,a=n===void 0?"":n,[c,u]=vm.useState(void 0),d=`${xm}--size-${l||"medium"}`,f;e[0]!==a||e[1]!==d?(f=[xm,d,a],e[0]=a,e[1]=d,e[2]=f):f=e[2];let m=f.join(" "),h,p;e[3]!==s?(h=()=>{if(!s){u(!1);return}u(void 0);let v=new Image;v.src=s,v.onload=()=>{u(!0)},v.onerror=()=>{u(!1)}},p=[s],e[3]=s,e[4]=h,e[5]=p):(h=e[4],p=e[5]),vm.useEffect(h,p);let g="";if(s){let v=s?.includes("?")?"&":"?";g=i?`${s}${v}${encodeURIComponent(i)}`:s}let b;if(e[6]!==o||e[7]!==m||e[8]!==c||e[9]!==r||e[10]!==g){let v;e[12]!==o||e[13]!==c||e[14]!==r||e[15]!==g?(v=c&&pa("img",{alt:o||r,src:g}),e[12]=o,e[13]=c,e[14]=r,e[15]=g,e[16]=v):v=e[16],b=_3("div",{className:m,children:[c===void 0&&pa(It,{height:"100%"}),v,c===!1&&pa(bm,{})]}),e[6]=o,e[7]=m,e[8]=c,e[9]=r,e[10]=g,e[11]=b}else b=e[11];return b}var Eg="file",ym=({cellData:t,collectionConfig:e,field:o,rowData:n})=>{if(("displayPreview"in o?o.displayPreview:void 0)??e.upload?.displayPreview??!0){let i=NL(n?.mimeType),l=i?n?.thumbnailURL||n?.url:n?.thumbnailURL;return i&&(l=fa({sizes:n?.sizes,thumbnailURL:n?.thumbnailURL,url:n?.url,width:n?.width})),EL("div",{className:Eg,children:[Tg(Mr,{className:`${Eg}__thumbnail`,collectionSlug:e?.slug,doc:{...n,filename:t},fileSrc:l,size:"small",uploadConfig:e?.upload}),Tg("span",{className:`${Eg}__filename`,children:String(t)})]})}else return Tg(PL,{children:String(t)})};import{jsx as F3}from"react/jsx-runtime";import"react";var A3=({cellData:t})=>{let e=t?.length>100?`${t.substring(0,100)}\u2026`:t;return F3("code",{className:"json-cell",children:F3("span",{children:JSON.stringify(e)})})};import{c as LL}from"react/compiler-runtime";import{jsx as $L,jsxs as E3}from"react/jsx-runtime";import{getTranslation as kL}from"@payloadcms/translations";import jL,{useEffect as P3,useState as N3}from"react";var T3=!!(typeof window<"u"&&window.document&&window.document.createElement);var OL="relationship-cell",Cm=3,wm=t=>{let e=LL(40),{cellData:o,customCellProps:n,field:r,field:s}=t,{label:i}=s,l="relationTo"in r&&r.relationTo||"collection"in r&&r.collection,a;a="collection"in r?o?.docs:o;let c=a,{config:u,getEntityConfig:d}=W(),{collections:f,routes:m}=u,[h,p]=fn(),g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g=[],e[0]=g):g=e[0];let[b,v]=N3(g),{documents:x,getRelationships:y}=Fg(),[C,S]=N3(!1),{i18n:w,t:F}=$(),_=T3?p?.boundingClientRect?.top<window.innerHeight:!1,A;e[1]!==c||e[2]!==y||e[3]!==C||e[4]!==_||e[5]!==l?(A=()=>{if((c||typeof c=="number")&&_&&!C){let T=[],L=Array.isArray(c)?c:[c];L.slice(0,L.length<Cm?L.length:Cm).forEach(k=>{typeof k=="object"&&"relationTo"in k&&"value"in k&&T.push(k),(typeof k=="number"||typeof k=="string")&&typeof l=="string"&&T.push({relationTo:l,value:k})}),y(T),S(!0),v(T)}},e[1]=c,e[2]=y,e[3]=C,e[4]=_,e[5]=l,e[6]=A):A=e[6];let R;e[7]!==c||e[8]!==f||e[9]!==y||e[10]!==C||e[11]!==_||e[12]!==l||e[13]!==m.api?(R=[c,l,f,_,m.api,C,y],e[7]=c,e[8]=f,e[9]=y,e[10]=C,e[11]=_,e[12]=l,e[13]=m.api,e[14]=R):R=e[14],P3(A,R);let I;e[15]!==C?(I=()=>{C&&S(!1)},e[15]=C,e[16]=I):I=e[16];let D;e[17]!==c?(D=[c],e[17]=c,e[18]=D):D=e[18],P3(I,D);let E;if(e[19]!==c||e[20]!==u.admin||e[21]!==n||e[22]!==x||e[23]!==r||e[24]!==d||e[25]!==w||e[26]!==h||e[27]!==i||e[28]!==F||e[29]!==b){let T;e[31]!==u.admin||e[32]!==n||e[33]!==x||e[34]!==r||e[35]!==d||e[36]!==w||e[37]!==F||e[38]!==b.length?(T=(L,k)=>{let{relationTo:j,value:P}=L,N=x[j][P],B=d({collectionSlug:j}),M=mr({collectionConfig:B,data:N||null,dateFormat:u.admin.dateFormat,fallback:`${F("general:untitled")} - ID: ${P}`,i18n:w}),O=null;return r.type==="upload"&&(("displayPreview"in r?r.displayPreview:void 0)??B.upload?.displayPreview??!0)&&N&&(O=$L(ym,{cellData:M,collectionConfig:B,collectionSlug:B.slug,customCellProps:n,field:r,rowData:N})),E3(jL.Fragment,{children:[N===!1&&`${F("general:untitled")} - ID: ${P}`,N===null&&`${F("general:loading")}...`,N?O||M:null,b.length>k+1&&", "]},k)},e[31]=u.admin,e[32]=n,e[33]=x,e[34]=r,e[35]=d,e[36]=w,e[37]=F,e[38]=b.length,e[39]=T):T=e[39],E=E3("div",{className:OL,ref:h,children:[b.map(T),Array.isArray(c)&&c.length>Cm&&F("fields:itemsAndMore",{count:c.length-Cm,items:""}),b.length===0&&F("general:noLabel",{label:kL(i||"",w)})]}),e[19]=c,e[20]=u.admin,e[21]=n,e[22]=x,e[23]=r,e[24]=d,e[25]=w,e[26]=h,e[27]=i,e[28]=F,e[29]=b,e[30]=E}else E=e[30];return E};import{c as ML}from"react/compiler-runtime";import{jsx as BL}from"react/jsx-runtime";import{getTranslation as VL}from"@payloadcms/translations";import{optionsAreObjects as GL}from"payload/shared";import"react";var Pg=t=>{let e=ML(10),{cellData:o,field:n}=t,{options:r}=n,{i18n:s}=$(),i;e[0]!==s||e[1]!==r?(i=u=>u.map(d=>{let f=r.filter(m=>m.value===d)?.[0]?.label;return VL(f,s)}).join(", "),e[0]=s,e[1]=r,e[2]=i):i=e[2];let l=i,a;if(GL(r)){let u;e[3]!==o||e[4]!==l?(u=Array.isArray(o)?l(o):l([o]),e[3]=o,e[4]=l,e[5]=u):u=e[5],a=u}else{let u;e[6]!==o?(u=Array.isArray(o)?o.join(", "):o,e[6]=o,e[7]=u):u=e[7],a=u}let c;return e[8]!==a?(c=BL("span",{children:a}),e[8]=a,e[9]=c):c=e[9],c};import{jsx as WL}from"react/jsx-runtime";import"react";var L3=({cellData:t})=>{let e=t?.length>100?`${t.substring(0,100)}\u2026`:t;return WL("span",{children:e})};var Ng={array:y3,blocks:C3,checkbox:S3,code:hm,date:I3,File:ym,join:wm,json:A3,radio:Pg,relationship:wm,select:Pg,textarea:L3,upload:wm};var uc=t=>{let e=HL(14),{cellData:o,className:n,collectionSlug:r,field:s,field:i,link:l,onClick:a,rowData:c}=t,{admin:u}=i,{i18n:d}=$(),{config:f,getEntityConfig:m}=W(),{routes:h}=f,{admin:p}=h,g,b;if(e[0]!==u||e[1]!==p||e[2]!==o||e[3]!==n||e[4]!==r||e[5]!==s||e[6]!==m||e[7]!==d||e[8]!==l||e[9]!==a||e[10]!==t||e[11]!==c){b=Symbol.for("react.early_return_sentinel");e:{let v=m({collectionSlug:r}),x=u&&"className"in u?u.className:void 0,y=n||(s.admin&&"className"in s.admin?s.admin.className:null)||x,C=a,S="span",w={className:y};if(l&&(w.prefetch=!1,S=Yt,w.href=v?.slug?pm({adminRoute:p,path:`/collections/${v?.slug}/${encodeURIComponent(c.id)}`}):""),typeof C=="function"&&(S="button",w.type="button",w.onClick=()=>{C({cellData:o,collectionSlug:v?.slug,rowData:c})}),YL(s)){b=ha(S,{...w,children:ha(hm,{cellData:`ID: ${o}`,collectionConfig:v,collectionSlug:r,field:{...s,type:"code"},nowrap:!0,rowData:c})});break e}let F=b3(o,s,d),_=typeof o<"u"&&Ng[s.type],A=null;if(ZL.isValidElement(F))A=F;else if(_)A=ha(_,{cellData:o,rowData:c,...t});else if(!_)if(v?.upload&&UL(s)&&s.name==="filename"&&s.type==="text"){let R=Ng.File;A=ha(R,{cellData:o,rowData:c,...t,collectionConfig:v,field:s})}else{b=zL(S,{...w,children:[(F===""||typeof F>"u"||F===null)&&d.t("general:noLabel",{label:XL(("label"in s?s.label:null)||"data",d)}),typeof F=="string"&&F,typeof F=="number"&&F,typeof F=="object"&&F!==null&&JSON.stringify(F)]});break e}if((s.type==="select"||s.type==="radio")&&s.options.length&&o){let R=Array.isArray(o)?o.map(JL).join(" "):`selected--${o}`,I=[w.className,R].filter(Boolean).join(" ");b=ha(S,{...w,className:I,children:A});break e}g=ha(S,{...w,children:A})}e[0]=u,e[1]=p,e[2]=o,e[3]=n,e[4]=r,e[5]=s,e[6]=m,e[7]=d,e[8]=l,e[9]=a,e[10]=t,e[11]=c,e[12]=g,e[13]=b}else g=e[12],b=e[13];return b!==Symbol.for("react.early_return_sentinel")?b:g};function JL(t){return`selected--${t}`}var QL="default-cell",j3=k3.createContext(null),Lg=()=>k3.use(j3),KL=t=>{let e=qL(9),{clientProps:o,columnIndex:n,isLinkedColumn:r}=t,{drawerSlug:s,onSelect:i}=en(),{LinkedCellOverride:l}=ma(),a;if(e[0]!==l||e[1]!==o||e[2]!==n||e[3]!==s||e[4]!==r||e[5]!==i){let c={...o,columnIndex:n};if(r&&s){c.className=`${QL}__first-cell`,c.link=!1;let u;e[7]!==i?(u=d=>{let{collectionSlug:f,rowData:m}=d;typeof i=="function"&&i({collectionSlug:f,doc:m,docID:m.id})},e[7]=i,e[8]=u):u=e[8],c.onClick=u}a=$3(j3,{value:c,children:r&&l?l:$3(uc,{...c})}),e[0]=l,e[1]=o,e[2]=n,e[3]=s,e[4]=r,e[5]=i,e[6]=a}else a=e[6];return a};var O3=t=>{let e=e$(15),{onDrawerDelete:o,onDrawerSave:n}=t,r=Lg(),s=r?.rowData.id,i=r?.collectionSlug,l;e[0]!==s||e[1]!==i?(l={id:s,collectionSlug:i},e[0]=s,e[1]=i,e[2]=l):l=e[2];let[a,c,u]=qt(l),{closeDrawer:d}=u,f;e[3]!==d||e[4]!==n?(f=b=>{d(),typeof n=="function"&&n(b)},e[3]=d,e[4]=n,e[5]=f):f=e[5];let m=f,h;e[6]!==d||e[7]!==o?(h=b=>{d(),typeof o=="function"&&o(b)},e[6]=d,e[7]=o,e[8]=h):h=e[8];let p=h,g;return e[9]!==a||e[10]!==c||e[11]!==r||e[12]!==p||e[13]!==m?(g=t$("div",{className:"drawer-link",children:[Sm(uc,{...r,className:"drawer-link__cell",link:!1,onClick:null}),Sm(c,{children:Sm(_r,{})}),Sm(a,{onDelete:p,onSave:m})]}),e[9]=a,e[10]=c,e[11]=r,e[12]=p,e[13]=m,e[14]=g):g=e[14],g};import{c as i$}from"react/compiler-runtime";import{jsx as a$}from"react/jsx-runtime";import"react";import{jsx as jg}from"react/jsx-runtime";import"react";import{jsx as M3}from"react/jsx-runtime";import"react";var $g="clickable-arrow",B3=t=>{let{direction:e="right",isDisabled:o=!1,updatePage:n}=t,r=[$g,o&&`${$g}--is-disabled`,e&&`${$g}--${e}`].filter(Boolean).join(" ");return M3("button",{className:r,disabled:o,onClick:o?void 0:n,type:"button",children:M3(Ze,{})})};import{jsx as o$}from"react/jsx-runtime";import"react";var Im="paginator__page",kg=({isCurrent:t,isFirstPage:e=!1,isLastPage:o=!1,page:n=1,updatePage:r})=>{let s=[Im,t&&`${Im}--is-current`,e&&`${Im}--is-first-page`,o&&`${Im}--is-last-page`].filter(Boolean).join(" ");return o$("button",{className:s,onClick:()=>r(n),type:"button",children:n})};import{jsx as r$}from"react/jsx-runtime";import"react";var V3=()=>r$("span",{className:"paginator__separator",children:"\u2014"});var n$={ClickableArrow:B3,Page:kg,Separator:V3},s$="paginator",dc=t=>{let{hasNextPage:e=!1,hasPrevPage:o=!1,nextPage:n=null,numberOfNeighbors:r=1,onChange:s,page:i,prevPage:l=null,totalPages:a=null}=t;if(!e&&!o)return null;let c=h=>{typeof s=="function"&&s(h)},u=Array.from({length:a},(h,p)=>p+1),d=i-1-r;d<=0&&(d=0);let f=i-1+r+1,m=u.slice(d,f);return i-r-1>=2&&m.unshift({type:"Separator"}),i>r+1&&m.unshift({type:"Page",props:{isFirstPage:!0,page:1,updatePage:c}}),i+r+1<a&&m.push({type:"Separator"}),f<a&&m.push({type:"Page",props:{isLastPage:!0,page:a,updatePage:c}}),m.unshift({type:"ClickableArrow",props:{direction:"right",isDisabled:!e,updatePage:()=>c(n)}}),m.unshift({type:"ClickableArrow",props:{direction:"left",isDisabled:!o,updatePage:()=>c(l)}}),jg("div",{className:s$,children:m.map((h,p)=>{if(typeof h=="number")return jg(kg,{isCurrent:i===h,page:h,updatePage:c},p);let g=n$[h.type];return jg(g,{...h.props},p)})})};var G3=()=>{let t=i$(11),{data:e,handlePageChange:o}=_t(),n=e.nextPage||2,r;t[0]!==o?(r=a=>{o(a)},t[0]=o,t[1]=r):r=t[1];let s=e.page||1,i=e.prevPage||void 0,l;return t[2]!==e.hasNextPage||t[3]!==e.hasPrevPage||t[4]!==e.limit||t[5]!==e.totalPages||t[6]!==n||t[7]!==r||t[8]!==s||t[9]!==i?(l=a$(dc,{hasNextPage:e.hasNextPage,hasPrevPage:e.hasPrevPage,limit:e.limit,nextPage:n,numberOfNeighbors:1,onChange:r,page:s,prevPage:i,totalPages:e.totalPages}),t[2]=e.hasNextPage,t[3]=e.hasPrevPage,t[4]=e.limit,t[5]=e.totalPages,t[6]=n,t[7]=r,t[8]=s,t[9]=i,t[10]=l):l=t[10],l};var nr="relationship-table",Bg=t=>{let{AfterInput:e,allowCreate:o=!0,BeforeInput:n,disableTable:r=!1,field:s,filterOptions:i,initialData:l,initialDrawerData:a,Label:c,parent:u,relationTo:d}=t,[f,m]=_n(null),{config:h,getEntityConfig:p}=W(),{permissions:g}=De(),[b]=_n(()=>{if(l)return{...l,docs:Array.isArray(l.docs)?l.docs.reduce((Y,H)=>typeof H=="string"?[...Y,{id:H}]:[...Y,H],[]):[]}}),{i18n:v,t:x}=$(),[y,C]=_n(),[S,w]=_n(!1),[F]=_n(()=>p({collectionSlug:d})),[_,A]=_n(Array.isArray(d)?void 0:d),[R,I]=_n(!r),[D,E]=_n(b),[T,L]=_n(),{getTableState:k}=Ft(),j=Rm(async Y=>{let H={limit:String(s?.defaultLimit||F?.admin?.pagination?.defaultLimit),sort:s.defaultSort||F?.defaultSort,...y||{},where:{...y?.where||{}}};i&&(H.where=l$(H.where,i));let le=s.admin.defaultColumns?s.admin.defaultColumns.map(J=>({accessor:J,active:!0})):void 0,{data:q,state:fe,Table:ae}=await k({collectionSlug:d,columns:W3(y?.columns)||le,docs:Y,enableRowSelections:!1,orderableFieldName:!s.orderable||Array.isArray(s.collection)?void 0:`_${s.collection}_${s.name}_order`,parent:u,query:H,renderRowTypes:!0,tableAppearance:"condensed"});E(q),m(ae),L(fe),I(!1)},[s.defaultLimit,s.defaultSort,s.admin.defaultColumns,s.collection,s.name,s.orderable,F?.admin?.pagination?.defaultLimit,F?.defaultSort,y,i,k,d,u]),P=to((Y,H)=>{!H&&(!f||Y)&&j()});Mg(()=>{P(y,r)},[y,r]);let[N,B,{closeDrawer:M,isDrawerOpen:O,openDrawer:V}]=qt({collectionSlug:_}),G=Rm(Y=>{let H=D?.docs?.findIndex(q=>q.id===Y.doc.id),le;if(H!==-1){let q=[...D.docs];q[H]=Y.doc,le=q}else le=[Y.doc,...D.docs];j(le)},[D?.docs,j]),z=Rm(Y=>{M(),G(Y)},[M,G]),X=Rm(Y=>{let H=D.docs.filter(le=>le.id!==Y.id);j(H)},[D?.docs,j]),te=o!==!1&&g?.collections?.[Array.isArray(d)?d[0]:d]?.create;return Mg(()=>{Array.isArray(d)&&_&&V()},[_,V,d]),Mg(()=>{Array.isArray(d)&&!O&&_&&A(void 0)},[O]),ii("div",{className:nr,children:[ii("div",{className:`${nr}__header`,children:[c,ii("div",{className:`${nr}__actions`,children:[!Array.isArray(d)&&te&&oo(B,{className:`${nr}__add-new`,children:v.t("fields:addNew")}),Array.isArray(d)&&oo(H3,{children:oo(ho,{button:ii(se,{buttonStyle:"none",className:`${nr}__add-new-polymorphic`,children:[v.t("fields:addNew"),oo(jo,{})]}),buttonType:"custom",horizontalAlign:"center",render:({close:Y})=>oo(Be.ButtonGroup,{children:d.map(H=>g.collections[H].create?oo(Be.Button,{className:`${nr}__relation-button--${H}`,onClick:()=>{Y(),A(H)},children:Og(h.collections.find(le=>le.slug===H).labels.singular,v)},H):null)}),size:"medium"})}),oo(vt,{"aria-controls":`${nr}-columns`,"aria-expanded":S,className:`${nr}__toggle-columns ${S?`${nr}__buttons-active`:""}`,icon:oo(Ze,{direction:S?"up":"down"}),onClick:()=>w(!S),pillStyle:"light",children:x("general:columns")})]})]}),n,R?oo("p",{children:x("general:loading")}):ii(H3,{children:[D?.docs&&D.docs.length===0&&ii("div",{className:`${nr}__no-results`,children:[oo("p",{children:v.t("general:noResults",{label:Array.isArray(d)?v.t("general:documents"):Og(F?.labels?.plural,v)})}),te&&oo(se,{onClick:V,children:v.t("general:createNewLabel",{label:Og(F?.labels?.singular,v)})})]}),D?.docs&&D.docs.length>0&&oo(cc,{children:oo(xg,{columns:W3(T),data:D,defaultLimit:s.defaultLimit??F?.admin?.pagination?.defaultLimit,defaultSort:s.defaultSort??F?.defaultSort,modifySearchParams:!1,onQueryChange:C,orderableFieldName:!s.orderable||Array.isArray(s.collection)?void 0:`_${s.collection}_${s.name}_order`,children:ii(sc,{collectionSlug:Array.isArray(d)?d[0]:d,columnState:T,LinkedCellOverride:oo(O3,{onDrawerDelete:X,onDrawerSave:G}),children:[oo(Tr,{className:`${nr}__columns`,height:S?"auto":0,id:`${nr}-columns`,children:oo("div",{className:`${nr}__columns-inner`,children:F&&oo(um,{collectionSlug:F.slug})})}),f,oo(G3,{})]})})})]}),e,oo(N,{initialData:a,onSave:z})]})};var X3=Vg.default.default||Vg.default,_m=({collectionSlug:t,config:e,docID:o,fields:n,segments:r})=>{let s=u$(n),i=r[0],l=s.find(c=>c.name===i);if(!l)return null;if(l.type==="relationship"||l.type==="upload"){let c=o;return Array.isArray(l.relationTo)&&(c={relationTo:t,value:o}),{[l.name]:l.hasMany?[c]:c}}let a=r.slice(1,r.length);if(l.type==="tab"||l.type==="group")return{[l.name]:_m({collectionSlug:t,config:e,docID:o,fields:l.fields,segments:a})};if(l.type==="array"){let c=_m({collectionSlug:t,config:e,docID:o,fields:l.fields,segments:a});return c.id=X3().toHexString(),{[l.name]:[c]}}if(l.type==="blocks")for(let c of l.blockReferences??l.blocks){let u=typeof c=="string"?e.blocksMap[c]:c,d=_m({collectionSlug:t,config:e,docID:o,fields:u.fields,segments:a});if(d)return d.id=X3().toHexString(),d.blockType=u.slug,{[l.name]:[d]}}},d$=t=>{let{field:e,field:{admin:{allowCreate:o,description:n},collection:r,label:s,localized:i,on:l,required:a},path:c}=t,{id:u,docConfig:d}=Pe(),{config:f,getEntityConfig:m}=W(),{customComponents:{AfterInput:h,BeforeInput:p,Description:g,Error:b,Label:v}={},path:x,showError:y,value:C}=Ne({potentiallyStalePath:c}),S=z3(()=>{if(!u)return null;let F=u;Array.isArray(e.targetField.relationTo)&&(F={relationTo:d.slug,value:F});let _=Array.isArray(r)?{}:{[l]:{equals:F}};return e.where?{and:[_,e.where]}:_},[u,r,e.targetField.relationTo,e.where,l,d?.slug]),w=z3(()=>{let F=m({collectionSlug:Array.isArray(e.collection)?e.collection[0]:e.collection});return _m({collectionSlug:d?.slug,config:f,docID:u,fields:F.fields,segments:e.on.split(".")})},[m,e.collection,e.on,d?.slug,u,f]);return d?c$("div",{className:[Ie,y&&"error","join"].filter(Boolean).join(" "),id:`field-${x?.replace(/\./g,"__")}`,children:[ai(oe,{CustomComponent:b,Fallback:ai(We,{path:x,showError:y})}),ai(Bg,{AfterInput:h,allowCreate:typeof u<"u"&&o,BeforeInput:p,disableTable:S===null,field:e,filterOptions:S,initialData:u&&C?C:{docs:[]},initialDrawerData:w,Label:ai("h4",{style:{margin:0},children:v||ai(ye,{label:s,localized:i,path:x,required:a})}),parent:Array.isArray(r)?{id:u,collectionSlug:d.slug,joinPath:x}:void 0,relationTo:r}),ai(oe,{CustomComponent:g,Fallback:ai(Ve,{description:n,path:x})})]}):null},mc=Oe(d$);import{jsx as li,jsxs as U3}from"react/jsx-runtime";import m$,{useCallback as Gg,useEffect as f$,useMemo as p$,useState as Wg}from"react";var h$="json-field",g$=t=>{let{field:e,field:{admin:{className:o,description:n,editorOptions:r,maxHeight:s}={},jsonSchema:i,label:l,localized:a,required:c},path:u,readOnly:d,validate:f}=t,[m,h]=Wg(),p=m$.useRef("system"),[g,b]=Wg(""),v=Gg((P,N)=>{if(typeof f=="function")return f(P,{...N,jsonError:m,required:c})},[f,c,m]),{customComponents:{AfterInput:x,BeforeInput:y,Description:C,Error:S,Label:w}={},disabled:F,initialValue:_,path:A,setValue:R,showError:I,value:D}=Ne({potentiallyStalePath:u,validate:v}),[E,T]=Wg(()=>(D||_)!==void 0?JSON.stringify(D??_,null,2):void 0),L=Gg((P,N)=>{if(!i)return;N.languages.json.jsonDefaults.setDiagnosticsOptions({enableSchemaRequest:!0,schemas:[...N.languages.json.jsonDefaults.diagnosticsOptions.schemas||[],i],validate:!0});let B=i.uri,M=B.includes("?")?`${B}&${crypto.randomUUID?crypto.randomUUID():Sn()}`:`${B}?${crypto.randomUUID?crypto.randomUUID():Sn()}`;P.setModel(N.editor.createModel(JSON.stringify(D,null,2),"json",N.Uri.parse(M)))},[i,D]),k=Gg(P=>{if(!(d||F)){p.current="user";try{R(P?JSON.parse(P):null),h(void 0)}catch(N){R(P||null),h(N)}}},[d,F,R]);f$(()=>{p.current==="system"&&(T((D||_)!==void 0?JSON.stringify(D??_,null,2):void 0),b(new Date().toString())),p.current="system"},[_,D]);let j=p$(()=>rt(e),[e]);return U3("div",{className:[Ie,h$,o,I&&"error",(d||F)&&"read-only"].filter(Boolean).join(" "),style:j,children:[li(oe,{CustomComponent:w,Fallback:li(ye,{label:l,localized:a,path:A,required:c})}),U3("div",{className:`${Ie}__wrap`,children:[li(oe,{CustomComponent:S,Fallback:li(We,{message:m,path:A,showError:I})}),y,li($l,{defaultLanguage:"json",maxHeight:s,onChange:k,onMount:L,options:r,readOnly:d||F,value:E,wrapperProps:{id:`field-${A?.replace(/\./g,"__")}`}},g),x]}),li(oe,{CustomComponent:C,Fallback:li(Ve,{description:n,path:A})})]})},fc=Oe(g$);import{jsx as Dn,jsxs as Y3}from"react/jsx-runtime";import{getTranslation as b$}from"@payloadcms/translations";import{isNumber as v$}from"payload/shared";import{useCallback as Hg,useEffect as x$,useMemo as y$,useState as C$}from"react";var w$=t=>{let{field:e,field:{admin:{className:o,description:n,placeholder:r,step:s=1}={},hasMany:i=!1,label:l,localized:a,max:c=1/0,maxRows:u=1/0,min:d=-1/0,required:f},onChange:m,path:h,readOnly:p,validate:g}=t,{i18n:b,t:v}=$(),x=Hg((P,N)=>{if(typeof g=="function")return g(P,{...N,max:c,min:d,required:f})},[g,d,c,f]),{customComponents:{AfterInput:y,BeforeInput:C,Description:S,Error:w,Label:F}={},disabled:_,path:A,setValue:R,showError:I,value:D}=Ne({potentiallyStalePath:h,validate:x}),E=Hg(P=>{let N=parseFloat(P.target.value),B=N;Number.isNaN(N)&&(B=null),typeof m=="function"&&m(B),R(B)},[m,R]),[T,L]=C$([]),k=Hg(P=>{if(!(p||_)){let N;P?Array.isArray(P)?N=P.map(B=>Number(B.value?.value||B.value)):N=[Number(P.value?.value||P.value)]:N=[],R(N)}},[p,_,R]);x$(()=>{i&&Array.isArray(D)&&L(D.map((P,N)=>({id:`${P}${N}`,label:`${P}`,value:{toString:()=>`${P}${N}`,value:P?.value||P}})))},[D,i]);let j=y$(()=>rt(e),[e]);return Y3("div",{className:[Ie,"number",o,I&&"error",(p||_)&&"read-only",i&&"has-many"].filter(Boolean).join(" "),style:j,children:[Dn(oe,{CustomComponent:F,Fallback:Dn(ye,{label:l,localized:a,path:A,required:f})}),Y3("div",{className:`${Ie}__wrap`,children:[Dn(oe,{CustomComponent:w,Fallback:Dn(We,{path:A,showError:I})}),C,i?Dn(ft,{className:`field-${A.replace(/\./g,"__")}`,disabled:p||_,filterOption:(P,N)=>{let B=Array.isArray(D)&&D.length>=u;return v$(N)&&!B},isClearable:!0,isCreatable:!0,isMulti:!0,isSortable:!0,noOptionsMessage:()=>Array.isArray(D)&&D.length>=u?v("validation:limitReached",{max:u,value:D.length+1}):null,onChange:k,options:[],placeholder:v("general:enterAValue"),showError:I,value:T}):Dn("div",{children:Dn("input",{disabled:p||_,id:`field-${A.replace(/\./g,"__")}`,max:c,min:d,name:A,onChange:E,onWheel:P=>{P.target.blur()},placeholder:b$(r,b),step:s,type:"number",value:typeof D=="number"?D:""})}),y,Dn(oe,{CustomComponent:S,Fallback:Dn(Ve,{description:n,path:A})})]})]})},pc=Oe(w$);import{jsx as tn,jsxs as ga}from"react/jsx-runtime";import{getTranslation as zg}from"@payloadcms/translations";import{useCallback as Z3,useMemo as S$}from"react";var J3="point",I$=t=>{let{field:e,field:{admin:{className:o,description:n,placeholder:r,step:s}={},label:i,localized:l,required:a},path:c,readOnly:u,validate:d}=t,{i18n:f,t:m}=$(),h=Z3((I,D)=>{if(typeof d=="function")return d(I,{...D,required:a})},[d,a]),{customComponents:{AfterInput:p,BeforeInput:g,Description:b,Error:v,Label:x}={},disabled:y,path:C,setValue:S,showError:w,value:F=[null,null]}=Ne({potentiallyStalePath:c,validate:h}),_=Z3((I,D)=>{let E=parseFloat(I.target.value);Number.isNaN(E)&&(E=I.target.value);let T=[...F];T[D]=E,S(T)},[S,F]),A=I=>{let D=m(I==="longitude"?"fields:longitude":"fields:latitude"),E=i?zg(i,f):"";return`${E}${E?" - ":""}${D}`},R=S$(()=>rt(e),[e]);return ga("div",{className:[Ie,J3,o,w&&"error",(u||y)&&"read-only"].filter(Boolean).join(" "),style:R,children:[ga("ul",{className:`${J3}__wrap`,children:[ga("li",{children:[tn(oe,{CustomComponent:x,Fallback:tn(ye,{label:A("longitude"),localized:l,path:C,required:a})}),ga("div",{className:"input-wrapper",children:[g,tn("input",{disabled:u||y,id:`field-longitude-${C?.replace(/\./g,"__")}`,name:`${C}.longitude`,onChange:I=>_(I,0),placeholder:zg(r,f),step:s,type:"number",value:F&&typeof F[0]=="number"?F[0]:""}),p]})]}),ga("li",{children:[tn(oe,{CustomComponent:x,Fallback:tn(ye,{label:A("latitude"),localized:l,path:C,required:a})}),ga("div",{className:"input-wrapper",children:[tn(oe,{CustomComponent:v,Fallback:tn(We,{path:C,showError:w})}),g,tn("input",{disabled:u||y,id:`field-latitude-${C?.replace(/\./g,"__")}`,name:`${C}.latitude`,onChange:I=>_(I,1),placeholder:zg(r,f),step:s,type:"number",value:F&&typeof F[1]=="number"?F[1]:""}),p]})]})]}),tn(oe,{CustomComponent:b,Fallback:tn(Ve,{description:n,path:C})})]})},hc=Oe(I$);import{jsx as Fn,jsxs as q3}from"react/jsx-runtime";import{optionIsObject as Q3}from"payload/shared";import{useCallback as F$,useMemo as A$}from"react";import{c as R$}from"react/compiler-runtime";import{jsx as Dm,jsxs as _$}from"react/jsx-runtime";import{getTranslation as D$}from"@payloadcms/translations";import"react";var gc="radio-input",bc=t=>{let e=R$(16),{isSelected:o,onChange:n,option:r,path:s,readOnly:i,uuid:l}=t,{i18n:a}=$(),c=ct(),u=`field-${s}-${r.value}${c>1?`-${c}`:""}${l?`-${l}`:""}`,d=o&&`${gc}--is-selected`,f;e[0]!==d?(f=[gc,d].filter(Boolean),e[0]=d,e[1]=f):f=e[1];let m=f.join(" "),h;e[2]!==n||e[3]!==r.value?(h=()=>typeof n=="function"?n(r.value):null,e[2]=n,e[3]=r.value,e[4]=h):h=e[4];let p;if(e[5]!==a||e[6]!==u||e[7]!==o||e[8]!==r.label||e[9]!==s||e[10]!==i||e[11]!==m||e[12]!==h){let g=Dm("input",{checked:o,disabled:i,id:u,name:s,onChange:h,type:"radio"}),b=i&&`${gc}__styled-radio--disabled`,v;e[14]!==b?(v=[`${gc}__styled-radio`,b].filter(Boolean),e[14]=b,e[15]=v):v=e[15],p=Dm("label",{htmlFor:u,children:_$("div",{className:m,children:[g,Dm("span",{className:v.join(" ")}),Dm("span",{className:`${gc}__label`,children:D$(r.label,a)})]})}),e[5]=a,e[6]=u,e[7]=o,e[8]=r.label,e[9]=s,e[10]=i,e[11]=m,e[12]=h,e[13]=p}else p=e[13];return p};var Fm="radio-group",T$=t=>{let{disableModifyingForm:e,field:o,field:{admin:{className:n,description:r,layout:s="horizontal"}={},label:i,localized:l,options:a=[],required:c}={},onChange:u,path:d,readOnly:f,validate:m,value:h}=t,{uuid:p}=Me(),g=F$((D,E)=>{if(typeof m=="function")return m(D,{...E,options:a,required:c})},[m,a,c]),{customComponents:{AfterInput:b,BeforeInput:v,Description:x,Error:y,Label:C}={},disabled:S,path:w,setValue:F,showError:_,value:A}=Ne({potentiallyStalePath:d,validate:g}),R=A||h,I=A$(()=>rt(o),[o]);return q3("div",{className:[Ie,Fm,n,`${Fm}--layout-${s}`,_&&"error",(f||S)&&`${Fm}--read-only`].filter(Boolean).join(" "),style:I,children:[Fn(oe,{CustomComponent:y,Fallback:Fn(We,{path:w,showError:_})}),Fn(oe,{CustomComponent:C,Fallback:Fn(ye,{label:i,localized:l,path:w,required:c})}),q3("div",{className:`${Ie}__wrap`,children:[v,Fn("ul",{className:`${Fm}--group`,id:`field-${w.replace(/\./g,"__")}`,children:a.map(D=>{let E="";Q3(D)?E=D.value:E=D;let T=String(E)===String(R),L=`field-${w}-${E}${p?`-${p}`:""}`;return Fn("li",{children:Fn(bc,{id:L,isSelected:T,onChange:()=>{typeof u=="function"&&u(E),f||S||F(E,!!e)},option:Q3(D)?D:{label:D,value:D},path:w,readOnly:f||S,uuid:p})},`${w} - ${E}`)})}),b,Fn(oe,{CustomComponent:x,Fallback:Fn(Ve,{description:r,path:w})})]})]})},vc=Oe(T$);import{jsx as Br,jsxs as Jg}from"react/jsx-runtime";import{dequal as ok}from"dequal/lite";import{formatAdminURL as rk,wordBoundariesRegex as nk}from"payload/shared";import*as qg from"qs-esm";import{useCallback as An,useEffect as Nm,useMemo as hS,useReducer as sk,useRef as Cc,useState as us}from"react";import{c as E$}from"react/compiler-runtime";import{jsx as on,jsxs as Am}from"react/jsx-runtime";import{getTranslation as K3}from"@payloadcms/translations";import{Fragment as Xg,useEffect as Tm,useState as xc}from"react";var ba="relationship-add-new",eS=t=>{let e=E$(45),{Button:o,hasMany:n,path:r,relationTo:s,setValue:i,unstyled:l,value:a}=t,c=dm(s),{permissions:u}=De(),[d,f]=xc(!1),[m,h]=xc(),p=c.length>1,g;e[0]!==c[0]||e[1]!==p?(g=()=>p?void 0:c[0],e[0]=c[0],e[1]=p,e[2]=g):g=e[2];let[b,v]=xc(g),[x,y]=xc(!1),{i18n:C,t:S}=$(),[w,F]=xc(!1),_=b?.slug,A;e[3]!==_?(A={collectionSlug:_},e[3]=_,e[4]=A):A=e[4];let[R,I,D]=qt(A),{isDrawerOpen:E,toggleDrawer:T}=D,L;e[5]!==b?.slug||e[6]!==n||e[7]!==s||e[8]!==i||e[9]!==a?(L=H=>{let{doc:le,operation:q}=H;if(q==="create"){let fe=Array.isArray(s)?{relationTo:b?.slug,value:le.id}:le.id;(Array.isArray(s)&&Array.isArray(a)?!a.some(J=>J&&typeof J=="object"&&J.value===le.id):a!==le.id)&&i(n?[...Array.isArray(a)?a:[],fe]:fe),h(void 0)}},e[5]=b?.slug,e[6]=n,e[7]=s,e[8]=i,e[9]=a,e[10]=L):L=e[10];let k=L,j;e[11]===Symbol.for("react.memo_cache_sentinel")?(j=H=>{y(H)},e[11]=j):j=e[11];let P=j,N,B;e[12]!==u||e[13]!==c?(N=()=>{u&&(c.length===1?f(u.collections[c[0]?.slug]?.create):f(c.some(H=>u.collections[H?.slug]?.create)))},B=[u,c],e[12]=u,e[13]=c,e[14]=N,e[15]=B):(N=e[14],B=e[15]),Tm(N,B);let M,O;e[16]!==c||e[17]!==p||e[18]!==m?(O=()=>{p&&m&&v(c.find(H=>H?.slug===m))},M=[m,p,c],e[16]=c,e[17]=p,e[18]=m,e[19]=M,e[20]=O):(M=e[19],O=e[20]),Tm(O,M);let V,G;e[21]!==b||e[22]!==p||e[23]!==T?(V=()=>{p&&b&&(T(),h(void 0))},G=[T,p,b],e[21]=b,e[22]=p,e[23]=T,e[24]=V,e[25]=G):(V=e[24],G=e[25]),Tm(V,G);let z,X;e[26]!==E||e[27]!==p?(z=()=>{p&&!E&&v(void 0)},X=[E,p],e[26]=E,e[27]=p,e[28]=z,e[29]=X):(z=e[28],X=e[29]),Tm(z,X);let te=c[0].labels.singular,Y;if(e[30]!==o||e[31]!==R||e[32]!==I||e[33]!==b||e[34]!==C||e[35]!==k||e[36]!==r||e[37]!==u||e[38]!==x||e[39]!==c||e[40]!==d||e[41]!==w||e[42]!==S||e[43]!==l){Y=Symbol.for("react.early_return_sentinel");e:{let H=S("fields:addNewLabel",{label:K3(te,C)});if(d){Y=Am("div",{className:ba,id:`${r}-add-new`,children:[c.length===1&&Am(Xg,{children:[on(I,{className:[`${ba}__add-button`,l&&`${ba}__add-button--unstyled`].filter(Boolean).join(" "),onClick:()=>F(!1),onMouseEnter:()=>F(!0),onMouseLeave:()=>F(!1),children:o||Am(Xg,{children:[on(go,{className:`${ba}__tooltip`,show:w,children:H}),on(jo,{})]})}),on(R,{onSave:k})]}),c.length>1&&Am(Xg,{children:[on(ho,{button:o||on(se,{buttonStyle:"none",className:`${ba}__add-button`,tooltip:x?void 0:S("fields:addNew"),children:on(jo,{})}),buttonType:"custom",horizontalAlign:"center",onToggleOpen:P,render:le=>{let{close:q}=le;return on(fp,{children:c.map(fe=>u.collections[fe?.slug].create?on(pp,{className:`${ba}__relation-button--${fe?.slug}`,onClick:()=>{q(),h(fe?.slug)},children:K3(fe?.labels?.singular,C)},fe?.slug):null)})},size:"medium"}),b&&u.collections[b?.slug]?.create&&on(R,{onSave:k})]})]});break e}}e[30]=o,e[31]=R,e[32]=I,e[33]=b,e[34]=C,e[35]=k,e[36]=r,e[37]=u,e[38]=x,e[39]=c,e[40]=d,e[41]=w,e[42]=S,e[43]=l,e[44]=Y}else Y=e[44];return Y!==Symbol.for("react.early_return_sentinel")?Y:null};import{c as L$}from"react/compiler-runtime";import{jsx as Pm}from"react/jsx-runtime";import{createElement as $$}from"react";import{useEffect as nS,useId as k$,useState as sS}from"react";import{jsx as tS,jsxs as P$}from"react/jsx-runtime";import{hoistQueryParamsToAnd as N$}from"payload/shared";import{useCallback as Em,useEffect as oS,useState as Ug}from"react";var rS=({allowCreate:t=!0,collectionSlugs:e,disableQueryPresets:o,drawerSlug:n,enableRowSelections:r,filterOptions:s,onBulkSelect:i,onSelect:l,overrideEntityVisibility:a=!0,selectedCollection:c})=>{let{closeModal:u,isModalOpen:d}=ue(),{serverFunction:f}=Ft(),[m,h]=Ug(void 0),[p,g]=Ug(!0),{config:{collections:b},getEntityConfig:v}=W(),x=d(n),y=b.filter(({slug:T})=>e.includes(T)),[C,S]=Ug(()=>{let T=c||y[0]?.slug,L=v({collectionSlug:T});return L?{label:L.labels,value:L.slug}:void 0}),[w,F,{drawerSlug:_}]=qt({collectionSlug:C.value}),A=to(T=>{T&&T!==C?.value&&S({label:v({collectionSlug:T})?.labels,value:T})});oS(()=>{A(c)},[c]);let R=Em(async(T,L)=>{try{let k={...L||{},where:{...L?.where||{}}},j=s?.[T];s&&typeof j!="boolean"&&(k.where=N$(k.where,j));let{List:P}=await f({name:"render-list",args:{allowCreate:t,collectionSlug:T,disableBulkDelete:!0,disableBulkEdit:!0,disableQueryPresets:o,drawerSlug:n,enableRowSelections:r,overrideEntityVisibility:a,query:k}});h(P),g(!1)}catch(k){console.error("Error rendering List View: ",k),x&&u(n)}},[f,u,t,n,x,r,s,a,o]);oS(()=>{m||R(C.value)},[R,m,C.value]);let I=Em(({doc:T})=>{typeof l=="function"&&l({collectionSlug:C.value,doc:T,docID:T.id}),u(_),u(n)},[u,_,n,l,C.value]),D=Em(T=>{R(C.value,T)},[R,C.value]),E=Em(T=>{S(T),R(T.value)},[R]);return p?tS(Rn,{}):P$(gg,{allowCreate:t,createNewDrawerSlug:_,DocumentDrawerToggler:F,drawerSlug:n,enabledCollections:e,onBulkSelect:i,onQueryChange:D,onSelect:l,selectedOption:C,setSelectedOption:E,children:[m,tS(w,{onSave:I})]})};var iS="list-drawer",j$=({depth:t,uuid:e})=>`list-drawer_${t}_${e}`,O$=({children:t,className:e,disabled:o,drawerSlug:n,onClick:r,...s})=>Pm(dr,{className:[e,`${iS}__toggler`].filter(Boolean).join(" "),disabled:o,onClick:r,slug:n,...s,children:t}),M$=t=>{let{drawerSlug:e}=t;return Pm(Lt,{className:iS,gutter:!1,Header:null,slug:e,children:Pm(rS,{...t})})},ci=t=>{let e=L$(42),{collectionSlugs:o,filterOptions:n,selectedCollection:r,uploads:s}=t,{config:i}=W(),{collections:l}=i,a=ct(),c=k$(),{closeModal:u,modalState:d,openModal:f,toggleModal:m}=ue(),[h,p]=sS(!1),[g,b]=sS(o),v;e[0]!==a||e[1]!==c?(v=j$({depth:a,uuid:c}),e[0]=a,e[1]=c,e[2]=v):v=e[2];let x=v,y,C;e[3]!==x||e[4]!==d?(y=()=>{p(!!d[x]?.isOpen)},C=[d,x],e[3]=x,e[4]=d,e[5]=y,e[6]=C):(y=e[5],C=e[6]),nS(y,C);let S,w;e[7]!==g||e[8]!==l||e[9]!==s?(S=()=>{if(!g||g.length===0){let V=l.filter(G=>{let{upload:z}=G;return s?!!z:!0});b(V.map(B$))}},w=[g,s,l],e[7]=g,e[8]=l,e[9]=s,e[10]=S,e[11]=w):(S=e[10],w=e[11]),nS(S,w);let F;e[12]!==x||e[13]!==m?(F=()=>{m(x)},e[12]=x,e[13]=m,e[14]=F):F=e[14];let _=F,A;e[15]!==u||e[16]!==x?(A=()=>{u(x)},e[15]=u,e[16]=x,e[17]=A):A=e[17];let R=A,I;e[18]!==x||e[19]!==f?(I=()=>{f(x)},e[18]=x,e[19]=f,e[20]=I):I=e[20];let D=I,E,T;e[21]!==R||e[22]!==g||e[23]!==x||e[24]!==n||e[25]!==r||e[26]!==s?(T=V=>$$(M$,{...V,closeDrawer:R,collectionSlugs:g,drawerSlug:x,filterOptions:n,key:x,selectedCollection:r,uploads:s}),e[21]=R,e[22]=g,e[23]=x,e[24]=n,e[25]=r,e[26]=s,e[27]=T):T=e[27],E=T;let L=E,k,j;e[28]!==x?(j=V=>Pm(O$,{...V,drawerSlug:x}),e[28]=x,e[29]=j):j=e[29],k=j;let P=k,N,B;e[30]!==R||e[31]!==g||e[32]!==a||e[33]!==x||e[34]!==h||e[35]!==D||e[36]!==_?(B={closeDrawer:R,collectionSlugs:g,drawerDepth:a,drawerSlug:x,isDrawerOpen:h,openDrawer:D,setCollectionSlugs:b,toggleDrawer:_},e[30]=R,e[31]=g,e[32]=a,e[33]=x,e[34]=h,e[35]=D,e[36]=_,e[37]=B):B=e[37],N=B;let M=N,O;return e[38]!==L||e[39]!==M||e[40]!==P?(O=[L,P,M],e[38]=L,e[39]=M,e[40]=P,e[41]=O):O=e[41],O};function B$(t){let{slug:e}=t;return e}import{c as V$}from"react/compiler-runtime";import{useRef as G$}from"react";var Yg=(t,e)=>{let o=V$(3),n=G$(void 0),r;return o[0]!==t||o[1]!==e?(r=(...s)=>{let i=s,l=()=>{clearTimeout(n.current),t(...i)};clearTimeout(n.current),n.current=setTimeout(l,e)},o[0]=t,o[1]=e,o[2]=r):r=o[2],r};var Zg=({hasMany:t,relationTo:e,value:o})=>{let n=Array.isArray(e),r;if(Array.isArray(e)?r=e.reduce((i,l)=>({...i,[l]:[]}),{}):r={[e]:[]},o===null)return r;let s=(i,l)=>{(typeof l=="string"||typeof l=="number")&&typeof i=="string"&&(r[i]?r[i].push(l):r[i]=[l])};return t&&Array.isArray(o)?o.forEach(i=>{n&&typeof i=="object"&&"relationTo"in i&&"value"in i&&s(i.relationTo,i.value),!n&&typeof e=="string"&&s(e,i)}):n&&Array.isArray(e)?typeof o=="object"&&"relationTo"in o&&"value"in o&&s(o.relationTo,o.value):s(e,o),r};var aS=({allowEdit:t,options:e,value:o})=>{if(o||typeof o=="number"){if(Array.isArray(o))return o.map(r=>{let s;return e.forEach(i=>{s||(s=i.options.find(l=>typeof r=="object"?l.value===r.value&&l.relationTo===r.relationTo:r===l.value))}),s?{allowEdit:t,...s}:void 0});let n;return e.forEach(r=>{n||(n=r.options.find(s=>typeof o=="object"?s.value===o.value&&s.relationTo===o.relationTo:o===s.value))}),n?{allowEdit:t,...n}:void 0}};import{getTranslation as W$}from"@payloadcms/translations";var cS=t=>t.reduce((e,o)=>o.options?[...e,...cS(o.options)]:[...e,{id:o.value,relationTo:o.relationTo}],[]),lS=t=>t.sort((e,o)=>typeof e?.label?.localeCompare=="function"&&typeof o?.label?.localeCompare=="function"?e.label.localeCompare(o.label):0),uS=(t,e)=>{switch(e.type){case"ADD":{let{collection:o,config:n,docs:r,i18n:s,ids:i=[],sort:l}=e,a=o.slug,c=cS(t),u=[...t],d=u.find(m=>m.label===o.labels.plural),f=r.reduce((m,h)=>{if(c.filter(p=>p.id===h.id&&p.relationTo===a).length===0){c.push({id:h.id,relationTo:a});let p=mr({collectionConfig:o,data:h,dateFormat:n.admin.dateFormat,fallback:`${s.t("general:untitled")} - ID: ${h.id}`,i18n:s});return[...m,{label:p,relationTo:a,value:h.id}]}return m},[]);if(i.forEach(m=>{c.filter(h=>h.id===m&&h.relationTo===a).length===0&&(c.push({id:m,relationTo:a}),f.push({allowEdit:!1,label:`${s.t("general:untitled")} - ID: ${m}`,relationTo:a,value:m}))}),d){let m=[...d.options,...f];d.options=l?lS(m):m}else u.push({label:W$(o.labels.plural,s),options:l?lS(f):f});return u}case"CLEAR":{let o=e.exemptValues?Array.isArray(e.exemptValues)?e.exemptValues:[e.exemptValues]:[];return t.filter(r=>{let s=r.options.filter(i=>o?o.some(l=>l&&i.value===(typeof l=="object"?l.value:l)):!1);return r.options=s,s.length>0})}case"REMOVE":{let{id:o,collection:n}=e,r=[...t],s=r.findIndex(i=>i.label===n.labels.plural);return s===-1||(r[s]={...r[s],options:r[s].options.filter(i=>i.value!==o)}),r}case"UPDATE":{let{collection:o,config:n,doc:r,i18n:s}=e,i=o.slug,l=[...t],a=mr({collectionConfig:o,data:r,dateFormat:n.admin.dateFormat,fallback:`${s.t("general:untitled")} - ID: ${r.id}`,i18n:s}),u=l.find(d=>d.label===o.labels.plural)?.options?.find(d=>d.value===r.id);return u&&(u.label=a,u.relationTo=i),l}default:return t}};import{c as H$}from"react/compiler-runtime";import{jsx as yc,jsxs as dS}from"react/jsx-runtime";import{Fragment as z$,useState as X$}from"react";var va="relationship--multi-value-label",mS=t=>{let e=H$(26),{data:o,selectProps:n}=t,{allowEdit:r,label:s,relationTo:i,value:l}=o,a;e[0]!==n?(a=n===void 0?{}:n,e[0]=n,e[1]=a):a=e[1];let{customProps:c}=a,u;e[2]!==c?(u=c===void 0?{}:c,e[2]=c,e[3]=u):u=e[3];let{draggableProps:d,onDocumentOpen:f}=u,{permissions:m}=De(),[h,p]=X$(!1),{t:g}=$(),b=!!m?.collections?.[i]?.read,v;e[4]!==d?(v=d||{},e[4]=d,e[5]=v):v=e[5];let x;if(e[6]!==r||e[7]!==b||e[8]!==s||e[9]!==f||e[10]!==t||e[11]!==i||e[12]!==h||e[13]!==g||e[14]!==v||e[15]!==l){let y;e[17]!==r||e[18]!==b||e[19]!==s||e[20]!==f||e[21]!==i||e[22]!==h||e[23]!==g||e[24]!==l?(y=i&&b&&r!==!1&&yc(z$,{children:dS("button",{"aria-label":`Edit ${s}`,className:`${va}__drawer-toggler`,onClick:C=>{p(!1),f({id:l,collectionSlug:i,hasReadPermission:b,openInNewTab:C.metaKey||C.ctrlKey})},onKeyDown:U$,onMouseDown:Y$,onMouseEnter:()=>p(!0),onMouseLeave:()=>p(!1),onTouchEnd:Z$,type:"button",children:[yc(go,{className:`${va}__tooltip`,show:h,children:g("general:editLabel",{label:""})}),yc(_r,{className:`${va}__icon`})]})}),e[17]=r,e[18]=b,e[19]=s,e[20]=f,e[21]=i,e[22]=h,e[23]=g,e[24]=l,e[25]=y):y=e[25],x=dS("div",{className:va,children:[yc("div",{className:`${va}__content`,children:yc(uo.MultiValueLabel,{...t,innerProps:{className:`${va}__text`,...v}})}),y]}),e[6]=r,e[7]=b,e[8]=s,e[9]=f,e[10]=t,e[11]=i,e[12]=h,e[13]=g,e[14]=v,e[15]=l,e[16]=x}else x=e[16];return x};function U$(t){t.key==="Enter"&&t.stopPropagation()}function Y$(t){return t.stopPropagation()}function Z$(t){return t.stopPropagation()}import{c as J$}from"react/compiler-runtime";import{jsx as xa,jsxs as fS}from"react/jsx-runtime";import{Fragment as q$,useState as Q$}from"react";var ya="relationship--single-value",pS=t=>{let e=J$(24),{children:o,data:n,selectProps:r}=t,{allowEdit:s,label:i,relationTo:l,value:a}=n,c;e[0]!==r?(c=r===void 0?{}:r,e[0]=r,e[1]=c):c=e[1];let{customProps:u}=c,d;e[2]!==u?(d=u===void 0?{}:u,e[2]=u,e[3]=d):d=e[3];let{onDocumentOpen:f}=d,[m,h]=Q$(!1),{t:p}=$(),{permissions:g}=De(),b=!!g?.collections?.[l]?.read,v;if(e[4]!==s||e[5]!==o||e[6]!==b||e[7]!==i||e[8]!==f||e[9]!==t||e[10]!==l||e[11]!==m||e[12]!==p||e[13]!==a){let x;e[15]!==s||e[16]!==b||e[17]!==i||e[18]!==f||e[19]!==l||e[20]!==m||e[21]!==p||e[22]!==a?(x=l&&b&&s!==!1&&xa(q$,{children:fS("button",{"aria-label":p("general:editLabel",{label:i}),className:`${ya}__drawer-toggler`,onClick:y=>{h(!1),f({id:a,collectionSlug:l,hasReadPermission:b,openInNewTab:y.metaKey||y.ctrlKey})},onKeyDown:K$,onMouseDown:ek,onMouseEnter:()=>h(!0),onMouseLeave:()=>h(!1),onTouchEnd:tk,type:"button",children:[xa(go,{className:`${ya}__tooltip`,show:m,children:p("general:edit")}),xa(_r,{})]})}),e[15]=s,e[16]=b,e[17]=i,e[18]=f,e[19]=l,e[20]=m,e[21]=p,e[22]=a,e[23]=x):x=e[23],v=xa(uo.SingleValue,{...t,className:ya,children:xa("div",{className:`${ya}__label`,children:fS("div",{className:`${ya}__label-text`,children:[xa("div",{className:`${ya}__text`,children:o}),x]})})}),e[4]=s,e[5]=o,e[6]=b,e[7]=i,e[8]=f,e[9]=t,e[10]=l,e[11]=m,e[12]=p,e[13]=a,e[14]=v}else v=e[14];return v};function K$(t){t.key==="Enter"&&t.stopPropagation()}function ek(t){return t.stopPropagation()}function tk(t){return t.stopPropagation()}var ik=10,wc="relationship",ak=t=>{let{field:e,field:{admin:{allowCreate:o=!0,allowEdit:n=!0,appearance:r="select",className:s,description:i,isSortable:l=!0,placeholder:a,sortOptions:c}={},hasMany:u,label:d,localized:f,relationTo:m,required:h},path:p,readOnly:g,validate:b}=t,{config:v,getEntityConfig:x}=W(),{routes:{api:y},serverURL:C}=v,{i18n:S,t:w}=$(),{permissions:F}=De(),{code:_}=$e(),A=Array.isArray(m),[R,I]=us({id:void 0,collectionSlug:void 0,hasReadPermission:!1}),[D,E]=us(-1),[T,L]=us({}),[k,j]=us(""),[P,N]=us(""),[B,M]=us(!1),[O,V]=us(!1),[G,z]=us(!1),X=Cc(!1),te=An((Z,re)=>{if(typeof b=="function")return b(Z,{...re,required:h})},[b,h]),{customComponents:{AfterInput:Y,BeforeInput:H,Description:le,Error:q,Label:fe}={},disabled:ae,filterOptions:J,initialValue:ge,path:Ce,setValue:he,showError:Le,value:Ae}=Ne({potentiallyStalePath:p,validate:te}),[Q,ke]=sk(uS,[]),xe=Cc(Ae);xe.current=Ae;let[ce,,{isDrawerOpen:ne,openDrawer:U}]=qt({id:R.id,collectionSlug:R.collectionSlug}),ie=hS(()=>{let Z=J;if(Ae){let re=(Array.isArray(Ae)?Ae:[Ae]).reduce((pe,ve)=>{if(typeof ve=="object"&&ve.relationTo)pe[ve.relationTo]||(pe[ve.relationTo]=[]),pe[ve.relationTo].push(ve.value);else if(ve){let we=Array.isArray(m)?void 0:m;we&&(pe[we]||(pe[we]=[]),pe[we].push(ve))}return pe},{});(Array.isArray(m)?m:[m]).forEach(pe=>{Z={...Z||{},[pe]:{...typeof J?.[pe]=="object"?J[pe]:{},...re[pe]?{id:{not_in:re[pe]}}:{}}}})}return Z},[J,Ae,m]),[de,,{closeDrawer:Te,isDrawerOpen:Ge,openDrawer:je}]=ci({collectionSlugs:A?m:[m],filterOptions:ie}),lt=An(({collectionSlug:Z,doc:re})=>{let pe=A?{relationTo:Z,value:re.id}:re.id;if(u){let ve=Array.isArray(Ae)?Ae:[];he([...ve,pe])}else he(pe);Te()},[u,A,he,Te,Ae]),Ue=Cc(!1),He=An(async({filterOptions:Z,lastFullyLoadedRelation:re,lastLoadedPage:pe,onSuccess:ve,search:we,sort:Ee,value:po})=>{if(!F)return;let no=typeof re<"u"?re:-1,Ye=Array.isArray(m)?m:[m],so=no===-1?Ye:Ye.slice(no+1),eo=0,Fo=Zg({hasMany:u,relationTo:m,value:po});k||(await so.reduce(async(Qe,wt)=>{let Xo=Z?.[wt],zt;if(P!==we?zt=1:zt=pe[wt]+1,await Qe,Xo===!1)return E(Ye.indexOf(wt)),Promise.resolve();if(eo<10){let Uo=x({collectionSlug:wt}),Ka=Uo?.admin?.useAsTitle||"id",el=Uo?.defaultSort||"id";typeof c=="string"?el=c:c?.[wt]&&(el=c[wt]);let Fs={depth:0,draft:!0,limit:ik,locale:_,page:zt,select:{[Ka]:!0},sort:el,where:{and:[{id:{not_in:Fo[wt]}}]}};we&&Fs.where.and.push({[Ka]:{like:we}}),Xo&&typeof Xo!="boolean"&&Fs.where.and.push(Xo);let tl=await fetch(`${C}${y}/${wt}`,{body:qg.stringify(Fs),credentials:"include",headers:{"Accept-Language":S.language,"Content-Type":"application/x-www-form-urlencoded","X-HTTP-Method-Override":"GET"},method:"POST"});if(tl.ok){let dn=await tl.json();L(Cu=>({...Cu,[wt]:zt})),dn.nextPage||E(Ye.indexOf(wt)),dn.docs.length>0&&(eo+=dn.docs.length,ke({type:"ADD",collection:Uo,config:v,docs:dn.docs,i18n:S,sort:Ee}))}else tl.status===403?(E(Ye.indexOf(wt)),ke({type:"ADD",collection:Uo,config:v,docs:[],i18n:S,ids:Fo[wt],sort:Ee})):j(w("error:unspecific"))}},Promise.resolve()),typeof ve=="function"&&ve())},[F,m,u,k,P,x,_,C,c,y,S,v,w]),dt=Yg((Z,re)=>{He({filterOptions:J,lastLoadedPage:{},search:Z,sort:!0,value:re}),N(Z)},300),Kt=An((Z,re)=>{P!==Z&&(L({}),dt(Z,re,Z!==""))},[P,dt]),ze=to(Z=>{let re=Zg({hasMany:u,relationTo:m,value:Z});Object.entries(re).reduce(async(pe,[ve,we])=>{await pe;let Ee=we.filter(po=>!Q.find(no=>no?.options?.find(Ye=>Ye.value===po&&Ye.relationTo===ve)));if(Ee.length>0){let po={depth:0,draft:!0,limit:Ee.length,locale:_,where:{id:{in:Ee}}};if(!k){let no=await fetch(`${C}${y}/${ve}`,{body:qg.stringify(po),credentials:"include",headers:{"Accept-Language":S.language,"Content-Type":"application/x-www-form-urlencoded","X-HTTP-Method-Override":"GET"},method:"POST"}),Ye=x({collectionSlug:ve}),so=[];no.ok&&(so=(await no.json()).docs),ke({type:"ADD",collection:Ye,config:v,docs:so,i18n:S,ids:Ee,sort:!0})}}},Promise.resolve())}),Je=Cc(Ae),Xe=Cc(!0);Nm(()=>{(Xe.current||!ok(Ae,Je.current))&&ze(Ae),Xe.current=!1,Je.current=Ae},[Ae]),Nm(()=>{let re=(Array.isArray(m)?m:[m]).reduce((pe,ve)=>(x({collectionSlug:ve})?.admin?.useAsTitle||"id")==="id"&&pe,!0);V(!re)},[m,x]);let Ct=to(async Z=>await He(Z));Nm(()=>{X.current&&G&&(M(!0),Ct({filterOptions:J,lastLoadedPage:{},onSuccess:()=>{X.current=!0,M(!1)},value:xe.current})),ke({type:"CLEAR",exemptValues:xe.current}),E(-1),L({})},[m,J,_,Ce,G]);let Et=An(Z=>{ke({type:"UPDATE",collection:Z.collectionConfig,config:v,doc:Z.doc,i18n:S});let re=xe.current,pe=Z.doc.id;if(u){let ve=re.some(Ee=>typeof Ee=="string"?Ee===pe:Ee.value===pe),we=re.map(Ee=>Ee.value===pe?{relationTo:Z.collectionConfig.slug,value:pe}:Ee);he(we,ve)}else{let ve=re===pe;he({relationTo:Z.collectionConfig.slug,value:pe},ve)}},[S,v,u,he]),gt=An(Z=>{ke({type:"ADD",collection:Z.collectionConfig,config:v,docs:[Z.doc],i18n:S,sort:!0}),he(u?xe.current?xe.current.concat({relationTo:Z.collectionConfig.slug,value:Z.doc.id}):null:{relationTo:Z.collectionConfig.slug,value:Z.doc.id})},[S,v,u,he]),qe=An(Z=>{ke({id:Z.id,type:"REMOVE",collection:Z.collectionConfig,config:v,i18n:S}),he(u&&xe.current?xe.current.filter(re=>re.value!==Z.id):null)},[S,v,u,he]),Pt=An((Z,re)=>{if(!re)return!0;let pe=nk(re||""),ve=250,we=String(Z.label);for(;we.length>ve;){let Ee=we.indexOf(" ",re.length);if(pe.test(we.slice(0,Ee===-1?re.length:Ee+1)))return!0;we=we.slice(Ee===-1?re.length:Ee+1)}return pe.test(we.slice(-ve))},[]),be=An(({id:Z,collectionSlug:re,hasReadPermission:pe,openInNewTab:ve})=>{if(ve){if(pe&&Z&&re){let we=rk({adminRoute:v.routes.admin,path:`/collections/${re}/${Z}`});window.open(we,"_blank")}}else Ue.current=!0,I({id:Z,collectionSlug:re,hasReadPermission:pe})},[I,v.routes.admin]);Nm(()=>{Ue.current&&(U(),Ue.current=!1)},[U,R]);let ee=aS({allowEdit:n,options:Q,value:Ae});!Array.isArray(ee)&&ee?.value==="null"&&(ee.value=null);let K=hS(()=>rt(e),[e]);return Jg("div",{className:[Ie,wc,s,Le&&"error",k&&"error-loading",(g||ae)&&`${wc}--read-only`,!(g||ae)&&o&&`${wc}--allow-create`].filter(Boolean).join(" "),id:`field-${Ce.replace(/\./g,"__")}`,style:K,children:[Br(oe,{CustomComponent:fe,Fallback:Br(ye,{label:d,localized:f,path:Ce,required:h})}),Jg("div",{className:`${Ie}__wrap`,children:[Br(oe,{CustomComponent:q,Fallback:Br(We,{path:Ce,showError:Le})}),H,!k&&Jg("div",{className:`${wc}__wrap`,children:[Br(ft,{backspaceRemovesValue:!(ne||Ge),components:{MultiValueLabel:mS,SingleValue:pS,...r!=="select"&&{DropdownIndicator:null}},customProps:{disableKeyDown:ne||Ge,disableMouseDown:ne||Ge,onDocumentOpen:be,onSave:Et},disabled:g||ae||ne||Ge,filterOption:O?Pt:void 0,getOptionValue:Z=>{if(Z)return u&&Array.isArray(m)?`${Z.relationTo}_${Z.value}`:Z.value},isLoading:r==="select"&&B,isMulti:u,isSearchable:r==="select",isSortable:l,menuIsOpen:r==="select"?G:!1,onChange:g||ae?void 0:Z=>{Z===null?he(u?[]:null):u&&Array.isArray(Z)?he(Z?Z.map(re=>A?{relationTo:re.relationTo,value:re.value}:re.value):null):A&&!Array.isArray(Z)?he({relationTo:Z.relationTo,value:Z.value}):Array.isArray(Z)||he(Z.value)},onInputChange:Z=>Kt(Z,Ae),onMenuClose:()=>{z(!1)},onMenuOpen:()=>{r==="drawer"?je():r==="select"&&(z(!0),X.current||(M(!0),He({filterOptions:J,lastLoadedPage:{},onSuccess:()=>{X.current=!0,M(!1)},value:ge})))},onMenuScrollToBottom:()=>{He({filterOptions:J,lastFullyLoadedRelation:D,lastLoadedPage:T,search:P,sort:!1,value:ge})},options:Q,placeholder:a,showError:Le,value:ee??null}),!(g||ae)&&o&&Br(eS,{hasMany:u,path:Ce,relationTo:m,setValue:he,value:Ae})]}),k&&Br("div",{className:`${wc}__error-loading`,children:k}),Y,Br(oe,{CustomComponent:le,Fallback:Br(Ve,{description:i,path:Ce})})]}),R.collectionSlug&&R.hasReadPermission&&Br(ce,{onDelete:qe,onDuplicate:gt,onSave:Et}),r==="drawer"&&!g&&Br(de,{allowCreate:o,enableRowSelections:!1,onSelect:lt})]})},Sc=Oe(ak);var Ic=()=>null;import{jsx as Qg}from"react/jsx-runtime";import"react";var gS="row",lk=t=>{let{field:{admin:{className:e,style:o}={},fields:n},forceRender:r=!1,indexPath:s="",parentPath:i="",parentSchemaPath:l="",permissions:a,readOnly:c}=t;return Qg(N2,{children:Qg("div",{className:[Ie,gS,e].filter(Boolean).join(" "),style:o||void 0,children:Qg(So,{className:`${gS}__fields`,fields:n,forceRender:r,margins:!1,parentIndexPath:s,parentPath:i,parentSchemaPath:l,permissions:a,readOnly:c})})})},Rc=Oe(lk);import{jsx as uk}from"react/jsx-runtime";import dk,{useCallback as vS,useMemo as mk}from"react";import{c as ck}from"react/compiler-runtime";import{jsx as ui,jsxs as bS}from"react/jsx-runtime";import{getTranslation as Kg}from"@payloadcms/translations";import"react";var Ca=t=>{let e=ck(40),{AfterInput:o,BeforeInput:n,className:r,Description:s,description:i,Error:l,hasMany:a,isClearable:c,isSortable:u,label:d,Label:f,localized:m,onChange:h,onInputChange:p,options:g,path:b,placeholder:v,readOnly:x,required:y,showError:C,style:S,value:w}=t,F=a===void 0?!1:a,_=c===void 0?!0:c,A=u===void 0?!0:u,{i18n:R}=$(),I;if(e[0]!==o||e[1]!==n||e[2]!==s||e[3]!==l||e[4]!==f||e[5]!==r||e[6]!==i||e[7]!==F||e[8]!==R||e[9]!==_||e[10]!==A||e[11]!==d||e[12]!==m||e[13]!==h||e[14]!==p||e[15]!==g||e[16]!==b||e[17]!==v||e[18]!==x||e[19]!==y||e[20]!==C||e[21]!==S||e[22]!==w){let D;if(F&&Array.isArray(w)){let j;e[24]!==R||e[25]!==g?(j=P=>{let N=g.find(B=>B.value===P);return{label:N?Kg(N.label,R):P,value:N?.value??P}},e[24]=R,e[25]=g,e[26]=j):j=e[26],D=w.map(j)}else if(w){let j,P;if(e[27]!==R||e[28]!==g||e[29]!==w){let N;e[32]!==w?(N=B=>B.value===w,e[32]=w,e[33]=N):N=e[33],j=g.find(N),P=j?Kg(j.label,R):w,e[27]=R,e[28]=g,e[29]=w,e[30]=j,e[31]=P}else j=e[30],P=e[31];D={label:P,value:j?.value??w}}else D=null;let E=C&&"error",T=x&&"read-only",L;e[34]!==r||e[35]!==E||e[36]!==T?(L=[Ie,"select",r,E,T].filter(Boolean),e[34]=r,e[35]=E,e[36]=T,e[37]=L):L=e[37];let k;e[38]!==R?(k=j=>({...j,label:Kg(j.label,R)}),e[38]=R,e[39]=k):k=e[39],I=bS("div",{className:L.join(" "),id:`field-${b.replace(/\./g,"__")}`,style:S,children:[ui(oe,{CustomComponent:f,Fallback:ui(ye,{label:d,localized:m,path:b,required:y})}),bS("div",{className:`${Ie}__wrap`,children:[ui(oe,{CustomComponent:l,Fallback:ui(We,{path:b,showError:C})}),n,ui(ft,{disabled:x,isClearable:_,isMulti:F,isSortable:A,onChange:h,onInputChange:p,options:g.map(k),placeholder:v,showError:C,value:D}),o]}),ui(oe,{CustomComponent:s,Fallback:ui(Ve,{description:i,path:b})})]}),e[0]=o,e[1]=n,e[2]=s,e[3]=l,e[4]=f,e[5]=r,e[6]=i,e[7]=F,e[8]=R,e[9]=_,e[10]=A,e[11]=d,e[12]=m,e[13]=h,e[14]=p,e[15]=g,e[16]=b,e[17]=v,e[18]=x,e[19]=y,e[20]=C,e[21]=S,e[22]=w,e[23]=I}else I=e[23];return I};var fk=t=>t.map(e=>typeof e=="object"&&(e.value||e.value==="")?e:{label:e,value:e}),pk=t=>{let{field:e,field:{name:o,admin:{className:n,description:r,isClearable:s=!0,isSortable:i=!0,placeholder:l}={},hasMany:a=!1,label:c,localized:u,options:d=[],required:f},onChange:m,path:h,readOnly:p,validate:g}=t,b=dk.useMemo(()=>fk(d),[d]),v=vS((T,L)=>{if(typeof g=="function")return g(T,{...L,hasMany:a,options:b,required:f})},[g,f,a,b]),{customComponents:{AfterInput:x,BeforeInput:y,Description:C,Error:S,Label:w}={},disabled:F,path:_,setValue:A,showError:R,value:I}=Ne({potentiallyStalePath:h,validate:v}),D=vS(T=>{if(!p||F){let L=null;T&&a?Array.isArray(T)?L=T.map(k=>k.value):L=[]:T&&!Array.isArray(T)&&(L=T.value),typeof m=="function"&&m(L),A(L)}},[p,F,a,A,m]),E=mk(()=>rt(e),[e]);return uk(Ca,{AfterInput:x,BeforeInput:y,className:n,Description:C,description:r,Error:S,hasMany:a,isClearable:s,isSortable:i,Label:w,label:c,localized:u,name:o,onChange:D,options:b,path:_,placeholder:l,readOnly:p||F,required:f,showError:R,style:E,value:I})},_c=Oe(pk);import{c as jS}from"react/compiler-runtime";import{jsx as En,jsxs as OS}from"react/jsx-runtime";import{getTranslation as tj}from"@payloadcms/translations";import{tabHasName as Om,toKebabCase as oj}from"payload/shared";import{useEffect as kS,useState as cb}from"react";var PS=As(ob(),1);import{jsx as Vr}from"react/jsx-runtime";import{dequal as ES}from"dequal/lite";import{useRouter as Hk}from"next/navigation.js";import{deepCopyObjectSimpleWithoutReactComponents as ib,getDataByPath as zk,getSiblingData as Xk,reduceFieldsToValues as ab,wait as Uk}from"payload/shared";import Yk,{useCallback as Wo,useEffect as mi,useReducer as Zk,useRef as Ac,useState as ms}from"react";import{c as xk}from"react/compiler-runtime";import{jsx as wS,jsxs as yk}from"react/jsx-runtime";import Ck from"react";function wk(t){let e=[];for(let o of t)if(o){let n=o.split(" \u2192 "),r=!1;for(let s=0;s<e.length;s++)if(e[s].startsWith(n[0])){e.splice(s+1,0,o),r=!0;break}r||e.push(o)}return e}function Sk(t){let[e,o]=t.split(":");if(!o)return{message:e};let n=o.split(",").map(r=>r.replaceAll(" > "," \u2192 ").trim());return n.length===1?{errors:n,message:`${e}:`}:{errors:wk(n),message:`${e} (${n.length}):`}}function SS(t){let e=xk(5),{errorMessage:o}=t,n;e[0]!==o?(n=()=>Sk(o),e[0]=o,e[1]=n):n=e[1];let[r]=Ck.useState(n),{errors:s,message:i}=r,l;return e[2]!==s||e[3]!==i?(l=yk("div",{children:[i,Array.isArray(s)&&s.length>0?wS("ul",{"data-testid":"field-errors",children:s.map(Ik)}):null]}),e[2]=s,e[3]=i,e[4]=l):l=e[4],l}function Ik(t,e){return wS("li",{children:t},e)}import{c as Rk}from"react/compiler-runtime";import{useEffect as IS,useState as _k}from"react";function rb(t,e,o){let n=Rk(11),r;n[0]!==t?(r=()=>t,n[0]=t,n[1]=r):r=n[1];let[s,i]=_k(r),l;n[2]!==o||n[3]!==t?(l=()=>{let d=setTimeout(()=>{i(()=>t)},o);return()=>{clearTimeout(d)}},n[2]=o,n[3]=t,n[4]=l):l=n[4];let a;n[5]!==o||n[6]!==e?(a=[...e,o],n[5]=o,n[6]=e,n[7]=a):a=n[7],IS(l,a);let c,u;n[8]!==s?(c=()=>{s()},u=[s],n[8]=s,n[9]=c,n[10]=u):(c=n[9],u=n[10]),IS(c,u)}import{useCallback as Dk,useRef as RS}from"react";function $m(){let t=RS([]),e=RS(!1);return{queueTask:Dk((n,r)=>{t.current.push(n);async function s(){if(!e.current&&!(typeof r?.beforeProcess=="function"&&r.beforeProcess()===!1))for(;t.current.length>0;){let i=t.current.pop();t.current=[],e.current=!0;try{await i()}catch(l){console.error("Error in queued function:",l)}finally{e.current=!1,typeof r?.afterProcess=="function"&&r.afterProcess()}}}s()},[])}}import{c as Fk}from"react/compiler-runtime";import{jsx as Ak}from"react/jsx-runtime";import _S,{useState as Tk}from"react";var DS=_S.createContext(null),nb=t=>{let e=Fk(6),{children:o}=t,[n,r]=Tk(Ek),s;e[0]!==n?(s=u=>{let{collectionSlug:d}=u;return n.get(d)},e[0]=n,e[1]=s):s=e[1];let i=s,l;e[2]===Symbol.for("react.memo_cache_sentinel")?(l=u=>{let{collectionSlug:d,handler:f}=u;r(m=>{let h=new Map(m);return h.set(d,f),h})},e[2]=l):l=e[2];let a=l,c;return e[3]!==o||e[4]!==i?(c=Ak(DS,{value:{getUploadHandler:i,setUploadHandler:a},children:o}),e[3]=o,e[4]=i,e[5]=c):c=e[5],c},Dc=()=>{let t=_S.use(DS);if(t===null)throw new Error("useUploadHandlers must be used within UploadHandlersProvider");return t};function Ek(){return new Map}var FS={413:"Your request was too large to submit successfully."};var sb=As(hg(),1);import{dequal as Nk}from"dequal/lite";import{deepCopyObjectSimpleWithoutReactComponents as TS}from"payload/shared";import{dequal as Pk}from"dequal/lite";var AS=({acceptValues:t,currentState:e={},incomingState:o})=>{let n={...e};for(let[r,s]of Object.entries(o||{}))!(r in e)&&!s.addedByServer||(!t&&!s.addedByServer&&(delete s.value,delete s.initialValue),n[r]={...e[r],...s},Array.isArray(s.rows)&&r in e&&(n[r].rows=[...e[r]?.rows||[]],s.rows.forEach(i=>{let l=e[r].rows.findIndex(a=>a.id===i.id);l>-1&&(n[r].rows[l]={...e[r].rows[l],...i})})),s.valid!==!1&&(n[r].valid=!0),s.passesCondition!==!1&&(n[r].passesCondition=!0),delete n[r].addedByServer);return Pk(n,e)?e:n};var wa=(t,e)=>{let o={},n=Object.entries(e).reduce((r,[s,i])=>{let l=r;if(s.indexOf(`${t}.`)===0){let[a]=s.replace(`${t}.`,"").split(".");l[a]||(l[a]={}),l[a][s.replace(`${t}.${String(a)}.`,"")]={...i}}else o[s]=i;return l},[]);return{remainingFields:o,rows:n}},Sa=(t,e)=>e.reduce((o,n,r)=>({...o,...Object.entries(n).reduce((s,[i,l])=>({...s,[`${t}.${r}.${i}`]:{...l}}),{})}),{});var ds=sb.default.default||sb.default;function Fc(t,e){switch(e.type){case"ADD_ROW":{let{blockType:o,path:n,rowIndex:r,subFieldState:s={}}=e,i=typeof r=="number"?r:t[n]?.rows?.length||0,l=[...t[n]?.rows||[]],a={id:s?.id?.value||new ds().toHexString(),collapsed:!1,isLoading:!0};o&&(a.blockType=o),l.splice(i,0,a),o&&(s.blockType={initialValue:o,valid:!0,value:o});let{remainingFields:c,rows:u}=wa(n,t);return u.splice(i,0,s),{...c,...Sa(n,u),[`${n}.${i}.id`]:{initialValue:a.id,passesCondition:!0,valid:!0,value:a.id},[n]:{...t[n],disableFormData:!0,rows:l,value:u.length}}}case"ADD_SERVER_ERRORS":{let o={...t},n=[];return e.errors.forEach(({message:r,path:s})=>{o[s]={...o[s]||{initialValue:null,value:null},errorMessage:r,valid:!1};let i=s.split(".");i.length>1&&n.push({fieldErrorPath:s,parentPath:i.slice(0,i.length-1).join(".")})}),o=Object.entries(o).reduce((r,[s,i])=>{let l=n.reduce((c,{fieldErrorPath:u,parentPath:d})=>(d.startsWith(s)&&c.push(u),c),[]),a=!1;if(l.length>0){let c=Array.isArray(i.errorPaths)?i.errorPaths:[];l.forEach(u=>{c.includes(u)||(c.push(u),a=!0)}),a&&(r[s]={...i,errorPaths:c})}return a||(r[s]=i),r},{}),o}case"DUPLICATE_ROW":{let{path:o,rowIndex:n}=e,{remainingFields:r,rows:s}=wa(o,t),i=[...t[o].rows||[]],l=TS(i[n]);l.id&&(l.id=new ds().toHexString());let a=TS(s[n]);a.id&&(a.id.value=new ds().toHexString(),a.id.initialValue=new ds().toHexString());for(let u of Object.keys(a).filter(d=>d.endsWith(".id"))){let d=a[u];d&&typeof d.value=="string"&&ds.isValid(d.value)&&(a[u].value=new ds().toHexString(),a[u].initialValue=new ds().toHexString())}return Object.keys(a).length>0&&(s.splice(n+1,0,a),i.splice(n+1,0,l)),{...r,...Sa(o,s),[o]:{...t[o],disableFormData:!0,rows:i,value:s.length}}}case"MERGE_SERVER_STATE":{let{acceptValues:o,prevStateRef:n,serverState:r}=e,s=AS({acceptValues:o,currentState:t||{},incomingState:r});return n.current=s,s}case"MOVE_ROW":{let{moveFromIndex:o,moveToIndex:n,path:r}=e,{remainingFields:s,rows:i}=wa(r,t),l=i[o];i.splice(o,1),i.splice(n,0,l);let a=[...t[r]?.rows||[]],c={...a[o]};return a.splice(o,1),a.splice(n,0,c),{...s,...Sa(r,i),[r]:{...t[r],rows:a}}}case"REMOVE":{let o={...t};return o[e.path]&&delete o[e.path],o}case"REMOVE_ROW":{let{path:o,rowIndex:n}=e,{remainingFields:r,rows:s}=wa(o,t),i=[...t[o]?.rows||[]];return s.splice(n,1),i.splice(n,1),{...r,[o]:{...t[o],disableFormData:s.length>0,rows:i,value:s.length},...Sa(o,s)}}case"REPLACE_ROW":{let{blockType:o,path:n,rowIndex:r,subFieldState:s={}}=e,{remainingFields:i,rows:l}=wa(n,t),a=Math.max(0,Math.min(r,l?.length-1||0)),c=[...t[n]?.rows||[]];return c[a]={id:new ds().toHexString(),blockType:o||void 0,collapsed:!1},o&&(s.blockType={initialValue:o,valid:!0,value:o}),l[a]=s,{...i,...Sa(n,l),[n]:{...t[n],disableFormData:!0,rows:c,value:l.length}}}case"REPLACE_STATE":{if(e.optimize!==!1){let o={};for(let[n,r]of Object.entries(e.state)){let s=t[n];r.valid!==!1&&(r.valid=!0),r.passesCondition!==!1&&(r.passesCondition=!0),Nk(s,r)?s&&(o[n]=s):o[n]=r}return o}if(e.sanitize)for(let o of Object.values(e.state))o.valid!==!1&&(o.valid=!0),o.passesCondition!==!1&&(o.passesCondition=!0);return e.state}case"SET_ALL_ROWS_COLLAPSED":{let{path:o,updatedRows:n}=e;return{...t,[o]:{...t[o],rows:n}}}case"SET_ROW_COLLAPSED":{let{path:o,updatedRows:n}=e;return{...t,[o]:{...t[o],rows:n}}}case"UPDATE":{let o=Object.entries(e).reduce((r,[s,i])=>["disableFormData","errorMessage","initialValue","rows","valid","validate","value"].includes(s)?{...r,[s]:i}:r,t?.[e.path]||{});return{...t,[e.path]:o}}case"UPDATE_MANY":{let o={...t};return Object.entries(e.formState).forEach(([n,r])=>{o[n]=r}),o}default:return t}}var Lk=()=>{},$k=()=>{},kk=()=>{},jk=()=>{},Ok=()=>{},Mk=()=>{},Bk=()=>{},Vk=()=>{},Gk=()=>{},Wk=()=>{},km={addFieldRow:()=>{},buildRowErrors:()=>{},createFormData:Ok,disabled:!1,dispatchFields:kk,fields:{},formRef:null,getData:()=>{},getDataByPath:()=>{},getField:()=>{},getFields:()=>({}),getSiblingData:$k,initializing:void 0,isValid:!0,moveFieldRow:()=>{},removeFieldRow:()=>{},replaceFieldRow:()=>{},replaceState:()=>{},reset:Wk,setBackgroundProcessing:Vk,setDisabled:()=>{},setIsValid:()=>{},setModified:Mk,setProcessing:Bk,setSubmitted:Gk,submit:Lk,validateForm:jk};var Jk="form",Tn=t=>{let{id:e,collectionSlug:o,docConfig:n,docPermissions:r,getDocPreferences:s,globalSlug:i}=Pe(),{action:l,beforeSubmit:a,children:c,className:u,disabled:d,disableSuccessStatus:f,disableValidationOnSubmit:m,el:h,handleResponse:p,initialState:g,isDocumentForm:b,isInitializing:v,onChange:x,onSubmit:y,onSuccess:C,redirect:S,submitted:w,uuid:F,waitForAutocomplete:_}=t,A="method"in t?t?.method:void 0,R=Hk(),I=Li(),{code:D}=$e(),{i18n:E,t:T}=$(),{refreshCookie:L,user:k}=De(),j=Ko(),{queueTask:P}=$m(),{getFormState:N}=Ft(),{startRouteTransition:B}=st(),{getUploadHandler:M}=Dc(),{config:O}=W(),[V,G]=ms(d||!1),[z,X]=ms(!1),[te,Y]=ms(!1),[H,le]=ms(!0),[q,fe]=ms(v),[ae,J]=ms(!1),[ge,Ce]=ms(!1),[he,Le]=ms(!1),Ae=Ac(null),Q=Ac({}),ke=Ac(null),xe=Ac(!0),ce=Zk(Fc,{},()=>g),[ne,U]=ce;Q.current.fields=ne;let ie=Ac(ne),de=Wo(async()=>{let K={},Z=!0,re=Q.current.getData(),pe=Object.entries(Q.current.fields).map(async([ve,we])=>{let Ee=we,po=ve?ve.split("."):[];if(we.passesCondition!==!1){let no=Ee.valid;if("validate"in we&&typeof we.validate=="function"){let Ye=we.value;we?.rows&&Array.isArray(we.rows)&&(Ye=Q.current.getDataByPath(ve)),no=await we.validate(Ye,{...we,id:e,collectionSlug:o,blockData:void 0,data:I?.getData?I.getData():re,event:"submit",operation:j,path:po,preferences:{},req:{payload:{config:O},t:T,user:k},siblingData:Q.current.getSiblingData(ve)}),typeof no=="string"?(Ee.errorMessage=no,Ee.valid=!1):(Ee.valid=!0,Ee.errorMessage=void 0)}Ee.valid===!1&&(Z=!1)}K[ve]=Ee});return await Promise.all(pe),ES(Q.current.fields,K)||U({type:"REPLACE_STATE",state:K}),le(Z),Z},[o,O,U,e,j,T,k,I]),Te=Wo(async(K={},Z)=>{let{action:re=l,method:pe=A,overrides:ve={},skipValidation:we}=K;if(V){Z&&Z.preventDefault();return}let Ee,po,no=new Promise((Qe,wt)=>{po=Qe,Ee=wt}),Ye=re||typeof l=="string"||typeof l=="function";if(S||f||!Ye?(po=Qe=>me.success(Qe),Ee=Qe=>me.error(Qe)):me.promise(no,{error:Qe=>Qe,loading:T("general:submitting"),success:Qe=>Qe}),Z&&(Z.stopPropagation(),Z.preventDefault()),J(!0),G(!0),_&&await Uk(100),Array.isArray(a)){let Qe,wt=ib(Q.current.fields);await a.reduce(async(zt,Uo)=>{await zt,Qe=await Uo({formState:wt})},Promise.resolve());let Xo=Object.entries(Qe).every(([,zt])=>zt.valid!==!1);if(le(Xo),!Xo)return J(!1),Le(!0),G(!1),U({type:"REPLACE_STATE",state:Qe})}let so=we||m?!0:await Q.current.validateForm();if(le(so),!so){Ee(T("error:correctInvalidFields")),J(!1),Le(!0),G(!1);return}let eo={};if(typeof ve=="function"?eo=ve(Q.current.fields):typeof ve=="object"&&(eo=ve),y){let Qe=ib(Q.current.fields),wt=ab(Qe,!0);for(let[Xo,zt]of Object.entries(eo))wt[Xo]=zt;y(Qe,wt)}if(!Ye){J(!1),Le(!0),G(!1);return}let Fo=await Q.current.createFormData(eo,{mergeOverrideData:typeof ve!="function"});try{let Qe;if(typeof re=="string"?Qe=await Ke[pe.toLowerCase()](re,{body:Fo,headers:{"Accept-Language":E.language}}):typeof l=="function"&&(Qe=await l(Fo)),Y(!1),G(!1),typeof p=="function"){p(Qe,po,Ee);return}let wt=Qe.headers.get("content-type"),Xo=wt&&wt.indexOf("application/json")!==-1,zt={};if(Xo&&(zt=await Qe.json()),Qe.status<400){if(typeof C=="function"){let Uo=await C(zt);Uo&&U({type:"MERGE_SERVER_STATE",acceptValues:!0,prevStateRef:ie,serverState:Uo})}Le(!1),J(!1),S?B(()=>R.push(S)):f||po(zt.message||T("general:submissionSuccessful"))}else{if(J(!1),Le(!0),Q.current={...Q.current},zt.message){Ee(zt.message);return}if(Array.isArray(zt.errors)){let[Ka,el]=zt.errors.reduce(([Fs,tl],dn)=>{let Cu=[],Gf=[];return dn?.message&&Gf.push(dn),Array.isArray(dn?.data?.errors)&&dn.data?.errors.forEach(Wf=>{Wf?.path?Cu.push(Wf):Gf.push(Wf)}),[[...Fs,...Cu],[...tl,...Gf]]},[[],[]]);le(!1),U({type:"ADD_SERVER_ERRORS",errors:Ka}),el.forEach(Fs=>{Ee(Vr(SS,{errorMessage:Fs.message||T("error:unknown")}))});return}let Uo=FS?.[Qe.status]||Qe?.statusText||T("error:unknown");Ee(Uo)}}catch(Qe){console.error("Error submitting form",Qe),J(!1),Le(!0),G(!1),Ee(Qe.message)}},[a,B,l,f,m,V,U,p,A,y,C,S,R,T,E,_]),Ge=Wo(()=>Q.current.fields,[]),je=Wo(K=>Q.current.fields[K],[]),lt=Wo(()=>ab(Q.current.fields,!0),[]),Ue=Wo(K=>Xk(Q.current.fields,K),[]),He=Wo(K=>zk(Q.current.fields,K),[]),dt=Wo(async(K,{mergeOverrideData:Z=!0})=>{let re=ab(Q.current.fields,!0),pe=re?.file;if(n&&"upload"in n&&n.upload&&pe){delete re.file;let Ee=M({collectionSlug:o});if(typeof Ee=="function"){let po=pe.name,no=await Ee({file:pe,updateFilename:Ye=>{po=Ye}});pe=JSON.stringify({clientUploadContext:no,collectionSlug:o,filename:po,mimeType:pe.type,size:pe.size})}}Z?re={...re,...K}:re=K;let ve={_payload:JSON.stringify(re)};return n&&"upload"in n&&n.upload&&pe&&(ve.file=pe),(0,PS.serialize)(ve,{indices:!0,nullsAsUndefineds:!1})},[o,n,M]),Kt=Wo(async K=>{let Z=rr(ke),re=await s(),{state:pe}=await N({id:e,collectionSlug:o,data:K,docPermissions:r,docPreferences:re,globalSlug:i,locale:D,operation:j,renderAllFields:!0,schemaPath:o||i,signal:Z.signal,skipValidation:!0});Q.current={...km},Y(!1),U({type:"REPLACE_STATE",state:pe}),ke.current=null},[o,U,i,e,j,N,r,s,D]),ze=Wo(K=>{Q.current={...km},Y(!1),U({type:"REPLACE_STATE",state:K})},[U]),Je=Wo(({blockType:K,path:Z,rowIndex:re,subFieldState:pe})=>{let ve=He(Z)||[],we=re===void 0?ve.length:re;U({type:"ADD_ROW",blockType:K,path:Z,rowIndex:we,subFieldState:pe}),Y(!0)},[U,He]),Xe=Wo(({moveFromIndex:K,moveToIndex:Z,path:re})=>{U({type:"MOVE_ROW",moveFromIndex:K,moveToIndex:Z,path:re}),Y(!0)},[U]),Ct=Wo(({path:K,rowIndex:Z})=>{U({type:"REMOVE_ROW",path:K,rowIndex:Z}),Y(!0)},[U]),Et=Wo(({blockType:K,path:Z,rowIndex:re,subFieldState:pe})=>{let ve=He(Z),we=re===void 0?ve.length:re;U({type:"REPLACE_ROW",blockType:K,path:Z,rowIndex:we,subFieldState:pe}),Y(!0)},[U,He]);mi(()=>{let K=ke.current;return()=>{or(K)}},[]),mi(()=>{v!==void 0&&fe(v)},[v]),Q.current.submit=Te,Q.current.getFields=Ge,Q.current.getField=je,Q.current.getData=lt,Q.current.getSiblingData=Ue,Q.current.getDataByPath=He,Q.current.validateForm=de,Q.current.createFormData=dt,Q.current.setModified=Y,Q.current.setProcessing=J,Q.current.setBackgroundProcessing=Ce,Q.current.setSubmitted=Le,Q.current.setIsValid=le,Q.current.disabled=V,Q.current.setDisabled=G,Q.current.formRef=Ae,Q.current.reset=Kt,Q.current.replaceState=ze,Q.current.dispatchFields=U,Q.current.addFieldRow=Je,Q.current.removeFieldRow=Ct,Q.current.moveFieldRow=Xe,Q.current.replaceFieldRow=Et,Q.current.uuid=F,Q.current.initializing=q,Q.current.isValid=H,mi(()=>{X(!0)},[]),mi(()=>{typeof d=="boolean"&&G(d)},[d]),mi(()=>{typeof w=="boolean"&&Le(w)},[w]),mi(()=>{g&&(Q.current={...km},U({type:"REPLACE_STATE",optimize:!1,sanitize:!0,state:g}))},[g,U]),Gs(()=>{L()},15e3,[ne]),mi(()=>{Q.current={...Q.current},Y(!1)},[D]);let gt=[u,Jk].filter(Boolean).join(" "),qe=to(K=>{P(async()=>{if(Array.isArray(x)){let Z;for(let re of x)Z=await re({formState:ib(ne),submitted:K});U({type:"MERGE_SERVER_STATE",prevStateRef:ie,serverState:Z})}})});rb(()=>{(xe.current||!ES(ne,ie.current))&&te&&qe(he),ie.current=ne,xe.current=!1},[te,he,ne],250);let Pt=b?Tu:Yk.Fragment,be=b?{value:Q.current}:{};return Vr(h||"form",{action:typeof l=="function"?void 0:l,className:gt,method:A,noValidate:!0,onSubmit:K=>void Q.current.submit({},K),ref:Ae,children:Vr(Pt,{...be,children:Vr(Au,{value:Q.current,children:Vr(Eu,{value:{fields:ne,...Q.current},children:Vr(Pu,{value:he,children:Vr(np,{value:!z||z&&q,children:Vr(Nu,{value:ae,children:Vr(rp,{value:ge,children:Vr(Lu,{value:te,children:Vr(al.Provider,{value:ce,children:c})})})})})})})})})})};import{c as qk}from"react/compiler-runtime";import{jsx as NS,jsxs as LS}from"react/jsx-runtime";import{getTranslation as Qk}from"@payloadcms/translations";import{tabHasName as $S}from"payload/shared";import Kk,{useState as ej}from"react";var jm="tabs-field__tab-button",lb=t=>{let e=qk(15),{hidden:o,isActive:n,parentPath:r,setIsActive:s,tab:i}=t,{i18n:l}=$(),[a,c]=ej(void 0),u;if(e[0]!==a||e[1]!==o||e[2]!==l||e[3]!==n||e[4]!==r||e[5]!==s||e[6]!==i){let d=[...r?r.split(".").slice(0,-1):[],...$S(i)?[i.name]:[]],f=a>0,m=NS(Js,{fields:i.fields,path:d,setErrorCount:c}),h=f&&`${jm}--has-error`,p=n&&`${jm}--active`,g=o&&`${jm}--hidden`,b;e[8]!==h||e[9]!==p||e[10]!==g?(b=[jm,h,p,g].filter(Boolean),e[8]=h,e[9]=p,e[10]=g,e[11]=b):b=e[11];let v;e[12]!==l||e[13]!==i?(v=i.label?Qk(i.label,l):$S(i)?i.name:"",e[12]=l,e[13]=i,e[14]=v):v=e[14],u=LS(Kk.Fragment,{children:[m,LS("button",{className:b.join(" "),onClick:s,type:"button",children:[v,f&&NS(ao,{count:a,i18n:l})]})]}),e[0]=a,e[1]=o,e[2]=l,e[3]=n,e[4]=r,e[5]=s,e[6]=i,e[7]=u}else u=e[7];return u};var Pn="tabs-field";function Ia({activeTabConfig:t,path:e}){let o=e;return Om(t)&&t.name&&(e?o=`${e}.${t.name}`:o=t.name),o}var rj=t=>{let e=jS(89),{field:o,forceRender:n,indexPath:r,parentPath:s,parentSchemaPath:i,path:l,permissions:a,readOnly:c}=t,{admin:u,tabs:d}=o,f;e[0]!==u?(f=u===void 0?{}:u,e[0]=u,e[1]=f):f=e[1];let{className:m}=f,h;e[2]!==d?(h=d===void 0?[]:d,e[2]=d,e[3]=h):h=e[3];let p=h,g=n===void 0?!1:n,b=r===void 0?"":r,v=s===void 0?"":s,x=i===void 0?"":i,y=l===void 0?"":l,{getPreference:C,setPreference:S}=Ao(),{preferencesKey:w}=Pe(),{i18n:F}=$(),{isWithinCollapsible:_}=Kn(),A;e[4]!==p?(A=xe=>{let[ce]=xe;return p.map((ne,U)=>{let ie=ne?.id;return{index:U,passesCondition:ce?.[ie]?.passesCondition??!0,tab:ne}})},e[4]=p,e[5]=A):A=e[5];let R=Nt(A),I;e[6]!==R?(I=()=>R.filter(sj)?.[0]?.index??0,e[6]=R,e[7]=I):I=e[7];let[D,E]=cb(I),T=`tabs-${b}`,L;e[8]!==D||e[9]!==v||e[10]!==p?(L=()=>Ia({activeTabConfig:p[D],path:v}),e[8]=D,e[9]=v,e[10]=p,e[11]=L):L=e[11];let[k,j]=cb(L),P;e[12]!==x||e[13]!==p[0]?(P=()=>Ia({activeTabConfig:p[0],path:x}),e[12]=x,e[13]=p[0],e[14]=P):P=e[14];let[N,B]=cb(P),M;e[15]!==D||e[16]!==k||e[17]!==v||e[18]!==p?(M=Om(p[D])?k:v,e[15]=D,e[16]=k,e[17]=v,e[18]=p,e[19]=M):M=e[19];let O=M,V=R[D],G=V?.tab,z;e[20]!==D||e[21]!==N||e[22]!==x||e[23]!==p?(z=Om(p[D])?N:x,e[20]=D,e[21]=N,e[22]=x,e[23]=p,e[24]=z):z=e[24];let X=z,te=G.admin?.description??G.description,Y;e[25]!==te||e[26]!==F?(Y=typeof te=="function"?te({i18n:F,t:F.t}):te,e[25]=te,e[26]=F,e[27]=Y):Y=e[27];let H=Y,le=R.some(ij),q;e[28]!==C||e[29]!==v||e[30]!==x||e[31]!==y||e[32]!==w||e[33]!==S||e[34]!==p||e[35]!==T?(q=async xe=>{E(xe),j(Ia({activeTabConfig:p[xe],path:v})),B(Ia({activeTabConfig:p[xe],path:x}));let ce=await C(w);w&&S(w,{...ce,...y?{fields:{...ce?.fields||{},[y]:{...ce?.fields?.[y],tabIndex:xe}}}:{fields:{...ce?.fields,[T]:{...ce?.fields?.[T],tabIndex:xe}}}})},e[28]=C,e[29]=v,e[30]=x,e[31]=y,e[32]=w,e[33]=S,e[34]=p,e[35]=T,e[36]=q):q=e[36];let fe=q,ae,J;e[37]!==C||e[38]!==v||e[39]!==x||e[40]!==y||e[41]!==w||e[42]!==p||e[43]!==T?(ae=()=>{w&&(async()=>{let ce=await C(w),U=(y?ce?.fields?.[y]?.tabIndex:ce?.fields?.[T]?.tabIndex)||0;E(U),j(Ia({activeTabConfig:p[U],path:v})),B(Ia({activeTabConfig:p[U],path:x}))})()},J=[y,C,w,T,p,v,x],e[37]=C,e[38]=v,e[39]=x,e[40]=y,e[41]=w,e[42]=p,e[43]=T,e[44]=ae,e[45]=J):(ae=e[44],J=e[45]),kS(ae,J);let ge;e[46]!==V?.passesCondition||e[47]!==fe||e[48]!==R?(ge=()=>{if(V?.passesCondition===!1){let xe=R.find(aj);xe&&fe(xe.index)}},e[46]=V?.passesCondition,e[47]=fe,e[48]=R,e[49]=ge):ge=e[49];let Ce;e[50]!==V||e[51]!==fe||e[52]!==R?(Ce=[V,R,fe],e[50]=V,e[51]=fe,e[52]=R,e[53]=Ce):Ce=e[53],kS(ge,Ce);let he=_&&`${Pn}--within-collapsible`,Le=!le&&`${Pn}--hidden`,Ae;e[54]!==m||e[55]!==he||e[56]!==Le?(Ae=[Ie,m,Pn,he,Le].filter(Boolean),e[54]=m,e[55]=he,e[56]=Le,e[57]=Ae):Ae=e[57];let Q=Ae.join(" "),ke;if(e[58]!==O||e[59]!==X||e[60]!==G||e[61]!==D||e[62]!==V||e[63]!==k||e[64]!==H||e[65]!==g||e[66]!==fe||e[67]!==b||e[68]!==y||e[69]!==a||e[70]!==c||e[71]!==Q||e[72]!==R){let xe;e[74]!==D||e[75]!==fe||e[76]!==y?(xe=ne=>{let{index:U,passesCondition:ie,tab:de}=ne;return En(lb,{hidden:!ie,isActive:D===U,parentPath:y,setIsActive:()=>{fe(U)},tab:de},U)},e[74]=D,e[75]=fe,e[76]=y,e[77]=xe):xe=e[77];let ce;e[78]!==O||e[79]!==X||e[80]!==G||e[81]!==V||e[82]!==k||e[83]!==H||e[84]!==g||e[85]!==b||e[86]!==a||e[87]!==c?(ce=G&&En(nj,{description:H,fields:G.fields,forceRender:g,hidden:!1,parentIndexPath:Om(G)?"":`${b?b+"-":""}`+String(V.index),parentPath:O,parentSchemaPath:X,path:k,permissions:a&&typeof a=="object"&&"name"in G?a[G.name]&&typeof a[G.name]=="object"&&"fields"in a[G.name]?a[G.name].fields:a[G.name]:a,readOnly:c}),e[78]=O,e[79]=X,e[80]=G,e[81]=V,e[82]=k,e[83]=H,e[84]=g,e[85]=b,e[86]=a,e[87]=c,e[88]=ce):ce=e[88],ke=En("div",{className:Q,children:OS(fg,{children:[En("div",{className:`${Pn}__tabs-wrap`,children:En("div",{className:`${Pn}__tabs`,children:R.map(xe)})}),En("div",{className:`${Pn}__content-wrap`,children:ce})]})}),e[58]=O,e[59]=X,e[60]=G,e[61]=D,e[62]=V,e[63]=k,e[64]=H,e[65]=g,e[66]=fe,e[67]=b,e[68]=y,e[69]=a,e[70]=c,e[71]=Q,e[72]=R,e[73]=ke}else ke=e[73];return ke},Tc=Oe(rj);function nj(t){let e=jS(19),{description:o,fields:n,forceRender:r,hidden:s,label:i,parentIndexPath:l,parentPath:a,parentSchemaPath:c,permissions:u,readOnly:d}=t,{i18n:f}=$(),{customComponents:m,path:h}=Ne(),p;e[0]!==m?(p=m===void 0?{}:m,e[0]=m,e[1]=p):p=e[1];let{AfterInput:g,BeforeInput:b,Description:v,Field:x}=p;if(x)return x;let y=s&&`${Pn}__tab--hidden`,C=i&&`${Pn}__tabConfigLabel-${oj(tj(i,f))}`,S;e[2]!==y||e[3]!==C?(S=[y,`${Pn}__tab`,C].filter(Boolean),e[2]=y,e[3]=C,e[4]=S):S=e[4];let w=S.join(" "),F;return e[5]!==g||e[6]!==b||e[7]!==v||e[8]!==o||e[9]!==n||e[10]!==r||e[11]!==l||e[12]!==a||e[13]!==c||e[14]!==h||e[15]!==u||e[16]!==d||e[17]!==w?(F=OS("div",{className:w,children:[En(oe,{CustomComponent:v,Fallback:En(Ve,{description:o,marginPlacement:"bottom",path:h})}),b,En(So,{fields:n,forceRender:r,parentIndexPath:l,parentPath:a,parentSchemaPath:c,permissions:u,readOnly:d}),g]}),e[5]=g,e[6]=b,e[7]=v,e[8]=o,e[9]=n,e[10]=r,e[11]=l,e[12]=a,e[13]=c,e[14]=h,e[15]=u,e[16]=d,e[17]=w,e[18]=F):F=e[18],F}function sj(t){let{passesCondition:e}=t;return e}function ij(t){let{passesCondition:e}=t;return e}function aj(t){let{passesCondition:e}=t;return e}import{jsx as mj}from"react/jsx-runtime";import{useCallback as BS,useEffect as fj,useMemo as pj,useState as hj}from"react";import{c as lj}from"react/compiler-runtime";import{jsx as fs,jsxs as MS}from"react/jsx-runtime";import{getTranslation as cj}from"@payloadcms/translations";import"react";var ub=t=>{let e=lj(31),{AfterInput:o,BeforeInput:n,className:r,Description:s,description:i,Error:l,hasMany:a,inputRef:c,Label:u,label:d,localized:f,maxRows:m,onChange:h,onKeyDown:p,path:g,placeholder:b,readOnly:v,required:x,rtl:y,showError:C,style:S,value:w,valueToRender:F}=t,{i18n:_,t:A}=$(),R=dj,I=C&&"error",D=v&&"read-only",E=a&&"has-many",T;e[0]!==r||e[1]!==I||e[2]!==D||e[3]!==E?(T=[Ie,"text",r,I,D,E].filter(Boolean),e[0]=r,e[1]=I,e[2]=D,e[3]=E,e[4]=T):T=e[4];let L=T.join(" "),k;return e[5]!==o||e[6]!==n||e[7]!==s||e[8]!==l||e[9]!==u||e[10]!==i||e[11]!==a||e[12]!==_||e[13]!==c||e[14]!==d||e[15]!==f||e[16]!==m||e[17]!==h||e[18]!==p||e[19]!==g||e[20]!==b||e[21]!==v||e[22]!==x||e[23]!==y||e[24]!==C||e[25]!==S||e[26]!==A||e[27]!==L||e[28]!==w||e[29]!==F?(k=MS("div",{className:L,style:S,children:[fs(oe,{CustomComponent:u,Fallback:fs(ye,{label:d,localized:f,path:g,required:x})}),MS("div",{className:`${Ie}__wrap`,children:[fs(oe,{CustomComponent:l,Fallback:fs(We,{path:g,showError:C})}),n,a?fs(ft,{className:`field-${g.replace(/\./g,"__")}`,components:{DropdownIndicator:null},customProps:{editableProps:R},disabled:v,filterOption:()=>m?!(Array.isArray(w)&&m&&w.length>=m):!0,isClearable:!1,isCreatable:!0,isMulti:!0,isSortable:!0,menuIsOpen:!1,noOptionsMessage:()=>Array.isArray(w)&&w.length>=m?A("validation:limitReached",{max:m,value:w.length+1}):null,onChange:h,options:[],placeholder:A("general:enterAValue"),showError:C,value:F}):fs("input",{"data-rtl":y,disabled:v,id:`field-${g?.replace(/\./g,"__")}`,name:g,onChange:h,onKeyDown:p,placeholder:cj(b,_),ref:c,type:"text",value:w||""}),o,fs(oe,{CustomComponent:s,Fallback:fs(Ve,{description:i,path:g})})]})]}),e[5]=o,e[6]=n,e[7]=s,e[8]=l,e[9]=u,e[10]=i,e[11]=a,e[12]=_,e[13]=c,e[14]=d,e[15]=f,e[16]=m,e[17]=h,e[18]=p,e[19]=g,e[20]=b,e[21]=v,e[22]=x,e[23]=y,e[24]=C,e[25]=S,e[26]=A,e[27]=L,e[28]=w,e[29]=F,e[30]=k):k=e[30],k};function uj(t){t.currentTarget.contentEditable="false"}function dj(t,e,o){let n=`${e}--editable`;return{onBlur:uj,onClick:r=>{r.currentTarget.contentEditable="true",r.currentTarget.classList.add(n),r.currentTarget.focus()},onKeyDown:r=>{if(r.key==="Enter"||r.key==="Tab"||r.key==="Escape"){if(r.currentTarget.contentEditable="false",r.currentTarget.classList.remove(n),t.value.value=r.currentTarget.innerText,t.label=r.currentTarget.innerText,t.value.value.replaceAll(`
54
+ `,""))o.onChange(o.value,{action:"create-option",option:t});else if(Array.isArray(o.value)){let s=o.value.filter(i=>i.id!==t.id);o.onChange(s,{action:"pop-value",removedValue:t})}r.preventDefault()}r.stopPropagation()}}}var gj=t=>{let{field:e,field:{admin:{className:o,description:n,placeholder:r,rtl:s}={},hasMany:i,label:l,localized:a,maxLength:c,maxRows:u,minLength:d,minRows:f,required:m},inputRef:h,path:p,readOnly:g,validate:b}=t,v=$e(),{config:{localization:x}}=W(),y=BS((N,B)=>{if(typeof b=="function")return b(N,{...B,maxLength:c,minLength:d,required:m})},[b,d,c,m]),{customComponents:{AfterInput:C,BeforeInput:S,Description:w,Error:F,Label:_}={},disabled:A,path:R,setValue:I,showError:D,value:E}=Ne({potentiallyStalePath:p,validate:y}),T=Ui({fieldLocalized:a,fieldRTL:s,locale:v,localizationConfig:x||void 0}),[L,k]=hj([]),j=BS(N=>{if(!(g||A)){let B;N?Array.isArray(N)?B=N.map(M=>M.value?.value||M.value):B=[N.value?.value||N.value]:B=[],I(B)}},[g,I,A]);fj(()=>{i&&Array.isArray(E)&&k(E.map((N,B)=>({id:`${N}${B}`,label:`${N}`,value:{toString:()=>`${N}${B}`,value:N?.value||N}})))},[E,i]);let P=pj(()=>rt(e),[e]);return mj(ub,{AfterInput:C,BeforeInput:S,className:o,Description:w,description:n,Error:F,hasMany:i,inputRef:h,Label:_,label:l,localized:a,maxRows:u,minRows:f,onChange:i?j:N=>{I(N.target.value)},path:R,placeholder:r,readOnly:g||A,required:m,rtl:T,showError:D,style:P,value:E||"",valueToRender:L})},fi=Oe(gj);import{jsx as xj}from"react/jsx-runtime";import{getTranslation as yj}from"@payloadcms/translations";import{useCallback as Cj,useMemo as wj}from"react";import{c as bj}from"react/compiler-runtime";import{jsx as ps,jsxs as VS}from"react/jsx-runtime";import{getTranslation as vj}from"@payloadcms/translations";import"react";var db=t=>{let e=bj(25),{AfterInput:o,BeforeInput:n,className:r,Description:s,description:i,Error:l,Label:a,label:c,localized:u,onChange:d,path:f,placeholder:m,readOnly:h,required:p,rows:g,rtl:b,showError:v,style:x,value:y}=t,{i18n:C}=$(),S=v&&"error",w=h&&"read-only",F;e[0]!==r||e[1]!==S||e[2]!==w?(F=[Ie,"textarea",r,S,w].filter(Boolean),e[0]=r,e[1]=S,e[2]=w,e[3]=F):F=e[3];let _=F.join(" "),A;return e[4]!==o||e[5]!==n||e[6]!==s||e[7]!==l||e[8]!==a||e[9]!==i||e[10]!==C||e[11]!==c||e[12]!==u||e[13]!==d||e[14]!==f||e[15]!==m||e[16]!==h||e[17]!==p||e[18]!==g||e[19]!==b||e[20]!==v||e[21]!==x||e[22]!==_||e[23]!==y?(A=VS("div",{className:_,style:x,children:[ps(oe,{CustomComponent:a,Fallback:ps(ye,{label:c,localized:u,path:f,required:p})}),VS("div",{className:`${Ie}__wrap`,children:[ps(oe,{CustomComponent:l,Fallback:ps(We,{path:f,showError:v})}),n,ps("label",{className:"textarea-outer",htmlFor:`field-${f.replace(/\./g,"__")}`,children:ps("textarea",{"data-rtl":b,disabled:h,id:`field-${f.replace(/\./g,"__")}`,name:f,onChange:d,placeholder:vj(m,C),rows:g,value:y||""})}),o,ps(oe,{CustomComponent:s,Fallback:ps(Ve,{description:i,path:f})})]})]}),e[4]=o,e[5]=n,e[6]=s,e[7]=l,e[8]=a,e[9]=i,e[10]=C,e[11]=c,e[12]=u,e[13]=d,e[14]=f,e[15]=m,e[16]=h,e[17]=p,e[18]=g,e[19]=b,e[20]=v,e[21]=x,e[22]=_,e[23]=y,e[24]=A):A=e[24],A};var Sj=t=>{let{field:e,field:{admin:{className:o,description:n,placeholder:r,rows:s,rtl:i}={},label:l,localized:a,maxLength:c,minLength:u,required:d},path:f,readOnly:m,validate:h}=t,{i18n:p}=$(),{config:{localization:g}}=W(),b=$e(),v=Ui({fieldLocalized:a,fieldRTL:i,locale:b,localizationConfig:g||void 0}),x=Cj((T,L)=>{if(typeof h=="function")return h(T,{...L,maxLength:c,minLength:u,required:d})},[h,d,c,u]),{customComponents:{AfterInput:y,BeforeInput:C,Description:S,Error:w,Label:F}={},disabled:_,path:A,setValue:R,showError:I,value:D}=Ne({potentiallyStalePath:f,validate:x}),E=wj(()=>rt(e),[e]);return xj(db,{AfterInput:y,BeforeInput:C,className:o,Description:S,description:n,Error:w,Label:F,label:l,localized:a,onChange:T=>{R(T.target.value)},path:A,placeholder:yj(r,p),readOnly:m||_,required:d,rows:s,rtl:v,showError:I,style:E,value:D})},Ec=Oe(Sj);var Pc=()=>null;import{jsx as ZO}from"react/jsx-runtime";import JO,{useMemo as qO}from"react";import{jsx as jt,jsxs as xi,Fragment as Uc}from"react/jsx-runtime";import*as YI from"qs-esm";import Xr,{useCallback as zI,useEffect as XI,useMemo as UI}from"react";import{c as jI}from"react/compiler-runtime";import{jsx as gi,jsxs as kO}from"react/jsx-runtime";import{validateMimeType as jO}from"payload/shared";import nn from"react";import{jsx as Bm,jsxs as mb}from"react/jsx-runtime";import Tj from"react";import{jsx as Ij}from"react/jsx-runtime";import hs from"react";var GS=t=>{t.preventDefault(),t.stopPropagation()},Rj="dropzone";function pi({children:t,className:e,disabled:o=!1,dropzoneStyle:n="default",multipleFiles:r,onChange:s}){let i=hs.useRef(null),[l,a]=hs.useState(!1),c=hs.useCallback(p=>{if(!r&&p.length>1){let g=new DataTransfer;g.items.add(p[0]),s(g.files)}else s(p)},[r,s]),u=hs.useCallback(p=>{p.preventDefault(),p.stopPropagation(),p.clipboardData.files&&p.clipboardData.files.length>0&&c(p.clipboardData.files)},[c]),d=hs.useCallback(p=>{p.preventDefault(),p.stopPropagation(),a(!0)},[]),f=hs.useCallback(p=>{p.preventDefault(),p.stopPropagation(),a(!1)},[]),m=hs.useCallback(p=>{p.preventDefault(),p.stopPropagation(),a(!1),p.dataTransfer.files&&p.dataTransfer.files.length>0&&(c(p.dataTransfer.files),a(!1),p.dataTransfer.clearData())},[c]);hs.useEffect(()=>{let p=i.current;return p&&!o?(p.addEventListener("dragenter",d),p.addEventListener("dragleave",f),p.addEventListener("dragover",GS),p.addEventListener("drop",m),p.addEventListener("paste",u),()=>{p.removeEventListener("dragenter",d),p.removeEventListener("dragleave",f),p.removeEventListener("dragover",GS),p.removeEventListener("drop",m),p.removeEventListener("paste",u)}):()=>null},[o,d,f,m,u]);let h=[Rj,e,l?"dragging":"",`dropzoneStyle--${n}`].filter(Boolean).join(" ");return Ij("div",{className:h,ref:i,children:t})}import{jsx as HS,jsxs as Fj}from"react/jsx-runtime";import"react";import{c as _j}from"react/compiler-runtime";import{jsx as WS}from"react/jsx-runtime";import"react";var Dj="drawer-close-button";function Mm(t){let e=_j(3),{onClick:o}=t,{t:n}=$(),r;return e[0]!==o||e[1]!==n?(r=WS("button",{"aria-label":n("general:close"),className:Dj,onClick:o,type:"button",children:WS(pt,{})}),e[0]=o,e[1]=n,e[2]=r):r=e[2],r}var Aj="bulk-upload--drawer-header";function Ra({onClose:t,title:e}){return Fj("div",{className:Aj,children:[HS("h2",{title:e,children:e}),HS(Mm,{onClick:t})]})}var Vm="bulk-upload--add-files";function Gm({acceptMimeTypes:t,onCancel:e,onDrop:o}){let{t:n}=$(),r=Tj.useRef(null);return mb("div",{className:Vm,children:[Bm(Ra,{onClose:e,title:n("upload:addFiles")}),Bm("div",{className:`${Vm}__dropArea`,children:mb(pi,{multipleFiles:!0,onChange:o,children:[Bm(se,{buttonStyle:"pill",iconPosition:"left",onClick:()=>{r.current&&r.current.click()},size:"small",children:n("upload:selectFile")}),Bm("input",{accept:t,"aria-hidden":"true",className:`${Vm}__hidden-input`,hidden:!0,multiple:!0,onChange:s=>{s.target.files&&s.target.files.length>0&&o(s.target.files)},ref:r,type:"file"}),mb("p",{className:`${Vm}__dragAndDropText`,children:[n("general:or")," ",n("upload:dragAndDrop")]})]})})]})}import{c as NO}from"react/compiler-runtime";import{jsx as zc,jsxs as Db}from"react/jsx-runtime";import{getTranslation as LO}from"@payloadcms/translations";import{reduceFieldsToValues as $O}from"payload/shared";import"react";import{c as iI}from"react/compiler-runtime";import{jsx as Wr,jsxs as Lc}from"react/jsx-runtime";import"react";import{c as Zj}from"react/compiler-runtime";import{jsx as Um,jsxs as Jj}from"react/jsx-runtime";import"react";import{jsx as Pj,jsxs as Nj}from"react/jsx-runtime";import{isImage as Lj}from"payload/shared";import*as Wm from"qs-esm";import ot from"react";var zS=t=>new Promise((e,o)=>{let n=new Image;n.src=URL.createObjectURL(t),n.onload=()=>{let s,i,l=n.width/n.height;l>1?(i=280,s=280/l):(i=280*l,s=280);let a=new OffscreenCanvas(i,s);a.getContext("2d").drawImage(n,0,0,i,s),a.convertToBlob({type:"image/jpeg",quality:.25}).then(u=>{URL.revokeObjectURL(n.src);let d=new FileReader;d.onload=()=>e(d.result),d.onerror=o,d.readAsDataURL(u)}).catch(o)},n.onerror=r=>{URL.revokeObjectURL(n.src),o(r)}});var XS=As(ob(),1);import{reduceFieldsToValues as Ej}from"payload/shared";async function US(t={},e={},o,n){let r=Ej(t,!0),s=r?.file;if(s&&delete r.file,s&&typeof n=="function"){let a=s.name,c=await n({file:s,updateFilename:u=>{a=u}});s=JSON.stringify({clientUploadContext:c,collectionSlug:o,filename:a,mimeType:s.type,size:s.size})}let i={...r,...e},l={_payload:JSON.stringify(i),file:s};return(0,XS.serialize)(l,{indices:!0,nullsAsUndefineds:!1})}function YS(t,e){switch(e.type){case"ADD_FORMS":{let o=[];for(let n=0;n<e.files.length;n++)o[n]={errorCount:0,formState:{...e.initialState||{},file:{initialValue:e.files[n],valid:!0,value:e.files[n]}},uploadEdits:{}};return{...t,activeIndex:0,forms:[...o,...t.forms]}}case"REMOVE_FORM":{let o=[...t.forms],[n]=o.splice(e.index,1),r=t.activeIndex>=e.index,s=t.activeIndex===e.index?e.index:r?t.activeIndex-1:t.activeIndex,i=Math.min(o.length-1,s);return{...t,activeIndex:r?i:t.activeIndex,forms:o,totalErrorCount:t.totalErrorCount-n.errorCount}}case"REPLACE":return{...t,...e.state};case"SET_ACTIVE_INDEX":return{...t,activeIndex:e.index};case"UPDATE_ERROR_COUNT":{let o=[...t.forms];return o[e.index].errorCount=e.count,{...t,forms:o,totalErrorCount:t.forms.reduce((n,r)=>n+r.errorCount,0)}}case"UPDATE_FORM":{let o=[...t.forms];return o[e.index].errorCount=e.errorCount,o[e.index]={...o[e.index],formState:{...o[e.index].formState,...e.formState},uploadEdits:{...o[e.index].uploadEdits,...e.uploadEdits}},{...t,forms:o,totalErrorCount:t.forms.reduce((n,r)=>n+r.errorCount,0)}}default:return t}}var ZS=ot.createContext({activeIndex:0,addFiles:()=>Promise.resolve(),bulkUpdateForm:()=>null,collectionSlug:"",docPermissions:void 0,documentSlots:{},forms:[],getFormDataRef:{current:()=>({})},hasPublishPermission:!1,hasSavePermission:!1,hasSubmitted:!1,isInitializing:!1,removeFile:()=>{},saveAllDocs:()=>Promise.resolve(),setActiveIndex:()=>0,setFormTotalErrorCount:()=>{},thumbnailUrls:[],totalErrorCount:0,updateUploadEdits:()=>{}}),$j={activeIndex:0,forms:[],totalErrorCount:0};function JS({children:t}){let{config:e}=W(),{routes:{api:o},serverURL:n}=e,{code:r}=$e(),{i18n:s,t:i}=$(),{getDocumentSlots:l,getFormState:a}=Ft(),{getUploadHandler:c}=Dc(),[u,d]=ot.useState({}),[f,m]=ot.useState(!1),[h,p]=ot.useState(),[g,b]=ot.useState(!1),[v,x]=ot.useState(!1),[y,C]=ot.useState(!1),[S,w]=ot.useState(!1),[F,_]=ot.useState(!1),[A,R]=ot.useReducer(YS,$j),{activeIndex:I,forms:D,totalErrorCount:E}=A,T=ot.useRef(D);T.current=D;let L=D.length,k=ot.useRef([]),j=ot.useRef(new Set),[P,N]=ot.useState([]);ot.useEffect(()=>{(async()=>{let U=[...k.current];for(let ie=0;ie<L;ie++){let de=T.current[ie].formState.file.value;if(j.current.has(de)||!de||!Lj(de.type))continue;j.current.add(de);let Te=await zS(de);U[ie]=Te,k.current=U,N([...U]),await new Promise(Ge=>setTimeout(Ge,100))}})()},[L]);let{toggleLoadingOverlay:B}=mm(),{closeModal:M}=ue(),{collectionSlug:O,drawerSlug:V,initialFiles:G,onSuccess:z}=Ho(),[X,te]=ot.useState(!1),[Y,H]=ot.useState(""),le=ot.useRef(!1),q=ot.useRef(null),fe=ot.useRef(()=>({})),ae=`${o}/${O}`,J=ot.useCallback(async()=>{let U={locale:r||void 0},ie=`/${O}/access`,Te=await(await fetch(`${n}${o}${ie}?${Wm.stringify(U)}`,{credentials:"include",headers:{"Accept-Language":s.language,"Content-Type":"application/json"},method:"post"})).json(),Ge=await fetch(`${n}${o}${ie}?${Wm.stringify(U)}`,{body:JSON.stringify({_status:"published"}),credentials:"include",headers:{"Accept-Language":s.language,"Content-Type":"application/json"},method:"POST"}).then(je=>je.json());p(Te),b(wl({collectionSlug:O,docPermissions:Te,isEditing:!1})),x(Ge?.update),w(!0)},[o,r,O,s.language,n]),ge=ot.useCallback(async U=>{U?.signal&&U.abort("aborting previous fetch for initial form state without files");let ie=await l({collectionSlug:O});d(ie);try{let{state:de}=await a({collectionSlug:O,docPermissions:h,docPreferences:{fields:{}},locale:r,operation:"create",renderAllFields:!0,schemaPath:O,skipValidation:!0});q.current=de,C(!0)}catch{}},[l,O,a,h,r]),Ce=ot.useCallback(U=>{let ie=fe.current();R({type:"REPLACE",state:{activeIndex:U,forms:D.map((de,Te)=>Te===I?{errorCount:de.errorCount,formState:ie,uploadEdits:de.uploadEdits}:de)}})},[D,I]),he=ot.useCallback(async U=>{B({isLoading:!0,key:"addingDocs"}),y||await ge(),R({type:"ADD_FORMS",files:U,initialState:q.current}),B({isLoading:!1,key:"addingDocs"})},[ge,y,B]),Le=ot.useCallback(U=>{k.current=k.current.filter((ie,de)=>!U.includes(de)),N([...k.current])},[]),Ae=ot.useCallback(U=>{R({type:"REMOVE_FORM",index:U}),Le([U])},[Le]),Q=ot.useCallback(({errorCount:U,index:ie})=>{R({type:"UPDATE_ERROR_COUNT",count:U,index:ie})},[]),ke=ot.useCallback(async({overrides:U}={})=>{let ie=fe.current(),de=[...D];de[I]={errorCount:de[I].errorCount,formState:ie,uploadEdits:de[I].uploadEdits};let Te=[];te(!0);for(let He=0;He<de.length;He++)try{let dt=de[He];H(i("general:uploadingBulk",{current:He+1,total:de.length}));let Kt=`${ae}${Wm.stringify({uploadEdits:dt?.uploadEdits||void 0},{addQueryPrefix:!0})}`,ze=await fetch(Kt,{body:await US(dt.formState,U,O,c({collectionSlug:O})),method:"POST"}),Je=await ze.json();ze.status===201&&Je?.doc&&Te.push(Je.doc);let[Xe,Ct]=(Je?.errors||[]).reduce(([Et,gt],qe)=>{let Pt=[],be=[];return qe?.message&&be.push(qe),Array.isArray(qe?.data?.errors)&&qe.data?.errors.forEach(ee=>{ee?.path?Pt.push(ee):be.push(ee)}),[[...Et,...Pt],[...gt,...be]]},[[],[]]);de[He]={errorCount:Xe.length,formState:Fc(de[He].formState,{type:"ADD_SERVER_ERRORS",errors:Xe})},(ze.status===413||ze.status===400)&&(de[He]={...de[He],errorCount:de[He].errorCount+1},me.error(Ct[0]?.message))}catch{}m(!0),H(""),te(!1);let Ge=[],je=[];de.forEach(({errorCount:He},dt)=>{He?Ge.push(de[dt]):je.push(dt)});let lt=Math.max(0,de.length-Ge.length),Ue=de.length-lt;lt&&(me.success(`Successfully saved ${lt} files`),typeof z=="function"&&z(Te,Ue),Ge.length&&je.length&&Le(je)),Ue?me.error(`Failed to save ${Ue} files`):M(V),R({type:"REPLACE",state:{activeIndex:0,forms:Ge,totalErrorCount:Ge.reduce((He,{errorCount:dt})=>He+dt,0)}})},[ae,I,D,Le,z,O,c,i,M,V]),xe=ot.useCallback(async(U,ie)=>{for(let de=0;de<D.length;de++)if(Object.entries(U).forEach(([Te,Ge])=>{D[de].formState[Te]&&(D[de].formState[Te].value=Ge,R({type:"UPDATE_FORM",errorCount:D[de].errorCount,formState:D[de].formState,index:de}))}),typeof ie=="function"&&ie(),f){let{state:Te}=await a({collectionSlug:O,docPermissions:h,docPreferences:null,formState:D[de].formState,operation:"create",schemaPath:O}),Ge=Object.values(Te).reduce((je,lt)=>lt?.valid===!1?je+1:je,0);R({type:"UPDATE_FORM",errorCount:Ge,formState:Te,index:de})}},[O,h,D,a,f]),ce=ot.useCallback(U=>{R({type:"UPDATE_FORM",errorCount:D[I].errorCount,formState:D[I].formState,index:I,uploadEdits:U})},[I,D]),ne=ot.useCallback(()=>{R({type:"REPLACE",state:{forms:D.map(U=>({...U,uploadEdits:{}}))}})},[D]);return ot.useEffect(()=>{O&&(y||ge(),S||J(),G&&_(!y||!S),y&&G&&!le.current&&(he(G),le.current=!0))},[he,G,ge,J,O,y,S]),Nj(ZS,{value:{activeIndex:A.activeIndex,addFiles:he,bulkUpdateForm:xe,collectionSlug:O,docPermissions:h,documentSlots:u,forms:D,getFormDataRef:fe,hasPublishPermission:v,hasSavePermission:g,hasSubmitted:f,isInitializing:F,removeFile:Ae,resetUploadEdits:ne,saveAllDocs:ke,setActiveIndex:Ce,setFormTotalErrorCount:Q,thumbnailUrls:P,totalErrorCount:E,updateUploadEdits:ce},children:[X&&Pj(Rn,{animationDuration:"250ms",loadingText:Y,overlayType:"fullscreen",show:!0}),t]})}function Io(){return ot.use(ZS)}import{jsx as Gr,jsxs as fb}from"react/jsx-runtime";import{getTranslation as zj}from"@payloadcms/translations";import{unflatten as oI}from"payload/shared";import Xj,{useCallback as pb,useEffect as Uj,useMemo as Yj,useState as rI}from"react";import{c as Bj}from"react/compiler-runtime";import{jsx as tI,jsxs as Vj}from"react/jsx-runtime";import{useState as Gj}from"react";var qS=t=>{let e=["file","mimeType","thumbnailURL","width","height","filesize","filename","url","focalX","focalY","sizes"];return t.filter(o=>!e.includes("name"in o&&o.name))};import{fieldAffectsData as kj,fieldHasSubFields as jj,fieldIsHiddenOrDisabled as Oj,getFieldPermissions as Mj}from"payload/shared";import{fieldAffectsData as QS}from"payload/shared";var _a=(t,e)=>t?QS(e)?`${t}.${e.name}`:t:QS(e)?e.name:"";import{jsx as Hm,jsxs as KS}from"react/jsx-runtime";import{Fragment as eI}from"react";var Nc=({CustomLabel:t,field:e,prefix:o})=>KS(eI,{children:[o?KS(eI,{children:[Hm("span",{style:{display:"inline-block"},children:o})," > "]}):null,Hm("span",{style:{display:"inline-block"},children:Hm(oe,{CustomComponent:t,Fallback:Hm(ye,{label:"label"in e&&e.label})})})]});var zm=({fields:t,formState:e,labelPrefix:o=null,parentPath:n="",path:r="",permissions:s})=>{if(!t)return[];let i=e?.[r]?.customComponents?.Label;return t?.reduce((l,a)=>{let{operation:c,permissions:u,read:d}=Mj({field:a,operation:"update",parentName:n?.includes(".")?n.split(".")[n.split(".").length-1]:n,permissions:s});if((kj(a)||a.type==="ui")&&(a.admin?.disableBulkEdit||a.unique||Oj(a)||"readOnly"in a&&a.readOnly||!c||!d))return l;if(!(a.type==="array"||a.type==="blocks")&&jj(a))return[...l,...zm({fields:a.fields,labelPrefix:Nc({CustomLabel:i,field:a,prefix:o}),parentPath:r,path:_a(r,a),permissions:u})];if(a.type==="tabs"&&"tabs"in a)return[...l,...a.tabs.reduce((m,h)=>{if("fields"in h){let p="name"in h&&h.name;return[...m,...zm({fields:h.fields,labelPrefix:o,parentPath:r,path:p?_a(r,a):r,permissions:u})]}},[])];let f={label:Nc({CustomLabel:i,field:a,prefix:o}),value:{field:a,fieldPermissions:u,path:_a(r,a)}};return[...l,f]},[])};var Wj="field-select",Xm=t=>{let e=Bj(14),{fields:o,onChange:n,permissions:r}=t,{t:s}=$(),{dispatchFields:i,getFields:l}=Me(),a;e[0]!==o||e[1]!==l||e[2]!==r?(a=()=>zm({fields:qS(o),formState:l(),permissions:r}),e[0]=o,e[1]=l,e[2]=r,e[3]=a):a=e[3];let[c]=Gj(a),u;if(e[4]!==i||e[5]!==l||e[6]!==n||e[7]!==c||e[8]!==s){let d;e[10]!==i||e[11]!==l||e[12]!==n?(d=f=>n({dispatchFields:i,formState:l(),selected:f}),e[10]=i,e[11]=l,e[12]=n,e[13]=d):d=e[13],u=Vj("div",{className:Wj,children:[tI(ye,{label:s("fields:selectFieldsToEdit")}),tI(ft,{getOptionValue:Hj,isMulti:!0,onChange:d,options:c})]}),e[4]=i,e[5]=l,e[6]=n,e[7]=c,e[8]=s,e[9]=u}else u=e[9];return u};function Hj(t){return typeof t.value=="object"&&"path"in t.value?String(t.value.path):String(t.value)}var nI=t=>{let{collection:{fields:e,labels:{plural:o,singular:n}}={},collection:r,drawerSlug:s,forms:i}=t,[l,a]=rI(!1),{permissions:c}=De(),{i18n:u,t:d}=$(),{closeModal:f}=ue(),{bulkUpdateForm:m}=Io(),{getFormState:h}=Ft(),p=Xj.useRef(null),[g,b]=rI([]),v=c?.collections?.[r.slug],x=Yj(()=>oI(g.reduce((w,F)=>(w[F.value.path]=!0,w),{})),[g]),y=pb(async({formState:w,submitted:F})=>{let _=rr(p),{state:A}=await h({collectionSlug:r.slug,docPermissions:v,docPreferences:null,formState:w,operation:"update",schemaPath:r.slug,select:x,signal:_.signal,skipValidation:!F});return p.current=null,A},[h,r,v,x]);Uj(()=>{let w=p.current;return()=>{or(w)}},[]);let C=pb(w=>{let F=g.reduce((_,A)=>(w[A.value.path]&&(_[A.value.path]=w[A.value.path].value),_),{});m(F,()=>f(s))},[f,s,m,g]),S=pb(async({dispatchFields:w,formState:F,selected:_})=>{a(!0),b(_||[]);let{state:A}=await h({collectionSlug:r.slug,docPermissions:v,docPreferences:null,formState:F,operation:"update",schemaPath:r.slug,select:oI(_.reduce((R,I)=>(R[I.value.path]=!0,R),{})),skipValidation:!0});w({type:"UPDATE_MANY",formState:A}),a(!1)},[h,r,v]);return fb("div",{className:`${br}__main`,children:[fb("div",{className:`${br}__header`,children:[Gr("h2",{className:`${br}__header__title`,children:d("general:editingLabel",{count:i.length,label:zj(i.length>1?o:n,u)})}),Gr("button",{"aria-label":d("general:close"),className:`${br}__header__close`,id:`close-drawer__${s}`,onClick:()=>f(s),type:"button",children:Gr(pt,{})})]}),fb(Tn,{className:`${br}__form`,isInitializing:l,onChange:[y],onSubmit:C,children:[Gr(Xm,{fields:e,onChange:S,permissions:v.fields}),g.length===0?null:Gr("div",{className:"render-fields",children:g.map((w,F)=>{let{value:{field:_,fieldPermissions:A,path:R}}=w;return Gr(Da,{clientFieldConfig:_,indexPath:"",parentPath:"",parentSchemaPath:"",path:R,permissions:A},`${R}-${F}`)})}),Gr("div",{className:`${br}__sidebar-wrap`,children:Gr("div",{className:`${br}__sidebar`,children:Gr("div",{className:`${br}__sidebar-sticky-wrap`,children:Gr("div",{className:`${br}__document-actions`,children:Gr(se,{type:"submit",children:d("general:applyChanges")})})})})})]})]})};var br="edit-many-bulk-uploads",sI=t=>{let e=Zj(5),{collection:o,collection:n}=t,{slug:r}=o===void 0?{}:o,{permissions:s}=De(),{t:i}=$(),{forms:l}=Io(),c=s?.collections?.[r]?.update,u=`edit-${r}-bulk-uploads`;if(!c)return null;let d;return e[0]!==n||e[1]!==u||e[2]!==l||e[3]!==i?(d=Jj("div",{className:br,children:[Um(dr,{"aria-label":i("general:editAll"),className:`${br}__toggle`,slug:u,children:i("general:editAll")}),Um($s,{children:Um(Lt,{Header:null,slug:u,children:Um(nI,{collection:n,drawerSlug:u,forms:l})})})]}),e[0]=n,e[1]=u,e[2]=l,e[3]=i,e[4]=d):d=e[4],d};var Fa="bulk-upload--actions-bar";function aI(t){let e=iI(15),{collectionConfig:o}=t,{activeIndex:n,forms:r,setActiveIndex:s}=Io(),{t:i}=$(),l=n+1,a;if(e[0]!==n||e[1]!==o||e[2]!==r.length||e[3]!==s||e[4]!==i||e[5]!==l){let c;e[7]!==n||e[8]!==r.length||e[9]!==s?(c=()=>{let d=n-1;d<0?s(r.length-1):s(d)},e[7]=n,e[8]=r.length,e[9]=s,e[10]=c):c=e[10];let u;e[11]!==n||e[12]!==r.length||e[13]!==s?(u=()=>{let d=n+1;d===r.length?s(0):s(d)},e[11]=n,e[12]=r.length,e[13]=s,e[14]=u):u=e[14],a=Lc("div",{className:Fa,children:[Lc("div",{className:`${Fa}__navigation`,children:[Lc("p",{className:`${Fa}__locationText`,children:[Wr("strong",{children:l})," of ",Wr("strong",{children:r.length})]}),Lc("div",{className:`${Fa}__controls`,children:[Wr(se,{"aria-label":i("general:previous"),buttonStyle:"none",onClick:c,type:"button",children:Wr(Ze,{direction:"left"})}),Wr(se,{"aria-label":i("general:next"),buttonStyle:"none",onClick:u,type:"button",children:Wr(Ze,{direction:"right"})})]}),Wr(sI,{collection:o})]}),Wr(hb,{className:`${Fa}__saveButtons`})]}),e[0]=n,e[1]=o,e[2]=r.length,e[3]=s,e[4]=i,e[5]=l,e[6]=a}else a=e[6];return a}function hb(t){let e=iI(12),{className:o}=t,{getEntityConfig:n}=W(),{t:r}=$(),{collectionSlug:s,hasPublishPermission:i,hasSavePermission:l,saveAllDocs:a}=Io(),c;e[0]!==s||e[1]!==n?(c=n({collectionSlug:s}),e[0]=s,e[1]=n,e[2]=c):c=e[2];let u=c,d;e[3]!==o?(d=[`${Fa}__buttons`,o].filter(Boolean),e[3]=o,e[4]=d):d=e[4];let f=d.join(" "),m;return e[5]!==u?.versions?.drafts||e[6]!==i||e[7]!==l||e[8]!==a||e[9]!==r||e[10]!==f?(m=Lc("div",{className:f,children:[u?.versions?.drafts&&l?Wr(se,{buttonStyle:"secondary",onClick:()=>void a({overrides:{_status:"draft"}}),children:r("version:saveDraft")}):null,u?.versions?.drafts&&i?Wr(se,{onClick:()=>void a({overrides:{_status:"published"}}),children:r("version:publish")}):null,!u?.versions?.drafts&&l?Wr(se,{onClick:()=>void a(),children:r("general:save")}):null]}),e[5]=u?.versions?.drafts,e[6]=i,e[7]=l,e[8]=a,e[9]=r,e[10]=f,e[11]=m):m=e[11],m}import{c as qj}from"react/compiler-runtime";import{jsx as Qj}from"react/jsx-runtime";import"react";var $c="bulk-upload--discard-without-saving";function lI(){let t=qj(9),{t:e}=$(),{closeModal:o}=ue(),{drawerSlug:n}=Ho(),r;t[0]!==o?(r=()=>{o($c)},t[0]=o,t[1]=r):r=t[1];let s=r,i;t[2]!==o||t[3]!==n?(i=()=>{o(n),o($c)},t[2]=o,t[3]=n,t[4]=i):i=t[4];let l=i,a;return t[5]!==s||t[6]!==l||t[7]!==e?(a=Qj(Rt,{body:e("general:changesNotSaved"),cancelLabel:e("general:stayOnThisPage"),confirmLabel:e("general:leaveAnyway"),heading:e("general:leaveWithoutSaving"),modalSlug:$c,onCancel:s,onConfirm:l}),t[5]=s,t[6]=l,t[7]=e,t[8]=a):a=t[8],a}import{jsx as Cs,jsxs as yO}from"react/jsx-runtime";import{useRouter as CO,useSearchParams as wO}from"next/navigation.js";import{formatAdminURL as SO}from"payload/shared";import Hc,{useCallback as EI,useEffect as PI}from"react";import{c as Kj}from"react/compiler-runtime";import{jsx as eO}from"react/jsx-runtime";import{createContext as tO,use as oO,useState as rO}from"react";var cI=tO({mostRecentUpdate:null,reportUpdate:t=>null}),gb=t=>{let e=Kj(3),{children:o}=t,[n,r]=rO(null),s;return e[0]!==o||e[1]!==n?(s=eO(cI,{value:{mostRecentUpdate:n,reportUpdate:r},children:o}),e[0]=o,e[1]=n,e[2]=s):s=e[2],s},hi=()=>oO(cI);import{jsx as gs,jsxs as uI}from"react/jsx-runtime";import{fieldIsSidebar as nO}from"payload/shared";import{useMemo as sO}from"react";var vr="document-fields",kc=({AfterFields:t,BeforeFields:e,Description:o,docPermissions:n,fields:r,forceSidebarWrap:s,readOnly:i,schemaPathSegments:l})=>{let{hasSidebarFields:a,mainFields:c,sidebarFields:u}=sO(()=>r.reduce((d,f)=>(nO(f)?(d.sidebarFields.push(f),d.mainFields.push(null),d.hasSidebarFields=!0):(d.mainFields.push(f),d.sidebarFields.push(null)),d),{hasSidebarFields:!1,mainFields:[],sidebarFields:[]}),[r]);return uI("div",{className:[vr,a?`${vr}--has-sidebar`:`${vr}--no-sidebar`,s&&`${vr}--force-sidebar-wrap`].filter(Boolean).join(" "),children:[gs("div",{className:`${vr}__main`,children:uI(Bo,{className:`${vr}__edit`,children:[o?gs("header",{className:`${vr}__header`,children:gs("div",{className:`${vr}__sub-header`,children:o})}):null,e,gs(So,{className:`${vr}__fields`,fields:c,forceRender:!0,parentIndexPath:"",parentPath:"",parentSchemaPath:l.join("."),permissions:n?.fields,readOnly:i}),t]})}),a?gs("div",{className:`${vr}__sidebar-wrap`,children:gs("div",{className:`${vr}__sidebar`,children:gs("div",{className:`${vr}__sidebar-fields`,children:gs(So,{fields:u,forceRender:!0,parentIndexPath:"",parentPath:"",parentSchemaPath:l.join("."),permissions:n?.fields,readOnly:i})})})}):null]})};import{c as FI}from"react/compiler-runtime";import{jsx as St,jsxs as yr}from"react/jsx-runtime";import{isImage as AI}from"payload/shared";import Wc,{Fragment as bO,useCallback as Qm,useEffect as Sb,useRef as DI,useState as Gc}from"react";import{jsx as Dt,jsxs as No}from"react/jsx-runtime";import Jm,{useRef as Pa,useState as xs}from"react";import Vt,{PureComponent as iO,createRef as dI}from"react";var Ym={x:0,y:0,width:0,height:0,unit:"px"},Aa=(t,e,o)=>Math.min(Math.max(t,e),o),aO=(...t)=>t.filter(e=>e&&typeof e=="string").join(" "),mI=(t,e)=>t===e||t.width===e.width&&t.height===e.height&&t.x===e.x&&t.y===e.y&&t.unit===e.unit;function Ta(t,e,o){return t.unit==="%"?{...Ym,...t,unit:"%"}:{unit:"%",x:t.x?t.x/e*100:0,y:t.y?t.y/o*100:0,width:t.width?t.width/e*100:0,height:t.height?t.height/o*100:0}}function bs(t,e,o){return t.unit?t.unit==="px"?{...Ym,...t,unit:"px"}:{unit:"px",x:t.x?t.x*e/100:0,y:t.y?t.y*o/100:0,width:t.width?t.width*e/100:0,height:t.height?t.height*o/100:0}:{...Ym,...t,unit:"px"}}function fI(t,e,o,n,r,s=0,i=0,l=n,a=r){let c={...t},u=Math.min(s,n),d=Math.min(i,r),f=Math.min(l,n),m=Math.min(a,r);e&&(e>1?(u=i?i*e:u,d=u/e,f=l*e):(d=s?s/e:d,u=d*e,m=a/e)),c.y<0&&(c.height=Math.max(c.height+c.y,d),c.y=0),c.x<0&&(c.width=Math.max(c.width+c.x,u),c.x=0);let h=n-(c.x+c.width);h<0&&(c.x=Math.min(c.x,n-u),c.width+=h);let p=r-(c.y+c.height);if(p<0&&(c.y=Math.min(c.y,r-d),c.height+=p),c.width<u&&((o==="sw"||o=="nw")&&(c.x-=u-c.width),c.width=u),c.height<d&&((o==="nw"||o=="ne")&&(c.y-=d-c.height),c.height=d),c.width>f&&((o==="sw"||o=="nw")&&(c.x-=f-c.width),c.width=f),c.height>m&&((o==="nw"||o=="ne")&&(c.y-=m-c.height),c.height=m),e){let g=c.width/c.height;if(g<e){let b=Math.max(c.width/e,d);(o==="nw"||o=="ne")&&(c.y-=b-c.height),c.height=b}else if(g>e){let b=Math.max(c.height*e,u);(o==="sw"||o=="nw")&&(c.x-=b-c.width),c.width=b}}return c}function lO(t,e,o,n){let r={...t};return e==="ArrowLeft"?n==="nw"?(r.x-=o,r.y-=o,r.width+=o,r.height+=o):n==="w"?(r.x-=o,r.width+=o):n==="sw"?(r.x-=o,r.width+=o,r.height+=o):n==="ne"?(r.y+=o,r.width-=o,r.height-=o):n==="e"?r.width-=o:n==="se"&&(r.width-=o,r.height-=o):e==="ArrowRight"&&(n==="nw"?(r.x+=o,r.y+=o,r.width-=o,r.height-=o):n==="w"?(r.x+=o,r.width-=o):n==="sw"?(r.x+=o,r.width-=o,r.height-=o):n==="ne"?(r.y-=o,r.width+=o,r.height+=o):n==="e"?r.width+=o:n==="se"&&(r.width+=o,r.height+=o)),e==="ArrowUp"?n==="nw"?(r.x-=o,r.y-=o,r.width+=o,r.height+=o):n==="n"?(r.y-=o,r.height+=o):n==="ne"?(r.y-=o,r.width+=o,r.height+=o):n==="sw"?(r.x+=o,r.width-=o,r.height-=o):n==="s"?r.height-=o:n==="se"&&(r.width-=o,r.height-=o):e==="ArrowDown"&&(n==="nw"?(r.x+=o,r.y+=o,r.width-=o,r.height-=o):n==="n"?(r.y+=o,r.height-=o):n==="ne"?(r.y+=o,r.width-=o,r.height-=o):n==="sw"?(r.x-=o,r.width+=o,r.height+=o):n==="s"?r.height+=o:n==="se"&&(r.width+=o,r.height+=o)),r}var Ea={capture:!0,passive:!1},vs=class Hr extends iO{constructor(){super(...arguments),this.docMoveBound=!1,this.mouseDownOnCrop=!1,this.dragStarted=!1,this.evData={startClientX:0,startClientY:0,startCropX:0,startCropY:0,clientX:0,clientY:0,isResize:!0},this.componentRef=dI(),this.mediaRef=dI(),this.initChangeCalled=!1,this.state={cropIsActive:!1,newCropIsBeingDrawn:!1},this.onCropPointerDown=e=>{let{crop:o,disabled:n}=this.props,r=this.getBox();if(!o)return;let s=bs(o,r.width,r.height);if(n)return;e.cancelable&&e.preventDefault(),this.bindDocMove(),this.componentRef.current.focus({preventScroll:!0});let i=e.target.dataset.ord,l=!!i,a=e.clientX,c=e.clientY,u=s.x,d=s.y;if(i){let f=e.clientX-r.x,m=e.clientY-r.y,h=0,p=0;i==="ne"||i=="e"?(h=f-(s.x+s.width),p=m-s.y,u=s.x,d=s.y+s.height):i==="se"||i==="s"?(h=f-(s.x+s.width),p=m-(s.y+s.height),u=s.x,d=s.y):i==="sw"||i=="w"?(h=f-s.x,p=m-(s.y+s.height),u=s.x+s.width,d=s.y):(i==="nw"||i=="n")&&(h=f-s.x,p=m-s.y,u=s.x+s.width,d=s.y+s.height),a=u+r.x+h,c=d+r.y+p}this.evData={startClientX:a,startClientY:c,startCropX:u,startCropY:d,clientX:e.clientX,clientY:e.clientY,isResize:l,ord:i},this.mouseDownOnCrop=!0,this.setState({cropIsActive:!0})},this.onComponentPointerDown=e=>{let{crop:o,disabled:n,locked:r,keepSelection:s,onChange:i}=this.props,l=this.getBox();if(n||r||s&&o)return;e.cancelable&&e.preventDefault(),this.bindDocMove(),this.componentRef.current.focus({preventScroll:!0});let a=e.clientX-l.x,c=e.clientY-l.y,u={unit:"px",x:a,y:c,width:0,height:0};this.evData={startClientX:e.clientX,startClientY:e.clientY,startCropX:a,startCropY:c,clientX:e.clientX,clientY:e.clientY,isResize:!0},this.mouseDownOnCrop=!0,i(bs(u,l.width,l.height),Ta(u,l.width,l.height)),this.setState({cropIsActive:!0,newCropIsBeingDrawn:!0})},this.onDocPointerMove=e=>{let{crop:o,disabled:n,onChange:r,onDragStart:s}=this.props,i=this.getBox();if(n||!o||!this.mouseDownOnCrop)return;e.cancelable&&e.preventDefault(),this.dragStarted||(this.dragStarted=!0,s&&s(e));let{evData:l}=this;l.clientX=e.clientX,l.clientY=e.clientY;let a;l.isResize?a=this.resizeCrop():a=this.dragCrop(),mI(o,a)||r(bs(a,i.width,i.height),Ta(a,i.width,i.height))},this.onComponentKeyDown=e=>{let{crop:o,disabled:n,onChange:r,onComplete:s}=this.props;if(n)return;let i=e.key,l=!1;if(!o)return;let a=this.getBox(),c=this.makePixelCrop(a),u=(navigator.platform.match("Mac")?e.metaKey:e.ctrlKey)?Hr.nudgeStepLarge:e.shiftKey?Hr.nudgeStepMedium:Hr.nudgeStep;if(i==="ArrowLeft"?(c.x-=u,l=!0):i==="ArrowRight"?(c.x+=u,l=!0):i==="ArrowUp"?(c.y-=u,l=!0):i==="ArrowDown"&&(c.y+=u,l=!0),l){e.cancelable&&e.preventDefault(),c.x=Aa(c.x,0,a.width-c.width),c.y=Aa(c.y,0,a.height-c.height);let d=bs(c,a.width,a.height),f=Ta(c,a.width,a.height);r(d,f),s&&s(d,f)}},this.onHandlerKeyDown=(e,o)=>{let{aspect:n=0,crop:r,disabled:s,minWidth:i=0,minHeight:l=0,maxWidth:a,maxHeight:c,onChange:u,onComplete:d}=this.props,f=this.getBox();if(s||!r)return;if(e.key==="ArrowUp"||e.key==="ArrowDown"||e.key==="ArrowLeft"||e.key==="ArrowRight")e.stopPropagation(),e.preventDefault();else return;let m=(navigator.platform.match("Mac")?e.metaKey:e.ctrlKey)?Hr.nudgeStepLarge:e.shiftKey?Hr.nudgeStepMedium:Hr.nudgeStep,h=bs(r,f.width,f.height),p=lO(h,e.key,m,o),g=fI(p,n,o,f.width,f.height,i,l,a,c);if(!mI(r,g)){let b=Ta(g,f.width,f.height);u(g,b),d&&d(g,b)}},this.onDocPointerDone=e=>{let{crop:o,disabled:n,onComplete:r,onDragEnd:s}=this.props,i=this.getBox();this.unbindDocMove(),!(n||!o)&&this.mouseDownOnCrop&&(this.mouseDownOnCrop=!1,this.dragStarted=!1,s&&s(e),r&&r(bs(o,i.width,i.height),Ta(o,i.width,i.height)),this.setState({cropIsActive:!1,newCropIsBeingDrawn:!1}))},this.onDragFocus=e=>{var o;(o=this.componentRef.current)==null||o.scrollTo(0,0)}}get document(){return document}getBox(){let e=this.mediaRef.current;if(!e)return{x:0,y:0,width:0,height:0};let{x:o,y:n,width:r,height:s}=e.getBoundingClientRect();return{x:o,y:n,width:r,height:s}}componentDidUpdate(e){let{crop:o,onComplete:n}=this.props;if(n&&!e.crop&&o){let{width:r,height:s}=this.getBox();r&&s&&n(bs(o,r,s),Ta(o,r,s))}}componentWillUnmount(){this.resizeObserver&&this.resizeObserver.disconnect()}bindDocMove(){this.docMoveBound||(this.document.addEventListener("pointermove",this.onDocPointerMove,Ea),this.document.addEventListener("pointerup",this.onDocPointerDone,Ea),this.document.addEventListener("pointercancel",this.onDocPointerDone,Ea),this.docMoveBound=!0)}unbindDocMove(){this.docMoveBound&&(this.document.removeEventListener("pointermove",this.onDocPointerMove,Ea),this.document.removeEventListener("pointerup",this.onDocPointerDone,Ea),this.document.removeEventListener("pointercancel",this.onDocPointerDone,Ea),this.docMoveBound=!1)}getCropStyle(){let{crop:e}=this.props;if(e)return{top:`${e.y}${e.unit}`,left:`${e.x}${e.unit}`,width:`${e.width}${e.unit}`,height:`${e.height}${e.unit}`}}dragCrop(){let{evData:e}=this,o=this.getBox(),n=this.makePixelCrop(o),r=e.clientX-e.startClientX,s=e.clientY-e.startClientY;return n.x=Aa(e.startCropX+r,0,o.width-n.width),n.y=Aa(e.startCropY+s,0,o.height-n.height),n}getPointRegion(e,o,n,r){let{evData:s}=this,i=s.clientX-e.x,l=s.clientY-e.y,a;r&&o?a=o==="nw"||o==="n"||o==="ne":a=l<s.startCropY;let c;return n&&o?c=o==="nw"||o==="w"||o==="sw":c=i<s.startCropX,c?a?"nw":"sw":a?"ne":"se"}resolveMinDimensions(e,o,n=0,r=0){let s=Math.min(n,e.width),i=Math.min(r,e.height);return!o||!s&&!i?[s,i]:o>1?s?[s,s/o]:[i*o,i]:i?[i*o,i]:[s,s/o]}resizeCrop(){let{evData:e}=this,{aspect:o=0,maxWidth:n,maxHeight:r}=this.props,s=this.getBox(),[i,l]=this.resolveMinDimensions(s,o,this.props.minWidth,this.props.minHeight),a=this.makePixelCrop(s),c=this.getPointRegion(s,e.ord,i,l),u=e.ord||c,d=e.clientX-e.startClientX,f=e.clientY-e.startClientY;(i&&u==="nw"||u==="w"||u==="sw")&&(d=Math.min(d,-i)),(l&&u==="nw"||u==="n"||u==="ne")&&(f=Math.min(f,-l));let m={unit:"px",x:0,y:0,width:0,height:0};c==="ne"?(m.x=e.startCropX,m.width=d,o?(m.height=m.width/o,m.y=e.startCropY-m.height):(m.height=Math.abs(f),m.y=e.startCropY-m.height)):c==="se"?(m.x=e.startCropX,m.y=e.startCropY,m.width=d,o?m.height=m.width/o:m.height=f):c==="sw"?(m.x=e.startCropX+d,m.y=e.startCropY,m.width=Math.abs(d),o?m.height=m.width/o:m.height=f):c==="nw"&&(m.x=e.startCropX+d,m.width=Math.abs(d),o?(m.height=m.width/o,m.y=e.startCropY-m.height):(m.height=Math.abs(f),m.y=e.startCropY+f));let h=fI(m,o,c,s.width,s.height,i,l,n,r);return o||Hr.xyOrds.indexOf(u)>-1?a=h:Hr.xOrds.indexOf(u)>-1?(a.x=h.x,a.width=h.width):Hr.yOrds.indexOf(u)>-1&&(a.y=h.y,a.height=h.height),a.x=Aa(a.x,0,s.width-a.width),a.y=Aa(a.y,0,s.height-a.height),a}createCropSelection(){let{ariaLabels:e=Hr.defaultProps.ariaLabels,disabled:o,locked:n,renderSelectionAddon:r,ruleOfThirds:s,crop:i}=this.props,l=this.getCropStyle();if(i)return Vt.createElement("div",{style:l,className:"ReactCrop__crop-selection",onPointerDown:this.onCropPointerDown,"aria-label":e.cropArea,tabIndex:0,onKeyDown:this.onComponentKeyDown,role:"group"},!o&&!n&&Vt.createElement("div",{className:"ReactCrop__drag-elements",onFocus:this.onDragFocus},Vt.createElement("div",{className:"ReactCrop__drag-bar ord-n","data-ord":"n"}),Vt.createElement("div",{className:"ReactCrop__drag-bar ord-e","data-ord":"e"}),Vt.createElement("div",{className:"ReactCrop__drag-bar ord-s","data-ord":"s"}),Vt.createElement("div",{className:"ReactCrop__drag-bar ord-w","data-ord":"w"}),Vt.createElement("div",{className:"ReactCrop__drag-handle ord-nw","data-ord":"nw",tabIndex:0,"aria-label":e.nwDragHandle,onKeyDown:a=>this.onHandlerKeyDown(a,"nw"),role:"button"}),Vt.createElement("div",{className:"ReactCrop__drag-handle ord-n","data-ord":"n",tabIndex:0,"aria-label":e.nDragHandle,onKeyDown:a=>this.onHandlerKeyDown(a,"n"),role:"button"}),Vt.createElement("div",{className:"ReactCrop__drag-handle ord-ne","data-ord":"ne",tabIndex:0,"aria-label":e.neDragHandle,onKeyDown:a=>this.onHandlerKeyDown(a,"ne"),role:"button"}),Vt.createElement("div",{className:"ReactCrop__drag-handle ord-e","data-ord":"e",tabIndex:0,"aria-label":e.eDragHandle,onKeyDown:a=>this.onHandlerKeyDown(a,"e"),role:"button"}),Vt.createElement("div",{className:"ReactCrop__drag-handle ord-se","data-ord":"se",tabIndex:0,"aria-label":e.seDragHandle,onKeyDown:a=>this.onHandlerKeyDown(a,"se"),role:"button"}),Vt.createElement("div",{className:"ReactCrop__drag-handle ord-s","data-ord":"s",tabIndex:0,"aria-label":e.sDragHandle,onKeyDown:a=>this.onHandlerKeyDown(a,"s"),role:"button"}),Vt.createElement("div",{className:"ReactCrop__drag-handle ord-sw","data-ord":"sw",tabIndex:0,"aria-label":e.swDragHandle,onKeyDown:a=>this.onHandlerKeyDown(a,"sw"),role:"button"}),Vt.createElement("div",{className:"ReactCrop__drag-handle ord-w","data-ord":"w",tabIndex:0,"aria-label":e.wDragHandle,onKeyDown:a=>this.onHandlerKeyDown(a,"w"),role:"button"})),r&&Vt.createElement("div",{className:"ReactCrop__selection-addon",onMouseDown:a=>a.stopPropagation()},r(this.state)),s&&Vt.createElement(Vt.Fragment,null,Vt.createElement("div",{className:"ReactCrop__rule-of-thirds-hz"}),Vt.createElement("div",{className:"ReactCrop__rule-of-thirds-vt"})))}makePixelCrop(e){let o={...Ym,...this.props.crop||{}};return bs(o,e.width,e.height)}render(){let{aspect:e,children:o,circularCrop:n,className:r,crop:s,disabled:i,locked:l,style:a,ruleOfThirds:c}=this.props,{cropIsActive:u,newCropIsBeingDrawn:d}=this.state,f=s?this.createCropSelection():null,m=aO("ReactCrop",r,u&&"ReactCrop--active",i&&"ReactCrop--disabled",l&&"ReactCrop--locked",d&&"ReactCrop--new-crop",s&&e&&"ReactCrop--fixed-aspect",s&&n&&"ReactCrop--circular-crop",s&&c&&"ReactCrop--rule-of-thirds",!this.dragStarted&&s&&!s.width&&!s.height&&"ReactCrop--invisible-crop",n&&"ReactCrop--no-animate");return Vt.createElement("div",{ref:this.componentRef,className:m,style:a},Vt.createElement("div",{ref:this.mediaRef,className:"ReactCrop__child-wrapper",onPointerDown:this.onComponentPointerDown},o),f)}};vs.xOrds=["e","w"];vs.yOrds=["n","s"];vs.xyOrds=["nw","ne","se","sw"];vs.nudgeStep=1;vs.nudgeStepMedium=10;vs.nudgeStepLarge=100;vs.defaultProps={ariaLabels:{cropArea:"Use the arrow keys to move the crop selection area",nwDragHandle:"Use the arrow keys to move the north west drag handle to change the crop selection area",nDragHandle:"Use the up and down arrow keys to move the north drag handle to change the crop selection area",neDragHandle:"Use the arrow keys to move the north east drag handle to change the crop selection area",eDragHandle:"Use the up and down arrow keys to move the east drag handle to change the crop selection area",seDragHandle:"Use the arrow keys to move the south east drag handle to change the crop selection area",sDragHandle:"Use the up and down arrow keys to move the south drag handle to change the crop selection area",swDragHandle:"Use the arrow keys to move the south west drag handle to change the crop selection area",wDragHandle:"Use the up and down arrow keys to move the west drag handle to change the crop selection area"}};var pI=vs;import"react-image-crop/dist/ReactCrop.css";var xt="edit-upload",Zm=t=>{let{name:e,onChange:o,ref:n,value:r}=t;return No("div",{className:`${xt}__input`,children:[e,Dt("input",{name:e,onChange:s=>o(s.target.value),ref:n,type:"number",value:r})]})},cO={height:100,unit:"%",width:100,x:0,y:0},bb=({fileName:t,fileSrc:e,imageCacheTag:o,initialCrop:n,initialFocalPoint:r,onSave:s,showCrop:i,showFocalPoint:l})=>{let{closeModal:a}=ue(),{t:c}=$(),[u,d]=xs(()=>({...cO,...n||{}})),f={x:50,y:50},[m,h]=xs(()=>({...f,...r})),[p,g]=xs(!1),[b,v]=xs(0),[x,y]=xs(0),C=Pa(void 0),S=Pa(void 0),w=Pa(void 0),F=Pa(null),_=Pa(null),[A,R]=xs(!1),I=P=>{v(P.currentTarget.naturalHeight),y(P.currentTarget.naturalWidth),R(!0)},D=({dimension:P,value:N})=>{let B=parseInt(N);if(P==="width"&&B>=x||P==="height"&&B>=b)return null;let M=100*(B/(P==="width"?x:b));if(M===100||M===0)return null;d({...u,[P]:M})},E=({coordinate:P,value:N})=>{let B=parseInt(N);B>=0&&B<=100&&h(M=>({...M,[P]:B}))},T=()=>{typeof s=="function"&&s({crop:u||void 0,focalPoint:m,heightInPixels:Number(F?.current?.value??b),widthInPixels:Number(_?.current?.value??x)}),a(jc)},L=Jm.useCallback(({x:P,y:N})=>{h({x:P,y:N}),g(!1)},[]),k=()=>{let P=C.current.getBoundingClientRect(),N=i?w.current.getBoundingClientRect():S.current.getBoundingClientRect(),B=(N.left-P.left+N.width/2)/P.width*100,M=(N.top-P.top+N.height/2)/P.height*100;h({x:B,y:M})},j=o?`${e}?${encodeURIComponent(o)}`:e;return No("div",{className:xt,children:[No("div",{className:`${xt}__header`,children:[No("h2",{title:`${c("general:editing")} ${t}`,children:[c("general:editing")," ",t]}),No("div",{className:`${xt}__actions`,children:[Dt(se,{"aria-label":c("general:cancel"),buttonStyle:"secondary",className:`${xt}__cancel`,onClick:()=>a(jc),children:c("general:cancel")}),Dt(se,{"aria-label":c("general:applyChanges"),buttonStyle:"primary",className:`${xt}__save`,disabled:!A,onClick:T,children:c("general:applyChanges")})]})]}),No("div",{className:`${xt}__toolWrap`,children:[Dt("div",{className:`${xt}__crop`,children:No("div",{className:`${xt}__focal-wrapper`,ref:C,style:{aspectRatio:`${x/b}`},children:[i?Dt(pI,{className:`${xt}__reactCrop`,crop:u,onChange:(P,N)=>d(N),onComplete:()=>g(!0),renderSelectionAddon:()=>Dt("div",{className:`${xt}__crop-window`,ref:w}),children:Dt("img",{alt:c("upload:setCropArea"),onLoad:I,ref:S,src:j})}):Dt("img",{alt:c("upload:setFocalPoint"),onLoad:I,ref:S,src:j}),l&&Dt(uO,{boundsRef:i?w:S,checkBounds:i?p:!1,className:`${xt}__focalPoint`,containerRef:C,initialPosition:m,onDragEnd:L,setCheckBounds:i?g:!1,children:Dt(jo,{})})]})}),(i||l)&&No("div",{className:`${xt}__sidebar`,children:[i&&No("div",{className:`${xt}__groupWrap`,children:[Dt("div",{children:No("div",{className:`${xt}__titleWrap`,children:[Dt("h3",{children:c("upload:crop")}),Dt(se,{buttonStyle:"none",className:`${xt}__reset`,onClick:()=>d({height:100,unit:"%",width:100,x:0,y:0}),children:c("general:reset")})]})}),Dt("span",{className:`${xt}__description`,children:c("upload:cropToolDescription")}),No("div",{className:`${xt}__inputsWrap`,children:[Dt(Zm,{name:`${c("upload:width")} (px)`,onChange:P=>D({dimension:"width",value:P}),ref:_,value:(u.width/100*x).toFixed(0)}),Dt(Zm,{name:`${c("upload:height")} (px)`,onChange:P=>D({dimension:"height",value:P}),ref:F,value:(u.height/100*b).toFixed(0)})]})]}),l&&No("div",{className:`${xt}__groupWrap`,children:[Dt("div",{children:No("div",{className:`${xt}__titleWrap`,children:[Dt("h3",{children:c("upload:focalPoint")}),Dt(se,{buttonStyle:"none",className:`${xt}__reset`,onClick:k,children:c("general:reset")})]})}),Dt("span",{className:`${xt}__description`,children:c("upload:focalPointDescription")}),No("div",{className:`${xt}__inputsWrap`,children:[Dt(Zm,{name:"X %",onChange:P=>E({coordinate:"x",value:P}),value:m.x.toFixed(0)}),Dt(Zm,{name:"Y %",onChange:P=>E({coordinate:"y",value:P}),value:m.y.toFixed(0)})]})]})]})]})]})},uO=({boundsRef:t,checkBounds:e,children:o,className:n,containerRef:r,initialPosition:s={x:50,y:50},onDragEnd:i,setCheckBounds:l})=>{let[a,c]=xs({x:s.x,y:s.y}),[u,d]=xs(!1),f=Pa(void 0),m=Jm.useCallback((b,v,x)=>{let y=r.current.getBoundingClientRect(),C=t.current.getBoundingClientRect(),S=b??C.left,w=v??C.top,F=S<C.left||S>C.right,_=w<C.top||w>C.bottom,A=(S-y.left)/y.width*100,R=(w-y.top)/y.height*100,I=(C.left-y.left+C.width/2)/y.width*100,D=(C.top-y.top+C.height/2)/y.height*100;return(F||_)&&(d(!1),S<C.left?A=(C.left-y.left)/y.width*100:S>C.right&&(A=(y.width-(y.right-C.right))/y.width*100),w<C.top?R=(C.top-y.top)/y.height*100:w>C.bottom&&(R=(y.height-(y.bottom-C.bottom))/y.height*100),x&&(A=F?I:A,R=_?D:R)),{x:A,y:R}},[t,r]),h=b=>{b.preventDefault(),d(!0)},p=b=>{if(!u)return null;let{x:v,y:x}=m(b.clientX,b.clientY);c({x:v,y:x})},g=()=>{d(!1),i(a)};return Jm.useEffect(()=>{if(!(u||!f.current)&&e){let{height:b,left:v,top:x,width:y}=f.current.getBoundingClientRect(),{x:C,y:S}=m(v+y/2,x+b/2,!0);i({x:C,y:S}),c({x:C,y:S}),l(!1);return}},[m,u,e,l,a.x,a.y,i]),Jm.useEffect(()=>{c({x:s.x,y:s.y})},[s.x,s.y]),No("div",{className:[`${xt}__draggable-container`,u&&`${xt}__draggable-container--dragging`].filter(Boolean).join(" "),onMouseMove:p,children:[Dt("button",{className:[`${xt}__draggable`,n].filter(Boolean).join(" "),onMouseDown:h,onMouseUp:g,ref:f,style:{left:`${a.x}%`,top:`${a.y}%`},type:"button",children:o}),Dt("div",{})]})};import{jsx as SI}from"react/jsx-runtime";import"react";import{c as dO}from"react/compiler-runtime";import{jsx as Nn,jsxs as vb}from"react/jsx-runtime";import"react";var ys="file-details-draggable",hI=t=>{let e=dO(20),{collectionSlug:o,doc:n,hideRemoveFile:r,imageCacheTag:s,isSortable:i,removeItem:l,rowIndex:a,uploadConfig:c}=t,{id:u,filename:d,thumbnailURL:f,url:m}=n,h;e[0]!==o||e[1]!==u?(h={id:u,collectionSlug:o},e[0]=o,e[1]=u,e[2]=h):h=e[2];let[p,g]=qt(h),b;e[3]!==p||e[4]!==g||e[5]!==o||e[6]!==n||e[7]!==d||e[8]!==r||e[9]!==s||e[10]!==i||e[11]!==l||e[12]!==a||e[13]!==f||e[14]!==c||e[15]!==m?(b=x=>vb("div",{className:[ys,x&&i&&`${ys}--has-drag-handle`].filter(Boolean).join(" "),ref:x.setNodeRef,style:{transform:x.transform,transition:x.transition,zIndex:x.isDragging?1:void 0},children:[vb("div",{className:`${ys}--drag-wrapper`,children:[i&&x&&Nn("div",{className:`${ys}__drag`,...x.attributes,...x.listeners,children:Nn(wn,{})}),Nn(Mr,{className:`${ys}__thumbnail`,collectionSlug:o,doc:n,fileSrc:f||m,imageCacheTag:s,uploadConfig:c})]}),Nn("div",{className:`${ys}__main-detail`,children:d}),vb("div",{className:`${ys}__actions`,children:[Nn(p,{}),Nn(g,{children:Nn(_r,{})}),!r&&l&&Nn(se,{buttonStyle:"icon-label",className:`${ys}__remove`,icon:"x",iconStyle:"none",onClick:()=>l(a),round:!0})]})]}),e[3]=p,e[4]=g,e[5]=o,e[6]=n,e[7]=d,e[8]=r,e[9]=s,e[10]=i,e[11]=l,e[12]=a,e[13]=f,e[14]=c,e[15]=m,e[16]=b):b=e[16];let v;return e[17]!==u||e[18]!==b?(v=Nn(Jr,{id:u,children:b},u),e[17]=u,e[18]=b,e[19]=v):v=e[19],v};import{jsx as Vc,jsxs as CI}from"react/jsx-runtime";import"react";import{jsx as xI,jsxs as Mc}from"react/jsx-runtime";import{formatFilesize as pO}from"payload/shared";import yI from"react";import{jsx as gI,jsxs as bI}from"react/jsx-runtime";import{useRef as mO,useState as vI}from"react";var fO="copy-to-clipboard",Oc=({defaultMessage:t,successMessage:e,value:o})=>{let n=mO(null),[r,s]=vI(!1),[i,l]=vI(!1),{t:a}=$();return o?bI("button",{className:fO,onClick:()=>{n&&n.current&&(n.current.select(),n.current.setSelectionRange(0,o.length+1),document.execCommand("copy"),s(!0))},onMouseEnter:()=>{l(!0),s(!1)},onMouseLeave:()=>{l(!1),s(!1)},type:"button",children:[gI(Al,{}),bI(go,{delay:r?0:void 0,show:i||r,children:[r&&(e??a("general:copied")),!r&&(t??a("general:copy"))]}),gI("textarea",{readOnly:!0,ref:n,tabIndex:-1,value:o})]}):null};var xb="file-meta",Bc=t=>{let{filename:e,filesize:o,height:n,mimeType:r,url:s,width:i}=t;return Mc("div",{className:xb,children:[Mc("div",{className:`${xb}__url`,children:[xI("a",{href:s,rel:"noopener noreferrer",target:"_blank",children:e}),xI(Oc,{defaultMessage:"Copy URL",value:s})]}),Mc("div",{className:`${xb}__size-type`,children:[pO(o),typeof i=="number"&&typeof n=="number"&&Mc(yI.Fragment,{children:["\xA0-\xA0",i,"x",n]}),r&&Mc(yI.Fragment,{children:["\xA0-\xA0",r]})]})]})};var qm="file-details",wI=t=>{let{customUploadActions:e,doc:o,enableAdjustments:n,handleRemove:r,hasImageSizes:s,hideRemoveFile:i,imageCacheTag:l,uploadConfig:a}=t,{filename:c,filesize:u,height:d,mimeType:f,thumbnailURL:m,url:h,width:p}=o,g=a.displayPreview??!0;return Vc("div",{className:qm,children:CI("header",{children:[g&&Vc(Mr,{className:`${qm}__thumbnail`,doc:o,fileSrc:m||h,imageCacheTag:l,uploadConfig:a}),CI("div",{className:`${qm}__main-detail`,children:[Vc(Bc,{filename:c,filesize:u,height:d,mimeType:f,url:h,width:p}),(n||e)&&Vc(yb,{customActions:e,enableAdjustments:!!n,enablePreviewSizes:s&&o.filename,mimeType:f})]}),!i&&r&&Vc(se,{buttonStyle:"icon-label",className:`${qm}__remove`,icon:"x",iconStyle:"with-border",onClick:r,round:!0})]})})};var Cb=t=>{let{hasMany:e}=t;return e?SI(hI,{...t}):SI(wI,{...t})};import{jsx as rn,jsxs as Na}from"react/jsx-runtime";import{useEffect as hO,useMemo as gO,useState as II}from"react";var xr="preview-sizes",RI=(t,e)=>{if(!e||e.length===0)return t;let o={};return e.forEach(({name:n})=>{t[n]&&(o[n]=t[n])}),o},_I=({name:t,active:e,meta:o,onClick:n,previewSrc:r})=>Na("div",{className:[`${xr}__sizeOption`,e&&`${xr}--selected`].filter(Boolean).join(" "),onClick:typeof n=="function"?n:void 0,onKeyDown:s=>{typeof n=="function"&&s.key==="Enter"&&n()},role:"button",tabIndex:0,children:[rn("div",{className:`${xr}__image`,children:rn("img",{alt:o.filename,src:r})}),Na("div",{className:`${xr}__sizeMeta`,children:[rn("div",{className:`${xr}__sizeName`,children:t}),rn(Bc,{...o})]})]}),wb=({doc:t,imageCacheTag:e,uploadConfig:o})=>{let{imageSizes:n}=o,{sizes:r}=t,[s,i]=II(()=>RI(r,n)),[l,a]=II(null),c=m=>{if(!m.filename)return null;if(m.url)return`${m.url}${e?`?${encodeURIComponent(e)}`:""}`};hO(()=>{i(RI(r,n))},[r,n,e]);let u=c(l?t.sizes[l]:t),d=gO(()=>({filename:t.filename,filesize:t.filesize,height:t.height,mimeType:t.mimeType,url:t.url,width:t.width}),[t]),f="Original";return Na("div",{className:xr,children:[Na("div",{className:`${xr}__imageWrap`,children:[Na("div",{className:`${xr}__meta`,children:[rn("div",{className:`${xr}__sizeName`,children:l||f}),rn(Bc,{...l?s[l]:d})]}),rn("img",{alt:t.filename,className:`${xr}__preview`,src:u})]}),rn("div",{className:`${xr}__listWrap`,children:Na("div",{className:`${xr}__list`,children:[rn(_I,{active:!l,meta:d,name:f,onClick:()=>a(null),previewSrc:c(t)}),Object.entries(s).map(([m,h])=>{let p=l===m,g=c(h);return g?rn(_I,{active:p,meta:h,name:m,onClick:()=>a(m),previewSrc:g},m):null})]})})]})};var Qt="file-field",jc="edit-upload",TI="preview-sizes",vO=t=>!t&&t!==void 0?"A file is required.":!0,yb=t=>{let e=FI(9),{customActions:o,enableAdjustments:n,enablePreviewSizes:r,mimeType:s}=t,{t:i}=$(),l,a;if(e[0]!==o||e[1]!==n||e[2]!==r||e[3]!==s||e[4]!==i){a=Symbol.for("react.early_return_sentinel");e:{let c=AI(s)&&s!=="image/svg+xml"&&s!=="image/jxl";if(!c&&(!o||o.length===0)){a=null;break e}let u;e[7]!==o?(u=o&&o.map(xO),e[7]=o,e[8]=u):u=e[8],l=yr("div",{className:`${Qt}__upload-actions`,children:[c&&yr(Wc.Fragment,{children:[r&&St(dr,{className:`${Qt}__previewSizes`,slug:TI,children:i("upload:previewSizes")}),n&&St(dr,{className:`${Qt}__edit`,slug:jc,children:i("upload:editImage")})]}),u]})}e[0]=o,e[1]=n,e[2]=r,e[3]=s,e[4]=i,e[5]=l,e[6]=a}else l=e[5],a=e[6];return a!==Symbol.for("react.early_return_sentinel")?a:l},Ib=t=>{let e=FI(5),{resetUploadEdits:o,updateUploadEdits:n,uploadEdits:r}=zs(),s;return e[0]!==t||e[1]!==o||e[2]!==n||e[3]!==r?(s=St(Rb,{...t,resetUploadEdits:o,updateUploadEdits:n,uploadEdits:r}),e[0]=t,e[1]=o,e[2]=n,e[3]=r,e[4]=s):s=e[4],s},Rb=t=>{let{collectionSlug:e,customActions:o,initialState:n,onChange:r,resetUploadEdits:s,updateUploadEdits:i,uploadConfig:l,uploadEdits:a}=t,{config:{routes:{api:c},serverURL:u}}=W(),{t:d}=$(),{setModified:f}=Me(),{id:m,docPermissions:h,savedDocumentData:p,setUploadStatus:g}=Pe(),b=cr(),{errorMessage:v,setValue:x,showError:y,value:C}=Ne({path:"file",validate:vO}),[S,w]=Gc(null),[F,_]=Gc(!1),[A,R]=Gc(C?.name||""),[I,D]=Gc(!1),[E,T]=Gc(""),L=DI(null),k=DI(null),j=typeof l?.pasteURL=="object"&&l.pasteURL.allowList?.length>0,P=Qm(J=>{J instanceof File&&w(URL.createObjectURL(J)),x(J),D(!1),typeof r=="function"&&r(J)},[r,x]),N=(J,ge)=>new File([J],ge,{type:J.type,lastModified:J.lastModified}),B=Wc.useCallback(J=>{let ge=J.target.value;C&&(P(N(C,ge)),R(ge))},[P,C]),M=Qm(J=>{let ge=J?.[0];P(ge)},[P]),O=Qm(()=>{_(!0),P(null),w(""),T(""),s(),D(!1)},[P,s]),V=Qm(J=>{f(!0),i(J)},[f,i]),G=async()=>{if(!(!E||l?.pasteURL===!1)){g("uploading");try{let J=await fetch(E);if(!J.ok)throw new Error(`Fetch failed with status: ${J.status}`);let ge=await J.blob(),Ce=decodeURIComponent(E.split("/").pop()||""),he=new File([ge],Ce,{type:ge.type});P(he),g("idle");return}catch{if(!j){me.error("Failed to fetch the file."),g("failed");return}}try{let J=`/${e}/paste-url${m?`/${m}?`:"?"}src=${encodeURIComponent(E)}`,ge=await fetch(`${u}${c}${J}`);if(!ge.ok)throw new Error(`Fetch failed with status: ${ge.status}`);let Ce=await ge.blob(),he=decodeURIComponent(E.split("/").pop()||""),Le=new File([Ce],he,{type:Ce.type});P(Le),g("idle")}catch{me.error("The provided URL is not allowed."),g("failed")}}};Sb(()=>{n?.file?.value instanceof File&&(w(URL.createObjectURL(n.file.value)),_(!1))},[n]),Sb(()=>{I&&L.current},[I]),Sb(()=>{b&&_(!1)},[b]);let z=h?.update&&"delete"in h&&h?.delete,X=l?.imageSizes?.length>0,te=!!l?.resizeOptions,Y=l?.focalPoint===!0,{crop:H=!0,focalPoint:le=!0}=l,q=le&&(X||te||Y),fe=l.mimeTypes?.join(", "),ae=l?.cacheTags&&p?.updatedAt;return l.hideFileInputOnCreate&&!p?.filename?null:yr("div",{className:[Ie,Qt].filter(Boolean).join(" "),children:[St(We,{message:v,showError:y}),p&&p.filename&&!F&&St(Cb,{collectionSlug:e,customUploadActions:o,doc:p,enableAdjustments:H||q,handleRemove:z?O:void 0,hasImageSizes:X,hideRemoveFile:l.hideRemoveFile,imageCacheTag:ae,uploadConfig:l}),(!l.hideFileInputOnCreate&&!p?.filename||F)&&yr("div",{className:`${Qt}__upload`,children:[!C&&!I&&St(pi,{onChange:M,children:yr("div",{className:`${Qt}__dropzoneContent`,children:[yr("div",{className:`${Qt}__dropzoneButtons`,children:[St(se,{buttonStyle:"pill",onClick:()=>{k.current&&k.current.click()},size:"small",children:d("upload:selectFile")}),St("input",{accept:fe,"aria-hidden":"true",className:`${Qt}__hidden-input`,hidden:!0,onChange:J=>{J.target.files&&J.target.files.length>0&&M(J.target.files)},ref:k,type:"file"}),l?.pasteURL!==!1&&yr(bO,{children:[St("span",{className:`${Qt}__orText`,children:d("general:or")}),St(se,{buttonStyle:"pill",onClick:()=>{D(!0)},size:"small",children:d("upload:pasteURL")})]})]}),yr("p",{className:`${Qt}__dragAndDropText`,children:[d("general:or")," ",d("upload:dragAndDrop")]})]})}),I&&yr(Wc.Fragment,{children:[yr("div",{className:`${Qt}__remote-file-wrap`,children:[St("input",{className:`${Qt}__remote-file`,onChange:J=>{T(J.target.value)},ref:L,type:"text",value:E}),St("div",{className:`${Qt}__add-file-wrap`,children:St("button",{className:`${Qt}__add-file`,onClick:()=>{G()},type:"button",children:d("upload:addFile")})})]}),St(se,{buttonStyle:"icon-label",className:`${Qt}__remove`,icon:"x",iconStyle:"with-border",onClick:()=>{D(!1)},round:!0,tooltip:d("general:cancel")})]}),C&&S&&yr(Wc.Fragment,{children:[St("div",{className:`${Qt}__thumbnail-wrap`,children:St(Mr,{collectionSlug:e,fileSrc:AI(C.type)?S:null})}),yr("div",{className:`${Qt}__file-adjustments`,children:[St("input",{className:`${Qt}__filename`,onChange:B,type:"text",value:A||C.name}),St(yb,{customActions:o,enableAdjustments:H||q,enablePreviewSizes:X&&p?.filename&&!F,mimeType:C.type})]}),St(se,{buttonStyle:"icon-label",className:`${Qt}__remove`,icon:"x",iconStyle:"with-border",onClick:O,round:!0,tooltip:d("general:cancel")})]})]}),(C||p?.filename)&&St($s,{children:St(Lt,{Header:null,slug:jc,children:St(bb,{fileName:C?.name||p?.filename,fileSrc:p?.url||S,imageCacheTag:ae,initialCrop:a?.crop??void 0,initialFocalPoint:{x:a?.focalPoint?.x||p?.focalX||50,y:a?.focalPoint?.y||p?.focalY||50},onSave:V,showCrop:H,showFocalPoint:q})})}),p&&X&&St(Lt,{className:`${Qt}__previewDrawer`,hoverTitle:!0,slug:TI,title:d("upload:sizesFor",{label:p.filename}),children:St(wb,{doc:p,imageCacheTag:ae,uploadConfig:l})})]})};function xO(t,e){return St(Wc.Fragment,{children:t},e)}var IO="collection-edit";function NI({resetUploadEdits:t,submitted:e,updateUploadEdits:o,uploadEdits:n}){let{action:r,collectionSlug:s,docPermissions:i,getDocPreferences:l,hasSavePermission:a,initialState:c,isEditing:u,isInitializing:d,Upload:f}=Pe(),{onSave:m}=ac(),{getFormState:h}=Ft(),{config:{routes:{admin:p}},getEntityConfig:g}=W(),b=Hc.useRef(null),v=g({collectionSlug:s}),x=CO(),y=ct(),C=wO(),{reportUpdate:S}=hi(),{startRouteTransition:w}=st(),F=C.get("locale"),_=v.slug,[A]=Hc.useState(_),R=EI(D=>{if(S({entitySlug:_,updatedAt:D?.result?.updatedAt||new Date().toISOString()}),typeof m=="function"&&m({...D,operation:"create"}),!u&&y<2){let E=SO({adminRoute:p,path:`/collections/${_}/${D?.doc?.id}${F?`?locale=${F}`:""}`});w(()=>x.push(E))}else t()},[p,_,y,u,F,m,S,t,x,w]),I=EI(async({formState:D,submitted:E})=>{let T=rr(b),L=await l(),{state:k}=await h({collectionSlug:_,docPermissions:i,docPreferences:L,formState:D,operation:"create",schemaPath:A,signal:T.signal,skipValidation:!E});return b.current=null,k},[_,A,l,h,i]);return PI(()=>{let D=b.current;return()=>{or(D)}},[]),Cs(Il,{operation:"create",children:Cs(_b,{children:yO(Tn,{action:r,className:`${IO}__form`,disabled:d||!a,initialState:d?void 0:c,isInitializing:d,method:"POST",onChange:[I],onSuccess:R,submitted:e,children:[Cs(kc,{BeforeFields:Cs(Hc.Fragment,{children:f||Cs(Rb,{collectionSlug:v.slug,initialState:c,resetUploadEdits:t,updateUploadEdits:o,uploadConfig:v.upload,uploadEdits:n})}),docPermissions:i,fields:v.fields,schemaPathSegments:[v.slug]}),Cs(_O,{}),Cs(RO,{})]})})})}function RO(){let{getFields:t}=Me(),{getFormDataRef:e}=Io();return PI(()=>{e.current=t},[t,e]),null}function _O(){let{docConfig:t}=Pe(),{activeIndex:e,setFormTotalErrorCount:o}=Io(),n=Hc.useRef(0),r=Hc.useCallback(s=>{s!==n.current&&(o({errorCount:s,index:e}),n.current=s)},[e,o]);return t?Cs(Js,{fields:t.fields,path:[],setErrorCount:r}):null}import{c as DO}from"react/compiler-runtime";import{jsx as kt,jsxs as zr}from"react/jsx-runtime";import{isImage as FO}from"payload/shared";import AO from"react";var Km="bulk-upload-drawer--add-more-files",yt="file-selections";function LI(){let t=DO(36),{activeIndex:e,addFiles:o,forms:n,isInitializing:r,removeFile:s,setActiveIndex:i,thumbnailUrls:l,totalErrorCount:a}=Io(),{initialFiles:c,maxFiles:u}=Ho(),{i18n:d,t:f}=$(),{closeModal:m,openModal:h}=ue(),[p,g]=AO.useState(!1),{breakpoints:b}=Co(),v;t[0]!==s?(v=I=>{s(I)},t[0]=s,t[1]=v):v=t[1];let x=v,y;t[2]!==o||t[3]!==m?(y=I=>{o(I),m(Km)},t[2]=o,t[3]=m,t[4]=y):y=t[4];let C=y,S=PO,w=r?c.length:n.length,F=p&&`${yt}__showingFiles`,_;t[5]!==F?(_=[yt,F].filter(Boolean),t[5]=F,t[6]=_):_=t[6];let A=_.join(" "),R;if(t[7]!==e||t[8]!==b.m||t[9]!==m||t[10]!==n||t[11]!==C||t[12]!==x||t[13]!==d||t[14]!==c||t[15]!==r||t[16]!==u||t[17]!==h||t[18]!==i||t[19]!==p||t[20]!==f||t[21]!==A||t[22]!==l||t[23]!==a||t[24]!==w){let I;t[26]===Symbol.for("react.memo_cache_sentinel")?(I=()=>g(EO),t[26]=I):I=t[26];let D;t[27]!==m?(D=()=>m(Km),t[27]=m,t[28]=D):D=t[28];let E;t[29]!==e||t[30]!==x||t[31]!==d||t[32]!==i||t[33]!==f||t[34]!==l?(E=(T,L)=>{let{errorCount:k,formState:j}=T,P=j?.file?.value||{};return zr("div",{className:[`${yt}__fileRowContainer`,L===e&&`${yt}__fileRowContainer--active`,k&&k>0&&`${yt}__fileRowContainer--error`].filter(Boolean).join(" "),children:[zr("button",{className:`${yt}__fileRow`,onClick:()=>i(L),type:"button",children:[kt(Mr,{className:`${yt}__thumbnail`,fileSrc:FO(P.type)?l[L]:null}),kt("div",{className:`${yt}__fileDetails`,children:kt("p",{className:`${yt}__fileName`,title:P.name,children:P.name||f("upload:noFile")})}),P instanceof File?kt("p",{className:`${yt}__fileSize`,children:S(P)}):null,kt("div",{className:`${yt}__remove ${yt}__remove--underlay`,children:kt(pt,{})}),k?kt(ao,{className:`${yt}__errorCount`,count:k,i18n:d}):null]}),kt("button",{"aria-label":f("general:remove"),className:`${yt}__remove ${yt}__remove--overlay`,onClick:()=>x(L),type:"button",children:kt(pt,{})})]},L)},t[29]=e,t[30]=x,t[31]=d,t[32]=i,t[33]=f,t[34]=l,t[35]=E):E=t[35],R=zr("div",{className:A,children:[b.m&&p?kt("div",{className:`${yt}__mobileBlur`}):null,zr("div",{className:`${yt}__header`,children:[zr("div",{className:`${yt}__headerTopRow`,children:[zr("div",{className:`${yt}__header__text`,children:[kt(ao,{count:a,i18n:d,withMessage:!0}),kt("p",{children:zr("strong",{title:`${w} ${f(w>1?"upload:filesToUpload":"upload:fileToUpload")}`,children:[w," ",f(w>1?"upload:filesToUpload":"upload:fileToUpload")]})})]}),zr("div",{className:`${yt}__header__actions`,children:[typeof u!="number"||w<u?kt(vt,{className:`${yt}__header__addFile`,onClick:()=>h(Km),children:f("upload:addFile")}):null,zr(se,{buttonStyle:"transparent",className:`${yt}__toggler`,onClick:I,children:[kt("span",{className:`${yt}__toggler__label`,children:zr("strong",{title:`${w} ${f(w>1?"upload:filesToUpload":"upload:fileToUpload")}`,children:[w," ",f(w>1?"upload:filesToUpload":"upload:fileToUpload")]})}),kt(Ze,{direction:p?"down":"up"})]}),kt(Lt,{gutter:!1,Header:null,slug:Km,children:kt(Gm,{onCancel:D,onDrop:C})})]})]}),kt("div",{className:`${yt}__header__mobileDocActions`,children:kt(hb,{})})]}),kt("div",{className:`${yt}__animateWrapper`,children:kt(Tr,{height:!b.m||p?"auto":0,children:zr("div",{className:`${yt}__filesContainer`,children:[r&&n.length===0&&c.length>0?Array.from(c).map(TO):null,n.map(E)]})})})]}),t[7]=e,t[8]=b.m,t[9]=m,t[10]=n,t[11]=C,t[12]=x,t[13]=d,t[14]=c,t[15]=r,t[16]=u,t[17]=h,t[18]=i,t[19]=p,t[20]=f,t[21]=A,t[22]=l,t[23]=a,t[24]=w,t[25]=R}else R=t[25];return R}function TO(t,e){return kt(It,{animationDelay:`calc(${e} * 60ms)`,height:"35px"},e)}function EO(t){return!t}function PO(t){let e=t.size,o=e===0?0:Math.floor(Math.log(e)/Math.log(1024)),n=o>1?1:0;return(e/Math.pow(1024,o)).toFixed(n)+" "+["B","kB","MB","GB","TB"][o]}var $I="bulk-upload--file-manager";function kI(){let t=NO(18),{activeIndex:e,collectionSlug:o,docPermissions:n,documentSlots:r,forms:s,hasPublishPermission:i,hasSavePermission:l,hasSubmitted:a,resetUploadEdits:c,updateUploadEdits:u}=Io(),d=s[e],{getEntityConfig:f}=W(),{i18n:m}=$(),{user:h}=De(),{openModal:p}=ue(),g;if(t[0]!==d||t[1]!==e||t[2]!==o||t[3]!==n||t[4]!==r||t[5]!==s.length||t[6]!==f||t[7]!==i||t[8]!==l||t[9]!==a||t[10]!==m||t[11]!==p||t[12]!==c||t[13]!==u||t[14]!==h){let b=f({collectionSlug:o}),v;t[16]!==p?(v=()=>p($c),t[16]=p,t[17]=v):v=t[17],g=Db("div",{className:$I,children:[zc(LI,{}),Db("div",{className:`${$I}__editView`,children:[zc(Ra,{onClose:v,title:LO(b.labels.singular,m)}),d?Db(Sl,{collectionSlug:o,currentEditor:h,docPermissions:n,hasPublishedDoc:!1,hasPublishPermission:i,hasSavePermission:l,id:null,initialData:$O(d.formState,!0),initialState:d.formState,isLocked:!1,lastUpdateTime:0,mostRecentVersionIsAutosaved:!1,unpublishedVersionCount:0,Upload:r.Upload,versionCount:0,children:[zc(aI,{collectionConfig:b}),zc(NI,{resetUploadEdits:c,submitted:a,updateUploadEdits:u,uploadEdits:d?.uploadEdits})]},`${e}-${s.length}`):null]}),zc(lI,{})]}),t[0]=d,t[1]=e,t[2]=o,t[3]=n,t[4]=r,t[5]=s.length,t[6]=f,t[7]=i,t[8]=l,t[9]=a,t[10]=m,t[11]=p,t[12]=c,t[13]=u,t[14]=h,t[15]=g}else g=t[15];return g}var OO="bulk-upload-drawer-slug";function MO(){let{addFiles:t,forms:e,isInitializing:o}=Io(),{closeModal:n}=ue(),{collectionSlug:r,drawerSlug:s}=Ho(),{getEntityConfig:i}=W(),{t:l}=$(),u=i({collectionSlug:r})?.upload?.mimeTypes,d=nn.useCallback(f=>{let m=new DataTransfer;for(let h of f)(u===void 0||u.length===0||jO(h.type,u))&&m.items.add(h);m.files.length===0?me.error(l("error:invalidFileType")):t(m.files)},[t,l,u]);return r?!e.length&&!o?gi(Gm,{acceptMimeTypes:u?.join(", "),onCancel:()=>n(s),onDrop:d}):gi(kI,{}):null}function OI(){let t=jI(2),{drawerSlug:e}=Ho(),o;return t[0]!==e?(o=gi(Lt,{gutter:!1,Header:null,slug:e,children:gi(JS,{children:gi(MO,{})})}),t[0]=e,t[1]=o):o=t[1],o}var MI=nn.createContext({collectionSlug:"",currentActivePath:void 0,drawerSlug:"",initialFiles:void 0,maxFiles:void 0,onCancel:()=>null,onSuccess:()=>null,setCollectionSlug:()=>null,setCurrentActivePath:()=>null,setInitialFiles:()=>null,setMaxFiles:()=>null,setOnCancel:()=>null,setOnSuccess:()=>null});function _b(t){let e=jI(16),{children:o}=t,[n,r]=nn.useState(),[s,i]=nn.useState(),[l,a]=nn.useState(),[c,u]=nn.useState(void 0),[d,f]=nn.useState(void 0),[m,h]=nn.useState(void 0),p=BI(),g;e[0]===Symbol.for("react.memo_cache_sentinel")?(g=w=>{r(w)},e[0]=g):g=e[0];let b=g,v;e[1]===Symbol.for("react.memo_cache_sentinel")?(v=(w,F)=>{i(_=>({..._,[w]:F}))},e[1]=v):v=e[1];let x=v,y;e[2]!==l?(y=()=>{typeof l=="function"&&l()},e[2]=l,e[3]=y):y=e[3];let C;e[4]!==m||e[5]!==s?(C=(w,F)=>{if(s&&Object.hasOwn(s,m)){let _=s[m];_(w,F)}},e[4]=m,e[5]=s,e[6]=C):C=e[6];let S;return e[7]!==o||e[8]!==n||e[9]!==m||e[10]!==p||e[11]!==c||e[12]!==d||e[13]!==y||e[14]!==C?(S=gi(MI,{value:{collectionSlug:n,currentActivePath:m,drawerSlug:p,initialFiles:c,maxFiles:d,onCancel:y,onSuccess:C,setCollectionSlug:b,setCurrentActivePath:h,setInitialFiles:u,setMaxFiles:f,setOnCancel:a,setOnSuccess:x},children:kO(nn.Fragment,{children:[o,gi(OI,{})]})}),e[7]=o,e[8]=n,e[9]=m,e[10]=p,e[11]=c,e[12]=d,e[13]=y,e[14]=C,e[15]=S):S=e[15],S}var Ho=()=>nn.use(MI);function BI(){let t=qn();return`${OO}-${t||1}`}import{c as WO}from"react/compiler-runtime";import{jsx as vi,jsxs as HO}from"react/jsx-runtime";import"react";import{c as BO}from"react/compiler-runtime";import{jsx as bi,jsxs as ef}from"react/jsx-runtime";import{formatFilesize as VO}from"payload/shared";import"react";var Ln="upload-relationship-details";function tf(t){let e=BO(34),{id:o,allowEdit:n,allowRemove:r,alt:s,byteSize:i,className:l,collectionSlug:a,displayPreview:c,filename:u,mimeType:d,onRemove:f,reloadDoc:m,src:h,thumbnailSrc:p,withMeta:g,x:b,y:v}=t,x=g===void 0?!0:g,{config:y}=W(),C;e[0]!==a||e[1]!==y?(C="collections"in y?y.collections.find(O=>O.slug===a):void 0,e[0]=a,e[1]=y,e[2]=C):C=e[2];let S=C,w=h?o:void 0,F;e[3]!==a||e[4]!==w?(F={id:w,collectionSlug:a},e[3]=a,e[4]=w,e[5]=F):F=e[5];let[_,,A]=qt(F),{openDrawer:R}=A,I;e[6]!==a||e[7]!==m?(I=async O=>{let{doc:V}=O;return m(V.id,a)},e[6]=a,e[7]=m,e[8]=I):I=e[8];let D=I,E;e[9]!==b||e[10]!==v?(E=function(V,G){let z=[];return G&&z.push(VO(G)),b&&v&&z.push(`${b}x${v}`),V&&z.push(V),z.join(" \u2014 ")},e[9]=b,e[10]=v,e[11]=E):E=e[11];let L=x?E(d,i):"",k=c??S.upload?.displayPreview??!0,j;e[12]!==l?(j=[Ln,l].filter(Boolean),e[12]=l,e[13]=j):j=e[13];let P=j.join(" "),N;e[14]!==s||e[15]!==u||e[16]!==k||e[17]!==p?(N=k&&bi(D3,{alt:s,className:`${Ln}__thumbnail`,filename:u,fileSrc:p,size:"small"}),e[14]=s,e[15]=u,e[16]=k,e[17]=p,e[18]=N):N=e[18];let B;e[19]!==u||e[20]!==h?(B=h?bi("a",{href:h,target:"_blank",children:u}):u,e[19]=u,e[20]=h,e[21]=B):B=e[21];let M;return e[22]!==_||e[23]!==n||e[24]!==r||e[25]!==L||e[26]!==f||e[27]!==D||e[28]!==R||e[29]!==B||e[30]!==P||e[31]!==N||e[32]!==x?(M=ef("div",{className:P,children:[ef("div",{className:`${Ln}__imageAndDetails`,children:[N,ef("div",{className:`${Ln}__details`,children:[bi("p",{className:`${Ln}__filename`,children:B}),x?bi("p",{className:`${Ln}__meta`,children:L}):null]})]}),n!==!1||r!==!1?ef("div",{className:`${Ln}__actions`,children:[n!==!1?bi(se,{buttonStyle:"icon-label",className:`${Ln}__edit`,icon:"edit",iconStyle:"none",onClick:R}):null,r!==!1?bi(se,{buttonStyle:"icon-label",className:`${Ln}__remove`,icon:"x",iconStyle:"none",onClick:()=>f()}):null,bi(_,{onSave:D})]}):null]}),e[22]=_,e[23]=n,e[24]=r,e[25]=L,e[26]=f,e[27]=D,e[28]=R,e[29]=B,e[30]=P,e[31]=N,e[32]=x,e[33]=M):M=e[33],M}import{jsx as GO}from"react/jsx-runtime";import"react";var VI="upload-field-card";function of({children:t,className:e,size:o="medium"}){return GO("div",{className:[VI,e,`${VI}--size-${o}`].filter(Boolean).join(" "),children:t})}import{isImage as zO}from"payload/shared";var Xc="upload upload--has-many";function GI(t){let e=WO(27),{className:o,displayPreview:n,fileDocs:r,isSortable:s,onRemove:i,onReorder:l,readonly:a,reloadDoc:c,serverURL:u}=t,d;e[0]!==r||e[1]!==l?(d=(v,x)=>{if(v===x)return;let y=[...r],[C]=y.splice(v,1);y.splice(x,0,C),l(y)},e[0]=r,e[1]=l,e[2]=d):d=e[2];let f=d,m;e[3]!==r||e[4]!==i?(m=v=>{let x=[...r||[]];x.splice(v,1),i(x.length===0?[]:x)},e[3]=r,e[4]=i,e[5]=m):m=e[5];let h=m,p;e[6]!==o?(p=[Xc,o].filter(Boolean),e[6]=o,e[7]=p):p=e[7];let g=p.join(" "),b;if(e[8]!==n||e[9]!==r||e[10]!==s||e[11]!==f||e[12]!==a||e[13]!==c||e[14]!==h||e[15]!==u||e[16]!==g){let v;e[18]!==f?(v=y=>{let{moveFromIndex:C,moveToIndex:S}=y;return f(C,S)},e[18]=f,e[19]=v):v=e[19];let x;e[20]!==n||e[21]!==s||e[22]!==a||e[23]!==c||e[24]!==h||e[25]!==u?(x=(y,C)=>{let{relationTo:S,value:w}=y,F=String(w.id),_,A;if(w.url)try{_=new URL(w.url,u).toString()}catch{_=`${u}${w.url}`}if(w.thumbnailURL)try{A=new URL(w.thumbnailURL,u).toString()}catch{A=`${u}${w.thumbnailURL}`}return zO(w.mimeType)&&(A=fa({sizes:w.sizes,thumbnailURL:A,url:_,width:w.width})),vi(Jr,{disabled:!s||a,id:F,children:R=>vi("div",{className:[`${Xc}__dragItem`,R&&s&&`${Xc}--has-drag-handle`].filter(Boolean).join(" "),ref:R.setNodeRef,style:{transform:R.transform,transition:R.transition,zIndex:R.isDragging?1:void 0},children:HO(of,{size:"small",children:[R&&vi("div",{className:`${Xc}__drag`,...R.attributes,...R.listeners,children:vi(wn,{})}),vi(tf,{allowEdit:!a,allowRemove:!a,alt:w?.alt||w?.filename,byteSize:w.filesize,collectionSlug:S,displayPreview:n,filename:w.filename,id:F,mimeType:w?.mimeType,onRemove:()=>h(C),reloadDoc:c,src:_,thumbnailSrc:A,withMeta:!1,x:w?.width,y:w?.height})]})})},F)},e[20]=n,e[21]=s,e[22]=a,e[23]=c,e[24]=h,e[25]=u,e[26]=x):x=e[26],b=vi("div",{className:g,children:vi(ur,{className:`${Xc}__draggable-rows`,ids:r?.map(XO),onDragEnd:v,children:r.map(x)})}),e[8]=n,e[9]=r,e[10]=s,e[11]=f,e[12]=a,e[13]=c,e[14]=h,e[15]=u,e[16]=g,e[17]=b}else b=e[17];return b}function XO(t){let{value:e}=t;return String(e.id)}import{jsx as WI}from"react/jsx-runtime";import{isImage as UO}from"payload/shared";import"react";var YO="upload upload--has-one";function HI(t){let{className:e,displayPreview:o,fileDoc:n,onRemove:r,readonly:s,reloadDoc:i,serverURL:l}=t,{relationTo:a,value:c}=n,u=String(c?.id),d,f;if(c.url)try{d=new URL(c.url,l).toString()}catch{d=`${l}${c.url}`}if(c.thumbnailURL)try{f=new URL(c.thumbnailURL,l).toString()}catch{f=`${l}${c.thumbnailURL}`}return UO(c.mimeType)&&(f=fa({sizes:c.sizes,thumbnailURL:f,url:d,width:c.width})),WI(of,{className:[YO,e].filter(Boolean).join(" "),children:WI(tf,{allowEdit:!s,allowRemove:!s,alt:c?.alt||c?.filename,byteSize:c.filesize,collectionSlug:a,displayPreview:o,filename:c.filename,id:u,mimeType:c?.mimeType,onRemove:r,reloadDoc:i,src:d,thumbnailSrc:f,x:c?.width,y:c?.height})})}var sn="upload";function rf(t){let{AfterInput:e,allowCreate:o,api:n,BeforeInput:r,className:s,Description:i,description:l,displayPreview:a,Error:c,filterOptions:u,hasMany:d,isSortable:f,Label:m,label:h,localized:p,maxRows:g,onChange:b,path:v,readOnly:x,relationTo:y,required:C,serverURL:S,showError:w,style:F,value:_}=t,[A,R]=Xr.useState(),[I,D]=Xr.useState(Array.isArray(y)?y[0]:y),{openModal:E}=ue(),{drawerSlug:T,setCollectionSlug:L,setCurrentActivePath:k,setInitialFiles:j,setMaxFiles:P,setOnSuccess:N}=Ho(),{permissions:B}=De(),{code:M}=$e(),{i18n:O,t:V}=$(),G=UI(()=>({...u,[I]:{...u?.[I]||{},id:{...u?.[I]?.id||{},not_in:(u?.[I]?.id?.not_in||[]).concat(...Array.isArray(_)||_?[_]:[])}}}),[_,I,u]),[z,,{closeDrawer:X,openDrawer:te}]=ci({collectionSlugs:typeof y=="string"?[y]:y,filterOptions:G}),[Y,,{closeDrawer:H,openDrawer:le}]=qt({collectionSlug:I}),q=Xr.useRef(!1),fe=UI(()=>o?!!(typeof I=="string"&&B?.collections&&B.collections?.[I]?.create):!1,[I,B,o]),ae=Xr.useCallback(ne=>{typeof b=="function"&&b(ne)},[b]),J=Xr.useCallback(async(ne,U)=>{if(!ne.length)return;let ie={depth:0,draft:!0,limit:ne.length,locale:M,where:{and:[{id:{in:ne}}]}},de=await fetch(`${S}${n}/${U}`,{body:YI.stringify(ie),credentials:"include",headers:{"Accept-Language":O.language,"Content-Type":"application/x-www-form-urlencoded","X-HTTP-Method-Override":"GET"},method:"POST"});if(de.ok){let Te=await de.json(),Ge=ne.map(je=>Te.docs.find(lt=>String(lt.id)===String(je)));return Ge.includes(void 0)&&d&&(Ge=Ge.map((je,lt)=>je||{id:ne[lt],filename:`${V("general:untitled")} - ID: ${ne[lt]}`,isPlaceholder:!0})),{...Te,docs:Ge}}return null},[M,S,n,O.language,V,d]),ge=zI(ne=>{if(d){let U=[...Array.isArray(_)?_:[],...ne.map(ie=>ie.id)];ae(U),R(ie=>[...ie||[],...ne.map(de=>({relationTo:I,value:de}))])}else{let U=ne[0];ae(U.id),R([{relationTo:I,value:U}])}},[_,ae,I,d]),Ce=Xr.useCallback(ne=>{let U=ne;if(!d&&ne&&ne.length>1){let ie=new DataTransfer;ie.items.add(ne[0]),U=ie.files}U&&j(U),L(y),typeof g=="number"&&P(g),k(v),E(T)},[T,d,E,y,L,j,g,P,v,k]),he=Xr.useCallback(async ne=>{let U=[];for(let[de,Te]of ne)Te&&U.push(de);let ie=await J(U,I);ie&&R(de=>[...de||[],...ie.docs.map(Te=>({relationTo:I,value:Te}))]),ae([...Array.isArray(_)?_:[],...U]),X()},[I,X,ae,J,_]),Le=Xr.useCallback(ne=>{ne.doc&&(R(U=>[...U||[],{relationTo:I,value:ne.doc}]),ae(ne.doc.id)),H()},[H,I,ae]),Ae=zI(async({collectionSlug:ne,doc:U})=>{let ie=await J([U.id],ne),de=ie?ie.docs?.[0]:null;R(Te=>de?d?[...Te||[],{relationTo:I,value:de}]:[{relationTo:I,value:de}]:Te),ae(d?[...Array.isArray(_)?_:[],U.id]:U.id),X()},[X,d,J,ae,_,I]),Q=Xr.useCallback(async(ne,U)=>{let{docs:ie}=await J([ne],U);if(ie[0]){let de=[];R(Te=>{let Ge=Te?.findIndex(je=>(je.value?.id===ie[0].id||je.value?.isPlaceholder)&&je.relationTo===U);if(Ge>-1){let je=[...Te];return je[Ge]={relationTo:U,value:ie[0]},de=je,je}}),de.length&&d&&ae(de.map(Te=>Te.value?.id))}},[J,ae,d]),ke=Xr.useCallback(ne=>{let U=ne.map(({value:ie})=>ie.id);ae(U),R(ne)},[ae]),xe=Xr.useCallback(ne=>{let U=ne?ne.map(({value:ie})=>ie.id):null;ae(d?U:U?U[0]:null),R(ne||[])},[ae,d]);XI(()=>{async function ne(){if(_){q.current=!0;let U=await J(Array.isArray(_)?_:[_],I);U&&R(U.docs.map(ie=>({relationTo:I,value:ie})))}}q.current||ne()},[J,I,_]),XI(()=>{N(v,ge)},[_,v,ge,N]);let ce=!_||d&&Array.isArray(_)&&(typeof g!="number"||_.length<g)||!d&&A?.[0]&&typeof A[0].value>"u";return xi("div",{className:[Ie,sn,s,w&&"error",x&&"read-only"].filter(Boolean).join(" "),id:`field-${v?.replace(/\./g,"__")}`,style:F,children:[jt(oe,{CustomComponent:m,Fallback:jt(ye,{label:h,localized:p,path:v,required:C})}),jt("div",{className:`${sn}__wrap`,children:jt(oe,{CustomComponent:c,Fallback:jt(We,{path:v,showError:w})})}),r,xi("div",{className:`${sn}__dropzoneAndUpload`,children:[d&&Array.isArray(_)&&_.length>0?jt(Uc,{children:A&&A?.length>0?jt(GI,{displayPreview:a,fileDocs:A,isSortable:f&&!x,onRemove:xe,onReorder:ke,readonly:x,reloadDoc:Q,serverURL:S}):jt("div",{className:`${sn}__loadingRows`,children:_.map(ne=>jt(It,{height:"40px"},ne))})}):null,!d&&_?jt(Uc,{children:A&&A?.length>0&&A[0].value?jt(HI,{displayPreview:a,fileDoc:A[0],onRemove:xe,readonly:x,reloadDoc:Q,serverURL:S}):A&&_&&!A?.[0]?.value?xi(Uc,{children:[V("general:untitled")," - ID: ",_]}):jt(It,{height:"62px"})}):null,ce?jt(pi,{disabled:x||!fe,multipleFiles:d,onChange:Ce,children:xi("div",{className:`${sn}__dropzoneContent`,children:[xi("div",{className:`${sn}__dropzoneContent__buttons`,children:[fe&&xi(Uc,{children:[jt(se,{buttonStyle:"pill",className:`${sn}__createNewToggler`,disabled:x||!fe,onClick:()=>{x||(d?Ce():le())},size:"small",children:V("general:createNew")}),jt("span",{className:`${sn}__dropzoneContent__orText`,children:V("general:or")})]}),jt(se,{buttonStyle:"pill",className:`${sn}__listToggler`,disabled:x,onClick:te,size:"small",children:V("fields:chooseFromExisting")}),jt(Y,{onSave:Le}),jt(z,{allowCreate:fe,enableRowSelections:d,onBulkSelect:he,onSelect:Ae})]}),fe&&!x&&xi("p",{className:`${sn}__dragAndDropText`,children:[V("general:or")," ",V("upload:dragAndDrop")]})]})}):jt(Uc,{children:!x&&!A&&(!_||typeof g!="number"||Array.isArray(_)&&_.length<g)?jt(It,{height:"40px"}):null})]}),e,jt(oe,{CustomComponent:i,Fallback:jt(Ve,{description:l,path:v})})]})}function QO(t){let{field:e,field:{admin:{allowCreate:o,className:n,description:r,isSortable:s}={},hasMany:i,label:l,localized:a,maxRows:c,relationTo:u,required:d},path:f,readOnly:m,validate:h}=t,{config:p}=W(),g=e.displayPreview,b=JO.useCallback((E,T)=>{if(typeof h=="function")return h(E,{...T,required:d})},[h,d]),{customComponents:{AfterInput:v,BeforeInput:x,Description:y,Error:C,Label:S}={},disabled:w,filterOptions:F,path:_,setValue:A,showError:R,value:I}=Ne({potentiallyStalePath:f,validate:b}),D=qO(()=>rt(e),[e]);return ZO(rf,{AfterInput:v,allowCreate:o!==!1,api:p.routes.api,BeforeInput:x,className:n,Description:y,description:r,displayPreview:g,Error:C,filterOptions:F,hasMany:i,isSortable:s,label:l,Label:S,localized:a,maxRows:c,onChange:A,path:_,readOnly:m||w,relationTo:u,required:d,serverURL:p.serverURL,showError:R,style:D,value:I})}var Yc=Oe(QO);function Da(t){let e=KO(13),{clientFieldConfig:o,forceRender:n,indexPath:r,parentPath:s,parentSchemaPath:i,path:l,permissions:a,readOnly:c,schemaPath:u}=t,d;e[0]!==l?(d=h=>{let[p]=h;return p&&p?.[l]?.customComponents?.Field},e[0]=l,e[1]=d):d=e[1];let f=Nt(d);if(f!==void 0)return f||null;let m;if(e[2]!==o||e[3]!==n||e[4]!==r||e[5]!==s||e[6]!==i||e[7]!==l||e[8]!==a||e[9]!==c||e[10]!==u){m=Symbol.for("react.early_return_sentinel");e:{let h={forceRender:n,permissions:a,readOnly:c,schemaPath:u},p={...h,indexPath:r,parentPath:s,parentSchemaPath:i};if(o.admin?.hidden){m=At(oc,{...h,path:l});break e}switch(o.type){case"array":{m=At(Zc,{...p,field:o,path:l});break e}case"blocks":{m=At(Ll,{...p,field:o,path:l});break e}case"checkbox":{m=At(fr,{...h,field:o,path:l});break e}case"code":{m=At(kl,{...h,field:o,path:l});break e}case"collapsible":{m=At(Ol,{...p,field:o,path:l});break e}case"date":{m=At(ec,{...h,field:o,path:l});break e}case"email":{m=At(ni,{...h,field:o,path:l});break e}case"group":{m=At(tc,{...p,field:o,path:l});break e}case"join":{m=At(mc,{...h,field:o,path:l});break e}case"json":{m=At(fc,{...h,field:o,path:l});break e}case"number":{m=At(pc,{...h,field:o,path:l});break e}case"point":{m=At(hc,{...h,field:o,path:l});break e}case"radio":{m=At(vc,{...h,field:o,path:l});break e}case"relationship":{m=At(Sc,{...h,field:o,path:l});break e}case"richText":{m=At(Ic,{...h,field:o,path:l});break e}case"row":{m=At(Rc,{...p,field:o});break e}case"select":{m=At(_c,{...h,field:o,path:l});break e}case"tabs":{m=At(Tc,{...p,field:o,path:l});break e}case"text":{m=At(fi,{...h,field:o,path:l});break e}case"textarea":{m=At(Ec,{...h,field:o,path:l});break e}case"ui":{let g;e[12]===Symbol.for("react.memo_cache_sentinel")?(g=At(Pc,{}),e[12]=g):g=e[12],m=g;break e}case"upload":{m=At(Yc,{...h,field:o,path:l});break e}}}e[2]=o,e[3]=n,e[4]=r,e[5]=s,e[6]=i,e[7]=l,e[8]=a,e[9]=c,e[10]=u,e[11]=m}else m=e[11];if(m!==Symbol.for("react.early_return_sentinel"))return m}var Ab="render-fields",So=t=>{let e=eM(22),{className:o,fields:n,forceRender:r,margins:s,parentIndexPath:i,parentPath:l,parentSchemaPath:a,permissions:c,readOnly:u}=t,d=Ko();if(n&&n.length>0){let f=s&&`${Ab}--margins-${s}`,m=s===!1&&`${Ab}--margins-none`,h;e[0]!==o||e[1]!==f||e[2]!==m?(h=[Ab,o,f,m].filter(Boolean),e[0]=o,e[1]=f,e[2]=m,e[3]=h):h=e[3];let p=h.join(" "),g;if(e[4]!==n||e[5]!==r||e[6]!==d||e[7]!==i||e[8]!==l||e[9]!==a||e[10]!==c||e[11]!==u||e[12]!==p){let b;e[14]!==r||e[15]!==d||e[16]!==i||e[17]!==l||e[18]!==a||e[19]!==c||e[20]!==u?(b=(v,x)=>{if(!v||tM(v))return null;let{operation:y,permissions:C,read:S}=rM({field:v,operation:d,parentName:l?.includes(".")?l.split(".")[l.split(".").length-1]:l,permissions:c});if("name"in v&&!S)return null;let w=u||v?.admin?.readOnly;w&&v.admin?.readOnly===!1&&(w=!1),"name"in v&&!y&&(w=!0);let{indexPath:F,path:_,schemaPath:A}=oM({field:v,index:x,parentIndexPath:i,parentPath:l,parentSchemaPath:a});return Fb(ih,{value:_,children:Fb(Da,{clientFieldConfig:v,forceRender:r,indexPath:F,parentPath:l,parentSchemaPath:a,path:_,permissions:C,readOnly:w,schemaPath:A})},`${_}-${x}`)},e[14]=r,e[15]=d,e[16]=i,e[17]=l,e[18]=a,e[19]=c,e[20]=u,e[21]=b):b=e[21],g=Fb(gy,{className:p,forceRender:r,children:n.map(b)}),e[4]=n,e[5]=r,e[6]=d,e[7]=i,e[8]=l,e[9]=a,e[10]=c,e[11]=u,e[12]=p,e[13]=g}else g=e[13];return g}return null};var Jc="array-field",ZI=t=>{let e=nM(42),{addRow:o,attributes:n,CustomRowLabel:r,duplicateRow:s,errorCount:i,fields:l,forceRender:a,hasMaxRows:c,isDragging:u,isLoading:d,isSortable:f,labels:m,listeners:h,moveRow:p,parentPath:g,path:b,permissions:v,readOnly:x,removeRow:y,row:C,rowCount:S,rowIndex:w,schemaPath:F,setCollapse:_,setNodeRef:A,transform:R,transition:I}=t,D=a===void 0?!1:a,E=wd(d,500),{i18n:T}=$(),L=Xt(),k=`${iM(m.singular,T)} ${String(w+1).padStart(2,"0")}`,j=i>0&&L,P=j?`${Jc}__row--has-errors`:`${Jc}__row--no-errors`,N;e[0]!==P?(N=[`${Jc}__row`,P].filter(Boolean),e[0]=P,e[1]=N):N=e[1];let B=N.join(" "),M=`${g.split(".").join("-")}-row-${w}`,O=u?1:void 0,V;if(e[2]!==r||e[3]!==o||e[4]!==n||e[5]!==B||e[6]!==s||e[7]!==i||e[8]!==k||e[9]!==j||e[10]!==l||e[11]!==D||e[12]!==c||e[13]!==T||e[14]!==E||e[15]!==f||e[16]!==h||e[17]!==p||e[18]!==g||e[19]!==b||e[20]!==v||e[21]!==x||e[22]!==y||e[23]!==C.collapsed||e[24]!==C.id||e[25]!==S||e[26]!==w||e[27]!==F||e[28]!==_||e[29]!==A||e[30]!==M||e[31]!==O||e[32]!==R||e[33]!==I){let G;e[35]!==i||e[36]!==j||e[37]!==T?(G=j&&ws(ao,{count:i,i18n:T,withMessage:!0}),e[35]=i,e[36]=j,e[37]=T,e[38]=G):G=e[38];let z;e[39]!==C.id||e[40]!==_?(z=X=>_(C.id,X),e[39]=C.id,e[40]=_,e[41]=z):z=e[41],V=ws("div",{id:M,ref:A,style:{transform:R,transition:I,zIndex:O},children:ws(Ys,{actions:x?void 0:ws(yd,{addRow:o,duplicateRow:s,hasMaxRows:c,index:w,isSortable:f,moveRow:p,removeRow:y,rowCount:S}),className:B,collapsibleStyle:j?"error":"default",dragHandleProps:f?{id:C.id,attributes:n,listeners:h}:void 0,header:sM("div",{className:`${Jc}__row-header`,children:[E?ws(It,{height:"1rem",width:"8rem"}):ws(mn,{CustomComponent:r,label:k,path:b,rowNumber:w}),G]}),isCollapsed:C.collapsed,onToggle:z,children:E?ws(It,{}):ws(So,{className:`${Jc}__fields`,fields:l,forceRender:D,margins:"small",parentIndexPath:"",parentPath:b,parentSchemaPath:F,permissions:v===!0?v:v?.fields,readOnly:x})})},`${g}-row-${C.id}`),e[2]=r,e[3]=o,e[4]=n,e[5]=B,e[6]=s,e[7]=i,e[8]=k,e[9]=j,e[10]=l,e[11]=D,e[12]=c,e[13]=T,e[14]=E,e[15]=f,e[16]=h,e[17]=p,e[18]=g,e[19]=b,e[20]=v,e[21]=x,e[22]=y,e[23]=C.collapsed,e[24]=C.id,e[25]=S,e[26]=w,e[27]=F,e[28]=_,e[29]=A,e[30]=M,e[31]=O,e[32]=R,e[33]=I,e[34]=V}else V=e[34];return V};var Cr="array-field",cM=t=>{let e=aM(52),{field:o,forceRender:n,path:r,permissions:s,readOnly:i,schemaPath:l,validate:a}=t,{name:c,admin:u,fields:d,label:f,localized:m,maxRows:h,minRows:p,required:g}=o,b;e[0]!==u?(b=u===void 0?{}:u,e[0]=u,e[1]=b):b=e[1];let{className:v,description:x,isSortable:y}=b,C=y===void 0?!0:y,S=n===void 0?!1:n,w=l??c,F=p??g?1:0,{setDocFieldPreferences:_}=Pe(),{addFieldRow:A,dispatchFields:R,moveFieldRow:I,removeFieldRow:D,setModified:E}=Me(),T=Xt(),{code:L}=$e(),{i18n:k,t:j}=$(),{config:P}=W(),{localization:N}=P,B;e:{if(N&&N.fallback){let ee=N.defaultLocale;B=L===ee;break e}B=!0}let M=B,O;e[2]!==j?(O=ee=>"labels"in ee&&ee?.labels?ee.labels:"labels"in ee.field&&ee.field.labels?{plural:ee.field.labels?.plural,singular:ee.field.labels?.singular}:"label"in ee.field&&ee.field.label?{plural:void 0,singular:ee.field.label}:{plural:j("general:rows"),singular:j("general:row")},e[2]=j,e[3]=O):O=e[3];let G=O(t),z;e[4]!==M||e[5]!==h||e[6]!==F||e[7]!==g||e[8]!==a?(z=(ee,K)=>{if(!M&&ee===null)return!0;if(typeof a=="function")return a(ee,{...K,maxRows:h,minRows:F,required:g})},e[4]=M,e[5]=h,e[6]=F,e[7]=g,e[8]=a,e[9]=z):z=e[9];let X=z,te;e[10]!==X||e[11]!==r?(te={hasRows:!0,potentiallyStalePath:r,validate:X},e[10]=X,e[11]=r,e[12]=te):te=e[12];let{customComponents:Y,disabled:H,errorPaths:le,path:q,rows:fe,showError:ae,valid:J,value:ge}=Ne(te),Ce;e[13]!==Y?(Ce=Y===void 0?{}:Y,e[13]=Y,e[14]=Ce):Ce=e[14];let{AfterInput:he,BeforeInput:Le,Description:Ae,Error:Q,Label:ke}=Ce,xe;e[15]!==fe?(xe=fe===void 0?[]:fe,e[15]=fe,e[16]=xe):xe=e[16];let ce=xe,ne;e[17]!==A||e[18]!==q||e[19]!==w?(ne=ee=>{A({path:q,rowIndex:ee,schemaPath:w}),setTimeout(()=>{Yi(`${q}-row-${ee}`)},0)},e[17]=A,e[18]=q,e[19]=w,e[20]=ne):ne=e[20];let U=ne,ie;e[21]!==R||e[22]!==q||e[23]!==E?(ie=ee=>{R({type:"DUPLICATE_ROW",path:q,rowIndex:ee}),E(!0),setTimeout(()=>{Yi(`${q}-row-${ee}`)},0)},e[21]=R,e[22]=q,e[23]=E,e[24]=ie):ie=e[24];let de=ie,Te;e[25]!==q||e[26]!==D?(Te=ee=>{D({path:q,rowIndex:ee})},e[25]=q,e[26]=D,e[27]=Te):Te=e[27];let Ge=Te,je;e[28]!==I||e[29]!==q?(je=(ee,K)=>{I({moveFromIndex:ee,moveToIndex:K,path:q})},e[28]=I,e[29]=q,e[30]=je):je=e[30];let lt=je,Ue;e[31]!==R||e[32]!==q||e[33]!==ce||e[34]!==_?(Ue=ee=>{let{collapsedIDs:K,updatedRows:Z}=pd({collapsed:ee,rows:ce});_(q,{collapsed:K}),R({type:"SET_ALL_ROWS_COLLAPSED",path:q,updatedRows:Z})},e[31]=R,e[32]=q,e[33]=ce,e[34]=_,e[35]=Ue):Ue=e[35];let He=Ue,dt;e[36]!==R||e[37]!==q||e[38]!==ce||e[39]!==_?(dt=(ee,K)=>{let{collapsedIDs:Z,updatedRows:re}=fd({collapsed:K,rowID:ee,rows:ce});R({type:"SET_ROW_COLLAPSED",path:q,updatedRows:re}),_(q,{collapsed:Z})},e[36]=R,e[37]=q,e[38]=ce,e[39]=_,e[40]=dt):dt=e[40];let Kt=dt,ze=h&&ce.length>=h,Je=le.length,Xe=T&&le.length>0,Ct=(i||H)&&ce.length===0,Et=ce.length&&ce.length<F||g&&ce.length===0,gt=Xe?`${Cr}--has-error`:`${Cr}--has-no-error`,qe;e[41]!==v||e[42]!==gt?(qe=[Ie,Cr,v,gt].filter(Boolean),e[41]=v,e[42]=gt,e[43]=qe):qe=e[43];let Pt;e[44]!==Q||e[45]!==q||e[46]!==ae?(Pt=ae&&mo(oe,{CustomComponent:Q,Fallback:mo(We,{path:q,showError:ae})}),e[44]=Q,e[45]=q,e[46]=ae,e[47]=Pt):Pt=e[47];let be;return e[48]!==Je||e[49]!==Xe||e[50]!==k?(be=Xe&&Je>0&&mo(ao,{count:Je,i18n:k,withMessage:!0}),e[48]=Je,e[49]=Xe,e[50]=k,e[51]=be):be=e[51],yi("div",{className:qe.join(" "),id:`field-${q.replace(/\./g,"__")}`,children:[Pt,yi("header",{className:`${Cr}__header`,children:[yi("div",{className:`${Cr}__header-wrap`,children:[yi("div",{className:`${Cr}__header-content`,children:[mo("h3",{className:`${Cr}__title`,children:mo(oe,{CustomComponent:ke,Fallback:mo(ye,{as:"span",label:f,localized:m,path:q,required:g})})}),be]}),ce?.length>0&&yi("ul",{className:`${Cr}__header-actions`,children:[mo("li",{children:mo("button",{className:`${Cr}__header-action`,onClick:()=>He(!0),type:"button",children:j("fields:collapseAll")})}),mo("li",{children:mo("button",{className:`${Cr}__header-action`,onClick:()=>He(!1),type:"button",children:j("fields:showAll")})})]})]}),mo(oe,{CustomComponent:Ae,Fallback:mo(Ve,{description:x,path:q})})]}),mo(Fl,{fieldValue:ge,localized:m,path:q}),Le,(ce?.length>0||!J&&(Ct||Et))&&yi(ur,{className:`${Cr}__draggable-rows`,ids:ce.map(uM),onDragEnd:ee=>{let{moveFromIndex:K,moveToIndex:Z}=ee;return lt(K,Z)},children:[ce.map((ee,K)=>{let{id:Z,isLoading:re}=ee,pe=`${q}.${K}`,ve=le?.filter(we=>we.startsWith(pe+".")).length;return mo(Jr,{disabled:i||H||!C,id:Z,children:we=>mo(ZI,{...we,addRow:U,CustomRowLabel:ce?.[K]?.customComponents?.RowLabel,duplicateRow:de,errorCount:ve,fields:d,forceRender:S,hasMaxRows:ze,isLoading:re,isSortable:C,labels:G,moveRow:lt,parentPath:q,path:pe,permissions:s,readOnly:i||H,removeRow:Ge,row:ee,rowCount:ce?.length,rowIndex:K,schemaPath:w,setCollapse:Kt})},Z)}),!J&&yi(lM.Fragment,{children:[Ct&&mo(Rr,{children:j("validation:fieldHasNo",{label:Tb(G.plural,k)})}),Et&&mo(Rr,{type:"error",children:j("validation:requiresAtLeast",{count:F,label:Tb(F>1?G.plural:G.singular,k)||j(F>1?"general:rows":"general:row")})})]})]}),!ze&&!i&&mo(se,{buttonStyle:"icon-label",className:`${Cr}__add-row`,icon:"plus",iconPosition:"left",iconStyle:"with-border",onClick:()=>{U(ge||0)},children:j("fields:addLabel",{label:Tb(G.singular,k)})}),he]})},Zc=Oe(cM);function uM(t){return t.id}import{c as dM}from"react/compiler-runtime";import{jsx as Eb,jsxs as JI}from"react/jsx-runtime";import{confirmPassword as mM}from"payload/shared";import"react";var qc=t=>{let e=dM(12),{disabled:o,path:n}=t,r=n===void 0?"confirm-password":n,{t:s}=$(),i;e[0]!==r?(i={path:r,validate:fM},e[0]=r,e[1]=i):i=e[1];let{disabled:l,setValue:a,showError:c,value:u}=Ne(i),d=c&&"error",f;e[2]!==d?(f=[Ie,"confirm-password",d].filter(Boolean),e[2]=d,e[3]=f):f=e[3];let m=f.join(" "),h;return e[4]!==l||e[5]!==o||e[6]!==r||e[7]!==a||e[8]!==s||e[9]!==m||e[10]!==u?(h=JI("div",{className:m,children:[Eb(ye,{htmlFor:"field-confirm-password",label:s("authentication:confirmPassword"),required:!0}),JI("div",{className:`${Ie}__wrap`,children:[Eb(We,{path:r}),Eb("input",{"aria-label":s("authentication:confirmPassword"),autoComplete:"off",disabled:!!(l||o),id:"field-confirm-password",name:"confirm-password",onChange:a,type:"password",value:u||""})]})]}),e[4]=l,e[5]=o,e[6]=r,e[7]=a,e[8]=s,e[9]=m,e[10]=u,e[11]=h):h=e[11],h};function fM(t,e){return mM(t,{name:"confirm-password",type:"text",required:!0,...e})}import{jsx as hM}from"react/jsx-runtime";import{password as gM}from"payload/shared";import{useCallback as bM,useMemo as vM}from"react";import{c as pM}from"react/compiler-runtime";import{jsx as Ci,jsxs as Pb}from"react/jsx-runtime";import{getTranslation as qI}from"@payloadcms/translations";import"react";var QI=t=>{let e=pM(28),{AfterInput:o,autoComplete:n,BeforeInput:r,className:s,description:i,Description:l,Error:a,inputRef:c,Label:u,label:d,localized:f,onChange:m,onKeyDown:h,path:p,placeholder:g,readOnly:b,required:v,rtl:x,showError:y,style:C,value:S,width:w}=t,F=n===void 0?"off":n,{i18n:_}=$(),A=y&&"error",R=b&&"read-only",I;e[0]!==s||e[1]!==A||e[2]!==R?(I=[Ie,"password",s,A,R].filter(Boolean),e[0]=s,e[1]=A,e[2]=R,e[3]=I):I=e[3];let D=I.join(" "),E;return e[4]!==o||e[5]!==r||e[6]!==l||e[7]!==a||e[8]!==u||e[9]!==F||e[10]!==i||e[11]!==_||e[12]!==c||e[13]!==d||e[14]!==f||e[15]!==m||e[16]!==h||e[17]!==p||e[18]!==g||e[19]!==b||e[20]!==v||e[21]!==x||e[22]!==y||e[23]!==C||e[24]!==D||e[25]!==S||e[26]!==w?(E=Pb("div",{className:D,style:{...C,width:w},children:[Ci(oe,{CustomComponent:u,Fallback:Ci(ye,{label:d,localized:f,path:p,required:v})}),Pb("div",{className:`${Ie}__wrap`,children:[Ci(oe,{CustomComponent:a,Fallback:Ci(We,{path:p,showError:y})}),Pb("div",{children:[r,Ci("input",{"aria-label":qI(d,_),autoComplete:F,"data-rtl":x,disabled:b,id:`field-${p.replace(/\./g,"__")}`,name:p,onChange:m,onKeyDown:h,placeholder:qI(g,_),ref:c,type:"password",value:S||""}),o]}),Ci(oe,{CustomComponent:l,Fallback:Ci(Ve,{description:i,path:p})})]})]}),e[4]=o,e[5]=r,e[6]=l,e[7]=a,e[8]=u,e[9]=F,e[10]=i,e[11]=_,e[12]=c,e[13]=d,e[14]=f,e[15]=m,e[16]=h,e[17]=p,e[18]=g,e[19]=b,e[20]=v,e[21]=x,e[22]=y,e[23]=C,e[24]=D,e[25]=S,e[26]=w,e[27]=E):E=e[27],E};var xM=t=>{let{autoComplete:e,field:o,field:{admin:{className:n,disabled:r,placeholder:s,rtl:i}={},label:l,localized:a,required:c}={},inputRef:u,path:d,validate:f}=t,{t:m}=$(),h=$e(),{config:p}=W(),g=bM((I,D)=>{let E=d?d.split("."):[];return typeof f=="function"?f(I,{...D,required:c}):gM(I,{name:"password",type:"text",blockData:{},data:{},event:"onChange",path:E,preferences:{fields:{}},req:{payload:{config:p},t:m},required:!0,siblingData:{}})},[f,p,m,c,d]),{customComponents:{AfterInput:b,BeforeInput:v,Description:x,Error:y,Label:C}={},disabled:S,setValue:w,showError:F,value:_}=Ne({path:d,validate:g}),A=Ui({fieldLocalized:!1,fieldRTL:i,locale:h,localizationConfig:p.localization||void 0}),R=vM(()=>rt(o),[o]);return hM(QI,{AfterInput:b,autoComplete:e,BeforeInput:v,className:n,Description:x,Error:y,inputRef:u,Label:C,label:l,localized:a,onChange:I=>{w(I.target.value)},path:d,placeholder:s,readOnly:S||r,required:c,rtl:A,showError:F,style:R,value:_||""})},Qc=Oe(xM);var KI={array:Zc,blocks:Ll,checkbox:fr,code:kl,collapsible:Ol,confirmPassword:qc,date:ec,email:ni,group:tc,hidden:oc,join:mc,json:fc,number:pc,password:Qc,point:hc,radio:vc,relationship:Sc,richText:Ic,row:Rc,select:_c,tabs:Tc,text:fi,textarea:Ec,ui:Pc,upload:Yc},yM={...KI,Description:Ve,Error:We,Label:ye,RowLabel:mn};import{c as CM}from"react/compiler-runtime";import{setsAreEqual as wM}from"payload/shared";import{useEffect as SM}from"react";var $n=new Map([]),IM={altleft:"alt",altright:"alt",controlleft:"ctrl",controlright:"ctrl",ctrlleft:"ctrl",ctrlright:"ctrl",escape:"esc",metaleft:"meta",metaright:"meta",osleft:"meta",osright:"meta",shiftleft:"shift",shiftright:"shift"},e4=t=>(IM[t.toLowerCase()]||t).trim().toLowerCase().replace("key",""),RM=t=>{let e=e4(t);e==="meta"&&$n.forEach((o,n)=>n!=="meta"&&$n.delete(n)),$n.set(e,Date.now())},_M=t=>{let e=e4(t);e==="meta"&&$n.clear(),$n.delete(e)},wi=(t,e)=>{let o=CM(9),{cmdCtrlKey:n,editDepth:r,keyCodes:s}=t,{modalState:i}=ue(),l;o[0]!==n||o[1]!==r||o[2]!==e||o[3]!==s||o[4]!==i?(l=f=>{let m=f.detail?.key?f.detail:f;if(m.key===void 0)return;$n.forEach(DM),m.code&&RM(m.code);let h=window.navigator.userAgent.includes("Mac OS X"),p=[...$n.keys()].filter(FM);if(wM(new Set(p),new Set(s))&&(!n||h&&$n.has("meta")||!h&&m.ctrlKey)){if((Object.keys(i).filter(b=>i[b]?.isOpen)?.length+1||1)!==r)return;e(m)}},o[0]=n,o[1]=r,o[2]=e,o[3]=s,o[4]=i,o[5]=l):l=o[5];let a=l,c=AM,u,d;o[6]!==a?(u=()=>(document.addEventListener("keydown",a,!1),document.addEventListener("bypassKeyDown",a,!1),document.addEventListener("keyup",c,!1),()=>{document.removeEventListener("keydown",a),document.removeEventListener("bypassKeyDown",a),document.removeEventListener("keyup",c)}),d=[a,c],o[6]=a,o[7]=u,o[8]=d):(u=o[7],d=o[8]),SM(u,d)};function DM(t,e){Date.now()-t>3e3&&$n.delete(e)}function FM(t){return!["alt","ctrl","meta","shift"].includes(t)}function AM(t){t.code&&_M(t.code)}import{c as TM}from"react/compiler-runtime";import*as o4 from"qs-esm";import{useEffect as t4,useRef as EM,useState as nf}from"react";var PM=(t,e)=>{let o=TM(32),n;o[0]!==e?(n=e===void 0?{}:e,o[0]=e,o[1]=n):n=o[1];let r=n,{initialData:s,initialParams:i}=r,l;o[2]!==i?(l=i===void 0?{}:i,o[2]=i,o[3]=l):l=o[3];let a=l,{i18n:c}=$(),u;o[4]!==s?(u=s||{},o[4]=s,o[5]=u):u=o[5];let[d,f]=nf(u),[m,h]=nf(a),[p,g]=nf(!s),[b,v]=nf(!1),{code:x}=$e(),y=EM(!1),C;if(o[6]!==x||o[7]!==m){let E;o[9]!==m?(E=typeof m=="object"?m:{},o[9]=m,o[10]=E):E=o[10],C=o4.stringify({locale:x,...E},{addQueryPrefix:!0}),o[6]=x,o[7]=m,o[8]=C}else C=o[8];let S=C,w;o[11]!==c.language||o[12]!==s||o[13]!==S||o[14]!==t?(w=()=>{if(s&&!y.current){y.current=!0;return}let E=new AbortController;return t?(async()=>{v(!1),g(!0);try{let L=await Ke.get(`${t}${S}`,{headers:{"Accept-Language":c.language},signal:E.signal});L.status>201&&v(!0);let k=await L.json();f(k),g(!1)}catch{E.signal.aborted||(v(!0),g(!1))}})():(v(!1),g(!1)),()=>{try{E.abort()}catch(L){let k=L}}},o[11]=c.language,o[12]=s,o[13]=S,o[14]=t,o[15]=w):w=o[15];let F;o[16]!==c.language||o[17]!==s||o[18]!==x||o[19]!==S||o[20]!==t?(F=[t,x,S,c.language,s],o[16]=c.language,o[17]=s,o[18]=x,o[19]=S,o[20]=t,o[21]=F):F=o[21],t4(w,F);let _,A;o[22]!==s?(_=()=>{s&&y.current&&f(s)},A=[s],o[22]=s,o[23]=_,o[24]=A):(_=o[23],A=o[24]),t4(_,A);let R;o[25]!==d||o[26]!==b||o[27]!==p?(R={data:d,isError:b,isLoading:p},o[25]=d,o[26]=b,o[27]=p,o[28]=R):R=o[28];let I;o[29]===Symbol.for("react.memo_cache_sentinel")?(I={setParams:h},o[29]=I):I=o[29];let D;return o[30]!==R?(D=[R,I],o[30]=R,o[31]=D):D=o[31],D};import{c as NM}from"react/compiler-runtime";import{useEffect as LM,useState as $M}from"react";var kM=t=>{let e=NM(5),[o,n]=$M(),r,s;e[0]!==t?(r=()=>{let l;return t&&(l=new ResizeObserver(a=>{a.forEach(c=>{let{contentBoxSize:u,contentRect:d}=c,f=0,m=0;if(u){let h=Array.isArray(u)?u[0]:u;if(h){let{blockSize:p,inlineSize:g}=h;f=g,m=p}}else if(d){let{height:h,width:p}=d;f=p,m=h}n({height:m,width:f})})}),l.observe(t)),()=>{l&&l.unobserve(t)}},s=[t],e[0]=t,e[1]=r,e[2]=s):(r=e[1],s=e[2]),LM(r,s);let i;return e[3]!==o?(i={size:o},e[3]=o,e[4]=i):i=e[4],i};import{flattenTopLevelFields as jM}from"payload/shared";var Nb=t=>{let{admin:{useAsTitle:e},fields:o}=t;return jM(o)?.find(r=>"name"in r&&r.name===e)};import{c as s4}from"react/compiler-runtime";import{jsx as La}from"react/jsx-runtime";import{useEffect as OM,useRef as MM}from"react";import{jsx as sf}from"react/jsx-runtime";import"react";var r4=({className:t})=>sf("svg",{className:"icon icon--sort",fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:sf("path",{className:"fill",d:"M2.5 13.3333L5.83333 16.6667M5.83333 16.6667L9.16667 13.3333M5.83333 16.6667V3.33333M9.16667 7.08333H17.5M9.16667 10.4167H15M11.6667 13.75H12.5",stroke:"#2F2F2F",strokeLinecap:"round",strokeLinejoin:"round"})}),n4=({className:t})=>sf("svg",{className:"icon icon--sort",fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:sf("path",{className:"fill",d:"M2.5 6.66668L5.83333 3.33334M5.83333 3.33334L9.16667 6.66668M5.83333 3.33334V16.6667M11.6667 7.08354H17.5M9.16667 10.4169H15M9.16667 13.7502H12.5",stroke:"#2F2F2F",strokeLinecap:"round",strokeLinejoin:"round"})});var kn="sort-header";function BM(){let t=s4(12),{handleSortChange:e,orderableFieldName:o,query:n}=_t(),r=Array.isArray(n.sort)?n.sort[0]:n.sort,s=MM(r===`-${o}`?"desc":"asc"),i=r===`-${o}`||r===o,l,a;t[0]!==i||t[1]!==o||t[2]!==r?(l=()=>{i&&(s.current=r===`-${o}`?"desc":"asc")},a=[o,r,i],t[0]=i,t[1]=o,t[2]=r,t[3]=l,t[4]=a):(l=t[3],a=t[4]),OM(l,a);let c;t[5]!==e||t[6]!==i||t[7]!==o?(c=()=>{if(i){e(s.current==="asc"?`-${o}`:o),s.current=s.current==="asc"?"desc":"asc";return}e(s.current==="asc"?o:`-${o}`)},t[5]=e,t[6]=i,t[7]=o,t[8]=c):c=t[8];let u=c,d;return t[9]!==u||t[10]!==i?(d={handleSortPress:u,isActive:i,sort:s},t[9]=u,t[10]=i,t[11]=d):d=t[11],d}var VM=t=>{let e=s4(8),{appearance:o}=t,{handleSortPress:n,isActive:r,sort:s}=BM(),{t:i}=$(),l=o&&`${kn}--appearance-${o}`,a;e[0]!==l?(a=[kn,l].filter(Boolean),e[0]=l,e[1]=a):a=e[1];let c=a.join(" "),u;return e[2]!==n||e[3]!==r||e[4]!==s.current||e[5]!==i||e[6]!==c?(u=La("div",{className:c,children:La("div",{className:`${kn}__buttons`,children:s.current==="desc"?La("button",{"aria-label":i("general:sortByLabelDirection",{direction:i("general:ascending"),label:"Order"}),className:`${kn}__button ${kn}__${s.current} ${r?`${kn}--active`:""}`,onClick:n,type:"button",children:La(r4,{})}):La("button",{"aria-label":i("general:sortByLabelDirection",{direction:i("general:descending"),label:"Order"}),className:`${kn}__button ${kn}__${s.current} ${r?`${kn}--active`:""}`,onClick:n,type:"button",children:La(n4,{})})})}),e[2]=n,e[3]=r,e[4]=s.current,e[5]=i,e[6]=c,e[7]=u):u=e[7],u};import{c as GM}from"react/compiler-runtime";import{jsx as i4}from"react/jsx-runtime";import"react";var a4="sort-row",WM=()=>{let t=GM(2),{orderableFieldName:e,query:o}=_t(),n=o.sort===e||o.sort===`-${e}`,r=`${a4} ${n?"active":""}`,s;return t[0]!==r?(s=i4("div",{className:r,role:"button",tabIndex:0,children:i4(wn,{className:`${a4}__icon`})}),t[0]=r,t[1]=s):s=t[1],s};import{jsx as Ur,jsxs as c4}from"react/jsx-runtime";import{DragOverlay as HM}from"@dnd-kit/core";import{useEffect as zM,useState as kb}from"react";import{jsx as af}from"react/jsx-runtime";var Lb=({cellMap:t,columns:e,dragAttributes:o={},dragListeners:n={},rowId:r,...s})=>af("tr",{...s,children:e.map((i,l)=>{let{accessor:a}=i,c=i.renderedCells[t[r]];return a==="_dragHandle"?af("td",{className:`cell-${a}`,children:af("div",{...o,...n,children:c})},l):af("td",{className:`cell-${a}`,children:c},l)})});import{jsx as $b}from"react/jsx-runtime";var l4=({children:t,className:e,rowId:o})=>typeof o>"u"?null:$b("div",{className:e,children:$b("table",{cellPadding:0,cellSpacing:0,children:$b("tbody",{children:t})})});var lf="table",XM=({appearance:t="default",collection:e,columns:o,data:n})=>{let{config:r}=W(),{data:s,orderableFieldName:i,query:l}=_t(),a=s?.docs||n,[c,u]=kb(a),[d,f]=kb({}),[m,h]=kb();zM(()=>{u(a),f(Object.fromEntries(a.map((x,y)=>[String(x.id??x._id),y])))},[a]);let p=o?.filter(x=>x?.active);if(!p||p.filter(x=>!["_dragHandle","_select"].includes(x.accessor)).length===0)return Ur("div",{children:"No columns selected"});let g=async({moveFromIndex:x,moveToIndex:y})=>{if(l.sort!==i&&l.sort!==`-${i}`){me.warning('To reorder the rows you must first sort them by the "Order" column'),h(void 0);return}if(x===y){h(void 0);return}let C=c[x].id??c[x]._id,S=y>x?c[y]:c[y-1],w=y>x?c[y+1]:c[y],F=[...c];u(_=>{let A=[..._];return A[x][i]="pending",A.splice(y,0,A.splice(x,1)[0]),A});try{let _=S?{id:S.id??S._id,key:S[i]}:{id:w.id??w._id,key:w[i]},A=S&&l.sort===i||!S&&l.sort===`-${i}`?"greater":"less",R={collectionSlug:e.slug,docsToMove:[C],newKeyWillBe:A,orderableFieldName:i,target:_},I=await fetch(`${r.routes.api}/reorder`,{body:JSON.stringify(R),headers:{"Content-Type":"application/json"},method:"POST"});if(I.status===403)throw new Error("You do not have permission to reorder these rows");if(!I.ok)throw new Error("Failed to reorder. This can happen if you reorder several rows too quickly. Please try again.")}catch(_){let A=_ instanceof Error?_.message:String(_);u(F),me.error(A)}finally{h(void 0)}},b=({id:x})=>{h(x)},v=c.map(x=>x.id??x._id);return Ur("div",{className:[lf,t&&`${lf}--appearance-${t}`].filter(Boolean).join(" "),children:c4(ur,{ids:v,onDragEnd:g,onDragStart:b,children:[c4("table",{cellPadding:"0",cellSpacing:"0",children:[Ur("thead",{children:Ur("tr",{children:p.map((x,y)=>Ur("th",{id:`heading-${x.accessor}`,children:x.Heading},y))})}),Ur("tbody",{children:c.map((x,y)=>Ur(Jr,{id:v[y],children:({attributes:C,isDragging:S,listeners:w,setNodeRef:F,transform:_,transition:A})=>Ur(Lb,{cellMap:d,className:`row-${y+1}`,columns:p,dragAttributes:C,dragListeners:w,ref:F,rowId:x.id??x._id,style:{opacity:S?0:1,transform:_,transition:A}})},v[y]))})]}),Ur(HM,{children:Ur(l4,{className:[lf,`${lf}--drag-preview`].join(" "),rowId:m,children:Ur(Lb,{cellMap:d,columns:p,rowId:m})})})]})})};import{jsx as u4}from"react/jsx-runtime";import{toWords as UM,transformColumnsToSearchParams as YM}from"payload/shared";import"react";var ZM="query-preset-columns-cell",JM=({cellData:t})=>u4("div",{className:ZM,children:t?YM(t).map((e,o)=>{let n=!e.startsWith("-");return n?u4(vt,{pillStyle:n?"always-white":"light",children:UM(e)},o):null}):"No columns selected"});import{jsx as qM}from"react/jsx-runtime";import{toWords as d4}from"payload/shared";import"react";var QM=t=>{if(t.or&&t.or.length>0&&t.or[0].and&&t.or[0].and.length>0){let o=t.or[0]?.and?.[0];if(!o)return"No where query";let n=Object.keys(o)[0];if(!o[n])return"No where query";let r=Object.keys(o[n])[0],s=o[n][r];return`${d4(n)} ${r} ${d4(s)}`}return""},KM=({cellData:t})=>qM("div",{children:t?QM(t):"No where query"});import{jsx as m4,jsxs as f4}from"react/jsx-runtime";import{toWords as p4}from"payload/shared";import{Fragment as eB}from"react";var tB=({cellData:t})=>{let e=["read","update","delete"];return m4("p",{children:e.reduce((o,n,r)=>{let s=t?.[n];return s&&s.constraint&&o.push(f4(eB,{children:[f4("span",{children:[m4("strong",{children:p4(n)}),": ",p4(s.constraint)]}),r!==e.length-1&&", "]},n)),o},[])})};import{c as oB}from"react/compiler-runtime";import{jsx as jb,jsxs as rB}from"react/jsx-runtime";import{toWords as nB,transformColumnsToSearchParams as sB}from"payload/shared";import"react";var iB=t=>{let e=oB(5),{field:o}=t,{label:n,required:r}=o,{path:s,value:i}=Ne(),l;return e[0]!==n||e[1]!==s||e[2]!==r||e[3]!==i?(l=rB("div",{className:"field-type query-preset-columns-field",children:[jb(ye,{as:"h3",label:n,path:s,required:r}),jb("div",{className:"value-wrapper",children:i?sB(i).map(aB):"No columns selected"})]}),e[0]=n,e[1]=s,e[2]=r,e[3]=i,e[4]=l):l=e[4],l};function aB(t,e){let o=!t.startsWith("-");return jb(vt,{pillStyle:o?"always-white":"light-gray",children:nB(t)},e)}import{jsx as jn,jsxs as cf}from"react/jsx-runtime";import{getTranslation as lB}from"@payloadcms/translations";import{toWords as h4}from"payload/shared";import g4 from"react";var cB=(t,e)=>{if(!t)return null;let o=r=>{let s=Object.keys(r)[0];if(!r[s])return"No where query";let i=Object.keys(r[s])[0],l=r[s][i];if(typeof l=="object")try{l=new Date(l).toLocaleDateString()}catch{l="Unknown error has occurred"}return cf(vt,{pillStyle:"always-white",children:[jn("b",{children:h4(s)})," ",i," ",jn("b",{children:h4(l)})]})};return((r,s)=>r.or&&r.or.length>0?jn("div",{className:"or-condition",children:r.or.map((i,l)=>jn(g4.Fragment,{children:i.and&&i.and.length>0?cf("div",{className:"and-condition",children:[l===0&&jn("span",{className:"label",children:`Filter ${s} where `}),l>0&&jn("span",{className:"label",children:" or "}),i.and.map((a,c)=>cf(g4.Fragment,{children:[o(a),c<i.and.length-1&&jn("span",{className:"label",children:" and "})]},c))]}):o(i)},l))}):o(r))(t,e)},uB=t=>{let{field:e}=t,{label:o,required:n}=e,{path:r,value:s}=Ne(),{collectionSlug:i}=_t(),{getEntityConfig:l}=W(),a=l({collectionSlug:i}),{i18n:c}=$();return cf("div",{className:"field-type query-preset-where-field",children:[jn(ye,{as:"h3",label:o,path:r,required:n}),jn("div",{className:"value-wrapper",children:s?cB(s,lB(a.labels.plural,c)):"No where query"})]})};import{c as bB}from"react/compiler-runtime";import{jsx as vB}from"react/jsx-runtime";import xB from"react";import{c as dB}from"react/compiler-runtime";import{useRouter as mB}from"next/navigation.js";import{useEffect as Ob,useRef as fB}from"react";function pB(t,...e){t&&t.addEventListener&&t.addEventListener(...e)}function hB(t,...e){t&&t.removeEventListener&&t.removeEventListener(...e)}var gB=(t,e)=>{let o=dB(7),n=t===void 0?!0:t,r;o[0]!==n||o[1]!==e?(r=a=>{if(typeof n!="function"||n())return a.preventDefault(),e&&(a.returnValue=e),e},o[0]=n,o[1]=e,o[2]=r):r=o[2];let s=r,i,l;o[3]!==n||o[4]!==s?(i=()=>{if(n)return pB(window,"beforeunload",s),()=>hB(window,"beforeunload",s)},l=[n,s],o[3]=n,o[4]=s,o[5]=i,o[6]=l):(i=o[5],l=o[6]),Ob(i,l)},b4=({hasAccepted:t=!1,message:e="Are you sure want to leave this page?",onAccept:o,onPrevent:n,prevent:r=!0})=>{gB(r,e);let{startRouteTransition:s}=st(),i=mB(),l=fB("");Ob(()=>{function a(d,f){let m=new URL(d),h=new URL(f);if(m.hostname===h.hostname&&m.pathname===h.pathname&&m.search===h.search){let p=m.hash,g=h.hash;return p!==g&&m.href.replace(p,"")===h.href.replace(g,"")}return!1}function c(d){for(;d&&d.tagName.toLowerCase()!=="a";)d=d.parentElement;return d}function u(d){try{let f=d.target,m=c(f);if(m){let h=window.location.href,p=m.href,g=a(h,p),b=m.download!=="",v=m.target==="_blank"||d.metaKey||d.ctrlKey;!(p===h||g||b||v)&&r&&(n||!window.confirm(e))&&(l.current=p,d.preventDefault(),d.stopPropagation(),typeof n=="function"&&n())}}catch(f){alert(f)}}return document.addEventListener("click",u,!0),()=>{document.removeEventListener("click",u,!0)}},[n,r,e]),Ob(()=>{t&&l.current&&(o&&o(),s(()=>i.push(l.current)))},[t,o,i,s])};var uf="leave-without-saving",Kc=()=>{let t=bB(15),{closeModal:e,openModal:o}=ue(),n=Ut(),{isValid:r}=Me(),{user:s}=De(),[i,l]=xB.useState(!1),{t:a}=$(),c=!!((n||!r)&&s),u;t[0]!==o?(u=()=>{o(uf)},t[0]=o,t[1]=u):u=t[1];let d=u,f;t[2]!==e?(f=()=>{e(uf)},t[2]=e,t[3]=f):f=t[3];let m=f,h;t[4]!==m||t[5]!==i||t[6]!==d||t[7]!==c?(h={hasAccepted:i,onAccept:m,onPrevent:d,prevent:c},t[4]=m,t[5]=i,t[6]=d,t[7]=c,t[8]=h):h=t[8],b4(h);let p;t[9]!==e?(p=()=>{e(uf)},t[9]=e,t[10]=p):p=t[10];let g=p,b;t[11]===Symbol.for("react.memo_cache_sentinel")?(b=()=>{l(!0)},t[11]=b):b=t[11];let v=b,x;return t[12]!==g||t[13]!==a?(x=vB(Rt,{body:a("general:changesNotSaved"),cancelLabel:a("general:stayOnThisPage"),confirmLabel:a("general:leaveAnyway"),heading:a("general:leaveWithoutSaving"),modalSlug:uf,onCancel:g,onConfirm:v}),t[12]=g,t[13]=a,t[14]=x):x=t[14],x};import{c as yB}from"react/compiler-runtime";import{jsx as eu,jsxs as Mb}from"react/jsx-runtime";import{useEffect as CB}from"react";var $a="document-take-over",df="document-take-over",Bb=t=>{let e=yB(17),{handleBackToDashboard:o,isActive:n,onReadOnly:r}=t,{closeModal:s,openModal:i}=ue(),{t:l}=$(),{startRouteTransition:a}=st(),c,u;e[0]!==s||e[1]!==n||e[2]!==i?(c=()=>{n?i($a):s($a)},u=[n,i,s],e[0]=s,e[1]=n,e[2]=i,e[3]=c,e[4]=u):(c=e[3],u=e[4]),CB(c,u);let d;if(e[5]!==s||e[6]!==o||e[7]!==r||e[8]!==a||e[9]!==l){let f;e[11]!==o||e[12]!==a?(f=()=>{a(()=>o())},e[11]=o,e[12]=a,e[13]=f):f=e[13];let m;e[14]!==s||e[15]!==r?(m=()=>{r(),s($a)},e[14]=s,e[15]=r,e[16]=m):m=e[16],d=eu(Zo,{className:df,slug:$a,children:Mb("div",{className:`${df}__wrapper`,children:[Mb("div",{className:`${df}__content`,children:[eu("h1",{children:l("general:editingTakenOver")}),eu("p",{children:l("general:anotherUserTakenOver")})]}),Mb("div",{className:`${df}__controls`,children:[eu(se,{buttonStyle:"primary",id:`${$a}-back-to-dashboard`,onClick:f,size:"large",children:l("general:backToDashboard")}),eu(se,{buttonStyle:"secondary",id:`${$a}-view-read-only`,onClick:m,size:"large",children:l("general:viewReadOnly")})]})]})}),e[5]=s,e[6]=o,e[7]=r,e[8]=a,e[9]=l,e[10]=d}else d=e[10];return d};import{c as wB}from"react/compiler-runtime";import{jsx as Si,jsxs as tu}from"react/jsx-runtime";import{useEffect as SB}from"react";var mf=t=>t&&typeof t=="object";var Ss="document-locked",ff="document-locked",IB=t=>t?new Intl.DateTimeFormat("en-US",{day:"numeric",hour:"numeric",hour12:!0,minute:"numeric",month:"short",year:"numeric"}).format(t):"",Vb=t=>{let e=wB(30),{handleGoBack:o,isActive:n,onReadOnly:r,onTakeOver:s,updatedAt:i,user:l}=t,{closeModal:a,openModal:c}=ue(),{t:u}=$(),{startRouteTransition:d}=st(),f,m;e[0]!==a||e[1]!==n||e[2]!==c?(f=()=>{n?c(Ss):a(Ss)},m=[n,c,a],e[0]=a,e[1]=n,e[2]=c,e[3]=f,e[4]=m):(f=e[3],m=e[4]),SB(f,m);let h;e[5]!==o||e[6]!==d?(h=()=>{d(()=>o())},e[5]=o,e[6]=d,e[7]=h):h=e[7];let p;if(e[8]!==a||e[9]!==o||e[10]!==r||e[11]!==s||e[12]!==d||e[13]!==u||e[14]!==h||e[15]!==i||e[16]!==l){let g;e[18]!==u||e[19]!==l?(g=mf(l)?l.email??l.id:`${u("general:user")}: ${l}`,e[18]=u,e[19]=l,e[20]=g):g=e[20];let b;e[21]!==o||e[22]!==d?(b=()=>{d(()=>o())},e[21]=o,e[22]=d,e[23]=b):b=e[23];let v;e[24]!==a||e[25]!==r?(v=()=>{r(),a(Ss)},e[24]=a,e[25]=r,e[26]=v):v=e[26];let x;e[27]!==a||e[28]!==s?(x=()=>{s(),a(Ss)},e[27]=a,e[28]=s,e[29]=x):x=e[29],p=Si(Zo,{className:ff,onClose:h,slug:Ss,children:tu("div",{className:`${ff}__wrapper`,children:[tu("div",{className:`${ff}__content`,children:[Si("h1",{children:u("general:documentLocked")}),tu("p",{children:[Si("strong",{children:g})," ",u("general:currentlyEditing")]}),tu("p",{children:[u("general:editedSince")," ",Si("strong",{children:IB(i)})]})]}),tu("div",{className:`${ff}__controls`,children:[Si(se,{buttonStyle:"secondary",id:`${Ss}-go-back`,onClick:b,size:"large",children:u("general:goBack")}),Si(se,{buttonStyle:"secondary",id:`${Ss}-view-read-only`,onClick:v,size:"large",children:u("general:viewReadOnly")}),Si(se,{buttonStyle:"primary",id:`${Ss}-take-over`,onClick:x,size:"large",children:u("general:takeOver")})]})]})}),e[8]=a,e[9]=o,e[10]=r,e[11]=s,e[12]=d,e[13]=u,e[14]=h,e[15]=i,e[16]=l,e[17]=p}else p=e[17];return p};import{jsx as pf}from"react/jsx-runtime";import"react";var v4=({elements:t,translationString:e})=>{let o=/(<[^>]+>.*?<\/[^>]+>)/g,n=e.split(o);return pf("span",{children:n.map((r,s)=>{if(t&&r.startsWith("<")&&r.endsWith(">")){let i=r[1],l=t[i];if(l){let a=new RegExp(`<${i}>(.*?)</${i}>`,"g"),c=r.replace(a,(u,d)=>d);return pf(l,{children:pf(v4,{translationString:c})},s)}}return r})})},Ii=({elements:t,i18nKey:e,t:o,variables:n})=>{let r=o(e,n||{});return t?pf(v4,{elements:t,translationString:r}):r};import{c as RB}from"react/compiler-runtime";import{jsx as _B}from"react/jsx-runtime";import{getTranslation as DB}from"@payloadcms/translations";import jFe from"react";function Gb(t){let e=RB(3),{i18n:o}=$(),{description:n}=t;if(n){let r;return e[0]!==n||e[1]!==o?(r=_B("div",{className:"custom-view-description",children:DB(n,o)}),e[0]=n,e[1]=o,e[2]=r):r=e[2],r}return null}import{jsx as zo,jsxs as xf}from"react/jsx-runtime";import{formatAdminURL as m7}from"payload/shared";import{useEffect as f7,useRef as p7,useState as h7}from"react";import{c as PB}from"react/compiler-runtime";import{jsx as T4}from"react/jsx-runtime";import{usePathname as NB}from"next/navigation.js";import{formatAdminURL as LB}from"payload/shared";import"react";import{jsx as Wb,jsxs as FB}from"react/jsx-runtime";import"react";var ou="graphic-account",x4=t=>FB("svg",{className:[ou,t?.active&&`${ou}--active`].filter(Boolean).join(" "),height:"25",viewBox:"0 0 25 25",width:"25",xmlns:"http://www.w3.org/2000/svg",children:[Wb("circle",{className:`${ou}__bg`,cx:"12.5",cy:"12.5",r:"11.5"}),Wb("circle",{className:`${ou}__head`,cx:"12.5",cy:"10.73",r:"3.98"}),Wb("path",{className:`${ou}__body`,d:"M12.5,24a11.44,11.44,0,0,0,7.66-2.94c-.5-2.71-3.73-4.8-7.66-4.8s-7.16,2.09-7.66,4.8A11.44,11.44,0,0,0,12.5,24Z"})]});var F4=As(D4(),1);import{c as TB}from"react/compiler-runtime";import{jsx as EB}from"react/jsx-runtime";import"react";var A4=()=>{let t=TB(2),{user:e}=De(),o=(0,F4.default)(e.email.trim().toLowerCase()),r=`?${new URLSearchParams({default:"mp",r:"g",s:"50"}).toString()}`,s=`https://www.gravatar.com/avatar/${o}?${r}`,i;return t[0]!==s?(i=EB("img",{alt:"yas",className:"gravatar-account",height:25,src:s,style:{borderRadius:"50%"},width:25}),t[0]=s,t[1]=i):i=t[1],i};var Xb=()=>{let t=PB(3),{config:e}=W(),{admin:o,routes:n}=e,{avatar:r,routes:s}=o,{account:i}=s,{admin:l}=n,{user:a}=De(),u=NB()===LB({adminRoute:l,path:i});if(!a?.email||r==="default"){let d;return t[0]!==u?(d=T4(x4,{active:u}),t[0]=u,t[1]=d):d=t[1],d}if(r==="gravatar"){let d;return t[2]===Symbol.for("react.memo_cache_sentinel")?(d=T4(A4,{}),t[2]=d):d=t[2],d}};import{c as $B}from"react/compiler-runtime";import{jsx as kB}from"react/jsx-runtime";import{createContext as jB,use as OB,useState as MB}from"react";var E4=jB({Actions:{},setViewActions:()=>{}}),Ub=()=>OB(E4),BB=t=>{let e=$B(4),{Actions:o,children:n}=t,[r,s]=MB(o),i;return e[0]!==o||e[1]!==n||e[2]!==r?(i=kB(E4,{value:{Actions:{...r,...o},setViewActions:s},children:n}),e[0]=o,e[1]=n,e[2]=r,e[3]=i):i=e[3],i};import{c as VB}from"react/compiler-runtime";import{jsx as hf,jsxs as L4}from"react/jsx-runtime";import"react";import{jsx as P4}from"react/jsx-runtime";import"react";var Yb=()=>P4("svg",{className:"icon icon--close-menu",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:P4("path",{className:"stroke",d:"M14 6L6 14M6 6L14 14",strokeLinecap:"square"})});import{jsx as N4}from"react/jsx-runtime";import"react";var Zb=()=>N4("svg",{className:"icon icon--menu",fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:N4("path",{className:"stroke",d:"M4.66667 10H15.3333M4.66667 6H15.3333M4.66667 14H15.3333",strokeLinecap:"square"})});var Jb="hamburger",qb=t=>{let e=VB(4),{t:o}=$(),{closeIcon:n,isActive:r}=t,s=n===void 0?"x":n,i=r===void 0?!1:r,l;return e[0]!==s||e[1]!==i||e[2]!==o?(l=L4("div",{className:Jb,children:[!i&&hf("div",{"aria-label":o("general:open"),className:`${Jb}__open-icon`,title:o("general:open"),children:hf(Zb,{})}),i&&L4("div",{"aria-label":o(s==="collapse"?"general:collapse":"general:close"),className:`${Jb}__close-icon`,title:o(s==="collapse"?"general:collapse":"general:close"),children:[s==="x"&&hf(Yb,{}),s==="collapse"&&hf(Ze,{direction:"left"})]})]}),e[0]=s,e[1]=i,e[2]=o,e[3]=l):l=e[3],l};import{c as HB}from"react/compiler-runtime";import{jsx as Ri,jsxs as zB}from"react/jsx-runtime";import{getTranslation as XB}from"@payloadcms/translations";import{useRouter as UB}from"next/navigation.js";import*as bf from"qs-esm";import{Fragment as YB}from"react";import{c as GB}from"react/compiler-runtime";import{jsx as $4,jsxs as Qb}from"react/jsx-runtime";import{getTranslation as WB}from"@payloadcms/translations";import"react";var ru="localizer-button",gf=t=>{let e=GB(12),{ariaLabel:o,className:n}=t,r=$e(),{i18n:s,t:i}=$(),l;e[0]!==o||e[1]!==i?(l=o||i("general:locale"),e[0]=o,e[1]=i,e[2]=l):l=e[2];let a;e[3]!==n?(a=[ru,n].filter(Boolean),e[3]=n,e[4]=a):a=e[4];let c=a.join(" "),u=r?r.code:void 0,d=`${i("general:locale")}:`,f;return e[5]!==s||e[6]!==r.label||e[7]!==l||e[8]!==c||e[9]!==u||e[10]!==d?(f=Qb("div",{"aria-label":l,className:c,"data-locale":u,children:[Qb("div",{className:`${ru}__label`,children:[d,"\xA0"]}),Qb("div",{className:`${ru}__current`,children:[$4("span",{className:`${ru}__current-label`,children:`${WB(r.label,s)}`}),$4(Ze,{className:`${ru}__chevron`})]})]}),e[5]=s,e[6]=r.label,e[7]=l,e[8]=c,e[9]=u,e[10]=d,e[11]=f):f=e[11],f};var Kb="localizer",k4=t=>{let e=HB(17),{className:o}=t,{config:n}=W(),{localization:r}=n,s=UB(),{startRouteTransition:i}=st(),{setLocaleIsLoading:l}=dd(),{i18n:a}=$(),c=$e();if(r){let{locales:u}=r,d;e[0]!==o?(d=[Kb,o].filter(Boolean),e[0]=o,e[1]=d):d=e[1];let f=d.join(" "),m;if(e[2]!==a||e[3]!==c||e[4]!==u||e[5]!==s||e[6]!==l||e[7]!==i||e[8]!==f){let h;e[10]!==a||e[11]!==c||e[12]!==u||e[13]!==s||e[14]!==l||e[15]!==i?(h=p=>{let{close:g}=p;return Ri(Be.ButtonGroup,{children:u.map(b=>{let v=XB(b.label,a);return Ri(Be.Button,{active:c.code===b.code,disabled:c.code===b.code,onClick:()=>{l(!0),g();let x=new URLSearchParams(window.location.search),y=bf.stringify({...bf.parse(x.toString(),{depth:10,ignoreQueryPrefix:!0}),locale:b.code},{addQueryPrefix:!0});i(()=>{s.push(y)})},children:v!==b.code?zB(YB,{children:[v,"\xA0",Ri("span",{className:`${Kb}__locale-code`,"data-locale":b.code,children:`(${b.code})`})]}):Ri("span",{className:`${Kb}__locale-code`,"data-locale":b.code,children:v})},b.code)})})},e[10]=a,e[11]=c,e[12]=u,e[13]=s,e[14]=l,e[15]=i,e[16]=h):h=e[16],m=Ri("div",{className:f,children:Ri(ho,{button:Ri(gf,{}),horizontalAlign:"right",render:h,showScrollbar:!0,size:"large"})}),e[2]=a,e[3]=c,e[4]=u,e[5]=s,e[6]=l,e[7]=i,e[8]=f,e[9]=m}else m=e[9];return m}return null};import{jsx as ZB}from"react/jsx-runtime";import{usePathname as JB}from"next/navigation.js";import su,{useEffect as nu,useRef as qB}from"react";var j4=su.createContext({hydrated:!1,navOpen:!0,navRef:null,setNavOpen:()=>{},shouldAnimate:!1}),_i=()=>su.use(j4),QB=async t=>{let o=(await t("nav"))?.open;return typeof o=="boolean"?o:!0},O4=({children:t,initialIsOpen:e})=>{let{breakpoints:{l:o,m:n,s:r}}=Co(),s=JB(),{getPreference:i}=Ao(),l=qB(null),[a,c]=su.useState(e),[u,d]=su.useState(!1),[f,m]=su.useState(!1);return nu(()=>{o===!1&&(async()=>{let p=await QB(i);c(p)})()},[o,i,c]),nu(()=>{r===!0&&c(!1)},[s]),nu(()=>{l.current&&(a&&n?l.current.style.overscrollBehavior="contain":l.current.style.overscrollBehavior="auto")},[a,n]),nu(()=>{(o===!0||n===!0||r===!0)&&c(!1),m(!0),setTimeout(()=>{d(!0)},100)},[o,n,r]),nu(()=>()=>{l.current&&(l.current.style.overscrollBehavior="auto")},[]),ZB(j4,{value:{hydrated:f,navOpen:a,navRef:l,setNavOpen:c,shouldAnimate:u},children:t})};import{c as KB}from"react/compiler-runtime";import{jsx as e7}from"react/jsx-runtime";import"react";var M4="nav-toggler",e1=t=>{let e=KB(15),{id:o,children:n,className:r,tabIndex:s}=t,i=s===void 0?0:s,{t:l}=$(),{setPreference:a}=Ao(),{navOpen:c,setNavOpen:u}=_i(),{breakpoints:d}=Co(),{l:f}=d,m=`${l(c?"general:close":"general:open")} ${l("general:menu")}`,h=c&&`${M4}--is-open`,p;e[0]!==r||e[1]!==h?(p=[M4,h,r].filter(Boolean),e[0]=r,e[1]=h,e[2]=p):p=e[2];let g=p.join(" "),b;e[3]!==f||e[4]!==c||e[5]!==u||e[6]!==a?(b=async()=>{u(!c),f||await a("nav",{open:!c},!0)},e[3]=f,e[4]=c,e[5]=u,e[6]=a,e[7]=b):b=e[7];let v;return e[8]!==n||e[9]!==o||e[10]!==m||e[11]!==g||e[12]!==b||e[13]!==i?(v=e7("button",{"aria-label":m,className:g,id:o,onClick:b,tabIndex:i,type:"button",children:n}),e[8]=n,e[9]=o,e[10]=m,e[11]=g,e[12]=b,e[13]=i,e[14]=v):v=e[14],v};import{c as u7}from"react/compiler-runtime";import{jsx as Ro,jsxs as G4}from"react/jsx-runtime";import{getTranslation as d7}from"@payloadcms/translations";import{Fragment as W4}from"react";import{jsx as B4,jsxs as t7}from"react/jsx-runtime";import"react";var vf=({fill:t})=>{let e=t||"var(--theme-elevation-1000)";return t7("svg",{className:"graphic-icon",height:"100%",viewBox:"0 0 25 25",width:"100%",xmlns:"http://www.w3.org/2000/svg",children:[B4("path",{d:"M11.8673 21.2336L4.40922 16.9845C4.31871 16.9309 4.25837 16.8355 4.25837 16.7282V10.1609C4.25837 10.0477 4.38508 9.97616 4.48162 10.0298L13.1404 14.9642C13.2611 15.0358 13.412 14.9464 13.412 14.8093V11.6091C13.412 11.4839 13.3456 11.3647 13.2309 11.2992L2.81624 5.36353C2.72573 5.30989 2.60505 5.30989 2.51454 5.36353L1.15085 6.14422C1.06034 6.19786 1 6.29321 1 6.40048V18.5995C1 18.7068 1.06034 18.8021 1.15085 18.8558L11.8491 24.9583C11.9397 25.0119 12.0603 25.0119 12.1509 24.9583L21.1355 19.8331C21.2562 19.7616 21.2562 19.5948 21.1355 19.5232L18.3357 17.9261C18.2211 17.8605 18.0883 17.8605 17.9737 17.9261L12.175 21.2336C12.0845 21.2872 11.9638 21.2872 11.8733 21.2336H11.8673Z",fill:e}),B4("path",{d:"M22.8491 6.13827L12.1508 0.0417218C12.0603 -0.0119135 11.9397 -0.0119135 11.8491 0.0417218L6.19528 3.2658C6.0746 3.33731 6.0746 3.50418 6.19528 3.57569L8.97092 5.16091C9.08557 5.22647 9.21832 5.22647 9.33296 5.16091L11.8672 3.71872C11.9578 3.66508 12.0784 3.66508 12.1689 3.71872L19.627 7.96782C19.7175 8.02146 19.7778 8.11681 19.7778 8.22408V14.8212C19.7778 14.9464 19.8442 15.0656 19.9589 15.1311L22.7345 16.7104C22.8552 16.7819 23.006 16.6925 23.006 16.5554V6.40048C23.006 6.29321 22.9457 6.19786 22.8552 6.14423L22.8491 6.13827Z",fill:e})]})};import{c as o7}from"react/compiler-runtime";import{jsx as r7}from"react/jsx-runtime";import{createContext as n7,use as s7,useState as i7}from"react";var On=()=>s7(V4),V4=n7({}),t1=t=>{let e=o7(4),{children:o}=t,n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n=[],e[0]=n):n=e[0];let[r,s]=i7(n),i;return e[1]!==o||e[2]!==r?(i=r7(V4,{value:{setStepNav:s,stepNav:r},children:o}),e[1]=o,e[2]=r,e[3]=i):i=e[3],i};import{c as a7}from"react/compiler-runtime";import{useEffect as l7}from"react";var c7=t=>{let e=a7(4),{nav:o}=t,{setStepNav:n}=On(),r,s;return e[0]!==o||e[1]!==n?(r=()=>{n(o)},s=[n,o],e[0]=o,e[1]=n,e[2]=r,e[3]=s):(r=e[2],s=e[3]),l7(r,s),null};var iu="step-nav",H4=t=>{let e=u7(7),{className:o,CustomIcon:n}=t,{i18n:r}=$(),{stepNav:s}=On(),{config:i}=W(),{routes:l}=i,{admin:a}=l,{t:c}=$(),u;return e[0]!==n||e[1]!==a||e[2]!==o||e[3]!==r||e[4]!==s||e[5]!==c?(u=Ro(W4,{children:s.length>0?G4("nav",{className:[iu,o].filter(Boolean).join(" "),children:[Ro(Yt,{className:`${iu}__home`,href:a,prefetch:!1,tabIndex:0,children:Ro("span",{title:c("general:dashboard"),children:Ro(oe,{CustomComponent:n,Fallback:Ro(vf,{})})})}),Ro("span",{children:"/"}),s.map((d,f)=>{let m=d7(d.label,r);return s.length===f+1?Ro("span",{className:`${iu}__last`,children:m},f):G4(W4,{children:[d.url?Ro(Yt,{href:d.url,prefetch:!1,children:Ro("span",{children:m},f)}):Ro("span",{children:m},f),Ro("span",{children:"/"})]},f)})]}):Ro("div",{className:[iu,o].filter(Boolean).join(" "),children:Ro("div",{className:`${iu}__home`,children:Ro("span",{title:c("general:dashboard"),children:Ro(oe,{CustomComponent:n,Fallback:Ro(vf,{})})})})})}),e[0]=n,e[1]=a,e[2]=o,e[3]=r,e[4]=s,e[5]=c,e[6]=u):u=e[6],u};var _o="app-header";function g7({CustomAvatar:t,CustomIcon:e}){let{t:o}=$(),{Actions:n}=Ub(),{config:{admin:{routes:{account:r}},localization:s,routes:{admin:i}}}=W(),{navOpen:l}=_i(),a=p7(null),[c,u]=h7(!1);f7(()=>{let f=()=>{let m=a.current;if(m){let h=m.scrollWidth>m.clientWidth;u(h)}};return f(),window.addEventListener("resize",f),()=>{window.removeEventListener("resize",f)}},[n]);let d=n?Object.values(n):[];return xf("header",{className:[_o,l&&`${_o}--nav-open`].filter(Boolean).join(" "),children:[zo("div",{className:`${_o}__bg`}),zo("div",{className:`${_o}__content`,children:xf("div",{className:`${_o}__wrapper`,children:[zo(e1,{className:`${_o}__mobile-nav-toggler`,tabIndex:-1,children:zo(qb,{})}),xf("div",{className:`${_o}__controls-wrapper`,children:[zo("div",{className:`${_o}__step-nav-wrapper`,children:zo(H4,{className:`${_o}__step-nav`,CustomIcon:e})}),xf("div",{className:`${_o}__actions-wrapper`,children:[zo("div",{className:`${_o}__actions`,ref:a,children:d.map((f,m)=>zo("div",{className:c&&m===d.length-1?`${_o}__last-action`:"",children:f},m))}),c&&zo("div",{className:`${_o}__gradient-placeholder`})]}),s&&zo(gf,{ariaLabel:"invisible",className:`${_o}__localizer-spacing`}),zo(Yt,{"aria-label":o("authentication:account"),className:`${_o}__account`,href:m7({adminRoute:i,path:r}),prefetch:!1,tabIndex:0,children:zo(oe,{CustomComponent:t,Fallback:zo(Xb,{})})})]})]})}),zo(k4,{className:`${_o}__localizer`})]})}import{jsx as o1,jsxs as b7}from"react/jsx-runtime";import"react";var au="card",v7=t=>{let{id:e,actions:o,buttonAriaLabel:n,href:r,onClick:s,title:i,titleAs:l}=t,a=[au,e,(s||r)&&`${au}--has-onclick`].filter(Boolean).join(" ");return b7("div",{className:a,id:e,children:[o1(l??"div",{className:`${au}__title`,children:i}),o&&o1("div",{className:`${au}__actions`,children:o}),(s||r)&&o1(se,{"aria-label":n,buttonStyle:"none",className:`${au}__click`,el:"link",onClick:s,to:r})]})};import{c as x7}from"react/compiler-runtime";import{jsx as Is,jsxs as yf}from"react/jsx-runtime";import{getTranslation as y7}from"@payloadcms/translations";import{useRouter as C7}from"next/navigation.js";import ka from"react";var Cf="copy-locale-data",wf="copy-locale",r1=()=>{let t=x7(38),{config:e}=W(),{localization:o,routes:n,serverURL:r}=e,{admin:s}=n,{code:i}=$e(),{id:l,collectionSlug:a,globalSlug:c}=Pe(),{i18n:u,t:d}=$(),f=Ut(),{toggleModal:m}=ue(),{copyDataFromLocale:h}=Ft(),p=C7(),{startRouteTransition:g}=st(),b;t[0]!==o?(b=o&&o.locales.map(w7)||[],t[0]=o,t[1]=b):b=t[1];let v=b,x;t[2]!==i?(x=G=>G.value!==i,t[2]=i,t[3]=x):x=t[3];let y=v.filter(x),C;t[4]!==u||t[5]!==o?(C=G=>{let z=o&&o.locales.find(X=>X.code===G);return z&&z.label?y7(z.label,u):G},t[4]=u,t[5]=o,t[6]=C):C=t[6];let S=C,[w,F]=ka.useState(!1),[_,A]=ka.useState(null),[R,I]=ka.useState(i),[D,E]=ka.useState(!1),T,L;t[7]!==i||t[8]!==R?(T=()=>{R!==i&&I(i)},L=[i,R],t[7]=i,t[8]=R,t[9]=T,t[10]=L):(T=t[9],L=t[10]),ka.useEffect(T,L);let k;t[11]!==s||t[12]!==a||t[13]!==h||t[14]!==c||t[15]!==l||t[16]!==D||t[17]!==p||t[18]!==r||t[19]!==g||t[20]!==m?(k=async G=>{let{from:z,to:X}=G;F(!0);try{await h({collectionSlug:a,docID:l,fromLocale:z,globalSlug:c,overrideData:D,toLocale:X}),F(!1),g(()=>p.push(`${r}${s}/${a?`collections/${a}/${l}`:`globals/${c}`}?locale=${X}`)),m(wf)}catch(te){let Y=te;me.error(Y.message)}},t[11]=s,t[12]=a,t[13]=h,t[14]=c,t[15]=l,t[16]=D,t[17]=p,t[18]=r,t[19]=g,t[20]=m,t[21]=k):k=t[21];let j=k;if(!l&&!c)return null;let P;t[22]!==f||t[23]!==d||t[24]!==m?(P=()=>{f?me.info(d("general:unsavedChanges")):m(wf)},t[22]=f,t[23]=d,t[24]=m,t[25]=P):P=t[25];let N;t[26]!==m?(N=()=>{m(wf)},t[26]=m,t[27]=N):N=t[27];let B;t[28]!==j||t[29]!==w||t[30]!==R||t[31]!==d||t[32]!==_?(B=async()=>{if(R===_){me.error(d("localization:cannotCopySameLocale"));return}w||await j({from:R,to:_})},t[28]=j,t[29]=w,t[30]=R,t[31]=d,t[32]=_,t[33]=B):B=t[33];let M;t[34]===Symbol.for("react.memo_cache_sentinel")?(M=G=>{G?.value&&I(G.value)},t[34]=M):M=t[34];let O;t[35]===Symbol.for("react.memo_cache_sentinel")?(O=G=>{G?.value&&A(G.value)},t[35]=O):O=t[35];let V;return t[36]!==D?(V=()=>E(!D),t[36]=D,t[37]=V):V=t[37],yf(ka.Fragment,{children:[Is(Be.Button,{id:`${Cf}__button`,onClick:P,children:d("localization:copyToLocale")}),yf(Lt,{className:Cf,gutter:!1,Header:Is(Ra,{onClose:N,title:d("localization:copyToLocale")}),slug:wf,children:[yf("div",{className:`${Cf}__sub-header`,children:[Is("span",{children:R&&_?Is("div",{children:d("localization:copyFromTo",{from:S(R),to:S(_)})}):d("localization:selectLocaleToCopy")}),Is(se,{buttonStyle:"primary",disabled:!R||!_,iconPosition:"left",onClick:B,size:"medium",children:w?d("general:copying")+"...":d("general:copy")})]}),yf("div",{className:`${Cf}__content`,children:[Is(Ca,{label:d("localization:copyFrom"),name:"fromLocale",onChange:M,options:v,path:"fromLocale",readOnly:!0,value:R}),Is(Ca,{label:d("localization:copyTo"),name:"toLocale",onChange:O,options:y,path:"toLocale",value:_}),Is(fr,{checked:D,field:{name:"overwriteExisting",label:d("general:overwriteExistingData")},onChange:V,path:"overwriteExisting"})]})]})]})};function w7(t){return{label:t.label,value:t.code}}import{jsx as Z4,jsxs as $7}from"react/jsx-runtime";import{getTranslation as J4}from"@payloadcms/translations";import{useRouter as k7,useSearchParams as j7}from"next/navigation.js";import{mergeListSearchAndWhere as O7}from"payload/shared";import*as Q4 from"qs-esm";import M7,{useCallback as q4}from"react";import{c as S7}from"react/compiler-runtime";import{jsx as I7}from"react/jsx-runtime";import{usePathname as R7,useRouter as _7}from"next/navigation.js";import{createContext as D7,use as F7,useEffect as A7}from"react";var z4=D7({clearRouteCache:()=>{}}),n1=t=>{let e=S7(10),{children:o}=t,n=R7(),r=_7(),s;e[0]!==r?(s=()=>{r.refresh()},e[0]=r,e[1]=s):s=e[1];let i=s,l;e[2]!==i?(l=()=>{i()},e[2]=i,e[3]=l):l=e[3];let a;e[4]!==i||e[5]!==n?(a=[n,i],e[4]=i,e[5]=n,e[6]=a):a=e[6],A7(l,a);let c;return e[7]!==o||e[8]!==i?(c=I7(z4,{value:{clearRouteCache:i},children:o}),e[7]=o,e[8]=i,e[9]=c):c=e[9],c},Mn=()=>F7(z4);import{jsx as T7}from"react/jsx-runtime";import{useSearchParams as E7}from"next/navigation.js";import*as U4 from"qs-esm";import{createContext as P7,use as N7,useCallback as s1,useEffect as X4,useRef as L7,useState as i1}from"react";var xo=function(t){return t.AllAvailable="allAvailable",t.AllInPage="allInPage",t.None="none",t.Some="some",t}({}),Y4=P7({}),a1=({children:t,docs:e=[],totalDocs:o,user:n})=>{let r=L7({}),{code:s}=$e(),[i,l]=i1(()=>{let g=new Map;return e.forEach(({id:b})=>{g.set(b,!1)}),g}),[a,c]=i1("none"),[u,d]=i1(0),f=E7(),m=s1((g=!1)=>{let b=new Map;g?(c("allAvailable"),e.forEach(({id:v,_isLocked:x,_userEditing:y})=>{(!x||y?.id===n?.id)&&b.set(v,!0)})):a==="allAvailable"||a==="allInPage"?c("none"):e.forEach(({id:v,_isLocked:x,_userEditing:y})=>{(!x||y?.id===n?.id)&&b.set(v,a!=="some")}),l(b)},[e,a,n?.id]),h=s1(g=>{let b=e.find(C=>C.id===g);if(b?._isLocked&&n?.id!==b?._userEditing.id)return;let v=i.get(g),x=typeof v=="boolean"?!v:!0,y=new Map(i.set(g,x));a==="allAvailable"&&!x&&c("some"),l(y)},[i,e,a,n?.id]),p=s1(g=>{let b;if(a==="allAvailable")b=jr(f)?.where||{id:{not_equals:""}};else{let v=[];for(let[x,y]of i)y&&v.push(x);b={id:{in:v}}}return g&&(b={and:[{...g},b]}),U4.stringify({locale:s,where:b},{addQueryPrefix:!0})},[a,i,s,f]);return X4(()=>{if(a==="allAvailable")return;let g=!1,b=!0;if(!i.size)b=!1,g=!1;else for(let[v,x]of i)b=b&&x,g=g||x;b&&i.size===e.length?c("allInPage"):c(g?"some":"none")},[a,i,o,e]),X4(()=>{let g=0;if(a==="allAvailable")g=o;else for(let[b,v]of i)v&&g++;d(g)},[a,i,o]),r.current={count:u,getQueryParams:p,selectAll:a,selected:i,setSelection:h,toggleAll:m,totalDocs:o},T7(Y4,{value:r.current,children:t})},ro=()=>N7(Y4);var B7="delete-documents",l1=t=>{let{collection:e,collection:{slug:o,labels:{plural:n,singular:r}}={}}=t,{permissions:s}=De(),{config:{routes:{api:i},serverURL:l}}=W(),{openModal:a}=ue(),{count:c,getQueryParams:u,selectAll:d,toggleAll:f}=ro(),{i18n:m,t:h}=$(),p=k7(),g=j7(),{clearRouteCache:b}=Mn(),x=s?.collections?.[o]?.delete,y=`delete-${o}`,C=q4(()=>{me.error(h("error:unknown"))},[h]),S=q4(async()=>{let w=O7({collectionConfig:e,search:g.get("search")}),F=u(w);await Ke.delete(`${l}${i}/${o}${F}`,{headers:{"Accept-Language":m.language,"Content-Type":"application/json"}}).then(async _=>{try{let A=await _.json(),R=A?.docs.length||0,I=R>1?n:r;if(_.status<400||R>0)return me.success(h("general:deletedCountSuccessfully",{count:R,label:J4(I,m)})),A?.errors.length>0&&me.error(A.message,{description:A.errors.map(D=>D.message).join(`
55
+ `)}),f(),p.replace(Q4.stringify({page:d?"1":void 0},{addQueryPrefix:!0})),b(),null;if(A.errors)me.error(A.message,{description:A.errors.map(D=>D.message).join(`
56
+ `)});else return C();return!1}catch{return C()}})},[g,C,i,u,m,n,p,d,l,r,o,h,f,b,e]);return d===xo.None||!x?null:$7(M7.Fragment,{children:[Z4("button",{className:`${B7}__toggle`,onClick:()=>{a(y)},type:"button",children:h("general:delete")}),Z4(Rt,{body:h("general:aboutToDeleteCount",{count:c,label:J4(c>1?n:r,m)}),confirmingLabel:h("general:deleting"),heading:h("general:confirmDeletion"),modalSlug:y,onConfirm:S})]})};import{c as R8}from"react/compiler-runtime";import{jsx as at,jsxs as $o}from"react/jsx-runtime";import{getTranslation as _8}from"@payloadcms/translations";import{formatAdminURL as D8}from"payload/shared";import g1,{Fragment as cu,useEffect as F8}from"react";import{jsx as eR,jsxs as G7}from"react/jsx-runtime";import{dequal as W7}from"dequal/lite";import{reduceFieldsToValues as tR,versionDefaults as H7}from"payload/shared";import z7,{useDeferredValue as X7,useEffect as oR,useRef as Di,useState as U7}from"react";import{unflatten as V7}from"payload/shared";var K4=(t,e,o)=>{let n={data:{},valid:!0};return t&&(Object.keys(t).forEach(r=>{(o===!0||!t[r]?.disableFormData)&&(n.data[r]=t[r]?.value,t[r].valid||(n.valid=!1))}),e&&(n.data=V7(n.data))),n};var Y7="autosave",rR=1e3,nR=({id:t,collection:e,global:o})=>{let{config:{routes:{api:n},serverURL:r}}=W(),{docConfig:s,incrementVersionCount:i,lastUpdateTime:l,mostRecentVersionIsAutosaved:a,setLastUpdateTime:c,setMostRecentVersionIsAutosaved:u,setUnpublishedVersionCount:d,updateSavedDocumentData:f}=Pe(),{reportUpdate:m}=hi(),{dispatchFields:h,isValid:p,setBackgroundProcessing:g,setIsValid:b,setSubmitted:v}=Me(),[x]=$i(),y=Ut(),C=Xt(),{code:S}=$e(),{i18n:w,t:F}=$(),_=s?.versions,A=H7.autosaveInterval;_.drafts&&_.drafts.autosave&&(A=_.drafts.autosave.interval);let R=!!(s?.versions?.drafts&&s?.versions?.drafts.validate),[I,D]=U7(!1),E=X7(I),T=qo(x,A),L=Di(x),k=Di(y),j=Di(S),P=Di(p);L.current=x,k.current=y,j.current=S;let{queueTask:N}=$m(),B=Di(null),M=to(()=>{B.current=void 0;let z,X,te=()=>{X-z<rR?B.current=setTimeout(()=>{D(!1)},rR-(X-z)):G()};N(async()=>{if(y){z=new Date().getTime(),D(!0);let Y,H,le;if(e&&t&&(le=e.slug,Y=`${r}${n}/${le}/${t}?draft=true&autosave=true&locale=${j.current}`,H="PATCH"),o&&(le=o.slug,Y=`${r}${n}/globals/${le}?draft=true&autosave=true&locale=${j.current}`,H="POST"),Y&&k.current){let{data:q,valid:fe}=K4(L.current,!0);if(q._status="draft",!(C&&!fe&&_?.drafts&&_?.drafts?.validate)&&P.current){let J;try{J=await fetch(Y,{body:JSON.stringify(q),credentials:"include",headers:{"Accept-Language":w.language,"Content-Type":"application/json"},method:H})}catch{}let ge=new Date;X=ge.getTime(),J.status===200&&(c(ge.getTime()),m({id:t,entitySlug:le,updatedAt:ge.toISOString()}),a||(i(),u(!0),d(he=>he+1)));let Ce=await J.json();if(_?.drafts&&_?.drafts?.validate&&Ce?.errors){if(Array.isArray(Ce.errors)){let[he,Le]=Ce.errors.reduce(([Ae,Q],ke)=>{let xe=[],ce=[];return ke?.message&&ce.push(ke),Array.isArray(ke?.data)&&ke.data.forEach(ne=>{ne?.field?xe.push(ne):ce.push(ne)}),[[...Ae,...xe],[...Q,...ce]]},[[],[]]);h({type:"ADD_SERVER_ERRORS",errors:he}),Le.forEach(Ae=>{me.error(Ae.message||w.t("error:unknown"))}),P.current=!1,b(!1),v(!0),te();return}}else{let he=Ce?.doc||Ce?.result;he&&(b(!0),P.current=!0,f(he))}te()}}}},{afterProcess:()=>{g(!1)},beforeProcess:()=>{if(!P.current)return P.current=!0,!1;g(!0)}})}),O=Di(!1),V=Di(tR(T));oR(()=>{if(!O.current){O.current=!0;return}let z=tR(T);W7(z,V)||(V.current=z,M())},[T]),oR(()=>()=>{G()},[]);let G=to(()=>{B.current&&clearTimeout(B.current),D(!1)});return G7("div",{className:Y7,children:[R&&!p&&eR(Kc,{}),E&&F("general:saving"),!E&&!!l&&eR(z7.Fragment,{children:F("version:lastSavedAgo",{distance:Xx({date:l,i18n:w})})})]})};import{jsx as Sf,jsxs as Z7}from"react/jsx-runtime";import{getTranslation as sR}from"@payloadcms/translations";import{useRouter as J7}from"next/navigation.js";import{formatAdminURL as q7}from"payload/shared";import Q7,{useCallback as iR}from"react";var aR=t=>{let{id:e,buttonId:o,collectionSlug:n,onDelete:r,redirectAfterDelete:s=!0,singularLabel:i,title:l}=t,{config:{routes:{admin:a,api:c},serverURL:u},getEntityConfig:d}=W(),f=d({collectionSlug:n}),{setModified:m}=Me(),h=J7(),{i18n:p,t:g}=$(),{title:b}=Pe(),{startRouteTransition:v}=st(),{openModal:x}=ue(),y=`delete-${e}`,C=iR(()=>{me.error(g("error:deletingTitle",{title:b}))},[g,b]),S=iR(async()=>{m(!1);try{await Ke.delete(`${u}${c}/${n}/${e}`,{headers:{"Accept-Language":p.language,"Content-Type":"application/json"}}).then(async w=>{try{let F=await w.json();if(w.status<400){if(me.success(g("general:titleDeleted",{label:sR(i,p),title:b})||F.message),s)return v(()=>h.push(q7({adminRoute:a,path:`/collections/${n}`})));typeof r=="function"&&await r({id:e,collectionConfig:f});return}return F.errors?F.errors.forEach(_=>me.error(_.message)):C(),!1}catch{return C()}})}catch{return C()}},[m,u,c,n,e,g,i,C,p,b,h,a,s,r,f,v]);return e?Z7(Q7.Fragment,{children:[Sf(Be.Button,{id:o,onClick:()=>{x(y)},children:g("general:delete")}),Sf(Rt,{body:Sf(Ii,{elements:{1:({children:w})=>Sf("strong",{children:w})},i18nKey:"general:aboutToDelete",t:g,variables:{label:sR(i,p),title:l||b||e}}),confirmingLabel:g("general:deleting"),heading:g("general:confirmDeletion"),modalSlug:y,onConfirm:S})]}):null};import{jsx as lR,jsxs as K7}from"react/jsx-runtime";import{getTranslation as cR}from"@payloadcms/translations";import{useRouter as e8}from"next/navigation.js";import{formatAdminURL as t8}from"payload/shared";import uR,{useCallback as dR}from"react";var mR=({id:t,slug:e,onDuplicate:o,redirectAfterDuplicate:n=!0,singularLabel:r})=>{let s=e8(),i=Ut(),{openModal:l}=ue(),a=$e(),{setModified:c}=Me(),{startRouteTransition:u}=st(),{config:{routes:{admin:d,api:f},serverURL:m},getEntityConfig:h}=W(),p=h({collectionSlug:e}),[g,b]=uR.useState(!1),{i18n:v,t:x}=$(),y=`duplicate-${t}`,C=dR(async()=>{b(!0),await Ke.post(`${m}${f}/${e}/${t}/duplicate${a?.code?`?locale=${a.code}`:""}`,{body:JSON.stringify({}),headers:{"Accept-Language":v.language,"Content-Type":"application/json",credentials:"include"}}).then(async w=>{let{doc:F,errors:_,message:A}=await w.json();if(w.status<400){if(me.success(A||x("general:successfullyDuplicated",{label:cR(r,v)})),c(!1),n)return u(()=>s.push(t8({adminRoute:d,path:`/collections/${e}/${F.id}${a?.code?`?locale=${a.code}`:""}`})));typeof o=="function"&&o({collectionConfig:p,doc:F})}else me.error(_?.[0].message||A||x("error:unspecific",{label:cR(r,v)}))})},[a,m,f,e,t,v,x,r,o,n,c,s,d,p,u]),S=dR(async()=>{b(!1),await C()},[C]);return K7(uR.Fragment,{children:[lR(Be.Button,{id:"action-duplicate",onClick:()=>i?(b(!0),l(y)):C(),children:x("general:duplicate")}),g&&lR(Rt,{body:x("general:unsavedChangesDuplicate"),confirmLabel:x("general:duplicateWithoutSaving"),heading:x("general:unsavedChanges"),modalSlug:y,onConfirm:S})]})};import{c as r8}from"react/compiler-runtime";import{jsx as hR,jsxs as n8}from"react/jsx-runtime";import{useState as s8}from"react";import{jsx as fR,jsxs as o8}from"react/jsx-runtime";import"react";var pR=({className:t})=>o8("svg",{className:["icon icon--lock",t].filter(Boolean).join(" "),fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[fR("path",{className:"stroke",d:"M7.5 9.5V7.5C7.5 6.83696 7.76339 6.20107 8.23223 5.73223C8.70107 5.26339 9.33696 5 10 5C10.663 5 11.2989 5.26339 11.7678 5.73223C12.2366 6.20107 12.5 6.83696 12.5 7.5V9.5",strokeLinecap:"round",strokeLinejoin:"round",strokeOpacity:"1"}),fR("path",{className:"stroke",d:"M13.5 9.5H6.5C5.94772 9.5 5.5 9.94772 5.5 10.5V14C5.5 14.5523 5.94772 15 6.5 15H13.5C14.0523 15 14.5 14.5523 14.5 14V10.5C14.5 9.94772 14.0523 9.5 13.5 9.5Z",stopOpacity:"1",strokeLinecap:"round",strokeLinejoin:"round"})]});var gR="locked",lu=t=>{let e=r8(8),{className:o,user:n}=t,[r,s]=s8(!1),{t:i}=$(),l=mf(n)?n.email??n.id:i("general:anotherUser"),a;e[0]!==o?(a=[gR,o].filter(Boolean),e[0]=o,e[1]=a):a=e[1];let c=a.join(" "),u,d;e[2]===Symbol.for("react.memo_cache_sentinel")?(u=()=>s(!0),d=()=>s(!1),e[2]=u,e[3]=d):(u=e[2],d=e[3]);let f=`${l} ${i("general:isEditing")}`,m;return e[4]!==r||e[5]!==c||e[6]!==f?(m=n8("div",{className:c,onMouseEnter:u,onMouseLeave:d,role:"button",tabIndex:0,children:[hR(go,{alignCaret:"left",className:`${gR}__tooltip`,position:"top",show:r,children:f}),hR(pR,{})]}),e[4]=r,e[5]=c,e[6]=f,e[7]=m):m=e[7],m};import{c as l8}from"react/compiler-runtime";import{jsx as c8}from"react/jsx-runtime";import"react";import*as vR from"qs-esm";import{useCallback as i8,useRef as a8,useState as bR}from"react";var xR=()=>{let{id:t,collectionSlug:e,globalSlug:o,versionCount:n}=Pe(),[r,s]=bR(!1),[i,l]=bR(""),{code:a}=$e(),c=n>0,{config:{routes:{api:u},serverURL:d}}=W(),{t:f}=$(),m=a8(!1);return{generatePreviewURL:i8(async({openPreviewWindow:p=!1})=>{if(!m.current){m.current=!0;try{s(!0);let g=`${d}${u}`;e&&(g=`${g}/${e}/${t}/preview`),o&&(g=`${g}/globals/${o}/preview`);let v=await fetch(`${g}?${vR.stringify({draft:c?"true":"false",locale:a||void 0})}`);if(!v.ok)throw new Error;let x=await v.json();if(!x)throw new Error;l(x),s(!1),m.current=!1,p&&window.open(x,"_blank")}catch{s(!1),m.current=!1,me.error(f("error:previewing"))}}},[d,u,e,o,c,a,t,f]),isLoading:r,label:f(r?"general:loading":"version:preview"),previewURL:i}};var u8="preview-btn";function c1(t){let e=l8(5),{generatePreviewURL:o,label:n}=xR(),r;e[0]!==o?(r=()=>o({openPreviewWindow:!0}),e[0]=o,e[1]=r):r=e[1];let s;return e[2]!==n||e[3]!==r?(s=c8(se,{buttonStyle:"secondary",className:u8,icon:"link",iconPosition:"left",onClick:r,size:"medium",children:n}),e[2]=n,e[3]=r,e[4]=s):s=e[4],s}import{jsx as Oa,jsxs as _R}from"react/jsx-runtime";import*as DR from"qs-esm";import d1,{useCallback as m1}from"react";import{jsx as yR}from"react/jsx-runtime";import"react";var d8="form-submit",Yr=t=>{let{type:e="submit",buttonId:o,children:n,disabled:r,onClick:s,programmaticSubmit:i,ref:l}=t,a=cr(),c=sp(),u=Ps(),{disabled:d,submit:f}=Me();return yR("div",{className:d8,children:yR(se,{ref:l,...t,disabled:!(r||u||a||c||d)?void 0:!0,id:o,onClick:s??(i?()=>{f()}:void 0),type:e,children:n})})};import{jsx as Gt,jsxs as Fi}from"react/jsx-runtime";import{getTranslation as h8}from"@payloadcms/translations";import*as IR from"qs-esm";import Lo,{useCallback as g8,useMemo as b8}from"react";import{jsx as Rs,jsxs as m8}from"react/jsx-runtime";import"react";var CR="table",u1=({appearance:t,columns:e,data:o})=>{let n=e?.filter(r=>r?.active);return!n||n.length===0?Rs("div",{children:"No columns selected"}):Rs("div",{className:[CR,t&&`${CR}--appearance-${t}`].filter(Boolean).join(" "),children:m8("table",{cellPadding:"0",cellSpacing:"0",children:[Rs("thead",{children:Rs("tr",{children:n.map((r,s)=>Rs("th",{id:`heading-${r.accessor}`,children:r.Heading},s))})}),Rs("tbody",{children:o&&o.map((r,s)=>Rs("tr",{className:`row-${s+1}`,children:n.map((i,l)=>{let{accessor:a}=i;return Rs("td",{className:`cell-${a}`,children:i.renderedCells[s]},l)})},typeof r.id=="string"||typeof r.id=="number"?String(r.id):s))})]})})};import{jsx as an,jsxs as f8}from"react/jsx-runtime";import{getTranslation as p8}from"@payloadcms/translations";import"react";var wR=({dateFormat:t,deleteHandler:e,docs:o,i18n:n,localization:r,supportedTimezones:s,t:i})=>{let l=[{accessor:"input.type",active:!0,field:{name:"",type:"text"},Heading:an("span",{children:i("version:type")}),renderedCells:o.map(a=>{let c=a.input?.type;return f8(vt,{pillStyle:c==="publish"?"success":"warning",children:[c==="publish"&&i("version:publish"),c==="unpublish"&&i("version:unpublish")]},a.id)})},{accessor:"waitUntil",active:!0,field:{name:"",type:"date"},Heading:an("span",{children:i("general:time")}),renderedCells:o.map(a=>an("span",{children:yn({date:a.waitUntil,i18n:n,pattern:t,timezone:a.input.timezone})},a.id))},{accessor:"input.timezone",active:!0,field:{name:"",type:"text"},Heading:an("span",{children:i("general:timezone")}),renderedCells:o.map(a=>{let u=s.find(d=>d.value===a.input.timezone)?.label||a.input.timezone;return an("span",{children:u||i("general:noValue")},a.id)})}];return r&&l.push({accessor:"input.locale",active:!0,field:{name:"",type:"text"},Heading:an("span",{children:i("general:locale")}),renderedCells:o.map(a=>{if(a.input.locale){let c=r.locales.find(u=>u.code===a.input.locale);if(c)return an("span",{children:p8(c.label,n)},a.id)}return an("span",{children:i("general:all")},a.id)})}),l.push({accessor:"delete",active:!0,field:{name:"delete",type:"text"},Heading:an("span",{children:i("general:delete")}),renderedCells:o.map(a=>an(se,{buttonStyle:"icon-label",className:"schedule-publish__delete",icon:"x",onClick:c=>{c.preventDefault(),e(a.id)},tooltip:i("general:delete")},a.id))}),l};var ja="schedule-publish",SR={label:"All",value:"all"},RR=({slug:t,defaultType:e,schedulePublishConfig:o})=>{let{toggleModal:n}=ue(),{config:{admin:{dateFormat:r,timezones:{defaultTimezone:s,supportedTimezones:i}},localization:l,routes:{api:a},serverURL:c}}=W(),{id:u,collectionSlug:d,globalSlug:f,title:m}=Pe(),{i18n:h,t:p}=$(),{schedulePublish:g}=Ft(),[b,v]=Lo.useState(e||"publish"),[x,y]=Lo.useState(),[C,S]=Lo.useState(s),[w,F]=Lo.useState(SR),[_,A]=Lo.useState(!1),R=p("general:schedulePublishFor",{title:m}),[I,D]=Lo.useState(),[E,T]=Lo.useState(),L=Lo.useRef(()=>null),k=Intl.DateTimeFormat().resolvedOptions().timeZone,j=Lo.useMemo(()=>{if(l){let V=l.locales.map(({code:G,label:z})=>({label:h8(z,h),value:G}));return V.unshift(SR),V}return[]},[l,h]),P=Lo.useCallback(async()=>{let V={sort:"waitUntil",where:{and:[{taskSlug:{equals:"schedulePublish"}},{waitUntil:{greater_than:new Date}}]}};d&&(V.where.and.push({"input.doc.value":{equals:String(u)}}),V.where.and.push({"input.doc.relationTo":{equals:d}})),f&&V.where.and.push({"input.global":{equals:f}});let{docs:G}=await Ke.post(`${c}${a}/payload-jobs`,{body:IR.stringify(V),headers:{"Accept-Language":h.language,"Content-Type":"application/x-www-form-urlencoded","X-HTTP-Method-Override":"GET"}}).then(z=>z.json());T(wR({dateFormat:r,deleteHandler:L.current,docs:G,i18n:h,localization:l,supportedTimezones:i,t:p})),D(G)},[d,f,c,a,h,r,l,i,p,u]),N=Lo.useCallback(async V=>{try{await g({deleteID:V}),await P(),me.success(p("general:deletedSuccessfully"))}catch(G){console.error(G),me.error(G.message)}},[P,g,p]);Lo.useEffect(()=>{L.current=N},[N]);let B=Lo.useCallback(async()=>{if(!x)return me.error(p("general:noDateSelected"));A(!0);let V;typeof w=="object"&&w.value!=="all"&&b==="publish"&&(V=w.value);try{await g({type:b,date:x,doc:d?{relationTo:d,value:String(u)}:void 0,global:f||void 0,locale:V,timezone:C}),y(void 0),me.success(p("version:scheduledSuccessfully")),P()}catch(G){console.error(G),me.error(G.message)}A(!1)},[x,w,b,p,g,d,u,f,C,P]),M=b8(()=>{if(C&&k&&x){let V=Mt.tz(C),G=Mt.tz(k),z=new Mt(x).withTimeZone(C),X=Ar(z,V);return Ar(X,G).toISOString()}return x},[C,x,k]),O=g8(V=>{if(C&&V){let G=Mt.tz(C),z=new Mt(V),X=Ar(z,G);y(X||null)}else y(V||null)},[y,C]);return Lo.useEffect(()=>{I||(async()=>await P())()},[I,P]),Fi(Lt,{className:ja,gutter:!1,Header:Fi("div",{className:`${ja}__drawer-header`,children:[Gt("h2",{title:R,children:R}),Gt(Mm,{onClick:()=>n(t)})]}),slug:t,children:[Fi(Bo,{className:`${ja}__scheduler`,children:[Gt(ye,{label:p("version:type"),required:!0}),Fi("ul",{className:`${ja}__type`,children:[Gt("li",{children:Gt(bc,{id:`${t}-type`,isSelected:b==="publish",onChange:()=>v("publish"),option:{label:p("version:publish"),value:"publish"},path:`${t}-type`,readOnly:_})}),Gt("li",{children:Gt(bc,{id:`${t}-type`,isSelected:b==="unpublish",onChange:()=>v("unpublish"),option:{label:p("version:unpublish"),value:"unpublish"},path:`${t}-type`,readOnly:_})})]}),Gt("br",{}),Gt(ye,{label:p("general:time"),path:"time",required:!0}),Gt(Ji,{id:"time",minDate:new Date,onChange:V=>O(V),pickerAppearance:"dayAndTime",readOnly:_,timeFormat:o?.timeFormat,timeIntervals:o?.timeIntervals??5,value:M}),i.length>0&&Gt(Kl,{id:"timezone-picker",onChange:S,options:i,selectedTimezone:C}),Gt("br",{}),j.length>0&&b==="publish"&&Fi(Lo.Fragment,{children:[Gt(ye,{label:p("localization:localeToPublish")}),Gt(ft,{onChange:V=>F(V),options:j,value:w}),Gt("br",{})]}),Fi("div",{className:`${ja}__actions`,children:[Gt(se,{buttonStyle:"primary",disabled:_,id:"scheduled-publish-save",onClick:B,type:"button",children:p("general:save")}),_?Gt("span",{children:p("general:saving")}):null]})]}),Fi(Bo,{className:`${ja}__upcoming`,children:[Gt("h4",{children:p("general:upcomingEvents")}),!I&&Gt(It,{}),I?.length===0&&Gt(Rr,{type:"info",children:p("general:noUpcomingEventsScheduled")}),I?.length>0&&Gt(u1,{appearance:"condensed",columns:E,data:I})]})]})};function f1({label:t}){let{id:e,collectionSlug:o,docConfig:n,globalSlug:r,hasPublishedDoc:s,hasPublishPermission:i,setHasPublishedDoc:l,setMostRecentVersionIsAutosaved:a,setUnpublishedVersionCount:c,unpublishedVersionCount:u,uploadStatus:d}=Pe(),{config:f,getEntityConfig:m}=W(),{submit:h}=Me(),p=Ut(),g=ct(),{code:b}=$e(),{isModalOpen:v,toggleModal:x}=ue(),y=`schedule-publish-${e}`,{localization:C,routes:{api:S},serverURL:w}=f,{t:F}=$(),_=t||F("version:publishChanges"),A=d1.useMemo(()=>{if(o)return m({collectionSlug:o});if(r)return m({globalSlug:r})},[o,r,m]),R=u>0,I=typeof A?.versions?.drafts=="object"&&A?.versions?.drafts.schedulePublish,D=i&&(p||R||!s)&&d!=="uploading",E=!!I,T=!!(typeof A?.versions?.drafts=="object"&&A?.versions?.drafts.autosave),L=!!(E&&i&&(r||o&&e)&&(T||!p)),j=Ko()==="update"&&!p,P=m1(async()=>{if(j)return;let Y=`?locale=${b}&depth=0&fallback-locale=null&draft=true`,H,le="POST";o&&(H=`${w}${S}/${o}${e?`/${e}`:""}${Y}`,e&&(le="PATCH")),r&&(H=`${w}${S}/globals/${r}${Y}`),await h({action:H,method:le,overrides:{_status:"draft"},skipValidation:!0})},[h,o,r,w,S,b,e,j]);wi({cmdCtrlKey:!0,editDepth:g,keyCodes:["s"]},Y=>{Y.preventDefault(),Y.stopPropagation(),P&&n.versions?.drafts&&n.versions?.drafts?.autosave&&P()});let N=m1(()=>{d!=="uploading"&&(h({overrides:{_status:"published"}}),c(0),a(!1),l(!0))},[l,h,c,d,a]),B=m1(Y=>{if(d==="uploading")return;let H=DR.stringify({publishSpecificLocale:Y}),le=`${w}${S}${r?`/globals/${r}`:`/${o}/${e?`${"/"+e}`:""}`}${H?"?"+H:""}`;h({action:le,overrides:{_status:"published"}}),l(!0)},[S,o,r,e,w,l,h,d]),M=!C||C&&C.defaultLocalePublishOption!=="active",O=C&&C?.locales.find(Y=>typeof Y=="string"?Y===b:Y.code===b),V=O&&(typeof O.label=="string"?O.label:O.label?.[b]??void 0),G=M?N:()=>B(O.code),z=M?_:F("version:publishIn",{locale:V}),X=M?()=>B(O.code):N,te=M?F("version:publishIn",{locale:V}):F("version:publishAllLocales");return i?_R(d1.Fragment,{children:[Oa(Yr,{buttonId:"action-save",disabled:!D,enableSubMenu:L,onClick:G,size:"medium",SubMenuPopupContent:C||L?({close:Y})=>_R(d1.Fragment,{children:[L&&Oa(Be.ButtonGroup,{children:Oa(Be.Button,{id:"schedule-publish",onClick:()=>[x(y),Y()],children:F("version:schedulePublish")})},"schedule-publish"),C&&D&&Oa(Be.ButtonGroup,{children:Oa(Be.Button,{id:"publish-locale",onClick:X,children:te})})]}):void 0,type:"button",children:C?z:_}),L&&v(y)&&Oa(RR,{defaultType:R?"publish":"unpublish",schedulePublishConfig:typeof I=="object"&&I,slug:y})]}):null}import{jsx as v8}from"react/jsx-runtime";import{useRef as x8}from"react";function p1({label:t}){let{uploadStatus:e}=Pe(),{t:o}=$(),{submit:n}=Me(),r=Ut(),s=t||o("general:save"),i=x8(null),l=ct(),c=Ko()==="update"&&!r||e==="uploading";return wi({cmdCtrlKey:!0,editDepth:l,keyCodes:["s"]},d=>{d.preventDefault(),d.stopPropagation(),i?.current&&i.current.click()}),v8(Yr,{buttonId:"action-save",disabled:c,onClick:()=>{if(e!=="uploading")return void n()},ref:i,size:"medium",type:"button",children:s})}import{jsx as y8}from"react/jsx-runtime";import{useCallback as C8,useRef as w8}from"react";var S8="save-draft";function h1(t){let{config:{routes:{api:e},serverURL:o}}=W(),{id:n,collectionSlug:r,globalSlug:s,setUnpublishedVersionCount:i,uploadStatus:l}=Pe(),a=Ut(),{code:c}=$e(),u=w8(null),d=ct(),{t:f}=$(),{submit:m}=Me(),p=Ko()==="update"&&!a||l==="uploading",g=C8(async()=>{if(p)return;let b=`?locale=${c}&depth=0&fallback-locale=null&draft=true`,v,x="POST";r&&(v=`${o}${e}/${r}${n?`/${n}`:""}${b}`,n&&(x="PATCH")),s&&(v=`${o}${e}/globals/${s}${b}`),await m({action:v,method:x,overrides:{_status:"draft"},skipValidation:!0}),i(y=>y+1)},[m,r,s,o,e,c,n,p,i]);return wi({cmdCtrlKey:!0,editDepth:d,keyCodes:["s"]},b=>{b.preventDefault(),b.stopPropagation(),u?.current&&u.current.click()}),y8(Yr,{buttonId:"action-save-draft",buttonStyle:"secondary",className:S8,disabled:p,onClick:()=>void g(),ref:u,size:"medium",type:"button",children:f("version:saveDraft")})}import{jsx as Ma,jsxs as If}from"react/jsx-runtime";import FR,{useCallback as I8}from"react";var Ba="status",AR=()=>{let{id:t,collectionSlug:e,docPermissions:o,globalSlug:n,hasPublishedDoc:r,incrementVersionCount:s,setHasPublishedDoc:i,setMostRecentVersionIsAutosaved:l,setUnpublishedVersionCount:a,unpublishedVersionCount:c}=Pe(),{toggleModal:u}=ue(),{config:{routes:{api:d},serverURL:f}}=W(),{reset:m}=Me(),{code:h}=$e(),{i18n:p,t:g}=$(),b=`confirm-un-publish-${t}`,v=`confirm-revert-${t}`,x;c>0&&r?x="changed":r?r&&c<=0&&(x="published"):x="draft";let y=I8(async S=>{let w,F,_;S==="unpublish"&&(_={_status:"draft"}),e&&(w=`${f}${d}/${e}/${t}?locale=${h}&fallback-locale=null&depth=0`,F="patch"),n&&(w=`${f}${d}/globals/${n}?locale=${h}&fallback-locale=null&depth=0`,F="post"),S==="revert"&&(_=await Ke.get(w,{headers:{"Accept-Language":p.language,"Content-Type":"application/json"}}).then(I=>I.json()));let A=await Ke[F](w,{body:JSON.stringify(_),headers:{"Accept-Language":p.language,"Content-Type":"application/json"}});if(A.status===200){let R,I=await A.json();n?R=I.result:e&&(R=I.doc),m(R),me.success(I.message),s(),l(!1),S==="unpublish"?i(!1):S==="revert"&&a(0)}else me.error(g("error:unPublishingDocument"))},[d,e,n,t,p.language,s,h,m,f,a,l,g,i]),C=o?.update;return x?Ma("div",{className:Ba,title:`${g("version:status")}: ${g(`version:${x}`)}`,children:If("div",{className:`${Ba}__value-wrap`,children:[If("span",{className:`${Ba}__label`,children:[g("version:status"),":\xA0"]}),Ma("span",{className:`${Ba}__value`,children:g(`version:${x}`)}),C&&x==="published"&&If(FR.Fragment,{children:["\xA0\u2014\xA0",Ma(se,{buttonStyle:"none",className:`${Ba}__action`,onClick:()=>u(b),children:g("version:unpublish")}),Ma(Rt,{body:g("version:aboutToUnpublish"),confirmingLabel:g("version:unpublishing"),heading:g("version:confirmUnpublish"),modalSlug:b,onConfirm:()=>y("unpublish")})]}),C&&x==="changed"&&If(FR.Fragment,{children:["\xA0\u2014\xA0",Ma(se,{buttonStyle:"none",className:`${Ba}__action`,id:"action-revert-to-published",onClick:()=>u(v),children:g("version:revertToPublished")}),Ma(Rt,{body:g("version:aboutToRevertToPublished"),confirmingLabel:g("version:reverting"),heading:g("version:confirmRevertToSaved"),modalSlug:v,onConfirm:()=>y("revert")})]})]})}):null};var Tt="doc-controls",b1=t=>{let e=R8(15),{id:o,slug:n,BeforeDocumentControls:r,customComponents:s,data:i,disableActions:l,disableCreate:a,hasSavePermission:c,isAccountView:u,isEditing:d,onDelete:f,onDrawerCreateNew:m,onDuplicate:h,onTakeOver:p,permissions:g,readOnlyForIncomingUser:b,redirectAfterDelete:v,redirectAfterDuplicate:x,user:y}=t,C;e[0]!==s?(C=s===void 0?{}:s,e[0]=s,e[1]=C):C=e[1];let{PreviewButton:S,PublishButton:w,SaveButton:F,SaveDraftButton:_}=C,{i18n:A,t:R}=$(),I=ct(),{config:D,getEntityConfig:E}=W(),T=E({collectionSlug:n}),L=E({globalSlug:n}),{admin:k,localization:j,routes:P}=D,{dateFormat:N}=k,{admin:B}=P,[M,O]=g1.useState(""),[V,G]=g1.useState(""),z=cr(),X=Ps(),te,Y;e[2]!==i||e[3]!==N||e[4]!==A?(te=()=>{i?.updatedAt&&O(yn({date:i.updatedAt,i18n:A,pattern:N})),i?.createdAt&&G(yn({date:i.createdAt,i18n:A,pattern:N}))},Y=[i,A,N],e[2]=i,e[3]=N,e[4]=A,e[5]=te,e[6]=Y):(te=e[5],Y=e[6]),F8(te,Y);let H=g&&"create"in g&&g.create,le=g&&"delete"in g&&g.delete,q=!!(T&&o&&!l&&(H||le)),fe=!o&&T?.versions?.drafts&&T.versions?.drafts.validate,ae=T?.versions?.drafts,J=L?.versions?.drafts,ge=ae&&ae?.autosave||J&&J?.autosave,Ce=ae&&ae?.autosave,he=J&&J?.autosave,Le=Ce&&ae.autosave!==!1&&ae.autosave.showSaveDraftButton===!0||he&&J.autosave!==!1&&J.autosave.showSaveDraftButton===!0,Ae=j&&!T?.admin?.disableCopyToLocale,Q;e[7]!==b||e[8]!==y?(Q=y&&b&&at(lu,{className:`${Tt}__locked-controls`,user:y}),e[7]=b,e[8]=y,e[9]=Q):Q=e[9];let ke;return e[10]!==p||e[11]!==b||e[12]!==R||e[13]!==y?(ke=y&&b&&at(se,{buttonStyle:"secondary",id:"take-over",onClick:p,size:"medium",type:"button",children:R("general:takeOver")}),e[10]=p,e[11]=b,e[12]=R,e[13]=y,e[14]=ke):ke=e[14],$o(Bo,{className:Tt,children:[$o("div",{className:`${Tt}__wrapper`,children:[at("div",{className:`${Tt}__content`,children:$o("ul",{className:`${Tt}__meta`,children:[T&&!d&&!u&&at("li",{className:`${Tt}__list-item`,children:at("p",{className:`${Tt}__value`,children:A.t("general:creatingNewLabel",{label:_8(T?.labels?.singular??A.t("general:document"),A)})})}),Q,(T?.versions?.drafts||L?.versions?.drafts)&&$o(cu,{children:[(L||T&&d)&&at("li",{className:[`${Tt}__status`,`${Tt}__list-item`].filter(Boolean).join(" "),children:at(AR,{})}),c&&ge&&!fe&&at("li",{className:`${Tt}__list-item`,children:at(nR,{collection:T,global:L,id:o,publishedDocUpdatedAt:i?.createdAt})})]}),T?.timestamps&&(d||u)&&$o(cu,{children:[$o("li",{className:[`${Tt}__list-item`,`${Tt}__value-wrap`].filter(Boolean).join(" "),title:i?.updatedAt?M:"",children:[$o("p",{className:`${Tt}__label`,children:[A.t("general:lastModified"),":\xA0"]}),i?.updatedAt&&at("p",{className:`${Tt}__value`,children:M})]}),$o("li",{className:[`${Tt}__list-item`,`${Tt}__value-wrap`].filter(Boolean).join(" "),title:i?.createdAt?V:"",children:[$o("p",{className:`${Tt}__label`,children:[A.t("general:created"),":\xA0"]}),i?.createdAt&&at("p",{className:`${Tt}__value`,children:V})]})]})]})}),$o("div",{className:`${Tt}__controls-wrapper`,children:[$o("div",{className:`${Tt}__controls`,children:[r,(T?.admin.preview||L?.admin.preview)&&at(oe,{CustomComponent:S,Fallback:at(c1,{})}),c&&at(cu,{children:T?.versions?.drafts||L?.versions?.drafts?$o(cu,{children:[(fe||!ge||ge&&Le)&&at(oe,{CustomComponent:_,Fallback:at(h1,{})}),at(oe,{CustomComponent:w,Fallback:at(f1,{})})]}):at(oe,{CustomComponent:F,Fallback:at(p1,{})})}),ke]}),q&&!b&&at(ho,{button:$o("div",{className:`${Tt}__dots`,children:[at("div",{}),at("div",{}),at("div",{})]}),className:`${Tt}__popup`,disabled:X||z,horizontalAlign:"right",size:"large",verticalAlign:"bottom",children:$o(Be.ButtonGroup,{children:[Ae&&at(r1,{}),H&&$o(g1.Fragment,{children:[!a&&at(cu,{children:I>1?at(Be.Button,{id:"action-create",onClick:m,children:A.t("general:createNew")}):at(Be.Button,{href:D8({adminRoute:B,path:`/collections/${T?.slug}/create`}),id:"action-create",children:A.t("general:createNew")})}),T.disableDuplicate!==!0&&d&&at(mR,{id:o.toString(),onDuplicate:h,redirectAfterDuplicate:x,singularLabel:T?.labels?.singular,slug:T?.slug})]}),le&&at(aR,{buttonId:"action-delete",collectionSlug:T?.slug,id:o.toString(),onDelete:f,redirectAfterDelete:v,singularLabel:T?.labels?.singular,useAsTitle:T?.admin?.useAsTitle})]})})]})]}),at("div",{className:`${Tt}__divider`})]})};import{c as O8}from"react/compiler-runtime";import{jsx as _f,jsxs as M8}from"react/jsx-runtime";import{useState as B8}from"react";import{c as v1}from"react/compiler-runtime";import{jsx as fo,jsxs as Rf}from"react/jsx-runtime";import{getTranslation as A8}from"@payloadcms/translations";import{useRouter as T8,useSearchParams as E8}from"next/navigation.js";import{mergeListSearchAndWhere as P8,unflatten as TR}from"payload/shared";import*as LR from"qs-esm";import ER,{useCallback as PR,useEffect as N8,useMemo as NR,useState as L8}from"react";var $8=t=>{let e=v1(7),{action:o,disabled:n}=t,{submit:r}=Me(),{t:s}=$(),i;e[0]!==o||e[1]!==r?(i=()=>{r({action:o,method:"PATCH",skipValidation:!0})},e[0]=o,e[1]=r,e[2]=i):i=e[2];let l=i,a;return e[3]!==n||e[4]!==l||e[5]!==s?(a=fo(Yr,{className:`${ko}__save`,disabled:n,onClick:l,children:s("general:save")}),e[3]=n,e[4]=l,e[5]=s,e[6]=a):a=e[6],a},k8=t=>{let e=v1(7),{action:o,disabled:n}=t,{submit:r}=Me(),{t:s}=$(),i;e[0]!==o||e[1]!==r?(i=()=>{r({action:o,method:"PATCH",overrides:{_status:"published"},skipValidation:!0})},e[0]=o,e[1]=r,e[2]=i):i=e[2];let l=i,a;return e[3]!==n||e[4]!==l||e[5]!==s?(a=fo(Yr,{className:`${ko}__publish`,disabled:n,onClick:l,children:s("version:publishChanges")}),e[3]=n,e[4]=l,e[5]=s,e[6]=a):a=e[6],a},j8=t=>{let e=v1(7),{action:o,disabled:n}=t,{submit:r}=Me(),{t:s}=$(),i;e[0]!==o||e[1]!==r?(i=()=>{r({action:o,method:"PATCH",overrides:{_status:"draft"},skipValidation:!0})},e[0]=o,e[1]=r,e[2]=i):i=e[2];let l=i,a;return e[3]!==n||e[4]!==l||e[5]!==s?(a=fo(Yr,{buttonStyle:"secondary",className:`${ko}__draft`,disabled:n,onClick:l,children:s("version:saveDraft")}),e[3]=n,e[4]=l,e[5]=s,e[6]=a):a=e[6],a},$R=t=>{let{collection:{fields:e,labels:{plural:o,singular:n}}={},collection:r,drawerSlug:s,selectedFields:i,setSelectedFields:l}=t,{permissions:a,user:c}=De(),{closeModal:u}=ue(),{config:{routes:{api:d},serverURL:f}}=W(),{getFormState:m}=Ft(),{count:h,getQueryParams:p,selectAll:g}=ro(),{i18n:b,t:v}=$(),[x,y]=L8(!1),C=T8(),S=ER.useRef(null),{clearRouteCache:w}=Mn(),F=a?.collections?.[r.slug],_=E8(),A=NR(()=>TR(i.reduce((T,L)=>(T[L.value.path]=!0,T),{})),[i]),R=PR(async({formState:T,submitted:L})=>{let k=rr(S),{state:j}=await m({collectionSlug:r.slug,docPermissions:F,docPreferences:null,formState:T,operation:"update",schemaPath:r.slug,select:A,signal:k.signal,skipValidation:!L});return S.current=null,j},[m,r,F,A]);N8(()=>{let T=S.current;return()=>{or(T)}},[]);let I=NR(()=>{let T=P8({collectionConfig:r,search:_.get("search")});return p(T)},[r,_,p]),D=()=>{C.replace(LR.stringify({...jr(_),page:g===xo.AllAvailable?"1":void 0},{addQueryPrefix:!0})),w(),u(s)},E=PR(async({dispatchFields:T,formState:L,selected:k})=>{y(!0),l(k||[]);let{state:j}=await m({collectionSlug:r.slug,docPermissions:F,docPreferences:null,formState:L,operation:"update",schemaPath:r.slug,select:TR(k.reduce((P,N)=>(P[N.value.path]=!0,P),{})),skipValidation:!0});T({type:"UPDATE_MANY",formState:j}),y(!1)},[m,r.slug,F,l]);return fo(Sl,{collectionSlug:r.slug,currentEditor:c,hasPublishedDoc:!1,id:null,initialData:{},isLocked:!1,lastUpdateTime:0,mostRecentVersionIsAutosaved:!1,unpublishedVersionCount:0,versionCount:0,children:fo(xd,{value:"update",children:Rf("div",{className:`${ko}__main`,children:[Rf("div",{className:`${ko}__header`,children:[fo("h2",{className:`${ko}__header__title`,children:v("general:editingLabel",{count:h,label:A8(h>1?o:n,b)})}),fo("button",{"aria-label":v("general:close"),className:`${ko}__header__close`,id:`close-drawer__${s}`,onClick:()=>u(s),type:"button",children:fo(pt,{})})]}),Rf(Tn,{className:`${ko}__form`,isInitializing:x,onChange:[R],onSuccess:D,children:[fo(Xm,{fields:e,onChange:E,permissions:F.fields}),i.length===0?null:fo("div",{className:"render-fields",children:i.map((T,L)=>{let{value:{field:k,fieldPermissions:j,path:P}}=T;return fo(Da,{clientFieldConfig:k,indexPath:"",parentPath:"",parentSchemaPath:"",path:P,permissions:j},`${P}-${L}`)})}),fo("div",{className:`${ko}__sidebar-wrap`,children:fo("div",{className:`${ko}__sidebar`,children:fo("div",{className:`${ko}__sidebar-sticky-wrap`,children:fo("div",{className:`${ko}__document-actions`,children:r?.versions?.drafts?Rf(ER.Fragment,{children:[fo(j8,{action:`${f}${d}/${r.slug}${I}&draft=true`,disabled:i.length===0}),fo(k8,{action:`${f}${d}/${r.slug}${I}&draft=true`,disabled:i.length===0})]}):fo($8,{action:`${f}${d}/${r.slug}${I}`,disabled:i.length===0})})})})})]})]})})})};var ko="edit-many",x1=t=>{let e=O8(10),{collection:o}=t,{slug:n}=o,{permissions:r}=De(),{openModal:s}=ue(),{selectAll:i}=ro(),{t:l}=$(),a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=[],e[0]=a):a=e[0];let[c,u]=B8(a),d=r?.collections?.[n],f=`edit-${n}`;if(i===xo.None||!d?.update)return null;let m;if(e[1]!==f||e[2]!==s||e[3]!==t.collection||e[4]!==c||e[5]!==l){let h;e[7]!==f||e[8]!==s?(h=()=>{s(f),u([])},e[7]=f,e[8]=s,e[9]=h):h=e[9],m=M8("div",{className:ko,children:[_f("button",{"aria-label":l("general:edit"),className:`${ko}__toggle`,onClick:h,type:"button",children:l("general:edit")}),_f($s,{children:_f(Lt,{Header:null,slug:f,children:_f($R,{collection:t.collection,drawerSlug:f,selectedFields:c,setSelectedFields:u})})})]}),e[1]=f,e[2]=s,e[3]=t.collection,e[4]=c,e[5]=l,e[6]=m}else m=e[6];return m};import{c as V8}from"react/compiler-runtime";import{jsx as G8}from"react/jsx-runtime";import"react";function W8(t){let e=V8(6),o=ct(),n;e[0]!==t.style?(n=t.style||{},e[0]=t.style,e[1]=n):n=e[1];let r=`calc(100 + ${o||0} + 1)`,s;return e[2]!==t||e[3]!==n||e[4]!==r?(s=G8(Zo,{...t,style:{...n,zIndex:r}}),e[2]=t,e[3]=n,e[4]=r,e[5]=s):s=e[5],s}import{c as H8}from"react/compiler-runtime";import{jsx as Df,jsxs as z8}from"react/jsx-runtime";import X8 from"react";function y1(t){let e=H8(12),{highlightField:o,setKey:n}=t,{id:r}=Pe(),{toggleModal:s}=ue(),{t:i}=$(),l=`generate-confirmation-${r}`,a;e[0]!==o||e[1]!==n||e[2]!==i?(a=()=>{n(),me.success(i("authentication:newAPIKeyGenerated")),o(!0)},e[0]=o,e[1]=n,e[2]=i,e[3]=a):a=e[3];let c=a,u;e[4]!==l||e[5]!==s?(u=()=>{s(l)},e[4]=l,e[5]=s,e[6]=u):u=e[6];let d;return e[7]!==c||e[8]!==l||e[9]!==i||e[10]!==u?(d=z8(X8.Fragment,{children:[Df(se,{buttonStyle:"secondary",onClick:u,size:"small",children:i("authentication:generateNewAPIKey")}),Df(Rt,{body:Df(Ii,{elements:{1:U8},i18nKey:"authentication:generatingNewAPIKeyWillInvalidate",t:i}),confirmLabel:i("authentication:generate"),heading:i("authentication:confirmGeneration"),modalSlug:l,onConfirm:c})]}),e[7]=c,e[8]=l,e[9]=i,e[10]=u,e[11]=d):d=e[11],d}function U8(t){let{children:e}=t;return Df("strong",{children:e})}import{c as Y8}from"react/compiler-runtime";import{useEffect as Z8}from"react";function J8(t){let e=Y8(4),{permissions:o}=t,{setPermissions:n}=De(),r,s;return e[0]!==o||e[1]!==n?(r=()=>{n(o)},s=[o,n],e[0]=o,e[1]=n,e[2]=r,e[3]=s):(r=e[2],s=e[3]),Z8(r,s),null}import{jsx as Wt,jsxs as Nf}from"react/jsx-runtime";import{getTranslation as Ha}from"@payloadcms/translations";import{validateWhereQuery as LV}from"payload/shared";import $V,{Fragment as x_,useEffect as y_,useRef as C_,useState as kV}from"react";import{jsx as C1,jsxs as q8}from"react/jsx-runtime";import"react";var w1="dots",kR=({ariaLabel:t,className:e,noBackground:o,orientation:n="vertical"})=>q8("div",{"aria-label":t,className:[e,w1,o&&`${w1}--no-background`,n&&`${w1}--${n}`].filter(Boolean).join(" "),children:[C1("div",{}),C1("div",{}),C1("div",{})]});import{jsx as jR}from"react/jsx-runtime";import{useEffect as OR,useRef as MR,useState as Q8}from"react";import{usePathname as K8}from"next/navigation.js";var BR="search-filter",S1=t=>{let{handleChange:e,initialParams:o,label:n}=t,r=K8(),[s,i]=Q8(typeof o?.search=="string"?o?.search:void 0),l=MR(!0),a=MR(typeof o?.search=="string"?o?.search:void 0),c=qo(s,300);return OR(()=>{o?.search!==a.current&&(l.current=!1,i(o?.search),a.current=o?.search)},[o?.search,r]),OR(()=>{c!==a.current&&l.current&&(e&&e(c),a.current=c)},[c,e]),jR("div",{className:BR,children:jR("input",{"aria-label":n,className:`${BR}__input`,id:"search-filter-input",onChange:u=>{l.current=!0,i(u.target.value)},placeholder:n,type:"text",value:s||""})})};import{jsx as Gn,jsxs as fu}from"react/jsx-runtime";import{getTranslation as RV}from"@payloadcms/translations";import{transformWhereQuery as _V,validateWhereQuery as a_}from"payload/shared";import Tf,{useMemo as l_}from"react";import{jsx as Bn,jsxs as P1}from"react/jsx-runtime";import{useCallback as o_,useEffect as gV,useState as bV}from"react";import{jsx as uu}from"react/jsx-runtime";import"react";import{jsx as VR}from"react/jsx-runtime";import"react";var eV="condition-value-date",I1=({disabled:t,field:{admin:e},onChange:o,value:n})=>{let{date:r}=e||{};return VR("div",{className:eV,children:VR(Ji,{...r,onChange:o,readOnly:t,value:n})})};import{c as tV}from"react/compiler-runtime";import{jsx as GR}from"react/jsx-runtime";import WR from"react";var oV="condition-value-number",R1=t=>{let e=tV(18),{disabled:o,field:n,onChange:r,operator:s,value:i}=t,{hasMany:l}=n,{t:a}=$(),c;e[0]!==l||e[1]!==s?(c=["in","not_in"].includes(s)||l,e[0]=l,e[1]=s,e[2]=c):c=e[2];let u=c,d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=[],e[3]=d):d=e[3];let[f,m]=WR.useState(d),h;e[4]!==u||e[5]!==r?(h=x=>{let y;x?u&&(Array.isArray(x)?y=x.map(rV):y=[Number(x.value?.value||x.value)]):y=[],r(y)},e[4]=u,e[5]=r,e[6]=h):h=e[6];let p=h,g,b;e[7]!==i?(g=()=>{Array.isArray(i)?m(i.map(nV)):m([])},b=[i],e[7]=i,e[8]=g,e[9]=b):(g=e[8],b=e[9]),WR.useEffect(g,b);let v;return e[10]!==o||e[11]!==u||e[12]!==r||e[13]!==p||e[14]!==a||e[15]!==i||e[16]!==f?(v=u?GR(ft,{disabled:o,isClearable:!0,isCreatable:!0,isMulti:u,isSortable:!0,numberOnly:!0,onChange:p,options:[],placeholder:a("general:enterAValue"),value:f||[]}):GR("input",{className:oV,disabled:o,onChange:x=>r(x.target.value),placeholder:a("general:enterAValue"),type:"number",value:i}),e[10]=o,e[11]=u,e[12]=r,e[13]=p,e[14]=a,e[15]=i,e[16]=f,e[17]=v):v=e[17],v};function rV(t){return Number(t.value?.value||t.value)}function nV(t,e){return{id:`${t}${e}`,label:`${t}`,value:{toString:()=>`${t}${e}`,value:t?.value||t}}}import{jsx as UR,jsxs as iV}from"react/jsx-runtime";import*as qR from"qs-esm";import YR,{useCallback as Ff,useEffect as ZR,useReducer as aV,useState as _1}from"react";import{getTranslation as HR}from"@payloadcms/translations";var zR=t=>t.reduce((e,o)=>o.options?[...e,...zR(o.options)]:[...e,o.id],[]),sV=(t,e)=>{switch(e.type){case"ADD":{let{collection:o,data:n,hasMultipleRelations:r,i18n:s,relation:i}=e,l=o.admin.useAsTitle||"id",a=zR(t);if(!r)return[...t,...n.docs.reduce((f,m)=>a.indexOf(m.id)===-1?(a.push(m.id),[...f,{label:m[l],value:m.id}]):f,[])];let c=[...t],u=c.find(f=>f.label===HR(o.labels.plural,s)),d=n.docs.reduce((f,m)=>a.indexOf(m.id)===-1?(a.push(m.id),[...f,{label:m[l],relationTo:i,value:m.id}]):f,[]);return u?u.options=[...u.options,...d]:c.push({label:HR(o.labels.plural,s),options:d,value:void 0}),c}case"CLEAR":return e.required?[]:[{label:e.i18n.t("general:none"),value:"null"}];default:return t}},XR=sV;var JR="condition-value-relationship",lV=10,D1=t=>{let{disabled:e,field:{admin:{isSortable:o,placeholder:n}={},hasMany:r,relationTo:s},filterOptions:i,onChange:l,value:a}=t,{config:{routes:{api:c},serverURL:u},getEntityConfig:d}=W(),f=Array.isArray(s),[m,h]=aV(XR,[]),[p,g]=_1(""),b=qo(p,300),[v,x]=_1(""),[y,C]=_1(!1),{i18n:S,t:w}=$(),F=$e(),_=f?s:[s],A=YR.useRef(new Map(_.map(P=>[P,{hasLoadedAll:!1,nextPage:1}]))),R=Ff((P,N)=>{let B=d({collectionSlug:N});h({type:"ADD",collection:B,data:P,hasMultipleRelations:f,i18n:S,relation:N})},[f,S,d]),I=to(async({abortController:P,relationSlug:N})=>{let B=A.current.get(N);if(N&&!B.hasLoadedAll){let O=d({collectionSlug:N})?.admin?.useAsTitle||"id",V={and:[]},G={depth:0,limit:lV,locale:F.code,page:B.nextPage,select:{[O]:!0},where:V};i&&i?.[N]&&G.where.and.push(i[N]),b&&G.where.and.push({[O]:{like:b}});try{let z=await fetch(`${u}${c}/${N}${qR.stringify(G,{addQueryPrefix:!0})}`,{credentials:"include",headers:{"Accept-Language":S.language},signal:P.signal});if(z.ok){let X=await z.json();X.docs.length>0&&(R(X,N),X.nextPage?A.current.set(N,{hasLoadedAll:!1,nextPage:X.nextPage}):A.current.set(N,{hasLoadedAll:!0,nextPage:null}))}else x(w("error:unspecific"))}catch(z){P.signal.aborted||console.error(z)}}C(!0)}),D=YR.useCallback(()=>{let P=A.current.entries().next().value;if(P[0]&&!P[1].hasLoadedAll){let N=new AbortController;I({abortController:N,relationSlug:P[0]})}},[]),E=Ff(()=>{if(a){if(r)return Array.isArray(a)?a.map(P=>{if(f){let N;return m.forEach(B=>{B.options&&B.options.some(M=>M?.value==P.value?(N=M,!0):!1)}),N}return m.find(N=>N.value==P)}):void 0;if(f){let P,N=a;return m.forEach(B=>{B?.options&&B.options.some(M=>M?.value==N.value?(P=M,!0):!1)}),P}return m.find(P=>P.value==a)}},[r,f,a,m]),T=Ff(P=>{if(P!==p){h({type:"CLEAR",i18n:S,required:!1});let N=Array.isArray(s)?s:[s];A.current=new Map(N.map(B=>[B,{hasLoadedAll:!1,nextPage:1}])),g(P)}},[S,s,p]),L=Ff(async(P,N)=>{if(!v&&P!=="null"&&P&&N){let B=await fetch(`${u}${c}/${N}/${P}?depth=0`,{credentials:"include",headers:{"Accept-Language":S.language}});if(B.ok){let M=await B.json();R({docs:[M]},N)}else console.error(w("error:loadingDocument",{id:P}))}},[S,R,c,v,u,w]);ZR(()=>{let P=Array.isArray(s)?s:[s];A.current=new Map(P.map(B=>[B,{hasLoadedAll:!1,nextPage:1}])),h({type:"CLEAR",i18n:S,required:!1}),C(!1);let N=[];return P.forEach(B=>{let M=new AbortController;I({abortController:M,relationSlug:B}),N.push(M)}),()=>{N.forEach(B=>{if(B.signal)try{B.abort()}catch{}})}},[S,s,b,i]),ZR(()=>{if(a&&y){if(r)(E()||[]).forEach((N,B)=>{N||(f?L(a[B].value,a[B].relationTo):L(a[B],s))});else if(!E())if(f){let N=a;L(N.value,N.relationTo)}else L(a,s)}},[L,E,r,f,s,a,y]);let k=["field-type",JR,v&&"error-loading"].filter(Boolean).join(" "),j=E()||a;return iV("div",{className:k,children:[!v&&UR(ft,{disabled:e,isMulti:r,isSortable:o,onChange:P=>{if(!P){l(null);return}r&&Array.isArray(P)?l(P?P.map(N=>f?{relationTo:N?.relationTo,value:N?.value}:N?.value):null):f&&!Array.isArray(P)?l({relationTo:P?.relationTo,value:P?.value}):Array.isArray(P)||l(P?.value)},onInputChange:T,onMenuScrollToBottom:D,options:m,placeholder:n,value:j}),v&&UR("div",{className:`${JR}__error-loading`,children:v})]})};import{c as cV}from"react/compiler-runtime";import{jsx as uV}from"react/jsx-runtime";import{getTranslation as F1}from"@payloadcms/translations";import A1 from"react";var T1=t=>{let e=cV(26),{disabled:o,field:n,isClearable:r,onChange:s,operator:i,options:l,value:a}=t,{admin:c}=n,{placeholder:u}=c,{i18n:d}=$(),f;e[0]!==l?(f=Ql(l),e[0]=l,e[1]=f):f=e[1];let[m,h]=A1.useState(f),p;e[2]===Symbol.for("react.memo_cache_sentinel")?(p=["in","not_in"],e[2]=p):p=e[2];let g=p.includes(i),b;if(g&&Array.isArray(a)){let _;e[3]!==d||e[4]!==m?(_=A=>{let R=m.find(I=>I.value===A);return{label:R?F1(R.label,d):A,value:R?.value??A}},e[3]=d,e[4]=m,e[5]=_):_=e[5],b=a.map(_)}else if(a){let _,A;if(e[6]!==d||e[7]!==m||e[8]!==a){let R;e[11]!==a?(R=I=>I.value===a,e[11]=a,e[12]=R):R=e[12],_=m.find(R),A=_?F1(_.label,d):a,e[6]=d,e[7]=m,e[8]=a,e[9]=_,e[10]=A}else _=e[9],A=e[10];b={label:A,value:_?.value??a}}let v;e[13]!==g||e[14]!==s?(v=_=>{let A;_?g?Array.isArray(_)?A=_.map(dV):A=[]:A=_.value:A=null,s(A)},e[13]=g,e[14]=s,e[15]=v):v=e[15];let x=v,y,C;e[16]!==l?(y=()=>{h(Ql(l))},C=[l],e[16]=l,e[17]=y,e[18]=C):(y=e[17],C=e[18]),A1.useEffect(y,C);let S,w;e[19]!==g||e[20]!==s||e[21]!==a?(S=()=>{!g&&Array.isArray(a)&&s(a[0])},w=[g,s,a],e[19]=g,e[20]=s,e[21]=a,e[22]=S,e[23]=w):(S=e[22],w=e[23]),A1.useEffect(S,w);let F;return e[24]!==d?(F=_=>({..._,label:F1(_.label,d)}),e[24]=d,e[25]=F):F=e[25],uV(ft,{disabled:o,isClearable:r,isMulti:g,onChange:x,options:m.map(F),placeholder:u,value:b})};function dV(t){return t.value}import{c as mV}from"react/compiler-runtime";import{jsx as QR}from"react/jsx-runtime";import KR from"react";var fV="condition-value-text",E1=t=>{let e=mV(18),{disabled:o,field:n,onChange:r,operator:s,value:i}=t,{hasMany:l}=n,{t:a}=$(),c;e[0]!==l||e[1]!==s?(c=["in","not_in"].includes(s)||l,e[0]=l,e[1]=s,e[2]=c):c=e[2];let u=c,d;e[3]===Symbol.for("react.memo_cache_sentinel")?(d=[],e[3]=d):d=e[3];let[f,m]=KR.useState(d),h;e[4]!==u||e[5]!==r?(h=x=>{let y;x?u&&(Array.isArray(x)?y=x.map(pV):y=[x.value?.value||x.value]):y=[],r(y)},e[4]=u,e[5]=r,e[6]=h):h=e[6];let p=h,g,b;e[7]!==i?(g=()=>{Array.isArray(i)?m(i.map(hV)):m([])},b=[i],e[7]=i,e[8]=g,e[9]=b):(g=e[8],b=e[9]),KR.useEffect(g,b);let v;return e[10]!==o||e[11]!==u||e[12]!==r||e[13]!==p||e[14]!==a||e[15]!==i||e[16]!==f?(v=u?QR(ft,{disabled:o,isClearable:!0,isCreatable:!0,isMulti:u,isSortable:!0,onChange:p,options:[],placeholder:a("general:enterAValue"),value:f||[]}):QR("input",{className:fV,disabled:o,onChange:x=>r(x.target.value),placeholder:a("general:enterAValue"),type:"text",value:i||""}),e[10]=o,e[11]=u,e[12]=r,e[13]=p,e[14]=a,e[15]=i,e[16]=f,e[17]=v):v=e[17],v};function pV(t){return t.value?.value||t.value}function hV(t,e){return{id:`${t}${e}`,label:`${t}`,value:{toString:()=>`${t}${e}`,value:t?.value||t}}}var e_=({booleanSelect:t,disabled:e,filterOptions:o,internalField:n,onChange:r,operator:s,options:i,value:l})=>{if(t||["radio","select"].includes(n?.field?.type))return uu(T1,{disabled:e,field:n.field,isClearable:!t,onChange:r,operator:s,options:i,value:l});switch(n?.field?.type){case"date":return uu(I1,{disabled:e,field:n.field,onChange:r,operator:s,value:l});case"number":return uu(R1,{disabled:e,field:n.field,onChange:r,operator:s,value:l});case"relationship":return uu(D1,{disabled:e,field:n.field,filterOptions:o,onChange:r,operator:s,value:l});default:return uu(E1,{disabled:e,field:n?.field,onChange:r,operator:s,value:l})}};var t_=t=>({all:"any",contains:"string",equals:"any",exists:"boolean",greater_than:t==="date"?"object":"string",greater_than_equal:t==="date"?"object":"string",in:"any",intersects:"any",less_than:t==="date"?"object":"string",less_than_equal:t==="date"?"object":"string",like:"string",near:"any",not_equals:"any",not_in:"any",not_like:"string",within:"any"});var Vn="condition",r_=t=>{let{addCondition:e,andIndex:o,fieldName:n,filterOptions:r,operator:s,orIndex:i,reducedFields:l,removeCondition:a,RenderedFilter:c,updateCondition:u,value:d}=t,{t:f}=$(),m=l.find(w=>w.value===n),[h,p]=bV(d),g=qo(h,300),b=["exists"].includes(s)||m?.field?.type==="checkbox",v=[];b?v=[{label:f("general:true"),value:"true"},{label:f("general:false"),value:"false"}]:m?.field&&"options"in m.field&&(v=m.field.options);let x=to(async w=>{s&&await u({andIndex:o,field:m,operator:s,orIndex:i,value:w===null?"":w})});gV(()=>{x(g)},[g]);let y=!m?.value&&typeof m?.value!="number"||m?.field?.admin?.disableListFilter,C=o_(async w=>{p(void 0),await u({andIndex:o,field:l.find(F=>F.value===w.value),operator:s,orIndex:i,value:void 0})},[o,s,i,l,u]),S=o_(async w=>{let _=t_(m.field.type)[w.value]||"any",A=_==="any"||typeof d===_||_==="boolean"&&(d==="true"||d==="false");A||p(void 0),await u({andIndex:o,field:m,operator:w.value,orIndex:i,value:A?d:void 0})},[o,m,i,u,d]);return Bn("div",{className:Vn,children:P1("div",{className:`${Vn}__wrap`,children:[P1("div",{className:`${Vn}__inputs`,children:[Bn("div",{className:`${Vn}__field`,children:Bn(ft,{disabled:y,filterOption:(w,F)=>(w?.data?.plainTextLabel||w.label).toLowerCase().includes(F.toLowerCase()),isClearable:!1,onChange:C,options:l.filter(w=>!w.field.admin.disableListFilter),value:m||{value:m?.value}})}),Bn("div",{className:`${Vn}__operator`,children:Bn(ft,{disabled:y,isClearable:!1,onChange:S,options:m?.operators,value:m?.operators.find(w=>s===w.value)||null})}),Bn("div",{className:`${Vn}__value`,children:c||Bn(e_,{booleanSelect:b,disabled:!s||!m||m?.field?.admin?.disableListFilter,filterOptions:r,internalField:m,onChange:p,operator:s,options:v,value:h??""})})]}),P1("div",{className:`${Vn}__actions`,children:[Bn(se,{buttonStyle:"icon-label",className:`${Vn}__actions-remove`,icon:"x",iconStyle:"with-border",onClick:()=>a({andIndex:o,orIndex:i}),round:!0}),Bn(se,{buttonStyle:"icon-label",className:`${Vn}__actions-add`,icon:"plus",iconStyle:"with-border",onClick:()=>e({andIndex:o+1,field:l.find(w=>!w.field.admin?.disableListFilter),orIndex:i,relation:"and"}),round:!0})]})]})})};var N1=[{label:"equals",value:"equals"},{label:"isNotEqualTo",value:"not_equals"}],sr=[...N1,{label:"isIn",value:"in"},{label:"isNotIn",value:"not_in"},{label:"exists",value:"exists"}],n_=[...sr,{label:"isGreaterThan",value:"greater_than"},{label:"isLessThan",value:"less_than"},{label:"isLessThanOrEqualTo",value:"less_than_equal"},{label:"isGreaterThanOrEqualTo",value:"greater_than_equal"}],vV=[...N1,{label:"exists",value:"exists"},{label:"near",value:"near"}],s_={label:"within",value:"within"},i_={label:"intersects",value:"intersects"},du={label:"isLike",value:"like"},mu={label:"isNotLike",value:"not_like"},Va={label:"contains",value:"contains"},xV={checkbox:{component:"Text",operators:N1},code:{component:"Text",operators:[...sr,du,mu,Va]},date:{component:"Date",operators:[...sr,...n_]},email:{component:"Text",operators:[...sr,Va]},json:{component:"Text",operators:[...sr,du,Va,mu,s_,i_]},number:{component:"Number",operators:[...sr,...n_]},point:{component:"Point",operators:[...vV,s_,i_]},radio:{component:"Select",operators:[...sr]},relationship:{component:"Relationship",operators:[...sr]},richText:{component:"Text",operators:[...sr,du,mu,Va]},select:{component:"Select",operators:[...sr]},text:{component:"Text",operators:[...sr,du,mu,Va]},textarea:{component:"Text",operators:[...sr,du,mu,Va]},upload:{component:"Text",operators:[...sr]}},Ai=xV;import{getTranslation as Af}from"@payloadcms/translations";import{fieldIsHiddenOrDisabled as yV,fieldIsID as CV,tabHasName as wV}from"payload/shared";import{renderToStaticMarkup as SV}from"react-dom/server";var Ga=({fields:t,i18n:e,labelPrefix:o,pathPrefix:n})=>t.reduce((r,s)=>{if(yV(s)&&!CV(s))return r;if(s.type==="tabs"&&"tabs"in s)return s.tabs.forEach(l=>{if(typeof l.label!="boolean"){let a=Af(l.label,e),c=o?o+" > "+a:a,u=wV(l)&&l.name?n?n+"."+l.name:l.name:n;typeof a=="string"&&r.push(...Ga({fields:l.fields,i18n:e,labelPrefix:c,pathPrefix:u}))}}),r;if(s.type==="row"&&"fields"in s)return r.push(...Ga({fields:s.fields,i18n:e,labelPrefix:o,pathPrefix:n})),r;if(s.type==="collapsible"&&"fields"in s){let i=Af(s.label||"",e),l=o?o+" > "+i:i;return r.push(...Ga({fields:s.fields,i18n:e,labelPrefix:l,pathPrefix:n})),r}if((s.type==="group"||s.type==="array")&&"fields"in s){let i=Af(s.label||"",e),l=o?i?o+" > "+i:o:i,a=s.name?n?n+"."+s.name:s.name:n;return r.push(...Ga({fields:s.fields,i18n:e,labelPrefix:l,pathPrefix:a})),r}if(typeof Ai[s.type]=="object"){let i=new Set,l=Ai[s.type].operators.reduce((m,h)=>{if(!i.has(h.value)){i.add(h.value);let p=`operators:${h.label}`;m.push({...h,label:e.t(p)})}return m},[]),a=Af(s.label||"",e),c=o?Nc({field:s,prefix:o}):a,u=IV(c),d=n?_a(n,s):s.name,f={label:c,plainTextLabel:u,value:d,...Ai[s.type],field:s,operators:l};return r.push(f),r}return r},[]),IV=t=>{if(!t)return"";if(typeof t=="string")return t;let e=SV(t);if(typeof document<"u"){let o=document.createElement("div");return o.innerHTML=e,o.textContent||""}else return e.replace(/<[^>]*>/g,"")};var ln="where-builder",c_=t=>{let{collectionPluralLabel:e,fields:o,renderedFilters:n,resolvedFilterOptions:r}=t,{i18n:s,t:i}=$(),l=l_(()=>Ga({fields:o,i18n:s}),[o,s]),{handleWhereChange:a,query:c}=_t(),u=l_(()=>{let h=c.where;if(h){if(a_(h))return h.or;let p=_V(h);if(a_(p))return p.or;console.warn(`Invalid where query in URL: ${JSON.stringify(h)}`)}return[]},[c.where]),d=Tf.useCallback(async({andIndex:h,field:p,orIndex:g,relation:b})=>{let v=[...u],x=Ai[p.field.type].operators[0].value;b==="and"?v[g].and.splice(h,0,{[String(p.value)]:{[x]:void 0}}):v.push({and:[{[String(p.value)]:{[x]:void 0}}]}),await a({or:v})},[u,a]),f=Tf.useCallback(async({andIndex:h,field:p,operator:g,orIndex:b,value:v})=>{let x=u[b].and[h],y=Ai[p.field.type],C=g||y.operators[0].value;if(typeof x=="object"&&p.value){let S=v??x?.[C],w=S!==x?.[String(p.value)]?.[String(C)],F=C!==Object.keys(x?.[String(p.value)]||{})?.[0];if(w||F){let _={[String(p.value)]:{[C]:S}},A=[...u];A[b].and[h]=_,await a({or:A})}}},[u,a]),m=Tf.useCallback(async({andIndex:h,orIndex:p})=>{let g=[...u];g[p].and.splice(h,1),g[p].and.length===0&&g.splice(p,1),await a({or:g})},[u,a]);return fu("div",{className:ln,children:[u.length>0&&fu(Tf.Fragment,{children:[Gn("div",{className:`${ln}__label`,children:i("general:filterWhere",{label:RV(e,s)})}),Gn("ul",{className:`${ln}__or-filters`,children:u.map((h,p)=>{let g=`${p}_${Array.isArray(h?.and)?h.and.length:""}`;return fu("li",{children:[p!==0&&Gn("div",{className:`${ln}__label`,children:i("general:or")}),Gn("ul",{className:`${ln}__and-filters`,children:Array.isArray(h?.and)&&h.and.map((b,v)=>{let x=u[p].and[v],y=Object.keys(x)[0],C=Object.keys(x?.[y]||{})?.[0]||void 0,S=x?.[y]?.[C]||void 0;return fu("li",{children:[v!==0&&Gn("div",{className:`${ln}__label`,children:i("general:and")}),Gn(r_,{addCondition:d,andIndex:v,fieldName:y,filterOptions:r?.get(y),operator:C,orIndex:p,reducedFields:l,removeCondition:m,RenderedFilter:n?.get(y),updateCondition:f,value:S})]},v)})})]},g)})}),Gn(se,{buttonStyle:"icon-label",className:`${ln}__add-or`,icon:"plus",iconPosition:"left",iconStyle:"with-border",onClick:async()=>{await d({andIndex:0,field:l[0],orIndex:u.length,relation:"or"})},children:i("general:or")})]}),u.length===0&&fu("div",{className:`${ln}__no-filters`,children:[Gn("div",{className:`${ln}__label`,children:i("general:noFiltersSet")}),Gn(se,{buttonStyle:"icon-label",className:`${ln}__add-first-filter`,icon:"plus",iconPosition:"left",iconStyle:"with-border",onClick:async()=>{l.length>0&&await d({andIndex:0,field:l.find(h=>!h.field.admin?.disableListFilter),orIndex:u.length,relation:"or"})},children:i("general:addFilter")})]})]})};import{c as DV}from"react/compiler-runtime";import{jsx as Ef,jsxs as FV}from"react/jsx-runtime";import{getTranslation as AV}from"@payloadcms/translations";import{jsx as u_}from"react/jsx-runtime";import"react";var d_=({className:t})=>u_("svg",{className:["icon","icon--people",t].filter(Boolean).join(" "),height:"14",viewBox:"0 0 16 14",width:"16",xmlns:"http://www.w3.org/2000/svg",children:u_("path",{className:"stroke",d:"M12.0002 13C12.0002 11.5855 11.4383 10.229 10.4381 9.22876C9.43787 8.22857 8.08132 7.66667 6.66683 7.66667M6.66683 7.66667C5.25234 7.66667 3.89579 8.22857 2.89559 9.22876C1.8954 10.229 1.3335 11.5855 1.3335 13M6.66683 7.66667C8.50778 7.66667 10.0002 6.17428 10.0002 4.33333C10.0002 2.49238 8.50778 1 6.66683 1C4.82588 1 3.3335 2.49238 3.3335 4.33333C3.3335 6.17428 4.82588 7.66667 6.66683 7.66667ZM14.6668 12.3333C14.6668 10.0867 13.3335 8 12.0002 7C12.4384 6.67118 12.7889 6.23939 13.0205 5.74285C13.2522 5.2463 13.3578 4.70031 13.3282 4.1532C13.2985 3.60609 13.1344 3.07472 12.8505 2.60613C12.5665 2.13754 12.1714 1.74617 11.7002 1.46667",strokeLinecap:"square"})});var pu="active-query-preset";function m_(t){let e=DV(36),{activePreset:o,openPresetListDrawer:n,resetPreset:r}=t,{i18n:s,t:i}=$(),{getEntityConfig:l}=W(),a,c,u,d,f,m,h,p,g,b,v;if(e[0]!==o||e[1]!==l||e[2]!==s||e[3]!==n||e[4]!==i){let y=l({collectionSlug:"payload-query-presets"});c=FV,u=vt;let C=o&&`${pu}--active`,S;e[16]!==C?(S=[pu,C].filter(Boolean),e[16]=C,e[17]=S):S=e[17],p=S.join(" "),g="select-preset",e[18]!==n?(b=()=>{n()},e[18]=n,e[19]=b):b=e[19],v=o?"always-white":"light",e[20]!==o?.isShared?(h=o?.isShared&&Ef(d_,{className:`${pu}__shared`}),e[20]=o?.isShared,e[21]=h):h=e[21],f=Ef,m="div",a=`${pu}__label-text`,d=o?.title||i("general:selectLabel",{label:AV(y.labels.singular,s)}),e[0]=o,e[1]=l,e[2]=s,e[3]=n,e[4]=i,e[5]=a,e[6]=c,e[7]=u,e[8]=d,e[9]=f,e[10]=m,e[11]=h,e[12]=p,e[13]=g,e[14]=b,e[15]=v}else a=e[5],c=e[6],u=e[7],d=e[8],f=e[9],m=e[10],h=e[11],p=e[12],g=e[13],b=e[14],v=e[15];let x;return e[22]!==o||e[23]!==r||e[24]!==a||e[25]!==c||e[26]!==u||e[27]!==d||e[28]!==f||e[29]!==m||e[30]!==h||e[31]!==p||e[32]!==g||e[33]!==b||e[34]!==v?(x=c(u,{className:p,id:g,onClick:b,pillStyle:v,children:[h,f(m,{className:a,children:d}),o?Ef("div",{className:`${pu}__clear`,id:"clear-preset",onClick:async y=>{y.stopPropagation(),await r()},onKeyDown:async y=>{y.stopPropagation(),await r()},role:"button",tabIndex:0,children:Ef(pt,{})}):null]}),e[22]=o,e[23]=r,e[24]=a,e[25]=c,e[26]=u,e[27]=d,e[28]=f,e[29]=m,e[30]=h,e[31]=p,e[32]=g,e[33]=b,e[34]=v,e[35]=x):x=e[35],x}import{fieldAffectsData as TV,flattenTopLevelFields as EV}from"payload/shared";var f_=(t,e)=>t?EV(e).filter(n=>TV(n)&&t.includes(n.name)):null;import{jsx as wr,jsxs as PV}from"react/jsx-runtime";import{getTranslation as L1}from"@payloadcms/translations";import{transformColumnsToPreferences as p_,transformColumnsToSearchParams as h_}from"payload/shared";import{Fragment as NV,useCallback as Pf,useMemo as g_}from"react";var b_="confirm-delete-preset",Wa="payload-query-presets",v_=({activePreset:t,collectionSlug:e,queryPresetPermissions:o})=>{let{modified:n,query:r,refineListData:s,setModified:i}=_t(),{i18n:l,t:a}=$(),{openModal:c}=ue(),{config:{routes:{api:u}},getEntityConfig:d}=W(),f=d({collectionSlug:Wa}),[m,,{openDrawer:h}]=qt({id:t?.id,collectionSlug:Wa}),[p,,{closeDrawer:g,openDrawer:b}]=qt({collectionSlug:Wa}),v=g_(()=>({"payload-query-presets":{relatedCollection:{equals:e}}}),[e]),[x,,{closeDrawer:y,openDrawer:C}]=ci({collectionSlugs:[Wa],filterOptions:v,selectedCollection:Wa}),S=Pf(async R=>{await s({columns:R.columns?h_(R.columns):void 0,preset:R.id,where:R.where},!1)},[s]),w=Pf(async()=>{await s({columns:void 0,preset:void 0,where:void 0},!1)},[s]),F=Pf(async()=>{try{await fetch(`${u}/${Wa}/${t.id}`,{method:"DELETE"}).then(async R=>{try{let I=await R.json();R.status<400?(me.success(a("general:titleDeleted",{label:L1(f?.labels?.singular,l),title:t.title})),await w()):I.errors?I.errors.forEach(D=>me.error(D.message)):me.error(a("error:deletingTitle",{title:t.title}))}catch{me.error(a("error:deletingTitle",{title:t.title}))}})}catch{me.error(a("error:deletingTitle",{title:t.title}))}},[u,t?.id,t?.title,a,f,l,w]),_=Pf(async()=>{try{await fetch(`${u}/payload-query-presets/${t.id}`,{body:JSON.stringify({columns:p_(r.columns),where:r.where}),credentials:"include",headers:{"Content-Type":"application/json"},method:"PATCH"}).then(async R=>{try{let I=await R.json();R.status<400?(me.success(a("general:updatedLabelSuccessfully",{label:L1(f?.labels?.singular,l)})),i(!1)):I.errors?I.errors.forEach(D=>me.error(D.message)):me.error(a("error:unknown"))}catch{me.error(a("error:unknown"))}})}catch{me.error(a("error:unknown"))}},[u,t?.id,r.columns,r.where,a,f?.labels?.singular,l,i]),A=g_(()=>{let R=[wr(ku,{label:L1(f?.labels?.plural,l)},"preset-group-label")];return t&&n&&(R.push(wr(Be.Button,{onClick:async()=>{await s({columns:h_(t.columns),where:t.where},!1)},children:a("general:reset")})),o.update&&R.push(wr(Be.Button,{onClick:async()=>{await _()},children:t.isShared?a("general:updateForEveryone"):a("general:save")}))),R.push(wr(Be.Button,{onClick:()=>{b()},children:a("general:createNew")})),t&&o?.delete&&R.push(PV(NV,{children:[wr(Be.Button,{onClick:()=>c(b_),children:a("general:delete")}),wr(Be.Button,{onClick:()=>{h()},children:a("general:edit")})]})),R},[t,o?.delete,o?.update,b,h,c,_,a,s,n,f?.labels?.plural,l]);return{CreateNewPresetDrawer:wr(p,{initialData:{columns:p_(r.columns),relatedCollection:e,where:r.where},onSave:async({doc:R})=>{g(),await S(R)},redirectAfterCreate:!1}),DeletePresetModal:wr(Rt,{body:wr(Ii,{elements:{1:({children:R})=>wr("strong",{children:R})},i18nKey:"general:aboutToDelete",t:a,variables:{label:f?.labels?.singular,title:t?.title}}),confirmingLabel:a("general:deleting"),heading:a("general:confirmDeletion"),modalSlug:b_,onConfirm:F}),EditPresetDrawer:wr(m,{onDelete:()=>{},onDuplicate:async({doc:R})=>{await S(R)},onSave:async({doc:R})=>{await S(R)}}),hasModifiedPreset:n,openPresetListDrawer:C,PresetListDrawer:wr(x,{allowCreate:!1,disableQueryPresets:!0,onSelect:async({doc:R})=>{y(),await S(R)}}),queryPresetMenuItems:A,resetPreset:w}};var Do="list-controls",$1=t=>{let{beforeActions:e,collectionConfig:o,collectionSlug:n,disableQueryPresets:r,enableColumns:s=!0,enableSort:i=!1,listMenuItems:l,queryPreset:a,queryPresetPermissions:c,renderedFilters:u,resolvedFilterOptions:d}=t,{handleSearchChange:f,query:m}=_t(),{CreateNewPresetDrawer:h,DeletePresetModal:p,EditPresetDrawer:g,hasModifiedPreset:b,openPresetListDrawer:v,PresetListDrawer:x,queryPresetMenuItems:y,resetPreset:C}=v_({activePreset:a,collectionSlug:n,queryPresetPermissions:c}),S=Nb(o),{i18n:w,t:F}=$(),{breakpoints:{s:_}}=Co(),A=(S&&Ha("label"in S&&(typeof S.label=="string"||typeof S.label=="object")?S.label:"name"in S?S.name:null,w))??"ID",R=f_(o.admin.listSearchableFields,o.fields),I=C_(F("general:searchBy",{label:Ha(A,w)})),D=C_(!!m?.where),E=LV(m?.where),[T,L]=kV(E?"where":void 0);y_(()=>{D.current&&!m?.where?D.current=!1:m?.where&&(D.current=!0)},[L,m?.where]),y_(()=>{R?.length>0?I.current=R.reduce((j,P,N)=>{let B="label"in P&&P.label?P.label:"name"in P?P.name:null;return N===0?`${F("general:searchBy",{label:Ha(B,w)})}`:N===R.length-1?`${j} ${F("general:or")} ${Ha(B,w)}`:`${j}, ${Ha(B,w)}`},""):I.current=F("general:searchBy",{label:Ha(A,w)})},[F,R,w,A]);let k=l;return o?.enableQueryPresets&&!r&&y?.length>0&&(k=[...y,l?.length>0?Wt(Be.Divider,{},"divider"):null,...l||[]]),Nf(x_,{children:[Nf("div",{className:Do,children:[Nf("div",{className:`${Do}__wrap`,children:[Wt(Pl,{}),Wt(S1,{fieldName:S&&"name"in S?S?.name:null,handleChange:j=>void f(j),initialParams:m,label:I.current},n),a&&b?Wt("div",{className:`${Do}__modified`,children:"Modified"}):null,Wt("div",{className:`${Do}__buttons`,children:Nf("div",{className:`${Do}__buttons-wrap`,children:[!_&&Wt($V.Fragment,{children:e&&e}),s&&Wt(vt,{"aria-controls":`${Do}-columns`,"aria-expanded":T==="columns",className:`${Do}__toggle-columns`,icon:Wt(Ze,{direction:T==="columns"?"up":"down"}),onClick:()=>L(T!=="columns"?"columns":void 0),pillStyle:"light",children:F("general:columns")}),Wt(vt,{"aria-controls":`${Do}-where`,"aria-expanded":T==="where",className:`${Do}__toggle-where`,icon:Wt(Ze,{direction:T==="where"?"up":"down"}),onClick:()=>L(T!=="where"?"where":void 0),pillStyle:"light",children:F("general:filters")}),i&&Wt(vt,{"aria-controls":`${Do}-sort`,"aria-expanded":T==="sort",className:`${Do}__toggle-sort`,icon:Wt(Ze,{}),onClick:()=>L(T!=="sort"?"sort":void 0),pillStyle:"light",children:F("general:sort")}),!r&&Wt(m_,{activePreset:a,openPresetListDrawer:v,resetPreset:C}),k&&Array.isArray(k)&&k.length>0&&Wt(ho,{button:Wt(kR,{ariaLabel:F("general:moreOptions")}),className:`${Do}__popup`,horizontalAlign:"right",id:"list-menu",size:"large",verticalAlign:"bottom",children:Wt(Be.ButtonGroup,{children:k.map((j,P)=>Wt(x_,{children:j},`list-menu-item-${P}`))})})]})})]}),s&&Wt(Tr,{className:`${Do}__columns`,height:T==="columns"?"auto":0,id:`${Do}-columns`,children:Wt(um,{collectionSlug:o.slug})}),Wt(Tr,{className:`${Do}__where`,height:T==="where"?"auto":0,id:`${Do}-where`,children:Wt(c_,{collectionPluralLabel:o?.labels?.plural,collectionSlug:o.slug,fields:o?.fields,renderedFilters:u,resolvedFilterOptions:d})})]}),x,g,h,p]})};import{c as UV}from"react/compiler-runtime";import{jsx as Ti,jsxs as T_}from"react/jsx-runtime";import{Fragment as YV}from"react";import{jsx as w_,jsxs as jV}from"react/jsx-runtime";import{getTranslation as S_}from"@payloadcms/translations";import{useRouter as OV,useSearchParams as MV}from"next/navigation.js";import*as R_ from"qs-esm";import BV,{useCallback as I_}from"react";var VV="publish-many",k1=t=>{let{clearRouteCache:e}=Mn(),{collection:{slug:o,labels:{plural:n,singular:r},versions:s}={}}=t,{config:{routes:{api:i},serverURL:l}}=W(),{permissions:a}=De(),{i18n:c,t:u}=$(),{getQueryParams:d,selectAll:f}=ro(),m=OV(),h=MV(),{openModal:p}=ue(),b=a?.collections?.[o]?.update,v=`publish-${o}`,x=I_(()=>{me.error(u("error:unknown"))},[u]),y=I_(async()=>{await Ke.patch(`${l}${i}/${o}${d({_status:{not_equals:"published"}})}&draft=true`,{body:JSON.stringify({_status:"published"}),headers:{"Accept-Language":c.language,"Content-Type":"application/json"}}).then(async C=>{try{let S=await C.json(),w=S?.docs.length||0,F=w>1?n:r;return C.status<400||w>0?(me.success(u("general:updatedCountSuccessfully",{count:w,label:S_(F,c)})),S?.errors.length>0&&me.error(S.message,{description:S.errors.map(_=>_.message).join(`
57
+ `)}),m.replace(R_.stringify({...jr(h),page:f?"1":void 0},{addQueryPrefix:!0})),e(),null):(S.errors?S.errors.forEach(_=>me.error(_.message)):x(),!1)}catch{return x()}})},[l,i,o,d,c,n,r,u,m,h,f,e,x]);return!s?.drafts||f===xo.None||!b?null:jV(BV.Fragment,{children:[w_("button",{className:`${VV}__toggle`,onClick:()=>{p(v)},type:"button",children:u("version:publish")}),w_(Rt,{body:u("version:aboutToPublishSelection",{label:S_(n,c)}),cancelLabel:u("general:cancel"),confirmingLabel:u("version:publishing"),confirmLabel:u("general:confirm"),heading:u("version:confirmPublish"),modalSlug:v,onConfirm:y})]})};import{jsx as __,jsxs as GV}from"react/jsx-runtime";import{getTranslation as D_}from"@payloadcms/translations";import{useRouter as WV,useSearchParams as HV}from"next/navigation.js";import*as A_ from"qs-esm";import zV,{useCallback as F_}from"react";var XV="unpublish-many",j1=t=>{let{collection:{slug:e,labels:{plural:o,singular:n},versions:r}={}}=t,{config:{routes:{api:s},serverURL:i}}=W(),{permissions:l}=De(),{toggleModal:a}=ue(),{i18n:c,t:u}=$(),d=HV(),{getQueryParams:f,selectAll:m}=ro(),h=WV(),{clearRouteCache:p}=Mn(),b=l?.collections?.[e]?.update,v=`unpublish-${e}`,x=F_(()=>{me.error(u("error:unknown"))},[u]),y=F_(async()=>{await Ke.patch(`${i}${s}/${e}${f({_status:{not_equals:"draft"}})}`,{body:JSON.stringify({_status:"draft"}),headers:{"Accept-Language":c.language,"Content-Type":"application/json"}}).then(async C=>{try{let S=await C.json(),w=S?.docs.length||0,F=w>1?o:n;return C.status<400||w>0?(me.success(u("general:updatedCountSuccessfully",{count:w,label:D_(F,c)})),S?.errors.length>0&&me.error(S.message,{description:S.errors.map(_=>_.message).join(`
58
+ `)}),h.replace(A_.stringify({...jr(d),page:m?"1":void 0},{addQueryPrefix:!0})),p(),null):(S.errors?S.errors.forEach(_=>me.error(_.message)):x(),!1)}catch{return x()}})},[i,s,e,f,c,o,n,u,h,d,m,p,x]);return!r?.drafts||m===xo.None||!b?null:GV(zV.Fragment,{children:[__("button",{className:`${XV}__toggle`,onClick:()=>{a(v)},type:"button",children:u("version:unpublish")}),__(Rt,{body:u("version:aboutToUnpublishSelection",{label:D_(o,c)}),confirmingLabel:u("version:unpublishing"),heading:u("version:confirmUnpublish"),modalSlug:v,onConfirm:y})]})};var E_="list-selection",hu=t=>{let e=UV(10),{collectionConfig:o,disableBulkDelete:n,disableBulkEdit:r,label:s}=t,{count:i,selectAll:l,toggleAll:a,totalDocs:c}=ro(),{t:u}=$();if(i===0)return null;let d;return e[0]!==o||e[1]!==i||e[2]!==n||e[3]!==r||e[4]!==s||e[5]!==l||e[6]!==u||e[7]!==a||e[8]!==c?(d=T_("div",{className:E_,children:[Ti("span",{children:u("general:selectedCount",{count:i,label:""})}),l!==xo.AllAvailable&&i<c&&Ti("button",{"aria-label":u("general:selectAll",{count:i,label:s}),className:`${E_}__button`,id:"select-all-across-pages",onClick:()=>a(!0),type:"button",children:u("general:selectAll",{count:c,label:""})}),!r&&!n&&Ti("span",{children:"\u2014"}),!r&&T_(YV,{children:[Ti(x1,{collection:o}),Ti(k1,{collection:o}),Ti(j1,{collection:o})]}),!n&&Ti(l1,{collection:o})]}),e[0]=o,e[1]=i,e[2]=n,e[3]=r,e[4]=s,e[5]=l,e[6]=u,e[7]=a,e[8]=c,e[9]=d):d=e[9],d};import{jsx as ir,jsxs as za,Fragment as ZV}from"react/jsx-runtime";import{getTranslation as Xa}from"@payloadcms/translations";import"react";var P_="list-header",Ei="list-drawer",JV=({className:t,collectionConfig:e,Description:o,disableBulkDelete:n,disableBulkEdit:r,hasCreatePermission:s,i18n:i,isBulkUploadEnabled:l,newDocumentURL:a,openBulkUpload:c,smallBreak:u,t:d})=>za("header",{className:[P_,t].filter(Boolean).join(" "),children:[ir("h1",{children:Xa(e?.labels?.plural,i)}),s&&za(ZV,{children:[ir(se,{"aria-label":i.t("general:createNewLabel",{label:Xa(e?.labels?.singular,i)}),buttonStyle:"pill",el:"link",size:"small",to:a,children:i.t("general:createNew")}),l&&ir(se,{"aria-label":d("upload:bulkUpload"),buttonStyle:"pill",onClick:c,size:"small",children:d("upload:bulkUpload")})]}),!u&&ir(hu,{collectionConfig:e,disableBulkDelete:n,disableBulkEdit:r,label:Xa(e?.labels?.plural,i)}),o]}),qV=({Description:t,hasCreatePermission:e,i18n:o,t:n})=>{let{config:{collections:r},getEntityConfig:s}=W(),{closeModal:i}=ue(),{DocumentDrawerToggler:l,drawerSlug:a,enabledCollections:c,selectedOption:u,setSelectedOption:d}=en(),f=s({collectionSlug:u.value}),m=r.filter(({slug:p})=>c.includes(p)),h=c.length>1;return za("header",{className:`${Ei}__header`,children:[za("div",{className:`${Ei}__header-wrap`,children:[za("div",{className:`${Ei}__header-content`,children:[ir("h2",{className:`${Ei}__header-text`,children:Xa(f?.labels?.plural,o)}),e&&ir(l,{className:`${Ei}__create-new-button`,children:ir(vt,{children:n("general:createNew")})})]}),ir("button",{"aria-label":n("general:close"),className:`${Ei}__header-close`,onClick:()=>{i(a)},type:"button",children:ir(pt,{})})]}),t,h&&za("div",{className:`${Ei}__select-collection-wrap`,children:[ir(ye,{label:n("upload:selectCollectionToBrowse")}),ir(ft,{className:`${P_}__select-collection`,onChange:d,options:m.map(p=>({label:Xa(p.labels.singular,o),value:p.slug})),value:{label:Xa(f?.labels.singular,o),value:f?.slug}})]})]})},O1=t=>{let{isInDrawer:e}=en();return e?ir(qV,{...t}):ir(JV,{...t})};import{c as QV}from"react/compiler-runtime";import{jsx as L_}from"react/jsx-runtime";import{formatAdminURL as KV}from"payload/shared";import"react";import{jsx as N_}from"react/jsx-runtime";import"react";var M1=()=>N_("svg",{className:"icon icon--logout",fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:N_("path",{className:"stroke",d:"M12 16H14.6667C15.0203 16 15.3594 15.8595 15.6095 15.6095C15.8595 15.3594 16 15.0203 16 14.6667V5.33333C16 4.97971 15.8595 4.64057 15.6095 4.39052C15.3594 4.14048 15.0203 4 14.6667 4H12M7.33333 13.3333L4 10M4 10L7.33333 6.66667M4 10H12",strokeLinecap:"square"})});var eG="nav",tG=t=>{let e=QV(5),{tabIndex:o}=t,n=o===void 0?0:o,{t:r}=$(),{config:s}=W(),{admin:i,routes:l}=s,{routes:a}=i,{logout:c}=a,{admin:u}=l,d;return e[0]!==u||e[1]!==c||e[2]!==r||e[3]!==n?(d=L_(Yt,{"aria-label":r("authentication:logOut"),className:`${eG}__log-out`,href:KV({adminRoute:u,path:c}),prefetch:!1,tabIndex:n,title:r("authentication:logOut"),children:L_(M1,{})}),e[0]=u,e[1]=c,e[2]=r,e[3]=n,e[4]=d):d=e[4],d};import{c as oG}from"react/compiler-runtime";import{jsx as Ua,jsxs as $_}from"react/jsx-runtime";import rG,{useState as k_}from"react";var _s="nav-group",nG="nav",sG=t=>{let e=oG(21),{children:o,isOpen:n,label:r}=t,[s,i]=k_(typeof n<"u"?!n:!1),[l,a]=k_(!1),{setPreference:c}=Ao(),{navOpen:u}=_i();if(r){let f;e[0]!==s||e[1]!==r||e[2]!==c?(f=()=>{a(!0);let F={};F?.[r]?F[r].open=!!s:F[r]={open:!!s},c(nG,{groups:F},!0),i(!s)},e[0]=s,e[1]=r,e[2]=c,e[3]=f):f=e[3];let m=f,h=`${r}`,p=s&&`${_s}--collapsed`,g;e[4]!==h||e[5]!==p?(g=[`${_s}`,h,p].filter(Boolean),e[4]=h,e[5]=p,e[6]=g):g=e[6];let b=g.join(" "),v=`nav-group-${r}`,x=`${_s}__toggle--${s?"collapsed":"open"}`,y;e[7]!==x?(y=[`${_s}__toggle`,x].filter(Boolean),e[7]=x,e[8]=y):y=e[8];let C=y.join(" "),S=u?0:-1,w;return e[9]!==l||e[10]!==o||e[11]!==s||e[12]!==r||e[13]!==S||e[14]!==b||e[15]!==v||e[16]!==C||e[17]!==m?(w=$_("div",{className:b,id:v,children:[$_("button",{className:C,onClick:m,tabIndex:S,type:"button",children:[Ua("div",{className:`${_s}__label`,children:r}),Ua("div",{className:`${_s}__indicator`,children:Ua(Ze,{className:`${_s}__indicator`,direction:s?void 0:"up"})})]}),Ua(Tr,{duration:l?200:0,height:s?0:"auto",children:Ua("div",{className:`${_s}__content`,children:o})})]}),e[9]=l,e[10]=o,e[11]=s,e[12]=r,e[13]=S,e[14]=b,e[15]=v,e[16]=C,e[17]=m,e[18]=w):w=e[18],w}let d;return e[19]!==o?(d=Ua(rG.Fragment,{children:o}),e[19]=o,e[20]=d):d=e[20],d};import{c as iG}from"react/compiler-runtime";import{jsx as Ds,jsxs as j_}from"react/jsx-runtime";import{collectionDefaults as aG,isNumber as lG}from"payload/shared";import"react";var Ya="per-page",cG=aG.admin.pagination.limits,B1=t=>{let e=iG(9),{defaultLimit:o,handleChange:n,limit:r,limits:s}=t,i=o===void 0?10:o,l=s===void 0?cG:s,{t:a}=$(),c=lG(r)?r:i,u;if(e[0]!==n||e[1]!==c||e[2]!==l||e[3]!==a){let d;e[5]!==n||e[6]!==c||e[7]!==l?(d=f=>{let{close:m}=f;return Ds(Be.ButtonGroup,{children:l.map((h,p)=>j_(Be.Button,{className:[`${Ya}__button`,h===c&&`${Ya}__button-active`].filter(Boolean).join(" "),onClick:()=>{m(),n&&n(h)},children:[h===c&&Ds("div",{className:`${Ya}__chevron`,children:Ds(Ze,{direction:"right",size:"small"})}),"\xA0",Ds("span",{children:h})]},p))})},e[5]=n,e[6]=c,e[7]=l,e[8]=d):d=e[8],u=Ds("div",{className:Ya,children:Ds(ho,{button:j_("div",{className:`${Ya}__base-button`,children:[Ds("span",{children:a("general:perPage",{limit:c})}),"\xA0",Ds(Ze,{className:`${Ya}__icon`})]}),horizontalAlign:"right",render:d,size:"small"})}),e[0]=n,e[1]=c,e[2]=l,e[3]=a,e[4]=u}else u=e[4];return u};import{c as pG}from"react/compiler-runtime";import{jsx as $f}from"react/jsx-runtime";import{Fragment as O_}from"react";import{c as uG}from"react/compiler-runtime";import{jsx as dG,jsxs as mG}from"react/jsx-runtime";import"react";function V1(t){return t===void 0||typeof t=="number"?t:decodeURIComponent(t)}var fG="id-label",Lf=t=>{let e=uG(9),{id:o,className:n,prefix:r}=t,s=r===void 0?"ID:":r,{config:i}=W(),{routes:l}=i,{admin:a}=l,{collectionSlug:c,globalSlug:u}=Pe(),d=qn(),f=`/${c?`collections/${c}`:`globals/${u}`}/${o}`,m;if(e[0]!==a||e[1]!==n||e[2]!==d||e[3]!==o||e[4]!==s||e[5]!==f){let h=pm({adminRoute:a,path:f}),p;e[7]!==n?(p=[fG,n].filter(Boolean),e[7]=n,e[8]=p):p=e[8],m=mG("div",{className:p.join(" "),title:o,children:[s,"\xA0",d>1?dG(Yt,{href:h,children:V1(o)}):V1(o)]}),e[0]=a,e[1]=n,e[2]=d,e[3]=o,e[4]=s,e[5]=f,e[6]=m}else m=e[6];return m};var G1="render-title",W1=t=>{let e=pG(10),{className:o,element:n,fallback:r,title:s}=t,i=n===void 0?"h1":n,{id:l,isInitializing:a,title:c}=Pe(),u=s||c||r,d=u===l,f=i,m;if(e[0]!==f||e[1]!==o||e[2]!==l||e[3]!==d||e[4]!==a||e[5]!==u){let h=$f(O_,{children:"\xA0"}),p=d&&`${G1}--has-id`,g;e[7]!==o||e[8]!==p?(g=[o,G1,p].filter(Boolean),e[7]=o,e[8]=p,e[9]=g):g=e[9],m=$f(f,{className:g.join(" "),title:u,children:a?h:$f(O_,{children:d?$f(Lf,{className:`${G1}__id`,id:l}):u||h})}),e[0]=f,e[1]=o,e[2]=l,e[3]=d,e[4]=a,e[5]=u,e[6]=m}else m=e[6];return m};import{c as hG}from"react/compiler-runtime";import{jsx as Za,jsxs as M_}from"react/jsx-runtime";import"react";var cn="sort-column",gG=t=>{let e=hG(22),{name:o,appearance:n,disable:r,Label:s,label:i}=t,l=r===void 0?!1:r,{handleSortChange:a,query:c}=_t(),{t:u}=$(),{sort:d}=c,f=`-${o}`,m=o,h;e[0]!==m||e[1]!==d?(h=[`${cn}__asc`],d===m&&h.push(`${cn}--active`),e[0]=m,e[1]=d,e[2]=h):h=e[2];let p;e[3]!==f||e[4]!==d?(p=[`${cn}__desc`],d===f&&p.push(`${cn}--active`),e[3]=f,e[4]=d,e[5]=p):p=e[5];let g=n&&`${cn}--appearance-${n}`,b;e[6]!==g?(b=[cn,g].filter(Boolean),e[6]=g,e[7]=b):b=e[7];let v=b.join(" "),x;e[8]!==s||e[9]!==i?(x=s??Za(ye,{hideLocale:!0,label:i,unstyled:!0}),e[8]=s,e[9]=i,e[10]=x):x=e[10];let y;return e[11]!==m||e[12]!==h||e[13]!==f||e[14]!==p||e[15]!==l||e[16]!==a||e[17]!==i||e[18]!==u||e[19]!==v||e[20]!==x?(y=M_("div",{className:v,children:[Za("span",{className:`${cn}__label`,children:x}),!l&&M_("div",{className:`${cn}__buttons`,children:[Za("button",{"aria-label":u("general:sortByLabelDirection",{direction:u("general:ascending"),label:i}),className:[...h,`${cn}__button`].filter(Boolean).join(" "),onClick:()=>void a(m),type:"button",children:Za(Ze,{direction:"up"})}),Za("button",{"aria-label":u("general:sortByLabelDirection",{direction:u("general:descending"),label:i}),className:[...p,`${cn}__button`].filter(Boolean).join(" "),onClick:()=>void a(f),type:"button",children:Za(Ze,{})})]})]}),e[11]=m,e[12]=h,e[13]=f,e[14]=p,e[15]=l,e[16]=a,e[17]=i,e[18]=u,e[19]=v,e[20]=x,e[21]=y):y=e[21],y};import{jsx as B_}from"react/jsx-runtime";import"react";var bG=t=>{let{className:e}=t;return B_("svg",{className:[e,"icon icon--externalLink"].filter(Boolean).join(" "),viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:B_("path",{className:"stroke",d:"M16 10.6667V14.6667C16 15.0203 15.8595 15.3594 15.6095 15.6095C15.3594 15.8595 15.0203 16 14.6667 16H5.33333C4.97971 16 4.64057 15.8595 4.39052 15.6095C4.14048 15.3594 4 15.0203 4 14.6667V5.33333C4 4.97971 4.14048 4.64057 4.39052 4.39052C4.64057 4.14048 4.97971 4 5.33333 4H9.33333M16 4L10 10M16 4H12M16 4V8",strokeLinecap:"square"})})};import{jsx as V_}from"react/jsx-runtime";import"react";var vG=()=>V_("svg",{"aria-hidden":"true",className:"graphic code-block-icon",focusable:"false",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:V_("path",{className:"stroke",d:"M14 12.6667L16.6667 9.99999L14 7.33332M5.99999 7.33332L3.33333 9.99999L5.99999 12.6667M11.6667 4.66666L8.33333 15.3333",strokeLinecap:"square"})});import{jsx as H1}from"react/jsx-runtime";import"react";var z1="minimize-maximize",xG=({className:t,isMinimized:e})=>{let o=[z1,e?`${z1}--minimized`:`${z1}--maximized`,t].filter(Boolean).join(" ");return H1("svg",{className:o,height:"20",stroke:"currentColor",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:e?H1("path",{d:"M7.33333 4H5.33333C4.97971 4 4.64057 4.14048 4.39052 4.39052C4.14048 4.64057 4 4.97971 4 5.33333V7.33333M16 7.33333V5.33333C16 4.97971 15.8595 4.64057 15.6095 4.39052C15.3594 4.14048 15.0203 4 14.6667 4H12.6667M4 12.6667V14.6667C4 15.0203 4.14048 15.3594 4.39052 15.6095C4.64057 15.8595 4.97971 16 5.33333 16H7.33333M12.6667 16H14.6667C15.0203 16 15.3594 15.8595 15.6095 15.6095C15.8595 15.3594 16 15.0203 16 14.6667V12.6667"}):H1("path",{d:"M7.33333 4V6C7.33333 6.35362 7.19286 6.69276 6.94281 6.94281C6.69276 7.19286 6.35362 7.33333 6 7.33333H4M16 7.33333H14C13.6464 7.33333 13.3072 7.19286 13.0572 6.94281C12.8071 6.69276 12.6667 6.35362 12.6667 6V4M4 12.6667H6C6.35362 12.6667 6.69276 12.8071 6.94281 13.0572C7.19286 13.3072 7.33333 13.6464 7.33333 14V16M12.6667 16V14C12.6667 13.6464 12.8071 13.3072 13.0572 13.0572C13.3072 12.8071 13.6464 12.6667 14 12.6667H16"})})};import{jsx as G_,jsxs as yG}from"react/jsx-runtime";import"react";var X1=()=>yG("svg",{fill:"none",height:"26",viewBox:"0 0 26 26",width:"26",xmlns:"http://www.w3.org/2000/svg",children:[G_("path",{d:"M13 21C17.4183 21 21 17.4183 21 13C21 8.58172 17.4183 5 13 5C8.58172 5 5 8.58172 5 13C5 17.4183 8.58172 21 13 21Z",fill:"var(--theme-error-500)"}),G_("path",{d:"M15.4001 10.5996L10.6001 15.3996M10.6001 10.5996L15.4001 15.3996",stroke:"var(--theme-error-50)",strokeLinecap:"round",strokeLinejoin:"round"})]});import{jsx as W_,jsxs as CG}from"react/jsx-runtime";import"react";var U1=()=>CG("svg",{fill:"none",height:"26",viewBox:"0 0 26 26",width:"26",xmlns:"http://www.w3.org/2000/svg",children:[W_("path",{d:"M13 21C17.4183 21 21 17.4183 21 13C21 8.58172 17.4183 5 13 5C8.58172 5 5 8.58172 5 13C5 17.4183 8.58172 21 13 21Z",fill:"var(--theme-elevation-500)"}),W_("path",{d:"M13 16.1998V12.9998M13 9.7998H13.0077",stroke:"var(--theme-elevation-50)",strokeLinecap:"round",strokeLinejoin:"round"})]});import{jsx as H_,jsxs as wG}from"react/jsx-runtime";import"react";var Y1=()=>wG("svg",{fill:"none",height:"26",viewBox:"0 0 26 26",width:"26",xmlns:"http://www.w3.org/2000/svg",children:[H_("path",{d:"M13 21C17.4183 21 21 17.4183 21 13C21 8.58172 17.4183 5 13 5C8.58172 5 5 8.58172 5 13C5 17.4183 8.58172 21 13 21Z",fill:"var(--theme-success-500)"}),H_("path",{d:"M10.6001 13.0004L12.2001 14.6004L15.4001 11.4004",stroke:"var(--theme-success-50)",strokeLinecap:"round",strokeLinejoin:"round"})]});import{jsx as z_,jsxs as SG}from"react/jsx-runtime";import"react";var Z1=()=>SG("svg",{fill:"none",height:"26",viewBox:"0 0 26 26",width:"26",xmlns:"http://www.w3.org/2000/svg",children:[z_("path",{d:"M13 21C17.4183 21 21 17.4183 21 13C21 8.58172 17.4183 5 13 5C8.58172 5 5 8.58172 5 13C5 17.4183 8.58172 21 13 21Z",fill:"var(--theme-warning-500)"}),z_("path",{d:"M13 10V13.2M13 16.4H13.008",stroke:"var(--theme-warning-50)",strokeLinecap:"round",strokeLinejoin:"round"})]});import{c as U_}from"react/compiler-runtime";import{jsx as X_}from"react/jsx-runtime";import Ja from"react";var Y_=Ja.createContext({addClientFunction:()=>null,removeClientFunction:()=>null}),Z_=Ja.createContext({}),J1=t=>{let e=U_(6),{children:o}=t,n;e[0]===Symbol.for("react.memo_cache_sentinel")?(n={},e[0]=n):n=e[0];let[r,s]=Ja.useState(n),i;e[1]===Symbol.for("react.memo_cache_sentinel")?(i=d=>{s(f=>{let m={...f};return m[d.key]=d.func,m})},e[1]=i):i=e[1];let l=i,a;e[2]===Symbol.for("react.memo_cache_sentinel")?(a=d=>{s(f=>{let m={...f};return delete m[d.key],m})},e[2]=a):a=e[2];let c=a,u;return e[3]!==o||e[4]!==r?(u=X_(Y_,{value:{addClientFunction:l,removeClientFunction:c},children:X_(Z_,{value:r,children:o})}),e[3]=o,e[4]=r,e[5]=u):u=e[5],u},IG=(t,e)=>{let o=U_(6),{addClientFunction:n,removeClientFunction:r}=Ja.use(Y_),s,i;o[0]!==n||o[1]!==e||o[2]!==t||o[3]!==r?(s=()=>(n({func:e,key:t}),()=>{r({func:e,key:t})}),i=[e,t,n,r],o[0]=n,o[1]=e,o[2]=t,o[3]=r,o[4]=s,o[5]=i):(s=o[4],i=o[5]),Ja.useEffect(s,i)},RG=()=>Ja.use(Z_);import{c as _G}from"react/compiler-runtime";import{jsx as J_}from"react/jsx-runtime";import DG,{useEffect as FG,useRef as AG}from"react";var q_=200,q1="progress-bar",TG=150,EG=()=>{let t=_G(9),{isTransitioning:e,transitionProgress:o}=st(),[n,r]=DG.useState(null),s=AG(!0),i,l;if(t[0]!==e||t[1]!==o?(i=()=>{let a,c;return e?s.current?c=setTimeout(()=>{r(o),s.current=!1},TG):r(o):(s.current=!0,r(1),a=setTimeout(()=>{r(null)},q_*2)),()=>{clearTimeout(a),clearTimeout(c)}},l=[e,o],t[0]=e,t[1]=o,t[2]=i,t[3]=l):(i=t[2],l=t[3]),FG(i,l),typeof n=="number"){let a=n===1&&`${q1}--fade-out`,c;t[4]!==a?(c=[q1,a].filter(Boolean),t[4]=a,t[5]=c):c=t[5];let u=c.join(" "),d;return t[6]!==n||t[7]!==u?(d=J_("div",{className:u,style:{"--transition-duration":`${q_}ms`},children:J_("div",{className:`${q1}__progress`,style:{width:`${(n||0)*100}%`}})}),t[6]=n,t[7]=u,t[8]=d):d=t[8],d}return null};import{c as PG}from"react/compiler-runtime";import{jsx as NG}from"react/jsx-runtime";import{createContext as LG,use as $G}from"react";var Q_=LG({}),kG=t=>{let e=PG(6),{children:o,visibleEntities:n}=t,r;e[0]!==n?(r=l=>{let{collectionSlug:a,globalSlug:c}=l;return a?n.collections.includes(a):c?n.globals.includes(c):!1},e[0]=n,e[1]=r):r=e[1];let s=r,i;return e[2]!==o||e[3]!==s||e[4]!==n?(i=NG(Q_,{value:{isEntityVisible:s,visibleEntities:n},children:o}),e[2]=o,e[3]=s,e[4]=n,e[5]=i):i=e[5],i},Q1=()=>$G(Q_);import{c as jG}from"react/compiler-runtime";import{jsx as OG}from"react/jsx-runtime";import{useParams as MG}from"next/navigation.js";import{createContext as BG,use as VG}from"react";var K_=BG({}),K1=t=>{let e=jG(3),{children:o}=t,n=MG(),r;return e[0]!==o||e[1]!==n?(r=OG(K_,{value:n,children:o}),e[0]=o,e[1]=n,e[2]=r):r=e[2],r},GG=()=>VG(K_);import{jsx as Ot,jsxs as rD}from"react/jsx-runtime";import $Me,{Fragment as kMe}from"react";import{useContext as HG}from"react";import{createContext as WG}from"react";var gu=WG({});var bu=()=>HG(gu);import zG,{useCallback as XG,useEffect as UG,useReducer as YG,useRef as ZG}from"react";var JG=(t,e)=>{let{timestamp:o,animationRef:n}=e;n.current=null;let{x:r,y:s,xDirection:i,yDirection:l,eventsFired:a,hasScrolled:c}=t,u=c||!!o,d=u?window.pageXOffset:0,f=u?window.pageYOffset:0,m=u?a+1:a,h=d-r,p=f-s,g=d/(document.body.scrollWidth-window.innerWidth)*100,b=f/(document.body.scrollHeight-window.innerHeight)*100,v=(g+b)/2,x=h>0?"right":h<0?"left":i,y=p>0?"down":p<0?"up":l;return{x:d,y:f,xDifference:h,yDifference:p,xDirection:x,yDirection:y,xPercentage:g,yPercentage:b,totalPercentage:v,eventsFired:m,hasScrolled:u}},vu=t=>{let{children:e}=t,o=ZG(null),[n,r]=YG(JG,{x:0,y:0,xDifference:0,yDifference:0,xDirection:void 0,yDirection:void 0,xPercentage:0,yPercentage:0,totalPercentage:0,eventsFired:0,hasScrolled:!1}),s=XG(i=>{o.current&&cancelAnimationFrame(o.current),o.current=requestAnimationFrame(l=>{r({e:i,timestamp:l,animationRef:o})})},[]);return UG(()=>(window.addEventListener("scroll",s),()=>{window.removeEventListener("scroll",s)}),[s]),zG.createElement(gu.Provider,{value:Object.assign({},n)},e&&e)};import WMe from"react";import{Fragment as nD}from"react";var{WindowInfoProvider:ev}=Un&&"WindowInfoProvider"in Un?Un:{WindowInfoProvider:void 0},{useWindowInfo:tv}=Un&&"useWindowInfo"in Un?Un:{useWindowInfo:void 0};import{jsx as qG}from"react/jsx-runtime";import{useSearchParams as QG}from"next/navigation.js";import*as kf from"qs-esm";import eD,{createContext as KG,use as eW}from"react";var tW={searchParams:{},stringifyParams:()=>""},tD=KG(tW),ov=({children:t})=>{let o=QG().toString(),n=eD.useMemo(()=>kf.parse(o,{depth:10,ignoreQueryPrefix:!0}),[o]),r=eD.useCallback(({params:s,replace:i=!1})=>kf.stringify({...i?{}:n,...s},{addQueryPrefix:!0}),[n]);return qG(tD,{value:{searchParams:n,stringifyParams:r},children:t})},oW=()=>eW(tD);import{jsx as xu}from"react/jsx-runtime";import"react";var oD=()=>xu(X0,{className:"payload-toast-container",closeButton:!0,dir:"undefined",gap:8,icons:{error:xu(X1,{}),info:xu(U1,{}),success:xu(Y1,{}),warning:xu(Z1,{})},offset:"calc(var(--gutter-h) / 2)",toastOptions:{classNames:{closeButton:"payload-toast-close-button",content:"toast-content",error:"toast-error",icon:"toast-icon",info:"toast-info",success:"toast-success",title:"toast-title",toast:"payload-toast-item",warning:"toast-warning"},unstyled:!0},visibleToasts:5});var rW=({children:t,config:e,dateFNSKey:o,fallbackLang:n,isNavOpen:r,languageCode:s,languageOptions:i,locale:l,permissions:a,serverFunction:c,switchLanguageServerAction:u,theme:d,translations:f,user:m})=>{let h=process.env.NEXT_PUBLIC_ENABLE_ROUTER_CACHE_REFRESH==="true"?n1:nD;return rD(nD,{children:[Ot(yg,{serverFunction:c,children:Ot(cp,{children:Ot(h,{children:Ot(zf,{config:e,children:Ot(J1,{children:Ot(Hf,{dateFNSKey:o,fallbackLang:n,language:s,languageOptions:i,switchLanguageServerAction:u,translations:f,children:Ot(ev,{breakpoints:{l:"(max-width: 1440px)",m:"(max-width: 1024px)",s:"(max-width: 768px)",xs:"(max-width: 400px)"},children:Ot(vu,{children:Ot(ov,{children:Ot(kp,{classPrefix:"payload",transTime:0,zIndex:"var(--z-modal)",children:rD(Hp,{permissions:a,user:m,children:[Ot(Up,{children:Ot(Uf,{theme:d,children:Ot(K1,{children:Ot(Yp,{locale:l,children:Ot(t1,{children:Ot(i3,{children:Ot(gb,{children:Ot(O4,{initialIsOpen:r,children:Ot(nb,{children:t})})})})})})})})}),Ot(Np,{}),Ot(J0,{})]})})})})})})})})})})}),Ot(oD,{})]})};import{jsx as sD,jsxs as nW}from"react/jsx-runtime";import{email as sW,username as iW}from"payload/shared";import"react";function rv(t){let{className:e,loginWithUsername:o,readOnly:n,t:r}=t,s=!o||o?.requireEmail||o?.allowEmailLogin,i=!!o;return nW("div",{className:e,children:[s?sD(ni,{field:{name:"email",admin:{autoComplete:"off"},label:r("general:email"),required:!o||o&&o.requireEmail},path:"email",readOnly:n,schemaPath:"email",validate:sW}):null,i&&sD(fi,{field:{name:"username",label:r("authentication:username"),required:o&&o.requireUsername},path:"username",readOnly:n,schemaPath:"username",validate:iW})]})}import{c as aW}from"react/compiler-runtime";import{jsx as lW}from"react/jsx-runtime";import"react";var iD="select-all",cW=()=>{let t=aW(7),{selectAll:e,toggleAll:o}=ro(),{i18n:n}=$(),r;if(t[0]!==n||t[1]!==e||t[2]!==o){let s;t[4]===Symbol.for("react.memo_cache_sentinel")?(s=[iD,`${iD}__checkbox`],t[4]=s):s=t[4];let i;t[5]!==o?(i=()=>o(),t[5]=o,t[6]=i):i=t[6],r=lW(Xs,{"aria-label":e===xo.None?n.t("general:selectAllRows"):n.t("general:deselectAllRows"),checked:e===xo.AllInPage||e===xo.AllAvailable,className:s.join(" "),id:"select-all",name:"select-all",onToggle:i,partialChecked:e===xo.Some}),t[0]=n,t[1]=e,t[2]=o,t[3]=r}else r=t[3];return r};import{c as uW}from"react/compiler-runtime";import{jsx as aD}from"react/jsx-runtime";import"react";var lD="select-row",dW=t=>{let e=uW(14),{rowData:o}=t,{user:n}=De(),{selected:r,setSelection:s}=ro(),i;e[0]!==o?(i=o||{},e[0]=o,e[1]=i):i=e[1];let{_isLocked:l,_userEditing:a}=i;if(l&&a&&a.id!==n?.id){let p;return e[2]!==a?(p=aD(lu,{user:a}),e[2]=a,e[3]=p):p=e[3],p}let u;e[4]!==o.id||e[5]!==r?(u=r.get(o.id),e[4]=o.id,e[5]=r,e[6]=u):u=e[6];let d=!!u,f;e[7]===Symbol.for("react.memo_cache_sentinel")?(f=[lD,`${lD}__checkbox`],e[7]=f):f=e[7];let m;e[8]!==o.id||e[9]!==s?(m=()=>s(o.id),e[8]=o.id,e[9]=s,e[10]=m):m=e[10];let h;return e[11]!==d||e[12]!==m?(h=aD(Xs,{checked:d,className:f.join(" "),onToggle:m}),e[11]=d,e[12]=m,e[13]=h):h=e[13],h};import{jsx as mW}from"react/jsx-runtime";import"react";var qa=t=>{let{onClick:e}=t,{count:o,selected:n}=ro();return!n||!o?null:mW(vt,{onClick:()=>{typeof e=="function"&&e(n)},pillStyle:"white",children:`Select ${o}`})};import{c as fW}from"react/compiler-runtime";import{jsx as Ht,jsxs as Pi}from"react/jsx-runtime";import{getTranslation as jf}from"@payloadcms/translations";import{useRouter as pW}from"next/navigation.js";import{formatFilesize as hW,isNumber as gW}from"payload/shared";import{Fragment as nv,useEffect as cD,useState as bW}from"react";var Wn="collection-list";function vW(t){let e=fW(17),{AfterList:o,AfterListTable:n,beforeActions:r,BeforeList:s,BeforeListTable:i,collectionSlug:l,columnState:a,Description:c,disableBulkDelete:u,disableBulkEdit:d,disableQueryPresets:f,enableRowSelections:m,hasCreatePermission:h,listMenuItems:p,newDocumentURL:g,queryPreset:b,queryPresetPermissions:v,renderedFilters:x,resolvedFilterOptions:y,Table:C}=t,[S,w]=bW(C),{allowCreate:F,createNewDrawerSlug:_,drawerSlug:A,onBulkSelect:R}=en(),I=F!==void 0?F&&h:h,D,E;e[0]!==C?(D=()=>{C&&w(C)},E=[C],e[0]=C,e[1]=D,e[2]=E):(D=e[1],E=e[2]),cD(D,E);let{user:T}=De(),{getEntityConfig:L}=W(),k=pW(),{data:j,defaultLimit:P,handlePageChange:N,handlePerPageChange:B,query:M}=_t(),{openModal:O}=ue(),{setCollectionSlug:V,setCurrentActivePath:G,setOnSuccess:z}=Ho(),{drawerSlug:X}=Ho(),te=L({collectionSlug:l}),{labels:Y,upload:H}=te,le=!!H,q=le&&te.upload.bulkUpload,fe=!!A,{i18n:ae,t:J}=$(),{setStepNav:ge}=On(),{breakpoints:Ce}=tv(),{s:he}=Ce,Le;if(le){let ce;e[3]!==j.docs?(ce=j.docs.map(xW),e[3]=j.docs,e[4]=ce):ce=e[4],Le=ce}else Le=j.docs;let Ae=Le,Q;e[5]!==X||e[6]!==l||e[7]!==O||e[8]!==k||e[9]!==V||e[10]!==G||e[11]!==z?(Q=()=>{V(l),G(l),O(X),z(l,()=>k.refresh())},e[5]=X,e[6]=l,e[7]=O,e[8]=k,e[9]=V,e[10]=G,e[11]=z,e[12]=Q):Q=e[12];let ke=Q;cD(()=>{fe||ge([{label:Y?.plural}])},[ge,Y,fe]);let xe;return e[13]!==r||e[14]!==m||e[15]!==R?(xe=m&&typeof R=="function"?r?[...r,Ht(qa,{onClick:R},"select-many")]:[Ht(qa,{onClick:R},"select-many")]:r,e[13]=r,e[14]=m,e[15]=R,e[16]=xe):xe=e[16],Ht(nv,{children:Ht(sc,{collectionSlug:l,columnState:a,children:Ht("div",{className:`${Wn} ${Wn}--${l}`,children:Pi(a1,{docs:Ae,totalDocs:j.totalDocs,user:T,children:[s,Pi(Bo,{className:`${Wn}__wrap`,children:[Ht(O1,{collectionConfig:te,Description:Ht("div",{className:`${Wn}__sub-header`,children:Ht(oe,{CustomComponent:c,Fallback:Ht(Gb,{collectionSlug:l,description:te?.admin?.description})})}),disableBulkDelete:u,disableBulkEdit:d,hasCreatePermission:I,i18n:ae,isBulkUploadEnabled:q&&!H.hideFileInputOnCreate,newDocumentURL:g,openBulkUpload:ke,smallBreak:he,t:J}),Ht($1,{beforeActions:xe,collectionConfig:te,collectionSlug:l,disableQueryPresets:te?.enableQueryPresets!==!0||f,listMenuItems:p,queryPreset:b,queryPresetPermissions:v,renderedFilters:x,resolvedFilterOptions:y}),i,Ae.length>0&&Ht(cc,{children:S}),Ae.length===0&&Pi("div",{className:`${Wn}__no-results`,children:[Ht("p",{children:ae.t("general:noResults",{label:jf(Y?.plural,ae)})}),I&&g&&Ht(nv,{children:fe?Ht(se,{el:"button",onClick:()=>O(_),children:ae.t("general:createNewLabel",{label:jf(Y?.singular,ae)})}):Ht(se,{el:"link",to:g,children:ae.t("general:createNewLabel",{label:jf(Y?.singular,ae)})})})]}),n,Ae.length>0&&Pi("div",{className:`${Wn}__page-controls`,children:[Ht(dc,{hasNextPage:j.hasNextPage,hasPrevPage:j.hasPrevPage,limit:j.limit,nextPage:j.nextPage,numberOfNeighbors:1,onChange:ce=>void N(ce),page:j.page,prevPage:j.prevPage,totalPages:j.totalPages}),j.totalDocs>0&&Pi(nv,{children:[Pi("div",{className:`${Wn}__page-info`,children:[j.page*j.limit-(j.limit-1),"-",j.totalPages>1&&j.totalPages!==j.page?j.limit*j.page:j.totalDocs," ",ae.t("general:of")," ",j.totalDocs]}),Ht(B1,{handleChange:ce=>void B(ce),limit:gW(M?.limit)?Number(M.limit):P,limits:te?.admin?.pagination?.limits,resetPage:j.totalDocs<=j.pagingCounter}),he&&Pi("div",{className:`${Wn}__list-selection`,children:[Ht(hu,{collectionConfig:te,disableBulkDelete:u,disableBulkEdit:d,label:jf(te.labels.plural,ae)}),Ht("div",{className:`${Wn}__list-selection-actions`,children:m&&typeof R=="function"?r?[...r,Ht(qa,{onClick:R},"select-many")]:[Ht(qa,{onClick:R},"select-many")]:r})]})]})]})]}),o]})})})})}function xW(t){return{...t,filesize:hW(t.filesize)}}import{jsx as ar,jsxs as yD}from"react/jsx-runtime";import{useRouter as GW,useSearchParams as WW}from"next/navigation.js";import{formatAdminURL as HW}from"payload/shared";import zW,{Fragment as XW,useCallback as uv,useEffect as CD,useMemo as UW,useRef as dv,useState as Bf}from"react";import{c as dD}from"react/compiler-runtime";import{jsx as Qa,jsxs as uD}from"react/jsx-runtime";var mD=t=>{let e=dD(7),{drawerSlug:o}=t,{closeModal:n}=ue(),{t:r}=$(),s;if(e[0]!==n||e[1]!==o||e[2]!==r){let i;e[4]!==n||e[5]!==o?(i=()=>n(o),e[4]=n,e[5]=o,e[6]=i):i=e[6],s=uD(Bo,{className:`${cs}__header`,children:[uD("div",{className:`${cs}__header-content`,children:[Qa("h2",{className:`${cs}__header-text`,children:Qa(W1,{element:"span"})}),Qa("button",{"aria-label":r("general:close"),className:`${cs}__header-close`,onClick:i,type:"button",children:Qa(pt,{})})]}),Qa(yW,{})]}),e[0]=n,e[1]=o,e[2]=r,e[3]=s}else s=e[3];return s},yW=()=>{let t=dD(3),{id:e,title:o}=Pe(),n;return t[0]!==e||t[1]!==o?(n=e&&e!==o?Qa(Lf,{id:e.toString()}):null,t[0]=e,t[1]=o,t[2]=n):n=t[2],n};import{formatAdminURL as CW}from"payload/shared";var fD=({adminRoute:t,router:e})=>{let o=CW({adminRoute:t,path:"/"});e.push(o)};import{formatAdminURL as wW}from"payload/shared";var pD=({adminRoute:t,collectionSlug:e,router:o})=>{let n=wW({adminRoute:t,path:e?`/collections/${e}`:"/"});o.push(n)};var sv=(t,e,o,n,r,s,i,l,a,c)=>{if(a)try{s(t,e??o,n),r||(l.current.hasShownLockedModal=!0),l.current={hasShownLockedModal:l.current?.hasShownLockedModal,isLocked:!0,user:n},i(n),r&&c&&c(!1)}catch(u){console.error("Error during document takeover:",u)}};import{c as AW}from"react/compiler-runtime";import{jsx as un,jsxs as yu}from"react/jsx-runtime";import TW,{Fragment as EW,useEffect as PW,useState as NW}from"react";import{jsx as Of,jsxs as iv}from"react/jsx-runtime";import{getTranslation as SW}from"@payloadcms/translations";import{text as IW}from"payload/shared";import RW,{useEffect as hD,useMemo as gD,useState as bD}from"react";var _W="apiKey",DW="api-key",FW="field-type",vD=({enabled:t,readOnly:e})=>{let[o]=bD(Sn()),[n,r]=bD(!1),{i18n:s,t:i}=$(),{config:l,getEntityConfig:a}=W(),{collectionSlug:c}=Pe(),u=Nt(([y])=>y&&y[_W]||null),d=a({collectionSlug:c})?.fields?.find(y=>"name"in y&&y.name==="apiKey"),f=y=>IW(y,{name:"apiKey",type:"text",blockData:{},data:{},event:"onChange",maxLength:48,minLength:24,path:["apiKey"],preferences:{fields:{}},req:{payload:{config:l},t:i},siblingData:{}}),m=u?.value,h=gD(()=>{let y="API Key";return d?.label&&(y=d.label),SW(y,s)},[d,s]),p=gD(()=>iv("div",{className:`${DW}__label`,children:[Of("span",{children:h}),Of(Oc,{value:m})]}),[h,m]),g=Ne({path:"apiKey",validate:f}),b=()=>{n&&r(!1),setTimeout(()=>{r(!0)},1)},{setValue:v,value:x}=g;return hD(()=>{!m&&t&&v(o),!t&&m&&v(null)},[m,t,v,o]),hD(()=>{n&&setTimeout(()=>{r(!1)},1e4)},[n]),t?iv(RW.Fragment,{children:[iv("div",{className:[FW,"api-key","read-only"].filter(Boolean).join(" "),children:[p,Of("input",{"aria-label":h,className:n?"highlight":void 0,disabled:!0,id:"apiKey",name:"apiKey",type:"text",value:x||""})]}),!e&&Of(y1,{highlightField:b,setKey:()=>v(Sn())})]}):null};var Mf="auth-fields",xD=t=>{let e=AW(57),{className:o,collectionSlug:n,disableLocalStrategy:r,email:s,loginWithUsername:i,operation:l,readOnly:a,requirePassword:c,setValidateBeforeSubmit:u,useAPIKey:d,username:f,verify:m}=t,{permissions:h}=De(),[p,g]=NW(c),b=Nt(LW),v=Nt($W),x=Ut(),{i18n:y,t:C}=$(),{docPermissions:S,isEditing:w,isInitializing:F}=Pe(),{config:_}=W(),{routes:A,serverURL:R}=_,{api:I}=A,D=!r||typeof r=="object"&&r.enableFields===!0,E=a||F,T=S?.fields===!0?!0:S?.fields?.enableAPIKey,L=a||T===!0||T&&typeof T=="object"&&!T?.update,k=a||T!==!0&&!T?.update,j=T===!0||T?.read,P;e:{let H=h?.collections?.[n];if(H){P=!!("unlock"in H&&H.unlock);break e}P=!1}let N=P,B;e[0]!==v||e[1]!==u||e[2]!==C?(B=H=>{H?(u(!0),v({type:"UPDATE",errorMessage:C("validation:required"),path:"password",valid:!1}),v({type:"UPDATE",errorMessage:C("validation:required"),path:"confirm-password",valid:!1})):(u(!1),v({type:"REMOVE",path:"password"}),v({type:"REMOVE",path:"confirm-password"})),g(H)},e[0]=v,e[1]=u,e[2]=C,e[3]=B):B=e[3];let M=B,O;e[4]!==I||e[5]!==n||e[6]!==s||e[7]!==y||e[8]!==i||e[9]!==R||e[10]!==C||e[11]!==f?(O=async()=>{let H=`${R}${I}/${n}/unlock`;(await fetch(H,{body:JSON.stringify(i&&f?{username:f}:{email:s}),credentials:"include",headers:{"Accept-Language":y.language,"Content-Type":"application/json"},method:"post"})).status===200?me.success(C("authentication:successfullyUnlocked")):me.error(C("authentication:failedToUnlock"))},e[4]=I,e[5]=n,e[6]=s,e[7]=y,e[8]=i,e[9]=R,e[10]=C,e[11]=f,e[12]=O):O=e[12];let V=O,G,z;if(e[13]!==x?(G=()=>{x||g(!1)},z=[x],e[13]=x,e[14]=G,e[15]=z):(G=e[14],z=e[15]),PW(G,z),r&&!D&&!d)return null;let X;e[16]!==o?(X=[Mf,o].filter(Boolean),e[16]=o,e[17]=X):X=e[17];let te=X.join(" "),Y;if(e[18]!==L||e[19]!==j||e[20]!==p||e[21]!==n||e[22]!==r||e[23]!==E||e[24]!==S?.fields||e[25]!==b?.value||e[26]!==k||e[27]!==D||e[28]!==M||e[29]!==N||e[30]!==w||e[31]!==i||e[32]!==l||e[33]!==a||e[34]!==c||e[35]!==C||e[36]!==te||e[37]!==V||e[38]!==d||e[39]!==m){let H;e[41]!==L||e[42]!==j||e[43]!==n||e[44]!==E||e[45]!==b?.value||e[46]!==k||e[47]!==C||e[48]!==d?(H=d&&un("div",{className:`${Mf}__api-key`,children:j&&yu(EW,{children:[un(fr,{field:{name:"enableAPIKey",admin:{disabled:E,readOnly:k},label:C("authentication:enableAPIKey")},path:"enableAPIKey",schemaPath:`${n}.enableAPIKey`}),un(vD,{enabled:!!b?.value,readOnly:L})]})}),e[41]=L,e[42]=j,e[43]=n,e[44]=E,e[45]=b?.value,e[46]=k,e[47]=C,e[48]=d,e[49]=H):H=e[49];let le;e[50]!==n||e[51]!==E||e[52]!==w||e[53]!==a||e[54]!==C||e[55]!==m?(le=m&&w&&un(fr,{field:{name:"_verified",admin:{disabled:E,readOnly:a},label:C("authentication:verified")},path:"_verified",schemaPath:`${n}._verified`}),e[50]=n,e[51]=E,e[52]=w,e[53]=a,e[54]=C,e[55]=m,e[56]=le):le=e[56],Y=yu("div",{className:te,children:[D&&yu(TW.Fragment,{children:[un(rv,{loginWithUsername:i,operation:l,permissions:S?.fields,readOnly:a,t:C}),(p||c)&&(!r||!D)&&yu("div",{className:`${Mf}__changing-password`,children:[un(Qc,{autoComplete:"new-password",field:{name:"password",label:C("authentication:newPassword"),required:!0},indexPath:"",parentPath:"",parentSchemaPath:"",path:"password",schemaPath:"password"}),un(qc,{disabled:a})]}),yu("div",{className:`${Mf}__controls`,children:[p&&!c&&un(se,{buttonStyle:"secondary",disabled:E,onClick:()=>M(!1),size:"medium",children:C("general:cancel")}),!p&&!c&&!r&&un(se,{buttonStyle:"secondary",disabled:E,id:"change-password",onClick:()=>M(!0),size:"medium",children:C("authentication:changePassword")}),l==="update"&&N&&un(se,{buttonStyle:"secondary",disabled:E,onClick:()=>void V(),size:"medium",children:C("authentication:forceUnlock")})]})]}),H,le]}),e[18]=L,e[19]=j,e[20]=p,e[21]=n,e[22]=r,e[23]=E,e[24]=S?.fields,e[25]=b?.value,e[26]=k,e[27]=D,e[28]=M,e[29]=N,e[30]=w,e[31]=i,e[32]=l,e[33]=a,e[34]=c,e[35]=C,e[36]=te,e[37]=V,e[38]=d,e[39]=m,e[40]=Y}else Y=e[40];return Y};function LW(t){let[e]=t;return e&&e?.enableAPIKey||null}function $W(t){return t[1]}import{c as kW}from"react/compiler-runtime";import{getTranslation as jW}from"@payloadcms/translations";import{formatAdminURL as av}from"payload/shared";import{useEffect as OW}from"react";var lv=t=>{let e=kW(20),{id:o,collectionSlug:n,globalSlug:r,pluralLabel:s,useAsTitle:i}=t,l=t?.view||void 0,{isEditing:a,isInitializing:c,title:u}=Pe(),{isEntityVisible:d}=Q1(),f;e[0]!==n||e[1]!==r||e[2]!==d?(f=d({collectionSlug:n,globalSlug:r}),e[0]=n,e[1]=r,e[2]=d,e[3]=f):f=e[3];let m=f,{setStepNav:h}=On(),{i18n:p,t:g}=$(),{config:b}=W(),{routes:v}=b,{admin:x}=v,y,C;return e[4]!==x||e[5]!==n||e[6]!==r||e[7]!==p||e[8]!==o||e[9]!==a||e[10]!==c||e[11]!==m||e[12]!==s||e[13]!==h||e[14]!==g||e[15]!==u||e[16]!==i||e[17]!==l?(y=()=>{let S=[];c||(n?(S.push({label:jW(s,p),url:m?av({adminRoute:x,path:`/collections/${n}`}):void 0}),a?S.push({label:i&&i!=="id"&&u||`${o}`,url:m?av({adminRoute:x,path:`/collections/${n}/${o}`}):void 0}):S.push({label:g("general:createNew")})):r&&S.push({label:u,url:m?av({adminRoute:x,path:`/globals/${r}`}):void 0}),l&&S.push({label:l}),h(S))},C=[h,c,a,s,o,i,x,g,p,u,n,r,l,m],e[4]=x,e[5]=n,e[6]=r,e[7]=p,e[8]=o,e[9]=a,e[10]=c,e[11]=m,e[12]=s,e[13]=h,e[14]=g,e[15]=u,e[16]=i,e[17]=l,e[18]=y,e[19]=C):(y=e[18],C=e[19]),OW(y,C),null};import{c as MW}from"react/compiler-runtime";import{useEffect as BW,useRef as VW}from"react";var cv=t=>{let e=MW(13),{collectionConfig:o,config:n,fallback:r,globalConfig:s}=t,i=o?.admin?.useAsTitle,l;e[0]!==i?(l=b=>{let[v]=b;return i&&v&&v?.[i]||null},e[0]=i,e[1]=l):l=e[1];let a=Nt(l),c=VW(!1),{i18n:u}=$(),{setDocumentTitle:d}=Pe(),f=n?.admin?.dateFormat,m;e[2]!==o||e[3]!==f||e[4]!==r||e[5]!==a||e[6]!==s||e[7]!==u?(m=mr({collectionConfig:o,data:{id:""},dateFormat:f,fallback:typeof a=="string"?a:typeof a=="number"?String(a):a?.value||r,globalConfig:s,i18n:u}),e[2]=o,e[3]=f,e[4]=r,e[5]=a,e[6]=s,e[7]=u,e[8]=m):m=e[8];let h=m,p,g;return e[9]!==d||e[10]!==h?(p=()=>{if(!c.current){c.current=!0;return}d(h)},g=[d,h],e[9]=d,e[10]=h,e[11]=p,e[12]=g):(p=e[11],g=e[12]),BW(p,g),null};var Vf="collection-edit";function YW({BeforeDocumentControls:t,Description:e,PreviewButton:o,PublishButton:n,SaveButton:r,SaveDraftButton:s,Upload:i}){let{id:l,action:a,AfterDocument:c,AfterFields:u,apiURL:d,BeforeFields:f,collectionSlug:m,currentEditor:h,disableActions:p,disableCreate:g,disableLeaveWithoutSaving:b,docPermissions:v,documentIsLocked:x,getDocPermissions:y,getDocPreferences:C,globalSlug:S,hasPublishPermission:w,hasSavePermission:F,incrementVersionCount:_,initialState:A,isEditing:R,isInitializing:I,lastUpdateTime:D,redirectAfterCreate:E,redirectAfterDelete:T,redirectAfterDuplicate:L,savedDocumentData:k,setCurrentEditor:j,setDocumentIsLocked:P,unlockDocument:N,updateDocumentEditor:B,updateSavedDocumentData:M}=Pe(),{clearDoc:O,drawerSlug:V,onDelete:G,onDuplicate:z,onSave:X}=ac(),te=!!V,{refreshCookieAsync:Y,user:H}=De(),{config:le,config:{admin:{user:q},routes:{admin:fe}},getEntityConfig:ae}=W(),J=ae({collectionSlug:m}),ge=ae({globalSlug:S}),Ce=ct(),he=GW(),Le=WW(),{reportUpdate:Ae}=hi(),{resetUploadEdits:Q}=zs(),{getFormState:ke}=Ft(),{startRouteTransition:xe}=st(),ce=dv(null),ne=dv(null),U=Le.get("locale"),ie=J?.slug||ge?.slug,de=m&&!l?"create":"update",Te=J?J.auth:void 0,Ge=J?J.upload:void 0,je=J||ge,lt=je?.lockDocuments!==void 0?je?.lockDocuments:!0,Ue=lt!==!1,Kt=(typeof lt=="object"?lt.duration:300)*1e3,ze=!!(J?.versions?.drafts&&J?.versions?.drafts?.autosave||ge?.versions?.drafts&&ge?.versions?.drafts?.autosave),Je=typeof b<"u"?!b:!ze,[Xe,Ct]=Bf(!1),[Et,gt]=Bf(!1),[qe,Pt]=Bf(Date.now()),be=D+Kt,ee=Date.now()>be,K=dv({hasShownLockedModal:!1,isLocked:!1,user:null}),Z=[Vf,(l||S)&&`${Vf}--is-editing`];S&&Z.push(`global-edit--${S}`),m&&Z.push(`collection-edit--${m}`);let re=UW(()=>[ie],[ie]),[pe,ve]=Bf(()=>!!(de==="create"&&Te&&!Te.disableLocalStrategy)),we=uv(Ye=>{P(!0);let so=typeof K.current?.user=="object"?K.current?.user?.id:K.current?.user;if(Ye){let eo=typeof Ye.user=="string"||typeof Ye.user=="number"?Ye.user:Ye.user.id;(!K.current||eo!==so)&&(so===H.id&&eo!==H.id&&(gt(!0),K.current.hasShownLockedModal=!0),K.current={hasShownLockedModal:K.current?.hasShownLockedModal||!1,isLocked:!0,user:Ye.user},j(Ye.user))}},[j,P,H?.id]),Ee=uv(async Ye=>{let so=rr(ne),eo=Ye?.doc||Ye?.result;if(Ae({id:l,entitySlug:ie,updatedAt:eo?.updatedAt||new Date().toISOString()}),H&&m===q&&l===H.id&&Y(),_(),typeof M=="function"&&M(eo||{}),typeof X=="function"){let Fo=l?"update":"create";X({...Ye,operation:Fo,updatedAt:Fo==="update"?new Date().toISOString():eo?.updatedAt||new Date().toISOString()})}if(!R&&Ce<2&&E!==!1){let Fo=HW({adminRoute:fe,path:`/collections/${m}/${eo?.id}${U?`?locale=${U}`:""}`});xe(()=>he.push(Fo))}else Q();if(await y(Ye),(l||S)&&!ze){let Fo=await C(),{state:Qe}=await ke({id:l,collectionSlug:m,data:eo,docPermissions:v,docPreferences:Fo,globalSlug:S,operation:de,renderAllFields:!0,returnLockStatus:!1,schemaPath:re.join("."),signal:so.signal,skipValidation:!0});return Ue&&P(!1),ne.current=null,Qe}},[Ae,l,ie,H,m,q,_,M,X,R,Ce,y,S,ze,Y,fe,U,he,Q,C,ke,v,de,re,Ue,P,xe,E]),po=uv(async({formState:Ye,submitted:so})=>{let eo=rr(ce),Fo=Date.now(),Qe=Fo-qe,wt=Ue&&Qe>=1e4;wt&&Pt(Fo);let Xo=await C(),{lockedState:zt,state:Uo}=await ke({id:l,collectionSlug:m,docPermissions:v,docPreferences:Xo,formState:Ye,globalSlug:S,operation:de,skipValidation:!so,renderAllFields:!1,returnLockStatus:Ue,schemaPath:re.join("."),signal:eo.signal,updateLastEdited:wt});return Ue&&we(zt),ce.current=null,Uo},[l,m,C,ke,S,we,Ue,de,re,v,qe]);CD(()=>()=>{Ue&&x&&(l||S)&&!["preview","api","versions"].some(so=>window.location.pathname.includes(so))&&(typeof K.current?.user=="object"?K.current?.user?.id===H?.id:K.current?.user===H?.id)&&(N(l,m??S),P(!1),j(null)),gt(!1)},[m,S,l,N,H,j,Ue,x,P]),CD(()=>{let Ye=ce.current,so=ne.current;return()=>{or(Ye),or(so)}},[]);let no=x&&h&&(typeof h=="object"?h.id!==H?.id:h!==H?.id)&&!Xe&&!Et&&!K.current?.hasShownLockedModal&&!ee;return ar("main",{className:Z.filter(Boolean).join(" "),children:ar(Il,{operation:de,children:yD(Tn,{action:a,className:`${Vf}__form`,disabled:Xe||I||!F,disableValidationOnSubmit:!pe,initialState:!I&&A,isDocumentForm:!0,isInitializing:I,method:l?"PATCH":"POST",onChange:[po],onSuccess:Ee,children:[te&&ar(mD,{drawerSlug:V}),Ue&&no&&!Xe&&ar(Vb,{handleGoBack:()=>pD({adminRoute:fe,collectionSlug:m,router:he}),isActive:no,onReadOnly:()=>{Ct(!0),gt(!1)},onTakeOver:()=>sv(l,m,S,H,!1,B,j,K,Ue),updatedAt:D,user:h}),Ue&&Et&&ar(Bb,{handleBackToDashboard:()=>fD({adminRoute:fe,router:he}),isActive:Et,onReadOnly:()=>{Ct(!0),gt(!1)}}),!Xe&&Je&&ar(Kc,{}),!te&&ar(lv,{collectionSlug:J?.slug,globalSlug:ge?.slug,id:l,pluralLabel:J?.labels?.plural,useAsTitle:J?.admin?.useAsTitle}),ar(cv,{collectionConfig:J,config:le,fallback:Ce<=1?l?.toString():void 0,globalConfig:ge}),ar(b1,{apiURL:d,BeforeDocumentControls:t,customComponents:{PreviewButton:o,PublishButton:n,SaveButton:r,SaveDraftButton:s},data:k,disableActions:p,disableCreate:g,hasPublishPermission:w,hasSavePermission:F,id:l,isEditing:R,onDelete:G,onDrawerCreateNew:O,onDuplicate:z,onSave:Ee,onTakeOver:()=>sv(l,m,S,H,!0,B,j,K,Ue,Ct),permissions:v,readOnlyForIncomingUser:Xe,redirectAfterDelete:T,redirectAfterDuplicate:L,slug:J?.slug||ge?.slug,user:h}),ar(kc,{AfterFields:u,BeforeFields:f||yD(XW,{children:[Te&&ar(xD,{className:`${Vf}__auth`,collectionSlug:J.slug,disableLocalStrategy:J.auth?.disableLocalStrategy,email:k?.email,loginWithUsername:Te?.loginWithUsername,operation:de,readOnly:!F,requirePassword:!l,setValidateBeforeSubmit:ve,useAPIKey:Te.useAPIKey,username:k?.username,verify:Te.verify}),Ge&&ar(zW.Fragment,{children:i||ar(Ib,{collectionSlug:J.slug,initialState:A,uploadConfig:Ge})})]}),Description:e,docPermissions:v,fields:je.fields,readOnly:Xe||!F,schemaPathSegments:re}),c]})})})}import{jsx as ZW}from"react/jsx-runtime";import"react";var JW="field-diff-label",qW=({children:t})=>ZW("div",{className:JW,children:t});export{Xb as Account,BB as ActionsProvider,g7 as AppHeader,Zc as ArrayField,Hp as AuthProvider,Rr as Banner,Nl as BlocksDrawer,Ll as BlocksField,OI as BulkUploadDrawer,_b as BulkUploadProvider,se as Button,FD as CalendarIcon,v7 as Card,lh as CheckIcon,fr as CheckboxField,Xs as CheckboxInput,Ze as ChevronIcon,J1 as ClientFunctionProvider,Yb as CloseMenuIcon,vG as CodeBlockIcon,_D as CodeEdiftor,$l as CodeEditorLazy,kl as CodeField,Ys as Collapsible,Ol as CollapsibleField,zf as ConfigProvider,qc as ConfirmPasswordField,Rt as ConfirmationModal,Al as CopyIcon,r1 as CopyLocaleData,Oc as CopyToClipboard,I1 as DateCondition,AD as DatePicker,ec as DateTimeField,xh as DefaultBlockImage,uc as DefaultCell,YW as DefaultEditView,vW as DefaultListView,l1 as DeleteMany,b1 as DocumentControls,gb as DocumentEventsProvider,kc as DocumentFields,Sl as DocumentInfoProvider,Vb as DocumentLocked,Bb as DocumentTakeOver,wn as DragHandleIcon,Lt as Drawer,dr as DrawerToggler,pi as Dropzone,$s as EditDepthProvider,_r as EditIcon,x1 as EditMany,bb as EditUpload,rv as EmailAndUsernameFields,ni as EmailField,kG as EntityVisibilityProvider,X1 as ErrorIcon,ao as ErrorPill,bG as ExternalLinkIcon,Ve as FieldDescription,qW as FieldDiffLabel,We as FieldError,ye as FieldLabel,bm as File,Cb as FileDetails,Tn as Form,K9 as FormLoadingOverlayToggle,Yr as FormSubmit,W8 as FullscreenModal,y1 as GenerateConfirmation,tc as GroupField,Bo as Gutter,qb as Hamburger,oc as HiddenField,J8 as HydrateAuthProvider,U1 as InfoIcon,fc as JSONField,mc as JoinField,Kc as LeaveWithoutSaving,ch as LineIcon,Yt as Link,dp as LinkIcon,$1 as ListControls,gg as ListDrawerContextProvider,O1 as ListHeader,xg as ListQueryProvider,hu as ListSelection,Rn as LoadingOverlay,l3 as LoadingOverlayToggle,Yp as LocaleProvider,lu as Locked,M1 as LogOutIcon,tG as Logout,Zb as MenuIcon,xG as MinimizeMaximizeIcon,Zo as Modal,fh as MoreIcon,sG as NavGroup,e1 as NavToggler,Fl as NullifyLocaleField,R1 as NumberCondition,pc as NumberField,Il as OperationProvider,XM as OrderableTable,dc as Pagination,K1 as ParamsProvider,Qc as PasswordField,vf as PayloadIcon,B1 as PerPage,vt as Pill,jo as PlusIcon,hc as PointField,ho as Popup,Be as PopupList,Up as PreferencesProvider,c1 as PreviewButton,wb as PreviewSizes,EG as ProgressBar,f1 as PublishButton,k1 as PublishMany,tB as QueryPresetsAccessCell,iB as QueryPresetsColumnField,JM as QueryPresetsColumnsCell,KM as QueryPresetsWhereCell,uB as QueryPresetsWhereField,vc as RadioGroupField,ft as ReactSelect,D1 as RelationshipCondition,Sc as RelationshipField,cc as RelationshipProvider,Bg as RelationshipTable,oe as RenderCustomComponent,KL as RenderDefaultCell,So as RenderFields,W1 as RenderTitle,Ic as RichTextField,rW as RootProvider,n1 as RouteCacheProvider,cp as RouteTransitionProvider,Rc as RowField,mn as RowLabel,ip as RowLabelProvider,p1 as SaveButton,h1 as SaveDraftButton,vu as ScrollInfoProvider,S1 as SearchFilter,Pl as SearchIcon,ov as SearchParamsProvider,yh as SectionTitle,ft as Select,cW as SelectAll,T1 as SelectCondition,_c as SelectField,Ca as SelectInput,qa as SelectMany,dW as SelectRow,a1 as SelectionProvider,yg as ServerFunctionsProvider,lv as SetDocumentStepNav,cv as SetDocumentTitle,c7 as SetStepNav,It as ShimmerEffect,gG as SortColumn,VM as SortHeader,WM as SortRow,SD as StaggeredShimmers,Y1 as SuccessIcon,mp as SwapIcon,lb as TabComponent,u1 as Table,sc as TableColumnsProvider,Tc as TabsField,fg as TabsProvider,E1 as TextCondition,fi as TextField,ub as TextInput,Ec as TextareaField,db as TextareaInput,Uf as ThemeProvider,Mr as Thumbnail,Kl as TimezonePicker,go as Tooltip,Ii as Translation,Hf as TranslationProvider,Pc as UIField,j1 as UnpublishMany,Ib as Upload,rh as UploadEditsProvider,Yc as UploadField,nb as UploadHandlersProvider,rf as UploadInput,Gb as ViewDescription,Z1 as WarningIcon,Js as WatchChildErrors,ah as WatchCondition,ev as WindowInfoProvider,pt as XIcon,yM as allFieldComponents,ID as defaultTheme,cs as documentDrawerBaseClass,Ie as fieldBaseClass,KI as fieldComponents,Fc as fieldReducer,Mp as formatDrawerSlug,jr as parseSearchParams,me as toast,Ub as useActions,IG as useAddClientFunction,$i as useAllFormFields,De as useAuth,Ho as useBulkUpload,BI as useBulkUploadDrawerSlug,Lg as useCellProps,RG as useClientFunctions,Kn as useCollapsible,W as useConfig,qo as useDebounce,Yg as useDebouncedCallback,rb as useDebouncedEffect,Xf as useDelay,Ig as useDelayedRender,qt as useDocumentDrawer,ac as useDocumentDrawerContext,hi as useDocumentEvents,Li as useDocumentForm,Pe as useDocumentInfo,bl as useDrawerSlug,ct as useEditDepth,to as useEffectEvent,Q1 as useEntityVisibility,Ne as useField,Me as useForm,sp as useFormBackgroundProcessing,Nt as useFormFields,Ps as useFormInitializing,Ut as useFormModified,cr as useFormProcessing,Xt as useFormSubmitted,wi as useHotkey,fn as useIntersect,ci as useListDrawer,en as useListDrawerContext,_t as useListQuery,Fg as useListRelationships,$e as useLocale,ue as useModal,_i as useNav,Ko as useOperation,GG as useParams,PM as usePayloadAPI,Ao as usePreferences,kM as useResize,Mn as useRouteCache,st as useRouteTransition,HD as useRowLabel,bu as useScrollInfo,oW as useSearchParams,ro as useSelection,Ft as useServerFunctions,On as useStepNav,ma as useTableColumns,RD as useTheme,Gs as useThrottledEffect,$ as useTranslation,zs as useUploadEdits,Dc as useUploadHandlers,Nb as useUseTitleField,$u as useWatchForm,tv as useWindowInfo,Oe as withCondition};
59
59
  /*! Bundled license information:
60
60
 
61
61
  scheduler/cjs/scheduler.production.js: