PageSourceSearch

https://fumadocs-payloadcms.vercel.app/_next/static/chunks/0eumhdsyb6_c~.js

js fumadocs-payloadcms.vercel.app collected 2026-10-03 06:59:15 UTC 1,074,136 bytes, 53 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,640550,(e,t,r)=>{var n={675:function(e,t){"use strict";t.byteLength=function(e){var t=s(e),r=t[0],n=t[1];return(r+n)*3/4-n},t.toByteArray=function(e){var t,r,l=s(e),i=l[0],o=l[1],c=new a((i+o)*3/4-o),u=0,d=o>0?i-4:i;for(r=0;r<d;r+=4)t=n[e.charCodeAt(r)]<<18|n[e.charCodeAt(r+1)]<<12|n[e.charCodeAt(r+2)]<<6|n[e.charCodeAt(r+3)],c[u++]=t>>16&255,c[u++]=t>>8&255,c[u++]=255&t;return 2===o&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,c[u++]=255&t),1===o&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,c[u++]=t>>8&255,c[u++]=255&t),c},t.fromByteArray=function(e){for(var t,n=e.length,a=n%3,l=[],i=0,o=n-a;i<o;i+=16383)l.push(function(e,t,n){for(var a,l=[],i=t;i<n;i+=3)a=(e[i]<<16&0xff0000)+(e[i+1]<<8&65280)+(255&e[i+2]),l.push(r[a>>18&63]+r[a>>12&63]+r[a>>6&63]+r[63&a]);return l.join("")}(e,i,i+16383>o?o:i+16383));return 1===a?l.push(r[(t=e[n-1])>>2]+r[t<<4&63]+"=="):2===a&&l.push(r[(t=(e[n-2]<<8)+e[n-1])>>10]+r[t>>4&63]+r[t<<2&63]+"="),l.join("")};for(var r=[],n=[],a="u">typeof Uint8Array?Uint8Array:Array,l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",i=0,o=l.length;i<o;++i)r[i]=l[i],n[l.charCodeAt(i)]=i;function s(e){var t=e.length;if(t%4>0)throw Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");-1===r&&(r=t);var n=r===t?0:4-r%4;return[r,n]}n[45]=62,n[95]=63},72:function(e,t,r){"use strict";var n=r(675),a=r(783),l="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;function i(e){if(e>0x7fffffff)throw RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,o.prototype),t}function o(e,t,r){if("number"==typeof e){if("string"==typeof t)throw TypeError('The "string" argument must be of type string. Received type number');return u(e)}return s(e,t,r)}function s(e,t,r){if("string"==typeof e){var n=e,a=t;if(("string"!=typeof a||""===a)&&(a="utf8"),!o.isEncoding(a))throw TypeError("Unknown encoding: "+a);var l=0|p(n,a),s=i(l),c=s.write(n,a);return c!==l&&(s=s.slice(0,c)),s}if(ArrayBuffer.isView(e))return d(e);if(null==e)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(N(e,ArrayBuffer)||e&&N(e.buffer,ArrayBuffer)||"u">typeof SharedArrayBuffer&&(N(e,SharedArrayBuffer)||e&&N(e.buffer,SharedArrayBuffer)))return function(e,t,r){var n;if(t<0||e.byteLength<t)throw RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw RangeError('"length" is outside of buffer bounds');return Object.setPrototypeOf(n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),o.prototype),n}(e,t,r);if("number"==typeof e)throw TypeError('The "value" argument must not be of type number. Received type number');var u=e.valueOf&&e.valueOf();if(null!=u&&u!==e)return o.from(u,t,r);var h=function(e){if(o.isBuffer(e)){var t=0|f(e.length),r=i(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||function(e){return e!=e}(e.length)?i(0):d(e):"Buffer"===e.type&&Array.isArray(e.data)?d(e.data):void 0}(e);if(h)return h;if("u">typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return o.from(e[Symbol.toPrimitive]("string"),t,r);throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function c(e){if("number"!=typeof e)throw TypeError('"size" argument must be of type number');if(e<0)throw RangeError('The value "'+e+'" is invalid for option "size"')}function u(e){return c(e),i(e<0?0:0|f(e))}function d(e){for(var t=e.length<0?0:0|f(e.length),r=i(t),n=0;n<t;n+=1)r[n]=255&e[n];return r}t.Buffer=o,t.SlowBuffer=function(e){return+e!=e&&(e=0),o.alloc(+e)},t.INSPECT_MAX_BYTES=50,t.kMaxLength=0x7fffffff,o.TYPED_ARRAY_SUPPORT=function(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(e){return!1}}(),!o.TYPED_ARRAY_SUPPORT&&"u">typeof console&&"function"==typeof console.error&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(o.prototype,"parent",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.buffer}}),Object.defineProperty(o.prototype,"offset",{enumerable:!0,get:function(){if(o.isBuffer(this))return this.byteOffset}}),o.poolSize=8192,o.from=function(e,t,r){return s(e,t,r)},Object.setPrototypeOf(o.prototype,Uint8Array.prototype),Object.setPrototypeOf(o,Uint8Array),o.alloc=function(e,t,r){return(c(e),e<=0)?i(e):void 0!==t?"string"==typeof r?i(e).fill(t,r):i(e).fill(t):i(e)},o.allocUnsafe=function(e){return u(e)},o.allocUnsafeSlow=function(e){return u(e)};function f(e){if(e>=0x7fffffff)throw RangeError("Attempt to allocate Buffer larger than maximum size: 0x7fffffff bytes");return 0|e}function p(e,t){if(o.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||N(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var a=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return $(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return k(e).length;default:if(a)return n?-1:$(e).length;t=(""+t).toLowerCase(),a=!0}}function h(e,t,r){var a,l,i,o=!1;if((void 0===t||t<0)&&(t=0),t>this.length||((void 0===r||r>this.length)&&(r=this.length),r<=0||(r>>>=0)<=(t>>>=0)))return"";for(e||(e="utf8");;)switch(e){case"hex":return function(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var a="",l=t;l<r;++l)a+=P[e[l]];return a}(this,t,r);case"utf8":case"utf-8":return v(this,t,r);case"ascii":return function(e,t,r){var n="";r=Math.min(e.length,r);for(var a=t;a<r;++a)n+=String.fromCharCode(127&e[a]);return n}(this,t,r);case"latin1":case"binary":return function(e,t,r){var n="";r=Math.min(e.length,r);for(var a=t;a<r;++a)n+=String.fromCharCode(e[a]);return n}(this,t,r);
vendor: 11,058 bytes, line 1
1case"base64":return a=this,l=t,i=r,0===l&&i===a.length?n.fromByteArray(a):n.fromByteArray(a.slice(l,i));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(e,t,r){for(var n=e.slice(t,r),a="",l=0;l<n.length;l+=2)a+=String.fromCharCode(n[l]+256*n[l+1]);return a}(this,t,r);default:if(o)throw TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),o=!0}}function m(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function g(e,t,r,n,a){var l;if(0===e.length)return -1;if("string"==typeof r?(n=r,r=0):r>0x7fffffff?r=0x7fffffff:r<-0x80000000&&(r=-0x80000000),(l=r*=1)!=l&&(r=a?0:e.length-1),r<0&&(r=e.length+r),r>=e.length)if(a)return -1;else r=e.length-1;else if(r<0)if(!a)return -1;else r=0;if("string"==typeof t&&(t=o.from(t,n)),o.isBuffer(t))return 0===t.length?-1:b(e,t,r,n,a);if("number"==typeof t){if(t&=255,"function"==typeof Uint8Array.prototype.indexOf)if(a)return Uint8Array.prototype.indexOf.call(e,t,r);else return Uint8Array.prototype.lastIndexOf.call(e,t,r);return b(e,[t],r,n,a)}throw TypeError("val must be string, number or Buffer")}function b(e,t,r,n,a){var l,i=1,o=e.length,s=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return -1;i=2,o/=2,s/=2,r/=2}function c(e,t){return 1===i?e[t]:e.readUInt16BE(t*i)}if(a){var u=-1;for(l=r;l<o;l++)if(c(e,l)===c(t,-1===u?0:l-u)){if(-1===u&&(u=l),l-u+1===s)return u*i}else -1!==u&&(l-=l-u),u=-1}else for(r+s>o&&(r=o-s),l=r;l>=0;l--){for(var d=!0,f=0;f<s;f++)if(c(e,l+f)!==c(t,f)){d=!1;break}if(d)return l}return -1}o.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==o.prototype},o.compare=function(e,t){if(N(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),N(t,Uint8Array)&&(t=o.from(t,t.offset,t.byteLength)),!o.isBuffer(e)||!o.isBuffer(t))throw TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var r=e.length,n=t.length,a=0,l=Math.min(r,n);a<l;++a)if(e[a]!==t[a]){r=e[a],n=t[a];break}return r<n?-1:+(n<r)},o.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},o.concat=function(e,t){if(!Array.isArray(e))throw TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return o.alloc(0);if(void 0===t)for(r=0,t=0;r<e.length;++r)t+=e[r].length;var r,n=o.allocUnsafe(t),a=0;for(r=0;r<e.length;++r){var l=e[r];if(N(l,Uint8Array)&&(l=o.from(l)),!o.isBuffer(l))throw TypeError('"list" argument must be an Array of Buffers');l.copy(n,a),a+=l.length}return n},o.byteLength=p,o.prototype._isBuffer=!0,o.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)m(this,t,t+1);return this},o.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)m(this,t,t+3),m(this,t+1,t+2);return this},o.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)m(this,t,t+7),m(this,t+1,t+6),m(this,t+2,t+5),m(this,t+3,t+4);return this},o.prototype.toString=function(){var e=this.length;return 0===e?"":0==arguments.length?v(this,0,e):h.apply(this,arguments)},o.prototype.toLocaleString=o.prototype.toString,o.prototype.equals=function(e){if(!o.isBuffer(e))throw TypeError("Argument must be a Buffer");return this===e||0===o.compare(this,e)},o.prototype.inspect=function(){var e="",r=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},l&&(o.prototype[l]=o.prototype.inspect),o.prototype.compare=function(e,t,r,n,a){if(N(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),!o.isBuffer(e))throw TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===a&&(a=this.length),t<0||r>e.length||n<0||a>this.length)throw RangeError("out of range index");if(n>=a&&t>=r)return 0;if(n>=a)return -1;if(t>=r)return 1;if(t>>>=0,r>>>=0,n>>>=0,a>>>=0,this===e)return 0;for(var l=a-n,i=r-t,s=Math.min(l,i),c=this.slice(n,a),u=e.slice(t,r),d=0;d<s;++d)if(c[d]!==u[d]){l=c[d],i=u[d];break}return l<i?-1:+(i<l)},o.prototype.includes=function(e,t,r){return -1!==this.indexOf(e,t,r)},o.prototype.indexOf=function(e,t,r){return g(this,e,t,r,!0)},o.prototype.lastIndexOf=function(e,t,r){return g(this,e,t,r,!1)};function v(e,t,r){r=Math.min(e.length,r);for(var n=[],a=t;a<r;){var l,i,o,s,c=e[a],u=null,d=c>239?4:c>223?3:c>191?2:1;if(a+d<=r)switch(d){case 1:c<128&&(u=c);break;case 2:(192&(l=e[a+1]))==128&&(s=(31&c)<<6|63&l)>127&&(u=s);break;case 3:l=e[a+1],i=e[a+2],(192&l)==128&&(192&i)==128&&(s=(15&c)<<12|(63&l)<<6|63&i)>2047&&(s<55296||s>57343)&&(u=s);break;case 4:l=e[a+1],i=e[a+2],o=e[a+3],(192&l)==128&&(192&i)==128&&(192&o)==128&&(s=(15&c)<<18|(63&l)<<12|(63&i)<<6|63&o)>65535&&s<1114112&&(u=s)}null===u?(u=65533,d=1):u>65535&&(u-=65536,n.push(u>>>10&1023|55296),u=56320|1023&u),n.push(u),a+=d}var f=n,p=f.length;if(p<=4096)return String.fromCharCode.apply(String,f);for(var h="",m=0;m<p;)h+=String.fromCharCode.apply(String,f.slice(m,m+=4096));return h}function y(e,t,r){if(e%1!=0||e<0)throw RangeError("offset is not uint");if(e+t>r)throw RangeError("Trying to access beyond buffer length")}function x(e,t,r,n,a,l){if(!o.isBuffer(e))throw TypeError('"buffer" argument must be a Buffer instance');if(t>a||t<l)throw RangeError('"value" argument is out of bounds');if(r+n>e.length)throw RangeError("Index out of range")}function w(e,t,r,n,a,l){if(r+n>e.length||r<0)throw RangeError("Index out of range")}function C(e,t,r,n,l){return t*=1,r>>>=0,l||w(e,t,r,4,34028234663852886e22,-34028234663852886e22),a.write(e,t,r,n,23,4),r+4}function j(e,t,r,n,l){return t*=1,r>>>=0,l||w(e,t,r,8,17976931348623157e292,-17976931348623157e292),a.write(e,t,r,n,52,8),r+8}o.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else if(isFinite(t))t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0);else throw Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var a,l,i,o,s,c,u,d,f=this.length-t;if((void 0===r||r>f)&&(r=f),e.length>0&&(r<0||t<0)||t>this.length)throw RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var p=!1;;)switch(n){case"hex":return function(e,t,r,n){r=Number(r)||0;var a=e.length-r;n?(n=Number(n))>a&&(n=a):n=a;var l=t.length;n>l/2&&(n=l/2);for(var i=0;i<n;++i){var o,s=parseInt(t.substr(2*i,2),16);if((o=s)!=o)break;e[r+i]=s}return i}(this,e,t,r);case"utf8":case"utf-8":return a=t,l=r,E($(e,this.length-a),this,a,l);case"ascii":return i=t,o=r,E(_(e),this,i,o);case"latin1":case"binary":return function(e,t,r,n){return E(_(t),e,r,n)}(this,e,t,r);case"base64":return s=t,c=r,E(k(e),this,s,c);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return u=t,d=r,E(function(e,t){for(var r,n,a=[],l=0;l<e.length&&!((t-=2)<0);++l)n=(r=e.charCodeAt(l))>>8,a.push(r%256),a.push(n);return a}(e,this.length-u),this,u,d);default:if(p)throw TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),p=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},o.prototype.slice=function(e,t){var r=this.length;e=~~e,t=void 0===t?r:~~t,e<0?(e+=r)<0&&(e=0):e>r&&(e=r),t<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e);var n=this.subarray(e,t);return Object.setPrototypeOf(n,o.prototype),n},o.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||y(e,t,this.length);for(var n=this[e],a=1,l=0;++l<t&&(a*=256);)n+=this[e+l]*a;return n},o.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||y(e,t,this.length);for(var n=this[e+--t],a=1;t>0&&(a*=256);)n+=this[e+--t]*a;return n},o.prototype.readUInt8=function(e,t){return e>>>=0,t||y(e,1,this.length),this[e]},o.prototype.readUInt16LE=function(e,t){return e>>>=0,t||y(e,2,this.length),this[e]|this[e+1]<<8},o.prototype.readUInt16BE=function(e,t){return e>>>=0,t||y(e,2,this.length),this[e]<<8|this[e+1]},o.prototype.readUInt32LE=function(e,t){return e>>>=0,t||y(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+0x1000000*this[e+3]},o.prototype.readUInt32BE=function(e,t){return e>>>=0,t||y(e,4,this.length),0x1000000*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},o.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||y(e,t,this.length);for(var n=this[e],a=1,l=0;++l<t&&(a*=256);)n+=this[e+l]*a;return n>=(a*=128)&&(n-=Math.pow(2,8*t)),n},o.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||y(e,t,this.length);for(var n=t,a=1,l=this[e+--n];n>0&&(a*=256);)l+=this[e+--n]*a;return l>=(a*=128)&&(l-=Math.pow(2,8*t)),l},o.prototype.readInt8=function(e,t){return(e>>>=0,t||y(e,1,this.length),128&this[e])?-((255-this[e]+1)*1):this[e]},o.prototype.readInt16LE=function(e,t){e>>>=0,t||y(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?0xffff0000|r:r},o.prototype.readInt16BE=function(e,t){e>>>=0,t||y(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?0xffff0000|r:r},o.prototype.readInt32LE=function(e,t){return e>>>=0,t||y(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},o.prototype.readInt32BE=function(e,t){return e>>>=0,t||y(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},o.prototype.readFloatLE=function(e,t){return e>>>=0,t||y(e,4,this.length),a.read(this,e,!0,23,4)},o.prototype.readFloatBE=function(e,t){return e>>>=0,t||y(e,4,this.length),a.read(this,e,!1,23,4)},o.prototype.readDoubleLE=function(e,t){return e>>>=0,t||y(e,8,this.length),a.read(this,e,!0,52,8)},o.prototype.readDoubleBE=function(e,t){return e>>>=0,t||y(e,8,this.length),a.read(this,e,!1,52,8)},o.prototype.writeUIntLE=function(e,t,r,n){if(e*=1,t>>>=0,r>>>=0,!n){var a=Math.pow(2,8*r)-1;x(this,e,t,r,a,0)}var l=1,i=0;for(this[t]=255&e;++i<r&&(l*=256);)this[t+i]=e/l&255;return t+r},o.prototype.writeUIntBE=function(e,t,r,n){if(e*=1,t>>>=0,r>>>=0,!n){var a=Math.pow(2,8*r)-1;x(this,e,t,r,a,0)}var l=r-1,i=1;for(this[t+l]=255&e;--l>=0&&(i*=256);)this[t+l]=e/i&255;return t+r},o.prototype.writeUInt8=function(e,t,r){return e*=1,t>>>=0,r||x(this,e,t,1,255,0),this[t]=255&e,t+1},o.prototype.writeUInt16LE=function(e,t,r){return e*=1,t>>>=0,r||x(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},o.prototype.writeUInt16BE=function(e,t,r){return e*=1,t>>>=0,r||x(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},o.prototype.writeUInt32LE=function(e,t,r){return e*=1,t>>>=0,r||x(this,e,t,4,0xffffffff,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},o.prototype.writeUInt32BE=function(e,t,r){return e*=1,t>>>=0,r||x(this,e,t,4,0xffffffff,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},o.prototype.writeIntLE=function(e,t,r,n){if(e*=1,t>>>=0,!n){var a=Math.pow(2,8*r-1);x(this,e,t,r,a-1,-a)}var l=0,i=1,o=0;for(this[t]=255&e;++l<r&&(i*=256);
1)e<0&&0===o&&0!==this[t+l-1]&&(o=1),this[t+l]=(e/i|0)-o&255;return t+r},o.prototype.writeIntBE=function(e,t,r,n){if(e*=1,t>>>=0,!n){var a=Math.pow(2,8*r-1);x(this,e,t,r,a-1,-a)}var l=r-1,i=1,o=0;for(this[t+l]=255&e;--l>=0&&(i*=256);)e<0&&0===o&&0!==this[t+l+1]&&(o=1),this[t+l]=(e/i|0)-o&255;return t+r},o.prototype.writeInt8=function(e,t,r){return e*=1,t>>>=0,r||x(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},o.prototype.writeInt16LE=function(e,t,r){return e*=1,t>>>=0,r||x(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},o.prototype.writeInt16BE=function(e,t,r){return e*=1,t>>>=0,r||x(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},o.prototype.writeInt32LE=function(e,t,r){return e*=1,t>>>=0,r||x(this,e,t,4,0x7fffffff,-0x80000000),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},o.prototype.writeInt32BE=function(e,t,r){return e*=1,t>>>=0,r||x(this,e,t,4,0x7fffffff,-0x80000000),e<0&&(e=0xffffffff+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},o.prototype.writeFloatLE=function(e,t,r){return C(this,e,t,!0,r)},o.prototype.writeFloatBE=function(e,t,r){return C(this,e,t,!1,r)},o.prototype.writeDoubleLE=function(e,t,r){return j(this,e,t,!0,r)},o.prototype.writeDoubleBE=function(e,t,r){return j(this,e,t,!1,r)},o.prototype.copy=function(e,t,r,n){if(!o.isBuffer(e))throw TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r||0===e.length||0===this.length)return 0;if(t<0)throw RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw RangeError("Index out of range");if(n<0)throw RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var a=n-r;if(this===e&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(t,r,n);else if(this===e&&r<t&&t<n)for(var l=a-1;l>=0;--l)e[l+t]=this[l+r];else Uint8Array.prototype.set.call(e,this.subarray(r,n),t);return a},o.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw TypeError("encoding must be a string");if("string"==typeof n&&!o.isEncoding(n))throw TypeError("Unknown encoding: "+n);if(1===e.length){var a,l=e.charCodeAt(0);("utf8"===n&&l<128||"latin1"===n)&&(e=l)}}else"number"==typeof e?e&=255:"boolean"==typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw RangeError("Out of range index");if(r<=t)return this;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(a=t;a<r;++a)this[a]=e;else{var i=o.isBuffer(e)?e:o.from(e,n),s=i.length;if(0===s)throw TypeError('The value "'+e+'" is invalid for argument "value"');for(a=0;a<r-t;++a)this[a+t]=i[a%s]}return this};var S=/[^+/0-9A-Za-z-_]/g;function $(e,t){t=t||1/0;for(var r,n=e.length,a=null,l=[],i=0;i<n;++i){if((r=e.charCodeAt(i))>55295&&r<57344){if(!a){if(r>56319||i+1===n){(t-=3)>-1&&l.push(239,191,189);continue}a=r;continue}if(r<56320){(t-=3)>-1&&l.push(239,191,189),a=r;continue}r=(a-55296<<10|r-56320)+65536}else a&&(t-=3)>-1&&l.push(239,191,189);if(a=null,r<128){if((t-=1)<0)break;l.push(r)}else if(r<2048){if((t-=2)<0)break;l.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;l.push(r>>12|224,r>>6&63|128,63&r|128)}else if(r<1114112){if((t-=4)<0)break;l.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}else throw Error("Invalid code point")}return l}function _(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}function k(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(S,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function E(e,t,r,n){for(var a=0;a<n&&!(a+r>=t.length)&&!(a>=e.length);++a)t[a+r]=e[a];return a}function N(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}var P=function(){for(var e="0123456789abcdef",t=Array(256),r=0;r<16;++r)for(var n=16*r,a=0;a<16;++a)t[n+a]=e[r]+e[a];return t}()},783:function(e,t){t.read=function(e,t,r,n,a){var l,i,o=8*a-n-1,s=(1<<o)-1,c=s>>1,u=-7,d=r?a-1:0,f=r?-1:1,p=e[t+d];for(d+=f,l=p&(1<<-u)-1,p>>=-u,u+=o;u>0;l=256*l+e[t+d],d+=f,u-=8);for(i=l&(1<<-u)-1,l>>=-u,u+=n;u>0;i=256*i+e[t+d],d+=f,u-=8);
1if(0===l)l=1-c;else{if(l===s)return i?NaN:1/0*(p?-1:1);i+=Math.pow(2,n),l-=c}return(p?-1:1)*i*Math.pow(2,l-n)},t.write=function(e,t,r,n,a,l){var i,o,s,c=8*l-a-1,u=(1<<c)-1,d=u>>1,f=5960464477539062e-23*(23===a),p=n?0:l-1,h=n?1:-1,m=+(t<0||0===t&&1/t<0);for(isNaN(t=Math.abs(t))||t===1/0?(o=+!!isNaN(t),i=u):(i=Math.floor(Math.log(t)/Math.LN2),t*(s=Math.pow(2,-i))<1&&(i--,s*=2),i+d>=1?t+=f/s:t+=f*Math.pow(2,1-d),t*s>=2&&(i++,s/=2),i+d>=u?(o=0,i=u):i+d>=1?(o=(t*s-1)*Math.pow(2,a),i+=d):(o=t*Math.pow(2,d-1)*Math.pow(2,a),i=0));a>=8;e[r+p]=255&o,p+=h,o/=256,a-=8);for(i=i<<a|o,c+=a;c>0;e[r+p]=255&i,p+=h,i/=256,c-=8);e[r+p-h]|=128*m}}},a={};function l(e){var t=a[e];if(void 0!==t)return t.exports;var r=a[e]={exports:{}},i=!0;try{n[e](r,r.exports,l),i=!1}finally{i&&delete a[e]}return r.exports}l.ab="/ROOT/node_modules/.pnpm/[email protected]_@[email protected]_@[email protected][email protected][email protected][email protected][email protected]/node_modules/next/dist/compiled/buffer/",t.exports=l(72)},11294,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.regexpCode=r.getEsmExportName=r.getProperty=r.safeStringify=r.stringify=r.strConcat=r.addCodeArg=r.str=r._=r.nil=r._Code=r.Name=r.IDENTIFIER=r._CodeOrName=void 0;class n{}r._CodeOrName=n,r.IDENTIFIER=/^[a-z$_][a-z$_0-9]*$/i;class a extends n{constructor(e){if(super(),!r.IDENTIFIER.test(e))throw Error("CodeGen: name must be a valid identifier");this.str=e}toString(){return this.str}emptyStr(){return!1}get names(){return{[this.str]:1}}}r.Name=a;class l extends n{constructor(e){super(),this._items="string"==typeof e?[e]:e}toString(){return this.str}emptyStr(){if(this._items.length>1)return!1;let e=this._items[0];return""===e||'""'===e}get str(){var e;return null!=(e=this._str)?e:this._str=this._items.reduce((e,t)=>`${e}${t}`,"")}get names(){var e;return null!=(e=this._names)?e:this._names=this._items.reduce((e,t)=>(t instanceof a&&(e[t.str]=(e[t.str]||0)+1),e),{})}}function i(e,...t){let r=[e[0]],n=0;for(;n<t.length;)c(r,t[n]),r.push(e[++n]);return new l(r)}r._Code=l,r.nil=new l(""),r._=i;let o=new l("+");function s(e,...t){let r=[u(e[0])],n=0;for(;n<t.length;)r.push(o),c(r,t[n]),r.push(o,u(e[++n]));return function(e){let t=1;for(;t<e.length-1;){if(e[t]===o){var r,n;let l=(r=e[t-1],'""'===(n=e[t+1])?r:'""'===r?n:"string"==typeof r?n instanceof a||'"'!==r[r.length-1]?void 0:"string"!=typeof n?`${r.slice(0,-1)}${n}"`:'"'===n[0]?r.slice(0,-1)+n.slice(1):void 0:"string"!=typeof n||'"'!==n[0]||r instanceof a?void 0:`"${r}${n.slice(1)}`);if(void 0!==l){e.splice(t-1,3,l);continue}e[t++]="+"}t++}}(r),new l(r)}function c(e,t){var r;t instanceof l?e.push(...t._items):t instanceof a?e.push(t):e.push("number"==typeof(r=t)||"boolean"==typeof r||null===r?r:u(Array.isArray(r)?r.join(","):r))}function u(e){return JSON.stringify(e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}r.str=s,r.addCodeArg=c,r.strConcat=function(e,t){return t.emptyStr()?e:e.emptyStr()?t:s`${e}${t}`},r.stringify=function(e){return new l(u(e))},r.safeStringify=u,r.getProperty=function(e){return"string"==typeof e&&r.IDENTIFIER.test(e)?new l(`.${e}`):i`[${e}]`},r.getEsmExportName=function(e){if("string"==typeof e&&r.IDENTIFIER.test(e))return new l(`${e}`);throw Error(`CodeGen: invalid export name: ${e}, use explicit $id name mapping`)},r.regexpCode=function(e){return new l(e.toString())}},683074,(e,t,r)=>{"use strict";var n,a;Object.defineProperty(r,"__esModule",{value:!0}),r.ValueScope=r.ValueScopeName=r.Scope=r.varKinds=r.UsedValueState=void 0;let l=e.r(11294);class i extends Error{constructor(e){super(`CodeGen: "code" for ${e} not defined`),this.value=e.value}}(a=n||(r.UsedValueState=n={}))[a.Started=0]="Started",a[a.Completed=1]="Completed",r.varKinds={const:new l.Name("const"),let:new l.Name("let"),var:new l.Name("var")};class o{constructor({prefixes:e,parent:t}={}){this._names={},this._prefixes=e,this._parent=t}toName(e){return e instanceof l.Name?e:this.name(e)}name(e){return new l.Name(this._newName(e))}_newName(e){let t=this._names[e]||this._nameGroup(e);return`${e}${t.index++}`}_nameGroup(e){var t,r;if((null==(r=null==(t=this._parent)?void 0:t._prefixes)?void 0:r.has(e))||this._prefixes&&!this._prefixes.has(e))throw Error(`CodeGen: prefix "${e}" is not allowed in this scope`);return this._names[e]={prefix:e,index:0}}}r.Scope=o;class s extends l.Name{constructor(e,t){super(t),this.prefix=e}setValue(e,{property:t,itemIndex:r}){this.value=e,this.scopePath=(0,l._)`.${new l.Name(t)}[${r}]`}}r.ValueScopeName=s;let c=(0,l._)`\n`;r.ValueScope=class extends o{constructor(e){super(e),this._values={},this._scope=e.scope,this.opts={...e,_n:e.lines?c:l.nil}}get(){return this._scope}name(e){return new s(e,this._newName(e))}value(e,t){var r;if(void 0===t.ref)throw Error("CodeGen: ref must be passed in value");let n=this.toName(e),{prefix:a}=n,l=null!=(r=t.key)?r:t.ref,i=this._values[a];if(i){let e=i.get(l);if(e)return e}else i=this._values[a]=new Map;i.set(l,n);let o=this._scope[a]||(this._scope[a]=[]),s=o.length;return o[s]=t.ref,n.setValue(t,{property:a,itemIndex:s}),n}getValue(e,t){let r=this._values[e];if(r)return r.get(t)}scopeRefs(e,t=this._values){return this._reduceValues(t,t=>{if(void 0===t.scopePath)throw Error(`CodeGen: name "${t}" has no value`);return(0,l._)`${e}${t.scopePath}`})}scopeCode(e=this._values,t,r){return this._reduceValues(e,e=>{if(void 0===e.value)throw Error(`CodeGen: name "${e}" has no value`);return e.value.code},t,r)}_reduceValues(e,t,a={},o){let s=l.nil;for(let c in e){let u=e[c];if(!u)continue;let d=a[c]=a[c]||new Map;
1u.forEach(e=>{if(d.has(e))return;d.set(e,n.Started);let a=t(e);if(a){let t=this.opts.es5?r.varKinds.var:r.varKinds.const;s=(0,l._)`${s}${t} ${e} = ${a};${this.opts._n}`}else if(a=null==o?void 0:o(e))s=(0,l._)`${s}${a}${this.opts._n}`;else throw new i(e);d.set(e,n.Completed)})}return s}}},100145,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.or=r.and=r.not=r.CodeGen=r.operators=r.varKinds=r.ValueScopeName=r.ValueScope=r.Scope=r.Name=r.regexpCode=r.stringify=r.getProperty=r.nil=r.strConcat=r.str=r._=void 0;let n=e.r(11294),a=e.r(683074);var l=e.r(11294);Object.defineProperty(r,"_",{enumerable:!0,get:function(){return l._}}),Object.defineProperty(r,"str",{enumerable:!0,get:function(){return l.str}}),Object.defineProperty(r,"strConcat",{enumerable:!0,get:function(){return l.strConcat}}),Object.defineProperty(r,"nil",{enumerable:!0,get:function(){return l.nil}}),Object.defineProperty(r,"getProperty",{enumerable:!0,get:function(){return l.getProperty}}),Object.defineProperty(r,"stringify",{enumerable:!0,get:function(){return l.stringify}}),Object.defineProperty(r,"regexpCode",{enumerable:!0,get:function(){return l.regexpCode}}),Object.defineProperty(r,"Name",{enumerable:!0,get:function(){return l.Name}});var i=e.r(683074);Object.defineProperty(r,"Scope",{enumerable:!0,get:function(){return i.Scope}}),Object.defineProperty(r,"ValueScope",{enumerable:!0,get:function(){return i.ValueScope}}),Object.defineProperty(r,"ValueScopeName",{enumerable:!0,get:function(){return i.ValueScopeName}}),Object.defineProperty(r,"varKinds",{enumerable:!0,get:function(){return i.varKinds}}),r.operators={GT:new n._Code(">"),GTE:new n._Code(">="),LT:new n._Code("<"),LTE:new n._Code("<="),EQ:new n._Code("==="),NEQ:new n._Code("!=="),NOT:new n._Code("!"),OR:new n._Code("||"),AND:new n._Code("&&"),ADD:new n._Code("+")};class o{optimizeNodes(){return this}optimizeNames(e,t){return this}}class s extends o{constructor(e,t,r){super(),this.varKind=e,this.name=t,this.rhs=r}render({es5:e,_n:t}){let r=e?a.varKinds.var:this.varKind,n=void 0===this.rhs?"":` = ${this.rhs}`;return`${r} ${this.name}${n};`+t}optimizeNames(e,t){if(e[this.name.str])return this.rhs&&(this.rhs=T(this.rhs,e,t)),this}get names(){return this.rhs instanceof n._CodeOrName?this.rhs.names:{}}}class c extends o{constructor(e,t,r){super(),this.lhs=e,this.rhs=t,this.sideEffects=r}render({_n:e}){return`${this.lhs} = ${this.rhs};`+e}optimizeNames(e,t){if(!(this.lhs instanceof n.Name)||e[this.lhs.str]||this.sideEffects)return this.rhs=T(this.rhs,e,t),this}get names(){return P(this.lhs instanceof n.Name?{}:{...this.lhs.names},this.rhs)}}class u extends c{constructor(e,t,r,n){super(e,r,n),this.op=t}render({_n:e}){return`${this.lhs} ${this.op}= ${this.rhs};`+e}}class d extends o{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){return`${this.label}:`+e}}class f extends o{constructor(e){super(),this.label=e,this.names={}}render({_n:e}){let t=this.label?` ${this.label}`:"";return`break${t};`+e}}class p extends o{constructor(e){super(),this.error=e}render({_n:e}){return`throw ${this.error};`+e}get names(){return this.error.names}}class h extends o{constructor(e){super(),this.code=e}render({_n:e}){return`${this.code};`+e}optimizeNodes(){return`${this.code}`?this:void 0}optimizeNames(e,t){return this.code=T(this.code,e,t),this}get names(){return this.code instanceof n._CodeOrName?this.code.names:{}}}class m extends o{constructor(e=[]){super(),this.nodes=e}render(e){return this.nodes.reduce((t,r)=>t+r.render(e),"")}optimizeNodes(){let{nodes:e}=this,t=e.length;for(;t--;){let r=e[t].optimizeNodes();Array.isArray(r)?e.splice(t,1,...r):r?e[t]=r:e.splice(t,1)}return e.length>0?this:void 0}optimizeNames(e,t){let{nodes:r}=this,n=r.length;for(;n--;){let a=r[n];a.optimizeNames(e,t)||(function(e,t){for(let r in t)e[r]=(e[r]||0)-(t[r]||0)}(e,a.names),r.splice(n,1))}return r.length>0?this:void 0}get names(){return this.nodes.reduce((e,t)=>N(e,t.names),{})}}class g extends m{render(e){return"{"+e._n+super.render(e)+"}"+e._n}}class b extends m{}class v extends g{}v.kind="else";class y extends g{constructor(e,t){super(t),this.condition=e}render(e){let t=`if(${this.condition})`+super.render(e);return this.else&&(t+="else "+this.else.render(e)),t}optimizeNodes(){super.optimizeNodes();let e=this.condition;if(!0===e)return this.nodes;let t=this.else;if(t){let e=t.optimizeNodes();t=this.else=Array.isArray(e)?new v(e):e}
1return t?!1===e?t instanceof y?t:t.nodes:this.nodes.length?this:new y(D(e),t instanceof y?[t]:t.nodes):!1!==e&&this.nodes.length?this:void 0}optimizeNames(e,t){var r;if(this.else=null==(r=this.else)?void 0:r.optimizeNames(e,t),super.optimizeNames(e,t)||this.else)return this.condition=T(this.condition,e,t),this}get names(){let e=super.names;return P(e,this.condition),this.else&&N(e,this.else.names),e}}y.kind="if";class x extends g{}x.kind="for";class w extends x{constructor(e){super(),this.iteration=e}render(e){return`for(${this.iteration})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iteration=T(this.iteration,e,t),this}get names(){return N(super.names,this.iteration.names)}}class C extends x{constructor(e,t,r,n){super(),this.varKind=e,this.name=t,this.from=r,this.to=n}render(e){let t=e.es5?a.varKinds.var:this.varKind,{name:r,from:n,to:l}=this;return`for(${t} ${r}=${n}; ${r}<${l}; ${r}++)`+super.render(e)}get names(){let e=P(super.names,this.from);return P(e,this.to)}}class j extends x{constructor(e,t,r,n){super(),this.loop=e,this.varKind=t,this.name=r,this.iterable=n}render(e){return`for(${this.varKind} ${this.name} ${this.loop} ${this.iterable})`+super.render(e)}optimizeNames(e,t){if(super.optimizeNames(e,t))return this.iterable=T(this.iterable,e,t),this}get names(){return N(super.names,this.iterable.names)}}class S extends g{constructor(e,t,r){super(),this.name=e,this.args=t,this.async=r}render(e){let t=this.async?"async ":"";return`${t}function ${this.name}(${this.args})`+super.render(e)}}S.kind="func";class $ extends m{render(e){return"return "+super.render(e)}}$.kind="return";class _ extends g{render(e){let t="try"+super.render(e);return this.catch&&(t+=this.catch.render(e)),this.finally&&(t+=this.finally.render(e)),t}optimizeNodes(){var e,t;return super.optimizeNodes(),null==(e=this.catch)||e.optimizeNodes(),null==(t=this.finally)||t.optimizeNodes(),this}optimizeNames(e,t){var r,n;return super.optimizeNames(e,t),null==(r=this.catch)||r.optimizeNames(e,t),null==(n=this.finally)||n.optimizeNames(e,t),this}get names(){let e=super.names;return this.catch&&N(e,this.catch.names),this.finally&&N(e,this.finally.names),e}}class k extends g{constructor(e){super(),this.error=e}render(e){return`catch(${this.error})`+super.render(e)}}k.kind="catch";class E extends g{render(e){return"finally"+super.render(e)}}function N(e,t){for(let r in t)e[r]=(e[r]||0)+(t[r]||0);return e}function P(e,t){return t instanceof n._CodeOrName?N(e,t.names):e}function T(e,t,r){var a;if(e instanceof n.Name)return l(e);if(!((a=e)instanceof n._Code&&a._items.some(e=>e instanceof n.Name&&1===t[e.str]&&void 0!==r[e.str])))return e;return new n._Code(e._items.reduce((e,t)=>(t instanceof n.Name&&(t=l(t)),t instanceof n._Code?e.push(...t._items):e.push(t),e),[]));function l(e){let n=r[e.str];return void 0===n||1!==t[e.str]?e:(delete t[e.str],n)}}function D(e){return"boolean"==typeof e||"number"==typeof e||null===e?!e:(0,n._)`!${L(e)}`}E.kind="finally",r.CodeGen=class{constructor(e,t={}){this._values={},this._blockStarts=[],this._constants={},this.opts={...t,_n:t.lines?"\n":""},this._extScope=e,this._scope=new a.Scope({parent:e}),this._nodes=[new b]}toString(){return this._root.render(this.opts)}name(e){return this._scope.name(e)}scopeName(e){return this._extScope.name(e)}scopeValue(e,t){let r=this._extScope.value(e,t);return(this._values[r.prefix]||(this._values[r.prefix]=new Set)).add(r),r}getScopeValue(e,t){return this._extScope.getValue(e,t)}scopeRefs(e){return this._extScope.scopeRefs(e,this._values)}scopeCode(){return this._extScope.scopeCode(this._values)}_def(e,t,r,n){let a=this._scope.toName(t);return void 0!==r&&n&&(this._constants[a.str]=r),this._leafNode(new s(e,a,r)),a}const(e,t,r){return this._def(a.varKinds.const,e,t,r)}let(e,t,r){return this._def(a.varKinds.let,e,t,r)}var(e,t,r){return this._def(a.varKinds.var,e,t,r)}assign(e,t,r){return this._leafNode(new c(e,t,r))}add(e,t){return this._leafNode(new u(e,r.operators.ADD,t))}code(e){return"function"==typeof e?e():e!==n.nil&&this._leafNode(new h(e)),this}object(...e){let t=["{"];for(let[r,a]of e)t.length>1&&t.push(","),t.push(r),(r!==a||this.opts.es5)&&(t.push(":"),(0,n.addCodeArg)(t,a));return t.push("}"),new n._Code(t)}
1if(e,t,r){if(this._blockNode(new y(e)),t&&r)this.code(t).else().code(r).endIf();else if(t)this.code(t).endIf();else if(r)throw Error('CodeGen: "else" body without "then" body');return this}elseIf(e){return this._elseNode(new y(e))}else(){return this._elseNode(new v)}endIf(){return this._endBlockNode(y,v)}_for(e,t){return this._blockNode(e),t&&this.code(t).endFor(),this}for(e,t){return this._for(new w(e),t)}forRange(e,t,r,n,l=this.opts.es5?a.varKinds.var:a.varKinds.let){let i=this._scope.toName(e);return this._for(new C(l,i,t,r),()=>n(i))}forOf(e,t,r,l=a.varKinds.const){let i=this._scope.toName(e);if(this.opts.es5){let e=t instanceof n.Name?t:this.var("_arr",t);return this.forRange("_i",0,(0,n._)`${e}.length`,t=>{this.var(i,(0,n._)`${e}[${t}]`),r(i)})}return this._for(new j("of",l,i,t),()=>r(i))}forIn(e,t,r,l=this.opts.es5?a.varKinds.var:a.varKinds.const){if(this.opts.ownProperties)return this.forOf(e,(0,n._)`Object.keys(${t})`,r);let i=this._scope.toName(e);return this._for(new j("in",l,i,t),()=>r(i))}endFor(){return this._endBlockNode(x)}label(e){return this._leafNode(new d(e))}break(e){return this._leafNode(new f(e))}return(e){let t=new $;if(this._blockNode(t),this.code(e),1!==t.nodes.length)throw Error('CodeGen: "return" should have one node');return this._endBlockNode($)}try(e,t,r){if(!t&&!r)throw Error('CodeGen: "try" without "catch" and "finally"');let n=new _;if(this._blockNode(n),this.code(e),t){let e=this.name("e");this._currNode=n.catch=new k(e),t(e)}return r&&(this._currNode=n.finally=new E,this.code(r)),this._endBlockNode(k,E)}throw(e){return this._leafNode(new p(e))}block(e,t){return this._blockStarts.push(this._nodes.length),e&&this.code(e).endBlock(t),this}endBlock(e){let t=this._blockStarts.pop();if(void 0===t)throw Error("CodeGen: not in self-balancing block");let r=this._nodes.length-t;if(r<0||void 0!==e&&r!==e)throw Error(`CodeGen: wrong number of nodes: ${r} vs ${e} expected`);return this._nodes.length=t,this}func(e,t=n.nil,r,a){return this._blockNode(new S(e,t,r)),a&&this.code(a).endFunc(),this}endFunc(){return this._endBlockNode(S)}optimize(e=1){for(;e-- >0;)this._root.optimizeNodes(),this._root.optimizeNames(this._root.names,this._constants)}_leafNode(e){return this._currNode.nodes.push(e),this}_blockNode(e){this._currNode.nodes.push(e),this._nodes.push(e)}_endBlockNode(e,t){let r=this._currNode;if(r instanceof e||t&&r instanceof t)return this._nodes.pop(),this;throw Error(`CodeGen: not in block "${t?`${e.kind}/${t.kind}`:e.kind}"`)}_elseNode(e){let t=this._currNode;if(!(t instanceof y))throw Error('CodeGen: "else" without "if"');return this._currNode=t.else=e,this}get _root(){return this._nodes[0]}get _currNode(){let e=this._nodes;return e[e.length-1]}set _currNode(e){let t=this._nodes;t[t.length-1]=e}},r.not=D;let R=O(r.operators.AND);r.and=function(...e){return e.reduce(R)};let A=O(r.operators.OR);function O(e){return(t,r)=>t===n.nil?r:r===n.nil?t:(0,n._)`${L(t)} ${e} ${L(r)}`}function L(e){return e instanceof n.Name?e:(0,n._)`(${e})`}r.or=function(...e){return e.reduce(A)}},803026,(e,t,r)=>{"use strict";var n,a;Object.defineProperty(r,"__esModule",{value:!0}),r.checkStrictMode=r.getErrorPath=r.Type=r.useFunc=r.setEvaluated=r.evaluatedPropsToName=r.mergeEvaluated=r.eachItem=r.unescapeJsonPointer=r.escapeJsonPointer=r.escapeFragment=r.unescapeFragment=r.schemaRefOrVal=r.schemaHasRulesButRef=r.schemaHasRules=r.checkUnknownRules=r.alwaysValidSchema=r.toHash=void 0;let l=e.r(100145),i=e.r(11294);function o(e,t=e.schema){let{opts:r,self:n}=e;if(!r.strictSchema||"boolean"==typeof t)return;let a=n.RULES.keywords;for(let r in t)a[r]||m(e,`unknown keyword: "${r}"`)}function s(e,t){if("boolean"==typeof e)return!e;for(let r in e)if(t[r])return!0;return!1}function c(e){return"number"==typeof e?`${e}`:e.replace(/~/g,"~0").replace(/\//g,"~1")}function u(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function d({mergeNames:e,mergeToName:t,mergeValues:r,resultToName:n}){return(a,i,o,s)=>{let c=void 0===o?i:o instanceof l.Name?(i instanceof l.Name?e(a,i,o):t(a,i,o),o):i instanceof l.Name?(t(a,o,i),i):r(i,o);return s!==l.Name||c instanceof l.Name?c:n(a,c)}}function f(e,t){if(!0===t)return e.var("props",!0);let r=e.var("props",(0,l._)`{}`);return void 0!==t&&p(e,r,t),r}function p(e,t,r){Object.keys(r).forEach(r=>e.assign((0,l._)`${t}${(0,l.getProperty)(r)}`,!0))}r.toHash=function(e){let t={};for(let r of e)t[r]=!0;return t},r.alwaysValidSchema=function(e,t){return"boolean"==typeof t?t:0===Object.keys(t).length||(o(e,t),!s(t,e.self.RULES.all))},r.checkUnknownRules=o,r.schemaHasRules=s,r.schemaHasRulesButRef=function(e,t){if("boolean"==typeof e)return!e;for(let r in e)if("$ref"!==r&&t.all[r])return!0;return!1},r.schemaRefOrVal=function({topSchemaRef:e,schemaPath:t},r,n,a){if(!a){if("number"==typeof r||"boolean"==typeof r)return r;if("string"==typeof r)return(0,l._)`${r}`}return(0,l._)`${e}${t}${(0,l.getProperty)(n)}`},r.unescapeFragment=function(e){return u(decodeURIComponent(e))},r.escapeFragment=function(e){return encodeURIComponent(c(e))},r.escapeJsonPointer=c,r.unescapeJsonPointer=u,r.eachItem=function(e,t){if(Array.isArray(e))for(let r of e)t(r);else t(e)},r.mergeEvaluated={props:d({mergeNames:(e,t,r)=>e.if((0,l._)`${r} !== true && ${t} !== undefined`,()=>{e.if((0,l._)`${t} === true`,()=>e.assign(r,!0),()=>e.assign(r,(0,l._)`${r} || {}`).code((0,l._)`Object.assign(${r}, ${t})`))}),mergeToName:(e,t,r)=>e.if((0,l._)`${r} !== true`,()=>{!0===t?e.assign(r,!0):(e.assign(r,(0,l._)`${r} || {}`),p(e,r,t))}),mergeValues:(e,t)=>!0===e||{...e,...t},resultToName:f}),items:d({mergeNames:(e,t,r)=>e.if((0,l._)`${r} !== true && ${t} !== undefined`,()=>e.assign(r,(0,l._)`${t} === true ? true : ${r} > ${t} ? ${r} : ${t}`)),mergeToName:(e,t,r)=>e.if((0,l._)`${r} !== true`,()=>e.assign(r,!0===t||(0,l._)`${r} > ${t} ? ${r} : ${t}`)),mergeValues:(e,t)=>!0===e||Math.max(e,t),resultToName:(e,t)=>
1e.var("items",t)})},r.evaluatedPropsToName=f,r.setEvaluated=p;let h={};function m(e,t,r=e.opts.strictSchema){if(r){if(t=`strict mode: ${t}`,!0===r)throw Error(t);e.self.logger.warn(t)}}r.useFunc=function(e,t){return e.scopeValue("func",{ref:t,code:h[t.code]||(h[t.code]=new i._Code(t.code))})},(a=n||(r.Type=n={}))[a.Num=0]="Num",a[a.Str=1]="Str",r.getErrorPath=function(e,t,r){if(e instanceof l.Name){let a=t===n.Num;return r?a?(0,l._)`"[" + ${e} + "]"`:(0,l._)`"['" + ${e} + "']"`:a?(0,l._)`"/" + ${e}`:(0,l._)`"/" + ${e}.replace(/~/g, "~0").replace(/\\//g, "~1")`}return r?(0,l.getProperty)(e).toString():"/"+c(e)},r.checkStrictMode=m},864130,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});let n=e.r(100145);r.default={data:new n.Name("data"),valCxt:new n.Name("valCxt"),instancePath:new n.Name("instancePath"),parentData:new n.Name("parentData"),parentDataProperty:new n.Name("parentDataProperty"),rootData:new n.Name("rootData"),dynamicAnchors:new n.Name("dynamicAnchors"),vErrors:new n.Name("vErrors"),errors:new n.Name("errors"),this:new n.Name("this"),self:new n.Name("self"),scope:new n.Name("scope"),json:new n.Name("json"),jsonPos:new n.Name("jsonPos"),jsonLen:new n.Name("jsonLen"),jsonPart:new n.Name("jsonPart")}},904,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.extendErrors=r.resetErrorsCount=r.reportExtraError=r.reportError=r.keyword$DataError=r.keywordError=void 0;let n=e.r(100145),a=e.r(803026),l=e.r(864130);function i(e,t){let r=e.const("err",t);e.if((0,n._)`${l.default.vErrors} === null`,()=>e.assign(l.default.vErrors,(0,n._)`[${r}]`),(0,n._)`${l.default.vErrors}.push(${r})`),e.code((0,n._)`${l.default.errors}++`)}function o(e,t){let{gen:r,validateName:a,schemaEnv:l}=e;l.$async?r.throw((0,n._)`new ${e.ValidationError}(${t})`):(r.assign((0,n._)`${a}.errors`,t),r.return(!1))}r.keywordError={message:({keyword:e})=>(0,n.str)`must pass "${e}" keyword validation`},r.keyword$DataError={message:({keyword:e,schemaType:t})=>t?(0,n.str)`"${e}" keyword must be ${t} ($data)`:(0,n.str)`"${e}" keyword is invalid ($data)`},r.reportError=function(e,t=r.keywordError,a,l){let{it:s}=e,{gen:u,compositeRule:d,allErrors:f}=s,p=c(e,t,a);(null!=l?l:d||f)?i(u,p):o(s,(0,n._)`[${p}]`)},r.reportExtraError=function(e,t=r.keywordError,n){let{it:a}=e,{gen:s,compositeRule:u,allErrors:d}=a;i(s,c(e,t,n)),u||d||o(a,l.default.vErrors)},r.resetErrorsCount=function(e,t){e.assign(l.default.errors,t),e.if((0,n._)`${l.default.vErrors} !== null`,()=>e.if(t,()=>e.assign((0,n._)`${l.default.vErrors}.length`,t),()=>e.assign(l.default.vErrors,null)))},r.extendErrors=function({gen:e,keyword:t,schemaValue:r,data:a,errsCount:i,it:o}){if(void 0===i)throw Error("ajv implementation error");let s=e.name("err");e.forRange("i",i,l.default.errors,i=>{e.const(s,(0,n._)`${l.default.vErrors}[${i}]`),e.if((0,n._)`${s}.instancePath === undefined`,()=>e.assign((0,n._)`${s}.instancePath`,(0,n.strConcat)(l.default.instancePath,o.errorPath))),e.assign((0,n._)`${s}.schemaPath`,(0,n.str)`${o.errSchemaPath}/${t}`),o.opts.verbose&&(e.assign((0,n._)`${s}.schema`,r),e.assign((0,n._)`${s}.data`,a))})};let s={keyword:new n.Name("keyword"),schemaPath:new n.Name("schemaPath"),params:new n.Name("params"),propertyName:new n.Name("propertyName"),message:new n.Name("message"),schema:new n.Name("schema"),parentSchema:new n.Name("parentSchema")};function c(e,t,r){let{createErrors:i}=e.it;return!1===i?(0,n._)`{}`:function(e,t,r={}){let{gen:i,it:o}=e,c=[function({errorPath:e},{instancePath:t}){let r=t?(0,n.str)`${e}${(0,a.getErrorPath)(t,a.Type.Str)}`:e;return[l.default.instancePath,(0,n.strConcat)(l.default.instancePath,r)]}(o,r),function({keyword:e,it:{errSchemaPath:t}},{schemaPath:r,parentSchema:l}){let i=l?t:(0,n.str)`${t}/${e}`;return r&&(i=(0,n.str)`${i}${(0,a.getErrorPath)(r,a.Type.Str)}`),[s.schemaPath,i]}(e,r)];return function(e,{params:t,message:r},a){let{keyword:i,data:o,schemaValue:c,it:u}=e,{opts:d,propertyName:f,topSchemaRef:p,schemaPath:h}=u;a.push([s.keyword,i],[s.params,"function"==typeof t?t(e):t||(0,n._)`{}`]),d.messages&&a.push([s.message,"function"==typeof r?r(e):r]),d.verbose&&a.push([s.schema,c],[s.parentSchema,(0,n._)`${p}${h}`],[l.default.data,o]),f&&a.push([s.propertyName,f])}(e,t,c),i.object(...c)}(e,t,r)}},170584,(e,t,r)=>{"use strict";
1Object.defineProperty(r,"__esModule",{value:!0}),r.boolOrEmptySchema=r.topBoolOrEmptySchema=void 0;let n=e.r(904),a=e.r(100145),l=e.r(864130),i={message:"boolean schema is false"};function o(e,t){let{gen:r,data:a}=e;(0,n.reportError)({gen:r,keyword:"false schema",data:a,schema:!1,schemaCode:!1,schemaValue:!1,params:{},it:e},i,void 0,t)}r.topBoolOrEmptySchema=function(e){let{gen:t,schema:r,validateName:n}=e;!1===r?o(e,!1):"object"==typeof r&&!0===r.$async?t.return(l.default.data):(t.assign((0,a._)`${n}.errors`,null),t.return(!0))},r.boolOrEmptySchema=function(e,t){let{gen:r,schema:n}=e;!1===n?(r.var(t,!1),o(e)):r.var(t,!0)}},388660,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.getRules=r.isJSONType=void 0;let n=new Set(["string","number","integer","boolean","null","object","array"]);r.isJSONType=function(e){return"string"==typeof e&&n.has(e)},r.getRules=function(){let e={number:{type:"number",rules:[]},string:{type:"string",rules:[]},array:{type:"array",rules:[]},object:{type:"object",rules:[]}};return{types:{...e,integer:!0,boolean:!0,null:!0},rules:[{rules:[]},e.number,e.string,e.array,e.object],post:{rules:[]},all:{},keywords:{}}}},571342,(e,t,r)=>{"use strict";function n(e,t){return t.rules.some(t=>a(e,t))}function a(e,t){var r;return void 0!==e[t.keyword]||(null==(r=t.definition.implements)?void 0:r.some(t=>void 0!==e[t]))}Object.defineProperty(r,"__esModule",{value:!0}),r.shouldUseRule=r.shouldUseGroup=r.schemaHasRulesForType=void 0,r.schemaHasRulesForType=function({schema:e,self:t},r){let a=t.RULES.types[r];return a&&!0!==a&&n(e,a)},r.shouldUseGroup=n,r.shouldUseRule=a},795401,(e,t,r)=>{"use strict";var n,a;Object.defineProperty(r,"__esModule",{value:!0}),r.reportTypeError=r.checkDataTypes=r.checkDataType=r.coerceAndCheckDataType=r.getJSONTypes=r.getSchemaTypes=r.DataType=void 0;let l=e.r(388660),i=e.r(571342),o=e.r(904),s=e.r(100145),c=e.r(803026);function u(e){let t=Array.isArray(e)?e:e?[e]:[];if(t.every(l.isJSONType))return t;throw Error("type must be JSONType or JSONType[]: "+t.join(","))}(a=n||(r.DataType=n={}))[a.Correct=0]="Correct",a[a.Wrong=1]="Wrong",r.getSchemaTypes=function(e){let t=u(e.type);if(t.includes("null")){if(!1===e.nullable)throw Error("type: null contradicts nullable: false")}else{if(!t.length&&void 0!==e.nullable)throw Error('"nullable" cannot be used without "type"');!0===e.nullable&&t.push("null")}return t},r.getJSONTypes=u,r.coerceAndCheckDataType=function(e,t){var r,a;let{gen:l,data:o,opts:c}=e,u=(r=t,(a=c.coerceTypes)?r.filter(e=>d.has(e)||"array"===a&&"array"===e):[]),f=t.length>0&&!(0===u.length&&1===t.length&&(0,i.schemaHasRulesForType)(e,t[0]));if(f){let r=p(t,o,c.strictNumbers,n.Wrong);l.if(r,()=>{u.length?function(e,t,r){let{gen:n,data:a,opts:l}=e,i=n.let("dataType",(0,s._)`typeof ${a}`),o=n.let("coerced",(0,s._)`undefined`);for(let e of("array"===l.coerceTypes&&n.if((0,s._)`${i} == 'object' && Array.isArray(${a}) && ${a}.length == 1`,()=>n.assign(a,(0,s._)`${a}[0]`).assign(i,(0,s._)`typeof ${a}`).if(p(t,a,l.strictNumbers),()=>n.assign(o,a))),n.if((0,s._)`${o} !== undefined`),r))(d.has(e)||"array"===e&&"array"===l.coerceTypes)&&function(e){switch(e){case"string":n.elseIf((0,s._)`${i} == "number" || ${i} == "boolean"`).assign(o,(0,s._)`"" + ${a}`).elseIf((0,s._)`${a} === null`).assign(o,(0,s._)`""`);return;case"number":n.elseIf((0,s._)`${i} == "boolean" || ${a} === null
2              || (${i} == "string" && ${a} && ${a} == +${a})`).assign(o,(0,s._)`+${a}`);return;case"integer":n.elseIf((0,s._)`${i} === "boolean" || ${a} === null
3              || (${i} === "string" && ${a} && ${a} == +${a} && !(${a} % 1))`).assign(o,(0,s._)`+${a}`);return;case"boolean":n.elseIf((0,s._)`${a} === "false" || ${a} === 0 || ${a} === null`).assign(o,!1).elseIf((0,s._)`${a} === "true" || ${a} === 1`).assign(o,!0);return;case"null":n.elseIf((0,s._)`${a} === "" || ${a} === 0 || ${a} === false`),n.assign(o,null);return;case"array":n.elseIf((0,s._)`${i} === "string" || ${i} === "number"
4              || ${i} === "boolean" || ${a} === null`).assign(o,(0,s._)`[${a}]`)}}(e);n.else(),m(e),n.endIf(),n.if((0,s._)`${o} !== undefined`,()=>{n.assign(a,o),function({gen:e,parentData:t,parentDataProperty:r},n){e.if((0,s._)`${t} !== undefined`,()=>e.assign((0,s._)`${t}[${r}]`,n))}(e,o)})}(e,t,u):m(e)})}return f};let d=new Set(["string","number","integer","boolean","null"]);function f(e,t,r,a=n.Correct){let l,i=a===n.Correct?s.operators.EQ:s.operators.NEQ;switch(e){case"null":return(0,s._)`${t} ${i} null`;case"array":l=(0,s._)`Array.isArray(${t})`;break;case"object":l=(0,s._)`${t} && typeof ${t} == "object" && !Array.isArray(${t})`;break;case"integer":l=o((0,s._)`!(${t} % 1) && !isNaN(${t})`);break;case"number":l=o();break;default:return(0,s._)`typeof ${t} ${i} ${e}`}return a===n.Correct?l:(0,s.not)(l);function o(e=s.nil){return(0,s.and)((0,s._)`typeof ${t} == "number"`,e,r?(0,s._)`isFinite(${t})`:s.nil)}}function p(e,t,r,n){let a;if(1===e.length)return f(e[0],t,r,n);let l=(0,c.toHash)(e);if(l.array&&l.object){let e=(0,s._)`typeof ${t} != "object"`;a=l.null?e:(0,s._)`!${t} || ${e}`,delete l.null,delete l.array,delete l.object}else a=s.nil;for(let e in l.number&&delete l.integer,l)a=(0,s.and)(a,f(e,t,r,n));return a}r.checkDataType=f,r.checkDataTypes=p;let h={message:({schema:e})=>`must be ${e}`,params:({schema:e,schemaValue:t})=>"string"==typeof e?(0,s._)`{type: ${e}}`:(0,s._)`{type: ${t}}`};function m(e){let t=function(e){let{gen:t,data:r,schema:n}=e,a=(0,c.schemaRefOrVal)(e,n,"type");return{gen:t,keyword:"type",data:r,schema:n.type,schemaCode:a,schemaValue:a,parentSchema:n,params:{},it:e}}(e);(0,o.reportError)(t,h)}r.reportTypeError=m},630096,(e,t,r)=>{"use strict";
4Object.defineProperty(r,"__esModule",{value:!0}),r.assignDefaults=void 0;let n=e.r(100145),a=e.r(803026);function l(e,t,r){let{gen:l,compositeRule:i,data:o,opts:s}=e;if(void 0===r)return;let c=(0,n._)`${o}${(0,n.getProperty)(t)}`;if(i)return void(0,a.checkStrictMode)(e,`default is ignored for: ${c}`);let u=(0,n._)`${c} === undefined`;"empty"===s.useDefaults&&(u=(0,n._)`${u} || ${c} === null || ${c} === ""`),l.if(u,(0,n._)`${c} = ${(0,n.stringify)(r)}`)}r.assignDefaults=function(e,t){let{properties:r,items:n}=e.schema;if("object"===t&&r)for(let t in r)l(e,t,r[t].default);else"array"===t&&Array.isArray(n)&&n.forEach((t,r)=>l(e,r,t.default))}},966992,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.validateUnion=r.validateArray=r.usePattern=r.callValidateCode=r.schemaProperties=r.allSchemaProperties=r.noPropertyInData=r.propertyInData=r.isOwnProperty=r.hasPropFunc=r.reportMissingProp=r.checkMissingProp=r.checkReportMissingProp=void 0;let n=e.r(100145),a=e.r(803026),l=e.r(864130),i=e.r(803026);function o(e){return e.scopeValue("func",{ref:Object.prototype.hasOwnProperty,code:(0,n._)`Object.prototype.hasOwnProperty`})}function s(e,t,r){return(0,n._)`${o(e)}.call(${t}, ${r})`}function c(e,t,r,a){let l=(0,n._)`${t}${(0,n.getProperty)(r)} === undefined`;return a?(0,n.or)(l,(0,n.not)(s(e,t,r))):l}function u(e){return e?Object.keys(e).filter(e=>"__proto__"!==e):[]}r.checkReportMissingProp=function(e,t){let{gen:r,data:a,it:l}=e;r.if(c(r,a,t,l.opts.ownProperties),()=>{e.setParams({missingProperty:(0,n._)`${t}`},!0),e.error()})},r.checkMissingProp=function({gen:e,data:t,it:{opts:r}},a,l){return(0,n.or)(...a.map(a=>(0,n.and)(c(e,t,a,r.ownProperties),(0,n._)`${l} = ${a}`)))},r.reportMissingProp=function(e,t){e.setParams({missingProperty:t},!0),e.error()},r.hasPropFunc=o,r.isOwnProperty=s,r.propertyInData=function(e,t,r,a){let l=(0,n._)`${t}${(0,n.getProperty)(r)} !== undefined`;return a?(0,n._)`${l} && ${s(e,t,r)}`:l},r.noPropertyInData=c,r.allSchemaProperties=u,r.schemaProperties=function(e,t){return u(t).filter(r=>!(0,a.alwaysValidSchema)(e,t[r]))},r.callValidateCode=function({schemaCode:e,data:t,it:{gen:r,topSchemaRef:a,schemaPath:i,errorPath:o},it:s},c,u,d){let f=d?(0,n._)`${e}, ${t}, ${a}${i}`:t,p=[[l.default.instancePath,(0,n.strConcat)(l.default.instancePath,o)],[l.default.parentData,s.parentData],[l.default.parentDataProperty,s.parentDataProperty],[l.default.rootData,l.default.rootData]];s.opts.dynamicRef&&p.push([l.default.dynamicAnchors,l.default.dynamicAnchors]);let h=(0,n._)`${f}, ${r.object(...p)}`;return u!==n.nil?(0,n._)`${c}.call(${u}, ${h})`:(0,n._)`${c}(${h})`};let d=(0,n._)`new RegExp`;r.usePattern=function({gen:e,it:{opts:t}},r){let a=t.unicodeRegExp?"u":"",{regExp:l}=t.code,o=l(r,a);return e.scopeValue("pattern",{key:o.toString(),ref:o,code:(0,n._)`${"new RegExp"===l.code?d:(0,i.useFunc)(e,l)}(${r}, ${a})`})},r.validateArray=function(e){let{gen:t,data:r,keyword:l,it:i}=e,o=t.name("valid");if(i.allErrors){let e=t.let("valid",!0);return s(()=>t.assign(e,!1)),e}return t.var(o,!0),s(()=>t.break()),o;function s(i){let s=t.const("len",(0,n._)`${r}.length`);t.forRange("i",0,s,r=>{e.subschema({keyword:l,dataProp:r,dataPropType:a.Type.Num},o),t.if((0,n.not)(o),i)})}},r.validateUnion=function(e){let{gen:t,schema:r,keyword:l,it:i}=e;if(!Array.isArray(r))throw Error("ajv implementation error");if(r.some(e=>(0,a.alwaysValidSchema)(i,e))&&!i.opts.unevaluated)return;let o=t.let("valid",!1),s=t.name("_valid");t.block(()=>r.forEach((r,a)=>{let i=e.subschema({keyword:l,schemaProp:a,compositeRule:!0},s);t.assign(o,(0,n._)`${o} || ${s}`),e.mergeValidEvaluated(i,s)||t.if((0,n.not)(o))})),e.result(o,()=>e.reset(),()=>e.error(!0))}},525952,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.validateKeywordUsage=r.validSchemaType=r.funcKeywordCode=r.macroKeywordCode=void 0;let n=e.r(100145),a=e.r(864130),l=e.r(966992),i=e.r(904);function o(e){let{gen:t,data:r,it:a}=e;t.if(a.parentData,()=>t.assign(r,(0,n._)`${a.parentData}[${a.parentDataProperty}]`))}function s(e,t,r){if(void 0===r)throw Error(`keyword "${t}" failed to compile`);return e.scopeValue("keyword","function"==typeof r?{ref:r}:{ref:r,code:(0,n.stringify)(r)})}r.macroKeywordCode=function(e,t){let{gen:r,keyword:a,schema:l,parentSchema:i,it:o}=e,c=t.macro.call(o.self,l,i,o),u=s(r,a,c);!1!==o.opts.validateSchema&&o.self.validateSchema(c,!0);let d=r.name("valid");e.subschema({schema:c,schemaPath:n.nil,errSchemaPath:`${o.errSchemaPath}/${a}`,topSchemaRef:u,compositeRule:!0},d),e.pass(d,()=>e.error(!0))},r.funcKeywordCode=function(e,t){var r;let{gen:c,keyword:u,schema:d,parentSchema:f,$data:p,it:h}=e;!function({schemaEnv:e},t){if(t.async&&!e.$async)throw Error("async keyword in sync schema")}(h,t);let m=s(c,u,!p&&t.compile?t.compile.call(h.self,d,f,h):t.validate),g=c.let("valid");function b(r=t.async?(0,n._)`await `:n.nil){let i=h.opts.passContext?a.default.this:a.default.self,o=!("compile"in t&&!p||!1===t.schema);c.assign(g,(0,n._)`${r}${(0,l.callValidateCode)(e,m,i,o)}`,t.modifying)}function v(e){var r;c.if((0,n.not)(null!=(r=t.valid)?r:g),e)}e.block$data(g,function(){if(!1===t.errors)b(),t.modifying&&o(e),v(()=>e.error());
4else{let r,l,s=t.async?(r=c.let("ruleErrs",null),c.try(()=>b((0,n._)`await `),e=>c.assign(g,!1).if((0,n._)`${e} instanceof ${h.ValidationError}`,()=>c.assign(r,(0,n._)`${e}.errors`),()=>c.throw(e))),r):(l=(0,n._)`${m}.errors`,c.assign(l,null),b(n.nil),l);t.modifying&&o(e),v(()=>(function(e,t){let{gen:r}=e;r.if((0,n._)`Array.isArray(${t})`,()=>{r.assign(a.default.vErrors,(0,n._)`${a.default.vErrors} === null ? ${t} : ${a.default.vErrors}.concat(${t})`).assign(a.default.errors,(0,n._)`${a.default.vErrors}.length`),(0,i.extendErrors)(e)},()=>e.error())})(e,s))}}),e.ok(null!=(r=t.valid)?r:g)},r.validSchemaType=function(e,t,r=!1){return!t.length||t.some(t=>"array"===t?Array.isArray(e):"object"===t?e&&"object"==typeof e&&!Array.isArray(e):typeof e==t||r&&void 0===e)},r.validateKeywordUsage=function({schema:e,opts:t,self:r,errSchemaPath:n},a,l){if(Array.isArray(a.keyword)?!a.keyword.includes(l):a.keyword!==l)throw Error("ajv implementation error");let i=a.dependencies;if(null==i?void 0:i.some(t=>!Object.prototype.hasOwnProperty.call(e,t)))throw Error(`parent schema must have dependencies of ${l}: ${i.join(",")}`);if(a.validateSchema&&!a.validateSchema(e[l])){let e=`keyword "${l}" value is invalid at path "${n}": `+r.errorsText(a.validateSchema.errors);if("log"===t.validateSchema)r.logger.error(e);else throw Error(e)}}},991565,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.extendSubschemaMode=r.extendSubschemaData=r.getSubschema=void 0;let n=e.r(100145),a=e.r(803026);r.getSubschema=function(e,{keyword:t,schemaProp:r,schema:l,schemaPath:i,errSchemaPath:o,topSchemaRef:s}){if(void 0!==t&&void 0!==l)throw Error('both "keyword" and "schema" passed, only one allowed');if(void 0!==t){let l=e.schema[t];return void 0===r?{schema:l,schemaPath:(0,n._)`${e.schemaPath}${(0,n.getProperty)(t)}`,errSchemaPath:`${e.errSchemaPath}/${t}`}:{schema:l[r],schemaPath:(0,n._)`${e.schemaPath}${(0,n.getProperty)(t)}${(0,n.getProperty)(r)}`,errSchemaPath:`${e.errSchemaPath}/${t}/${(0,a.escapeFragment)(r)}`}}if(void 0!==l){if(void 0===i||void 0===o||void 0===s)throw Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"');return{schema:l,schemaPath:i,topSchemaRef:s,errSchemaPath:o}}throw Error('either "keyword" or "schema" must be passed')},r.extendSubschemaData=function(e,t,{dataProp:r,dataPropType:l,data:i,dataTypes:o,propertyName:s}){if(void 0!==i&&void 0!==r)throw Error('both "data" and "dataProp" passed, only one allowed');let{gen:c}=t;if(void 0!==r){let{errorPath:i,dataPathArr:o,opts:s}=t;u(c.let("data",(0,n._)`${t.data}${(0,n.getProperty)(r)}`,!0)),e.errorPath=(0,n.str)`${i}${(0,a.getErrorPath)(r,l,s.jsPropertySyntax)}`,e.parentDataProperty=(0,n._)`${r}`,e.dataPathArr=[...o,e.parentDataProperty]}function u(r){e.data=r,e.dataLevel=t.dataLevel+1,e.dataTypes=[],t.definedProperties=new Set,e.parentData=t.data,e.dataNames=[...t.dataNames,r]}void 0!==i&&(u(i instanceof n.Name?i:c.let("data",i,!0)),void 0!==s&&(e.propertyName=s)),o&&(e.dataTypes=o)},r.extendSubschemaMode=function(e,{jtdDiscriminator:t,jtdMetadata:r,compositeRule:n,createErrors:a,allErrors:l}){void 0!==n&&(e.compositeRule=n),void 0!==a&&(e.createErrors=a),void 0!==l&&(e.allErrors=l),e.jtdDiscriminator=t,e.jtdMetadata=r}},65932,(e,t,r)=>{"use strict";t.exports=function e(t,r){if(t===r)return!0;if(t&&r&&"object"==typeof t&&"object"==typeof r){if(t.constructor!==r.constructor)return!1;if(Array.isArray(t)){if((n=t.length)!=r.length)return!1;for(a=n;0!=a--;)if(!e(t[a],r[a]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if((n=(l=Object.keys(t)).length)!==Object.keys(r).length)return!1;for(a=n;0!=a--;)if(!Object.prototype.hasOwnProperty.call(r,l[a]))return!1;for(a=n;0!=a--;){var n,a,l,i=l[a];if(!e(t[i],r[i]))return!1}return!0}return t!=t&&r!=r}},725028,(e,t,r)=>{"use strict";var n=t.exports=function(e,t,r){"function"==typeof t&&(r=t,t={});var a="function"==typeof(r=t.cb||r)?r:r.pre||function(){};!function e(t,r,a,l,i,o,s,c,u,d){if(l&&"object"==typeof l&&!Array.isArray(l)){for(var f in r(l,i,o,s,c,u,d),l){var p=l[f];if(Array.isArray(p)){if(f in n.arrayKeywords)for(var h=0;h<p.length;h++)e(t,r,a,p[h],i+"/"+f+"/"+h,o,i,f,l,h)}else if(f in n.propsKeywords){if(p&&"object"==typeof p)for(var m in p)e(t,r,a,p[m],i+"/"+f+"/"+m.replace(/~/g,"~0").replace(/\//g,"~1"),o,i,f,l,m)}
4else(f in n.keywords||t.allKeys&&!(f in n.skipKeywords))&&e(t,r,a,p,i+"/"+f,o,i,f,l)}a(l,i,o,s,c,u,d)}}(t,a,r.post||function(){},e,"",e)};n.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0,if:!0,then:!0,else:!0},n.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0},n.propsKeywords={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependencies:!0},n.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0}},336370,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.getSchemaRefs=r.resolveUrl=r.normalizeId=r._getFullPath=r.getFullPath=r.inlineRef=void 0;let n=e.r(803026),a=e.r(65932),l=e.r(725028),i=new Set(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum","const"]);r.inlineRef=function(e,t=!0){return"boolean"==typeof e||(!0===t?!function e(t){for(let r in t){if(o.has(r))return!0;let n=t[r];if(Array.isArray(n)&&n.some(e)||"object"==typeof n&&e(n))return!0}return!1}(e):!!t&&function e(t){let r=0;for(let a in t)if("$ref"===a||(r++,!i.has(a)&&("object"==typeof t[a]&&(0,n.eachItem)(t[a],t=>r+=e(t)),r===1/0)))return 1/0;return r}(e)<=t)};let o=new Set(["$ref","$recursiveRef","$recursiveAnchor","$dynamicRef","$dynamicAnchor"]);function s(e,t="",r){!1!==r&&(t=d(t));let n=e.parse(t);return c(e,n)}function c(e,t){return e.serialize(t).split("#")[0]+"#"}r.getFullPath=s,r._getFullPath=c;let u=/#\/?$/;function d(e){return e?e.replace(u,""):""}r.normalizeId=d,r.resolveUrl=function(e,t,r){return r=d(r),e.resolve(t,r)};let f=/^[a-z_][-a-z0-9._]*$/i;r.getSchemaRefs=function(e,t){if("boolean"==typeof e)return{};let{schemaId:r,uriResolver:n}=this.opts,i=d(e[r]||t),o={"":i},c=s(n,i,!1),u={},p=new Set;return l(e,{allKeys:!0},(e,t,n,a)=>{if(void 0===a)return;let l=c+t,i=o[a];function s(t){let r=this.opts.uriResolver.resolve;if(t=d(i?r(i,t):t),p.has(t))throw m(t);p.add(t);let n=this.refs[t];return"string"==typeof n&&(n=this.refs[n]),"object"==typeof n?h(e,n.schema,t):t!==d(l)&&("#"===t[0]?(h(e,u[t],t),u[t]=e):this.refs[t]=l),t}function g(e){if("string"==typeof e){if(!f.test(e))throw Error(`invalid anchor "${e}"`);s.call(this,`#${e}`)}}"string"==typeof e[r]&&(i=s.call(this,e[r])),g.call(this,e.$anchor),g.call(this,e.$dynamicAnchor),o[t]=i}),u;function h(e,t,r){if(void 0!==t&&!a(e,t))throw m(r)}function m(e){return Error(`reference "${e}" resolves to more than one schema`)}}},341770,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.getData=r.KeywordCxt=r.validateFunctionCode=void 0;let n=e.r(170584),a=e.r(795401),l=e.r(571342),i=e.r(795401),o=e.r(630096),s=e.r(525952),c=e.r(991565),u=e.r(100145),d=e.r(864130),f=e.r(336370),p=e.r(803026),h=e.r(904);function m({gen:e,validateName:t,schema:r,schemaEnv:n,opts:a},l){var i;a.code.es5?e.func(t,(0,u._)`${d.default.data}, ${d.default.valCxt}`,n.$async,()=>{var t,n;e.code((0,u._)`"use strict"; ${g(r,a)}`),t=e,n=a,t.if(d.default.valCxt,()=>{t.var(d.default.instancePath,(0,u._)`${d.default.valCxt}.${d.default.instancePath}`),t.var(d.default.parentData,(0,u._)`${d.default.valCxt}.${d.default.parentData}`),t.var(d.default.parentDataProperty,(0,u._)`${d.default.valCxt}.${d.default.parentDataProperty}`),t.var(d.default.rootData,(0,u._)`${d.default.valCxt}.${d.default.rootData}`),n.dynamicRef&&t.var(d.default.dynamicAnchors,(0,u._)`${d.default.valCxt}.${d.default.dynamicAnchors}`)},()=>{t.var(d.default.instancePath,(0,u._)`""`),t.var(d.default.parentData,(0,u._)`undefined`),t.var(d.default.parentDataProperty,(0,u._)`undefined`),t.var(d.default.rootData,d.default.data),n.dynamicRef&&t.var(d.default.dynamicAnchors,(0,u._)`{}`)}),e.code(l)}):e.func(t,(0,u._)`${d.default.data}, ${(i=a,(0,u._)`{${d.default.instancePath}="", ${d.default.parentData}, ${d.default.parentDataProperty}, ${d.default.rootData}=${d.default.data}${i.dynamicRef?(0,u._)`, ${d.default.dynamicAnchors}={}`:u.nil}}={}`)}`,n.$async,()=>e.code(g(r,a)).code(l))}function g(e,t){let r="object"==typeof e&&e[t.schemaId];return r&&(t.code.source||t.code.process)?(0,u._)`/*# sourceURL=${r} */`:u.nil}function b({schema:e,self:t}){if("boolean"==typeof e)return!e;for(let r in e)if(t.RULES.all[r])return!0;return!1}function v(e){return"boolean"!=typeof e.schema}function y(e){(0,p.checkUnknownRules)(e),function(e){let{schema:t,errSchemaPath:r,opts:n,self:
4a}=e;t.$ref&&n.ignoreKeywordsWithRef&&(0,p.schemaHasRulesButRef)(t,a.RULES)&&a.logger.warn(`$ref: keywords ignored in schema at path "${r}"`)}(e)}function x(e,t){if(e.opts.jtd)return C(e,[],!1,t);let r=(0,a.getSchemaTypes)(e.schema),n=(0,a.coerceAndCheckDataType)(e,r);C(e,r,!n,t)}function w({gen:e,schemaEnv:t,schema:r,errSchemaPath:n,opts:a}){let l=r.$comment;if(!0===a.$comment)e.code((0,u._)`${d.default.self}.logger.log(${l})`);else if("function"==typeof a.$comment){let r=(0,u.str)`${n}/$comment`,a=e.scopeValue("root",{ref:t.root});e.code((0,u._)`${d.default.self}.opts.$comment(${l}, ${r}, ${a}.schema)`)}}function C(e,t,r,n){var a,o,s,c;let{gen:f,schema:h,data:m,allErrors:g,opts:b,self:v}=e,{RULES:y}=v;if(h.$ref&&(b.ignoreKeywordsWithRef||!(0,p.schemaHasRulesButRef)(h,y)))return void f.block(()=>k(e,"$ref",y.all.$ref.definition));function x(a){(0,l.shouldUseGroup)(h,a)&&(a.type?(f.if((0,i.checkDataType)(a.type,m,b.strictNumbers)),j(e,a),1===t.length&&t[0]===a.type&&r&&(f.else(),(0,i.reportTypeError)(e)),f.endIf()):j(e,a),g||f.if((0,u._)`${d.default.errors} === ${n||0}`))}b.jtd||(a=e,o=t,!a.schemaEnv.meta&&a.opts.strictTypes&&(function(e,t){if(t.length){if(!e.dataTypes.length){e.dataTypes=t;return}t.forEach(t=>{S(e.dataTypes,t)||$(e,`type "${t}" not allowed by context "${e.dataTypes.join(",")}"`)}),function(e,t){let r=[];for(let n of e.dataTypes)S(t,n)?r.push(n):t.includes("integer")&&"number"===n&&r.push("integer");e.dataTypes=r}(e,t)}}(a,o),a.opts.allowUnionTypes||(s=a,(c=o).length>1&&!(2===c.length&&c.includes("null"))&&$(s,"use allowUnionTypes to allow union type keyword")),function(e,t){let r=e.self.RULES.all;for(let n in r){let a=r[n];if("object"==typeof a&&(0,l.shouldUseRule)(e.schema,a)){let{type:r}=a.definition;r.length&&!r.some(e=>{var r,n;return r=t,n=e,r.includes(n)||"number"===n&&r.includes("integer")})&&$(e,`missing type "${r.join(",")}" for keyword "${n}"`)}}}(a,a.dataTypes))),f.block(()=>{for(let e of y.rules)x(e);x(y.post)})}function j(e,t){let{gen:r,schema:n,opts:{useDefaults:a}}=e;a&&(0,o.assignDefaults)(e,t.type),r.block(()=>{for(let r of t.rules)(0,l.shouldUseRule)(n,r)&&k(e,r.keyword,r.definition,t.type)})}function S(e,t){return e.includes(t)||"integer"===t&&e.includes("number")}function $(e,t){let r=e.schemaEnv.baseId+e.errSchemaPath;t+=` at "${r}" (strictTypes)`,(0,p.checkStrictMode)(e,t,e.opts.strictTypes)}r.validateFunctionCode=function(e){v(e)&&(y(e),b(e))?function(e){let{schema:t,opts:r,gen:n}=e;m(e,()=>{r.$comment&&t.$comment&&w(e),function(e){let{schema:t,opts:r}=e;void 0!==t.default&&r.useDefaults&&r.strictSchema&&(0,p.checkStrictMode)(e,"default is ignored in the schema root")}(e),n.let(d.default.vErrors,null),n.let(d.default.errors,0),r.unevaluated&&function(e){let{gen:t,validateName:r}=e;e.evaluated=t.const("evaluated",(0,u._)`${r}.evaluated`),t.if((0,u._)`${e.evaluated}.dynamicProps`,()=>t.assign((0,u._)`${e.evaluated}.props`,(0,u._)`undefined`)),t.if((0,u._)`${e.evaluated}.dynamicItems`,()=>t.assign((0,u._)`${e.evaluated}.items`,(0,u._)`undefined`))}(e),x(e),function(e){let{gen:t,schemaEnv:r,validateName:n,ValidationError:a,opts:l}=e;r.$async?t.if((0,u._)`${d.default.errors} === 0`,()=>t.return(d.default.data),()=>t.throw((0,u._)`new ${a}(${d.default.vErrors})`)):(t.assign((0,u._)`${n}.errors`,d.default.vErrors),l.unevaluated&&function({gen:e,evaluated:t,props:r,items:n}){r instanceof u.Name&&e.assign((0,u._)`${t}.props`,r),n instanceof u.Name&&e.assign((0,u._)`${t}.items`,n)}(e),t.return((0,u._)`${d.default.errors} === 0`))}(e)})}(e):m(e,()=>(0,n.topBoolOrEmptySchema)(e))};class _{constructor(e,t,r){if((0,s.validateKeywordUsage)(e,t,r),this.gen=e.gen,this.allErrors=e.allErrors,this.keyword=r,this.data=e.data,this.schema=e.schema[r],this.$data=t.$data&&e.opts.$data&&this.schema&&this.schema.$data,this.schemaValue=(0,p.schemaRefOrVal)(e,this.schema,r,this.$data),this.schemaType=t.schemaType,this.parentSchema=e.schema,this.params={},this.it=e,this.def=t,this.$data)this.schemaCode=e.gen.const("vSchema",P(this.$data,e));else if(this.schemaCode=this.schemaValue,!(0,s.validSchemaType)(this.schema,t.schemaType,t.allowUndefined))throw Error(`${r} value must be ${JSON.stringify(t.schemaType)}`);("code"in t?t.trackErrors:!1!==t.errors)&&(this.errsCount=e.gen.const("_errs",d.default.errors))}result(e,t,r){this.failResult((0,u.not)(e),t,r)}
4failResult(e,t,r){this.gen.if(e),r?r():this.error(),t?(this.gen.else(),t(),this.allErrors&&this.gen.endIf()):this.allErrors?this.gen.endIf():this.gen.else()}pass(e,t){this.failResult((0,u.not)(e),void 0,t)}fail(e){if(void 0===e){this.error(),this.allErrors||this.gen.if(!1);return}this.gen.if(e),this.error(),this.allErrors?this.gen.endIf():this.gen.else()}fail$data(e){if(!this.$data)return this.fail(e);let{schemaCode:t}=this;this.fail((0,u._)`${t} !== undefined && (${(0,u.or)(this.invalid$data(),e)})`)}error(e,t,r){if(t){this.setParams(t),this._error(e,r),this.setParams({});return}this._error(e,r)}_error(e,t){(e?h.reportExtraError:h.reportError)(this,this.def.error,t)}$dataError(){(0,h.reportError)(this,this.def.$dataError||h.keyword$DataError)}reset(){if(void 0===this.errsCount)throw Error('add "trackErrors" to keyword definition');(0,h.resetErrorsCount)(this.gen,this.errsCount)}ok(e){this.allErrors||this.gen.if(e)}setParams(e,t){t?Object.assign(this.params,e):this.params=e}block$data(e,t,r=u.nil){this.gen.block(()=>{this.check$data(e,r),t()})}check$data(e=u.nil,t=u.nil){if(!this.$data)return;let{gen:r,schemaCode:n,schemaType:a,def:l}=this;r.if((0,u.or)((0,u._)`${n} === undefined`,t)),e!==u.nil&&r.assign(e,!0),(a.length||l.validateSchema)&&(r.elseIf(this.invalid$data()),this.$dataError(),e!==u.nil&&r.assign(e,!1)),r.else()}invalid$data(){let{gen:e,schemaCode:t,schemaType:r,def:n,it:a}=this;return(0,u.or)(function(){if(r.length){if(!(t instanceof u.Name))throw Error("ajv implementation error");let e=Array.isArray(r)?r:[r];return(0,u._)`${(0,i.checkDataTypes)(e,t,a.opts.strictNumbers,i.DataType.Wrong)}`}return u.nil}(),function(){if(n.validateSchema){let r=e.scopeValue("validate$data",{ref:n.validateSchema});return(0,u._)`!${r}(${t})`}return u.nil}())}subschema(e,t){let r=(0,c.getSubschema)(this.it,e);(0,c.extendSubschemaData)(r,this.it,e),(0,c.extendSubschemaMode)(r,e);let a={...this.it,...r,items:void 0,props:void 0};return!function(e,t){if(v(e)&&(y(e),b(e)))return function(e,t){var r;let n,{schema:a,gen:l,opts:i}=e;i.$comment&&a.$comment&&w(e),(n=(r=e).schema[r.opts.schemaId])&&(r.baseId=(0,f.resolveUrl)(r.opts.uriResolver,r.baseId,n)),function(e){if(e.schema.$async&&!e.schemaEnv.$async)throw Error("async schema in sync schema")}(e);let o=l.const("_errs",d.default.errors);x(e,o),l.var(t,(0,u._)`${o} === ${d.default.errors}`)}(e,t);(0,n.boolOrEmptySchema)(e,t)}(a,t),a}mergeEvaluated(e,t){let{it:r,gen:n}=this;r.opts.unevaluated&&(!0!==r.props&&void 0!==e.props&&(r.props=p.mergeEvaluated.props(n,e.props,r.props,t)),!0!==r.items&&void 0!==e.items&&(r.items=p.mergeEvaluated.items(n,e.items,r.items,t)))}mergeValidEvaluated(e,t){let{it:r,gen:n}=this;if(r.opts.unevaluated&&(!0!==r.props||!0!==r.items))return n.if(t,()=>this.mergeEvaluated(e,u.Name)),!0}}function k(e,t,r,n){let a=new _(e,r,t);"code"in r?r.code(a,n):a.$data&&r.validate?(0,s.funcKeywordCode)(a,r):"macro"in r?(0,s.macroKeywordCode)(a,r):(r.compile||r.validate)&&(0,s.funcKeywordCode)(a,r)}r.KeywordCxt=_;let E=/^\/(?:[^~]|~0|~1)*$/,N=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function P(e,{dataLevel:t,dataNames:r,dataPathArr:n}){let a,l;if(""===e)return d.default.rootData;if("/"===e[0]){if(!E.test(e))throw Error(`Invalid JSON-pointer: ${e}`);a=e,l=d.default.rootData}else{let i=N.exec(e);if(!i)throw Error(`Invalid JSON-pointer: ${e}`);let s=+i[1];if("#"===(a=i[2])){if(s>=t)throw Error(o("property/index",s));return n[t-s]}if(s>t)throw Error(o("data",s));if(l=r[t-s],!a)return l}let i=l;for(let e of a.split("/"))e&&(l=(0,u._)`${l}${(0,u.getProperty)((0,p.unescapeJsonPointer)(e))}`,i=(0,u._)`${i} && ${l}`);return i;function o(e,r){return`Cannot access ${e} ${r} levels up, current level is ${t}`}}r.getData=P},227230,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=class extends Error{constructor(e){super("validation failed"),this.errors=e,this.ajv=this.validation=!0}}},743002,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});let n=e.r(336370);r.default=class extends Error{constructor(e,t,r,a){super(a||`can't resolve reference ${r} from id ${t}`),this.missingRef=(0,n.resolveUrl)(e,t,r),this.missingSchema=(0,n.normalizeId)((0,n.getFullPath)(e,this.missingRef))}}},893066,(e,t,r)=>{"use strict";
4Object.defineProperty(r,"__esModule",{value:!0}),r.resolveSchema=r.getCompilingSchema=r.resolveRef=r.compileSchema=r.SchemaEnv=void 0;let n=e.r(100145),a=e.r(227230),l=e.r(864130),i=e.r(336370),o=e.r(803026),s=e.r(341770);class c{constructor(e){var t;let r;this.refs={},this.dynamicAnchors={},"object"==typeof e.schema&&(r=e.schema),this.schema=e.schema,this.schemaId=e.schemaId,this.root=e.root||this,this.baseId=null!=(t=e.baseId)?t:(0,i.normalizeId)(null==r?void 0:r[e.schemaId||"$id"]),this.schemaPath=e.schemaPath,this.localRefs=e.localRefs,this.meta=e.meta,this.$async=null==r?void 0:r.$async,this.refs={}}}function u(e){let t,r,o=f.call(this,e);if(o)return o;let c=(0,i.getFullPath)(this.opts.uriResolver,e.root.baseId),{es5:u,lines:d}=this.opts.code,{ownProperties:p}=this.opts,h=new n.CodeGen(this.scope,{es5:u,lines:d,ownProperties:p});e.$async&&(t=h.scopeValue("Error",{ref:a.default,code:(0,n._)`require("ajv/dist/runtime/validation_error").default`}));let m=h.scopeName("validate");e.validateName=m;let g={gen:h,allErrors:this.opts.allErrors,data:l.default.data,parentData:l.default.parentData,parentDataProperty:l.default.parentDataProperty,dataNames:[l.default.data],dataPathArr:[n.nil],dataLevel:0,dataTypes:[],definedProperties:new Set,topSchemaRef:h.scopeValue("schema",!0===this.opts.code.source?{ref:e.schema,code:(0,n.stringify)(e.schema)}:{ref:e.schema}),validateName:m,ValidationError:t,schema:e.schema,schemaEnv:e,rootId:c,baseId:e.baseId||c,schemaPath:n.nil,errSchemaPath:e.schemaPath||(this.opts.jtd?"":"#"),errorPath:(0,n._)`""`,opts:this.opts,self:this};try{this._compilations.add(e),(0,s.validateFunctionCode)(g),h.optimize(this.opts.code.optimize);let t=h.toString();r=`${h.scopeRefs(l.default.scope)}return ${t}`,this.opts.code.process&&(r=this.opts.code.process(r,e));let a=Function(`${l.default.self}`,`${l.default.scope}`,r)(this,this.scope.get());if(this.scope.value(m,{ref:a}),a.errors=null,a.schema=e.schema,a.schemaEnv=e,e.$async&&(a.$async=!0),!0===this.opts.code.source&&(a.source={validateName:m,validateCode:t,scopeValues:h._values}),this.opts.unevaluated){let{props:e,items:t}=g;a.evaluated={props:e instanceof n.Name?void 0:e,items:t instanceof n.Name?void 0:t,dynamicProps:e instanceof n.Name,dynamicItems:t instanceof n.Name},a.source&&(a.source.evaluated=(0,n.stringify)(a.evaluated))}return e.validate=a,e}catch(t){throw delete e.validate,delete e.validateName,r&&this.logger.error("Error compiling schema, function code:",r),t}finally{this._compilations.delete(e)}}function d(e){return(0,i.inlineRef)(e.schema,this.opts.inlineRefs)?e.schema:e.validate?e:u.call(this,e)}function f(e){for(let n of this._compilations){var t,r;if(t=n,r=e,t.schema===r.schema&&t.root===r.root&&t.baseId===r.baseId)return n}}function p(e,t){let r;for(;"string"==typeof(r=this.refs[t]);)t=r;return r||this.schemas[t]||h.call(this,e,t)}function h(e,t){let r=this.opts.uriResolver.parse(t),n=(0,i._getFullPath)(this.opts.uriResolver,r),a=(0,i.getFullPath)(this.opts.uriResolver,e.baseId,void 0);if(Object.keys(e.schema).length>0&&n===a)return g.call(this,r,e);let l=(0,i.normalizeId)(n),o=this.refs[l]||this.schemas[l];if("string"==typeof o){let t=h.call(this,e,o);if("object"!=typeof(null==t?void 0:t.schema))return;return g.call(this,r,t)}if("object"==typeof(null==o?void 0:o.schema)){if(o.validate||u.call(this,o),l===(0,i.normalizeId)(t)){let{schema:t}=o,{schemaId:r}=this.opts,n=t[r];return n&&(a=(0,i.resolveUrl)(this.opts.uriResolver,a,n)),new c({schema:t,schemaId:r,root:e,baseId:a})}return g.call(this,r,o)}}r.SchemaEnv=c,r.compileSchema=u,r.resolveRef=function(e,t,r){var n;r=(0,i.resolveUrl)(this.opts.uriResolver,t,r);let a=e.refs[r];if(a)return a;let l=p.call(this,e,r);if(void 0===l){let a=null==(n=e.localRefs)?void 0:n[r],{schemaId:i}=this.opts;a&&(l=new c({schema:a,schemaId:i,root:e,baseId:t}))}if(void 0!==l)return e.refs[r]=d.call(this,l)},r.getCompilingSchema=f,r.resolveSchema=h;let m=new Set(["properties","patternProperties","enum","dependencies","definitions"]);function g(e,{baseId:t,schema:r,root:n}){var a;let l;if((null==(a=e.fragment)?void 0:a[0])!=="/")return;for(let n of e.fragment.slice(1).split("/")){if("boolean"==typeof r)return;let e=r[(0,o.unescapeFragment)(n)];if(void 0===e)return;let a="object"==typeof(r=e)&&r[this.opts.schemaId];!m.has(n)&&a&&(t=(0,i.resolveUrl)(this.opts.uriResolver,t,a))}if("boolean"!=typeof r&&r.$ref&&!(0,o.schemaHasRulesButRef)(r,this.RULES)){let e=(0,i.resolveUrl)(this.opts.uriResolver,t,r.$ref);l=h.call(this,n,e)}let{schemaId:s}=this.opts;if((l=l||new c({schema:r,schemaId:s,root:n,baseId:t})).schema!==l.root.schema)return l}},215588,(e,t,r)=>{t.exports={$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON AnySchema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}},43518,(e,t,r)=>{"use strict";let n=RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu),a=RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);function l(e){let t="",r=0,n=0;for(n=0;n<e.length;
4n++)if(48!==(r=e[n].charCodeAt(0))){if(!(r>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[n];break}for(n+=1;n<e.length;n++){if(!((r=e[n].charCodeAt(0))>=48&&r<=57||r>=65&&r<=70||r>=97&&r<=102))return"";t+=e[n]}return t}function i(e){return e.length=0,!0}function o(e,t,r){if(e.length){let n=l(e);if(""===n)return r.error=!0,!1;t.push(n),e.length=0}return!0}function s(e){if(2>function(e){let t=0;for(let r=0;r<e.length;r++)":"===e[r]&&t++;return t}(e))return{host:e,isIPV6:!1};let t=function(e){let t=0,r={error:!1,address:"",zone:""},n=[],a=[],s=!1,c=!1,u=o;for(let l=0;l<e.length;l++){let o=e[l];if("["!==o&&"]"!==o)if(":"===o){if(!0===s&&(c=!0),!u(a,n,r))break;if(++t>7){r.error=!0;break}l>0&&":"===e[l-1]&&(s=!0),n.push(":");continue}else if("%"===o){if(!u(a,n,r))break;u=i}else{a.push(o);continue}}return a.length&&(u===i?r.zone=a.join(""):c?n.push(a.join("")):n.push(l(a))),r.address=n.join(""),r}(e);if(t.error)return{host:e,isIPV6:!1};{let e=t.address,r=t.address;return t.zone&&(e+="%"+t.zone,r+="%25"+t.zone),{host:e,isIPV6:!0,escapedHost:r}}}t.exports={nonSimpleDomain:RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u),recomposeAuthority:function(e){let t=[];if(void 0!==e.userinfo&&(t.push(e.userinfo),t.push("@")),void 0!==e.host){let r=unescape(e.host);if(!a(r)){let t=s(r);r=!0===t.isIPV6?`[${t.escapedHost}]`:e.host}t.push(r)}return("number"==typeof e.port||"string"==typeof e.port)&&(t.push(":"),t.push(String(e.port))),t.length?t.join(""):void 0},normalizeComponentEncoding:function(e,t){let r=!0!==t?escape:unescape;return void 0!==e.scheme&&(e.scheme=r(e.scheme)),void 0!==e.userinfo&&(e.userinfo=r(e.userinfo)),void 0!==e.host&&(e.host=r(e.host)),void 0!==e.path&&(e.path=r(e.path)),void 0!==e.query&&(e.query=r(e.query)),void 0!==e.fragment&&(e.fragment=r(e.fragment)),e},removeDotSegments:function(e){let t=e,r=[],n=-1,a=0;for(;a=t.length;){if(1===a)if("."===t)break;else if("/"===t){r.push("/");break}else{r.push(t);break}if(2===a){if("."===t[0]){if("."===t[1])break;else if("/"===t[1]){t=t.slice(2);continue}}else if("/"===t[0]&&("."===t[1]||"/"===t[1])){r.push("/");break}}else if(3===a&&"/.."===t){0!==r.length&&r.pop(),r.push("/");break}if("."===t[0]){if("."===t[1]){if("/"===t[2]){t=t.slice(3);continue}}else if("/"===t[1]){t=t.slice(2);continue}}else if("/"===t[0]&&"."===t[1]){if("/"===t[2]){t=t.slice(2);continue}else if("."===t[2]&&"/"===t[3]){t=t.slice(3),0!==r.length&&r.pop();continue}}if(-1===(n=t.indexOf("/",1))){r.push(t);break}r.push(t.slice(0,n)),t=t.slice(n)}return r.join("")},isIPv4:a,isUUID:n,normalizeIPv6:s,stringArrayToHexStripped:l}},67137,(e,t,r)=>{"use strict";let{isUUID:n}=e.r(43518),a=/([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu,l=["http","https","ws","wss","urn","urn:uuid"];function i(e){return!0===e.secure||!1!==e.secure&&!!e.scheme&&3===e.scheme.length&&("w"===e.scheme[0]||"W"===e.scheme[0])&&("s"===e.scheme[1]||"S"===e.scheme[1])&&("s"===e.scheme[2]||"S"===e.scheme[2])}function o(e){return e.host||(e.error=e.error||"HTTP URIs must have a host."),e}function s(e){let t="https"===String(e.scheme).toLowerCase();return(e.port===(t?443:80)||""===e.port)&&(e.port=void 0),e.path||(e.path="/"),e}let c={scheme:"http",domainHost:!0,parse:o,serialize:s},u={scheme:"https",domainHost:c.domainHost,parse:o,serialize:s},d={scheme:"ws",domainHost:!0,parse:function(e){return e.secure=i(e),e.resourceName=(e.path||"/")+(e.query?"?"+e.query:""),e.path=void 0,e.query=void 0,e},serialize:function(e){if((e.port===(i(e)?443:80)||""===e.port)&&(e.port=void 0),"boolean"==typeof e.secure&&(e.scheme=e.secure?"wss":"ws",e.secure=void 0),e.resourceName){let[t,r]=e.resourceName.split("?");e.path=t&&"/"!==t?t:void 0,e.query=r,e.resourceName=void 0}return e.fragment=void 0,e}},f={scheme:"wss",domainHost:d.domainHost,parse:d.parse,serialize:d.serialize},p={http:c,https:u,ws:d,wss:f,urn:{scheme:"urn",parse:function(e,t){if(!e.path)return e.error="URN can not be parsed",e;let r=e.path.match(a);if(r){let n=t.scheme||e.scheme||"urn";e.nid=r[1].toLowerCase(),e.nss=r[2];let a=h(`${n}:${t.nid||e.nid}`);e.path=void 0,a&&(e=a.parse(e,t))}else e.error=e.error||"URN can not be parsed.";return e},serialize:function(e,t){if(void 0===e.nid)throw Error("URN without nid cannot be serialized");let r=t.scheme||e.scheme||"urn",n=e.nid.toLowerCase(),a=h(`${r}:${t.nid||n}`);a&&(e=a.serialize(e,t));let l=e,i=e.nss;return l.path=`${n||t.nid}:${i}`,t.skipEscape=!0,l},skipNormalize:!0},"urn:uuid":{scheme:"urn:uuid",parse:function(e,t){return e.uuid=e.nss,e.nss=void 0,t.tolerant||e.uuid&&n(e.uuid)||(e.error=e.error||"UUID is not val
4id."),e},serialize:function(e){return e.nss=(e.uuid||"").toLowerCase(),e},skipNormalize:!0}};function h(e){return e&&(p[e]||p[e.toLowerCase()])||void 0}Object.setPrototypeOf(p,null),t.exports={wsIsSecure:i,SCHEMES:p,isValidSchemeName:function(e){return -1!==l.indexOf(e)},getSchemeHandler:h}},866749,(e,t,r)=>{"use strict";let{normalizeIPv6:n,removeDotSegments:a,recomposeAuthority:l,normalizeComponentEncoding:i,isIPv4:o,nonSimpleDomain:s}=e.r(43518),{SCHEMES:c,getSchemeHandler:u}=e.r(67137);function d(e,t,r,n){let l={};return n||(e=h(f(e,r),r),t=h(f(t,r),r)),!(r=r||{}).tolerant&&t.scheme?(l.scheme=t.scheme,l.userinfo=t.userinfo,l.host=t.host,l.port=t.port,l.path=a(t.path||""),l.query=t.query):(void 0!==t.userinfo||void 0!==t.host||void 0!==t.port?(l.userinfo=t.userinfo,l.host=t.host,l.port=t.port,l.path=a(t.path||""),l.query=t.query):(t.path?("/"===t.path[0]?l.path=a(t.path):(void 0===e.userinfo&&void 0===e.host&&void 0===e.port||e.path?e.path?l.path=e.path.slice(0,e.path.lastIndexOf("/")+1)+t.path:l.path=t.path:l.path="/"+t.path,l.path=a(l.path)),l.query=t.query):(l.path=e.path,void 0!==t.query?l.query=t.query:l.query=e.query),l.userinfo=e.userinfo,l.host=e.host,l.port=e.port),l.scheme=e.scheme),l.fragment=t.fragment,l}function f(e,t){let r={host:e.host,scheme:e.scheme,userinfo:e.userinfo,port:e.port,path:e.path,query:e.query,nid:e.nid,nss:e.nss,uuid:e.uuid,fragment:e.fragment,reference:e.reference,resourceName:e.resourceName,secure:e.secure,error:""},n=Object.assign({},t),i=[],o=u(n.scheme||r.scheme);o&&o.serialize&&o.serialize(r,n),void 0!==r.path&&(n.skipEscape?r.path=unescape(r.path):(r.path=escape(r.path),void 0!==r.scheme&&(r.path=r.path.split("%3A").join(":")))),"suffix"!==n.reference&&r.scheme&&i.push(r.scheme,":");let s=l(r);if(void 0!==s&&("suffix"!==n.reference&&i.push("//"),i.push(s),r.path&&"/"!==r.path[0]&&i.push("/")),void 0!==r.path){let e=r.path;n.absolutePath||o&&o.absolutePath||(e=a(e)),void 0===s&&"/"===e[0]&&"/"===e[1]&&(e="/%2F"+e.slice(2)),i.push(e)}return void 0!==r.query&&i.push("?",r.query),void 0!==r.fragment&&i.push("#",r.fragment),i.join("")}let p=/^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;function h(e,t){let r=Object.assign({},t),a={scheme:void 0,userinfo:void 0,host:"",port:void 0,path:"",query:void 0,fragment:void 0},l=!1;"suffix"===r.reference&&(e=r.scheme?r.scheme+":"+e:"//"+e);let i=e.match(p);if(i){if(a.scheme=i[1],a.userinfo=i[3],a.host=i[4],a.port=parseInt(i[5],10),a.path=i[6]||"",a.query=i[7],a.fragment=i[8],isNaN(a.port)&&(a.port=i[5]),a.host)if(!1===o(a.host)){let e=n(a.host);a.host=e.host.toLowerCase(),l=e.isIPV6}else l=!0;void 0!==a.scheme||void 0!==a.userinfo||void 0!==a.host||void 0!==a.port||void 0!==a.query||a.path?void 0===a.scheme?a.reference="relative":void 0===a.fragment?a.reference="absolute":a.reference="uri":a.reference="same-document",r.reference&&"suffix"!==r.reference&&r.reference!==a.reference&&(a.error=a.error||"URI is not a "+r.reference+" reference.");let t=u(r.scheme||a.scheme);if(!r.unicodeSupport&&(!t||!t.unicodeSupport)&&a.host&&(r.domainHost||t&&t.domainHost)&&!1===l&&s(a.host))try{a.host=URL.domainToASCII(a.host.toLowerCase())}catch(e){a.error=a.error||"Host's domain name can not be converted to ASCII: "+e}(!t||t&&!t.skipNormalize)&&(-1!==e.indexOf("%")&&(void 0!==a.scheme&&(a.scheme=unescape(a.scheme)),void 0!==a.host&&(a.host=unescape(a.host))),a.path&&(a.path=escape(unescape(a.path))),a.fragment&&(a.fragment=encodeURI(decodeURIComponent(a.fragment)))),t&&t.parse&&t.parse(a,r)}else a.error=a.error||"URI can not be parsed.";return a}let m={SCHEMES:c,normalize:function(e,t){return"string"==typeof e?e=f(h(e,t),t):"object"==typeof e&&(e=h(f(e,t),t)),e},resolve:function(e,t,r){let n=r?Object.assign({scheme:"null"},r):{scheme:"null"},a=d(h(e,n),h(t,n),n,!0);return n.skipEscape=!0,f(a,n)},resolveComponent:d,equal:function(e,t,r){return"string"==typeof e?e=f(i(h(e=unescape(e),r),!0),{...r,skipEscape:!0}):"object"==typeof e&&(e=f(i(e,!0),{...r,skipEscape:!0}
4)),"string"==typeof t?t=f(i(h(t=unescape(t),r),!0),{...r,skipEscape:!0}):"object"==typeof t&&(t=f(i(t,!0),{...r,skipEscape:!0})),e.toLowerCase()===t.toLowerCase()},serialize:f,parse:h};t.exports=m,t.exports.default=m,t.exports.fastUri=m},220536,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});let n=e.r(866749);n.code='require("ajv/dist/runtime/uri").default',r.default=n},226924,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.CodeGen=r.Name=r.nil=r.stringify=r.str=r._=r.KeywordCxt=void 0;var n=e.r(341770);Object.defineProperty(r,"KeywordCxt",{enumerable:!0,get:function(){return n.KeywordCxt}});var a=e.r(100145);Object.defineProperty(r,"_",{enumerable:!0,get:function(){return a._}}),Object.defineProperty(r,"str",{enumerable:!0,get:function(){return a.str}}),Object.defineProperty(r,"stringify",{enumerable:!0,get:function(){return a.stringify}}),Object.defineProperty(r,"nil",{enumerable:!0,get:function(){return a.nil}}),Object.defineProperty(r,"Name",{enumerable:!0,get:function(){return a.Name}}),Object.defineProperty(r,"CodeGen",{enumerable:!0,get:function(){return a.CodeGen}});let l=e.r(227230),i=e.r(743002),o=e.r(388660),s=e.r(893066),c=e.r(100145),u=e.r(336370),d=e.r(795401),f=e.r(803026),p=e.r(215588),h=e.r(220536),m=(e,t)=>new RegExp(e,t);m.code="new RegExp";let g=["removeAdditional","useDefaults","coerceTypes"],b=new Set(["validate","serialize","parse","wrapper","root","schema","keyword","pattern","formats","validate$data","func","obj","Error"]),v={errorDataPath:"",format:"`validateFormats: false` can be used instead.",nullable:'"nullable" keyword is supported by default.',jsonPointers:"Deprecated jsPropertySyntax can be used instead.",extendRefs:"Deprecated 
4ignoreKeywordsWithRef can be used instead.",missingRefs:"Pass empty schema with $id that should be ignored to ajv.addSchema.",processCode:"Use option `code: {process: (code, schemaEnv: object) => string}`",sourceCode:"Use option `code: {source: true}`",strictDefaults:"It is default now, see option `strict`.",strictKeywords:"It is default now, see option `strict`.",uniqueItems:'"uniqueItems" keyword is always validated.',unknownFormats:"Disable strict mode or pass `true` to `ajv.addFormat` (or `formats` option).",cache:"Map is used as cache, schema object as key.",serialize:"Map is used as cache, schema object as key.",ajvErrors:"It is default now."},y={ignoreKeywordsWithRef:"",jsPropertySyntax:"",unicode:'"minLength"/"maxLength" account for unicode characters by default.'};class x{constructor(e={}){this.schemas={},this.refs={},this.formats={},this._compilations=new Set,this._loading={},this._cache=new Map,e=this.opts={...e,...function(e){var t,r,n,a,l,i,o,s,c,u,d,f,p,g,b,v,y,x,w,C,j,S,$,_,k;let E=e.strict,N=null==(t=e.code)?void 0:t.optimize,P=!0===N||void 0===N?1:N||0,T=null!=(n=null==(r=e.code)?void 0:r.regExp)?n:m,D=null!=(a=e.uriResolver)?a:h.default;return{strictSchema:null==(i=null!=(l=e.strictSchema)?l:E)||i,strictNumbers:null==(s=null!=(o=e.strictNumbers)?o:E)||s,strictTypes:null!=(u=null!=(c=e.strictTypes)?c:E)?u:"log",strictTuples:null!=(f=null!=(d=e.strictTuples)?d:E)?f:"log",strictRequired:null!=(g=null!=(p=e.strictRequired)?p:E)&&g,code:e.code?{...e.code,optimize:P,regExp:T}:{optimize:P,regExp:T},loopRequired:null!=(b=e.loopRequired)?b:200,loopEnum:null!=(v=e.loopEnum)?v:200,meta:null==(y=e.meta)||y,messages:null==(x=e.messages)||x,inlineRefs:null==(w=e.inlineRefs)||w,schemaId:null!=(C=e.schemaId)?C:"$id",addUsedSchema:null==(j=e.addUsedSchema)||j,validateSchema:null==(S=e.validateSchema)||S,validateFormats:null==($=e.validateFormats)||$,unicodeRegExp:null==(_=e.unicodeRegExp)||_,int32range:null==(k=e.int32range)||k,uriResolver:D}}(e)};const{es5:t,lines:r}=this.opts.code;this.scope=new c.ValueScope({scope:{},prefixes:b,es5:t,lines:r}),this.logger=function(e){if(!1===e)return k;if(void 0===e)return console;if(e.log&&e.warn&&e.error)return e;throw Error("logger must implement log, warn and error methods")}(e.logger);const n=e.validateFormats;e.validateFormats=!1,this.RULES=(0,o.getRules)(),w.call(this,v,e,"NOT SUPPORTED"),w.call(this,y,e,"DEPRECATED","warn"),this._metaOpts=_.call(this),e.formats&&S.call(this),this._addVocabularies(),this._addDefaultMetaSchema(),e.keywords&&$.call(this,e.keywords),"object"==typeof e.meta&&this.addMetaSchema(e.meta),j.call(this),e.validateFormats=n}_addVocabularies(){this.addKeyword("$async")}_addDefaultMetaSchema(){let{$data:e,meta:t,schemaId:r}=this.opts,n=p;"id"===r&&((n={...p}).id=n.$id,delete n.$id),t&&e&&this.addMetaSchema(n,n[r],!1)}defaultMeta(){let{meta:e,schemaId:t}=this.opts;return this.opts.defaultMeta="object"==typeof e?e[t]||e:void 0}validate(e,t){let r;if("string"==typeof e){if(!(r=this.getSchema(e)))throw Error(`no schema with key or ref "${e}"`)}else r=this.compile(e);let n=r(t);return"$async"in r||(this.errors=r.errors),n}compile(e,t){let r=this._addSchema(e,t);return r.validate||this._compileSchemaEnv(r)}compileAsync(e,t){if("function"!=typeof this.opts.loadSchema)throw Error("options.loadSchema should be a function");let{loadSchema:r}=this.opts;return n.call(this,e,t);async function n(e,t){await a.call(this,e.$schema);let r=this._addSchema(e,t);return r.validate||l.call(this,r)}async function a(e){e&&!this.getSchema(e)&&await n.call(this,{$ref:e},!0)}async function l(e){try{return this._compileSchemaEnv(e)}catch(t){if(!(t instanceof i.default))throw t;return o.call(this,t),await s.call(this,t.missingSchema),l.call(this,e)}}function o({missingSchema:e,missingRef:t}){if(this.refs[e])throw Error(`AnySchema ${e} is loaded but ${t} cannot be resolved`)}async function s(e){let r=await c.call(this,e);this.refs[e]||await a.call(this,r.$schema),this.refs[e]||this.addSchema(r,e,t)}async function c(e){let t=this._loading[e];if(t)return t;try{return await (this._loading[e]=r(e))}finally{delete this._loading[e]}}}addSchema(e,t,r,n=this.opts.validateSchema){let a;
4if(Array.isArray(e)){for(let t of e)this.addSchema(t,void 0,r,n);return this}if("object"==typeof e){let{schemaId:t}=this.opts;if(void 0!==(a=e[t])&&"string"!=typeof a)throw Error(`schema ${t} must be string`)}return t=(0,u.normalizeId)(t||a),this._checkUnique(t),this.schemas[t]=this._addSchema(e,r,t,n,!0),this}addMetaSchema(e,t,r=this.opts.validateSchema){return this.addSchema(e,t,!0,r),this}validateSchema(e,t){let r;if("boolean"==typeof e)return!0;if(void 0!==(r=e.$schema)&&"string"!=typeof r)throw Error("$schema must be a string");if(!(r=r||this.opts.defaultMeta||this.defaultMeta()))return this.logger.warn("meta-schema not available"),this.errors=null,!0;let n=this.validate(r,e);if(!n&&t){let e="schema is invalid: "+this.errorsText();if("log"===this.opts.validateSchema)this.logger.error(e);else throw Error(e)}return n}getSchema(e){let t;for(;"string"==typeof(t=C.call(this,e));)e=t;if(void 0===t){let{schemaId:r}=this.opts,n=new s.SchemaEnv({schema:{},schemaId:r});if(!(t=s.resolveSchema.call(this,n,e)))return;this.refs[e]=t}return t.validate||this._compileSchemaEnv(t)}removeSchema(e){if(e instanceof RegExp)return this._removeAllSchemas(this.schemas,e),this._removeAllSchemas(this.refs,e),this;switch(typeof e){case"undefined":return this._removeAllSchemas(this.schemas),this._removeAllSchemas(this.refs),this._cache.clear(),this;case"string":{let t=C.call(this,e);return"object"==typeof t&&this._cache.delete(t.schema),delete this.schemas[e],delete this.refs[e],this}case"object":{this._cache.delete(e);let t=e[this.opts.schemaId];return t&&(t=(0,u.normalizeId)(t),delete this.schemas[t],delete this.refs[t]),this}default:throw Error("ajv.removeSchema: invalid parameter")}}addVocabulary(e){for(let t of e)this.addKeyword(t);return this}addKeyword(e,t){let r;if("string"==typeof e)r=e,"object"==typeof t&&(this.logger.warn("these parameters are deprecated, see docs for addKeyword"),t.keyword=r);else if("object"==typeof e&&void 0===t){if(Array.isArray(r=(t=e).keyword)&&!r.length)throw Error("addKeywords: keyword must be string or non-empty array")}else throw Error("invalid addKeywords parameters");if(N.call(this,r,t),!t)return(0,f.eachItem)(r,e=>P.call(this,e)),this;D.call(this,t);let n={...t,type:(0,d.getJSONTypes)(t.type),schemaType:(0,d.getJSONTypes)(t.schemaType)};return(0,f.eachItem)(r,0===n.type.length?e=>P.call(this,e,n):e=>n.type.forEach(t=>P.call(this,e,n,t))),this}getKeyword(e){let t=this.RULES.all[e];return"object"==typeof t?t.definition:!!t}removeKeyword(e){let{RULES:t}=this;for(let r of(delete t.keywords[e],delete t.all[e],t.rules)){let t=r.rules.findIndex(t=>t.keyword===e);t>=0&&r.rules.splice(t,1)}return this}addFormat(e,t){return"string"==typeof t&&(t=new RegExp(t)),this.formats[e]=t,this}errorsText(e=this.errors,{separator:t=", ",dataVar:r="data"}={}){return e&&0!==e.length?e.map(e=>`${r}${e.instancePath} ${e.message}`).reduce((e,r)=>e+t+r):"No errors"}$dataMetaSchema(e,t){let r=this.RULES.all;for(let n of(e=JSON.parse(JSON.stringify(e)),t)){let t=n.split("/").slice(1),a=e;for(let e of t)a=a[e];for(let e in r){let t=r[e];if("object"!=typeof t)continue;let{$data:n}=t.definition,l=a[e];n&&l&&(a[e]=A(l))}}return e}_removeAllSchemas(e,t){for(let r in e){let n=e[r];(!t||t.test(r))&&("string"==typeof n?delete e[r]:n&&!n.meta&&(this._cache.delete(n.schema),delete e[r]))}}_addSchema(e,t,r,n=this.opts.validateSchema,a=this.opts.addUsedSchema){let l,{schemaId:i}=this.opts;if("object"==typeof e)l=e[i];else if(this.opts.jtd)throw Error("schema must be object");else if("boolean"!=typeof e)throw Error("schema must be object or boolean");let o=this._cache.get(e);if(void 0!==o)return o;r=(0,u.normalizeId)(l||r);let c=u.getSchemaRefs.call(this,e,r);return o=new s.SchemaEnv({schema:e,schemaId:i,meta:t,baseId:r,localRefs:c}),this._cache.set(o.schema,o),a&&!r.startsWith("#")&&(r&&this._checkUnique(r),this.refs[r]=o),n&&this.validateSchema(e,!0),o}_checkUnique(e){if(this.schemas[e]||this.refs[e])throw Error(`schema with key or id "${e}" already exists`)}_compileSchemaEnv(e){if(e.meta?this._compileMetaSchema(e):s.compileSchema.call(this,e),!e.validate)throw Error("ajv implementation error");return e.validate}_compileMetaSchema(e){let t=this.opts;this.opts=this._metaOpts;try{s.compileSchema.call(this,e)}finally{this.opts=t}}}function w(e,t,r,n="error"){for(let a in e)a in t&&this.logger[n](`${r}: option ${a}. ${e[a]}`)}function C(e){return e=(0,u.normalizeId)(e),this.schemas[e]||this.refs[e]}function j(){let e=this.opts.schemas;if(e)if(Array.isArray(e))this.addSchema(e);else for(let t in e)this.addSchema(e[t],t)}function S(){for(let e in this.opts.formats){let t=this.opts.formats[e];t&&this.addFormat(e,t)}}function $(e){if(Array.isArray(e))return void this.addVocabulary(e);for(let t in this.logger.warn("keywords option as map is deprecated, pass array"),e){let r=e[t];r.keyword||(r.keyword=t),this.addKeyword(r)}}function _(){let e={...this.opts};for(let t of g)delete e[t];return e}x.ValidationError=l.default,x.MissingRefError=i.default,r.default=x;let k={log(){},warn(){},error(){}},E=/^[a-z_$][a-z0-9_$:-]*$/i;function N(e,t){let{RULES:r}=this;if((0,f.eachItem)(e,e=>{if(r.keywords[e])throw Error(`Keyword ${e} is already defined`);if(!E.test(e))throw Error(`Keyword ${e}
4 has invalid name`)}),t&&t.$data&&!("code"in t||"validate"in t))throw Error('$data keyword must have "code" or "validate" function')}function P(e,t,r){var n;let a=null==t?void 0:t.post;if(r&&a)throw Error('keyword with "post" flag cannot have "type"');let{RULES:l}=this,i=a?l.post:l.rules.find(({type:e})=>e===r);if(i||(i={type:r,rules:[]},l.rules.push(i)),l.keywords[e]=!0,!t)return;let o={keyword:e,definition:{...t,type:(0,d.getJSONTypes)(t.type),schemaType:(0,d.getJSONTypes)(t.schemaType)}};t.before?T.call(this,i,o,t.before):i.rules.push(o),l.all[e]=o,null==(n=t.implements)||n.forEach(e=>this.addKeyword(e))}function T(e,t,r){let n=e.rules.findIndex(e=>e.keyword===r);n>=0?e.rules.splice(n,0,t):(e.rules.push(t),this.logger.warn(`rule ${r} is not defined`))}function D(e){let{metaSchema:t}=e;void 0!==t&&(e.$data&&this.opts.$data&&(t=A(t)),e.validateSchema=this.compile(t,!0))}let R={$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"};function A(e){return{anyOf:[e,R]}}},274028,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default={keyword:"id",code(){throw Error('NOT SUPPORTED: keyword "id", use "$id" for schema ID')}}},807857,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.callRef=r.getValidate=void 0;let n=e.r(743002),a=e.r(966992),l=e.r(100145),i=e.r(864130),o=e.r(893066),s=e.r(803026);function c(e,t){let{gen:r}=e;return t.validate?r.scopeValue("validate",{ref:t.validate}):(0,l._)`${r.scopeValue("wrapper",{ref:t})}.validate`}function u(e,t,r,n){let{gen:o,it:c}=e,{allErrors:u,schemaEnv:d,opts:f}=c,p=f.passContext?i.default.this:l.nil;function h(e){let t=(0,l._)`${e}.errors`;o.assign(i.default.vErrors,(0,l._)`${i.default.vErrors} === null ? ${t} : ${i.default.vErrors}.concat(${t})`),o.assign(i.default.errors,(0,l._)`${i.default.vErrors}.length`)}function m(e){var t;if(!c.opts.unevaluated)return;let n=null==(t=null==r?void 0:r.validate)?void 0:t.evaluated;if(!0!==c.props)if(n&&!n.dynamicProps)void 0!==n.props&&(c.props=s.mergeEvaluated.props(o,n.props,c.props));else{let t=o.var("props",(0,l._)`${e}.evaluated.props`);c.props=s.mergeEvaluated.props(o,t,c.props,l.Name)}if(!0!==c.items)if(n&&!n.dynamicItems)void 0!==n.items&&(c.items=s.mergeEvaluated.items(o,n.items,c.items));else{let t=o.var("items",(0,l._)`${e}.evaluated.items`);c.items=s.mergeEvaluated.items(o,t,c.items,l.Name)}}n?function(){if(!d.$async)throw Error("async schema referenced by sync schema");let r=o.let("valid");o.try(()=>{o.code((0,l._)`await ${(0,a.callValidateCode)(e,t,p)}`),m(t),u||o.assign(r,!0)},e=>{o.if((0,l._)`!(${e} instanceof ${c.ValidationError})`,()=>o.throw(e)),h(e),u||o.assign(r,!1)}),e.ok(r)}():e.result((0,a.callValidateCode)(e,t,p),()=>m(t),()=>h(t))}r.getValidate=c,r.callRef=u,r.default={keyword:"$ref",schemaType:"string",code(e){var t,r;let a,i,s,d,{gen:f,schema:p,it:h}=e,{baseId:m,schemaEnv:g,validateName:b,opts:v,self:y}=h,{root:x}=g;if(("#"===p||"#/"===p)&&m===x.baseId){if(g===x)return u(e,b,g,g.$async);let t=f.scopeValue("root",{ref:x});return u(e,(0,l._)`${t}.validate`,x,x.$async)}let w=o.resolveRef.call(y,x,m,p);if(void 0===w)throw new n.default(h.opts.uriResolver,m,p);return w instanceof o.SchemaEnv?(a=c(e,t=w),void u(e,a,t,t.$async)):(r=w,i=f.scopeValue("schema",!0===v.code.source?{ref:r,code:(0,l.stringify)(r)}:{ref:r}),s=f.name("valid"),d=e.subschema({schema:r,dataTypes:[],schemaPath:l.nil,topSchemaRef:i,errSchemaPath:p},s),void(e.mergeEvaluated(d),e.ok(s)))}}},28453,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});let n=e.r(274028),a=e.r(807857);r.default=["$schema","$id","$defs","$vocabulary",{keyword:"$comment"},"definitions",n.default,a.default]},100213,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});let n=e.r(100145),a=n.operators,l={maximum:{okStr:"<=",ok:a.LTE,fail:a.GT},minimum:{okStr:">=",ok:a.GTE,fail:a.LT},exclusiveMaximum:{okStr:"<",ok:a.LT,fail:a.GTE},exclusiveMinimum:{okStr:">",ok:a.GT,fail:a.LTE}};r.default={keyword:Object.keys(l),type:"number",schemaType:"number",$data:!0,error:{message:({keyword:e,schemaCode:t})=>(0,n.str)`must be ${l[e].okStr} ${t}`,params:({keyword:e,schemaCode:t})=>(0,n._)`{comparison: ${l[e].okStr}, limit: ${t}}`},code(e){let{keyword:t,data:r,schemaCode:a}=e;e.fail$data((0,n._)`${r} ${l[t].fail} ${a} || isNaN(${r})`)}}},797966,(e,t,r)=>{"use strict";
4Object.defineProperty(r,"__esModule",{value:!0});let n=e.r(100145);r.default={keyword:"multipleOf",type:"number",schemaType:"number",$data:!0,error:{message:({schemaCode:e})=>(0,n.str)`must be multiple of ${e}`,params:({schemaCode:e})=>(0,n._)`{multipleOf: ${e}}`},code(e){let{gen:t,data:r,schemaCode:a,it:l}=e,i=l.opts.multipleOfPrecision,o=t.let("res"),s=i?(0,n._)`Math.abs(Math.round(${o}) - ${o}) > 1e-${i}`:(0,n._)`${o} !== parseInt(${o})`;e.fail$data((0,n._)`(${a} === 0 || (${o} = ${r}/${a}, ${s}))`)}}},446772,(e,t,r)=>{"use strict";function n(e){let t,r=e.length,n=0,a=0;for(;a<r;)n++,(t=e.charCodeAt(a++))>=55296&&t<=56319&&a<r&&(64512&(t=e.charCodeAt(a)))==56320&&a++;return n}Object.defineProperty(r,"__esModule",{value:!0}),r.default=n,n.code='require("ajv/dist/runtime/ucs2length").default'},631717,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});let n=e.r(100145),a=e.r(803026),l=e.r(446772);r.default={keyword:["maxLength","minLength"],type:"string",schemaType:"number",$data:!0,error:{message:({keyword:e,schemaCode:t})=>(0,n.str)`must NOT have ${"maxLength"===e?"more":"fewer"} than ${t} characters`,params:({schemaCode:e})=>(0,n._)`{limit: ${e}}`},code(e){let{keyword:t,data:r,schemaCode:i,it:o}=e,s="maxLength"===t?n.operators.GT:n.operators.LT,c=!1===o.opts.unicode?(0,n._)`${r}.length`:(0,n._)`${(0,a.useFunc)(e.gen,l.default)}(${r})`;e.fail$data((0,n._)`${c} ${s} ${i}`)}}},997782,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});let n=e.r(966992),a=e.r(100145);r.default={keyword:"pattern",type:"string",schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>(0,a.str)`must match pattern "${e}"`,params:({schemaCode:e})=>(0,a._)`{pattern: ${e}}`},code(e){let{data:t,$data:r,schema:l,schemaCode:i,it:o}=e,s=o.opts.unicodeRegExp?"u":"",c=r?(0,a._)`(new RegExp(${i}, ${s}))`:(0,n.usePattern)(e,l);e.fail$data((0,a._)`!${c}.test(${t})`)}}},385395,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});let n=e.r(100145);r.default={keyword:["maxProperties","minProperties"],type:"object",schemaType:"number",$data:!0,error:{message:({keyword:e,schemaCode:t})=>(0,n.str)`must NOT have ${"maxProperties"===e?"more":"fewer"} than ${t} properties`,params:({schemaCode:e})=>(0,n._)`{limit: ${e}}`},code(e){let{keyword:t,data:r,schemaCode:a}=e,l="maxProperties"===t?n.operators.GT:n.operators.LT;e.fail$data((0,n._)`Object.keys(${r}).length ${l} ${a}`)}}},572568,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});let n=e.r(966992),a=e.r(100145),l=e.r(803026);r.default={keyword:"required",type:"object",schemaType:"array",$data:!0,error:{message:({params:{missingProperty:e}})=>(0,a.str)`must have required property '${e}'`,params:({params:{missingProperty:e}})=>(0,a._)`{missingProperty: ${e}}`},code(e){let{gen:t,schema:r,schemaCode:i,data:o,$data:s,it:c}=e,{opts:u}=c;if(!s&&0===r.length)return;let d=r.length>=u.loopRequired;if(c.allErrors?function(){if(d||s)e.block$data(a.nil,f);else for(let t of r)(0,n.checkReportMissingProp)(e,t)}():function(){let l=t.let("missing");if(d||s){let r=t.let("valid",!0);e.block$data(r,()=>{var s,c;return s=l,c=r,void(e.setParams({missingProperty:s}),t.forOf(s,i,()=>{t.assign(c,(0,n.propertyInData)(t,o,s,u.ownProperties)),t.if((0,a.not)(c),()=>{e.error(),t.break()})},a.nil))}),e.ok(r)}else t.if((0,n.checkMissingProp)(e,r,l)),(0,n.reportMissingProp)(e,l),t.else()}(),u.strictRequired){let t=e.parentSchema.properties,{definedProperties:n}=e.it;for(let e of r)if((null==t?void 0:t[e])===void 0&&!n.has(e)){let t=c.schemaEnv.baseId+c.errSchemaPath,r=`required property "${e}" is not defined at "${t}" (strictRequired)`;(0,l.checkStrictMode)(c,r,c.opts.strictRequired)}}function f(){t.forOf("prop",i,r=>{e.setParams({missingProperty:r}),t.if((0,n.noPropertyInData)(t,o,r,u.ownProperties),()=>e.error())})}}}},581573,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});let n=e.r(100145);r.default={keyword:["maxItems","minItems"],type:"array",schemaType:"number",$data:!0,error:{message:({keyword:e,schemaCode:t})=>(0,n.str)`must NOT have ${"maxItems"===e?"more":"fewer"} than ${t} items`,params:({schemaCode:e})=>(0,n._)`{limit: ${e}}`}
4,code(e){let{keyword:t,data:r,schemaCode:a}=e,l="maxItems"===t?n.operators.GT:n.operators.LT;e.fail$data((0,n._)`${r}.length ${l} ${a}`)}}},991150,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});let n=e.r(65932);n.code='require("ajv/dist/runtime/equal").default',r.default=n},287120,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});let n=e.r(795401),a=e.r(100145),l=e.r(803026),i=e.r(991150);r.default={keyword:"uniqueItems",type:"array",schemaType:"boolean",$data:!0,error:{message:({params:{i:e,j:t}})=>(0,a.str)`must NOT have duplicate items (items ## ${t} and ${e} are identical)`,params:({params:{i:e,j:t}})=>(0,a._)`{i: ${e}, j: ${t}}`},code(e){let{gen:t,data:r,$data:o,schema:s,parentSchema:c,schemaCode:u,it:d}=e;if(!o&&!s)return;let f=t.let("valid"),p=c.items?(0,n.getSchemaTypes)(c.items):[];e.block$data(f,function(){let o=t.let("i",(0,a._)`${r}.length`),s=t.let("j");e.setParams({i:o,j:s}),t.assign(f,!0),t.if((0,a._)`${o} > 1`,()=>(p.length>0&&!p.some(e=>"object"===e||"array"===e)?function(l,i){let o=t.name("item"),s=(0,n.checkDataTypes)(p,o,d.opts.strictNumbers,n.DataType.Wrong),c=t.const("indices",(0,a._)`{}`);t.for((0,a._)`;${l}--;`,()=>{t.let(o,(0,a._)`${r}[${l}]`),t.if(s,(0,a._)`continue`),p.length>1&&t.if((0,a._)`typeof ${o} == "string"`,(0,a._)`${o} += "_"`),t.if((0,a._)`typeof ${c}[${o}] == "number"`,()=>{t.assign(i,(0,a._)`${c}[${o}]`),e.error(),t.assign(f,!1).break()}).code((0,a._)`${c}[${o}] = ${l}`)})}:function(n,o){let s=(0,l.useFunc)(t,i.default),c=t.name("outer");t.label(c).for((0,a._)`;${n}--;`,()=>t.for((0,a._)`${o} = ${n}; ${o}--;`,()=>t.if((0,a._)`${s}(${r}[${n}], ${r}[${o}])`,()=>{e.error(),t.assign(f,!1).break(c)})))})(o,s))},(0,a._)`${u} === false`),e.ok(f)}}},861707,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});let n=e.r(100145),a=e.r(803026),l=e.r(991150);r.default={keyword:"const",$data:!0,error:{message:"must be equal to constant",params:({schemaCode:e})=>(0,n._)`{allowedValue: ${e}}`},code(e){let{gen:t,data:r,$data:i,schemaCode:o,schema:s}=e;i||s&&"object"==typeof s?e.fail$data((0,n._)`!${(0,a.useFunc)(t,l.default)}(${r}, ${o})`):e.fail((0,n._)`${s} !== ${r}`)}}},833314,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});let n=e.r(100145),a=e.r(803026),l=e.r(991150);r.default={keyword:"enum",schemaType:"array",$data:!0,error:{message:"must be equal to one of the allowed values",params:({schemaCode:e})=>(0,n._)`{allowedValues: ${e}}`},code(e){let t,r,{gen:i,data:o,$data:s,schema:c,schemaCode:u,it:d}=e;if(!s&&0===c.length)throw Error("enum must have non-empty array");let f=c.length>=d.opts.loopEnum,p=()=>null!=t?t:t=(0,a.useFunc)(i,l.default);if(f||s)r=i.let("valid"),e.block$data(r,function(){i.assign(r,!1),i.forOf("v",u,e=>i.if((0,n._)`${p()}(${o}, ${e})`,()=>i.assign(r,!0).break()))});else{if(!Array.isArray(c))throw Error("ajv implementation error");let e=i.const("vSchema",u);r=(0,n.or)(...c.map((t,r)=>{var a,l;let i;return a=e,"object"==typeof(i=c[l=r])&&null!==i?(0,n._)`${p()}(${o}, ${a}[${l}])`:(0,n._)`${o} === ${i}`}))}e.pass(r)}}},838988,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});let n=e.r(100213),a=e.r(797966),l=e.r(631717),i=e.r(997782),o=e.r(385395),s=e.r(572568),c=e.r(581573),u=e.r(287120),d=e.r(861707),f=e.r(833314);r.default=[n.default,a.default,l.default,i.default,o.default,s.default,c.default,u.default,{keyword:"type",schemaType:["string","array"]},{keyword:"nullable",schemaType:"boolean"},d.default,f.default]},894930,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.validateAdditionalItems=void 0;let n=e.r(100145),a=e.r(803026);function l(e,t){let{gen:r,schema:l,data:i,keyword:o,it:s}=e;s.items=!0;let c=r.const("len",(0,n._)`${i}.length`);if(!1===l)e.setParams({len:t.length}),e.pass((0,n._)`${c} <= ${t.length}`);else if("object"==typeof l&&!(0,a.alwaysValidSchema)(s,l)){let l=r.var("valid",(0,n._)`${c} <= ${t.length}`);r.if((0,n.not)(l),()=>{var i;return i=l,void r.forRange("i",t.length,c,t=>{e.subschema({keyword:o,dataProp:t,dataPropType:a.Type.Num},i),s.allErrors||r.if((0,n.not)(i),()=>r.break())})}),e.ok(l)}}r.validateAdditionalItems=l,r.default={keyword:"additionalItems",type:"array",schemaType:["boolean","object"],before:"uniqueItems",error:{message:({params:{len:e}})=>(0,n.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,n._)`{limit: ${e}}`}
4,code(e){let{parentSchema:t,it:r}=e,{items:n}=t;Array.isArray(n)?l(e,n):(0,a.checkStrictMode)(r,'"additionalItems" is ignored when "items" is not an array of schemas')}}},344735,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.validateTuple=void 0;let n=e.r(100145),a=e.r(803026),l=e.r(966992);function i(e,t,r=e.schema){let{gen:l,parentSchema:o,data:s,keyword:c,it:u}=e;(function(e){let{opts:n,errSchemaPath:l}=u,i=r.length,o=i===e.minItems&&(i===e.maxItems||!1===e[t]);if(n.strictTuples&&!o){let e=`"${c}" is ${i}-tuple, but minItems or maxItems/${t} are not specified or different at path "${l}"`;(0,a.checkStrictMode)(u,e,n.strictTuples)}})(o),u.opts.unevaluated&&r.length&&!0!==u.items&&(u.items=a.mergeEvaluated.items(l,r.length,u.items));let d=l.name("valid"),f=l.const("len",(0,n._)`${s}.length`);r.forEach((t,r)=>{(0,a.alwaysValidSchema)(u,t)||(l.if((0,n._)`${f} > ${r}`,()=>e.subschema({keyword:c,schemaProp:r,dataProp:r},d)),e.ok(d))})}r.validateTuple=i,r.default={keyword:"items",type:"array",schemaType:["object","array","boolean"],before:"uniqueItems",code(e){let{schema:t,it:r}=e;if(Array.isArray(t))return i(e,"additionalItems",t);r.items=!0,(0,a.alwaysValidSchema)(r,t)||e.ok((0,l.validateArray)(e))}}},291963,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});let n=e.r(344735);r.default={keyword:"prefixItems",type:"array",schemaType:["array"],before:"uniqueItems",code:e=>(0,n.validateTuple)(e,"items")}},117350,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});let n=e.r(100145),a=e.r(803026),l=e.r(966992),i=e.r(894930);r.default={keyword:"items",type:"array",schemaType:["object","boolean"],before:"uniqueItems",error:{message:({params:{len:e}})=>(0,n.str)`must NOT have more than ${e} items`,params:({params:{len:e}})=>(0,n._)`{limit: ${e}}`},code(e){let{schema:t,parentSchema:r,it:n}=e,{prefixItems:o}=r;n.items=!0,(0,a.alwaysValidSchema)(n,t)||(o?(0,i.validateAdditionalItems)(e,o):e.ok((0,l.validateArray)(e)))}}},180339,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});let n=e.r(100145),a=e.r(803026);r.default={keyword:"contains",type:"array",schemaType:["object","boolean"],before:"uniqueItems",trackErrors:!0,error:{message:({params:{min:e,max:t}})=>void 0===t?(0,n.str)`must contain at least ${e} valid item(s)`:(0,n.str)`must contain at least ${e} and no more than ${t} valid item(s)`,params:({params:{min:e,max:t}})=>void 0===t?(0,n._)`{minContains: ${e}}`:(0,n._)`{minContains: ${e}, maxContains: ${t}}`},code(e){let t,r,{gen:l,schema:i,parentSchema:o,data:s,it:c}=e,{minContains:u,maxContains:d}=o;c.opts.next?(t=void 0===u?1:u,r=d):t=1;let f=l.const("len",(0,n._)`${s}.length`);if(e.setParams({min:t,max:r}),void 0===r&&0===t)return void(0,a.checkStrictMode)(c,'"minContains" == 0 without "maxContains": "contains" keyword ignored');if(void 0!==r&&t>r){(0,a.checkStrictMode)(c,'"minContains" > "maxContains" is always invalid'),e.fail();return}if((0,a.alwaysValidSchema)(c,i)){let a=(0,n._)`${f} >= ${t}`;void 0!==r&&(a=(0,n._)`${a} && ${f} <= ${r}`),e.pass(a);return}c.items=!0;let p=l.name("valid");function h(){let e=l.name("_valid"),a=l.let("count",0);m(e,()=>l.if(e,()=>{var e;return e=a,void(l.code((0,n._)`${e}++`),void 0===r?l.if((0,n._)`${e} >= ${t}`,()=>l.assign(p,!0).break()):(l.if((0,n._)`${e} > ${r}`,()=>l.assign(p,!1).break()),1===t?l.assign(p,!0):l.if((0,n._)`${e} >= ${t}`,()=>l.assign(p,!0))))}))}function m(t,r){l.forRange("i",0,f,n=>{e.subschema({keyword:"contains",dataProp:n,dataPropType:a.Type.Num,compositeRule:!0},t),r()})}void 0===r&&1===t?m(p,()=>l.if(p,()=>l.break())):0===t?(l.let(p,!0),void 0!==r&&l.if((0,n._)`${s}.length > 0`,h)):(l.let(p,!1),h()),e.result(p,()=>e.reset())}}},518459,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.validateSchemaDeps=r.validatePropertyDeps=r.error=void 0;let n=e.r(100145),a=e.r(803026),l=e.r(966992);r.error={message:({params:{property:e,depsCount:t,deps:r}})=>(0,n.str)`must have ${1===t?"property":"properties"} ${r} when property ${e} is present`,params:({params:{property:e,depsCount:t,deps:r,missingProperty:a}})=>(0,n._)`{property: ${e},
5    missingProperty: ${a},
6    depsCount: ${t},
7    deps: ${r}}`};let i={keyword:"dependencies",type:"object",schemaType:"object",error:r.error,code(e){let[t,r]=function({schema:e}){let t={},r={};for(let n in e)"__proto__"!==n&&((Array.isArray(e[n])?t:r)[n]=e[n]);return[t,r]}(e);o(e,t),s(e,r)}};function o(e,t=e.schema){let{gen:r,data:a,it:i}=e;if(0===Object.keys(t).length)return;let s=r.let("missing");for(let o in t){let c=t[o];if(0===c.length)continue;let u=(0,l.propertyInData)(r,a,o,i.opts.ownProperties);e.setParams({property:o,depsCount:c.length,deps:c.join(", ")}),i.allErrors?r.if(u,()=>{for(let t of c)(0,l.checkReportMissingProp)(e,t)}
7):(r.if((0,n._)`${u} && (${(0,l.checkMissingProp)(e,c,s)})`),(0,l.reportMissingProp)(e,s),r.else())}}function s(e,t=e.schema){let{gen:r,data:n,keyword:i,it:o}=e,c=r.name("valid");for(let s in t)(0,a.alwaysValidSchema)(o,t[s])||(r.if((0,l.propertyInData)(r,n,s,o.opts.ownProperties),()=>{let t=e.subschema({keyword:i,schemaProp:s},c);e.mergeValidEvaluated(t,c)},()=>r.var(c,!0)),e.ok(c))}r.validatePropertyDeps=o,r.validateSchemaDeps=s,r.default=i},33770,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});let n=e.r(100145),a=e.r(803026);r.default={keyword:"propertyNames",type:"object",schemaType:["object","boolean"],error:{message:"property name must be valid",params:({params:e})=>(0,n._)`{propertyName: ${e.propertyName}}`},code(e){let{gen:t,schema:r,data:l,it:i}=e;if((0,a.alwaysValidSchema)(i,r))return;let o=t.name("valid");t.forIn("key",l,r=>{e.setParams({propertyName:r}),e.subschema({keyword:"propertyNames",data:r,dataTypes:["string"],propertyName:r,compositeRule:!0},o),t.if((0,n.not)(o),()=>{e.error(!0),i.allErrors||t.break()})}),e.ok(o)}}},61366,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});let n=e.r(966992),a=e.r(100145),l=e.r(864130),i=e.r(803026);r.default={keyword:"additionalProperties",type:["object"],schemaType:["boolean","object"],allowUndefined:!0,trackErrors:!0,error:{message:"must NOT have additional properties",params:({params:e})=>(0,a._)`{additionalProperty: ${e.additionalProperty}}`},code(e){let{gen:t,schema:r,parentSchema:o,data:s,errsCount:c,it:u}=e;if(!c)throw Error("ajv implementation error");let{allErrors:d,opts:f}=u;if(u.props=!0,"all"!==f.removeAdditional&&(0,i.alwaysValidSchema)(u,r))return;let p=(0,n.allSchemaProperties)(o.properties),h=(0,n.allSchemaProperties)(o.patternProperties);function m(e){t.code((0,a._)`delete ${s}[${e}]`)}function g(n){if("all"===f.removeAdditional||f.removeAdditional&&!1===r)return void m(n);if(!1===r){e.setParams({additionalProperty:n}),e.error(),d||t.break();return}if("object"==typeof r&&!(0,i.alwaysValidSchema)(u,r)){let r=t.name("valid");"failing"===f.removeAdditional?(b(n,r,!1),t.if((0,a.not)(r),()=>{e.reset(),m(n)})):(b(n,r),d||t.if((0,a.not)(r),()=>t.break()))}}function b(t,r,n){let a={keyword:"additionalProperties",dataProp:t,dataPropType:i.Type.Str};!1===n&&Object.assign(a,{compositeRule:!0,createErrors:!1,allErrors:!1}),e.subschema(a,r)}t.forIn("key",s,r=>{p.length||h.length?t.if(function(r){let l;if(p.length>8){let e=(0,i.schemaRefOrVal)(u,o.properties,"properties");l=(0,n.isOwnProperty)(t,e,r)}else l=p.length?(0,a.or)(...p.map(e=>(0,a._)`${r} === ${e}`)):a.nil;return h.length&&(l=(0,a.or)(l,...h.map(t=>(0,a._)`${(0,n.usePattern)(e,t)}.test(${r})`))),(0,a.not)(l)}(r),()=>g(r)):g(r)}),e.ok((0,a._)`${c} === ${l.default.errors}`)}}},290985,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});let n=e.r(341770),a=e.r(966992),l=e.r(803026),i=e.r(61366);r.default={keyword:"properties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,parentSchema:o,data:s,it:c}=e;"all"===c.opts.removeAdditional&&void 0===o.additionalProperties&&i.default.code(new n.KeywordCxt(c,i.default,"additionalProperties"));let u=(0,a.allSchemaProperties)(r);for(let e of u)c.definedProperties.add(e);c.opts.unevaluated&&u.length&&!0!==c.props&&(c.props=l.mergeEvaluated.props(t,(0,l.toHash)(u),c.props));let d=u.filter(e=>!(0,l.alwaysValidSchema)(c,r[e]));if(0===d.length)return;let f=t.name("valid");for(let n of d){var p;(p=n,c.opts.useDefaults&&!c.compositeRule&&void 0!==r[p].default)?h(n):(t.if((0,a.propertyInData)(t,s,n,c.opts.ownProperties)),h(n),c.allErrors||t.else().var(f,!0),t.endIf()),e.it.definedProperties.add(n),e.ok(f)}function h(t){e.subschema({keyword:"properties",schemaProp:t,dataProp:t},f)}}}},836328,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});let n=e.r(966992),a=e.r(100145),l=e.r(803026),i=e.r(803026);r.default={keyword:"patternProperties",type:"object",schemaType:"object",code(e){let{gen:t,schema:r,data:o,parentSchema:s,it:c}=e,{opts:u}=c,d=(0,n.allSchemaProperties)(r),f=d.filter(e=>(0,l.alwaysValidSchema)(c,r[e]));if(0===d.length||f.length===d.length&&(!c.opts.unevaluated||!0===c.props))return;let p=u.strictSchema&&!u.allowMatchingProperties&&s.properties,h=t.name("valid");!0===c.props||c.props instanceof a.Name||(c.props=(0,i.evaluatedPropsToName)(t,c.props));let{props:m}=c;for(let e of d)p&&function(e){for(let t in p)new RegExp(e).test(t)&&(0,l.checkStrictMode)(c,`property ${t} matches pattern ${e} (use allowMatchingProperties)`)}(e),c.allErrors?g(e):(t.var(h,!0),g(e),t.if(h));function g(r){t.forIn("key",o,l=>{t.if((0,a._)`${(0,n.usePattern)(e,r)}.test(${l})`,()=>{let n=f.includes(r);n||e.subschema({keyword:"patternProperties",schemaProp:r,dataProp:l,dataPropType:i.Type.Str},h),c.opts.unevaluated&&!0!==m?t.assign((0,a._)`${m}[${l}]`,!0):n||c.allErrors||t.if((0,a.not)(h),()=>t.break())})})}}}},210489,(e,t,r)=>{"use strict";
7Object.defineProperty(r,"__esModule",{value:!0});let n=e.r(803026);r.default={keyword:"not",schemaType:["object","boolean"],trackErrors:!0,code(e){let{gen:t,schema:r,it:a}=e;if((0,n.alwaysValidSchema)(a,r))return void e.fail();let l=t.name("valid");e.subschema({keyword:"not",compositeRule:!0,createErrors:!1,allErrors:!1},l),e.failResult(l,()=>e.reset(),()=>e.error())},error:{message:"must NOT be valid"}}},124465,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default={keyword:"anyOf",schemaType:"array",trackErrors:!0,code:e.r(966992).validateUnion,error:{message:"must match a schema in anyOf"}}},115124,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});let n=e.r(100145),a=e.r(803026);r.default={keyword:"oneOf",schemaType:"array",trackErrors:!0,error:{message:"must match exactly one schema in oneOf",params:({params:e})=>(0,n._)`{passingSchemas: ${e.passing}}`},code(e){let{gen:t,schema:r,parentSchema:l,it:i}=e;if(!Array.isArray(r))throw Error("ajv implementation error");if(i.opts.discriminator&&l.discriminator)return;let o=t.let("valid",!1),s=t.let("passing",null),c=t.name("_valid");e.setParams({passing:s}),t.block(function(){r.forEach((r,l)=>{let u;(0,a.alwaysValidSchema)(i,r)?t.var(c,!0):u=e.subschema({keyword:"oneOf",schemaProp:l,compositeRule:!0},c),l>0&&t.if((0,n._)`${c} && ${o}`).assign(o,!1).assign(s,(0,n._)`[${s}, ${l}]`).else(),t.if(c,()=>{t.assign(o,!0),t.assign(s,l),u&&e.mergeEvaluated(u,n.Name)})})}),e.result(o,()=>e.reset(),()=>e.error(!0))}}},873609,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});let n=e.r(803026);r.default={keyword:"allOf",schemaType:"array",code(e){let{gen:t,schema:r,it:a}=e;if(!Array.isArray(r))throw Error("ajv implementation error");let l=t.name("valid");r.forEach((t,r)=>{if((0,n.alwaysValidSchema)(a,t))return;let i=e.subschema({keyword:"allOf",schemaProp:r},l);e.ok(l),e.mergeEvaluated(i)})}}},571115,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});let n=e.r(100145),a=e.r(803026);function l(e,t){let r=e.schema[t];return void 0!==r&&!(0,a.alwaysValidSchema)(e,r)}r.default={keyword:"if",schemaType:["object","boolean"],trackErrors:!0,error:{message:({params:e})=>(0,n.str)`must match "${e.ifClause}" schema`,params:({params:e})=>(0,n._)`{failingKeyword: ${e.ifClause}}`},code(e){let t,{gen:r,parentSchema:i,it:o}=e;void 0===i.then&&void 0===i.else&&(0,a.checkStrictMode)(o,'"if" without "then" and "else" is ignored');let s=l(o,"then"),c=l(o,"else");if(!s&&!c)return;let u=r.let("valid",!0),d=r.name("_valid");if(t=e.subschema({keyword:"if",compositeRule:!0,createErrors:!1,allErrors:!1},d),e.mergeEvaluated(t),e.reset(),s&&c){let t=r.let("ifClause");e.setParams({ifClause:t}),r.if(d,f("then",t),f("else",t))}else s?r.if(d,f("then")):r.if((0,n.not)(d),f("else"));function f(t,a){return()=>{let l=e.subschema({keyword:t},d);r.assign(u,d),e.mergeValidEvaluated(l,u),a?r.assign(a,(0,n._)`${t}`):e.setParams({ifClause:t})}}e.pass(u,()=>e.error(!0))}}},556572,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});let n=e.r(803026);r.default={keyword:["then","else"],schemaType:["object","boolean"],code({keyword:e,parentSchema:t,it:r}){void 0===t.if&&(0,n.checkStrictMode)(r,`"${e}" without "if" is ignored`)}}},426647,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});let n=e.r(894930),a=e.r(291963),l=e.r(344735),i=e.r(117350),o=e.r(180339),s=e.r(518459),c=e.r(33770),u=e.r(61366),d=e.r(290985),f=e.r(836328),p=e.r(210489),h=e.r(124465),m=e.r(115124),g=e.r(873609),b=e.r(571115),v=e.r(556572);r.default=function(e=!1){let t=[p.default,h.default,m.default,g.default,b.default,v.default,c.default,u.default,s.default,d.default,f.default];return e?t.push(a.default,i.default):t.push(n.default,l.default),t.push(o.default),t}},65527,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});let n=e.r(100145);r.default={keyword:"format",type:["number","string"],schemaType:"string",$data:!0,error:{message:({schemaCode:e})=>(0,n.str)`must match format "${e}"`,params:({schemaCode:e})=>(0,n._)`{format: ${e}}`}
7,code(e,t){let r,a,l,i,o,s,{gen:c,data:u,$data:d,schema:f,schemaCode:p,it:h}=e,{opts:m,errSchemaPath:g,schemaEnv:b,self:v}=h;m.validateFormats&&(d?(r=c.scopeValue("formats",{ref:v.formats,code:m.code.formats}),a=c.const("fDef",(0,n._)`${r}[${p}]`),l=c.let("fType"),i=c.let("format"),c.if((0,n._)`typeof ${a} == "object" && !(${a} instanceof RegExp)`,()=>c.assign(l,(0,n._)`${a}.type || "string"`).assign(i,(0,n._)`${a}.validate`),()=>c.assign(l,(0,n._)`"string"`).assign(i,a)),e.fail$data((0,n.or)(!1===m.strictSchema?n.nil:(0,n._)`${p} && !${i}`,(o=b.$async?(0,n._)`(${a}.async ? await ${i}(${u}) : ${i}(${u}))`:(0,n._)`${i}(${u})`,s=(0,n._)`(typeof ${i} == "function" ? ${o} : ${i}.test(${u}))`,(0,n._)`${i} && ${i} !== true && ${l} === ${t} && !${s}`)))):function(){var r;let a,l,i=v.formats[f];if(!i){if(!1===m.strictSchema)return v.logger.warn(o());throw Error(o());function o(){return`unknown format "${f}" ignored in schema at path "${g}"`}}if(!0===i)return;let[s,d,p]=(a=(r=i)instanceof RegExp?(0,n.regexpCode)(r):m.code.formats?(0,n._)`${m.code.formats}${(0,n.getProperty)(f)}`:void 0,l=c.scopeValue("formats",{key:f,ref:r,code:a}),"object"!=typeof r||r instanceof RegExp?["string",r,l]:[r.type||"string",r.validate,(0,n._)`${l}.validate`]);s===t&&e.pass(function(){if("object"==typeof i&&!(i instanceof RegExp)&&i.async){if(!b.$async)throw Error("async format in sync schema");return(0,n._)`await ${p}(${u})`}return"function"==typeof d?(0,n._)`${p}(${u})`:(0,n._)`${p}.test(${u})`}())}())}}},192473,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.default=[e.r(65527).default]},305738,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.contentVocabulary=r.metadataVocabulary=void 0,r.metadataVocabulary=["title","description","default","deprecated","readOnly","writeOnly","examples"],r.contentVocabulary=["contentMediaType","contentEncoding","contentSchema"]},903311,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});let n=e.r(28453),a=e.r(838988),l=e.r(426647),i=e.r(192473),o=e.r(305738);r.default=[n.default,a.default,(0,l.default)(),i.default,o.metadataVocabulary,o.contentVocabulary]},743283,(e,t,r)=>{"use strict";var n,a;Object.defineProperty(r,"__esModule",{value:!0}),r.DiscrError=void 0,(a=n||(r.DiscrError=n={})).Tag="tag",a.Mapping="mapping"},584978,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0});let n=e.r(100145),a=e.r(743283),l=e.r(893066),i=e.r(743002),o=e.r(803026);r.default={keyword:"discriminator",type:"object",schemaType:"object",error:{message:({params:{discrError:e,tagName:t}})=>e===a.DiscrError.Tag?`tag "${t}" must be string`:`value of tag "${t}" must be in oneOf`,params:({params:{discrError:e,tag:t,tagName:r}})=>(0,n._)`{error: ${e}, tag: ${r}, tagValue: ${t}}`},code(e){let{gen:t,data:r,schema:s,parentSchema:c,it:u}=e,{oneOf:d}=c;if(!u.opts.discriminator)throw Error("discriminator: requires discriminator option");let f=s.propertyName;if("string"!=typeof f)throw Error("discriminator: requires propertyName");if(s.mapping)throw Error("discriminator: mapping is not supported");if(!d)throw Error("discriminator: requires oneOf keyword");let p=t.let("valid",!1),h=t.const("tag",(0,n._)`${r}${(0,n.getProperty)(f)}`);t.if((0,n._)`typeof ${h} == "string"`,()=>(function(){let r=function(){var e;let t={},r=a(c),n=!0;for(let t=0;t<d.length;t++){let c=d[t];if((null==c?void 0:c.$ref)&&!(0,o.schemaHasRulesButRef)(c,u.self.RULES)){let e=c.$ref;if((c=l.resolveRef.call(u.self,u.schemaEnv.root,u.baseId,e))instanceof l.SchemaEnv&&(c=c.schema),void 0===c)throw new i.default(u.opts.uriResolver,u.baseId,e)}let p=null==(e=null==c?void 0:c.properties)?void 0:e[f];if("object"!=typeof p)throw Error(`discriminator: oneOf subschemas (or referenced schemas) must have "properties/${f}"`);n=n&&(r||a(c)),function(e,t){if(e.const)s(e.const,t);else if(e.enum)for(let r of e.enum)s(r,t);else throw Error(`discriminator: "properties/${f}" must have "const" or "enum"`)}(p,t)}if(!n)throw Error(`discriminator: "${f}" must be required`);return t;function a({required:e}){return Array.isArray(e)&&e.includes(f)}function s(e,r){if("string"!=typeof e||e in t)throw Error(`discriminator: "${f}" values must be unique strings`);t[e]=r}}();for(let a in t.if(!1),r)t.elseIf((0,n._)`${h} === ${a}`),t.assign(p,function(r){let a=t.name("valid"),l=e.subschema({keyword:"oneOf",schemaProp:r},a);return e.mergeEvaluated(l,n.Name),a}(r[a]));t.else(),e.error(!1,{discrError:a.DiscrError.Mapping,tag:h,tagName:f}),t.endIf()})(),()=>e.error(!1,{discrError:a.DiscrError.Tag,tag:h,tagName:f})),e.ok(p)}}},84328,(e,t,r)=>{t.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"}
7,const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}},34705,(e,t,r)=>{"use strict";Object.defineProperty(r,"__esModule",{value:!0}),r.MissingRefError=r.ValidationError=r.CodeGen=r.Name=r.nil=r.stringify=r.str=r._=r.KeywordCxt=r.Ajv=void 0;let n=e.r(226924),a=e.r(903311),l=e.r(584978),i=e.r(84328),o=["/properties"],s="http://json-schema.org/draft-07/schema";class c extends n.default{_addVocabularies(){super._addVocabularies(),a.default.forEach(e=>this.addVocabulary(e)),this.opts.discriminator&&this.addKeyword(l.default)}_addDefaultMetaSchema(){if(super._addDefaultMetaSchema(),!this.opts.meta)return;let e=this.opts.$data?this.$dataMetaSchema(i,o):i;this.addMetaSchema(e,s,!1),this.refs["http://json-schema.org/schema"]=s}defaultMeta(){return this.opts.defaultMeta=super.defaultMeta()||(this.getSchema(s)?s:void 0)}}r.Ajv=c,t.exports=r=c,t.exports.Ajv=c,Object.defineProperty(r,"__esModule",{value:!0}),r.default=c;var u=e.r(341770);Object.defineProperty(r,"KeywordCxt",{enumerable:!0,get:function(){return u.KeywordCxt}});var d=e.r(100145);Object.defineProperty(r,"_",{enumerable:!0,get:function(){return d._}}),Object.defineProperty(r,"str",{enumerable:!0,get:function(){return d.str}}),Object.defineProperty(r,"stringify",{enumerable:!0,get:function(){return d.stringify}}),Object.defineProperty(r,"nil",{enumerable:!0,get:function(){return d.nil}}),Object.defineProperty(r,"Name",{enumerable:!0,get:function(){return d.Name}}),Object.defineProperty(r,"CodeGen",{enumerable:!0,get:function(){return d.CodeGen}});var f=e.r(227230);Object.defineProperty(r,"ValidationError",{enumerable:!0,get:function(){return f.default}});var p=e.r(743002);Object.defineProperty(r,"MissingRefError",{enumerable:!0,get:function(){return p.default}})},756961,(e,t,r)=>{for(var n=e.i(6946),a=e.i(640550),l=Math.floor(0xffffff*Math.random()),i=h.index=parseInt(0xffffff*Math.random(),10),o=(void 0===n.default||"number"!=typeof n.default.pid?Math.floor(1e5*Math.random()):n.default.pid)%65535,s=(()=>{try{return _Buffer}catch(e){try{return a.Buffer}catch(e){return null}}})(),c=function(e){return!!(null!=e&&e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e))},u=[],d=0;d<256;d++)u[d]=(d<=15?"0":"")+d.toString(16);var f=RegExp("^[0-9a-fA-F]{24}$"),p=[];for(d=0;d<10;)p[48+d]=d++;for(;d<16;)p[55+d]=p[87+d]=d++;function h(e){if(!(this instanceof h))return new h(e);if(e&&(e instanceof h||"ObjectID"===e._bsontype))return e;if(this._bsontype="ObjectID",null==e||"number"==typeof e){this.id=this.generate(e);return}var t=h.isValid(e);if(t||null==e)if(t&&"string"==typeof e&&24===e.length)return h.createFromHexString(e);else if(null!=e&&12===e.length)this.id=e;else if(null!=e&&"function"==typeof e.toHexString)return e;else throw Error("Argument passed in must be a single String of 12 bytes or a string of 24 hex characters");else throw Error("Argument passed in must be a single String of 12 bytes or a string of 24 hex characters")}t.exports=h,h.default=h,h.createFromTime=function(e){var t;return new h((8===(t=(t=e=parseInt(e,10)%0xffffffff).toString(16)).length?t:"00000000".substring(t.length,8)+t)+"0000000000000000")},h.createFromHexString=function(e){if(void 0===e||null!=e&&24!==e.length)throw Error("Argument passed in must be a single String of 12 bytes or a string of 24 hex characters");for(var t="",r=0;r<24;)t+=String.fromCharCode(p[e.charCodeAt(r++)]<<4|p[e.charCodeAt(r++)]);return new h(t)},h.isValid=function(e){return null!=e&&("number"==typeof e||("string"==typeof e?12===e.length||24===e.length&&f.test(e):e instanceof h||(c(e)?h.isValid(e.toString("hex")):"function"==typeof e.toHexString&&!!s&&(e.id instanceof s||"string"==typeof e.id)&&(12===e.id.length||24===e.id.length&&f.test(e.id)))))},h.prototype={constructor:h,toHexString:function(){if(!this.id||!this.id.length)throw Error("invalid ObjectId, ObjectId.id must be either a string or a Buffer, but is ["+JSON.stringify(this.id)+"]");if(24===this.id.length)return this.id;if(c(this.id))return this.id.toString("hex");for(var e="",t=0;t<this.id.length;
7t++)e+=u[this.id.charCodeAt(t)];return e},equals:function(e){if(e instanceof h)return this.toString()===e.toString();if("string"==typeof e&&h.isValid(e)&&12===e.length&&c(this.id))return e===this.id.toString("binary");if("string"==typeof e&&h.isValid(e)&&24===e.length)return e.toLowerCase()===this.toHexString();if("string"==typeof e&&h.isValid(e)&&12===e.length)return e===this.id;if(null!=e&&(e instanceof h||e.toHexString))return e.toHexString()===this.toHexString();else return!1},getTimestamp:function(){var e,t=new Date;return e=c(this.id)?this.id[3]|this.id[2]<<8|this.id[1]<<16|this.id[0]<<24:this.id.charCodeAt(3)|this.id.charCodeAt(2)<<8|this.id.charCodeAt(1)<<16|this.id.charCodeAt(0)<<24,t.setTime(1e3*Math.floor(e)),t},generate:function(e){"number"!=typeof e&&(e=~~(Date.now()/1e3)),e=parseInt(e,10)%0xffffffff;var t=i=(i+1)%0xffffff;return String.fromCharCode(e>>24&255,e>>16&255,e>>8&255,255&e,l>>16&255,l>>8&255,255&l,o>>8&255,255&o,t>>16&255,t>>8&255,255&t)}};var m=Symbol&&Symbol.for&&Symbol.for("nodejs.util.inspect.custom")||"inspect";h.prototype[m]=function(){return"ObjectID("+this+")"},h.prototype.toJSON=h.prototype.toHexString,h.prototype.toString=h.prototype.toHexString},286264,(e,t,r)=>{e.e,t.exports=function(){var e=[],t=[],r={},n={},a={};function l(e){return"string"==typeof e?RegExp("^"+e+"$","i"):e}function i(e,t){return e===t?t:e===e.toLowerCase()?t.toLowerCase():e===e.toUpperCase()?t.toUpperCase():e[0]===e[0].toUpperCase()?t.charAt(0).toUpperCase()+t.substr(1).toLowerCase():t.toLowerCase()}function o(e,t,n){if(!e.length||r.hasOwnProperty(e))return t;for(var a=n.length;a--;){var l=n[a];if(l[0].test(t))return function(e,t){return e.replace(t[0],function(r,n){var a,l,o=(a=t[1],l=arguments,a.replace(/\$(\d{1,2})/g,function(e,t){return l[t]||""}));return""===r?i(e[n-1],o):i(r,o)})}(t,l)}return t}function s(e,t,r){return function(n){var a=n.toLowerCase();return t.hasOwnProperty(a)?i(n,a):e.hasOwnProperty(a)?i(n,e[a]):o(a,n,r)}}function c(e,t,r,n){return function(n){var a=n.toLowerCase();return!!t.hasOwnProperty(a)||!e.hasOwnProperty(a)&&o(a,a,r)===a}}function u(e,t,r){var n=1===t?u.singular(e):u.plural(e);return(r?t+" ":"")+n}return u.plural=s(a,n,e),u.isPlural=c(a,n,e),u.singular=s(n,a,t),u.isSingular=c(n,a,t),u.addPluralRule=function(t,r){e.push([l(t),r])},u.addSingularRule=function(e,r){t.push([l(e),r])},u.addUncountableRule=function(e){if("string"==typeof e){r[e.toLowerCase()]=!0;return}u.addPluralRule(e,"$0"),u.addSingularRule(e,"$0")},u.addIrregularRule=function(e,t){t=t.toLowerCase(),a[e=e.toLowerCase()]=t,n[t]=e},[["I","we"],["me","us"],["he","they"],["she","they"],["them","them"],["myself","ourselves"],["yourself","yourselves"],["itself","themselves"],["herself","themselves"],["himself","themselves"],["themself","themselves"],["is","are"],["was","were"],["has","have"],["this","these"],["that","those"],["echo","echoes"],["dingo","dingoes"],["volcano","volcanoes"],["tornado","tornadoes"],["torpedo","torpedoes"],["genus","genera"],["viscus","viscera"],["stigma","stigmata"],["stoma","stomata"],["dogma","dogmata"],["lemma","lemmata"],["schema","schemata"],["anathema","anathemata"],["ox","oxen"],["axe","axes"],["die","dice"],["yes","yeses"],["foot","feet"],["eave","eaves"],["goose","geese"],["tooth","teeth"],["quiz","quizzes"],["human","humans"],["proof","proofs"],["carve","carves"],["valve","valves"],["looey","looies"],["thief","thieves"],["groove","grooves"],["pickaxe","pickaxes"],["passerby","passersby"]].forEach(function(e){return u.addIrregularRule(e[0],e[1])}),[[/s?$/i,"s"],[/[^\u0000-\u007F]$/i,"$0"],[/([^aeiou]ese)$/i,"$1"],[/(ax|test)is$/i,"$1es"],[/(alias|[^aou]us|t[lm]as|gas|ris)$/i,"$1es"],[/(e[mn]u)s?$/i,"$1s"],[/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i,"$1"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1i"],[/(alumn|alg|vertebr)(?:a|ae)$/i,"$1ae"],[/(seraph|cherub)(?:im)?$/i,"$1im"],[/(her|at|gr)o$/i,"$1oes"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i,"$1a"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i,"$1a"],[/sis$/i,"ses"],[/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i,"$1$2ves"],[/([^aeiouy]|qu)y$/i,"$1ies"],[/([^ch][ieo][ln])ey$/i,"$1ies"],[/(x|ch|ss|sh|zz)$/i,"$1es"],[/(matr|cod|mur|sil|vert|ind|append)(?:ix|ex)$/i,"$1ices"],[/\b((?:tit)?m|l)(?:ice|ouse)$/i,"$1ice"],[/(pe)(?:rson|ople)$/i,"$1ople"],[/(child)(?:ren)?$/i,"$1ren"],[/eaux$/i,"$0"],[/m[ae]n$/i,"men"],["thou","you"]].forEac
7h(function(e){return u.addPluralRule(e[0],e[1])}),[[/s$/i,""],[/(ss)$/i,"$1"],[/(wi|kni|(?:after|half|high|low|mid|non|night|[^\w]|^)li)ves$/i,"$1fe"],[/(ar|(?:wo|[ae])l|[eo][ao])ves$/i,"$1f"],[/ies$/i,"y"],[/\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i,"$1ie"],[/\b(mon|smil)ies$/i,"$1ey"],[/\b((?:tit)?m|l)ice$/i,"$1ouse"],[/(seraph|cherub)im$/i,"$1"],[/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|[aeiou]ris)(?:es)?$/i,"$1"],[/(analy|diagno|parenthe|progno|synop|the|empha|cri|ne)(?:sis|ses)$/i,"$1sis"],[/(movie|twelve|abuse|e[mn]u)s$/i,"$1"],[/(test)(?:is|es)$/i,"$1is"],[/(alumn|syllab|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i,"$1us"],[/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i,"$1um"],[/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i,"$1on"],[/(alumn|alg|vertebr)ae$/i,"$1a"],[/(cod|mur|sil|vert|ind)ices$/i,"$1ex"],[/(matr|append)ices$/i,"$1ix"],[/(pe)(rson|ople)$/i,"$1rson"],[/(child)ren$/i,"$1"],[/(eau)x?$/i,"$1"],[/men$/i,"man"]].forEach(function(e){return u.addSingularRule(e[0],e[1])}),["adulthood","advice","agenda","aid","aircraft","alcohol","ammo","analytics","anime","athletics","audio","bison","blood","bream","buffalo","butter","carp","cash","chassis","chess","clothing","cod","commerce","cooperation","corps","debris","diabetes","digestion","elk","energy","equipment","excretion","expertise","firmware","flounder","fun","gallows","garbage","graffiti","hardware","headquarters","health","herpes","highjinks","homework","housework","information","jeans","justice","kudos","labour","literature","machinery","mackerel","mail","media","mews","moose","music","mud","manga","news","only","personnel","pike","plankton","pliers","police","pollution","premises","rain","research","rice","salmon","scissors","series","sewage","shambles","shrimp","software","species","staff","swine","tennis","traffic","transportation","trout","tuna","wealth","welfare","whiting","wildebeest","wildlife","you",/pok[eé]mon$/i,/[^aeiou]ese$/i,/deer$/i,/fish$/i,/measles$/i,/o[iu]s$/i,/pox$/i,/sheep$/i].forEach(u.addUncountableRule),u}()},76795,45895,556529,67013,720247,214316,763591,219365,571167,527434,545464,e=>{"use strict";let t,r,n,a,l;var i,o=e.i(6946),s=e.i(640550),c=e.i(476781),u=e.i(863218),d=e.i(250558),f=e.i(815841),p=e.i(79944),h=e.i(166535);let m=(e,t)=>{if("object"==typeof e&&!Object.prototype.hasOwnProperty.call(e,"$$typeof")){if(e[t.language])return e[t.language];let r=[];"string"==typeof t.fallbackLanguage?r=[t.fallbackLanguage]:Array.isArray(t.fallbackLanguage)&&(r=t.fallbackLanguage);let n=r.find(t=>e[t]);return n&&e[n]?e[n]:e[Object.keys(e)[0]]}return"function"==typeof e?e({i18n:t,t:t.t}):e};e.s(["getTranslation",0,m],45895);var g=e.i(393095),b=e.i(304498),v=e.i(309442);function y(e){return"group"===e.type||"array"===e.type||"row"===e.type||"collapsible"===e.type}function x(e){return"object"==typeof e}function w(e){return Array.isArray(e)&&"object"==typeof e?.[0]}function C(e){return"ui"===e.type}function j(e){return"admin"in e&&"position"in e.admin&&"sidebar"===e.admin.position}function S(e){return"name"in e&&"id"===e.name}function $(e){return"hidden"in e&&e.hidden||"admin"in e&&"disabled"in e.admin&&e.admin.disabled}function _(e){return"name"in e&&!C(e)}function k(e){return"name"in e}function E(e){return"name"in e}e.s(["fieldAffectsData",0,_,"fieldHasSubFields",0,y,"fieldIsArrayType",0,function(e){return"array"===e.type},"fieldIsBlockType",0,function(e){return"blocks"===e.type},"fieldIsHiddenOrDisabled",0,$,"fieldIsID",0,S,"fieldIsPresentationalOnly",0,C,"fieldIsSidebar",0,j,"fieldShouldBeLocalized",0,function({field:e,parentIsLocalized:t}){return"localized"in e&&e.localized&&(!t||"true"===o.default.env.NEXT_PUBLIC_PAYLOAD_COMPATIBILITY_allowLocalizedWithinLocalized)},"groupHasName",0,E,"optionIsObject",0,x,"optionsAreObjects",0,w,"tabHasName",0,k],556529);let N="u">typeof window&&void 0!==window.document&&void 0!==window.document.createElement;function P(e){let t=Object.prototype.toString.call(e);return"[object Window]"===t||"[object global]"===t}function T(e){return"nodeType"in e}function D(e){var t,r;return e?P(e)?e:T(e)&&null!=(t=null==(r=e.ownerDocument)?void 0:r.defaultView)?t:window:window}function R(e){let{Document:t}=D(e);return e instanceof t}function A(e){return!P(e)&&e instanceof D(e).HTMLElement}function O(e){return e instanceof D(e).SVGElement}function L(e){return e?P(e)?e.document:T(e)?R(e)?e:A(e)||O(e)?e.ownerDocument:document:document:document}let M=N?c.useLayoutEffect:c.useEffect;function I(e){let t=(0,c.useRef)(e);return M(()=>{t.current=e}),(0,c.useCallback)(function(){for(var e=arguments.length,r=Array(e),n=0;n<e;n++)r[n]=arguments[n];return null==t.current?void 0:t.current(...r)},[])}function F(){let e=(0,c.useRef)(null);return[(0,c.useCallback)((t,r)=>{e.current=setInterval(t,r)},[]),(0,c.useCallback)(()=>{null!==e.current&&(clearInterval(e.current),e.current=null)},[])]}function B(e,t){void 0===t&&(t=[e]);let r=(0,c.useRef)(e);return M(()=>{r.current!==e&&(r.current=e)},t),r}function z(e,t){let r=(0,c.useRef)();return(0,c.useMemo)(()=>{let t=e(r.current);return r.current=t,t},[...t])}function U(e){let t=I(e),r=(0,c.useRef)(null),n=(0,c.useCallback)(e=>{e!==r.current&&(null==t||t(e,r.current)),r.current=e},[]);return[r,n]}function V(e){let t=(0,c.useRef)();return(0,c.useEffect)(()=>{t.current=e},[e]),t.current}let H={};function q(e,t){return(0,c.useMemo)(()=>
7{if(t)return t;let r=null==H[e]?0:H[e]+1;return H[e]=r,e+"-"+r},[e,t])}function K(e){return function(t){for(var r=arguments.length,n=Array(r>1?r-1:0),a=1;a<r;a++)n[a-1]=arguments[a];return n.reduce((t,r)=>{for(let[n,a]of Object.entries(r)){let r=t[n];null!=r&&(t[n]=r+e*a)}return t},{...t})}}let W=K(1),G=K(-1);function Y(e){if(!e)return!1;let{KeyboardEvent:t}=D(e.target);return t&&e instanceof t}function Q(e){if(function(e){if(!e)return!1;let{TouchEvent:t}=D(e.target);return t&&e instanceof t}(e)){if(e.touches&&e.touches.length){let{clientX:t,clientY:r}=e.touches[0];return{x:t,y:r}}else if(e.changedTouches&&e.changedTouches.length){let{clientX:t,clientY:r}=e.changedTouches[0];return{x:t,y:r}}}return"clientX"in e&&"clientY"in e?{x:e.clientX,y:e.clientY}:null}let X=Object.freeze({Translate:{toString(e){if(!e)return;let{x:t,y:r}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(r?Math.round(r):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;let{scaleX:t,scaleY:r}=e;return"scaleX("+t+") scaleY("+r+")"}},Transform:{toString(e){if(e)return[X.Translate.toString(e),X.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:r,easing:n}=e;return t+" "+r+"ms "+n}}}),J="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function Z(e){return e.matches(J)?e:e.querySelector(J)}e.s(["CSS",0,X,"add",0,W,"canUseDOM",0,N,"findFirstFocusableNode",0,Z,"getEventCoordinates",0,Q,"getOwnerDocument",0,L,"getWindow",0,D,"isDocument",0,R,"isHTMLElement",0,A,"isKeyboardEvent",0,Y,"isNode",0,T,"isSVGElement",0,O,"isWindow",0,P,"subtract",0,G,"useCombinedRefs",0,function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return(0,c.useMemo)(()=>e=>{t.forEach(t=>t(e))},t)},"useEvent",0,I,"useInterval",0,F,"useIsomorphicLayoutEffect",0,M,"useLatestValue",0,B,"useLazyMemo",0,z,"useNodeRef",0,U,"usePrevious",0,V,"useUniqueId",0,q],67013);let ee={display:"none"};function et(e){let{id:t,value:r}=e;return c.default.createElement("div",{id:t,style:ee},r)}function er(e){let{id:t,announcement:r,ariaLiveType:n="assertive"}=e;return c.default.createElement("div",{id:t,style:{position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"},role:"status","aria-live":n,"aria-atomic":!0},r)}let en=(0,c.createContext)(null);function ea(e){let t=(0,c.useContext)(en);(0,c.useEffect)(()=>{if(!t)throw Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}let el={draggable:"\n    To pick up a draggable item, press the space bar.\n    While dragging, use the arrow keys to move the item.\n    Press space again to drop the item in its new position, or press escape to cancel.\n  "},ei={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:r}=e;return r?"Draggable item "+t.id+" was moved over droppable area "+r.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:r}=e;return r?"Draggable item "+t.id+" was dropped over droppable area "+r.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function eo(e){let{announcements:t=ei,container:r,hiddenTextDescribedById:n,screenReaderInstructions:a=el}=e,{announce:l,announcement:i}=function(){let[e,t]=(0,c.useState)("");return{announce:(0,c.useCallback)(e=>{null!=e&&t(e)},[]),announcement:e}}(),o=q("DndLiveRegion"),[s,d]=(0,c.useState)(!1);if((0,c.useEffect)(()=>{d(!0)},[]),ea((0,c.useMemo)(()=>({onDragStart(e){let{active:r}=e;l(t.onDragStart({active:r}))},onDragMove(e){let{active:r,over:n}=e;t.onDragMove&&l(t.onDragMove({active:r,over:n}))},onDragOver(e){let{active:r,over:n}=e;l(t.onDragOver({active:r,over:n}))},onDragEnd(e){let{active:r,over:n}=e;l(t.onDragEnd({active:r,over:n}))},onDragCancel(e){let{active:r,over:n}=e;l(t.onDragCancel({active:r,over:n}))}}),[l,t])),!s)return null;let f=c.default.createElement(c.default.Fragment,null,c.default.createElement(et,{id:n,value:a.draggable}),c.default.createElement(er,{id:o,announcement:i}));return r?(0,u.createPortal)(f,r):f}function es(){}function ec(e,t){return(0,c.useMemo)(()=>({sensor:e,options:null!=t?t:{}}),[e,t])}function eu(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return(0,c.useMemo)(()=>[...t].filter(e=>null!=e),[...t])}(lT=lz||(lz={})).DragStart="dragStart",lT.DragMove="dragMove",lT.DragEnd="dragEnd",lT.DragCancel="dragCancel",lT.DragOver="dragOver",lT.RegisterDroppable="registerDroppable",lT.SetDroppableDisabled="setDroppableDisabled",lT.UnregisterDroppable="unregisterDroppable";let ed=Object.freeze({x:0,y:0});function ef(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function ep(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return r-n}function eh(e,t){let{data:{value:r}}=e,{data:{value:n}}=t;return n-r}function em(e){let{left:t,top:r,height:n,width:a}=e;return[{x:t,y:r},{x:t+a,y:r},{x:t,y:r+n},{x:t+a,y:r+n}]}function eg(e,t){if(!e||0===e.length)return null;let[r]=e;return t?r[t]:r}function eb(e,t,r){return void 0===t&&(t=e.left),void 0===r&&(r=e.top),{x:t+.5*e.width,y:r+.5*e.height}}let ev=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e,a=eb(t,t.left,t.top),l=[];for(let e of n){let{id:t}=e,n=r.get(t);if(n){let r=ef(eb(n),a);l.push({id:t,data:{droppableContainer:e,value:r}})}}return l.sort(ep)},ey=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e,a=em(t),l=[];for(let e of n){let{id:t}=e,n=r.get(t);
7if(n){let r=em(n),i=Number((a.reduce((e,t,n)=>e+ef(r[n],t),0)/4).toFixed(4));l.push({id:t,data:{droppableContainer:e,value:i}})}}return l.sort(ep)},ex=e=>{let{collisionRect:t,droppableRects:r,droppableContainers:n}=e,a=[];for(let e of n){let{id:n}=e,l=r.get(n);if(l){let r=function(e,t){let r=Math.max(t.top,e.top),n=Math.max(t.left,e.left),a=Math.min(t.left+t.width,e.left+e.width),l=Math.min(t.top+t.height,e.top+e.height);if(n<a&&r<l){let i=t.width*t.height,o=e.width*e.height,s=(a-n)*(l-r);return Number((s/(i+o-s)).toFixed(4))}return 0}(l,t);r>0&&a.push({id:n,data:{droppableContainer:e,value:r}})}}return a.sort(eh)},ew=e=>{let{droppableContainers:t,droppableRects:r,pointerCoordinates:n}=e;if(!n)return[];let a=[];for(let e of t){let{id:t}=e,l=r.get(t);if(l&&function(e,t){let{top:r,left:n,bottom:a,right:l}=t;return r<=e.y&&e.y<=a&&n<=e.x&&e.x<=l}(n,l)){let r=Number((em(l).reduce((e,t)=>e+ef(n,t),0)/4).toFixed(4));a.push({id:t,data:{droppableContainer:e,value:r}})}}return a.sort(ep)};function eC(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:ed}let ej=function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return r.reduce((e,t)=>({...e,top:e.top+ +t.y,bottom:e.bottom+ +t.y,left:e.left+ +t.x,right:e.right+ +t.x}),{...e})};function eS(e){if(e.startsWith("matrix3d(")){let t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}if(e.startsWith("matrix(")){let t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}let e$={ignoreTransform:!1};function e_(e,t){void 0===t&&(t=e$);let r=e.getBoundingClientRect();if(t.ignoreTransform){let{transform:t,transformOrigin:n}=D(e).getComputedStyle(e);t&&(r=function(e,t,r){let n=eS(t);if(!n)return e;let{scaleX:a,scaleY:l,x:i,y:o}=n,s=e.left-i-(1-a)*parseFloat(r),c=e.top-o-(1-l)*parseFloat(r.slice(r.indexOf(" ")+1)),u=a?e.width/a:e.width,d=l?e.height/l:e.height;return{width:u,height:d,top:c,right:s+u,bottom:c+d,left:s}}(r,t,n))}let{top:n,left:a,width:l,height:i,bottom:o,right:s}=r;return{top:n,left:a,width:l,height:i,bottom:o,right:s}}function ek(e){return e_(e,{ignoreTransform:!0})}function eE(e,t){let r=[];return e?function n(a){var l,i;let o;if(null!=t&&r.length>=t||!a)return r;if(R(a)&&null!=a.scrollingElement&&!r.includes(a.scrollingElement))return r.push(a.scrollingElement),r;if(!A(a)||O(a)||r.includes(a))return r;let s=D(e).getComputedStyle(a);return(a!==e&&(void 0===(l=s)&&(l=D(a).getComputedStyle(a)),o=/(auto|scroll|overlay)/,["overflow","overflowX","overflowY"].some(e=>{let t=l[e];return"string"==typeof t&&o.test(t)}))&&r.push(a),void 0===(i=s)&&(i=D(a).getComputedStyle(a)),"fixed"===i.position)?r:n(a.parentNode)}(e):r}function eN(e){let[t]=eE(e,1);return null!=t?t:null}function eP(e){return N&&e?P(e)?e:T(e)?R(e)||e===L(e).scrollingElement?window:A(e)?e:null:null:null}function eT(e){return P(e)?e.scrollX:e.scrollLeft}function eD(e){return P(e)?e.scrollY:e.scrollTop}function eR(e){return{x:eT(e),y:eD(e)}}function eA(e){return!!N&&!!e&&e===document.scrollingElement}function eO(e){let t={x:0,y:0},r=eA(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},n={x:e.scrollWidth-r.width,y:e.scrollHeight-r.height},a=e.scrollTop<=t.y,l=e.scrollLeft<=t.x;return{isTop:a,isLeft:l,isBottom:e.scrollTop>=n.y,isRight:e.scrollLeft>=n.x,maxScroll:n,minScroll:t}}(lD=lU||(lU={}))[lD.Forward=1]="Forward",lD[lD.Backward=-1]="Backward";let eL={x:.2,y:.2};function eM(e){return e.reduce((e,t)=>W(e,eR(t)),ed)}function eI(e,t){if(void 0===t&&(t=e_),!e)return;let{top:r,left:n,bottom:a,right:l}=t(e);eN(e)&&(a<=0||l<=0||r>=window.innerHeight||n>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}let eF=[["x",["left","right"],function(e){return e.reduce((e,t)=>e+eT(t),0)}],["y",["top","bottom"],function(e){return e.reduce((e,t)=>e+eD(t),0)}]];class eB{constructor(e,t){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=eE(t),n=eM(r);for(const[t,a,l]of(this.rect={...e},this.width=e.width,this.height=e.height,eF))for(const e of a)Object.defineProperty(this,e,{get:()=>{let a=l(r),i=n[t]-a;return this.rect[e]+i},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class ez{constructor(e){this.target=void 0,this.listeners=[],this.removeAll=()=>
7{this.listeners.forEach(e=>{var t;return null==(t=this.target)?void 0:t.removeEventListener(...e)})},this.target=e}add(e,t,r){var n;null==(n=this.target)||n.addEventListener(e,t,r),this.listeners.push([e,t,r])}}function eU(e,t){let r=Math.abs(e.x),n=Math.abs(e.y);return"number"==typeof t?Math.sqrt(r**2+n**2)>t:"x"in t&&"y"in t?r>t.x&&n>t.y:"x"in t?r>t.x:"y"in t&&n>t.y}function eV(e){e.preventDefault()}function eH(e){e.stopPropagation()}(lR=lV||(lV={})).Click="click",lR.DragStart="dragstart",lR.Keydown="keydown",lR.ContextMenu="contextmenu",lR.Resize="resize",lR.SelectionChange="selectionchange",lR.VisibilityChange="visibilitychange",(lA=lH||(lH={})).Space="Space",lA.Down="ArrowDown",lA.Right="ArrowRight",lA.Left="ArrowLeft",lA.Up="ArrowUp",lA.Esc="Escape",lA.Enter="Enter",lA.Tab="Tab";let eq={start:[lH.Space,lH.Enter],cancel:[lH.Esc],end:[lH.Space,lH.Enter,lH.Tab]},eK=(e,t)=>{let{currentCoordinates:r}=t;switch(e.code){case lH.Right:return{...r,x:r.x+25};case lH.Left:return{...r,x:r.x-25};case lH.Down:return{...r,y:r.y+25};case lH.Up:return{...r,y:r.y-25}}};class eW{constructor(e){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=e;const{event:{target:t}}=e;this.props=e,this.listeners=new ez(L(t)),this.windowListeners=new ez(D(t)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(lV.Resize,this.handleCancel),this.windowListeners.add(lV.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(lV.Keydown,this.handleKeyDown))}handleStart(){let{activeNode:e,onStart:t}=this.props,r=e.node.current;r&&eI(r),t(ed)}handleKeyDown(e){if(Y(e)){let{active:t,context:r,options:n}=this.props,{keyboardCodes:a=eq,coordinateGetter:l=eK,scrollBehavior:i="smooth"}=n,{code:o}=e;if(a.end.includes(o))return void this.handleEnd(e);if(a.cancel.includes(o))return void this.handleCancel(e);let{collisionRect:s}=r.current,c=s?{x:s.left,y:s.top}:ed;this.referenceCoordinates||(this.referenceCoordinates=c);let u=l(e,{active:t,context:r.current,currentCoordinates:c});if(u){let t=G(u,c),n={x:0,y:0},{scrollableAncestors:a}=r.current;for(let r of a){let a=e.code,{isTop:l,isRight:o,isLeft:s,isBottom:c,maxScroll:d,minScroll:f}=eO(r),p=function(e){if(e===document.scrollingElement){let{innerWidth:e,innerHeight:t}=window;return{top:0,left:0,right:e,bottom:t,width:e,height:t}}let{top:t,left:r,right:n,bottom:a}=e.getBoundingClientRect();return{top:t,left:r,right:n,bottom:a,width:e.clientWidth,height:e.clientHeight}}(r),h={x:Math.min(a===lH.Right?p.right-p.width/2:p.right,Math.max(a===lH.Right?p.left:p.left+p.width/2,u.x)),y:Math.min(a===lH.Down?p.bottom-p.height/2:p.bottom,Math.max(a===lH.Down?p.top:p.top+p.height/2,u.y))},m=a===lH.Right&&!o||a===lH.Left&&!s,g=a===lH.Down&&!c||a===lH.Up&&!l;if(m&&h.x!==u.x){let e=r.scrollLeft+t.x,l=a===lH.Right&&e<=d.x||a===lH.Left&&e>=f.x;if(l&&!t.y)return void r.scrollTo({left:e,behavior:i});l?n.x=r.scrollLeft-e:n.x=a===lH.Right?r.scrollLeft-d.x:r.scrollLeft-f.x,n.x&&r.scrollBy({left:-n.x,behavior:i});break}if(g&&h.y!==u.y){let e=r.scrollTop+t.y,l=a===lH.Down&&e<=d.y||a===lH.Up&&e>=f.y;if(l&&!t.x)return void r.scrollTo({top:e,behavior:i});l?n.y=r.scrollTop-e:n.y=a===lH.Down?r.scrollTop-d.y:r.scrollTop-f.y,n.y&&r.scrollBy({top:-n.y,behavior:i});break}}this.handleMove(e,W(G(u,this.referenceCoordinates),n))}}}handleMove(e,t){let{onMove:r}=this.props;e.preventDefault(),r(t)}handleEnd(e){let{onEnd:t}=this.props;e.preventDefault(),this.detach(),t()}handleCancel(e){let{onCancel:t}=this.props;e.preventDefault(),this.detach(),t()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}function eG(e){return!!(e&&"distance"in e)}function eY(e){return!!(e&&"delay"in e)}eW.activators=[{eventName:"onKeyDown",handler:(e,t,r)=>{let{keyboardCodes:n=eq,onActivation:a}=t,{active:l}=r,{code:i}=e.nativeEvent;if(n.start.includes(i)){let t=l.activatorNode.current;return(!t||e.target===t)&&(e.preventDefault(),null==a||a({event:e.nativeEvent}),!0)}return!1}}];class eQ{constructor(e,t,r){var n;void 0===r&&(r=function(e){let{EventTarget:t}=D(e);return e instanceof t?e:L(e)}(e.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=e,this.events=t;const{event:a}=e,{target:l}=a;this.props=e,this.events=t,this.document=L(l),this.documentListeners=new ez(this.document),this.listeners=new ez(r),this.windowListeners=new ez(D(l)),this.initialCoordinates=null!=(n=Q(a))?n:ed,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){let{events:e,props:{options:{activationConstraint:t,bypassActivationConstraint:r}}}=this;if(this.listeners.add(e.move.name,this.handleMove,{passive:!1}),this.listeners.add(e.end.name,this.handleEnd),e.cancel&&this.listeners.add(e.cancel.name,this.handleCancel),this.windowListeners.add(lV.Resize,this.handleCancel),this.windowListeners.add(lV.DragStart,eV),this.windowListeners.add(lV.VisibilityChange,this.handleCancel),this.windowListeners.add(lV.ContextMenu,eV),this.documentListeners.add(lV.Keydown,this.handleKeydown),t){if(null!=r&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(eY(t)){this.timeoutId=setTimeout(this.handleStart,t.delay),this.handlePending(t);return}if(eG(t))return void this.handlePending(t)}
7this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),null!==this.timeoutId&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(e,t){let{active:r,onPending:n}=this.props;n(r,e,this.initialCoordinates,t)}handleStart(){let{initialCoordinates:e}=this,{onStart:t}=this.props;e&&(this.activated=!0,this.documentListeners.add(lV.Click,eH,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(lV.SelectionChange,this.removeTextSelection),t(e))}handleMove(e){var t;let{activated:r,initialCoordinates:n,props:a}=this,{onMove:l,options:{activationConstraint:i}}=a;if(!n)return;let o=null!=(t=Q(e))?t:ed,s=G(n,o);if(!r&&i){if(eG(i)){if(null!=i.tolerance&&eU(s,i.tolerance))return this.handleCancel();if(eU(s,i.distance))return this.handleStart()}return eY(i)&&eU(s,i.tolerance)?this.handleCancel():void this.handlePending(i,s)}e.cancelable&&e.preventDefault(),l(o)}handleEnd(){let{onAbort:e,onEnd:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleCancel(){let{onAbort:e,onCancel:t}=this.props;this.detach(),this.activated||e(this.props.active),t()}handleKeydown(e){e.code===lH.Esc&&this.handleCancel()}removeTextSelection(){var e;null==(e=this.document.getSelection())||e.removeAllRanges()}}let eX={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class eJ extends eQ{constructor(e){const{event:t}=e;super(e,eX,L(t.target))}}eJ.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;return!!r.isPrimary&&0===r.button&&(null==n||n({event:r}),!0)}}];let eZ={move:{name:"mousemove"},end:{name:"mouseup"}};(lO=lq||(lq={}))[lO.RightClick=2]="RightClick";class e0 extends eQ{constructor(e){super(e,eZ,L(e.event.target))}}e0.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t;return r.button!==lq.RightClick&&(null==n||n({event:r}),!0)}}];let e1={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class e2 extends eQ{constructor(e){super(e,e1)}static setup(){return window.addEventListener(e1.move.name,e,{capture:!1,passive:!1}),function(){window.removeEventListener(e1.move.name,e)};function e(){}}}e2.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:r}=e,{onActivation:n}=t,{touches:a}=r;return!(a.length>1)&&(null==n||n({event:r}),!0)}}],(lL=lK||(lK={}))[lL.Pointer=0]="Pointer",lL[lL.DraggableRect=1]="DraggableRect",(lM=lW||(lW={}))[lM.TreeOrder=0]="TreeOrder",lM[lM.ReversedTreeOrder=1]="ReversedTreeOrder";let e3={x:{[lU.Backward]:!1,[lU.Forward]:!1},y:{[lU.Backward]:!1,[lU.Forward]:!1}};(lI=lG||(lG={}))[lI.Always=0]="Always",lI[lI.BeforeDragging=1]="BeforeDragging",lI[lI.WhileDragging=2]="WhileDragging",(lY||(lY={})).Optimized="optimized";let e6=new Map;function e5(e,t){return z(r=>e?r||("function"==typeof t?t(e):e):null,[t,e])}function e4(e){let{callback:t,disabled:r}=e,n=I(t),a=(0,c.useMemo)(()=>{if(r||"u"<typeof window||void 0===window.ResizeObserver)return;let{ResizeObserver:e}=window;return new e(n)},[r]);return(0,c.useEffect)(()=>()=>null==a?void 0:a.disconnect(),[a]),a}function e8(e){return new eB(e_(e),e)}function e7(e,t,r){void 0===t&&(t=e8);let[n,a]=(0,c.useState)(null);function l(){a(n=>{if(!e)return null;if(!1===e.isConnected){var a;return null!=(a=null!=n?n:r)?a:null}let l=t(e);return JSON.stringify(n)===JSON.stringify(l)?n:l})}let i=function(e){let{callback:t,disabled:r}=e,n=I(t),a=(0,c.useMemo)(()=>{if(r||"u"<typeof window||void 0===window.MutationObserver)return;let{MutationObserver:e}=window;return new e(n)},[n,r]);return(0,c.useEffect)(()=>()=>null==a?void 0:a.disconnect(),[a]),a}({callback(t){if(e)for(let r of t){let{type:t,target:n}=r;if("childList"===t&&n instanceof HTMLElement&&n.contains(e)){l();break}}}}),o=e4({callback:l});return M(()=>{l(),e?(null==o||o.observe(e),null==i||i.observe(document.body,{childList:!0,subtree:!0})):(null==o||o.disconnect(),null==i||i.disconnect())},[e]),n}let e9=[];function te(e,t){void 0===t&&(t=[]);let r=(0,c.useRef)(null);return(0,c.useEffect)(()=>{r.current=null},t),(0,c.useEffect)(()=>{let t=e!==ed;t&&!r.current&&(r.current=e),!t&&r.current&&(r.current=null)},[e]),r.current?G(e,r.current):ed}function tt(e){return(0,c.useMemo)(()=>{let t,r;return e?(t=e.innerWidth,{top:0,left:0,right:t,bottom:r=e.innerHe
7ight,width:t,height:r}):null},[e])}let tr=[];function tn(e){if(!e)return null;if(e.children.length>1)return e;let t=e.children[0];return A(t)?t:e}let ta=[{sensor:eJ,options:{}},{sensor:eW,options:{}}],tl={current:{}},ti={draggable:{measure:ek},droppable:{measure:ek,strategy:lG.WhileDragging,frequency:lY.Optimized},dragOverlay:{measure:e_}};class to extends Map{get(e){var t;return null!=e&&null!=(t=super.get(e))?t:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(e=>{let{disabled:t}=e;return!t})}getNodeFor(e){var t,r;return null!=(t=null==(r=this.get(e))?void 0:r.node.current)?t:void 0}}let ts={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new to,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:es},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:ti,measureDroppableContainers:es,windowRect:null,measuringScheduled:!1},tc={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:es,draggableNodes:new Map,over:null,measureDroppableContainers:es},tu=(0,c.createContext)(tc),td=(0,c.createContext)(ts);function tf(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new to}}}function tp(e,t){switch(t.type){case lz.DragStart:return{...e,draggable:{...e.draggable,initialCoordinates:t.initialCoordinates,active:t.active}};case lz.DragMove:if(null==e.draggable.active)return e;return{...e,draggable:{...e.draggable,translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}}};case lz.DragEnd:case lz.DragCancel:return{...e,draggable:{...e.draggable,active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}}};case lz.RegisterDroppable:{let{element:r}=t,{id:n}=r,a=new to(e.droppable.containers);return a.set(n,r),{...e,droppable:{...e.droppable,containers:a}}}case lz.SetDroppableDisabled:{let{id:r,key:n,disabled:a}=t,l=e.droppable.containers.get(r);if(!l||n!==l.key)return e;let i=new to(e.droppable.containers);return i.set(r,{...l,disabled:a}),{...e,droppable:{...e.droppable,containers:i}}}case lz.UnregisterDroppable:{let{id:r,key:n}=t,a=e.droppable.containers.get(r);if(!a||n!==a.key)return e;let l=new to(e.droppable.containers);return l.delete(r),{...e,droppable:{...e.droppable,containers:l}}}default:return e}}function th(e){let{disabled:t}=e,{active:r,activatorEvent:n,draggableNodes:a}=(0,c.useContext)(tu),l=V(n),i=V(null==r?void 0:r.id);return(0,c.useEffect)(()=>{if(!t&&!n&&l&&null!=i){if(!Y(l)||document.activeElement===l.target)return;let e=a.get(i);if(!e)return;let{activatorNode:t,node:r}=e;(t.current||r.current)&&requestAnimationFrame(()=>{for(let e of[t.current,r.current]){if(!e)continue;let t=Z(e);if(t){t.focus();break}}})}},[n,t,a,i,l]),null}function tm(e,t){let{transform:r,...n}=t;return null!=e&&e.length?e.reduce((e,t)=>t({transform:e,...n}),r):r}let tg=(0,c.createContext)({...ed,scaleX:1,scaleY:1});(lF=lQ||(lQ={}))[lF.Uninitialized=0]="Uninitialized",lF[lF.Initializing=1]="Initializing",lF[lF.Initialized=2]="Initialized";let tb=(0,c.memo)(function(e){var t,r,n,a,l,i,o,s;let d,f,p,h,m,g,b,v,{id:y,accessibility:x,autoScroll:w=!0,children:C,sensors:j=ta,collisionDetection:S=ex,measuring:$,modifiers:_,...k}=e,[E,P]=(0,c.useReducer)(tp,void 0,tf),[T,R]=function(){let[e]=(0,c.useState)(()=>new Set),t=(0,c.useCallback)(t=>(e.add(t),()=>e.delete(t)),[e]);return[(0,c.useCallback)(t=>{let{type:r,event:n}=t;e.forEach(e=>{var t;return null==(t=e[r])?void 0:t.call(e,n)})},[e]),t]}(),[O,L]=(0,c.useState)(lQ.Uninitialized),I=O===lQ.Initialized,{draggable:{active:H,nodes:K,translate:G},droppable:{containers:Y}}=E,X=null!=H?K.get(H):null,J=(0,c.useRef)({initial:null,translated:null}),Z=(0,c.useMemo)(()=>{var e;return null!=H?{id:H,data:null!=(e=null==X?void 0:X.data)?e:tl,rect:J}:null},[H,X]),ee=(0,c.useRef)(null),[et,er]=(0,c.useState)(null),[ea,el]=(0,c.useState)(null),ei=B(k,Object.values(k)),es=q("DndDescribedBy",y),ec=(0,c.useMemo)(()=>Y.getEnabled(),[Y]),eu=(0,c.useMemo)(()=>({draggable:{...ti.draggable,...null==$?void 0:$.draggable},droppable:{...ti.droppable,...null==$?void 0:$.droppable},dragOverlay:{...ti.dragOverlay,...null==$?void 0:$.dragOverlay}}),[null==$?void 0:$.draggable,null==$?void 0:$.droppable,null==$?void 0:$.dragOverlay]),{droppableRects:ef,measureDroppableContainers:ep,measuringScheduled:eh}=function(e,t){let{dragging:r,dependencies:n,config:a}=t,[l,i]=(0,c.useState)(null),{frequency:o,measure:s,strategy:u}=a,d=(0,c.useRef)(e),f=function(){switch(u){case lG.Always:return!1;case lG.BeforeDragging:return r;default:return!r}}(),p=B(f),h=(0,c.useCallback)(function(e){void 0===e&&(e=[]),p.current||i(t=>null===t?e:t.concat(e.filter(e=>!t.includes(e))))}
7,[p]),m=(0,c.useRef)(null),g=z(t=>{if(f&&!r)return e6;if(!t||t===e6||d.current!==e||null!=l){let t=new Map;for(let r of e){if(!r)continue;if(l&&l.length>0&&!l.includes(r.id)&&r.rect.current){t.set(r.id,r.rect.current);continue}let e=r.node.current,n=e?new eB(s(e),e):null;r.rect.current=n,n&&t.set(r.id,n)}return t}return t},[e,l,r,f,s]);return(0,c.useEffect)(()=>{d.current=e},[e]),(0,c.useEffect)(()=>{f||h()},[r,f]),(0,c.useEffect)(()=>{l&&l.length>0&&i(null)},[JSON.stringify(l)]),(0,c.useEffect)(()=>{f||"number"!=typeof o||null!==m.current||(m.current=setTimeout(()=>{h(),m.current=null},o))},[o,f,h,...n]),{droppableRects:g,measureDroppableContainers:h,measuringScheduled:null!=l}}(ec,{dragging:I,dependencies:[G.x,G.y],config:eu.droppable}),em=z(e=>{var t;return null==H?null:null!=(t=null!=m?m:e)?t:null},[m=(h=null!=H?K.get(H):void 0)?h.node.current:null,H]),eb=(0,c.useMemo)(()=>ea?Q(ea):null,[ea]),ev=(d=(null==et?void 0:et.autoScrollEnabled)===!1,f="object"==typeof w?!1===w.enabled:!1===w,p=I&&!d&&!f,"object"==typeof w?{...w,enabled:p}:{enabled:p}),ey=e5(em,eu.draggable.measure);!function(e){let{activeNode:t,measure:r,initialRect:n,config:a=!0}=e,l=(0,c.useRef)(!1),{x:i,y:o}="boolean"==typeof a?{x:a,y:a}:a;M(()=>
7{if(!i&&!o||!t){l.current=!1;return}if(l.current||!n)return;let e=null==t?void 0:t.node.current;if(!e||!1===e.isConnected)return;let a=eC(r(e),n);if(i||(a.x=0),o||(a.y=0),l.current=!0,Math.abs(a.x)>0||Math.abs(a.y)>0){let t=eN(e);t&&t.scrollBy({top:a.y,left:a.x})}},[t,i,o,n,r])}({activeNode:null!=H?K.get(H):null,config:ev.layoutShiftCompensation,initialRect:ey,measure:eu.draggable.measure});let ew=e7(em,eu.draggable.measure,ey),eS=e7(em?em.parentElement:null),e$=(0,c.useRef)({activatorEvent:null,active:null,activeNode:em,collisionRect:null,collisions:null,droppableRects:ef,draggableNodes:K,draggingNode:null,draggingNodeRect:null,droppableContainers:Y,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),ek=Y.getNodeFor(null==(t=e$.current.over)?void 0:t.id),eT=function(e){let{measure:t}=e,[r,n]=(0,c.useState)(null),a=e4({callback:(0,c.useCallback)(e=>{for(let{target:r}of e)if(A(r)){n(e=>{let n=t(r);return e?{...e,width:n.width,height:n.height}:n});break}},[t])}),[l,i]=U((0,c.useCallback)(e=>{let r=tn(e);null==a||a.disconnect(),r&&(null==a||a.observe(r)),n(r?t(r):null)},[t,a]));return(0,c.useMemo)(()=>({nodeRef:l,rect:r,setRef:i}),[r,l,i])}({measure:eu.dragOverlay.measure}),eD=null!=(r=eT.nodeRef.current)?r:em,eI=I?null!=(n=eT.rect)?n:ew:null,eF=!!(eT.nodeRef.current&&eT.rect),ez=(g=e5(l=eF?null:ew),eC(l,g)),eU=tt(eD?D(eD):null),eV=(i=I?null!=ek?ek:em:null,b=(0,c.useRef)(i),v=z(e=>i?e&&e!==e9&&i&&b.current&&i.parentNode===b.current.parentNode?e:eE(i):e9,[i]),(0,c.useEffect)(()=>{b.current=i},[i]),v),eH=function(e,t){void 0===t&&(t=e_);let[r]=e,n=tt(r?D(r):null),[a,l]=(0,c.useState)(tr);function i(){l(()=>e.length?e.map(e=>eA(e)?n:new eB(t(e),e)):tr)}let o=e4({callback:i});return M(()=>{null==o||o.disconnect(),i(),e.forEach(e=>null==o?void 0:o.observe(e))},[e]),a}(eV),eq=tm(_,{transform:{x:G.x-ez.x,y:G.y-ez.y,scaleX:1,scaleY:1},activatorEvent:ea,active:Z,activeNodeRect:ew,containerNodeRect:eS,draggingNodeRect:eI,over:e$.current.over,overlayNodeRect:eT.rect,scrollableAncestors:eV,scrollableAncestorRects:eH,windowRect:eU}),eK=eb?W(eb,G):null,eW=function(e){let[t,r]=(0,c.useState)(null),n=(0,c.useRef)(e),a=(0,c.useCallback)(e=>{let t=eP(e.target);t&&r(e=>e?(e.set(t,eR(t)),new Map(e)):null)},[]);return(0,c.useEffect)(()=>{let t=n.current;if(e!==t){l(t);let i=e.map(e=>{let t=eP(e);return t?(t.addEventListener("scroll",a,{passive:!0}),[t,eR(t)]):null}).filter(e=>null!=e);r(i.length?new Map(i):null),n.current=e}return()=>{l(e),l(t)};function l(e){e.forEach(e=>{let t=eP(e);null==t||t.removeEventListener("scroll",a)})}},[a,e]),(0,c.useMemo)(()=>e.length?t?Array.from(t.values()).reduce((e,t)=>W(e,t),ed):eM(e):ed,[e,t])}(eV),eG=te(eW),eY=te(eW,[ew]),eQ=W(eq,eG),eX=eI?ej(eI,eq):null,eJ=Z&&eX?S({active:Z,collisionRect:eX,droppableRects:ef,droppableContainers:ec,pointerCoordinates:eK}
7):null,eZ=eg(eJ,"id"),[e0,e1]=(0,c.useState)(null),e2=(o=eF?eq:W(eq,eY),s=null!=(a=null==e0?void 0:e0.rect)?a:null,{...o,scaleX:s&&ew?s.width/ew.width:1,scaleY:s&&ew?s.height/ew.height:1}),e8=(0,c.useRef)(null),to=(0,c.useCallback)((e,t)=>{let{sensor:r,options:n}=t;if(null==ee.current)return;let a=K.get(ee.current);if(!a)return;let l=e.nativeEvent,i=new r({active:ee.current,activeNode:a,event:l,options:n,context:e$,onAbort(e){if(!K.get(e))return;let{onDragAbort:t}=ei.current,r={id:e};null==t||t(r),T({type:"onDragAbort",event:r})},onPending(e,t,r,n){if(!K.get(e))return;let{onDragPending:a}=ei.current,l={id:e,constraint:t,initialCoordinates:r,offset:n};null==a||a(l),T({type:"onDragPending",event:l})},onStart(e){let t=ee.current;if(null==t)return;let r=K.get(t);if(!r)return;let{onDragStart:n}=ei.current,a={activatorEvent:l,active:{id:t,data:r.data,rect:J}};(0,u.unstable_batchedUpdates)(()=>{null==n||n(a),L(lQ.Initializing),P({type:lz.DragStart,initialCoordinates:e,active:t}),T({type:"onDragStart",event:a}),er(e8.current),el(l)})},onMove(e){P({type:lz.DragMove,coordinates:e})},onEnd:o(lz.DragEnd),onCancel:o(lz.DragCancel)});function o(e){return async function(){let{active:t,collisions:r,over:n,scrollAdjustedTranslate:a}=e$.current,i=null;if(t&&a){let{cancelDrop:o}=ei.current;i={activatorEvent:l,active:t,collisions:r,delta:a,over:n},e===lz.DragEnd&&"function"==typeof o&&await Promise.resolve(o(i))&&(e=lz.DragCancel)}ee.current=null,(0,u.unstable_batchedUpdates)(()=>{P({type:e}),L(lQ.Uninitialized),e1(null),er(null),el(null),e8.current=null;let t=e===lz.DragEnd?"onDragEnd":"onDragCancel";if(i){let e=ei.current[t];null==e||e(i),T({type:t,event:i})}})}}e8.current=i},[K]),ts=(0,c.useCallback)((e,t)=>(r,n)=>{let a=r.nativeEvent,l=K.get(n);null!==ee.current||!l||a.dndKit||a.defaultPrevented||!0===e(r,t.options,{active:l})&&(a.dndKit={capturedBy:t.sensor},ee.current=n,to(r,t))},[K,to]),tc=(0,c.useMemo)(()=>j.reduce((e,t)=>{let{sensor:r}=t;return[...e,...r.activators.map(e=>({eventName:e.eventName,handler:ts(e.handler,t)}))]},[]),[j,ts]);(0,c.useEffect)(()=>{if(!N)return;let e=j.map(e=>{let{sensor:t}=e;return null==t.setup?void 0:t.setup()});return()=>{for(let t of e)null==t||t()}},j.map(e=>{let{sensor:t}=e;return t})),M(()=>{ew&&O===lQ.Initializing&&L(lQ.Initialized)},[ew,O]),(0,c.useEffect)(()=>{let{onDragMove:e}=ei.current,{active:t,activatorEvent:r,collisions:n,over:a}=e$.current;if(!t||!r)return;let l={active:t,activatorEvent:r,collisions:n,delta:{x:eQ.x,y:eQ.y},over:a};(0,u.unstable_batchedUpdates)(()=>{null==e||e(l),T({type:"onDragMove",event:l})})},[eQ.x,eQ.y]),(0,c.useEffect)(()=>{let{active:e,activatorEvent:t,collisions:r,droppableContainers:n,scrollAdjustedTranslate:a}=e$.current;if(!e||null==ee.current||!t||!a)return;let{onDragOver:l}=ei.current,i=n.get(eZ),o=i&&i.rect.current?{id:i.id,rect:i.rect.current,data:i.data,disabled:i.disabled}:null,s={active:e,activatorEvent:t,collisions:r,delta:{x:a.x,y:a.y},over:o};(0,u.unstable_batchedUpdates)(()=>{e1(o),null==l||l(s),T({type:"onDragOver",event:s})})},[eZ]),M(()=>{e$.current={activatorEvent:ea,active:Z,activeNode:em,collisionRect:eX,collisions:eJ,droppableRects:ef,draggableNodes:K,draggingNode:eD,draggingNodeRect:eI,droppableContainers:Y,over:e0,scrollableAncestors:eV,scrollAdjustedTranslate:eQ},J.current={initial:eI,translated:eX}},[Z,em,eJ,eX,K,eD,eI,ef,Y,e0,eV,eQ]),function(e){let{acceleration:t,activator:r=lK.Pointer,canScroll:n,draggingRect:a,enabled:l,interval:i=5,order:o=lW.TreeOrder,pointerCoordinates:s,scrollableAncestors:u,scrollableAncestorRects:d,delta:f,threshold:p}=e,h=function(e){let{delta:t,disabled:r}=e,n=V(t);return z(e=>{if(r||!n||!e)return e3;let a={x:Math.sign(t.x-n.x),y:Math.sign(t.y-n.y)};return{x:{[lU.Backward]:e.x[lU.Backward]||-1===a.x,[lU.Forward]:e.x[lU.Forward]||1===a.x},y:{[lU.Backward]:e.y[lU.Backward]||-1===a.y,[lU.Forward]:e.y[lU.Forward]||1===a.y}}},[r,t,n])}({delta:f,disabled:!l}),[m,g]=F(),b=(0,c.useRef)({x:0,y:0}),v=(0,c.useRef)({x:0,y:0}),y=(0,c.useMemo)(()=>{switch(r){case lK.Pointer:return s?{top:s.y,bottom:s.y,left:s.x,right:s.x}:null;case lK.DraggableRect:return a}},[r,a,s]),x=(0,c.useRef)(null),w=(0,c.useCallback)(()=>{let e=x.current;if(!e)return;let t=b.current.x*v.current.x,r=b.current.y*v.current.y;e.scrollBy(t,r)},[]),C=(0,c.useMemo)(()=>o===lW.TreeOrder?[...u].reverse():u,[o,u]);(0,c.useEffect)(()=>
7{if(!l||!u.length||!y)return void g();for(let e of C){if((null==n?void 0:n(e))===!1)continue;let r=d[u.indexOf(e)];if(!r)continue;let{direction:a,speed:l}=function(e,t,r,n,a){let{top:l,left:i,right:o,bottom:s}=r;void 0===n&&(n=10),void 0===a&&(a=eL);let{isTop:c,isBottom:u,isLeft:d,isRight:f}=eO(e),p={x:0,y:0},h={x:0,y:0},m={height:t.height*a.y,width:t.width*a.x};return!c&&l<=t.top+m.height?(p.y=lU.Backward,h.y=n*Math.abs((t.top+m.height-l)/m.height)):!u&&s>=t.bottom-m.height&&(p.y=lU.Forward,h.y=n*Math.abs((t.bottom-m.height-s)/m.height)),!f&&o>=t.right-m.width?(p.x=lU.Forward,h.x=n*Math.abs((t.right-m.width-o)/m.width)):!d&&i<=t.left+m.width&&(p.x=lU.Backward,h.x=n*Math.abs((t.left+m.width-i)/m.width)),{direction:p,speed:h}}(e,r,y,t,p);for(let e of["x","y"])h[e][a[e]]||(l[e]=0,a[e]=0);if(l.x>0||l.y>0){g(),x.current=e,m(w,i),b.current=l,v.current=a;return}}b.current={x:0,y:0},v.current={x:0,y:0},g()},[t,w,n,g,l,i,JSON.stringify(y),JSON.stringify(h),m,u,C,d,JSON.stringify(p)])}({...ev,delta:G,draggingRect:eX,pointerCoordinates:eK,scrollableAncestors:eV,scrollableAncestorRects:eH});let tb=(0,c.useMemo)(()=>({active:Z,activeNode:em,activeNodeRect:ew,activatorEvent:ea,collisions:eJ,containerNodeRect:eS,dragOverlay:eT,draggableNodes:K,droppableContainers:Y,droppableRects:ef,over:e0,measureDroppableContainers:ep,scrollableAncestors:eV,scrollableAncestorRects:eH,measuringConfiguration:eu,measuringScheduled:eh,windowRect:eU}),[Z,em,ew,ea,eJ,eS,eT,K,Y,ef,e0,ep,eV,eH,eu,eh,eU]),tv=(0,c.useMemo)(()=>({activatorEvent:ea,activators:tc,active:Z,activeNodeRect:ew,ariaDescribedById:{draggable:es},dispatch:P,draggableNodes:K,over:e0,measureDroppableContainers:ep}),[ea,tc,Z,ew,P,es,K,e0,ep]);return c.default.createElement(en.Provider,{value:R},c.default.createElement(tu.Provider,{value:tv},c.default.createElement(td.Provider,{value:tb},c.default.createElement(tg.Provider,{value:e2},C)),c.default.createElement(th,{disabled:(null==x?void 0:x.restoreFocus)===!1})),c.default.createElement(eo,{...x,hiddenTextDescribedById:es}))}),tv=(0,c.createContext)(null),ty="button";function tx(e){let{id:t,data:r,disabled:n=!1,attributes:a}=e,l=q("Draggable"),{activators:i,activatorEvent:o,active:s,activeNodeRect:u,ariaDescribedById:d,draggableNodes:f,over:p}=(0,c.useContext)(tu),{role:h=ty,roleDescription:m="draggable",tabIndex:g=0}=null!=a?a:{},b=(null==s?void 0:s.id)===t,v=(0,c.useContext)(b?tg:tv),[y,x]=U(),[w,C]=U(),j=(0,c.useMemo)(()=>i.reduce((e,r)=>{let{eventName:n,handler:a}=r;return e[n]=e=>{a(e,t)},e},{}),[i,t]),S=B(r);return M(()=>(f.set(t,{id:t,key:l,node:y,activatorNode:w,data:S}),()=>{let e=f.get(t);e&&e.key===l&&f.delete(t)}),[f,t]),{active:s,activatorEvent:o,activeNodeRect:u,attributes:(0,c.useMemo)(()=>({role:h,tabIndex:g,"aria-disabled":n,"aria-pressed":!!b&&h===ty||void 0,"aria-roledescription":m,"aria-describedby":d.draggable}),[n,h,g,b,m,d.draggable]),isDragging:b,listeners:n?void 0:j,node:y,over:p,setNodeRef:x,setActivatorNodeRef:C,transform:v}}function tw(){return(0,c.useContext)(td)}let tC={timeout:25};function tj(e){let{data:t,disabled:r=!1,id:n,resizeObserverConfig:a}=e,l=q("Droppable"),{active:i,dispatch:o,over:s,measureDroppableContainers:u}=(0,c.useContext)(tu),d=(0,c.useRef)({disabled:r}),f=(0,c.useRef)(!1),p=(0,c.useRef)(null),h=(0,c.useRef)(null),{disabled:m,updateMeasurementsFor:g,timeout:b}={...tC,...a},v=B(null!=g?g:n),y=e4({callback:(0,c.useCallback)(()=>{if(!f.current){f.current=!0;return}null!=h.current&&clearTimeout(h.current),h.current=setTimeout(()=>{u(Array.isArray(v.current)?v.current:[v.current]),h.current=null},b)},[b]),disabled:m||!i}),[x,w]=U((0,c.useCallback)((e,t)=>{y&&(t&&(y.unobserve(t),f.current=!1),e&&y.observe(e))},[y])),C=B(t);return(0,c.useEffect)(()=>{y&&x.current&&(y.disconnect(),f.current=!1,y.observe(x.current))},[x,y]),(0,c.useEffect)(()=>(o({type:lz.RegisterDroppable,element:{id:n,key:l,disabled:r,node:x,rect:p,data:C}}),()=>o({type:lz.UnregisterDroppable,key:l,id:n})),[n]),(0,c.useEffect)(()=>{r!==d.current.disabled&&(o({type:lz.SetDroppableDisabled,id:n,key:l,disabled:r}),d.current.disabled=r)},[n,l,r,o]),{active:i,rect:p,isOver:(null==s?void 0:s.id)===n,node:x,over:s,setNodeRef:w}}function tS(e){let{animation:t,children:r}=e,[n,a]=(0,c.useState)(null),[l,i]=(0,c.useState)(null),o=V(r);
7return r||n||!o||a(o),M(()=>{if(!l)return;let e=null==n?void 0:n.key,r=null==n?void 0:n.props.id;null==e||null==r?a(null):Promise.resolve(t(r,l)).then(()=>{a(null)})},[t,n,l]),c.default.createElement(c.default.Fragment,null,r,n?(0,c.cloneElement)(n,{ref:i}):null)}let t$={x:0,y:0,scaleX:1,scaleY:1};function t_(e){let{children:t}=e;return c.default.createElement(tu.Provider,{value:tc},c.default.createElement(tg.Provider,{value:t$},t))}let tk={position:"fixed",touchAction:"none"},tE=e=>Y(e)?"transform 250ms ease":void 0,tN=(0,c.forwardRef)((e,t)=>{let{as:r,activatorEvent:n,adjustScale:a,children:l,className:i,rect:o,style:s,transform:u,transition:d=tE}=e;if(!o)return null;let f=a?u:{...u,scaleX:1,scaleY:1},p={...tk,width:o.width,height:o.height,top:o.top,left:o.left,transform:X.Transform.toString(f),transformOrigin:a&&n?function(e,t){let r=Q(e);if(!r)return"0 0";let n={x:(r.x-t.left)/t.width*100,y:(r.y-t.top)/t.height*100};return n.x+"% "+n.y+"%"}(n,o):void 0,transition:"function"==typeof d?d(n):d,...s};return c.default.createElement(r,{className:i,style:p,ref:t},l)}),tP={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:t,final:r}}=e;return[{transform:X.Transform.toString(t)},{transform:X.Transform.toString(r)}]},sideEffects:(t={styles:{active:{opacity:"0"}}},e=>{let{active:r,dragOverlay:n}=e,a={},{styles:l,className:i}=t;if(null!=l&&l.active)for(let[e,t]of Object.entries(l.active))void 0!==t&&(a[e]=r.node.style.getPropertyValue(e),r.node.style.setProperty(e,t));if(null!=l&&l.dragOverlay)for(let[e,t]of Object.entries(l.dragOverlay))void 0!==t&&n.node.style.setProperty(e,t);return null!=i&&i.active&&r.node.classList.add(i.active),null!=i&&i.dragOverlay&&n.node.classList.add(i.dragOverlay),function(){for(let[e,t]of Object.entries(a))r.node.style.setProperty(e,t);null!=i&&i.active&&r.node.classList.remove(i.active)}})},tT=0,tD=c.default.memo(e=>{var t;let{adjustScale:r=!1,children:n,dropAnimation:a,style:l,transition:i,modifiers:o,wrapperElement:s="div",className:u,zIndex:d=999}=e,{activatorEvent:f,active:p,activeNodeRect:h,containerNodeRect:m,draggableNodes:g,droppableContainers:b,dragOverlay:v,over:y,measuringConfiguration:x,scrollableAncestors:w,scrollableAncestorRects:C,windowRect:j}=tw(),S=(0,c.useContext)(tg),$=(t=null==p?void 0:p.id,(0,c.useMemo)(()=>{if(null!=t)return++tT},[t])),_=tm(o,{activatorEvent:f,active:p,activeNodeRect:h,containerNodeRect:m,draggingNodeRect:v.rect,over:y,overlayNodeRect:v.rect,scrollableAncestors:w,scrollableAncestorRects:C,transform:S,windowRect:j}),k=e5(h),E=function(e){let{config:t,draggableNodes:r,droppableContainers:n,measuringConfiguration:a}=e;return I((e,l)=>{if(null===t)return;let i=r.get(e);if(!i)return;let o=i.node.current;if(!o)return;let s=tn(l);if(!s)return;let{transform:c}=D(l).getComputedStyle(l),u=eS(c);if(!u)return;let d="function"==typeof t?t:function(e){let{duration:t,easing:r,sideEffects:n,keyframes:a}={...tP,...e};return e=>{let{active:l,dragOverlay:i,transform:o,...s}=e;if(!t)return;let c={x:i.rect.left-l.rect.left,y:i.rect.top-l.rect.top},u={scaleX:1!==o.scaleX?l.rect.width*o.scaleX/i.rect.width:1,scaleY:1!==o.scaleY?l.rect.height*o.scaleY/i.rect.height:1},d={x:o.x-c.x,y:o.y-c.y,...u},f=a({...s,active:l,dragOverlay:i,transform:{initial:o,final:d}}),[p]=f,h=f[f.length-1];if(JSON.stringify(p)===JSON.stringify(h))return;let m=null==n?void 0:n({active:l,dragOverlay:i,...s}),g=i.node.animate(f,{duration:t,easing:r,fill:"forwards"});return new Promise(e=>{g.onfinish=()=>{null==m||m(),e()}})}}(t);return eI(o,a.draggable.measure),d({active:{id:e,data:i.data,node:o,rect:a.draggable.measure(o)},draggableNodes:r,dragOverlay:{node:l,rect:a.dragOverlay.measure(s)},droppableContainers:n,measuringConfiguration:a,transform:u})})}({config:a,draggableNodes:g,droppableContainers:b,measuringConfiguration:x}),N=k?v.setRef:void 0;return c.default.createElement(t_,null,c.default.createElement(tS,{animation:E},p&&$?c.default.createElement(tN,{key:$,id:p.id,ref:N,as:s,activatorEvent:f,adjustScale:r,className:u,transition:i,rect:k,style:{zIndex:d,...l},transform:_},n):null))});e.s(["DndContext",0,tb,"DragOverlay",0,tD,"KeyboardCode",0,lH,"KeyboardSensor",0,eW,"MouseSensor",0,e0,"TouchSensor",0,e2,"closestCenter",0,ev,"closestCorners",0,ey,"getClientRect",0,e_,"getFirstCollision",0,eg,"getScrollableAncestors",0,eE,"pointerWithin",0,ew,"rectIntersection",0,ex,"useDndContext",0,tw,"useDndMonitor",0,ea,"useDraggable",0,tx,"useDroppable",0,tj,"useSensor",0,ec,"useSensors",0,eu],720247);let tR=e=>{let{adminRoute:t,apiRoute:r,includeBasePath:n,path:a="",relative:l=!1,serverURL:i}=e,s=o.default.env.NEXT_BASE_PATH||e.basePath||"",c=t||r,u=[c&&"/"!==c&&c,a&&a].filter(
7Boolean).join("")||"/",d=(s+u).replace(/\/$/,"")||"/";if(l||!i)return(n??!t)&&s?d:u;let f=new URL(i);return new URL(d,f.origin).toString()};e.s(["formatAdminURL",0,tR],214316);let tA=String.prototype.replace,tO=/%20/g,tL="RFC3986",tM="RFC1738";e.s(["RFC1738",0,tM,"RFC3986",0,tL,"default",0,tL,"formatters",0,{RFC1738:function(e){return tA.call(e,tO,"+")},RFC3986:function(e){return String(e)}}],115410);let tI=Object.prototype.hasOwnProperty,tF=Array.isArray,tB=function(){let e=[];for(let t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),tz=function(e){for(;e.length>1;){let t=e.pop(),r=t.obj[t.prop];if(tF(r)){let e=[];for(let t=0;t<r.length;++t)void 0!==r[t]&&e.push(r[t]);t.obj[t.prop]=e}}},tU=function(e,t){let r=t&&t.plainObjects?Object.create(null):{};for(let t=0;t<e.length;++t)void 0!==e[t]&&(r[t]=e[t]);return r},tV=function e(t,r,n){if(!r)return t;if("object"!=typeof r){if(tF(t))t.push(r);else{if(!t||"object"!=typeof t)return[t,r];(n&&(n.plainObjects||n.allowPrototypes)||!tI.call(Object.prototype,r))&&(t[r]=!0)}return t}if(!t||"object"!=typeof t)return[t].concat(r);let a=t;return(tF(t)&&!tF(r)&&(a=tU(t,n)),tF(t)&&tF(r))?(r.forEach(function(r,a){if(tI.call(t,a)){let l=t[a];l&&"object"==typeof l&&r&&"object"==typeof r?t[a]=e(l,r,n):t.push(r)}else t[a]=r}),t):Object.keys(r).reduce(function(t,a){let l=r[a];return tI.call(t,a)?t[a]=e(t[a],l,n):t[a]=l,t},a)},tH=function(e){let t=[{obj:{o:e},prop:"o"}],r=[];for(let e=0;e<t.length;++e){let n=t[e],a=n.obj[n.prop],l=Object.keys(a);for(let e=0;e<l.length;++e){let n=l[e],i=a[n];"object"==typeof i&&null!==i&&-1===r.indexOf(i)&&(t.push({obj:a,prop:n}),r.push(i))}}return tz(t),e},tq=function(e,t){if(tF(e)){let r=[];for(let n=0;n<e.length;n+=1)r.push(t(e[n]));return r}return t(e)};var tK=e.i(115410);let tW=Object.prototype.hasOwnProperty,tG={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},tY=Array.isArray,tQ=Array.prototype.push,tX=function(e,t){tQ.apply(e,tY(t)?t:[t])},tJ=Date.prototype.toISOString,tZ=tK.default,t0={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:function(e,t,r,n,a){if(0===e.length)return e;let l=e;if("symbol"==typeof e?l=Symbol.prototype.toString.call(e):"string"!=typeof e&&(l=String(e)),"iso-8859-1"===r)return escape(l).replace(/%u[0-9a-f]{4}/gi,function(e){return"%26%23"+parseInt(e.slice(2),16)+"%3B"});let i="";for(let e=0;e<l.length;e+=1024){let t=l.length>=1024?l.slice(e,e+1024):l,r=[];for(let e=0;e<t.length;++e){let n=t.charCodeAt(e);if(45===n||46===n||95===n||126===n||n>=48&&n<=57||n>=65&&n<=90||n>=97&&n<=122||a===tM&&(40===n||41===n)){r[r.length]=t.charAt(e);continue}if(n<128){r[r.length]=tB[n];continue}if(n<2048){r[r.length]=tB[192|n>>6]+tB[128|63&n];continue}if(n<55296||n>=57344){r[r.length]=tB[224|n>>12]+tB[128|n>>6&63]+tB[128|63&n];continue}e+=1,n=65536+((1023&n)<<10|1023&t.charCodeAt(e)),r[r.length]=tB[240|n>>18]+tB[128|n>>12&63]+tB[128|n>>6&63]+tB[128|63&n]}i+=r.join("")}return i},encodeValuesOnly:!1,format:tZ,formatter:tK.formatters[tZ],indices:!1,serializeDate:function(e){return tJ.call(e)},skipNulls:!1,strictNullHandling:!1},t1={},t2=function(e,t,r,n,a,l,i,o,s,c,u,d,f,p,h,m,g,b){var v,y;let x,w=e,C=b,j=0,S=!1;for(;void 0!==(C=C.get(t1))&&!S;){let t=C.get(e);if(j+=1,void 0!==t)if(t===j)throw RangeError("Cyclic object value");else S=!0;void 0===C.get(t1)&&(j=0)}if("function"==typeof c?w=c(t,w):w instanceof Date?w=f(w):"comma"===r&&tY(w)&&(w=tq(w,function(e){return e instanceof Date?f(e):e})),null===w){if(l)return s&&!m?s(t,t0.encoder,g,"key",p):t;w=""}if("string"==typeof(v=w)||"number"==typeof v||"boolean"==typeof v||"symbol"==typeof v||"bigint"==typeof v||(y=w)&&"object"==typeof y&&y.constructor&&y.constructor.isBuffer&&y.constructor.isBuffer(y))return s?[h(m?t:s(t,t0.encoder,g,"key",p))+"="+h(s(w,t0.encoder,g,"value",p))]:[h(t)+"="+h(String(w))];let $=[];if(void 0===w)return $;if("comma"===r&&tY(w))m&&s&&(w=tq(w,s)),x=[{value:w.length>0?w.join(",")||null:void 0}];else if(tY(c))x=c;else{let e=Object.keys(w);x=u?e.sort(u):e}let _=o?t.replace(/\./g,"%2E"):t,k=n&&tY(w)&&1===w.length?_+"[]":_;if(a&&tY(w)&&0===w.length)return k+"[]";for(let t=0;t<x.length;++t){let v=x[t],y="object"==typeof v&&void 0!==v.value?v.value:w[v];if(i&&null===y)continue;let C=d&&o?v.replace(/\./g,"%2E"):v,S=tY(w)?"function"==typeof r?r(k,C):k:k+(d?"."+C:"["+C+"]");b.set(e,j);let _=new WeakMap;_.set(t1,b),tX($,t2(y,S,r,n,a,l,i,o,"comma"===r&&m&&tY(w)?null:s,c,u,d,f,p,h,m,g,_))}return $},t3=function(e){let t;if(!e)return t0;if(void 0!==e.allowEmptyArrays&&"boolean"!=typeof e.allowEmptyArrays)throw TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");
7if(void 0!==e.encodeDotInKeys&&"boolean"!=typeof e.encodeDotInKeys)throw TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(null!==e.encoder&&void 0!==e.encoder&&"function"!=typeof e.encoder)throw TypeError("Encoder has to be a function.");let r=e.charset||t0.charset;if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");let n=tK.default;if(void 0!==e.format){if(!tW.call(tK.formatters,e.format))throw TypeError("Unknown format option provided.");n=e.format}let a=tK.formatters[n],l=t0.filter;if(("function"==typeof e.filter||tY(e.filter))&&(l=e.filter),t=e.arrayFormat in tG?e.arrayFormat:"indices"in e?e.indices?"indices":"repeat":t0.arrayFormat,"commaRoundTrip"in e&&"boolean"!=typeof e.commaRoundTrip)throw TypeError("`commaRoundTrip` must be a boolean, or absent");let i=void 0===e.allowDots?!0===e.encodeDotInKeys||t0.allowDots:!!e.allowDots;return{addQueryPrefix:"boolean"==typeof e.addQueryPrefix?e.addQueryPrefix:t0.addQueryPrefix,allowDots:i,allowEmptyArrays:"boolean"==typeof e.allowEmptyArrays?!!e.allowEmptyArrays:t0.allowEmptyArrays,arrayFormat:t,charset:r,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:t0.charsetSentinel,commaRoundTrip:e.commaRoundTrip,delimiter:void 0===e.delimiter?t0.delimiter:e.delimiter,encode:"boolean"==typeof e.encode?e.encode:t0.encode,encodeDotInKeys:"boolean"==typeof e.encodeDotInKeys?e.encodeDotInKeys:t0.encodeDotInKeys,encoder:"function"==typeof e.encoder?e.encoder:t0.encoder,encodeValuesOnly:"boolean"==typeof e.encodeValuesOnly?e.encodeValuesOnly:t0.encodeValuesOnly,filter:l,format:n,formatter:a,serializeDate:"function"==typeof e.serializeDate?e.serializeDate:t0.serializeDate,skipNulls:"boolean"==typeof e.skipNulls?e.skipNulls:t0.skipNulls,sort:"function"==typeof e.sort?e.sort:null,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:t0.strictNullHandling}};function t6(e,t){let r,n=e,a=t3(t);"function"==typeof a.filter?n=(0,a.filter)("",n):tY(a.filter)&&(r=a.filter);let l=[];if("object"!=typeof n||null===n)return"";let i=tG[a.arrayFormat],o="comma"===i&&a.commaRoundTrip;r||(r=Object.keys(n)),a.sort&&r.sort(a.sort);let s=new WeakMap;for(let e=0;e<r.length;++e){let t=r[e];a.skipNulls&&null===n[t]||tX(l,t2(n[t],t,i,o,a.allowEmptyArrays,a.strictNullHandling,a.skipNulls,a.encodeDotInKeys,a.encode?a.encoder:null,a.filter,a.sort,a.allowDots,a.serializeDate,a.format,a.formatter,a.encodeValuesOnly,a.charset,s))}let c=l.join(a.delimiter),u=!0===a.addQueryPrefix?"?":"";return a.charsetSentinel&&("iso-8859-1"===a.charset?u+="utf8=%26%2310003%3B&":u+="utf8=%E2%9C%93&"),c.length>0?u+c:""}e.s(["stringify",0,t6],763591);let t5=["ar","fa","he"];var t4=Object.prototype.hasOwnProperty;function t8(e,t){var r,n;if(e===t)return!0;if(e&&t&&(r=e.constructor)===t.constructor){if(r===Date)return e.getTime()===t.getTime();if(r===RegExp)return e.toString()===t.toString();if(r===Array){if((n=e.length)===t.length)for(;n--&&t8(e[n],t[n]););return -1===n}if(!r||"object"==typeof e){for(r in n=0,e)if(t4.call(e,r)&&++n&&!t4.call(t,r)||!(r in t)||!t8(e[r],t[r]))return!1;return Object.keys(t).length===n}}return e!=e&&t!=t}function t7({field:e,index:t,parentIndexPath:r,parentPath:n="",parentSchemaPath:a}){let l=n.split("."),i=l?.[l.length-1]?.startsWith("_index-"),o=i?l.slice(0,-1).join("."):n,s=i?o:n;if("name"in e)return{indexPath:"",path:`${s?s+".":""}${e.name}`,schemaPath:`${a?a+".":""}${e.name}`};let c=`_index-${r?r+"-":""}${t}`,u=a.split(".");return{indexPath:`${r?r+"-":""}${t}`,path:`${s?s+".":""}${c}`,schemaPath:u?.[u.length-1]?.startsWith("_index-")?`${a}-${t}`:`${a?a+".":""}${c}`}}let t9=({collectionPermissions:e,field:t,operation:r,parentName:n,permissions:a})=>{let l=!0===a||a?.[r]===!0||a?.[n]===!0||"name"in t&&"object"==typeof a&&a?.[t.name]&&(!0===a[t.n
7ame]||r in a[t.name]&&a[t.name][r]),i=null==a||!0===a||("name"in t?a[t.name]:a),o=!0===a||a?.read===!0||a?.[n]===!0||"name"in t&&"object"==typeof a&&a?.[t.name]&&(!0===a[t.name]||"read"in a[t.name]&&a[t.name].read);if(!(!0===a||"object"==typeof a&&null!==a&&Object.keys(a).length>0)&&e){let t=!!e.read,n=!1;return"create"===r&&"create"in e?n=!!e.create:"update"===r&&(n=!!e.update),{operation:n,permissions:{read:t},read:t}}return{operation:!!l,permissions:i,read:!!o}};function re(e=[],t){let{i18n:r,keepPresentationalFields:n,labelPrefix:a,moveSubFieldsToTop:l=!1,pathPrefix:i}="boolean"==typeof t?{keepPresentationalFields:t}:t??{};return e.reduce((e,o)=>{if("group"===o.type&&"fields"in o)if(l){let t="name"in o&&"string"==typeof o.name&&!!o.name,s="name"in o?o.name:void 0,c="label"in o&&o.label&&r?m(o.label,r):void 0,u=a?`${a} > ${c??s}`:c??s,d="name"in o&&o.name?i?`${i}.${o.name}`:o.name:i;e.push(o,...re(o.fields,{i18n:r,keepPresentationalFields:n,labelPrefix:t?u:a,moveSubFieldsToTop:l,pathPrefix:t?d:i}))}else _(o)?e.push(o):e.push(...re(o.fields,t));else if("tabs"===o.type&&"tabs"in o)return[...e,...o.tabs.reduce((e,o)=>{if(!k(o))return[...e,...re(o.fields,t)];if(!l)return[...e,{...o,type:"tab"}];{let t="label"in o&&o.label&&r?m(o.label,r):void 0,s=a?`${a} > ${t??o.name}`:t??o.name,c=o.name?i?`${i}.${o.name}`:o.name:i;return[...e,...re(o.fields,{i18n:r,keepPresentationalFields:n,labelPrefix:s,moveSubFieldsToTop:l,pathPrefix:c})]}},[])];else if(y(o)&&["collapsible","row"].includes(o.type))e.push(...re(o.fields,t));else if(_(o)||n&&C(o)){if("id"===o.name&&void 0!==a)return e;let t="label"in o&&o.label&&r?m(o.label,r):void 0,n="name"in o?o.name:void 0,s=void 0!==i||void 0!==a;e.push({...o,...l&&s&&{accessor:i&&n?`${i}.${n}`:n??"",labelWithPrefix:a?`${a} > ${t??n}`:t??n}})}return e},[])}let rt=e=>0===Object.keys(e).length,rr=(e,t)=>rt(t)?e:rt(e)?t:("and"in e&&e.and?e.and.push(t):("or"in e,e={and:[e,t]}),e),rn=({collectionConfig:e,search:t,where:r={}})=>{if(t){let n={...r||{}},a=(e.admin.listSearchableFields||[e.admin?.useAsTitle||"id"]).map(e=>({[e]:{like:t}}));a.length>0&&(n=rr(n,{or:a})),rt(n)||(r=n)}return r};e.s(["hoistQueryParamsToAnd",0,rr,"mergeListSearchAndWhere",0,rn],219365);let ra=e=>{if(!e)return;let t=e;if("string"==typeof e)try{t=JSON.parse(e)}catch(t){console.error("Error parsing columns",e,t)}if(t&&Array.isArray(t))return t.map(e=>{if("string"==typeof e){let t="-"!==e[0];return{accessor:t?e:e.slice(1),active:t}}return{accessor:e.accessor,active:e.active}})},rl=e=>e?.map(e=>e.active?e.accessor:`-${e.accessor}`),ri=Object.prototype.hasOwnProperty,ro=Array.isArray,rs={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:function(e,t,r){let n=e.replace(/\+/g," ");if("iso-8859-1"===r)return n.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(n)}catch(e){return n}},delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictNullHandling:!1},rc=function(e,t){return e&&"string"==typeof e&&t.comma&&e.indexOf(",")>-1?e.split(","):e},ru=function(e,t){let r,n={__proto__:null},a=t.ignoreQueryPrefix?e.replace(/^\?/,""):e,l=t.parameterLimit===1/0?void 0:t.parameterLimit,i=a.split(t.delimiter,l),o=-1,s=t.charset;if(t.charsetSentinel)for(r=0;r<i.length;++r)0===i[r].indexOf("utf8=")&&("utf8=%E2%9C%93"===i[r]?s="utf-8":"utf8=%26%2310003%3B"===i[r]&&(s="iso-8859-1"),o=r,r=i.length);for(r=0;r<i.length;++r){let e,a;if(r===o)continue;let l=i[r],c=l.indexOf("]="),u=-1===c?l.indexOf("="):c+1;-1===u?(e=t.decoder(l,rs.decoder,s,"key"),a=t.strictNullHandling?null:""):(e=t.decoder(l.slice(0,u),rs.decoder,s,"key"),a=tq(rc(l.slice(u+1),t),function(e){return t.decoder(e,rs.decoder,s,"value")})),a&&t.interpretNumericEntities&&"iso-8859-1"===s&&(a=a.replace(/&#(\d+);/g,function(e,t){return String.fromCharCode(parseInt(t,10))})),l.indexOf("[]=")>-1&&(a=ro(a)?[a]:a);let d=ri.call(n,e);if(d&&"combine"===t.duplicates)n[e]=[].concat(n[e],a);else d&&"last"!==t.duplicates||(n[e]=a)}return n},rd=function(e,t,r,n){let a=n?t:rc(t,r);for(let t=e.length-1;t>=0;--t){let n,l=e[t];if("[]"===l&&r.parseArrays)n=r.allowEmptyArrays&&""===a?[]:[].concat(a);else{n=r.plainObjects?Object.create(null):{};let e="["===l.charAt(0)&&"]"===l.charAt(l.length-1)?l.slice(1,-1):l,t=r.decodeDotInKeys?e.replace(/%2E/g,"."):e,i=parseInt(t,10);r.parseArrays||""!==t?!isNaN(i)&&l!==t&&String(i)===t&&i>=0&&r.parseArrays&&i<=r.arrayLimit?(n=[])[i]=a:"__proto__"!==t&&(n[t]=a):n={0:a}}a=n}return a},rf=function(e,t,r,n){if(!e)return;let a=r.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,l=/(\[[^[\]]*])/g,i=r.depth>0&&/(\[[^[\]]*])/.exec(a),o=i?a.slice(0,i.index):a,s=[];if(o){if(!r.plainObjects&&ri.call(Object.prototype,o)&&!r.allowPrototypes)return;s.push(o)}let c=0;for(;r.depth>0&&null!==(i=l.exec(a))&&c<r.depth;
7){if(c+=1,!r.plainObjects&&ri.call(Object.prototype,i[1].slice(1,-1))&&!r.allowPrototypes)return;s.push(i[1])}return i&&s.push("["+a.slice(i.index)+"]"),rd(s,t,r,n)},rp=function(e){var t;if(!e)return rs;if(void 0!==e.allowEmptyArrays&&"boolean"!=typeof e.allowEmptyArrays)throw TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(void 0!==e.decodeDotInKeys&&"boolean"!=typeof e.decodeDotInKeys)throw TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(null!==e.decoder&&void 0!==e.decoder&&"function"!=typeof e.decoder)throw TypeError("Decoder has to be a function.");if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");let r=void 0===e.charset?rs.charset:e.charset,n=void 0===e.duplicates?rs.duplicates:e.duplicates;if("combine"!==n&&"first"!==n&&"last"!==n)throw TypeError("The duplicates option must be either combine, first, or last");return{allowDots:void 0===e.allowDots?!0===e.decodeDotInKeys||rs.allowDots:!!e.allowDots,allowEmptyArrays:"boolean"==typeof e.allowEmptyArrays?!!e.allowEmptyArrays:rs.allowEmptyArrays,allowPrototypes:"boolean"==typeof e.allowPrototypes?e.allowPrototypes:rs.allowPrototypes,allowSparse:"boolean"==typeof e.allowSparse?e.allowSparse:rs.allowSparse,arrayLimit:"number"==typeof e.arrayLimit?e.arrayLimit:rs.arrayLimit,charset:r,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:rs.charsetSentinel,comma:"boolean"==typeof e.comma?e.comma:rs.comma,decodeDotInKeys:"boolean"==typeof e.decodeDotInKeys?e.decodeDotInKeys:rs.decodeDotInKeys,decoder:"function"==typeof e.decoder?e.decoder:rs.decoder,delimiter:"string"==typeof e.delimiter||(t=e.delimiter,"[object RegExp]"===Object.prototype.toString.call(t))?e.delimiter:rs.delimiter,depth:"number"==typeof e.depth||!1===e.depth?+e.depth:rs.depth,duplicates:n,ignoreQueryPrefix:!0===e.ignoreQueryPrefix,interpretNumericEntities:"boolean"==typeof e.interpretNumericEntities?e.interpretNumericEntities:rs.interpretNumericEntities,parameterLimit:"number"==typeof e.parameterLimit?e.parameterLimit:rs.parameterLimit,parseArrays:!1!==e.parseArrays,plainObjects:"boolean"==typeof e.plainObjects?e.plainObjects:rs.plainObjects,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:rs.strictNullHandling}};function rh(e,t){let r=rp(t);if(""===e||null==e)return r.plainObjects?Object.create(null):{};let n="string"==typeof e?ru(e,r):e,a=r.plainObjects?Object.create(null):{},l=Object.keys(n);for(let t=0;t<l.length;++t){let i=l[t];a=tV(a,rf(i,n[i],r,"string"==typeof e),r)}return!0===r.allowSparse?a:tH(a)}let rm=({sizes:e,targetSizeMax:t=180,targetSizeMin:r=40,thumbnailURL:n,url:a,width:l})=>n||e&&Object.values(e).reduce((e,n)=>!n.width||n.width<r?e:n.width>=r&&n.width<=t?!e.width||n.width<e.width||e.width<r||e.width>t?n:e:!e.width||!e.original&&e.width<r&&n.width>e.width||e.width>t&&n.width<e.width?n:e,{original:!0,url:a,width:l}).url||a;function rg(e){return["image/jpeg","image/png","image/gif","image/svg+xml","image/webp","image/avif","image/jxl"].indexOf(e)>-1}function rb(e){return null!=e&&("string"!=typeof e||""!==e.trim())&&!Number.isNaN(Number(e))}let rv=e=>!!(e?.versions&&"object"==typeof e.versions&&e.versions.drafts),ry=e=>!!(e?.versions&&"object"==typeof e.versions&&e.versions.drafts&&"object"==typeof e.versions.drafts&&e.versions.drafts.localizeStatus),rx=e=>!!(e?.versions&&"object"==typeof e.versions&&e.versions.drafts&&"object"==typeof e.versions.drafts&&e.versions.drafts.autosave),rw=e=>!!(e?.versions&&"object"==typeof e.versions&&e.versions.drafts&&"object"==typeof e.versions.drafts&&e.versions.drafts.validate),rC=e=>!!(e?.versions&&"object"==typeof e.versions&&e.versions.drafts&&"object"==typeof e.versions.drafts&&e.versions.drafts.schedulePublish),rj=e=>{let t=2e3;return e?.versions&&"object"==typeof e.versions&&e.versions.drafts&&"object"==typeof e.versions.drafts&&e.versions.drafts.autosave&&"object"==typeof e.versions.drafts.autosave&&(t=e.versions.drafts.autosave.interval??2e3),t};e.s(["getAutosaveInterval",0,rj,"hasAutosaveEnabled",0,rx,"hasDraftValidationEnabled",0,rw,"hasDraftsEnabled",0,rv,"hasLocalizeStatusEnabled",0,ry,"hasScheduledPublishEnabled",0,rC],571167);let rS=new Map;rS.set(Date,e=>new Date(e)),rS.set(Map,(e,t)=>new Map(r_(Array.from(e),t))),rS.set(Set,(e,t)=>new Set(r_(Array.from(e),t))),rS.set(RegExp,e=>new RegExp(e.source,e.flags));let r$=null;function r_(e,t){let r=Object.keys(e),n=Array(r.length);for(let l=0;l<r.length;l++){var a;let i=r[l],o=e[i];"object"!=typeof o||null===o?n[i]=o:o instanceof RegExp?n[i]=new RegExp(o.source,o.flags):o.constructor!==Object&&(r$=rS.get(o.constructor))?n[i]=r$(o,t):ArrayBuffer.isView(o)?n[i]=(a=o)instanceof s.Buffer?s.Buffer.from(a):new a.constructor(a.buffer.slice(),a.byteOffset,a.length):n[i]=t(o)}return n}function rk(e,t={}){if("object"!=typeof e||null===e||!("$$typeof"in e)||"symbol"!=typeof e.$$typeof){if("object"!=typeof e||null===e)return e;if(Array.isArray(e))return e.map(e=>
7"object"!=typeof e||null===e?e:rk(e,t));if(e instanceof File){if(t.excludeFiles)return;return e}if(e instanceof Date)return new Date(e);let r={};for(let n in e){let a=e[n];r[n]="object"!=typeof a||null===a?a:rk(a,t)}return r}}let rE=(e,t)=>{let r=(t=t||{}).delimiter||".",n=t.overwrite||!1,a=t.recursive||!1,l={};if(null!=e&&null!=e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)||"[object Object]"!==Object.prototype.toString.call(e))return e;let i=e=>{let r=Number(e);return isNaN(r)||-1!==e.indexOf(".")||t.object?e:r};return Object.keys(e).sort((e,t)=>e.length-t.length).forEach(o=>{let s=o.split(r),c=i(s.shift()),u=i(s[0]),d=l;for(;void 0!==u;){if("__proto__"===c)return;let e=Object.prototype.toString.call(d[c]),r="[object Object]"===e||"[object Array]"===e;if(!n&&!r&&void 0!==d[c])return;(!n||r)&&(n||null!=d[c])||(d[c]="number"!=typeof u||t.object?{}:[]),d=d[c],s.length>0&&(c=i(s.shift()),u=i(s[0]))}d[c]=a?rE(e[o],t):e[o]}),l},rN=(e,t,r)=>{let n={};return e&&(Object.keys(e).forEach(t=>{!0!==r&&e[t]?.disableFormData||(n[t]=e[t]?.value)}),t&&(n=rE(n))),n};async function rP(e){return new Promise(t=>{setTimeout(t,e)})}let rT=(e,t)=>0===t.length||t.map(e=>e.replace("*","")).some(t=>e.startsWith(t)),rD=e=>"string"==typeof e||"number"==typeof e?e:e.id;function rR(e,t=0){if(0===e)return"0 bytes";let r=Math.floor(Math.log(e)/Math.log(1024));return`${parseFloat((e/1024**r).toFixed(t<0?0:t))}${[" bytes","KB","MB","GB","TB","PB","EB","ZB","YB"][r]}`}e.i(34705);var rA=e.i(756961);let rO="default"in rA.default?rA.default.default:rA.default,rL="default"in rA.default?rA.default.default:rA.default,rM=(e,{hasMany:t,maxLength:r,maxRows:n,minLength:a,minRows:l,req:{payload:{config:i},t:o},required:s})=>{let c;if(!s&&null==e)return!0;if(!0===t){let t=rU(e,{maxRows:n,minRows:l,required:s,t:o});if("string"==typeof t)return t}for(let t of("number"==typeof i?.defaultMaxTextLength&&(c=i.defaultMaxTextLength),"number"==typeof r&&(c=r),Array.isArray(e)?e:[e])){let e=t?.length||0;if("number"==typeof c&&e>c)return o("validation:shorterThanMax",{label:o("general:value"),maxLength:c,stringValue:t});if("number"==typeof a&&e<a)return o("validation:longerThanMin",{label:o("general:value"),minLength:a,stringValue:t})}return!(s&&(!e||("string"==typeof e||Array.isArray(e))&&0===e.length))||o("validation:required")},rI=(e,{maxLength:t,minLength:r=3,req:{payload:{config:n},t:a},required:l})=>{let i;return("number"==typeof n?.defaultMaxTextLength&&(i=n.defaultMaxTextLength),"number"==typeof t&&(i=t),e&&i&&e.length>i)?a("validation:shorterThanMax",{maxLength:i}):e&&r&&e.length<r?a("validation:longerThanMin",{minLength:r}):!l||!!e||a("validation:required")},rF=(e,{req:{t:t},required:r,siblingData:n})=>r&&!e?t("validation:required"):!e||e===n.password||t("fields:passwordsDoNotMatch"),rB=(e,{collectionSlug:t,req:{payload:{collections:r,config:n},t:a},required:l,siblingData:i})=>{if(t){let l=r?.[t]?.config??n.collections.find(({slug:e})=>e===t);if(l.auth.loginWithUsername&&!l.auth.loginWithUsername?.requireUsername&&!l.auth.loginWithUsername?.requireEmail&&!e&&!i?.username)return a("validation:required")}return(!e||!!/^(?!.*\.\.)[\w!#$%&'*+/=?^`{|}~-](?:[\w!#$%&'*+/=?^`{|}~.-]*[\w!#$%&'*+/=?^`{|}~-])?@[a-z0-9](?:[a-z0-9-]*[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)*\.[a-z]{2,}$/i.test(e))&&(!!e||!l)||a("validation:emailAddress")},rz=(e,{collectionSlug:t,req:{payload:{collections:r,config:n},t:a},required:l,siblingData:i})=>{let o;if(t){let l=r?.[t]?.config??n.collections.find(({slug:e})=>e===t);if(l.auth.loginWithUsername&&!l.auth.loginWithUsername?.requireUsername&&!l.auth.loginWithUsername?.requireEmail&&!e&&!i?.email)return a("validation:required")}return("number"==typeof n?.defaultMaxTextLength&&(o=n.defaultMaxTextLength),e&&o&&e.length>o)?a("validation:shorterThanMax",{maxLength:o}):!!e||!l||a("validation:required")},rU=(e,t)=>{let{maxRows:r,minRows:n,required:a,t:l}=t,i=Array.isArray(e)?e.length:e||0;return!a&&0===i||(n&&i<n?l("validation:requiresAtLeast",{count:n,label:l("general:rows")}):r&&i>r?l("validation:requiresNoMoreThan",{count:r,label:l("general:rows")}):!a||!!i||l("validation:requiresAtLeast",{count:1,label:l("general:row")}))};e.s(["confirmPassword",0,rF,"email",0,rB,"password",0,rI,"text",0,rM,"username",0,rz],527434);let rV=(e,t)=>e.size===t.size&&[...e].every(e=>t.has(e)),{isPlural:rH,singular:rq}=e.i(286264).default,rK=(e,t=!1)=>{let r=(e||"").trim().split(/[\s-]/),n=[];
7return r.forEach(e=>{if(""!==e){let t=e.split(/(?=[A-Z])/).join(" ");n.push(t.charAt(0).toUpperCase()+t.slice(1))}}),t?n.join("").replace(/\s/g,""):n.join(" ")},rW=new Set(["equals","contains","not_equals","in","all","not_in","exists","greater_than","greater_than_equal","less_than","less_than_equal","like","not_like","within","intersects","near"]),rG=e=>!!(e?.or&&(e?.or?.length===0||e?.or?.length>0&&e?.or?.[0]?.and&&e?.or?.[0]?.and?.length>0))&&e.or.every(e=>!!(e.and&&Array.isArray(e.and))&&e.and.every(e=>{if("object"!=typeof e)return!1;let t=Object.keys(e);if(0===t.length)return!1;for(let r of t){let t=Object.keys(e[r])[0];if(!t||!rW.has(t))return!1}return!0})),rY={BROWSE_BY_FOLDER:"browse-by-folder",DASHBOARD_LAYOUT:"dashboard-layout",NAV:"nav"};function rQ(e,t="and"){if(0===e.length)return{};let r=e.reduce((e,r)=>(r&&"object"==typeof r&&Object.keys(r).length>0&&(t in r?e[t]=[...e[t],...r[t]]:e[t]?.push(r)),e),{[t]:[]});return r[t]?.length===0?{}:r}e.s(["PREFERENCE_KEYS",0,rY],545464);var rX=(0,p.c)(e=>{function t(e,t){var r=e.length;for(e.push(t);0<r;){var n=r-1>>>1,l=e[n];if(0<a(l,t))e[n]=t,e[r]=l,r=n;else break}}function r(e){return 0===e.length?null:e[0]}function n(e){if(0===e.length)return null;var t=e[0],r=e.pop();if(r!==t){e[0]=r;for(var n=0,l=e.length,i=l>>>1;n<i;){var o=2*(n+1)-1,s=e[o],c=o+1,u=e[c];if(0>a(s,r))c<l&&0>a(u,s)?(e[n]=u,e[c]=r,n=c):(e[n]=s,e[o]=r,n=o);else if(c<l&&0>a(u,r))e[n]=u,e[c]=r,n=c;else break}}return t}function a(e,t){var r=e.sortIndex-t.sortIndex;return 0!==r?r:e.id-t.id}e.unstable_now=void 0,"object"==typeof performance&&"function"==typeof performance.now?(s=performance,e.unstable_now=function(){return s.now()}):(u=(c=Date).now(),e.unstable_now=function(){return c.now()-u});var l,i,o,s,c,u,d=[],f=[],p=1,h=null,m=3,g=!1,b=!1,v=!1,y="function"==typeof setTimeout?setTimeout:null,x="function"==typeof clearTimeout?clearTimeout:null,w="u">typeof setImmediate?setImmediate:null;function C(e){for(var a=r(f);null!==a;){if(null===a.callback)n(f);else if(a.startTime<=e)n(f),a.sortIndex=a.expirationTime,t(d,a);else break;a=r(f)}}function j(e){if(v=!1,C(e),!b)if(null!==r(d))b=!0,P();else{var t=r(f);null!==t&&T(j,t.startTime-e)}}var S=!1,$=-1,_=5,k=-1;function E(){return!(e.unstable_now()-k<_)}function N(){if(S){var t=e.unstable_now();k=t;var a=!0;try{e:{b=!1,v&&(v=!1,x($),$=-1),g=!0;var i=m;try{t:{for(C(t),h=r(d);null!==h&&!(h.expirationTime>t&&E());){var o=h.callback;if("function"==typeof o){h.callback=null,m=h.priorityLevel;var s=o(h.expirationTime<=t);if(t=e.unstable_now(),"function"==typeof s){h.callback=s,C(t),a=!0;break t}h===r(d)&&n(d),C(t)}else n(d);h=r(d)}if(null!==h)a=!0;else{var c=r(f);null!==c&&T(j,c.startTime-t),a=!1}}break e}finally{h=null,m=i,g=!1}}}finally{a?l():S=!1}}}function P(){S||(S=!0,l())}function T(t,r){$=y(function(){t(e.unstable_now())},r)}"function"==typeof w?l=function(){w(N)}:"u">typeof MessageChannel?(o=(i=new MessageChannel).port2,i.port1.onmessage=N,l=function(){o.postMessage(null)}):l=function(){y(N,0)},e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_continueExecution=function(){b||g||(b=!0,P())},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):_=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return m},e.unstable_getFirstCallbackNode=function(){return r(d)},e.unstable_next=function(e){switch(m){case 1:case 2:case 3:var t=3;break;default:t=m}var r=m;m=t;try{return e()}finally{m=r}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var r=m;m=e;try{return t()}finally{m=r}},e.unstable_scheduleCallback=function(n,a,l){var i=e.unstable_now();switch(l="object"==typeof l&&null!==l&&"number"==typeof(l=l.delay)&&0<l?i+l:i,n){case 1:var o=-1;break;case 2:o=250;break;case 5:o=0x3fffffff;break;case 4:o=1e4;break;default:o=5e3}return o=l+o,n={id:p++,callback:a,priorityLevel:n,startTime:l,expirationTime:o,sortIndex:-1},l>i?(n.sortIndex=l,t(f,n),null===r(d)&&n===r(f)&&(v?(x($),$=-1):v=!0,T(j,l-i))):(n.sortIndex=o,t(d,n),b||g||(b=!0,P())),n},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=m;return function(){var r=m;m=t;try{return e.apply(this,arguments)}finally{m=r}}}}),rJ=(0,p.c)((e,t)=>{t.exports=rX()}),rZ=(0,p.c)((e,t)=>
7{var r=Math.floor(0xffffff*Math.random()),n=p.index=parseInt(0xffffff*Math.random(),10),a=(typeof o.default>"u"||"number"!=typeof o.default.pid?Math.floor(1e5*Math.random()):o.default.pid)%65535,l=(()=>{try{return _Buffer}catch{try{return s.Buffer}catch{return null}}})(),i=function(e){return!!(null!=e&&e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e))},c=[];for(u=0;u<256;u++)c[u]=(u<=15?"0":"")+u.toString(16);var u,d=RegExp("^[0-9a-fA-F]{24}$"),f=[];for(u=0;u<10;)f[48+u]=u++;for(;u<16;)f[55+u]=f[87+u]=u++;function p(e){if(!(this instanceof p))return new p(e);if(e&&(e instanceof p||"ObjectID"===e._bsontype))return e;if(this._bsontype="ObjectID",null==e||"number"==typeof e){this.id=this.generate(e);return}var t=p.isValid(e);if(!t&&null!=e)throw Error("Argument passed in must be a single String of 12 bytes or a string of 24 hex characters");if(t&&"string"==typeof e&&24===e.length)return p.createFromHexString(e);if(null!=e&&12===e.length)this.id=e;else{if(null!=e&&"function"==typeof e.toHexString)return e;throw Error("Argument passed in must be a single String of 12 bytes or a string of 24 hex characters")}}t.exports=p,p.default=p,p.createFromTime=function(e){var t;return new p((8===(t=(t=e=parseInt(e,10)%0xffffffff).toString(16)).length?t:"00000000".substring(t.length,8)+t)+"0000000000000000")},p.createFromHexString=function(e){if(typeof e>"u"||null!=e&&24!==e.length)throw Error("Argument passed in must be a single String of 12 bytes or a string of 24 hex characters");for(var t="",r=0;r<24;)t+=String.fromCharCode(f[e.charCodeAt(r++)]<<4|f[e.charCodeAt(r++)]);return new p(t)},p.isValid=function(e){return null!=e&&("number"==typeof e||("string"==typeof e?12===e.length||24===e.length&&d.test(e):e instanceof p||(i(e)?p.isValid(e.toString("hex")):"function"==typeof e.toHexString&&!!l&&(e.id instanceof l||"string"==typeof e.id)&&(12===e.id.length||24===e.id.length&&d.test(e.id)))))},p.prototype={constructor:p,toHexString:function(){if(!this.id||!this.id.length)throw Error("invalid ObjectId, ObjectId.id must be either a string or a Buffer, but is ["+JSON.stringify(this.id)+"]");if(24===this.id.length)return this.id;if(i(this.id))return this.id.toString("hex");for(var e="",t=0;t<this.id.length;t++)e+=c[this.id.charCodeAt(t)];return e},equals:function(e){return e instanceof p?this.toString()===e.toString():"string"==typeof e&&p.isValid(e)&&12===e.length&&i(this.id)?e===this.id.toString("binary"):"string"==typeof e&&p.isValid(e)&&24===e.length?e.toLowerCase()===this.toHexString():"string"==typeof e&&p.isValid(e)&&12===e.length?e===this.id:null!=e&&(e instanceof p||!!e.toHexString)&&e.toHexString()===this.toHexString()},getTimestamp:function(){var e,t=new Date;return e=i(this.id)?this.id[3]|this.id[2]<<8|this.id[1]<<16|this.id[0]<<24:this.id.charCodeAt(3)|this.id.charCodeAt(2)<<8|this.id.charCodeAt(1)<<16|this.id.charCodeAt(0)<<24,t.setTime(1e3*Math.floor(e)),t},generate:function(e){"number"!=typeof e&&(e=~~(Date.now()/1e3)),e=parseInt(e,10)%0xffffffff;var t=n=(n+1)%0xffffff;return String.fromCharCode(e>>24&255,e>>16&255,e>>8&255,255&e,r>>16&255,r>>8&255,255&r,a>>8&255,255&a,t>>16&255,t>>8&255,255&t)}};var h=Symbol&&Symbol.for&&Symbol.for("nodejs.util.inspect.custom")||"inspect";p.prototype[h]=function(){return"ObjectID("+this+")"},p.prototype.toJSON=p.prototype.toHexString,p.prototype.toString=p.prototype.toHexString}),r0=(0,p.c)(e=>{var t="function"==typeof Symbol&&Symbol.for,r=t?Symbol.for("react.element"):60103,n=t?Symbol.for("react.portal"):60106,a=t?Symbol.for("react.fragment"):60107,l=t?Symbol.for("react.strict_mode"):60108,i=t?Symbol.for("react.profiler"):60114,o=t?Symbol.for("react.provider"):60109,s=t?Symbol.for("react.context"):60110,c=t?Symbol.for("react.async_mode"):60111,u=t?Symbol.for("react.concurrent_mode"):60111,d=t?Symbol.for("react.forward_ref"):60112,f=t?Symbol.for("react.suspense"):60113,p=t?Symbol.for("react.suspense_list"):60120,h=t?Symbol.for("react.memo"):60115,m=t?Symbol.for("react.lazy"):60116,g=t?Symbol.for("react.block"):60121,b=t?Symbol.for("react.fundamental"):60117,v=t?Symbol.for("react.responder"):60118,y=t?Symbol.for("react.scope"):60119;function x(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case r:switch(e=e.type){case c:case u:case a:case i:case l:case f:return e;default:switch(e=e&&e.$$typeof){case s:case d:case m:case h:case o:return e;default:return t}}case n:return t}}}function w(e){return x(e)===u}e.AsyncMode=c,e.ConcurrentMode=u,e.ContextConsumer=s,e.ContextProvider=o,e.Element=r,e.ForwardRef=d,e.Fragment=a,e.Lazy=m,e.Memo=h,e.Portal=n,e.Profiler=i,e.StrictMode=l,e.Suspense=f,e.isAsyncMode=function(e){return w(e)||x(e)===c},e.isConcurrentMode=w,e.isContextConsumer=function(e){return x(e)===s},e.isContextProvider=function(e){return x(e)===o},e.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===r},e.isForwardRef=function(e){return x(e)===d},e.isFragment=function(e){return x(e)===a},e.isLazy=function(e){return x(e)===m},e.isMemo=function(e){return x(e)===h},e.isPortal=function(e){return x(e)===n},e.isProfiler=function(e){return x(e)===i},e.isStrictMode=function(e){return x(e)===l},e.isSuspense=function(e){return x(e)===f},e.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===a||e===u||e===i||e===l||e===f||e===p||"object"==typeof e&&null!==e&&(e.$$typeof===m||e.$$typeof===h||e.$$typeof===o||e.$$typeof===s||e.$$typeof===d||e.$$typeof===b||e.$$typeof===v||e.$$typeof===y||e.$$typeof===g)},e.typeOf=x}),r1=(0,p.c)((e,t)=>{t.exports=r0()}),r2=(0,p.c)((e,t)=>{var r=r1(),n={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},a={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},l={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},i={};function o(e){return r.isMemo(e)?l:i[e.$$typeof]||n}i[r.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},i[r.Memo]=l;var s=Object.defineProperty,c=Object.getOwnPropertyNames,u=Object.getOwnPropertySymbols,d=Object.getOwnPropertyDescriptor,f=Object.getPrototypeOf,p=Object.prototype;
7t.exports=function e(t,r,n){if("string"!=typeof r){if(p){var l=f(r);l&&l!==p&&e(t,l,n)}var i=c(r);u&&(i=i.concat(u(r)));for(var h=o(t),m=o(r),g=0;g<i.length;++g){var b=i[g];if(!a[b]&&!(n&&n[b])&&!(m&&m[b])&&!(h&&h[b])){var v=d(r,b);try{s(t,b,v)}catch{}}}}return t}}),r3=(0,p.c)((e,t)=>{function r(e){return void 0===e}function n(e){return e===Object(e)}function a(e){return Array.isArray(e)}function l(e,t){return t?n(e)&&!r(e.uri):n(e)&&"number"==typeof e.size&&"string"==typeof e.type&&"function"==typeof e.slice}function i(e){return!r(e)&&e}t.exports={serialize:function e(t,o,s,c){o=o||{},s=s||new FormData,o.indices=i(o.indices),o.nullsAsUndefineds=i(o.nullsAsUndefineds),o.booleansAsIntegers=i(o.booleansAsIntegers),o.allowEmptyArrays=i(o.allowEmptyArrays),o.noAttributesWithArrayNotation=i(o.noAttributesWithArrayNotation),o.noFilesWithArrayNotation=i(o.noFilesWithArrayNotation),o.dotsForObjectNotation=i(o.dotsForObjectNotation);let u="function"==typeof s.getParts;return r(t)||(null===t?o.nullsAsUndefineds||s.append(c,""):"boolean"==typeof t?o.booleansAsIntegers?s.append(c,+!!t):s.append(c,t):a(t)?t.length?t.forEach((t,r)=>{var a;let i=c+"["+(o.indices?r:"")+"]";(o.noAttributesWithArrayNotation||o.noFilesWithArrayNotation&&l(a=t,u)&&"string"==typeof a.name&&(n(a.lastModifiedDate)||"number"==typeof a.lastModified))&&(i=c),e(t,o,s,i)}):o.allowEmptyArrays&&s.append(o.noAttributesWithArrayNotation?c:c+"[]",""):t instanceof Date?s.append(c,t.toISOString()):n(t)&&!l(t,u)?Object.keys(t).forEach(r=>{let n=t[r];if(a(n))for(;r.length>2&&r.lastIndexOf("[]")===r.length-2;)r=r.substring(0,r.length-2);let l=c?o.dotsForObjectNotation?c+"."+r:c+"["+r+"]":r;e(n,o,s,l)}):s.append(c,t)),s}}}),r6=(0,p.c)((e,t)=>{var r,n;r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t.exports=n={rotl:function(e,t){return e<<t|e>>>32-t},rotr:function(e,t){return e<<32-t|e>>>t},endian:function(e){if(e.constructor==Number)return 0xff00ff&n.rotl(e,8)|0xff00ff00&n.rotl(e,24);for(var t=0;t<e.length;t++)e[t]=n.endian(e[t]);return e},randomBytes:function(e){for(var t=[];e>0;e--)t.push(Math.floor(256*Math.random()));return t},bytesToWords:function(e){for(var t=[],r=0,n=0;r<e.length;r++,n+=8)t[n>>>5]|=e[r]<<24-n%32;return t},wordsToBytes:function(e){for(var t=[],r=0;r<32*e.length;r+=8)t.push(e[r>>>5]>>>24-r%32&255);return t},bytesToHex:function(e){for(var t=[],r=0;r<e.length;r++)t.push((e[r]>>>4).toString(16)),t.push((15&e[r]).toString(16));return t.join("")},hexToBytes:function(e){for(var t=[],r=0;r<e.length;r+=2)t.push(parseInt(e.substr(r,2),16));return t},bytesToBase64:function(e){for(var t=[],n=0;n<e.length;n+=3)for(var a=e[n]<<16|e[n+1]<<8|e[n+2],l=0;l<4;l++)8*n+6*l<=8*e.length?t.push(r.charAt(a>>>6*(3-l)&63)):t.push("=");return t.join("")},base64ToBytes:function(e){e=e.replace(/[^A-Z0-9+\/]/ig,"");for(var t=[],n=0,a=0;n<e.length;a=++n%4)0!=a&&t.push((r.indexOf(e.charAt(n-1))&Math.pow(2,-2*a+8)-1)<<2*a|r.indexOf(e.charAt(n))>>>6-2*a);return t}}}),r5=(0,p.c)((e,t)=>{var r={utf8:{stringToBytes:function(e){return r.bin.stringToBytes(unescape(encodeURIComponent(e)))},bytesToString:function(e){return decodeURIComponent(escape(r.bin.bytesToString(e)))}},bin:{stringToBytes:function(e){for(var t=[],r=0;r<e.length;r++)t.push(255&e.charCodeAt(r));return t},bytesToString:function(e){for(var t=[],r=0;r<e.length;r++)t.push(String.fromCharCode(e[r]));return t.join("")}}};t.exports=r}),r4=(0,p.c)((e,t)=>{function r(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}t.exports=function(e){var t;return null!=e&&(r(e)||"function"==typeof(t=e).readFloatLE&&"function"==typeof t.slice&&r(t.slice(0,0))||!!e._isBuffer)}}),r8=(0,p.c)((e,t)=>{var r,n,a,l,i;r=r6(),n=r5().utf8,a=r4(),l=r5().bin,(i=function(e,t){e.constructor==String?e=t&&"binary"===t.encoding?l.stringToBytes(e):n.stringToBytes(e):a(e)?e=Array.prototype.slice.call(e,0):Array.isArray(e)||e.constructor===Uint8Array||(e=e.toString());for(var o=r.bytesToWords(e),s=8*e.length,c=0x67452301,u=-0x10325477,d=-0x67452302,f=0x10325476,p=0;p<o.length;p++)o[p]=(o[p]<<8|o[p]>>>
724)&0xff00ff|(o[p]<<24|o[p]>>>8)&0xff00ff00;o[s>>>5]|=128<<s%32,o[(s+64>>>9<<4)+14]=s;for(var h=i._ff,m=i._gg,g=i._hh,b=i._ii,p=0;p<o.length;p+=16){var v=c,y=u,x=d,w=f;c=h(c,u,d,f,o[p+0],7,-0x28955b88),f=h(f,c,u,d,o[p+1],12,-0x173848aa),d=h(d,f,c,u,o[p+2],17,0x242070db),u=h(u,d,f,c,o[p+3],22,-0x3e423112),c=h(c,u,d,f,o[p+4],7,-0xa83f051),f=h(f,c,u,d,o[p+5],12,0x4787c62a),d=h(d,f,c,u,o[p+6],17,-0x57cfb9ed),u=h(u,d,f,c,o[p+7],22,-0x2b96aff),c=h(c,u,d,f,o[p+8],7,0x698098d8),f=h(f,c,u,d,o[p+9],12,-0x74bb0851),d=h(d,f,c,u,o[p+10],17,-42063),u=h(u,d,f,c,o[p+11],22,-0x76a32842),c=h(c,u,d,f,o[p+12],7,0x6b901122),f=h(f,c,u,d,o[p+13],12,-0x2678e6d),d=h(d,f,c,u,o[p+14],17,-0x5986bc72),u=h(u,d,f,c,o[p+15],22,0x49b40821),c=m(c,u,d,f,o[p+1],5,-0x9e1da9e),f=m(f,c,u,d,o[p+6],9,-0x3fbf4cc0),d=m(d,f,c,u,o[p+11],14,0x265e5a51),u=m(u,d,f,c,o[p+0],20,-0x16493856),c=m(c,u,d,f,o[p+5],5,-0x29d0efa3),f=m(f,c,u,d,o[p+10],9,0x2441453),d=m(d,f,c,u,o[p+15],14,-0x275e197f),u=m(u,d,f,c,o[p+4],20,-0x182c0438),c=m(c,u,d,f,o[p+9],5,0x21e1cde6),f=m(f,c,u,d,o[p+14],9,-0x3cc8f82a),d=m(d,f,c,u,o[p+3],14,-0xb2af279),u=m(u,d,f,c,o[p+8],20,0x455a14ed),c=m(c,u,d,f,o[p+13],5,-0x561c16fb),f=m(f,c,u,d,o[p+2],9,-0x3105c08),d=m(d,f,c,u,o[p+7],14,0x676f02d9),u=m(u,d,f,c,o[p+12],20,-0x72d5b376),c=g(c,u,d,f,o[p+5],4,-378558),f=g(f,c,u,d,o[p+8],11,-0x788e097f),d=g(d,f,c,u,o[p+11],16,0x6d9d6122),u=g(u,d,f,c,o[p+14],23,-0x21ac7f4),c=g(c,u,d,f,o[p+1],4,-0x5b4115bc),f=g(f,c,u,d,o[p+4],11,0x4bdecfa9),d=g(d,f,c,u,o[p+7],16,-0x944b4a0),u=g(u,d,f,c,o[p+10],23,-0x41404390),c=g(c,u,d,f,o[p+13],4,0x289b7ec6),f=g(f,c,u,d,o[p+0],11,-0x155ed806),d=g(d,f,c,u,o[p+3],16,-0x2b10cf7b),u=g(u,d,f,c,o[p+6],23,0x4881d05),c=g(c,u,d,f,o[p+9],4,-0x262b2fc7),f=g(f,c,u,d,o[p+12],11,-0x1924661b),d=g(d,f,c,u,o[p+15],16,0x1fa27cf8),u=g(u,d,f,c,o[p+2],23,-0x3b53a99b),c=b(c,u,d,f,o[p+0],6,-0xbd6ddbc),f=b(f,c,u,d,o[p+7],10,0x432aff97),d=b(d,f,c,u,o[p+14],15,-0x546bdc59),u=b(u,d,f,c,o[p+5],21,-0x36c5fc7),c=b(c,u,d,f,o[p+12],6,0x655b59c3),f=b(f,c,u,d,o[p+3],10,-0x70f3336e),d=b(d,f,c,u,o[p+10],15,-1051523),u=b(u,d,f,c,o[p+1],21,-0x7a7ba22f),c=b(c,u,d,f,o[p+8],6,0x6fa87e4f),f=b(f,c,u,d,o[p+15],10,-0x1d31920),d=b(d,f,c,u,o[p+6],15,-0x5cfebcec),u=b(u,d,f,c,o[p+13],21,0x4e0811a1),c=b(c,u,d,f,o[p+4],6,-0x8ac817e),f=b(f,c,u,d,o[p+11],10,-0x42c50dcb),d=b(d,f,c,u,o[p+2],15,0x2ad7d2bb),u=b(u,d,f,c,o[p+9],21,-0x14792c6f),c=c+v>>>0,u=u+y>>>0,d=d+x>>>0,f=f+w>>>0}return r.endian([c,u,d,f])})._ff=function(e,t,r,n,a,l,i){var o=e+(t&r|~t&n)+(a>>>0)+i;return(o<<l|o>>>32-l)+t},i._gg=function(e,t,r,n,a,l,i){var o=e+(t&n|r&~n)+(a>>>0)+i;return(o<<l|o>>>32-l)+t},i._hh=function(e,t,r,n,a,l,i){var o=e+(t^r^n)+(a>>>0)+i;return(o<<l|o>>>32-l)+t},i._ii=function(e,t,r,n,a,l,i){var o=e+(r^(t|~n))+(a>>>0)+i;return(o<<l|o>>>32-l)+t},i._blocksize=16,i._digestsize=16,t.exports=function(e,t){if(null==e)throw Error("Illegal argument "+e);var n=r.wordsToBytes(i(e,t));return t&&t.asBytes?n:t&&t.asString?l.bytesToString(n):r.bytesToHex(n)}});function r7({CustomComponent:e,Fallback:t}){return void 0!==e?e:t}var r9=(0,p.e)(rJ(),1),ne=Symbol(),nt=Symbol(),nr=typeof window>"u"||/ServerSideRendering/.test(window.navigator&&window.navigator.userAgent)?c.useEffect:c.useLayoutEffect,nn=r9.unstable_runWithPriority?e=>{try{(0,r9.unstable_runWithPriority)(r9.unstable_NormalPriority,e)}catch(t){if("Not implemented."===t.message)e();else throw t}}:e=>e(),na=e=>e;function nl(e,t){let{v:{current:r},n:{current:n},l:a}=(0,c.useContext)(e)[ne],l=t(r),[i,o]=(0,c.useReducer)((e,a)=>{if(!a)return[r,l];if("p"in a)throw a.p;if(a.n===n)return Object.is(e[1],l)?e:[r,l];try{if("v"in a){if(Object.is(e[0],a.v))return e;let r=t(a.v);return Object.is(e[1],r)?e:[a.v,r]}}catch{}return[...e]},[r,l]);return Object.is(i[1],l)||o(),nr(()=>(a.add(o),()=>{a.delete(o)}),[a]),i[1]}var ni=(0,c.createContext)({}),no=(0,c.createContext)({}),ns=(0,c.createContext)({}),nc=(0,c.createContext)(!1),nu=(0,c.createContext)(!1),nd=(0,c.createContext)(!1),nf=(0,c.createContext)(!1),np=(0,c.createContext)(!1),nh=(lB=[{},()=>null],(r=(0,c.createContext)({[ne]:{v:{current:lB},n:{current:-1},l:new Set,u:e=>e()}}))[nt]=r.Provider,n=r.Provider,r.Provider=({value:e,children:t})=>{let r=(0,c.useRef)(e),a=(0,c.useRef)(0),[l,i]=(0,c.useState)(null);l&&(l(e),i(null));let o=(0,c.useRef)();if(!o.current){let e=new Set;o.current={[ne]:{v:r,n:a,l:e,u:(t,r)=>{a.current+=1;let n={n:a.current};r?.suspense&&(n.n*=-1,n.p=new Promise(e=>{i(()=>t=>{n.v=t,delete n.p,e(t)})}
7)),e.forEach(e=>e(n)),t()}}}}return nr(()=>{r.current=e,a.current+=1,nn(()=>{o.current[ne].l.forEach(t=>{t({n:a.current,v:e})})})},[e]),(0,c.createElement)(n,{value:o.current},t)},delete r.Consumer,r),nm=()=>(0,c.use)(ni),ng=()=>(0,c.use)(no),nb=()=>(0,c.use)(ns),nv=()=>(0,c.use)(nc),ny=()=>(0,c.use)(nu),nx=()=>(0,c.use)(nd),nw=()=>(0,c.use)(nf),nC=()=>(0,c.use)(np),nj=e=>nl(nh,e),nS=()=>nl(nh,na),n$=c.default.createContext({data:{},path:"",rowNumber:void 0}),n_=({children:e,path:t,rowNumber:r})=>{let{getDataByPath:n,getSiblingData:a}=nb(),l=a(t),i=n(t)||l,o=c.default.useMemo(()=>({data:i,path:t,rowNumber:r}),[i,t,r]);return(0,h.jsx)(n$,{value:o,children:e})},nk=e=>{let{className:t,CustomComponent:r,label:n,path:a,rowNumber:l}=e;return(0,h.jsx)(n_,{path:a,rowNumber:l,children:(0,h.jsx)(r7,{CustomComponent:r,Fallback:"string"==typeof n?(0,h.jsx)("span",{className:["row-label",t].filter(Boolean).join(" "),style:{pointerEvents:"none"},children:n}):n})})},nE=Array(12).fill(0),nN=({visible:e,className:t})=>c.default.createElement("div",{className:["sonner-loading-wrapper",t].filter(Boolean).join(" "),"data-visible":e},c.default.createElement("div",{className:"sonner-spinner"},nE.map((e,t)=>c.default.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${t}`})))),nP=c.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},c.default.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"})),nT=c.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},c.default.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"})),nD=c.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},c.default.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"})),nR=c.default.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},c.default.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"})),nA=c.default.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"},c.default.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),c.default.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"})),nO=1,nL=new class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let t=this.subscribers.indexOf(e);this.subscribers.splice(t,1)}),this.publish=e=>{this.subscribers.forEach(t=>t(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var t;let{message:r,...n}=e,a="number"==typeof e?.id||(null==(t=e.id)?void 0:t.length)>0?e.id:nO++,l=this.toasts.find(e=>e.id===a),i=void 0===e.dismissible||e.dismissible;return this.dismissedToasts.has(a)&&this.dismissedToasts.delete(a),l?this.toasts=this.toasts.map(t=>t.id===a?(this.publish({...t,...e,id:a,title:r}),{...t,...e,id:a,dismissible:i,title:r}):t):this.addToast({title:r,...n,dismissible:i,id:a}),a},this.dismiss=e=>(this.dismissedToasts.add(e),e||this.toasts.forEach(e=>{this.subscribers.forEach(t=>t({id:e.id,dismiss:!0}))}),this.subscribers.forEach(t=>t({id:e,dismiss:!0})),e),this.message=(e,t)=>
7this.create({...t,message:e}),this.error=(e,t)=>this.create({...t,message:e,type:"error"}),this.success=(e,t)=>this.create({...t,type:"success",message:e}),this.info=(e,t)=>this.create({...t,type:"info",message:e}),this.warning=(e,t)=>this.create({...t,type:"warning",message:e}),this.loading=(e,t)=>this.create({...t,type:"loading",message:e}),this.promise=(e,t)=>{let r;if(!t)return;void 0!==t.loading&&(r=this.create({...t,promise:e,type:"loading",message:t.loading,description:"function"!=typeof t.description?t.description:void 0}));let n=e instanceof Promise?e:e(),a=void 0!==r,l,i=n.then(async e=>{if(l=["resolve",e],c.default.isValidElement(e))a=!1,this.create({id:r,type:"default",message:e});else if(nM(e)&&!e.ok){a=!1;let n="function"==typeof t.error?await t.error(`HTTP error! status: ${e.status}`):t.error,l="function"==typeof t.description?await t.description(`HTTP error! status: ${e.status}`):t.description;this.create({id:r,type:"error",message:n,description:l})}else if(void 0!==t.success){a=!1;let n="function"==typeof t.success?await t.success(e):t.success,l="function"==typeof t.description?await t.description(e):t.description;this.create({id:r,type:"success",message:n,description:l})}}).catch(async e=>{if(l=["reject",e],void 0!==t.error){a=!1;let n="function"==typeof t.error?await t.error(e):t.error,l="function"==typeof t.description?await t.description(e):t.description;this.create({id:r,type:"error",message:n,description:l})}}).finally(()=>{var e;a&&(this.dismiss(r),r=void 0),null==(e=t.finally)||e.call(t)}),o=()=>new Promise((e,t)=>i.then(()=>"reject"===l[0]?t(l[1]):e(l[1])).catch(t));return"string"!=typeof r&&"number"!=typeof r?{unwrap:o}:Object.assign(r,{unwrap:o})},this.custom=(e,t)=>{let r=t?.id||nO++;return this.create({jsx:e(r),id:r,...t}),r},this.getActiveToasts=()=>this.toasts.filter(e=>!this.dismissedToasts.has(e.id)),this.subscribers=[],this.toasts=[],this.dismissedToasts=new Set}},nM=e=>e&&"object"==typeof e&&"ok"in e&&"boolean"==typeof e.ok&&"status"in e&&"number"==typeof e.status,nI=Object.assign((e,t)=>{let r=t?.id||nO++;return nL.addToast({title:e,...t,id:r}),r},{success:nL.success,info:nL.info,warning:nL.warning,error:nL.error,custom:nL.custom,message:nL.message,promise:nL.promise,dismiss:nL.dismiss,loading:nL.loading},{getHistory:()=>nL.toasts,getToasts:()=>nL.getActiveToasts()});function nF(e){return void 0!==e.label}function nB(...e){return e.filter(Boolean).join(" ")}!function(e,{insertAt:t}={}){if(!e||typeof document>"u")return;let r=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css","top"===t&&r.firstChild?r.insertBefore(n,r.firstChild):r.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}(`: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;
7left: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}
7: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%);
7--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%)}
8`);var nz=e=>{var t,r,n,a,l,i,o,s,u,d,f,p,h,m;let{invert:g,toast:b,unstyled:v,interacting:y,setHeights:x,visibleToasts:w,heights:C,index:j,toasts:S,expanded:$,removeToast:_,defaultRichColors:k,closeButton:E,style:N,cancelButtonStyle:P,actionButtonStyle:T,className:D="",descriptionClassName:R="",duration:A,position:O,gap:L,loadingIcon:M,expandByDefault:I,classNames:F,icons:B,closeButtonAriaLabel:z="Close toast",pauseWhenPageIsHidden:U}=e,[V,H]=c.default.useState(null),[q,K]=c.default.useState(null),[W,G]=c.default.useState(!1),[Y,Q]=c.default.useState(!1),[X,J]=c.default.useState(!1),[Z,ee]=c.default.useState(!1),[et,er]=c.default.useState(!1),[en,ea]=c.default.useState(0),[el,ei]=c.default.useState(0),eo=c.default.useRef(b.duration||A||4e3),es=c.default.useRef(null),ec=c.default.useRef(null),eu=0===j,ed=j+1<=w,ef=b.type,ep=!1!==b.dismissible,eh=b.className||"",em=b.de
8scriptionClassName||"",eg=c.default.useMemo(()=>C.findIndex(e=>e.toastId===b.id)||0,[C,b.id]),eb=c.default.useMemo(()=>{var e;return null!=(e=b.closeButton)?e:E},[b.closeButton,E]),ev=c.default.useMemo(()=>b.duration||A||4e3,[b.duration,A]),ey=c.default.useRef(0),ex=c.default.useRef(0),ew=c.default.useRef(0),eC=c.default.useRef(null),[ej,eS]=O.split("-"),e$=c.default.useMemo(()=>C.reduce((e,t,r)=>r>=eg?e:e+t.height,0),[C,eg]),e_=(()=>{let[e,t]=c.default.useState(document.hidden);return c.default.useEffect(()=>{let e=()=>{t(document.hidden)};return document.addEventListener("visibilitychange",e),()=>window.removeEventListener("visibilitychange",e)},[]),e})(),ek=b.invert||g,eE="loading"===ef;ex.current=c.default.useMemo(()=>eg*L+e$,[eg,e$]),c.default.useEffect(()=>{eo.current=ev},[ev]),c.default.useEffect(()=>{G(!0)},[]),c.default.useEffect(()=>{let e=ec.current;if(e){let t=e.getBoundingClientRect().height;return ei(t),x(e=>[{toastId:b.id,height:t,position:b.position},...e]),()=>x(e=>e.filter(e=>e.toastId!==b.id))}},[x,b.id]),c.default.useLayoutEffect(()=>{if(!W)return;let e=ec.current,t=e.style.height;e.style.height="auto";let r=e.getBoundingClientRect().height;e.style.height=t,ei(r),x(e=>e.find(e=>e.toastId===b.id)?e.map(e=>e.toastId===b.id?{...e,height:r}:e):[{toastId:b.id,height:r,position:b.position},...e])},[W,b.title,b.description,x,b.id]);let eN=c.default.useCallback(()=>{Q(!0),ea(ex.current),x(e=>e.filter(e=>e.toastId!==b.id)),setTimeout(()=>{_(b)},200)},[b,_,x,ex]);return c.default.useEffect(()=>{let e;if((!b.promise||"loading"!==ef)&&b.duration!==1/0&&"loading"!==b.type)return $||y||U&&e_?(()=>{if(ew.current<ey.current){let e=new Date().getTime()-ey.current;eo.current=eo.current-e}ew.current=new Date().getTime()})():eo.current!==1/0&&(ey.current=new Date().getTime(),e=setTimeout(()=>{var e;null==(e=b.onAutoClose)||e.call(b,b),eN()},eo.current)),()=>clearTimeout(e)},[$,y,b,ef,U,e_,eN]),c.default.useEffect(()=>{b.delete&&eN()},[eN,b.delete]),c.default.createElement("li",{tabIndex:0,ref:ec,className:nB(D,eh,F?.toast,null==(t=b?.classNames)?void 0:t.toast,F?.default,F?.[ef],null==(r=b?.classNames)?void 0:r[ef]),"data-sonner-toast":"","data-rich-colors":null!=(n=b.richColors)?n:k,"data-styled":!(b.jsx||b.unstyled||v),"data-mounted":W,"data-promise":!!b.promise,"data-swiped":et,"data-removed":Y,"data-visible":ed,"data-y-position":ej,"data-x-position":eS,"data-index":j,"data-front":eu,"data-swiping":X,"data-dismissible":ep,"data-type":ef,"data-invert":ek,"data-swipe-out":Z,"data-swipe-direction":q,"data-expanded":!!($||I&&W),style:{"--index":j,"--toasts-before":j,"--z-index":S.length-j,"--offset":`${Y?en:ex.current}px`,"--initial-height":I?"auto":`${el}px`,...N,...b.style},onDragEnd:()=>{J(!1),H(null),eC.current=null},onPointerDown:e=>{eE||!ep||(es.current=new Date,ea(ex.current),e.target.setPointerCapture(e.pointerId),"BUTTON"!==e.target.tagName&&(J(!0),eC.current={x:e.clientX,y:e.clientY}))},onPointerUp:()=>{var e,t,r,n;if(Z||!ep)return;eC.current=null;let a=Number((null==(e=ec.current)?void 0:e.style.getPropertyValue("--swipe-amount-x").replace("px",""))||0),l=Number((null==(t=ec.current)?void 0:t.style.getPropertyValue("--swipe-amount-y").replace("px",""))||0),i=new Date().getTime()-(null==(r=es.current)?void 0:r.getTime()),o="x"===V?a:l,s=Math.abs(o)/i;if(Math.abs(o)>=20||s>.11){ea(ex.current),null==(n=b.onDismiss)||n.call(b,b),K("x"===V?a>0?"right":"left":l>0?"down":"up"),eN(),ee(!0),er(!1);return}J(!1),H(null)},onPointerMove:t=>{var r,n,a,l;if(!eC.current||!ep||(null==(r=window.getSelection())?void 0:r.toString().length)>0)return;let i=t.clientY-eC.current.y,o=t.clientX-eC.current.x,s=null!=(n=e.swipeDirections)?n:function(e){let[t,r]=e.split("-"),n=[];return t&&n.push(t),r&&n.push(r),n}(O);!V&&(Math.abs(o)>1||Math.abs(i)>1)&&H(Math.abs(o)>Math.abs(i)?"x":"y");let c={x:0,y:0};"y"===V?(s.includes("top")||s.includes("bottom"))&&(s.includes("top")&&i<0||s.includes("bottom")&&i>0)&&(c.y=i):"x"===V&&(s.includes("left")||s.includes("right"))&&(s.includes("left")&&o<0||s.includes("right")&&o>0)&&(c.x=o),(Math.abs(c.x)>0||Math.abs(c.y)>0)&&er(!0),null==(a=ec.current)||a.style.setProperty("--swipe-amount-x",`${c.x}
8px`),null==(l=ec.current)||l.style.setProperty("--swipe-amount-y",`${c.y}px`)}},eb&&!b.jsx?c.default.createElement("button",{"aria-label":z,"data-disabled":eE,"data-close-button":!0,onClick:eE||!ep?()=>{}:()=>{var e;eN(),null==(e=b.onDismiss)||e.call(b,b)},className:nB(F?.closeButton,null==(a=b?.classNames)?void 0:a.closeButton)},null!=(l=B?.close)?l:nA):null,b.jsx||(0,c.isValidElement)(b.title)?b.jsx?b.jsx:"function"==typeof b.title?b.title():b.title:c.default.createElement(c.default.Fragment,null,ef||b.icon||b.promise?c.default.createElement("div",{"data-icon":"",className:nB(F?.icon,null==(i=b?.classNames)?void 0:i.icon)},b.promise||"loading"===b.type&&!b.icon?b.icon||(null!=B&&B.loading?c.default.createElement("div",{className:nB(F?.loader,null==(p=b?.classNames)?void 0:p.loader,"sonner-loader"),"data-visible":"loading"===ef},B.loading):M?c.default.createElement("div",{className:nB(F?.loader,null==(h=b?.classNames)?void 0:h.loader,"sonner-loader"),"data-visible":"loading"===ef},M):c.default.createElement(nN,{className:nB(F?.loader,null==(m=b?.classNames)?void 0:m.loader),visible:"loading"===ef})):null,"loading"!==b.type?b.icon||B?.[ef]||(e=>{switch(e){case"success":return nP;case"info":return nD;case"warning":return nT;case"error":return nR;default:return null}})(ef):null):null,c.default.createElement("div",{"data-content":"",className:nB(F?.content,null==(o=b?.classNames)?void 0:o.content)},c.default.createElement("div",{"data-title":"",className:nB(F?.title,null==(s=b?.classNames)?void 0:s.title)},"function"==typeof b.title?b.title():b.title),b.description?c.default.createElement("div",{"data-description":"",className:nB(R,em,F?.description,null==(u=b?.classNames)?void 0:u.description)},"function"==typeof b.description?b.description():b.description):null),(0,c.isValidElement)(b.cancel)?b.cancel:b.cancel&&nF(b.cancel)?c.default.createElement("button",{"data-button":!0,"data-cancel":!0,style:b.cancelButtonStyle||P,onClick:e=>{var t,r;nF(b.cancel)&&ep&&(null==(r=(t=b.cancel).onClick)||r.call(t,e),eN())},className:nB(F?.cancelButton,null==(d=b?.classNames)?void 0:d.cancelButton)},b.cancel.label):null,(0,c.isValidElement)(b.action)?b.action:b.action&&nF(b.action)?c.default.createElement("button",{"data-button":!0,"data-action":!0,style:b.actionButtonStyle||T,onClick:e=>{var t,r;nF(b.action)&&(null==(r=(t=b.action).onClick)||r.call(t,e),e.defaultPrevented||eN())},className:nB(F?.actionButton,null==(f=b?.classNames)?void 0:f.actionButton)},b.action.label):null))};function nU(){if(typeof window>"u"||typeof document>"u")return"ltr";let e=document.documentElement.getAttribute("dir");return"auto"!==e&&e?e:window.getComputedStyle(document.documentElement).direction}var nV=(0,c.forwardRef)(function(e,t){let{invert:r,position:n="bottom-right",hotkey:a=["altKey","KeyT"],expand:l,closeButton:i,className:o,offset:s,mobileOffset:d,theme:f="light",richColors:p,duration:h,style:m,visibleToasts:g=3,toastOptions:b,dir:v=nU(),gap:y=14,loadingIcon:x,icons:w,containerAriaLabel:C="Notifications",pauseWhenPageIsHidden:j}=e,[S,$]=c.default.useState([]),_=c.default.useMemo(()=>Array.from(new Set([n].concat(S.filter(e=>e.position).map(e=>e.position)))),[S,n]),[k,E]=c.default.useState([]),[N,P]=c.default.useState(!1),[T,D]=c.default.useState(!1),[R,A]=c.default.useState("system"!==f?f:"u">typeof window&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),O=c.default.useRef(null),L=a.join("+").replace(/Key/g,"").replace(/Digit/g,""),M=c.default.useRef(null),I=c.default.useRef(!1),F=c.default.useCallback(e=>{$(t=>{var r;return null!=(r=t.find(t=>t.id===e.id))&&r.delete||nL.dismiss(e.id),t.filter(({id:t})=>t!==e.id)})},[]);return c.default.useEffect(()=>nL.subscribe(e=>{e.dismiss?$(t=>t.map(t=>t.id===e.id?{...t,delete:!0}:t)):setTimeout(()=>{u.default.flushSync(()=>{$(t=>{let r=t.findIndex(t=>t.id===e.id);return -1!==r?[...t.slice(0,r),{...t[r],...e},...t.slice(r+1)]:[e,...t]})})})}),[]),c.default.useEffect(()=>{if("system"!==f)return void A(f);if("system"===f&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?A("dark"):A("light")),typeof window>"u")return;let e=window.matchMedia("(prefers-color-scheme: dark)");try{e.addEventListener("change",({matches:e})=>{A(e?"dark":"light")})}catch{e.addListener(({matches:e})=>{try{A(e?"dark":"light")}catch(e){console.error(e)}})}},[f]),c.default.useEffect(()=>{S.length<=1&&P(!1)},[S]),c.default.useEffect(()=>{let e=e=>{var t,r;a.every(t=>
8e[t]||e.code===t)&&(P(!0),null==(t=O.current)||t.focus()),"Escape"===e.code&&(document.activeElement===O.current||null!=(r=O.current)&&r.contains(document.activeElement))&&P(!1)};return document.addEventListener("keydown",e),()=>document.removeEventListener("keydown",e)},[a]),c.default.useEffect(()=>{if(O.current)return()=>{M.current&&(M.current.focus({preventScroll:!0}),M.current=null,I.current=!1)}},[O.current]),c.default.createElement("section",{ref:t,"aria-label":`${C} ${L}`,tabIndex:-1,"aria-live":"polite","aria-relevant":"additions text","aria-atomic":"false",suppressHydrationWarning:!0},_.map((t,n)=>{var a;let u,[f,C]=t.split("-");return S.length?c.default.createElement("ol",{key:t,dir:"auto"===v?nU():v,tabIndex:-1,ref:O,className:o,"data-sonner-toaster":!0,"data-theme":R,"data-y-position":f,"data-lifted":N&&S.length>1&&!l,"data-x-position":C,style:{"--front-toast-height":`${(null==(a=k[0])?void 0:a.height)||0}px`,"--width":"356px","--gap":`${y}px`,...m,...(u={},[s,d].forEach((e,t)=>{let r=1===t,n=r?"--mobile-offset":"--offset",a=r?"16px":"32px";function l(e){["top","right","bottom","left"].forEach(t=>{u[`${n}-${t}`]="number"==typeof e?`${e}px`:e})}"number"==typeof e||"string"==typeof e?l(e):"object"==typeof e?["top","right","bottom","left"].forEach(t=>{void 0===e[t]?u[`${n}-${t}`]=a:u[`${n}-${t}`]="number"==typeof e[t]?`${e[t]}px`:e[t]}):l(a)}),u)},onBlur:e=>{I.current&&!e.currentTarget.contains(e.relatedTarget)&&(I.current=!1,M.current&&(M.current.focus({preventScroll:!0}),M.current=null))},onFocus:e=>{e.target instanceof HTMLElement&&"false"===e.target.dataset.dismissible||I.current||(I.current=!0,M.current=e.relatedTarget)},onMouseEnter:()=>P(!0),onMouseMove:()=>P(!0),onMouseLeave:()=>{T||P(!1)},onDragEnd:()=>P(!1),onPointerDown:e=>{e.target instanceof HTMLElement&&"false"===e.target.dataset.dismissible||D(!0)},onPointerUp:()=>D(!1)},S.filter(e=>!e.position&&0===n||e.position===t).map((n,a)=>{var o,s;return c.default.createElement(nz,{key:n.id,icons:w,index:a,toast:n,defaultRichColors:p,duration:null!=(o=b?.duration)?o:h,className:b?.className,descriptionClassName:b?.descriptionClassName,invert:r,visibleToasts:g,closeButton:null!=(s=b?.closeButton)?s:i,interacting:T,position:t,style:b?.style,unstyled:b?.unstyled,classNames:b?.classNames,cancelButtonStyle:b?.cancelButtonStyle,actionButtonStyle:b?.actionButtonStyle,removeToast:F,toasts:S.filter(e=>e.position==n.position),heights:k.filter(e=>e.position==n.position),setHeights:E,expandByDefault:l,gap:y,loadingIcon:x,expanded:N,pauseWhenPageIsHidden:j,swipeDirections:e.swipeDirections})})):null}))}),nH=e=>{let t,r=(0,v.c)(11),{children:n}=e,[a,l]=(0,c.useOptimistic)(!1),[i,o]=c.default.useState(0),s=(0,c.useRef)(i),u=(0,c.useRef)(null),d;r[0]===Symbol.for("react.memo_cache_sentinel")?(d=()=>{u.current=setInterval(()=>{let e=s.current+(.93-s.current)*Math.random()*.2*Math.pow(Math.log(1+(1-s.current)*.75),.75);o(e),s.current=e},250)},r[0]=d):d=r[0];let f=d,p,m;r[1]!==a?(p=()=>{o(0),s.current=0,a?f():u.current&&clearInterval(u.current)},m=[a,f],r[1]=a,r[2]=p,r[3]=m):(p=r[2],m=r[3]),(0,c.useEffect)(p,m),r[4]!==l?(t=e=>{(0,c.startTransition)(()=>{l(!0),"function"==typeof e&&e()})},r[4]=l,r[5]=t):t=r[5];let g=t,b;return r[6]!==n||r[7]!==a||r[8]!==g||r[9]!==i?(b=(0,h.jsx)(nq,{value:{isTransitioning:a,startRouteTransition:g,transitionProgress:i},children:n}),r[6]=n,r[7]=a,r[8]=g,r[9]=i,r[10]=b):b=r[10],b},nq=c.default.createContext({isTransitioning:!1,startRouteTransition:e=>{"function"==typeof e&&e()},transitionProgress:0}),nK=()=>c.default.use(nq),nW=/https?|ftp|gopher|file/;function nG(e){return"string"!=typeof e&&("number"!=typeof e||isNaN(e))&&"boolean"!=typeof e?"":String(e)}var nY="default"in g.default?g.default.default:g.default,nQ=({children:e,href:t,onClick:r,preventDefault:n=!0,ref:a,replace:l,scroll:i,...o})=>{let s=(0,b.useRouter)(),{startRouteTransition:c}=nK();return(0,h.jsx)(nY,{href:t,onClick:e=>{let a;if((a=e.currentTarget.getAttribute("target"))&&"_self"!==a||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.nativeEvent&&2===e.nativeEvent.which)return;r&&r(e),n&&e.preventDefault();let o="string"==typeof t?t:function(e){var t;let r,{auth:n}=e,{hostname:a}=e,l=e.protocol||"",i=e.pathname||"",o=e.hash||"",s=e.query||"",c=!1;n=n?encodeURIComponent(n).replace(/%3A/i,":")+"@":"",e.host?c=n+e.host:a&&(c=n+(~a.indexOf(":")?`[${a}]`:a),e.port&&(c+=":"+e.port)),s&&"object"==typeof s&&(s=String((t=s,r=new URLSearchParams,Object.entries(t).forEach(([e,t])=>{Array.isArray(t)?t.forEach(t=>r.append(e,nG(t))):r.set(e,nG(t))}),r)));let u=e.search||s&&`?${s}`||"";return l&&!l.endsWith(":")&&(l+=":"),e.slashes||(!l||nW.test(l))&&!1!==c?(c="//"+(c||""),i&&"/"!==i[0]&&(i="/"+i)):c||(c=""),o&&"#"!==o[0]&&(o="#"+o),u&&"?"!==u[0]&&(u="?"+u),i=i.replace(/[?#]/g,encodeURIComponent),u=u.replace("#","%23"),`${l}${c}${i}${u}${o}`}(t);c(()=>{l?s.replace(o,{scroll:i}):s.push(o,{scroll:i})})},ref:a,...o,children:e})},nX="banner",nJ=({type:e="default",alignIcon:t="right",children:r,className:n,icon:a,onClick:l,to:i})=>{let o=[nX,`${nX}--type-${e}`,n&&n,i&&`${nX}--has-link`,(i||l)&&`${nX}--has-action`,a&&`${nX}--has-icon`,a&&`${nX}--align-icon-${t}
8`].filter(Boolean).join(" "),s="div";return l&&!i&&(s="button"),i&&(s=nQ),(0,h.jsxs)(s,{className:o,href:i||null,onClick:l,children:[a&&"left"===t&&(0,h.jsx)(c.default.Fragment,{children:a}),(0,h.jsx)("span",{className:`${nX}__content`,children:r}),a&&"right"===t&&(0,h.jsx)(c.default.Fragment,{children:a})]})},nZ=({ariaLabel:e,className:t,direction:r,size:n})=>(0,h.jsx)("svg",{"aria-label":e,className:["icon icon--chevron",t,n&&`icon--size-${n}`].filter(Boolean).join(" "),height:"100%",style:{transform:"left"===r?"rotate(90deg)":"right"===r?"rotate(-90deg)":"up"===r?"rotate(180deg)":void 0},viewBox:"0 0 20 20",width:"100%",xmlns:"http://www.w3.org/2000/svg",children:(0,h.jsx)("path",{className:"stroke",d:"M14 8L10 12L6 8",strokeLinecap:"square"})}),n0=({className:e})=>(0,h.jsx)("svg",{className:[e,"icon icon--edit"].filter(Boolean).join(" "),viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:(0,h.jsx)("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"})}),n1=()=>(0,h.jsx)("svg",{"aria-hidden":"true",className:"graphic link icon icon--link",fill:"none",focu
8sable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,h.jsx)("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"})}),n2=()=>(0,h.jsx)("svg",{className:"icon icon--plus",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,h.jsx)("path",{className:"stroke",d:"M5.33333 9.99998H14.6667M9.99999 5.33331V14.6666",strokeLinecap:"square"})}),n3=()=>(0,h.jsx)("svg",{className:"icon icon--swap",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:(0,h.jsx)("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"})}),n6={};(0,p.d)(n6,{Button:()=>n9,ButtonGroup:()=>n7,Divider:()=>n5,GroupLabel:()=>n4});var n5=()=>(0,h.jsx)("hr",{className:"popup-divider"}),n4=({label:e})=>(0,h.jsx)("p",{className:"popup-list-group-label",children:e}),n8="popup-button-list",n7=({buttonSize:e="default",children:t,className:r,textAlign:n="left"})=>{let a=[n8,r,`${n8}__text-align--${n}`,`${n8}__button-size--${e}`].filter(Boolean).join(" ");return(0,h.jsx)("div",{className:a,children:t})},n9=({id:e,active:t,children:r,className:n,disabled:a,href:l,onClick:i})=>{let o=[`${n8}__button`,a&&`${n8}__disabled`,t&&`${n8}__button--selected`,n].filter(Boolean).join(" ");if(!a){if(l)return(0,h.jsx)(nQ,{className:o,href:l,id:e,onClick:e=>{i&&i(e)},prefetch:!1,children:r});if(i)return(0,h.jsx)("button",{className:o,id:e,onClick:e=>{i&&i(e)},type:"button",children:r})}return(0,h.jsx)("div",{className:o,id:e,children:r})},ae="useEffectEvent"in c.default&&"function"==typeof c.default.useEffectEvent?c.default.useEffectEvent:e=>{let t=(0,c.useRef)(e);return(0,c.useInsertionEffect)(()=>{t.current=e},[e]),(0,c.useCallback)((...e)=>(0,t.current)(...e),[])},at="popup-button",ar=e=>{let{active:t,button:r,buttonType:n,className:a,disabled:l,noBackground:i,setActive:o,size:s}=e,c=[at,a,`${at}--${n}`,!i&&`${at}--background`,s&&`${at}--size-${s}`,l&&`${at}--disabled`].filter(Boolean).join(" "),u=()=>{o(!t,!1)},d=e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),o(!t,!0))};return"none"===n?null:"custom"===n?(0,h.jsx)("div",{className:c,onClick:u,onKeyDown:d,role:"button",tabIndex:0,children:r}):(0,h.jsx)("button",{className:c,disabled:l,onClick:u,onKeyDown:d,tabIndex:0,type:"button",children:r})},an="popup",aa=["a[href]","button:not(:disabled)",'input:not(:disabled):not([type="hidden"])',"select:not(:disabled)","textarea:not(:disabled)","[tabindex]",'[contenteditable]:not([contenteditable="false"])',"audio[controls]","video[controls]","summary"].map(e=>`${e}:not([tabindex="-1"])`).join(", "),al=e=>{let{id:t,button:r,buttonClassName:n,buttonSize:a,buttonType:l="default",caret:i=!0,children:o,className:s,disabled:d,forceOpen:f,horizontalAlign:p="left",initActive:m=!1,noBackground:g,onToggleClose:b,onToggleOpen:v,portalClassName:y,render:x,showOnHover:w=!1,showScrollbar:C=!1,size:j="medium",verticalAlign:S="bottom"}=e,$=(0,c.useRef)(null),_=(0,c.useRef)(null),k=(0,c.useRef)(!1),[E,N]=(0,c.useState)(!1),[P,T]=(0,c.useState)(m),[D,R]=(0,c.useState)("top"===S);(0,c.useEffect)(()=>{N(!0)},[]);let A=(0,c.useCallback)((e,t=!1)=>{e?(k.current=t,v?.(!0)):b?.(),T(e)},[b,v]),O=ae(()=>{let e=_.current,t=$.current;if(!e||!t)return;let r=e.getBoundingClientRect(),n=t.getBoundingClientRect(),a,l="top"===S;"bottom"===S?(a=r.bottom+window.scrollY+10,r.bottom+n.height+10>window.innerHeight&&(a=r.top+window.scrollY-n.height-10,l=!0)):(a=r.top+window.scrollY-n.height-10,r.top-n.height-10<0&&(a=r.bottom+window.scrollY+10,l=!1)),R(l);
8let i="right"===p?r.right-n.width:"center"===p?r.left+r.width/2-n.width/2:r.left;i=Math.max(10,Math.min(i,window.innerWidth-n.width-10));let o=Math.max(12,Math.min(r.left+r.width/2-i,n.width-12)),s=`${Math.round(a)}px`,c=`${Math.round(i+window.scrollX)}px`,u=`${Math.round(o)}px`;t.style.top!==s&&(t.style.top=s),t.style.left!==c&&(t.style.left=c),t.style.getPropertyValue("--caret-left")!==u&&t.style.setProperty("--caret-left",u)}),L=ae(e=>{let t=!$.current?.contains(e.target),r=!_.current?.contains(e.target);t&&r&&A(!1)}),M=ae(e=>{let t=$.current;if(!(!t||!P)){if("Escape"===e.key){e.preventDefault(),A(!1),_.current?.querySelector('button, [tabindex="0"]')?.focus();return}if("Tab"===e.key||"ArrowDown"===e.key||"ArrowUp"===e.key){let r=Array.from(t.querySelectorAll(aa));if(0===r.length)return;e.preventDefault();let n=r.findIndex(e=>e===document.activeElement),a="ArrowUp"===e.key||"Tab"===e.key&&e.shiftKey,l;l=-1===n?a?r.length-1:0:a?0===n?r.length-1:n-1:n===r.length-1?0:n+1,r[l].focus()}}}),I=ae(e=>{let t=e.target;if(t.closest("[data-popup-prevent-close]"))return;let r=t.closest('button, a[href], [role="button"], [role="menuitem"]');r&&$.current?.contains(r)&&A(!1)});(0,c.useEffect)(()=>{if(!P)return;let e=$.current;if(e)return O(),k.current&&requestAnimationFrame(()=>{e.querySelector(aa)?.focus()}),window.addEventListener("resize",O),window.addEventListener("scroll",O,{capture:!0,passive:!0}),document.addEventListener("mousedown",L),document.addEventListener("keydown",M),e.addEventListener("click",I),()=>{window.removeEventListener("resize",O),window.removeEventListener("scroll",O,{capture:!0}),document.removeEventListener("mousedown",L),document.removeEventListener("keydown",M),e.removeEventListener("click",I)}},[P]),(0,c.useEffect)(()=>{void 0!==f&&A(f)},[f,A]);let F=(0,h.jsx)(ar,{active:P,button:r,buttonType:l,className:n,disabled:d,noBackground:g,setActive:A,size:a});return(0,h.jsxs)("div",{className:[an,s].filter(Boolean).join(" "),id:t,children:[(0,h.jsx)("div",{className:`${an}__trigger-wrap`,ref:_,children:w?(0,h.jsx)("div",{className:`${an}__on-hover-watch`,onMouseEnter:()=>A(!0),onMouseLeave:()=>A(!1),role:"button",tabIndex:0,children:F}):F}),E?(0,u.createPortal)((0,h.jsxs)("div",{className:P?[`${an}__content`,`${an}--size-${j}`,D?`${an}--v-top`:`${an}--v-bottom`,y].filter(Boolean).join(" "):`${an}__hidden-content`,"data-popup-id":t||void 0,ref:$,children:[(0,h.jsxs)("div",{className:`${an}__scroll-container${C?` ${an}__scroll-container--show-scrollbar`:""}`,children:[x?.({close:()=>A(!1)}),o]}),i&&(0,h.jsx)("div",{className:`${an}__caret`})]}),document.body):null]})},ai=(e,t)=>{let r,n=(0,v.c)(8),{root:a,rootMargin:l,threshold:i}=void 0===e?{}:e,[o,s]=(0,c.useState)(),[u,d]=(0,c.useState)(null),f=(0,c.useRef)("u">typeof window&&"IntersectionObserver"in window&&!t?new window.IntersectionObserver(e=>{let[t]=e;return s(t)},{root:void 0===a?null:a,rootMargin:void 0===l?"0px":l,threshold:void 0===i?0:i}):null),p,h;return n[0]!==t||n[1]!==u?(p=()=>{if(t)return;let{current:e}=f;return e.disconnect(),u&&e.observe(u),()=>e.disconnect()},h=[u,t],n[0]=t,n[1]=u,n[2]=p,n[3]=h):(p=n[2],h=n[3]),(0,c.useEffect)(p,h),n[4]!==o||n[5]!==u||n[6]!==d?(r=[d,o,u],n[4]=o,n[5]=u,n[6]=d,n[7]=r):r=n[7],r},ao=e=>{let{alignCaret:t="center",boundingRef:r,children:n,className:a,delay:l=350,position:i,show:o=!0,staticPositioning:s=!1}=e,[u,d]=c.default.useState(o),[f,p]=c.default.useState("top"),[m,g]=ai({root:r?.current||null,rootMargin:"-145px 0px 0px 100px",threshold:0},s);return(0,c.useEffect)(()=>{let e;return l&&o?e=setTimeout(()=>{d(o)},l):d(o),()=>{e&&clearTimeout(e)}},[o,l]),(0,c.useEffect)(()=>{s||p(g?.isIntersecting?"top":"bottom")},[g,s]),(0,h.jsxs)(c.default.Fragment,{children:[!s&&(0,h.jsx)("aside",{"aria-hidden":"true",className:["tooltip",a,`tooltip--caret-${t}
8`,"tooltip--position-top"].filter(Boolean).join(" "),ref:m,style:{opacity:"0"},children:(0,h.jsx)("div",{className:"tooltip-content",children:n})}),(0,h.jsx)("aside",{className:["tooltip",a,u&&"tooltip--show",`tooltip--caret-${t}`,`tooltip--position-${i||f}`].filter(Boolean).join(" "),title:"string"==typeof n?n:"",children:(0,h.jsx)("div",{className:"tooltip-content",children:n})})]})},as={chevron:nZ,edit:n0,link:n1,plus:n2,swap:n3,x:f.a},ac=({children:e,icon:t,showTooltip:r,tooltip:n})=>{let a=as[t];return(0,h.jsxs)(c.Fragment,{children:[n&&(0,h.jsx)(ao,{className:"btn__tooltip",show:r,children:n}),(0,h.jsxs)("span",{className:"btn__content",children:[e&&(0,h.jsx)("span",{className:"btn__label",children:e}),t&&(0,h.jsxs)("span",{className:"btn__icon",children:[(0,c.isValidElement)(t)&&t,a&&(0,h.jsx)(a,{})]})]})]})},au=e=>{let{id:t,type:r="button","aria-label":n,buttonStyle:a="primary",children:l,className:i,disabled:o,el:s="button",enableSubMenu:u,extraButtonProps:d={},icon:f,iconPosition:p="right",iconStyle:m="without-border",margin:g=!0,newTab:b,onClick:v,onMouseDown:y,ref:x,round:w,size:C="medium",SubMenuPopupContent:j,to:S,tooltip:$,url:_}=e,[k,E]=c.default.useState(!1),N=["btn",i&&i,f&&"btn--icon",m&&`btn--icon-style-${m}`,f&&!l&&"btn--icon-only",C&&`btn--size-${C}`,f&&p&&`btn--icon-position-${p}`,$&&"btn--has-tooltip",!j&&"btn--withoutPopup",!g&&"btn--no-margin"].filter(Boolean).join(" "),P=[a&&`btn--style-${a}`,o&&"btn--disabled",w&&"btn--round",j?"btn--withPopup":"btn--withoutPopup"].filter(Boolean).join(" "),T={id:t,type:r,"aria-disabled":o,"aria-label":n,className:j?N:[N,P].join(" "),disabled:o,onClick:o?void 0:function(e){E(!1),"submit"!==r&&v&&e.preventDefault(),v&&v(e)},onMouseDown:o?void 0:y,onPointerEnter:$?()=>E(!0):void 0,onPointerLeave:$?()=>E(!1):void 0,rel:b?"noopener noreferrer":void 0,target:b?"_blank":void 0,title:n,...d},D;switch(s){case"anchor":D=(0,h.jsx)("a",{...T,href:o?void 0:_,ref:x,children:(0,h.jsx)(ac,{icon:f,showTooltip:k,tooltip:$,children:l})});break;case"link":o&&(D=(0,h.jsx)("div",{...T,children:(0,h.jsx)(ac,{icon:f,showTooltip:k,tooltip:$,children:l})})),D=(0,h.jsx)(nQ,{...T,href:S||_,prefetch:!1,children:(0,h.jsx)(ac,{icon:f,showTooltip:k,tooltip:$,children:l})});break;default:D=(0,h.jsx)(s,{ref:x,...T,children:(0,h.jsx)(ac,{icon:f,showTooltip:k,tooltip:$,children:l})})}return j?(0,h.jsxs)("div",{className:P,children:[D,(0,h.jsx)(al,{button:(0,h.jsx)(nZ,{}),buttonSize:C,className:o&&!u?"btn--popup-disabled":"",disabled:o&&!u,horizontalAlign:"right",id:`${t}-popup`,noBackground:!0,render:({close:e})=>j({close:()=>e()}),size:"large",verticalAlign:"bottom"})]}):D};function ad({fieldsFromClipboard:e,fieldsFromConfig:t}){return!!t&&e.length===t?.length&&e.every((e,r)=>{let n=t[r];if(e.type!==n.type||_(e)&&_(n)&&e.name!==n.name)return!1;let a=y(n),l=y(e);return l===a&&(!l||!a||ad({fieldsFromClipboard:e.fields,fieldsFromConfig:n.fields}))})}var af="_payloadClipboard";function ap(e){let{getDataToCopy:t,t:r,...n}=e,a={data:t(),...n};try{return localStorage.setItem(af,JSON.stringify(a)),!0}catch{return r("error:unableToCopy")}}function ah({onPaste:e,path:t,t:r,...n}){let a;try{let e=localStorage.getItem(af);if(!e)return r("error:invalidClipboardData");a=JSON.parse(e)}catch{return r("error:invalidClipboardData")}return!function({data:e,path:t,...r}){return!(typeof e>"u")&&!!t&&!!r.type&&("blocks"===r.type?function({blocksFromClipboard:e,blocksFromConfig:t}){let r=new Map(t?.map(e=>[e.slug,e]));if(!r.size)return!1;let n=new Set;for(let t of e){let e=t.slug;if(!n.has(e)){let a=r.get(e);if(!a||!ad({fieldsFromClipboard:t.fields,fieldsFromConfig:a.fields}))return!1;n.add(e)}}return!0}({blocksFromClipboard:r.blocks,blocksFromConfig:r.schemaBlocks}):ad({fieldsFromClipboard:r.fields,fieldsFromConfig:r.schemaFields}))}({...a,...n,fieldPath:t})?r("error:invalidClipboardData"):(e(a),!0)}var am=({className:e})=>(0,h.jsxs)("svg",{className:["icon icon--more",e].filter(Boolean).join(" "),viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:[(0,h.jsx)("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"}),(0,h.jsx)("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"}),(0,h.jsx)("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"})]}),ag=()=>(0,h.jsx)("svg",{className:"icon icon--copy",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:(0,h.jsx)("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 
816.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"})}),ab=e=>{let t=(0,v.c)(4),{isPaste:r,isRow:n}=e,{t:a}=(0,f.d)(),l;if(t[0]!==r||t[1]!==n||t[2]!==a){let e=a("general:copyField");!n&&r?e=a("general:pasteField"):n&&!r?e=a("general:copyRow"):n&&r&&(e=a("general:pasteRow")),l=(0,h.jsxs)(c.Fragment,{children:[r?(0,h.jsx)(n0,{}):(0,h.jsx)(ag,{})," ",e]}),t[0]=r,t[1]=n,t[2]=a,t[3]=l}else l=t[3];return l},av=({allowCopy:e,allowPaste:t,className:r,copyClassName:n,disabled:a,isRow:l,onPaste:i,pasteClassName:o,path:s,...u})=>{let{t:d}=(0,f.d)(),p=["clipboard-action__popup",r].filter(Boolean).join(" "),m=(0,c.useCallback)(()=>{let e=ap({path:s,t:d,...u});"string"==typeof e?nI.error(e):nI.success(d("general:copied"))},[d,u,s]),g=(0,c.useCallback)(()=>{let e=ah("array"===u.type?{onPaste:i,path:s,schemaFields:u.fields,t:d}:{onPaste:i,path:s,schemaBlocks:u.blocks,t:d});"string"==typeof e&&nI.error(e)},[i,u,s,d]);return t||e?(0,h.jsx)(al,{button:(0,h.jsx)(am,{}),className:p,disabled:a,horizontalAlign:"center",render:({close:r})=>(0,h.jsxs)(n6.ButtonGroup,{children:[(0,h.jsx)(n6.Button,{className:n,disabled:!e,onClick:()=>{m(),r()},children:(0,h.jsx)(ab,{isRow:l})}),(0,h.jsx)(n6.Button,{className:o,disabled:!t,onClick:()=>{g(),r()},children:(0,h.jsx)(ab,{isPaste:!0,isRow:l})})]}),size:"large",verticalAlign:"bottom"}):null},ay=(0,p.e)(rZ(),1),ax="default"in ay.default?ay.default.default:ay.default;function aw({formState:e,path:t,rowIndex:r}){let n={},a="number"!=typeof r?t:`${t}.${r}`;for(let t in e){if(!t.startsWith(a))continue;let{customComponents:r,validate:l,...i}=e[t];Array.isArray(i.rows)&&(i.rows=i.rows.map(e=>{if(!e||"object"!=typeof e)return e;let{customComponents:t,...r}=e;return r})),n[t]=i}return n}function aC({dataFromClipboard:e,formState:t,path:r,rowIndex:n}){let a,{type:l,data:i,path:o,rowIndex:s}=e,c="number"!=typeof s,u="number"!=typeof n,d=!c&&u,f="array"===l,p;if(p=c&&u?o:c?`${o}.${n}`:`${o}.${s}`,a=u?d?`${r}.0`:r:`${r}.${n}`,d){let e=`${r}.0`,n=i[`${p}.id`]?.value,a=t[r].rows?.length;for(let l in t[r].rows=[{...a&&f?t[r].rows[0]:{},id:n,isLoading:!1,lastRenderedPath:e}],t[r].value=1,t[r].initialValue=1,t[r].disableFormData=!0,t)l!==r&&!l.startsWith(e)&&l.startsWith(r)&&delete t[l]}let h=new Map;for(let e in i){if(!u&&e===`${p}.id`||!e.startsWith(p))continue;let r=e.replace(p,a),n=f?t[r]?.customComponents:void 0,l=f?t[r]?.validate:void 0;if(e.endsWith(".id")&&i[e]?.value){let a=i[e].value;if("string"==typeof a&&ax.isValid(a)){let a=new ax().toHexString();h.set(e,a),t[r]={customComponents:n,validate:l,...i[e],initialValue:a,value:a};continue}}t[r]={customComponents:n,validate:l,...i[e]}}for(let[e,r]of h){let n=e.replace(`${p}.`,"").split(".");if(n.length>=2){let e=parseInt(n[n.length-2],10),l=n.slice(0,n.length-2).join("."),i=l?`${a}.${l}`:a;if(t[i]&&Array.isArray(t[i].rows)){let n=t[i].rows;!isNaN(e)&&n[e]&&(n[e].id=r)}}else if(1===n.length&&"id"===n[0]){let e=a.split("."),n=e[e.length-1],l=isNaN(parseInt(n,10))?0:parseInt(n,10),i=isNaN(parseInt(n,10))?a:e.slice(0,-1).join(".");if(t[i]&&Array.isArray(t[i].rows)){let e=t[i].rows;e[l]&&(e[l].id=r)}}}return t}function aj(e){var t,r;let n;return e?"[object Window]"===(n=Object.prototype.toString.call(e))||"[object global]"===n?e:"nodeType"in e&&null!=(t=null==(r=e.ownerDocument)?void 0:r.defaultView)?t:window:window}var aS="u">typeof window&&"u">typeof window.document&&"u">typeof window.document.createElement?c.useLayoutEffect:c.useEffect,a$={},a_=function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return r.reduce((e,t)=>{for(let[r,n]of Object.entries(t)){let t=e[r];null!=t&&(e[r]=t+-1*n)}return e},{...e})},ak=Object.freeze({Translate:{toString(e){if(!e)return;let{x:t,y:r}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(r?Math.round(r):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;let{scaleX:t,scaleY:r}=e;return"scaleX("+t+") scaleY("+r+")"}},Transform:{toString(e){if(e)return[ak.Translate.toString(e),ak.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:r,easing:n}=e;return t+" "+r+"ms "+n}}});function aE(e,t,r){let n=e.slice();return n.splice(r<0?n.length+r:r,0,n.splice(t,1)[0]),n}function aN(e){return null!==e&&e>=0}var aP=e=>{let{rects:t,activeIndex:r,overIndex:n,index:a}=e,l=aE(t,n,r),i=t[a],o=l[a];return o&&i?{x:o.left-i.left,y:o.top-i.top,scaleX:o.width/i.width,scaleY:o.height/i.height}:null}
8,aT="Sortable",aD=c.default.createContext({activeIndex:-1,containerId:aT,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:aP,disabled:{draggable:!1,droppable:!1}});function aR(e){let{children:t,id:r,items:n,strategy:a=aP,disabled:l=!1}=e,{active:i,dragOverlay:o,droppableRects:s,over:u,measureDroppableContainers:d}=tw(),f=(0,c.useMemo)(()=>{if(r)return r;let e=null==a$[aT]?0:a$[aT]+1;return a$[aT]=e,aT+"-"+e},[aT,r]),p=null!==o.rect,h=(0,c.useMemo)(()=>n.map(e=>"object"==typeof e&&"id"in e?e.id:e),[n]),m=null!=i,g=i?h.indexOf(i.id):-1,b=u?h.indexOf(u.id):-1,v=(0,c.useRef)(h),y=!function(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(e[r]!==t[r])return!1;return!0}(h,v.current),x=-1!==b&&-1===g||y,w="boolean"==typeof l?{draggable:l,droppable:l}:l;aS(()=>{y&&m&&d(h)},[y,h,m,d]),(0,c.useEffect)(()=>{v.current=h},[h]);let C=(0,c.useMemo)(()=>({activeIndex:g,containerId:f,disabled:w,disableTransforms:x,items:h,overIndex:b,useDragOverlay:p,sortedRects:h.reduce((e,t,r)=>{let n=s.get(t);return n&&(e[r]=n),e},Array(h.length)),strategy:a}),[g,f,w.draggable,w.droppable,x,h,b,s,p,a]);return c.default.createElement(aD.Provider,{value:C},t)}var aA=e=>{let{id:t,items:r,activeIndex:n,overIndex:a}=e;return aE(r,n,a).indexOf(t)},aO=e=>{let{containerId:t,isSorting:r,wasDragging:n,index:a,items:l,newIndex:i,previousItems:o,previousContainerId:s,transition:c}=e;return!!c&&!!n&&(o===l||a!==i)&&(!!r||i!==a&&t===s)},aL={duration:200,easing:"ease"},aM="transform",aI=ak.Transition.toString({property:aM,duration:0,easing:"linear"}),aF={roleDescription:"sortable"};function aB(e){if(!e)return!1;let t=e.data.current;return!!(t&&"sortable"in t&&"object"==typeof t.sortable&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}var az=[lH.Down,lH.Right,lH.Up,lH.Left],aU=(e,t)=>{let{context:{active:r,collisionRect:n,droppableRects:a,droppableContainers:l,over:i,scrollableAncestors:o}}=t;if(az.includes(e.code)){if(e.preventDefault(),!r||!n)return;let t=[];l.getEnabled().forEach(r=>{if(!r||null!=r&&r.disabled)return;let l=a.get(r.id);if(l)switch(e.code){case lH.Down:n.top<l.top&&t.push(r);break;case lH.Up:n.top>l.top&&t.push(r);break;case lH.Left:n.left>l.left&&t.push(r);break;case lH.Right:n.left<l.left&&t.push(r)}});let u=ey({active:r,collisionRect:n,droppableRects:a,droppableContainers:t,pointerCoordinates:null}),d=eg(u,"id");if(d===i?.id&&u.length>1&&(d=u[1].id),null!=d){let e=l.get(r.id),t=l.get(d),i=t?a.get(t.id):null,u=t?.node.current;if(u&&i&&e&&t){var s,c;let r=eE(u).some((e,t)=>o[t]!==e),a=aV(e,t),l=(s=e,c=t,!!aB(s)&&!!aB(c)&&!!aV(s,c)&&s.data.current.sortable.index<c.data.current.sortable.index),d=r||!a?{x:0,y:0}:{x:l?n.width-i.width:0,y:l?n.height-i.height:0},f={x:i.left,y:i.top};return d.x&&d.y?f:a_(f,d)}}}};function aV(e,t){return!!aB(e)&&!!aB(t)&&e.data.current.sortable.containerId===t.data.current.sortable.containerId}var aH=e=>{let t,r,n=(0,v.c)(17),{id:a,disabled:l}=e,i;n[0]===Symbol.for("react.memo_cache_sentinel")?(i={duration:250,easing:"cubic-bezier(0, 0.2, 0.2, 1)"},n[0]=i):i=n[0],n[1]!==l||n[2]!==a?(t={id:a,disabled:l,transition:i},n[1]=l,n[2]=a,n[3]=t):t=n[3];let{attributes:o,isDragging:s,listeners:u,setNodeRef:d,transform:f,transition:p}=function(e){var t,r,n,a;let{animateLayoutChanges:l=aO,attributes:i,disabled:o,data:s,getNewIndex:u=aA,id:d,strategy:f,resizeObserverConfig:p,transition:h=aL}=e,{items:m,containerId:g,activeIndex:b,disabled:v,disableTransforms:y,sortedRects:x,overIndex:w,useDragOverlay:C,strategy:j}=(0,c.useContext)(aD),S=(t=o,r=v,"boolean"==typeof t?{draggable:t,droppable:!1}:{draggable:null!=(n=t?.draggable)?n:r.draggable,droppable:null!=(a=t?.droppable)?a:r.droppable}),$=m.indexOf(d),_=(0,c.useMemo)(()=>({sortable:{containerId:g,index:$,items:m},...s}),[g,s,$,m]),k=(0,c.useMemo)(()=>m.slice(m.indexOf(d)),[m,d]),{rect:E,node:N,isOver:P,setNodeRef:T}=tj({id:d,data:_,disabled:S.droppable,resizeObserverConfig:{updateMeasurementsFor:k,...p}}),{active:D,activatorEvent:R,activeNodeRect:A,attributes:O,setNodeRef:L,listeners:M,isDragging:I,over:F,setActivatorNodeRef:B,transform:z}=tx({id:d,data:_,attributes:{...aF,...i},disabled:S.draggable}),U=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return(0,c.useMemo)(()=>e=>{t.forEach(t=>t(e))},t)}(T,L),V=!!D,H=V&&!y&&aN(b)&&aN(w),q=!C&&I,K=H?(q&&H?z:null)??(f??j)({rects:x,activeNodeRect:A,activeIndex:b,overIndex:w,index:$}):null,W=aN(b)&&aN(w)?u({id:d,items:m,activeIndex:b,overIndex:w}):$,G=D?.id,Y=(0,c.useRef)({activeId:G,items:m,newIndex:W,containerId:g}),Q=m!==Y.current.items,X=l({active:D,containerId:g,isDragging:I,isSorting:V,id:d,index:$,items:m,newIndex:Y.current.newIndex,previousItems:Y.current.items,previousContainerId:Y.current.containerId,transition:h,wasDragging:null!=Y.current.activeId}),J=function(e){let{disabled:t,index:r,node:n,rect:a}
8=e,[l,i]=(0,c.useState)(null),o=(0,c.useRef)(r);return aS(()=>{if(!t&&r!==o.current&&n.current){let e=a.current;if(e){let t=e_(n.current,{ignoreTransform:!0}),r={x:e.left-t.left,y:e.top-t.top,scaleX:e.width/t.width,scaleY:e.height/t.height};(r.x||r.y)&&i(r)}}r!==o.current&&(o.current=r)},[t,r,n,a]),(0,c.useEffect)(()=>{l&&i(null)},[l]),l}({disabled:!X,index:$,node:N,rect:E});return(0,c.useEffect)(()=>{V&&Y.current.newIndex!==W&&(Y.current.newIndex=W),g!==Y.current.containerId&&(Y.current.containerId=g),m!==Y.current.items&&(Y.current.items=m)},[V,W,g,m]),(0,c.useEffect)(()=>{if(G===Y.current.activeId)return;if(null!=G&&null==Y.current.activeId){Y.current.activeId=G;return}let e=setTimeout(()=>{Y.current.activeId=G},50);return()=>clearTimeout(e)},[G]),{active:D,activeIndex:b,attributes:O,data:_,rect:E,index:$,newIndex:W,items:m,isOver:P,isSorting:V,isDragging:I,listeners:M,node:N,overIndex:w,over:F,setNodeRef:U,setActivatorNodeRef:B,setDroppableNodeRef:T,setDraggableNodeRef:L,transform:J??K,transition:J||Q&&Y.current.newIndex===$?aI:!(q&&!function(e){if(!e)return!1;let{KeyboardEvent:t}=aj(e.target);return t&&e instanceof t}(R)||!h)&&(V||X)?ak.Transition.toString({...h,property:aM}):void 0}}(t),h=s?"grabbing":"grab",m;n[4]!==h||n[5]!==p?(m={cursor:h,transition:p},n[4]=h,n[5]=p,n[6]=m):m=n[6],n[7]!==o||n[8]!==m?(r={...o,style:m},n[7]=o,n[8]=m,n[9]=r):r=n[9];let g=f&&`translate3d(${f.x}px, ${f.y}px, 0)`,b;return n[10]!==s||n[11]!==u||n[12]!==d||n[13]!==r||n[14]!==g||n[15]!==p?(b={attributes:r,isDragging:s,listeners:u,setNodeRef:d,transform:g,transition:p},n[10]=s,n[11]=u,n[12]=d,n[13]=r,n[14]=g,n[15]=p,n[16]=b):b=n[16],b},aq=e=>{let t=(0,v.c)(12),{id:r,children:n,disabled:a}=e,l;t[0]!==a||t[1]!==r?(l={id:r,disabled:a},t[0]=a,t[1]=r,t[2]=l):l=t[2];let{attributes:i,isDragging:o,listeners:s,setNodeRef:u,transform:d,transition:f}=aH(l),p=o?"grabbing":"grab",m;return t[3]!==i||t[4]!==n||t[5]!==o||t[6]!==s||t[7]!==u||t[8]!==p||t[9]!==d||t[10]!==f?(m=(0,h.jsx)(c.Fragment,{children:n({attributes:{...i,style:{cursor:p}},isDragging:o,listeners:s,setNodeRef:u,transform:d,transition:f})}),t[3]=i,t[4]=n,t[5]=o,t[6]=s,t[7]=u,t[8]=p,t[9]=d,t[10]=f,t[11]=m):m=t[11],m},aK=e=>{let t,r,n=(0,v.c)(20),{children:a,className:l,ids:i,onDragEnd:o,onDragStart:s}=e,u=(0,c.useId)(),d=(0,c.useId)(),f;n[0]!==u?(f={id:u},n[0]=u,n[1]=f):f=n[1];let{setNodeRef:p}=tj(f),m;n[2]===Symbol.for("react.memo_cache_sentinel")?(m={activationConstraint:{distance:5}},n[2]=m):m=n[2],n[3]===Symbol.for("react.memo_cache_sentinel")?(t={activationConstraint:{delay:200,tolerance:5}},n[3]=t):t=n[3],n[4]===Symbol.for("react.memo_cache_sentinel")?(r={coordinateGetter:aU},n[4]=r):r=n[4];let g=eu(ec(e0,m),ec(e2,t),ec(eW,r)),b;n[5]!==i||n[6]!==o?(b=e=>{let{active:t,over:r}=e;e.activatorEvent.stopPropagation(),t&&r&&"function"==typeof o&&o({event:e,moveFromIndex:i.findIndex(e=>e===t.id),moveToIndex:i.findIndex(e=>e===r.id)})},n[5]=i,n[6]=o,n[7]=b):b=n[7];let y=b,x;n[8]!==s?(x=e=>{let{active:t}=e;t&&"function"==typeof s&&s({id:t.id,event:e})},n[8]=s,n[9]=x):x=n[9];let w=x,C;return n[10]!==a||n[11]!==l||n[12]!==u||n[13]!==y||n[14]!==w||n[15]!==i||n[16]!==g||n[17]!==p||n[18]!==d?(C=(0,h.jsx)(tb,{collisionDetection:ev,id:u,onDragEnd:y,onDragStart:w,sensors:g,children:(0,h.jsx)(aR,{id:d,items:i,children:(0,h.jsx)("div",{className:l,ref:p,children:a})})}),n[10]=a,n[11]=l,n[12]=u,n[13]=y,n[14]=w,n[15]=i,n[16]=g,n[17]=p,n[18]=d,n[19]=C):C=n[19],C},aW="error-pill",aG=e=>{let{className:t,count:r,i18n:n,withMessage:a}=e,l=[aW,!a&&r<99&&`${aW}--fixed-width`,t&&t].filter(Boolean).join(" ");return 0===r?null:(0,h.jsx)("div",{className:l,children:(0,h.jsxs)("div",{className:`${aW}__content`,children:[(0,h.jsx)("span",{className:`${aW}__count`,children:r}),a&&` ${r>1?n.t("general:errors"):n.t("general:error")}`]})})},aY="field-description",aQ=e=>{let t=(0,v.c)(8),{className:r,description:n,marginPlacement:a,path:l}=e,{i18n:i}=(0,f.d)();if(n){let e=`field-description-${l?.replace(/\./g,"__")}`,o=a&&`${aY}--margin-${a}`,s;t[0]!==r||t[1]!==e||t[2]!==o?(s=[aY,r,e,o].filter(Boolean),t[0]=r,t[1]=e,t[2]=o,t[3]=s):s=t[3];let c=s.join(" "),u;return t[4]!==n||t[5]!==i||t[6]!==c?(u=(0,h.jsx)("div",{className:c,children:m(n,i)}),t[4]=n,t[5]=i,t[6]=c,t[7]=u):u=t[7],u}return null},aX=e=>{let t=(0,v.c)(8),{alignCaret:r,message:n,path:a,showError:l}=e,i=void 0===r?"right":r,o=nv(),s;t[0]!==a?(s=e=>{let[t]=e;return t&&t?.[a]||null},t[0]=a,t[1]=s):s=t[1];let c=nj(s),u;if(t[2]!==i||t[3]!==c||t[4]!==o||t[5]!==n||t[6]!==l){u=Symbol.for("react.early_return_sentinel");e:{let{errorMessage:e,valid:t}=c||{},r=n||e;if((l||o&&!1===t)&&r?.length){u=(0,h.jsx)(ao,{alignCaret:i,className:"field-error",delay:0,staticPositioning:!0,children:r});break e}}t[2]=i,t[3]=c,t[4]=o,t[5]=n,t[6]=l,t[7]=u}else u=t[7];return u!==Symbol.for("react.early_return_sentinel")?u:null},aJ=(0,c.createContext)(0),aZ=e=>{let t=(0,v.c)(3),{children:r}=e,n=a0()+1,a;return t[0]!==r||t[1]!==n?(a=(0,h.jsx)(aJ,{value:n,children:r}),t[0]=r,t[1]=n,t[2]=a):a=t[2],a},a0=()=>(0,c.use)(aJ),a1=(e,t)=>e?.locales&&0!==e.locales.length?e.locales.find(e=>e?.code===t):null;function a2(){return(a2=Object.assign.bind()).apply(null,arguments)}function a3(e,t){if(null==e)return{};var r={};for(var n in e)if(({}).hasOwnProperty.call(e,n)){if(-1!==t.indexOf(n))continue;r[n]=e[n]}return r}
8function a6(e,t){return(a6=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function a5(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,a6(e,t)}function a4(e,t){return e.replace(RegExp("(^|\\s)"+t+"(?:\\s|$)","g"),"$1").replace(/\s+/g," ").replace(/^\s*|\s*$/g,"")}var a8=c.default.createContext(null),a7=function(e){return e.scrollTop},a9="unmounted",le="exited",lt="entering",lr="entered",ln="exiting",la=function(e){function t(t,r){var n,a=e.call(this,t,r)||this,l=r&&!r.isMounting?t.enter:t.appear;return a.appearStatus=null,t.in?l?(n=le,a.appearStatus=lt):n=lr:n=t.unmountOnExit||t.mountOnEnter?a9:le,a.state={status:n},a.nextCallback=null,a}a5(t,e),t.getDerivedStateFromProps=function(e,t){return e.in&&t.status===a9?{status:le}:null};var r=t.prototype;return r.componentDidMount=function(){this.updateStatus(!0,this.appearStatus)},r.componentDidUpdate=function(e){var t=null;if(e!==this.props){var r=this.state.status;this.props.in?r!==lt&&r!==lr&&(t=lt):(r===lt||r===lr)&&(t=ln)}this.updateStatus(!1,t)},r.componentWillUnmount=function(){this.cancelNextCallback()},r.getTimeouts=function(){var e,t,r,n=this.props.timeout;return e=t=r=n,null!=n&&"number"!=typeof n&&(e=n.exit,t=n.enter,r=void 0!==n.appear?n.appear:t),{exit:e,enter:t,appear:r}},r.updateStatus=function(e,t){if(void 0===e&&(e=!1),null!==t)if(this.cancelNextCallback(),t===lt){if(this.props.unmountOnExit||this.props.mountOnEnter){var r=this.props.nodeRef?this.props.nodeRef.current:u.default.findDOMNode(this);r&&a7(r)}this.performEnter(e)}else this.performExit();else this.props.unmountOnExit&&this.state.status===le&&this.setState({status:a9})},r.performEnter=function(e){var t=this,r=this.props.enter,n=this.context?this.context.isMounting:e,a=this.props.nodeRef?[n]:[u.default.findDOMNode(this),n],l=a[0],i=a[1],o=this.getTimeouts(),s=n?o.appear:o.enter;(e||r)&&1?(this.props.onEnter(l,i),this.safeSetState({status:lt},function(){t.props.onEntering(l,i),t.onTransitionEnd(s,function(){t.safeSetState({status:lr},function(){t.props.onEntered(l,i)})})})):this.safeSetState({status:lr},function(){t.props.onEntered(l)})},r.performExit=function(){var e=this,t=this.props.exit,r=this.getTimeouts(),n=this.props.nodeRef?void 0:u.default.findDOMNode(this);t?(this.props.onExit(n),this.safeSetState({status:ln},function(){e.props.onExiting(n),e.onTransitionEnd(r.exit,function(){e.safeSetState({status:le},function(){e.props.onExited(n)})})})):this.safeSetState({status:le},function(){e.props.onExited(n)})},r.cancelNextCallback=function(){null!==this.nextCallback&&(this.nextCallback.cancel(),this.nextCallback=null)},r.safeSetState=function(e,t){t=this.setNextCallback(t),this.setState(e,t)},r.setNextCallback=function(e){var t=this,r=!0;return this.nextCallback=function(n){r&&(r=!1,t.nextCallback=null,e(n))},this.nextCallback.cancel=function(){r=!1},this.nextCallback},r.onTransitionEnd=function(e,t){this.setNextCallback(t);var r=this.props.nodeRef?this.props.nodeRef.current:u.default.findDOMNode(this),n=null==e&&!this.props.addEndListener;if(!r||n)return void setTimeout(this.nextCallback,0);if(this.props.addEndListener){var a=this.props.nodeRef?[this.nextCallback]:[r,this.nextCallback],l=a[0],i=a[1];this.props.addEndListener(l,i)}null!=e&&setTimeout(this.nextCallback,e)},r.render=function(){var e=this.state.status;if(e===a9)return null;var t=this.props,r=t.children,n=(t.in,t.mountOnEnter,t.unmountOnExit,t.appear,t.enter,t.exit,t.timeout,t.addEndListener,t.onEnter,t.onEntering,t.onEntered,t.onExit,t.onExiting,t.onExited,t.nodeRef,a3(t,["children","in","mountOnEnter","unmountOnExit","appear","enter","exit","timeout","addEndListener","onEnter","onEntering","onEntered","onExit","onExiting","onExited","nodeRef"]));return c.default.createElement(a8.Provider,{value:null},"function"==typeof r?r(e,n):c.default.cloneElement(c.default.Children.only(r),n))},t}(c.default.Component);function ll(){}la.contextType=a8,la.propTypes={},la.defaultProps={in:!1,mountOnEnter:!1,unmountOnExit:!1,appear:!1,enter:!0,exit:!0,onEnter:ll,onEntering:ll,onEntered:ll,onExit:ll,onExiting:ll,onExited:ll},la.UNMOUNTED=a9,la.EXITED=le,la.ENTERING=lt,la.ENTERED=lr,la.EXITING=ln;var li=function(e,t){return e&&t&&t.split(" ").forEach(function(t){e.classList?e.classList.remove(t):"string"==typeof e.className?e.className=a4(e.className,t):e.setAttribute("class",a4(e.className&&e.className.baseVal||"",t))})},lo=function(e){function t(){for(var t,r=arguments.length,n=Array(r),a=0;a<r;a++)n[a]=arguments[a];
8return(t=e.call.apply(e,[this].concat(n))||this).appliedClasses={appear:{},enter:{},exit:{}},t.onEnter=function(e,r){var n=t.resolveArguments(e,r),a=n[0],l=n[1];t.removeClasses(a,"exit"),t.addClass(a,l?"appear":"enter","base"),t.props.onEnter&&t.props.onEnter(e,r)},t.onEntering=function(e,r){var n=t.resolveArguments(e,r),a=n[0],l=n[1];t.addClass(a,l?"appear":"enter","active"),t.props.onEntering&&t.props.onEntering(e,r)},t.onEntered=function(e,r){var n=t.resolveArguments(e,r),a=n[0],l=n[1]?"appear":"enter";t.removeClasses(a,l),t.addClass(a,l,"done"),t.props.onEntered&&t.props.onEntered(e,r)},t.onExit=function(e){var r=t.resolveArguments(e)[0];t.removeClasses(r,"appear"),t.removeClasses(r,"enter"),t.addClass(r,"exit","base"),t.props.onExit&&t.props.onExit(e)},t.onExiting=function(e){var r=t.resolveArguments(e)[0];t.addClass(r,"exit","active"),t.props.onExiting&&t.props.onExiting(e)},t.onExited=function(e){var r=t.resolveArguments(e)[0];t.removeClasses(r,"exit"),t.addClass(r,"exit","done"),t.props.onExited&&t.props.onExited(e)},t.resolveArguments=function(e,r){return t.props.nodeRef?[t.props.nodeRef.current,e]:[e,r]},t.getClassNames=function(e){var r=t.props.classNames,n="string"==typeof r,a=n&&r?r+"-":"",l=n?""+a+e:r[e],i=n?l+"-active":r[e+"Active"],o=n?l+"-done":r[e+"Done"];return{baseClassName:l,activeClassName:i,doneClassName:o}},t}a5(t,e);var r=t.prototype;return r.addClass=function(e,t,r){var n,a=this.getClassNames(t)[r+"ClassName"],l=this.getClassNames("enter").doneClassName;"appear"===t&&"done"===r&&l&&(a+=" "+l),"active"===r&&e&&a7(e),a&&(this.appliedClasses[t][r]=a,n=a,e&&n&&n.split(" ").forEach(function(t){e.classList?e.classList.add(t):(e.classList?!!t&&e.classList.contains(t):-1!==(" "+(e.className.baseVal||e.className)+" ").indexOf(" "+t+" "))||("string"==typeof e.className?e.className=e.className+" "+t:e.setAttribute("class",(e.className&&e.className.baseVal||"")+" "+t))}))},r.removeClasses=function(e,t){var r=this.appliedClasses[t],n=r.base,a=r.active,l=r.done;this.appliedClasses[t]={},n&&li(e,n),a&&li(e,a),l&&li(e,l)},r.render=function(){var e=this.props,t=(e.classNames,a3(e,["classNames"]));return c.default.createElement(la,a2({},t,{onEnter:this.onEnter,onEntered:this.onEntered,onEntering:this.onEntering,onExit:this.onExit,onExiting:this.onExiting,onExited:this.onExited}))},t}(c.default.Component);lo.defaultProps={classNames:""},lo.propTypes={};var ls=(0,c.createContext)({}),lc=()=>(0,c.useContext)(ls),lu=e=>e?{appear:`${e}--appear`,appearActive:`${e}--appearActive`,appearDone:`${e}--appearDone`,enter:`${e}--enter`,enterActive:`${e}--enterActive`,enterDone:`${e}--enterDone`,exit:`${e}--exit`,exitActive:`${e}--exitActive`,exitDone:`${e}--exitDone`}:{};function ld(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function lf(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ld(Object(r),!0).forEach(function(t){var n,a,l;n=e,a=t,l=r[t],(a=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(a))in n?Object.defineProperty(n,a,{value:l,enumerable:!0,configurable:!0,writable:!0}):n[a]=l}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ld(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}(0,f.j)();var lp=function(e,t){if(e.length>0){var r=e[e.length-1];r!==t&&r.pause()}var n=e.indexOf(t);-1===n||e.splice(n,1),e.push(t)},lh=function(e,t){var r=e.indexOf(t);-1!==r&&e.splice(r,1),e.length>0&&e[e.length-1].unpause()},lm=function(e){return e?.key==="Tab"||e?.keyCode===9},lg=function(e){return lm(e)&&!e.shiftKey},lb=function(e){return lm(e)&&e.shiftKey},lv=function(e){return setTimeout(e,0)},ly=function(e,t){var r=-1;return e.every(function(e,n){return!t(e)||(r=n,!1)}),r},lx=function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return"function"==typeof e?e.apply(void 0,r):e},lw=function(e){return e.target.shadowRoot&&"function"==typeof e.composedPath?e.composedPath()[0]:e.target},lC=[],lj=function(e,t){var r,n=t?.document||document,a=t?.trapStack||lC,l=lf({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0,isKeyForward:lg,isKeyBackward:lb},t),i={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0,recentNavEvent:void 0},o=function(e,t,r){return e&&void 0!==e[t]?e[t]:l[r||t]},s=function(e,t){var r="function"==typeof t?.composedPath?t.composedPath():void 0;return i.containerGroups.findIndex(function(t){var n=t.container,a=t.tabbableNodes;return n.contains(e)||r?.includes(n)||a.find(function(t){return t===e})})},c=function(e){var t=l[e];if("function"==typeof t){for(var r=arguments.length,a=Array(r>1?r-1:0),i=1;i<r;i++)a[i-1]=arguments[i];t=t.apply(void 0,a)}if(!0===t&&(t=void 0),!t){if(void 0===t||!1===t)return t;throw Error("`".concat(e,"` was specified but was not a node, or did not return a node"))}var o=t;if("string"==typeof t&&!(o=n.querySelector(t)))throw Error("`".concat(e,"` as selector refers to no known node"));return o},u=function(){var e=c("initialFocus");if(!1===e)return!1;if(void 0===e||!(0,f.i)(e,l.tabbableOptions))if(s(n.activeElement)>=0)e=n.activeElement;else{var t=i.tabbableGroups[0];e=t&&t.firstTabbableNode||c("fallbackFocus")}if(!e)throw Error("Your focus-trap needs to have at least one focusable element");return e},d=function(){if(i.containerGroups=i.containers.map(function(e){var t=(0,f.f)(e,l.tabbableOptions),r=(0,f.g)(e,l.tabbableOptions),n=t.length>0?t[0]:void 0,a=t.length>0?t[t.length-1]:void 0,i=r.find(function(e){return(0,f.h)(e)}),o=r.slice().reverse().find(function(e){return(0,f.h)(e)}),s=!!t.find(function(e){return(0,f.e)(e)>0});return{container:e,tabbableNodes:t,focusableNodes:r,posTabIndexesFound:s,firstTabbableNode:n,lastTabbableNode:a,firstDomTabbableNode:i,lastDomTabbableNode:o,nextTabbableNode:function(e){var n=!(arguments.length>1)||void 0===arguments[1]||arguments[1],a=t.indexOf(e);return a<0?n?r.slice(r.indexOf(e)+1).find(function(e){return(0,f.h)(e)}):r.slice(0,r.indexOf(e)).reverse().find(function(e){return(0,f.h)(e)}):t[a+(n?1:-1)]}}}),i.tabbableGroups=i.containerGroups.filter(function(e){return e.tabbableNodes.length>0}),i.tabbableGroups.length<=0&&!c("fallbackFocus"))throw 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(e){return e.posTabIndexesFound}
8)&&i.containerGroups.length>1)throw 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.")},p=function e(t){var r=t.activeElement;if(r)return r.shadowRoot&&null!==r.shadowRoot.activeElement?e(r.shadowRoot):r},h=function e(t){if(!1!==t&&t!==p(document)){if(!t||!t.focus)return void e(u());t.focus({preventScroll:!!l.preventScroll}),i.mostRecentlyFocusedNode=t,t.tagName&&"input"===t.tagName.toLowerCase()&&"function"==typeof t.select&&t.select()}},m=function(e){var t=c("setReturnFocus",e);return t||!1!==t&&e},g=function(e){var t=e.target,r=e.event,n=e.isBackward,a=void 0!==n&&n;t=t||lw(r),d();var o=null;if(i.tabbableGroups.length>0){var u=s(t,r),p=u>=0?i.containerGroups[u]:void 0;if(u<0)o=a?i.tabbableGroups[i.tabbableGroups.length-1].lastTabbableNode:i.tabbableGroups[0].firstTabbableNode;else if(a){var h=ly(i.tabbableGroups,function(e){var r=e.firstTabbableNode;return t===r});if(h<0&&(p.container===t||(0,f.i)(t,l.tabbableOptions)&&!(0,f.h)(t,l.tabbableOptions)&&!p.nextTabbableNode(t,!1))&&(h=u),h>=0){var m=0===h?i.tabbableGroups.length-1:h-1,g=i.tabbableGroups[m];o=(0,f.e)(t)>=0?g.lastTabbableNode:g.lastDomTabbableNode}else lm(r)||(o=p.nextTabbableNode(t,!1))}else{var b=ly(i.tabbableGroups,function(e){var r=e.lastTabbableNode;return t===r});if(b<0&&(p.container===t||(0,f.i)(t,l.tabbableOptions)&&!(0,f.h)(t,l.tabbableOptions)&&!p.nextTabbableNode(t))&&(b=u),b>=0){var v=b===i.tabbableGroups.length-1?0:b+1,y=i.tabbableGroups[v];o=(0,f.e)(t)>=0?y.firstTabbableNode:y.firstDomTabbableNode}else lm(r)||(o=p.nextTabbableNode(t))}}else o=c("fallbackFocus");return o},b=function(e){if(!(s(lw(e),e)>=0)){if(lx(l.clickOutsideDeactivates,e))return void r.deactivate({returnFocus:l.returnFocusOnDeactivate});lx(l.allowOutsideClick,e)||e.preventDefault()}},v=function(e){var t=lw(e),r=s(t,e)>=0;if(r||t instanceof Document)r&&(i.mostRecentlyFocusedNode=t);else{e.stopImmediatePropagation();var n,a=!0;if(i.mostRecentlyFocusedNode)if((0,f.e)(i.mostRecentlyFocusedNode)>0){var o=s(i.mostRecentlyFocusedNode),c=i.containerGroups[o].tabbableNodes;if(c.length>0){var d=c.findIndex(function(e){return e===i.mostRecentlyFocusedNode});d>=0&&(l.isKeyForward(i.recentNavEvent)?d+1<c.length&&(n=c[d+1],a=!1):d-1>=0&&(n=c[d-1],a=!1))}}else i.containerGroups.some(function(e){return e.tabbableNodes.some(function(e){return(0,f.e)(e)>0})})||(a=!1);else a=!1;a&&(n=g({target:i.mostRecentlyFocusedNode,isBackward:l.isKeyBackward(i.recentNavEvent)})),h(n||i.mostRecentlyFocusedNode||u())}i.recentNavEvent=void 0},y=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];i.recentNavEvent=e;var r=g({event:e,isBackward:t});r&&(lm(e)&&e.preventDefault(),h(r))},x=function(e){if((e?.key==="Escape"||e?.key==="Esc"||e?.keyCode===27)&&!1!==lx(l.escapeDeactivates,e)){e.preventDefault(),r.deactivate();return}(l.isKeyForward(e)||l.isKeyBackward(e))&&y(e,l.isKeyBackward(e))},w=function(e){s(lw(e),e)>=0||lx(l.clickOutsideDeactivates,e)||lx(l.allowOutsideClick,e)||(e.preventDefault(),e.stopImmediatePropagation())},C=function(){if(i.active)return lp(a,r),i.delayInitialFocusTimer=l.delayInitialFocus?lv(function(){h(u())}):h(u()),n.addEventListener("focusin",v,!0),n.addEventListener("mousedown",b,{capture:!0,passive:!1}),n.addEventListener("touchstart",b,{capture:!0,passive:!1}),n.addEventListener("click",w,{capture:!0,passive:!1}),n.addEventListener("keydown",x,{capture:!0,passive:!1}),r},j=function(){if(i.active)return n.removeEventListener("focusin",v,!0),n.removeEventListener("mousedown",b,!0),n.removeEventListener("touchstart",b,!0),n.removeEventListener("click",w,!0),n.removeEventListener("keydown",x,!0),r},S="u">typeof window&&"MutationObserver"in window?new MutationObserver(function(e){e.some(function(e){return Array.from(e.removedNodes).some(function(e){return e===i.mostRecentlyFocusedNode})})&&h(u())}):void 0,$=function(){S&&(S.disconnect(),i.active&&!i.paused&&i.containers.map(function(e){S.observe(e,{subtree:!0,childList:!0})}))};return(r={get active(){return i.active},get paused(){return i.paused},activate:function(e){if(i.active)return this;var t=o(e,"onActivate"),r=o(e,"onPostActivate"),a=o(e,"checkCanFocusTrap");a||d(),i.active=!0,i.paused=!1,i.nodeFocusedBeforeActivation=n.activeElement,t?.();var l=function(){a&&d(),C(),$(),r?.()};return a?a(i.containers.concat()).then(l,l):l(),this},deactivate:function(e){if(!i.active)return this;var t=lf({onDeactivate:l.onDeactivate,onPostDeactivate:l.onPostDeactivate,checkCanReturnFocus:l.checkCanReturnFocus},e);clearTimeout(i.delayInitialFocusTimer),i.delayInitialFocusTimer=void 0,j(),i.active=!1,i.paused=!1,$(),lh(a,r);var n=o(t,"onDeactivate"),s=o(t,"onPostDeactivate"),c=o(t,"checkCanReturnFocus"),u=o(t,"returnFocus","returnFocusOnDeactivate");n?.();var d=function(){lv(function(){u&&h(m(i.nodeFocusedBeforeActivation)),s?.()})};return u&&c?c(m(i.nodeFocusedBeforeActivation)).then(d,d):d(),this},pause:function(e){if(i.paused||!i.active)return this;var t=o(e,"onPause"),r=o(e,"onPostPause");return i.paused=!0,t?.(),j(),$(),r?.(),this},unpause:function(e){if(!i.paused||!i.active)return this;var t=o(e,"onUnpause"),r=o(e,"onPostUnpause");return i.paused=!1,t?.(),d(),C(),$(),r?.(),this},updateContainerElements:function(e){return i.containers=[].concat(e).filter(
8Boolean).map(function(e){return"string"==typeof e?n.querySelector(e):e}),i.active&&d(),$(),this}}).updateContainerElements(e),r},lS=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)0>t.indexOf(n[a])&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]]);return r},l$="modal-item",l_=(a=e=>{let{children:t}=e;return t?"function"==typeof t?(0,h.jsx)(c.Fragment,{children:t(e)}):(0,h.jsx)(c.Fragment,{children:t}):null},e=>{let t=lc(),r=(0,c.useRef)(null),[n,i]=(0,c.useState)(!1),o=(0,c.useRef)(!1),[s,d]=(0,c.useState)(null),{modalState:f,classPrefix:p,containerRef:m,transTime:g,setCloseOnBlur:b,setBodyScrollLock:v,openModal:y}=t,{className:x,htmlElement:w="dialog",slug:C="",closeOnBlur:j=!0,lockBodyScroll:S=!0,classPrefix:$,onEnter:_,onEntering:k,onEntered:E,onExit:N,onExiting:P,onExited:T,openOnInit:D,trapFocus:R=!0,focusTrapOptions:A={}}=e,O=lS(e,["className","htmlElement","slug","closeOnBlur","lockBodyScroll","classPrefix","onEnter","onEntering","onEntered","onExit","onExiting","onExited","openOnInit","trapFocus","focusTrapOptions"]),L=$||p,M=l||C,I=f[M]&&f[M].isOpen;(0,c.useEffect)(()=>{if(R){let e=r.current;!1===o.current&&e&&(d(lj(e,Object.assign(Object.assign({},A),{fallbackFocus:A?.fallbackFocus||e,allowOutsideClick:!("u">typeof A.allowOutsideClick)||A.allowOutsideClick}))),o.current=!0)}},[R,n,A]),(0,c.useEffect)(()=>{i(!0)},[]),(0,c.useEffect)(()=>(s&&(I?s.activate():s.deactivate()),()=>{s&&s.deactivate()}),[I,s]),(0,c.useEffect)(()=>{I&&b(j)},[I,j,b]),(0,c.useEffect)(()=>{let e=r.current;return e&&v(!!(I&&S),e),()=>{e&&v(!1,e)}},[I,S,v]);let[F,B]=(0,c.useState)(I);if((0,c.useEffect)(()=>{I?B(I):setTimeout(()=>B(!1),g)},[I,g]),(0,c.useEffect)(()=>{D&&y(M)},[M,D,y]),m.current){let n=L?`${L}__${l$}`:l$,l=[n,`${n}--slug-${M}`,x].filter(Boolean).join(" "),i=Object.assign({role:"dialog"!==w?"dialog":void 0,open:"dialog"===w?F||I:void 0,"aria-modal":!0,"aria-label":O["aria-labelledby"]?void 0:M},O);return u.default.createPortal((0,h.jsx)(lo,{nodeRef:r,timeout:g,in:I,classNames:lu(n),appear:!0,onEnter:_,onEntering:k,onEntered:E,onExit:N,onExiting:P,onExited:T,children:(0,h.jsx)(w,Object.assign({ref:r,id:O?.id||M,className:l},i,{children:(0,h.jsx)(a,Object.assign({},e,{isOpen:I,modal:t}))}))}),m.current)}return null}),lk=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var a=0,n=Object.getOwnPropertySymbols(e);a<n.length;a++)0>t.indexOf(n[a])&&Object.prototype.propertyIsEnumerable.call(e,n[a])&&(r[n[a]]=e[n[a]]);return r},lE="modal-container",lN=e=>{let{oneModalIsOpen:t,classPrefix:r,transTime:n,setContainerRef:a,containerRef:l,closeAllModals:i,closeOnBlur:o}=lc(),{className:s,htmlElement:c="div",children:u,onClick:d}=e,f=lk(e,["className","htmlElement","children","onClick"]),p=r?`${r}__${lE}`:lE,m=[p,s].filter(Boolean).join(" "),g=Object.assign(Object.assign({},f),{onClick:e=>{o&&i(),"function"==typeof d&&d(e)}});return(0,h.jsx)(lo,{nodeRef:l,in:t,timeout:n,classNames:lu(p),appear:!0,children:(0,h.jsx)(c,Object.assign({className:m,ref:a},g,{children:u&&u}))})},lP=!1;"u">typeof window&&(lX={get passive(){lP=!0}},window.addEventListener("testPassive",null,lX),window.removeEventListener("testPassive",null,lX));var lT,lD,lR,lA,lO,lL,lM,lI,lF,lB,lz,lU,lV,lH,lq,lK,lW,lG,lY,lQ,lX,lJ="u">typeof window&&window.navigator&&window.navigator.platform&&(/iP(ad|hone|od)/.test(window.navigator.platform)||"MacIntel"===window.navigator.platform&&window.navigator.maxTouchPoints>1),lZ=[],l0=!1,l1=-1,l2=void 0,l3=void 0,l6=void 0,l5=function(e){return lZ.some(function(t){return!!(t.options.allowTouchMove&&t.options.allowTouchMove(e))})},l4=function(e){var t=e||window.event;return!!l5(t.target)||t.touches.length>1||(t.preventDefault&&t.preventDefault(),!1)},l8=function(e){if(void 0===l6){var t=!!e&&!0===e.reserveScrollBarGap,r=window.innerWidth-document.documentElement.clientWidth;if(t&&r>0){var n=parseInt(window.getComputedStyle(document.body).getPropertyValue("padding-right"),10);l6=document.body.style.paddingRight,document.body.style.paddingRight=n+r+"px"}}void 0===l2&&(l2=document.body.style.overflow,document.body.style.overflow="hidden")},l7=function(){void 0!==l6&&(document.body.style.paddingRight=l6,l6=void 0),void 0!==l2&&(document.body.style.overflow=l2,l2=void 0)},l9=function(){if(void 0!==l3){var e=-parseInt(document.body.style.top,10),t=-parseInt(document.body.style.left,10);document.body.style.position=l3.position,document.body.style.top=l3.top,document.body.style.left=l3.left,window.scrollTo(t,e),l3=void 0}},ie=function(e,t){var r=e.targetTouches[0].clientY-l1;return!l5(e.target)&&(t&&0===t.scrollTop&&r>0||t&&t.scrollHeight-t.scrollTop<=t.clientHeight&&r<0?l4(e):(e.stopPropagation(),!0))},it=function(e,t){e?!lZ.some(function(t){return t.targetElement===e})&&(lZ=[].concat(function(e){if(!Array.isArray(e))return Array.from(e);for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}(lZ),[{targetElement:e,options:t||{}}]),lJ?window.requestAnimationFrame(function(){if(void 0===l3){l3={position:document.body.style.position,top:document.body.style.top,left
8:document.body.style.left};var e=window,t=e.scrollY,r=e.scrollX,n=e.innerHeight;document.body.style.position="fixed",document.body.style.top=-t,document.body.style.left=-r,setTimeout(function(){return window.requestAnimationFrame(function(){var e=n-window.innerHeight;e&&t>=n&&(document.body.style.top=-(t+e))})},300)}}):l8(t),lJ&&(e.ontouchstart=function(e){1===e.targetTouches.length&&(l1=e.targetTouches[0].clientY)},e.ontouchmove=function(t){1===t.targetTouches.length&&ie(t,e)},l0||(document.addEventListener("touchmove",l4,lP?{passive:!1}:void 0),l0=!0))):console.error("disableBodyScroll unsuccessful - targetElement must be provided when calling disableBodyScroll on IOS devices.")},ir=function(e){e?(lZ=lZ.filter(function(t){return t.targetElement!==e}),lJ&&(e.ontouchstart=null,e.ontouchmove=null,l0&&0===lZ.length&&(document.removeEventListener("touchmove",l4,lP?{passive:!1}:void 0),l0=!1)),lJ?l9():l7()):console.error("enableBodyScroll unsuccessful - targetElement must be provided when calling enableBodyScroll on IOS devices.")},ia=(e,t)=>{let r=Object.assign({},e),{type:n,payload:a}=t;switch(n){case"UPDATE_MODAL":{let{slug:e}=a;e&&(r[e]=Object.assign(Object.assign({},r[e]),a));break}case"OPEN_MODAL":{let{slug:e}=a;e&&(e in r&&r[e].isOpen||(r[e]=Object.assign(Object.assign({},r[e]),{slug:e,openedOn:Date.now(),isOpen:!0})));break}case"TOGGLE_MODAL":{let{slug:e}=a;if(e){let t=e in r&&r[e].isOpen;r[e]=Object.assign(Object.assign({},r[e]),{slug:e,openedOn:t?void 0:Date.now(),isOpen:!t})}break}case"CLOSE_MODAL":{let{slug:e}=a;e&&(r[e]=Object.assign(Object.assign({},r[e]),{slug:e,openedOn:void 0,isOpen:!1}));break}case"REMOVE_MODAL":{let{slug:e}=a;e&&e in r&&delete r[e];break}case"CLOSE_LATEST_MODAL":{let e=Object.keys(r).reduce((e,t)=>{let n=r[t];return n.isOpen&&"number"==typeof n.openedOn&&(!e||"number"==typeof e.openedOn&&n.openedOn>e.openedOn)?n:e},void 0);e&&(r[e.slug]=Object.assign(Object.assign({},r[e.slug]),{isOpen:!1,openedOn:void 0}));break}case"CLOSE_ALL_MODALS":r=Object.entries(r).reduce((e,[t,r])=>(e[t]=Object.assign(Object.assign({},r),{isOpen:!1,openedOn:void 0}),e),{})}return r},il=e=>{let{classPrefix:t,minifyCSS:r=!0,generateCSS:n=!0,zIndex:a=9999,handleParamChange:l,children:i,transTime:o=250}=e,s=(0,c.useRef)(null),[u,d]=(0,c.useReducer)(ia,{},()=>(()=>{let e=(()=>{if("u">typeof window)return new URLSearchParams(window.location.search)})(),t=[];if(e){let r=e.get("modal");r&&(t=r.includes(",")?r.split(","):[r])}return t})().reduce((e,t)=>(e[t]={slug:t,isOpen:!0,openedOn:Date.now()},e),{})),[f,p]=(0,c.useState)(!1),[m,g]=(0,c.useState)(!1),[b,v]=(0,c.useState)(!1),[y,x]=(0,c.useState)(""),w=(0,c.useRef)(!1),C=(0,c.useCallback)(e=>{27===e.keyCode&&d({type:"CLOSE_LATEST_MODAL"})},[]);(0,c.useEffect)(()=>(w.current||(document.addEventListener("keydown",e=>C(e),!1),w.current=!0),()=>{w.current&&document.removeEventListener("keydown",e=>C(e),!1)}),[C]),(0,c.useEffect)(()=>{if(n){let e="";e=(({classPrefix:e,zIndex:t})=>{let r=e?`${e}__`:"";return`
9    .${r}${lE} {
10      top: 0;
11      right: 0;
12      bottom: 0;
13      left: 0;
14      position: fixed;
15      pointer-events: none;
16      visibility: hidden;
17      z-index: -1;
18    }
19
20    .${r}${lE}--appear,
21    .${r}${lE}--appearDone,
22    .${r}${lE}--enter,
23    .${r}${lE}--enterDone,
24    .${r}${lE}--exit {
25      pointer-events: all;
26      visibility: visible;
27      z-index: ${t};
28    }
29
30    .${r}${l$} {
31      position: absolute;
32      visibility: hidden;
33    }
34
35    .${r}${l$}--appear,
36    .${r}${l$}--appearDone,
37    .${r}${l$}--enter,
38    .${r}${l$}--enterDone,
39    .${r}${l$}--exit {
40      visibility: visible;
41    }
42  `})({classPrefix:t,zIndex:a}),r&&(e=e.replace(/\n/g,"").replace(/\s\s+/g," ")),x(e)}},[n,r,a,t]),(0,c.useEffect)(()=>{if("function"==typeof l&&l(u),"boolean"==typeof l&&l){let e=Object.keys(u).filter(e=>u[e].isOpen),t=new URLSearchParams;for(let r of e)t.append("modal",r);let r=t.toString()?`?${t}`:"",n=`${window.location.pathname}${r}`;window.history.pushState({},"",n)}},[u,l]),(0,c.useEffect)(()=>{p(Object.keys(u).some(e=>u[e].isOpen))},[u]);let j=(0,c.useCallback)((e,t)=>{t&&(e?(it(t),v(!0)):(ir(t),v(!1)))},[]),S=(0,c.useCallback)(e=>{s.current=e},[]),$=(0,c.useCallback)(e=>{d({type:"OPEN_MODAL",payload:{slug:e}})},[]),_=(0,c.useCallback)(e=>{d({type:"CLOSE_MODAL",payload:{slug:e}})},[]),k=(0,c.useCallback)(()=>{d({type:"CLOSE_ALL_MODALS"})},[]),E=(0,c.useCallback)(e=>{d({type:"TOGGLE_MODAL",payload:{slug:e}})},[]),N=(0,c.useCallback)(e=>u[e]&&u[e].isOpen,[u]),P=Object.assign({},e);return delete P.children,(0,h.jsxs)(c.Fragment,{children:[n&&(0,h.jsx)("style",{dangerouslySetInnerHTML:{__html:y}}),(0,h.jsx)(ls.Provider,{value:Object.assign(Object.assign({},P),{transTime:o,containerRef:s,modalState:u,oneModalIsOpen:f,isModalOpen:N,closeOnBlur:m,bodyScrollIsLocked:b,classPrefix:t,closeAllModals:k,setCloseOnBlur:g,openModal:$,closeModal:_,toggleModal:E,setBodyScrollLock:j,setContainerRef:S}),children:i})]})}
42,ii="gutter",io=e=>{let{children:t,className:r,left:n=!0,negativeLeft:a=!1,negativeRight:l=!1,ref:i,right:o=!0}=e,s=n&&!a,c=o&&!l;return(0,h.jsx)("div",{className:[ii,s&&`${ii}--left`,c&&`${ii}--right`,a&&`${ii}--negative-left`,l&&`${ii}--negative-right`,r].filter(Boolean).join(" "),ref:i,children:t})},is=e=>{let t=(0,v.c)(3),r=(0,c.useId)(),n=a0(),a=`${e}-${r}`,l;return t[0]!==n||t[1]!==a?(l=iu({slug:a,depth:n}),t[0]=n,t[1]=a,t[2]=l):l=t[2],l},ic="drawer",iu=({slug:e,depth:t})=>`drawer_${t}_${e}`,id=e=>{let t=(0,v.c)(4),{slug:r,children:n,className:a,disabled:l,onClick:i,...o}=e,{openModal:s}=lc(),c;return t[0]!==i||t[1]!==s||t[2]!==r?(c=e=>{s(r),"function"==typeof i&&i(e)},t[0]=i,t[1]=s,t[2]=r,t[3]=c):c=t[3],(0,h.jsx)("button",{className:a,disabled:l,onClick:c,type:"button",...o,children:n})},ip=e=>{let t=(0,v.c)(22),{slug:r,children:n,className:a,gutter:l,Header:i,hoverTitle:o,title:s}=e,u=void 0===l||l,{t:d}=(0,f.d)(),{closeModal:p,modalState:m}=lc(),g=ig(),b=!!m[r]?.isOpen,[y,x]=(0,c.useState)(b),w,C;if(t[0]!==b?(w=()=>{x(b)},C=[b],t[0]=b,t[1]=w,t[2]=C):(w=t[1],C=t[2]),(0,c.useLayoutEffect)(w,C),b){let e=y&&`${ic}--is-open`,l=g>1&&`${ic}--nested`,c;
42t[3]!==a||t[4]!==e||t[5]!==l?(c=[a,ic,e,l].filter(Boolean),t[3]=a,t[4]=e,t[5]=l,t[6]=c):c=t[6];let m=c.join(" "),b=100+g,v;if(t[7]!==i||t[8]!==n||t[9]!==p||t[10]!==g||t[11]!==u||t[12]!==o||t[13]!==r||t[14]!==d||t[15]!==m||t[16]!==b||t[17]!==s){let e;t[19]!==p||t[20]!==r?(e=()=>p(r),t[19]=p,t[20]=r,t[21]=e):e=t[21],v=(0,h.jsx)(im,{children:(0,h.jsxs)(l_,{className:m,closeOnBlur:!1,slug:r,style:{zIndex:b},children:[(!g||1===g)&&(0,h.jsx)("div",{className:`${ic}__blur-bg`}),(0,h.jsx)("button",{"aria-label":d("general:close"),className:`${ic}__close`,id:`close-drawer__${r}`,onClick:e,type:"button"}),(0,h.jsxs)("div",{className:`${ic}__content`,style:{width:`calc(100% - (${g} * var(--gutter-h)))`},children:[(0,h.jsx)("div",{className:`${ic}__blur-bg-content`}),(0,h.jsxs)(io,{className:`${ic}__content-children`,left:u,right:u,children:[i,void 0===i&&(0,h.jsxs)("div",{className:`${ic}__header`,children:[(0,h.jsx)("h2",{className:`${ic}__header__title`,title:o?s:null,children:s}),(0,h.jsx)("button",{"aria-label":d("general:close"),className:`${ic}__header__close`,id:`close-drawer__${r}`,onClick:()=>p(r),type:"button",children:(0,h.jsx)(f.a,{})})]}),n]})]})]})}),t[7]=i,t[8]=n,t[9]=p,t[10]=g,t[11]=u,t[12]=o,t[13]=r,t[14]=d,t[15]=m,t[16]=b,t[17]=s,t[18]=v}else v=t[18];return v}return null},ih=(0,c.createContext)(1),im=e=>{let t=(0,v.c)(3),{children:r}=e,n=ig()+1,a;return t[0]!==r||t[1]!==n?(a=(0,h.jsx)(ih,{value:n,children:r}),t[0]=r,t[1]=n,t[2]=a):a=t[2],a},ig=()=>(0,c.use)(ih),ib="confirmation-modal";function iv(e){let t,r=(0,v.c)(25),{body:n,cancelLabel:a,className:l,confirmingLabel:i,confirmLabel:o,heading:s,modalSlug:u,onCancel:d,onConfirm:p}=e,m=ig(),[g,b]=c.default.useState(!1),{closeModal:y,isModalOpen:x}=lc(),{t:w}=(0,f.d)(),C;r[0]!==y||r[1]!==g||r[2]!==u||r[3]!==p?(C=async()=>{g||(b(!0),"function"==typeof p&&await p(),b(!1),y(u))},r[0]=y,r[1]=g,r[2]=u,r[3]=p,r[4]=C):C=r[4];let j=C,S;r[5]!==y||r[6]!==g||r[7]!==u||r[8]!==d?(S=()=>{g||(y(u),"function"==typeof d&&d())},r[5]=y,r[6]=g,r[7]=u,r[8]=d,r[9]=S):S=r[9];let $=S;if(!x(u))return null;
42r[10]!==l?(t=[ib,l].filter(Boolean),r[10]=l,r[11]=t):t=r[11];let _=t.join(" "),k=100+m,E;return r[12]!==n||r[13]!==a||r[14]!==o||r[15]!==g||r[16]!==i||r[17]!==s||r[18]!==u||r[19]!==$||r[20]!==j||r[21]!==w||r[22]!==_||r[23]!==k?(E=(0,h.jsx)(l_,{className:_,closeOnBlur:!1,slug:u,style:{zIndex:k},children:(0,h.jsxs)("div",{className:`${ib}__wrapper`,children:[(0,h.jsxs)("div",{className:`${ib}__content`,children:["string"==typeof s?(0,h.jsx)("h1",{children:s}):s,"string"==typeof n?(0,h.jsx)("p",{children:n}):n]}),(0,h.jsxs)("div",{className:`${ib}__controls`,children:[(0,h.jsx)(au,{buttonStyle:"secondary",disabled:g,id:"confirm-cancel",onClick:$,size:"large",type:"button",children:a||w("general:cancel")}),(0,h.jsx)(au,{id:"confirm-action",onClick:j,size:"large",children:g?i||`${w("general:loading")}...`:o||w("general:confirm")})]})]})}),r[12]=n,r[13]=a,r[14]=o,r[15]=g,r[16]=i,r[17]=s,r[18]=u,r[19]=$,r[20]=j,r[21]=w,r[22]=_,r[23]=k,r[24]=E):E=r[24],E}var iy="stay-logged-in",ix=()=>{let e=(0,v.c)(11),{refreshCookie:t}=iS(),r=(0,b.useRouter)(),{config:n}=(0,d.c)(),{admin:a,routes:l}=n,{routes:i}=a,{logout:o}=i,{admin:s}=l,{t:c}=(0,f.d)(),{startRouteTransition:u}=nK(),p;e[0]!==s||e[1]!==o||e[2]!==r||e[3]!==u?(p=()=>u(()=>r.push(tR({adminRoute:s,path:o}))),e[0]=s,e[1]=o,e[2]=r,e[3]=u,e[4]=p):p=e[4];let m=p,g;e[5]!==t?(g=()=>{t()},e[5]=t,e[6]=g):g=e[6];let y=g,x;return e[7]!==y||e[8]!==m||e[9]!==c?(x=(0,h.jsx)(iv,{body:c("authentication:youAreInactive"),cancelLabel:c("authentication:stayLoggedIn"),confirmLabel:c("authentication:logOut"),heading:c("authentication:stayLoggedIn"),modalSlug:iy,onCancel:y,onConfirm:m}),e[7]=y,e[8]=m,e[9]=c,e[10]=x):x=e[10],x},iw={delete:(e,t={headers:{}})=>{let r=t&&t.headers?{...t.headers}:{};return fetch(e,{...t,credentials:"include",headers:{...r},method:"delete"})},get:(e,t={headers:{}})=>{let r="";return t.params&&(r=t6(t.params,{addQueryPrefix:!0})),fetch(`${e}${r}`,{credentials:"include",...t})},patch:(e,t={headers:{}})=>{let r=t&&t.headers?{...t.headers}:{};return fetch(e,{...t,credentials:"include",headers:{...r},method:"PATCH"})},post:(e,t={headers:{}})=>{let r=t&&t.headers?{...t.headers}:{};return fetch(`${e}`,{...t,credentials:"include",headers:{...r},method:"post"})},put:(e,t={headers:{}})=>{let r=t&&t.headers?{...t.headers}:{};return fetch(e,{...t,credentials:"include",headers:{...r},method:"put"})}},iC=(0,c.createContext)({});function ij({children:e,permissions:t,user:r}){let n=(0,b.usePathname)(),a=(0,b.useRouter)(),{config:l}=(0,d.c)(),{admin:{autoLogin:i,autoRefresh:o,routes:{inactivity:s},user:u},routes:{admin:p,api:m}}=l,{i18n:g}=(0,f.d)(),{closeAllModals:v,openModal:y}=lc(),{startRouteTransition:x}=nK(),[w,C]=(0,c.useState)(r),[j,S]=(0,c.useState)(),[$,_]=(0,c.useState)(),[k,E]=(0,c.useState)(t),[N,P]=(0,c.useState)(12e4),[T,D]=(0,c.useState)(!1),R=c.default.useRef(null),A=c.default.useRef(null),O=c.default.useRef(null),L=w?.id,M=(0,c.useCallback)(()=>{let e=tR({adminRoute:p,path:""});x(()=>a.replace(tR({adminRoute:p,path:`${s}${window.location.pathname.startsWith(e)?`?redirect=${encodeURIComponent(window.location.pathname)}`:""}`}))),v()},[a,p,s,v,x]),I=(0,c.useCallback)(()=>{C(null),S(void 0),_(void 0),clearTimeout(R.current)},[]),F=ae(()=>{o?K():y(iy)}),B=(0,c.useCallback)(e=>{if(clearTimeout(A.current),clearTimeout(O.current),e?.user){C(e.user),S(e.token),_(1e3*e.exp);let t=Math.max(0,Math.min((e.exp??0)*1e3-Date.now(),0x7fffffff));if(t){let e=Math.min(6e4,t/2);P(e),A.current=setTimeout(F,Math.max(t-e,0)),O.current=setTimeout(()=>{I(),M()},t)}}else I()},[M,I]),z=(0,c.useCallback)(e=>{if(!L)return;let t=Math.max(0,($??0)-Date.now());(e||$&&t<2*N)&&(clearTimeout(R.current),R.current=setTimeout(async()=>{try{let e=await iw.post(tR({apiRoute:m,path:`/${u}/refresh-token?refresh`}),{headers:{"Accept-Language":g.language}});if(200===e.status){let t=await e.json();B(t)}else B(null),M()}catch(e){nI.error(e.message)}},1e3))},[m,g.language,M,B,$,u,N,L]),U=(0,c.useCallback)(async e=>{try{let t=await iw.post(tR({apiRoute:m,path:`/${u}/refresh-token`}),{headers:{"Accept-Language":g.language}}
42);if(200===t.status){let r=await t.json();return e||B(r),r.user}w&&(B(null),M())}catch(e){nI.error(`Refreshing token failed: ${e.message}`)}return null},[m,g.language,M,B,u,w]),V=(0,c.useCallback)(async()=>{try{w&&w.collection&&(B(null),await iw.post(tR({apiRoute:m,path:`/${w.collection}/logout`})))}catch{}return!0},[m,B,w]),H=(0,c.useCallback)(async({locale:e}={})=>{let t=t6({locale:e},{addQueryPrefix:!0});try{let e=await iw.get(tR({apiRoute:m,path:`/access${t}`}),{headers:{"Accept-Language":g.language}});if(200===e.status){let t=await e.json();E(t)}else throw Error(`Fetching permissions failed with status code ${e.status}`)}catch(e){nI.error(`Refreshing permissions failed: ${e.message}`)}},[m,g]),q=c.default.useCallback(async()=>{try{let e=await iw.get(tR({apiRoute:m,path:`/${u}/me`}),{credentials:"include",headers:{"Accept-Language":g.language}});if(200===e.status){let t=await e.json();return B(t),t?.user||null}}catch(e){nI.error(`Fetching user failed: ${e.message}`)}return null},[m,u,g.language,B]),K=ae(z);(0,c.useEffect)(()=>{K()},[n]);let W=ae(q);return(0,c.useEffect)(()=>{!async function(){await W(),D(!0)}()},[]),(0,c.useEffect)(()=>{w||!i||i.prefillOnly||W()},[w,i]),(0,c.useEffect)(()=>()=>{clearTimeout(R.current),clearTimeout(A.current),clearTimeout(O.current)},[]),w||T?(0,h.jsx)(iC,{value:{fetchFullUser:q,logOut:V,permissions:k,refreshCookie:z,refreshCookieAsync:U,refreshPermissions:H,setPermissions:E,setUser:B,token:j,tokenExpirationMs:$,user:w},children:e}):null}var iS=()=>(0,c.use)(iC),i$=(0,c.createContext)({}),i_=(0,c.createContext)({localeIsLoading:!1,setLocaleIsLoading:e=>{}}),ik=async(e,t)=>await fetch(`${t}/payload-preferences/${e}`,{credentials:"include",headers:{"Content-Type":"application/json"},method:"GET"})?.then(e=>e.json()),iE=e=>{let t,r,n=(0,v.c)(28),{children:a,locale:l}=e,{config:i}=(0,d.c)(),{localization:o,routes:s}=i,u=void 0!==o&&o,{api:f}=s,{user:p}=iS(),m=u?u.defaultLocale:"en",g=(0,b.useSearchParams)(),y;n[0]!==g?(y=g.get("locale"),n[0]=g,n[1]=y):y=n[1];let x=y,w;n[2]!==m||n[3]!==l||n[4]!==x||n[5]!==u?(w=()=>u&&(!u||u.locales.length)?a1(u,x)||a1(u,l)||a1(u,m)||a1(u,u.locales[0].code):{},n[2]=m,n[3]=l,n[4]=x,n[5]=u,n[6]=w):w=n[6];let[C,j]=c.default.useState(w),[S,$]=(0,c.useState)(!1),_=(0,c.useRef)(C),k,E;n[7]!==C?(k=()=>{C.code!==_.current.code&&$(!1),_.current=C},E=[C],n[7]=C,n[8]=k,n[9]=E):(k=n[8],E=n[9]),(0,c.useEffect)(k,E),n[10]!==f?(t=tR({apiRoute:f,path:""}),n[10]=f,n[11]=t):t=n[11];let N=t,P;n[12]!==m||n[13]!==N||n[14]!==x||n[15]!==u||n[16]!==p?.id?(P=()=>{!async function(){if(u&&p?.id){let e=a1(u,x||await ik("locale",N)?.then(iT))||a1(u,m)||a1(u,u?.locales?.[0]?.code);e&&j(e)}}()},n[12]=m,n[13]=N,n[14]=x,n[15]=u,n[16]=p?.id,n[17]=P):P=n[17];let T=p?.id,D;return n[18]!==m||n[19]!==N||n[20]!==x||n[21]!==u||n[22]!==T?(D=[m,u,N,x,T],n[18]=m,n[19]=N,n[20]=x,n[21]=u,n[22]=T,n[23]=D):D=n[23],(0,c.useEffect)(P,D),n[24]!==a||n[25]!==S||n[26]!==C?(r=(0,h.jsx)(i$,{value:C,children:(0,h.jsx)(i_,{value:{localeIsLoading:S,setLocaleIsLoading:$},children:a})}),n[24]=a,n[25]=S,n[26]=C,n[27]=r):r=n[27],r},iN=()=>(0,c.use)(i_),iP=()=>(0,c.use)(i$);function iT(e){return e.value}var iD=(e,t,r)=>{if(e)return`field-${e.replace(/\./g,"__")}${t>1?`-${t}`:""}${r?`-${r}`:""}`},iR=e=>{let{as:t,hideLocale:r,htmlFor:n,label:a,localized:l,path:i,required:o,unstyled:s}=e,c=void 0===t?"label":t,u=void 0!==s&&s,{uuid:d}=nm(),p=a0(),g=n||iD(i,p,d),{i18n:b}=(0,f.d)(),{code:v,label:y}=iP();return a?(0,h.jsxs)("label"===c?g?"label":"span":c||"span",{className:`field-label${u?" unstyled":""}`,htmlFor:g,children:[m(a,b),void 0!==o&&o&&!u&&(0,h.jsx)("span",{className:"required",children:"*"}),void 0!==l&&l&&!(void 0!==r&&r)&&(0,h.jsxs)("span",{className:"localized",children:["— ","string"==typeof y?y:v]})]}):null},iA=({collapsed:e,rowID:t,rows:r})=>r.reduce((r,n)=>(t===n.id&&(n.collapsed=e),n.collapsed&&r.collapsedIDs.push(n.id),r.updatedRows.push(n),r),{collapsedIDs:[],updatedRows:[]}),iO=({collapsed:e,rows:t})=>t.reduce((t,r)=>(r.collapsed=e,e&&t.collapsedIDs.push(r.id),t.updatedRows.push(r),t),{collapsedIDs:[],updatedRows:[]}),iL=(e,t,r)=>{let n,a=(0,v.c)(9),l;a[0]!==r?(l=void 0===r?[]:r,a[0]=r,a[1]=l):l=a[1];let i=l,o;a[2]===Symbol.for("react.memo_cache_sentinel")?(o=Date.now(),a[2]=o):o=a[2];let s=(0,c.useRef)(o),u;a[3]!==e||a[4]!==t?(u=()=>{let r=setTimeout(()=>{Date.now()-s.current>=t&&(e(),s.current=Date.now())},t-(Date.now()-s.current));return()=>{clearTimeout(r)}},a[3]=e,a[4]=t,a[5]=u):u=a[5],a[6]!==t||a[7]!==i?(n=[t,...i],a[6]=t,a[7]=i,a[8]=n):n=a[8],(0,c.useEffect)(u,n
42)},iM={},iI={};function iF(e,t){try{let r=(iM[e]||=new Intl.DateTimeFormat("en-GB",{timeZone:e,hour:"numeric",timeZoneName:"longOffset"}).format)(t).split("GMT")[1]||"";return r in iI?iI[r]:iz(r,r.split(":"))}catch{if(e in iI)return iI[e];let t=e?.match(iB);return t?iz(e,t.slice(1)):NaN}}var iB=/([+-]\d\d):?(\d\d)?/;function iz(e,t){let r=+t[0],n=+(t[1]||0);return iI[e]=r>0?60*r+n:60*r-n}var iU=class e extends Date{constructor(...e){super(),e.length>1&&"string"==typeof e[e.length-1]&&(this.timeZone=e.pop()),this.internal=new Date,isNaN(iF(this.timeZone,this))?this.setTime(NaN):e.length?"number"==typeof e[0]&&(1===e.length||2===e.length&&"number"!=typeof e[1])?this.setTime(e[0]):"string"==typeof e[0]?this.setTime(+new Date(e[0])):e[0]instanceof Date?this.setTime(+e[0]):(this.setTime(+new Date(...e)),iq(this,NaN),iH(this)):this.setTime(Date.now())}static tz(t,...r){return r.length?new e(...r,t):new e(Date.now(),t)}withTimeZone(t){return new e(+this,t)}getTimezoneOffset(){return-iF(this.timeZone,this)}setTime(e){return Date.prototype.setTime.apply(this,arguments),iH(this),+this}[Symbol.for("constructDateFrom")](t){return new e(+new Date(t),this.timeZone)}},iV=/^(get|set)(?!UTC)/;function iH(e){e.internal.setTime(+e),e.internal.setUTCMinutes(e.internal.getUTCMinutes()-e.getTimezoneOffset())}function iq(e){let t=iF(e.timeZone,e),r=new Date(+e);r.setUTCHours(r.getUTCHours()-1);let n=-new Date(+e).getTimezoneOffset(),a=n- -new Date(+r).getTimezoneOffset(),l=Date.prototype.getHours.apply(e)!==e.internal.getUTCHours();a&&l&&e.internal.setUTCMinutes(e.internal.getUTCMinutes()+a);let i=n-t;i&&Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+i);let o=iF(e.timeZone,e),s=-new Date(+e).getTimezoneOffset()-o-i;if(o!==t&&s){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+s);let t=o-iF(e.timeZone,e);t&&(e.internal.setUTCMinutes(e.internal.getUTCMinutes()+t),Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+t))}}Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!iV.test(e))return;let t=e.replace(iV,"$1UTC");iU.prototype[t]&&(e.startsWith("get")?iU.prototype[e]=function(){return this.internal[t]()}:(iU.prototype[e]=function(){var e;return Date.prototype[t].apply(this.internal,arguments),e=this,Date.prototype.setFullYear.call(e,e.internal.getUTCFullYear(),e.internal.getUTCMonth(),e.internal.getUTCDate()),Date.prototype.setHours.call(e,e.internal.getUTCHours(),e.internal.getUTCMinutes(),e.internal.getUTCSeconds(),e.internal.getUTCMilliseconds()),iq(e),+this},iU.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),iH(this),+this}))});var iK=Symbol.for("constructDateFrom");function iW(e,t){return"function"==typeof e?e(t):e&&"object"==typeof e&&iK in e?e[iK](t):e instanceof Date?new e.constructor(t):new Date(t)}function iG(e,t){return iW(t||e,e)}var iY={};function iQ(e,t){let r=t?.weekStartsOn??t?.locale?.options?.weekStartsOn??iY.weekStartsOn??iY.locale?.options?.weekStartsOn??0,n=iG(e,t?.in),a=n.getDay();return n.setDate(n.getDate()-(7*(a<r)+a-r)),n.setHours(0,0,0,0),n}function iX(e,t){return iQ(e,{...t,weekStartsOn:1})}function iJ(e,t){let r=iG(e,t?.in),n=r.getFullYear(),a=iW(r,0);a.setFullYear(n+1,0,4),a.setHours(0,0,0,0);let l=iX(a),i=iW(r,0);i.setFullYear(n,0,4),i.setHours(0,0,0,0);let o=iX(i);return r.getTime()>=l.getTime()?n+1:r.getTime()>=o.getTime()?n:n-1}function iZ(e){let t=iG(e),r=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return r.setUTCFullYear(t.getFullYear()),e-r}function i0(e,...t){let r=iW.bind(null,e||t.find(e=>"object"==typeof e));return t.map(r)}function i1(e,t){let r=iG(e,t?.in);return r.setHours(0,0,0,0),r}function i2(e,t){let r=iG(e)-iG(t);return r<0?-1:r>0?1:r}function i3(e){return iW(e,Date.now())}function i6(e,t){let r=iG(e,t?.in);return r.setHours(23,59,59,999),r}function i5(e,t){let r=iG(e,t?.in),n=r.getFullYear(),a=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??iY.firstWeekContainsDate??iY.locale?.options?.firstWeekContainsDate??1,l=iW(t?.in||e,0);l.setFullYear(n+1,0,a),l.setHours(0,0,0,0);let i=iQ(l,t),o=iW(t?.in||e,0);o.setFullYear(n,0,a),o.setHours(0,0,0,0);let s=iQ(o,t);return+r>=+i?n+1:+r>=+s?n:n-1}function i4(e,t){let r=Math.abs(e).toString().padStart(t,"0");return(e<0?"-":"")+r}var i8={y(e,t){let r=e.getFullYear(),n=r>0?r:1-r;return i4("yy"===t?n%100:n,t.length)},M(e,t){let r=e.getMonth();return"M"===t?String(r+1):i4(r+1,2)},d:(e,t)=>i4(e.getDate(),t.length),a(e,t){let r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];
42default:return"am"===r?"a.m.":"p.m."}},h:(e,t)=>i4(e.getHours()%12||12,t.length),H:(e,t)=>i4(e.getHours(),t.length),m:(e,t)=>i4(e.getMinutes(),t.length),s:(e,t)=>i4(e.getSeconds(),t.length),S(e,t){let r=t.length;return i4(Math.trunc(e.getMilliseconds()*Math.pow(10,r-3)),t.length)}},i7={G:function(e,t,r){let n=+(e.getFullYear()>0);switch(t){case"G":case"GG":case"GGG":return r.era(n,{width:"abbreviated"});case"GGGGG":return r.era(n,{width:"narrow"});default:return r.era(n,{width:"wide"})}},y:function(e,t,r){if("yo"===t){let t=e.getFullYear();return r.ordinalNumber(t>0?t:1-t,{unit:"year"})}return i8.y(e,t)},Y:function(e,t,r,n){let a=i5(e,n),l=a>0?a:1-a;return"YY"===t?i4(l%100,2):"Yo"===t?r.ordinalNumber(l,{unit:"year"}):i4(l,t.length)},R:function(e,t){return i4(iJ(e),t.length)},u:function(e,t){return i4(e.getFullYear(),t.length)},Q:function(e,t,r){let n=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(n);case"QQ":return i4(n,2);case"Qo":return r.ordinalNumber(n,{unit:"quarter"});case"QQQ":return r.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(n,{width:"narrow",context:"formatting"});default:return r.quarter(n,{width:"wide",context:"formatting"})}},q:function(e,t,r){let n=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(n);case"qq":return i4(n,2);case"qo":return r.ordinalNumber(n,{unit:"quarter"});case"qqq":return r.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(n,{width:"narrow",context:"standalone"});default:return r.quarter(n,{width:"wide",context:"standalone"})}},M:function(e,t,r){let n=e.getMonth();switch(t){case"M":case"MM":return i8.M(e,t);case"Mo":return r.ordinalNumber(n+1,{unit:"month"});case"MMM":return r.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(n,{width:"narrow",context:"formatting"});default:return r.month(n,{width:"wide",context:"formatting"})}},L:function(e,t,r){let n=e.getMonth();switch(t){case"L":return String(n+1);case"LL":return i4(n+1,2);case"Lo":return r.ordinalNumber(n+1,{unit:"month"});case"LLL":return r.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(n,{width:"narrow",context:"standalone"});default:return r.month(n,{width:"wide",context:"standalone"})}},w:function(e,t,r,n){let a,l,i,o,s=Math.round((iQ(o=iG(e,n?.in),n)-(a=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??iY.firstWeekContainsDate??iY.locale?.options?.firstWeekContainsDate??1,l=i5(o,n),(i=iW(n?.in||o,0)).setFullYear(l,0,a),i.setHours(0,0,0,0),iQ(i,n)))/6048e5)+1;return"wo"===t?r.ordinalNumber(s,{unit:"week"}):i4(s,t.length)},I:function(e,t,r){let n,a,l,i=Math.round((iX(l=iG(e,void 0))-(n=iJ(l,void 0),(a=iW(l,0)).setFullYear(n,0,4),a.setHours(0,0,0,0),iX(a)))/6048e5)+1;return"Io"===t?r.ordinalNumber(i,{unit:"week"}):i4(i,t.length)},d:function(e,t,r){return"do"===t?r.ordinalNumber(e.getDate(),{unit:"date"}):i8.d(e,t)},D:function(e,t,r){let n,a,l=function(e,t){let[r,n]=i0(void 0,e,t),a=i1(r),l=i1(n);return Math.round((a-iZ(a)-(l-iZ(l)))/864e5)}(a=iG(e,void 0),((n=iG(a,void 0)).setFullYear(n.getFullYear(),0,1),n.setHours(0,0,0,0),n))+1;return"Do"===t?r.ordinalNumber(l,{unit:"dayOfYear"}):i4(l,t.length)},E:function(e,t,r){let n=e.getDay();switch(t){case"E":case"EE":case"EEE":return r.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(n,{width:"short",context:"formatting"});default:return r.day(n,{width:"wide",context:"formatting"})}},e:function(e,t,r,n){let a=e.getDay(),l=(a-n.weekStartsOn+8)%7||7;switch(t){case"e":return String(l);case"ee":return i4(l,2);case"eo":return r.ordinalNumber(l,{unit:"day"});case"eee":return r.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(a,{width:"short",context:"formatting"});default:return r.day(a,{width:"wide",context:"formatting"})}},c:function(e,t,r,n){let a=e.getDay(),l=(a-n.weekStartsOn+8)%7||7;switch(t){case"c":return String(l);case"cc":return i4(l,t.length);case"co":return r.ordinalNumber(l,{unit:"day"});case"ccc":return r.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(a,{width:"narrow",context:"standalone"});case"cccccc":return r.day(a,{width:"short",context:"standalone"});default:return r.day(a,{width:"wide",context:"standalone"})}},i:function(e,t,r){let n=e.getDay(),a=0===n?7:n;switch(t){case"i":return String(a);case"ii":return i4(a,t.length);case"io":return r.ordinalNumber(a,{unit:"day"});case"iii":return r.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(n,{width:"short",context:"formatting"});default:return r.day(n,{width:"wide",context:"formatting"})}},a:function(e,t,r){let n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(n,{width:"narrow",context:"formatting"});default:return r.dayPeriod(n,{width:"wide",context:"formatting"})}},b:function(e,t,r){let n=e.getHours(),a;switch(a=12===n?"noon":0===n?"midnight":n/12>
42=1?"pm":"am",t){case"b":case"bb":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(a,{width:"narrow",context:"formatting"});default:return r.dayPeriod(a,{width:"wide",context:"formatting"})}},B:function(e,t,r){let n=e.getHours(),a;switch(a=n>=17?"evening":n>=12?"afternoon":n>=4?"morning":"night",t){case"B":case"BB":case"BBB":return r.dayPeriod(a,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(a,{width:"narrow",context:"formatting"});default:return r.dayPeriod(a,{width:"wide",context:"formatting"})}},h:function(e,t,r){if("ho"===t){let t=e.getHours()%12;return 0===t&&(t=12),r.ordinalNumber(t,{unit:"hour"})}return i8.h(e,t)},H:function(e,t,r){return"Ho"===t?r.ordinalNumber(e.getHours(),{unit:"hour"}):i8.H(e,t)},K:function(e,t,r){let n=e.getHours()%12;return"Ko"===t?r.ordinalNumber(n,{unit:"hour"}):i4(n,t.length)},k:function(e,t,r){let n=e.getHours();return 0===n&&(n=24),"ko"===t?r.ordinalNumber(n,{unit:"hour"}):i4(n,t.length)},m:function(e,t,r){return"mo"===t?r.ordinalNumber(e.getMinutes(),{unit:"minute"}):i8.m(e,t)},s:function(e,t,r){return"so"===t?r.ordinalNumber(e.getSeconds(),{unit:"second"}):i8.s(e,t)},S:function(e,t){return i8.S(e,t)},X:function(e,t,r){let n=e.getTimezoneOffset();if(0===n)return"Z";switch(t){case"X":return oe(n);case"XXXX":case"XX":return ot(n);default:return ot(n,":")}},x:function(e,t,r){let n=e.getTimezoneOffset();switch(t){case"x":return oe(n);case"xxxx":case"xx":return ot(n);default:return ot(n,":")}},O:function(e,t,r){let n=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+i9(n,":");default:return"GMT"+ot(n,":")}},z:function(e,t,r){let n=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+i9(n,":");default:return"GMT"+ot(n,":")}},t:function(e,t,r){return i4(Math.trunc(e/1e3),t.length)},T:function(e,t,r){return i4(+e,t.length)}};function i9(e,t=""){let r=e>0?"-":"+",n=Math.abs(e),a=Math.trunc(n/60),l=n%60;return 0===l?r+String(a):r+String(a)+t+i4(l,2)}function oe(e,t){return e%60==0?(e>0?"-":"+")+i4(Math.abs(e)/60,2):ot(e,t)}function ot(e,t=""){let r=Math.abs(e);return(e>0?"-":"+")+i4(Math.trunc(r/60),2)+t+i4(r%60,2)}var or=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},on=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},oa={p:on,P:(e,t)=>{let r,n=e.match(/(P+)(p+)?/)||[],a=n[1],l=n[2];if(!l)return or(e,t);switch(a){case"P":r=t.dateTime({width:"short"});break;case"PP":r=t.dateTime({width:"medium"});break;case"PPP":r=t.dateTime({width:"long"});break;default:r=t.dateTime({width:"full"})}return r.replace("{{date}}",or(a,t)).replace("{{time}}",on(l,t))}},ol=/^D+$/,oi=/^Y+$/,oo=["D","DD","YY","YYYY"],os=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,oc=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,ou=/^'([^]*?)'?$/,od=/''/g,of=/[a-zA-Z]/;function op(e,t,r){let n=r?.locale??iY.locale??f.b,a=r?.firstWeekContainsDate??r?.locale?.options?.firstWeekContainsDate??iY.firstWeekContainsDate??iY.locale?.options?.firstWeekContainsDate??1,l=r?.weekStartsOn??r?.locale?.options?.weekStartsOn??iY.weekStartsOn??iY.locale?.options?.weekStartsOn??0,i=iG(e,r?.in);if(!(i instanceof Date||"object"==typeof i&&"[object Date]"===Object.prototype.toString.call(i))&&"number"!=typeof i||isNaN(+iG(i)))throw RangeError("Invalid time value");let o=t.match(oc).map(e=>{let t=e[0];return"p"===t||"P"===t?(0,oa[t])(e,n.formatLong):e}).join("").match(os).map(e=>{if("''"===e)return{isToken:!1,value:"'"};let t=e[0];if("'"===t){var r;let t;return{isToken:!1,value:(t=(r=e).match(ou))?t[1].replace(od,"'"):r}}if(i7[t])return{isToken:!0,value:e};if(t.match(of))throw RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}});n.localize.preprocessor&&(o=n.localize.preprocessor(i,o));let s={firstWeekContainsDate:a,weekStartsOn:l,locale:n};return o.map(a=>{if(!a.isToken)return a.value;let l=a.value;return(!r?.useAdditionalWeekYearTokens&&oi.test(l)||!r?.useAdditionalDayOfYearTokens&&ol.test(l))&&function(e,t,r){var n,a,l;let i,o=(n=e,a=t,l=r,i="Y"===n[0]?"years":"days of the month",`Use \`${n.toLowerCase()}\` instead of \`${n}\` (in \`${a}\`) for formatting ${i} to the input \`${l}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`);if(console.warn(o),oo.includes(e))throw RangeError(o)}(l,t,String(e)),(0,i7[l[0]])(i,l,n.localize,s)}).join("")}function oh(e,t){var r;let n="function"==typeof(r=t)&&r.prototype?.constructor===r?new t(0):iW(t,0);return n.setFullYear(e.getFullYear(),e.getMonth(),e.getDate()),n.setHours(e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()),n}var om=({date:e,i18n:t,pattern:r,timezone:n})=>{let a=new iU(new Date(e));if(n){let e=iU.tz(n),l=oh(a.withTimeZone(n),e);return t.dateFNS?op(l,r,{locale:t.dateFNS}):`${t.t("general:loading")}...`}return t.dateFNS?op(a,r,{locale:t.dateFNS}):`${t.t("general:loading")}...`},og=({date:e,i18n:t})=>{var r;let n="string"==typeof e?new Date(e):e;return t?.dateFNS?(r={locale:t.dateFNS},function(e,t,r){var n;let a=r?.locale??iY.locale??f.b,l=i2(e,t);if(isNaN(l))throw RangeError("Invalid time value");let i=Object.assign({},r,{addSuffix:r?.addSuffix,comparison:l}),[o,s]=i0(r?.in,...l>0?[t,e]:[e,t]),c=(n=void 0,e=>{let t=(n?Math[n]:Math.trunc)(e);return 0===t?0:t})((iG(s)-iG(o))/1e3),u=Math.round((c-(iZ(s)-iZ(o))/1e3)/60),d;if(u<2)return r?.includeSeconds?c<5?a.formatDistance("lessThanXSeconds",5,i):c<10?a.formatDistance("lessThanXSeconds",10,i):c<20?a.formatDistance("lessThanXSeconds",20,i):c<40?a.formatDistance("halfAMinute",0,i):c<60?a.formatDistance("lessThanXMinutes",1,i):a.formatDistance("xMinutes",1,i):0===u?a.formatDistance("lessThanXMinutes",1,i):a.formatDistance("xMinutes",u,i);if(u<45)return a.formatDistance("xMinutes",u,i);if(u<90)return a.formatDistance("aboutXHours",1,i);if(u<1440){let e=Math.round(u/60);return a.formatDistance("aboutXHours",e,i)}if(u<2520)return a.formatDistance("xDays",1,i);if(u<43200){let e=Math.round(u/1440);return a.formatDistance("xDays",e,i)}if(u<86400)return d=Math.round(u/43200),a.formatDistance("aboutXMonths",d,i);if((d=function(e,t){var r;let n,a,l,[i,o,s]=i0(void 0,e,e,t),c=i2(o,s),u=Math.abs(function(e,t){let[r,n]=i0(void 0,e,t);return 12*(r.getFullYear()-n.getFullYear())+(r.getMonth()-n.getMonth())}
42(o,s));if(u<1)return 0;1===o.getMonth()&&o.getDate()>27&&o.setDate(30),o.setMonth(o.getMonth()-c*u);let d=i2(o,s)===-c;+i6(n=iG(i,void 0),void 0)==+(r=void 0,l=(a=iG(n,r?.in)).getMonth(),a.setFullYear(a.getFullYear(),l+1,0),a.setHours(23,59,59,999),a)&&1===u&&1===i2(i,s)&&(d=!1);let f=c*(u-d);return 0===f?0:f}(s,o))<12){let e=Math.round(u/43200);return a.formatDistance("xMonths",e,i)}{let e=d%12,t=Math.trunc(d/12);return e<3?a.formatDistance("aboutXYears",t,i):e<9?a.formatDistance("overXYears",t,i):a.formatDistance("almostXYears",t+1,i)}}(n,i3(n),r)):`${t.t("general:loading")}...`};function ob(e){return"object"==typeof e&&"root"in e}function ov(e,t){for(let r of e)"text"in r&&r.text?t+=r.text:"children"in r||(t+=`[${r.type}]`),"children"in r&&r.children&&(t+=ov(r.children,t));return t}var oy=({collectionConfig:e,data:t,dateFormat:r,fallback:n,globalConfig:a,i18n:l})=>{let i;if(e){let n=e?.admin?.useAsTitle;if(n&&(i=t?.[n])){let a,o=e.fields.find(e=>"name"in e&&e.name===n),s=o?.type==="date",c=o?.type==="relationship";s&&(i=om({date:i,i18n:l,pattern:"date"in o.admin&&o?.admin?.date?.displayFormat||r})||i),c&&(i=Array.isArray(a=t[n])?a.map(e=>"object"==typeof e&&null!==e?e.id:String(e)).filter(Boolean).join(", "):"object"==typeof a&&null!==a?a.id||"":String(a))}}return a&&(i=m(a?.label,l)||a?.slug),i&&ob(i)&&(i=ov(i.root.children?.[0]?.children||[],"")),!i&&ob(n)&&(i=ov(n.root.children?.[0]?.children||[],"")),i||(i="string"==typeof n?n:`[${l.t("general:untitled")}]`),i},ox=(0,c.createContext)({}),ow=()=>(0,c.use)(ox),oC=({children:e})=>{let{id:t,collectionSlug:r,data:n,docConfig:a,globalSlug:l,initialData:i}=oD(),{config:{admin:{dateFormat:o}}}=(0,d.c)(),{i18n:s}=(0,f.d)(),[u,p]=(0,c.useState)(()=>oy({collectionConfig:r?a:void 0,data:{...i||{},id:t},dateFormat:o,fallback:t?.toString(),globalConfig:l?a:void 0,i18n:s}));return(0,c.useEffect)(()=>{p(oy({collectionConfig:r?a:void 0,data:{...n,id:t},dateFormat:o,fallback:t?.toString(),globalConfig:l?a:void 0,i18n:s}))},[n,o,s,t,r,a,l]),(0,h.jsx)(ox,{value:{setDocumentTitle:p,title:u},children:e})},oj=(0,c.createContext)({}),oS=(e,t)=>({body:JSON.stringify({value:e}),headers:{"Accept-Language":t,"Content-Type":"application/json"}}),o$=({children:e})=>{let t=(0,c.useRef)({}),r=(0,c.useRef)({}),n=(0,c.useRef)({}),{config:a}=(0,d.c)(),{user:l}=iS(),{i18n:i}=(0,f.d)(),{routes:{api:o}}=a;(0,c.useEffect)(()=>{l||(r.current={})},[l]);let s=(0,c.useCallback)(async e=>{let t=r.current;if("u">typeof t[e])return t[e];let n=new Promise(t=>{(async()=>{let n=await iw.get(tR({apiRoute:o,path:`/payload-preferences/${e}`}),{credentials:"include",headers:{"Accept-Language":i.language}}),a=null;200===n.status&&(a=(await n.json()).value),r.current[e]=a,t(a)})()});return t[e]=n,n},[i.language,o,r]),u=(0,c.useCallback)(async(e,t,a=!1)=>{if(!1===a){r.current[e]=t,await iw.post(tR({apiRoute:o,path:`/payload-preferences/${e}`}),oS(t,i.language));return}let l=t,c=await s(e);if("object"==typeof t&&"object"==typeof c&&"object"==typeof l){if(c&&(l=function e(t,r){let n={...t};for(let a in r)Object.prototype.hasOwnProperty.call(r,a)&&("object"==typeof r[a]&&!Array.isArray(r[a])&&t[a]?n[a]=e(t[a],r[a]):n[a]=r[a]);return n}(c,l)),t8(l,c))return;n.current[e]={...n.current[e],...l}}else{if(l===c)return;n.current[e]=l}let u=async()=>{t8(n.current[e],r.current[e])||(r.current[e]=n.current[e],await iw.post(tR({apiRoute:o,path:`/payload-preferences/${e}`}),oS(r.current[e],i.language)),delete n.current[e])};setTimeout(()=>{u()})},[o,s,i.language,n]);return t.current.getPreference=s,t.current.setPreference=u,(0,h.jsx)(oj,{value:t.current,children:e})},o_=()=>(0,c.use)(oj),ok=c.default.createContext({getUploadEdits:()=>{},resetUploadEdits:void 0,updateUploadEdits:void 0,uploadEdits:void 0}),oE=e=>{let t=(0,v.c)(10),{children:r,initialUploadEdits:n}=e,a;t[0]!==n?(a=n||{},t[0]=n,t[1]=a):a=t[1];let[l,i]=c.default.useState(a),o;t[2]===Symbol.for("react.memo_cache_sentinel")?(o=()=>{i({})},t[2]=o):o=t[2];let s=o,u;t[3]===Symbol.for("react.memo_cache_sentinel")?(u=e=>{i(t=>({...t||{},...e||{}}))},t[3]=u):u=t[3];let d=u,f;t[4]!==l?(f=()=>l,t[4]=l,t[5]=f):f=t[5];let p=f,m;
42return t[6]!==r||t[7]!==p||t[8]!==l?(m=(0,h.jsx)(ok,{value:{getUploadEdits:p,resetUploadEdits:s,updateUploadEdits:d,uploadEdits:l},children:r}),t[6]=r,t[7]=p,t[8]=l,t[9]=m):m=t[9],m},oN=()=>c.default.use(ok),oP=e=>{let{collectionSlug:t,docPermissions:r,globalSlug:n,isEditing:a}=e;return t?!!(a&&r?.update||!a&&r?.create):!!n&&!!r?.update},oT=(0,c.createContext)({}),oD=()=>(0,c.use)(oT),oR=({children:e,...t})=>{let{id:r,collectionSlug:n,currentEditor:a,docPermissions:l,globalSlug:i,hasPublishedDoc:o,hasPublishPermission:s,hasSavePermission:u,initialData:p,initialState:m,isLocked:g,lastUpdateTime:b,mostRecentVersionIsAutosaved:v,unpublishedVersionCount:y,versionCount:x}=t,[w,C]=(0,d.a)(l),[j,S]=(0,d.a)(u),[$,_]=(0,d.a)(s),{permissions:k}=iS(),{config:{admin:{dateFormat:E},collections:N,routes:{api:P}},getEntityConfig:T}=(0,d.c)(),D=T({collectionSlug:n}),R=T({globalSlug:i}),A=N.some(e=>"payload-locked-documents"===e.slug),O=(0,c.useRef)(new AbortController),L=D||R,{i18n:M}=(0,f.d)(),{uploadEdits:I}=oN(),[F,B]=(0,c.useState)(()=>oy({collectionConfig:D,data:{...p||{},id:r},dateFormat:E,fallback:r?.toString(),globalConfig:R,i18n:M})),[z,U]=(0,c.useState)(v),[V,H]=(0,c.useState)(x),[q,K]=(0,c.useState)(o),[W,G]=(0,c.useState)(y),[Y,Q]=(0,d.a)(g),[X,J]=(0,d.a)(a),[Z,ee]=(0,d.a)(b),[et,er]=(0,d.a)(p),[en,ea]=(0,d.a)("idle"),el=(0,c.useRef)({hasShownLockedModal:!1,isLocked:!1,user:null}),ei=(0,c.useCallback)(e=>{ea(e)},[ea]),{getPreference:eo,setPreference:es}=o_(),{code:ec}=iP(),{localeIsLoading:eu}=iN(),ed=(0,c.useMemo)(()=>void 0===m||void 0===p||eu,[p,m,eu]),ef=tR({apiRoute:P,path:""}),ep,eh,em;i&&(ep=i,eh="globals",em=`global-${ep}`),n&&(ep=n,eh="collections",r&&(em=`collection-${ep}-${r}`));let eg=(0,c.useCallback)(async(e,t)=>{if(A)try{let r=t===i,n=await iw.get(`${ef}/payload-locked-documents`,{credentials:"include",params:r?{"where[globalSlug][equals]":t}:{"where[document.relationTo][equals]":t,"where[document.value][equals]":e}}),{docs:a}=await n.json();if(a?.length>0){let e=a[0].id;await iw.delete(`${ef}/payload-locked-documents/${e}`,{credentials:"include",headers:{"Content-Type":"application/json"}}),Q(!1)}}catch(e){console.error("Failed to unlock the document",e)}},[ef,i,Q,A]),eb=(0,c.useCallback)(async(e,t,r)=>{if(A)try{let n=t===i,a=await iw.get(`${ef}/payload-locked-documents`,{credentials:"include",params:n?{"where[globalSlug][equals]":t}:{"where[document.relationTo][equals]":t,"where[document.value][equals]":e}}),{docs:l}=await a.json();if(l?.length>0){let e=l[0].id,t="object"==typeof r?{relationTo:r.collection,value:r.id}:{relationTo:"users",value:r};await iw.patch(`${ef}/payload-locked-documents/${e}`,{body:JSON.stringify({user:t}),credentials:"include",headers:{"Content-Type":"application/json"}})}}catch(e){console.error("Failed to update the document editor",e)}},[ef,i,A]),ev=(({id:e,api:t,collectionSlug:r,globalSlug:n,i18n:a,locale:l,permissions:i,setDocPermissions:o,setHasPublishPermission:s,setHasSavePermission:u})=>c.default.useCallback(async c=>{let d={locale:l||void 0},f=c?.id||e,p=(({id:e,collectionSlug:t,globalSlug:r})=>!!(r||t&&e))({id:f,collectionSlug:r,globalSlug:n});if(p){let e=r?`/${r}/access/${f}`:n?`/globals/${n}/access`:null;if(e){let l=await (await fetch(tR({apiRoute:t,path:`${e}${t6(d,{addQueryPrefix:!0})}`}),{body:JSON.stringify({...c?.doc||c||{},_status:"draft"}),credentials:"include",headers:{"Accept-Language":a.language,"Content-Type":"application/json"},method:"post"})).json(),i=await fetch(tR({apiRoute:t,path:`${e}${t6(d,{addQueryPrefix:!0})}`}),{body:JSON.stringify({...c?.doc||c||{},_status:"published"}),credentials:"include",headers:{"Accept-Language":a.language,"Content-Type":"application/json"},method:"POST"}).then(e=>e.json());o(l),u(oP({collectionSlug:r,docPermissions:l,globalSlug:n,isEditing:p})),s(i?.update)}}else{let e=r?i?.collections?.[r]:i?.globals?.[n];o(e),u(oP({collectionSlug:r,docPermissions:e,globalSlug:n,isEditing:p}))}},[l,e,r,n,t,a.language,o,u,s,i?.collections,i?.globals]))({id:r,api:P,collectionSlug:n,globalSlug:i,i18n:M,locale:ec,permissions:k,setDocPermissions:C,setHasPublishPermission:_,setHasSavePermission:S}),ey=(0,c.useCallback)(()=>eo(em),[eo,em]),ex=(0,c.useCallback)(async(e,t)=>{let r=await ey();if(em)try{await es(em,{...r,fields:{...r?.fields||{},[e]:{...r?.fields?.[e],...t}}})}catch(e){console.error(e)}},[es,em,ey]),ew=(0,c.useCallback)(()=>{let e=V+1;D&&D.versions?D.versions.maxPerDoc>0?H(Math.min(e,D.versions.maxPerDoc)):H(e):R&&R.versions&&(R.versions.max>0?H(Math.min(e,R.versions.max)):H(e))},[D,R,V]);(0,c.useEffect)(()=>{B(oy({collectionConfig:D,data:{...et,id:r},dateFormat:E,fallback:r?.toString(),globalConfig:R,i18n:M}))},[D,R,et,E,M,r]),(0,c.useEffect)(()=>{let e=O.current;return()=>{if(e)try{e.abort()}catch{}}},[]);let eC=c.default.useMemo(()=>{let e=`${"globals"===eh?"/globals":""}/${ep}${r?`/${r}`:""}`;return`${ef}${e}${t6({depth:0,"fallback-locale":"null",locale:ec,uploadEdits:I||void 0},{addQueryPrefix:!0})}`},[ef,ec,eh,r,ep,I]),ej={...t,action:eC,currentEditor:X,data:et,docConfig:L,docPermissions:w,documentIsLocked:Y,documentLockState:el,getDocPermissions:ev,getDocPreferences:ey,hasPublishedDoc:q,hasPublishPermission:$,hasSavePermission:j,incrementVersionCount:ew,initialData:p,initialState:m,isInitializing:ed,lastUpdateTime:Z,mostRecentVersionIsAutosaved:z,preferencesKey:em,savedDocumentData:et,setCurrentEditor:J,setData:er,setDocFieldPreferences:ex,setDocumentIsLocked:Q,setDocumentTitle:B,setHasPublishedDoc:K,setLastUpdateTime:ee,setMostRecentVersionIsAutosaved:U,setUnpublishedVersionCount:G,setUploadStatus:ei,title:F,unlockDocument:eg,unpublishedVersionCount:W,updateDocumentEditor:eb,updateSavedDocumentData:er,uploadStatus:en,versionCount:V};return(0,h.jsx)(oT,{value:ej,children:(0,h.jsx)(oC,{children:e})})}
42,oA=e=>(0,h.jsx)(oE,{children:(0,h.jsx)(oR,{...e})}),oO=(0,c.createContext)(""),oL=({children:e,operation:t})=>(0,h.jsx)(oO,{value:t,children:e}),oM=()=>(0,c.use)(oO),oI=c.default.createContext(void 0),oF=()=>{let e=c.default.useContext(oI);if(e)return e},oB=c.default.createContext(void 0),oz=e=>{let t=oF(),r=c.default.use(oB),n=c.default.useRef(null);if(null===n.current){let a=e?.path||t||e?.potentiallyStalePath;n.current=!!(r&&a&&r.path===a)}if(!0===n.current){if(!r)throw Error("FieldContext was removed after mount. This breaks hook ordering.");return r}return(e=>{let t=(0,v.c)(65),r;t[0]!==e?(r=e||{},t[0]=e,t[1]=r):r=t[1];let{disableFormData:n,hasRows:a,path:l,potentiallyStalePath:i,validate:o}=r,s=void 0!==n&&n,u=oF(),p=l||u||i,h=nv(),m=ny(),g=nC(),{user:b}=iS(),{id:y,collectionSlug:x}=oD(),w=oM(),C=nj(oU),j;t[2]!==p?(j=e=>{let[t]=e;return t&&t?.[p]||null},t[2]=p,t[3]=j):j=t[3];let S=nj(j),{t:$}=(0,f.d)(),{config:_}=(0,d.c)(),{getData:k,getDataByPath:E,getSiblingData:N,setModified:P}=nm(),T=ng(),D=S?.filterOptions,R=S?.value,A=S?.initialValue,O="boolean"!=typeof S?.valid||S.valid,L=!1===O&&h,M=(0,c.useRef)(O),I=(0,c.useRef)(S?.errorMessage),F;t[4]!==p?(F=p?p.split("."):[],t[4]=p,t[5]=F):F=t[5];let B=F,z;t[6]!==s||t[7]!==C||t[8]!==a||t[9]!==p||t[10]!==P?(z=(e,t)=>{let r=e&&"object"==typeof e&&"function"==typeof e.preventDefault&&"function"==typeof e.stopPropagation?e.target.value:e;C({type:"UPDATE",disableFormData:s||a&&r>0,path:p,value:r}),void 0!==t&&t||P(!0)},t[6]=s,t[7]=C,t[8]=a,t[9]=p,t[10]=P,t[11]=z):z=t[11];let U=z,V=S?.blocksFilterOptions,H=S?.customComponents,q=m||g,K=S?.errorMessage,W;t[12]!==S?.errorPaths?(W=S?.errorPaths||[],t[12]=S?.errorPaths,t[13]=W):W=t[13];let G=S?.rows,Y=S?.selectFilterOptions,Q=S?.valid,X;t[14]!==D||t[15]!==A||t[16]!==g||t[17]!==p||t[18]!==m||t[19]!==U||t[20]!==L||t[21]!==h||t[22]!==G||t[23]!==Y||t[24]!==Q||t[25]!==V||t[26]!==H||t[27]!==q||t[28]!==K||t[29]!==W||t[30]!==R?(X={blocksFilterOptions:V,customComponents:H,disabled:q,errorMessage:K,errorPaths:W,filterOptions:D,formInitializing:g,formProcessing:m,formSubmitted:h,initialValue:A,path:p,rows:G,selectFilterOptions:Y,setValue:U,showError:L,valid:Q,value:R},t[14]=D,t[15]=A,t[16]=g,t[17]=p,t[18]=m,t[19]=U,t[20]=L,t[21]=h,t[22]=G,t[23]=Y,t[24]=Q,t[25]=V,t[26]=H,t[27]=q,t[28]=K,t[29]=W,t[30]=R,t[31]=X):X=t[31];let J=X,Z;t[32]!==x||t[33]!==_||t[34]!==s||t[35]!==C||t[36]!==T||t[37]!==S||t[38]!==k||t[39]!==E||t[40]!==N||t[41]!==a||t[42]!==y||t[43]!==w||t[44]!==p||t[45]!==B||t[46]!==$||t[47]!==b||t[48]!==o||t[49]!==R?(Z=()=>{(async()=>{let e=R;S?.rows&&Array.isArray(S.rows)&&(e=E(p));let t=I.current,r=M.current,n=k(),l="function"==typeof o?await o(e,{id:y,blockData:void 0,collectionSlug:x,data:T?.getData?T.getData():n,event:"onChange",operation:w,path:B,preferences:{},req:{payload:{config:_},t:$,user:b},siblingData:N(p)}):"string"==typeof I.current?I.current:M.current;if("string"==typeof l?(r=!1,t=l):"boolean"==typeof l&&(r=l,t=void 0),r!==M.current||t!==I.current){M.current=r,I.current=t;let e={type:"UPDATE",errorMessage:t,path:p,rows:S?.rows,valid:r,validate:o,value:R};(s||a&&"number"==typeof R&&R>0)&&(e.disableFormData=!0),"function"==typeof C&&C(e)}})()},t[32]=x,t[33]=_,t[34]=s,t[35]=C,t[36]=T,t[37]=S,t[38]=k,t[39]=E,t[40]=N,t[41]=a,t[42]=y,t[43]=w,t[44]=p,t[45]=B,t[46]=$,t[47]=b,t[48]=o,t[49]=R,t[50]=Z):Z=t[50];let ee=S?.rows,et;return t[51]!==x||t[52]!==s||t[53]!==C||t[54]!==k||t[55]!==E||t[56]!==N||t[57]!==y||t[58]!==w||t[59]!==p||t[60]!==ee||t[61]!==b||t[62]!==o||t[63]!==R?(et=[R,s,C,k,N,E,y,w,p,b,o,ee,x],t[51]=x,t[52]=s,t[53]=C,t[54]=k,t[55]=E,t[56]=N,t[57]=y,t[58]=w,t[59]=p,t[60]=ee,t[61]=b,t[62]=o,t[63]=R,t[64]=et):et=t[64],iL(Z,150,et),J})(e)};function oU(e){let[,t]=e;return t}var oV=e=>{let t=(0,v.c)(2),{children:r,path:n}=e,a;t[0]!==n?(a=e=>{let[t]=e;return t&&t?.[n]||null},t[0]=n,t[1]=a):a=t[1];let{passesCondition:l}=nj(a)||{};return!1===l?null:r},oH=e=>t=>{let{path:r}=t;return(0,h.jsx)(oV,{path:r,children:(0,h.jsx)(e,{...t})})},oq=e=>({...e?.admin?.style||{},...e?.admin?.width?{"--field-width":e.admin.width}:{flex:"1 1 auto"},...e?.admin?.style?.flex?{flex:e.admin.style.flex}:{}}),oK="field-type";function oW({fieldLocalized:e,fieldRTL:t,locale:r,localizationConfig:n}){let a=r&&n&&n.locales&&n.locales.length>1,l=r?.code===n?.defaultLocale;return!1!==t&&r?.rtl===!0&&(e||!e&&!a||!e&&l)||!0===t}var oG=()=>(0,h.jsx)("svg",{className:"icon icon--check",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:(0,h.jsx)("path",{className:"stroke",d:"M15.3333 6.00001L8.00001 13.3333L4.66667 10",strokeLinecap:"square"})}),oY=()=>(0,h.jsx)("svg",{className:"icon icon--line",fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,h.jsx)("path",{className:"stroke",d:"M5.33333 10H14.6667",strokeLinecap:"square"})}),oQ="checkbox-input",oX=e=>{let t=(0,v.c)(24),{id:r,name:n,AfterInput:a,BeforeInput:l,checked:i,className:o,inputRef:s,Label:u,label:d,localized:f,onToggle:p,partialChecked:m,readOnly:g,required:b}=e,[y,x]=(0,c.useState)(!1),w=(0,c.useId)(),C=r||w,j,S;t[0]===Symbol.for("react.memo_cache_sentinel")?(j=()=>{x(!0)},S=[],t[0]=j,t[1]=S):(j=t[0],S=t[1]),(0,c.useEffect)(j,S);let $=g||!y,_=i&&`${oQ}--checked`,k=$&&`${oQ}--read-only`,E;
42t[2]!==o||t[3]!==_||t[4]!==k?(E=[o,oQ,_,k].filter(Boolean),t[2]=o,t[3]=_,t[4]=k,t[5]=E):E=t[5];let N=E.join(" "),P=!!i,T;if(t[6]!==a||t[7]!==l||t[8]!==u||t[9]!==i||t[10]!==C||t[11]!==s||t[12]!==d||t[13]!==f||t[14]!==n||t[15]!==p||t[16]!==m||t[17]!==$||t[18]!==b||t[19]!==N||t[20]!==P){let e=(0,h.jsx)("input",{"aria-label":"","aria-labelledby":n,checked:P,disabled:$,id:C,name:n,onChange:p,ref:s,required:b,title:n,type:"checkbox"}),r=!i&&m?"partial":"check",o;t[22]!==r?(o=[`${oQ}__icon`,r].filter(Boolean),t[22]=r,t[23]=o):o=t[23],T=(0,h.jsxs)("div",{className:N,children:[(0,h.jsxs)("div",{className:`${oQ}__input`,children:[l,e,(0,h.jsxs)("span",{className:o.join(" "),children:[i&&(0,h.jsx)(oG,{}),!i&&m&&(0,h.jsx)(oY,{})]}),a]}),(0,h.jsx)(r7,{CustomComponent:u,Fallback:(0,h.jsx)(iR,{htmlFor:C,label:d,localized:f,required:b})})]}),t[6]=a,t[7]=l,t[8]=u,t[9]=i,t[10]=C,t[11]=s,t[12]=d,t[13]=f,t[14]=n,t[15]=p,t[16]=m,t[17]=$,t[18]=b,t[19]=N,t[20]=P,t[21]=T}else T=t[21];return T},oJ="checkbox",oZ=oH(e=>{let{id:t,checked:r,disableFormData:n,field:a,field:{admin:{className:l,description:i}={},label:o,required:s}={},onChange:u,partialChecked:d,path:p,readOnly:m,validate:g}=e,{uuid:b}=nm(),v=a0(),{i18n:{language:y}}=(0,f.d)(),x=t5.includes(y),{customComponents:{AfterInput:w,BeforeInput:C,Description:j,Error:S,Label:$}={},disabled:_,path:k,setValue:E,showError:N,value:P}=oz({disableFormData:n,potentiallyStalePath:p,validate:(0,c.useCallback)((e,t)=>{if("function"==typeof g)return g(e,{...t,required:s})},[g,s])}),T=(0,c.useCallback)(()=>{m||(E(!P),"function"==typeof u&&u(!P))},[u,m,E,P]),D=r||!!P,R=t||iD(k,v,b),A=(0,c.useMemo)(()=>oq(a),[a]);return(0,h.jsxs)("div",{className:[oK,oJ,N&&"error",l,P&&`${oJ}--checked`,(m||_)&&`${oJ}--read-only`].filter(Boolean).join(" "),style:A,children:[(0,h.jsx)(r7,{CustomComponent:S,Fallback:(0,h.jsx)(aX,{alignCaret:x?"right":"left",path:k,showError:N})}),(0,h.jsx)(oX,{AfterInput:w,BeforeInput:C,checked:D,id:R,inputRef:null,Label:$,label:o,name:k,onToggle:T,partialChecked:d,readOnly:m||_,required:s}),(0,h.jsx)(r7,{CustomComponent:j,Fallback:(0,h.jsx)(aQ,{description:i,path:k})})]})}),o0=e=>{let t,r,n=(0,v.c)(13),{fieldValue:a,localized:l,path:i,readOnly:o}=e,s=void 0!==o&&o,{code:u}=iP(),{config:p}=(0,d.c)(),{localization:m}=p,[g,b]=c.useState("number"!=typeof a),{t:y}=(0,f.d)(),{dispatchFields:x,setModified:w}=nm();if(!l||!m||m.defaultLocale===u||!m.fallback)return null;n[0]!==g||n[1]!==x||n[2]!==a||n[3]!==i||n[4]!==w?(t=()=>{let e=!g;x({type:"UPDATE",path:i,value:e?null:a||0}),w(!0),b(e)},n[0]=g,n[1]=x,n[2]=a,n[3]=i,n[4]=w,n[5]=t):t=n[5];let C=t;if(a){let e=!1;if("number"==typeof a&&a>0&&(e=!0),Array.isArray(a)&&a.length>0&&(e=!0),e)return g&&b(!1),null}return n[6]!==g||n[7]!==a||n[8]!==C||n[9]!==i||n[10]!==s||n[11]!==y?(r=(0,h.jsx)(nJ,{className:"nullify-locale-field",children:!a&&s?y("general:fallbackToDefaultLocale"):(0,h.jsx)(oZ,{checked:g,field:{name:"",label:y("general:fallbackToDefaultLocale")},id:`field-${i.replace(/\./g,"__")}`,onChange:C,path:i,schemaPath:""})}),n[6]=g,n[7]=a,n[8]=C,n[9]=i,n[10]=s,n[11]=y,n[12]=r):r=n[12],r},o1=e=>{let t=document.getElementById(e);if(t){let e=t.getBoundingClientRect();window.scrollBy({behavior:"smooth",top:e.top-100})}},o2="array-actions",o3=e=>{let t=(0,v.c)(12),{addRow:r,copyRow:n,duplicateRow:a,hasMaxRows:l,index:i,isSortable:o,moveRow:s,pasteRow:u,removeRow:d,rowCount:p}=e,{t:m}=(0,f.d)(),g;return t[0]!==r||t[1]!==n||t[2]!==a||t[3]!==l||t[4]!==i||t[5]!==o||t[6]!==s||t[7]!==u||t[8]!==d||t[9]!==p||t[10]!==m?(g=(0,h.jsx)(al,{button:(0,h.jsx)(am,{}),buttonClassName:`${o2}__button`,className:o2,horizontalAlign:"center",render:e=>{let{close:t}=e;return(0,h.jsxs)(n6.ButtonGroup,{buttonSize:"small",children:[o&&0!==i&&(0,h.jsxs)(n6.Button,{className:`${o2}__action ${o2}__move-up`,onClick:()=>{s(i,i-1),t()},children:[(0,h.jsx)("div",{className:`${o2}__action-chevron`,children:(0,h.jsx)(nZ,{direction:"up"})}),m("general:moveUp")]}),o&&i<p-1&&(0,h.jsxs)(n6.Button,{className:`${o2}__action`,onClick:()=>{s(i,i+1),t()},children:[(0,h.jsx)("div",{className:`${o2}__action-chevron`,children:(0,h.jsx)(nZ,{})}),m("general:moveDown")]}),!l&&(0,h.jsxs)(c.default.Fragment,{children:[(0,h.jsxs)(n6.Button,{className:`${o2}__action ${o2}__add`,onClick:()=>{r(i+1),t()},children:[(0,h.jsx)(n2,{}),m("general:addBelow")]}),(0,h.jsxs)(n6.Button,{className:`${o2}__action ${o2}__duplicate`,onClick:()=>{a(i),t()},children:[(0,h.jsx)(ag,{}),m("general:duplicate")]})]}),(0,h.jsx)(n6.Button,{className:`${o2}__action ${o2}__copy`,onClick:()=>{n(i),t()},children:(0,h.jsx)(ab,{isRow:!0})}),(0,h.jsx)(n6.Button,{className:`${o2}__action ${o2}__paste`,onClick:()=>{u(i),t()},children:(0,h.jsx)(ab,{isPaste:!0,isRow:!0})}),(0,h.jsxs)(n6.Button,{className:`${o2}__action ${o2}__remove`,onClick:()=>{d(i),t()},children:[(0,h.jsx)(f.a,{}),m("general:remove")]})]})},size:"medium"}),t[0]=r,t[1]=n,t[2]=a,t[3]=l,t[4]=i,t[5]=o,t[6]=s,t[7]=u,t[8]=d,t[9]=p,t[10]=m,t[11]=g):g=t[11
42],g},o6=({className:e})=>(0,h.jsxs)("svg",{className:["icon icon--drag-handle",e].filter(Boolean).join(" "),viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:[(0,h.jsx)("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"}),(0,h.jsx)("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"}),(0,h.jsx)("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"}),(0,h.jsx)("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"}),(0,h.jsx)("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"}),(0,h.jsx)("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"})]}),o5=({id:e,children:t,className:r,duration:n=300,height:a})=>{let[l,i]=c.default.useState(()=>!!a),o=(0,c.useRef)(l),[s,u]=c.default.useState(()=>l?"":"none"),[d,f]=c.default.useState(()=>l?"":"hidden"),[p,m]=c.default.useState(!1),g=(0,c.useRef)(null),b=(0,c.useRef)(null);return(0,c.useEffect)(()=>{let e,t,r=!!a,l=o.current!==r;return o.current=r,l&&(m(!0),f("hidden"),r?u(""):e=window.setTimeout(()=>{u("none")},n),i(r),t=window.setTimeout(()=>{f(""),m(!1)},n)),()=>{e&&clearTimeout(e),t&&clearTimeout(t)}},[a,n]),(({containerRef:e,contentRef:t,duration:r,open:n})=>{let a=(0,c.useMemo)(()=>!!("u">typeof CSS&&CSS)&&!!CSS.supports&&CSS.supports("interpolate-size","allow-keywords"),[]),l=(0,c.useRef)(!1),i=(0,c.useRef)(n),[o,s]=(0,c.useState)(!1),u=(0,c.useRef)(null);return(0,c.useEffect)(()=>{let c=e.current,d=t.current;if(!c||!d||a)return;let f=e=>{c.style.height=e};return(()=>{if(!l.current&&n){f("auto"),s(!1);return}l.current=!0,i.current!==n&&f(n?"0px":`${d.scrollHeight}px`),c.offsetHeight,s(!0),c.style.transition=`height ${r}ms ease`,f(n?`${d.scrollHeight}px`:"0px");let e=()=>{c&&(c.style.transition="",c.style.height=n?"auto":"0px",s(!1)),c.removeEventListener("transitionend",e)};c.addEventListener("transitionend",e)})(),i.current=n,u.current=new ResizeObserver(()=>{o&&(c.style.height=n?`${d.scrollHeight}px`:"0px")}),u.current.observe(d),()=>{c&&(c.style.transition="",c.style.height=""),u.current?.disconnect()}},[n,r,e,t,a])})({containerRef:g,contentRef:b,duration:n,open:l}),(0,h.jsx)("div",{"aria-hidden":!l,className:[r,"rah-static",l&&"auto"===a&&"rah-static--height-auto",p&&`rah-animating--${l?"down":"up"}`,p&&"auto"===a&&"rah-animating--to-height-auto"].filter(Boolean).join(" "),id:e,ref:g,style:{overflow:d,transition:`height ${n}ms ease`},children:(0,h.jsx)("div",{ref:b,...s?{style:{display:s}}:{},children:t})})},o4=(0,c.createContext)({isCollapsed:void 0,isVisible:void 0,isWithinCollapsible:void 0,toggle:()=>{}}),o8=({children:e,isCollapsed:t,isWithinCollapsible:r=!0,toggle:n})=>{let{isCollapsed:a,isVisible:l}=o7(),i=c.default.useMemo(()=>({isCollapsed:t,isVisible:l&&!a,isWithinCollapsible:r,toggle:n}),[t,r,n,a,l]);return(0,h.jsx)(o4,{value:i,children:e})},o7=()=>(0,c.use)(o4),o9="collapsible",se=e=>{let t,r=(0,v.c)(25),{actions:n,AfterCollapsible:a,children:l,className:i,collapsibleStyle:o,disableHeaderToggle:s,disableToggleIndicator:u,dragHandleProps:d,header:p,initCollapsed:m,isCollapsed:g,onToggle:b}=e,y=void 0!==s&&s,x=void 0!==u&&u,[w,C]=(0,c.useState)(!!m),[j,S]=(0,c.useState)(!1),{isWithinCollapsible:$}=o7(),{t:_}=(0,f.d)(),k="boolean"==typeof g?g:w,E;r[0]!==k||r[1]!==b?(E=()=>{"function"==typeof b&&b(!k),C(!k)},r[0]=k,r[1]=b,r[2]=E):E=r[2];let N=E,P=d&&`${o9}--has-drag-handle`,T=k&&`${o9}--collapsed`,D=$&&`${o9}--nested`,R=j&&!y&&`${o9}--hovered`,A=`${o9}--style-${void 0===o?"default":o}`,O;r[3]!==i||r[4]!==P||r[5]!==T||r[6]!==D||r[7]!==R||r[8]!==A?(O=[o9,i,P,T,D,R,A].filter(
42Boolean),r[3]=i,r[4]=P,r[5]=T,r[6]=D,r[7]=R,r[8]=A,r[9]=O):O=r[9];let L=O.join(" "),M=`${o9}__toggle-wrap${y?" toggle-disabled":""}`,I,F;return r[10]===Symbol.for("react.memo_cache_sentinel")?(I=()=>S(!0),F=()=>S(!1),r[10]=I,r[11]=F):(I=r[10],F=r[11]),r[12]!==a||r[13]!==n||r[14]!==l||r[15]!==y||r[16]!==x||r[17]!==d||r[18]!==p||r[19]!==k||r[20]!==_||r[21]!==L||r[22]!==M||r[23]!==N?(t=(0,h.jsx)("div",{className:L,children:(0,h.jsxs)(o8,{isCollapsed:k,toggle:N,children:[(0,h.jsxs)("div",{className:M,onMouseEnter:I,onMouseLeave:F,children:[!y&&(0,h.jsx)("button",{className:[`${o9}__toggle`,`${o9}__toggle--${k?"collapsed":"open"}`].filter(Boolean).join(" "),onClick:N,type:"button",children:(0,h.jsx)("span",{children:_("fields:toggleBlock")})}),d&&(0,h.jsx)("div",{className:`${o9}__drag`,...d.attributes,...d.listeners,children:(0,h.jsx)(o6,{})}),p?(0,h.jsx)("div",{className:[`${o9}__header-wrap`,d&&`${o9}__header-wrap--has-drag-handle`].filter(Boolean).join(" "),children:p}):null,(0,h.jsxs)("div",{className:`${o9}__actions-wrap`,children:[n?(0,h.jsx)("div",{className:`${o9}__actions`,children:n}):null,!x&&(0,h.jsx)("div",{className:`${o9}__indicator`,children:(0,h.jsx)(nZ,{direction:k?void 0:"up"})})]})]}),(0,h.jsx)(o5,{height:k?0:"auto",children:(0,h.jsx)("div",{className:`${o9}__content`,children:l})}),a]})}),r[12]=a,r[13]=n,r[14]=l,r[15]=y,r[16]=x,r[17]=d,r[18]=p,r[19]=k,r[20]=_,r[21]=L,r[22]=M,r[23]=N,r[24]=t):t=r[24],t},st=e=>{let t=(0,v.c)(9),{children:r,className:n,forceRender:a}=e,[l,i]=c.default.useState(!!a),o;t[0]===Symbol.for("react.memo_cache_sentinel")?(o={rootMargin:"1000px"},t[0]=o):o=t[0];let[s,u]=ai(o,!!a),d=!!u?.isIntersecting,f=u?.boundingClientRect?.top<0,p=a||d||f,m,g;t[1]!==l||t[2]!==p?(m=()=>{p&&!l&&i(!0)},g=[p,l],t[1]=l,t[2]=p,t[3]=m,t[4]=g):(m=t[3],g=t[4]),c.default.useEffect(m,g);let b=l?r:null,y;return t[5]!==n||t[6]!==s||t[7]!==b?(y=(0,h.jsx)("div",{className:n,ref:s,children:b}),t[5]=n,t[6]=s,t[7]=b,t[8]=y):y=t[8],y},sr="pill",sn=e=>{let t=(0,v.c)(12),{id:r,className:n}=e,a;t[0]!==r?(a={id:r},t[0]=r,t[1]=a):a=t[1];let{attributes:l,isDragging:i,listeners:o,setNodeRef:s,transform:c}=aH(a),u=i&&`${sr}--is-dragging`,d;t[2]!==n||t[3]!==u?(d=[u,n].filter(Boolean),t[2]=n,t[3]=u,t[4]=d):d=t[4];let f=d.join(" "),p;return t[5]!==l||t[6]!==o||t[7]!==e||t[8]!==s||t[9]!==f||t[10]!==c?(p=(0,h.jsx)(sa,{...e,className:f,elementProps:{...o,...l,ref:s,style:{transform:c}}}),t[5]=l,t[6]=o,t[7]=e,t[8]=s,t[9]=f,t[10]=c,t[11]=p):p=t[11],p},sa=e=>{let t=(0,v.c)(27),{id:r,alignIcon:n,"aria-checked":a,"aria-controls":l,"aria-expanded":i,"aria-label":o,children:s,className:u,draggable:d,elementProps:f,icon:p,onClick:m,pillStyle:g,rounded:b,size:y,to:x}=e,[w,C]=(0,c.useState)(!1),j,S;t[0]===Symbol.for("react.memo_cache_sentinel")?(j=()=>{C(!0)},S=[],t[0]=j,t[1]=S):(j=t[0],S=t[1]),(0,c.useEffect)(j,S);let $=m&&!x,_=`${sr}--style-${void 0===g?"light":g}`,k=`${sr}--size-${void 0===y?"medium":y}`,E=u&&u,N=x&&`${sr}--has-link`,P=(x||m)&&`${sr}--has-action`,T=p&&`${sr}--has-icon`,D=p&&`${sr}--align-icon-${void 0===n?"right":n}`,R=d&&`${sr}--draggable`,A=b&&`${sr}--rounded`,O;t[2]!==T||t[3]!==D||t[4]!==R||t[5]!==A||t[6]!==_||t[7]!==k||t[8]!==E||t[9]!==N||t[10]!==P?(O=[sr,_,k,E,N,P,T,D,R,A].filter(Boolean),t[2]=T,t[3]=D,t[4]=R,t[5]=A,t[6]=_,t[7]=k,t[8]=E,t[9]=N,t[10]=P,t[11]=O):O=t[11];let L=O.join(" "),M="div";$&&(M="button"),x&&(M=nQ);let I=$?!w:void 0,F=x||null,B=$?"button":void 0,z;return t[12]!==M||t[13]!==a||t[14]!==l||t[15]!==i||t[16]!==o||t[17]!==s||t[18]!==L||t[19]!==f||t[20]!==p||t[21]!==r||t[22]!==m||t[23]!==I||t[24]!==F||t[25]!==B?(z=(0,h.jsxs)(M,{...f,"aria-checked":a,"aria-controls":l,"aria-expanded":i,"aria-label":o,className:L,disabled:I,href:F,id:r,onClick:m,type:B,children:[(0,h.jsx)("span",{className:`${sr}__label`,children:s}),!!p&&(0,h.jsx)("span",{className:`${sr}__icon`,children:p})]}),t[12]=M,t[13]=a,t[14]=l,t[15]=i,t[16]=o,t[17]=s,t[18]=L,t[19]=f,t[20]=p,t[21]=r,t[22]=m,t[23]=I,t[24]=F,t[25]=B,t[26]=z):z=t[26],z},sl=e=>{let{draggable:t}=e;return t?(0,h.jsx)(sn,{...e}):(0,h.jsx)(sa,{...e})};function si(e,t){let[r,n]=(0,c.useState)(e);return(0,c.useEffect)(()=>{let r=setTimeout(()=>{n(e)},t);return()=>{clearTimeout(r)}},[e,t]),r}var so="thumbnail-card",ss=e=>{let t=(0,v.c)(13),{alignLabel:r,className:n,collection:a,doc:l,label:i,onClick:o,thumbnail:s}=e,{config:c}=(0,d.c)(),{i18n:u}=(0,f.d)(),p="function"==typeof o&&`${so}
42--has-on-click`,m=r&&`${so}--align-label-${r}`,g;t[0]!==n||t[1]!==p||t[2]!==m?(g=[so,n,p,m].filter(Boolean),t[0]=n,t[1]=p,t[2]=m,t[3]=g):g=t[3];let b=g.join(" "),y;if(t[4]!==b||t[5]!==a||t[6]!==c||t[7]!==l||t[8]!==u||t[9]!==i||t[10]!==o||t[11]!==s){let e=i;e||(e=oy({collectionConfig:a,data:l,dateFormat:c.admin.dateFormat,fallback:l?.filename,i18n:u})),y=(0,h.jsxs)("button",{className:b,onClick:o,title:e,type:"button",children:[(0,h.jsx)("div",{className:`${so}__thumbnail`,children:s}),(0,h.jsx)("div",{className:`${so}__label`,children:e})]}),t[4]=b,t[5]=a,t[6]=c,t[7]=l,t[8]=u,t[9]=i,t[10]=o,t[11]=s,t[12]=y}else y=t[12];return y},sc=[];for(su=0;su<256;++su)sc.push((su+256).toString(16).slice(1));var su,sd,sf=new Uint8Array(16),sp="u">typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),sh=function(e,t,r){if(sp&&!t&&!e)return sp();var n=(e=e||{}).random||(e.rng||function(){if(!sd&&!(sd="u">typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)))throw Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return sd(sf)})();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,t){r=r||0;for(var a=0;a<16;++a)t[r+a]=n[a];return t}return function(e,t=0){return(sc[e[t+0]]+sc[e[t+1]]+sc[e[t+2]]+sc[e[t+3]]+"-"+sc[e[t+4]]+sc[e[t+5]]+"-"+sc[e[t+6]]+sc[e[t+7]]+"-"+sc[e[t+8]]+sc[e[t+9]]+"-"+sc[e[t+10]]+sc[e[t+11]]+sc[e[t+12]]+sc[e[t+13]]+sc[e[t+14]]+sc[e[t+15]]).toLowerCase()}(n)},sm=()=>{let[e]=(0,c.useState)(()=>`pattern${sh()}`);return(0,h.jsxs)("svg",{fill:"none",height:"151",preserveAspectRatio:"xMidYMid slice",viewBox:"0 0 231 151",width:"231",xmlns:"http://www.w3.org/2000/svg",children:[(0,h.jsxs)("g",{clipPath:`url(#${e})`,children:[(0,h.jsx)("rect",{fill:"#D9D9D9",height:"100%",rx:"2",width:"100%"}),(0,h.jsx)("rect",{fill:"#BCBCBC",height:"116.063",transform:"rotate(52.0687 33.7051 79.3051)",width:"85.8593",x:"33.7051",y:"79.3051"}),(0,h.jsx)("rect",{fill:"#BCBCBC",height:"116.063",transform:"rotate(52.0687 86.1219 92.6272)",width:"85.8593",x:"86.1219",y:"92.6272"}),(0,h.jsx)("circle",{cx:"189",cy:"45",fill:"#BCBCBC",r:"19"}),(0,h.jsx)("rect",{fill:"#B8B8B8",height:"5",rx:"2.5",width:"98",x:"66",y:"70"}),(0,h.jsx)("rect",{fill:"#B8B8B8",height:"5",rx:"2.5",width:"76",x:"77",y:"82"})]}),(0,h.jsx)("defs",{children:(0,h.jsx)("clipPath",{id:`${e}`,children:(0,h.jsx)("rect",{fill:"white",height:"151",width:"231"})})})]})},sg=()=>(0,h.jsx)("svg",{className:"icon icon--search",fill:"none",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:(0,h.jsx)("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"})}),sb="block-search",sv=e=>{let t=(0,v.c)(5),{setSearchTerm:r}=e,{t:n}=(0,f.d)(),a;t[0]!==r?(a=e=>{r(e.target.value)},t[0]=r,t[1]=a):a=t[1];let l=a,i;return t[2]!==l||t[3]!==n?(i=(0,h.jsxs)("div",{className:sb,children:[(0,h.jsx)("input",{className:`${sb}__input`,onChange:l,placeholder:n("fields:searchForBlock")}),(0,h.jsx)(sg,{})]}),t[2]=l,t[3]=n,t[4]=i):i=t[4],i},sy="blocks-drawer",sx=e=>{let{blocks:t,onSelect:r,searchTerm:n}=e,[a,l]=(0,d.a)(n??""),[i,o]=(0,c.useState)(t),{i18n:s}=(0,f.d)(),{config:u}=(0,d.c)(),p=(0,c.useMemo)(()=>{let e={_none:[]};return i.forEach(t=>{if("object"==typeof t&&t.admin?.group){let r=t.admin.group,n="string"==typeof r?r:m(r,s);Object.hasOwn(e,n)?e[n].push(t):e[n]=[t]}else e._none.push(t)}),e},[i,s]);return(0,c.useEffect)(()=>{let e=a.toLowerCase();o(t?.reduce((t,r)=>{let n="string"==typeof r?u.blocksMap[r]:r;return("string"==typeof n.labels.singular?n.labels.singular.toLowerCase():"object"==typeof n.labels.singular?m(n.labels.singular,s).toLowerCase():"").includes(e)&&t.push(n),t},[]))},[a,t,s,u.blocksMap]),(0,h.jsxs)(c.Fragment,{children:[(0,h.jsx)(sv,{setSearchTerm:l}),(0,h.jsx)("div",{className:`${sy}__blocks-wrapper`,children:(0,h.jsx)("ul",{className:`${sy}__block-groups`,children:Object.entries(p).map(([e,t])=>t.length?(0,h.jsxs)("li",{className:[`${sy}
42__block-group`,"_none"===e&&`${sy}__block-group-none`].filter(Boolean).join(" "),children:["_none"!==e&&(0,h.jsx)("h3",{className:`${sy}__block-group-label`,children:e}),(0,h.jsx)("ul",{className:`${sy}__blocks`,children:t.map((e,t)=>{let{slug:n,admin:a,imageAltText:l,imageURL:i,labels:o}="string"==typeof e?u.blocksMap[e]:e,c=a?.images?.thumbnail?"string"==typeof a.images.thumbnail?a.images.thumbnail:a.images.thumbnail.url:i,d=a?.images?.thumbnail&&"string"!=typeof a.images.thumbnail?a.images.thumbnail.alt:l;return(0,h.jsx)("li",{className:`${sy}__block`,children:(0,h.jsx)(ss,{alignLabel:"center",label:m(o?.singular,s),onClick:()=>{"function"==typeof r&&r(n)},thumbnail:(0,h.jsx)("div",{className:`${sy}__default-image`,children:c?(0,h.jsx)("img",{alt:d,src:c}):(0,h.jsx)(sm,{})})})},t)})})]},e):null)})})]})},sw=e=>{let t,r=(0,v.c)(19),{addRow:n,addRowIndex:a,blocks:l,drawerSlug:i,labels:o}=e,{closeModal:s,isModalOpen:u}=lc(),{i18n:d,t:p}=(0,f.d)(),[g,b]=c.default.useState(""),y,x;if(r[0]!==i||r[1]!==u?(y=()=>{u(i)||b("")},x=[u,i],r[0]=i,r[1]=u,r[2]=y,r[3]=x):(y=r[2],x=r[3]),(0,c.useEffect)(y,x),r[4]!==n||r[5]!==a||r[6]!==l||r[7]!==s||r[8]!==i||r[9]!==d||r[10]!==o.singular||r[11]!==g||r[12]!==p){let e;r[14]!==n||r[15]!==a||r[16]!==s||r[17]!==i?(e=e=>{n(a,e),s(i)},r[14]=n,r[15]=a,r[16]=s,r[17]=i,r[18]=e):e=r[18],t=(0,h.jsx)(ip,{slug:i,title:p("fields:addLabel",{label:m(o.singular,d)}),children:(0,h.jsx)(sx,{blocks:l,onSelect:e,searchTerm:g})}),r[4]=n,r[5]=a,r[6]=l,r[7]=s,r[8]=i,r[9]=d,r[10]=o.singular,r[11]=g,r[12]=p,r[13]=t}else t=r[13];return t},sC=e=>{let t,r=(0,v.c)(28),{addRow:n,blocks:a,blockType:l,copyRow:i,duplicateRow:o,hasMaxRows:s,isSortable:u,labels:d,moveRow:f,pasteRow:p,removeRow:m,rowCount:g,rowIndex:b}=e,{closeModal:y,openModal:x}=lc(),w=is("blocks-drawer"),[C,j]=c.default.useState(null),S;if(r[0]!==n||r[1]!==y||r[2]!==w||r[3]!==C?(S=(e,t)=>{"function"==typeof n&&n(C,t),y(w)},r[0]=n,r[1]=y,r[2]=w,r[3]=C,r[4]=S):S=r[4],r[5]!==l||r[6]!==a||r[7]!==i||r[8]!==w||r[9]!==o||r[10]!==s||r[11]!==u||r[12]!==d||r[13]!==f||r[14]!==x||r[15]!==p||r[16]!==m||r[17]!==g||r[18]!==b||r[19]!==S){let e,n;r[21]!==w||r[22]!==x?(e=e=>{j(e),x(w)},r[21]=w,r[22]=x,r[23]=e):e=r[23],r[24]!==l||r[25]!==o||r[26]!==b?(n=()=>o(b,l),r[24]=l,r[25]=o,r[26]=b,r[27]=n):n=r[27],t=(0,h.jsxs)(c.default.Fragment,{children:[(0,h.jsx)(sw,{addRow:S,addRowIndex:b,blocks:a,drawerSlug:w,labels:d}),(0,h.jsx)(o3,{addRow:e,copyRow:i,duplicateRow:n,hasMaxRows:s,index:b,isSortable:u,moveRow:f,pasteRow:p,removeRow:m,rowCount:g})]}),r[5]=l,r[6]=a,r[7]=i,r[8]=w,r[9]=o,r[10]=s,r[11]=u,r[12]=d,r[13]=f,r[14]=x,r[15]=p,r[16]=m,r[17]=g,r[18]=b,r[19]=S,r[20]=t}else t=r[20];return t},sj="section-title",sS=e=>{let t=(0,v.c)(14),{customOnChange:r,customValue:n,path:a,readOnly:l}=e,i;t[0]!==a?(i={path:a},t[0]=a,t[1]=i):i=t[1];let{setValue:o,value:s}=oz(i),{t:c}=(0,f.d)(),u;t[2]===Symbol.for("react.memo_cache_sentinel")?(u=[sj].filter(Boolean),t[2]=u):u=t[2];let d=u.join(" "),p;t[3]!==r||t[4]!==o?(p=r||(e=>{e.stopPropagation(),e.preventDefault(),o(e.target.value)}),t[3]=r,t[4]=o,t[5]=p):p=t[5];let m=p,g=n||s,b;return t[6]!==n||t[7]!==m||t[8]!==a||t[9]!==l||t[10]!==c||t[11]!==g||t[12]!==s?(b=(0,h.jsx)("div",{className:d,"data-value":g,children:(0,h.jsx)("input",{className:`${sj}__input`,id:a,name:a,onChange:m,placeholder:c("general:untitled"),readOnly:l,type:"text",value:n||s||""})}),t[6]=n,t[7]=m,t[8]=a,t[9]=l,t[10]=c,t[11]=g,t[12]=s,t[13]=b):b=t[13],b},s$="blocks-field",s_=e=>{let t=(0,v.c)(42),{addRow:r,attributes:n,block:a,blocks:l,copyRow:i,duplicateRow:o,errorCount:s,fields:c,hasMaxRows:u,isLoading:p,isSortable:g,Label:b,labels:y,listeners:x,moveRow:w,parentPath:C,pasteRow:j,path:S,permissions:$,readOnly:_,removeRow:k,row:E,rowCount:N,rowIndex:P,schemaPath:T,setCollapse:D,setNodeRef:R,transform:A}=e,O=si(p,500),{i18n:L}=(0,f.d)(),M=nv()&&s>0,I=!a.admin?.disableBlockName,F=M?`${s$}__row--has-errors`:`${s$}__row--no-errors`,B;t[0]!==F?(B=[`${s$}__row`,F].filter(Boolean),t[0]=F,t[1]=B):B=t[1];let z=B.join(" "),U;if(t[2]!==b||t[3]!==r||t[4]!==n||t[5]!==a.fields||t[6]!==a.labels||t[7]!==a.slug||t[8]!==l||t[9]!==z||t[10]!==i||t[11]!==o||t[12]!==s||t[13]!==M||t[14]!==c||t[15]!==u||t[16]!==L||t[17]!==O||t[18]!==g||t[19]!==y||t[20]!==x||t[21]!==w||t[22]!==C||t[23]!==j||t[24]!==S||t[25]!==$||t[26]!==_||t[27]!==k||t[28]!==E.blockType||t[29]!==E.collapsed||t[30]!==E.id||t[31]!==N||t[32]!==P||t[33]!==T||t[34]!==D||t[35]!==R||t[36]!==I||t[37]!==A){let e,f;if(!0===$)e=!0;else{let t=$?.blocks?.[a.slug]||$?.blocks;if(!0===t)e=!0;else if(t?.fields)e=t.fields;else if("object"==typeof $&&$&&!t){let r=!0===$.read,n=!$.create||!$.update;e=r&&(n||"object"==typeof $&&1===Object.keys($).length&&$.read)?{read:!0}:t?.fields}else e=t?.fields}t[39]!==E.id||t[40]!==D?(f=e=>D(E.id,e),t[39]=E.id,t[40]=D,t[41]=f):f=t[41],U=(0,h.jsx)("div",{id:`${C?.split(".").join("-")}-row-${P}`,ref:R,style:{transform:A},children:(0,h.jsx)(se,{actions:_?void 0:(0,h.jsx)(sC,{addRow:r,blocks:l,blockType:E.blockType,copyRow:i,duplicateRow:o,fields:a.fields,hasMaxRows:u,isSortable:g,labels:y,moveRow:w,pasteRow:j,removeRow:k,rowCount:N,rowIndex:P}),className:z,collapsibleStyle:M?"error":"default",dragHandleProps:g?{id:E.id,attributes:n,listeners:x}:void 0,header:O?(0,h.jsx)(d.f,{height:"1rem",width:"8rem"}):(0,h.jsxs)("div",{className:`${s$}__block-header`,children:[(0,h.jsx)(nk,{CustomComponent:b,label:(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)("span",{className:`${s$}__block-number`,children:String(P+1).padStart(2,"0")}),(0,h.jsx)(sl,{className:`${s$}__block-pill ${s$}__block-pill-${E.blockType}`,pillStyle:"white",size:"small",children:m(a.labels.singular,L)}),I&&(0,h.jsx)(sS,{path:`${S}.blockName`,readOnly:_})]}),path:S,rowNumber:P}),M&&(0,h.jsx)(aG,{count:s,i18n:L,withMessage:!0})]}),isCollapsed:E.collapsed,onToggle:f,children:O?(0,h.jsx)(d.f,{}):(0,h.jsx)(gq,{className:`${s$}__fields`,fields:c,margins:"small",parentIndexPath:"",parentPath:S,parentSchemaPath:T,permissions:e,readOnly:_})},E.id)},`${C}-row-${P}`),t[2]=b,t[3]=r,t[4]=n,t[5]=a.fields,t[6]=a.labels,t[7]=a.slug,t[8]=l,t[9]=z,t[10]=i,t[11]=o,t[12]=s,t[13]=M,t[14]=c,t[15]=u,t[16]=L,t[17]=O,t[18]=g,t[19]=y,t[20]=x,t[21]=w,t[22]=C,t[23]=j,t[24]=S,t[25]=$,t[26]=_,t[27]=k,t[28]=E.blockType,t[29]=E.collapsed,t[30]=E.id,t[31]=N,t[32]=P,t[33]=T,t[34]=D,t[35]=R,t[36]=I,t[37]=A,t[38]=U}else U=t[38];return U},sk="blocks-field",sE=oH(e=>{let{i18n:t,t:r}=(0,f.d)(),{field:n,field:{name:a,type:l,admin:{className:i,description:o,isSortable:s=!0}={},blockReferences:u,blocks:p,label:g,labels:b,localized:v,maxRows:y,minRows:x,required:w},path:C,permissions:j,readOnly:S,schemaPath:$,validate:_}=e,k=$??a,E=x??w?1:0,{setDocFieldPreferences:N}=oD(),{addFieldRow:P,dispatchFields:T,getFields:D,moveFieldRow:R,removeFieldRow:A,replaceState:O,setModified:L}=nm(),{code:M}=iP(),{config:{localization:I},config:F}=(0,d.c)(),B=is("blocks-drawer"),z=nv(),U={plural:r("fields:blocks"),singular:r("fields:block"),...b},V=!I||!I.fallback||M===I.defaultLocale,{blocksFilterOptions:H,customComponents:{AfterInput:q,BeforeInput:K,Description:W,Error:G,Label:Y}={},disabled:Q,errorPaths:X,path:J,rows:Z=[],showError:ee,valid:et,value:er}=oz({hasRows:!0,potentiallyStalePath:C,validate:(0,c.useCallback)((e,t)=>!V&&null===e||("function"==typeof _?_(e,{...t,maxRows:y,minRows:E,required:w}):void 0),[y,E,w,_,V])}
42),{clientBlocks:en,clientBlocksAfterFilter:ea}=(0,c.useMemo)(()=>{let e=[];if(u)for(let t of u){let r="string"==typeof t?F.blocksMap[t]:t;r&&e.push(r)}else e=p;if(Array.isArray(H)){let t=e.filter(e=>{let t="string"==typeof e?e:e.slug;return H.includes(t)});return{clientBlocks:e,clientBlocksAfterFilter:t}}return{clientBlocks:e,clientBlocksAfterFilter:e}},[u,p,H,F.blocksMap]),el=(0,c.useCallback)((e,t)=>{P({blockType:t,path:J,rowIndex:e,schemaPath:k}),setTimeout(()=>{o1(`${J}-row-${e+1}`)},0)},[P,J,k]),ei=(0,c.useCallback)(e=>{T({type:"DUPLICATE_ROW",path:J,rowIndex:e}),L(!0),setTimeout(()=>{o1(`${J}-row-${e+1}`)},0)},[T,J,L]),eo=(0,c.useCallback)(e=>{A({path:J,rowIndex:e})},[J,A]),es=(0,c.useCallback)((e,t)=>{R({moveFromIndex:e,moveToIndex:t,path:J})},[R,J]),ec=(0,c.useCallback)(e=>{let{collapsedIDs:t,updatedRows:r}=iO({collapsed:e,rows:Z});T({type:"SET_ALL_ROWS_COLLAPSED",path:J,updatedRows:r}),N(J,{collapsed:t})},[T,J,Z,N]),eu=(0,c.useCallback)((e,t)=>{let{collapsedIDs:r,updatedRows:n}=iA({collapsed:t,rowID:e,rows:Z});T({type:"SET_ROW_COLLAPSED",path:J,updatedRows:n}),N(J,{collapsed:r})},[T,J,Z,N]),ed=(0,c.useCallback)(e=>{let t=ap({type:l,blocks:en,getDataToCopy:()=>aw({formState:{...D()},path:J,rowIndex:e}),path:J,rowIndex:e,t:r});"string"==typeof t?nI.error(t):nI.success(r("general:copied"))},[en,J,r,l,D]),ef=(0,c.useCallback)(e=>{let t=ah({onPaste:t=>{O(aC({dataFromClipboard:t,formState:{...D()},path:J,rowIndex:e})),L(!0)},path:J,schemaBlocks:en,t:r});"string"==typeof t&&nI.error(t)},[en,D,J,O,L,r]),ep=(0,c.useCallback)(e=>{O(aC({dataFromClipboard:e,formState:{...D()},path:J})),L(!0)},[D,J,O,L]),eh=y&&Z.length>=y,em=X.length,eg=z&&em+ +!et>0,eb=Z.length<E||w&&0===Z.length,ev=S&&0===Z.length,ey=(0,c.useMemo)(()=>oq(n),[n]);return(0,h.jsxs)("div",{className:[oK,sk,i,eg?`${sk}--has-error`:`${sk}--has-no-error`].filter(Boolean).join(" "),id:`field-${J?.replace(/\./g,"__")}`,style:ey,children:[ee&&(0,h.jsx)(r7,{CustomComponent:G,Fallback:(0,h.jsx)(aX,{path:J,showError:ee})}),(0,h.jsxs)("header",{className:`${sk}__header`,children:[(0,h.jsxs)("div",{className:`${sk}__header-wrap`,children:[(0,h.jsxs)("div",{className:`${sk}__heading-with-error`,children:[(0,h.jsx)("h3",{children:(0,h.jsx)(r7,{CustomComponent:Y,Fallback:(0,h.jsx)(iR,{as:"span",label:g,localized:v,path:J,required:w})})}),eg&&em>0&&(0,h.jsx)(aG,{count:em,i18n:t,withMessage:!0})]}),(0,h.jsxs)("ul",{className:`${sk}__header-actions`,children:[Z.length>0&&(0,h.jsxs)(c.Fragment,{children:[(0,h.jsx)("li",{children:(0,h.jsx)("button",{className:`${sk}__header-action`,onClick:()=>ec(!0),type:"button",children:r("fields:collapseAll")})}),(0,h.jsx)("li",{children:(0,h.jsx)("button",{className:`${sk}__header-action`,onClick:()=>ec(!1),type:"button",children:r("fields:showAll")})})]}),(0,h.jsx)("li",{children:(0,h.jsx)(av,{allowCopy:Z?.length>0,allowPaste:!S,blocks:en,className:`${sk}__header-action`,disabled:Q,getDataToCopy:()=>aw({formState:{...D()},path:J}),onPaste:ep,path:J,type:l})})]})]}),(0,h.jsx)(r7,{CustomComponent:W,Fallback:(0,h.jsx)(aQ,{description:o,path:J})})]}),K,(0,h.jsx)(o0,{fieldValue:er,localized:v,path:J,readOnly:S}),(Z.length>0||!et&&(ev||eb))&&(0,h.jsxs)(aK,{className:`${sk}__rows`,ids:Z.map(e=>e.id),onDragEnd:({moveFromIndex:e,moveToIndex:t})=>es(e,t),children:[Z.map((e,t)=>{let{blockType:r,isLoading:n}=e,a=F.blocksMap[r]??en.find(e=>e.slug===r);if(a){let r=`${J}.${t}`,l=X.filter(e=>e.startsWith(r+".")).length;return(0,h.jsx)(aq,{disabled:S||Q||!s,id:e.id,children:i=>(0,h.jsx)(s_,{...i,addRow:el,block:a,blocks:en,copyRow:ed,duplicateRow:ei,errorCount:l,fields:a.fields,hasMaxRows:eh,isLoading:n,isSortable:s,Label:Z?.[t]?.customComponents?.RowLabel,labels:U,moveRow:es,parentPath:J,pasteRow:ef,path:r,permissions:j,readOnly:S||Q,removeRow:eo,row:e,rowCount:Z.length,rowIndex:t,schemaPath:k+a.slug,setCollapse:eu})},e.id)}return null}),!V&&(0,h.jsxs)(c.default.Fragment,{children:[eb&&(0,h.jsx)(nJ,{type:"error",children:r("validation:requiresAtLeast",{count:E,label:m(E>1?U.plural:U.singular,t)||r(E>1?"general:row":"general:rows")})}),ev&&(0,h.jsx)(nJ,{children:r("validation:fieldHasNo",{label:m(U.plural,t)})})]})]}),!eh&&(0,h.jsxs)(c.Fragment,{children:[(0,h.jsx)(id,{className:`${sk}__drawer-toggler`,disabled:S||Q,slug:B,children:(0,h.jsx)(au,{buttonStyle:"icon-label",disabled:S||Q,el:"span",icon:"plus",iconPosition:"left",iconStyle:"with-border",children:r("fields:addLabel",{label:m(U.singular,t)})})}),(0,h.jsx)(sw,{addRow:el,addRowIndex:Z?.length||0,blocks:ea,drawerSlug:B,labels:U})]}),q]})}),sN=(0,c.lazy)(()=>e.A(967087)),sP=e=>(0,h.jsx)(c.Suspense,{fallback:(0,h.jsx)(d.f,{}),children:(0,h.jsx)(sN,{...e})}
42),sT={js:"javascript",ts:"typescript",tsx:"typescript"},sD=oH(e=>{let{field:t,field:{admin:{className:r,description:n,editorOptions:a,editorProps:l,language:i="javascript"}={},label:o,localized:s,required:u},onMount:d,path:f,readOnly:p,validate:m}=e,g=c.default.useRef("formState"),[b,v]=(0,c.useState)(Date.now()),{customComponents:{AfterInput:y,BeforeInput:x,Description:w,Error:C,Label:j}={},disabled:S,initialValue:$,path:_,setValue:k,showError:E,value:N}=oz({potentiallyStalePath:f,validate:(0,c.useCallback)((e,t)=>{if("function"==typeof m)return m(e,{...t,required:u})},[m,u])}),P=c.default.useRef((N||$)!==void 0?N??$:void 0),T=(0,c.useCallback)(e=>{if(!(p||S)){g.current="internalEditor";try{k(e||null),P.current=e}catch{k(e||null),P.current=e}}},[p,S,k]);(0,c.useEffect)(()=>{"formState"===g.current&&(P.current=(N||$)!==void 0?N??$:void 0,v(Date.now())),g.current="formState"},[$,_,N]);let D=(0,c.useMemo)(()=>oq(t),[t]);return(0,h.jsxs)("div",{className:[oK,"code-field",r,E&&"error",(p||S)&&"read-only"].filter(Boolean).join(" "),style:D,children:[(0,h.jsx)(r7,{CustomComponent:j,Fallback:(0,h.jsx)(iR,{label:o,localized:s,path:_,required:u})}),(0,h.jsxs)("div",{className:`${oK}__wrap`,children:[(0,h.jsx)(r7,{CustomComponent:C,Fallback:(0,h.jsx)(aX,{path:_,showError:E})}),x,(0,h.jsx)(sP,{defaultLanguage:sT[i]||i,onChange:T,onMount:d,options:a,readOnly:p||S,recalculatedHeightAt:b,value:P.current,wrapperProps:{id:`field-${_?.replace(/\./g,"__")}`},...l||{}}),y]}),(0,h.jsx)(r7,{CustomComponent:w,Fallback:(0,h.jsx)(aQ,{description:n,path:_})})]})}),sR=e=>e.reduce((e,t)=>{let r="fields"in t?t.fields:void 0;return r?_(t)?e.push(`${t.name}.`):e.push(...sR(r)):"tabs"===t.type?"tabs"in t&&t.tabs?.forEach(t=>{"name"in t?e.push(`${t.name}.`):e.push(...sR(t.fields))}):_(t)&&e.push(t.name),e},[]),sA=e=>{let t,r=(0,v.c)(12),{fields:n,path:a,setErrorCount:l}=e,[i]=nS(),o=nv(),s;r[0]!==n?(s=sR(n),r[0]=n,r[1]=s):s=r[1];let c=s,u;return r[2]!==i||r[3]!==o||r[4]!==a||r[5]!==c||r[6]!==l?(u=()=>{if(o){let e=0;Object.entries(i).forEach(t=>{let[r]=t;if(c?.some(e=>{let t=[...a,e].join(".");if(t.endsWith(".")){let e=t.slice(0,-1);return r.startsWith(t)||r===e}return r===t})){let t=i[r];"valid"in t&&!t.valid&&(e+=1)}}),l(e)}},r[2]=i,r[3]=o,r[4]=a,r[5]=c,r[6]=l,r[7]=u):u=r[7],r[8]!==n||r[9]!==i||r[10]!==o?(t=[i,o,n],r[8]=n,r[9]=i,r[10]=o,r[11]=t):t=r[11],iL(u,250,t),null},sO="collapsible-field",sL=oH(e=>{let{field:t,field:{admin:{className:r,description:n,initCollapsed:a=!1}={},fields:l,label:i}={},indexPath:o,parentPath:s,parentSchemaPath:u,path:d,permissions:p,readOnly:g}=e,{i18n:b}=(0,f.d)(),{getPreference:v,setPreference:y}=o_(),{preferencesKey:x}=oD(),[w,C]=(0,c.useState)(),j=`collapsible-${d?.replace(/\./g,"__")}`,[S,$]=(0,c.useState)(0),_=S>0,{customComponents:{AfterInput:k,BeforeInput:E,Description:N,Label:P}={},disabled:T}=oz({path:d}),D=(0,c.useCallback)(async e=>{let t=await v(x);x&&y(x,{...t,...d?{fields:{...t?.fields||{},[d]:{...t?.fields?.[d],collapsed:e}}}:{fields:{...t?.fields||{},[j]:{...t?.fields?.[j],collapsed:e}}}})},[x,j,v,y,d]);(0,c.useEffect)(()=>{(async()=>{if(x){let e=await v(x),t=d?e?.fields?.[d]?.collapsed:e?.fields?.[j]?.collapsed;C(void 0!==t?!!t:"boolean"==typeof a&&a)}else C("boolean"==typeof a&&a)})()},[v,x,j,a,d]);let R=(0,c.useMemo)(()=>oq(t),[t]);return"boolean"!=typeof w?null:(0,h.jsxs)(c.Fragment,{children:[(0,h.jsx)(sA,{fields:l,path:d.split(".").slice(0,-1),setErrorCount:$}),(0,h.jsxs)("div",{className:[oK,sO,r,_?`${sO}--has-error`:`${sO}--has-no-error`].filter(Boolean).join(" "),id:`field-${j}`,style:R,children:[E,(0,h.jsx)(se,{className:`${sO}__collapsible`,collapsibleStyle:_?"error":"default",header:(0,h.jsxs)("div",{className:`${sO}__row-label-wrap`,children:[(0,h.jsx)(nk,{CustomComponent:P,label:m(i,b),path:d}),_&&(0,h.jsx)(aG,{count:S,i18n:b,withMessage:!0})]}),initCollapsed:w,onToggle:D,children:(0,h.jsx)(gq,{fields:l,margins:"small",parentIndexPath:o,parentPath:s,parentSchemaPath:u,permissions:p,readOnly:g||T})}),k,(0,h.jsx)(r7,{CustomComponent:N,Fallback:(0,h.jsx)(aQ,{description:n,path:d})})]})]})}),sM=(0,c.lazy)(()=>e.A(856680)),sI=e=>(0,h.jsx)(c.Suspense,{fallback:(0,h.jsx)(d.f,{height:50}),children:(0,h.jsx)(sM,{...e})});function sF(e){return(sF="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function sB(e){var t=function(e,t){if("object"!=sF(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=sF(n))return n;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==sF(t)?t:t+""}function sz(e,t,r){return(t=sB(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function sU(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function sV(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};
42t%2?sU(Object(r),!0).forEach(function(t){sz(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):sU(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function sH(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function sq(e,t){if(e){if("string"==typeof e)return sH(e,t);var r=({}).toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?sH(e,t):void 0}}function sK(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var r=null==e?null:"u">typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,a,l,i,o=[],s=!0,c=!1;try{if(l=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;s=!1}else for(;!(s=(n=l.call(r)).done)&&(o.push(n.value),o.length!==t);s=!0);}catch(e){c=!0,a=e}finally{try{if(!s&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(c)throw a}}return o}}(e,t)||sq(e,t)||function(){throw TypeError(`Invalid attempt to destructure non-iterable instance.
43In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function sW(e,t){if(null==e)return{};var r,n,a=a3(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(n=0;n<l.length;n++)r=l[n],-1===t.indexOf(r)&&({}).propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}var sG=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function sY(e){var t=e.defaultInputValue,r=e.defaultMenuIsOpen,n=e.defaultValue,a=e.inputValue,l=e.menuIsOpen,i=e.onChange,o=e.onInputChange,s=e.onMenuClose,u=e.onMenuOpen,d=e.value,f=sW(e,sG),p=sK((0,c.useState)(void 0!==a?a:void 0===t?"":t),2),h=p[0],m=p[1],g=sK((0,c.useState)(void 0!==l?l:void 0!==r&&r),2),b=g[0],v=g[1],y=sK((0,c.useState)(void 0!==d?d:void 0===n?null:n),2),x=y[0],w=y[1],C=(0,c.useCallback)(function(e,t){"function"==typeof i&&i(e,t),w(e)},[i]),j=(0,c.useCallback)(function(e,t){var r;"function"==typeof o&&(r=o(e,t)),m(void 0!==r?r:e)},[o]),S=(0,c.useCallback)(function(){"function"==typeof u&&u(),v(!0)},[u]),$=(0,c.useCallback)(function(){"function"==typeof s&&s(),v(!1)},[s]),_=void 0!==a?a:h,k=void 0!==l?l:b,E=void 0!==d?d:x;return sV(sV({},f),{},{inputValue:_,menuIsOpen:k,onChange:C,onInputChange:j,onMenuClose:$,onMenuOpen:S,value:E})}function sQ(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,sB(n.key),n)}}function sX(e){return(sX=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function sJ(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(sJ=function(){return!!e})()}function sZ(e){return function(e){if(Array.isArray(e))return sH(e)}(e)||function(e){if("u">typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||sq(e)||function(){throw TypeError(`Invalid attempt to spread non-iterable instance.
44In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}var s0=function(){function e(e){var t=this;this._insertTag=function(e){var r;r=0===t.tags.length?t.insertionPoint?t.insertionPoint.nextSibling:t.prepend?t.container.firstChild:t.before:t.tags[t.tags.length-1].nextSibling,t.container.insertBefore(e,r),t.tags.push(e)},this.isSpeedy=void 0===e.speedy||e.speedy,this.tags=[],this.ctr=0,this.nonce=e.nonce,this.key=e.key,this.container=e.container,this.prepend=e.prepend,this.insertionPoint=e.insertionPoint,this.before=null}var t=e.prototype;return t.hydrate=function(e){e.forEach(this._insertTag)},t.insert=function(e){this.ctr%(this.isSpeedy?65e3:1)==0&&this._insertTag(((t=document.createElement("style")).setAttribute("data-emotion",this.key),void 0!==this.nonce&&t.setAttribute("nonce",this.nonce),t.appendChild(document.createTextNode("")),t.setAttribute("data-s",""),t));var t,r=this.tags[this.tags.length-1];if(this.isSpeedy){var n=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]}(r);try{n.insertRule(e,n.cssRules.length)}catch{}}else r.appendChild(document.createTextNode(e));this.ctr++}
vendor: 4,170 bytes, line 44
44,t.flush=function(){this.tags.forEach(function(e){var t;return null==(t=e.parentNode)?void 0:t.removeChild(e)}),this.tags=[],this.ctr=0},e}(),s1="-ms-",s2="-moz-",s3="-webkit-",s6="comm",s5="rule",s4="decl",s8="@keyframes",s7=Math.abs,s9=String.fromCharCode,ce=Object.assign;function ct(e,t,r){return e.replace(t,r)}function cr(e,t){return e.indexOf(t)}function cn(e,t){return 0|e.charCodeAt(t)}function ca(e,t,r){return e.slice(t,r)}function cl(e){return e.length}function ci(e,t){return t.push(e),e}var co=1,cs=1,cc=0,cu=0,cd=0,cf="";function cp(e,t,r,n,a,l,i){return{value:e,root:t,parent:r,type:n,props:a,children:l,line:co,column:cs,length:i,return:""}}function ch(e,t){return ce(cp("",null,null,"",null,null,0),e,{length:-e.length},t)}function cm(){return cd=cu<cc?cn(cf,cu++):0,cs++,10===cd&&(cs=1,co++),cd}function cg(){return cn(cf,cu)}function cb(e){switch(e){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 cv(e){return co=cs=1,cc=cl(cf=e),cu=0,[]}function cy(e){var t,r;return(t=cu-1,r=function e(t){for(;cm();)switch(cd){case t:return cu;case 34:case 39:34!==t&&39!==t&&e(cd);break;case 40:41===t&&e(t);break;case 92:cm()}return cu}(91===e?e+2:40===e?e+1:e),ca(cf,t,r)).trim()}function cx(e,t,r,n,a,l,i,o,s,c,u){for(var d=a-1,f=0===a?l:[""],p=f.length,h=0,m=0,g=0;h<n;++h)for(var b=0,v=ca(e,d+1,d=s7(m=i[h])),y=e;b<p;++b)(y=(m>0?f[b]+" "+v:ct(v,/&\f/g,f[b])).trim())&&(s[g++]=y);return cp(e,t,r,0===a?s5:o,s,c,u)}function cw(e,t,r,n){return cp(e,t,r,s4,ca(e,0,n),ca(e,n+1,-1),n)}function cC(e,t){for(var r="",n=e.length,a=0;a<n;a++)r+=t(e[a],a,e,t)||"";return r}function cj(e,t,r,n){switch(e.type){case"@layer":if(e.children.length)break;case"@import":case s4:return e.return=e.return||e.value;case s6:return"";case s8:return e.return=e.value+"{"+cC(e.children,n)+"}";case s5:e.value=e.props.join(",")}return cl(r=cC(e.children,n))?e.return=e.value+"{"+r+"}":""}var cS=function(e,t,r){for(var n=0,a=0;n=a,a=cg(),38===n&&12===a&&(t[r]=1),!cb(a);)cm();return ca(cf,e,cu)},c$=function(e,t){var r=-1,n=44;do switch(cb(n)){case 0:38===n&&12===cg()&&(t[r]=1),e[r]+=cS(cu-1,t,r);break;case 2:e[r]+=cy(n);break;case 4:if(44===n){e[++r]=58===cg()?"&\f":"",t[r]=e[r].length;break}default:e[r]+=s9(n)}while(n=cm())return e},c_=function(e,t){var r;return r=c$(cv(e),t),cf="",r},ck=new WeakMap,cE=function(e){if(!("rule"!==e.type||!e.parent||e.length<1)){for(var t=e.value,r=e.parent,n=e.column===r.column&&e.line===r.line;"rule"!==r.type;)if(!(r=r.parent))return;if(!(1===e.props.length&&58!==t.charCodeAt(0)&&!ck.get(r))&&!n){ck.set(e,!0);for(var a=[],l=c_(t,a),i=r.props,o=0,s=0;o<l.length;o++)for(var c=0;c<i.length;c++,s++)e.props[s]=a[o]?l[o].replace(/&\f/g,i[c]):i[c]+" "+l[o]}}},cN=function(e){if("decl"===e.type){var t=e.value;108===t.charCodeAt(0)&&98===t.charCodeAt(2)&&(e.return="",e.value="")}},cP=[function(e,t,r,n){if(e.length>-1&&!e.return)switch(e.type){case s4:e.return=function e(t,r){switch(45^cn(t,0)?(((r<<2^cn(t,0))<<2^cn(t,1))<<2^cn(t,2))<<2^cn(t,3):0){case 5103:return s3+"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 s3+t+t;case 5349:case 4246:case 4810:case 6968:case 2756:return s3+t+s2+t+s1+t+t;case 6828:case 4268:return s3+t+s1+t+t;case 6165:return s3+t+s1+"flex-"+t+t;case 5187:return s3+t+ct(t,/(\w+).+(:[^]+)/,s3+"box-$1$2"+s1+"flex-$1$2")+t;case 5443:return s3+t+s1+"flex-item-"+ct(t,/flex-|-self/,"")+t;case 4675:return s3+t+s1+"flex-line-pack"+ct(t,/align-content|flex-|-self/,"")+t;case 5548:return s3+t+s1+ct(t,"shrink","negative")+t;case 5292:return s3+t+s1+ct(t,"basis","preferred-size")+t;case 6060:return s3+"box-"+ct(t,"-grow","")+s3+t+s1+ct(t,"grow","positive")+t;case 4554:return s3+ct(t,/([^-])(transform)/g,"$1"+s3+"$2")+t;case 6187:return ct(ct(ct(t,/(zoom-|grab)/,s3+"$1"),/(image-set)/,s3+"$1"),t,"")+t;
vendor: 9,395 bytes, line 44
44case 5495:case 3959:return ct(t,/(image-set\([^]*)/,s3+"$1$`$1");case 4968:return ct(ct(t,/(.+:)(flex-)?(.*)/,s3+"box-pack:$3"+s1+"flex-pack:$3"),/s.+-b[^;]+/,"justify")+s3+t+t;case 4095:case 3583:case 4068:case 2532:return ct(t,/(.+)-inline(.+)/,s3+"$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(cl(t)-1-r>6)switch(cn(t,r+1)){case 109:if(45!==cn(t,r+4))break;case 102:return ct(t,/(.+:)(.+)-([^]+)/,"$1"+s3+"$2-$3$1"+s2+(108==cn(t,r+3)?"$3":"$2-$3"))+t;case 115:return~cr(t,"stretch")?e(ct(t,"stretch","fill-available"),r)+t:t}break;case 4949:if(115!==cn(t,r+1))break;case 6444:switch(cn(t,cl(t)-3-(~cr(t,"!important")&&10))){case 107:return ct(t,":",":"+s3)+t;case 101:return ct(t,/(.+:)([^;!]+)(;|!.+)?/,"$1"+s3+(45===cn(t,14)?"inline-":"")+"box$3$1"+s3+"$2$3$1"+s1+"$2box$3")+t}break;case 5936:switch(cn(t,r+11)){case 114:return s3+t+s1+ct(t,/[svh]\w+-[tblr]{2}/,"tb")+t;case 108:return s3+t+s1+ct(t,/[svh]\w+-[tblr]{2}/,"tb-rl")+t;case 45:return s3+t+s1+ct(t,/[svh]\w+-[tblr]{2}/,"lr")+t}return s3+t+s1+t+t}return t}(e.value,e.length);break;case s8:return cC([ch(e,{value:ct(e.value,"@","@"+s3)})],n);case s5:if(e.length){var a,l;return a=e.props,l=function(t){var r;switch(r=t,(r=/(::plac\w+|:read-\w+)/.exec(r))?r[0]:r){case":read-only":case":read-write":return cC([ch(e,{props:[ct(t,/:(read-\w+)/,":"+s2+"$1")]})],n);case"::placeholder":return cC([ch(e,{props:[ct(t,/:(plac\w+)/,":"+s3+"input-$1")]}),ch(e,{props:[ct(t,/:(plac\w+)/,":"+s2+"$1")]}),ch(e,{props:[ct(t,/:(plac\w+)/,s1+"input-$1")]})],n)}return""},a.map(l).join("")}}}],cT=function(e,t,r){var n=e.key+"-"+t.name;!1===r&&void 0===e.registered[n]&&(e.registered[n]=t.styles)},cD=function(e,t,r){cT(e,t,r);var n=e.key+"-"+t.name;if(void 0===e.inserted[t.name]){var a=t;do e.insert(t===a?"."+n:"",a,e.sheet,!0),a=a.next;while(void 0!==a)}},cR={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},cA=/[A-Z]|^ms/g,cO=/_EMO_([^_]+?)_([^]*?)_EMO_/g,cL=function(e){return 45===e.charCodeAt(1)},cM=function(e){return null!=e&&"boolean"!=typeof e},cI=(cz=function(e){return cL(e)?e:e.replace(cA,"-$&").toLowerCase()},cU=Object.create(null),function(e){return void 0===cU[e]&&(cU[e]=cz(e)),cU[e]}),cF=function(e,t){switch(e){case"animation":case"animationName":if("string"==typeof t)return t.replace(cO,function(e,t,r){return cV={name:t,styles:r,next:cV},t})}return 1===cR[e]||cL(e)||"number"!=typeof t||0===t?t:t+"px"};function cB(e,t,r){if(null==r)return"";if(void 0!==r.__emotion_styles)return r;switch(typeof r){case"boolean":return"";case"object":if(1===r.anim)return cV={name:r.name,styles:r.styles,next:cV},r.name;if(void 0!==r.styles){var n=r.next;if(void 0!==n)for(;void 0!==n;)cV={name:n.name,styles:n.styles,next:cV},n=n.next;return r.styles+";"}return function(e,t,r){var n="";if(Array.isArray(r))for(var a=0;a<r.length;a++)n+=cB(e,t,r[a])+";";else for(var l in r){var i=r[l];if("object"!=typeof i)null!=t&&void 0!==t[i]?n+=l+"{"+t[i]+"}":cM(i)&&(n+=cI(l)+":"+cF(l,i)+";");else if(Array.isArray(i)&&"string"==typeof i[0]&&(null==t||void 0===t[i[0]]))for(var o=0;o<i.length;o++)cM(i[o])&&(n+=cI(l)+":"+cF(l,i[o])+";");else{var s=cB(e,t,i);switch(l){case"animation":case"animationName":n+=cI(l)+":"+s+";";break;default:n+=l+"{"+s+"}"}}}return n}(e,t,r);case"function":if(void 0!==e){var a=cV,l=r(e);return cV=a,cB(e,t,l)}}if(null==t)return r;var i=t[r];return void 0!==i?i:r}var cz,cU,cV,cH=/label:\s*([^\s;{]+)\s*(;|$)/g;function cq(e,t,r){if(1===e.length&&"object"==typeof e[0]&&null!==e[0]&&void 0!==e[0].styles)return e[0];var n=!0,a="";cV=void 0;var l=e[0];null==l||void 0===l.raw?(n=!1,a+=cB(r,t,l)):a+=l[0];for(var i=1;i<e.length;i++)a+=cB(r,t,e[i]),n&&(a+=l[i]);cH.lastIndex=0;for(var o,s="";null!==(o=cH.exec(a));)s+="-"+o[1];return{name:function(e){for(var t,r=0,n=0,a=e.length;a>=4;++n,a-=4)t=(65535&(t=255&e.charCodeAt(n)|(255&e.charCodeAt(++n))<<8|(255&e.charCodeAt(++n))<<16|(255&e.charCodeAt(++n))<<24))*0x5bd1e995+((t>>>16)*59797<<16),t^=t>>>24,r=(65535&t)*0x5bd1e995+((t>>>16)*59797<<16)^(65535&r)*0x5bd1e995+((r>>>16)*59797<<16);switch(a){case 3:r^=(255&e.charCodeAt(n+2))<<16;case 2:r^=(255&e.charCodeAt(n+1))<<8;case 1:r^=255&e.charCodeAt(n),r=(65535&r)*0x5bd1e995+((r>>>16)*59797<<16)}return r^=r>>>13,(((r=(65535&r)*0x5bd1e995+((r>>>16)*59797<<16))^r>>>15)>>>0).toString(36)}(a)+s,styles:a,next:cV}}var cK=!!c.useInsertionEffect&&c.useInsertionEffect||function(e){return e()},cW=c.createContext("u">typeof HTMLElement?function(e){var t=e.key;if("css"===t){var r=document.querySelectorAll("style[data-emotion]:not([data-s])");Array.prototype.forEach.call(r,function(e){-1!==e.getAttribute("data-emotion").indexOf(" ")&&(document.head.appendChild(e),e.setAttribute("data-s",""))})}var n,a=e.stylisPlugins||cP,l={},i=[];n=e.container||document.head,Array.prototype.forEach.call(document.querySelectorAll('style[data-emotion^="'+t+' "]'),function(e){for(var t=e.getAttribute("data-emotion").split(" "),r=1;r<t.length;r++)l[t[r]]=!0;i.push(e)});var o,s,c,u,d=(s=(o=[cE,cN].concat(a,[cj,(c=function(e){u.insert(e)},function(e){e.root||(e=e.return)&&c(e)})])).length,function(e,t,r,n){for(var a="",l=0;l<s;l++)a+=o[l](e,t,r,n)||"";return a}),f=function(e){var t,r;return cC((r=function e(t,r,n,a,l,i,o,s,c){for(var u,d=0,f=0,p=o,h=0,m=0,g=0,b=1,v=1,y=1,x=0,w="",C=l,j=i,S=a,$=w;v;)switch(g=x,x=cm()){case 40:if(108!=g&&58==cn($,p-1)){-1!=cr($+=ct(cy(x),"&","&\f"),"&\f")&&(y=-1);break}case 34:case 39:case 91:$+=cy(x);break;case 9:case 10:case 13:case 32:$+=function(e){for(;(cd=cg())&&cd<33;)cm();return cb(e)>2||cb(cd)>3?"":" "}(g);break;case 92:$+=function(e,t){for(var r;--t&&cm()&&!(cd<48||cd>102||cd>57&&cd<65||cd>70&&cd<97););return r=cu+(t<6&&32==cg()&&32==cm()),ca(cf,e,r)}(cu-1,7);continue;case 47:switch(cg()){case 42:case 47:ci((u=function(e,t){for(;cm()&&e+cd!==57&&(e+cd!==84||47!==cg()););return"/*"+ca(cf,t,cu-1)+"*"+s9(47===e?e:cm())}(cm(),cu),cp(u,r,n,s6,s9(cd),ca(u,2,-2),0)),c);break;default:$+="/"}break;case 123*b:s[d++]=cl($)*y;case 125*b:case 59:case 0:switch(x){case 0:case 125:v=0;case 59+f:-1==y&&($=ct($,/\f/g,"")),m>0&&cl($)-p&&ci(m>32?cw($+";",a,n,p-1):cw(ct($," ","")+";",a,n,p-2),c);break;case 59:$+=";";default:if(ci(S=cx($,r,n,d,f,l,s,w,C=[],j=[],p),i),123===x)if(0===f)e($,r,S,S,C,i,p,s,j);else switch(99===h&&110===cn($,3)?100:h){case 100:case 108:case 109:case 115:e(t,S,S,a&&ci(cx(t,S,S,0,0,l,s,w,l,C=[],p),j),l,j,p,s,a?C:j);break;default:e($,S,S,S,[""],j,0,s,j)}}d=f=m=0,b=y=1,w=$="",p=o;break;case 58:p=1+cl($),m=g;default:if(b<1){if(123==x)--b;else if(125==x&&0==b++&&125==(cd=cu>0?cn(cf,--cu):0,cs--,10===cd&&(cs=1,co--),cd))continue}switch($+=s9(x),x*b){case 38:y=f>0?1:($+="\f",-1);break;case 44:s[d++]=(cl($)-1)*y,y=1;break;case 64:45===cg()&&($+=cy(cm())),h=cg(),f=p=cl(w=$+=function(e){for(;!cb(cg());)cm();return ca(cf,e,cu)}(cu)),x++;break;case 45:45===g&&2==cl($)&&(b=0)}}return i}("",null,null,null,[""],t=cv(t=e),0,[0],t),cf="",r),d)},p={key:t,sheet:new s0({key:t,container:n,nonce:e.nonce,speedy:e.speedy,prepend:e.prepend,insertionPoint:e.insertionPoint}),nonce:e.nonce,inserted:l,registered:{},insert:function(e,t,r,n){u=r,f(e?e+"{"+t.styles+"}":t.styles),n&&(p.inserted[t.name]=!0)}};return p.sheet.hydrate(i),p}({key:"css"}):null);cW.Provider;var cG=c.createContext({}),cY={}.hasOwnProperty,cQ="__EMOTION_TYPE_PLEASE_DO_NOT_USE__",cX=function(e,t){var r={};for(var n in t)cY.call(t,n)&&(r[n]=t[n]);return r[cQ]=e,r},cJ=function(e){var t=e.cache,r=e.serialized,n=e.isStringTag;return cT(t,r,n),cK(function(){return cD(t,r,n)}),null},cZ=(uc=function(e,t,r){var n,a,l,i=e.css;"string"==typeof i&&void 0!==t.registered[i]&&(i=t.registered[i]);var o=e[cQ],s=[i],u="";"string"==typeof e.className?(n=t.registered,a=e.className,l="",a.split(" ").forEach(function(e){void 0!==n[e]?s.push(n[e]+";"):e&&(l+=e+" ")}),u=l):null!=e.className&&(u=e.className+" ");var d=cq(s,void 0,c.useContext(cG));u+=t.key+"-"+d.name;var f={};for(var p in e)cY.call(e,p)&&"css"!==p&&p!==cQ&&(f[p]=e[p]);return f.className=u,r&&(f.ref=r),c.createElement(c.Fragment,null,c.createElement(cJ,{cache:t,serialized:d,isStringTag:"string"==typeof o}),c.createElement(o,f))},(0,c.forwardRef)(function(e,t){return uc(e,(0,c.useContext)(cW),t)}));(0,p.e)(r2());var c0=function(e,t){var r=arguments;if(null==t||!cY.call(t,"css"))return c.createElement.apply(void 0,r);var n=r.length,a=Array(n);a[0]=cZ,a[1]=cX(e,t);for(var l=2;l<n;l++)a[l]=r[l];return c.createElement.apply(null,a)};function c1(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return cq(t)}uu=c0||(c0={}),ud||(ud=uu.JSX||(uu.JSX={})),(0,f.l)();var c2=c.useLayoutEffect,c3=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","
44setValue","theme"],c6=function(){};function c5(e,t){for(var r=arguments.length,n=Array(r>2?r-2:0),a=2;a<r;a++)n[a-2]=arguments[a];var l=[].concat(n);if(t&&e)for(var i in t)t.hasOwnProperty(i)&&t[i]&&l.push("".concat(i?"-"===i[0]?e+i:e+"__"+i:e));return l.filter(function(e){return e}).map(function(e){return String(e).trim()}).join(" ")}var c4=function(e){return Array.isArray(e)?e.filter(Boolean):"object"===sF(e)&&null!==e?[e]:[]},c8=function(e){return 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,sV({},sW(e,c3))},c7=function(e,t,r){var n=e.cx,a=e.getStyles,l=e.getClassNames,i=e.className;return{css:a(t,e),className:n(r??{},l(t,e),i)}};function c9(e){return[document.documentElement,document.body,window].indexOf(e)>-1}function ue(e){return c9(e)?window.pageYOffset:e.scrollTop}function ut(e,t){c9(e)?window.scrollTo(0,t):e.scrollTop=t}function ur(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:200,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:c6,a=ue(e),l=t-a,i=0;!function t(){var o;i+=10,ut(e,l*((o=(o=i)/r-1)*o*o+1)+a),i<r?window.requestAnimationFrame(t):n(e)}()}function un(e,t){var r=e.getBoundingClientRect(),n=t.getBoundingClientRect(),a=t.offsetHeight/3;n.bottom+a>r.bottom?ut(e,Math.min(t.offsetTop+t.clientHeight-e.offsetHeight+a,e.scrollHeight)):n.top-a<r.top&&ut(e,Math.max(t.offsetTop-a,0))}function ua(){try{return document.createEvent("TouchEvent"),!0}catch{return!1}}var ul=!1,ui="u">typeof window?window:{};ui.addEventListener&&ui.removeEventListener&&(ui.addEventListener("p",c6,{get passive(){return ul=!0}}),ui.removeEventListener("p",c6,!1));var uo=ul;function us(e){return null!=e}var uc,uu,ud,uf,up=function(e){for(var t=arguments.length,r=Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];return Object.entries(e).filter(function(e){var t=sK(e,1)[0];return!r.includes(t)}).reduce(function(e,t){var r=sK(t,2),n=r[0],a=r[1];return e[n]=a,e},{})},uh=["children","innerProps"],um=["children","innerProps"],ug=function(e){return"auto"===e?"bottom":e},ub=(0,c.createContext)(null),uv=function(e){var t=e.children,r=e.minMenuHeight,n=e.maxMenuHeight,a=e.menuPlacement,l=e.menuPosition,i=e.menuShouldScrollIntoView,o=e.theme,s=((0,c.useContext)(ub)||{}).setPortalPlacement,u=(0,c.useRef)(null),d=sK((0,c.useState)(n),2),f=d[0],p=d[1],h=sK((0,c.useState)(null),2),m=h[0],g=h[1],b=o.spacing.controlHeight;return c2(function(){var e=u.current;if(e){var t="fixed"===l,o=function(e){var t,r=e.maxHeight,n=e.menuEl,a=e.minHeight,l=e.placement,i=e.shouldScroll,o=e.isFixedPosition,s=e.controlHeight,c=function(e){var t=getComputedStyle(e),r="absolute"===t.position,n=/(auto|scroll)/;if("fixed"===t.position)return document.documentElement;for(var a=e;a=a.parentElement;)if(t=getComputedStyle(a),!(r&&"static"===t.position)&&n.test(t.overflow+t.overflowY+t.overflowX))return a;return document.documentElement}(n),u={placement:"bottom",maxHeight:r};if(!n||!n.offsetParent)return u;var d=c.getBoundingClientRect().height,f=n.getBoundingClientRect(),p=f.bottom,h=f.height,m=f.top,g=n.offsetParent.getBoundingClientRect().top,b=o||c9(t=c)?window.innerHeight:t.clientHeight,v=ue(c),y=parseInt(getComputedStyle(n).marginBottom,10),x=parseInt(getComputedStyle(n).marginTop,10),w=g-x,C=b-m,j=w+v,S=d-v-m,$=p-b+v+y,_=v+m-x;switch(l){case"auto":case"bottom":if(C>=h)return{placement:"bottom",maxHeight:r};if(S>=h&&!o)return i&&ur(c,$,160),{placement:"bottom",maxHeight:r};if(!o&&S>=a||o&&C>=a)return i&&ur(c,$,160),{placement:"bottom",maxHeight:o?C-y:S-y};if("auto"===l||o){var k=r,E=o?w:j;return E>=a&&(k=Math.min(E-y-s,r)),{placement:"top",maxHeight:k}}if("bottom"===l)return i&&ut(c,$),{placement:"bottom",maxHeight:r};break;case"top":if(w>=h)return{placement:"top",maxHeight:r};if(j>=h&&!o)return i&&ur(c,_,160),{placement:"top",maxHeight:r};if(!o&&j>=a||o&&w>=a){var N=r;return(!o&&j>=a||o&&w>=a)&&(N=o?w-x:j-x),i&&ur(c,_,160),{placement:"top",maxHeight:N}}return{placement:"bottom",maxHeight:r};default:throw Error('Invalid placement provided "'.concat(l,'".'))}return u}({maxHeight:n,menuEl:e,minHeight:r,placement:a,shouldScroll:i&&!t,isFixedPosition:t,controlHeight:b});p(o.maxHeight),g(o.placement),s?.(o.placement)}},[n,a,l,i,r,s,b]),t({ref:u,placerProps:sV(sV({},e),{},{placement:m||ug(a),maxHeight:f})})},uy=function(e,t){var r=e.theme,n=r.spacing.baseUnit,a=r.colors;return sV({textAlign:"center"},t?{}:{color:a.neutral40,padding:"".concat(2*n,"px ").concat(3*n,"px")}
44)},ux=["size"],uw=["innerProps","isRtl","size"],uC={name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"},uj=function(e){var t=e.size,r=sW(e,ux);return c0("svg",a2({height:t,width:t,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:uC},r))},uS=function(e){return c0(uj,a2({size:20},e),c0("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"}))},u$=function(e){return c0(uj,a2({size:20},e),c0("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"}))},u_=function(e,t){var r=e.isFocused,n=e.theme,a=n.spacing.baseUnit,l=n.colors;return sV({label:"indicatorContainer",display:"flex",transition:"color 150ms"},t?{}:{color:r?l.neutral60:l.neutral20,padding:2*a,":hover":{color:r?l.neutral80:l.neutral40}})},uk=function(){var e=c1.apply(void 0,arguments),t="animation-"+e.name;return{name:t,styles:"@keyframes "+t+"{"+e.styles+"}",anim:1,toString:function(){return"_EMO_"+this.name+"_"+this.styles+"_EMO_"}}}(uf||(uH=[`
45  0%, 80%, 100% { opacity: 0; }
46  40% { opacity: 1; }
47`],uq||(uq=uH.slice(0)),uf=Object.freeze(Object.defineProperties(uH,{raw:{value:Object.freeze(uq)}})))),uE=function(e){var t=e.delay,r=e.offset;return c0("span",{css:c1({animation:"".concat(uk," 1s ease-in-out ").concat(t,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:r?"1em":void 0,height:"1em",verticalAlign:"top",width:"1em"},"","")})},uN=["data"],uP=["innerRef","isDisabled","isHidden","inputClassName"],uT={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},uD={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":sV({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},uT)},uR=function(e){var t=e.children,r=e.innerProps;return c0("div",r,t)},uA={ClearIndicator:function(e){var t=e.children,r=e.innerProps;return c0("div",a2({},c7(e,"clearIndicator",{indicator:!0,"clear-indicator":!0}),r),t||c0(uS,null))},Control:function(e){var t=e.children,r=e.isDisabled,n=e.isFocused,a=e.innerRef,l=e.innerProps,i=e.menuIsOpen;return c0("div",a2({ref:a},c7(e,"control",{control:!0,"control--is-disabled":r,"control--is-focused":n,"control--menu-is-open":i}),l,{"aria-disabled":r||void 0}),t)},DropdownIndicator:function(e){var t=e.children,r=e.innerProps;return c0("div",a2({},c7(e,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),r),t||c0(u$,null))},DownChevron:u$,CrossIcon:uS,Group:function(e){var t=e.children,r=e.cx,n=e.getStyles,a=e.getClassNames,l=e.Heading,i=e.headingProps,o=e.innerProps,s=e.label,c=e.theme,u=e.selectProps;return c0("div",a2({},c7(e,"group",{group:!0}),o),c0(l,a2({},i,{selectProps:u,theme:c,getStyles:n,getClassNames:a,cx:r}),s),c0("div",null,t))},GroupHeading:function(e){var t=c8(e);t.data;var r=sW(t,uN);return c0("div",a2({},c7(e,"groupHeading",{"group-heading":!0}),r))},IndicatorsContainer:function(e){var t=e.children,r=e.innerProps;return c0("div",a2({},c7(e,"indicatorsContainer",{indicators:!0}),r),t)},IndicatorSeparator:function(e){var t=e.innerProps;return c0("span",a2({},t,c7(e,"indicatorSeparator",{"indicator-separator":!0})))},Input:function(e){var t=e.cx,r=e.value,n=c8(e),a=n.innerRef,l=n.isDisabled,i=n.isHidden,o=n.inputClassName,s=sW(n,uP);return c0("div",a2({},c7(e,"input",{"input-container":!0}),{"data-value":r||""}),c0("input",a2({className:t({input:!0},o),ref:a,style:sV({label:"input",color:"inherit",background:0,opacity:+!i,width:"100%"},uT),disabled:l},s)))},LoadingIndicator:function(e){var t=e.innerProps,r=e.isRtl,n=e.size,a=sW(e,uw);return c0("div",a2({}
47,c7(sV(sV({},a),{},{innerProps:t,isRtl:r,size:void 0===n?4:n}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),t),c0(uE,{delay:0,offset:r}),c0(uE,{delay:160,offset:!0}),c0(uE,{delay:320,offset:!r}))},Menu:function(e){var t=e.children,r=e.innerRef,n=e.innerProps;return c0("div",a2({},c7(e,"menu",{menu:!0}),{ref:r},n),t)},MenuList:function(e){var t=e.children,r=e.innerProps,n=e.innerRef,a=e.isMulti;return c0("div",a2({},c7(e,"menuList",{"menu-list":!0,"menu-list--is-multi":a}),{ref:n},r),t)},MenuPortal:function(e){var t=e.appendTo,r=e.children,n=e.controlElement,a=e.innerProps,l=e.menuPlacement,i=e.menuPosition,o=(0,c.useRef)(null),s=(0,c.useRef)(null),d=sK((0,c.useState)(ug(l)),2),p=d[0],h=d[1],m=(0,c.useMemo)(function(){return{setPortalPlacement:h}},[]),g=sK((0,c.useState)(null),2),b=g[0],v=g[1],y=(0,c.useCallback)(function(){if(n){var e,t={bottom:(e=n.getBoundingClientRect()).bottom,height:e.height,left:e.left,right:e.right,top:e.top,width:e.width},r="fixed"===i?0:window.pageYOffset,a=t[p]+r;(a!==b?.offset||t.left!==b?.rect.left||t.width!==b?.rect.width)&&v({offset:a,rect:t})}},[n,i,p,b?.offset,b?.rect.left,b?.rect.width]);c2(function(){y()},[y]);var x=(0,c.useCallback)(function(){"function"==typeof s.current&&(s.current(),s.current=null),n&&o.current&&(s.current=(0,f.k)(n,o.current,y,{elementResize:"ResizeObserver"in window}))},[n,y]);c2(function(){x()},[x]);var w=(0,c.useCallback)(function(e){o.current=e,x()},[x]);if(!t&&"fixed"!==i||!b)return null;var C=c0("div",a2({ref:w},c7(sV(sV({},e),{},{offset:b.offset,position:i,rect:b.rect}),"menuPortal",{"menu-portal":!0}),a),r);return c0(ub.Provider,{value:m},t?(0,u.createPortal)(C,t):C)},LoadingMessage:function(e){var t=e.children,r=void 0===t?"Loading...":t,n=e.innerProps,a=sW(e,um);return c0("div",a2({},c7(sV(sV({},a),{},{children:r,innerProps:n}),"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),n),r)},NoOptionsMessage:function(e){var t=e.children,r=void 0===t?"No options":t,n=e.innerProps,a=sW(e,uh);return c0("div",a2({},c7(sV(sV({},a),{},{children:r,innerProps:n}),"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),n),r)},MultiValue:function(e){var t=e.children,r=e.components,n=e.data,a=e.innerProps,l=e.isDisabled,i=e.removeProps,o=e.selectProps,s=r.Container,c=r.Label,u=r.Remove;return c0(s,{data:n,innerProps:sV(sV({},c7(e,"multiValue",{"multi-value":!0,"multi-value--is-disabled":l})),a),selectProps:o},c0(c,{data:n,innerProps:sV({},c7(e,"multiValueLabel",{"multi-value__label":!0})),selectProps:o},t),c0(u,{data:n,innerProps:sV(sV({},c7(e,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(t||"option")},i),selectProps:o}))},MultiValueContainer:uR,MultiValueLabel:uR,MultiValueRemove:function(e){var t=e.children,r=e.innerProps;return c0("div",a2({role:"button"},r),t||c0(uS,{size:14}))},Option:function(e){var t=e.children,r=e.isDisabled,n=e.isFocused,a=e.isSelected,l=e.innerRef,i=e.innerProps;return c0("div",a2({},c7(e,"option",{option:!0,"option--is-disabled":r,"option--is-focused":n,"option--is-selected":a}),{ref:l,"aria-disabled":r},i),t)},Placeholder:function(e){var t=e.children,r=e.innerProps;return c0("div",a2({},c7(e,"placeholder",{placeholder:!0}),r),t)},SelectContainer:function(e){var t=e.children,r=e.innerProps,n=e.isDisabled,a=e.isRtl;return c0("div",a2({},c7(e,"container",{"--is-disabled":n,"--is-rtl":a}),r),t)},SingleValue:function(e){var t=e.children,r=e.isDisabled,n=e.innerProps;return c0("div",a2({},c7(e,"singleValue",{"single-value":!0,"single-value--is-disabled":r}),n),t)},ValueContainer:function(e){var t=e.children,r=e.innerProps,n=e.isMulti,a=e.hasValue;return c0("div",a2({},c7(e,"valueContainer",{"value-container":!0,"value-container--is-multi":n,"value-container--has-value":a}),r),t)}},uO=Number.isNaN||function(e){return"number"==typeof e&&e!=e};function uL(e,t){if(e.length!==t.length)return!1;for(var r,n,a=0;a<e.length;a++)if(!((r=e[a])===(n=t[a])||uO(r)&&uO(n)))return!1;return!0}var uM={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"},uI=function(e){return c0("span",a2({css:uM},e))},uF={guidance:function(e){var t=e.isSearchable,r=e.isMulti,n=e.tabSelectsValue,a=e.context,l=e.isInitialFocus;switch(a){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(n?", press Tab to select the option and exit the menu":"",".");case"input":return l?"".concat(e["aria-label"]||"Select"," is focused ").concat(t?",type to refine list":"",", press Down to open the menu, ").concat(r?" 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 t=e.action,r=e.label,n=void 0===r?"":r,a=e.labels,l=e.isDisabled;
47switch(t){case"deselect-option":case"pop-value":case"remove-value":return"option ".concat(n,", deselected.");case"clear":return"All selected options have been cleared.";case"initial-input-focus":return"option".concat(a.length>1?"s":""," ").concat(a.join(","),", selected.");case"select-option":return l?"option ".concat(n," is disabled. Select another option."):"option ".concat(n,", selected.");default:return""}},onFocus:function(e){var t=e.context,r=e.focused,n=e.options,a=e.label,l=void 0===a?"":a,i=e.selectValue,o=e.isDisabled,s=e.isSelected,c=e.isAppleDevice,u=function(e,t){return e&&e.length?"".concat(e.indexOf(t)+1," of ").concat(e.length):""};if("value"===t&&i)return"value ".concat(l," focused, ").concat(u(i,r),".");if("menu"===t&&c){var d="".concat(s?" selected":"").concat(o?" disabled":"");return"".concat(l).concat(d,", ").concat(u(n,r),".")}return""},onFilter:function(e){var t=e.inputValue,r=e.resultsMessage;return"".concat(r).concat(t?" for search term "+t:"",".")}},uB=function(e){var t=e.ariaSelection,r=e.focusedOption,n=e.focusedValue,a=e.focusableOptions,l=e.isFocused,i=e.selectValue,o=e.selectProps,s=e.id,u=e.isAppleDevice,d=o.ariaLiveMessages,f=o.getOptionLabel,p=o.inputValue,h=o.isMulti,m=o.isOptionDisabled,g=o.isSearchable,b=o.menuIsOpen,v=o.options,y=o.screenReaderStatus,x=o.tabSelectsValue,w=o.isLoading,C=o["aria-label"],j=o["aria-live"],S=(0,c.useMemo)(function(){return sV(sV({},uF),d||{})},[d]),$=(0,c.useMemo)(function(){var e="";if(t&&S.onChange){var r=t.option,n=t.options,a=t.removedValue,l=t.removedValues,o=t.value,s=a||r||(Array.isArray(o)?null:o),c=s?f(s):"",u=n||l||void 0,d=u?u.map(f):[],p=sV({isDisabled:s&&m(s,i),label:c,labels:d},t);e=S.onChange(p)}return e},[t,S,m,i,f]),_=(0,c.useMemo)(function(){var e="",t=r||n,l=!!(r&&i&&i.includes(r));if(t&&S.onFocus){var o={focused:t,label:f(t),isDisabled:m(t,i),isSelected:l,options:a,context:t===r?"menu":"value",selectValue:i,isAppleDevice:u};e=S.onFocus(o)}return e},[r,n,f,m,S,a,i,u]),k=(0,c.useMemo)(function(){var e="";if(b&&v.length&&!w&&S.onFilter){var t=y({count:a.length});e=S.onFilter({inputValue:p,resultsMessage:t})}return e},[a,p,b,S,v,y,w]),E=t?.action==="initial-input-focus",N=(0,c.useMemo)(function(){var e="";if(S.guidance){var t=n?"value":b?"menu":"input";e=S.guidance({"aria-label":C,context:t,isDisabled:r&&m(r,i),isMulti:h,isSearchable:g,tabSelectsValue:x,isInitialFocus:E})}return e},[C,r,n,h,m,g,b,S,i,x,E]),P=c0(c.Fragment,null,c0("span",{id:"aria-selection"},$),c0("span",{id:"aria-focused"},_),c0("span",{id:"aria-results"},k),c0("span",{id:"aria-guidance"},N));return c0(c.Fragment,null,c0(uI,{id:s},E&&P),c0(uI,{"aria-live":j,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},l&&!E&&P))},uz=[{base:"A",letters:"AⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"},{base:"AA",letters:"Ꜳ"},{base:"AE",letters:"ÆǼǢ"},{base:"AO",letters:"Ꜵ"},{base:"AU",letters:"Ꜷ"},{base:"AV",letters:"ꜸꜺ"},{base:"AY",letters:"Ꜽ"},{base:"B",letters:"BⒷBḂḄḆɃƂƁ"},{base:"C",letters:"CⒸCĆĈĊČÇḈƇȻꜾ"},{base:"D",letters:"DⒹDḊĎḌḐḒḎĐƋƊƉꝹ"},{base:"DZ",letters:"DZDŽ"},{base:"Dz",letters:"DzDž"},{base:"E",letters:"EⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ"},{base:"F",letters:"FⒻFḞƑꝻ"},{base:"G",letters:"GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ"},{base:"H",letters:"HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"},{base:"I",letters:"IⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"},{base:"J",letters:"JⒿJĴɈ"},{base:"K",letters:"KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",letters:"LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",letters:"LJ"},{base:"Lj",letters:"Lj"},{base:"M",letters:"MⓂMḾṀṂⱮƜ"},{base:"N",letters:"NⓃNǸŃÑṄŇṆŅṊṈȠƝꞐꞤ"},{base:"NJ",letters:"NJ"},{base:"Nj",letters:"Nj"},{base:"O",letters:"OⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"},{base:"OI",letters:"Ƣ"},{base:"OO",letters:"Ꝏ"},{base:"OU",letters:"Ȣ"},{base:"P",letters:"PⓅPṔṖƤⱣꝐꝒꝔ"},{base:"Q",letters:"QⓆQꝖꝘɊ"}
47,{base:"R",letters:"RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"},{base:"S",letters:"SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"},{base:"T",letters:"TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"},{base:"TZ",letters:"Ꜩ"},{base:"U",letters:"UⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"},{base:"V",letters:"VⓋVṼṾƲꝞɅ"},{base:"VY",letters:"Ꝡ"},{base:"W",letters:"WⓌWẀẂŴẆẄẈⱲ"},{base:"X",letters:"XⓍXẊẌ"},{base:"Y",letters:"YⓎYỲÝŶỸȲẎŸỶỴƳɎỾ"},{base:"Z",letters:"ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"},{base:"a",letters:"aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ"},{base:"aa",letters:"ꜳ"},{base:"ae",letters:"æǽǣ"},{base:"ao",letters:"ꜵ"},{base:"au",letters:"ꜷ"},{base:"av",letters:"ꜹꜻ"},{base:"ay",letters:"ꜽ"},{base:"b",letters:"bⓑbḃḅḇƀƃɓ"},{base:"c",letters:"cⓒcćĉċčçḉƈȼꜿↄ"},{base:"d",letters:"dⓓdḋďḍḑḓḏđƌɖɗꝺ"},{base:"dz",letters:"dzdž"},{base:"e",letters:"eⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ"},{base:"f",letters:"fⓕfḟƒꝼ"},{base:"g",letters:"gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ"},{base:"h",letters:"hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"},{base:"hv",letters:"ƕ"},{base:"i",letters:"iⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı"},{base:"j",letters:"jⓙjĵǰɉ"},{base:"k",letters:"kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"},{base:"l",letters:"lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"},{base:"lj",letters:"lj"},{base:"m",letters:"mⓜmḿṁṃɱɯ"},{base:"n",letters:"nⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ"},{base:"nj",letters:"nj"},{base:"o",letters:"oⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ"},{base:"oi",letters:"ƣ"},{base:"ou",letters:"ȣ"},{base:"oo",letters:"ꝏ"},{base:"p",letters:"pⓟpṕṗƥᵽꝑꝓꝕ"},{base:"q",letters:"qⓠqɋꝗꝙ"},{base:"r",letters:"rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"},{base:"s",letters:"sⓢsßśṥŝṡšṧṣṩșşȿꞩꞅẛ"},{base:"t",letters:"tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"},{base:"tz",letters:"ꜩ"},{base:"u",letters:"uⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"},{base:"v",letters:"vⓥvṽṿʋꝟʌ"},{base:"vy",letters:"ꝡ"},{base:"w",letters:"wⓦwẁẃŵẇẅẘẉⱳ"},{base:"x",letters:"xⓧxẋẍ"},{base:"y",letters:"yⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ"},{base:"z",letters:"zⓩzźẑżžẓẕƶȥɀⱬꝣ"}],uU=RegExp("["+uz.map(function(e){return e.letters}).join("")+"]","g"),uV={};for(uG=0;uG<uz.length;uG++)for(uK=uz[uG],uW=0;uW<uK.letters.length;uW++)uV[uK.letters[uW]]=uK.base;var uH,uq,uK,uW,uG,uY=function(e){return e.replace(uU,function(e){return uV[e]})},uQ=function(e,t){void 0===t&&(t=uL);var r=null;function n(){for(var n=[],a=0;a<arguments.length;a++)n[a]=arguments[a];if(r&&r.lastThis===this&&t(n,r.lastArgs))return r.lastResult;var l=e.apply(this,n);return r={lastResult:l,lastArgs:n,lastThis:this},l}return n.clear=function(){r=null},n}(uY),uX=function(e){return e.replace(/^\s+|\s+$/g,"")},uJ=function(e){return"".concat(e.label," ").concat(e.value)},uZ=["innerRef"];function u0(e){var t=e.innerRef,r=up(sW(e,uZ),"onExited","in","enter","exit","appear");return c0("input",a2({ref:t},r,{css:c1({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 u1=function(e){e.cancelable&&e.preventDefault(),e.stopPropagation()},u2=["boxSizing","height","overflow","paddingRight","position"],u3={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function u6(e){e.cancelable&&e.preventDefault()}function u5(e){e.stopPropagation()}function u4(){var e=this.scrollTop,t=this.scrollHeight,r=e+this.offsetHeight;0===e?this.scrollTop=1:r===t&&(this.scrollTop=e-1)}function u8(){return"ontouchstart"in window||navigator.maxTouchPoints}var u7=!!("u">typeof window&&window.document&&window.document.createElement),u9=0,de={capture:!1,passive:!1},dt=function(e){var t=e.target;return t.ownerDocument.activeElement&&t.ownerDocument.activeElement.blur()},dr={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function dn(e){var t,r,n,a,l,i,o,s,u,d,f,p,h,m,g,b,v,y,x,w,C,j,S,$,_=e.children,k=e.lockEnabled,E=e.captureEnabled,N=(r=(t={isEnabled:void 0===E||E,onBottomArrive:e.onBottomArrive,onBottomLeave:e.onBottomLeave,onTopArrive:e.onTopArrive,onTopLeave:e.onTopLeave}).isEnabled,n=t.onBottomArrive,a=t.onBottomLeave,l=t.onTopArrive,i=t.onTopLeave,o=(0,c.useRef)(!1),s=(0,c.useRef)(!1),u=(0,c.useRef)(0),d=(0,c.useRef)(null),f=(0,c.useCallback)(function(e,t){if(null!==d.current){var r=d.current,c=r.scrollTop,u=r.scrollHeight,f=r.clientHeight,p=d.current,h=t>0,m=u-f-c,g=!1;m>t&&o.current&&(a&&a(e),o.current=!1),h&&s.current&&(i&&i(e),s.current=!1),h&&t>m?(n&&!o.current&&n(e),p.scrollTop=u,g=!0,o.current=!0):!h&&-t>c&&(l&&!s.current&&l(e),p.scrollTop=0,g=!0,s.current=!0),g&&u1(e)}},[n,a,l,i]),p=(0,c.useCallback)(function(e){f(e,e.deltaY)},[f]),h=(0,c.useCallback)(function(e){u.current=e.changedTouches[0].clientY},[]),m=(0,c.useCallback)(function(e){var t=u.current-e.changedTouches[0].clientY;f(e,t)},[f]),g=(0,c.useCallback)(function(e){if(e){var t=!!uo&&{passive:!1};e.addEventListener("wheel",p,t),e.addEventListener("touchstart",h,t),e.addEventListener("touchmove",m,t)}},[m,h,p]),b=(0,c.useCallback)(function(e){e&&(e.removeEventListener("wheel",p,!1),e.removeEventListener("touchstart",h,!1),e.removeEventListener("touchmove",m,!1))},[m,h,p]),(0,c.useEffect)(function(){if(r){var e=d.current;return g(e),function(){b(e)}}},[r,g,b]),function(e){d.current=e}),P=(y=(v={isEnabled:k}).isEnabled,w=void 0===(x=v.accountForScrollbars)||x,C=(0,c.useRef)({}),j=(0,c.useRef)(null),S=(0,c.useCallback)(function(e){if(u7){var t=document.body,r=t&&t.style;if(w&&u2.forEach(function(e){var t=r&&r[e];C.current[e]=t}),w&&u9<1){var n=parseInt(C.current.paddingRight,10)||0,a=document.body?document.body.clientWidth:0,l=window.innerWidth-a+n||0;Object.keys(u3).forEach(function(e){var t=u3[e];r&&(r[e]=t)}),r&&(r.paddingRight="".concat(l,"px"))}t&&u8()&&(t.addEventListener("touchmove",u6,de),e&&(e.addEventListener("touchstart",u4,de),e.addEventListener("touchmove",u5,de))),u9+=1}},[w]),$=(0,c.useCallback)(function(e){if(u7){var t=document.body,r=t&&t.style;u9=Math.max(u9-1,0),w&&u9<1&&u2.forEach(function(e){var t=C.current[e];r&&(r[e]=t)}),t&&u8()&&(t.removeEventListener("touchmove",u6,de),e&&(e.removeEventListener("touchstart",u4,de),e.removeEventListener("touchmove",u5,de)))}},[w]),(0,c.useEffect)(function(){if(y){var e=j.current;return S(e),function(){$(e)}}},[y,S,$]),function(e){j.current=e});return c0(c.Fragment,null,k&&c0("div",{onClick:dt,css:dr}),_(function(e){N(e),P(e)}))}var da={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;
47opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},dl=function(e){var t=e.name,r=e.onFocus;return c0("input",{required:!0,name:t,tabIndex:-1,"aria-hidden":"true",onFocus:r,css:da,value:"",onChange:function(){}})};function di(e){var t;return"u">typeof window&&null!=window.navigator&&e.test((null==(t=window.navigator.userAgentData)?void 0:t.platform)||window.navigator.platform)}var ds=function(e){return e.label},dc=function(e){return e.value},du={clearIndicator:u_,container:function(e){var t=e.isDisabled;return{label:"container",direction:e.isRtl?"rtl":void 0,pointerEvents:t?"none":void 0,position:"relative"}},control:function(e,t){var r=e.isDisabled,n=e.isFocused,a=e.theme,l=a.colors,i=a.borderRadius;return sV({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:a.spacing.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},t?{}:{backgroundColor:r?l.neutral5:l.neutral0,borderColor:r?l.neutral10:n?l.primary:l.neutral20,borderRadius:i,borderStyle:"solid",borderWidth:1,boxShadow:n?"0 0 0 1px ".concat(l.primary):void 0,"&:hover":{borderColor:n?l.primary:l.neutral30}})},dropdownIndicator:u_,group:function(e,t){var r=e.theme.spacing;return t?{}:{paddingBottom:2*r.baseUnit,paddingTop:2*r.baseUnit}},groupHeading:function(e,t){var r=e.theme,n=r.colors,a=r.spacing;return sV({label:"group",cursor:"default",display:"block"},t?{}:{color:n.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:3*a.baseUnit,paddingRight:3*a.baseUnit,textTransform:"uppercase"})},indicatorsContainer:function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},indicatorSeparator:function(e,t){var r=e.isDisabled,n=e.theme,a=n.spacing.baseUnit,l=n.colors;return sV({label:"indicatorSeparator",alignSelf:"stretch",width:1},t?{}:{backgroundColor:r?l.neutral10:l.neutral20,marginBottom:2*a,marginTop:2*a})},input:function(e,t){var r=e.isDisabled,n=e.value,a=e.theme,l=a.spacing,i=a.colors;return sV(sV({visibility:r?"hidden":"visible",transform:n?"translateZ(0)":""},uD),t?{}:{margin:l.baseUnit/2,paddingBottom:l.baseUnit/2,paddingTop:l.baseUnit/2,color:i.neutral80})},loadingIndicator:function(e,t){var r=e.isFocused,n=e.size,a=e.theme,l=a.colors,i=a.spacing.baseUnit;return sV({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:n,lineHeight:1,marginRight:n,textAlign:"center",verticalAlign:"middle"},t?{}:{color:r?l.neutral60:l.neutral20,padding:2*i})},loadingMessage:uy,menu:function(e,t){var r,n=e.placement,a=e.theme,l=a.borderRadius,i=a.spacing,o=a.colors;return sV((sz(r={label:"menu"},n?({bottom:"top",top:"bottom"})[n]:"bottom","100%"),sz(r,"position","absolute"),sz(r,"width","100%"),sz(r,"zIndex",1),r),t?{}:{backgroundColor:o.neutral0,borderRadius:l,boxShadow:"0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)",marginBottom:i.menuGutter,marginTop:i.menuGutter})},menuList:function(e,t){var r=e.maxHeight,n=e.theme.spacing.baseUnit;return sV({maxHeight:r,overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},t?{}:{paddingBottom:n,paddingTop:n})},menuPortal:function(e){var t=e.rect,r=e.offset,n=e.position;return{left:t.left,position:n,top:r,width:t.width,zIndex:1}},multiValue:function(e,t){var r=e.theme,n=r.spacing,a=r.borderRadius,l=r.colors;return sV({label:"multiValue",display:"flex",minWidth:0},t?{}:{backgroundColor:l.neutral10,borderRadius:a/2,margin:n.baseUnit/2})},multiValueLabel:function(e,t){var r=e.theme,n=r.borderRadius,a=r.colors,l=e.cropWithEllipsis;return sV({overflow:"hidden",textOverflow:l||void 0===l?"ellipsis":void 0,whiteSpace:"nowrap"},t?{}:{borderRadius:n/2,color:a.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},multiValueRemove:function(e,t){var r=e.theme,n=r.spacing,a=r.borderRadius,l=r.colors,i=e.isFocused;return sV({alignItems:"center",display:"flex"},t?{}:{borderRadius:a/2,backgroundColor:i?l.dangerLight:void 0,paddingLeft:n.baseUnit,paddingRight:n.baseUnit,":hover":{backgroundColor:l.dangerLight,color:l.danger}})},noOptionsMessage:uy,option:function(e,t){var r=e.isDisabled,n=e.isFocused,a=e.isSelected,l=e.theme,i=l.spacing,o=l.colors;return sV({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},t?{}:{backgroundColor:a?o.primary:n?o.primary25:"transparent",color:r?o.neutral20:a?o.neutral0:"inherit",padding:"".concat(2*i.baseUnit,"px ").concat(3*i.baseUnit,"px"),":active":{backgroundColor:r?void 0:a?o.primary:o.primary50}})},placeholder:function(e,t){var r=e.theme,n=r.spacing,a=r.colors;return sV({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},t?{}:{color:a.neutral50,marginLeft:n.baseUnit/2,marginRight:n.baseUnit/2})},singleValue:function(e,t){var r=e.isDisabled,n=e.theme,a=n.spacing,l=n.colors;return sV({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},t?{}:{color:r?l.neutral40:l.neutral80,marginLeft:a.baseUnit/2,marginRight:a.baseUnit/2})},valueContainer:function(e,t){var r=e.theme.spacing,n=e.isMulti,a=e.hasValue,l=e.selectProps.controlShouldRenderValue;return sV({alignItems:"center",display:n&&a&&l?"flex":"grid",flex:1,flexWrap:"wrap",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"},t?{}:{padding:"".concat(r.baseUnit/2,"px ").concat(2*r.baseUnit,"px")})}},dd={borderRadius:4,colors:{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%)"},spacing:{baseUnit:4,controlHeight:38,menuGutter:8}},df={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:ua(),captureMenuScroll:!ua(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:function(e,t){if(e.data.__isNew__)return!0;var r=sV({ignoreCase:!0,ignoreAccents:!0,stringify:uJ,trim:!0,matchFrom:"any"},void 0),n=r.ignoreCase,a=r.ignoreAccents,l=r.stringify,i=r.trim,o=r.matchFrom,s=i?uX(t):t,c=i?uX(l(e)):l(e);return n&&(s=s.toLowerCase(),c=c.toLowerCase()),a&&(s=uQ(s),c=uY(c)),"start"===o?c.substr(0,s.length)===s:c.indexOf(s)>-1},formatGroupLabel:function(e){return e.label},getOptionLabel:ds,getOptionValue:dc,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:function(e){return!!e.isDisabled},loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!function(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch{return!1}}(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(e){var t=e.count;return"".concat(t," result").concat(1!==t?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0,unstyled:!1};function dp(e,t,r,n){var a=dw(e,t,r),l=dC(e,t,r),i=dy(e,t),o=dx(e,t);return{type:"option",data:t,isDisabled:a,isSelected:l,label:i,value:o,index:n}}function dh(e,t){return e.options.map(function(r,n){if("options"in r){var a=r.options.map(function(r,n){return dp(e,r,t,n)}).filter(function(t){return db(e,t)});return a.length>0?{type:"group",data:r,options:a,index:n}:void 0}var l=dp(e,r,t,n);return db(e,l)?l:void 0}).filter(us)}function dm(e){return e.reduce(function(e,t){return"group"===t.type?e.push.apply(e,sZ(t.options.map(function(e){return e.data}))):e.push(t.data),e},[])}function dg(e,t){return e.reduce(function(e,r){return"group"===r.type?e.push.apply(e,sZ(r.options.map(function(e){return{data:e.data,id:"".concat(t,"-").concat(r.index,"-").concat(e.index)}}))):e.push({data:r.data,id:"".concat(t,"-").concat(r.index)}),e},[])}function db(e,t){var r=e.inputValue,n=t.data,a=t.isSelected,l=t.label,i=t.value;return(!dS(e)||!a)&&dj(e,{label:l,value:i,data:n},void 0===r?"":r)}var dv=function(e,t){var r;return(null==(r=e.find(function(e){return e.data===t}))?void 0:r.id)||null},dy=function(e,t){return e.getOptionLabel(t)}
47,dx=function(e,t){return e.getOptionValue(t)};function dw(e,t,r){return"function"==typeof e.isOptionDisabled&&e.isOptionDisabled(t,r)}function dC(e,t,r){if(r.indexOf(t)>-1)return!0;if("function"==typeof e.isOptionSelected)return e.isOptionSelected(t,r);var n=dx(e,t);return r.some(function(t){return dx(e,t)===n})}function dj(e,t,r){return!e.filterOption||e.filterOption(t,r)}var dS=function(e){var t=e.hideSelectedOptions,r=e.isMulti;return void 0===t?r:t},d$=1,d_=function(e){if("function"!=typeof e&&null!==e)throw TypeError("Super expression must either be null or a function");l.prototype=Object.create(e&&e.prototype,{constructor:{value:l,writable:!0,configurable:!0}}),Object.defineProperty(l,"prototype",{writable:!1}),e&&a6(l,e);var t,r,n,a=(t=sJ(),function(){var e,r=sX(l);e=t?Reflect.construct(r,arguments,sX(this).constructor):r.apply(this,arguments);if(e&&("object"==sF(e)||"function"==typeof e))return e;if(void 0!==e)throw TypeError("Derived constructors may only return object or undefined");if(void 0===this)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return this});function l(e){var t;if(function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")}(this,l),(t=a.call(this,e)).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:""},t.blockOptionHover=!1,t.isComposing=!1,t.commonProps=void 0,t.initialTouchX=0,t.initialTouchY=0,t.openAfterFocus=!1,t.scrollToFocusedOptionOnUpdate=!1,t.userIsDragging=void 0,t.isAppleDevice=di(/^Mac/i)||di(/^iPhone/i)||di(/^iPad/i)||di(/^Mac/i)&&navigator.maxTouchPoints>1,t.controlRef=null,t.getControlRef=function(e){t.controlRef=e},t.focusedOptionRef=null,t.getFocusedOptionRef=function(e){t.focusedOptionRef=e},t.menuListRef=null,t.getMenuListRef=function(e){t.menuListRef=e},t.inputRef=null,t.getInputRef=function(e){t.inputRef=e},t.focus=t.focusInput,t.blur=t.blurInput,t.onChange=function(e,r){var n=t.props,a=n.onChange;r.name=n.name,t.ariaOnChange(e,r),a(e,r)},t.setValue=function(e,r,n){var a=t.props,l=a.closeMenuOnSelect,i=a.isMulti,o=a.inputValue;t.onInputChange("",{action:"set-value",prevInputValue:o}),l&&(t.setState({inputIsHiddenAfterUpdate:!i}),t.onMenuClose()),t.setState({clearFocusValueOnUpdate:!0}),t.onChange(e,{action:r,option:n})},t.selectOption=function(e){var r=t.props,n=r.blurInputOnSelect,a=r.isMulti,l=r.name,i=t.state.selectValue,o=a&&t.isOptionSelected(e,i),s=t.isOptionDisabled(e,i);if(o){var c=t.getOptionValue(e);t.setValue(i.filter(function(e){return t.getOptionValue(e)!==c}),"deselect-option",e)}else{if(s)return void t.ariaOnChange(e,{action:"select-option",option:e,name:l});a?t.setValue([].concat(sZ(i),[e]),"select-option",e):t.setValue(e,"select-option")}n&&t.blurInput()},t.removeValue=function(e){var r,n=t.props.isMulti,a=t.state.selectValue,l=t.getOptionValue(e),i=a.filter(function(e){return t.getOptionValue(e)!==l}),o=(r=i[0]||null,n?i:r);t.onChange(o,{action:"remove-value",removedValue:e}),t.focusInput()},t.clearValue=function(){var e,r,n=t.state.selectValue;t.onChange((e=t.props.isMulti,r=[],e?r:null),{action:"clear",removedValues:n})},t.popValue=function(){var e,r=t.props.isMulti,n=t.state.selectValue,a=n[n.length-1],l=n.slice(0,n.length-1),i=(e=l[0]||null,r?l:e);a&&t.onChange(i,{action:"pop-value",removedValue:a})},t.getFocusedOptionId=function(e){return dv(t.state.focusableOptionsWithIds,e)},t.getFocusableOptionsWithIds=function(){return dg(dh(t.props,t.state.selectValue),t.getElementId("option"))},t.getValue=function(){return t.state.selectValue},t.cx=function(){for(var e=arguments.length,r=Array(e),n=0;n<e;n++)r[n]=arguments[n];return c5.apply(void 0,[t.props.classNamePrefix].concat(r))},t.getOptionLabel=function(e){return dy(t.props,e)},t.getOptionValue=function(e){return dx(t.props,e)},t.getStyles=function(e,r){var n=t.props.unstyled,a=du[e](r,n);a.boxSizing="border-box";var l=t.props.styles[e];return l?l(a,r):a},t.getClassNames=function(e,r){var n,a;return null==(n=(a=t.props.classNames)[e])?void 0:n.call(a,r)},t.getElementId=function(e){return"".concat(t.state.instancePrefix,"-").concat(e)},t.getComponents=function(){var e;return e=t.props,sV(sV({},uA),e.components)},t.buildCategorizedOptions=function(){return dh(t.props,t.state.selectValue)},t.getCategorizedOptions=function(){return t.props.menuIsOpen?t.buildCategorizedOptions():[]},t.buildFocusableOptions=function(){return dm(t.buildCategorizedOptions())},t.getFocusableOptions=function(){return t.props.menuIsOpen?t.buildFocusableOptions():[]},t.ariaOnChange=function(e,r){t.setState({ariaSelection:sV({value:e},r)})},t.onMenuMouseDown=function(e){0===e.button&&(e.stopPropagation(),e.preventDefault(),t.focusInput())},t.onMenuMouseMove=function(e){t.blockOptionHover=!1},t.onControlMouseDown=function(e){if(!e.defaultPrevented){var r=t.props.openMenuOnClick;t.state.isFocused?t.props.menuIsOpen?"INPUT"!==e.target.tagName&&"TEXTAREA"!==e.target.tagName&&t.onMenuClose():r&&t.openMenu("first"):(r&&(t.openAfterFocus=!0),t.focusInput()),"INPUT"!==e.target.tagName&&"TEXTAREA"!==e.target.tagName&&e.preventDefault()}},t.onDropdownIndicatorMouseDown=function(e){if(!(e&&"mousedown"===e.type&&0!==e.button)&&!t.props.isDisabled){var r=t.props,n=r.isMulti,a=r.menuIsOpen;t.focusInput(),a?(t.setState({inputIsHiddenAfterUpdate:!n}),t.onMenuClose()):t.openMenu("first"),e.preventDefault()}},t.onClearIndicatorMouseDown=function(e){e&&"mousedown"===e.type&&0!==e.button||(t.clearValue(),e.preventDefault(),t.openAfterFocus=!1,"touchend"===e.type?t.focu
vendor: 10,913 bytes, line 47
47sInput():setTimeout(function(){return t.focusInput()}))},t.onScroll=function(e){"boolean"==typeof t.props.closeMenuOnScroll?e.target instanceof HTMLElement&&c9(e.target)&&t.props.onMenuClose():"function"==typeof t.props.closeMenuOnScroll&&t.props.closeMenuOnScroll(e)&&t.props.onMenuClose()},t.onCompositionStart=function(){t.isComposing=!0},t.onCompositionEnd=function(){t.isComposing=!1},t.onTouchStart=function(e){var r=e.touches,n=r&&r.item(0);n&&(t.initialTouchX=n.clientX,t.initialTouchY=n.clientY,t.userIsDragging=!1)},t.onTouchMove=function(e){var r=e.touches,n=r&&r.item(0);if(n){var a=Math.abs(n.clientX-t.initialTouchX),l=Math.abs(n.clientY-t.initialTouchY);t.userIsDragging=a>5||l>5}},t.onTouchEnd=function(e){t.userIsDragging||(t.controlRef&&!t.controlRef.contains(e.target)&&t.menuListRef&&!t.menuListRef.contains(e.target)&&t.blurInput(),t.initialTouchX=0,t.initialTouchY=0)},t.onControlTouchEnd=function(e){t.userIsDragging||t.onControlMouseDown(e)},t.onClearIndicatorTouchEnd=function(e){t.userIsDragging||t.onClearIndicatorMouseDown(e)},t.onDropdownIndicatorTouchEnd=function(e){t.userIsDragging||t.onDropdownIndicatorMouseDown(e)},t.handleInputChange=function(e){var r=t.props.inputValue,n=e.currentTarget.value;t.setState({inputIsHiddenAfterUpdate:!1}),t.onInputChange(n,{action:"input-change",prevInputValue:r}),t.props.menuIsOpen||t.onMenuOpen()},t.onInputFocus=function(e){t.props.onFocus&&t.props.onFocus(e),t.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(t.openAfterFocus||t.props.openMenuOnFocus)&&t.openMenu("first"),t.openAfterFocus=!1},t.onInputBlur=function(e){var r=t.props.inputValue;t.menuListRef&&t.menuListRef.contains(document.activeElement)?t.inputRef.focus():(t.props.onBlur&&t.props.onBlur(e),t.onInputChange("",{action:"input-blur",prevInputValue:r}),t.onMenuClose(),t.setState({focusedValue:null,isFocused:!1}))},t.onOptionHover=function(e){if(!(t.blockOptionHover||t.state.focusedOption===e)){var r=t.getFocusableOptions().indexOf(e);t.setState({focusedOption:e,focusedOptionId:r>-1?t.getFocusedOptionId(e):null})}},t.shouldHideSelectedOptions=function(){return dS(t.props)},t.onValueInputFocus=function(e){e.preventDefault(),e.stopPropagation(),t.focus()},t.onKeyDown=function(e){var r=t.props,n=r.isMulti,a=r.backspaceRemovesValue,l=r.escapeClearsValue,i=r.inputValue,o=r.isClearable,s=r.isDisabled,c=r.menuIsOpen,u=r.onKeyDown,d=r.tabSelectsValue,f=r.openMenuOnFocus,p=t.state,h=p.focusedOption,m=p.focusedValue,g=p.selectValue;if(!s&&!("function"==typeof u&&(u(e),e.defaultPrevented))){switch(t.blockOptionHover=!0,e.key){case"ArrowLeft":if(!n||i)return;t.focusValue("previous");break;case"ArrowRight":if(!n||i)return;t.focusValue("next");break;case"Delete":case"Backspace":if(i)return;if(m)t.removeValue(m);else{if(!a)return;n?t.popValue():o&&t.clearValue()}break;case"Tab":if(t.isComposing||e.shiftKey||!c||!d||!h||f&&t.isOptionSelected(h,g))return;t.selectOption(h);break;case"Enter":if(229===e.keyCode)break;if(c){if(!h||t.isComposing)return;t.selectOption(h);break}return;case"Escape":c?(t.setState({inputIsHiddenAfterUpdate:!1}),t.onInputChange("",{action:"menu-close",prevInputValue:i}),t.onMenuClose()):o&&l&&t.clearValue();break;case" ":if(i)return;if(!c){t.openMenu("first");break}if(!h)return;t.selectOption(h);break;case"ArrowUp":c?t.focusOption("up"):t.openMenu("last");break;case"ArrowDown":c?t.focusOption("down"):t.openMenu("first");break;case"PageUp":if(!c)return;t.focusOption("pageup");break;case"PageDown":if(!c)return;t.focusOption("pagedown");break;case"Home":if(!c)return;t.focusOption("first");break;case"End":if(!c)return;t.focusOption("last");break;default:return}e.preventDefault()}},t.state.instancePrefix="react-select-"+(t.props.instanceId||++d$),t.state.selectValue=c4(e.value),e.menuIsOpen&&t.state.selectValue.length){var r=t.getFocusableOptionsWithIds(),n=t.buildFocusableOptions(),i=n.indexOf(t.state.selectValue[0]);t.state.focusableOptionsWithIds=r,t.state.focusedOption=n[i],t.state.focusedOptionId=dv(r,n[i])}return t}return r=[{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&&un(this.menuListRef,this.focusedOptionRef)}},{key:"componentDidUpdate",value:function(e){var t=this.props,r=t.isDisabled,n=t.menuIsOpen,a=this.state.isFocused;(a&&!r&&e.isDisabled||a&&n&&!e.menuIsOpen)&&this.focusInput(),a&&r&&!e.isDisabled?this.setState({isFocused:!1},this.onMenuClose):a||r||!e.isDisabled||this.inputRef!==document.activeElement||this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(un(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(e,t){this.props.onInputChange(e,t)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(e){var t=this,r=this.state,n=r.selectValue,a=r.isFocused,l=this.buildFocusableOptions(),i="first"===e?0:l.length-1;if(!this.props.isMulti){var o=l.indexOf(n[0]);o>-1&&(i=o)}this.scrollToFocusedOptionOnUpdate=!(a&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:l[i],focusedOptionId:this.getFocusedOptionId(l[i])},function(){return t.onMenuOpen()})}},{key:"focusValue",value:function(e){var t=this.state,r=t.selectValue,n=t.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var a=r.indexOf(n);n||(a=-1);var l=r.length-1,i=-1;if(r.length){switch(e){case"previous":i=0===a?0:-1===a?l:a-1;break;case"next":a>-1&&a<l&&(i=a+1)}this.setState({inputIsHidden:-1!==i,focusedValue:r[i]})}}}},{key:"focusOption",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"first",t=this.props.pageSize,r=this.state.focusedOption,n=this.getFocusableOptions();if(n.length){var a=0,l=n.indexOf(r);r||(l=-1),"up"===e?a=l>0?l-1:n.length-1:"down"===e?a=(l+1)%n.length:"pageup"===e?(a=l-t)<0&&(a=0):"pagedown"===e?(a=l+t)>n.length-1&&(a=n.length-1):"last"===e&&(a=n.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:n[a],focusedValue:null,focusedOptionId:this.getFocusedOptionId(n[a])})}}},{key:"getTheme",value:function(){return this.props.theme?"function"==typeof this.props.theme?this.props.theme(dd):sV(sV({},dd),this.props.theme):dd}},{key:"getCommonProps",value:function(){var e=this.clearValue,t=this.cx,r=this.getStyles,n=this.getClassNames,a=this.getValue,l=this.selectOption,i=this.setValue,o=this.props,s=o.isMulti,c=o.isRtl,u=o.options;return{clearValue:e,cx:t,getStyles:r,getClassNames:n,getValue:a,hasValue:this.hasValue(),isMulti:s,isRtl:c,options:u,selectOption:l,selectProps:o,setValue:i,theme:this.getTheme()}}},{key:"hasValue",value:function(){return this.state.selectValue.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var e=this.props,t=e.isClearable,r=e.isMulti;return void 0===t?r:t}},{key:"isOptionDisabled",value:function(e,t){return dw(this.props,e,t)}},{key:"isOptionSelected",value:function(e,t){return dC(this.props,e,t)}},{key:"filterOption",value:function(e,t){return dj(this.props,e,t)}},{key:"formatOptionLabel",value:function(e,t){if("function"!=typeof this.props.formatOptionLabel)return this.getOptionLabel(e);var r=this.props.inputValue,n=this.state.selectValue;return this.props.formatOptionLabel(e,{context:t,inputValue:r,selectValue:n})}},{key:"formatGroupLabel",value:function(e){return this.props.formatGroupLabel(e)}},{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 e=this.props,t=e.isDisabled,r=e.isSearchable,n=e.inputId,a=e.inputValue,l=e.tabIndex,i=e.form,o=e.menuIsOpen,s=e.required,u=this.getComponents().Input,d=this.state,f=d.inputIsHidden,p=d.ariaSelection,h=this.commonProps,m=n||this.getElementId("input"),g=sV(sV(sV({"aria-autocomplete":"list","aria-expanded":o,"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":s,role:"combobox","aria-activedescendant":this.isAppleDevice?void 0:this.state.focusedOptionId||""},o&&{"aria-controls":this.getElementId("listbox")}),!r&&{"aria-readonly":!0}),this.hasValue()?p?.action==="initial-input-focus"&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return r?c.createElement(u,a2({},h,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:m,innerRef:this.getInputRef,isDisabled:t,isHidden:f,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:l,form:i,type:"text",value:a},g)):c.createElement(u0,a2({id:m,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:c6,onFocus:this.onInputFocus,disabled:t,tabIndex:l,inputMode:"none",form:i,value:""},g))}},{key:"renderPlaceholderOrValue",value:function(){var e=this,t=this.getComponents(),r=t.MultiValue,n=t.MultiValueContainer,a=t.MultiValueLabel,l=t.MultiValueRemove,i=t.SingleValue,o=t.Placeholder,s=this.commonProps,u=this.props,d=u.controlShouldRenderValue,f=u.isDisabled,p=u.isMulti,h=u.inputValue,m=u.placeholder,g=this.state,b=g.selectValue,v=g.focusedValue,y=g.isFocused;
47if(!this.hasValue()||!d)return h?null:c.createElement(o,a2({},s,{key:"placeholder",isDisabled:f,isFocused:y,innerProps:{id:this.getElementId("placeholder")}}),m);if(p)return b.map(function(t,i){var o=t===v,u="".concat(e.getOptionLabel(t),"-").concat(e.getOptionValue(t));return c.createElement(r,a2({},s,{components:{Container:n,Label:a,Remove:l},isFocused:o,isDisabled:f,key:u,index:i,removeProps:{onClick:function(){return e.removeValue(t)},onTouchEnd:function(){return e.removeValue(t)},onMouseDown:function(e){e.preventDefault()}},data:t}),e.formatOptionLabel(t,"value"))});if(h)return null;var x=b[0];return c.createElement(i,a2({},s,{data:x,isDisabled:f}),this.formatOptionLabel(x,"value"))}},{key:"renderClearIndicator",value:function(){var e=this.getComponents().ClearIndicator,t=this.commonProps,r=this.props,n=r.isDisabled,a=r.isLoading,l=this.state.isFocused;if(!this.isClearable()||!e||n||!this.hasValue()||a)return null;var i={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return c.createElement(e,a2({},t,{innerProps:i,isFocused:l}))}},{key:"renderLoadingIndicator",value:function(){var e=this.getComponents().LoadingIndicator,t=this.commonProps,r=this.props,n=r.isDisabled,a=r.isLoading,l=this.state.isFocused;return e&&a?c.createElement(e,a2({},t,{innerProps:{"aria-hidden":"true"},isDisabled:n,isFocused:l})):null}},{key:"renderIndicatorSeparator",value:function(){var e=this.getComponents(),t=e.DropdownIndicator,r=e.IndicatorSeparator;if(!t||!r)return null;var n=this.commonProps,a=this.props.isDisabled,l=this.state.isFocused;return c.createElement(r,a2({},n,{isDisabled:a,isFocused:l}))}},{key:"renderDropdownIndicator",value:function(){var e=this.getComponents().DropdownIndicator;if(!e)return null;var t=this.commonProps,r=this.props.isDisabled,n=this.state.isFocused,a={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return c.createElement(e,a2({},t,{innerProps:a,isDisabled:r,isFocused:n}))}},{key:"renderMenu",value:function(){var e=this,t=this.getComponents(),r=t.Group,n=t.GroupHeading,a=t.Menu,l=t.MenuList,i=t.MenuPortal,o=t.LoadingMessage,s=t.NoOptionsMessage,u=t.Option,d=this.commonProps,f=this.state.focusedOption,p=this.props,h=p.captureMenuScroll,m=p.inputValue,g=p.isLoading,b=p.loadingMessage,v=p.minMenuHeight,y=p.maxMenuHeight,x=p.menuIsOpen,w=p.menuPlacement,C=p.menuPosition,j=p.menuPortalTarget,S=p.menuShouldBlockScroll,$=p.menuShouldScrollIntoView,_=p.noOptionsMessage,k=p.onMenuScrollToTop,E=p.onMenuScrollToBottom;if(!x)return null;var N,P=function(t,r){var n=t.type,a=t.data,l=t.isDisabled,i=t.isSelected,o=t.label,s=t.value,p=f===a,h=l?void 0:function(){return e.onOptionHover(a)},m=l?void 0:function(){return e.selectOption(a)},g="".concat(e.getElementId("option"),"-").concat(r),b={id:g,onClick:m,onMouseMove:h,onMouseOver:h,tabIndex:-1,role:"option","aria-selected":e.isAppleDevice?void 0:i};return c.createElement(u,a2({},d,{innerProps:b,data:a,isDisabled:l,isSelected:i,key:g,label:o,type:n,value:s,isFocused:p,innerRef:p?e.getFocusedOptionRef:void 0}),e.formatOptionLabel(t.data,"menu"))};if(this.hasOptions())N=this.getCategorizedOptions().map(function(t){if("group"===t.type){var a=t.data,l=t.options,i=t.index,o="".concat(e.getElementId("group"),"-").concat(i),s="".concat(o,"-heading");return c.createElement(r,a2({},d,{key:o,data:a,options:l,Heading:n,headingProps:{id:s,data:t.data},label:e.formatGroupLabel(t.data)}),t.options.map(function(e){return P(e,"".concat(i,"-").concat(e.index))}))}if("option"===t.type)return P(t,"".concat(t.index))});else if(g){var T=b({inputValue:m});if(null===T)return null;N=c.createElement(o,d,T)}else{var D=_({inputValue:m});if(null===D)return null;N=c.createElement(s,d,D)}var R={minMenuHeight:v,maxMenuHeight:y,menuPlacement:w,menuPosition:C,menuShouldScrollIntoView:$},A=c.createElement(uv,a2({},d,R),function(t){var r=t.ref,n=t.placerProps,i=n.placement,o=n.maxHeight;return c.createElement(a,a2({},d,R,{innerRef:r,innerProps:{onMouseDown:e.onMenuMouseDown,onMouseMove:e.onMenuMouseMove},isLoading:g,placement:i}),c.createElement(dn,{captureEnabled:h,onTopArrive:k,onBottomArrive:E,lockEnabled:S},function(t){return c.createElement(l,a2({},d,{innerRef:function(r){e.getMenuListRef(r),t(r)},innerProps:{role:"listbox","aria-multiselectable":d.isMulti,id:e.getElementId("listbox")},isLoading:g,maxHeight:o,focusedOption:f}),N)}))});return j||"fixed"===C?c.createElement(i,a2({},d,{appendTo:j,controlElement:this.controlRef,menuPlacement:w,menuPosition:C}),A):A}},{key:"renderFormField",value:function(){var e=this,t=this.props,r=t.delimiter,n=t.isDisabled,a=t.isMulti,l=t.name,i=t.required,o=this.state.selectValue;if(i&&!this.hasValue()&&!n)return c.createElement(dl,{name:l,onFocus:this.onValueInputFocus});if(!(!l||n))if(a)if(r){var s=o.map(function(t){return e.getOptionValue(t)}).join(r);return c.createElement("input",{name:l,type:"hidden",value:s})}else{var u=o.length>0?o.map(function(t,r){return c.createElement("input",{key:"i-".concat(r),name:l,type:"hidden",value:e.getOptionValue(t)})}):c.createElement("input",{name:l,type:"hidden",value:""});return c.createElement("div",null,u)}else{var d=o[0]?this.getOptionValue(o[0]):"";return c.createElement("input",{name:l,type:"hidden",value:d})}}},{key:"renderLiveRegion",value:function(){var e=this.commonProps,t=this.state,r=t.ariaSelection,n=t.focusedOption,a=t.focusedValue,l=t.isFocused,i=t.selectValue,o=this.getFocusableOptions();return c.createElement(uB,a2({},e,{id:this.getElementId("live-region"),ariaSelection:r,focusedOption:n,focusedValue:a,isFocused:l,selectValue:i,focusableOptions:o,isAppleDevice:this.isAppleDevice}))}},{key:"render",value:function(){var e=this.getComponents(),t=e.Control,r=e.IndicatorsContainer,n=e.SelectContainer,a=e.ValueContainer,l=this.props,i=l.className,o=l.id,s=l.isDisabled,u=l.menuIsOpen,d=this.state.isFocused,f=this.commonProps=this.getCommonProps();return c.createElement(n,a2({},f,{className:i,innerProps:{id:o,onKeyDown:this.onKeyDown},isDisabled:s,isFocused:d}),this.renderLiveRegion(),c.createElement(t,a2({},f,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:s,isFocused:d,menuIsOpen:u}),c.createElement(a,a2({},f,{isDisabled:s}),this.renderPlaceholderOrValue(),this.renderInput()),c.createElement(r,a2({},f,{isDisabled:s}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],n=[{key:"getDerivedStateFromProps",value:function(e,t){var r,n=t.prevProps,a=t.clearFocusValueOnUpdate,l=t.inputIsHiddenAfterUpdate,i=t.ariaSelection,o=t.isFocused,s=t.prevWasFocused,c=t.instancePrefix,u=e.options,d=e.value,f=e.menuIsOpen,p=e.inputValue,h=e.isMulti,m=c4(d),g={};if(n&&(d!==n.value||u!==n.options||f!==n.menuIsOpen||p!==n.inputValue)){var b,v=f?dm(dh(e,m)):[],y=f?dg(dh(e,m),"".concat(c,"-option")):[],x=a?function(e,t){var r=e.focusedValue,n=e.selectValue.indexOf(r);if(n>-1){if(t.indexOf(r)>-1)return r;if(n<t.length)return t[n]}return null}(t,m):null,w=(b=t.focusedOption)&&v.indexOf(b)>-1?b:v[0],C=dv(y,w);g={selectValue:m,focusedOption:w,focusedOptionId:C,focusableOptionsWithIds:y,focusedValue:x,clearFocusValueOnUpdate:!1}}var j=null!=l&&e!==n?{inputIsHidden:l,inputIsHiddenAfterUpdate:void 0}:{},S=i,$=o&&s;return o&&!$&&(S={value:(r=m[0]||null,h?m:r),options:m,action:"initial-input-focus"},$=!s),i?.action==="initial-input-focus"&&(S=null),sV(sV(sV({},g),j),{},{prevProps:e,ariaSelection:S,prevWasFocused:$})}}
47],r&&sQ(l.prototype,r),n&&sQ(l,n),Object.defineProperty(l,"prototype",{writable:!1}),l}(c.Component);d_.defaultProps=df;var dk=(0,c.forwardRef)(function(e,t){var r=sY(e);return c.createElement(d_,a2({ref:t},r))}),dE=["allowCreateWhileLoading","createOptionPosition","formatCreateLabel","isValidNewOption","getNewOptionData","onCreateOption","options","onChange"],dN=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",t=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,n=String(e).toLowerCase(),a=String(r.getOptionValue(t)).toLowerCase(),l=String(r.getOptionLabel(t)).toLowerCase();return a===n||l===n},dP=function(e){return'Create "'.concat(e,'"')},dT=function(e,t,r,n){return!(!e||t.some(function(t){return dN(e,t,n)})||r.some(function(t){return dN(e,t,n)}))},dD=function(e,t){return{label:t,value:e,__isNew__:!0}},dR=(0,c.forwardRef)(function(e,t){var r,n,a,l,i,o,s,u,d,f,p,h,m,g,b,v,y,x,w,C,j,S,$,_,k,E,N,P,T=(a=void 0!==(n=(r=sY(e)).allowCreateWhileLoading)&&n,i=void 0===(l=r.createOptionPosition)?"last":l,s=void 0===(o=r.formatCreateLabel)?dP:o,d=void 0===(u=r.isValidNewOption)?dT:u,p=void 0===(f=r.getNewOptionData)?dD:f,h=r.onCreateOption,g=void 0===(m=r.options)?[]:m,b=r.onChange,x=void 0===(y=(v=sW(r,dE)).getOptionValue)?dc:y,C=void 0===(w=v.getOptionLabel)?ds:w,j=v.inputValue,S=v.isLoading,$=v.isMulti,_=v.value,k=v.name,E=(0,c.useMemo)(function(){return d(j,c4(_),g,{getOptionValue:x,getOptionLabel:C})?p(j,s(j)):void 0},[s,p,C,x,j,d,g,_]),N=(0,c.useMemo)(function(){return(a||!S)&&E?"first"===i?[E].c
47oncat(sZ(g)):[].concat(sZ(g),[E]):g},[a,i,S,E,g]),P=(0,c.useCallback)(function(e,t){if("select-option"!==t.action)return b(e,t);var r=Array.isArray(e)?e:[e];if(r[r.length-1]===E){if(h)h(j);else{var n,a=p(j,j);b((n=[].concat(sZ(c4(_)),[a]),$?n:a),{action:"create-option",name:k,option:a})}return}b(e,t)},[p,j,$,k,E,h,b,_]),sV(sV({},v),{},{options:N,onChange:P}));return c.createElement(d_,a2({ref:t},T))}),dA="clear-indicator",dO=e=>{let{clearValue:t,innerProps:{ref:r,...n}}=e;return(0,h.jsx)("div",{className:dA,ref:"string"==typeof r?null:r,...n,onKeyDown:e=>{"Enter"===e.key&&(t(),e.stopPropagation())},role:"button",tabIndex:0,children:(0,h.jsx)(f.a,{className:`${dA}__icon`})})},dL=e=>{let{children:t,innerProps:r,selectProps:{customProps:{disableKeyDown:n,disableMouseDown:a}={}}={}}=e;return(0,h.jsx)(c.default.Fragment,{children:(0,h.jsx)(uA.Control,{...e,innerProps:{...r,onKeyDown:e=>{if(n){e.stopPropagation();let t=new CustomEvent("bypassKeyDown",{detail:e});document.dispatchEvent(t)}},onMouseDown:e=>{a||r.onMouseDown(e)}},children:t})})},dM="dropdown-indicator",dI=e=>{let{innerProps:{ref:t,...r}}=e;return(0,h.jsx)("button",{className:dM,ref:t,...r,onKeyDown:e=>{"Enter"===e.key&&(e.key=" ")},type:"button",children:(0,h.jsx)(nZ,{className:`${dM}__icon`})})},dF=e=>(0,h.jsx)(c.default.Fragment,{children:(0,h.jsx)(uA.Input,{...e,"aria-activedescendant":void 0})}),dB="multi-value";function dz(e,t){return"function"==typeof t?t(e):e?.value}var dU=e=>{let t=(0,v.c)(24),{className:r,data:n,innerProps:a,isDisabled:l,selectProps:i}=e,o;t[0]!==i?(o=void 0===i?{}:i,t[0]=i,t[1]=o):o=t[1];let{customProps:s,getOptionValue:u,isSortable:d}=o,f;t[2]!==s?(f=void 0===s?{}:s,t[2]=s,t[3]=f):f=t[3];let{disableMouseDown:p}=f,m;t[4]!==n||t[5]!==u?(m=dz(n,u),t[4]=n,t[5]=u,t[6]=m):m=t[6];let g=m,b=!d,y;t[7]!==g||t[8]!==b?(y={id:g,disabled:b},t[7]=g,t[8]=b,t[9]=y):y=t[9];let{attributes:x,isDragging:w,listeners:C,setNodeRef:j,transform:S}=aH(y),$=!l&&d&&"draggable",_=w&&`${dB}--is-dragging`,k;t[10]!==r||t[11]!==$||t[12]!==_?(k=[dB,r,$,_].filter(Boolean),t[10]=r,t[11]=$,t[12]=_,t[13]=k):k=t[13];let E=k.join(" "),N;if(t[14]!==x||t[15]!==E||t[16]!==p||t[17]!==a||t[18]!==d||t[19]!==C||t[20]!==e||t[21]!==j||t[22]!==S){let{onMouseDown:r,...n}=C||{};N=(0,h.jsx)(c.default.Fragment,{children:(0,h.jsx)(uA.MultiValue,{...e,className:E,innerProps:{...d?{...x,...n}:{},...a,onMouseDown:e=>{d&&r&&r(e),p||e.stopPropagation()},ref:j,style:d?{transform:S,...x?.style}:{}}})}),t[14]=x,t[15]=E,t[16]=p,t[17]=a,t[18]=d,t[19]=C,t[20]=e,t[21]=j,t[22]=S,t[23]=N}else N=t[23];return N},dV="multi-value-label",dH=e=>{let{data:t,selectProps:r}=e,{customProps:n}=void 0===r?{}:r,{draggableProps:a,editableProps:l}=void 0===n?{}:n,{i18n:i}=(0,f.d)(),o=`${dV}__text`,s=t.label?m(t.label,i):"";return(0,h.jsx)("div",{className:dV,title:"string"==typeof s?s:"",children:(0,h.jsx)(uA.MultiValueLabel,{...e,innerProps:{className:o,...l&&l(t,o,e.selectProps)||{},...a||{}}})})},dq="multi-value-remove",dK=e=>{let t=(0,v.c)(12),{innerProps:r}=e,{className:n,onClick:a,onTouchEnd:l}=r,[i,o]=c.default.useState(!1),{t:s}=(0,f.d)(),u;if(t[0]!==n||t[1]!==a||t[2]!==l||t[3]!==i||t[4]!==s){let e,r,c,d=s("general:remove"),p;t[6]!==n?(p=[dq,n].filter(Boolean),t[6]=n,t[7]=p):p=t[7],t[8]!==a?(e=e=>{o(!1),a(e)},t[8]=a,t[9]=e):e=t[9],t[10]===Symbol.for("react.memo_cache_sentinel")?(r=()=>o(!0),c=()=>o(!1),t[10]=r,t[11]=c):(r=t[10],c=t[11]),u=(0,h.jsxs)("button",{"aria-label":d,className:p.join(" "),onClick:e,onKeyDown:dW,onMouseDown:dG,onMouseEnter:r,onMouseLeave:c,onTouchEnd:l,type:"button",children:[(0,h.jsx)(ao,{className:`${dq}__tooltip`,show:i,children:s("general:remove")}),(0,h.jsx)(f.a,{className:`${dq}__icon`})]}),t[0]=n,t[1]=a,t[2]=l,t[3]=i,t[4]=s,t[5]=u}else u=t[5];return u};function dW(e){"Enter"===e.key&&e.stopPropagation()}function dG(e){return e.stopPropagation()}var dY=e=>{let{children:t,className:r}=e;return(0,h.jsx)(c.default.Fragment,{children:(0,h.jsx)(uA.SingleValue,{...e,className:["react-select--single-value",r].filter(Boolean).join(" "),children:t})})},dQ="value-container",dX=e=>{let{selectProps:t}=e,{customProps:r,value:n}=void 0===t?{}:t,{i18n:a}=(0,f.d)(),l="";if(n&&!Array.isArray(n)&&"object"==typeof n&&"label"in n){let e=n.label?m(n.label,a):"";l="string"==typeof e?e:""}return(0,h.jsxs)("div",{className:dQ,ref:r?.droppableRef,title:l,children:[r?.valueContainerLabel&&(0,h.jsx)("span",{className:`${dQ}__label`,children:r?.valueContainerLabel}),(0,h.jsx)(uA.ValueContainer,{...e})]})},dJ=e=>{let{i18n:t,t:r}=(0,f.d)(),[n,a]=c.default.useState(""),l=(0,c.useId)(),[i,o]=c.default.useState(!1);(0,c.useEffect)(()=>{o(!0)},[]);let{className:s,components:u,customProps:p,disabled:g=!1,filterOption:b,getOptionValue:v,isClearable:y=!0,isCreatable:x,isLoading:w,isSearchable:C=!0,noOptionsMessage:j=()=>r("general:noOptions"),numberOnly:S=!1,onChange:$,onMenuClose:_,onMenuOpen:k,options:E,placeholder:N=r("general:selectValue"),showError:P,value:T}=e,D=()=>r("general:loading")+"...",R=[s,"react-select",P&&"react-select--error"].filter(
47Boolean).join(" "),A={menu:e=>({...e,zIndex:void 0})};return i?x?(0,h.jsx)(dR,{captureMenuScroll:!0,isLoading:w,...e,className:R,classNamePrefix:"rs",components:{ClearIndicator:dO,Control:dL,DropdownIndicator:dI,Input:dF,MultiValue:dU,MultiValueLabel:dH,MultiValueRemove:dK,SingleValue:dY,ValueContainer:dX,...u},filterOption:b,inputValue:n,instanceId:l,isClearable:y,isDisabled:g,isSearchable:C,loadingMessage:D,menuPlacement:"auto",noOptionsMessage:j,onChange:$,onInputChange:e=>a(e),onKeyDown:e=>{if(!0===S){let t=!/\D/.test(e.key),r=["Tab","Escape","Backspace","Enter","ArrowRight","ArrowLeft","ArrowUp","ArrowDown"].includes(e.key);if(!t&&!r)return void e.preventDefault()}if(!(!T||!n||""===n.trim())&&!(b&&!b(null,n))&&!e.nativeEvent.isComposing)switch(e.key){case"Enter":case"Tab":$([...T,{label:n,value:n}]),a(""),e.preventDefault()}},onMenuClose:_,onMenuOpen:k,options:E,placeholder:m(N,t),styles:A,unstyled:!0,value:T}):(0,h.jsx)(dk,{captureMenuScroll:!0,customProps:p,isLoading:w,...e,className:R,classNamePrefix:"rs",components:{ClearIndicator:dO,Control:dL,DropdownIndicator:dI,Input:dF,MultiValue:dU,MultiValueLabel:dH,MultiValueRemove:dK,SingleValue:dY,ValueContainer:dX,...u},filterOption:b,getOptionValue:v,instanceId:l,isClearable:y,isDisabled:g,isSearchable:C,loadingMessage:D,menuPlacement:"auto",noOptionsMessage:j,onChange:$,onMenuClose:_,onMenuOpen:k,options:E,placeholder:m(N,t),styles:A,unstyled:!0,value:T}):(0,h.jsx)(d.f,{height:"calc(var(--base) * 2 + 2px)"})},dZ=e=>{let{getOptionValue:t,onChange:r,value:n}=e,a=[];return n&&(a=(Array.isArray(n)?n:[n]).map(e=>dz(e,t))),(0,h.jsx)(aK,{className:"react-select-container",ids:a,onDragEnd:({moveFromIndex:e,moveToIndex:t})=>{let a=n;n&&Array.isArray(n)&&(a=aE(n,e,t)),r(a)},children:(0,h.jsx)(dJ,{...e})})},d0=e=>{let{isMulti:t,isSortable:r}=e;return t&&r?(0,h.jsx)(dZ,{...e}):(0,h.jsx)(dJ,{...e})},d1=e=>e.map(e=>"object"==typeof e&&(e.value||""===e.value)?e:{label:e,value:e}),d2=e=>{let{id:t,onChange:r,options:n,readOnly:a,required:l,selectedTimezone:i}=e,{t:o}=(0,f.d)(),s=d1(n),u=(0,c.useMemo)(()=>s.find(e=>("string"==typeof e?e:e.value)===i),[s,i]),d=!!a||1===s.length;return(0,h.jsxs)("div",{className:"timezone-picker-wrapper",children:[(0,h.jsx)(iR,{htmlFor:t,label:`${o("general:timezone")} ${l?"*":""}`,required:l,unstyled:!0}),(0,h.jsx)(d0,{className:"timezone-picker",disabled:d,inputId:t,isClearable:!l,isCreatable:!1,onChange:e=>{r&&r(e?.value||"")},options:s,value:u})]})},d3="date-time-field",d6=oH(e=>{let{field:t,field:{admin:{className:r,date:n,description:a,placeholder:l}={},label:i,localized:o,required:s,timezone:u},path:p,readOnly:g,validate:b}=e,v=n?.pickerAppearance||"default",y=Intl.DateTimeFormat().resolvedOptions().timeZone,{config:x}=(0,d.c)(),{i18n:w}=(0,f.d)(),{dispatchFields:C,setModified:j}=nm(),{customComponents:{AfterInput:S,BeforeInput:$,Description:_,Error:k,Label:E}={},disabled:N,path:P,setValue:T,showError:D,value:R}=oz({potentiallyStalePath:p,validate:(0,c.useCallback)((e,t)=>{if("function"==typeof b)return b(e,{...t,required:s})},[b,s])}),A=P+"_tz",O=nj(([e,t])=>e?.[A]),L=(0,c.useMemo)(()=>u&&"object"==typeof u&&u.supportedTimezones?u.supportedTimezones:x.admin.timezones.supportedTimezones,[x.admin.timezones.supportedTimezones,u]),M=["dayOnly","default","monthOnly"].includes(v),I=O?.value,F=s||u&&"object"==typeof u&&u.required,B=(0,c.useMemo)(()=>{if(u&&I&&y&&R){let e=iU.tz(I),t=iU.tz(y),r=oh(new iU(R).withTimeZone(I),e);return oh(r,t).toISOString()}return R},[u,I,R,y]),z=(0,c.useMemo)(()=>oq(t),[t]),U=(0,c.useCallback)(e=>{if(!(g||N))if(u&&I&&e){let t=iU.tz(I);if(M){let r=e.getTimezoneOffset()/60,n=e.getHours()+r;e.setHours(n),T(oh(e,t).toISOString()||null)}else T(oh(new iU(e),t).toISOString()||null)}else T(e?.toISOString()||null)},[g,N,u,I,M,T]),V=(0,c.useCallback)(e=>{A&&(C({type:"UPDATE",path:A,value:e}),j(!0))},[C,j,A]);return(0,h.jsxs)("div",{className:[oK,d3,r,D&&`${d3}
47--has-error`,(g||N)&&"read-only"].filter(Boolean).join(" "),style:z,children:[(0,h.jsx)(r7,{CustomComponent:E,Fallback:(0,h.jsx)(iR,{label:i,localized:o,path:P,required:s})}),(0,h.jsxs)("div",{className:`${oK}__wrap`,id:`field-${P.replace(/\./g,"__")}`,children:[(0,h.jsx)(r7,{CustomComponent:k,Fallback:(0,h.jsx)(aX,{path:P,showError:D})}),$,(0,h.jsx)(sI,{...n,onChange:U,overrides:{...n?.overrides},placeholder:m(l,w),readOnly:g||N,value:B}),u&&L.length>0&&(0,h.jsx)(d2,{id:`${P}-timezone-picker`,onChange:V,options:L,readOnly:g||N,required:F,selectedTimezone:I}),S]}),(0,h.jsx)(r7,{CustomComponent:_,Fallback:(0,h.jsx)(aQ,{description:a,path:P})})]})}),d5=oH(e=>{let{field:t,field:{admin:{autoComplete:r,className:n,description:a,placeholder:l}={},label:i,localized:o,required:s}={},path:u,readOnly:d,validate:p}=e,{i18n:g}=(0,f.d)(),{customComponents:{AfterInput:b,BeforeInput:v,Description:y,Error:x,Label:w}={},disabled:C,path:j,setValue:S,showError:$,value:_}=oz({potentiallyStalePath:u,validate:(0,c.useCallback)((e,t)=>{if("function"==typeof p)return p(e,{...t,required:s})},[p,s])}),k=(0,c.useMemo)(()=>oq(t),[t]);return(0,h.jsxs)("div",{className:[oK,"email",n,$&&"error",(d||C)&&"read-only"].filter(
47Boolean).join(" "),style:k,children:[(0,h.jsx)(r7,{CustomComponent:w,Fallback:(0,h.jsx)(iR,{label:i,localized:o,path:j,required:s})}),(0,h.jsxs)("div",{className:`${oK}__wrap`,children:[(0,h.jsx)(r7,{CustomComponent:x,Fallback:(0,h.jsx)(aX,{path:j,showError:$})}),v,(0,h.jsx)("input",{autoComplete:r,disabled:d||C,id:`field-${j.replace(/\./g,"__")}`,name:j,onChange:S,placeholder:m(l,g),required:s,type:"email",value:_||""}),b]}),(0,h.jsx)(r7,{CustomComponent:y,Fallback:(0,h.jsx)(aQ,{description:a,path:j})})]})}),d4=(0,c.createContext)(!1),d8=({children:e,withinRow:t=!0})=>(0,h.jsx)(d4,{value:t,children:e}),d7=(0,c.createContext)(!1),d9=({children:e,withinTab:t=!0})=>(0,h.jsx)(d7,{value:t,children:e}),fe=(0,c.createContext)(!1),ft=({children:e,withinGroup:t=!0})=>(0,h.jsx)(fe,{value:t,children:e}),fr="group-field",fn=oH(e=>{let{field:t,field:{admin:{className:r,description:n,hideGutter:a}={},fields:l,label:i},indexPath:o,parentPath:s,parentSchemaPath:u,path:d,permissions:p,readOnly:g,schemaPath:b}=e,v=b??("group"===t.type&&E(t)?t.name:d),{i18n:y}=(0,f.d)(),{isWithinCollapsible:x}=o7(),w=(0,c.use)(fe),C=(0,c.use)(d4),j=(0,c.use)(d7),{customComponents:{AfterInput:S,BeforeInput:$,Description:_,Label:k}={},errorPaths:N}=oz({path:d}),P=nv(),T=N.length,D=P&&T>0,R=!(x||w||C),A=(0,c.useMemo)(()=>oq(t),[t]);return(0,h.jsxs)("div",{className:[oK,fr,R&&`${fr}--top-level`,x&&`${fr}--within-collapsible`,w&&`${fr}--within-group`,C&&`${fr}--within-row`,j&&`${fr}--within-tab`,!a&&w&&`${fr}--gutter`,D&&`${fr}--has-error`,r].filter(Boolean).join(" "),id:`field-${d?.replace(/\./g,"__")}`,style:A,children:[(0,h.jsx)(ft,{children:(0,h.jsxs)("div",{className:`${fr}__wrap`,children:[!!(k||_||i||D)&&(0,h.jsxs)("div",{className:`${fr}__header`,children:[!!(k||_||i)&&(0,h.jsxs)("header",{children:[(0,h.jsx)(r7,{CustomComponent:k,Fallback:(0,h.jsx)("h3",{className:`${fr}__title`,children:(0,h.jsx)(iR,{as:"span",label:m(i,y),localized:!1,path:d,required:!1})})}),(0,h.jsx)(r7,{CustomComponent:_,Fallback:(0,h.jsx)(aQ,{description:n,path:d})})]}),D&&(0,h.jsx)(aG,{count:T,i18n:y,withMessage:!0})]}),$,E(t)?(0,h.jsx)(gq,{fields:l,margins:"small",parentIndexPath:"",parentPath:d,parentSchemaPath:v,permissions:!0===p?p:p?.fields,readOnly:g}):(0,h.jsx)(gq,{fields:l,margins:"small",parentIndexPath:o,parentPath:s,parentSchemaPath:u,permissions:p,readOnly:g})]})}),S]})}),fa=oH(e=>{let t=(0,v.c)(13),{disableModifyingForm:r,path:n,value:a}=e,l=void 0===r||r,i;t[0]!==n?(i={potentiallyStalePath:n},t[0]=n,t[1]=i):i=t[1];let{formInitializing:o,path:s,setValue:u,value:d}=oz(i),f,p;t[2]!==l||t[3]!==o||t[4]!==u||t[5]!==a?(f=()=>{void 0===a||o||u(a,l)},p=[a,u,l,o],t[2]=l,t[3]=o,t[4]=u,t[5]=a,t[6]=f,t[7]=p):(f=t[6],p=t[7]),(0,c.useEffect)(f,p);let m=`field-${s?.replace(/\./g,"__")}`,g=d||"",b;return t[8]!==s||t[9]!==u||t[10]!==m||t[11]!==g?(b=(0,h.jsx)("input",{id:m,name:s,onChange:u,type:"hidden",value:g}),t[8]=s,t[9]=u,t[10]=m,t[11]=g,t[12]=b):b=t[12],b}),fl=(0,p.e)(rZ(),1),fi=(0,c.createContext)({}),fo=({children:e,...t})=>(0,h.jsx)(fi,{value:{isInDrawer:!!t.drawerSlug,...t},children:e}),fs=()=>{let e=(0,c.use)(fi);if(!e)throw Error("useListDrawerContext must be used within a ListDrawerContextProvider");return e};function fc(e){return rh(e.toString(),{depth:10,ignoreQueryPrefix:!0})}var fu=(0,c.createContext)({}),fd=()=>(0,c.use)(fu),ff=(0,c.createContext)(!1),fp=e=>{let t={...e};return Object.entries(t).forEach(([e,r])=>{if("columns"===e&&("[]"===r||Array.isArray(t[e])&&0===t[e].length)&&delete t[e],"where"!==e||"object"!=typeof r||null===r||Object.keys(r).length||delete t[e],("limit"===e||"page"===e)&&"string"==typeof r){let n=parseInt(r,10);t[e]=Number.isNaN(n)?void 0:n}"page"===e&&0===r&&delete t[e],""===r&&delete t[e]}),t},fh=({children:e,collectionSlug:t,data:r,modifySearchParams:n,onQueryChange:a,orderableFieldName:l,query:i})=>{let o=(0,b.useRouter)(),s=(0,b.useSearchParams)(),{startRouteTransition:u}=nK(),[f,p]=(0,c.useState)(!1),{getEntityConfig:m}=(0,d.c)(),g=m({collectionSlug:t}),v=(0,c.useRef)({});v.current.modified=f;let{onQueryChange:y}=fs(),x=y||a,w=(0,c.useMemo)(()=>fp(fc(s)),[s]),[C,j]=(0,c.useState)(()=>n?w:{limit:i.limit,sort:i.sort}),S=(0,c.useCallback)(async(e,t)=>{var r;let a,l;p(t??!0);let s=(r={defaults:{limit:i.limit,sort:i.sort}},a="page"in e?e.page:C?.page,["where","search","groupBy"].some(t=>t in e&&!["limit","page"].includes(t))&&(a=1),["where","search","page","limit","groupBy","
47sort"].some(t=>t in e)||(l={...C?.queryByGroup||{},...e.queryByGroup?Object.fromEntries(Object.entries(e.queryByGroup).map(([e,t])=>[e,{...C?.queryByGroup?.[e]||{},...t}])):{}}),{...C,...e,columns:"columns"in e?e.columns:C.columns,groupBy:"groupBy"in e?e.groupBy:C?.groupBy??r?.defaults?.groupBy,limit:"limit"in e?e.limit:C?.limit??r?.defaults?.limit,page:a,preset:"preset"in e?e.preset:C?.preset,queryByGroup:l,search:"search"in e?e.search:C?.search,sort:"sort"in e?e.sort:C?.sort??r?.defaults?.sort,where:"where"in e?e.where:C?.where});if(n){let e=`?${t6({...s,columns:JSON.stringify(s.columns),queryByGroup:JSON.stringify(s.queryByGroup)})}`;window.location.search!==e&&u(()=>o.replace(e))}else"function"==typeof x&&x(s);j(s)},[C,i.limit,i.sort,n,x,u,o]),$=(0,c.useCallback)(async e=>{await S({page:e})},[S]),_=c.default.useCallback(async e=>{await S({limit:e,page:1})},[S]),k=(0,c.useCallback)(async e=>{await S({search:""===e?void 0:e})},[S]),E=(0,c.useCallback)(async e=>{await S({sort:e})},[S]),N=(0,c.useCallback)(async e=>{await S({where:e})},[S]),P=ae(()=>{let e=fp({...C||{},...i||{}}),t=`?${t6({...e,columns:JSON.stringify(e.columns),queryByGroup:JSON.stringify(e.queryByGroup)})}`;window.location.search!==t&&(j(e),window.history.replaceState(null,"",t))});return(0,c.useEffect)(()=>{n&&i&&P()},[n,i]),(0,h.jsx)(fu,{value:{collectionSlug:t,data:r,defaultLimit:r?.limit,handlePageChange:$,handlePerPageChange:_,handleSearchChange:k,handleSortChange:E,handleWhereChange:N,isGroupingBy:!!(g?.admin?.groupBy&&C?.groupBy),orderableFieldName:l,query:C,refineListData:S,setModified:p,...v.current},children:(0,h.jsx)(ff,{value:f,children:e})})},fm=(0,c.createContext)(void 0),fg=()=>{let e=c.default.use(fm);if(void 0===e)throw Error("useServerFunctions must be used within a ServerFunctionsProvider");return e},fb=({children:e,serverFunction:t})=>{if(!t)throw Error("ServerFunctionsProvider requires a serverFunction prop");let r=(0,c.useCallback)(async e=>await t({name:"render-document-slots",args:e}),[t]),n=(0,c.useCallback)(async e=>{let{signal:r,...n}=e;try{if(!r?.aborted){let e=await t({name:"schedule-publish",args:{...n}});if(!r?.aborted)return e}}catch(e){console.error(e)}let a=`Error scheduling ${n.type}`;return n.doc&&(a+=` for document with ID ${n.doc.value} in collection ${n.doc.relationTo}`),{error:a}},[t]),a=(0,c.useCallback)(async e=>{let{signal:r,...n}=e||{};try{if(!r?.aborted){let e=await t({name:"form-state",args:{fallbackLocale:!1,...n}});if(!r?.aborted)return e}}catch(e){console.error(e)}return{state:null}},[t]),l=(0,c.useCallback)(async e=>{let{signal:r,...n}=e||{};try{if(!r?.aborted){let e=await t({name:"table-state",args:{fallbackLocale:!1,...n}});if(!r?.aborted)return e}}catch(e){console.error(e)}},[t]),i=(0,c.useCallback)(async e=>{let{signal:r,...n}=e||{};try{return await t({name:"render-document",args:{fallbackLocale:!1,...n}})}catch(e){console.error(e)}},[t]),o=(0,c.useCallback)(async e=>{let{signal:r,...n}=e||{},a=await t({name:"copy-data-from-locale",args:n});if(!r?.aborted)return{data:a}},[t]),s=(0,c.useCallback)(async e=>{let{signal:r,...n}=e||{};try{let e=await t({name:"get-folder-results-component-and-data",args:n});if(!r?.aborted)return e}catch(e){console.error(e)}},[t]),u=(0,c.useCallback)(async e=>{try{return await t({name:"render-field",args:e})}catch(e){console.error(e)}},[t]),d=(0,c.useCallback)(async e=>{let{signal:r,...n}=e||{};try{return await t({name:"slugify",args:{...n}})}catch(e){console.error(e)}},[t]);return(0,h.jsx)(fm,{value:{_internal_renderField:u,copyDataFromLocale:o,getDocumentSlots:r,getFolderResultsComponentAndData:s,getFormState:a,getTableState:l,renderDocument:i,schedulePublish:n,serverFunction:t,slugify:d},children:e})},fv=(0,c.createContext)({}),fy=()=>(0,c.use)(fv),fx=({children:e,collectionSlug:t,columnState:r,LinkedCellOverride:n})=>{let{getEntityConfig:a}=(0,d.c)(),{query:l,refineListData:i}=fd(),{admin:{defaultColumns:o}={}}=a({collectionSlug:t}),[s,u]=c.default.useOptimistic(r,(e,t)=>t),f=(0,c.useRef)({}),p=(0,c.useCallback)(async e=>{let t=(s||[]).map(t=>t.accessor===e?{...t,active:!t.active}:t);(0,c.startTransition)(()=>{u(t)}),await i({columns:rl(t)})},[i,s,u]),m=(0,c.useCallback)(async e=>{let{fromIndex:t,toIndex:r}=e,n=[...s||[]],[a]=n.splice(t,1);n.splice(r,0,a),(0,c.startTransition)(()=>{u(n)}),await i({columns:rl(n)})},[s,i,u]),g=(0,c.useCallback)(async e=>{let t=l.columns;
47e.forEach(e=>{let r=t.findIndex(t=>e===t);void 0!==r&&"-"===t[r][0]&&(t[r]=e.slice(1))}),await i({columns:t})},[l,i]),b=c.default.useCallback(async()=>{await i({columns:o||[]})},[o,i]);return(0,h.jsx)(fv,{value:{columns:s,LinkedCellOverride:n,moveColumn:m,resetColumnsState:b,setActiveColumns:g,toggleColumn:p,...f.current},children:e})},fw="pill-selector",fC=({draggable:e,onClick:t,pills:r})=>{let n=c.default.useMemo(()=>r.map((r,n)=>(0,h.jsx)(sl,{alignIcon:"left","aria-checked":r.selected,className:[`${fw}__pill`,r.selected&&`${fw}__pill--selected`].filter(Boolean).join(" "),draggable:!!e,icon:r.selected?(0,h.jsx)(f.a,{}):(0,h.jsx)(n2,{}),id:r.name,onClick:()=>{t&&t({pill:r})},size:"small",children:r.Label??(0,h.jsx)("span",{className:`${fw}__pill-label`,children:r.name})},r.key??`${r.name}-${n}`)),[r,t,e]);return e?(0,h.jsx)(aK,{className:fw,ids:r.map(e=>e.name),onDragEnd:({moveFromIndex:t,moveToIndex:r})=>{e.onDragEnd({moveFromIndex:t,moveToIndex:r})},children:n}):(0,h.jsx)("div",{className:fw,children:n})},fj=({collectionSlug:e})=>{let{columns:t,moveColumn:r,toggleColumn:n}=fy(),a=(0,c.useId)(),l=a0(),i=(0,c.useMemo)(()=>t?.filter(e=>!($(e.field)&&!S(e.field))&&!e?.field?.admin?.disableListColumn),[t]),o=(0,c.useMemo)(()=>i?i.map((t,r)=>{let{accessor:n,active:i,field:o}=t,s="labelWithPrefix"in o&&void 0!==o.labelWithPrefix?o.labelWithPrefix:"label"in o&&void 0!==o.label?o.label:"name"in o&&void 0!==o.name?o.name:void 0;return{name:n,key:`${e}-${n}-${r}${l?`-${l}-`:""}${a}`,Label:(0,h.jsx)(iR,{label:s,unstyled:!0}),selected:i}}):null,[e,l,i,a]);return o?(0,h.jsx)(fC,{draggable:{onDragEnd:({moveFromIndex:e,moveToIndex:t})=>{r({fromIndex:e,toIndex:t})}},onClick:({pill:e})=>{n(e.name)},pills:o}):null},fS=e=>{let t=(0,v.c)(3),{getEntityConfig:r}=(0,d.c)(),n;t[0]!==r||t[1]!==e?(n=()=>e?("string"==typeof e?[e]:e).map(e=>r({collectionSlug:e})):[],t[0]=r,t[1]=e,t[2]=n):n=t[2];let[a]=(0,c.useState)(n);return a},f$=e=>{let t,r=(0,v.c)(13),{delayBeforeShow:n,inTimeout:a,minShowTime:l,outTimeout:i,show:o}=e,s=a+l+i,[u,f]=(0,d.e)(n),[p,h]=c.useState(!1),[m,g]=c.useState(!1),b=c.useRef(0),y=c.useRef(void 0),x;r[0]!==i?(x=()=>{g(!0),y.current=setTimeout(()=>{h(!1),g(!1)},i)},r[0]=i,r[1]=x):x=r[1];let w=x,C,j;return r[2]!==u||r[3]!==p||r[4]!==o||r[5]!==s||r[6]!==w?(C=()=>
47{let e=u&&!p&&o,t=p&&!o;if(e)b.current=Date.now(),h(!0);else if(t){let e=s-(Date.now()-b.current);clearTimeout(y.current),y.current=setTimeout(w,Math.max(0,e))}},j=[p,o,w,s,u],r[2]=u,r[3]=p,r[4]=o,r[5]=s,r[6]=w,r[7]=C,r[8]=j):(C=r[7],j=r[8]),c.useEffect(C,j),r[9]!==p||r[10]!==m||r[11]!==f?(t={isMounted:p,isUnmounting:m,triggerDelayedRender:f},r[9]=p,r[10]=m,r[11]=f,r[12]=t):t=r[12],t},f_={isLoading:!1,loaders:[],loadingText:"",overlayType:null},fk=(e,t)=>{let r=[...e.loaders],{type:n="fullscreen",key:a="user",loadingText:l}=t.payload;if("add"===t.type)r.push({type:n,key:a,loadingText:l});else if("remove"===t.type){let e=r.findIndex(e=>e.key===a&&e.type===n);r.splice(e,1)}let i=r?.length>0?r[r.length-1]:null;return{isLoading:!!i,loaders:r,loadingText:i?.loadingText||e?.loadingText,overlayType:i?.type||e?.overlayType}},fE=(0,c.createContext)({isOnScreen:!1,toggleLoadingOverlay:void 0}),fN=({children:e})=>{let{t:t}=(0,f.d)(),r=t("general:loading"),[n,a]=c.default.useReducer(fk,f_),{isMounted:l,isUnmounting:i,triggerDelayedRender:o}=f$({delayBeforeShow:1e3,inTimeout:250,minShowTime:500,outTimeout:250,show:n.isLoading}),s=c.default.useCallback(({type:e,isLoading:t,key:n,loadingText:l=r})=>{t?(o(),a({type:"add",payload:{type:e,key:n,loadingText:l}})):a({type:"remove",payload:{type:e,key:n}})},[o,r]);return(0,h.jsxs)(fE,{value:{isOnScreen:l,toggleLoadingOverlay:s},children:[l&&(0,h.jsx)(fD,{animationDuration:"250ms",loadingText:n.loadingText||r,overlayType:n.overlayType,show:!i}),e]})},fP=()=>{let e=c.default.use(fE);if(void 0===e)throw Error("useLoadingOverlay must be used within a LoadingOverlayProvider");return e},fT="loading-overlay",fD=e=>{let t=(0,v.c)(8),{animationDuration:r,loadingText:n,overlayType:a,show:l}=e,{t:i}=(0,f.d)(),o=void 0===l||l?`${fT}--entering`:`${fT}--exiting`,s=a?`${fT}--${a}`:"",c;t[0]!==o||t[1]!==s?(c=[fT,o,s].filter(Boolean),t[0]=o,t[1]=s,t[2]=c):c=t[2];let u=c.join(" "),d=r||"500ms",p;return t[3]!==n||t[4]!==i||t[5]!==u||t[6]!==d?(p=(0,h.jsxs)("div",{className:u,style:{animationDuration:d},children:[(0,h.jsxs)("div",{className:`${fT}__bars`,children:[(0,h.jsx)("div",{className:`${fT}__bar`}),(0,h.jsx)("div",{className:`${fT}__bar`}),(0,h.jsx)("div",{className:`${fT}__bar`}),(0,h.jsx)("div",{className:`${fT}__bar`}),(0,h.jsx)("div",{className:`${fT}__bar`})]}),(0,h.jsx)("span",{className:`${fT}__text`,children:n||i("general:loading")})]}),t[3]=n,t[4]=i,t[5]=u,t[6]=d,t[7]=p):p=t[7],p},fR=e=>{let t=(0,v.c)(7),{name:r,type:n,loadingText:a,show:l}=e,i=void 0===n?"fullscreen":n,{toggleLoadingOverlay:o}=fP(),s,u;return t[0]!==r||t[1]!==a||t[2]!==l||t[3]!==o||t[4]!==i?(s=()=>(o({type:i,isLoading:l,key:r,loadingText:a||void 0}),()=>{o({type:i,isLoading:!1,key:r})}),u=[l,o,r,i,a],t[0]=r,t[1]=a,t[2]=l,t[3]=o,t[4]=i,t[5]=s,t[6]=u):(s=t[5],u=t[6]),c.default.useEffect(s,u),null};function fA(e){if(e)try{e.abort()}catch{}}function fO(e){let t=new AbortController;if(e.current)try{e.current.abort()}catch{}return e.current=t,t}var fL=(0,c.createContext)({}),fM=({children:e,...t})=>(0,h.jsx)(fL,{value:{...t},children:e}),fI=()=>{let e=(0,c.use)(fL);if(!e)throw Error("useDocumentDrawerContext must be used within a DocumentDrawerProvider");return e},fF=({id:e,collectionSlug:t,disableActions:r,drawerSlug:n,initialData:a,onDelete:l,onDuplicate:i,onSave:o,overrideEntityVisibility:s=!0,redirectAfterCreate:u,redirectAfterDelete:p,redirectAfterDuplicate:m,redirectAfterRestore:g})=>{let{getEntityConfig:b}=(0,d.c)(),[v]=(0,c.useState)(()=>b({collectionSlug:t})),y=c.default.useRef(null),{closeModal:x}=lc(),{t:w}=(0,f.d)(),{renderDocument:C}=fg(),[j,S]=(0,c.useState)(void 0),[$,_]=(0,c.useState)(!0),k=(0,c.useRef)(!1),E=(0,c.useCallback)((e,l=!1)=>{let i=fO(y);(async()=>{l&&_(!0);try{let l=await C({collectionSlug:t,disableActions:r,docID:e,drawerSlug:n,initialData:a,overrideEntityVisibility:s,redirectAfterCreate:u,redirectAfterDelete:void 0!==p&&p,redirectAfterDuplicate:void 0!==m&&m,redirectAfterRestore:void 0!==g&&g,signal:i.signal});l?.Document&&(S(l.Document),_(!1))}catch(e){nI.error(e?.message||w("error:unspecific")),x(n)}y.current=null})()},[t,r,n,a,p,m,g,C,u,x,s,w]),N=(0,c.useCallback)(e=>{"create"===e.operation&&E(e.doc.id),"function"==typeof o&&o({...e,collectionConfig:v})},[o,v,E]),P=(0,c.useCallback)(e=>{E(e.doc.id),"function"==typeof i&&i({...e,collectionConfig:v})},[i,v,E]),T=(0,c.useCallback)(e=>{"function"==typeof l&&l({...e,collectionConfig:v}),x(n)},[l,x,n,v]),D=(0,c.useCallback)(()=>{E(void 0,!0)},[E]);return(0,c.useEffect)(()=>{j||k.current||(E(e,!0),k.current=!0)},[j,E,e]),(0,c.useEffect)(()=>{let e=y.current;return()=>{fA(e)}},[]),$?(0,h.jsx)(fD,{}):(0,h.jsx)(fM,{clearDoc:D,drawerSlug:n,onDelete:T,onDuplicate:P,onSave:N,children:j})},fB="doc-drawer",fz=e=>{let t=(0,v.c)(2),{children:r,className:n,collectionSlug:a,disabled:l,drawerSlug:i,onClick:o,operation:s,...c}=e,{t:u}=(0,f.d)(),[d]=fS(a),p=u("create"===s?"fields:addNewLabel":"general:editLabel",{label:d?.labels.singular}),m;return t[0]!==n?(m=[n,`${fB}
47__toggler`].filter(Boolean),t[0]=n,t[1]=m):m=t[1],(0,h.jsx)(id,{"aria-label":p,className:m.join(" "),disabled:l,onClick:o,slug:i,...c,children:r})},fU=e=>{let{drawerSlug:t}=e;return(0,h.jsx)(ip,{className:fB,gutter:!1,Header:null,slug:t,children:(0,h.jsx)(fF,{...e})})},fV=e=>{let t,r=(0,v.c)(38),{id:n,collectionSlug:a,overrideEntityVisibility:l}=e,i=a0(),o=(0,c.useId)(),{closeModal:s,modalState:u,openModal:d,toggleModal:f}=lc(),[p,m]=(0,c.useState)(!1),g;r[0]!==a||r[1]!==i||r[2]!==n||r[3]!==o?(g=(({id:e,collectionSlug:t,depth:r,uuid:n})=>`doc-drawer_${t}_${r}${e?`_${e}`:""}_${n}`)({id:n,collectionSlug:a,depth:i,uuid:o}),r[0]=a,r[1]=i,r[2]=n,r[3]=o,r[4]=g):g=r[4];let b=g,y,x;r[5]!==b||r[6]!==u?(y=()=>{m(!!u[b]?.isOpen)},x=[u,b],r[5]=b,r[6]=u,r[7]=y,r[8]=x):(y=r[7],x=r[8]),(0,c.useEffect)(y,x),r[9]!==b||r[10]!==f?(t=()=>{f(b)},r[9]=b,r[10]=f,r[11]=t):t=r[11];let w=t,C;r[12]!==s||r[13]!==b?(C=()=>{s(b)},r[12]=s,r[13]=b,r[14]=C):C=r[14];let j=C,S;r[15]!==b||r[16]!==d?(S=()=>{d(b)},r[15]=b,r[16]=d,r[17]=S):S=r[17];let $=S,_;r[18]!==a||r[19]!==b||r[20]!==n||r[21]!==l?(_=e=>(0,c.createElement)(fU,{...e,collectionSlug:a,drawerSlug:b,id:n,key:b,overrideEntityVisibility:l}),r[18]=a,r[19]=b,r[20]=n,r[21]=l,r[22]=_):_=r[22];let k=_,E;r[23]!==a||r[24]!==b||r[25]!==n?(E=e=>(0,h.jsx)(fz,{...e,collectionSlug:a,drawerSlug:b,operation:n?"update":"create"}),r[23]=a,r[24]=b,r[25]=n,r[26]=E):E=r[26];let N=E,P;r[27]!==j||r[28]!==b||r[29]!==i||r[30]!==p||r[31]!==$||r[32]!==w?(P={closeDrawer:j,drawerDepth:i,drawerSlug:b,isDrawerOpen:p,openDrawer:$,toggleDrawer:w},r[27]=j,r[28]=b,r[29]=i,r[30]=p,r[31]=$,r[32]=w,r[33]=P):P=r[33];let T=P,D;return r[34]!==k||r[35]!==T||r[36]!==N?(D=[k,N,T],r[34]=k,r[35]=T,r[36]=N,r[37]=D):D=r[37],D},fH="no-results";function fq({Actions:e,Message:t}){return(0,h.jsxs)("div",{className:fH,children:[t,e&&e.length>0&&(0,h.jsx)("div",{className:`${fH}__actions`,children:e.map((e,t)=>(0,h.jsx)(c.default.Fragment,{children:e},t))})]})}function fK(e,t){let r=(0,v.c)(4),[n,a]=(0,c.useState)(e),l,i;return r[0]!==t||r[1]!==e?(l=()=>{let r=setTimeout(()=>{a(e)},t);return()=>{clearTimeout(r)}},i=[e,t],r[0]=t,r[1]=e,r[2]=l,r[3]=i):(l=r[2],i=r[3]),(0,c.useEffect)(l,i),n}function fW(e,t){switch(t.type){case"ADD_LOADED":{let r={...e};"object"!=typeof r[t.relationTo]&&(r[t.relationTo]={});let n=[...t.idsToLoad];return Array.isArray(t.docs)&&t.docs.forEach(e=>{n.splice(n.indexOf(e.id),1),r[t.relationTo][e.id]=e}),n.forEach(e=>{r[t.relationTo][e]=!1}),r}case"REQUEST":{let r={...e};return t.docs.forEach(({relationTo:e,value:t})=>{"object"!=typeof r[e]&&(r[e]={}),r[e][t]=null}),r}default:return e}}var fG=(0,c.createContext)({}),fY=e=>{let t,r=(0,v.c)(15),{children:n}=e,a;r[0]===Symbol.for("react.memo_cache_sentinel")?(a={},r[0]=a):a=r[0];let[l,i]=(0,c.useReducer)(fW,a),o=fK(l,100),{config:s}=(0,d.c)(),{collections:u,routes:p}=s,{api:m}=p,{i18n:g}=(0,f.d)(),{code:b}=iP(),y=(0,c.useRef)(b),x;r[1]!==m||r[2]!==u||r[3]!==o||r[4]!==g||r[5]!==b?(x=e=>{let t=void 0!==e&&e;Object.entries(o).forEach(async e=>{let[r,n]=e,a=[];if(Object.entries(n).forEach(e=>{let[r,n]=e;(null===n||t)&&a.push(r)}),a.length>0){let e=tR({apiRoute:m,path:`/${r}`}),t=new URLSearchParams,n={};t.append("depth","0"),t.append("limit","250");let l=u.find(e=>e.slug===r);l.admin.enableListViewSelectAPI&&(n[l.admin.useAsTitle??"id"]=!0,l.upload&&(({collectionConfig:e,select:t})=>{e.upload&&t&&(t.mimeType=!0,t.thumbnailURL=!0,e.upload.imageSizes&&e.upload.imageSizes.length>0?e.upload.adminThumbnail&&"string"==typeof e.upload.adminThumbnail?t.sizes={[e.upload.adminThumbnail]:{filename:!0}}:t.sizes=e.upload.imageSizes.reduce((e,t)=>({...e,[t.name]:{filename:!0,url:!0,width:!0}}),{}):t.url=!0)})({collectionConfig:l,select:n})),b&&t.append("locale",b);let o=a.map(fX);t.append("where[id][in]",o.join(","));let s=`?${t.toString()}&${t6({select:n})}`,c=await fetch(`${e}${s}`,{credentials:"include",headers:{"Accept-Language":g.language}});if(c.ok){let e=await c.json();e.docs&&i({type:"ADD_LOADED",docs:e.docs,idsToLoad:a,relationTo:r})}else i({type:"ADD_LOADED",docs:[],idsToLoad:a,relationTo:r})}})},r[1]=m,r[2]=u,r[3]=o,r[4]=g,r[5]=b,r[6]=x):x=r[6];let w=x,C,j;r[7]!==w||r[8]!==b?(C=()=>{w(b&&y.current!==b),y.current=b},j=[b,w],r[7]=w,r[8]=b,r[9]=C,r[10]=j):(C=r[9],j=r[10]),(0,c.useEffect)(C,j),r[11]===Symbol.for("react.memo_cache_sentinel")?(t=e=>{i({type:"REQUEST",docs:e})},r[11]=t):t=r[11];let S=t,$;return r[12]!==n||r[13]!==l?($=(0,h.jsx)(fG,{value:{documents:l,getRelationships:S},children:n}),r[12]=n,r[13]=l,r[14]=$):$=r[14],$},fQ=()=>(0,c.use)(fG);function fX(e){return String(e)}var fJ=({allowCreate:e,baseClass:t,buttonStyle:r,className:n,collections:a,i18n:l,icon:i,label:o,onClick:s,permissions:c,relationTo:u})=>e?Array.isArray(u)?(0,h.jsx)("div",{className:`${t}__add-new-polymorphic-wrapper`,children:(0,h.jsx)(al,{button:(0,h.jsx)(au,{buttonStyle:r,className:n,icon:i,children:o}),buttonType:"custom",horizontalAlign:"center",render:({close:e})=>(0,h.jsx)(n6.ButtonGroup,{children:u.map(r=>c.collections[r]?.create?(0,h.jsx)(n6.Button,{className:`${t}__relation-button--${r}`,onClick:()=>{e(),s(r)},children:m(a.find(e=>e.slug===r).labels.singular,l)},r):null)}),size:"medium"})}):(0,h.jsx)(au,{buttonStyle:r,className:n,onClick:()=>s(),children:o}):null,fZ=Symbol.for("react.lazy");function f0(e){return c.default.isValidElement(e)||e?.$$typeof===fZ}var f1=({cellData:e,nowrap:t})=>{let r=e?.length>100?`${e.substring(0,100)}\u2026`:e;return(0,h.jsx)("code",{className:"code-cell",style:t?{whiteSpace:"nowrap"}:{},children:(0,h.jsx)("span",{children:r})})};function f2(e){let{blockType:t}=e;return t}var f3=e=>{let{cellData:t,field:r,rowData:n}=e,{name:a,accessor:l,admin:i,timezone:o}=r,{date:s}=void 0===i?{}:i,{config:c}=(0,d.c)(),{admin:u}=c,{dateFormat:p}=u,{i18n:m}=(0,f.d)(),g=`${l||a}_tz`,b=o&&n?((e,t,r)=>{if(!t||!e)return r;let n=t.split(".").reduce((e,t)=>
47e?.[t],e);return void 0===n?r:n})(n,g,void 0):void 0,v=s?.displayFormat||p;return(0,h.jsx)("span",{children:!!t&&om({date:t,i18n:m,pattern:v,timezone:b})})},f6=()=>(0,h.jsxs)("svg",{height:"150",style:{backgroundColor:"#333333"},viewBox:"0 0 150 150",width:"150",xmlns:"http://www.w3.org/2000/svg",children:[(0,h.jsx)("path",{d:"M82.8876 50.5H55.5555V100.5H94.4444V61.9818H82.8876V50.5Z",fill:"white"}),(0,h.jsx)("path",{d:"M82.8876 61.9818H94.4444L82.8876 50.5V61.9818Z",fill:"#9A9A9A"})]}),f5="thumbnail",f4=e=>{let t=(0,v.c)(6),{className:r,doc:n,fileSrc:a,height:l,imageCacheTag:i,size:o,width:s}=e,u=void 0===r?"":r,{filename:f}=void 0===n?{}:n,[p,m]=c.default.useState(void 0),g=`${f5}--size-${o||"medium"}`,b;t[0]!==u||t[1]!==g?(b=[f5,g,u],t[0]=u,t[1]=g,t[2]=b):b=t[2];let y=b.join(" "),x,w;t[3]!==a?(x=()=>{if(!a)return void m(!1);m(void 0);let e=new Image;e.src=a,e.onload=()=>{m(!0)},e.onerror=()=>{m(!1)}},w=[a],t[3]=a,t[4]=x,t[5]=w):(x=t[4],w=t[5]),c.default.useEffect(x,w);let C=null;if(a){let e=a?.includes("?")?"&":"?";C=i?`${a}${e}${encodeURIComponent(i)}`:a}return(0,h.jsxs)("div",{className:y,children:[void 0===p&&(0,h.jsx)(d.f,{height:"100%"}),p&&(0,h.jsx)("img",{alt:f,height:l,src:C,width:s}),!1===p&&(0,h.jsx)(f6,{})]})};function f8(e){let t,r=(0,v.c)(12),{alt:n,className:a,filename:l,fileSrc:i,imageCacheTag:o,size:s}=e,u=void 0===a?"":a,[f,p]=c.default.useState(void 0),m=`${f5}--size-${s||"medium"}`,g;r[0]!==u||r[1]!==m?(g=[f5,m,u],r[0]=u,r[1]=m,r[2]=g):g=r[2];let b=g.join(" "),y,x;r[3]!==i?(y=()=>{if(!i)return void p(!1);p(void 0);let e=new Image;e.src=i,e.onload=()=>{p(!0)},e.onerror=()=>{p(!1)}},x=[i],r[3]=i,r[4]=y,r[5]=x):(y=r[4],x=r[5]),c.default.useEffect(y,x);let w="";if(i){let e=i?.includes("?")?"&":"?";w=o?`${i}${e}${encodeURIComponent(o)}`:i}return r[6]!==n||r[7]!==b||r[8]!==f||r[9]!==l||r[10]!==w?(t=(0,h.jsxs)("div",{className:b,children:[void 0===f&&(0,h.jsx)(d.f,{height:"100%"}),f&&(0,h.jsx)("img",{alt:n||l,src:w}),!1===f&&(0,h.jsx)(f6,{})]}),r[6]=n,r[7]=b,r[8]=f,r[9]=l,r[10]=w,r[11]=t):t=r[11],t}var f7="file",f9=({cellData:e,collectionConfig:t,field:r,rowData:n})=>{if(!(("displayPreview"in r?r.displayPreview:void 0)??t.upload?.displayPreview??!0))return(0,h.jsx)(h.Fragment,{children:String(e)});{let r=rg(n?.mimeType),a=r?n?.thumbnailURL||n?.url:n?.thumbnailURL;return r&&(a=rm({sizes:n?.sizes,thumbnailURL:n?.thumbnailURL,url:n?.url,width:n?.width})),(0,h.jsxs)("div",{className:f7,children:[(0,h.jsx)(f4,{className:`${f7}__thumbnail`,collectionSlug:t?.slug,doc:{...n,filename:e},fileSrc:a,imageCacheTag:t?.upload?.cacheTags&&n?.updatedAt,size:"small",uploadConfig:t?.upload}),(0,h.jsx)("span",{className:`${f7}__filename`,children:String(e)})]})}},pe=!!("u">typeof window&&window.document&&window.document.createElement),pt=e=>{let t,r,n,a,l=(0,v.c)(39),{cellData:i,customCellProps:o,field:s,field:u}=e,{label:p}=u,g="relationTo"in s&&s.relationTo||"collection"in s&&s.collection,b="collection"in s?i?.docs:i,{config:y,getEntityConfig:x}=(0,d.c)(),{collections:w}=y,[C,j]=ai(),S;l[0]===Symbol.for("react.memo_cache_sentinel")?(S=[],l[0]=S):S=l[0];let[$,_]=(0,c.useState)(S),{documents:k,getRelationships:E}=fQ(),[N,P]=(0,c.useState)(!1),{i18n:T,t:D}=(0,f.d)(),R=!!pe&&j?.boundingClientRect?.top<window.innerHeight,A;if(l[1]!==b||l[2]!==E||l[3]!==N||l[4]!==R||l[5]!==g?(A=()=>{if((b||"number"==typeof b)&&R&&!N){let e=[],t=Array.isArray(b)?b:[b];t.slice(0,t.length<3?t.length:3).forEach(t=>{"object"==typeof t&&"relationTo"in t&&"value"in t&&e.push(t),("number"==typeof t||"string"==typeof t)&&"string"==typeof g&&e.push({relationTo:g,value:t})}),E(e),P(!0),_(e)}},l[1]=b,l[2]=E,l[3]=N,l[4]=R,l[5]=g,l[6]=A):A=l[6],l[7]!==b||l[8]!==w||l[9]!==E||l[10]!==N||l[11]!==R||l[12]!==g?(t=[b,g,w,R,N,E],l[7]=b,l[8]=w,l[9]=E,l[10]=N,l[11]=R,l[12]=g,l[13]=t):t=l[13],(0,c.useEffect)(A,t),l[14]!==N?(r=()=>{N&&P(!1)},l[14]=N,l[15]=r):r=l[15],l[16]!==b?(n=[b],l[16]=b,l[17]=n):n=l[17],(0,c.useEffect)(r,n),l[18]!==b||l[19]!==y.admin||l[20]!==o||l[21]!==k||l[22]!==s||l[23]!==x||l[24]!==T||l[25]!==C||l[26]!==p||l[27]!==D||l[28]!==$){let e;l[30]!==y.admin||l[31]!==o||l[32]!==k||l[33]!==s||l[34]!==x||l[35]!==T||l[36]!==D||l[37]!==$.length?(e=(e,t)=>{let{relationTo:r,value:n}
47=e,a=k[r][n],l=x({collectionSlug:r}),i=oy({collectionConfig:l,data:a||null,dateFormat:y.admin.dateFormat,fallback:`${D("general:untitled")} - ID: ${n}`,i18n:T}),u=null;return"upload"===s.type&&(("displayPreview"in s?s.displayPreview:void 0)??l.upload?.displayPreview??!0)&&a&&(u=(0,h.jsx)(f9,{cellData:i,collectionConfig:l,collectionSlug:l.slug,customCellProps:o,field:s,rowData:a})),(0,h.jsxs)(c.default.Fragment,{children:[!1===a&&`${D("general:untitled")} - ID: ${n}`,null===a&&`${D("general:loading")}...`,a?u||i:null,$.length>t+1&&", "]},t)},l[30]=y.admin,l[31]=o,l[32]=k,l[33]=s,l[34]=x,l[35]=T,l[36]=D,l[37]=$.length,l[38]=e):e=l[38],a=(0,h.jsxs)("div",{className:"relationship-cell",ref:C,children:[$.map(e),Array.isArray(b)&&b.length>3&&D("fields:itemsAndMore",{count:b.length-3,items:""}),0===$.length&&D("general:noLabel",{label:m(p||"",T)})]}),l[18]=b,l[19]=y.admin,l[20]=o,l[21]=k,l[22]=s,l[23]=x,l[24]=T,l[25]=C,l[26]=p,l[27]=D,l[28]=$,l[29]=a}else a=l[29];return a},pr=e=>{let t=(0,v.c)(7),{cellData:r,field:n}=e,{options:a}=n,{i18n:l}=(0,f.d)(),i;t[0]!==l||t[1]!==a?(i=e=>e.map(e=>m(a.filter(t=>t.value===e)?.[0]?.label,l)).join(", "),t[0]=l,t[1]=a,t[2]=i):i=t[2];let o=i,s;if(t[3]!==r||t[4]!==o||t[5]!==a){let e;e=w(a)?o(Array.isArray(r)?r:[r]):Array.isArray(r)?r.join(", "):r,s=(0,h.jsx)("span",{children:e}),t[3]=r,t[4]=o,t[5]=a,t[6]=s}else s=t[6];return s},pn={array:e=>{let t=(0,v.c)(2),{cellData:r,field:n}=e,{labels:a}=n,{i18n:l}=(0,f.d)(),i=r??[],o=1===i.length?`${i.length} ${m(a?.singular||l.t("general:rows"),l)}`:`${i.length} ${m(a?.plural||l.t("general:rows"),l)}`,s;return t[0]!==o?(s=(0,h.jsx)("span",{children:o}),t[0]=o,t[1]=s):s=t[1],s},blocks:e=>{let t,r=(0,v.c)(2),{cellData:n,field:a}=e,{blockReferences:l,blocks:i,labels:o}=a,{i18n:s}=(0,f.d)(),{config:c}=(0,d.c)(),u=Array.isArray(n)?n.map(f2):[],p=(l??i)?.map(e=>{let t="string"==typeof e?c.blocksMap[e]:e;return{slug:t.slug,label:m(t.labels.singular,s)}}),g=`0 ${m(o?.plural,s)}`,b=e=>e.map(e=>p.filter(t=>t.slug===e)?.[0]?.label).join(", ");if(u.length>5){let e=u.length-5;g=`${u.length} ${m(o?.plural,s)} - ${s.t("fields:itemsAndMore",{count:e,items:b(u.slice(0,5))})}`}else u.length>0&&(g=`${u.length} ${m(1===u.length?o?.singular:o?.plural,s)} - ${b(u)}`);return r[0]!==g?(t=(0,h.jsx)("span",{children:g}),r[0]=g,r[1]=t):t=r[1],t},checkbox:e=>{let t=(0,v.c)(3),{cellData:r}=e,{t:n}=(0,f.d)(),a=`general:${r}`,l;return t[0]!==n||t[1]!==a?(l=(0,h.jsx)("code",{className:"bool-cell",children:(0,h.jsx)("span",{children:n(a).toLowerCase()})}),t[0]=n,t[1]=a,t[2]=l):l=t[2],l},code:f1,date:f3,File:f9,join:pt,json:e=>{let t=(0,v.c)(4),{cellData:r}=e,{t:n}=(0,f.d)();try{let e;if(t[0]!==r){let n,a=(n=JSON.stringify(r)).length/100>1.5?`${n.substring(0,100)}\u2026`:n;e=(0,h.jsx)("code",{className:"json-cell",children:(0,h.jsx)("span",{children:a})}),t[0]=r,t[1]=e}else e=t[1];return e}catch{let e;return t[2]!==n?(e=(0,h.jsx)("code",{className:"json-cell",children:(0,h.jsx)("span",{children:n("general:error")})}),t[2]=n,t[3]=e):e=t[3],e}},radio:pr,relationship:pt,select:pr,textarea:({cellData:e})=>{let t=e?.length>100?`${e.substring(0,100)}\u2026`:e;return(0,h.jsx)("span",{children:t})},upload:pt},pa=e=>{let t=(0,v.c)(16),{cellData:r,className:n,collectionSlug:a,field:l,field:i,link:o,linkURL:s,onClick:c,rowData:u,viewType:p}=e,{admin:g}=i,{i18n:b}=(0,f.d)(),{config:y,getEntityConfig:x}=(0,d.c)(),{routes:w}=y,{admin:C}=w,j,$;if(t[0]!==g||t[1]!==C||t[2]!==r||t[3]!==n||t[4]!==a||t[5]!==l||t[6]!==x||t[7]!==b||t[8]!==o||t[9]!==s||t[10]!==c||t[11]!==e||t[12]!==u||t[13]!==p){$=Symbol.for("react.early_return_sentinel");e:{let t=x({collectionSlug:a}),i=g&&"className"in g?g.className:void 0,d=n||(l.admin&&"className"in l.admin?l.admin.className:null)||i,f="span",v={className:d};if(o&&(v.prefetch=!1,f=nQ,s?v.href=s:v.href=t?.slug?tR({adminRoute:C,path:`/collections/${t?.slug}${"trash"===p?"/trash":""}/${encodeURIComponent(u.id)}`}):""),"function"==typeof c&&(f="button",v.type="button",v.onClick=()=>{c({cellData:r,collectionSlug:t?.slug,rowData:u})}),S(l)){$=(0,h.jsx)(f,{...v,children:(0,h.jsx)(f1,{cellData:`ID: ${r}`,collectionConfig:t,collectionSlug:a,field:{...l,type:"code"},nowrap:!0,rowData:u})});break e}let y=((e,t,r)=>{if((t?.type==="select"||t?.type==="radio")&&Array.isArray(t.options)){let n=t.options.find(t=>"object"==typeof t?t.value===e:t===e);if(n)return"object"==typeof n&&"label"in n?f0(n.label)?n.label:m(n.label,r)||n.value:n}return e})(r,l,b),w="u">typeof r&&pn[l.type],k=null;if(f0(y))k=y;else if(w)k=(0,h.jsx)(w,{cellData:r,rowData:u,...e});else if(!w)if(t?.upload&&_(l)&&"filename"===l.name&&"text"===l.type){let n=pn.File;k=(0,h.jsx)(n,{cellData:r,rowData:u,...e,collectionConfig:t,field:l})}else{$=(0,h.jsxs)(f,{...v,children:[(""===y||typeof y>"u"||null===y)&&b.t("general:noLabel",{label:m(("label"in l?l.label:null)||"data",b)}),"string"==typeof y&&y,"number"==typeof y&&y,"object"==typeof y&&null!==y&&JSON.stringify(y)]});break e}if(("select"===l.type||"radio"===l.type)&&l.options.length&&r){let e=Array.isArray(r)?r.map(pl).join(" "):`selected--${r}
47`,t=[v.className,e].filter(Boolean).join(" ");$=(0,h.jsx)(f,{...v,className:t,children:k});break e}j=(0,h.jsx)(f,{...v,children:k})}t[0]=g,t[1]=C,t[2]=r,t[3]=n,t[4]=a,t[5]=l,t[6]=x,t[7]=b,t[8]=o,t[9]=s,t[10]=c,t[11]=e,t[12]=u,t[13]=p,t[14]=j,t[15]=$}else j=t[14],$=t[15];return $!==Symbol.for("react.early_return_sentinel")?$:j};function pl(e){return`selected--${e}`}var pi=c.default.createContext(null),po=()=>c.default.use(pi),ps=e=>{let t=(0,v.c)(3),{onDrawerOpen:r}=e,n=po(),a;return t[0]!==n||t[1]!==r?(a=(0,h.jsxs)("div",{className:"drawer-link",children:[(0,h.jsx)(pa,{...n,className:"drawer-link__cell",link:!1,onClick:null}),(0,h.jsx)("button",{className:"drawer-link__doc-drawer-toggler",onClick:()=>{r(n.rowData.id,n.collectionSlug)},type:"button",children:(0,h.jsx)(n0,{})})]}),t[0]=n,t[1]=r,t[2]=a):a=t[2],a},pc="clickable-arrow",pu="paginator__page",pd=({isCurrent:e,isFirstPage:t=!1,isLastPage:r=!1,page:n=1,updatePage:a})=>{let l=[pu,e&&`${pu}--is-current`,t&&`${pu}--is-first-page`,r&&`${pu}--is-last-page`].filter(Boolean).join(" ");return(0,h.jsx)("button",{className:l,onClick:()=>a(n),type:"button",children:n})},pf={ClickableArrow:e=>{let{direction:t="right",isDisabled:r=!1,updatePage:n}=e,a=[pc,r&&`${pc}--is-disabled`,t&&`${pc}--${t}`].filter(Boolean).join(" ");return(0,h.jsx)("button",{className:a,disabled:r,onClick:r?void 0:n,type:"button",children:(0,h.jsx)(nZ,{})})},Page:pd,Separator:()=>(0,h.jsx)("span",{className:"paginator__separator",children:"—"})},pp=e=>{let{hasNextPage:t=!1,hasPrevPage:r=!1,nextPage:n=null,numberOfNeighbors:a=1,onChange:l,page:i,prevPage:o=null,totalPages:s=null}=e;if(!r&&!t)return null;let c=e=>{"function"==typeof l&&l(e)},u=Array.from({length:s},(e,t)=>t+1),d=i-1-a;d<=0&&(d=0);let f=i-1+a+1,p=u.slice(d,f);return i-a-1>=2&&p.unshift({type:"Separator"}),i>a+1&&p.unshift({type:"Page",props:{isFirstPage:!0,page:1,updatePage:c}}),i+a+1<s&&p.push({type:"Separator"}),f<s&&p.push({type:"Page",props:{isLastPage:!0,page:s,updatePage:c}}),p.unshift({type:"ClickableArrow",props:{direction:"right",isDisabled:!t,updatePage:()=>c(n??i+1)}}),p.unshift({type:"ClickableArrow",props:{direction:"left",isDisabled:!r,updatePage:()=>c(o??Math.max(1,i-1))}}),(0,h.jsx)("div",{className:"paginator",children:p.map((e,t)=>{if("number"==typeof e)return(0,h.jsx)(pd,{isCurrent:i===e,page:e,updatePage:c},t);let r=pf[e.type];return(0,h.jsx)(r,{...e.props},t)})})},ph=()=>{let e=(0,v.c)(11),{data:t,handlePageChange:r}=fd(),n=t.nextPage||2,a;e[0]!==r?(a=e=>{r(e)},e[0]=r,e[1]=a):a=e[1];let l=t.page||1,i=t.prevPage||void 0,o;return e[2]!==t.hasNextPage||e[3]!==t.hasPrevPage||e[4]!==t.limit||e[5]!==t.totalPages||e[6]!==n||e[7]!==a||e[8]!==l||e[9]!==i?(o=(0,h.jsx)(pp,{hasNextPage:t.hasNextPage,hasPrevPage:t.hasPrevPage,limit:t.limit,nextPage:n,numberOfNeighbors:1,onChange:a,page:l,prevPage:i,totalPages:t.totalPages}),e[2]=t.hasNextPage,e[3]=t.hasPrevPage,e[4]=t.limit,e[5]=t.totalPages,e[6]=n,e[7]=a,e[8]=l,e[9]=i,e[10]=o):o=e[10],o},pm="relationship-table",pg=e=>{let{AfterInput:t,allowCreate:r=!0,BeforeInput:n,disableTable:a=!1,field:l,fieldPath:i,filterOptions:o,initialData:s,initialDrawerData:u,Label:p,parent:g,relationTo:b}=e,[v,y]=(0,c.useState)(null),{config:x,getEntityConfig:w}=(0,d.c)(),{i18n:C,t:j}=(0,f.d)(),[S,$]=(0,c.useState)(),[_,k]=(0,c.useState)(!1),[E]=(0,c.useState)(()=>w({collectionSlug:b})),N=Array.isArray(b),[P,T]=(0,c.useState)(N?void 0:b),{permissions:D}=iS(),R=(0,c.useRef)(!1),[A,O]=(0,c.useState)(void 0),[L,,{closeDrawer:M,isDrawerOpen:I,openDrawer:F}]=fV({id:A,collectionSlug:P}),[B,z]=(0,c.useState)(!a),[U,V]=(0,c.useState)(()=>s?{...s,docs:Array.isArray(s.docs)?s.docs.reduce((e,t)=>"string"==typeof t||"number"==typeof t?[...e,{id:t}]:[...e,t],[]):[]}:void 0),[H,q]=(0,c.useState)(),{getTableState:K}=fg(),W=(0,c.useCallback)(async e=>{let t={limit:l?.defaultLimit||E?.admin?.pagination?.defaultLimit,sort:l.defaultSort||E?.defaultSort,...S||{},where:{...S?.where||{}}};o&&(t.where=rr(t.where,o));let r=l.admin.defaultColumns?l.admin.defaultColumns.map(e=>({accessor:e,active:!0})):void 0,n="boolean"==typeof l.admin.disableRowTypes?!l.admin.disableRowTypes:Array.isArray(b),{data:a,state:i,Table:s}=await K({collectionSlug:b,columns:ra(S?.columns)||r,data:e,enableRowSelections:!1,orderableFieldName:!l.orderable||Array.isArray(l.collection)?void 0:`_${l.collection}_${l.name}_order`,parent:g,query:t,renderRowTypes:n,tableAppearance:"condensed"});V(a),y(s),q(i),z(!1)},[l.defaultLimit,l.defaultSort,l.admin.defaultColumns,l.admin.disableRowTypes,l.collection,l.name,l.orderable,E?.admin?.pagination?.defaultLimit,E?.defaultSort,
47S,o,K,b,g]),G=ae((e,t)=>{t||v&&!e||W()});(0,c.useEffect)(()=>{G(S,a)},[S,a]);let Y=(0,c.useCallback)(({doc:e,operation:t})=>{"create"===t&&M();let r=U?.docs?.findIndex(t=>t.id===e.id),n={docs:[]};if(-1!==r){let t=[...U.docs];t[r]=e,n.docs=t}else n.docs=[e,...U.docs];W(n)},[U?.docs,W,M]),Q=(0,c.useCallback)(e=>{let t=U.docs.filter(t=>t.id!==e.id);W({...U,docs:t}),O(void 0)},[U,W]),X=(0,c.useCallback)((e,t)=>{R.current=!0,O(e||void 0),T(t||void 0)},[]);(0,c.useEffect)(()=>{R.current&&(R.current=!1,F())},[F]),(0,c.useEffect)(()=>{I||O(void 0)},[I]);let J=!1!==r&&D?.collections?.[N?b[0]:b]?.create;(0,c.useEffect)(()=>{N&&P&&F()},[P,F,N]),(0,c.useEffect)(()=>{N&&!I&&P&&T(void 0)},[I]);let Z=c.default.useMemo(()=>({columns:ra(H)?.map(({accessor:e})=>e),limit:l.defaultLimit??E?.admin?.pagination?.defaultLimit,sort:l.defaultSort??E?.defaultSort}),[H,l,E]);return(0,h.jsxs)("div",{className:pm,children:[(0,h.jsxs)("div",{className:`${pm}__header`,children:[p,(0,h.jsxs)("div",{className:`${pm}__actions`,children:[(0,h.jsx)(fJ,{allowCreate:!1!==r,baseClass:pm,buttonStyle:"none",className:`${pm}__add-new${N?"-polymorphic":" doc-drawer__toggler"}`,collections:x.collections,i18n:C,icon:N?"plus":void 0,label:C.t("fields:addNew"),onClick:N?T:F,permissions:D,relationTo:b}),(0,h.jsx)(sl,{"aria-controls":`${pm}-columns`,"aria-expanded":_,className:`${pm}__toggle-columns ${_?`${pm}__buttons-active`:""}`,icon:(0,h.jsx)(nZ,{direction:_?"up":"down"}),onClick:()=>k(!_),pillStyle:"light",size:"small",children:j("general:columns")})]})]}),n,B?(0,h.jsx)("p",{children:j("general:loading")}):(0,h.jsxs)(c.Fragment,{children:[U?.docs&&0===U.docs.length&&(0,h.jsx)(fq,{Actions:J?[(0,h.jsx)(fJ,{allowCreate:J,baseClass:pm,collections:x.collections,i18n:C,label:C.t("general:createNewLabel",{label:N?C.t("general:document"):m(E?.labels?.singular,C)}),onClick:N?T:F,permissions:D,relationTo:b},"create")]:[],Message:(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)("h3",{children:C.t("general:noResultsFound")}),(0,h.jsx)("p",{children:C.t("general:noResults",{label:N?C.t("general:documents"):m(E?.labels?.plural,C)})})]})}),U?.docs&&U.docs.length>0&&(0,h.jsx)(fY,{children:(0,h.jsx)(fh,{data:U,modifySearchParams:!1,onQueryChange:$,orderableFieldName:!l.orderable||Array.isArray(l.collection)?void 0:`_${l.collection}_${i.replaceAll(".","_")}_order`,query:Z,children:(0,h.jsxs)(fx,{collectionSlug:N?b[0]:b,columnState:H,LinkedCellOverride:(0,h.jsx)(ps,{currentDrawerID:A,onDrawerOpen:X}),children:[(0,h.jsx)(o5,{className:`${pm}__columns`,height:_?"auto":0,id:`${pm}-columns`,children:(0,h.jsx)("div",{className:`${pm}__columns-inner`,children:E&&(0,h.jsx)(fj,{collectionSlug:E.slug})})}),v,(0,h.jsx)(ph,{})]})})})]}),t,(0,h.jsx)(L,{initialData:u,onDelete:Q,onSave:Y})]})},pb="default"in fl.default?fl.default.default:fl.default,pv=({collectionSlug:e,config:t,docID:r,fields:n,segments:a})=>{let l=re(n,{keepPresentationalFields:!0}),i=a[0],o=l.find(e=>e.name===i);if(!o)return null;if("relationship"===o.type||"upload"===o.type){let t=r;return Array.isArray(o.relationTo)&&(t={relationTo:e,value:r}),{[o.name]:o.hasMany?[t]:t}}let s=a.slice(1,a.length);if("tab"===o.type||"group"===o.type&&_(o))return{[o.name]:pv({collectionSlug:e,config:t,docID:r,fields:o.fields,segments:s})};if("array"===o.type){let n=pv({collectionSlug:e,config:t,docID:r,fields:o.fields,segments:s});return n.id=pb().toHexString(),{[o.name]:[n]}}if("blocks"===o.type)for(let n of o.blockReferences??o.blocks){let a="string"==typeof n?t.blocksMap[n]:n,l=pv({collectionSlug:e,config:t,docID:r,fields:a.fields,segments:s});if(l)return l.id=pb().toHexString(),l.blockType=a.slug,{[o.name]:[l]}}},py=oH(e=>{let{field:t,field:{admin:{allowCreate:r,description:n},collection:a,label:l,localized:i,on:o,required:s},path:u}=e,{id:f,docConfig:p}=oD(),{config:m,getEntityConfig:g}=(0,d.c)(),{customComponents:{AfterInput:b,BeforeInput:v,Description:y,Error:x,Label:w}={},path:C,showError:j,value:S}=oz({potentiallyStalePath:u}),$=(0,c.useMemo)(()=>{if(!f)return null;let e=f;Array.isArray(t.targetField.relationTo)&&(e={relationTo:p.slug,value:e});let r=Array.isArray(a)?{}:{[o]:{equals:e}};return t.where?{and:[r,t.where]}:r},[f,a,t.targetField.relationTo,t.where,o,p?.slug]),_=(0,c.useMemo)(()=>{let e=g({collectionSlug:Array.isArray(t.collection)?t.collection[0]:t.collection});return pv({collectionSlug:p?.slug,config:m,docID:f,fields:e?.fields,segments:t.on.split(".")})},[g,t.collection,t.on,p?.slug,f,m]);return p?(0,h.jsxs)("div",{className:[oK,j&&"error","join"].filter(
47Boolean).join(" "),id:`field-${C?.replace(/\./g,"__")}`,children:[(0,h.jsx)(r7,{CustomComponent:x,Fallback:(0,h.jsx)(aX,{path:C,showError:j})}),(0,h.jsx)(pg,{AfterInput:b,allowCreate:"u">typeof f&&r,BeforeInput:v,disableTable:null===$,field:t,fieldPath:C,filterOptions:$,initialData:f&&S?S:{docs:[]},initialDrawerData:_,Label:(0,h.jsx)("h4",{style:{margin:0},children:w||(0,h.jsx)(iR,{label:l,localized:i,path:C,required:s})}),parent:"u">typeof f?{id:f,collectionSlug:p.slug,joinPath:C}:void 0,relationTo:a}),(0,h.jsx)(r7,{CustomComponent:y,Fallback:(0,h.jsx)(aQ,{description:n,path:C})})]}):null}),px=oH(e=>{let{field:t,field:{admin:{className:r,description:n,editorOptions:a,maxHeight:l}={},jsonSchema:i,label:o,localized:s,required:u},path:f,readOnly:p,validate:m}=e,{insertSpaces:g=d.k.insertSpaces,tabSize:b=d.k.tabSize}=a||{},v=(0,c.useCallback)(e=>{if(void 0!==e)return null===e?"":g?JSON.stringify(e,null,b):JSON.stringify(e,null,"	")},[b,g]),[y,x]=(0,c.useState)(),w=c.default.useRef("formState"),[C,j]=(0,c.useState)(Date.now()),{customComponents:{AfterInput:S,BeforeInput:$,Description:_,Error:k,Label:E}={},disabled:N,initialValue:P,path:T,setValue:D,showError:R,value:A}=oz({potentiallyStalePath:f,validate:(0,c.useCallback)((e,t)=>{if("function"==typeof m)return m(e,{...t,jsonError:y,required:u})},[m,u,y])}),O=c.default.useRef(v(A??P)),L=(0,c.useCallback)((e,t)=>{if(!i)return;t.languages.json.jsonDefaults.setDiagnosticsOptions({enableSchemaRequest:!0,schemas:[...t.languages.json.jsonDefaults.diagnosticsOptions.schemas||[],i],validate:!0});let r=i.uri,n=r.includes("?")?`${r}&${crypto.randomUUID?crypto.randomUUID():sh()}`:`${r}?${crypto.randomUUID?crypto.randomUUID():sh()}`;e.setModel(t.editor.createModel(v(A)||"","json",t.Uri.parse(n)))},[i,v,A]),M=(0,c.useCallback)(e=>{if(!(p||N)){w.current="internalEditor";try{D(e?JSON.parse(e):null),O.current=e,x(void 0)}catch(t){D(e||null),O.current=e,x(t)}}},[p,N,D]);(0,c.useEffect)(()=>{if("formState"===w.current){let e=v(A??P);e!==O.current&&(O.current=e,j(Date.now()))}w.current="formState"},[P,T,v,A]);let I=(0,c.useMemo)(()=>oq(t),[t]);return(0,h.jsxs)("div",{className:[oK,"json-field",r,R&&"error",(p||N)&&"read-only"].filter(
47Boolean).join(" "),style:I,children:[(0,h.jsx)(r7,{CustomComponent:E,Fallback:(0,h.jsx)(iR,{label:o,localized:s,path:T,required:u})}),(0,h.jsxs)("div",{className:`${oK}__wrap`,children:[(0,h.jsx)(r7,{CustomComponent:k,Fallback:(0,h.jsx)(aX,{message:y,path:T,showError:R})}),$,(0,h.jsx)(sP,{defaultLanguage:"json",maxHeight:l,onChange:M,onMount:L,options:a,readOnly:p||N,recalculatedHeightAt:C,value:O.current,wrapperProps:{id:`field-${T?.replace(/\./g,"__")}`}}),S]}),(0,h.jsx)(r7,{CustomComponent:_,Fallback:(0,h.jsx)(aQ,{description:n,path:T})})]})}),pw=oH(e=>{let{field:t,field:{admin:{className:r,description:n,placeholder:a,step:l=1}={},hasMany:i=!1,label:o,localized:s,max:u=1/0,maxRows:d=1/0,min:p=-1/0,required:g},onChange:b,path:v,readOnly:y,validate:x}=e,{i18n:w,t:C}=(0,f.d)(),{customComponents:{AfterInput:j,BeforeInput:S,Description:$,Error:_,Label:k}={},disabled:E,path:N,setValue:P,showError:T,value:D}=oz({potentiallyStalePath:v,validate:(0,c.useCallback)((e,t)=>{if("function"==typeof x)return x(e,{...t,max:u,min:p,required:g})},[x,p,u,g])}),R=(0,c.useCallback)(e=>{let t=parseFloat(e.target.value),r=t;Number.isNaN(t)&&(r=null),"function"==typeof b&&b(r),P(r)},[b,P]),[A,O]=(0,c.useState)([]),L=(0,c.useCallback)(e=>{!(y||E)&&P(e?Array.isArray(e)?e.map(e=>Number(e.value?.value||e.value)):[Number(e.value?.value||e.value)]:[])},[y,E,P]);(0,c.useEffect)(()=>{i&&Array.isArray(D)&&O(D.map((e,t)=>({id:`${e}${t}`,label:`${e}`,value:{toString:()=>`${e}${t}`,value:e?.value||e}})))},[D,i]);let M=(0,c.useMemo)(()=>oq(t),[t]),I=m(a,w);return(0,h.jsxs)("div",{className:[oK,"number",r,T&&"error",(y||E)&&"read-only",i&&"has-many"].filter(Boolean).join(" "),style:M,children:[(0,h.jsx)(r7,{CustomComponent:k,Fallback:(0,h.jsx)(iR,{label:o,localized:s,path:N,required:g})}),(0,h.jsxs)("div",{className:`${oK}__wrap`,children:[(0,h.jsx)(r7,{CustomComponent:_,Fallback:(0,h.jsx)(aX,{path:N,showError:T})}),S,i?(0,h.jsx)(d0,{className:`field-${N.replace(/\./g,"__")}`,disabled:y||E,filterOption:(e,t)=>{let r=Array.isArray(D)&&D.length>=d;return rb(t)&&!r},isClearable:!0,isCreatable:!0,isMulti:!0,isSortable:!0,noOptionsMessage:()=>Array.isArray(D)&&D.length>=d?C("validation:limitReached",{max:d,value:D.length+1}):null,onChange:L,options:[],placeholder:I,showError:T,value:A}):(0,h.jsx)("div",{children:(0,h.jsx)("input",{disabled:y||E,id:`field-${N.replace(/\./g,"__")}`,max:u,min:p,name:N,onChange:R,onWheel:e=>{e.target.blur()},placeholder:I,step:l,type:"number",value:"number"==typeof D?D:""})}),j,(0,h.jsx)(r7,{CustomComponent:$,Fallback:(0,h.jsx)(aQ,{description:n,path:N})})]})]})}),pC="point",pj=oH(e=>{let{field:t,field:{admin:{className:r,description:n,placeholder:a,step:l}={},label:i,localized:o,required:s},path:u,readOnly:d,validate:p}=e,{i18n:g,t:b}=(0,f.d)(),{customComponents:{AfterInput:v,BeforeInput:y,Description:x,Error:w,Label:C}={},disabled:j,path:S,setValue:$,showError:_,value:k=[null,null]}=oz({potentiallyStalePath:u,validate:(0,c.useCallback)((e,t)=>{if("function"==typeof p)return p(e,{...t,required:s})},[p,s])}),E=(0,c.useCallback)((e,t)=>{let r=parseFloat(e.target.value);Number.isNaN(r)&&(r=e.target.value);let n=[...k];n[t]=r,$(n)},[$,k]),N=e=>{let t=b("longitude"===e?"fields:longitude":"fields:latitude"),r=i?m(i,g):"";return`${r}${r?" - ":""}${t}`},P=(0,c.useMemo)(()=>oq(t),[t]);return(0,h.jsxs)("div",{className:[oK,pC,r,_&&"error",(d||j)&&"read-only"].filter(
47Boolean).join(" "),style:P,children:[(0,h.jsxs)("ul",{className:`${pC}__wrap`,children:[(0,h.jsxs)("li",{children:[(0,h.jsx)(r7,{CustomComponent:C,Fallback:(0,h.jsx)(iR,{label:N("longitude"),localized:o,path:S,required:s})}),(0,h.jsxs)("div",{className:"input-wrapper",children:[y,(0,h.jsx)("input",{disabled:d||j,id:`field-longitude-${S?.replace(/\./g,"__")}`,name:`${S}.longitude`,onChange:e=>E(e,0),placeholder:m(a,g),step:l,type:"number",value:k&&"number"==typeof k[0]?k[0]:""}),v]})]}),(0,h.jsxs)("li",{children:[(0,h.jsx)(r7,{CustomComponent:C,Fallback:(0,h.jsx)(iR,{label:N("latitude"),localized:o,path:S,required:s})}),(0,h.jsxs)("div",{className:"input-wrapper",children:[(0,h.jsx)(r7,{CustomComponent:w,Fallback:(0,h.jsx)(aX,{path:S,showError:_})}),y,(0,h.jsx)("input",{disabled:d||j,id:`field-latitude-${S?.replace(/\./g,"__")}`,name:`${S}.latitude`,onChange:e=>E(e,1),placeholder:m(a,g),step:l,type:"number",value:k&&"number"==typeof k[1]?k[1]:""}),v]})]})]}),(0,h.jsx)(r7,{CustomComponent:x,Fallback:(0,h.jsx)(aQ,{description:n,path:S})})]})}),pS="radio-input",p$=e=>{let t,r=(0,v.c)(16),{isSelected:n,onChange:a,option:l,path:i,readOnly:o,uuid:s}=e,{i18n:c}=(0,f.d)(),u=a0(),d=`field-${i}-${l.value}${u>1?`-${u}`:""}${s?`-${s}`:""}`,p=n&&`${pS}--is-selected`,g;r[0]!==p?(g=[pS,p].filter(Boolean),r[0]=p,r[1]=g):g=r[1];let b=g.join(" "),y;if(r[2]!==a||r[3]!==l.value?(y=()=>"function"==typeof a?a(l.value):null,r[2]=a,r[3]=l.value,r[4]=y):y=r[4],r[5]!==c||r[6]!==d||r[7]!==n||r[8]!==l.label||r[9]!==i||r[10]!==o||r[11]!==b||r[12]!==y){let e=(0,h.jsx)("input",{checked:n,disabled:o,id:d,name:i,onChange:y,type:"radio"}),a=o&&`${pS}__styled-radio--disabled`,s;r[14]!==a?(s=[`${pS}__styled-radio`,a].filter(Boolean),r[14]=a,r[15]=s):s=r[15],t=(0,h.jsx)("label",{htmlFor:d,children:(0,h.jsxs)("div",{className:b,children:[e,(0,h.jsx)("span",{className:s.join(" ")}),(0,h.jsx)("span",{className:`${pS}__label`,children:m(l.label,c)})]})}),r[5]=c,r[6]=d,r[7]=n,r[8]=l.label,r[9]=i,r[10]=o,r[11]=b,r[12]=y,r[13]=t}else t=r[13];return t},p_="radio-group",pk=oH(e=>{let{disableModifyingForm:t,field:r,field:{admin:{className:n,description:a,layout:l="horizontal"}={},label:i,localized:o,options:s=[],required:u}={},onChange:d,path:f,readOnly:p,validate:m,value:g}=e,{uuid:b}=nm(),{customComponents:{AfterInput:v,BeforeInput:y,Description:w,Error:C,Label:j}={},disabled:S,path:$,setValue:_,showError:k,value:E}=oz({potentiallyStalePath:f,validate:(0,c.useCallback)((e,t)=>{if("function"==typeof m)return m(e,{...t,options:s,required:u})},[m,s,u])}),N=E||g,P=(0,c.useMemo)(()=>oq(r),[r]);return(0,h.jsxs)("div",{className:[oK,p_,n,`${p_}--layout-${l}`,k&&"error",(p||S)&&`${p_}--read-only`].filter(Boolean).join(" "),style:P,children:[(0,h.jsx)(r7,{CustomComponent:C,Fallback:(0,h.jsx)(aX,{path:$,showError:k})}),(0,h.jsx)(r7,{CustomComponent:j,Fallback:(0,h.jsx)(iR,{label:i,localized:o,path:$,required:u})}),(0,h.jsxs)("div",{className:`${oK}__wrap`,children:[y,(0,h.jsx)("ul",{className:`${p_}--group`,id:`field-${$.replace(/\./g,"__")}`,children:s.map(e=>{let r="",n=String(r=x(e)?e.value:e)===String(N),a=`field-${$}-${r}${b?`-${b}`:""}`;return(0,h.jsx)("li",{children:(0,h.jsx)(p$,{id:a,isSelected:n,onChange:()=>{"function"==typeof d&&d(r),p||S||_(r,!!t)},option:x(e)?e:{label:e,value:e},path:$,readOnly:p||S,uuid:b})},`${$} - ${r}`)})}),v,(0,h.jsx)(r7,{CustomComponent:w,Fallback:(0,h.jsx)(aQ,{description:a,path:$})})]})]})}),pE="relationship-add-new",pN=e=>{let t,r,n,a,l,i,o=(0,v.c)(46),{Button:s,hasMany:u,onChange:d,path:p,relationTo:g,unstyled:b,value:y}=e,x=fS(g),{permissions:w}=iS(),[C,j]=(0,c.useState)(!1),[S,$]=(0,c.useState)(),_=x.length>1,k;o[0]!==x[0]||o[1]!==_?(k=()=>_?void 0:x[0],o[0]=x[0],o[1]=_,o[2]=k):k=o[2];let[E,N]=(0,c.useState)(k),[P,T]=(0,c.useState)(!1),{i18n:D,t:R}=(0,f.d)(),[A,O]=(0,c.useState)(!1),L=E?.slug,M;o[3]!==L?(M={collectionSlug:L},o[3]=L,o[4]=M):M=o[4];let[I,F,B]=fV(M),{isDrawerOpen:z,toggleDrawer:U}=B,V;o[5]!==E||o[6]!==u||o[7]!==d||o[8]!==y?(V=e=>{let{doc:t,operation:r}=e;("create"===r||"update"===r&&rx(E))&&(y&&(Array.isArray(y)?y.some(e=>e&&e.value===t.id):y.value===t.id)||d(!0===u?[...Array.isArray(y)?y:[],{relationTo:E?.slug,value:t.id}]:{relationTo:E?.slug,value:t.id}),$(void 0))},o[5]=E,o[6]=u,o[7]=d,o[8]=y,o[9]=V):V=o[9];let H=V,q;o[10]===Symbol.for("react.memo_cache_sentinel")?(q=e=>{T(e)},o[10]=q):q=o[10];let K=q,W,G;o[11]!==w||o[12]!==x?(W=()=>{w&&(1===x.length?j(w.collections[x[0]?.slug]?.create):j(x.some(e=>w.collections[e?.slug]?.create)))},G=[w,x],o[11]=w,o[12]=x,o[13]=W,o[14]=G):(W=o[13],G=o[14]),(0,c.useEffect)(W,G),o[15]!==x||o[16]!==_||o[17]!==S?(r=()=>{_&&S&&N(x.find(e=>e?.slug===S))},t=[S,_,x],o[15]=x,o[16]=_,o[17]=S,o[18]=t,o[19]=r):(t=o[18],r=o[19]),(0,c.useEffect)(r,t),o[20]!==E||o[21]!==_||o[22]!==U?(n=()=>{_&&E&&(U(),$(void 0))},a=[U,_,E],o[20]=E,o[21]=_,o[22]=U,o[23]=n,o[24]=a):(n=o[23],a=o[24]),(0,c.useEffect)(n,a),o[25]!==z||o[26]!==_?
47(l=()=>{_&&!z&&N(void 0)},i=[z,_],o[25]=z,o[26]=_,o[27]=l,o[28]=i):(l=o[27],i=o[28]),(0,c.useEffect)(l,i);let Y=x[0]?.labels.singular,Q,X;if(o[29]!==s||o[30]!==I||o[31]!==F||o[32]!==E||o[33]!==D||o[34]!==H||o[35]!==p||o[36]!==w||o[37]!==P||o[38]!==x||o[39]!==C||o[40]!==A||o[41]!==R||o[42]!==Y||o[43]!==b){X=Symbol.for("react.early_return_sentinel");e:{let e=R("fields:addNewLabel",{label:m(Y,D)});if(!C){X=null;break e}Q=(0,h.jsxs)("div",{className:pE,id:`${p}-add-new`,children:[1===x.length&&(0,h.jsxs)(c.Fragment,{children:[(0,h.jsx)(F,{className:[`${pE}__add-button`,b&&`${pE}__add-button--unstyled`].filter(Boolean).join(" "),onClick:()=>{O(!1)},onMouseEnter:()=>O(!0),onMouseLeave:()=>O(!1),children:s||(0,h.jsxs)(c.Fragment,{children:[(0,h.jsx)(ao,{className:`${pE}__tooltip`,show:A,children:e}),(0,h.jsx)(n2,{})]})}),(0,h.jsx)(I,{onSave:H})]}),x.length>1&&(0,h.jsxs)(c.Fragment,{children:[(0,h.jsx)(al,{button:s||(0,h.jsx)(au,{buttonStyle:"none",className:`${pE}__add-button`,tooltip:P?void 0:R("fields:addNew"),children:(0,h.jsx)(n2,{})}),buttonType:"custom",horizontalAlign:"center",onToggleOpen:K,render:e=>{let{close:t}=e;return(0,h.jsx)(n7,{children:x.map(e=>w.collections[e?.slug]?.create?(0,h.jsx)(n9,{className:`${pE}__relation-button--${e?.slug}`,onClick:()=>{t(),$(e?.slug)},children:m(e?.labels?.singular,D)},e?.slug):null)})},size:"medium"}),E&&w.collections[E?.slug]?.create&&(0,h.jsx)(I,{onSave:H})]})]})}o[29]=s,o[30]=I,o[31]=F,o[32]=E,o[33]=D,o[34]=H,o[35]=p,o[36]=w,o[37]=P,o[38]=x,o[39]=C,o[40]=A,o[41]=R,o[42]=Y,o[43]=b,o[44]=Q,o[45]=X}else Q=o[44],X=o[45];return X!==Symbol.for("react.early_return_sentinel")?X:Q},pP=({allowCreate:e=!0,collectionSlugs:t,disableQueryPresets:r,drawerSlug:n,enableRowSelections:a,filterOptions:l,onBulkSelect:i,onSelect:o,overrideEntityVisibility:s=!0,selectedCollection:u})=>{let{closeModal:f,isModalOpen:p}=lc(),{serverFunction:m}=fg(),[g,b]=(0,c.useState)(void 0),[v,y]=(0,c.useState)(!0),{config:{collections:x},getEntityConfig:w}=(0,d.c)(),C=p(n),j=x.filter(({slug:e})=>t.includes(e)),[S,$]=(0,c.useState)(()=>{let e=w({collectionSlug:u||j[0]?.slug});return e?{label:e.labels,value:e.slug}:void 0}),[_,k,{drawerSlug:E}]=fV({collectionSlug:S.value}),N=ae(e=>{e&&e!==S?.value&&$({label:w({collectionSlug:e})?.labels,value:e})});(0,c.useEffect)(()=>{N(u)},[u]);let P=(0,c.useCallback)(async({slug:e,query:t})=>{try{let i={...t||{},where:{...t?.where||{}}},o=l?.[e];if(l&&"boolean"!=typeof o&&(i.where=rr(i.where,o)),e){let t=await m({name:"render-list",args:{collectionSlug:e,disableBulkDelete:!0,disableBulkEdit:!0,disableQueryPresets:r,drawerSlug:n,enableRowSelections:a,overrideEntityVisibility:s,query:i}});b(t?.List||null)}else b(null);y(!1)}catch(e){console.error("Error rendering List View: ",e),C&&f(n)}},[m,f,n,C,a,l,s,r]);(0,c.useEffect)(()=>{g||P({slug:S?.value})},[P,g,S.value]);let T=(0,c.useCallback)(({doc:e})=>{"function"==typeof o&&o({collectionSlug:S?.value,doc:e,docID:e.id}),f(E),f(n)},[f,E,n,o,S.value]),D=(0,c.useCallback)(e=>{P({slug:S?.value,query:e})},[P,S.value]),R=(0,c.useCallback)(e=>{$(e),P({slug:e?.value})},[P]),A=(0,c.useCallback)(async e=>{e&&$({label:w({collectionSlug:e})?.labels,value:e}),await P({slug:S.value||e})},[w,P,S.value]);return v?(0,h.jsx)(fD,{}):(0,h.jsxs)(fo,{allowCreate:e,createNewDrawerSlug:E,DocumentDrawerToggler:k,drawerSlug:n,enabledCollections:t,onBulkSelect:i,onQueryChange:D,onSelect:o,refresh:A,selectedOption:S,setSelectedOption:R,children:[g,(0,h.jsx)(_,{onSave:T})]})},pT="list-drawer",pD=({children:e,className:t,disabled:r,drawerSlug:n,onClick:a,...l})=>(0,h.jsx)(id,{className:[t,`${pT}
47__toggler`].filter(Boolean).join(" "),disabled:r,onClick:a,slug:n,...l,children:e}),pR=e=>{let{drawerSlug:t}=e;return(0,h.jsx)(ip,{className:pT,gutter:!1,Header:null,slug:t,children:(0,h.jsx)(pP,{...e})})},pA=e=>{let t,r,n,a=(0,v.c)(42),{collectionSlugs:l,filterOptions:i,selectedCollection:o,uploads:s}=e,{config:u}=(0,d.c)(),{collections:f}=u,p=a0(),m=(0,c.useId)(),{closeModal:g,modalState:b,openModal:y,toggleModal:x}=lc(),[w,C]=(0,c.useState)(!1),[j,S]=(0,c.useState)(l),$;a[0]!==p||a[1]!==m?($=(({depth:e,uuid:t})=>`list-drawer_${e}_${t}`)({depth:p,uuid:m}),a[0]=p,a[1]=m,a[2]=$):$=a[2];let _=$,k,E;a[3]!==_||a[4]!==b?(k=()=>{C(!!b[_]?.isOpen)},E=[b,_],a[3]=_,a[4]=b,a[5]=k,a[6]=E):(k=a[5],E=a[6]),(0,c.useEffect)(k,E),a[7]!==j||a[8]!==f||a[9]!==s?(t=()=>{j&&0!==j.length||S(f.filter(e=>{let{upload:t}=e;return!s||!!t}).map(pO))},r=[j,s,f],a[7]=j,a[8]=f,a[9]=s,a[10]=t,a[11]=r):(t=a[10],r=a[11]),(0,c.useEffect)(t,r),a[12]!==_||a[13]!==x?(n=()=>{x(_)},a[12]=_,a[13]=x,a[14]=n):n=a[14];let N=n,P;a[15]!==g||a[16]!==_?(P=()=>{g(_)},a[15]=g,a[16]=_,a[17]=P):P=a[17];let T=P,D;a[18]!==_||a[19]!==y?(D=()=>{y(_)},a[18]=_,a[19]=y,a[20]=D):D=a[20];let R=D,A;a[21]!==T||a[22]!==j||a[23]!==_||a[24]!==i||a[25]!==o||a[26]!==s?(A=e=>(0,c.createElement)(pR,{...e,closeDrawer:T,collectionSlugs:j,drawerSlug:_,filterOptions:i,key:_,selectedCollection:o,uploads:s}),a[21]=T,a[22]=j,a[23]=_,a[24]=i,a[25]=o,a[26]=s,a[27]=A):A=a[27];let O=A,L;a[28]!==_?(L=e=>(0,h.jsx)(pD,{...e,drawerSlug:_}),a[28]=_,a[29]=L):L=a[29];let M=L,I;a[30]!==T||a[31]!==j||a[32]!==p||a[33]!==_||a[34]!==w||a[35]!==R||a[36]!==N?(I={closeDrawer:T,collectionSlugs:j,drawerDepth:p,drawerSlug:_,isDrawerOpen:w,openDrawer:R,setCollectionSlugs:S,toggleDrawer:N},a[30]=T,a[31]=j,a[32]=p,a[33]=_,a[34]=w,a[35]=R,a[36]=N,a[37]=I):I=a[37];let F=I,B;return a[38]!==O||a[39]!==F||a[40]!==M?(B=[O,M,F],a[38]=O,a[39]=F,a[40]=M,a[41]=B):B=a[41],B};function pO(e){let{slug:t}=e;return t}var pL=(e,t)=>{let r=(0,v.c)(3),n=(0,c.useRef)(void 0),a;return r[0]!==e||r[1]!==t?(a=(...r)=>{clearTimeout(n.current),n.current=setTimeout(()=>{clearTimeout(n.current),e(...r)},t)},r[0]=e,r[1]=t,r[2]=a):a=r[2],a};function pM(){let e=(0,c.useRef)([]),t=(0,c.useRef)(!1);return{queueTask:(0,c.useCallback)((r,n)=>{e.current.push(r),async function(){if(!t.current&&("function"!=typeof n?.beforeProcess||!1!==n.beforeProcess()))for(;e.current.length>0;){let r=e.current.pop();e.current=[],t.current=!0;try{await r()}catch(e){console.error("Error in queued function:",e)}finally{t.current=!1,"function"==typeof n?.afterProcess&&n.afterProcess()}}}()},[])}}
47var pI=(0,c.createContext)({mostRecentUpdate:null,reportUpdate:()=>null}),pF=e=>{let t=(0,v.c)(3),{children:r}=e,[n,a]=(0,c.useState)(null),l;return t[0]!==r||t[1]!==n?(l=(0,h.jsx)(pI,{value:{mostRecentUpdate:n,reportUpdate:a},children:r}),t[0]=r,t[1]=n,t[2]=l):l=t[2],l},pB=()=>(0,c.use)(pI),pz=e=>{for(let t in e){let r=e[t];if(("and"===t.toLowerCase()||"or"===t.toLowerCase())&&Array.isArray(r))for(let e of r)pz(e);else r&&"object"==typeof r&&"in"in r&&Array.isArray(r.in)&&0===r.in.length&&(e[t]={exists:!1})}return e},pU=({hasMany:e,relationTo:t,value:r})=>{let n=t.reduce((e,t)=>({...e,[t]:[]}),{});if(null===r)return n;if(r){let t=(e,t)=>{("string"==typeof t||"number"==typeof t)&&"string"==typeof e&&(n[e]?n[e].push(t):n[e]=[t])};!0===e?r.forEach(e=>{e&&t(e.relationTo,e.value)}):t(r.relationTo,r.value)}return n},pV=e=>e.reduce((e,t)=>t.options?[...e,...pV(t.options)]:[...e,{id:t.value,relationTo:t.relationTo}],[]),pH=e=>e.sort((e,t)=>"function"==typeof e?.label?.localeCompare&&"function"==typeof t?.label?.localeCompare?e.label.localeCompare(t.label):0),pq=(e,t)=>{switch(t.type){case"ADD":{let{collection:r,config:n,docs:a,i18n:l,ids:i=[],sort:o}=t,s=r.slug,c=pV(e),u=[...e],d=u.find(e=>e.label===r.labels.plural),f=a.reduce((e,t)=>0===c.filter(e=>e.id===t.id&&e.relationTo===s).length?(c.push({id:t.id,relationTo:s}),[...e,{label:oy({collectionConfig:r,data:t,dateFormat:n.admin.dateFormat,fallback:`${l.t("general:untitled")} - ID: ${t.id}`,i18n:l}),relationTo:s,value:t.id}]):e,[]);if(i.forEach(e=>{0===c.filter(t=>t.id===e&&t.relationTo===s).length&&(c.push({id:e,relationTo:s}),f.push({allowEdit:!1,label:`${l.t("general:untitled")} - ID: ${e}`,relationTo:s,value:e}))}),d){let e=[...d.options,...f];d.options=o?pH(e):e}else u.push({label:m(r.labels.plural,l),options:o?pH(f):f});return u}case"CLEAR":{let r=t.exemptValues?Array.isArray(t.exemptValues)?t.exemptValues:[t.exemptValues]:[];return e.filter(e=>{let t=e.options.filter(e=>!!r&&r.some(t=>t&&e.value===t.value));return e.options=t,t.length>0})}case"REMOVE":{let{id:r,collection:n}=t,a=[...e],l=a.findIndex(e=>e.label===n.labels.plural);return -1===l||(a[l]={...a[l],options:a[l].options.filter(e=>e.value!==r)}),a}case"UPDATE":{let{collection:r,config:n,doc:a,i18n:l}=t,i=r.slug,o=[...e],s=oy({collectionConfig:r,data:a,dateFormat:n.admin.dateFormat,fallback:`${l.t("general:untitled")} - ID: ${a.id}`,i18n:l}),c=o.find(e=>e.label===r.labels.plural)?.options?.find(e=>e.value===a.id);return c&&(c.label=s,c.relationTo=i),o}default:return e}},pK="relationship--multi-value-label",pW=e=>{let{data:t,selectProps:r}=e,{allowEdit:n,label:a,relationTo:l,value:i}=t,{customProps:o}=void 0===r?{}:r,{draggableProps:s,onDocumentOpen:u}=void 0===o?{}:o,{permissions:d}=iS(),[p,m]=(0,c.useState)(!1),{t:g}=(0,f.d)(),b=!!d?.collections?.[l]?.read;return(0,h.jsxs)("div",{className:pK,title:a||"",children:[(0,h.jsx)("div",{className:`${pK}__content`,children:(0,h.jsx)(uA.MultiValueLabel,{...e,innerProps:{className:`${pK}__text`,...s||{}}})}),l&&b&&!1!==n&&(0,h.jsx)(c.Fragment,{children:(0,h.jsxs)("button",{"aria-label":`Edit ${a}`,className:`${pK}__drawer-toggler`,onClick:e=>{m(!1),u({id:i,collectionSlug:l,hasReadPermission:b,openInNewTab:e.metaKey||e.ctrlKey})},onKeyDown:pG,onMouseDown:pY,onMouseEnter:()=>m(!0),onMouseLeave:()=>m(!1),onTouchEnd:pQ,type:"button",children:[(0,h.jsx)(ao,{className:`${pK}__tooltip`,show:p,children:g("general:editLabel",{label:""})}),(0,h.jsx)(n0,{className:`${pK}__icon`})]})})]})};function pG(e){"Enter"===e.key&&e.stopPropagation()}function pY(e){return e.stopPropagation()}function pQ(e){return e.stopPropagation()}var pX="relationship--single-value",pJ=e=>{let t=(0,v.c)(16),{children:r,data:n,selectProps:a}=e,{allowEdit:l,label:i,relationTo:o,value:s}=n,u;t[0]!==a?(u=void 0===a?{}:a,t[0]=a,t[1]=u):u=t[1];let{customProps:d}=u,p;t[2]!==d?(p=void 0===d?{}:d,t[2]=d,t[3]=p):p=t[3];let{onDocumentOpen:m}=p,[g,b]=(0,c.useState)(!1),{t:y}=(0,f.d)(),{permissions:x}=iS(),w=!!x?.collections?.[o]?.read,C=i||"",j;return t[4]!==l||t[5]!==r||t[6]!==w||t[7]!==i||t[8]!==m||t[9]!==e||t[10]!==o||t[11]!==g||t[12]!==y||t[13]!==C||t[14]!==s?(j=(0,h.jsx)(uA.SingleValue,{...e,className:pX,children:(0,h.jsx)("div",{className:`${pX}__label`,title:C,children:(0,h.jsxs)("div",{className:`${pX}__label-text`,children:[(0,h.jsx)("div",{className:`${pX}__text`,children:r}),o&&w&&!1!==l&&(0,h.jsx)(c.Fragment,{children:(0,h.jsxs)("button",{"aria-label":y("general:editLabel",{label:i}),className:`${pX}__drawer-toggler`,onClick:e=>{b(!1),m({id:s,collectionSlug:o,hasReadPermission:w,openInNewTab:e.metaKey||e.ctrlKey})},onKeyDown:pZ,onMouseDown:p0,onMouseEnter:()=>b(!0),onMouseLeave:()=>b(!1),onTouchEnd:p1,type:"button",children:[(0,h.jsx)(ao,{className:`${pX}__tooltip`,show:g,children:y("general:edit")}),(0,h.jsx)(n0,{})]})})]})})}),t[4]=l,t[5]=r,t[6]=w,t[7]=i,t[8]=m,t[9]=e,t[10]=o,t[11]=g,t[12]=y,t[13]=C,t[14]=s,t[15]=j):j=t[15],j};function pZ(e){"Enter"===e.key&&e.stopPropagation()}function p0(e){return e.stopPropagation()}function p1(e){return e.stopPropagation()}var p2="relationship",p3=e=>{let{AfterInput:t,allowCreate:r=!0,allowEdit:n=!0,appearance:a="select",BeforeInput:l,className:i,description:o,Description:s,Error:u,filterOptions:p,formatDisplayedOptions:m,hasMany:g,initialValue:b,isSortable:v=!0,label:y,Label:x,localized:w,maxResultsPerRequest:C=10,onChange:j,path:S,placeholder:$,readOnly:_,relationTo:k,required:E,showError:N,sortOptions:P,style:T,value:D}=e,{config:R,getEntityConfig:A}=(0,d.c)(),{routes:{api:O},serverURL:L}=R,{i18n:M,t:I}=(0,f.d)(),{permissions:F}=iS(),{code:B}=iP(),[z,U]=(0,c.useState)({id:void 0,collectionSlug:void 0,hasReadPermission:!1}),[V,H]=(0,c.useState)(-1),[q,K]=(0,c.useState)({}),[W,G]=(0,c.useState)(""),[Y,Q]=(0,c.useState)(""),[X,J]=(0,c.useState)(!1),[Z,ee]=(0,c.useState)(!1),[et,er]=(0,c.useState)(!1),en=(0,c.useRef)(!1),{queueTask:ea}=pM(),[el,ei]=(0,c.useReducer)(pq,[]),eo=(0,c.useRef)(D),[es,,{drawerSlug:ec,isDrawerOpen:eu,openDrawer:ed}]=fV({id:z.id,collectionSlug:z.collectionSlug}),ef=(0,c.useMemo)(()=>{let e=p;if(D){let t=(!1===g?[D]:D).reduce((e,t)=>
47(e[t.relationTo]||(e[t.relationTo]=[]),e[t.relationTo].push(t.value),e),{});(Array.isArray(k)?k:[k]).forEach(r=>{e={...e||{},[r]:{..."object"==typeof p?.[r]?p[r]:{},...t[r]?{id:{not_in:t[r]}}:{}}}})}return e},[p,D,g,k]),[ep,,{closeDrawer:eh,isDrawerOpen:em,openDrawer:eg}]=pA({collectionSlugs:k,filterOptions:ef}),eb=(0,c.useCallback)(({collectionSlug:e,doc:t})=>{g?j([...Array.isArray(D)?D:[],{relationTo:e,value:t.id}]):!1===g&&j({relationTo:e,value:t.id}),eh()},[g,j,eh,D]),ev=(0,c.useRef)(!1),ey=(0,c.useCallback)(({filterOptions:e,hasMany:t,lastFullyLoadedRelation:r,lastLoadedPage:n,onSuccess:a,search:l,sort:i,value:o})=>{F&&ea(async()=>{let s="u">typeof r?r:-1,c=Array.isArray(k)?k:[k],u=-1===s?c:c.slice(s+1),d=0,f=pU(!0===t?{hasMany:!0,relationTo:k,value:o}:{hasMany:!1,relationTo:k,value:o});W||(await u.reduce(async(t,r)=>{let a=e?.[r],o;if(o=Y!==l?1:(n[r]||0)+1,await t,!1===a)return H(c.indexOf(r)),Promise.resolve();if(d<10){let e=A({collectionSlug:r}),t=e?.admin?.useAsTitle||"id",n=e?.defaultSort||"id";"string"==typeof P?n=P:P?.[r]&&(n=P[r]);let s={depth:0,draft:!0,limit:C,locale:B,page:o,select:{[t]:!0},sort:n,where:{and:[{id:{not_in:f[r]}}]}};l&&s.where.and.push({[t]:{like:l}}),a&&"boolean"!=typeof a&&s.where.and.push(a),pz(s.where);let u=await fetch(tR({apiRoute:O,path:`/${r}`}),{body:t6(s),credentials:"include",headers:{"Accept-Language":M.language,"Content-Type":"application/x-www-form-urlencoded","X-Payload-HTTP-Method-Override":"GET"},method:"POST"});if(u.ok){let t=await u.json();K(e=>({...e,[r]:o})),t.nextPage||H(c.indexOf(r)),t.docs.length>0&&(d+=t.docs.length,ei({type:"ADD",collection:e,config:R,docs:t.docs,i18n:M,sort:i}))}else 403===u.status?(H(c.indexOf(r)),ei({type:"ADD",collection:e,config:R,docs:[],i18n:M,ids:f[r],sort:i})):G(I("error:unspecific"))}},Promise.resolve()),"function"==typeof a&&a())})},[F,ea,k,W,Y,A,P,C,B,O,M,R,I]),ex=pL(({hasMany:e,search:t,value:r})=>{eN({filterOptions:p,lastLoadedPage:{},onSuccess:()=>{J(!1)},search:t,sort:!0,hasMany:e,value:r}),Q(t)},300),ew=(0,c.useCallback)(e=>{Y!==e.search&&(J(!0),K({}),ex(e))},[Y,ex]),eC=ae(({hasMany:e,value:t})=>{Object.entries(pU({hasMany:e,relationTo:k,value:t})).reduce(async(e,[t,r])=>{await e;let n=r.filter(e=>!el.find(r=>r?.options?.find(r=>r.value===e&&r.relationTo===t)));if(n.length>0){let e=A({collectionSlug:t}),r=e?.admin?.useAsTitle||"id",a={depth:0,draft:!0,limit:n.length,locale:B,select:{[r]:!0},where:{id:{in:n}}};if(!W){let r=await fetch(tR({apiRoute:O,path:`/${t}`}),{body:t6(a),credentials:"include",headers:{"Accept-Language":M.language,"Content-Type":"application/x-www-form-urlencoded","X-Payload-HTTP-Method-Override":"GET"},method:"POST"}),l=[];r.ok&&(l=(await r.json()).docs),ei({type:"ADD",collection:e,config:R,docs:l,i18n:M,ids:n,sort:!0})}}},Promise.resolve())}),{mostRecentUpdate:ej}=pB(),eS=ae(e=>{if(!D)return!1;let t=e.doc.id,r=!1;"update"===e.operation?!0===g?r=(Array.isArray(D)?D:[D]).some(r=>r.value===t&&r.relationTo===e.entitySlug):!1===g&&(r=D?.value===t&&D?.relationTo===e.entitySlug):"create"===e.operation&&(r=e.drawerSlug===ec),r&&((ei({type:"UPDATE",collection:A({collectionSlug:e.entitySlug}),config:R,doc:e.doc,i18n:M}),g)?j((D?Array.isArray(D)?D:[D]:[]).map(r=>({relationTo:r.value===t?e.entitySlug:r.relationTo,value:r.value}))):!1===g&&j({relationTo:e.entitySlug,value:t}))});(0,c.useEffect)(()=>{ej&&eS(ej)},[ej]);let e$=(0,c.useCallback)(e=>{ei({type:"ADD",collection:e.collectionConfig,config:R,docs:[e.doc],i18n:M,sort:!0}),g?j(D?D.concat({relationTo:e.collectionConfig.slug,value:e.doc.id}):null):!1===g&&j({relationTo:e.collectionConfig.slug,value:e.doc.id})},[M,R,g,j,D]),e_=(0,c.useCallback)(e=>{ei({id:e.id,type:"REMOVE",collection:e.collectionConfig,config:R,i18n:M}),j(g&&D?D.filter(t=>t.value!==e.id):null)},[M,R,g,j,D]),ek=(0,c.useCallback)((e,t)=>{let r;if(!t)return!0;let n=RegExp((r=(t||"").split(" ")).reduce((e,t,n)=>{let a=t.replace(/[\\^$*+?.()|[\]{}]/g,"\\$&");return`${e}(?=.*(?:(?:[^\\p{L}\\p{N}])|^).*${a}.*(?=[^\\p{L}\\p{N}]|$))${n+1===r.length?".+":""}`},""),"i"),a=String(e.label);for(;a.length>250;){let e=a.indexOf(" ",t.length);if(n.test(a.slice(0,-1===e?t.length:e+1)))return!0;a=a.slice(-1===e?t.length:e+1)}return n.test(a.slice(-250))},[]),eE=(0,c.useCallback)(({id:e,collectionSlug:t,hasReadPermission:r,openInNewTab:n})=>{if(n){if(r&&e&&t){let r=tR({adminRoute:R.routes.admin,path:`/collections/${t}/${e}`,serverURL:L});window.open(r,"_blank")}}else ev.current=!0,U({id:e,collectionSlug:t,hasReadPermission:r})},[R.routes.admin,L]),eN=ae(e=>ey(e));(0,c.useEffect)(()=>{en.current&&et&&(J(!0),eN({filterOptions:p,lastLoadedPage:{},onSuccess:()=>{en.current=!0,J(!1)},...{hasMany:g,value:eo.current}})),ei({type:"CLEAR",exemptValues:eo.current}),H(-1),K({})},[k,p,B,S,et,g]);let eP=(0,c.useRef)(D),eT=(0,c.useRef)(!0);(0,c.useEffect)(()=>{(eT.current||!t8(D,eP.current))&&eC({hasMany:g,value:D}),eT.current=!1,eP.current=D},[D,g]),(0,c.useEffect)(()=>{ee(!(Array.isArray(k)?k:[k]).reduce((e,t)=>
47"id"===(A({collectionSlug:t})?.admin?.useAsTitle||"id")&&e,!0))},[k,A]),(0,c.useEffect)(()=>{ev.current&&(ed(),ev.current=!1)},[ed,z]),(0,c.useEffect)(()=>{eo.current=D},[D]);let eD=(({allowEdit:e,options:t,value:r})=>{if(r||"number"==typeof r){let n;return Array.isArray(r)?r.map(r=>{let n;return t.forEach(e=>{n||(n=e.options.find(e=>e.value===r.value&&e.relationTo===r.relationTo))}),n?{allowEdit:e,...n}:void 0}):(t.forEach(e=>{n||(n=e.options.find(e=>e.value===r.value&&e.relationTo===r.relationTo))}),n?{allowEdit:e,...n}:void 0)}})({allowEdit:n,options:el,value:D});return Array.isArray(eD)||eD?.value!=="null"||(eD.value=null),(0,h.jsxs)("div",{className:[oK,p2,i,N&&"error",W&&"error-loading",_&&`${p2}--read-only`,!_&&r&&`${p2}--allow-create`].filter(Boolean).join(" "),id:`field-${S.replace(/\./g,"__")}`,style:T,children:[(0,h.jsx)(r7,{CustomComponent:x,Fallback:(0,h.jsx)(iR,{label:y,localized:w,path:S,required:E})}),(0,h.jsxs)("div",{className:`${oK}__wrap`,children:[(0,h.jsx)(r7,{CustomComponent:u,Fallback:(0,h.jsx)(aX,{path:S,showError:N})}),l,W?(0,h.jsx)("div",{className:`${p2}__error-loading`,children:W}):(0,h.jsxs)("div",{className:`${p2}__wrap`,children:[(0,h.jsx)(d0,{backspaceRemovesValue:!(eu||em),components:{MultiValueLabel:pW,SingleValue:pJ,..."select"!==a&&{DropdownIndicator:null}},customProps:{disableKeyDown:eu||em,disableMouseDown:eu||em,onDocumentOpen:eE},disabled:_||eu||em,filterOption:Z?ek:void 0,getOptionValue:e=>{if(e)return g&&Array.isArray(k)?`${e.relationTo}_${e.value}`:e.value},isLoading:"select"===a&&X,isMulti:g,isSearchable:"select"===a,isSortable:v,menuIsOpen:"select"===a&&et,onChange:_?void 0:e=>{g?null===e?(eo.current=[],j([])):(eo.current=e,j(e)):!1===g&&(null===e?(eo.current=null,j(null)):(eo.current=e,j(e)))},onInputChange:e=>ew({search:e,hasMany:g,value:D}),onMenuClose:()=>{er(!1)},onMenuOpen:()=>{"drawer"===a?eg():"select"===a&&(er(!0),en.current||(J(!0),eN({filterOptions:p,lastLoadedPage:{},onSuccess:()=>{en.current=!0,J(!1)},hasMany:g,value:D})))},onMenuScrollToBottom:()=>{J(!0),eN({filterOptions:p,lastFullyLoadedRelation:V,lastLoadedPage:q,onSuccess:()=>{J(!1)},search:Y,sort:!1,hasMany:g,value:b})},options:"function"==typeof m?m(el):el,placeholder:$,showError:N,value:eD??null}),!_&&r&&(0,h.jsx)(pN,{path:S,relationTo:k,hasMany:g,onChange:j,value:D})]}),t,(0,h.jsx)(r7,{CustomComponent:s,Fallback:(0,h.jsx)(aQ,{description:o,path:S})})]}),z.collectionSlug&&z.hasReadPermission&&(0,h.jsx)(es,{onDelete:e_,onDuplicate:e$}),"drawer"===a&&!_&&(0,h.jsx)(ep,{allowCreate:r,enableRowSelections:!1,onSelect:eb})]})},p6=oH(e=>{let{field:t,field:{admin:{allowCreate:r=!0,allowEdit:n=!0,appearance:a="select",className:l,description:i,isSortable:o=!0,placeholder:s,sortOptions:u}={},hasMany:d,label:f,localized:p,relationTo:m,required:g},path:b,readOnly:v,validate:y}=e,{customComponents:{AfterInput:x,BeforeInput:w,Description:C,Error:j,Label:S}={},disabled:$,filterOptions:_,initialValue:k,path:E,setValue:N,showError:P,value:T}=oz({potentiallyStalePath:b,validate:(0,c.useCallback)((e,t)=>{if("function"==typeof y)return y(e,{...t,required:g})},[y,g])}),D=(0,c.useMemo)(()=>oq(t),[t]),R=Array.isArray(m),[A]=c.default.useState(()=>Array.isArray(m)?m:[m]),O=(0,c.useCallback)(e=>{if(!e)return void N(null,e===T);let t=!1;t=R?Array.isArray(T)&&Array.isArray(e)&&T.length===e.length&&T.every((t,r)=>{let n=e[r];return t.value===n.value&&t.relationTo===n.relationTo}):Array.isArray(T)&&Array.isArray(e)&&T.length===e.length&&T.every((t,r)=>t===e[r].value),N(e.map(e=>R?e:e.value),t)},[R,N,T]),L=(0,c.useCallback)(e=>{if(!e)return void N(null,e===T);let t=!1;t=R?T&&e&&T.value===e.value&&T.relationTo===e.relationTo:T&&e&&T===e.value,N(R?e:e.value,t)},[R,N,T]),M=c.default.useMemo(()=>!0===d?Array.isArray(T)?T.map(e=>R?e:{relationTo:Array.isArray(A)?A[0]:A,value:e}):T:T&&(R?T:{relationTo:Array.isArray(A)?A[0]:A,value:T}),[d,T,R,A]),I=c.default.useMemo(()=>!0===d?Array.isArray(k)?k.map(e=>R?e:{relationTo:Array.isArray(A)?A[0]:A,value:e}):k:k&&(R?k:{relationTo:Array.isArray(A)?A[0]:A,value:k}),[k,R,A,d]);return(0,h.jsx)(p3,{AfterInput:x,allowCreate:r,allowEdit:n,appearance:a,BeforeInput:w,className:l,Description:C,description:i,Error:j,filterOptions:_,formatDisplayedOptions:R?void 0:e=>e.map(e=>e.options).flat(),isSortable:o,Label:S,label:f,localized:p,maxResultsPerRequest:10,maxRows:t?.maxRows,minRows:t?.minRows,path:E,placeholder:s,readOnly:v||$,relationTo:A,required:g,showError:P,sortOptions:u,style:D,...!0===d?{hasMany:!0,initialValue:I,onChange:O,value:M}:{hasMany:!1,initialValue:I,onChange:L,value:M}})}),p5=()=>null,p4=oH(e=>{let{field:{admin:{className:t,style:r}={},fields:n},forceRender:a=!1,indexPath:l="",parentPath:i="",parentSchemaPath:o="",permissions:s,readOnly:c}=e;return(0,h.jsx)(d8,{children:(0,h.jsx)("div",{className:[oK,"row",t].filter(
47Boolean).join(" "),style:r||void 0,children:(0,h.jsx)(gq,{className:"row__fields",fields:n,forceRender:a,margins:!1,parentIndexPath:l,parentPath:i,parentSchemaPath:o,permissions:s,readOnly:c})})})}),p8=e=>{let t=(0,v.c)(37),{id:r,AfterInput:n,BeforeInput:a,className:l,Description:i,description:o,Error:s,filterOption:c,hasMany:u,isClearable:d,isSortable:p,label:g,Label:b,localized:y,onChange:x,onInputChange:w,options:C,path:j,placeholder:S,readOnly:$,required:_,showError:k,style:E,value:N}=e,P=void 0!==u&&u,T=void 0===d||d,D=void 0===p||p,{i18n:R}=(0,f.d)(),A;if(t[0]!==n||t[1]!==a||t[2]!==i||t[3]!==s||t[4]!==b||t[5]!==l||t[6]!==o||t[7]!==c||t[8]!==P||t[9]!==R||t[10]!==r||t[11]!==T||t[12]!==D||t[13]!==g||t[14]!==y||t[15]!==x||t[16]!==w||t[17]!==C||t[18]!==j||t[19]!==S||t[20]!==$||t[21]!==_||t[22]!==k||t[23]!==E||t[24]!==N){let e,u;if(P&&Array.isArray(N)){let r;t[26]!==R||t[27]!==C?(r=e=>{let t=C.find(t=>t.value===e);return{label:t?m(t.label,R):e,value:t?.value??e}},t[26]=R,t[27]=C,t[28]=r):r=t[28],e=N.map(r)}else if(N){let r;t[29]!==N?(r=e=>e.value===N,t[29]=N,t[30]=r):r=t[30];let n=C.find(r);e={label:n?m(n.label,R):N,value:n?.value??N}}else e=null;let d=k&&"error",f=$&&"read-only",p;t[31]!==l||t[32]!==d||t[33]!==f?(p=[oK,"select",l,d,f].filter(Boolean),t[31]=l,t[32]=d,t[33]=f,t[34]=p):p=t[34],t[35]!==R?(u=e=>({...e,label:m(e.label,R)}),t[35]=R,t[36]=u):u=t[36],A=(0,h.jsxs)("div",{className:p.join(" "),id:`field-${j.replace(/\./g,"__")}`,style:E,children:[(0,h.jsx)(r7,{CustomComponent:b,Fallback:(0,h.jsx)(iR,{label:g,localized:y,path:j,required:_})}),(0,h.jsxs)("div",{className:`${oK}__wrap`,children:[(0,h.jsx)(r7,{CustomComponent:s,Fallback:(0,h.jsx)(aX,{path:j,showError:k})}),a,(0,h.jsx)(d0,{disabled:$,filterOption:c,id:r,isClearable:T,isMulti:P,isSortable:D,onChange:x,onInputChange:w,options:C.map(u),placeholder:S,showError:k,value:e}),n]}),(0,h.jsx)(r7,{CustomComponent:i,Fallback:(0,h.jsx)(aQ,{description:o,path:j})})]}),t[0]=n,t[1]=a,t[2]=i,t[3]=s,t[4]=b,t[5]=l,t[6]=o,t[7]=c,t[8]=P,t[9]=R,t[10]=r,t[11]=T,t[12]=D,t[13]=g,t[14]=y,t[15]=x,t[16]=w,t[17]=C,t[18]=j,t[19]=S,t[20]=$,t[21]=_,t[22]=k,t[23]=E,t[24]=N,t[25]=A}else A=t[25];return A},p7=e=>e.map(e=>"object"==typeof e&&(e.value||""===e.value)?e:{label:e,value:e}),p9=oH(e=>{let{field:t,field:{name:r,admin:{className:n,description:a,isClearable:l=!0,isSortable:i=!0,placeholder:o}={},hasMany:s=!1,label:u,localized:d,options:f=[],required:p},onChange:m,path:g,readOnly:b,validate:v}=e,y=c.default.useMemo(()=>p7(f),[f]),{customComponents:{AfterInput:x,BeforeInput:w,Description:C,Error:j,Label:S}={},disabled:$,path:_,selectFilterOptions:k,setValue:E,showError:N,value:P}=oz({potentiallyStalePath:g,validate:(0,c.useCallback)((e,t)=>{if("function"==typeof v)return v(e,{...t,hasMany:s,options:y,required:p})},[v,p,s,y])}),T=(0,c.useCallback)(e=>{if(!b||$){let t=null;e&&s?t=Array.isArray(e)?e.map(e=>e.value):[]:e&&!Array.isArray(e)&&(t=e.value),"function"==typeof m&&m(t),E(t)}},[b,$,s,E,m]),D=(0,c.useMemo)(()=>oq(t),[t]);return(0,h.jsx)(p8,{AfterInput:x,BeforeInput:w,className:n,Description:C,description:a,Error:j,filterOption:k?({label:e,value:t},r)=>k?.some(e=>("string"==typeof e?e:e.value)===t)&&e.toLowerCase().includes(r.toLowerCase()):void 0,hasMany:s,isClearable:l,isSortable:i,Label:S,label:u,localized:d,name:r,onChange:T,options:y,path:_,placeholder:o,readOnly:b||$,required:p,showError:N,style:D,value:P})}),he=(0,p.e)(r3(),1);function ht(e){let t=(0,v.c)(5),{errorMessage:r}=e,n;t[0]!==r?(n=()=>(function(e){let t=e.indexOf(":"),r=t>=0?e.slice(0,t):e,n=t>=0?e.slice(t+1):void 0;if(!n)return{message:r};let a=n.split(",").map(e=>e.replaceAll(" > "," → ").trim());return 1===a.length?{errors:a,message:`${r}: `}:{errors:function(e){let t=[];for(let r of e)if(r){let e=r.split(" → "),n=!1;for(let a=0;a<t.length;a++)if(t[a].startsWith(e[0])){t.splice(a+1,0,r),n=!0;break}n||t.push(r)}return t}(a),message:`${r} (${a.length}):`}})(r),t[0]=r,t[1]=n):n=t[1];let[a]=c.default.useState(n),{errors:l,message:i}=a,o;return t[2]!==l||t[3]!==i?(o=(0,h.jsxs)("div",{children:[i,Array.isArray(l)&&l.length>0?1===l.length?(0,h.jsx)("span",{"data-testid":"field-error",children:l[0]}):(0,h.jsx)("ul",{"data-testid":"field-errors",children:l.map(hr)}):null]}),t[2]=l,t[3]=i,t[4]=o):o=t[4],o}function hr(e,t){return(0,h.jsx)("li",{children:e},t)}function hn(e,t,r){let n,a,l,i=(0,v.c)(11),o;i[0]!==e?(o=()=>e,i[0]=e,i[1]=o):o=i[1];let[s,u]=(0,c.useState)(o),d;i[2]!==r||i[3]!==e?(d=()=>{let t=setTimeout(()=>{u(()=>e)},r);return()=>{clearTimeout(t)}},i[2]=r,i[3]=e,i[4]=d):d=i[4],i[5]!==r||i[6]!==t?(n=[...t,r],i[5]=r,i[6]=t,i[7
47]=n):n=i[7],(0,c.useEffect)(d,n),i[8]!==s?(a=()=>{s()},l=[s],i[8]=s,i[9]=a,i[10]=l):(a=i[9],l=i[10]),(0,c.useEffect)(a,l)}var ha=c.default.createContext(null),hl=e=>{let t=(0,v.c)(6),{children:r}=e,[n,a]=(0,c.useState)(ho),l;t[0]!==n?(l=e=>{let{collectionSlug:t}=e;return n.get(t)},t[0]=n,t[1]=l):l=t[1];let i=l,o;t[2]===Symbol.for("react.memo_cache_sentinel")?(o=e=>{let{collectionSlug:t,handler:r}=e;a(e=>{let n=new Map(e);return n.set(t,r),n})},t[2]=o):o=t[2];let s=o,u;return t[3]!==r||t[4]!==i?(u=(0,h.jsx)(ha,{value:{getUploadHandler:i,setUploadHandler:s},children:r}),t[3]=r,t[4]=i,t[5]=u):u=t[5],u},hi=()=>{let e=c.default.use(ha);if(null===e)throw Error("useUploadHandlers must be used within UploadHandlersProvider");return e};function ho(){return new Map}var hs={413:"Your request was too large to submit successfully."},hc=(0,p.e)(rZ(),1),hu=(e,t)=>{let r={},n=Object.entries(t).reduce((t,[n,a])=>{if(0===n.indexOf(`${e}.`)){let[r]=n.replace(`${e}.`,"").split(".");t[r]||(t[r]={}),t[r][n.replace(`${e}.${String(r)}.`,"")]={...a}}else r[n]=a;return t},[]);return{remainingFields:r,rows:n}},hd=(e,t)=>t.reduce((t,r,n)=>({...t,...Object.entries(r).reduce((t,[r,a])=>({...t,[`${e}.${n}.${r}`]:{...a}}),{})}),{}),hf="default"in hc.default?hc.default.default:hc.default;function hp(e,t){switch(t.type){case"ADD_ROW":{let{blockType:r,path:n,rowIndex:a,subFieldState:l={}}=t,i="number"==typeof a?a:e[n]?.rows?.length||0,o=[...e[n]?.rows||[]],s={id:l?.id?.value||new hf().toHexString(),isLoading:!0};r&&(s.blockType=r),o.splice(i,0,s),r&&(l.blockType={initialValue:r,valid:!0,value:r});let{remainingFields:c,rows:u}=hu(n,e);return u.splice(i,0,l),{...c,...hd(n,u),[`${n}.${i}.id`]:{initialValue:s.id,passesCondition:!0,valid:!0,value:s.id},[n]:{...e[n],disableFormData:!0,rows:o,value:u.length}}}case"ADD_SERVER_ERRORS":{let r={...e},n=[];return t.errors.forEach(({message:e,path:t})=>{r[t]={...r[t]||{initialValue:null,value:null},errorMessage:e,valid:!1};let a=t.split(".");a.length>1&&n.push({fieldErrorPath:t,parentPath:a.slice(0,a.length-1).join(".")})}),r=Object.entries(r).reduce((e,[t,r])=>{let a=n.reduce((e,{fieldErrorPath:r,parentPath:n})=>(n.startsWith(t)&&e.push(r),e),[]),l=!1;if(a.length>0){let n=Array.isArray(r.errorPaths)?r.errorPaths:[];a.forEach(e=>{n.includes(e)||(n.push(e),l=!0)}),l&&(e[t]={...r,errorPaths:n})}return l||(e[t]=r),e},{})}case"DUPLICATE_ROW":{let{path:r,rowIndex:n}=t,{remainingFields:a,rows:l}=hu(r,e),i=[...e[r].rows||[]],o=rk(i[n]),s=new hf().toHexString();o.id&&(o.id=s),i[n]?.customComponents?.RowLabel&&(o.customComponents={RowLabel:i[n].customComponents.RowLabel});let c=rk(l[n]);for(let e of(c.id&&(c.id.value=s,c.id.initialValue=s),Object.keys(c).filter(e=>e.endsWith(".id")))){let t=c[e],r=new hf().toHexString();if(t&&"string"==typeof t.value&&hf.isValid(t.value)){c[e].value=r,c[e].initialValue=r;let t=e.split("."),n=parseInt(t[t.length-2],10),a=t.slice(0,t.length-2).join("."),l=c?.[a]?.rows;c[a]&&Array.isArray(l)&&(l[n]?l[n].id=r:l[n]={id:r})}}return Object.keys(c).length>0&&(l.splice(n+1,0,c),i.splice(n+1,0,o)),{...a,...hd(r,l),[r]:{...e[r],disableFormData:!0,rows:i,value:l.length}}}case"MERGE_SERVER_STATE":{let{acceptValues:r,prevStateRef:n,serverState:a}=t,l=(({acceptValues:e,currentState:t={},incomingState:r})=>{let n={...t};for(let[a,l]of Object.entries(r||{})){if(!(a in t)&&!l.addedByServer)continue;let i=l.addedByServer||!0===e||"object"==typeof e&&null!==e&&!1===e.overrideLocalChanges&&!t[a]?.isModified;if(i&&!l.addedByServer&&!0!==e){let e=function(e){let t=e.split("."),r=-1;for(let e=t.length-1;e>=0;e--)if(/^\d+$/.test(t[e])){r=e;break}return -1===r||r===t.length-1?null:{arrayPath:t.slice(0,r).join("."),fieldPath:t.slice(r+1).join("."),rowIndex:parseInt(t[r],10)}}(a);if(e){let{arrayPath:n,rowIndex:a}=e,l=t[n]?.rows?.[a]?.id,o=r[n]?.rows?.[a]?.id;(void 0===l||o&&l!==o)&&(i=!1)}}let o=l;if(!i){let{initialValue:e,value:t,...r}=l;o=r}n[a]={...t[a],...o},t[a]&&"errorPaths"in t[a]&&!("errorPaths"in l)&&(n[a].errorPaths=[]),Array.isArray(l.rows)&&a in t&&(!0===e?n[a].rows=l.rows.map((e,r)=>({...t[a]?.rows?.[r]||{},...e}
47)):(n[a].rows=[...t[a]?.rows||[]],l.rows.forEach(e=>{let r=t[a].rows?.findIndex(t=>t.id===e.id);if(r>-1)n[a].rows[r]={...t[a].rows[r],...e};else if(e.addedByServer){let t={...e};delete t.addedByServer,n[a].rows.push(t)}}),"value"in l&&n[a].rows.length!==l.value&&(n[a].value=n[a].rows.length))),!1!==l.valid&&(n[a].valid=!0),!1!==l.passesCondition&&(n[a].passesCondition=!0),l.blocksFilterOptions||delete n[a].blocksFilterOptions,delete n[a].addedByServer}return t8(n,t)?t:n})({acceptValues:r,currentState:e||{},incomingState:a});return n.current=l,l}case"MOVE_ROW":{let{moveFromIndex:r,moveToIndex:n,path:a}=t,{remainingFields:l,rows:i}=hu(a,e),o=i[r];i.splice(r,1),i.splice(n,0,o);let s=[...e[a]?.rows||[]],c={...s[r]};return s.splice(r,1),s.splice(n,0,c),{...l,...hd(a,i),[a]:{...e[a],rows:s}}}case"REMOVE":{let r={...e};return r[t.path]&&delete r[t.path],r}case"REMOVE_ROW":{let{path:r,rowIndex:n}=t,{remainingFields:a,rows:l}=hu(r,e),i=[...e[r]?.rows||[]];return l.splice(n,1),i.splice(n,1),{...a,[r]:{...e[r],disableFormData:l.length>0,rows:i,value:l.length},...hd(r,l)}}case"REPLACE_ROW":{let{blockType:r,path:n,rowIndex:a,subFieldState:l={}}=t,{remainingFields:i,rows:o}=hu(n,e),s=Math.max(0,Math.min(a,o?.length-1||0)),c=[...e[n]?.rows||[]];return c[s]={id:new hf().toHexString(),blockType:r||void 0,collapsed:!1},r&&(l.blockType={initialValue:r,valid:!0,value:r}),o[s]=l,{...i,...hd(n,o),[n]:{...e[n],disableFormData:!0,rows:c,value:o.length}}}case"REPLACE_STATE":if(!1!==t.optimize){let r={};for(let[n,a]of Object.entries(t.state)){let t=e[n];!1!==a.valid&&(a.valid=!0),!1!==a.passesCondition&&(a.passesCondition=!0),t8(t,a)?t&&(r[n]=t):r[n]=a}return r}if(t.sanitize)for(let e of Object.values(t.state))!1!==e.valid&&(e.valid=!0),!1!==e.passesCondition&&(e.passesCondition=!0);return t.state;case"SET_ALL_ROWS_COLLAPSED":{let{path:r,updatedRows:n}=t;return{...e,[r]:{...e[r],rows:n}}}case"SET_ROW_COLLAPSED":{let{path:r,updatedRows:n}=t;return{...e,[r]:{...e[r],rows:n}}}case"UPDATE":{let r=Object.entries(t).reduce((e,[t,r])=>["disableFormData","errorMessage","initialValue","rows","valid","validate","value"].includes(t)?{...e,[t]:r,..."value"===t?{isModified:!0}:{}}:e,e?.[t.path]||{}),n={...e,[t.path]:r};if("value"in t)for(let[e,r]of Object.entries(n))e!==t.path&&"isModified"in r&&delete n[e].isModified;return n}case"UPDATE_MANY":{let r={...e};return Object.entries(t.formState).forEach(([e,t])=>{r[e]=t}),r}default:return e}}var hh={addFieldRow:()=>{},buildRowErrors:()=>{},createFormData:()=>{},disabled:!1,dispatchFields:()=>{},fields:{},formRef:null,getData:()=>{},getDataByPath:()=>{},getField:()=>{},getFields:()=>({}),getSiblingData:()=>{},initializing:void 0,isValid:!0,moveFieldRow:()=>{},removeFieldRow:()=>{},replaceFieldRow:()=>{},replaceState:()=>{},reset:()=>{},setBackgroundProcessing:()=>{},setDisabled:()=>{},setIsValid:()=>{},setModified:()=>{},setProcessing:()=>{},setSubmitted:()=>{},submit:()=>{},validateForm:()=>{}},hm=e=>{let{id:t,collectionSlug:r,docConfig:n,docPermissions:a,getDocPreferences:l,globalSlug:i}=oD(),o=rw(n),{action:s,beforeSubmit:u,children:p,className:m,disabled:g,disableSuccessStatus:v,disableValidationOnSubmit:y,el:x,handleResponse:w,initialState:C,isDocumentForm:j,isInitializing:S,onChange:$,onSubmit:_,onSuccess:k,redirect:E,submitted:N,uuid:P,waitForAutocomplete:T}=e,D="method"in e?e?.method:void 0,R=(0,b.useRouter)(),A=ng(),{code:O}=iP(),{i18n:L,t:M}=(0,f.d)(),{refreshCookie:I,user:F}=iS(),B=oM(),{queueTask:z}=pM(),{getFormState:U}=fg(),{startRouteTransition:V}=nK(),{getUploadHandler:H}=hi(),{config:q}=(0,d.c)(),[K,W]=(0,c.useState)(g||!1),[G,Y]=(0,c.useState)(!1),[Q,X]=(0,c.useState)(!1),[J,Z]=(0,c.useState)(!0),[ee,et]=(0,c.useState)(S),[er,en]=(0,c.useState)(!1),[ea,el]=(0,c.useState)(!1),ei=(0,c.useRef)(ea),eo=(0,c.useRef)(!1),es=(0,c.useCallback)(e=>{ei.current=e,el(e)},[]),[ec,eu]=(0,c.useState)(!1),ed=(0,c.useCallback)(e=>{ei.current&&(eo.current=!0),eu(e)},[]),ef=(0,c.useRef)(null),ep=(0,c.useRef)({}),eh=(0,c.useRef)(null),em=(0,c.useRef)(!0),eg=(0,c.useReducer)(hp,{},()=>C),[eb,ev]=eg;ep.current.fields=eb;let ey=(0,c.useRef)(eb),ex=(0,c.useCallback)(async()=>{let e={},n=!0,a=ep.current.getData(),l=Object.entries(ep.current.fields).map(async([l,i])=>{let o=l?l.split("."):[];if(!1!==i.passesCondition){let e=i.valid;
47if("validate"in i&&"function"==typeof i.validate){let n=i.value;i?.rows&&Array.isArray(i.rows)&&(n=ep.current.getDataByPath(l)),"string"==typeof(e=await i.validate(n,{...i,id:t,collectionSlug:r,blockData:void 0,data:A?.getData?A.getData():a,event:"submit",operation:B,path:o,preferences:{},req:{payload:{config:q},t:M,user:F},siblingData:ep.current.getSiblingData(l)}))?(i.errorMessage=e,i.valid=!1):(i.valid=!0,i.errorMessage=void 0)}!1===i.valid&&(n=!1)}e[l]=i});return await Promise.all(l),t8(ep.current.fields,e)||ev({type:"REPLACE_STATE",state:e}),Z(n),n},[r,q,ev,t,B,M,F,A]),ew=(0,c.useCallback)(async(e,t)=>{let{acceptValues:r=!0,action:n=s,context:a,disableFormWhileProcessing:l=!0,disableSuccessStatus:i,method:c=D,overrides:d={},skipValidation:f}=e||{},p=i??v;if(K){t&&t.preventDefault();return}let m,g,b=new Promise((e,t)=>{g=e,m=t}),x=n||"string"==typeof s||"function"==typeof s;E||p||!x?(g=e=>nI.success(e),m=e=>nI.error(e)):nI.promise(b,{error:e=>e,loading:M("general:submitting"),success:e=>e}),t&&(t.stopPropagation(),t.preventDefault()),l&&(en(!0),W(!0)),T&&await rP(100);let C=rN(ep.current.fields,!0),j=rk(ep.current.fields,{excludeFiles:!0});if(Array.isArray(u)){let e;await u.reduce(async(t,r)=>{await t,e=await r({formState:j})},Promise.resolve());let t=Object.entries(e).every(([,e])=>!1!==e.valid);if(Z(t),!t)return en(!1),X(!0),W(!1),ev({type:"REPLACE_STATE",state:e})}let S=!!f||!!y||await ep.current.validateForm();if(Z(S),!S){m(M("error:correctInvalidFields")),en(!1),X(!0),W(!1);return}let $={};if("function"==typeof d?$=d(ep.current.fields):"object"==typeof d&&($=d),_){for(let[e,t]of Object.entries($))C[e]=t;_(ep.current.fields,C)}if(!x){en(!1),X(!0),W(!1);return}try{let e=await ep.current.createFormData($,{data:C,mergeOverrideData:"function"!=typeof d}),t;if("string"==typeof n?t=await iw[c.toLowerCase()](n,{body:e,headers:{"Accept-Language":L.language}}):"function"==typeof s&&(t=await s(e)),eo.current?eo.current=!1:ed(!1),W(!1),"function"==typeof w)return void w(t,g,m);let l=t.headers.get("content-type"),i=l&&-1!==l.indexOf("application/json"),u={};if(i&&(u=await t.json()),t.status<400){if("function"==typeof k){let e=await k(u,{context:a,formState:j});e&&ev({type:"MERGE_SERVER_STATE",acceptValues:r,prevStateRef:ey,serverState:e})}X(!1),en(!1),E?V(()=>R.push(E)):p||g(u.message||M("general:submissionSuccessful"))}else{if(en(!1),X(!0),"draft"===d._status&&(ed(!0),o||X(!1)),ep.current={...ep.current},u.message)return void m(u.message);if(Array.isArray(u.errors)){let[e,t]=u.errors.reduce(([e,t],r)=>{let n=[],a=[];return r?.message&&a.push(r),Array.isArray(r?.data?.errors)&&r.data?.errors.forEach(e=>{e?.path?n.push(e):a.push(e)}),[[...e,...n],[...t,...a]]},[[],[]]);Z(!1),ev({type:"ADD_SERVER_ERRORS",errors:e}),t.forEach(e=>{m((0,h.jsx)(ht,{errorMessage:e.message||M("error:unknown")}))});return}let e=hs?.[t.status]||t?.statusText||M("error:unknown");m(e)}return{formState:ep.current.fields,res:t}}catch(e){console.error("Error submitting form",e),en(!1),X(!0),W(!1),m(e.message)}},[u,V,s,v,y,K,ev,w,D,_,k,E,R,M,L,o,T,ed,X]),eC=(0,c.useCallback)(()=>ep.current.fields,[]),ej=(0,c.useCallback)(e=>ep.current.fields[e],[]),eS=(0,c.useCallback)(()=>rN(ep.current.fields,!0),[]),e$=(0,c.useCallback)(e=>((e,t)=>{let r;if(!e)return null;if(-1===t.indexOf("."))return rN(e,!0);let n={},a=t.split(".");return r=Number.isNaN(Number(a[a.length-1]))?t.substring(0,t.lastIndexOf(".")+1):`${t}.`,Object.keys(e).forEach(t=>{e[t]?.disableFormData||0!==t.indexOf(r)||(n[t.replace(r,"")]=e[t]?.value)}),rE(n)})(ep.current.fields,e),[]),e_=(0,c.useCallback)(e=>{var t;let r,n,a,l;return t=ep.current.fields,r=e.substring(0,e.lastIndexOf(".")+1),n=e.split(".").pop(),a={},Object.keys(t).forEach(n=>{!t[n]?.disableFormData&&(0===n.indexOf(`${e}.`)||n===e)&&(a[n.replace(r,"")]=t[n]?.value,t[n]?.rows&&0===t[n].rows.length&&(a[n.replace(r,"")]=[]))}),l=rE(a),l?.[n]},[]),ek=(0,c.useCallback)(async(e,{data:t,mergeOverrideData:a=!0})=>{let l=t||rN(ep.current.fields,!0),i=l?.file;if(n&&"upload"in n&&n.upload&&i){delete l.file;let e=H({collectionSlug:r});if("function"==typeof e){let t=i.name;i=JSON.stringify({clientUploadContext:await e({file:i,updateFilename:e=>{t=e}}),collectionSlug:r,filename:t,mimeType:i.type,size:i.size})}}let o={_payload:JSON.stringify(l=a?{...l,...e}:e)};return n&&"upload"in n&&n.upload&&i&&(o.file=i),(0,he.serialize)(o,{indices:!0,nullsAsUndefineds:!1}
47)},[r,n,H]),eE=(0,c.useCallback)(async e=>{let n=fO(eh),o=await l(),{state:s}=await U({id:t,collectionSlug:r,data:e,docPermissions:a,docPreferences:o,globalSlug:i,locale:O,operation:B,renderAllFields:!0,schemaPath:r||i,signal:n.signal,skipValidation:!0});ep.current={...hh},ed(!1),ev({type:"REPLACE_STATE",state:s}),eh.current=null},[r,ev,i,t,B,U,a,l,O,ed]),eN=(0,c.useCallback)(e=>{ep.current={...hh},ed(!1),ev({type:"REPLACE_STATE",state:e})},[ev,ed]),eP=(0,c.useCallback)(({blockType:e,path:t,rowIndex:r,subFieldState:n})=>{let a=e_(t)||[];ev({type:"ADD_ROW",blockType:e,path:t,rowIndex:void 0===r?a.length:r,subFieldState:n}),ed(!0)},[ev,e_,ed]),eT=(0,c.useCallback)(({moveFromIndex:e,moveToIndex:t,path:r})=>{ev({type:"MOVE_ROW",moveFromIndex:e,moveToIndex:t,path:r}),ed(!0)},[ev,ed]),eD=(0,c.useCallback)(({path:e,rowIndex:t})=>{ev({type:"REMOVE_ROW",path:e,rowIndex:t}),ed(!0)},[ev,ed]),eR=(0,c.useCallback)(({blockType:e,path:t,rowIndex:r,subFieldState:n})=>{let a=e_(t);ev({type:"REPLACE_ROW",blockType:e,path:t,rowIndex:void 0===r?a.length:r,subFieldState:n}),ed(!0)},[ev,e_,ed]);(0,c.useEffect)(()=>{let e=eh.current;return()=>{fA(e)}},[]),(0,c.useEffect)(()=>{void 0!==S&&et(S)},[S]),ep.current.submit=ew,ep.current.getFields=eC,ep.current.getField=ej,ep.current.getData=eS,ep.current.getSiblingData=e$,ep.current.getDataByPath=e_,ep.current.validateForm=ex,ep.current.createFormData=ek,ep.current.setModified=ed,ep.current.setProcessing=en,ep.current.setBackgroundProcessing=es,ep.current.setSubmitted=X,ep.current.setIsValid=Z,ep.current.disabled=K,ep.current.setDisabled=W,ep.current.formRef=ef,ep.current.reset=eE,ep.current.replaceState=eN,ep.current.dispatchFields=ev,ep.current.addFieldRow=eP,ep.current.removeFieldRow=eD,ep.current.moveFieldRow=eT,ep.current.replaceFieldRow=eR,ep.current.uuid=P,ep.current.initializing=ee,ep.current.isValid=J,(0,c.useEffect)(()=>{Y(!0)},[]),(0,c.useEffect)(()=>{"boolean"==typeof g&&W(g)},[g]),(0,c.useEffect)(()=>{"boolean"==typeof N&&X(N)},[N]),(0,c.useEffect)(()=>{C&&(ep.current={...hh},ev({type:"REPLACE_STATE",optimize:!1,sanitize:!0,state:C}))},[C,ev]),iL(()=>{I()},15e3,[eb]);let eA=ae(()=>{ep.current={...ep.current},ed(!1)});(0,c.useEffect)(()=>{eA()},[O]);let eO=[m,"form"].filter(Boolean).join(" "),eL=ae(e=>{z(async()=>{if(Array.isArray($)){let t;for(let r of $)t=await r({formState:rk(eb,{excludeFiles:!0}),submitted:e});ev({type:"MERGE_SERVER_STATE",prevStateRef:ey,serverState:t})}})});hn(()=>{(em.current||!t8(eb,ey.current))&&ec&&eL(Q),ey.current=eb,em.current=!1},[ec,Q,eb],250);let eM=j?no:c.default.Fragment,eI=j?{value:ep.current}:{};return(0,h.jsx)(x||"form",{action:"function"==typeof s?void 0:s,className:eO,"data-form-ready":!er&&G&&!ee,method:D,noValidate:!0,onSubmit:e=>{ep.current.submit({},e)},ref:ef,children:(0,h.jsx)(eM,{...eI,children:(0,h.jsx)(ni,{value:ep.current,children:(0,h.jsx)(ns,{value:{fields:eb,...ep.current},children:(0,h.jsx)(nc,{value:Q,children:(0,h.jsx)(np,{value:!G||G&&ee,children:(0,h.jsx)(nu,{value:er,children:(0,h.jsx)(nd,{value:ea,children:(0,h.jsx)(nf,{value:ec,children:(0,h.jsx)(nh.Provider,{value:eg,children:p})})})})})})})})})})},hg="tabs-field__tab-button",hb=e=>{let t=(0,v.c)(12),{hidden:r,isActive:n,parentPath:a,setIsActive:l,tab:i}=e,{i18n:o}=(0,f.d)(),[s,u]=(0,c.useState)(void 0),d;if(t[0]!==s||t[1]!==r||t[2]!==o||t[3]!==n||t[4]!==a||t[5]!==l||t[6]!==i){let e=[...a?a.split(".").slice(0,-1):[],...k(i)?[i.name]:[]],f=s>0,p=(0,h.jsx)(sA,{fields:i.fields,path:e,setErrorCount:u}),g=f&&`${hg}--has-error`,b=n&&`${hg}--active`,v=r&&`${hg}--hidden`,y;t[8]!==g||t[9]!==b||t[10]!==v?(y=[hg,g,b,v].filter(Boolean),t[8]=g,t[9]=b,t[10]=v,t[11]=y):y=t[11],d=(0,h.jsxs)(c.default.Fragment,{children:[p,(0,h.jsxs)("button",{className:y.join(" "),onClick:l,type:"button",children:[i.label?m(i.label,o):k(i)?i.name:"",f&&(0,h.jsx)(aG,{count:s,i18n:o})]})]}),t[0]=s,t[1]=r,t[2]=o,t[3]=n,t[4]=a,t[5]=l,t[6]=i,t[7]=d}else d=t[7];return d},hv="tabs-field",hy=oH(e=>{let t,r,n,a,l=(0,v.c)(44),{field:i,forceRender:o,indexPath:s,parentPath:u,parentSchemaPath:d,path:p,permissions:m,readOnly:g,schemaPath:b}=e,{admin:y,tabs:x}=i,w;l[0]!==y?(w=void 0===y?{}:y,l[0]=y,l[1]=w):w=l[1];let{className:C}=w,j;l[2]!==x?(j=void 0===x?[]:x,l[2]=x,l[3]=j):j=l[3];let S=j,$=void 0===s?"":s,_=void 0===u?"":u,k=void 0===d?"":d,E=void 0===p?"":p,{getPreference:N,setPreference:P}=o_(),{preferencesKey:T}=oD(),{i18n:D}=(0,f.d)(),{isWithinCollapsible:R}=o7(),A;l[4]!==S?(A=e=>{let[t]=e;return S.map((e,r)=>{let n=e?.id;return{index:r,passesCondition:t?.[n]?.passesCondition??!0,tab:e}})},l[4]=S,l[5]=A):A=l[5];let O=nj(A),L;l[6]!==O?(L=()=>O.filter(hw)?.[0]?.index??0,l[6]=O,l[7]=L):L=l[7];let[M,I]=(0,c.useState)(L),F=`tabs-${$}`,B=O[M],z=B?.tab,U=z?.admin?.description??z?.description,V="function"==typeof U?U({i18n:D,t:D.t}):U,H=O.some(hC),q;
47l[8]!==N||l[9]!==E||l[10]!==T||l[11]!==P||l[12]!==F?(q=async e=>{I(e);let t=await N(T);T&&P(T,{...t,...E?{fields:{...t?.fields||{},[E]:{...t?.fields?.[E],tabIndex:e}}}:{fields:{...t?.fields,[F]:{...t?.fields?.[F],tabIndex:e}}}})},l[8]=N,l[9]=E,l[10]=T,l[11]=P,l[12]=F,l[13]=q):q=l[13];let K=q,W;l[14]!==N||l[15]!==E||l[16]!==T||l[17]!==O.length||l[18]!==F?(W=()=>{T&&(async()=>{let e=await N(T),t=E?e?.fields?.[E]?.tabIndex:e?.fields?.[F]?.tabIndex;I("number"==typeof t&&t<O.length?t:0)})()},l[14]=N,l[15]=E,l[16]=T,l[17]=O.length,l[18]=F,l[19]=W):W=l[19],l[20]!==N||l[21]!==_||l[22]!==k||l[23]!==E||l[24]!==T||l[25]!==S||l[26]!==F?(t=[E,N,T,F,S,_,k],l[20]=N,l[21]=_,l[22]=k,l[23]=E,l[24]=T,l[25]=S,l[26]=F,l[27]=t):t=l[27],(0,c.useEffect)(W,t),l[28]!==B?.passesCondition||l[29]!==K||l[30]!==O?(r=()=>{if(B?.passesCondition===!1){let e=O.find(hj);e&&K(e.index)}},l[28]=B?.passesCondition,l[29]=K,l[30]=O,l[31]=r):r=l[31],l[32]!==B||l[33]!==K||l[34]!==O?(n=[B,O,K],l[32]=B,l[33]=K,l[34]=O,l[35]=n):n=l[35],(0,c.useEffect)(r,n);let G=R&&`${hv}--within-collapsible`,Y=!H&&`${hv}--hidden`,Q;return l[36]!==C||l[37]!==G||l[38]!==Y?(Q=[oK,C,hv,G,Y].filter(Boolean),l[36]=C,l[37]=G,l[38]=Y,l[39]=Q):Q=l[39],l[40]!==M||l[41]!==K||l[42]!==E?(a=e=>{let{index:t,passesCondition:r,tab:n}=e;return(0,h.jsx)(hb,{hidden:!r,isActive:M===t,parentPath:E,setIsActive:()=>{K(t)},tab:n},t)},l[40]=M,l[41]=K,l[42]=E,l[43]=a):a=l[43],(0,h.jsx)("div",{className:Q.join(" "),children:(0,h.jsxs)(d9,{children:[(0,h.jsx)("div",{className:`${hv}__tabs-wrap`,children:(0,h.jsx)("div",{className:`${hv}__tabs`,children:O.map(a)})}),(0,h.jsx)("div",{className:`${hv}__content-wrap`,children:z&&(0,h.jsx)(hx,{description:V,field:z,forceRender:void 0!==o&&o,hidden:!1,parentIndexPath:$,parentPath:E,parentSchemaPath:void 0===b?"":b,path:E,permissions:m&&"object"==typeof m&&"name"in z?m[z.name]&&"object"==typeof m[z.name]&&"fields"in m[z.name]?m[z.name].fields:m[z.name]:m,readOnly:g,tabIndex:M})})]})})});function hx(e){let t=(0,v.c)(21),{description:r,field:n,forceRender:a,hidden:l,label:i,parentIndexPath:o,parentPath:s,parentSchemaPath:c,permissions:u,readOnly:d,tabIndex:p}=e,{i18n:g}=(0,f.d)(),{customComponents:b}=oz(),y,x;if(t[0]!==r||t[1]!==n||t[2]!==a||t[3]!==l||t[4]!==g||t[5]!==i||t[6]!==o||t[7]!==s||t[8]!==c||t[9]!==u||t[10]!==d||t[11]!==b||t[12]!==p){x=Symbol.for("react.early_return_sentinel");e:{let e,f,{AfterInput:v,BeforeInput:w,Description:C,Field:j}=void 0===b?{}:b;if(j){x=j;break e}let{indexPath:S,path:$,schemaPath:_}=t7({field:n,index:p,parentIndexPath:o,parentPath:s,parentSchemaPath:c}),k=l&&`${hv}__tab--hidden`,E;t[15]!==g||t[16]!==i?(E=i&&`${hv}__tabConfigLabel-${e=m(i,g),e?.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/\s+/g,"-").toLowerCase()}`,t[15]=g,t[16]=i,t[17]=E):E=t[17],t[18]!==k||t[19]!==E?(f=[k,`${hv}__tab`,E].filter(Boolean),t[18]=k,t[19]=E,t[20]=f):f=t[20],y=(0,h.jsxs)("div",{className:f.join(" "),children:[(0,h.jsx)(r7,{CustomComponent:C,Fallback:(0,h.jsx)(aQ,{description:r,marginPlacement:"bottom",path:s})}),w,(0,h.jsx)(gq,{fields:n.fields,forceRender:a,parentIndexPath:S,parentPath:$,parentSchemaPath:_,permissions:u,readOnly:d}),v]})}t[0]=r,t[1]=n,t[2]=a,t[3]=l,t[4]=g,t[5]=i,t[6]=o,t[7]=s,t[8]=c,t[9]=u,t[10]=d,t[11]=b,t[12]=p,t[13]=y,t[14]=x}else y=t[13],x=t[14];return x!==Symbol.for("react.early_return_sentinel")?x:y}function hw(e){let{passesCondition:t}=e;return t}function hC(e){let{passesCondition:t}=e;return t}function hj(e){let{passesCondition:t}=e;return t}var hS=e=>{let t=(0,v.c)(32),{AfterInput:r,BeforeInput:n,className:a,Description:l,description:i,Error:o,hasMany:s,htmlAttributes:c,inputRef:u,Label:d,label:p,localized:g,maxRows:b,onChange:y,onKeyDown:x,path:w,placeholder:C,readOnly:j,required:S,rtl:$,showError:_,style:k,value:E,valueToRender:N}=e,{i18n:P,t:T}=(0,f.d)(),D;if(t[0]!==r||t[1]!==n||t[2]!==l||t[3]!==o||t[4]!==d||t[5]!==a||t[6]!==i||t[7]!==s||t[8]!==c||t[9]!==P||t[10]!==u||t[11]!==p||t[12]!==g||t[13]!==b||t[14]!==y||t[15]!==x||t[16]!==w||t[17]!==C||t[18]!==j||t[19]!==S||t[20]!==$||t[21]!==_||t[22]!==k||t[23]!==T||t[24]!==E||t[25]!==N){let e=m(C,P),f=_&&"error",v=j&&"read-only",R=s&&"has-many",A;t[27]!==a||t[28]!==f||t[29]!==v||t[30]!==R?(A=[oK,"text",a,f,v,R].filter(
47Boolean),t[27]=a,t[28]=f,t[29]=v,t[30]=R,t[31]=A):A=t[31],D=(0,h.jsxs)("div",{className:A.join(" "),style:k,children:[(0,h.jsx)(r7,{CustomComponent:d,Fallback:(0,h.jsx)(iR,{label:p,localized:g,path:w,required:S})}),(0,h.jsxs)("div",{className:`${oK}__wrap`,children:[(0,h.jsx)(r7,{CustomComponent:o,Fallback:(0,h.jsx)(aX,{path:w,showError:_})}),n,s?(0,h.jsx)(d0,{className:`field-${w.replace(/\./g,"__")}`,components:{DropdownIndicator:null},customProps:{editableProps:h_},disabled:j,filterOption:()=>!b||!(Array.isArray(E)&&b&&E.length>=b),isClearable:!1,isCreatable:!0,isMulti:!0,isSortable:!0,menuIsOpen:!1,noOptionsMessage:()=>Array.isArray(E)&&E.length>=b?T("validation:limitReached",{max:b,value:E.length+1}):null,onChange:y,options:[],placeholder:e,showError:_,value:N}):(0,h.jsx)("input",{"data-rtl":$,disabled:j,id:`field-${w?.replace(/\./g,"__")}`,name:w,onChange:y,onKeyDown:x,placeholder:e,ref:u,type:"text",value:E||"",...c??{}}),r,(0,h.jsx)(r7,{CustomComponent:l,Fallback:(0,h.jsx)(aQ,{description:i,path:w})})]})]}),t[0]=r,t[1]=n,t[2]=l,t[3]=o,t[4]=d,t[5]=a,t[6]=i,t[7]=s,t[8]=c,t[9]=P,t[10]=u,t[11]=p,t[12]=g,t[13]=b,t[14]=y,t[15]=x,t[16]=w,t[17]=C,t[18]=j,t[19]=S,t[20]=$,t[21]=_,t[22]=k,t[23]=T,t[24]=E,t[25]=N,t[26]=D}else D=t[26];return D};function h$(e){e.currentTarget.contentEditable="false"}function h_(e,t,r){let n=`${t}--editable`;return{onBlur:h$,onClick:e=>{e.currentTarget.contentEditable="true",e.currentTarget.classList.add(n),e.currentTarget.focus()},onKeyDown:t=>{if(!t.nativeEvent.isComposing&&("Enter"===t.key||"Tab"===t.key||"Escape"===t.key)){if(t.currentTarget.contentEditable="false",t.currentTarget.classList.remove(n),e.value.value=t.currentTarget.innerText,e.label=t.currentTarget.innerText,e.value.value.replaceAll(`
48`,""))r.onChange(r.value,{action:"create-option",option:e});else if(Array.isArray(r.value)){let t=r.value.filter(t=>t.id!==e.id);r.onChange(t,{action:"pop-value",removedValue:e})}t.preventDefault()}t.stopPropagation()}}}var hk=oH(e=>{let{field:t,field:{admin:{autoComplete:r,className:n,description:a,placeholder:l,rtl:i}={},hasMany:o,label:s,localized:u,maxLength:f,maxRows:p,minLength:m,minRows:g,required:b},inputRef:v,path:y,readOnly:x,validate:w}=e,C=iP(),{config:{localization:j}}=(0,d.c)(),{customComponents:{AfterInput:S,BeforeInput:$,Description:_,Error:k,Label:E}={},disabled:N,path:P,setValue:T,showError:D,value:R}=oz({potentiallyStalePath:y,validate:(0,c.useCallback)((e,t)=>{if("function"==typeof w)return w(e,{...t,maxLength:f,minLength:m,required:b})},[w,m,f,b])}),A=oW({fieldLocalized:u,fieldRTL:i,locale:C,localizationConfig:j||void 0}),[O,L]=(0,c.useState)([]),M=(0,c.useCallback)(e=>{!(x||N)&&T(e?Array.isArray(e)?e.map(e=>e.value?.value||e.value):[e.value?.value||e.value]:[])},[x,T,N]);(0,c.useEffect)(()=>{o&&Array.isArray(R)&&L(R.map((e,t)=>({id:`${e}${t}`,label:`${e}`,value:{toString:()=>`${e}${t}`,value:e?.value||e}})))},[R,o]);let I=(0,c.useMemo)(()=>oq(t),[t]);return(0,h.jsx)(hS,{AfterInput:S,BeforeInput:$,className:n,Description:_,description:a,Error:k,hasMany:o,htmlAttributes:{autoComplete:r||void 0},inputRef:v,Label:E,label:s,localized:u,maxRows:p,minRows:g,onChange:o?M:e=>{T(e.target.value)},path:P,placeholder:l,readOnly:x||N,required:b,rtl:A,showError:D,style:I,value:R||"",valueToRender:O})}),hE=e=>{let t=(0,v.c)(26),{AfterInput:r,BeforeInput:n,className:a,Description:l,description:i,Error:o,Label:s,label:c,localized:u,onChange:d,path:p,placeholder:g,readOnly:b,required:y,rows:x,rtl:w,showError:C,style:j,value:S}=e,{i18n:$}=(0,f.d)(),_=C&&"error",k=b&&"read-only",E;t[0]!==a||t[1]!==_||t[2]!==k?(E=[oK,"textarea",a,_,k].filter(Boolean),t[0]=a,t[1]=_,t[2]=k,t[3]=E):E=t[3];let N=E.join(" "),P=`field-${p.replace(/\./g,"__")}`,T;return t[4]!==r||t[5]!==n||t[6]!==l||t[7]!==o||t[8]!==s||t[9]!==i||t[10]!==$||t[11]!==c||t[12]!==u||t[13]!==d||t[14]!==p||t[15]!==g||t[16]!==b||t[17]!==y||t[18]!==x||t[19]!==w||t[20]!==C||t[21]!==j||t[22]!==N||t[23]!==P||t[24]!==S?(T=(0,h.jsxs)("div",{className:N,style:j,children:[(0,h.jsx)(r7,{CustomComponent:s,Fallback:(0,h.jsx)(iR,{htmlFor:P,label:c,localized:u,path:p,required:y})}),(0,h.jsxs)("div",{className:`${oK}__wrap`,children:[(0,h.jsx)(r7,{CustomComponent:o,Fallback:(0,h.jsx)(aX,{path:p,showError:C})}),n,(0,h.jsx)("div",{className:"textarea-outer",children:(0,h.jsx)("textarea",{"data-rtl":w,disabled:b,id:`field-${p.replace(/\./g,"__")}`,name:p,onChange:d,placeholder:m(g,$),rows:x,style:{"--rows":x},value:S||""})}),r,(0,h.jsx)(r7,{CustomComponent:l,Fallback:(0,h.jsx)(aQ,{description:i,path:p})})]})]}),t[4]=r,t[5]=n,t[6]=l,t[7]=o,t[8]=s,t[9]=i,t[10]=$,t[11]=c,t[12]=u,t[13]=d,t[14]=p,t[15]=g,t[16]=b,t[17]=y,t[18]=x,t[19]=w,t[20]=C,t[21]=j,t[22]=N,t[23]=P,t[24]=S,t[25]=T):T=t[25],T},hN=oH(e=>{let{field:t,field:{admin:{className:r,description:n,placeholder:a,rows:l,rtl:i}={},label:o,localized:s,maxLength:u,minLength:p,required:g},path:b,readOnly:v,validate:y}=e,{i18n:x}=(0,f.d)(),{config:{localization:w}}=(0,d.c)(),C=oW({fieldLocalized:s,fieldRTL:i,locale:iP(),localizationConfig:w||void 0}),{customComponents:{AfterInput:j,BeforeInput:S,Description:$,Error:_,Label:k}={},disabled:E,path:N,setValue:P,showError:T,value:D}=oz({potentiallyStalePath:b,validate:(0,c.useCallback)((e,t)=>{if("function"==typeof y)return y(e,{...t,maxLength:u,minLength:p,required:g})},[y,g,u,p])}),R=(0,c.useMemo)(()=>oq(t),[t]);return(0,h.jsx)(hE,{AfterInput:j,BeforeInput:S,className:r,Description:$,description:n,Error:_,Label:k,label:o,localized:s,onChange:e=>{P(e.target.value)},path:N,placeholder:m(a,x),readOnly:v||E,required:g,rows:l,rtl:C,showError:T,style:R,value:D})}),hP=()=>null,hT=(0,c.createContext)(void 0),hD=e=>{let t=(0,v.c)(5),{children:r}=e,[n,a]=(0,c.useState)(null),[l,i]=(0,c.useState)(""),[o,s]=(0,c.useState)(null),u;
48return t[0]!==r||t[1]!==o||t[2]!==n||t[3]!==l?(u=(0,h.jsx)(hT,{value:{setUploadControlFile:s,setUploadControlFileName:a,setUploadControlFileUrl:i,uploadControlFile:o,uploadControlFileName:n,uploadControlFileUrl:l},children:r}),t[0]=r,t[1]=o,t[2]=n,t[3]=l,t[4]=u):u=t[4],u},hR=()=>{let e=(0,c.use)(hT);if(!e)throw Error("useUploadControls must be used within an UploadControlsProvider");return e},hA=e=>{e.preventDefault(),e.stopPropagation()};function hO({children:e,className:t,disabled:r=!1,dropzoneStyle:n="default",multipleFiles:a,onChange:l}){let i=c.default.useRef(null),[o,s]=c.default.useState(!1),u=c.default.useCallback(e=>{if(!a&&e.length>1){let t=new DataTransfer;t.items.add(e[0]),l(t.files)}else l(e)},[a,l]),d=c.default.useCallback(e=>{e.preventDefault(),e.stopPropagation(),e.clipboardData.files&&e.clipboardData.files.length>0&&u(e.clipboardData.files)},[u]),f=c.default.useCallback(e=>{e.preventDefault(),e.stopPropagation(),s(!0)},[]),p=c.default.useCallback(e=>{e.preventDefault(),e.stopPropagation(),s(!1)},[]),m=c.default.useCallback(e=>{if(e.preventDefault(),e.stopPropagation(),s(!1),e.dataTransfer.files&&e.dataTransfer.files.length>0){u(e.dataTransfer.files),s(!1);try{e.dataTransfer.clearData()}catch{}}},[u]);c.default.useEffect(()=>{let e=i.current;return e&&!r?(e.addEventListener("dragenter",f),e.addEventListener("dragleave",p),e.addEventListener("dragover",hA),e.addEventListener("drop",m),e.addEventListener("paste",d),()=>{e.removeEventListener("dragenter",f),e.removeEventListener("dragleave",p),e.removeEventListener("dragover",hA),e.removeEventListener("drop",m),e.removeEventListener("paste",d)}):()=>null},[r,f,p,m,d]);let g=["dropzone",t,o?"dragging":"",`dropzoneStyle--${n}`].filter(Boolean).join(" ");return(0,h.jsx)("div",{className:g,ref:i,children:e})}function hL(e){let t=(0,v.c)(3),{onClick:r}=e,{t:n}=(0,f.d)(),a;return t[0]!==r||t[1]!==n?(a=(0,h.jsx)("button",{"aria-label":n("general:close"),className:"drawer-close-button",onClick:r,type:"button",children:(0,h.jsx)(f.a,{})}),t[0]=r,t[1]=n,t[2]=a):a=t[2],a}function hM({onClose:e,title:t}){return(0,h.jsxs)("div",{className:"bulk-upload--drawer-header",children:[(0,h.jsx)("h2",{title:t,children:t}),(0,h.jsx)(hL,{onClick:e})]})}var hI="bulk-upload--add-files";function hF({acceptMimeTypes:e,onCancel:t,onDrop:r}){let{t:n}=(0,f.d)(),a=c.default.useRef(null);return(0,h.jsxs)("div",{className:hI,children:[(0,h.jsx)(hM,{onClose:t,title:n("upload:addFiles")}),(0,h.jsx)("div",{className:`${hI}__dropArea`,children:(0,h.jsxs)(hO,{multipleFiles:!0,onChange:r,children:[(0,h.jsx)(au,{buttonStyle:"subtle",iconPosition:"left",onClick:()=>{a.current&&a.current.click()},size:"small",children:n("upload:selectFile")}),(0,h.jsx)("input",{accept:e,"aria-hidden":"true",className:`${hI}__hidden-input`,hidden:!0,multiple:!0,onChange:e=>{e.target.files&&e.target.files.length>0&&r(e.target.files)},ref:a,type:"file"}),(0,h.jsxs)("p",{className:`${hI}__dragAndDropText`,children:[n("general:or")," ",n("upload:dragAndDrop")]})]})})]})}var hB=(0,p.e)(r3(),1);async function hz(e={},t={},r,n){let a=rN(e,!0),l=a?.file;if(l&&delete a.file,l&&"function"==typeof n){let e=l.name;l=JSON.stringify({clientUploadContext:await n({file:l,updateFilename:t=>{e=t}}),collectionSlug:r,filename:e,mimeType:l.type,size:l.size})}let i={_payload:JSON.stringify({...a,...t}),file:l};return(0,hB.serialize)(i,{indices:!0,nullsAsUndefineds:!1})}function hU(e,t){switch(t.type){case"ADD_FORMS":{let r=[];for(let e=0;e<t.forms.length;e++)r[e]={errorCount:0,formID:t.forms[e].formID??(crypto.randomUUID?crypto.randomUUID():sh()),formState:{...t.forms[e].initialState||{},file:{initialValue:t.forms[e].file,valid:!0,value:t.forms[e].file}},uploadEdits:{}};return{...e,activeIndex:0,forms:[...r,...e.forms]}}case"REMOVE_FORM":{let r=[...e.forms],[n]=r.splice(t.index,1),a=e.activeIndex>=t.index,l=Math.min(r.length-1,e.activeIndex===t.index?t.index:a?e.activeIndex-1:e.activeIndex);return{...e,activeIndex:a?l:e.activeIndex,forms:r,totalErrorCount:e.totalErrorCount-n.errorCount}}case"REPLACE":return{...e,...t.state};case"SET_ACTIVE_INDEX":return{...e,activeIndex:t.index};case"UPDATE_ERROR_COUNT":{let r=[...e.forms];return r[t.index].errorCount=t.count,{...e,forms:r,totalErrorCount:r.reduce((e,t)=>
48e+t.errorCount,0)}}case"UPDATE_FORM":{let r=[...e.forms];return r[t.index].errorCount=t.errorCount,r[t.index]={...r[t.index],formState:{...r[t.index].formState,...t.formState},uploadEdits:{...r[t.index].uploadEdits,...t.uploadEdits}},{...e,forms:r,totalErrorCount:r.reduce((e,t)=>e+t.errorCount,0)}}default:return e}}var hV=c.default.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:()=>{},totalErrorCount:0,updateUploadEdits:()=>{}}),hH={activeIndex:0,forms:[],totalErrorCount:0};function hq({children:e}){let{config:t}=(0,d.c)(),{routes:{api:r}}=t,{code:n}=iP(),{i18n:a,t:l}=(0,f.d)(),{getDocumentSlots:i,getFormState:o}=fg(),{getUploadHandler:s}=hi(),[u,p]=c.default.useState({}),[m,g]=c.default.useState(!1),[b,v]=c.default.useState(),[y,x]=c.default.useState(!1),[w,C]=c.default.useState(!1),[j,S]=c.default.useState(!1),[$,_]=c.default.useState(!1),[k,E]=c.default.useState(!1),[N,P]=c.default.useReducer(hU,hH),{activeIndex:T,forms:D,totalErrorCount:R}=N;c.default.useRef(D).current=D;let{toggleLoadingOverlay:A}=fP(),{closeModal:O}=lc(),{collectionSlug:L,drawerSlug:M,initialFiles:I,initialForms:F,onSuccess:B,setInitialFiles:z,setInitialForms:U,setSuccessfullyUploaded:V}=gP(),[H,q]=c.default.useState(!1),[K,W]=c.default.useState(""),G=c.default.useRef(!1),Y=c.default.useRef(null),Q=c.default.useRef(()=>({})),X=tR({apiRoute:r,path:""}),J=`${X}/${L}`,Z=c.default.useCallback(async()=>{let e={locale:n||void 0},t=`/${L}/access`,r=await (await fetch(`${X}${t}?${t6(e)}`,{credentials:"include",headers:{"Accept-Language":a.language,"Content-Type":"application/json"},method:"post"})).json(),l=await fetch(`${X}${t}?${t6(e)}`,{body:JSON.stringify({_status:"published"}),credentials:"include",headers:{"Accept-Language":a.language,"Content-Type":"application/json"},method:"POST"}).then(e=>e.json());v(r),x(oP({collectionSlug:L,docPermissions:r,isEditing:!1})),C(l?.update),_(!0)},[X,n,L,a.language]),ee=c.default.useCallback(async e=>{e?.signal&&e.abort("aborting previous fetch for initial form state without files"),p(await i({collectionSlug:L}));try{let{state:e}=await o({collectionSlug:L,docPermissions:b,docPreferences:{fields:{}},locale:n,operation:"create",renderAllFields:!0,schemaPath:L,skipValidation:!0});Y.current=e,S(!0)}catch{}},[i,L,o,b,n]),et=c.default.useCallback(e=>{let t=Q.current();P({type:"REPLACE",state:{activeIndex:e,forms:D.map((e,r)=>r===T?{errorCount:e.errorCount,formID:e.formID,formState:t,uploadEdits:e.uploadEdits}:e)}})},[D,T]),er=c.default.useCallback(async e=>{D.length&&P({type:"UPDATE_FORM",errorCount:D[T].errorCount,formState:Q.current(),index:T}),A({isLoading:!0,key:"addingDocs"}),j||await ee(),P({type:"ADD_FORMS",forms:Array.from(e).map(e=>({file:e,initialState:Y.current}))}),A({isLoading:!1,key:"addingDocs"})},[ee,j,A,T,D]),en=ae(er),ea=ae(async e=>{A({isLoading:!0,key:"addingDocs"}),j||await ee(),P({type:"ADD_FORMS",forms:e.map(e=>({...e,initialState:e?.initialState||Y.current}))}),A({isLoading:!1,key:"addingDocs"})}),el=c.default.useCallback(e=>{P({type:"REMOVE_FORM",index:e})},[]),ei=c.default.useCallback(({errorCount:e,index:t})=>{P({type:"UPDATE_ERROR_COUNT",count:e,index:t})},[]),eo=c.default.useCallback(async({overrides:e}={})=>{let t=Q.current(),r=[...D];r[T]={errorCount:r[T].errorCount,formID:r[T].formID,formState:t,uploadEdits:r[T].uploadEdits};let a=r[T]?.formID,i=[];q(!0);for(let t=0;t<r.length;t++)try{let a=r[t],c=a.formState?.file?.value;W(l("general:uploadingBulk",{current:t+1,total:r.length}));let u=`${J}${t6({locale:n,uploadEdits:a?.uploadEdits||void 0},{addQueryPrefix:!0})}`,d=await fetch(u,{body:await hz(a.formState,e,L,s({collectionSlug:L})),credentials:"include",method:"POST"}),f=await d.json();201===d.status&&f?.doc&&i.push({collectionSlug:L,doc:f.doc,formID:a.formID});let[p,h]=(f?.errors||[]).reduce(([e,t],r)=>{let n=[],a=[];return r?.message&&a.push(r),Array.isArray(r?.data?.errors)&&r.data?.errors.forEac
48h(e=>{e?.path?n.push(e):a.push(e)}),[[...e,...n],[...t,...a]]},[[],[]]),m=!c&&400===d.status,g=c&&413===d.status,v=c&&"object"==typeof c&&"name"in c&&(!c.name||""===c.name);if(m||g||v){r[t].formState.file.valid=!1;let e=r[t].formState.file?.value,n={...r[t].formState};e instanceof File&&(n.file={...n.file,value:{name:e.name}});let{state:a}=await o({collectionSlug:L,docPermissions:b,docPreferences:null,formState:n,operation:"update",schemaPath:L});a&&(e instanceof File&&a.file&&(a.file={...a.file,value:e}),r[t]={errorCount:Object.values(a).reduce((e,t)=>t?.valid===!1?e+1:e,0),formID:r[t].formID,formState:a}),nI.error(h[0]?.message)}else r[t]={errorCount:p.length,formID:r[t].formID,formState:hp(r[t].formState,{type:"ADD_SERVER_ERRORS",errors:p})}}catch{}g(!0),W(""),q(!1);let c=[];r.forEach(({errorCount:e},t)=>{e&&c.push(r[t])});let u=Math.max(0,r.length-c.length),d=r.length-u;u&&(nI.success(`Successfully saved ${u} files`),V(!0),"function"==typeof B&&B(i,d)),d?nI.error(`Failed to save ${d} files`):O(M),P({type:"REPLACE",state:{activeIndex:c.reduce((e,{formID:t},r)=>t===a?r:e,0),forms:c,totalErrorCount:c.reduce((e,{errorCount:t})=>e+t,0)}}),0===c.length&&(z(void 0),U(void 0))},[D,T,l,J,n,L,s,o,b,V,B,O,M,z,U]),es=c.default.useCallback(async(e,t)=>{for(let r=0;r<D.length;r++)if(Object.entries(e).forEach(([e,t])=>{D[r].formState[e]&&(D[r].formState[e].value=t,P({type:"UPDATE_FORM",errorCount:D[r].errorCount,formState:D[r].formState,index:r}))}),"function"==typeof t&&t(),m){let{state:e}=await o({collectionSlug:L,docPermissions:b,docPreferences:null,formState:D[r].formState,operation:"create",schemaPath:L});P({type:"UPDATE_FORM",errorCount:Object.values(e).reduce((e,t)=>t?.valid===!1?e+1:e,0),formState:e,index:r})}},[L,b,D,o,m]),ec=c.default.useCallback(e=>{P({type:"UPDATE_FORM",errorCount:D[T].errorCount,formState:D[T].formState,index:T,uploadEdits:e})},[T,D]),eu=c.default.useCallback(()=>{P({type:"REPLACE",state:{forms:D.map(e=>({...e,uploadEdits:{}}))}})},[D]);return c.default.useEffect(()=>{L&&(j||ee(),$||Z(),(I||F)&&E(!j||!$),j&&(F?.length||I?.length)&&!G.current&&(F?.length&&ea(F),I?.length&&en(I),G.current=!0))},[I,ee,Z,L,j,$,F]),(0,h.jsxs)(hV,{value:{activeIndex:N.activeIndex,addFiles:er,bulkUpdateForm:es,collectionSlug:L,docPermissions:b,documentSlots:u,forms:D,getFormDataRef:Q,hasPublishPermission:w,hasSavePermission:y,hasSubmitted:m,isInitializing:k,removeFile:el,resetUploadEdits:eu,saveAllDocs:eo,setActiveIndex:et,setFormTotalErrorCount:ei,totalErrorCount:R,updateUploadEdits:ec},children:[H&&(0,h.jsx)(fD,{animationDuration:"250ms",loadingText:K,overlayType:"fullscreen",show:!0}),e]})}function hK(){return c.default.use(hV)}var hW=(e,t)=>e?_(t)&&t.name?`${e}.${t.name}`:e:_(t)?t.name:"",hG=({CustomLabel:e,field:t,prefix:r})=>(0,h.jsxs)(c.Fragment,{children:[r?(0,h.jsxs)(c.Fragment,{children:[(0,h.jsx)("span",{style:{display:"inline-block"},children:r})," > "]}):null,(0,h.jsx)("span",{style:{display:"inline-block"},children:(0,h.jsx)(r7,{CustomComponent:e,Fallback:(0,h.jsx)(iR,{label:"label"in t&&t.label})})})]}),hY=({fields:e,formState:t,labelPrefix:r=null,parentPath:n="",path:a="",permissions:l})=>{if(!e)return[];let i=t?.[a]?.customComponents?.Label;return e?.reduce((e,t)=>{let{operation:o,permissions:s,read:c}=t9({field:t,operation:"update",parentName:n?.includes(".")?n.split(".")[n.split(".").length-1]:n,permissions:l});return(_(t)||"ui"===t.type)&&(t.admin?.disableBulkEdit||t.unique||$(t)||"readOnly"in t&&t.readOnly||!o||!c)?e:"array"!==t.type&&"blocks"!==t.type&&y(t)?[...e,...hY({fields:t.fields,labelPrefix:hG({CustomLabel:i,field:t,prefix:r}),parentPath:a,path:hW(a,t),permissions:s})]:"tabs"===t.type&&"tabs"in t?[...e,...t.tabs.reduce((e,n)=>{if("fields"in n){let l="name"in n&&n.name;return[...e,...hY({fields:n.fields,labelPrefix:r,parentPath:a,path:l?hW(a,t):a,permissions:s})]}},[])]:[...e,{label:hG({CustomLabel:i,field:t,prefix:r}),value:{field:t,fieldPermissions:s,path:hW(a,t)}}]},[])},hQ=e=>{let t=(0,v.c)(14),{fields:r,onChange:n,permissions:a}=e,{t:l}=(0,f.d)(),{dispatchFields:i,getFields:o}=nm(),s;t[0]!==r||t[1]!==o||t[2]!==a?(s=()=>{let e;return hY({fields:(e=["file","mimeType","thumbnailURL","width","height","filesize","filename","url","focalX","focalY","sizes"],r.filter(t=>!e.includes("name"in t&&t.name))),formState:o(),permissions:a})},t[0]=r,t[1]=o,t[2]=a,t[3]=s):s=t[3];let[u]=(0,c.useState)(s),d;if(t[4]!==i||t[5]!==o||t[6]!==n||t[7]!==u||t[8]!==l){let e;t[10]!==i||t[11]!==o||t[12]!==n?(e=e=>
48n({dispatchFields:i,formState:o(),selected:e}),t[10]=i,t[11]=o,t[12]=n,t[13]=e):e=t[13],d=(0,h.jsxs)("div",{className:"field-select",children:[(0,h.jsx)(iR,{label:l("fields:selectFieldsToEdit")}),(0,h.jsx)(d0,{getOptionValue:hX,isMulti:!0,onChange:e,options:u})]}),t[4]=i,t[5]=o,t[6]=n,t[7]=u,t[8]=l,t[9]=d}else d=t[9];return d};function hX(e){return"object"==typeof e.value&&"path"in e.value?String(e.value.path):String(e.value)}var hJ=e=>{let{collection:{fields:t,labels:{plural:r,singular:n}}={},collection:a,drawerSlug:l,forms:i}=e,[o,s]=(0,c.useState)(!1),{permissions:u}=iS(),{i18n:d,t:p}=(0,f.d)(),{closeModal:g}=lc(),{bulkUpdateForm:b}=hK(),{getFormState:v}=fg(),y=c.default.useRef(null),[x,w]=(0,c.useState)([]),C=u?.collections?.[a.slug],j=(0,c.useMemo)(()=>rE(x.reduce((e,t)=>(e[t.value.path]=!0,e),{})),[x]),S=(0,c.useCallback)(async({formState:e,submitted:t})=>{let r=fO(y),{state:n}=await v({collectionSlug:a.slug,docPermissions:C,docPreferences:null,formState:e,operation:"update",schemaPath:a.slug,select:j,signal:r.signal,skipValidation:!t});return y.current=null,n},[v,a,C,j]);(0,c.useEffect)(()=>{let e=y.current;return()=>{fA(e)}},[]);let $=(0,c.useCallback)(e=>{b(x.reduce((t,r)=>(e[r.value.path]&&(t[r.value.path]=e[r.value.path].value),t),{}),()=>g(l))},[g,l,b,x]),_=(0,c.useCallback)(async({dispatchFields:e,formState:t,selected:r})=>{s(!0),w(r||[]);let{state:n}=await v({collectionSlug:a.slug,docPermissions:C,docPreferences:null,formState:t,operation:"update",schemaPath:a.slug,select:rE(r.reduce((e,t)=>(e[t.value.path]=!0,e),{})),skipValidation:!0});e({type:"UPDATE_MANY",formState:n}),s(!1)},[v,a,C]);return(0,h.jsxs)("div",{className:`${hZ}__main`,children:[(0,h.jsxs)("div",{className:`${hZ}__header`,children:[(0,h.jsx)("h2",{className:`${hZ}__header__title`,children:p("general:editingLabel",{count:i.length,label:m(i.length>1?r:n,d)})}),(0,h.jsx)("button",{"aria-label":p("general:close"),className:`${hZ}__header__close`,id:`close-drawer__${l}`,onClick:()=>g(l),type:"button",children:(0,h.jsx)(f.a,{})})]}),(0,h.jsxs)(hm,{className:`${hZ}__form`,isInitializing:o,onChange:[S],onSubmit:$,children:[(0,h.jsx)(hQ,{fields:t,onChange:_,permissions:C.fields}),0===x.length?null:(0,h.jsx)("div",{className:"render-fields",children:(0,h.jsx)(oI,{value:void 0,children:x.map((e,t)=>{let{value:{field:r,fieldPermissions:n,path:a}}=e;return(0,h.jsx)(gV,{clientFieldConfig:r,indexPath:"",parentPath:"",parentSchemaPath:"",path:a,permissions:n},`${a}-${t}`)})})}),(0,h.jsx)("div",{className:`${hZ}__sidebar-wrap`,children:(0,h.jsx)("div",{className:`${hZ}__sidebar`,children:(0,h.jsx)("div",{className:`${hZ}__sidebar-sticky-wrap`,children:(0,h.jsx)("div",{className:`${hZ}__document-actions`,children:(0,h.jsx)(au,{type:"submit",children:p("general:applyChanges")})})})})})]})]})},hZ="edit-many-bulk-uploads",h0=e=>{let t,r=(0,v.c)(5),{collection:n,collection:a}=e,{slug:l}=void 0===n?{}:n,{permissions:i}=iS(),{t:o}=(0,f.d)(),{forms:s}=hK(),c=i?.collections?.[l]?.update,u=`edit-${l}-bulk-uploads`;return c?(r[0]!==a||r[1]!==u||r[2]!==s||r[3]!==o?(t=(0,h.jsxs)("div",{className:hZ,children:[(0,h.jsx)(id,{"aria-label":o("general:editAll"),className:`${hZ}__toggle`,slug:u,children:o("general:editAll")}),(0,h.jsx)(aZ,{children:(0,h.jsx)(ip,{Header:null,slug:u,children:(0,h.jsx)(hJ,{collection:a,drawerSlug:u,forms:s})})})]}),r[0]=a,r[1]=u,r[2]=s,r[3]=o,r[4]=t):t=r[4],t):null},h1="bulk-upload--actions-bar";function h2(e){let t=(0,v.c)(15),{collectionConfig:r}=e,{activeIndex:n,forms:a,setActiveIndex:l}=hK(),{t:i}=(0,f.d)(),o=n+1,s;if(t[0]!==n||t[1]!==r||t[2]!==a.length||t[3]!==l||t[4]!==i||t[5]!==o){let e,c;t[7]!==n||t[8]!==a.length||t[9]!==l?(e=()=>{let e=n-1;e<0?l(a.length-1):l(e)},t[7]=n,t[8]=a.length,t[9]=l,t[10]=e):e=t[10],t[11]!==n||t[12]!==a.length||t[13]!==l?(c=()=>{let e=n+1;e===a.length?l(0):l(e)},t[11]=n,t[12]=a.length,t[13]=l,t[14]=c):c=t[14],s=(0,h.jsxs)("div",{className:h1,children:[(0,h.jsxs)("div",{className:`${h1}__navigation`,children:[(0,h.jsxs)("p",{className:`${h1}__locationText`,children:[(0,h.jsx)("strong",{children:o}),` ${i("general:of")} `,(0,h.jsx)("strong",{children:a.length})]}),(0,h.jsxs)("div",{className:`${h1}__controls`,children:[(0,h.jsx)(au,{"aria-label":i("general:previous"),buttonStyle:"none",onClick:e,type:"button",children:(0,h.jsx)(nZ,{direction:"left"})}),(0,h.jsx)(au,{"aria-label":i("general:next"),buttonStyle:"none",onClick:c,type:"button",children:(0,h.jsx)(nZ,{direction:"right"})})]}),(0,h.jsx)(h0,{collection:r})]}),(0,h.jsx)(h3,{className:`${h1}__saveButtons`})]}),t[0]=n,t[1]=r,t[2]=a.length,t[3]=l,t[4]=i,t[5]=o,t[6]=s}else s=t[6];return s}function h3(e){let t=(0,v.c)(12),{className:r}=e,{getEntityConfig:n}=(0,d.c)(),{t:a}=(0,f.d)(),{collectionSlug:l,hasPublishPermission:i,hasSavePermission:o,saveAllDocs:s}=hK(),c;t[0]!==l||t[1]!==n?(c=n({collectionSlug:l}),t[0]=l,t[1]=n,t[2]=c):c=t[2];let u=c,p;t[3]!==r?(p=[`${h1}
48__buttons`,r].filter(Boolean),t[3]=r,t[4]=p):p=t[4];let m=p.join(" "),g;return t[5]!==u?.versions?.drafts||t[6]!==i||t[7]!==o||t[8]!==s||t[9]!==a||t[10]!==m?(g=(0,h.jsxs)("div",{className:m,children:[u?.versions?.drafts&&o?(0,h.jsx)(au,{buttonStyle:"secondary",onClick:()=>{s({overrides:{_status:"draft"}})},children:a("version:saveDraft")}):null,u?.versions?.drafts&&i?(0,h.jsx)(au,{onClick:()=>{s({overrides:{_status:"published"}})},children:a("version:publish")}):null,!u?.versions?.drafts&&o?(0,h.jsx)(au,{onClick:()=>{s()},children:a("general:save")}):null]}),t[5]=u?.versions?.drafts,t[6]=i,t[7]=o,t[8]=s,t[9]=a,t[10]=m,t[11]=g):g=t[11],g}var h6="bulk-upload--discard-without-saving";function h5(){let e=(0,v.c)(9),{t:t}=(0,f.d)(),{closeModal:r}=lc(),{drawerSlug:n}=gP(),a;e[0]!==r?(a=()=>{r(h6)},e[0]=r,e[1]=a):a=e[1];let l=a,i;e[2]!==r||e[3]!==n?(i=()=>{r(n),r(h6)},e[2]=r,e[3]=n,e[4]=i):i=e[4];let o=i,s;return e[5]!==l||e[6]!==o||e[7]!==t?(s=(0,h.jsx)(iv,{body:t("general:changesNotSaved"),cancelLabel:t("general:stayOnThisPage"),confirmLabel:t("general:leaveAnyway"),heading:t("general:leaveWithoutSaving"),modalSlug:h6,onCancel:l,onConfirm:o}),e[5]=l,e[6]=o,e[7]=t,e[8]=s):s=e[8],s}function h4({className:e}){return(0,h.jsx)("svg",{className:[e,"icon icon--trash"].filter(
48Boolean).join(" "),fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,h.jsx)("path",{d:"M4.1499 6.1H15.8499M14.5499 6.1V15.2C14.5499 15.85 13.8999 16.5 13.2499 16.5H6.7499C6.0999 16.5 5.4499 15.85 5.4499 15.2V6.1M7.3999 6.1V4.8C7.3999 4.15 8.0499 3.5 8.6999 3.5H11.2999C11.9499 3.5 12.5999 4.15 12.5999 4.8V6.1M8.6999 9.35V13.25M11.2999 9.35V13.25",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})})}var h8=()=>{let{getEntityConfig:e}=(0,d.c)(),{collectionSlug:t}=oD(),{labels:r}=e({collectionSlug:t}),{i18n:n}=(0,f.d)();return(0,h.jsxs)("div",{className:"trash-banner",children:[(0,h.jsx)(h4,{}),(0,h.jsx)("p",{children:n.t("general:documentIsTrashed",{label:`${m(r?.singular,n)}`})})]})},h7="document-fields",h9=({AfterFields:e,BeforeFields:t,docPermissions:r,fields:n,forceSidebarWrap:a,isTrashed:l=!1,readOnly:i,schemaPathSegments:o})=>{let{hasSidebarFields:s,mainFields:u,sidebarFields:d}=(0,c.useMemo)(()=>n.reduce((e,t)=>(j(t)?(e.sidebarFields.push(t),e.mainFields.push(null),e.hasSidebarFields=!0):(e.mainFields.push(t),e.sidebarFields.push(null)),e),{hasSidebarFields:!1,mainFields:[],sidebarFields:[]}),[n]);return(0,h.jsxs)("div",{className:[h7,s?`${h7}--has-sidebar`:`${h7}--no-sidebar`,a&&`${h7}--force-sidebar-wrap`].filter(Boolean).join(" "),children:[(0,h.jsx)("div",{className:`${h7}__main`,children:(0,h.jsxs)(io,{className:`${h7}__edit`,children:[l&&(0,h.jsx)(h8,{}),t,(0,h.jsx)(gq,{className:`${h7}__fields`,fields:u,forceRender:!0,parentIndexPath:"",parentPath:"",parentSchemaPath:o.join("."),permissions:r?.fields,readOnly:i}),e]})}),s?(0,h.jsx)("div",{className:`${h7}__sidebar-wrap`,children:(0,h.jsx)("div",{className:`${h7}__sidebar`,children:(0,h.jsx)("div",{className:`${h7}__sidebar-fields`,children:(0,h.jsx)(gq,{fields:d,forceRender:!0,parentIndexPath:"",parentPath:"",parentSchemaPath:o.join("."),permissions:r?.fields,readOnly:i})})})}):null]})};function me({className:e}){return(0,h.jsx)("svg",{className:[e,"icon icon--folder"].filter(Boolean).join(" "),fill:"none",height:"16",viewBox:"0 0 16 16",width:"16",xmlns:"http://www.w3.org/2000/svg",children:(0,h.jsx)("path",{d:"M13.3333 13.3333C13.6869 13.3333 14.026 13.1929 14.2761 12.9428C14.5261 12.6928 14.6666 12.3536 14.6666 12V5.33333C14.6666 4.97971 14.5261 4.64057 14.2761 4.39052C14.026 4.14048 13.6869 4 13.3333 4H8.06659C7.84359 4.00219 7.62362 3.94841 7.42679 3.84359C7.22996 3.73877 7.06256 3.58625 6.93992 3.4L6.39992 2.6C6.27851 2.41565 6.11323 2.26432 5.91892 2.1596C5.7246 2.05488 5.50732 2.00004 5.28659 2H2.66659C2.31296 2 1.97382 2.14048 1.72378 2.39052C1.47373 2.64057 1.33325 2.97971 1.33325 3.33333V12C1.33325 12.3536 1.47373 12.6928 1.72378 12.9428C1.97382 13.1929 2.31296 13.3333 2.66659 13.3333H13.3333Z",fill:"currentColor"})})}var mt=c.default.createContext({activeCollectionFolderSlugs:[],allCollectionFolderSlugs:[],allowCreateCollectionSlugs:[],breadcrumbs:[],checkIfItemIsDisabled:()=>!1,clearSelections:()=>{},currentFolder:null,documents:[],dragOverlayItem:void 0,focusedRowIndex:-1,folderCollectionConfig:null,folderCollectionSlug:"",folderFieldName:"folder",folderID:void 0,FolderResultsComponent:null,folderType:void 0,getFolderRoute:()=>"",getSelectedItems:()=>[],isDragging:!1,itemKeysToMove:void 0,moveToFolder:()=>Promise.resolve(void 0),onItemClick:()=>{},onItemKeyPress:()=>{},refineFolderData:()=>{},search:"",selectedFolderCollections:void 0,selectedItemKeys:new Set,setBreadcrumbs:()=>{},setFocusedRowIndex:()=>-1,setIsDragging:()=>!1,sort:"name",subfolders:[]});function mr({activeCollectionFolderSlugs:e,allCollectionFolderSlugs:t=[],allowCreateCollectionSlugs:r,allowMultiSelection:n=!0,baseFolderPath:a,breadcrumbs:l=[],children:i,documents:o,folderFieldName:s,folderID:u,FolderResultsComponent:p,onItemClick:m,search:g,sort:v="name",subfolders:y}){let x=mn(),{config:w}=(0,d.c)(),{routes:C}=w,j=ig(),{t:S}=(0,f.d)(),$=(0,b.useRouter)(),{startRouteTransition:_}=nK(),k=iP(),E=k?k.code:void 0,N=c.default.useRef(new Set),[P,T]=c.default.useState([]),[D,R]=c.default.useState(p||(()=>null)),[A]=c.default.useState(()=>w.collections.find(e=>w.folders&&e.slug===w.folders.slug)),O=A.slug,L=(0,b.useSearchParams)(),M=c.default.useMemo(()=>fc(L),[L]),[I,F]=c.default.useState(M),[B,z]=c.default.useState(!1),[U,V]=c.default.useState(()=>new Set),[H,q]=c.default.useState(-1),[K,W]=c.default.useState(),[G,Y]=c.default.useState(l),Q=c.default.useRef(null),X=y.length+o.length,J=c.default.useCallback(()=>
48{q(-1),V(new Set),W(void 0),N.current=new Set},[]),Z=c.default.useCallback((e={})=>{let t="page"in e?e.page:I?.page;return"search"in e&&(t="1"),{...I,...e,locale:E,page:t,relationTo:"relationTo"in e?e.relationTo:I?.relationTo,search:"search"in e?e.search:I?.search,sort:"sort"in e?e.sort:I?.sort??void 0}},[I,E]),ee=c.default.useCallback(({query:e,updateURL:t})=>{if(t){let t=Z(e);_(()=>$.replace(`${t6({...t,relationTo:JSON.stringify(t.relationTo)},{addQueryPrefix:!0})}`)),F(t)}},[Z,$,_]),et=c.default.useCallback(e=>{let t=t6(Z({page:"1",search:""}),{addQueryPrefix:!0});return tR({adminRoute:w.routes.admin,path:`${a}${e?`/${e}`:""}${t}`})},[a,w.routes.admin,Z]),er=c.default.useCallback(e=>[...y,...o].find(t=>t.itemKey===e),[o,y]),en=c.default.useCallback(()=>Array.from(U).reduce((e,t)=>{let r=er(t);return r&&e.push(r),e},[]),[U,er]),ea=c.default.useCallback(({collectionSlug:e,docID:t})=>{1===j?e===O?_(()=>{$.push(et(t)),J()}):e&&_(()=>{$.push(tR({adminRoute:w.routes.admin,path:`/collections/${e}/${t}`})),J()}):J(),"function"==typeof m&&m(er(`${e}-${t}`))},[J,w.routes.admin,j,O,et,er,m,$,_]),el=c.default.useCallback(e=>{let t=[...y,...o].reduce((e,t,r)=>(U.has(t.itemKey)&&e.push(r),e),[]);if(0===t.length)return[e];let r=Math.min(...t),n=Math.max(...t),a=e>=r&&e<=n,l=e,i=Math.min(l=a?e===r||e===n?e:Math.abs(e-r)>=Math.abs(e-n)?r:n:Math.abs(e-r)<=Math.abs(e-n)?r:n,e),s=Array.from({length:Math.max(l,e)-i+1},(e,t)=>i+t);return a?s:[...new Set([...t,...s])]},[y,o,U]),ei=c.default.useCallback(({indexes:e})=>{let{newSelectedFolderCollections:t,newSelectedItemKeys:r}=[...y,...o].reduce((t,r,n)=>(e.includes(n)&&(t.newSelectedItemKeys.add(r.itemKey),r.relationTo===O?r.value.folderType?.forEach(e=>{t.newSelectedFolderCollections.includes(e)||t.newSelectedFolderCollections.push(e)}):t.newSelectedFolderCollections.includes(r.relationTo)||t.newSelectedFolderCollections.push(r.relationTo)),t),{newSelectedFolderCollections:[],newSelectedItemKeys:new Set});T(t),V(r)},[o,O,y]),eo=c.default.useCallback(({event:e,item:t})=>{let{code:r,ctrlKey:a,metaKey:l,shiftKey:i}=e,s=a||l,c=U.has(t.itemKey),u=[...y,...o],d=u.findIndex(e=>e.itemKey===t.itemKey);switch(r){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":{if(e.preventDefault(),-1===d)break;let t="ArrowLeft"===r||"ArrowUp"===r?d-1:d+1;if(t<0||t>X-1)return;if(q(t),s)break;if(i&&n)return void ei({indexes:el(t)});i||V(new Set([u[t].itemKey]));break}case"Enter":if(1===U.size){q(void 0),ea({collectionSlug:t.relationTo,docID:rD(t.value)});return}break;case"Escape":J();break;case"KeyA":n&&s&&(e.preventDefault(),q(X-1),ei({indexes:Array.from({length:X},(e,t)=>t)}));break;case"Space":n&&i?(e.preventDefault(),ei({indexes:[...y,...o].reduce((e,r,n)=>{if(r.itemKey===t.itemKey){if(c)return e;e.push(n)}else U.has(r.itemKey)&&e.push(n);return e},[])})):(e.preventDefault(),ei({indexes:c?[]:[d]}));break;case"Tab":if(n&&i){let e=d-1;e<0&&U?.size>0&&q(e)}else d+1===X&&U.size>0&&q(X-1)}},[U,y,o,n,el,ei,ea,J,X]),es=c.default.useCallback(({event:e,item:t})=>{let r=!1,a=e.ctrlKey||e.metaKey,l=e.shiftKey,i=U.has(t.itemKey),s=[...y,...o],c=s.findIndex(e=>e.itemKey===t.itemKey);if(n&&a){let r;e.preventDefault(),ei({indexes:s.reduce((n,a,l)=>{if(a.itemKey===t.itemKey){if(i&&"pointermove"!==e.type)return n;n.push(l),r=a.itemKey}else U.has(a.itemKey)&&n.push(l);return n},[])}),r&&W(er(r))}else if(n&&l)-1!==c&&ei({indexes:el(c)});else if(n&&"pointermove"===e.type)i||ei({indexes:s.reduce((e,r,n)=>(r.itemKey===t.itemKey&&e.push(n),e),[])}),W(er(t.itemKey));else{let e=Date.now();r=e-Q.current<400&&K?.itemKey===t.itemKey,Q.current=e,r||ei({indexes:i&&1===U.size?[]:[c]}),W(er(t.itemKey))}r&&ea({collectionSlug:t.relationTo,docID:rD(t.value)})},[U,y,o,n,K,er,ei,ea,el]),ec=c.default.useCallback(async e=>{let{itemsToMove:t,toFolderID:r}=e;if(t.length){if(1===t.length&&t[0].relationTo===O&&t[0].value.id===u){let e=t6({depth:0,locale:E},{addQueryPrefix:!0});200!==(await fetch(tR({apiRoute:C.api,path:`/${O}/${u}${e}`}),{body:JSON.stringify({[s]:r||null}),credentials:"include",headers:{"content-type":"application/json"},method:"PATCH"})).status&&nI.error(S("general:error"))}else for(let[e,n]of Object.entries(t.reduce((e,t)=>
48(e[t.relationTo]||(e[t.relationTo]=[]),e[t.relationTo].push(t.value.id),e),{}))){let t=t6({depth:0,limit:0,locale:E,where:{id:{in:n}}},{addQueryPrefix:!0});try{await fetch(tR({apiRoute:C.api,path:`/${e}${t}`}),{body:JSON.stringify({[s]:r||null}),credentials:"include",headers:{"content-type":"application/json"},method:"PATCH"})}catch(e){nI.error(S("general:error")),console.error(e);continue}}J()}},[u,J,O,s,C.api,S,E]),eu=c.default.useCallback(e=>{function t({item:e,selectedFolderCollections:r}){return!(!e.value.folderType||Array.isArray(e.value.folderType)&&0===e.value.folderType.length)&&(0===r.length?!!(e.value.folderType||e.value.folderType.length>0):r.some(t=>!e.value.folderType.includes(t)))}return B?!!U.has(e.itemKey)||e.relationTo!==O||t({item:e,selectedFolderCollections:P}):x?.selectedItemKeys?.size?!!x.selectedItemKeys.has(e.itemKey)||e.relationTo!==O||t({item:e,selectedFolderCollections:x.selectedFolderCollections}):void 0},[P,B,U,O,x?.selectedFolderCollections,x?.selectedItemKeys]);return c.default.useEffect(()=>{p&&R(p)},[p]),(0,h.jsx)(mt,{value:{activeCollectionFolderSlugs:e||t,allCollectionFolderSlugs:t,allowCreateCollectionSlugs:r,breadcrumbs:G,checkIfItemIsDisabled:eu,clearSelections:J,currentFolder:G?.[G.length-1]?.id!==void 0?function({folderFieldName:e,isUpload:t,relationTo:r,useAsTitle:n,value:a}){let l={id:a?.id,_folderOrDocumentTitle:String(n&&a?.[n]||a.id),createdAt:a?.createdAt,folderID:a?.[e],folderType:a?.folderType||[],updatedAt:a?.updatedAt};return t&&(l.filename=a.filename,l.mimeType=a.mimeType,l.url=a.thumbnailURL||(rg(a.mimeType)?rm({sizes:a.sizes,targetSizeMax:520,targetSizeMin:300,url:a.url,width:a.width}):void 0)),{itemKey:`${r}-${a.id}`,relationTo:r,value:l}}({folderFieldName:s,isUpload:!1,relationTo:O,useAsTitle:A.admin.useAsTitle,value:G[G.length-1]}):null,documents:o,dragOverlayItem:K,focusedRowIndex:H,folderCollectionConfig:A,folderCollectionSlug:O,folderFieldName:s,folderID:u,FolderResultsComponent:D,folderType:G?.[G.length-1]?.folderType,getFolderRoute:et,getSelectedItems:en,isDragging:B,itemKeysToMove:x.selectedItemKeys,moveToFolder:ec,onItemClick:es,onItemKeyPress:eo,refineFolderData:ee,search:g,selectedFolderCollections:P,selectedItemKeys:U,setBreadcrumbs:Y,setFocusedRowIndex:q,setIsDragging:z,sort:v,subfolders:y},children:i})}function mn(){let e=c.default.use(mt);if(void 0===e)throw Error("useFolder must be used within a FolderProvider");return e}var ma=(0,c.createContext)({cachingEnabled:!0,clearRouteCache:()=>{}}),ml=e=>{let t,r,n,a,l=(0,v.c)(17),{cachingEnabled:i,children:o}=e,s=void 0===i||i,u=(0,b.usePathname)(),d=(0,b.useRouter)(),f=(0,c.useRef)(!1),p;l[0]!==d?(p=()=>{d.refresh()},l[0]=d,l[1]=p):p=l[1];let m=p,g;l[2]===Symbol.for("react.memo_cache_sentinel")?(g=()=>{let e=()=>{f.current=!0};return window.addEventListener("popstate",e),()=>{window.removeEventListener("popstate",e)}},l[2]=g):g=l[2],l[3]!==d?(t=[d],l[3]=d,l[4]=t):t=l[4],(0,c.useEffect)(g,t),l[5]!==s||l[6]!==m?(r=e=>{(s||f.current)&&(f.current=!1,m())},l[5]=s,l[6]=m,l[7]=r):r=l[7];let y=ae(r),x;return l[8]!==y||l[9]!==u?(x=()=>{y(u)},l[8]=y,l[9]=u,l[10]=x):x=l[10],l[11]!==u?(n=[u],l[11]=u,l[12]=n):n=l[12],(0,c.useEffect)(x,n),l[13]!==s||l[14]!==o||l[15]!==m?(a=(0,h.jsx)(ma,{value:{cachingEnabled:s,clearRouteCache:m},children:o}),l[13]=s,l[14]=o,l[15]=m,l[16]=a):a=l[16],a},mi=()=>(0,c.use)(ma),mo=e=>{let{type:t="submit",buttonId:r,children:n,disabled:a,onClick:l,programmaticSubmit:i,ref:o}=e,s=ny(),c=nx(),u=nC(),{disabled:d,submit:f}=nm();return(0,h.jsx)("div",{className:"form-submit",children:(0,h.jsx)(au,{ref:o,...e,disabled:!!(a||u||s||c||d)||void 0,id:r,onClick:l??(i?()=>{f()}:void 0),type:t,children:n})})},ms="drawer-action-header",mc=e=>{let t=(0,v.c)(10),{cancelLabel:r,className:n,onCancel:a,onSave:l,saveLabel:i,title:o}=e,{t:s}=(0,f.d)(),c;t[0]!==n?(c=[ms,n].filter(Boolean),t[0]=n,t[1]=c):c=t[1];let u=c.join(" "),d;return t[2]!==r||t[3]!==a||t[4]!==l||t[5]!==i||t[6]!==s||t[7]!==u||t[8]!==o?(d=(0,h.jsx)("div",{className:u,children:(0,h.jsxs)("div",{className:`${ms}__content`,children:[(0,h.jsx)("h1",{className:`${ms}__title`,children:o}),(0,h.jsxs)("div",{className:`${ms}__actions`,children:[(0,h.jsx)(au,{"aria-label":s("general:cancel"),buttonStyle:"secondary",onClick:a,children:r||s("general:cancel")}),(0,h.jsx)(mo,{"aria-label":s("general:applyChanges"),onClick:l,children:i||s("general:applyChanges")}
48)]})]})}),t[2]=r,t[3]=a,t[4]=l,t[5]=i,t[6]=s,t[7]=u,t[8]=o,t[9]=d):d=t[9],d};function mu({children:e,className:t}){return(0,h.jsx)("div",{className:["drawer-content-container",t].filter(Boolean).join(" "),children:e})}var md="create-new-doc-in-folder";function mf(e){let t,r=(0,v.c)(24),{buttonLabel:n,buttonSize:a,buttonStyle:l,collectionSlugs:i,folderAssignedCollections:o,onCreateSuccess:s,slugPrefix:u}=e,p=void 0===a?"small":a,g=void 0===l?"pill":l,b=`${u}-new-doc-in-folder-drawer`,{i18n:y}=(0,f.d)(),{closeModal:x,openModal:w}=lc(),{config:C}=(0,d.c)(),{folderCollectionConfig:j,folderCollectionSlug:S,folderFieldName:$,folderID:_}=mn(),k;r[0]!==S?(k={collectionSlug:S},r[0]=S,r[1]=k):k=r[1];let[E,,N]=fV(k),{closeDrawer:P,openDrawer:T}=N,[D,R]=c.default.useState(),A;r[2]!==i||r[3]!==C?(A=()=>i.reduce((e,t)=>{let r=C.collections.find(e=>{let{slug:r}=e;return r===t});return r&&e.push(r),e},[]),r[2]=i,r[3]=C,r[4]=A):A=r[4];let[O]=c.default.useState(A);return 0===O.length?null:(r[5]!==E||r[6]!==n||r[7]!==p||r[8]!==g||r[9]!==P||r[10]!==x||r[11]!==i||r[12]!==D||r[13]!==O||r[14]!==o||r[15]!==j.slug||r[16]!==$||r[17]!==_||r[18]!==y||r[19]!==b||r[20]!==s||r[21]!==T||r[22]!==w?(t=(0,h.jsxs)(c.default.Fragment,{children:[1===O.length?(0,h.jsx)(au,{buttonStyle:g,className:`${md}__button`,el:"div",onClick:()=>{O[0].slug===j.slug?T():(R(O[0].slug),w(b))},size:p,children:n}):(0,h.jsx)(al,{button:(0,h.jsx)(au,{buttonStyle:g,className:`${md}__popup-button`,el:"div",icon:"chevron",size:p,children:n}),buttonType:"default",className:`${md}__action-popup`,children:(0,h.jsx)(n6.ButtonGroup,{children:O.map((e,t)=>(0,h.jsx)(n6.Button,{onClick:()=>{e.slug===j.slug?T():(R(e.slug),w(b))},children:m(e.labels.singular,y)},t))})}),D&&(0,h.jsx)(fU,{collectionSlug:D,drawerSlug:b,initialData:{[$]:_},onSave:async e=>{let{doc:t}=e;await s({collectionSlug:D,doc:t}),x(b)},redirectAfterCreate:!1}),i.includes(j.slug)&&(0,h.jsx)(E,{initialData:{[$]:_,folderType:D?o||[D]:o},onSave:async e=>{await s({collectionSlug:j.slug,doc:e.doc}),P()},redirectAfterCreate:!1})]}),r[5]=E,r[6]=n,r[7]=p,r[8]=g,r[9]=P,r[10]=x,r[11]=i,r[12]=D,r[13]=O,r[14]=o,r[15]=j.slug,r[16]=$,r[17]=_,r[18]=y,r[19]=b,r[20]=s,r[21]=T,r[22]=w,r[23]=t):t=r[23],t)}var mp=({elements:e,translationString:t})=>{let r=t.split(/(<[^>]+>.*?<\/[^>]+>)/g);return(0,h.jsx)("span",{children:r.map((t,r)=>{if(e&&t.startsWith("<")&&t.endsWith(">")){let n=t[1],a=e[n];if(a){let e=RegExp(`<${n}>(.*?)</${n}>`,"g"),l=t.replace(e,(e,t)=>t);return(0,h.jsx)(a,{children:(0,h.jsx)(mp,{translationString:l})},r)}}return t})})},mh=({elements:e,i18nKey:t,t:r,variables:n})=>{let a=r(t,n||{});return e?(0,h.jsx)(mp,{elements:e,translationString:a}):a},mm="folderBreadcrumbs";function mg({breadcrumbs:e,className:t}){return(0,h.jsx)("div",{className:`${mm} ${t||""}`.trim(),children:e?.map((t,r)=>(0,h.jsxs)("div",{className:`${mm}__crumb`,children:[t.onClick?(0,h.jsx)(mb,{className:`${mm}__crumb-item`,id:t.id,onClick:t.onClick,children:t.name}):t.name,e.length>0&&r!==e.length-1&&(0,h.jsx)(nZ,{className:`${mm}__crumb-chevron`,direction:"right"})]},r))})}function mb(e){let t,r=(0,v.c)(13),{id:n,children:a,className:l,onClick:i}=e,o=`folder-${n}`,s;r[0]!==n?(s={id:n,type:"folder"},r[0]=n,r[1]=s):s=r[1],r[2]!==o||r[3]!==s?(t={id:o,data:s},r[2]=o,r[3]=s,r[4]=t):t=r[4];let{isOver:c,setNodeRef:u}=tj(t),d=c&&"droppable-button--hover",f;r[5]!==l||r[6]!==d?(f=["droppable-button",l,d].filter(Boolean),r[5]=l,r[6]=d,r[7]=f):f=r[7];let p=f.join(" "),m;return r[8]!==a||r[9]!==i||r[10]!==u||r[11]!==p?(m=(0,h.jsx)("button",{className:p,onClick:i,ref:u,type:"button",children:a}),r[8]=a,r[9]=i,r[10]=u,r[11]=p,r[12]=m):m=r[12],m}function mv(){return(0,h.jsx)(me,{className:"colored-folder-icon"})}var my="move-folder-drawer",mx="move-folder-drawer-confirm-move";function mw(e){return(0,h.jsx)(ip,{gutter:!1,Header:null,slug:e.drawerSlug,children:(0,h.jsx)(mC,{...e})})}function mC(e){let{permissions:t}=iS(),[r,n]=c.default.useState([]),[a,l]=c.default.useState([]),[i,o]=c.default.useState([]),[s,u]=c.default.useState(null),[d,f]=c.default.useState(!1),[p,m]=c.default.useState(e.fromFolderID||null),g=c.default.useRef(!1),{getFolderResultsComponentAndData:b}=fg(),v=c.default.useCallback(async t=>{try{let r=await b({browseByFolder:!1,collectionsToDisplay:[e.folderCollectionSlug],displayAs:"grid",folderAssignedCollections:e.folderAssignedCollections,folderID:t,sort:"name"});o(r.breadcrumbs||[]),n(r?.subfolders||[]),l(r?.documents||[]),u(r.FolderResultsComponent||null),m(t),f(!0)}catch{o([]),n([]),l([])}g.current=!0},[b,e.folderAssignedCollections,e.folderCollectionSlug]);return c.default.useEffect(()=>{g.current||v(e.fromFolderID)},[v,e.fromFolderID]),d?(0,h.jsx)(mr,{allCollectionFolderSlugs:[e.folderCollectionSlug],allowCreateCollectionSlugs:t.collections[e.folderCollectionSlug]?.create?[e.folderCollectionSlug]:[],allowMultiSelection:!1,breadcrumbs:i,documents:a,folderFieldName:e.folderFieldName,folderID:p,FolderResultsComponent:s,onItemClick:async e=>{await v(e.value.id)},subfolders:r,children:(0,h.jsx)(mj,{...e,populateMoveToFolderDrawer:v})},p):(0,h.jsx)(fD,{})}function mj(e){let t,r,n,a,l=(0,v.c)(34),{drawerSlug:i,fromFolderID:o,fromFolderName:s,itemsToMove:u,onConfirm:d,populateMoveToFolderDrawer:p,skipConfirmModal:g,...b}=e,{clearRouteCache:y}
48=mi(),{closeModal:x,isModalOpen:w,openModal:C}=lc(),j;l[0]!==u?(j=()=>u.length,l[0]=u,l[1]=j):j=l[1];let[S]=c.default.useState(j),[$,_]=c.default.useState(!1),{i18n:k,t:E}=(0,f.d)(),{breadcrumbs:N,folderCollectionConfig:P,folderCollectionSlug:T,folderFieldName:D,folderID:R,FolderResultsComponent:A,folderType:O,getSelectedItems:L,subfolders:M}=mn(),I;l[2]!==T?(I={collectionSlug:T},l[2]=T,l[3]=I):I=l[3];let[F,,B]=fV(I),{closeDrawer:z,openDrawer:U}=B,V;l[4]!==N||l[5]!==L?(V=()=>{let e=L();if(0!==e.length)return{id:e[0].value.id,name:e[0].value._folderOrDocumentTitle};{let e=N?.[N.length-1];return{id:e?.id||null,name:e?.name||null}}},l[4]=N,l[5]=L,l[6]=V):V=l[6];let H=V,q;l[7]!==T||l[8]!==R||l[9]!==o||l[10]!==p?(q=async e=>{let{collectionSlug:t,doc:r}=e;await p(R),t===T&&(r?.folder&&o===rD(r?.folder)||!o&&!r?.folder)&&_(!0)},l[7]=T,l[8]=R,l[9]=o,l[10]=p,l[11]=q):q=l[11];let K=q,W;l[12]!==H||l[13]!==d?(W=()=>{"function"==typeof d&&d(H())},l[12]=H,l[13]=d,l[14]=W):W=l[14];let G=W,Y,Q;return l[15]!==y||l[16]!==i||l[17]!==$||l[18]!==w?(Y=()=>{!w(i)&&$&&(_(!1),y())},Q=[i,w,y,$],l[15]=y,l[16]=i,l[17]=$,l[18]=w,l[19]=Y,l[20]=Q):(Y=l[19],Q=l[20]),c.default.useEffect(Y,Q),l[21]!==x||l[22]!==i?(t=()=>{x(i)},l[21]=x,l[22]=i,l[23]=t):t=l[23],l[24]!==G||l[25]!==C||l[26]!==g?(r=()=>{g?G():C(mx)},l[24]=G,l[25]=C,l[26]=g,l[27]=r):r=l[27],l[28]!==N.length||l[29]!==p?(n=N.length?()=>{p(null)}:void 0,l[28]=N.length,l[29]=p,l[30]=n):n=l[30],l[31]!==N.length||l[32]!==p?(a=(e,t)=>({id:e.id,name:e.name,onClick:t!==N.length-1?()=>{p(e.id)}:void 0}),l[31]=N.length,l[32]=p,l[33]=a):a=l[33],(0,h.jsxs)("div",{className:my,children:[(0,h.jsx)(mc,{onCancel:t,onSave:r,saveLabel:E("general:select"),title:(0,h.jsx)(mS,{action:b.action,count:S,fromFolderName:o?s:void 0,title:"moveItemToFolder"===b.action?b.title:void 0})}),(0,h.jsxs)("div",{className:`${my}__breadcrumbs-section`,children:[(0,h.jsx)(mg,{breadcrumbs:[{id:null,name:(0,h.jsxs)("span",{className:`${my}__folder-breadcrumbs-root`,children:[(0,h.jsx)(mv,{}),E("folder:folders")]}),onClick:n},...N.map(a)]}),M.length>0&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(au,{buttonStyle:"pill",className:`${my}__add-folder-button`,margin:!1,onClick:()=>{U()},children:E("fields:addLabel",{label:m(P.labels?.singular,k)})}),(0,h.jsx)(F,{initialData:{[D]:R,folderType:O},onSave:e=>{K({collectionSlug:P.slug,doc:e.doc}),z()},redirectAfterCreate:!1})]})]}),(0,h.jsx)(mu,{className:`${my}__body-section`,children:M.length>0?A:(0,h.jsx)(fq,{Actions:[(0,h.jsx)(mf,{buttonLabel:`${E("general:create")} ${m(P.labels?.singular,k).toLowerCase()}`,buttonSize:"medium",buttonStyle:"primary",collectionSlugs:[T],folderAssignedCollections:b.folderAssignedCollections,onCreateSuccess:K,slugPrefix:"create-new-folder-from-drawer--no-results"},"create-folder")],Message:(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)("h3",{children:k.t("general:noResultsFound")}),(0,h.jsx)("p",{children:k.t("general:noResultsDescription")})]})})}),!g&&(0,h.jsx)(iv,{body:(0,h.jsx)(m$,{action:b.action,count:S,fromFolderName:s,title:"moveItemToFolder"===b.action?b.title:void 0,toFolderName:H().name}),confirmingLabel:E("general:moving"),confirmLabel:E("general:move"),heading:E("general:confirmMove"),modalSlug:mx,onConfirm:G})]})}function mS(e){let t=(0,v.c)(14),{t:r}=(0,f.d)();switch(e.action){case"moveItemToFolder":if(e.fromFolderName){let n;return t[0]!==e.fromFolderName||t[1]!==e.title||t[2]!==r?(n=r("folder:movingFromFolder",{fromFolder:e.fromFolderName,title:e.title}),t[0]=e.fromFolderName,t[1]=e.title,t[2]=r,t[3]=n):n=t[3],n}{let n;return t[4]!==e.title||t[5]!==r?(n=r("folder:selectFolderForItem",{title:e.title}),t[4]=e.title,t[5]=r,t[6]=n):n=t[6],n}case"moveItemsToFolder":if(e.fromFolderName){let n=`${e.count} ${r(e.count>1?"general:items":"general:item")}`,a;return t[7]!==e.fromFolderName||t[8]!==r||t[9]!==n?(a=r("folder:movingFromFolder",{fromFolder:e.fromFolderName,title:n}),t[7]=e.fromFolderName,t[8]=r,t[9]=n,t[10]=a):a=t[10],a}{let n=`${e.count} ${r(e.count>1?"general:items":"general:item")}`,a;return t[11]!==r||t[12]!==n?(a=r("folder:selectFolderForItem",{title:n}),t[11]=r,t[12]=n,t[13]=a):a=t[13],a}}}function m$(e){let t=(0,v.c)(14),{t:r}=(0,f.d)();switch(e.action){case"moveItemToFolder":if(e.toFolderName){let n;return t[0]!==e.title||t[1]!==e.toFolderName||t[2]!==r?(n=(0,h.jsx)(mh,{elements:{1:mT,2:mP},i18nKey:"folder:moveItemToFolderConfirmation",t:r,variables:{title:e.title,toFolder:e.toFolderName}}),t[0]=e.title,t[1]=e.toFolderName,t[2]=r,t[3]=n):n=t[3],n}{let n;return t[4]!==e.title||t[5]!==r?(n=(0,h.jsx)(mh,{elements:{1:mN},i18nKey:"folder:moveItemToRootConfirmation",t:r,variables:{title:e.title}}
48),t[4]=e.title,t[5]=r,t[6]=n):n=t[6],n}case"moveItemsToFolder":if(e.toFolderName){let n;return t[7]!==e.count||t[8]!==e.toFolderName||t[9]!==r?(n=(0,h.jsx)(mh,{elements:{1:mE,2:mk},i18nKey:"folder:moveItemsToFolderConfirmation",t:r,variables:{count:e.count,label:r(e.count>1?"general:items":"general:item"),toFolder:e.toFolderName}}),t[7]=e.count,t[8]=e.toFolderName,t[9]=r,t[10]=n):n=t[10],n}{let n;return t[11]!==e.count||t[12]!==r?(n=(0,h.jsx)(mh,{elements:{1:m_},i18nKey:"folder:moveItemsToRootConfirmation",t:r,variables:{count:e.count,label:r(e.count>1?"general:items":"general:item")}}),t[11]=e.count,t[12]=r,t[13]=n):n=t[13],n}}}function m_(e){let{children:t}=e;return(0,h.jsx)("strong",{children:t})}function mk(e){let{children:t}=e;return(0,h.jsx)("strong",{children:t})}function mE(e){let{children:t}=e;return(0,h.jsx)("strong",{children:t})}function mN(e){let{children:t}=e;return(0,h.jsx)("strong",{children:t})}function mP(e){let{children:t}=e;return(0,h.jsx)("strong",{children:t})}function mT(e){let{children:t}=e;return(0,h.jsx)("strong",{children:t})}function mD(e){let t=(0,v.c)(29),{buttonProps:r,className:n,folderCollectionSlug:a,folderFieldName:l}=e,i=void 0===n?"":n,{t:o}=(0,f.d)(),s=nj(mR),u;t[0]!==l?(u=e=>{let[t]=e;return t&&t?.[l]||null},t[0]=l,t[1]=u):u=t[1];let p=nj(u),m=p?.value,{id:g,collectionSlug:b,initialData:y,title:x}=oD(),{setModified:w}=nm(),C;t[2]!==o?(C=()=>`${o("general:loading")}...`,t[2]=o,t[3]=C):C=t[3];let[j,S]=c.default.useState(C),{config:$}=(0,d.c)(),_=(0,c.useId)(),k,E;t[4]!==$.routes.api||t[5]!==a||t[6]!==m||t[7]!==o?(k=()=>{!async function(){if(m&&("string"==typeof m||"number"==typeof m)){let e=await (await fetch(tR({apiRoute:$.routes.api,path:`/${a}/${m}`}))).json();S(e?.name||o("folder:noFolder"))}else S(o("folder:noFolder"))}()},E=[a,$.routes.api,m,o],t[4]=$.routes.api,t[5]=a,t[6]=m,t[7]=o,t[8]=k,t[9]=E):(k=t[8],E=t[9]),c.default.useEffect(k,E);let N=`move-to-folder-${_}`,P;t[10]!==p||t[11]!==s||t[12]!==l||t[13]!==w?(P=e=>{let{id:t}=e;p.value!==t&&(s({type:"UPDATE",path:l,value:t}),w(!0))},t[10]=p,t[11]=s,t[12]=l,t[13]=w,t[14]=P):P=t[14];let T=!p?.value,D;return t[15]!==r||t[16]!==i||t[17]!==b||t[18]!==a||t[19]!==l||t[20]!==m||t[21]!==j||t[22]!==g||t[23]!==y||t[24]!==N||t[25]!==P||t[26]!==T||t[27]!==x?(D=(0,h.jsx)(mA,{buttonProps:r,className:i,collectionSlug:b,docData:y,docID:g,docTitle:x,folderCollectionSlug:a,folderFieldName:l,fromFolderID:m,fromFolderName:j,modalSlug:N,onConfirm:P,skipConfirmModal:T}),t[15]=r,t[16]=i,t[17]=b,t[18]=a,t[19]=l,t[20]=m,t[21]=j,t[22]=g,t[23]=y,t[24]=N,t[25]=P,t[26]=T,t[27]=x,t[28]=D):D=t[28],D}function mR(e){let[,t]=e;return t}var mA=e=>{let t=(0,v.c)(22),{buttonProps:r,className:n,collectionSlug:a,docData:l,docID:i,docTitle:o,folderCollectionSlug:s,folderFieldName:c,fromFolderID:u,fromFolderName:p,modalSlug:g,onConfirm:b,skipConfirmModal:y}=e,{getEntityConfig:x}=(0,d.c)(),{i18n:w,t:C}=(0,f.d)(),{closeModal:j,openModal:S}=lc(),$=ig(),_;if(t[0]!==r||t[1]!==n||t[2]!==j||t[3]!==a||t[4]!==l||t[5]!==i||t[6]!==o||t[7]!==$||t[8]!==s||t[9]!==c||t[10]!==u||t[11]!==p||t[12]!==x||t[13]!==w||t[14]!==g||t[15]!==b||t[16]!==S||t[17]!==y||t[18]!==C){let e=iu({slug:g,depth:$}),d=o||m(x({collectionSlug:a}).labels.singular,w),f;t[20]!==n?(f=["move-doc-to-folder",n].filter(Boolean),t[20]=n,t[21]=f):f=t[21],_=(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(au,{buttonStyle:"subtle",className:f.join(" "),icon:(0,h.jsx)(me,{}),iconPosition:"left",onClick:()=>{S(e)},...r,children:p}),(0,h.jsx)(mw,{action:"moveItemToFolder",drawerSlug:e,folderAssignedCollections:[a],folderCollectionSlug:s,folderFieldName:c,fromFolderID:u,fromFolderName:p,itemsToMove:[{itemKey:`${a}-${i}`,relationTo:a,value:{...l,id:i}}],onConfirm:async t=>{if(u!==t.id&&"function"==typeof b)try{await b(t),t.id?nI.success(C("folder:itemHasBeenMoved",{folderName:`"${t.name}"`,title:d})):nI.success(C("folder:itemHasBeenMovedToRoot",{title:d}))}catch(e){}j(e)},skipConfirmModal:y,title:d})]}),t[0]=r,t[1]=n,t[2]=j,t[3]=a,t[4]=l,t[5]=i,t[6]=o,t[7]=$,t[8]=s,t[9]=c,t[10]=u,t[11]=p,t[12]=x,t[13]=w,t[14]=g,t[15]=b,t[16]=S,t[17]=y,t[18]=C,t[19]=_}else _=t[19];return _},mO={x:0,y:0,width:0,height:0,unit:"px"},mL=(e,t,r)=>
48Math.min(Math.max(e,t),r),mM=(e,t)=>e===t||e.width===t.width&&e.height===t.height&&e.x===t.x&&e.y===t.y&&e.unit===t.unit;function mI(e,t,r){return"%"===e.unit?{...mO,...e,unit:"%"}:{unit:"%",x:e.x?e.x/t*100:0,y:e.y?e.y/r*100:0,width:e.width?e.width/t*100:0,height:e.height?e.height/r*100:0}}function mF(e,t,r){return e.unit?"px"===e.unit?{...mO,...e,unit:"px"}:{unit:"px",x:e.x?e.x*t/100:0,y:e.y?e.y*r/100:0,width:e.width?e.width*t/100:0,height:e.height?e.height*r/100:0}:{...mO,...e,unit:"px"}}function mB(e,t,r,n,a,l=0,i=0,o=n,s=a){let c={...e},u=Math.min(l,n),d=Math.min(i,a),f=Math.min(o,n),p=Math.min(s,a);t&&(t>1?(d=(u=i?i*t:u)/t,f=o*t):(u=(d=l?l/t:d)*t,p=s/t)),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 m=a-(c.y+c.height);if(m<0&&(c.y=Math.min(c.y,a-d),c.height+=m),c.width<u&&(("sw"===r||"nw"==r)&&(c.x-=u-c.width),c.width=u),c.height<d&&(("nw"===r||"ne"==r)&&(c.y-=d-c.height),c.height=d),c.width>f&&(("sw"===r||"nw"==r)&&(c.x-=f-c.width),c.width=f),c.height>p&&(("nw"===r||"ne"==r)&&(c.y-=p-c.height),c.height=p),t){let e=c.width/c.height;if(e<t){let e=Math.max(c.width/t,d);("nw"===r||"ne"==r)&&(c.y-=e-c.height),c.height=e}else if(e>t){let e=Math.max(c.height*t,u);("sw"===r||"nw"==r)&&(c.x-=e-c.width),c.width=e}}return c}var mz={capture:!0,passive:!1},mU=class e extends c.PureComponent{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=(0,c.createRef)(),this.mediaRef=(0,c.createRef)(),this.initChangeCalled=!1,this.state={cropIsActive:!1,newCropIsBeingDrawn:!1},this.onCropPointerDown=e=>{let{crop:t,disabled:r}=this.props,n=this.getBox();if(!t)return;let a=mF(t,n.width,n.height);if(r)return;e.cancelable&&e.preventDefault(),this.bindDocMove(),this.componentRef.current.focus({preventScroll:!0});let l=e.target.dataset.ord,i=e.clientX,o=e.clientY,s=a.x,c=a.y;if(l){let t=e.clientX-n.x,r=e.clientY-n.y,u=0,d=0;"ne"===l||"e"==l?(u=t-(a.x+a.width),d=r-a.y,s=a.x,c=a.y+a.height):"se"===l||"s"===l?(u=t-(a.x+a.width),d=r-(a.y+a.height),s=a.x,c=a.y):"sw"===l||"w"==l?(u=t-a.x,d=r-(a.y+a.height),s=a.x+a.width,c=a.y):("nw"===l||"n"==l)&&(u=t-a.x,d=r-a.y,s=a.x+a.width,c=a.y+a.height),i=s+n.x+u,o=c+n.y+d}this.evData={startClientX:i,startClientY:o,startCropX:s,startCropY:c,clientX:e.clientX,clientY:e.clientY,isResize:!!l,ord:l},this.mouseDownOnCrop=!0,this.setState({cropIsActive:!0})},this.onComponentPointerDown=e=>{let{crop:t,disabled:r,locked:n,keepSelection:a,onChange:l}=this.props,i=this.getBox();if(r||n||a&&t)return;e.cancelable&&e.preventDefault(),this.bindDocMove(),this.componentRef.current.focus({preventScroll:!0});let o=e.clientX-i.x,s=e.clientY-i.y,c={unit:"px",x:o,y:s,width:0,height:0};this.evData={startClientX:e.clientX,startClientY:e.clientY,startCropX:o,startCropY:s,clientX:e.clientX,clientY:e.clientY,isResize:!0},this.mouseDownOnCrop=!0,l(mF(c,i.width,i.height),mI(c,i.width,i.height)),this.setState({cropIsActive:!0,newCropIsBeingDrawn:!0})},this.onDocPointerMove=e=>{let t,{crop:r,disabled:n,onChange:a,onDragStart:l}=this.props,i=this.getBox();if(n||!r||!this.mouseDownOnCrop)return;e.cancelable&&e.preventDefault(),this.dragStarted||(this.dragStarted=!0,l&&l(e));let{evData:o}=this;o.clientX=e.clientX,o.clientY=e.clientY,mM(r,t=o.isResize?this.resizeCrop():this.dragCrop())||a(mF(t,i.width,i.height),mI(t,i.width,i.height))},this.onComponentKeyDown=t=>{let{crop:r,disabled:n,onChange:a,onComplete:l}=this.props;if(n)return;let i=t.key,o=!1;if(!r)return;let s=this.getBox(),c=this.makePixelCrop(s),u=(navigator.platform.match("Mac")?t.metaKey:t.ctrlKey)?e.nudgeStepLarge:t.shiftKey?e.nudgeStepMedium:e.nudgeStep;if("ArrowLeft"===i?(c.x-=u,o=!0):"ArrowRight"===i?(c.x+=u,o=!0):"ArrowUp"===i?(c.y-=u,o=!0):"ArrowDown"===i&&(c.y+=u,o=!0),o){t.cancelable&&t.preventDefault(),c.x=mL(c.x,0,s.width-c.width),c.y=mL(c.y,0,s.height-c.height);let e=mF(c,s.width,s.height),r=mI(c,s.width,s.height);a(e,r),l&&l(e,r)}},this.onHandlerKeyDown=(t,r)=>{var n,a;let l,{aspect:i=0,crop:o,disabled:s,minWidth:c=0,minHeight:u=0,maxWidth:d,maxHeight:f,onChange:p,onComplete:h}=this.props,m=this.getBox();if(s||!o||"ArrowUp"!==t.key&&"ArrowDown"!==t.key&&"ArrowLeft"!==t.key&&"ArrowRight"!==t.key)return;t.stopPropagation(),t.preventDefault();let g=(navigator.platform.match("Mac")?t.metaKey:t.ctrlKey)?e.nudgeStepLarge:t.shiftKey?e.nudgeStepMedium:e.nudgeStep,b=mB((n=mF(o,m.width,m.height),a=t.key,l={...n},"ArrowLeft"===a?"nw"===r?(l.x-=g,l.y-=g,l.width+=g,l.height+=g):"w"===r?(l.x-=g,l.width+=g):"sw"===r?(l.x-=g,l.width+=g,l.height+=g):"ne"===r?(l.y+=g,l.width-=g,l.height-=g):"e"===r?l.width-=g:"se"===r&&(l.width-=g,l.height-=g):"ArrowRight"===a&&("nw"===r?(l.x+=g,l.y+=g,l.width-=g,l.height-=g):"w"===r?(l.x+=g,l.width-=g):"sw"===r?(l.x+=g,l.width-=g,l.height-=g):"ne"===r?(l.y-=g,l.width+=g,l.height+=g):"e"===r?l.width+=g:"se"===r&&(l.width+=g,l.height+=g)),"ArrowUp"===a?"nw"===r?(l.x-=g,l.y-=g,l.width+=g,l.height+=g):"n"===r?(l.y-=g,l.height+=g):"ne"===r?(l.y-=g,l.width+=g,l.height+=g):"sw"===r?(l.x+=g,l.width-=g,l.height-=g):"s"===r?l.height-=g:"se"===r&&(l.width-=g,l.height-=g):"ArrowDown"===a&&("nw"===r?(l.x+=g,l.y+=g,l.width-=g,l.height-=g):"n"===r?(l.y+=g,l.height-=g):"ne"===r?(l.y+=g,l.width-=g,l.height-=g):"sw"===r?(l.x-=g,l.width+=g,l.height+=g):"s"===r?l.height+=g:"se"===r&&(l.width+=g,l.height+=g)),l),i,r,m.width,m.height,c,u,d,f);
48if(!mM(o,b)){let e=mI(b,m.width,m.height);p(b,e),h&&h(b,e)}},this.onDocPointerDone=e=>{let{crop:t,disabled:r,onComplete:n,onDragEnd:a}=this.props,l=this.getBox();this.unbindDocMove(),!(r||!t)&&this.mouseDownOnCrop&&(this.mouseDownOnCrop=!1,this.dragStarted=!1,a&&a(e),n&&n(mF(t,l.width,l.height),mI(t,l.width,l.height)),this.setState({cropIsActive:!1,newCropIsBeingDrawn:!1}))},this.onDragFocus=e=>{var t;null==(t=this.componentRef.current)||t.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:t,y:r,width:n,height:a}=e.getBoundingClientRect();return{x:t,y:r,width:n,height:a}}componentDidUpdate(e){let{crop:t,onComplete:r}=this.props;if(r&&!e.crop&&t){let{width:e,height:n}=this.getBox();e&&n&&r(mF(t,e,n),mI(t,e,n))}}componentWillUnmount(){this.resizeObserver&&this.resizeObserver.disconnect()}bindDocMove(){this.docMoveBound||(this.document.addEventListener("pointermove",this.onDocPointerMove,mz),this.document.addEventListener("pointerup",this.onDocPointerDone,mz),this.document.addEventListener("pointercancel",this.onDocPointerDone,mz),this.docMoveBound=!0)}unbindDocMove(){this.docMoveBound&&(this.document.removeEventListener("pointermove",this.onDocPointerMove,mz),this.document.removeEventListener("pointerup",this.onDocPointerDone,mz),this.document.removeEventListener("pointercancel",this.onDocPointerDone,mz),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,t=this.getBox(),r=this.makePixelCrop(t),n=e.clientX-e.startClientX,a=e.clientY-e.startClientY;return r.x=mL(e.startCropX+n,0,t.width-r.width),r.y=mL(e.startCropY+a,0,t.height-r.height),r}getPointRegion(e,t,r,n){let{evData:a}=this,l=a.clientX-e.x,i=a.clientY-e.y,o;return o=n&&t?"nw"===t||"n"===t||"ne"===t:i<a.startCropY,(r&&t?"nw"===t||"w"===t||"sw"===t:l<a.startCropX)?o?"nw":"sw":o?"ne":"se"}resolveMinDimensions(e,t,r=0,n=0){let a=Math.min(r,e.width),l=Math.min(n,e.height);return t&&(a||l)?t>1?a?[a,a/t]:[l*t,l]:l?[l*t,l]:[a,a/t]:[a,l]}resizeCrop(){let{evData:t}=this,{aspect:r=0,maxWidth:n,maxHeight:a}=this.props,l=this.getBox(),[i,o]=this.resolveMinDimensions(l,r,this.props.minWidth,this.props.minHeight),s=this.makePixelCrop(l),c=this.getPointRegion(l,t.ord,i,o),u=t.ord||c,d=t.clientX-t.startClientX,f=t.clientY-t.startClientY;(i&&"nw"===u||"w"===u||"sw"===u)&&(d=Math.min(d,-i)),(o&&"nw"===u||"n"===u||"ne"===u)&&(f=Math.min(f,-o));let p={unit:"px",x:0,y:0,width:0,height:0};"ne"===c?(p.x=t.startCropX,p.width=d,r?p.height=p.width/r:p.height=Math.abs(f),p.y=t.startCropY-p.height):"se"===c?(p.x=t.startCropX,p.y=t.startCropY,p.width=d,r?p.height=p.width/r:p.height=f):"sw"===c?(p.x=t.startCropX+d,p.y=t.startCropY,p.width=Math.abs(d),r?p.height=p.width/r:p.height=f):"nw"===c&&(p.x=t.startCropX+d,p.width=Math.abs(d),r?(p.height=p.width/r,p.y=t.startCropY-p.height):(p.height=Math.abs(f),p.y=t.startCropY+f));let h=mB(p,r,c,l.width,l.height,i,o,n,a);return r||e.xyOrds.indexOf(u)>-1?s=h:e.xOrds.indexOf(u)>-1?(s.x=h.x,s.width=h.width):e.yOrds.indexOf(u)>-1&&(s.y=h.y,s.height=h.height),s.x=mL(s.x,0,l.width-s.width),s.y=mL(s.y,0,l.height-s.height),s}createCropSelection(){let{ariaLabels:t=e.defaultProps.ariaLabels,disabled:r,locked:n,renderSelectionAddon:a,ruleOfThirds:l,crop:i}=this.props,o=this.getCropStyle();if(i)return c.default.createElement("div",{style:o,className:"ReactCrop__crop-selection",onPointerDown:this.onCropPointerDown,"aria-label":t.cropArea,tabIndex:0,onKeyDown:this.onComponentKeyDown,role:"group"},!r&&!n&&c.default.createElement("div",{className:"ReactCrop__drag-elements",onFocus:this.onDragFocus},c.default.createElement("div",{className:"ReactCrop__drag-bar ord-n","data-ord":"n"}),c.default.createElement("div",{className:"ReactCrop__drag-bar ord-e","data-ord":"e"}),c.default.createElement("div",{className:"ReactCrop__drag-bar ord-s","data-ord":"s"}),c.default.createElement("div",{className:"ReactCrop__drag-bar ord-w","data-ord":"w"}),c.default.createElement("div",{className:"ReactCrop__drag-handle ord-nw","data-ord":"nw",tabIndex:0,"aria-label":t.nwDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"nw"),role:"button"}),c.default.createElement("div",{className:"ReactCrop__drag-handle ord-n","data-ord":"n",tabIndex:0,"aria-label":t.nDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"n"),role:"button"}),c.default.createElement("div",{className:"ReactCrop__drag-handle ord-ne","data-ord":"ne",tabIndex:0,"aria-label":t.neDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"ne"),role:"button"}),c.default.createElement("div",{className:"ReactCrop__drag-handle ord-e","data-ord":"e",tabIndex:0,"aria-label":t.eDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"e"),role:"button"}),c.default.createElement("div",{className:"ReactCrop__drag-handle ord-se","data-ord":"se",tabIndex:0,"aria-label":t.seDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"se"),role:"button"}),c.default.createElement("div",{className:"ReactCrop__drag-handle ord-s","data-ord":"s",tabIndex:0,"aria-label":t.sDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"s"),role:"button"}),c.default.createElement("div",{className:"ReactCrop__drag-handle ord-sw","data-ord":"sw",tabIndex:0,"aria-label":t.swDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"sw"),role:"button"}),c.default.createElement("div",{className:"ReactCrop__drag-handle ord-w","data-ord":"w",tabIndex:0,"aria-label":t.wDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"w"),role:"button"})),a&&c.default.createElement("div",{className:"ReactCrop__selection-addon",onMouseDown:e=>e.stopPropagation()},a(this.state)),l&&c.default.createElement(c.default.Fragment,null,c.default.createElement("div",{className:"ReactCrop__rule-of-thirds-hz"}),c.default.createElement("div",{className:"ReactCrop__rule-of-thirds-vt"})))}makePixelCrop(e){return mF({...mO,...this.props.crop||{}},e.width,e.height)}render(){let{aspect:e,children:t,circularCrop:r,className:n,crop:a,disabled:l,locked:i,style:o,ruleOfThirds:s}=this.props,{cropIsActive:u,newCropIsBeingDrawn:d}=this.state,f=a?this.createCropSelection():null,p=((...e)=>e.filter(e=>e&&"string"==typeof e).join(" "))("ReactCrop",n,u&&"ReactCrop--active",l&&"ReactCrop--disabled",i&&"ReactCrop--locked",d&&"ReactCrop--new-crop",a&&e&&"ReactCrop--fixed-aspect",a&&r&&"ReactCrop--circular-crop",a&&s&&"ReactCrop--rule-of-thirds",!this.dragStarted&&a&&!a.width&&!a.height&&"ReactCrop--invisible-crop",r&&"ReactCrop--no-animate");return c.default.createElement("div",{ref:this.componentRef,className:p,style:o},c.default.createElement("div",{ref:this.mediaRef,className:"ReactCrop__child-wrapper",onPointerDown:this.onComponentPointerDown},t),f)}};mU.xOrds=["e","w"],mU.yOrds=["n","s"],mU.xyOrds=["nw","ne","se","sw"],mU.nudgeStep=1,mU.nudgeStepMedium=10,mU.nudgeStepLarge=100,mU.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 mV="edit-upload",mH=e=>{let{name:t,onChange:r,ref:n,value:a}=e;return(0,h.jsxs)("div",{className:`${mV}__input`,children:[t,(0,h.jsx)("input",{name:t,onChange:e=>r(e.target.value),ref:n,type:"number",value:a})]})},mq={height:100,unit:"%",width:100,x:0,y:0},mK=({fileName:e,fileSrc:t,imageCacheTag:r,initialCrop:n,initialFocalPoint:a,onSave:l,showCrop:i,showFocalPoint:o})=>{let{closeModal:s}=lc(),{t:u}=(0,f.d)(),[d,p]=(0,c.useState)(()=>({...mq,...n||{}})),m={x:50,y:50},[g,b]=(0,c.useState)(()=>({...m,...a})),[v,y]=(0,c.useState)(!1),[x,w]=(0,c.useState)(0),[C,j]=(0,c.useState)(0),S=(0,c.useRef)(void 0),$=(0,c.useRef)(void 0),_=(0,c.useRef)(void 0),k=(0,c.useRef)(null),E=(0,c.useRef)(null),[N,P]=(0,c.useState)(!1),T=e=>
48{w(e.currentTarget.naturalHeight),j(e.currentTarget.naturalWidth),P(!0)},D=({dimension:e,value:t})=>{let r=100*(parseInt(t)/("width"===e?C:x));if(r<=0||r>100)return null;p({...d,[e]:r})},R=({coordinate:e,value:t})=>{let r=parseInt(t);r>=0&&r<=100&&b(t=>({...t,[e]:r}))},A=c.default.useCallback(({x:e,y:t})=>{b({x:e,y:t}),y(!1)},[]),O=r?`${t}?${encodeURIComponent(r)}`:t;return(0,h.jsxs)("div",{className:mV,children:[(0,h.jsxs)("div",{className:`${mV}__header`,children:[(0,h.jsxs)("h2",{title:`${u("general:editing")} ${e}`,children:[u("general:editing")," ",e]}),(0,h.jsxs)("div",{className:`${mV}__actions`,children:[(0,h.jsx)(au,{"aria-label":u("general:cancel"),buttonStyle:"secondary",className:`${mV}__cancel`,onClick:()=>s(m8),children:u("general:cancel")}),(0,h.jsx)(au,{"aria-label":u("general:applyChanges"),buttonStyle:"primary",className:`${mV}__save`,disabled:!N,onClick:()=>{"function"==typeof l&&l({crop:d||void 0,focalPoint:g,heightInPixels:Number(k?.current?.value??x),widthInPixels:Number(E?.current?.value??C)}),s(m8)},children:u("general:applyChanges")})]})]}),(0,h.jsxs)("div",{className:`${mV}__toolWrap`,children:[(0,h.jsx)("div",{className:`${mV}__crop`,children:(0,h.jsxs)("div",{className:`${mV}__focal-wrapper`,ref:S,style:{aspectRatio:`${C/x}`},children:[i?(0,h.jsx)(mU,{className:`${mV}__reactCrop`,crop:d,onChange:(e,t)=>
48p(t),onComplete:()=>y(!0),renderSelectionAddon:()=>(0,h.jsx)("div",{className:`${mV}__crop-window`,ref:_}),children:(0,h.jsx)("img",{alt:u("upload:setCropArea"),onLoad:T,ref:$,src:O})}):(0,h.jsx)("img",{alt:u("upload:setFocalPoint"),onLoad:T,ref:$,src:O}),o&&(0,h.jsx)(mW,{boundsRef:i?_:$,checkBounds:!!i&&v,className:`${mV}__focalPoint`,containerRef:S,initialPosition:g,onDragEnd:A,setCheckBounds:!!i&&y,children:(0,h.jsx)(n2,{})})]})}),(i||o)&&(0,h.jsxs)("div",{className:`${mV}__sidebar`,children:[i&&(0,h.jsxs)("div",{className:`${mV}__groupWrap`,children:[(0,h.jsx)("div",{children:(0,h.jsxs)("div",{className:`${mV}__titleWrap`,children:[(0,h.jsx)("h3",{children:u("upload:crop")}),(0,h.jsx)(au,{buttonStyle:"none",className:`${mV}__reset`,onClick:()=>p({height:100,unit:"%",width:100,x:0,y:0}),children:u("general:reset")})]})}),(0,h.jsx)("span",{className:`${mV}__description`,children:u("upload:cropToolDescription")}),(0,h.jsxs)("div",{className:`${mV}__inputsWrap`,children:[(0,h.jsx)(mH,{name:`${u("upload:width")} (px)`,onChange:e=>D({dimension:"width",value:e}),ref:E,value:(d.width/100*C).toFixed(0)}),(0,h.jsx)(mH,{name:`${u("upload:height")} (px)`,onChange:e=>D({dimension:"height",value:e}),ref:k,value:(d.height/100*x).toFixed(0)})]})]}),o&&(0,h.jsxs)("div",{className:`${mV}__groupWrap`,children:[(0,h.jsx)("div",{children:(0,h.jsxs)("div",{className:`${mV}__titleWrap`,children:[(0,h.jsx)("h3",{children:u("upload:focalPoint")}),(0,h.jsx)(au,{buttonStyle:"none",className:`${mV}__reset`,onClick:()=>{let e=S.current.getBoundingClientRect(),t=i?_.current.getBoundingClientRect():$.current.getBoundingClientRect();b({x:(t.left-e.left+t.width/2)/e.width*100,y:(t.top-e.top+t.height/2)/e.height*100})},children:u("general:reset")})]})}),(0,h.jsx)("span",{className:`${mV}__description`,children:u("upload:focalPointDescription")}),(0,h.jsxs)("div",{className:`${mV}__inputsWrap`,children:[(0,h.jsx)(mH,{name:"X %",onChange:e=>R({coordinate:"x",value:e}),value:g.x.toFixed(0)}),(0,h.jsx)(mH,{name:"Y %",onChange:e=>R({coordinate:"y",value:e}),value:g.y.toFixed(0)})]})]})]})]})]})},mW=({boundsRef:e,checkBounds:t,children:r,className:n,containerRef:a,initialPosition:l={x:50,y:50},onDragEnd:i,setCheckBounds:o})=>{let[s,u]=(0,c.useState)({x:l.x,y:l.y}),[d,f]=(0,c.useState)(!1),p=(0,c.useRef)(void 0),m=c.default.useCallback((t,r,n)=>{let l=a.current.getBoundingClientRect(),i=e.current.getBoundingClientRect(),o=t??i.left,s=r??i.top,c=o<i.left||o>i.right,u=s<i.top||s>i.bottom,d=(o-l.left)/l.width*100,p=(s-l.top)/l.height*100,h=(i.left-l.left+i.width/2)/l.width*100,m=(i.top-l.top+i.height/2)/l.height*100;return(c||u)&&(f(!1),o<i.left?d=(i.left-l.left)/l.width*100:o>i.right&&(d=(l.width-(l.right-i.right))/l.width*100),s<i.top?p=(i.top-l.top)/l.height*100:s>i.bottom&&(p=(l.height-(l.bottom-i.bottom))/l.height*100),n&&(d=c?h:d,p=u?m:p)),{x:d,y:p}},[e,a]);return c.default.useEffect(()=>{if(!(d||!p.current)&&t){let{height:e,left:t,top:r,width:n}=p.current.getBoundingClientRect(),{x:a,y:l}=m(t+n/2,r+e/2,!0);i({x:a,y:l}),u({x:a,y:l}),o(!1);return}},[m,d,t,o,s.x,s.y,i]),c.default.useEffect(()=>{u({x:l.x,y:l.y})},[l.x,l.y]),(0,h.jsxs)("div",{className:[`${mV}__draggable-container`,d&&`${mV}__draggable-container--dragging`].filter(Boolean).join(" "),onMouseMove:e=>{if(!d)return null;let{x:t,y:r}=m(e.clientX,e.clientY);u({x:t,y:r})},children:[(0,h.jsx)("button",{className:[`${mV}__draggable`,n].filter(Boolean).join(" "),onMouseDown:e=>{e.preventDefault(),f(!0)},onMouseUp:()=>{f(!1),i(s)},ref:p,style:{left:`${s.x}%`,top:`${s.y}%`},type:"button",children:r}),(0,h.jsx)("div",{})]})},mG="file-details-draggable",mY=e=>{let t,r=(0,v.c)(20),{collectionSlug:n,doc:a,hideRemoveFile:l,imageCacheTag:i,isSortable:o,removeItem:s,rowIndex:c,uploadConfig:u}=e,{id:d,filename:f,thumbnailURL:p,url:m}=a,g;r[0]!==n||r[1]!==d?(g={id:d,collectionSlug:n},r[0]=n,r[1]=d,r[2]=g):g=r[2];let[b,y]=fV(g),x;return r[3]!==b||r[4]!==y||r[5]!==n||r[6]!==a||r[7]!==f||r[8]!==l||r[9]!==i||r[10]!==o||r[11]!==s||r[12]!==c||r[13]!==p||r[14]!==u||r[15]!==m?(x=e=>(0,h.jsxs)("div",{className:[mG,e&&o&&`${mG}
48--has-drag-handle`].filter(Boolean).join(" "),ref:e.setNodeRef,style:{transform:e.transform,transition:e.transition,zIndex:e.isDragging?1:void 0},children:[(0,h.jsxs)("div",{className:`${mG}--drag-wrapper`,children:[o&&e&&(0,h.jsx)("div",{className:`${mG}__drag`,...e.attributes,...e.listeners,children:(0,h.jsx)(o6,{})}),(0,h.jsx)(f4,{className:`${mG}__thumbnail`,collectionSlug:n,doc:a,fileSrc:p||m,imageCacheTag:i,uploadConfig:u})]}),(0,h.jsx)("div",{className:`${mG}__main-detail`,children:f}),(0,h.jsxs)("div",{className:`${mG}__actions`,children:[(0,h.jsx)(b,{}),(0,h.jsx)(y,{children:(0,h.jsx)(n0,{})}),!l&&s&&(0,h.jsx)(au,{buttonStyle:"icon-label",className:`${mG}__remove`,icon:"x",iconStyle:"none",onClick:()=>s(c),round:!0})]})]}),r[3]=b,r[4]=y,r[5]=n,r[6]=a,r[7]=f,r[8]=l,r[9]=i,r[10]=o,r[11]=s,r[12]=c,r[13]=p,r[14]=u,r[15]=m,r[16]=x):x=r[16],r[17]!==d||r[18]!==x?(t=(0,h.jsx)(aq,{id:d,children:x},d),r[17]=d,r[18]=x,r[19]=t):t=r[19],t},mQ=e=>{let t=(0,v.c)(11),{defaultMessage:r,successMessage:n,value:a}=e,[l,i]=(0,c.useState)(!1),[o,s]=(0,c.useState)(!1),{t:u}=(0,f.d)();if(a){let e,c,d,f;return t[0]!==a?(e=async()=>{await navigator.clipboard.writeText(a),i(!0)},t[0]=a,t[1]=e):e=t[1],t[2]===Symbol.for("react.memo_cache_sentinel")?(c=()=>{s(!0),i(!1)},d=()=>{s(!1),i(!1)},t[2]=c,t[3]=d):(c=t[2],d=t[3]),t[4]!==l||t[5]!==r||t[6]!==o||t[7]!==n||t[8]!==u||t[9]!==e?(f=(0,h.jsxs)("button",{className:"copy-to-clipboard",onClick:e,onMouseEnter:c,onMouseLeave:d,type:"button",children:[(0,h.jsx)(ag,{}),(0,h.jsxs)(ao,{delay:l?0:void 0,show:o||l,children:[l&&(n??u("general:copied")),!l&&(r??u("general:copy"))]})]}),t[4]=l,t[5]=r,t[6]=o,t[7]=n,t[8]=u,t[9]=e,t[10]=f):f=t[10],f}return null},mX="file-meta",mJ=e=>{let{filename:t,filesize:r,height:n,mimeType:a,url:l,width:i}=e;return(0,h.jsxs)("div",{className:mX,children:[(0,h.jsxs)("div",{className:`${mX}__url`,children:[(0,h.jsx)("a",{href:l,rel:"noopener noreferrer",target:"_blank",children:t}),(0,h.jsx)(mQ,{defaultMessage:"Copy URL",value:l})]}),(0,h.jsxs)("div",{className:`${mX}__size-type`,children:[rR(r),"number"==typeof i&&"number"==typeof n&&(0,h.jsxs)(c.default.Fragment,{children:[" - ",i,"x",n]}),a&&(0,h.jsxs)(c.default.Fragment,{children:[" - ",a]})]})]})},mZ="file-details",m0=e=>{let{customUploadActions:t,doc:r,enableAdjustments:n,handleRemove:a,hasImageSizes:l,hideRemoveFile:i,imageCacheTag:o,uploadConfig:s}=e,{filename:c,filesize:u,height:d,mimeType:f,thumbnailURL:p,url:m,width:g}=r,b=s.displayPreview??!0;return(0,h.jsx)("div",{className:mZ,children:(0,h.jsxs)("header",{children:[b&&(0,h.jsx)(f4,{className:`${mZ}__thumbnail`,doc:r,fileSrc:p||m,imageCacheTag:o,uploadConfig:s}),(0,h.jsxs)("div",{className:`${mZ}__main-detail`,children:[(0,h.jsx)(mJ,{filename:c,filesize:u,height:d,mimeType:f,url:m,width:g}),(n||l&&r.filename||t)&&(0,h.jsx)(ge,{customActions:t,enableAdjustments:!!n,enablePreviewSizes:l&&r.filename,mimeType:f})]}),!i&&a&&(0,h.jsx)(au,{buttonStyle:"icon-label",className:`${mZ}__remove`,icon:"x",iconStyle:"with-border",onClick:a,round:!0})]})})},m1=e=>{let{hasMany:t}=e;return t?(0,h.jsx)(mY,{...e}):(0,h.jsx)(m0,{...e})},m2="preview-sizes",m3=(e,t)=>{if(!t||0===t.length)return e;let r={};return t.forEach(({name:t})=>{e[t]&&(r[t]=e[t])}),r},m6=({name:e,active:t,alt:r,meta:n,onClick:a,previewSrc:l})=>(0,h.jsxs)("div",{className:[`${m2}__sizeOption`,t&&`${m2}--selected`].filter(Boolean).join(" "),onClick:"function"==typeof a?a:void 0,onKeyDown:e=>{"function"==typeof a&&"Enter"===e.key&&a()},role:"button",tabIndex:0,children:[(0,h.jsx)("div",{className:`${m2}__image`,children:(0,h.jsx)("img",{alt:r,src:l})}),(0,h.jsxs)("div",{className:`${m2}__sizeMeta`,children:[(0,h.jsx)("div",{className:`${m2}__sizeName`,children:e}),(0,h.jsx)(mJ,{...n})]})]}),m5=({doc:e,imageCacheTag:t,uploadConfig:r})=>{let{imageSizes:n}=r,{sizes:a}=e,l=e?.alt||e.filename||"",[i,o]=(0,c.useState)(()=>m3(a,n)),[s,u]=(0,c.useState)(null),d=e=>e.filename?e.url?`${e.url}${t?`?${encodeURIComponent(t)}`:""}`:void 0:null;(0,c.useEffect)(()=>{o(m3(a,n))},[a,n,t]);let f=d(s?e.sizes[s]:e),p=(0,c.useMemo)(()=>({filename:e.filename,filesize:e.filesize,height:e.height,mimeType:e.mimeType,url:e.url,width:e.width}),[e]),m="Original";return(0,h.jsxs)("div",{className:m2,children:[(0,h.jsxs)("div",{className:`${m2}__imageWrap`,children:[(0,h.jsxs)("div",{className:`${m2}__meta`,children:[(0,h.jsx)("div",{className:`${m2}__sizeName`,children:s||m}),(0,h.jsx)(mJ,{...s?i[s]:p})]}),(0,h.jsx)("img",{alt:l,className:`${m2}__preview`,src:f})]}),(0,h.jsx)("div",{className:`${m2}__listWrap`,children:(0,h.jsxs)("div",{className:`${m2}__list`,children:[(0,h.jsx)(m6,{active:!s,alt:l,meta:p,name:m,onClick:()=>u(null),previewSrc:d(e)}),Object.entries(i).map(([e,t])=>{let r=s===e,n=d(t);return n?(0,h.jsx)(m6,{active:r,alt:l,meta:t,name:e,onClick:()=>u(e),previewSrc:n},e):null})]})})]})},m4="file-field",m8="edit-upload",m7="preview-sizes",m9=e=>e||void 0===e?!e||!!e.name&&""!==e.name||"A file name is required.":"A file is required.",ge=e=>{let t=(0,v.c)(8),{customActions:r,enableAdjustments:n,enablePreviewSizes:a,mimeType:l}=e,{t:i}=(0,f.d)(),{openModal:o}=lc(),s,u;if(t[0]!==r||t[1]!==n||t[2]!==a||t[3]!==l||t[4]!==o||t[5]!==i){u=Symbol.for("react.early_return_sentinel");e:{let e=rg(l)&&"image/svg+xml"!==l&&"image/jxl"!==l;if(!e&&(!r||0===r.length)){u=null;break e}s=(0,h.jsxs)("div",{className:`${m4}__upload-actions`,children:[e&&(0,h.jsxs)(c.default.Fragment,{children:[a&&(0,h.jsx)(au,{buttonStyle:"pill",className:`${m4}__previewSizes`,margin:!1,onClick:()=>{o(m7)},size:"small",children:i("upload:previewSizes")}),n&&(0,h.jsx)(au,{buttonStyle:"pill",className:`${m4}__edit`,margin:!1,onClick:()=>{o(m8)},size:"small",children:i("upload:editImage")})]}),r&&r.map(gn)]})}t[0]=r,t[1]=n,t[2]=a,t[3]=l,t[4]=o,t[5]=i,t[6]=s,t[7]=u}else s=t[6],u=t[7];return u!==Symbol.for("react.early_return_sentinel")?u:s},gt=e=>{let t=(0,v.c)(5),{resetUploadEdits:r,updateUploadEdits:n,uploadEdits:a}=oN(),l;
48return t[0]!==e||t[1]!==r||t[2]!==n||t[3]!==a?(l=(0,h.jsx)(hD,{children:(0,h.jsx)(gr,{...e,resetUploadEdits:r,updateUploadEdits:n,uploadEdits:a})}),t[0]=e,t[1]=r,t[2]=n,t[3]=a,t[4]=l):l=t[4],l},gr=e=>{let{collectionSlug:t,customActions:r,initialState:n,onChange:a,resetUploadEdits:l,updateUploadEdits:i,uploadConfig:o,UploadControls:s,uploadEdits:u}=e,{setUploadControlFile:p,setUploadControlFileName:m,setUploadControlFileUrl:g,uploadControlFile:b,uploadControlFileName:v,uploadControlFileUrl:y}=hR(),{config:{routes:{api:x}}}=(0,d.c)(),{t:w}=(0,f.d)(),{setModified:C}=nm(),{id:j,data:S,docPermissions:$,setUploadStatus:_}=oD(),k=ny(),{errorMessage:E,setValue:N,showError:P,value:T}=oz({path:"file",validate:m9}),[D,R]=(0,c.useState)(null),[A,O]=(0,c.useState)(!1),[L,M]=(0,c.useState)(T?.name||""),[I,F]=(0,c.useState)(!1),[B,z]=(0,c.useState)(""),U=(0,c.useRef)(null),V=(0,c.useRef)(null),H="object"==typeof o?.pasteURL&&o.pasteURL.allowList?.length>0,q=(0,c.useCallback)(({file:e,isNewFile:t=!0})=>{t&&e instanceof File&&R(URL.createObjectURL(e)),N(e),F(!1),g(""),m(null),p(null),"function"==typeof a&&a(e)},[a,N,p,m,g]),K=c.default.useCallback(e=>{let t=e.target.value;T&&(q({file:new File([T],t,{type:T.type,lastModified:T.lastModified}),isNewFile:!1}),M(t))},[q,T]),W=(0,c.useCallback)(e=>{q({file:e?.[0]})},[q]),G=(0,c.useCallback)(()=>{O(!0),q({file:null}),R(""),z(""),l(),F(!1),g(""),m(null),p(null)},[q,l,p,m,g]),Y=(0,c.useCallback)(e=>{C(!0),i(e)},[C,i]),Q=(0,c.useCallback)(async()=>{if(!(!B||o?.pasteURL===!1)){_("uploading");try{let e=await fetch(B);if(!e.ok)throw Error(`Fetch failed with status: ${e.status}`);let t=await e.blob(),r=v||decodeURIComponent(B.split("/").pop()||""),n=new File([t],r,{type:t.type});q({file:n}),_("idle");return}catch{if(!H){nI.error("Failed to fetch the file."),_("failed");return}}try{let e=`/${t}/paste-url${j?`/${j}?`:"?"}src=${encodeURIComponent(B)}`,r=await fetch(tR({apiRoute:x,path:e}));if(!r.ok)throw Error(`Fetch failed with status: ${r.status}`);let n=await r.blob(),a=decodeURIComponent(B.split("/").pop()||""),l=new File([n],a,{type:n.type});q({file:l}),_("idle")}catch{nI.error("The provided URL is not allowed."),_("failed")}}},[x,t,B,q,j,_,o,v,H]);(0,c.useEffect)(()=>{n?.file?.value instanceof File&&(R(URL.createObjectURL(n.file.value)),O(!1))},[n]),(0,c.useEffect)(()=>{I&&U.current},[I]),(0,c.useEffect)(()=>{k&&O(!1)},[k]);let X=$?.update,J=o?.imageSizes?.length>0,Z=!!o?.resizeOptions,ee=o?.focalPoint===!0,{crop:et=!0,focalPoint:er=!0}=o,en=er&&(J||Z||ee),ea=o.mimeTypes?.join(", "),el=o?.cacheTags&&S?.updatedAt;return(0,c.useEffect)(()=>{(async()=>y&&(z(y),await Q()))()},[y,Q]),(0,c.useEffect)(()=>{b&&q({file:b})},[b,q]),(0,h.jsxs)("div",{className:[oK,m4].filter(Boolean).join(" "),children:[(0,h.jsx)(aX,{message:E,showError:P}),S&&S.filename&&!A&&(0,h.jsx)(m1,{collectionSlug:t,customUploadActions:r,doc:S,enableAdjustments:et||en,handleRemove:X?G:void 0,hasImageSizes:J,hideRemoveFile:o.hideRemoveFile,imageCacheTag:el,uploadConfig:o}),(!o.hideFileInputOnCreate&&!S?.filename||A)&&(0,h.jsxs)("div",{className:`${m4}__upload`,children:[!T&&!I&&(0,h.jsx)(hO,{onChange:W,children:(0,h.jsxs)("div",{className:`${m4}__dropzoneContent`,children:[(0,h.jsxs)("div",{className:`${m4}__dropzoneButtons`,children:[(0,h.jsx)(au,{buttonStyle:"pill",onClick:()=>{V.current&&V.current.click()},size:"small",children:w("upload:selectFile")}),(0,h.jsx)("input",{accept:ea,"aria-hidden":"true",className:`${m4}__hidden-input`,hidden:!0,onChange:e=>{e.target.files&&e.target.files.length>0&&W(e.target.files)},ref:V,type:"file"}),o?.pasteURL!==!1&&(0,h.jsxs)(c.Fragment,{children:[(0,h.jsx)("span",{className:`${m4}__orText`,children:w("general:or")}),(0,h.jsx)(au,{buttonStyle:"pill",onClick:()=>{F(!0),g(""),p(null),m(null)},size:"small",children:w("upload:pasteURL")})]}),s||null]}),(0,h.jsxs)("p",{className:`${m4}__dragAndDropText`,children:[w("general:or")," ",w("upload:dragAndDrop")]})]})}),I&&(0,h.jsxs)(c.default.Fragment,{children:[(0,h.jsxs)("div",{className:`${m4}__remote-file-wrap`,children:[(0,h.jsx)("input",{className:`${m4}__remote-file`,onChange:e=>{z(e.target.value)},ref:U,title:B,type:"text",value:B}),(0,h.jsx)("div",{className:`${m4}__add-file-wrap`,children:(0,h.jsx)("button",{className:`${m4}__add-file`,onClick:()=>{Q()},type:"button",children:w("upload:addFile")})})]}),(0,h.jsx)(au,{buttonStyle:"icon-label",className:`${m4}__remove`,icon:"x",iconStyle:"with-border",onClick:()=>{F(!1),g(""),p(null),m(null)},round:!0,tooltip:w("general:cancel")})]}),T&&D&&(0,h.jsxs)(c.default.Fragment,{children:[(0,h.jsx)("div",{className:`${m4}__thumbnail-wrap`,children:(0,h.jsx)(f4,{collectionSlug:t,fileSrc:rg(T.type)?D:null})}),(0,h.jsxs)("div",{className:`${m4}__file-adjustments`,children:[(0,h.jsx)("input",{className:`${m4}__filename`,onChange:K,title:L||T.name,type:"text",value:L||T.name}),(0,h.jsx)(ge,{customActions:r,enableAdjustments:et||en,enablePreviewSizes:J&&S?.filename&&!A,mimeType:T.type})]}),(0,h.jsx)(au,{buttonStyle:"icon-label",className:`${m4}__remove`,icon:"x",iconStyle:"with-border",onClick:G,round:!0,tooltip:w("general:cancel")})]})]}),(T||S?.filename)&&(0,h.jsx)(aZ,{children:(0,h.jsx)(ip,{Header:null,slug:m8,children:(0,h.jsx)(mK,{fileName:T?.name||S?.filename,fileSrc:S?.url||D,imageCacheTag:el,initialCrop:u?.crop??void 0,initialFocalPoint:{x:u?.focalPoint?.x||S?.focalX||50,y:u?.focalPoint?.y||S?.focalY||50},onSave:Y,showCrop:et,showFocalPoint:en})})}),S&&J&&(0,h.jsx)(ip,{className:`${m4}__previewDrawer`,hoverTitle:!0,slug:m7,title:w("upload:sizesFor",{label:S.filename}),children:(0,h.jsx)(m5,{doc:S,imageCacheTag:el,uploadConfig:o})})]})};function gn(e,t){return(0,h.jsx)(c.default.Fragment,{children:e},t)}function ga({resetUploadEdits:e,submitted:t,updateUploadEdits:r,uploadEdits:n}){let{action:a,collectionSlug:l,docPermissions:i,getDocPreferences:o,hasSavePermission:s,initialState:u,isInitializing:f,Upload:p}=oD(),{drawerSlug:m,onSave:g}=fI(),{getFormState:b}
48=fg(),{config:{folders:v},getEntityConfig:y}=(0,d.c)(),x=c.default.useRef(null),w=y({collectionSlug:l}),{reportUpdate:C}=pB(),j=w.slug,[S]=c.default.useState(j),$=(0,c.useCallback)(t=>{C({doc:t?.doc||t?.result,drawerSlug:m,entitySlug:j,operation:"create",updatedAt:t?.result?.updatedAt||new Date().toISOString()}),"function"==typeof g&&g({...t,operation:"create"}),e()},[j,g,C,e,m]),_=(0,c.useCallback)(async({formState:e,submitted:t})=>{let r=fO(x),n=await o(),{state:a}=await b({collectionSlug:j,docPermissions:i,docPreferences:n,formState:e,operation:"create",schemaPath:S,signal:r.signal,skipValidation:!t});return x.current=null,a},[j,S,o,b,i]);return(0,c.useEffect)(()=>{let e=x.current;return()=>{fA(e)}},[]),(0,h.jsx)(oL,{operation:"create",children:(0,h.jsxs)(hm,{action:a,className:"collection-edit__form",disabled:f||!s,initialState:f?void 0:u,isInitializing:f,method:"POST",onChange:[_],onSuccess:$,submitted:t,children:[(0,h.jsx)(h9,{BeforeFields:(0,h.jsx)(c.default.Fragment,{children:p||(0,h.jsx)(gr,{collectionSlug:w.slug,customActions:[v&&w.folders&&(0,h.jsx)(mD,{buttonProps:{buttonStyle:"pill",size:"small"},folderCollectionSlug:v.slug,folderFieldName:v.fieldName},"move-doc-to-folder")].filter(Boolean),initialState:u,resetUploadEdits:e,updateUploadEdits:r,uploadConfig:w.upload,uploadEdits:n})}),docPermissions:i,fields:w.fields,schemaPathSegments:[w.slug]}),(0,h.jsx)(gi,{}),(0,h.jsx)(gl,{})]})})}function gl(){let e,t=(0,v.c)(7),{getField:r,getFields:n}=nm(),{getFormDataRef:a}=hK(),l;return t[0]!==n||t[1]!==a?(l=()=>{a.current=n},t[0]=n,t[1]=a,t[2]=l):l=t[2],t[3]!==r||t[4]!==n||t[5]!==a?(e=[n,r,a],t[3]=r,t[4]=n,t[5]=a,t[6]=e):e=t[6],(0,c.useEffect)(l,e),null}function gi(){let{docConfig:e}=oD(),{activeIndex:t,forms:r,setFormTotalErrorCount:n}=hK(),a=c.default.useRef(0),l=(0,c.useMemo)(()=>r[t]?.formState?.file?.valid??!0,[t,r]),i=c.default.useCallback(e=>{let r=e;l||(r+=1),r!==a.current&&(n({errorCount:r,index:t}),a.current=r)},[t,n,l]);return e?(0,h.jsx)(sA,{fields:e.fields,path:[],setErrorCount:i}):null}var go={};(0,p.d)(go,{WindowInfo:()=>gu,WindowInfoContext:()=>gs,WindowInfoProvider:()=>gf,useWindowInfo:()=>gc,withWindowInfo:()=>gp});var gs=(0,c.createContext)({}),gc=()=>(0,c.useContext)(gs),gu=e=>{let{children:t}=e,r=gc();return t?"function"==typeof t?c.default.createElement(c.Fragment,null,t(r)):c.default.createElement(c.Fragment,null,t):null},gd=(e,t)=>{let{payload:{breakpoints:r,animationRef:n}}=t;n.current=null;let{eventsFired:a}=e,{documentElement:{style:l,clientWidth:i,clientHeight:o}}=document,{innerWidth:s,innerHeight:c}=window,u=`${i/100}px`,d=`${o/100}px`,f=r?Object.keys(r).reduce((e,t)=>Object.assign(Object.assign({},e),{[t]:window.matchMedia(r[t]).matches}),{}):{};return l.setProperty("--vw",u),l.setProperty("--vh",d),{width:s,height:c,"--vw":u,"--vh":d,breakpoints:f,eventsFired:a+1}},gf=e=>{let{breakpoints:t,children:r}=e,n=(0,c.useRef)(null),[a,l]=(0,c.useReducer)(gd,{width:void 0,height:void 0,"--vw":"","--vh":"",breakpoints:{},eventsFired:0}),i=(0,c.useCallback)(()=>{n.current&&cancelAnimationFrame(n.current),n.current=requestAnimationFrame(()=>l({type:"UPDATE",payload:{breakpoints:t,animationRef:n}}))},[t]),o=(0,c.useCallback)(()=>{setTimeout(()=>{i()},500)},[i]);return(0,c.useEffect)(()=>(window.addEventListener("resize",i),window.addEventListener("orientationchange",o),()=>{window.removeEventListener("resize",i),window.removeEventListener("orientationchange",o)}),[i,o]),(0,c.useEffect)(()=>{0===a.eventsFired&&l({type:"UPDATE",payload:{breakpoints:t,animationRef:n}})},[t,a]),c.default.createElement(gs.Provider,{value:Object.assign({},a)},r&&r)},gp=e=>t=>{let r=gc();return c.default.createElement(e,Object.assign({},t,{windowInfo:r}))},gh="bulk-upload-drawer--add-more-files",gm="file-selections";function gg(){let e=(0,v.c)(39),{activeIndex:t,addFiles:r,forms:n,isInitializing:a,removeFile:l,setActiveIndex:i,totalErrorCount:o}=hK(),{initialFiles:s,initialForms:u,maxFiles:p}=gP(),{i18n:m,t:g}=(0,f.d)(),{closeModal:b,openModal:y}=lc(),[x,w]=c.default.useState(!1),{breakpoints:C}=gc(),j;e[0]!==l?(j=e=>{l(e)},e[0]=l,e[1]=j):j=e[1];let S=j,$;e[2]!==r||e[3]!==b?($=e=>{r(e),b(gh)},e[2]=r,e[3]=b,e[4]=$):$=e[4];let _=$,k=a?s?.length??u?.length:n.length,{collectionSlug:E,selectableCollections:N,setCollectionSlug:P}=gP(),{getEntityConfig:T}=(0,d.c)(),D=x&&`${gm}__showingFiles`,R;
48e[5]!==D?(R=[gm,D].filter(Boolean),e[5]=D,e[6]=R):R=e[6];let A=R.join(" "),O;if(e[7]!==t||e[8]!==C.m||e[9]!==E||e[10]!==b||e[11]!==n||e[12]!==T||e[13]!==_||e[14]!==S||e[15]!==m||e[16]!==s||e[17]!==u||e[18]!==a||e[19]!==p||e[20]!==y||e[21]!==N||e[22]!==i||e[23]!==P||e[24]!==x||e[25]!==g||e[26]!==A||e[27]!==o||e[28]!==k){let r,l,c;e[30]===Symbol.for("react.memo_cache_sentinel")?(r=()=>w(gv),e[30]=r):r=e[30],e[31]!==b?(l=()=>b(gh),e[31]=b,e[32]=l):l=e[32],e[33]!==t||e[34]!==S||e[35]!==m||e[36]!==i||e[37]!==g?(c=(e,r)=>{let{errorCount:n,formID:a,formState:l}=e,o=l?.file?.value||{};return(0,h.jsxs)("div",{className:[`${gm}__fileRowContainer`,r===t&&`${gm}__fileRowContainer--active`,n&&n>0&&`${gm}__fileRowContainer--error`].filter(Boolean).join(" "),children:[(0,h.jsxs)("button",{className:`${gm}__fileRow`,onClick:()=>i(r),type:"button",children:[(0,h.jsx)(gy,{file:o,formID:a}),(0,h.jsx)("div",{className:`${gm}__fileDetails`,children:(0,h.jsx)("p",{className:`${gm}__fileName`,title:o.name,children:o.name||g("upload:noFile")})}),o instanceof File?(0,h.jsx)("p",{className:`${gm}__fileSize`,children:function(e){let t=e.size,r=0===t?0:Math.floor(Math.log(t)/Math.log(1024));return(t/Math.pow(1024,r)).toFixed(+(r>1))+" "+["B","kB","MB","GB","TB"][r]}(o)}):null,(0,h.jsx)("div",{className:`${gm}__remove ${gm}__remove--underlay`,children:(0,h.jsx)(f.a,{})}),n?(0,h.jsx)(aG,{className:`${gm}__errorCount`,count:n,i18n:m}):null]}),(0,h.jsx)("button",{"aria-label":g("general:remove"),className:`${gm}__remove ${gm}__remove--overlay`,onClick:()=>S(r),type:"button",children:(0,h.jsx)(f.a,{})})]},a)},e[33]=t,e[34]=S,e[35]=m,e[36]=i,e[37]=g,e[38]=c):c=e[38],O=(0,h.jsxs)("div",{className:A,children:[C.m&&x?(0,h.jsx)("div",{className:`${gm}__mobileBlur`}):null,(0,h.jsxs)("div",{className:`${gm}__header`,children:[N?.length>1&&(0,h.jsx)(p8,{className:`${gm}__collectionSelect`,isClearable:!1,name:"groupBy",onChange:e=>{P("object"==typeof e&&"value"in e?e?.value:e)},options:N?.map(e=>{let t=T({collectionSlug:e});return{label:t.labels.singular,value:t.slug}})||[],path:"groupBy",required:!0,value:E}),(0,h.jsxs)("div",{className:`${gm}__headerTopRow`,children:[(0,h.jsxs)("div",{className:`${gm}__header__text`,children:[(0,h.jsx)(aG,{count:o,i18n:m,withMessage:!0}),(0,h.jsx)("p",{children:(0,h.jsxs)("strong",{title:`${k} ${g(k>1?"upload:filesToUpload":"upload:fileToUpload")}`,children:[k," ",g(k>1?"upload:filesToUpload":"upload:fileToUpload")]})})]}),(0,h.jsxs)("div",{className:`${gm}__header__actions`,children:["number"!=typeof p||k<p?(0,h.jsx)(sl,{className:`${gm}__header__addFile`,onClick:()=>y(gh),size:"small",children:g("upload:addFile")}):null,(0,h.jsxs)(au,{buttonStyle:"transparent",className:`${gm}__toggler`,onClick:r,children:[(0,h.jsx)("span",{className:`${gm}__toggler__label`,children:(0,h.jsxs)("strong",{title:`${k} ${g(k>1?"upload:filesToUpload":"upload:fileToUpload")}`,children:[k," ",g(k>1?"upload:filesToUpload":"upload:fileToUpload")]})}),(0,h.jsx)(nZ,{direction:x?"down":"up"})]}),(0,h.jsx)(ip,{gutter:!1,Header:null,slug:gh,children:(0,h.jsx)(hF,{onCancel:l,onDrop:_})})]})]}),(0,h.jsx)("div",{className:`${gm}__header__mobileDocActions`,children:(0,h.jsx)(h3,{})})]}),(0,h.jsx)("div",{className:`${gm}__animateWrapper`,children:(0,h.jsx)(o5,{height:!C.m||x?"auto":0,children:(0,h.jsxs)("div",{className:`${gm}__filesContainer`,children:[a&&0===n.length&&(s?.length>0||u?.length>0)?(s?Array.from(s):u).map(gb):null,n.map(c)]})})})]}),e[7]=t,e[8]=C.m,e[9]=E,e[10]=b,e[11]=n,e[12]=T,e[13]=_,e[14]=S,e[15]=m,e[16]=s,e[17]=u,e[18]=a,e[19]=p,e[20]=y,e[21]=N,e[22]=i,e[23]=P,e[24]=x,e[25]=g,e[26]=A,e[27]=o,e[28]=k,e[29]=O}else O=e[29];return O}function gb(e,t){return(0,h.jsx)(d.f,{animationDelay:`calc(${t} * 60ms)`,height:"35px"},t)}function gv(e){return!e}function gy({file:e,formID:t}){let[r,n]=c.default.useState(null),[a,l]=c.default.useState(!0);return c.default.useEffect(()=>{let t=!1;return async function(){l(!0),n(null);try{if(rg(e.type)){let r=await new Promise((t,r)=>{let n=new Image;n.src=URL.createObjectURL(e),n.onload=()=>{let a,l,i=n.width/n.height;i>1?(l=280,a=280/i):(l=280*i,a=280);let o=new OffscreenCanvas(l,a),s=o.getContext("2d"),c="image/png"===e.type?"image/png":"image/jpeg",u="image/png"===e.type?void 0:.8;
48s.drawImage(n,0,0,l,a),o.convertToBlob({type:c,...u&&{quality:u}}).then(e=>{URL.revokeObjectURL(n.src);let a=new FileReader;a.onload=()=>t(a.result),a.onerror=r,a.readAsDataURL(e)}).catch(r)},n.onerror=e=>{URL.revokeObjectURL(n.src),r(e)}});t||n(r)}else n(null)}catch{t||n(null)}finally{t||l(!1)}}(),()=>{t=!0}},[e]),a?(0,h.jsx)(d.f,{className:`${gm}__thumbnail-shimmer`,disableInlineStyles:!0}):(0,h.jsx)(f4,{className:`${gm}__thumbnail`,fileSrc:r},`${t}-${r||"placeholder"}`)}var gx="bulk-upload--file-manager";function gw(){let e=(0,v.c)(18),{activeIndex:t,collectionSlug:r,docPermissions:n,documentSlots:a,forms:l,hasPublishPermission:i,hasSavePermission:o,hasSubmitted:s,resetUploadEdits:c,updateUploadEdits:u}=hK(),p=l[t],{getEntityConfig:g}=(0,d.c)(),{i18n:b}=(0,f.d)(),{user:y}=iS(),{openModal:x}=lc(),w;if(e[0]!==p||e[1]!==t||e[2]!==r||e[3]!==n||e[4]!==a||e[5]!==l.length||e[6]!==g||e[7]!==i||e[8]!==o||e[9]!==s||e[10]!==b||e[11]!==x||e[12]!==c||e[13]!==u||e[14]!==y){let d=g({collectionSlug:r}),f;e[16]!==x?(f=()=>x(h6),e[16]=x,e[17]=f):f=e[17],w=(0,h.jsxs)("div",{className:gx,children:[(0,h.jsx)(gg,{}),(0,h.jsxs)("div",{className:`${gx}__editView`,children:[(0,h.jsx)(hM,{onClose:f,title:m(d.labels.singular,b)}),p?(0,h.jsxs)(oA,{collectionSlug:r,currentEditor:y,docPermissions:n,hasPublishedDoc:!1,hasPublishPermission:i,hasSavePermission:o,id:null,initialData:rN(p.formState,!0),initialState:p.formState,isLocked:!1,lastUpdateTime:0,mostRecentVersionIsAutosaved:!1,unpublishedVersionCount:0,Upload:a.Upload,versionCount:0,children:[(0,h.jsx)(h2,{collectionConfig:d}),(0,h.jsx)(ga,{resetUploadEdits:c,submitted:s,updateUploadEdits:u,uploadEdits:p?.uploadEdits})]},`${t}-${l.length}`):null]}),(0,h.jsx)(h5,{})]}),e[0]=p,e[1]=t,e[2]=r,e[3]=n,e[4]=a,e[5]=l.length,e[6]=g,e[7]=i,e[8]=o,e[9]=s,e[10]=b,e[11]=x,e[12]=c,e[13]=u,e[14]=y,e[15]=w}else w=e[15];return w}function gC(){let{addFiles:e,forms:t,isInitializing:r}=hK(),{closeModal:n}=lc(),{collectionSlug:a,drawerSlug:l}=gP(),{getEntityConfig:i}=(0,d.c)(),{t:o}=(0,f.d)(),s=i({collectionSlug:a})?.upload?.mimeTypes,u=c.default.useCallback(t=>{let r=new DataTransfer;for(let e of t)(void 0===s||0===s.length||rT(e.type,s))&&r.items.add(e);0===r.files.length?nI.error(o("error:invalidFileType")):e(r.files)},[e,o,s]);return a?t.length||r?(0,h.jsx)(gw,{}):(0,h.jsx)(hF,{acceptMimeTypes:s?.join(", "),onCancel:()=>n(l),onDrop:u}):null}function gj(){let e,t,r=(0,v.c)(17),{drawerSlug:n,onCancel:a,setInitialFiles:l,setInitialForms:i,setOnCancel:o,setOnSuccess:s,setSelectableCollections:u,setSuccessfullyUploaded:d,successfullyUploaded:f}=gP(),{modalState:p}=lc(),m=c.default.useRef(p),g;r[0]!==n||r[1]!==a||r[2]!==l||r[3]!==i||r[4]!==o||r[5]!==s||r[6]!==u||r[7]!==d||r[8]!==f?(g=e=>{let t=m.current[n],r=e[n];typeof r>"u"&&typeof t>"u"||(t?.isOpen!==r?.isOpen&&(r?.isOpen||(f||"function"==typeof a&&a(),l(void 0),i(void 0),o(g_),s(gS),u(null),d(!1))),m.current=e)},r[0]=n,r[1]=a,r[2]=l,r[3]=i,r[4]=o,r[5]=s,r[6]=u,r[7]=d,r[8]=f,r[9]=g):g=r[9];let b=ae(g),y;return r[10]!==p||r[11]!==b?(y=()=>{b(p)},r[10]=p,r[11]=b,r[12]=y):y=r[12],r[13]!==p?(e=[p],r[13]=p,r[14]=e):e=r[14],(0,c.useEffect)(y,e),r[15]!==n?(t=(0,h.jsx)(ip,{gutter:!1,Header:null,slug:n,children:(0,h.jsx)(hq,{children:(0,h.jsx)(hD,{children:(0,h.jsx)(aZ,{children:(0,h.jsx)(gC,{})})})})}),r[15]=n,r[16]=t):t=r[16],t}function gS(){return g$}function g$(){return null}function g_(){return gk}function gk(){return null}var gE=c.default.createContext({collectionSlug:"",drawerSlug:"",initialFiles:void 0,initialForms:[],maxFiles:void 0,onCancel:()=>null,onSuccess:()=>null,selectableCollections:null,setCollectionSlug:()=>null,setInitialFiles:()=>null,setInitialForms:()=>null,setMaxFiles:()=>null,setOnCancel:()=>null,setOnSuccess:()=>null,setSelectableCollections:()=>null,setSuccessfullyUploaded:()=>!1,successfullyUploaded:!1});function gN(e){let t,r,n=(0,v.c)(17),{children:a,drawerSlugPrefix:l}=e,[i,o]=c.default.useState(null),[s,u]=c.default.useState(),[d,f]=c.default.useState(),[p,m]=c.default.useState(),[g,b]=c.default.useState(void 0),[y,x]=c.default.useState(void 0),[w,C]=c.default.useState(void 0),[j,S]=c.default.useState(!1),$=`${l?`${l}-`:""}${gT()}`,_;n[0]===Symbol.for("react.memo_cache_sentinel")?(_=e=>{f(()=>e)},n[0]=_):_=n[0];let k=_,E;n[1]===Symbol.for("react.memo_cache_sentinel")?(E=e=>{m(()=>e)},n[1]=E):E=n[1];let N=E,P;return n[2]!==p?(P=()=>{"function"==typeof p&&p()},n[2]=p,n[3]=P):P=n[3],n[4]!==d?(t=(e,t)=>
48{"function"==typeof d&&d(e,t)},n[4]=d,n[5]=t):t=n[5],n[6]!==a||n[7]!==s||n[8]!==$||n[9]!==g||n[10]!==y||n[11]!==w||n[12]!==i||n[13]!==j||n[14]!==P||n[15]!==t?(r=(0,h.jsx)(gE,{value:{collectionSlug:s,drawerSlug:$,initialFiles:g,initialForms:y,maxFiles:w,onCancel:P,onSuccess:t,selectableCollections:i,setCollectionSlug:u,setInitialFiles:b,setInitialForms:x,setMaxFiles:C,setOnCancel:N,setOnSuccess:k,setSelectableCollections:o,setSuccessfullyUploaded:S,successfullyUploaded:j},children:(0,h.jsxs)(c.default.Fragment,{children:[a,(0,h.jsx)(gj,{})]})}),n[6]=a,n[7]=s,n[8]=$,n[9]=g,n[10]=y,n[11]=w,n[12]=i,n[13]=j,n[14]=P,n[15]=t,n[16]=r):r=n[16],r}var gP=()=>c.default.use(gE);function gT(){let e=ig();return`bulk-upload-drawer-slug-${e||1}`}var gD="upload-relationship-details";function gR(e){let t=(0,v.c)(11),{id:r,allowEdit:n,allowRemove:a,alt:l,byteSize:i,className:o,collectionSlug:s,displayPreview:c,filename:u,mimeType:p,onRemove:g,reloadDoc:b,showCollectionSlug:y,src:x,thumbnailSrc:w,updatedAt:C,withMeta:j,x:S,y:$}=e,_=void 0===j||j,{config:k}=(0,d.c)(),{i18n:E}=(0,f.d)(),N="collections"in k?k.collections.find(e=>e.slug===s):void 0,P=r??void 0,T;t[0]!==s||t[1]!==P?(T={id:P,collectionSlug:s},t[0]=s,t[1]=P,t[2]=T):T=t[2];let[D,,R]=fV(T),{openDrawer:A}=R,O;t[3]!==s||t[4]!==b?(O=async e=>{let{doc:t}=e;return b(t.id,s)},t[3]=s,t[4]=b,t[5]=O):O=t[5];let L=O,M;t[6]!==S||t[7]!==$?(M=function(e,t){let r=[];return t&&r.push(rR(t)),S&&$&&r.push(`${S}x${$}`),e&&r.push(e),r.join(" — ")},t[6]=S,t[7]=$,t[8]=M):M=t[8];let I=_?M(p,i):"",F=c??N?.upload?.displayPreview??!0,B;return t[9]!==o?(B=[gD,o].filter(Boolean),t[9]=o,t[10]=B):B=t[10],(0,h.jsxs)("div",{className:B.join(" "),children:[(0,h.jsxs)("div",{className:`${gD}__imageAndDetails`,children:[F&&(0,h.jsx)(f8,{alt:l,className:`${gD}__thumbnail`,filename:u,fileSrc:w,imageCacheTag:N?.upload?.cacheTags&&C,size:"small"}),void 0!==y&&y&&N?(0,h.jsx)(sl,{size:"small",children:m(N.labels.singular,E)}):null,(0,h.jsxs)("div",{className:`${gD}__details`,children:[(0,h.jsx)("p",{className:`${gD}__filename`,children:x?(0,h.jsx)("a",{href:x,target:"_blank",children:u}):u}),_?(0,h.jsx)("p",{className:`${gD}__meta`,children:I}):null]})]}),!1!==n||!1!==a?(0,h.jsxs)("div",{className:`${gD}__actions`,children:[!1!==n?(0,h.jsx)(au,{buttonStyle:"icon-label",className:`${gD}__edit`,icon:"edit",iconStyle:"none",onClick:A}):null,!1!==a?(0,h.jsx)(au,{buttonStyle:"icon-label",className:`${gD}__remove`,icon:"x",iconStyle:"none",onClick:()=>g()}):null,(0,h.jsx)(D,{onSave:L})]}):null]})}var gA="upload-field-card";function gO({children:e,className:t,size:r="medium"}){return(0,h.jsx)("div",{className:[gA,t,`${gA}--size-${r}`].filter(Boolean).join(" "),children:e})}var gL="upload upload--has-many";function gM(e){let t=(0,v.c)(29),{className:r,displayPreview:n,fileDocs:a,isSortable:l,onRemove:i,onReorder:o,readonly:s,reloadDoc:c,serverURL:u,showCollectionSlug:d}=e,f=void 0!==d&&d,p;t[0]!==a||t[1]!==o?(p=(e,t)=>{if(e===t)return;let r=[...a],[n]=r.splice(e,1);r.splice(t,0,n),o(r)},t[0]=a,t[1]=o,t[2]=p):p=t[2];let m=p,g;t[3]!==a||t[4]!==i?(g=e=>{let t=[...a||[]];t.splice(e,1),i(0===t.length?[]:t)},t[3]=a,t[4]=i,t[5]=g):g=t[5];let b=g,y;t[6]!==r?(y=[gL,r].filter(Boolean),t[6]=r,t[7]=y):y=t[7];let x=y.join(" "),w;if(t[8]!==n||t[9]!==a||t[10]!==l||t[11]!==m||t[12]!==s||t[13]!==c||t[14]!==b||t[15]!==u||t[16]!==f||t[17]!==x){let e,r;t[19]!==m?(e=e=>{let{moveFromIndex:t,moveToIndex:r}=e;return m(t,r)},t[19]=m,t[20]=e):e=t[20],t[21]!==n||t[22]!==l||t[23]!==s||t[24]!==c||t[25]!==b||t[26]!==u||t[27]!==f?(r=(e,t)=>{let{relationTo:r,value:a}=e,i=String(a.id),o,d;if(a.url)try{o=new URL(a.url,u).toString()}catch{o=`${u}${a.url}`}if(a.thumbnailURL)try{d=new URL(a.thumbnailURL,u).toString()}catch{d=`${u}${a.thumbnailURL}`}return rg(a.mimeType)&&(d=rm({sizes:a.sizes,thumbnailURL:d,url:o,width:a.width})),(0,h.jsx)(aq,{disabled:!l||s,id:i,children:e=>(0,h.jsx)("div",{className:[`${gL}__dragItem`,e&&l&&`${gL}--has-drag-handle`].filter(Boolean).join(" "),ref:e.setNodeRef,style:{transform:e.transform,transition:e.transition,zIndex:e.isDragging?1:void 0},children:(0,h.jsxs)(gO,{size:"small",children:[e&&(0,h.jsx)("div",{className:`${gL}__drag`,...e.attributes,...e.listeners,children:(0,h.jsx)(o6,{})}),(0,h.jsx)(gR,{allowEdit:!s,allowRemove:!s,alt:a?.alt||a?.filename,byteSize:a.filesize,collectionSlug:r,displayPreview:n,filename:a.filename,id:i,mimeType:a?.mimeType,onRemove:()=>b(t),reloadDoc:c,showCollectionSlug:f,src:o,thumbnailSrc:d,updatedAt:a.updatedAt,withMeta:!1,x:a?.width,y:a?.height})]})})},i)},t[21]=n,t[22]=l,t[23]=s,t[24]=c,t[25]=b,t[26]=u,t[27]=f,t[28]=r):r=t[28],w=(0,h.jsx)("div",{className:x,children:(0,h.jsx)(aK,{className:`${gL}__draggable-rows`,ids:a?.map(gI),onDragEnd:e,children:a.map(r)})}),t[8]=n,t[9]=a,t[10]=l,t[11]=m,t[12]=s,t[13]=c,t[14]=b,t[15]=u,t[16]=f,t[17]=x,t[18]=w}else w=t[18];return w}function gI(e){let{value:t}=e;return String(t.id)}function gF(e){let{className:t,displayPreview:r,fileDoc:n,onRemove:a,readonly:l,reloadDoc:i,serverURL:o,showCollectionSlug:s=!1}=e,{relationTo:c,value:u}=n,d=String(u?.id),f,p;
48if(u.url)try{f=new URL(u.url,o).toString()}catch{f=`${o}${u.url}`}if(u.thumbnailURL)try{p=new URL(u.thumbnailURL,o).toString()}catch{p=`${o}${u.thumbnailURL}`}return rg(u.mimeType)&&(p=rm({sizes:u.sizes,thumbnailURL:p,url:f,width:u.width})),(0,h.jsx)(gO,{className:["upload upload--has-one",t].filter(Boolean).join(" "),children:(0,h.jsx)(gR,{allowEdit:!l,allowRemove:!l,alt:u?.alt||u?.filename,byteSize:u.filesize,collectionSlug:c,displayPreview:r,filename:u.filename,id:d,mimeType:u?.mimeType,onRemove:a,reloadDoc:i,showCollectionSlug:s,src:f,thumbnailSrc:p,updatedAt:u.updatedAt,x:u?.width,y:u?.height})})}var gB="upload";function gz(e){let{AfterInput:t,allowCreate:r,api:n,BeforeInput:a,className:l,Description:i,description:o,displayPreview:s,Error:u,filterOptions:p,hasMany:m,isSortable:g,Label:b,label:v,localized:y,maxRows:x,onChange:w,path:C,readOnly:j,relationTo:S,required:$,serverURL:_,showError:k,style:E,value:N}=e,[P,T]=c.default.useState(),[D]=c.default.useState(Array.isArray(S)?S[0]:S),{openModal:R}=lc(),{drawerSlug:A,setCollectionSlug:O,setInitialFiles:L,setMaxFiles:M,setOnSuccess:I,setSelectableCollections:F}=gP(),{permissions:B}=iS(),{code:z}
48=iP(),{i18n:U,t:V}=(0,f.d)(),H=(0,c.useMemo)(()=>Array.isArray(S)?S.filter(e=>B?.collections&&B.collections?.[e]?.create):[],[S,B]),q=(0,c.useMemo)(()=>{let e=Array.isArray(S);if(!N)return p;let t={};for(let r of Array.isArray(N)?N:[N])if(e&&"object"==typeof r&&"relationTo"in r)t[r.relationTo]||(t[r.relationTo]=[]),t[r.relationTo].push(r.value);else if(!e){t[S]||(t[S]=[]);let e="object"==typeof r&&"value"in r?r.value:r;("string"==typeof e||"number"==typeof e)&&t[S].push(e)}let r={...p};return(e?S:[S]).forEach(e=>{let n=t[e]||[];r[e]={...p?.[e]||{},id:{...p?.[e]?.id||{},not_in:(p?.[e]?.id?.not_in||[]).concat(n)}}}),r},[N,p,S]),[K,,{closeDrawer:W,openDrawer:G}]=pA({collectionSlugs:"string"==typeof S?[S]:S,filterOptions:q}),[Y,,{closeDrawer:Q,openDrawer:X}]=fV({collectionSlug:D}),J=c.default.useRef(null),Z=(0,c.useMemo)(()=>!!r&&!!("string"==typeof D&&B?.collections&&B.collections?.[D]?.create),[D,B,r]),ee=c.default.useCallback(e=>{"function"==typeof w&&w(e)},[w]),et=c.default.useCallback(async e=>{if(!e?.length)return[];let t={};e.forEach(({relationTo:e,value:r})=>{t[e]||(t[e]=[]);let n=r;r&&"object"==typeof r&&"value"in r&&(n=r.value),t[e].push(n)});let r=Object.entries(t).map(async([e,t])=>{let r={depth:0,draft:!0,limit:t.length,locale:z,where:{and:[{id:{in:t}}]}},a=await fetch(tR({apiRoute:n,path:`/${e}`}),{body:t6(r),credentials:"include",headers:{"Accept-Language":U.language,"Content-Type":"application/x-www-form-urlencoded","X-Payload-HTTP-Method-Override":"GET"},method:"POST"}),l=[];return a.ok&&(l=(await a.json()).docs),{collection:e,docsById:l.reduce((e,t)=>(e[t.id]=t,e),{})}}),a=await Promise.all(r),l={};return a.forEach(({collection:e,docsById:t})=>{l[e]=t}),e.map(({relationTo:e,value:t})=>{let r=l[e]?.[t]||{id:t,filename:`${V("general:untitled")} - ID: ${t}`,isPlaceholder:!0};return{relationTo:e,value:r}})},[n,z,U.language,V]),er=(0,c.useCallback)(e=>(function(e,t){let r=Array.isArray(t);if("string"==typeof e||"number"==typeof e)return e;if(e&&"object"==typeof e&&"relationTo"in e&&"value"in e){let t=e.value;for(;t&&"object"==typeof t&&null!==t&&"value"in t;)t=t.value;return t&&"object"==typeof t&&null!==t&&"id"in t&&(t=t.id),r?{relationTo:e.relationTo,value:t}:t}return e&&"object"==typeof e&&"id"in e?e.id:e})(e,S),[S]),en=(0,c.useCallback)(e=>{let t=Array.isArray(S);if(m){let r=e.map(e=>t?{relationTo:e.collectionSlug,value:e.doc.id}:e.doc.id);ee([...Array.isArray(N)?N.map(er):[],...r]),T(t=>[...t||[],...e.map(e=>({relationTo:e.collectionSlug,value:e.doc}))])}else{let r=e[0];ee(t?{relationTo:r.collectionSlug,value:r.doc.id}:r.doc.id),T([{relationTo:r.collectionSlug,value:r.doc}])}},[N,ee,m,S,er]),ea=c.default.useCallback(e=>{let t=e;if(!m&&e&&e.length>1){let r=new DataTransfer;r.items.add(e[0]),t=r.files}t&&L(t),O(Array.isArray(S)?D:S),Array.isArray(H)&&F(H),"number"==typeof x&&M(x),R(A)},[m,S,D,O,H,x,R,A,L,F,M]),el=c.default.useCallback(async e=>{let t=Array.isArray(S),r=[];for(let[t,n]of e)n&&r.push(t);let n=r.map(e=>({relationTo:D,value:e})),a=await et(n);a&&T(e=>[...e||[],...a]);let l=r.map(e=>t?{relationTo:D,value:e}:e);ee([...Array.isArray(N)?N.map(er):[],...l]),W()},[D,W,ee,et,N,S,er]),ei=c.default.useCallback(e=>{let t=Array.isArray(S);e.doc&&(T(t=>[...t||[],{relationTo:D,value:e.doc}]),ee(t?{relationTo:D,value:e.doc.id}:e.doc.id)),Q()},[Q,D,ee,S]),eo=(0,c.useCallback)(async({collectionSlug:e,doc:t})=>{let r=Array.isArray(S),n=(await et([{relationTo:e,value:t.id}]))?.[0]||null;if(T(e=>n?m?[...e||[],n]:[n]:e),m){let n=r?{relationTo:e,value:t.id}:t.id;ee([...Array.isArray(N)?N.map(er):[],n])}else ee(r?{relationTo:e,value:t.id}:t.id);W()},[W,m,et,ee,N,S,er]),es=c.default.useCallback(async(e,t)=>{let r=await et([{relationTo:t,value:e}]);if(r[0]){let e=[];T(n=>{let a=n?.findIndex(e=>(e.value?.id===r[0].value.id||e.value?.isPlaceholder)&&e.relationTo===t);if(a>-1){let t=[...n];return t[a]=r[0],e=t,t}return n}),e.length&&m&&ee(e.map(e=>e.value?.id))}},[et,ee,m]),ec=c.default.useCallback(e=>{let t=Array.isArray(S);ee(e.map(({relationTo:e,value:r})=>t?{relationTo:e,value:r.id}:r.id)),T(e)},[ee,S]),eu=c.default.useCallback(e=>{let t=Array.isArray(S);if(!e||0===e.length){ee(m?[]:null),T(m?[]:null);return}let r=e.map(({relationTo:e,value:r})=>
48t?{relationTo:e,value:r.id}:r.id);ee(m?r:r[0]),T(e)},[ee,m,S]);(0,c.useEffect)(()=>{async function e(){if(N){let e=[];if(Array.isArray(S)&&("object"==typeof N&&"relationTo"in N||Array.isArray(N)&&N.length>0&&"object"==typeof N[0]&&"relationTo"in N[0])?e=(Array.isArray(N)?N:[N]).filter(e=>"object"==typeof e&&"relationTo"in e).map(e=>{let t=e.value;for(;t&&"object"==typeof t&&null!==t&&"value"in t;)t=t.value;return{relationTo:e.relationTo,value:t}}):Array.isArray(S)||(e=(Array.isArray(N)?N:[N]).map(e=>{let t=e;for(;t&&"object"==typeof t&&null!==t&&"value"in t;)t=t.value;return{relationTo:S,value:t}})),e.length>0){let t=await et(e);t&&(T(t),J.current=N)}}else T([]),J.current=null}J.current!==N&&e()},[et,N,S]),(0,c.useEffect)(()=>{I(en)},[N,C,en,I]);let ed=!N||m&&Array.isArray(N)&&("number"!=typeof x||N.length<x)||!m&&P?.[0]&&typeof P[0].value>"u";return(0,h.jsxs)("div",{className:[oK,gB,l,k&&"error",j&&"read-only"].filter(Boolean).join(" "),id:`field-${C?.replace(/\./g,"__")}`,style:E,children:[(0,h.jsx)(r7,{CustomComponent:b,Fallback:(0,h.jsx)(iR,{label:v,localized:y,path:C,required:$})}),(0,h.jsx)("div",{className:`${gB}__wrap`,children:(0,h.jsx)(r7,{CustomComponent:u,Fallback:(0,h.jsx)(aX,{path:C,showError:k})})}),a,(0,h.jsxs)("div",{className:`${gB}__dropzoneAndUpload`,children:[m&&Array.isArray(N)&&N.length>0?(0,h.jsx)(h.Fragment,{children:P&&P?.length>0?(0,h.jsx)(gM,{displayPreview:s,fileDocs:P,isSortable:g&&!j,onRemove:eu,onReorder:ec,readonly:j,reloadDoc:es,serverURL:_,showCollectionSlug:Array.isArray(S)}):(0,h.jsx)("div",{className:`${gB}__loadingRows`,children:N.map(e=>(0,h.jsx)(d.f,{height:"40px"},"object"==typeof e?e.value:e))})}):null,!m&&N?(0,h.jsx)(h.Fragment,{children:P&&P?.length>0&&P[0].value?(0,h.jsx)(gF,{displayPreview:s,fileDoc:P[0],onRemove:eu,readonly:j,reloadDoc:es,serverURL:_,showCollectionSlug:Array.isArray(S)}):P&&N&&!P?.[0]?.value?(0,h.jsxs)(h.Fragment,{children:[V("general:untitled")," - ID: ",N]}):(0,h.jsx)(d.f,{height:"62px"})}):null,ed?(0,h.jsx)(hO,{disabled:j||!Z,multipleFiles:m,onChange:ea,children:(0,h.jsxs)("div",{className:`${gB}__dropzoneContent`,children:[(0,h.jsxs)("div",{className:`${gB}__dropzoneContent__buttons`,children:[Z&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(au,{buttonStyle:"pill",className:`${gB}__createNewToggler`,disabled:j||!Z,onClick:()=>{j||(m?ea():X())},size:"small",children:V("general:createNew")}),(0,h.jsx)("span",{className:`${gB}__dropzoneContent__orText`,children:V("general:or")})]}),(0,h.jsx)(au,{buttonStyle:"pill",className:`${gB}__listToggler`,disabled:j,onClick:G,size:"small",children:V("fields:chooseFromExisting")}),(0,h.jsx)(Y,{onSave:ei}),(0,h.jsx)(K,{allowCreate:Z,enableRowSelections:m,onBulkSelect:el,onSelect:eo})]}),Z&&!j&&(0,h.jsxs)("p",{className:`${gB}__dragAndDropText`,children:[V("general:or")," ",V("upload:dragAndDrop")]})]})}):(0,h.jsx)(h.Fragment,{children:!j&&!P&&(!N||"number"!=typeof x||Array.isArray(N)&&N.length<x)?(0,h.jsx)(d.f,{height:"40px"}):null})]}),t,(0,h.jsx)(r7,{CustomComponent:i,Fallback:(0,h.jsx)(aQ,{description:o,path:C})})]})}var gU=oH(function(e){let{field:t,field:{admin:{allowCreate:r,className:n,description:a,isSortable:l}={},hasMany:i,label:o,localized:s,maxRows:u,relationTo:f,required:p},path:m,readOnly:g,validate:b}=e,{config:v}=(0,d.c)(),y=t.displayPreview,{customComponents:{AfterInput:x,BeforeInput:w,Description:C,Error:j,Label:S}={},disabled:$,filterOptions:_,path:k,setValue:E,showError:N,value:P}=oz({potentiallyStalePath:m,validate:c.default.useCallback((e,t)=>{if("function"==typeof b)return b(e,{...t,required:p})},[b,p])}),T=Array.isArray(f),D=c.default.useMemo(()=>!0===i&&Array.isArray(P)?P.map(e=>T?e:{relationTo:Array.isArray(f)?f[0]:f,value:e}):P,[i,P,T,f]),R=(0,c.useMemo)(()=>oq(t),[t]);return(0,h.jsx)(gN,{drawerSlugPrefix:m,children:(0,h.jsx)(gz,{AfterInput:x,allowCreate:!1!==r,api:v.routes.api,BeforeInput:w,className:n,Description:C,description:a,displayPreview:y,Error:j,filterOptions:_,hasMany:i,isSortable:l,label:o,Label:S,localized:s,maxRows:u,onChange:E,path:k,readOnly:g||$,relationTo:f,required:p,serverURL:v.serverURL,showError:N,style:R,value:D})})});function gV(e){let t=(0,v.c)(13),{clientFieldConfig:r,forceRender:n,indexPath:a,parentPath:l,parentSchemaPath:i,path:o,permissions:s,readOnly:c,schemaPath:u}=e,d;t[0]!==o?(d=e=>{let[t]=e;return t&&t?.[o]?.customComponents?.Field},t[0]=o,t[1]=d):d=t[1];let f=nj(d),p;if(t[2]!==f||t[3]!==r||t[4]!==n||t[5]!==a||t[6]!==l||t[7]!==i||t[8]!==o||t[9]!==s||t[10]!==c||t[11]!==u){p=Symbol.for("react.early_return_sentinel");e:{let e={forceRender:n,permissions:s,readOnly:c,schemaPath:u};if(r.admin?.hidden){p=(0,h.jsx)(fa,{...e,path:o});break e}if(void 0!==f){p=f||null;break e}let t={...e,indexPath:a,parentPath:l,parentSchemaPath:i};switch(r.type){case"array":p=(0,h.jsx)(gY,{...t,field:r,path:o});break e;case"blocks":p=(0,h.jsx)(sE,{...t,field:r,path:o});break e;case"checkbox":p=(0,h.jsx)(oZ,{...e,field:r,path:o});break e;case"code":p=(0,h.jsx)(sD,{...e,field:r,path:o});break e;case"collapsible":p=(0,h.jsx)(sL,{...t,field:r,path:o});break e;case"date":p=(0,h.jsx)(d6,{...e,field:r,path:o});break e;case"email":p=(0,h.jsx)(d5,{...e,field:r,path:o});break e;case"group":p=(0,h.jsx)(fn,{...t,field:r,path:o});break e;case"join":p=(0,h.jsx)(py,{...e,field:r,path:o});break e;case"json":p=(0,h.jsx)(px,{...e,field:r,path:o});break e;case"number":p=(0,h.jsx)(pw,{...e,field:r,path:o});break e;case"point":p=(0,h.jsx)(pj,{...e,field:r,path:o});break e;case"radio":p=(0,h.jsx)(pk,{...e,field:r,path:o});break e;case"relationship":p=(0,h.jsx)(p6,{...e,field:r,path:o});break e;case"richText":p=(0,h.jsx)(p5,{...e,field:r,path:o});break e;case"row":p=(0,h.jsx)(p4,{...t,field:r});break e;case"select":p=(0,h.jsx)(p9,{...e,field:r,path:o});break e;case"tabs":p=(0,h.jsx)(hy,{...t,field:r,path:o});break e;case"text":p=(0,h.jsx)(hk,{...e,field:r,path:o});break e;case"textarea":p=(0,h.jsx)(hN,{...e,field:r,path:o});break e;case"ui":p=(0,h.jsx)(hP,{});break e;case"upload":p=(0,h.jsx)(gU,{...e,field:r,path:o});break e}}t[2]=f,t[3]=r,t[4]=n,t[5]=a,t[6]=l,t[7]=i,t[8]=o,t[9]=s,t[10]=c,t[11]=u,t[12]=p}else p=t[12];if(p!==Symbol.for("react.early_return_sentinel"))return p}var gH="render-fields",gq=e=>{let t=(0,v.c)(22),{className:r,fields:n,forceRender:a,margins:l,parentIndexPath:i,parentPath:o,parentSchemaPath:s,permissions:c,readOnly:u}=e,d=oM();if(n&&n.length>0){let e=l&&`${gH}--margins-${l}`,f=!1===l&&`${gH}--margins-none`,p;
48t[0]!==r||t[1]!==e||t[2]!==f?(p=[gH,r,e,f].filter(Boolean),t[0]=r,t[1]=e,t[2]=f,t[3]=p):p=t[3];let m=p.join(" "),g;if(t[4]!==n||t[5]!==a||t[6]!==d||t[7]!==i||t[8]!==o||t[9]!==s||t[10]!==c||t[11]!==u||t[12]!==m){let e;t[14]!==a||t[15]!==d||t[16]!==i||t[17]!==o||t[18]!==s||t[19]!==c||t[20]!==u?(e=(e,t)=>{if(!e||$(e))return null;let{operation:r,permissions:n,read:l}=t9({field:e,operation:d,parentName:o?.includes(".")?o.split(".")[o.split(".").length-1]:o,permissions:c});if("name"in e&&!l)return null;let f=u||e?.admin?.readOnly;f&&e.admin?.readOnly===!1&&(f=!1),"name"in e&&!r&&(f=!0);let{indexPath:p,path:m,schemaPath:g}=t7({field:e,index:t,parentIndexPath:i,parentPath:o,parentSchemaPath:s});return(0,h.jsx)(oI,{value:m,children:(0,h.jsx)(gV,{clientFieldConfig:e,forceRender:a,indexPath:p,parentPath:o,parentSchemaPath:s,path:m,permissions:n,readOnly:f,schemaPath:g})},`${m}-${t}`)},t[14]=a,t[15]=d,t[16]=i,t[17]=o,t[18]=s,t[19]=c,t[20]=u,t[21]=e):e=t[21],g=(0,h.jsx)(st,{className:m,forceRender:a,children:n.map(e)}),t[4]=n,t[5]=a,t[6]=d,t[7]=i,t[8]=o,t[9]=s,t[10]=c,t[11]=u,t[12]=m,t[13]=g}else g=t[13];return g}return null},gK="array-field",gW=e=>{let t=(0,v.c)(41),{addRow:r,attributes:n,copyRow:a,CustomRowLabel:l,duplicateRow:i,errorCount:o,fields:s,forceRender:c,hasMaxRows:u,isDragging:p,isLoading:g,isSortable:b,labels:y,listeners:x,moveRow:w,parentPath:C,pasteRow:j,path:S,permissions:$,readOnly:_,removeRow:k,row:E,rowCount:N,rowIndex:P,schemaPath:T,scrollIdPrefix:D,setCollapse:R,setNodeRef:A,transform:O,transition:L}=e,M=void 0!==c&&c,I=si(g,500),{i18n:F}=(0,f.d)(),B=nv(),z=`${m(y.singular,F)} ${String(P+1).padStart(2,"0")}`,U=o>0&&B,V=U?`${gK}__row--has-errors`:`${gK}__row--no-errors`,H;t[0]!==V?(H=[`${gK}__row`,V].filter(Boolean),t[0]=V,t[1]=H):H=t[1];let q=H.join(" "),K=`${C.split(".").join("-")}-row-${P}`,W=p?1:void 0,G;if(t[2]!==l||t[3]!==r||t[4]!==n||t[5]!==q||t[6]!==a||t[7]!==i||t[8]!==o||t[9]!==z||t[10]!==U||t[11]!==s||t[12]!==M||t[13]!==u||t[14]!==F||t[15]!==I||t[16]!==b||t[17]!==x||t[18]!==w||t[19]!==C||t[20]!==j||t[21]!==S||t[22]!==$||t[23]!==_||t[24]!==k||t[25]!==E.collapsed||t[26]!==E.id||t[27]!==N||t[28]!==P||t[29]!==T||t[30]!==D||t[31]!==R||t[32]!==A||t[33]!==K||t[34]!==W||t[35]!==O||t[36]!==L){let e;t[38]!==E.id||t[39]!==R?(e=e=>R(E.id,e),t[38]=E.id,t[39]=R,t[40]=e):e=t[40],G=(0,h.jsx)("div",{id:K,ref:A,style:{transform:O,transition:L,zIndex:W},children:(0,h.jsx)(se,{actions:_?void 0:(0,h.jsx)(o3,{addRow:r,copyRow:a,duplicateRow:i,hasMaxRows:u,index:P,isSortable:b,moveRow:w,pasteRow:j,removeRow:k,rowCount:N}),className:q,collapsibleStyle:U?"error":"default",dragHandleProps:b?{id:E.id,attributes:n,listeners:x}:void 0,header:(0,h.jsxs)("div",{className:`${gK}__row-header`,id:`${D}-row-${P}`,children:[I?(0,h.jsx)(d.f,{height:"1rem",width:"8rem"}):(0,h.jsx)(nk,{CustomComponent:l,label:z,path:S,rowNumber:P}),U&&(0,h.jsx)(aG,{count:o,i18n:F,withMessage:!0})]}),isCollapsed:E.collapsed,onToggle:e,children:I?(0,h.jsx)(d.f,{}):(0,h.jsx)(gq,{className:`${gK}__fields`,fields:s,forceRender:M,margins:"small",parentIndexPath:"",parentPath:S,parentSchemaPath:T,permissions:!0===$?$:$?.fields,readOnly:_})})},`${C}-row-${E.id}`),t[2]=l,t[3]=r,t[4]=n,t[5]=q,t[6]=a,t[7]=i,t[8]=o,t[9]=z,t[10]=U,t[11]=s,t[12]=M,t[13]=u,t[14]=F,t[15]=I,t[16]=b,t[17]=x,t[18]=w,t[19]=C,t[20]=j,t[21]=S,t[22]=$,t[23]=_,t[24]=k,t[25]=E.collapsed,t[26]=E.id,t[27]=N,t[28]=P,t[29]=T,t[30]=D,t[31]=R,t[32]=A,t[33]=K,t[34]=W,t[35]=O,t[36]=L,t[37]=G}else G=t[37];return G},gG="array-field",gY=oH(e=>{let{field:t,field:{name:r,type:n,admin:{className:a,description:l,isSortable:i=!0}={},fields:o,label:s,localized:u,maxRows:p,minRows:g,required:b},forceRender:v=!1,path:y,permissions:x,readOnly:w,schemaPath:C,validate:j}=e,S=C??r,$=g??+!!b,{setDocFieldPreferences:_}=oD(),{addFieldRow:k,dispatchFields:E,getFields:N,moveFieldRow:P,removeFieldRow:T,replaceState:D,setModified:R}=nm(),A=nv(),{code:O}=iP(),{i18n:L,t:M}=(0,f.d)(),{config:{localization:I}}=(0,d.c)(),F=!I||!I.fallback||O===I.defaultLocale,B="labels"in e&&e?.labels?e.labels:"labels"in e.field&&e.field.labels?{plural:e.field.labels?.plural,singular:e.field.labels?.singular}:"label"in e.field&&e.field.label?{plural:void 0,singular:e.field.label}:{plural:M("general:rows"),singular:M("general:row")},{customComponents:{AfterInput:z,BeforeInput:U,Description:V,Error:H,Label:q}={},disabled:K,errorPaths:W,path:G,rows:Y=[],showError:Q,valid:X,value:J}=oz({hasRows:!0,potentiallyStalePath:y,validate:(0,c.useCallback)((e,t)=>!F&&null===e||("function"==typeof j?j(e,{...t,maxRows:p,minRows:$,required:b}):void 0),[p,$,b,j,F])}),Z=(0,c.useId)(),ee=(0,c.useMemo)(()=>`scroll-${Z}`,[Z]),et=(0,c.useCallback)(e=>{k({path:G,rowIndex:e,schemaPath:S}),setTimeout(()=>{o1(`${ee}-row-${e}`)},0)},[k,G,S,ee]),er=(0,c.useCallback)(e=>{E({type:"DUPLICATE_ROW",path:G,rowIndex:e}),R(!0),setTimeout(()=>{o1(`${ee}-row-${e}`)},0)},[E,G,ee,R]),en=(0,c.useCallback)(e=>{T({path:G,rowIndex:e})},[T,G]),ea=(0,c.useCallback)((e,t)=>{P({moveFromIndex:e,moveToIndex:t,path:G})},[G,P]),el=(0,c.useCallback)(e=>{let{collapsedIDs:t,updatedRows:r}=iO({collapsed:e,rows:Y});_(G,{collapsed:t}),E({type:"SET_ALL_ROWS_COLLAPSED",path:G,updatedRows:r})},[E,G,Y,_]),ei=(0,c.useCallback)((e,t)=>{let{collapsedIDs:r,updatedRows:n}=iA({collapsed:t,rowID:e,rows:Y});E({type:"SET_ROW_COLLAPSED",path:G,updatedRows:n}),_(G,{collapsed:r})},[E,G,Y,_]),eo=(0,c.useCallback)(e=>{let t={...N()},r=ap({type:n,fields:o,getDataToCopy:()=>aw({formState:t,path:G,rowIndex:e}),path:G,rowIndex:e,t:M});"string"==typeof r?nI.error(r):nI.success(M("general:copied"))},[o,N,G,M,n]),es=(0,c.useCallback)(e=>{let t={...N()},r=ah({onPaste:r=>{D(aC({dataFromClipboard:r,formState:t,path:G,rowIndex:e})),R(!0)},path:G,schemaFields:o,t:M});"string"==typeof r&&nI.error(r)},[o,N,G,D,R,M]),ec=(0,c.useCallback)(e=>{D(aC({dataFromClipboard:e,formState:{...N()},path:G})),R(!0)},[N,G,D,R]),eu=(0,c.useCallback)(()=>aw({formState:{...N()},path:G}),[N,G]),ed=p&&Y.length>=p,ef=W.length,ep=A&&W.length>0,eh=(w||K)&&0===Y.length,em=Y.length&&Y.length<$||b&&0===Y.length,eg=(0,c.useMemo)(()=>oq(t),[t]);return(0,h.jsxs)("div",{className:[oK,gG,a,ep?`${gG}--has-error`:`${gG}
48--has-no-error`].filter(Boolean).join(" "),id:`field-${G.replace(/\./g,"__")}`,style:eg,children:[Q&&(0,h.jsx)(r7,{CustomComponent:H,Fallback:(0,h.jsx)(aX,{path:G,showError:Q})}),(0,h.jsxs)("header",{className:`${gG}__header`,children:[(0,h.jsxs)("div",{className:`${gG}__header-wrap`,children:[(0,h.jsxs)("div",{className:`${gG}__header-content`,children:[(0,h.jsx)("h3",{className:`${gG}__title`,children:(0,h.jsx)(r7,{CustomComponent:q,Fallback:(0,h.jsx)(iR,{as:"span",label:s,localized:u,path:G,required:b})})}),ep&&ef>0&&(0,h.jsx)(aG,{count:ef,i18n:L,withMessage:!0})]}),(0,h.jsxs)("ul",{className:`${gG}__header-actions`,children:[Y?.length>0&&(0,h.jsxs)(c.Fragment,{children:[(0,h.jsx)("li",{children:(0,h.jsx)("button",{className:`${gG}__header-action`,onClick:()=>el(!0),type:"button",children:M("fields:collapseAll")})}),(0,h.jsx)("li",{children:(0,h.jsx)("button",{className:`${gG}__header-action`,onClick:()=>el(!1),type:"button",children:M("fields:showAll")})})]}),(0,h.jsx)("li",{children:(0,h.jsx)(av,{allowCopy:Y?.length>0,allowPaste:!w,className:`${gG}__header-action`,disabled:K,fields:o,getDataToCopy:eu,onPaste:ec,path:G,type:n})})]})]}),(0,h.jsx)(r7,{CustomComponent:V,Fallback:(0,h.jsx)(aQ,{description:l,path:G})})]}),(0,h.jsx)(o0,{fieldValue:J,localized:u,path:G,readOnly:w}),U,(Y?.length>0||!X&&(eh||em))&&(0,h.jsxs)(aK,{className:`${gG}__draggable-rows`,ids:Y.map(e=>e.id),onDragEnd:({moveFromIndex:e,moveToIndex:t})=>ea(e,t),children:[Y.map((e,t)=>{let{id:r,isLoading:n}=e,a=`${G}.${t}`,l=W?.filter(e=>e.startsWith(a+".")).length;return(0,h.jsx)(aq,{disabled:w||K||!i,id:r,children:r=>(0,h.jsx)(gW,{...r,addRow:et,copyRow:eo,CustomRowLabel:Y?.[t]?.customComponents?.RowLabel,duplicateRow:er,errorCount:l,fields:o,forceRender:v,hasMaxRows:ed,isLoading:n,isSortable:i,labels:B,moveRow:ea,parentPath:G,pasteRow:es,path:a,permissions:x,readOnly:w||K,removeRow:en,row:e,rowCount:Y?.length,rowIndex:t,schemaPath:S,scrollIdPrefix:ee,setCollapse:ei})},r)}),!X&&(0,h.jsxs)(c.default.Fragment,{children:[eh&&(0,h.jsx)(nJ,{children:M("validation:fieldHasNo",{label:m(B.plural,L)})}),em&&(0,h.jsx)(nJ,{type:"error",children:M("validation:requiresAtLeast",{count:$,label:m($>1?B.plural:B.singular,L)||M($>1?"general:rows":"general:row")})})]})]}),!ed&&!w&&(0,h.jsx)(au,{buttonStyle:"icon-label",className:`${gG}__add-row`,disabled:K,icon:"plus",iconPosition:"left",iconStyle:"with-border",onClick:()=>{et(J||0)},children:M("fields:addLabel",{label:m(B.singular,L)})}),z]})}),gQ=e=>{let t=(0,v.c)(12),{disabled:r,path:n}=e,a=void 0===n?"confirm-password":n,{t:l}=(0,f.d)(),i;t[0]!==a?(i={path:a,validate:gX},t[0]=a,t[1]=i):i=t[1];let{disabled:o,setValue:s,showError:c,value:u}=oz(i),d=c&&"error",p;t[2]!==d?(p=[oK,"confirm-password",d].filter(Boolean),t[2]=d,t[3]=p):p=t[3];let m=p.join(" "),g;return t[4]!==o||t[5]!==r||t[6]!==a||t[7]!==s||t[8]!==l||t[9]!==m||t[10]!==u?(g=(0,h.jsxs)("div",{className:m,children:[(0,h.jsx)(iR,{htmlFor:"field-confirm-password",label:l("authentication:confirmPassword"),required:!0}),(0,h.jsxs)("div",{className:`${oK}__wrap`,children:[(0,h.jsx)(aX,{path:a}),(0,h.jsx)("input",{"aria-label":l("authentication:confirmPassword"),autoComplete:"off",disabled:!!(o||r),id:"field-confirm-password",name:"confirm-password",onChange:s,type:"password",value:u||""})]})]}),t[4]=o,t[5]=r,t[6]=a,t[7]=s,t[8]=l,t[9]=m,t[10]=u,t[11]=g):g=t[11],g};function gX(e,t){return rF(e,{name:"confirm-password",type:"text",required:!0,...t})}var gJ=e=>{let t=(0,v.c)(28),{AfterInput:r,autoComplete:n,BeforeInput:a,className:l,description:i,Description:o,Error:s,inputRef:c,Label:u,label:d,localized:p,onChange:g,onKeyDown:b,path:y,placeholder:x,readOnly:w,required:C,rtl:j,showError:S,style:$,value:_,width:k}=e,E=void 0===n?"off":n,{i18n:N}=(0,f.d)(),P=S&&"error",T=w&&"read-only",D;
48t[0]!==l||t[1]!==P||t[2]!==T?(D=[oK,"password",l,P,T].filter(Boolean),t[0]=l,t[1]=P,t[2]=T,t[3]=D):D=t[3];let R=D.join(" "),A;return t[4]!==r||t[5]!==a||t[6]!==o||t[7]!==s||t[8]!==u||t[9]!==E||t[10]!==i||t[11]!==N||t[12]!==c||t[13]!==d||t[14]!==p||t[15]!==g||t[16]!==b||t[17]!==y||t[18]!==x||t[19]!==w||t[20]!==C||t[21]!==j||t[22]!==S||t[23]!==$||t[24]!==R||t[25]!==_||t[26]!==k?(A=(0,h.jsxs)("div",{className:R,style:{...$,width:k},children:[(0,h.jsx)(r7,{CustomComponent:u,Fallback:(0,h.jsx)(iR,{label:d,localized:p,path:y,required:C})}),(0,h.jsxs)("div",{className:`${oK}__wrap`,children:[(0,h.jsx)(r7,{CustomComponent:s,Fallback:(0,h.jsx)(aX,{path:y,showError:S})}),(0,h.jsxs)("div",{children:[a,(0,h.jsx)("input",{"aria-label":m(d,N),autoComplete:E,"data-rtl":j,disabled:w,id:`field-${y.replace(/\./g,"__")}`,name:y,onChange:g,onKeyDown:b,placeholder:m(x,N),ref:c,type:"password",value:_||""}),r]}),(0,h.jsx)(r7,{CustomComponent:o,Fallback:(0,h.jsx)(aQ,{description:i,path:y})})]})]}),t[4]=r,t[5]=a,t[6]=o,t[7]=s,t[8]=u,t[9]=E,t[10]=i,t[11]=N,t[12]=c,t[13]=d,t[14]=p,t[15]=g,t[16]=b,t[17]=y,t[18]=x,t[19]=w,t[20]=C,t[21]=j,t[22]=S,t[23]=$,t[24]=R,t[25]=_,t[26]=k,t[27]=A):A=t[27],A},gZ=oH(e=>{let{autoComplete:t,field:r,field:{admin:{className:n,disabled:a,placeholder:l,rtl:i}={},label:o,localized:s,required:u}={},inputRef:p,path:m,validate:g}=e,{t:b}=(0,f.d)(),v=iP(),{config:y}=(0,d.c)(),x=(0,c.useCallback)((e,t)=>{let r=m?m.split("."):[];return"function"==typeof g?g(e,{...t,required:u}):rI(e,{name:"password",type:"text",blockData:{},data:{},event:"onChange",path:r,preferences:{fields:{}},req:{payload:{config:y},t:b},required:!0,siblingData:{}})},[g,y,b,u,m]),{customComponents:{AfterInput:w,BeforeInput:C,Description:j,Error:S,Label:$}={},disabled:_,setValue:k,showError:E,value:N}=oz({path:m,validate:x}),P=oW({fieldLocalized:!1,fieldRTL:i,locale:v,localizationConfig:y.localization||void 0}),T=(0,c.useMemo)(()=>oq(r),[r]);return(0,h.jsx)(gJ,{AfterInput:w,autoComplete:t,BeforeInput:C,className:n,Description:j,Error:S,inputRef:p,Label:$,label:o,localized:s,onChange:e=>{k(e.target.value)},path:m,placeholder:l,readOnly:_||a,required:u,rtl:P,showError:E,style:T,value:N||""})}),g0={array:gY,blocks:sE,checkbox:oZ,code:sD,collapsible:sL,confirmPassword:gQ,date:d6,email:d5,group:fn,hidden:fa,join:py,json:px,number:pw,password:gZ,point:pj,radio:pk,relationship:p6,richText:p5,row:p4,select:p9,tabs:hy,text:hk,textarea:hN,ui:hP,upload:gU},g1={...g0,Description:aQ,Error:aX,Label:iR,RowLabel:nk},g2=new Map([]),g3={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"},g6=e=>(g3[e.toLowerCase()]||e).trim().toLowerCase().replace("key",""),g5=(e,t)=>{let r=(0,v.c)(9),{cmdCtrlKey:n,editDepth:a,keyCodes:l}=e,{modalState:i}=lc(),o;r[0]!==n||r[1]!==a||r[2]!==t||r[3]!==l||r[4]!==i?(o=e=>{let r,o=e.detail?.key?e.detail:e;if(void 0===o.key)return;g2.forEach(g4),o.code&&("meta"===(r=g6(o.code))&&g2.forEach((e,t)=>"meta"!==t&&g2.delete(t)),g2.set(r,Date.now()));let s=window.navigator.userAgent.includes("Mac OS X");if(rV(new Set([...g2.keys()].filter(g8)),new Set(l))&&(!n||s&&g2.has("meta")||!s&&o.ctrlKey)){if((Object.keys(i).filter(e=>i[e]?.isOpen)?.length+1||1)!==a)return;t(o)}},r[0]=n,r[1]=a,r[2]=t,r[3]=l,r[4]=i,r[5]=o):o=r[5];let s=o,u,d;r[6]!==s?(u=()=>(document.addEventListener("keydown",s,!1),document.addEventListener("bypassKeyDown",s,!1),document.addEventListener("keyup",g7,!1),()=>{document.removeEventListener("keydown",s),document.removeEventListener("bypassKeyDown",s),document.removeEventListener("keyup",g7)}),d=[s,g7],r[6]=s,r[7]=u,r[8]=d):(u=r[7],d=r[8]),(0,c.useEffect)(u,d)};function g4(e,t){Date.now()-e>3e3&&g2.delete(t)}function g8(e){return!["alt","ctrl","meta","shift"].includes(e)}function g7(e){let t;e.code&&("meta"===(t=g6(e.code))&&g2.clear(),g2.delete(t))}var g9=e=>{let t,r=(0,v.c)(5),[n,a]=(0,c.useState)(),l,i;return r[0]!==e?(l=()=>{let t;return e&&(t=new ResizeObserver(e=>
48{e.forEach(e=>{let{contentBoxSize:t,contentRect:r}=e,n=0,l=0;if(t){let e=Array.isArray(t)?t[0]:t;if(e){let{blockSize:t,inlineSize:r}=e;n=r,l=t}}else if(r){let{height:e,width:t}=r;n=t,l=e}a({height:l,width:n})})})).observe(e),()=>{t&&t.unobserve(e)}},i=[e],r[0]=e,r[1]=l,r[2]=i):(l=r[1],i=r[2]),(0,c.useEffect)(l,i),r[3]!==n?(t={size:n},r[3]=n,r[4]=t):t=r[4],t},be=e=>{let t=(0,v.c)(4),{admin:r,fields:n}=e,{useAsTitle:a}=r,{i18n:l}=(0,f.d)(),i;return t[0]!==n||t[1]!==l||t[2]!==a?(i=re(n,{i18n:l,moveSubFieldsToTop:!0})?.find(e=>"name"in e&&e.name===a),t[0]=n,t[1]=l,t[2]=a,t[3]=i):i=t[3],i},bt=({className:e})=>(0,h.jsx)("svg",{className:"icon icon--sort",fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,h.jsx)("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"})}),br=({className:e})=>(0,h.jsx)("svg",{className:"icon icon--sort",fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,h.jsx)("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"})}),bn="sort-header",ba="sort-row",bl=({cellMap:e,columns:t,dragAttributes:r={},dragListeners:n={},rowId:a,...l})=>(0,h.jsx)("tr",{...l,children:t.map((t,l)=>{let{accessor:i}=t,o=t.renderedCells[e[a]];return"_dragHandle"===i?(0,h.jsx)("td",{className:`cell-${i}`,children:(0,h.jsx)("div",{...r,...n,children:o})},l):(0,h.jsx)("td",{className:`cell-${i}`,children:o},l)})}),bi=({children:e,className:t,rowId:r})=>typeof r>"u"?null:(0,h.jsx)("div",{className:t,children:(0,h.jsx)("table",{cellPadding:0,cellSpacing:0,children:(0,h.jsx)("tbody",{children:e})})}),bo="table",bs=[{label:"equals",value:"equals"},{label:"isNotEqualTo",value:"not_equals"}],bc={label:"exists",value:"exists"},bu=[...bs,{label:"isIn",value:"in"},{label:"isNotIn",value:"not_in"},bc],bd=[...bu,{label:"isGreaterThan",value:"greater_than"},{label:"isLessThan",value:"less_than"},{label:"isLessThanOrEqualTo",value:"less_than_equal"},{label:"isGreaterThanOrEqualTo",value:"greater_than_equal"}],bf=[...bs,{label:"near",value:"near"}],bp={label:"within",value:"within"},bh={label:"intersects",value:"intersects"},bm={label:"isLike",value:"like"},bg={label:"isNotLike",value:"not_like"},bb={label:"contains",value:"contains"},bv={checkbox:{component:"Text",operators:[...bs,bc]},code:{component:"Text",operators:[...bu,bm,bg,bb]},date:{component:"Date",operators:[...bd,bc]},email:{component:"Text",operators:[...bu,bb]},json:{component:"Text",operators:[...bu,bm,bb,bg,bp,bh]},number:{component:"Number",operators:[...bd,bc]},point:{component:"Point",operators:[...bf,bc,bp,bh]},radio:{component:"Select",operators:[...bu]},relationship:{component:"Relationship",operators:[...bu]},richText:{component:"Text",operators:[...bu,bm,bg,bb]},select:{component:"Select",operators:[...bu]},text:{component:"Text",operators:[...bu,bm,bg,bb]},textarea:{component:"Text",operators:[...bu,bm,bg,bb]},upload:{component:"Relationship",operators:[...bu]}},by=({field:e,operator:t})=>{let r=[];return r="relationship"===e.type&&Array.isArray(e.relationTo)?[...bs,bc]:[...bv[e.type].operators],{validOperator:t&&r.find(({value:e})=>e===t)?t:r[0].value,validOperators:r}},bx=({fieldPermissions:e,fields:t,i18n:r,labelPrefix:n,pathPrefix:a})=>t.reduce((t,l)=>{let i=a;if($(l)&&!S(l)||"virtual"in l&&!0===l.virtual)return t;let o=!1;if("virtual"in l&&"string"==typeof l.virtual&&(i=i?i+"."+l.virtual:l.virtual,_(l)&&(o=!0)),"tabs"===l.type&&"tabs"in l)return l.tabs.forEach(a=>{if("boolean"!=typeof a.label){let l=m(a.label,r),o=k(a)&&a.name?i?i+"."+a.name:a.name:i;"string"==typeof l&&t.push(...bx({fieldPermissions:"boolean"==typeof e?e:k(a)&&a.name?e?.[a.name]?.fields||e?.[a.name]:e,fields:a.fields,i18n:r,labelPrefix:n?n+" > "+l:l,pathPrefix:o}))}}),t;if("row"===l.type&&"fields"in l)return t.push(...bx({fieldPermissions:e,fields:l.fields,i18n:r,labelPrefix:n,pathPrefix:i})),t;if("collapsible"===l.type&&"fields"in l){let a=m(l.label||"",r);return t.push(...bx({fieldPermissions:e,fields:l.fields,i18n:r,labelPrefix:n?n+" > "+a:a,pathPrefix:i})),t}if("group"===l.type&&"fields"in l){let a=m(l.label||"",r),o=n?a?n+" > "+a:n:a;if(_(l)){let n=l.name?i?i+"."+l.name:l.name:i;t.push(...bx({fieldPermissions:"boolean"==typeof e?e:e?.[l.name]?.fields||e?.[l.name],fields:l.fields,i18n:r,labelPrefix:o,pathPrefix:n}))}else t.push(...bx({fieldPermissions:e,fields:l.fields,i18n:r,labelPrefix:o,pathPrefix:i}));return t}if("array"===l.type&&"fields"in l){let a=m(l.label||"",r),o=l.name?i?i+"."+l.name:l.name:i;return t.push(...bx({fieldPermissions:"boolean"==typeof e?e:e?.[l.name]?.fields||e?.[l.name],fields:l.fields,i18n:r,labelPrefix:n?a?n+" > "+a:n:a,pathPrefix:o})),t}if("object"==typeof bv[l.type]&&(S(l)||!0===e||e?.[l.name]===!0||e?.[l.name]?.read===!0)){let e=new Set,{validOperators:a}=by({field:l}),s=a.reduce((t,n)=>{if(!e.has(n.value)){e.add(n.value);let a=`operators:${n.label}`;
48t.push({...n,label:r.t(a)})}return t},[]),c=m(l.label||"",r),u={label:n?hG({field:l,prefix:n}):c,plainTextLabel:`${n?n+" > ":""}${c}`,value:o?i:i?hW(i,l):l.name,...bv[l.type],field:l,operators:s};return t.push(u),t}return t},[]),bw=({fieldPermissions:e,fields:t})=>(t??[]).reduce((t,r)=>{if("ui"!==r.type&&$(r)&&!S(r)||r?.admin?.disableListColumn===!0)return t;if("tabs"===r.type&&"tabs"in r){let n={...r,tabs:r.tabs.map(t=>({...t,fields:bw({fieldPermissions:"boolean"==typeof e?e:"name"in t&&t.name?e[t.name]?.fields||e[t.name]:e,fields:t.fields})}))};return t.push(n),t}if("fields"in r&&Array.isArray(r.fields)){let n={...r,fields:bw({fieldPermissions:"boolean"==typeof e?e:"name"in r&&r.name?e?.[r.name]?.fields||e?.[r.name]:e,fields:r.fields})};return t.push(n),t}if(!0===e)return t.push(r),t;if(_(r)){let n=e?.[r.name];return(S(r)||!0===n||n?.read===!0)&&t.push(r),t}return t.push(r),t},[]),bC=(e,t)=>e?.reduce((e,r)=>_(r)&&r.name===t?e:!_(r)&&"fields"in r?[...e,...bC(r.fields,t)]:"tabs"===r.type&&"tabs"in r?[...e,...r.tabs.reduce((e,r)=>[...e,..."name"in r?[r.name]:bC(r.fields,t)],[])]:[...e,r.name],[]),bj=e=>{let{disabled:t,field:r,onChange:n,value:a}=e,{admin:l}=r,{date:i}=l||{},{i18n:o,t:s}=(0,f.d)();return(0,h.jsx)("div",{className:"condition-value-date",children:(0,h.jsx)(sI,{...i,onChange:n,placeholder:m(l.placeholder,o)||s("general:enterAValue"),readOnly:t,value:a})})},bS=e=>{let t,r=(0,v.c)(20),{disabled:n,field:a,onChange:l,operator:i,value:o}=e,{admin:s,hasMany:u}=a,{i18n:d,t:p}=(0,f.d)(),g;r[0]!==u||r[1]!==i?(g=["in","not_in"].includes(i)||u,r[0]=u,r[1]=i,r[2]=g):g=r[2];let b=g,y;r[3]===Symbol.for("react.memo_cache_sentinel")?(y=[],r[3]=y):y=r[3];let[x,w]=c.default.useState(y),C;r[4]!==b||r[5]!==l?(C=e=>{let t;e?b&&(t=Array.isArray(e)?e.map(b$):[Number(e.value?.value||e.value)]):t=[],l(t)},r[4]=b,r[5]=l,r[6]=C):C=r[6];let j=C,S,$;if(r[7]!==o?(S=()=>{Array.isArray(o)?w(o.map(b_)):w([])},$=[o],r[7]=o,r[8]=S,r[9]=$):(S=r[8],$=r[9]),c.default.useEffect(S,$),r[10]!==s?.placeholder||r[11]!==n||r[12]!==d||r[13]!==b||r[14]!==l||r[15]!==j||r[16]!==p||r[17]!==o||r[18]!==x){let e=m(s?.placeholder,d)||p("general:enterAValue");t=b?(0,h.jsx)(d0,{disabled:n,isClearable:!0,isCreatable:!0,isMulti:b,isSortable:!0,numberOnly:!0,onChange:j,options:[],placeholder:e,value:x||[]}):(0,h.jsx)("input",{className:"condition-value-number",disabled:n,onChange:e=>l(e.target.value),placeholder:e,type:"number",value:o}),r[10]=s?.placeholder,r[11]=n,r[12]=d,r[13]=b,r[14]=l,r[15]=j,r[16]=p,r[17]=o,r[18]=x,r[19]=t}else t=r[19];return t};function b$(e){return Number(e.value?.value||e.value)}function b_(e,t){return{id:`${e}${t}`,label:`${e}`,value:{toString:()=>`${e}${t}`,value:e?.value||e}}}var bk=e=>e.reduce((e,t)=>t.options?[...e,...bk(t.options)]:[...e,t.id],[]),bE=(e,t)=>{switch(t.type){case"ADD":{let{collection:r,data:n,hasMultipleRelations:a,i18n:l,relation:i}=t,o=r.admin.useAsTitle||"id",s=bk(e);if(!a)return[...e,...n.docs.reduce((e,t)=>-1===s.indexOf(t.id)?(s.push(t.id),[...e,{label:t[o],value:t.id}]):e,[])];let c=[...e],u=c.find(e=>e.label===m(r.labels.plural,l)),d=n.docs.reduce((e,t)=>-1===s.indexOf(t.id)?(s.push(t.id),[...e,{label:t[o],relationTo:i,value:t.id}]):e,[]);return u?u.options=[...u.options,...d]:c.push({label:m(r.labels.plural,l),options:d,value:void 0}),c}case"CLEAR":return t.required?[]:[{label:t.i18n.t("general:none"),value:"null"}];default:return e}},bN="condition-value-relationship",bP=e=>{let{disabled:t,field:{admin:r={},hasMany:n,relationTo:a},filterOptions:l,onChange:i,operator:o,value:s}=e,u="placeholder"in r?r?.placeholder:void 0,p=r?.isSortable,m=n||["in","not_in"].includes(o),{config:{routes:{api:g}},getEntityConfig:b}=(0,d.c)(),v=Array.isArray(a),[y,x]=(0,c.useReducer)(bE,[]),[w,C]=(0,c.useState)(""),j=fK(w,300),[S,$]=(0,c.useState)(""),[_,k]=(0,c.useState)(!1),{i18n:E,t:N}=(0,f.d)(),P=iP(),T=v?a:[a],D=c.default.useRef(new Map(T.map(e=>[e,{hasLoadedAll:!1,nextPage:1}]))),R=(0,c.useCallback)((e,t)=>{x({type:"ADD",collection:b({collectionSlug:t}),data:e,hasMultipleRelations:v,i18n:E,relation:t})},[v,E,b]),A=ae(async({abortController:e,relationSlug:t})=>{let r=D.current.get(t);if(t&&!r.hasLoadedAll){let n=b({collectionSlug:t})?.admin?.useAsTitle||"id",a={depth:0,limit:10,locale:P.code,page:r.nextPage,select:{[n]:!0},where:{and:[]}};l&&l?.[t]&&a.where.and.push(l[t]),j&&a.where.and.push({[n]:{like:j}});try{let r=await fetch(tR({apiRoute:g,path:`/${t}${t6(a,{addQueryPrefix:!0})}`}),{credentials:"include",headers:{"Accept-Language":E.language},signal:e.signal});if(r.ok){let e=await r.json();e.docs.length>0&&(R(e,t),e.nextPage?D.current.set(t,{hasLoadedAll:!1,nextPage:e.nextPage}):D.current.set(t,{hasLoadedAll:!0,nextPage:null}))}else $(N("error:unspecific"))}catch(t){e.signal.aborted||console.error(t)}}k(!0)}),O=c.default.useCallback(()=>{let e=D.current.entries().next().value;e[0]&&!e[1].hasLoadedAll&&A({abortController:new AbortController,relationSlug:e[0]})},[]),L=(0,c.useCallback)(()=>
48{if(s){if(m)return Array.isArray(s)?s.map(e=>{if(v){let t;return y.forEach(r=>{r.options&&r.options.some(r=>r?.value==e.value&&(t=r,!0))}),t}return y.find(t=>t.value==e)}):void 0;if(v){let e;return y.forEach(t=>{t?.options&&t.options.some(t=>t?.value==s.value&&(e=t,!0))}),e}return y.find(e=>e.value==s)}},[m,v,s,y]),M=(0,c.useCallback)(e=>{e!==w&&(x({type:"CLEAR",i18n:E,required:!1}),D.current=new Map((Array.isArray(a)?a:[a]).map(e=>[e,{hasLoadedAll:!1,nextPage:1}])),C(e))},[E,a,w]),I=(0,c.useCallback)(async(e,t)=>{if(!S&&"null"!==e&&e&&t){let r=await fetch(tR({apiRoute:g,path:`/${t}/${e}?depth=0`}),{credentials:"include",headers:{"Accept-Language":E.language}});r.ok?R({docs:[await r.json()]},t):console.error(N("error:loadingDocument",{id:e}))}},[E,R,g,S,N]);(0,c.useEffect)(()=>{let e=Array.isArray(a)?a:[a];D.current=new Map(e.map(e=>[e,{hasLoadedAll:!1,nextPage:1}])),x({type:"CLEAR",i18n:E,required:!1}),k(!1);let t=[];return e.forEach(e=>{let r=new AbortController;A({abortController:r,relationSlug:e}),t.push(r)}),()=>{t.forEach(e=>{if(e.signal)try{e.abort()}catch{}})}},[E,a,j,l]),(0,c.useEffect)(()=>{s&&_&&(m?(L()||[]).forEach((e,t)=>{e||(v?I(s[t].value,s[t].relationTo):I(s[t],a))}):L()||(v?I(s.value,s.relationTo):I(s,a)))},[I,L,m,v,a,s,_]);let F=["field-type",bN,S&&"error-loading"].filter(Boolean).join(" "),B=L()||s;return(0,h.jsx)("div",{className:F,children:S?(0,h.jsx)("div",{className:`${bN}__error-loading`,children:S}):(0,h.jsx)(d0,{disabled:t,isMulti:m,isSortable:p,onChange:e=>{e?m&&Array.isArray(e)?i(e?e.map(e=>v?{relationTo:e?.relationTo,value:e?.value}:e?.value):null):v&&!Array.isArray(e)?i({relationTo:e?.relationTo,value:e?.value}):Array.isArray(e)||i(e?.value):i(null)},onInputChange:M,onMenuScrollToBottom:O,options:y,placeholder:u,value:B})})},bT=e=>{let t,r,n,a,l=(0,v.c)(21),{disabled:i,field:o,isClearable:s,onChange:u,operator:d,options:p,value:g}=e,{admin:b}=o,{placeholder:y}=b,{i18n:x}=(0,f.d)(),w;l[0]!==p?(w=d1(p),l[0]=p,l[1]=w):w=l[1];let[C,j]=c.default.useState(w),S;l[2]===Symbol.for("react.memo_cache_sentinel")?(S=["in","not_in"],l[2]=S):S=l[2];let $=S.includes(d),_;if($&&Array.isArray(g)){let e;l[3]!==x||l[4]!==C?(e=e=>{let t=C.find(t=>t.value===e);return{label:t?m(t.label,x):e,value:t?.value??e}},l[3]=x,l[4]=C,l[5]=e):e=l[5],_=g.map(e)}else if(g){let e;l[6]!==g?(e=e=>e.value===g,l[6]=g,l[7]=e):e=l[7];let t=C.find(e);_={label:t?m(t.label,x):g,value:t?.value??g}}l[8]!==$||l[9]!==u?(t=e=>{u(e?$?Array.isArray(e)?e.map(bD):[]:e.value:null)},l[8]=$,l[9]=u,l[10]=t):t=l[10];let k=t,E,N;return l[11]!==p?(E=()=>{j(d1(p))},N=[p],l[11]=p,l[12]=E,l[13]=N):(E=l[12],N=l[13]),c.default.useEffect(E,N),l[14]!==$||l[15]!==u||l[16]!==g?(r=()=>{!$&&Array.isArray(g)&&u(g[0])},n=[$,u,g],l[14]=$,l[15]=u,l[16]=g,l[17]=r,l[18]=n):(r=l[17],n=l[18]),c.default.useEffect(r,n),l[19]!==x?(a=e=>({...e,label:m(e.label,x)}),l[19]=x,l[20]=a):a=l[20],(0,h.jsx)(d0,{disabled:i,isClearable:s,isMulti:$,onChange:k,options:C.map(a),placeholder:y,value:_})};function bD(e){return e.value}var bR=e=>{let t,r=(0,v.c)(18),{disabled:n,field:a,onChange:l,operator:i,value:o}=e,{t:s}=(0,f.d)(),u=a?.hasMany??!1,d;r[0]!==u||r[1]!==i?(d=["in","not_in"].includes(i)||u,r[0]=u,r[1]=i,r[2]=d):d=r[2];let p=d,m;r[3]===Symbol.for("react.memo_cache_sentinel")?(m=[],r[3]=m):m=r[3];let[g,b]=c.default.useState(m),y;r[4]!==p||r[5]!==l?(y=e=>{let t;e?p&&(t=Array.isArray(e)?e.map(bA):[e.value?.value||e.value]):t=[],l(t)},r[4]=p,r[5]=l,r[6]=y):y=r[6];let x=y,w,C;return r[7]!==o?(w=()=>{Array.isArray(o)?b(o.map(bO)):b([])},C=[o],r[7]=o,r[8]=w,r[9]=C):(w=r[8],C=r[9]),c.default.useEffect(w,C),r[10]!==n||r[11]!==p||r[12]!==l||r[13]!==x||r[14]!==s||r[15]!==o||r[16]!==g?(t=p?(0,h.jsx)(d0,{disabled:n,isClearable:!0,isCreatable:!0,isMulti:p,isSortable:!0,onChange:x,options:[],placeholder:s("general:enterAValue"),value:g||[]}):(0,h.jsx)("input",{className:"condition-value-text",disabled:n,onChange:e=>l(e.target.value),placeholder:s("general:enterAValue"),type:"text",value:o||""}),r[10]=n,r[11]=p,r[12]=l,r[13]=x,r[14]=s,r[15]=o,r[16]=g,r[17]=t):t=r[17],t};function bA(e){return e.value?.value||e.value}function bO(e,t){return{id:`${e}${t}`,label:`${e}`,value:{toString:()=>`${e}${t}`,value:e?.value||e}}}var bL=({booleanSelect:e,disabled:t,filterOptions:r,internalField:n,onChange:a,operator:l,options:i,value:o})=>{if(e||["radio","select"].includes(n?.field?.type))return(0,h.jsx)(bT,{disabled:t,field:n.field,isClearable:!e,onChange:a,operator:l,options:i,value:o});switch(n?.field?.type){case"date":return(0,h.jsx)(bj,{disabled:t,field:n.field,onChange:a,operator:l,value:o});case"number":return(0,h.jsx)(bS,{disabled:t,field:n.field,onChange:a,operator:l,value:o});case"relationship":case"upload":return(0,h.jsx)(bP,{disabled:t,field:n.field,filterOptions:r??{},onChange:a,operator:l,value:o});default:return(0,h.jsx)(bR,{disabled:t,field:n?.field,onChange:a,operator:l,value:o})}},bM="condition",bI=e=>{let{addCondition:t,andIndex:r,fieldPath:n,filterOptions:a,operator:l,orIndex:i,reducedFields:o,removeCondition:s,RenderedFilter:u,updateCondition:d,value:p}=e,{t:m}=(0,f.d)(),g=o.find(e=>e.value===n),[b,v]=(0,c.useState)(p),y=fK(b,300),x=["exists"].includes(l)||g?.field?.type==="checkbox",w=[];x?w=[{label:m("general:true"),value:"true"},{label:m("general:false"),value:"false"}]:g?.field&&"options"in g.field&&(w=g.field.options);let C=ae(async e=>{l&&await d({type:"value",andIndex:r,field:g,operator:l,orIndex:i,value:null===e||""===e?void 0:e})});(0,c.useEffect)(()=>{C(y)},[y]);let j=!g?.value&&"number"!=typeof g?.value||g?.field?.admin?.disableListFilter,S=(0,c.useCallback)(async e=>{v(void 0),await d({type:"field",andIndex:r,field:o.find(t=>t.value===e.value),operator:l,orIndex:i,value:void 0})},[r,l,i,o,d]),$=(0,c.useCallback)(async e=>{let t,n={all:"any",contains:"string",equals:"any",exists:"boolean",greater_than:"date"===(t=g.field.type)?"object":"string",greater_than_equal:"date"===t?"object":"string",in:"any",intersects:"any",less_than:"date"===t?"object":"string",less_than_equal:"date"===t?"object":"string",like:"string",near:"any",not_equals:"any",not_in:"any",not_like:"string",within:"any"}
48[e.value]||"any",a="any"===n||typeof p===n||"boolean"===n&&("true"===p||"false"===p);a||v(void 0),await d({type:"operator",andIndex:r,field:g,operator:e.value,orIndex:i,value:a?p:void 0})},[r,g,i,d,p]);return(0,h.jsx)("div",{className:bM,children:(0,h.jsxs)("div",{className:`${bM}__wrap`,children:[(0,h.jsxs)("div",{className:`${bM}__inputs`,children:[(0,h.jsx)("div",{className:`${bM}__field`,children:(0,h.jsx)(d0,{disabled:j,filterOption:(e,t)=>(e?.data?.plainTextLabel||e.label).toLowerCase().includes(t.toLowerCase()),isClearable:!1,onChange:S,options:o.filter(e=>!e.field.admin.disableListFilter),value:g||{value:g?.value}})}),(0,h.jsx)("div",{className:`${bM}__operator`,children:(0,h.jsx)(d0,{disabled:j,isClearable:!1,onChange:$,options:g?.operators,value:g?.operators.find(e=>l===e.value)||null})}),(0,h.jsx)("div",{className:`${bM}__value`,children:u||(0,h.jsx)(bL,{booleanSelect:x,disabled:!l||!g||g?.field?.admin?.disableListFilter,filterOptions:a,internalField:g,onChange:v,operator:l,options:w,value:b??""})})]}),(0,h.jsxs)("div",{className:`${bM}__actions`,children:[(0,h.jsx)(au,{buttonStyle:"icon-label",className:`${bM}__actions-remove`,icon:"x",iconStyle:"with-border",onClick:()=>s({andIndex:r,orIndex:i}),round:!0}),(0,h.jsx)(au,{buttonStyle:"icon-label",className:`${bM}__actions-add`,icon:"plus",iconStyle:"with-border",onClick:()=>t({andIndex:r+1,field:o.find(e=>!e.field.admin?.disableListFilter),orIndex:i,relation:"and"}),round:!0})]})]})})},bF="where-builder",bB=e=>{let{collectionPluralLabel:t,collectionSlug:r,fields:n,onChange:a,renderedFilters:l,resolvedFilterOptions:i,value:o}=e,{i18n:s,t:u}=(0,f.d)(),{permissions:p}=iS(),{getEntityConfig:g}=(0,d.c)(),b=fd(),v="function"==typeof a,y=(0,c.useMemo)(()=>v?g({collectionSlug:r}):null,[v,r,g]),x=v?y?.labels?.plural??r:t??r,w=(v?y?.fields:n)??[],C=p?.collections?.[r]?.fields,j=(0,c.useMemo)(()=>bx({fieldPermissions:C,fields:w,i18n:s}),[C,w,s]),S=(0,c.useMemo)(()=>{let e=v?o:b.query?.where;if(e){if(rG(e))return e.or??[];let t=e?e.or&&!e.and?{or:e.or.map(e=>e.and?e:{and:[e]})}:e.and&&!e.or?{or:[{and:e.and}]}:e.or||e.and?e:{or:[{and:[e]}]}:{};if(rG(t))return t.or??[];v||console.warn(`Invalid where query in URL: ${JSON.stringify(e)}`)}return[]},[v,o,b.query?.where]),$=v?e=>{a?.(e)}:b.handleWhereChange,_=c.default.useCallback(async({andIndex:e,field:t,orIndex:r,relation:n})=>{let a=[...S],l=bv[t.field.type].operators[0].value;"and"===n?a[r].and.splice(e,0,{[String(t.value)]:{[l]:void 0}}):a.push({and:[{[String(t.value)]:{[l]:void 0}}]}),await $({or:a})},[S,$]),k=c.default.useCallback(async({andIndex:e,field:t,operator:r,orIndex:n,value:a})=>{let l=S[n].and[e];if("object"==typeof l&&t.value){let{validOperator:i}=by({field:t.field,operator:r}),o=l[String(t.value)]?.[i];if("u">typeof o&&o===a)return;let s={[String(t.value)]:{[i]:a}};if(t8(l,s))return;let c=[...S];c[n].and[e]=s,await $({or:c})}},[S,$]),E=c.default.useCallback(async({andIndex:e,orIndex:t})=>{let r=[...S];r[t].and.splice(e,1),0===r[t].and.length&&r.splice(t,1),await $({or:r})},[S,$]);return(0,h.jsxs)("div",{className:bF,children:[S.length>0&&(0,h.jsxs)(c.default.Fragment,{children:[(0,h.jsx)("p",{className:`${bF}__label`,children:u("general:filterWhere",{label:m(x,s)})}),(0,h.jsx)("ul",{className:`${bF}__or-filters`,children:S.map((e,t)=>{let r=`${t}_${Array.isArray(e?.and)?e.and.length:""}`;return(0,h.jsxs)("li",{children:[0!==t&&(0,h.jsx)("div",{className:`${bF}__label`,children:u("general:or")}),(0,h.jsx)("ul",{className:`${bF}__and-filters`,children:Array.isArray(e?.and)&&e.and.map((e,r)=>{let n=S[t].and[r],a=Object.keys(n)[0],o=Object.keys(n?.[a]||{})?.[0]||void 0,s=n?.[a]?.[o]||void 0;return(0,h.jsxs)("li",{children:[0!==r&&(0,h.jsx)("div",{className:`${bF}__label`,children:u("general:and")}),(0,h.jsx)(bI,{addCondition:_,andIndex:r,fieldPath:a,filterOptions:i?.get(a),operator:o,orIndex:t,reducedFields:j,removeCondition:E,RenderedFilter:l?.get(a),updateCondition:k,value:s})]},r)})})]},r)})}),(0,h.jsx)(au,{buttonStyle:"icon-label",className:`${bF}__add-or`,icon:"plus",iconPosition:"left",iconStyle:"with-border",onClick:async()=>{await _({andIndex:0,field:j.find(e=>!e.field.admin?.disableListFilter),orIndex:S.length,relation:"or"})},children:u("general:or")})]}),0===S.length&&(0,h.jsxs)("div",{className:`${bF}__no-filters`,children:[(0,h.jsx)("div",{className:`${bF}__label`,children:u("general:noFiltersSet")}),(0,h.jsx)(au,{buttonStyle:"icon-label",className:`${bF}__add-first-filter`,icon:"plus",iconPosition:"left",iconStyle:"with-border",onClick:async()=>{j.length>0&&await _({andIndex:0,field:j.find(e=>!e.field.admin?.disableListFilter),orIndex:S.length,relation:"or"})},children:u("general:addFilter")})]})]})},bz="group-by-builder",bU=["text","textarea","number","select","relationship","date","checkbox","radio","email","number","upload"],bV=({collectionSlug:e,fields:t,onChange:r,value:n})=>{let{i18n:a,t:l}=(0,f.d)(),{permissions:i}=iS(),o=fd(),s="function"==typeof r,u=s?n:o.query?.groupBy,d=u?.replace(/^-/,""),p=i?.collections?.[e]?.fields,m=(0,c.useMemo)(()=>bx({fieldPermissions:p,fields:t,i18n:a}),[t,p,a]),g=m.find(e=>e.value===d),b=(0,c.useMemo)(()=>s?e=>{let t=null===e?void 0:e.value,n=t?u?.startsWith("-")?`-${t}`:t:"";r?.(n)}:e=>{(async()=>
48{if("function"!=typeof o.refineListData)return;let t=null===e?void 0:e.value;null===e?await o.refineListData({groupBy:"",page:1}):await o.refineListData({groupBy:t?o.query?.groupBy?.startsWith("-")?`-${t}`:t:void 0,page:1})})()},[s,u,o,r]),v=(0,c.useMemo)(()=>s?()=>r?.(""):()=>{(async()=>"function"==typeof o.refineListData&&await o.refineListData({groupBy:""}))()},[s,o,r]),y=(0,c.useMemo)(()=>s?({value:e})=>{d&&r?.("asc"===e?d:`-${d}`)}:({value:e})=>{(async()=>!d||"function"!=typeof o.refineListData||await o.refineListData({groupBy:"asc"===e?d:`-${d}`,page:1}))()},[d,s,o,r]),x=u&&"string"==typeof u&&u.startsWith("-")?"desc":"asc";return(0,h.jsxs)("div",{className:bz,children:[(0,h.jsxs)("div",{className:`${bz}__header`,children:[(0,h.jsx)("p",{children:l("general:groupByLabel",{label:""})}),u&&(0,h.jsx)("button",{className:`${bz}__clear-button`,id:"group-by--reset",onClick:()=>{v()},type:"button",children:l("general:clear")})]}),(0,h.jsxs)("div",{className:`${bz}__inputs`,children:[(0,h.jsx)(d0,{filterOption:(e,t)=>(e?.data?.plainTextLabel||e.label).toLowerCase().includes(t.toLowerCase()),id:"group-by--field-select",isClearable:!0,isMulti:!1,onChange:b,options:m.filter(e=>!e.field.admin?.disableGroupBy&&"id"!==e.value&&bU.includes(e.field.type)),value:{label:g?.label||l("general:selectValue"),value:d||""}}),(0,h.jsx)(p8,{id:"group-by--sort",isClearable:!1,name:"direction",onChange:y,options:[{label:l("general:ascending"),value:"asc"},{label:l("general:descending"),value:"desc"}],path:"direction",readOnly:!d,value:x})]})]})},bH="leave-without-saving",bq=e=>{let t,r=(0,v.c)(17),{disablePreventLeave:n,onConfirm:a,onPrevent:l}=e,{closeModal:i,openModal:o}=lc(),s=nw(),{isValid:u}=nm(),{user:d}=iS(),[f,p]=c.default.useState(!1),m=!(void 0!==n&&n)&&!!((s||!u)&&d),g;r[0]!==l||r[1]!==o?(g=()=>{let e=document.activeElement?.href||null;l&&l(e),o(bH)},r[0]=l,r[1]=o,r[2]=g):g=r[2];let y=g,x;r[3]!==i?(x=()=>{i(bH)},r[3]=i,r[4]=x):x=r[4];let w=x,C;r[5]!==w||r[6]!==y||r[7]!==f||r[8]!==m?(C={hasAccepted:f,onAccept:w,onPrevent:y,prevent:m},r[5]=w,r[6]=y,r[7]=f,r[8]=m,r[9]=C):C=r[9],(({hasAccepted:e=!1,message:t="Are you sure want to leave this page?",onAccept:r,onPrevent:n,prevent:a=!0})=>{let l,i,o,s,u,d;l=(0,v.c)(7),i=void 0===a||a,l[0]!==i||l[1]!==t?(o=e=>{if("function"!=typeof i||i())return e.preventDefault(),t&&(e.returnValue=t),t},l[0]=i,l[1]=t,l[2]=o):o=l[2],s=o,l[3]!==i||l[4]!==s?(u=()=>{if(i)return function(e,...t){e&&e.addEventListener&&e.addEventListener(...t)}(window,"beforeunload",s),()=>(function(e,...t){e&&e.removeEventListener&&e.removeEventListener(...t)})(window,"beforeunload",s)},d=[i,s],l[3]=i,l[4]=s,l[5]=u,l[6]=d):(u=l[5],d=l[6]),(0,c.useEffect)(u,d);let{startRouteTransition:f}=nK(),p=(0,b.useRouter)(),h=(0,c.useRef)("");(0,c.useEffect)(()=>{function e(e){try{let r=e.target,l=function(e){for(;e&&"a"!==e.tagName.toLowerCase();)e=e.parentElement;return e}(r);if(l){let r=window.location.href,i=l.href,o=function(e,t){try{let r=new URL(e),n=new URL(t);if(r.hostname===n.hostname&&r.pathname===n.pathname&&r.search===n.search){let e=r.hash,t=n.hash;return e!==t&&r.href.replace(e,"")===n.href.replace(t,"")}}catch(e){console.log("Unexpected exception thrown in LeaveWithoutSaving:isAnchorOfCurrentUrl",e)}return!1}(r,i),s=""!==l.download,c="_blank"===l.target||e.metaKey||e.ctrlKey;!(i===r||o||s||c)&&a&&(n||!window.confirm(t))&&(h.current=i,e.preventDefault(),e.stopPropagation(),"function"==typeof n&&n())}}catch(e){console.log("Unexpected exception thrown in LeaveWithoutSaving:usePreventLeave",e)}}return a&&document.addEventListener("click",e,!0),()=>{document.removeEventListener("click",e,!0)}},[n,a,t]),(0,c.useEffect)(()=>{e&&h.current&&(r&&r(),f(()=>p.push(h.current)))},[e,r,p,f])})(C),r[10]!==i?(t=()=>{i(bH)},r[10]=i,r[11]=t):t=r[11];let j=t,S;r[12]!==a?(S=async()=>{if(a)try{await a()}catch(e){console.error("Error in LeaveWithoutSaving onConfirm:",e)}p(!0)},r[12]=a,r[13]=S):S=r[13];let $=S,_;return r[14]!==$||r[15]!==j?(_=(0,h.jsx)(bK,{modalSlug:bH,onCancel:j,onConfirm:$}),r[14]=$,r[15]=j,r[16]=_):_=r[16],_},bK=e=>{let t=(0,v.c)(5),{modalSlug:r,onCancel:n,onConfirm:a}=e,{t:l}=(0,f.d)(),i;
48return t[0]!==r||t[1]!==n||t[2]!==a||t[3]!==l?(i=(0,h.jsx)(iv,{body:l("general:changesNotSaved"),cancelLabel:l("general:stayOnThisPage"),confirmLabel:l("general:leaveAnyway"),heading:l("general:leaveWithoutSaving"),modalSlug:r,onCancel:n,onConfirm:a}),t[0]=r,t[1]=n,t[2]=a,t[3]=l,t[4]=i):i=t[4],i},bW="document-take-over",bG="document-take-over",bY=e=>{let t,r=(0,v.c)(19),{handleBackToDashboard:n,isActive:a,onReadOnly:l}=e,{closeModal:i,openModal:o}=lc(),{t:s}=(0,f.d)(),{startRouteTransition:u}=nK(),{clearRouteCache:d}=mi(),p,m;if(r[0]!==i||r[1]!==a||r[2]!==o?(p=()=>{a?o(bW):i(bW)},m=[a,o,i],r[0]=i,r[1]=a,r[2]=o,r[3]=p,r[4]=m):(p=r[3],m=r[4]),(0,c.useEffect)(p,m),r[5]!==d||r[6]!==i||r[7]!==n||r[8]!==l||r[9]!==u||r[10]!==s){let e,a;r[12]!==n||r[13]!==u?(e=()=>{u(()=>n())},r[12]=n,r[13]=u,r[14]=e):e=r[14],r[15]!==d||r[16]!==i||r[17]!==l?(a=()=>{l(),i(bW),d()},r[15]=d,r[16]=i,r[17]=l,r[18]=a):a=r[18],t=(0,h.jsx)(l_,{className:bG,closeOnBlur:!1,slug:bW,children:(0,h.jsxs)("div",{className:`${bG}__wrapper`,children:[(0,h.jsxs)("div",{className:`${bG}__content`,children:[(0,h.jsx)("h1",{children:s("general:editingTakenOver")}),(0,h.jsx)("p",{children:s("general:anotherUserTakenOver")})]}),(0,h.jsxs)("div",{className:`${bG}__controls`,children:[(0,h.jsx)(au,{buttonStyle:"primary",id:`${bW}-back-to-dashboard`,onClick:e,size:"large",children:s("general:backToDashboard")}),(0,h.jsx)(au,{buttonStyle:"secondary",id:`${bW}-view-read-only`,onClick:a,size:"large",children:s("general:viewReadOnly")})]})]})}),r[5]=d,r[6]=i,r[7]=n,r[8]=l,r[9]=u,r[10]=s,r[11]=t}else t=r[11];return t},bQ="document-locked",bX="document-locked",bJ=e=>{let t,r,n=(0,v.c)(33),{handleGoBack:a,isActive:l,onReadOnly:i,onTakeOver:o,updatedAt:s,user:u}=e,{closeModal:d,openModal:p}=lc(),{t:m}=(0,f.d)(),{clearRouteCache:g}=mi(),{startRouteTransition:b}=nK(),y,x;if(n[0]!==d||n[1]!==l||n[2]!==p?(y=()=>{l?p(bQ):d(bQ)},x=[l,p,d],n[0]=d,n[1]=l,n[2]=p,n[3]=y,n[4]=x):(y=n[3],x=n[4]),(0,c.useEffect)(y,x),n[5]!==a||n[6]!==b?(t=()=>{b(()=>a())},n[5]=a,n[6]=b,n[7]=t):t=n[7],n[8]!==g||n[9]!==d||n[10]!==a||n[11]!==i||n[12]!==o||n[13]!==b||n[14]!==m||n[15]!==t||n[16]!==s||n[17]!==u){let e,l,c,f;n[19]!==m||n[20]!==u?(e=u&&"object"==typeof u?u.email??u.id:`${m("general:user")}: ${u}`,n[19]=m,n[20]=u,n[21]=e):e=n[21],n[22]!==d||n[23]!==a||n[24]!==b?(l=()=>{d(bQ),b(()=>a())},n[22]=d,n[23]=a,n[24]=b,n[25]=l):l=n[25],n[26]!==g||n[27]!==d||n[28]!==i?(c=()=>{i(),d(bQ),g()},n[26]=g,n[27]=d,n[28]=i,n[29]=c):c=n[29],n[30]!==d||n[31]!==o?(f=()=>{o(),d(bQ)},n[30]=d,n[31]=o,n[32]=f):f=n[32],r=(0,h.jsx)(l_,{className:bX,closeOnBlur:!1,onClose:t,slug:bQ,children:(0,h.jsxs)("div",{className:`${bX}__wrapper`,children:[(0,h.jsxs)("div",{className:`${bX}__content`,children:[(0,h.jsx)("h1",{children:m("general:documentLocked")}),(0,h.jsxs)("p",{children:[(0,h.jsx)("strong",{children:e})," ",m("general:currentlyEditing")]}),(0,h.jsxs)("p",{children:[m("general:editedSince")," ",(0,h.jsx)("strong",{children:s?new Intl.DateTimeFormat("en-US",{day:"numeric",hour:"numeric",hour12:!0,minute:"numeric",month:"short",year:"numeric"}).format(new Date(s)):""})]})]}),(0,h.jsxs)("div",{className:`${bX}__controls`,children:[(0,h.jsx)(au,{buttonStyle:"secondary",id:`${bQ}-go-back`,onClick:l,size:"large",children:m("general:goBack")}),(0,h.jsx)(au,{buttonStyle:"secondary",id:`${bQ}-view-read-only`,onClick:c,size:"large",children:m("general:viewReadOnly")}),(0,h.jsx)(au,{buttonStyle:"primary",id:`${bQ}-take-over`,onClick:f,size:"large",children:m("general:takeOver")})]})]})}),n[8]=g,n[9]=d,n[10]=a,n[11]=i,n[12]=o,n[13]=b,n[14]=m,n[15]=t,n[16]=s,n[17]=u,n[18]=r}else r=n[18];return r};function bZ(e){let t=(0,v.c)(3),{i18n:r}=(0,f.d)(),{description:n}=e;if(n){let e;return t[0]!==n||t[1]!==r?(e=(0,h.jsx)("div",{className:"custom-view-description",children:m(n,r)}),t[0]=n,t[1]=r,t[2]=e):e=t[2],e}return null}var b0="graphic-account",b1=e=>(0,h.jsxs)("svg",{className:[b0,e?.active&&`${b0}--active`].filter(Boolean).join(" "),height:"25",viewBox:"0 0 25 25",width:"25",xmlns:"http://www.w3.org/2000/svg",children:[(0,h.jsx)("circle",{className:`${b0}__bg`,cx:"12.5",cy:"12.5",r:"11.5"}),(0,h.jsx)("circle",{className:`${b0}__head`,cx:"12.5",cy:"10.73",r:"3.98"}),(0,h.jsx)("path",{className:`${b0}__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"})]}),b2=(0,p.e)(r8(),1),b3=()=>{let e=(0,v.c)(2),{user:t}=iS(),r=(0,b2.default)(t.email.trim().toLowerCase()),n=`?${new URLSearchParams({default:"mp",r:"g",s:"50"}).toString()}`,a=`https://www.gravatar.com/avatar/${r}${n}`,l;return e[0]!==a?(l=(0,h.jsx)("img",{alt:"yas",className:"gravatar-account",height:25,src:a,style:{borderRadius:"50%"},width:25}),e[0]=a,e[1]=l):l=e[1],l},b6=()=>{let e=(0,v.c)(3),{config:t}=(0,d.c)(),{admin:r,routes:n}=t,{avatar:a,routes:l}=r,{account:i}=l,{admin:o}=n,{user:s}=iS(),c=(0,b.usePathname)()===tR({adminRoute:o,path:i});if(!s?.email||"default"===a){let t;return e[0]!==c?(t=(0,h.jsx)(b1,{active:c}
48),e[0]=c,e[1]=t):t=e[1],t}if("gravatar"===a){let t;return e[2]===Symbol.for("react.memo_cache_sentinel")?(t=(0,h.jsx)(b3,{}),e[2]=t):t=e[2],t}},b5=(0,c.createContext)({Actions:{},setViewActions:()=>{}}),b4=()=>(0,c.use)(b5),b8=()=>(0,h.jsx)("svg",{className:"icon icon--close-menu",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:(0,h.jsx)("path",{className:"stroke",d:"M14 6L6 14M6 6L14 14",strokeLinecap:"square"})}),b7=()=>(0,h.jsx)("svg",{className:"icon icon--menu",fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,h.jsx)("path",{className:"stroke",d:"M4.66667 10H15.3333M4.66667 6H15.3333M4.66667 14H15.3333",strokeLinecap:"square"})}),b9="hamburger",ve=e=>{let t=(0,v.c)(4),{t:r}=(0,f.d)(),{closeIcon:n,isActive:a}=e,l=void 0===n?"x":n,i=void 0!==a&&a,o;return t[0]!==l||t[1]!==i||t[2]!==r?(o=(0,h.jsxs)("div",{className:b9,children:[!i&&(0,h.jsx)("div",{"aria-label":r("general:open"),className:`${b9}__open-icon`,title:r("general:open"),children:(0,h.jsx)(b7,{})}),i&&(0,h.jsxs)("div",{"aria-label":r("collapse"===l?"general:collapse":"general:close"),className:`${b9}__close-icon`,title:r("collapse"===l?"general:collapse":"general:close"),children:["x"===l&&(0,h.jsx)(b8,{}),"collapse"===l&&(0,h.jsx)(nZ,{direction:"left"})]})]}),t[0]=l,t[1]=i,t[2]=r,t[3]=o):o=t[3],o},vt="localizer-button",vr=e=>{let t=(0,v.c)(8),{ariaLabel:r,className:n}=e,a=iP(),{i18n:l,t:i}=(0,f.d)(),o;if(t[0]!==r||t[1]!==n||t[2]!==l||t[3]!==a||t[4]!==i){let e;t[6]!==n?(e=[vt,n].filter(Boolean),t[6]=n,t[7]=e):e=t[7],o=(0,h.jsxs)("div",{"aria-label":r||i("general:locale"),className:e.join(" "),"data-locale":a?a.code:void 0,children:[(0,h.jsxs)("div",{className:`${vt}__label`,children:[`${i("general:locale")}:`," "]}),(0,h.jsxs)("div",{className:`${vt}__current`,children:[(0,h.jsx)("span",{className:`${vt}__current-label`,children:`${m(a.label,l)}`}),(0,h.jsx)(nZ,{className:`${vt}__chevron`})]})]}),t[0]=r,t[1]=n,t[2]=l,t[3]=a,t[4]=i,t[5]=o}else o=t[5];return o},vn="localizer",va=e=>{let t=(0,v.c)(17),{className:r}=e,{config:n}=(0,d.c)(),{localization:a}=n,l=(0,b.useRouter)(),{startRouteTransition:i}=nK(),{setLocaleIsLoading:o}=iN(),{i18n:s}=(0,f.d)(),u=iP();if(a){let{locales:e}=a,n;t[0]!==r?(n=[vn,r].filter(Boolean),t[0]=r,t[1]=n):n=t[1];let d=n.join(" "),f;if(t[2]!==s||t[3]!==u||t[4]!==e||t[5]!==l||t[6]!==o||t[7]!==i||t[8]!==d){let r;t[10]!==s||t[11]!==u||t[12]!==e||t[13]!==l||t[14]!==o||t[15]!==i?(r=t=>{let{close:r}=t;return(0,h.jsx)(n6.ButtonGroup,{children:e.map(e=>{let t=m(e.label,s);return(0,h.jsx)(n6.Button,{active:u.code===e.code,disabled:u.code===e.code,onClick:()=>{o(!0),r();let t=t6({...rh(new URLSearchParams(window.location.search).toString(),{depth:10,ignoreQueryPrefix:!0}),locale:e.code},{addQueryPrefix:!0});i(()=>{l.push(t)})},children:t!==e.code?(0,h.jsxs)(c.Fragment,{children:[t," ",(0,h.jsx)("span",{className:`${vn}__locale-code`,"data-locale":e.code,children:`(${e.code})`})]}):(0,h.jsx)("span",{className:`${vn}__locale-code`,"data-locale":e.code,children:t})},e.code)})})},t[10]=s,t[11]=u,t[12]=e,t[13]=l,t[14]=o,t[15]=i,t[16]=r):r=t[16],f=(0,h.jsx)("div",{className:d,children:(0,h.jsx)(al,{button:(0,h.jsx)(vr,{}),horizontalAlign:"right",render:r,showScrollbar:!0,size:"large"})}),t[2]=s,t[3]=u,t[4]=e,t[5]=l,t[6]=o,t[7]=i,t[8]=d,t[9]=f}else f=t[9];return f}return null},vl=c.default.createContext({hydrated:!1,navOpen:!0,navRef:null,setNavOpen:()=>{},shouldAnimate:!1}),vi=()=>c.default.use(vl),vo=async e=>{let t=(await e(rY.NAV))?.open;return"boolean"!=typeof t||t},vs=({children:e,initialIsOpen:t})=>{let{breakpoints:{l:r,m:n,s:a}}=gc(),l=(0,b.usePathname)(),{getPreference:i}=o_(),o=(0,c.useRef)(null),[s,u]=c.default.useState(t),[d,f]=c.default.useState(!1),[p,m]=c.default.useState(!1);return(0,c.useEffect)(()=>{!1===r&&(async()=>{u(await vo(i))})()},[r,i,u]),(0,c.useEffect)(()=>{!0===a&&u(!1)},[l]),(0,c.useEffect)(()=>{o.current&&(s&&n?o.current.style.overscrollBehavior="contain":o.current.style.overscrollBehavior="auto")},[s,n]),(0,c.useEffect)(()=>{(!0===r||!0===n||!0===a)&&u(!1),m(!0);let e=setTimeout(()=>{f(!0)},100);return()=>{clearTimeout(e)}},[r,n,a]),(0,c.useEffect)(()=>()=>{o.current&&(o.current.style.overscrollBehavior="auto")},[]),(0,h.jsx)(vl,{value:{hydrated:p,navOpen:s,navRef:o,setNavOpen:u,shouldAnimate:d},children:e})},vc="nav-toggler",vu=e=>{let t,r=(0,v.c)(15),{id:n,children:a,className:l,tabIndex:i}=e,o=void 0===i?0:i,{t:s}=(0,f.d)(),{setPreference:c}=o_(),{navOpen:u,setNavOpen:d}=vi(),{breakpoints:p}=gc(),{l:m}=p,g=`${s(u?"general:close":"general:open")} ${s("general:menu")}`,b=u&&`${vc}--is-open`,y;
48r[0]!==l||r[1]!==b?(y=[vc,b,l].filter(Boolean),r[0]=l,r[1]=b,r[2]=y):y=r[2];let x=y.join(" "),w;return r[3]!==m||r[4]!==u||r[5]!==d||r[6]!==c?(w=async()=>{d(!u),m||await c(rY.NAV,{open:!u},!0)},r[3]=m,r[4]=u,r[5]=d,r[6]=c,r[7]=w):w=r[7],r[8]!==a||r[9]!==n||r[10]!==g||r[11]!==x||r[12]!==w||r[13]!==o?(t=(0,h.jsx)("button",{"aria-label":g,className:x,id:n,onClick:w,tabIndex:o,type:"button",children:a}),r[8]=a,r[9]=n,r[10]=g,r[11]=x,r[12]=w,r[13]=o,r[14]=t):t=r[14],t},vd=({fill:e})=>{let t=e||"var(--theme-elevation-1000)";return(0,h.jsxs)("svg",{className:"graphic-icon",height:"100%",viewBox:"0 0 25 25",width:"100%",xmlns:"http://www.w3.org/2000/svg",children:[(0,h.jsx)("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:t}),(0,h.jsx)("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:t})]})},vf=()=>(0,c.use)(vp),vp=(0,c.createContext)({setStepNav:()=>{},stepNav:[]}),vh=e=>{let t=(0,v.c)(4),{children:r}=e,n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n=[],t[0]=n):n=t[0];let[a,l]=(0,c.useState)(n),i;return t[1]!==r||t[2]!==a?(i=(0,h.jsx)(vp,{value:{setStepNav:l,stepNav:a},children:r}),t[1]=r,t[2]=a,t[3]=i):i=t[3],i},vm="step-nav",vg=e=>{let t=(0,v.c)(7),{className:r,CustomIcon:n}=e,{i18n:a}=(0,f.d)(),{stepNav:l}=vf(),{config:i}=(0,d.c)(),{routes:o}=i,{admin:s}=o,{t:u}=(0,f.d)(),p;return t[0]!==n||t[1]!==s||t[2]!==r||t[3]!==a||t[4]!==l||t[5]!==u?(p=(0,h.jsx)(c.Fragment,{children:l.length>0?(0,h.jsxs)("nav",{className:[vm,r].filter(Boolean).join(" "),children:[(0,h.jsx)(nQ,{className:`${vm}__home`,href:s,prefetch:!1,tabIndex:0,children:(0,h.jsx)("span",{title:u("general:dashboard"),children:(0,h.jsx)(r7,{CustomComponent:n,Fallback:(0,h.jsx)(vd,{})})})}),(0,h.jsx)("span",{children:"/"}),l.map((e,t)=>{let r=m(e.label,a);return l.length===t+1?(0,h.jsx)("span",{className:`${vm}__last`,children:r},t):(0,h.jsxs)(c.Fragment,{children:[e.url?(0,h.jsx)(nQ,{href:e.url,prefetch:!1,children:(0,h.jsx)("span",{children:r},t)}):(0,h.jsx)("span",{children:r},t),(0,h.jsx)("span",{children:"/"})]},t)})]}):(0,h.jsx)("div",{className:[vm,r].filter(Boolean).join(" "),children:(0,h.jsx)("div",{className:`${vm}__home`,children:(0,h.jsx)("span",{title:u("general:dashboard"),children:(0,h.jsx)(r7,{CustomComponent:n,Fallback:(0,h.jsx)(vd,{})})})})})}),t[0]=n,t[1]=s,t[2]=r,t[3]=a,t[4]=l,t[5]=u,t[6]=p):p=t[6],p},vb="app-header",vv="card",vy="copy-locale-data",vx="copy-locale",vw=()=>{let e,t,r,n,a,l,i,o=(0,v.c)(36),{config:s}=(0,d.c)(),{localization:u,routes:p}=s,{admin:g}=p,{code:y}=iP(),{id:x,collectionSlug:w,globalSlug:C}=oD(),{i18n:j,t:S}=(0,f.d)(),$=nw(),{toggleModal:_}=lc(),{copyDataFromLocale:k}=fg(),E=(0,b.useRouter)(),{startRouteTransition:N}=nK(),P=u&&u.locales.map(vC)||[],T;o[0]!==y?(T=e=>e.value!==y,o[0]=y,o[1]=T):T=o[1];let D=P.filter(T),R;o[2]!==j||o[3]!==u?(R=e=>{let t=u&&u.locales.find(t=>t.code===e);return t&&t.label?m(t.label,j):e},o[2]=j,o[3]=u,o[4]=R):R=o[4];let A=R,[O,L]=c.default.useState(!1),[M,I]=c.default.useState(null),[F,B]=c.default.useState(y),[z,U]=c.default.useState(!1),V,H;o[5]!==y||o[6]!==F?(V=()=>{F!==y&&B(y)},H=[y,F],o[5]=y,o[6]=F,o[7]=V,o[8]=H):(V=o[7],H=o[8]),c.default.useEffect(V,H),o[9]!==g||o[10]!==w||o[11]!==k||o[12]!==C||o[13]!==x||o[14]!==z||o[15]!==E||o[16]!==N||o[17]!==S||o[18]!==_?(e=async e=>{let{from:t,to:r}=e;L(!0);try{await k({collectionSlug:w,docID:x,fromLocale:t,globalSlug:C,overrideData:z,toLocale:r}),L(!1),N(()=>E.push(tR({adminRoute:g,path:`/${w?`collections/${w}/${x}`:`globals/${C}`}`})+`?locale=${r}`)),_(vx)}catch(r){L(!1);let e=r.message||"error:unknown",t=e.startsWith("error:")?S(e):e;nI.error(t)}},o[9]=g,o[10]=w,o[11]=k,o[12]=C,o[13]=x,o[14]=z,o[15]=E,o[16]=N,o[17]=S,o[18]=_,o[19]=e):e=o[19];let q=e;return x||C?(o[20]!==$||o[21]!==S||o[22]!==_?(t=()=>{$?nI.info(S("general:unsavedChanges")):_(vx)},o[20]=$,o[21]=S,o[22]=_,o[23]=t):t=o[23],o[24]!==_?(r=()=>{_(vx)},o[24]=_,o[25]=r):r=o[25],o[26]!==q||o[27]!==O||o[28]!==F||o[29]!==S||o[30]!==M?(n=async()=>{F===M?nI.error(S("localization:cannotCopySameLocale")):O||await q({from:F,to:M})},o[26]=q,o[27]=O,o[28]=F,o[29]=S,o[30]=M,o[31]=n):n=o[31],o[32]===Symbol.for("react.memo_cache_sentinel")?(a=e=>{e?.value&&B(e.value)},o[32]=a):a=o[32],o[33]===Symbol.for("react.memo_cache_sentinel")?(l=e=>{e?.value&&I(e.value)},o[33]=l):l=o[33],o[34]!==z?(i=()=>U(!z),o[34]=z,o[35]=i):i=o[35],(0,h.jsxs)(c.default.Fragment,{children:[(0,h.jsx)(n6.Button,{id:`${vy}__button`,onClick:t,children:S("localization:copyToLocale")}),(0,h.jsxs)(ip,{className:vy,gutter:!1,Header:(0,h.jsx)(hM,{onClose:r,title:S("localization:copyToLocale")}),slug:vx,children:[(0,h.jsxs)("div",{className:`${vy}__sub-header`,children:[(0,h.jsx)("span",{children:F&&M?(0,h.jsx)("div",{children:S("localization:copyFromTo",{from:A(F),to:A(M)})}):S("localization:selectLocaleToCopy")}),(0,h.jsx)(au,{buttonStyle:"primary",disabled:!F||!M,iconPosition:"left",onClick:n,size:"medium",children:O?S("general:copying")+"...":S("general:copy")})]}),(0,h.jsxs)("div",{className:`${vy}__content`,children:[(0,h.jsx)(p8,{label:S("localization:copyFrom"),name:"fromLocale",onChange:a,options:P,path:"fromLocale",readOnly:!0,value:F}),(0,h.jsx)(p8,{label:S("localization:copyTo"),name:"toLocale",onChange:l,options:D,path:"toLocale",value:M}),(0,h.jsx)(oZ,{checked:z,field:{name:"overwriteExisting",label:S("general:overwriteExistingData")},onChange:i,path:"overwriteExisting"})]})]})]})):null};function vC(e){return{label:e.label,value:e.code}}var vj=((i={}).AllAvailable="allAvailable",i.AllInPage="allInPage",i.None="none",i.Some="some",i),vS=(0,c.createContext)({count:void 0,getQueryParams:e=>"",getSelectedIds:()=>[],selectAll:void 0,selected:new Map,selectedIDs:[],setSelection:e=>{},toggleAll:e=>{},totalDocs:void 0}),v$=e=>{let t=[];for(let[r,n]of e)n&&t.push(r);return t},v_=({children:e,docs:t=[],totalDocs:r})=>{let n=(0,c.useRef)({}),{user:a}=iS(),{code:l}=iP(),[i,o]=(0,c.useState)(()=>{let e=new Map;return t.forEach(({id:t})=>{e.set(t,!1)}),e}),[s,u]=(0,c.useState)("none"),[d,f]=(0,c.useState)(0),p=(0,b.useSearchParams)(),{query:m}=fd(),g=(0,c.useCallback)((e=!1)=>{let r=new Map;if(e)u("allAvailable"),t.forEach(({id:e,_isLocked:t,_userEditing:n})=>{t&&n?.id!==a?.id||r.set(e,!0)});else if("allAvailable"===s||"allInPage"===s)u("none");else{let e="some"!==s;t.forEach(({id:t,_isLocked:n,_userEditing:l})=>
48{n&&l?.id!==a?.id||r.set(t,e)}),e&&r.size>0?r.size===t.length?u("allInPage"):u("some"):u("none")}o(r)},[t,s,a?.id]),v=(0,c.useCallback)(e=>{let r=t.find(t=>t.id===e);if(r?._isLocked&&a?.id!==r?._userEditing.id)return;let n=i.get(e),l="boolean"!=typeof n||!n,c=new Map(i.set(e,l));"allAvailable"!==s||l||u("some"),o(c)},[i,t,s,a?.id]),y=(0,c.useCallback)(e=>{let t;if("allAvailable"===s)t=fc(p)?.where||{id:{not_equals:""}};else{let e=[];for(let[t,r]of i)r&&e.push(t);t={id:{in:e}}}return e&&(t={and:[{...e},t]}),t6({locale:l,where:t},{addQueryPrefix:!0})},[s,i,l,p]),x=(0,c.useCallback)(()=>v$(i),[i]);(0,c.useEffect)(()=>{if("allAvailable"===s)return;let e=!1,r=!0;if(i.size)for(let[t,n]of i)r=r&&n,e=e||n;else r=!1,e=!1;r&&i.size===t.length?u("allInPage"):u(e?"some":"none")},[s,i,r,t]),(0,c.useEffect)(()=>{let e=0;if("allAvailable"===s)e=r;else for(let[t,r]of i)r&&e++;f(e)},[s,i,r]),(0,c.useEffect)(()=>{u("none"),o(new Map)},[m]);let w=(0,c.useMemo)(()=>v$(i),[i]);return n.current={count:d,getQueryParams:y,getSelectedIds:x,selectAll:s,selected:i,selectedIDs:w,setSelection:v,toggleAll:g,totalDocs:r},(0,h.jsx)(vS,{value:n.current,children:e})},vk=()=>(0,c.use)(vS),vE="list-selection";function vN(e){let t=(0,v.c)(5),{count:r,ListActions:n,SelectionActions:a}=e,{t:l}=(0,f.d)(),i;return t[0]!==n||t[1]!==a||t[2]!==r||t[3]!==l?(i=(0,h.jsxs)("div",{className:vE,children:[(0,h.jsx)("span",{children:l("general:selectedCount",{count:r,label:""})}),n&&n.length>0&&(0,h.jsxs)(c.default.Fragment,{children:[(0,h.jsx)("span",{children:"—"}),(0,h.jsx)("div",{className:`${vE}__actions`,children:n})]}),a&&a.length>0&&(0,h.jsxs)(c.default.Fragment,{children:[(0,h.jsx)("span",{children:"—"}),(0,h.jsx)("div",{className:`${vE}__actions`,children:a})]})]}),t[0]=n,t[1]=a,t[2]=r,t[3]=l,t[4]=i):i=t[4],i}function vP({children:e,className:t,...r}){return(0,h.jsx)(au,{...r,buttonStyle:"none",className:[`${vE}__button`,t].filter(Boolean).join(" "),children:e})}var vT=e=>{let t=(0,v.c)(6),{viewType:r}=e,{collection:n,hasDeletePermission:a,hasTrashPermission:l,modalPrefix:i}=e,{slug:o,trash:s}=void 0===n?{}:n,{permissions:u}=iS(),{count:d,selectAll:f,selectedIDs:p,toggleAll:m}=vk(),g=(0,b.useRouter)(),y=(0,b.useSearchParams)(),{clearRouteCache:x}=mi(),w=u?.collections?.[o],C=void 0!==a?a:!!w?.delete,j=void 0!==l?l:C,S=f===vj.AllAvailable,$=S?[]:p,_="trash"===r?C:C||j;if(f===vj.None||!_)return null;let k=fc(y)?.where,E="trash"===r?{and:[...Array.isArray(k?.and)?k.and:k?[k]:[],{deletedAt:{exists:!0}}]}:k,N;return t[0]!==x||t[1]!==g||t[2]!==y||t[3]!==f||t[4]!==m?(N=()=>{m(),g.replace(t6({...fc(y),page:f?"1":void 0},{addQueryPrefix:!0})),x()},t[0]=x,t[1]=g,t[2]=y,t[3]=f,t[4]=m,t[5]=N):N=t[5],(0,h.jsx)(c.default.Fragment,{children:(0,h.jsx)(vD,{afterDelete:N,hasDeletePermission:C,hasTrashPermission:j,modalPrefix:i,search:fc(y)?.search,selections:{[o]:{all:f===vj.AllAvailable,ids:$,totalCount:S?d:$.length}},trash:s,viewType:r,where:E})})};function vD({afterDelete:e,hasDeletePermission:t=!1,hasTrashPermission:r=!1,modalPrefix:n,search:a,selections:l,trash:i,viewType:o,where:s}){let{t:u}=(0,f.d)(),{config:{collections:p,routes:{api:g}}}=(0,d.c)(),{code:b}=iP(),{i18n:v}=(0,f.d)(),{openModal:y}=lc(),[x,w]=c.default.useState(!1),C=`${n?`${n}-`:""}confirm-delete-many-docs`,j=c.default.useCallback(async()=>{let n=1===Object.keys(l).length,i={};for(let[e,{all:c,ids:d=[]}]of Object.entries(l)){let l=p.find(({slug:t})=>t===e);if(l){let f;f=c?n&&s?"trash"===o?{and:[...Array.isArray(s.and)?s.and:[s],{deletedAt:{exists:!0}}]}:s:"trash"===o?{and:[{id:{not_equals:""}},{deletedAt:{exists:!0}}]}:{id:{not_equals:""}}:{and:[{id:{in:d}},..."trash"===o?[{deletedAt:{exists:!0}}]:[]]};let p=tR({apiRoute:g,path:`/${e}${t6({limit:0,locale:b,select:{},where:rn({collectionConfig:l,search:a,where:f}),..."trash"===o?{trash:!0}:{}},{addQueryPrefix:!0})}`}),h=function({deletePermanently:e,hasDeletePermission:t,hasTrashPermission:r,
48isTrashView:n=!1}){return n||!r||t&&e}({deletePermanently:x,hasDeletePermission:t,hasTrashPermission:!!l.trash&&r,isTrashView:"trash"===o}),y=h?await iw.delete(p,{headers:{"Accept-Language":v.language,"Content-Type":"application/json"}}):await iw.patch(p,{body:JSON.stringify({deletedAt:new Date().toISOString()}),headers:{"Accept-Language":v.language,"Content-Type":"application/json"}});try{let{plural:r,singular:n}=l.labels,a=await y.json(),s=a?.docs.length||0,c=s>1?r:n;if(y.status<400||s>0){let e;e=h?"trash"===o||t&&x?"general:permanentlyDeletedCountSuccessfully":"general:deletedCountSuccessfully":"general:trashedCountSuccessfully",nI.success(u(e,{count:s,label:m(c,v)}))}a?.errors.length>0&&nI.error(a.message,{description:a.errors.map(e=>e.message).join(`
49`)}),i[e]={deletedCount:s,errors:a?.errors||null,ids:a?.docs.map(e=>e.id)||[],totalCount:a.totalDocs},y.status>400&&a?.errors.length===0&&(nI.error(u("error:unknown")),i[e].errors=[u("error:unknown")]);continue}catch(t){nI.error(u("error:unknown")),i[e]={deletedCount:0,errors:[t],ids:[],totalCount:0};continue}}}"function"==typeof e&&e(i)},[l,e,p,x,t,r,b,a,g,v,o,s,u]),{label:S,labelCount:$}=Object.entries(l).reduce((e,[t,r],n,a)=>{let l=p.find(({slug:e})=>e===t);if(l){let t=void 0===e.labelCount?r.totalCount:e.labelCount,i=`${void 0!==e.labelCount?`${r.totalCount} `:""}${m(r.totalCount>1?l.labels.plural:l.labels.singular,v)}`;return{label:n===a.length-1&&0!==n?`${e.label} and ${i}`:n>0?`${e.label}, ${i}`:i,labelCount:t}}return e},{label:"",labelCount:void 0});return(0,h.jsxs)(c.default.Fragment,{children:[(0,h.jsx)(vP,{"aria-label":u("general:delete"),className:"delete-documents__toggle",onClick:()=>{y(C)},children:u("general:delete")}),(0,h.jsx)(iv,{body:(0,h.jsxs)(c.default.Fragment,{children:[(0,h.jsx)("p",{children:i&&r?"trash"===o?(0,h.jsx)(mh,{elements:{0:({children:e})=>(0,h.jsx)("strong",{children:e}),1:({children:e})=>(0,h.jsx)("strong",{children:e})},i18nKey:"general:aboutToPermanentlyDeleteTrash",t:u,variables:{count:$??0,label:S}}):u("general:aboutToTrashCount",{count:$,label:S}):u("general:aboutToDeleteCount",{count:$,label:S})}),i&&r&&t&&"trash"!==o&&(0,h.jsx)("div",{className:"delete-documents__checkbox",children:(0,h.jsx)(oX,{checked:x,id:"delete-forever",label:u("general:deletePermanently"),name:"delete-forever",onToggle:e=>w(e.target.checked)})})]}),confirmingLabel:u("general:deleting"),heading:u("general:confirmDeletion"),modalSlug:C,onConfirm:j})]})}var vR=(0,c.createContext)({appIsReady:!1,breakpoint:void 0,breakpoints:void 0,iframeRef:void 0,isLivePreviewEnabled:void 0,isLivePreviewing:!1,isPopupOpen:!1,isPreviewEnabled:void 0,measuredDeviceSize:{height:0,width:0},openPopupWindow:()=>{},popupRef:void 0,previewURL:void 0,previewWindowType:"iframe",setAppIsReady:()=>{},setBreakpoint:()=>{},setHeight:()=>{},setIsLivePreviewing:()=>{},setLoadedURL:()=>{},setMeasuredDeviceSize:()=>{},setPreviewURL:()=>{},setPreviewWindowType:()=>{},setSize:()=>{},setToolbarPosition:()=>{},setURL:()=>{},setWidth:()=>{},setZoom:()=>{},shouldRenderIframe:void 0,size:{height:0,width:0},toolbarPosition:{x:0,y:0},typeofLivePreviewURL:void 0,url:void 0,zoom:1}),vA=()=>(0,c.use)(vR),vO=()=>{let{isPreviewEnabled:e,previewURL:t,setPreviewURL:r}=(0,c.use)(vR);return{isPreviewEnabled:e,previewURL:t,setPreviewURL:r}},vL=({id:e,collection:t,global:r})=>{let{config:{routes:{api:n}}}=(0,d.c)(),{docConfig:a,lastUpdateTime:l,mostRecentVersionIsAutosaved:i,setMostRecentVersionIsAutosaved:o,setUnpublishedVersionCount:s}=oD(),{isValid:u,setBackgroundProcessing:p,submit:m}=nm(),[g]=nS(),b=nw(),v=nv(),{code:y}=iP(),{i18n:x,t:w}=(0,f.d)(),C=rj(a),j=rw(a),[S,$]=(0,c.useState)(!1),_=(0,c.useDeferredValue)(S),k=fK(g,C),{queueTask:E}=pM(),N=(0,c.useRef)(null),P=ae(()=>{let a,l;N.current=void 0,E(async()=>{if(b){var c;let u;a=new Date().getTime(),$(!0);let d,f,p,h=t6({autosave:!0,depth:0,draft:!0,"fallback-locale":"null",locale:y},{addQueryPrefix:!0});t&&e&&(p=t.slug,d=tR({apiRoute:n,path:`/${p}/${e}${h}`}),f="PATCH"),r&&(p=r.slug,d=tR({apiRoute:n,path:`/globals/${p}${h}`}),f="POST");let{valid:x}=(u={data:{},valid:!0}
49,g&&(Object.keys(g).forEach(e=>{(!0===c||!g[e]?.disableFormData)&&(u.data[e]=g[e]?.value,g[e].valid||(u.valid=!1))}),u.data=rE(u.data)),u);if(!(v&&!x&&j)&&b&&d){let e=await m({acceptValues:{overrideLocalChanges:!1},action:d,context:{getDocPermissions:!1,incrementVersionCount:!i},disableFormWhileProcessing:!1,disableSuccessStatus:!0,method:f,overrides:{_status:"draft"},skipValidation:!j});e&&e?.res?.ok&&!i&&(o(!0),s(e=>e+1)),(l=new Date().getTime())-a<1e3?N.current=setTimeout(()=>{$(!1)},1e3-(l-a)):R()}}},{afterProcess:()=>{p(!1)},beforeProcess:()=>{p(!0)}})}),T=(0,c.useRef)(!1),D=(0,c.useRef)(rN(k));(0,c.useEffect)(()=>{if(!T.current){T.current=!0;return}let{updatedAt:e,...t}=rN(k),{updatedAt:r,...n}=D.current;t8(t,n)||(D.current=t,P())},[k]),(0,c.useEffect)(()=>()=>{R()},[]);let R=ae(()=>{N.current&&clearTimeout(N.current),$(!1)});return(0,h.jsxs)("div",{className:"autosave",children:[j&&!u&&(0,h.jsx)(bq,{}),_&&w("general:saving"),!_&&!!l&&(0,h.jsx)(c.default.Fragment,{children:w("version:lastSavedAgo",{distance:og({date:l,i18n:x})})})]})},vM="delete-document",vI=e=>{let{id:t,buttonId:r,collectionSlug:n,onDelete:a,redirectAfterDelete:l=!0,singularLabel:i,title:o}=e,{config:{routes:{admin:s,api:u}},getEntityConfig:p}=(0,d.c)(),g=p({collectionSlug:n}),{hasDeletePermission:v,hasTrashPermission:y}=oD(),{setModified:x}=nm(),w=(0,b.useRouter)(),{i18n:C,t:j}=(0,f.d)(),{title:S}=ow(),{startRouteTransition:$}=nK(),{openModal:_}=lc(),k=`delete-${t}`,[E,N]=(0,c.useState)(!1),P=(0,c.useCallback)(()=>{nI.error(j("error:deletingTitle",{title:S}))},[j,S]),T=(0,c.useCallback)(async()=>{x(!1);let e=function({deletePermanently:e,hasDeletePermission:t,hasTrashPermission:r,
49isTrashView:n=!1}){return n||!r||t&&e}({deletePermanently:E,hasDeletePermission:v,hasTrashPermission:y});try{let r=tR({apiRoute:u,path:`/${n}/${t}`}),o=e?await iw.delete(r,{headers:{"Accept-Language":C.language,"Content-Type":"application/json"}}):await iw.patch(r,{body:JSON.stringify({deletedAt:new Date().toISOString()}),headers:{"Accept-Language":C.language,"Content-Type":"application/json"}}),c=await o.json();if(o.status<400){if(nI.success(j(e?"general:titleDeleted":"general:titleTrashed",{label:m(i,C),title:S})||c.message),l)return $(()=>w.push(tR({adminRoute:s,path:`/collections/${n}`})));"function"==typeof a&&await a({id:t,collectionConfig:g});return}c.errors?c.errors.forEach(e=>nI.error(e.message)):P();return}catch{return P()}},[E,x,v,y,u,n,t,j,i,P,C,S,w,s,l,a,g,$]);return t?(0,h.jsxs)(c.Fragment,{children:[(0,h.jsx)(n6.Button,{id:r,onClick:()=>{_(k)},children:j("general:delete")}),(0,h.jsx)(iv,{body:(0,h.jsxs)(c.Fragment,{children:[(0,h.jsx)(mh,{elements:{1:({children:e})=>(0,h.jsx)("strong",{children:e})},i18nKey:g.trash&&y?"general:aboutToTrash":"general:aboutToDelete",t:j,variables:{label:m(i,C),title:o||S||t}}),g.trash&&y&&v&&(0,h.jsx)("div",{className:`${vM}__checkbox`,children:(0,h.jsx)(oX,{checked:E,id:"delete-forever",label:j("general:deletePermanently"),name:"delete-forever",onToggle:e=>N(e.target.checked)})})]}),className:vM,confirmingLabel:j("general:deleting"),heading:j("general:confirmDeletion"),modalSlug:k,onConfirm:T})]}):null},vF=e=>{for(let t of e){if("localized"in t&&t.localized)return!0;switch(t.type){case"array":case"collapsible":case"group":case"row":if(t.fields&&vF(t.fields))return!0;break;case"blocks":if(t.blocks){for(let e of t.blocks)if(e.fields&&vF(e.fields))return!0}break;case"tabs":if(t.tabs){for(let e of t.tabs)if("localized"in e&&e.localized||"fields"in e&&e.fields&&vF(e.fields))return!0}}}return!1},vB="select-locales-drawer",vz=({slug:e,localization:t,onConfirm:r})=>{let{i18n:n,t:a}=(0,f.d)(),{toggleModal:l}=lc(),[i,o]=(0,c.useState)([]),s=(0,c.useMemo)(()=>(({i18n:e,localization:t})=>t.locales.map(t=>({label:m(t.label,e),value:t.code})))({i18n:n,localization:t}),[t,n]),u=(0,c.useMemo)(()=>s.map(e=>e.value),[s]),d=(0,c.useMemo)(()=>rV(new Set(i),new Set(u)),[i,u]),p=(0,c.useCallback)(()=>{o(d?[]:[...u])},[d,u]),g=(0,c.useCallback)(e=>{o(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])},[]),b=(0,c.useCallback)(async()=>{await r({selectedLocales:i}),l(e)},[r,i,e,l]);return(0,h.jsxs)(ip,{className:vB,gutter:!1,Header:(0,h.jsx)(hM,{onClose:()=>{l(e)},title:`${a("general:duplicate")} ${a("localization:selectedLocales")}`}),slug:e,children:[(0,h.jsxs)("div",{className:`${vB}__sub-header`,children:[(0,h.jsx)("span",{children:a("localization:selectLocaleToDuplicate")}),(0,h.jsx)(au,{buttonStyle:"primary",disabled:0===i.length,iconPosition:"left",id:"#action-duplicate-confirm",onClick:b,size:"medium",children:a("general:duplicate")})]}),(0,h.jsxs)("div",{className:`${vB}__content`,children:[(0,h.jsx)("div",{className:`${vB}__item`,children:(0,h.jsx)(oX,{checked:d,id:"select-locale-all",label:a("general:selectAll",{count:u.length,label:a("general:locales")}),onToggle:p})}),s.map(e=>(0,h.jsx)("div",{className:`${vB}__item`,children:(0,h.jsx)(oX,{checked:i.includes(e.value),id:`select-locale-${e.value}`,label:e.label,onToggle:()=>g(e.value)})},e.value))]})]})},vU=({id:e,slug:t,onDuplicate:r,redirectAfterDuplicate:n=!0,selectLocales:a,singularLabel:l})=>{let i=(0,b.useRouter)(),o=nw(),{openModal:s}=lc(),{code:u}=iP(),{setModified:p}=nm(),{startRouteTransition:g}=nK(),{config:{localization:v,routes:{admin:y,api:x}},getEntityConfig:w}=(0,d.c)(),C=w({collectionSlug:t}),{i18n:j,t:S}=(0,f.d)(),$=`duplicate-${e}`,_=`duplicate-locales-${e}`,k=(0,c.useMemo)(()=>!!a&&!!C&&vF(C.fields),[C,a]),E=(0,c.useCallback)(async a=>{let{selectedLocales:o}=a||{},s=o&&o.length>0,c={};u&&(c.locale=u),s&&(c.selectedLocales=o);let d={"Accept-Language":j.language,"Content-Type":"application/json",credentials:"include"};try{let a=await iw.post(tR({apiRoute:x,path:`/${t}/${e}/duplicate${t6(c,{addQueryPrefix:!0})}`}),{body:JSON.stringify(rv(C)?{_status:"draft"}:{}),headers:d}),{doc:o,errors:s,message:f}=await a.json();if(a.status<400){if(nI.success(f||S("general:successfullyDuplicated",{label:m(l,j)})),p(!1),n)return g(()=>i.push(tR({adminRoute:y,path:`/collections/${t}/${o.id}${u?`?locale=${u}`:""}`})));"function"==typeof r&&r({collectionConfig:C,doc:o})}else nI.error(s?.[0].message||f||S("error:unspecific",{label:m(l,j)}))}catch{nI.error(S("error:unspecific",{label:m(l,j)}))}},[y,x,C,j,e,u,r,n,i,p,l,t,g,S]),N=(0,c.useCallback)(async()=>{a?s(_):await E()},[E,_,a,s]),P=a?`${S("general:duplicate")} ${S("localization:selectedLocales")}`:S("general:duplicate");return!a||k?(0,h.jsxs)(c.default.Fragment,{children:[(0,h.jsx)(n6.Button,{id:`action-duplicate${k?"-locales":""}`,onClick:()=>{o?s($):a?s(_):E()},children:P}),(0,h.jsx)(iv,{body:S("general:unsavedChangesDuplicate"),confirmLabel:S("general:duplicateWithoutSaving"),heading:S("general:unsavedChanges"),modalSlug:$,onConfirm:N}),a&&v&&(0,h.jsx)(vz,{localization:v,onConfirm:E,slug:_})]}):null},vV=({active:e=!0,className:t})=>
49(0,h.jsx)("svg",{className:[t,"icon icon--eye"].filter(Boolean).join(" "),viewBox:"0 0 16 12",xmlns:"http://www.w3.org/2000/svg",children:e?(0,h.jsx)(c.Fragment,{children:(0,h.jsx)("path",{className:"stroke",d:"M2 11.5L4.35141 9.51035M15 0.5L12.6486 2.48965M10.915 6.64887C10.6493 7.64011 9.78959 8.38832 8.7408 8.48855M10.4085 4.38511C9.94992 3.84369 9.2651 3.5 8.5 3.5C7.11929 3.5 6 4.61929 6 6C6 6.61561 6.22251 7.17926 6.59149 7.61489M10.4085 4.38511L6.59149 7.61489M10.4085 4.38511L12.6486 2.48965M6.59149 7.61489L4.35141 9.51035M14.1292 3.92915C15.0431 5.02085 15.5 6 15.5 6C15.5 6 13.1667 11 8.5 11C7.67995 11 6.93195 10.8456 6.256 10.5911M4.35141 9.51035C2.45047 8.03672 1.5 6 1.5 6C1.5 6 3.83333 1 8.5 1C10.1882 1 11.5711 1.65437 12.6486 2.48965"})}):(0,h.jsxs)(c.Fragment,{children:[(0,h.jsx)("circle",{className:"stroke",cx:"8.5",cy:"6",r:"2.5"}),(0,h.jsx)("path",{className:"stroke",d:"M8.5 1C3.83333 1 1.5 6 1.5 6C1.5 6 3.83333 11 8.5 11C13.1667 11 15.5 6 15.5 6C15.5 6 13.1667 1 8.5 1Z"})]})}),vH="live-preview-toggler",vq=()=>{let{isLivePreviewing:e,setIsLivePreviewing:t,url:r}=vA(),{t:n}=(0,f.d)();return r?(0,h.jsx)("button",{"aria-label":n(e?"general:exitLivePreview":"general:livePreview"),className:[vH,e&&`${vH}--active`].filter(Boolean).join(" "),id:"live-preview-toggler",onClick:()=>{t(!e)},title:n(e?"general:exitLivePreview":"general:livePreview"),type:"button",children:(0,h.jsx)(vV,{active:e})}):null},vK=({className:e})=>
49(0,h.jsxs)("svg",{className:["icon icon--lock",e].filter(Boolean).join(" "),fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[(0,h.jsx)("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"}),(0,h.jsx)("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"})]}),vW="locked",vG=e=>{let t=(0,v.c)(8),{className:r,user:n}=e,[a,l]=(0,c.useState)(!1),{t:i}=(0,f.d)(),o=n&&"object"==typeof n?n.email??n.id:i("general:anotherUser"),s;t[0]!==r?(s=[vW,r].filter(Boolean),t[0]=r,t[1]=s):s=t[1];let u=s.join(" "),d,p;t[2]===Symbol.for("react.memo_cache_sentinel")?(d=()=>l(!0),p=()=>l(!1),t[2]=d,t[3]=p):(d=t[2],p=t[3]);let m=`${o} ${i("general:isEditing")}`,g;return t[4]!==a||t[5]!==u||t[6]!==m?(g=(0,h.jsxs)("div",{className:u,onMouseEnter:d,onMouseLeave:p,role:"button",tabIndex:0,children:[(0,h.jsx)(ao,{alignCaret:"left",className:`${vW}__tooltip`,position:"top",show:a,children:m}),(0,h.jsx)(vK,{})]}),t[4]=a,t[5]=u,t[6]=m,t[7]=g):g=t[7],g},vY=e=>{let{id:t,buttonId:r,collectionSlug:n,onDelete:a,redirectAfterDelete:l=!0,singularLabel:i,title:o}=e,{config:{routes:{admin:s,api:u},serverURL:p},getEntityConfig:g}=(0,d.c)(),v=g({collectionSlug:n}),y=(0,b.useRouter)(),{i18n:x,t:w}=(0,f.d)(),{title:C}=ow(),{startRouteTransition:j}=nK(),{openModal:S}=lc(),$=`perma-delete-${t}`,_=(0,c.useCallback)(()=>{nI.error(w("error:deletingTitle",{title:C}))},[w,C]),k=(0,c.useCallback)(async()=>{try{let e=tR({apiRoute:u,path:`/${n}${t6({trash:!0,where:{and:[{id:{equals:t}},{deletedAt:{exists:!0}}]}},{addQueryPrefix:!0})}`}),r=await iw.delete(e,{headers:{"Accept-Language":x.language,"Content-Type":"application/json"}}),o=await r.json();if(r.status<400){if(nI.success(w("general:titleDeleted",{label:m(i,x),title:C})||o.message),l)return j(()=>y.push(tR({adminRoute:s,path:`/collections/${n}/trash`,serverURL:p}
49)));"function"==typeof a&&await a({id:t,collectionConfig:v});return}o.errors?o.errors.forEach(e=>nI.error(e.message)):_()}catch{_()}},[p,u,n,t,w,i,_,x,C,y,s,l,a,v,j]);return t?(0,h.jsxs)(c.Fragment,{children:[(0,h.jsx)(au,{buttonStyle:"secondary",id:r,onClick:()=>{S($)},children:w("general:permanentlyDelete")}),(0,h.jsx)(iv,{body:(0,h.jsx)(mh,{elements:{1:({children:e})=>(0,h.jsx)("strong",{children:e})},i18nKey:"general:aboutToPermanentlyDelete",t:w,variables:{label:m(i,x),title:o||C||t}}),confirmingLabel:w("general:deleting"),heading:w("general:confirmDeletion"),modalSlug:$,onConfirm:k})]}):null},vQ=e=>{let{className:t}=e;return(0,h.jsx)("svg",{className:[t,"icon icon--externalLink"].filter(Boolean).join(" "),viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:(0,h.jsx)("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"})})};function vX(e){let t,r=(0,v.c)(3),{previewURL:n}=vO(),{t:a}=(0,f.d)();return n?(r[0]!==n||r[1]!==a?(t=(0,h.jsx)("a",{"aria-label":a("version:preview"),className:"preview-btn",href:n,id:"preview-button",target:"_blank",title:a("version:preview"),children:(0,h.jsx)(vQ,{})}),r[0]=n,r[1]=a,r[2]=t):t=r[2],t):null}var vJ="table",vZ=({appearance:e,BeforeTable:t,columns:r,data:n})=>{let a=r?.filter(e=>e?.active);return a&&0!==a.length?(0,h.jsxs)("div",{className:[vJ,e&&`${vJ}--appearance-${e}`].filter(Boolean).join(" "),children:[t,(0,h.jsxs)("table",{cellPadding:"0",cellSpacing:"0",children:[(0,h.jsx)("thead",{children:(0,h.jsx)("tr",{children:a.map((e,t)=>(0,h.jsx)("th",{id:`heading-${e.accessor.replace(/\./g,"__")}`,children:e.Heading},t))})}),(0,h.jsx)("tbody",{children:n&&n?.map((e,t)=>(0,h.jsx)("tr",{className:`row-${t+1}`,"data-id":e.id,children:a.map((e,r)=>{let{accessor:n}=e;return(0,h.jsx)("td",{className:`cell-${n.replace(/\./g,"__")}`,children:e.renderedCells[t]},r)})},"string"==typeof e.id||"number"==typeof e.id?String(e.id):t))})]})]}):(0,h.jsx)("div",{children:"No columns selected"})},v0="schedule-publish",v1={label:"All",value:"all"},v2=({slug:e,defaultType:t,schedulePublishConfig:r})=>{let{toggleModal:n}=lc(),{config:{admin:{dateFormat:a,timezones:{defaultTimezone:l,supportedTimezones:i}},localization:o,routes:{api:s}}}=(0,d.c)(),{id:u,collectionSlug:p,globalSlug:g}=oD(),{title:b}=ow(),{i18n:v,t:y}=(0,f.d)(),{schedulePublish:x}=fg(),[w,C]=c.default.useState(t||"publish"),[j,S]=c.default.useState(),[$,_]=c.default.useState(l),[k,E]=c.default.useState(v1),[N,P]=c.default.useState(!1),T=y("general:schedulePublishFor",{title:b}),[D,R]=c.default.useState(),[A,O]=c.default.useState(),L=c.default.useRef(()=>null),M=Intl.DateTimeFormat().resolvedOptions().timeZone,I=c.default.useMemo(()=>{if(o){let e=o.locales.map(({code:e,label:t})=>({label:m(t,v),value:e}));return e.unshift(v1),e}return[]},[o,v]),F=c.default.useCallback(async()=>{let e={sort:"waitUntil",where:{and:[{taskSlug:{equals:"schedulePublish"}},{waitUntil:{greater_than:new Date}}]}};p&&(e.where.and.push({"input.doc.value":{equals:String(u)}}),e.where.and.push({"input.doc.relationTo":{equals:p}})),g&&e.where.and.push({"input.global":{equals:g}});let{docs:t}=await iw.post(tR({apiRoute:s,path:"/payload-jobs"}),{body:t6(e),headers:{"Accept-Language":v.language,"Content-Type":"application/x-www-form-urlencoded","X-Payload-HTTP-Method-Override":"GET"}}).then(e=>e.json());O((({dateFormat:e,deleteHandler:t,docs:r,i18n:n,localization:a,supportedTimezones:l,t:i})=>{let o=[{accessor:"input.type",active:!0,field:{name:"",type:"text"},Heading:(0,h.jsx)("span",{children:i("version:type")}),renderedCells:r.map(e=>{let t=e.input?.type;return(0,h.jsxs)(sl,{pillStyle:"publish"===t?"success":"warning",size:"small",children:["publish"===t&&i("version:publish"),"unpublish"===t&&i("version:unpublish")]},e.id)})},{accessor:"waitUntil",active:!0,field:{name:"",type:"date"},Heading:(0,h.jsx)("span",{children:i("general:time")}),renderedCells:r.map(t=>(0,h.jsx)("span",{children:om({date:t.waitUntil,i18n:n,pattern:e,timezone:t.input.timezone})},t.id))},{accessor:"input.timezone",active:!0,field:{name:"",type:"text"},Heading:(0,h.jsx)("span",{children:i("general:timezone")}),renderedCells:r.map(e=>{let t=l.find(t=>t.value===e.input.timezone)?.label||e.input.timezone;return(0,h.jsx)("span",{children:t||i("general:noValue")},e.id)})}];return a&&o.push({accessor:"input.locale",active:!0,field:{name:"",type:"text"},Heading:(0,h.jsx)("span",{children:i("general:locale")}
49),renderedCells:r.map(e=>{if(e.input.locale){let t=a.locales.find(t=>t.code===e.input.locale);if(t)return(0,h.jsx)("span",{children:m(t.label,n)},e.id)}return(0,h.jsx)("span",{children:i("general:all")},e.id)})}),o.push({accessor:"delete",active:!0,field:{name:"delete",type:"text"},Heading:(0,h.jsx)("span",{children:i("general:delete")}),renderedCells:r.map(e=>(0,h.jsx)(au,{buttonStyle:"icon-label",className:"schedule-publish__delete",icon:"x",onClick:r=>{r.preventDefault(),t(e.id)},tooltip:i("general:delete")},e.id))}),o})({dateFormat:a,deleteHandler:L.current,docs:t,i18n:v,localization:o,supportedTimezones:i,t:y})),R(t)},[p,g,s,v,a,o,i,y,u]),B=c.default.useCallback(async e=>{try{await x({deleteID:e}),await F(),nI.success(y("general:deletedSuccessfully"))}catch(e){console.error(e),nI.error(e.message)}},[F,x,y]);c.default.useEffect(()=>{L.current=B},[B]);let z=c.default.useCallback(async()=>{let e;if(!j)return nI.error(y("general:noDateSelected"));P(!0),"object"==typeof k&&"all"!==k.value&&"publish"===w&&(e=k.value);try{await x({type:w,date:j,doc:p?{relationTo:p,value:String(u)}:void 0,global:g||void 0,localeToPublish:e,timezone:$}),S(void 0),nI.success(y("version:scheduledSuccessfully")),F()}catch(e){console.error(e),nI.error(e.message)}P(!1)},[j,k,w,y,x,p,u,g,$,F]),U=(0,c.useMemo)(()=>{if($&&M&&j){let e=iU.tz($),t=iU.tz(M),r=oh(new iU(j).withTimeZone($),e);return oh(r,t).toISOString()}return j},[$,j,M]),V=(0,c.useCallback)(e=>{if($&&e){let t=iU.tz($);S(oh(new iU(e),t)||null)}else S(e||null)},[S,$]);c.default.useEffect(()=>{D||(async()=>await F())()},[D,F]);let H=(0,c.useMemo)(()=>j&&function(e,t){let[r,n]=i0(void 0,e,t);return+i1(r)==+i1(n)}(iW(j,j),i3(j))?new Date:i1(new Date),[j]);return(0,h.jsxs)(ip,{className:v0,gutter:!1,Header:(0,h.jsxs)("div",{className:`${v0}__drawer-header`,children:[(0,h.jsx)("h2",{title:T,children:T}),(0,h.jsx)(hL,{onClick:()=>n(e)})]}),slug:e,children:[(0,h.jsxs)(io,{className:`${v0}__scheduler`,children:[(0,h.jsx)(iR,{label:y("version:type"),required:!0}),(0,h.jsxs)("ul",{className:`${v0}__type`,children:[(0,h.jsx)("li",{children:(0,h.jsx)(p$,{id:`${e}-type`,isSelected:"publish"===w,onChange:()=>C("publish"),option:{label:y("version:publish"),value:"publish"},path:`${e}-type`,readOnly:N})}),(0,h.jsx)("li",{children:(0,h.jsx)(p$,{id:`${e}-type`,isSelected:"unpublish"===w,onChange:()=>C("unpublish"),option:{label:y("version:unpublish"),value:"unpublish"},path:`${e}-type`,readOnly:N})})]}),(0,h.jsx)("br",{}),(0,h.jsx)(iR,{label:y("general:time"),path:"time",required:!0}),(0,h.jsx)(sI,{id:"time",maxTime:i6(Date.now(),void 0),minDate:new Date,minTime:H,onChange:e=>V(e),pickerAppearance:"dayAndTime",readOnly:N,timeFormat:r?.timeFormat,timeIntervals:r?.timeIntervals??5,value:U}),i.length>0&&(0,h.jsx)(d2,{id:"timezone-picker",onChange:_,options:i,selectedTimezone:$}),(0,h.jsx)("br",{}),I.length>0&&"publish"===w&&(0,h.jsxs)(c.default.Fragment,{children:[(0,h.jsx)(iR,{label:y("localization:localeToPublish")}),(0,h.jsx)(d0,{onChange:e=>E(e),options:I,value:k}),(0,h.jsx)("br",{})]}),(0,h.jsxs)("div",{className:`${v0}__actions`,children:[(0,h.jsx)(au,{buttonStyle:"primary",disabled:N,id:"scheduled-publish-save",onClick:z,type:"button",children:y("general:save")}),N?(0,h.jsx)("span",{children:y("general:saving")}):null]})]}),(0,h.jsxs)(io,{className:`${v0}__upcoming`,children:[(0,h.jsx)("h4",{children:y("general:upcomingEvents")}),!D&&(0,h.jsx)(d.f,{}),D?.length===0&&(0,h.jsx)(nJ,{type:"info",children:y("general:noUpcomingEventsScheduled")}),D?.length>0&&(0,h.jsx)(vZ,{appearance:"condensed",columns:A,data:D})]})]})};function v3({label:e}={}){let{id:t,collectionSlug:r,globalSlug:n,hasPublishedDoc:a,hasPublishPermission:l,setHasPublishedDoc:i,setMostRecentVersionIsAutosaved:o,setUnpublishedVersionCount:s,unpublishedVersionCount:u,uploadStatus:p}=oD(),{config:g,getEntityConfig:b}=(0,d.c)(),{submit:v}=nm(),y=nw(),x=a0(),{code:w}=iP(),{isModalOpen:C,toggleModal:j}=lc(),S=`schedule-publish-${t}`,{localization:$,routes:{api:_}}=g,{i18n:k,t:E}=(0,f.d)(),N=e||E("version:publishChanges"),P=c.default.useMemo(()=>r?b({collectionSlug:r}):n?b({globalSlug:n}):void 0,[r,n,b]),T=u>0,D=l&&(y||T||!a)&&"uploading"!==p,R=rC(P),A=rx(P),O=!!(R&&l&&(n||r&&t)&&(A||!y)),[L,M]=(0,c.useState)(!1);(0,c.useEffect)(()=>{M(vF(P?.fields))},[P?.fields]);let I=$&&L&&l,F="update"===oM()&&!y,B=(0,c.useCallback)(async()=>
49{if(F)return;let e=t6({depth:0,draft:!0,"fallback-locale":"null",locale:w},{addQueryPrefix:!0}),a,l="POST";r&&(a=tR({apiRoute:_,path:`/${r}${t?`/${t}`:""}${e}`}),t&&(l="PATCH")),n&&(a=tR({apiRoute:_,path:`/globals/${n}${e}`})),await v({action:a,method:l,overrides:{_status:"draft"},skipValidation:!0})},[F,w,r,n,v,_,t]);g5({cmdCtrlKey:!0,editDepth:x,keyCodes:["s"]},e=>{e.preventDefault(),e.stopPropagation(),B&&A&&B()});let z=ry(P),U=(0,c.useCallback)(async()=>{if("uploading"===p)return;let e=t6({depth:0,locale:w,...z&&{publishAllLocales:!0}},{addQueryPrefix:!0}),a=tR({apiRoute:_,path:`${n?`/globals/${n}`:`/${r}${t?`/${t}`:""}`}${e}`});await v({action:a,overrides:{_status:"published"}})&&(s(0),o(!1),i(!0))},[w,z,_,r,n,t,i,v,s,p,o]),V=(0,c.useCallback)(async e=>{if("uploading"===p)return;let a=t6({depth:0,locale:e,publishSpecificLocale:e},{addQueryPrefix:!0}),l=n?`/globals/${n}`:`/${r}${t?`/${t}`:""}`,c=tR({apiRoute:_,path:`${l}${a}`});await v({action:c,overrides:{_status:"published"}})&&(s(0),o(!1),i(!0))},[_,r,n,t,i,o,s,v,p]),H=!I||$&&$?.defaultLocalePublishOption!=="active",q=$&&$?.locales.find(e=>"string"==typeof e?e===w:e.code===w),K=q&&m(q.label,k);return l?(0,h.jsxs)(c.default.Fragment,{children:[(0,h.jsx)(mo,{buttonId:"action-save",disabled:!D,enableSubMenu:O,onClick:H?U:()=>V(q.code),size:"medium",SubMenuPopupContent:I||O?({close:e})=>(0,h.jsxs)(c.default.Fragment,{children:[O&&(0,h.jsx)(n6.ButtonGroup,{children:(0,h.jsx)(n6.Button,{id:"schedule-publish",onClick:()=>[j(S),e()],children:E("version:schedulePublish")})},"schedule-publish"),I&&(0,h.jsx)(n6.ButtonGroup,{children:(0,h.jsx)(n6.Button,{id:"publish-locale",onClick:H?()=>V(q.code):U,children:H?E("version:publishIn",{locale:K}):E("version:publishAllLocales")})})]}):void 0,type:"button",children:H?N:E("version:publishIn",{locale:K})}),O&&C(S)&&(0,h.jsx)(v2,{defaultType:T?"publish":"unpublish",schedulePublishConfig:R&&"object"==typeof P.versions.drafts.schedulePublish?P.versions.drafts.schedulePublish:void 0,slug:S})]}):null}var v6="restore-button",v5=e=>{let{id:t,buttonId:r,collectionSlug:n,onRestore:a,redirectAfterRestore:l=!0,singularLabel:i,title:o}=e,{config:{routes:{admin:s,api:u},serverURL:p},getEntityConfig:g}=(0,d.c)(),v=g({collectionSlug:n}),y=(0,b.useRouter)(),{i18n:x,t:w}=(0,f.d)(),{title:C}=ow(),{startRouteTransition:j}=nK(),{openModal:S}=lc(),$=`restore-${t}`,[_,k]=(0,c.useState)(!1),E=(0,c.useCallback)(()=>{nI.error(w("error:restoringTitle",{title:C}))},[w,C]),N=(0,c.useCallback)(async()=>{try{let e=tR({apiRoute:u,path:`/${n}${t6({trash:!0,where:{and:[{id:{equals:t}},{deletedAt:{exists:!0}}]}},{addQueryPrefix:!0})}`}),r={deletedAt:null};v?.versions?.drafts&&(r._status=_?"published":"draft");let o=await iw.patch(e,{body:JSON.stringify(r),headers:{"Accept-Language":x.language,"Content-Type":"application/json"}}),c=await o.json();if(o.status<400){if(nI.success(w("general:titleRestored",{label:m(i,x),title:C})||c.message),l)return j(()=>y.push(tR({adminRoute:s,path:`/collections/${n}/${t}`,serverURL:p}
49)));"function"==typeof a&&await a({id:t,collectionConfig:v});return}c.errors?c.errors.forEach(e=>nI.error(e.message)):E()}catch{E()}},[p,u,n,t,w,i,E,x,C,y,s,l,a,v,j,_]);return t?(0,h.jsxs)(c.Fragment,{children:[(0,h.jsx)(au,{buttonStyle:"primary",id:r,onClick:()=>{S($)},children:w("general:restore")},r),(0,h.jsx)(iv,{body:(0,h.jsxs)(c.Fragment,{children:[(0,h.jsx)(mh,{elements:{1:({children:e})=>(0,h.jsx)("strong",{children:e})},i18nKey:v?.versions?.drafts?"general:aboutToRestoreAsDraft":"general:aboutToRestore",t:w,variables:{label:m(i,x),title:o||C||t}}),v?.versions?.drafts&&(0,h.jsx)("div",{className:`${v6}__checkbox`,children:(0,h.jsx)(oX,{checked:_,id:"restore-as-published",label:w("general:restoreAsPublished"),name:"restore-as-published",onToggle:e=>k(e.target.checked)})})]}),className:v6,confirmingLabel:w("general:restoring"),heading:w("general:confirmRestoration"),modalSlug:$,onConfirm:N})]}):null};function v4({label:e}){let{uploadStatus:t}=oD(),{t:r}=(0,f.d)(),{submit:n}=nm(),a=nw(),l=e||r("general:save"),i=(0,c.useRef)(null),o=a0(),s="update"===oM()&&!a||"uploading"===t;return g5({cmdCtrlKey:!0,editDepth:o,keyCodes:["s"]},e=>{e.preventDefault(),e.stopPropagation(),i?.current&&i.current.click()}),(0,h.jsx)(mo,{buttonId:"action-save",disabled:s,onClick:()=>{"uploading"!==t&&n()},ref:i,size:"medium",type:"button",children:l})}function v8(e){let{config:{routes:{api:t}}}=(0,d.c)(),{id:r,collectionSlug:n,globalSlug:a,setUnpublishedVersionCount:l,uploadStatus:i}=oD(),o=nw(),{code:s}=iP(),u=(0,c.useRef)(null),p=a0(),{t:m}=(0,f.d)(),{submit:g}=nm(),b="update"===oM()&&!o||"uploading"===i,v=(0,c.useCallback)(async()=>{if(b)return;let e=`?locale=${s}&depth=0&fallback-locale=null&draft=true`,i,o="POST";n&&(i=tR({apiRoute:t,path:`/${n}${r?`/${r}`:""}${e}`}),r&&(o="PATCH")),a&&(i=tR({apiRoute:t,path:`/globals/${a}${e}`})),await g({action:i,method:o,overrides:{_status:"draft"},skipValidation:!0}),l(e=>e+1)},[g,n,a,t,s,r,b,l]);return g5({cmdCtrlKey:!0,editDepth:p,keyCodes:["s"]},e=>{e.preventDefault(),e.stopPropagation(),u?.current&&u.current.click()}),(0,h.jsx)(mo,{buttonId:"action-save-draft",buttonStyle:"secondary",className:"save-draft",disabled:b,onClick:()=>{v()},ref:u,size:"medium",type:"button",children:m("version:saveDraft")})}var v7="status",v9=()=>{let{id:e,collectionSlug:t,docPermissions:r,globalSlug:n,hasPublishedDoc:a,incrementVersionCount:l,isTrashed:i,setMostRecentVersionIsAutosaved:o,setUnpublishedVersionCount:s,unpublishedVersionCount:u}=oD(),{toggleModal:p}=lc(),{config:{routes:{api:m}}}=(0,d.c)(),{reset:g}=nm(),{code:b}=iP(),{i18n:v,t:y}=(0,f.d)(),x=`confirm-revert-${e}`,w;u>0&&a?w="changed":a?a&&u<=0&&(w="published"):w="draft";let C=i?a?"previouslyPublished":"previouslyDraft":w,j=(0,c.useCallback)(async()=>{let r,a;t&&(r=tR({apiRoute:m,path:`/${t}/${e}?locale=${b}&fallback-locale=null&depth=0`}),a="patch"),n&&(r=tR({apiRoute:m,path:`/globals/${n}?locale=${b}&fallback-locale=null&depth=0`}),a="post");let i=await iw.get(r,{headers:{"Accept-Language":v.language,"Content-Type":"application/json"}}).then(e=>e.json()),c=await iw[a](r,{body:JSON.stringify(i),headers:{"Accept-Language":v.language,"Content-Type":"application/json"}});if(200===c.status){let e,r=await c.json();n?e=r.result:t&&(e=r.doc),g(e),nI.success(r.message),l(),o(!1),s(0)}else try{let e=await c.json();e.errors?.[0]?.message?nI.error(e.errors[0].message):e.error?nI.error(e.error):nI.error(y("error:revertingDocument"))}catch{nI.error(y("error:revertingDocument"))}},[m,t,n,e,v.language,l,b,g,s,o,y]),S=r?.update;return w?(0,h.jsx)("div",{className:v7,title:`${y("version:status")}: ${y(`version:${C}`)}`,children:(0,h.jsxs)("div",{className:`${v7}__value-wrap`,children:[(0,h.jsxs)("span",{className:`${v7}__label`,children:[y("version:status"),": "]}),(0,h.jsx)("span",{className:`${v7}__value`,children:y(`version:${C}`)}),!i&&S&&a&&"changed"===w&&(0,h.jsxs)(c.default.Fragment,{children:[" — ",(0,h.jsx)(au,{buttonStyle:"none",className:`${v7}__action`,id:"action-revert-to-published",onClick:()=>p(x),children:y("version:revertToPublished")}),(0,h.jsx)(iv,{body:y("version:aboutToRevertToPublished"),confirmingLabel:y("version:reverting"),heading:y("version:confirmRevertToSaved"),modalSlug:x,onConfirm:()=>j()})]})]})}):null};function ye({label:e}={}){let{id:t,collectionSlug:r,data:n,globalSlug:a,hasPublishedDoc:l,hasPublishPermission:i,incrementVersionCount:o,isTrashed:s,setHasPublishedDoc:u,setMostRecentVersionIsAutosaved:p,setUnpublishedVersionCount:g}=oD(),{toggleModal:b}=lc(),{config:v,getEntityConfig:y}=(0,d.c)(),{reset:x}=nm(),{code:w,label:C}=iP(),[j,S]=(0,c.useState)(!1),[$,_]=(0,c.useState)(!1),k=`confirm-un-publish-${t}`,{routes:{api:E},serverURL:N}=v,{i18n:P,t:T}=(0,f.d)(),D=c.default.useMemo(()=>r?y({collectionSlug:r}):a?y({globalSlug:a}):void 0,[r,a,y]),R=(0,c.useCallback)(e=>{(async()=>{let l,i,s=t6({depth:0,"fallback-locale":"null",locale:e?void 0:w,unpublishAllLocales:e},{addQueryPrefix:!0});r&&(l=tR({apiRoute:E,path:`/${r}/${t}${s}`,serverURL:N}),i="patch"),a&&(l=tR({apiRoute:E,path:`/globals/${a}${s}`,serverURL:N}),i="post");try{let e=await iw[i](l,{body:JSON.stringify({_status:"draft"}),headers:{"Accept-Language":P.language,"Content-Type":"application/json"}});if(200===e.status)x({...n||{},_status:"draft"}),nI.success(T("version:unpublishedSuccessfully")),o(),g(1),p(!1),u(!1);else try{let t=await e.json();t.errors?.[0]?.message?nI.error(t.errors[0].message):t.error?nI.error(t.error):nI.error(T("error:unPublishingDocument"))}catch{nI.error(T("error:unPublishingDocument"))}}catch{nI.error(T("error:unPublishingDocument"))}})().catch(()=>{nI.error(T("error:unPublishingDocument"))})},[n,x,r,a,N,E,w,t,P.language,o,u,p,g,T]);(0,c.useEffect)(()=>{_(vF(D?.fields))},[D?.fields]);let A=D?.versions?.drafts,O="object"==typeof A&&null!==A,L=c.default.useMemo(()=>O&&i&&l&&!s,[i,l,s,O]),M=c.default.useMemo(()=>
49{if(!L||!$)return!1;let e=A&&!0===A.localizeStatus,t=v.experimental?.localizeStatus===!0;return e&&t},[L,$,A,v.experimental?.localizeStatus]),I=m(C,P);return L?(0,h.jsxs)(c.default.Fragment,{children:[(0,h.jsx)(n6.Button,{id:"action-unpublish",onClick:()=>{S(!0),b(k)},children:e||T("version:unpublish")}),M&&(0,h.jsx)(n6.Button,{id:"action-unpublish-locale",onClick:()=>{S(!1),b(k)},children:e?`${e} [${I}]`:T("version:unpublishIn",{locale:I})}),(0,h.jsx)(iv,{body:j?T("version:aboutToUnpublish"):T("version:aboutToUnpublishIn",{locale:I}),confirmingLabel:T("version:unpublishing"),heading:T("version:confirmUnpublish"),modalSlug:k,onConfirm:()=>R(j)})]}):null}var yt="doc-controls",yr=e=>{let t=(0,v.c)(5),{id:r,slug:n,BeforeDocumentControls:a,customComponents:l,data:i,disableActions:o,disableCreate:s,EditMenuItems:u,hasSavePermission:p,isAccountView:g,isEditing:b,isInDrawer:y,isTrashed:x,onDelete:w,onDrawerCreateNew:C,onDuplicate:j,onRestore:S,onTakeOver:$,permissions:_,readOnlyForIncomingUser:k,redirectAfterDelete:E,redirectAfterDuplicate:N,redirectAfterRestore:P,user:T}=e,{PreviewButton:D,PublishButton:R,SaveButton:A,SaveDraftButton:O,Status:L,UnpublishButton:M}=void 0===l?{}:l,{i18n:I,t:F}=(0,f.d)(),B=a0(),{config:z,getEntityConfig:U}=(0,d.c)(),V=U({collectionSlug:n}),H=U({globalSlug:n}),{isLivePreviewEnabled:q}=vA(),{hasDeletePermission:K,hasTrashPermission:W}=oD(),{admin:G,localization:Y,routes:Q}=z,{dateFormat:X}=G,{admin:J}=Q,[Z,ee]=c.default.useState(""),[et,er]=c.default.useState(""),en=ny(),ea=nC(),el,ei;t[0]!==i||t[1]!==X||t[2]!==I?(el=()=>{i?.updatedAt&&ee(om({date:i.updatedAt,i18n:I,pattern:X})),i?.createdAt&&er(om({date:i.createdAt,i18n:I,pattern:X}))},ei=[i,I,X],t[0]=i,t[1]=X,t[2]=I,t[3]=el,t[4]=ei):(el=t[3],ei=t[4]),(0,c.useEffect)(el,ei);let eo=_&&"create"in _&&_.create,es=_&&"delete"in _&&_.delete,ec=V?.trash?W||K:es,eu=!!(V&&r&&!o&&(eo||ec)),ed=!r&&V?.versions?.drafts&&V.versions?.drafts.validate,ef=rv(H),ep=rv(V),eh=rx(V),em=rx(H),eg=eh||em,eb=eh&&!1!==V.versions.drafts.autosave&&!0===V.versions.drafts.autosave.showSaveDraftButton||em&&!1!==H.versions.drafts.autosave&&!0===H.versions.drafts.autosave.showSaveDraftButton,ev=Y&&!V?.admin?.disableCopyToLocale,ey=V&&V.folders,ex=T&&k;return(0,h.jsxs)(io,{className:yt,children:[(0,h.jsxs)("div",{className:`${yt}__wrapper`,children:[(0,h.jsxs)("div",{className:`${yt}__content`,children:[ex||ey?(0,h.jsxs)("div",{className:`${yt}__meta-icons`,children:[ex&&(0,h.jsx)(vG,{className:`${yt}__locked-controls`,user:T}),ey&&z.folders&&!x&&(0,h.jsx)(mD,{folderCollectionSlug:z.folders.slug,folderFieldName:z.folders.fieldName})]}):null,(0,h.jsxs)("ul",{className:`${yt}__meta`,children:[V&&!b&&!g&&(0,h.jsx)("li",{className:`${yt}__list-item`,children:(0,h.jsx)("p",{className:`${yt}__value`,children:I.t("general:creatingNewLabel",{label:m(V?.labels?.singular??I.t("general:document"),I)})})}),(ep||ef)&&(0,h.jsxs)(c.Fragment,{children:[(H||V&&b)&&(0,h.jsx)("li",{className:[`${yt}__status`,`${yt}__list-item`].filter(Boolean).join(" "),children:(0,h.jsx)(r7,{CustomComponent:L,Fallback:(0,h.jsx)(v9,{})})}),p&&eg&&!ed&&!x&&(0,h.jsx)("li",{className:`${yt}__list-item`,children:(0,h.jsx)(vL,{collection:V,global:H,id:r,publishedDocUpdatedAt:i?.createdAt})})]}),V?.timestamps&&(b||g)&&(0,h.jsxs)(c.Fragment,{children:[(0,h.jsxs)("li",{className:[`${yt}__list-item`,`${yt}__value-wrap`].filter(Boolean).join(" "),title:i?.updatedAt?Z:"",children:[(0,h.jsxs)("p",{className:`${yt}__label`,children:[I.t(x?"general:deleted":"general:lastModified"),": "]}),i?.updatedAt&&(0,h.jsx)("p",{className:`${yt}__value`,children:Z})]}),(0,h.jsxs)("li",{className:[`${yt}__list-item`,`${yt}__value-wrap`].filter(Boolean).join(" "),title:i?.createdAt?et:"",children:[(0,h.jsxs)("p",{className:`${yt}__label`,children:[I.t("general:created"),": "]}),i?.createdAt&&(0,h.jsx)("p",{className:`${yt}__value`,children:et})]})]})]})]}),(0,h.jsxs)("div",{className:`${yt}__controls-wrapper`,children:[(0,h.jsxs)("div",{className:`${yt}__controls`,children:[a,q&&!y&&(0,h.jsx)(vq,{}),(V?.admin.preview||H?.admin.preview)&&(0,h.jsx)(r7,{CustomComponent:D,Fallback:(0,h.jsx)(vX,{})}),p&&!x&&(0,h.jsx)(c.Fragment,{children:ep||ef?(0,h.jsxs)(c.Fragment,{children:[(ed||!eg||eg&&eb)&&(0,h.jsx)(r7,{CustomComponent:O,Fallback:(0,h.jsx)(v8,{})}),(0,h.jsx)(r7,{CustomComponent:R,Fallback:(0,h.jsx)(v3,{})})]}):(0,h.jsx)(r7,{CustomComponent:A,Fallback:(0,h.jsx)(v4,{})})}),K&&x&&(0,h.jsx)(vY,{buttonId:"action-permanently-delete",collectionSlug:V?.slug,id:r.toString(),onDelete:w,redirectAfterDelete:E,singularLabel:V?.labels?.singular}),p&&x&&(0,h.jsx)(v5,{buttonId:"action-restore",collectionSlug:V?.slug,id:r.toString(),onRestore:S,redirectAfterRestore:P,singularLabel:V?.labels?.singular}),T&&k&&(0,h.jsx)(au,{buttonStyle:"secondary",id:"take-over",onClick:$,size:"medium",type:"button",children:F("general:takeOver")})]}),eu&&!k&&(0,h.jsx)(al,{button:(0,h.jsxs)("div",{className:`${yt}__dots`,children:[(0,h.jsx)("div",{}),(0,h.jsx)("div",{}),(0,h.jsx)("div",{})]}),className:`${yt}__popup`,disabled:ea||en,horizontalAlign:"right",size:"large",verticalAlign:"bottom",children:(0,h.jsxs)(n6.ButtonGroup,{children:[ev&&(0,h.jsx)(vw,{}),eo&&(0,h.jsxs)(c.default.Fragment,{children:[!s&&(0,h.jsx)(c.Fragment,{children:B>1?(0,h.jsx)(n6.Button,{id:"action-create",onClick:C,children:I.t("general:createNew")}):(0,h.jsx)(n6.Button,{href:tR({adminRoute:J,path:`/collections/${V?.slug}/create`}),id:"action-create",children:I.t("general:createNew")})}),!0!==V.disableDuplicate&&b&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(vU,{id:r,onDuplicate:j,redirectAfterDuplicate:N,singularLabel:V?.labels?.singular,slug:V?.slug}),Y&&(0,h.jsx)(vU,{id:r,onDuplicate:j,redirectAfterDuplicate:N,selectLocales:!0,singularLabel:V?.labels?.singular,slug:V?.slug})]})]}),ec&&(0,h.jsx)(vI,{buttonId:"action-delete",collectionSlug:V?.slug,id:r.toString(),onDelete:w,redirectAfterDelete:E,singularLabel:V?.labels?.singular,useAsTitle:V?.admin?.useAsTitle}),(0,h.jsx)(r7,{CustomComponent:M,Fallback:(0,h.jsx)(ye,{})}),u]})})]})]}),(0,h.jsx)("div",{className:`${yt}__divider`})]})},yn=/^<(?<name>[^\s/>]+)[^>]*>$/,ya=/^<(?<isEnd>\/)?(?<name>[^\s>]+)[^>]*>$/,yl=/^<[^>]+>/,yi=/^<img[^>]*>$/,yo=/^<video[^>]*>.*?<\/video>$/ms,ys=class{config;leastCommonLength=1/0;matchedBlockList=[];newTokens=[];oldTokens=[];operationList=[];sideBySideContents;unifiedContent;constructor(e,t,{classNames:r={createBlock:"html-diff-create-block-wrapper",createInline:"html-diff-create-inline-wrapper",deleteBlock:"html-diff-delete-block-wrapper",deleteInline:"html-diff-delete-inline-wrapper"},greedyBoundary:n=1e3,greedyMatch:a=!0,minMatchedSize:l=2,tokenizeByCh
49aracter:i=!1}={}){if(this.config={classNames:{createBlock:"html-diff-create-block-wrapper",createInline:"html-diff-create-inline-wrapper",deleteBlock:"html-diff-delete-block-wrapper",deleteInline:"html-diff-delete-inline-wrapper",...r},greedyBoundary:n,greedyMatch:a,minMatchedSize:l},(e=e.trim())===(t=t.trim())){this.unifiedContent=e;let t=0,r=e.replace(/<([^\s/>]+)[^>]*>/g,(e,r)=>{let n=r.length+1;return`${e.slice(0,n)} data-seq="${++t}"${e.slice(n)}`});this.sideBySideContents=[r,r];return}let o=i?this.tokenizeByCharacter:this.tokenizeByWord;this.oldTokens=o(e),this.newTokens=o(t),this.matchedBlockList=this.getMatchedBlockList(),this.operationList=this.getOperationList()}computeBestMatchedBlock(e,t,r,n){let a=null;for(let l=e;l<t;l++){let e=Math.min(t-l,n-r),i=this.slideBestMatchedBlock(l,r,e);if(i&&(!a||i.size>a.size)&&(a=i,i.size>this.leastCommonLength))return a}for(let l=r;l<n;l++){let r=Math.min(t-e,n-l),i=this.slideBestMatchedBlock(e,l,r);if(i&&(!a||i.size>a.size)&&(a=i,i.size>this.leastCommonLength))break}return a}computeMatchedBlockList(e,t,r,n,a=[]){let l=this.computeBestMatchedBlock(e,t,r,n);return l?(e<l.oldStart&&r<l.newStart&&this.computeMatchedBlockList(e,l.oldStart,r,l.newStart,a),a.push(l),t>l.oldEnd&&n>l.newEnd&&this.computeMatchedBlockList(l.oldEnd,t,l.newEnd,n,a),a):[]}dressUpBlockTag(e,t){return"create"===e?`<div class="${this.config.classNames.createBlock}">${t}</div>`:"delete"===e?`<div class="${this.config.classNames.deleteBlock}">${t}</div>`:""}dressUpDiffContent(e,t){let r=t.length;if(!r)return"";let n="",a=0,l=-1;for(let r of t){l++;let i=r.includes('data-enable-match="true"'),o=r.includes('data-enable-match="false"'),s=!!r.match(yl)?.length;o?(a=l+1,n+=r):!i&&s?(l>a&&(n+=this.dressUpText(e,t.slice(a,l))),a=l+1,r.match(yo)?n+=this.dressUpBlockTag(e,r):n+=r):i&&s&&(l>a&&(n+=this.dressUpText(e,t.slice(a,l))),a=l+1,n+=this.dressupMatchEnabledHtmlTag(e,r))}return a<r&&(n+=this.dressUpText(e,t.slice(a))),n}dressUpInlineTag(e,t){return"create"===e?`<span class="${this.config.classNames.createInline}">${t}</span>`:"delete"===e?`<span class="${this.config.classNames.deleteInline}">${t}</span>`:""}dressupMatchEnabledHtmlTag(e,t){let r=t.match(yn)?.groups?.name;if(!r)return t;let n=r.length+1;return`${t.slice(0,n)} data-match-type="${"create"===e?"create":"delete"}"${t.slice(n,t.length)}`}dressUpText(e,t){let r=t.join("");return r.trim()?"create"===e?`<span data-match-type="create">${r}</span>`:"delete"===e?`<span data-match-type="delete">${r}</span>`:"":""}getMatchedBlockList(){let e=this.oldTokens.length,t=this.newTokens.length,r=null,n=0;for(;n<e&&n<t&&this.oldTokens[n]===this.newTokens[n];)n++;n>=this.config.minMatchedSize&&(r={newEnd:n,newStart:0,oldEnd:n,oldStart:0,size:n});let a=null,l=e-1,i=t-1;for(;n<=l&&n<=i&&this.oldTokens[l]===this.newTokens[i];)l--,i--;let o=e-1-l;o>=this.config.minMatchedSize&&(a={newEnd:t,newStart:i+1,oldEnd:e,oldStart:l+1,size:o});let s=r?n:0,c=a?l+1:e,u=r?n:0,d=a?i+1:t;if(this.config.greedyMatch){let e=Math.min(c-s,d-u);e>this.config.greedyBoundary&&(this.leastCommonLength=Math.floor(e/3))}let f=this.computeMatchedBlockList(s,c,u,d);return r&&f.unshift(r),a&&f.push(a),f}getOperationList(){let e=[],t=0,r=0;for(let n of this.matchedBlockList){let a=t===n.oldStart,l=r===n.newStart,i={newEnd:n.newStart,newStart:r,oldEnd:n.oldStart,oldStart:t};a||l?a&&!l?e.push(Object.assign(i,{type:"create"})):!a&&l&&e.push(Object.assign(i,{type:"delete"})):e.push(Object.assign(i,{type:"replace"})),e.push({type:"equal",newEnd:n.newEnd,newStart:n.newStart,oldEnd:n.oldEnd,oldStart:n.oldStart}),t=n.oldEnd,r=n.newEnd}let n=this.oldTokens.length,a=this.newTokens.length,l={newEnd:a,newStart:r,oldEnd:n,oldStart:t},i=t===n,o=r===a;return i||o?i&&!o?e.push(Object.assign(l,{type:"create"})):!i&&o&&e.push(Object.assign(l,{type:"delete"})):e.push(Object.assign(l,{type:"replace"})),e}slideBestMatchedBlock(e,t,r){let n=0,a=null,l=0;for(let i=0;i<r;i++)this.oldTokens[e+i]===this.newTokens[t+i]?l++:l=0,l>n&&(n=l,a={newEnd:t+i+1,newStart:t+i-l+1,oldEnd:e+i+1,oldStart:e+i-l+1,size:l});return n>=this.config.minMatchedSize?a:null}
49tokenizeByCharacter(e){let t=[],r=0,n=/<picture[^>]*>.*?<\/picture>|<video[^>]*>.*?<\/video>|<[^>]+>/gs,a;for(;null!==(a=n.exec(e));){let n=e.substring(r,a.index);if(n)for(let e of n)t.push(e);t.push(a[0]),r=a.index+a[0].length}for(let n of e.substring(r))t.push(n);return t}tokenizeByWord(e){return e.match(/<picture[^>]*>.*?<\/picture>|<video[^>]*>.*?<\/video>|<[^>]+>|\w+\b|\s+|[^<>\w]/gs)||[]}getSideBySideContents(){if(void 0!==this.sideBySideContents)return this.sideBySideContents;let e="",t="",r=0;this.operationList.forEach(n=>{switch(n.type){case"create":t+=this.dressUpDiffContent("create",this.newTokens.slice(n.newStart,n.newEnd));break;case"delete":{let t=this.oldTokens.slice(n.oldStart,n.oldEnd);e+=this.dressUpDiffContent("delete",t);break}case"equal":{let a=this.newTokens.slice(n.newStart,n.newEnd),l="";for(let e of a){let t=e.match(yn);if(t){r+=1;let n=(t?.groups?.name?.length??0)+1;l+=`${e.slice(0,n)} data-seq="${r}"${e.slice(n)}`}else l+=e}e+=l,t+=l;break}case"replace":e+=this.dressUpDiffContent("delete",this.oldTokens.slice(n.oldStart,n.oldEnd)),t+=this.dressUpDiffContent("create",this.newTokens.slice(n.newStart,n.newEnd));break;default:console.error("Richtext diff error - invalid operation: "+String(n.type))}});let n=[e,t];return this.sideBySideContents=n,n}getUnifiedContent(){if(void 0!==this.unifiedContent)return this.unifiedContent;let e="";return this.operationList.forEach(t=>{switch(t.type){case"create":e+=this.dressUpDiffContent("create",this.newTokens.slice(t.newStart,t.newEnd));break;case"delete":e+=this.dressUpDiffContent("delete",this.oldTokens.slice(t.oldStart,t.oldEnd));break;case"equal":for(let r of this.newTokens.slice(t.newStart,t.newEnd))e+=r;break;case"replace":{let r=this.oldTokens.slice(t.oldStart,t.oldEnd),n=this.newTokens.slice(t.newStart,t.newEnd);if(1===r.length&&1===n.length&&r[0]?.match(yl)&&n[0]?.match(yl)){e+=n[0];break}let a=[],l=[],i=t.newStart;for(let r=t.oldStart;r<t.oldEnd;r++){let n=this.oldTokens[r];if(!n)continue;let o=n?.match(ya);if(o){if([yi,yo].some(e=>n?.match(e))){a.push(n);continue}e+=this.dressUpDiffContent("delete",a),a.splice(0);let r=!1;for(let n=i;n<t.newEnd;n++){let t=this.newTokens[n];if(!t)continue;let a=t?.match(ya);if(a&&a.groups?.name===o.groups?.name&&a.groups?.isEnd===o.groups?.isEnd){r=!0,e+=this.dressUpDiffContent("create",l),e+=t,l.splice(0),i=n+1;break}l.push(t)}r||(e+=n,l.splice(0))}else a.push(n)}i<t.newEnd&&l.push(...this.newTokens.slice(i,t.newEnd)),e+=this.dressUpDiffContent("delete",a),e+=this.dressUpDiffContent("create",l);break}default:console.error("Richtext diff error - invalid operation: "+String(t.type))}}),this.unifiedContent=e,e}},yc="html-diff",yu=(0,c.createContext)(null),yd=({children:e})=>{let t=(0,c.useRef)(new Set);return(0,c.useEffect)(()=>{let e=e=>{t.current.forEach(({handler:t,ref:r})=>{r.current&&!r.current.contains(e.target)&&t()})};return document.addEventListener("mousedown",e),()=>document.removeEventListener("mousedown",e)},[]),(0,h.jsx)(yu,{value:{register:e=>t.current.add(e),unregister:e=>t.current.delete(e)},children:e})},yf=()=>{let e=(0,c.use)(yu);if(!e)throw Error("useClickOutside must be used within a ClickOutsideProvider");return e},yp=e=>{let t=(0,v.c)(7),{action:r,disabled:n}=e,{submit:a}=nm(),{t:l}=(0,f.d)(),i;t[0]!==r||t[1]!==a?(i=()=>{a({action:r,method:"PATCH",skipValidation:!0})},t[0]=r,t[1]=a,t[2]=i):i=t[2];let o=i,s;return t[3]!==n||t[4]!==o||t[5]!==l?(s=(0,h.jsx)(mo,{className:`${yb}__save`,disabled:n,onClick:o,children:l("general:save")}),t[3]=n,t[4]=o,t[5]=l,t[6]=s):s=t[6],s},yh=e=>{let t=(0,v.c)(7),{action:r,disabled:n}=e,{submit:a}=nm(),{t:l}=(0,f.d)(),i;t[0]!==r||t[1]!==a?(i=()=>{a({action:r,method:"PATCH",overrides:{_status:"published"},skipValidation:!0})},t[0]=r,t[1]=a,t[2]=i):i=t[2];let o=i,s;return t[3]!==n||t[4]!==o||t[5]!==l?(s=(0,h.jsx)(mo,{className:`${yb}__publish`,disabled:n,onClick:o,children:l("version:publishChanges")}),t[3]=n,t[4]=o,t[5]=l,t[6]=s):s=t[6],s},ym=e=>{let t=(0,v.c)(7),{action:r,disabled:n}=e,{submit:a}=nm(),{t:l}=(0,f.d)(),i;t[0]!==r||t[1]!==a?(i=()=>{a({action:r,method:"PATCH",overrides:{_status:"draft"},skipValidation:!0}
49)},t[0]=r,t[1]=a,t[2]=i):i=t[2];let o=i,s;return t[3]!==n||t[4]!==o||t[5]!==l?(s=(0,h.jsx)(mo,{buttonStyle:"secondary",className:`${yb}__draft`,disabled:n,onClick:o,children:l("version:saveDraft")}),t[3]=n,t[4]=o,t[5]=l,t[6]=s):s=t[6],s},yg=e=>{let{collection:t,collection:{fields:r,labels:{plural:n,singular:a}}={},count:l,drawerSlug:i,ids:o,onSuccess:s,selectAll:u,selectedFields:p,setSelectedFields:g,where:v}=e,{permissions:y,user:x}=iS(),{code:w}=iP(),{closeModal:C}=lc(),{config:{routes:{api:j}}}=(0,d.c)(),{getFormState:S}=fg(),{i18n:$,t:_}=(0,f.d)(),[k,E]=(0,c.useState)(!1),N=(0,b.useRouter)(),P=c.default.useRef(null),T=y?.collections?.[t.slug],D=(0,b.useSearchParams)(),R=(0,c.useMemo)(()=>rE(p.reduce((e,t)=>(e[t.value.path]=!0,e),{})),[p]),A=(0,c.useCallback)(async({formState:e,submitted:r})=>{let n=fO(P),{state:a}=await S({collectionSlug:t.slug,docPermissions:T,docPreferences:null,formState:e,operation:"update",schemaPath:t.slug,select:R,signal:n.signal,skipValidation:!r});return P.current=null,a},[S,t,T,R]);(0,c.useEffect)(()=>{let e=P.current;return()=>{fA(e)}},[]);let O=(0,c.useMemo)(()=>{let e=[];v&&e.push(v);let r=rn({collectionConfig:t,search:D.get("search")});return r&&e.push(r),u?e.push(fc(D)?.where||{id:{not_equals:""}}):e.push({id:{in:o||[]}}),t6({locale:w,select:{},where:rQ(e)},{addQueryPrefix:!0})},[t,D,u,o,w,v]),L=(0,c.useCallback)(async({dispatchFields:e,formState:r,selected:n})=>{E(!0),g(n||[]);let{state:a}=await S({collectionSlug:t.slug,docPermissions:T,docPreferences:null,formState:r,operation:"update",schemaPath:t.slug,select:rE(n.reduce((e,t)=>(e[t.value.path]=!0,e),{})),skipValidation:!0});e({type:"UPDATE_MANY",formState:a}),E(!1)},[S,t.slug,T,g]);return(0,h.jsx)(oA,{collectionSlug:t.slug,currentEditor:x,hasPublishedDoc:!1,id:null,initialData:{},isLocked:!1,lastUpdateTime:0,mostRecentVersionIsAutosaved:!1,unpublishedVersionCount:0,versionCount:0,children:(0,h.jsx)(oO,{value:"update",children:(0,h.jsxs)("div",{className:`${yb}__main`,children:[(0,h.jsxs)("div",{className:`${yb}__header`,children:[(0,h.jsx)("h2",{className:`${yb}__header__title`,children:_("general:editingLabel",{count:l,label:m(l>1?n:a,$)})}),(0,h.jsx)("button",{"aria-label":_("general:close"),className:`${yb}__header__close`,id:`close-drawer__${i}`,onClick:()=>C(i),type:"button",children:(0,h.jsx)(f.a,{})})]}),(0,h.jsxs)(hm,{className:`${yb}__form`,isInitializing:k,onChange:[A],onSuccess:()=>{N.replace(t6({...fc(D),_r:Date.now(),page:u?"1":void 0},{addQueryPrefix:!0})),C(i),"function"==typeof s&&s()},children:[(0,h.jsx)(hQ,{fields:r,onChange:L,permissions:T.fields}),0===p.length?null:(0,h.jsx)("div",{className:"render-fields",children:p.map((e,t)=>{let{value:{field:r,fieldPermissions:n,path:a}}=e;return(0,h.jsx)(gV,{clientFieldConfig:r,indexPath:"",parentPath:"",parentSchemaPath:"",path:a,permissions:n},`${a}-${t}`)})}),(0,h.jsx)("div",{className:`${yb}__sidebar-wrap`,children:(0,h.jsx)("div",{className:`${yb}__sidebar`,children:(0,h.jsx)("div",{className:`${yb}__sidebar-sticky-wrap`,children:(0,h.jsx)("div",{className:`${yb}__document-actions`,children:t?.versions?.drafts?(0,h.jsxs)(c.default.Fragment,{children:[(0,h.jsx)(ym,{action:tR({apiRoute:j,path:`/${t.slug}${O}&draft=true`}),disabled:0===p.length}),(0,h.jsx)(yh,{action:tR({apiRoute:j,path:`/${t.slug}${O}&draft=true`}),disabled:0===p.length})]}):(0,h.jsx)(yp,{action:tR({apiRoute:j,path:`/${t.slug}${O}`}),disabled:0===p.length})})})})})]})]})})})},yb="edit-many",yv=e=>{let t,r,n=(0,v.c)(16),{collection:a,count:l,ids:i,modalPrefix:o,onSuccess:s,selectAll:u,where:d}=e,{permissions:p}=iS(),{openModal:m}=lc(),{t:g}=(0,f.d)(),b;n[0]===Symbol.for("react.memo_cache_sentinel")?(b=[],n[0]=b):b=n[0];let[y,x]=(0,c.useState)(b),w=p?.collections?.[a.slug],C=`${o?`${o}-`:""}edit-${a.slug}`;if(0===l||!w?.update)return null;if(n[1]===Symbol.for("react.memo_cache_sentinel")?(t=[yb,`${yb}__toggle`].filter(Boolean),n[1]=t):t=n[1],n[2]!==a||n[3]!==l||n[4]!==C||n[5]!==i||n[6]!==s||n[7]!==m||n[8]!==u||n[9]!==y||n[10]!==g||n[11]!==d){let e;n[13]!==C||n[14]!==m?(e=()=>{m(C),x([])},n[13]=C,n[14]=m,n[15]=e):e=n[15],r=(0,h.jsxs)("div",{className:t.join(" "),children:[(0,h.jsx)(vP,{"aria-label":g("general:edit"),onClick:e,children:g("general:edit")}),(0,h.jsx)(aZ,{children:(0,h.jsx)(ip,{Header:null,slug:C,children:(0,h.jsx)(yg,{collection:a,count:l,drawerSlug:C,ids:i,onSuccess:s,selectAll:u,selectedFields:y,setSelectedFields:x,where:d})})})]}),n[2]=a,n[3]=l,n[4]=C,n[5]=i,n[6]=s,n[7]=m,n[8]=u,n[9]=y,n[10]=g,n[11]=d,n[12]=r}else r=n[12];return r};function yy(e){let t,r=(0,v.c)(12),{highlightField:n,setKey:a}=e,{id:l}=oD(),{toggleModal:i}=lc(),{t:o}=(0,f.d)(),s=`generate-confirmation-${l}`,u;r[0]!==n||r[1]!==a||r[2]!==o?(u=()=>{a(),nI.success(o("authentication:newAPIKeyGenerated")),n(!0)},r[0]=n,r[1]=a,r[2]=o,r[3]=u):u=r[3];let d=u,p;return r[4]!==s||r[5]!==i?(p=()=>{i(s)},r[4]=s,r[5]=i,r[6]=p):p=r[6],r[7]!==d||r[8]!==s||r[9]!==o||r[10]!==p?(t=(0,h.jsxs)(c.default.Fragment,{children:[(0,h.jsx)(au,{buttonStyle:"secondary",onClick:p,size:"small",children:o("authentication:generateNewAPIKey")}),(0,h.jsx)(iv,{body:(0,h.jsx)(mh,{elements:{1:yx},i18nKey:"authentication:generatingNewAPIKeyWillInvalidate",t:o}
49),confirmLabel:o("authentication:generate"),heading:o("authentication:confirmGeneration"),modalSlug:s,onConfirm:d})]}),r[7]=d,r[8]=s,r[9]=o,r[10]=p,r[11]=t):t=r[11],t}function yx(e){let{children:t}=e;return(0,h.jsx)("strong",{children:t})}var yw="dots",yC=({ariaLabel:e,className:t,noBackground:r,orientation:n="vertical"})=>(0,h.jsxs)("div",{"aria-label":e,className:[t,yw,r&&`${yw}--no-background`,n&&`${yw}--${n}`].filter(Boolean).join(" "),children:[(0,h.jsx)("div",{}),(0,h.jsx)("div",{}),(0,h.jsx)("div",{})]}),yj=({className:e})=>(0,h.jsx)("svg",{className:["icon","icon--people",e].filter(Boolean).join(" "),fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,h.jsx)("path",{className:"stroke",d:"M14 16C14 14.5855 13.4381 13.229 12.4379 12.2288C11.4377 11.2286 10.0812 10.6667 8.66668 10.6667M8.66668 10.6667C7.25219 10.6667 5.89563 11.2286 4.89544 12.2288C3.89525 13.229 3.33334 14.5855 3.33334 16M8.66668 10.6667C10.5076 10.6667 12 9.17428 12 7.33333C12 5.49238 10.5076 4 8.66668 4C6.82573 4 5.33334 5.49238 5.33334 7.33333C5.33334 9.17428 6.82573 10.6667 8.66668 10.6667ZM16.6667 15.3333C16.6667 13.0867 15.3333 11 14 10C14.4383 9.67118 14.7888 9.23939 15.0204 8.74285C15.252 8.2463 15.3577 7.70031 15.328 7.1532C15.2984 6.60609 15.1343 6.07472 14.8503 5.60613C14.5664 5.13754 14.1713 4.74617 13.7 4.46667",strokeLinecap:"round",strokeLinejoin:"round"})}),yS="active-query-preset";function y$(e){let t=(0,v.c)(11),{activePreset:r,openPresetListDrawer:n,resetPreset:a}=e,{i18n:l,t:i}=(0,f.d)(),{getEntityConfig:o}=(0,d.c)(),s;if(t[0]!==r||t[1]!==o||t[2]!==l||t[3]!==n||t[4]!==a||t[5]!==i){let e,c=o({collectionSlug:"payload-query-presets"}),u=r&&`${yS}--active`,d;t[7]!==u?(d=[yS,u].filter(Boolean),t[7]=u,t[8]=d):d=t[8],t[9]!==n?(e=()=>{n()},t[9]=n,t[10]=e):e=t[10],s=(0,h.jsx)(sl,{className:d.join(" "),id:"select-preset",onClick:e,pillStyle:"light",size:"small",children:(0,h.jsxs)("div",{className:`${yS}__label`,children:[r?.isShared&&(0,h.jsx)(yj,{className:`${yS}__shared`}),(0,h.jsx)("div",{className:`${yS}__label-text-max-width`,children:(0,h.jsx)("div",{className:`${yS}__label-text`,children:r?.title||i("general:selectLabel",{label:m(c.labels.singular,l)})})}),r?(0,h.jsx)("div",{className:`${yS}__clear`,id:"clear-preset",onClick:async e=>{e.stopPropagation(),await a()},onKeyDown:async e=>{("Enter"===e.key||" "===e.key)&&(e.stopPropagation(),await a())},role:"button",tabIndex:0,children:(0,h.jsx)(f.a,{})}):null]})}),t[0]=r,t[1]=o,t[2]=l,t[3]=n,t[4]=a,t[5]=i,t[6]=s}else s=t[6];return s}var y_="confirm-delete-preset",yk="payload-query-presets",yE="query-preset-bar",yN=({activePreset:e,collectionSlug:t,queryPresetPermissions:r})=>{let{modified:n,query:a,refineListData:l,setModified:i}=fd(),{i18n:o,t:s}=(0,f.d)(),{openModal:u}=lc(),{config:{routes:{api:p}},getEntityConfig:g}=(0,d.c)(),b=g({collectionSlug:yk}),[v,,{openDrawer:y}]=fV({id:e?.id,collectionSlug:yk}),[x,,{closeDrawer:w,openDrawer:C}]=fV({collectionSlug:yk}),[j,,{closeDrawer:S,openDrawer:$}]=pA({collectionSlugs:[yk],filterOptions:(0,c.useMemo)(()=>({"payload-query-presets":{isTemp:{not_equals:!0},relatedCollection:{equals:t}}}),[t]),selectedCollection:yk}),_=(0,c.useCallback)(async e=>{await l({columns:e.columns?rl(e.columns):void 0,groupBy:e.groupBy||"",preset:e.id,where:e.where},!1)},[l]),k=(0,c.useCallback)(async()=>{await l({columns:[],groupBy:"",preset:"",where:{}},!1)},[l]),E=(0,c.useCallback)(async()=>{try{await fetch(tR({apiRoute:p,path:`/${yk}/${e.id}`}),{method:"DELETE"}).then(async t=>{try{let r=await t.json();t.status<400?(nI.success(s("general:titleDeleted",{label:m(b?.labels?.singular,o),title:e.title})),await k()):r.errors?r.errors.forEach(e=>nI.error(e.message)):nI.error(s("error:deletingTitle",{title:e.title}))}catch{nI.error(s("error:deletingTitle",{title:e.title}))}})}catch{nI.error(s("error:deletingTitle",{title:e.title}))}},[p,e?.id,e?.title,s,b,o,k]),N=(0,c.useCallback)(async()=>{try{await fetch(tR({apiRoute:p,path:`/${yk}/${e.id}`}),{body:JSON.stringify({columns:ra(a.columns),groupBy:a.groupBy,where:a.where}),credentials:"include",headers:{"Content-Type":"application/json"},method:"PATCH"}).then(async e=>{try{let t=await e.json();e.status<400?(nI.success(s("general:updatedLabelSuccessfully",{label:m(b?.labels?.singular,o)}
49)),i(!1)):t.errors?t.errors.forEach(e=>nI.error(e.message)):nI.error(s("error:unknown"))}catch{nI.error(s("error:unknown"))}})}catch{nI.error(s("error:unknown"))}},[p,e?.id,a.columns,a.groupBy,a.where,s,b?.labels?.singular,o,i]),P=e&&n;return(0,h.jsxs)(c.Fragment,{children:[(0,h.jsxs)("div",{className:yE,children:[(0,h.jsxs)("div",{className:`${yE}__menu`,children:[(0,h.jsx)(y$,{activePreset:e,openPresetListDrawer:$,resetPreset:k}),(0,h.jsx)(sl,{"aria-label":s("general:newLabel",{label:b?.labels?.singular}),className:`${yE}__create-new-preset`,icon:(0,h.jsx)(n2,{}),id:"create-new-preset",onClick:()=>{C()},size:"small"})]}),(0,h.jsxs)("div",{className:`${yE}__menu-items`,children:[P&&(0,h.jsx)(vP,{id:"reset-preset",onClick:async()=>{await l({columns:rl(e.columns),groupBy:e.groupBy||"",where:e.where},!1)},type:"button",children:s("general:reset")},"reset"),P&&r.update&&(0,h.jsx)(vP,{id:"save-preset",onClick:async()=>{await N()},type:"button",children:e?.isShared?s("general:updateForEveryone"):s("fields:saveChanges")},"save"),e&&r?.delete&&(0,h.jsxs)(c.Fragment,{children:[(0,h.jsx)(vP,{id:"delete-preset",onClick:()=>u(y_),type:"button",children:s("general:deleteLabel",{label:b?.labels?.singular})}),(0,h.jsx)(vP,{id:"edit-preset",onClick:()=>{y()},type:"button",children:s("general:editLabel",{label:b?.labels?.singular})})]})]})]}),(0,h.jsx)(x,{initialData:{columns:ra(a.columns),groupBy:a.groupBy,relatedCollection:t,where:a.where},onSave:async({doc:e})=>{w(),await _(e)},redirectAfterCreate:!1}),(0,h.jsx)(iv,{body:(0,h.jsx)(mh,{elements:{1:({children:e})=>(0,h.jsx)("strong",{children:e})},i18nKey:"general:aboutToDelete",t:s,variables:{label:b?.labels?.singular,title:e?.title}}),confirmingLabel:s("general:deleting"),heading:s("general:confirmDeletion"),modalSlug:y_,onConfirm:E}),(0,h.jsx)(v,{onDelete:()=>{},onDuplicate:async({doc:e})=>{await _(e)},onSave:async({doc:e})=>{await _(e)}}),(0,h.jsx)(j,{allowCreate:!1,disableQueryPresets:!0,onSelect:async({doc:e})=>{S(),await _(e)}})]})},yP="search-filter";function yT(e){let{handleChange:t,initialParams:r,label:n,searchQueryParam:a}=e,l=r?.search||a,[i,o]=(0,c.useState)("string"==typeof l?l:void 0),s=(0,c.useRef)(!0),u=(0,c.useRef)("string"==typeof l?l:void 0),d=fK(i,300);return(0,c.useEffect)(()=>(l!==u.current&&(s.current=!1,o(l),u.current=l),()=>{s.current=!0,u.current=void 0}),[l]),(0,c.useEffect)(()=>{d!==u.current&&s.current&&(t&&t(d),u.current=d)},[d,t]),(0,h.jsx)("div",{className:yP,children:(0,h.jsx)("input",{"aria-label":n,className:`${yP}__input`,id:"search-filter-input",onChange:e=>{s.current=!0,o(e.target.value)}
49,placeholder:n,type:"text",value:i||""})})}var yD="search-bar";function yR({Actions:e,className:t,label:r="Search...",onSearchChange:n,searchQueryParam:a}){return(0,h.jsxs)("div",{className:[yD,t].filter(Boolean).join(" "),children:[(0,h.jsx)(sg,{}),(0,h.jsx)(yT,{handleChange:n,label:r,searchQueryParam:a}),e&&e.length>0?(0,h.jsx)("div",{className:`${yD}__actions`,children:e}):null]})}var yA="list-controls",yO=e=>{let{beforeActions:t,collectionConfig:r,collectionSlug:n,disableQueryPresets:a,enableColumns:l=!0,enableFilters:i=!0,enableSort:o=!1,listMenuItems:s,queryPreset:u,queryPresetPermissions:d,renderedFilters:p,resolvedFilterOptions:g}=e,{handleSearchChange:b,query:v}=fd(),y=be(r),{i18n:x,t:w}=(0,f.d)(),{breakpoints:{s:C}}=gc(),j=(y&&m("label"in y&&("string"==typeof y.label||"object"==typeof y.label)?y.label:"name"in y?y.name:null,x))??"ID",S=((e,t,r)=>{if(e){let n=re(t,{i18n:r,moveSubFieldsToTop:!0}),a=new Set(e),l=[];for(let e of n)_(e)&&a.has(e.name)&&(l.push(e),a.delete(e.name));return l}return null})(r.admin.listSearchableFields,r.fields,x),$=(0,c.useRef)(w("general:searchBy",{label:m(j,x)})),k=(0,c.useRef)(!!v?.where),E=rG(v?.where),[N,P]=(0,c.useState)(E?"where":void 0);return(0,c.useEffect)(()=>{k.current&&!v?.where?k.current=!1:v?.where&&(k.current=!0)},[P,v?.where]),(0,c.useEffect)(()=>{S?.length>0?$.current=S.reduce((e,t,r)=>{let n="label"in t&&t.label?t.label:"name"in t?t.name:null;return 0===r?`${w("general:searchBy",{label:m(n,x)})}`:r===S.length-1?`${e} ${w("general:or")} ${m(n,x)}`:`${e}, ${m(n,x)}`},""):$.current=w("general:searchBy",{label:m(j,x)})},[w,S,x,j]),(0,h.jsxs)("div",{className:yA,children:[r?.enableQueryPresets&&!a&&(0,h.jsx)(yN,{activePreset:u,collectionSlug:n,queryPresetPermissions:d}),(0,h.jsx)(yR,{Actions:[!C&&(0,h.jsx)(c.default.Fragment,{children:t&&t},"before-actions"),l&&(0,h.jsx)(sl,{"aria-controls":`${yA}-columns`,"aria-expanded":"columns"===N,className:`${yA}__toggle-columns`,icon:(0,h.jsx)(nZ,{direction:"columns"===N?"up":"down"}),id:"toggle-list-columns",onClick:()=>P("columns"!==N?"columns":void 0),pillStyle:"light",size:"small",children:w("general:columns")},"toggle-list-columns"),i&&(0,h.jsx)(sl,{"aria-controls":`${yA}-where`,"aria-expanded":"where"===N,className:`${yA}__toggle-where`,icon:(0,h.jsx)(nZ,{direction:"where"===N?"up":"down"}),id:"toggle-list-filters",onClick:()=>P("where"!==N?"where":void 0),pillStyle:"light",size:"small",children:w("general:filters")},"toggle-list-filters"),o&&(0,h.jsx)(sl,{"aria-controls":`${yA}-sort`,"aria-expanded":"sort"===N,className:`${yA}__toggle-sort`,icon:(0,h.jsx)(nZ,{}),id:"toggle-list-sort",onClick:()=>P("sort"!==N?"sort":void 0),pillStyle:"light",size:"small",children:w("general:sort")},"toggle-list-sort"),r.admin.groupBy&&(0,h.jsx)(sl,{"aria-controls":`${yA}-group-by`,"aria-expanded":"group-by"===N,className:`${yA}__toggle-group-by`,icon:(0,h.jsx)(nZ,{direction:"group-by"===N?"up":"down"}),id:"toggle-group-by",onClick:()=>P("group-by"!==N?"group-by":void 0),pillStyle:"light",size:"small",children:w("general:groupByLabel",{label:""})},"toggle-group-by"),s&&Array.isArray(s)&&s.length>0&&(0,h.jsx)(al,{button:(0,h.jsx)(yC,{ariaLabel:w("general:moreOptions")}),className:`${yA}__popup`,horizontalAlign:"right",id:"list-menu",size:"small",verticalAlign:"bottom",children:(0,h.jsx)(n6.ButtonGroup,{children:s.map((e,t)=>(0,h.jsx)(c.Fragment,{children:e},`list-menu-item-${t}`))})},"list-menu")].filter(Boolean),label:$.current,onSearchChange:b,searchQueryParam:v?.search},n),l&&(0,h.jsx)(o5,{className:`${yA}__columns`,height:"columns"===N?"auto":0,id:`${yA}-columns`,children:(0,h.jsx)(fj,{collectionSlug:r.slug})}),(0,h.jsx)(o5,{className:`${yA}__where`,height:"where"===N?"auto":0,id:`${yA}-where`,children:(0,h.jsx)(bB,{collectionPluralLabel:r?.labels?.plural,collectionSlug:r.slug,fields:r?.fields,renderedFilters:p,resolvedFilterOptions:g})}),r.admin.groupBy&&(0,h.jsx)(o5,{className:`${yA}__group-by`,height:"group-by"===N?"auto":0,id:`${yA}-group-by`,children:(0,h.jsx)(bV,{collectionSlug:r.slug,fields:r.fields})})]})};function yL(e){let{collection:t,collection:{slug:r,labels:{plural:n,singular:a}}={},drawerSlug:l,ids:i,onSuccess:o,selectAll:s,where:u}=e,{clearRouteCache:p}=mi(),{config:{routes:{api:g}}}
49=(0,d.c)(),{code:v}=iP(),y=(0,b.useRouter)(),x=(0,b.useSearchParams)(),{i18n:w,t:C}=(0,f.d)(),j=(0,c.useCallback)(()=>{nI.error(C("error:unknown"))},[C]),S=c.default.useMemo(()=>{let e=[{_status:{not_equals:"published"}}];u&&e.push(u);let r=rn({collectionConfig:t,search:x.get("search")});return r&&e.push(r),s?e.push(fc(x)?.where||{id:{not_equals:""}}):e.push({id:{in:i||[]}}),t6({locale:v,select:{},where:rQ(e)},{addQueryPrefix:!0})},[t,x,s,i,v,u]),$=(0,c.useCallback)(async()=>{let e=tR({apiRoute:g,path:`/${r}${S}&draft=true`});await iw.patch(e,{body:JSON.stringify({_status:"published"}),headers:{"Accept-Language":w.language,"Content-Type":"application/json"}}).then(async e=>{try{let t=await e.json(),r=t?.docs.length||0,l=r>1?n:a;return e.status<400||r>0?(nI.success(C("general:updatedCountSuccessfully",{count:r,label:m(l,w)})),t?.errors.length>0&&nI.error(t.message,{description:t.errors.map(e=>e.message).join(`
50`)}),y.replace(t6({...fc(x),page:s?"1":void 0},{addQueryPrefix:!0})),p(),"function"==typeof o&&o(),null):(t.errors?t.errors.forEach(e=>nI.error(e.message)):j(),!1)}catch{return j()}})},[g,r,S,w,n,a,C,y,x,s,p,j,o]);return(0,h.jsx)(iv,{body:C("version:aboutToPublishSelection",{label:m(n,w)}),cancelLabel:C("general:cancel"),confirmingLabel:C("version:publishing"),confirmLabel:C("general:confirm"),heading:C("version:confirmPublish"),modalSlug:l,onConfirm:$})}var yM=e=>{let t,r=(0,v.c)(12),{collection:n,collection:a,count:l,ids:i,modalPrefix:o,onSuccess:s,selectAll:u,where:d}=e,{slug:p,versions:m}=void 0===a?{}:a,{permissions:g}=iS(),{t:b}=(0,f.d)(),{openModal:y}=lc(),x=g?.collections?.[p]?.update,w=`${o?`${o}-`:""}publish-${p}`;if(!m?.drafts||0===l||!x)return null;if(r[0]!==n||r[1]!==w||r[2]!==i||r[3]!==s||r[4]!==y||r[5]!==u||r[6]!==b||r[7]!==d){let e;r[9]!==w||r[10]!==y?(e=()=>{y(w)},r[9]=w,r[10]=y,r[11]=e):e=r[11],t=(0,h.jsxs)(c.default.Fragment,{children:[(0,h.jsx)(vP,{"aria-label":b("version:publish"),onClick:e,children:b("version:publish")}),(0,h.jsx)(yL,{collection:n,drawerSlug:w,ids:i,onSuccess:s,selectAll:u,where:d})]}),r[0]=n,r[1]=w,r[2]=i,r[3]=s,r[4]=y,r[5]=u,r[6]=b,r[7]=d,r[8]=t}else t=r[8];return t},yI="confirm-restore-many-docs",yF="restore-many",yB=e=>{let{collection:{slug:t}={},viewType:r}=e,{permissions:n}=iS(),{config:{collections:a,routes:l,serverURL:i}}=(0,d.c)(),{code:o}=iP(),s=(0,b.useRouter)(),{clearRouteCache:u}=mi(),p=(0,b.useSearchParams)(),{count:g,getSelectedIds:v,selectAll:y,toggleAll:x}=vk(),{openModal:w}=lc(),{i18n:C,t:j}=(0,f.d)(),[S,$]=c.default.useState(!1),_=n?.collections?.[t]?.update;if(y===vj.None||!_||"trash"!==r)return null;let k=y===vj.AllAvailable,E=k?[]:v(),N=fc(p)?.where,P={and:[...Array.isArray(N?.and)?N.and:N?[N]:[],{deletedAt:{exists:!0}}]},T=async()=>{let e,r=a.find(e=>e.slug===t);if(!r)return;e=k?P:{and:[{id:{in:E}},{deletedAt:{exists:!0}}]};let n=tR({apiRoute:l.api,path:`/${t}${t6({limit:0,locale:o,select:{},trash:!0,where:rn({collectionConfig:r,search:fc(p)?.search,where:e})},{addQueryPrefix:!0})}`}),i={deletedAt:null};r?.versions?.drafts&&(i._status=S?"published":"draft");let c=await iw.patch(n,{body:JSON.stringify(i),headers:{"Accept-Language":C.language,"Content-Type":"application/json"}});try{let{plural:e,singular:t}=r.labels,n=await c.json(),a=n?.docs?.length||0;(c.status<400||a>0)&&nI.success(j("general:restoredCountSuccessfully",{count:a,label:m(a>1?e:t,C)})),n?.errors?.length>0&&nI.error(n.message,{description:n.errors.map(e=>e.message).join(`
51`)})}catch{nI.error(j("error:unknown"))}x(),s.replace(t6({...fc(p),page:k?"1":void 0},{addQueryPrefix:!0})),u()},D=a.find(({slug:e})=>e===t),R=m(1===g?D.labels.singular:D.labels.plural,C);return(0,h.jsxs)(c.default.Fragment,{children:[(0,h.jsx)(vP,{"aria-label":j("general:restore"),className:"restore-documents__toggle",onClick:()=>{w(yI)},children:j("general:restore")}),(0,h.jsx)(iv,{body:(0,h.jsxs)(c.default.Fragment,{children:[j(D?.versions?.drafts?"general:aboutToRestoreAsDraftCount":"general:aboutToRestoreCount",{count:g,label:R}),D?.versions?.drafts&&(0,h.jsx)("div",{className:`${yF}
51__checkbox`,children:(0,h.jsx)(oX,{checked:S,id:"restore-as-published-many",label:j("general:restoreAsPublished"),name:"restore-as-published-many",onToggle:e=>$(e.target.checked)})})]}),className:yF,confirmingLabel:j("general:restoring"),heading:j("general:confirmRestoration"),modalSlug:yI,onConfirm:T})]})};function yz(e){let{collection:t,collection:{slug:r,labels:{plural:n,singular:a}}={},drawerSlug:l,ids:i,onSuccess:o,selectAll:s,where:u}=e,{config:{routes:{api:p}}}=(0,d.c)(),{code:g}=iP(),{i18n:v,t:y}=(0,f.d)(),x=(0,b.useSearchParams)(),w=(0,b.useRouter)(),{clearRouteCache:C}=mi(),j=(0,c.useCallback)(()=>{nI.error(y("error:unknown"))},[y]),S=c.default.useMemo(()=>{let e=[{_status:{not_equals:"draft"}}];u&&e.push(u);let r=rn({collectionConfig:t,search:x.get("search")});return r&&e.push(r),s||e.push({id:{in:i||[]}}),t6({locale:g,select:{},where:rQ(e)},{addQueryPrefix:!0})},[t,x,s,i,g,u]),$=(0,c.useCallback)(async()=>{let e=tR({apiRoute:p,path:`/${r}${S}`});await iw.patch(e,{body:JSON.stringify({_status:"draft"}),headers:{"Accept-Language":v.language,"Content-Type":"application/json"}}).then(async e=>{try{let t=await e.json(),r=t?.docs.length||0,l=r>1?n:a;return e.status<400||r>0?(nI.success(y("general:updatedCountSuccessfully",{count:r,label:m(l,v)})),t?.errors.length>0&&nI.error(t.message,{description:t.errors.map(e=>e.message).join(`
52`)}),w.replace(t6({...fc(x),page:s?"1":void 0},{addQueryPrefix:!0})),C(),"function"==typeof o&&o(),null):(t.errors?t.errors.forEach(e=>nI.error(e.message)):j(),!1)}catch{return j()}})},[p,r,S,v,n,a,y,w,x,s,C,j,o]);return(0,h.jsx)(iv,{body:y("version:aboutToUnpublishSelection",{label:m(n,v)}),confirmingLabel:y("version:unpublishing"),heading:y("version:confirmUnpublish"),modalSlug:l,onConfirm:$})}var yU=e=>{let t,r=(0,v.c)(12),{collection:n,collection:a,count:l,ids:i,modalPrefix:o,onSuccess:s,selectAll:u,where:d}=e,{slug:p,versions:m}=void 0===a?{}:a,{t:g}=(0,f.d)(),{permissions:b}=iS(),{toggleModal:y}=lc(),x=b?.collections?.[p]?.update,w=`${o?`${o}-`:""}unpublish-${p}`;if(!m?.drafts||0===l||!x)return null;if(r[0]!==n||r[1]!==w||r[2]!==i||r[3]!==s||r[4]!==u||r[5]!==g||r[6]!==y||r[7]!==d){let e;r[9]!==w||r[10]!==y?(e=()=>{y(w)},r[9]=w,r[10]=y,r[11]=e):e=r[11],t=(0,h.jsxs)(c.default.Fragment,{children:[(0,h.jsx)(vP,{"aria-label":g("version:unpublish"),onClick:e,children:g("version:unpublish")}),(0,h.jsx)(yz,{collection:n,drawerSlug:w,ids:i,onSuccess:s,selectAll:u,where:d})]}),r[0]=n,r[1]=w,r[2]=i,r[3]=s,r[4]=u,r[5]=g,r[6]=y,r[7]=d,r[8]=t}else t=r[8];return t},yV=e=>{let t=(0,v.c)(21),{collectionConfig:r,disableBulkDelete:n,disableBulkEdit:a,hasDeletePermission:l,hasTrashPermission:i,label:o,modalPrefix:s,showSelectAllAcrossPages:u,viewType:d,where:p}=e,m=void 0===u||u,{count:g,selectAll:b,selectedIDs:y,toggleAll:x,totalDocs:w}=vk(),{t:C}=(0,f.d)(),j;t[0]!==x?(j=()=>x(),t[0]=x,t[1]=j):j=t[1];let S=j;if(0===g)return null;let $=r?.trash&&"trash"===d,_;return t[2]!==r||t[3]!==g||t[4]!==n||t[5]!==a||t[6]!==l||t[7]!==i||t[8]!==$||t[9]!==o||t[10]!==s||t[11]!==S||t[12]!==b||t[13]!==y||t[14]!==m||t[15]!==C||t[16]!==x||t[17]!==w||t[18]!==d||t[19]!==p?(_=(0,h.jsx)(vN,{count:g,ListActions:[b!==vj.AllAvailable&&g<w&&!1!==m?(0,h.jsx)(vP,{"aria-label":C("general:selectAll",{count:`(${w})`,label:o}),id:"select-all-across-pages",onClick:()=>x(!0),children:C("general:selectAll",{count:`(${w})`,label:""})},"select-all"):null].filter(Boolean),SelectionActions:[!a&&!$&&(0,h.jsxs)(c.Fragment,{children:[(0,h.jsx)(yv,{collection:r,count:g,ids:y,modalPrefix:s,onSuccess:S,selectAll:b===vj.AllAvailable,where:p}),(0,h.jsx)(yM,{collection:r,count:g,ids:y,modalPrefix:s,onSuccess:S,selectAll:b===vj.AllAvailable,where:p}),(0,h.jsx)(yU,{collection:r,count:g,ids:y,modalPrefix:s,onSuccess:S,selectAll:b===vj.AllAvailable,where:p})]},"bulk-actions"),$&&(0,h.jsx)(yB,{collection:r,viewType:d},"bulk-restore"),!n&&(0,h.jsx)(vT,{collection:r,hasDeletePermission:l,hasTrashPermission:i,modalPrefix:s,viewType:d},"bulk-delete")].filter(Boolean)}),t[2]=r,t[3]=g,t[4]=n,t[5]=a,t[6]=l,t[7]=i,t[8]=$,t[9]=o,t[10]=s,t[11]=S,t[12]=b,t[13]=y,t[14]=m,t[15]=C,t[16]=x,t[17]=w,t[18]=d,t[19]=p,t[20]=_):_=t[20],_};function yH({slug:e,className:t}){let{closeModal:r}=lc(),{t:n}=(0,f.d)();return(0,h.jsx)("button",{"aria-label":n("general:close"),className:["close-modal-button",t].filter(
52Boolean).join(" "),onClick:()=>{r(e)},type:"button",children:(0,h.jsx)(f.a,{})},"close-button")}var yq="default-list-view-tabs",yK=e=>{let t,r=(0,v.c)(20),{collectionConfig:n,config:a,onChange:l,viewType:i}=e,{i18n:o,t:s}=(0,f.d)(),{setPreference:c}=o_(),u=(0,b.useRouter)(),d=n.trash,p=n.folders&&a.folders;if(!d&&!p)return null;r[0]!==n.slug||r[1]!==a||r[2]!==l||r[3]!==u||r[4]!==c?(t=async e=>{l&&l(e),("list"===e||"folders"===e)&&await c(`collection-${n.slug}`,{listViewType:e});let t=`/collections/${n.slug}`;switch(e){case"folders":a.folders&&(t=`/collections/${n.slug}/${a.folders.slug}`);break;case"trash":t=`/collections/${n.slug}/trash`}let r=tR({adminRoute:a.routes.admin,path:t});u.push(r)},r[0]=n.slug,r[1]=a,r[2]=l,r[3]=u,r[4]=c,r[5]=t):t=r[5];let g=t,y=`${s("general:all")} ${m(n?.labels?.plural,o)}`,x;if(r[6]!==y||r[7]!==n.labels?.plural||r[8]!==g||r[9]!==o||r[10]!==p||r[11]!==d||r[12]!==s||r[13]!==i){let e,t;r[15]===Symbol.for("react.memo_cache_sentinel")?(e=/\s+/g,r[15]=e):e=r[15];let a=y.toLowerCase().replace(e,"-"),l="list"===i&&`${yq}__button--active`,c;r[16]!==l?(c=[`${yq}__button`,l].filter(Boolean),r[16]=l,r[17]=c):c=r[17],r[18]!==g?(t=()=>g("list"),r[18]=g,r[19]=t):t=r[19],x=(0,h.jsxs)("div",{className:yq,children:[(0,h.jsxs)(au,{buttonStyle:"tab",className:c.join(" "),disabled:"list"===i,el:"button",id:a,onClick:t,children:[s("general:all")," ",m(n?.labels?.plural,o)]}),p&&(0,h.jsx)(au,{buttonStyle:"tab",className:[`${yq}__button`,"folders"===i&&`${yq}__button--active`].filter(Boolean).join(" "),disabled:"folders"===i,el:"button",onClick:()=>g("folders"),children:s("folder:byFolder")}),d&&(0,h.jsx)(au,{buttonStyle:"tab",className:[`${yq}__button`,"trash"===i&&`${yq}__button--active`].filter(Boolean).join(" "),disabled:"trash"===i,el:"button",id:"trash-view-pill",onClick:()=>g("trash"),children:s("general:trash")})]}),r[6]=y,r[7]=n.labels?.plural,r[8]=g,r[9]=o,r[10]=p,r[11]=d,r[12]=s,r[13]=i,r[14]=x}else x=r[14];return x},yW="list-header",yG=e=>(0,h.jsxs)("header",{className:[yW,e.className].filter(Boolean).join(" "),children:[(0,h.jsxs)("div",{className:`${yW}__content`,children:[(0,h.jsxs)("div",{className:`${yW}__title-and-actions`,children:[(0,h.jsx)("h1",{className:`${yW}__title`,children:e.title}),e.TitleActions.length?(0,h.jsx)("div",{className:`${yW}__title-actions`,children:e.TitleActions}):null]}),e.Actions.length?(0,h.jsx)("div",{className:`${yW}__actions`,children:e.Actions}):null]}),e.AfterListHeaderContent?(0,h.jsx)("div",{className:`${yW}__after-header-content`,children:e.AfterListHeaderContent}):null]}),yY=()=>{let e=(0,v.c)(12),{i18n:t,t:r}=(0,f.d)(),{config:n,getEntityConfig:a}=(0,d.c)(),{collections:l}=n,{enabledCollections:i,selectedOption:o,setSelectedOption:s}=fs(),c;if(e[0]!==l||e[1]!==i||e[2]!==a||e[3]!==t||e[4]!==o||e[5]!==s||e[6]!==r){c=Symbol.for("react.early_return_sentinel");e:{let n;e[8]!==i?(n=e=>{let{slug:t}=e;return i.includes(t)},e[8]=i,e[9]=n):n=e[9];let u=l.filter(n);if(u.length>1){let n=a({collectionSlug:o.value}),l;e[10]!==t?(l=e=>({label:m(e.labels.singular,t),value:e.slug}),e[10]=t,e[11]=l):l=e[11],c=(0,h.jsxs)("div",{className:"list-drawer__select-collection-wrap",children:[(0,h.jsx)(iR,{label:r("upload:selectCollectionToBrowse")}),(0,h.jsx)(d0,{className:`${yW}__select-collection`,isClearable:!1,onChange:s,options:u.map(l),value:{label:m(n?.labels.singular,t),value:n?.slug}})]});break e}}e[0]=l,e[1]=i,e[2]=a,e[3]=t,e[4]=o,e[5]=s,e[6]=r,e[7]=c}else c=e[7];return c!==Symbol.for("react.early_return_sentinel")?c:null};function yQ(e){let t,r=(0,v.c)(3),{hasCreatePermission:n}=e,{DocumentDrawerToggler:a}=fs(),{t:l}=(0,f.d)();return n?(r[0]!==a||r[1]!==l?(t=(0,h.jsx)(a,{className:"list-header__create-new-button",children:(0,h.jsx)(sl,{size:"small",children:l("general:createNew")})},"create-new-button-toggler"),r[0]=a,r[1]=l,r[2]=t):t=r[2],t):null}function yX(e){let t,r=(0,v.c)(12),{collectionSlug:n,hasCreatePermission:a,isBulkUploadEnabled:l,onBulkUploadSuccess:i,openBulkUpload:o}=e,{drawerSlug:s,setCollectionSlug:c,setOnSuccess:u}=gP(),{t:d}=(0,f.d)(),{openModal:p}=lc(),m=(0,b.useRouter)(),g;r[0]!==s||r[1]!==n||r[2]!==i||r[3]!==o||r[4]!==p||r[5]!==m||r[6]!==c||r[7]!==u?(g=()=>{"function"==typeof o?o():(c(n),p(s),u(()=>{"function"==typeof i?i():m.refresh()}))},r[0]=s,r[1]=n,r[2]=i,r[3]=o,r[4]=p,r[5]=m,r[6]=c,r[7]=u,r[8]=g):g=r[8];let y=g;return a&&l?(r[9]!==y||r[10]!==d?(t=(0,h.jsx)(au,{"aria-label":d("upload:bulkUpload"),buttonStyle:"pill",onClick:y,size:"small",children:d("upload:bulkUpload")},"bulk-upload-button"),r[9]=y,r[10]=d,r[11]=t):t=r[11],t):null}function yJ(e){let t=(0,v.c)(5),{collectionConfig:r,hasCreatePermission:n,newDocumentURL:a}=e,{i18n:l,t:i}=(0,f.d)();if(!n)return null;let o=r?.labels?.singular,s;return t[0]!==l||t[1]!==a||t[2]!==i||t[3]!==o?(s=(0,h.jsx)(au,{"aria-label":i("general:createNewLabel",{label:m(o,l)}),buttonStyle:"pill",className:"list-create-new-doc__create-new-button",el:"link",size:"small",to:a,children:i("general:createNew")},"create-new-button"),t[0]=l,t[1]=a,t[2]=i,t[3]=o,t[4]=s):s=t[4],s}var yZ="confirm-empty-trash";function y0({collectionConfig:e,hasDeletePermission:t}){let{i18n:r,t:n}
52=(0,f.d)(),{code:a}=iP(),{config:l}=(0,d.c)(),{openModal:i}=lc(),o=(0,b.useRouter)(),s=(0,b.useSearchParams)(),{clearRouteCache:u}=mi(),[p,g]=c.default.useState(null);c.default.useEffect(()=>{(async()=>{let t=t6({depth:0,limit:0,locale:a,trash:!0,where:{deletedAt:{exists:!0}}},{addQueryPrefix:!0});try{let n=await (await iw.get(tR({apiRoute:l.routes.api,path:`/${e.slug}${t}`}),{headers:{"Accept-Language":r.language,"Content-Type":"application/json"}})).json();g(n?.totalDocs??0)}catch{g(0)}})()},[e.slug,l,r.language,a]);let v=c.default.useCallback(async()=>{if(!t)return;let{slug:i,labels:c}=e,d=t6({limit:0,locale:a,trash:!0,where:{deletedAt:{exists:!0}}},{addQueryPrefix:!0}),f=await iw.delete(tR({apiRoute:l.routes.api,path:`/${i}${d}`}),{headers:{"Accept-Language":r.language,"Content-Type":"application/json"}});try{let e=await f.json(),t=e?.docs?.length||0;f.status<400&&nI.success(n("general:permanentlyDeletedCountSuccessfully",{count:t,label:m(c?.plural,r)})),e?.errors?.length>0&&nI.error(e.message,{description:e.errors.map(e=>e.message).join(`
53`)}),o.replace(t6({...Object.fromEntries(s.entries()),page:"1"},{addQueryPrefix:!0})),u()}catch{nI.error(n("error:unknown"))}},[e,l,t,r,n,a,s,o,u]);return(0,h.jsxs)(c.default.Fragment,{children:[(0,h.jsx)(au,{"aria-label":n("general:emptyTrashLabel",{label:m(e?.labels?.plural,r)}),buttonStyle:"pill",disabled:0===p,id:"empty-trash-button",onClick:()=>{i(yZ)},size:"small",children:n("general:emptyTrash")},"empty-trash-button"),(0,h.jsx)(iv,{body:(0,h.jsx)(mh,{elements:{0:({children:e})=>(0,h.jsx)("strong",{children:e}),1:({children:e})=>(0,h.jsx)("strong",{children:e})},i18nKey:"general:aboutToPermanentlyDeleteTrash",t:n,variables:{count:p??0,label:m(1===p?e.labels?.singular:e.labels?.plural,r)}}),confirmingLabel:n("general:deleting"),heading:n("general:confirmDeletion"),modalSlug:yZ,onConfirm:v})]})}var y1="list-drawer",y2=({className:e,collectionConfig:t,Description:r,disableBulkDelete:n,disableBulkEdit:a,hasCreatePermission:l,hasDeletePermission:i,hasTrashPermission:o,i18n:s,isBulkUploadEnabled:c,isTrashEnabled:u,newDocumentURL:f,onBulkUploadSuccess:p,openBulkUpload:g,smallBreak:b,viewType:v})=>{let{config:y,getEntityConfig:x}=(0,d.c)(),{drawerSlug:w,isInDrawer:C,selectedOption:j}=fs(),S="trash"===v,{isGroupingBy:$}=fd();return C?(0,h.jsx)(yG,{Actions:[(0,h.jsx)(yH,{className:`${y1}__header-close`,slug:w},"close-button")],AfterListHeaderContent:(0,h.jsxs)(h.Fragment,{children:[r,(0,h.jsx)(yY,{})]}),className:`${y1}__header`,title:m(x({collectionSlug:j.value})?.labels?.plural,s),TitleActions:[(0,h.jsx)(yQ,{hasCreatePermission:l},"list-drawer-create-new-doc")].filter(Boolean)}):(0,h.jsx)(yG,{Actions:[!b&&!$&&(0,h.jsx)(yV,{collectionConfig:t,disableBulkDelete:n,disableBulkEdit:a,hasDeletePermission:i,hasTrashPermission:o,label:m(t?.labels?.plural,s),showSelectAllAcrossPages:!$,viewType:v},"list-selection"),(0,h.jsx)(yK,{collectionConfig:t,config:y,viewType:v},"default-list-actions")].filter(Boolean),AfterListHeaderContent:r,className:e,title:m(t?.labels?.plural,s),TitleActions:[l&&!S&&(0,h.jsx)(yJ,{collectionConfig:t,hasCreatePermission:l,newDocumentURL:f},"list-header-create-new-doc"),l&&c&&!S&&(0,h.jsx)(yX,{collectionSlug:t.slug,hasCreatePermission:l,isBulkUploadEnabled:c,onBulkUploadSuccess:p,openBulkUpload:g},"list-header-bulk-upload"),i&&u&&"trash"===v&&(0,h.jsx)(y0,{collectionConfig:t,hasDeletePermission:i},"list-header-empty-trash")].filter(Boolean)})},y3="group-by-header",y6="per-page",y5=[5,10,25,50,100],y4=e=>{let t=(0,v.c)(9),{defaultLimit:r,handleChange:n,limit:a,limits:l}=e,i=void 0===l?y5:l,{t:o}=(0,f.d)(),s=rb(a)?a:void 0===r?10:r,c;if(t[0]!==n||t[1]!==s||t[2]!==i||t[3]!==o){let e;t[5]!==n||t[6]!==s||t[7]!==i?(e=e=>{let{close:t}=e;return(0,h.jsx)(n6.ButtonGroup,{children:i.map((e,r)=>(0,h.jsxs)(n6.Button,{className:[`${y6}__button`,e===s&&`${y6}__button-active`].filter(Boolean).join(" "),onClick:()=>{t(),n&&n(e)},children:[e===s&&(0,h.jsx)("div",{className:`${y6}__chevron`,children:(0,h.jsx)(nZ,{direction:"right",size:"small"})})," ",(0,h.jsx)("span",{children:e})]},r))})},t[5]=n,t[6]=s,t[7]=i,t[8]=e):e=t[8],c=(0,h.jsx)("div",{className:y6,children:(0,h.jsx)(al,{button:(0,h.jsxs)("div",{className:`${y6}__base-button`,children:[(0,h.jsx)("span",{children:o("general:perPage",{limit:s})})," ",(0,h.jsx)(nZ,{className:`${y6}__icon`})]}),horizontalAlign:"right",render:e,size:"small"})}),t[0]=n,t[1]=s,t[2]=i,t[3]=o,t[4]=c}else c=t[4];return c}
53,y8="page-controls",y7=e=>{let t=(0,v.c)(16),{AfterPageControls:r,collectionConfig:n,data:a,handlePageChange:l,handlePerPageChange:i,limit:o}=e,{i18n:s}=(0,f.d)(),u;return t[0]!==r||t[1]!==n?.admin?.pagination?.limits||t[2]!==a.hasNextPage||t[3]!==a.hasPrevPage||t[4]!==a.limit||t[5]!==a.nextPage||t[6]!==a.page||t[7]!==a.pagingCounter||t[8]!==a.prevPage||t[9]!==a.totalDocs||t[10]!==a.totalPages||t[11]!==l||t[12]!==i||t[13]!==s||t[14]!==o?(u=(0,h.jsxs)("div",{className:y8,children:[(0,h.jsx)(pp,{hasNextPage:a.hasNextPage,hasPrevPage:a.hasPrevPage,limit:a.limit,nextPage:a.nextPage,numberOfNeighbors:1,onChange:l,page:a.page,prevPage:a.prevPage,totalPages:a.totalPages}),a.totalDocs>0&&(0,h.jsxs)(c.Fragment,{children:[(0,h.jsxs)("div",{className:`${y8}__page-info`,children:[a.page*a.limit-(a.limit-1),"-",a.totalPages>1&&a.totalPages!==a.page?a.limit*a.page:a.totalDocs," ",s.t("general:of")," ",a.totalDocs]}),(0,h.jsx)(y4,{handleChange:i,limit:o,limits:n?.admin?.pagination?.limits,resetPage:a.totalDocs<=a.pagingCounter}),r]})]}),t[0]=r,t[1]=n?.admin?.pagination?.limits,t[2]=a.hasNextPage,t[3]=a.hasPrevPage,t[4]=a.limit,t[5]=a.nextPage,t[6]=a.page,t[7]=a.pagingCounter,t[8]=a.prevPage,t[9]=a.totalDocs,t[10]=a.totalPages,t[11]=l,t[12]=i,t[13]=s,t[14]=o,t[15]=u):u=t[15],u},y9=e=>{let t,r=(0,v.c)(10),{AfterPageControls:n,collectionConfig:a}=e,{data:l,defaultLimit:i,handlePageChange:o,handlePerPageChange:s,query:c}=fd(),u;return r[0]!==i||r[1]!==c.limit?(u=rb(c.limit)?c.limit:i,r[0]=i,r[1]=c.limit,r[2]=u):u=r[2],r[3]!==n||r[4]!==a||r[5]!==l||r[6]!==o||r[7]!==s||r[8]!==u?(t=(0,h.jsx)(y7,{AfterPageControls:n,collectionConfig:a,data:l,handlePageChange:o,handlePerPageChange:s,limit:u}),r[3]=n,r[4]=a,r[5]=l,r[6]=o,r[7]=s,r[8]=u,r[9]=t):t=r[9],t},xe=({children:e})=>(0,h.jsx)("div",{className:"sticky-toolbar",children:e}),xt=()=>(0,h.jsx)("svg",{className:"icon icon--logout",fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,h.jsx)("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 10L
537.33333 6.66667M4 10H12",strokeLinecap:"square"})}),xr="nav-group",xn="combobox",xa=()=>(0,h.jsx)("svg",{className:"icon icon--document",fill:"none",height:"16",viewBox:"0 0 16 16",width:"16",xmlns:"http://www.w3.org/2000/svg",children:(0,h.jsx)("path",{clipRule:"evenodd",d:"M3.5 1C2.94772 1 2.5 1.44772 2.5 2V14C2.5 14.5523 2.94771 15 3.5 15H12.5C13.0523 15 13.5 14.5523 13.5 14V4.41421C13.5 4.149 13.3946 3.89464 13.2071 3.70711L10.7929 1.29289C10.6054 1.10536 10.351 1 10.0858 1H3.5ZM5 5.5C5 5.22386 5.22386 5 5.5 5H10.5C10.7761 5 11 5.22386 11 5.5C11 5.77614 10.7761 6 10.5 6H5.5C5.22386 6 5 5.77614 5 5.5ZM5 8.5C5 8.22386 5.22386 8 5.5 8H10.5C10.7761 8 11 8.22386 11 8.5C11 8.77614 10.7761 9 10.5 9H5.5C5.22386 9 5 8.77614 5 8.5ZM5 11.5C5 11.2239 5.22386 11 5.5 11H10.5C10.7761 11 11 11.2239 11 11.5C11 11.7761 10.7761 12 10.5 12H5.5C5.22386 12 5 11.7761 5 11.5Z",fill:"currentColor",fillRule:"evenodd"})}),xl="draggable-with-click",xi=({as:e="div",children:t,className:r,disabled:n=!1,onClick:a,onKeyDown:l,ref:i,thresholdPixels:o=3})=>{let{attributes:s,listeners:u,setNodeRef:d}=tx({id:(0,c.useId)(),disabled:n}),f=(0,c.useRef)({x:0,y:0}),p=(0,c.useRef)(!1);return(0,h.jsx)(e||"div",{role:"button",tabIndex:0,...s,className:[xl,r,n?`${xl}--disabled`:""].filter(Boolean).join(" "),onKeyDown:n?void 0:l,onPointerDown:n?void 0:a?e=>{f.current={x:e.clientX,y:e.clientY},p.current=!1;let t=r=>{let n=Math.abs(r.clientX-f.current.x),l=Math.abs(r.clientY-f.current.y);(n>o||l>o)&&(p.current=!0,u?.onPointerDown&&(u.onPointerDown(e),a(r)),window.removeEventListener("pointermove",t))},r=e=>{window.removeEventListener("pointermove",t),window.removeEventListener("pointerup",r),p.current||a(e)};window.addEventListener("pointermove",t),window.addEventListener("pointerup",r)}:void 0,ref:e=>{n||(d(e),i&&(i.current=e))},children:t})},xo="simple-table",xs=({appearance:e,className:t,headerCells:r,tableRows:n})=>(0,h.jsx)("div",{className:[t,xo,e&&`${xo}--appearance-${e}`].filter(Boolean).join(" "),children:(0,h.jsxs)("table",{cellPadding:0,cellSpacing:0,className:`${xo}__table`,children:[(0,h.jsx)(xc,{children:(0,h.jsx)(xd,{children:r})}),(0,h.jsx)(xu,{children:n})]})}),xc=({children:e,className:t,...r})=>(0,h.jsx)("thead",{className:`${xo}__thead ${t||""}`.trim(),...r,children:e}),xu=({children:e,className:t,...r})=>(0,h.jsx)("tbody",{className:`${xo}__tbody ${t||""}`.trim(),...r,children:e}),xd=({children:e,className:t,...r})=>(0,h.jsx)("tr",{className:`${xo}__tr ${t||""}`.trim(),...r,children:e}),xf=({children:e,className:t,...r})=>(0,h.jsx)("td",{className:`${xo}__td ${t||""}`.trim(),...r,children:e}),xp=({children:e,className:t,...r})=>(0,h.jsx)("th",{className:`${xo}__th ${t||""}`.trim(),...r,children:e}),xh=({children:e,className:t,...r})=>(0,h.jsx)("td",{className:`${xo}__hidden-cell ${t||""}`.trim(),...r,children:e}),xm="draggable-table-row";function xg({id:e,columns:t,disabled:r=!1,dragData:n,isDroppable:a,isFocused:l,isSelected:i,isSelecting:o,itemKey:s,onClick:u,onKeyDown:d}){let f=!r&&a&&!i,{isOver:p,setNodeRef:m}=tj({id:e,data:n,disabled:!f}),g=c.default.useRef(null);return c.default.useEffect(()=>{let e=g.current;return l&&g.current?g.current.focus():!l&&g.current&&g.current.blur(),()=>{e&&e.blur()}},[l]),(0,h.jsxs)(xi,{as:"tr",className:[xm,i&&`${xm}--selected`,o&&`${xm}--selecting`,r&&`${xm}--disabled`,l&&`${xm}--focused`,p&&`${xm}
53--over`].filter(Boolean).join(" "),onClick:u,onKeyDown:d,ref:g,children:[t.map((e,r)=>(0,h.jsx)(xf,{className:[`${xm}__cell-content`,0===r&&`${xm}__first-td`,r===t.length-1&&`${xm}__last-td`].filter(Boolean).join(" "),children:e},`${s}-${r}`)),f?(0,h.jsx)(xh,{children:(0,h.jsx)("div",{className:`${xm}__drop-area`,ref:m})}):null]},s)}var xb="folder-file-table";function xv(e){let t=(0,v.c)(39),{showRelationCell:r}=e,n=void 0===r||r,{checkIfItemIsDisabled:a,documents:l,focusedRowIndex:i,onItemClick:o,onItemKeyPress:s,selectedItemKeys:u,subfolders:p}=mn(),{config:g}=(0,d.c)(),{i18n:b,t:y}=(0,f.d)(),x;t[0]!==g||t[1]!==b?(x=()=>{let e={};return g.collections.forEach(t=>{e[t.slug]={plural:m(t.labels?.plural,b),singular:m(t.labels?.singular,b)}}),e},t[0]=g,t[1]=b,t[2]=x):x=t[2];let[w]=c.default.useState(x),C;t[3]!==n||t[4]!==y?(C=()=>{let e=[{name:"name",label:y("general:name")},{name:"createdAt",label:y("general:createdAt")},{name:"updatedAt",label:y("general:updatedAt")}];return n&&e.push({name:"type",label:y("version:type")}),e},t[3]=n,t[4]=y,t[5]=C):C=t[5];let[j]=c.default.useState(C),S;if(t[6]!==a||t[7]!==j||t[8]!==g||t[9]!==l||t[10]!==i||t[11]!==b||t[12]!==o||t[13]!==s||t[14]!==w||t[15]!==u||t[16]!==p){let e,r;t[18]!==a||t[19]!==j||t[20]!==g||t[21]!==i||t[22]!==b||t[23]!==o||t[24]!==s||t[25]!==w||t[26]!==u?(e=(e,t)=>{let{itemKey:r,relationTo:n,value:l}=e,c=rD(l);return(0,h.jsx)(xg,{columns:j.map((t,a)=>{let{name:i}=t,o="—";return"name"===i&&void 0!==l._folderOrDocumentTitle&&(o=l._folderOrDocumentTitle),("createdAt"===i||"updatedAt"===i)&&l[i]&&(o=om({date:l[i],i18n:b,pattern:g.admin.dateFormat})),"type"===i&&(o=(0,h.jsxs)(h.Fragment,{children:[w[n]?.singular||n,Array.isArray(e.value?.folderType)?e.value?.folderType.reduce((e,t,r)=>0===r?` \u2014 ${w[t]?.plural||t}`:r>0?`${e}, ${w[t]?.plural||t}`:e,""):""]})),0===a?(0,h.jsxs)("span",{className:`${xb}__cell-with-icon`,children:[(0,h.jsx)(mv,{}),o]},`${r}-${i}`):o}),disabled:a(e),dragData:{id:c,type:"folder"},id:c,isDroppable:!0,isFocused:i===t,isSelected:u.has(r),isSelecting:u.size>0,itemKey:r,onClick:r=>{o({event:r,index:t,item:e})},onKeyDown:r=>{s({event:r,index:t,item:e})}},`${t}-${r}`)},t[18]=a,t[19]=j,t[20]=g,t[21]=i,t[22]=b,t[23]=o,t[24]=s,t[25]=w,t[26]=u,t[27]=e):e=t[27],t[28]!==a||t[29]!==j||t[30]!==g||t[31]!==i||t[32]!==b||t[33]!==o||t[34]!==s||t[35]!==w||t[36]!==u||t[37]!==p.length?(r=(e,t)=>
53{let{itemKey:r,relationTo:n,value:l}=e,c=rD(l),d=t+p.length;return(0,h.jsx)(xg,{columns:j.map((e,t)=>{let{name:a}=e,i="—";return"name"===a&&void 0!==l._folderOrDocumentTitle&&(i=l._folderOrDocumentTitle),("createdAt"===a||"updatedAt"===a)&&l[a]&&(i=om({date:l[a],i18n:b,pattern:g.admin.dateFormat})),"type"===a&&(i=w[n]?.singular||n),0===t?(0,h.jsxs)("span",{className:`${xb}__cell-with-icon`,children:[(0,h.jsx)(xa,{}),i]},`${r}-${a}`):i}),disabled:a(e),dragData:{id:c,type:"document"},id:c,isFocused:i===d,isSelected:u.has(r),isSelecting:u.size>0,itemKey:r,onClick:t=>{o({event:t,index:d,item:e})},onKeyDown:t=>{s({event:t,index:d,item:e})}},`${d}-${r}`)},t[28]=a,t[29]=j,t[30]=g,t[31]=i,t[32]=b,t[33]=o,t[34]=s,t[35]=w,t[36]=u,t[37]=p.length,t[38]=r):r=t[38],S=(0,h.jsx)(xs,{headerCells:j.map(xy),tableRows:[...p.map(e),...l.map(r)]}),t[6]=a,t[7]=j,t[8]=g,t[9]=l,t[10]=i,t[11]=b,t[12]=o,t[13]=s,t[14]=w,t[15]=u,t[16]=p,t[17]=S}else S=t[17];return S}function xy(e){let{name:t,label:r}=e;return(0,h.jsx)(xp,{children:r},t)}function xx({className:e=""}){return(0,h.jsxs)("div",{className:`icon icon--dots ${e}`.trim(),children:[(0,h.jsx)("div",{}),(0,h.jsx)("div",{}),(0,h.jsx)("div",{})]})}var xw="folder-file-card";function xC({id:e,type:t,className:r="",disabled:n=!1,folderType:a,isDeleting:l=!1,isFocused:i=!1,isSelected:o=!1,itemKey:s,onClick:u,onKeyDown:d,PopupActions:f,previewUrl:p,selectedCount:m=0,title:g}){let b=!e||n||"folder"!==t,{isOver:v,setNodeRef:y}=tj({id:s,data:{id:e,type:t,folderType:a},disabled:b}),x=c.default.useRef(null);return c.default.useEffect(()=>{let e=x.current;return i&&x.current?x.current.focus():!i&&x.current&&x.current.blur(),()=>{e&&e.blur()}},[i]),(0,h.jsxs)(xi,{className:[xw,r,o&&`${xw}--selected`,n&&`${xw}--disabled`,l&&`${xw}--deleting`,i&&`${xw}--focused`,v&&`${xw}--over`,`${xw}--${t}`].filter(Boolean).join(" "),disabled:n||!u&&!d,onClick:u,onKeyDown:d,ref:x,children:[b?null:(0,h.jsx)("div",{className:`${xw}__drop-area`,ref:y}),"file"===t?(0,h.jsx)("div",{className:`${xw}__preview-area`,children:p?(0,h.jsx)(f4,{fileSrc:p}):(0,h.jsx)(xa,{})}):null,(0,h.jsxs)("div",{className:`${xw}__titlebar-area`,children:[(0,h.jsx)("div",{className:`${xw}__icon-wrap`,children:"file"===t?(0,h.jsx)(xa,{}):(0,h.jsx)(mv,{})}),(0,h.jsxs)("div",{className:`${xw}__titlebar-labels`,children:[(0,h.jsx)("p",{className:`${xw}__name`,title:g,children:(0,h.jsx)("span",{children:g})}),a&&a.length>0?(0,h.jsx)(xj,{folderType:a}):null]}),f?(0,h.jsx)(al,{button:(0,h.jsx)(xx,{}),disabled:m>1||1===m&&!o,horizontalAlign:"right",size:"large",verticalAlign:"bottom",children:f}):null]})]},s)}function xj({folderType:e}){let{config:t}=(0,d.c)(),{i18n:r}=(0,f.d)(),n=c.default.useMemo(()=>e.reduce((e,n)=>{let a=t.collections?.find(e=>e.slug===n);return a?[...e,m(a.labels.plural,r)]:e},[]),[e,t.collections,r]);return(0,h.jsx)("p",{className:`${xw}__assigned-collections`,children:n.map((t,r)=>(0,h.jsxs)("span",{children:[t,r<e.length-1?", ":""]},t))})}function xS(e){let t=(0,v.c)(18),{type:r,className:n,index:a,item:l}=e,{checkIfItemIsDisabled:i,focusedRowIndex:o,onItemClick:s,onItemKeyPress:c,selectedItemKeys:u}=mn(),d;if(t[0]!==i||t[1]!==n||t[2]!==o||t[3]!==a||t[4]!==l||t[5]!==s||t[6]!==c||t[7]!==u||t[8]!==r){let e,f=u.has(l.itemKey),p=i(l),m;t[10]!==a||t[11]!==l||t[12]!==s?(m=e=>{s({event:e,index:a,item:l})},t[10]=a,t[11]=l,t[12]=s,t[13]=m):m=t[13],t[14]!==a||t[15]!==l||t[16]!==c?(e=e=>{c({event:e,index:a,item:l})},t[14]=a,t[15]=l,t[16]=c,t[17]=e):e=t[17],d=(0,h.jsx)(xC,{className:n,disabled:p,folderType:l.value.folderType||[],id:l.value.id,isFocused:o===a,isSelected:f,itemKey:l.itemKey,onClick:m,onKeyDown:e,previewUrl:l.value.url,title:l.value._folderOrDocumentTitle,type:r}),t[0]=i,t[1]=n,t[2]=o,t[3]=a,t[4]=l,t[5]=s,t[6]=c,t[7]=u,t[8]=r,t[9]=d}else d=t[9];return d}var x$="item-card-grid";function x_({type:e,items:t,subfolderCount:r,title:n}){return(0,h.jsxs)(h.Fragment,{children:[n&&(0,h.jsx)("p",{className:`${x$}__title`,children:n}),(0,h.jsx)("div",{className:x$,children:t&&t?.length!==0?t.map((t,n)=>{let{itemKey:a}=t;return(0,h.jsx)(xS,{index:n+(r||0),item:t,type:e},a)}):null})]})}function xk(e){return void 0===e||"number"==typeof e?e:decodeURIComponent(e)}var xE=e=>{let t=(0,v.c)(9),{id:r,className:n,prefix:a}=e,l=void 0===a?"ID:":a,{config:i}=(0,d.c)(),{routes:o}=i,{admin:s}=o,{collectionSlug:c,globalSlug:u}=oD(),f=ig(),p=`/${c?`collections/${c}`:`globals/${u}`}/${r}`,m;
53if(t[0]!==s||t[1]!==n||t[2]!==f||t[3]!==r||t[4]!==l||t[5]!==p){let e=tR({adminRoute:s,path:p}),a;t[7]!==n?(a=["id-label",n].filter(Boolean),t[7]=n,t[8]=a):a=t[8],m=(0,h.jsxs)("div",{className:a.join(" "),title:r,children:[l," ",f>1?(0,h.jsx)(nQ,{href:e,children:xk(r)}):xk(r)]}),t[0]=s,t[1]=n,t[2]=f,t[3]=r,t[4]=l,t[5]=p,t[6]=m}else m=t[6];return m},xN="render-title",xP=e=>{let t=(0,v.c)(10),{className:r,element:n,fallback:a,title:l}=e,{id:i,isInitializing:o}=oD(),{title:s}=ow(),u=l||s||a,d=u===i,f=void 0===n?"h1":n,p;if(t[0]!==f||t[1]!==r||t[2]!==i||t[3]!==d||t[4]!==o||t[5]!==u){let e=(0,h.jsx)(c.Fragment,{children:" "}),n=d&&`${xN}--has-id`,a;t[7]!==r||t[8]!==n?(a=[r,xN,n].filter(Boolean),t[7]=r,t[8]=n,t[9]=a):a=t[9],p=(0,h.jsx)(f,{className:a.join(" "),"data-doc-id":i,title:u,children:o?e:(0,h.jsx)(c.Fragment,{children:d?(0,h.jsx)(xE,{className:`${xN}__id`,id:i}):u||e})}),t[0]=f,t[1]=r,t[2]=i,t[3]=d,t[4]=o,t[5]=u,t[6]=p}else p=t[6];return p},xT="sort-column",xD="item-search",xR=e=>{let t=(0,v.c)(7),{placeholder:r,setSearchTerm:n}=e,a=(0,c.useId)(),l=`${a}-label`,i;t[0]!==n?(i=e=>{n(e.target.value)},t[0]=n,t[1]=i):i=t[1];let o=i,s;return t[2]!==o||t[3]!==a||t[4]!==l||t[5]!==r?(s=(0,h.jsxs)("div",{className:xD,children:[(0,h.jsx)("label",{className:"sr-only",htmlFor:a,id:l,children:r}),(0,h.jsx)("input",{"aria-labelledby":l,className:`${xD}__input`,id:a,onChange:o,placeholder:r,type:"text"}),(0,h.jsx)(sg,{})]}),t[2]=o,t[3]=a,t[4]=l,t[5]=r,t[6]=s):s=t[6],s},xA="items-drawer";function xO(e){return!e}var xL="minimize-maximize",xM=()=>(0,h.jsxs)("svg",{className:"icon icon--grid-view",fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[(0,h.jsx)("path",{d:"M8 4H4.66667C4.29848 4 4 4.29848 4 4.66667V8C4 8.36819 4.29848 8.66667 4.66667 8.66667H8C8.36819 8.66667 8.66667 8.36819 8.66667 8V4.66667C8.66667 4.29848 8.36819 4 8 4Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),(0,h.jsx)("path",{d:"M15.3333 4H12C11.6318 4 11.3333 4.29848 11.3333 4.66667V8C11.3333 8.36819 11.6318 8.66667 12 8.66667H15.3333C15.7015 8.66667 16 8.36819 16 8V4.66667C16 4.29848 15.7015 4 15.3333 4Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),(0,h.jsx)("path",{d:"M15.3333 11.3333H12C11.6318 11.3333 11.3333 11.6318 11.3333 12V15.3333C11.3333 15.7015 11.6318 16 12 16H15.3333C15.7015 16 16 15.7015 16 15.3333V12
53C16 11.6318 15.7015 11.3333 15.3333 11.3333Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),(0,h.jsx)("path",{d:"M8 11.3333H4.66667C4.29848 11.3333 4 11.6318 4 12V15.3333C4 15.7015 4.29848 16 4.66667 16H8C8.36819 16 8.66667 15.7015 8.66667 15.3333V12C8.66667 11.6318 8.36819 11.3333 8 11.3333Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})]}),xI=()=>(0,h.jsx)("svg",{className:"icon icon--list-view",fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,h.jsx)("path",{d:"M4 10H16M4 14H16M4 6H16",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})}),xF=()=>(0,h.jsxs)("svg",{fill:"none",height:"26",viewBox:"0 0 26 26",width:"26",xmlns:"http://www.w3.org/2000/svg",children:[(0,h.jsx)("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)"}),(0,h.jsx)("path",{d:"M15.4001 10.5996L10.6001 15.3996M10.6001 10.5996L15.4001 15.3996",stroke:"var(--theme-error-50)",strokeLinecap:"round",strokeLinejoin:"round"})]}),xB=()=>(0,h.jsxs)("svg",{fill:"none",height:"26",viewBox:"0 0 26 26",width:"26",xmlns:"http://www.w3.org/2000/svg",children:[(0,h.jsx)("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)"}),(0,h.jsx)("path",{d:"M13 16.1998V12.9998M13 9.7998H13.0077",stroke:"var(--theme-elevation-50)",strokeLinecap:"round",strokeLinejoin:"round"})]}),xz=()=>(0,h.jsxs)("svg",{fill:"none",height:"26",viewBox:"0 0 26 26",width:"26",xmlns:"http://www.w3.org/2000/svg",children:[(0,h.jsx)("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)"}),(0,h.jsx)("path",{d:"M10.6001 13.0004L12.2001 14.6004L15.4001 11.4004",stroke:"var(--theme-success-50)",strokeLinecap:"round",strokeLinejoin:"round"})]}),xU=()=>(0,h.jsxs)("svg",{fill:"none",height:"26",viewBox:"0 0 26 26",width:"26",xmlns:"http://www.w3.org/2000/svg",children:[(0,h.jsx)("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)"}),(0,h.jsx)("path",{d:"M13 10V13.2M13 16.4H13.008",stroke:"var(--theme-warning-50)",strokeLinecap:"round",strokeLinejoin:"round"})]}),xV=c.default.createContext({addClientFunction:()=>null,removeClientFunction:()=>null}),xH=c.default.createContext({}),xq=e=>{let t=(0,v.c)(6),{children:r}=e,n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n={},t[0]=n):n=t[0];let[a,l]=c.default.useState(n),i;t[1]===Symbol.for("react.memo_cache_sentinel")?(i=e=>{l(t=>{let r={...t};return r[e.key]=e.func,r})},t[1]=i):i=t[1];let o=i,s;t[2]===Symbol.for("react.memo_cache_sentinel")?(s=e=>{l(t=>{let r={...t};return delete r[e.key],r})},t[2]=s):s=t[2];let u=s,d;return t[3]!==r||t[4]!==a?(d=(0,h.jsx)(xV,{value:{addClientFunction:o,removeClientFunction:u},children:(0,h.jsx)(xH,{value:a,children:r})}),t[3]=r,t[4]=a,t[5]=d):d=t[5],d},xK=e=>e?.startsWith("http://")||e?.startsWith("https://")?e:(e=>{try{return new URL(e,window.location.origin).href}catch{return e}})(e),xW=({collisionRect:e,droppableContainers:t,...r})=>{let n=t.find(({id:e})=>"live-preview-area"===e),a=ex({...r,collisionRect:e,droppableContainers:[n]});if(0===a.length)return a;let l=n?.rect?.current;if(e.top>=l.top&&e.left>=l.left&&e.bottom<=l.bottom&&e.right<=l.right)return a},xG=(e,t)=>{switch(t.type){case"height":return{...e,height:t.value};case"width":return{...e,width:t.value};default:return{...e,...t?.value||{}}}},xY="progress-bar",xQ=(0,c.createContext)({}),xX=()=>(0,c.use)(xQ),xJ=(0,c.createContext)({}),xZ=e=>{let t=(0,v.c)(3),{children:r}=e,n=(0,b.useParams)(),a;return t[0]!==r||t[1]!==n?(a=(0,h.jsx)(xJ,{value:n,children:r}),t[0]=r,t[1]=n,t[2]=a):a=t[2],a},x0=(0,c.createContext)({}),x1=(e,t)=>{let{timestamp:r,animationRef:n}=t;n.current=null;let{x:a,y:l,xDirection:i,yDirection:o,eventsFired:s,hasScrolled:c}=e,u=c||!!r,d=u?window.pageXOffset:0,f=u?window.pageYOffset:0,p=d-a,h=f-l,m=d/(document.body.scrollWidth-window.innerWidth)*100,g=f/(document.body.scrollHeight-window.innerHeight)*100;return{x:d,y:f,xDifference:p,yDifference:h,xDirection:p>0?"right":p<0?"left":i,yDirection:h>0?"down":h<0?"up":o,xPercentage:m,yPercentage:g,totalPercentage:(m+g)/2,eventsFired:u?s+1:s,hasScrolled:u}},x2=e=>{let{children:t}=e,r=(0,c.useRef)(null),[n,a]=(0,c.useReducer)(x1,{x:0,y:0,xDifference:0,yDifference:0,xDirection:void 0,yDirection:void 0,xPercentage:0,yPercentage:0,totalPercentage:0,eventsFired:0,hasScrolled:!1}),l=(0,c.useCallback)(e=>{r.current&&cancelAnimationFrame(r.current),r.current=requestAnimationFrame(t=>{a({e:e,timestamp:t,animationRef:r})})},[]);return(0,c.useEffect)(()=>(window.addEventListener("scroll",l),()=>{window.removeEventListener("scroll",l)}),[l]),c.default.createElement(x0.Provider,{value:Object.assign({},n)},t&&t)};function x3(){let e,t=(0,v.c)(6),{closeAllModals:r}=lc(),n=(0,b.usePathname)(),a;t[0]!==r?(a=()=>{r()},t[0]=r,t[1]=a):a=t[1];let l=ae(a),i=(0,c.useRef)(!0),o;return t[2]!==l?(o=()=>
53{if(i.current){i.current=!1;return}l()},t[2]=l,t[3]=o):o=t[3],t[4]!==n?(e=[n],t[4]=n,t[5]=e):e=t[5],(0,c.useEffect)(o,e),null}var{WindowInfoProvider:x6}=go&&"WindowInfoProvider"in go?go:{WindowInfoProvider:void 0},{useWindowInfo:x5}=go&&"useWindowInfo"in go?go:{useWindowInfo:void 0},x4=(0,c.createContext)({searchParams:{},stringifyParams:()=>""}),x8=({children:e})=>{let t=(0,b.useSearchParams)().toString(),r=c.default.useMemo(()=>rh(t,{depth:10,ignoreQueryPrefix:!0}),[t]),n=c.default.useCallback(({params:e,replace:t=!1})=>t6({...t?{}:r,...e},{addQueryPrefix:!0}),[r]);return(0,h.jsx)(x4,{value:{searchParams:r,stringifyParams:n},children:e})},x7=({config:e})=>{let{admin:{toast:{duration:t,expand:r,limit:n,position:a}={}}={}}=e;return(0,h.jsx)(nV,{className:"payload-toast-container",closeButton:!0,dir:"undefined",duration:t??4e3,expand:r??!1,gap:8,icons:{error:(0,h.jsx)(xF,{}),info:(0,h.jsx)(xB,{}),success:(0,h.jsx)(xz,{}),warning:(0,h.jsx)(xU,{})},offset:"calc(var(--gutter-h) / 2)",position:a??"bottom-right",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:n??5})};function x9(e){let{className:t,loginWithUsername:r,operation:n,permissions:a,readOnly:l,t:i}=e;function o(e,t){return t9({field:{name:e,type:"text"},operation:"create"===n?"create":t,parentName:"",permissions:a}).operation}let s="object"==typeof a&&"email"in a&&a.email,c="object"==typeof a&&"username"in a&&a.username,u=s?{read:o("email","read"),update:o("email","update")}:{read:!0,update:!0},d=c?{read:o("username","read"),update:o("username","update")}:{read:!0,update:!0},f=(!r||r?.requireEmail||r?.allowEmailLogin)&&u.read,p=!!r&&d.read;if(f||p)return(0,h.jsxs)("div",{className:["login-fields",t&&t].filter(Boolean).join(" "),children:[f?(0,h.jsx)(oI,{value:"email",children:(0,h.jsx)(d5,{field:{name:"email",admin:{autoComplete:"off"},label:i("general:email"),required:!r||r&&r.requireEmail},path:"email",readOnly:l||!u.update,schemaPath:"email",validate:rB})}):null,p&&(0,h.jsx)(oI,{value:"username",children:(0,h.jsx)(hk,{field:{name:"username",admin:{autoComplete:"off"},label:i("authentication:username"),required:r&&r.requireUsername},path:"username",readOnly:l||!d.update,schemaPath:"username",validate:rz})})]})}var we="select-all",wt="select-row",wr=e=>{let{onClick:t}=e,{count:r,selected:n}=vk(),{t:a}=(0,f.d)();return n&&r?(0,h.jsxs)(sl,{onClick:()=>{"function"==typeof t&&t(n)},pillStyle:"white",size:"small",children:[a("general:select")," ",r]}):null},wn="collection-list",wa="move-to-folder--current-folder",wl="confirm-many-delete";function wi({className:e}){let t=(0,b.useRouter)(),{startRouteTransition:r}=nK(),{breadcrumbs:n,currentFolder:a,folderCollectionConfig:l,folderCollectionSlug:i,folderFieldName:o,folderID:s,getFolderRoute:u,moveToFolder:p}=mn(),[g,,{closeDrawer:v,openDrawer:y}]=fV({id:s,collectionSlug:i}),{clearRouteCache:x}=mi(),{config:w}=(0,d.c)(),{routes:C}=w,{closeModal:j,openModal:S}=lc(),{i18n:$,t:_}=(0,f.d)(),k=c.default.useCallback(async()=>{await fetch(tR({apiRoute:C.api,path:`/${i}/${s}?depth=0`}),{credentials:"include",method:"DELETE"}),r(()=>{t.push(u(n[n.length-2]?.id||null))})},[n,i,s,u,t,C.api,r]);return s?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(al,{button:(0,h.jsx)(yC,{}
53),className:["current-folder-actions",e].filter(Boolean).join(" "),render:()=>(0,h.jsxs)(n6.ButtonGroup,{children:[(0,h.jsx)(n6.Button,{onClick:()=>{y()},children:_("general:editLabel",{label:m(l.labels.singular,$)})}),(0,h.jsx)(n6.Button,{onClick:()=>{S(wa)},children:_("folder:moveFolder")}),(0,h.jsx)(n6.Button,{onClick:()=>{S(wl)},children:_("folder:deleteFolder")})]})}),(0,h.jsx)(mw,{action:"moveItemToFolder",drawerSlug:wa,folderAssignedCollections:a?.value.folderType,folderCollectionSlug:i,folderFieldName:o,fromFolderID:a?.value.id,fromFolderName:a?.value._folderOrDocumentTitle,itemsToMove:[a],onConfirm:async({id:e,name:t})=>{await p({itemsToMove:[a],toFolderID:e}),e?nI.success(_("folder:itemHasBeenMoved",{folderName:`"${t}"`,title:a.value._folderOrDocumentTitle})):nI.success(_("folder:itemHasBeenMovedToRoot",{title:a.value._folderOrDocumentTitle})),j(wa)},title:a.value._folderOrDocumentTitle}),(0,h.jsx)(iv,{body:(0,h.jsx)(mh,{elements:{1:({children:e})=>(0,h.jsx)("strong",{children:e})},i18nKey:"general:aboutToDelete",t:_,variables:{label:m(l.labels.singular,$),title:a.value._folderOrDocumentTitle}}),confirmingLabel:_("general:deleting"),heading:_("general:confirmDeletion"),modalSlug:wl,onConfirm:k}),(0,h.jsx)(g,{onSave:()=>{v(),x()}})]}):null}var wo="drag-overlay-selection";function ws({item:e,selectedCount:t}){return(0,h.jsx)(tD,{dropAnimation:null,modifiers:[wc],style:{height:"unset",maxWidth:"220px"},children:(0,h.jsxs)("div",{className:`${wo}__cards`,children:[Array.from({length:t>1?2:1}).map((t,r)=>(0,h.jsx)("div",{className:`${wo}__card`,style:{right:`${3*r}px`,top:`-${3*r}px`},children:(0,h.jsx)(xC,{id:null,isSelected:!0,itemKey:"overlay-card",title:e.value._folderOrDocumentTitle,type:"folder"})},r)),t>1?(0,h.jsx)("span",{className:`${wo}__card-count`,children:t}):null]})})}var wc=({activatorEvent:e,draggingNodeRect:t,transform:r})=>{if(t&&e){let n=function(e){if(function(e){if(!e)return!1;let{TouchEvent:t}=aj(e.target);return t&&e instanceof t}(e)){if(e.touches&&e.touches.length){let{clientX:t,clientY:r}=e.touches[0];return{x:t,y:r}}else if(e.changedTouches&&e.changedTouches.length){let{clientX:t,clientY:r}=e.changedTouches[0];return{x:t,y:r}}}return"clientX"in e&&"clientY"in e?{x:e.clientX,y:e.clientY}:null}(e);if(!n)return r;let a=n.x-t.left,l=n.y-t.top;return{...r,x:r.x+a+5,y:r.y+l+5}}return r},wu="sort-by-pill",wd=[{label:e=>e("general:name"),value:"name"},{label:e=>e("general:createdAt"),value:"createdAt"},{label:e=>e("general:updatedAt"),value:"updatedAt"}],wf=[{label:e=>(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(br,{}),e("general:ascending")]}),value:"asc"},{label:e=>(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(bt,{}),e("general:descending")]}),value:"desc"}];function wp(){let{refineFolderData:e,sort:t}=mn(),{t:r}=(0,f.d)(),n=t.startsWith("-")?"desc":"asc",[a]=wd.filter(({value:e})=>e===(t.startsWith("-")?t.slice(1):t))||wd,[l]=wf.filter(({value:e})=>e===n);return(0,h.jsx)(al,{button:(0,h.jsxs)(sl,{className:`${wu}__trigger`,icon:(0,h.jsx)(nZ,{}),size:"small",children:["asc"===n?(0,h.jsx)(br,{className:`${wu}__sort-icon`}):(0,h.jsx)(bt,{className:`${wu}__sort-icon`}),a?.label(r)]}),className:wu,horizontalAlign:"right",render:({close:t})=>(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(n6.GroupLabel,{label:"Sort by"}),(0,h.jsx)(n6.ButtonGroup,{children:wd.map(({label:l,value:i})=>(0,h.jsx)(n6.Button,{active:a?.value===i,onClick:()=>{e({query:{page:"1",sort:"desc"===n?`-${i}`:i},updateURL:!0}),t()},children:l(r)},i))}),(0,h.jsx)(n6.Divider,{}),(0,h.jsx)(n6.GroupLabel,{label:"Order"}),(0,h.jsx)(n6.ButtonGroup,{children:wf.map(({label:i,value:o})=>(0,h.jsx)(n6.Button,{active:l?.value===o,className:`${wu}__order-option`,onClick:()=>{n!==o&&(e({query:{page:"1",sort:"desc"===o?`-${a?.value}`:a?.value},updateURL:!0}),t())},children:i(r)},o))})]}),showScrollbar:!0,verticalAlign:"bottom"})}var wh="folder-view-toggle-button";function wm({activeView:e,setActiveView:t}){return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(au,{buttonStyle:"pill",className:[wh,"grid"===e&&`${wh}--active`].filter(Boolean).join(" "),icon:(0,h.jsx)(xM,{}),margin:!1,onClick:()=>{t("grid")}}),(0,h.jsx)(au,{buttonStyle:"pill",className:[wh,"list"===e&&`${wh}
53--active`].filter(Boolean).join(" "),icon:(0,h.jsx)(xI,{}),margin:!1,onClick:()=>{t("list")}})]})}var wg=({id:e,folderCollectionSlug:t})=>{let{clearRouteCache:r}=mi(),{t:n}=(0,f.d)(),[a,,{closeDrawer:l,openDrawer:i}]=fV({id:e,collectionSlug:t});return e?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(vP,{onClick:i,type:"button",children:n("general:edit")}),(0,h.jsx)(a,{onSave:()=>{l(),r()}})]}):null},wb="move-to-folder--list",wv=e=>{let t=(0,v.c)(17),{disableBulkDelete:r,disableBulkEdit:n,folderAssignedCollections:a}=e,{clearSelections:l,currentFolder:i,folderCollectionSlug:o,folderFieldName:s,folderID:u,getSelectedItems:p,moveToFolder:m}=mn(),{clearRouteCache:g}=mi(),{config:b}=(0,d.c)(),{t:y}=(0,f.d)(),{closeModal:x,openModal:w}=lc(),C,j;if(t[0]!==g||t[1]!==l||t[2]!==x||t[3]!==b||t[4]!==i?.value?._folderOrDocumentTitle||t[5]!==r||t[6]!==n||t[7]!==a||t[8]!==o||t[9]!==s||t[10]!==u||t[11]!==p||t[12]!==m||t[13]!==w||t[14]!==y){j=Symbol.for("react.early_return_sentinel");e:{let e=p(),t=e.reduce(wy,{}),d=e.length,f=1===Object.keys(t).length&&Object.keys(t)[0]!==o,v=f?b.collections.find(e=>e.slug===Object.keys(t)[0]):null;if(0===d){j=null;break e}let S=f&&t[Object.keys(t)[0]]?.ids||[];C=(0,h.jsx)(vN,{count:d,ListActions:[d>0&&(0,h.jsx)(vP,{onClick:()=>l(),children:y("general:clearAll")},"clear-all")].filter(Boolean),SelectionActions:[!n&&S.length&&(0,h.jsxs)(c.Fragment,{children:[(0,h.jsx)(yv,{collection:v,count:d,ids:S,selectAll:!1}),(0,h.jsx)(yM,{collection:v,count:d,ids:S,selectAll:!1}),(0,h.jsx)(yU,{collection:v,count:d,ids:S,selectAll:!1})]},"bulk-actions"),1===d&&!f&&(0,h.jsx)(wg,{folderCollectionSlug:o,id:t[o].ids[0]},"edit-folder-action"),d>0?(0,h.jsxs)(c.default.Fragment,{children:[(0,h.jsx)(vP,{onClick:()=>{w(wb)},type:"button",children:y("general:move")}),(0,h.jsx)(mw,{action:"moveItemsToFolder",drawerSlug:wb,folderAssignedCollections:a,folderCollectionSlug:o,folderFieldName:s,fromFolderID:u,fromFolderName:i?.value?._folderOrDocumentTitle,itemsToMove:p(),onConfirm:async e=>{let{id:t,name:r}=e;await m({itemsToMove:p(),toFolderID:t}),t?nI.success(y("folder:itemsMovedToFolder",{folderName:`"${r}"`,title:`${d} ${d>1?y("general:items"):y("general:item")}`})):nI.success(y("folder:itemsMovedToRoot",{title:`${d} ${d>1?y("general:items"):y("general:item")}`})),g(),x(wb)}})]},wb):null,!r&&(0,h.jsx)(vD,{afterDelete:()=>{g(),l()},hasDeletePermission:!0,selections:t},"bulk-delete")].filter(Boolean)})}t[0]=g,t[1]=l,t[2]=x,t[3]=b,t[4]=i?.value?._folderOrDocumentTitle,t[5]=r,t[6]=n,t[7]=a,t[8]=o,t[9]=s,t[10]=u,t[11]=p,t[12]=m,t[13]=w,t[14]=y,t[15]=C,t[16]=j}else C=t[15],j=t[16];return j!==Symbol.for("react.early_return_sentinel")?j:C};function wy(e,t){return t&&(e[t.relationTo]?(e[t.relationTo].ids.push(rD(t.value)),e[t.relationTo].totalCount=e[t.relationTo].totalCount+1):e[t.relationTo]={ids:[rD(t.value)],totalCount:1}),e}var wx="collection-folder-list";function ww(e){let t=(0,v.c)(6),{AfterFolderList:r,AfterFolderListTable:n,BeforeFolderList:a,BeforeFolderListTable:l,collectionSlug:i,Description:o,disableBulkDelete:s,disableBulkEdit:u,search:p,viewPreference:g}=e,{config:y,getEntityConfig:x}=(0,d.c)(),{i18n:w,t:C}=(0,f.d)(),j=a0(),{setStepNav:S}=vf(),{setPreference:$}=o_(),{allowCreateCollectionSlugs:_,breadcrumbs:k,documents:E,dragOverlayItem:N,folderCollectionConfig:P,folderCollectionSlug:T,FolderResultsComponent:D,folderType:R,getSelectedItems:A,moveToFolder:O,refineFolderData:L,selectedItemKeys:M,setIsDragging:I,subfolders:F}=mn(),B=(0,b.useRouter)(),{startRouteTransition:z}=nK(),{clearRouteCache:U}=mi(),V=x({collectionSlug:i}),{labels:H,upload:q}=V,K=!!q&&V.upload.bulkUpload,{breakpoints:W}=x5(),{s:G}=W,Y;t[0]!==U||t[1]!==A||t[2]!==O?(Y=async e=>{if(e.over&&"folder"===e.over.data.current.type&&"id"in e.over.data.current){try{await O({itemsToMove:A(),toFolderID:e.over.data.current.id})}catch(e){console.error("Error moving items:",e)}U()}},t[0]=U,t[1]=A,t[2]=O,t[3]=Y):Y=t[3];let Q=Y,X=async e=>{await $(`${i}-collection-folder`,{viewPreference:e}),U()};c.default.useEffect(()=>{j||S([k.length?{label:(0,h.jsxs)(mb,{className:[`${wx}__step-nav-droppable`,`${wx}
53__step-nav-icon-label`].filter(Boolean).join(" "),id:null,onClick:()=>{z(()=>{y.folders&&B.push(tR({adminRoute:y.routes.admin,path:`/collections/${i}/${y.folders.slug}`}))})},children:[(0,h.jsx)(mv,{}),m(H?.plural,w)]},"root")}:{label:(0,h.jsxs)("div",{className:`${wx}__step-nav-icon-label`,children:[(0,h.jsx)(mv,{}),m(H?.plural,w)]},"root")},...k.map((e,t)=>({label:t===k.length-1?e.name:(0,h.jsx)(mb,{className:`${wx}__step-nav-droppable`,id:e.id,onClick:()=>{z(()=>{y.folders&&B.push(tR({adminRoute:y.routes.admin,path:`/collections/${i}/${y.folders.slug}/${e.id}`}))})},children:e.name},e.id)}))])},[k,i,y.folders,y.routes.admin,y.serverURL,j,w,H?.plural,B,S,z]);let J=E.length+F.length,Z;return t[4]!==L?(Z=e=>L({query:{search:e},updateURL:!0}),t[4]=L,t[5]=Z):Z=t[5],(0,h.jsxs)(c.Fragment,{children:[(0,h.jsx)(wC,{onDragEnd:Q,setIsDragging:I}),(0,h.jsxs)("div",{className:`${wx} ${wx}--${i}`,children:[a,(0,h.jsxs)(io,{className:`${wx}__wrap`,children:[(0,h.jsx)(yG,{Actions:[!G&&(0,h.jsx)(wv,{disableBulkDelete:s,disableBulkEdit:V.disableBulkEdit??u,folderAssignedCollections:Array.isArray(R)?R:[i]},"list-selection"),(0,h.jsx)(yK,{collectionConfig:V,config:y,viewType:"folders"},"default-list-actions")].filter(Boolean),AfterListHeaderContent:o,title:m(H?.plural,w),TitleActions:[_.length&&(0,h.jsx)(mf,{buttonLabel:_.length>1?C("general:createNew"):`${C("general:create")} ${m(P.labels?.singular,w).toLowerCase()}`,collectionSlugs:_,folderAssignedCollections:Array.isArray(R)?R:[i],onCreateSuccess:U,slugPrefix:"create-document--header-pill"},"create-new-button"),(0,h.jsx)(yX,{collectionSlug:i,hasCreatePermission:_.includes(i),isBulkUploadEnabled:K},"bulk-upload-button")].filter(Boolean)}),(0,h.jsx)(yR,{Actions:[(0,h.jsx)(wp,{},"sort-by-pill"),(0,h.jsx)(wm,{activeView:g,setActiveView:X},"toggle-view-buttons"),(0,h.jsx)(wi,{},"current-folder-actions")].filter(Boolean),label:C("general:searchBy",{label:C("general:name")}),onSearchChange:Z,searchQueryParam:p}),l,J>0&&D,0===J&&(0,h.jsx)(fq,{Actions:[_.includes(T)&&(0,h.jsx)(mf,{buttonLabel:`${C("general:create")} ${m(P.labels?.singular,w).toLowerCase()}`,buttonSize:"medium",buttonStyle:"primary",collectionSlugs:[P.slug],folderAssignedCollections:Array.isArray(R)?R:[i],onCreateSuccess:U,slugPrefix:"create-folder--no-results"},"create-folder"),_.includes(i)&&(0,h.jsx)(mf,{buttonLabel:`${C("general:create")} ${C("general:document").toLowerCase()}`,buttonSize:"medium",buttonStyle:"primary",collectionSlugs:[i],folderAssignedCollections:Array.isArray(R)?R:[i],onCreateSuccess:U,slugPrefix:"create-document--no-results"},"create-document")].filter(Boolean),Message:(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)("h3",{children:w.t("general:noResultsFound")}),(0,h.jsx)("p",{children:w.t("general:noResultsDescription")})]})}),n]}),r]}),M.size>0&&N&&(0,h.jsx)(ws,{item:N,selectedCount:M.size})]})}function wC(e){let t=(0,v.c)(3),{onDragEnd:r,setIsDragging:n}=e,a;return t[0]!==r||t[1]!==n?(a={onDragCancel(){n(!1)},onDragEnd(e){n(!1),r(e)},onDragStart(){n(!0)}},t[0]=r,t[1]=n,t[2]=a):a=t[2],ea(a),null}var wj="checkbox-popup";function wS({Button:e,className:t,onChange:r,options:n,selectedValues:a,...l}){return(0,h.jsx)(al,{button:e,className:[wj,t].filter(Boolean).join(" "),horizontalAlign:"right",render:({close:e})=>(0,h.jsx)("div",{className:`${wj}__options`,children:n.map(({label:t,value:n})=>(0,h.jsx)(oX,{checked:a?.includes(n),label:t,onToggle:()=>{r({close:e,selectedValues:a?.includes(n)?a.filter(e=>e!==n):[...a,n]})}},n))}),showScrollbar:!0,verticalAlign:"bottom",...l})}function w$(){let e=(0,v.c)(13),{activeCollectionFolderSlugs:t,allCollectionFolderSlugs:r,folderCollectionSlug:n,refineFolderData:a}=mn(),{i18n:l,t:i}=(0,f.d)(),{config:o,getEntityConfig:s}=(0,d.c)(),u;e[0]!==o||e[1]!==n||e[2]!==r||e[3]!==s||e[4]!==l?(u=()=>o.collections.reduce((e,t)=>(t.folders&&r.includes(t.slug)&&e.push({label:m(t.labels?.plural,l),value:t.slug}),e),[{label:m(s({collectionSlug:n}).labels?.plural,l),value:n}]),e[0]=o,e[1]=n,e[2]=r,e[3]=s,e[4]=l,e[5]=u):u=e[5];let[p]=c.default.useState(u),g;if(e[6]!==p||e[7]!==a||e[8]!==i||e[9]!==t){let r;e[11]!==a?(r=e=>{let{selectedValues:t}=e;a({query:{relationTo:t},updateURL:!0})},e[11]=a,e[12]=r):r=e[12],g=(0,h.jsx)(wS,{Button:(0,h.jsxs)(au,{buttonStyle:"pill",el:"div",icon:"chevron",margin:!1,size:"small",children:[t.length?(0,h.jsx)("span",{className:"collection-type__count",children:t.length}):null,i("version:type")]}),onChange:r,options:p,selectedValues:t}
53,"relation-to-selection-popup"),e[6]=p,e[7]=a,e[8]=i,e[9]=t,e[10]=g}else g=e[10];return g}var w_="folder-list";function wk(e){let t=(0,v.c)(20),{AfterFolderList:r,AfterFolderListTable:n,BeforeFolderList:a,BeforeFolderListTable:l,Description:i,disableBulkDelete:o,disableBulkEdit:s,folderAssignedCollections:u,viewPreference:d}=e,p=(0,b.useRouter)(),{i18n:g,t:y}=(0,f.d)(),x=a0(),{setStepNav:w}=vf(),{startRouteTransition:C}=nK(),{clearRouteCache:j}=mi(),{breakpoints:S}=x5(),{s:$}=S,{setPreference:_}=o_(),{allowCreateCollectionSlugs:k,breadcrumbs:E,documents:N,dragOverlayItem:P,folderCollectionConfig:T,folderID:D,folderType:R,getFolderRoute:A,getSelectedItems:O,moveToFolder:L,refineFolderData:M,search:I,selectedItemKeys:F,setIsDragging:B,subfolders:z}=mn(),[U,V]=c.default.useState(d||"grid"),H;t[0]!==E||t[1]!==T||t[2]!==g||t[3]!==y?(H=()=>y("folder:searchByNameInFolder",{folderName:0===E.length?m(T.labels?.plural,g):E[E.length-1].name}),t[0]=E,t[1]=T,t[2]=g,t[3]=y,t[4]=H):H=t[4];let[q]=c.default.useState(H),K;t[5]!==j||t[6]!==O||t[7]!==L?(K=async e=>{e.over&&"folder"===e.over.data.current.type&&"id"in e.over.data.current&&(await L({itemsToMove:O(),toFolderID:e.over.data.current.id||null}),j())},t[5]=j,t[6]=O,t[7]=L,t[8]=K):K=t[8];let W=K,G=N.length+z.length,Y=E.length?E[E.length-1].name:y("folder:browseByFolder"),Q,X;t[9]!==E||t[10]!==x||t[11]!==A||t[12]!==p||t[13]!==w||t[14]!==C||t[15]!==y?(Q=()=>{x||w([E.length?{label:(0,h.jsxs)(mb,{className:[`${w_}__step-nav-droppable`,`${w_}__step-nav-icon-label`].filter(Boolean).join(" "),id:null,onClick:()=>{C(()=>{p.push(A(null))})},children:[(0,h.jsx)(mv,{}),y("folder:browseByFolder")]},"root")}:{label:(0,h.jsxs)("div",{className:`${w_}__step-nav-icon-label`,children:[(0,h.jsx)(mv,{}),y("folder:browseByFolder")]},"root")},...E.map((e,t)=>({label:t===E.length-1?e.name:(0,h.jsx)(mb,{className:`${w_}__step-nav-droppable`,id:e.id,onClick:()=>{C(()=>{p.push(A(e.id))})},children:e.name},e.id)}))])},X=[E,x,A,p,w,C,y],t[9]=E,t[10]=x,t[11]=A,t[12]=p,t[13]=w,t[14]=C,t[15]=y,t[16]=Q,t[17]=X):(Q=t[16],X=t[17]),c.default.useEffect(Q,X);let J=k.filter(e=>e!==T.slug),Z;return t[18]!==M?(Z=e=>M({query:{search:e},updateURL:!0}),t[18]=M,t[19]=Z):Z=t[19],(0,h.jsxs)(c.Fragment,{children:[(0,h.jsx)(wE,{onDragEnd:W,setIsDragging:B}),(0,h.jsxs)("div",{className:`${w_} ${w_}--folders`,children:[a,(0,h.jsxs)(io,{className:`${w_}__wrap`,children:[(0,h.jsx)(yG,{Actions:[!$&&(0,h.jsx)(wv,{disableBulkDelete:o,disableBulkEdit:s,folderAssignedCollections:u},"list-selection")].filter(Boolean),AfterListHeaderContent:i,title:Y,TitleActions:[k.length&&(0,h.jsx)(mf,{buttonLabel:k.length>1?y("general:createNew"):`${y("general:create")} ${m(T.labels?.singular,g).toLowerCase()}`,collectionSlugs:k,folderAssignedCollections:Array.isArray(R)?R:[],onCreateSuccess:j,slugPrefix:"create-document--header-pill"},"create-new-button")].filter(Boolean)}),(0,h.jsx)(yR,{Actions:[(0,h.jsx)(wp,{},"sort-by-pill"),D&&(0,h.jsx)(w$,{},"collection-type"),(0,h.jsx)(wm,{activeView:U,setActiveView:e=>{_(rY.BROWSE_BY_FOLDER,{viewPreference:e}),V(e)}},"toggle-view-buttons"),(0,h.jsx)(wi,{},"current-folder-actions")].filter(Boolean),label:q,onSearchChange:Z,searchQueryParam:I}),l,G>0&&(0,h.jsx)(h.Fragment,{children:"grid"===U?(0,h.jsxs)("div",{children:[z.length?(0,h.jsx)(h.Fragment,{children:(0,h.jsx)(x_,{items:z,title:"Folders",type:"folder"})}):null,N.length?(0,h.jsx)(h.Fragment,{children:(0,h.jsx)(x_,{items:N,subfolderCount:z.length,title:"Documents",type:"file"})}):null]}):(0,h.jsx)(xv,{})}),0===G&&(0,h.jsx)(fq,{Actions:[k.includes(T.slug)&&(0,h.jsx)(mf,{buttonLabel:`${y("general:create")} ${m(T.labels?.singular,g).toLowerCase()}`,buttonSize:"medium",buttonStyle:"primary",collectionSlugs:[T.slug],folderAssignedCollections:Array.isArray(R)?R:[],onCreateSuccess:j,slugPrefix:"create-folder--no-results"},"create-folder"),D&&J.length>0&&(0,h.jsx)(mf,{buttonLabel:`${y("general:create")} ${y("general:document").toLowerCase()}`,buttonSize:"medium",buttonStyle:"primary",collectionSlugs:J,folderAssignedCollections:Array.isArray(R)?R:[],onCreateSuccess:j,slugPrefix:"create-document--no-results"}
53,"create-document")].filter(Boolean),Message:(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)("h3",{children:g.t("general:noResultsFound")}),(0,h.jsx)("p",{children:g.t("general:noResultsDescription")})]})}),n]}),r]}),F.size>0&&P&&(0,h.jsx)(ws,{item:P,selectedCount:F.size})]})}function wE(e){let t=(0,v.c)(3),{onDragEnd:r,setIsDragging:n}=e,a;return t[0]!==r||t[1]!==n?(a={onDragCancel(){n(!1)},onDragEnd(e){n(!1),r(e)},onDragStart(){n(!0)}},t[0]=r,t[1]=n,t[2]=a):a=t[2],ea(a),null}var wN="leave-without-saving-doc-drawer",wP=e=>{let t=(0,v.c)(15),{AfterHeader:r,drawerSlug:n,showDocumentID:a}=e,l=void 0===a||a,{closeModal:i,openModal:o}=lc(),{t:s}=(0,f.d)(),c=nw(),u;t[0]!==i||t[1]!==n||t[2]!==c||t[3]!==o?(u=()=>{c?o(wN):i(n)},t[0]=i,t[1]=n,t[2]=c,t[3]=o,t[4]=u):u=t[4];let d=u,p;if(t[5]!==r||t[6]!==i||t[7]!==n||t[8]!==d||t[9]!==l||t[10]!==s){let e;t[12]!==i||t[13]!==n?(e=()=>i(n),t[12]=i,t[13]=n,t[14]=e):e=t[14],p=(0,h.jsxs)(io,{className:`${fB}__header`,children:[(0,h.jsxs)("div",{className:`${fB}__header-content`,children:[(0,h.jsx)("h2",{className:`${fB}__header-text`,children:(0,h.jsx)(xP,{element:"span"})}),(0,h.jsx)("button",{"aria-label":s("general:close"),className:`${fB}__header-close`,onClick:d,type:"button",children:(0,h.jsx)(f.a,{})})]}),l&&(0,h.jsx)(wT,{}),r?(0,h.jsx)("div",{className:`${fB}__after-header`,children:r}):null,(0,h.jsx)(bK,{modalSlug:wN,onConfirm:e})]}),t[5]=r,t[6]=i,t[7]=n,t[8]=d,t[9]=l,t[10]=s,t[11]=p}else p=t[11];return p},wT=()=>{let e=(0,v.c)(3),{id:t}=oD(),{title:r}=ow(),n;return e[0]!==t||e[1]!==r?(n=t&&t!==r?(0,h.jsx)(xE,{id:t.toString()}):null,e[0]=t,e[1]=r,e[2]=n):n=e[2],n},wD="document-stale-data",wR="document-stale-data",wA=e=>{let t,r=(0,v.c)(14),{isActive:n,onReload:a}=e,{closeModal:l,openModal:i}=lc(),{clearRouteCache:o}=mi(),{t:s}=(0,f.d)(),u,d;if(r[0]!==l||r[1]!==n||r[2]!==i?(u=()=>{n?i(wD):l(wD)},d=[n,i,l],r[0]=l,r[1]=n,r[2]=i,r[3]=u,r[4]=d):(u=r[3],d=r[4]),(0,c.useEffect)(u,d),r[5]!==o||r[6]!==l||r[7]!==a||r[8]!==s){let e;r[10]!==o||r[11]!==l||r[12]!==a?(e=async()=>{l(wD),o(),await a()},r[10]=o,r[11]=l,r[12]=a,r[13]=e):e=r[13],t=(0,h.jsx)(l_,{className:wR,closeOnBlur:!1,slug:wD,children:(0,h.jsxs)("div",{className:`${wR}__wrapper`,children:[(0,h.jsxs)("div",{className:`${wR}__content`,children:[(0,h.jsx)("h1",{children:s("general:documentModified")}),(0,h.jsx)("p",{children:s("general:documentOutOfDate")})]}),(0,h.jsx)("div",{className:`${wR}__controls`,children:(0,h.jsx)(au,{buttonStyle:"primary",id:`${wD}-reload`,margin:!1,onClick:e,size:"medium",children:s("general:reloadDocument")})})]})}),r[5]=o,r[6]=l,r[7]=a,r[8]=s,r[9]=t}else t=r[9];return t},wO=e=>{let{children:t}=e,r=c.default.useRef(null),n=c.default.useRef(null),{breakpoint:a,setMeasuredDeviceSize:l,size:i,zoom:o}=vA(),{size:s}=g9(r.current),{size:u}=g9(n.current);(0,c.useEffect)(()=>{s&&l(s)},[s,l]);let d="0",f="0";if(a&&"responsive"!==a&&(d="-50%",i&&s&&"number"==typeof o&&"number"==typeof i.width&&"number"==typeof i.height&&"number"==typeof s.width&&"number"==typeof s.height)){f="0 auto";let e=i.width/o,t=s.width*o,r=e-i.width;if(t>u.width)if(o>1){let e=s.width-u.width;d=e<0?`${e/2}px`:"0"}else d="0";else o>=1?d=`${r/2}px`:(d=`${(u.width-t)/2}px`,f="0")}let p=o?`${100/o}%`:"100%",m=o?`${100/o}%`:"100%";return"responsive"!==a&&(p=`${i?.width/("number"==typeof o?o:1)}px`,m=`${i?.height/("number"==typeof o?o:1)}px`),(0,h.jsx)("div",{ref:n,style:{height:"100%",width:"100%"},children:(0,h.jsx)("div",{ref:r,style:{height:m,margin:f,transform:`translate3d(${d}, 0, 0)`,width:p},children:t})})},wL=()=>{let e=(0,v.c)(8),{iframeRef:t,setLoadedURL:r,url:n,zoom:a}=vA(),l;e[0]!==r||e[1]!==n?(l=()=>{r(n)},e[0]=r,e[1]=n,e[2]=l):l=e[2];let i="number"==typeof a?`scale(${a}) `:void 0,o;return e[3]!==t||e[4]!==l||e[5]!==i||e[6]!==n?(o=(0,h.jsx)("iframe",{className:"live-preview-iframe",onLoad:l,ref:t,src:n,style:{transform:i},title:n},n),e[3]=t,e[4]=l,e[5]=i,e[6]=n,e[7]=o):o=e[7],o},wM=e=>{let t=(0,v.c)(18),{axis:r}=e,{breakpoint:n,measuredDeviceSize:a,setBreakpoint:l,setSize:i,size:o,zoom:s}=vA(),[u,d]=c.default.useState(("x"===r?a?.width:a?.height)||0),f;t[0]!==r||t[1]!==a?.height||t[2]!==a?.width||t[3]!==l||t[4]!==i||t[5]!==s?(f=e=>{let t=Number(e.target.value);t<0&&(t=0),d(t),l("custom"),i({type:"reset",value:{height:"y"===r?t:Number(a?.height.toFixed(0))*s,width:"x"===r?t:Number(a?.width.toFixed(0))*s}})},t[0]=r,t[1]=a?.height,t[2]=a?.width,t[3]=l,t[4]=i,t[5]=s,t[6]=f):f=t[6];let p=f,m,g;t[7]!==r||t[8]!==n||t[9]!==a||t[10]!==o||t[11]!==s?(m=()=>{"responsive"===n&&a&&d("x"===r?Number(a.width.toFixed(0))*s:Number(a.height.toFixed(0))*s),"responsive"!==n&&o&&d("x"===r?o.width:o.height)},g=[n,r,a,o,s],t[7]=r,t[8]=n,t[9]=a,t[10]=o,t[11]=s,t[12]=m,t[13]=g):(m=t[12],g=t[13]),(0,c.useEffect)(m,g);let b="x"===r?"live-preview-width":"live-preview-height",y=u||0,x;return t[14]!==p||t[15]!==b||t[16]!==y?(x=(0,h.jsx)("input",{className:"toolbar-input",min:0,name:b,onChange:p,step:1,type:"number",value:y}),t[14]=p,t[15]=b,t[16]=y,t[17]=x):x=t[17],x}
53,wI="live-preview-toolbar-controls",wF=[50,75,100,125,150,200],wB=()=>{let e=(0,v.c)(14),{breakpoint:t,breakpoints:r,setBreakpoint:n,setPreviewWindowType:a,setZoom:l,url:i,zoom:o}=vA(),{t:s}=(0,f.d)(),u;if(e[0]!==t||e[1]!==r||e[2]!==n||e[3]!==a||e[4]!==l||e[5]!==s||e[6]!==i||e[7]!==o){let d,p={label:s("general:custom"),value:"custom"},m;e[9]!==l||e[10]!==o?(m=e=>{let{close:t}=e;return(0,h.jsx)(n6.ButtonGroup,{children:(0,h.jsx)(c.default.Fragment,{children:wF.map(e=>(0,h.jsxs)(n6.Button,{active:100*o==e,onClick:()=>{l(e/100),t()},children:[e,"%"]},e))})})},e[9]=l,e[10]=o,e[11]=m):m=e[11],e[12]!==a?(d=e=>{e.preventDefault(),a("popup")},e[12]=a,e[13]=d):d=e[13],u=(0,h.jsxs)("div",{className:wI,children:[r?.length>0&&(0,h.jsx)(al,{button:(0,h.jsxs)(c.default.Fragment,{children:[(0,h.jsx)("span",{children:r.find(e=>e.name==t)?.label??p.label}),(0,h.jsx)(nZ,{className:`${wI}__chevron`})]}),className:`${wI}__breakpoint`,horizontalAlign:"right",render:e=>{let{close:a}=e;return(0,h.jsx)(n6.ButtonGroup,{children:(0,h.jsxs)(c.default.Fragment,{children:[r.map(e=>(0,h.jsx)(n6.Button,{active:e.name==t,onClick:()=>{n(e.name),a()},children:e.label},e.name)),"custom"===t&&(0,h.jsx)(n6.Button,{active:t==p.value,onClick:()=>{n(p.value),a()},children:p.label})]})})},showScrollbar:!0,verticalAlign:"bottom"}),(0,h.jsxs)("div",{className:`${wI}__device-size`,children:[(0,h.jsx)(wM,{axis:"x"}),(0,h.jsx)("span",{className:`${wI}__size-divider`,children:(0,h.jsx)(f.a,{})}),(0,h.jsx)(wM,{axis:"y"})]}),(0,h.jsx)(al,{button:(0,h.jsxs)(c.default.Fragment,{children:[(0,h.jsxs)("span",{children:[100*o,"%"]}),(0,h.jsx)(nZ,{className:`${wI}__chevron`})]}),className:`${wI}__zoom`,horizontalAlign:"right",render:m,showScrollbar:!0,verticalAlign:"bottom"}),(0,h.jsx)("a",{className:`${wI}__external`,href:i,onClick:d,target:"_blank",title:"Open in new window",type:"button",children:(0,h.jsx)(vQ,{})})]}),e[0]=t,e[1]=r,e[2]=n,e[3]=a,e[4]=l,e[5]=s,e[6]=i,e[7]=o,e[8]=u}else u=e[8];return u},wz="live-preview-toolbar",wU=e=>{let t=(0,v.c)(10),{toolbarPosition:r}=vA(),n;t[0]===Symbol.for("react.memo_cache_sentinel")?(n={id:"live-preview-toolbar"},t[0]=n):n=t[0];let{attributes:a,listeners:l,setNodeRef:i,transform:o}=tx(n),s;t[1]===Symbol.for("react.memo_cache_sentinel")?(s=[wz,`${wz}--draggable`],t[1]=s):s=t[1];let c=`${r.x}px`,u=`${r.y}px`,d;return t[2]!==a||t[3]!==l||t[4]!==e||t[5]!==i||t[6]!==c||t[7]!==u||t[8]!==o?(d=(0,h.jsxs)("div",{className:s.join(" "),style:{left:c,top:u,...o?{transform:o?`translate3d(${o?.x||0}px, ${o?.y||0}px, 0)`:void 0}:{}},children:[(0,h.jsx)("button",{...l,...a,className:`${wz}__drag-handle`,ref:i,type:"button",children:(0,h.jsx)(o6,{})}),(0,h.jsx)(wB,{...e})]}),t[2]=a,t[3]=l,t[4]=e,t[5]=i,t[6]=c,t[7]=u,t[8]=o,t[9]=d):d=t[9],d},wV=e=>(0,h.jsx)("div",{className:[wz,`${wz}--static`].join(" "),children:(0,h.jsx)(wB,{...e})}),wH=e=>{let{draggable:t}=e;return t?(0,h.jsx)(wU,{...e}):(0,h.jsx)(wV,{...e})},wq="live-preview-window",wK=e=>{let t,r,n,a=(0,v.c)(50),{appIsReady:l,breakpoint:i,iframeRef:o,isLivePreviewing:s,loadedURL:u,popupRef:f,previewWindowType:p,shouldRenderIframe:m,url:g}=vA(),b=iP(),{mostRecentUpdate:y}=pB(),[x]=nS(),{id:w,collectionSlug:C,globalSlug:j}=oD(),S;if(a[0]!==l||a[1]!==C||a[2]!==x||a[3]!==j||a[4]!==w||a[5]!==o||a[6]!==s||a[7]!==b||a[8]!==y||a[9]!==f||a[10]!==p||a[11]!==g?(S=()=>{if(!(!s||!l)&&x){let e=rN(x,!0);e.id||(e.id=w);let t={type:"payload-live-preview",collectionSlug:C,data:e,externallyUpdatedRelationship:y,globalSlug:j,locale:b.code};"popup"===p&&f.current&&f.current.postMessage(t,g),"iframe"===p&&o.current&&o.current.contentWindow?.postMessage(t,g)}},a[0]=l,a[1]=C,a[2]=x,a[3]=j,a[4]=w,a[5]=o,a[6]=s,a[7]=b,a[8]=y,a[9]=f,a[10]=p,a[11]=g,a[12]=S):S=a[12],a[13]!==l||a[14]!==C||a[15]!==x||a[16]!==j||a[17]!==w||a[18]!==o||a[19]!==s||a[20]!==u||a[21]!==b||a[22]!==y||a[23]!==f||a[24]!==p||a[25]!==g?(t=[x,g,C,j,w,p,f,l,o,y,b,s,u],a[13]=l,a[14]=C,a[15]=x,a[16]=j,a[17]=w,a[18]=o,a[19]=s,a[20]=u,a[21]=b,a[22]=y,a[23]=f,a[24]=p,a[25]=g,a[26]=t):t=a[26],(0,c.useEffect)(S,t),a[27]!==l||a[28]!==o||a[29]!==s||a[30]!==f||a[31]!==p||a[32]!==g?(r=()=>{if(!s||!l)return;let e={type:"payload-document-event"};"popup"===p&&f.current&&f.current.postMessage(e,g),"iframe"===p&&o.current&&o.current.contentWindow?.postMessage(e,g)},a[27]=l,a[28]=o,a[29]=s,a[30]=f,a[31]=p,a[32]=g,a[33]=r):r=a[33],a[34]!==l||a[35]!==o||a[36]!==s||a[37]!==y||a[38]!==f||a[39]!==p||a[40]!==g?(n=[y,o,f,p,g,s,l],a[34]=l,a[35]=o,a[36]=s,a[37]=y,a[38]=f,a[39]=p,a[40]=g,a[41]=n):n=a[41],(0,c.useEffect)(r,n),"iframe"!==p)return null;let $=s&&`${wq}--is-live-previewing`,_=i&&"responsive"!==i&&`${wq}--has-breakpoint`,k;
53a[42]!==$||a[43]!==_?(k=[wq,$,_].filter(Boolean),a[42]=$,a[43]=_,a[44]=k):k=a[44];let E=k.join(" "),N;return a[45]!==e||a[46]!==m||a[47]!==E||a[48]!==g?(N=(0,h.jsx)("div",{className:E,children:(0,h.jsxs)("div",{className:`${wq}__wrapper`,children:[(0,h.jsx)(wH,{...e}),(0,h.jsx)("div",{className:`${wq}__main`,children:(0,h.jsx)(wO,{children:g&&m?(0,h.jsx)(wL,{}):(0,h.jsx)(d.f,{height:"100%"})})})]})}),a[45]=e,a[46]=m,a[47]=E,a[48]=g,a[49]=N):N=a[49],N},wW=async({id:e,clearRouteCache:t,collectionSlug:r,documentLockStateRef:n,globalSlug:a,isLockingEnabled:l,isWithinDoc:i,setCurrentEditor:o,setIsReadOnlyForIncomingUser:s,updateDocumentEditor:c,user:u})=>{if(l)try{await c(e,r??a,u),i||(n.current.hasShownLockedModal=!0),n.current={hasShownLockedModal:n.current?.hasShownLockedModal,isLocked:!0,user:u},o(u),i&&s&&s(!1),t&&t()}catch(e){console.error("Error during document takeover:",e)}},wG="api-key",wY=({enabled:e,readOnly:t})=>{let[r]=(0,c.useState)(sh()),[n,a]=(0,c.useState)(!1),[l,i]=(0,c.useState)(!1),{i18n:o,t:s}=(0,f.d)(),{config:u,getEntityConfig:p}=(0,d.c)(),{collectionSlug:g}=oD(),b=nj(([e])=>e&&e.apiKey||null),v=p({collectionSlug:g})?.fields?.find(e=>"name"in e&&"apiKey"===e.name),y=b?.value,x=(0,c.useMemo)(()=>{let e="API Key";return v?.label&&(e=v.label),m(e,o)},[v,o]),w=(0,c.useMemo)(()=>(0,h.jsxs)("label",{className:`${wG}__label field-label`,htmlFor:"apiKey",children:[(0,h.jsx)("span",{children:x}),(0,h.jsx)(mQ,{value:y})]}),[x,y]),{setValue:C,value:j}=oz({path:"apiKey",validate:e=>rM(e,{name:"apiKey",type:"text",blockData:{},data:{},event:"onChange",maxLength:48,minLength:24,path:["apiKey"],preferences:{fields:{}},req:{payload:{config:u},t:s},siblingData:{}})});return(0,c.useEffect)(()=>{!y&&e&&C(r),!e&&y&&C(null)},[y,e,C,r]),(0,c.useEffect)(()=>{n&&setTimeout(()=>{a(!1)},1e4)},[n]),e?(0,h.jsxs)(c.default.Fragment,{children:[(0,h.jsxs)("div",{className:["field-type","api-key","read-only"].filter(
53Boolean).join(" "),children:[w,(0,h.jsxs)("div",{className:`${wG}__input-wrap`,children:[(0,h.jsx)("input",{"aria-label":x,className:n?"highlight":void 0,disabled:!0,id:"apiKey",name:"apiKey",type:l?"text":"password",value:j||""}),(0,h.jsx)("div",{className:`${wG}__toggle-button-wrap`,children:(0,h.jsx)(au,{buttonStyle:"none",className:`${wG}__toggle-button`,icon:(0,h.jsx)(vV,{active:l}),onClick:()=>i(e=>!e)})})]})]}),!t&&(0,h.jsx)(yy,{highlightField:()=>{n&&a(!1),setTimeout(()=>{a(!0)},1)},setKey:()=>C(sh())})]}):null},wQ="auth-fields",wX=e=>{let t,r=(0,v.c)(21),{className:n,collectionSlug:a,disableLocalStrategy:l,email:i,loginWithUsername:o,operation:s,readOnly:u,requirePassword:p,setValidateBeforeSubmit:m,useAPIKey:g,username:b,verify:y}=e,[x,w]=(0,c.useState)(p),C=nj(wJ),j=nj(wZ),S=nw(),{i18n:$,t:_}=(0,f.d)(),{docPermissions:k,isEditing:E,isInitializing:N,isTrashed:P}=oD(),{config:T}=(0,d.c)(),{routes:D}=T,{api:R}=D,A=!0,O=!0,L="object"==typeof k.fields&&"password"in k.fields,M="object"==typeof k.fields&&("username"in k.fields||"email"in k.fields);if(L){let{permissions:e}=t9({field:{name:"password",type:"text"},operation:s,parentName:"",permissions:k?.fields});A="create"===s?!0===e||"object"==typeof e&&e.create:!0===e||"object"==typeof e&&e.update}if(M){let e=o&&(o.requireEmail||o.allowEmailLogin),t;r[0]!==k.fields?(t=t9({field:{name:"email",type:"text"},operation:"read",parentName:"",permissions:k?.fields}),r[0]=k.fields,r[1]=t):t=r[1];let{operation:n}=t,a;r[2]!==k.fields?(a=t9({field:{name:"username",type:"text"},operation:"read",parentName:"",permissions:k?.fields}),r[2]=k.fields,r[3]=a):a=r[3];let{operation:l}=a;O=e?l||n:o&&!e?l:n}let I=(!l||"object"==typeof l&&!0===l.enableFields)&&(O||A),F=u||N||P,B=k?.fields===!0||k?.fields?.enableAPIKey,z=u||!0===B||B&&"object"==typeof B&&!B?.update,U=u||!0!==B&&!B?.update,V=!0===B||B?.read,H;e:{if(k){H=!!("unlock"in k&&k.unlock);break e}H=!1}let q=H,K;r[4]!==j||r[5]!==m||r[6]!==_?(K=e=>{e?(m(!0),j({type:"UPDATE",errorMessage:_("validation:required"),path:"password",valid:!1}),j({type:"UPDATE",errorMessage:_("validation:required"),path:"confirm-password",valid:!1})):(m(!1),j({type:"REMOVE",path:"password"}),j({type:"REMOVE",path:"confirm-password"})),w(e)},r[4]=j,r[5]=m,r[6]=_,r[7]=K):K=r[7];let W=K,G;r[8]!==R||r[9]!==a||r[10]!==i||r[11]!==$||r[12]!==o||r[13]!==_||r[14]!==b?(G=async()=>{let e=tR({apiRoute:R,path:`/${a}/unlock`});200===(await fetch(e,{body:JSON.stringify(o&&b?{username:b}:{email:i}),credentials:"include",headers:{"Accept-Language":$.language,"Content-Type":"application/json"},method:"post"})).status?nI.success(_("authentication:successfullyUnlocked")):nI.error(_("authentication:failedToUnlock"))},r[8]=R,r[9]=a,r[10]=i,r[11]=$,r[12]=o,r[13]=_,r[14]=b,r[15]=G):G=r[15];let Y=G,Q,X;return(r[16]!==S?(Q=()=>{S||w(!1)},X=[S],r[16]=S,r[17]=Q,r[18]=X):(Q=r[17],X=r[18]),(0,c.useEffect)(Q,X),I||g&&V||y&&E)?(r[19]!==n?(t=[wQ,n].filter(Boolean),r[19]=n,r[20]=t):t=r[20],(0,h.jsxs)("div",{className:t.join(" "),children:[I&&(0,h.jsxs)(c.default.Fragment,{children:[(0,h.jsx)(x9,{loginWithUsername:o,operation:s,permissions:k?.fields,readOnly:u||P,t:_}),(x||p)&&(!l||!I)&&(0,h.jsxs)("div",{className:`${wQ}__changing-password`,children:[(0,h.jsx)(gZ,{autoComplete:"new-password",field:{name:"password",label:_("authentication:newPassword"),required:!0},indexPath:"",parentPath:"",parentSchemaPath:"",path:"password",schemaPath:"password"}),(0,h.jsx)(gQ,{disabled:u||P})]}),(0,h.jsxs)("div",{className:`${wQ}__controls`,children:[x&&!p&&(0,h.jsx)(au,{buttonStyle:"secondary",disabled:F,id:"cancel-change-password",onClick:()=>W(!1),size:"medium",children:_("general:cancel")}),!x&&!p&&!l&&A&&(0,h.jsx)(au,{buttonStyle:"secondary",disabled:F,id:"change-password",onClick:()=>W(!0),size:"medium",children:_("authentication:changePassword")}),!x&&"update"===s&&q&&(0,h.jsx)(au,{buttonStyle:"secondary",disabled:F||!O,id:"force-unlock",onClick:()=>{Y()},size:"medium",children:_("authentication:forceUnlock")})]})]}),g&&(0,h.jsx)("div",{className:`${wQ}__api-key`,children:V&&(0,h.jsxs)(c.Fragment,{children:[(0,h.jsx)(oZ,{field:{name:"enableAPIKey",admin:{disabled:F,readOnly:U},label:_("authentication:enableAPIKey")},path:"enableAPIKey",schemaPath:`${a}.enableAPIKey`}),(0,h.jsx)(wY,{enabled:!!C?.value,readOnly:z})]})}),y&&E&&(0,h.jsx)(oZ,{field:{name:"_verified",admin:{disabled:F,readOnly:u},label:_("authentication:verified")},path:"_verified",schemaPath:`${a}._verified`})]})):null};function wJ(e){let[t]=e;return t&&t?.enableAPIKey||null}function wZ(e){return e[1]}var w0=e=>{let t,r=(0,v.c)(37),{id:n,collectionSlug:a,globalSlug:l,isTrashed:i,pluralLabel:o,useAsTitle:s}=e,u=e?.view||void 0,{isEditing:p,isInitializing:h}=oD(),{title:g}=ow(),{isEntityVisible:b}=xX(),y;r[0]!==a||r[1]!==l||r[2]!==b?(y=b({collectionSlug:a,globalSlug:l}),r[0]=a,r[1]=l,r[2]=b,r[3]=y):y=r[3];let x=y,{setStepNav:w}=vf(),{i18n:C,t:j}=(0,f.d)(),{config:S}=(0,d.c)(),{routes:$,serverURL:_}=S,{admin:k}=$,E;return r[4]!==k||r[5]!==a||r[6]!==l||r[7]!==C||r[8]!==n||r[9]!==p||r[10]!==h||r[11]!==i||r[12]!==x||r[13]!==o||r[14]!==w||r[15]!==j||r[16]!==g||r[17]!==s||r[18]!==u?(E=()=>{let e=[];
53h||(a?(e.push({label:m(o,C),url:x?tR({adminRoute:k,path:`/collections/${a}`}):void 0}),i&&e.push({label:j("general:trash"),url:x?tR({adminRoute:k,path:`/collections/${a}/trash`}):void 0}),p?e.push({label:s&&"id"!==s&&g||`${n}`,url:x?tR({adminRoute:k,path:i?`/collections/${a}/trash/${n}`:`/collections/${a}/${n}`}):void 0}):e.push({label:j("general:createNew")})):l&&e.push({label:g,url:x?tR({adminRoute:k,path:`/globals/${l}`}):void 0}),u&&e.push({label:u}),w(e))},r[4]=k,r[5]=a,r[6]=l,r[7]=C,r[8]=n,r[9]=p,r[10]=h,r[11]=i,r[12]=x,r[13]=o,r[14]=w,r[15]=j,r[16]=g,r[17]=s,r[18]=u,r[19]=E):E=r[19],r[20]!==k||r[21]!==a||r[22]!==l||r[23]!==C||r[24]!==n||r[25]!==p||r[26]!==h||r[27]!==i||r[28]!==x||r[29]!==o||r[30]!==_||r[31]!==w||r[32]!==j||r[33]!==g||r[34]!==s||r[35]!==u?(t=[w,h,p,o,n,i,s,k,j,C,g,a,l,_,u,x],r[20]=k,r[21]=a,r[22]=l,r[23]=C,r[24]=n,r[25]=p,r[26]=h,r[27]=i,r[28]=x,r[29]=o,r[30]=_,r[31]=w,r[32]=j,r[33]=g,r[34]=s,r[35]=u,r[36]=t):t=r[36],(0,c.useEffect)(E,t),null},w1=e=>{let t=(0,v.c)(14),{collectionConfig:r,config:n,fallback:a,globalConfig:l}=e,i=r?.admin?.useAsTitle,o;t[0]!==i?(o=e=>{let[t]=e;return i&&t&&t?.[i]||null},t[0]=i,t[1]=o):o=t[1];let s=nj(o),u=(0,c.useRef)(!1),{i18n:d}=(0,f.d)(),{setDocumentTitle:p}=ow(),h=n?.admin?.dateFormat,m=s?.value||"",g;t[2]!==r||t[3]!==h||t[4]!==a||t[5]!==l||t[6]!==d||t[7]!==m||t[8]!==i?(g=oy({collectionConfig:r,data:{id:"",[i]:m},dateFormat:h,fallback:a,globalConfig:l,i18n:d}),t[2]=r,t[3]=h,t[4]=a,t[5]=l,t[6]=d,t[7]=m,t[8]=i,t[9]=g):g=t[9];let b=g,y,x;return t[10]!==p||t[11]!==b?(y=()=>{if(!u.current){u.current=!0;return}p(b)},x=[p,b],t[10]=p,t[11]=b,t[12]=y,t[13]=x):(y=t[12],x=t[13]),(0,c.useEffect)(y,x),null},w2="collection-edit",w3="payload-pending-success-toast",w6=({children:e})=>(0,h.jsx)("div",{className:"field-diff-label",children:e}),w5="field-diff";e.s(["Account",0,b6,"ActionsProvider",0,e=>{let t=(0,v.c)(4),{Actions:r,children:n}=e,[a,l]=(0,c.useState)(r),i;return t[0]!==r||t[1]!==n||t[2]!==a?(i=(0,h.jsx)(b5,{value:{Actions:{...a,...r},setViewActions:l},children:n}),t[0]=r,t[1]=n,t[2]=a,t[3]=i):i=t[3],i},"AnimateHeight",0,o5,"AppHeader",0,function({CustomAvatar:e,CustomIcon:t}){let{t:r}=(0,f.d)(),{Actions:n}=b4(),{config:{admin:{routes:{account:a}},localization:l,routes:{admin:i},serverURL:o}}=(0,d.c)(),{navOpen:s}=vi(),u=(0,c.useRef)(null),[p,m]=(0,c.useState)(!1);(0,c.useEffect)(()=>{let e=()=>{let e=u.current;e&&m(e.scrollWidth>e.clientWidth)};return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}},[n]);let g=n?Object.values(n):[];return(0,h.jsxs)("header",{className:[vb,s&&`${vb}--nav-open`].filter(Boolean).join(" "),children:[(0,h.jsx)("div",{className:`${vb}__bg`}),(0,h.jsx)("div",{className:`${vb}__content`,children:(0,h.jsxs)("div",{className:`${vb}__wrapper`,children:[(0,h.jsx)(vu,{className:`${vb}__mobile-nav-toggler`,tabIndex:-1,children:(0,h.jsx)(ve,{})}),(0,h.jsxs)("div",{className:`${vb}__controls-wrapper`,children:[(0,h.jsx)("div",{className:`${vb}__step-nav-wrapper`,children:(0,h.jsx)(vg,{className:`${vb}__step-nav`,CustomIcon:t})}),(0,h.jsxs)("div",{className:`${vb}__actions-wrapper`,children:[(0,h.jsx)("div",{className:`${vb}__actions`,ref:u,children:g.map((e,t)=>(0,h.jsx)("div",{className:p&&t===g.length-1?`${vb}__last-action`:"",children:e},t))}),p&&(0,h.jsx)("div",{className:`${vb}__gradient-placeholder`})]}),l&&(0,h.jsx)(vr,{ariaLabel:"invisible",className:`${vb}__localizer-spacing`}),(0,h.jsx)(nQ,{"aria-label":r("authentication:account"),className:`${vb}__account`,href:tR({adminRoute:i,path:a}),prefetch:!1,tabIndex:0,children:(0,h.jsx)(r7,{CustomComponent:e,Fallback:(0,h.jsx)(b6,{})})})]})]})}),(0,h.jsx)(va,{className:`${vb}__localizer`})]})},"ArrayField",0,gY,"AuthProvider",0,ij,"Banner",0,nJ,"BlockSelector",0,sx,"BlocksDrawer",0,sw,"BlocksField",0,sE,"BrowseByFolderButton",0,function({active:e}){let{t:t}=(0,f.d)(),{config:r}=(0,d.c)(),{admin:{routes:{browseByFolder:n}},routes:{admin:a}}=r;return(0,h.jsxs)(nQ,{className:["browse-by-folder-button",e&&"active"].filter(Boolean).join(" "),href:tR({adminRoute:a,path:n}),id:"browse-by-folder",prefetch:!1,children:[(0,h.jsx)(mv,{}),t("folder:browseByFolder")]})},"BulkUploadDrawer",0,gj,"BulkUploadProvider",0,gN,"Button",0,au,"Card",0,e=>{let{id:t,actions:r,buttonAriaLabel:n,href:a,onClick:l,title:i,titleAs:o}=e,s=[vv,t,(l||a)&&`${vv}
53--has-onclick`].filter(Boolean).join(" ");return(0,h.jsxs)("div",{className:s,id:t,children:[(0,h.jsx)(o??"div",{className:`${vv}__title`,children:i}),r&&(0,h.jsx)("div",{className:`${vv}__actions`,children:r}),(l||a)&&(0,h.jsx)(au,{"aria-label":n,buttonStyle:"none",className:`${vv}__click`,el:"link",onClick:l,to:a})]})},"CheckIcon",0,oG,"CheckboxField",0,oZ,"CheckboxInput",0,oX,"ChevronIcon",0,nZ,"ClientFunctionProvider",0,xq,"CloseMenuIcon",0,b8,"CodeBlockIcon",0,()=>(0,h.jsx)("svg",{"aria-hidden":"true",className:"graphic code-block-icon",focusable:"false",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:(0,h.jsx)("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"})}),"CodeEditorLazy",0,sP,"CodeField",0,sD,"Collapsible",0,se,"CollapsibleField",0,sL,"Combobox",0,e=>{let{entries:t,minEntriesForSearch:r=8,onSelect:n,onToggleClose:a,onToggleOpen:l,searchPlaceholder:i="Search...",...o}=e,[s,u]=(0,c.useState)(""),d=(0,c.useRef)(!1),f=(0,c.useRef)(null),p=(0,c.useMemo)(()=>{if(!s)return t;let e=s.toLowerCase();return t.filter(t=>t.name.toLowerCase().includes(e))},[t,s]),m=t.length>=r,g=p.length>0,b=c.default.useCallback(e=>{d.current=e,e&&m&&setTimeout(()=>{f.current?.focus()},100),l?.(e)},[m,l]),v=c.default.useCallback(()=>{d.current=!1,u(""),a?.()},[a]);return(0,h.jsx)(al,{...o,className:`${xn} ${o.className||""}`,onToggleClose:v,onToggleOpen:b,render:({close:e})=>(0,h.jsxs)("div",{className:`${xn}__content`,children:[m&&(0,h.jsx)("div",{className:`${xn}__search-wrapper${g?"":` ${xn}__search-wrapper--no-results`}`,children:(0,h.jsx)("input",{"aria-label":i,className:`${xn}__search-input`,onChange:e=>u(e.target.value),placeholder:i,ref:f,type:"text",value:s})}),(0,h.jsx)(n6.ButtonGroup,{children:p.map((t,r)=>{let a=()=>{n&&n(t),e()};return(0,h.jsx)("div",{className:`${xn}__entry`,"data-popup-prevent-close":!0,onClick:a,onKeyDown:e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),a())},role:"menuitem",tabIndex:0,children:t.Component},`${t.name}-${r}`)})})]})})},"ConfirmPasswordField",0,gQ,"ConfirmationModal",0,iv,"CopyIcon",0,ag,"CopyLocaleData",0,vw,"CopyToClipboard",0,mQ,"DateCell",0,f3,"DateCondition",0,bj,"DateTimeField",0,d6,"DefaultBlockImage",0,sm,"DefaultBrowseByFolderView",0,function({activeCollectionFolderSlugs:e,allCollectionFolderSlugs:t,allowCreateCollectionSlugs:r,baseFolderPath:n,breadcrumbs:a,documents:l,folderFieldName:i,folderID:o,FolderResultsComponent:s,search:c,subfolders:u,...d}){return(0,h.jsx)(mr,{activeCollectionFolderSlugs:e,allCollectionFolderSlugs:t,allowCreateCollectionSlugs:r,baseFolderPath:n,breadcrumbs:a,documents:l,folderFieldName:i,folderID:o,FolderResultsComponent:s,search:c,subfolders:u,children:(0,h.jsx)(wk,{...d})})},"DefaultCell",0,pa,"DefaultCollectionFolderView",0,function({allCollectionFolderSlugs:e,allowCreateCollectionSlugs:t,baseFolderPath:r,breadcrumbs:n,documents:a,folderFieldName:l,folderID:i,FolderResultsComponent:o,search:s,sort:c,subfolders:u,...d}){return(0,h.jsx)(mr,{allCollectionFolderSlugs:e,allowCreateCollectionSlugs:t,baseFolderPath:r,breadcrumbs:n,documents:a,folderFieldName:l,folderID:i,FolderResultsComponent:o,search:s,sort:c,subfolders:u,children:(0,h.jsx)(ww,{...d})})},"DefaultEditView",0,function({BeforeDocumentControls:e,Description:t,EditMenuItems:r,LivePreview:n,PreviewButton:a,PublishButton:l,SaveButton:i,SaveDraftButton:o,Status:s,UnpublishButton:u,Upload:f,UploadControls:p}){let{id:m,action:g,AfterDocument:v,AfterFields:y,apiURL:x,BeforeFields:w,collectionSlug:C,currentEditor:j,data:S,disableActions:$,disableCreate:_,disableLeaveWithoutSaving:k,docPermissions:E,documentIsLocked:N,documentLockState:P,getDocPermissions:T,getDocPreferences:D,globalSlug:R,hasPublishPermission:A,hasSavePermission:O,incrementVersionCount:L,initialState:M,isEditing:I,isInitializing:F,isLocked:B,isTrashed:z,lastUpdateTime:U,redirectAfterCreate:V,redirectAfterDelete:H,redirectAfterDuplicate:q,redirectAfterRestore:K,setCurrentEditor:W,setData:G,setDocumentIsLocked:Y,setLastUpdateTime:Q,unlockDocument:X,updateDocumentEditor:J}=oD(),{clearDoc:Z,drawerSlug:ee,onDelete:et,onDuplicate:er,onRestore:en,onSave:ea}=fI(),el=!!ee,{refreshCookieAsync:ei,user:eo}=iS(),{config:es,config:{admin:{user:ec},routes:{admin:eu},serverURL:ed},getEntityConfig:ef}=(0,d.c)(),ep=ef({collectionSlug:C}),eh=ef({globalSlug:R}),em=a0(),eg=(0,b.useRouter)(),eb=(0,b.useSearchParams)(),{reportUpdate:ev}=pB(),{resetUploadEdits:ey}=oN(),{getFormState:ex}=fg(),{startRouteTransition:ew}=nK(),{clearRouteCache:eC}=mi(),{isLivePreviewEnabled:ej,isLivePreviewing:eS,previewWindowType:e$,setURL:e_,typeofLivePreviewURL:ek,url:eE}=vA(),{isPreviewEnabled:eN,setPreviewURL:eP}=vO(),eT=(0,c.useRef)(null),eD=(0,c.useRef)(null),eR=eb.get("locale"),eA=ep?.slug||eh?.slug,eO=C&&!m?"create":"update",eL=ep?ep.auth:void 0,eM=ep?ep.upload:void 0,eI=ep||eh,eF=eI?.lockDocuments===void 0||eI?.lockDocuments,eB=!1!==eF,ez=("object"==typeof eF?eF.duration:300)*1e3,eU=rx(eI),[eV,eH]=(0,c.useState)(!1),[eq,eK]=(0,c.useState)(!1),[eW,eG]=(0,c.useState)(!1),[eY,eQ]=(0,c.useState)(Date.now()),eX=(0,c.useRef)(!1),eJ=(0,c.useRef)(S?.updatedAt),eZ=(0,c.useRef)(0),e0=(0,c.useRef)(!1),e1=U+ez,e2=Date.now()>e1,e3=!eV&&("u">typeof k?!k:!eU),e6=(0,c.useMemo)(()=>[eA],[eA]),[e5,e4]=(0,c.useState)(()=>!!("create"===eO&&eL&&!eL.disableLocalStrategy)),e8=c.default.useRef(null),e7=(0,c.useCallback)(e=>{Y(!0);let t="object"==typeof P.current?.user?P.current?.user?.id:P.current?.user;if(e&&e.user){let r="string"==typeof e.user||"number"==typeof e.user?e.user:e.user.id;P.current&&r===t||(t===eo.id&&r!==eo.id&&(eK(!0),P.current.hasShownLockedModal=!0),P.current={hasShownLockedModal:P.current?.hasShownLockedModal||!1,isLocked:!0,user:e.user},W(e.user)),e.lastEditedAt&&Q(new Date(e.lastEditedAt).getTime())}},[P,W,Y,Q,eo?.id]),e9=(0,c.useCallback)(()=>{eG(!1),eg.refresh()}
53,[eg]),te=(0,c.useCallback)(e=>{e8.current=e},[]),tt=(0,c.useCallback)(async()=>{let e=P.current?.user,t="object"==typeof e?e?.id===eo?.id:e===eo?.id;if(eB&&N&&(m||R)){let e=e8.current?new URL(e8.current).pathname:"",r=["/preview","/api","/versions"].some(t=>e.includes(t));if(t&&!r)try{await X(m,C??R),Y(!1),W(null)}catch(e){console.error("Failed to unlock before leave",e)}}},[C,N,P,R,m,eB,W,Y,X,eo?.id]),tr=(0,c.useCallback)(async(e,t)=>{let{context:r,formState:n}=t||{},a=fO(eD),l=e?.doc||e?.result,i=l?.updatedAt||new Date().toISOString();if(eo&&C===ec&&m===eo.id&&ei(),Q(new Date(i).getTime()),eJ.current=i,eX.current=!1,e0.current=!1,r?.incrementVersionCount!==!1&&L(),"function"==typeof G&&G(l||{}),"function"==typeof ea){let t=m?"update":"create";ea({...e,context:r,operation:t,updatedAt:"update"===t?new Date().toISOString():l?.updatedAt||new Date().toISOString()})}if(!I&&em<2&&!1!==V){e.message&&"u">typeof window&&window.sessionStorage.setItem(w3,e.message);let t=tR({adminRoute:eu,path:`/collections/${C}/${l?.id}${eR?`?locale=${eR}`:""}`});ew(()=>eg.push(t))}else ey();if(r?.getDocPermissions!==!1&&await T(e),m||R){let e=await D(),{livePreviewURL:t,previewURL:r,state:o}=await ex({id:m,collectionSlug:C,data:l,docPermissions:E,docPreferences:e,formState:n,globalSlug:R,operation:eO,renderAllFields:!1,returnLivePreviewURL:ej&&"function"===ek,returnLockStatus:!1,returnPreviewURL:eN,schemaPath:e6.join("."),signal:a.signal,skipValidation:!0});return eM&&o&&delete o.file,eB&&Y(!1),ej&&"function"===ek&&e_(t),eN&&eP(r),ev({id:m,doc:l,drawerSlug:ee,entitySlug:eA,operation:"update",updatedAt:i}),eD.current=null,o}ev({id:m,doc:l,drawerSlug:ee,entitySlug:eA,operation:"create",updatedAt:i})},[eo,C,ec,m,Q,G,ea,I,em,V,R,ei,L,eu,eR,ew,eg,ey,T,D,ex,E,eO,ej,ek,eN,e6,eM,eB,ev,ee,eA,Y,e_,eP]),tn=(0,c.useCallback)(async({formState:e,submitted:t})=>{let r=fO(eT),n=eZ.current,a=e0.current;S?.updatedAt&&S.updatedAt>eJ.current&&(eJ.current=S.updatedAt,eX.current=!1);let l=Date.now(),i=l-eY,o=eB&&i>=1e4;o&&eQ(l);let s=!eX.current&&eJ.current&&"update"===eO&&!eU;s&&(eX.current=!0);let c=await D(),u=await ex({id:m,checkForStaleData:s,collectionSlug:C,docPermissions:E,docPreferences:c,formState:e,globalSlug:R,operation:eO,originalUpdatedAt:s?eJ.current:void 0,renderAllFields:!1,returnLockStatus:eB,schemaPath:e6.join("."),signal:r.signal,skipValidation:!t,updateLastEdited:o});if(!u)return;let{lockedState:d,staleDataState:f,state:p}=u;return eB&&e7(d),f?.isStale&&!a&&eZ.current===n&&eG(!0),eT.current=null,p},[S?.updatedAt,eY,eB,D,ex,m,C,E,R,eO,e6,e7,eU]);(0,c.useEffect)(()=>()=>{eK(!1)},[]),(0,c.useEffect)(()=>{let e=eT.current,t=eD.current;return()=>{fA(e),fA(t)}},[]),(0,c.useEffect)(()=>{if(!F&&"u">typeof window){let e=window.sessionStorage.getItem(w3);e&&(window.sessionStorage.removeItem(w3),nI.success(e))}},[F]);let ta=N&&j&&("object"==typeof j?j.id!==eo?.id:j!==eo?.id)&&!eV&&!eq&&!P.current?.hasShownLockedModal&&!e2,tl=es.folders&&C===es.folders?.slug;return(0,h.jsx)("main",{className:[w2,(m||R)&&`${w2}--is-editing`,R&&`global-edit--${R}`,C&&`collection-edit--${C}`,eS&&"iframe"===e$&&`${w2}--is-live-previewing`].filter(Boolean).join(" "),children:(0,h.jsx)(oL,{operation:eO,children:(0,h.jsxs)(hm,{action:g,className:`${w2}__form`,disabled:eV||F||!O||z,disableSuccessStatus:!I&&em<2&&!1!==V,disableValidationOnSubmit:!e5,initialState:!F&&M,isDocumentForm:!0,isInitializing:F,method:m?"PATCH":"POST",onChange:[tn],onSubmit:()=>{eZ.current+=1,e0.current=!0},onSuccess:tr,children:[el&&(0,h.jsx)(wP,{AfterHeader:t,drawerSlug:ee,showDocumentID:!tl}),eB&&ta&&(0,h.jsx)(bJ,{handleGoBack:()=>(({adminRoute:e,collectionSlug:t,router:r,serverURL:n})=>{let a=tR({adminRoute:e,path:t?`/collections/${t}`:"/"});r.push(a)})({adminRoute:eu,collectionSlug:C,router:eg,serverURL:ed}),isActive:ta,onReadOnly:()=>{eH(!0),eK(!1)},onTakeOver:()=>wW({id:m,clearRouteCache:eC,collectionSlug:C,documentLockStateRef:P,globalSlug:R,isLockingEnabled:eB,isWithinDoc:!1,setCurrentEditor:W,updateDocumentEditor:J,user:eo}),updatedAt:U,user:j}),eB&&eq&&(0,h.jsx)(bY,{handleBackToDashboard:()=>(({adminRoute:e,router:t,serverURL:r})=>{let n=tR({adminRoute:e,path:"",serverURL:r});t.push(n)})({adminRoute:eu,router:eg,serverURL:ed}),isActive:eq,onReadOnly:()=>{eH(!0),eK(!1)}}),eW&&(0,h.jsx)(wA,{isActive:eW,onReload:e9}),e3&&(0,h.jsx)(bq,{onConfirm:tt,onPrevent:te}),!el&&(0,h.jsx)(w0,{collectionSlug:ep?.slug,globalSlug:eh?.slug,id:m,isTrashed:z,pluralLabel:ep?.labels?.plural,useAsTitle:ep?.admin?.useAsTitle}),(0,h.jsx)(w1,{collectionConfig:ep,config:es,fallback:em<=1?m?.toString():void 0,globalConfig:eh}),(0,h.jsx)(yr,{apiURL:x,BeforeDocumentControls:e,customComponents:{PreviewButton:a,PublishButton:l,SaveButton:i,SaveDraftButton:o,Status:s,UnpublishButton:u},data:S,disableActions:$||tl||z,disableCreate:_,EditMenuItems:r,hasPublishPermission:A,hasSavePermission:O,id:m,isEditing:I,isInDrawer:el,isTrashed:z,onDelete:et,onDrawerCreateNew:Z,onDuplicate:er,onRestore:en,onSave:tr,onTakeOver:()=>wW({id:m,clearRouteCache:eC,collectionSlug:C,documentLockStateRef:P,globalSlug:R,isLockingEnabled:eB,isWithinDoc:!0,setCurrentEditor:W,setIsReadOnlyForIncomingUser:eH,updateDocumentEditor:J,user:eo}),permissions:E,readOnlyForIncomingUser:eV,redirectAfterDelete:H,redirectAfterDuplicate:q,redirectAfterRestore:K,slug:ep?.slug||eh?.slug,user:j}),(0,h.jsxs)("div",{className:[`${w2}__main-wrapper`,"popup"===e$&&`${w2}
53--detached`].filter(Boolean).join(" "),children:[(0,h.jsxs)("div",{className:[`${w2}__main`,"popup"===e$&&`${w2}__main--popup-open`].filter(Boolean).join(" "),children:[(0,h.jsx)(h9,{AfterFields:y,BeforeFields:w||(0,h.jsxs)(c.Fragment,{children:[eL&&(0,h.jsx)(wX,{className:`${w2}__auth`,collectionSlug:ep.slug,disableLocalStrategy:ep.auth?.disableLocalStrategy,email:S?.email,loginWithUsername:eL?.loginWithUsername,operation:eO,readOnly:!O,requirePassword:!m,setValidateBeforeSubmit:e4,useAPIKey:eL.useAPIKey,username:S?.username,verify:eL.verify}),eM&&(0,h.jsx)(c.default.Fragment,{children:(0,h.jsx)(hD,{children:f||(0,h.jsx)(gt,{collectionSlug:ep.slug,initialState:M,uploadConfig:eM,UploadControls:p})})})]}),Description:t,docPermissions:E,fields:eI.fields,forceSidebarWrap:eS,isTrashed:z,readOnly:eV||!O||z,schemaPathSegments:e6}),v]}),ej&&!el&&eE&&(0,h.jsx)(h.Fragment,{children:n||(0,h.jsx)(wK,{collectionSlug:C,globalSlug:R})})]})]},`${B}`)})})},"DefaultListView",0,function(e){let{AfterList:t,AfterListTable:r,beforeActions:n,BeforeList:a,BeforeListTable:l,collectionSlug:i,columnState:o,Description:s,disableBulkDelete:u,disableBulkEdit:p,disableQueryPresets:g,enableRowSelections:v,hasCreatePermission:y,hasDeletePermission:x,hasTrashPermission:w,listMenuItems:C,newDocumentURL:j,queryPreset:S,queryPresetPermissions:$,renderedFilters:_,resolvedFilterOptions:k,Table:E,viewType:N}=e,[P]=(0,d.a)(E),{allowCreate:T,createNewDrawerSlug:D,isInDrawer:R,onBulkSelect:A}=fs(),O=void 0!==T?T&&y:y,{config:{routes:{admin:L},serverURL:M},getEntityConfig:I}=(0,d.c)(),F=(0,b.useRouter)(),{data:B,isGroupingBy:z}=fd(),{openModal:U}=lc(),{drawerSlug:V,setCollectionSlug:H,setOnSuccess:q}=gP(),K=I({collectionSlug:i}),{labels:W,upload:G}=K,Y=!!G,Q=Y&&K.upload.bulkUpload,X=!!K.trash,{i18n:J}=(0,f.d)(),{setStepNav:Z}=vf(),{breakpoints:{s:ee}}=x5(),et=c.default.useMemo(()=>Y?B.docs.map(e=>({...e,filesize:rR(e.filesize)})):B?.docs,[B?.docs,Y]),er=c.default.useCallback(()=>{H(i),U(V),q(()=>F.refresh())},[F,i,V,U,H,q]);return(0,c.useEffect)(()=>{if(!R){let e={label:m(W?.plural,J),url:X&&"trash"===N?tR({adminRoute:L,path:`/collections/${i}`}):void 0},t={label:J.t("general:trash")};Z(X&&"trash"===N?[e,t]:[e])}},[L,Z,M,W,R,X,N,J,i]),(0,h.jsxs)(c.Fragment,{children:[(0,h.jsx)(fx,{collectionSlug:i,columnState:o,children:(0,h.jsx)("div",{className:`${wn} ${wn}--${i}`,children:(0,h.jsxs)(v_,{docs:et,totalDocs:B?.totalDocs,children:[a,(0,h.jsxs)(io,{className:`${wn}__wrap`,children:[(0,h.jsx)(y2,{collectionConfig:K,Description:s||K?.admin?.description?(0,h.jsx)("div",{className:`${wn}__sub-header`,children:(0,h.jsx)(r7,{CustomComponent:s,Fallback:(0,h.jsx)(bZ,{collectionSlug:i,description:K?.admin?.description})})}):void 0,disableBulkDelete:u,disableBulkEdit:p,hasCreatePermission:O,hasDeletePermission:x,hasTrashPermission:w,i18n:J,isBulkUploadEnabled:Q&&!G.hideFileInputOnCreate,isTrashEnabled:X,newDocumentURL:j,openBulkUpload:er,smallBreak:ee,viewType:N}),(0,h.jsx)(yO,{beforeActions:v&&"function"==typeof A?n?[...n,(0,h.jsx)(wr,{onClick:A},"select-many")]:[(0,h.jsx)(wr,{onClick:A},"select-many")]:n,collectionConfig:K,collectionSlug:i,disableQueryPresets:K?.enableQueryPresets!==!0||g,listMenuItems:C,queryPreset:S,queryPresetPermissions:$,renderedFilters:_,resolvedFilterOptions:k}),l,et?.length>0&&(0,h.jsx)("div",{className:`${wn}__tables`,children:(0,h.jsx)(fY,{children:P})}),et?.length===0&&(0,h.jsx)(fq,{Actions:O&&j&&"trash"!==N?[R?(0,h.jsx)(au,{el:"button",onClick:()=>U(D),children:J.t("general:createNewLabel",{label:m(W?.singular,J)})},"create"):(0,h.jsx)(au,{el:"link",to:j,children:J.t("general:createNewLabel",{label:m(W?.singular,J)})},"create")]:[],Message:"trash"===N?(0,h.jsx)("p",{children:J.t("general:noTrashResults",{label:m(W?.plural,J)})}):(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)("h3",{children:J.t("general:noResultsFound")}),(0,h.jsx)("p",{children:J.t("general:noResultsDescription")})]})}),r,et?.length>0&&!z&&(0,h.jsx)(y9,{AfterPageControls:ee?(0,h.jsxs)("div",{className:`${wn}__list-selection`,children:[(0,h.jsx)(yV,{collectionConfig:K,disableBulkDelete:u,disableBulkEdit:p,label:m(K.labels.plural,J),showSelectAllAcrossPages:!z}),(0,h.jsx)("div",{className:`${wn}__list-selection-actions`,children:v&&"function"==typeof A?n?[...n,(0,h.jsx)(wr,{onClick:A},"select-many")]:[(0,h.jsx)(wr,{onClick:A},"select-many")]:n})]}):null,collectionConfig:K})]}),t]})})}),et?.length>0&&z&&B.totalPages>1&&(0,h.jsx)(xe,{children:(0,h.jsx)(y9,{collectionConfig:K})})]})},"DeleteMany",0,vT,"DocumentControls",0,yr,"DocumentEventsProvider",0,pF,"DocumentFields",0,h9,"DocumentIcon",0,xa,"DocumentInfoProvider",0,oA,"DocumentLocked",0,bJ,"DocumentTakeOver",0,bY,"DragHandleIcon",0,o6,"Drawer",0,ip,"DrawerContentContainer",0,mu,"DrawerToggler",0,id,"Dropzone",0,hO,"EditDepthProvider",0,aZ,"EditIcon",0,n0,"EditMany",0,e=>{let t=(0,v.c)(8),{count:r,selectAll:n,selectedIDs:a,toggleAll:l}=vk(),i;t[0]!==l?(i=()=>l(),t[0]=l,t[1]=i):i=t[1];let o=n===vj.AllAvailable,s;return t[2]!==r||t[3]!==e||t[4]!==a||t[5]!==i||t[6]!==o?(s=(0,h.jsx)(yv,{...e,count:r,ids:a,onSuccess:i,selectAll:o}),t[2]=r,t[3]=e,t[4]=a,t[5]=i,t[6]=o,t[7]=s):s=t[7],s},"EditUpload",0,mK,"EmailAndUsernameFields",0,x9,"EmailField",0,d5,"EntityVisibilityProvi
53der",0,e=>{let t=(0,v.c)(6),{children:r,visibleEntities:n}=e,a;t[0]!==n?(a=e=>{let{collectionSlug:t,globalSlug:r}=e;return t?n.collections.includes(t):!!r&&n.globals.includes(r)},t[0]=n,t[1]=a):a=t[1];let l=a,i;return t[2]!==r||t[3]!==l||t[4]!==n?(i=(0,h.jsx)(xQ,{value:{isEntityVisible:l,visibleEntities:n},children:r}),t[2]=r,t[3]=l,t[4]=n,t[5]=i):i=t[5],i},"ErrorIcon",0,xF,"ErrorPill",0,aG,"ExternalLinkIcon",0,vQ,"FieldContext",0,oB,"FieldDescription",0,aQ,"FieldDiffContainer",0,e=>{let{className:t,From:r,i18n:n,label:{label:a,locale:l},nestingLevel:i=0,To:o}=e;return(0,h.jsxs)("div",{className:`${w5}-container${t?` ${t}`:""} nested-level-${i}`,style:i?{"--left-offset":`calc(50%  - (${i} * calc( calc(var(--base)* 0.5) - 2.5px  )))`}:{"--left-offset":"50%"},children:[(0,h.jsxs)(w6,{children:[l&&(0,h.jsx)("span",{className:`${w5}__locale-label`,children:l}),"function"!=typeof a&&m(a||"",n)]}),(0,h.jsxs)("div",{className:`${w5}-content`,style:i?{gridTemplateColumns:"calc(var(--left-offset) - calc(var(--base)*0.5) )     calc(50% - calc(var(--base)*0.5) + calc(50% - var(--left-offset)))"}:void 0,children:[r,o]})]})},"FieldDiffLabel",0,w6,"FieldError",0,aX,"FieldLabel",0,iR,"FieldPathContext",0,oI,"File",0,f6,"FileDetails",0,m1,"FolderFileTable",0,xv,"FolderIcon",0,me,"FolderProvider",0,mr,"FolderTypeField",0,e=>{let{field:t,field:{name:r,admin:{className:n,isClearable:a=!0,isSortable:l=!0,placeholder:i}={},hasMany:o=!1,label:s,localized:u,options:d=[],required:p},onChange:m,path:g,readOnly:b,validate:v}=e,{t:y}=(0,f.d)(),{folderType:x}=mn(),w=c.default.useMemo(()=>x&&0!==x.length?p7(d.filter(e=>"object"!=typeof e||!e.value||x.includes(e.value))):p7(d),[d,x]),{customComponents:{AfterInput:C,BeforeInput:j,Description:S,Error:$,Label:_}={},disabled:k,path:E,selectFilterOptions:N,setValue:P,showError:T,value:D}=oz({potentiallyStalePath:g,validate:c.default.useCallback((e,t)=>{if("function"==typeof v)return v(e,{...t,hasMany:o,options:w,required:p})},[v,p,o,w])}),R=c.default.useCallback(e=>{if(!b||k){let t=null;e&&o?t=Array.isArray(e)&&e.length>0?e.map(e=>e.value):null:e&&!Array.isArray(e)&&(t=e.value),"function"==typeof m&&m(t),P(t)}},[b,k,o,P,m]),A=c.default.useMemo(()=>oq(t),[t]);return(0,h.jsx)(p8,{AfterInput:C,BeforeInput:j,className:n,Description:S,description:y("folder:folderTypeDescription"),Error:$,filterOption:N?({value:e})=>N?.some(t=>("string"==typeof t?t:t.value)===e):void 0,hasMany:o,isClearable:a,isSortable:l,Label:_,label:s,localized:u,name:r,onChange:R,options:w,path:E,placeholder:i,readOnly:b||k,required:p||Array.isArray(x)&&x.length>0,showError:T,style:A,value:D})},"Form",0,hm,"FormLoadingOverlayToggle",0,e=>{let t=(0,v.c)(6),{name:r,type:n,action:a,formIsLoading:l,loadingSuffix:i}=e,o=void 0===n?"fullscreen":n,s=void 0!==l&&l,c=ny(),{i18n:u,t:d}=(0,f.d)(),p=`${{create:d("general:creating"),loading:d("general:loading"),update:d("general:updating")}[a]} ${i?m(i,u):""}`,g;return t[0]!==s||t[1]!==c||t[2]!==r||t[3]!==p||t[4]!==o?(g=(0,h.jsx)(fR,{loadingText:p.trim(),name:r,show:s||c,type:o}),t[0]=s,t[1]=c,t[2]=r,t[3]=p,t[4]=o,t[5]=g):g=t[5],g},"FormSubmit",0,mo,"FullscreenModal",0,function(e){let t=(0,v.c)(3),r=a0(),n;return t[0]!==r||t[1]!==e?(n=(0,h.jsx)(l_,{closeOnBlur:!1,...e,style:{...e.style||{},zIndex:`calc(100 + ${r||0} + 1)`}}),t[0]=r,t[1]=e,t[2]=n):n=t[2],n},"GearIcon",0,({ariaLabel:e,className:t})=>(0,h.jsx)("div",{"aria-label":e,className:[t,"gear"].filter(Boolean).join(" "),children:(0,h.jsx)("svg",{className:"icon icon--gear",fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,h.jsx)("path",{d:"M9.33337 8.84671L6.66671 4.22671M9.33337 11.1534L6.66671 15.7734M10 16.6667V15.3334M10 15.3334C12.9456 15.3334 15.3334 12.9456 15.3334 10C15.3334 7.05452 12.9456 4.66671 10 4.66671M10 15.3334C7.05452 15.3334 4.66671 12.9456 4.66671 10M10 3.33337V4.66671M10 4.66671C7.05452 4.66671 4.66671 7.05452 4.66671 10M11.3334 10H16.6667M11.3334 10C11.3334 10.7364 10.7364 11.3334 10 11.3334C9.26366 11.3334 8.66671 10.7364 8.66671 10C8.66671 9.26366 9.26366 8.66671 10 8.66671C10.7364 8.66671 11.3334 9.26366 11.3334 10ZM13.3334 15.7734L12.6667 14.62M13.3334 4.22671L12.6667 5.38004M3.33337 10H4.66671M15.7734 13.3334L14.62 12.6667M15.7734 6.66671L14.62 7.33337M4.22671 13.3334L5.38004 12.6667M4.22671 6.66671L5.38004 7.33337",strokeLinecap:"round",strokeLinejoin:"round"})})}),"GenerateConfirmation",0,yy,"GridViewIcon",0,xM,"GroupByHeader",0,({collectionConfig:e,groupByFieldPath:t,groupByValue:r,heading:n})=>(0,h.jsxs)("header",{className:y3,children:[(0,h.jsx)("h4",{className:`${y3}__heading`,"data-group-id":r,children:n}),(0,h.jsx)(yV,{collectionConfig:e,label:n,modalPrefix:r,where:{[t]:{equals:r}}})]}),"GroupByPageControls",0,e=>{let t=(0,v.c)(12),{AfterPageControls:r,collectionConfig:n,data:a,groupByValue:l}=e,{refineListData:i}=fd(),o;t[0]!==l||t[1]!==i?(o=async e=>{await i({queryByGroup:{[l]:{page:e}}})},t[0]=l,t[1]=i,t[2]=o):o=t[2];let s=o,c;t[3]!==l||t[4]!==i?(c=async e=>{await i({queryByGroup:{[l]:{limit:e,page:1}}})},t[3]=l,t[4]=i,t[5]=c):c=t[5];let u=c,d;return t[6]!==r||t[7]!==n||t[8]!==a||t[9]!==s||t[10]!==u?(d=(0,h.jsx)(y7,{AfterPageControls:r,collectionConfig:n,data:a,handlePageChange:s,handlePerPageChange:u}),t[6]=r,t[7]=n,t[8]=a,t[9]=s,t[10]=u,t[11]=d):d=t[11],d},"GroupField",0,fn,"Gutter",0,io,"Hamburger",0,ve,"HiddenField",0,fa,"HydrateAuthProvider",0,function(e){let t=(0,v.c)(4),{permissions:r}=e,{setPermissions:n}=iS(),a,l;return t[0]!==r||t[1]!==n?(a=()=>{n(r)},l=[r,n],t[0]=r,t[1]=n,t[2]=a,t[3]=l):(a=t[2],l=t[3]),(0,c.useEffect)(a,l),null},"InfoIcon",0,xB,"ItemCardGrid",0,x_,"ItemsDrawer",0,e=>{let{addRowIndex:t,drawerSlug:r,items:n,labels:a,onItemClick:l,searchPlaceholder:i,title:o}=e,[s,u]=(0,c.useState)(""),[p,g]=(0,c.useState)(n),{closeModal:b,isModalOpen:v}=lc(),{i18n:y,t:x}=(0,f.d)(),{config:w}=(0,d.c)(),C=(0,c.useMemo)(()=>{let e={_none:[]};return p.forEach(t=>{if("object"==typeof t&&"admin"in t&&t.admin?.group){let r=t.admin.group,n="string"==typeof r?r:m(r,y);Object.hasOwn(e,n)?e[n].push(t):e[n]=[t]}else e._none.push(t)}),e},[p,y]);(0,c.useEffect)(()=>{v(r)||u("")},[v,r]),(0,c.useEffect)(()=>{let e=s.toLowerCase();g(n?.reduce((t,r)=>{let n;return(n="string"==typeof r?w.blocksMap?.[r]:r)&&((e,t)=>{if("labels"in e&&e.labels?.singular){if("string"==typeof e.labels.singular)return e.labels.singular.toLowerCase();if("object"==typeof e.labels.singular)return m(e.labels.singular,t).toLowerCase()}if("label"in e&&e.label){if("string"==typeof e.label)return e.label.toLowerCase();if("object"==typeof e.label)return m(e.label,t).toLowerCase()}return"slug"in e?rK(e.slug).toLowerCase():""})(n,y).includes(e)&&t.push(n),t},[])||[])},[s,n,y,w.blocksMap]);let j=o||(a?x("fields:addLabel",{label:m(a.singular,y)}):x("fields:addNew"));return(0,h.jsxs)(ip,{slug:r,title:j,children:[(0,h.jsx)(xR,{placeholder:i||x("fields:searchForBlock"),setSearchTerm:u}),(0,h.jsx)("div",{className:`${xA}__items-wrapper`,children:(0,h.jsx)("ul",{className:`${xA}__item-groups`,children:Object.entries(C).map(([e,n])=>n.length?(0,h.jsxs)("li",{className:[`${xA}__item-group`,"_none"===e&&`${xA}
53__item-group-none`].filter(Boolean).join(" "),children:["_none"!==e&&(0,h.jsx)("h3",{className:`${xA}__item-group-label`,children:e}),(0,h.jsx)("ul",{className:`${xA}__items`,children:n.map((e,n)=>{let a="string"==typeof e?w.blocksMap?.[e]:e;if(!a)return null;let{imageAltText:i,imageURL:o}=(e=>{if("admin"in e&&e?.admin?.images?.thumbnail){let t=e.admin?.images.thumbnail;return{imageAltText:"string"==typeof t?void 0:t.alt,imageURL:"string"==typeof t?t:t.url}}return"imageURL"in e?{imageAltText:e.imageAltText,imageURL:e.imageURL}:{imageAltText:void 0,imageURL:void 0}})(a),s=((e,t)=>{if("labels"in e&&e.labels?.singular)return m(e.labels.singular,t);if("label"in e&&e.label){if("string"==typeof e.label)return e.label;if("object"==typeof e.label)return m(e.label,t)}return rK(e.slug)})(a,y);return(0,h.jsx)("li",{className:`${xA}__item`,children:(0,h.jsx)(ss,{alignLabel:"center",label:s,onClick:()=>{l(a,t),b(r)},thumbnail:(0,h.jsx)("div",{className:`${xA}__default-image`,children:o?(0,h.jsx)("img",{alt:i,src:o}):(0,h.jsx)(sm,{})})})},n)})})]},e):null)})})]})},"JSONField",0,px,"JoinField",0,py,"LeaveWithoutSaving",0,bq,"LineIcon",0,oY,"Link",0,nQ,"LinkIcon",0,n1,"ListControls",0,yO,"ListDrawerContextProvider",0,fo,"ListHeader",0,y2,"ListQueryProvider",0,fh,"ListSelection",0,yV,"ListViewIcon",0,xI,"LivePreviewProvider",0,({breakpoints:e,children:t,isLivePreviewEnabled:r,isLivePreviewing:n,isPreviewEnabled:a,previewURL:l,typeofLivePreviewURL:i,url:o})=>{let[s,u]=(0,c.useState)("iframe"),[f,p]=(0,c.useState)(n),[m,g]=(0,c.useState)(f),b=(0,c.useCallback)(e=>{e&&g(!0),p(e)},[]),y=(0,c.useMemo)(()=>[...e||[],{name:"responsive",height:"100%",label:"Responsive",width:"100%"}],[e]),[x,w]=(0,c.useState)(""),[C,j]=(0,c.useState)(l),{isPopupOpen:S,openPopupWindow:$,popupRef:_}=(e=>{let t,r,n=(0,v.c)(15),{eventType:a,onMessage:l,url:i}=e,o=(0,c.useRef)(!1),[s,u]=(0,c.useState)(!1),{config:f}=(0,d.c)(),{serverURL:p}=f,h=(0,c.useRef)(null),m,g;n[0]!==a||n[1]!==s||n[2]!==l||n[3]!==p||n[4]!==i?(m=()=>{let e=async e=>{e.origin!==window.location.origin||e.origin!==i||e.origin!==p||"function"!=typeof l||e.data?.type!==a||o.current||(o.current=!0,await l(e.data?.searchParams),o.current=!1)};return s&&h.current&&window.addEventListener("message",e,!1),()=>{window.removeEventListener("message",e)}},g=[l,a,i,p,s],n[0]=a,n[1]=s,n[2]=l,n[3]=p,n[4]=i,n[5]=m,n[6]=g):(m=n[5],g=n[6]),(0,c.useEffect)(m,g),n[7]!==i?(t=e=>{e&&e.preventDefault();let t={height:700,left:"auto",menubar:"no",popup:"yes",toolbar:"no",top:"auto",width:800},r=Object.entries(t).reduce((e,r)=>
53{let[n,a]=r,l=e;if("auto"===a){if("top"===n){let e=Math.round(window.innerHeight/2-t.height/2);l+=`top=${e},`}else if("left"===n){let e=Math.round(window.innerWidth/2-t.width/2);l+=`left=${e},`}return l}return l+`${n}=${a},`},"").slice(0,-1);h.current=window.open(i,"_blank",r),u(!0)},n[7]=i,n[8]=t):t=n[8];let b=t,y,x;return n[9]!==s?(y=()=>{let e;return s?e=setInterval(function(){h.current.closed&&(clearInterval(e),u(!1))},1e3):clearInterval(e),()=>{e&&clearInterval(e)}},x=[s,h],n[9]=s,n[10]=y,n[11]=x):(y=n[10],x=n[11]),(0,c.useEffect)(y,x),n[12]!==s||n[13]!==b?(r={isPopupOpen:s,openPopupWindow:b,popupRef:h},n[12]=s,n[13]=b,n[14]=r):r=n[14],r})({eventType:"payload-live-preview",url:x}),[k,E]=(0,c.useState)(!1),[N,P]=(0,c.useState)(!1),{collectionSlug:T,globalSlug:D}=oD(),R=(0,c.useRef)(!0),{setPreference:A}=o_(),O=c.default.useRef(null),[L,M]=(0,c.useState)(),[I,F]=(0,c.useState)(1),[B,z]=(0,c.useState)({x:0,y:0}),[U,V]=c.default.useReducer(xG,{height:0,width:0}),[H,q]=(0,c.useState)({height:0,width:0}),[K,W]=c.default.useState("responsive"),G=(0,c.useCallback)(e=>{let t;"string"==typeof e&&(t=xK(e)),t||b(!1),t!==x&&(E(!1),w(t))},[x]);(0,c.useEffect)(()=>{"string"==typeof o&&w(xK(o))},[o]);let Y=(0,c.useCallback)(e=>{V({type:"width",value:e})},[V]),Q=(0,c.useCallback)(e=>{V({type:"height",value:e})},[V]);(0,c.useEffect)(()=>{let e=y?.find(e=>e.name===K);e&&"responsive"!==K&&"custom"!==K&&"number"==typeof e?.width&&"number"==typeof e?.height&&V({type:"reset",value:{height:e.height,width:e.width}})},[K,y]),(0,c.useEffect)(()=>{let e=e=>{x?.startsWith(e.origin)&&e.data&&"object"==typeof e.data&&"payload-live-preview"===e.data.type&&e.data.ready&&E(!0)};return window.addEventListener("message",e),P(!0),()=>{window.removeEventListener("message",e)}},[x,N]);let X=(0,c.useCallback)(e=>{E(!1),u(e),"popup"===e&&$()},[$]);(0,c.useEffect)(()=>{(S?"popup":"iframe")!==s&&X("iframe")},[s,S,X]),(0,c.useEffect)(()=>{if(R.current){R.current=!1;return}A(T?`collection-${T}`:`global-${D}`,{editViewType:f?"live-preview":"default"},!0)},[f,A,T,D]);let J=(0,c.useId)();return(0,h.jsx)(vR,{value:{appIsReady:k,breakpoint:K,breakpoints:y,iframeRef:O,isLivePreviewEnabled:r,isLivePreviewing:f,isPopupOpen:S,isPreviewEnabled:a,listeningForMessages:N,loadedURL:L,measuredDeviceSize:H,openPopupWindow:$,popupRef:_,previewURL:C,previewWindowType:s,setAppIsReady:E,setBreakpoint:W,setHeight:Q,setIsLivePreviewing:b,setLoadedURL:M,setMeasuredDeviceSize:q,setPreviewURL:j,setPreviewWindowType:X,setSize:V,setToolbarPosition:z,setURL:G,setWidth:Y,setZoom:F,shouldRenderIframe:m,size:U,toolbarPosition:B,typeofLivePreviewURL:i,url:x,zoom:I},children:(0,h.jsx)(tb,{collisionDetection:xW,id:J,onDragEnd:e=>{e.over&&"live-preview-area"===e.over.id&&z({x:B.x+e.delta.x,y:B.y+e.delta.y})},children:t})})},"LivePreviewWindow",0,wK,"LoadingOverlay",0,fD,"LoadingOverlayToggle",0,fR,"LocaleProvider",0,iE,"Locked",0,vG,"LogOutIcon",0,xt,"Logout",0,e=>{let t=(0,v.c)(5),{tabIndex:r}=e,n=void 0===r?0:r,{t:a}=(0,f.d)(),{config:l}=(0,d.c)(),{admin:i,routes:o}=l,{routes:s}=i,{logout:c}=s,{admin:u}=o,p;return t[0]!==u||t[1]!==c||t[2]!==a||t[3]!==n?(p=(0,h.jsx)(nQ,{"aria-label":a("authentication:logOut"),className:"nav__log-out",href:tR({adminRoute:u,path:c}),prefetch:!1,tabIndex:n,title:a("authentication:logOut"),children:(0,h.jsx)(xt,{})}),t[0]=u,t[1]=c,t[2]=a,t[3]=n,t[4]=p):p=t[4],p},"MenuIcon",0,b7,"MinimizeMaximizeIcon",0,({className:e,isMinimized:t})=>{let r=[xL,t?`${xL}--minimized`:`${xL}--maximized`,e].filter(Boolean).join(" ");return(0,h.jsx)("svg",{className:r,height:"20",stroke:"currentColor",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:t?(0,h.jsx)("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"}):(0,h.jsx)("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.8
53071 13.3072 13.0572 13.0572C13.3072 12.8071 13.6464 12.6667 14 12.6667H16"})})},"Modal",0,l_,"MoreIcon",0,am,"MoveDocToFolder",0,mD,"MoveDocToFolderButton",0,mA,"MoveFolderIcon",0,function(){return(0,h.jsxs)("svg",{className:"icon icon--move-folder",fill:"none",height:"24",viewBox:"0 0 24 24",width:"24",xmlns:"http://www.w3.org/2000/svg",children:[(0,h.jsx)("g",{filter:"url(#filter0_d_278_1086)",children:(0,h.jsx)("path",{d:"M5.33334 10V7.33334C5.33334 6.97971 5.47382 6.64058 5.72387 6.39053C5.97392 6.14048 6.31305 6 6.66668 6H9.26668C9.48967 5.99782 9.70965 6.0516 9.90648 6.15642C10.1033 6.26124 10.2707 6.41375 10.3933 6.6L10.9333 7.4C11.0547 7.58436 11.22 7.73568 11.4143 7.84041C11.6087 7.94513 11.8259 7.99997 12.0467 8H17.3333C17.687 8 18.0261 8.14048 18.2762 8.39053C18.5262 8.64058 18.6667 8.97971 18.6667 9.33334V16C18.6667 16.3536 18.5262 16.6928 18.2762 16.9428C18.0261 17.1929 17.687 17.3333 17.3333 17.3333H6.66668C6.31305 17.3333 5.97392 17.1929 5.72387 16.9428C5.47382 16.6928 5.33334 16.3536 5.33334 16V15.3333M5.33334 12.6667H12M12 12.6667L10 14.6667M12 12.6667L10 10.6667",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})}),(0,h.jsx)("defs",{children:(0,h.jsx)("filter",{colorInterpolationFilters:"sRGB",filterUnits:"userSpaceOnUse",height:"26",id:"filter0_d_278_1086",width:"26",x:"-1",y:"-1",children:(0,h.jsx)("feBlend",{in:"SourceGraphic",in2:"effect1_dropShadow_278_1086",mode:"normal",result:"shape"})})})]})},"NavContext",0,vl,"NavGroup",0,e=>{let t,r=(0,v.c)(21),{children:n,isOpen:a,label:l}=e,[i,o]=(0,c.useState)("u">typeof a&&!a),[s,u]=(0,c.useState)(!1),{setPreference:d}=o_(),{navOpen:f}=vi();if(l){let e;r[0]!==i||r[1]!==l||r[2]!==d?(e=()=>{u(!0);let e={};e?.[l]?e[l].open=!!i:e[l]={open:!!i},d(rY.NAV,{groups:e},!0),o(!i)},r[0]=i,r[1]=l,r[2]=d,r[3]=e):e=r[3];let t=e,a=`${l}`,c=i&&`${xr}--collapsed`,p;r[4]!==a||r[5]!==c?(p=[`${xr}`,a,c].filter(Boolean),r[4]=a,r[5]=c,r[6]=p):p=r[6];let m=p.join(" "),g=`nav-group-${l}`,b=`${xr}__toggle--${i?"collapsed":"open"}`,v;r[7]!==b?(v=[`${xr}__toggle`,b].filter(Boolean),r[7]=b,r[8]=v):v=r[8];let y=v.join(" "),x=f?0:-1,w;return r[9]!==s||r[10]!==n||r[11]!==i||r[12]!==l||r[13]!==x||r[14]!==m||r[15]!==g||r[16]!==y||r[17]!==t?(w=(0,h.jsxs)("div",{className:m,id:g,children:[(0,h.jsxs)("button",{className:y,onClick:t,tabIndex:x,type:"button",children:[(0,h.jsx)("div",{className:`${xr}__label`,children:l}),(0,h.jsx)("div",{className:`${xr}__indicator`,children:(0,h.jsx)(nZ,{className:`${xr}__indicator`,direction:i?void 0:"up"})})]}),(0,h.jsx)(o5,{duration:200*!!s,height:i?0:"auto",children:(0,h.jsx)("div",{className:`${xr}__content`,children:n})})]}),r[9]=s,r[10]=n,r[11]=i,r[12]=l,r[13]=x,r[14]=m,r[15]=g,r[16]=y,r[17]=t,r[18]=w):w=r[18],w}return r[19]!==n?(t=(0,h.jsx)(c.default.Fragment,{children:n}),r[19]=n,r[20]=t):t=r[20],t},"NavProvider",0,vs,"NavToggler",0,vu,"NullifyLocaleField",0,o0,"NumberCondition",0,bS,"NumberField",0,pw,"OperationProvider",0,oL,"OrderableTable",0,({appearance:e="default",BeforeTable:t,collection:r,columns:n,data:a})=>{let{config:l}=(0,d.c)(),{data:i,orderableFieldName:o,query:s}=fd(),{code:u}=iP(),f=i?.docs||a,[p,m]=(0,c.useState)(f),[g,b]=(0,c.useState)({}),[v,y]=(0,c.useState)();(0,c.useEffect)(()=>{m(f),b(Object.fromEntries(f.map((e,t)=>[String(e.id??e._id),t])))},[f]);let x=n?.filter(e=>e?.active);if(!x||0===x.filter(e=>!["_dragHandle","_select"].includes(e.accessor)).length)return(0,h.jsx)("div",{children:"No columns selected"});let w=async({moveFromIndex:e,moveToIndex:t})=>{if(s.sort!==o&&s.sort!==`-${o}`){nI.warning('To reorder the rows you must first sort them by the "Order" column'),y(void 0);return}if(e===t)return void y(void 0);let n=p[e].id??p[e]._id,a=t>e?p[t]:p[t-1],i=t>e?p[t+1]:p[t],c=[...p];m(r=>{let n=[...r];return n[e][o]="pending",n.splice(t,0,n.splice(e,1)[0]),n});try{let e=a?{id:a.id??a._id,key:a[o]}:{id:i.id??i._id,key:i[o]},t=a&&s.sort===o||!a&&s.sort===`-${o}`?"greater":"less",c={collectionSlug:r.slug,docsToMove:[n],newKeyWillBe:t,orderableFieldName:o,target:e},d=await fetch(tR({apiRoute:l.routes.api,path:`/reorder?locale=${u}`}),{body:JSON.stringify(c),credentials:"include",headers:{"Content-Type":"application/json"},method:"POST"});if(403===d.status)throw Error("You do not have permission to reorder these rows");if(!d.ok)throw Error("Failed to reorder. This can happen if you reorder several rows too quickly. Please try again.");
53if(200===d.status&&"initial migration"===(await d.json()).message)throw Error('You have enabled "orderable" on a collection with existing documentsand this is the first time you have sorted documents. We have run an automatic migration to add an initial order to the documents. Please refresh the page and try again.')}catch(t){let e=t instanceof Error?t.message:String(t);m(c),nI.error(e)}finally{y(void 0)}},C=p.map(e=>e.id??e._id);return(0,h.jsxs)("div",{className:[bo,e&&`${bo}--appearance-${e}`].filter(Boolean).join(" "),children:[t,(0,h.jsxs)(aK,{ids:C,onDragEnd:w,onDragStart:({id:e})=>{y(e)},children:[(0,h.jsxs)("table",{cellPadding:"0",cellSpacing:"0",children:[(0,h.jsx)("thead",{children:(0,h.jsx)("tr",{children:x.map((e,t)=>(0,h.jsx)("th",{id:`heading-${e.accessor}`,children:e.Heading},t))})}),(0,h.jsx)("tbody",{children:p.map((e,t)=>(0,h.jsx)(aq,{id:C[t],children:({attributes:r,isDragging:n,listeners:a,setNodeRef:l,transform:i,transition:o})=>(0,h.jsx)(bl,{cellMap:g,className:`row-${t+1}`,columns:x,dragAttributes:r,dragListeners:a,ref:l,rowId:e.id??e._id,style:{opacity:+!n,transform:i,transition:o}})},C[t]))})]}),(0,h.jsx)(tD,{children:(0,h.jsx)(bi,{className:[bo,`${bo}--drag-preview`].join(" "),rowId:v,children:(0,h.jsx)(bl,{cellMap:g,columns:x,rowId:v})})})]})]})},"PageControls",0,y9,"PageControlsComponent",0,y7,"Pagination",0,pp,"ParamsProvider",0,xZ,"PasswordField",0,gZ,"PayloadIcon",0,vd,"PerPage",0,y4,"Pill",0,sl,"PillSelector",0,fC,"PlusIcon",0,n2,"PointField",0,pj,"Popup",0,al,"PopupList",0,n6,"PreferencesProvider",0,o$,"PreviewButton",0,vX,"PreviewSizes",0,m5,"ProgressBar",0,()=>{let e=(0,v.c)(9),{isTransitioning:t,transitionProgress:r}=nK(),[n,a]=c.default.useState(null),l=(0,c.useRef)(!0),i,o;if(e[0]!==t||e[1]!==r?(i=()=>{let e,n;return t?l.current?n=setTimeout(()=>{a(r),l.current=!1},150):a(r):(l.current=!0,a(1),e=setTimeout(()=>{a(null)},400)),()=>{clearTimeout(e),clearTimeout(n)}},o=[t,r],e[0]=t,e[1]=r,e[2]=i,e[3]=o):(i=e[2],o=e[3]),(0,c.useEffect)(i,o),"number"==typeof n){let t=1===n&&`${xY}--fade-out`,r;e[4]!==t?(r=[xY,t].filter(Boolean),e[4]=t,e[5]=r):r=e[5];let a=r.join(" "),l;return e[6]!==n||e[7]!==a?(l=(0,h.jsx)("div",{className:a,style:{"--transition-duration":"200ms"},children:(0,h.jsx)("div",{className:`${xY}__progress`,style:{width:`${100*(n||0)}%`}})}),e[6]=n,e[7]=a,e[8]=l):l=e[8],l}return null},"PublishButton",0,v3,"PublishMany",0,e=>{let t=(0,v.c)(8),{count:r,selectAll:n,selectedIDs:a,toggleAll:l}=vk(),i;t[0]!==l?(i=()=>l(),t[0]=l,t[1]=i):i=t[1];let o=n===vj.AllAvailable,s;return t[2]!==r||t[3]!==e||t[4]!==a||t[5]!==i||t[6]!==o?(s=(0,h.jsx)(yM,{...e,count:r,ids:a,onSuccess:i,selectAll:o}),t[2]=r,t[3]=e,t[4]=a,t[5]=i,t[6]=o,t[7]=s):s=t[7],s},"QueryPresetsAccessCell",0,({cellData:e})=>{let t=["read","update","delete"];return(0,h.jsx)("p",{children:t.reduce((r,n,a)=>{let l=e?.[n];return l&&l.constraint&&r.push((0,h.jsxs)(c.Fragment,{children:[(0,h.jsxs)("span",{children:[(0,h.jsx)("strong",{children:rK(n)}),": ",rK(l.constraint)]}),a!==t.length-1&&", "]},n)),r},[])})},"QueryPresetsColumnField",0,({field:{label:e,required:t}})=>{let{path:r,setValue:n,value:a}=oz(),l=oz({path:"relatedCollection"}).value,{config:i,getEntityConfig:o}=(0,d.c)(),{i18n:s}=(0,f.d)(),{permissions:u}=iS(),p=(0,c.useId)(),m=(0,c.useMemo)(()=>l?o({collectionSlug:l}):null,[l,o]),g=(0,c.useMemo)(()=>l&&m?(({clientConfig:e,collectionConfig:t,collectionSlug:r,columns:n,i18n:a,permissions:l})=>{let i=Array.isArray(r),o=i?[]:t?.fields??[];if(i)for(let t of r){let r=e.collections.find(e=>e.slug===t);for(let e of bw({fieldPermissions:l?.collections?.[t]?.fields||!0,fields:r.fields}))_(e)&&o.some(t=>_(t)&&t.name===e.name)||o.push(e)}return n?.length?n?.filter(e=>re(o,{i18n:a,keepPresentationalFields:!0,moveSubFieldsToTop:!0})?.some(t=>("accessor"in t?t.accessor:"name"in t?t.name:void 0)===e.accessor)):((e,t,r)=>{let n=[];if(Array.isArray(r)&&r.length>=1)n=r;else{t&&n.push(t);let r=bC(e,t);n=(n=n.concat(r)).slice(0,4)}return n.map(e=>({accessor:e,active:!0}))})(i?o:bw({fieldPermissions:!("string"==typeof r&&l?.collections?.[r]?.fields)||l.collections[r].fields,fields:o}),t?.admin?.useAsTitle,i?[]:t?.admin?.defaultColumns)})({clientConfig:i,collectionConfig:m,collectionSlug:l,columns:a??[],i18n:s,permissions:u}):[],[i,m,l,a,s,u]),b=(0,c.useMemo)(()=>m?.fields?bx({fieldPermissions:u?.collections?.[l]?.fields??!0,fields:m.fields,i18n:s}):[],[m,s,u,l]),v=(0,c.useMemo)(()=>{let e={};for(let t of b)e[String(t.value)]=t.label;return e},[b]),y=(0,c.useMemo)(()=>g.map((e,t)=>({name:e.accessor,key:`${l}-${e.accessor}-${t}-${p}`,Label:v[e.accessor]??e.accessor,selected:e.active})),[v,g,l,p]),x=a??g,w=c.default.useCallback(({pill:e})=>{let t=x.map(t=>t.accessor===e.name?{...t,active:!t.active}:t);n(t.length?t:void 0)},[x,n]);return l?(0,h.jsxs)("div",{className:"field-type query-preset-columns-field",children:[(0,h.jsx)(iR,{as:"h3",label:e,path:r,required:t}),y.length>0?(0,h.jsx)(fC,{onClick:w,pills:y}):(0,h.jsx)("p",{className:"query-preset-columns-field__hint",children:"No columns available for this collection."})]}):(0,h.jsxs)("div",{className:"field-type query-preset-columns-field",children:[(0,h.jsx)(iR,{as:"h3",label:e,path:r,required:t}),(0,h.jsx)("p",{className:"query-preset-columns-field__hint",children:"Select the related collection to configure columns."})]})},"QueryPresetsColumnsCell",0,({cellData:e})=>(0,h.jsx)("div",{className:"query-preset-columns-cell",children:e?rl(e).map((e,t)=>{let r=!e.startsWith("-");return r?(0,h.jsx)(sl,{pillStyle:r?"always-white":"light",size:"small",children:rK(e)},t):null}):"No columns selected"}),"QueryPresetsGroupByCell",0,({cellData:e,rowData:t})=>{let{i18n:r}=(0,f.d)(),{permissions:n}=iS(),{config:a}=(0,d.c)(),l=t?.relatedCollection,i=(0,c.useMemo)(()=>l?a.collections?.find(e=>e.slug===l):null,[l,a.collections]),o=(0,c.useMemo)(()=>i?bx({fieldPermissions:n?.collections?.[l]?.fields,fields:i.fields,i18n:r}):[],[i,n,l,r]);if(!e||"string"!=typeof e)return(0,h.jsx)("div",{children:"No group by selected"});let s=e.startsWith("-"),u=s?e.slice(1):e,p=o.find(e=>e.value===u)?.label||rK(u);return(0,h.jsxs)("div",{children:[p," (",s?"descending":"ascending",")"]})},"QueryPresetsGroupByField",0,({field:{label:e,required:t}})=>{let{path:r,setValue:n,value:a}=oz(),l=oz({path:"relatedCollection"}).value,{config:i}=(0,d.c)(),o=(0,c.useMemo)(()=>l?i.collections?.find(e=>e.slug===l):null,[l,i.collections])?.fields??[];return l?(0,h.jsxs)("div",{className:"field-type query-preset-group-by-field",children:[(0,h.jsx)(iR,{as:"h3",label:e,path:r,required:t}),(0,h.jsx)(bV,{collectionSlug:l,fields:o,onChange:e=>n(e||null),value:a??void 0})]}):(0,h.jsxs)("div",{className:"field-type query-preset-group-by-field",children:[(0,h.jsx)(iR,{as:"h3",label:e,path:r,required:t}),(0,h.jsx)("p",{className:"query-preset-group-by-field__hint",children:"Select the related collection to configure group by."})]})},"QueryPresetsWhereCell",0,({cellData:e})=>(0,h.jsx)("div",{children:e?(e=>{if(e.or&&e.or.length>0&&e.or[0].and&&e.or[0].and.length>0){let t=e.or[0]?.and?.[0];if(!t||"object"!=typeof t)return"No where query";let r=Object.keys(t)[0];if(!r||!t[r]||"object"!=typeof t[r])return"No where query";let n=Object.keys(t[r])[0],a=t[r][n];if("string"==typeof a)return`${rK(r)} ${n} ${rK(a)}`;if(Array.isArray(a))return`${rK(r)} ${n} ${a.map(e=>rK(e)).join(" or ")}`}return""})(e):"No where query"}),"QueryPresetsWhereField",0,e=>{let t,r=(0,v.c)(14),{field:n}=e,{label:a,required:l}=n,{path:i,setValue:o,value:s}=oz(),c;r[0]===Symbol.for("react.memo_cache_sentinel")?(c={path:"relatedCollection"},r[0]=c):c=r[0];let u=oz(c).value;if(!u){let e;
53return r[1]!==a||r[2]!==i||r[3]!==l?(e=(0,h.jsxs)("div",{className:"field-type query-preset-where-field",children:[(0,h.jsx)(iR,{as:"h3",label:a,path:i,required:l}),(0,h.jsx)("p",{className:"query-preset-where-field__hint",children:"Select the related collection to configure filters."})]}),r[1]=a,r[2]=i,r[3]=l,r[4]=e):e=r[4],e}if(r[5]!==a||r[6]!==i||r[7]!==u||r[8]!==l||r[9]!==o||r[10]!==s){let e;r[12]!==o?(e=e=>o(e),r[12]=o,r[13]=e):e=r[13],t=(0,h.jsxs)("div",{className:"field-type query-preset-where-field",children:[(0,h.jsx)(iR,{as:"h3",label:a,path:i,required:l}),(0,h.jsx)(bB,{collectionSlug:u,onChange:e,value:s??void 0})]}),r[5]=a,r[6]=i,r[7]=u,r[8]=l,r[9]=o,r[10]=s,r[11]=t}else t=r[11];return t},"RadioGroupField",0,pk,"ReactSelect",0,d0,"RelationshipCondition",0,bP,"RelationshipField",0,p6,"RelationshipInput",0,p3,"RelationshipProvider",0,fY,"RelationshipTable",0,pg,"RenderCustomComponent",0,r7,"RenderDefaultCell",0,e=>{let t=(0,v.c)(9),{clientProps:r,columnIndex:n,isLinkedColumn:a}=e,{drawerSlug:l,onSelect:i}=fs(),{LinkedCellOverride:o}=fy(),s;if(t[0]!==o||t[1]!==r||t[2]!==n||t[3]!==l||t[4]!==a||t[5]!==i){let e={...r,columnIndex:n};if(a&&l){let r;e.className="default-cell__first-cell",e.link=!1,t[7]!==i?(r=e=>{let{collectionSlug:t,rowData:r}=e;"function"==typeof i&&i({collectionSlug:t,doc:r,docID:r.id})},t[7]=i,t[8]=r):r=t[8],e.onClick=r}s=(0,h.jsx)(pi,{value:e,children:a&&o?o:(0,h.jsx)(pa,{...e})}),t[0]=o,t[1]=r,t[2]=n,t[3]=l,t[4]=a,t[5]=i,t[6]=s}else s=t[6];return s},"RenderFields",0,gq,"RenderTitle",0,xP,"RichTextField",0,p5,"RootProvider",0,e=>{let t=(0,v.c)(16),{children:r,config:n,dateFNSKey:a,fallbackLang:l,isNavOpen:i,languageCode:s,languageOptions:u,locale:p,permissions:m,serverFunction:g,switchLanguageServerAction:b,theme:y,translations:x,user:w}=e,C=c.default.useId(),j;return t[0]!==r||t[1]!==n||t[2]!==a||t[3]!==C||t[4]!==l||t[5]!==i||t[6]!==s||t[7]!==u||t[8]!==p||t[9]!==m||t[10]!==g||t[11]!==b||t[12]!==y||t[13]!==x||t[14]!==w?(j=(0,h.jsxs)(yd,{children:[(0,h.jsx)(fb,{serverFunction:g,children:(0,h.jsx)(nH,{children:(0,h.jsx)(ml,{cachingEnabled:"true"===o.default.env.NEXT_PUBLIC_ENABLE_ROUTER_CACHE_REFRESH,children:(0,h.jsx)(d.b,{config:n,children:(0,h.jsx)(xq,{children:(0,h.jsx)(f.c,{dateFNSKey:a,fallbackLang:l,language:s,languageOptions:u,switchLanguageServerAction:b,translations:x,children:(0,h.jsx)(x6,{breakpoints:{l:"(max-width: 1440px)",m:"(max-width: 1024px)",s:"(max-width: 768px)",xs:"(max-width: 400px)"},children:(0,h.jsx)(x2,{children:(0,h.jsx)(x8,{children:(0,h.jsxs)(il,{classPrefix:"payload",transTime:0,zIndex:"var(--z-modal)",children:[(0,h.jsx)(x3,{}),(0,h.jsxs)(ij,{permissions:m,user:w,children:[(0,h.jsx)(o$,{children:(0,h.jsx)(d.i,{theme:y,children:(0,h.jsx)(xZ,{children:(0,h.jsx)(iE,{locale:p,children:(0,h.jsx)(vh,{children:(0,h.jsx)(fN,{children:(0,h.jsx)(pF,{children:(0,h.jsx)(vs,{initialIsOpen:i,children:(0,h.jsx)(hl,{children:(0,h.jsx)(tb,{collisionDetection:ew,id:C,children:r})})})})})})})})})}),(0,h.jsx)(lN,{}),(0,h.jsx)(ix,{})]})]})})})})})})})})})}),(0,h.jsx)(x7,{config:n})]}),t[0]=r,t[1]=n,t[2]=a,t[3]=C,t[4]=l,t[5]=i,t[6]=s,t[7]=u,t[8]=p,t[9]=m,t[10]=g,t[11]=b,t[12]=y,t[13]=x,t[14]=w,t[15]=j):j=t[15],j},"RouteCacheProvider",0,ml,"RouteTransitionProvider",0,nH,"RowField",0,p4,"RowLabel",0,nk,"RowLabelProvider",0,n_,"SaveButton",0,v4,"SaveDraftButton",0,v8,"ScrollInfoProvider",0,x2,"SearchFilter",0,yT,"SearchIcon",0,sg,"SearchParamsProvider",0,x8,"SectionTitle",0,sS,"Select",0,d0,"SelectAll",0,()=>{let e=(0,v.c)(7),{selectAll:t,toggleAll:r}=vk(),{i18n:n}=(0,f.d)(),a;if(e[0]!==n||e[1]!==t||e[2]!==r){let l,i;e[4]===Symbol.for("react.memo_cache_sentinel")?(l=[we,`${we}__checkbox`],e[4]=l):l=e[4],e[5]!==r?(i=()=>r(),e[5]=r,e[6]=i):i=e[6],a=(0,h.jsx)(oX,{"aria-label":t===vj.None?n.t("general:selectAllRows"):n.t("general:deselectAllRows"),checked:t===vj.AllInPage||t===vj.AllAvailable,className:l.join(" "),id:"select-all",name:"select-all",onToggle:i,partialChecked:t===vj.Some}),e[0]=n,e[1]=t,e[2]=r,e[3]=a}else a=e[3];return a},"SelectCondition",0,bT,"SelectField",0,p9,"SelectInput",0,p8,"SelectMany",0,wr,"SelectRow",0,e=>{let t,r,n,a=(0,v.c)(13),{rowData:l}=e,{user:i}=iS(),{selected:o,setSelection:s}=vk(),c;if(a[0]!==l||a[1]!==i?.id){c=Symbol.for("react.early_return_sentinel");e:{let{_isLocked:e,_userEditing:t}=l||{};if(e&&t&&t.id!==i?.id){c=(0,h.jsx)(vG,{user:t});break e}}a[0]=l,a[1]=i?.id,a[2]=c}else c=a[2];
53if(c!==Symbol.for("react.early_return_sentinel"))return c;a[3]!==l.id||a[4]!==o?(t=o.get(l.id),a[3]=l.id,a[4]=o,a[5]=t):t=a[5];let u=!!t,d;return a[6]===Symbol.for("react.memo_cache_sentinel")?(d=[wt,`${wt}__checkbox`],a[6]=d):d=a[6],a[7]!==l.id||a[8]!==s?(r=()=>s(l.id),a[7]=l.id,a[8]=s,a[9]=r):r=a[9],a[10]!==u||a[11]!==r?(n=(0,h.jsx)(oX,{checked:u,className:d.join(" "),onToggle:r}),a[10]=u,a[11]=r,a[12]=n):n=a[12],n},"SelectionProvider",0,v_,"ServerFunctionsContext",0,fm,"ServerFunctionsProvider",0,fb,"SetDocumentStepNav",0,w0,"SetDocumentTitle",0,w1,"SetStepNav",0,e=>{let t=(0,v.c)(4),{nav:r}=e,{setStepNav:n}=vf(),a,l;return t[0]!==r||t[1]!==n?(a=()=>{n(r)},l=[n,r],t[0]=r,t[1]=n,t[2]=a,t[3]=l):(a=t[2],l=t[3]),(0,c.useEffect)(a,l),null},"SlugField",0,e=>{let t=(0,v.c)(24),{field:r,path:n,readOnly:a,useAsSlug:l}=e,{label:i}=r,{t:o}=(0,f.d)(),{collectionSlug:s,globalSlug:u}=oD(),{slugify:d}=fg(),p=n||r.name,m;t[0]!==p?(m={path:p},t[0]=p,t[1]=m):m=t[1];let{setValue:g,value:b}=oz(m),{getData:y,getDataByPath:x}=nm(),[w,C]=(0,c.useState)(!0),j;t[2]!==s||t[3]!==y||t[4]!==x||t[5]!==u||t[6]!==n||t[7]!==g||t[8]!==d||t[9]!==l||t[10]!==b?(j=async e=>{e.preventDefault();let t=x(l),r=await d({collectionSlug:s,data:y(),globalSlug:u,path:n,valueToSlugify:t});null==r?g(""):b!==r&&g(r)},t[2]=s,t[3]=y,t[4]=x,t[5]=u,t[6]=n,t[7]=g,t[8]=d,t[9]=l,t[10]=b,t[11]=j):j=t[11];let S=j,$;t[12]===Symbol.for("react.memo_cache_sentinel")?($=e=>{e.preventDefault(),C(xO)},t[12]=$):$=t[12];let _=$,k=`field-${n}`,E;return t[13]!==r.name||t[14]!==S||t[15]!==w||t[16]!==i||t[17]!==n||t[18]!==a||t[19]!==g||t[20]!==o||t[21]!==k||t[22]!==b?(E=(0,h.jsxs)("div",{className:"field-type slug-field-component",children:[(0,h.jsxs)("div",{className:"label-wrapper",children:[(0,h.jsx)(iR,{htmlFor:k,label:i}),!w&&(0,h.jsx)(au,{buttonStyle:"none",className:"lock-button",onClick:S,children:o("authentication:generate")}),(0,h.jsx)(au,{buttonStyle:"none",className:"lock-button",onClick:_,children:o(w?"general:unlock":"general:lock")})]}),(0,h.jsx)(hS,{onChange:g,path:n||r.name,readOnly:!!(a||w),value:b})]}),t[13]=r.name,t[14]=S,t[15]=w,t[16]=i,t[17]=n,t[18]=a,t[19]=g,t[20]=o,t[21]=k,t[22]=b,t[23]=E):E=t[23],E},"SortColumn",0,e=>{let t,r=(0,v.c)(19),{name:n,appearance:a,disable:l,Label:i,label:o}=e,s=void 0!==l&&l,{handleSortChange:c,query:u}=fd(),{t:d}=(0,f.d)(),{sort:p}=u,m=`-${n}`,g;r[0]!==n||r[1]!==p?(g=[`${xT}__asc`],p===n&&g.push(`${xT}--active`),r[0]=n,r[1]=p,r[2]=g):g=r[2],r[3]!==m||r[4]!==p?(t=[`${xT}__desc`],p===m&&t.push(`${xT}--active`),r[3]=m,r[4]=p,r[5]=t):t=r[5];let b=a&&`${xT}--appearance-${a}`,y;r[6]!==b?(y=[xT,b].filter(Boolean),r[6]=b,r[7]=y):y=r[7];let x=y.join(" "),w;return r[8]!==i||r[9]!==n||r[10]!==g||r[11]!==m||r[12]!==t||r[13]!==s||r[14]!==c||r[15]!==o||r[16]!==d||r[17]!==x?(w=(0,h.jsxs)("div",{className:x,children:[(0,h.jsx)("span",{className:`${xT}__label`,children:i??(0,h.jsx)(iR,{hideLocale:!0,label:o,unstyled:!0})}),!s&&(0,h.jsxs)("div",{className:`${xT}__buttons`,children:[(0,h.jsx)("button",{"aria-label":d("general:sortByLabelDirection",{direction:d("general:ascending"),label:o}),className:[...g,`${xT}__button`].filter(Boolean).join(" "),onClick:()=>{c(n)},type:"button",children:(0,h.jsx)(nZ,{direction:"up"})}),(0,h.jsx)("button",{"aria-label":d("general:sortByLabelDirection",{direction:d("general:descending"),label:o}),className:[...t,`${xT}__button`].filter(Boolean).join(" "),onClick:()=>{c(m)},type:"button",children:(0,h.jsx)(nZ,{})})]})]}),r[8]=i,r[9]=n,r[10]=g,r[11]=m,r[12]=t,r[13]=s,r[14]=c,r[15]=o,r[16]=d,r[17]=x,r[18]=w):w=r[18],w},"SortHeader",0,e=>{let t=(0,v.c)(7),{appearance:r}=e,{handleSortPress:n,isActive:a}=function(){let e=(0,v.c)(7),{handleSortChange:t,orderableFieldName:r,query:n}=fd(),a=(Array.isArray(n.sort)?n.sort[0]:n.sort)===r,l;e[0]!==t||e[1]!==a||e[2]!==r?(l=()=>{a||t(r)},e[0]=t,e[1]=a,e[2]=r,e[3]=l):l=e[3];let i=l,o;return e[4]!==i||e[5]!==a?(o={handleSortPress:i,isActive:a},e[4]=i,e[5]=a,e[6]=o):o=e[6],o}(),{t:l}=(0,f.d)(),i=r&&`${bn}--appearance-${r}`,o;t[0]!==i?(o=[bn,i].filter(Boolean),t[0]=i,t[1]=o):o=t[1];let s=o.join(" "),c;return t[2]!==n||t[3]!==a||t[4]!==l||t[5]!==s?(c=(0,h.jsx)("div",{className:s,children:(0,h.jsx)("div",{className:`${bn}__buttons`,children:(0,h.jsx)("button",{"aria-label":l("general:sortByLabelDirection",{direction:l("general:ascending"),label:"Order"}),className:`${bn}__button ${a?`${bn}--active`:""}`,onClick:n,type:"button",children:(0,h.jsx)(bt,{})})})}),t[2]=n,t[3]=a,t[4]=l,t[5]=s,t[6]=c):c=t[6],c},"SortRow",0,()=>{let e=(0,v.c)(2),{orderableFieldName:t,query:r}=fd(),n=r.sort===t||r.sort===`-${t}`,a=`${ba} ${n?"active":""}`,l;return e[0]!==a?(l=(0,h.jsx)("div",{className:a,role:"button",tabIndex:0,children:(0,h.jsx)(o6,{className:`${ba}__icon`})}),e[0]=a,e[1]=l):l=e[1],l},"StickyToolbar",0,xe,"SuccessIcon",0,xz,"SwapIcon",0,n3,"TabComponent",0,hb,"Table",0,vZ,"TableColumnsProvider",0,fx,"TabsField",0,hy,"TabsProvi
53der",0,d9,"TextCondition",0,bR,"TextField",0,hk,"TextInput",0,hS,"TextareaField",0,hN,"TextareaInput",0,hE,"Thumbnail",0,f4,"TimezonePicker",0,d2,"Tooltip",0,ao,"Translation",0,mh,"UIField",0,hP,"UnpublishButton",0,ye,"UnpublishMany",0,e=>{let t=(0,v.c)(8),{count:r,selectAll:n,selectedIDs:a,toggleAll:l}=vk(),i;t[0]!==l?(i=()=>l(),t[0]=l,t[1]=i):i=t[1];let o=n===vj.AllAvailable,s;return t[2]!==r||t[3]!==e||t[4]!==a||t[5]!==i||t[6]!==o?(s=(0,h.jsx)(yU,{...e,count:r,ids:a,onSuccess:i,selectAll:o}),t[2]=r,t[3]=e,t[4]=a,t[5]=i,t[6]=o,t[7]=s):s=t[7],s},"Upload",0,gt,"UploadEditsProvider",0,oE,"UploadField",0,gU,"UploadHandlersProvider",0,hl,"UploadInput",0,gz,"ViewDescription",0,bZ,"WarningIcon",0,xU,"WatchChildErrors",0,sA,"WatchCondition",0,oV,"WindowInfoProvider",0,x6,"allFieldComponents",0,g1,"documentDrawerBaseClass",0,fB,"escapeDiffHTML",0,function(e){return null==e?"":("string"==typeof e?e:String(e)).replace(/&/g,"").replace(/</g,"").replace(/>/g,"").replace(/"/g,"").replace(/'/g,"")},"fieldBaseClass",0,oK,"fieldComponents",0,g0,"fieldReducer",0,hp,"formatDrawerSlug",0,iu,"formatTimeToNow",0,og,"getHTMLDiffComponents",0,({fromHTML:e,postProcess:t,toHTML:r,tokenizeByCharacter:n})=>{let[a,l]=new ys(e,r,{tokenizeByCharacter:n}).getSideBySideContents();return t&&(a=t(a),l=t(l)),{From:a?(0,h.jsx)("div",{className:`${yc}__diff-old html-diff`,dangerouslySetInnerHTML:{__html:a}}):null,To:l?(0,h.jsx)("div",{className:`${yc}__diff-new html-diff`,dangerouslySetInnerHTML:{__html:l}}):null}},"isFieldRTL",0,oW,"parseSearchParams",0,fc,"toast",0,nI,"unescapeDiffHTML",0,function(e){return e.replace(/\uE001/g,"&amp;").replace(/\uE002/g,"&lt;").replace(/\uE003/g,"&gt;").replace(/\uE004/g,"&quot;").replace(/\uE005/g,"&#39;")},"useActions",0,b4,"useAddClientFunction",0,(e,t)=>{let r=(0,v.c)(6),{addClientFunction:n,removeClientFunction:a}=c.default.use(xV),l,i;r[0]!==n||r[1]!==t||r[2]!==e||r[3]!==a?(l=()=>(n({func:t,key:e}),()=>{a({func:t,key:e})}),i=[t,e,n,a],r[0]=n,r[1]=t,r[2]=e,r[3]=a,r[4]=l,r[5]=i):(l=r[4],i=r[5]),c.default.useEffect(l,i)},"useAllFormFields",0,nS,"useAuth",0,iS,"useBulkUpload",0,gP,"useBulkUploadDrawerSlug",0,gT,"useCellProps",0,po,"useClickOutside",0,function(e,t,r=!0){let{register:n,unregister:a}=yf();(0,c.useEffect)(()=>{if(!r||!e.current)return;let l={handler:t,ref:e};return n(l),()=>a(l)},[e,t,r,n,a])},"useClickOutsideContext",0,yf,"useClientFunctions",0,()=>c.default.use(xH),"useCollapsible",0,o7,"useDebounce",0,fK,"useDebouncedCallback",0,pL,"useDebouncedEffect",0,hn,"useDelayedRender",0,f$,"useDocumentDrawer",0,fV,"useDocumentDrawerContext",0,fI,"useDocumentEvents",0,pB,"useDocumentForm",0,ng,"useDocumentInfo",0,oD,"useDocumentTitle",0,ow,"useDrawerSlug",0,is,"useEditDepth",0,a0,"useEffectEvent",0,ae,"useEntityVisibility",0,xX,"useField",0,oz,"useFieldPath",0,oF,"useFolder",0,mn,"useForm",0,nm,"useFormBackgroun
53dProcessing",0,nx,"useFormFields",0,nj,"useFormInitializing",0,nC,"useFormModified",0,nw,"useFormProcessing",0,ny,"useFormSubmitted",0,nv,"useHotkey",0,g5,"useIntersect",0,ai,"useListDrawer",0,pA,"useListDrawerContext",0,fs,"useListQuery",0,fd,"useListRelationships",0,fQ,"useLivePreviewContext",0,vA,"useLocale",0,iP,"useModal",0,lc,"useNav",0,vi,"useOperation",0,oM,"useParams",0,()=>(0,c.use)(xJ),"usePayloadAPI",0,(e,t)=>{let r,n,a,l,i,o,s=(0,v.c)(30),u;s[0]!==t?(u=void 0===t?{}:t,s[0]=t,s[1]=u):u=s[1];let{initialData:d,initialParams:p}=u,h;s[2]!==p?(h=void 0===p?{}:p,s[2]=p,s[3]=h):h=s[3];let m=h,{i18n:g}=(0,f.d)(),b;s[4]!==d?(b=d||{},s[4]=d,s[5]=b):b=s[5];let[y,x]=(0,c.useState)(b),[w,C]=(0,c.useState)(m),[j,S]=(0,c.useState)(!d),[$,_]=(0,c.useState)(!1),{code:k}=iP(),E=(0,c.useRef)(!1),N;s[6]!==k||s[7]!==w?(N=t6({locale:k,..."object"==typeof w?w:{}},{addQueryPrefix:!0}),s[6]=k,s[7]=w,s[8]=N):N=s[8];let P=N,T;return s[9]!==g.language||s[10]!==d||s[11]!==P||s[12]!==e?(T=()=>{if(d&&!E.current){E.current=!0;return}let t=new AbortController;return e?(async()=>{_(!1),S(!0);try{let r=await iw.get(`${e}${P}`,{headers:{"Accept-Language":g.language},signal:t.signal});r.status>201&&_(!0);let n=await r.json();x(n),S(!1)}catch{t.signal.aborted||(_(!0),S(!1))}})():(_(!1),S(!1)),()=>{try{t.abort()}catch(e){}}},s[9]=g.language,s[10]=d,s[11]=P,s[12]=e,s[13]=T):T=s[13],s[14]!==g.language||s[15]!==d||s[16]!==k||s[17]!==P||s[18]!==e?(r=[e,k,P,g.language,d],s[14]=g.language,s[15]=d,s[16]=k,s[17]=P,s[18]=e,s[19]=r):r=s[19],(0,c.useEffect)(T,r),s[20]!==d?(n=()=>{d&&E.current&&x(d)},a=[d],s[20]=d,s[21]=n,s[22]=a):(n=s[21],a=s[22]),(0,c.useEffect)(n,a),s[23]!==y||s[24]!==$||s[25]!==j?(l={data:y,isError:$,isLoading:j},s[23]=y,s[24]=$,s[25]=j,s[26]=l):l=s[26],s[27]===Symbol.for("react.memo_cache_sentinel")?(i={setParams:C},s[27]=i):i=s[27],s[28]!==l?(o=[l,i],s[28]=l,s[29]=o):o=s[29],o},"usePreferences",0,o_,"useQueue",0,pM,"useResize",0,g9,"useRouteCache",0,mi,"useRouteTransition",0,nK,"useRowLabel",0,()=>c.default.use(n$),"useScrollInfo",0,()=>(0,c.useContext)(x0),"useSearchParams",0,()=>(0,c.use)(x4),"useSelection",0,vk,"useServerFunctions",0,fg,"useStepNav",0,vf,"useTableColumns",0,fy,"useThrottledEffect",0,iL,"useUploadControls",0,hR,"useUploadEdits",0,oN,"useUploadHandlers",0,hi,"useUseTitleField",0,be,"useWatchForm",0,nb,"useWindowInfo",0,x5,"withCondition",0,oH],76795)},748555,e=>{"use strict";var t=e.i(76795),r=e.i(250558),n=e.i(815841);e.s(["Account",()=>t.Account,"ActionsProvider",()=>t.ActionsProvider,"AnimateHeight",()=>t.AnimateHeight,"AppHeader",()=>t.AppHeader,"ArrayField",()=>t.ArrayField,"AuthProvider",()=>t.AuthProvider,"Banner",()=>t.Banner,"BlockSelector",()=>t.BlockSelector,"BlocksDrawer",()=>t.BlocksDrawer,"BlocksField",()=>t.BlocksField,"BrowseByFolderButton",()=>t.BrowseByFolderButton,"BulkUploadDrawer",()=>t.BulkUploadDrawer,"BulkUploadProvider",()=>t.BulkUploadProvider,"Button",()=>t.Button,"CalendarIcon",()=>n.m,"Card",()=>t.Card,"CheckIcon",()=>t.CheckIcon,"CheckboxField",()=>t.CheckboxField,"CheckboxInput",()=>t.CheckboxInput,"ChevronIcon",()=>t.ChevronIcon,"ClientFunctionProvider",()=>t.ClientFunctionProvider,"CloseMenuIcon",()=>t.CloseMenuIcon,"CodeBlockIcon",()=>t.CodeBlockIcon,"CodeEditor",()=>r.l,"CodeEditorLazy",()=>t.CodeEditorLazy,"CodeField",()=>t.CodeField,"Collapsible",()=>t.Collapsible,"CollapsibleField",()=>t.CollapsibleField,"Combobox",()=>t.Combobox,"ConfigProvider",()=>r.b,"ConfirmPasswordField",()=>t.ConfirmPasswordField,"ConfirmationModal",()=>t.ConfirmationModal,"CopyIcon",()=>t.CopyIcon,"CopyLocaleData",()=>t.CopyLocaleData,"CopyToClipboard",()=>t.CopyToClipboard,"DateCell",()=>t.DateCell,"DateCondition",()=>t.DateCondition,"DatePicker",()=>n.n,"DateTimeField",()=>t.DateTimeField,"DefaultBlockImage",()=>t.DefaultBlockImage,"DefaultBrowseByFolderView",()=>t.DefaultBrowseByFolderView,"DefaultCell",()=>t.DefaultCell,"DefaultCollectionFolderView",()=>t.DefaultCollectionFolderView,"DefaultEditView",()=>t.DefaultEditView,"DefaultListView",()=>t.DefaultListView,"DeleteMany",()=>t.DeleteMany,"DocumentControls",()=>t.DocumentControls,"DocumentEventsProvider",()=>t.DocumentEventsProvider,"DocumentFields",()=>t.DocumentFields,"DocumentIcon",()=>t.DocumentIcon,"DocumentInfoProvider",()=>t.DocumentInfoProvider,"DocumentLocked",()=>t.DocumentLocked,"DocumentTakeOver",()=>t.DocumentTakeOver,"DragHandleIcon",()=>t.DragHandleIcon,"Drawer",()=>t.Drawer,"DrawerContentContainer",()=>t.DrawerContentContainer,"DrawerToggler",()=>t.DrawerToggler,"Dropzone",()=>t.Dropzone,"EditDepthProvider",()=>t.EditDepthProvider,"EditIcon",()=>t.EditIcon,"EditMany",()=>t.EditMany,"EditUpload",()=>t.EditUpload,"EmailAndUsernameFields",()=>t.EmailAndUsernameFields,"EmailField",()=>
53t.EmailField,"EntityVisibilityProvider",()=>t.EntityVisibilityProvider,"ErrorIcon",()=>t.ErrorIcon,"ErrorPill",()=>t.ErrorPill,"ExternalLinkIcon",()=>t.ExternalLinkIcon,"FieldContext",()=>t.FieldContext,"FieldDescription",()=>t.FieldDescription,"FieldDiffContainer",()=>t.FieldDiffContainer,"FieldDiffLabel",()=>t.FieldDiffLabel,"FieldError",()=>t.FieldError,"FieldLabel",()=>t.FieldLabel,"FieldPathContext",()=>t.FieldPathContext,"File",()=>t.File,"FileDetails",()=>t.FileDetails,"FolderFileTable",()=>t.FolderFileTable,"FolderIcon",()=>t.FolderIcon,"FolderProvider",()=>t.FolderProvider,"FolderTypeField",()=>t.FolderTypeField,"Form",()=>t.Form,"FormLoadingOverlayToggle",()=>t.FormLoadingOverlayToggle,"FormSubmit",()=>t.FormSubmit,"FullscreenModal",()=>t.FullscreenModal,"GearIcon",()=>t.GearIcon,"GenerateConfirmation",()=>t.GenerateConfirmation,"GridViewIcon",()=>t.GridViewIcon,"GroupByHeader",()=>t.GroupByHeader,"GroupByPageControls",()=>t.GroupByPageControls,"GroupField",()=>t.GroupField,"Gutter",()=>t.Gutter,"Hamburger",()=>t.Hamburger,"HiddenField",()=>t.HiddenField,"HydrateAuthProvider",()=>t.HydrateAuthProvider,"InfoIcon",()=>t.InfoIcon,"ItemCardGrid",()=>t.ItemCardGrid,"ItemsDrawer",()=>t.ItemsDrawer,"JSONField",()=>t.JSONField,"JoinField",()=>t.JoinField,"LeaveWithoutSaving",()=>t.LeaveWithoutSaving,"LineIcon",()=>t.LineIcon,"Link",()=>t.Link,"LinkIcon",()=>t.LinkIcon,"ListControls",()=>t.ListControls,"ListDrawerContextProvider",()=>t.ListDrawerContextProvider,"ListHeader",()=>t.ListHeader,"ListQueryProvider",()=>t.ListQueryProvider,"ListSelection",()=>t.ListSelection,"ListViewIcon",()=>t.ListViewIcon,"LivePreviewProvider",()=>t.LivePreviewProvider,"LivePreviewWindow",()=>t.LivePreviewWindow,"LoadingOverlay",()=>t.LoadingOverlay,"LoadingOverlayToggle",()=>t.LoadingOverlayToggle,"LocaleProvider",()=>t.LocaleProvider,"Locked",()=>t.Locked,"LogOutIcon",()=>t.LogOutIcon,"Logout",()=>t.Logout,"MenuIcon",()=>t.MenuIcon,"MinimizeMaximizeIcon",()=>t.MinimizeMaximizeIcon,"Modal",()=>t.Modal,"MoreIcon",()=>t.MoreIcon,"MoveDocToFolder",()=>t.MoveDocToFolder,"MoveDocToFolderButton",()=>t.MoveDocToFolderButton,"MoveFolderIcon",()=>t.MoveFolderIcon,"NavContext",()=>t.NavContext,"NavGroup",()=>t.NavGroup,"NavProvider",()=>t.NavProvider,"NavToggler",()=>t.NavToggler,"NullifyLocaleField",()=>t.NullifyLocaleField,"NumberCondition",()=>t.NumberCondition,"NumberField",()=>t.NumberField,"OperationProvider",()=>t.OperationProvider,"OrderableTable",()=>t.OrderableTable,"PageConfigProvider",()=>r.d,"PageControls",()=>t.PageControls,"PageControlsComponent",()=>t.PageControlsComponent,"Pagination",()=>t.Pagination,"ParamsProvider",()=>t.ParamsProvider,"PasswordField",()=>t.PasswordField,"PayloadIcon",()=>t.PayloadIcon,"PerPage",()=>t.PerPage,"Pill",()=>t.Pill,"PillSelector",()=>t.PillSelector,"PlusIcon",()=>t.PlusIcon,"PointField",()=>t.PointField,"Popup",()=>t.Popup,"PopupList",()=>t.PopupList,"PreferencesProvider",()=>t.PreferencesProvider,"PreviewButton",()=>t.PreviewButton,"PreviewSizes",()=>t.PreviewSizes,"ProgressBar",()=>t.ProgressBar,"PublishButton",()=>t.PublishButton,"PublishMany",()=>t.PublishMany,"QueryPresetsAccessCell",()=>t.QueryPresetsAccessCell,"QueryPresetsColumnField",()=>t.QueryPresetsColumnField,"QueryPresetsColumnsCell",()=>t.QueryPresetsColumnsCell,"QueryPresetsGroupByCell",()=>t.QueryPresetsGroupByCell,"QueryPresetsGroupByField",()=>t.QueryPresetsGroupByField,"QueryPresetsWhereCell",()=>t.QueryPresetsWhereCell,"QueryPresetsWhereField",()=>t.QueryPresetsWhereField,"RadioGroupField",()=>t.RadioGroupField,"ReactSelect",()=>t.ReactSelect,"RelationshipCondition",()=>t.RelationshipCondition,"RelationshipField",()=>t.RelationshipField,"RelationshipInput",()=>t.RelationshipInput,"RelationshipProvider",()=>t.RelationshipProvider,"RelationshipTable",()=>t.RelationshipTable,"RenderCustomComponent",()=>t.RenderCustomComponent,"RenderDefaultCell",()=>t.RenderDefaultCell,"RenderFields",()=>t.RenderFields,"RenderTitle",()=>t.RenderTitle,"RichTextField",()=>t.RichTextField,"RootProvider",()=>t.RootProvider,"RouteCacheProvider",()=>t.RouteCacheProvider,"RouteTransitionProvider",()=>t.RouteTransitionProvider,"RowField",()=>t.RowField,"RowLabel",()=>t.RowLabel,"RowLabelProvider",()=>t.RowLabelProvider,"SaveButton",()=>t.SaveButton,"SaveDraftButton",()=>t.SaveDraftButton,"ScrollInfoProvider",()=>t.ScrollInfoProvider,"SearchFilter",()=>t.SearchFilter,"SearchIcon",()=>t.SearchIcon,"SearchParamsProvider",()=>t.SearchParamsProvider,"SectionTitle",()=>t.SectionTitle,"Select",()=>t.Select,"SelectAll",()=>t.SelectAll,"SelectCondition",()=>t.SelectCondition,"SelectField",()=>t.SelectField,"SelectInput",()=>t.SelectInput,"SelectMany",()=>t.SelectMany,"SelectRow",()=>t.SelectRow,"SelectionProvider",()=>t.SelectionProvider,"ServerFunctionsContext",()=>t.ServerFunctionsContext,"ServerFunctionsProvider",()=>t.ServerFunctionsProvider,"SetDocumentStepNav",()=>t.SetDocumentStepNav,"SetDocumentTitle",()=>t.SetDocumentTitle,"SetStepNav",()=>t.SetStepNav,"ShimmerEffect",()=>r.f,"SlugField",()=>t.SlugField,"SortColumn",()=>t.SortColumn,"SortHeader",()=>t.SortHeader,"SortRow",()=>t.SortRow,"StaggeredShimmers",()=>r.g,"StickyToolbar",()=>t.StickyToolbar,"SuccessIcon",()=>t.SuccessIcon,"SwapIcon",()=>t.SwapIcon,"TabComponent",()=>t.TabComponent,"Table",()=>t.Table,"TableColumnsProvider",()=>t.TableColumnsProvider,"TabsField",()=>
53t.TabsField,"TabsProvider",()=>t.TabsProvider,"TextCondition",()=>t.TextCondition,"TextField",()=>t.TextField,"TextInput",()=>t.TextInput,"TextareaField",()=>t.TextareaField,"TextareaInput",()=>t.TextareaInput,"ThemeProvider",()=>r.i,"Thumbnail",()=>t.Thumbnail,"TimezonePicker",()=>t.TimezonePicker,"Tooltip",()=>t.Tooltip,"Translation",()=>t.Translation,"TranslationProvider",()=>n.c,"UIField",()=>t.UIField,"UnpublishButton",()=>t.UnpublishButton,"UnpublishMany",()=>t.UnpublishMany,"Upload",()=>t.Upload,"UploadEditsProvider",()=>t.UploadEditsProvider,"UploadField",()=>t.UploadField,"UploadHandlersProvider",()=>t.UploadHandlersProvider,"UploadInput",()=>t.UploadInput,"ViewDescription",()=>t.ViewDescription,"WarningIcon",()=>t.WarningIcon,"WatchChildErrors",()=>t.WatchChildErrors,"WatchCondition",()=>t.WatchCondition,"WindowInfoProvider",()=>t.WindowInfoProvider,"XIcon",()=>n.a,"allFieldComponents",()=>t.allFieldComponents,"defaultTheme",()=>r.h,"documentDrawerBaseClass",()=>t.documentDrawerBaseClass,"escapeDiffHTML",()=>t.escapeDiffHTML,"fieldBaseClass",()=>t.fieldBaseClass,"fieldComponents",()=>t.fieldComponents,"fieldReducer",()=>t.fieldReducer,"formatDrawerSlug",()=>t.formatDrawerSlug,"formatTimeToNow",()=>t.formatTimeToNow,"getHTMLDiffComponents",()=>t.getHTMLDiffComponents,"isFieldRTL",()=>t.isFieldRTL,"parseSearchParams",()=>t.parseSearchParams,"toast",()=>t.toast,"unescapeDiffHTML",()=>t.unescapeDiffHTML,"useActions",()=>t.useActions,"useAddClientFunction",()=>t.useAddClientFunction,"useAllFormFields",()=>t.useAllFormFields,"useAuth",()=>t.useAuth,"useBulkUpload",()=>t.useBulkUpload,"useBulkUploadDrawerSlug",()=>t.useBulkUploadDrawerSlug,"useCellProps",()=>t.useCellProps,"useClickOutside",()=>t.useClickOutside,"useClickOutsideContext",()=>t.useClickOutsideContext,"useClientFunctions",()=>t.useClientFunctions,"useCollapsible",()=>t.useCollapsible,"useConfig",()=>r.c,"useControllableState",()=>r.a,"useDebounce",()=>t.useDebounce,"useDebouncedCallback",()=>t.useDebouncedCallback,"useDebouncedEffect",()=>t.useDebouncedEffect,"useDelay",()=>r.e,"useDelayedRender",()=>t.useDelayedRender,"useDocumentDrawer",()=>t.useDocumentDrawer,"useDocumentDrawerContext",()=>t.useDocumentDrawerContext,"useDocumentEvents",()=>t.useDocumentEvents,"useDocumentForm",()=>t.useDocumentForm,"useDocumentInfo",()=>t.useDocumentInfo,"useDocumentTitle",()=>t.useDocumentTitle,"useDrawerSlug",()=>t.useDrawerSlug,"useEditDepth",()=>t.useEditDepth,"useEffectEvent",()=>t.useEffectEvent,"useEntityVisibility",()=>t.useEntityVisibility,"useField",()=>t.useField,"useFieldPath",()=>t.useFieldPath,"useFolder",()=>t.useFolder,"useForm",()=>
53t.useForm,"useFormBackgroundProcessing",()=>t.useFormBackgroundProcessing,"useFormFields",()=>t.useFormFields,"useFormInitializing",()=>t.useFormInitializing,"useFormModified",()=>t.useFormModified,"useFormProcessing",()=>t.useFormProcessing,"useFormSubmitted",()=>t.useFormSubmitted,"useHotkey",()=>t.useHotkey,"useIntersect",()=>t.useIntersect,"useListDrawer",()=>t.useListDrawer,"useListDrawerContext",()=>t.useListDrawerContext,"useListQuery",()=>t.useListQuery,"useListRelationships",()=>t.useListRelationships,"useLivePreviewContext",()=>t.useLivePreviewContext,"useLocale",()=>t.useLocale,"useModal",()=>t.useModal,"useNav",()=>t.useNav,"useOperation",()=>t.useOperation,"useParams",()=>t.useParams,"usePayloadAPI",()=>t.usePayloadAPI,"usePreferences",()=>t.usePreferences,"useQueue",()=>t.useQueue,"useResize",()=>t.useResize,"useRouteCache",()=>t.useRouteCache,"useRouteTransition",()=>t.useRouteTransition,"useRowLabel",()=>t.useRowLabel,"useScrollInfo",()=>t.useScrollInfo,"useSearchParams",()=>t.useSearchParams,"useSelection",()=>t.useSelection,"useServerFunctions",()=>t.useServerFunctions,"useStepNav",()=>t.useStepNav,"useTableColumns",()=>t.useTableColumns,"useTheme",()=>r.j,"useThrottledEffect",()=>t.useThrottledEffect,"useTranslation",()=>n.d,"useUploadControls",()=>t.useUploadControls,"useUploadEdits",()=>t.useUploadEdits,"useUploadHandlers",()=>t.useUploadHandlers,"useUseTitleField",()=>t.useUseTitleField,"useWatchForm",()=>t.useWatchForm,"useWindowInfo",()=>t.useWindowInfo,"withCondition",()=>t.withCondition])},835530,e=>{"use strict";var t=e.i(309442),r=e.i(166535),n=e.i(76795);e.i(476781),e.s(["NavHamburger",0,e=>{let a,l,i=(0,t.c)(6),{baseClass:o}=e,{navOpen:s,setNavOpen:c}=(0,n.useNav)(),u=`${o}__mobile-close`;i[0]!==c?(a=()=>{c(!1)},i[0]=c,i[1]=a):a=i[1];let d=s?void 0:-1;return i[2]!==u||i[3]!==a||i[4]!==d?(l=(0,r.jsx)("button",{className:u,onClick:a,tabIndex:d,type:"button",children:(0,r.jsx)(n.Hamburger,{isActive:!0})}),i[2]=u,i[3]=a,i[4]=d,i[5]=l):l=i[5],l}])},267037,e=>{"use strict";var t=e.i(309442),r=e.i(166535),n=e.i(76795);e.i(476781),e.s(["NavWrapper",0,e=>{let a,l,i=(0,t.c)(11),{baseClass:o,children:s}=e,{hydrated:c,navOpen:u,navRef:d,shouldAnimate:f}=(0,n.useNav)(),p=u&&`${o}--nav-open`,h=f&&`${o}--nav-animate`,m=c&&`${o}--nav-hydrated`;i[0]!==o||i[1]!==p||i[2]!==h||i[3]!==m?(a=[o,p,h,m].filter(Boolean),i[0]=o,i[1]=p,i[2]=h,i[3]=m,i[4]=a):a=i[4];let g=a.join(" "),b=!u||void 0,v=`${o}__scroll`;return i[5]!==s||i[6]!==d||i[7]!==g||i[8]!==b||i[9]!==v?(l=(0,r.jsx)("aside",{className:g,inert:b,children:(0,r.jsx)("div",{className:v,ref:d,children:s})}),i[5]=s,i[6]=d,i[7]=g,i[8]=b,i[9]=v,i[10]=l):l=i[10],l}])},621151,e=>{"use strict";var t=e.i(815841);e.s(["useTranslation",()=>t.d])},563359,e=>{"use strict";var t=e.i(309442),r=e.i(166535),n=e.i(76795),a=e.i(621151),l=e.i(476781);function i(e,t){return(0,r.jsx)(l.Fragment,{children:e},`settings-menu-item-${t}`)}e.s(["SettingsMenuButton",0,e=>{let l,o=(0,t.c)(3),{settingsMenu:s}=e,{t:c}=(0,a.useTranslation)();return s&&0!==s.length?(o[0]!==s||o[1]!==c?(l=(0,r.jsx)(n.Popup,{button:(0,r.jsx)(n.GearIcon,{ariaLabel:c("general:menu")}),className:"settings-menu-button",horizontalAlign:"left",id:"settings-menu",size:"small",verticalAlign:"bottom",children:s.map(i)}),o[0]=s,o[1]=c,o[2]=l):l=o[2],l):null}])},196244,e=>{"use strict";var t=e.i(250558);e.s(["useConfig",()=>t.c])},486766,e=>{"use strict";e.i(166535),e.i(476781),Symbol.for("react.client.reference"),e.i(556529);var t,r=e.i(763591);e.i(214316);var n=e.i(244874),n=n,a=e.i(492421),l=e.i(516467);function i(e){let t=(0,l.toDate)(e),r=new Date(Date.UTC(t.getFullYear(),t.getMonth(),t.getDate(),t.getHours(),t.getMinutes(),t.getSeconds(),t.getMilliseconds()));return r.setUTCFullYear(t.getFullYear()),e-r}var o=e.i(539392),s=e.i(511518);function c(e,t){let r=(0,l.toDate)(e,t?.in);return r.setHours(0,0,0,0),r}var u=e.i(954259);function d(e,t){return(0,u.startOfWeek)(e,{...t,weekStartsOn:1})}var f=e.i(487122);function p(e,t){let r=(0,l.toDate)(e,t?.in),n=r.getFullYear(),a=(0,f.constructFrom)(r,0);a.setFullYear(n+1,0,4),a.setHours(0,0,0,0);let i=d(a),o=(0,f.constructFrom)(r,0);o.setFullYear(n,0,4),o.setHours(0,0,0,0);let s=d(o);return r.getTime()>=i.getTime()?n+1:r.getTime()>=s.getTime()?n:n-1}function h(e,t){let r=(0,l.toDate)(e,t?.in),n=r.getFullYear(),i=(0,a.getDefaultOptions)(),o=t?.firstWeekContainsDate??t?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,s=(0,f.constructFrom)(t?.in||e,0);s.setFullYear(n+1,0,o),s.setHours(0,0,0,0);let c=(0,u.startOfWeek)(s,t),d=(0,f.constructFrom)(t?.in||e,0);d.setFullYear(n,0,o),d.setHours(0,0,0,0);let p=(0,u.startOfWeek)(d,t);return+r>=+c?n+1:+r>=+p?n:n-1}function m(e,t){let r=Math.abs(e).toString().padStart(t,"0");return(e<0?"-":"")+r}let g={y(e,t){let r=e.getFullYear(),n=r>0?r:1-r;return m("yy"===t?n%100:n,t.length)},M(e,t){let r=e.getMonth();return"M"===t?String(r+1):m(r+1,2)},d:(e,t)=>m(e.getDate(),t.length),a(e,t){let r=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];
53default:return"am"===r?"a.m.":"p.m."}},h:(e,t)=>m(e.getHours()%12||12,t.length),H:(e,t)=>m(e.getHours(),t.length),m:(e,t)=>m(e.getMinutes(),t.length),s:(e,t)=>m(e.getSeconds(),t.length),S(e,t){let r=t.length;return m(Math.trunc(e.getMilliseconds()*Math.pow(10,r-3)),t.length)}},b={G:function(e,t,r){let n=+(e.getFullYear()>0);switch(t){case"G":case"GG":case"GGG":return r.era(n,{width:"abbreviated"});case"GGGGG":return r.era(n,{width:"narrow"});default:return r.era(n,{width:"wide"})}},y:function(e,t,r){if("yo"===t){let t=e.getFullYear();return r.ordinalNumber(t>0?t:1-t,{unit:"year"})}return g.y(e,t)},Y:function(e,t,r,n){let a=h(e,n),l=a>0?a:1-a;return"YY"===t?m(l%100,2):"Yo"===t?r.ordinalNumber(l,{unit:"year"}):m(l,t.length)},R:function(e,t){return m(p(e),t.length)},u:function(e,t){return m(e.getFullYear(),t.length)},Q:function(e,t,r){let n=Math.ceil((e.getMonth()+1)/3);switch(t){case"Q":return String(n);case"QQ":return m(n,2);case"Qo":return r.ordinalNumber(n,{unit:"quarter"});case"QQQ":return r.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(n,{width:"narrow",context:"formatting"});default:return r.quarter(n,{width:"wide",context:"formatting"})}},q:function(e,t,r){let n=Math.ceil((e.getMonth()+1)/3);switch(t){case"q":return String(n);case"qq":return m(n,2);case"qo":return r.ordinalNumber(n,{unit:"quarter"});case"qqq":return r.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(n,{width:"narrow",context:"standalone"});default:return r.quarter(n,{width:"wide",context:"standalone"})}},M:function(e,t,r){let n=e.getMonth();switch(t){case"M":case"MM":return g.M(e,t);case"Mo":return r.ordinalNumber(n+1,{unit:"month"});case"MMM":return r.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(n,{width:"narrow",context:"formatting"});default:return r.month(n,{width:"wide",context:"formatting"})}},L:function(e,t,r){let n=e.getMonth();switch(t){case"L":return String(n+1);case"LL":return m(n+1,2);case"Lo":return r.ordinalNumber(n+1,{unit:"month"});case"LLL":return r.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(n,{width:"narrow",context:"standalone"});default:return r.month(n,{width:"wide",context:"standalone"})}},w:function(e,t,r,n){let i,o,c,d,p,g=(i=(0,l.toDate)(e,n?.in),Math.round(((0,u.startOfWeek)(i,n)-(o=(0,a.getDefaultOptions)(),c=n?.firstWeekContainsDate??n?.locale?.options?.firstWeekContainsDate??o.firstWeekContainsDate??o.locale?.options?.firstWeekContainsDate??1,d=h(i,n),(p=(0,f.constructFrom)(n?.in||i,0)).setFullYear(d,0,c),p.setHours(0,0,0,0),(0,u.startOfWeek)(p,n)))/s.millisecondsInWeek)+1);return"wo"===t?r.ordinalNumber(g,{unit:"week"}):m(g,t.length)},I:function(e,t,r){let n,a,i,o=Math.round((d(n=(0,l.toDate)(e,void 0))-(a=p(n,void 0),(i=(0,f.constructFrom)(n,0)).setFullYear(a,0,4),i.setHours(0,0,0,0),d(i)))/s.millisecondsInWeek)+1;return"Io"===t?r.ordinalNumber(o,{unit:"week"}):m(o,t.length)},d:function(e,t,r){return"do"===t?r.ordinalNumber(e.getDate(),{unit:"date"}):g.d(e,t)},D:function(e,t,r){let n,a,u=function(e,t){let[r,n]=(0,o.normalizeDates)(void 0,e,t),a=c(r),l=c(n);return Math.round((a-i(a)-(l-i(l)))/s.millisecondsInDay)}(n=(0,l.toDate)(e,void 0),((a=(0,l.toDate)(n,void 0)).setFullYear(a.getFullYear(),0,1),a.setHours(0,0,0,0),a))+1;return"Do"===t?r.ordinalNumber(u,{unit:"dayOfYear"}):m(u,t.length)},E:function(e,t,r){let n=e.getDay();switch(t){case"E":case"EE":case"EEE":return r.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(n,{width:"short",context:"formatting"});default:return r.day(n,{width:"wide",context:"formatting"})}},e:function(e,t,r,n){let a=e.getDay(),l=(a-n.weekStartsOn+8)%7||7;switch(t){case"e":return String(l);case"ee":return m(l,2);case"eo":return r.ordinalNumber(l,{unit:"day"});case"eee":return r.day(a,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(a,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(a,{width:"short",context:"formatting"});default:return r.day(a,{width:"wide",context:"formatting"})}},c:function(e,t,r,n){let a=e.getDay(),l=(a-n.weekStartsOn+8)%7||7;switch(t){case"c":return String(l);case"cc":return m(l,t.length);case"co":return r.ordinalNumber(l,{unit:"day"});case"ccc":return r.day(a,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(a,{width:"narrow",context:"standalone"});case"cccccc":return r.day(a,{width:"short",context:"standalone"});default:return r.day(a,{width:"wide",context:"standalone"})}},i:function(e,t,r){let n=e.getDay(),a=0===n?7:n;switch(t){case"i":return String(a);case"ii":return m(a,t.length);case"io":return r.ordinalNumber(a,{unit:"day"});case"iii":return r.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(n,{width:"short",context:"formatting"});default:return r.day(n,{width:"wide",context:"formatting"})}},a:function(e,t,r){let n=e.getHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(n,{width:"narrow",context:"formatting"});default:return r.dayPeriod(n,{width:"wide",context:"formatting"})}},b:function(e,t,r){let n,a=e.getHours();switch(n=12===a?"noon":0===a?"midnight":a/12>
53=1?"pm":"am",t){case"b":case"bb":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(n,{width:"narrow",context:"formatting"});default:return r.dayPeriod(n,{width:"wide",context:"formatting"})}},B:function(e,t,r){let n,a=e.getHours();switch(n=a>=17?"evening":a>=12?"afternoon":a>=4?"morning":"night",t){case"B":case"BB":case"BBB":return r.dayPeriod(n,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(n,{width:"narrow",context:"formatting"});default:return r.dayPeriod(n,{width:"wide",context:"formatting"})}},h:function(e,t,r){if("ho"===t){let t=e.getHours()%12;return 0===t&&(t=12),r.ordinalNumber(t,{unit:"hour"})}return g.h(e,t)},H:function(e,t,r){return"Ho"===t?r.ordinalNumber(e.getHours(),{unit:"hour"}):g.H(e,t)},K:function(e,t,r){let n=e.getHours()%12;return"Ko"===t?r.ordinalNumber(n,{unit:"hour"}):m(n,t.length)},k:function(e,t,r){let n=e.getHours();return(0===n&&(n=24),"ko"===t)?r.ordinalNumber(n,{unit:"hour"}):m(n,t.length)},m:function(e,t,r){return"mo"===t?r.ordinalNumber(e.getMinutes(),{unit:"minute"}):g.m(e,t)},s:function(e,t,r){return"so"===t?r.ordinalNumber(e.getSeconds(),{unit:"second"}):g.s(e,t)},S:function(e,t){return g.S(e,t)},X:function(e,t,r){let n=e.getTimezoneOffset();if(0===n)return"Z";switch(t){case"X":return y(n);case"XXXX":case"XX":return x(n);default:return x(n,":")}},x:function(e,t,r){let n=e.getTimezoneOffset();switch(t){case"x":return y(n);case"xxxx":case"xx":return x(n);default:return x(n,":")}},O:function(e,t,r){let n=e.getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+v(n,":");default:return"GMT"+x(n,":")}},z:function(e,t,r){let n=e.getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+v(n,":");default:return"GMT"+x(n,":")}},t:function(e,t,r){return m(Math.trunc(e/1e3),t.length)},T:function(e,t,r){return m(+e,t.length)}};function v(e,t=""){let r=e>0?"-":"+",n=Math.abs(e),a=Math.trunc(n/60),l=n%60;return 0===l?r+String(a):r+String(a)+t+m(l,2)}function y(e,t){return e%60==0?(e>0?"-":"+")+m(Math.abs(e)/60,2):x(e,t)}function x(e,t=""){let r=Math.abs(e);return(e>0?"-":"+")+m(Math.trunc(r/60),2)+t+m(r%60,2)}let w=(e,t)=>{switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},C=(e,t)=>{switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},j={p:C,P:(e,t)=>{let r,n=e.match(/(P+)(p+)?/)||[],a=n[1],l=n[2];if(!l)return w(e,t);switch(a){case"P":r=t.dateTime({width:"short"});break;case"PP":r=t.dateTime({width:"medium"});break;case"PPP":r=t.dateTime({width:"long"});break;default:r=t.dateTime({width:"full"})}return r.replace("{{date}}",w(a,t)).replace("{{time}}",C(l,t))}},S=/^D+$/,$=/^Y+$/,_=["D","DD","YY","YYYY"],k=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,E=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,N=/^'([^]*?)'?$/,P=/''/g,T=/[a-zA-Z]/;function D(e,t,r){let i=(0,a.getDefaultOptions)(),o=r?.locale??i.locale??n.enUS,s=r?.firstWeekContainsDate??r?.locale?.options?.firstWeekContainsDate??i.firstWeekContainsDate??i.locale?.options?.firstWeekContainsDate??1,c=r?.weekStartsOn??r?.locale?.options?.weekStartsOn??i.weekStartsOn??i.locale?.options?.weekStartsOn??0,u=(0,l.toDate)(e,r?.in);if(!(u instanceof Date||"object"==typeof u&&"[object Date]"===Object.prototype.toString.call(u))&&"number"!=typeof u||isNaN(+(0,l.toDate)(u)))throw RangeError("Invalid time value");let d=t.match(E).map(e=>{let t=e[0];return"p"===t||"P"===t?(0,j[t])(e,o.formatLong):e}).join("").match(k).map(e=>{if("''"===e)return{isToken:!1,value:"'"};let t=e[0];if("'"===t){var r;let t;return{isToken:!1,value:(t=(r=e).match(N))?t[1].replace(P,"'"):r}}if(b[t])return{isToken:!0,value:e};if(t.match(T))throw RangeError("Format string contains an unescaped latin alphabet character `"+t+"`");return{isToken:!1,value:e}});o.localize.preprocessor&&(d=o.localize.preprocessor(u,d));let f={firstWeekContainsDate:s,weekStartsOn:c,locale:o};return d.map(n=>{if(!n.isToken)return n.value;let a=n.value;return(!r?.useAdditionalWeekYearTokens&&$.test(a)||!r?.useAdditionalDayOfYearTokens&&S.test(a))&&function(e,t,r){var n,a,l;let i,o=(n=e,a=t,l=r,i="Y"===n[0]?"years":"days of the month",`Use \`${n.toLowerCase()}\` instead of \`${n}\` (in \`${a}\`) for formatting ${i} to the input \`${l}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`);if(console.warn(o),_.includes(e))throw RangeError(o)}(a,t,String(e)),(0,b[a[0]])(u,a,o.localize,f)}).join("")}e.i(45895),e.i(219365);var R={},A={};function O(e,t){try{let r=(R[e]||=new Intl.DateTimeFormat("en-GB",{timeZone:e,hour:"numeric",timeZoneName:"longOffset"}).format)(t).split("GMT")[1]||"";return r in A?A[r]:M(r,r.split(":"))}catch{if(e in A)return A[e];let t=e?.match(L);return t?M(e,t.slice(1)):NaN}}var L=/([+-]\d\d):?(\d\d)?/;function M(e,t){let r=+t[0],n=+(t[1]||0);return A[e]=r>0?60*r+n:60*r-n}var I=class e extends Date{constructor(...e){super(),e.length>1&&"string"==typeof e[e.length-1]&&(this.timeZone=e.pop()),this.internal=new Date,isNaN(O(this.timeZone,this))?this.setTime(NaN):e.length?"number"==typeof e[0]&&(1===e.length||2===e.length&&"number"!=typeof e[1])?this.setTime(e[0]):"string"==typeof e[0]?this.setTime(+new Date(e[0])):e[0]instanceof Date?this.setTime(+e[0]):(this.setTime(+new Date(...e)),z(this,NaN),B(this)):this.setTime(Date.now())}static tz(t,...r){return r.length?new e(...r,t):new e(Date.now(),t)}withTimeZone(t){return new e(+this,t)}getTimezoneOffset(){return-O(this.timeZone,this)}setTime(e){return Date.prototype.setTime.apply(this,arguments),B(this),+this}[Symbol.for("constructDateFrom")](t){return new e(+new Date(t),this.timeZone)}},F=/^(get|set)(?!UTC)/;function B(e){e.internal.setTime(+e),e.internal.setUTCMinutes(e.internal.getUTCMinutes()-e.getTimezoneOffset())}function z(e){let t=O(e.timeZone,e),r=new Date(+e);r.setUTCHours(r.getUTCHours()-1);let n=-new Date(+e).getTimezoneOffset(),a=n- -new Date(+r).getTimezoneOffset(),l=Date.prototype.getHours.apply(e)!==e.internal.getUTCHours();a&&l&&e.internal.setUTCMinutes(e.internal.getUTCMinutes()+a);let i=n-t;i&&Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+i);let o=O(e.timeZone,e),s=-new Date(+e).getTimezoneOffset()-o-i;if(o!==t&&s){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+s);let t=o-O(e.timeZone,e);t&&(e.internal.setUTCMinutes(e.internal.getUTCMinutes()+t),Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+t))}}
53Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!F.test(e))return;let t=e.replace(F,"$1UTC");I.prototype[t]&&(e.startsWith("get")?I.prototype[e]=function(){return this.internal[t]()}:(I.prototype[e]=function(){var e;return Date.prototype[t].apply(this.internal,arguments),e=this,Date.prototype.setFullYear.call(e,e.internal.getUTCFullYear(),e.internal.getUTCMonth(),e.internal.getUTCDate()),Date.prototype.setHours.call(e,e.internal.getUTCHours(),e.internal.getUTCMinutes(),e.internal.getUTCSeconds(),e.internal.getUTCMilliseconds()),z(e),+this},I.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),B(this),+this}))});var U=((t={}).collection="collections",t.global="globals",t);e.s(["EntityType",0,U,"abortAndIgnore",0,function(e){if(e)try{e.abort()}catch{}},"formatDate",0,({date:e,i18n:t,pattern:r,timezone:n})=>{let a=new I(new Date(e));if(n){var l,i;let e,o=I.tz(n),s=(l=a.withTimeZone(n),(e="function"==typeof(i=o)&&i.prototype?.constructor===i?new o(0):(0,f.constructFrom)(o,0)).setFullYear(l.getFullYear(),l.getMonth(),l.getDate()),e.setHours(l.getHours(),l.getMinutes(),l.getSeconds(),l.getMilliseconds()),e);return t.dateFNS?D(s,r,{locale:t.dateFNS}):`${t.t("general:loading")}...`}return t.dateFNS?D(a,r,{locale:t.dateFNS}):`${t.t("general:loading")}...`},"handleAbortRef",0,function(e){let t=new AbortController;if(e.current)try{e.current.abort()}catch{}return e.current=t,t},"requests",0,{delete:(e,t={headers:{}})=>{let r=t&&t.headers?{...t.headers}:{};return fetch(e,{...t,credentials:"include",headers:{...r},method:"delete"})},get:(e,t={headers:{}})=>{let n="";return t.params&&(n=r.stringify(t.params,{addQueryPrefix:!0})),fetch(`${e}${n}`,{credentials:"include",...t})},patch:(e,t={headers:{}})=>{let r=t&&t.headers?{...t.headers}:{};return fetch(e,{...t,credentials:"include",headers:{...r},method:"PATCH"})},post:(e,t={headers:{}})=>{let r=t&&t.headers?{...t.headers}:{};return fetch(`${e}`,{...t,credentials:"include",headers:{...r},method:"post"})},put:(e,t={headers:{}})=>{let r=t&&t.headers?{...t.headers}:{};return fetch(e,{...t,credentials:"include",headers:{...r},method:"put"})}}],486766)},609389,e=>{"use strict";var t=e.i(309442),r=e.i(166535),n=e.i(45895),a=e.i(76795),l=e.i(196244),i=e.i(621151),o=e.i(486766),s=e.i(304498),c=e.i(214316),u=e.i(476781);e.s(["DefaultNavClient",0,e=>{let d,f=(0,t.c)(13),{groups:p,navPreferences:h}=e,m=(0,s.usePathname)(),{config:g}=(0,l.useConfig)(),{admin:b,folders:v,routes:y}=g,{routes:x}=b,{browseByFolder:w}=x,{admin:C}=y,{i18n:j}=(0,i.useTranslation)();if(f[0]!==C||f[1]!==v||f[2]!==w||f[3]!==p||f[4]!==j||f[5]!==h?.groups||f[6]!==m){let e,t=(0,c.formatAdminURL)({adminRoute:C,path:w}),l=m.startsWith(t);f[8]!==C||f[9]!==j||f[10]!==h?.groups||f[11]!==m?(e=(e,t)=>{let{entities:l,label:i}=e;return(0,r.jsx)(a.NavGroup,{isOpen:h?.groups?.[i]?.open,label:i,children:l.map((e,t)=>{let l,i,{slug:s,type:u,label:d}=e;u===o.EntityType.collection&&(l=(0,c.formatAdminURL)({adminRoute:C,path:`/collections/${s}`}),i=`nav-${s}`),u===o.EntityType.global&&(l=(0,c.formatAdminURL)({adminRoute:C,path:`/globals/${s}`}),i=`nav-global-${s}`);let f=m.startsWith(l)&&["/",void 0].includes(m[l.length]),p=(0,r.jsxs)(r.Fragment,{children:[f&&(0,r.jsx)("div",{className:"nav__link-indicator"}),(0,r.jsx)("span",{className:"nav__link-label",children:(0,n.getTranslation)(d,j)})]});return m===l?(0,r.jsx)("div",{className:"nav__link",id:i,children:p},t):(0,r.jsx)(a.Link,{className:"nav__link",href:l,id:i,prefetch:!1,children:p},t)})},t)},f[8]=C,f[9]=j,f[10]=h?.groups,f[11]=m,f[12]=e):e=f[12],d=(0,r.jsxs)(u.Fragment,{children:[v&&v.browseByFolder&&(0,r.jsx)(a.BrowseByFolderButton,{active:l}),p.map(e)]}),f[0]=C,f[1]=v,f[2]=w,f[3]=p,f[4]=j,f[5]=h?.groups,f[6]=m,f[7]=d}else d=f[7];return d}])},92990,e=>{"use strict";var t=e.i(309442),r=e.i(166535),n=e.i(76795);e.i(476781),e.s(["NavHamburger",0,()=>{let e,a=(0,t.c)(2),{navOpen:l}=(0,n.useNav)();return a[0]!==l?(e=(0,r.jsx)(n.Hamburger,{closeIcon:"collapse",isActive:l}),a[0]=l,a[1]=e):e=a[1],e}])},701135,e=>{"use strict";var t=e.i(309442),r=e.i(166535),n=e.i(76795);e.i(476781),e.s(["Wrapper",0,e=>{let a,l,i=(0,t.c)(9),{baseClass:o,children:s,className:c}=e,{hydrated:u,navOpen:d,shouldAnimate:f}=(0,n.useNav)(),p=d&&`${o}--nav-open`,h=f&&`${o}--nav-animate`,m=u&&`${o}--nav-hydrated`;i[0]!==o||i[1]!==c||i[2]!==p||i[3]!==h||i[4]!==m?(a=[o,c,p,h,m].filter(
53Boolean),i[0]=o,i[1]=c,i[2]=p,i[3]=h,i[4]=m,i[5]=a):a=i[5];let g=a.join(" ");return i[6]!==s||i[7]!==g?(l=(0,r.jsx)("div",{className:g,children:s}),i[6]=s,i[7]=g,i[8]=l):l=i[8],l}])},897867,e=>{"use strict";var t=e.i(309442),r=e.i(166535),n=e.i(76795),a=e.i(196244),l=e.i(621151),i=e.i(476781);let o="not-found";e.s(["NotFoundClient",0,e=>{let s,c,u,d,f=(0,t.c)(10),{marginTop:p}=e,h=void 0===p?"large":p,{setStepNav:m}=(0,n.useStepNav)(),{t:g}=(0,l.useTranslation)(),{config:b}=(0,a.useConfig)(),{routes:v}=b,{admin:y}=v;f[0]!==m||f[1]!==g?(s=()=>{m([{label:g("general:notFound")}])},c=[m,g],f[0]=m,f[1]=g,f[2]=s,f[3]=c):(s=f[2],c=f[3]),(0,i.useEffect)(s,c);let x=h&&`${o}--margin-top-${h}`;f[4]!==x?(u=[o,x].filter(Boolean),f[4]=x,f[5]=u):u=f[5];let w=u.join(" ");return f[6]!==y||f[7]!==g||f[8]!==w?(d=(0,r.jsx)("div",{className:w,children:(0,r.jsxs)(n.Gutter,{className:`${o}__wrap`,children:[(0,r.jsxs)("div",{className:`${o}__content`,children:[(0,r.jsx)("h1",{children:g("general:nothingFound")}),(0,r.jsx)("p",{children:g("general:sorryNotFound")})]}),(0,r.jsx)(n.Button,{className:`${o}__button`,el:"link",size:"large",to:y,children:g("general:backToDashboard")})]})}),f[6]=y,f[7]=g,f[8]=w,f[9]=d):d=f[9],d}])},537349,e=>{"use strict";var t=e.i(166535),r=e.i(76795),n=e.i(196244),a=e.i(621151),l=e.i(304498),i=e.i(214316),o=e.i(571167),s=e.i(476781),c=e.i(309442);let u=e=>{let n,l=(0,c.c)(6),{localeOptions:i,onChange:o}=e,{t:s}=(0,a.useTranslation)();if(l[0]!==i||l[1]!==o||l[2]!==s){let e;l[4]!==o?(e=e=>o(e),l[4]=o,l[5]=e):e=l[5],n=(0,t.jsx)(r.SelectField,{field:{name:"locale",label:s("general:locale"),options:i},onChange:e,path:"locale"}),l[0]=i,l[1]=o,l[2]=s,l[3]=n}else n=l[3];return n},d="query-inspector",f=({type:e,comma:r=!1,position:n})=>(0,t.jsxs)("span",{className:`${d}__bracket ${d}__bracket--position-${n}`,children:["end"===n?"object"===e?"}":"]":"object"===e?"{":"[","end"===n&&r?",":null]}),p=e=>{let n,a=(0,c.c)(2),{isEmpty:l,object:i,objectKey:o,parentType:u,trailingComma:h}=e,m=void 0!==l&&l,g=void 0===u?"object":u,b=void 0!==h&&h,v=i?Object.keys(i):[],y=v.length,[x,w]=s.useState(!0),C="object"===g||"array"===g;return a[0]!==x?(n=()=>w(!x),a[0]=x,a[1]=n):n=a[1],(0,t.jsxs)("li",{className:C?`${d}__row-line--nested`:"",children:[(0,t.jsxs)("button",{"aria-label":"toggle",className:`${d}__list-toggle ${m?`${d}__list-toggle--empty`:""}`,onClick:n,type:"button",children:[m?null:(0,t.jsx)(r.ChevronIcon,{className:`${d}__toggle-row-icon ${d}__toggle-row-icon--${x?"open":"closed"}`}),(0,t.jsxs)("span",{children:[o&&`"${o}": `,(0,t.jsx)(f,{position:"start",type:g}),m?(0,t.jsx)(f,{comma:b,position:"end",type:g}):null]})]}),(0,t.jsx)("ul",{className:`${d}__json-children ${C?`${d}__json-children--nested`:""}`,children:x&&v.map((e,r)=>{let n,a=i[e],l=r===y-1;if(null===a?n="null":a instanceof Date?(n="date",a=a.toISOString()):n=Array.isArray(a)?"array":"object"==typeof a?"object":"number"==typeof a?"number":"boolean"==typeof a?"boolean":"string","object"===n||"array"===n)return(0,t.jsx)(p,{isEmpty:0===a.length||0===Object.keys(a).length,object:a,objectKey:"object"===g?e:void 0,parentType:n,trailingComma:!l},`${e}-${r}`);if("date"===n||"string"===n||"null"===n||"number"===n||"boolean"===n){let i=!!("object"===g&&e),s=[`${d}__row-line`,`${d}__value-type--${n}`,`${d}__row-line--${o?"nested":"top"}`].filter(Boolean).join(" ");return(0,t.jsxs)("li",{className:s,children:[i?(0,t.jsx)("span",{children:`"${e}": `}):null,(0,t.jsx)("span",{className:`${d}__value`,children:JSON.stringify(a)}),l?"":","]},`${e}-${r}`)}})}),!m&&(0,t.jsx)("span",{className:C?`${d}__bracket--nested`:"",children:(0,t.jsx)(f,{comma:b,position:"end",type:g})})]})},h="query-inspector";e.s(["APIViewClient",0,()=>{let e,{id:c,collectionSlug:d,globalSlug:f,initialData:m,isTrashed:g}=(0,r.useDocumentInfo)(),b=(0,l.useSearchParams)(),{i18n:v,t:y}=(0,a.useTranslation)(),{code:x}=(0,r.useLocale)(),{config:{defaultDepth:w,localization:C,routes:{api:j},serverURL:S},getEntityConfig:$}=(0,n.useConfig)(),_=$({collectionSlug:d}),k=$({globalSlug:f}),E=C&&C.locales.map(e=>({label:e.label,value:e.code})),N=!1;_&&(N=(0,o.hasDraftsEnabled)(_),e=`/${d}/${c}`),k&&(N=(0,o.hasDraftsEnabled)(k),e=`/globals/${f}`);let[P,T]=s.useState(m),[D,R]=s.useState("true"===b.get("draft")),[A,O]=s.useState(b?.get("locale")||x),[L,M]=s.useState(b.get("depth")||w.toString()),[I,F]=s.useState(!0),[B,z]=s.useState(!1),U="string"==typeof m?.deletedAt,V=new URLSearchParams({depth:L,draft:String(D),locale:A,trash:U?"true":"false"}).toString(),H=(0,i.formatAdminURL)({apiRoute:j,path:`${e}?${V}`,serverURL:S||window.location.origin});return s.useEffect(()=>{(async()=>
53{try{let e=await fetch(H,{credentials:I?"include":"omit",headers:{"Accept-Language":v.language},method:"GET"});try{let t=await e.json();T(t)}catch(e){r.toast.error("Error parsing response"),console.error(e)}}catch(e){r.toast.error("Error making request"),console.error(e)}})()},[v.language,H,I]),(0,t.jsxs)(r.Gutter,{className:[h,B&&`${h}--fullscreen`].filter(Boolean).join(" "),right:!1,children:[(0,t.jsx)(r.SetDocumentStepNav,{collectionSlug:d,globalLabel:k?.label,globalSlug:f,id:c,isTrashed:g,pluralLabel:_?_?.labels?.plural:void 0,useAsTitle:_?_?.admin?.useAsTitle:void 0,view:"API"}),(0,t.jsxs)("div",{className:`${h}__configuration`,children:[(0,t.jsxs)("div",{className:`${h}__api-url`,children:[(0,t.jsxs)("span",{className:`${h}__label`,children:["API URL ",(0,t.jsx)(r.CopyToClipboard,{value:H})]}),(0,t.jsx)("a",{href:H,rel:"noopener noreferrer",target:"_blank",children:H})]}),(0,t.jsx)(r.Form,{initialState:{authenticated:{initialValue:I||!1,valid:!0,value:I||!1},depth:{initialValue:Number(L||0),valid:!0,value:Number(L||0)},draft:{initialValue:D||!1,valid:!0,value:D||!1},locale:{initialValue:A,valid:!0,value:A}},children:(0,t.jsxs)("div",{className:`${h}__form-fields`,children:[(0,t.jsxs)("div",{className:`${h}__filter-query-checkboxes`,children:[N&&(0,t.jsx)(r.CheckboxField,{field:{name:"draft",label:y("version:draft")},onChange:()=>R(!D),path:"draft"}),(0,t.jsx)(r.CheckboxField,{field:{name:"authenticated",label:y("authentication:authenticated")},onChange:()=>F(!I),path:"authenticated"})]}),E&&(0,t.jsx)(u,{localeOptions:E,onChange:O}),(0,t.jsx)(r.NumberField,{field:{name:"depth",admin:{step:1},label:y("general:depth"),max:10,min:0},onChange:e=>M(e?.toString()),path:"depth"})]})})]}),(0,t.jsxs)("div",{className:`${h}__results-wrapper`,children:[(0,t.jsx)("div",{className:`${h}__toggle-fullscreen-button-container`,children:(0,t.jsx)("button",{"aria-label":"toggle fullscreen",className:`${h}__toggle-fullscreen-button`,onClick:()=>z(!B),type:"button",children:(0,t.jsx)(r.MinimizeMaximizeIcon,{isMinimized:!B})})}),(0,t.jsx)("div",{className:`${h}__results`,children:(0,t.jsx)(p,{object:P})})]})]})}],537349)},30566,e=>{"use strict";var t=e.i(166535),r=e.i(76795);e.i(476781),e.s(["EditView",0,e=>(0,t.jsx)(r.DefaultEditView,{...e})])},126542,e=>{"use strict";var t=e.i(476781);let r=(0,t.createContext)({selectedLocales:[]});e.s(["SelectedLocalesContext",0,r,"useSelectedLocales",0,()=>(0,t.use)(r)])},276976,e=>{"use strict";var t=e.i(166535),r=e.i(76795),n=e.i(196244),a=e.i(621151),l=e.i(304498),i=e.i(476781),o=e.i(45895),s=e.i(486766),c=e.i(214316);let u="restore-version",d="restore-version",f=({className:e,collectionConfig:f,globalConfig:p,label:h,originalDocID:m,status:g,versionDateFormatted:b,versionID:v})=>{let{config:{routes:{admin:y,api:x}}}=(0,n.useConfig)(),{toggleModal:w}=(0,r.useModal)(),C=(0,l.useRouter)(),{i18n:j,t:S}=(0,a.useTranslation)(),[$,_]=(0,i.useState)(!1),{startRouteTransition:k}=(0,r.useRouteTransition)(),E=S(p?"version:aboutToRestoreGlobal":"version:aboutToRestore",{label:(0,o.getTranslation)(h,j),versionDate:b}),N="draft"!==g&&f?.versions?.drafts,P=(0,i.useCallback)(async()=>{let e,t=(0,c.formatAdminURL)({apiRoute:x,path:""});f&&(t=`${t}/${f.slug}/versions/${v}?draft=${$}`,e=(0,c.formatAdminURL)({adminRoute:y,path:`/collections/${f.slug}/${m}`})),p&&(t=`${t}/globals/${p.slug}/versions/${v}?draft=${$}`,e=(0,c.formatAdminURL)({adminRoute:y,path:`/globals/${p.slug}`}));let n=await s.requests.post(t,{headers:{"Accept-Language":j.language}});if(200===n.status){let t=await n.json();return r.toast.success(t.message),k(()=>C.push(e))}r.toast.error(S("version:problemRestoringVersion"))},[x,f,p,j.language,v,$,y,m,k,C,S]);return(0,t.jsxs)(i.Fragment,{children:[(0,t.jsx)("div",{className:[u,e].filter(
53Boolean).join(" "),children:(0,t.jsx)(r.Button,{buttonStyle:"primary",className:[N&&`${u}__restore-as-draft-button`].filter(Boolean).join(" "),onClick:()=>w(d),size:"xsmall",SubMenuPopupContent:N?()=>(0,t.jsx)(r.PopupList.ButtonGroup,{children:(0,t.jsx)(r.PopupList.Button,{onClick:()=>[_(!0),w(d)],children:S("version:restoreAsDraft")})}):null,children:S("version:restoreThisVersion")})}),(0,t.jsx)(r.ConfirmationModal,{body:E,confirmingLabel:S("version:restoring"),heading:S("version:confirmVersionRestoration"),modalSlug:d,onConfirm:P})]})};var p=e.i(309442);let h=e=>{let{collectionSlug:n,docID:o,drawerSlug:s,globalSlug:c}=e,{isTrashed:u}=(0,r.useDocumentInfo)(),{closeModal:d}=(0,r.useModal)(),f=(0,l.useSearchParams)(),p=(0,i.useRef)(f),{renderDocument:h}=(0,r.useServerFunctions)(),[m,g]=(0,i.useState)(void 0),[b,v]=(0,i.useState)(!0),y=(0,i.useRef)(!1),{t:x}=(0,a.useTranslation)(),w=(0,i.useCallback)(e=>{(async()=>{v(!0);try{let t=!!c,r=n??c,a=await h({collectionSlug:r,docID:e,drawerSlug:s,paramsOverride:{segments:[t?"globals":"collections",r,...u?["trash"]:[],t?void 0:String(e),"versions"].filter(Boolean)},redirectAfterDelete:!1,redirectAfterDuplicate:!1,searchParams:Object.fromEntries(f.entries()),versions:{disableGutter:!0,useVersionDrawerCreatedAtCell:!0}});a?.Document&&(g(a.Document),v(!1))}catch(e){r.toast.error(e?.message||x("error:unspecific")),d(s)}})()},[d,n,s,c,u,h,f,x]);return((0,i.useEffect)(()=>{y.current&&p.current===f||(p.current=f,w(o),y.current=!0)}
53,[o,w,f]),b)?(0,t.jsx)(r.LoadingOverlay,{}):m},m=e=>{let n,l=(0,p.c)(6),{collectionSlug:i,docID:o,drawerSlug:s,globalSlug:c}=e,{t:u}=(0,a.useTranslation)();return l[0]!==i||l[1]!==o||l[2]!==s||l[3]!==c||l[4]!==u?(n=(0,t.jsx)(r.Drawer,{className:"version-drawer",gutter:!0,slug:s,title:u("version:selectVersionToCompare"),children:(0,t.jsx)(h,{collectionSlug:i,docID:o,drawerSlug:s,globalSlug:c})}),l[0]=i,l[1]=o,l[2]=s,l[3]=c,l[4]=u,l[5]=n):n=l[5],n},g="compare-version",b=(0,i.memo)(e=>{let{collectionSlug:n,docID:l,globalSlug:o,onChange:s,versionFromID:c,versionFromOptions:u}=e,{t:d}=(0,a.useTranslation)(),{Drawer:f,openDrawer:h}=(e=>{let n,a,l,o,s,c,u,d,f=(0,p.c)(29),{collectionSlug:h,docID:g,globalSlug:b}=e,v=(0,r.useEditDepth)(),y=(0,i.useId)(),{closeModal:x,modalState:w,openModal:C,toggleModal:j}=(0,r.useModal)(),[S,$]=(0,i.useState)(!1);f[0]!==v||f[1]!==y?(n=(({depth:e,uuid:t})=>`version-drawer_${e}_${t}`)({depth:v,uuid:y}),f[0]=v,f[1]=y,f[2]=n):n=f[2];let _=n;f[3]!==_||f[4]!==w?(a=()=>{$(!!w[_]?.isOpen)},l=[w,_],f[3]=_,f[4]=w,f[5]=a,f[6]=l):(a=f[5],l=f[6]),(0,i.useEffect)(a,l),f[7]!==_||f[8]!==j?(o=()=>{j(_)},f[7]=_,f[8]=j,f[9]=o):o=f[9];let k=o;f[10]!==x||f[11]!==_?(s=()=>{x(_)},f[10]=x,f[11]=_,f[12]=s):s=f[12];let E=s;f[13]!==_||f[14]!==C?(c=()=>{C(_)},f[13]=_,f[14]=C,f[15]=c):c=f[15];let N=c;f[16]!==h||f[17]!==g||f[18]!==_||f[19]!==b?(u=()=>(0,t.jsx)(m,{collectionSlug:h,docID:g,drawerSlug:_,globalSlug:b}),f[16]=h,f[17]=g,f[18]=_,f[19]=b,f[20]=u):u=f[20];let P=u;return f[21]!==P||f[22]!==E||f[23]!==v||f[24]!==_||f[25]!==S||f[26]!==N||f[27]!==k?(d={closeDrawer:E,Drawer:P,drawerDepth:v,drawerSlug:_,isDrawerOpen:S,openDrawer:N,toggleDrawer:k},f[21]=P,f[22]=E,f[23]=v,f[24]=_,f[25]=S,f[26]=N,f[27]=k,f[28]=d):d=f[28],d})({collectionSlug:n,docID:l,globalSlug:o}),b=(0,i.useMemo)(()=>[...u,{label:(0,t.jsx)("span",{className:`${g}-moreVersions`,children:d("version:moreVersions")}),value:"more"}],[d,u]),v=(0,i.useMemo)(()=>u.find(e=>e.value===c),[u,c]),y=(0,i.useCallback)(e=>{"more"===e.value?h():s(e)},[s,h]);return(0,t.jsxs)("div",{className:[r.fieldBaseClass,g].filter(Boolean).join(" "),children:[(0,t.jsx)(r.ReactSelect,{isClearable:!1,isSearchable:!1,onChange:y,options:b,placeholder:d("version:selectVersionToCompare"),value:v}),(0,t.jsx)(f,{})]})}),v="select-version-locales",y=({locales:e,localeSelectorOpen:n,onChange:a})=>(0,t.jsx)(r.AnimateHeight,{className:v,height:n?"auto":0,id:`${v}-locales`,children:(0,t.jsx)(r.PillSelector,{onClick:({pill:t})=>{a({locales:e.map(e=>e.name===t.name?{...e,selected:!t.selected}:e)})},pills:e})});var x=e.i(126542);let w=e=>{let t,l,s=(0,p.c)(24),{id:u,collectionConfig:d,globalConfig:f,isTrashed:h,versionToCreatedAtFormatted:m,versionToID:g}=e,{config:b}=(0,n.useConfig)(),{setStepNav:v}=(0,r.useStepNav)(),{i18n:y,t:x}=(0,a.useTranslation)(),w=(0,r.useLocale)(),{title:C}=(0,r.useDocumentTitle)();return s[0]!==d||s[1]!==b||s[2]!==f||s[3]!==y||s[4]!==u||s[5]!==h||s[6]!==v||s[7]!==x||s[8]!==C||s[9]!==m?(t=()=>{let{routes:e}=b,{admin:t}=e;if(d){let e=d.slug,r=d.labels?.plural,n=h?`/collections/${e}/trash/${u}`:`/collections/${e}/${u}`,a=[{label:(0,o.getTranslation)(r,y),url:(0,c.formatAdminURL)({adminRoute:t,path:`/collections/${e}`})}];h&&a.push({label:x("general:trash"),url:(0,c.formatAdminURL)({adminRoute:t,path:`/collections/${e}/trash`})}),a.push({label:C,url:(0,c.formatAdminURL)({adminRoute:t,path:n})},{label:x("version:versions"),url:(0,c.formatAdminURL)({adminRoute:t,path:`${n}/versions`})},{label:m,url:void 0}),v(a);return}if(f){let e=f.slug;v([{label:f.label,url:(0,c.formatAdminURL)({adminRoute:t,path:`/globals/${e}`})},{label:x("version:versions"),url:(0,c.formatAdminURL)({adminRoute:t,path:`/globals/${e}/versions`})},{label:m}])}},s[0]=d,s[1]=b,s[2]=f,s[3]=y,s[4]=u,s[5]=h,s[6]=v,s[7]=x,s[8]=C,s[9]=m,s[10]=t):t=s[10],s[11]!==d||s[12]!==b||s[13]!==f||s[14]!==y||s[15]!==u||s[16]!==h||s[17]!==w||s[18]!==v||s[19]!==x||s[20]!==C||s[21]!==m||s[22]!==g?(l=[b,v,u,h,w,x,y,d,f,C,m,g],s[11]=d,s[12]=b,s[13]=f,s[14]=y,s[15]=u,s[16]=h,s[17]=w,s[18]=v,s[19]=x,s[20]=C,s[21]=m,s[22]=g,s[23]=l):l=s[23],
53(0,i.useEffect)(t,l),null},C="view-version";e.s(["DefaultVersionView",0,({canUpdate:e,modifiedOnly:o,RenderedDiff:s,selectedLocales:c,versionFromCreatedAt:u,versionFromID:d,versionFromOptions:p,versionToCreatedAt:h,versionToCreatedAtFormatted:m,VersionToCreatedAtLabel:g,versionToID:v,versionToStatus:j})=>{let{config:S,getEntityConfig:$}=(0,n.useConfig)(),{code:_}=(0,r.useLocale)(),{i18n:k,t:E}=(0,a.useTranslation)(),[N,P]=(0,i.useState)([]),[T,D]=i.default.useState(!1);(0,i.useEffect)(()=>{S.localization&&P(S.localization.locales.map(e=>{let t=e.label;return"string"!=typeof e.label&&e.label[_]&&(t=e.label[_]),{name:e.code,Label:t,selected:c.includes(e.code)}}))},[_,S.localization,c]);let{id:R,collectionSlug:A,globalSlug:O,isTrashed:L}=(0,r.useDocumentInfo)(),{startRouteTransition:M}=(0,r.useRouteTransition)(),{collectionConfig:I,globalConfig:F}=(0,i.useMemo)(()=>({collectionConfig:$({collectionSlug:A}),globalConfig:$({globalSlug:O})}),[A,O,$]),B=(0,l.useRouter)(),z=(0,l.usePathname)(),U=(0,l.useSearchParams)(),[V,H]=(0,i.useState)(o),q=(0,i.useCallback)(e=>{let t=new URLSearchParams(Array.from(U.entries()));if(e?.versionFromID&&t.set("versionFrom",e?.versionFromID),e?.selectedLocales)if(e.selectedLocales.length){let r=[];for(let t of e.selectedLocales)t.selected&&r.push(t.name);t.set("localeCodes",JSON.stringify(r))}else t.delete("localeCodes");e?.modifiedOnly===!1?t.set("modifiedOnly","false"):e?.modifiedOnly===!0&&t.delete("modifiedOnly");let r=t.toString(),n=r?`?${r}`:"";M(()=>B.push(`${z}${n}`))},[z,B,U,M]),K=(0,i.useCallback)(e=>{let t=e.target.checked;H(t),q({modifiedOnly:t})},[q]),W=(0,i.useCallback)(({locales:e})=>{P(e),q({selectedLocales:e})},[q]),G=(0,i.useCallback)(e=>{q({versionFromID:e.value})},[q]),{localization:Y}=S,Q=(0,i.useMemo)(()=>E("version:versionAgo",{distance:(0,r.formatTimeToNow)({date:h,i18n:k})}),[h,k,E]),X=(0,i.useMemo)(()=>u?E("version:versionAgo",{distance:(0,r.formatTimeToNow)({date:u,i18n:k})}):void 0,[u,k,E]);return(0,t.jsxs)("main",{className:C,children:[(0,t.jsxs)(r.Gutter,{className:`${C}-controls-top`,children:[(0,t.jsxs)("div",{className:`${C}-controls-top__wrapper`,children:[(0,t.jsx)("h2",{children:k.t("version:compareVersions")}),(0,t.jsxs)("div",{className:`${C}-controls-top__wrapper-actions`,children:[(0,t.jsx)("span",{className:`${C}__modifiedCheckBox`,children:(0,t.jsx)(r.CheckboxInput,{checked:V,id:"modifiedOnly",label:k.t("version:modifiedOnly"),onToggle:K})}),Y&&(0,t.jsxs)(r.Pill,{"aria-controls":`${C}-locales`,"aria-expanded":T,className:`${C}__toggle-locales`,icon:(0,t.jsx)(r.ChevronIcon,{direction:T?"up":"down"}),onClick:()=>D(e=>!e),pillStyle:"light",size:"small",children:[(0,t.jsxs)("span",{className:`${C}__toggle-locales-label`,children:[E("general:locales"),":"," "]}),(0,t.jsx)("span",{className:`${C}__toggle-locales-list`,children:N.filter(e=>e.selected).map(e=>e.name).join(", ")})]})]})]}),Y&&(0,t.jsx)(y,{locales:N,localeSelectorOpen:T,onChange:W})]}),(0,t.jsx)(r.Gutter,{className:`${C}-controls-bottom`,children:(0,t.jsxs)("div",{className:`${C}-controls-bottom__wrapper`,children:[(0,t.jsxs)("div",{className:`${C}__version-from`,children:[(0,t.jsxs)("div",{className:`${C}__version-from-labels`,children:[(0,t.jsx)("span",{children:E("version:comparingAgainst")}),X&&(0,t.jsx)("span",{className:`${C}__time-elapsed`,children:X})]}),(0,t.jsx)(b,{collectionSlug:A,docID:R,globalSlug:O,onChange:G,versionFromID:d,versionFromOptions:p})]}),(0,t.jsxs)("div",{className:`${C}__version-to`,children:[(0,t.jsxs)("div",{className:`${C}__version-to-labels`,children:[(0,t.jsx)("span",{children:E("version:currentlyViewing")}),(0,t.jsx)("span",{className:`${C}__time-elapsed`,children:Q})]}),(0,t.jsxs)("div",{className:`${C}__version-to-version`,children:[g,e&&!L&&(0,t.jsx)(f,{className:`${C}__restore`,collectionConfig:I,globalConfig:F,label:I?.labels.singular||F?.label,originalDocID:R,status:j,versionDateFormatted:m,versionID:v})]})]})]})}),(0,t.jsx)(w,{collectionConfig:I,globalConfig:F,id:R,isTrashed:L,versionToCreatedAtFormatted:m,versionToID:v}),(0,t.jsx)(r.Gutter,{className:`${C}__diff-wrap`,children:(0,t.jsx)(x.SelectedLocalesContext,{value:{selectedLocales:N.map(e=>e.name)}
53,children:h&&s})})]})}],276976)},351628,245575,e=>{"use strict";var t=e.i(309442),r=e.i(166535),n=e.i(76795),a=e.i(196244),l=e.i(621151),i=e.i(556529),o=e.i(476781);function s(e,t){return JSON.stringify(e)!==JSON.stringify(t)}function c({baseVersionField:e,config:t,field:r,row:n,valueFromRow:a,valueToRow:l}){let i=[],o=[];if("array"===r.type&&"fields"in r)i=r.fields,o=e.rows?.length?e.rows[n]:e.fields;else if("blocks"===r.type)if(l?.blockType===a?.blockType)i=(t?.blocksMap?.[l?.blockType]??(("blocks"in r||"blockReferences"in r)&&(r.blockReferences??r.blocks)?.find(e=>"string"!=typeof e&&e.slug===l?.blockType)||{fields:[]})).fields,o=e.rows?.length?e.rows[n]:e.fields;else{let s=t?.blocksMap?.[l?.blockType]??(("blocks"in r||"blockReferences"in r)&&(r.blockReferences??r.blocks)?.find(e=>"string"!=typeof e&&e.slug===l?.blockType)||{fields:[]}),c=t?.blocksMap?.[a?.blockType]??(("blocks"in r||"blockReferences"in r)&&(r.blockReferences??r.blocks)?.find(e=>"string"!=typeof e&&e.slug===a?.blockType)||{fields:[]});i=[...new Map([...s.fields,...c.fields].map(e=>[e.name,e])).values()],o=e.rows?.length?e.rows[n]:e.fields}return{fields:i,versionFields:o}}function u({config:e,fields:t,locales:r,parentIsLocalized:n,valueFrom:a,valueTo:l}){let o=0;return t.forEach(t=>{if("name"in t&&"id"===t.name)return;let c=t.type;switch(c){case"array":case"blocks":if(r&&(0,i.fieldShouldBeLocalized)({field:t,parentIsLocalized:n}))r.forEach(i=>{let s=a?.[t.name]?.[i]??[],c=l?.[t.name]?.[i]??[];o+=d({config:e,field:t,locales:r,parentIsLocalized:n||t.localized,valueFromRows:s,valueToRows:c})});else{let i=a?.[t.name]??[],s=l?.[t.name]??[];o+=d({config:e,field:t,locales:r,parentIsLocalized:n||t.localized,valueFromRows:i,valueToRows:s})}break;case"checkbox":case"code":case"date":case"email":case"join":case"json":case"number":case"point":case"radio":case"relationship":case"richText":case"select":case"text":case"textarea":case"upload":r&&(0,i.fieldShouldBeLocalized)({field:t,parentIsLocalized:n})?r.forEach(e=>{s(l?.[t.name]?.[e],a?.[t.name]?.[e])&&o++}):s(l?.[t.name],a?.[t.name])&&o++;break;case"collapsible":case"row":o+=u({config:e,fields:t.fields,locales:r,parentIsLocalized:n||t.localized,valueFrom:a,valueTo:l});break;case"group":(0,i.groupHasName)(t)?r&&(0,i.fieldShouldBeLocalized)({field:t,parentIsLocalized:n})?r.forEach(i=>{o+=u({config:e,fields:t.fields,locales:r,parentIsLocalized:n||t.localized,valueFrom:a?.[t.name]?.[i],valueTo:l?.[t.name]?.[i]})}):o+=u({config:e,fields:t.fields,locales:r,parentIsLocalized:n||t.localized,valueFrom:a?.[t.name],valueTo:l?.[t.name]}):o+=u({config:e,fields:t.fields,locales:r,parentIsLocalized:n||t.localized,valueFrom:a,valueTo:l});break;case"tabs":t.tabs.forEach(t=>{"name"in t&&r&&t.localized?r.forEach(i=>{o+=u({config:e,fields:t.fields,locales:r,parentIsLocalized:n||t.localized,valueFrom:a?.[t.name]?.[i],valueTo:l?.[t.name]?.[i]})}):"name"in t?o+=u({config:e,fields:t.fields,locales:r,parentIsLocalized:n||t.localized,valueFrom:a?.[t.name],valueTo:l?.[t.name]}):o+=u({config:e,fields:t.fields,locales:r,parentIsLocalized:n||t.localized,valueFrom:a,valueTo:l})});break;case"ui":break;default:throw Error(`Unexpected field.type in countChangedFields : ${String(c)}`)}}),o}function d({config:e,field:t,locales:r,parentIsLocalized:n,valueFromRows:a=[],valueToRows:l=[]}){let i=0,o=0;for(;a[o]||l[o];){let s=a?.[o]||{},d=l?.[o]||{},{fields:f}=c({baseVersionField:{type:"text",fields:[],path:"",schemaPath:""},config:e,field:t,row:o,valueFromRow:s,valueToRow:d});i+=u({config:e,fields:f,locales:r,parentIsLocalized:n||t.localized,valueFrom:s,valueTo:d}),o++}return i}e.s(["getFieldsForRowComparison",0,c],245575);let f="diff-collapser";e.s(["DiffCollapser",0,e=>{let s,c=(0,t.c)(19),{children:p,field:h,fields:m,hideGutter:g,initCollapsed:b,isIterable:v,Label:y,locales:x,parentIsLocalized:w,valueFrom:C,valueTo:j}=e,S=void 0!==g&&g,$=void 0!==v&&v,{t:_}=(0,l.useTranslation)(),[k,E]=(0,o.useState)(void 0!==b&&b),{config:N}=(0,a.useConfig)();if(c[0]!==y||c[1]!==p||c[2]!==N||c[3]!==h||c[4]!==m||c[5]!==S||c[6]!==k||c[7]!==$||c[8]!==x||c[9]!==w||c[10]!==_||c[11]!==C||c[12]!==j){let e,t,a;
53if($){if(!(0,i.fieldIsArrayType)(h)&&!(0,i.fieldIsBlockType)(h))throw Error("DiffCollapser: field must be an array or blocks field when isIterable is true");let t=C??[],r=j??[];if(!Array.isArray(t)||!Array.isArray(r))throw Error("DiffCollapser: valueFrom and valueTro must be arrays when isIterable is true");e=d({config:N,field:h,locales:x,parentIsLocalized:w,valueFromRows:t,valueToRows:r})}else e=u({config:N,fields:m,locales:x,parentIsLocalized:w,valueFrom:C,valueTo:j});let l=k&&`${f}__content--is-collapsed`,o=S&&`${f}__content--hide-gutter`;c[14]!==l||c[15]!==o?(t=[`${f}__content`,l,o].filter(Boolean),c[14]=l,c[15]=o,c[16]=t):t=c[16];let g=t.join(" ");c[17]!==k?(a=()=>E(!k),c[17]=k,c[18]=a):a=c[18],s=(0,r.jsxs)("div",{className:f,children:[(0,r.jsxs)(n.FieldDiffLabel,{children:[(0,r.jsxs)("button",{"aria-label":k?"Expand":"Collapse",className:`${f}__toggle-button`,onClick:a,type:"button",children:[(0,r.jsx)("div",{className:`${f}__label`,children:y}),(0,r.jsx)(n.ChevronIcon,{direction:k?"right":"down",size:"small"})]}),e>0&&k&&(0,r.jsx)("span",{className:`${f}__field-change-count`,children:_("version:changedFieldsCount",{count:e})})]}),(0,r.jsx)("div",{className:g,children:p})]}),c[0]=y,c[1]=p,c[2]=N,c[3]=h,c[4]=m,c[5]=S,c[6]=k,c[7]=$,c[8]=x,c[9]=w,c[10]=_,c[11]=C,c[12]=j,c[13]=s}else s=c[13];return s}],351628)},717628,e=>{"use strict";var t=e.i(250558);e.s(["ShimmerEffect",()=>t.f])},640501,e=>{"use strict";var t=e.i(309442),r=e.i(166535),n=e.i(717628),a=e.i(476781);let l="render-field-diffs";function i(e,t){if(e.fieldByLocale){let n=[];for(let[a,i]of Object.entries(e.fieldByLocale))n.push((0,r.jsx)("div",{className:`${l}__locale`,"data-field-path":i.path,"data-locale":a,children:(0,r.jsx)("div",{className:`${l}__locale-value`,children:i.CustomComponent})},[a,t].join("-")));return(0,r.jsx)("div",{className:`${l}__field`,children:n},t)}return e.field?(0,r.jsx)("div",{className:`${l}__field field__${e.field.type}`,"data-field-path":e.field.path,children:e.field.CustomComponent},t):null}e.s(["RenderVersionFieldsToDiff",0,e=>{let o,s,c,u=(0,t.c)(6),{parent:d,versionFields:f}=e,[p,h]=a.default.useState(!1);u[0]===Symbol.for("react.memo_cache_sentinel")?(o=()=>{h(!0)},s=[],u[0]=o,u[1]=s):(o=u[0],s=u[1]),(0,a.useEffect)(o,s);let m=`${l}${void 0!==d&&d?` ${l}--parent`:""}`;return u[2]!==p||u[3]!==m||u[4]!==f?(c=(0,r.jsx)("div",{className:m,children:p?f?.map(i):(0,r.jsx)(a.Fragment,{children:(0,r.jsx)(n.ShimmerEffect,{height:"8rem",width:"100%"})})}),u[2]=p,u[3]=m,u[4]=f,u[5]=c):c=u[5],c}])},471015,e=>{"use strict";var t=e.i(309442),r=e.i(166535),n=e.i(45895),a=e.i(621151);e.i(476781);var l=e.i(126542),i=e.i(351628),o=e.i(640501);e.s(["Collapsible",0,e=>{let s,c=(0,t.c)(8),{baseVersionField:u,comparisonValue:d,field:f,parentIsLocalized:p,versionValue:h}=e,{i18n:m}=(0,a.useTranslation)(),{selectedLocales:g}=(0,l.useSelectedLocales)();return u.fields?.length?(c[0]!==u.fields||c[1]!==f||c[2]!==m||c[3]!==p||c[4]!==g||c[5]!==d||c[6]!==h?(s=(0,r.jsx)("div",{className:"collapsible-diff",children:(0,r.jsx)(i.DiffCollapser,{fields:f.fields,Label:"label"in f&&f.label&&"function"!=typeof f.label&&(0,r.jsx)("span",{children:(0,n.getTranslation)(f.label,m)}),locales:g,parentIsLocalized:p||f.localized,valueFrom:d,valueTo:h,children:(0,r.jsx)(o.RenderVersionFieldsToDiff,{versionFields:u.fields})})}),c[0]=u.fields,c[1]=f,c[2]=m,c[3]=p,c[4]=g,c[5]=d,c[6]=h,c[7]=s):s=c[7],s):null}])},583381,e=>{"use strict";var t=e.i(309442),r=e.i(166535),n=e.i(76795),a=e.i(196244),l=e.i(621151),i=e.i(486766);e.i(476781);let o="date-diff";e.s(["DateDiffComponent",0,e=>{let s,c=(0,t.c)(7),{comparisonValue:u,field:d,locale:f,nestingLevel:p,versionValue:h}=e,{i18n:m}=(0,l.useTranslation)(),{config:g}=(0,a.useConfig)(),{admin:b}=g,{dateFormat:v}=b,y=u?(0,i.formatDate)({date:"string"==typeof u?new Date(u):u,i18n:m,pattern:v}):"",x=h?(0,i.formatDate)({date:"string"==typeof h?new Date(h):h,i18n:m,pattern:v}):"",w=(0,n.escapeDiffHTML)(y),C=(0,n.escapeDiffHTML)(x),j=`<div class="${o}" data-enable-match="true" data-date="${w}"><p>`+w+"</p></div>",S=`<div class="${o}" data-enable-match="true" data-date="${C}"><p>`+C+"</p></div>";if(c[0]!==d.label||c[1]!==m||c[2]!==f||c[3]!==p||c[4]!==j||c[5]!==S){let{From:e,To:t}=(0,n.getHTMLDiffComponents)({fromHTML:j,postProcess:n.unescapeDiffHTML,toHTML:S,tokenizeByCh
53aracter:!1});s=(0,r.jsx)(n.FieldDiffContainer,{className:o,From:e,i18n:m,label:{label:d.label,locale:f},nestingLevel:p,To:t}),c[0]=d.label,c[1]=m,c[2]=f,c[3]=p,c[4]=j,c[5]=S,c[6]=s}else s=c[6];return s}])},412454,e=>{"use strict";var t=e.i(309442),r=e.i(166535),n=e.i(45895),a=e.i(621151);e.i(476781);var l=e.i(126542),i=e.i(351628),o=e.i(640501);let s="group-diff";e.s(["Group",0,e=>{let c,u=(0,t.c)(9),{baseVersionField:d,comparisonValue:f,field:p,locale:h,parentIsLocalized:m,versionValue:g}=e,{i18n:b}=(0,a.useTranslation)(),{selectedLocales:v}=(0,l.useSelectedLocales)();return u[0]!==d.fields||u[1]!==p||u[2]!==b||u[3]!==h||u[4]!==m||u[5]!==v||u[6]!==f||u[7]!==g?(c=(0,r.jsx)("div",{className:s,children:(0,r.jsx)(i.DiffCollapser,{fields:p.fields,Label:"label"in p&&p.label&&"function"!=typeof p.label?(0,r.jsxs)("span",{children:[h&&(0,r.jsx)("span",{className:`${s}__locale-label`,children:h}),(0,n.getTranslation)(p.label,b)]}):(0,r.jsxs)("span",{className:`${s}__locale-label ${s}__locale-label--no-label`,children:["<",b.t("version:noLabelGroup"),">"]}),locales:v,parentIsLocalized:m||p.localized,valueFrom:f,valueTo:g,children:(0,r.jsx)(o.RenderVersionFieldsToDiff,{versionFields:d.fields})})}),u[0]=d.fields,u[1]=p,u[2]=b,u[3]=h,u[4]=m,u[5]=v,u[6]=f,u[7]=g,u[8]=c):c=u[8],c}])},811775,e=>{"use strict";var t=e.i(309442),r=e.i(166535),n=e.i(45895),a=e.i(196244),l=e.i(621151),i=e.i(556529);e.i(476781);var o=e.i(126542),s=e.i(351628),c=e.i(640501),u=e.i(245575);let d="iterable-diff";e.s(["Iterable",0,e=>{let f,p=(0,t.c)(12),{baseVersionField:h,comparisonValue:m,field:g,locale:b,parentIsLocalized:v,versionValue:y}=e,{i18n:x,t:w}=(0,l.useTranslation)(),{selectedLocales:C}=(0,o.useSelectedLocales)(),{config:j}=(0,a.useConfig)();if(!(0,i.fieldIsArrayType)(g)&&!(0,i.fieldIsBlockType)(g))throw Error(`Expected field to be an array or blocks type but got: ${g.type}`);let S=Math.max(Array.isArray(y)?y.length:0,Array.isArray(m)?m.length:0);return p[0]!==h||p[1]!==j||p[2]!==g||p[3]!==x||p[4]!==b||p[5]!==S||p[6]!==v||p[7]!==C||p[8]!==w||p[9]!==m||p[10]!==y?(f=(0,r.jsx)("div",{className:d,children:(0,r.jsxs)(s.DiffCollapser,{field:g,isIterable:!0,Label:"label"in g&&g.label&&"function"!=typeof g.label&&(0,r.jsxs)("span",{children:[b&&(0,r.jsx)("span",{className:`${d}__locale-label`,children:b}),(0,n.getTranslation)(g.label,x)]}),locales:C,parentIsLocalized:v,valueFrom:m,valueTo:y,children:[S>0&&(0,r.jsx)("div",{className:`${d}__rows`,children:Array.from({length:S},(e,t)=>{let n=y?.[t]||{},a=m?.[t]||{},{fields:l,versionFields:o}=(0,u.getFieldsForRowComparison)({baseVersionField:h,config:j,field:g,row:t,valueFromRow:a,valueToRow:n});if(!o?.length)return null;let f=String(t+1).padStart(2,"0"),p=(0,i.fieldIsArrayType)(g)?`${w("general:item")} ${f}`:`${w("fields:block")} ${f}`;return(0,r.jsx)("div",{className:`${d}__row`,children:(0,r.jsx)(s.DiffCollapser,{fields:l,hideGutter:!0,Label:(0,r.jsxs)("div",{className:`${d}-label-container`,children:[(0,r.jsx)("div",{className:`${d}-label-prefix`}),(0,r.jsx)("span",{className:`${d}__label`,children:p})]}),locales:C,parentIsLocalized:v||g.localized,valueFrom:a,valueTo:n,children:(0,r.jsx)(c.RenderVersionFieldsToDiff,{versionFields:o})})},t)})}),0===S&&(0,r.jsx)("div",{className:`${d}__no-rows`,children:x.t("version:noRowsFound",{label:"labels"in g&&g.labels?.plural?(0,n.getTranslation)(g.labels.plural,x):x.t("general:rows")})})]})}),p[0]=h,p[1]=j,p[2]=g,p[3]=x,p[4]=b,p[5]=S,p[6]=v,p[7]=C,p[8]=w,p[9]=m,p[10]=y,p[11]=f):f=p[11],f}])},626123,e=>{"use strict";var t=e.i(166535);e.i(476781);var r=e.i(640501);e.s(["Row",0,({baseVersionField:e})=>(0,t.jsx)("div",{className:"row-diff",children:(0,t.jsx)(r.RenderVersionFieldsToDiff,{versionFields:e.fields})})])},130421,e=>{"use strict";var t=e.i(309442),r=e.i(166535),n=e.i(45895),a=e.i(76795),l=e.i(621151);e.i(476781);let i=(e,t,r)=>r&&Array.isArray(e)?e.map(e=>t.find(t=>("string"==typeof t?t:t.value)===e)||String(e)):t.find(t=>("string"==typeof t?t:t.value)===e)||String(e),o=(e,t)=>{if(Array.isArray(e))return e.map(e=>{if("string"==typeof e)return e;let r=(0,n.getTranslation)(e.label,t);return"string"==typeof r?r:e.value}).join(", ");
53if("string"==typeof e)return e;let r=(0,n.getTranslation)(e.label,t);return"string"==typeof r?r:e.value};e.s(["Select",0,e=>{let n,s=(0,t.c)(7),{comparisonValue:c,field:u,locale:d,nestingLevel:f,versionValue:p}=e,{i18n:h}=(0,l.useTranslation)(),m="options"in u&&u.options,g=void 0!==c?o(i("string"==typeof c?c:JSON.stringify(c),m,u.hasMany),h):"",b=void 0!==p?o(i("string"==typeof p?p:JSON.stringify(p),m,u.hasMany),h):"",v="<p>"+(0,a.escapeDiffHTML)(g)+"</p>",y="<p>"+(0,a.escapeDiffHTML)(b)+"</p>";if(s[0]!==u.label||s[1]!==h||s[2]!==d||s[3]!==f||s[4]!==v||s[5]!==y){let{From:e,To:t}=(0,a.getHTMLDiffComponents)({fromHTML:v,postProcess:a.unescapeDiffHTML,toHTML:y,tokenizeByCharacter:!0});n=(0,r.jsx)(a.FieldDiffContainer,{className:"select-diff",From:e,i18n:h,label:{label:u.label,locale:d},nestingLevel:f,To:t}),s[0]=u.label,s[1]=h,s[2]=d,s[3]=f,s[4]=v,s[5]=y,s[6]=n}else n=s[6];return n}])},462722,e=>{"use strict";var t=e.i(309442),r=e.i(166535),n=e.i(45895),a=e.i(621151);e.i(476781);var l=e.i(126542),i=e.i(351628),o=e.i(640501);let s="tabs-diff",c=e=>{let c,u=(0,t.c)(10),{comparisonValue:d,fieldTab:f,locale:p,parentIsLocalized:h,tab:m,versionValue:g}=e,{i18n:b}=(0,a.useTranslation)(),{selectedLocales:v}=(0,l.useSelectedLocales)();return m.fields?.length?(u[0]!==f.fields||u[1]!==f.localized||u[2]!==b||u[3]!==p||u[4]!==h||u[5]!==v||u[6]!==m||u[7]!==d||u[8]!==g?(c=(0,r.jsx)(i.DiffCollapser,{fields:f.fields,Label:"label"in m&&m.label&&"function"!=typeof m.label&&(0,r.jsxs)("span",{children:[p&&(0,r.jsx)("span",{className:`${s}__locale-label`,children:p}),(0,n.getTranslation)(m.label,b)]}),locales:v,parentIsLocalized:h||f.localized,valueFrom:d,valueTo:g,children:(0,r.jsx)(o.RenderVersionFieldsToDiff,{versionFields:m.fields})}),u[0]=f.fields,u[1]=f.localized,u[2]=b,u[3]=p,u[4]=h,u[5]=v,u[6]=m,u[7]=d,u[8]=g,u[9]=c):c=u[9],c):null};e.s(["Tabs",0,e=>{let n,a=(0,t.c)(13),{baseVersionField:i,comparisonValue:o,field:u,versionValue:d}=e,{selectedLocales:f}=(0,l.useSelectedLocales)();if(a[0]!==i.tabs||a[1]!==u||a[2]!==e||a[3]!==f||a[4]!==o||a[5]!==d){let t;a[7]!==u||a[8]!==e||a[9]!==f||a[10]!==o||a[11]!==d?(t=(t,n)=>{if(!t?.fields?.length)return null;let a=u.tabs?.[n];return a?(0,r.jsx)("div",{className:`${s}__tab`,children:(()=>{if("name"in a&&f&&a.localized)return f.map((n,l)=>{let i={...e,comparisonValue:o?.[t.name]?.[n],fieldTab:a,locale:n,tab:t,versionValue:d?.[t.name]?.[n]};return(0,r.jsx)("div",{className:`${s}__tab-locale`,children:(0,r.jsx)("div",{className:`${s}__tab-locale-value`,children:(0,r.jsx)(c,{...i},n)})},[n,l].join("-"))});if(!("name"in t)||!t.name)return(0,r.jsx)(c,{fieldTab:a,...e,tab:t},n);{let l={...e,comparisonValue:o?.[t.name],fieldTab:a,tab:t,versionValue:d?.[t.name]};return(0,r.jsx)(c,{...l},n)}})()},n):null},a[7]=u,a[8]=e,a[9]=f,a[10]=o,a[11]=d,a[12]=t):t=a[12],n=(0,r.jsx)("div",{className:s,children:i.tabs.map(t)}),a[0]=i.tabs,a[1]=u,a[2]=e,a[3]=f,a[4]=o,a[5]=d,a[6]=n}else n=a[6];return n}])},41090,e=>{"use strict";var t=e.i(309442),r=e.i(166535),n=e.i(76795),a=e.i(621151);function l(e){return"string"==typeof e?{tokenizeByCharacter:!0,value:(0,n.escapeDiffHTML)(e)}:"number"==typeof e?{tokenizeByCharacter:!0,value:String(e)}:"boolean"==typeof e?{tokenizeByCharacter:!1,value:String(e)}:e&&"object"==typeof e?{tokenizeByCharacter:!1,value:`<pre>${(0,n.escapeDiffHTML)(JSON.stringify(e,null,2))}</pre>`}:{tokenizeByCharacter:!0,value:void 0}}e.i(476781),e.s(["Text",0,e=>{let i,o=(0,t.c)(8),{comparisonValue:s,field:c,locale:u,nestingLevel:d,versionValue:f}=e,{i18n:p}=(0,a.useTranslation)(),h="";if(f==s&&(h='<span class="html-diff-no-value"><span>'),o[0]!==c.label||o[1]!==p||o[2]!==u||o[3]!==d||o[4]!==h||o[5]!==s||o[6]!==f){let e=l(s),t=l(f),a=!0;e.value?.length?a=e.tokenizeByCharacter:t.value?.length&&(a=t.tokenizeByCharacter);let m=e.value??h,g=t.value??h,{From:b,To:v}=(0,n.getHTMLDiffComponents)({fromHTML:"<p>"+m+"</p>",postProcess:n.unescapeDiffHTML,toHTML:"<p>"+g+"</p>",tokenizeByCharacter:a});i=(0,r.jsx)(n.FieldDiffContainer,{className:"text-diff",From:b,i18n:p,label:{label:c.label,locale:u},nestingLevel:d,To:v}),o[0]=c.label,o[1]=p,o[2]=u,o[3]=d,o[4]=h,o[5]=s,o[6]=f,o[7]=i}else i=o[7];return i}])},541338,e=>{"use strict";var t=e.i(309442),r=e.i(166535),n=e.i(76795),a=e.i(196244),l=e.i(621151),i=e.i(486766),o=e.i(476781);let s="version-pill-label",c=(e,t)=>(0,r.jsx)(n.Pill,{pillStyle:t,size:"small",children:e});e.s(["VersionPillLabel",0,e=>{let u,d=(0,t.c)(14),{currentlyPublishedVersion:f,disableDate:p,doc:h,labelFirst:m,labelOverride:g,labelStyle:b,labelSuffix:v,latestDraftVersion:y}=e,x=void 0!==p&&p,w=void 0!==m&&m,C=void 0===b?"pill":b,{config:j}=(0,a.useConfig)(),{admin:S,localization:$}=j,{dateFormat:_}=S,{i18n:k,t:E}=(0,l.useTranslation)(),{code:N}=(0,n.useLocale)();if(d[0]!==N||d[1]!==f||d[2]!==_||d[3]!==x||d[4]!==h||d[5]!==k||d[6]!==w||d[7]!==g||d[8]!==C||d[9]!==v||d[10]!==y||d[11]!==$||d[12]!==E){let{label:e,pillStyle:t}=function({currentLocale:e,currentlyPublishedVersion:t,latestDraftVersion:r,t:n,version:a}){let l=a.version._status;if("draft"===l){if(t?.updatedAt>r?.updatedAt)return{name:"draft",label:n("version:draft"),pillStyle:"light"};let e=a.id===r?.id;return{name:e?"currentDraft":"draft",label:n(e?"version:currentDraft":"version:draft"),pillStyle:"light"}}if("published"===l&&a.publishedLocale&&e!==a.publishedLocale)return{name:"currentDraft",label:n("version:currentDraft"),pillStyle:"light"};let i=t&&a.id===t.id;return{name:i?"currentlyPublished":"previouslyPublished",label:n(i?"version:currentlyPublished":"version:previouslyPublished"),pillStyle:i?"success":"light"}}({currentLocale:N,currentlyPublishedVersion:f,latestDraftVersion:y,t:E,version:h}),a=(0,r.jsxs)("span",{children:[g||e,v]}
53),l=!x&&h.updatedAt,p=l?(0,i.formatDate)({date:h.updatedAt,i18n:k,pattern:_}):null,m=Array.isArray(h.publishedLocale)?h.publishedLocale[0]:h.publishedLocale,b=$&&$?.locales?$.locales.find(e=>e.code===m):null,j=b?b?.label?.[k?.language]||b?.label:null;u=(0,r.jsxs)("div",{className:s,children:[w?(0,r.jsxs)(o.default.Fragment,{children:["pill"===C?c(a,t):(0,r.jsx)("span",{className:`${s}-text`,children:a}),l&&(0,r.jsx)("span",{className:`${s}-date`,children:p})]}):(0,r.jsxs)(o.default.Fragment,{children:[l&&(0,r.jsx)("span",{className:`${s}-date`,children:p}),"pill"===C?c(a,t):(0,r.jsx)("span",{className:`${s}-text`,children:a})]}),j&&(0,r.jsx)(n.Pill,{size:"small",children:j})]}),d[0]=N,d[1]=f,d[2]=_,d[3]=x,d[4]=h,d[5]=k,d[6]=w,d[7]=g,d[8]=C,d[9]=v,d[10]=y,d[11]=$,d[12]=E,d[13]=u}else u=d[13];return u}],541338)},946735,e=>{"use strict";var t=e.i(166535),r=e.i(196244),n=e.i(76795),a=e.i(621151),l=e.i(486766),i=e.i(304498);e.s(["VersionDrawerCreatedAtCell",0,e=>{let{rowData:o}=e,{id:s,updatedAt:c}=void 0===o?{}:o,{config:u}=(0,r.useConfig)(),{admin:d}=u,{dateFormat:f}=d,{closeAllModals:p}=(0,n.useModal)(),h=(0,i.useRouter)(),m=(0,i.usePathname)(),g=(0,i.useSearchParams)(),{startRouteTransition:b}=(0,n.useRouteTransition)(),{i18n:v}=(0,a.useTranslation)();return(0,t.jsx)("button",{className:"created-at-cell",onClick:()=>{p();let e=new URLSearchParams(Array.from(g.entries()));s&&e.set("versionFrom",String(s));let t=e.toString(),r=t?`?${t}`:"";b(()=>h.push(`${m}${r}`))},type:"button",children:(0,l.formatDate)({date:c,i18n:v,pattern:f})})}])},756937,e=>{"use strict";var t=e.i(309442),r=e.i(166535),n=e.i(76795),a=e.i(621151);e.i(476781);var l=e.i(541338);e.s(["AutosaveCell",0,e=>{let i,o=(0,t.c)(5),{currentlyPublishedVersion:s,latestDraftVersion:c,rowData:u}=e,{t:d}=(0,a.useTranslation)();return o[0]!==s||o[1]!==c||o[2]!==u||o[3]!==d?(i=(0,r.jsxs)("div",{className:"autosave-cell__items",children:[u?.autosave&&(0,r.jsx)(n.Pill,{size:"small",children:d("version:autosave")}),(0,r.jsx)(l.VersionPillLabel,{currentlyPublishedVersion:s,disableDate:!0,doc:u,labelFirst:!1,labelStyle:"pill",latestDraftVersion:c})]}),o[0]=s,o[1]=c,o[2]=u,o[3]=d,o[4]=i):i=o[4],i}])},937429,e=>{"use strict";var t=e.i(166535),r=e.i(76795),n=e.i(196244),a=e.i(621151),l=e.i(486766),i=e.i(214316);e.i(476781),e.s(["CreatedAtCell",0,e=>{let o,{collectionSlug:s,docID:c,globalSlug:u,isTrashed:d,rowData:f}=e,{id:p,updatedAt:h}=void 0===f?{}:f,{config:m}=(0,n.useConfig)(),{admin:g,routes:b}=m,{dateFormat:v}=g,{admin:y}=b,{i18n:x}=(0,a.useTranslation)();return s&&(o=(0,i.formatAdminURL)({adminRoute:y,path:`/collections/${s}/${d?"trash/":""}${c}/versions/${p}`})),u&&(o=(0,i.formatAdminURL)({adminRoute:y,path:`/globals/${u}/versions/${p}`})),(0,t.jsx)(r.Link,{href:o,prefetch:!1,children:(0,l.formatDate)({date:h,i18n:x,pattern:v})})}])},32001,e=>{"use strict";var t=e.i(166535),r=e.i(476781);e.s(["IDCell",0,function({id:e}){return(0,t.jsx)(r.Fragment,{children:e})}])},267832,e=>{"use strict";var t=e.i(309442),r=e.i(166535),n=e.i(76795),a=e.i(621151),l=e.i(304498),i=e.i(476781);e.s(["VersionsViewClient",0,e=>{let o,s,c=(0,t.c)(13),{baseClass:u,columns:d,paginationLimits:f}=e,{data:p,handlePageChange:h,handlePerPageChange:m}=(0,n.useListQuery)(),g=(0,l.useSearchParams)();c[0]!==g?(o=g.get("limit"),c[0]=g,c[1]=o):o=c[1];let b=o,{i18n:v}=(0,a.useTranslation)(),y=p?.totalDocs||0,x=!p;return c[2]!==u||c[3]!==d||c[4]!==p||c[5]!==h||c[6]!==m||c[7]!==v||c[8]!==b||c[9]!==f||c[10]!==x||c[11]!==y?(s=(0,r.jsxs)(i.default.Fragment,{children:[(0,r.jsx)(n.LoadingOverlayToggle,{name:"versions",show:x}),0===y&&(0,r.jsx)("div",{className:`${u}__no-versions`,children:v.t("version:noFurtherVersionsFound")}),y>0&&(0,r.jsxs)(i.default.Fragment,{children:[(0,r.jsx)(n.Table,{columns:d,data:p?.docs}),(0,r.jsxs)("div",{className:`${u}__page-controls`,children:[(0,r.jsx)(n.Pagination,{hasNextPage:p.hasNextPage,hasPrevPage:p.hasPrevPage,limit:p.limit,nextPage:p.nextPage,numberOfNeighbors:1,onChange:h,page:p.page,prevPage:p.prevPage,totalPages:p.totalPages}),p?.totalDocs>0&&(0,r.jsxs)(i.default.Fragment,{children:[(0,r.jsxs)("div",{className:`${u}__page-info`,children:[p.page*p.limit-(p.limit-1),"-",p.totalPages>1&&p.totalPages!==p.page?p.limit*p.page:p.totalDocs," ",v.t("general:of")," ",p.totalDocs]}),(0,r.jsx)(n.PerPage,{handleChange:m,limit:b?Number(b):10,limits:f})]})]})]})]}),c[2]=u,c[3]=d,c[4]=p,c[5]=h,c[6]=m,c[7]=v,c[8]=b,c[9]=f,c[10]=x,c[11]=y,c[12]=s):s=c[12],s}])},617605,e=>{"use strict";var t=e.i(166535),r=e.i(393095),n=e.i(304498),a=e.i(476781);e.i(309442);let l=a.default.createContext({isTransitioning:!1,startRouteTransition:e=>{"function"==typeof e&&e()},transitionProgress:0}),i=/https?|ftp|gopher|file/;function o(e){return"string"!=typeof e&&("number"!=typeof e||isNaN(e))&&"boolean"!=typeof e?"":String(e)}let s="default"in r.default?r.default.default:r.default;e.s(["Link",0,({children:e,href:r,onClick:c,preventDefault:u=!0,ref:d,replace:f,scroll:p,...h})=>{let m=(0,n.useRouter)(),{startRouteTransition:g}=a.default.use(l);return(0,t.jsx)(s,{href:r,onClick:e=>{let t;if((t=e.currentTarget.getAttribute("target"))&&"_self"!==t||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.nativeEvent&&2===e.nativeEvent.which)return;c&&c(e),u&&e.preventDefault();let n="string"==typeof r?r:function(e){var t;let r,{auth:n}=e,{hostname:a}=e,l=e.protocol||"",s=e.pathname||"",c=e.hash||"",u=e.query||"",d=!1;n=n?encodeURIComponent(n).replace(/%3A/i,":")+"@":"",e.host?d=n+e.host:a&&(d=n+(~a.indexOf(":")?`[${a}]`:a),e.port&&(d+=":"+e.port)),u&&"object"==typeof u&&(u=String((t=u,r=new URLSearchParams,Object.entries(t).forEach(([e,t])=>{Array.isArray(t)?t.forEach(t=>r.append(e,o(t))):r.set(e,o(t))}),r)));let f=e.search||u&&`?${u}`||"";return l&&!l.endsWith(":")&&(l+=":"),e.slashes||(!l||i.test(l))&&!1!==d?(d="//"+(d||""),s&&"/"!==s[0]&&(s="/"+s)):d||(d=""),c&&"#"!==c[0]&&(c="#"+c),f&&"?"!==f[0]&&(f="?"+f),s=s.replace(/[?#]/g,encodeURIComponent),f=f.replace("#","%23"),`${l}${d}${s}${f}${c}`}(r);g(()=>{f?m.replace(n,{scroll:p}):m.push(n,{scroll:p})})},ref:d,...h,children:e})}],617605)},970210,(e,t,r)=>{function n(e,t){"boolean"==typeof t&&(t={forever:t}),this._originalTimeouts=JSON.parse(JSON.stringify(e)),this._timeouts=e,this._options=t||{},this._maxRetryTime=t&&t.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}t.exports=n,n.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)},n.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null},n.prototype.retry=function(e){if(this._timeout&&clearTimeout(this._timeout),!e)return!1;var t=new Date().getTime();if(e&&t-this._operationStart>=this._maxRetryTime)return this._errors.push(e),this._errors.unshift(Error("RetryOperation timeout occurred")),!1;this._errors.push(e);var r=this._timeouts.shift();if(void 0===r)if(!this._cachedTimeouts)return!1;else this._errors.splice(0,this._errors.length-1),r=this._cachedTimeouts.slice(-1);var n=this;return this._timer=setTimeout(function(){n._attempts++,n._operationTimeoutCb&&(n._timeout=setTimeout(function(){n._operationTimeoutCb(n._attempts)},n._operationTimeout),n._options.unref&&n._timeout.unref()),n._fn(n._attempts)},r),this._options.unref&&this._timer.unref(),!0},n.prototype.attempt=function(e,t){this._fn=e,t&&(t.timeout&&(this._operationTimeout=t.timeout),t.cb&&(this._operationTimeoutCb=t.cb));var r=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){r._operationTimeoutCb()},r._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)},n.prototype.try=function(e){console.log("Using RetryOperation.try() is deprecated"),this.attempt(e)},n.prototype.start=function(e){console.log("Using RetryOperation.start() is deprecated"),this.attempt(e)},n.prototype.start=n.prototype.try,n.prototype.errors=function(){return this._errors},n.prototype.attempts=function(){return this._attempts},n.prototype.mainError=function(){if(0===this._errors.length)return null;for(var e={},t=null,r=0,n=0;n<this._errors.length;n++){var a=this._errors[n],l=a.message,i=(e[l]||0)+1;e[l]=i,i>=r&&(t=a,r=i)}return t}},731238,(e,t,r)=>{var n=e.r(970210);r.operation=function(e){return new n(r.timeouts(e),{forever:e&&(e.forever||e.retries===1/0),unref:e&&e.unref,maxRetryTime:e&&e.maxRetryTime})},r.timeouts=function(e){if(e instanceof Array)return[].concat(e);var t={retries:10,factor:2,minTimeout:1e3,maxTimeout:1/0,randomize:!1};for(var r in e)t[r]=e[r];if(t.minTimeout>t.maxTimeout)throw Error("minTimeout is greater than maxTimeout");for(var n=[],a=0;a<t.retries;a++)n.push(this.createTimeout(a,t));return e&&e.forever&&!n.length&&n.push(this.createTimeout(a,t)),n.sort(function(e,t){return e-t}),n},r.createTimeout=function(e,t){var r=Math.round((t.randomize?Math.random()+1:1)*Math.max(t.minTimeout,1)*Math.pow(t.factor,e));return Math.min(r,t.maxTimeout)},r.wrap=function(e,t,n){if(t instanceof Array&&(n=t,t=null),!n)for(var a in n=[],e)"function"==typeof e[a]&&n.push(a);for(var l=0;l<n.length;l++){var i=n[l],o=e[i];e[i]=(function(n){var a=r.operation(t),l=Array.prototype.slice.call(arguments,1
53),i=l.pop();l.push(function(e){a.retry(e)||(e&&(arguments[0]=a.mainError()),i.apply(this,arguments))}),a.attempt(function(){n.apply(e,l)})}).bind(e,o),e[i].options=t}}},629103,(e,t,r)=>{t.exports=e.r(731238)},452172,(e,t,r)=>{var n=e.r(629103);t.exports=function(e,t){return new Promise(function(r,a){var l,i=t||{};function o(e){a(e||Error("Aborted"))}function s(e,t){e.bail?o(e):l.retry(e)?i.onRetry&&i.onRetry(e,t):a(l.mainError())}"randomize"in i||(i.randomize=!0),(l=n.operation(i)).attempt(function(t){var n;try{n=e(o,t)}catch(e){s(e,t);return}Promise.resolve(n).then(r).catch(function(e){s(e,t)})})})}},655263,(e,t,r)=>{"use strict";t.exports=function(e,t){return"string"==typeof e?s(e):"number"==typeof e?o(e,t):null},t.exports.format=o,t.exports.parse=s;var n=/\B(?=(\d{3})+(?!\d))/g,a=/(?:\.0*|(\.[^0]+)0+)$/,l={b:1,kb:1024,mb:1048576,gb:0x40000000,tb:0x10000000000,pb:0x4000000000000},i=/^((-|\+)?(\d+(?:\.\d+)?)) *(kb|mb|gb|tb|pb)$/i;function o(e,t){if(!Number.isFinite(e))return null;var r=Math.abs(e),i=t&&t.thousandsSeparator||"",o=t&&t.unitSeparator||"",s=t&&void 0!==t.decimalPlaces?t.decimalPlaces:2,c=!!(t&&t.fixedDecimals),u=t&&t.unit||"";u&&l[u.toLowerCase()]||(u=r>=l.pb?"PB":r>=l.tb?"TB":r>=l.gb?"GB":r>=l.mb?"MB":r>=l.kb?"KB":"B");var d=(e/l[u.toLowerCase()]).toFixed(s);return c||(d=d.replace(a,"$1")),i&&(d=d.split(".").map(function(e,t){return 0===t?e.replace(n,i):e}).join(".")),d+o+u}function s(e){if("number"==typeof e&&!isNaN(e))return e;if("string"!=typeof e)return null;var t,r=i.exec(e),n="b";return(r?(t=parseFloat(r[1]),n=r[4].toLowerCase()):(t=parseInt(e,10),n="b"),isNaN(t))?null:Math.floor(l[n]*t)}},906202,(e,t,r)=>{t.exports=function(e){return null!=e&&null!=e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}},197232,e=>{"use strict";var t,r,n=e.i(166535),a=e.i(196244),l=e.i(76795),i=e.i(476781);e.i(640550);var o=e.i(6946);let s=globalThis.fetch.bind(globalThis);var c=e.i(452172),u=e.i(655263);let d={toWeb(){throw Error("Vercel Blob: Sorry, we cannot get a Readable stream in this environment. If you see this message please open an issue here: https://github.com/vercel/storage/ with details on your environment.")}};var f=e.i(906202),p=class extends Error{constructor(e){super(`Vercel Blob: ${e}`)}},h=!1;try{((null==(t=o.default.env.DEBUG)?void 0:t.includes("blob"))||(null==(r=o.default.env.NEXT_PUBLIC_DEBUG)?void 0:r.includes("blob")))&&(h=!0)}catch(e){}function m(e,...t){h&&console.debug(`vercel-blob: ${e}`,...t)}var g=class extends p{constructor(){super("Access denied, please provide a valid token for this resource.")}},b=class extends p{constructor(){super("This store does not exist.")}},v=class extends p{constructor(){super("This store has been suspended.")}},y=class extends p{constructor(){super("Unknown error, please visit https://vercel.com/help.")}},x=class extends p{constructor(){super("The requested blob does not exist")}},w=class extends p{constructor(){super("The blob service is currently not available. Please try again.")}},C=class extends p{constructor(e){super(`Too many requests please lower the number of concurrent requests ${e?` - try again in ${e} seconds`:""}.`),this.retryAfter=null!=e?e:0}};async function j(e){var t,r,n;let a,l,i,o;try{let i=await e.json();a=null!=(r=null==(t=i.error)?void 0:t.code)?r:"unknown_error",l=null==(n=i.error)?void 0:n.message}catch{a="unknown_error"}switch(a){case"store_suspended":i=new v;break;case"forbidden":i=new g;break;case"not_found":i=new x;break;case"store_not_found":i=new b;break;case"bad_request":i=new p(null!=l?l:"Bad request");break;case"service_unavailable":i=new w;break;case"rate_limited":i=new C((o=e.headers.get("retry-after"))?parseInt(o,10):void 0);break;default:i=new y}return{code:a,error:i}}async function S(e,t,r){let n=function(){let e=null;try{e=o.default.env.VERCEL_BLOB_API_VERSION_OVERRIDE||o.default.env.NEXT_PUBLIC_VERCEL_BLOB_API_VERSION_OVERRIDE}catch{}return`${null!=e?e:7}`}(),a=function(e){if(null==e?void 0:e.token)return e.token;if(o.default.env.BLOB_READ_WRITE_TOKEN)return o.default.env.BLOB_READ_WRITE_TOKEN;throw new p("No token found. Either configure the `BLOB_READ_WRITE_TOKEN` environment variable, or pass a `token` option to your calls.")}(r),l=await (0,c.default)(async r=>{let l=await s(function(e=""){let t=null;try{t=o.default.env.VERCEL_BLOB_API_URL||o.default.env.NEXT_PUBLIC_VERCEL_BLOB_API_URL}catch{}return`${t||"https://blob.vercel-storage.com"}${e}`}(e),{...t,headers:{"x-api-version":n,authorization:`Bearer ${a}`,...t.headers}});if(l.ok)return l;let{code:i,error:c}=await j(l);if("unknown_error"===i||"service_unavailable"===i)throw c;r(c)},{retries:function(){try{let e=o.default.env.VERCEL_BLOB_RETRIES||"10";return parseInt(e,10)}catch{return 10}}(),onRetry:t=>{m(`retrying API request to ${e}`,t.message)}});if(!l)throw new y;return await l.json()}function $(e,t){let r={};return e.includes("contentType")&&t.contentType&&(r["x-content-type"]=t.contentType),e.includes("addRandomSuffix")&&void 0!==t.addRandomSuffix&&(r["x-add-random-suffix"]=t.addRandomSuffix?"1":"0"),e.includes("cacheControlMa
53xAge")&&void 0!==t.cacheControlMaxAge&&(r["x-cache-control-max-age"]=t.cacheControlMaxAge.toString()),r}async function _({pathname:e,options:t,extraChecks:r,getToken:n}){if(!e)throw new p("pathname is required");if(!t)throw new p("missing options, see usage");if("public"!==t.access)throw new p('access must be "public"');return r&&r(t),n&&(t.token=await n(e,t)),t}async function k({uploadId:e,key:t,pathname:r,parts:n,headers:a,options:l}){try{let i=await S(`/mpu/${r}`,{method:"POST",headers:{...a,"content-type":"application/json","x-mpu-action":"complete","x-mpu-upload-id":e,"x-mpu-key":encodeURI(t)},body:JSON.stringify(n)},l);return m("mpu: complete",i),i}catch(e){if(e instanceof TypeError&&("Failed to fetch"===e.message||"fetch failed"===e.message))throw new w;throw e}}async function E(e,t,r){m("mpu: create","pathname:",e);try{let n=await S(`/mpu/${e}`,{method:"POST",headers:{...t,"x-mpu-action":"create"}},r);return m("mpu: create",n),n}catch(e){if(e instanceof TypeError&&("Failed to fetch"===e.message||"fetch failed"===e.message))throw new w;throw e}}function N({uploadId:e,key:t,pathname:r,headers:n,options:a,abortController:l,part:i}){return S(`/mpu/${r}`,{signal:null==l?void 0:l.signal,method:"POST",headers:{...n,"x-mpu-action":"upload","x-mpu-key":encodeURI(t),"x-mpu-upload-id":e,"x-mpu-part-number":i.partNumber.toString()},body:i.blob,duplex:"half"},a)}var P="u">typeof window?6:8,T=8388608*P*2;async function D(e,t,r,n){var a,l,i;let o;m("mpu: init","pathname:",e,"headers:",r);let s=t instanceof ReadableStream?t:t instanceof Blob?t.stream():"object"==typeof(a=t)&&"function"==typeof a.pipe&&a.readable&&"function"==typeof a._read&&"object"==typeof a._readableState?d.toWeb(t):(o=t instanceof ArrayBuffer?t:(l=t,(0,f.default)(l))?t.buffer:(i=t,new TextEncoder().encode(i)),new ReadableStream({start(e){e.enqueue(o),e.close()}})),c=await E(e,r,n),p=await function({uploadId:e,key:t,pathname:r,stream:n,headers:a,options:l}){m("mpu: upload init","key:",t);let i=new AbortController;return new Promise((o,s)=>{let c=[],d=[],f=n.getReader(),p=0,h=!1,g=1,b=!1,v=0,y=!1,x=0,C=[],j=0;async function S(){for(m("mpu: upload read start","activeUploads:",p,"currentBytesInMemory:",`${(0,u.default)(v)}/${(0,u.default)(T)}`,"bytesSent:",(0,u.default)(x)),h=!0;v<T&&!b;)try{let{value:e,done:t}=await f.read();if(t){y=!0,m("mpu: upload read consumed the whole stream"),C.length>0&&(c.push({partNumber:g++,blob:new Blob(C,{type:"application/octet-stream"})}),_()),h=!1;return}v+=e.byteLength;let r=0;for(;r<e.byteLength;){let t=8388608-j,n=Math.min(r+t,e.byteLength),a=e.slice(r,n);C.push(a),j+=a.byteLength,r=n,8388608===j&&(c.push({partNumber:g++,blob:new Blob(C,{type:"application/octet-stream"})}),C=[],j=0,_())}}catch(e){k(e)}m("mpu: upload read end","activeUploads:",p,"currentBytesInMemory:",`${(0,u.default)(v)}/${(0,u.default)(T)}`,"bytesSent:",(0,u.default)(x)),h=!1}async function $(n){p++,m("mpu: upload send part start","partNumber:",n.partNumber,"size:",n.blob.size,"activeUploads:",p,"currentBytesInMemory:",`${(0,u.default)(v)}/${(0,u.default)(T)}`,"bytesSent:",(0,u.default)(x));try{let s=await N({uploadId:e,key:t,pathname:r,headers:a,options:l,abortController:i,part:n});if(m("mpu: upload send part end","partNumber:",n.partNumber,"activeUploads",p,"currentBytesInMemory:",`${(0,u.default)(v)}/${(0,u.default)(T)}`,"bytesSent:",(0,u.default)(x)),b)return;if(d.push({partNumber:n.partNumber,etag:s.etag}),v-=n.blob.size,p--,x+=n.blob.size,c.length>0&&_(),y){0===p&&(f.releaseLock(),o(d));return}h||S().catch(k)}catch(e){k(e)}}function _(){if(!b)for(m("send parts","activeUploads",p,"partsToUpload",c.length);p<P&&c.length>0;){let e=c.shift();e&&$(e)}}function k(e){b||(b=!0,i.abort(),f.releaseLock(),e instanceof TypeError&&("Failed to fetch"===e.message||"fetch failed"===e.message)?s(new w):s(e))}S().catch(k)})}({uploadId:c.uploadId,key:c.key,pathname:e,stream:s,headers:r,options:n});return await k({uploadId:c.uploadId,key:c.key,pathname:e,parts:p,headers:r,options:n})}function R({allowedOptions:e,getToken:t,extraChecks:r}){return async function(n,a,l){let i=n.endsWith("/");if(!a&&!i)throw new p("body is required");if(a&&l&&i)throw new p("body is not allowed for creating empty folders");let o=i?void 0:a,s=await _({pathname:n,options:i?a:l,extraChecks:r,getToken:t}),c=$(e,s);if(!0===s.multipart&&o)return D(n,o,c,s);let u=await S(`/${n}`,{method:"PUT",body:o,headers:c,duplex:"half"},s);return{url:u.url,downloadUrl:u.downloadUrl,pathname:u.pathname,contentType:u.contentType,contentDisposition:u.contentDisposition}}}function A(e){return function(t){if("u"<typeof window)throw new p(`${e} must be called from a client environment`);if(!t.token.startsWith("vercel_blob_client_"))throw new p(`${e} must be called with a client token`);
53if(void 0!==t.addRandomSuffix||void 0!==t.cacheControlMaxAge)throw new p(`${e} doesn't allow addRandomSuffix and cacheControlMaxAge. Configure these options at the server side when generating client tokens.`)}}R({allowedOptions:["contentType"],extraChecks:A("client/`put`")}),function({allowedOptions:e,getToken:t,extraChecks:r}){}({allowedOptions:["contentType"],extraChecks:A("client/`createMultipartUpload`")}),function({allowedOptions:e,getToken:t,extraChecks:r}){}({allowedOptions:["contentType"],extraChecks:A("client/`createMultipartUpload`")}),function({allowedOptions:e,getToken:t,extraChecks:r}){}({allowedOptions:["contentType"],extraChecks:A("client/`multipartUpload`")}),function({allowedOptions:e,getToken:t,extraChecks:r}){}({allowedOptions:["contentType"],extraChecks:A("client/`completeMultipartUpload`")});var O=R({allowedOptions:["contentType"],extraChecks(e){if("u"<typeof window)throw new p("client/`upload` must be called from a client environment");if(void 0===e.handleUploadUrl)throw new p("client/`upload` requires the 'handleUploadUrl' parameter");if(void 0!==e.addRandomSuffix||void 0!==e.cacheControlMaxAge)throw new p("client/`upload` doesn't allow addRandomSuffix and cacheControlMaxAge. Configure these options at the server side when generating client tokens.")},async getToken(e,t){var r,n;return L({handleUploadUrl:t.handleUploadUrl,pathname:e,clientPayload:null!=(r=t.clientPayload)?r:null,multipart:null!=(n=t.multipart)&&n})}});async function L(e){let{handleUploadUrl:t,pathname:r}=e,n=!function(e){try{return new URL(e),!0}catch(e){return!1}}(t)?new URL(t,window.location.href).href:t,a={type:"blob.generate-client-token",payload:{pathname:r,callbackUrl:n,clientPayload:e.clientPayload,multipart:e.multipart}},l=await s(n,{method:"POST",body:JSON.stringify(a),headers:{"content-type":"application/json"}});if(!l.ok)throw new p("Failed to  retrieve the client token");try{let{clientToken:e}=await l.json();return e}catch(e){throw new p("Failed to retrieve the client token")}}var M=e.i(214316);let I=(({handler:e})=>function({children:t,collectionSlug:r,enabled:o,extra:s,prefix:c,serverHandlerPath:u}){let{setUploadHandler:d}=(0,l.useUploadHandlers)(),{config:{routes:{api:f},serverURL:p}}=(0,a.useConfig)(),h=(0,l.useEffectEvent)(()=>{o&&d({collectionSlug:r,handler:({file:t,updateFilename:n})=>e({apiRoute:f,collectionSlug:r,extra:s,file:t,prefix:c,serverHandlerPath:u,serverURL:p,updateFilename:n})})});return(0,i.useEffect)(()=>{h()},[]),(0,n.jsx)(i.Fragment,{children:t})})({handler:async({apiRoute:e,collectionSlug:t,extra:{addRandomSuffix:r,baseURL:n,prefix:a=""},file:l,serverHandlerPath:i,serverURL:o,updateFilename:s})=>{let c=(0,M.formatAdminURL)({apiRoute:e,path:i,serverURL:o}),u=await O(`${a}${l.name}`,l,{access:"public",clientPayload:t,contentType:l.type,handleUploadUrl:c});return r&&s(u.url.replace(`${n}/`,"")),{prefix:a}}});e.s(["VercelBlobClientUploadHandler",0,I],197232)},883795,e=>{"use strict";var t=e.i(166535),r=e.i(476781),n=e.i(309442);e.s(["Tooltip",0,e=>{let{alignCaret:a="center",boundingRef:l,children:i,className:o,delay:s=350,position:c,show:u=!0,staticPositioning:d=!1}=e,[f,p]=r.default.useState(u),[h,m]=r.default.useState("top"),[g,b]=((e,t)=>{let a,l,i,o=(0,n.c)(8),{root:s,rootMargin:c,threshold:u}=void 0===e?{}:e,[d,f]=(0,r.useState)(),[p,h]=(0,r.useState)(null),m=(0,r.useRef)("u">typeof window&&"IntersectionObserver"in window&&!t?new window.IntersectionObserver(e=>{let[t]=e;return f(t)},{root:void 0===s?null:s,rootMargin:void 0===c?"0px":c,threshold:void 0===u?0:u}):null);return o[0]!==t||o[1]!==p?(a=()=>{if(t)return;let{current:e}=m;return e.disconnect(),p&&e.observe(p),()=>e.disconnect()},l=[p,t],o[0]=t,o[1]=p,o[2]=a,o[3]=l):(a=o[2],l=o[3]),(0,r.useEffect)(a,l),o[4]!==d||o[5]!==p||o[6]!==h?(i=[h,d,p],o[4]=d,o[5]=p,o[6]=h,o[7]=i):i=o[7],i})({root:l?.current||null,rootMargin:"-145px 0px 0px 100px",threshold:0},d);return(0,r.useEffect)(()=>{let e;return s&&u?e=setTimeout(()=>{p(u)},s):p(u),()=>{e&&clearTimeout(e)}},[u,s]),(0,r.useEffect)(()=>{d||m(b?.isIntersecting?"top":"bottom")},[b,d]),(0,t.jsxs)(r.default.Fragment,{children:[!d&&(0,t.jsx)("aside",{"aria-hidden":"true",className:["tooltip",o,`tooltip--caret-${a}
53`,"tooltip--position-top"].filter(Boolean).join(" "),ref:g,style:{opacity:"0"},children:(0,t.jsx)("div",{className:"tooltip-content",children:i})}),(0,t.jsx)("aside",{className:["tooltip",o,f&&"tooltip--show",`tooltip--caret-${a}`,`tooltip--position-${c||h}`].filter(Boolean).join(" "),title:"string"==typeof i?i:"",children:(0,t.jsx)("div",{className:"tooltip-content",children:i})})]})}],883795)},901980,e=>{"use strict";var t=e.i(166535),r=e.i(476781);let n=({ariaLabel:e,className:r,direction:n,size:a})=>(0,t.jsx)("svg",{"aria-label":e,className:["icon icon--chevron",r,a&&`icon--size-${a}`].filter(Boolean).join(" "),height:"100%",style:{transform:"left"===n?"rotate(90deg)":"right"===n?"rotate(-90deg)":"up"===n?"rotate(180deg)":void 0},viewBox:"0 0 20 20",width:"100%",xmlns:"http://www.w3.org/2000/svg",children:(0,t.jsx)("path",{className:"stroke",d:"M14 8L10 12L6 8",strokeLinecap:"square"})});var a=e.i(617605),l=e.i(863218);let i="useEffectEvent"in r.default&&"function"==typeof r.default.useEffectEvent?r.default.useEffectEvent:e=>{let t=(0,r.useRef)(e);return(0,r.useInsertionEffect)(()=>{t.current=e},[e]),(0,r.useCallback)((...e)=>(0,t.current)(...e),[])},o="popup-button",s=e=>{let{active:r,button:n,buttonType:a,className:l,disabled:i,noBackground:s,setActive:c,size:u}=e,d=[o,l,`${o}--${a}`,!s&&`${o}--background`,u&&`${o}--size-${u}`,i&&`${o}--disabled`].filter(Boolean).join(" "),f=()=>{c(!r,!1)},p=e=>{("Enter"===e.key||" "===e.key)&&(e.preventDefault(),c(!r,!0))};return"none"===a?null:"custom"===a?(0,t.jsx)("div",{className:d,onClick:f,onKeyDown:p,role:"button",tabIndex:0,children:n}):(0,t.jsx)("button",{className:d,disabled:i,onClick:f,onKeyDown:p,tabIndex:0,type:"button",children:n})},c="popup",u=["a[href]","button:not(:disabled)",'input:not(:disabled):not([type="hidden"])',"select:not(:disabled)","textarea:not(:disabled)","[tabindex]",'[contenteditable]:not([contenteditable="false"])',"audio[controls]","video[controls]","summary"].map(e=>`${e}:not([tabindex="-1"])`).join(", "),d=e=>{let{id:n,button:a,buttonClassName:o,buttonSize:d,buttonType:f="default",caret:p=!0,children:h,className:m,disabled:g,forceOpen:b,horizontalAlign:v="left",initActive:y=!1,noBackground:x,onToggleClose:w,onToggleOpen:C,portalClassName:j,render:S,showOnHover:$=!1,showScrollbar:_=!1,size:k="medium",verticalAlign:E="bottom"}=e,N=(0,r.useRef)(null),P=(0,r.useRef)(null),T=(0,r.useRef)(!1),[D,R]=(0,r.useState)(!1),[A,O]=(0,r.useState)(y),[L,M]=(0,r.useState)("top"===E);(0,r.useEffect)(()=>{R(!0)},[]);let I=(0,r.useCallback)((e,t=!1)=>{e?(T.current=t,C?.(!0)):w?.(),O(e)},[w,C]),F=i(()=>{let e,t=P.current,r=N.current;if(!t||!r)return;let n=t.getBoundingClientRect(),a=r.getBoundingClientRect(),l="top"===E;"bottom"===E?(e=n.bottom+window.scrollY+10,n.bottom+a.height+10>window.innerHeight&&(e=n.top+window.scrollY-a.height-10,l=!0)):(e=n.top+window.scrollY-a.height-10,n.top-a.height-10<0&&(e=n.bottom+window.scrollY+10,l=!1)),M(l);let i="right"===v?n.right-a.width:"center"===v?n.left+n.width/2-a.width/2:n.left;i=Math.max(10,Math.min(i,window.innerWidth-a.width-10));let o=Math.max(12,Math.min(n.left+n.width/2-i,a.width-12)),s=`${Math.round(e)}px`,c=`${Math.round(i+window.scrollX)}px`,u=`${Math.round(o)}px`;r.style.top!==s&&(r.style.top=s),r.style.left!==c&&(r.style.left=c),r.style.getPropertyValue("--caret-left")!==u&&r.style.setProperty("--caret-left",u)}),B=i(e=>{let t=!N.current?.contains(e.target),r=!P.current?.contains(e.target);t&&r&&I(!1)}),z=i(e=>{let t=N.current;if(t&&A){if("Escape"===e.key){e.preventDefault(),I(!1),P.current?.querySelector('button, [tabindex="0"]')?.focus();return}if("Tab"===e.key||"ArrowDown"===e.key||"ArrowUp"===e.key){let r,n=Array.from(t.querySelectorAll(u));if(0===n.length)return;e.preventDefault();let a=n.findIndex(e=>e===document.activeElement),l="ArrowUp"===e.key||"Tab"===e.key&&e.shiftKey;r=-1===a?l?n.length-1:0:l?0===a?n.length-1:a-1:a===n.length-1?0:a+1,n[r].focus()}}}),U=i(e=>{let t=e.target;if(t.closest("[data-popup-prevent-close]"))return;let r=t.closest('button, a[href], [role="button"], [role="menuitem"]');r&&N.current?.contains(r)&&I(!1)});(0,r.useEffect)(()=>
53{if(!A)return;let e=N.current;if(e)return F(),T.current&&requestAnimationFrame(()=>{let t=e.querySelector(u);t?.focus()}),window.addEventListener("resize",F),window.addEventListener("scroll",F,{capture:!0,passive:!0}),document.addEventListener("mousedown",B),document.addEventListener("keydown",z),e.addEventListener("click",U),()=>{window.removeEventListener("resize",F),window.removeEventListener("scroll",F,{capture:!0}),document.removeEventListener("mousedown",B),document.removeEventListener("keydown",z),e.removeEventListener("click",U)}},[A]),(0,r.useEffect)(()=>{void 0!==b&&I(b)},[b,I]);let V=(0,t.jsx)(s,{active:A,button:a,buttonType:f,className:o,disabled:g,noBackground:x,setActive:I,size:d});return(0,t.jsxs)("div",{className:[c,m].filter(Boolean).join(" "),id:n,children:[(0,t.jsx)("div",{className:`${c}__trigger-wrap`,ref:P,children:$?(0,t.jsx)("div",{className:`${c}__on-hover-watch`,onMouseEnter:()=>I(!0),onMouseLeave:()=>I(!1),role:"button",tabIndex:0,children:V}):V}),D?(0,l.createPortal)((0,t.jsxs)("div",{className:A?[`${c}__content`,`${c}--size-${k}`,L?`${c}--v-top`:`${c}--v-bottom`,j].filter(Boolean).join(" "):`${c}__hidden-content`,"data-popup-id":n||void 0,ref:N,children:[(0,t.jsxs)("div",{className:`${c}__scroll-container${_?` ${c}__scroll-container--show-scrollbar`:""}`,children:[S?.({close:()=>I(!1)}),h]}),p&&(0,t.jsx)("div",{className:`${c}__caret`})]}),document.body):null]})};var f=e.i(883795);let p={chevron:n,edit:({className:e})=>(0,t.jsx)("svg",{className:[e,"icon icon--edit"].filter(Boolean).join(" "),viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:(0,t.jsx)("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"})}),link:()=>(0,t.jsx)("svg",{"aria-hidden":"true",className:"graphic link icon icon--link",fill:"none",focu
53sable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,t.jsx)("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"})}),plus:()=>(0,t.jsx)("svg",{className:"icon icon--plus",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:(0,t.jsx)("path",{className:"stroke",d:"M5.33333 9.99998H14.6667M9.99999 5.33331V14.6666",strokeLinecap:"square"})}),swap:()=>(0,t.jsx)("svg",{className:"icon icon--swap",viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",children:(0,t.jsx)("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"})}),x:({className:e})=>(0,t.jsx)("svg",{className:[e,"icon icon--x"].filter(Boolean).join(" "),height:20,viewBox:"0 0 20 20",width:20,xmlns:"http://www.w3.org/2000/svg",children:(0,t.jsx)("path",{className:"stroke",d:"M14 6L6 14M6 6L14 14",strokeLinecap:"square"})})},h=({children:e,icon:n,showTooltip:a,tooltip:l})=>{let i=p[n];return(0,t.jsxs)(r.Fragment,{children:[l&&(0,t.jsx)(f.Tooltip,{className:"btn__tooltip",show:a,children:l}),(0,t.jsxs)("span",{className:"btn__content",children:[e&&(0,t.jsx)("span",{className:"btn__label",children:e}),n&&(0,t.jsxs)("span",{className:"btn__icon",children:[(0,r.isValidElement)(n)&&n,i&&(0,t.jsx)(i,{})]})]})]})};e.s(["Button",0,e=>{let l,{id:i,type:o="button","aria-label":s,buttonStyle:c="primary",children:u,className:f,disabled:p,el:m="button",enableSubMenu:g,extraButtonProps:b={},icon:v,iconPosition:y="right",iconStyle:x="without-border",margin:w=!0,newTab:C,onClick:j,onMouseDown:S,ref:$,round:_,size:k="medium",SubMenuPopupContent:E,to:N,tooltip:P,url:T}=e,[D,R]=r.default.useState(!1),A=["btn",f&&f,v&&"btn--icon",x&&`btn--icon-style-${x}`,v&&!u&&"btn--icon-only",k&&`btn--size-${k}`,v&&y&&`btn--icon-position-${y}`,P&&"btn--has-tooltip",!E&&"btn--withoutPopup",!w&&"btn--no-margin"].filter(Boolean).join(" "),O=[c&&`btn--style-${c}`,p&&"btn--disabled",_&&"btn--round",E?"btn--withPopup":"btn--withoutPopup"].filter(Boolean).join(" "),L={id:i,type:o,"aria-disabled":p,"aria-label":s,className:E?A:[A,O].join(" "),disabled:p,onClick:p?void 0:function(e){R(!1),"submit"!==o&&j&&e.preventDefault(),j&&j(e)},onMouseDown:p?void 0:S,onPointerEnter:P?()=>R(!0):void 0,onPointerLeave:P?()=>R(!1):void 0,rel:C?"noopener noreferrer":void 0,target:C?"_blank":void 0,title:s,...b};switch(m){case"anchor":l=(0,t.jsx)("a",{...L,href:p?void 0:T,ref:$,children:(0,t.jsx)(h,{icon:v,showTooltip:D,tooltip:P,children:u})});break;case"link":p&&(l=(0,t.jsx)("div",{...L,children:(0,t.jsx)(h,{icon:v,showTooltip:D,tooltip:P,children:u})})),l=(0,t.jsx)(a.Link,{...L,href:N||T,prefetch:!1,children:(0,t.jsx)(h,{icon:v,showTooltip:D,tooltip:P,children:u})});break;default:l=(0,t.jsx)(m,{ref:$,...L,children:(0,t.jsx)(h,{icon:v,showTooltip:D,tooltip:P,children:u})})}return E?(0,t.jsxs)("div",{className:O,children:[l,(0,t.jsx)(d,{button:(0,t.jsx)(n,{}),buttonSize:k,className:p&&!g?"btn--popup-disabled":"",disabled:p&&!g,horizontalAlign:"right",id:`${i}-popup`,noBackground:!0,render:({close:e})=>E({close:()=>e()}),size:"large",verticalAlign:"bottom"})]}):l},"ButtonContents",0,h],901980)},485710,e=>{"use strict";var t=e.i(166535);e.i(476781);var r=e.i(901980);let n="card";e.s(["Card",0,e=>{let{id:a,actions:l,buttonAriaLabel:i,href:o,onClick:s,title:c,titleAs:u}=e,d=[n,a,(s||o)&&`${n}--has-onclick`].filter(Boolean).join(" ");return(0,t.jsxs)("div",{className:d,id:a,children:[(0,t.jsx)(u??"div",{className:`${n}__title`,children:c}),l&&(0,t.jsx)("div",{className:`${n}__actions`,children:l}),(s||o)&&(0,t.jsx)(r.Button,{"aria-label":i,buttonStyle:"none",className:`${n}__click`,el:"link",onClick:s,to:o})]})}])},209203,e=>{"use strict";var t=e.i(309442),r=e.i(166535),n=e.i(476781);let a=({className:e})=>
53(0,r.jsxs)("svg",{className:["icon icon--lock",e].filter(Boolean).join(" "),fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[(0,r.jsx)("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"}),(0,r.jsx)("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"})]});e.i(618656),e.i(476715);var l=e.i(244874);e.i(304498);let i=(0,n.createContext)({i18n:{dateFNS:l.enUS,dateFNSKey:"en-US",fallbackLanguage:"en",language:"en",t:e=>e,translations:{}},languageOptions:void 0,switchLanguage:void 0,t:e=>void 0});var o=e.i(883795);let s="locked";e.s(["Locked",0,e=>{let l,c,u,d,f=(0,t.c)(8),{className:p,user:h}=e,[m,g]=(0,n.useState)(!1),{t:b}=(0,n.use)(i),v=h&&"object"==typeof h?h.email??h.id:b("general:anotherUser");f[0]!==p?(l=[s,p].filter(Boolean),f[0]=p,f[1]=l):l=f[1];let y=l.join(" ");f[2]===Symbol.for("react.memo_cache_sentinel")?(c=()=>g(!0),u=()=>g(!1),f[2]=c,f[3]=u):(c=f[2],u=f[3]);let x=`${v} ${b("general:isEditing")}`;return f[4]!==m||f[5]!==y||f[6]!==x?(d=(0,r.jsxs)("div",{className:y,onMouseEnter:c,onMouseLeave:u,role:"button",tabIndex:0,children:[(0,r.jsx)(o.Tooltip,{alignCaret:"left",className:`${s}__tooltip`,position:"top",show:m,children:x}),(0,r.jsx)(a,{})]}),f[4]=m,f[5]=y,f[6]=x,f[7]=d):d=f[7],d}],209203)}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.